summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs')
-rw-r--r--TAO/orbsvcs/Concurrency_Service/.cvsignore1
-rw-r--r--TAO/orbsvcs/Concurrency_Service/Concurrency_Service.cpp252
-rw-r--r--TAO/orbsvcs/Concurrency_Service/Concurrency_Service.h103
-rw-r--r--TAO/orbsvcs/Concurrency_Service/Concurrency_Service.mpc6
-rw-r--r--TAO/orbsvcs/Concurrency_Service/Makefile.am51
-rw-r--r--TAO/orbsvcs/Concurrency_Service/README129
-rw-r--r--TAO/orbsvcs/Concurrency_Service/svc.conf4
-rw-r--r--TAO/orbsvcs/Concurrency_Service/svc.conf.xml8
-rw-r--r--TAO/orbsvcs/CosEvent_Service/.cvsignore1
-rw-r--r--TAO/orbsvcs/CosEvent_Service/CosEvent_Service.cpp75
-rw-r--r--TAO/orbsvcs/CosEvent_Service/CosEvent_Service.mpc6
-rw-r--r--TAO/orbsvcs/CosEvent_Service/Makefile.am63
-rw-r--r--TAO/orbsvcs/CosEvent_Service/README101
-rw-r--r--TAO/orbsvcs/Dump_Schedule/.cvsignore1
-rw-r--r--TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp78
-rw-r--r--TAO/orbsvcs/Dump_Schedule/Dump_Schedule.mpc6
-rw-r--r--TAO/orbsvcs/Dump_Schedule/Makefile.am47
-rw-r--r--TAO/orbsvcs/Event_Service/.cvsignore1
-rw-r--r--TAO/orbsvcs/Event_Service/Event_Service.cpp469
-rw-r--r--TAO/orbsvcs/Event_Service/Event_Service.h104
-rw-r--r--TAO/orbsvcs/Event_Service/Event_Service.mpc6
-rw-r--r--TAO/orbsvcs/Event_Service/Makefile.am63
-rw-r--r--TAO/orbsvcs/Event_Service/svc.conf2
-rw-r--r--TAO/orbsvcs/Event_Service/svc.conf.xml6
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Event_Service/.cvsignore1
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Event_Service/FTRT_Event_Service.mpc7
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Event_Service/FT_EventService.cpp306
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Event_Service/FT_EventService.h54
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Event_Service/Makefile.am74
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Event_Service/TP_Task.h38
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Event_Service/svc.conf22
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Factory_Service/.cvsignore1
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp203
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.h65
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Factory_Service/FTRTEC_Factory_Service.cpp156
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Factory_Service/FTRTEC_Factory_Service.mpc8
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Factory_Service/Makefile.am75
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Factory_Service/factory.cfg2
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/.cvsignore1
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/FTRTEC_Gateway_Service.cpp136
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/FTRTEC_Gateway_Service.mpc12
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/Makefile.am74
-rw-r--r--TAO/orbsvcs/FTRT_Event_Service/Makefile.am15
-rwxr-xr-xTAO/orbsvcs/FTRT_Event_Service/NameService17
-rwxr-xr-xTAO/orbsvcs/FTRT_Event_Service/consumer22
-rwxr-xr-xTAO/orbsvcs/FTRT_Event_Service/ftec25
-rwxr-xr-xTAO/orbsvcs/FTRT_Event_Service/supplier23
-rw-r--r--TAO/orbsvcs/FT_ReplicationManager/.cvsignore1
-rwxr-xr-xTAO/orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.cpp174
-rwxr-xr-xTAO/orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.h90
-rwxr-xr-xTAO/orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.cpp32
-rwxr-xr-xTAO/orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.h89
-rwxr-xr-xTAO/orbsvcs/FT_ReplicationManager/FT_FaultConsumer.cpp303
-rwxr-xr-xTAO/orbsvcs/FT_ReplicationManager/FT_FaultConsumer.h170
-rwxr-xr-xTAO/orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.cpp96
-rwxr-xr-xTAO/orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.h80
-rw-r--r--TAO/orbsvcs/FT_ReplicationManager/FT_Property_Validator.cpp246
-rw-r--r--TAO/orbsvcs/FT_ReplicationManager/FT_Property_Validator.h97
-rw-r--r--TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp1097
-rw-r--r--TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.h527
-rw-r--r--TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.mpc25
-rwxr-xr-xTAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.cpp1118
-rwxr-xr-xTAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.h200
-rw-r--r--TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerLib_export.h60
-rw-r--r--TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager_Main.cpp24
-rw-r--r--TAO/orbsvcs/FT_ReplicationManager/Makefile.am119
-rw-r--r--TAO/orbsvcs/FT_ReplicationManager/README12
-rw-r--r--TAO/orbsvcs/Fault_Detector/.cvsignore1
-rw-r--r--TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.cpp714
-rw-r--r--TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.h346
-rw-r--r--TAO/orbsvcs/Fault_Detector/Fault_Detector.mpc10
-rw-r--r--TAO/orbsvcs/Fault_Detector/Fault_Detector_Main.cpp25
-rw-r--r--TAO/orbsvcs/Fault_Detector/Fault_Detector_i.cpp206
-rw-r--r--TAO/orbsvcs/Fault_Detector/Fault_Detector_i.h183
-rw-r--r--TAO/orbsvcs/Fault_Detector/Makefile.am75
-rw-r--r--TAO/orbsvcs/Fault_Notifier/.cvsignore5
-rw-r--r--TAO/orbsvcs/Fault_Notifier/FT_Notifier_i.cpp774
-rw-r--r--TAO/orbsvcs/Fault_Notifier/FT_Notifier_i.h272
-rw-r--r--TAO/orbsvcs/Fault_Notifier/Fault_Notifier.mpc8
-rw-r--r--TAO/orbsvcs/Fault_Notifier/Fault_Notifier_Main.cpp25
-rw-r--r--TAO/orbsvcs/Fault_Notifier/Makefile.am79
-rw-r--r--TAO/orbsvcs/IFR_Service/.cvsignore2
-rw-r--r--TAO/orbsvcs/IFR_Service/IFR_Server.cpp52
-rw-r--r--TAO/orbsvcs/IFR_Service/IFR_Service.cpp88
-rw-r--r--TAO/orbsvcs/IFR_Service/IFR_Service.h66
-rw-r--r--TAO/orbsvcs/IFR_Service/IFR_Service.mpc76
-rw-r--r--TAO/orbsvcs/IFR_Service/Makefile.am134
-rw-r--r--TAO/orbsvcs/IFR_Service/README80
-rw-r--r--TAO/orbsvcs/IFR_Service/TAO_IFR_BE_Export.h40
-rw-r--r--TAO/orbsvcs/IFR_Service/be_extern.h86
-rw-r--r--TAO/orbsvcs/IFR_Service/be_global.cpp245
-rw-r--r--TAO/orbsvcs/IFR_Service/be_global.h137
-rw-r--r--TAO/orbsvcs/IFR_Service/be_init.cpp126
-rw-r--r--TAO/orbsvcs/IFR_Service/be_produce.cpp250
-rw-r--r--TAO/orbsvcs/IFR_Service/drv_args.cpp11
-rw-r--r--TAO/orbsvcs/IFR_Service/drv_init_ifr.cpp130
-rw-r--r--TAO/orbsvcs/IFR_Service/drv_preproc.cpp11
-rw-r--r--TAO/orbsvcs/IFR_Service/drv_private_ifr.cpp83
-rw-r--r--TAO/orbsvcs/IFR_Service/drv_private_ifr.h92
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp4470
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_adding_visitor.h282
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_adding_visitor_exception.cpp487
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_adding_visitor_exception.h79
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_adding_visitor_operation.cpp280
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_adding_visitor_operation.h61
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_adding_visitor_structure.cpp451
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_adding_visitor_structure.h76
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_adding_visitor_union.cpp564
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_adding_visitor_union.h81
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_removing_visitor.cpp147
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_removing_visitor.h54
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_visitor.cpp264
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_visitor.h168
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_visitor_macro.h25
-rw-r--r--TAO/orbsvcs/IFR_Service/tao_idl.cpp11
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/.cvsignore3
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Activator_Info.cpp20
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Activator_Info.h36
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Activator_Loader.cpp109
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Activator_Loader.h52
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Activator_NT_Service.cpp115
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Activator_NT_Service.h65
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Activator_Options.cpp348
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Activator_Options.h105
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Adapter_Activator.cpp95
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Adapter_Activator.h59
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/AsyncStartupWaiter.idl18
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/AsyncStartupWaiter_i.cpp171
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/AsyncStartupWaiter_i.h75
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Forwarder.cpp162
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Forwarder.h77
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/INS_Locator.cpp64
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/INS_Locator.h53
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR.xsd30
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR_Activator.cpp216
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR_Activator.idl18
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp395
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.h128
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR_Locator.cpp201
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR_Locator.idl22
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp1532
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h187
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc142
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Iterator.cpp91
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Iterator.h55
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_Loader.cpp105
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_Loader.h50
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_NT_Service.cpp116
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_NT_Service.h62
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_Options.cpp505
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_Options.h147
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp574
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h114
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp97
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.h88
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Makefile.am391
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/README.txt590
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp66
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Server_Info.h77
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/activator_export.h54
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/activator_idl_export.h54
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/locator_export.h54
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/locator_idl_export.h54
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/repository.xml8
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/tao_imr.cpp15
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/tao_imr_i.cpp1111
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/tao_imr_i.h322
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/utils.h98
-rw-r--r--TAO/orbsvcs/LifeCycle_Service/.cvsignore1
-rw-r--r--TAO/orbsvcs/LifeCycle_Service/Criteria_Evaluator.cpp88
-rw-r--r--TAO/orbsvcs/LifeCycle_Service/Criteria_Evaluator.h57
-rw-r--r--TAO/orbsvcs/LifeCycle_Service/Factory_Trader.cpp234
-rw-r--r--TAO/orbsvcs/LifeCycle_Service/Factory_Trader.h54
-rw-r--r--TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service.cpp226
-rw-r--r--TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service.h66
-rw-r--r--TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service.mpc6
-rw-r--r--TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service_i.cpp172
-rw-r--r--TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service_i.h73
-rw-r--r--TAO/orbsvcs/LifeCycle_Service/Makefile.am66
-rw-r--r--TAO/orbsvcs/LoadBalancer/.cvsignore2
-rw-r--r--TAO/orbsvcs/LoadBalancer/LoadBalancer.mpc24
-rw-r--r--TAO/orbsvcs/LoadBalancer/LoadManager.cpp310
-rw-r--r--TAO/orbsvcs/LoadBalancer/LoadMonitor.cpp417
-rw-r--r--TAO/orbsvcs/LoadBalancer/Makefile.am117
-rw-r--r--TAO/orbsvcs/LoadBalancer/Monitor_Signal_Handler.cpp51
-rw-r--r--TAO/orbsvcs/LoadBalancer/Monitor_Signal_Handler.h62
-rw-r--r--TAO/orbsvcs/LoadBalancer/Push_Handler.cpp57
-rw-r--r--TAO/orbsvcs/LoadBalancer/Push_Handler.h66
-rw-r--r--TAO/orbsvcs/LoadBalancer/README183
-rw-r--r--TAO/orbsvcs/LoadBalancer/Signal_Handler.cpp147
-rw-r--r--TAO/orbsvcs/LoadBalancer/Signal_Handler.h100
-rw-r--r--TAO/orbsvcs/Logging_Service/Basic_Logging_Service/.cvsignore1
-rw-r--r--TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Server.cpp79
-rw-r--r--TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Service.cpp276
-rw-r--r--TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Service.h96
-rw-r--r--TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Service.mpc5
-rw-r--r--TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Makefile.am57
-rw-r--r--TAO/orbsvcs/Logging_Service/Basic_Logging_Service/README12
-rw-r--r--TAO/orbsvcs/Logging_Service/Event_Logging_Service/.cvsignore1
-rw-r--r--TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Server.cpp81
-rw-r--r--TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Service.cpp281
-rw-r--r--TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Service.h97
-rw-r--r--TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Service.mpc5
-rw-r--r--TAO/orbsvcs/Logging_Service/Event_Logging_Service/Makefile.am74
-rwxr-xr-xTAO/orbsvcs/Logging_Service/Event_Logging_Service/README14
-rw-r--r--TAO/orbsvcs/Logging_Service/Makefile.am16
-rw-r--r--TAO/orbsvcs/Logging_Service/Notify_Logging_Service/.cvsignore1
-rw-r--r--TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Makefile.am73
-rw-r--r--TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Server.cpp79
-rw-r--r--TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.cpp306
-rw-r--r--TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.h107
-rw-r--r--TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.mpc5
-rwxr-xr-xTAO/orbsvcs/Logging_Service/Notify_Logging_Service/README14
-rwxr-xr-xTAO/orbsvcs/Logging_Service/Notify_Logging_Service/svc.conf3
-rw-r--r--TAO/orbsvcs/Logging_Service/README32
-rw-r--r--TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/.cvsignore1
-rw-r--r--TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/Makefile.am71
-rwxr-xr-xTAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/README14
-rw-r--r--TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/RTEvent_Logging_Service.cpp341
-rw-r--r--TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/RTEvent_Logging_Service.h84
-rw-r--r--TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/RTEvent_Logging_Service.mpc5
-rw-r--r--TAO/orbsvcs/Makefile.am43
-rw-r--r--TAO/orbsvcs/Mobility_Service/GTP.idl2
-rw-r--r--TAO/orbsvcs/Naming_Service/.cvsignore2
-rw-r--r--TAO/orbsvcs/Naming_Service/Makefile.am101
-rw-r--r--TAO/orbsvcs/Naming_Service/NT_Naming_Server.cpp228
-rw-r--r--TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp199
-rw-r--r--TAO/orbsvcs/Naming_Service/NT_Naming_Service.h97
-rw-r--r--TAO/orbsvcs/Naming_Service/Naming_Server.cpp69
-rw-r--r--TAO/orbsvcs/Naming_Service/Naming_Service.cpp158
-rw-r--r--TAO/orbsvcs/Naming_Service/Naming_Service.h76
-rw-r--r--TAO/orbsvcs/Naming_Service/Naming_Service.mpc21
-rw-r--r--TAO/orbsvcs/Naming_Service/README409
-rw-r--r--TAO/orbsvcs/Notify_Service/.cvsignore2
-rw-r--r--TAO/orbsvcs/Notify_Service/Makefile.am108
-rw-r--r--TAO/orbsvcs/Notify_Service/NT_Notify_Server.cpp231
-rw-r--r--TAO/orbsvcs/Notify_Service/NT_Notify_Service.cpp154
-rw-r--r--TAO/orbsvcs/Notify_Service/NT_Notify_Service.h79
-rw-r--r--TAO/orbsvcs/Notify_Service/Notify_Server.cpp73
-rw-r--r--TAO/orbsvcs/Notify_Service/Notify_Service.cpp446
-rw-r--r--TAO/orbsvcs/Notify_Service/Notify_Service.h146
-rw-r--r--TAO/orbsvcs/Notify_Service/Notify_Service.mpc28
-rw-r--r--TAO/orbsvcs/Notify_Service/README250
-rw-r--r--TAO/orbsvcs/Notify_Service/svc.conf3
-rw-r--r--TAO/orbsvcs/Notify_Service/svc.conf.xml5
-rw-r--r--TAO/orbsvcs/PSS/Dump_Visitor.cpp1651
-rw-r--r--TAO/orbsvcs/PSS/Dump_Visitor.h155
-rw-r--r--TAO/orbsvcs/PSS/PSDL.ll209
-rw-r--r--TAO/orbsvcs/PSS/PSDL.mpc57
-rw-r--r--TAO/orbsvcs/PSS/PSDL.yy1364
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Code_Gen.cpp170
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Code_Gen.h93
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Datastore.cpp196
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Datastore.h135
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Enum_Type_Visitor.cpp100
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Enum_Type_Visitor.h55
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Exception_Scope.cpp121
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Exception_Scope.h71
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Exception_Visitor.cpp221
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Exception_Visitor.h56
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Extern.cpp31
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Extern.h50
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Interface_Scope.cpp224
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Interface_Scope.h95
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Interface_Visitor.cpp2366
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Interface_Visitor.h65
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Interpreter.cpp107
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Interpreter.h99
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Module_Scope.cpp237
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Module_Scope.h97
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Module_Visitor.cpp52
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Module_Visitor.h45
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Node.cpp5215
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Node.h3333
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Node_Visitor.cpp647
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Node_Visitor.h368
-rw-r--r--TAO/orbsvcs/PSS/PSDL_OctetSeq.cpp124
-rw-r--r--TAO/orbsvcs/PSS/PSDL_OctetSeq.h78
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Op_Dcl_Scope.cpp59
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Op_Dcl_Scope.h54
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Root_Scope.cpp205
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Root_Scope.h84
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Scope.cpp928
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Scope.h294
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Scope_Visitor.cpp1150
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Scope_Visitor.h186
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Simple_Scope.cpp160
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Simple_Scope.h81
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Stream.cpp158
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Stream.h90
-rw-r--r--TAO/orbsvcs/PSS/PSDL_String.cpp138
-rw-r--r--TAO/orbsvcs/PSS/PSDL_String.h85
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Struct_Scope.cpp152
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Struct_Scope.h73
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Struct_Visitor.cpp1160
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Struct_Visitor.h66
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Type_Dcl_Visitor.cpp445
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Type_Dcl_Visitor.h58
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Typecode_Defn.cpp33
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Typecode_Defn.h43
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Visitor_Factory.cpp78
-rw-r--r--TAO/orbsvcs/PSS/PSDL_Visitor_Factory.h41
-rw-r--r--TAO/orbsvcs/PSS/PSDL_l.cpp2317
-rw-r--r--TAO/orbsvcs/PSS/PSDL_y.cpp3410
-rw-r--r--TAO/orbsvcs/PSS/PSDL_y.h93
-rw-r--r--TAO/orbsvcs/PSS/README261
-rw-r--r--TAO/orbsvcs/PSS/psdl_export.h40
-rw-r--r--TAO/orbsvcs/PSS/psdl_tao.cpp65
-rw-r--r--TAO/orbsvcs/Scheduling_Service/.cvsignore1
-rw-r--r--TAO/orbsvcs/Scheduling_Service/Makefile.am51
-rw-r--r--TAO/orbsvcs/Scheduling_Service/Scheduling_Service.cpp303
-rw-r--r--TAO/orbsvcs/Scheduling_Service/Scheduling_Service.h101
-rw-r--r--TAO/orbsvcs/Scheduling_Service/Scheduling_Service.mpc6
-rw-r--r--TAO/orbsvcs/TAO_Service/.cvsignore1
-rw-r--r--TAO/orbsvcs/TAO_Service/Makefile.am39
-rw-r--r--TAO/orbsvcs/TAO_Service/README118
-rw-r--r--TAO/orbsvcs/TAO_Service/TAO_Service.cpp77
-rw-r--r--TAO/orbsvcs/TAO_Service/TAO_Service.mpc6
-rw-r--r--TAO/orbsvcs/TAO_Service/svc.conf23
-rw-r--r--TAO/orbsvcs/TAO_Service/svc.conf.xml20
-rw-r--r--TAO/orbsvcs/Time_Service/.cvsignore2
-rw-r--r--TAO/orbsvcs/Time_Service/Clerk_i.cpp562
-rw-r--r--TAO/orbsvcs/Time_Service/Clerk_i.h139
-rw-r--r--TAO/orbsvcs/Time_Service/Makefile.am80
-rw-r--r--TAO/orbsvcs/Time_Service/README96
-rw-r--r--TAO/orbsvcs/Time_Service/Server_i.cpp286
-rw-r--r--TAO/orbsvcs/Time_Service/Server_i.h89
-rw-r--r--TAO/orbsvcs/Time_Service/Time_Service.mpc19
-rw-r--r--TAO/orbsvcs/Time_Service/Time_Service_Clerk.cpp44
-rw-r--r--TAO/orbsvcs/Time_Service/Time_Service_Server.cpp45
-rw-r--r--TAO/orbsvcs/Trading_Service/.cvsignore1
-rw-r--r--TAO/orbsvcs/Trading_Service/Makefile.am55
-rw-r--r--TAO/orbsvcs/Trading_Service/README10
-rw-r--r--TAO/orbsvcs/Trading_Service/Trading_Server.cpp37
-rw-r--r--TAO/orbsvcs/Trading_Service/Trading_Service.cpp87
-rw-r--r--TAO/orbsvcs/Trading_Service/Trading_Service.h84
-rw-r--r--TAO/orbsvcs/Trading_Service/Trading_Service.mpc7
-rw-r--r--TAO/orbsvcs/examples/CosEC/Factory/CosEC_Factory.mpc36
-rw-r--r--TAO/orbsvcs/examples/CosEC/Factory/CosEventChannelFactory.idl83
-rw-r--r--TAO/orbsvcs/examples/CosEC/Factory/CosEventChannelFactory_i.cpp327
-rw-r--r--TAO/orbsvcs/examples/CosEC/Factory/CosEventChannelFactory_i.h119
-rw-r--r--TAO/orbsvcs/examples/CosEC/Factory/FactoryClient.cpp418
-rw-r--r--TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.cpp168
-rw-r--r--TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.h80
-rw-r--r--TAO/orbsvcs/examples/CosEC/Factory/Makefile.am139
-rw-r--r--TAO/orbsvcs/examples/CosEC/Factory/README45
-rw-r--r--TAO/orbsvcs/examples/CosEC/Factory/main.cpp14
-rw-r--r--TAO/orbsvcs/examples/CosEC/Makefile.am16
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/Makefile.am15
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/README7
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/CosEC_RtEC_Based_bin.mpc15
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/Makefile.am67
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/README82
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/RtEC_Based_CosEC.cpp311
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/RtEC_Based_CosEC.h106
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ConsumerAdmin_i.cpp68
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ConsumerAdmin_i.h69
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEC_RtEC_Based_lib.mpc8
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEvent_Utilities.cpp443
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEvent_Utilities.h157
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/EventChannel_i.cpp124
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/EventChannel_i.h92
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/Makefile.am62
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ProxyPushConsumer_i.cpp207
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ProxyPushConsumer_i.h87
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ProxyPushSupplier_i.cpp194
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ProxyPushSupplier_i.h76
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/SupplierAdmin_i.cpp67
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/SupplierAdmin_i.h71
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/rtec_cosec_export.h40
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Basic.cpp176
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Basic.h75
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Consumer.cpp96
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Consumer.h75
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/CosEC_RtEC_Based_tests_Basic.mpc15
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Makefile.am72
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/README26
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Supplier.cpp86
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Supplier.h64
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Makefile.am14
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Consumer.cpp197
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Consumer.h86
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/CosEC_RtEC_Based_Mult.mpc36
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Makefile.am118
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Multiple.cpp151
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Multiple.h79
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/README77
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Supplier.cpp185
-rw-r--r--TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Supplier.h79
-rwxr-xr-xTAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/run_test.pl178
-rwxr-xr-xTAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/run_test2.pl133
-rw-r--r--TAO/orbsvcs/examples/CosEC/Simple/Consumer.cpp130
-rw-r--r--TAO/orbsvcs/examples/CosEC/Simple/Consumer.h59
-rw-r--r--TAO/orbsvcs/examples/CosEC/Simple/CosEC_Simple.mpc20
-rw-r--r--TAO/orbsvcs/examples/CosEC/Simple/Makefile.am123
-rw-r--r--TAO/orbsvcs/examples/CosEC/Simple/README15
-rw-r--r--TAO/orbsvcs/examples/CosEC/Simple/Service.cpp124
-rw-r--r--TAO/orbsvcs/examples/CosEC/Simple/Supplier.cpp129
-rw-r--r--TAO/orbsvcs/examples/CosEC/Simple/Supplier.h50
-rwxr-xr-xTAO/orbsvcs/examples/CosEC/Simple/run_test.pl56
-rw-r--r--TAO/orbsvcs/examples/CosEC/TypedSimple/Consumer.cpp114
-rw-r--r--TAO/orbsvcs/examples/CosEC/TypedSimple/CosEC_TypedSimple.mpc21
-rw-r--r--TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl16
-rw-r--r--TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl.for_ifr16
-rw-r--r--TAO/orbsvcs/examples/CosEC/TypedSimple/Country_i.cpp80
-rw-r--r--TAO/orbsvcs/examples/CosEC/TypedSimple/Country_i.h45
-rw-r--r--TAO/orbsvcs/examples/CosEC/TypedSimple/Makefile.am130
-rw-r--r--TAO/orbsvcs/examples/CosEC/TypedSimple/README18
-rw-r--r--TAO/orbsvcs/examples/CosEC/TypedSimple/Supplier.cpp93
-rwxr-xr-xTAO/orbsvcs/examples/CosEC/TypedSimple/run_test.pl118
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/Makefile.am13
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/CrashPoint.cpp7
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/CrashPoint.h19
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/Log.h10
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/LogACE_RB_Tree.h66
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/LogStdMap.h56
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/Makefile.am179
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ORB_Initializer.cpp56
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ORB_Initializer.h28
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/README105
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ReplicaController.cpp540
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ReplicaController.h138
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly.idl15
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly.mpc32
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly_i.cpp72
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly_i.h44
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/StateUpdate.h27
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/client.cpp239
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/RolyPoly/server.cpp140
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/Advanced.mpc54
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/Makefile.am163
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/Manager.idl9
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/Manager_i.cpp39
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/Manager_i.h38
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/Messenger.idl6
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/Messenger_i.cpp41
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/Messenger_i.h41
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/README37
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/TestClient.cpp258
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/TestClient.h38
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/TestServer.cpp514
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/TestServer.h50
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/client_main.cpp25
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/drivers/all6
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/drivers/defaults76
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/drivers/environment14
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/drivers/invocation48
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/drivers/persistence57
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/drivers/retry28
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/drivers/use_environment19
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/drivers/use_invocation12
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/drivers/use_persistence22
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/manager_main.cpp59
-rwxr-xr-xTAO/orbsvcs/examples/ImR/Advanced/run_test.pl519
-rw-r--r--TAO/orbsvcs/examples/ImR/Advanced/server_main.cpp26
-rw-r--r--TAO/orbsvcs/examples/ImR/Combined_Service/ImR_Combined_Service.mpc83
-rw-r--r--TAO/orbsvcs/examples/ImR/Combined_Service/Makefile.am209
-rw-r--r--TAO/orbsvcs/examples/ImR/Combined_Service/combined.cpp81
-rw-r--r--TAO/orbsvcs/examples/ImR/Combined_Service/controller.cpp73
-rw-r--r--TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.conf1
-rw-r--r--TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.cpp154
-rw-r--r--TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.h58
-rw-r--r--TAO/orbsvcs/examples/ImR/Combined_Service/dynserver_export.h54
-rw-r--r--TAO/orbsvcs/examples/ImR/Combined_Service/readme28
-rwxr-xr-xTAO/orbsvcs/examples/ImR/Combined_Service/run_test.pl184
-rw-r--r--TAO/orbsvcs/examples/ImR/Combined_Service/service_config.idl6
-rw-r--r--TAO/orbsvcs/examples/ImR/Combined_Service/start_all.conf2
-rw-r--r--TAO/orbsvcs/examples/ImR/Combined_Service/test.cpp47
-rw-r--r--TAO/orbsvcs/examples/ImR/Combined_Service/test.idl4
-rw-r--r--TAO/orbsvcs/examples/ImR/Combined_Service/test_server.cpp93
-rw-r--r--TAO/orbsvcs/examples/ImR/Makefile.am14
-rw-r--r--TAO/orbsvcs/examples/LoadBalancing/LoadBalancing.mpc34
-rw-r--r--TAO/orbsvcs/examples/LoadBalancing/Makefile.am141
-rw-r--r--TAO/orbsvcs/examples/LoadBalancing/ORBInitializer.cpp81
-rw-r--r--TAO/orbsvcs/examples/LoadBalancing/ORBInitializer.h96
-rw-r--r--TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.cpp91
-rw-r--r--TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.h93
-rw-r--r--TAO/orbsvcs/examples/LoadBalancing/ServerRequestInterceptor.cpp82
-rw-r--r--TAO/orbsvcs/examples/LoadBalancing/ServerRequestInterceptor.h123
-rw-r--r--TAO/orbsvcs/examples/LoadBalancing/Stock.cpp32
-rw-r--r--TAO/orbsvcs/examples/LoadBalancing/Stock.h34
-rw-r--r--TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp34
-rw-r--r--TAO/orbsvcs/examples/LoadBalancing/StockFactory.h30
-rw-r--r--TAO/orbsvcs/examples/LoadBalancing/Test.idl47
-rw-r--r--TAO/orbsvcs/examples/LoadBalancing/client.cpp110
-rwxr-xr-xTAO/orbsvcs/examples/LoadBalancing/run_test.pl105
-rw-r--r--TAO/orbsvcs/examples/LoadBalancing/server.cpp370
-rw-r--r--TAO/orbsvcs/examples/Log/Basic/Log_Basic.mpc6
-rw-r--r--TAO/orbsvcs/examples/Log/Basic/Makefile.am46
-rw-r--r--TAO/orbsvcs/examples/Log/Basic/README17
-rw-r--r--TAO/orbsvcs/examples/Log/Basic/TLS_Client.cpp198
-rw-r--r--TAO/orbsvcs/examples/Log/Basic/TLS_Client.h63
-rw-r--r--TAO/orbsvcs/examples/Log/Basic/main.cpp39
-rwxr-xr-xTAO/orbsvcs/examples/Log/Basic/run_test.pl57
-rw-r--r--TAO/orbsvcs/examples/Log/Event/Event_Consumer.cpp131
-rw-r--r--TAO/orbsvcs/examples/Log/Event/Event_Consumer.h74
-rw-r--r--TAO/orbsvcs/examples/Log/Event/Event_Supplier.cpp240
-rw-r--r--TAO/orbsvcs/examples/Log/Event/Event_Supplier.h66
-rw-r--r--TAO/orbsvcs/examples/Log/Event/Log_Event.mpc16
-rw-r--r--TAO/orbsvcs/examples/Log/Event/Makefile.am88
-rw-r--r--TAO/orbsvcs/examples/Log/Event/README18
-rwxr-xr-xTAO/orbsvcs/examples/Log/Event/run_test.pl67
-rw-r--r--TAO/orbsvcs/examples/Log/Makefile.am16
-rw-r--r--TAO/orbsvcs/examples/Log/Notify/Log_Notify.mpc16
-rw-r--r--TAO/orbsvcs/examples/Log/Notify/Makefile.am94
-rw-r--r--TAO/orbsvcs/examples/Log/Notify/Notify_Consumer.cpp174
-rw-r--r--TAO/orbsvcs/examples/Log/Notify/Notify_Consumer.h100
-rw-r--r--TAO/orbsvcs/examples/Log/Notify/Notify_Supplier.cpp362
-rw-r--r--TAO/orbsvcs/examples/Log/Notify/Notify_Supplier.h128
-rw-r--r--TAO/orbsvcs/examples/Log/Notify/README18
-rwxr-xr-xTAO/orbsvcs/examples/Log/Notify/run_test.pl67
-rw-r--r--TAO/orbsvcs/examples/Log/README18
-rw-r--r--TAO/orbsvcs/examples/Log/RTEvent/Log_RTEvent.mpc16
-rw-r--r--TAO/orbsvcs/examples/Log/RTEvent/Makefile.am96
-rw-r--r--TAO/orbsvcs/examples/Log/RTEvent/README18
-rw-r--r--TAO/orbsvcs/examples/Log/RTEvent/RTEvent_Consumer.cpp175
-rw-r--r--TAO/orbsvcs/examples/Log/RTEvent/RTEvent_Consumer.h72
-rw-r--r--TAO/orbsvcs/examples/Log/RTEvent/RTEvent_Supplier.cpp297
-rw-r--r--TAO/orbsvcs/examples/Log/RTEvent/RTEvent_Supplier.h63
-rwxr-xr-xTAO/orbsvcs/examples/Log/RTEvent/run_test.pl67
-rw-r--r--TAO/orbsvcs/examples/Makefile.am21
-rw-r--r--TAO/orbsvcs/examples/Notify/Federation/Agent/Agent.cpp346
-rw-r--r--TAO/orbsvcs/examples/Notify/Federation/Agent/Agent.mpc14
-rw-r--r--TAO/orbsvcs/examples/Notify/Federation/Agent/Makefile.am67
-rw-r--r--TAO/orbsvcs/examples/Notify/Federation/Agent/README12
-rw-r--r--TAO/orbsvcs/examples/Notify/Federation/Agent/agent.diabin0 -> 4102 bytes
-rw-r--r--TAO/orbsvcs/examples/Notify/Federation/Gate/Export.h44
-rw-r--r--TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.cpp266
-rw-r--r--TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.h93
-rw-r--r--TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.mpc7
-rw-r--r--TAO/orbsvcs/examples/Notify/Federation/Gate/Makefile.am53
-rw-r--r--TAO/orbsvcs/examples/Notify/Federation/Makefile.am15
-rw-r--r--TAO/orbsvcs/examples/Notify/Federation/SpaceCraft/Makefile.am67
-rw-r--r--TAO/orbsvcs/examples/Notify/Federation/SpaceCraft/README27
-rw-r--r--TAO/orbsvcs/examples/Notify/Federation/SpaceCraft/SpaceCraft.cpp197
-rw-r--r--TAO/orbsvcs/examples/Notify/Federation/SpaceCraft/SpaceCraft.mpc14
-rw-r--r--TAO/orbsvcs/examples/Notify/Filter/Filter.cpp507
-rw-r--r--TAO/orbsvcs/examples/Notify/Filter/Filter.h261
-rw-r--r--TAO/orbsvcs/examples/Notify/Filter/Makefile.am56
-rw-r--r--TAO/orbsvcs/examples/Notify/Filter/Notify_Filter.mpc5
-rw-r--r--TAO/orbsvcs/examples/Notify/Filter/README23
-rw-r--r--TAO/orbsvcs/examples/Notify/Filter/main.cpp35
-rwxr-xr-xTAO/orbsvcs/examples/Notify/Filter/run_test.pl73
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/Consumer.cpp171
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/Consumer.h111
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/Consumer_Client.cpp269
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/Consumer_Client.h77
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/Makefile.am129
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/Notify_Lanes.mpc22
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/ORB_Objects.cpp71
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/ORB_Objects.h56
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/ORB_Run_Task.cpp33
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/ORB_Run_Task.h44
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/README62
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/Supplier.cpp185
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/Supplier.h110
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/Supplier_Client.cpp272
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/Supplier_Client.h71
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/client.conf1
-rw-r--r--TAO/orbsvcs/examples/Notify/Lanes/notify.conf3
-rwxr-xr-xTAO/orbsvcs/examples/Notify/Lanes/run_test.pl128
-rw-r--r--TAO/orbsvcs/examples/Notify/Makefile.am17
-rw-r--r--TAO/orbsvcs/examples/Notify/README18
-rw-r--r--TAO/orbsvcs/examples/Notify/Subscribe/Makefile.am56
-rw-r--r--TAO/orbsvcs/examples/Notify/Subscribe/Notify_Subscribe.mpc6
-rw-r--r--TAO/orbsvcs/examples/Notify/Subscribe/README28
-rw-r--r--TAO/orbsvcs/examples/Notify/Subscribe/Subscribe.cpp471
-rw-r--r--TAO/orbsvcs/examples/Notify/Subscribe/Subscribe.h246
-rw-r--r--TAO/orbsvcs/examples/Notify/Subscribe/main.cpp35
-rwxr-xr-xTAO/orbsvcs/examples/Notify/Subscribe/run_test.pl73
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/Consumer.cpp219
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/Consumer.h138
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/Consumer_Client.cpp274
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/Consumer_Client.h83
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/Makefile.am140
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/Notify_ThreadPool.mpc20
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Objects.cpp71
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Objects.h55
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Run_Task.cpp33
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Run_Task.h44
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/README57
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/Supplier.cpp194
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/Supplier.h121
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/Supplier_Client.cpp270
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/Supplier_Client.h79
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/client.conf1
-rw-r--r--TAO/orbsvcs/examples/Notify/ThreadPool/notify.conf3
-rwxr-xr-xTAO/orbsvcs/examples/Notify/ThreadPool/run_test.pl131
-rw-r--r--TAO/orbsvcs/examples/ORT/Gateway.idl16
-rw-r--r--TAO/orbsvcs/examples/ORT/Gateway_ObjRef_Factory.cpp35
-rw-r--r--TAO/orbsvcs/examples/ORT/Gateway_ObjRef_Factory.h40
-rw-r--r--TAO/orbsvcs/examples/ORT/Gateway_i.cpp181
-rw-r--r--TAO/orbsvcs/examples/ORT/Gateway_i.h50
-rw-r--r--TAO/orbsvcs/examples/ORT/Makefile.am225
-rw-r--r--TAO/orbsvcs/examples/ORT/ORT.mpc52
-rw-r--r--TAO/orbsvcs/examples/ORT/ObjectReferenceFactory.idl16
-rw-r--r--TAO/orbsvcs/examples/ORT/Object_Factory_i.cpp49
-rw-r--r--TAO/orbsvcs/examples/ORT/Object_Factory_i.h45
-rw-r--r--TAO/orbsvcs/examples/ORT/README69
-rw-r--r--TAO/orbsvcs/examples/ORT/Server_IORInterceptor.cpp85
-rw-r--r--TAO/orbsvcs/examples/ORT/Server_IORInterceptor.h85
-rw-r--r--TAO/orbsvcs/examples/ORT/Server_IORInterceptor_ORBInitializer.cpp59
-rw-r--r--TAO/orbsvcs/examples/ORT/Server_IORInterceptor_ORBInitializer.h44
-rw-r--r--TAO/orbsvcs/examples/ORT/client.cpp85
-rw-r--r--TAO/orbsvcs/examples/ORT/gateway_server.cpp189
-rwxr-xr-xTAO/orbsvcs/examples/ORT/run_test.pl130
-rw-r--r--TAO/orbsvcs/examples/ORT/server.cpp152
-rw-r--r--TAO/orbsvcs/examples/ORT/sum_server.idl10
-rw-r--r--TAO/orbsvcs/examples/ORT/sum_server_i.cpp20
-rw-r--r--TAO/orbsvcs/examples/ORT/sum_server_i.h40
-rw-r--r--TAO/orbsvcs/examples/PSS/README58
-rw-r--r--TAO/orbsvcs/examples/PSS/Server.idl31
-rw-r--r--TAO/orbsvcs/examples/PSS/Server_i.cpp20
-rw-r--r--TAO/orbsvcs/examples/PSS/Server_i.h40
-rw-r--r--TAO/orbsvcs/examples/PSS/Simple_Naming.cpp164
-rw-r--r--TAO/orbsvcs/examples/PSS/Simple_Naming.idl36
-rw-r--r--TAO/orbsvcs/examples/PSS/Simple_Naming_i.cpp47
-rw-r--r--TAO/orbsvcs/examples/PSS/Simple_Naming_i.h56
-rw-r--r--TAO/orbsvcs/examples/PSS/client.cpp107
-rw-r--r--TAO/orbsvcs/examples/PSS/naming_data.psdl5
-rw-r--r--TAO/orbsvcs/examples/PSS/oldmpc_pss44
-rw-r--r--TAO/orbsvcs/examples/PSS/server.cpp108
-rw-r--r--TAO/orbsvcs/examples/RtEC/IIOPGateway/Consumer.cpp200
-rw-r--r--TAO/orbsvcs/examples/RtEC/IIOPGateway/Consumer.h57
-rw-r--r--TAO/orbsvcs/examples/RtEC/IIOPGateway/EC.cpp159
-rw-r--r--TAO/orbsvcs/examples/RtEC/IIOPGateway/EC.h39
-rw-r--r--TAO/orbsvcs/examples/RtEC/IIOPGateway/Gateway.cpp185
-rw-r--r--TAO/orbsvcs/examples/RtEC/IIOPGateway/Gateway.h38
-rw-r--r--TAO/orbsvcs/examples/RtEC/IIOPGateway/Makefile.am166
-rw-r--r--TAO/orbsvcs/examples/RtEC/IIOPGateway/README19
-rw-r--r--TAO/orbsvcs/examples/RtEC/IIOPGateway/RtEC_IIOPGateway.mpc35
-rw-r--r--TAO/orbsvcs/examples/RtEC/IIOPGateway/Supplier.cpp195
-rw-r--r--TAO/orbsvcs/examples/RtEC/IIOPGateway/Supplier.h46
-rwxr-xr-xTAO/orbsvcs/examples/RtEC/IIOPGateway/consumerec_crash.pl150
-rw-r--r--TAO/orbsvcs/examples/RtEC/IIOPGateway/ec.conf4
-rw-r--r--TAO/orbsvcs/examples/RtEC/IIOPGateway/ec.conf.xml5
-rw-r--r--TAO/orbsvcs/examples/RtEC/IIOPGateway/gateway.conf6
-rw-r--r--TAO/orbsvcs/examples/RtEC/IIOPGateway/gateway.conf.xml5
-rwxr-xr-xTAO/orbsvcs/examples/RtEC/IIOPGateway/run_test.pl124
-rw-r--r--TAO/orbsvcs/examples/RtEC/Kokyu/Consumer.cpp32
-rw-r--r--TAO/orbsvcs/examples/RtEC/Kokyu/Consumer.h55
-rw-r--r--TAO/orbsvcs/examples/RtEC/Kokyu/Makefile.am67
-rw-r--r--TAO/orbsvcs/examples/RtEC/Kokyu/README66
-rw-r--r--TAO/orbsvcs/examples/RtEC/Kokyu/RtECKokyu.mpc3
-rw-r--r--TAO/orbsvcs/examples/RtEC/Kokyu/Service.cpp522
-rw-r--r--TAO/orbsvcs/examples/RtEC/Kokyu/Supplier.cpp71
-rw-r--r--TAO/orbsvcs/examples/RtEC/Kokyu/Supplier.h87
-rw-r--r--TAO/orbsvcs/examples/RtEC/Kokyu/svc.conf3
-rw-r--r--TAO/orbsvcs/examples/RtEC/Kokyu/svc.conf.xml7
-rw-r--r--TAO/orbsvcs/examples/RtEC/MCast/AddrServer.cpp19
-rw-r--r--TAO/orbsvcs/examples/RtEC/MCast/AddrServer.h53
-rw-r--r--TAO/orbsvcs/examples/RtEC/MCast/Consumer.cpp104
-rw-r--r--TAO/orbsvcs/examples/RtEC/MCast/Consumer.h64
-rw-r--r--TAO/orbsvcs/examples/RtEC/MCast/MCast.cpp379
-rw-r--r--TAO/orbsvcs/examples/RtEC/MCast/Makefile.am66
-rw-r--r--TAO/orbsvcs/examples/RtEC/MCast/README26
-rw-r--r--TAO/orbsvcs/examples/RtEC/MCast/RtEC_MCast.mpc5
-rw-r--r--TAO/orbsvcs/examples/RtEC/MCast/Supplier.cpp94
-rw-r--r--TAO/orbsvcs/examples/RtEC/MCast/Supplier.h62
-rw-r--r--TAO/orbsvcs/examples/RtEC/MCast/svc.conf2
-rw-r--r--TAO/orbsvcs/examples/RtEC/MCast/svc.conf.xml6
-rw-r--r--TAO/orbsvcs/examples/RtEC/Makefile.am17
-rw-r--r--TAO/orbsvcs/examples/RtEC/Schedule/Consumer.cpp32
-rw-r--r--TAO/orbsvcs/examples/RtEC/Schedule/Consumer.h55
-rw-r--r--TAO/orbsvcs/examples/RtEC/Schedule/Makefile.am65
-rw-r--r--TAO/orbsvcs/examples/RtEC/Schedule/README23
-rw-r--r--TAO/orbsvcs/examples/RtEC/Schedule/RtEC_Schedule.mpc5
-rw-r--r--TAO/orbsvcs/examples/RtEC/Schedule/Schedule.h42
-rw-r--r--TAO/orbsvcs/examples/RtEC/Schedule/Service.cpp408
-rw-r--r--TAO/orbsvcs/examples/RtEC/Schedule/Supplier.cpp18
-rw-r--r--TAO/orbsvcs/examples/RtEC/Schedule/Supplier.h54
-rw-r--r--TAO/orbsvcs/examples/RtEC/Schedule/svc.conf2
-rw-r--r--TAO/orbsvcs/examples/RtEC/Schedule/svc.conf.xml6
-rw-r--r--TAO/orbsvcs/examples/RtEC/Simple/Consumer.cpp162
-rw-r--r--TAO/orbsvcs/examples/RtEC/Simple/Consumer.h60
-rw-r--r--TAO/orbsvcs/examples/RtEC/Simple/Makefile.am130
-rw-r--r--TAO/orbsvcs/examples/RtEC/Simple/README15
-rw-r--r--TAO/orbsvcs/examples/RtEC/Simple/RtEC_Simple.mpc20
-rw-r--r--TAO/orbsvcs/examples/RtEC/Simple/Service.cpp141
-rw-r--r--TAO/orbsvcs/examples/RtEC/Simple/Supplier.cpp152
-rw-r--r--TAO/orbsvcs/examples/RtEC/Simple/Supplier.h51
-rw-r--r--TAO/orbsvcs/examples/RtEC/Simple/ec.conf2
-rw-r--r--TAO/orbsvcs/examples/RtEC/Simple/ec.conf.xml6
-rwxr-xr-xTAO/orbsvcs/examples/RtEC/Simple/run_test.pl83
-rw-r--r--TAO/orbsvcs/examples/Security/Makefile.am13
-rw-r--r--TAO/orbsvcs/examples/Security/README9
-rw-r--r--TAO/orbsvcs/examples/Security/SecurityLevel1/README47
-rw-r--r--TAO/orbsvcs/examples/Security/SecurityLevel1/SLevel1_Test.idl10
-rw-r--r--TAO/orbsvcs/examples/Security/SecurityLevel1/SLevel1_Test_i.cpp122
-rw-r--r--TAO/orbsvcs/examples/Security/SecurityLevel1/SLevel1_Test_i.h39
-rw-r--r--TAO/orbsvcs/examples/Security/SecurityLevel1/client.cpp89
-rw-r--r--TAO/orbsvcs/examples/Security/SecurityLevel1/server.cpp75
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/Makefile.am100
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/README73
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/Security_Send_File.mpc31
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/cacert.pem21
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/client.conf4
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/client.conf.xml9
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/client.cpp90
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/client_cert.pem16
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/client_key.pem15
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/client_key_nopasswd.pem16
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/client_nopasswd.conf4
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/client_nopasswd.conf.xml9
-rwxr-xr-xTAO/orbsvcs/examples/Security/Send_File/run_test.pl52
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/server.conf4
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/server.conf.xml9
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/server.cpp113
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/server_cert.pem16
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/server_key.pem15
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/server_key_nopasswd.pem16
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/server_none.conf4
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/server_none.conf.xml9
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/server_nopasswd.conf4
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/server_nopasswd.conf.xml9
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/test.idl10
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/test_i.cpp24
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/test_i.h49
-rw-r--r--TAO/orbsvcs/examples/Security/Send_File/test_i.i7
-rw-r--r--TAO/orbsvcs/examples/examples.mwc5
-rw-r--r--TAO/orbsvcs/orbsvcs/ATLAS.idl88
-rw-r--r--TAO/orbsvcs/orbsvcs/AV.mpc85
-rw-r--r--TAO/orbsvcs/orbsvcs/AV.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp5309
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h1536
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/AVStreams_i.i62
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/AV_Core.cpp1186
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/AV_Core.h181
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/AV_Pluggable_Framework.html377
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/AV_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy.cpp435
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h190
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp837
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h293
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Fill_ACE_QoS.cpp75
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Fill_ACE_QoS.h86
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/FlowSpec_Entry.cpp1018
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h359
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i347
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Flows_T.cpp252
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Flows_T.h130
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/MCast.cpp220
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/MCast.h117
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/MCast.i17
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Policy.cpp150
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Policy.h176
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Policy.i81
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Protocol_Factory.cpp131
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Protocol_Factory.h103
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/QoS_UDP.cpp1537
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/QoS_UDP.h306
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/QoS_UDP.i81
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/README27
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/RTCP.cpp826
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/RTCP.h256
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/RTCP_Channel.cpp364
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/RTCP_Channel.h223
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/RTCP_Packet.cpp1212
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/RTCP_Packet.h405
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/RTP.cpp785
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/RTP.h423
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Resource_Factory.h54
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.cpp932
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.h308
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/TCP.cpp721
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/TCP.h283
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Transport.cpp682
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Transport.h345
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Transport.i111
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/UDP.cpp1094
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/UDP.h296
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/UDP.i32
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/default_resource.cpp107
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/default_resource.h66
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/global.h33
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/md5.h49
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/md5c.cpp326
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/media_timer.cpp95
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/media_timer.h69
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/ntp-time.h97
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/sfp.cpp1336
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/sfp.h306
-rw-r--r--TAO/orbsvcs/orbsvcs/AVStreams.idl795
-rw-r--r--TAO/orbsvcs/orbsvcs/CSI.idl201
-rw-r--r--TAO/orbsvcs/orbsvcs/CSIIOP.idl153
-rw-r--r--TAO/orbsvcs/orbsvcs/Channel_Clients_T.cpp41
-rw-r--r--TAO/orbsvcs/orbsvcs/Channel_Clients_T.h99
-rw-r--r--TAO/orbsvcs/orbsvcs/Channel_Clients_T.i19
-rw-r--r--TAO/orbsvcs/orbsvcs/Concurrency/CC_Lock.cpp246
-rw-r--r--TAO/orbsvcs/orbsvcs/Concurrency/CC_Lock.h148
-rw-r--r--TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSet.cpp330
-rw-r--r--TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSet.h199
-rw-r--r--TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSetFactory.cpp62
-rw-r--r--TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSetFactory.h68
-rw-r--r--TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Loader.cpp88
-rw-r--r--TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Loader.h74
-rw-r--r--TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Utils.cpp126
-rw-r--r--TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Utils.h77
-rw-r--r--TAO/orbsvcs/orbsvcs/Concurrency/concurrency_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Concurrency/concurrency_serv_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Concurrency/concurrency_skel_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/CosConcurrency.mpc106
-rw-r--r--TAO/orbsvcs/orbsvcs/CosConcurrency.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosConcurrencyControl.idl199
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent.mpc135
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerAdmin.cpp141
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerAdmin.h157
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerAdmin.i39
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerControl.cpp62
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerControl.h99
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Default_Factory.cpp1403
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Default_Factory.h231
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Default_Factory.i32
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Defaults.h127
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching.cpp64
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching.h119
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching_Task.cpp156
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching_Task.h165
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching_Task.i85
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_DynamicImplementation.cpp179
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_DynamicImplementation.h84
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_DynamicImplementation.i19
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.cpp241
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.h316
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.i205
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Event_Loader.cpp536
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Event_Loader.h110
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Factory.cpp14
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Factory.h235
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_MT_Dispatching.cpp108
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_MT_Dispatching.h100
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullConsumer.cpp423
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullConsumer.h158
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullConsumer.i42
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullSupplier.cpp389
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullSupplier.h182
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullSupplier.i43
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushConsumer.cpp397
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushConsumer.h210
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushConsumer.i50
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushSupplier.cpp983
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushSupplier.h233
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushSupplier.i98
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Pulling_Strategy.cpp13
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Pulling_Strategy.h71
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.cpp492
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.h213
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.i23
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.cpp204
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.h151
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.i15
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.cpp537
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.h229
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.i34
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierAdmin.cpp105
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierAdmin.h127
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierAdmin.i23
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierControl.cpp67
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierControl.h112
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.cpp135
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.h129
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.i24
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEvent.cpp9
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEvent.h69
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEvent.i30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEventChannel.cpp597
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEventChannel.h393
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEventChannel.i205
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.cpp450
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.h210
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.i21
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedSupplierAdmin.cpp111
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedSupplierAdmin.h109
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedSupplierAdmin.i15
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/event_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/event_serv_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent/event_skel_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEventChannelAdmin.idl246
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEventComm.idl177
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent_Serv.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosEvent_Skel.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosLifeCycle.idl127
-rw-r--r--TAO/orbsvcs/orbsvcs/CosLifeCycle.mpc32
-rw-r--r--TAO/orbsvcs/orbsvcs/CosLifeCycle.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosLoadBalancing.idl202
-rw-r--r--TAO/orbsvcs/orbsvcs/CosLoadBalancing.mpc50
-rw-r--r--TAO/orbsvcs/orbsvcs/CosLoadBalancing.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNaming.idl291
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNaming.mpc48
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNaming.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNaming_Serv.mpc53
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNaming_Serv.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNaming_Skel.mpc35
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNaming_Skel.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNotification.idl390
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNotification.mpc267
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNotification.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNotification_Serv.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNotification_Skel.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNotifyChannelAdmin.idl1027
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNotifyComm.idl387
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNotifyFilter.idl505
-rw-r--r--TAO/orbsvcs/orbsvcs/CosProperty.idl413
-rw-r--r--TAO/orbsvcs/orbsvcs/CosProperty.mpc120
-rw-r--r--TAO/orbsvcs/orbsvcs/CosProperty.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosPropertyService.idl16
-rw-r--r--TAO/orbsvcs/orbsvcs/CosTime.mpc33
-rw-r--r--TAO/orbsvcs/orbsvcs/CosTime.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosTrading.idl522
-rw-r--r--TAO/orbsvcs/orbsvcs/CosTrading.mpc133
-rw-r--r--TAO/orbsvcs/orbsvcs/CosTrading.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosTradingDynamic.idl50
-rw-r--r--TAO/orbsvcs/orbsvcs/CosTradingRepos.idl159
-rw-r--r--TAO/orbsvcs/orbsvcs/CosTrading_Serv.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosTrading_Skel.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/CosTypedEventChannelAdmin.idl62
-rw-r--r--TAO/orbsvcs/orbsvcs/CosTypedEventComm.idl32
-rw-r--r--TAO/orbsvcs/orbsvcs/DsEventLogAdmin.idl56
-rw-r--r--TAO/orbsvcs/orbsvcs/DsEventLogAdmin.mpc108
-rw-r--r--TAO/orbsvcs/orbsvcs/DsEventLogAdmin.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/DsLogAdmin.idl337
-rw-r--r--TAO/orbsvcs/orbsvcs/DsLogAdmin.mpc137
-rw-r--r--TAO/orbsvcs/orbsvcs/DsLogAdmin.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/DsLogNotification.idl112
-rw-r--r--TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin.idl66
-rw-r--r--TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin.mpc110
-rw-r--r--TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Busy_Lock.cpp64
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Busy_Lock.h80
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Busy_Lock.i13
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Read.cpp120
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Read.h74
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.cpp208
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.h184
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.i41
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Defaults.h37
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.cpp216
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.h160
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.i38
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp97
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.h187
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.i47
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Immediate_Changes.cpp49
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Immediate_Changes.h69
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Immediate_Changes.i48
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Admin.cpp58
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Admin.h108
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Workers.cpp53
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Workers.h107
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Workers.i31
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Admin.cpp110
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Admin.h167
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Admin.i32
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Collection.cpp20
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Collection.h174
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.cpp93
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.h88
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.i25
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RB_Tree.cpp91
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RB_Tree.h114
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RB_Tree.i69
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RefCount_Guard.cpp29
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RefCount_Guard.h79
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RefCount_Guard.i18
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_RefCount_Guard.cpp14
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_RefCount_Guard.h67
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_RefCount_Guard.i22
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Shutdown_Proxy.cpp33
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Shutdown_Proxy.h52
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Shutdown_Proxy.i12
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Worker.cpp22
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Worker.h67
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/esf_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL.mpc33
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/ETCL.ll161
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/ETCL.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/ETCL.yy261
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.cpp956
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.h430
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.inl330
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint_Visitor.h70
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/ETCL_Interpreter.cpp112
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/ETCL_Interpreter.h110
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/ETCL_l.cpp1884
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/ETCL_l.cpp.diff511
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.cpp1295
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.cpp.diff607
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.h45
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.h.diff25
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/README12
-rw-r--r--TAO/orbsvcs/orbsvcs/ETCL/etcl_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Adapters.cpp19
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Adapters.h79
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Address_Server_Base.h42
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Receiver.cpp608
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Receiver.h318
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Receiver.i51
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Sender.cpp340
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Sender.h190
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Sender.i56
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.cpp170
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.h118
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.i17
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_ConsumerEC_Control.cpp42
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_ConsumerEC_Control.h83
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Defaults.h79
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.cpp303
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.h294
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.i63
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.cpp705
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.h290
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.i34
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.cpp253
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.h133
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.cpp319
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.h147
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.cpp38
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.h69
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.i17
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Mcast_EH.cpp98
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Mcast_EH.h96
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_UDP_EH.cpp89
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_UDP_EH.h110
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_UDP_EH.i13
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Out_Endpoint.cpp83
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Out_Endpoint.h108
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Out_Endpoint.i37
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.cpp250
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.h239
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.i106
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.cpp236
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.h230
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.inl96
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_And_Filter.cpp170
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_And_Filter.h89
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Basic_Factory.cpp262
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Basic_Factory.h120
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.cpp203
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.h81
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.i14
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Bitmask_Filter.cpp122
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Bitmask_Filter.h107
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Busy_Lock.cpp64
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Busy_Lock.h66
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Busy_Lock.i13
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Channel_Destroyer.cpp30
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Channel_Destroyer.h46
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Conjunction_Filter.cpp209
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Conjunction_Filter.h113
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.cpp41
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.h81
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ConsumerControl.cpp42
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ConsumerControl.h83
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.cpp1003
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.h201
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.i59
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxyConsumer.cpp192
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxyConsumer.h85
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxySupplier.cpp228
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxySupplier.h82
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Defaults.h144
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Disjunction_Filter.cpp163
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Disjunction_Filter.h90
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Dispatching.cpp14
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Dispatching.h84
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Dispatching_Task.cpp210
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Dispatching_Task.h199
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Dispatching_Task.i95
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp37
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.h62
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel_Base.cpp353
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel_Base.h377
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel_Base.i206
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Factory.cpp14
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Factory.h169
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Filter.cpp130
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Filter.h225
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Filter.i45
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Filter_Builder.cpp33
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Filter_Builder.h92
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Filter_Builder.i12
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Gateway.cpp32
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Gateway.h71
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.cpp715
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.h255
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP_Factory.cpp212
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP_Factory.h115
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP_Factory.i19
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Gateway_Sched.cpp82
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Gateway_Sched.h59
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Group_Scheduling.cpp32
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Group_Scheduling.h56
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Group_Scheduling.inl7
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Dispatching.cpp210
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Dispatching.h147
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Dispatching.i42
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Factory.cpp272
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Factory.h78
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Factory.i15
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter.cpp313
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter.h127
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter_Builder.cpp513
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter_Builder.h89
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter_Builder.i15
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Scheduling.cpp99
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Scheduling.h77
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Scheduling.i14
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils.cpp7
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils.h217
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils.i179
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.cpp51
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.h203
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.i340
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_MT_Dispatching.cpp92
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_MT_Dispatching.h98
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Masked_Type_Filter.cpp128
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Masked_Type_Filter.h93
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Negation_Filter.cpp114
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Negation_Filter.h86
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Null_Factory.cpp241
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Null_Factory.h116
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Null_Scheduling.cpp39
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Null_Scheduling.h60
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Null_Scheduling.i7
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.cpp516
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.h362
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.i81
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Per_Supplier_Filter.cpp213
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Per_Supplier_Filter.h122
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Per_Supplier_Filter.i14
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Prefix_Filter_Builder.cpp158
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Prefix_Filter_Builder.h72
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Prefix_Filter_Builder.i14
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Priority_Dispatching.cpp141
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Priority_Dispatching.h90
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Priority_Scheduling.cpp100
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Priority_Scheduling.h76
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Priority_Scheduling.i14
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.cpp310
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.h238
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.i71
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.cpp535
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h231
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.i99
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Proxy_Disconnector.cpp47
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Proxy_Disconnector.h76
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_QOS_Info.cpp9
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_QOS_Info.h70
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_QOS_Info.i23
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Dispatching.cpp106
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Dispatching.h82
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Factory.cpp276
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Factory.h123
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.cpp276
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.h155
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.i13
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Dispatching.cpp45
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Dispatching.h65
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.cpp266
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.h166
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.i13
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.cpp56
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.h70
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Sched_Factory.cpp225
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Sched_Factory.h71
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Sched_Factory.i13
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter.cpp283
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter.h129
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter_Builder.cpp335
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter_Builder.h89
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter_Builder.i14
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Scheduling_Strategy.cpp14
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Scheduling_Strategy.h73
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp39
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.h73
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_SupplierControl.cpp42
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_SupplierControl.h81
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter.cpp29
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter.h151
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter.i15
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter_Builder.cpp13
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter_Builder.h67
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.cpp198
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.h85
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching_Task.cpp22
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching_Task.h34
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_TPC_Factory.cpp124
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_TPC_Factory.h67
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxyConsumer.cpp55
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxyConsumer.h50
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxySupplier.cpp76
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxySupplier.h64
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxySupplier.i17
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Filter.cpp171
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Filter.h120
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Filter.i19
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Generator.cpp61
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Generator.h101
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Generator.i12
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Trivial_Supplier_Filter.cpp112
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Trivial_Supplier_Filter.h109
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Type_Filter.cpp150
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Type_Filter.h81
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_UDP_Admin.cpp30
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_UDP_Admin.h60
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/event_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/event_serv_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/event_skel_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/rtcorba_event_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/rtkokyu_event_export.h56
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/sched_event_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Event_Forwarder.idl50
-rw-r--r--TAO/orbsvcs/orbsvcs/Event_Service_Constants.h84
-rw-r--r--TAO/orbsvcs/orbsvcs/Event_Utilities.cpp221
-rw-r--r--TAO/orbsvcs/orbsvcs/Event_Utilities.h256
-rw-r--r--TAO/orbsvcs/orbsvcs/Event_Utilities.i152
-rw-r--r--TAO/orbsvcs/orbsvcs/FTORB.mpc89
-rw-r--r--TAO/orbsvcs/orbsvcs/FTRT.idl82
-rw-r--r--TAO/orbsvcs/orbsvcs/FTRT_GroupManager.idl71
-rw-r--r--TAO/orbsvcs/orbsvcs/FT_CORBA.idl352
-rw-r--r--TAO/orbsvcs/orbsvcs/FT_CORBA_ORB.idl136
-rw-r--r--TAO/orbsvcs/orbsvcs/FT_FaultDetectorFactory.idl119
-rw-r--r--TAO/orbsvcs/orbsvcs/FT_Notifier.idl62
-rw-r--r--TAO/orbsvcs/orbsvcs/FT_Replica.idl51
-rw-r--r--TAO/orbsvcs/orbsvcs/FT_ReplicationManager.idl75
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance.mpc43
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORBInitializer.cpp115
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORBInitializer.h73
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORB_export.h60
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicyFactory.cpp34
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicyFactory.h61
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicy_i.cpp193
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicy_i.h165
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicy_i.inl55
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.cpp441
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.h150
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientService_Activate.cpp81
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientService_Activate.h73
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Endpoint_Selector_Factory.cpp60
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Endpoint_Selector_Factory.h76
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.cpp428
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.h147
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.inl35
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Invocation_Endpoint_Selectors.cpp235
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Invocation_Endpoint_Selectors.h96
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORBInitializer.cpp140
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORBInitializer.h79
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORB_Utils_export.h60
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_PolicyFactory.cpp38
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_PolicyFactory.h63
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Policy_i.cpp259
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Policy_i.h217
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Policy_i.inl80
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerORBInitializer.cpp100
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerORBInitializer.h74
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerORB_export.h60
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicyFactory.cpp34
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicyFactory.h60
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicy_i.cpp82
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicy_i.h96
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicy_i.inl28
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerRequest_Interceptor.cpp237
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerRequest_Interceptor.h138
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerService_Activate.cpp55
-rwxr-xr-xTAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerService_Activate.h65
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Activate.cpp79
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Activate.h19
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp325
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h107
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/fault_tol_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/ftconf.h42
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent.mpc83
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Initializer.cpp35
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Initializer.h65
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Interceptor.cpp161
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Interceptor.h90
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Loader.cpp107
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Loader.h57
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/ftrt_clientorb_export.h60
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Primary_Replication_Strategy.cpp222
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Primary_Replication_Strategy.h67
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Replication_Strategy.cpp71
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Replication_Strategy.h59
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Basic_Replication_Strategy.cpp158
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Basic_Replication_Strategy.h59
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ConnectionHandler_T.cpp96
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ConnectionHandler_T.h75
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.cpp125
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.h76
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.inl69
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.cpp11
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.h31
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ConsumerAdmin.cpp51
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ConsumerAdmin.h73
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel.cpp428
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel.h184
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.cpp582
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.h135
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Factory.cpp56
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Factory.h49
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Fault_Listener.h29
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.cpp378
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.h80
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ORBInitializer.cpp68
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ORBInitializer.h42
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.cpp134
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.h67
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxySupplier.cpp202
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxySupplier.h72
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_SupplierAdmin.cpp49
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_SupplierAdmin.h79
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTRTEC_ServiceActivate.h11
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_Base.cpp52
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_Base.h53
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.cpp145
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.h58
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector.cpp75
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector.h64
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.cpp90
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.h59
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_T.cpp65
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_T.h48
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Listener.h33
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ForwardCtrlServerInterceptor.cpp260
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ForwardCtrlServerInterceptor.h65
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.cpp340
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.h100
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.cpp175
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h83
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/IOGR_Maker.cpp269
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/IOGR_Maker.h75
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Identification_Service.cpp100
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Identification_Service.h57
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ObjectGroupManagerHandler.cpp71
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ObjectGroupManagerHandler.h61
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxyConsumerStateWorker.cpp36
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxyConsumerStateWorker.h43
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxySupplierStateWorker.cpp38
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxySupplierStateWorker.h43
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Service.cpp210
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Service.h85
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Strategy.cpp35
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Strategy.h76
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.cpp316
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h116
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/SCTP_Fault_Detector.cpp96
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/SCTP_Fault_Detector.h86
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Set_Update_Interceptor.cpp168
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Set_Update_Interceptor.h86
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.cpp61
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.h52
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/UpdateableHandler.cpp100
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/UpdateableHandler.h60
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/create_persistent_poa.cpp49
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/create_persistent_poa.h30
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ftrtec_export.h60
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/replace_key.cpp35
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp523
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.h82
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.inl16
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp29
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h48
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.inl51
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.cpp9
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.inl23
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ScopeGuard.h300
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.cpp167
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.h123
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.inl58
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/activate_with_id.h43
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ftrtevent_export.h73
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/resolve_init.h73
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtecEventChannelAdmin.idl194
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtecEventComm.idl32
-rw-r--r--TAO/orbsvcs/orbsvcs/GSSUP.idl63
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP.idl30
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP.mpc29
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.cpp889
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.h239
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.i28
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor_Impl.cpp322
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor_Impl.h156
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Completion_Handler.cpp181
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Completion_Handler.h99
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connection_Handler.cpp289
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connection_Handler.h135
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector.cpp420
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector.h137
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector_Impl.cpp62
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector_Impl.h128
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Endpoint.cpp225
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Endpoint.h162
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Endpoint.i79
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Export.h54
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Factory.cpp146
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Factory.h99
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Profile.cpp473
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Profile.h151
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.cpp456
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.h168
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/README.txt154
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/htiop_endpoints.pidl42
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/htiop_endpointsC.cpp222
-rw-r--r--TAO/orbsvcs/orbsvcs/HTIOP/htiop_endpointsC.h199
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService.mpc21
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/AbstractInterfaceDef_i.cpp62
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/AbstractInterfaceDef_i.h81
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/AliasDef_i.cpp141
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/AliasDef_i.h101
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ArrayDef_i.cpp279
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ArrayDef_i.h148
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/AttributeDef_i.cpp397
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/AttributeDef_i.h152
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.cpp569
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.h144
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ComponentDef_i.cpp794
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ComponentDef_i.h249
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ComponentModuleDef_i.cpp23
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ComponentModuleDef_i.h63
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ComponentRepository_i.cpp245
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ComponentRepository_i.h129
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ConstantDef_i.cpp313
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ConstantDef_i.h132
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ConsumesDef_i.cpp34
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ConsumesDef_i.h68
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/Contained_i.cpp1259
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/Contained_i.h236
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/Container_i.cpp2684
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/Container_i.h479
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/EmitsDef_i.cpp32
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/EmitsDef_i.h68
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/EnumDef_i.cpp163
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/EnumDef_i.h101
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/EventDef_i.cpp101
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/EventDef_i.h102
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/EventPortDef_i.cpp200
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/EventPortDef_i.h123
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ExceptionDef_i.cpp351
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ExceptionDef_i.h124
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ExtAbstractInterfaceDef_i.cpp43
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ExtAbstractInterfaceDef_i.h70
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ExtAttributeDef_i.cpp315
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ExtAttributeDef_i.h133
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ExtInterfaceDef_i.cpp29
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ExtInterfaceDef_i.h65
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ExtLocalInterfaceDef_i.cpp43
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ExtLocalInterfaceDef_i.h70
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp975
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.h135
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/FactoryDef_i.cpp32
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/FactoryDef_i.h66
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/FinderDef_i.cpp31
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/FinderDef_i.h67
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/FixedDef_i.cpp152
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/FixedDef_i.h133
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/HomeDef_i.cpp1058
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/HomeDef_i.h286
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IDLType_i.cpp21
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IDLType_i.h75
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS.cpp7987
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS.h1261
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS.inl414
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS_T.cpp49
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS_T.h927
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS_T.inl1512
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS.cpp23928
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS.h7898
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS.inl9663
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS_T.cpp49
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS_T.h7971
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS_T.inl13439
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS.cpp14264
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS.h5119
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS.inl6972
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS_T.cpp49
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS_T.h5387
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS_T.inl9019
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS.cpp7501
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS.h2140
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS.inl2232
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS_T.cpp49
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS_T.h2032
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS_T.inl3342
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Loader.cpp100
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Loader.h76
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp1445
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.h258
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils_T.cpp389
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils_T.h125
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IFR_macro.h51
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IRObject_i.cpp89
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/IRObject_i.h99
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/InterfaceAttrExtension_i.cpp343
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/InterfaceAttrExtension_i.h97
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/InterfaceDef_i.cpp1285
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/InterfaceDef_i.h236
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/LocalInterfaceDef_i.cpp62
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/LocalInterfaceDef_i.h78
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ModuleDef_i.cpp111
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ModuleDef_i.h94
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/NativeDef_i.cpp66
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/NativeDef_i.h79
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/OperationDef_i.cpp750
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/OperationDef_i.h184
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/Options.cpp122
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/Options.h95
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/PrimitiveDef_i.cpp142
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/PrimitiveDef_i.h100
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ProvidesDef_i.cpp161
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ProvidesDef_i.h101
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/PublishesDef_i.cpp30
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/PublishesDef_i.h67
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/RecursDef_i.cpp47
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/RecursDef_i.h68
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/Repository_i.cpp1150
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/Repository_i.h386
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/SequenceDef_i.cpp269
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/SequenceDef_i.h150
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/StringDef_i.cpp131
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/StringDef_i.h112
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/StructDef_i.cpp317
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/StructDef_i.h113
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/TypedefDef_i.cpp82
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/TypedefDef_i.h75
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/UnionDef_i.cpp486
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/UnionDef_i.h153
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/UsesDef_i.cpp214
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/UsesDef_i.h122
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ValueBoxDef_i.cpp140
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ValueBoxDef_i.h101
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp1857
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.h353
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ValueMemberDef_i.cpp224
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ValueMemberDef_i.h132
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/WstringDef_i.cpp131
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/WstringDef_i.h113
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/concrete_classes.h54
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ifr_service_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp321
-rw-r--r--TAO/orbsvcs/orbsvcs/IOR_Multicast.h114
-rw-r--r--TAO/orbsvcs/orbsvcs/LB_ORT.idl28
-rw-r--r--TAO/orbsvcs/orbsvcs/LifeCycle/lifecycle_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/LifeCycleService.idl83
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Load_Average_Monitor.cpp244
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Load_Average_Monitor.h103
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Utilization_Monitor.cpp170
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Utilization_Monitor.h100
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientComponent.cpp70
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientComponent.h68
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientORBInitializer.cpp43
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientORBInitializer.h78
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientRequestInterceptor.cpp114
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientRequestInterceptor.h114
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Component.cpp146
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Component.h70
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_IORInterceptor.cpp189
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_IORInterceptor.h152
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp641
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.h229
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.inl27
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.cpp42
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.h87
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.inl16
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlertInfo.cpp16
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlertInfo.h54
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlertMap.h46
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.cpp52
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.h76
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.cpp454
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.h184
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.inl26
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadListMap.h46
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadManager.cpp1295
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadManager.h519
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMap.h46
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.cpp664
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.h208
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.inl26
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Location_Index_Map.h44
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_MemberLocator.cpp76
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_MemberLocator.h92
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_MonitorMap.h42
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.cpp94
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.h110
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectReferenceFactory.cpp258
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectReferenceFactory.h179
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Pull_Handler.cpp84
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Pull_Handler.h73
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Random.cpp180
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Random.h124
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_RoundRobin.cpp171
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_RoundRobin.h127
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.cpp182
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.h125
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_conf.h45
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LoadBalancing_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/README35
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/BasicLogFactory_i.cpp147
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/BasicLogFactory_i.h109
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/BasicLog_i.cpp93
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/BasicLog_i.h101
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/EventLogConsumer.cpp100
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/EventLogConsumer.h102
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.cpp253
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.h152
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/EventLogNotification.cpp52
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/EventLogNotification.h92
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/EventLog_i.cpp139
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/EventLog_i.h135
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Hash_Iterator_i.cpp110
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Hash_Iterator_i.h95
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Hash_LogRecordStore.cpp832
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Hash_LogRecordStore.h399
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.cpp269
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.h130
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Hash_Persistence_Strategy.cpp25
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Hash_Persistence_Strategy.h59
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Iterator_i.cpp73
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Iterator_i.h91
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/LogActivator.cpp58
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/LogActivator.h78
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/LogMgr_i.cpp296
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/LogMgr_i.h202
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/LogNotification.cpp418
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/LogNotification.h185
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/LogRecordStore.cpp17
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/LogRecordStore.h269
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/LogStore.h108
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Log_Compaction_Handler.cpp66
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Log_Compaction_Handler.h66
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Interpreter.cpp49
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Interpreter.h70
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Visitors.cpp1347
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Visitors.h130
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Log_Flush_Handler.cpp59
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Log_Flush_Handler.h66
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Log_Persistence_Strategy.h61
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Log_i.cpp1859
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/Log_i.h509
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/NotifyLogConsumer.cpp144
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/NotifyLogConsumer.h117
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/NotifyLogFactory_i.cpp462
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/NotifyLogFactory_i.h281
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/NotifyLogNotification.cpp88
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/NotifyLogNotification.h108
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/NotifyLog_i.cpp371
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/NotifyLog_i.h240
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/RTEventLogConsumer.cpp68
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/RTEventLogConsumer.h95
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.cpp242
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.h141
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/RTEventLogNotification.cpp90
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/RTEventLogNotification.h93
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/RTEventLog_i.cpp166
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/RTEventLog_i.h138
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/eventlog_export.h37
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/eventlog_serv_export.h37
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/eventlog_skel_export.h37
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/log_export.h39
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/log_serv_export.h39
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/log_skel_export.h41
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/notifylog_export.h37
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/notifylog_serv_export.h37
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/notifylog_skel_export.h37
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/rteventlog_export.h37
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/rteventlog_serv_export.h37
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/rteventlog_skel_export.h37
-rw-r--r--TAO/orbsvcs/orbsvcs/Makefile.am6166
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics.idl331
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager.cpp14
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager.h37
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager.i9
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager_T.cpp14
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager_T.h277
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager_T.i821
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache.cpp12
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache.h115
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache.i10
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.cpp488
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.h329
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_Logger.cpp871
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_Logger.h224
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor.cpp23
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor.h264
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor.i381
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor_T.cpp28
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor_T.h164
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor_T.i263
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_Utils.cpp534
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_Utils.h187
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/Metrics_Utils.i39
-rw-r--r--TAO/orbsvcs/orbsvcs/Metrics/metrics_export.h50
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Bindings_Iterator_T.cpp232
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Bindings_Iterator_T.h145
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Entries.cpp127
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Entries.h139
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp361
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.h95
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.cpp680
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.h280
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Client.cpp67
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Client.h78
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.cpp539
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.h422
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.cpp98
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.h71
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp768
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Server.h239
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Service_Container.cpp392
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Service_Container.h234
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp310
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.h171
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Persistent_Entries.cpp208
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Persistent_Entries.h233
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp541
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.h273
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/README69
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Storable.cpp25
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Storable.h165
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Storable.inl170
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp1584
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.h474
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp125
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h91
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp344
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.h204
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/naming_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/naming_serv_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/naming_skel_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/nsconf.h45
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Admin.cpp222
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Admin.h126
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Admin.inl54
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/AdminProperties.cpp94
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/AdminProperties.h133
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/AdminProperties.inl85
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/AllocTracker.h81
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp140
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h121
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.cpp90
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.h86
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushSupplier.cpp65
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushSupplier.h89
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushConsumer.cpp134
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushConsumer.h96
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushSupplier.cpp110
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushSupplier.h98
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.cpp118
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.h78
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/PushSupplier.cpp65
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/PushSupplier.h63
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Bit_Vector.cpp114
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Bit_Vector.h81
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.cpp266
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.h121
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Builder.cpp592
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Builder.h175
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp702
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Consumer.h195
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Consumer.inl27
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.cpp488
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.h254
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Consumer_Map.h43
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Container_T.cpp65
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Container_T.h82
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Container_T.inl13
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/CosNotify_Initializer.cpp17
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/CosNotify_Initializer.h44
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp314
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h95
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Default_Factory.cpp197
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Default_Factory.h101
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Delivery_Request.cpp103
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Delivery_Request.h135
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Delivery_Request.inl27
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp448
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.h175
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.cpp81
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.h94
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event.cpp84
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event.h139
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event.inl43
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/EventChannel.cpp685
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/EventChannel.h254
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp564
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.h207
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/EventType.cpp180
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/EventType.h107
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/EventType.inl19
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/EventTypeSeq.cpp317
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/EventTypeSeq.h88
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event_Manager.cpp309
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event_Manager.h136
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.cpp58
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.h101
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.inl31
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.cpp166
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.h123
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.inl56
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event_Persistence_Factory.cpp13
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event_Persistence_Factory.h54
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Event_Persistence_Strategy.h51
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Factory.h136
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.cpp204
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.h117
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.inl39
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/FilterFactory.h49
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.cpp49
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.h77
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.inl14
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ID_Factory.cpp22
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ID_Factory.h62
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ID_Factory.inl24
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request.cpp62
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request.h75
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp304
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h170
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.cpp102
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.h104
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp233
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h140
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Shutdown.cpp35
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Shutdown.h58
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.cpp59
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.h90
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.cpp28
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.h81
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.inl36
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Name_Value_Pair.cpp216
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Name_Value_Pair.h102
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.cpp49
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.h65
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.cpp1465
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.h168
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Default_CO_Factory.cpp17
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Default_CO_Factory.h48
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Default_Collection_Factory.cpp17
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Default_Collection_Factory.h47
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Default_EMO_Factory.cpp17
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Default_EMO_Factory.h45
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Default_POA_Factory.cpp17
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Default_POA_Factory.h44
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.cpp41
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.h44
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Extensions.cpp12
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Notify_Extensions.h33
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Object.cpp372
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Object.h221
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Object.inl97
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/POA_Helper.cpp218
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/POA_Helper.h115
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/POA_Helper.inl13
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Peer.cpp125
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Peer.h85
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.cpp400
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.h208
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Properties.cpp44
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Properties.h155
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Properties.inl151
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Property.h49
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/PropertySeq.cpp65
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/PropertySeq.h77
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/PropertySeq.inl22
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.cpp47
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.h89
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.inl62
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Property_T.cpp137
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Property_T.h170
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Property_T.inl77
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Proxy.cpp199
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Proxy.h139
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Proxy.inl40
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.cpp204
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.h105
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.inl26
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer_T.cpp84
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer_T.h86
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp166
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h101
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.inl26
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ProxySupplier_T.cpp227
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ProxySupplier_T.h161
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Proxy_T.cpp165
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Proxy_T.h161
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/QoSProperties.cpp218
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/QoSProperties.h120
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/QoSProperties.inl163
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/README51
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/RT_Builder.cpp73
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/RT_Builder.h50
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/RT_Factory.cpp131
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/RT_Factory.h100
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/RT_Notify_Service.cpp98
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/RT_Notify_Service.h61
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/RT_POA_Helper.cpp166
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/RT_POA_Helper.h63
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/RT_Properties.cpp22
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/RT_Properties.h68
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/RT_Properties.inl31
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Random_File.cpp161
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Random_File.h94
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.cpp59
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.h77
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.inl13
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Reconnect_Worker_T.cpp41
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Reconnect_Worker_T.h54
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Reconnection_Registry.cpp257
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Reconnection_Registry.h100
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Refcountable.cpp252
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Refcountable.h99
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.cpp14
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h89
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl91
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Routing_Slip.cpp933
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Routing_Slip.h242
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.cpp804
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.h267
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Queue.cpp112
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Queue.h93
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Save_Persist_Worker_T.cpp47
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Save_Persist_Worker_T.h63
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.cpp38
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.h72
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.inl15
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.cpp139
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.h102
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushSupplier.cpp108
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushSupplier.h99
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp297
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h94
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushSupplier.cpp56
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushSupplier.h61
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Service.cpp15
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Service.h84
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Standard_Event_Persistence.cpp234
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Standard_Event_Persistence.h134
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.cpp81
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.h63
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp142
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h112
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.cpp135
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.h105
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushSupplier.cpp111
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushSupplier.h103
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp101
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h81
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushSupplier.cpp55
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushSupplier.h62
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Subscription_Change_Worker.cpp29
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Subscription_Change_Worker.h54
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Supplier.cpp41
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Supplier.h70
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Supplier.inl13
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.cpp430
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.h219
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Supplier_Map.h37
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp200
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h98
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Timer.h56
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Timer_Queue.cpp48
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Timer_Queue.h70
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Timer_Reactor.cpp50
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Timer_Reactor.h66
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Topology_Factory.h54
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Topology_Loader.cpp20
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Topology_Loader.h84
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Topology_Object.cpp151
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Topology_Object.h213
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Topology_Object.inl26
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Topology_Saver.cpp16
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Topology_Saver.h114
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Worker_Task.cpp22
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Worker_Task.h71
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/XML_Loader.cpp234
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/XML_Loader.h87
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/XML_Saver.cpp203
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/XML_Saver.h87
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/XML_Topology_Factory.cpp162
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/XML_Topology_Factory.h85
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/notify_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/notify_persist_export.h60
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/notify_serv_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/notify_skel_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/rt_notify_export.h39
-rw-r--r--TAO/orbsvcs/orbsvcs/NotifyExt.idl184
-rw-r--r--TAO/orbsvcs/orbsvcs/Null_MediaCtrl.idl5
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup.idl323
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup.mpc40
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/GOA.cpp711
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/GOA.h329
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.cpp29
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.h45
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Default_Property_Validator.cpp151
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Default_Property_Validator.h86
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.cpp733
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.h263
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Factory_Map.h46
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Factory_Set.h58
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.cpp780
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.h248
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp232
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h184
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Guard.cpp59
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Guard.h93
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Equal_To.cpp11
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Equal_To.h59
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Equal_To.inl15
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Hash.cpp13
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Hash.h53
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Hash.inl25
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Map.h54
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_MemberInfo.cpp18
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_MemberInfo.h62
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Null_Property_Validator.cpp30
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Null_Property_Validator.h67
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroupManager.cpp871
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroupManager.h314
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroup_Map.h84
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Adapter_Factory.cpp48
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Adapter_Factory.h47
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp896
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h382
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Manipulator.cpp190
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Manipulator.h123
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Operators.cpp33
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Operators.h50
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.cpp67
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.h101
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.inl64
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.cpp151
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.h214
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_PropertyManager.cpp368
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_PropertyManager.h192
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp360
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.h200
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set_Find.h55
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Utils.cpp82
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Utils.h57
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Servant_Dispatcher.cpp70
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Servant_Dispatcher.h72
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Utils.cpp176
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Utils.h59
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_conf.h64
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Acceptor_Registry.cpp191
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Acceptor_Registry.h117
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.cpp83
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.h68
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp71
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.h61
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.cpp61
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.h70
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/Portable_Group_Map.cpp180
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/Portable_Group_Map.h139
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/README43
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp354
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.h160
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.i29
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp267
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.h149
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.cpp215
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.h99
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.cpp150
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.h129
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.i52
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.cpp99
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.h72
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Message_Block_Data_Iterator.cpp89
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Message_Block_Data_Iterator.h70
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.cpp800
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.h165
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp613
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.h131
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Wait_Never.cpp53
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Wait_Never.h58
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/miopconf.h41
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/portablegroup_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup_Simple_DS.idl41
-rw-r--r--TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.cpp1888
-rw-r--r--TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.h621
-rw-r--r--TAO/orbsvcs/orbsvcs/Property/property_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Property/property_serv_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Property/property_skel_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/RTCORBAEvent.mpc27
-rw-r--r--TAO/orbsvcs/orbsvcs/RTCosScheduling.idl107
-rw-r--r--TAO/orbsvcs/orbsvcs/RTCosScheduling.mpc24
-rw-r--r--TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ClientScheduler_i.cpp524
-rw-r--r--TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ClientScheduler_i.h218
-rw-r--r--TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp519
-rw-r--r--TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.h316
-rw-r--r--TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.i98
-rw-r--r--TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.cpp766
-rw-r--r--TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.h316
-rw-r--r--TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.i39
-rw-r--r--TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_export.h60
-rw-r--r--TAO/orbsvcs/orbsvcs/RTEvent.mpc55
-rw-r--r--TAO/orbsvcs/orbsvcs/RTEvent.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/RTEventLogAdmin.idl56
-rw-r--r--TAO/orbsvcs/orbsvcs/RTEventLogAdmin.mpc107
-rw-r--r--TAO/orbsvcs/orbsvcs/RTEvent_Serv.mpc99
-rw-r--r--TAO/orbsvcs/orbsvcs/RTEvent_Serv.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/RTEvent_Skel.mpc44
-rw-r--r--TAO/orbsvcs/orbsvcs/RTEvent_Skel.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/RTKokyuEvent.mpc24
-rw-r--r--TAO/orbsvcs/orbsvcs/RTSched.mpc32
-rw-r--r--TAO/orbsvcs/orbsvcs/RTSched.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/RTSchedEvent.mpc25
-rw-r--r--TAO/orbsvcs/orbsvcs/RTSchedEvent.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/RT_Notification.mpc26
-rw-r--r--TAO/orbsvcs/orbsvcs/RT_Notification.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/RtecBase.idl92
-rw-r--r--TAO/orbsvcs/orbsvcs/RtecDefaultEventData.idl78
-rw-r--r--TAO/orbsvcs/orbsvcs/RtecEventChannelAdmin.idl393
-rw-r--r--TAO/orbsvcs/orbsvcs/RtecEventComm.idl175
-rw-r--r--TAO/orbsvcs/orbsvcs/RtecScheduler.idl496
-rw-r--r--TAO/orbsvcs/orbsvcs/RtecUDPAdmin.idl61
-rw-r--r--TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp594
-rw-r--r--TAO/orbsvcs/orbsvcs/Runtime_Scheduler.h288
-rw-r--r--TAO/orbsvcs/orbsvcs/SL3CSI.idl353
-rw-r--r--TAO/orbsvcs/orbsvcs/SL3TCPIP.idl203
-rw-r--r--TAO/orbsvcs/orbsvcs/SL3TLS.idl350
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP.idl98
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP.mpc29
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.cpp39
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.h86
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.cpp90
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.h122
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.inl33
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.cpp288
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.h104
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.cpp54
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.h90
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Accept_Strategy.cpp66
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Accept_Strategy.h98
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp684
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h169
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.i14
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ClientCredentials.cpp142
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ClientCredentials.h153
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp445
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h202
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.i29
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp862
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h162
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.cpp267
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.h186
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.inl21
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirer.cpp388
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirer.h154
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirerFactory.cpp30
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirerFactory.h65
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.cpp197
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.h177
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.inl40
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current_Impl.cpp128
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current_Impl.h113
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current_Impl.inl26
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_EVP_PKEY.cpp76
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_EVP_PKEY.h79
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp382
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h256
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i70
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp614
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.h141
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Invocation_Interceptor.cpp175
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Invocation_Interceptor.h148
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.cpp248
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.h100
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.cpp17
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.h139
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.inl165
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OwnCredentials.cpp77
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OwnCredentials.h121
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp357
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.h179
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_SSL.h85
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_TargetCredentials.cpp134
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_TargetCredentials.h129
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp385
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h159
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.cpp58
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.h65
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_X509.h84
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/params_dup.c19
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/params_dup.h44
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/ssl_endpoints.pidl33
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/ssl_endpointsC.cpp165
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/ssl_endpointsC.h158
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp674
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.h318
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/DynSched.cpp2423
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/DynSched.h544
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/DynSched.i113
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils.cpp1808
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils.h669
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.cpp1085
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.h490
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler.h38
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp3218
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h777
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/SchedEntry.cpp938
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/SchedEntry.h648
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/SchedEntry.i447
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Scheduler.cpp271
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Scheduler.h300
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Scheduler_Generic.cpp269
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Scheduler_Generic.h140
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Strategy_Scheduler.cpp1394
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Strategy_Scheduler.h505
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/sched_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp795
-rw-r--r--TAO/orbsvcs/orbsvcs/Scheduler_Factory.h280
-rw-r--r--TAO/orbsvcs/orbsvcs/Scheduler_Factory.i21
-rw-r--r--TAO/orbsvcs/orbsvcs/Scheduler_Utilities.cpp12
-rw-r--r--TAO/orbsvcs/orbsvcs/Scheduler_Utilities.h68
-rw-r--r--TAO/orbsvcs/orbsvcs/Scheduler_Utilities.i40
-rw-r--r--TAO/orbsvcs/orbsvcs/Security.idl358
-rw-r--r--TAO/orbsvcs/orbsvcs/Security.mpc42
-rw-r--r--TAO/orbsvcs/orbsvcs/Security.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/CSI_Utils.cpp69
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/CSI_Utils.h56
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL2_EstablishTrustPolicy.cpp63
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL2_EstablishTrustPolicy.h106
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL2_QOPPolicy.cpp61
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL2_QOPPolicy.h103
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_ContextEstablishmentPolicy.cpp126
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_ContextEstablishmentPolicy.h134
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsAcquirerFactory.cpp14
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsAcquirerFactory.h68
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsCurator.cpp284
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsCurator.h176
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_ObjectCredentialsPolicy.cpp65
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_ObjectCredentialsPolicy.h110
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_PolicyFactory.cpp63
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_PolicyFactory.h82
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent.cpp60
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent.h152
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent.inl26
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent_Impl.cpp16
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent_Impl.h85
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_SecurityManager.cpp84
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/SL3_SecurityManager.h119
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/Security_Current.cpp97
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/Security_Current.h149
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/Security_Current.inl26
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/Security_Current_Impl.cpp15
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/Security_Current_Impl.h95
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.cpp240
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.h106
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/Security_PolicyFactory.cpp159
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/Security_PolicyFactory.h73
-rw-r--r--TAO/orbsvcs/orbsvcs/Security/security_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/SecurityAdmin.idl143
-rw-r--r--TAO/orbsvcs/orbsvcs/SecurityLevel1.idl31
-rw-r--r--TAO/orbsvcs/orbsvcs/SecurityLevel2.idl274
-rw-r--r--TAO/orbsvcs/orbsvcs/SecurityLevel3.idl2037
-rw-r--r--TAO/orbsvcs/orbsvcs/SecurityReplaceable.idl237
-rw-r--r--TAO/orbsvcs/orbsvcs/Shutdown_Utilities.cpp97
-rw-r--r--TAO/orbsvcs/orbsvcs/Shutdown_Utilities.h71
-rw-r--r--TAO/orbsvcs/orbsvcs/Svc_Utils.mpc34
-rw-r--r--TAO/orbsvcs/orbsvcs/Svc_Utils.rc30
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosConcurrency.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosConcurrency_Serv.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosConcurrency_Skel.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosEvent.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosEvent_Serv.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosEvent_Skel.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosLifeCycle.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosLoadBalancing.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosNaming.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosNaming_Serv.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosNaming_Skel.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosNotification.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosNotification_Serv.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosNotification_Skel.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosProperty.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosProperty_Serv.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosProperty_Skel.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosTime.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosTrading.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosTrading_Serv.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_CosTrading_Skel.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_DsEventLogAdmin.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_DsEventLogAdmin_Serv.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_DsEventLogAdmin_Skel.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_DsLogAdmin.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_DsLogAdmin_Serv.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_DsLogAdmin_Skel.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_DsNotifyLogAdmin.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_DsNotifyLogAdmin_Serv.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_DsNotifyLogAdmin_Skel.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_ETCL.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_FTORB_Utils.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_FT_ClientORB.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_FT_ServerORB.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_FaultTolerance.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_PortableGroup.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_RTEvent.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_RTEventLogAdmin.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_RTEventLogAdmin_Serv.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_RTEventLogAdmin_Skel.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_RTEvent_Serv.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_RTEvent_Skel.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/TAO_Svc_Utils.pc.in11
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_TIO.cpp288
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_TIO.h95
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.cpp181
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.h141
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.cpp127
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.h87
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_UTO.cpp246
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_UTO.h119
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/Timer_Helper.cpp156
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/Timer_Helper.h80
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/time_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/TimeBase.idl16
-rw-r--r--TAO/orbsvcs/orbsvcs/TimeService.idl179
-rw-r--r--TAO/orbsvcs/orbsvcs/Time_Utilities.cpp22
-rw-r--r--TAO/orbsvcs/orbsvcs/Time_Utilities.h111
-rw-r--r--TAO/orbsvcs/orbsvcs/Time_Utilities.i103
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Constraint_Interpreter.cpp255
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Constraint_Interpreter.h166
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Constraint_Nodes.cpp930
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Constraint_Nodes.h358
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Constraint_Tokens.h49
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Constraint_Visitors.cpp1204
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Constraint_Visitors.h449
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Constraint_l.cpp1790
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Constraint_y.cpp900
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Interpreter.cpp101
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Interpreter.h107
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils.cpp56
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils.h100
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils_T.cpp52
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils_T.h23
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Locking.h46
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Offer_Database.cpp389
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Offer_Database.h211
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators.cpp322
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators.h298
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators_T.cpp97
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators_T.h96
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Service_Type_Repository.cpp695
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Service_Type_Repository.h327
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Trader.cpp866
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Trader.h525
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Trader_Constraint_Visitors.cpp84
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Trader_Constraint_Visitors.h63
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp1940
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.h1019
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Trader_T.cpp325
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Trader_T.h278
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Trader_Utils.cpp1535
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Trader_Utils.h783
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Trading_Loader.cpp512
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Trading_Loader.h116
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/constraint.l136
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/constraint.y139
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/trading_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/trading_serv_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/trading_skel_export.h40
-rw-r--r--TAO/orbsvcs/orbsvcs/ec_typed_events.mpb21
-rw-r--r--TAO/orbsvcs/orbsvcs/ec_typed_events_idl.mpb16
-rw-r--r--TAO/orbsvcs/orbsvcs/ec_typed_events_serv.mpb15
-rw-r--r--TAO/orbsvcs/orbsvcs/ec_typed_events_skel.mpb32
-rw-r--r--TAO/orbsvcs/orbsvcs/miop.idl55
-rw-r--r--TAO/orbsvcs/orbsvcs/orbsvcs.mwc6
-rw-r--r--TAO/orbsvcs/orbsvcs/sfp.idl124
-rw-r--r--TAO/orbsvcs/orbsvcs/svc_utils_export.h40
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/ORBInitializer.cpp55
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/ORBInitializer.h92
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/Roundtrip.cpp47
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/Roundtrip.h46
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/Test.idl28
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/client.cpp194
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/default.conf4
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/default.conf.xml8
-rwxr-xr-xTAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/default_configuration.pl51
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/server.cpp391
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/svc.conf.xml10
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/Makefile.am13
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/LoadBalancing.mpc38
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Makefile.am173
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ORBInitializer.cpp78
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ORBInitializer.h97
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.cpp92
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.h92
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Roundtrip.cpp41
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Roundtrip.h46
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ServerRequestInterceptor.cpp81
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ServerRequestInterceptor.h122
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Test.idl28
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/client.cpp193
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/default.conf4
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/default.conf.xml8
-rwxr-xr-xTAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/default_configuration.pl51
-rwxr-xr-xTAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/run_test.pl48
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/server.cpp392
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/svc.conf6
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/svc.conf.xml10
-rw-r--r--TAO/orbsvcs/performance-tests/LoadBalancing/Makefile.am13
-rw-r--r--TAO/orbsvcs/performance-tests/Makefile.am14
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/Colocated_Roundtrip.mpc15
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/Makefile.am69
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/compare_histo.cpp71
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/compare_histo.pl94
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/driver.cpp248
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_reactive.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_reactive.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_rtcorba.conf3
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_rtcorba.conf.xml7
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_threaded.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_threaded.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_null.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_null.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_per_supplier.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_per_supplier.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_read.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_read.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_write.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_write.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_delayed.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_delayed.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_immediate.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_immediate.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_acc.sh17
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_cmp.sh10
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_compared_histo.sh14
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_gnuplot.pl11
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_histo.sh10
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_percentiles.sh47
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_stat.sh42
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/parameters9
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/run_dispatching.sh27
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/run_filter.sh17
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/run_locking.sh17
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/Federated_Roundtrip.mpc28
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/Makefile.am118
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/client.cpp302
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/parameters20
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/roundtrip.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/roundtrip.conf.xml6
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/run_roundtrip.sh26
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/server.cpp156
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Makefile.am19
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Makefile.am170
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/RTCORBA_Baseline.mpc52
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Roundtrip.cpp42
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Roundtrip.h38
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Test.idl27
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/client.cpp280
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/generate_cmp.sh10
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/generate_histo.sh8
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/generate_percentiles.sh47
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/realtime.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/realtime.conf.xml6
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/run.sh40
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/server.cpp137
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Callback.cpp43
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Callback.h58
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Makefile.am174
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/RTCORBA_Callback.mpc54
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session.cpp40
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session.h38
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session_Factory.cpp42
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session_Factory.h39
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Test.idl39
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/client.cpp335
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/parameters13
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/realtime.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/realtime.conf.xml6
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/run_test.sh34
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/server.cpp145
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/Makefile.am116
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/Roundtrip.mpc30
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/client.cpp231
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_reactive.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_reactive.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_rtcorba.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_rtcorba.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_threaded.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_threaded.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_read.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_read.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_write.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_write.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_delayed.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_delayed.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_immediate.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_immediate.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_null.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_null.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_per_supplier.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_per_supplier.conf.xml6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/parameters19
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/roundtrip.conf2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/roundtrip.conf.xml6
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_dispatching.sh47
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_locking.sh25
-rwxr-xr-xTAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_roundtrip.sh22
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/server.cpp168
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/Makefile.am116
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/TCP_Baseline.mpc30
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/client.cpp318
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/server.cpp203
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.cpp24
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.h54
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.inl27
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Group.cpp76
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Group.h101
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Group.inl36
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Options.cpp104
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Options.h60
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Pair.cpp82
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Pair.h100
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Pair.inl24
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Consumer.cpp141
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Consumer.h88
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Control.cpp179
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Control.h80
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/EC_Destroyer.cpp34
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/EC_Destroyer.h48
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/EC_Destroyer.inl7
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Federated_Test.idl105
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Implicit_Deactivator.cpp74
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Implicit_Deactivator.h52
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Implicit_Deactivator.inl13
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback.cpp40
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback.h47
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Consumer.cpp116
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Consumer.h76
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Pair.cpp56
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Pair.h79
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Pair.inl24
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Supplier.cpp134
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Supplier.h80
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.cpp121
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.h83
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.inl7
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Makefile.am181
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Holder.cpp37
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Holder.h62
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Holder.inl25
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Shutdown.cpp16
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Shutdown.h31
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Shutdown.inl23
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task.cpp39
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task.h46
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task.inl13
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task_Activator.cpp29
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task_Activator.h42
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task_Activator.inl19
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Peer_Base.cpp145
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Peer_Base.h76
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/PriorityBand_Setup.cpp63
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/PriorityBand_Setup.h46
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/PriorityBand_Setup.inl8
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RIR_Narrow.cpp49
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RIR_Narrow.h39
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RTCORBA_Setup.cpp82
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RTCORBA_Setup.h63
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RTCORBA_Setup.inl19
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RTClient_Setup.cpp55
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RTClient_Setup.h59
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RTClient_Setup.inl19
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Initializer.cpp47
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Initializer.h44
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Perf.mpc16
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RTPOA_Setup.cpp100
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RTPOA_Setup.h45
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RTPOA_Setup.inl13
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RTServer_Setup.cpp57
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RTServer_Setup.h50
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RTServer_Setup.inl13
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.cpp52
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.h74
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.inl37
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task.cpp130
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task.h78
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task_Stopper.cpp24
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task_Stopper.h41
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task_Stopper.inl16
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Servant_var.cpp58
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Servant_var.h81
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Servant_var.inl89
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Shutdown.cpp17
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Shutdown.h34
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Shutdown.inl20
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Supplier.cpp121
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Supplier.h81
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/SyncScope_Setup.cpp71
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/SyncScope_Setup.h53
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/SyncScope_Setup.inl7
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Task_Activator.cpp55
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Task_Activator.h86
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Task_Activator.inl13
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/rtec_perf_export.h40
-rw-r--r--TAO/orbsvcs/performance-tests/perf.mwc5
-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
4103 files changed, 714752 insertions, 0 deletions
diff --git a/TAO/orbsvcs/Concurrency_Service/.cvsignore b/TAO/orbsvcs/Concurrency_Service/.cvsignore
new file mode 100644
index 00000000000..60c35ef084d
--- /dev/null
+++ b/TAO/orbsvcs/Concurrency_Service/.cvsignore
@@ -0,0 +1 @@
+Concurrency_Service
diff --git a/TAO/orbsvcs/Concurrency_Service/Concurrency_Service.cpp b/TAO/orbsvcs/Concurrency_Service/Concurrency_Service.cpp
new file mode 100644
index 00000000000..a3245dae921
--- /dev/null
+++ b/TAO/orbsvcs/Concurrency_Service/Concurrency_Service.cpp
@@ -0,0 +1,252 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs/Concurrecy_Service/Concurrency_Service
+//
+// = FILENAME
+// Concurrency_Service.cpp
+//
+// = DESCRIPTION
+// This class implements a Concurrency_Service object.
+//
+// = AUTHORS
+// Torben Worm <tworm@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "Concurrency_Service.h"
+
+#include "ace/Argv_Type_Converter.h"
+#include "tao/debug.h"
+#include "ace/OS_main.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID(Concurrency_Service,
+ Concurrency_Service,
+ "$Id$")
+
+// Default Constructor.
+
+Concurrency_Service::Concurrency_Service (void)
+ : use_naming_service_ (1),
+ ior_file_name_ (0),
+ pid_file_name_ (0)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("Concurrency_Service::Concurrency_Service (void)\n")));
+}
+
+// Constructor taking command-line arguments.
+
+Concurrency_Service::Concurrency_Service (int argc,
+ ACE_TCHAR** argv
+ ACE_ENV_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("Concurrency_Service::Concurrency_Service (...)\n")));
+ this->init (argc, argv ACE_ENV_ARG_PARAMETER);
+}
+
+int
+Concurrency_Service::parse_args (int argc, ACE_TCHAR** argv)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("Concurrency_Service::parse_args\n")));
+
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("do:p:s"));
+ 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_file_name_ = get_opts.opt_arg();
+ break;
+ case 'p':
+ this->pid_file_name_ = get_opts.opt_arg();
+ break;
+ case 's':
+ this->use_naming_service_ = 0;
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("usage: %s")
+ ACE_TEXT(" [-d]")
+ ACE_TEXT(" [-o] <ior_output_file>")
+ ACE_TEXT("\n"),
+ argv[0]),
+ 1);
+ }
+ // Indicates sucessfull persing of command line.
+ return 0;
+}
+
+// Initialize the state of the Concurrency_Service object.
+
+int
+Concurrency_Service::init (int argc,
+ ACE_TCHAR **argv
+ ACE_ENV_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "Concurrency_Service::init\n"));
+
+ // Copy command line parameter.
+ ACE_Argv_Type_Converter command_line(argc, argv);
+
+ if (this->orb_manager_.init_child_poa (command_line.get_argc(),
+ command_line.get_ASCII_argv(),
+ "child_poa"
+ ACE_ENV_ARG_PARAMETER) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("%p\n"),
+ ACE_TEXT("init_child_poa")),
+ -1);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->parse_args (command_line.get_argc(), command_line.get_TCHAR_argv())!=0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("Could not parse command line\n")),
+ -1);
+ CORBA::String_var str =
+ this->orb_manager_.activate (this->my_concurrency_server_.GetLockSetFactory ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_DEBUG ((LM_DEBUG,
+ "The IOR is: <%s>\n",
+ ACE_TEXT_CHAR_TO_TCHAR(str.in ())));
+
+ if (this->ior_file_name_ != 0)
+ {
+ FILE* iorf = ACE_OS::fopen (ior_file_name_, ACE_TEXT("w"));
+ if (iorf == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_file_name_),
+ -1);
+ }
+
+ ACE_OS::fprintf (iorf, "%s\n", str.in ());
+ ACE_OS::fclose (iorf);
+ }
+
+ if (this->pid_file_name_ != 0)
+ {
+ FILE* pidf = ACE_OS::fopen (pid_file_name_, ACE_TEXT("w"));
+ if (pidf != 0)
+ {
+ ACE_OS::fprintf (pidf,
+ "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pidf);
+ }
+ }
+
+ if (this->use_naming_service_)
+ return this->init_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ return 0;
+}
+
+int
+Concurrency_Service::init_naming_service (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG, "Concurrency_Service::init_naming_service (...)\n"));
+ CORBA::ORB_var orb;
+ PortableServer::POA_var child_poa;
+
+ orb = this->orb_manager_.orb ();
+
+ int result = this->naming_client_.init (orb.in ());
+
+ if (result == -1)
+ return result;
+ lockset_factory_ =
+ this->my_concurrency_server_.GetLockSetFactory ()->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNaming::Name concurrency_context_name (1);
+ concurrency_context_name.length (1);
+ concurrency_context_name[0].id = CORBA::string_dup ("CosConcurrency");
+
+ this->concurrency_context_ =
+ this->naming_client_->bind_new_context (concurrency_context_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNaming::Name lockset_name (1);
+ lockset_name.length (1);
+ lockset_name[0].id = CORBA::string_dup ("LockSetFactory");
+ this->concurrency_context_->bind (lockset_name,
+ lockset_factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+// Run the ORB event loop.
+
+int
+Concurrency_Service::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "Concurrency_Service::run (...)\n"));
+
+ int retval = this->orb_manager_.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (retval == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Concurrency_Service::run"),
+ -1);
+ return 0;
+}
+
+// Destructor.
+
+Concurrency_Service::~Concurrency_Service (void)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "Concurrency_Service::~Concurrency_Service (void)\n"));
+}
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR ** argv)
+{
+ Concurrency_Service concurrency_service;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\n \t Concurrency Service:SERVER \n \n"));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int r = concurrency_service.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (r == -1)
+ return 1;
+
+ concurrency_service.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;
+ return 0;
+}
diff --git a/TAO/orbsvcs/Concurrency_Service/Concurrency_Service.h b/TAO/orbsvcs/Concurrency_Service/Concurrency_Service.h
new file mode 100644
index 00000000000..ccd0fe73930
--- /dev/null
+++ b/TAO/orbsvcs/Concurrency_Service/Concurrency_Service.h
@@ -0,0 +1,103 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs/Concurrency_Service/Concurency_Service
+//
+// = FILENAME
+// Concurrency_Service.h
+//
+// = DESCRIPTION
+// This class implements a subset of the functionality of the
+// CORBA Concurrency Service.
+//
+// = AUTHORS
+// Torben Worm <tworm@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef _CONCURRENCY_SERVICE_H
+#define _CONCURRENCY_SERVICE_H
+
+#include "ace/Get_Opt.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Log_Msg.h"
+#include "tao/Utils/ORB_Manager.h"
+#include "orbsvcs/Concurrency/Concurrency_Utils.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+
+class Concurrency_Service : public TAO_ORB_Manager
+{
+ // = TITLE
+ // Defines a class that encapsulates the implementation of the
+ // concurrency service.
+ // = DESCRIPTION
+ // This class uses the TAO_ORB_Manager, the TAO_Naming_Client, and
+ // the TAO_Concurrency_Server classes to implement a server for
+ // the concurrency service.
+public:
+ // = Initialization and termination methods.
+ Concurrency_Service (void);
+ // Default Constructor.
+
+ Concurrency_Service (int argc,
+ ACE_TCHAR **argv
+ ACE_ENV_ARG_DECL);
+ // Constructor taking the command-line arguments.
+
+ ~Concurrency_Service (void);
+ // Destructor.
+
+ int init (int argc,
+ ACE_TCHAR **argv
+ ACE_ENV_ARG_DECL);
+ // Initialize the Concurrency Service with the arguments.
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the Concurrency_Service.
+
+private:
+ int parse_args (int argc, ACE_TCHAR** argv);
+ // Parses the commandline arguments.
+
+ int init_naming_service (ACE_ENV_SINGLE_ARG_DECL);
+ // Initialize the name server and register the concurency server
+ // factory with it. Maybe later it will be convinient to register
+ // the individual lock sets with the naming service. At present the
+ // clients must keep track of the reference and pass 'by hand'
+
+ int use_naming_service_;
+ // Flag to tell wheter the naming service will be used.
+
+ const char *ior_file_name_;
+ // The name of the file where we output the IOR.
+
+ const char *pid_file_name_;
+ // The name of a file where the process stores its pid.
+
+ TAO_ORB_Manager orb_manager_;
+ // The ORB manager
+
+ TAO_Naming_Client naming_client_;
+ // An instance of the name client used for registering the factory
+ // objects.
+
+ TAO_Concurrency_Server my_concurrency_server_;
+ // An instance of the concurrency server.
+
+ CosConcurrencyControl::LockSetFactory_var lockset_factory_;
+ // Factory var to register with the naming service.
+
+ CosNaming::NamingContext_var concurrency_context_;
+ // Naming context for the concurrency service.
+
+ CosNaming::NamingContext_var naming_context_;
+ // Naming context for the naming service.
+};
+
+#endif /* _CONCURRENCY_SERVICE_H */
diff --git a/TAO/orbsvcs/Concurrency_Service/Concurrency_Service.mpc b/TAO/orbsvcs/Concurrency_Service/Concurrency_Service.mpc
new file mode 100644
index 00000000000..f18e0fc5ba6
--- /dev/null
+++ b/TAO/orbsvcs/Concurrency_Service/Concurrency_Service.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcsexe, core, concurrency_serv, naming, utils {
+ exename = Concurrency_Service
+}
diff --git a/TAO/orbsvcs/Concurrency_Service/Makefile.am b/TAO/orbsvcs/Concurrency_Service/Makefile.am
new file mode 100644
index 00000000000..b0aae6c44ac
--- /dev/null
+++ b/TAO/orbsvcs/Concurrency_Service/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.Concurrency_Service.am
+
+bin_PROGRAMS = Concurrency_Service
+
+Concurrency_Service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+Concurrency_Service_SOURCES = \
+ Concurrency_Service.cpp \
+ Concurrency_Service.h
+
+Concurrency_Service_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosConcurrency_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosConcurrency_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.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/Concurrency_Service/README b/TAO/orbsvcs/Concurrency_Service/README
new file mode 100644
index 00000000000..5eb1c83a529
--- /dev/null
+++ b/TAO/orbsvcs/Concurrency_Service/README
@@ -0,0 +1,129 @@
+$Id$
+
+This file describes how to run the TAO Concurrency Service and its
+accompanying tests. In addition, it describes the locations of the
+files that make up the service and tests. For a general description
+of the directory structure for the services please consult
+
+ $TAO_ROOT/docs/orbsvcs.html
+
+----------------------------------------
+
+HOW TO RUN THE SERVICE
+
+The Concurrency Service server runs in a thread-per-connection
+concurrency model, which is specified by the svc.conf file. This
+model is necessary to enable the server to block in a dedicated
+thread, i.e., one for each client. The concurrency service will not
+run in the reactive model.
+
+The server itself is located in the
+
+$TAO_ROOT/orbsvcs/Concurrency_Service
+
+directory.
+
+The server accepts the following options:
+
+ usage: ./Concurrency_Service [-d] [-o] <ior_output_file>
+ [-d] is the debug option
+ [-o] <ior_output_file> outputs the IOR of the lock set factory
+ to the file
+ [-s] Prevents the concurrency server from using the naming server
+
+The lock set factory is registered in the naming service in the
+CosConcurrency context with the name "LockSetFactory".
+
+----------------------------------------
+
+THE IMPLEMENTATION
+
+The implementation of the concurrency service objects is located in
+the $TAO_ROOT/orbsvcs/orbsvcs/Concurrency directory and consists of
+the following files:
+
+ CC_LockSet.{h,cpp} Implementation of the lock set. At present
+ there is only one implementation of the lock set which
+ implements multiple possession semantics for both
+ transactional (which is not otherwise supported) and
+ non-transactional clients. Please see the comments in
+ the CC_LockSet.h file for further details.
+
+ CC_LockSetFactory.{h,cpp} Implementation of the lock set
+ factory
+
+ Concurrency_Utils.{h,cpp} Wrapper around the concurrency
+ server.
+
+The current implementation does not support transactions. If you'd
+like to add support for transactions to TAO please let us know.
+
+----------------------------------------
+
+THE TESTS
+
+The tests are located in the $TAO_ROOT/orbsvcs/tests/Concurrency
+directory. There are two types of tests:
+
+ . A simple test -- which tests that it is possible to create
+ locks and lock them in all the different lock modes
+
+ . A more extended test which requires two (or more)
+ processes.
+
+The client accepts the following options:
+
+ usage: ./CC_client [-b] [-d]
+ [-c] <stdin|testscriptname>
+ [-e] <test;arg1;arg2>
+ [-f cc_factory-obj-ref-key-file]
+ [-k cc-obj-ref-key] [-x] [-s]
+
+ . The [-b] option runs the basic tests.
+ . The [-c] option runs a test script against the concurrency
+ service server. This option is described in more detail in
+ the $TAO_ROOT/orbsvcs/tests/Concurrency/README file. It is
+ the intent that this type of testing will be used instead of
+ the [-b] and [-e] tests. These tests are retained for
+ backwards compatibility.
+ . The [-d] option is the debug option.
+ . The [-e] option is for running one of the extended tests. The
+ format of the argument to the -e option is <test;arg1;arg2>
+ where test is the name of the test (at present test =
+ {1,2,3}) and arg1 and arg2 are arguments to the test. See
+ the example below.
+
+ . The [-f] option reads the factory IOR from a file. This is
+ currently not supported.
+
+ . The [-k] option takes the factory IOR as argument on the
+ commandline. This is currently not supported.
+
+ . The [-x] option tells the server to shut down
+ gracefully. Currently this has no effect.
+
+ . The [-s] option tells the test not to use the naming
+ service. This is currently not supported.
+
+----------------------------------------
+
+EXAMPLE TEST RUN
+
+ Window-1> ./Concurrency_Service -d
+ Window-2> ./CC_client -b
+ Window-2> ./CC_client -e '1;Name'
+ Window-2> ./CC_client -e '2;Name'
+ Window-3> ./CC_client -e '3;Name'
+
+NOTE: It seems that there is a problem using the naming service the
+ first time the client is run. This error does not appear if the
+ environment variable 'NameService' is set to the IOR of the naming
+ service (the IOR of the naming service is printed when the
+ Concurrency_Control server is started).
+
+----------------------------------------
+
+CONTACT POINT
+
+If you have any questions about this service, please contact Torben
+Worm at <tworm@cs.wustl.edu>.
diff --git a/TAO/orbsvcs/Concurrency_Service/svc.conf b/TAO/orbsvcs/Concurrency_Service/svc.conf
new file mode 100644
index 00000000000..2071e54859c
--- /dev/null
+++ b/TAO/orbsvcs/Concurrency_Service/svc.conf
@@ -0,0 +1,4 @@
+# This service must use a thread-per-connection model to enable the
+# server to block in a dedicated thread, i.e., one for each client.
+# The concurrency service will not run in the reactive model.
+static Server_Strategy_Factory "-ORBconcurrency thread-per-connection"
diff --git a/TAO/orbsvcs/Concurrency_Service/svc.conf.xml b/TAO/orbsvcs/Concurrency_Service/svc.conf.xml
new file mode 100644
index 00000000000..ac491a2ce35
--- /dev/null
+++ b/TAO/orbsvcs/Concurrency_Service/svc.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/Concurrency_Service/svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- This service must use a thread-per-connection model to enable the -->
+ <!-- server to block in a dedicated thread, i.e., one for each client. -->
+ <!-- The concurrency service will not run in the reactive model. -->
+ <static id="Server_Strategy_Factory" params="-ORBconcurrency thread-per-connection"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/CosEvent_Service/.cvsignore b/TAO/orbsvcs/CosEvent_Service/.cvsignore
new file mode 100644
index 00000000000..a9304243e61
--- /dev/null
+++ b/TAO/orbsvcs/CosEvent_Service/.cvsignore
@@ -0,0 +1 @@
+CosEvent_Service
diff --git a/TAO/orbsvcs/CosEvent_Service/CosEvent_Service.cpp b/TAO/orbsvcs/CosEvent_Service/CosEvent_Service.cpp
new file mode 100644
index 00000000000..2bb2e9205ac
--- /dev/null
+++ b/TAO/orbsvcs/CosEvent_Service/CosEvent_Service.cpp
@@ -0,0 +1,75 @@
+// $Id$
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_Default_Factory.h"
+#include "orbsvcs/CosEvent/CEC_Event_Loader.h"
+#include "ace/Get_Opt.h"
+#include "ace/Argv_Type_Converter.h"
+#include "ace/OS_main.h"
+
+ACE_RCSID (CosEvent_Service,
+ CosEvent_Service,
+ "$Id$")
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR* argv[])
+{
+ TAO_CEC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Copy command line parameter.
+ ACE_Argv_Type_Converter command_line(argc, argv);
+
+ // Intialize the ORB
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (command_line.get_argc(), command_line.get_ASCII_argv(), 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Call TAO_CEC_Event_Loader::init (argc, argv) from here.
+ TAO_CEC_Event_Loader event_service;
+
+ // To intialise the service
+ int result =
+ event_service.init (command_line.get_argc(), command_line.get_TCHAR_argv());
+
+ if (result == -1)
+ return 1;
+
+ // @@ Run forever... even after the EC is destroyed...
+ // The "Right Way"[tm] to fix this is to modify
+ // TAO_CEC_EventChannel to get a new option.. If the option is
+ // set then we destroy the ORB on EventChannel::destroy(),
+ // otherwise we don't.
+ // The option will not be set by default, but the user can pass
+ // it in the command line, and in this main program with set it
+ // to 1 by default or something like that...
+ // Don't worry about this change yet... Let's get all the changes
+ // in and then we can fix the EC shutdown problem...
+ //
+ // As inidicated above, The Typed EC implementation can now be
+ // destroyed by passing -d at the command line and
+ // calling destroy on the typed EC interface.
+ // Calling fini() completes the destruction, although most of
+ // this is done in TAO_CEC_TypedEventChannel::shutdown().
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ event_service.fini();
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ // Destroy the ORB
+ orb->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, argv[0]);
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/CosEvent_Service/CosEvent_Service.mpc b/TAO/orbsvcs/CosEvent_Service/CosEvent_Service.mpc
new file mode 100644
index 00000000000..90263aae047
--- /dev/null
+++ b/TAO/orbsvcs/CosEvent_Service/CosEvent_Service.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcsexe, core, naming, event_serv, svc_utils, iortable, messaging_optional, portableserver {
+ exename = CosEvent_Service
+}
diff --git a/TAO/orbsvcs/CosEvent_Service/Makefile.am b/TAO/orbsvcs/CosEvent_Service/Makefile.am
new file mode 100644
index 00000000000..fe84d063565
--- /dev/null
+++ b/TAO/orbsvcs/CosEvent_Service/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.CosEvent_Service.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+bin_PROGRAMS = CosEvent_Service
+
+CosEvent_Service_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
+
+CosEvent_Service_SOURCES = \
+ CosEvent_Service.cpp
+
+CosEvent_Service_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.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_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_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/CosEvent_Service/README b/TAO/orbsvcs/CosEvent_Service/README
new file mode 100644
index 00000000000..448f3d47dda
--- /dev/null
+++ b/TAO/orbsvcs/CosEvent_Service/README
@@ -0,0 +1,101 @@
+ CORBA COS Event Service
+ -----------------------
+
+The CosEvent_Service is a COS compliant Event Service.
+
+The service is registered with the naming service with the name
+"CosEventService" . It exposes the <EventChannel> interface which can be
+used by suppliers and consumers to send and receive events.
+
+WARNING: In TAO 1.0.14 we introduced a new implementation of the COS
+Event Service, this new implementation supports both the push and pull
+models, and does not use the Real-time Event Service as its backend.
+Both implementations are useful, for example, the native
+implementation is more efficient and fully featured, but cannot
+exploit the features in the RTEC, such as filtering and multicast
+based federations.
+
+To run the Event Channel:
+------------------------
+1. you should have a running Naming Service.
+ if not, start one as:
+ $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -m 1
+
+2. if you want to use the -t option you should have a running
+ Real Time Event Channel.
+ if not, start one at $TAO_ROOT/orbsvcs/Event_Service/Event_Service
+
+3. execute the CosEvent_Service.
+
+Command line parameters:
+------------------------
+ -n <COS Event Service name>
+ specifies the name with which to register the Event Service.
+
+ -r
+ specifies that a local Real Time Event Channel (Rtec) should be
+ created and used.
+
+ -t <Real Time Event Service name>
+ specifies the name with which to *look* for the RtEC.This option is
+ only useful along with the -r option.
+
+The next 3 options are used to introduce a filtering mechanism for the
+Event Channel based on event types and source ids.
+
+ -e ["EventType_1 EventType_2..."]
+ specifies the event types for the ConsumerQOS.When the Rtec is being
+ setup, the ConsumerQOS is specified.
+ The event types should start at >= ACE_ES_EVENT_UNDEFINED = 16.
+ e.g. -e "17 20 40" specifies that event types with ids 17, 20 and 40
+ should be passed to the consumers.
+
+ -o ["EventSourceID_1 EventSourceID_2.."]
+ specifies the source ids for the ConsumerQOS.
+
+ -p ["sourceID EventTypeID"]
+ specifies a pair of sourceid and event type for the Supplier QOS.
+
+
+Running the native COS Event Channel
+------------------------------------
+
+ The native implementation of the COS Event Channel is run
+using:
+
+$ CosEvent_Service_Native
+
+ on top of the regular -ORB arguments and the service
+configurator parameters described in:
+
+$TAO_ROOT/docs/cec_options.html
+
+ this implementation also understands the following arguments:
+
+ -n name Use <name> when binding the object
+ reference in the naming service
+ -r Use rebind() to store the object
+ reference in the naming service
+ -x do not use the naming service
+
+
+
+ Note:
+ ====
+ By default, the Naming Service disables multicast discovery.
+ The "-m 1" option enables the Naming Service to be resolved via
+ multicast.
+
+ If you do not wish to do this, then use the
+ -ORBInitRef option in which case the Naming Service should be started
+ as:
+
+ $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o naming.ior
+
+ and the CosEvent_Service as
+
+ $ CosEvent_Service_Native -ORBInitRef NameService=file://naming.ior
+
+Author:
+-------
+Pradeep Gore <pradeep@cs.wustl.edu>
diff --git a/TAO/orbsvcs/Dump_Schedule/.cvsignore b/TAO/orbsvcs/Dump_Schedule/.cvsignore
new file mode 100644
index 00000000000..fb2c130a840
--- /dev/null
+++ b/TAO/orbsvcs/Dump_Schedule/.cvsignore
@@ -0,0 +1 @@
+Dump_Schedule
diff --git a/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp b/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp
new file mode 100644
index 00000000000..ec523388f64
--- /dev/null
+++ b/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp
@@ -0,0 +1,78 @@
+
+// $Id$
+
+#include "ace/Sched_Params.h"
+#include "ace/Get_Opt.h"
+#include "ace/Argv_Type_Converter.h"
+#include "ace/OS_main.h"
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Scheduler_Factory.h"
+
+ACE_RCSID (Dump_Schedule,
+ Dump_Schedule,
+ "$Id$")
+
+// This program dumps the results of one scheduling in a C++ file.
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR* argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Copy command line parameter.
+ ACE_Argv_Type_Converter command_line(argc, argv);
+
+ // Initialize ORB.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (command_line.get_argc(), command_line.get_ASCII_argv(), "internet" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 find the Naming Service\n"),
+ 1);
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ const char *name = "ScheduleService";
+ if (command_line.get_argc() > 1)
+ {
+ name = command_line.get_ASCII_argv()[1];
+ }
+ ACE_Scheduler_Factory::use_config (naming_context.in (), name);
+
+ 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 (),
+ "Scheduler_Runtime.cpp");
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Dump_Schedule");
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.mpc b/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.mpc
new file mode 100644
index 00000000000..2468639a7a3
--- /dev/null
+++ b/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcsexe, core, rtsched, naming, svc_utils, iortable, portableserver {
+ exename = Dump_Schedule
+}
diff --git a/TAO/orbsvcs/Dump_Schedule/Makefile.am b/TAO/orbsvcs/Dump_Schedule/Makefile.am
new file mode 100644
index 00000000000..c286f12f251
--- /dev/null
+++ b/TAO/orbsvcs/Dump_Schedule/Makefile.am
@@ -0,0 +1,47 @@
+## 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.Dump_Schedule.am
+
+bin_PROGRAMS = Dump_Schedule
+
+Dump_Schedule_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+Dump_Schedule_SOURCES = \
+ Dump_Schedule.cpp
+
+Dump_Schedule_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(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/Event_Service/.cvsignore b/TAO/orbsvcs/Event_Service/.cvsignore
new file mode 100644
index 00000000000..0d4b7f11eb3
--- /dev/null
+++ b/TAO/orbsvcs/Event_Service/.cvsignore
@@ -0,0 +1 @@
+Event_Service
diff --git a/TAO/orbsvcs/Event_Service/Event_Service.cpp b/TAO/orbsvcs/Event_Service/Event_Service.cpp
new file mode 100644
index 00000000000..f0510a4fef0
--- /dev/null
+++ b/TAO/orbsvcs/Event_Service/Event_Service.cpp
@@ -0,0 +1,469 @@
+// $Id$
+
+#include "Event_Service.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/Argv_Type_Converter.h"
+#include "ace/OS_main.h"
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Sched/Config_Scheduler.h"
+
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+
+#include "tao/BiDir_GIOP/BiDirGIOP.h"
+#include "ace/OS_NS_strings.h"
+
+ACE_RCSID (Event_Service,
+ Event_Service,
+ "$Id$")
+
+int ACE_TMAIN (int argc, ACE_TCHAR* argv[])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ Event_Service event_service;
+ return event_service.run (argc, argv);
+}
+
+// ****************************************************************
+
+Event_Service::Event_Service (void)
+ : sched_impl_ (0),
+ ec_impl_ (0),
+ scheduler_type_ (ES_SCHED_NONE),
+ use_bidir_giop_ (false),
+ bind_to_naming_service_ (true)
+{
+}
+
+Event_Service::~Event_Service (void)
+{
+ delete this->ec_impl_;
+ this->ec_impl_ = 0;
+ delete this->sched_impl_;
+ this->sched_impl_ = 0;
+}
+
+int
+Event_Service::run (int argc, ACE_TCHAR* argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Make a copy of command line parameter.
+ ACE_Argv_Type_Converter command(argc, argv);
+
+ // Initialize ORB.
+ this->orb_ =
+ CORBA::ORB_init (command.get_argc(), command.get_ASCII_argv(), "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->parse_args (command.get_argc(), command.get_TCHAR_argv()) == -1)
+ return 1;
+
+ CORBA::Object_var root_poa_object =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil (root_poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the root POA.\n"),
+ 1);
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (root_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;
+
+ // When we have a service name or a non local scheduler we must use the
+ // naming service.
+
+ bool use_name_service = bind_to_naming_service_ ||
+ this->scheduler_type_ != ES_SCHED_NONE;
+
+ CORBA::Object_var naming_obj;
+ RtecScheduler::Scheduler_var scheduler;
+ CosNaming::NamingContext_var naming_context;
+
+ if (use_name_service)
+ {
+ 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 initialize the Naming Service.\n"),
+ 1);
+
+ 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");
+
+ // The old EC always needs a scheduler. If none is
+ // specified, we default to a local scheduler
+ if (this->scheduler_type_ == ES_SCHED_LOCAL)
+ {
+ // Create a local scheduler instance
+ ACE_NEW_RETURN (this->sched_impl_,
+ ACE_Config_Scheduler,
+ 1);
+
+ scheduler = this->sched_impl_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Register the servant with the Naming Context....
+ if (!CORBA::is_nil (naming_context.in ()))
+ {
+ naming_context->rebind (schedule_name, scheduler.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ else if (this->scheduler_type_ == ES_SCHED_GLOBAL)
+ {
+ // Get reference to a scheduler from naming service
+ CORBA::Object_var tmp =
+ naming_context->resolve (schedule_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ scheduler = RtecScheduler::Scheduler::_narrow (tmp.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (scheduler.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to resolve the Scheduling Service.\n"),
+ 1);
+ }
+
+ TAO_EC_Event_Channel_Attributes attr (root_poa.in (),
+ root_poa.in ());
+
+ if (this->scheduler_type_ != ES_SCHED_NONE)
+ {
+ attr.scheduler = scheduler.in ();
+ }
+
+ TAO_EC_Event_Channel* ec_impl = 0;
+ ACE_NEW_RETURN (ec_impl,
+ TAO_EC_Event_Channel (attr),
+ 1);
+ this->ec_impl_ = ec_impl;
+
+ ec_impl->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var ec;
+
+ // If the object_id_ is empty and we don't use BiDIR GIOP, activate the
+ // servant under the default POA, else create a new child POA with
+ // the needed policies
+ int persistent = ACE_OS::strcmp(this->object_id_.c_str(), "");
+ if ((persistent == 0) && (this->use_bidir_giop_ == false))
+ {
+ // Notice that we activate *this* object with the POA, but we
+ // forward all the requests to the underlying EC
+ // implementation.
+ ec = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ int index = 0;
+
+ // Create child POA
+ CORBA::PolicyList policies (3);
+
+ if (persistent != 0)
+ {
+ policies[index++] =
+ root_poa->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ policies[index++] =
+ root_poa->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ if (this->use_bidir_giop_ == true)
+ {
+ CORBA::Any pol;
+ pol <<= BiDirPolicy::BOTH;
+ policies[index++] =
+ this->orb_->create_policy (BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE,
+ pol
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ policies.length (index);
+
+ ACE_CString child_poa_name = "childPOA";
+ PortableServer::POA_var child_poa =
+ root_poa->create_POA (child_poa_name.c_str (),
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Creation of persistentPOA 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;
+ }
+
+ if (CORBA::is_nil (child_poa.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the child POA.\n"),
+ 1);
+
+ PortableServer::ObjectId_var ec_object_id =
+ PortableServer::string_to_ObjectId(object_id_.c_str());
+
+ child_poa->activate_object_with_id(ec_object_id.in(),
+ this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var ec_obj =
+ child_poa->id_to_reference(ec_object_id.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ec =
+ RtecEventChannelAdmin::EventChannel::_narrow(ec_obj.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ CORBA::String_var str =
+ this->orb_->object_to_string (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ACE_OS::strcmp(this->ior_file_name_.c_str(), "") != 0)
+ {
+ FILE *output_file=
+ ACE_OS::fopen (ACE_TEXT_CHAR_TO_TCHAR(this->ior_file_name_.c_str()),
+ ACE_TEXT("w"));
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ this->ior_file_name_.c_str()),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", str.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ if (ACE_OS::strcmp(this->pid_file_name_.c_str(), "") != 0)
+ {
+ FILE *pidf =
+ ACE_OS::fopen (ACE_TEXT_CHAR_TO_TCHAR(this->pid_file_name_.c_str()),
+ ACE_TEXT("w"));
+ if (pidf != 0)
+ {
+ ACE_OS::fprintf (pidf,
+ "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pidf);
+ }
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("The EC IOR is <%s>\n"),
+ ACE_TEXT_CHAR_TO_TCHAR(str.in ())));
+
+ if (bind_to_naming_service_ && !CORBA::is_nil (naming_context.in ()))
+ {
+ CosNaming::Name channel_name (1);
+ channel_name.length (1);
+ channel_name[0].id = CORBA::string_dup (this->service_name_.c_str());
+ naming_context->rebind (channel_name, ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("%s; running event service\n"),
+ ACE_TEXT_CHAR_TO_TCHAR(__FILE__)));
+
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (bind_to_naming_service_ && !CORBA::is_nil (naming_context.in ()))
+ {
+ CosNaming::Name channel_name (1);
+ channel_name.length (1);
+ channel_name[0].id = CORBA::string_dup (this->service_name_.c_str());
+ naming_context->unbind (channel_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ if (!CORBA::is_nil (scheduler.in ()) &&
+ !CORBA::is_nil (naming_context.in ()))
+ {
+ naming_context->unbind (schedule_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "EC");
+ }
+ ACE_ENDTRY;
+
+
+ return 0;
+}
+
+int
+Event_Service::parse_args (int argc, ACE_TCHAR* argv [])
+{
+ // default values...
+ this->service_name_ = "EventService";
+
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("n:o:p:s:q:bx"));
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'n':
+ this->service_name_ = ACE_TEXT_ALWAYS_CHAR(get_opt.opt_arg ());
+ break;
+
+ case 'o':
+ this->ior_file_name_ = ACE_TEXT_ALWAYS_CHAR(get_opt.opt_arg ());
+ break;
+
+ case 'p':
+ this->pid_file_name_ = ACE_TEXT_ALWAYS_CHAR(get_opt.opt_arg ());
+ break;
+
+ case 'q':
+ this->object_id_ = ACE_TEXT_ALWAYS_CHAR(get_opt.opt_arg ());
+ break;
+
+ case 'b':
+ this->use_bidir_giop_ = true;
+ break;
+
+ case 'x':
+ this->bind_to_naming_service_ = false;
+ break;
+
+ case 's':
+ // It could be just a flag (i.e. no "global" or "local"
+ // argument, but this is consistent with the EC_Multiple
+ // test and also allows for a runtime scheduling service.
+
+ if (ACE_OS::strcasecmp (get_opt.opt_arg (), ACE_TEXT("global")) == 0)
+ {
+ this->scheduler_type_ = ES_SCHED_GLOBAL;
+ }
+ else if (ACE_OS::strcasecmp (get_opt.opt_arg (), ACE_TEXT("local")) == 0)
+ {
+ this->scheduler_type_ = ES_SCHED_LOCAL;
+ }
+ else if (ACE_OS::strcasecmp (get_opt.opt_arg (), ACE_TEXT("none")) == 0)
+ {
+ this->scheduler_type_ = ES_SCHED_NONE;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("Unknown scheduling type <%s> ")
+ ACE_TEXT("defaulting to none\n"),
+ get_opt.opt_arg ()));
+ this->scheduler_type_ = ES_SCHED_NONE;
+ }
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("Usage: %s ")
+ ACE_TEXT("-n service_name ")
+ ACE_TEXT("-o ior_file_name ")
+ ACE_TEXT("-p pid_file_name ")
+ ACE_TEXT("-s <global|local|none> ")
+ ACE_TEXT("-q ec_object_id ")
+ ACE_TEXT("-x [disable naming service bind] ")
+ ACE_TEXT("-b [use bidir giop] ")
+ ACE_TEXT("\n"),
+ argv[0]));
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+
+RtecEventChannelAdmin::ConsumerAdmin_ptr
+Event_Service::for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->ec_impl_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+RtecEventChannelAdmin::SupplierAdmin_ptr
+Event_Service::for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->ec_impl_->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+Event_Service::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->ec_impl_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->orb_->shutdown ();
+}
+
+RtecEventChannelAdmin::Observer_Handle
+Event_Service::append_observer (RtecEventChannelAdmin::Observer_ptr observer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER))
+{
+ return this->ec_impl_->append_observer (observer ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Event_Service::remove_observer (RtecEventChannelAdmin::Observer_Handle handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_REMOVE_OBSERVER))
+{
+ this->ec_impl_->remove_observer (handle ACE_ENV_ARG_PARAMETER);
+}
+
diff --git a/TAO/orbsvcs/Event_Service/Event_Service.h b/TAO/orbsvcs/Event_Service/Event_Service.h
new file mode 100644
index 00000000000..efd15738d4c
--- /dev/null
+++ b/TAO/orbsvcs/Event_Service/Event_Service.h
@@ -0,0 +1,104 @@
+/* -*- C++ -*- */
+
+// ============================================================================
+/**
+ * @file Event_Service.h
+ *
+ * $Id$
+ *
+ * The TAO event service implementation.
+ */
+#ifndef EC_EVENT_SERVICE_H
+#define EC_EVENT_SERVICE_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventChannelAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include "orbsvcs/RtecSchedulerS.h"
+#include "ace/SString.h"
+
+/**
+ * @class Event_Service
+ *
+ * This class decorates an Event Channel implementation, but in a very simple
+ * way: destroy() also shutdowns the ORB.
+ *
+ * The Event_Channel implementations should not shutdown the ORB by default,
+ * but in this case, where the Event_Channel is (almost) the only service on
+ * the host, it makes more sense to do so.
+ */
+class Event_Service : public POA_RtecEventChannelAdmin::EventChannel
+{
+public:
+ Event_Service (void);
+ virtual ~Event_Service (void);
+
+ /// Run the event service.
+ int run (int argc, ACE_TCHAR* argv[]);
+
+ // = The 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));
+ 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));
+
+private:
+ /// Parse the command line args
+ int parse_args (int argc, ACE_TCHAR* argv[]);
+
+ enum Sched_type_t {ES_SCHED_NONE, ES_SCHED_GLOBAL, ES_SCHED_LOCAL};
+
+private:
+ /// The Scheduler implementation.
+ POA_RtecScheduler::Scheduler *sched_impl_;
+
+ /// The Event Channel implementation.
+ POA_RtecEventChannelAdmin::EventChannel *ec_impl_;
+
+ /// The name we use to bind with the NameService
+ ACE_CString service_name_;
+
+ /// The name of the file were we output the Event_Service IOR.
+ ACE_CString ior_file_name_;
+
+ /// The name of a file where the process stores its pid
+ ACE_CString pid_file_name_;
+
+ /// The name of the servant we use when we use persistent IORs
+ ACE_CString object_id_;
+
+ /// Should we use a global scheduler or a local one or none?
+ Sched_type_t scheduler_type_;
+
+ /// A reference to the ORB, to shut it down properly.
+ CORBA::ORB_var orb_;
+
+ /// Use BiDirectional GIOP
+ bool use_bidir_giop_;
+
+ /// Should we bind to the naming service
+ bool bind_to_naming_service_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* EC_EVENT_SERVICE_H */
diff --git a/TAO/orbsvcs/Event_Service/Event_Service.mpc b/TAO/orbsvcs/Event_Service/Event_Service.mpc
new file mode 100644
index 00000000000..00fc51207c2
--- /dev/null
+++ b/TAO/orbsvcs/Event_Service/Event_Service.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcsexe, core, rtevent_serv, rtschedevent, bidir_giop {
+ exename = Event_Service
+}
diff --git a/TAO/orbsvcs/Event_Service/Makefile.am b/TAO/orbsvcs/Event_Service/Makefile.am
new file mode 100644
index 00000000000..f5f934274fe
--- /dev/null
+++ b/TAO/orbsvcs/Event_Service/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.Event_Service.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+bin_PROGRAMS = Event_Service
+
+Event_Service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+Event_Service_SOURCES = \
+ Event_Service.cpp \
+ Event_Service.h
+
+Event_Service_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_BiDirGIOP.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/Event_Service/svc.conf b/TAO/orbsvcs/Event_Service/svc.conf
new file mode 100644
index 00000000000..1645185e704
--- /dev/null
+++ b/TAO/orbsvcs/Event_Service/svc.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"
diff --git a/TAO/orbsvcs/Event_Service/svc.conf.xml b/TAO/orbsvcs/Event_Service/svc.conf.xml
new file mode 100644
index 00000000000..4a9c51c07f5
--- /dev/null
+++ b/TAO/orbsvcs/Event_Service/svc.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/Event_Service/svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Event_Service/.cvsignore b/TAO/orbsvcs/FTRT_Event_Service/Event_Service/.cvsignore
new file mode 100644
index 00000000000..27d8be5f25e
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Event_Service/.cvsignore
@@ -0,0 +1 @@
+ftrt_eventservice
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Event_Service/FTRT_Event_Service.mpc b/TAO/orbsvcs/FTRT_Event_Service/Event_Service/FTRT_Event_Service.mpc
new file mode 100644
index 00000000000..dfda930d86d
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Event_Service/FTRT_Event_Service.mpc
@@ -0,0 +1,7 @@
+// -*- MPC -*-
+// $Id$
+
+project(FTRT_Event_Service): orbsvcsexe, utils, rtschedevent, ftrteventchannel, ftorbutils {
+ exename = ftrt_eventservice
+ includes += $(TAO_ROOT)/orbsvcs/FtRtEvent/Utils
+}
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Event_Service/FT_EventService.cpp b/TAO/orbsvcs/FTRT_Event_Service/Event_Service/FT_EventService.cpp
new file mode 100644
index 00000000000..add3c0f5153
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Event_Service/FT_EventService.cpp
@@ -0,0 +1,306 @@
+// $Id$
+
+#include "FT_EventService.h"
+#include "ace/Argv_Type_Converter.h"
+#include "ace/Thread_Manager.h"
+#include "ace/Get_Opt.h"
+#include "ace/INET_Addr.h"
+#include "ace/SOCK_Connector.h"
+#include "ace/SOCK_Stream.h"
+#include "orbsvcs/Sched/Config_Scheduler.h"
+#include "orbsvcs/Scheduler_Factory.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTRTEC_ServiceActivate.h"
+#include "orbsvcs/FtRtEvent/Utils/Log.h"
+#include "ace/OS_main.h"
+
+ACE_RCSID (Event_Service,
+ FT_EventService,
+ "$Id$")
+
+int ACE_TMAIN (int argc, ACE_TCHAR* argv[])
+{
+ FT_EventService event_service;
+ return event_service.run (argc, argv);
+}
+
+FT_EventService::FT_EventService()
+: global_scheduler_(0)
+, sched_impl_(0)
+, membership_(TAO_FTEC_Event_Channel::UNSPECIFIED)
+, num_threads_(1)
+, task_(orb_)
+{
+}
+
+FT_EventService::~FT_EventService()
+{
+ delete sched_impl_;
+}
+
+int
+FT_EventService::run(int argc, ACE_TCHAR* argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Make a copy of command line parameter.
+ ACE_Argv_Type_Converter command(argc, argv);
+
+ // Initialize ORB.
+ orb_ = CORBA::ORB_init (command.get_argc(),
+ command.get_ASCII_argv(),
+ "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->parse_args (command.get_argc(), command.get_TCHAR_argv()) == -1)
+ return 1;
+
+ CORBA::Object_var root_poa_object =
+ orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil (root_poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the root POA.\n"),
+ 1);
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (root_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;
+
+ 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 initialize the Naming Service.\n"),
+ 1);
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ setup_scheduler(naming_context.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+
+ poa_manager->activate(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Activate the Event channel implementation
+
+ TAO_FTEC_Event_Channel ec(orb_, root_poa);
+
+ FtRtecEventChannelAdmin::EventChannel_var ec_ior =
+ ec.activate(membership_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (report_factory(orb_.in(), ec_ior.in() )==-1)
+ return -1;
+
+ orb_->run(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION, "A CORBA Exception occurred.");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+
+ ACE_Thread_Manager::instance()->wait();
+ return 0;
+}
+
+int
+FT_EventService::parse_args (int argc, ACE_TCHAR* argv [])
+{
+ /// get the membership from the environment variable
+ char* member = ACE_OS::getenv("FTEC_MEMBERSHIP");
+
+ membership_ = TAO_FTEC_Event_Channel::UNSPECIFIED;
+
+ if (member) {
+ if (ACE_OS::strcasecmp(member, "PRIMARY")==0) {
+ membership_ = TAO_FTEC_Event_Channel::PRIMARY;
+ }
+ else if (ACE_OS::strcasecmp(member, "BACKUP")==0) {
+ membership_ = TAO_FTEC_Event_Channel::BACKUP;
+ }
+ }
+
+ char* n_threads = ACE_OS::getenv("FTEC_NUM_THREAD");
+
+ this->num_threads_ = 1;
+ if (n_threads)
+ this->num_threads_ = ACE_OS::atoi(n_threads);
+
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("d:jn:ps:"));
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'd':
+ TAO_FTRTEC::Log::level(ACE_OS::atoi(get_opt.opt_arg ()));
+ break;
+ case 'j':
+ this->membership_ = TAO_FTEC_Event_Channel::BACKUP;
+ break;
+ case 'n':
+ this->num_threads_ = ACE_OS::atoi(get_opt.opt_arg ());
+ break;
+ case 'p':
+ this->membership_ = TAO_FTEC_Event_Channel::PRIMARY;
+ break;
+ case 's':
+ // It could be just a flag (i.e. no "global" or "local"
+ // argument, but this is consistent with the EC_Multiple
+ // test and also allows for a runtime scheduling service.
+
+ if (ACE_OS::strcasecmp (get_opt.opt_arg (), ACE_TEXT("global")) == 0)
+ {
+ this->global_scheduler_ = 1;
+ }
+ else if (ACE_OS::strcasecmp (get_opt.opt_arg (), ACE_TEXT("local")) == 0)
+ {
+ this->global_scheduler_ = 0;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("Unknown scheduling type <%s> ")
+ ACE_TEXT("defaulting to local\n"),
+ get_opt.opt_arg ()));
+ this->global_scheduler_ = 0;
+ }
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("Usage: %s \n")
+ ACE_TEXT(" -j join the object group\n")
+ ACE_TEXT(" -p set as primary\n")
+ ACE_TEXT(" -s <global|local> \n")
+ ACE_TEXT("\n"),
+ argv[0]));
+ return -1;
+ }
+ }
+
+ if (this->num_threads_ < 1)
+ ACE_ERROR_RETURN((LM_ERROR, "Invalid number of threads specified\n"), -1);
+
+ return 0;
+}
+
+void
+FT_EventService::setup_scheduler(CosNaming::NamingContext_ptr naming_context
+ ACE_ENV_ARG_DECL)
+{
+ RtecScheduler::Scheduler_var scheduler;
+ if (CORBA::is_nil(naming_context)) {
+ ACE_NEW_THROW_EX (this->sched_impl_,
+ ACE_Config_Scheduler,
+ CORBA::NO_MEMORY());
+
+ scheduler = this->sched_impl_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (ACE_Scheduler_Factory::server(scheduler.in()) == -1)
+ ACE_ERROR((LM_ERROR,"Unable to install scheduler\n"));
+ }
+ else {
+ // 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");
+
+
+ if (1)
+ {
+ // We must find the scheduler object reference...
+
+ if (this->global_scheduler_ == 0)
+ {
+ ACE_NEW_THROW_EX (this->sched_impl_,
+ ACE_Config_Scheduler,
+ CORBA::NO_MEMORY());
+
+ scheduler = this->sched_impl_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Register the servant with the Naming Context....
+ naming_context->rebind (schedule_name, scheduler.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ CORBA::Object_var tmp =
+ naming_context->resolve (schedule_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ scheduler = RtecScheduler::Scheduler::_narrow (tmp.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ }
+}
+
+int
+FT_EventService::report_factory(CORBA::ORB_ptr orb,
+ FtRtecEventChannelAdmin::EventChannel_ptr ec)
+{
+ ACE_TRY_NEW_ENV {
+ char* addr = ACE_OS::getenv("EventChannelFactoryAddr");
+
+ if (addr != NULL) {
+ // instaniated by object factory, report my ior back to the factory
+ ACE_INET_Addr factory_addr(addr);
+ ACE_SOCK_Connector connector;
+ ACE_SOCK_Stream stream;
+
+ ACE_DEBUG((LM_DEBUG,"connecting to %s\n",addr));
+ if (connector.connect(stream, factory_addr) == -1)
+ ACE_ERROR_RETURN((LM_ERROR, "(%P|%t) Invalid Factory Address\n"), -1);
+
+ ACE_DEBUG((LM_DEBUG,"Factory connected\n"));
+ CORBA::String_var my_ior_string = orb->object_to_string(ec
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+ int len = strlen(my_ior_string.in()) ;
+
+ if (stream.send_n(my_ior_string.in(), len) != len)
+ ACE_ERROR_RETURN((LM_ERROR, "(%P|%t) IOR Transmission Error\n"), -1);
+
+ stream.close();
+ }
+ }
+ ACE_CATCHALL {
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void FT_EventService::become_primary()
+{
+ if (this->num_threads_ > 1) {
+ task_.activate(THR_NEW_LWP | THR_JOINABLE, num_threads_-1);
+ }
+}
+
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Event_Service/FT_EventService.h b/TAO/orbsvcs/FTRT_Event_Service/Event_Service/FT_EventService.h
new file mode 100644
index 00000000000..9238edf51b0
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Event_Service/FT_EventService.h
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_EventService.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef FT_EVENTSERVICE_H
+#define FT_EVENTSERVICE_H
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/FtRtecEventChannelAdminC.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.h"
+#include "TP_Task.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+namespace POA_RtecScheduler
+{
+ class Scheduler;
+}
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+class FT_EventService : private TAO_FTEC_Become_Primary_Listener
+{
+public:
+ FT_EventService();
+ ~FT_EventService();
+
+ int run(int argc, ACE_TCHAR* argv[]);
+
+private:
+ int parse_args (int argc, ACE_TCHAR* argv []);
+ void setup_scheduler(CosNaming::NamingContext_ptr naming_context
+ ACE_ENV_ARG_DECL);
+ int report_factory(CORBA::ORB_ptr orb,
+ FtRtecEventChannelAdmin::EventChannel_ptr ec);
+ virtual void become_primary();
+
+ int global_scheduler_;
+ // Should we use a global scheduler or a local one?
+ POA_RtecScheduler::Scheduler *sched_impl_;
+ // The Scheduler implementation.
+ TAO_FTEC_Event_Channel::MEMBERSHIP membership_;
+ int num_threads_;
+ CORBA::ORB_var orb_;
+ TP_Task task_;
+};
+
+#endif
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Event_Service/Makefile.am b/TAO/orbsvcs/FTRT_Event_Service/Event_Service/Makefile.am
new file mode 100644
index 00000000000..c5bdcdfdd92
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Event_Service/Makefile.am
@@ -0,0 +1,74 @@
+## 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.FTRT_Event_Service.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = ftrt_eventservice
+
+ftrt_eventservice_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/FtRtEvent/EventChannel \
+ -I$(TAO_ROOT)/orbsvcs/FtRtEvent/Utils
+
+ftrt_eventservice_SOURCES = \
+ FT_EventService.cpp \
+ FT_EventService.h \
+ TP_Task.h
+
+ftrt_eventservice_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTRT_EventChannel.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_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTSchedEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTSched.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(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)/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/FTRT_Event_Service/Event_Service/TP_Task.h b/TAO/orbsvcs/FTRT_Event_Service/Event_Service/TP_Task.h
new file mode 100644
index 00000000000..f5f2d410cac
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Event_Service/TP_Task.h
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file TP_Task.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef TP_TASK_H
+#define TP_TASK_H
+
+#include "ace/Task.h"
+#include "tao/corba.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TP_Task : public ACE_Task_Base {
+public:
+ TP_Task(CORBA::ORB_var& orb)
+ : orb_(orb)
+ {
+ }
+
+ ~TP_Task(){}
+ virtual int svc() {
+ this->orb_->run();
+ return 0;
+ }
+private:
+ CORBA::ORB_var& orb_;
+};
+
+#endif
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Event_Service/svc.conf b/TAO/orbsvcs/FTRT_Event_Service/Event_Service/svc.conf
new file mode 100644
index 00000000000..fbc0d98b8a5
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Event_Service/svc.conf
@@ -0,0 +1,22 @@
+## $Id$
+
+static Client_Strategy_Factory "-ORBClientConnectionHandler RW"
+
+## The value of FTEC_DETECTOR_TRANSPORT_PROTOCL should be either "sctp" or "tcp".
+## The FTEC_HEART_BEAT is only meanful for stcp. It represents the heart beat in
+## seconds for the connections between replicas.
+
+static FTRTEC_Fault_Detector "$FTEC_DETECTOR_TRANSPORT_PROTOCL -HeartBeat $FTEC_HEART_BEAT"
+
+
+## If FTEC_REPLICATION_STRATEGY is set to AMI, then use AMI for replicating operations;
+## otherwise, two-way CORBA call is used for replication.
+
+static FTRTEC_Replication "$FTEC_REPLICATION_STRATEGY"
+
+## FTEC_EVENT_SERVICE_NAME is used for the event channnel to register to the naming service.
+## FTEC_OBJECT_ID should be a globally unique identifier defined in
+## draft-leach-uuids-guids-01.txt. This value should be the same
+## for the entire object group.
+
+static FTRTEC_Identification "-Name $FTEC_EVENT_SERVICE_NAME -Object_ID $FTEC_OBJECT_ID" \ No newline at end of file
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/.cvsignore b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/.cvsignore
new file mode 100644
index 00000000000..9b9f57c4751
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/.cvsignore
@@ -0,0 +1 @@
+ftrtec_factory_service
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp
new file mode 100644
index 00000000000..b4febf2f835
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp
@@ -0,0 +1,203 @@
+// $Id$
+
+#include "EventChannelFactory_i.h"
+#include "ace/Process.h"
+#include "ace/Read_Buffer.h"
+#include "ace/SOCK_Acceptor.h"
+#include "ace/SOCK_Stream.h"
+#include "orbsvcs/FtRtEvent/Utils/UUID.h"
+
+ACE_RCSID (Factory_Service,
+ EventChannelFactory_i,
+ "$Id$")
+
+
+const int WAIT_FOR_REGISTRATION_TIME = 10; //sec
+const int MAX_ID_STRING = 10;
+
+EventChannelFactory_i::EventChannelFactory_i(const char* conf_filename, CORBA::ORB_ptr orb_ptr)
+: conf_file(conf_filename), id(0), orb(orb_ptr)
+{
+}
+
+CORBA::Object_ptr EventChannelFactory_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
+ ))
+{
+
+ ACE_DEBUG((LM_DEBUG,"EventChannelFactory_i::create_object\n"));
+ FILE* file = 0;
+ char *id_str=0, *prog=0;
+
+ ACE_TRY {
+
+ file = fopen(conf_file, "r");
+ if (file == 0)
+ ACE_TRY_THROW (PortableGroup::NoFactory());
+
+ ACE_Read_Buffer read_buf(file);
+
+ while ((id_str = read_buf.read(' ')) != 0 &&
+ (prog = read_buf.read('\n')) != 0) {
+ id_str[strlen(id_str)-1] = '\0';
+ if (strcmp(id_str, type_id) == 0) {
+ return create_process(prog, the_criteria, factory_creation_id);
+ }
+ }
+ }
+ ACE_CATCHALL {
+ if (file) fclose(file);
+ if (id_str) ACE_Allocator::instance()->free(id_str);
+ if (prog) ACE_Allocator::instance()->free(prog);
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN(CORBA::Object::_nil());
+
+ ACE_THROW_RETURN(PortableGroup::ObjectNotCreated(), CORBA::Object::_nil());
+}
+
+void EventChannelFactory_i::delete_object (
+ const PortableGroup::GenericFactory::FactoryCreationId & factory_creation_id
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::ObjectNotFound
+ ))
+{
+ ACE_TRACE("EventChannelFactory_i::delete_object");
+ CORBA::ULong object_id;
+ factory_creation_id >>= object_id;
+ CORBA::Object_var obj;
+ if (objects.find(object_id, obj) == 0) {
+ objects.unbind(object_id);
+ //obj->shutdown(ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+}
+
+CORBA::Object_ptr EventChannelFactory_i::create_process (
+ char * process_str,
+ const PortableGroup::Criteria & the_criteria,
+ PortableGroup::GenericFactory::FactoryCreationId_out factory_creation_id)
+{
+ ACE_TRACE("EventChannelFactory_i::create_process");
+
+ CORBA::Object_ptr result = CORBA::Object::_nil();
+
+ // fill the factory_creation_id
+
+ ACE_NEW_RETURN(factory_creation_id,
+ PortableGroup::GenericFactory::FactoryCreationId,
+ CORBA::Object::_nil());
+ *factory_creation_id <<= (CORBA::ULong) ++id;
+
+ // create an acceptor and get the listen address
+
+ ACE_SOCK_Acceptor acceptor;
+ ACE_INET_Addr server_addr;
+ acceptor.open(server_addr);
+ acceptor.get_local_addr(server_addr);
+
+ ACE_Process_Options options;
+ ACE_CString str;
+
+ char* pos = ACE_OS::strrchr(process_str, '/');
+ if (pos !=0) { //
+ *pos = '\0';
+ options.working_directory(process_str);
+ *pos = '/';
+ }
+ str = process_str;
+
+ const int ENV_BUF_LEN = 512;
+ char buf[ENV_BUF_LEN];
+ server_addr.addr_to_string(buf,ENV_BUF_LEN,0);
+ options.setenv("EventChannelFactoryAddr", buf);
+
+ // extract the object ID from the criteria
+ for (size_t i = 0; i < the_criteria.length(); ++i)
+ {
+ const CosNaming::Name& name = the_criteria[i].nam;
+ if (name.length() > 0) {
+ const char* val;
+ const char* id_str = name[0].id.in();
+ the_criteria[i].val >>= val;
+ if (id_str[0] != '-') // environment variable
+ options.setenv(id_str, "%s", val);
+ else {// command line option
+ ACE_OS::sprintf(buf, " %s %s", id_str, val);
+ str += buf;
+ }
+ }
+ }
+
+ ACE_DEBUG((LM_DEBUG, "Command Line : %s\n", str.c_str()));
+
+ options.command_line(str.c_str());
+
+ // Try to create a new process running date.
+ ACE_Process new_process;
+
+ ACE_Time_Value timeout(WAIT_FOR_REGISTRATION_TIME);
+ timeout += ACE_OS::gettimeofday();
+ if (new_process.spawn (options) == -1)
+ {
+ int error = ACE_OS::last_error ();
+ ACE_ERROR ((LM_ERROR,
+ "%p errno = %d.\n",
+ str.c_str(),
+ error));
+ return result;
+ }
+
+ ACE_INET_Addr client_addr;
+ ACE_SOCK_Stream stream;
+
+ ACE_DEBUG((LM_DEBUG, "accepting connection from event channel\n"));
+ if (acceptor.accept(stream, &client_addr, &timeout) == -1)
+ ACE_ERROR_RETURN((LM_ERROR, "accept fail\n"), 0);
+
+
+ ACE_DEBUG((LM_DEBUG, "Factory Connect established with %s:%d\n",
+ client_addr.get_host_name(), client_addr.get_port_number() ));
+
+ // receive the ior string from the created object
+
+ char ior[5000] = {'0'};
+ int n = 0;
+ int byteRead=0;
+ while (0 != (n = stream.recv(ior+byteRead, 5000-byteRead))) {
+ byteRead += n;
+ }
+
+ if (strlen(ior) ==0)
+ return result;
+
+ ACE_TRY_NEW_ENV {
+ CORBA::Object_var result = orb->string_to_object(ior
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (objects.bind(id, result) ==0){
+ return result._retn();
+ }
+ }
+ ACE_CATCHALL {
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.h b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.h
new file mode 100644
index 00000000000..656df7363bf
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.h
@@ -0,0 +1,65 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file EventChannelFactory_i.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef EVENTCHANNELFACTORY_I_H
+#define EVENTCHANNELFACTORY_I_H
+
+#include "orbsvcs/FT_CORBAS.h"
+#include "ace/Synch.h"
+#include "ace/Hash_Map_Manager_T.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class EventChannelFactory_i : public POA_PortableGroup::GenericFactory {
+public:
+ EventChannelFactory_i(const char* conf_filename, CORBA::ORB_ptr);
+
+ 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
+ )
+ 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
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::ObjectNotFound
+ ));
+
+private:
+ CORBA::Object_ptr create_process (
+ char * process,
+ const PortableGroup::Criteria & the_criteria,
+ PortableGroup::GenericFactory::FactoryCreationId_out factory_creation_id);
+
+ const char* conf_file;
+ int id;
+ CORBA::ORB_ptr orb;
+ typedef ACE_Hash_Map_Manager<int, CORBA::Object_var, ACE_Null_Mutex> Objects;
+ Objects objects;
+};
+#endif
+
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/FTRTEC_Factory_Service.cpp b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/FTRTEC_Factory_Service.cpp
new file mode 100644
index 00000000000..e2189bb34db
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/FTRTEC_Factory_Service.cpp
@@ -0,0 +1,156 @@
+// $Id$
+
+#include "EventChannelFactory_i.h"
+#include "ace/Task.h"
+#include "ace/SString.h"
+#include "ace/Get_Opt.h"
+
+ACE_RCSID (Factory_Service,
+ FTRTEC_Factory_Service,
+ "$Id$")
+
+namespace {
+ ACE_CString id, kind, output;
+}
+
+int parse_args(int argc, char* argv[])
+{
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("i:k:o:"));
+ int opt;
+
+ int result = 0;
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'i':
+ id = get_opt.opt_arg ();
+ break;
+ case 'k':
+ kind = get_opt.opt_arg ();
+ break;
+ case 'o':
+ output = get_opt.opt_arg ();
+ break;
+ default:
+ result = -1;
+ break;
+ }
+ }
+
+ if (result == -1 || (id.length() == 0 && output.length() == 0))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("Usage: %s \n")
+ ACE_TEXT(" [-i id] set the id that is used to register to the naming service\n")
+ ACE_TEXT(" [-k kind] set the kind that is used to register to the naming service\n")
+ ACE_TEXT(" [-o filename] set the output file name for the IOR\n")
+ ACE_TEXT("\n"),
+ argv[0]));
+ return -1;
+ }
+ return 0;
+}
+
+int main(int argc, ACE_TCHAR* argv[])
+{
+
+ 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) == -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;
+
+ 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;
+
+ EventChannelFactory_i servant("factory.cfg", orb.in());
+
+ FT::GenericFactory_var event_channel_factory =
+ servant._this(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // register to the Event Service
+
+ if (id.length()) {
+ CORBA::Object_var namng_contex_object =
+ orb->resolve_initial_references("NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow(namng_contex_object.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // register to naming service
+ CosNaming::Name name(1);
+ name.length(1);
+ name[0].id = CORBA::string_dup(id.c_str());
+ if (kind.length())
+ name[0].kind = CORBA::string_dup(kind.c_str());
+
+ naming_context->bind(name, event_channel_factory.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "Register to naming service with %s", id.c_str()));
+ if (kind.length())
+ ACE_DEBUG((LM_DEBUG, ", %s", kind.c_str()));
+ ACE_DEBUG((LM_DEBUG,"\n"));
+ }
+
+ if (output.length()) {
+ // get the IOR of factory
+ CORBA::String_var str = orb->object_to_string(event_channel_factory.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ACE_OS::strcmp(output.c_str(), "") != 0)
+ {
+ FILE *output_file=
+ ACE_OS::fopen (ACE_TEXT_CHAR_TO_TCHAR(output.c_str()),
+ ACE_TEXT("w"));
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ output.c_str()),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", str.in ());
+ ACE_OS::fclose (output_file);
+ }
+ }
+
+ ACE_TRY_CHECK;
+
+ 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/FTRT_Event_Service/Factory_Service/FTRTEC_Factory_Service.mpc b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/FTRTEC_Factory_Service.mpc
new file mode 100644
index 00000000000..88dc0523ae3
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/FTRTEC_Factory_Service.mpc
@@ -0,0 +1,8 @@
+// -*- MPC -*-
+// $Id$
+
+project(FTRTEC_Factory_Service): orbsvcsexe, fault_tolerance, notification, event_skel, strategies {
+ after += FaultTolerance
+ exename = ftrtec_factory_service
+}
+
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/Makefile.am b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/Makefile.am
new file mode 100644
index 00000000000..8c78feec083
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/Makefile.am
@@ -0,0 +1,75 @@
+## 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.FTRTEC_Factory_Service.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = ftrtec_factory_service
+
+ftrtec_factory_service_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
+
+ftrtec_factory_service_SOURCES = \
+ EventChannelFactory_i.cpp \
+ FTRTEC_Factory_Service.cpp \
+ EventChannelFactory_i.h
+
+ftrtec_factory_service_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.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
+
+## 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/FTRT_Event_Service/Factory_Service/factory.cfg b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/factory.cfg
new file mode 100644
index 00000000000..021110f6781
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/factory.cfg
@@ -0,0 +1,2 @@
+IDL:FtRtecEventChannelAdmin/EventChannel:1.0 ../FTRT_Event_Service/ftrt_eventservice
+IDL:RtecEventChannelAdmin/EventChannel:1.0 ../FTRT_Event_Service/ftrt_eventservice \ No newline at end of file
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/.cvsignore b/TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/.cvsignore
new file mode 100644
index 00000000000..e9561cf105c
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/.cvsignore
@@ -0,0 +1 @@
+ftrtec_gateway_service
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/FTRTEC_Gateway_Service.cpp b/TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/FTRTEC_Gateway_Service.cpp
new file mode 100644
index 00000000000..e431da580ae
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/FTRTEC_Gateway_Service.cpp
@@ -0,0 +1,136 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "ace/SString.h"
+#include "ace/OS_NS_stdio.h"
+#include "orbsvcs/FtRtEvent/Utils/FTEC_Gateway.h"
+#include "orbsvcs/FtRtEvent/Utils/resolve_init.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 (Gateway_Service,
+ FTRTEC_Gateway_Service,
+ "$Id$")
+
+namespace {
+ CORBA::ORB_var orb;
+ FtRtecEventChannelAdmin::EventChannel_var ftec;
+ ACE_CString ior_file_name;
+}
+
+int parse_args(int argc, ACE_TCHAR** argv)
+{
+ ACE_TRY_NEW_ENV {
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("i:n:o:"));
+ int opt;
+ CosNaming::Name name(1);
+ name.length(1);
+ name[0].id = CORBA::string_dup("FT_EventService");
+
+ 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_TRY_CHECK;
+ ftec = FtRtecEventChannelAdmin::EventChannel::_narrow(obj.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ break;
+ case 'n':
+ name[0].id = CORBA::string_dup(get_opt.opt_arg ());
+ break;
+ case 'o':
+ ior_file_name = get_opt.opt_arg ();
+ break;
+ }
+ }
+
+ if (CORBA::is_nil(ftec.in())) {
+ /// we should get the ftec from Naming Service
+
+ CosNaming::NamingContext_var naming_context =
+ resolve_init<CosNaming::NamingContext>(orb.in(), "NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ftec = resolve<FtRtecEventChannelAdmin::EventChannel>(naming_context.in(),
+ name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil(ftec.in()))
+ ACE_ERROR_RETURN((LM_ERROR, "Cannot Find FT_EventService\n"), -1);
+ }
+ }
+ ACE_CATCHANY {
+ ACE_ERROR_RETURN((LM_ERROR, "Cannot Find FT_EventService\n"), -1);
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int main(int argc, ACE_TCHAR** argv)
+{
+ ACE_TRY_NEW_ENV
+ {
+ orb = CORBA::ORB_init (argc, argv, ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args(argc, argv)==-1)
+ return 1;
+
+ PortableServer::POA_var
+ root_poa = resolve_init<PortableServer::POA>(orb.in(), "RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // create POAManager
+ 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;
+
+ TAO_FTRTEC::FTEC_Gateway gateway_servant(orb.in(), ftec.in());
+
+ RtecEventChannelAdmin::EventChannel_var gateway =
+ gateway_servant.activate(root_poa.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ior_file_name.length())
+ {
+ CORBA::String_var str = orb->object_to_string(gateway.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ FILE *output_file=
+ ACE_OS::fopen (ACE_TEXT_CHAR_TO_TCHAR(ior_file_name.c_str()),
+ ACE_TEXT("w"));
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_file_name.c_str()),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", str.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ orb->run(ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ ACE_CATCHANY {
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/FTRTEC_Gateway_Service.mpc b/TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/FTRTEC_Gateway_Service.mpc
new file mode 100644
index 00000000000..50c652b095d
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/FTRTEC_Gateway_Service.mpc
@@ -0,0 +1,12 @@
+// -*- MPC -*-
+// $Id$
+
+project(FTRTEC_Gateway_Service): orbsvcsexe, ftrteventclient, strategies {
+ exename = ftrtec_gateway_service
+ includes += $(TAO_ROOT)/orbsvcs/FtRtEvent/Utils
+
+ Source_Files {
+ FTRTEC_Gateway_Service.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/Makefile.am b/TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/Makefile.am
new file mode 100644
index 00000000000..e7e12326fdc
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/Gateway_Service/Makefile.am
@@ -0,0 +1,74 @@
+## 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.FTRTEC_Gateway_Service.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = ftrtec_gateway_service
+
+ftrtec_gateway_service_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/FtRtEvent/Utils
+
+ftrtec_gateway_service_SOURCES = \
+ FTRTEC_Gateway_Service.cpp
+
+ftrtec_gateway_service_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/FTRT_Event_Service/Makefile.am b/TAO/orbsvcs/FTRT_Event_Service/Makefile.am
new file mode 100644
index 00000000000..f8817324df0
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/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 = \
+ Event_Service \
+ Factory_Service \
+ Gateway_Service
+
diff --git a/TAO/orbsvcs/FTRT_Event_Service/NameService b/TAO/orbsvcs/FTRT_Event_Service/NameService
new file mode 100755
index 00000000000..4e599cf9a44
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/NameService
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+case $# in
+ 0) ARG="-multicast";;
+ 1) ARG=$1
+esac
+
+case "$ARG" in
+ -multicast) PARAM="-m 1";;
+ -iiop) PARAM=iiop://`hostname`:${ORBNameServicePort=10000};;
+ -sciop) PARAM=sciop://`hostname`:${ORBNameServicePort=10000};;
+ *)
+ @echo Usage : NameService [-iiop | -sciop] 2&>1 ; exit 2
+
+esac
+
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -d -d -d -ORBEndPoint "$PARAM"
diff --git a/TAO/orbsvcs/FTRT_Event_Service/consumer b/TAO/orbsvcs/FTRT_Event_Service/consumer
new file mode 100755
index 00000000000..eec89bc5e69
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/consumer
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+HOSTNAME=`hostname`
+EndpintParam=
+FTEC_TransactionDepth=${FTEC_TransactionDepth=1}
+
+
+while test "$1" != ""
+do
+ case "$1" in
+ -sciop) ORBNameServicePort=${ORBNameServicePort=10000}
+ export NameServiceIOR=${NameServiceIOR=corbaloc:sciop:$HOSTNAME:$ORBNameServicePort/NameService}
+ EndpointParam="-ORBEndpoint sciop://";;
+ -d) $FTEC_TransactionDepth=$2
+ shift;;
+ esac
+ shift
+done
+
+cd $TAO_ROOT/orbsvcs/tests/FtRtEvent
+export FTEC_TransactionDepth
+./consumer $EndpointParam
diff --git a/TAO/orbsvcs/FTRT_Event_Service/ftec b/TAO/orbsvcs/FTRT_Event_Service/ftec
new file mode 100755
index 00000000000..a6ca436573b
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/ftec
@@ -0,0 +1,25 @@
+#!/bin/sh
+HOSTNAME=`hostname`
+ARGS=
+
+while test "$1" != ""
+do
+ case "$1" in
+ -sciop) ORBNameServicePort=${ORBNameServicePort=10000}
+ export NameServiceIOR=${NameServiceIOR=corbaloc:sciop:$HOSTNAME:$ORBNameServicePort/NameService}
+ ARGS="$ARGS -ORBEndpoint sciop:// ";;
+ -sctp) export FTEC_DETECTOR_TRANSPORT_PROTOCOL=sctp ;;
+ -hb) export FTEC_DETECTOR_TRANSPORT_PROTOCOL=sctp
+ export FTEC_HEART_BEAT=$2
+ shift;;
+ -ami) export FTEC_REPLCATION_STRATEGY=AMI;;
+ -ns) ORBNameServicePort=${ORBNameServicePort=10000}
+ export NameServiceIOR=${NameServiceIOR=corbaloc:iiop:$2:$ORBNameServicePort/NameService};
+ shift;;
+ *) ARGS="$ARGS $1";;
+ esac
+ shift
+done
+echo $ARGS
+cd ./Event_Service
+./ftrt_eventservice $ARGS
diff --git a/TAO/orbsvcs/FTRT_Event_Service/supplier b/TAO/orbsvcs/FTRT_Event_Service/supplier
new file mode 100755
index 00000000000..8825f9a75ae
--- /dev/null
+++ b/TAO/orbsvcs/FTRT_Event_Service/supplier
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+HOSTNAME=`hostname`
+EndpintParam=
+FTEC_TransactionDepth=${FTEC_TransactionDepth=1}
+
+while test "$1" != ""
+do
+ case "$1" in
+ -sciop) ORBNameServicePort=${ORBNameServicePort=10000}
+ export NameServiceIOR=${NameServiceIOR=corbaloc:sciop:$HOSTNAME:$ORBNameServicePort/NameService}
+ EndpointParam="-ORBEndpoint sciop://";;
+ -d) $FTEC_TransactionDepth=$2
+ shift;;
+ -orbd) EndpointParam="$EndpointParam -ORBDebugLevel $2"; shift;;
+ *) EndpointParam="$EndpointParam $1";;
+ esac
+ shift
+done
+
+cd $TAO_ROOT/orbsvcs/tests/FtRtEvent
+export FTEC_TransactionDepth
+./supplier $EndpointParam
diff --git a/TAO/orbsvcs/FT_ReplicationManager/.cvsignore b/TAO/orbsvcs/FT_ReplicationManager/.cvsignore
new file mode 100644
index 00000000000..0443905ee6a
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/.cvsignore
@@ -0,0 +1 @@
+FT_ReplicationManager
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.cpp
new file mode 100755
index 00000000000..03fc838db47
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.cpp
@@ -0,0 +1,174 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_DefaultFaultAnalyzer.cpp
+ *
+ * $Id$
+ *
+ * This file is part of TAO's implementation of Fault Tolerant CORBA.
+ *
+ * @author Steve Totten <totten_s@ociweb.com>
+ */
+//=============================================================================
+
+#include "FT_DefaultFaultAnalyzer.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/FT_NotifierC.h"
+#include "orbsvcs/FT_FaultDetectorFactoryC.h"
+#include "orbsvcs/FT_ReplicationManagerC.h"
+#include "orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.h"
+#include "tao/debug.h"
+#include "ace/OS_NS_string.h"
+
+ACE_RCSID (FT_DefaultFaultAnalyzer,
+ FT_DefaultFaultAnalyzer,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Default constructor.
+TAO::FT_DefaultFaultAnalyzer::FT_DefaultFaultAnalyzer ()
+{
+}
+
+/// Destructor.
+TAO::FT_DefaultFaultAnalyzer::~FT_DefaultFaultAnalyzer ()
+{
+}
+
+// Validate the event to make sure it is one we can handle.
+// If it is not an event we can handle, this function logs the error
+// and returns -1.
+int TAO::FT_DefaultFaultAnalyzer::validate_event_type (
+ const CosNotification::StructuredEvent & event)
+{
+ int result = 0;
+
+ // CORBA 3.0.2, section 23.4.5.1 states:
+ //
+ // The fault management specification defines one event type:
+ // ObjectCrashFault. As the name suggests, this event is
+ // generated by a Fault Detector when it detects that an object
+ // has crashed.
+
+ // So, the event header's event_type.domain_name must be "FT_CORBA"
+ // and the event header's event_type.type_name must be "ObjectCrashFault".
+ // @@ why make string dups just to do a strcmp?
+ CORBA::String_var domain_name = CORBA::string_dup (
+ event.header.fixed_header.event_type.domain_name);
+ CORBA::String_var type_name = CORBA::string_dup (
+ event.header.fixed_header.event_type.type_name);
+ CORBA::String_var event_name = CORBA::string_dup (
+ event.header.fixed_header.event_name);
+
+ if (result == 0)
+ {
+ if (ACE_OS::strcmp (domain_name.in(), FT::FT_EVENT_TYPE_DOMAIN) != 0 ||
+ ACE_OS::strcmp (type_name.in(), FT::FT_EVENT_TYPE_NAME) != 0)
+ {
+ if (TAO_debug_level > 6)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_DefaultFaultAnalyzer::validate_event_type: "
+ "Received invalid event type.\n"
+ "EventType domain: <%s>\n"
+ "EventType type: <%s>\n"
+ "EventName: <%s>\n"),
+ domain_name.in(),
+ type_name.in(),
+ event_name.in()
+ ));
+ }
+ result = -1;
+ }
+ }
+
+ // CORBA 3.0.2, section 23.4.5.1 also states:
+ //
+ // The filterable_data part of the event body contains the
+ // identity of the crashed object as four name-value pairs: the
+ // fault tolerance domain identifier, the member’s location
+ // identifier, the repository identifier and the object group
+ // identifier. The Fault Notifier filters events based on the
+ // domain_name, the type_name, and the four identifiers. All
+ // other fields of the structured event may be set to null.
+ //
+ // The Fault Detector always sets the following fault event
+ // fields: domain_name, type_name, FTDomainId, and Location.
+ //
+ // So, at least "FTDomainId" and "Location" must be present:
+ if (result == 0)
+ {
+ if (event.filterable_data.length () >= 2)
+ {
+ // Check for FTDomainId.
+ if (ACE_OS::strcmp (
+ event.filterable_data[0].name.in(), FT::FT_DOMAIN_ID) != 0)
+ {
+ if (TAO_debug_level > 6)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_DefaultFaultAnalyzer::validate_event_type: "
+ "Received invalid structured event.\n"
+ "filterable_data[0] must be \"FTDomainId\", not \"%s\"\n"),
+ event.filterable_data[0].name.in()
+ ));
+ }
+ result = -1;
+ }
+ else if (ACE_OS::strcmp (
+ event.filterable_data[1].name.in(), FT::FT_LOCATION) != 0)
+ {
+ if (TAO_debug_level > 6)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_DefaultFaultAnalyzer::validate_event_type: "
+ "Received invalid structured event.\n"
+ "filterable_data[1] must be \"Location\", not \"%s\"\n"),
+ event.filterable_data[1].name.in()
+ ));
+ }
+ result = -1;
+ }
+ }
+ else
+ {
+ if (TAO_debug_level > 6)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_DefaultFaultAnalyzer::validate_event_type: "
+ "Received invalid structured event.\n"
+ "There must be at least two name/value pairs in "
+ "the filterable_data field, for \"FTDomainId\" and \"Location\".\n")
+ ));
+ }
+ result = -1;
+ }
+ }
+
+ return result;
+}
+
+/// Analyze a fault event.
+int TAO::FT_DefaultFaultAnalyzer::analyze_fault_event (
+ const CosNotification::StructuredEvent & event)
+{
+ ACE_UNUSED_ARG (event);
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "In TAO::FT_DefaultFaultAnalyzer::analyze_fault_event.\n")
+ ));
+ }
+
+ // no-op
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.h b/TAO/orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.h
new file mode 100755
index 00000000000..0901c34e63b
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.h
@@ -0,0 +1,90 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_DefaultFaultAnalyzer.h
+ *
+ * $Id$
+ *
+ * This file is part of TAO's implementation of Fault Tolerant CORBA.
+ * This is the default implementation of a fault analyzer that
+ * implements the interface of the abstract base class
+ * TAO::FT_FaultAnalyzer.
+ *
+ * @author Steve Totten <totten_s@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef FT_DEFAULT_FAULT_ANALYZER_H_
+#define FT_DEFAULT_FAULT_ANALYZER_H_
+
+#include /**/ "ace/pre.h"
+#include <ace/ACE.h>
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "FT_ReplicationManagerLib_export.h"
+#include "FT_FaultAnalyzer.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+
+ /**
+ * Default fault analyzer.
+ *
+ */
+ class TAO_ReplicationManagerLib_Export FT_DefaultFaultAnalyzer
+ : public ::TAO::FT_FaultAnalyzer
+ {
+
+ public:
+ /**
+ * Default constructor.
+ */
+ FT_DefaultFaultAnalyzer ();
+
+ /**
+ * Destructor.
+ */
+ virtual ~FT_DefaultFaultAnalyzer ();
+
+ public:
+
+ /**
+ * Validate event type to make sure it is one we can handle.
+ * @param event The structured fault event, as from the Fault Notifier.
+ * @return 0 if it is a valid event type, -1 otherwise.
+ */
+ virtual int validate_event_type (
+ const CosNotification::StructuredEvent & event);
+
+ /**
+ * Analyze a fault event.
+ * @param event The structured fault event, as from the Fault Notifier.
+ * @return 0 on success, -1 on failure.
+ */
+ virtual int analyze_fault_event (
+ const CosNotification::StructuredEvent & event);
+
+ ////////////////////
+ // Forbidden methods
+ private:
+ /// Copy constructor.
+ FT_DefaultFaultAnalyzer (const FT_DefaultFaultAnalyzer & rhs);
+ /// Assignment operator.
+ FT_DefaultFaultAnalyzer & operator = (const FT_DefaultFaultAnalyzer & rhs);
+
+ };
+
+} // namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* FT_DEFAULT_FAULT_ANALYZER_H_ */
+
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.cpp
new file mode 100755
index 00000000000..bd2d2d8d059
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.cpp
@@ -0,0 +1,32 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_FaultAnalyzer.cpp
+ *
+ * $Id$
+ *
+ * This file is part of TAO's implementation of Fault Tolerant CORBA.
+ *
+ * @author Steve Totten <totten_s@ociweb.com>
+ */
+//=============================================================================
+
+#include "FT_FaultAnalyzer.h"
+
+ACE_RCSID (FT_FaultAnalyzer,
+ FT_FaultAnalyzer,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Default constructor.
+TAO::FT_FaultAnalyzer::FT_FaultAnalyzer ()
+{
+}
+
+/// Destructor.
+TAO::FT_FaultAnalyzer::~FT_FaultAnalyzer ()
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.h b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.h
new file mode 100755
index 00000000000..253421fe577
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.h
@@ -0,0 +1,89 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_FaultAnalyzer.h
+ *
+ * $Id$
+ *
+ * This file is part of TAO's implementation of Fault Tolerant CORBA.
+ *
+ * @author Steve Totten <totten_s@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef FT_FAULT_ANALYZER_H_
+#define FT_FAULT_ANALYZER_H_
+
+#include /**/ "ace/pre.h"
+#include <ace/ACE.h>
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "FT_ReplicationManagerLib_export.h"
+#include "orbsvcs/CosNotifyCommC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ /**
+ * Abstract base class for application-defined fault analyzers.
+ *
+ */
+ class TAO_ReplicationManagerLib_Export FT_FaultAnalyzer
+ {
+
+ public:
+ /**
+ * Default constructor.
+ */
+ FT_FaultAnalyzer ();
+
+ /**
+ * Destructor.
+ */
+ virtual ~FT_FaultAnalyzer ();
+
+ public:
+
+ /**
+ * Validate event type to make sure it is one we can handle.
+ * @param event The structured fault event, as from the Fault Notifier.
+ * @return 0 if it is a valid event type, -1 otherwise.
+ */
+ virtual int validate_event_type (
+ const CosNotification::StructuredEvent & event) = 0;
+
+ /**
+ * Analyze a fault event.
+ * @param event The structured fault event, as from the Fault Notifier.
+ * @return 0 on success, -1 on failure.
+ */
+ virtual int analyze_fault_event (
+ const CosNotification::StructuredEvent & event) = 0;
+
+ ////////////////////
+ // Forbidden methods
+ private:
+ /// Copy constructor.
+ FT_FaultAnalyzer (const FT_FaultAnalyzer & rhs);
+ /// Assignment operator.
+ FT_FaultAnalyzer & operator = (const FT_FaultAnalyzer & rhs);
+
+ ///////////////
+ // Data Members
+ private:
+
+ };
+
+} // namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* FT_FAULT_ANALYZER_H_ */
+
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultConsumer.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultConsumer.cpp
new file mode 100755
index 00000000000..5a08f15d6d9
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultConsumer.cpp
@@ -0,0 +1,303 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_FaultConsumer.cpp
+ *
+ * $Id$
+ *
+ * This file is part of TAO's implementation of Fault Tolerant CORBA.
+ * This file provides the implementation of the TAO::FT_FaultConsumer
+ * class. The TAO::FT_FaultConsumer connects to the FaultNotifier to
+ * receive fault reports. It interacts with the ReplicationManager
+ * to process fault reports (e.g., to set a new primary on an object
+ * group or to create a new member of an object group).
+ *
+ * @author Steve Totten <totten_s@ociweb.com>
+ */
+//=============================================================================
+
+#include "FT_FaultConsumer.h"
+#include "orbsvcs/FT_ReplicationManagerC.h"
+#include "orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.h"
+#include "tao/debug.h"
+
+ACE_RCSID (FT_FaultConsumer,
+ FT_FaultConsumer,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Default constructor.
+TAO::FT_FaultConsumer::FT_FaultConsumer ()
+ : poa_ (PortableServer::POA::_nil ())
+ , fault_notifier_ (FT::FaultNotifier::_nil ())
+ , fault_analyzer_ (0)
+ , consumer_id_ (0)
+ , consumer_ref_ (CosNotifyComm::StructuredPushConsumer::_nil ())
+ , notifications_ (0)
+{
+}
+
+/// Destructor.
+TAO::FT_FaultConsumer::~FT_FaultConsumer ()
+{
+}
+
+/**
+* Connect to the FT::FaultNotifier.
+* Note: We make the following assumptions about what the
+* application will do:
+* - Create an instance of this consumer class.
+* - Obtain the object reference of the FaultNotifier to which this
+* consumer should connect.
+* - Call this init() method, passing it the POA with which we
+* have been activated, the FaultNotifier, and ReplicationManager
+* object references.
+*/
+int TAO::FT_FaultConsumer::init (
+ PortableServer::POA_ptr poa,
+ FT::FaultNotifier_ptr fault_notifier,
+ TAO::FT_FaultAnalyzer * fault_analyzer
+ ACE_ENV_ARG_DECL)
+{
+
+ if (TAO_debug_level > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "Enter TAO::FT_FaultConsumer::init.\n")
+ ));
+ }
+
+ ACE_ASSERT (!CORBA::is_nil (poa));
+ ACE_ASSERT (!CORBA::is_nil (fault_notifier));
+ ACE_ASSERT (fault_analyzer != 0);
+
+ // Duplicate the object references passed in.
+ this->poa_ =
+ PortableServer::POA::_duplicate (poa);
+ this->fault_notifier_ =
+ FT::FaultNotifier::_duplicate (fault_notifier);
+
+ // We have no ownership responsibilities for the Fault Analyzer.
+ this->fault_analyzer_ = fault_analyzer;
+
+ //@@ Should this init() method activate the consumer in the POA, or
+ // should the application do that?
+ // I don't think this object can activate itself because it doesn't
+ // know the policies on the POA. So, we assume the application has
+ // already activated us.
+ //@@ For now, let's try just activating it in the POA.
+
+ // Activate this consumer in the POA.
+ this->object_id_ = this->poa_->activate_object (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ CORBA::Object_var obj =
+ this->poa_->id_to_reference (this->object_id_.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Narrow it to CosNotifyComm::StructuredPushConsumer.
+ this->consumer_ref_ = CosNotifyComm::StructuredPushConsumer::_narrow (
+ obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Subscribe to the FaultNotifier.
+ CosNotifyFilter::Filter_var filter = CosNotifyFilter::Filter::_nil ();
+ this->consumer_id_ = fault_notifier_->connect_structured_fault_consumer (
+ this->consumer_ref_.in(), filter.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (TAO_debug_level > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "Leave TAO::FT_FaultConsumer::init.\n")
+ ));
+ }
+
+ // Success.
+ return 0;
+}
+
+/**
+* Clean house for process shut down.
+* - Disconnect from FT::FaultNotifier.
+* - Deactivate from the POA.
+*/
+int TAO::FT_FaultConsumer::fini (ACE_ENV_SINGLE_ARG_DECL)
+{
+
+ if (TAO_debug_level > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Enter TAO::FT_FaultConsumer::fini.\n")
+ ));
+ }
+
+ // Disconnect from the FaultNotifier.
+ // Swallow any exception.
+ ACE_TRY_NEW_ENV
+ {
+ if (!CORBA::is_nil (this->fault_notifier_.in()))
+ {
+
+ if (TAO_debug_level > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_FaultConsumer::fini: "
+ "Disconnecting consumer from FaultNotifier.\n")
+ ));
+ }
+
+ this->fault_notifier_->disconnect_consumer (
+ this->consumer_id_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (TAO_debug_level > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_FaultConsumer::fini: "
+ "Deactivating from POA.\n")
+ ));
+ }
+
+ // Deactivate ourself from the POA.
+ this->poa_->deactivate_object (
+ this->object_id_.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT (
+ "TAO::FT_FaultConsumer::fini: "
+ "Error disconnecting from notifier (ignored).\n")
+ );
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN(1);
+
+ if (TAO_debug_level > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_FaultConsumer::fini: "
+ "Setting our object reference to nil.\n")
+ ));
+ }
+
+ this->consumer_ref_ = CosNotifyComm::StructuredPushConsumer::_nil ();
+
+ if (TAO_debug_level > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Leave TAO::FT_FaultConsumer::fini.\n")
+ ));
+ }
+
+ // Success.
+ return 0;
+}
+
+CosNotifyComm::StructuredPushConsumer_ptr
+TAO::FT_FaultConsumer::consumer_ref ()
+{
+ return CosNotifyComm::StructuredPushConsumer::_duplicate (
+ this->consumer_ref_.in ());
+}
+
+size_t TAO::FT_FaultConsumer::notifications () const
+{
+ return this->notifications_;
+}
+
+
+///////////////////
+// CORBA operations
+
+// Receive and process an incoming fault event from the Fault Notifier.
+// First, we validate the event to make sure it is something we can
+// handle. Then, we analyze it. If it is not an event we can handle,
+// we simply log the error and drop the event.
+void TAO::FT_FaultConsumer::push_structured_event (
+ const CosNotification::StructuredEvent &event
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException, CosEventComm::Disconnected))
+{
+ // Debugging support.
+ this->notifications_ += 1;
+ if (TAO_debug_level > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_FaultConsumer::push_structured_event: "
+ "Received Fault notification(%d):\n"),
+ static_cast<unsigned int> (this->notifications_)
+ ));
+ }
+
+ int result = 0;
+
+ // Make sure it is an event type we can handle.
+ if (result == 0)
+ {
+ result = this->fault_analyzer_->validate_event_type (event);
+ if (result != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_FaultConsumer::push_structured_event: "
+ "Received invalid fault event type.\n")
+ ));
+ }
+ }
+
+ // Analyze the event.
+ if (result == 0)
+ {
+ result = this->fault_analyzer_->analyze_fault_event (event);
+ if (result != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_FaultConsumer::push_structured_event: "
+ "Could not analyze fault event.\n")
+ ));
+ }
+ }
+
+ return;
+}
+
+void TAO::FT_FaultConsumer::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("TAO::FT_FaultConsumer::offer_change() call ignored.\n")
+ ));
+}
+
+void TAO::FT_FaultConsumer::disconnect_structured_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ //TODO: For now, we are just ignoring the disconnect callback.
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("TAO::FT_FaultConsumer::disconnect_structured_push_consumer() "
+ "call ignored.\n")
+ ));
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultConsumer.h b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultConsumer.h
new file mode 100755
index 00000000000..4ba96cdee31
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultConsumer.h
@@ -0,0 +1,170 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_FaultConsumer.h
+ *
+ * $Id$
+ *
+ * This file is part of TAO's implementation of Fault Tolerant CORBA.
+ *
+ * @author Steve Totten <totten_s@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef FT_FAULT_CONSUMER_H_
+#define FT_FAULT_CONSUMER_H_
+
+#include /**/ "ace/pre.h"
+#include <ace/ACE.h>
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyCommS.h"
+#include "orbsvcs/FT_NotifierC.h"
+#include "FT_ReplicationManagerLib_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+
+ ///////////////////////
+ // Forward declarations
+ class FT_FaultAnalyzer;
+
+ /**
+ * Implement the CosNotifyComm::StructuredPushConsumer interface.
+ *
+ */
+ class TAO_ReplicationManagerLib_Export FT_FaultConsumer
+ : public virtual POA_CosNotifyComm::StructuredPushConsumer
+ {
+
+ //////////////////////
+ // non-CORBA interface
+
+ public:
+ /**
+ * Default constructor.
+ */
+ FT_FaultConsumer ();
+
+ /**
+ * Destructor.
+ */
+ virtual ~FT_FaultConsumer ();
+
+ /**
+ * Connect to the FT::FaultNotifier.
+ * Note: We make the following assumptions about what the
+ * application will do:
+ * - Create an instance of this consumer class.
+ * - Obtain the object reference of the FaultNotifier to which this
+ * consumer should connect.
+ * - Call this init() method, passing it the POA with which we
+ * have been activated, the FaultNotifier, and ReplicationManager
+ * object references.
+ */
+ int init (
+ PortableServer::POA_ptr poa,
+ FT::FaultNotifier_ptr fault_notifier,
+ TAO::FT_FaultAnalyzer * fault_analyzer
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Clean house for process shut down.
+ * - Disconnect from FT::FaultNotifier.
+ * - Deactivate from the POA.
+ */
+ int fini (ACE_ENV_SINGLE_ARG_DECL);
+
+ /**
+ * Accessor for a duplicate of this consumer's object reference.
+ */
+ CosNotifyComm::StructuredPushConsumer_ptr consumer_ref ();
+
+ //@@ For testing purposes only, will be removed later.
+ /**
+ * Accessor for the number of notifications we have received.
+ */
+ size_t notifications () const;
+
+ public:
+
+ /**
+ * @name POA_CosNotifyComm::StructuredPushConsumer Methods
+ *
+ * Methods required by the POA_CosNotifyComm::StructuredPushConsumer
+ * interface.
+ */
+ //@{
+
+ ////////////////
+ // 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:
+ /// Copy constructor.
+ FT_FaultConsumer (const FT_FaultConsumer & rhs);
+ /// Assignment operator.
+ FT_FaultConsumer & operator = (const FT_FaultConsumer & rhs);
+
+ ///////////////
+ // Data Members
+ private:
+
+ /// The POA with which we are activated.
+ PortableServer::POA_var poa_;
+
+ /// The ObjectId from our activation in the POA.
+ PortableServer::ObjectId_var object_id_;
+
+ /// The FaultNotifier's object reference.
+ FT::FaultNotifier_var fault_notifier_;
+
+ /// Application-specific Fault Analyzer.
+ TAO::FT_FaultAnalyzer * fault_analyzer_;
+
+ /// ConsumerId assigned by the notifier.
+ FT::FaultNotifier::ConsumerId consumer_id_;
+
+ /// Our consumer object reference.
+ CosNotifyComm::StructuredPushConsumer_var consumer_ref_;
+
+ ///TODO: Remove this later, it is just for testing.
+ // Keep track of how many notifications we have received.
+ size_t notifications_;
+
+ };
+
+} // namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* FT_FAULT_CONSUMER_H_ */
+
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.cpp
new file mode 100755
index 00000000000..3f101f27dea
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.cpp
@@ -0,0 +1,96 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_FaultEventDescriptor.cpp
+ *
+ * $Id$
+ *
+ * This file is part of TAO's implementation of Fault Tolerant CORBA.
+ * This file provides the implementation of the
+ * TAO::FT_FaultEventDescriptor structure. The
+ * TAO::FT_FaultEventDescriptor is a helper type used during
+ * analysis of fault events.
+ *
+ * @author Steve Totten <totten_s@ociweb.com>
+ */
+//=============================================================================
+
+#include "FT_FaultEventDescriptor.h"
+
+#include "ace/SString.h"
+
+ACE_RCSID (FT_FaultEventDescriptor,
+ FT_FaultEventDescriptor,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Default constructor.
+TAO::FT_FaultEventDescriptor::FT_FaultEventDescriptor ()
+ : all_at_location_failed (0)
+ , all_of_type_at_location_failed (0)
+ , object_at_location_failed (0)
+ , object_is_primary (0)
+ , type_id (CORBA::string_dup (""))
+ , object_group_id (PortableGroup::ObjectGroupId (0))
+{
+}
+
+// Debugging support.
+void TAO::FT_FaultEventDescriptor::dump ()
+{
+ // Get the location as a string.
+ ACE_CString loc_as_string;
+ for (CORBA::ULong li = 0; li < this->location->length(); ++li)
+ {
+ if (li > 0) loc_as_string += "/";
+ // Assume only the "id" field of the CosNaming::Name is used.
+ loc_as_string += CORBA::string_dup (this->location[li].id);
+ }
+
+ if (this->all_at_location_failed == 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_FaultEventDescriptor::dump: "
+ "All objects at location <%s> failed.\n"),
+ loc_as_string.c_str()
+ ));
+ }
+
+ if (this->all_of_type_at_location_failed == 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_FaultEventDescriptor::dump: "
+ "All objects of type <%s> at location <%s> failed.\n"),
+ this->type_id.in(),
+ loc_as_string.c_str()
+ ));
+ }
+
+ if (this->object_at_location_failed == 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_FaultEventDescriptor::dump: "
+ "Replica of type <%s> with ObjectGroupId <%Q> "
+ "at location <%s> failed.\n"),
+ this->type_id.in(),
+ this->object_group_id,
+ loc_as_string.c_str()
+ ));
+ }
+
+ if (this->object_is_primary == 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_FaultEventDescriptor::dump: "
+ "Primary replica of ObjectGroupId <%Q> failed.\n"),
+ this->object_group_id
+ ));
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.h b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.h
new file mode 100755
index 00000000000..fe174448fb2
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.h
@@ -0,0 +1,80 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_FaultEventDescriptor.h
+ *
+ * $Id$
+ *
+ * This file is part of TAO's implementation of Fault Tolerant CORBA.
+ *
+ * @author Steve Totten <totten_s@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef FT_FAULT_EVENT_DESCRIPTOR_H_
+#define FT_FAULT_EVENT_DESCRIPTOR_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_CORBAC.h"
+#include "orbsvcs/PortableGroupC.h"
+#include "FT_ReplicationManagerLib_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ /// Helper class for describing the properties in a fault event.
+ struct TAO_ReplicationManagerLib_Export FT_FaultEventDescriptor
+ {
+ public:
+
+ /// Default constructor.
+ FT_FaultEventDescriptor ();
+
+ /// Debugging support.
+ void dump ();
+
+ /////////////////
+ /// Data members.
+
+ /// Flags indicating the "extent" of the fault.
+ int all_at_location_failed;
+ int all_of_type_at_location_failed;
+ int object_at_location_failed;
+ int object_is_primary;
+
+ /// The location of the fault.
+ PortableGroup::Location_var location;
+
+ /// The TypeId of the object that faulted.
+ PortableGroup::TypeId_var type_id;
+
+ /// The ObjectGroupId of the faulted object.
+ PortableGroup::ObjectGroupId object_group_id;
+
+ /// Other properties of the object group to which the fault relates.
+ PortableGroup::MembershipStyleValue membership_style;
+ FT::ReplicationStyleValue replication_style;
+ PortableGroup::MinimumNumberMembersValue minimum_number_members;
+ PortableGroup::InitialNumberMembersValue initial_number_members;
+
+ /// The object group's factories.
+ PortableGroup::FactoryInfos_var factories;
+
+ };
+
+} // namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* FT_FAULT_EVENT_DESCRIPTOR_H_ */
+
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_Property_Validator.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_Property_Validator.cpp
new file mode 100644
index 00000000000..0268c527fbb
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_Property_Validator.cpp
@@ -0,0 +1,246 @@
+#include "FT_Property_Validator.h"
+#include "orbsvcs/PortableGroup/PG_Operators.h"
+#include "orbsvcs/FT_ReplicationManagerC.h"
+
+
+ACE_RCSID (PortableGroup,
+ FT_Property_Validator,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::FT_Property_Validator::FT_Property_Validator (void)
+ : replication_style_ (1),
+ membership_style_ (1),
+ consistency_style_ (1),
+ fault_monitoring_style_ (1),
+ fault_monitoring_granularity_ (1),
+ factories_ (1)
+{
+ this->replication_style_.length (1);
+ this->replication_style_[0].id = CORBA::string_dup (::FT::FT_REPLICATION_STYLE);
+
+ this->membership_style_.length (1);
+ this->membership_style_[0].id = CORBA::string_dup (::FT::FT_MEMBERSHIP_STYLE);
+
+ this->consistency_style_.length (1);
+ this->consistency_style_[0].id = CORBA::string_dup (::FT::FT_CONSISTENCY_STYLE);
+
+ this->fault_monitoring_style_.length (1);
+ this->fault_monitoring_style_[0].id = CORBA::string_dup (::FT::FT_FAULT_MONITORING_STYLE);
+
+ this->fault_monitoring_granularity_.length (1);
+ this->fault_monitoring_granularity_[0].id = CORBA::string_dup (::FT::FT_FAULT_MONITORING_GRANULARITY);
+
+ this->factories_.length (1);
+ this->factories_[0].id = CORBA::string_dup (::FT::FT_FACTORIES);
+}
+
+
+TAO::FT_Property_Validator::~FT_Property_Validator (void)
+{
+}
+
+
+void
+TAO::FT_Property_Validator::validate_property (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ const CORBA::ULong len = props.length ();
+
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ const PortableGroup::Property & property = props[i];
+
+ if (property.nam == this->replication_style_)
+ {
+ FT::ReplicationStyleValue value;
+ if (!(property.val >>= value)
+ || (value != FT::STATELESS
+ && value != FT::COLD_PASSIVE
+ && value != FT::WARM_PASSIVE
+ && value != FT::ACTIVE
+ && value != FT::ACTIVE_WITH_VOTING
+ && value != FT::SEMI_ACTIVE))
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+ else if (property.nam == this->membership_style_)
+ {
+ PortableGroup::MembershipStyleValue value;
+ if (!(property.val >>= value)
+ || (value != PortableGroup::MEMB_APP_CTRL
+ && value != PortableGroup::MEMB_INF_CTRL))
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+ else if (property.nam == this->consistency_style_)
+ {
+ FT::ConsistencyStyleValue value;
+ if (!(property.val >>= value)
+ || (value != FT::CONS_APP_CTRL
+ && value != FT::CONS_INF_CTRL))
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+ else if (property.nam == this->fault_monitoring_style_)
+ {
+ FT::FaultMonitoringStyleValue value;
+ if (!(property.val >>= value)
+ || (value != FT::PULL
+ && value != FT::PUSH
+ && value != FT::NOT_MONITORED))
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+ else if (property.nam == this->fault_monitoring_granularity_)
+ {
+ FT::FaultMonitoringGranularityValue value;
+ if (!(property.val >>= value)
+ || (value != FT::MEMB
+ && value != FT::LOC
+ && value != FT::LOC_AND_TYPE))
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+ else if (property.nam == this->factories_)
+ {
+ const PortableGroup::FactoriesValue * factories;
+ if (!(property.val >>= factories))
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ else
+ {
+ const CORBA::ULong flen = factories->length ();
+
+ if (flen == 0)
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+
+ for (CORBA::ULong j = 0; j < flen; ++j)
+ {
+ const PortableGroup::FactoryInfo & factory_info =
+ (*factories)[j];
+
+ if (CORBA::is_nil (factory_info.the_factory.in ())
+ || factory_info.the_location.length () == 0)
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+ }
+ }
+ }
+}
+
+void
+TAO::FT_Property_Validator::validate_criteria (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::CannotMeetCriteria))
+{
+ const CORBA::ULong len = props.length ();
+ PortableGroup::Criteria invalid_criteria;
+
+ // Optimize for the worst case scenario where all properties are
+ // invalid.
+ invalid_criteria.length (len);
+
+ /// The invalid criteria index.
+ CORBA::ULong p = 0;
+
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ const PortableGroup::Property & property = props[i];
+ CORBA::Long value;
+
+ if (!(property.val >>= value))
+ invalid_criteria[p++] = property;
+ else
+ {
+ if (property.nam == this->replication_style_)
+ {
+ if ( value != FT::STATELESS
+ && value != FT::COLD_PASSIVE
+ && value != FT::WARM_PASSIVE
+ && value != FT::ACTIVE
+ && value != FT::ACTIVE_WITH_VOTING
+ && value != FT::SEMI_ACTIVE )
+ invalid_criteria[p++] = property;
+ }
+ else if (property.nam == this->membership_style_)
+ {
+ if ( value != PortableGroup::MEMB_APP_CTRL
+ && value != PortableGroup::MEMB_INF_CTRL )
+ invalid_criteria[p++] = property;
+ }
+ else if (property.nam == this->consistency_style_)
+ {
+ if ( value != FT::CONS_APP_CTRL
+ && value != FT::CONS_INF_CTRL )
+ invalid_criteria[p++] = property;
+ }
+ else if (property.nam == this->fault_monitoring_style_)
+ {
+ if ( value != FT::PULL
+ && value != FT::PUSH
+ && value != FT::NOT_MONITORED )
+ invalid_criteria[p++] = property;
+ }
+ else if (property.nam == this->fault_monitoring_granularity_)
+ {
+ if ( value != FT::MEMB
+ && value != FT::LOC
+ && value != FT::LOC_AND_TYPE )
+ invalid_criteria[p++] = property;
+ }
+ else if (property.nam == this->factories_)
+ {
+ PortableGroup::FactoriesValue * factories;
+ if (!(property.val >>= factories))
+ invalid_criteria[p++] = property;
+ else
+ {
+ const CORBA::ULong flen = factories->length ();
+
+ if (flen == 0)
+ invalid_criteria[p++] = property;
+ else
+ {
+ for (CORBA::ULong j = 0; j < flen; ++j)
+ {
+ const PortableGroup::FactoryInfo & factory_info =
+ (*factories)[j];
+
+ if (CORBA::is_nil (factory_info.the_factory.in ())
+ || factory_info.the_location.length () == 0)
+ {
+ invalid_criteria[p++] = property;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (p > 0)
+ {
+ // Reduce the length of the invalid criteria sequence in an
+ // effort to optimize the copying that will occur when the below
+ // exception is thrown. Reducing the length is fast since no
+ // deallocations should occur.
+ invalid_criteria.length (p);
+
+ ACE_THROW (PortableGroup::InvalidCriteria (invalid_criteria));
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_Property_Validator.h b/TAO/orbsvcs/FT_ReplicationManager/FT_Property_Validator.h
new file mode 100644
index 00000000000..954d7f29ded
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_Property_Validator.h
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_Property_Validator.h
+ *
+ * $Id$
+ *
+ * @author Curt Hibbs <hibbs_c@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef FT_PROPERTY_VALIDATOR_H
+#define FT_PROPERTY_VALIDATOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/PG_Default_Property_Validator.h"
+#include "orbsvcs/PortableGroupC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ /**
+ * @class FT_Property_Validator
+ *
+ * @brief Default property validator implementation.
+ *
+ * This Property_Validator verifies that all properties defined in the
+ * FT CORBA IDL are valid.
+ */
+ class FT_Property_Validator : public TAO_PG_Default_Property_Validator
+ {
+ public:
+
+ /// Constructor.
+ FT_Property_Validator (void);
+
+ /// Destructor.
+ virtual ~FT_Property_Validator (void);
+
+ /// Validate the given properties. Throw an exception when the
+ /// first invalid property is encountered. The remaining properties
+ /// will not be validated.
+ virtual
+ void validate_property (const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /// Validate the given properties/criteria. All criteria
+ /// will be validated regardless of whether or not an invalid
+ /// property was encountered.
+ virtual
+ void validate_criteria (const PortableGroup::Properties & criteria
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::CannotMeetCriteria));
+
+ private:
+
+ /**
+ * @name Pre-initialize property Names.
+ *
+ * These properties are pre-initialized once to reduce property
+ * validation overhead. Note that the following properties are
+ * not validated since there are no restrictions for these values:
+ * InitialNumberMembers
+ * MinimumNumberMembers
+ * FaultMonitoringInterval
+ * CheckpointInterval
+ */
+ //@{
+ PortableGroup::Name replication_style_;
+ PortableGroup::Name membership_style_;
+ PortableGroup::Name consistency_style_;
+ PortableGroup::Name fault_monitoring_style_;
+ PortableGroup::Name fault_monitoring_granularity_;
+ PortableGroup::Name factories_;
+ //@}
+
+ };
+
+} // namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* FT_PROPERTY_VALIDATOR_H */
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp
new file mode 100644
index 00000000000..bfc77eb5a46
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp
@@ -0,0 +1,1097 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_ReplicationManager.cpp
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * This file implements the FT_ReplicationManager class as declared in
+ * FT_Replication_Manager.h.
+ *
+ * @author Curt Hibbs <hibbs_c@ociweb.com>
+ */
+//=============================================================================
+#include "FT_ReplicationManager.h"
+#include "FT_Property_Validator.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+#include "tao/Messaging/Messaging.h"
+#include "tao/IORTable/IORTable.h"
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+#include "orbsvcs/PortableGroup/PG_Object_Group.h"
+#include "orbsvcs/PortableGroup/PG_Property_Set.h"
+#include "orbsvcs/PortableGroup/PG_Properties_Encoder.h"
+#include "orbsvcs/PortableGroup/PG_Property_Utils.h"
+#include "orbsvcs/PortableGroup/PG_conf.h"
+
+#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h"
+#include "orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.h"
+
+ACE_RCSID (FT_ReplicationManager,
+ FT_ReplicationManager,
+ "$Id$")
+
+
+// Use this macro at the beginning of CORBA methods
+// to aid in debugging.
+#define METHOD_ENTRY(name) \
+ if (TAO_debug_level > 6) \
+ { \
+ 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) \
+ if (TAO_debug_level > 6) \
+ { \
+ ACE_DEBUG (( LM_DEBUG, \
+ "Leave %s\n", #name \
+ )); \
+ } \
+ return /* value goes here */
+
+#define TODO
+//#define TODO int todo; // warn on todos
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::FT_ReplicationManager::FT_ReplicationManager ()
+ : orb_ (CORBA::ORB::_nil ())
+ , poa_ (PortableServer::POA::_nil ())
+ , ior_output_file_ (0)
+ , ns_name_ (0)
+ , naming_context_ (CosNaming::NamingContext::_nil ())
+ , replication_manager_ref_ (FT::ReplicationManager::_nil ())
+ , fault_notifier_ (FT::FaultNotifier::_nil ())
+ , fault_notifier_ior_string_ (0)
+ , fault_consumer_ ()
+ , factory_registry_ ("ReplicationManager::FactoryRegistry")
+ , quit_ (0)
+{
+ // init must be called before using this object.
+}
+
+TAO::FT_ReplicationManager::~FT_ReplicationManager (void)
+{
+ // cleanup happens in fini
+}
+
+//public
+int TAO::FT_ReplicationManager::parse_args (int argc, char * argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "n:o:f:");
+ 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->fault_notifier_ior_string_ = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ // fall thru
+ default:
+ ACE_ERROR_RETURN ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - usage: %s")
+ ACE_TEXT (" -o <iorfile (for testing)>")
+ ACE_TEXT (" -f <fault notifier IOR (for testing)>")
+ ACE_TEXT (" -n <name-to-bind-in-NameService (for testing)>")
+ ACE_TEXT ("\n"),
+ argv [0]),
+ -1);
+ break;
+ }
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+//public
+const char * TAO::FT_ReplicationManager::identity () const
+{
+ return this->identity_.c_str ();
+}
+
+//public
+int TAO::FT_ReplicationManager::init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
+{
+ int result = 0;
+
+ if (TAO_debug_level > 1)
+ {
+ ACE_DEBUG ( (LM_DEBUG,
+ ACE_TEXT (
+ "%T %n (%P|%t) - Enter TAO::FT_ReplicationManager::init.\n")
+ ));
+ }
+
+
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+
+ // Get the RootPOA.
+ CORBA::Object_var poa_obj = this->orb_->resolve_initial_references (
+ TAO_OBJID_ROOTPOA ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ this->poa_ = PortableServer::POA::_narrow (
+ poa_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+
+ // initialize the FactoryRegistry
+ this->factory_registry_.init (this->orb_.in (), this->poa_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ PortableGroup::FactoryRegistry_var factory_registry = this->factory_registry_.reference ();
+
+ // @@: do we want to use the same poa to create object groups?
+ this->group_factory_.init (
+ this->orb_.in (),
+ this->poa_.in (),
+ factory_registry.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Activate ourself in the POA.
+ PortableServer::ObjectId_var oid = this->poa_->activate_object (
+ this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::Object_var this_obj = this->poa_->id_to_reference (
+ oid.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ this->replication_manager_ref_ = FT::ReplicationManager::_narrow (
+ this_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // If we were given an initial IOR string for a Fault Notifier on the
+ // command line, convert it to an IOR, then register the fault
+ // notifier.
+ if (this->fault_notifier_ior_string_ != 0)
+ {
+ CORBA::Object_var notifier_obj = this->orb_->string_to_object (
+ this->fault_notifier_ior_string_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ FT::FaultNotifier_var notifier = FT::FaultNotifier::_narrow (
+ notifier_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (! CORBA::is_nil (notifier.in ()))
+ {
+ this->register_fault_notifier_i (notifier.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ else
+ {
+ ACE_ERROR_RETURN ( (LM_ERROR,
+ ACE_TEXT (
+ "%T %n (%P|%t) - "
+ "Could not resolve notifier IOR.\n")),
+ -1);
+ }
+ }
+
+ // Activate the RootPOA.
+ PortableServer::POAManager_var poa_mgr =
+ this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ poa_mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register our IOR in the IORTable with the key-string
+ // "ReplicationManager".
+ CORBA::Object_var ior_table_obj =
+ this->orb_->resolve_initial_references (
+ TAO_OBJID_IORTABLE ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ IORTable::Table_var ior_table =
+ IORTable::Table::_narrow (ior_table_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (CORBA::is_nil (ior_table.in ()))
+ {
+ ACE_ERROR_RETURN ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - Unable to resolve the IORTable.\n")),
+ -1);
+ }
+ else
+ {
+ CORBA::String_var rm_ior_str = this->orb_->object_to_string (
+ this->replication_manager_ref_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ ior_table->bind ("ReplicationManager", rm_ior_str.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ // Publish our IOR, either to a file or the Naming Service.
+ if (this->ior_output_file_ != 0)
+ {
+ this->identity_ = "file:";
+ this->identity_ += this->ior_output_file_;
+ result = this->write_ior ();
+ }
+
+ if (result == 0 && this->ns_name_ != 0)
+ {
+ this->identity_ = "name:";
+ this->identity_ += this->ns_name_;
+
+ CORBA::Object_var naming_obj = this->orb_->resolve_initial_references (
+ TAO_OBJID_NAMESERVICE ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->naming_context_ =
+ CosNaming::NamingContext::_narrow (
+ naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (this->naming_context_.in ()))
+ {
+ ACE_ERROR_RETURN ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - Unable to find the Naming Service.\n")),
+ -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->replication_manager_ref_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ if (TAO_debug_level > 1)
+ {
+ if (result == 0)
+ {
+ ACE_DEBUG ( (LM_DEBUG,
+ ACE_TEXT (
+ "%T %n (%P|%t) - Leave TAO::FT_ReplicationManager::init.\n")
+ ));
+ }
+ else
+ {
+ ACE_DEBUG ( (LM_DEBUG,
+ ACE_TEXT (
+ "%T %n (%P|%t) - FT_ReplicationManager::init failed.\n")
+ ));
+ }
+ }
+
+ ////////////////////////////////
+ // Initialize default properties
+ PortableGroup::Value value;
+ value <<= TAO_PG_MEMBERSHIP_STYLE;
+ this->properties_support_.set_default_property (PortableGroup::PG_MEMBERSHIP_STYLE, value ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ value <<= TAO_PG_INITIAL_NUMBER_MEMBERS;
+ this->properties_support_.set_default_property (PortableGroup::PG_INITIAL_NUMBER_MEMBERS, value ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ value <<= TAO_PG_MINIMUM_NUMBER_MEMBERS;
+ this->properties_support_.set_default_property (PortableGroup::PG_MINIMUM_NUMBER_MEMBERS, value ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ value <<= FT::SEMI_ACTIVE;
+ this->properties_support_.set_default_property (FT::FT_REPLICATION_STYLE, value ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ value <<= FT::CONS_APP_CTRL;
+ this->properties_support_.set_default_property ( FT::FT_CONSISTENCY_STYLE, value ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ value <<= FT::PULL;
+ this->properties_support_.set_default_property (FT::FT_FAULT_MONITORING_STYLE, value ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ value <<= FT::MEMB;
+ this->properties_support_.set_default_property (FT::FT_FAULT_MONITORING_GRANULARITY, value ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+#if 0
+ FaultMonitoringIntervalAndTimeoutValue times;
+ value <<= times;
+ this->properties_support_.set_default_property (FT::FT_FAULT_MONITORING_INTERVAL_AND_TIMEOUT, value ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+#endif
+
+#if 0
+ value << interval;
+ this->properties_support_.set_default_property (FT::FT_CHECKPOINT_INTERVAL, value);
+#endif
+
+
+ return result;
+}
+
+//public
+int TAO::FT_ReplicationManager::idle (int & result ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_UNUSED_ARG (result);
+ return this->quit_;
+}
+
+
+//public
+int TAO::FT_ReplicationManager::fini (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int result = 0;
+
+ result = this->fault_consumer_.fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ 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->this_name_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ this->ns_name_ = 0;
+ }
+
+ return result;
+}
+
+//CORBA
+void
+TAO::FT_ReplicationManager::register_fault_notifier (
+ FT::FaultNotifier_ptr fault_notifier
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException))
+{
+ this->register_fault_notifier_i (fault_notifier ACE_ENV_ARG_PARAMETER);
+}
+
+//private
+void
+TAO::FT_ReplicationManager::register_fault_notifier_i (
+ FT::FaultNotifier_ptr fault_notifier
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException))
+{
+ if (CORBA::is_nil (fault_notifier))
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT (
+ "%T %n (%P|%t) - "
+ "Bad Fault Notifier object reference provided.\n")
+ ));
+ ACE_THROW (CORBA::BAD_PARAM (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+
+ // Cache new Fault Notifier object reference.
+ this->fault_notifier_ = FT::FaultNotifier::_duplicate (fault_notifier);
+
+ // Re-initialize our consumer.
+ // Swallow any exception.
+ int result = 0;
+ ACE_TRY_NEW_ENV
+ {
+ //@@ should we check to see if a notifier is already registered, rather than
+ // simply "unregistering"?
+ result = this->fault_consumer_.fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Note if the fini failed, we ignore it. It may not have been registered in the first place.
+
+ // Create a fault analyzer.
+ TAO::FT_FaultAnalyzer * analyzer = 0;
+ ACE_NEW_NORETURN (
+ analyzer,
+ TAO::FT_ReplicationManagerFaultAnalyzer (this));
+ if (analyzer == 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT (
+ "%T %n (%P|%t) - "
+ "Error creating FaultAnalyzer.\n"
+ )
+ ));
+ result = -1;
+ }
+ if (result == 0)
+ {
+ result = this->fault_consumer_.init (
+ this->poa_.in (),
+ this->fault_notifier_.in (),
+ analyzer
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManager::register_fault_notifier_i: "
+ "Error reinitializing FT_FaultConsumer.\n")
+ );
+ result = -1;
+ }
+ ACE_ENDTRY;
+
+ if (result != 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT (
+ "%T %n (%P|%t) - "
+ "Could not re-initialize FT_FaultConsumer.\n")
+ ));
+
+ ACE_THROW (CORBA::INTERNAL (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+}
+
+
+// Returns the reference of the Fault Notifier.
+//CORBA
+FT::FaultNotifier_ptr
+TAO::FT_ReplicationManager::get_fault_notifier (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException, FT::InterfaceNotFound))
+{
+ if (CORBA::is_nil (this->fault_notifier_.in ()))
+ {
+ ACE_THROW_RETURN ( FT::InterfaceNotFound () , FT::FaultNotifier::_nil ());
+ }
+ return FT::FaultNotifier::_duplicate (this->fault_notifier_.in ());
+}
+
+
+// TAO-specific find factory registry
+//CORBA
+::PortableGroup::FactoryRegistry_ptr
+TAO::FT_ReplicationManager::get_factory_registry (
+ const PortableGroup::Criteria & selection_criteria
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ( (CORBA::SystemException))
+{
+ ACE_UNUSED_ARG (selection_criteria);
+ return this->factory_registry_.reference ();
+}
+
+// TAO-specific shutdown operation.
+//public
+void TAO::FT_ReplicationManager::shutdown (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ( (CORBA::SystemException))
+{
+ this->quit_ = 1;
+}
+
+// Get the type_id associated with an object group.
+//CORBA
+char * TAO::FT_ReplicationManager::type_id (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+{
+ char * result = 0;
+ TAO::PG_Object_Group * group = 0;
+ if (this->group_factory_.find_group (object_group, group))
+ {
+ result = group->get_type_id ();
+ }
+ else
+ {
+ ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), 0);
+ }
+ return result;
+}
+
+//////////////////////////////////////////////////////
+// PortableGroup::PropertyManager methods
+
+//CORBA
+void
+TAO::FT_ReplicationManager::set_default_properties (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+
+ this->properties_support_.set_default_properties (props ACE_ENV_ARG_PARAMETER);
+ //@@ validate properties?
+}
+
+//CORBA
+PortableGroup::Properties *
+TAO::FT_ReplicationManager::get_default_properties (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException))
+{
+ return this->properties_support_.get_default_properties (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+//CORBA
+void
+TAO::FT_ReplicationManager::remove_default_properties (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ this->properties_support_.remove_default_properties (props
+ ACE_ENV_ARG_PARAMETER);
+}
+
+//CORBA
+void
+TAO::FT_ReplicationManager::set_type_properties (
+ const char *type_id,
+ const PortableGroup::Properties & overrides
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ this->properties_support_.set_type_properties (
+ type_id,
+ overrides
+ ACE_ENV_ARG_PARAMETER);
+}
+
+//CORBA
+PortableGroup::Properties *
+TAO::FT_ReplicationManager::get_type_properties (
+ const char *type_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException))
+{
+ return this->properties_support_.get_type_properties (type_id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+//CORBA
+void
+TAO::FT_ReplicationManager::remove_type_properties (
+ const char *type_id,
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ this->properties_support_.remove_type_properties (
+ type_id,
+ props
+ ACE_ENV_ARG_PARAMETER);
+}
+
+//CORBA
+void
+TAO::FT_ReplicationManager::set_properties_dynamically (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Properties & overrides
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+
+ TAO::PG_Object_Group * group = 0;
+ if (this->group_factory_.find_group (object_group, group))
+ {
+ group->set_properties_dynamically (overrides ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ ACE_THROW (PortableGroup::ObjectGroupNotFound ());
+ }
+}
+
+//CORBA
+PortableGroup::Properties *
+TAO::FT_ReplicationManager::get_properties (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+ PortableGroup::Properties_var result;
+ ACE_NEW_THROW_EX (result, PortableGroup::Properties(), CORBA::NO_MEMORY ());
+
+ TAO::PG_Object_Group * group = 0;
+ if (this->group_factory_.find_group (object_group, group))
+ {
+ group->get_properties (result);
+ }
+ else
+ {
+ ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), 0);
+ }
+ return result._retn();
+}
+
+
+//////////////////////////////////////////////////////
+// FT::FTObjectGroupManager methods
+
+/// Sets the primary member of a group.
+//CORBA
+PortableGroup::ObjectGroup_ptr
+TAO::FT_ReplicationManager::set_primary_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (
+ CORBA::SystemException
+ , PortableGroup::ObjectGroupNotFound
+ , PortableGroup::MemberNotFound
+ , FT::PrimaryNotSet
+ , FT::BadReplicationStyle
+ ))
+{
+ METHOD_ENTRY (TAO::FT_ReplicationManager::set_primary_member);
+ PortableGroup::ObjectGroup_var result = PortableGroup::ObjectGroup::_nil();
+ TAO::PG_Object_Group * group = 0;
+ if (this->group_factory_.find_group (object_group, group))
+ {
+
+ PortableGroup::TagGroupTaggedComponent tag_component;
+ TAO_FT_IOGR_Property prop (tag_component);
+
+ int sts = group->set_primary_member (&prop, the_location ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableGroup::ObjectGroup::_nil ());
+ if (sts)
+ {
+ result = group->reference ();
+ }
+ else
+ {
+ ACE_THROW_RETURN (FT::PrimaryNotSet (), PortableGroup::ObjectGroup::_nil ());
+ }
+ }
+ else
+ {
+ ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), PortableGroup::ObjectGroup::_nil ());
+ }
+ METHOD_RETURN (TAO::FT_ReplicationManager::set_primary_member) result._retn ();
+}
+
+//CORBA
+PortableGroup::ObjectGroup_ptr
+TAO::FT_ReplicationManager::create_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::NoFactory,
+ PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::CannotMeetCriteria))
+{
+ PortableGroup::ObjectGroup_var result = PortableGroup::ObjectGroup::_nil();
+ TAO::PG_Object_Group * group = 0;
+ if (this->group_factory_.find_group (object_group, group))
+ {
+ group->create_member (the_location, type_id, the_criteria ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableGroup::ObjectGroup::_nil ());
+ result = group->reference ();
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::create_member: unknown group\n")
+ ));
+ }
+ ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result._retn ());
+ }
+ return result._retn();
+}
+
+
+//CORBA
+PortableGroup::ObjectGroup_ptr
+TAO::FT_ReplicationManager::add_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ CORBA::Object_ptr member
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::ObjectNotAdded))
+{
+ METHOD_ENTRY (TAO::FT_ReplicationManager::add_member);
+ PortableGroup::ObjectGroup_var result = PortableGroup::ObjectGroup::_nil ();
+
+ // Find the object group corresponding to this IOGR
+ TAO::PG_Object_Group * group = 0;
+ if (this->group_factory_.find_group (object_group, group))
+ {
+ group->add_member (
+ the_location,
+ member
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ result = group->reference ();
+
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::add_member to unknown group\n")
+ ));
+ }
+ ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result._retn ());
+ }
+ METHOD_RETURN (TAO::FT_ReplicationManager::add_member) result._retn ();
+}
+
+//CORBA
+PortableGroup::ObjectGroup_ptr
+TAO::FT_ReplicationManager::remove_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound))
+{
+ PortableGroup::ObjectGroup_var result = PortableGroup::ObjectGroup::_nil ();
+
+ // Find the object group corresponding to this IOGR
+ TAO::PG_Object_Group * group = 0;
+ if (this->group_factory_.find_group (object_group, group))
+ {
+ group->remove_member (the_location ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (result._retn ());
+
+ group->minimum_populate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (result._retn ());
+ //@@ how about the case where the member was removed successfully,
+ // but for one reason or another we were unable to bring the group
+ // back up to minimum_number_of_replicas?
+
+ result = group->reference ();
+ }
+ else
+ {
+ ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result._retn ());
+ }
+ return result._retn ();
+}
+
+//CORBA
+PortableGroup::Locations *
+TAO::FT_ReplicationManager::locations_of_members (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+ PortableGroup::Locations * result = 0;
+
+ // Find the object group corresponding to this IOGR
+ TAO::PG_Object_Group * group = 0;
+ if (this->group_factory_.find_group (object_group, group))
+ {
+ result = group->locations_of_members (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::locations_of_members: unknown group\n")
+ ));
+ }
+ ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), 0);
+ }
+ return result;
+}
+
+//CORBA
+PortableGroup::ObjectGroups *
+TAO::FT_ReplicationManager::groups_at_location (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException))
+{
+ return this->group_factory_.groups_at_location (the_location ACE_ENV_ARG_PARAMETER);
+}
+
+//CORBA
+PortableGroup::ObjectGroupId
+TAO::FT_ReplicationManager::get_object_group_id (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+ PortableGroup::ObjectGroupId result = 0;
+ TAO::PG_Object_Group * group = 0;
+ if (this->group_factory_.find_group (object_group, group))
+ {
+ group->get_object_group_id ();
+ ACE_CHECK_RETURN (result);
+ result = group->get_object_group_id ();
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::get_object_group_id: unknown group\n")
+ ));
+ }
+ ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result);
+ }
+ return result;
+}
+
+//CORBA
+PortableGroup::ObjectGroup_ptr
+TAO::FT_ReplicationManager::get_object_group_ref (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+ PortableGroup::ObjectGroup_var result = PortableGroup::ObjectGroup::_nil ();
+
+ // Find the object group corresponding to this IOGR
+ TAO::PG_Object_Group * group = 0;
+ if (this->group_factory_.find_group (object_group, group))
+ {
+ result = group->reference ();
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::get_object_group_ref: unknown group\n")
+ ));
+ }
+ ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result._retn ());
+ }
+ return result._retn();
+}
+
+//CORBA, TAO specific
+PortableGroup::ObjectGroup_ptr
+TAO::FT_ReplicationManager::get_object_group_ref_from_id (
+ PortableGroup::ObjectGroupId group_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (
+ CORBA::SystemException
+ , PortableGroup::ObjectGroupNotFound
+ ))
+{
+ PortableGroup::ObjectGroup_var result = PortableGroup::ObjectGroup::_nil ();
+
+ // Find the object group corresponding to this IOGR
+ TAO::PG_Object_Group * group = 0;
+ if (this->group_factory_.find_group (group_id, group))
+ {
+ result = group->reference ();
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::get_object_group_ref_from_id: unknown group\n")
+ ));
+ }
+ ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result._retn ());
+ }
+ return result._retn();
+}
+
+//CORBA
+CORBA::Object_ptr
+TAO::FT_ReplicationManager::get_member_ref (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound))
+{
+ CORBA::Object_var result = CORBA::Object::_nil();
+
+ // Find the object group corresponding to this IOGR
+ TAO::PG_Object_Group * group = 0;
+ if (this->group_factory_.find_group (object_group, group))
+ {
+ result = group->get_member_reference (the_location ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil());
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::get_member_ref: unknown group\n")
+ ));
+ }
+ ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result._retn ());
+ }
+ return result._retn();
+}
+
+
+//////////////////////////////////////////////////////
+// PortableGroup::GenericFactory methods
+
+//CORBA
+CORBA::Object_ptr
+TAO::FT_ReplicationManager::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 (TAO::FT_ReplicationManager::create_object)
+
+ ////////////////////////////////
+ // find the properties for this
+ // type of object group
+ TAO::PG_Property_Set * typeid_properties
+ = this->properties_support_.find_typeid_properties (
+ type_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ TAO::PG_Object_Group * group
+ = this->group_factory_.create_group (
+ type_id,
+ the_criteria,
+ typeid_properties
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ group->initial_populate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+ //@@ on error we should remove the group from the Group_Factory
+ // doing this "right" will require a var-type pointer to the object group
+ // that knows about the factory, too.
+
+ // Allocate a new FactoryCreationId for use as an "out" parameter.
+ PortableGroup::GenericFactory::FactoryCreationId_ptr factory_id_ptr = 0;
+ ACE_NEW_THROW_EX (factory_id_ptr,
+ PortableGroup::GenericFactory::FactoryCreationId,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+ PortableGroup::GenericFactory::FactoryCreationId_var factory_id = factory_id_ptr;
+ PortableGroup::ObjectGroupId group_id = group->get_object_group_id ();
+ factory_id <<= group_id;
+ factory_creation_id = factory_id._retn();
+
+ METHOD_RETURN (TAO::FT_ReplicationManager::create_object) group->reference ();
+}
+
+//CORBA
+void
+TAO::FT_ReplicationManager::delete_object (
+ const PortableGroup::GenericFactory::FactoryCreationId & factory_creation_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::ObjectNotFound))
+{
+
+ PortableGroup::ObjectGroupId group_id = 0;
+ if (factory_creation_id >>= group_id)
+ {
+ this->group_factory_.delete_group (
+ group_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ ACE_THROW (PortableGroup::ObjectNotFound ());
+ }
+}
+
+//private
+int TAO::FT_ReplicationManager::write_ior ()
+{
+ int result = -1;
+ FILE* out = ACE_OS::fopen (this->ior_output_file_, "w");
+ if (out)
+ {
+ CORBA::String_var ior_str = this->orb_->object_to_string (
+ this->replication_manager_ref_.in ());
+ ACE_OS::fprintf (out, "%s", ior_str.in ());
+ ACE_OS::fclose (out);
+ result = 0;
+ }
+ else
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - Open failed for %s\n"), this->ior_output_file_
+ ));
+ }
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.h b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.h
new file mode 100644
index 00000000000..a38ed1ec911
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.h
@@ -0,0 +1,527 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_ReplicationManager.h
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ *
+ * @author Curt Hibbs <hibbs_c@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef FT_REPLICATION_MANAGER_H_
+#define FT_REPLICATION_MANAGER_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_ReplicationManagerS.h>
+//#include <orbsvcs/PortableGroup/PG_PropertyManager.h>
+//#include <orbsvcs/PortableGroup/PG_GenericFactory.h>
+//#include <orbsvcs/PortableGroup/PG_ObjectGroupManager.h>
+// Note: the new, improved versions...
+//#include <orbsvcs/PortableGroup/PG_Object_Group_Map.h>
+#include <orbsvcs/PortableGroup/PG_Properties_Support.h>
+#include <orbsvcs/PortableGroup/PG_Group_Factory.h>
+
+#include <orbsvcs/PortableGroup/PG_FactoryRegistry.h>
+#include <orbsvcs/FT_ReplicationManager/FT_FaultConsumer.h>
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ /**
+ * Implement the ReplicationManager interfaces.
+ *
+ * The ReplicationManager does most of its work by delegating to
+ * support objects. These include:
+ *
+ * TAO::PG_Group_Factory group_factory_;
+ * The group factory contains a collection of TAO::PG_Object_Groups
+ * It provides methods to create new groups, destroy old groups and
+ * find existing groups.
+ *
+ * TAO::PG_Object_Group
+ * These objects which can be found through the group factory provde
+ * methods to create and add group members, remove and delete group
+ * members and set group properties.
+ *
+ * TAO::PG_Properties_Support properties_support_;
+ * This object maintains sets of properties(TAO::PG_Property_Set).
+ * In particular it has one default property set, and a collection of
+ * property sets indexed by type_id.
+ * The default property set acts as a parent to the type_id property
+ * sets and the type_id property sets act as parents to the property
+ * sets contained in PG_Object_Group.
+ *
+ * FT::FaultNotifier_var fault_notifier_;
+ * This notification channel is "the" source of fault notifications.
+ *
+ * TAO::FT_FaultConsumer fault_consumer_;
+ * This object subscribes to the fault_notifier_as a fault consumer. It
+ * analyzes incoming fault notifications and calls appropriate ReplicationManager
+ * methods to respond to the fault.
+ *
+ * TAO::PG_FactoryRegistry factory_registry_;
+ * This object maintains a collection of factory registrations. When a factory
+ * is started it registeres itself with the ReplicationManager (delegated to this
+ * object). When a member needs to be created in an object group this factory
+ * registry is queried to find factories that can create the member.
+ */
+ class FT_ReplicationManager
+ : public virtual POA_FT::ReplicationManager
+ {
+
+ //////////////////////
+ // non-CORBA interface
+
+ public:
+ /**
+ * Default constructor.
+ * Call init after constructing the object to prepare it for use.
+ */
+ FT_ReplicationManager ();
+
+ /**
+ * Destructor.
+ * Actual cleanup happens in the fini function.
+ */
+ virtual ~FT_ReplicationManager ();
+
+ public:
+
+ /**
+ * 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 CORBA::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);
+
+ /**
+ * Idle-time activity.
+ *
+ * @param result is set to process return code if return value is non-zero.
+ * @return zero to continue; nonzero to exit
+ */
+ int idle (int & result ACE_ENV_ARG_DECL);
+
+
+ /**
+ * Identify this fault detector factory.
+ * @return a string to identify this object for logging/console message purposes.
+ */
+ const char * identity () const;
+
+ /**
+ * Get the type_id associated with an object group.
+ * @param object_group The ObjectGroup.
+ * @return String identifying the type id associated with the ObjectGroup.
+ */
+ char * type_id (PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL);
+
+
+ //////////////////////
+ // CORBA interface(s)
+
+ public:
+
+ /**
+ * @name POA_FT::ReplicationManager Methods
+ *
+ * Methods required by the POA_FT::ReplicationManager interface.
+ */
+ //@{
+
+ /// Registers the Fault Notifier with the Replication Manager.
+ virtual void register_fault_notifier (
+ FT::FaultNotifier_ptr fault_notifier
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// Returns the reference of the Fault Notifier.
+ virtual FT::FaultNotifier_ptr get_fault_notifier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , FT::InterfaceNotFound
+ ));
+
+ /// TAO-specific find factory registry
+ virtual ::PortableGroup::FactoryRegistry_ptr get_factory_registry (
+ const PortableGroup::Criteria & selection_criteria
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// TAO-specific shutdown operation.
+ virtual void shutdown (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ //@}
+
+ /**
+ * @name PortableGroup::PropertyManager Methods
+ *
+ * Methods required by the PortableGroup::PropertyManager interface.
+ */
+ //@{
+
+ /// Set the default properties to be used by all object groups.
+ virtual void set_default_properties (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /// Get the default properties used by all object groups.
+ virtual PortableGroup::Properties * get_default_properties (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Remove default properties.
+ virtual void remove_default_properties (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /**
+ * Set properties associated with a given Replica type. These
+ * properties override the default properties on a name-by-name basis.
+ */
+ virtual void set_type_properties (
+ const char * type_id,
+ const PortableGroup::Properties & overrides
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /**
+ * Return the properties associated with a given Replica type. These
+ * properties include the type-specific properties in use, in
+ * addition to the default properties that were not overridden.
+ */
+ virtual PortableGroup::Properties * get_type_properties (
+ const char * type_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Remove the given properties associated with the Replica type ID.
+ virtual void remove_type_properties (
+ const char * type_id,
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /**
+ * Dynamically set the properties associated with a given object
+ * group as the replication manager and replicas are being executed.
+ * These properties override the type-specific and default
+ * properties.
+ */
+ virtual void set_properties_dynamically (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Properties & overrides
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /**
+ * Return the properties currently in use by the given object
+ * group. These properties include those that were set dynamically,
+ * type-specific properties that weren't overridden, properties that
+ * were used when the Replica was created, and default properties
+ * that weren't overridden.
+ */
+ virtual PortableGroup::Properties * get_properties (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+ //@}
+
+ /**
+ * @name FT::FTObjectGroupManager methods
+ *
+ * Methods required by the FT::FTObjectGroupManager
+ * interface.
+ */
+ //@{
+
+ /// Create a member in an object group.
+ virtual PortableGroup::ObjectGroup_ptr create_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::NoFactory,
+ PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::CannotMeetCriteria));
+
+ /// Add an existing object to the ObjectGroup.
+ virtual PortableGroup::ObjectGroup_ptr add_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ CORBA::Object_ptr member
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::ObjectNotAdded));
+
+ /**
+ * Remove the member at a specific location from an
+ * ObjectGroup. Application created objects must be
+ * deleted by the application. Objects created by the
+ * infrastructure (replication manager) will be deleted by the
+ * infrastructure.
+ * For infrastructure-controlled membership: After the member
+ * is removed from the group the minumum number of members
+ * parameter will be checked and new members will be created
+ * as necessary (if possible.)
+ */
+ virtual PortableGroup::ObjectGroup_ptr remove_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound));
+
+ /// Return the locations of the members in the given ObjectGroup.
+ virtual PortableGroup::Locations * locations_of_members (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+ /// Return the locations of the members in the given ObjectGroup.
+ virtual PortableGroup::ObjectGroups * groups_at_location (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the ObjectGroupId for the given ObjectGroup.
+ virtual PortableGroup::ObjectGroupId get_object_group_id (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+ /**
+ * Return an update the IOGR for an object group. If no changes have
+ * been made in the group the return value will be the same as the object_group
+ * parameter.
+ */
+ virtual PortableGroup::ObjectGroup_ptr get_object_group_ref (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+ /**
+ * TAO-specific extension.
+ * Return the ObjectGroup reference for the given ObjectGroupId.
+ */
+ virtual PortableGroup::ObjectGroup_ptr get_object_group_ref_from_id (
+ PortableGroup::ObjectGroupId group_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::ObjectGroupNotFound
+ ));
+
+ /**
+ * Return the reference corresponding to the Replica of a given
+ * ObjectGroup at the given location.
+ */
+ virtual CORBA::Object_ptr get_member_ref (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & loc
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound));
+
+ /// Sets the primary member of a group.
+ virtual PortableGroup::ObjectGroup_ptr set_primary_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::ObjectGroupNotFound
+ , PortableGroup::MemberNotFound
+ , FT::PrimaryNotSet
+ , FT::BadReplicationStyle
+ ));
+
+ //@}
+
+ /**
+ * @name PortableGroup::GenericFactory methods
+ *
+ * Methods required by the PortableGroup::GenericFactory interface.
+ */
+ //@{
+
+ /**
+ * Create an object of the specified type that adheres to the
+ * restrictions defined by the provided Criteria. The out
+ * FactoryCreationId parameter may be passed to the delete_object()
+ * method to delete the object.
+ *
+ * Infrastructure controlled membership: The initial number of members
+ * property will be honored by creating new members and adding them to
+ * the group.
+ */
+ 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)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::NoFactory,
+ PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::InvalidProperty,
+ PortableGroup::CannotMeetCriteria));
+
+ /**
+ * Delete the object group corresponding to the provided
+ * FactoryCreationId. For infratructure-controlled membership
+ * all members will be deleted. For application-controlled membership
+ * the application is responsible for deleting group members.
+ */
+ virtual void delete_object (
+ const PortableGroup::GenericFactory::FactoryCreationId &
+ factory_creation_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectNotFound));
+
+ //@}
+
+ /////////////////////////
+ // Implementation methods
+ private:
+ /**
+ * Write this factory's IOR to a file
+ */
+ int write_ior (void);
+
+ /// Registers the Fault Notifier with the Replication Manager.
+ void register_fault_notifier_i (
+ FT::FaultNotifier_ptr fault_notifier
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ ////////////////
+ // Forbidden methods
+ FT_ReplicationManager (const FT_ReplicationManager & rhs);
+ FT_ReplicationManager & operator = (const FT_ReplicationManager & rhs);
+
+ ///////////////
+ // Data Members
+ private:
+
+ /// The orb
+ CORBA::ORB_var orb_;
+
+ /// The POA.
+ PortableServer::POA_var poa_;
+
+ /// A file to which the factory's IOR should be written.
+ const char * ior_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_;
+
+ /// Our object reference.
+ FT::ReplicationManager_var replication_manager_ref_;
+
+ /// A human-readable string to identify this Replication Manager.
+ ACE_CString identity_;
+
+ /// an object that manages a collection of object groups
+ TAO::PG_Group_Factory group_factory_;
+
+ /// an object that manages default and type_id related properties
+ TAO::PG_Properties_Support properties_support_;
+
+ /// The fault notifier.
+ FT::FaultNotifier_var fault_notifier_;
+ /// set by command line -f option
+ const char * fault_notifier_ior_string_;
+
+ /// The fault consumer.
+ TAO::FT_FaultConsumer fault_consumer_;
+
+ /// The factory registry
+ TAO::PG_FactoryRegistry factory_registry_;
+
+ /// Quit flag.
+ int quit_;
+ };
+
+} // namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* FT_REPLICATION_MANAGER_H_ */
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.mpc b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.mpc
new file mode 100644
index 00000000000..c34f71456b1
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.mpc
@@ -0,0 +1,25 @@
+// $Id$
+project(*Lib): orbsvcslib, conv_lib, fault_tolerance, notification_skel, ftorb, portablegroup, minimum_corba {
+ sharedname = TAO_ReplicationManagerLib
+ dynamicflags = TAO_REPLICATIONMANAGERLIB_BUILD_DLL
+
+ Source_Files {
+ FT_FaultAnalyzer.cpp
+ FT_DefaultFaultAnalyzer.cpp
+ FT_FaultEventDescriptor.cpp
+ FT_FaultConsumer.cpp
+ }
+}
+
+project : taoserver, orbsvcsexe, fault_tolerance, notification_skel, iormanip, iortable, ftorb, core {
+ exename = FT_ReplicationManager
+ libs += TAO_ReplicationManagerLib
+ after += FT_ReplicationManager_Lib
+ Source_Files {
+ FT_ReplicationManager.cpp
+ FT_ReplicationManager_Main.cpp
+ FT_Property_Validator.cpp
+ FT_ReplicationManagerFaultAnalyzer.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.cpp
new file mode 100755
index 00000000000..4606008727c
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.cpp
@@ -0,0 +1,1118 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_ReplicationManagerFaultAnalyzer.cpp
+ *
+ * $Id$
+ *
+ * This file is part of TAO's implementation of Fault Tolerant CORBA.
+ *
+ * @author Steve Totten <totten_s@ociweb.com>
+ */
+//=============================================================================
+
+#include "FT_ReplicationManagerFaultAnalyzer.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/FT_NotifierC.h"
+#include "orbsvcs/FT_ReplicationManager/FT_ReplicationManager.h"
+#include "orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.h"
+#include "orbsvcs/PortableGroup/PG_Property_Utils.h"
+#include "orbsvcs/PortableGroup/PG_Operators.h"
+#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h"
+#include "tao/debug.h"
+#include <iostream>
+
+ACE_RCSID (FT_ReplicationManagerFaultAnalyzer,
+ FT_ReplicationManagerFaultAnalyzer,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Constructor.
+TAO::FT_ReplicationManagerFaultAnalyzer::FT_ReplicationManagerFaultAnalyzer (
+ const TAO::FT_ReplicationManager * replication_manager)
+ : replication_manager_ (
+ const_cast<TAO::FT_ReplicationManager *> (replication_manager))
+{
+}
+
+/// Destructor.
+TAO::FT_ReplicationManagerFaultAnalyzer::~FT_ReplicationManagerFaultAnalyzer ()
+{
+}
+
+// Validate the event to make sure it is one we can handle.
+// If it is not an event we can handle, this function logs the error
+// and returns -1.
+int TAO::FT_ReplicationManagerFaultAnalyzer::validate_event_type (
+ const CosNotification::StructuredEvent & event)
+{
+ // Delegate to base class.
+ //@@ Visual C++ 6.0 won't compile this if I include the namespace name
+ // on the base class.
+ // return TAO::FT_DefaultFaultAnalyzer::validate_event_type (event);
+ return FT_DefaultFaultAnalyzer::validate_event_type (event);
+}
+
+/// Analyze a fault event.
+int TAO::FT_ReplicationManagerFaultAnalyzer::analyze_fault_event (
+ const CosNotification::StructuredEvent & event)
+{
+ int result = 0;
+
+ const CosNotification::FilterableEventBody & filterable =
+ event.filterable_data;
+ CORBA::ULong item_count = filterable.length ();
+ if (TAO_debug_level > 6)
+ {
+ for (CORBA::ULong n_prop = 0; n_prop < item_count; ++n_prop)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT(
+ "TAO::FT_ReplicationManagerFaultAnalyzer::analyze_fault_event: "
+ "Property Name: <%s>\n"),
+ filterable[n_prop].name.in()
+ ));
+ }
+ }
+
+ // Populate a TAO::FT_FaultEventDescriptor structure from the
+ // properties in the event.
+ TAO::FT_FaultEventDescriptor fault_event_desc;
+
+ // Extract the location.
+ if (result == 0)
+ {
+ result = this->get_location (
+ filterable[1].value, fault_event_desc.location.out());
+ }
+
+ // CORBA 3.0.2, section 23.4.5.1 states:
+ //
+ // The fault detector may or may not set the TypeId and
+ // ObjectGroupId fields with the following interpretations:
+ // - Neither is set if all objects at the given location have failed.
+ // - TypeId is set and ObjectGroupId is not set if all objects at
+ // the given location with the given type have failed.
+ // - Both are set if the member with the given ObjectGroupId at the
+ // given location has failed.
+
+ if ((result == 0) && (item_count == 2))
+ {
+ // All objects at location failed.
+ fault_event_desc.all_at_location_failed = 1;
+ }
+
+ if ((result == 0) && (item_count == 3))
+ {
+ // All objects of type at location failed.
+ fault_event_desc.all_of_type_at_location_failed = 1;
+ result = this->get_type_id (
+ filterable[2].value, fault_event_desc.type_id.out());
+ }
+
+ if ((result == 0) && (item_count == 4))
+ {
+ // An object (replica) at a location failed.
+ fault_event_desc.object_at_location_failed = 1;
+ result = this->get_type_id (
+ filterable[2].value, fault_event_desc.type_id.out());
+ if (result == 0)
+ {
+ result = this->get_object_group_id (
+ filterable[3].value, fault_event_desc.object_group_id);
+ }
+ }
+
+ // A specific object at a location failed.
+ if ((result == 0) && (fault_event_desc.object_at_location_failed == 1))
+ {
+ result = this->single_replica_failure (fault_event_desc);
+ }
+
+ // All objects at location failed.
+ if ((result == 0) && (fault_event_desc.all_at_location_failed == 1))
+ {
+ result = this->location_failure (fault_event_desc);
+ }
+
+ // All objects of type at location failed.
+ if ((result == 0) && (fault_event_desc.all_of_type_at_location_failed == 1))
+ {
+ result = this->type_failure (fault_event_desc);
+ }
+
+ // Debugging support.
+ if (TAO_debug_level > 6)
+ {
+ fault_event_desc.dump ();
+ }
+
+ return result;
+}
+
+// Extract a string type_id from CORBA::Any.
+// Caller owns the string returned via <type_id>.
+int TAO::FT_ReplicationManagerFaultAnalyzer::get_type_id (
+ const CORBA::Any& val, PortableGroup::TypeId_out type_id)
+{
+ const char* type_id_value;
+ if ((val >>= type_id_value) == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::get_type_id: "
+ "Could not extract TypeId value from any.\n")),
+ -1);
+ }
+
+ // Make a deep copy of the TypeId string.
+ type_id = CORBA::string_dup (type_id_value);
+ return 0;
+}
+
+// Extract the ObjectGroupId from CORBA::Any.
+int TAO::FT_ReplicationManagerFaultAnalyzer::get_object_group_id (
+ const CORBA::Any& val, PortableGroup::ObjectGroupId& id)
+{
+ PortableGroup::ObjectGroupId temp_id = (PortableGroup::ObjectGroupId)0;
+ if ((val >>= temp_id) == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::get_object_group_id: "
+ "Could not extract ObjectGroupId value from any.\n")),
+ -1);
+ }
+ id = temp_id;
+ return 0;
+}
+
+int TAO::FT_ReplicationManagerFaultAnalyzer::get_location (
+ const CORBA::Any& val, PortableGroup::Location_out location)
+{
+ const PortableGroup::Location* temp_loc;
+ if ((val >>= temp_loc) == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::get_location: "
+ "Could not extract Location value from fault event.\n")),
+ -1);
+ }
+ // Make a deep copy of the Location.
+ ACE_NEW_RETURN (location, PortableGroup::Location (*temp_loc), -1);
+ return 0;
+}
+
+//
+//TODO: Use TAO::PG_Property_Set to get property values from properties
+// instead of all these specific "get" functions.
+//
+
+// Get the MembershipStyle property.
+int TAO::FT_ReplicationManagerFaultAnalyzer::get_membership_style (
+ const PortableGroup::Properties & properties,
+ PortableGroup::MembershipStyleValue & membership_style)
+{
+ PortableGroup::Name prop_name (1);
+ prop_name.length (1);
+ prop_name[0].id = CORBA::string_dup (FT::FT_MEMBERSHIP_STYLE);
+ int result = 0;
+
+ PortableGroup::Value value;
+ if (TAO_PG::get_property_value (prop_name, properties, value)
+ && ((value >>= membership_style) == 1))
+ {
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::get_membership_style: "
+ "MembershipStyle is <%d>:\n"),
+ membership_style
+ ));
+ }
+ }
+ else
+ {
+ result = -1;
+ }
+
+ return result;
+}
+
+int TAO::FT_ReplicationManagerFaultAnalyzer::get_replication_style (
+ const PortableGroup::Properties & properties,
+ FT::ReplicationStyleValue & replication_style)
+{
+ PortableGroup::Name prop_name (1);
+ prop_name.length (1);
+ prop_name[0].id = CORBA::string_dup (FT::FT_REPLICATION_STYLE);
+ int result = 0;
+
+ PortableGroup::Value value;
+ if (TAO_PG::get_property_value (prop_name, properties, value)
+ && ((value >>= replication_style) == 1))
+ {
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::get_replication_style: "
+ "ReplicationStyle is <%d>:\n"),
+ replication_style
+ ));
+ }
+ }
+ else
+ {
+ result = -1;
+ }
+
+ return result;
+}
+
+int TAO::FT_ReplicationManagerFaultAnalyzer::get_minimum_number_members (
+ const PortableGroup::Properties & properties,
+ PortableGroup::MinimumNumberMembersValue & minimum_number_members)
+{
+ PortableGroup::Name prop_name (1);
+ prop_name.length (1);
+ prop_name[0].id = CORBA::string_dup (FT::FT_MINIMUM_NUMBER_MEMBERS);
+ int result = 0;
+
+ PortableGroup::Value value;
+ if (TAO_PG::get_property_value (prop_name, properties, value)
+ && ((value >>= minimum_number_members) == 1))
+ {
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::get_minimum_number_members: "
+ "MinimumNumberMembers is <%d>:\n"),
+ minimum_number_members
+ ));
+ }
+ }
+ else
+ {
+ result = -1;
+ }
+
+ return result;
+}
+
+int TAO::FT_ReplicationManagerFaultAnalyzer::get_initial_number_members (
+ const PortableGroup::Properties & properties,
+ PortableGroup::InitialNumberMembersValue & initial_number_members)
+{
+ PortableGroup::Name prop_name (1);
+ prop_name.length (1);
+ prop_name[0].id = CORBA::string_dup (FT::FT_INITIAL_NUMBER_MEMBERS);
+ int result = 0;
+
+ PortableGroup::Value value;
+ if (TAO_PG::get_property_value (prop_name, properties, value)
+ && ((value >>= initial_number_members) == 1))
+ {
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::get_initial_number_members: "
+ "InitialNumberMembers is <%d>:\n"),
+ initial_number_members
+ ));
+ }
+ }
+ else
+ {
+ result = -1;
+ }
+
+ return result;
+}
+
+int TAO::FT_ReplicationManagerFaultAnalyzer::get_factories (
+ const PortableGroup::Properties & properties,
+ PortableGroup::FactoryInfos_out factories)
+{
+ PortableGroup::Name prop_name (1);
+ prop_name.length (1);
+ prop_name[0].id = CORBA::string_dup (FT::FT_FACTORIES);
+ int result = 0;
+
+ PortableGroup::FactoryInfos_var temp_factories;
+ PortableGroup::Value value;
+ if (TAO_PG::get_property_value (prop_name, properties, value) == 1)
+ {
+ if ((value >>= temp_factories) == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::get_factories: "
+ "Could not extract Factories from properties.\n")
+ ));
+ result = -1;
+ }
+ else
+ {
+ // Make a deep copy of the Factories.
+ ACE_NEW_RETURN (factories, PortableGroup::FactoryInfos (temp_factories.in()), -1);
+ result = 0;
+ }
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::get_factories: "
+ "Could not find Factories property.\n")
+ ));
+ result = -1;
+ }
+ return result;
+}
+
+int TAO::FT_ReplicationManagerFaultAnalyzer::is_primary_member (
+ const PortableGroup::ObjectGroup_ptr iogr,
+ const PortableGroup::Location & location,
+ int & object_is_primary)
+{
+
+ // To determine if this was a primary that faulted:
+ // Get the TagFTGroupTaggedComponent from the IOGR and search
+ // for the primary, using the TAO_FT_IOGR_Property helper class.
+ // Then, compare the TypeId and Location of the failed object with
+ // those of the primary. If they match, it was a primary fault.
+
+ int result = 0;
+ object_is_primary = 0;
+
+ ACE_TRY_NEW_ENV
+ {
+ // Create an "empty" TAO_FT_IOGR_Property and use it to get the
+ // tagged component.
+ TAO_FT_IOGR_Property temp_ft_prop;
+ FT::TagFTGroupTaggedComponent ft_group_tagged_component;
+ CORBA::Boolean got_tagged_component =
+ temp_ft_prop.get_tagged_component (
+ iogr, ft_group_tagged_component ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (got_tagged_component)
+ {
+ // Create a new TAO_FT_IOGR_Property with the tagged
+ // component.
+ TAO_FT_IOGR_Property ft_prop (ft_group_tagged_component);
+
+ // Check to see if a primary is set.
+ CORBA::Boolean primary_is_set = ft_prop.is_primary_set (
+ iogr ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (primary_is_set)
+ {
+ // Get the primary object.
+ CORBA::Object_var primary_obj = ft_prop.get_primary (
+ iogr ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil (primary_obj.in()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::is_primary_member: "
+ "Could not get primary IOR from IOGR.\n")),
+ -1);
+ }
+
+ // Get the object reference of the failed member.
+ CORBA::Object_var failed_obj =
+ this->replication_manager_->get_member_ref (
+ iogr, location ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil (failed_obj.in()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::is_primary_member: "
+ "Could not get IOR of failed member from IOGR.\n")),
+ -1);
+ }
+
+ // Are the two object refs (primary and failed) equivalent?
+ CORBA::Boolean equiv = primary_obj->_is_equivalent (
+ failed_obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (equiv)
+ {
+ object_is_primary = 1;
+ result = 0;
+ }
+ }
+ else // primary is not set
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::is_primary_member: "
+ "Primary is not set on IOGR.\n")
+ ));
+ result = -1;
+ }
+ }
+ else // could not get tagged component
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::is_primary_member: "
+ "Could not get tagged component from IOGR.\n")
+ ));
+ result = -1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::is_primary_member: ")
+ );
+ result = -1;
+ }
+ ACE_ENDTRY;
+
+ return result;
+}
+
+// Handle a single replica failure.
+int TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure (
+ TAO::FT_FaultEventDescriptor & fault_event_desc)
+{
+ int result = 0;
+ PortableGroup::ObjectGroup_var the_object_group = PortableGroup::ObjectGroup::_nil();
+ PortableGroup::Properties_var properties;
+
+ ACE_TRY_NEW_ENV
+ {
+ // Get the object group reference based on the ObjectGroupId.
+ the_object_group =
+ this->replication_manager_->get_object_group_ref_from_id (
+ fault_event_desc.object_group_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This should not happen, but let us be safe.
+ if (CORBA::is_nil (the_object_group.in()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: "
+ "Could not get ObjectGroup reference from ObjectGroupId: <%Q>.\n"),
+ fault_event_desc.object_group_id
+ ));
+ ACE_TRY_THROW (PortableGroup::ObjectGroupNotFound ());
+ }
+
+ // Get the properties associated with this ObjectGroup.
+ properties = this->replication_manager_->get_properties (
+ the_object_group.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: ")
+ );
+ result = -1;
+ }
+ ACE_ENDTRY;
+
+ if (result == 0)
+ {
+ // Get the MembershipStyle property.
+ PortableGroup::MembershipStyleValue membership_style;
+ result = this->get_membership_style (properties.in(), membership_style);
+ if (result != 0)
+ {
+ //@@ it seems a shame to fail here. We should at least remove the failed replica from the group.
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: "
+ "Could not extract MembershipStyle from properties on "
+ "ObjectGroup with id <%Q>.\n"),
+ fault_event_desc.object_group_id),
+ -1);
+ }
+ else
+ {
+ fault_event_desc.membership_style = membership_style;
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: "
+ "MembershipStyleValue = <%d>"),
+ fault_event_desc.membership_style
+ ));
+ }
+ }
+
+ // Get the ReplicationStyle property.
+ FT::ReplicationStyleValue replication_style;
+ result = this->get_replication_style (properties.in(), replication_style);
+ if (result != 0)
+ {
+ //@@ it seems a shame to fail here. We should at least remove the failed replica from the group.
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: "
+ "Could not extract ReplicationStyle from properties on "
+ "ObjectGroup with id <%Q>.\n"),
+ fault_event_desc.object_group_id),
+ -1);
+ }
+ else
+ {
+ fault_event_desc.replication_style = replication_style;
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: "
+ "ReplicationStyleValue = <%d>"),
+ fault_event_desc.replication_style
+ ));
+ }
+ }
+
+ // Get the MinimumNumberMembers property.
+ PortableGroup::MinimumNumberMembersValue minimum_number_members;
+ result = this->get_minimum_number_members (
+ properties.in(), minimum_number_members);
+ if (result != 0)
+ {
+ // This is not a fatal error. It may be App Controlled.
+ result = 0;
+ if (TAO_debug_level > 3)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: "
+ "Could not extract MinimumNumberMembers from properties on "
+ "ObjectGroup with id <%Q>.\n"),
+ fault_event_desc.object_group_id));
+ }
+ }
+ else
+ {
+ fault_event_desc.minimum_number_members = minimum_number_members;
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: "
+ "MinimumNumberMembers = <%d>"),
+ fault_event_desc.minimum_number_members
+ ));
+ }
+ }
+
+ // Get the InitialNumberMembers property.
+ PortableGroup::InitialNumberMembersValue initial_number_members;
+ result = this->get_initial_number_members (
+ properties.in(), initial_number_members);
+ if (result != 0)
+ {
+ // This is not a fatal error. It may be App Controlled.
+ result = 0;
+ if (TAO_debug_level > 3)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: "
+ "Could not extract InitialNumberMembers from properties on "
+ "ObjectGroup with id <%Q>.\n"),
+ fault_event_desc.object_group_id));
+ }
+ }
+ else
+ {
+ fault_event_desc.initial_number_members = initial_number_members;
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: "
+ "InitialNumberMembers = <%d>"),
+ fault_event_desc.initial_number_members
+ ));
+ }
+ }
+
+ // Get the Factories property.
+ result = this->get_factories (
+ properties.in(),
+ fault_event_desc.factories.out());
+ if (result != 0)
+ {
+ // This is not a fatal error. It may be App Controlled.
+ result = 0;
+ if (TAO_debug_level > 3)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: "
+ "Could not extract Factories from properties on "
+ "ObjectGroup with id <%Q>.\n"),
+ fault_event_desc.object_group_id));
+ }
+ }
+ else
+ {
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: "
+ "Got Factories from properties on "
+ "ObjectGroup with id <%Q>.\n"),
+ fault_event_desc.object_group_id
+ ));
+ }
+ }
+
+ }
+
+ // If the ReplicationStyle is COLD_PASSIVE, WARM_PASSIVE, or
+ // SEMI_ACTIVE, we can see if it was the primary replica that
+ // failed.
+ if ((result == 0) &&
+ (fault_event_desc.replication_style == FT::COLD_PASSIVE ||
+ fault_event_desc.replication_style == FT::WARM_PASSIVE ||
+ fault_event_desc.replication_style == FT::SEMI_ACTIVE))
+ {
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: "
+ "Checking to see if failed replica was the primary for "
+ "ObjectGroup with id <%Q>.\n"),
+ fault_event_desc.object_group_id
+ ));
+ }
+ result = this->is_primary_member (
+ the_object_group.in(),
+ fault_event_desc.location.in(),
+ fault_event_desc.object_is_primary);
+ }
+
+ // If the MembershipStyle is FT::MEMB_INF_CTRL (infrastructure
+ // controlled) and the primary has faulted, establish a new primary.
+ // We get back a new object group.
+ if ((result == 0) &&
+ (fault_event_desc.membership_style == FT::MEMB_INF_CTRL))
+ {
+
+ PortableGroup::ObjectGroup_var new_object_group;
+ result = this->remove_failed_member (
+ the_object_group.in(),
+ fault_event_desc,
+ new_object_group.out());
+ if (result == 0)
+ {
+ the_object_group = new_object_group;
+ }
+
+ if (fault_event_desc.object_is_primary == 1)
+ {
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: "
+ "Setting new primary for "
+ "ObjectGroup with id <%Q>.\n"),
+ fault_event_desc.object_group_id
+ ));
+ }
+ result = this->set_new_primary (
+ the_object_group.in(),
+ fault_event_desc,
+ new_object_group.out());
+ if (result == 0)
+ {
+ the_object_group = new_object_group;
+ }
+ }
+ }
+
+#if 0 // According to the FT CORBA specification, this will be handled by the ObjectGroupManager::remove_member method
+ // If the MembershipStyle is FT::MEMB_INF_CTRL (infrastructure
+ // controlled) and the number of remaining members is less than
+ // the MinimumNumberMembers property, add new members.
+ // We get back a new object group.
+ if ((result == 0) &&
+ (fault_event_desc.membership_style == FT::MEMB_INF_CTRL))
+ {
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: "
+ "Potentially adding new members to "
+ "ObjectGroup with id <%Q>.\n"),
+ fault_event_desc.object_group_id
+ ));
+ }
+ result = this->add_members (
+ the_object_group.in(),
+ fault_event_desc,
+ new_object_group.out());
+ the_object_group = new_object_group;
+ }
+#endif
+ return result;
+}
+
+int TAO::FT_ReplicationManagerFaultAnalyzer::remove_failed_member (
+ PortableGroup::ObjectGroup_ptr iogr,
+ TAO::FT_FaultEventDescriptor & fault_event_desc,
+ PortableGroup::ObjectGroup_out new_iogr)
+{
+ int result = 0;
+ new_iogr = PortableGroup::ObjectGroup::_nil ();
+
+ ACE_TRY_NEW_ENV
+ {
+ // Remove the old primary member from the object group.
+ PortableGroup::ObjectGroup_var temp_iogr =
+ this->replication_manager_->remove_member (
+ iogr,
+ fault_event_desc.location.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ new_iogr = temp_iogr._retn ();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ "TAO::FT_ReplicationManagerFaultAnalyzer::remove_failed_member: ");
+ result = -1;
+ }
+ ACE_ENDTRY;
+ return result;
+}
+
+
+// Choose a new primary member for the ObjectGroup.
+// Sets <new_iogr> and returns 0 on success.
+// Returns -1 on failure.
+int TAO::FT_ReplicationManagerFaultAnalyzer::set_new_primary (
+ PortableGroup::ObjectGroup_ptr iogr,
+ TAO::FT_FaultEventDescriptor & fault_event_desc,
+ PortableGroup::ObjectGroup_out new_iogr)
+{
+ int result = 0;
+ new_iogr = PortableGroup::ObjectGroup::_nil ();
+
+ ACE_TRY_NEW_ENV
+ {
+ // Get the locations of the remaining members of the object group.
+ PortableGroup::Locations_var locations =
+ this->replication_manager_->locations_of_members (
+ iogr
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Choose the first location as our new primary location.
+ if (locations->length() >= 1)
+ {
+ new_iogr = this->replication_manager_->set_primary_member (
+ iogr,
+ (*locations)[0]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (
+ "TAO::FT_ReplicationManagerFaultAnalyzer::set_new_primary: "
+ "No locations remaining in ObjectGroup with id <%Q>.\n"),
+ fault_event_desc.object_group_id),
+ -1);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ "TAO::FT_ReplicationManagerFaultAnalyzer::set_new_primary: ");
+ result = -1;
+ }
+ ACE_ENDTRY;
+
+ return result;
+}
+
+#if 0 // this is handled by the remove_member method
+// While the number of members in the object group is less than
+// the MinimumNumberMembers property, add new members.
+// Sets <new_iogr> and returns 0 on success.
+// Returns -1 on failure.
+int TAO::FT_ReplicationManagerFaultAnalyzer::add_members (
+ PortableGroup::ObjectGroup_ptr iogr,
+ TAO::FT_FaultEventDescriptor & fault_event_desc,
+ PortableGroup::ObjectGroup_out new_iogr)
+{
+ int result = 0;
+ new_iogr = PortableGroup::ObjectGroup::_nil ();
+
+ ACE_TRY_NEW_ENV
+ {
+ // Get current number of members in object group
+ // (same as number of locations).
+ PortableGroup::Locations_var locations =
+ this->replication_manager_->locations_of_members (
+ iogr
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::ULong num_members = locations->length();
+
+ // If it is less than the MinimumNumberMembers property, add
+ // new members.
+ if (num_members < fault_event_desc.minimum_number_members)
+ {
+ //@@ To create a member, we need to know the ObjectGroup,
+ // Location, TypeId, and Criteria.
+
+ // Get the factory registry from the Replication Manager.
+ PortableGroup::Criteria fake_criteria;
+ PortableGroup::FactoryRegistry_var factory_registry =
+ this->replication_manager_->get_factory_registry (
+ fake_criteria ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ // @@ DLW SAYS: we need to find out the role played by this object
+ // group so we can use the correct set of factories.
+ // Get the list of factories for the type of the failed replica.
+ CORBA::String_var type_id;
+ PortableGroup::FactoryInfos_var factories_by_type =
+ factory_registry->list_factories_by_role (
+ fault_event_desc.type_id.in(), type_id ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //
+ // Build a set of locations of factories for this type that we
+ // can use to create new members (i.e., at locations where
+ // members do not currently exist).
+ //
+ FT_Location_Set valid_locations;
+
+ // For each factory that can be used for this type...
+ for (CORBA::ULong f=0; f<factories_by_type->length(); ++f)
+ {
+ // ...insert its location into valid_locations set.
+ valid_locations.insert (factories_by_type[f].the_location);
+ }
+
+ // Now remove any locations where members already exist.
+ for (CORBA::ULong m=0; m<num_members; ++m)
+ {
+ if (valid_locations.find (locations[m]))
+ valid_locations.remove (locations[m]);
+ }
+
+ // The valid_locations set now contains all the factory
+ // locations we can use to add members to this object group.
+ // So, now we add new members until we reach
+ // the value of the MinimumNumberMembers property.
+ PortableGroup::Location_var good_location;
+ for (FT_Location_Set::iterator iter (valid_locations);
+ iter.next (good_location.out()) &&
+ fault_event_desc.minimum_number_members > num_members;
+ iter.advance(), ++num_members)
+ {
+ // Create a new member of the object group at this location.
+ new_iogr = this->replication_manager_->create_member (
+ iogr,
+ good_location.in(),
+ fault_event_desc.type_id.in(),
+ fake_criteria
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Stop adding members when we reach the value of the
+ // MinimumNumberMembers property.
+ // if (num_members++ >= fault_event_desc.minimum_number_members)
+ // break;
+ }
+
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ "TAO::FT_ReplicationManagerFaultAnalyzer::add_members: ");
+ result = -1;
+ }
+ ACE_ENDTRY;
+
+ return result;
+}
+#endif // 0
+
+// Handle a location failure.
+int TAO::FT_ReplicationManagerFaultAnalyzer::location_failure (
+ TAO::FT_FaultEventDescriptor & fault_event_desc)
+{
+ int result = 0;
+
+ // To handle a location failure, we should:
+ // - Unregister all the factories at that location.
+ // (We do this first so that we don't try to create a new replica
+ // at that location for any of the affected object groups.)
+ // - Determine all the object groups that had members at that
+ // location.
+ // - Handle each one of them as a single replica failure.
+
+ ACE_TRY_NEW_ENV
+ {
+ // Get the factory registry from the Replication Manager.
+ PortableGroup::Criteria fake_criteria;
+ PortableGroup::FactoryRegistry_var factory_registry =
+ this->replication_manager_->get_factory_registry (
+ fake_criteria ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Unregister all factories at the failed location.
+ factory_registry->unregister_factory_by_location (
+ fault_event_desc.location.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Determine all the object groups that had members at that
+ // location.
+ PortableGroup::ObjectGroups_var object_groups_at_location =
+ this->replication_manager_->groups_at_location (
+ fault_event_desc.location.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Handle each one of them as a single replica failure.
+ for (CORBA::ULong i=0;
+ result==0 && i<object_groups_at_location->length();
+ ++i)
+ {
+ // Get the object group id.
+ fault_event_desc.object_group_id =
+ this->replication_manager_->get_object_group_id (
+ object_groups_at_location[i] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get type id of this object group.
+ fault_event_desc.type_id =
+ this->replication_manager_->type_id (
+ object_groups_at_location[i] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Handle it as a single replica failure.
+ result = this->single_replica_failure (fault_event_desc);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ "TAO::FT_ReplicationManagerFaultAnalyzer::location_failure: ");
+ result = -1;
+ }
+ ACE_ENDTRY;
+
+ return result;
+}
+
+// Handle a type failure.
+int TAO::FT_ReplicationManagerFaultAnalyzer::type_failure (
+ TAO::FT_FaultEventDescriptor & fault_event_desc)
+{
+ int result = 0;
+
+ // To handle a type failure, we should:
+ // - Unregister the factory at the location of the failure
+ // that is associated with the failed type.
+ // (We do this first so that we don't try to create a new replica
+ // with that factory for any of the affected object groups.)
+ // - Determine all the object groups that had members at that
+ // location of that type.
+ // - Handle each one of them as a single replica failure.
+
+ ACE_TRY_NEW_ENV
+ {
+ // Get the factory registry from the Replication Manager.
+ PortableGroup::Criteria fake_criteria;
+ PortableGroup::FactoryRegistry_var factory_registry =
+ this->replication_manager_->get_factory_registry (
+ fake_criteria ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Unregister the factory at the failed location associated with
+ // the role.
+ //@@ Using type_id as the role for now.
+ factory_registry->unregister_factory (
+ fault_event_desc.type_id.in(),
+ fault_event_desc.location.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get all the object groups that had members at that
+ // location.
+ PortableGroup::ObjectGroups_var object_groups_at_location =
+ this->replication_manager_->groups_at_location (
+ fault_event_desc.location.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // For each one, if it was of the same type as the failed type,
+ // handle it as a single replica failure.
+ for (CORBA::ULong i=0;
+ result==0 && i<object_groups_at_location->length();
+ ++i)
+ {
+ // Get the object group id.
+ fault_event_desc.object_group_id =
+ this->replication_manager_->get_object_group_id (
+ object_groups_at_location[i] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get type id of this object group.
+ PortableGroup::TypeId_var type_id =
+ this->replication_manager_->type_id (
+ object_groups_at_location[i] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If the type id is the same as the failed type id...
+ if (ACE_OS::strcmp (type_id.in(), fault_event_desc.type_id.in()) == 0)
+ {
+ // Handle it as a single replica failure.
+ result = this->single_replica_failure (fault_event_desc);
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ "TAO::FT_ReplicationManagerFaultAnalyzer::type_failure: ");
+ result = -1;
+ }
+ ACE_ENDTRY;
+
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.h b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.h
new file mode 100755
index 00000000000..6b2e263ee85
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.h
@@ -0,0 +1,200 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_ReplicationManagerFaultAnalyzer.h
+ *
+ * $Id$
+ *
+ * This file is part of TAO's implementation of Fault Tolerant CORBA.
+ * This is the Replication Manager's implementation of a fault analyzer.
+ *
+ * @author Steve Totten <totten_s@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef FT_REPLICATION_MANAGER_FAULT_ANALYZER_H_
+#define FT_REPLICATION_MANAGER_FAULT_ANALYZER_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_DefaultFaultAnalyzer.h"
+#include "orbsvcs/FT_CORBAC.h"
+
+// Forward declarations.
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+template <class T> class ACE_Unbounded_Set;
+template <class T> class ACE_Unbounded_Set_Iterator;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+
+ ///////////////////////
+ // Forward declarations
+ class FT_ReplicationManager;
+ struct FT_FaultEventDescriptor;
+
+ typedef ACE_Unbounded_Set<PortableGroup::Location> FT_Location_Set;
+
+ /**
+ * Replication Manager's fault analyzer.
+ *
+ */
+ class FT_ReplicationManagerFaultAnalyzer
+ : public ::TAO::FT_DefaultFaultAnalyzer
+ {
+
+ public:
+ /**
+ * Constructor.
+ * @param replication_manager Pointer to TAO::FT_ReplicationManager.
+ */
+ FT_ReplicationManagerFaultAnalyzer (
+ const TAO::FT_ReplicationManager * replication_manager);
+
+ /**
+ * Destructor.
+ */
+ virtual ~FT_ReplicationManagerFaultAnalyzer ();
+
+ public:
+
+ /**
+ * Validate event type to make sure it is one we can handle.
+ * @param event The structured fault event, as from the Fault Notifier.
+ * @return 0 if it is a valid event type, -1 otherwise.
+ */
+ virtual int validate_event_type (
+ const CosNotification::StructuredEvent & event);
+
+ /**
+ * Analyze a fault event.
+ * @param event The structured fault event, as from the Fault Notifier.
+ * @return 0 on success, -1 on failure.
+ */
+ virtual int analyze_fault_event (
+ const CosNotification::StructuredEvent & event);
+
+ ////////////////////
+ // Forbidden methods
+ private:
+ /// Default constructor.
+ FT_ReplicationManagerFaultAnalyzer ();
+
+ /// Copy constructor.
+ FT_ReplicationManagerFaultAnalyzer (
+ const FT_ReplicationManagerFaultAnalyzer & rhs);
+
+ /// Assignment operator.
+ FT_ReplicationManagerFaultAnalyzer & operator = (
+ const FT_ReplicationManagerFaultAnalyzer & rhs);
+
+ /////////////////////////
+ // Implementation methods
+ protected:
+
+ /// Helper functions for fault analysis.
+
+ // Extract the type id from a CORBA any.
+ int get_type_id (const CORBA::Any& val, PortableGroup::TypeId_out type_id);
+
+ // Extract the ObjectGroupId from a CORBA any.
+ int get_object_group_id (const CORBA::Any& val, PortableGroup::ObjectGroupId& id);
+
+ // Extract the PortableGroup::Location from a CORBA any.
+ int get_location (const CORBA::Any& val, PortableGroup::Location_out location);
+
+ // Get the MembershipStyle property.
+ int get_membership_style (
+ const PortableGroup::Properties & properties,
+ PortableGroup::MembershipStyleValue & membership_style);
+
+ // Get the ReplicationStyle property.
+ int get_replication_style (
+ const PortableGroup::Properties & properties,
+ FT::ReplicationStyleValue & replication_style);
+
+ // Get the MinimumNumberMembers property.
+ int get_minimum_number_members (
+ const PortableGroup::Properties & properties,
+ PortableGroup::MinimumNumberMembersValue & minimum_number_members);
+
+ // Get the InitialNumberMembers property.
+ int get_initial_number_members (
+ const PortableGroup::Properties & properties,
+ PortableGroup::InitialNumberMembersValue & initial_number_members);
+
+ // Get the Factories property.
+ int get_factories (
+ const PortableGroup::Properties & properties,
+ PortableGroup::FactoryInfos_out factories);
+
+ // Handle a single replica failure.
+ int single_replica_failure (
+ TAO::FT_FaultEventDescriptor & fault_event_desc);
+
+ // Handle a location failure.
+ int location_failure (
+ TAO::FT_FaultEventDescriptor & fault_event_desc);
+
+ // Handle a type at location failure.
+ int type_failure (
+ TAO::FT_FaultEventDescriptor & fault_event_desc);
+
+ // Is the replica at location the primary member of its ObjectGroup?
+ // Sets <object_is_primary> and returns 0 on success.
+ // Returns -1 on failure.
+ int is_primary_member (
+ const PortableGroup::ObjectGroup_ptr iogr,
+ const PortableGroup::Location & location,
+ int & object_is_primary);
+
+ /// remove a failed member from a group
+ int remove_failed_member (
+ PortableGroup::ObjectGroup_ptr iogr,
+ TAO::FT_FaultEventDescriptor & fault_event_desc,
+ PortableGroup::ObjectGroup_out new_iogr);
+
+
+ // Choose a new primary member for the ObjectGroup.
+ // Sets <new_iogr> and returns 0 on success.
+ // Returns -1 on failure.
+ int set_new_primary (
+ PortableGroup::ObjectGroup_ptr iogr,
+ TAO::FT_FaultEventDescriptor & fault_event_desc,
+ PortableGroup::ObjectGroup_out new_iogr);
+
+#if 0 // this is handled by the remove_member method
+ // While the number of members in the object group is less than
+ // the MinimumNumberMembers property, add new members.
+ // Sets <new_iogr> and returns 0 on success.
+ // Returns -1 on failure.
+ int add_members (
+ PortableGroup::ObjectGroup_ptr iogr,
+ TAO::FT_FaultEventDescriptor & fault_event_desc,
+ PortableGroup::ObjectGroup_out new_iogr);
+#endif
+
+ ///////////////
+ // Data Members
+ private:
+ FT_ReplicationManager * replication_manager_;
+
+ };
+
+} // namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* FT_REPLICATION_MANAGER_FAULT_ANALYZER_H_ */
+
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerLib_export.h b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerLib_export.h
new file mode 100644
index 00000000000..b6a46c4cf8e
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerLib_export.h
@@ -0,0 +1,60 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TAO_ReplicationManagerLib
+// ------------------------------
+#ifndef TAO_REPLICATIONMANAGERLIB_EXPORT_H
+#define TAO_REPLICATIONMANAGERLIB_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_REPLICATIONMANAGERLIB_HAS_DLL)
+# define TAO_REPLICATIONMANAGERLIB_HAS_DLL 0
+# endif /* ! TAO_REPLICATIONMANAGERLIB_HAS_DLL */
+#else
+# if !defined (TAO_REPLICATIONMANAGERLIB_HAS_DLL)
+# define TAO_REPLICATIONMANAGERLIB_HAS_DLL 1
+# endif /* ! TAO_REPLICATIONMANAGERLIB_HAS_DLL */
+#endif
+
+#if defined (TAO_REPLICATIONMANAGERLIB_HAS_DLL) && (TAO_REPLICATIONMANAGERLIB_HAS_DLL == 1)
+# if defined (TAO_REPLICATIONMANAGERLIB_BUILD_DLL)
+# define TAO_ReplicationManagerLib_Export ACE_Proper_Export_Flag
+# define TAO_REPLICATIONMANAGERLIB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_REPLICATIONMANAGERLIB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_REPLICATIONMANAGERLIB_BUILD_DLL */
+# define TAO_ReplicationManagerLib_Export ACE_Proper_Import_Flag
+# define TAO_REPLICATIONMANAGERLIB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_REPLICATIONMANAGERLIB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_REPLICATIONMANAGERLIB_BUILD_DLL */
+#else /* TAO_REPLICATIONMANAGERLIB_HAS_DLL == 1 */
+# define TAO_ReplicationManagerLib_Export
+# define TAO_REPLICATIONMANAGERLIB_SINGLETON_DECLARATION(T)
+# define TAO_REPLICATIONMANAGERLIB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_REPLICATIONMANAGERLIB_HAS_DLL == 1 */
+
+// Set TAO_REPLICATIONMANAGERLIB_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TAO_REPLICATIONMANAGERLIB_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TAO_REPLICATIONMANAGERLIB_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TAO_REPLICATIONMANAGERLIB_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TAO_REPLICATIONMANAGERLIB_NTRACE */
+
+#if (TAO_REPLICATIONMANAGERLIB_NTRACE == 1)
+# define TAO_REPLICATIONMANAGERLIB_TRACE(X)
+#else /* (TAO_REPLICATIONMANAGERLIB_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define TAO_REPLICATIONMANAGERLIB_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (TAO_REPLICATIONMANAGERLIB_NTRACE == 1) */
+
+#endif /* TAO_REPLICATIONMANAGERLIB_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager_Main.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager_Main.cpp
new file mode 100644
index 00000000000..4b1e493ba02
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager_Main.cpp
@@ -0,0 +1,24 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_ReplicationManager_Main.cpp
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * This file provides the main routine for a process that
+ * implements the FT_ReplicationManager interface.
+ *
+ * @author Curt Hibbs <hibbs_c@ociweb.com>
+ */
+//=============================================================================
+
+#include "FT_ReplicationManager.h"
+#include "tao/Utils/Server_Main.h"
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ TAO::Utils::Server_Main<TAO::FT_ReplicationManager>
+ server_main("ReplicationManager");
+ return server_main.run(argc, argv);
+}
diff --git a/TAO/orbsvcs/FT_ReplicationManager/Makefile.am b/TAO/orbsvcs/FT_ReplicationManager/Makefile.am
new file mode 100644
index 00000000000..1f7d9f4e065
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/Makefile.am
@@ -0,0 +1,119 @@
+## 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.FT_ReplicationManager_Lib.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_LTLIBRARIES = libTAO_ReplicationManagerLib.la
+
+libTAO_ReplicationManagerLib_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_REPLICATIONMANAGERLIB_BUILD_DLL
+
+libTAO_ReplicationManagerLib_la_SOURCES = \
+ FT_DefaultFaultAnalyzer.cpp \
+ FT_FaultAnalyzer.cpp \
+ FT_FaultConsumer.cpp \
+ FT_FaultEventDescriptor.cpp
+
+noinst_HEADERS = \
+ FT_DefaultFaultAnalyzer.h \
+ FT_FaultAnalyzer.h \
+ FT_FaultConsumer.h \
+ FT_FaultEventDescriptor.h
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.FT_ReplicationManager.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+bin_PROGRAMS = FT_ReplicationManager
+
+FT_ReplicationManager_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_ReplicationManager_SOURCES = \
+ FT_Property_Validator.cpp \
+ FT_ReplicationManager.cpp \
+ FT_ReplicationManagerFaultAnalyzer.cpp \
+ FT_ReplicationManager_Main.cpp \
+ FT_Property_Validator.h \
+ FT_ReplicationManager.h \
+ FT_ReplicationManagerFaultAnalyzer.h
+
+FT_ReplicationManager_LDADD = \
+ libTAO_ReplicationManagerLib.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.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
+
+## 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/FT_ReplicationManager/README b/TAO/orbsvcs/FT_ReplicationManager/README
new file mode 100644
index 00000000000..6308eaea08d
--- /dev/null
+++ b/TAO/orbsvcs/FT_ReplicationManager/README
@@ -0,0 +1,12 @@
+
+Run FT_ReplicationManager as follows:
+
+ FT_ReplicationManager -o <file1.ior>
+ Starts the replication manager and writes in ior
+ to the specified file.
+
+ FT_ReplicationManager
+ Starts the replication manager and registers it
+ with the naming service.
+
+s \ No newline at end of file
diff --git a/TAO/orbsvcs/Fault_Detector/.cvsignore b/TAO/orbsvcs/Fault_Detector/.cvsignore
new file mode 100644
index 00000000000..3d60edd3d48
--- /dev/null
+++ b/TAO/orbsvcs/Fault_Detector/.cvsignore
@@ -0,0 +1 @@
+Fault_Detector
diff --git a/TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.cpp b/TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.cpp
new file mode 100644
index 00000000000..0efefef03cd
--- /dev/null
+++ b/TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.cpp
@@ -0,0 +1,714 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_FaultDetectorFactory_i.cpp
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+#include "FT_FaultDetectorFactory_i.h"
+#include "Fault_Detector_i.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/Auto_Ptr.h"
+#include "orbsvcs/CosNamingC.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 */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//////////////////////////////////////////////////////
+// FT_FaultDetectorFactory_i Construction/destruction
+
+TAO::FT_FaultDetectorFactory_i::FT_FaultDetectorFactory_i ()
+ : orb_ (0)
+ , poa_ (0)
+ , objectId_ (0)
+ , ior_output_file_ (0)
+ , ns_name_ (0)
+ , naming_context_ (0)
+ , this_name_ (1)
+ , quit_on_idle_ (0)
+ , domain_ (CORBA::string_dup("default_domain"))
+ , location_ (1)
+ , notifier_ (0)
+ , rm_register_ (1)
+ , replication_manager_ (0)
+ , registered_ (0)
+ , factory_registry_ (0)
+ , identity_ ("")
+ , empty_slots_ (0)
+ , quit_requested_ (0)
+
+{
+ this->location_.length(1);
+ this->location_[0].id = CORBA::string_dup("default_location");
+}
+
+TAO::FT_FaultDetectorFactory_i::~FT_FaultDetectorFactory_i ()
+{
+ //scope the guard
+ {
+ InternalGuard guard (this->internals_);
+
+ // be sure all detectors are gone
+ // before this object disappears
+ shutdown_i ();
+ }
+ ACE_DECLARE_NEW_ENV;
+ fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+ this->threadManager_.close ();
+}
+
+////////////////////////////////////////////
+// FT_FaultDetectorFactory_i private methods
+
+void TAO::FT_FaultDetectorFactory_i::shutdown_i()
+{
+ // assume mutex is locked
+ for (size_t nDetector = 0; nDetector < this->detectors_.size(); ++nDetector)
+ {
+ Fault_Detector_i * detector = this->detectors_[nDetector];
+ if (detector != 0)
+ {
+ detector->request_quit();
+ }
+ }
+}
+
+int TAO::FT_FaultDetectorFactory_i::write_ior()
+{
+ 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;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Open failed for %s\n", ior_output_file_
+ ));
+ }
+ return result;
+}
+
+//////////////////////////////////////////////////////
+// FT_FaultDetectorFactory_i public, non-CORBA methods
+
+int TAO::FT_FaultDetectorFactory_i::parse_args (int argc, char * argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "d:l:o:qr");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'd':
+ {
+ this->domain_ = CORBA::string_dup (get_opts.opt_arg ());
+ break;
+ }
+ case 'l':
+ {
+ this->location_.length(1);
+ this->location_[0].id = CORBA::string_dup(get_opts.opt_arg ());
+ break;
+ }
+ case 'o':
+ {
+ this->ior_output_file_ = get_opts.opt_arg ();
+ break;
+ }
+ case 'r':
+ {
+ this->rm_register_ = ! this->rm_register_;
+ break;
+ }
+ case 'q':
+ {
+ this->quit_on_idle_ = 1;
+ break;
+ }
+
+ case '?':
+ // fall thru
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " -d <FT Domain>"
+ " -l <FT Location>"
+ " -o <iorfile>"
+ " -r <disable registering with replication manager>"
+ " -q{uit on idle}"
+ "\n",
+ argv [0]),
+ -1);
+ break;
+ }
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+const char * TAO::FT_FaultDetectorFactory_i::identity () const
+{
+ return this->identity_.c_str();
+}
+
+int TAO::FT_FaultDetectorFactory_i::idle (int & result ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_UNUSED_ARG (result);
+ int quit = this->quit_requested_;
+ if (quit == 0 && this->detectors_.size() == this->empty_slots_)
+ {
+ // don't quitOnIdle until something has happened
+ if (this->quit_on_idle_ && this->empty_slots_ != 0)
+ {
+ ACE_ERROR (( LM_INFO,
+ "FaultDetectorFactory exits due to quit on idle option.\n"
+ ));
+ quit = 1;
+ }
+ }
+
+ return quit;
+}
+
+
+int TAO::FT_FaultDetectorFactory_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->objectId_ = this->poa_->activate_object (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // find my IOR
+
+ CORBA::Object_var this_obj =
+ this->poa_->id_to_reference (objectId_.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);
+
+ this->identity_ = "FaultDetectorFactory";
+
+ ///////////////////////////////
+ // Register with ReplicationManager
+ if (this->rm_register_)
+ {
+ 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 ()))
+ {
+ // capture the default notifier
+ this->notifier_ = this->replication_manager_->get_fault_notifier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // register with ReplicationManager::RegistrationFactory
+ PortableGroup::Criteria criteria(0);
+ this->factory_registry_ = this->replication_manager_->get_factory_registry (criteria ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (! CORBA::is_nil(factory_registry_.in ()))
+ {
+ PortableGroup::FactoryInfo info;
+ info.the_factory = ::PortableGroup::GenericFactory::_narrow(this_obj.in ());
+ info.the_location = 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(FT::FAULT_DETECTOR_ROLE_NAME);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "FaultDetector registering with ReplicationManager.\n"
+ ));
+ this->factory_registry_->register_factory(
+ FT::FAULT_DETECTOR_ROLE_NAME,
+ FT::FAULT_DETECTOR_ROLE_NAME,
+ info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "FaultDetector Registration complete.\n"
+ ));
+ this->registered_ = 1;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,"FaultNotifier: ReplicationManager doesn't have RegistrationFactory.\n" ));
+ }
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,"FaultNotifier: Can't resolve ReplicationManager, It will not be registered.\n" ));
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ReplicaFactory: Exception resolving ReplicationManager. Factory will not be registered.\n" );
+ }
+ ACE_ENDTRY;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "FaultNotifier: ReplicationManager registration disabled.\n"
+ ));
+ }
+
+ if (this->ior_output_file_ != 0)
+ {
+ this->identity_ = "file:";
+ this->identity_ += this->ior_output_file_;
+ write_ior();
+ }
+
+ 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);
+ }
+
+ 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);
+ }
+
+ return result;
+}
+
+int TAO::FT_FaultDetectorFactory_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);
+ this->ns_name_ = 0;
+ }
+
+ if (this->registered_)
+ {
+ this->factory_registry_->unregister_factory(
+ FT::FAULT_DETECTOR_ROLE_NAME,
+ this->location_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ this->registered_ = 0;
+ }
+ return 0;
+}
+
+
+CORBA::ULong TAO::FT_FaultDetectorFactory_i::allocate_id()
+{
+ CORBA::ULong id = this->detectors_.size();
+ if (this->empty_slots_ != 0)
+ {
+ for(CORBA::ULong pos = 0; pos < id; ++pos)
+ {
+ if (this->detectors_[pos] == 0)
+ {
+ id = pos;
+ }
+ }
+ }
+ else
+ {
+ this->detectors_.push_back(0);
+ this->empty_slots_ += 1;
+ }
+ return id;
+}
+
+void TAO::FT_FaultDetectorFactory_i::remove_detector(CORBA::ULong id, TAO::Fault_Detector_i * detector)
+{
+ InternalGuard guard (this->internals_);
+ if (id < this->detectors_.size())
+ {
+ if(this->detectors_[id] == detector)
+ {
+ delete this->detectors_[id];
+ this->detectors_[id] = 0;
+ this->empty_slots_ += 1;
+ if (this->empty_slots_ == this->detectors_.size())
+ {
+ ACE_ERROR (( LM_INFO,
+ "FaultDetectorFactory is idle.\n"
+ ));
+ }
+ }
+ else
+ {
+ ACE_ERROR (( LM_ERROR,
+ "Remove detector %d mismatch.\n",
+ static_cast<int> (id)
+ ));
+ }
+ }
+ else
+ {
+ ACE_ERROR (( LM_ERROR,
+ "Attempt to remove invalid detector %d. Limit %d.\n",
+ static_cast<int> (id),
+ static_cast<int> (this->detectors_.size())
+ ));
+ }
+}
+
+//////////////////////////////////////////
+// FT_FaultDetectorFactory_i CORBA methods
+
+void TAO::FT_FaultDetectorFactory_i::change_properties (
+ const PortableGroup::Properties & property_set
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::InvalidProperty
+ ))
+{
+ METHOD_ENTRY(TAO::FT_FaultDetectorFactory_i::change_properties);
+
+ // TimeT is expressed in 10E-7 seconds (== 100 nSec == 0.1 uSec)
+ static const long timeT_per_uSec = 10L;
+ static const long uSec_per_sec = 1000000L;
+
+ ::TAO::PG_Property_Set decoder(property_set);
+
+ TimeBase::TimeT value = 0;
+ if( TAO::find (decoder, FT::FT_FAULT_MONITORING_INTERVAL, value) )
+ {
+ // note: these should be unsigned long, but
+ // ACE_Time_Value wants longs.
+ long uSec = static_cast<long> ((value / timeT_per_uSec) % uSec_per_sec);
+ long sec = static_cast<long> ((value / timeT_per_uSec) / uSec_per_sec);
+ ACE_Time_Value atv(sec, uSec);
+ TAO::Fault_Detector_i::set_time_for_all_detectors(atv);
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Throwing Invalid Property: %s\n",
+ FT::FT_FAULT_MONITORING_INTERVAL
+ ));
+ ::PortableGroup::InvalidProperty ex;
+ ex.nam.length(1);
+ ex.nam[0].id = CORBA::string_dup(FT::FT_FAULT_MONITORING_INTERVAL);
+ ACE_THROW (::PortableGroup::InvalidProperty (ex));
+ }
+ METHOD_RETURN(TAO::FT_FaultDetectorFactory_i::change_properties);
+}
+
+void TAO::FT_FaultDetectorFactory_i::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ METHOD_ENTRY(TAO::FT_FaultDetectorFactory_i::shutdown);
+ InternalGuard guard (this->internals_);
+ shutdown_i ();
+ this->quit_requested_ = 1;
+ METHOD_RETURN(TAO::FT_FaultDetectorFactory_i::shutdown);
+}
+
+CORBA::Object_ptr TAO::FT_FaultDetectorFactory_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(TAO::FT_FaultDetectorFactory_i::create_object);
+
+ ACE_UNUSED_ARG (type_id); //@@ use it
+ 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;
+
+ FT::FaultNotifier_ptr notifier;
+ if (! ::TAO::find (decoder, ::FT::FT_NOTIFIER, notifier) )
+ {
+ if (! CORBA::is_nil (this->notifier_.in ()))
+ {
+ notifier = FT::FaultNotifier::_duplicate (this->notifier_.in ());
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "FaultDetectorFactory::create_object: Missing parameter %s\n",
+ ::FT::FT_NOTIFIER
+ ));
+ missingParameter = 1;
+ missingParameterName = ::FT::FT_NOTIFIER;
+ }
+ }
+
+ FT::PullMonitorable_ptr monitorable;
+ if (! ::TAO::find (decoder, ::FT::FT_MONITORABLE, monitorable) )
+ {
+ ACE_ERROR ((LM_ERROR,
+ "FaultDetectorFactory::create_object: Missing parameter %s\n",
+ ::FT::FT_MONITORABLE
+ ));
+ missingParameter = 1;
+ missingParameterName = ::FT::FT_MONITORABLE;
+ }
+
+ FT::FTDomainId domain_id = 0;
+ // note the cast in the next line makes ANY >>= work.
+ const char * domain_id_string = 0;
+ if (::TAO::find (decoder, ::FT::FT_DOMAIN_ID, domain_id_string) )
+ {
+ // NOTE the assumption that we can assign a char * to a domain id
+ domain_id = const_cast<char *> (domain_id_string);
+ }
+ else
+ {
+ domain_id = this->domain_;
+
+// ACE_ERROR ((LM_ERROR,
+// "FaultDetectorFactory::create_object: Missing parameter %s\n",
+// ::FT::FT_DOMAIN_ID
+// ));
+// missingParameter = 1;
+// missingParameterName = ::FT::FT_DOMAIN_ID;
+ }
+
+ PortableGroup::Location * object_location = 0;
+ if (! ::TAO::find (decoder, ::FT::FT_LOCATION, object_location) )
+ {
+ object_location = & this->location_;
+
+// ACE_ERROR ((LM_ERROR,
+// "FaultDetectorFactory::create_object: Missing parameter %s\n",
+// ::FT::FT_LOCATION
+// ));
+// missingParameter = 1;
+// missingParameterName = ::FT::FT_LOCATION;
+ }
+
+ PortableGroup::TypeId object_type = 0;
+ const char * object_type_string;
+ if (::TAO::find (decoder, ::FT::FT_TYPE_ID, object_type_string))
+ {
+ object_type = const_cast<char *> (object_type_string);
+ }
+ else
+ {
+ object_type = const_cast<char *> ("unknown");
+ // Not required: missingParameter = 1;
+ ACE_DEBUG ((LM_DEBUG, "Object type not given.\n"));
+ }
+
+ FT::ObjectGroupId group_id = 0;
+ if (! ::TAO::find (decoder, ::FT::FT_GROUP_ID, group_id) )
+ {
+ // Not required: missingParameter = 1;
+ }
+
+ if (missingParameter)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Throwing 'InvalidCriteria' due to missing %s\n",
+ missingParameterName
+ ));
+ ACE_THROW_RETURN ( PortableGroup::InvalidCriteria(), CORBA::Object::_nil () );
+ }
+
+ CORBA::ULong detectorId = allocate_id();
+
+ // NOTE: ACE_NEW is incompatable with auto_ptr
+ // so create a bare pointer first.
+ TAO::Fault_Detector_i * pFD = 0;
+
+ ACE_NEW_NORETURN(pFD, TAO::Fault_Detector_i(
+ *this,
+ detectorId,
+ notifier,
+ monitorable,
+ domain_id,
+ *object_location,
+ object_type,
+ group_id));
+ if (pFD == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "New FaultDetector_i returned NULL. Throwing ObjectNotCreated.\n"
+ ));
+ ACE_THROW_RETURN ( PortableGroup::ObjectNotCreated(), CORBA::Object::_nil () );
+ }
+ auto_ptr<TAO::Fault_Detector_i> detector(pFD);
+
+ ACE_NEW_NORETURN ( factory_creation_id,
+ PortableGroup::GenericFactory::FactoryCreationId);
+ if (factory_creation_id.ptr() == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "New factory_creation_id returned NULL. Throwing ObjectNotCreated.\n"
+ ));
+
+ ACE_THROW_RETURN ( PortableGroup::ObjectNotCreated(), CORBA::Object::_nil ());
+ }
+ (*factory_creation_id) <<= detectorId;
+
+ (*detector).start(this->threadManager_);
+
+ this->detectors_[detectorId] = detector.release();
+ this->empty_slots_ -= 1;
+
+ // since FaultDetector is not a CORBA object (it does not implement
+ // an interface.) we always return NIL;
+ METHOD_RETURN(TAO::FT_FaultDetectorFactory_i::create_object)
+ CORBA::Object::_nil();
+}
+
+void TAO::FT_FaultDetectorFactory_i::delete_object (
+ const PortableGroup::GenericFactory::FactoryCreationId & factory_creation_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::ObjectNotFound
+ ))
+{
+ METHOD_ENTRY(TAO::FT_FaultDetectorFactory_i::delete_object);
+
+ InternalGuard guard (this->internals_);
+
+ CORBA::ULong detectorId;
+ factory_creation_id >>= detectorId;
+ if (detectorId < this->detectors_.size())
+ {
+ if(this->detectors_[detectorId] != 0)
+ {
+ this->detectors_[detectorId]->request_quit();
+ }
+ else
+ {
+ ACE_THROW(::PortableGroup::ObjectNotFound());
+ }
+ }
+ else
+ {
+ ACE_THROW(::PortableGroup::ObjectNotFound());
+ }
+ METHOD_RETURN(TAO::FT_FaultDetectorFactory_i::delete_object);
+}
+
+CORBA::Boolean TAO::FT_FaultDetectorFactory_i::is_alive (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ METHOD_RETURN(TAO::FT_FaultDetectorFactory_i::is_alive)
+ 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.h b/TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.h
new file mode 100644
index 00000000000..a28eebffe56
--- /dev/null
+++ b/TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.h
@@ -0,0 +1,346 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_FaultDetectorFactory_i.h
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * It declares the implementation of FaultDetectorFactory which
+ * creates and manages FaultDetectors as an agent for
+ * the ReplicationManager as defined in the FT CORBA specification.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef FT_FAULTDETECTORFACTORY_I_H_
+#define FT_FAULTDETECTORFACTORY_I_H_
+#include /**/ "ace/pre.h"
+#include "ace/ACE.h"
+#include "ace/SString.h"
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/////////////////////////////////
+// Includes needed by this header
+#include <ace/Vector_T.h>
+#include <orbsvcs/FT_FaultDetectorFactoryS.h>
+#include <orbsvcs/FT_ReplicationManagerC.h>
+#include <ace/Thread_Manager.h>
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/////////////////////
+// Forward references
+
+/**
+ * Implement the FaultDetectorFactory interface.
+ *
+ * Because each FaultDetector runs in a separate thread, care
+ * must be taken to insure that the thread comes to an end, and
+ * that the Fault_Detector_i object is deleted at the right time.
+ * Hence, the FaultDetector life cycle:
+ * Creation:
+ * The create_object method of the factory creates a Fault_Detector_i
+ *
+ * A pointer to the Fault_Detector_i is stored in the detectors_ table.
+ *
+ * The start method of the Fault_Detector_i is called to create a thread
+ * that will monotor the object-to-be-monitored. An ACE_Thread_Manager
+ * supplied by the factory is used to keep track of the thread.
+ *
+ * Destruction:
+ *
+ * If the factory wants the detector to go away, it calls the
+ * quitRequested method of the detector which sets a flag that must
+ * be checked regularly by the detector.
+ *
+ * If the object being monitored faults, the detector sends the
+ * notification message then sets its own quit requested flag.
+ *
+ * When a detector discovers the quit requested flag has been set
+ * it calls the remove_detector method of the factory, then ends
+ * the thread.
+ *
+ * The remove_detector method of the factory removes the detector from
+ * the detectors_ collection, then deletes the Fault_Detector_i object.
+ *
+ * Shutdown:
+ *
+ * The destructor of the factory calls the shutdown method of all
+ * remaining Fault_Detector_i objects.
+ *
+ * It then closes the ACE_Thread_Manager to ensure that all
+ * detector threads have departed before the factory itself is
+ * deleted.
+ *
+ */
+
+namespace TAO
+{
+ /////////////////////
+ // Forward references
+ class Fault_Detector_i;
+
+ /////////////////////
+ // Class Declarations
+ class FT_FaultDetectorFactory_i : public virtual POA_FT::FaultDetectorFactory
+ {
+ typedef ACE_Vector<Fault_Detector_i *> DetectorVec;
+
+ //////////////////////
+ // non-CORBA interface
+ public:
+ /**
+ * Default constructor.
+ */
+ FT_FaultDetectorFactory_i ();
+
+ /**
+ * Virtual destructor.
+ */
+ virtual ~FT_FaultDetectorFactory_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);
+
+ /**
+ * Idle-time activity.
+ *
+ * @param result is set to process return code if return value is non-zero.
+ * @return zero to continue; nonzero to exit
+ */
+ int idle(int & result ACE_ENV_ARG_DECL);
+
+
+ /**
+ * Identify this fault detector factory.
+ * @return a string to identify this object for logging/console message purposes.
+ */
+ const char * identity () const;
+
+ /**
+ * Remove pointer to individual detector; delete Fault_Detector_i.
+ * See FaultDetector life cycle description.
+ * @param id the numerical id assigned to this FaultDetector.
+ * @param detector a pointer to the detector object (redundant for safety.)
+ */
+ void remove_detector (CORBA::ULong id, Fault_Detector_i * detector);
+
+ //////////////////
+ // CORBA interface
+ // See IDL for documentation
+
+ ///////////////////////////////////////////////
+ // CORBA interface FaultDetectorFactory methods
+ virtual void change_properties (
+ const PortableGroup::Properties & property_set
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::InvalidProperty
+ ));
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ 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
+ )
+ 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
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::ObjectNotFound
+ ));
+
+ //////////////////////////////////////////
+ // CORBA interface PullMonitorable methods
+
+ virtual CORBA::Boolean is_alive (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /////////////////////////
+ // Implementation methods
+ private:
+ /**
+ * Find or allocate an ID for a new detector
+ */
+ CORBA::ULong allocate_id();
+
+ /**
+ * Write this factory's IOR to a file
+ */
+ int write_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 objectId_;
+
+
+ /**
+ * IOR of this object as assigned by orb.
+ */
+ CORBA::String_var ior_;
+
+ /**
+ * A file to which the factory's IOR should be written.
+ */
+ const char * ior_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_;
+
+ /**
+ * Quit on idle flag.
+ */
+ int quit_on_idle_;
+
+ /**
+ * the FT::Domain where we're operating
+ */
+ PortableGroup::GroupDomainId domain_;
+
+ /**
+ * the FT::Location within the domain
+ */
+ PortableGroup::Location location_;
+
+ /**
+ * the notifer to use by default
+ */
+
+ FT::FaultNotifier_var notifier_;
+
+ /**
+ * bool: if true, register with ReplicationManager.
+ * default is true. -x turns it off.
+ */
+ int rm_register_;
+
+ /**
+ * the replication manager
+ */
+ ::FT::ReplicationManager_var replication_manager_;
+
+ /**
+ * bool: if true the registration with ReplicationManager was successful.
+ */
+ int registered_;
+
+ /**
+ * The factory registry with which to register.
+ */
+ PortableGroup::FactoryRegistry_var factory_registry_;
+
+ /**
+ * A human-readable string to distinguish this from other Notifiers.
+ */
+ ACE_CString identity_;
+
+ /**
+ * A manager for all FaultDetector threads.
+ */
+ ACE_Thread_Manager threadManager_;
+
+ /**
+ * A vector of FaultDetectors. Note that the FaultDetector ID
+ * is an index into this vector.
+ */
+ DetectorVec detectors_;
+
+ /**
+ * count of empty entries in detectors_
+ * Used to determine when the factory is idle, and to avoid
+ * fruitless searches for empty slots.
+ */
+ size_t empty_slots_;
+
+ /**
+ * boolean: starts false. Set to true when it's time to quit.
+ */
+ int quit_requested_;
+ };
+} // namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* FT_FAULTDETECTORFACTORY_I_H_ */
diff --git a/TAO/orbsvcs/Fault_Detector/Fault_Detector.mpc b/TAO/orbsvcs/Fault_Detector/Fault_Detector.mpc
new file mode 100644
index 00000000000..b88d38ae6f2
--- /dev/null
+++ b/TAO/orbsvcs/Fault_Detector/Fault_Detector.mpc
@@ -0,0 +1,10 @@
+// $Id$
+project : taoserver, orbsvcsexe, core, fault_tolerance {
+ exename = Fault_Detector
+ Source_Files {
+ Fault_Detector_i.cpp
+ Fault_Detector_Main.cpp
+ FT_FaultDetectorFactory_i.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/Fault_Detector/Fault_Detector_Main.cpp b/TAO/orbsvcs/Fault_Detector/Fault_Detector_Main.cpp
new file mode 100644
index 00000000000..c101b763c69
--- /dev/null
+++ b/TAO/orbsvcs/Fault_Detector/Fault_Detector_Main.cpp
@@ -0,0 +1,25 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Fault_Detector_Main.cpp
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * This file provides the main routine for a process that
+ * implements the FaultDetectorFactory interface and manages
+ * a set of FaultDetectors.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#include "tao/Utils/Server_Main.h"
+#include "FT_FaultDetectorFactory_i.h"
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ TAO::Utils::Server_Main<TAO::FT_FaultDetectorFactory_i> server_main("TAO_FaultDetector");
+ return server_main.run(argc, argv);
+}
+
diff --git a/TAO/orbsvcs/Fault_Detector/Fault_Detector_i.cpp b/TAO/orbsvcs/Fault_Detector/Fault_Detector_i.cpp
new file mode 100644
index 00000000000..60d749ef0dd
--- /dev/null
+++ b/TAO/orbsvcs/Fault_Detector/Fault_Detector_i.cpp
@@ -0,0 +1,206 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Fault_Detector_i.cpp
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * This file implements the Fault_Detector_i class as declared in Fault_Detector_i.h.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+#include "Fault_Detector_i.h"
+#include "FT_FaultDetectorFactory_i.h"
+#include "tao/debug.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+///////////////////////////////
+// Fault_Detector_i static data
+
+ACE_Time_Value TAO::Fault_Detector_i::sleep_time_(1,0);
+
+
+/////////////////////////////////////////
+// Fault_Detector_i public static methods
+
+void TAO::Fault_Detector_i::set_time_for_all_detectors(ACE_Time_Value value)
+{
+ sleep_time_ = value;
+}
+
+////////////////////////////////////////////
+// Fault_Detector_i construction/destruction
+
+TAO::Fault_Detector_i::Fault_Detector_i (
+ FT_FaultDetectorFactory_i & factory,
+ CORBA::ULong id,
+ FT::FaultNotifier_ptr & notifier,
+ FT::PullMonitorable_ptr & monitorable,
+ FT::FTDomainId domain_id,
+ const PortableGroup::Location & object_location,
+ PortableGroup::TypeId object_type,
+ PortableGroup::ObjectGroupId group_id
+ )
+ : factory_(factory)
+ , id_(id)
+ , domain_id_(domain_id)
+ , object_location_(object_location)
+ , object_type_(object_type)
+ , group_id_(group_id)
+ , sleep_(0) // initially not signaled
+ , quit_requested_(0)
+{
+ this->notifier_ = FT::FaultNotifier::_duplicate(notifier);
+ this->monitorable_ = FT::PullMonitorable::_duplicate(monitorable);
+ ACE_DEBUG ((LM_DEBUG,
+ "Object type %s\n", object_type
+ ));
+}
+
+TAO::Fault_Detector_i::~Fault_Detector_i ()
+{
+}
+
+////////////////////////////////////
+// Fault_Detector_i public interface
+
+
+void TAO::Fault_Detector_i::request_quit()
+{
+ this->quit_requested_ = 1;
+ // wake up the thread
+ this->sleep_.signal ();
+}
+
+void TAO::Fault_Detector_i::start(ACE_Thread_Manager & threadManager)
+{
+ threadManager.spawn(thr_func, this);
+}
+
+///////////////////////////////////////////////////
+// Fault_Detector_i private implementation methods
+
+void TAO::Fault_Detector_i::run()
+{
+ while ( ! this->quit_requested_ )
+ {
+ ACE_TRY_NEW_ENV
+ {
+ if (this->monitorable_->is_alive(ACE_ENV_SINGLE_ARG_PARAMETER))
+ {
+ ACE_TRY_CHECK;
+ // use this rather than ACE_OS::sleep
+ // to allow the nap to be interruped see request_quit
+ this->sleep_.wait (&sleep_time_, 0);
+ }
+ else
+ {
+ ACE_ERROR ((LM_INFO,
+ "FaultDetector%d FAULT: not alive.\n",
+ id_
+ ));
+ notify();
+ this->quit_requested_ = 1;
+ }
+ }
+ ACE_CATCHANY // todo refine this
+ {
+ ACE_ERROR ((LM_ERROR,
+ "FaultDetector FAULT: exception.\n"
+ ));
+ notify();
+ this->quit_requested_ = 1;
+ }
+ ACE_ENDTRY;
+ }
+ // warning: The following call will delete
+ // this object. Be careful not to reference
+ // member data after making this call.
+ // todo: use "scoped resource management" to make
+ // this exception-safe and stupid-return-safe.
+ this->factory_.remove_detector (this->id_, this);
+}
+
+void TAO::Fault_Detector_i::notify()
+{
+ CosNotification::StructuredEvent_var vEvent;
+ ACE_NEW_NORETURN(vEvent, CosNotification::StructuredEvent );
+ if (vEvent.ptr() != 0)
+ {
+ CORBA::ULong length = 2;
+ if( this->object_type_ != 0)
+ {
+ length = 3;
+ if (this->group_id_!= 0)
+ {
+ length = 4;
+ }
+ }
+
+ vEvent->header.fixed_header.event_type.domain_name = FT::FT_EVENT_TYPE_DOMAIN;
+ vEvent->header.fixed_header.event_type.type_name = FT::FT_EVENT_TYPE_NAME;
+ vEvent->filterable_data.length(length);
+ vEvent->filterable_data[0].name = FT::FT_DOMAIN_ID;
+ (vEvent->filterable_data[0].value) <<= this->domain_id_;
+ vEvent->filterable_data[1].name = FT::FT_LOCATION;
+ (vEvent->filterable_data[1].value) <<= this->object_location_;
+ if (this->object_type_!= 0)
+ {
+ vEvent->filterable_data[2].name = FT::FT_TYPE_ID;
+ (vEvent->filterable_data[2].value) <<= this->object_type_;
+ if (this->group_id_!= 0)
+ {
+ vEvent->filterable_data[3].name = FT::FT_GROUP_ID;
+ vEvent->filterable_data[3].value <<= this->group_id_;
+ }
+ }
+ ACE_TRY_NEW_ENV
+ {
+ if (TAO_debug_level > 5)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "call Fault Detector push Structured Event.\n"
+ ));
+ }
+ this->notifier_->push_structured_fault(vEvent.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (TAO_debug_level > 5)
+ {
+
+ ACE_ERROR ((LM_ERROR,
+ "return from Fault Detector push Structured Event.\n"
+ ));
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Fault Detector cannot send notification.");
+ }
+ ACE_ENDTRY;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Fault Detector cannot create Structured Event.\n"
+ ));
+ }
+}
+
+
+/////////////////////////////////////////////////////////
+// Fault_Detector_i private static implementation methods
+
+//static
+ACE_THR_FUNC_RETURN TAO::Fault_Detector_i::thr_func (void * arg)
+{
+ TAO::Fault_Detector_i * detector = static_cast<TAO::Fault_Detector_i * > (arg);
+ detector->run ();
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/Fault_Detector/Fault_Detector_i.h b/TAO/orbsvcs/Fault_Detector/Fault_Detector_i.h
new file mode 100644
index 00000000000..03642de4b48
--- /dev/null
+++ b/TAO/orbsvcs/Fault_Detector/Fault_Detector_i.h
@@ -0,0 +1,183 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Fault_Detector_i.h
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * This file declares the Fault_Detector_i class.
+ * The class implements the FaultDetectors as defined
+ * in the specification.
+ * A FaultDetector monitors the health of replicas.
+ * It is *NOT* a CORBA object and does not implement an IDL interface.
+ * All CORBA interaction with a FaultDetector is via a FaultDetectorFactory.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef FAULT_DETECTOR_I_H_
+#define FAULT_DETECTOR_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/Manual_Event.h>
+
+
+#include "orbsvcs/FT_NotifierC.h"
+#include "orbsvcs/FT_ReplicaC.h"
+#include "ace/Time_Value.h"
+
+// Classes declared in this header
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ //////////////////////
+ // Forward references
+
+ class FT_FaultDetectorFactory_i;
+
+ //////////////////////
+ // Class declarations
+
+ class Fault_Detector_i
+ {
+ ///////////////////
+ // Public interface
+ public:
+ /**
+ * Construct FaultDetector.
+ * @param factory to be notified when this detector goes away.
+ * @param id to use when notifyting the factory of detector departure.
+ * @param notifier to receive the fault notification if our monitorable faults.
+ * @param monitorable object to be monitored.
+ * @param domain_id data to include in fault notification.
+ * @param object_location data to include in fault notification.
+ * @param object_type data to include in fault notification.
+ * @param group_id data to include in fault notification.
+ */
+ Fault_Detector_i (
+ FT_FaultDetectorFactory_i & factory,
+ CORBA::ULong id,
+ FT::FaultNotifier_ptr & notifier,
+ FT::PullMonitorable_ptr & monitorable,
+ FT::FTDomainId domain_id,
+ const PortableGroup::Location & object_location,
+ PortableGroup::TypeId object_type,
+ PortableGroup::ObjectGroupId group_id
+ );
+ /**
+ * destructor.
+ * Non-virtual because this class does not take part in
+ * inheritence.
+ */
+ ~Fault_Detector_i ();
+
+ /**
+ * Start the thread associated with this fault detector.
+ * @param threadManager to track this thread.
+ */
+ void start(ACE_Thread_Manager & threadManager);
+
+ /**
+ * Request that this detector shut itself down.
+ */
+ void request_quit();
+
+ ////////////////////////
+ // Static public methods
+ public:
+ /**
+ * Set the polling time for all FaultDetectors in this process.
+ * @param value the time between polls.
+ */
+ static void set_time_for_all_detectors (ACE_Time_Value value);
+
+ /////////////////////////
+ // implementation methods
+ private:
+ /**
+ * Send the notification message.
+ */
+ void notify();
+
+ /**
+ * The method to be run in the fault detector thread.
+ */
+ void run();
+
+ /**
+ * The startup function for the fault detector thread.
+ */
+ static ACE_THR_FUNC_RETURN thr_func (void * arg);
+
+ ////////////////////
+ // Forbidden methods
+ private:
+ Fault_Detector_i ();
+ Fault_Detector_i (Fault_Detector_i & rhs);
+ Fault_Detector_i & operator = (const Fault_Detector_i & rhs);
+
+ ///////////////
+ // Static data
+ private:
+ /**
+ * Time between polls for all fault detectors in this process.
+ */
+ static ACE_Time_Value sleep_time_;
+
+ ///////////////
+ // Data members
+ private:
+ /**
+ * The factory that "owns" us."
+ */
+ FT_FaultDetectorFactory_i & factory_;
+
+ /**
+ * How the factory knows who we are.
+ */
+ CORBA::ULong id_;
+
+ /**
+ * Where to send fault notification messages.
+ */
+ FT::FaultNotifier_var notifier_;
+
+ /**
+ * What to monitor.
+ */
+ FT::PullMonitorable_var monitorable_;
+
+ /**
+ * Data for the notification message.
+ */
+ FT::FTDomainId domain_id_;
+ PortableGroup::Location object_location_;
+ PortableGroup::TypeId object_type_;
+ PortableGroup::ObjectGroupId group_id_;
+
+ /**
+ * An Event (in the Win32 sense) to implement interruptable sleep.
+ * Manual rather than auto because once quit is requested we never
+ * want to sleep again.
+ */
+ ACE_Manual_Event sleep_;
+
+ /**
+ * A boolean flag. If true, this fault detector should leave.
+ */
+ int quit_requested_;
+ };
+} // namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ <ace/post.h>
+#endif // FAULT_DETECTOR_I_H_
diff --git a/TAO/orbsvcs/Fault_Detector/Makefile.am b/TAO/orbsvcs/Fault_Detector/Makefile.am
new file mode 100644
index 00000000000..a0033227cea
--- /dev/null
+++ b/TAO/orbsvcs/Fault_Detector/Makefile.am
@@ -0,0 +1,75 @@
+## 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.Fault_Detector.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+bin_PROGRAMS = Fault_Detector
+
+Fault_Detector_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
+
+Fault_Detector_SOURCES = \
+ FT_FaultDetectorFactory_i.cpp \
+ Fault_Detector_Main.cpp \
+ Fault_Detector_i.cpp \
+ FT_FaultDetectorFactory_i.h \
+ Fault_Detector_i.h
+
+Fault_Detector_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/Fault_Notifier/.cvsignore b/TAO/orbsvcs/Fault_Notifier/.cvsignore
new file mode 100644
index 00000000000..346d74c2dcd
--- /dev/null
+++ b/TAO/orbsvcs/Fault_Notifier/.cvsignore
@@ -0,0 +1,5 @@
+*.dsp
+*.dsw
+Debug
+Fault_Notifier
+Release
diff --git a/TAO/orbsvcs/Fault_Notifier/FT_Notifier_i.cpp b/TAO/orbsvcs/Fault_Notifier/FT_Notifier_i.cpp
new file mode 100644
index 00000000000..e120b9a2cc7
--- /dev/null
+++ b/TAO/orbsvcs/Fault_Notifier/FT_Notifier_i.cpp
@@ -0,0 +1,774 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file FT_Notifier_i.cpp
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#include "FT_Notifier_i.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+#include "tao/debug.h"
+
+// Use this macro at the beginning of CORBA methods
+// to aid in debugging.
+#define METHOD_ENTRY(name) \
+ if (TAO_debug_level > 6) \
+ { \
+ 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) \
+ if (TAO_debug_level > 6) \
+ { \
+ ACE_DEBUG (( LM_DEBUG, \
+ "Leave %s\n", #name \
+ )); \
+ } \
+ return /* value goes here */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Implementation skeleton constructor
+TAO::FT_FaultNotifier_i::FT_FaultNotifier_i ()
+ : orb_ (0)
+ , poa_ (0)
+ , object_id_ (0)
+ , ior_output_file_(0)
+ , ns_name_(0)
+ , naming_context_ (0)
+ , this_name_ (1)
+ , rm_register_ (1)
+ , replication_manager_ (0)
+ , registered_ (0)
+ , identity_ ("")
+ , proxy_infos_ (0)
+ , consumer_connects_(0)
+ , consumer_disconnects_(0)
+ , notify_channel_ (0)
+ , filter_factory_ (0)
+ , supplier_admin_ (0)
+ , consumer_admin_ (0)
+ , structured_proxy_push_consumer_ (0)
+ , sequence_proxy_push_consumer_ (0)
+ , quit_on_idle_(0)
+ , quitting_(0)
+ , gone_(0)
+{
+}
+
+// Implementation skeleton destructor
+TAO::FT_FaultNotifier_i::~FT_FaultNotifier_i ()
+{
+ ACE_TRY_NEW_ENV
+ {
+ fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+}
+
+
+int TAO::FT_FaultNotifier_i::idle(int &result ACE_ENV_ARG_DECL_NOT_USED)
+{
+ static unsigned long linger = 0;
+ ACE_UNUSED_ARG(result);
+ if (gone_)
+ {
+ if ( linger == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "FaultNotifier (%P|%t) Begin linger.\n"
+ ));
+ }
+ if(++linger > 5)//10)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "FaultNotifier (%P|%t) idle returnning gone\n"
+ ));
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ return this->gone_;
+}
+
+////////////////////////////////////////////
+// FT_FaultNotifier_i private methods
+
+
+// TODO: find this a common home
+int TAO::FT_FaultNotifier_i::write_ior()
+{
+ 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;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "%T %n (%P|%t) Open failed for %s\n", ior_output_file_
+ ));
+ }
+ return result;
+}
+
+//////////////////////////////////////////////////////
+// FT_FaultNotifier_i public, non-CORBA methods
+
+int TAO::FT_FaultNotifier_i::parse_args (int argc, char * argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:rq");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'o':
+ {
+ this->ior_output_file_ = get_opts.opt_arg ();
+ break;
+ }
+ case 'r':
+ {
+ this->rm_register_ = ! this->rm_register_;
+ break;
+ }
+ case 'q':
+ {
+ this->quit_on_idle_ = 1;
+ break;
+ }
+ case '?':
+ // fall thru
+ default:
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " -o <iorfile>"
+ " -r disable registration with ReplicationManager"
+ " -q(uit on idle)"
+ "\n",
+ argv [0]),
+ -1);
+ break;
+ }
+ }
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+const char * TAO::FT_FaultNotifier_i::identity () const
+{
+ return this->identity_.c_str();
+}
+
+PortableServer::POA_ptr TAO::FT_FaultNotifier_i::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return this->poa_.in();
+}
+
+
+void TAO::FT_FaultNotifier_i::_remove_ref (ACE_ENV_SINGLE_ARG_DECL)
+{
+ notify_channel_->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ERROR ((LM_ERROR,
+ "FaultNotifier (%P|%t) _remove_ref setting gone\n"
+ ));
+ this->gone_ = 1;
+}
+
+int TAO::FT_FaultNotifier_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_.in() != 0)
+ {
+ this->naming_context_->unbind (this_name_
+ ACE_ENV_ARG_PARAMETER);
+ this->ns_name_ = 0;
+ }
+
+ if (this->registered_)
+ {
+ ACE_TRY
+ {
+ this->replication_manager_->register_fault_notifier(::FT::FaultNotifier::_nil ());
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG,
+ "FaultNotifier unregistered from ReplicationManager.\n"
+ ));
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "FaultNotifier Can't unregister from ReplicationManager.\n"
+ ));
+ // complain, but otherwise ignore this error
+ // RM may be down.
+ }
+ ACE_ENDTRY;
+
+ this->registered_ = 0;
+ }
+ return 0;
+}
+
+int TAO::FT_FaultNotifier_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);
+
+ // find my IOR
+
+ 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);
+
+
+ ////////////////////////////////////////////////
+ // Register with coresident Notification Channel
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory =
+ TAO_Notify_EventChannelFactory_i::create (poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+ this->notify_channel_ =
+ notify_factory->create_channel (initial_qos,
+ initial_admin,
+ channel_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ this->filter_factory_ = this->notify_channel_->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ ///////////////////////////
+ // Producer registration
+
+ this->supplier_admin_ = this->notify_channel_->default_supplier_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ ::CosNotifyChannelAdmin::ProxyID proxyId = 0;
+
+ //////////////////////
+ // structured producer
+ ::CosNotifyChannelAdmin::ProxyConsumer_var consumer
+ = this->supplier_admin_->obtain_notification_push_consumer (
+ ::CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ proxyId
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ structured_proxy_push_consumer_
+ = ::CosNotifyChannelAdmin::StructuredProxyPushConsumer::_narrow(consumer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+ if (CORBA::is_nil (this->structured_proxy_push_consumer_.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%T %n (%P|%t) Should not occur: Unable to narrow Structured Proxy Push Consumer\n"),
+ 1);
+ }
+
+ // todo: implement a push supplier if we want to receive disconnect notice
+ CosNotifyComm::StructuredPushSupplier_var stubPushSupplier =
+ CosNotifyComm::StructuredPushSupplier::_nil();
+
+ this->structured_proxy_push_consumer_->connect_structured_push_supplier (stubPushSupplier.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ ////////////////////
+ // Sequence producer
+ consumer
+ = this->supplier_admin_->obtain_notification_push_consumer (
+ ::CosNotifyChannelAdmin::SEQUENCE_EVENT,
+ proxyId
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->sequence_proxy_push_consumer_
+ = ::CosNotifyChannelAdmin::SequenceProxyPushConsumer::_narrow(consumer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (CORBA::is_nil (this->sequence_proxy_push_consumer_.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%T %n (%P|%t) Should not occur: Unable to narrow Sequence Proxy Push Consumer\n"),
+ 1);
+ }
+
+ // todo: implement this if we want to receive disconnect notice
+ CosNotifyComm::SequencePushSupplier_var stubSeqPushSupplier =
+ CosNotifyComm::SequencePushSupplier::_nil();
+
+ this->sequence_proxy_push_consumer_->connect_sequence_push_supplier (stubSeqPushSupplier.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+ ///////////////////////////
+ // Consumer registration
+
+ // find the channel administrator for consumers
+ this->consumer_admin_ = this->notify_channel_->default_consumer_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+ if (CORBA::is_nil (this->consumer_admin_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "%T %n (%P|%t) NIL consumer admin\n"
+ ));
+ result = -1;
+ }
+ // everything else happens when subscriber shows up
+
+ ///////////////////////////////
+ // Register with ReplicationManager
+ if (this->rm_register_)
+ {
+ 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 ()))
+ {
+ // @@: should we check to see if there's already one registered?
+ FT::FaultNotifier_var notifier = FT::FaultNotifier::_narrow (this_obj.in ());
+ if (! CORBA::is_nil (notifier.in ()))
+ {
+ this->replication_manager_->register_fault_notifier(notifier.in ());
+ ACE_DEBUG ((LM_DEBUG,
+ "FaultNotifier registered with ReplicationManager.\n"
+ ));
+ this->registered_ = 1;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Error: Registration failed. This is not a FaultNotifier (should not occur.)\n"
+ ));
+ }
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,"FaultNotifier: Can't resolve ReplicationManager, It will not be registered.\n" ));
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "FaultNotifier: Exception resolving ReplicationManager. Notifier will not be registered.\n" );
+ }
+ ACE_ENDTRY;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "FaultNotifier: ReplicationManager registration disabled.\n"
+ ));
+ }
+ ///////////////////////////////
+ // Set up and ready for action
+ // publish our IOR
+
+ if(result == 0)
+ {
+ if (this->ior_output_file_ != 0)
+ {
+ this->identity_ = "file:";
+ this->identity_ += this->ior_output_file_;
+ result = write_ior();
+ }
+ }
+
+ if (result == 0)
+ {
+ 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);
+ }
+
+ this->naming_context_ =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (CORBA::is_nil(this->naming_context_.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%T %n (%P|%t) Should not occur: Can't narrow initial reference to naming context.\n"),
+ 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);
+ }
+ }
+
+ return result;
+}
+
+///////////////////
+// CORBA METHODS
+
+void TAO::FT_FaultNotifier_i::push_structured_fault (
+ const CosNotification::StructuredEvent & event
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ METHOD_ENTRY(TAO::FT_FaultNotifier_i::push_structured_fault);
+
+ this->structured_proxy_push_consumer_->push_structured_event (event
+ ACE_ENV_ARG_PARAMETER);
+
+ METHOD_RETURN(TAO::FT_FaultNotifier_i::push_structured_fault);
+}
+
+void TAO::FT_FaultNotifier_i::push_sequence_fault (
+ const CosNotification::EventBatch & events
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ METHOD_ENTRY(TAO::FT_FaultNotifier_i::push_sequence_fault);
+
+ this->sequence_proxy_push_consumer_->push_structured_events (events
+ ACE_ENV_ARG_PARAMETER);
+
+ METHOD_RETURN(TAO::FT_FaultNotifier_i::push_sequence_fault);
+}
+
+::CosNotifyFilter::Filter_ptr TAO::FT_FaultNotifier_i::create_subscription_filter (
+ const char * constraint_grammar
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException, CosNotifyFilter::InvalidGrammar))
+{
+ METHOD_ENTRY(TAO::FT_FaultNotifier_i::create_subscription_filter);
+ ACE_UNUSED_ARG (constraint_grammar); //@@todo
+
+ CosNotifyFilter::Filter_var filter = this->filter_factory_->create_filter ("ETCL");
+ METHOD_RETURN(TAO::FT_FaultNotifier_i::create_subscription_filter)
+ filter._retn ();
+}
+
+FT::FaultNotifier::ConsumerId TAO::FT_FaultNotifier_i::connect_structured_fault_consumer (
+ CosNotifyComm::StructuredPushConsumer_ptr push_consumer,
+ CosNotifyFilter::Filter_ptr filter
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ METHOD_ENTRY(TAO::FT_FaultNotifier_i::connect_structured_fault_consumer);
+
+ /////////////////////////
+ // find a ProxyInfo entry
+ // use the first nil entry or a new entry if no nils found
+
+ size_t infoPos = 0;
+ int looking = 1;
+ for ( size_t pos = 0; looking && pos < this->proxy_infos_.size (); ++pos)
+ {
+ ProxyInfo & pi = this->proxy_infos_[pos];
+ if (CORBA::is_nil(pi.proxyVar_.in ()))
+ {
+ infoPos = pos;
+ looking = 0;
+ }
+ }
+ if (looking)
+ {
+ infoPos = this->proxy_infos_.size();
+ this->proxy_infos_.push_back(ProxyInfo());
+ }
+
+ ///////////////////////////////////////
+ // Assign an ID, populate the ProxyInfo
+ FT::FaultNotifier::ConsumerId result = infoPos;
+ ProxyInfo & info = this->proxy_infos_[infoPos];
+ info.proxyVar_
+ = this->consumer_admin_->obtain_notification_push_supplier (
+ ::CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ info.proxyId_
+ ACE_ENV_ARG_PARAMETER);
+
+ this->consumer_connects_ += 1;
+
+ ::CosNotifyChannelAdmin::StructuredProxyPushSupplier_var proxySupplier
+ = ::CosNotifyChannelAdmin::StructuredProxyPushSupplier::_narrow(info.proxyVar_.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ if ( CORBA::is_nil (proxySupplier.in ()))
+ {
+ // this is a shoould-not-occur situation. The consumer admin returned
+ // the wrong kind of object.
+ ACE_ERROR(( LM_ERROR,
+ "%T %n (%P|%t) Unexpected result: Wrong type of object returned from obtain_notification_push_supplier\n"
+ ));
+ }
+ else
+ {
+ proxySupplier->connect_structured_push_consumer ( push_consumer
+ ACE_ENV_ARG_PARAMETER);
+
+ if (! CORBA::is_nil (filter))
+ {
+ proxySupplier->add_filter(filter);
+ }
+ }
+
+ METHOD_RETURN(TAO::FT_FaultNotifier_i::connect_structured_fault_consumer) result;
+}
+
+FT::FaultNotifier::ConsumerId TAO::FT_FaultNotifier_i::connect_sequence_fault_consumer (
+ CosNotifyComm::SequencePushConsumer_ptr push_consumer,
+ CosNotifyFilter::Filter_ptr filter
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ METHOD_ENTRY(TAO::FT_FaultNotifier_i::connect_sequence_fault_consumer);
+ /////////////////////////
+ // find a ProxyInfo entry
+ // use the first nil entry or a new entry if no nils found
+
+ size_t infoPos = 0;
+ int looking = 1;
+ for ( size_t pos = 0; looking && pos < this->proxy_infos_.size (); ++pos)
+ {
+ ProxyInfo & pi = this->proxy_infos_[pos];
+ if (CORBA::is_nil(pi.proxyVar_.in ()))
+ {
+ infoPos = pos;
+ looking = 0;
+ }
+ }
+ if (looking)
+ {
+ infoPos = this->proxy_infos_.size();
+ this->proxy_infos_.push_back(ProxyInfo());
+ }
+
+ ///////////////////////////////////////
+ // Assign an ID, populate the ProxyInfo
+ FT::FaultNotifier::ConsumerId result = infoPos;
+ ProxyInfo & info = this->proxy_infos_[infoPos];
+ info.proxyVar_
+ = this->consumer_admin_->obtain_notification_push_supplier (
+ ::CosNotifyChannelAdmin::SEQUENCE_EVENT,
+ info.proxyId_
+ ACE_ENV_ARG_PARAMETER);
+
+ this->consumer_connects_ += 1;
+
+ ::CosNotifyChannelAdmin::SequenceProxyPushSupplier_var proxySupplier
+ = ::CosNotifyChannelAdmin::SequenceProxyPushSupplier::_narrow(info.proxyVar_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ if ( CORBA::is_nil (proxySupplier.in ()))
+ {
+ // this is a shoould-not-occur situation. The consumer admin returned
+ // the wrong kind of object.
+ ACE_ERROR(( LM_ERROR,
+ "%T %n (%P|%t) Unexpected result: Wrong type of object returned from obtain_notification_push_supplier\n"
+ ));
+ }
+ else
+ {
+ proxySupplier->connect_sequence_push_consumer ( push_consumer
+ ACE_ENV_ARG_PARAMETER);
+
+ if (! CORBA::is_nil (filter))
+ {
+ proxySupplier->add_filter(filter);
+ }
+ }
+ METHOD_RETURN(TAO::FT_FaultNotifier_i::connect_sequence_fault_consumer) result;
+}
+
+void TAO::FT_FaultNotifier_i::disconnect_consumer (
+ FT::FaultNotifier::ConsumerId connection
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException, CosEventComm::Disconnected))
+{
+ METHOD_ENTRY(TAO::FT_FaultNotifier_i::disconnect_consumer);
+
+ size_t index = static_cast<size_t> (connection);
+ if (index < this->proxy_infos_.size())
+ {
+ ProxyInfo & info = this->proxy_infos_[index];
+ if (CORBA::is_nil(info.proxyVar_.in ()) )
+ {
+ ACE_THROW(CosEventComm::Disconnected());
+ }
+ else
+ {
+ ::CosNotifyChannelAdmin::StructuredProxyPushSupplier_var proxySupplier
+ = ::CosNotifyChannelAdmin::StructuredProxyPushSupplier::_narrow(info.proxyVar_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ if (! CORBA::is_nil (proxySupplier.in ()))
+ {
+ proxySupplier->disconnect_structured_push_supplier ();
+ info.proxyVar_ = ::CosNotifyChannelAdmin::ProxySupplier::_nil();
+ }
+ else
+ {
+ ::CosNotifyChannelAdmin::SequenceProxyPushSupplier_var proxySupplier
+ = ::CosNotifyChannelAdmin::SequenceProxyPushSupplier::_narrow(info.proxyVar_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ if (! CORBA::is_nil (proxySupplier.in ()))
+ {
+ proxySupplier->disconnect_sequence_push_supplier ();
+ info.proxyVar_ = ::CosNotifyChannelAdmin::ProxySupplier::_nil();
+ }
+ else
+ {
+ ACE_ERROR((LM_ERROR,
+ "%T %n (%P|%t) Unexpected proxy supplier type\n"
+ ));
+ ACE_THROW(CosEventComm::Disconnected());
+ }
+ }
+ }
+ }
+ else
+ {
+ ACE_THROW(CosEventComm::Disconnected());
+ }
+
+ this->consumer_disconnects_ += 1;
+ if (this->quit_on_idle_)
+ {
+ if (! this->quitting_
+ && this->consumer_connects_ == this->consumer_disconnects_)
+ {
+ ACE_ERROR((LM_ERROR,
+ "FaultNotifier (%P|%t) quit on idle: connects %d, disconnects %d\n",
+ static_cast<unsigned int> (this->consumer_connects_),
+ static_cast<unsigned int> (this->consumer_disconnects_)
+ ));
+ this->poa_->deactivate_object (this->object_id_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ this->quitting_ = 1;
+ }
+ }
+
+ METHOD_RETURN(TAO::FT_FaultNotifier_i::disconnect_consumer);
+}
+
+CORBA::Boolean TAO::FT_FaultNotifier_i::is_alive (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ METHOD_RETURN(TAO::FT_FaultNotifier_i::is_alive) 1;
+}
+
+//////////////
+// ProxyInfo
+
+TAO::FT_FaultNotifier_i::ProxyInfo::ProxyInfo ()
+ : proxyId_ (0)
+ , proxyVar_ (::CosNotifyChannelAdmin::ProxySupplier::_nil())
+{
+}
+
+TAO::FT_FaultNotifier_i::ProxyInfo::ProxyInfo (const ProxyInfo & rhs)
+ : proxyId_ (rhs.proxyId_)
+ , proxyVar_ (rhs.proxyVar_)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/Fault_Notifier/FT_Notifier_i.h b/TAO/orbsvcs/Fault_Notifier/FT_Notifier_i.h
new file mode 100644
index 00000000000..1f5e672eaed
--- /dev/null
+++ b/TAO/orbsvcs/Fault_Notifier/FT_Notifier_i.h
@@ -0,0 +1,272 @@
+// -*- C++ -*-
+//
+// $Id$
+//=============================================================================
+/**
+ * @file FT_Notifier_i.h
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * This file declares the Fault_Notifier_i class.
+ * A FaultNotifer is a subset of a notification channel. It allows interested
+ * parties to subscribe to fault notifications. The most likely interested party
+ * is the ReplicationManager.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef TAO_FT_NOTIFIER_I_H_
+#define TAO_FT_NOTIFIER_I_H_
+#include /**/ "ace/pre.h"
+#include "ace/ACE.h"
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include <orbsvcs/FT_NotifierS.h>
+#include <orbsvcs/FT_ReplicationManagerC.h>
+#include <orbsvcs/Notify/Notify_EventChannelFactory_i.h>
+#include <ace/Vector_T.h>
+
+/////////////////////
+// Forward references
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+namespace TAO
+{
+ class FT_FaultNotifier_i : public virtual POA_FT::FaultNotifier
+ {
+ //////////////////////
+ // non-CORBA interface
+ public:
+ /**
+ * Default constructor.
+ */
+ FT_FaultNotifier_i ();
+
+ /**
+ * Virtual destructor.
+ */
+ virtual ~FT_FaultNotifier_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 orbManager 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);
+
+ /**
+ * Identify this fault notifier.
+ * @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);
+
+ //////////////////
+ // CORBA interface
+ // See IDL for documentation
+
+ virtual void push_structured_fault (
+ const CosNotification::StructuredEvent & event
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void push_sequence_fault (
+ const CosNotification::EventBatch & events
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::CosNotifyFilter::Filter_ptr create_subscription_filter (
+ const char * constraint_grammar
+ ACE_ENV_ARG_DECL
+ )
+ 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
+ )
+ 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
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void disconnect_consumer (
+ FT::FaultNotifier::ConsumerId connection
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException, CosEventComm::Disconnected));
+
+ //////////////////////////////////////////
+ // CORBA interface PullMonitorable methods
+ virtual CORBA::Boolean is_alive (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+ /////////////////////////////////////////
+ // 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);
+
+ /////////////////////////
+ // Implementation methods
+ private:
+ /**
+ * Write this notifier's IOR to a file
+ */
+ int write_ior ();
+
+ ///////////////
+ // 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 orb.
+ */
+ CORBA::String_var ior_;
+
+ /**
+ * A file to which the notifier's IOR should be written.
+ */
+ const char * ior_output_file_;
+
+ /**
+ * A name to be used to register the notifier with the name service.
+ */
+ const char * ns_name_;
+
+ CosNaming::NamingContext_var naming_context_;
+
+ CosNaming::Name this_name_;
+
+ /**
+ * bool: if true, register with ReplicationManager.
+ * default is true. -r turns it off.
+ */
+ int rm_register_;
+
+ /**
+ * the replication manager
+ */
+ ::FT::ReplicationManager_var replication_manager_;
+
+ /**
+ * bool: if true the registration with ReplicationManager was successful.
+ */
+ int registered_;
+
+ /**
+ * A human-readable string to distinguish this from other Notifiers.
+ */
+ ACE_CString identity_;
+
+ /////////////////////////////
+ //
+ struct ProxyInfo
+ {
+ ::CosNotifyChannelAdmin::ProxyID proxyId_;
+ ::CosNotifyChannelAdmin::ProxySupplier_var proxyVar_;
+
+ ProxyInfo ();
+ ProxyInfo (const ProxyInfo & rhs);
+ };
+
+ typedef ACE_Vector <ProxyInfo> ProxyInfoVec;
+
+ ProxyInfoVec proxy_infos_;
+
+ size_t consumer_connects_;
+ size_t consumer_disconnects_;
+
+ ::CosNotifyChannelAdmin::ChannelID channel_id_;
+ ::CosNotifyChannelAdmin::EventChannel_var notify_channel_;
+ ::CosNotifyFilter::FilterFactory_var filter_factory_;
+ ::CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
+ ::CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
+
+ ::CosNotifyChannelAdmin::StructuredProxyPushConsumer_var structured_proxy_push_consumer_;
+ ::CosNotifyChannelAdmin::SequenceProxyPushConsumer_var sequence_proxy_push_consumer_;
+
+ /*
+ * boolean quit when all consumers disconnect
+ */
+ int quit_on_idle_;
+
+ /**
+ * boolean: set true we've asked CORBA to deactivate
+ */
+ int quitting_;
+
+ /**
+ * boolean: set true when CORBA is done with this object.
+ */
+ int gone_;
+
+ };
+} // namespace TAO
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_FT_NOTIFIER_I_H_ */
diff --git a/TAO/orbsvcs/Fault_Notifier/Fault_Notifier.mpc b/TAO/orbsvcs/Fault_Notifier/Fault_Notifier.mpc
new file mode 100644
index 00000000000..071207bca3a
--- /dev/null
+++ b/TAO/orbsvcs/Fault_Notifier/Fault_Notifier.mpc
@@ -0,0 +1,8 @@
+// $Id$
+project : taoserver, orbsvcsexe, core, fault_tolerance, notification_serv {
+ exename = Fault_Notifier
+ Source_Files {
+ FT_Notifier_i.cpp
+ Fault_Notifier_Main.cpp
+ }
+}
diff --git a/TAO/orbsvcs/Fault_Notifier/Fault_Notifier_Main.cpp b/TAO/orbsvcs/Fault_Notifier/Fault_Notifier_Main.cpp
new file mode 100644
index 00000000000..1896c78ea18
--- /dev/null
+++ b/TAO/orbsvcs/Fault_Notifier/Fault_Notifier_Main.cpp
@@ -0,0 +1,25 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Fault_Notifier_Main.cpp
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * This file provides the main routine for a process that
+ * implements the FaultNotifier interface and manages
+ * a set of FaultNotifiers.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#include "tao/Utils/Server_Main.h"
+#include "FT_Notifier_i.h"
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ TAO::Utils::Server_Main<TAO::FT_FaultNotifier_i> server_main("TAO_FaultNotifier");
+ return server_main.run(argc, argv);
+}
+
diff --git a/TAO/orbsvcs/Fault_Notifier/Makefile.am b/TAO/orbsvcs/Fault_Notifier/Makefile.am
new file mode 100644
index 00000000000..23e094d7a5b
--- /dev/null
+++ b/TAO/orbsvcs/Fault_Notifier/Makefile.am
@@ -0,0 +1,79 @@
+## 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.Fault_Notifier.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+bin_PROGRAMS = Fault_Notifier
+
+Fault_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
+
+Fault_Notifier_SOURCES = \
+ FT_Notifier_i.cpp \
+ Fault_Notifier_Main.cpp \
+ FT_Notifier_i.h
+
+Fault_Notifier_LDADD = \
+ $(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_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.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
+
+## 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/IFR_Service/.cvsignore b/TAO/orbsvcs/IFR_Service/.cvsignore
new file mode 100644
index 00000000000..6a5a929a01d
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/.cvsignore
@@ -0,0 +1,2 @@
+IFR_Service
+tao_ifr
diff --git a/TAO/orbsvcs/IFR_Service/IFR_Server.cpp b/TAO/orbsvcs/IFR_Service/IFR_Server.cpp
new file mode 100644
index 00000000000..505afb05051
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/IFR_Server.cpp
@@ -0,0 +1,52 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "IFR_Service.h"
+#include "tao/Environment.h"
+
+ACE_RCSID (IFR_Service,
+ IFR_Server,
+ "$Id$")
+
+int
+main (int argc, char *argv[])
+{
+ IFR_Service server;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int status = server.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == -1)
+ {
+ return 1;
+ }
+ else
+ {
+ server.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ status = server.fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == -1)
+ {
+ return 1;
+ }
+ }
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_PRINT_EXCEPTION (sysex, "System Exception");
+ return -1;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unknown Exception");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/IFR_Service/IFR_Service.cpp b/TAO/orbsvcs/IFR_Service/IFR_Service.cpp
new file mode 100644
index 00000000000..327ecfa4ae2
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/IFR_Service.cpp
@@ -0,0 +1,88 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "IFR_Service.h"
+#include "orbsvcs/IFRService/ComponentRepository_i.h"
+#include "orbsvcs/IFRService/Options.h"
+#include "orbsvcs/IFRService/IFR_ComponentsS.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+#include "orbsvcs/IOR_Multicast.h"
+#include "tao/IORTable/IORTable.h"
+#include "tao/ORB_Core.h"
+#include "ace/Auto_Ptr.h"
+
+ACE_RCSID (IFR_Service,
+ IFR_Service,
+ "$Id$")
+
+IFR_Service::IFR_Service (void)
+{
+}
+
+IFR_Service::~IFR_Service (void)
+{
+}
+
+int
+IFR_Service::init (int argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL)
+{
+ int result;
+ ACE_TRY
+ {
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ result = this->my_ifr_server_.init_with_orb (argc,
+ argv,
+ this->orb_.in ());
+ if (result == -1)
+ {
+ return result;
+ }
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "IFR_Service::init");
+
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+IFR_Service::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->orb_->run (0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+IFR_Service::fini (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ this->my_ifr_server_.fini ();
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "IFR_Service::fini");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/IFR_Service/IFR_Service.h b/TAO/orbsvcs/IFR_Service/IFR_Service.h
new file mode 100644
index 00000000000..ac7970f348b
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/IFR_Service.h
@@ -0,0 +1,66 @@
+// $Id$
+
+// ========================================================================
+//
+// = LIBRARY
+// orbsvcs/IFR_Service
+//
+// = FILENAME
+// IFR_Service.h
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// =======================================================================
+
+#ifndef IFR_SERVICE_H
+#define IFR_SERVICE_H
+
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/ORB.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class IFR_Service
+ *
+ * A class that initializes, runs and shuts down
+ * the Interface Repository service.
+ */
+class IFR_Service
+{
+public:
+
+ /// Default constructor.
+ IFR_Service (void);
+
+ /// Destructor
+ ~IFR_Service (void);
+
+ /// Initialize the IFR service.
+ int init (int argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Shut down the IFR Service.
+ int fini (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// Run the IFR service.
+ int run (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+protected:
+
+ /// Reference to our ORB.
+ CORBA::ORB_var orb_;
+
+ /// Root POA reference.
+ PortableServer::POA_var root_poa_;
+
+ /// IFR Server instance.
+ TAO_IFR_Server my_ifr_server_;
+};
+
+#endif /* IFR_SERVICE_H */
diff --git a/TAO/orbsvcs/IFR_Service/IFR_Service.mpc b/TAO/orbsvcs/IFR_Service/IFR_Service.mpc
new file mode 100644
index 00000000000..719169d1594
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/IFR_Service.mpc
@@ -0,0 +1,76 @@
+// -*- MPC -*-
+// $Id$
+
+// The ifrservice base project inherits from minimum_corba, so it's no longer
+// necessary to add minimum_corba to 'avoids' here.
+project(IFR_Service) : orbsvcsexe, core, ifrservice, ifr_client, imr_client, crosscompile {
+ exename = IFR_Service
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ IFR_Server.cpp
+ IFR_Service.cpp
+ }
+}
+
+
+project(TAO_IFR_BE) : taolib, conv_lib, ifr_client, crosscompile, minimum_corba {
+ after += TAO_IDL_FE
+ sharedname = TAO_IFR_BE
+ libs += TAO_IDL_FE
+ dynamicflags = TAO_IFR_BE_BUILD_DLL
+ includes += $(TAO_ROOT)/TAO_IDL/include $(TAO_ROOT)/TAO_IDL/fe
+
+ Source_Files {
+ be_global.cpp
+ be_init.cpp
+ be_produce.cpp
+ ifr_adding_visitor.cpp
+ ifr_adding_visitor_exception.cpp
+ ifr_adding_visitor_operation.cpp
+ ifr_adding_visitor_structure.cpp
+ ifr_adding_visitor_union.cpp
+ ifr_removing_visitor.cpp
+ ifr_visitor.cpp
+ }
+
+ Header_Files {
+ be_extern.h
+ }
+}
+
+
+project(TAO_IFR_EXE) : aceexe, core, ifr_client, crosscompile, minimum_corba {
+ after += TAO_IFR_BE TAO_IDL_FE
+ exename = tao_ifr
+ libs += TAO_IFR_BE TAO TAO_IDL_FE
+ includes += $(TAO_ROOT)/orbsvcs/IFR_Service \
+ $(TAO_ROOT)/TAO_IDL/include \
+ $(TAO_ROOT)/TAO_IDL/fe \
+ $TAO_ROOT
+ install = $(ACE_ROOT)/bin
+
+ specific(automake) {
+ macros += TAO_IDL_INCLUDE_DIR=\"\\"$(includedir)/tao\\"\"
+ }
+
+ verbatim(gnuace, local) {
+ ifeq ($(TAO_IDL_PREPROCESSOR),)
+ CPPFLAGS += -DTAO_IDL_PREPROCESSOR=\\\"$(strip $(CXX))\\\"
+ else
+ CPPFLAGS += -DTAO_IDL_PREPROCESSOR=\\\"$(subst \\,\\,$(TAO_IDL_PREPROCESSOR))\\\"
+ endif
+ }
+
+ Source_Files {
+ drv_args.cpp
+ drv_preproc.cpp
+ tao_idl.cpp
+ }
+
+ Header_Files {
+ $(TAO_ROOT)/TAO_IDL/include/drv_extern.h
+ }
+}
diff --git a/TAO/orbsvcs/IFR_Service/Makefile.am b/TAO/orbsvcs/IFR_Service/Makefile.am
new file mode 100644
index 00000000000..af35aebcf86
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/Makefile.am
@@ -0,0 +1,134 @@
+## 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)
+
+bin_PROGRAMS =
+
+## Makefile.IFR_Service.am
+
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+bin_PROGRAMS += IFR_Service
+
+IFR_Service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+IFR_Service_SOURCES = \
+ IFR_Server.cpp \
+ IFR_Service.cpp \
+ IFR_Service.h
+
+IFR_Service_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_ImR_Client.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_IFRService.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_TypeCodeFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.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
+
+## Makefile.TAO_IFR_BE.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_LTLIBRARIES = libTAO_IFR_BE.la
+
+libTAO_IFR_BE_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/TAO_IDL/include \
+ -I$(TAO_ROOT)/TAO_IDL/fe \
+ -DTAO_IFR_BE_BUILD_DLL
+
+libTAO_IFR_BE_la_SOURCES = \
+ be_global.cpp \
+ be_init.cpp \
+ be_produce.cpp \
+ ifr_adding_visitor.cpp \
+ ifr_adding_visitor_exception.cpp \
+ ifr_adding_visitor_operation.cpp \
+ ifr_adding_visitor_structure.cpp \
+ ifr_adding_visitor_union.cpp \
+ ifr_removing_visitor.cpp \
+ ifr_visitor.cpp
+
+noinst_HEADERS = \
+ be_extern.h \
+ be_global.h \
+ ifr_adding_visitor.h \
+ ifr_adding_visitor_exception.h \
+ ifr_adding_visitor_operation.h \
+ ifr_adding_visitor_structure.h \
+ ifr_adding_visitor_union.h \
+ ifr_removing_visitor.h \
+ ifr_visitor.h
+
+endif !BUILD_MINIMUM_CORBA
+
+## Makefile.TAO_IFR_EXE.am
+
+if !BUILD_MINIMUM_CORBA
+
+bin_PROGRAMS += tao_ifr
+
+tao_ifr_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs/IFR_Service \
+ -I$(TAO_ROOT)/TAO_IDL/include \
+ -I$(TAO_ROOT)/TAO_IDL/fe \
+ -DTAO_IDL_INCLUDE_DIR="\"$(includedir)/tao\""
+
+tao_ifr_SOURCES = \
+ drv_args.cpp \
+ drv_preproc.cpp \
+ tao_idl.cpp \
+ $(TAO_ROOT)/TAO_IDL/include/drv_extern.h
+
+tao_ifr_LDADD = \
+ libTAO_IFR_BE.la \
+ $(TAO_BUILDDIR)/TAO_IDL/libTAO_IDL_FE.la \
+ $(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/IFR_Service/README b/TAO/orbsvcs/IFR_Service/README
new file mode 100644
index 00000000000..c846bdde6f1
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/README
@@ -0,0 +1,80 @@
+$Id$
+
+
+Interface Repository -------
+
+Required libraries (in addition to ACE and TAO):
+ ACE_ROOT/TAO/tao/IFR_CLient/TAO_IFR_CLient.(lib-ext)
+ ACE_ROOT/TAO/tao/TypeCodeFactory/TAO_TypeCodeFactory.(lib-ext)
+ ACE_ROOT/TAO/tao/PortableServer/TAO_PortableServer.(lib-ext)
+ ACE_ROOT/TAO/tao/IORTable/TAO_IORTable.(lib-ext)
+ ACE_ROOT/TAO/orbsvcs/orbsvcs/TAO_Svc_Utils.(lib-ext)
+
+Executable name is IFR_Service.
+
+Command line options are:
+
+ -p Makes the Interface Repository persistent.
+
+ -b <filename> Overrides the default filename used for
+ persistent storage. The default filename
+ is "ifr_default_backing_store".
+
+ -m Enables read/write locking of IFR calls.
+ If the IFR is started up with
+ multithreading enabled - for example if
+ a service config file is used that specifies
+ thread-per-connection - this option should be
+ used. Note that if ACE_HAS_THREADS is not
+ defined, this option will be ignored.
+
+ -r Uses win32 registry for the database. Not
+ available with persistence. If -p is on
+ the command line, this option is ignored.
+ If the platform is not win32, an error
+ message is output.
+
+ -o <filename> Overrides the default filename used for
+ outputting the Interface Repository IOR.
+ The default filename is "if_repo.ior".
+
+Test code for the Interface Repository can be found in
+ACE_ROOT/TAO/orbsvcs/tests/InterfaceRepo.
+
+
+
+tao_ifr ------
+
+This is the executable that administers the IFR. Calling
+tao_ifr <IDL filename> will add the contents of the IDL
+file to the repository. Calling tao_ifr -r <IDL filename>
+will remove the contents of the IDL file from the repository.
+tao_ifr requires all the libraries that are required by
+the IFR service, plus the IFR_Service executable itself.
+Test code for tao_ifr can be found in
+ACE_ROOT/TAO/orbsvcs/tests/InterfaceRepo/Application_Test.
+
+tao_ifr can also handle the -ORBxxx parameters. The one most
+frequently used would probably be
+
+'-ORBInitRef InterfaceRepository=file://<filename>'
+
+which will enable the IFR service to be resolved by getting
+its IOR from <filename>. By default, the IFR service stores
+its IOR in the file 'if_repo.ior', but that can be modified
+by starting the IFR service using the -o option (see above).
+All -ORB options appear in the command line before any other
+options, since the -ORB options are consumed by CORBA::ORB_init.
+
+tao_ifr can process multiple IDL files in one execution. As
+long as the filenames come after any -ORB options that may
+be present, they may come mixed in any order with the other
+command line options. The tao_ifr command line parser will
+treat any option (or option pair) that doesn't begin with
+'-' as a filename.
+
+More information about the Interface Repository and tao_ifr can
+be found in ACE_ROOT/TAO/docs/releasenotes/index.html.
+
+
+- Jeff Parsons <parsons@cs.wustl.edu>
diff --git a/TAO/orbsvcs/IFR_Service/TAO_IFR_BE_Export.h b/TAO/orbsvcs/IFR_Service/TAO_IFR_BE_Export.h
new file mode 100644
index 00000000000..3ae082aa61e
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/TAO_IFR_BE_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_IFR_BE_EXPORT_H
+#define TAO_IFR_BE_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_IFR_BE_HAS_DLL)
+# define TAO_IFR_BE_HAS_DLL 0
+# endif /* ! TAO_IFR_BE_HAS_DLL */
+#else
+# if !defined (TAO_IFR_BE_HAS_DLL)
+# define TAO_IFR_BE_HAS_DLL 1
+# endif /* ! TAO_IFR_BE_HAS_DLL */
+#endif
+
+#if defined (TAO_IFR_BE_HAS_DLL) && (TAO_IFR_BE_HAS_DLL == 1)
+# if defined (TAO_IFR_BE_BUILD_DLL)
+# define TAO_IFR_BE_Export ACE_Proper_Export_Flag
+# define TAO_IFR_BE_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_IFR_BE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_IFR_BE_BUILD_DLL */
+# define TAO_IFR_BE_Export ACE_Proper_Import_Flag
+# define TAO_IFR_BE_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_IFR_BE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_IFR_BE_BUILD_DLL */
+#else /* TAO_IFR_BE_HAS_DLL == 1 */
+# define TAO_IFR_BE_Export
+# define TAO_IFR_BE_SINGLETON_DECLARATION(T)
+# define TAO_IFR_BE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_IFR_BE_HAS_DLL == 1 */
+
+#endif /* TAO_IFR_BE_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/IFR_Service/be_extern.h b/TAO/orbsvcs/IFR_Service/be_extern.h
new file mode 100644
index 00000000000..e4beb71cfd2
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/be_extern.h
@@ -0,0 +1,86 @@
+// This may look like C, but it's really -*- C++ -*-
+// $Id$
+/*
+
+COPYRIGHT
+
+Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United
+States of America. All Rights Reserved.
+
+This product is protected by copyright and distributed under the following
+license restricting its use.
+
+The Interface Definition Language Compiler Front End (CFE) is made
+available for your use provided that you include this license and copyright
+notice on all media and documentation and the software program in which
+this product is incorporated in whole or part. You may copy and extend
+functionality (but may not remove functionality) of the Interface
+Definition Language CFE without charge, but you are not authorized to
+license or distribute it to anyone else except as part of a product or
+program developed by you or with the express written consent of Sun
+Microsystems, Inc. ("Sun").
+
+The names of Sun Microsystems, Inc. and any of its subsidiaries or
+affiliates may not be used in advertising or publicity pertaining to
+distribution of Interface Definition Language CFE as permitted herein.
+
+This license is effective until terminated by Sun for failure to comply
+with this license. Upon termination, you shall destroy or return all code
+and documentation for the Interface Definition Language CFE.
+
+INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF
+ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS
+FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF
+DEALING, USAGE OR TRADE PRACTICE.
+
+INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT
+ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES
+TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT.
+
+SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH
+RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY
+INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF.
+
+IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR
+ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL
+DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+Use, duplication, or disclosure by the government is subject to
+restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
+Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR
+52.227-19.
+
+Sun, Sun Microsystems and the Sun logo are trademarks or registered
+trademarks of Sun Microsystems, Inc.
+
+SunSoft, Inc.
+2550 Garcia Avenue
+Mountain View, California 94043
+
+NOTE:
+
+SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are
+trademarks or registered trademarks of Sun Microsystems, Inc.
+
+*/
+
+#ifndef TAO_IFR_BE_EXTERN_H
+#define TAO_IFR_BE_EXTERN_H
+
+#include "TAO_IFR_BE_Export.h"
+#include "be_global.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+extern TAO_IFR_BE_Export BE_GlobalData *be_global;
+
+extern TAO_IFR_BE_Export int BE_init (int &, char*[]);
+extern TAO_IFR_BE_Export void BE_post_init (char *[], long);
+extern TAO_IFR_BE_Export void BE_version (void);
+extern TAO_IFR_BE_Export void BE_produce (void);
+extern TAO_IFR_BE_Export void BE_cleanup (void);
+extern TAO_IFR_BE_Export void BE_abort (void);
+
+#endif /* TAO_IFR_BE_EXTERN_H */
diff --git a/TAO/orbsvcs/IFR_Service/be_global.cpp b/TAO/orbsvcs/IFR_Service/be_global.cpp
new file mode 100644
index 00000000000..023d4cb3c96
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/be_global.cpp
@@ -0,0 +1,245 @@
+// $Id$
+
+// ============================================================================
+//
+//
+// = LIBRARY
+// TAO_IFR_BE_DLL
+//
+// = FILENAME
+// be_global.cpp
+//
+// = DESCRIPTION
+// Stores global data specific to the compiler back end.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "be_global.h"
+#include "ast_generator.h"
+#include "global_extern.h"
+#include "idl_defines.h"
+
+ACE_RCSID (IFR_Service,
+ be_global,
+ "$Id$")
+
+TAO_IFR_BE_Export BE_GlobalData *be_global = 0;
+
+BE_GlobalData::BE_GlobalData (void)
+ : removing_ (false),
+ holding_scope_name_ (CORBA::string_dup ("TAO_IFR_holding_scope_module")),
+ filename_ (0),
+ enable_locking_ (false),
+ do_included_files_ (true)
+{
+ // At this point, the FE has been initialized. We can
+ // now instruct it that we want to preserve c++ keywords.
+ idl_global->preserve_cpp_keywords (true);
+}
+
+BE_GlobalData::~BE_GlobalData (void)
+{
+}
+
+bool
+BE_GlobalData::removing (void) const
+{
+ return this->removing_;
+}
+
+void
+BE_GlobalData::removing (bool value)
+{
+ this->removing_ = value;
+}
+
+CORBA::ORB_ptr
+BE_GlobalData::orb (void) const
+{
+ return this->orb_.in ();
+}
+
+void
+BE_GlobalData::orb (CORBA::ORB_ptr orb)
+{
+ this->orb_ = orb;
+}
+
+CORBA::Repository_ptr
+BE_GlobalData::repository (void) const
+{
+ return this->repository_.in ();
+}
+
+void
+BE_GlobalData::repository (CORBA::Repository_ptr repo)
+{
+ this->repository_ = repo;
+}
+
+CORBA::ModuleDef_ptr
+BE_GlobalData::holding_scope (void) const
+{
+ return this->holding_scope_.in ();
+}
+
+void
+BE_GlobalData::holding_scope (CORBA::ModuleDef_ptr scope)
+{
+ this->holding_scope_ = scope;
+}
+
+const char *
+BE_GlobalData::holding_scope_name (void) const
+{
+ return this->holding_scope_name_.in ();
+}
+
+ACE_Unbounded_Stack<CORBA::Container_ptr> &
+BE_GlobalData::ifr_scopes (void)
+{
+ return this->ifr_scopes_;
+}
+
+void
+BE_GlobalData::destroy (void)
+{
+}
+
+const char *
+BE_GlobalData::filename (void) const
+{
+ return this->filename_;
+}
+
+void
+BE_GlobalData::filename (char *fname)
+{
+ this->filename_ = fname;
+}
+
+bool
+BE_GlobalData::enable_locking (void) const
+{
+ return this->enable_locking_;
+}
+
+void
+BE_GlobalData::enable_locking (bool value)
+{
+ this->enable_locking_ = value;
+}
+
+bool
+BE_GlobalData::do_included_files (void) const
+{
+ return this->do_included_files_;
+}
+
+void
+BE_GlobalData::do_included_files (bool val)
+{
+ this->do_included_files_ = val;
+}
+
+ACE_CString
+BE_GlobalData::orb_args (void) const
+{
+ return this->orb_args_;
+}
+
+void
+BE_GlobalData::orb_args (const ACE_CString& args)
+{
+ this->orb_args_ = args;
+}
+
+ACE_CString
+BE_GlobalData::spawn_options (void)
+{
+ return this->orb_args_ + idl_global->idl_flags ();
+}
+
+void
+BE_GlobalData::parse_args (long &i, char **av)
+{
+ switch (av[i][1])
+ {
+ case 'L':
+ be_global->enable_locking (true);
+ break;
+ case 'r':
+ be_global->removing (true);
+ break;
+ case 'S':
+ // Suppress ...
+ if (av[i][2] == 'i')
+ {
+ // ... processing of included IDL files.
+ be_global->do_included_files (0);
+ }
+ else
+ {
+ ACE_ERROR ((
+ LM_ERROR,
+ ACE_TEXT ("IDL: I don't understand the '%s' option\n"),
+ av[i]
+ ));
+
+ ACE_OS::exit (99);
+ }
+ break;
+ default:
+ ACE_ERROR ((
+ LM_ERROR,
+ ACE_TEXT ("IDL: I don't understand the '%s' option\n"),
+ av[i]
+ ));
+
+ idl_global->set_compile_flags (idl_global->compile_flags ()
+ | IDL_CF_ONLY_USAGE);
+ break;
+ }
+}
+
+// Does nothing in this backend.
+void
+BE_GlobalData::prep_be_arg (char *)
+{
+}
+
+// Does nothing in this backend.
+void
+BE_GlobalData::arg_post_proc (void)
+{
+}
+
+void
+BE_GlobalData::usage (void) const
+{
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT (" -L\t\t\tEnable locking at the IDL file level\n")
+ ));
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT (" -r\t\t\tRemove contents of IDL file(s) from repository\n")
+ ));
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT (" -Si\t\t\tSuppress processing of included IDL files\n")
+ ));
+}
+
+AST_Generator *
+BE_GlobalData::generator_init (void)
+{
+ AST_Generator *gen = 0;
+ ACE_NEW_RETURN (gen,
+ AST_Generator,
+ 0);
+ return gen;
+}
diff --git a/TAO/orbsvcs/IFR_Service/be_global.h b/TAO/orbsvcs/IFR_Service/be_global.h
new file mode 100644
index 00000000000..6a0c17fccca
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/be_global.h
@@ -0,0 +1,137 @@
+/* -*- c++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO_IFR_BE_DLL
+//
+// = FILENAME
+// be_global.h
+//
+// = DESCRIPTION
+// Header file for class containing compiler back end global data.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_IFR_BE_GLOBAL_H
+#define TAO_IFR_BE_GLOBAL_H
+
+#include "TAO_IFR_BE_Export.h"
+#include "tao/IFR_Client/IFR_BasicC.h"
+#include "tao/ORB.h"
+#include "ace/Containers.h"
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class AST_Generator;
+
+// Defines a class containing all back end global data.
+
+class TAO_IFR_BE_Export BE_GlobalData
+{
+public:
+ // = TITLE
+ // BE_GlobalData
+ //
+ // = DESCRIPTION
+ // Storage of global data specific to the compiler back end
+ //
+ BE_GlobalData (void);
+ // Constructor.
+
+ virtual ~BE_GlobalData (void);
+ // Destructor.
+
+ // Data accessors.
+
+ bool removing (void) const;
+ void removing (bool value);
+
+ CORBA::ORB_ptr orb (void) const;
+ void orb (CORBA::ORB_ptr orb);
+
+ CORBA::Repository_ptr repository (void) const;
+ void repository (CORBA::Repository_ptr repo);
+
+ CORBA::ModuleDef_ptr holding_scope (void) const;
+ void holding_scope (CORBA::ModuleDef_ptr scope);
+
+ const char *holding_scope_name (void) const;
+
+ ACE_Unbounded_Stack<CORBA::Container_ptr> &ifr_scopes (void);
+
+ void destroy (void);
+ // Cleanup function.
+
+ const char *filename (void) const;
+ void filename (char *fname);
+
+ bool enable_locking (void) const;
+ void enable_locking (bool value);
+
+ bool do_included_files (void) const;
+ void do_included_files (bool val);
+
+ ACE_CString orb_args (void) const;
+ void orb_args (const ACE_CString& args);
+
+ ACE_CString spawn_options (void);
+ // Command line passed to ACE_Process::spawn. Different
+ // implementations in IDL and IFR backends.
+
+ void parse_args (long &i, char **av);
+ // Parse args that affect the backend.
+
+ void prep_be_arg (char *s);
+ // Special BE arg call factored out of DRV_args.
+
+ void arg_post_proc (void);
+ // Checks made after parsing args.
+
+ void usage (void) const;
+ // Display usage of BE-specific options.
+
+ AST_Generator *generator_init (void);
+ // Create an AST node generator.
+
+private:
+ bool removing_;
+ // Are we removing IR objects from the repository?
+
+ CORBA::ORB_var orb_;
+ // Reference to our ORB.
+
+ CORBA::Repository_var repository_;
+ // Reference to the interface repository.
+
+ CORBA::ModuleDef_var holding_scope_;
+ // Used to hold struct/union/exception member defns until
+ // they are moved into their permanent scope.
+
+ CORBA::String_var holding_scope_name_;
+ // Must be something unlikely to clash.
+
+ ACE_Unbounded_Stack<CORBA::Container_ptr> ifr_scopes_;
+ // IR object scope stack.
+
+ char *filename_;
+ // Name of the IDL file we are processing.
+
+ bool enable_locking_;
+ // Option to lock at the IDL file level.
+
+ bool do_included_files_;
+ // Option to process included IDL files.
+
+ ACE_CString orb_args_;
+ //Holder for -ORB args saved and passed to DRV_fork.
+};
+
+#endif /* TAO_IFR_BE_GLOBAL_H */
diff --git a/TAO/orbsvcs/IFR_Service/be_init.cpp b/TAO/orbsvcs/IFR_Service/be_init.cpp
new file mode 100644
index 00000000000..8327a82601f
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/be_init.cpp
@@ -0,0 +1,126 @@
+// $Id$
+
+#include "global_extern.h"
+#include "be_extern.h"
+#include "../../tao/Version.h"
+
+int
+BE_save_orb_args (int &argc, char *argv[])
+{
+ int i = 1;
+ ACE_CString holder;
+
+ while (i < argc)
+ {
+ if (ACE_OS::strncmp (argv[i], "-ORB", 4) == 0)
+ {
+ holder += ACE_CString (argv[i]);
+ holder += " ";
+
+ // Could be another -ORBxxx arg or an IDL compiler arg.
+ if (*argv[i + 1] == '-')
+ {
+ ++i;
+ continue;
+ }
+
+ // No-copy constructor.
+ ACE_CString tmp (argv[i + 1],
+ 0,
+ 0);
+
+ // If the arg ends with either .idl or .pidl, we're done.
+
+ size_t len = tmp.length ();
+ ssize_t pos = tmp.find (".idl");
+
+ if (len - pos == 4)
+ {
+ return 0;
+ }
+
+ pos = tmp.find (".pidl");
+
+ if (len - pos == 5)
+ {
+ return 0;
+ }
+
+ // If we're here, the next arg goes with the preceding -ORBxxx.
+ holder += tmp;
+ holder += " ";
+ i += 2;
+ }
+ else
+ {
+ ++i;
+ }
+ }
+
+ be_global->orb_args (holder);
+
+ return 0;
+}
+
+// 'ac' must be passed in by reference, because it is also
+// passed by reference to ORB_init, which may modify it.
+// After BE_ifr_init returns to main() the modified argc
+// must be passed to DRV_parse_args().
+int
+BE_ifr_orb_init (int &ac, char *av[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ be_global->orb (CORBA::ORB_init (ac,
+ av,
+ 0
+ ACE_ENV_ARG_PARAMETER));
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("BE_ifr_orb_init"));
+
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+TAO_IFR_BE_Export void
+BE_version (void)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "%s %s\n",
+ ACE_TEXT ("TAO_IFR_BE, version"),
+ ACE_TEXT (TAO_VERSION)));
+}
+
+TAO_IFR_BE_Export int
+BE_init (int &argc, char *argv[])
+{
+ // Initialize BE global data object.
+ ACE_NEW_RETURN (be_global,
+ BE_GlobalData,
+ -1);
+
+ int status = BE_save_orb_args (argc, argv);
+
+ if (status != 0)
+ {
+ return status;
+ }
+
+ idl_global->using_ifr_backend (true);
+
+ return BE_ifr_orb_init (argc, argv);
+}
+
+TAO_IFR_BE_Export void
+BE_post_init (char *[], long)
+{
+}
+
diff --git a/TAO/orbsvcs/IFR_Service/be_produce.cpp b/TAO/orbsvcs/IFR_Service/be_produce.cpp
new file mode 100644
index 00000000000..043d02b66dc
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/be_produce.cpp
@@ -0,0 +1,250 @@
+// $Id$
+
+/*
+
+COPYRIGHT
+
+Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United
+States of America. All Rights Reserved.
+
+This product is protected by copyright and distributed under the following
+license restricting its use.
+
+The Interface Definition Language Compiler Front End (CFE) is made
+available for your use provided that you include this license and copyright
+notice on all media and documentation and the software program in which
+this product is incorporated in whole or part. You may copy and extend
+functionality (but may not remove functionality) of the Interface
+Definition Language CFE without charge, but you are not authorized to
+license or distribute it to anyone else except as part of a product or
+program developed by you or with the express written consent of Sun
+Microsystems, Inc. ("Sun").
+
+The names of Sun Microsystems, Inc. and any of its subsidiaries or
+affiliates may not be used in advertising or publicity pertaining to
+distribution of Interface Definition Language CFE as permitted herein.
+
+This license is effective until terminated by Sun for failure to comply
+with this license. Upon termination, you shall destroy or return all code
+and documentation for the Interface Definition Language CFE.
+
+INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF
+ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS
+FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF
+DEALING, USAGE OR TRADE PRACTICE.
+
+INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT
+ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES
+TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT.
+
+SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH
+RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY
+INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF.
+
+IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR
+ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL
+DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+Use, duplication, or disclosure by the government is subject to
+restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
+Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR
+52.227-19.
+
+Sun, Sun Microsystems and the Sun logo are trademarks or registered
+trademarks of Sun Microsystems, Inc.
+
+SunSoft, Inc.
+2550 Garcia Avenue
+Mountain View, California 94043
+
+NOTE:
+
+SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are
+trademarks or registered trademarks of Sun Microsystems, Inc.
+
+ */
+
+// BE_produce.cc - Produce the work of the BE - does nothing in the
+// dummy BE
+
+#include "global_extern.h"
+#include "TAO_IFR_BE_Export.h"
+#include "be_extern.h"
+#include "fe_extern.h"
+#include "ast_root.h"
+#include "ifr_visitor_macro.h"
+#include "ifr_removing_visitor.h"
+#include "ifr_adding_visitor.h"
+
+ACE_RCSID (be,
+ be_produce,
+ "$Id$")
+
+// Clean up before exit, whether successful or not.
+TAO_IFR_BE_Export void
+BE_cleanup (void)
+{
+ idl_global->destroy ();
+}
+
+// Abort this run of the BE.
+TAO_IFR_BE_Export void
+BE_abort (void)
+{
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Fatal Error - Aborting\n")));
+
+ // BE_cleanup will be called after the exception is caught.
+ throw FE_Bailout ();
+}
+
+void
+BE_create_holding_scope (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::ModuleDef_ptr scope = CORBA::ModuleDef::_nil ();
+
+ // If we are multi-threaded, it may already be created.
+ CORBA::Contained_var result =
+ be_global->repository ()->lookup_id (be_global->holding_scope_name ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Will live until the repository goes away for good.
+ if (CORBA::is_nil (result.in ()))
+ {
+ scope =
+ be_global->repository ()->create_module (
+ be_global->holding_scope_name (),
+ be_global->holding_scope_name (),
+ "1.0"
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+ }
+ else
+ {
+ scope = CORBA::ModuleDef::_narrow (result.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ be_global->holding_scope (scope);
+}
+
+int
+BE_ifr_repo_init (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_var object =
+ be_global->orb ()->resolve_initial_references ("InterfaceRepository"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (object.in ()))
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("Null objref from resolve_initial_references\n")
+ ),
+ -1
+ );
+ }
+
+ CORBA::Repository_var repo =
+ CORBA::Repository::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (repo.in ()))
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("CORBA::Repository::_narrow failed\n")
+ ),
+ -1
+ );
+ }
+
+ be_global->repository (repo._retn ());
+
+ return 0;
+}
+
+// Do the work of this BE. This is the starting point for code generation.
+TAO_IFR_BE_Export void
+BE_produce (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int status = BE_ifr_repo_init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status != 0)
+ {
+ return;
+ }
+
+ BE_create_holding_scope (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the root node.
+ AST_Decl *d = idl_global->root ();
+ AST_Root *root = AST_Root::narrow_from_decl (d);
+
+ if (root == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%N:%l) BE_produce - ")
+ ACE_TEXT ("No Root\n")));
+
+ BE_abort ();
+ }
+
+ if (be_global->removing ())
+ {
+ ifr_removing_visitor visitor;
+
+ TAO_IFR_VISITOR_WRITE_GUARD;
+
+ // If the visitor is dispatched this way, we need to override
+ // only visit_scope() for the removing visitor.
+ if (visitor.visit_scope (root) == -1)
+ {
+ ACE_ERROR ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) BE_produce -")
+ ACE_TEXT (" failed to accept removing visitor\n")
+ ));
+
+ BE_abort ();
+ }
+ }
+ else
+ {
+ ifr_adding_visitor visitor (d);
+
+ TAO_IFR_VISITOR_WRITE_GUARD;
+
+ if (root->ast_accept (&visitor) == -1)
+ {
+ ACE_ERROR ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) BE_produce -")
+ ACE_TEXT (" failed to accept adding visitor\n")
+ ));
+
+ BE_abort ();
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("BE_produce"));
+
+ }
+ ACE_ENDTRY;
+
+ // Clean up.
+ BE_cleanup ();
+}
diff --git a/TAO/orbsvcs/IFR_Service/drv_args.cpp b/TAO/orbsvcs/IFR_Service/drv_args.cpp
new file mode 100644
index 00000000000..d7f5a0951ff
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/drv_args.cpp
@@ -0,0 +1,11 @@
+// -*- C++ -*-
+// $Id$
+
+// This file is here to avoid the use of VPATH. Since the TAO_IDL
+// counterparts are built with a different BE_GlobalData definition, the
+// object files built in the TAO_IDL directory are not usable in the
+// IFRService. The BE_GlobalData is larger in TAO_IDL than it is in
+// IFRService which causes problems when be_global is deleted.
+// -- Chad Elliott 12/16/2004
+
+#include "TAO_IDL/driver/drv_args.cpp"
diff --git a/TAO/orbsvcs/IFR_Service/drv_init_ifr.cpp b/TAO/orbsvcs/IFR_Service/drv_init_ifr.cpp
new file mode 100644
index 00000000000..a2916004551
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/drv_init_ifr.cpp
@@ -0,0 +1,130 @@
+// $Id$
+
+/*
+
+COPYRIGHT
+
+Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United
+States of America. All Rights Reserved.
+
+This product is protected by copyright and distributed under the following
+license restricting its use.
+
+The Interface Definition Language Compiler Front End (CFE) is made
+available for your use provided that you include this license and copyright
+notice on all media and documentation and the software program in which
+this product is incorporated in whole or part. You may copy and extend
+functionality (but may not remove functionality) of the Interface
+Definition Language CFE without charge, but you are not authorized to
+license or distribute it to anyone else except as part of a product or
+program developed by you or with the express written consent of Sun
+Microsystems, Inc. ("Sun").
+
+The names of Sun Microsystems, Inc. and any of its subsidiaries or
+affiliates may not be used in advertising or publicity pertaining to
+distribution of Interface Definition Language CFE as permitted herein.
+
+This license is effective until terminated by Sun for failure to comply
+with this license. Upon termination, you shall destroy or return all code
+and documentation for the Interface Definition Language CFE.
+
+INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF
+ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS
+FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF
+DEALING, USAGE OR TRADE PRACTICE.
+
+INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT
+ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES
+TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT.
+
+SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH
+RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY
+INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF.
+
+IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR
+ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL
+DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+Use, duplication, or disclosure by the government is subject to
+restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
+Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR
+52.227-19.
+
+Sun, Sun Microsystems and the Sun logo are trademarks or registered
+trademarks of Sun Microsystems, Inc.
+
+SunSoft, Inc.
+2550 Garcia Avenue
+Mountain View, California 94043
+
+NOTE:
+
+SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are
+trademarks or registered trademarks of Sun Microsystems, Inc.
+
+*/
+
+// Initialization for IDL compiler driver program
+
+#include "idl.h"
+#include "idl_extern.h"
+#include "drv_private_ifr.h"
+#include "be_extern.h"
+
+ACE_RCSID(IFR_Service, drv_init_ifr, "$Id$")
+
+const size_t LOCAL_ESCAPES_BUFFER_SIZE = 1024;
+
+void
+DRV_init (void)
+{
+ // Initialize FE global data object.
+ ACE_NEW (idl_global,
+ IDL_GlobalData);
+
+ // Initialize some of its data.
+ idl_global->set_root (0);
+ idl_global->set_gen (0);
+ idl_global->set_err (FE_new_UTL_Error ());
+ idl_global->set_err_count (0);
+ idl_global->set_indent (FE_new_UTL_Indenter ());
+ idl_global->set_filename (0);
+ idl_global->set_main_filename (0);
+ idl_global->set_real_filename (0);
+ idl_global->set_stripped_filename (0);
+ idl_global->set_import (I_TRUE);
+ idl_global->set_in_main_file (I_FALSE);
+ idl_global->set_lineno (-1);
+ idl_global->set_prog_name (0);
+
+#if defined (TAO_IDL_PREPROCESSOR)
+ idl_global->set_cpp_location (TAO_IDL_PREPROCESSOR);
+#elif defined (ACE_CC_PREPROCESSOR)
+ idl_global->set_cpp_location (ACE_CC_PREPROCESSOR);
+#else
+ // Just default to cc.
+ idl_global->set_cpp_location ("cc");
+#endif /* TAO_IDL_PREPROCESSOR */
+
+ char local_escapes[LOCAL_ESCAPES_BUFFER_SIZE];
+ ACE_OS::memset (&local_escapes,
+ 0,
+ LOCAL_ESCAPES_BUFFER_SIZE);
+
+ idl_global->set_local_escapes (local_escapes);
+ idl_global->set_be ("");
+ idl_global->set_compile_flags (0);
+ idl_global->set_read_from_stdin (I_FALSE);
+ idl_global->set_include_file_names (0);
+ idl_global->set_n_include_file_names (0);
+ idl_global->set_parse_state (IDL_GlobalData::PS_NoState);
+
+ // Initialize BE global data object.
+ ACE_NEW (be_global,
+ BE_GlobalData);
+
+ // Initialize driver private data.
+ DRV_nfiles = 0;
+ DRV_file_index = 0;
+}
+
diff --git a/TAO/orbsvcs/IFR_Service/drv_preproc.cpp b/TAO/orbsvcs/IFR_Service/drv_preproc.cpp
new file mode 100644
index 00000000000..a277283542d
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/drv_preproc.cpp
@@ -0,0 +1,11 @@
+// -*- C++ -*-
+// $Id$
+
+// This file is here to avoid the use of VPATH. Since the TAO_IDL
+// counterparts are built with a different BE_GlobalData definition, the
+// object files built in the TAO_IDL directory are not usable in the
+// IFRService. The BE_GlobalData is larger in TAO_IDL than it is in
+// IFRService which causes problems when be_global is deleted.
+// -- Chad Elliott 12/16/2004
+
+#include "TAO_IDL/driver/drv_preproc.cpp"
diff --git a/TAO/orbsvcs/IFR_Service/drv_private_ifr.cpp b/TAO/orbsvcs/IFR_Service/drv_private_ifr.cpp
new file mode 100644
index 00000000000..f83d85a62fa
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/drv_private_ifr.cpp
@@ -0,0 +1,83 @@
+// $Id$
+
+/*
+
+COPYRIGHT
+
+Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United
+States of America. All Rights Reserved.
+
+This product is protected by copyright and distributed under the following
+license restricting its use.
+
+The Interface Definition Language Compiler Front End (CFE) is made
+available for your use provided that you include this license and copyright
+notice on all media and documentation and the software program in which
+this product is incorporated in whole or part. You may copy and extend
+functionality (but may not remove functionality) of the Interface
+Definition Language CFE without charge, but you are not authorized to
+license or distribute it to anyone else except as part of a product or
+program developed by you or with the express written consent of Sun
+Microsystems, Inc. ("Sun").
+
+The names of Sun Microsystems, Inc. and any of its subsidiaries or
+affiliates may not be used in advertising or publicity pertaining to
+distribution of Interface Definition Language CFE as permitted herein.
+
+This license is effective until terminated by Sun for failure to comply
+with this license. Upon termination, you shall destroy or return all code
+and documentation for the Interface Definition Language CFE.
+
+INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF
+ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS
+FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF
+DEALING, USAGE OR TRADE PRACTICE.
+
+INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT
+ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES
+TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT.
+
+SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH
+RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY
+INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF.
+
+IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR
+ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL
+DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+Use, duplication, or disclosure by the government is subject to
+restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
+Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR
+52.227-19.
+
+Sun, Sun Microsystems and the Sun logo are trademarks or registered
+trademarks of Sun Microsystems, Inc.
+
+SunSoft, Inc.
+2550 Garcia Avenue
+Mountain View, California 94043
+
+NOTE:
+
+SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are
+trademarks or registered trademarks of Sun Microsystems, Inc.
+
+*/
+
+// Global variables for IDL compiler driver program
+
+#include "idl.h"
+#include "idl_extern.h"
+#include "drv_private_ifr.h"
+
+ACE_RCSID(IFR_Service, drv_private_ifr, "$Id$")
+
+// Storage for file names
+
+#if !defined (NFILES)
+# define NFILES 1024
+#endif /* ! NFILES */
+
+const char *DRV_files[NFILES];
+long DRV_nfiles = 0;
+long DRV_file_index = -1;
diff --git a/TAO/orbsvcs/IFR_Service/drv_private_ifr.h b/TAO/orbsvcs/IFR_Service/drv_private_ifr.h
new file mode 100644
index 00000000000..e901e9a97be
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/drv_private_ifr.h
@@ -0,0 +1,92 @@
+// $Id$
+
+/*
+
+COPYRIGHT
+
+Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United
+States of America. All Rights Reserved.
+
+This product is protected by copyright and distributed under the following
+license restricting its use.
+
+The Interface Definition Language Compiler Front End (CFE) is made
+available for your use provided that you include this license and copyright
+notice on all media and documentation and the software program in which
+this product is incorporated in whole or part. You may copy and extend
+functionality (but may not remove functionality) of the Interface
+Definition Language CFE without charge, but you are not authorized to
+license or distribute it to anyone else except as part of a product or
+program developed by you or with the express written consent of Sun
+Microsystems, Inc. ("Sun").
+
+The names of Sun Microsystems, Inc. and any of its subsidiaries or
+affiliates may not be used in advertising or publicity pertaining to
+distribution of Interface Definition Language CFE as permitted herein.
+
+This license is effective until terminated by Sun for failure to comply
+with this license. Upon termination, you shall destroy or return all code
+and documentation for the Interface Definition Language CFE.
+
+INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF
+ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS
+FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF
+DEALING, USAGE OR TRADE PRACTICE.
+
+INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT
+ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES
+TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT.
+
+SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH
+RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY
+INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF.
+
+IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR
+ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL
+DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+Use, duplication, or disclosure by the government is subject to
+restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
+Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR
+52.227-19.
+
+Sun, Sun Microsystems and the Sun logo are trademarks or registered
+trademarks of Sun Microsystems, Inc.
+
+SunSoft, Inc.
+2550 Garcia Avenue
+Mountain View, California 94043
+
+NOTE:
+
+SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are
+trademarks or registered trademarks of Sun Microsystems, Inc.
+
+*/
+
+#ifndef TAO_IFR_DRV_PRIVATE_H
+#define TAO_IFR_DRV_PRIVATE_H
+
+// Define data and functions which are private to
+// the DRV but which must be accessible throughout the DRV
+
+// Data
+
+// The ACE_Process_Options default size of 1024 is sometimes not enough.
+const unsigned long TAO_IDL_COMMAND_LINE_BUFFER_SIZE = 4 * 1024;
+
+extern const char *DRV_files[];
+// All files to be processed.
+
+extern long DRV_nfiles;
+// How many are there?
+
+extern long DRV_file_index;
+// What's the file I am responsible for?
+
+// Functions.
+
+extern void DRV_drive (const char *);
+// Compiler driver for single file.
+
+#endif /* TAO_IFR_DRV_PRIVATE_H */
diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp
new file mode 100644
index 00000000000..31f082877d2
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp
@@ -0,0 +1,4470 @@
+/* -*- c++ -*- */
+// $Id$
+
+#include "ast_argument.h"
+#include "ast_array.h"
+#include "ast_attribute.h"
+#include "ast_component.h"
+#include "ast_component_fwd.h"
+#include "ast_constant.h"
+#include "ast_enum.h"
+#include "ast_eventtype.h"
+#include "ast_eventtype_fwd.h"
+#include "ast_exception.h"
+#include "ast_expression.h"
+#include "ast_factory.h"
+#include "ast_field.h"
+#include "ast_home.h"
+#include "ast_interface.h"
+#include "ast_interface_fwd.h"
+#include "ast_module.h"
+#include "ast_native.h"
+#include "ast_operation.h"
+#include "ast_predefined_type.h"
+#include "ast_root.h"
+#include "ast_sequence.h"
+#include "ast_string.h"
+#include "ast_structure.h"
+#include "ast_union.h"
+#include "ast_valuebox.h"
+#include "ast_valuetype.h"
+#include "ast_valuetype_fwd.h"
+#include "utl_identifier.h"
+#include "utl_string.h"
+#include "utl_exceptlist.h"
+#include "nr_extern.h"
+
+#include "ifr_adding_visitor.h"
+#include "ifr_adding_visitor_operation.h"
+#include "ifr_adding_visitor_structure.h"
+#include "ifr_adding_visitor_exception.h"
+#include "ifr_adding_visitor_union.h"
+
+#include "tao/IFR_Client/IFR_ComponentsC.h"
+
+#include "ace/Vector_T.h"
+
+ACE_RCSID (IFR_Service,
+ ifr_adding_visitor,
+ "$Id$")
+
+ifr_adding_visitor::ifr_adding_visitor (AST_Decl *scope,
+ CORBA::Boolean in_reopened)
+ : scope_ (scope),
+ in_reopened_ (in_reopened)
+{
+}
+
+ifr_adding_visitor::~ifr_adding_visitor (void)
+{
+}
+
+int
+ifr_adding_visitor::visit_scope (UTL_Scope *node)
+{
+ // Proceed if the number of members in our scope is greater than 0.
+ if (node->nmembers () > 0)
+ {
+ // Initialize an iterator to iterate over our scope.
+ UTL_ScopeActiveIterator si (node,
+ UTL_Scope::IK_decls);
+
+ AST_Decl *d = 0;
+
+ // Continue until each element is visited.
+ while (!si.is_done ())
+ {
+ d = si.item ();
+
+ if (d == 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::visit_scope -")
+ ACE_TEXT (" bad node in this scope\n")
+ ),
+ -1
+ );
+ }
+
+ // These are created at startup in the repository, and
+ // need not be dealt with here.
+ if (d->node_type () == AST_Decl::NT_pre_defined)
+ {
+ si.next ();
+ continue;
+ }
+
+ if (d->ast_accept (this) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::visit_scope -")
+ ACE_TEXT (" failed to accept visitor\n")
+ ),
+ -1
+ );
+ }
+
+ si.next ();
+ }
+ }
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_predefined_type (AST_PredefinedType *node)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->ir_current_ =
+ be_global->repository ()->get_primitive (
+ this->predefined_type_to_pkind (node)
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_predefined_type"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_module (AST_Module *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ CORBA::Container_var new_def;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // If this module been opened before, it will already be in
+ // the repository.
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ // New module.
+ CORBA::Container_ptr container =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (container) == 0)
+ {
+ new_def = container->create_module (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::visit_module -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+ }
+ else
+ {
+ CORBA::DefinitionKind kind =
+ prev_def->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (kind == CORBA::dk_Module)
+ {
+ // We are either in a reopened module, are processing an IDL
+ // IDL file for the second time, or are in a module whose
+ // name already exists by coincidence - there is no way to
+ // tell the difference. So any members whose repository ID
+ // already exists in this case will throw BAD_PARAM
+ // when we attempt to add them to the repository.
+ this->in_reopened_ = 1;
+
+ new_def =
+ CORBA::ComponentIR::Container::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ if (be_global->ifr_scopes ().push (new_def.in ()) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::visit_module -")
+ ACE_TEXT (" scope push failed\n")
+ ),
+ -1
+ );
+ }
+
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::visit_module -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ this->in_reopened_ = 0;
+ CORBA::Container_ptr tmp =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().pop (tmp) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::visit_module -")
+ ACE_TEXT (" scope pop failed\n")
+ ),
+ -1
+ );
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_module"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_interface (AST_Interface *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this interface already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If not, create a new entry.
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ int status = this->create_interface_def (node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return status;
+ }
+ else
+ {
+ // There is already an entry in the repository. If the interface is
+ // defined and has not already been populated, we do so
+ // now. If it is not yet defined or the full definition has already
+ // been added to the repository, we just update the current IR object
+ // holder.
+ if (node->is_defined ()
+ && node->ifr_added () == 0
+ && this->in_reopened_ == 0)
+ {
+ // If we are here and the line below is true, then either
+ // 1. We are defining an undefined forward declared interface
+ // from a previously processed IDL file, or
+ // 2. We are clobbering a previous definition, either of an
+ // interface or of some other type.
+ // 3. We are inside a module that has a previous entry.
+ // If prev_def would narrow successfully to an InterfaceDef, we
+ // have NO WAY of knowing if we are defining or clobbering. So
+ // we destroy the contents of the previous entry (we don't want
+ // to destroy the entry itself, since it may have already been
+ // made a member of some other entry, and destroying it would
+ // make the containing entry's section key invalid) and repopulate.
+ // On the other hand, if prev_def is NOT an interface, we can
+ // safely destroy it, since we know we are not redefining a
+ // previous entry, forward declared or not.
+ // If we are inside a module that was seen before, we could be
+ // just processing an IDL file a second time, in which case we
+ // again just update ir_current_.
+ if (node->ifr_fwd_added () == 0)
+ {
+ CORBA::DefinitionKind kind =
+ prev_def->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (kind == CORBA::dk_Interface)
+ {
+ CORBA::InterfaceDef_var iface =
+ CORBA::InterfaceDef::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ContainedSeq_var contents =
+ iface->contents (CORBA::dk_all,
+ 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ULong length = contents->length ();
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ contents[i]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ else
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int status = this->create_interface_def (node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return status;
+ }
+ }
+
+ CORBA::ULong n_parents = static_cast<CORBA::ULong> (node->n_inherits ());
+
+ CORBA::InterfaceDefSeq bases (n_parents);
+ bases.length (n_parents);
+ CORBA::Contained_var result;
+
+ AST_Interface **parents = node->inherits ();
+
+ // Construct a list of the parents.
+ for (CORBA::ULong i = 0; i < n_parents; ++i)
+ {
+ result =
+ be_global->repository ()->lookup_id (parents[i]->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If one of our interface's parents is not in the repository,
+ // that means that it has not yet been seen (even as a
+ // forward declaration) in the IDL file, and we will have to
+ // postpone the populating of our interface until they are all
+ // added.
+ if (CORBA::is_nil (result.in ()))
+ {
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK
+
+ return 0;
+ }
+
+ bases[i] =
+ CORBA::InterfaceDef::_narrow (result.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (bases[i]))
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_interface -")
+ ACE_TEXT (" CORBA::InterfaceDef::_narrow failed\n")
+ ),
+ -1
+ );
+ }
+ }
+
+ CORBA::InterfaceDef_var extant_def =
+ CORBA::InterfaceDef::_narrow (prev_def. in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ extant_def->base_interfaces (bases
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK
+
+ node->ifr_added (1);
+
+ // Push the new IR object onto the scope stack.
+ if (be_global->ifr_scopes ().push (extant_def.in ()) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_interface -")
+ ACE_TEXT (" scope push failed\n")
+ ),
+ -1
+ );
+ }
+
+ // Visit the members, if any.
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_interface -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ // This spot in the AST doesn't necessarily have to be the
+ // interface definition - it could be any reference to it.
+ // The front end will already have fully defined it, so all
+ // the info is available anywhere. So it's a good idea to
+ // update the current IR object holder now.
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (extant_def.in ());
+
+ CORBA::Container_ptr used_scope =
+ CORBA::Container::_nil ();
+
+ // Pop the new IR object back off the scope stack.
+ if (be_global->ifr_scopes ().pop (used_scope) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_interface -")
+ ACE_TEXT (" scope pop failed\n")
+ ),
+ -1
+ );
+ }
+ }
+ else
+ {
+ // @@ (JP) I think we're ok here without a check:
+ // not defined/not added - visit_interface_fwd will have
+ // detected a clobber.
+ // not defined/added - not possible.
+ // defined/not added - takes the other branch.
+ // defined/added - we're ok.
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_interface"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_interface_fwd (AST_InterfaceFwd *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ AST_Interface *i = node->full_definition ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this interface already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (i->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ // If our full definition is found in this IDL file, we go
+ // ahead and create the full entry now.
+ // The forward declared interface is not defined anywhere
+ // in this IDL file, so we just create an empty entry to
+ // be replaced by a full definition in some other IDL file.
+ CORBA::InterfaceDefSeq bases (0);
+ bases.length (0);
+
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ if (i->is_local ())
+ {
+ this->ir_current_ =
+ current_scope->create_local_interface (
+ i->repoID (),
+ i->local_name ()->get_string (),
+ i->version (),
+ bases
+ ACE_ENV_ARG_PARAMETER
+ );
+ }
+ else
+ {
+ this->ir_current_ =
+ current_scope->create_interface (
+ i->repoID (),
+ i->local_name ()->get_string (),
+ i->version (),
+ bases
+ ACE_ENV_ARG_PARAMETER
+ );
+ }
+
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_interface_fwd -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ node->ifr_added (1);
+ i->ifr_fwd_added (1);
+ }
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_interface_fwd"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_valuebox (AST_ValueBox *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->element_type (node->boxed_type ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ this->ir_current_ =
+ current_scope->create_value_box (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ this->ir_current_.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::visit_valuebox -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ node->ifr_added (1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_valuebox"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_valuetype (AST_ValueType *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this interface already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If not, create a new entry.
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ int status = this->create_value_def (node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return status;
+ }
+ else
+ {
+ // There is already an entry in the repository. If the interface is
+ // defined and has not already been populated, we do so
+ // now. If it is not yet defined or the full definition has already
+ // been added to the repository, we just update the current IR object
+ // holder.
+ if (node->is_defined ()
+ && node->ifr_added () == 0
+ && this->in_reopened_ == 0)
+ {
+ // If we are here and the line below is true, then either
+ // 1. We are defining an undefined forward declared interface
+ // from a previously processed IDL file, or
+ // 2. We are clobbering a previous definition, either of an
+ // interface or of some other type.
+ // 3. We are inside a module that has a previous entry.
+ // If prev_def would narrow successfully to an InterfaceDef, we
+ // have NO WAY of knowing if we are defining or clobbering. So
+ // we destroy the contents of the previous entry (we don't want
+ // to destroy the entry itself, since it may have already been
+ // made a member of some other entry, and destroying it would
+ // make the containing entry's key invalid) and repopulate.
+ // On the other hand, if prev_def is NOT an interface, we can
+ // safely destroy it, since we know we are not redefining a
+ // previous entry, forward declared or not.
+ // If we are inside a module that was seen before, we could be
+ // just processing an IDL file a second time, in which case we
+ // again just update ir_current_.
+ if (node->ifr_fwd_added () == 0)
+ {
+ CORBA::DefinitionKind kind =
+ prev_def->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (kind == CORBA::dk_Value)
+ {
+ CORBA::ValueDef_var value =
+ CORBA::ValueDef::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ContainedSeq_var contents =
+ value->contents (CORBA::dk_all,
+ 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ULong length = contents->length ();
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ contents[i]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ else
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int status =
+ this->create_value_def (node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return status;
+ }
+ }
+
+ // Our previous definition is a valuetype, so narrow it here,
+ // then populate it.
+ CORBA::ExtValueDef_var extant_def =
+ CORBA::ExtValueDef::_narrow (prev_def. in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Concrete base value.
+
+ CORBA::ValueDef_var base_vt;
+ this->fill_base_value (base_vt.out (),
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ extant_def->base_value (base_vt.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Abstract base values.
+
+ CORBA::ValueDefSeq abstract_base_values;
+ this->fill_abstract_base_values (abstract_base_values,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ extant_def->abstract_base_values (abstract_base_values
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Supported interfaces.
+
+ CORBA::InterfaceDefSeq supported;
+ this->fill_supported_interfaces (supported,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ extant_def->supported_interfaces (supported
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Intializers.
+
+ CORBA::ExtInitializerSeq initializers;
+ this->fill_initializers (initializers,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ extant_def->ext_initializers (initializers
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Truncatable, abstract, custom.
+
+ extant_def->is_abstract (static_cast<CORBA::Boolean> (node->is_abstract ())
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ extant_def->is_truncatable (static_cast<CORBA::Boolean> (node->truncatable ())
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ extant_def->is_custom (static_cast<CORBA::Boolean> (node->custom ())
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ node->ifr_added (1);
+
+ // Push the new IR object onto the scope stack before visiting
+ // the new object's scope.
+ if (be_global->ifr_scopes ().push (extant_def.in ()) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_valuetype -")
+ ACE_TEXT (" scope push failed\n")
+ ),
+ -1
+ );
+ }
+
+ // Visit the members, if any.
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_valuetype -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ // This spot in the AST doesn't necessarily have to be the
+ // interface definition - it could be any reference to it.
+ // The front end will already have fully defined it, so all
+ // the info is available anywhere. So it's a good idea to
+ // update the current IR object holder now.
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (extant_def.in ());
+
+ CORBA::Container_ptr used_scope =
+ CORBA::Container::_nil ();
+
+ // Pop the new IR object back off the scope stack.
+ if (be_global->ifr_scopes ().pop (used_scope) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_valuetype -")
+ ACE_TEXT (" scope pop failed\n")
+ ),
+ -1
+ );
+ }
+ }
+ else
+ {
+ // @@ (JP) I think we're ok here without a check:
+ // not defined/not added - visit_valuetype_fwd will have
+ // detected a clobber.
+ // not defined/added - not possible.
+ // defined/not added - takes the other branch.
+ // defined/added - we're ok.
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_valuetype"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_valuetype_fwd (AST_ValueTypeFwd *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ AST_Interface *v = node->full_definition ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this interface already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (v->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ // If our full definition is found in this IDL file, we go
+ // ahead and create the full entry now.
+ // The forward declared valuetype is not defined anywhere
+ // in this IDL file, so we just create an empty entry to
+ // be replaced by a full definition in some other IDL file.
+ CORBA::ValueDefSeq abstract_bases (0);
+ abstract_bases.length (0);
+ CORBA::InterfaceDefSeq supported (0);
+ supported.length (0);
+ CORBA::InitializerSeq initializers (0);
+ initializers.length (0);
+
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ CORBA::Boolean abstract =
+ static_cast<CORBA::Boolean> (v->is_abstract ());
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ this->ir_current_ =
+ current_scope->create_value (
+ v->repoID (),
+ v->local_name ()->get_string (),
+ v->version (),
+ 0, // 'custom' not handled yet
+ abstract,
+ CORBA::ValueDef::_nil (),
+ 0, // 'truncatable' not handled yet
+ abstract_bases,
+ supported,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_valuetype_fwd -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ node->ifr_added (1);
+ v->ifr_fwd_added (1);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_valuetype_fwd"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_component (AST_Component *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this interface already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If not, create a new entry.
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ int status = this->create_component_def (node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return status;
+ }
+ else
+ {
+ // There is already an entry in the repository. If the interface is
+ // defined and has not already been populated, we do so
+ // now. If it is not yet defined or the full definition has already
+ // been added to the repository, we just update the current IR object
+ // holder.
+ if (node->is_defined ()
+ && node->ifr_added () == 0
+ && this->in_reopened_ == 0)
+ {
+ // If we are here and the line below is true, then either
+ // 1. We are defining an undefined forward declared interface
+ // from a previously processed IDL file, or
+ // 2. We are clobbering a previous definition, either of an
+ // interface or of some other type.
+ // 3. We are inside a module that has a previous entry.
+ // If prev_def would narrow successfully to an InterfaceDef, we
+ // have NO WAY of knowing if we are defining or clobbering. So
+ // we destroy the contents of the previous entry (we don't want
+ // to destroy the entry itself, since it may have already been
+ // made a member of some other entry, and destroying it would
+ // make the containing entry's key invalid) and repopulate.
+ // On the other hand, if prev_def is NOT an interface, we can
+ // safely destroy it, since we know we are not redefining a
+ // previous entry, forward declared or not.
+ // If we are inside a module that was seen before, we could be
+ // just processing an IDL file a second time, in which case we
+ // again just update ir_current_.
+ if (node->ifr_fwd_added () == 0)
+ {
+ CORBA::DefinitionKind kind =
+ prev_def->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (kind == CORBA::dk_Component)
+ {
+ CORBA::ComponentIR::ComponentDef_var value =
+ CORBA::ComponentIR::ComponentDef::_narrow (
+ prev_def.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+
+ CORBA::ContainedSeq_var contents =
+ value->contents (CORBA::dk_all,
+ 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ULong length = contents->length ();
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ contents[i]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ else
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int status =
+ this->create_component_def (node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return status;
+ }
+ }
+
+ // Re-populate the repository entry.
+
+ CORBA::ComponentIR::ComponentDef_var extant_def =
+ CORBA::ComponentIR::ComponentDef::_narrow (
+ prev_def.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+
+ CORBA::InterfaceDefSeq supported_interfaces;
+ this->fill_supported_interfaces (supported_interfaces,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ extant_def->supported_interfaces (supported_interfaces
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ComponentIR::ComponentDef_var base_component;
+ this->fill_base_component (base_component.out (),
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ extant_def->base_component (base_component.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->visit_all_provides (node,
+ extant_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->visit_all_uses (node,
+ extant_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->visit_all_emits (node,
+ extant_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->visit_all_publishes (node,
+ extant_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->visit_all_consumes (node,
+ extant_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ node->ifr_added (1);
+
+ // Push the new IR object onto the scope stack before visiting
+ // the new object's scope.
+ if (be_global->ifr_scopes ().push (extant_def.in ()) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_component -")
+ ACE_TEXT (" scope push failed\n")
+ ),
+ -1
+ );
+ }
+
+ // Visit the members, if any.
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_component -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ // This spot in the AST doesn't necessarily have to be the
+ // interface definition - it could be any reference to it.
+ // The front end will already have fully defined it, so all
+ // the info is available anywhere. So it's a good idea to
+ // update the current IR object holder now.
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (extant_def.in ());
+
+ CORBA::Container_ptr used_scope =
+ CORBA::Container::_nil ();
+
+ // Pop the new IR object back off the scope stack.
+ if (be_global->ifr_scopes ().pop (used_scope) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_interface -")
+ ACE_TEXT (" scope pop failed\n")
+ ),
+ -1
+ );
+ }
+ }
+ else
+ {
+ // @@ (JP) I think we're ok here without a check:
+ // not defined/not added - visit_interface_fwd will have
+ // detected a clobber.
+ // not defined/added - not possible.
+ // defined/not added - takes the other branch.
+ // defined/added - we're ok.
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_component"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_component_fwd (AST_ComponentFwd *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ AST_Component *c =
+ AST_Component::narrow_from_decl (node->full_definition ());
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this interface already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (c->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ CORBA::ComponentIR::Container_var ccm_scope =
+ CORBA::ComponentIR::Container::_narrow (
+ current_scope
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+
+ // If our full definition is found in this IDL file, we go
+ // ahead and create the full entry now.
+ // The forward declared component is not defined anywhere
+ // in this IDL file, so we just create an empty entry to
+ // be replaced by a full definition later.
+ CORBA::InterfaceDefSeq supported_interfaces;
+ supported_interfaces.length (0);
+ CORBA::ComponentIR::ComponentDef_var base_component;
+
+
+ if (node->is_defined ())
+ {
+ this->fill_supported_interfaces (supported_interfaces,
+ c
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->fill_base_component (base_component.out (),
+ c
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ this->ir_current_ =
+ ccm_scope->create_component (
+ c->repoID (),
+ c->local_name ()->get_string (),
+ c->version (),
+ base_component.in (),
+ supported_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+
+ // Might as well go ahead and complete the repository
+ // entry now, if we can - we're halfway there already.
+ if (node->is_defined ())
+ {
+ CORBA::ComponentIR::ComponentDef_var new_def =
+ CORBA::ComponentIR::ComponentDef::_narrow (
+ this->ir_current_.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+
+ this->visit_all_provides (c,
+ new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->visit_all_uses (c,
+ new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->visit_all_emits (c,
+ new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->visit_all_publishes (c,
+ new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->visit_all_consumes (c,
+ new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_component_fwd -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ node->ifr_added (1);
+ c->ifr_fwd_added (1);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_component_fwd"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_eventtype (AST_EventType *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this interface already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If not, create a new entry.
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ int status = this->create_event_def (node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return status;
+ }
+ else
+ {
+ // There is already an entry in the repository. If the interface is
+ // defined and has not already been populated, we do so
+ // now. If it is not yet defined or the full definition has already
+ // been added to the repository, we just update the current IR object
+ // holder.
+ if (node->is_defined ()
+ && node->ifr_added () == 0
+ && this->in_reopened_ == 0)
+ {
+ // If we are here and the line below is true, then either
+ // 1. We are defining an undefined forward declared interface
+ // from a previously processed IDL file, or
+ // 2. We are clobbering a previous definition, either of an
+ // interface or of some other type.
+ // 3. We are inside a module that has a previous entry.
+ // If prev_def would narrow successfully to an InterfaceDef, we
+ // have NO WAY of knowing if we are defining or clobbering. So
+ // we destroy the contents of the previous entry (we don't want
+ // to destroy the entry itself, since it may have already been
+ // made a member of some other entry, and destroying it would
+ // make the containing entry's key invalid) and repopulate.
+ // On the other hand, if prev_def is NOT an interface, we can
+ // safely destroy it, since we know we are not redefining a
+ // previous entry, forward declared or not.
+ // If we are inside a module that was seen before, we could be
+ // just processing an IDL file a second time, in which case we
+ // again just update ir_current_.
+ if (node->ifr_fwd_added () == 0)
+ {
+ CORBA::DefinitionKind kind =
+ prev_def->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (kind == CORBA::dk_Value)
+ {
+ CORBA::ComponentIR::EventDef_var event =
+ CORBA::ComponentIR::EventDef::_narrow (
+ prev_def.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+
+ CORBA::ContainedSeq_var contents =
+ event->contents (CORBA::dk_all,
+ 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ULong length = contents->length ();
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ contents[i]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ else
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int status =
+ this->create_event_def (node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return status;
+ }
+ }
+
+ // Our previous definition is a valuetype, so narrow it here,
+ // then populate it.
+ CORBA::ComponentIR::EventDef_var extant_def =
+ CORBA::ComponentIR::EventDef::_narrow (prev_def. in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Concrete base value.
+
+ CORBA::ValueDef_var base_vt;
+ this->fill_base_value (base_vt.out (),
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ extant_def->base_value (base_vt.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Abstract base values.
+
+ CORBA::ValueDefSeq abstract_base_values;
+ this->fill_abstract_base_values (abstract_base_values,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ extant_def->abstract_base_values (abstract_base_values
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Supported interfaces.
+
+ CORBA::InterfaceDefSeq supported;
+ this->fill_supported_interfaces (supported,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ extant_def->supported_interfaces (supported
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Intializers.
+
+ CORBA::ExtInitializerSeq initializers;
+ this->fill_initializers (initializers,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ extant_def->ext_initializers (initializers
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Truncatable, abstract, custom.
+
+ extant_def->is_abstract (static_cast<CORBA::Boolean> (node->is_abstract ())
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ extant_def->is_truncatable (static_cast<CORBA::Boolean> (node->truncatable ())
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ extant_def->is_custom (static_cast<CORBA::Boolean> (node->custom ())
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ node->ifr_added (1);
+
+ // Push the new IR object onto the scope stack before visiting
+ // the new object's scope.
+ if (be_global->ifr_scopes ().push (extant_def.in ()) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_eventtype -")
+ ACE_TEXT (" scope push failed\n")
+ ),
+ -1
+ );
+ }
+
+ // Visit the members, if any.
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_eventtype -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ // This spot in the AST doesn't necessarily have to be the
+ // interface definition - it could be any reference to it.
+ // The front end will already have fully defined it, so all
+ // the info is available anywhere. So it's a good idea to
+ // update the current IR object holder now.
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (extant_def.in ());
+
+ CORBA::Container_ptr used_scope =
+ CORBA::Container::_nil ();
+
+ // Pop the new IR object back off the scope stack.
+ if (be_global->ifr_scopes ().pop (used_scope) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_eventtype -")
+ ACE_TEXT (" scope pop failed\n")
+ ),
+ -1
+ );
+ }
+ }
+ else
+ {
+ // @@ (JP) I think we're ok here without a check:
+ // not defined/not added - visit_valuetype_fwd will have
+ // detected a clobber.
+ // not defined/added - not possible.
+ // defined/not added - takes the other branch.
+ // defined/added - we're ok.
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_eventtype"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_eventtype_fwd (AST_EventTypeFwd *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ AST_Interface *v = node->full_definition ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this interface already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (v->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ // If our full definition is found in this IDL file, we go
+ // ahead and create the full entry now.
+ // The forward declared valuetype is not defined anywhere
+ // in this IDL file, so we just create an empty entry to
+ // be replaced by a full definition in some other IDL file.
+ CORBA::ValueDefSeq abstract_bases (0);
+ abstract_bases.length (0);
+ CORBA::InterfaceDefSeq supported (0);
+ supported.length (0);
+ CORBA::ExtInitializerSeq initializers (0);
+ initializers.length (0);
+
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ CORBA::ComponentIR::Container_var ccm_scope =
+ CORBA::ComponentIR::Container::_narrow (
+ current_scope
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+
+ CORBA::Boolean abstract =
+ static_cast<CORBA::Boolean> (v->is_abstract ());
+
+ this->ir_current_ =
+ ccm_scope->create_event (
+ v->repoID (),
+ v->local_name ()->get_string (),
+ v->version (),
+ 0, // 'custom' not handled yet
+ abstract,
+ CORBA::ValueDef::_nil (),
+ 0, // 'truncatable' not handled yet
+ abstract_bases,
+ supported,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_eventtype_fwd -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ node->ifr_added (1);
+ v->ifr_fwd_added (1);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_eventtype_fwd"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_home (AST_Home *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this interface already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If not, create a new entry.
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ int status = this->create_home_def (node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return status;
+ }
+ else
+ {
+ // There is already an entry in the repository. If the interface is
+ // defined and has not already been populated, we do so
+ // now. If it is not yet defined or the full definition has already
+ // been added to the repository, we just update the current IR object
+ // holder.
+ if (node->is_defined ()
+ && node->ifr_added () == 0
+ && this->in_reopened_ == 0)
+ {
+ // If we are here and the line below is true, then either
+ // 1. We are defining an undefined forward declared interface
+ // from a previously processed IDL file, or
+ // 2. We are clobbering a previous definition, either of an
+ // interface or of some other type.
+ // 3. We are inside a module that has a previous entry.
+ // If prev_def would narrow successfully to an InterfaceDef, we
+ // have NO WAY of knowing if we are defining or clobbering. So
+ // we destroy the contents of the previous entry (we don't want
+ // to destroy the entry itself, since it may have already been
+ // made a member of some other entry, and destroying it would
+ // make the containing entry's key invalid) and repopulate.
+ // On the other hand, if prev_def is NOT an interface, we can
+ // safely destroy it, since we know we are not redefining a
+ // previous entry, forward declared or not.
+ // If we are inside a module that was seen before, we could be
+ // just processing an IDL file a second time, in which case we
+ // again just update ir_current_.
+ if (node->ifr_fwd_added () == 0)
+ {
+ CORBA::DefinitionKind kind =
+ prev_def->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (kind == CORBA::dk_Component)
+ {
+ CORBA::ComponentIR::HomeDef_var value =
+ CORBA::ComponentIR::HomeDef::_narrow (
+ prev_def.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+
+ CORBA::ContainedSeq_var contents =
+ value->contents (CORBA::dk_all,
+ 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ULong length = contents->length ();
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ contents[i]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ else
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int status =
+ this->create_home_def (node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return status;
+ }
+ }
+
+ // Re-populate the repository entry.
+
+ }
+ else
+ {
+ // @@ (JP) I think we're ok here without a check:
+ // not defined/not added - visit_interface_fwd will have
+ // detected a clobber.
+ // not defined/added - not possible.
+ // defined/not added - takes the other branch.
+ // defined/added - we're ok.
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_home"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_factory (AST_Factory *)
+{
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_structure (AST_Structure *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ ifr_adding_visitor_structure visitor (node, 0);
+ int retval = visitor.visit_structure (node);
+
+ if (retval == 0)
+ {
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (visitor.ir_current ());
+ }
+
+ return retval;
+ }
+ else
+ {
+ // If the line below is true, we are clobbering a previous
+ // entry (from another IDL file) of another type. In that
+ // case we do what other ORB vendors do, and destroy the
+ // original entry, create the new one, and let the user beware.
+ // Unless we are in a module that has been seen before, in
+ // which case we might be just processing and IDL file a
+ // second time and we want to just update ir_current_.
+ if (node->ifr_added () == 0 && this->in_reopened_ == 0)
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return this->visit_structure (node);
+ }
+
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor::visit_structure"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_exception (AST_Exception *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ ifr_adding_visitor_exception visitor (node,
+ this->in_reopened_);
+
+ // No point in updating ir_current_ here because
+ // ExceptionDef is not an IDLType.
+
+ return visitor.visit_exception (node);
+}
+
+int
+ifr_adding_visitor::visit_enum (AST_Enum *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this enum already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If not, create a new entry.
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ CORBA::ULong member_count =
+ static_cast<CORBA::ULong> (node->member_count ());
+
+ CORBA::EnumMemberSeq members (member_count);
+ members.length (member_count);
+
+ UTL_ScopedName *member_name = 0;
+
+ // Get a list of the member names.
+ for (CORBA::ULong i = 0; i < member_count; ++i)
+ {
+ member_name = node->value_to_name (i);
+
+ members[i] =
+ CORBA::string_dup (
+ member_name->last_component ()->get_string ()
+ );
+ }
+
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ this->ir_current_ =
+ current_scope->create_enum (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::visit_enum -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ node->ifr_added (1);
+ }
+ else
+ {
+ // If the line below is true, we are clobbering a previous
+ // entry (from another IDL file) of another type. In that
+ // case we do what other ORB vendors do, and destroy the
+ // original entry, create the new one, and let the user beware.
+ // Unless we are in a module that has been seen before, in
+ // which case we might be just processing and IDL file a
+ // second time and we want to just update ir_current_.
+ if (node->ifr_added () == 0 && this->in_reopened_ == 0)
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return this->visit_enum (node);
+ }
+
+ // There is already an entry in the repository, so just update
+ // the current IR object holder.
+ this->ir_current_ =
+ CORBA::EnumDef::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor::visit_enum"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_operation (AST_Operation *node)
+{
+ ifr_adding_visitor_operation visitor (node);
+
+ return visitor.visit_operation (node);
+}
+
+int
+ifr_adding_visitor::visit_field (AST_Field *node)
+{
+ AST_Decl *scope = ScopeAsDecl (node->defined_in ());
+ AST_Decl::NodeType nt = scope->node_type ();
+
+ if (nt == AST_Decl::NT_valuetype || nt == AST_Decl::NT_eventtype)
+ {
+ return this->create_value_member (node);
+ }
+
+ AST_Type *ft = AST_Type::narrow_from_decl (node->field_type ());
+
+ if (ft == 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_field - ")
+ ACE_TEXT ("Bad field type\n")
+ ),
+ -1
+ );
+ }
+
+ if (ft->ast_accept (this) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("visit_field - ")
+ ACE_TEXT ("failed to accept visitor\n")
+ ),
+ -1
+ );
+ }
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_attribute (AST_Attribute *node)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ AST_Type *type = node->field_type ();
+
+ // Updates ir_current_.
+ this->get_referenced_type (type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::AttributeMode mode =
+ node->readonly () ? CORBA::ATTR_READONLY : CORBA::ATTR_NORMAL;
+
+ CORBA::ExceptionDefSeq get_exceptions;
+ this->fill_get_exceptions (get_exceptions,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ExceptionDefSeq set_exceptions;
+ this->fill_set_exceptions (set_exceptions,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ CORBA::DefinitionKind kind =
+ current_scope->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (kind == CORBA::dk_Value || kind == CORBA::dk_Event)
+ {
+ CORBA::ExtValueDef_var value =
+ CORBA::ExtValueDef::_narrow (current_scope
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ExtAttributeDef_var new_def =
+ value->create_ext_attribute (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ this->ir_current_.in (),
+ mode,
+ get_exceptions,
+ set_exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ // We are an interface, a local interface, an abstract
+ // interface or a component. This narrow covers them all.
+ CORBA::InterfaceAttrExtension_var iface =
+ CORBA::InterfaceAttrExtension::_narrow (current_scope
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ExtAttributeDef_var new_def =
+ iface->create_ext_attribute (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ this->ir_current_.in (),
+ mode,
+ get_exceptions,
+ set_exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ }
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::visit_attribute -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_attribute"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_union (AST_Union *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ ifr_adding_visitor_union visitor (node,
+ 0);
+
+ int retval = visitor.visit_union (node);
+
+ if (retval == 0)
+ {
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (visitor.ir_current ());
+ }
+
+ return retval;
+ }
+ else
+ {
+ // If the line below is true, we are clobbering a previous
+ // entry (from another IDL file) of another type. In that
+ // case we do what other ORB vendors do, and destroy the
+ // original entry, create the new one, and let the user beware.
+ // Unless we are in a module that has been seen before, in
+ // which case we might be just processing and IDL file a
+ // second time and we want to just update ir_current_.
+ if (node->ifr_added () == 0 && this->in_reopened_ == 0)
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return this->visit_union (node);
+ }
+
+ this->ir_current_ =
+ CORBA::UnionDef::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor::visit_union"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_constant (AST_Constant *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ const char *id = node->repoID ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Nothing prevents this constant's repo id from already being
+ // in the repository as another type, if it came from another
+ // IDL file whose generated code is not linked to the generated
+ // code from this IDL file. So we check here before we make a
+ // call on ir_current_.
+ if (!CORBA::is_nil (prev_def.in ()))
+ {
+ // If the line below is true, we are clobbering a previous
+ // entry (from another IDL file) of another type. In that
+ // case we do what other ORB vendors do, and destroy the
+ // original entry, create the new one, and let the user beware.
+ // Unless we are in a module that has been seen before, in
+ // which case we might be just processing and IDL file a
+ // second time and we want to just update ir_current_.
+ if (node->ifr_added () == 0 && this->in_reopened_ == 0)
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ // The node is referenced in an array size, string bound
+ // or sequence bound - no action needed in the IFR.
+ return 0;
+ }
+ }
+
+ AST_Expression::AST_ExprValue *ev = node->constant_value ()->ev ();
+ AST_Decl *td = node->constant_value ()->get_tdef ();
+
+ if (td != 0 && td->node_type () == AST_Decl::NT_typedef)
+ {
+ // This constant's type is a typedef - look up the typedef to
+ // pass to create_constant().
+ CORBA::Contained_var contained =
+ be_global->repository ()->lookup_id (td->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->ir_current_ = CORBA::IDLType::_narrow (contained.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ CORBA::PrimitiveKind pkind = this->expr_type_to_pkind (ev->et);
+ this->ir_current_ =
+ be_global->repository ()->get_primitive (pkind
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ CORBA::Any any;
+ this->load_any (ev,
+ any);
+
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ CORBA::ConstantDef_var new_def =
+ current_scope->create_constant (
+ id,
+ node->local_name ()->get_string (),
+ node->version (),
+ this->ir_current_.in (),
+ any
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::visit_constant -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_constant"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_array (AST_Array *node)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->element_type (node->base_type ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ AST_Expression **dims = node->dims ();
+
+ for (unsigned long i = node->n_dims (); i > 0; --i)
+ {
+ this->ir_current_ =
+ be_global->repository ()->create_array (
+ dims[i - 1]->ev ()->u.ulval,
+ this->ir_current_.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_array"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_sequence (AST_Sequence *node)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->element_type (node->base_type ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->ir_current_ =
+ be_global->repository ()->create_sequence (
+ node->max_size ()->ev ()->u.ulval,
+ this->ir_current_.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_sequence"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_string (AST_String *node)
+{
+ AST_Expression *ex = node->max_size ();
+
+ AST_Expression::AST_ExprValue *ev = ex->ev ();
+
+ CORBA::ULong bound = static_cast<CORBA::ULong> (ev->u.ulval);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ if (node->node_type () == AST_Decl::NT_string)
+ {
+ this->ir_current_ =
+ be_global->repository ()->create_string (bound
+ ACE_ENV_ARG_PARAMETER);
+ }
+ else
+ {
+ this->ir_current_ =
+ be_global->repository ()->create_wstring (bound
+ ACE_ENV_ARG_PARAMETER);
+ }
+
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_string"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_typedef (AST_Typedef *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->element_type (node->base_type ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ this->ir_current_ =
+ current_scope->create_alias (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ this->ir_current_.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::visit_typedef -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ node->ifr_added (1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_typedef"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_root (AST_Root *node)
+{
+ if (be_global->ifr_scopes ().push (be_global->repository ()) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::visit_root -")
+ ACE_TEXT (" scope push failed\n")
+ ),
+ -1
+ );
+ }
+
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::visit_root -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ CORBA::Container_ptr tmp =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().pop (tmp) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::visit_root -")
+ ACE_TEXT (" scope pop failed\n")
+ ),
+ -1
+ );
+ }
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::visit_native (AST_Native *node)
+{
+ if (node->imported () && !be_global->do_included_files ())
+ {
+ return 0;
+ }
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ this->ir_current_ =
+ current_scope->create_native (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::visit_native -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ node->ifr_added (1);
+ }
+ else
+ {
+ // If the line below is true, we are clobbering a previous
+ // entry (from another IDL file) of another type. In that
+ // case we do what other ORB vendors do, and destroy the
+ // original entry, create the new one, and let the user beware.
+ // Unless we are in a module that has been seen before, in
+ // which case we might be just processing and IDL file a
+ // second time and we want to just update ir_current_.
+ if (node->ifr_added () == 0 && this->in_reopened_ == 0)
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This call will take the other branch.
+ return this->visit_native (node);
+ }
+
+ this->ir_current_ =
+ CORBA::NativeDef::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_native"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+CORBA::PrimitiveKind
+ifr_adding_visitor::expr_type_to_pkind (AST_Expression::ExprType et)
+{
+ switch (et)
+ {
+ case AST_Expression::EV_short:
+ return CORBA::pk_short;
+ case AST_Expression::EV_ushort:
+ return CORBA::pk_ushort;
+ case AST_Expression::EV_long:
+ return CORBA::pk_long;
+ case AST_Expression::EV_ulong:
+ return CORBA::pk_ulong;
+ case AST_Expression::EV_longlong:
+ return CORBA::pk_longlong;
+ case AST_Expression::EV_ulonglong:
+ return CORBA::pk_ulonglong;
+ case AST_Expression::EV_float:
+ return CORBA::pk_float;
+ case AST_Expression::EV_double:
+ return CORBA::pk_double;
+ case AST_Expression::EV_longdouble:
+ return CORBA::pk_longdouble;
+ case AST_Expression::EV_char:
+ return CORBA::pk_char;
+ case AST_Expression::EV_wchar:
+ return CORBA::pk_wchar;
+ case AST_Expression::EV_octet:
+ return CORBA::pk_octet;
+ case AST_Expression::EV_bool:
+ return CORBA::pk_boolean;
+ case AST_Expression::EV_string:
+ return CORBA::pk_string;
+ case AST_Expression::EV_wstring:
+ return CORBA::pk_wstring;
+ case AST_Expression::EV_any:
+ return CORBA::pk_any;
+ case AST_Expression::EV_void:
+ return CORBA::pk_void;
+ case AST_Expression::EV_none:
+ return CORBA::pk_null;
+ default:
+ return CORBA::pk_null;
+ }
+}
+
+CORBA::PrimitiveKind
+ifr_adding_visitor::predefined_type_to_pkind (AST_PredefinedType *node)
+{
+ switch (node->pt ())
+ {
+ case AST_PredefinedType::PT_short:
+ return CORBA::pk_short;
+ case AST_PredefinedType::PT_ushort:
+ return CORBA::pk_ushort;
+ case AST_PredefinedType::PT_long:
+ return CORBA::pk_long;
+ case AST_PredefinedType::PT_ulong:
+ return CORBA::pk_ulong;
+ case AST_PredefinedType::PT_longlong:
+ return CORBA::pk_longlong;
+ case AST_PredefinedType::PT_ulonglong:
+ return CORBA::pk_ulonglong;
+ case AST_PredefinedType::PT_float:
+ return CORBA::pk_float;
+ case AST_PredefinedType::PT_double:
+ return CORBA::pk_double;
+ case AST_PredefinedType::PT_longdouble:
+ return CORBA::pk_longdouble;
+ case AST_PredefinedType::PT_char:
+ return CORBA::pk_char;
+ case AST_PredefinedType::PT_wchar:
+ return CORBA::pk_wchar;
+ case AST_PredefinedType::PT_octet:
+ return CORBA::pk_octet;
+ case AST_PredefinedType::PT_boolean:
+ return CORBA::pk_boolean;
+ case AST_PredefinedType::PT_any:
+ return CORBA::pk_any;
+ case AST_PredefinedType::PT_void:
+ return CORBA::pk_void;
+ case AST_PredefinedType::PT_object:
+ return CORBA::pk_objref;
+ case AST_PredefinedType::PT_pseudo:
+ {
+ const char *local_name = node->local_name ()->get_string ();
+
+ if (!ACE_OS::strcmp (local_name, "Principal"))
+ {
+ return CORBA::pk_Principal;
+ }
+ else
+ {
+ return CORBA::pk_TypeCode;
+ }
+ }
+ default:
+ return CORBA::pk_null;
+ }
+}
+
+void
+ifr_adding_visitor::load_any (AST_Expression::AST_ExprValue *ev,
+ CORBA::Any &any)
+{
+ switch (ev->et)
+ {
+ case AST_Expression::EV_short:
+ any <<= ev->u.sval;
+ break;
+ case AST_Expression::EV_ushort:
+ any <<= ev->u.usval;
+ break;
+ case AST_Expression::EV_long:
+ any <<= static_cast<CORBA::Long> (ev->u.lval);
+ break;
+ case AST_Expression::EV_ulong:
+ any <<= static_cast<CORBA::ULong> (ev->u.ulval);
+ break;
+#if !defined (ACE_LACKS_LONGLONG_T)
+ case AST_Expression::EV_longlong:
+ any <<= ev->u.llval;
+ break;
+ case AST_Expression::EV_ulonglong:
+ any <<= ev->u.ullval;
+ break;
+#endif /* !defined (ACE_LACKS_LONGLONG_T) */
+ case AST_Expression::EV_float:
+ any <<= ev->u.fval;
+ break;
+ case AST_Expression::EV_double:
+ any <<= ev->u.dval;
+ break;
+#if 0
+ case AST_Expression::EV_longdouble:
+ // Not implemented in IDL compiler.
+#endif
+ case AST_Expression::EV_char:
+ any <<= CORBA::Any::from_char (ev->u.cval);
+ break;
+ case AST_Expression::EV_wchar:
+ any <<= CORBA::Any::from_wchar (ev->u.wcval);
+ break;
+ case AST_Expression::EV_octet:
+ any <<= CORBA::Any::from_octet (ev->u.oval);
+ break;
+ case AST_Expression::EV_bool:
+ any <<= CORBA::Any::from_boolean ((CORBA::Boolean) ev->u.bval);
+ break;
+ case AST_Expression::EV_string:
+ any <<= ev->u.strval->get_string ();
+ break;
+ case AST_Expression::EV_wstring:
+ {
+ char *str = ev->u.wstrval;
+ size_t len = ACE_OS::strlen (str);
+ CORBA::WChar *wstr = 0;
+ ACE_NEW (wstr,
+ CORBA::WChar[len + 1]);
+
+ for (size_t i = 0; i < len; ++i)
+ {
+ wstr[i] = static_cast<CORBA::WChar> (str[i]);
+ }
+
+ wstr[len] = 0;
+ any <<= wstr;
+ delete wstr;
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+void
+ifr_adding_visitor::element_type (AST_Type *base_type
+ ACE_ENV_ARG_DECL)
+{
+ if (base_type->anonymous ())
+ {
+ if (base_type->ast_accept (this) == -1)
+ {
+ ACE_ERROR ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::element_type -")
+ ACE_TEXT (" failed to accept visitor\n")
+ ));
+ }
+ }
+ else
+ {
+ CORBA::Contained_var contained =
+ be_global->repository ()->lookup_id (base_type->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (contained.in ()))
+ {
+ ACE_ERROR ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::element_type -")
+ ACE_TEXT (" lookup_id failed\n")
+ ));
+ }
+
+ this->ir_current_ = CORBA::IDLType::_narrow (contained.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+int
+ifr_adding_visitor::create_interface_def (AST_Interface *node
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::ULong n_parents = static_cast<CORBA::ULong> (node->n_inherits ());
+ AST_Interface **parents = node->inherits ();
+ CORBA::Contained_var result;
+ CORBA::AbstractInterfaceDefSeq abs_bases;
+ CORBA::InterfaceDefSeq bases;
+
+ if (node->is_abstract ())
+ {
+ abs_bases.length (n_parents);
+
+ // Construct a list of the parents.
+ for (CORBA::ULong i = 0; i < n_parents; ++i)
+ {
+ result =
+ be_global->repository ()->lookup_id (parents[i]->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // If we got to visit_interface() from a forward declared interface,
+ // this node may not yet be in the repository.
+ if (CORBA::is_nil (result.in ()))
+ {
+ int status = this->create_interface_def (parents[i]
+ ACE_ENV_ARG_PARAMETER);
+
+ if (status != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_interface_def -")
+ ACE_TEXT (" parent interfacedef creation failed\n")
+ ),
+ -1
+ );
+ }
+
+ bases[i] =
+ CORBA::AbstractInterfaceDef::_narrow (this->ir_current_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ else
+ {
+ abs_bases[i] =
+ CORBA::AbstractInterfaceDef::_narrow (result.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ if (CORBA::is_nil (abs_bases[i]))
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_interface_def -")
+ ACE_TEXT (" CORBA::InterfaceDef::_narrow failed\n")
+ ),
+ -1
+ );
+ }
+ }
+ }
+ else
+ {
+ bases.length (n_parents);
+
+ // Construct a list of the parents.
+ for (CORBA::ULong i = 0; i < n_parents; ++i)
+ {
+ result =
+ be_global->repository ()->lookup_id (parents[i]->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // If we got to visit_interface() from a forward declared interface,
+ // this node may not yet be in the repository.
+ if (CORBA::is_nil (result.in ()))
+ {
+ int status = this->create_interface_def (parents[i]
+ ACE_ENV_ARG_PARAMETER);
+
+ if (status != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_interface_def -")
+ ACE_TEXT (" parent interfacedef creation failed\n")
+ ),
+ -1
+ );
+ }
+
+ bases[i] = CORBA::InterfaceDef::_narrow (this->ir_current_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ else
+ {
+ bases[i] = CORBA::InterfaceDef::_narrow (result.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ if (CORBA::is_nil (bases[i]))
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_interface_def -")
+ ACE_TEXT (" CORBA::InterfaceDef::_narrow failed\n")
+ ),
+ -1
+ );
+ }
+ }
+ }
+
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ CORBA::InterfaceDef_var new_def;
+
+ if (node->is_local ())
+ {
+ new_def =
+ current_scope->create_local_interface (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ bases
+ ACE_ENV_ARG_PARAMETER
+ );
+ }
+ else if (node->is_abstract ())
+ {
+ new_def =
+ current_scope->create_abstract_interface (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ abs_bases
+ ACE_ENV_ARG_PARAMETER
+ );
+ }
+ else
+ {
+ new_def =
+ current_scope->create_interface (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ bases
+ ACE_ENV_ARG_PARAMETER
+ );
+ }
+
+ ACE_CHECK_RETURN (-1);
+
+ node->ifr_added (1);
+
+ // Push the new IR object onto the scope stack.
+ CORBA::Container_var new_scope =
+ CORBA::Container::_narrow (new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (be_global->ifr_scopes ().push (new_scope.in ()) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_interface_def -")
+ ACE_TEXT (" scope push failed\n")
+ ),
+ -1
+ );
+ }
+
+ // Visit the members, if any.
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_interface_def -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ // This spot in the AST doesn't necessarily have to be the
+ // interface definition - it could be any reference to it.
+ // The front end will already have fully defined it, so all
+ // the info is available anywhere. So it's a good idea to
+ // update the current IR object holder now. This will
+ // consume the objref pointer.
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (new_def.in ());
+
+ CORBA::Container_ptr used_scope =
+ CORBA::Container::_nil ();
+
+ // Pop the new IR object back off the scope stack.
+ if (be_global->ifr_scopes ().pop (used_scope) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_interface_def -")
+ ACE_TEXT (" scope pop failed\n")
+ ),
+ -1
+ );
+ }
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::create_interface_def -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::create_value_def (AST_ValueType *node
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ CORBA::ValueDef_var base_value;
+ this->fill_base_value (base_value.out (),
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ValueDefSeq abstract_base_values;
+ this->fill_abstract_base_values (abstract_base_values,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::InterfaceDefSeq supported_interfaces;
+ this->fill_supported_interfaces (supported_interfaces,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ExtInitializerSeq initializers;
+ this->fill_initializers (initializers,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ExtValueDef_var new_def =
+ current_scope->create_ext_value (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ static_cast<CORBA::Boolean> (node->custom ()),
+ static_cast<CORBA::Boolean> (node->is_abstract ()),
+ base_value.in (),
+ static_cast<CORBA::Boolean> (node->truncatable ()),
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (-1);
+
+ node->ifr_added (1);
+
+ // Push the new IR object onto the scope stack.
+ CORBA::Container_var new_scope =
+ CORBA::Container::_narrow (new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (be_global->ifr_scopes ().push (new_scope.in ()) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_value_def -")
+ ACE_TEXT (" scope push failed\n")
+ ),
+ -1
+ );
+ }
+
+ // Visit the members, if any.
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_value_def -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ // This spot in the AST doesn't necessarily have to be the
+ // interface definition - it could be any reference to it.
+ // The front end will already have fully defined it, so all
+ // the info is available anywhere. So it's a good idea to
+ // update the current IR object holder now. This will
+ // consume the objref pointer.
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (new_def.in ());
+
+ CORBA::Container_ptr used_scope =
+ CORBA::Container::_nil ();
+
+ // Pop the new IR object back off the scope stack.
+ if (be_global->ifr_scopes ().pop (used_scope) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_value_def -")
+ ACE_TEXT (" scope pop failed\n")
+ ),
+ -1
+ );
+ }
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::create_value_def -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::create_component_def (AST_Component *node
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ CORBA::ComponentIR::ComponentDef_var base_component;
+ this->fill_base_component (base_component.out (),
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::InterfaceDefSeq supported_interfaces;
+ this->fill_supported_interfaces (supported_interfaces,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ComponentIR::Container_var ccm_scope =
+ CORBA::ComponentIR::Container::_narrow (current_scope
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ComponentIR::ComponentDef_var new_def =
+ ccm_scope->create_component (node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ base_component.in (),
+ supported_interfaces
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ node->ifr_added (1);
+
+ if (be_global->ifr_scopes ().push (new_def.in ()) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_component_def -")
+ ACE_TEXT (" scope push failed\n")
+ ),
+ -1
+ );
+ }
+
+ // Visit the members, if any.
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_component_def -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ this->visit_all_provides (node,
+ new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->visit_all_uses (node,
+ new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->visit_all_emits (node,
+ new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->visit_all_publishes (node,
+ new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->visit_all_consumes (node,
+ new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // This spot in the AST doesn't necessarily have to be the
+ // interface definition - it could be any reference to it.
+ // The front end will already have fully defined it, so all
+ // the info is available anywhere. So it's a good idea to
+ // update the current IR object holder now. This will
+ // consume the objref pointer.
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (new_def.in ());
+
+ CORBA::Container_ptr used_scope =
+ CORBA::Container::_nil ();
+
+ // Pop the new IR object back off the scope stack.
+ if (be_global->ifr_scopes ().pop (used_scope) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_component_def -")
+ ACE_TEXT (" scope pop failed\n")
+ ),
+ -1
+ );
+ }
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::create_component_def -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::create_home_def (AST_Home *node
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ CORBA::ComponentIR::HomeDef_var base_home;
+ this->fill_base_home (base_home.out (),
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ComponentIR::ComponentDef_var managed_component;
+ this->fill_managed_component (managed_component.out (),
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::InterfaceDefSeq supported_interfaces;
+ this->fill_supported_interfaces (supported_interfaces,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ValueDef_var primary_key;
+ this->fill_primary_key (primary_key.out (),
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ComponentIR::Container_var ccm_scope =
+ CORBA::ComponentIR::Container::_narrow (current_scope
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ComponentIR::HomeDef_var new_def =
+ ccm_scope->create_home (node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ base_home.in (),
+ managed_component.in (),
+ supported_interfaces,
+ primary_key.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ node->ifr_added (1);
+
+ // Push the new IR object onto the scope stack.
+ CORBA::Container_var new_scope =
+ CORBA::Container::_narrow (new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (be_global->ifr_scopes ().push (new_scope.in ()) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_home_def -")
+ ACE_TEXT (" scope push failed\n")
+ ),
+ -1
+ );
+ }
+
+ // Visit the members, if any.
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_home_def -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ // Get the contents of these lists into the repository.
+
+ this->visit_all_factories (node,
+ new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->visit_all_finders (node,
+ new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // This spot in the AST doesn't necessarily have to be the
+ // interface definition - it could be any reference to it.
+ // The front end will already have fully defined it, so all
+ // the info is available anywhere. So it's a good idea to
+ // update the current IR object holder now. This will
+ // consume the objref pointer.
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (new_def.in ());
+
+ CORBA::Container_ptr used_scope =
+ CORBA::Container::_nil ();
+
+ // Pop the new IR object back off the scope stack.
+ if (be_global->ifr_scopes ().pop (used_scope) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_home_def -")
+ ACE_TEXT (" scope pop failed\n")
+ ),
+ -1
+ );
+ }
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::create_home_def -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::create_event_def (AST_EventType *node
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ CORBA::ValueDef_var base_value;
+ this->fill_base_value (base_value.out (),
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ValueDefSeq abstract_base_values;
+ this->fill_abstract_base_values (abstract_base_values,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::InterfaceDefSeq supported_interfaces;
+ this->fill_supported_interfaces (supported_interfaces,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ExtInitializerSeq initializers;
+ this->fill_initializers (initializers,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ComponentIR::Container_var ccm_scope =
+ CORBA::ComponentIR::Container::_narrow (current_scope
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ExtValueDef_var new_def =
+ ccm_scope->create_event (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ static_cast<CORBA::Boolean> (node->custom ()),
+ static_cast<CORBA::Boolean> (node->is_abstract ()),
+ base_value.in (),
+ static_cast<CORBA::Boolean> (node->truncatable ()),
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (-1);
+
+ node->ifr_added (1);
+
+ // Push the new IR object onto the scope stack.
+ CORBA::Container_var new_scope =
+ CORBA::Container::_narrow (new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (be_global->ifr_scopes ().push (new_scope.in ()) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_event_def -")
+ ACE_TEXT (" scope push failed\n")
+ ),
+ -1
+ );
+ }
+
+ // Visit the members, if any.
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_event_def -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ // This spot in the AST doesn't necessarily have to be the
+ // interface definition - it could be any reference to it.
+ // The front end will already have fully defined it, so all
+ // the info is available anywhere. So it's a good idea to
+ // update the current IR object holder now. This will
+ // consume the objref pointer.
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (new_def.in ());
+
+ CORBA::Container_ptr used_scope =
+ CORBA::Container::_nil ();
+
+ // Pop the new IR object back off the scope stack.
+ if (be_global->ifr_scopes ().pop (used_scope) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_event_def -")
+ ACE_TEXT (" scope pop failed\n")
+ ),
+ -1
+ );
+ }
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::create_event_def -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ return 0;
+}
+
+int
+ifr_adding_visitor::create_value_member (AST_Field *node)
+{
+ ACE_TRY_NEW_ENV
+ {
+ AST_Type *bt = node->field_type ();
+ AST_Decl::NodeType nt = bt->node_type ();
+
+ // We can't use lookup_id() on these, because
+ // they don't inherit from Contained.
+ if (nt == AST_Decl::NT_pre_defined
+ || nt == AST_Decl::NT_string
+ || nt == AST_Decl::NT_wstring
+ || nt == AST_Decl::NT_array
+ || nt == AST_Decl::NT_sequence)
+ {
+ /// This will put the repo entry into ir_current_.
+ if (bt->ast_accept (this) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_value_member -")
+ ACE_TEXT (" visit base type failed\n")
+ ),
+ -1
+ );
+ }
+ }
+ else
+ {
+ // If the IDL is legal, this will succeed.
+ CORBA::Contained_var holder =
+ be_global->repository ()->lookup_id (bt->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (holder.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ CORBA::Visibility vis = CORBA::PUBLIC_MEMBER;
+
+ switch (node->visibility ())
+ {
+ case AST_Field::vis_PUBLIC:
+ break;
+ case AST_Field::vis_PRIVATE:
+ vis = CORBA::PRIVATE_MEMBER;
+ break;
+ default:
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::create_value_member -")
+ ACE_TEXT (" bad visibility value in node\n")
+ ),
+ -1
+ );
+ };
+
+ CORBA::Container_ptr current_scope = CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("create_value_member -")
+ ACE_TEXT (" scope stack empty\n")
+ ),
+ -1
+ );
+ }
+ ACE_TRY_CHECK;
+
+ CORBA::ValueDef_var vt =
+ CORBA::ValueDef::_narrow (current_scope
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ValueMemberDef_var vm =
+ vt->create_value_member (node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ this->ir_current_.in (),
+ vis
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("create_value_member"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+void
+ifr_adding_visitor::get_referenced_type (AST_Type *node
+ ACE_ENV_ARG_DECL)
+{
+ switch (node->node_type ())
+ {
+ // For anonymous types, a new IR object is be created each
+ // time, so we just visit the node, which get the object and
+ // updates ir_current_.
+ case AST_Decl::NT_pre_defined:
+ case AST_Decl::NT_string:
+ case AST_Decl::NT_wstring:
+ case AST_Decl::NT_array:
+ case AST_Decl::NT_sequence:
+ if (node->ast_accept (this) == -1)
+ {
+ ACE_ERROR ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("get_scope_member -")
+ ACE_TEXT (" failed to accept visitor\n")
+ ));
+ }
+
+ break;
+ // For names types, we can just look up the entry and update
+ // ir_current_.
+ default:
+ {
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ break;
+ }
+ }
+}
+
+void
+ifr_adding_visitor::fill_base_value (CORBA::ValueDef_ptr &result,
+ AST_ValueType *node
+ ACE_ENV_ARG_DECL)
+{
+ result = CORBA::ValueDef::_nil ();
+ AST_ValueType *base_value = node->inherits_concrete ();
+
+ if (base_value == 0)
+ {
+ return;
+ }
+
+ CORBA::Contained_var holder =
+ be_global->repository ()->lookup_id (
+ base_value->repoID ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ if (!CORBA::is_nil (holder.in ()))
+ {
+ result =
+ CORBA::ValueDef::_narrow (holder.in ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+void
+ifr_adding_visitor::fill_base_component (
+ CORBA::ComponentIR::ComponentDef_ptr &result,
+ AST_Component *node
+ ACE_ENV_ARG_DECL
+ )
+{
+ result = CORBA::ComponentIR::ComponentDef::_nil ();
+ AST_Component *base_component = node->base_component ();
+
+ if (base_component == 0)
+ {
+ return;
+ }
+
+ CORBA::Contained_var holder =
+ be_global->repository ()->lookup_id (
+ base_component->repoID ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ if (!CORBA::is_nil (holder.in ()))
+ {
+ result =
+ CORBA::ComponentIR::ComponentDef::_narrow (holder.in ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+void
+ifr_adding_visitor::fill_base_home (CORBA::ComponentIR::HomeDef_ptr &result,
+ AST_Home *node
+ ACE_ENV_ARG_DECL)
+{
+ result = CORBA::ComponentIR::HomeDef::_nil ();
+ AST_Home *base_home = node->base_home ();
+
+ if (base_home == 0)
+ {
+ return;
+ }
+
+ CORBA::Contained_var holder =
+ be_global->repository ()->lookup_id (
+ base_home->repoID ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ if (!CORBA::is_nil (holder.in ()))
+ {
+ result =
+ CORBA::ComponentIR::HomeDef::_narrow (holder.in ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+ else
+ {
+ /// Maybe the base home is in an included IDL file - put it in
+ /// the repository and go again.
+ (void) base_home->ast_accept (this);
+ this->fill_base_home (result,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+void
+ifr_adding_visitor::fill_managed_component (
+ CORBA::ComponentIR::ComponentDef_ptr &result,
+ AST_Home *node
+ ACE_ENV_ARG_DECL
+ )
+{
+ result = CORBA::ComponentIR::ComponentDef::_nil ();
+ AST_Component *managed_component = node->managed_component ();
+
+ if (managed_component == 0)
+ {
+ return;
+ }
+
+ CORBA::Contained_var holder =
+ be_global->repository ()->lookup_id (managed_component->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (!CORBA::is_nil (holder.in ()))
+ {
+ result =
+ CORBA::ComponentIR::ComponentDef::_narrow (holder.in ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+ else
+ {
+ /// Maybe the managed component is in an included IDL file - put it in
+ /// the repository and go again.
+ (void) managed_component->ast_accept (this);
+ this->fill_managed_component (result,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+void
+ifr_adding_visitor::fill_primary_key (CORBA::ValueDef_ptr &result,
+ AST_Home *node
+ ACE_ENV_ARG_DECL)
+{
+ result = CORBA::ValueDef::_nil ();
+ AST_ValueType *primary_key = node->primary_key ();
+
+ if (primary_key == 0)
+ {
+ return;
+ }
+
+ CORBA::Contained_var holder =
+ be_global->repository ()->lookup_id (primary_key->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (!CORBA::is_nil (holder.in ()))
+ {
+ result =
+ CORBA::ValueDef::_narrow (holder.in ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+ else
+ {
+ /// Maybe the primary key is in an included IDL file - put it in
+ /// the repository and go again.
+ (void) primary_key->ast_accept (this);
+ this->fill_primary_key (result,
+ node
+ ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+void
+ifr_adding_visitor::fill_abstract_base_values (CORBA::ValueDefSeq &result,
+ AST_ValueType *node
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Long s_length = node->n_inherits ();
+ result.length (0);
+
+ // Not sure if this could be negative in some default case or
+ // not. If it's 0, we should make the call anyway to clear
+ // existing entries, if any, from the repository.
+ if (s_length > 0)
+ {
+ AST_Interface **list = node->inherits ();
+ CORBA::ULong u_length = static_cast<CORBA::ULong> (s_length);
+ bool first_abs = list[0]->is_abstract ();
+ result.length (first_abs ? u_length : u_length - 1);
+
+ for (CORBA::ULong i = 0; i < u_length; ++i)
+ {
+ if (i == 0 && ! first_abs)
+ {
+ continue;
+ }
+
+ // Get list[i] into ir_current_.
+ (void) list[i]->ast_accept (this);
+
+ result[first_abs ? i : i - 1] =
+ CORBA::ValueDef::_narrow (this->ir_current_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+}
+
+void
+ifr_adding_visitor::fill_inherited_interfaces (CORBA::InterfaceDefSeq &result,
+ AST_Interface *node
+ ACE_ENV_ARG_DECL)
+{
+ result.length (0);
+ this->fill_interfaces (result,
+ node->inherits (),
+ node->n_inherits ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+ifr_adding_visitor::fill_supported_interfaces (CORBA::InterfaceDefSeq &result,
+ AST_Interface *node
+ ACE_ENV_ARG_DECL)
+{
+ result.length (0);
+ CORBA::Long s_length = 0;
+ AST_Interface **list = 0;
+
+ switch (node->node_type ())
+ {
+ case AST_Decl::NT_valuetype:
+ case AST_Decl::NT_eventtype:
+ {
+ AST_ValueType *v = AST_ValueType::narrow_from_decl (node);
+ s_length = v->n_supports ();
+ list = v->supports ();
+ break;
+ }
+ case AST_Decl::NT_component:
+ {
+ AST_Component *c = AST_Component::narrow_from_decl (node);
+ s_length = c->n_supports ();
+ list = c->supports ();
+ break;
+ }
+ case AST_Decl::NT_home:
+ {
+ AST_Home *h = AST_Home::narrow_from_decl (node);
+ s_length = h->n_supports ();
+ list = h->supports ();
+ break;
+ }
+ default:
+ return;
+ }
+
+ this->fill_interfaces (result,
+ list,
+ s_length
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+ifr_adding_visitor::fill_interfaces (CORBA::InterfaceDefSeq &result,
+ AST_Interface **list,
+ CORBA::Long length
+ ACE_ENV_ARG_DECL)
+{
+ // Not sure if this could be negative in some default case or
+ // not. If it's 0, we should make the call anyway to clear
+ // existing entries, if any, from the repository.
+ if (length > 0)
+ {
+ CORBA::ULong u_length = static_cast<CORBA::ULong> (length);
+ result.length (u_length);
+
+ for (CORBA::ULong i = 0; i < u_length; ++i)
+ {
+ // Get list[i] into ir_current_.
+ (void) list[i]->ast_accept (this);
+
+ result[i] =
+ CORBA::InterfaceDef::_narrow (this->ir_current_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+}
+
+void
+ifr_adding_visitor::fill_initializers (CORBA::ExtInitializerSeq &result,
+ AST_ValueType *node
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ result.length (0);
+ AST_Decl *item = 0;
+ ACE_Vector<AST_Factory *> factories;
+
+ for (UTL_ScopeActiveIterator v_iter (node,
+ UTL_Scope::IK_decls);
+ !v_iter.is_done ();
+ v_iter.next ())
+ {
+ item = v_iter.item ();
+
+ if (item->node_type () == AST_Decl::NT_factory)
+ {
+ factories.push_back (AST_Factory::narrow_from_decl (item));
+ }
+ }
+
+ CORBA::ULong n_factories = factories.size ();
+
+ if (n_factories == 0)
+ {
+ return;
+ }
+
+ result.length (n_factories);
+ CORBA::ULong n_args = 0;
+ AST_Argument *arg = 0;
+ CORBA::ULong index = 0;
+ AST_Exception *excp = 0;
+ CORBA::Contained_var holder;
+
+ for (CORBA::ULong i = 0; i < n_factories; ++i)
+ {
+ result[i].name =
+ CORBA::string_dup (factories[i]->local_name ()->get_string ());
+ n_args = static_cast<CORBA::ULong> (factories[i]->argument_count ());
+ result[i].members.length (n_args);
+
+ // The factory should have nothing in its scope but args.
+ for (UTL_ScopeActiveIterator f_iter (factories[i],
+ UTL_Scope::IK_decls);
+ !f_iter.is_done ();
+ f_iter.next (), ++index)
+ {
+ arg = AST_Argument::narrow_from_decl (f_iter.item ());
+ result[i].members[index].name =
+ CORBA::string_dup (arg->local_name ()->get_string ());
+ result[i].members[index].type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+
+ /// This will put the field type in ir_current_, and also add it
+ /// to the repository if it's not already there.
+ if (arg->field_type ()->ast_accept (this) != 0)
+ {
+ ACE_ERROR ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor::")
+ ACE_TEXT ("fill_initializers -")
+ ACE_TEXT (" failed to accept arg type visitor\n")
+ ));
+ }
+
+ result[i].members[index].type_def =
+ CORBA::IDLType::_duplicate (this->ir_current_.in ());
+ }
+
+ CORBA::ULong n_exceptions =
+ static_cast<CORBA::ULong> (factories[i]->n_exceptions ());
+ result[i].exceptions.length (n_exceptions);
+ index = 0;
+
+ for (UTL_ExceptlistActiveIterator ei (factories[i]->exceptions ());
+ !ei.is_done ();
+ ei.next ())
+ {
+ excp = AST_Exception::narrow_from_decl (ei.item ());
+ result[i].exceptions[index].name =
+ CORBA::string_dup (excp->local_name ()->get_string ());
+ result[i].exceptions[index].id = excp->repoID ();
+ result[i].exceptions[index].defined_in =
+ ScopeAsDecl (excp->defined_in ())->repoID ();
+ result[i].exceptions[index].version = excp->version ();
+ result[i].exceptions[index++].type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+ }
+ }
+}
+
+void
+ifr_adding_visitor::fill_get_exceptions (CORBA::ExceptionDefSeq &result,
+ AST_Attribute *node
+ ACE_ENV_ARG_DECL)
+{
+ this->fill_exceptions (result,
+ node->get_get_exceptions ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+ifr_adding_visitor::fill_set_exceptions (CORBA::ExceptionDefSeq &result,
+ AST_Attribute *node
+ ACE_ENV_ARG_DECL)
+{
+ this->fill_exceptions (result,
+ node->get_set_exceptions ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+ifr_adding_visitor::fill_exceptions (CORBA::ExceptionDefSeq &result,
+ AST_Decl *node
+ ACE_ENV_ARG_DECL)
+{
+ switch (node->node_type ())
+ {
+ case AST_Decl::NT_op:
+ {
+ AST_Operation *op = AST_Operation::narrow_from_decl (node);
+ this->fill_exceptions (result,
+ op->exceptions ()
+ ACE_ENV_ARG_PARAMETER);
+ return;
+ }
+ case AST_Decl::NT_factory:
+ {
+ AST_Factory *f = AST_Factory::narrow_from_decl (node);
+ this->fill_exceptions (result,
+ f->exceptions ()
+ ACE_ENV_ARG_PARAMETER);
+ return;
+ }
+ default:
+ result.length (0);
+ return;
+ }
+}
+
+void
+ifr_adding_visitor::fill_exceptions (CORBA::ExceptionDefSeq &result,
+ UTL_ExceptList *list
+ ACE_ENV_ARG_DECL)
+{
+ if (list == 0)
+ {
+ result.length (0);
+ return;
+ }
+
+ result.length (static_cast<CORBA::ULong> (list->length ()));
+ CORBA::ULong index = 0;
+ AST_Decl *d = 0;
+ CORBA::Contained_var holder;
+
+ for (UTL_ExceptlistActiveIterator ei (list);
+ !ei.is_done ();
+ ei.next (), ++index)
+ {
+ d = ei.item ();
+
+ // Just to make sure. The call will return quickly if d has already
+ // been visited. Can't use ir_current_ because ExceptionDef doesn't
+ // inherit from IDLType.
+ (void) d->ast_accept (this);
+
+ holder = be_global->repository ()->lookup_id (d->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ result[index] =
+ CORBA::ExceptionDef::_narrow (holder.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ifr_adding_visitor::fill_params (CORBA::ParDescriptionSeq &result,
+ AST_Operation *node
+ ACE_ENV_ARG_DECL)
+{
+ AST_Argument *arg = 0;
+ CORBA::ULong n_args = static_cast<CORBA::ULong> (node->argument_count ());
+ result.length (n_args);
+ CORBA::ULong index = 0;
+ CORBA::Contained_var holder;
+
+ for (UTL_ScopeActiveIterator iter (node,
+ UTL_Scope::IK_decls);
+ ! iter.is_done ();
+ iter.next (), ++index)
+ {
+ arg = AST_Argument::narrow_from_decl (iter.item ());
+ result[index].name =
+ CORBA::string_dup (arg->local_name ()->get_string ());
+ result[index].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+
+ // Get the arg type into ir_current_.
+ (void) arg->ast_accept (this);
+
+ result[index].type_def =
+ CORBA::IDLType::_duplicate (this->ir_current_.in ());
+ ACE_CHECK;
+
+ result[index].mode = CORBA::PARAM_IN;
+ }
+}
+
+void
+ifr_adding_visitor::visit_all_provides (AST_Component *node,
+ CORBA::ComponentIR::ComponentDef_ptr c
+ ACE_ENV_ARG_DECL)
+{
+ AST_Component::port_description *tmp = 0;
+ CORBA::Contained_var contained;
+ CORBA::InterfaceDef_var interface_type;
+ CORBA::ComponentIR::ProvidesDef_var new_def;
+ char *local_name = 0;
+
+ for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> i (
+ node->provides ()
+ );
+ ! i.done ();
+ i.advance ())
+ {
+ i.next (tmp);
+ contained = be_global->repository ()->lookup_id (tmp->impl->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ interface_type = CORBA::InterfaceDef::_narrow (contained.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_CString str (node->repoID ());
+ local_name = tmp->id->get_string ();
+ this->expand_id (str, local_name);
+ new_def = c->create_provides (str.fast_rep (),
+ local_name,
+ tmp->impl->version (),
+ interface_type.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ifr_adding_visitor::visit_all_uses (AST_Component *node,
+ CORBA::ComponentIR::ComponentDef_ptr c
+ ACE_ENV_ARG_DECL)
+{
+ AST_Component::port_description *tmp = 0;
+ CORBA::Contained_var contained;
+ CORBA::InterfaceDef_var interface_type;
+ CORBA::ComponentIR::UsesDef_var new_def;
+ char *local_name = 0;
+
+ for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> i (
+ node->uses ()
+ );
+ ! i.done ();
+ i.advance ())
+ {
+ i.next (tmp);
+ contained = be_global->repository ()->lookup_id (tmp->impl->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ interface_type = CORBA::InterfaceDef::_narrow (contained.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_CString str (node->repoID ());
+ local_name = tmp->id->get_string ();
+ this->expand_id (str, local_name);
+ new_def = c->create_uses (str.fast_rep (),
+ local_name,
+ tmp->impl->version (),
+ interface_type.in (),
+ static_cast<CORBA::Boolean> (tmp->is_multiple)
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ifr_adding_visitor::visit_all_emits (AST_Component *node,
+ CORBA::ComponentIR::ComponentDef_ptr c
+ ACE_ENV_ARG_DECL)
+{
+ AST_Component::port_description *tmp = 0;
+ CORBA::Contained_var contained;
+ CORBA::ComponentIR::EventDef_var event_type;
+ CORBA::ComponentIR::EmitsDef_var new_def;
+ char *local_name = 0;
+
+ for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> i (
+ node->emits ()
+ );
+ ! i.done ();
+ i.advance ())
+ {
+ i.next (tmp);
+ contained = be_global->repository ()->lookup_id (tmp->impl->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ event_type =
+ CORBA::ComponentIR::EventDef::_narrow (contained.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_CString str (node->repoID ());
+ local_name = tmp->id->get_string ();
+ this->expand_id (str, local_name);
+ new_def = c->create_emits (str.fast_rep (),
+ local_name,
+ tmp->impl->version (),
+ event_type.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ifr_adding_visitor::visit_all_publishes (AST_Component *node,
+ CORBA::ComponentIR::ComponentDef_ptr c
+ ACE_ENV_ARG_DECL)
+{
+ AST_Component::port_description *tmp = 0;
+ CORBA::Contained_var contained;
+ CORBA::ComponentIR::EventDef_var event_type;
+ CORBA::ComponentIR::PublishesDef_var new_def;
+ char *local_name = 0;
+
+ for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> i (
+ node->publishes ()
+ );
+ ! i.done ();
+ i.advance ())
+ {
+ i.next (tmp);
+ contained = be_global->repository ()->lookup_id (tmp->impl->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ event_type =
+ CORBA::ComponentIR::EventDef::_narrow (contained.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_CString str (node->repoID ());
+ local_name = tmp->id->get_string ();
+ this->expand_id (str, local_name);
+ new_def = c->create_publishes (str.fast_rep (),
+ local_name,
+ tmp->impl->version (),
+ event_type.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ifr_adding_visitor::visit_all_consumes (AST_Component *node,
+ CORBA::ComponentIR::ComponentDef_ptr c
+ ACE_ENV_ARG_DECL)
+{
+ AST_Component::port_description *tmp = 0;
+ CORBA::Contained_var contained;
+ CORBA::ComponentIR::EventDef_var event_type;
+ CORBA::ComponentIR::ConsumesDef_var new_def;
+ char *local_name = 0;
+
+ for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> i (
+ node->consumes ()
+ );
+ ! i.done ();
+ i.advance ())
+ {
+ i.next (tmp);
+ contained = be_global->repository ()->lookup_id (tmp->impl->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ event_type =
+ CORBA::ComponentIR::EventDef::_narrow (contained.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_CString str (node->repoID ());
+ local_name = tmp->id->get_string ();
+ this->expand_id (str, local_name);
+ new_def = c->create_consumes (str.fast_rep (),
+ local_name,
+ tmp->impl->version (),
+ event_type.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ifr_adding_visitor::visit_all_factories (AST_Home *node,
+ CORBA::ComponentIR::HomeDef_ptr h
+ ACE_ENV_ARG_DECL)
+{
+ AST_Operation **tmp = 0;
+ CORBA::Contained_var contained;
+ CORBA::ComponentIR::FactoryDef_var new_def;
+
+ for (ACE_Unbounded_Queue_Iterator<AST_Operation *> i (node->factories ());
+ ! i.done ();
+ i.advance ())
+ {
+ i.next (tmp);
+ CORBA::ParDescriptionSeq params;
+ this->fill_params (params,
+ *tmp
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ExceptionDefSeq exceptions;
+ this->fill_exceptions (exceptions,
+ *tmp
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ new_def = h->create_factory ((*tmp)->repoID (),
+ (*tmp)->local_name ()->get_string (),
+ (*tmp)->version (),
+ params,
+ exceptions
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ifr_adding_visitor::visit_all_finders (AST_Home *node,
+ CORBA::ComponentIR::HomeDef_ptr h
+ ACE_ENV_ARG_DECL)
+{
+ AST_Operation **tmp = 0;
+ CORBA::Contained_var contained;
+ CORBA::ComponentIR::FinderDef_var new_def;
+
+ for (ACE_Unbounded_Queue_Iterator<AST_Operation *> i (node->finders ());
+ ! i.done ();
+ i.advance ())
+ {
+ i.next (tmp);
+ CORBA::ParDescriptionSeq params;
+ this->fill_params (params,
+ *tmp
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ExceptionDefSeq exceptions;
+ this->fill_exceptions (exceptions,
+ *tmp
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ new_def = h->create_finder ((*tmp)->repoID (),
+ (*tmp)->local_name ()->get_string (),
+ (*tmp)->version (),
+ params,
+ exceptions
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ifr_adding_visitor::expand_id (ACE_CString &str,
+ const char *local_name)
+{
+ ssize_t pos = str.rfind (':');
+ str = str.substr (0, pos) + '/' + local_name + str.substr (pos);
+}
diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.h b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.h
new file mode 100644
index 00000000000..839373308e1
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.h
@@ -0,0 +1,282 @@
+// $Id$
+
+/* -*- C++ -*- */
+// ============================================================================
+//
+// = LIBRARY
+// TAO_IFR_BE_DLL
+//
+// = FILENAME
+// ifr_adding_visitor.h
+//
+// = DESCRIPTION
+// Header file for class ifr_adding_visitor.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_IFR_ADDING_VISITOR_H
+#define TAO_IFR_ADDING_VISITOR_H
+
+#include "ifr_visitor.h"
+#include "tao/IFR_Client/IFR_ComponentsC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class UTL_ExceptList;
+
+class ifr_adding_visitor : public ifr_visitor
+{
+ //
+ // = TITLE
+ // ifr_adding_visitor.
+ //
+ // = DESCRIPTION
+ // This visitor adds items found in the IDL file being processed
+ // to the Interface Repository.
+ //
+public:
+ ifr_adding_visitor (AST_Decl *scope,
+ CORBA::Boolean in_reopened = 0);
+ // Constructor.
+
+ virtual ~ifr_adding_visitor (void);
+ // Destructor.
+
+ virtual int visit_scope (UTL_Scope *node);
+ // Visit the scope.
+
+ virtual int visit_predefined_type (AST_PredefinedType *node);
+ // Visit the predefined type.
+
+ virtual int visit_module (AST_Module *node);
+ // Visit module.
+
+ virtual int visit_interface (AST_Interface *node);
+ // Visit interface.
+
+ virtual int visit_interface_fwd (AST_InterfaceFwd *node);
+ // Visit interface_fwd.
+
+ virtual int visit_valuebox (AST_ValueBox *node);
+ // Visit valuebox.
+
+ virtual int visit_valuetype (AST_ValueType *node);
+ // Visit valuetype.
+
+ virtual int visit_valuetype_fwd (AST_ValueTypeFwd *node);
+ // Visit valuetype_fwd.
+
+ virtual int visit_component (AST_Component *node);
+ // Visit component.
+
+ virtual int visit_component_fwd (AST_ComponentFwd *node);
+ // Visit component_fwd
+
+ virtual int visit_eventtype (AST_EventType *node);
+ // Visit valuetype.
+
+ virtual int visit_eventtype_fwd (AST_EventTypeFwd *node);
+ // Visit valuetype_fwd
+
+ virtual int visit_home (AST_Home *node);
+ // Visit component home.
+
+ virtual int visit_factory (AST_Factory *node);
+ // Visit a factory construct.
+
+ virtual int visit_structure (AST_Structure *node);
+ // Visit a structure.
+
+ virtual int visit_exception (AST_Exception *node);
+ // Visit exception
+
+ virtual int visit_enum (AST_Enum *node);
+ // Visit an enum.
+
+ virtual int visit_operation (AST_Operation *node);
+ // Visit an operation.
+
+ virtual int visit_field (AST_Field *node);
+ // Visit a field.
+
+ virtual int visit_attribute (AST_Attribute *node);
+ // Visit an attribute.
+
+ virtual int visit_union (AST_Union *node);
+ // Visit union.
+
+ virtual int visit_constant (AST_Constant *node);
+ // Visit a constant.
+
+ virtual int visit_array (AST_Array *node);
+ // Visit an array.
+
+ virtual int visit_sequence (AST_Sequence *node);
+ // Visit a sequence.
+
+ virtual int visit_string (AST_String *node);
+ // Visit a string.
+
+ virtual int visit_typedef (AST_Typedef *node);
+ // Visit a typedef.
+
+ virtual int visit_root (AST_Root *node);
+ // Visit the root.
+
+ virtual int visit_native (AST_Native *node);
+ // Visit a native.
+
+protected:
+ CORBA::PrimitiveKind expr_type_to_pkind (AST_Expression::ExprType et);
+ CORBA::PrimitiveKind predefined_type_to_pkind (AST_PredefinedType *node);
+ // Conversion functions.
+
+ void load_any (AST_Expression::AST_ExprValue *ev,
+ CORBA::Any &any);
+ // Determine the primitive type and insert into the Any.
+
+ void element_type (AST_Type *base_type
+ ACE_ENV_ARG_DECL);
+ // Creates or looks up the element type of an array or sequence,
+ // and stores the result in ir_current_.
+
+ int create_interface_def (AST_Interface *node
+ ACE_ENV_ARG_DECL);
+ // Code encapsulated out of visit_interface().
+
+ int create_value_def (AST_ValueType *node
+ ACE_ENV_ARG_DECL);
+ // Code encapsulated out of visit_valuetype().
+
+ int create_component_def (AST_Component *node
+ ACE_ENV_ARG_DECL);
+ // Code encapsulated out of visit_component().
+
+ int create_home_def (AST_Home *node
+ ACE_ENV_ARG_DECL);
+ // Code encapsulated out of visit_home().
+
+ int create_event_def (AST_EventType *node
+ ACE_ENV_ARG_DECL);
+ // Code encapsulated out of visit_eventtype().
+
+ int create_value_member (AST_Field *node);
+ // Conditional call from visit_field().
+
+ void get_referenced_type (AST_Type *node
+ ACE_ENV_ARG_DECL);
+ // Utility method to update ir_current_ for struct members, union
+ // members, operation parameters and operation return types.
+
+ void fill_base_value (CORBA::ValueDef_ptr &result,
+ AST_ValueType *node
+ ACE_ENV_ARG_DECL);
+
+ void fill_base_component (CORBA::ComponentIR::ComponentDef_ptr &result,
+ AST_Component *node
+ ACE_ENV_ARG_DECL);
+
+ void fill_base_home (CORBA::ComponentIR::HomeDef_ptr &result,
+ AST_Home *node
+ ACE_ENV_ARG_DECL);
+
+ void fill_managed_component (CORBA::ComponentIR::ComponentDef_ptr &result,
+ AST_Home *node
+ ACE_ENV_ARG_DECL);
+
+ void fill_primary_key (CORBA::ValueDef_ptr &result,
+ AST_Home *node
+ ACE_ENV_ARG_DECL);
+
+ void fill_abstract_base_values (CORBA::ValueDefSeq &result,
+ AST_ValueType *node
+ ACE_ENV_ARG_DECL);
+
+ void fill_inherited_interfaces (CORBA::InterfaceDefSeq &result,
+ AST_Interface *node
+ ACE_ENV_ARG_DECL);
+
+ void fill_supported_interfaces (CORBA::InterfaceDefSeq &result,
+ AST_Interface *node
+ ACE_ENV_ARG_DECL);
+
+ void fill_interfaces (CORBA::InterfaceDefSeq &result,
+ AST_Interface **list,
+ CORBA::Long length
+ ACE_ENV_ARG_DECL);
+
+ void fill_initializers (CORBA::ExtInitializerSeq &result,
+ AST_ValueType *node
+ ACE_ENV_ARG_DECL);
+
+ void fill_get_exceptions (CORBA::ExceptionDefSeq &result,
+ AST_Attribute *node
+ ACE_ENV_ARG_DECL);
+
+ void fill_set_exceptions (CORBA::ExceptionDefSeq &result,
+ AST_Attribute *node
+ ACE_ENV_ARG_DECL);
+
+ void fill_exceptions (CORBA::ExceptionDefSeq &result,
+ AST_Decl *node
+ ACE_ENV_ARG_DECL);
+
+ void fill_exceptions (CORBA::ExceptionDefSeq &result,
+ UTL_ExceptList *list
+ ACE_ENV_ARG_DECL);
+
+ void fill_params (CORBA::ParDescriptionSeq &result,
+ AST_Operation *node
+ ACE_ENV_ARG_DECL);
+
+ void visit_all_provides (AST_Component *node,
+ CORBA::ComponentIR::ComponentDef_ptr c
+ ACE_ENV_ARG_DECL);
+
+ void visit_all_uses (AST_Component *node,
+ CORBA::ComponentIR::ComponentDef_ptr c
+ ACE_ENV_ARG_DECL);
+
+ void visit_all_emits (AST_Component *node,
+ CORBA::ComponentIR::ComponentDef_ptr c
+ ACE_ENV_ARG_DECL);
+
+ void visit_all_publishes (AST_Component *node,
+ CORBA::ComponentIR::ComponentDef_ptr c
+ ACE_ENV_ARG_DECL);
+
+ void visit_all_consumes (AST_Component *node,
+ CORBA::ComponentIR::ComponentDef_ptr c
+ ACE_ENV_ARG_DECL);
+
+ void visit_all_factories (AST_Home *node,
+ CORBA::ComponentIR::HomeDef_ptr h
+ ACE_ENV_ARG_DECL);
+
+ void visit_all_finders (AST_Home *node,
+ CORBA::ComponentIR::HomeDef_ptr h
+ ACE_ENV_ARG_DECL);
+
+ void expand_id (ACE_CString &str,
+ const char *local_name);
+
+protected:
+ CORBA::IDLType_var ir_current_;
+ // Holder for the IR object most recently created or looked up by
+ // the visitor. This makes it accessible by visitor methods that
+ // need the result of a call to another visitor method that
+ // creates an IR object.
+
+ AST_Decl *scope_;
+ // Store the node whose scope (if any) we will be visiting.
+
+ CORBA::Boolean in_reopened_;
+ // Are we traversing the scope of a reopened module?
+};
+
+#endif /* TAO_IFR_ADDING_VISITOR_H */
diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_exception.cpp b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_exception.cpp
new file mode 100644
index 00000000000..d22c22c825b
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_exception.cpp
@@ -0,0 +1,487 @@
+/* -*- c++ -*- */
+// $Id$
+
+#include "ast_enum.h"
+#include "ast_exception.h"
+#include "ast_expression.h"
+#include "ast_field.h"
+#include "ast_union.h"
+#include "utl_identifier.h"
+
+#include "ifr_adding_visitor_exception.h"
+#include "ifr_adding_visitor_structure.h"
+#include "ifr_adding_visitor_union.h"
+
+ACE_RCSID (IFR_Service,
+ ifr_adding_visitor_exception,
+ "$Id$")
+
+ifr_adding_visitor_exception::ifr_adding_visitor_exception (
+ AST_Decl *scope,
+ CORBA::Boolean in_reopened
+ )
+ : ifr_adding_visitor (scope,
+ in_reopened)
+{
+}
+
+ifr_adding_visitor_exception::~ifr_adding_visitor_exception (void)
+{
+}
+
+// Specialized visit_scope method for exceptions only.
+int
+ifr_adding_visitor_exception::visit_scope (UTL_Scope *node)
+{
+ // If the exception has members that are scopes but not exceptions,
+ // the regular visit_scope method should be called instead.
+ if (node->scope_node_type () != AST_Decl::NT_except)
+ {
+ return ifr_adding_visitor::visit_scope (node);
+ }
+
+ AST_Exception *e = AST_Exception::narrow_from_scope (node);
+
+ CORBA::ULong nfields = static_cast<CORBA::ULong> (e->nfields ());
+
+ this->members_.length (nfields);
+
+ AST_Field **f = 0;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Visit each field.
+ for (CORBA::ULong i = 0; i < nfields; ++i)
+ {
+ if (e->field (f, i) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_exception::")
+ ACE_TEXT ("visit_scope -")
+ ACE_TEXT (" field node access failed\n")
+ ),
+ -1
+ );
+ }
+
+ AST_Type *ft = (*f)->field_type ();
+
+ bool defined_here = ft->is_child (this->scope_);
+
+ // If the struct member is defined in the struct, we have to
+ // do some visiting - otherwise we can just look up the entry.
+ if (defined_here)
+ {
+ if (ft->ast_accept (this) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_exception::")
+ ACE_TEXT ("visit_scope -")
+ ACE_TEXT (" failed to accept visitor\n")
+ ),
+ -1
+ );
+ }
+ }
+ else
+ {
+ // Updates ir_current_.
+ this->get_referenced_type (ft ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ this->members_[i].name =
+ CORBA::string_dup ((*f)->local_name ()->get_string ());
+
+ // IfR method create_exception does not use this - it just needs
+ // to be non-zero for marshaling.
+ this->members_[i].type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+
+ this->members_[i].type_def =
+ CORBA::IDLType::_duplicate (this->ir_current_.in ());
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor_structure::visit_scope")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor_exception::visit_structure (AST_Structure *node)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this union already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If not, create a new entry.
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ ifr_adding_visitor_structure visitor (node,
+ 1);
+
+ int retval = visitor.visit_structure (node);
+
+ if (retval == 0)
+ {
+ // Get the result of the visit.
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (visitor.ir_current ());
+
+ CORBA::Contained_ptr tmp =
+ CORBA::Contained::_narrow (visitor.ir_current ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Since the enclosing ExceptionDef hasn't been created
+ // yet, we don't have a scope, so this nested StructDef
+ // (which was created at global scope) goes on the
+ // queue to be moved later.
+ this->move_queue_.enqueue_tail (tmp);
+ }
+
+ return retval;
+ }
+ else
+ {
+ // If the line below is true, we are clobbering a previous
+ // entry (from another IDL file) of another type. In that
+ // case we do what other ORB vendors do, and destroy the
+ // original entry, create the new one, and let the user beware.
+ if (node->ifr_added () == 0)
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This call will take the other branch.
+ return this->visit_structure (node);
+ }
+
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor_exception::visit_structure")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor_exception::visit_exception (AST_Exception *node)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (!CORBA::is_nil (prev_def.in ()))
+ {
+ // If we and our enclosing module are both already in the
+ // repository, we are probably processing the same IDL file
+ // a second time. If it is just a name clash, there is no
+ // way to detect it.
+ if (this->in_reopened_ == 1)
+ {
+ return 0;
+ }
+
+ // If the line below is true, we are clobbering a previous
+ // entry (from another IDL file) of another type. In that
+ // case we do what other ORB vendors do, and destroy the
+ // original entry, create the new one, and let the user beware.
+ if (node->ifr_added () == 0)
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This call will create a new ExceptionDef entry.
+ return this->visit_exception (node);
+ }
+ else
+ {
+ // The node is being referenced in an operation, no action.
+ return 0;
+ }
+ }
+
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_exception::")
+ ACE_TEXT ("visit_exception -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_exception::")
+ ACE_TEXT ("visit_exception -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ CORBA::ExceptionDef_var new_def =
+ current_scope->create_exception (node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ this->members_
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+ size_t size = this->move_queue_.size ();
+
+ if (size > 0)
+ {
+ CORBA::Contained_var traveller;
+
+ CORBA::Container_var new_container =
+ CORBA::Container::_narrow (new_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ for (size_t i = 0; i < size; ++i)
+ {
+ this->move_queue_.dequeue_head (traveller);
+
+ CORBA::String_var name =
+ traveller->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var version =
+ traveller->version (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ traveller->move (new_container.in (),
+ name.in (),
+ version.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ node->ifr_added (1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor_exception::visit_exception")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor_exception::visit_enum (AST_Enum *node)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this enum already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If not, create a new entry.
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ CORBA::ULong member_count = static_cast<CORBA::ULong> (node->member_count ());
+
+ CORBA::EnumMemberSeq members (member_count);
+ members.length (member_count);
+
+ UTL_ScopedName *member_name = 0;
+
+ // Get a list of the member names.
+ for (CORBA::ULong i = 0; i < member_count; ++i)
+ {
+ member_name = node->value_to_name (i);
+
+ members[i] =
+ CORBA::string_dup (
+ member_name->last_component ()->get_string ()
+ );
+ }
+
+ this->ir_current_ =
+ be_global->repository ()->create_enum (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+
+ CORBA::Contained_ptr tmp =
+ CORBA::Contained::_narrow (this->ir_current_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->move_queue_.enqueue_tail (tmp);
+
+ node->ifr_added (1);
+ }
+ else
+ {
+ // If the line below is true, we are clobbering a previous
+ // entry (from another IDL file) of another type. In that
+ // case we do what other ORB vendors do, and destroy the
+ // original entry, create the new one, and let the user beware.
+ if (node->ifr_added () == 0)
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This call will take the other branch.
+ return this->visit_enum (node);
+ }
+
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor_exception::visit_enum")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor_exception::visit_union (AST_Union *node)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this union already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If not, create a new entry.
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ ifr_adding_visitor_union visitor (node,
+ 1);
+
+ int retval = visitor.visit_union (node);
+
+ if (retval == 0)
+ {
+ // Get the result of the visit.
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (visitor.ir_current ());
+
+ CORBA::Contained_ptr tmp =
+ CORBA::Contained::_narrow (visitor.ir_current ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Since the enclosing ExceptionDef hasn't been created
+ // yet, we don't have a scope, so this nested UnionDef
+ // (which was created at global scope) goes on the
+ // queue to be moved later.
+ this->move_queue_.enqueue_tail (tmp);
+ }
+
+ return retval;
+ }
+ else
+ {
+ // If the line below is true, we are clobbering a previous
+ // entry (from another IDL file) of another type. In that
+ // case we do what other ORB vendors do, and destroy the
+ // original entry, create the new one, and let the user beware.
+ if (node->ifr_added () == 0)
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This call will take the other branch.
+ return this->visit_union (node);
+ }
+
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor_exception::visit_union")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+CORBA::IDLType_ptr
+ifr_adding_visitor_exception::ir_current (void) const
+{
+ return this->ir_current_.in ();
+}
diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_exception.h b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_exception.h
new file mode 100644
index 00000000000..058bbd7c35a
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_exception.h
@@ -0,0 +1,79 @@
+// $Id$
+
+/* -*- c++ -*- */
+// ============================================================================
+//
+// = LIBRARY
+// TAO_IFR_BE_DLL
+//
+// = FILENAME
+// ifr_adding_visitor_exception.h
+//
+// = DESCRIPTION
+// Header file for class ifr_adding_visitor_exception.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_IFR_ADDING_VISITOR_EXCEPTION_H
+#define TAO_IFR_ADDING_VISITOR_EXCEPTION_H
+
+#include "ifr_adding_visitor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class ifr_adding_visitor_exception : public ifr_adding_visitor
+{
+ //
+ // = TITLE
+ // ifr_adding_visitor_exception.
+ //
+ // = DESCRIPTION
+ // This visitor overrides a few of the visit methods
+ // for the case when an exception node is seen in the AST.
+ //
+public:
+ ifr_adding_visitor_exception (AST_Decl *scope,
+ CORBA::Boolean in_reopened_);
+ // Constructor.
+
+ virtual ~ifr_adding_visitor_exception (void);
+ // Destructor.
+
+ virtual int visit_scope (UTL_Scope *node);
+ // Visit a struct.
+
+ virtual int visit_structure (AST_Structure *node);
+ // Visit a struct.
+
+ virtual int visit_exception (AST_Exception *node);
+ // Visit a struct.
+
+ virtual int visit_enum (AST_Enum *node);
+ // Visit an enum.
+
+ virtual int visit_union (AST_Union *node);
+ // Visit union.
+
+ virtual CORBA::IDLType_ptr ir_current (void) const;
+ // Lets the visitor one level above acess this value.
+
+private:
+ CORBA::Boolean is_nested_;
+ // Is this visitor visiting a struct that was defined inside
+ // a union, an exception, or another struct?
+
+ CORBA::StructMemberSeq members_;
+ // Holder for the member list passed to create_struct() or
+ // create_exception().
+
+ ACE_Unbounded_Queue<CORBA::Contained_ptr> move_queue_;
+ // IR objects that must be moved into the scope (struct or
+ // exception) where they were declared in the IDL file.
+};
+
+#endif /* TAO_IFR_ADDING_VISITOR_EXCEPTION_H */
diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_operation.cpp b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_operation.cpp
new file mode 100644
index 00000000000..63ff0eaefbf
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_operation.cpp
@@ -0,0 +1,280 @@
+/* -*- c++ -*- */
+// $Id$
+
+#include "ast_argument.h"
+#include "ast_exception.h"
+#include "ast_expression.h"
+#include "ast_operation.h"
+#include "utl_identifier.h"
+#include "utl_string.h"
+
+#include "ifr_adding_visitor_operation.h"
+#include "utl_exceptlist.h"
+#include "utl_strlist.h"
+#include "nr_extern.h"
+
+ACE_RCSID (IFR_Service,
+ ifr_adding_visitor_operation,
+ "$Id$")
+
+ifr_adding_visitor_operation::ifr_adding_visitor_operation (AST_Decl *scope)
+ : ifr_adding_visitor (scope),
+ index_ (0)
+{
+}
+
+ifr_adding_visitor_operation::~ifr_adding_visitor_operation (void)
+{
+}
+
+int
+ifr_adding_visitor_operation::visit_operation (AST_Operation *node)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // If this operation is already in the repository (for example, if
+ // we are processing the IDL file a second time inadvertently), we
+ // just return 0. The IDL file must be legal, otherwise the IDL
+ // compiler front end would have told us.
+
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (!CORBA::is_nil (prev_def.in ()))
+ {
+ return 0;
+ }
+
+ // Build the parameter list. Our overridden version of visit_argument
+ // will look up each parameter and add its repository entry to
+ // our params_ member.
+
+ CORBA::ULong length = static_cast<CORBA::ULong> (node->argument_count ());
+
+ this->params_.length (length);
+
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_operation::")
+ ACE_TEXT ("visit_operation -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ this->index_ = 0;
+
+ // Build the exception list.
+
+ UTL_ExceptList *excepts = node->exceptions ();
+
+ if (excepts != 0)
+ {
+ length = static_cast<CORBA::ULong> (excepts->length ());
+ }
+ else
+ {
+ length = 0;
+ }
+
+ CORBA::ExceptionDefSeq exceptions (length);
+ exceptions.length (length);
+
+ AST_Exception *ex = 0;
+ CORBA::ULong i = 0;
+
+ for (UTL_ExceptlistActiveIterator ex_iter (excepts);
+ !ex_iter.is_done ();
+ ex_iter.next (), ++i)
+ {
+ ex = ex_iter.item ();
+
+ prev_def =
+ be_global->repository ()->lookup_id (ex->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ exceptions[i] =
+ CORBA::ExceptionDef::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Build the context list.
+
+ UTL_StrList *ctx_list = node->context ();
+
+ if (ctx_list != 0)
+ {
+ length = static_cast<CORBA::ULong> (ctx_list->length ());
+ }
+ else
+ {
+ length = 0;
+ }
+
+ CORBA::ContextIdSeq contexts (length);
+ contexts.length (length);
+
+ UTL_StrlistActiveIterator ctx_iter (ctx_list);
+ UTL_String *str = 0;
+ i = 0;
+
+ while (!ctx_iter.is_done ())
+ {
+ str = ctx_iter.item ();
+
+ contexts[i++] = str->get_string ();
+
+ ctx_iter.next ();
+ }
+
+ // Get the return type.
+
+ AST_Type *return_type = node->return_type ();
+
+ // Updates ir_current_.
+ this->get_referenced_type (return_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Is the operation oneway?
+ CORBA::OperationMode mode = node->flags () == AST_Operation::OP_oneway
+ ? CORBA::OP_ONEWAY
+ : CORBA::OP_NORMAL;
+
+ // Create the repository entry.
+
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) == 0)
+ {
+ AST_Decl *op_scope = ScopeAsDecl (node->defined_in ());
+ AST_Decl::NodeType nt = op_scope->node_type ();
+
+ if (nt == AST_Decl::NT_interface)
+ {
+ CORBA::InterfaceDef_var iface =
+ CORBA::InterfaceDef::_narrow (current_scope
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::OperationDef_var new_def =
+ iface->create_operation (node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ this->ir_current_.in (),
+ mode,
+ this->params_,
+ exceptions,
+ contexts
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ CORBA::ValueDef_var vtype =
+ CORBA::ValueDef::_narrow (current_scope
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::OperationDef_var new_def =
+ vtype->create_operation (node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ this->ir_current_.in (),
+ mode,
+ this->params_,
+ exceptions,
+ contexts
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_operation::")
+ ACE_TEXT ("visit_operation -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor_operation::visit_operation")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor_operation::visit_argument (AST_Argument *node)
+{
+ // Get the parameter's name.
+ this->params_[this->index_].name =
+ CORBA::string_dup (node->local_name ()->get_string ());
+
+ AST_Type *arg_type = node->field_type ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Updates ir_current_.
+ this->get_referenced_type (arg_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->params_[this->index_].type_def =
+ CORBA::IDLType::_duplicate (this->ir_current_.in ());
+
+
+ switch (node->direction ())
+ {
+ case AST_Argument::dir_IN:
+ this->params_[this->index_].mode = CORBA::PARAM_IN;
+ break;
+ case AST_Argument::dir_OUT:
+ this->params_[this->index_].mode = CORBA::PARAM_OUT;
+ break;
+ case AST_Argument::dir_INOUT:
+ this->params_[this->index_].mode = CORBA::PARAM_INOUT;
+ break;
+ }
+
+ // IfR method create_operation does not use this - it just needs
+ // to be non-zero for marshaling.
+ this->params_[this->index_].type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+
+ ++this->index_;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor_operation::visit_argument")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_operation.h b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_operation.h
new file mode 100644
index 00000000000..73cc1bb6e95
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_operation.h
@@ -0,0 +1,61 @@
+// $Id$
+
+/* -*- C++ -*- */
+// ============================================================================
+//
+// = LIBRARY
+// TAO_IFR_BE_DLL
+//
+// = FILENAME
+// ifr_adding_visitor_operation.h
+//
+// = DESCRIPTION
+// Header file for class ifr_adding_visitor_operation.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_IFR_ADDING_VISITOR_OPERATION_H
+#define TAO_IFR_ADDING_VISITOR_OPERATION_H
+
+#include "ifr_adding_visitor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class ifr_adding_visitor_operation : public ifr_adding_visitor
+{
+ //
+ // = TITLE
+ // ifr_adding_visitor_operation.
+ //
+ // = DESCRIPTION
+ // This visitor overrides a few of the visit methods
+ // for the case when an operation node is seen in the AST.
+ //
+public:
+ ifr_adding_visitor_operation (AST_Decl *scope);
+ // Constructor.
+
+ virtual ~ifr_adding_visitor_operation (void);
+ // Destructor.
+
+ virtual int visit_operation (AST_Operation *node);
+ // Visit an operation.
+
+ virtual int visit_argument (AST_Argument *node);
+ // Visit argument.
+
+private:
+ CORBA::ParDescriptionSeq params_;
+ // Holder for the operation parameter info passed to the
+ // interface repository method create_operation().
+
+ CORBA::ULong index_;
+ // Counter for building the parameter list.
+};
+
+#endif /* TAO_IFR_ADDING_VISITOR_OPERATION_H */
diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_structure.cpp b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_structure.cpp
new file mode 100644
index 00000000000..6e3f4a4bbe5
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_structure.cpp
@@ -0,0 +1,451 @@
+/* -*- c++ -*- */
+// $Id$
+
+#include "ast_enum.h"
+#include "ast_expression.h"
+#include "ast_field.h"
+#include "ast_union.h"
+#include "utl_identifier.h"
+
+#include "ifr_adding_visitor_structure.h"
+#include "ifr_adding_visitor_union.h"
+
+ACE_RCSID (IFR_Service,
+ ifr_adding_visitor_structure,
+ "$Id$")
+
+ifr_adding_visitor_structure::ifr_adding_visitor_structure (
+ AST_Decl *scope,
+ CORBA::Boolean is_nested
+ )
+ : ifr_adding_visitor (scope),
+ is_nested_ (is_nested)
+{
+}
+
+ifr_adding_visitor_structure::~ifr_adding_visitor_structure (void)
+{
+}
+
+// Specialized visit_scope method for stucts only.
+int
+ifr_adding_visitor_structure::visit_scope (UTL_Scope *node)
+{
+ // If the struct has members that are scopes but not structs,
+ // the regular visit_scope method should be called instead.
+ if (node->scope_node_type () != AST_Decl::NT_struct)
+ {
+ return ifr_adding_visitor::visit_scope (node);
+ }
+
+ AST_Structure *s = AST_Structure::narrow_from_scope (node);
+ CORBA::ULong nfields = static_cast<CORBA::ULong> (s->nfields ());
+ this->members_.length (nfields);
+ AST_Field **f = 0;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Visit each field.
+ for (CORBA::ULong i = 0; i < nfields; ++i)
+ {
+ if (s->field (f, i) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_structure::")
+ ACE_TEXT ("visit_scope -")
+ ACE_TEXT (" field node access failed\n")
+ ),
+ -1
+ );
+ }
+
+ AST_Type *ft = (*f)->field_type ();
+ bool defined_here = ft->is_child (this->scope_);
+
+ // If the struct member is defined in the struct, we have to
+ // do some visiting - otherwise we can just look up the entry.
+ if (defined_here)
+ {
+ if (ft->node_type () == AST_Decl::NT_struct)
+ {
+ // Since the enclosing scope hasn't been created yet,
+ // we make a special visitor to create this member
+ // at global scope and move it into the struct later.
+ ifr_adding_visitor_structure visitor (ft, 1);
+
+ if (ft->ast_accept (&visitor) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_structure::")
+ ACE_TEXT ("visit_scope -")
+ ACE_TEXT (" failed to accept visitor\n")
+ ),
+ -1
+ );
+ }
+
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (visitor.ir_current ());
+
+ CORBA::Contained_ptr tmp =
+ CORBA::Contained::_narrow (visitor.ir_current ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->move_queue_.enqueue_tail (tmp);
+ }
+ else
+ {
+ if (ft->ast_accept (this) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_structure::")
+ ACE_TEXT ("visit_scope -")
+ ACE_TEXT (" failed to accept visitor\n")
+ ),
+ -1
+ );
+ }
+ }
+ }
+ else
+ {
+ // Updates ir_current_.
+ this->get_referenced_type (ft
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ this->members_[i].name =
+ CORBA::string_dup ((*f)->local_name ()->get_string ());
+
+ // IfR method create_struct does not use this - it just needs
+ // to be non-zero for marshaling.
+ this->members_[i].type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+
+ this->members_[i].type_def =
+ CORBA::IDLType::_duplicate (this->ir_current_.in ());
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor_structure::visit_scope")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor_structure::visit_structure (AST_Structure *node)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ CORBA::StructDef_var struct_def;
+ CORBA::StructMemberSeq dummyMembers( 0 );
+ dummyMembers.length( 0 );
+
+ CORBA::Container_ptr current_scope= CORBA::Container::_nil ();
+ if (this->is_nested_)
+ {
+ current_scope= be_global->holding_scope ();
+ }
+ else if (be_global->ifr_scopes ().top (current_scope) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_structure::")
+ ACE_TEXT ("visit_structure -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ // First create the named structure without any members
+ struct_def=
+ current_scope->create_struct (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ dummyMembers
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+
+ // Then recurse into the real structure members (which corrupts ir_current_)
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_structure::")
+ ACE_TEXT ("visit_structure -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ // Correct ir_current_ and move the real structure members into the struct
+ this->ir_current_= CORBA::StructDef::_duplicate (struct_def.in ());
+ struct_def->members( this->members_ );
+
+ ACE_TRY_CHECK;
+
+ size_t size = this->move_queue_.size ();
+
+ if (size > 0)
+ {
+ CORBA::Contained_var traveller;
+
+ CORBA::Container_var new_container =
+ CORBA::Container::_narrow (this->ir_current_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ for (size_t i = 0; i < size; ++i)
+ {
+ this->move_queue_.dequeue_head (traveller);
+
+ CORBA::String_var name =
+ traveller->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var version =
+ traveller->version (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ traveller->move (new_container.in (),
+ name.in (),
+ version.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ node->ifr_added (1);
+ }
+ else
+ {
+ // If the line below is true, we are clobbering a previous
+ // entry (from another IDL file) of another type. In that
+ // case we do what other ORB vendors do, and destroy the
+ // original entry, create the new one, and let the user beware.
+ if (node->ifr_added () == 0)
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This call will take the other branch.
+ return this->visit_structure (node);
+ }
+
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor_structure::visit_structure")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor_structure::visit_enum (AST_Enum *node)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this enum already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If not, create a new entry.
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ CORBA::ULong member_count = static_cast<CORBA::ULong> (node->member_count ());
+
+ CORBA::EnumMemberSeq members (member_count);
+ members.length (member_count);
+
+ UTL_ScopedName *member_name = 0;
+
+ // Get a list of the member names.
+ for (CORBA::ULong i = 0; i < member_count; ++i)
+ {
+ member_name = node->value_to_name (i);
+
+ members[i] =
+ CORBA::string_dup (
+ member_name->last_component ()->get_string ()
+ );
+ }
+
+ this->ir_current_ =
+ be_global->repository ()->create_enum (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+
+ CORBA::Contained_ptr tmp =
+ CORBA::Contained::_narrow (this->ir_current_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Since the enclosing StructDef hasn't been created
+ // yet, we don't have a scope, so this nested EnumDef
+ // (which was created at global scope) goes on the
+ // queue to be moved later.
+ this->move_queue_.enqueue_tail (tmp);
+
+ node->ifr_added (1);
+ }
+ else
+ {
+ // If the line below is true, we are clobbering a previous
+ // entry (from another IDL file) of another type. In that
+ // case we do what other ORB vendors do, and destroy the
+ // original entry, create the new one, and let the user beware.
+ if (node->ifr_added () == 0)
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This call will take the other branch.
+ return this->visit_enum (node);
+ }
+
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor_structure::visit_enum")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor_structure::visit_union (AST_Union *node)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this union already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If not, create a new entry.
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ ifr_adding_visitor_union visitor (node,
+ 1);
+
+ int retval = visitor.visit_union (node);
+
+ if (retval == 0)
+ {
+ // Get the result of the visit.
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (visitor.ir_current ());
+
+ CORBA::Contained_ptr tmp =
+ CORBA::Contained::_narrow (visitor.ir_current ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Since the enclosing StructDef hasn't been created
+ // yet, we don't have a scope, so this nested UnionDef
+ // (which was created at global scope) goes on the
+ // queue to be moved later.
+ this->move_queue_.enqueue_tail (tmp);
+ }
+
+ return retval;
+ }
+ else
+ {
+ // If the line below is true, we are clobbering a previous
+ // entry (from another IDL file) of another type. In that
+ // case we do what other ORB vendors do, and destroy the
+ // original entry, create the new one, and let the user beware.
+ if (node->ifr_added () == 0)
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This call will take the other branch.
+ return this->visit_union (node);
+ }
+
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor_structure::visit_union")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+CORBA::IDLType_ptr
+ifr_adding_visitor_structure::ir_current (void) const
+{
+ return this->ir_current_.in ();
+}
diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_structure.h b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_structure.h
new file mode 100644
index 00000000000..116a94401b2
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_structure.h
@@ -0,0 +1,76 @@
+// $Id$
+
+/* -*- C++ -*- */
+// ============================================================================
+//
+// = LIBRARY
+// TAO_IFR_BE_DLL
+//
+// = FILENAME
+// ifr_adding_visitor_structure.h
+//
+// = DESCRIPTION
+// Header file for class ifr_adding_visitor_structure.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_IFR_ADDING_VISITOR_STRUCTURE_H
+#define TAO_IFR_ADDING_VISITOR_STRUCTURE_H
+
+#include "ifr_adding_visitor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class ifr_adding_visitor_structure : public ifr_adding_visitor
+{
+ //
+ // = TITLE
+ // ifr_adding_visitor_structure.
+ //
+ // = DESCRIPTION
+ // This visitor overrides a few of the visit methods
+ // for the case when a struct or exception node is seen in the AST.
+ //
+public:
+ ifr_adding_visitor_structure (AST_Decl *scope,
+ CORBA::Boolean is_nested);
+ // Constructor.
+
+ virtual ~ifr_adding_visitor_structure (void);
+ // Destructor.
+
+ virtual int visit_scope (UTL_Scope *node);
+ // Visit a struct.
+
+ virtual int visit_structure (AST_Structure *node);
+ // Visit a struct.
+
+ virtual int visit_enum (AST_Enum *node);
+ // Visit an enum.
+
+ virtual int visit_union (AST_Union *node);
+ // Visit union.
+
+ virtual CORBA::IDLType_ptr ir_current (void) const;
+ // Lets the visitor one level above acess this value.
+
+private:
+ CORBA::Boolean is_nested_;
+ // Is this visitor visiting a struct that was defined inside
+ // a union, an exception, or another struct?
+
+ CORBA::StructMemberSeq members_;
+ // Holder for the member list passed to create_struct() or
+ // create_exception().
+
+ ACE_Unbounded_Queue<CORBA::Contained_ptr> move_queue_;
+ // IR objects that must be moved into the scope (struct or
+ // exception) where they were declared in the IDL file.
+};
+
+#endif /* TAO_IFR_ADDING_VISITOR_STRUCTURE_H */
diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_union.cpp b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_union.cpp
new file mode 100644
index 00000000000..57e82d66ddb
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_union.cpp
@@ -0,0 +1,564 @@
+/* -*- c++ -*- */
+// $Id$
+
+#include "ast_enum.h"
+#include "ast_expression.h"
+#include "ast_union.h"
+#include "ast_union_branch.h"
+#include "ast_union_label.h"
+#include "utl_identifier.h"
+
+#include "ifr_adding_visitor_union.h"
+#include "ifr_adding_visitor_structure.h"
+
+#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h"
+#include "tao/CDR.h"
+
+ACE_RCSID (IFR_Service,
+ ifr_adding_visitor_union,
+ "$Id$")
+
+ifr_adding_visitor_union::ifr_adding_visitor_union (
+ AST_Decl *scope,
+ CORBA::Boolean is_nested
+ )
+ : ifr_adding_visitor (scope),
+ is_nested_ (is_nested)
+{
+}
+
+ifr_adding_visitor_union::~ifr_adding_visitor_union (void)
+{
+}
+
+// Specialized visit_scope method for unions only.
+int
+ifr_adding_visitor_union::visit_scope (UTL_Scope *node)
+{
+ // If the union has members that are scopes but not unions,
+ // the regular visit_scope method should be called instead.
+ if (node->scope_node_type () != AST_Decl::NT_union)
+ {
+ return ifr_adding_visitor::visit_scope (node);
+ }
+
+ AST_Union *u = AST_Union::narrow_from_scope (node);
+
+ CORBA::ULong nfields = static_cast<CORBA::ULong> (u->nfields ());
+
+ this->members_.length (nfields);
+
+ AST_Field **f = 0;
+
+ // Index into members_.
+ CORBA::ULong index = 0;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Visit each field.
+ for (CORBA::ULong i = 0; i < nfields; ++i)
+ {
+ if (u->field (f, i) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_union::")
+ ACE_TEXT ("visit_scope -")
+ ACE_TEXT (" field node access failed\n")
+ ),
+ -1
+ );
+ }
+
+ AST_Type *ft = (*f)->field_type ();
+
+ bool defined_here = ft->is_child (this->scope_);
+
+ // If the union member is defined in the union, we have to
+ // do some visiting - otherwise we can just look up the entry.
+ if (defined_here)
+ {
+ if (ft->node_type () == AST_Decl::NT_union)
+ {
+ // Since the enclosing scope hasn't been created yet,
+ // we make a special visitor to create this member
+ // at global scope and move it into the union later.
+ ifr_adding_visitor_union visitor (ft,
+ 1);
+
+ if (ft->ast_accept (&visitor) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_union::")
+ ACE_TEXT ("visit_scope -")
+ ACE_TEXT (" failed to accept visitor\n")
+ ),
+ -1
+ );
+ }
+
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (visitor.ir_current ());
+
+ CORBA::Contained_ptr tmp =
+ CORBA::Contained::_narrow (visitor.ir_current ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->move_queue_.enqueue_tail (tmp);
+ }
+ else
+ {
+ if (ft->ast_accept (this) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_union::")
+ ACE_TEXT ("visit_scope -")
+ ACE_TEXT (" failed to accept visitor\n")
+ ),
+ -1
+ );
+ }
+ }
+ }
+ else
+ {
+ // Updates ir_current_.
+ this->get_referenced_type (ft
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Get the case label(s).
+
+ AST_UnionBranch *ub = 0;
+ AST_UnionLabel *case_label = 0;
+
+ ub = AST_UnionBranch::narrow_from_decl (*f);
+
+ unsigned long len = ub->label_list_length ();
+
+ // If there are multiple case labels, we will have an element
+ // in the UnionMemberSeq for each label, not just for each member,
+ // so the list length and the loop terminator must both be
+ // increased accordingly.
+ if (len > 1)
+ {
+ this->members_.length (this->members_.length () + len - 1);
+ }
+
+ for (unsigned long j = 0; j < len; ++j)
+ {
+ case_label = ub->label (j);
+
+ // Is this a regular label or default label?
+ if (case_label->label_kind () == AST_UnionLabel::UL_label)
+ {
+ AST_Expression::AST_ExprValue *ev =
+ case_label->label_val ()->ev ();
+
+ // If the discriminator is an enum, we can't just insert
+ // a ulong into the Any member of struct UnionMember.
+ if (u->disc_type ()->node_type () == AST_Decl::NT_enum)
+ {
+ TAO_OutputCDR cdr;
+ cdr.write_ulong (ev->u.ulval);
+ TAO_InputCDR in_cdr (cdr);
+ TAO::Unknown_IDL_Type *unk = 0;
+ ACE_NEW_RETURN (unk,
+ TAO::Unknown_IDL_Type (
+ this->disc_tc_.in (),
+ in_cdr
+ ),
+ -1);
+ this->members_[index].label.replace (unk);
+ }
+ else
+ {
+ this->load_any (ev,
+ this->members_[index].label);
+ }
+ }
+ else // Default case label.
+ {
+ this->members_[index].label <<= CORBA::Any::from_octet (0);
+ }
+
+ this->members_[index].name =
+ CORBA::string_dup ((*f)->local_name ()->get_string ());
+
+ // IfR method create_union does not use this - it just needs
+ // to be non-zero for marshaling.
+ this->members_[index].type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+
+ this->members_[index++].type_def =
+ CORBA::IDLType::_duplicate (this->ir_current_.in ());
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor_union::visit_scope")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor_union::visit_structure (AST_Structure *node)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this struct already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If not, create a new entry.
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ ifr_adding_visitor_structure visitor (node,
+ 1);
+
+ int retval = visitor.visit_structure (node);
+
+ if (retval == 0)
+ {
+ // Get the result of the visit.
+ this->ir_current_ =
+ CORBA::IDLType::_duplicate (visitor.ir_current ());
+
+ CORBA::Contained_ptr tmp =
+ CORBA::Contained::_narrow (visitor.ir_current ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Since the enclosing UnionDef hasn't been created
+ // yet, we don't have a scope, so this nested StructDef
+ // (which was created at global scope) goes on the
+ // queue to be moved later.
+ this->move_queue_.enqueue_tail (tmp);
+ }
+
+ return retval;
+ }
+ else
+ {
+ // If the line below is true, we are clobbering a previous
+ // entry (from another IDL file) of another type. In that
+ // case we do what other ORB vendors do, and destroy the
+ // original entry, create the new one, and let the user beware.
+ if (node->ifr_added () == 0)
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This call will take the other branch.
+ return this->visit_structure (node);
+ }
+
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor_union::visit_structure")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor_union::visit_enum (AST_Enum *node)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Is this enum already in the respository?
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If not, create a new entry.
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ CORBA::ULong member_count = static_cast<CORBA::ULong> (node->member_count ());
+
+ CORBA::EnumMemberSeq members (member_count);
+ members.length (member_count);
+
+ UTL_ScopedName *member_name = 0;
+
+ // Get a list of the member names.
+ for (CORBA::ULong i = 0; i < member_count; ++i)
+ {
+ member_name = node->value_to_name (i);
+
+ members[i] =
+ CORBA::string_dup (member_name->last_component ()->get_string ());
+ }
+
+ this->ir_current_ =
+ be_global->repository ()->create_enum (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+
+ CORBA::Contained_ptr tmp =
+ CORBA::Contained::_narrow (this->ir_current_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Since the enclosing UnionDef hasn't been created
+ // yet, we don't have a scope, so this nested EnumDef
+ // (which was created at global scope) goes on the
+ // queue to be moved later.
+ this->move_queue_.enqueue_tail (tmp);
+
+ node->ifr_added (1);
+ }
+ else
+ {
+ // If the line below is true, we are clobbering a previous
+ // entry (from another IDL file) of another type. In that
+ // case we do what other ORB vendors do, and destroy the
+ // original entry, create the new one, and let the user beware.
+ if (node->ifr_added () == 0)
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This call will take the other branch.
+ return this->visit_enum (node);
+ }
+
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor_union::visit_enum")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+ifr_adding_visitor_union::visit_union (AST_Union *node)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Contained_var prev_def =
+ be_global->repository ()->lookup_id (node->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (prev_def.in ()))
+ {
+ // Get the discrimintor node.
+ AST_ConcreteType *disc_type = node->disc_type ();
+
+ // Since the IDL compiler stores enum label values as ulongs,
+ // we need to get the typecode to insert the label value into
+ // an Any.
+ if (disc_type->node_type () == AST_Decl::NT_enum)
+ {
+ CORBA::Contained_var disc_def =
+ be_global->repository ()->lookup_id (disc_type->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (disc_def.in ()))
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_union::")
+ ACE_TEXT ("visit_union -")
+ ACE_TEXT (" discriminator not found in repository\n")
+ ),
+ -1
+ );
+ }
+
+ CORBA::IDLType_var idl_def =
+ CORBA::IDLType::_narrow (disc_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->disc_tc_ = idl_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_union::visit_union -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ // This will put an IR object for the discriminator in ir_current_.
+ if (disc_type->ast_accept (this) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_union::visit_union -")
+ ACE_TEXT (" failed to accept visitor\n")
+ ),
+ -1
+ );
+ }
+
+ if (this->is_nested_)
+ {
+ this->ir_current_ =
+ be_global->holding_scope ()->create_union (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ this->ir_current_.in (),
+ this->members_
+ ACE_ENV_ARG_PARAMETER
+ );
+ }
+ else
+ {
+ CORBA::Container_ptr current_scope =
+ CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().top (current_scope) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_adding_visitor_union::")
+ ACE_TEXT ("visit_union -")
+ ACE_TEXT (" scope stack is empty\n")
+ ),
+ -1
+ );
+ }
+
+ this->ir_current_ =
+ current_scope->create_union (
+ node->repoID (),
+ node->local_name ()->get_string (),
+ node->version (),
+ this->ir_current_.in (),
+ this->members_
+ ACE_ENV_ARG_PARAMETER
+ );
+ }
+
+ ACE_TRY_CHECK;
+
+ size_t size = this->move_queue_.size ();
+
+ if (size > 0)
+ {
+ CORBA::Contained_var traveller;
+
+ CORBA::Container_var new_container =
+ CORBA::Container::_narrow (this->ir_current_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ for (size_t i = 0; i < size; ++i)
+ {
+ this->move_queue_.dequeue_head (traveller);
+
+ CORBA::String_var name = traveller->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var version =
+ traveller->version (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ traveller->move (new_container.in (),
+ name.in (),
+ version.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ node->ifr_added (1);
+ } // if (CORBA::is_nil (...))
+ else
+ {
+ // If the line below is true, we are clobbering a previous
+ // entry (from another IDL file) of another type. In that
+ // case we do what other ORB vendors do, and destroy the
+ // original entry, create the new one, and let the user beware.
+ if (node->ifr_added () == 0)
+ {
+ prev_def->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This call will take the other branch.
+ return this->visit_union (node);
+ }
+
+ this->ir_current_ =
+ CORBA::IDLType::_narrow (prev_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_adding_visitor_union::visit_union")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+CORBA::IDLType_ptr
+ifr_adding_visitor_union::ir_current (void) const
+{
+ return this->ir_current_.in ();
+}
diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_union.h b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_union.h
new file mode 100644
index 00000000000..3ca81518afe
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor_union.h
@@ -0,0 +1,81 @@
+// $Id$
+
+/* -*- C++ -*- */
+// ============================================================================
+//
+// = LIBRARY
+// TAO_IFR_BE_DLL
+//
+// = FILENAME
+// ifr_adding_visitor_union.h
+//
+// = DESCRIPTION
+// Header file for class ifr_adding_visitor_union.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_IFR_ADDING_VISITOR_UNION_H
+#define TAO_IFR_ADDING_VISITOR_UNION_H
+
+#include "ifr_adding_visitor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class ifr_adding_visitor_union : public ifr_adding_visitor
+{
+ //
+ // = TITLE
+ // ifr_adding_visitor_exception.
+ //
+ // = DESCRIPTION
+ // This visitor overrides a few of the visit methods
+ // for the case when a union node is seen in the AST.
+ //
+public:
+ ifr_adding_visitor_union (AST_Decl *scope,
+ CORBA::Boolean is_nested);
+ // Constructor.
+
+ virtual ~ifr_adding_visitor_union (void);
+ // Destructor.
+
+ virtual int visit_scope (UTL_Scope *node);
+ // Visit a struct.
+
+ virtual int visit_structure (AST_Structure *node);
+ // Visit a struct.
+
+ virtual int visit_enum (AST_Enum *node);
+ // Visit an enum.
+
+ virtual int visit_union (AST_Union *node);
+ // Visit union.
+
+ virtual CORBA::IDLType_ptr ir_current (void) const;
+ // Lets the visitor one level above acess this value.
+
+private:
+ CORBA::Boolean is_nested_;
+ // Is this visitor visiting a struct that was defined inside
+ // a union, an exception, or another struct?
+
+ CORBA::UnionMemberSeq members_;
+ // Holder for the member list passed to create_struct() or
+ // create_exception().
+
+ CORBA::TypeCode_var disc_tc_;
+ // Holds the typecode of the discriminator (used only if the
+ // discriminator is an enum type, so we can insert the label
+ // values into Anys for UnionMemberSeq[i].label).
+
+ ACE_Unbounded_Queue<CORBA::Contained_ptr> move_queue_;
+ // IR objects that must be moved into the scope (struct or
+ // exception) where they were declared in the IDL file.
+};
+
+#endif /* TAO_IFR_ADDING_VISITOR_UNION_H */
diff --git a/TAO/orbsvcs/IFR_Service/ifr_removing_visitor.cpp b/TAO/orbsvcs/IFR_Service/ifr_removing_visitor.cpp
new file mode 100644
index 00000000000..467dd213950
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/ifr_removing_visitor.cpp
@@ -0,0 +1,147 @@
+/* -*- c++ -*- */
+// $Id$
+
+#include "ifr_removing_visitor.h"
+#include "utl_scope.h"
+#include "ast_root.h"
+
+ACE_RCSID (IFR_Service,
+ ifr_removing_visitor,
+ "$Id$")
+
+ifr_removing_visitor::ifr_removing_visitor (void)
+{
+}
+
+ifr_removing_visitor::~ifr_removing_visitor (void)
+{
+}
+
+int
+ifr_removing_visitor::visit_scope (UTL_Scope *node)
+{
+ // Proceed if the number of members in our scope is greater than 0.
+ if (node->nmembers () > 0)
+ {
+ // Initialize an iterator to iterate over our scope.
+ UTL_ScopeActiveIterator si (node,
+ UTL_Scope::IK_decls);
+
+ AST_Decl *d = 0;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Continue until each element is visited.
+ while (!si.is_done ())
+ {
+ d = si.item ();
+
+ if (d == 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_removing_visitor::visit_scope -")
+ ACE_TEXT (" bad node in this scope\n")
+ ),
+ -1
+ );
+ }
+
+ if (d->node_type () == AST_Decl::NT_pre_defined)
+ {
+ // We can skip these - they don't get destroyed in the IfR.
+ si.next ();
+ continue;
+ }
+
+ CORBA::Contained_var top_level =
+ be_global->repository ()->lookup_id (d->repoID ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (!CORBA::is_nil (top_level.in ()))
+ {
+ // All we have to do is call destroy() on each IR object
+ // in the global scope, because destroy() works on all
+ // the contents recursively.
+ top_level->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ si.next ();
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT ("ifr_removing_visitor::visit_scope")
+ );
+
+ return -1;
+ }
+ ACE_ENDTRY;
+ }
+
+ return 0;
+}
+
+int
+ifr_removing_visitor::visit_root (AST_Root *node)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Container_var new_scope =
+ CORBA::Container::_narrow (be_global->repository ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (be_global->ifr_scopes ().push (new_scope.in ()) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_removing_visitor::visit_root -")
+ ACE_TEXT (" scope push failed\n")
+ ),
+ -1
+ );
+ }
+
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_removing_visitor::visit_root -")
+ ACE_TEXT (" visit_scope failed\n")
+ ),
+ -1
+ );
+ }
+
+ CORBA::Container_ptr tmp = CORBA::Container::_nil ();
+
+ if (be_global->ifr_scopes ().pop (tmp) != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_removing_visitor::visit_root -")
+ ACE_TEXT (" scope pop failed\n")
+ ),
+ -1
+ );
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("visit_root"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/IFR_Service/ifr_removing_visitor.h b/TAO/orbsvcs/IFR_Service/ifr_removing_visitor.h
new file mode 100644
index 00000000000..4b6f82fa44e
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/ifr_removing_visitor.h
@@ -0,0 +1,54 @@
+// $Id$
+
+/* -*- c++ -*- */
+// ============================================================================
+//
+// = LIBRARY
+// TAO_IFR_BE_DLL
+//
+// = FILENAME
+// ifr_removing_visitor.h
+//
+// = DESCRIPTION
+// Header file for class ifr_removing_visitor.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_IFR_REMOVING_VISITOR_H
+#define TAO_IFR_REMOVING_VISITOR_H
+
+#include "ifr_visitor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class ifr_removing_visitor : public ifr_visitor
+{
+ //
+ // = TITLE
+ // ifr_removing_visitor.
+ //
+ // = DESCRIPTION
+ // This visitor removes items found in the IDL file being processed
+ // from the Interface Repository.
+ //
+public:
+ ifr_removing_visitor (void);
+ // Constructor.
+
+ virtual ~ifr_removing_visitor (void);
+ // Destructor.
+
+ virtual int visit_scope (UTL_Scope *node);
+ // Visit the scope.
+
+ virtual int visit_root (AST_Root *node);
+ // Visit the root.
+};
+
+#endif /* TAO_IFR_REMOVING_VISITOR_H */
+
diff --git a/TAO/orbsvcs/IFR_Service/ifr_visitor.cpp b/TAO/orbsvcs/IFR_Service/ifr_visitor.cpp
new file mode 100644
index 00000000000..40ea9e4afe3
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/ifr_visitor.cpp
@@ -0,0 +1,264 @@
+/* -*- c++ -*- */
+// $Id$
+
+#include "ifr_visitor.h"
+#include "ace/Lock_Adapter_T.h"
+#include "ace/Synch_Traits.h"
+#include "ace/Null_Mutex.h"
+
+ACE_RCSID (IFR_Service,
+ ifr_visitor,
+ "$Id$")
+
+ifr_visitor::ifr_visitor (void)
+ : lock_ (0)
+{
+ // Create the appropriate lock.
+ if (be_global->enable_locking ())
+ {
+ ACE_NEW (this->lock_,
+ ACE_Lock_Adapter<TAO_SYNCH_MUTEX> ());
+ }
+ else
+ {
+ ACE_NEW (this->lock_,
+ ACE_Lock_Adapter<ACE_SYNCH_NULL_MUTEX> ());
+ }
+}
+
+ifr_visitor::~ifr_visitor (void)
+{
+ delete this->lock_;
+}
+
+// All the visit methods. Each concrete ifr visitors will
+// override some subset of these.
+
+int
+ifr_visitor::visit_decl (AST_Decl *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_scope (UTL_Scope *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_type (AST_Type *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_predefined_type (AST_PredefinedType *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_module (AST_Module *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_interface (AST_Interface *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_interface_fwd (AST_InterfaceFwd *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_valuebox (AST_ValueBox *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_valuetype (AST_ValueType *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_valuetype_fwd (AST_ValueTypeFwd *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_component (AST_Component *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_component_fwd (AST_ComponentFwd *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_eventtype (AST_EventType *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_eventtype_fwd (AST_EventTypeFwd *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_home (AST_Home *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_factory (AST_Factory *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_structure (AST_Structure *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_structure_fwd (AST_StructureFwd *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_exception (AST_Exception *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_expression (AST_Expression *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_enum (AST_Enum *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_operation (AST_Operation *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_field (AST_Field *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_argument (AST_Argument *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_attribute (AST_Attribute *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_union (AST_Union *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_union_fwd (AST_UnionFwd *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_union_branch (AST_UnionBranch *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_union_label (AST_UnionLabel *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_constant (AST_Constant *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_enum_val (AST_EnumVal *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_array (AST_Array *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_sequence (AST_Sequence *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_string (AST_String *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_typedef (AST_Typedef *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_root (AST_Root *)
+{
+ return 0;
+}
+
+int
+ifr_visitor::visit_native (AST_Native *)
+{
+ return 0;
+}
+
+ACE_Lock &
+ifr_visitor::lock (void) const
+{
+ return *this->lock_;
+}
+
diff --git a/TAO/orbsvcs/IFR_Service/ifr_visitor.h b/TAO/orbsvcs/IFR_Service/ifr_visitor.h
new file mode 100644
index 00000000000..0d5a80a760b
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/ifr_visitor.h
@@ -0,0 +1,168 @@
+// $Id$
+
+/* -*- c++ -*- */
+// ============================================================================
+//
+// = LIBRARY
+// TAO_IFR_BE_DLL
+//
+// = FILENAME
+// ifr_visitor.h
+//
+// = DESCRIPTION
+// The Interface Repository administration visitor base class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_IFR_VISITOR_H
+#define TAO_IFR_VISITOR_H
+
+#include "ast_visitor.h"
+#include "be_extern.h"
+#include "tao/Environment.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class ifr_visitor : public ast_visitor
+{
+ //
+ // = TITLE
+ // ifr_visitor.
+ //
+ // = DESCRIPTION
+ // Base class for the IfR administration visitors. The methods are
+ // not pure virtual to facilitate the implementation of some
+ // derived visitors that override only a few.
+ //
+public:
+ ifr_visitor (void);
+ // Constructor.
+
+ virtual ~ifr_visitor (void);
+ // Destructor.
+
+ virtual int visit_decl (AST_Decl *d);
+ // Visit a decl node.
+
+ virtual int visit_scope (UTL_Scope *node);
+ // Visit the scope.
+
+ virtual int visit_type (AST_Type *node);
+ // Visit the type.
+
+ virtual int visit_predefined_type (AST_PredefinedType *node);
+ // Visit the predefined type.
+
+ virtual int visit_module (AST_Module *node);
+ // Visit module.
+
+ virtual int visit_interface (AST_Interface *node);
+ // Visit interface.
+
+ virtual int visit_interface_fwd (AST_InterfaceFwd *node);
+ // Visit a forward interface declaration
+
+ virtual int visit_valuebox (AST_ValueBox *node);
+ // Visit valuebox.
+
+ virtual int visit_valuetype (AST_ValueType *node);
+ // Visit valuetype.
+
+ virtual int visit_valuetype_fwd (AST_ValueTypeFwd *node);
+ // Visit valuetype_fwd
+
+ virtual int visit_component (AST_Component *node);
+ // Visit component.
+
+ virtual int visit_component_fwd (AST_ComponentFwd *node);
+ // Visit component_fwd
+
+ virtual int visit_eventtype (AST_EventType *node);
+ // Visit valuetype.
+
+ virtual int visit_eventtype_fwd (AST_EventTypeFwd *node);
+ // Visit valuetype_fwd
+
+ virtual int visit_home (AST_Home *node);
+ // Visit component home.
+
+ virtual int visit_factory (AST_Factory *node);
+ // Visit a factory construct.
+
+ virtual int visit_structure (AST_Structure *node);
+ // Visit a structure.
+
+ virtual int visit_structure_fwd (AST_StructureFwd *node);
+ // Visit a forward structure declaration.
+
+ virtual int visit_exception (AST_Exception *node);
+ // Visit exception
+
+ virtual int visit_expression (AST_Expression *node);
+ // Visit expression.
+
+ virtual int visit_enum (AST_Enum *node);
+ // Visit an enum.
+
+ virtual int visit_operation (AST_Operation *node);
+ // Visit an operation.
+
+ virtual int visit_field (AST_Field *node);
+ // Visit a field.
+
+ virtual int visit_argument (AST_Argument *node);
+ // Visit argument.
+
+ virtual int visit_attribute (AST_Attribute *node);
+ // Visit an attribute.
+
+ virtual int visit_union (AST_Union *node);
+ // Visit union.
+
+ virtual int visit_union_fwd (AST_UnionFwd *node);
+ // Visit a forward union declaration.
+
+ virtual int visit_union_branch (AST_UnionBranch *node);
+ // Visit union branch.
+
+ virtual int visit_union_label (AST_UnionLabel *node);
+ // Visit union label.
+
+ virtual int visit_constant (AST_Constant *node);
+ // Visit a constant.
+
+ virtual int visit_enum_val (AST_EnumVal *node);
+ // Visit enum val.
+
+ virtual int visit_array (AST_Array *node);
+ // Visit an array.
+
+ virtual int visit_sequence (AST_Sequence *node);
+ // Visit a sequence.
+
+ virtual int visit_string (AST_String *node);
+ // Visit a string.
+
+ virtual int visit_typedef (AST_Typedef *node);
+ // Visit a typedef.
+
+ virtual int visit_root (AST_Root *node);
+ // Visit the root.
+
+ virtual int visit_native (AST_Native *node);
+ // Visit a native.
+
+ ACE_Lock &lock (void) const;
+ // Accessor for our lock.
+
+private:
+ ACE_Lock *lock_;
+ // Lock.
+};
+
+#endif /* TAO_IFR_VISITOR_H */
diff --git a/TAO/orbsvcs/IFR_Service/ifr_visitor_macro.h b/TAO/orbsvcs/IFR_Service/ifr_visitor_macro.h
new file mode 100644
index 00000000000..0eae91fc49e
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/ifr_visitor_macro.h
@@ -0,0 +1,25 @@
+/* -*- C++ -*- */
+// $Id$
+
+#ifndef TAO_IFR_VISITOR_MACRO_H
+#define TAO_IFR_VISITOR_MACRO_H
+
+#include /**/ "ace/pre.h"
+#include "ace/CORBA_macros.h"
+
+#include "tao/ORB_Constants.h"
+
+#define TAO_IFR_VISITOR_WRITE_GUARD \
+ ACE_WRITE_GUARD_THROW_EX (ACE_Lock, \
+ monitor, \
+ visitor.lock (), \
+ CORBA::INTERNAL ( \
+ CORBA::SystemException::_tao_minor_code ( \
+ TAO_GUARD_FAILURE, \
+ 0), \
+ CORBA::COMPLETED_NO)); \
+ ACE_TRY_CHECK
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_IFR_VISITOR_MACRO_H */
diff --git a/TAO/orbsvcs/IFR_Service/tao_idl.cpp b/TAO/orbsvcs/IFR_Service/tao_idl.cpp
new file mode 100644
index 00000000000..90a26b11e50
--- /dev/null
+++ b/TAO/orbsvcs/IFR_Service/tao_idl.cpp
@@ -0,0 +1,11 @@
+// -*- C++ -*-
+// $Id$
+
+// This file is here to avoid the use of VPATH. Since the TAO_IDL
+// counterparts are built with a different BE_GlobalData definition, the
+// object files built in the TAO_IDL directory are not usable in the
+// IFRService. The BE_GlobalData is larger in TAO_IDL than it is in
+// IFRService which causes problems when be_global is deleted.
+// -- Chad Elliott 12/16/2004
+
+#include "TAO_IDL/tao_idl.cpp"
diff --git a/TAO/orbsvcs/ImplRepo_Service/.cvsignore b/TAO/orbsvcs/ImplRepo_Service/.cvsignore
new file mode 100644
index 00000000000..114bf08db80
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/.cvsignore
@@ -0,0 +1,3 @@
+ImR_Activator
+ImplRepo_Service
+tao_imr
diff --git a/TAO/orbsvcs/ImplRepo_Service/Activator_Info.cpp b/TAO/orbsvcs/ImplRepo_Service/Activator_Info.cpp
new file mode 100644
index 00000000000..7833dce79ca
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Activator_Info.cpp
@@ -0,0 +1,20 @@
+// $Id$
+#include "Activator_Info.h"
+
+Activator_Info::Activator_Info
+(const ACE_CString& aname,
+ CORBA::Long atoken,
+ const ACE_CString& aior,
+ ImplementationRepository::Activator_ptr act)
+ : name(aname)
+ , token(atoken)
+ , ior(aior)
+ , activator (ImplementationRepository::Activator::_duplicate (act))
+{
+}
+void
+Activator_Info::reset()
+{
+ ior = "";
+ activator = ImplementationRepository::Activator::_nil();
+}
diff --git a/TAO/orbsvcs/ImplRepo_Service/Activator_Info.h b/TAO/orbsvcs/ImplRepo_Service/Activator_Info.h
new file mode 100644
index 00000000000..a054fa24cd9
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Activator_Info.h
@@ -0,0 +1,36 @@
+// $Id$
+#ifndef ACTIVATOR_INFO_H
+#define ACTIVATOR_INFO_H
+
+#include "ace/Bound_Ptr.h"
+#include "ace/SString.h"
+
+#include "ImR_ActivatorC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+* @brief Information about IMR registered Activators.
+*/
+struct Activator_Info
+{
+ Activator_Info (const ACE_CString& aname,
+ CORBA::Long atoken,
+ const ACE_CString& aior,
+ ImplementationRepository::Activator_ptr act =
+ ImplementationRepository::Activator::_nil ());
+
+ /// Reset the connection portion
+ void reset();
+
+ ACE_CString name;
+ CORBA::Long token;
+ ACE_CString ior;
+ ImplementationRepository::Activator_var activator;
+};
+
+typedef ACE_Strong_Bound_Ptr<Activator_Info, ACE_Null_Mutex> Activator_Info_Ptr;
+
+#endif /* ACTIVATOR_INFO_H */
diff --git a/TAO/orbsvcs/ImplRepo_Service/Activator_Loader.cpp b/TAO/orbsvcs/ImplRepo_Service/Activator_Loader.cpp
new file mode 100644
index 00000000000..9f222a54739
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Activator_Loader.cpp
@@ -0,0 +1,109 @@
+// $Id$
+
+#include "Activator_Loader.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/Task.h"
+
+class ImR_Activator_ORB_Runner : public ACE_Task_Base
+{
+ ImR_Activator_Loader& service_;
+public:
+ ImR_Activator_ORB_Runner (ImR_Activator_Loader& service)
+ : service_ (service)
+ {
+ }
+ virtual int svc ()
+ {
+ // Block until service_.fini() calls orb->destroy()
+ this->service_.run ();
+ return 0;
+ }
+};
+
+ImR_Activator_Loader::ImR_Activator_Loader (void)
+{
+}
+
+// For now, we will assume that it's sufficient to start
+// the service in its own thread. Later, if necessary, we
+// can add a command line option to allow the imr to use
+// the same orb as other tao services, however the imr
+// is currently written with the assumption that it's running
+// in its own orb.
+int
+ImR_Activator_Loader::init (int argc, ACE_TCHAR *argv[] ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ int err = this->opts_.init (argc, argv);
+ if (err != 0)
+ return -1;
+
+ // Creates it's own internal orb, which we must run later
+ err = this->service_.init (this->opts_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (err != 0)
+ return -1;
+
+ // Create a thread in which to run the service
+ ACE_ASSERT (this->runner_.get () == 0);
+ this->runner_.reset (new ImR_Activator_ORB_Runner (*this));
+ this->runner_->activate ();
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+ImR_Activator_Loader::fini (void)
+{
+ ACE_ASSERT (this->runner_.get() != 0);
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int ret = this->service_.fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->runner_->wait ();
+ this->runner_.reset (0);
+ return ret;
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+}
+
+CORBA::Object_ptr
+ImR_Activator_Loader::create_object (CORBA::ORB_ptr,
+ int,
+ ACE_TCHAR **
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN(CORBA::NO_IMPLEMENT (), CORBA::Object::_nil ());
+}
+
+int
+ImR_Activator_Loader::run (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ return this->service_.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL
+ {
+ ACE_ERROR ((LM_ERROR, "Exception in ImR_Locator_ORB_Runner()\n"));
+ return -1;
+ }
+ ACE_ENDTRY;
+}
+
+ACE_FACTORY_DEFINE (Activator, ImR_Activator_Loader)
diff --git a/TAO/orbsvcs/ImplRepo_Service/Activator_Loader.h b/TAO/orbsvcs/ImplRepo_Service/Activator_Loader.h
new file mode 100644
index 00000000000..2871c38e56b
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Activator_Loader.h
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef TAO_IMR_ACTIVATOR_LOADER_H
+#define TAO_IMR_ACTIVATOR_LOADER_H
+
+#include "ImR_Activator_i.h"
+#include "Activator_Options.h"
+
+#include "tao/Object_Loader.h"
+
+#include "ace/Auto_Ptr.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class ImR_Activator_ORB_Runner;
+
+class Activator_Export ImR_Activator_Loader : public TAO_Object_Loader
+{
+public:
+ ImR_Activator_Loader(void);
+
+ virtual int init (int argc, ACE_TCHAR *argv[] ACE_ENV_ARG_DECL);
+
+ virtual int fini (void);
+
+ virtual CORBA::Object_ptr create_object (CORBA::ORB_ptr orb,
+ int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // Unlike other service objects, we have our own orb.
+ int run(void);
+
+private:
+ ImR_Activator_i service_;
+ Activator_Options opts_;
+ ACE_Auto_Ptr<ImR_Activator_ORB_Runner> runner_;
+
+private:
+ // Disallow copying and assignment.
+ ImR_Activator_Loader (const ImR_Activator_Loader &);
+ ImR_Activator_Loader &operator = (const ImR_Activator_Loader &);
+};
+
+ACE_FACTORY_DECLARE (Activator, ImR_Activator_Loader)
+
+#endif
diff --git a/TAO/orbsvcs/ImplRepo_Service/Activator_NT_Service.cpp b/TAO/orbsvcs/ImplRepo_Service/Activator_NT_Service.cpp
new file mode 100644
index 00000000000..eac94f086bb
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Activator_NT_Service.cpp
@@ -0,0 +1,115 @@
+//=============================================================================
+/**
+ * @file Activator_NT_Service.cpp
+ *
+ * $Id$
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ * @author Jeff Parsons <parsons@cs.wustl.edu>
+ * @author John Tucker <jtucker@infoglide.com>
+ * @author Mike Vitalo <mvitalo@infoglide.com>
+ */
+//=============================================================================
+
+#include "Activator_NT_Service.h"
+
+#if defined (ACE_WIN32)
+
+#include "ImR_Activator_i.h"
+#include "Activator_Options.h"
+
+#include "tao/ORB_Core.h"
+
+#include "ace/Reactor.h"
+/**
+ * Handles the SERVICE_CONTROL_SHUTDOWN and SERVICE_CONTROL_STOP commands
+ * by shutting down the ORB. Otherwise ACE_NT_Service::handle_control
+ * handles the command.
+ */
+void
+Activator_NT_Service::handle_control (DWORD control_code)
+{
+ if (control_code == SERVICE_CONTROL_SHUTDOWN
+ || control_code == SERVICE_CONTROL_STOP)
+ {
+ report_status (SERVICE_STOP_PENDING);
+ TAO_ORB_Core_instance ()->reactor ()->end_reactor_event_loop ();
+ TAO_ORB_Core_instance ()->orb ()->shutdown (1);
+ }
+ else
+ {
+ ACE_NT_Service::handle_control (control_code);
+ }
+}
+
+
+/**
+ */
+int
+Activator_NT_Service::handle_exception (ACE_HANDLE)
+{
+ return 0;
+}
+
+
+/**
+ * We do almost the same thing as we do in run_standalone () except that
+ * we update the report_status after init.
+ */
+int
+Activator_NT_Service::svc (void)
+{
+ ImR_Activator_i server;
+ Activator_Options opts;
+
+ if (opts.init_from_registry() != 0)
+ {
+ report_status (SERVICE_STOPPED);
+ return -1;
+ }
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int status = server.init (opts ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == -1)
+ {
+ report_status (SERVICE_STOPPED);
+ return -1;
+ }
+ else
+ {
+ report_status (SERVICE_RUNNING);
+ server.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ status = server.fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ report_status (SERVICE_STOPPED);
+
+ }
+ if (status != -1)
+ return 0;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_PRINT_EXCEPTION (sysex, IMR_ACTIVATOR_DISPLAY_NAME);
+ }
+ ACE_CATCH (CORBA::UserException, userex)
+ {
+ ACE_PRINT_EXCEPTION (userex, IMR_ACTIVATOR_DISPLAY_NAME);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, IMR_ACTIVATOR_DISPLAY_NAME);
+ }
+ ACE_ENDTRY;
+
+ report_status (SERVICE_STOPPED);
+ return -1;
+}
+
+#endif /* ACE_WIN32 */
diff --git a/TAO/orbsvcs/ImplRepo_Service/Activator_NT_Service.h b/TAO/orbsvcs/ImplRepo_Service/Activator_NT_Service.h
new file mode 100644
index 00000000000..bde40cf1cd9
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Activator_NT_Service.h
@@ -0,0 +1,65 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Activator_NT_Service.h
+ *
+ * $Id$
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ * @author Jeff Parsons <parsons@cs.wustl.edu>
+ * @author John Tucker <jtucker@infoglide.com>
+ * @author Mike Vitalo <mvitalo@infoglide.com>
+ */
+//=============================================================================
+
+#ifndef Activator_NT_Service_H
+#define Activator_NT_Service_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_WIN32)
+
+#include "ace/NT_Service.h"
+#include "ace/Singleton.h"
+#include "ace/Synch.h"
+#include "tao/orbconf.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+static const char * IMR_ACTIVATOR_SERVICE_NAME = "TAOImRActivator";
+static const char * IMR_ACTIVATOR_DISPLAY_NAME = "TAO Implementation Repository Activator";
+static const char * IMR_ACTIVATOR_DESCRIPTION = "Implementation Repository Activator service for TAO";
+
+/**
+ * @class Activator_NT_Service
+ *
+ * @brief Allows the Implementation Repository to act as a Windows NT Service.
+ */
+class Activator_NT_Service : public ACE_NT_Service
+{
+public:
+ typedef TAO_SYNCH_RECURSIVE_MUTEX MUTEX;
+
+ /// We override <handle_control> because it handles stop requests
+ /// privately.
+ virtual void handle_control (DWORD control_code);
+
+ /// We override <handle_exception> so a 'stop' control code can wake
+ /// the reactor off of its wait.
+ virtual int handle_exception (ACE_HANDLE h);
+
+ /// This is a virtual method inherited from ACE_NT_Service.
+ virtual int svc (void);
+private:
+ friend class ACE_Singleton<Activator_NT_Service, MUTEX>;
+};
+
+typedef ACE_Singleton<Activator_NT_Service, ACE_Mutex> SERVICE;
+
+#endif /* ACE_WIN32 */
+
+#endif /* Activator_NT_Service_H */
+
+
diff --git a/TAO/orbsvcs/ImplRepo_Service/Activator_Options.cpp b/TAO/orbsvcs/ImplRepo_Service/Activator_Options.cpp
new file mode 100644
index 00000000000..072ca61ba38
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Activator_Options.cpp
@@ -0,0 +1,348 @@
+//=============================================================================
+/**
+ * @file Activator_Options.cpp
+ *
+ * $Id$
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+#include "Activator_Options.h"
+
+#include "ace/Arg_Shifter.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID (ImplRepo_Service,
+ Activator_Options,
+ "$Id$")
+
+#if defined (ACE_WIN32)
+static const HKEY SERVICE_REG_ROOT = HKEY_LOCAL_MACHINE;
+// This string must agree with the one used in Activator_NT_Service.h
+static const ACE_TCHAR *SERVICE_REG_PATH =
+ ACE_TEXT ("SYSTEM\\CurrentControlSet\\Services\\TAOImRActivator\\Parameters");
+#endif /* ACE_WIN32 */
+
+Activator_Options::Activator_Options ()
+: debug_ (1)
+, service_ (false)
+, notify_imr_ (false)
+, service_command_(SC_NONE)
+{
+}
+
+int
+Activator_Options::parse_args (int &argc, char *argv[])
+{
+ ACE_Arg_Shifter shifter (argc, argv);
+
+ while (shifter.is_anything_left ())
+ {
+ if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-c")) == 0)
+ {
+ shifter.consume_arg ();
+
+ if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
+ {
+ ACE_ERROR ((LM_ERROR, "Error: -c option needs a command\n"));
+ this->print_usage ();
+ return -1;
+ }
+
+ if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("install")) == 0)
+ {
+ this->service_command_ = SC_INSTALL;
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("remove")) == 0)
+ {
+ this->service_command_ = SC_REMOVE;
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("install_no_imr")) == 0)
+ {
+ this->service_command_ = SC_INSTALL_NO_LOCATOR;
+ }
+ else
+ {
+ ACE_ERROR((LM_ERROR, "Error: Unknown service command : %s\n", shifter.get_current()));
+ this->print_usage ();
+ return -1;
+ }
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-d")) == 0)
+ {
+ shifter.consume_arg ();
+
+ if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
+ {
+ ACE_ERROR ((LM_ERROR, "Error: -d option needs a debuglevel\n"));
+ this->print_usage ();
+ return -1;
+ }
+
+ this->debug_ = ACE_OS::atoi (shifter.get_current ());
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-o")) == 0)
+ {
+ shifter.consume_arg ();
+
+ if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
+ {
+ ACE_ERROR ((LM_ERROR, "Error: -o option needs a filename\n"));
+ this->print_usage ();
+ return -1;
+ }
+ this->ior_output_file_ = shifter.get_current ();
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-s")) == 0)
+ {
+ this->service_ = true;
+ }
+ else if ((ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-?")) == 0)
+ || (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-h")) == 0))
+ {
+ this->print_usage ();
+ return 1;
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-n")) == 0)
+ {
+ shifter.consume_arg ();
+
+ if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
+ {
+ ACE_ERROR ((LM_ERROR, "Error: -n option needs a name\n"));
+ this->print_usage ();
+ return -1;
+ }
+ this->name_ = shifter.get_current ();
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-l")) == 0)
+ {
+ this->notify_imr_ = true;
+ }
+ else
+ {
+ shifter.ignore_arg ();
+ continue;
+ }
+
+ shifter.consume_arg ();
+ }
+ return 0;
+}
+
+int
+Activator_Options::init (int argc, char *argv[])
+{
+ // Make an initial pass through and grab the arguments that we recognize.
+ // This may also run the commands to install or remove the nt service.
+ int result = this->parse_args (argc, argv);
+ if (result != 0)
+ {
+ return result;
+ }
+
+ for (int i = 0; i < argc; ++i)
+ {
+ this->cmdline_ += ACE_CString (argv[i]) + ACE_CString (" ");
+ }
+
+ return 0;
+}
+
+int
+Activator_Options::init_from_registry (void)
+{
+ this->load_registry_options();
+ return 0;
+}
+
+void
+Activator_Options::print_usage (void) const
+{
+ ACE_ERROR ((LM_ERROR,
+ "Usage:\n"
+ "\n"
+ "ImR_Activator [-c cmd] [-d 0|1|2] [-o file] [-l] [-n name]\n"
+ "\n"
+ " -c command Runs service commands \n"
+ " ('install' or 'remove' or 'install_no_imr')\n"
+ " -d level Sets the debug level\n"
+ " -o file Outputs the ImR's IOR to a file\n"
+ " -l Notify the ImR when a process exits\n"
+ " -n name Specify a name for the Activator\n")
+ );
+}
+
+int
+Activator_Options::save_registry_options()
+{
+#if defined (ACE_WIN32)
+ HKEY key = 0;
+ // Create or open the parameters key
+ LONG err = ACE_TEXT_RegCreateKeyEx (SERVICE_REG_ROOT,
+ SERVICE_REG_PATH,
+ 0,
+ "", // class
+ REG_OPTION_NON_VOLATILE,
+ KEY_ALL_ACCESS,
+ NULL,
+ &key,
+ NULL
+ );
+ if (err != ERROR_SUCCESS)
+ {
+ return -1;
+ }
+ err = ACE_TEXT_RegSetValueEx (key, "ORBInitOptions", 0, REG_SZ,
+ (LPBYTE) this->cmdline_.c_str (), this->cmdline_.length () + 1);
+ ACE_ASSERT (err == ERROR_SUCCESS);
+
+ err = ACE_TEXT_RegSetValueEx (key, "IORFile", 0, REG_SZ,
+ (LPBYTE) this->ior_output_file_.c_str (), this->ior_output_file_.length () + 1);
+ ACE_ASSERT (err == ERROR_SUCCESS);
+
+ err = ACE_TEXT_RegSetValueEx (key, "DebugLevel", 0, REG_DWORD,
+ (LPBYTE) &this->debug_ , sizeof (this->debug_));
+ ACE_ASSERT (err == ERROR_SUCCESS);
+
+ err = ACE_TEXT_RegSetValueEx( key, "Name", 0, REG_SZ,
+ (LPBYTE) this->name_.c_str (), this->name_.length () + 1);
+ ACE_ASSERT (err == ERROR_SUCCESS);
+
+ DWORD tmpint = this->notify_imr_;
+ err = ACE_TEXT_RegSetValueEx (key, "NotifyImR", 0, REG_DWORD,
+ (LPBYTE) &tmpint , sizeof (tmpint));
+ ACE_ASSERT (err == ERROR_SUCCESS);
+
+ err = ::RegCloseKey (key);
+ ACE_ASSERT (err == ERROR_SUCCESS);
+#endif
+ return 0;
+}
+
+int
+Activator_Options::load_registry_options ()
+{
+#if defined (ACE_WIN32)
+ HKEY key = 0;
+ // Create or open the parameters key
+ LONG err = ACE_TEXT_RegOpenKeyEx (SERVICE_REG_ROOT,
+ SERVICE_REG_PATH,
+ 0,
+ KEY_READ,
+ &key
+ );
+ if (err != ERROR_SUCCESS)
+ {
+ // If there aren't any saved parameters, then that's ok.
+ return 0;
+ }
+ char tmpstr[4096];
+ DWORD sz = sizeof (tmpstr);
+ DWORD type = 0;
+ err = ACE_TEXT_RegQueryValueEx (key, "ORBInitOptions", 0, &type,
+ (LPBYTE) tmpstr, &sz);
+ if (err == ERROR_SUCCESS)
+ {
+ ACE_ASSERT (type == REG_SZ);
+ tmpstr[sz - 1] = '\0';
+ this->cmdline_ = tmpstr;
+ }
+
+ sz = sizeof(tmpstr);
+ err = ACE_TEXT_RegQueryValueEx (key, "IORFile", 0, &type,
+ (LPBYTE) tmpstr, &sz);
+ if (err == ERROR_SUCCESS)
+ {
+ ACE_ASSERT (type == REG_SZ);
+ tmpstr[sz - 1] = '\0';
+ this->ior_output_file_ = tmpstr;
+ }
+
+ sz = sizeof(debug_);
+ err = ACE_TEXT_RegQueryValueEx (key, "DebugLevel", 0, &type,
+ (LPBYTE) &this->debug_ , &sz);
+ if (err == ERROR_SUCCESS)
+ {
+ ACE_ASSERT (type == REG_DWORD);
+ }
+
+ sz = sizeof(tmpstr);
+ err = ACE_TEXT_RegQueryValueEx (key, "Name", 0, &type,
+ (LPBYTE) tmpstr, &sz);
+ if (err == ERROR_SUCCESS)
+ {
+ ACE_ASSERT (type == REG_SZ);
+ tmpstr[sz - 1] = '\0';
+ this->name_ = tmpstr;
+ }
+
+ DWORD tmpint = 0;
+ sz = sizeof(tmpint);
+ err = ACE_TEXT_RegQueryValueEx (key, "NotifyImR", 0, &type,
+ (LPBYTE) &tmpint , &sz);
+ if (err == ERROR_SUCCESS)
+ {
+ ACE_ASSERT (type == REG_DWORD);
+ }
+ this->notify_imr_ = tmpint != 0;
+
+ err = ::RegCloseKey (key);
+ ACE_ASSERT(err == ERROR_SUCCESS);
+#endif /* ACE_WIN32 */
+ return 0;
+}
+
+bool
+Activator_Options::service (void) const
+{
+ return this->service_;
+}
+
+bool
+Activator_Options::notify_imr (void) const
+{
+ return this->notify_imr_;
+}
+
+unsigned int
+Activator_Options::debug (void) const
+{
+ return this->debug_;
+}
+
+const ACE_CString&
+Activator_Options::ior_filename (void) const
+{
+ return this->ior_output_file_;
+}
+
+Activator_Options::SERVICE_COMMAND
+Activator_Options::service_command (void) const
+{
+ return this->service_command_;
+}
+
+const char*
+Activator_Options::cmdline (void) const
+{
+ return this->cmdline_.c_str ();
+}
+
+const ACE_CString&
+Activator_Options::name (void) const
+{
+ return this->name_;
+}
diff --git a/TAO/orbsvcs/ImplRepo_Service/Activator_Options.h b/TAO/orbsvcs/ImplRepo_Service/Activator_Options.h
new file mode 100644
index 00000000000..45f351a0f44
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Activator_Options.h
@@ -0,0 +1,105 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Activator_Options.h
+ *
+ * $Id$
+ *
+ * @brief Definition of the Options class for the Implementation Repository.
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef ACTIVATOR_OPTIONS_H
+#define ACTIVATOR_OPTIONS_H
+
+#include "activator_export.h"
+
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Options
+ *
+ * This is where all the settings for TAO's Implementation Repository are
+ * stored.
+ */
+class Activator_Export Activator_Options
+{
+public:
+
+ enum SERVICE_COMMAND {
+ SC_NONE,
+ SC_INSTALL,
+ SC_REMOVE,
+ SC_INSTALL_NO_LOCATOR
+ };
+
+ Activator_Options ();
+
+ /// Parse the command-line arguments and initialize the options.
+ int init (int argc, char *argv[]);
+ /// This version should only be used when run as an nt service.
+ int init_from_registry();
+
+ /// Service Mode
+ bool service (void) const;
+
+ /// Notify the ImR when server processes die.
+ /// Note : Currently this only works on Unix.
+ bool notify_imr (void) const;
+
+ /// Debug level for the Implementation Repository.
+ unsigned int debug (void) const;
+
+ /// Returns the file where the IOR should be stored.
+ const ACE_CString& ior_filename (void) const;
+
+ /// The nt service command to run (install/remove)
+ SERVICE_COMMAND service_command(void) const;
+
+ /// Save the command line arguments as registry settings. (Windows only)
+ int save_registry_options ();
+
+ const char* cmdline(void) const;
+
+ const ACE_CString& name(void) const;
+
+private:
+ /// Parses and pulls out arguments for the ImR
+ int parse_args (int &argc, char *argv[]);
+
+ /// Print the usage information.
+ void print_usage (void) const;
+
+ /// Loads options from the registry
+ int load_registry_options ();
+
+private:
+
+ /// Our extra command line arguments
+ ACE_CString cmdline_;
+
+ /// Debug level.
+ unsigned int debug_;
+
+ /// File where the IOR of the server object is stored.
+ ACE_CString ior_output_file_;
+
+ /// Should we run as a service?
+ bool service_;
+
+ bool notify_imr_;
+
+ /// SC_NONE, SC_INSTALL, SC_REMOVE, ...
+ SERVICE_COMMAND service_command_;
+
+ ACE_CString name_;
+};
+
+#endif
diff --git a/TAO/orbsvcs/ImplRepo_Service/Adapter_Activator.cpp b/TAO/orbsvcs/ImplRepo_Service/Adapter_Activator.cpp
new file mode 100644
index 00000000000..e68bdbcf4f9
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Adapter_Activator.cpp
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file Adapter_Activator.cpp
+ *
+ * $Id$
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+
+#include "Adapter_Activator.h"
+
+#include "ace/Log_Msg.h"
+
+ImR_Adapter::ImR_Adapter (void)
+: servant_locator_ (0)
+{
+}
+
+void
+ImR_Adapter::init (PortableServer::ServantLocator_ptr servant)
+{
+ servant_locator_ = servant;
+}
+
+CORBA::Boolean
+ImR_Adapter::unknown_adapter (PortableServer::POA_ptr parent,
+ const char *name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_ASSERT (! CORBA::is_nil(parent));
+ ACE_ASSERT (name != 0);
+ CORBA::PolicyList policies (2);
+ policies.length (2);
+
+ const char *exception_message = "Null Message";
+
+ ACE_TRY
+ {
+ // Servant Retention Policy
+ exception_message = "While PortableServer::POA::create_servant_retention_policy";
+ policies[0] =
+ parent->create_servant_retention_policy (PortableServer::NON_RETAIN ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Request Processing Policy
+ exception_message = "While PortableServer::POA::create_request_processing_policy";
+ policies[1] =
+ parent->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ parent->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ exception_message = "While create_POA";
+ PortableServer::POA_var child =
+ parent->create_POA (name,
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ exception_message = "While unknown_adapter::policy->destroy";
+ 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;
+ }
+
+ exception_message = "While child->the_activator";
+ child->the_activator (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ exception_message = "While unknown_adapter, set_servant_manager";
+ child->set_servant_manager (this->servant_locator_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR ((LM_ERROR,
+ "IMR_Adapter_Activator::unknown_adapter - %s\n",
+ exception_message));
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "System Exception");
+ return 0;
+ }
+ ACE_ENDTRY;
+
+ // Finally, now everything is fine
+ return 1;
+}
+
diff --git a/TAO/orbsvcs/ImplRepo_Service/Adapter_Activator.h b/TAO/orbsvcs/ImplRepo_Service/Adapter_Activator.h
new file mode 100644
index 00000000000..d62d8f3cfcf
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Adapter_Activator.h
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file Adapter_Activator.h
+ *
+ * $Id$
+ *
+ * @brief This class implements ImR's Adapter Activator.
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef IMR_ADAPTER_ACTIVATOR_H
+#define IMR_ADAPTER_ACTIVATOR_H
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/PortableServer/AdapterActivatorC.h"
+#include "tao/PortableServer/ServantLocatorC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+
+
+/**
+ * @class ImR_Adapter_Activator
+ *
+ * @brief Implementation Repository Adapter Activator
+ *
+ * Part of the ServantLocator/AdapterActivator combination that is used to
+ * receive forwardable requests from clients. The Adapter Activator creates
+ * the POA structure that the request expects. For each POA created, the
+ * same ServantLocator will be registered in each one.
+ */
+class ImR_Adapter
+ : public PortableServer::AdapterActivator,
+ public CORBA::LocalObject
+{
+public:
+ ImR_Adapter();
+
+ /// Called when a POA needs to be created.
+ virtual CORBA::Boolean unknown_adapter (
+ PortableServer::POA_ptr parent,
+ const char *name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void init(PortableServer::ServantLocator_ptr servant);
+private:
+ /// The ServantLocator registered in each new POA.
+ PortableServer::ServantLocator_ptr servant_locator_;
+};
+
+#endif /* IMR_ADAPTER_ACTIVATOR_H */
diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncStartupWaiter.idl b/TAO/orbsvcs/ImplRepo_Service/AsyncStartupWaiter.idl
new file mode 100644
index 00000000000..92a908888d9
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/AsyncStartupWaiter.idl
@@ -0,0 +1,18 @@
+// -*- IDL -*-
+
+// $Id$
+
+module ImplementationRepository
+{
+ struct StartupInfo {
+ string name;
+ string partial_ior;
+ string ior;
+ };
+
+ interface AsyncStartupWaiter
+ {
+ StartupInfo wait_for_startup(in string name);
+ };
+};
+
diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncStartupWaiter_i.cpp b/TAO/orbsvcs/ImplRepo_Service/AsyncStartupWaiter_i.cpp
new file mode 100644
index 00000000000..2cebbc590bd
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/AsyncStartupWaiter_i.cpp
@@ -0,0 +1,171 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "AsyncStartupWaiter_i.h"
+#include "ImR_Locator_i.h"
+
+using namespace ImplementationRepository;
+
+AsyncStartupWaiter_i::PendingData::PendingData (const char* p, const char* i)
+: partial_ior (p)
+, ior( i)
+{
+}
+
+AsyncStartupWaiter_i::PendingData::PendingData ()
+{
+}
+
+
+void AsyncStartupWaiter_i::debug (bool dbg)
+{
+ debug_ = dbg;
+}
+
+void AsyncStartupWaiter_i::wait_for_startup (AMH_AsyncStartupWaiterResponseHandler_ptr rh,
+ const char* name ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PendingListPtr plst;
+ pending_.find(name, plst);
+ if (! plst.null () && plst->size () > 0)
+ {
+ PendingList& tmp = *plst;
+ PendingData& pd = tmp[tmp.size () - 1];
+ tmp.pop_back ();
+
+ if (debug_)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Skipping wait due to queued startup info for <%s>.\n", name));
+
+ send_response (*rh, name, pd.partial_ior.c_str(), pd.ior.c_str());
+
+ }
+ else
+ {
+ RHListPtr lst;
+ waiting_.find (name, lst);
+ if (lst.null ())
+ {
+ lst = RHListPtr (new RHList);
+ int err = waiting_.bind (name, lst);
+ ACE_ASSERT (err == 0);
+ ACE_UNUSED_ARG (err);
+ }
+ lst->push_back (AMH_AsyncStartupWaiterResponseHandler::_duplicate (rh));
+ }
+}
+
+void
+AsyncStartupWaiter_i::send_response (ImplementationRepository::AMH_AsyncStartupWaiterResponseHandler& rh,
+ const char* name, const char* partial_ior, const char* ior)
+{
+ StartupInfo_var si = new StartupInfo();
+ si->name = name;
+ si->partial_ior = partial_ior;
+ si->ior = ior;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ rh.wait_for_startup (si.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ if (debug_)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "AsyncStartupWaiter_i::send_response ()");
+ }
+ ACE_ENDTRY;
+}
+
+void
+AsyncStartupWaiter_i::unblock_one (const char* name, const char* partial_ior, const char* ior, bool queue) {
+ ImplementationRepository::AMH_AsyncStartupWaiterResponseHandler_var rh = get_one_waiter(name);
+ if (! CORBA::is_nil(rh.in ()))
+ {
+ send_response (*rh.in (), name, partial_ior, ior);
+ }
+ else if (queue)
+ {
+ if (debug_)
+ ACE_DEBUG((LM_DEBUG, "ImR: Queuing startup info.\n"));
+
+ PendingListPtr lst;
+ pending_.find (name, lst);
+ if (lst.null ())
+ {
+ lst = PendingListPtr (new PendingList);
+ int err = pending_.bind (name, lst);
+ ACE_ASSERT (err == 0);
+ ACE_UNUSED_ARG (err);
+ }
+ lst->push_back (PendingData (partial_ior, ior));
+ }
+}
+
+void
+AsyncStartupWaiter_i::unblock_all (const char* name) {
+ RHList tmp;
+
+ get_all_waiters (name, tmp);
+
+ // This startup info should be ignored when unblocking all, because we
+ // don't know the ior or partial_ior at this point.
+ StartupInfo_var si = new StartupInfo ();
+ si->name = name;
+
+ // Note : This method may be called when there are no waiters.
+
+ for (size_t i = 0; i < tmp.size(); ++i)
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ ImplementationRepository::AMH_AsyncStartupWaiterResponseHandler_var& rh = tmp[i];
+
+ rh->wait_for_startup (si.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ if (debug_)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "AsyncStartupWaiter_i::unblock_all ()");
+ }
+ ACE_ENDTRY;
+ }
+}
+
+ImplementationRepository::AMH_AsyncStartupWaiterResponseHandler_ptr
+AsyncStartupWaiter_i::get_one_waiter (const char* name)
+{
+ RHListPtr lst;
+ waiting_.find (name, lst);
+ if (! lst.null() && lst->size () > 0)
+ {
+ RHList& rhlst = *lst;
+ ImplementationRepository::AMH_AsyncStartupWaiterResponseHandler_var& tmp = rhlst[rhlst.size () - 1];
+ ImplementationRepository::AMH_AsyncStartupWaiterResponseHandler_ptr ret = tmp._retn ();
+ rhlst.pop_back ();
+ return ret;
+ }
+ return ImplementationRepository::AMH_AsyncStartupWaiterResponseHandler::_nil ();
+}
+
+void
+AsyncStartupWaiter_i::get_all_waiters (const char* name, RHList& ret)
+{
+ RHListPtr lst;
+ waiting_.find (name, lst);
+ if (! lst.null ()) {
+ for (size_t i = 0; i < lst->size (); ++i)
+ {
+ RHList& tmp = *lst;
+ ret.push_back (tmp[i]);
+ // The ACE_Vector will not destruct the elements when cleared, so we must
+ // make sure to do so here.
+ tmp[i] = ImplementationRepository::AMH_AsyncStartupWaiterResponseHandler::_nil ();
+ }
+ lst->clear ();
+ }
+}
+
diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncStartupWaiter_i.h b/TAO/orbsvcs/ImplRepo_Service/AsyncStartupWaiter_i.h
new file mode 100644
index 00000000000..b4b527e1d40
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/AsyncStartupWaiter_i.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef IMR_AsyncStartupWaiterI_H_
+#define IMR_AsyncStartupWaiterI_H_
+
+#include "locator_export.h"
+#include "AsyncStartupWaiterS.h"
+
+#include "ace/Vector_T.h"
+#include "ace/Hash_Map_Manager.h"
+#include "ace/Bound_Ptr.h"
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+class ImR_Locator_i;
+
+class Locator_Export AsyncStartupWaiter_i : public virtual POA_ImplementationRepository::AMH_AsyncStartupWaiter
+{
+ struct PendingData {
+ PendingData();
+ PendingData(const char* partial_ior, const char* ior);
+ ACE_CString partial_ior;
+ ACE_CString ior;
+ };
+ typedef ACE_Vector<PendingData> PendingList;
+ typedef ACE_Strong_Bound_Ptr<PendingList, ACE_Null_Mutex> PendingListPtr;
+ typedef ACE_Hash_Map_Manager_Ex<ACE_CString,
+ PendingListPtr,
+ ACE_Hash<ACE_CString>,
+ ACE_Equal_To<ACE_CString>,
+ ACE_Null_Mutex> PendingMap;
+
+ typedef ACE_Vector<ImplementationRepository::AMH_AsyncStartupWaiterResponseHandler_var> RHList;
+ typedef ACE_Strong_Bound_Ptr<RHList, ACE_Null_Mutex> RHListPtr;
+ typedef ACE_Hash_Map_Manager_Ex<ACE_CString,
+ RHListPtr,
+ ACE_Hash<ACE_CString>,
+ ACE_Equal_To<ACE_CString>,
+ ACE_Null_Mutex> WaitingMap;
+
+public:
+
+ void wait_for_startup (
+ ImplementationRepository::AMH_AsyncStartupWaiterResponseHandler_ptr rh,
+ const char* name ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void unblock_one(const char* name, const char* partial_ior, const char* ior, bool queue);
+ void unblock_all(const char* name);
+
+ void debug(bool dbg);
+
+private:
+
+ImplementationRepository::AMH_AsyncStartupWaiterResponseHandler_ptr
+ get_one_waiter(const char* name);
+
+void get_all_waiters(const char* name, RHList& ret);
+
+void send_response(ImplementationRepository::AMH_AsyncStartupWaiterResponseHandler& rh,
+ const char* name, const char* partial_ior, const char* ior);
+private:
+ WaitingMap waiting_;
+ PendingMap pending_;
+ bool debug_;
+};
+
+#endif /* AsyncStartupWaiterI_H_ */
+
diff --git a/TAO/orbsvcs/ImplRepo_Service/Forwarder.cpp b/TAO/orbsvcs/ImplRepo_Service/Forwarder.cpp
new file mode 100644
index 00000000000..7337af511e9
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Forwarder.cpp
@@ -0,0 +1,162 @@
+//=============================================================================
+/**
+* @file Forwarder.cpp
+*
+* $Id$
+*
+* @brief Definition of ImR_Forwarder
+*
+* @author Darrell Brunsch <brunsch@cs.wustl.edu>
+* @author Priyanka Gontla <pgontla@doc.ece.uci.edu>
+*/
+//=============================================================================
+
+#include "Forwarder.h"
+#include "ImR_Locator_i.h"
+
+#include "tao/ORB.h"
+#include "tao/Object_KeyC.h"
+#include "tao/ORB_Constants.h"
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/PortableServer/POA_Current_Impl.h"
+#include "tao/PortableServer/POA_Current.h"
+
+/**
+* This constructor takes in orb and ImR_Locator_i pointers to store for later
+* use. It also grabs a reference to the POACurrent object for use in
+* preinvoke.
+*/
+ImR_Forwarder::ImR_Forwarder (ImR_Locator_i& imr_impl)
+ : locator_ (imr_impl)
+{
+}
+
+void
+ImR_Forwarder::init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (! CORBA::is_nil(orb));
+ this->orb_ = orb;
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Object_var tmp =
+ orb->resolve_initial_references ("POACurrent" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->poa_current_var_ =
+ PortableServer::Current::_narrow (tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR_Forwarder::init() Exception ignored.\n"));
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ ACE_ASSERT (!CORBA::is_nil (this->poa_current_var_.in ()));
+}
+
+/**
+* We figure out the intended recipient from the POA name. After activating
+* the server, we throw a forwarding exception to the correct server.
+*
+* The big complicated thing here is that we have to create the forwarding
+* ior based on what we already have. So we combine the endpoint received
+* from activate_server_i and append the objectid from the request to it.
+*/
+PortableServer::Servant
+ImR_Forwarder::preinvoke (const PortableServer::ObjectId &,
+ PortableServer::POA_ptr poa,
+ const char *,
+ PortableServer::ServantLocator::Cookie &
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::ForwardRequest))
+{
+ ACE_ASSERT (! CORBA::is_nil(poa));
+ CORBA::Object_var forward_obj;
+
+ ACE_TRY
+ {
+ CORBA::String_var server_name = poa->the_name();
+
+ if (locator_.debug() > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Activating server <%s>.\n", server_name.in()));
+
+ // The activator stores a partial ior with each server. We can
+ // just tack on the current ObjectKey to get a valid ior for
+ // the desired server.
+ CORBA::String_var pior = locator_.activate_server_by_name (server_name.in (), false ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_CString ior = pior.in ();
+
+ // Check that the returned ior is the expected partial ior with
+ // missing ObjectKey.
+ if (ior.find ("corbaloc:") != 0 || ior[ior.length () - 1] != '/')
+ {
+ ACE_ERROR ((LM_ERROR, "ImR_Forwarder::preinvoke () Invalid corbaloc ior.\n\t<%s>\n", ior.c_str()));
+ ACE_TRY_THROW (CORBA::OBJECT_NOT_EXIST (
+ CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0),
+ CORBA::COMPLETED_NO));
+ }
+
+ CORBA::String_var key_str;
+ // Unlike POA Current, this implementation cannot be cached.
+ TAO::Portable_Server::POA_Current* tao_current =
+ dynamic_cast <TAO::Portable_Server::POA_Current*> (this->poa_current_var_.in ());
+
+ ACE_ASSERT(tao_current != 0);
+ TAO::Portable_Server::POA_Current_Impl* impl = tao_current->implementation ();
+ TAO::ObjectKey::encode_sequence_to_string (key_str.out (), impl->object_key ());
+
+ ior += key_str.in();
+
+ if (locator_.debug() > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Forwarding invocation on <%s> to <%s>\n", server_name.in(), ior.c_str()));
+
+ forward_obj =
+ this->orb_->string_to_object (ior.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (ImplementationRepository::CannotActivate, ex)
+ {
+ ACE_TRY_THROW (CORBA::TRANSIENT (
+ CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0),
+ CORBA::COMPLETED_NO));
+ }
+ ACE_CATCH (ImplementationRepository::NotFound, ex)
+ {
+ ACE_TRY_THROW (CORBA::TRANSIENT (
+ CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0),
+ CORBA::COMPLETED_NO));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Forwarder");
+ ACE_TRY_THROW (CORBA::TRANSIENT (
+ CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0),
+ CORBA::COMPLETED_NO));
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ if (!CORBA::is_nil (forward_obj.in ()))
+ ACE_THROW_RETURN (PortableServer::ForwardRequest (forward_obj.in ()), 0);
+
+ ACE_ERROR ((LM_ERROR, "Error: Forward_to reference is nil.\n"));
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (
+ CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0),
+ CORBA::COMPLETED_NO), 0);
+}
+
+void
+ImR_Forwarder::postinvoke (const PortableServer::ObjectId &,
+ PortableServer::POA_ptr,
+ const char *,
+ PortableServer::ServantLocator::Cookie,
+ PortableServer::Servant
+ ACE_ENV_ARG_DECL_NOT_USED
+ ) ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
diff --git a/TAO/orbsvcs/ImplRepo_Service/Forwarder.h b/TAO/orbsvcs/ImplRepo_Service/Forwarder.h
new file mode 100644
index 00000000000..31bf107b602
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Forwarder.h
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file Forwarder.h
+ *
+ * $Id$
+ *
+ * @brief This class implements ImR's forwarding ServantLocator
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ * @author Priyanka Gontla <pgontla@doc.ece.uci.edu>
+ */
+//=============================================================================
+
+#ifndef IMR_FORWARDER_H
+#define IMR_FORWARDER_H
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/PortableServer/ServantLocatorC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+
+
+class ImR_Locator_i;
+
+/**
+ * @class ImR_Forwarder:
+ *
+ * @brief Implementation Repository Forwarder
+ *
+ * This class provides a ServantLocator implementation that
+ * is used to handle arbitrary calls and forward them to the
+ * correct place.
+ */
+class ImR_Forwarder
+ : public PortableServer::ServantLocator,
+ public CORBA::LocalObject
+{
+public:
+ ImR_Forwarder (ImR_Locator_i& imr_impl);
+
+ /// Called before the invocation begins.
+ virtual PortableServer::Servant preinvoke (
+ const PortableServer::ObjectId &oid,
+ PortableServer::POA_ptr poa,
+ const char * operation,
+ PortableServer::ServantLocator::Cookie &cookie
+ ACE_ENV_ARG_DECL
+ ) ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::ForwardRequest));
+
+ virtual void postinvoke (
+ const PortableServer::ObjectId & oid,
+ PortableServer::POA_ptr adapter,
+ const char * operation,
+ PortableServer::ServantLocator::Cookie the_cookie,
+ PortableServer::Servant the_servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ ) ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void init(CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);
+
+private:
+ /// Where we find out where to forward to.
+ ImR_Locator_i& locator_;
+
+ /// POA reference.
+ PortableServer::Current_var poa_current_var_;
+
+ /// Variable to save the ORB reference passed to the constr.
+ CORBA::ORB_ptr orb_;
+};
+
+#endif /* IMR_FORWARDER_H */
diff --git a/TAO/orbsvcs/ImplRepo_Service/INS_Locator.cpp b/TAO/orbsvcs/ImplRepo_Service/INS_Locator.cpp
new file mode 100644
index 00000000000..3057a8d6622
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/INS_Locator.cpp
@@ -0,0 +1,64 @@
+//=============================================================================
+/**
+* @file INS_Locator.cpp
+*
+* $Id$
+*
+* @brief Implementation of the ImR's INS Locator class
+*
+* @author Darrell Brunsch <brunsch@cs.wustl.edu>
+*/
+//=============================================================================
+
+#include "INS_Locator.h"
+#include "ImR_Locator_i.h"
+#include "tao/ORB_Constants.h"
+
+INS_Locator::INS_Locator (ImR_Locator_i& loc)
+: imr_locator_ (loc)
+{
+}
+
+char *
+INS_Locator::locate (const char* object_key ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException, IORTable::NotFound))
+{
+ ACE_ASSERT (object_key != 0);
+ ACE_TRY
+ {
+ ACE_CString key (object_key);
+ ssize_t poaidx = key.find ('/');
+ if (poaidx >= 0)
+ {
+ key = key.substring (0, poaidx);
+ }
+
+ if (imr_locator_.debug () > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Activating server <%s>.\n", key.c_str ()));
+
+ CORBA::String_var located =
+ this->imr_locator_.activate_server_by_object (key.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_CString tmp = located.in ();
+ tmp += object_key;
+
+ if (imr_locator_.debug () > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Forwarding invocation on <%s> to <%s>\n", key.c_str (), tmp.c_str()));
+
+ return CORBA::string_dup (tmp.c_str ());
+ }
+ ACE_CATCH (ImplementationRepository::CannotActivate, ex)
+ {
+ ACE_TRY_THROW (CORBA::TRANSIENT (
+ CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0),
+ CORBA::COMPLETED_NO));
+ }
+ ACE_CATCH (ImplementationRepository::NotFound, ex)
+ {
+ ACE_TRY_THROW (CORBA::TRANSIENT (
+ CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0),
+ CORBA::COMPLETED_NO));
+ }
+ ACE_ENDTRY;
+}
diff --git a/TAO/orbsvcs/ImplRepo_Service/INS_Locator.h b/TAO/orbsvcs/ImplRepo_Service/INS_Locator.h
new file mode 100644
index 00000000000..88fca61b5ba
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/INS_Locator.h
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file INS_Locator.h
+ *
+ * $Id$
+ *
+ * @brief This class implements the ImR's INS Locator class
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef IMR_INS_LOCATOR_H
+#define IMR_INS_LOCATOR_H
+#include /**/ "ace/pre.h"
+
+#include "tao/IORTable/IORTable.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+
+
+class ImR_Locator_i;
+
+/**
+ * @class INS_Locator
+ *
+ * @brief Implementation Repository INS Locator class
+ *
+ * This class provides a callback for the IORTable to call when it needs
+ * to dynamically receive a IOR to forward in response to an INS request.
+ */
+class INS_Locator
+ : public virtual IORTable::Locator,
+ public virtual CORBA::LocalObject
+{
+public:
+ INS_Locator (ImR_Locator_i& loc);
+
+ /// Locate the appropriate IOR.
+ char* locate (const char *object_key ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, IORTable::NotFound));
+
+private:
+ ImR_Locator_i& imr_locator_;
+};
+
+#include /**/ "ace/post.h"
+#endif
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR.xsd b/TAO/orbsvcs/ImplRepo_Service/ImR.xsd
new file mode 100644
index 00000000000..013bd6dd849
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR.xsd
@@ -0,0 +1,30 @@
+<?xml version="1.0" ?>
+<xs:schema id="ImplementationRepository" targetNamespace="http://www.theaceorb.com/ImplementationRepository.xsd" xmlns:mstns="http://www.theaceorb.com/ImplementationRepository.xsd"
+ xmlns="http://www.theaceorb.com/ImplementationRepository.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
+ attributeFormDefault="qualified" elementFormDefault="qualified">
+ <xs:element name="ImplementationRepository" msdata:IsDataSet="true" msdata:EnforceConstraints="False">
+ <xs:complexType>
+ <xs:choice maxOccurs="unbounded">
+ <xs:element name="Servers">
+ <xs:complexType>
+ <xs:attribute name="name" form="unqualified" type="xs:string" />
+ <xs:attribute name="activator" form="unqualified" type="xs:string" />
+ <xs:attribute name="command_line" form="unqualified" type="xs:string" />
+ <xs:attribute name="working_dir" form="unqualified" type="xs:string" />
+ <xs:attribute name="activation_mode" form="unqualified" type="xs:string" />
+ <xs:attribute name="start_limit" form="unqualified" type="xs:string" />
+ <xs:attribute name="partial_ior" form="unqualified" type="xs:string" />
+ <xs:attribute name="ior" form="unqualified" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="Activators">
+ <xs:complexType>
+ <xs:attribute name="name" form="unqualified" type="xs:string" />
+ <xs:attribute name="token" form="unqualified" type="xs:string" />
+ <xs:attribute name="ior" form="unqualified" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+</xs:schema> \ No newline at end of file
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Activator.cpp b/TAO/orbsvcs/ImplRepo_Service/ImR_Activator.cpp
new file mode 100644
index 00000000000..34da1320caf
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Activator.cpp
@@ -0,0 +1,216 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "Activator_Options.h"
+#include "ImR_Activator_i.h"
+#include "Activator_NT_Service.h"
+
+#include "orbsvcs/Shutdown_Utilities.h"
+
+class ImR_Activator_Shutdown : public Shutdown_Functor
+{
+public:
+ ImR_Activator_Shutdown (ImR_Activator_i& act);
+
+ void operator() (int which_signal);
+private:
+ ImR_Activator_i& act_;
+};
+
+ImR_Activator_Shutdown::ImR_Activator_Shutdown (ImR_Activator_i &act)
+ : act_(act)
+{
+}
+
+void
+ImR_Activator_Shutdown::operator() (int /*which_signal*/)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->act_.shutdown (true ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "ImR Activator: ");
+ }
+ ACE_ENDTRY;
+}
+
+int
+run_standalone (Activator_Options& opts)
+{
+ ImR_Activator_i server;
+
+ ImR_Activator_Shutdown killer (server);
+ Service_Shutdown kill_contractor (killer);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int status = server.init (opts ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == -1)
+ {
+ return 1;
+ }
+ else
+ {
+ // Run the server if it is initialized correctly.
+ server.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // End the server after its work is done.
+ status = server.fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == -1)
+ return 1;
+ }
+ return 0;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_PRINT_EXCEPTION (sysex, "System Exception");
+ }
+ ACE_CATCH (CORBA::UserException, userex)
+ {
+ ACE_PRINT_EXCEPTION (userex, "User Exception");
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unknown Exception");
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
+
+#if defined (ACE_WIN32)
+ACE_NT_SERVICE_DEFINE (service, Activator_NT_Service, IMR_ACTIVATOR_SERVICE_NAME);
+#endif /* ACE_WIN32 */
+
+int
+run_service (void)
+{
+#if defined (ACE_WIN32)
+ SERVICE::instance()->name (IMR_ACTIVATOR_SERVICE_NAME, IMR_ACTIVATOR_DISPLAY_NAME);
+ ACE_NT_SERVICE_RUN (service, SERVICE::instance (), ret);
+
+ if (ret == 0)
+ ACE_ERROR ((LM_ERROR, "%p\n", "Couldn't start service"));
+
+ return ret;
+#else /* ACE_WIN32 */
+ return 1;
+#endif /* ACE_WIN32 */
+}
+
+/**
+ * Executes the various commands that are useful for a NT service. Right
+ * now these include 'install' and 'remove'. Others, such as 'start' and
+ * 'stop' can be added, but the 'net' program in Windows already handles
+ * these commands.
+ */
+static int
+run_service_command (Activator_Options& opts)
+{
+ if (opts.service_command () == Activator_Options::SC_NONE)
+ return 0;
+
+#if defined (ACE_WIN32)
+ SERVICE::instance()->name (IMR_ACTIVATOR_SERVICE_NAME, IMR_ACTIVATOR_DISPLAY_NAME);
+
+ if (opts.service_command () == Activator_Options::SC_INSTALL ||
+ opts.service_command () == Activator_Options::SC_INSTALL_NO_LOCATOR)
+ {
+ const DWORD MAX_PATH_LENGTH = 4096;
+ char pathname[MAX_PATH_LENGTH];
+
+ DWORD length = ACE_TEXT_GetModuleFileName(NULL, pathname, MAX_PATH_LENGTH);
+ if (length == 0 || length >= MAX_PATH_LENGTH - sizeof(" -s"))
+ {
+ ACE_ERROR ((LM_ERROR, "Error: Could not get module file name\n"));
+ return -1;
+ }
+
+ // Append the command used for running the implrepo as a service
+ ACE_OS::strcat (pathname, ACE_TEXT (" -s"));
+ int ret = -1;
+ if (opts.service_command () == Activator_Options::SC_INSTALL)
+ {
+ const char* DEPENDS_ON = "TAOImR"; // Must match Locator_NT_Service.h
+
+ ret = SERVICE::instance ()->insert (SERVICE_DEMAND_START,
+ SERVICE_ERROR_NORMAL,
+ pathname,
+ 0, // group
+ 0, // tag
+ DEPENDS_ON
+ );
+ }
+ else
+ {
+ ret = SERVICE::instance ()->insert (SERVICE_DEMAND_START,
+ SERVICE_ERROR_NORMAL,
+ pathname);
+ }
+ if (ret != -1)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR Activator: Service installed.\n"));
+ opts.save_registry_options ();
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR, "Error: Failed to install service.\n"));
+ }
+ if (ret == 0)
+ return 1;
+ }
+ else if (opts.service_command () == Activator_Options::SC_REMOVE)
+ {
+ int ret = SERVICE::instance ()->remove ();
+ ACE_DEBUG ((LM_DEBUG, "ImR Activator: Service removed.\n"));
+ if (ret == 0)
+ return 1; // If successfull, then we don't want to continue.
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR, "Error: Unknown service command :%d \n",
+ opts.service_command ()));
+ return -1;
+ }
+
+ return -1;
+
+#else /* ACE_WIN32 */
+ ACE_ERROR ((LM_ERROR, "NT Service not supported on this platform"));
+ return -1;
+#endif /* ACE_WIN32 */
+}
+
+int
+main (int argc, char *argv[])
+{
+ Activator_Options opts;
+
+ int result = opts.init (argc, argv);
+ if (result < 0)
+ return 1; // Error
+ else if (result > 0)
+ return 0; // No error, but we should exit anyway.
+
+ result = run_service_command (opts);
+ if (result < 0)
+ return 1; // Error
+ else if (result > 0)
+ return 0; // No error, but we should exit anyway.
+
+ if (opts.service ())
+ return run_service ();
+
+ return run_standalone (opts);
+}
+
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Activator.idl b/TAO/orbsvcs/ImplRepo_Service/ImR_Activator.idl
new file mode 100644
index 00000000000..aa0fecbd401
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Activator.idl
@@ -0,0 +1,18 @@
+// -*- IDL -*-
+
+// $Id$
+
+#include "tao/ImR_Client/ImplRepo.pidl"
+
+module ImplementationRepository
+{
+ interface Activator
+ {
+ // Tells the activator to launch a server with the given information.
+ void start_server(in string name, in string cmdline,
+ in string dir, in EnvironmentList env) raises(CannotActivate);
+
+ oneway void shutdown();
+ };
+};
+
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp b/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp
new file mode 100644
index 00000000000..7017ec1827d
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp
@@ -0,0 +1,395 @@
+// $Id$
+
+#include "ImR_Activator_i.h"
+
+#include "Activator_Options.h"
+
+#include "tao/ORB_Core.h"
+
+#include "ace/Reactor.h"
+#include "ace/ARGV.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/os_include/os_netdb.h"
+
+static ACE_CString getHostName ()
+{
+ char host_name[MAXHOSTNAMELEN];
+ ACE_OS::hostname (host_name, MAXHOSTNAMELEN);
+ return ACE_CString (host_name);
+}
+
+ImR_Activator_i::ImR_Activator_i (void)
+: registration_token_(0)
+, debug_(0)
+, notify_imr_ (false)
+, name_ (getHostName ())
+{
+}
+
+static PortableServer::POA_ptr
+createPersistentPOA (PortableServer::POA_ptr root_poa, const char* poa_name ACE_ENV_ARG_DECL)
+{
+ PortableServer::LifespanPolicy_var life =
+ root_poa->create_lifespan_policy (PortableServer::PERSISTENT ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableServer::POA::_nil ());
+
+ PortableServer::IdAssignmentPolicy_var assign =
+ root_poa->create_id_assignment_policy (PortableServer::USER_ID ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableServer::POA::_nil ());
+
+ CORBA::PolicyList pols;
+ pols.length (2);
+ pols[0] = PortableServer::LifespanPolicy::_duplicate (life.in ());
+ pols[1] = PortableServer::IdAssignmentPolicy::_duplicate (assign.in ());
+
+ PortableServer::POAManager_var mgr = root_poa->the_POAManager ();
+ PortableServer::POA_var poa =
+ root_poa->create_POA(poa_name, mgr.in (), pols ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(PortableServer::POA::_nil ());
+
+ life->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableServer::POA::_nil ());
+ assign->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableServer::POA::_nil ());
+
+ return poa._retn ();
+}
+
+// It's ok if we can't register with the ImR. It just
+// means we won't be able to notify it of any events
+// (Currently, just that we're shutting down.)
+void
+ImR_Activator_i::register_with_imr (ImplementationRepository::Activator_ptr activator)
+{
+ ACE_TRY_NEW_ENV
+ {
+ if (this->debug_ > 1)
+ ACE_DEBUG( (LM_DEBUG, "ImR Activator: Contacting ImplRepoService...\n"));
+
+ // First, resolve the ImR, without this we can go no further
+ CORBA::Object_var obj =
+ orb_->resolve_initial_references ("ImplRepoService" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->process_mgr_.open (ACE_Process_Manager::DEFAULT_SIZE,
+ this->orb_->orb_core ()->reactor ());
+
+ locator_ = ImplementationRepository::Locator::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (!CORBA::is_nil (locator_.in ()))
+ {
+ this->registration_token_ =
+ locator_->register_activator (name_.c_str (), activator ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (debug_ > 0)
+ ACE_DEBUG((LM_DEBUG, "ImR Activator: Registered with ImR.\n"));
+
+ return;
+ }
+ }
+ ACE_CATCHANY
+ {
+ if (debug_ > 1)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "ImR Activator: Can't register with ImR.");
+ }
+ ACE_ENDTRY;
+
+ if (debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR Activator: Not registered with ImR.\n"));
+}
+
+int
+ImR_Activator_i::init_with_orb (CORBA::ORB_ptr orb, const Activator_Options& opts ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT(! CORBA::is_nil (orb));
+ orb_ = CORBA::ORB::_duplicate (orb);
+ debug_ = opts.debug ();
+ notify_imr_ = opts.notify_imr ();
+ if (opts.name ().length () > 0)
+ {
+ name_ = opts.name();
+ }
+
+ ACE_TRY
+ {
+ CORBA::Object_var obj = 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;
+ ACE_ASSERT (! CORBA::is_nil(this->root_poa_.in ()));
+
+ // The activator must use a persistent POA so that it can be started before the
+ // locator in some scenarios, such as when the locator persists its database, and
+ // wants to reconnect to running activators to auto_start some servers.
+ this->imr_poa_ = createPersistentPOA (this->root_poa_.in (),
+ "ImR_Activator" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_ASSERT (! CORBA::is_nil(this->imr_poa_.in ()));
+
+ // Activate ourself
+ PortableServer::ObjectId_var id = PortableServer::string_to_ObjectId ("ImR_Activator");
+ this->imr_poa_->activate_object_with_id (id.in (), this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ obj = this->imr_poa_->id_to_reference (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ImplementationRepository::Activator_var activator =
+ ImplementationRepository::Activator::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_ASSERT(! CORBA::is_nil (activator.in ()));
+
+ CORBA::String_var ior = this->orb_->object_to_string (activator.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->debug_ > 0)
+ ACE_DEBUG((LM_DEBUG, "ImR Activator: Starting %s\n", name_.c_str ()));
+
+ // initialize our process manager.
+ // This requires a reactor that has signal handling.
+ ACE_Reactor *reactor = ACE_Reactor::instance ();
+ if (reactor != 0)
+ {
+ if (this->process_mgr_.open (ACE_Process_Manager::DEFAULT_SIZE, reactor) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "The ACE_Process_Manager didnt get initialized\n"), -1);
+ }
+ }
+
+ this->register_with_imr (activator.in ()); // no throw
+
+ PortableServer::POAManager_var poaman =
+ this->root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poaman->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR Activator: The Activator IOR is: <%s>\n", ior.in ()));
+ }
+
+ // The last thing we do is write out the ior so that a test program can assume
+ // that the activator is ready to go as soon as the ior is written.
+ if (opts.ior_filename ().length () > 0)
+ {
+ FILE* fp = ACE_OS::fopen (opts.ior_filename ().c_str (), "w");
+ if (fp == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ImR Activator: Could not open file: %s\n", opts.ior_filename ().c_str ()), -1);
+ }
+ ACE_OS::fprintf (fp, "%s", ior.in ());
+ ACE_OS::fclose (fp);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "ImR_Activator_i::init_with_orb");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+ImR_Activator_i::init (Activator_Options& opts ACE_ENV_ARG_DECL)
+{
+ ACE_CString cmdline = opts.cmdline();
+ // Must use IOR style objrefs, because URLs sometimes get mangled when passed
+ // to ACE_Process::spawn().
+ cmdline += "-ORBUseImR 0 -ORBObjRefStyle IOR ";
+ ACE_ARGV av (cmdline.c_str ());
+ int argc = av.argc ();
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, av.argv (), "TAO_ImR_Activator" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ int ret = this->init_with_orb(orb.in (), opts ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ return ret;
+}
+
+int
+ImR_Activator_i::fini (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY_EX (try_block_1)
+ {
+ if (debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR Activator: Shutting down...\n"));
+
+ this->process_mgr_.close ();
+
+ this->root_poa_->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (try_block_1);
+
+ if (! CORBA::is_nil (this->locator_.in ()) && this->registration_token_ != 0)
+ {
+ this->locator_->unregister_activator (name_.c_str(),
+ this->registration_token_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (try_block_1);
+ }
+ }
+ ACE_CATCH(CORBA::COMM_FAILURE, ex)
+ {
+ if (debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR Activator: Unable to unregister from ImR.\n"));
+ }
+ ACE_CATCH(CORBA::TRANSIENT, ex)
+ {
+ if (debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR Activator: Unable to unregister from ImR.\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "ImR Activator: fini");
+ ACE_RE_THROW_EX (try_block_1);
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_TRY_EX (try_block_2)
+ {
+ this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (try_block_2);
+
+ if (debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR Activator: Shut down successfully.\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "ImR Activator: fini 2");
+ ACE_RE_THROW_EX (try_block_2);
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+ImR_Activator_i::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+void
+ImR_Activator_i::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ shutdown (false ACE_ENV_ARG_PARAMETER);
+}
+
+void
+ImR_Activator_i::shutdown (bool wait_for_completion ACE_ENV_ARG_DECL)
+{
+ this->orb_->shutdown (wait_for_completion ACE_ENV_ARG_PARAMETER);
+}
+
+void
+ImR_Activator_i::start_server(const char* name,
+ const char* cmdline,
+ const char* dir,
+ const ImplementationRepository::EnvironmentList & env ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, ImplementationRepository::CannotActivate))
+{
+ if (debug_ > 1)
+ ACE_DEBUG((LM_DEBUG, "ImR Activator: Starting server <%s>...\n", name));
+ if (debug_ > 1)
+ ACE_DEBUG((LM_DEBUG, "\tcommand line : <%s>\n\tdirectory : <%s>\n", cmdline, dir));
+
+ ACE_Process_Options proc_opts;
+ proc_opts.command_line (cmdline);
+ proc_opts.working_directory (dir);
+ // Win32 does not support the CLOSE_ON_EXEC semantics for sockets
+ // the way unix does, so in order to avoid having the child process
+ // hold the listen socket open, we force the child to inherit no
+ // handles. This includes stdin, stdout, logs, etc.
+ proc_opts.handle_inheritence (0);
+
+ proc_opts.setenv ("TAO_USE_IMR", "1");
+ if (!CORBA::is_nil (this->locator_.in ()))
+ {
+ CORBA::String_var ior = orb_->object_to_string (locator_.in ());
+ proc_opts.setenv ("ImplRepoServiceIOR", ior.in());
+ }
+
+ for (CORBA::ULong i = 0; i < env.length (); ++i)
+ {
+ proc_opts.setenv (env[i].name.in (), env[i].value.in ());
+ }
+
+ int pid = this->process_mgr_.spawn (proc_opts);
+ if (pid == ACE_INVALID_PID)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "ImR Activator: Cannot start server <%s> using <%s>\n", name, cmdline));
+
+ ACE_THROW(ImplementationRepository::CannotActivate(CORBA::string_dup ("Process Creation Failed")));
+ return;
+ }
+ else
+ {
+ if (debug_ > 1)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "ImR Activator: register death handler for process %d\n", pid));
+ }
+ this->process_mgr_.register_handler (this, pid);
+
+ // We only bind to the process_map_ if we want to notify
+ // the locator of a process' death.
+ if (notify_imr_)
+ {
+ this->process_map_.rebind (pid, name);
+ }
+ }
+
+ if (debug_ > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR Activator: Successfully started <%s>. \n", name));
+ }
+}
+
+int
+ImR_Activator_i::handle_exit (ACE_Process * process)
+{
+ // We use the process_manager so that we're notified when
+ // any of our launched processes die. We notify the locator
+ // when this happens.
+
+ if (debug_ > 0)
+ {
+ ACE_DEBUG
+ ((LM_DEBUG,
+ ACE_TEXT ("Process %d exited with exit code %d\n"),
+ process->getpid (), process->return_value ()));
+ }
+
+ ACE_CString name;
+ if (this->process_map_.find (process->getpid (), name) == 0)
+ {
+ this->process_map_.unbind (process->getpid ());
+
+ if (!CORBA::is_nil (this->locator_.in ()))
+ {
+ if (debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ImR Activator: Notifying ImR that %s has exited.\n"),
+ name.c_str()));
+ }
+ this->locator_->notify_child_death (name.c_str());
+ }
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.h b/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.h
new file mode 100644
index 00000000000..7b62dc525cf
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.h
@@ -0,0 +1,128 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+* @file ImR_Activator_i.h
+*
+* $Id$
+*
+* @author Priyanka Gontla <gontla_p@ociweb.com>
+* @author Darrell Brunsch <brunsch@cs.wustl.edu>
+*/
+//=============================================================================
+
+#ifndef IMR_ACTIVATOR_I_H
+#define IMR_ACTIVATOR_I_H
+
+#include "activator_export.h"
+
+#include "ImR_ActivatorS.h"
+#include "ImR_LocatorC.h"
+
+#include "ace/Process_Manager.h"
+#include "ace/Hash_Map_Manager.h"
+#include "ace/Null_Mutex.h"
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Activator_Options;
+
+// ace/Functor.h doesn't provide functors for every built in integer type.
+// Depending on the platform and what pid_t maps to, the functors may be missing.
+struct ACE_Hash_pid_t
+{
+ unsigned long operator () (pid_t t) const
+ {
+ return t;
+ }
+};
+
+struct ACE_Equal_To_pid_t
+{
+ int operator () (const pid_t lhs, const pid_t rhs) const
+ {
+ return lhs == rhs;
+ }
+};
+
+
+/**
+* @class ImR_Activator_i
+*
+* @brief IMR Activator Interface.
+*
+* This class provides the interface for the various activities
+* that can be done by the ImR_Activator.
+*
+*/
+class Activator_Export ImR_Activator_i : public POA_ImplementationRepository::Activator,
+ public ACE_Event_Handler
+{
+public:
+ ImR_Activator_i (void);
+
+ void start_server (
+ const char* name,
+ const char* cmdline,
+ const char* dir,
+ const ImplementationRepository::EnvironmentList & env ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, ImplementationRepository::CannotActivate));
+
+ void shutdown(ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Initialize the Server state - parsing arguments and waiting.
+ int init (Activator_Options& opts ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Cleans up any state created by init*.
+ int fini (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// Runs the orb.
+ int run (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// Shutdown the orb.
+ void shutdown (bool wait_for_completion ACE_ENV_ARG_DECL);
+
+private:
+
+ int init_with_orb (CORBA::ORB_ptr orb, const Activator_Options& opts ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ void register_with_imr(ImplementationRepository::Activator_ptr activator);
+
+ // Handles the death of the child processes of the ImR_Activator.
+ // Informs the ImR_Locator too.
+ int handle_exit (ACE_Process * process);
+
+private:
+
+ typedef ACE_Hash_Map_Manager_Ex<pid_t,
+ ACE_CString,
+ ACE_Hash_pid_t,
+ ACE_Equal_To_pid_t,
+ ACE_Null_Mutex> ProcessMap;
+
+ ACE_Process_Manager process_mgr_;
+
+ PortableServer::POA_var root_poa_;
+ PortableServer::POA_var imr_poa_;
+
+ ImplementationRepository::Locator_var locator_;
+
+ /// We're given a token when registering with the locator, which
+ /// we must use when unregistering.
+ CORBA::Long registration_token_;
+
+ CORBA::ORB_var orb_;
+
+ unsigned int debug_;
+
+ bool notify_imr_;
+
+ ACE_CString name_;
+
+ ProcessMap process_map_;
+};
+
+#endif /* IMR_ACTIVATOR_I_H */
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator.cpp b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator.cpp
new file mode 100644
index 00000000000..12be58dd8cd
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator.cpp
@@ -0,0 +1,201 @@
+// $Id$
+
+#include "ImR_Locator_i.h"
+#include "Locator_NT_Service.h"
+#include "Locator_Options.h"
+#include "orbsvcs/Shutdown_Utilities.h"
+
+class ImR_Locator_Shutdown : public Shutdown_Functor
+{
+public:
+ ImR_Locator_Shutdown (ImR_Locator_i& imr);
+
+ void operator() (int which_signal);
+private:
+ ImR_Locator_i& imr_;
+};
+
+ImR_Locator_Shutdown::ImR_Locator_Shutdown (ImR_Locator_i &imr)
+ : imr_(imr)
+{
+}
+
+void
+ImR_Locator_Shutdown::operator () (int /*which_signal*/)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->imr_.shutdown (true ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "ImR: ");
+ }
+ ACE_ENDTRY;
+}
+
+int
+run_standalone (Options& opts)
+{
+ ImR_Locator_i server;
+
+ ImR_Locator_Shutdown killer (server);
+ Service_Shutdown kill_contractor(killer);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int status = server.init (opts ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (status == -1)
+ {
+ return 1;
+ }
+ else
+ {
+ // Run the server if it is initialized correctly.
+ server.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // End the server after its work is done.
+ status = server.fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == -1)
+ return 1;
+ }
+ return 0;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_PRINT_EXCEPTION (sysex, "System Exception");
+ }
+ ACE_CATCH (CORBA::UserException, userex)
+ {
+ ACE_PRINT_EXCEPTION (userex, "User Exception");
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unknown Exception");
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
+
+#if defined (ACE_WIN32)
+ACE_NT_SERVICE_DEFINE (service, Locator_NT_Service, IMR_LOCATOR_SERVICE_NAME);
+#endif /* ACE_WIN32 */
+
+int
+run_service (void)
+{
+#if defined (ACE_WIN32)
+
+ SERVICE::instance ()->name (IMR_LOCATOR_SERVICE_NAME, IMR_LOCATOR_DISPLAY_NAME);
+
+ ACE_NT_SERVICE_RUN (service, SERVICE::instance (), ret);
+
+ if (ret == 0)
+ ACE_ERROR ((LM_ERROR, "%p\n", "Couldn't start service"));
+
+ return ret;
+#else /* ACE_WIN32 */
+ return 1;
+#endif /* ACE_WIN32 */
+}
+
+/**
+ * Executes the various commands that are useful for a NT service. Right
+ * now these include 'install' and 'remove'. Others, such as 'start' and
+ * 'stop' can be added, but the 'net' program in Windows already handles
+ * these commands.
+ */
+static int
+run_service_command (Options& opts)
+{
+ if (opts.service_command () == Options::SC_NONE)
+ return 0;
+
+#if defined (ACE_WIN32)
+ SERVICE::instance()->name (IMR_LOCATOR_SERVICE_NAME, IMR_LOCATOR_DISPLAY_NAME);
+
+ if (opts.service_command () == Options::SC_INSTALL)
+ {
+ const DWORD MAX_PATH_LENGTH = 4096;
+ char pathname[MAX_PATH_LENGTH];
+
+ DWORD length = ACE_TEXT_GetModuleFileName (NULL, pathname, MAX_PATH_LENGTH);
+ if (length == 0 || length >= MAX_PATH_LENGTH - sizeof(" -s"))
+ {
+ ACE_ERROR ((LM_ERROR, "Error: Could not get module file name\n"));
+ return -1;
+ }
+
+ // Append the command used for running the implrepo as a service
+ ACE_OS::strcat (pathname, ACE_TEXT (" -s"));
+
+ int ret = SERVICE::instance ()->insert (SERVICE_DEMAND_START,
+ SERVICE_ERROR_NORMAL,
+ pathname);
+ if (ret != -1)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR: Service installed.\n"));
+ opts.save_registry_options ();
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR, "Error: Failed to install service. error:%d\n", errno));
+ }
+ if (ret == 0)
+ return 1;
+ }
+ else if (opts.service_command () == Options::SC_REMOVE)
+ {
+ int ret = SERVICE::instance ()->remove ();
+ ACE_DEBUG ((LM_DEBUG, "ImR: Service removed.\n"));
+ if (ret == 0)
+ return 1; // If successfull, then we don't want to continue.
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR, "Error: Unknown service command :%d \n",
+ opts.service_command ()));
+ return -1;
+ }
+
+ return -1;
+
+#else /* ACE_WIN32 */
+ ACE_ERROR ((LM_ERROR, "NT Service not supported on this platform"));
+ return -1;
+#endif /* ACE_WIN32 */
+}
+
+int
+main (int argc, char *argv[])
+{
+ Options opts;
+
+ int result = opts.init (argc, argv);
+ if (result < 0)
+ return 1; // Error
+ else if (result > 0)
+ return 0; // No error, but we should exit anyway.
+
+ result = run_service_command(opts);
+ if (result < 0)
+ return 1; // Error
+ else if (result > 0)
+ return 0; // No error, but we should exit anyway.
+
+ if (opts.service ())
+ {
+ return run_service ();
+ }
+
+ return run_standalone (opts);
+}
+
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator.idl b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator.idl
new file mode 100644
index 00000000000..acae98bb07f
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator.idl
@@ -0,0 +1,22 @@
+// -*- IDL -*-
+
+// $Id$
+
+#include "ImR_Activator.idl"
+
+module ImplementationRepository
+{
+ interface Locator : Administration
+ {
+ // returns a token that can be used (along with activator name) to unregister the activator.
+ long register_activator (in string name, in Activator act);
+
+ // You must pass in the token returned from register_activator.
+ void unregister_activator (in string name, in long token);
+
+ // The ImR_Activator calls this method to notify death of child
+ // process that it had started.
+ void notify_child_death (in string name);
+ };
+};
+
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp
new file mode 100644
index 00000000000..95684378c77
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp
@@ -0,0 +1,1532 @@
+// $Id$
+
+#include "ImR_Locator_i.h"
+#include "utils.h"
+#include "Iterator.h"
+#include "INS_Locator.h"
+
+#include "orbsvcs/Time_Utilities.h"
+
+#include "tao/IORTable/IORTable.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/ORB_Core.h"
+#include "tao/default_ports.h"
+#include "tao/Messaging/Messaging.h"
+#include "tao/AnyTypeCode/Any.h"
+
+#include "ace/ARGV.h"
+#include "ace/OS_NS_sys_time.h"
+#include "ace/Vector_T.h"
+
+static const int DEFAULT_START_LIMIT = 1;
+
+static const int PING_RETRY_SCHEDULE[] = {0, 10, 100, 500, 1000, 1000, 1000, 1000, 5000, 5000};
+
+static const ACE_Time_Value DEFAULT_SERVER_TIMEOUT (0, 10 * 1000); // 10ms
+// We want to give shutdown a little more time to work, so that we
+// can guarantee to the tao_imr utility that it has shutdown. The tao_imr
+// utility prints a different message depending on whether shutdown succeeds
+// or times out.
+static const ACE_Time_Value DEFAULT_SHUTDOWN_TIMEOUT (0, 5000 * 1000);
+
+static PortableServer::POA_ptr
+createPersistentPOA (PortableServer::POA_ptr root_poa, const char* poa_name ACE_ENV_ARG_DECL) {
+
+ PortableServer::LifespanPolicy_var life =
+ root_poa->create_lifespan_policy (PortableServer::PERSISTENT ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableServer::POA::_nil ());
+
+ PortableServer::IdAssignmentPolicy_var assign =
+ root_poa->create_id_assignment_policy (PortableServer::USER_ID ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableServer::POA::_nil ());
+
+ CORBA::PolicyList pols;
+ pols.length (2);
+ pols[0] = PortableServer::LifespanPolicy::_duplicate (life.in ());
+ pols[1] = PortableServer::IdAssignmentPolicy::_duplicate (assign.in ());
+
+ PortableServer::POAManager_var mgr = root_poa->the_POAManager ();
+ PortableServer::POA_var poa =
+ root_poa->create_POA (poa_name, mgr.in (), pols ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableServer::POA::_nil ());
+
+ life->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableServer::POA::_nil ());
+ assign->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableServer::POA::_nil ());
+
+ return poa._retn ();
+}
+
+ImR_Locator_i::ImR_Locator_i (void)
+ : forwarder_ (*this)
+ , ins_locator_ (0)
+ , debug_ (0)
+ , read_only_ (false)
+{
+ // Visual C++ 6.0 is not smart enough to do a direct assignment
+ // while allocating the INS_Locator. So, we have to do it in
+ // two steps.
+ INS_Locator* locator;
+ ACE_NEW (locator,
+ INS_Locator (*this));
+ ins_locator_ = locator;
+}
+
+ImR_Locator_i::~ImR_Locator_i (void)
+{
+ // For some reason g++ 4.0 needs this out-of-line destructor instead
+ // of the default one generated by the compiler. Without this
+ // destructor, we get a number of "undefined reference" link errors
+ // related to the virtual tables of the INS_Locator, ImR_Adapter and
+ // ImR_Forwarder members in this class.
+}
+
+int
+ImR_Locator_i::init_with_orb (CORBA::ORB_ptr orb, Options& opts ACE_ENV_ARG_DECL)
+{
+ orb_ = CORBA::ORB::_duplicate (orb);
+ debug_ = opts.debug ();
+ read_only_ = opts.readonly ();
+ startup_timeout_ = opts.startup_timeout ();
+ ping_interval_ = opts.ping_interval ();
+
+ CORBA::Object_var obj =
+ this->orb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ this->root_poa_ = PortableServer::POA::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ ACE_ASSERT (! CORBA::is_nil (this->root_poa_.in ()));
+
+ this->forwarder_.init (orb ACE_ENV_ARG_PARAMETER);
+ this->adapter_.init (& this->forwarder_);
+
+ // Register the Adapter_Activator reference to be the RootPOA's
+ // Adapter Activator.
+ root_poa_->the_activator (&this->adapter_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Use a persistent POA so that any IOR
+ this->imr_poa_ = createPersistentPOA (this->root_poa_.in (),
+ "ImplRepo_Service" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ ACE_ASSERT (! CORBA::is_nil (this->imr_poa_.in ()));
+
+ waiter_svt_.debug (debug_ > 1);
+ PortableServer::ObjectId_var id = PortableServer::string_to_ObjectId ("ImR_AsyncStartupWaiter");
+ this->imr_poa_->activate_object_with_id (id.in (), &waiter_svt_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ obj = this->imr_poa_->id_to_reference (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (startup_timeout_ > ACE_Time_Value::zero)
+ {
+ obj = set_timeout_policy (obj.in (), startup_timeout_);
+ }
+ waiter_ = ImplementationRepository::AsyncStartupWaiter::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ id = PortableServer::string_to_ObjectId ("ImplRepo_Service");
+ this->imr_poa_->activate_object_with_id (id.in (), this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ obj = this->imr_poa_->id_to_reference (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ CORBA::String_var ior = this->orb_->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register the ImR for use with INS
+ obj = orb->resolve_initial_references ("IORTable" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ IORTable::Table_var ior_table = IORTable::Table::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ ACE_ASSERT (! CORBA::is_nil (ior_table.in ()));
+ ior_table->bind ("ImplRepoService", ior.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ ior_table->bind ("ImR", ior.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ ior_table->set_locator (this->ins_locator_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Set up multicast support (if enabled)
+ if (opts.multicast ())
+ {
+ ACE_Reactor* reactor = orb->orb_core ()->reactor ();
+ if (this->setup_multicast (reactor, ior.in ()) != 0)
+ return -1;
+ }
+
+ // Initialize the persistent storage. This will load any values that
+ // may have been persisted before.
+ // The init can return 1 if there is no persistent file yet. In
+ // that case, we need not do anything for now.
+ int init_result =
+ this->repository_.init (opts);
+ if (init_result == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Repository failed to initialize\n"), -1);
+ }
+
+ // Activate the two poa managers
+ PortableServer::POAManager_var poaman =
+ this->root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ poaman->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ poaman = this->imr_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ poaman->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // We write the ior file last so that the tests can know we are ready.
+ if (opts.ior_filename ().length () > 0)
+ {
+ FILE* fp = ACE_OS::fopen (opts.ior_filename ().c_str (), "w");
+ if (fp == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ImR: Could not open file: %s\n", opts.ior_filename ().c_str ()), -1);
+ }
+ ACE_OS::fprintf (fp, "%s", ior.in ());
+ ACE_OS::fclose (fp);
+ }
+
+ return 0;
+}
+
+int
+ImR_Locator_i::init (Options& opts ACE_ENV_ARG_DECL)
+{
+ ACE_CString cmdline = opts.cmdline ();
+ cmdline += " -orbcollocation no -orbuseimr 0";
+ ACE_ARGV av (cmdline.c_str ());
+ int argc = av.argc ();
+ char** argv = av.argv ();
+
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "TAO_ImR_Locator" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ int err = this->init_with_orb (orb.in (), opts ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ return err;
+}
+
+int
+ImR_Locator_i::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (debug_ > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Implementation Repository: Running\n"
+ "\tPing Interval : %dms\n"
+ "\tStartup Timeout : %ds\n"
+ "\tPersistence : %s\n"
+ "\tMulticast : %s\n"
+ "\tDebug : %d\n"
+ "\tLocked : %s\n\n",
+ ping_interval_.msec (),
+ startup_timeout_.sec (),
+ repository_.repo_mode (),
+ ior_multicast_.reactor () != 0 ? "Enabled" : "Disabled",
+ debug (),
+ read_only_ ? "True" : "False"));
+ }
+ this->auto_start_servers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+void
+ImR_Locator_i::shutdown (CORBA::Boolean activators, CORBA::Boolean servers ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (servers != 0 && this->repository_.servers ().current_size () > 0)
+ {
+ // Note : shutdown is oneway, so we can't throw
+ ACE_ERROR ((LM_ERROR, "ImR: Shutdown of all servers not implemented.\n"));
+ }
+ if (activators != 0 && this->repository_.activators ().current_size () > 0)
+ {
+ ACE_Vector<ImplementationRepository::Activator_var> acts;
+ Locator_Repository::AIMap::ENTRY* entry = 0;
+ Locator_Repository::AIMap::ITERATOR it (this->repository_.activators ());
+ for (;it.next (entry) != 0; it.advance ())
+ {
+ Activator_Info_Ptr info = entry->int_id_;
+ ACE_ASSERT (! info.null ());
+ connect_activator (*info);
+ if (! CORBA::is_nil (info->activator.in ()))
+ acts.push_back (info->activator);
+ }
+
+ int shutdown_errs = 0;
+
+ for (size_t i = 0; i < acts.size (); ++i)
+ {
+ ACE_TRY
+ {
+ acts[i]->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ acts[i] = ImplementationRepository::Activator::_nil ();
+ }
+ ACE_CATCHANY
+ {
+ ++shutdown_errs;
+ if (debug_ > 1)
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "ImR: shutdown activator");
+ }
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+ if (debug_ > 0 && shutdown_errs > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR: Some activators could not be shut down.\n"));
+ }
+ }
+ // Technically, we should wait for all the activators to unregister, but
+ // ,for now at least, it doesn't seem worth it.
+ shutdown (false ACE_ENV_ARG_PARAMETER);
+}
+
+void
+ImR_Locator_i::shutdown (bool wait_for_completion ACE_ENV_ARG_DECL)
+{
+ this->orb_->shutdown (wait_for_completion ACE_ENV_ARG_PARAMETER);
+}
+
+int
+ImR_Locator_i::fini (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ if (debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Shutting down...\n"));
+
+ teardown_multicast ();
+
+ this->root_poa_->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Shut down successfully.\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "ImR_Locator_i::fini");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+void
+ImR_Locator_i::teardown_multicast ()
+{
+ ACE_Reactor* r = ior_multicast_.reactor ();
+ if (r != 0) {
+ r->remove_handler (&ior_multicast_, ACE_Event_Handler::READ_MASK);
+ ior_multicast_.reactor (0);
+ }
+}
+
+int
+ImR_Locator_i::setup_multicast (ACE_Reactor* reactor, const char* ior)
+{
+ ACE_ASSERT (reactor != 0);
+ ACE_ASSERT (ior != 0);
+#if defined (ACE_HAS_IP_MULTICAST)
+
+ TAO_ORB_Core* core = TAO_ORB_Core_instance ();
+ // See if the -ORBMulticastDiscoveryEndpoint option was specified.
+ ACE_CString mde (core->orb_params ()->mcast_discovery_endpoint ());
+
+ if (mde.length () != 0)
+ {
+ if (this->ior_multicast_.init (ior,
+ mde.c_str (), TAO_SERVICEID_IMPLREPOSERVICE) == -1)
+ {
+ return -1;
+ }
+ }
+ else
+ {
+ // Port can be specified as param, env var, or default
+ CORBA::UShort port =
+ core->orb_params ()->service_port (TAO::MCAST_IMPLREPOSERVICE);
+ if (port == 0)
+ {
+ // Check environment var. for multicast port.
+ const char* port_number = ACE_OS::getenv ("ImplRepoServicePort");
+
+ if (port_number != 0)
+ port = static_cast<CORBA::UShort> (ACE_OS::atoi (port_number));
+ }
+ if (port == 0)
+ port = TAO_DEFAULT_IMPLREPO_SERVER_REQUEST_PORT;
+
+ if (this->ior_multicast_.init (ior, port,
+ ACE_DEFAULT_MULTICAST_ADDR, TAO_SERVICEID_IMPLREPOSERVICE) == -1)
+ {
+ return -1;
+ }
+ }
+
+ // Register event handler for the ior multicast.
+ if (reactor->register_handler (&this->ior_multicast_,
+ ACE_Event_Handler::READ_MASK) == -1)
+ {
+ if (debug_ >= 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR: cannot register Event handler\n"));
+ return -1;
+ }
+#else /* ACE_HAS_IP_MULTICAST*/
+ ACE_UNUSED_ARG (reactor);
+ ACE_UNUSED_ARG (ior);
+#endif /* ACE_HAS_IP_MULTICAST*/
+ return 0;
+}
+
+CORBA::Long
+ImR_Locator_i::register_activator (const char* aname,
+ ImplementationRepository::Activator_ptr activator
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_ASSERT (aname != 0);
+ ACE_ASSERT (! CORBA::is_nil (activator));
+
+ // Before we can register the activator, we need to ensure that any existing
+ // registration is purged.
+ this->unregister_activator_i (aname);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::String_var ior =
+ this->orb_->object_to_string (activator ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::Long token = ACE_OS::gettimeofday ().msec ();
+
+ int err = this->repository_.add_activator (aname, token, ior.in (), activator);
+ ACE_ASSERT (err == 0);
+ ACE_UNUSED_ARG (err);
+
+ if (this->debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Activator registered for %s.\n", aname));
+
+ return token;
+}
+
+void
+ImR_Locator_i::unregister_activator (const char* aname,
+ CORBA::Long token
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_ASSERT (aname != 0);
+ Activator_Info_Ptr info = this->get_activator (aname);
+
+ if (! info.null ())
+ {
+ if (info->token != token && this->debug_ > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR: Ignoring unregister activator:%s. Wrong token.\n", aname));
+ return;
+ }
+
+ this->unregister_activator_i (aname);
+ ACE_CHECK;
+
+ if (this->debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Activator %s unregistered.\n", aname));
+ }
+ else
+ {
+ if (this->debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Ignoring unregister activator:%s. Unknown activator.\n", aname));
+ }
+}
+
+void
+ImR_Locator_i::unregister_activator_i (const char* aname)
+{
+ ACE_ASSERT (aname != 0);
+ int err = this->repository_.remove_activator (aname);
+ ACE_UNUSED_ARG (err);
+}
+
+void
+ImR_Locator_i::notify_child_death (const char* name ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_ASSERT (name != 0);
+
+ if (this->debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Server has died <%s>.\n", name));
+
+ Server_Info_Ptr info = this->repository_.get_server (name);
+ if (! info.null ())
+ {
+ info->ior = "";
+ info->partial_ior = "";
+
+ int err = this->repository_.update_server (*info);
+ ACE_ASSERT (err == 0);
+ ACE_UNUSED_ARG (err);
+ }
+ else
+ {
+ if (this->debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR: Failed to find server in repository.\n"));
+ }
+}
+
+void
+ImR_Locator_i::activate_server (const char* server ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ ImplementationRepository::NotFound,
+ ImplementationRepository::CannotActivate))
+{
+ if (debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Manually activating server <%s>\n", server));
+
+ // This is the version called by tao_imr to activate the server, manually
+ // starting it if necessary.
+ activate_server_by_name (server, true ACE_ENV_ARG_PARAMETER);
+}
+
+char*
+ImR_Locator_i::activate_server_by_name (const char* name, bool manual_start ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ ImplementationRepository::NotFound,
+ ImplementationRepository::CannotActivate))
+{
+ // Activate the server, starting it if necessary. Don't start MANUAL
+ // servers unless manual_start=true
+ ACE_ASSERT (name != 0);
+
+ Server_Info_Ptr info = this->repository_.get_server (name);
+ if (info.null ())
+ {
+ ACE_ERROR ((LM_ERROR, "ImR: Cannot find info for server <%s>\n", name));
+ ACE_THROW_RETURN (ImplementationRepository::NotFound (), 0);
+ }
+
+ return activate_server_i (*info, manual_start ACE_ENV_ARG_PARAMETER);
+}
+
+char*
+ImR_Locator_i::activate_server_by_object (const char* object_name ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ ImplementationRepository::NotFound,
+ ImplementationRepository::CannotActivate))
+{
+ ACE_ASSERT (object_name != 0);
+
+ // We assume that the first part of the object name is the server name.
+ // So a name of foo/bar means that the server name is foo.
+ ACE_CString server_name (object_name);
+ ACE_CString::size_type pos = server_name.find ('/');
+ if (pos != ACE_CString::npos)
+ server_name = server_name.substr (pos + 1);
+
+ return activate_server_by_name (server_name.c_str (), false ACE_ENV_ARG_PARAMETER);
+}
+
+char*
+ImR_Locator_i::activate_server_i (Server_Info& info, bool manual_start ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ ImplementationRepository::NotFound,
+ ImplementationRepository::CannotActivate))
+{
+ if (info.activation_mode == ImplementationRepository::PER_CLIENT)
+ {
+ return activate_perclient_server_i (info, manual_start ACE_ENV_ARG_PARAMETER);
+ }
+
+ while (true)
+ {
+ if (is_alive (info))
+ {
+ if (debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR: Successfully activated <%s> at \n\t%s\n",
+ info.name.c_str (), info.partial_ior.c_str ()));
+ }
+ info.start_count = 0;
+
+ waiter_svt_.unblock_all (info.name.c_str ());
+
+ return CORBA::string_dup (info.partial_ior.c_str ());
+ }
+
+ info.reset ();
+
+ if (! info.starting && info.start_count >= info.start_limit)
+ {
+ if (this->debug_ > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR: Cannot Activate <%s>.\n", info.name.c_str ()));
+ }
+
+ waiter_svt_.unblock_all (info.name.c_str ());
+
+ ACE_THROW_RETURN (ImplementationRepository::CannotActivate
+ (CORBA::string_dup ("Cannot start server.")), 0);
+ }
+
+ // Note : We already updated info with StartupInfo in server_is_running ()
+ ImplementationRepository::StartupInfo_var si =
+ start_server (info, manual_start ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+}
+
+char*
+ImR_Locator_i::activate_perclient_server_i (Server_Info info, bool manual_start ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ ImplementationRepository::NotFound,
+ ImplementationRepository::CannotActivate))
+{
+ do
+ {
+ ImplementationRepository::StartupInfo* psi =
+ start_server (info, manual_start ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (psi != 0)
+ {
+ ImplementationRepository::StartupInfo_var si = psi;
+ ACE_ASSERT (info.name == si->name.in ());
+ info.partial_ior = si->partial_ior.in ();
+ info.ior = si->ior.in ();
+
+ if (is_alive (info))
+ {
+ if (debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR: Successfully activated <%s> at \n\t%s\n",
+ info.name.c_str (), info.partial_ior.c_str ()));
+ }
+ return CORBA::string_dup (info.partial_ior.c_str ());
+ }
+ info.reset ();
+ }
+ } while (info.start_count < info.start_limit);
+
+ if (this->debug_ > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR: Cannot Activate <%s>.\n", info.name.c_str ()));
+ }
+ ACE_THROW_RETURN (ImplementationRepository::CannotActivate
+ (CORBA::string_dup ("Cannot start server.")), 0);
+}
+
+ImplementationRepository::StartupInfo*
+ImR_Locator_i::start_server (Server_Info& info, bool manual_start ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ ImplementationRepository::NotFound,
+ ImplementationRepository::CannotActivate))
+{
+ if (info.activation_mode == ImplementationRepository::MANUAL && ! manual_start)
+ {
+ if (debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Cannot start server <%s>. ActivationMode=MANUAL\n", info.name.c_str ()));
+ ACE_THROW_RETURN (ImplementationRepository::CannotActivate
+ (CORBA::string_dup ("Cannot implicitly activate MANUAL server.")), 0);
+ }
+ if (info.cmdline.length () == 0)
+ {
+ if (debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Cannot start server <%s>."
+ " No command line.\n", info.name.c_str ()));
+ ACE_THROW_RETURN (ImplementationRepository::CannotActivate
+ (CORBA::string_dup ("No command line registered for server.")), 0);
+ }
+
+ Activator_Info_Ptr ainfo = get_activator (info.activator);
+
+ if (ainfo.null () || CORBA::is_nil (ainfo->activator.in ()))
+ {
+ if (debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Cannot start server <%s>. "
+ "Activator <%s> not found.\n", info.name.c_str (), info.activator.c_str ()));
+ ACE_THROW_RETURN (ImplementationRepository::CannotActivate
+ (CORBA::string_dup ("No activator registered for server.")), 0);
+ }
+
+ ACE_TRY
+ {
+ ++ info.waiting_clients;
+
+ if (info.waiting_clients <= 1 || info.activation_mode == ImplementationRepository::PER_CLIENT)
+ {
+ info.starting = true;
+ ++info.start_count;
+ ACE_ASSERT (info.start_count <= info.start_limit);
+ if (this->debug_ > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR: Starting server <%s>. Attempt %d/%d.\n",
+ info.name.c_str (), info.start_count, info.start_limit));
+ }
+ ainfo->activator->start_server (
+ info.name.c_str (),
+ info.cmdline.c_str (),
+ info.dir.c_str (),
+ info.env_vars
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ if (info.partial_ior.length () == 0)
+ {
+ if (this->debug_ > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR: Waiting for <%s> to start...\n", info.name.c_str ()));
+ }
+
+ ImplementationRepository::StartupInfo_var si =
+ waiter_->wait_for_startup (info.name.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ -- info.waiting_clients;
+ info.starting = false;
+
+ return si._retn ();
+ }
+ else // The server_is_running () came in before the wait_for_startup ()
+ {
+ if (this->debug_ > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR: <%s> Skipping wait. Already started.\n", info.name.c_str ()));
+ }
+ -- info.waiting_clients;
+ info.starting = false;
+ }
+ }
+ ACE_CATCH (CORBA::TIMEOUT, ex)
+ {
+ -- info.waiting_clients;
+ info.starting = false;
+ // We may have connected successfully, because the timeout could occur before
+ // the AsyncStartupWaiter manages to return. In fact, when the ImR is very busy
+ // this is the most likely code path.
+ if (info.partial_ior.length () == 0)
+ {
+ if (debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR : Timeout waiting for <%s> to start.\n", info.name.c_str ()));
+ info.reset ();
+ }
+ }
+ ACE_CATCH (ImplementationRepository::CannotActivate, ex)
+ {
+ -- info.waiting_clients;
+ info.starting = false;
+ info.reset ();
+ if (debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Activator cannot start <%s>.\n", info.name.c_str ()));
+ }
+ ACE_CATCHANY
+ {
+ -- info.waiting_clients;
+ info.starting = false;
+ if (debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Unexpected exception while starting <%s>.\n", info.name.c_str ()));
+ if (debug_ > 1)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "");
+ ainfo->reset ();
+ info.reset ();
+ }
+ ACE_ENDTRY;
+ return 0; // This is not a corba call, so a zero should be ok
+}
+
+CORBA::Object_ptr
+ImR_Locator_i::set_timeout_policy (CORBA::Object_ptr obj, const ACE_Time_Value& to)
+{
+ CORBA::Object_var ret (CORBA::Object::_duplicate (obj));
+
+ ACE_TRY_NEW_ENV
+ {
+ TimeBase::TimeT timeout;
+ ORBSVCS_Time::Time_Value_to_TimeT (timeout, to);
+ CORBA::Any tmp;
+ tmp <<= timeout;
+
+ CORBA::PolicyList policies (1);
+ policies.length (1);
+ policies[0] = orb_->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE, tmp ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ret = obj->_set_policy_overrides (policies, CORBA::ADD_OVERRIDE ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ policies[0]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (ret.in ()))
+ {
+ if (this->debug_ > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR: Unable to set timeout policy.\n"));
+ }
+ ret = CORBA::Object::_duplicate (obj);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "ImR_Locator_i::set_timeout_policy ()");
+ }
+ ACE_ENDTRY;
+
+ return ret._retn ();
+}
+
+void
+ImR_Locator_i::add_or_update_server (const char* server,
+ const ImplementationRepository::StartupOptions &options
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ ImplementationRepository::NotFound))
+{
+ ACE_ASSERT (server != 0);
+
+ if (this->read_only_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR: Cannot add/update server <%s> due to locked database.\n", server));
+ ACE_THROW (CORBA::NO_PERMISSION (
+ CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0),
+ CORBA::COMPLETED_NO));
+ }
+
+ if (debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Add/Update server <%s>.\n", server));
+
+ int limit = options.start_limit;
+ if (limit < 0)
+ {
+ limit = -limit;
+ }
+ else if (limit == 0)
+ {
+ limit = 1;
+ }
+
+ Server_Info_Ptr info = this->repository_.get_server (server);
+ if (info.null ())
+ {
+ if (this->debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Adding server <%s>.\n", server));
+
+ this->repository_.add_server (server,
+ options.activator.in (),
+ options.command_line.in (),
+ options.environment,
+ options.working_directory.in (),
+ options.activation,
+ limit);
+ }
+ else
+ {
+ if (this->debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Updating server <%s>.\n", server));
+
+ info->activator = options.activator.in ();
+ info->cmdline = options.command_line.in ();
+ info->env_vars = options.environment;
+ info->dir = options.working_directory.in ();
+ info->activation_mode = options.activation;
+ info->start_limit = limit;
+ info->start_count = 0;
+ int err = this->repository_.update_server (*info);
+ ACE_ASSERT (err == 0);
+ ACE_UNUSED_ARG (err);
+ }
+
+ if (this->debug_ > 1)
+ {
+ // Note : The info var may be null, so we use options.
+ ACE_DEBUG ((LM_DEBUG, "ImR: Server: %s\n"
+ "\tActivator: %s\n"
+ "\tCommand Line: %s\n"
+ "\tWorking Directory: %s\n"
+ "\tActivation: %s\n"
+ "\tStart Limit: %d\n"
+ "\n",
+ server,
+ options.activator.in (),
+ options.command_line.in (),
+ options.working_directory.in (),
+ ImR_Utils::activationModeToString (options.activation).c_str (),
+ limit
+ ));
+
+ for (CORBA::ULong i = 0; i < options.environment.length (); ++i)
+ ACE_DEBUG ((LM_DEBUG, "Environment variable %s=%s\n",
+ options.environment[i].name.in (),
+ options.environment[i].value.in ()));
+ }
+}
+
+void
+ImR_Locator_i::remove_server (const char* name ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException, ImplementationRepository::NotFound))
+{
+ ACE_ASSERT (name != 0);
+ if (this->read_only_)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "ImR: Can't remove server <%s> due to locked database.\n", name));
+ ACE_THROW (CORBA::NO_PERMISSION (
+ CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0),
+ CORBA::COMPLETED_NO));
+ }
+
+ // Note : This will be safe, because any Server_Info_Ptr objects will still
+ // be valid, and the actual Server_Info will be destroyed when the last
+ // one goes out of scope.
+
+ Server_Info_Ptr info = this->repository_.get_server (name);
+ if (! info.null ())
+ {
+ if (this->repository_.remove_server (name) == 0)
+ {
+ if (this->debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Removing Server <%s>...\n", name));
+
+ PortableServer::POA_var poa = findPOA (name);
+ ACE_CHECK;
+ if (! CORBA::is_nil (poa.in ()))
+ {
+ bool etherealize = true;
+ bool wait = false;
+ poa->destroy (etherealize, wait ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ if (this->debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Removed Server <%s>.\n", name));
+ }
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "ImR: Can't remove unknown server <%s>.\n", name));
+ ACE_THROW (ImplementationRepository::NotFound ());
+ }
+}
+
+PortableServer::POA_ptr
+ImR_Locator_i::findPOA (const char* name)
+{
+ ACE_TRY_NEW_ENV
+ {
+ bool activate_it = false;
+ return root_poa_->find_POA (name, activate_it ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {// Ignore
+ }
+ ACE_ENDTRY;
+ return PortableServer::POA::_nil ();
+}
+
+void
+ImR_Locator_i::shutdown_server (const char* server ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException, ImplementationRepository::NotFound))
+{
+ ACE_ASSERT (server != 0);
+
+ if (this->debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Shutting down server <%s>.\n", server));
+
+ Server_Info_Ptr info = this->repository_.get_server (server);
+ if (info.null ())
+ {
+ ACE_ERROR ((LM_ERROR,
+ "ImR: shutdown_server () Cannot find info for server <%s>\n", server));
+ ACE_THROW (ImplementationRepository::NotFound ());
+ }
+
+ connect_server (*info);
+
+ if (CORBA::is_nil (info->server.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "ImR: shutdown_server () Cannot connect to server <%s>\n", server));
+ ACE_THROW (ImplementationRepository::NotFound ());
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Object_var obj = set_timeout_policy (info->server.in (), DEFAULT_SHUTDOWN_TIMEOUT);
+ ImplementationRepository::ServerObject_var server =
+ ImplementationRepository::ServerObject::_unchecked_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TIMEOUT, ex)
+ {
+ info->reset ();
+ int err = this->repository_.update_server (*info);
+ ACE_ASSERT (err == 0);
+ ACE_UNUSED_ARG (err);
+ // Note : This is a good thing. It means we didn't waste our time waiting for
+ // the server to finish shutting down.
+ if (this->debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR: Timeout while waiting for <%s> shutdown.\n", server));
+ }
+ ACE_RE_THROW;
+ }
+ ACE_CATCHANY
+ {
+ if (this->debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR: Exception ignored while shutting down <%s>\n", server));
+ }
+ }
+ ACE_ENDTRY;
+
+ // Note : In most cases this has already been done in the server_is_shutting_down ()
+ // operation, but it doesn't hurt to update it again.
+ info->reset ();
+
+ int err = this->repository_.update_server (*info);
+ ACE_ASSERT (err == 0);
+ ACE_UNUSED_ARG (err);
+}
+
+void
+ImR_Locator_i::server_is_running (const char* name,
+ const char* partial_ior,
+ ImplementationRepository::ServerObject_ptr server
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ ImplementationRepository::NotFound))
+{
+ ACE_ASSERT (name != 0);
+ ACE_ASSERT (partial_ior != 0);
+ ACE_ASSERT (! CORBA::is_nil (server));
+
+ if (this->debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Server %s is running at %s.\n", name, partial_ior));
+
+ CORBA::String_var ior = orb_->object_to_string (server ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Server %s callback at %s.\n", name, ior.in ()));
+
+ Server_Info_Ptr info = this->repository_.get_server (name);
+ if (info.null ())
+ {
+ if (this->debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Auto adding NORMAL server <%s>.\n", name));
+
+ ImplementationRepository::EnvironmentList env (0);
+ this->repository_.add_server (name,
+ "", // no activator
+ "", // no cmdline
+ ImplementationRepository::EnvironmentList (),
+ "", // no working dir
+ ImplementationRepository::NORMAL,
+ DEFAULT_START_LIMIT,
+ partial_ior,
+ ior.in (),
+ ImplementationRepository::ServerObject::_nil () // Will connect at first access
+ );
+ }
+ else
+ {
+ if (info->activation_mode != ImplementationRepository::PER_CLIENT) {
+ info->ior = ior.in ();
+ info->partial_ior = partial_ior;
+ info->server = ImplementationRepository::ServerObject::_nil (); // Will connect at first access
+
+ int err = this->repository_.update_server (*info);
+ ACE_ASSERT (err == 0);
+ ACE_UNUSED_ARG (err);
+
+ waiter_svt_.unblock_one (name, partial_ior, ior.in (), false);
+ } else {
+ // Note : There's no need to unblock all the waiting request until
+ // we know the final status of the server.
+ waiter_svt_.unblock_one (name, partial_ior, ior.in (), true);
+ }
+ }
+}
+
+void
+ImR_Locator_i::server_is_shutting_down (const char* server ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException, ImplementationRepository::NotFound))
+{
+ ACE_ASSERT (server != 0);
+ Server_Info_Ptr info = this->repository_.get_server (server);
+ if (info.null ())
+ {
+ if (this->debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR_Locator_i::server_is_shutting_down: Unknown server:%s\n", server));
+ }
+ return;
+ }
+
+ if (this->debug_ > 0)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Server <%s> is shutting down.\n", server));
+
+ info->reset ();
+
+ int err = this->repository_.update_server (*info);
+ ACE_ASSERT (err == 0);
+ ACE_UNUSED_ARG (err);
+}
+
+void
+ImR_Locator_i::find (const char* server,
+ ImplementationRepository::ServerInformation_out imr_info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_ASSERT (server != 0);
+ ACE_NEW_THROW_EX (imr_info, ImplementationRepository::ServerInformation, CORBA::NO_MEMORY ());
+
+ Server_Info_Ptr info = this->repository_.get_server (server);
+ if (! info.null ())
+ {
+ imr_info = info->createImRServerInfo (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ if (this->debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Found server %s.\n", server));
+ }
+ else
+ {
+ if (debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Cannot find server <%s>\n", server));
+ }
+}
+
+void
+ImR_Locator_i::list (CORBA::ULong how_many,
+ ImplementationRepository::ServerInformationList_out server_list,
+ ImplementationRepository::ServerInformationIterator_out server_iterator
+ ACE_ENV_ARG_DECL
+ ) ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (this->debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR: List servers.\n"));
+
+ // Initialize the out variables, so if we return early, they will
+ // not be dangling.
+ server_iterator = ImplementationRepository::ServerInformationIterator::_nil ();
+ ACE_NEW_THROW_EX (server_list,
+ ImplementationRepository::ServerInformationList (0), CORBA::NO_MEMORY ());
+
+ Locator_Repository::SIMap::ENTRY* entry = 0;
+ Locator_Repository::SIMap::ITERATOR it (this->repository_.servers ());
+
+ // Number of servers that will go into the server_list.
+ CORBA::ULong n = this->repository_.servers ().current_size ();
+ if (how_many > 0 && n > how_many)
+ {
+ n = how_many;
+ }
+
+ server_list->length (n);
+
+ if (this->debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR_Locator_i::list: Filling ServerList with %d servers\n", n));
+
+ for (CORBA::ULong i = 0; i < n; i++)
+ {
+ it.next (entry);
+ it.advance ();
+ ACE_ASSERT (entry != 0);
+
+ Server_Info_Ptr info = entry->int_id_;
+
+ ImplementationRepository::ServerInformation_var imr_info = info->createImRServerInfo (ACE_ENV_SINGLE_ARG_PARAMETER);
+ server_list[i] = *imr_info;
+ }
+
+ if (this->repository_.servers ().current_size () > n)
+ {
+ if (this->debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR_Locator_i::list: Creating ServerInformation Iterator\n"));
+
+ ImR_Iterator* imr_iter;
+
+ ACE_NEW_THROW_EX (imr_iter,
+ ImR_Iterator (n, this->repository_, this->imr_poa_.in ()),
+ CORBA::NO_MEMORY ());
+
+ PortableServer::ServantBase_var tmp (imr_iter);
+
+ ACE_TRY
+ {
+ PortableServer::ObjectId_var id =
+ this->imr_poa_->activate_object (imr_iter ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::Object_var obj = this->imr_poa_->id_to_reference (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ server_iterator = ImplementationRepository::
+ ServerInformationIterator::_unchecked_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+}
+
+Activator_Info_Ptr
+ImR_Locator_i::get_activator (const ACE_CString& aname)
+{
+ Activator_Info_Ptr info = this->repository_.get_activator (aname);
+ if (! info.null ())
+ {
+ this->connect_activator (*info);
+ }
+ return info;
+}
+
+void
+ImR_Locator_i::connect_activator (Activator_Info& info)
+{
+ if (! CORBA::is_nil (info.activator.in ()) || info.ior.length () == 0)
+ return;
+
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Object_var obj =
+ this->orb_->string_to_object (info.ior.c_str ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (obj.in ()))
+ {
+ info.reset ();
+ return;
+ }
+
+ if (startup_timeout_ > ACE_Time_Value::zero)
+ {
+ obj = set_timeout_policy (obj.in (), startup_timeout_);
+ }
+
+ info.activator =
+ ImplementationRepository::Activator::_unchecked_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (info.activator.in ()))
+ {
+ info.reset ();
+ return;
+ }
+
+ if (debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Connected to activator <%s>\n", info.name.c_str ()));
+ }
+ ACE_CATCHANY
+ {
+ info.reset ();
+ }
+ ACE_ENDTRY;
+}
+
+void
+ImR_Locator_i::auto_start_servers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->repository_.servers ().current_size () == 0)
+ return;
+
+ Locator_Repository::SIMap::ENTRY* server_entry;
+ Locator_Repository::SIMap::ITERATOR server_iter (this->repository_.servers ());
+
+ // For each of the entries in the Locator_Repository, get the startup
+ // information and activate the servers, if they are not already
+ // running.
+ for (;server_iter.next (server_entry) != 0; server_iter.advance ())
+ {
+ Server_Info_Ptr info = server_entry->int_id_;
+ ACE_ASSERT (! info.null ());
+
+ ACE_TRY
+ {
+ if (info->activation_mode == ImplementationRepository::AUTO_START
+ && info->cmdline.length () > 0)
+ {
+ this->activate_server_i (*info, true ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ if (this->debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR: AUTO_START Could not activate <%s>\n",
+ server_entry->ext_id_.c_str ()));
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "AUTO_START");
+ }
+ // Ignore exceptions
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+}
+
+void
+ImR_Locator_i::connect_server (Server_Info& info)
+{
+ if (! CORBA::is_nil (info.server.in ()))
+ {
+ return; // already connected
+ }
+
+ if (info.ior.length () == 0)
+ {
+ info.reset ();
+ return; // can't connect
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Object_var obj = orb_->string_to_object (info.ior.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (obj.in ()))
+ {
+ info.reset ();
+ return;
+ }
+
+ obj = set_timeout_policy (obj.in (), DEFAULT_SERVER_TIMEOUT);
+
+ info.server =
+ ImplementationRepository::ServerObject::_unchecked_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (info.server.in ()))
+ {
+ info.reset ();
+ return;
+ }
+
+ if (debug_ > 1)
+ ACE_DEBUG ((LM_DEBUG, "ImR: Connected to server <%s>\n", info.name.c_str ()));
+ }
+ ACE_CATCHANY
+ {
+ info.reset ();
+ }
+ ACE_ENDTRY;
+}
+
+bool
+ImR_Locator_i::is_alive (Server_Info& info)
+{
+ const size_t table_size = sizeof (PING_RETRY_SCHEDULE) /
+ sizeof (*PING_RETRY_SCHEDULE);
+
+ for (size_t i = 0; i < table_size; ++i)
+ {
+ int status = this->is_alive_i (info);
+ if (status == 0)
+ return false;
+ if (status == 1)
+ return true;
+
+ // This is evil, but there's not much else we can do for now. We
+ // should never reach this code once the ImR Servers are fixed
+ // so that they don't lie about server_is_running. Currently,
+ // they send this notification during poa creation. We have to
+ // run the orb, because the very thing that may be slowing the
+ // aliveness of the servers is the fact that they're trying to
+ // register more objects with us. In practical testing, we
+ // never retried the ping more than once, because the second
+ // ping always timed out, even if the servers poa manager had
+ // not been activated. The only way we saw multiple retries was
+ // if we ran the orb on the server before the poa manager was
+ // activated. For this reason, the first retry is immediate,
+ // and the orb->run () call is not required. The call will
+ // likely timeout, and is_alive will return true.
+ if (PING_RETRY_SCHEDULE[i] > 0)
+ {
+ ACE_Time_Value tv (0, PING_RETRY_SCHEDULE[i] * 1000);
+ this->orb_->run (tv);
+ }
+ }
+ if (debug_ > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR: <%s> Ping retry count exceeded. alive=maybe.\n", info.name.c_str ()));
+ }
+ // We return true here, because the server *might* be alive, it's just not starting in a timely
+ // manner. We can't return false, because then we'll just try to start another instance, and the
+ // same thing will likely happen.
+ info.last_ping = ACE_OS::gettimeofday ();
+ return true;
+}
+
+int
+ImR_Locator_i::is_alive_i (Server_Info& info)
+{
+ // This is used by the ACE_TRY below when exceptions are turned off.
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ if (info.ior.length () == 0 || info.partial_ior.length () == 0)
+ {
+ if (debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR: <%s> not running. alive=false.\n", info.name.c_str ()));
+ }
+ info.last_ping = ACE_Time_Value::zero;
+ return 0;
+ }
+
+ if (ping_interval_ == ACE_Time_Value::zero)
+ {
+ if (debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR: <%s> Ping verification disabled. alive=true.\n", info.name.c_str ()));
+ }
+ return 1;
+ }
+
+ if ((ACE_OS::gettimeofday () - info.last_ping) < ping_interval_)
+ {
+ if (debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR: <%s> within ping interval. alive=true.\n", info.name.c_str ()));
+ }
+ return 1;
+ }
+
+ // If we don't have enough information to start the server if it isn't already
+ // then we might as well assume it is running. That way the client can get the
+ // status directly from the server.
+ if (info.cmdline.length () == 0 || ! repository_.has_activator (info.activator))
+ {
+ if (debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR: Ping verification skipped. <%s> not startable.\n", info.name.c_str ()));
+ }
+ return 1;
+ }
+
+ connect_server (info);
+
+ if (CORBA::is_nil (info.server.in ()))
+ {
+ if (debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR: <%s> Could not connect. alive=false.\n", info.name.c_str ()));
+ }
+ return 0;
+ }
+
+ ACE_TRY
+ {
+ // Make a copy, in case the info is updated during the ping.
+ ImplementationRepository::ServerObject_var server = info.server;
+
+ // This will timeout if it takes too long
+ server->ping (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR: <%s> Ping successful. alive=true\n", info.name.c_str ()));
+ }
+ info.last_ping = ACE_OS::gettimeofday ();
+ }
+ ACE_CATCH (CORBA::TRANSIENT, ex)
+ {
+ const CORBA::ULong BITS_5_THRU_12_MASK = 0x00000f80;
+ switch (ex.minor () & BITS_5_THRU_12_MASK)
+ {
+ case TAO_INVOCATION_SEND_REQUEST_MINOR_CODE:
+ {
+ if (debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR: <%s> Local TRANSIENT. alive=false.\n", info.name.c_str ()));
+ }
+ }
+ info.last_ping = ACE_Time_Value::zero;
+ return 0;
+ case TAO_POA_DISCARDING:
+ case TAO_POA_HOLDING:
+ {
+ if (debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR: <%s> Remote TRANSIENT. alive=maybe.\n", info.name.c_str ()));
+ }
+ }
+ return -1; // We keep trying to ping, because returning 1 now, would just lead
+ // to clients getting the same exception. If we can't ping after several
+ // attempts, then we'll give up and return 1, letting the client worry about it.
+ default:
+ {
+ if (debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR: <%s> TRANSIENT exception. alive=false.\n", info.name.c_str ()));
+ }
+ info.last_ping = ACE_Time_Value::zero;
+ }
+ return 0;
+ }
+ }
+ ACE_CATCH (CORBA::TIMEOUT, ex)
+ {
+ if (debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ImR: <%s> Ping timed out. alive=true.\n", info.name.c_str ()));
+ }
+ return 1; // This is "alive" as far as we're concerned. Presumably the client
+ // will have a less stringent timeout policy, or will want to know
+ // about the timeout. In any case, we're only guaranteeing that the
+ // server is alive, not that it's responsive.
+ }
+ ACE_CATCHANY
+ {
+ if (debug_ > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ImR: <%s> Unexpected Ping exception. alive=false\n", info.name.c_str ()));
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "\n");
+ }
+ info.last_ping = ACE_Time_Value::zero;
+ return false;
+ }
+ ACE_ENDTRY;
+ return 1;
+}
+
+int
+ImR_Locator_i::debug () const
+{
+ return debug_;
+}
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h
new file mode 100644
index 00000000000..7dd3033bcbc
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h
@@ -0,0 +1,187 @@
+// $Id$
+
+#ifndef IMR_LOCATOR_I_H
+#define IMR_LOCATOR_I_H
+#include /**/ "ace/pre.h"
+
+#include "locator_export.h"
+
+#include "Adapter_Activator.h"
+#include "Forwarder.h"
+#include "Locator_Options.h"
+#include "Locator_Repository.h"
+#include "AsyncStartupWaiter_i.h"
+#include "tao/IORTable/IORTable.h"
+
+#include "orbsvcs/IOR_Multicast.h"
+
+#include "ImR_LocatorS.h"
+#include "AsyncStartupWaiterS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Reactor;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+class INS_Locator;
+
+// Gets a request from a client and depending on the POA name,
+// requests an activator to take care of activating the
+// corresponding server and raises a forward exception to the
+// client pointing to the correct server.
+class Locator_Export ImR_Locator_i
+ : public virtual POA_ImplementationRepository::Locator
+{
+public:
+ ImR_Locator_i();
+
+ ~ImR_Locator_i (void);
+
+ /// Initialize the service, creating its own orb, poa, etc.
+ int init (Options& opts ACE_ENV_ARG_DECL);
+
+ /// Same as above, but use the given orb
+ int init_with_orb (CORBA::ORB_ptr orb, Options& opts ACE_ENV_ARG_DECL);
+
+ /// Cleans up any state created by init*.
+ int fini (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Run using the orb reference created during init()
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Shutdown the orb.
+ void shutdown (bool wait_for_completion ACE_ENV_ARG_DECL);
+
+ int debug() const;
+ // Note : See the IDL for descriptions of the operations.
+
+ // Activator->Locator
+
+ virtual CORBA::Long register_activator (const char* name,
+ ImplementationRepository::Activator_ptr admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void unregister_activator (const char* name,
+ CORBA::Long token ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void notify_child_death (const char* name ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // tao_imr->Locator
+
+ virtual void activate_server (const char * name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ ImplementationRepository::NotFound,
+ ImplementationRepository::CannotActivate));
+ virtual void add_or_update_server (const char * name,
+ const ImplementationRepository::StartupOptions &options ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, ImplementationRepository::NotFound));
+ virtual void remove_server (const char * name ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, ImplementationRepository::NotFound));
+ virtual void shutdown_server (const char * name ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, ImplementationRepository::NotFound));
+ virtual void find (const char * name,
+ ImplementationRepository::ServerInformation_out info ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void list (
+ CORBA::ULong how_many,
+ ImplementationRepository::ServerInformationList_out server_list,
+ ImplementationRepository::ServerInformationIterator_out server_iterator ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void shutdown(CORBA::Boolean activators, CORBA::Boolean servers ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // Server->Locator
+
+ virtual void server_is_running (const char* name,
+ const char* partial_ior,
+ ImplementationRepository::ServerObject_ptr server_object
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, ImplementationRepository::NotFound));
+ virtual void server_is_shutting_down (const char * name ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, ImplementationRepository::NotFound));
+
+ // Used by the INS_Locator to start a sever given an object name
+ char* activate_server_by_object (const char* object_name ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ ImplementationRepository::NotFound,
+ ImplementationRepository::CannotActivate));
+
+ char* activate_server_by_name (const char * name, bool manual_start ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ ImplementationRepository::NotFound,
+ ImplementationRepository::CannotActivate));
+
+private:
+
+ char* activate_server_i (Server_Info& info, bool manual_start ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ ImplementationRepository::NotFound,
+ ImplementationRepository::CannotActivate));
+
+ char* activate_perclient_server_i (Server_Info info, bool manual_start ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ ImplementationRepository::NotFound,
+ ImplementationRepository::CannotActivate));
+
+ ImplementationRepository::StartupInfo*
+ start_server(Server_Info& info, bool manual_start ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ ImplementationRepository::NotFound,
+ ImplementationRepository::CannotActivate));
+
+ bool is_alive(Server_Info& info);
+ int is_alive_i(Server_Info& info);
+
+ // Set up the multicast related if 'm' is passed on the command
+ // line.
+ int setup_multicast (ACE_Reactor *reactor, const char *ior);
+ void teardown_multicast();
+
+ void unregister_activator_i(const char* activator);
+
+ Activator_Info_Ptr get_activator (const ACE_CString& name);
+ void connect_activator (Activator_Info& info);
+
+ void auto_start_servers(ACE_ENV_SINGLE_ARG_DECL);
+
+ CORBA::Object_ptr set_timeout_policy(CORBA::Object_ptr obj, const ACE_Time_Value& to);
+
+ void connect_server(Server_Info& info);
+
+ PortableServer::POA_ptr findPOA(const char* name);
+private:
+
+ // The class that handles the forwarding.
+ ImR_Forwarder forwarder_;
+
+ // Used for the forwarding of any type of POA.
+ ImR_Adapter adapter_;
+
+ /// The locator interface for the IORTable
+ IORTable::Locator_var ins_locator_;
+
+ CORBA::ORB_var orb_;
+ PortableServer::POA_var root_poa_;
+ PortableServer::POA_var imr_poa_;
+
+ int debug_;
+
+ TAO_IOR_Multicast ior_multicast_;
+
+ Locator_Repository repository_;
+
+ AsyncStartupWaiter_i waiter_svt_;
+ ImplementationRepository::AsyncStartupWaiter_var waiter_;
+
+ bool read_only_;
+ ACE_Time_Value startup_timeout_;
+ ACE_Time_Value ping_interval_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* IMR_LOCATOR_I_H */
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc b/TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc
new file mode 100644
index 00000000000..24d5c6e2a0c
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc
@@ -0,0 +1,142 @@
+// $Id$
+
+project(ImR_Activator_IDL) : orbsvcslib, conv_lib, portableserver, imr_client, tao_versioning_idl_defaults {
+ sharedname = TAO_ImR_Activator_IDL
+ dynamicflags = ACTIVATOR_IDL_BUILD_DLL
+ idlflags += -Wb,export_macro=ActivatorIDL_Export -Wb,export_include=activator_idl_export.h
+ idl_files {
+ ImR_Activator.idl
+ }
+ source_files {
+ ImR_ActivatorS.cpp
+ ImR_ActivatorC.cpp
+ }
+ header_files {
+ activator_idl_export.h
+ }
+}
+
+project(ImR_Locator_IDL) : orbsvcslib, conv_lib, valuetype, portableserver, imr_client, messaging, tao_versioning_idl_defaults {
+ sharedname = TAO_ImR_Locator_IDL
+ after += ImR_Activator_IDL
+ libs += TAO_ImR_Activator_IDL
+ // Dont try to build this project if ImR_Activator_IDL is not built
+ requires += corba_messaging
+
+ dynamicflags = LOCATOR_IDL_BUILD_DLL
+ idlflags += -Wb,export_macro=LocatorIDL_Export -Wb,export_include=locator_idl_export.h
+ idl_files {
+ ImR_Locator.idl
+ }
+
+ idl_files {
+ idlflags += -GH
+ AsyncStartupWaiter.idl
+ }
+
+ source_files {
+ ImR_LocatorS.cpp
+ ImR_LocatorC.cpp
+ AsyncStartupWaiterS.cpp
+ AsyncStartupWaiterC.cpp
+ }
+ header_files {
+ locator_idl_export.h
+ }
+}
+
+project(ImR_Activator) : orbsvcslib, conv_lib, acexml, minimum_corba, valuetype, portableserver, imr_client, messaging, pi, codecfactory {
+ sharedname = TAO_ImR_Activator
+ dynamicflags = ACTIVATOR_BUILD_DLL
+ after += ImR_Activator_IDL ImR_Locator_IDL
+ libs += TAO_ImR_Activator_IDL TAO_ImR_Locator_IDL
+ // Dont try to build this project if ImR_Activator_IDL is not built
+ requires += corba_messaging
+
+ Source_Files {
+ ImR_Activator_i.cpp
+ Activator_Options.cpp
+ Activator_Loader.cpp
+ }
+ header_files {
+ activator_export.h
+ }
+ idl_files {
+ }
+}
+
+project(ImR_Locator) : orbsvcslib, conv_lib, minimum_corba, iortable, portableserver, messaging, svc_utils, acexml, imr_client {
+ sharedname = TAO_ImR_Locator
+ dynamicflags = LOCATOR_BUILD_DLL
+ after += ImR_Locator_IDL ImR_Activator_IDL
+ libs += TAO_ImR_Locator_IDL TAO_ImR_Activator_IDL
+ Source_Files {
+ Activator_Info.cpp
+ Adapter_Activator.cpp
+ Forwarder.cpp
+ ImR_Locator_i.cpp
+ AsyncStartupWaiter_i.cpp
+ INS_Locator.cpp
+ Locator_XMLHandler.cpp
+ Locator_Loader.cpp
+ Locator_Options.cpp
+ Iterator.cpp
+ Server_Info.cpp
+ Locator_Repository.cpp
+ }
+ header_files {
+ utils.h
+ locator_export.h
+ }
+ idl_files {
+ }
+}
+
+project(ImR_Locator_Service) : orbsvcsexe, install_bin, minimum_corba, iortable, messaging, acexml ,svc_utils, pi_server, imr_client {
+ exename = ImplRepo_Service
+ after += ImR_Locator ImR_Activator_IDL ImR_Locator_IDL
+ libs += TAO_ImR_Locator TAO_ImR_Activator_IDL TAO_ImR_Locator_IDL
+
+ // Static Debug builds on Windows will not link properly due
+ // to a linker bug. It complains that the ACEXML library duplicates
+ // a couple of template instantiations from the TAO_ImR_Locator library.
+ // The FORCE:MULTIPLE option works around that bug. Unfortunately,
+ // there is no way to narrow the options down to only static debug builds.
+ // Incremental linking has also been turned off since it is
+ // incompatible with this option, producing warnings at link time.
+ specific(em3, nmake, vc6, vc71) {
+ link_options += /FORCE:MULTIPLE /INCREMENTAL:NO
+ }
+
+ Source_Files {
+ ImR_Locator.cpp
+ Locator_NT_Service.cpp
+ }
+ idl_files {
+ }
+}
+
+
+project(ImR_Activator_Service) : orbsvcsexe, install_bin, acexml, minimum_corba, messaging, svc_utils, imr_client {
+ exename = ImR_Activator
+ after += ImR_Activator ImR_Activator_IDL ImR_Locator_IDL
+ libs += TAO_ImR_Activator TAO_ImR_Activator_IDL TAO_ImR_Locator_IDL
+ Source_Files {
+ ImR_Activator.cpp
+ Activator_NT_Service.cpp
+ }
+ idl_files {
+ }
+}
+
+
+project(tao_imr) : orbsvcsexe, install_bin, minimum_corba, portableserver, imr_client {
+ exename = tao_imr
+ install = $(ACE_ROOT)/bin
+ Source_Files {
+ tao_imr.cpp
+ tao_imr_i.cpp
+ }
+ idl_files {
+ }
+}
diff --git a/TAO/orbsvcs/ImplRepo_Service/Iterator.cpp b/TAO/orbsvcs/ImplRepo_Service/Iterator.cpp
new file mode 100644
index 00000000000..1ed369991c2
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Iterator.cpp
@@ -0,0 +1,91 @@
+//=============================================================================
+/**
+ * @file Iterator.cpp
+ *
+ * $Id$
+ *
+ * @brief This file declares ImR's iterator.
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+
+#include "Iterator.h"
+
+ImR_Iterator::ImR_Iterator (CORBA::ULong n, Locator_Repository& repo, PortableServer::POA_ptr poa)
+ : repo_(repo)
+ , count_(n)
+ , poa_(poa)
+{
+}
+
+
+CORBA::Boolean
+ImR_Iterator::next_n (CORBA::ULong how_many,
+ ImplementationRepository::ServerInformationList_out server_list
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_NEW_THROW_EX (server_list,
+ ImplementationRepository::ServerInformationList(0), CORBA::NO_MEMORY());
+
+ Locator_Repository::SIMap::ENTRY* entry = 0;
+ Locator_Repository::SIMap::ITERATOR it (this->repo_.servers ());
+
+ // Number of servers that will go into the server_list.
+ CORBA::ULong n = this->repo_.servers().current_size();
+ if (n <= this->count_)
+ {
+ return 0; // We already finished.
+ }
+ else
+ {
+ n -= this->count_;
+ }
+
+ if (how_many > 0 && n > how_many)
+ {
+ n = how_many;
+ }
+
+ server_list->length (n);
+
+ CORBA::ULong i = 0;
+ for (; i < this->count_; ++i)
+ {
+ it.advance ();
+ }
+
+ for (i = 0; i < n; ++i)
+ {
+ it.next (entry);
+ it.advance ();
+ ACE_ASSERT(entry != 0);
+
+ Server_Info_Ptr info = entry->int_id_;
+
+ server_list[i].server = info->name.c_str ();
+ server_list[i].startup.command_line = info->cmdline.c_str ();
+ server_list[i].startup.environment = info->env_vars;
+ server_list[i].startup.working_directory = info->dir.c_str ();
+ server_list[i].startup.activation = info->activation_mode;
+ server_list[i].startup.activator = info->activator.c_str ();
+ server_list[i].startup.start_limit = info->start_limit;
+ server_list[i].partial_ior = info->partial_ior.c_str ();
+ }
+
+ this->count_ += n;
+
+ return 1;
+}
+
+
+void
+ImR_Iterator::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableServer::ObjectId_var oid = poa_->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ poa_->deactivate_object (oid.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/ImplRepo_Service/Iterator.h b/TAO/orbsvcs/ImplRepo_Service/Iterator.h
new file mode 100644
index 00000000000..d592146fbb7
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Iterator.h
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file Iterator.h
+ *
+ * $Id$
+ *
+ * @brief This file declares ImR's iterator.
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef IMR_ITERATOR_H
+#define IMR_ITERATOR_H
+
+#include "Locator_Repository.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/ImR_Client/ImplRepoS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class ImR_Iterator
+ *
+ * @brief The Iterator for servers in the ImR.
+ *
+ */
+class ImR_Iterator
+ : public POA_ImplementationRepository::ServerInformationIterator
+{
+public:
+ ImR_Iterator (CORBA::ULong n, Locator_Repository& repo, PortableServer::POA_ptr poa);
+
+ /// Returns the next list of up to <how_many> servers. If empty, will return
+ /// false.
+ virtual CORBA::Boolean next_n (
+ CORBA::ULong how_many,
+ ImplementationRepository::ServerInformationList_out server_list
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ Locator_Repository& repo_;
+ CORBA::ULong count_;
+ PortableServer::POA_ptr poa_;
+};
+
+#endif /* IMR_ITERATOR_H */
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Loader.cpp b/TAO/orbsvcs/ImplRepo_Service/Locator_Loader.cpp
new file mode 100644
index 00000000000..be8dd5e0e1f
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Loader.cpp
@@ -0,0 +1,105 @@
+// $Id$
+
+#include "Locator_Loader.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/Task.h"
+
+class ImR_Locator_ORB_Runner : public ACE_Task_Base
+{
+public:
+ ImR_Locator_ORB_Runner (ImR_Locator_Loader& service)
+ : service_ (service)
+ {
+ }
+ virtual int svc ()
+ {
+ // Block until service_.fini () calls orb->destroy ()
+ this->service_.run ();
+ return 0;
+ }
+private:
+ ImR_Locator_Loader& service_;
+};
+
+ImR_Locator_Loader::ImR_Locator_Loader()
+{
+}
+
+int
+ImR_Locator_Loader::init (int argc, ACE_TCHAR *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int err = this->opts_.init (argc, argv);
+ if (err != 0)
+ return -1;
+
+ err = this->service_.init (this->opts_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (err != 0)
+ return -1;
+
+ // Create a thread in which to run the service
+ ACE_ASSERT(this->runner_.get () == 0);
+ this->runner_.reset(new ImR_Locator_ORB_Runner (*this));
+ this->runner_->activate ();
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+ImR_Locator_Loader::fini (void)
+{
+ ACE_ASSERT(this->runner_.get () != 0);
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int ret = this->service_.fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->runner_->wait ();
+ this->runner_.reset (0);
+ return ret;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+ return -1;
+}
+
+CORBA::Object_ptr
+ImR_Locator_Loader::create_object (CORBA::ORB_ptr,
+ int,
+ ACE_TCHAR**
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT(), CORBA::Object::_nil ());
+}
+
+int
+ImR_Locator_Loader::run(void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ return this->service_.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL
+ {
+ ACE_ERROR((LM_ERROR, "Exception in ImR_Locator_ORB_Runner ()\n"));
+ return -1;
+ }
+ ACE_ENDTRY;
+}
+
+
+ACE_FACTORY_DEFINE (Locator, ImR_Locator_Loader)
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Loader.h b/TAO/orbsvcs/ImplRepo_Service/Locator_Loader.h
new file mode 100644
index 00000000000..ca90c61c6fb
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Loader.h
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef TAO_IMR_LOCATOR_LOADER_H
+#define TAO_IMR_LOCATOR_LOADER_H
+
+#include "ImR_Locator_i.h"
+
+#include "tao/Object_Loader.h"
+
+#include "ace/Auto_Ptr.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class ImR_Locator_ORB_Runner;
+
+class Locator_Export ImR_Locator_Loader : public TAO_Object_Loader
+{
+public:
+ ImR_Locator_Loader();
+
+ virtual int init (int argc, ACE_TCHAR *argv[]);
+
+ virtual int fini (void);
+
+ virtual CORBA::Object_ptr create_object (CORBA::ORB_ptr orb,
+ int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // Unlike other service objects, we have our own orb.
+ int run(void);
+
+private:
+ ImR_Locator_i service_;
+ Options opts_;
+ ACE_Auto_Ptr<ImR_Locator_ORB_Runner> runner_;
+private:
+ // Disallow copying and assignment.
+ ImR_Locator_Loader (const ImR_Locator_Loader &);
+ ImR_Locator_Loader &operator = (const ImR_Locator_Loader &);
+};
+
+ACE_FACTORY_DECLARE (Locator, ImR_Locator_Loader)
+
+#endif
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_NT_Service.cpp b/TAO/orbsvcs/ImplRepo_Service/Locator_NT_Service.cpp
new file mode 100644
index 00000000000..e13a4f8080f
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_NT_Service.cpp
@@ -0,0 +1,116 @@
+//=============================================================================
+/**
+ * @file Locator_NT_Service.cpp
+ *
+ * $Id$
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ * @author Jeff Parsons <parsons@cs.wustl.edu>
+ * @author John Tucker <jtucker@infoglide.com>
+ * @author Mike Vitalo <mvitalo@infoglide.com>
+ */
+//=============================================================================
+
+#include "Locator_NT_Service.h"
+
+#if defined (ACE_WIN32)
+
+#include "ImR_Locator_i.h"
+#include "Locator_Options.h"
+
+#include "tao/ORB_Core.h"
+#include "tao/corba.h"
+#include "ace/Reactor.h"
+
+/**
+ * Handles the SERVICE_CONTROL_SHUTDOWN and SERVICE_CONTROL_STOP commands
+ * by shutting down the ORB. Otherwise ACE_NT_Service::handle_control
+ * handles the command.
+ */
+void
+Locator_NT_Service::handle_control (DWORD control_code)
+{
+ if (control_code == SERVICE_CONTROL_SHUTDOWN
+ || control_code == SERVICE_CONTROL_STOP)
+ {
+ report_status (SERVICE_STOP_PENDING);
+ TAO_ORB_Core_instance ()->reactor ()->end_reactor_event_loop ();
+ TAO_ORB_Core_instance ()->orb ()->shutdown (1);
+ }
+ else
+ {
+ ACE_NT_Service::handle_control (control_code);
+ }
+}
+
+
+/**
+ */
+int
+Locator_NT_Service::handle_exception (ACE_HANDLE)
+{
+ return 0;
+}
+
+
+/**
+ * We do almost the same thing as we do in run_standalone ()
+ */
+int
+Locator_NT_Service::svc (void)
+{
+ ImR_Locator_i server;
+ Options opts;
+
+ if (opts.init_from_registry () != 0)
+ {
+ report_status (SERVICE_STOPPED);
+ return -1;
+ }
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int status = server.init (opts ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == -1)
+ {
+ report_status (SERVICE_STOPPED);
+ return -1;
+ }
+ else
+ {
+ report_status (SERVICE_RUNNING);
+ server.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ status = server.fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ report_status (SERVICE_STOPPED);
+
+ }
+ if (status != -1)
+ return 0;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_PRINT_EXCEPTION (sysex, IMR_LOCATOR_DISPLAY_NAME);
+ }
+ ACE_CATCH (CORBA::UserException, userex)
+ {
+ ACE_PRINT_EXCEPTION (userex, IMR_LOCATOR_DISPLAY_NAME);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, IMR_LOCATOR_DISPLAY_NAME);
+ }
+ ACE_ENDTRY;
+
+ report_status (SERVICE_STOPPED);
+
+ return -1;
+}
+
+#endif /* ACE_WIN32 */
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_NT_Service.h b/TAO/orbsvcs/ImplRepo_Service/Locator_NT_Service.h
new file mode 100644
index 00000000000..c2199926f63
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_NT_Service.h
@@ -0,0 +1,62 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Locator_NT_Service.h
+ *
+ * $Id$
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ * @author Jeff Parsons <parsons@cs.wustl.edu>
+ * @author John Tucker <jtucker@infoglide.com>
+ * @author Mike Vitalo <mvitalo@infoglide.com>
+ */
+//=============================================================================
+
+#ifndef Locator_NT_Service_H
+#define Locator_NT_Service_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_WIN32)
+
+#include "ace/NT_Service.h"
+#include "ace/Singleton.h"
+#include "ace/Synch.h"
+#include "tao/orbconf.h"
+
+static const char * IMR_LOCATOR_SERVICE_NAME = "TAOImR";
+static const char * IMR_LOCATOR_DISPLAY_NAME = "TAO Implementation Repository";
+static const char * IMR_LOCATOR_DESCRIPTION = "Implementation Repository Locator service for TAO";
+
+/**
+ * @class Locator_NT_Service
+ *
+ * @brief Allows the Implementation Repository to act as a Windows NT Service.
+ */
+class Locator_NT_Service : public ACE_NT_Service
+{
+public:
+ typedef TAO_SYNCH_RECURSIVE_MUTEX MUTEX;
+
+ /// We override <handle_control> because it handles stop requests
+ /// privately.
+ virtual void handle_control (DWORD control_code);
+
+ /// We override <handle_exception> so a 'stop' control code can wake
+ /// the reactor off of its wait.
+ virtual int handle_exception (ACE_HANDLE h);
+
+ /// This is a virtual method inherited from ACE_NT_Service.
+ virtual int svc (void);
+
+private:
+ friend class ACE_Singleton<Locator_NT_Service, MUTEX>;
+};
+
+typedef ACE_Singleton<Locator_NT_Service, ACE_Mutex> SERVICE;
+
+#endif /* ACE_WIN32 */
+
+#endif /* Locator_NT_Service_H */
+
+
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Options.cpp b/TAO/orbsvcs/ImplRepo_Service/Locator_Options.cpp
new file mode 100644
index 00000000000..810649d2bb5
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Options.cpp
@@ -0,0 +1,505 @@
+//=============================================================================
+/**
+ * @file Locator_Options.cpp
+ *
+ * $Id$
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+
+#include "Locator_Options.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_strings.h"
+
+ACE_RCSID (ImplRepo_Service,
+ Options,
+ "$Id$")
+
+
+#if defined (ACE_WIN32)
+static const HKEY SERVICE_REG_ROOT = HKEY_LOCAL_MACHINE;
+// This string must agree with the one used in Locator_NT_Service.h
+static const ACE_TCHAR *SERVICE_REG_PATH =
+ ACE_TEXT ("SYSTEM\\CurrentControlSet\\Services\\TAOImR\\Parameters");
+#endif /* ACE_WIN32 */
+
+static const int DEFAULT_PING_INTERVAL = 10; // seconds
+static const int DEFAULT_START_TIMEOUT = 60; // seconds
+
+Options::Options ()
+: repo_mode_ (REPO_NONE)
+, erase_repo_ (false)
+, debug_ (1)
+, multicast_ (false)
+, service_ (false)
+, ping_interval_(DEFAULT_PING_INTERVAL)
+, startup_timeout_(DEFAULT_START_TIMEOUT)
+, readonly_ (false)
+, service_command_(SC_NONE)
+{
+}
+
+int
+Options::parse_args (int &argc, char *argv[])
+{
+ ACE_Arg_Shifter shifter (argc, argv);
+
+ while (shifter.is_anything_left ())
+ {
+ if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-c")) == 0)
+ {
+ shifter.consume_arg ();
+
+ if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
+ {
+ ACE_ERROR ((LM_ERROR, "Error: -c option needs a command\n"));
+ this->print_usage ();
+ return -1;
+ }
+
+ if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("install")) == 0)
+ {
+ this->service_command_ = SC_INSTALL;
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("remove")) == 0)
+ {
+ this->service_command_ = SC_REMOVE;
+ }
+ else
+ {
+ ACE_ERROR((LM_ERROR, "Error: Unknown service command : %s\n", shifter.get_current()));
+ this->print_usage ();
+ return -1;
+ }
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-d")) == 0)
+ {
+ shifter.consume_arg ();
+
+ if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
+ {
+ ACE_ERROR ((LM_ERROR, "Error: -d option needs a debuglevel\n"));
+ this->print_usage ();
+ return -1;
+ }
+
+ this->debug_ = ACE_OS::atoi (shifter.get_current ());
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-m")) == 0)
+ {
+ this->multicast_ = true;
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-o")) == 0)
+ {
+ shifter.consume_arg ();
+
+ if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
+ {
+ ACE_ERROR ((LM_ERROR, "Error: -o option needs a filename\n"));
+ this->print_usage ();
+ return -1;
+ }
+ this->ior_output_file_ = shifter.get_current();
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-s")) == 0)
+ {
+ // Run as a service
+ this->service_ = true;
+ }
+ else if ((ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-?")) == 0)
+ || (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-h")) == 0))
+ {
+ this->print_usage ();
+ return 1;
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-l")) == 0)
+ {
+ this->readonly_ = true;
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-p")) == 0)
+ {
+ shifter.consume_arg ();
+
+ if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
+ {
+ ACE_ERROR ((LM_ERROR, "Error: -p option needs a filename\n"));
+ this->print_usage ();
+ return -1;
+ }
+
+ this->persist_file_name_ = shifter.get_current ();
+ this->repo_mode_ = REPO_HEAP_FILE;
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-r")) == 0)
+ {
+ this->repo_mode_ = REPO_REGISTRY;
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-x")) == 0)
+ {
+ shifter.consume_arg ();
+
+ if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
+ {
+ ACE_ERROR ((LM_ERROR, "Error: -x option needs a filename\n"));
+ this->print_usage ();
+ return -1;
+ }
+
+ this->persist_file_name_ = shifter.get_current ();
+ this->repo_mode_ = REPO_XML_FILE;
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-e")) == 0)
+ {
+ this->erase_repo_ = true;
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-t")) == 0)
+ {
+ shifter.consume_arg ();
+
+ if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
+ {
+ ACE_ERROR ((LM_ERROR, "Error: -t option needs a value\n"));
+ this->print_usage ();
+ return -1;
+ }
+ this->startup_timeout_ =
+ ACE_Time_Value (ACE_OS::atoi (shifter.get_current ()));
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-v")) == 0)
+ {
+ shifter.consume_arg ();
+
+ if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
+ {
+ ACE_ERROR ((LM_ERROR, "Error: -v option needs a value\n"));
+ this->print_usage ();
+ return -1;
+ }
+ this->ping_interval_ =
+ ACE_Time_Value (0, 1000 * ACE_OS::atoi (shifter.get_current ()));
+ }
+ else
+ {
+ shifter.ignore_arg ();
+ continue;
+ }
+
+ shifter.consume_arg ();
+ }
+
+ return 0;
+}
+
+int
+Options::init (int argc, char *argv[])
+{
+ // Make an initial pass through and grab the arguments that we recognize.
+ // This may also run the commands to install or remove the nt service.
+ int result = this->parse_args (argc, argv);
+ if (result != 0)
+ {
+ return result;
+ }
+
+ for (int i = 0; i < argc; ++i)
+ {
+ this->cmdline_ += ACE_CString (argv[i]) + ACE_CString (" ");
+ }
+ return 0;
+}
+
+int
+Options::init_from_registry (void)
+{
+ this->load_registry_options ();
+ return 0;
+}
+
+
+void
+Options::print_usage (void) const
+{
+ ACE_ERROR ((LM_ERROR,
+ "Usage:\n"
+ "\n"
+ "ImR_Locator [-c cmd] [-d 0|1|2] [-m] [-o file]\n"
+ " [-r|-p file|-x file] [-s] [-t secs] [-v secs]\n"
+ " -c command Runs nt service commands ('install' or 'remove')\n"
+ " -d level Sets the debug level (default 1)\n"
+ " -l Lock the database\n"
+ " -m Turn on multicast\n"
+ " -o file Outputs the ImR's IOR to a file\n"
+ " -p file Use file for storing/loading settings\n"
+ " -x file Use XML file for storing/loading setting\n"
+ " -r Use the registry for storing/loading settings\n"
+ " -t secs Server startup timeout.(Default=60s)\n"
+ " -v msecs Server verification interval.(Default=10s)\n"
+ ));
+}
+
+int
+Options::save_registry_options ()
+{
+#if defined (ACE_WIN32)
+ HKEY key = 0;
+ // Create or open the parameters key
+ LONG err = ACE_TEXT_RegCreateKeyEx (SERVICE_REG_ROOT,
+ SERVICE_REG_PATH,
+ 0,
+ "", // class
+ REG_OPTION_NON_VOLATILE,
+ KEY_ALL_ACCESS,
+ NULL,
+ &key,
+ NULL
+ );
+ if (err != ERROR_SUCCESS)
+ {
+ return -1;
+ }
+ err = ACE_TEXT_RegSetValueEx (key, "ORBInitOptions", 0, REG_SZ,
+ (LPBYTE) this->cmdline_.c_str (), this->cmdline_.length () + 1);
+ ACE_ASSERT (err == ERROR_SUCCESS);
+
+ err = ACE_TEXT_RegSetValueEx (key, "IORFile", 0, REG_SZ,
+ (LPBYTE) ior_output_file_.c_str (), ior_output_file_.length () + 1);
+ ACE_ASSERT (err == ERROR_SUCCESS);
+
+ err = ACE_TEXT_RegSetValueEx (key, "DebugLevel", 0, REG_DWORD,
+ (LPBYTE) &debug_ , sizeof (debug_));
+ ACE_ASSERT(err == ERROR_SUCCESS);
+
+ err = ACE_TEXT_RegSetValueEx (key, "PersistFile", 0, REG_SZ,
+ (LPBYTE) this->persist_file_name_.c_str (), this->persist_file_name_.length () + 1);
+ ACE_ASSERT (err == ERROR_SUCCESS);
+
+ DWORD tmp = this->ping_interval_.msec ();
+ err = ACE_TEXT_RegSetValueEx (key, "PingInterval", 0, REG_DWORD,
+ (LPBYTE) &tmp, sizeof (DWORD));
+ ACE_ASSERT (err == ERROR_SUCCESS);
+
+ tmp = this->readonly_ ? 1 : 0;
+ err = ACE_TEXT_RegSetValueEx (key, "Lock", 0, REG_DWORD,
+ (LPBYTE) &tmp, sizeof (DWORD));
+ ACE_ASSERT (err == ERROR_SUCCESS);
+
+ tmp = this->repo_mode_;
+ err = ACE_TEXT_RegSetValueEx (key, "PersistType", 0, REG_DWORD,
+ (LPBYTE) &tmp, sizeof (DWORD));
+ ACE_ASSERT (err == ERROR_SUCCESS);
+
+ tmp = this->startup_timeout_.sec();
+ err = ACE_TEXT_RegSetValueEx (key, "Timeout", 0, REG_DWORD,
+ (LPBYTE) &tmp, sizeof (DWORD));
+ ACE_ASSERT (err == ERROR_SUCCESS);
+
+ tmp = multicast_ ? 1 : 0;
+ err = ACE_TEXT_RegSetValueEx (key, "Multicast", 0, REG_DWORD,
+ (LPBYTE) &tmp, sizeof (DWORD));
+ ACE_ASSERT (err == ERROR_SUCCESS);
+
+ err = ::RegCloseKey (key);
+ ACE_ASSERT (err == ERROR_SUCCESS);
+#endif
+ return 0;
+}
+
+int
+Options::load_registry_options ()
+{
+#if defined (ACE_WIN32)
+ HKEY key = 0;
+ // Create or open the parameters key
+ LONG err = ACE_TEXT_RegOpenKeyEx (SERVICE_REG_ROOT,
+ SERVICE_REG_PATH,
+ 0,
+ KEY_READ,
+ &key
+ );
+ if (err != ERROR_SUCCESS)
+ {
+ // If there aren't any saved parameters, then that's ok.
+ return 0;
+ }
+ ACE_TCHAR tmpstr[4096];
+ DWORD sz = sizeof (tmpstr);
+ DWORD type = 0;
+ err = ACE_TEXT_RegQueryValueEx (key, "ORBInitOptions", 0, &type,
+ (LPBYTE) tmpstr, &sz);
+ if (err == ERROR_SUCCESS)
+ {
+ ACE_ASSERT (type == REG_SZ);
+ tmpstr[sz - 1] = '\0';
+ this->cmdline_ = tmpstr;
+ }
+
+ sz = sizeof(tmpstr);
+ err = ACE_TEXT_RegQueryValueEx (key, "IORFile", 0, &type,
+ (LPBYTE) tmpstr, &sz);
+ if (err == ERROR_SUCCESS)
+ {
+ ACE_ASSERT (type == REG_SZ);
+ tmpstr[sz - 1] = '\0';
+ this->ior_output_file_ = tmpstr;
+ }
+
+ sz = sizeof(debug_);
+ err = ACE_TEXT_RegQueryValueEx (key, "DebugLevel", 0, &type,
+ (LPBYTE) &this->debug_ , &sz);
+ if (err == ERROR_SUCCESS)
+ {
+ ACE_ASSERT (type == REG_DWORD);
+ }
+
+ DWORD tmp = 0;
+ sz = sizeof(tmp);
+ err = ACE_TEXT_RegQueryValueEx (key, "PingInterval", 0, &type,
+ (LPBYTE) &tmp, &sz);
+ if (err == ERROR_SUCCESS)
+ {
+ ACE_ASSERT (type == REG_DWORD);
+ ping_interval_.msec (tmp);
+ }
+
+ tmp = 0;
+ sz = sizeof(tmp);
+ err = ACE_TEXT_RegQueryValueEx (key, "Lock", 0, &type,
+ (LPBYTE) &tmp, &sz);
+ if (err == ERROR_SUCCESS)
+ {
+ ACE_ASSERT (type == REG_DWORD);
+ readonly_ = tmp != 0;
+ }
+
+ sz = sizeof(this->repo_mode_);
+ err = ACE_TEXT_RegQueryValueEx (key, "PersistType", 0, &type,
+ (LPBYTE) &this->repo_mode_, &sz);
+ if (err == ERROR_SUCCESS)
+ {
+ ACE_ASSERT (type == REG_DWORD);
+ }
+
+ tmp = 0;
+ sz = sizeof(tmp);
+ err = ACE_TEXT_RegQueryValueEx (key, "Timeout", 0, &type,
+ (LPBYTE) &tmp, &sz);
+ if (err == ERROR_SUCCESS)
+ {
+ ACE_ASSERT (type == REG_DWORD);
+ this->startup_timeout_.sec (tmp);
+ }
+
+ tmp = 0;
+ sz = sizeof(tmp);
+ err = ACE_TEXT_RegQueryValueEx (key, "Multicast", 0, &type,
+ (LPBYTE) &tmp, &sz);
+ if (err == ERROR_SUCCESS)
+ {
+ ACE_ASSERT (type == REG_DWORD);
+ this->multicast_ = tmp != 0;
+ }
+
+ sz = sizeof(tmpstr);
+ err = ACE_TEXT_RegQueryValueEx (key, "PersistFile", 0, &type,
+ (LPBYTE) tmpstr, &sz);
+ if (err == ERROR_SUCCESS)
+ {
+ ACE_ASSERT (type == REG_SZ);
+ tmpstr[sz - 1] = '\0';
+ this->persist_file_name_ = tmpstr;
+ }
+
+ err = ::RegCloseKey (key);
+ ACE_ASSERT (err == ERROR_SUCCESS);
+#endif
+ return 0;
+}
+
+bool
+Options::service (void) const
+{
+ return this->service_;
+}
+
+unsigned int
+Options::debug (void) const
+{
+ return this->debug_;
+}
+
+const ACE_CString&
+Options::ior_filename (void) const
+{
+ return this->ior_output_file_;
+}
+
+bool
+Options::multicast (void) const
+{
+ return this->multicast_;
+}
+
+Options::SERVICE_COMMAND
+Options::service_command(void) const
+{
+ return this->service_command_;
+}
+
+const char*
+Options::cmdline(void) const {
+ return this->cmdline_.c_str ();
+}
+
+const ACE_CString&
+Options::persist_file_name(void) const {
+ return this->persist_file_name_;
+}
+
+ACE_Time_Value
+Options::startup_timeout (void) const
+{
+ return this->startup_timeout_;
+}
+
+ACE_Time_Value
+Options::ping_interval (void) const
+{
+ return this->ping_interval_;
+}
+
+Options::RepoMode
+Options::repository_mode (void) const
+{
+ return this->repo_mode_;
+}
+
+bool
+Options::repository_erase (void) const
+{
+ return this->erase_repo_;
+}
+
+bool
+Options::readonly (void) const
+{
+ return this->readonly_;
+}
+
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Options.h b/TAO/orbsvcs/ImplRepo_Service/Locator_Options.h
new file mode 100644
index 00000000000..4d7019bccf3
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Options.h
@@ -0,0 +1,147 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Locator_Options.h
+ *
+ * $Id$
+ *
+ * @brief Definition of the Options class for the Implementation Repository.
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef LOCATOR_OPTIONS_H
+#define LOCATOR_OPTIONS_H
+
+#include "locator_export.h"
+
+#include "ace/SString.h"
+#include "ace/Time_Value.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Options
+ *
+ * @brief Maintains the global options.
+ *
+ * This is where the settings for TAO's Implementation Repository are stored.
+ */
+class Locator_Export Options
+{
+public:
+
+ enum SERVICE_COMMAND {
+ SC_NONE,
+ SC_INSTALL,
+ SC_REMOVE
+ };
+
+ enum RepoMode {
+ REPO_NONE,
+ REPO_XML_FILE,
+ REPO_HEAP_FILE,
+ REPO_REGISTRY
+ };
+
+ Options ();
+
+ /// Parse the command-line arguments and initialize the options.
+ int init (int argc, char *argv[]);
+ /// This version should only be used when run as an nt service.
+ int init_from_registry();
+
+ /// Service Mode
+ bool service (void) const;
+
+ /// Debug level for the Implementation Repository.
+ unsigned int debug (void) const;
+
+ /// Returns the file where the IOR should be stored.
+ const ACE_TString& ior_filename (void) const;
+
+ /// Will we listen for multicast location requests?
+ bool multicast (void) const;
+
+ /// The nt service command to run (install/remove)
+ SERVICE_COMMAND service_command(void) const;
+
+ int save_registry_options();
+
+ const char* cmdline(void) const;
+
+ /// File that contains the activator related information
+ /// that the persistent locator has to save.
+ const ACE_TString& persist_file_name(void) const;
+
+ /// Do we allow modifications to the servers?
+ bool readonly (void) const;
+
+ RepoMode repository_mode (void) const;
+
+ /// Do we wish to clear out the repository
+ bool repository_erase (void) const;
+
+ /// Returns the timeout value for program starting.
+ ACE_Time_Value startup_timeout (void) const;
+
+ /// If the server hasn't been verified for a while, then we'll
+ /// ping it. Note : No timers are currently used. We simply ping()
+ /// during indirect invocations, if this interval has elapsed.
+ ACE_Time_Value ping_interval (void) const;
+
+private:
+ /// Parses and pulls out arguments for the ImR
+ int parse_args (int &argc, char *argv[]);
+
+ /// Print the usage information.
+ void print_usage (void) const;
+
+ /// Run a service command.
+ int run_service_command (const ACE_TString& cmdline);
+
+ int load_registry_options();
+private:
+
+ // xml, heap, or registry
+ RepoMode repo_mode_;
+
+ // do we clear out the repository on load
+ bool erase_repo_;
+
+ /// Debug level.
+ unsigned int debug_;
+
+ /// File where the IOR of the server object is stored.
+ ACE_TString ior_output_file_;
+
+ /// Will we listen for multicast location requests?
+ bool multicast_;
+
+ /// Are we running as a service?
+ bool service_;
+
+ /// The amount of time between successive "are you started yet?" pings.
+ ACE_Time_Value ping_interval_;
+
+ /// The amount of time to wait for a server to response after starting it.
+ ACE_Time_Value startup_timeout_;
+
+ /// Can the server_repository be modified?
+ bool readonly_;
+
+ /// SC_NONE, SC_INSTALL, SC_REMOVE, ...
+ SERVICE_COMMAND service_command_;
+
+ /// Our extra command line arguments
+ ACE_CString cmdline_;
+
+ /// The persistent XML file name.
+ ACE_TString persist_file_name_;
+};
+
+#endif
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp
new file mode 100644
index 00000000000..ed44f22f9ad
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp
@@ -0,0 +1,574 @@
+#include "Locator_Repository.h"
+#include "Locator_XMLHandler.h"
+#include "utils.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_ctype.h"
+#include "ace/OS_NS_unistd.h"
+
+#include "ACEXML/parser/parser/Parser.h"
+#include "ACEXML/common/FileCharStream.h"
+#include "ACEXML/common/XML_Util.h"
+
+ACE_RCSID (ImplRepo_Service, Locator_Repository, "$Id$")
+
+static const char* STARTUP_COMMAND = "StartupCommand";
+static const char* WORKING_DIR = "WorkingDir";
+static const char* ENVIRONMENT = "Environment";
+static const char* ACTIVATION = "Activation";
+static const char* PARTIAL_IOR = "Location";
+static const char* IOR = "IOR";
+static const char* START_LIMIT = "StartLimit";
+static const char* ACTIVATOR = "Activator";
+static const char* SERVERS_ROOT_KEY = "Servers";
+static const char* ACTIVATORS_ROOT_KEY = "Activators";
+static const char* TOKEN = "Token";
+
+#if defined (ACE_WIN32)
+static const char* WIN32_REG_KEY = "Software\\TAO\\ImplementationRepository";
+#endif
+
+static ACE_CString lcase (const ACE_CString& s)
+{
+ ACE_CString ret(s);
+ for (size_t i = 0; i < ret.length (); ++i)
+ {
+ ret[i] = static_cast<char>(ACE_OS::ace_tolower (s[i]));
+ }
+ return ret;
+}
+
+static void loadActivatorsAsBinary (ACE_Configuration& config, Locator_Repository::AIMap& map)
+{
+ ACE_Configuration_Section_Key root;
+ int err = config.open_section (config.root_section (), ACTIVATORS_ROOT_KEY, 0, root);
+ if (err == 0)
+ {
+ int index = 0;
+ ACE_CString name;
+ while (config.enumerate_sections (root, index, name) == 0)
+ {
+ ACE_CString ior;
+ u_int token;
+
+ ACE_Configuration_Section_Key key;
+
+ // Can't fail, because we're enumerating
+ config.open_section (root, name.c_str(), 0, key);
+
+ config.get_string_value (key, IOR, ior);
+ config.get_integer_value (key, TOKEN, token);
+
+ Activator_Info_Ptr info (new Activator_Info (name, token, ior));
+ map.bind (lcase (name), info);
+ index++;
+ }
+ }
+}
+
+static void loadServersAsBinary(ACE_Configuration& config, Locator_Repository::SIMap& map)
+{
+ ACE_Configuration_Section_Key root;
+ int err = config.open_section (config.root_section (), SERVERS_ROOT_KEY, 0, root);
+ if (err == 0)
+ {
+ int index = 0;
+ ACE_CString name;
+ while (config.enumerate_sections (root, index, name) == 0)
+ {
+ ACE_CString cmdline, dir, envstr, partial_ior, ior, aname;
+ u_int amodeint = ImplementationRepository::MANUAL;
+ u_int start_limit;
+
+ ACE_Configuration_Section_Key key;
+
+ // Can't fail, because we're enumerating
+ config.open_section (root, name.c_str (), 0, key);
+
+ // Ignore any missing values. Server name is enough on its own.
+ config.get_string_value (key, ACTIVATOR, aname);
+ config.get_string_value (key, STARTUP_COMMAND, cmdline);
+ config.get_string_value (key, WORKING_DIR, dir);
+ config.get_string_value (key, ENVIRONMENT, envstr);
+ config.get_integer_value(key, ACTIVATION, amodeint);
+ config.get_string_value (key, PARTIAL_IOR, partial_ior);
+ config.get_string_value (key, IOR, ior);
+ config.get_integer_value(key, START_LIMIT, start_limit);
+
+ ImplementationRepository::ActivationMode amode =
+ static_cast <ImplementationRepository::ActivationMode> (amodeint);
+
+ ImplementationRepository::EnvironmentList env_vars =
+ ImR_Utils::parseEnvList (envstr);
+
+ Server_Info_Ptr info (new Server_Info(name, aname, cmdline,
+ env_vars, dir, amode, start_limit, partial_ior, ior));
+ map.bind (name, info);
+ index++;
+ }
+ }
+}
+
+static void loadAsBinary (ACE_Configuration& config, Locator_Repository& repo)
+{
+ loadServersAsBinary (config, repo.servers ());
+ loadActivatorsAsBinary (config, repo.activators ());
+}
+
+// Note : There is no saveAsBinary(), because the ACE_Configuration class
+// supports saving of individual entries.
+
+static void convertEnvList (const Locator_XMLHandler::EnvList& in, ImplementationRepository::EnvironmentList& out)
+{
+ CORBA::ULong sz = in.size ();
+ out.length (sz);
+ for (CORBA::ULong i = 0; i < sz; ++i)
+ {
+ out[i].name = in[i].name.c_str ();
+ out[i].value = in[i].value.c_str ();
+ }
+}
+
+class Server_Repo_XML_Callback : public Locator_XMLHandler::Callback
+{
+public:
+ Server_Repo_XML_Callback(Locator_Repository& repo)
+ : repo_ (repo)
+ {
+ }
+ virtual void next_server (const ACE_CString& name,
+ const ACE_CString& aname, const ACE_CString& cmdline,
+ const Locator_XMLHandler::EnvList& envlst, const ACE_CString& dir,
+ const ACE_CString& amodestr, int start_limit,
+ const ACE_CString& partial_ior, const ACE_CString& ior)
+ {
+ ImplementationRepository::ActivationMode amode =
+ ImR_Utils::parseActivationMode (amodestr);
+
+ ImplementationRepository::EnvironmentList env_vars;
+ convertEnvList (envlst, env_vars);
+
+ int limit = start_limit < 1 ? 1 : start_limit;
+
+ Server_Info_Ptr si (new Server_Info (name, aname, cmdline,
+ env_vars, dir, amode, limit, partial_ior, ior));
+
+ this->repo_.servers ().bind (name, si);
+ }
+ virtual void next_activator (const ACE_CString& aname,
+ long token,
+ const ACE_CString& ior)
+ {
+ Activator_Info_Ptr si (new Activator_Info (aname, token, ior));
+ this->repo_.activators ().bind (lcase (aname), si);
+ }
+private:
+ Locator_Repository& repo_;
+};
+
+static int loadAsXML (const ACE_CString& fname, Locator_Repository& repo)
+{
+ ACEXML_FileCharStream* fstm = new ACEXML_FileCharStream; // xml input source will take ownership
+
+ if (fstm->open (fname.c_str()) != 0)
+ {
+ // This is not a real error. The xml file may not exist yet.
+ delete fstm;
+ return 0;
+ }
+
+ Server_Repo_XML_Callback cb (repo);
+
+ Locator_XMLHandler handler (cb);
+
+ ACEXML_Parser parser;
+
+ // InputSource takes ownership
+ ACEXML_InputSource input (fstm);
+
+ parser.setContentHandler (&handler);
+ parser.setDTDHandler (&handler);
+ parser.setErrorHandler (&handler);
+ parser.setEntityResolver (&handler);
+
+ ACEXML_TRY_NEW_ENV
+ {
+ parser.parse (&input ACEXML_ENV_ARG_PARAMETER);
+ ACEXML_TRY_CHECK;
+ }
+ ACEXML_CATCH (ACEXML_Exception, ex)
+ {
+ ACE_ERROR ((LM_ERROR, "Error during load of ImR persistence xml file."));
+ ex.print ();
+ return -1;
+ }
+ ACEXML_ENDTRY;
+ return 0;
+}
+
+// Note : Would pass servers by const&, but ACE hash map const_iterator is broken.
+static void saveAsXML (const ACE_CString& fname, Locator_Repository& repo)
+{
+ FILE* fp = ACE_OS::fopen (fname.c_str (), "w");
+ if (fp == 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Couldn't write to file %s\n", fname.c_str()));
+ return;
+ }
+ ACE_OS::fprintf (fp,"<?xml version=\"1.0\"?>\n");
+ ACE_OS::fprintf (fp,"<%s>\n", Locator_XMLHandler::ROOT_TAG);
+
+ // Save servers
+ Locator_Repository::SIMap::ENTRY* sientry = 0;
+ Locator_Repository::SIMap::ITERATOR siit (repo.servers ());
+ for (; siit.next (sientry); siit.advance() )
+ {
+ Server_Info_Ptr& info = sientry->int_id_;
+
+ ACE_CString name = ACEXML_escape_string (info->name);
+ ACE_CString activator = ACEXML_escape_string (info->activator);
+ ACE_CString cmdline = ACEXML_escape_string (info->cmdline);
+ ACE_CString wdir = ACEXML_escape_string (info->dir);
+ ACE_CString partial_ior = ACEXML_escape_string (info->partial_ior);
+ ACE_CString ior = ACEXML_escape_string (info->ior);
+
+ ACE_OS::fprintf (fp,"\t<%s", Locator_XMLHandler::SERVER_INFO_TAG);
+ ACE_OS::fprintf (fp," name=\"%s\"", name.c_str ());
+ ACE_OS::fprintf (fp," activator=\"%s\"", activator.c_str ());
+ ACE_OS::fprintf (fp," command_line=\"%s\"", cmdline.c_str ());
+ ACE_OS::fprintf (fp," working_dir=\"%s\"", wdir.c_str ());
+ ACE_CString amodestr = ImR_Utils::activationModeToString (info->activation_mode);
+ ACE_OS::fprintf (fp," activation_mode=\"%s\"", amodestr.c_str ());
+ ACE_OS::fprintf (fp," start_limit=\"%d\"", info->start_limit);
+ ACE_OS::fprintf (fp," partial_ior=\"%s\"", partial_ior.c_str ());
+ ACE_OS::fprintf (fp," ior=\"%s\"", ior.c_str ());
+ ACE_OS::fprintf (fp,">\n");
+
+ for (CORBA::ULong i = 0; i < info->env_vars.length (); ++i)
+ {
+ ACE_OS::fprintf (fp,"\t\t<%s", Locator_XMLHandler::ENVIRONMENT_TAG);
+ ACE_OS::fprintf (fp," name=\"%s\"", info->env_vars[i].name.in ());
+ ACE_CString val = ACEXML_escape_string (info->env_vars[i].value.in ());
+ ACE_OS::fprintf (fp," value=\"%s\"", val.c_str ());
+ ACE_OS::fprintf (fp,"/>\n");
+ }
+
+ ACE_OS::fprintf (fp,"\t</%s>\n", Locator_XMLHandler::SERVER_INFO_TAG);
+ }
+
+ // Save Activators
+ Locator_Repository::AIMap::ENTRY* aientry = 0;
+ Locator_Repository::AIMap::ITERATOR aiit (repo.activators ());
+ for (; aiit.next (aientry); aiit.advance ())
+ {
+ ACE_CString aname = aientry->ext_id_;
+ Activator_Info_Ptr& info = aientry->int_id_;
+ ACE_OS::fprintf (fp,"\t<%s", Locator_XMLHandler::ACTIVATOR_INFO_TAG);
+ ACE_OS::fprintf( fp," name=\"%s\"", aname.c_str ());
+ ACE_OS::fprintf (fp," token=\"%d\"", info->token);
+ ACE_OS::fprintf (fp," ior=\"%s\"", info->ior.c_str ());
+ ACE_OS::fprintf (fp,"/>\n");
+ }
+
+ ACE_OS::fprintf (fp,"</%s>\n", Locator_XMLHandler::ROOT_TAG);
+ ACE_OS::fclose (fp);
+}
+
+Locator_Repository::Locator_Repository ()
+: rmode_ (Options::REPO_NONE)
+, config_ (0)
+{
+}
+
+int
+Locator_Repository::init(const Options& opts)
+{
+ this->rmode_ = opts.repository_mode ();
+ this->fname_ = opts.persist_file_name ();
+
+ int err = 0;
+ switch (this->rmode_)
+ {
+ case Options::REPO_NONE:
+ {
+ break;
+ }
+ case Options::REPO_HEAP_FILE:
+ {
+ if (opts.repository_erase ())
+ {
+ ACE_OS::unlink ( this->fname_.c_str () );
+ }
+ ACE_Configuration_Heap* heap = new ACE_Configuration_Heap ();
+ this->config_.reset (heap);
+ err = heap->open (this->fname_.c_str ());
+ if (err == 0)
+ {
+ loadAsBinary (*this->config_, *this);
+ }
+ break;
+ }
+ case Options::REPO_REGISTRY:
+ {
+#if defined (ACE_WIN32)
+ if (opts.repository_erase ())
+ {
+ ACE_Configuration_Win32Registry config ( HKEY_LOCAL_MACHINE );
+ ACE_Configuration_Section_Key root;
+ config.open_section (config.root_section(), "Software\\TAO", 0, root);
+ config.remove_section (root, "ImplementationRepository", 1);
+ }
+ HKEY root = ACE_Configuration_Win32Registry::
+ resolve_key (HKEY_LOCAL_MACHINE, WIN32_REG_KEY);
+ this->config_.reset (new ACE_Configuration_Win32Registry( root));
+ loadAsBinary (*this->config_, *this);
+#else
+ ACE_ERROR ((LM_ERROR, "Registry persistence is only "
+ "supported on Windows\n"));
+ err = -1;
+#endif
+ break;
+ }
+ case Options::REPO_XML_FILE:
+ {
+ if (opts.repository_erase ())
+ {
+ ACE_OS::unlink ( this->fname_.c_str() );
+ }
+ err = loadAsXML (this->fname_, *this);
+ break;
+ }
+ default:
+ {
+ bool invalid_rmode_specified = false;
+ ACE_ASSERT (invalid_rmode_specified);
+ ACE_UNUSED_ARG (invalid_rmode_specified);
+ err = -1;
+ }
+ }
+ return err;
+}
+
+int
+Locator_Repository::add_server (const ACE_CString& name,
+ const ACE_CString& aname,
+ const ACE_CString& startup_command,
+ const ImplementationRepository::EnvironmentList& env_vars,
+ const ACE_CString& working_dir,
+ ImplementationRepository::ActivationMode activation,
+ int start_limit,
+ const ACE_CString& partial_ior,
+ const ACE_CString& ior,
+ ImplementationRepository::ServerObject_ptr svrobj)
+{
+ int limit = start_limit < 1 ? 1 : start_limit;
+ Server_Info_Ptr info(new Server_Info (name, aname, startup_command,
+ env_vars, working_dir, activation, limit, partial_ior, ior, svrobj));
+
+ int err = servers ().bind (name, info);
+ if (err != 0)
+ {
+ return err;
+ }
+ this->update_server (*info);
+ return 0;
+}
+
+int
+Locator_Repository::add_activator (const ACE_CString& name,
+ const CORBA::Long token,
+ const ACE_CString& ior,
+ ImplementationRepository::Activator_ptr act)
+{
+ Activator_Info_Ptr info (new Activator_Info (name, token, ior, act));
+
+ int err = activators ().bind (lcase (name), info);
+ if (err != 0)
+ {
+ return err;
+ }
+ this->update_activator (*info);
+ return 0;
+}
+
+int
+Locator_Repository::update_server (const Server_Info& info)
+{
+ if (rmode_ == Options::REPO_HEAP_FILE || rmode_ == Options::REPO_REGISTRY)
+ {
+ ACE_ASSERT (this->config_.get () != 0);
+
+ ACE_Configuration& cfg = *this->config_;
+
+ ACE_Configuration_Section_Key root;
+ ACE_Configuration_Section_Key key;
+ int err = cfg.open_section (cfg.root_section(), SERVERS_ROOT_KEY, 1, root);
+ if (err != 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Unable to open config section:%s\n", SERVERS_ROOT_KEY));
+ return err;
+ }
+ err = cfg.open_section (root, info.name.c_str (), 1, key);
+ if (err != 0)
+ {
+ ACE_ERROR((LM_ERROR, "Unable to open config section:%s\n", info.name.c_str()));
+ return err;
+ }
+
+ ACE_CString envstr = ImR_Utils::envListToString(info.env_vars);
+
+ cfg.set_string_value (key, ACTIVATOR, info.activator.c_str ());
+ cfg.set_string_value (key, STARTUP_COMMAND, info.cmdline.c_str ());
+ cfg.set_string_value (key, WORKING_DIR, info.dir.c_str ());
+ cfg.set_string_value (key, ENVIRONMENT, envstr);
+ cfg.set_integer_value (key, ACTIVATION, info.activation_mode);
+ cfg.set_integer_value (key, START_LIMIT, info.start_limit);
+ cfg.set_string_value (key, PARTIAL_IOR, info.partial_ior.c_str ());
+ cfg.set_string_value (key, IOR, info.ior.c_str());
+ }
+ else if (rmode_ == Options::REPO_XML_FILE)
+ {
+ saveAsXML (this->fname_, *this);
+ }
+ return 0;
+}
+
+int
+Locator_Repository::update_activator (const Activator_Info& info)
+{
+ if (rmode_ == Options::REPO_HEAP_FILE || rmode_ == Options::REPO_REGISTRY)
+ {
+ ACE_ASSERT(this->config_.get () != 0);
+
+ ACE_Configuration& cfg = *this->config_;
+
+ ACE_Configuration_Section_Key root;
+ ACE_Configuration_Section_Key key;
+ int err = cfg.open_section (cfg.root_section(), ACTIVATORS_ROOT_KEY, 1, root);
+ if (err != 0)
+ {
+ ACE_ERROR((LM_ERROR, "Unable to open config section:%s\n", ACTIVATORS_ROOT_KEY));
+ return err;
+ }
+ err = cfg.open_section (root, info.name.c_str (), 1, key);
+ if (err != 0)
+ {
+ ACE_ERROR((LM_ERROR, "Unable to open config section:%s\n", info.name.c_str()));
+ return err;
+ }
+
+ cfg.set_integer_value (key, TOKEN, info.token);
+ cfg.set_string_value (key, IOR, info.ior.c_str ());
+ }
+ else if (rmode_ == Options::REPO_XML_FILE)
+ {
+ saveAsXML( this->fname_, *this);
+ }
+ return 0;
+}
+
+Server_Info_Ptr
+Locator_Repository::get_server (const ACE_CString& name)
+{
+ Server_Info_Ptr server (0);
+ servers ().find (name, server);
+ return server;
+}
+
+Activator_Info_Ptr
+Locator_Repository::get_activator (const ACE_CString& name)
+{
+ Activator_Info_Ptr activator (0);
+ activators ().find (lcase (name), activator);
+ return activator;
+}
+
+bool
+Locator_Repository::has_activator (const ACE_CString& name)
+{
+ Activator_Info_Ptr activator (0);
+ return activators().find (lcase (name), activator) == 0;
+}
+
+int
+Locator_Repository::remove_server (const ACE_CString& name)
+{
+ int ret = this->servers().unbind (name);
+ if (ret != 0)
+ {
+ return ret;
+ }
+
+ if (rmode_ == Options::REPO_HEAP_FILE || rmode_ == Options::REPO_REGISTRY)
+ {
+ ACE_ASSERT (this->config_.get() != 0);
+ ACE_Configuration& cfg = *this->config_;
+ ACE_Configuration_Section_Key root;
+ int err = cfg.open_section (cfg.root_section (), SERVERS_ROOT_KEY, 0, root);
+ if (err != 0)
+ {
+ return 0; // Already gone.
+ }
+ ret = cfg.remove_section (root, name.c_str (), 1);
+ }
+ else if (rmode_ == Options::REPO_XML_FILE)
+ {
+ saveAsXML (this->fname_, *this);
+ }
+ return ret;
+}
+
+int
+Locator_Repository::remove_activator (const ACE_CString& name)
+{
+ int ret = activators().unbind (lcase(name));
+ if (ret != 0)
+ {
+ return ret;
+ }
+
+ if (rmode_ == Options::REPO_HEAP_FILE || rmode_ == Options::REPO_REGISTRY)
+ {
+ ACE_ASSERT (this->config_.get () != 0);
+ ACE_Configuration& cfg = *this->config_;
+ ACE_Configuration_Section_Key root;
+ int err = cfg.open_section (cfg.root_section (), ACTIVATORS_ROOT_KEY, 0, root);
+ if (err != 0)
+ {
+ return 0; // Already gone.
+ }
+ ret = cfg.remove_section (root, name.c_str (), 1);
+ }
+ else if (rmode_ == Options::REPO_XML_FILE)
+ {
+ saveAsXML (this->fname_, *this);
+ }
+ return ret;
+}
+
+Locator_Repository::SIMap&
+Locator_Repository::servers (void)
+{
+ return server_infos_;
+}
+
+Locator_Repository::AIMap&
+Locator_Repository::activators (void)
+{
+ return activator_infos_;
+}
+
+const char*
+Locator_Repository::repo_mode ()
+{
+ switch (rmode_)
+ {
+ case Options::REPO_XML_FILE:
+ case Options::REPO_HEAP_FILE:
+ return fname_.c_str ();
+ case Options::REPO_REGISTRY:
+ return "Registry";
+ case Options::REPO_NONE:
+ return "Disabled";
+ }
+ return "Disabled";
+}
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h
new file mode 100644
index 00000000000..2ef50b5753a
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h
@@ -0,0 +1,114 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+* @file Locator_Repository.h
+*
+* $Id$
+*
+* This class implements the Repository for the Implementation Repository.
+*
+* @author Darrell Brunsch <brunsch@cs.wustl.edu>
+* @author Priyanka Gontla <gontla_p@ociweb.com>
+*/
+//=============================================================================
+
+#ifndef REPOSITORY_H
+#define REPOSITORY_H
+
+#include "Server_Info.h"
+#include "Activator_Info.h"
+#include "Locator_Options.h"
+
+#include "ace/Hash_Map_Manager.h"
+#include "ace/Configuration.h"
+#include "ace/Auto_Ptr.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+* @class Locator_Repository
+*
+* @brief Database containing all ImR persistent information.
+*
+*/
+class Locator_Repository
+{
+public:
+ typedef ACE_Hash_Map_Manager_Ex<ACE_CString,
+ Server_Info_Ptr,
+ ACE_Hash<ACE_CString>,
+ ACE_Equal_To<ACE_CString>,
+ ACE_Null_Mutex> SIMap;
+
+ typedef ACE_Hash_Map_Manager_Ex<ACE_CString,
+ Activator_Info_Ptr,
+ ACE_Hash<ACE_CString>,
+ ACE_Equal_To<ACE_CString>,
+ ACE_Null_Mutex> AIMap;
+
+ Locator_Repository();
+
+ /// Initializes the Server Repository
+ int init (const Options& opts);
+
+ /// Add a new server to the Repository
+ int add_server (const ACE_CString& name,
+ const ACE_CString& aname,
+ const ACE_CString& startup_command,
+ const ImplementationRepository::EnvironmentList& environment_vars,
+ const ACE_CString& working_dir,
+ ImplementationRepository::ActivationMode activation,
+ int start_limit,
+ const ACE_CString& partial_ior = ACE_CString(""),
+ const ACE_CString& ior = ACE_CString(""),
+ ImplementationRepository::ServerObject_ptr svrobj = ImplementationRepository::ServerObject::_nil()
+ );
+ /// Add a new activator to the Repository
+ int add_activator (const ACE_CString& name,
+ const CORBA::Long token,
+ const ACE_CString& ior = ACE_CString(""),
+ ImplementationRepository::Activator_ptr act = ImplementationRepository::Activator::_nil()
+ );
+
+ /// Update the associated information.
+ int update_server (const Server_Info& info);
+ /// Update the associated information.
+ int update_activator (const Activator_Info& info);
+
+ /// Returns information related to startup.
+ Server_Info_Ptr get_server (const ACE_CString& name);
+ /// Returns information related to startup.
+ Activator_Info_Ptr get_activator (const ACE_CString& name);
+
+ bool has_activator(const ACE_CString& name);
+
+ /// Removes the server from the Repository.
+ int remove_server (const ACE_CString& name);
+ /// Removes the activator from the Repository.
+ int remove_activator (const ACE_CString& name);
+
+ /// Returns the internal hash map containing the server information.
+ SIMap& servers(void);
+ /// Returns the internal hash map containing the activator information.
+ AIMap& activators(void);
+
+ const char* repo_mode();
+
+private:
+ // Type mechanism to use for persistence.
+ Options::RepoMode rmode_;
+ // The in-memory list of the server information.
+ SIMap server_infos_;
+ // The in-memory list of the activator information.
+ AIMap activator_infos_;
+ // Several rmode_ values require this.
+ ACE_Auto_Ptr<ACE_Configuration> config_;
+ // XML requires the file name
+ ACE_CString fname_;
+};
+
+
+#endif /* REPOSITORY_H */
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp b/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp
new file mode 100644
index 00000000000..a1ddcf0b3d9
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp
@@ -0,0 +1,97 @@
+// $Id$
+
+#include "Locator_XMLHandler.h"
+#include "ace/OS_NS_strings.h"
+
+ACE_RCSID (ImplRepo_Service,Locator_XMLHandler,"$Id$")
+
+const char* Locator_XMLHandler::ROOT_TAG = "ImplementationRepository";
+const char* Locator_XMLHandler::SERVER_INFO_TAG = "Servers";
+const char* Locator_XMLHandler::ACTIVATOR_INFO_TAG = "Activators";
+const char* Locator_XMLHandler::ENVIRONMENT_TAG = "EnvironmentVariables";
+
+Locator_XMLHandler::Locator_XMLHandler (Callback& cb)
+: callback_ (cb)
+{
+}
+
+void
+Locator_XMLHandler::startElement (const ACEXML_Char*,
+ const ACEXML_Char*,
+ const ACEXML_Char* qName,
+ ACEXML_Attributes* attrs ACEXML_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((ACEXML_SAXException))
+{
+ ACE_ASSERT (qName != 0);
+ if (ACE_OS::strcasecmp (qName, SERVER_INFO_TAG) == 0)
+ {
+ // We'll use this as a key to determine if we've got a valid record
+ this->server_name_ = "";
+ this->env_vars_.clear();
+
+ if (attrs != 0 && attrs->getLength () == 8)
+ {
+ this->server_name_ = attrs->getValue ((size_t)0);
+ this->activator_name_ = attrs->getValue ((size_t)1);
+ this->command_line_ = attrs->getValue ((size_t)2);
+ this->working_dir_ = attrs->getValue ((size_t)3);
+ this->activation_ = attrs->getValue ((size_t)4);
+ this->env_vars_.clear ();
+ int limit = ACE_OS::atoi (attrs->getValue ((size_t)5));
+ this->start_limit_ = limit;
+ this->partial_ior_ = attrs->getValue ((size_t)6);
+ this->server_object_ior_ = attrs->getValue ((size_t)7);
+ }
+ }
+ else if (ACE_OS::strcasecmp (qName, ACTIVATOR_INFO_TAG) == 0)
+ {
+ if (attrs != 0 && attrs->getLength () == 3)
+ {
+ ACE_CString aname = attrs->getValue ((size_t)0);
+ ACE_CString token_str = attrs->getValue ((size_t)1);
+ long token = ACE_OS::atoi (token_str.c_str ());
+ ACE_CString ior = attrs->getValue ((size_t)2);
+ this->callback_.next_activator (aname, token, ior);
+ }
+ }
+ else if (ACE_OS::strcasecmp (qName, ENVIRONMENT_TAG) == 0)
+ {
+ if (attrs != 0 && attrs->getLength () == 2)
+ {
+ EnvVar ev;
+ ev.name = attrs->getValue ((size_t)0);
+ ev.value = attrs->getValue ((size_t)1);
+ this->env_vars_.push_back (ev);
+ }
+ }
+}
+
+void
+Locator_XMLHandler::endElement (const ACEXML_Char*,
+ const ACEXML_Char*,
+ const ACEXML_Char* qName ACEXML_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((ACEXML_SAXException))
+{
+ ACE_ASSERT(qName != 0);
+ if (ACE_OS::strcasecmp (qName, SERVER_INFO_TAG) == 0
+ && this->server_name_.length () > 0)
+ {
+ this->callback_.next_server (this->server_name_,
+ this->activator_name_, this->command_line_,
+ this->env_vars_, this->working_dir_, this->activation_,
+ this->start_limit_, this->partial_ior_, this->server_object_ior_);
+ }
+ // activator info is handled in the startElement
+}
+
+bool
+Locator_XMLHandler::EnvVar::operator== (const EnvVar& rhs) const
+{
+ return name == rhs.name && value == rhs.value;
+}
+bool
+Locator_XMLHandler::EnvVar::operator!= (const EnvVar& rhs) const
+{
+ return ! (rhs == *this);
+}
+
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.h b/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.h
new file mode 100644
index 00000000000..ff8691d0a78
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.h
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file Locator_XMLHandler.h
+ *
+ * $Id$
+ *
+ * @author Justin Michel <michel_j@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef Locator_XMLHandler_H
+#define Locator_XMLHandler_H
+
+#include "ACEXML/common/DefaultHandler.h"
+
+#include "ace/Vector_T.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * Callback SAX XML Handler for parsing XML.
+ */
+class Locator_XMLHandler : public ACEXML_DefaultHandler
+{
+public:
+
+ // XML ELEMENT names
+ static const char* ROOT_TAG;
+ static const char* SERVER_INFO_TAG;
+ static const char* ENVIRONMENT_TAG;
+ static const char* ACTIVATOR_INFO_TAG;
+
+ struct EnvVar {
+ ACE_CString name;
+ ACE_CString value;
+ bool operator==(const EnvVar&) const; // To allow Vector explicit instantiation
+ bool operator!=(const EnvVar&) const; // To allow Vector explicit instantiation
+ };
+
+ typedef ACE_Vector<EnvVar> EnvList;
+
+ struct Callback {
+ virtual ~Callback() {}
+
+ virtual void next_server (const ACE_CString& server_name,
+ const ACE_CString& aname, const ACE_CString& startup_cmd,
+ const EnvList& env_vars, const ACE_CString& working_dir,
+ const ACE_CString& actmode, int start_limit,
+ const ACE_CString& partial_ior, const ACE_CString& ior) = 0;
+
+ virtual void next_activator (const ACE_CString& activator_name,
+ long token,
+ const ACE_CString& ior) = 0;
+ };
+
+ Locator_XMLHandler (Callback& cb);
+
+ virtual void startElement (const ACEXML_Char* namespaceURI,
+ const ACEXML_Char* localName,
+ const ACEXML_Char* qName,
+ ACEXML_Attributes* atts ACEXML_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((ACEXML_SAXException));
+
+ virtual void endElement (const ACEXML_Char* namespaceURI,
+ const ACEXML_Char* localName,
+ const ACEXML_Char* qName ACEXML_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((ACEXML_SAXException));
+
+ private:
+
+ // callback on completion of an element
+ Callback& callback_;
+
+ ACE_CString server_name_;
+ ACE_CString activator_name_;
+ ACE_CString command_line_;
+ ACE_CString activation_;
+ ACE_CString working_dir_;
+ ACE_CString server_object_ior_;
+ ACE_CString partial_ior_;
+ int start_limit_;
+ EnvList env_vars_;
+};
+
+#endif /* Locator_XMLHandler_H */
diff --git a/TAO/orbsvcs/ImplRepo_Service/Makefile.am b/TAO/orbsvcs/ImplRepo_Service/Makefile.am
new file mode 100644
index 00000000000..166dacc12a0
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Makefile.am
@@ -0,0 +1,391 @@
+## 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)
+
+bin_PROGRAMS =
+
+## Makefile.ImR_Activator_IDL.am
+
+BUILT_SOURCES = \
+ ImR_ActivatorC.cpp \
+ ImR_ActivatorC.h \
+ ImR_ActivatorC.inl \
+ ImR_ActivatorS.cpp \
+ ImR_ActivatorS.h \
+ ImR_ActivatorS.inl \
+ ImR_ActivatorS_T.cpp \
+ ImR_ActivatorS_T.h \
+ ImR_ActivatorS_T.inl
+
+CLEANFILES = \
+ ImR_Activator-stamp \
+ ImR_ActivatorC.cpp \
+ ImR_ActivatorC.h \
+ ImR_ActivatorC.inl \
+ ImR_ActivatorS.cpp \
+ ImR_ActivatorS.h \
+ ImR_ActivatorS.inl \
+ ImR_ActivatorS_T.cpp \
+ ImR_ActivatorS_T.h \
+ ImR_ActivatorS_T.inl
+
+ImR_ActivatorC.cpp ImR_ActivatorC.h ImR_ActivatorC.inl ImR_ActivatorS.cpp ImR_ActivatorS.h ImR_ActivatorS.inl ImR_ActivatorS_T.cpp ImR_ActivatorS_T.h ImR_ActivatorS_T.inl: ImR_Activator-stamp
+
+ImR_Activator-stamp: $(srcdir)/ImR_Activator.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=ActivatorIDL_Export -Wb,export_include=activator_idl_export.h $(srcdir)/ImR_Activator.idl
+ @touch $@
+
+noinst_LTLIBRARIES = libTAO_ImR_Activator_IDL.la
+
+libTAO_ImR_Activator_IDL_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DACTIVATOR_IDL_BUILD_DLL
+
+libTAO_ImR_Activator_IDL_la_SOURCES = \
+ ImR_ActivatorC.cpp \
+ ImR_ActivatorS.cpp
+
+noinst_HEADERS = \
+ ImR_Activator.idl \
+ ImR_ActivatorC.h \
+ ImR_ActivatorC.inl \
+ ImR_ActivatorS.h \
+ ImR_ActivatorS.inl \
+ ImR_ActivatorS_T.cpp \
+ ImR_ActivatorS_T.h \
+ ImR_ActivatorS_T.inl \
+ activator_idl_export.h
+
+## Makefile.ImR_Locator_IDL.am
+
+if BUILD_CORBA_MESSAGING
+
+BUILT_SOURCES += \
+ ImR_LocatorC.cpp \
+ ImR_LocatorC.h \
+ ImR_LocatorC.inl \
+ ImR_LocatorS.cpp \
+ ImR_LocatorS.h \
+ ImR_LocatorS.inl \
+ ImR_LocatorS_T.cpp \
+ ImR_LocatorS_T.h \
+ ImR_LocatorS_T.inl
+
+CLEANFILES += \
+ ImR_Locator-stamp \
+ ImR_LocatorC.cpp \
+ ImR_LocatorC.h \
+ ImR_LocatorC.inl \
+ ImR_LocatorS.cpp \
+ ImR_LocatorS.h \
+ ImR_LocatorS.inl \
+ ImR_LocatorS_T.cpp \
+ ImR_LocatorS_T.h \
+ ImR_LocatorS_T.inl
+
+ImR_LocatorC.cpp ImR_LocatorC.h ImR_LocatorC.inl ImR_LocatorS.cpp ImR_LocatorS.h ImR_LocatorS.inl ImR_LocatorS_T.cpp ImR_LocatorS_T.h ImR_LocatorS_T.inl: ImR_Locator-stamp
+
+ImR_Locator-stamp: $(srcdir)/ImR_Locator.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=LocatorIDL_Export -Wb,export_include=locator_idl_export.h $(srcdir)/ImR_Locator.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ AsyncStartupWaiterC.cpp \
+ AsyncStartupWaiterC.h \
+ AsyncStartupWaiterC.inl \
+ AsyncStartupWaiterS.cpp \
+ AsyncStartupWaiterS.h \
+ AsyncStartupWaiterS.inl \
+ AsyncStartupWaiterS_T.cpp \
+ AsyncStartupWaiterS_T.h \
+ AsyncStartupWaiterS_T.inl
+
+CLEANFILES += \
+ AsyncStartupWaiter-stamp \
+ AsyncStartupWaiterC.cpp \
+ AsyncStartupWaiterC.h \
+ AsyncStartupWaiterC.inl \
+ AsyncStartupWaiterS.cpp \
+ AsyncStartupWaiterS.h \
+ AsyncStartupWaiterS.inl \
+ AsyncStartupWaiterS_T.cpp \
+ AsyncStartupWaiterS_T.h \
+ AsyncStartupWaiterS_T.inl
+
+AsyncStartupWaiterC.cpp AsyncStartupWaiterC.h AsyncStartupWaiterC.inl AsyncStartupWaiterS.cpp AsyncStartupWaiterS.h AsyncStartupWaiterS.inl AsyncStartupWaiterS_T.cpp AsyncStartupWaiterS_T.h AsyncStartupWaiterS_T.inl: AsyncStartupWaiter-stamp
+
+AsyncStartupWaiter-stamp: $(srcdir)/AsyncStartupWaiter.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=LocatorIDL_Export -Wb,export_include=locator_idl_export.h -GH $(srcdir)/AsyncStartupWaiter.idl
+ @touch $@
+
+noinst_LTLIBRARIES += libTAO_ImR_Locator_IDL.la
+
+libTAO_ImR_Locator_IDL_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DLOCATOR_IDL_BUILD_DLL
+
+libTAO_ImR_Locator_IDL_la_SOURCES = \
+ AsyncStartupWaiterC.cpp \
+ AsyncStartupWaiterS.cpp \
+ ImR_LocatorC.cpp \
+ ImR_LocatorS.cpp
+
+noinst_HEADERS += \
+ AsyncStartupWaiter.idl \
+ AsyncStartupWaiterC.h \
+ AsyncStartupWaiterC.inl \
+ AsyncStartupWaiterS.h \
+ AsyncStartupWaiterS.inl \
+ AsyncStartupWaiterS_T.cpp \
+ AsyncStartupWaiterS_T.h \
+ AsyncStartupWaiterS_T.inl \
+ ImR_Locator.idl \
+ ImR_LocatorC.h \
+ ImR_LocatorC.inl \
+ ImR_LocatorS.h \
+ ImR_LocatorS.inl \
+ ImR_LocatorS_T.cpp \
+ ImR_LocatorS_T.h \
+ ImR_LocatorS_T.inl \
+ locator_idl_export.h
+
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.ImR_Activator.am
+
+if BUILD_ACEXML
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_LTLIBRARIES += libTAO_ImR_Activator.la
+
+libTAO_ImR_Activator_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(ACE_ROOT)/ACEXML/common \
+ -DACTIVATOR_BUILD_DLL
+
+libTAO_ImR_Activator_la_SOURCES = \
+ Activator_Loader.cpp \
+ Activator_Options.cpp \
+ ImR_Activator_i.cpp
+
+noinst_HEADERS += \
+ Activator_Loader.h \
+ Activator_Options.h \
+ ImR_Activator_i.h \
+ activator_export.h
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACEXML
+
+## Makefile.ImR_Activator_Service.am
+
+if BUILD_ACEXML
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+bin_PROGRAMS += ImR_Activator
+
+ImR_Activator_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(ACE_ROOT)/ACEXML/common \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+ImR_Activator_SOURCES = \
+ Activator_NT_Service.cpp \
+ ImR_Activator.cpp \
+ Activator_NT_Service.h
+
+ImR_Activator_LDADD = \
+ libTAO_ImR_Activator.la \
+ libTAO_ImR_Activator_IDL.la \
+ libTAO_ImR_Locator_IDL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_ImR_Client.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 \
+ $(ACE_BUILDDIR)/ACEXML/parser/parser/libACEXML_Parser.la \
+ $(ACE_BUILDDIR)/ACEXML/common/libACEXML.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
+endif BUILD_ACEXML
+
+## Makefile.ImR_Locator.am
+
+if BUILD_ACEXML
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_LTLIBRARIES += libTAO_ImR_Locator.la
+
+libTAO_ImR_Locator_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(ACE_ROOT)/ACEXML/common \
+ -DLOCATOR_BUILD_DLL
+
+libTAO_ImR_Locator_la_SOURCES = \
+ Activator_Info.cpp \
+ Adapter_Activator.cpp \
+ AsyncStartupWaiter_i.cpp \
+ Forwarder.cpp \
+ INS_Locator.cpp \
+ ImR_Locator_i.cpp \
+ Iterator.cpp \
+ Locator_Loader.cpp \
+ Locator_Options.cpp \
+ Locator_Repository.cpp \
+ Locator_XMLHandler.cpp \
+ Server_Info.cpp
+
+noinst_HEADERS += \
+ Activator_Info.h \
+ Adapter_Activator.h \
+ AsyncStartupWaiter_i.h \
+ Forwarder.h \
+ INS_Locator.h \
+ ImR_Locator_i.h \
+ Iterator.h \
+ Locator_Loader.h \
+ Locator_Options.h \
+ Locator_Repository.h \
+ Locator_XMLHandler.h \
+ Server_Info.h \
+ locator_export.h \
+ utils.h
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACEXML
+
+## Makefile.ImR_Locator_Service.am
+
+if BUILD_ACEXML
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+bin_PROGRAMS += ImplRepo_Service
+
+ImplRepo_Service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(ACE_ROOT)/ACEXML/common \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+ImplRepo_Service_SOURCES = \
+ ImR_Locator.cpp \
+ Locator_NT_Service.cpp \
+ Locator_NT_Service.h
+
+ImplRepo_Service_LDADD = \
+ libTAO_ImR_Locator.la \
+ libTAO_ImR_Activator_IDL.la \
+ libTAO_ImR_Locator_IDL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_ImR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(ACE_BUILDDIR)/ACEXML/parser/parser/libACEXML_Parser.la \
+ $(ACE_BUILDDIR)/ACEXML/common/libACEXML.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_IORTable.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
+endif BUILD_ACEXML
+
+## Makefile.tao_imr.am
+
+if !BUILD_MINIMUM_CORBA
+
+bin_PROGRAMS += tao_imr
+
+tao_imr_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+tao_imr_SOURCES = \
+ tao_imr.cpp \
+ tao_imr_i.cpp \
+ tao_imr_i.h
+
+tao_imr_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
+
+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/ImplRepo_Service/README.txt b/TAO/orbsvcs/ImplRepo_Service/README.txt
new file mode 100644
index 00000000000..f6f8082f21b
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/README.txt
@@ -0,0 +1,590 @@
+/** -*- HTML-Helper -*- $Id$
+
+@mainpage Implementation Repository
+
+@section intro Introduction
+
+The purpose of the Implementation Repository (ImR) in TAO is for the automatic
+activation of a TAO server when a method is invoked but the server is not
+running. It does this by working with the server to keep track of when it is
+activated and stores information on how to reactivate it. Method
+invocations on the server will actually be sent to the Implementation
+Repository, which will then be able to start the server process if it is not
+already running and forward the invocation to the real server.
+
+@section resources Resources
+
+The ImR in TAO was first based on a paper on the subject by
+<a href="http://www.triodia.com/staff/michi-henning.html">Michi Henning</a>
+called <a href="http://www.triodia.com/staff/michi/cacm.pdf">Binding,
+Migration, and Scalability in CORBA</a>. Mr. Henning later went on to
+coauthor the book
+<a href="http://cseng.awl.com/bookdetail.qry?ISBN=0-201-37927-9&amp;ptype=0">
+Advanced CORBA Programming in C++</a> and included a chapter on the
+Implementation Repository. The description of the ImR in this chapter is used
+as the specification for TAO's ImR.
+
+@ref usersguide - Overall documentation on how to use the ImR in your programs
+
+@ref future - Future Work
+
+@ref ntservice - Running the ImR as a NT Service
+
+@ref imrandnaming - Using the Naming Service with the Implmentation Repository
+
+@ref movefromoldImR - Moving from IMR as in TAO 1.2.2 to the present version.
+
+@section authors Authors
+
+The guy who first worked on ImR and provided a base for the current
+ImR is Darrell Brunsch
+@<<a href="mailto:brunsch@cs.wustl.edu">brunsch@cs.wustl.edu</a>@>.
+The current version is developed by Priyanka Gontla
+@<<a href="mailto:gontla_p@ociweb.com">gontla_p@ociweb.com</a>@>.
+You can reach us by either email (which is better), or through the
+<a href="http://www.cs.wustl.edu/~schmidt/ACE-mail.html">ACE mailing list</a>
+@<<a href="mailto:ace-useres@cs.wustl.edu">ace-users@cs.wustl.edu</a>@>,
+or through the <a href="news:comp.soft-sys.ace">comp.soft-sys.ace</a>
+newsgroup. The newsgroup mirrors the mailing list, but not the other way.
+Also, if you use the mailing list, it is best if you join it before sending
+a question since responses are usually just replied back to the group.
+
+The NT Service part of the ImR was developed by Jeff Parsons @<<a
+href="mailto:parsons@cs.wustl.edu">parsons@cs.wustl.edu</a>@>. He can
+also be reached via the same channels.
+It was later extended and enhanced by Justin Michel <michel_j@ociweb.com>
+
+*/
+
+/**
+@page future Future Work
+
+As with any program, there is always a wishlist of things to do.
+
+@subsection ort Use Object Reference Template (ORT) Features
+
+ Use ORT so that the ImR-ified IORs doesnt have any information
+about the ImR_Activators. Right now, even though, the ImplRepo_Service is
+the one that is exposed to the client, the IOR will have a reference
+to the ImR_Activator. By using ORT features, we want the IOR to refer
+to the ImplRepo_Service rather than the underlying ImR_Activator. That way
+the ImR_Activator is totally blocked from the client using the ImR
+service.
+
+@subsection ort_design Design Considerations
+
+ For the above mentioned purposes, we can say that the ImplRepo_Service
+acts as the gateway which receives requests on behalf of the actual
+ImR_Activator.
+
+ The ImplRepo_Service will now need a new IDL method 'create_object'. The
+create_object method will take the interface_repository_id of the
+object that has to be gatewayed (ImR_Activator's) and the
+CORBA::Object_ptr of the gatewayed object. And, using these two will
+create an object which will point to the ImplRepo_Service and will also
+know that the ultimate receiver is the ImR_Activator.
+
+ So, this is how it works.
+
+ As before, we will first run the ImplRepo_Service. And, then run an
+ImR_Activator. We will use interceptors and in the post_init method,
+we will add an ior interceptor which will have the ImplRepo_Service
+object. By this, the IOR that is generated will actually point to the
+ImplRepo_Service rather than ImR_Activator. So, the IOR which is visible to
+the client will show that the IOR actually points to the ImplRepo_Service.
+
+ When a client sends a request to the ImplRepo_Service, the request
+will come to ImplRepo_Service which will send the request to the actual
+ImR_Activator.
+
+@subsection AMH Use AMH Features
+
+ Use the AMH features to improve the TAO IMR performance.
+
+@subsection logicalnames Logical Server names
+
+In the IDL interface, but not used on the server side or fully implemented in
+tao_ImR.
+
+@subsection shutdown Server Shutdown
+
+Only cooperative shutdown implemented right now. Since we keep track of the
+Process ID, then we could kill the server if it doesn't cooperate.
+
+@subsection optimization Client-side Optimizations
+
+Nothing yet.
+
+@subsection security Server Security
+
+Nothing really here. There is two main things I have in mind.
+
+First, the security service would be useful to restrict access to some
+of the Administration methods
+
+Second, without a security service we should provide some sort of flag to
+the ImR that disables the Administration methods. That way, the database
+can be set up with the servers in a controlled run of the ImR. Then the
+ImR could be run again reading in the database without Admin access.
+
+@subsection federations Federations
+
+Nothing yet.
+
+@subsection dllserver DLL servers
+
+Nothing yet.
+
+@subsection XML Database Support
+
+ As of now, the support is only to be able to have the information
+ about a registered server written to an XML file. Have to support
+retrieving information from the XML file to be able to do any actions
+on the registered servers.
+
+@subsection Remove ImR_Activator
+
+ We can now successfully register an ImR_Activator. But, we have to
+yet provide support to gracefully unregister the ImR_Activator from
+the ImplRepo_Service. The ImplRepo_Service then has to try to transfer the
+servers that were registered with this instance to other activators.
+*/
+
+/**
+@page usersguide Implementation Repository User's Guide
+
+In order for a server to make use of the Implementation Repository, it must
+communicate with the ImR to keep it up to date on such things as the server's
+running status. These functions now are contained within the POA, so when a
+Persistent POA is used on a server that has -ORBUseImR specified, it will
+communicate with an Implementation Repository, if one is available.
+
+@subsection description The New ImR
+
+ The new ImR is based on the ImR in TAO 1.2.2 with added
+features to help improve throughput and load balancing. The work to be
+performed by the Implementation Repository is distributed between two
+entities (ImplRepo_Service and ImR_Activator) to help achieve the goal of
+better throughput and load balance.
+
+@subsection locator ImplRepo_Service
+
+ The ImplRepo_Service acts as the main server which is visible to
+the application intending to use the ImR. It receives requests sent
+via tao_ImR and distributes the work to the registered ImR_Activators.
+It is stateless and does not maintain any information except about the
+ImR_Activators that are registered with it. Its job is to act as
+a mediator between the application and the actual ImR_Activator that does
+the real work. As of now, we only support one ImplRepo_Service to be running at
+any time. ImplRepo_Service can be reached through the usual methods of
+-ORBInitRef and -ORBDefaultInitRef and multicast.
+
+Commandline Arguments that can be passed to ImplRepo_Service
+
+-d debug information
+-m support multicast discovery.
+-o generate the ior.
+-x support persistence to the ImplRepo_Service. We use XML to support
+ persistence. Names of the activators registered with the locator,
+ their IORs, and the servers registered with each of the activators are
+ saved to the xml file. Use this option to pass the name of the file
+ where the data has to be saved.
+
+ And, ofcourse, the ORB Options.
+
+
+@subsection activator ImR_Activator
+
+ ImR_Activators, as you might have guessed, do the real work of
+activating servers or shutting them down and maintaining the information
+about servers related to them. Only one instance of an ImR_Activator
+can be run on one host. The ImR_Activator is not exposed at all to the
+application. Only the ImplRepo_Service needs to and it is the only one that
+can contact the ImR_Activator.
+
+ An instance of ImR_Activator first registers itself with the
+ImplRepo_Service so that it can begin to receive requests. When registering
+with the ImplRepo_Service, it passes the hostname where it is being run and
+its IOR to the ImplRepo_Service. And, the ImplRepo_Service reaches it using the
+same information.
+
+The Commandline paramters that are valid for ImR_Activator are
+
+-c: Run the Service command.
+-d:number Debug Information
+-l lock the database.
+-o Generate the IOR to a file (just in case some one wants
+ to read the IOR)
+-r Enable Win32 regsitry implementation.
+-s Run as a service.
+-t Set a timeout value.
+-h Prints the help.
+
+ When Persistence of an ImR_Activator is required, we will save
+the information about the server's that this ImR_Activator is related
+to in a file (being the easy form of a persistent database). The
+information about each server include its startup options, location,
+working directory which are needed to execute the requests that can
+passed by tao_imr with regards to the server.
+
+ There are two ways in which you can store data in the
+file. One way is to use ACE_Configuration_Heap to save all
+the information to the file. To do this, we have to pass the '-p' option.
+
+-p Pass the ImplRepo service a filename to use for the
+ backing store. Uses ACE_Configuration_Heap.
+
+ The second way is to save in XML-ized format.
+
+-x Pass the filename where the repository information should
+ be saved. Use XML format.
+
+
+@subsection work So how does the whole thing work?
+
+ The first thing to do is to have an ImplRepo_Service running. Once
+the ImplRepo_Service is running, we can instantiate one or more ImR_Activators
+as needed per the application. As mentioned already, the
+ImR_Activators, upon instantiation, register with the ImplRepo_Service to
+be able to receive requests.
+
+ When a new server has to be added or any change has to the
+done to an existing server, a request is to be sent to the ImplRepo_Service
+via the tao_imr utility. Startup commands, the working directory, the
+host where the server should be started up and such other information
+are passed to the ImplRepo_Service via the TAO_ImR commandline arguments.
+
+ If the host where the server should be started up is passed
+while adding a new server, the ImplRepo_Service chooses the ImR_Activator
+that is running on that host to be responsible for the server's
+activities. Otherwise, an ImR_Activator is chosen based on the Round
+robin algorithm. We plan to use better algorithms based on the
+existing load for the same purpose in future. Whatever way the
+ImR_Activator is chosen for a server, once an ImR_Activator is chosen,
+that ImR_Activator remains reponsible for the server throughout the
+server's lifetime.
+
+ After an ImR_Activator is chosen, the ImplRepo_Service passes the
+request to the chosen ImR_Activator. The ImR_Activator acts on the request
+and updates its database to reflect the new state of the server.
+
+@subsection run How is the ImR run?
+
+<ol>
+ <li>First run the <b>ImplRepo_Service</b>
+ <em>Example:<code> </code> </em><code> ImplRepo_Service -o locator.ior<br></code>
+ <li>Run the <b>Activator</b>
+ <em>Example:<code> </code> </em><code> ImR_Activator -ORBInitRef ImplRepoService=file://locator.ior<br></code>
+
+@subsection use How is the ImR used?
+
+The main steps for the lifetime of a server that uses the ImR are generally
+the following:
+
+<ol>
+ <li>Register name and startup commands with the ImR using <b>tao_ImR<br>
+ </b><em>Example:<code> </code> </em><code> tao_ImR -ORBInitRef
+ ImplRepoService=file://locator.ior add plane -c &quot;airplane_server -i
+ -ORBInitRef ImplRepoService=file://locator.ior&quot;<br></code>
+ <br>
+ Note that the name used to register the server is the name of the POA
+ which the objects are created in. So in this example, the airplane_server
+ creates a POA called &quot;plane&quot; and activates its servants under
+ it.<br>
+ <li>Start the server once to generate an ImR-ified IOR<br>
+ <li>Start clients and pass them the above IOR<br>
+ <li>Clients will use the IOR, which will automatically go through the ImR<br>
+ <li>The ImR will start the server if it is not already running<br>
+ <li>At any time when the server is not currently in use by a client, it can be
+ shut down using <strong>tao_ImR<br></strong><em>Example:</em><code> tao_ImR
+ -ORBInitRef ImplRepoService=file://locator.ior shutdown plane<br>
+ </code>
+ <li>After the server isn't needed anymore, it can be removed from the ImR database
+ using <strong>tao_ImR<br></strong><em>Example:<code> </em>tao_ImR -ORBInitRef
+ ImplRepoService=file://locator.ior remove plane</code>
+</ol>
+
+@subsection serverresponsibilities So what does the server need to do?
+
+As of TAO 1.0.9, the Implementation Repository support on the server-side has
+been integrated into the POA. Previously, the IR_Helper class needed to be
+used explicitly. Now only the &quot;-ORBUseImR 1&quot; command line
+argument needs to be used.
+
+There are a couple of restrictions on the server though. Only objects within
+a persistent POA will be supported by the ImR. Also the Implementation
+Repository will key its entries on POA name. What this means for the server
+is that each server must have unique persistent POA names.
+
+@subsection defaultinitref Use of -ORBDefaultInitRef with the ImR
+
+As mentioned in the INS documentation (in TAO/docs/INS.html), a base IOR
+can be passed to the ORB. Then when resolve_initial_reference is called,
+the ORB can append the service name to the base IOR to form a full IOR.
+
+When used with the ImR, this can be a powerful feature. If the ImR's endpoint
+is used as the base IOR, then the ImR can be used to provide many services via
+the resolve_initial_reference functionality.
+
+For example, let's say the ImR service is running on doriath on port 5555 and
+the Name Service is already registered with the ImR (in that the ImR knows how
+to start the Name Service).
+
+Now we should be able to run some client that uses the Name Service like this:
+
+<code>client -ORBDefaultInitRef corbaloc:iiop:doriath:5555/</code>
+
+When the client calls resolve_initial_reference("NameService"), the ORB will
+resolve that to "corbaloc:iiop:doriath:5555/NameService". The ImR
+recognizes this IOR as a pointer to the NameService, and will then
+start it up if necessary. Finally, it will forward the client to the
+Name Service.
+
+Services used in this way have two requirements:
+
+- The server must be registered as the request_initial_reference name. For
+ example, the Name Service is registered as the "NameService", and thus also
+ contains a POA with the name "NameService".
+- The server must also be able to handle the INS name
+ "corbaloc:iiop:machine:port/poa_name", where the poa_name is the
+ same name as above.
+
+@subsection activationmodes What are activation modes
+
+Each server can have one of three different types of activation modes:
+
+<ul>
+ <li>NORMAL is the default. The server can be started via tao_ImR,
+ the command line, and with client requests.
+ <li>MANUAL specifies that the server shouldn't be activated with a
+ client request but can be activated through tao_ImR or via the
+ command line.
+ <li>PER_CLIENT specifies that each request to the ImplRepo will
+ result in a new server process started up. Because clients
+ cache the forwarded reference, there is one server per client
+ (more or less). There are some exceptions, such as if the
+ original IOR is used in different threads (each thread would get
+ a different server). <b>Note:</b> The Implementation Repository
+ doesn't store any information about the started servers in this
+ mode, so it cannot be used to shut down the servers. So the
+ servers must have an alternative way of shutting down.
+ <li>AUTO_START specifies that a server should be activated when the
+ Implementation Repository is started. tao_ImR also has an
+ autostart command to activate all servers marked AUTO_START.
+</ul>
+
+@subsection taoImRior Using the tao_ImR ior command
+
+First, some background.
+
+For the longest time, there was no way with TAO's Implementation Repository
+to register a server and then start using the client immediately. The server
+had to be started once just for the purpose of creating an IOR for the client
+to use. The problem was that it was very difficult to create an IOR without
+running the server.
+
+It would be nice to be able to generate a valid IOR without requiring the
+program to be run. A valid IOR in this case requires two major things. First
+it requires the endpoint of the ImR. This is relatively easy to get, since it
+is encoded in the ImR's IOR. Second it also requires an object key. At the
+least, this involves both the POA hierarchy and the object name.
+
+So if we knew the POA and object names, then we should be able to create an
+IOR for the server. One possibility would be to have tao_ImR ask for both the
+POA and the object, and then create the POA hierarchy to generate an IOR.
+Doing the generation is this manner (letting the POA create the reference)
+shields us from changes in the IOR generation schemes. Since we are using
+the same code that the server would use, our IORs would be up to date.
+
+It ends up there is an easier way to do this. The Interoperable Naming
+Service is intended to be used in situations where an IOR could be created by
+hand. Using the same information as above, it is not difficult to take the
+endpoint information from the ImR and attach the POA name. For example,
+let's say that we are running the ImR on ringil.ece.uci.edu at port 5000.
+The endpoint would be
+&quot;corbaloc:iiop:1.2@ringil.ece.uci.edu:5000&quot;. If we are
+creating an IOR for the nestea server, we'd just need to attach
+&quot;/nestea_server&quot; to the end of the endpoint. Now we have an
+IOR.
+
+So what does this mean for the server?
+
+The main issue here is that the server must be changed to support the
+simplified name. This can be done by using the IORTable like this:
+
+<CODE>
+ CORBA::Object_var table_object =
+ this->orb_->resolve_initial_references ("IORTable",
+ ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+
+ IORTable::Table_var adapter =
+ IORTable::Table::_narrow (table_object.in (), ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil (adapter.in ()))
+ {
+ ACE_ERROR ((LM_ERROR, "Nil IORTable\n"));
+ }
+ else
+ {
+ adapter->bind (poa_name, server_str.in (), ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+ }
+</CODE>
+
+These lines, as taken from the nestea_server example, just uses the same
+poa_name as registered with the ImR and associates it with the server_obj
+object in the IOR table. Because the ImR will be able to handle the
+simplified name (if it uses the POA name scheme) then this IOR will work.
+
+Just one more thing, each object that needs an IOR needs to be registered
+with the IOR table. But this raises the problem of uniqueness; they all
+can't have the same name. The ImR will actually only look at the name part
+of the simplified IOR up to the first &quot;/&quot;. So both
+&quot;corbaloc:iiop:1.2@ringil:5000/nestea_server/foo&quot; and
+&quot;corbaloc:iiop:1.2@ringil:5000/nestea_server/bar&quot; will be treated by
+the ImR as objects in the &quot;nestea_server&quot; server.
+
+@subsection persistence Persistent Implementation Repository
+
+Tao's Implementation Repository can be made persistent by doing two things:
+
+<ul>
+<li>
+Always start up the Implementation Repository on the same port. This ensures that
+the Implementation Repository will not have to re-ImR-ify the IORs of every server
+registered to it each time it starts up. The way to accomplish this is to add<br>
+-ORBEndpoint iiop://(hostname):(portnumber)<br>
+
+ to the ImR_Activator's startup command line. The host
+name can be obtained portably in C++ code with the lines<br>
+
+ ACE_INET_addr ad;<br>
+ char *hostname = ad.get_host_name ();<br>
+
+or in a Perl script by adding<br>
+
+ use Sys::Hostname;<br>
+ $hostname = hostname();<br>
+
+There are even specific port numbers, assigned to the OMG by the IANA,
+which can be used for this purpose. They are 683 (for IIOP) and 684
+(for IIOP over SSL). For more information about this, see
+<a href="http://www.iana.org/">http://www.iana.org/</a>
+and <a href="http://www.isi.edu/in-notes/iana/assignments/port-numbers">
+http://www.isi.edu/in-notes/iana/assignments/port-numbers</a>.<br><br>
+<li>
+Pass the ImR a filename to use for the backing store, specified by the
+command line option<br>
+
+-p (filename)<br>
+
+This option must be used the first and every subsequent time the
+persistent ImR is started up.
+
+</ul>
+*/
+
+/**
+@page ntservice Running as an NT service
+
+The ImplRepo_Service.exe can now also function as a Windows NT
+Service. The -c option can be used to install and remove the service
+(this requires Administrator access on the machine).
+
+@note When using the ImplRepo_Service as a service, it must have all
+of its required ACE/TAO DLL's in the path or in the same directory.
+For example, the run_test.pl copies ImplRepo_Service.exe to the
+ACE_wrappers@\bin directory before using "-c install".
+Alternatively, You can set the usual ACE_ROOT, TAO_ROOT, and PATH environment
+variables on a system wide basis.
+
+The service can be then started either from the Windows NT "Services"
+Admin Tool or via the "net" program on the command line:
+
+<CODE>net start "TAO Implementation Repository Locator"</CODE>
+<CODE>net start "TAO Implementation Repository Activator"</CODE>
+
+The Implementation Repository supports start and stop but not pause.
+
+When the Activator is installed using ImR_Activator -c install, it is added
+with a dependency on a locator service. If you don't wish to also install
+the locator on the same machine, then you must use the -c install_no_imr
+option instead.
+
+@subsection serviceopts Service Options
+
+Any options that are specified along with -c install, will be saved in
+the registry under
+HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TAOIMRActivator\Parameters and
+HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TAOIMRLocator\Parameters.
+For example:
+ImR_Activator -c install -d 3 -l -m -o activator.ior -x persist.xml -t 30 -orbendpoint iiop://:9988 -orbdebuglevel 1
+
+The order of arguments makes no difference, but you must run
+-c remove and then -c install if you want to change the parameters.
+
+You can also manually change these using the typical regedit utility.
+
+*/
+
+/**
+@page imrandnaming Naming Service
+
+@subsection lowdown The Short Answer
+
+Register the Naming Service with an Implementation Repository using the
+POA name "NameService". So for example:
+
+<CODE>tao_imr add NameService -c "Naming_Service -ORBUseIMR 1"</CODE>
+
+And then an IOR can be created by:
+
+<CODE>tao_imr ior NameService</CODE>
+
+The above commands depend on multicast (since the commands are shorter and
+easier put in documents). You might need to add "-ORBInitRef
+ImplRepoService=..." for a more robust solution.
+
+@subsection details Various Details
+
+The Naming Service in TAO contains one persistant POA named "NameService".
+If -ORBUseIMR 1 is passed to it, it will communicate with the ImR as any
+other persistent POA does. Also, the Naming Service recognizes the INS
+object key "NameService". This allows you to use the "tao_imr ior"
+command to create corbaloc IORs.
+
+NameService was chosen because resolve_initial_references () uses that
+name. And that allows us to do interesting things with ORBDefaultInitRef
+(as shown in the @ref defaultinitref section).
+
+*/
+
+/**
+@page movefromoldImR Transition from IMR in TAO 1.2.2
+
+
+While the previous version of ImR has a single focal point (ImplRepo_Service)
+for performing all the jobs including receiving various requests,
+maintaining the information about all the servers registered with it
+and actually activating the servers as needed, in the new IMR, we
+distribute the work load between two entities, ImplRepo_Service and
+ImR_Activator, to help achieve the goal of better throughput and load
+balance.
+
+<b>.</b> The added step that you would have to now do is run the
+ImR_Activator. You can just run one instance of it to get the same
+behaviour as you were getting before.
+
+If you run the ImplRepo_Service in multicast mode, the
+ImR_Activator will be able to get access to it via
+multicast. Otherwise, you would have to use one of the reference
+initializing methods to give the ImR_Activator access to the
+ImplRepo_Service.
+
+<b>.</b> As I mentioned before, the previous commandline parameters
+that can be passed to ImplRepoService for the repository purposes will
+now be passed to the ImR_Activator since that is the one that is
+dealing with the database.
+
+*/
diff --git a/TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp b/TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp
new file mode 100644
index 00000000000..91f8d7fa1be
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp
@@ -0,0 +1,66 @@
+// $Id$
+#include "Server_Info.h"
+
+Server_Info::Server_Info
+(
+ const ACE_CString& server_name,
+ const ACE_CString& aname,
+ const ACE_CString& cmdline,
+ const ImplementationRepository::EnvironmentList& env,
+ const ACE_CString& working_dir,
+ ImplementationRepository::ActivationMode amode,
+ int limit,
+ const ACE_CString& partial_ior,
+ const ACE_CString& server_ior,
+ ImplementationRepository::ServerObject_ptr svrobj
+ )
+ : name (server_name)
+ , activator (aname)
+ , cmdline( cmdline)
+ , env_vars (env)
+ , dir (working_dir)
+ , activation_mode (amode)
+ , start_limit (limit)
+ , partial_ior (partial_ior)
+ , ior (server_ior)
+ , server(ImplementationRepository::ServerObject::_duplicate (svrobj))
+ , start_count (0)
+ , waiting_clients (0)
+ , starting (false)
+{
+}
+
+ImplementationRepository::ServerInformation*
+Server_Info::createImRServerInfo (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ImplementationRepository::ServerInformation* info;
+ ACE_NEW_THROW_EX (info, ImplementationRepository::ServerInformation, CORBA::NO_MEMORY ());
+
+ info->server = name.c_str ();
+ info->startup.command_line = cmdline.c_str ();
+ info->startup.environment = env_vars;
+ info->startup.working_directory = dir.c_str ();
+ info->startup.activation = activation_mode;
+ info->startup.activator = activator.c_str ();
+ if (start_count >= start_limit)
+ {
+ info->startup.start_limit = -start_limit;
+ }
+ else
+ {
+ info->startup.start_limit = start_limit;
+ }
+ info->partial_ior = partial_ior.c_str();
+
+ return info;
+}
+
+void
+Server_Info::reset (void)
+{
+ ior = "";
+ partial_ior = "";
+ last_ping = ACE_Time_Value::zero;
+ server = ImplementationRepository::ServerObject::_nil ();
+ // start_count = 0; Note : We can't do this, because it would be reset during startup.
+}
diff --git a/TAO/orbsvcs/ImplRepo_Service/Server_Info.h b/TAO/orbsvcs/ImplRepo_Service/Server_Info.h
new file mode 100644
index 00000000000..e6c3a910f3b
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Server_Info.h
@@ -0,0 +1,77 @@
+//=============================================================================
+/**
+ * @file Server_Info.h
+ *
+ * $Id$
+ *
+ * This class implements the Server_Info for the Implementation Repository.
+ *
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ * @author Priyanka Gontla <gontla_p@ociweb.com>
+ */
+#ifndef SERVER_INFO_H
+#define SERVER_INFO_H
+
+#include "ace/Bound_Ptr.h"
+
+#include "tao/ImR_Client/ImplRepoC.h"
+
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+* @brief Information about IMR registered servers.
+*/
+struct Server_Info
+{
+ Server_Info (const ACE_CString& server_name,
+ const ACE_CString& aname,
+ const ACE_CString& cmdline,
+ const ImplementationRepository::EnvironmentList& env,
+ const ACE_CString& working_dir,
+ ImplementationRepository::ActivationMode amode,
+ int start_limit,
+ const ACE_CString& partial_ior = ACE_CString(""),
+ const ACE_CString& server_ior = ACE_CString(""),
+ ImplementationRepository::ServerObject_ptr svrobj = ImplementationRepository::ServerObject::_nil()
+ );
+
+ /// Convert to the corba type
+ ImplementationRepository::ServerInformation* createImRServerInfo(ACE_ENV_SINGLE_ARG_DECL);
+
+ void reset();
+
+ /// The name of the server.
+ ACE_CString name;
+ /// The name of the activator in which this server runs
+ ACE_CString activator;
+ /// The command line startup command (program and arguments).
+ ACE_CString cmdline;
+ /// Environment Variables.
+ ImplementationRepository::EnvironmentList env_vars;
+ /// The working directory.
+ ACE_CString dir;
+ /// The type of activation this supports.
+ ImplementationRepository::ActivationMode activation_mode;
+ /// Limit of retries to start the server
+ int start_limit;
+ /// Current endpoint used by the server.
+ ACE_CString partial_ior;
+ /// IOR of the server object in the server.
+ ACE_CString ior;
+ /// The timestamp of the last time we verified the server is alive
+ ACE_Time_Value last_ping;
+ /// The cached server object
+ ImplementationRepository::ServerObject_var server;
+ int start_count;
+ int waiting_clients;
+ bool starting;
+};
+
+typedef ACE_Strong_Bound_Ptr<Server_Info, ACE_Null_Mutex> Server_Info_Ptr;
+
+#endif /* SERVER_INFO_H */
diff --git a/TAO/orbsvcs/ImplRepo_Service/activator_export.h b/TAO/orbsvcs/ImplRepo_Service/activator_export.h
new file mode 100644
index 00000000000..fcd22f8ccde
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/activator_export.h
@@ -0,0 +1,54 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl -s Activator
+// ------------------------------
+#ifndef ACTIVATOR_EXPORT_H
+#define ACTIVATOR_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (ACTIVATOR_HAS_DLL)
+# define ACTIVATOR_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && ACTIVATOR_HAS_DLL */
+
+#if !defined (ACTIVATOR_HAS_DLL)
+# define ACTIVATOR_HAS_DLL 1
+#endif /* ! ACTIVATOR_HAS_DLL */
+
+#if defined (ACTIVATOR_HAS_DLL) && (ACTIVATOR_HAS_DLL == 1)
+# if defined (ACTIVATOR_BUILD_DLL)
+# define Activator_Export ACE_Proper_Export_Flag
+# define ACTIVATOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define ACTIVATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* ACTIVATOR_BUILD_DLL */
+# define Activator_Export ACE_Proper_Import_Flag
+# define ACTIVATOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define ACTIVATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* ACTIVATOR_BUILD_DLL */
+#else /* ACTIVATOR_HAS_DLL == 1 */
+# define Activator_Export
+# define ACTIVATOR_SINGLETON_DECLARATION(T)
+# define ACTIVATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* ACTIVATOR_HAS_DLL == 1 */
+
+// Set ACTIVATOR_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (ACTIVATOR_NTRACE)
+# if (ACE_NTRACE == 1)
+# define ACTIVATOR_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define ACTIVATOR_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !ACTIVATOR_NTRACE */
+
+#if (ACTIVATOR_NTRACE == 1)
+# define ACTIVATOR_TRACE(X)
+#else /* (ACTIVATOR_NTRACE == 1) */
+# define ACTIVATOR_TRACE(X) ACE_TRACE_IMPL(X)
+#endif /* (ACTIVATOR_NTRACE == 1) */
+
+#endif /* ACTIVATOR_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/ImplRepo_Service/activator_idl_export.h b/TAO/orbsvcs/ImplRepo_Service/activator_idl_export.h
new file mode 100644
index 00000000000..5ae5cbc5e22
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/activator_idl_export.h
@@ -0,0 +1,54 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl -s Activator
+// ------------------------------
+#ifndef ACTIVATOR_IDL_EXPORT_H
+#define ACTIVATOR_IDL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (ACTIVATOR_IDL_HAS_DLL)
+# define ACTIVATOR_IDL_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && ACTIVATOR_IDL_HAS_DLL */
+
+#if !defined (ACTIVATOR_IDL_HAS_DLL)
+# define ACTIVATOR_IDL_HAS_DLL 1
+#endif /* ! ACTIVATOR_IDL_HAS_DLL */
+
+#if defined (ACTIVATOR_IDL_HAS_DLL) && (ACTIVATOR_IDL_HAS_DLL == 1)
+# if defined (ACTIVATOR_IDL_BUILD_DLL)
+# define ActivatorIDL_Export ACE_Proper_Export_Flag
+# define ACTIVATOR_IDL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define ACTIVATOR_IDL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* ACTIVATOR_IDL_BUILD_DLL */
+# define ActivatorIDL_Export ACE_Proper_Import_Flag
+# define ACTIVATOR_IDL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define ACTIVATOR_IDL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* ACTIVATOR_IDL_BUILD_DLL */
+#else /* ACTIVATOR_IDL_HAS_DLL == 1 */
+# define ActivatorIDL_Export
+# define ACTIVATOR_IDL_SINGLETON_DECLARATION(T)
+# define ACTIVATOR_IDL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* ACTIVATOR_IDL_HAS_DLL == 1 */
+
+// Set ACTIVATOR_IDL_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (ACTIVATOR_IDL_NTRACE)
+# if (ACE_NTRACE == 1)
+# define ACTIVATOR_IDL_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define ACTIVATOR_IDL_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !ACTIVATOR_IDL_NTRACE */
+
+#if (ACTIVATOR_IDL_NTRACE == 1)
+# define ACTIVATOR_IDL_TRACE(X)
+#else /* (ACTIVATOR_IDL_NTRACE == 1) */
+# define ACTIVATOR_IDL_TRACE(X) ACE_TRACE_IMPL(X)
+#endif /* (ACTIVATOR_IDL_NTRACE == 1) */
+
+#endif /* ACTIVATOR_IDL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/ImplRepo_Service/locator_export.h b/TAO/orbsvcs/ImplRepo_Service/locator_export.h
new file mode 100644
index 00000000000..8a3584386f1
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/locator_export.h
@@ -0,0 +1,54 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl -s Locator
+// ------------------------------
+#ifndef LOCATOR_EXPORT_H
+#define LOCATOR_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (LOCATOR_HAS_DLL)
+# define LOCATOR_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && LOCATOR_HAS_DLL */
+
+#if !defined (LOCATOR_HAS_DLL)
+# define LOCATOR_HAS_DLL 1
+#endif /* ! LOCATOR_HAS_DLL */
+
+#if defined (LOCATOR_HAS_DLL) && (LOCATOR_HAS_DLL == 1)
+# if defined (LOCATOR_BUILD_DLL)
+# define Locator_Export ACE_Proper_Export_Flag
+# define LOCATOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define LOCATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* LOCATOR_BUILD_DLL */
+# define Locator_Export ACE_Proper_Import_Flag
+# define LOCATOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define LOCATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* LOCATOR_BUILD_DLL */
+#else /* LOCATOR_HAS_DLL == 1 */
+# define Locator_Export
+# define LOCATOR_SINGLETON_DECLARATION(T)
+# define LOCATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* LOCATOR_HAS_DLL == 1 */
+
+// Set LOCATOR_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (LOCATOR_NTRACE)
+# if (ACE_NTRACE == 1)
+# define LOCATOR_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define LOCATOR_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !LOCATOR_NTRACE */
+
+#if (LOCATOR_NTRACE == 1)
+# define LOCATOR_TRACE(X)
+#else /* (LOCATOR_NTRACE == 1) */
+# define LOCATOR_TRACE(X) ACE_TRACE_IMPL(X)
+#endif /* (LOCATOR_NTRACE == 1) */
+
+#endif /* LOCATOR_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/ImplRepo_Service/locator_idl_export.h b/TAO/orbsvcs/ImplRepo_Service/locator_idl_export.h
new file mode 100644
index 00000000000..3016cfc767b
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/locator_idl_export.h
@@ -0,0 +1,54 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl -s Locator
+// ------------------------------
+#ifndef LOCATOR_IDL_EXPORT_H
+#define LOCATOR_IDL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (LOCATOR_IDL_HAS_DLL)
+# define LOCATOR_IDL_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && LOCATOR_IDL_HAS_DLL */
+
+#if !defined (LOCATOR_IDL_HAS_DLL)
+# define LOCATOR_IDL_HAS_DLL 1
+#endif /* ! LOCATOR_IDL_HAS_DLL */
+
+#if defined (LOCATOR_IDL_HAS_DLL) && (LOCATOR_IDL_HAS_DLL == 1)
+# if defined (LOCATOR_IDL_BUILD_DLL)
+# define LocatorIDL_Export ACE_Proper_Export_Flag
+# define LOCATOR_IDL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define LOCATOR_IDL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* LOCATOR_IDL_BUILD_DLL */
+# define LocatorIDL_Export ACE_Proper_Import_Flag
+# define LOCATOR_IDL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define LOCATOR_IDL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* LOCATOR_IDL_BUILD_DLL */
+#else /* LOCATOR_IDL_HAS_DLL == 1 */
+# define LocatorIDL_Export
+# define LOCATOR_IDL_SINGLETON_DECLARATION(T)
+# define LOCATOR_IDL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* LOCATOR_IDL_HAS_DLL == 1 */
+
+// Set LOCATOR_IDL_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (LOCATOR_IDL_NTRACE)
+# if (ACE_NTRACE == 1)
+# define LOCATOR_IDL_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define LOCATOR_IDL_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !LOCATOR_IDL_NTRACE */
+
+#if (LOCATOR_IDL_NTRACE == 1)
+# define LOCATOR_IDL_TRACE(X)
+#else /* (LOCATOR_IDL_NTRACE == 1) */
+# define LOCATOR_IDL_TRACE(X) ACE_TRACE_IMPL(X)
+#endif /* (LOCATOR_IDL_NTRACE == 1) */
+
+#endif /* LOCATOR_IDL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/ImplRepo_Service/repository.xml b/TAO/orbsvcs/ImplRepo_Service/repository.xml
new file mode 100644
index 00000000000..d6b5ab4638a
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/repository.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<ImplementationRepository>
+ <Servers name="test" activator="MYHOST" command_line="mysrv" working_dir="mydir" activation_mode="NORMAL" start_limit="1" partial_ior="" ior="">
+ </Servers>
+ <Servers name="test2" activator="MYHOST" command_line="" working_dir="" activation_mode="NORMAL" start_limit="1" partial_ior="" ior="">
+ </Servers>
+ <Activators name="MYHOST" token="1610927480" ior="IOR:010000002b00000049444c3a496d706c656d656e746174696f6e5265706f7369746f72792f416374697661746f723a312e300000010000000000000090000000010102cd150000004a555354414c49454e2e6f63697765622e636f6d00cd1f083900000014010f004e555000000017000000000100000000496d525f416374697661746f7200000000000100000054414f496d52416374697661746f7200000002000000000000000800000001cdcdcd004f4154010000001400000001cdcdcd01000100000000000901010000000000"/>
+</ImplementationRepository>
diff --git a/TAO/orbsvcs/ImplRepo_Service/tao_imr.cpp b/TAO/orbsvcs/ImplRepo_Service/tao_imr.cpp
new file mode 100644
index 00000000000..45b72a2790a
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/tao_imr.cpp
@@ -0,0 +1,15 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "tao_imr_i.h"
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ TAO_IMR_i tao_imr_i;
+
+ if (tao_imr_i.init (argc, argv) != 0)
+ return 1;
+
+ return tao_imr_i.run ();
+}
diff --git a/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.cpp b/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.cpp
new file mode 100644
index 00000000000..9febb1ae406
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.cpp
@@ -0,0 +1,1111 @@
+// $Id$
+
+#include "tao_imr_i.h"
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/PortableServer/ForwardRequestC.h"
+
+#include "tao/Stub.h"
+#include "tao/Profile.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/OS.h"
+
+TAO_IMR_i::TAO_IMR_i (void)
+: imr_ (ImplementationRepository::Administration::_nil ())
+{
+ // Nothing
+}
+
+TAO_IMR_i::~TAO_IMR_i (void)
+{
+}
+
+int
+TAO_IMR_i::run ()
+{
+ if (this->op_.get () == 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Unknown operation"));
+ return TAO_IMR_Op::UNKNOWN;
+ }
+
+ return this->op_->run ();
+}
+
+int
+TAO_IMR_i::init (int argc, char **argv)
+{
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ const char *exception_message = "Null Message";
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Retrieve the ORB.
+ this->orb_ = CORBA::ORB_init (this->argc_, this->argv_, "tao_imr_i" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Parse command line and verify parameters.
+ if (this->parse_args () == -1)
+ return -1;
+
+ // Get the ImplRepo object
+ CORBA::Object_var obj =
+ orb_->resolve_initial_references ("ImplRepoService" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (obj.in ()))
+ {
+ ACE_ERROR ((LM_ERROR, "Unable to resolve the ImR.\n"));
+ return -1;
+ }
+
+ exception_message = "While narrowing ImR";
+
+ this->imr_ =
+ ImplementationRepository::Administration::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (imr_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR, "Unable to narrow the ImR.\n"));
+ return -1;
+ }
+
+ this->op_->set_imr (this->imr_.in ());
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR ((LM_ERROR, "TAO_IMR_i::init - %s\n", exception_message));
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+
+// Go through and figure out which operation we should do.
+
+int
+TAO_IMR_i::parse_args (void)
+{
+ // Make sure one command was given
+ if (this->argc_ < 2)
+ {
+ ACE_ERROR((LM_ERROR, "Error: No operation specified.\n"));
+ this->print_usage ();
+ return -1;
+ }
+
+ this->op_.reset (TAO_IMR_Op::make_op (this->argv_[1]));
+
+ // Check for unrecognized operation
+
+ if (this->op_.get () == 0)
+ {
+ ACE_ERROR((LM_ERROR, "Error: Unknown operation '%s'.\n", this->argv_[1]));
+ this->print_usage ();
+ return -1;
+ }
+
+ // Adjust argc and argv so only the command specific args are passed
+ return this->op_->parse (this->argc_ - 1, this->argv_ + 1);
+}
+
+
+// Print out information about all operations.
+
+void
+TAO_IMR_i::print_usage (void)
+{
+ ACE_ERROR ((LM_ERROR, "Usage: tao_imr [options] command [command-arguments]\n"
+ " where [options] are ORB options\n"
+ " where command is one of the following:\n"
+ " start Start a server through the ImR\n"
+ " add Add an entry to the ImR\n"
+ " autostart Activates all AUTO_START servers\n"
+ " ior Creates a simplified IOR\n"
+ " list List the entries in the ImR\n"
+ " remove Remove an entry from the ImR\n"
+ " shutdown Shut down a server through the ImR\n"
+ " shutdown-repo Shut down the ImR\n"
+ " update Update an entry in the ImR\n"
+ " where [command-arguments] depend on the command\n"));
+}
+
+
+// Factory for operations
+
+TAO_IMR_Op *
+TAO_IMR_Op::make_op (const ACE_TCHAR *op_name)
+{
+ if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("activate")) == 0)
+ {
+ ACE_ERROR((LM_ERROR, "Warning: The activate option has been renamed to start.\n"));
+ return new TAO_IMR_Op_Activate ();
+ }
+ else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("start")) == 0)
+ return new TAO_IMR_Op_Activate ();
+ else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("add")) == 0)
+ return new TAO_IMR_Op_Register (true);
+ else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("autostart")) == 0)
+ return new TAO_IMR_Op_Autostart();
+ else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("ior")) == 0)
+ return new TAO_IMR_Op_IOR();
+ else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("list")) == 0)
+ return new TAO_IMR_Op_List ();
+ else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("remove")) == 0)
+ return new TAO_IMR_Op_Remove ();
+ else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("shutdown")) == 0)
+ return new TAO_IMR_Op_Shutdown ();
+ else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("shutdown-repo")) == 0)
+ return new TAO_IMR_Op_ShutdownRepo ();
+ else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("update")) == 0)
+ return new TAO_IMR_Op_Register (false);
+
+ return 0;
+}
+
+
+TAO_IMR_Op::~TAO_IMR_Op ()
+{
+ // Nothing
+}
+
+void
+TAO_IMR_Op::set_imr (ImplementationRepository::Administration_ptr imr)
+{
+ this->imr_ = imr;
+}
+
+void
+TAO_IMR_Op::display_server_information (const ImplementationRepository::ServerInformation &info)
+{
+ // Figure out what the activation string is.
+ const char *act = "UNKNOWN STARTUP";
+ if (info.startup.activation == ImplementationRepository::NORMAL)
+ act = "NORMAL";
+ else if (info.startup.activation == ImplementationRepository::MANUAL)
+ act = "MANUAL";
+ else if (info.startup.activation == ImplementationRepository::PER_CLIENT)
+ act = "PER_CLIENT";
+ else if (info.startup.activation == ImplementationRepository::AUTO_START)
+ act = "AUTO_START";
+
+ // Print out information
+ ACE_DEBUG ((LM_DEBUG, "Server <%s>\n", info.server.in ()));
+
+ const char * locked_out = "";
+
+ int limit = info.startup.start_limit;
+ if (info.startup.start_limit < 0)
+ {
+ limit = -limit;
+ locked_out = " Locked Out\n";
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ " Activator: %s\n"
+ " Command Line: %s\n"
+ " Working Directory: %s\n"
+ " Activation Mode: %s\n"
+ " Number of retries: %d\n"
+ "%s",
+ info.startup.activator.in (),
+ info.startup.command_line.in (),
+ info.startup.working_directory.in (),
+ act,
+ limit - 1,
+ locked_out));
+ for (CORBA::ULong i = 0; i < info.startup.environment.length (); ++i)
+ ACE_DEBUG ((LM_DEBUG, "Environment Variable: %s=%s \n",
+ info.startup.environment[i].name.in (),
+ info.startup.environment[i].value.in ()));
+
+ if (info.startup.activation == ImplementationRepository::PER_CLIENT)
+ ACE_DEBUG ((LM_DEBUG,
+ " No running info available for PER_CLIENT mode\n"));
+ else if (ACE_OS::strlen (info.partial_ior.in ()) > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ " Running at endpoint: %s\n",
+ info.partial_ior.in ()));
+ else // I am assuming that a blank partial_ior means currently not running.
+ ACE_DEBUG ((LM_DEBUG,
+ " Not currently running\n"));
+
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+}
+
+TAO_IMR_Op_List::TAO_IMR_Op_List (void)
+: verbose_server_information_ (0)
+{
+ // Nothing
+}
+
+TAO_IMR_Op_Register::TAO_IMR_Op_Register (bool is_add)
+: is_add_ (is_add)
+, set_command_line_ (false)
+, set_environment_vars_(false)
+, set_working_dir_ (false)
+, set_activation_ (false)
+, activation_(ImplementationRepository::NORMAL)
+, set_retry_count_(false)
+, retry_count_ (0)
+, set_activator_ (false)
+{
+ // Nothing
+}
+
+void
+TAO_IMR_Op_Activate::print_usage (void)
+{
+ ACE_ERROR ((LM_ERROR, "Starts a server using its registered Activator.\n"
+ "\n"
+ "Usage: tao_imr [options] start <name>\n"
+ " where [options] are ORB options\n"
+ " where <name> is the name of a registered POA.\n"
+ " -h Displays this\n"));
+}
+
+int
+TAO_IMR_Op_Activate::parse (int argc, ACE_TCHAR **argv)
+{
+ // Check for enough arguments (we need at least one for the server name)
+ if (argc < 2)
+ {
+ this->print_usage ();
+ return -1;
+ }
+
+ // Skip both the program name and the "activate" command
+ ACE_Get_Opt get_opts (argc, argv, "h");
+
+ this->server_name_ = argv[1];
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'h':
+ this->print_usage ();
+ return -1;
+ default:
+ ACE_ERROR((LM_ERROR, "ERROR : Unknown option '%c'\n", (char) c));
+ this->print_usage ();
+ return -1;
+ }
+ }
+ return 0;
+}
+
+void
+TAO_IMR_Op_Autostart::print_usage (void)
+{
+ ACE_ERROR ((LM_ERROR, "Usage: tao_imr [options] autostart\n"
+ " where [options] are ORB options\n"
+ " -h Displays this\n"));
+}
+
+int
+TAO_IMR_Op_Autostart::parse (int argc, ACE_TCHAR **argv)
+{
+ // Skip the "autostart" command
+ ACE_Get_Opt get_opts (argc, argv, "h");
+
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'h': // display help
+ this->print_usage ();
+ return -1;
+ default:
+ ACE_ERROR((LM_ERROR, "ERROR : Unknown option '%c'\n", (char) c));
+ this->print_usage ();
+ return -1;
+ }
+ }
+ return 0;
+}
+
+void
+TAO_IMR_Op_IOR::print_usage (void)
+{
+ ACE_ERROR ((LM_ERROR, "Creates an IOR for a server that is registered with the IMR and uses\n"
+ "the InterOperable Naming Service. Please see the documentation for\n"
+ "more information on which server configurations work with this command.\n"
+ "\n"
+ "Usage: tao_imr [options] ior <object_key> [command-arguments]\n"
+ " where [options] are ORB options\n"
+ " where <object_key> matches the simple key bound in the server IORTable.\n"
+ " where [command-arguments] can be\n"
+ " -f filename filename to output the IOR to\n"
+ " -h Displays this\n"));
+}
+
+int
+TAO_IMR_Op_IOR::parse (int argc, ACE_TCHAR **argv)
+{
+ // Check for enough arguments (we need at least one for the server name)
+ if (argc < 2)
+ {
+ this->print_usage ();
+ return -1;
+ }
+
+ // Skip both the program name and the "ior" command
+ ACE_Get_Opt get_opts (argc, argv, "hf:");
+
+ this->server_name_ = argv[1];
+ if (this->server_name_.length() == 0 || this->server_name_[0] == '-')
+ {
+ ACE_ERROR((LM_ERROR, "ERROR : name is required.\n"));
+ this->print_usage ();
+ return -1;
+ }
+
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f': // File name
+ this->filename_ = get_opts.opt_arg ();
+ break;
+ case 'h': // display help
+ this->print_usage ();
+ return -1;
+ default:
+ ACE_ERROR((LM_ERROR, "ERROR : Unknown option '%c'\n", (char) c));
+ this->print_usage ();
+ return -1;
+ }
+ }
+ return 0;
+}
+
+void
+TAO_IMR_Op_List::print_usage (void)
+{
+ ACE_ERROR ((LM_ERROR, "Lists all or one of the servers in the Implementation Repository\n"
+ "\n"
+ "Usage: tao_imr [options] list [name] [command-arguments]\n"
+ " where [options] are ORB options\n"
+ " where [name] is the optional server name to search for\n"
+ " where [command-arguments] can be\n"
+ " -v Verbose: Displays more info for each server when\n"
+ " displaying more than one server\n"
+ " -h Displays this\n"));
+}
+
+int
+TAO_IMR_Op_List::parse (int argc, ACE_TCHAR **argv)
+{
+ int server_flag = 0;
+
+ if (argc > 1 && argv[1][0] != '-')
+ {
+ this->server_name_ = argv[1];
+ server_flag = 2;
+ }
+
+ // Skip both the program name and the "list" command
+ ACE_Get_Opt get_opts (argc, argv, "vh", server_flag);
+
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'v': // verbose server display
+ this->verbose_server_information_ = 1;
+ break;
+ case 'h': // display help
+ this->print_usage ();
+ return -1;
+ default:
+ ACE_ERROR((LM_ERROR, "ERROR : Unknown option '%c'\n", (char) c));
+ this->print_usage ();
+ return -1;
+ }
+ }
+ return 0;
+}
+
+void
+TAO_IMR_Op_Remove::print_usage (void)
+{
+ ACE_ERROR ((LM_ERROR, "Removes a server entry\n"
+ "\n"
+ "Usage: tao_imr [options] remove <name>\n"
+ " where [options] are ORB options\n"
+ " where <name> is the POA name used by the server object\n"
+ " -h Displays this\n"));
+}
+
+int
+TAO_IMR_Op_Remove::parse (int argc, ACE_TCHAR **argv)
+{
+ // Check for enough arguments (we need at least one for the server name)
+ if (argc < 2)
+ {
+ this->print_usage ();
+ return -1;
+ }
+
+ // Skip both the program name and the "remove" command
+ ACE_Get_Opt get_opts (argc, argv, "h");
+
+ this->server_name_ = argv[1];
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'h':
+ this->print_usage ();
+ return -1;
+ default:
+ ACE_ERROR((LM_ERROR, "ERROR : Unknown option '%c'\n", (char) c));
+ this->print_usage ();
+ return -1;
+ }
+ }
+ return 0;
+}
+
+void
+TAO_IMR_Op_Shutdown::print_usage (void)
+{
+ ACE_ERROR ((LM_ERROR, "Shuts down a server\n"
+ "\n"
+ "Usage: tao_imr [options] shutdown <name>\n"
+ " where [options] are ORB options\n"
+ " where <name> is the name of the server object\n"
+ " -h Displays this\n"));
+}
+
+int
+TAO_IMR_Op_Shutdown::parse (int argc, ACE_TCHAR **argv)
+{
+ // Check for enough arguments (we need at least one for the server name)
+ if (argc < 2)
+ {
+ this->print_usage ();
+ return -1;
+ }
+
+ // Skip both the program name and the "shutdown" command
+ ACE_Get_Opt get_opts (argc, argv, "h");
+
+ this->server_name_ = argv[1];
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'h':
+ this->print_usage ();
+ return -1;
+ default:
+ ACE_ERROR((LM_ERROR, "ERROR : Unknown option '%c'\n", (char) c));
+ this->print_usage ();
+ return -1;
+ }
+ }
+ return 0;
+}
+
+TAO_IMR_Op_ShutdownRepo::TAO_IMR_Op_ShutdownRepo()
+: activators_(false)
+{
+}
+
+void
+TAO_IMR_Op_ShutdownRepo::print_usage (void)
+{
+ ACE_ERROR ((LM_ERROR, "Shuts down the ImR\n"
+ "\n"
+ "Usage: tao_imr [options] shutdown-repo [-a]\n"
+ " where [options] are ORB options\n"
+ " Specify -a to also shutdown any registered ImR Activators.\n"
+ " -h Displays this\n"));
+}
+
+int
+TAO_IMR_Op_ShutdownRepo::parse (int argc, ACE_TCHAR **argv)
+{
+ // Check for enough arguments (we need at least one for the server name)
+ if (argc < 1)
+ {
+ this->print_usage ();
+ return -1;
+ }
+
+ // Skip both the program name and the "shutdown-repo" command
+ ACE_Get_Opt get_opts (argc, argv, "ha");
+
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'h':
+ this->print_usage ();
+ return -1;
+ case 'a':
+ activators_ = true;
+ break;
+ default:
+ ACE_ERROR((LM_ERROR, "ERROR : Unknown option '%c'\n", (char) c));
+ this->print_usage ();
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+void
+TAO_IMR_Op_Register::addenv (ACE_TCHAR *opt)
+{
+ CORBA::ULong length = this->environment_vars_.length ();
+ // Increase the length of the sequence
+ this->environment_vars_.length (length + 1);
+ ACE_CString tokens (opt);
+ int index = tokens.find ("=");
+ // Insert at position length since that is our new element
+ this->environment_vars_ [length].name =
+ CORBA::string_dup (tokens.substr (0, index).c_str ());
+ this->environment_vars_ [length].value =
+ CORBA::string_dup (tokens.substr (index + 1).c_str ());
+}
+
+void
+TAO_IMR_Op_Register::print_usage (void)
+{
+ ACE_ERROR ((LM_ERROR,
+ "Adds/Updates a server entry\n"
+ "\n"
+ "Usage: tao_imr [options] <add|update> <name> [command-arguments]\n"
+ " where [options] are ORB options\n"
+ " where <name> is the POA name used by the server object\n"
+ " where [command-arguments] can be\n"
+ " -h Displays this\n"
+ " -l Activator name.\n"
+ " -c command Startup command\n"
+ " -w dir Working directory\n"
+ " -e name=value Set environment variables\n"
+ " -a mode Set activate mode (NORMAL|MANUAL|PER_CLIENT|AUTO_START)\n"
+ " -r count Set the startup/ping retry count to count\n"));
+}
+
+int
+TAO_IMR_Op_Register::parse (int argc, ACE_TCHAR **argv)
+{
+ // Check for enough arguments (we need at least one for the server name)
+ if (argc < 2)
+ {
+ ACE_ERROR((LM_ERROR, "Error: Must supply at least a server name.\n"));
+ this->print_usage ();
+ return -1;
+ }
+
+ // Skip both the program name and the "update" command
+ ACE_Get_Opt get_opts (argc, argv, "hc:w:a:e:r:R:l:");
+
+ this->server_name_ = argv[1];
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'c': // Command line arguments
+ this->set_command_line_ = true;
+ this->command_line_ = get_opts.opt_arg ();
+ break;
+ case 'e': // set environment variables
+ this->set_environment_vars_ = true;
+ this->addenv( get_opts.opt_arg () );
+ break;
+ case 'w': // Working Directory
+ this->set_working_dir_ = true;
+ this->working_dir_ = get_opts.opt_arg ();
+ break;
+ case 'a': // Activation Mode
+ this->set_activation_ = true;
+ if (ACE_OS::strcasecmp (get_opts.opt_arg (), "NORMAL") == 0)
+ this->activation_ = ImplementationRepository::NORMAL;
+ else if (ACE_OS::strcasecmp (get_opts.opt_arg (), "MANUAL") == 0)
+ this->activation_ = ImplementationRepository::MANUAL;
+ else if (ACE_OS::strcasecmp (get_opts.opt_arg (), "PER_CLIENT") == 0)
+ this->activation_ = ImplementationRepository::PER_CLIENT;
+ else if (ACE_OS::strcasecmp (get_opts.opt_arg (), "AUTO_START") == 0)
+ this->activation_ = ImplementationRepository::AUTO_START;
+ else
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unknown Activation Mode <%s>.\n",
+ get_opts.opt_arg ()),
+ -1);
+ break;
+ case 'r':
+ case 'R': // startup/ping Retry Count
+ {
+ this->set_retry_count_ = true;
+ int rc = ACE_OS::atoi(get_opts.optarg);
+ if (rc > 0)
+ this->retry_count_ = rc;
+ }
+ break;
+ case 'l': /// hostname of the activator
+ this->activator_ = get_opts.optarg;
+ this->set_activator_ = true;
+ break;
+ case 'h': // display help
+ this->print_usage ();
+ return -1;
+ default:
+ ACE_ERROR((LM_ERROR, "ERROR : Unknown option '%c'\n", (char) c));
+ this->print_usage ();
+ return -1;
+ }
+ }
+ return 0;
+}
+
+
+// ============================================================================
+// = Run methods
+
+
+int
+TAO_IMR_Op_Activate::run (void)
+{
+ ACE_ASSERT(! CORBA::is_nil(imr_));
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->imr_->activate_server (this->server_name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG,
+ "Successfully Activated server <%s>\n",
+ this->server_name_.c_str ()));
+ }
+ ACE_CATCH (ImplementationRepository::CannotActivate, ex)
+ {
+ ACE_ERROR ((LM_ERROR, "Cannot activate server <%s>, reason: <%s>\n",
+ this->server_name_.c_str (),
+ ex.reason.in ()));
+ return TAO_IMR_Op::CANNOT_ACTIVATE;
+ }
+ ACE_CATCH (ImplementationRepository::NotFound, ex)
+ {
+ ACE_ERROR ((LM_ERROR, "Could not find server <%s>.\n", this->server_name_.c_str ()));
+ return TAO_IMR_Op::NOT_FOUND;
+ }
+ ACE_CATCH (PortableServer::ForwardRequest, ex)
+ {
+ ACE_RE_THROW;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Activating Server");
+ return TAO_IMR_Op::UNKNOWN;
+ }
+ ACE_ENDTRY;
+
+ return TAO_IMR_Op::NORMAL;
+}
+
+int
+TAO_IMR_Op_Autostart::run (void)
+{
+ ACE_ASSERT(! CORBA::is_nil (imr_));
+
+ ImplementationRepository::ServerInformationList_var server_list;
+ ImplementationRepository::ServerInformationIterator_var server_iter;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->imr_->list (0,
+ server_list,
+ server_iter
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT(CORBA::is_nil (server_iter.in ()));
+
+ CORBA::ULong len = server_list->length ();
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ ACE_TRY_EX (inside)
+ {
+ this->imr_->activate_server (server_list[i].server.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (inside);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, server_list[i].server.in ());
+ // Ignore exception
+ }
+ ACE_ENDTRY;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "autostart");
+ return TAO_IMR_Op::UNKNOWN;
+ }
+ ACE_ENDTRY;
+
+ return TAO_IMR_Op::NORMAL;
+}
+
+int
+TAO_IMR_Op_IOR::run (void)
+{
+ ACE_ASSERT (! CORBA::is_nil(imr_));
+
+ // Create a corbaloc string
+ // Todo : Most of this logic duplicates that in the POA.cpp
+ ACE_TRY_NEW_ENV
+ {
+ if (CORBA::is_nil (this->imr_)
+ || !this->imr_->_stubobj ()
+ || !this->imr_->_stubobj ()->profile_in_use ())
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("Invalid ImR IOR.\n")
+ ), -1);
+ }
+
+ CORBA::String_var imr_str =
+ this->imr_->_stubobj ()->
+ profile_in_use ()->to_string (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Search for "corbaloc:" alone, without the protocol. This code
+ // should be protocol neutral.
+ const char corbaloc[] = "corbaloc:";
+ char *pos = ACE_OS::strstr (imr_str.inout (), corbaloc);
+
+ if (pos == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Could not parse IMR IOR.\n"), -1);
+ }
+ else
+ {
+ pos = ACE_OS::strchr (pos + sizeof (corbaloc), ':');
+ pos = ACE_OS::strchr (pos + 1,
+ this->imr_->_stubobj ()->profile_in_use ()->object_key_delimiter ());
+
+ if (pos)
+ {
+ *(pos + 1) = 0; // Crop the string
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Could not parse IMR IOR.\n"), -1);
+ }
+ }
+ ACE_CString ior (imr_str.in ());
+
+ // Add the key
+ ior += this->server_name_;
+
+ ACE_DEBUG ((LM_DEBUG, "%s\n", ior.c_str ()));
+
+ if (this->filename_.length () > 0)
+ {
+ FILE *file = ACE_OS::fopen (this->filename_.c_str (), "w");
+
+ if (file == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error: Unable to open %s for writing: %p\n",
+ this->filename_.c_str ()),
+ -1);
+ }
+
+ ACE_OS::fprintf (file, "%s", ior.c_str ());
+ ACE_OS::fclose (file);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "IOR");
+ return TAO_IMR_Op::UNKNOWN;
+ }
+ ACE_ENDTRY;
+
+ return TAO_IMR_Op::NORMAL;
+}
+
+int
+TAO_IMR_Op_List::run (void)
+{
+ ACE_ASSERT (! CORBA::is_nil(imr_));
+
+ ImplementationRepository::ServerInformationList_var server_list;
+ ImplementationRepository::ServerInformationIterator_var server_iter;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // If there is a server name, list only that server. Otherwise, look
+ // at all of them.
+ if (this->server_name_.length () == 0)
+ {
+ this->imr_->list (0,
+ server_list.out(),
+ server_iter.out()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (server_list->length() == 0)
+ {
+ ACE_DEBUG((LM_DEBUG, "No servers found.\n"));
+ return TAO_IMR_Op::NORMAL;
+ }
+
+ for (CORBA::ULong i = 0; i < server_list->length (); i++)
+ this->display_server_information (server_list[i]);
+
+ ACE_ASSERT (CORBA::is_nil (server_iter.in ()));
+ }
+ else
+ {
+ ImplementationRepository::ServerInformation_var si;
+
+ this->imr_->find (this->server_name_.c_str (), si ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->verbose_server_information_ = 1;
+
+ this->display_server_information (si.in ());
+ }
+ }
+ ACE_CATCH (ImplementationRepository::NotFound, ex)
+ {
+ ACE_ERROR ((LM_ERROR, "Could not find server <%s>.\n", this->server_name_.c_str ()));
+ return TAO_IMR_Op::NOT_FOUND;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "List");
+ return TAO_IMR_Op::UNKNOWN;
+ }
+ ACE_ENDTRY;
+
+ return TAO_IMR_Op::NORMAL;
+}
+
+int
+TAO_IMR_Op_Remove::run (void)
+{
+ ACE_ASSERT (! CORBA::is_nil(imr_));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->imr_->remove_server (this->server_name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Successfully removed server <%s>\n",
+ this->server_name_.c_str ()));
+ }
+ ACE_CATCH (ImplementationRepository::NotFound, ex)
+ {
+ ACE_ERROR ((LM_ERROR, "Could not find server <%s>.\n",
+ this->server_name_.c_str ()));
+ return TAO_IMR_Op::NOT_FOUND;
+ }
+ ACE_CATCH (CORBA::NO_PERMISSION, ex)
+ {
+ ACE_ERROR ((LM_ERROR, "No Permission: ImplRepo is in Locked mode\n"));
+ return TAO_IMR_Op::NO_PERMISSION;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Removing Server");
+ return TAO_IMR_Op::UNKNOWN;
+ }
+ ACE_ENDTRY;
+
+ return TAO_IMR_Op::NORMAL;
+}
+
+int
+TAO_IMR_Op_Shutdown::run (void)
+{
+ ACE_ASSERT (! CORBA::is_nil(imr_));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->imr_->shutdown_server (this->server_name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Successfully shut down server <%s>\n",
+ this->server_name_.c_str ()));
+ }
+ ACE_CATCH (ImplementationRepository::NotFound, ex)
+ {
+ ACE_ERROR ((LM_ERROR, "Server <%s> already shut down.\n", this->server_name_.c_str ()));
+ return TAO_IMR_Op::NOT_FOUND;
+ }
+ ACE_CATCH(CORBA::TIMEOUT, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Timeout waiting for <%s> to shutdown.\n",
+ this->server_name_.c_str ()));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Shutting Down Server");
+ return TAO_IMR_Op::UNKNOWN;
+ }
+ ACE_ENDTRY;
+
+ return TAO_IMR_Op::NORMAL;
+}
+
+int
+TAO_IMR_Op_ShutdownRepo::run (void)
+{
+ ACE_ASSERT(! CORBA::is_nil(imr_));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ bool servers = false; // not implemented yet, if ever
+ this->imr_->shutdown (activators_, servers ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "ImR shutdown initiated.\n"));
+ }
+ ACE_CATCH(CORBA::TIMEOUT, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Timeout waiting for ImR shutdown.\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Shutting Down ImR");
+ return TAO_IMR_Op::UNKNOWN;
+ }
+ ACE_ENDTRY;
+
+ return TAO_IMR_Op::NORMAL;
+}
+
+int
+TAO_IMR_Op_Register::run (void)
+{
+ ACE_ASSERT (! CORBA::is_nil(imr_));
+
+ ImplementationRepository::ServerInformation_var server_information;
+ ImplementationRepository::StartupOptions local;
+ ImplementationRepository::StartupOptions* options = NULL;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->imr_->find(this->server_name_.c_str (),
+ server_information.out() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (server_name_ == server_information->server.in())
+ {
+ if (is_add_)
+ {
+ ACE_DEBUG((LM_DEBUG, "Server <%s> already registered.\n", this->server_name_.c_str ()));
+ return ALREADY_REGISTERED;
+ }
+ options = &server_information->startup;
+ }
+ else // not found
+ {
+ if (!is_add_)
+ {
+ ACE_DEBUG((LM_DEBUG, "Adding Server <%s> on update command.\n", this->server_name_.c_str ()));
+ is_add_ = true;
+ }
+ options = &local;
+ }
+
+ if (this->set_command_line_)
+ options->command_line = CORBA::string_dup (this->command_line_.c_str ());
+
+ if (this->set_environment_vars_)
+ options->environment = this->environment_vars_;
+
+ if (this->set_working_dir_)
+ options->working_directory = CORBA::string_dup (this->working_dir_.c_str ());
+
+ if (this->set_activation_ || is_add_)
+ options->activation = this->activation_;
+
+ if (this->set_retry_count_ || is_add_)
+ options->start_limit = this->retry_count_ + 1;
+
+ if (this->set_activator_)
+ options->activator = CORBA::string_dup(this->activator_.c_str ());
+ // If the command line is set, we must have an activator
+ else if (this->set_command_line_ &&
+ (options->activator.in () == 0 || *options->activator.in () == 0))
+ {
+ char host_name[MAXHOSTNAMELEN + 1];
+ ACE_OS::hostname (host_name, MAXHOSTNAMELEN);
+ options->activator = CORBA::string_dup (host_name);
+ ACE_DEBUG ((LM_DEBUG, "Updating Server <%s> with default activator of <%s>.\n",
+ this->server_name_.c_str (), options->activator.in ()));
+ }
+
+ this->imr_->add_or_update_server (this->server_name_.c_str (), *options ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "Successfully registered <%s>.\n", this->server_name_.c_str ()));
+ }
+ ACE_CATCH (CORBA::NO_PERMISSION, ex)
+ {
+ ACE_ERROR ((LM_ERROR, "No Permission: ImplRepo is in Locked mode\n"));
+ return TAO_IMR_Op::NO_PERMISSION;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Updating server");
+ return TAO_IMR_Op::UNKNOWN;
+ }
+ ACE_ENDTRY;
+
+ return TAO_IMR_Op::NORMAL;
+}
+
+// ============================================================================
+// = Display Server Information methods
+
+void
+TAO_IMR_Op_List::display_server_information (const ImplementationRepository::ServerInformation &info)
+{
+ if (this->verbose_server_information_)
+ TAO_IMR_Op::display_server_information (info);
+ else
+ ACE_DEBUG ((LM_DEBUG, "<%s>\n", info.server.in ()));
+}
diff --git a/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.h b/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.h
new file mode 100644
index 00000000000..df728e7002e
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.h
@@ -0,0 +1,322 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file tao_imr_i.h
+ *
+ * $Id$
+ *
+ * This class implements the Implementation Repository helper application.
+ *
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+#ifndef TAO_IMR_I_H
+#define TAO_IMR_I_H
+
+#include "tao/ImR_Client/ImplRepoC.h"
+#include "tao/corba.h"
+#include "ace/SString.h"
+#include "ace/Auto_Ptr.h"
+
+// Forward Declaration
+class TAO_IMR_Op;
+
+/**
+ * @class TAO_IMR_i
+ *
+ * @brief TAO's command line helper application
+ *
+ * This class talks to the IMR and registers/lists/etc.
+ */
+class TAO_IMR_i
+{
+public:
+
+ // = Constructor and destructor.
+ TAO_IMR_i (void);
+ ~TAO_IMR_i (void);
+
+ /// Execute client code.
+ int run (void);
+
+ /// Initialize the client communication endpoint with server.
+ int init (int argc, char **argv);
+
+private:
+ /// Print out information about all operations.
+ void print_usage (void);
+
+ /// Parses the arguments passed on the command line.
+ int parse_args (void);
+
+ /// # of arguments on the command line.
+ int argc_;
+
+ /// Arguments from command line.
+ ACE_TCHAR **argv_;
+
+ /// Remember our orb.
+ CORBA::ORB_var orb_;
+
+ /// Reference to our Locator interface of
+ /// implementation repository.
+ ImplementationRepository::Administration_var imr_;
+
+ /// What we need to do.
+ ACE_Auto_Ptr<TAO_IMR_Op> op_;
+};
+
+
+/**
+ * @class TAO_IMR_Op
+ *
+ * @brief IMR Operation Base Class
+ *
+ * Provides a base class with virtual methods for each operation strategy.
+ */
+class TAO_IMR_Op
+{
+public:
+ enum RETURN_CODES {
+ NORMAL = 0,
+ UNKNOWN,
+ NO_PERMISSION,
+ ALREADY_REGISTERED,
+ CANNOT_ACTIVATE,
+ NOT_FOUND
+ };
+
+ /// Factory.
+ static TAO_IMR_Op *make_op (const ACE_TCHAR *op_name);
+
+ /// Destructor.
+ virtual ~TAO_IMR_Op (void);
+
+ /// Parse arguments.
+ virtual int parse (int argc, ACE_TCHAR **argv) = 0;
+
+ /// Do the work.
+ virtual int run (void) = 0;
+
+ /// Sets the implrepo locator pointer
+ void set_imr (ImplementationRepository::Administration_ptr imr);
+
+protected:
+ /// Reference to our implementation repository.
+ ImplementationRepository::Administration_ptr imr_;
+
+ // = Helper methods
+
+ /// Prints out the information contained in a ServerInformation structure.
+ void display_server_information (const ImplementationRepository::ServerInformation &info);
+};
+
+
+/**
+ * @class TAO_IMR_Op_Activate
+ *
+ * @brief Activation Operation
+ *
+ * Activation is used to start servers via the Implementation Repository
+ */
+class TAO_IMR_Op_Activate : public TAO_IMR_Op
+{
+public:
+ virtual int parse (int argc, ACE_TCHAR **argv);
+ virtual int run (void);
+
+protected:
+ /// Prints a message about the usage
+ void print_usage (void);
+
+ /// POA server name.
+ ACE_CString server_name_;
+};
+
+/**
+ * @class TAO_IMR_Op_Autostart
+ *
+ * @brief Autostart Operation
+ *
+ * Autostart is used to activate all servers with the AUTO_START activation
+ * mode.
+ */
+class TAO_IMR_Op_Autostart : public TAO_IMR_Op
+{
+public:
+ virtual int parse (int argc, ACE_TCHAR **argv);
+ virtual int run (void);
+
+protected:
+ /// Prints a message about the usage
+ void print_usage (void);
+};
+
+
+/**
+ * @class TAO_IMR_Op_IOR
+ *
+ * @brief IOR Operation
+ *
+ * IOR is used to create a simple IOR for a server that uses the
+ * IMR and the Interoperable Naming Service.
+ */
+class TAO_IMR_Op_IOR : public TAO_IMR_Op
+{
+public:
+ virtual int parse (int argc, ACE_TCHAR **argv);
+ virtual int run (void);
+
+protected:
+ /// Prints a message about the usage
+ void print_usage (void);
+
+ /// POA server name.
+ ACE_CString server_name_;
+
+ /// Filename to output to.
+ ACE_CString filename_;
+};
+
+
+/**
+ * @class TAO_IMR_Op_List
+ *
+ * @brief List Operation
+ *
+ * List is used to either list all the servers registered in the IMR or just
+ * look at one of them.
+ */
+class TAO_IMR_Op_List : public TAO_IMR_Op
+{
+public:
+ TAO_IMR_Op_List (void);
+
+ virtual int parse (int argc, ACE_TCHAR **argv);
+ virtual int run (void);
+
+protected:
+ /// Prints a message about the usage
+ void print_usage (void);
+
+ /// POA server name.
+ ACE_CString server_name_;
+
+ /// If true, more server information is displayed.
+ int verbose_server_information_;
+
+ /// Prints out the information contained in a ServerInformation structure.
+ /// Specialized to only print server information
+ void display_server_information (const ImplementationRepository::ServerInformation &info);
+};
+
+
+/**
+ * @class TAO_IMR_Op_Remove
+ *
+ * @brief Remove Operation
+ *
+ * Remove is used to unregister a server in the IMR.
+ */
+class TAO_IMR_Op_Remove : public TAO_IMR_Op
+{
+public:
+ virtual int parse (int argc, ACE_TCHAR **argv);
+ virtual int run (void);
+
+protected:
+ /// Prints a message about the usage
+ void print_usage (void);
+
+ ACE_CString server_name_;
+};
+
+
+/**
+ * @class TAO_IMR_Op_Shutdown
+ *
+ * @brief Shutdown Operation
+ *
+ * Shutdown is used to shutdown a server through the IMR.
+ */
+class TAO_IMR_Op_Shutdown : public TAO_IMR_Op
+{
+public:
+ virtual int parse (int argc, ACE_TCHAR **argv);
+ virtual int run (void);
+
+protected:
+ /// Prints a message about the usage
+ void print_usage (void);
+
+ ACE_CString server_name_;
+};
+
+/**
+ * Shutdown the ImR and optionally any registered activators.
+ */
+class TAO_IMR_Op_ShutdownRepo : public TAO_IMR_Op
+{
+public:
+ TAO_IMR_Op_ShutdownRepo();
+ virtual int parse (int argc, ACE_TCHAR **argv);
+ virtual int run (void);
+
+protected:
+ void print_usage (void);
+
+ bool activators_;
+};
+
+/**
+ * @class TAO_IMR_Op_Register
+ *
+ * @brief Register Operation
+ *
+ * Register is used to update/add information for a server
+ * with the IMR.
+ */
+class TAO_IMR_Op_Register : public TAO_IMR_Op
+{
+public:
+ TAO_IMR_Op_Register(bool is_add);
+
+ virtual int parse (int argc, ACE_TCHAR **argv);
+ virtual int run (void);
+
+protected:
+
+ /// Enables pre-registration checks
+ bool is_add_;
+
+ /// Sets one environment variable.
+ void addenv (ACE_TCHAR *opt);
+
+ /// Prints a message about the usage.
+ void print_usage (void);
+
+ /// POA server name.
+ ACE_CString server_name_;
+
+ bool set_command_line_;
+ ACE_CString command_line_;
+
+ bool set_environment_vars_;
+ ImplementationRepository::EnvironmentList environment_vars_;
+
+ bool set_working_dir_;
+ ACE_CString working_dir_;
+
+ bool set_activation_;
+ ImplementationRepository::ActivationMode activation_;
+
+ bool set_retry_count_;
+ int retry_count_;
+
+ bool set_activator_;
+ ACE_CString activator_;
+};
+
+#endif /* TAO_IMR_I_H */
diff --git a/TAO/orbsvcs/ImplRepo_Service/utils.h b/TAO/orbsvcs/ImplRepo_Service/utils.h
new file mode 100644
index 00000000000..2e4effd55b9
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/utils.h
@@ -0,0 +1,98 @@
+//$Id$
+#ifndef TAO_IMR_UTILS_H
+#define TAO_IMR_UTILS_H
+
+#include "tao/ImR_Client/ImplRepoC.h"
+
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class ImR_Utils {
+public:
+ static ACE_CString activationModeToString(ImplementationRepository::ActivationMode mode)
+ {
+ switch (mode )
+ {
+ case ImplementationRepository::NORMAL:
+ return "NORMAL";
+ case ImplementationRepository::MANUAL:
+ return "MANUAL";
+ case ImplementationRepository::PER_CLIENT:
+ return "PER_CLIENT";
+ case ImplementationRepository::AUTO_START:
+ return "AUTO_START";
+ default:
+ ACE_ASSERT(mode == ImplementationRepository::NORMAL);
+ return "";
+ }
+ }
+ static ImplementationRepository::ActivationMode parseActivationMode(const ACE_CString& s)
+ {
+ if (s == "NORMAL")
+ return ImplementationRepository::NORMAL;
+ if (s == "MANUAL")
+ return ImplementationRepository::MANUAL;
+ if (s == "PER_CLIENT")
+ return ImplementationRepository::PER_CLIENT;
+ if (s == "AUTO_START")
+ return ImplementationRepository::AUTO_START;
+
+ return ImplementationRepository::NORMAL;
+ }
+ static ACE_CString envListToString(const ImplementationRepository::EnvironmentList& lst)
+ {
+ ACE_CString ret;
+ for (CORBA::ULong n = 0; n < lst.length(); ++n)
+ {
+ ret += "name=\"";
+ ret += lst[n].name.in();
+ ret += "\" value=\"";
+ ret += lst[n].value.in();
+ ret += "\"\n";
+ }
+ return ret;
+ }
+ static ImplementationRepository::EnvironmentList parseEnvList(const ACE_CString& s)
+ {
+ ImplementationRepository::EnvironmentList ret(10);
+
+ const ACE_CString NAMETAG = "name=\"";
+ const ACE_CString VALTAG = "value=\"";
+ const ACE_CString ENDTAG = "\"";
+
+ ACE_CString::size_type i = 0;
+
+ for (CORBA::ULong idx = 0; ; ++idx)
+ {
+ // find name
+ ACE_CString::size_type j = s.find(NAMETAG, i);
+ if (j == ACE_CString::npos) break;
+ j += NAMETAG.length();
+ ACE_CString::size_type k = s.find(ENDTAG, j + 1);
+ if (k == ACE_CString::npos) break;
+ ACE_CString name = s.substr(j, k - j);
+
+ i = k + 1;
+
+ // find value
+ j = s.find(VALTAG, i);
+ if (j == ACE_CString::npos) break;
+ j += VALTAG.length();
+ k = s.find(ENDTAG, j + 1);
+ if (k == ACE_CString::npos) break;
+ ACE_CString value = s.substr(j, k - j);
+
+ i = k + 1;
+
+ ret.length(idx + 1);
+ ret[idx].name = name.c_str();
+ ret[idx].value = value.c_str();
+ }
+ return ret;
+ }
+};
+
+#endif
diff --git a/TAO/orbsvcs/LifeCycle_Service/.cvsignore b/TAO/orbsvcs/LifeCycle_Service/.cvsignore
new file mode 100644
index 00000000000..ae8684a2f43
--- /dev/null
+++ b/TAO/orbsvcs/LifeCycle_Service/.cvsignore
@@ -0,0 +1 @@
+LifeCycle_Service
diff --git a/TAO/orbsvcs/LifeCycle_Service/Criteria_Evaluator.cpp b/TAO/orbsvcs/LifeCycle_Service/Criteria_Evaluator.cpp
new file mode 100644
index 00000000000..3e2270c5442
--- /dev/null
+++ b/TAO/orbsvcs/LifeCycle_Service/Criteria_Evaluator.cpp
@@ -0,0 +1,88 @@
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// Criteria_Evaluator.cpp
+//
+// = DESCRIPTION
+// An Evaluator for the CosLifeCycle Criteria
+//
+// = AUTHOR
+// Michael Kircher (mk1@cs.wustl.edu)
+//
+// ============================================================================
+
+#include "Criteria_Evaluator.h"
+#include "ace/OS_NS_string.h"
+
+ACE_RCSID(LifeCycle_Service, Criteria_Evaluator, "$Id$")
+
+Criteria_Evaluator::Criteria_Evaluator (const CosLifeCycle::Criteria &criteria)
+: criteria_ (criteria)
+{
+}
+
+Criteria_Evaluator::~Criteria_Evaluator ()
+{
+}
+
+LifeCycleService::Criteria_Evaluator::SeqNamedValuePair *
+Criteria_Evaluator::getInitialization (ACE_ENV_SINGLE_ARG_DECL)
+{
+ LifeCycleService::Criteria_Evaluator::SeqNamedValuePair *sequence_ptr = 0;
+
+ CORBA::Any *any_ptr =
+ this->getCriteriaMember ("initialization");
+
+ if (any_ptr == 0)
+ ACE_THROW_RETURN (LifeCycleService::Criteria_Evaluator::NotAvailable
+ ("No initialization member found.\n"),
+ 0);
+
+ *any_ptr >>= sequence_ptr;
+
+ return sequence_ptr;
+}
+
+char *
+Criteria_Evaluator::getFilter (ACE_ENV_SINGLE_ARG_DECL)
+{
+ const char* string;
+ CORBA::Any value;
+ CORBA::Any_ptr any_ptr = this->getCriteriaMember ("filter");
+
+ if (any_ptr == 0)
+ ACE_THROW_RETURN (LifeCycleService::Criteria_Evaluator::NotAvailable
+ ("No filter member found.\n"),
+ 0);
+ *any_ptr >>= string;
+ return CORBA::string_dup (string);
+}
+
+CORBA::Any *
+Criteria_Evaluator::getCriteriaMember (const char *member_name)
+{
+ if (!ACE_OS::strcmp(member_name, "initialization")
+ && !ACE_OS::strcmp(member_name, "filter")
+ && !ACE_OS::strcmp(member_name, "logical location")
+ && !ACE_OS::strcmp(member_name, "preferences"))
+ return 0;
+
+ for (u_int i = 0;
+ i < criteria_.length();
+ i++)
+ if (ACE_OS::strcmp (member_name,
+ criteria_[i].name) == 0)
+ {
+ CORBA::Any_ptr value_ptr;
+
+ // @@ We should use ACE_NEW_THROW_EX + ACE_CHECK_RETURN here.
+ ACE_NEW_RETURN (value_ptr,
+ CORBA::Any(criteria_[i].value),
+ 0);
+ return value_ptr;
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/LifeCycle_Service/Criteria_Evaluator.h b/TAO/orbsvcs/LifeCycle_Service/Criteria_Evaluator.h
new file mode 100644
index 00000000000..d170b8fdca1
--- /dev/null
+++ b/TAO/orbsvcs/LifeCycle_Service/Criteria_Evaluator.h
@@ -0,0 +1,57 @@
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// Criteria_Evaluaotr.h
+//
+// = DESCRIPTION
+// An Evaluator for the CosLifeCycle Criteria
+//
+// = AUTHOR
+// Michael Kircher (mk1@cs.wustl.edu)
+//
+// ============================================================================
+
+
+#include "orbsvcs/CosLifeCycleC.h"
+#include "orbsvcs/LifeCycleServiceC.h"
+
+#ifndef CRITERIA_EVALUATOR_H_H
+#define CRITERIA_EVALUATOR_H_H
+
+class Criteria_Evaluator// : public LifeCycleService::Criteria_Evaluator
+{
+ // = TITLE
+ //
+public:
+ Criteria_Evaluator (const CosLifeCycle::Criteria &criteria);
+ ~Criteria_Evaluator (void);
+
+ LifeCycleService::Criteria_Evaluator::SeqNamedValuePair * getInitialization (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+ char * getFilter (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+ LifeCycleService::Criteria_Evaluator::SeqNamedValuePair * getLogicalLocation (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ {
+ return 0;
+ }
+
+ char * getPreferences (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ {
+ return 0;
+ }
+
+private:
+ CORBA::Any *getCriteriaMember (const char *member_name);
+
+ const CosLifeCycle::Criteria &criteria_;
+};
+
+#endif /* CRITERIA_EVALUATOR_H */
+
+
+
+
+
+
diff --git a/TAO/orbsvcs/LifeCycle_Service/Factory_Trader.cpp b/TAO/orbsvcs/LifeCycle_Service/Factory_Trader.cpp
new file mode 100644
index 00000000000..f088231c4f2
--- /dev/null
+++ b/TAO/orbsvcs/LifeCycle_Service/Factory_Trader.cpp
@@ -0,0 +1,234 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+//
+// = FILENAME
+// Factory_Trader.cpp
+//
+// = DESCRIPTION
+// A colocated instance of the Trading Service, only part of
+// the functionality provided is used. This class serves
+// as Wrapper around the Trading Service and provides
+// smaller interfaces.
+// TRADER_AVAILABLE is defined via compiler switch in the Makefile
+//
+// = AUTHOR
+// Michael Kircher (mk1@cs.wustl.edu)
+//
+// ============================================================================
+
+#include "Factory_Trader.h"
+#include "orbsvcs/CosTradingC.h"
+
+ACE_RCSID (LifeCycle_Service,
+ Factory_Trader,
+ "$Id$")
+
+// This const char * is used for adding a new type to the service repository
+// the added types will be subclasses of this.
+const char * Factory_Trader::GENERIC_FACTORY_INTERFACE_REPOSITORY_ID =
+ "IDL:omg.org/CosLifeCycle/GenericFactory:1.0";
+
+
+Factory_Trader::Factory_Trader (int debug_level)
+ : trader_ptr_(0),
+ trading_Components_ptr_ (0),
+ support_Attributes_ptr_(0),
+ debug_level_ (debug_level)
+{
+ ACE_TRY_NEW_ENV
+ {
+ int argc = 0;
+ // create the trader
+ this->trader_ptr_ = TAO_Trader_Factory::create_trader (argc, 0);
+ this->support_Attributes_ptr_ = &(trader_ptr_->support_attributes ());
+ // this pointer is deleted when the trader_ptr is deleted
+ this->trading_Components_ptr_ = &(trader_ptr_->trading_components ());
+ // this pointer is deleted when the trader_ptr is deleted
+
+ // Set the service type repository
+ support_Attributes_ptr_->type_repos
+ (this->repository_._this (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_TRY_CHECK;
+
+ // Add the "Factory" type to the repository
+ this->add_type ();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "LifeCycle Server: (Factory_Trader::Factory_Trader) Failed adding a new type.\n");
+ }
+ ACE_ENDTRY;
+ // @@ ACE_CHECK? No way to pass back any exceptions.
+}
+
+Factory_Trader::~Factory_Trader ()
+{
+ delete this->trader_ptr_;
+}
+
+
+void
+Factory_Trader::add_type ()
+{
+ ACE_TRY_NEW_ENV
+ {
+ // define the new type
+ CosTradingRepos::ServiceTypeRepository::PropStruct propStruct_name;
+ propStruct_name.name = CORBA::string_dup ("name");
+ propStruct_name.value_type = CORBA::_tc_string;
+ propStruct_name.mode = CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY;
+
+ CosTradingRepos::ServiceTypeRepository::PropStruct propStruct_location;
+ propStruct_location.name = CORBA::string_dup ("location");
+ propStruct_location.value_type = CORBA::_tc_string;
+ propStruct_location.mode = CosTradingRepos::ServiceTypeRepository::PROP_NORMAL;
+
+ CosTradingRepos::ServiceTypeRepository::PropStruct propStruct_description;
+ propStruct_description.name = CORBA::string_dup ("description");
+ propStruct_description.value_type = CORBA::_tc_string;
+ propStruct_description.mode = CosTradingRepos::ServiceTypeRepository::PROP_NORMAL;
+
+ CosTradingRepos::ServiceTypeRepository::PropStructSeq propStructSeq(3);
+ propStructSeq.length (3);
+ propStructSeq[0] = propStruct_name;
+ propStructSeq[1] = propStruct_location;
+ propStructSeq[2] = propStruct_description;
+
+ CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq superTypeSeq;
+
+ // Add the new type
+ this->repository_.add_type (CORBA::string_dup("GenericFactory"),
+ GENERIC_FACTORY_INTERFACE_REPOSITORY_ID,
+ propStructSeq,
+ superTypeSeq
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "LifeCycle Server: (Factory_Trader::init).\n");
+ }
+ ACE_ENDTRY;
+ // @@ ACE_CHECK
+}
+
+
+void
+Factory_Trader::_cxx_export (const char * name,
+ const char * location,
+ const char * description,
+ const CORBA::Object_ptr object_ptr)
+{
+ ACE_TRY_NEW_ENV
+ {
+ if (CORBA::is_nil(object_ptr))
+ {
+ ACE_ERROR ((LM_ERROR, "LifeCycle Server (Factory_Trader::export): "
+ "Object pointer is nil, cannot export!\n"));
+ return;
+ }
+
+ CosTrading::PropertySeq propertySeq(3);
+ propertySeq.length (3);
+ propertySeq[0].name = CORBA::string_dup("name");
+ propertySeq[0].value <<= CORBA::string_dup (name);
+ propertySeq[1].name = CORBA::string_dup("location");
+ propertySeq[1].value <<= CORBA::string_dup (location);
+ propertySeq[2].name = CORBA::string_dup("description");
+ propertySeq[2].value <<= CORBA::string_dup (description);
+
+ // get the register interface
+ CosTrading::Register_ptr register_ptr = this->trading_Components_ptr_->register_if ();
+ // this pointer is deleted when the trader_ptr is deleted
+
+ // invoke the export method on the Register interface of the Trading Service
+ register_ptr->_cxx_export (CORBA::Object::_duplicate (object_ptr),
+ CORBA::string_dup("GenericFactory"),
+ propertySeq
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "LifeCycle Server (Factory_Trader::export): "
+ "Failed to export factory.\n");
+ }
+ ACE_ENDTRY;
+ // @@ ACE_CHECK*
+}
+
+
+CORBA::Object_ptr
+Factory_Trader::query (const char* constraint)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CosTrading::Lookup::SpecifiedProps specifiedProps;
+ specifiedProps._d(CosTrading::Lookup::all);
+
+ // Get some pointers for the out parameters of the call.
+ CosTrading::OfferSeq *offerSeq_ptr = 0;
+ CosTrading::OfferIterator_ptr offerIterator_ptr = 0;
+ CosTrading::PolicyNameSeq *policyNameSeq_ptr = 0;
+
+ // An empty policy sequence
+ CosTrading::PolicySeq policySeq;
+
+ // Get a reference to the lookup interface
+ CosTrading::Lookup_ptr lookup_ptr = this->trading_Components_ptr_->lookup_if ();
+ // this pointer is deleted when the trader_ptr is deleted
+
+ // Invoke the query method on the Lookup Interface.
+ lookup_ptr->query ("GenericFactory", // Type name
+ constraint, // Constraint, very important
+ "", // Preferences
+ policySeq, // Policy
+ specifiedProps, // Specified Properties
+ 1, // Number of wanted results
+ CosTrading::OfferSeq_out(offerSeq_ptr), // results
+ CosTrading::OfferIterator_out(offerIterator_ptr), // more results
+ CosTrading::PolicyNameSeq_out(policyNameSeq_ptr) // Policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize
+ CORBA::Object_ptr object_ptr = 0;
+
+ // Check if an offer was made
+ if (offerSeq_ptr != 0)
+ {
+ // Insert the pointer into the out class
+ CosTrading::OfferSeq_var offerSeq_var(offerSeq_ptr);
+
+ // We need at least one offer.
+ if (offerSeq_var->length() >= 1)
+ {
+ // now we are all set to read from the sequence the result
+ object_ptr = CORBA::Object::_duplicate (offerSeq_var[0u].reference.in());
+
+ if (CORBA::is_nil (object_ptr))
+ ACE_ERROR_RETURN ((LM_ERROR,"Factory_Trader::query: Object reference is nil.\n"), 0);
+ else
+ if (this->debug_level_ >= 2)
+ ACE_DEBUG ((LM_DEBUG, "Factory_Trader::query: Received a proper object reference.\n"));
+ }
+ else
+ ACE_ERROR ((LM_ERROR, "Factory_Trader::query: OfferSequence.length is smaller than 1.\n"));
+ }
+ return object_ptr;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Factory_Trader::query: Failed.\n");
+ }
+ ACE_ENDTRY;
+ // @@ ACE_CHECK_RETURN (?)
+ return 0;
+}
diff --git a/TAO/orbsvcs/LifeCycle_Service/Factory_Trader.h b/TAO/orbsvcs/LifeCycle_Service/Factory_Trader.h
new file mode 100644
index 00000000000..ebf8a024d32
--- /dev/null
+++ b/TAO/orbsvcs/LifeCycle_Service/Factory_Trader.h
@@ -0,0 +1,54 @@
+// $Id$
+// ============================================================================
+//
+// = LIBRARY
+//
+// = FILENAME
+// Factory_Trader.cpp
+//
+// = DESCRIPTION
+// Factory Trader for the Generic Factory.
+//
+// = AUTHOR
+// Michael Kircher (mk1@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef FACTORY_TRADER_H
+#define FACTORY_TRADER_H
+
+#include "orbsvcs/Trader/Trader.h"
+#include "orbsvcs/Trader/Service_Type_Repository.h"
+#include "orbsvcs/CosLifeCycleC.h"
+
+
+class Factory_Trader
+{
+public:
+ Factory_Trader (int debug_level = 1);
+ ~Factory_Trader ();
+
+ void add_type ();
+ // Add a the Factory type to the repository
+
+ void _cxx_export (const char * name,
+ const char * location,
+ const char * description,
+ const CORBA::Object_ptr object_ptr);
+ // export a specific factory
+
+ CORBA::Object_ptr query (const char* constraint);
+ // query for a specific factory using a constraint
+
+ static const char * GENERIC_FACTORY_INTERFACE_REPOSITORY_ID;
+private:
+ TAO_Service_Type_Repository repository_;
+ TAO_Trader_Factory::TAO_TRADER *trader_ptr_;
+ TAO_Trading_Components_i *trading_Components_ptr_;
+ TAO_Support_Attributes_i *support_Attributes_ptr_;
+
+ int debug_level_;
+ // debug level (0 = quiet, 1 = default, informative, 2+ = noisy);
+};
+
+#endif // FACTORY_TRADER_H
diff --git a/TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service.cpp b/TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service.cpp
new file mode 100644
index 00000000000..0a3c9a68cf8
--- /dev/null
+++ b/TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service.cpp
@@ -0,0 +1,226 @@
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// Life_Cycle_Service.cpp
+//
+// = DESCRIPTION
+// The server for the LifeCycleService of the quoter example.
+//
+// = AUTHOR
+// Michael Kircher (mk1@cs.wustl.edu)
+//
+// ============================================================================
+
+#include "LifeCycle_Service.h"
+
+#include "ace/Argv_Type_Converter.h"
+#include "ace/OS_main.h"
+
+ACE_RCSID (LifeCycle_Service,
+ LifeCycle_Service,
+ "$Id$")
+
+Life_Cycle_Service_Server::Life_Cycle_Service_Server (void)
+: debug_level_ (1)
+{
+}
+
+Life_Cycle_Service_Server::~Life_Cycle_Service_Server (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Unbind the Factory Finder.
+ CosNaming::Name generic_Factory_Name (2);
+ generic_Factory_Name.length (2);
+ generic_Factory_Name[0].id = CORBA::string_dup ("LifeCycle_Service");
+ this->namingContext_var_->unbind (generic_Factory_Name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "User Exception");
+ }
+ ACE_ENDTRY;
+}
+
+int
+Life_Cycle_Service_Server::init (int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL)
+{
+ int retval = 0;
+
+ // Copy command line parameter.
+ ACE_Argv_Type_Converter command(argc, argv);
+
+ retval = this->orb_manager_.init (command.get_argc(),
+ command.get_ASCII_argv()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (retval == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("%p\n"),
+ ACE_TEXT("init")),
+ -1);
+
+ // Activate the POA manager
+ retval = this->orb_manager_.activate_poa_manager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (retval == -1)
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "activate_poa_manager"), -1);
+
+ ACE_CHECK_RETURN (-1);
+
+ this->parse_args (command.get_argc(), command.get_TCHAR_argv());
+
+ ACE_NEW_RETURN (this->life_Cycle_Service_i_ptr_,
+ Life_Cycle_Service_i(this->debug_level_),
+ -1);
+
+ // Activate the object.
+ CORBA::String_var str =
+ this->orb_manager_.activate (this->life_Cycle_Service_i_ptr_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->debug_level_ >= 2)
+ ACE_DEBUG ((LM_DEBUG, "LifeCycle_Service: IOR is: <%s>\n", ACE_TEXT_CHAR_TO_TCHAR(str.in ())));
+
+ // Register the LifeCycle Service with the Naming Service.
+ ACE_TRY
+ {
+ if (this->debug_level_ >= 2)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("LifeCycle_Service: Trying to get a reference to the Naming Service.\n")));
+
+ // Get the Naming Service object reference.
+ CORBA::Object_var namingObj_var =
+ orb_manager_.orb()->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (namingObj_var.in ()))
+ ACE_ERROR ((LM_ERROR,
+ " LifeCycle_Service: Unable get the Naming Service.\n"));
+
+ // Narrow the object reference to a Naming Context.
+ namingContext_var_ = CosNaming::NamingContext::_narrow (namingObj_var.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (namingContext_var_.in ()))
+ ACE_ERROR ((LM_ERROR,
+ "LifeCycle_Service: Unable get the Naming Service.\n"));
+
+ if (this->debug_level_ >= 2)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("LifeCycle_Service: Have a proper reference to the Naming Service.\n")));
+
+ CosNaming::Name life_Cycle_Service_Name (1);
+ life_Cycle_Service_Name.length (1);
+ life_Cycle_Service_Name[0].id = CORBA::string_dup ("Life_Cycle_Service");
+
+ CORBA::Object_ptr tmp = this->life_Cycle_Service_i_ptr_->_this(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ namingContext_var_->bind (life_Cycle_Service_Name,
+ tmp
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->debug_level_ >= 2)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("LifeCycle_Service: Bound the LifeCycle Service to the Naming Context.\n")));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Life_Cycle_Service_Server::init");
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+
+int
+Life_Cycle_Service_Server::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->debug_level_ >= 1)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("\nLifeCycle Service: Life_Cycle_Service_Server is running\n")));
+
+ orb_manager_.orb()->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+
+// Function get_options.
+
+u_int
+Life_Cycle_Service_Server::parse_args (int argc,
+ ACE_TCHAR* argv[])
+{
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("?d:"));
+ int opt;
+ int exit_code = 0;
+
+ while ((opt = get_opt ()) != EOF)
+ switch (opt)
+ {
+ case 'd': // debug flag.
+ this->debug_level_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+ default:
+ exit_code = 1;
+ ACE_ERROR ((LM_ERROR,
+ "%s: unknown arg, -%c\n",
+ argv[0], char(opt)));
+ case '?':
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("usage: %s")
+ ACE_TEXT(" [-d] <debug level> - Set the debug level\n")
+ ACE_TEXT(" [-?] - Prints this message\n")
+ ACE_TEXT("\n"),
+ argv[0]));
+ ACE_OS::exit (exit_code);
+ break;
+ }
+ return 0;
+}
+
+// function main
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR* argv [])
+{
+ Life_Cycle_Service_Server life_Cycle_Service_Server;
+
+ ACE_TRY_NEW_ENV
+ {
+ int check = life_Cycle_Service_Server.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (check)
+ return 1;
+ else
+ {
+ life_Cycle_Service_Server.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "LifeCycleService::main");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service.h b/TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service.h
new file mode 100644
index 00000000000..35355e5368e
--- /dev/null
+++ b/TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service.h
@@ -0,0 +1,66 @@
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// LifeCycle_Service.h
+//
+// = DESCRIPTION
+// A creation service for objects using the CosLifeCycle GenericFactory.
+//
+// = AUTHOR
+// Michael Kircher (mk1@cs.wustl.edu)
+//
+// ============================================================================
+
+#include "ace/Get_Opt.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Utils/ORB_Manager.h"
+#include "LifeCycle_Service_i.h"
+
+#ifndef LIFECYCLE_SERVICE_H
+#define LIFECYCLE_SERVICE_H
+
+class Life_Cycle_Service_Server
+{
+ // = TILE
+ // Server object for the LifeCycle Service
+
+public:
+ Life_Cycle_Service_Server (void);
+ // Default constructor
+
+ ~Life_Cycle_Service_Server (void);
+ // Destructor
+
+ int init (int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL);
+ // Initialize the Server state - parsing arguments and ...
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the orb.
+
+ u_int parse_args (int argc,
+ ACE_TCHAR* argv[]);
+ // Parse the passed parameters.
+
+private:
+ TAO_ORB_Manager orb_manager_;
+ // instance of the ORB Manager
+
+ Life_Cycle_Service_i *life_Cycle_Service_i_ptr_;
+ // Instance of the creation service
+
+ CosNaming::NamingContext_var namingContext_var_;
+ // reference to the naming service
+
+ int debug_level_;
+ // debug level (0 = quiet, 1 = default, informative, 2+ = noisy);
+};
+
+#endif /* LIFECYCLE_SERVICE_H */
diff --git a/TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service.mpc b/TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service.mpc
new file mode 100644
index 00000000000..6c8727c5070
--- /dev/null
+++ b/TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcsexe, lifecycle, naming, trading_serv, minimum_corba, utils {
+ exename = LifeCycle_Service
+}
diff --git a/TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service_i.cpp b/TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service_i.cpp
new file mode 100644
index 00000000000..a1e011451b8
--- /dev/null
+++ b/TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service_i.cpp
@@ -0,0 +1,172 @@
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// Life_Cycle_Service_i.cpp
+//
+// = DESCRIPTION
+// The implementation of a LifeCycle Service GenericFactory.
+//
+// = AUTHOR
+// Michael Kircher (mk1@cs.wustl.edu)
+//
+// ============================================================================
+
+#include "ace/Get_Opt.h"
+
+#include "orbsvcs/LifeCycleServiceC.h"
+
+#include "LifeCycle_Service_i.h"
+
+ACE_RCSID (LifeCycle_Service,
+ LifeCycle_Service_i,
+ "$Id$")
+
+// Constructor
+Life_Cycle_Service_i::Life_Cycle_Service_i (int debug_level)
+ : factory_trader_ptr_ (0),
+ debug_level_ (debug_level)
+{
+}
+
+// Destructor.
+Life_Cycle_Service_i::~Life_Cycle_Service_i (void)
+{
+}
+
+
+CORBA::Boolean
+Life_Cycle_Service_i::supports (const CosLifeCycle::Key &
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return 0;
+}
+
+CORBA::Object_ptr
+Life_Cycle_Service_i::create_object (const CosLifeCycle::Key &factory_key,
+ const CosLifeCycle::Criteria &the_criteria
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLifeCycle::NoFactory,
+ CosLifeCycle::InvalidCriteria,
+ CosLifeCycle::CannotMeetCriteria))
+{
+ if (this->debug_level_ >= 2)
+ ACE_DEBUG ((LM_DEBUG, "Life_Cycle_Service_i:create_object: called.\n"));
+ // Exceptions are forwarded, not handled !!
+
+ if (factory_trader_ptr_ != 0)
+ {
+ Criteria_Evaluator criteria_Evaluator(the_criteria);
+
+ if (this->debug_level_ >= 2)
+ ACE_DEBUG ((LM_DEBUG, "Life_Cycle_Service_i:create_object: new evaluator.\n"));
+
+ if (this->debug_level_ >= 2)
+ ACE_DEBUG ((LM_DEBUG, "Life_Cycle_Service_i:create_object: getFilter will be called.\n"));
+
+ char* filter = criteria_Evaluator.getFilter (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (this->debug_level_ >= 2)
+ ACE_DEBUG ((LM_DEBUG, "Life_Cycle_Service_i:create_object: query(%s) will be called.\n",filter));
+
+ CORBA::Object_ptr genericFactoryObj_ptr = factory_trader_ptr_->query (filter);
+
+ if (this->debug_level_ >= 2)
+ ACE_DEBUG ((LM_DEBUG, "Life_Cycle_Service_i:create_object: query was called.\n"));
+
+ if (CORBA::is_nil (genericFactoryObj_ptr))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Life_Cycle_Service_i::create_object: Factory is nil!\n"),
+ 0);
+ else // everyting is ok
+ if (this->debug_level_ >= 2)
+ ACE_DEBUG ((LM_DEBUG, "Life_Cycle_Service_i::create_object: Object reference OK.\n"));
+
+ // Now we have a proper reference to a Generic Factory
+ // the create_object call will be forwarded to this factory
+
+
+ // Check if it is a valid Generic Factory reference
+ if (CORBA::is_nil (genericFactoryObj_ptr))
+ ACE_THROW_RETURN (CosLifeCycle::NoFactory (factory_key), 0);
+ else
+ {
+ CosLifeCycle::GenericFactory_var genericFactory_var;
+ ACE_TRY
+ {
+ genericFactory_var =
+ CosLifeCycle::GenericFactory::_narrow (genericFactoryObj_ptr
+ ACE_ENV_ARG_PARAMETER);
+ // ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // see if there is an exception, if yes then throw the
+ // NoFactory exception throw a NoFactory exception
+ ACE_TRY_THROW (CosLifeCycle::NoFactory (factory_key));
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ if (CORBA::is_nil (genericFactory_var.in()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Life_Cycle_Service_i::create_object: Invalid Generic Factory.\n"),
+ 0);
+
+ if (this->debug_level_ >= 2)
+ ACE_DEBUG ((LM_DEBUG, "Life_Cycle_Service_i::create_object: Generic Factory reference OK.\n"));
+
+ // Now retrieve the Object obj ref corresponding to the key.
+ CORBA::Object_var object_var = genericFactory_var->create_object (factory_key,
+ the_criteria
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (this->debug_level_ >= 2)
+ ACE_DEBUG ((LM_DEBUG,
+ "Life_Cycle_Service_i::create_object: Forwarded request.\n"));
+
+ if (CORBA::is_nil (object_var.in()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Life_Cycle_Service_i::create_object: Null object refeference returned by factory.\n"),
+ 0);
+
+ if (this->debug_level_ >= 2)
+ ACE_DEBUG ((LM_DEBUG,
+ "Life_Cycle_Service_i::create_object: Return a object reference to a new object.\n"));
+
+ return CORBA::Object::_duplicate (object_var.in());
+ }
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+void
+Life_Cycle_Service_i::register_factory (const char * name,
+ const char * location,
+ const char * description,
+ CORBA::Object_ptr object
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC (( CORBA::SystemException))
+{
+ if (factory_trader_ptr_ == 0)
+ ACE_NEW (factory_trader_ptr_, Factory_Trader(this->debug_level_));
+ // we have an proper reference to the Factory Trader
+
+ // Just forward the call to the factory trader
+ // Exceptions are not handled here, they are returned
+ factory_trader_ptr_->_cxx_export (name, location, description, object);
+
+ if (this->debug_level_ >= 1)
+ ACE_DEBUG ((LM_DEBUG, "LifeCycle Server: Registered %s\n"
+ " Location: %s\n"
+ " Description: %s\n",
+ name, location, description));
+}
diff --git a/TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service_i.h b/TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service_i.h
new file mode 100644
index 00000000000..2997da242a5
--- /dev/null
+++ b/TAO/orbsvcs/LifeCycle_Service/LifeCycle_Service_i.h
@@ -0,0 +1,73 @@
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// LifeCycle_Service_i.h
+//
+// = DESCRIPTION
+// A Life Cycle Service for the Quoter example.
+//
+// = AUTHOR
+// Michael Kircher (mk1@cs.wustl.edu)
+//
+// ============================================================================
+
+#include "orbsvcs/LifeCycleServiceS.h"
+#include "Factory_Trader.h"
+#include "Criteria_Evaluator.h"
+
+#ifndef LIFECYCLE_SERVICE_IMPL_H
+#define LIFECYCLE_SERVICE_IMPL_H
+
+class Life_Cycle_Service_i : public POA_LifeCycleService::Life_Cycle_Service
+{
+ // = TILE
+ // A CosLifeCycle conforming Generic Factory.
+
+public:
+ Life_Cycle_Service_i (int debug_level = 1);
+ ~Life_Cycle_Service_i (void);
+
+ CORBA::Boolean supports (const CosLifeCycle::Key &factory_key
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Returns true if the Generic Factory is able to forward a request
+ // for creating an object described by the <factory_key>.
+
+ CORBA::Object_ptr create_object (const CosLifeCycle::Key &factory_key,
+ const CosLifeCycle::Criteria &the_criteria
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLifeCycle::NoFactory,
+ CosLifeCycle::InvalidCriteria,
+ CosLifeCycle::CannotMeetCriteria));
+ // Returns an object reference to a newly created object, though the
+ // Generic Factory itself cannot create objects, it will forward the
+ // request to a more concrete Factory.
+
+ void register_factory (const char * name,
+ const char * location,
+ const char * description,
+ CORBA::Object_ptr object
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC (( CORBA::SystemException));
+
+ // Registers a factory with specified properties
+
+private:
+ Factory_Trader *factory_trader_ptr_;
+
+ int debug_level_;
+ // debug level (0 = quiet, 1 = default, informative, 2+ = noisy);
+};
+
+#endif /* LIFECYCLE_SERVICE_IMPL_H */
+
+
+
+
+
+
+
+
diff --git a/TAO/orbsvcs/LifeCycle_Service/Makefile.am b/TAO/orbsvcs/LifeCycle_Service/Makefile.am
new file mode 100644
index 00000000000..1a997b187d7
--- /dev/null
+++ b/TAO/orbsvcs/LifeCycle_Service/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.LifeCycle_Service.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = LifeCycle_Service
+
+LifeCycle_Service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+LifeCycle_Service_SOURCES = \
+ Criteria_Evaluator.cpp \
+ Factory_Trader.cpp \
+ LifeCycle_Service.cpp \
+ LifeCycle_Service_i.cpp \
+ Criteria_Evaluator.h \
+ Factory_Trader.h \
+ LifeCycle_Service.h \
+ LifeCycle_Service_i.h
+
+LifeCycle_Service_LDADD = \
+ $(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)/orbsvcs/orbsvcs/libTAO_CosTrading.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosLifeCycle.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
+
+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/LoadBalancer/.cvsignore b/TAO/orbsvcs/LoadBalancer/.cvsignore
new file mode 100644
index 00000000000..11ebf643a83
--- /dev/null
+++ b/TAO/orbsvcs/LoadBalancer/.cvsignore
@@ -0,0 +1,2 @@
+LoadManager
+LoadMonitor
diff --git a/TAO/orbsvcs/LoadBalancer/LoadBalancer.mpc b/TAO/orbsvcs/LoadBalancer/LoadBalancer.mpc
new file mode 100644
index 00000000000..2574a799cfd
--- /dev/null
+++ b/TAO/orbsvcs/LoadBalancer/LoadBalancer.mpc
@@ -0,0 +1,24 @@
+// -*- MPC -*-
+//
+// $Id$
+
+
+project(LoadManager): namingexe, portableserver, core, iortable, iormanip, loadbalancing {
+ exename = LoadManager
+ requires += ami interceptors
+ Source_Files {
+ LoadManager.cpp
+ Signal_Handler.cpp
+ }
+}
+
+project(LoadMonitor): namingexe, portableserver, core, loadbalancing {
+ requires += ami interceptors
+ exename = LoadMonitor
+ Source_Files {
+ LoadMonitor.cpp
+ Push_Handler.cpp
+ Monitor_Signal_Handler.cpp
+ Signal_Handler.cpp
+ }
+}
diff --git a/TAO/orbsvcs/LoadBalancer/LoadManager.cpp b/TAO/orbsvcs/LoadBalancer/LoadManager.cpp
new file mode 100644
index 00000000000..b95c5ca9c6b
--- /dev/null
+++ b/TAO/orbsvcs/LoadBalancer/LoadManager.cpp
@@ -0,0 +1,310 @@
+#include "Signal_Handler.h"
+
+#include "orbsvcs/LoadBalancing/LB_LoadManager.h"
+
+#include "tao/ORB_Core.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_main.h"
+#include "ace/OS_NS_strings.h"
+
+#include "tao/IORTable/IORTable.h"
+
+#if defined (linux) && defined (ACE_HAS_THREADS)
+# include "ace/Signal.h"
+#endif /* linux && ACE_HAS_THREADS */
+
+
+ACE_RCSID (LoadBalancer,
+ LoadBalancer,
+ "$Id$")
+
+
+static const char * lm_ior_file = "lm.ior";
+
+void
+usage (const ACE_TCHAR * cmd)
+{
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT ("Usage:\n")
+ ACE_TEXT (" %s\n")
+ ACE_TEXT (" -o <ior_output_file>\n")
+ ACE_TEXT (" -s <RoundRobin | Random | LeastLoaded>\n")
+ ACE_TEXT (" -h\n")
+ ACE_TEXT ("\n")
+ ACE_TEXT (" NOTE: Standard default values will be used ")
+ ACE_TEXT ("for \"LeastLoaded\" strategy.\n"),
+ cmd));
+}
+
+void
+parse_args (int argc,
+ ACE_TCHAR *argv[],
+ int & default_strategy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT ("o:s:h"));
+
+ int c = 0;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'o':
+ ::lm_ior_file = get_opts.opt_arg ();
+ break;
+
+ case 's':
+ if (ACE_OS::strcasecmp (get_opts.opt_arg (),
+ "RoundRobin") == 0)
+ default_strategy = 0;
+ else if (ACE_OS::strcasecmp (get_opts.opt_arg (),
+ "Random") == 0)
+ default_strategy = 1;
+ else if (ACE_OS::strcasecmp (get_opts.opt_arg (),
+ "LeastLoaded") == 0)
+ default_strategy = 2;
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Unknown strategy, using RoundRobin\n")));
+ break;
+
+ case 'h':
+ ::usage (argv[0]);
+ ACE_OS::exit (0);
+ break;
+
+ default:
+ ::usage (argv[0]);
+ ACE_THROW (CORBA::BAD_PARAM ());
+ }
+ }
+}
+
+#if defined (linux) && defined (ACE_HAS_THREADS)
+// Only the main thread can handle signals in Linux. Run the
+// LoadManager in thread other than main().
+extern "C"
+void *
+TAO_LB_run_load_manager (void * orb_arg)
+{
+ CORBA::ORB_ptr orb = static_cast<CORBA::ORB_ptr> (orb_arg);
+
+ // Only the main thread should handle signals.
+ //
+ // @@ This is probably unnecessary since no signals should be
+ // delivered to this thread on Linux.
+ ACE_Sig_Guard signal_guard;
+
+ 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,
+ "TAO Load Manager");
+
+ return reinterpret_cast<void *> (-1);
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (reinterpret_cast<void *> (-1));
+
+ return 0;
+}
+#endif /* linux && ACE_HAS_THREADS */
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // The usual server side boilerplate code.
+
+ 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;
+
+ 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;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // "built-in" strategies are the following:
+ // 0 = RoundRobin
+ // 1 = Random
+ // 2 = LeastLoaded
+ int default_strategy = 1;
+
+ // Check the non-ORB arguments.
+ ::parse_args (argc,
+ argv,
+ default_strategy
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_LB_LoadManager * lm = 0;
+ ACE_NEW_THROW_EX (lm,
+ TAO_LB_LoadManager,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_TRY_CHECK;
+
+ PortableServer::ServantBase_var safe_lm = lm;
+
+ // Initalize the LoadManager servant.
+ lm->init (orb->orb_core ()->reactor (),
+ orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableGroup::Properties props (1);
+ props.length (1);
+ props[0].nam.length (1);
+ props[0].nam[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.StrategyInfo");
+
+ CosLoadBalancing::StrategyInfo strategy_info;
+
+ switch (default_strategy)
+ {
+ case 0:
+ strategy_info.name = CORBA::string_dup ("RoundRobin");
+ break;
+ case 1:
+ strategy_info.name = CORBA::string_dup ("Random");
+ break;
+ case 2:
+ strategy_info.name = CORBA::string_dup ("LeastLoaded");
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("ERROR: LoadBalancer internal error.\n")
+ ACE_TEXT (" Unknown built-in strategy.\n")),
+ -1);
+ }
+
+ props[0].val <<= strategy_info;
+
+ lm->set_default_properties (props
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosLoadBalancing::LoadManager_var load_manager =
+ lm->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var str =
+ orb->object_to_string (load_manager.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // to support corbaloc
+ // Get a reference to the IOR table.
+ CORBA::Object_var tobj = orb->resolve_initial_references ("IORTable"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ IORTable::Table_var table = IORTable::Table::_narrow (tobj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // bind your stringified IOR in the IOR table
+ table->bind ("LoadManager", str.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ FILE * lm_ior = ACE_OS::fopen (lm_ior_file, "w");
+ ACE_OS::fprintf (lm_ior, "%s", str.in ());
+ ACE_OS::fclose (lm_ior);
+
+#if defined (linux) && defined (ACE_HAS_THREADS)
+ if (ACE_Thread_Manager::instance ()->spawn (::TAO_LB_run_load_manager,
+ orb.in ()) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ERROR: Unable to spawn TAO LoadManager's "
+ "ORB thread.\n"),
+ -1);
+ }
+
+ ACE_Sig_Set sigset;
+ sigset.sig_add (SIGINT);
+ sigset.sig_add (SIGTERM);
+
+ int signum = -1;
+
+ // Block waiting for the registered signals.
+ if (ACE_OS::sigwait (sigset, &signum) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) %p\n",
+ "ERROR waiting on signal"),
+ -1);
+ }
+
+ ACE_ASSERT (signum == SIGINT || signum == SIGTERM);
+#else
+ // Activate/register the signal handler that (attempts) to
+ // ensure graceful shutdown of the LoadManager so that remote
+ // resources created by the LoadManager can be cleaned up.
+ TAO_LB_Signal_Handler signal_handler (orb.in (), root_poa.in ());
+
+ if (signal_handler.activate () != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error: can't activate LB signal handler, exiting.\n"),
+ -1);
+ }
+
+ // @@ There is a subtle race condition here. If the signal
+ // handler thread shuts down the ORB before it is run, the
+ // below call to ORB::run() will throw a CORBA::BAD_INV_ORDER
+ // exception.
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Wait for the signal handler thread to finish
+ // before the process exits.
+ signal_handler.wait ();
+#endif /* linux && ACE_HAS_THREADS */
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+// ACE_CATCH (PortableGroup::InvalidProperty, ex)
+// {
+// ACE_DEBUG ((LM_DEBUG, "Property ----> %s\n", ex.nam[0].id.in ()));
+// }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO Load Manager");
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/LoadBalancer/LoadMonitor.cpp b/TAO/orbsvcs/LoadBalancer/LoadMonitor.cpp
new file mode 100644
index 00000000000..b0bb0a36701
--- /dev/null
+++ b/TAO/orbsvcs/LoadBalancer/LoadMonitor.cpp
@@ -0,0 +1,417 @@
+#include "Push_Handler.h"
+#include "Monitor_Signal_Handler.h"
+
+#include "orbsvcs/LoadBalancing/LB_CPU_Load_Average_Monitor.h"
+#include "orbsvcs/LoadBalancing/LB_conf.h"
+
+#include "tao/ORB_Core.h"
+
+#include "ace/Reactor.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_main.h"
+#include "ace/OS_NS_strings.h"
+
+
+ACE_RCSID (LoadBalancer,
+ LoadMonitor,
+ "$Id$")
+
+
+static const char * location_id = 0;
+static const char * location_kind = 0;
+static const char * mtype = "CPU";
+static const char * mstyle = "PUSH";
+static const char * custom_monitor_ior = 0;
+
+// For the sake of consistency, make default push monitoring interval
+// the same as the pull monitoring interval.
+static long push_interval = TAO_LB_PULL_HANDLER_INTERVAL;
+
+void
+usage (const ACE_TCHAR * cmd)
+{
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT ("Usage:\n")
+ ACE_TEXT (" %s\n")
+ ACE_TEXT (" -l <location_id>\n")
+ ACE_TEXT (" -k <location_kind>\n")
+ ACE_TEXT (" -t <CPU | Disk | Memory | Network>\n")
+ ACE_TEXT (" -s <PULL | PUSH>\n")
+ ACE_TEXT (" -i <push_interval> (in seconds,")
+ ACE_TEXT (" and requires \"PUSH\" style monitoring)\n")
+ ACE_TEXT (" -m <custom_monitor_ior>")
+ ACE_TEXT (" (overrides \"-t\", \"-l\" and \"-k\")\n")
+ ACE_TEXT (" -h\n")
+ ACE_TEXT ("\n"),
+ cmd));
+}
+
+void
+parse_args (int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL)
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT ("l:k:t:s:i:m:h"));
+
+ int c = 0;
+ const char * s;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'm':
+ ::custom_monitor_ior = get_opts.opt_arg ();
+ break;
+
+ case 'l':
+ ::location_id = get_opts.opt_arg ();
+ break;
+
+ case 'k':
+ ::location_kind = get_opts.opt_arg ();
+ break;
+
+ case 't':
+ ::mtype = get_opts.opt_arg ();
+ break;
+
+ case 's':
+ ::mstyle = get_opts.opt_arg ();
+ break;
+
+ case 'i':
+ s = get_opts.opt_arg ();
+ push_interval = ACE_OS::atoi (s);
+ if (push_interval < 1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("ERROR: Invalid push interval: %s\n"),
+ s));
+
+ ACE_THROW (CORBA::BAD_PARAM ());
+ }
+ break;
+
+ case 'h':
+ ::usage (argv[0]);
+ ACE_OS::exit (0);
+ break;
+
+ default:
+ ::usage (argv[0]);
+ ACE_THROW (CORBA::BAD_PARAM ());
+ }
+ }
+}
+
+#if defined (linux) && defined (ACE_HAS_THREADS)
+// Only the main thread can handle signals in Linux. Run the
+// LoadManager in thread other than main().
+extern "C"
+void *
+TAO_LB_run_load_monitor (void * orb_arg)
+{
+ CORBA::ORB_ptr orb = static_cast<CORBA::ORB_ptr> (orb_arg);
+
+ // Only the main thread should handle signals.
+ //
+ // @@ This is probably unnecessary since no signals should be
+ // delivered to this thread on Linux.
+ ACE_Sig_Guard signal_guard;
+
+ 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,
+ "TAO Load Monitor");
+
+ return reinterpret_cast<void *> (-1);
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (reinterpret_cast<void *> (-1));
+
+ return 0;
+}
+#endif /* linux && ACE_HAS_THREADS */
+
+
+CosLoadBalancing::LoadMonitor_ptr
+get_load_monitor (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr root_poa
+ ACE_ENV_ARG_DECL)
+{
+ if (::custom_monitor_ior != 0)
+ {
+ CORBA::Object_var obj =
+ orb->string_to_object (::custom_monitor_ior
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosLoadBalancing::LoadMonitor::_nil ());
+
+ return CosLoadBalancing::LoadMonitor::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+ else
+ {
+ // The POA is only needed for the built-in load monitors since
+ // they must be activated.
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosLoadBalancing::LoadMonitor::_nil ());
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosLoadBalancing::LoadMonitor::_nil ());
+
+ if (ACE_OS::strcasecmp (::mtype, "CPU") == 0)
+ {
+ TAO_LB_CPU_Load_Average_Monitor * monitor = 0;
+ ACE_NEW_THROW_EX (monitor,
+ TAO_LB_CPU_Load_Average_Monitor (::location_id,
+ ::location_kind),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosLoadBalancing::LoadMonitor::_nil ());
+
+ // Transfer ownership to the POA.
+ PortableServer::ServantBase_var s = monitor;
+
+ return monitor->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ else if (ACE_OS::strcasecmp (::mtype, "Disk") == 0
+ || ACE_OS::strcasecmp (::mtype, "Memory") == 0
+ || ACE_OS::strcasecmp (::mtype, "Network") == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("ERROR: \"%s\" load monitor currently ")
+ ACE_TEXT ("unimplemented.\n"),
+ ::mtype));
+
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
+ CosLoadBalancing::LoadMonitor::_nil ());
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("ERROR: Unrecognized built-in load monitor ")
+ ACE_TEXT ("type: <%s>.\n"),
+ ::mtype));
+
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ CosLoadBalancing::LoadMonitor::_nil ());
+ }
+ }
+}
+
+void
+register_load_monitor (CosLoadBalancing::LoadManager_ptr manager,
+ CosLoadBalancing::LoadMonitor_ptr monitor,
+ TAO_LB_Push_Handler * handler,
+ ACE_Reactor * reactor,
+ long & timer_id
+ ACE_ENV_ARG_DECL)
+{
+ if (ACE_OS::strcasecmp (::mstyle, "PULL") == 0)
+ {
+ PortableGroup::Location_var location =
+ monitor->the_location (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ manager->register_load_monitor (location.in (),
+ monitor
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (ACE_OS::strcasecmp (::mstyle, "PUSH") == 0)
+ {
+ ACE_Time_Value interval (::push_interval, 0);
+ ACE_Time_Value restart (::push_interval, 0);
+ timer_id = reactor->schedule_timer (handler,
+ 0,
+ interval,
+ restart);
+
+ if (timer_id == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("ERROR: Unable to schedule timer for ")
+ ACE_TEXT ("\"PUSH\" style load monitoring.\n")));
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("ERROR: Unrecognized load monitoring ")
+ ACE_TEXT ("style: <%s>.\n"),
+ ::mstyle));
+
+ ACE_THROW (CORBA::BAD_PARAM ());
+ }
+}
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // The usual server side boilerplate code.
+
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Check the non-ORB arguments.
+ ::parse_args (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;
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosLoadBalancing::LoadMonitor_var load_monitor =
+ ::get_load_monitor (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableGroup::Location_var location =
+ load_monitor->the_location (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The "LoadManager" reference should have already been
+ // registered with the ORB by its ORBInitializer.
+ obj = orb->resolve_initial_references ("LoadManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosLoadBalancing::LoadManager_var load_manager =
+ CosLoadBalancing::LoadManager::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This "push" handler will only be used if the load monitor
+ // style is "PUSH".
+ TAO_LB_Push_Handler push_handler (load_monitor.in (),
+ location.in (),
+ load_manager.in ());
+
+ ACE_Reactor * reactor = orb->orb_core ()->reactor ();
+
+ long timer_id = -1;
+
+ ::register_load_monitor (load_manager.in (),
+ load_monitor.in (),
+ &push_handler,
+ reactor,
+ timer_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosLoadBalancing::LoadManager_ptr tmp;;
+
+ if (timer_id == -1)
+ tmp = load_manager.in (); // PULL monitoring
+ else
+ tmp = CosLoadBalancing::LoadManager::_nil (); // PUSH
+ // monitoring
+
+#if defined (linux) && defined (ACE_HAS_THREADS)
+ if (ACE_Thread_Manager::instance ()->spawn (::TAO_LB_run_load_monitor,
+ orb.in ()) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ERROR: Unable to spawn TAO LoadMonitor's "
+ "ORB thread.\n"),
+ -1);
+ }
+
+ ACE_Sig_Set sigset;
+ sigset.sig_add (SIGINT);
+ sigset.sig_add (SIGTERM);
+
+ int signum = -1;
+
+ // Block waiting for the registered signals.
+ if (ACE_OS::sigwait (sigset, &signum) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) %p\n",
+ "ERROR waiting on signal"),
+ -1);
+ }
+
+ ACE_ASSERT (signum == SIGINT || signum == SIGTERM);
+
+ // Deregister the LoadMonitor from the LoadManager in the PULL
+ // load monitoring case.
+ if (timer_id == -1)
+ {
+ load_manager->remove_load_monitor (location.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+#else
+ // Activate/register the signal handler that (attempts) to
+ // ensure graceful shutdown of the LoadMonitor so that
+ // LoadMonitors registered with the LoadManager can be
+ // deregistered.
+ TAO_LB_Monitor_Signal_Handler signal_handler (
+ orb.in (),
+ root_poa.in (),
+ tmp,
+ location.in ());
+
+ if (signal_handler.activate () != 0)
+ return -1;
+
+ // @@ There is a subtle race condition here. If the signal
+ // handler thread shuts down the ORB before it is run, the
+ // below call to ORB::run() will throw a CORBA::BAD_INV_ORDER
+ // exception.
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Wait for the signal handler thread to finish
+ // before the process exits.
+ signal_handler.wait ();
+#endif /* linux && ACE_HAS_THREADS */
+
+ if (timer_id != -1 && reactor->cancel_timer (timer_id) == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("ERROR: Unable to cancel \"push\" load ")
+ ACE_TEXT ("monitoring timer.\n")));
+
+ // Just keep going. We're shutting down anyway.
+ }
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO Load Monitor");
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/LoadBalancer/Makefile.am b/TAO/orbsvcs/LoadBalancer/Makefile.am
new file mode 100644
index 00000000000..4956f9d2aa2
--- /dev/null
+++ b/TAO/orbsvcs/LoadBalancer/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)
+
+bin_PROGRAMS =
+
+## Makefile.LoadManager.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_MINIMUM_CORBA
+
+bin_PROGRAMS += LoadManager
+
+LoadManager_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+LoadManager_SOURCES = \
+ LoadManager.cpp \
+ Signal_Handler.cpp \
+ Signal_Handler.h
+
+LoadManager_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_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_IORTable.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
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_AMI
+
+## Makefile.LoadMonitor.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_MINIMUM_CORBA
+
+bin_PROGRAMS += LoadMonitor
+
+LoadMonitor_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+LoadMonitor_SOURCES = \
+ LoadMonitor.cpp \
+ Monitor_Signal_Handler.cpp \
+ Push_Handler.cpp \
+ Signal_Handler.cpp \
+ Monitor_Signal_Handler.h \
+ Push_Handler.h \
+ Signal_Handler.h
+
+LoadMonitor_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)/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_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
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_INTERCEPTORS
+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/LoadBalancer/Monitor_Signal_Handler.cpp b/TAO/orbsvcs/LoadBalancer/Monitor_Signal_Handler.cpp
new file mode 100644
index 00000000000..3153f62e98a
--- /dev/null
+++ b/TAO/orbsvcs/LoadBalancer/Monitor_Signal_Handler.cpp
@@ -0,0 +1,51 @@
+#include "Monitor_Signal_Handler.h"
+
+
+ACE_RCSID (LoadBalancer,
+ Monitor_Signal_Handler,
+ "$Id$")
+
+
+TAO_LB_Monitor_Signal_Handler::TAO_LB_Monitor_Signal_Handler (
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Location & location)
+ : TAO_LB_Signal_Handler (orb, poa),
+ load_manager_ (CosLoadBalancing::LoadManager::_duplicate (load_manager)),
+ location_ (location)
+{
+}
+
+
+int
+TAO_LB_Monitor_Signal_Handler::perform_cleanup (int signum)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Deregister the LoadMonitor from the LoadManager in the PULL
+ // load monitoring case.
+ if (!CORBA::is_nil (this->load_manager_.in ()))
+ {
+ this->load_manager_->remove_load_monitor (this->location_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception");
+
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Problem during LoadMonitor cleanup "
+ "initiated by signal %d.\n",
+ signum),
+ -1);
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return this->TAO_LB_Signal_Handler::perform_cleanup (signum);
+}
diff --git a/TAO/orbsvcs/LoadBalancer/Monitor_Signal_Handler.h b/TAO/orbsvcs/LoadBalancer/Monitor_Signal_Handler.h
new file mode 100644
index 00000000000..aee41ca5e76
--- /dev/null
+++ b/TAO/orbsvcs/LoadBalancer/Monitor_Signal_Handler.h
@@ -0,0 +1,62 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Monitor_Signal_Handler.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_MONITOR_SIGNAL_HANDLER_H
+#define TAO_LB_MONITOR_SIGNAL_HANDLER_H
+
+#include "Signal_Handler.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosLoadBalancingC.h"
+
+
+/**
+ * @class TAO_LB_Monitor_Signal_Handler
+ *
+ * @brief LoadMonitor-specific signal handler.
+ *
+ * This class simply builds on the TAO_LB_Signal_Handler class to add
+ * some LoadMonitor-specific cleanup.
+ */
+class TAO_LB_Monitor_Signal_Handler : public TAO_LB_Signal_Handler
+{
+public:
+
+ /// Constructor.
+ TAO_LB_Monitor_Signal_Handler (
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Location & location);
+
+protected:
+
+ /// Template method that initiates the cleanup process.
+ virtual int perform_cleanup (int signum);
+
+private:
+
+ /// Reference to the LoadManager with which the LoadMonitor is
+ /// registered.
+ CosLoadBalancing::LoadManager_var load_manager_;
+
+ /// Reference to the location the LoadMonitor resides at.
+ const PortableGroup::Location & location_;
+
+};
+
+
+#endif /* TAO_LB_MONITOR_SIGNAL_HANDLER_H */
diff --git a/TAO/orbsvcs/LoadBalancer/Push_Handler.cpp b/TAO/orbsvcs/LoadBalancer/Push_Handler.cpp
new file mode 100644
index 00000000000..de2f9ef1f51
--- /dev/null
+++ b/TAO/orbsvcs/LoadBalancer/Push_Handler.cpp
@@ -0,0 +1,57 @@
+#include "Push_Handler.h"
+
+#include "tao/debug.h"
+
+
+ACE_RCSID (LoadBalancing,
+ Push_Handler,
+ "$Id$")
+
+
+TAO_LB_Push_Handler::TAO_LB_Push_Handler (
+ CosLoadBalancing::LoadMonitor_ptr monitor,
+ const PortableGroup::Location & location,
+ CosLoadBalancing::LoadManager_ptr manager)
+ : monitor_ (CosLoadBalancing::LoadMonitor::_duplicate (monitor)),
+ location_ (location),
+ manager_ (CosLoadBalancing::LoadManager::_duplicate (manager))
+{
+}
+
+int
+TAO_LB_Push_Handler::handle_timeout (
+ const ACE_Time_Value & /* current_time */,
+ const void * /* arg */)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosLoadBalancing::LoadList_var loads =
+ this->monitor_->loads (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+// ACE_DEBUG ((LM_DEBUG,
+// "PUSHING LOAD:\n"
+// " id: %u\n"
+// " value: %f\n",
+// loads[0].id,
+// loads[0].value));
+
+ this->manager_->push_loads (this->location_,
+ loads.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Catch the exception and ignore it.
+ // @@ Yah?
+
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "(%P|%t) Push_Handler::handle_timeout()\n");
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/LoadBalancer/Push_Handler.h b/TAO/orbsvcs/LoadBalancer/Push_Handler.h
new file mode 100644
index 00000000000..7913a399f72
--- /dev/null
+++ b/TAO/orbsvcs/LoadBalancer/Push_Handler.h
@@ -0,0 +1,66 @@
+// -*- C++ -*-
+
+//=======================================================================
+/**
+ * @file Push_Handler.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=======================================================================
+
+
+#ifndef TAO_LB_PUSH_HANDLER_H
+#define TAO_LB_PUSH_HANDLER_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/CosLoadBalancingC.h"
+
+#include "ace/Event_Handler.h"
+
+
+/**
+ * @class TAO_LB_Push_Handler
+ *
+ * @brief Event handler used when the "push" monitoring style is
+ * configured.
+ *
+ * An event handler designed to push loads to the LoadManager.
+ */
+class TAO_LB_Push_Handler : public ACE_Event_Handler
+{
+public:
+
+ /// Constructor
+ TAO_LB_Push_Handler (CosLoadBalancing::LoadMonitor_ptr monitor,
+ const PortableGroup::Location & location,
+ CosLoadBalancing::LoadManager_ptr manager);
+
+ /// Receive the timeout event.
+ virtual int handle_timeout (const ACE_Time_Value &current_time,
+ const void *arg);
+
+private:
+
+ /// Reference to the LoadMonitor.
+ CosLoadBalancing::LoadMonitor_var monitor_;
+
+ /// Location where the LoadMonitor resides.
+ const PortableGroup::Location location_;
+
+ /// Reference to the LoadManager.
+ CosLoadBalancing::LoadManager_var manager_;
+
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_PUSH_HANDLER_H */
diff --git a/TAO/orbsvcs/LoadBalancer/README b/TAO/orbsvcs/LoadBalancer/README
new file mode 100644
index 00000000000..04de23e0fb8
--- /dev/null
+++ b/TAO/orbsvcs/LoadBalancer/README
@@ -0,0 +1,183 @@
+#
+# $Id$
+#
+
+This directory contains the sources for two binaries:
+
+ 1) LoadManager
+ 2) LoadMonitor
+
+Descriptions of each follow.
+
+LoadManager
+===========
+The "LoadManager" binary is the stand-alone load balancing/managing
+service.
+
+A listing of available "LoadManager" command line options is available
+by invoking the "LoadManager" binary with the "-h" command line option.
+
+Usage
+-----
+The below comments assume a non-adaptive load balancing configuration.
+Documentation on adaptive load balancing will be added in the future.
+
+Approach 1: Portable Approach
+..............................
+
+1. Start the `LoadManager' binary in $TAO_ROOT/orbsvcs/LoadBalancer.
+
+2. In your server, obtain a reference to the "LoadManager" object
+ using the canonical resolve_initial_references() mechanism. Don't
+ forget to pass your server the appropriate
+ "-ORBInitRef LoadManager=..." ORB option.
+
+3. One (not more!) of your servers must create an "object group." For
+ example, to create an object group that your application will
+ populate (i.e. "application controlled" membership, as opposed to
+ "infrastructure controlled membership):
+
+ // The object group will contain members of this type.
+ const char * repository_id = "IDL:MyObject: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");
+
+ // Configure for application-controlled membership.
+ PortableGroup::MembershipStyleValue msv =
+ PortableGroup::MEMB_APP_CTRL;
+ property.val <<= msv;
+
+ PortableGroup::GenericFactory::FactoryCreationId_var fcid;
+
+ CORBA::Object_var group =
+ load_manager->create_object (repository_id,
+ criteria,
+ fcid.out ());
+
+ You then "export" the "group" object reference to your clients as
+ you would with any other object reference, such as those returned
+ from _this(). You can for example call object_to_string() on the
+ above "group" reference. You can even put it into any Naming
+ Service, not just TAO's.
+
+ Note that the default load balancing strategy is "Random," which is
+ non-adaptive. It is currently possible to override it with a
+ custom one but that functionality hasn't been fully tested yet. If
+ you want to know how to do that, please let me know on the mailing
+ list so that others may benefit, too.
+
+4. Once you've created the object group, you need to populate it with
+ your object group members, i.e. your objects:
+
+ CORBA::Object_var member = my_servant._this ();
+
+ PortableGroup::Location location (1);
+ location.length (1);
+
+ // Location this member resides at.
+ location[0].id = CORBA::string_dup ("My Location 1");
+
+ // "group" is the object group reference. add_member() may
+ // change it (TAO's implementation does NOT) so store the new
+ // reference in the same variable.
+ group =
+ load_manager->add_member (group.in (),
+ location,
+ member.in ());
+
+ Only one member of a given object group can reside at a given
+ location. For example, you cannot add two members of object group
+ A at "My Location 1". You can, however, have multiple members of
+ different object groups residing at the same location. For
+ example, a member of object group A and a member of object group B
+ can reside at "My Location 1". Also, multiple object group of the
+ same type, e.g. "IDL:MyObject:1.0", can exist. In that case,
+ a member from each object group may reside at the location, despite
+ the fact they are of the same type.
+
+5. At this point, load balancing will automatically occur once clients
+ start making invocation via the object group reference.
+
+
+6. Once you longer have any need of the object group, destroy it as
+ follows:
+
+ load_manager->delete_object (fcid.in ());
+
+ "fcid" is the factory creation ID that was returned as an "out"
+ parameter in the LoadManager::create_object() call.
+
+Approach 2:
+Quick, Transparent, Non-Portable and Somewhat Experimental Approach
+...................................................................
+
+Use the "LB_Component" Service Object to transparently add load
+balancer support to your dynamically linked servers. It will
+automatically register whatever CORBA objects you want with the load
+balancer, and override object reference creation methods such as
+_this() and POA::create_reference() so that they return the object
+group reference instead of the individual object's reference. All of
+this is done "behind the scenes," meaning that no modification to your
+existing code is necessary.
+
+This approach is "experimental" since I'm still tweaking the
+configuration interface available to the user, and since I may rename
+"LB_Component" to something else like "LB_ServerComponent." It's
+"non-portable" since other ORB's do not use the same dynamic loading
+approach the "LB_Component" uses, i.e. ACE's Service Configurator. It
+is, however, portable to all platforms supported by TAO.
+
+Other than that, the underlying group registration mechanisms are
+portable since they are straight CORBA calls. The "LB_Component" just
+makes all of the calls on the "LoadManager" for you.
+
+If you want try this approach, try adding the following to your
+primary (i.e. the one that creates the object group) server's
+`svc.conf' file:
+
+ dynamic LB_Component Service_Object * TAO_CosLoadBalancing:_make_TAO_LB_Component() "-LBLocation LOCATION_1 -LBGroup CREATE -LBTypeId IDL:MyObject:1.0"
+
+and the following to your other servers that do NOT create object
+groups and simply add themselves to the object group:
+
+ dynamic LB_Component Service_Object * TAO_CosLoadBalancing:_make_TAO_LB_Component() "-LBLocation LOCATION_2 -LBGroup file://group.ior -LBTypeId IDL:MyObject:1.0"
+
+etc. Don't forget to change the location for each object group
+member. With this approach, all of the LoadManager calls I described
+in the "standard" approach are handled for you. Again, this approach
+is still really experimental.
+
+If none of this makes sense, you may want to just wait for the
+documentation to be completed, and simply use the above "standard"
+procedure.
+
+
+LoadMonitor
+===========
+The "LoadMonitor" binary is a stand-alone load monitoring utility. It
+can be used to report loads for the standard load monitor types (CPU,
+Disk, Memory and Network), in addition to custom load monitors.
+A custom load monitor is used by passing its IOR to the "LoadMonitor"
+utility through the "-m" command line option.
+
+Both "PUSH" and "PULL" load monitoring styles may be configured. The
+"PUSH" interval may be configured, as well.
+
+A listing of available "LoadMonitor" command line options is available
+by invoking the "LoadMonitor" binary with the "-h" command line
+option.
+
+The LoadManager object's IOR must be made available to the
+"LoadMonitor" binary. This can be done using the standard
+Interoperable Naming Service "-ORBInitRef" option. For example, the
+following will work if LoadManager IOR is available in the file
+`lm.ior'
+
+ LoadMonitor -ORBInitRef LoadManager=file://lm.ior
diff --git a/TAO/orbsvcs/LoadBalancer/Signal_Handler.cpp b/TAO/orbsvcs/LoadBalancer/Signal_Handler.cpp
new file mode 100644
index 00000000000..e6c646c9833
--- /dev/null
+++ b/TAO/orbsvcs/LoadBalancer/Signal_Handler.cpp
@@ -0,0 +1,147 @@
+#include "Signal_Handler.h"
+
+#include "tao/ORB_Core.h"
+#include "ace/Reactor.h"
+
+ACE_RCSID (LoadBalancer,
+ Signal_Handler,
+ "$Id$")
+
+
+TAO_LB_Signal_Handler::TAO_LB_Signal_Handler (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa)
+ :
+#ifdef ACE_HAS_THREADS
+ signal_guard_ (),
+#endif /* ACE_HAS_THREADS */
+ sigset_ (),
+ orb_ (CORBA::ORB::_duplicate (orb)),
+ poa_ (PortableServer::POA::_duplicate (poa))
+{
+ // Register signal handlers.
+ this->sigset_.sig_add (SIGINT);
+ this->sigset_.sig_add (SIGTERM);
+}
+
+int
+TAO_LB_Signal_Handler::svc (void)
+{
+ // This method is only invoked when performing synchronous signal
+ // handling.
+
+ int signum = -1;
+
+ // Block waiting for the registered signals.
+ if (ACE_OS::sigwait (this->sigset_, &signum) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) %p\n",
+ "ERROR waiting on signal"),
+ -1);
+ }
+
+ ACE_ASSERT (signum == SIGINT || signum == SIGTERM);
+
+// ACE_DEBUG ((LM_DEBUG,
+// ACE_TEXT ("(%P|%t) synchronous signal handler done\n")));
+
+ return this->perform_cleanup (signum);
+}
+
+int
+TAO_LB_Signal_Handler::activate (long flags,
+ int n_threads,
+ int force_active,
+ long priority,
+ int grp_id,
+ ACE_Task_Base *task,
+ ACE_hthread_t thread_handles[],
+ void *stack[],
+ size_t stack_size[],
+ ACE_thread_t thread_ids[])
+{
+ // sigwait() is not implemented on MS Windows. Handle signals
+ // asynchronously through the ORB's reactor in that case instead.
+ // Otherwise, handle signals synchronously in another thread.
+
+#if defined (ACE_HAS_THREADS) && !defined (ACE_WIN32)
+ return this->ACE_Task_Base::activate (flags,
+ n_threads,
+ force_active,
+ priority,
+ grp_id,
+ task,
+ thread_handles,
+ stack,
+ stack_size,
+ thread_ids);
+#else
+ ACE_UNUSED_ARG (flags);
+ ACE_UNUSED_ARG (n_threads);
+ ACE_UNUSED_ARG (force_active);
+ ACE_UNUSED_ARG (priority);
+ ACE_UNUSED_ARG (grp_id);
+ ACE_UNUSED_ARG (task);
+ ACE_UNUSED_ARG (thread_handles);
+ ACE_UNUSED_ARG (stack);
+ ACE_UNUSED_ARG (stack_size);
+ ACE_UNUSED_ARG (thread_ids);
+
+ return
+ this->orb_->orb_core ()->reactor ()->register_handler (this->sigset_,
+ this);
+#endif /* ACE_HAS_THREADS */
+}
+
+int
+TAO_LB_Signal_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *)
+{
+// ACE_DEBUG ((LM_DEBUG,
+// ACE_TEXT ("(%P|%t) ASYNCHRONOUS signal handler done\n")));
+
+ // This method is only used in the asynchronous signal handling case
+ // (i.e. when single-threaded build is used).
+
+ // @note Is it okay to perform ORB operations from this method? The
+ // issue here is whether or not
+ // ACE_Event_Handler::handle_signal() is called from within an
+ // OS signal handler, and if that did occur is it safe to
+ // perform ORB operations?
+ return this->perform_cleanup (signum);
+}
+
+int
+TAO_LB_Signal_Handler::perform_cleanup (int signum)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Shutdown the POA.
+ //
+ // Shutting down the POA will cause servants "owned" by the POA
+ // to be destroyed. Servants will then have the opportunity to
+ // clean up all resources they are responsible for.
+ this->poa_->destroy (1, 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Now shutdown the ORB.
+ this->orb_->shutdown (1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception");
+
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Problem during cleanup initiated by signal %d.\n",
+ signum),
+ -1);
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/LoadBalancer/Signal_Handler.h b/TAO/orbsvcs/LoadBalancer/Signal_Handler.h
new file mode 100644
index 00000000000..5e9e7c2dea2
--- /dev/null
+++ b/TAO/orbsvcs/LoadBalancer/Signal_Handler.h
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Signal_Handler.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_SIGNAL_HANDLER_H
+#define TAO_LB_SIGNAL_HANDLER_H
+
+#include "ace/Task.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/ORB.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "ace/Signal.h"
+
+/**
+ * @class TAO_LB_Signal_Handler
+ *
+ * @brief Active object designed to handle signals synchronously.
+ *
+ * This class handles signals synchronously in the multi-threaded case,
+ * and asynchronously through a Reactor in the single-threaded case.
+ * @par
+ * The goal of this signal handler is to ensure proper cleanup of
+ * resources created by servants upon interruption by signals. For
+ * example, suppose a user sends a
+ * SIGINT (e.g. types CTRL-C) signal to an application. The servants
+ * in that application should be shutdown gracefully so that all
+ * resources handled by those servants are cleaned up. This is
+ * particularly important for resources that are not cleaned up
+ * automatically.
+ */
+class TAO_LB_Signal_Handler : public ACE_Task_Base
+{
+public:
+
+ /// Constructor.
+ TAO_LB_Signal_Handler (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa);
+
+ /// Run by a daemon thread to handle signals synchronously.
+ virtual int svc (void);
+
+ /// Active object activation method.
+ /**
+ * This override blocks all signals in the calling thread before
+ * spawning the synchronous signal handler.
+ */
+ virtual int activate (long flags = THR_NEW_LWP | THR_JOINABLE,
+ int n_threads = 1,
+ int force_active = 0,
+ long priority = ACE_DEFAULT_THREAD_PRIORITY,
+ int grp_id = -1,
+ ACE_Task_Base *task = 0,
+ ACE_hthread_t thread_handles[] = 0,
+ void *stack[] = 0,
+ size_t stack_size[] = 0,
+ ACE_thread_t thread_ids[] = 0);
+
+ /// Called when object is signaled by OS (either via UNIX signals or
+ /// when a Win32 object becomes signaled).
+ virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0);
+
+protected:
+
+ /// Template method that initiates the cleanup process.
+ virtual int perform_cleanup (int signum);
+
+private:
+
+#ifdef ACE_HAS_THREADS
+ /// Block all signals before spawning the threads. Then, unblock
+ /// these signals when this handler is destroyed.
+ ACE_Sig_Guard signal_guard_;
+#endif /* ACE_HAS_THREADS */
+
+ /// The set of signals which this handler will handle.
+ ACE_Sig_Set sigset_;
+
+ /// Pseudo-reference to the ORB in which the LoadManager is running.
+ CORBA::ORB_var orb_;
+
+ /// Reference to the POA within which the LoadManager servant is
+ /// registered.
+ PortableServer::POA_var poa_;
+
+};
+
+#endif /* TAO_LB_SIGNAL_HANDLER_H */
diff --git a/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/.cvsignore b/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/.cvsignore
new file mode 100644
index 00000000000..3ff0e6fc5e4
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/.cvsignore
@@ -0,0 +1 @@
+Basic_Logging_Service
diff --git a/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Server.cpp b/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Server.cpp
new file mode 100644
index 00000000000..55900325fcc
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Server.cpp
@@ -0,0 +1,79 @@
+#include "Basic_Logging_Service.h"
+#include "ace/OS_main.h"
+
+#include "orbsvcs/Shutdown_Utilities.h"
+#include "tao/debug.h"
+
+ACE_RCSID (Basic_Logging_Service,
+ Basic_Logging_Server,
+ "$Id$")
+
+
+class Logging_Svc_Shutdown
+ : public Shutdown_Functor
+{
+public:
+ Logging_Svc_Shutdown (Basic_Logging_Service& svc);
+
+ void operator() (int which_signal);
+
+private:
+ Basic_Logging_Service& svc_;
+};
+
+Logging_Svc_Shutdown::Logging_Svc_Shutdown (Basic_Logging_Service& svc)
+ : svc_ (svc)
+{
+}
+
+void
+Logging_Svc_Shutdown::operator() (int which_signal)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Basic_Logging_Service: shutting down on signal %d\n",
+ which_signal));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ (void) this->svc_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// Driver function for the Basic_Logging_Service
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ Basic_Logging_Service service;
+
+ Logging_Svc_Shutdown killer (service);
+ Service_Shutdown kill_contractor (killer);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int rc;
+
+ rc = service.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (rc == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Failed to initialize the Telecom Log Service.\n"),
+ 1);
+
+ rc = service.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (rc == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Failed to start the Telecom Log Service.\n"),
+ 1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Failed to start the Telecom Log Service.\n");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Service.cpp b/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Service.cpp
new file mode 100644
index 00000000000..e782bb204f7
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Service.cpp
@@ -0,0 +1,276 @@
+#include "Basic_Logging_Service.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/Log/BasicLogFactory_i.h"
+#include "tao/IORTable/IORTable.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (Basic_Logging_Service,
+ Basic_Logging_Service,
+ "$Id$")
+
+
+Basic_Logging_Service::Basic_Logging_Service (void)
+ : service_name_ ("BasicLogFactory"),
+ ior_file_name_ (0),
+ pid_file_name_ (0),
+ bind_to_naming_service_ (1),
+ nthreads_ (0)
+{
+ // No-Op.
+}
+
+Basic_Logging_Service::~Basic_Logging_Service (void)
+{
+ // No-Op.
+}
+
+void
+Basic_Logging_Service::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_var poa_object =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->poa_ =
+ PortableServer::POA::_narrow (poa_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+Basic_Logging_Service::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("n:o:p:t:x"));
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'n':
+ service_name_ = get_opt.opt_arg();
+ break;
+
+ case 'o':
+ ior_file_name_ = get_opt.opt_arg();
+ break;
+
+ case 'p':
+ pid_file_name_ = get_opt.opt_arg();
+ break;
+
+ case 't':
+ nthreads_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'x':
+ bind_to_naming_service_ = 0;
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "-n service_name "
+ "-o ior_file_name "
+ "-p pid_file_name "
+ "-t threads "
+ "-x [disable naming service bind] "
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+Basic_Logging_Service::init (int argc, char *argv[] ACE_ENV_ARG_DECL)
+{
+ // initalize the ORB.
+ this->init_ORB (argc, argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->parse_args (argc, argv) == -1)
+ return -1;
+
+ // Activate the basic log factory
+ // CORBA::Object_var obj =
+ DsLogAdmin::BasicLogFactory_var obj =
+ this->basic_log_factory_.activate (this->orb_.in (),
+ this->poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ ACE_ASSERT (!CORBA::is_nil (obj.in ()));
+
+ CORBA::String_var ior =
+ this->orb_->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (true)
+ {
+ CORBA::Object_var table_object =
+ this->orb_->resolve_initial_references ("IORTable"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ IORTable::Table_var adapter =
+ IORTable::Table::_narrow (table_object.in ());
+ ACE_CHECK_RETURN (-1);
+
+ adapter->bind("BasicLogService", ior.in ());
+ ACE_CHECK_RETURN (-1);
+ }
+
+ if (ior_file_name_ != 0)
+ {
+ FILE* iorf = ACE_OS::fopen (ior_file_name_, ACE_TEXT("w"));
+ if (iorf == 0) {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_file_name_),
+ -1);
+ }
+
+ ACE_OS::fprintf (iorf, "%s\n", ior.in ());
+ ACE_OS::fclose (iorf);
+ }
+
+ if (pid_file_name_ != 0)
+ {
+ FILE* pidf = ACE_OS::fopen (pid_file_name_, ACE_TEXT("w"));
+ if (pidf != 0)
+ {
+ ACE_OS::fprintf (pidf,
+ "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pidf);
+ }
+ }
+
+ if (bind_to_naming_service_)
+ {
+ // Resolve the naming service.
+ this->resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register the Basic Log Factory.
+ ACE_ASSERT(!CORBA::is_nil (this->naming_.in ()));
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (this->service_name_);
+
+ this->naming_->rebind (name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ return 0;
+}
+
+void
+Basic_Logging_Service::resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService"
+ 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::NamingContext::_narrow (naming_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+Basic_Logging_Service::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->nthreads_ > 0)
+ {
+ if (this->activate ((THR_NEW_LWP | THR_JOINABLE), this->nthreads_) != 0)
+ return -1;
+
+ this->thr_mgr ()->wait ();
+ return 0;
+ }
+
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Basic_Logging_Service::svc ()
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+void
+Basic_Logging_Service::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // @@ JTC - factory object isn't activated on root poa.
+#if 0
+ // Deactivate.
+ PortableServer::ObjectId_var oid =
+ this->poa_->servant_to_id (&this->basic_log_factory_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Deactivate from the poa.
+ this->poa_->deactivate_object (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#endif
+
+ if (bind_to_naming_service_)
+ {
+ // Unbind from the naming service.
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (this->service_name_);
+
+ this->naming_->unbind (name
+ ACE_ENV_ARG_PARAMETER);
+ }
+
+ // Shutdown the ORB.
+ if (!CORBA::is_nil (this->orb_.in ()))
+ this->orb_->shutdown ();
+}
diff --git a/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Service.h b/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Service.h
new file mode 100644
index 00000000000..57066ebf020
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Service.h
@@ -0,0 +1,96 @@
+/* -*- C++ -*- */
+
+// ============================================================================
+/**
+ * @file Basic_Logging_Service.h
+ *
+ * $Id$
+ *
+ * Front End of the Telecom Log Service
+ * Basic_Logging_Service
+ *
+ *
+ * @author D A Hanvey (d.hanvey@qub.ac.uk)
+ */
+// ============================================================================
+
+#ifndef BASIC_LOGGING_SERVICE_H
+#define BASIC_LOGGING_SERVICE_H
+
+#include "ace/Task.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/DsLogAdminC.h"
+#include "orbsvcs/Log/BasicLogFactory_i.h"
+
+class Basic_Logging_Service
+ : public ACE_Task_Base
+{
+ // = TITLE
+ // Basic_Logging_Service
+ //
+ // = DESCRIPTION
+ // Implementation of the Telecom Log Service
+
+ public:
+ // = Initialization and termination methods.
+ Basic_Logging_Service (void);
+ // Constructor.
+
+ virtual ~Basic_Logging_Service (void);
+ // Destructor.
+
+ int init (int argc, char *argv[] ACE_ENV_ARG_DECL);
+ // Initializes the Telecom Log Service.
+ // Returns 0 on success, -1 on error.
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the Telecom Log Service.
+ // Returns 0 on success, -1 on error.
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+ // Shutdown the Telecom Log Service.
+ // Returns 0 on success, -1 on error.
+
+protected:
+ void init_ORB (int& argc, char *argv []
+ ACE_ENV_ARG_DECL);
+ // initialize the ORB.
+
+ int parse_args (int argc, char *argv []);
+ // Parses the command line arguments.
+
+ void resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL);
+ // Resolve the naming service.
+
+ int svc ();
+ // Run worker threads.
+
+ // = Data members
+ TAO_BasicLogFactory_i basic_log_factory_;
+ // The Basic Log Factory.
+
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ PortableServer::POA_var poa_;
+ // Reference to the root poa.
+
+ CosNaming::NamingContext_var naming_;
+ // A naming context.
+
+ const char* service_name_;
+ // The name we use to bind with the NameService
+
+ const char* ior_file_name_;
+ // The name of the file where we output the factory IOR.
+
+ const char* pid_file_name_;
+ // The name of the file where we output the process id.
+
+ int bind_to_naming_service_;
+ // If true, bind to naming service
+
+ int nthreads_;
+ // Number of worker threads.
+};
+#endif /* BASIC_LOGGING_SERVICE_H */
diff --git a/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Service.mpc b/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Service.mpc
new file mode 100644
index 00000000000..3a63ffedf79
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Service.mpc
@@ -0,0 +1,5 @@
+// $Id$
+
+project: namingexe, iortable, core, dslogadmin_serv, valuetype {
+ exename = Basic_Logging_Service
+}
diff --git a/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Makefile.am b/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/Makefile.am
new file mode 100644
index 00000000000..1d5584d36e0
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/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.Basic_Logging_Service.am
+
+bin_PROGRAMS = Basic_Logging_Service
+
+Basic_Logging_Service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+Basic_Logging_Service_SOURCES = \
+ Basic_Logging_Server.cpp \
+ Basic_Logging_Service.cpp \
+ Basic_Logging_Service.h
+
+Basic_Logging_Service_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin.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/Logging_Service/Basic_Logging_Service/README b/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/README
new file mode 100644
index 00000000000..5288ca240e1
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Basic_Logging_Service/README
@@ -0,0 +1,12 @@
+The service is registered with the naming service with the name
+"BasicLogFactory" .
+
+To run the Basic Logging Service:
+------------------------
+1. you should have a running Naming Service.
+ if not, start one at $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service
+
+2. execute the Basic_Logging_Service
+ at $TAO_ROOT/orbsvcs/Logging_Service/Basic_Logging_Service/Basic_Logging_Service
+
+The idl spec is $TAO_ROOT/orbsvcs/orbsvcs/DsLogAdmin.idl
diff --git a/TAO/orbsvcs/Logging_Service/Event_Logging_Service/.cvsignore b/TAO/orbsvcs/Logging_Service/Event_Logging_Service/.cvsignore
new file mode 100644
index 00000000000..31e33cd2684
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Event_Logging_Service/.cvsignore
@@ -0,0 +1 @@
+Event_Logging_Service
diff --git a/TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Server.cpp b/TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Server.cpp
new file mode 100644
index 00000000000..bcbd1a3f592
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Server.cpp
@@ -0,0 +1,81 @@
+#include "Event_Logging_Service.h"
+#include "ace/OS_main.h"
+
+#include "orbsvcs/Shutdown_Utilities.h"
+#include "tao/debug.h"
+
+ACE_RCSID (Event_Logging_Service,
+ Event_Logging_Server,
+ "$Id$")
+
+
+class Logging_Svc_Shutdown
+ : public Shutdown_Functor
+{
+public:
+ Logging_Svc_Shutdown (Event_Logging_Service& svc);
+
+ void operator() (int which_signal);
+
+private:
+ Event_Logging_Service& svc_;
+};
+
+Logging_Svc_Shutdown::Logging_Svc_Shutdown (Event_Logging_Service& svc)
+ : svc_ (svc)
+{
+}
+
+void
+Logging_Svc_Shutdown::operator() (int which_signal)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Event_Logging_Service: shutting down on signal %d\n",
+ which_signal));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ (void) this->svc_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// Driver function for the Event_Logging_Service
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ TAO_CEC_Default_Factory::init_svcs ();
+
+ Event_Logging_Service service;
+
+ Logging_Svc_Shutdown killer (service);
+ Service_Shutdown kill_contractor (killer);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int rc;
+
+ rc = service.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (rc == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Failed to initialize the Telecom Log Service.\n"),
+ 1);
+
+ rc = service.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (rc == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Failed to start the Telecom Log Service.\n"),
+ 1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Failed to start the Telecom Log Service.\n");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Service.cpp b/TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Service.cpp
new file mode 100644
index 00000000000..be47a102d7c
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Service.cpp
@@ -0,0 +1,281 @@
+#include "Event_Logging_Service.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/Log/EventLogFactory_i.h"
+#include "orbsvcs/CosEvent/CEC_Default_Factory.h"
+#include "tao/IORTable/IORTable.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (Event_Logging_Service,
+ Event_Logging_Service,
+ "$Id$")
+
+
+Event_Logging_Service::Event_Logging_Service (void)
+ : service_name_ ("EventLogFactory"),
+ ior_file_name_ (0),
+ pid_file_name_ (0),
+ bind_to_naming_service_ (1),
+ nthreads_ (0)
+{
+ // No-Op.
+}
+
+Event_Logging_Service::~Event_Logging_Service (void)
+{
+ // No-Op.
+}
+
+void
+Event_Logging_Service::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_var poa_object =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->poa_ =
+ PortableServer::POA::_narrow (poa_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+Event_Logging_Service::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("n:o:p:t:x"));
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'n':
+ service_name_ = get_opt.opt_arg();
+ break;
+
+ case 'o':
+ ior_file_name_ = get_opt.opt_arg();
+ break;
+
+ case 'p':
+ pid_file_name_ = get_opt.opt_arg();
+ break;
+
+ case 't':
+ nthreads_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'x':
+ bind_to_naming_service_ = 0;
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "-n service_name "
+ "-o ior_file_name "
+ "-p pid_file_name "
+ "-t threads "
+ "-x [disable naming service bind] "
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+Event_Logging_Service::init (int argc, char *argv[] ACE_ENV_ARG_DECL)
+{
+ // initalize the ORB.
+ this->init_ORB (argc, argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->parse_args (argc, argv) == -1)
+ return -1;
+
+ // Activate the event log factory
+ ACE_NEW_THROW_EX (this->event_log_factory_,
+ TAO_EventLogFactory_i (),
+ CORBA::NO_MEMORY ());
+
+ // CORBA::Object_var obj =
+ DsEventLogAdmin::EventLogFactory_var obj =
+ this->event_log_factory_->activate (this->orb_.in (),
+ this->poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ ACE_ASSERT (!CORBA::is_nil (obj.in ()));
+
+ CORBA::String_var ior =
+ this->orb_->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (true)
+ {
+ CORBA::Object_var table_object =
+ this->orb_->resolve_initial_references ("IORTable"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ IORTable::Table_var adapter =
+ IORTable::Table::_narrow (table_object.in ());
+ ACE_CHECK_RETURN (-1);
+
+ adapter->bind("EventLogService", ior.in ());
+ ACE_CHECK_RETURN (-1);
+ }
+
+ if (ior_file_name_ != 0)
+ {
+ FILE* iorf = ACE_OS::fopen (ior_file_name_, ACE_TEXT("w"));
+ if (iorf == 0) {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_file_name_),
+ -1);
+ }
+
+ ACE_OS::fprintf (iorf, "%s\n", ior.in ());
+ ACE_OS::fclose (iorf);
+ }
+
+ if (pid_file_name_ != 0)
+ {
+ FILE* pidf = ACE_OS::fopen (pid_file_name_, ACE_TEXT("w"));
+ if (pidf != 0)
+ {
+ ACE_OS::fprintf (pidf,
+ "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pidf);
+ }
+ }
+
+ if (bind_to_naming_service_)
+ {
+ // Resolve the naming service.
+ this->resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register the Event Log Factory.
+ ACE_ASSERT(!CORBA::is_nil (this->naming_.in ()));
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (this->service_name_);
+
+ this->naming_->rebind (name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ return 0;
+}
+
+void
+Event_Logging_Service::resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService"
+ 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::NamingContext::_narrow (naming_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+Event_Logging_Service::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->nthreads_ > 0)
+ {
+ if (this->activate ((THR_NEW_LWP | THR_JOINABLE), this->nthreads_) != 0)
+ return -1;
+
+ this->thr_mgr ()->wait ();
+ return 0;
+ }
+
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Event_Logging_Service::svc (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+void
+Event_Logging_Service::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // @@ JTC - factory object isn't activated on root poa.
+#if 0
+ // Deactivate.
+ PortableServer::ObjectId_var oid =
+ this->poa_->servant_to_id (this->event_log_factory_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // deactivate from the poa.
+ this->poa_->deactivate_object (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#endif
+
+ if (bind_to_naming_service_)
+ {
+ // Unbind from the naming service.
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (this->service_name_);
+
+ this->naming_->unbind (name
+ ACE_ENV_ARG_PARAMETER);
+ }
+
+ // shutdown the ORB.
+ if (!CORBA::is_nil (this->orb_.in ()))
+ this->orb_->shutdown ();
+}
diff --git a/TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Service.h b/TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Service.h
new file mode 100644
index 00000000000..de98deb20f9
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Service.h
@@ -0,0 +1,97 @@
+/* -*- C++ -*- */
+
+// ============================================================================
+/**
+ * @file Event_Logging_Service.h
+ *
+ * $Id$
+ *
+ * Front End of the Telecom Log Service
+ * Event_Logging_Service
+ *
+ *
+ * @author D A Hanvey (d.hanvey@qub.ac.uk)
+ */
+// ============================================================================
+
+#ifndef EVENT_LOGGING_SERVICE_H
+#define EVENT_LOGGING_SERVICE_H
+
+#include "ace/Task.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/DsLogAdminC.h"
+#include "orbsvcs/DsEventLogAdminC.h"
+#include "orbsvcs/Log/EventLogFactory_i.h"
+
+class Event_Logging_Service
+ : public ACE_Task_Base
+{
+ // = TITLE
+ // Event_Logging_Service
+ //
+ // = DESCRIPTION
+ // Implementation of the Telecom Log Service
+
+ public:
+ // = Initialization and termination methods.
+ Event_Logging_Service (void);
+ // Constructor.
+
+ virtual ~Event_Logging_Service (void);
+ // Destructor.
+
+ int init (int argc, char *argv[] ACE_ENV_ARG_DECL);
+ // Initializes the Telecom Log Service.
+ // Returns 0 on success, -1 on error.
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the Telecom Log Service.
+ // Returns 0 on success, -1 on error.
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+ // Shutdown the Telecom Log Service.
+ // Returns 0 on success, -1 on error.
+
+protected:
+ void init_ORB (int& argc, char *argv []
+ ACE_ENV_ARG_DECL);
+ // initialize the ORB.
+
+ int parse_args (int argc, char *argv []);
+ // Parses the command line arguments.
+
+ void resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL);
+ // Resolve the naming service.
+
+ int svc ();
+ // Run worker threads.
+
+ // = Data members
+ TAO_EventLogFactory_i *event_log_factory_;
+ // The Event Log Factory.
+
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ PortableServer::POA_var poa_;
+ // Reference to the root poa.
+
+ CosNaming::NamingContext_var naming_;
+ // A naming context.
+
+ const char* service_name_;
+ // The name we use to bind with the NameService
+
+ const char* ior_file_name_;
+ // The name of the file where we output the factory IOR.
+
+ const char* pid_file_name_;
+ // The name of the file where we output the process id.
+
+ int bind_to_naming_service_;
+ // If true, bind to naming service
+
+ int nthreads_;
+ // Number of worker threads.
+};
+#endif /* EVENT_LOGGING_SERVICE_H */
diff --git a/TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Service.mpc b/TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Service.mpc
new file mode 100644
index 00000000000..cd3075b21d8
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Service.mpc
@@ -0,0 +1,5 @@
+// $Id$
+
+project: namingexe, iortable, core, dseventlogadmin_serv, valuetype {
+ exename = Event_Logging_Service
+}
diff --git a/TAO/orbsvcs/Logging_Service/Event_Logging_Service/Makefile.am b/TAO/orbsvcs/Logging_Service/Event_Logging_Service/Makefile.am
new file mode 100644
index 00000000000..fcc727eb83c
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Event_Logging_Service/Makefile.am
@@ -0,0 +1,74 @@
+## 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_Logging_Service.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+bin_PROGRAMS = Event_Logging_Service
+
+Event_Logging_Service_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
+
+Event_Logging_Service_SOURCES = \
+ Event_Logging_Server.cpp \
+ Event_Logging_Service.cpp \
+ Event_Logging_Service.h
+
+Event_Logging_Service_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsEventLogAdmin_Serv.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_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsEventLogAdmin_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsEventLogAdmin.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin.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
+
+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/Logging_Service/Event_Logging_Service/README b/TAO/orbsvcs/Logging_Service/Event_Logging_Service/README
new file mode 100755
index 00000000000..4977a7bac72
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Event_Logging_Service/README
@@ -0,0 +1,14 @@
+The service is registered with the naming service with the name
+"EventLogFactory" .
+
+To run the Event Logging Service:
+------------------------
+1. you should have a running Naming Service.
+ if not, start one at $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service
+
+2. execute the Event_Logging_Service
+ at $TAO_ROOT/orbsvcs/Logging_Service/Event_Logging_Service/Event_Logging_Service
+
+
+The idl spec is $TAO_ROOT/orbsvcs/orbsvcs/DsEventLogAdmin.idl
+see also $TAO_ROOT/orbsvcs/orbsvcs/DsLogNotification.idl
diff --git a/TAO/orbsvcs/Logging_Service/Makefile.am b/TAO/orbsvcs/Logging_Service/Makefile.am
new file mode 100644
index 00000000000..12d820f5b52
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/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 = \
+ Basic_Logging_Service \
+ Event_Logging_Service \
+ Notify_Logging_Service \
+ RTEvent_Logging_Service
+
diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/.cvsignore b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/.cvsignore
new file mode 100644
index 00000000000..bf00697bc77
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/.cvsignore
@@ -0,0 +1 @@
+Notify_Logging_Service
diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Makefile.am b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Makefile.am
new file mode 100644
index 00000000000..42c6388bae0
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/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.Notify_Logging_Service.am
+
+if !BUILD_MINIMUM_CORBA
+
+bin_PROGRAMS = Notify_Logging_Service
+
+Notify_Logging_Service_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
+
+Notify_Logging_Service_SOURCES = \
+ Notify_Logging_Server.cpp \
+ Notify_Logging_Service.cpp \
+ Notify_Logging_Service.h
+
+Notify_Logging_Service_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsNotifyLogAdmin_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsNotifyLogAdmin_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsEventLogAdmin_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsNotifyLogAdmin.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsEventLogAdmin.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin.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
+
+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/Logging_Service/Notify_Logging_Service/Notify_Logging_Server.cpp b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Server.cpp
new file mode 100644
index 00000000000..14b848c2d27
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Server.cpp
@@ -0,0 +1,79 @@
+//$Id$
+#include "Notify_Logging_Service.h"
+#include "ace/OS_main.h"
+#include "orbsvcs/Shutdown_Utilities.h"
+#include "tao/debug.h"
+
+ACE_RCSID (Notify_Logging_Service,
+ Notify_Logging_Server,
+ "$Id$")
+
+
+class Logging_Svc_Shutdown
+ : public Shutdown_Functor
+{
+public:
+ Logging_Svc_Shutdown (Notify_Logging_Service& svc);
+
+ void operator() (int which_signal);
+
+private:
+ Notify_Logging_Service& svc_;
+};
+
+Logging_Svc_Shutdown::Logging_Svc_Shutdown (Notify_Logging_Service& svc)
+ : svc_ (svc)
+{
+}
+
+void
+Logging_Svc_Shutdown::operator() (int which_signal)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Notify_Logging_Service: shutting down on signal %d\n",
+ which_signal));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ (void) this->svc_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// Driver function for the Notify_Logging_Service.
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ Notify_Logging_Service service;
+
+ Logging_Svc_Shutdown killer (service);
+ Service_Shutdown kill_contractor (killer);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int rc;
+
+ rc = service.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (rc == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Failed to initialize the Telecom Log Service.\n"),
+ 1);
+
+ rc = service.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (rc == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Failed to start the Telecom Log Service.\n"),
+ 1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Failed to start the Telecom Log Service.\n");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.cpp b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.cpp
new file mode 100644
index 00000000000..fd898bddc31
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.cpp
@@ -0,0 +1,306 @@
+#include "Notify_Logging_Service.h"
+#include "ace/Get_Opt.h"
+#include "ace/Dynamic_Service.h"
+#include "tao/debug.h"
+#include "tao/IORTable/IORTable.h"
+#include "orbsvcs/Notify/Service.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (Notify_Logging_Service,
+ Notify_Logging_Service,
+ "$Id$")
+
+
+Notify_Logging_Service::Notify_Logging_Service (void)
+ : service_name_ (NOTIFY_KEY),
+ ior_file_name_ (0),
+ pid_file_name_ (0),
+ bind_to_naming_service_ (1),
+ nthreads_ (0)
+{
+ // No-Op.
+}
+
+Notify_Logging_Service::~Notify_Logging_Service (void)
+{
+ // No-Op.
+}
+
+int
+Notify_Logging_Service::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);
+
+ this->notify_service_ = ACE_Dynamic_Service<TAO_Notify_Service>::instance (TAO_NOTIFY_DEF_EMO_FACTORY_NAME);
+
+ if (this->notify_service_ == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Notify Service not found! check conf. file\n"));
+ return -1;
+ }
+
+ CORBA::Object_var poa_obj =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (poa_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to resolve the RootPOA.\n"),
+ -1);
+
+ this->poa_ =
+ PortableServer::POA::_narrow (poa_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-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);
+
+ return 0;
+}
+
+int
+Notify_Logging_Service::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("n:o:p:t::x"));
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'n':
+ service_name_ = get_opt.opt_arg();
+ break;
+
+ case 'o':
+ ior_file_name_ = get_opt.opt_arg();
+ break;
+
+ case 'p':
+ pid_file_name_ = get_opt.opt_arg();
+ break;
+
+ case 't':
+ nthreads_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'x':
+ bind_to_naming_service_ = 0;
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "-n service_name "
+ "-o ior_file_name "
+ "-p pid_file_name "
+ "-x [disable naming service bind] "
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+Notify_Logging_Service::init (int argc, char *argv[]
+ ACE_ENV_ARG_DECL)
+{
+ // initalize the ORB.
+ if (this->init_ORB (argc, argv
+ ACE_ENV_ARG_PARAMETER) != 0)
+ return -1;
+
+ if (this->parse_args (argc, argv) == -1)
+ return -1;
+
+ this->notify_service_->init_service (this->orb_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Activate the factory
+ this->notify_factory_ =
+ notify_service_->create (this->poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_NEW_THROW_EX (this->notify_log_factory_,
+ TAO_NotifyLogFactory_i (this->notify_factory_.in ()),
+ CORBA::NO_MEMORY ());
+
+ DsNotifyLogAdmin::NotifyLogFactory_var obj =
+ notify_log_factory_->activate (this->orb_.in (),
+ this->poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::String_var ior =
+ this->orb_->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (true)
+ {
+ CORBA::Object_var table_object =
+ this->orb_->resolve_initial_references ("IORTable"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ IORTable::Table_var adapter =
+ IORTable::Table::_narrow (table_object.in ());
+ ACE_CHECK_RETURN (-1);
+
+ adapter->bind("NotifyLogService", ior.in ());
+ ACE_CHECK_RETURN (-1);
+ }
+
+ if (ior_file_name_ != 0)
+ {
+ FILE* iorf = ACE_OS::fopen (ior_file_name_, ACE_TEXT("w"));
+ if (iorf == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_file_name_),
+ -1);
+ }
+
+ ACE_OS::fprintf (iorf, "%s\n", ior.in ());
+ ACE_OS::fclose (iorf);
+ }
+
+ if (pid_file_name_ != 0)
+ {
+ FILE* pidf = ACE_OS::fopen (pid_file_name_, ACE_TEXT("w"));
+ if (pidf != 0)
+ {
+ ACE_OS::fprintf (pidf,
+ "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pidf);
+ }
+ }
+
+ if (bind_to_naming_service_)
+ {
+ // Resolve the naming service.
+ resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register the Factory
+ ACE_ASSERT (!CORBA::is_nil (this->naming_.in ()));
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (this->service_name_);
+ ACE_CHECK_RETURN (-1);
+
+ this->naming_->rebind (name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ return 0;
+}
+
+void
+Notify_Logging_Service::resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService"
+ 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::NamingContext::_narrow (naming_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+Notify_Logging_Service::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->nthreads_ > 0)
+ {
+ if (this->activate ((THR_NEW_LWP | THR_JOINABLE), this->nthreads_) != 0)
+ return -1;
+
+ this->thr_mgr ()->wait ();
+ return 0;
+ }
+
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Notify_Logging_Service::svc ()
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+void
+Notify_Logging_Service::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // @@ JTC - factory object isn't activated on root poa.
+#if 0
+ // Deactivate.
+ PortableServer::ObjectId_var oid =
+ this->poa_->reference_to_id (this->notify_log_factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // deactivate from the poa.
+ this->poa_->deactivate_object (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#endif
+
+ if (bind_to_naming_service_)
+ {
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (this->service_name_);
+ ACE_CHECK;
+
+ this->naming_->unbind (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // shutdown the ORB.
+ if (!CORBA::is_nil (this->orb_.in ()))
+ this->orb_->shutdown ();
+}
diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.h b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.h
new file mode 100644
index 00000000000..c6d5f3a459b
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.h
@@ -0,0 +1,107 @@
+/* -*- C++ -*- */
+
+// ============================================================================
+/**
+ * @file Notify_Logging_Service.h
+ *
+ * $Id$
+ *
+ * Front End of the Telecom Log Service
+ * Notify_Logging_Service
+ *
+ *
+ * @author D A Hanvey (d.hanvey@qub.ac.uk)
+ */
+// ============================================================================
+
+#ifndef NOTIFY_LOGGING_SERVICE_H
+#define NOTIFY_LOGGING_SERVICE_H
+
+#include "ace/Task.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Notify/Service.h"
+#include "orbsvcs/DsLogAdminC.h"
+#include "orbsvcs/DsNotifyLogAdminC.h"
+#include "orbsvcs/Log/NotifyLogFactory_i.h"
+
+#define NOTIFY_KEY "NotifyLogFactory"
+
+class Notify_Logging_Service
+ : public ACE_Task_Base
+{
+ // = TITLE
+ // Notify_Logging_Service
+ //
+ // = DESCRIPTION
+ // Implementation of the Telecom Log Service
+
+ public:
+ // = Initialization and termination methods.
+ Notify_Logging_Service (void);
+ // Constructor.
+
+ virtual ~Notify_Logging_Service (void);
+ // Destructor.
+
+ int init (int argc, char *argv[] ACE_ENV_ARG_DECL);
+ // Initializes the Telecom Log Service.
+ // Returns 0 on success, -1 on error.
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the Telecom Log Service.
+ // Returns 0 on success, -1 on error.
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+ // Shutdown the Telecom Service.
+ // Returns 0 on success, -1 on error.
+
+protected:
+ int init_ORB (int& argc, char *argv []
+ ACE_ENV_ARG_DECL);
+ // initialize the ORB.
+
+ int parse_args (int argc, char *argv[]);
+ // Parses the command line arguments.
+
+ void resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL);
+ // Resolve the naming service.
+
+ int svc ();
+ // Run worker threads.
+
+ // = Data members
+
+ TAO_Notify_Service* notify_service_;
+
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory_;
+ // The Factory.
+
+ TAO_NotifyLogFactory_i *notify_log_factory_;
+ // The Notify Log Factory.
+
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ PortableServer::POA_var poa_;
+ // Reference to the root poa.
+
+ CosNaming::NamingContext_var naming_;
+ // A naming context.
+
+ const char* service_name_;
+ // The name we use to bind with the NameService
+
+ const char* ior_file_name_;
+ // The name of the file where we output the factory IOR.
+
+ const char* pid_file_name_;
+ // The name of the file where we output the process id.
+
+ int bind_to_naming_service_;
+ // If true, bind to naming service
+
+ int nthreads_;
+ // Number of worker threads.
+};
+#endif /* NOTIFY_LOGGING_SERVICE_H */
diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.mpc b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.mpc
new file mode 100644
index 00000000000..3990281b3e6
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service.mpc
@@ -0,0 +1,5 @@
+// $Id$
+
+project: namingexe, iortable, core, dsnotifylogadmin_serv, valuetype {
+ exename = Notify_Logging_Service
+}
diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/README b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/README
new file mode 100755
index 00000000000..282768d11e9
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/README
@@ -0,0 +1,14 @@
+The service is registered with the naming service with the name
+"NotifyLogFactory" .
+
+To run the Notify Logging Service:
+------------------------
+1. you should have a running Naming Service.
+ if not, start one at $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service
+
+2. execute the Notify_Logging_Service
+ at $TAO_ROOT/orbsvcs/Logging_Service/Notify_Logging_Service/Notify_Logging_Service
+
+
+The idl spec is $TAO_ROOT/orbsvcs/orbsvcs/DsNotifyLogAdmin.idl
+see also $TAO_ROOT/orbsvcs/orbsvcs/DsLogNotification.idl
diff --git a/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/svc.conf b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/svc.conf
new file mode 100755
index 00000000000..8ffdb5ee8f1
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/Notify_Logging_Service/svc.conf
@@ -0,0 +1,3 @@
+##$Id$
+## Load the static Cos Notification Service
+static Notify_Default_Event_Manager_Objects_Factory "-MTDispatching -DispatchingThreads 1"
diff --git a/TAO/orbsvcs/Logging_Service/README b/TAO/orbsvcs/Logging_Service/README
new file mode 100644
index 00000000000..e3bcce3a3f8
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/README
@@ -0,0 +1,32 @@
+// README v 1.3 dhanvey <d.hanvey@qub.ac.uk> 14:43 30/05/02
+
+ Telecom Log Service
+ -------------------
+
+This is an implementation of the Telecom Log Service.
+
+The Log Service implementations are in $TAO_ROOT/orbsvcs/orbsvcs/Log
+
+The Logging Service is comprised of 3 separate services ...
+
+1. The Basic Logging Service - an event unaware service.
+ $TAO_ROOT/orbsvcs/Logging_Service/Basic_Logging_Service
+
+2. The Event Logging Service - an integration with the COS Event Service.
+ $TAO_ROOT/orbsvcs/Logging_Service/Event_Logging_Service
+
+3. The Notification Logging Service - an integration with the Notification Service.
+ $TAO_ROOT/orbsvcs/Logging_Service/Notify_Logging_Service
+
+There is also a RTEvent Logging Service available ...
+
+4. The RTEvent Logging Service
+ $TAO_ROOT/orbsvcs/orbsvcs/Logging_Service/RTEvent_Logging_Service
+
+Please see the README documents in each of the above folders for
+details on how to execute the respective services.
+
+Author:
+-------
+David Hanvey
+send suggestions, bugs, to David Hanvey <d.hanvey@qub.ac.uk>
diff --git a/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/.cvsignore b/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/.cvsignore
new file mode 100644
index 00000000000..b2ce1a35634
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/.cvsignore
@@ -0,0 +1 @@
+RTEvent_Logging_Service
diff --git a/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/Makefile.am b/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/Makefile.am
new file mode 100644
index 00000000000..bc87d82f809
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/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.RTEvent_Logging_Service.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+bin_PROGRAMS = RTEvent_Logging_Service
+
+RTEvent_Logging_Service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+RTEvent_Logging_Service_SOURCES = \
+ RTEvent_Logging_Service.cpp \
+ RTEvent_Logging_Service.h
+
+RTEvent_Logging_Service_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEventLogAdmin_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTSched.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEventLogAdmin_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEventLogAdmin.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)/orbsvcs/orbsvcs/libTAO_DsLogAdmin.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
+
+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/Logging_Service/RTEvent_Logging_Service/README b/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/README
new file mode 100755
index 00000000000..9f49da0c078
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/README
@@ -0,0 +1,14 @@
+The service is registered with the naming service with the name
+"RTEventLogFactory" .
+
+To run the RTEvent Logging Service:
+------------------------
+1. you should have a running Naming Service.
+ if not, start one at $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service
+
+2. execute the Event_Logging_Service
+ at $TAO_ROOT/orbsvcs/Logging_Service/RTEvent_Logging_Service/RTEvent_Logging_Service
+
+
+The idl spec is $TAO_ROOT/orbsvcs/orbsvcs/RTEventLogAdmin.idl
+see also $TAO_ROOT/orbsvcs/orbsvcs/DsLogNotification.idl
diff --git a/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/RTEvent_Logging_Service.cpp b/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/RTEvent_Logging_Service.cpp
new file mode 100644
index 00000000000..02dce835e2e
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/RTEvent_Logging_Service.cpp
@@ -0,0 +1,341 @@
+#include "RTEvent_Logging_Service.h"
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Sched/Config_Scheduler.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "tao/IORTable/IORTable.h"
+#include "ace/OS_main.h"
+#include "ace/OS_NS_strings.h"
+
+ACE_RCSID (RTEvent_Logging_Service,
+ RTEvent_Logging_Service,
+ "$Id$")
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ RTEvent_Logging_Service event_service;
+ return event_service.run (argc, argv);
+}
+
+// ****************************************************************
+
+RTEvent_Logging_Service::RTEvent_Logging_Service (void)
+ : sched_impl_ (0),
+ // ec_impl_ (0),
+ service_name_ (0),
+ ior_file_name_ (0),
+ pid_file_name_ (0),
+ global_scheduler_ (0),
+ rtevent_log_factory_name_ ("RTEventLogFactory"),
+ child_poa_name_ ("RTEventLog_ChildPOA"),
+ factory_servant_ (0)
+{
+}
+
+RTEvent_Logging_Service::~RTEvent_Logging_Service (void)
+{
+ //delete this->ec_impl_;
+ //this->ec_impl_ = 0;
+ //delete this->sched_impl_;
+ //this->sched_impl_ = 0;
+}
+
+int
+RTEvent_Logging_Service::run (int argc, char* argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize ORB.
+ this->orb_ =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->parse_args (argc, argv) == -1)
+ return 1;
+
+ ACE_NEW_RETURN (factory_servant_,
+ TAO_RTEventLogFactory_i (),
+ -1);
+
+ 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 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 initialize the Naming Service.\n"),
+ 1);
+
+ CosNaming::NamingContext_var context =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+// Alternative way to get NamingContext.
+/* if (naming_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 =
+ naming_client_.get_context ();
+*/
+
+ RtecScheduler::Scheduler_var scheduler;
+ // 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");
+
+
+ if (1) // this->event_service_type_ == ES_OLD_REACTIVE
+ // || this->event_service_type_ == ES_OLD_MT)
+ {
+ // We must find the scheduler object reference...
+
+ if (this->global_scheduler_ == 0)
+ {
+ ACE_NEW_RETURN (this->sched_impl_,
+ ACE_Config_Scheduler,
+ 1);
+
+ scheduler = this->sched_impl_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Register the servant with the Naming Context....
+ context->rebind (schedule_name, scheduler.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ CORBA::Object_var tmp =
+ context->resolve (schedule_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ scheduler = RtecScheduler::Scheduler::_narrow (tmp.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+
+
+/*
+ TAO_EC_Event_Channel_Attributes attr (root_poa.in (),
+ root_poa.in ());
+ TAO_EC_Event_Channel* ec;
+ ACE_NEW_RETURN (ec,
+ TAO_EC_Event_Channel (attr),
+ 1);
+ this->ec_impl_ = ec;
+ ec->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+*/
+ // Notice that we activate *this* object with the POA, but we
+ // forward all the requests to the underlying EC
+ // implementation.
+/*
+ RtecEventChannelAdmin::EventChannel_var ec =
+ this->_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 EC IOR is <%s>\n", str.in ()));
+
+ CosNaming::Name channel_name (1);
+ channel_name.length (1);
+ channel_name[0].id = CORBA::string_dup (this->service_name_);
+ naming_context->rebind (channel_name, ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+*/
+
+ if (factory_servant_->init (orb_.in (),
+ root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Unable to initialize "
+ "the factory. \n"),
+ 1);
+
+ // activate the factory in the root poa.
+ factory_ = factory_servant_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Give the ownership to the POA.
+ factory_servant_->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+ CORBA::String_var
+ ior = orb_->object_to_string (factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (true)
+ {
+ CORBA::Object_var table_object =
+ this->orb_->resolve_initial_references ("IORTable"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ IORTable::Table_var adapter =
+ IORTable::Table::_narrow (table_object.in ());
+ ACE_CHECK_RETURN (-1);
+
+ adapter->bind("RTEventLogService", ior.in ());
+ ACE_CHECK_RETURN (-1);
+ }
+
+ if (this->ior_file_name_ != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (this->ior_file_name_, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ this->ior_file_name_),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ if (this->pid_file_name_ != 0)
+ {
+ FILE *pidf = fopen (this->pid_file_name_, "w");
+ if (pidf != 0)
+ {
+ ACE_OS::fprintf (pidf,
+ "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pidf);
+ }
+ }
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (rtevent_log_factory_name_);
+ context->rebind (name,
+ factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ context->unbind (name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (!CORBA::is_nil (scheduler.in ()))
+ {
+ context->unbind (schedule_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "EC");
+ }
+ ACE_ENDTRY;
+
+
+ return 0;
+}
+
+int
+RTEvent_Logging_Service::parse_args (int argc, char *argv [])
+{
+ // default values...
+ this->service_name_ = "EventService";
+
+ ACE_Get_Opt get_opt (argc, argv, "n:o:p:s:");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'n':
+ this->service_name_ = get_opt.opt_arg ();
+ break;
+
+ case 'o':
+ this->ior_file_name_ = get_opt.opt_arg ();
+ break;
+
+ case 'p':
+ this->pid_file_name_ = get_opt.opt_arg ();
+ break;
+
+ case 's':
+ // It could be just a flag (i.e. no "global" or "local"
+ // argument, but this is consistent with the EC_Multiple
+ // test and also allows for a runtime scheduling service.
+
+ if (ACE_OS::strcasecmp (get_opt.opt_arg (), "global") == 0)
+ {
+ this->global_scheduler_ = 1;
+ }
+ else if (ACE_OS::strcasecmp (get_opt.opt_arg (), "local") == 0)
+ {
+ this->global_scheduler_ = 0;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Unknown scheduling type <%s> "
+ "defaulting to local\n",
+ get_opt.opt_arg ()));
+ this->global_scheduler_ = 0;
+ }
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "-n service_name "
+ "-o ior_file_name "
+ "-p pid_file_name "
+ "-s <global|local> "
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/RTEvent_Logging_Service.h b/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/RTEvent_Logging_Service.h
new file mode 100644
index 00000000000..629155423b4
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/RTEvent_Logging_Service.h
@@ -0,0 +1,84 @@
+/* -*- C++ -*- */
+
+// ============================================================================
+/**
+ * @file RTEvent_Logging_Service.h
+ *
+ * $Id$
+ *
+ * Front End of the Telecom Log Service
+ * RTEvent_Logging_Service
+ *
+ *
+ * @author D A Hanvey (d.hanvey@qub.ac.uk)
+ */
+// ============================================================================
+
+#ifndef RTEVENT_LOGGING_SERVICE_H
+#define RTEVENT_LOGGING_SERVICE_H
+
+#include "orbsvcs/RtecEventChannelAdminS.h"
+#include "orbsvcs/RtecSchedulerS.h"
+
+#include "orbsvcs/RTEventLogAdminS.h"
+
+#include "orbsvcs/Log/RTEventLogFactory_i.h"
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class RTEvent_Logging_Service
+{
+public:
+ RTEvent_Logging_Service (void);
+ virtual ~RTEvent_Logging_Service (void);
+
+ int run (int argc, char* argv[]);
+ // Run the event service.
+
+private:
+ int parse_args (int argc, char* argv[]);
+ // parse the command line args
+
+private:
+ POA_RtecScheduler::Scheduler *sched_impl_;
+ // The Scheduler implementation.
+
+ const char* service_name_;
+ // The name we use to bind with the NameService
+
+ const char* ior_file_name_;
+ // The name of the file were we output the Event_Service IOR.
+
+ const char* pid_file_name_;
+ // The name of a file where the process stores its pid
+
+ int global_scheduler_;
+ // Should we use a global scheduler or a local one?
+
+ const char* rtevent_log_factory_name_;
+ // The name of the factory registered with the naming service.
+
+ const char* child_poa_name_;
+ // The name of the Child POA.
+
+ TAO_RTEventLogFactory_i *factory_servant_;
+ // The factory servant.
+
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ PortableServer::POA_var root_poa_;
+ // Reference to the root poa.
+
+ RTEventLogAdmin::EventLogFactory_var factory_;
+ // The corba object after activation.
+
+ TAO_Naming_Client naming_client_;
+};
+
+#endif /* RTEVENT_LOGGING_SERVICE_H */
diff --git a/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/RTEvent_Logging_Service.mpc b/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/RTEvent_Logging_Service.mpc
new file mode 100644
index 00000000000..199315c55a2
--- /dev/null
+++ b/TAO/orbsvcs/Logging_Service/RTEvent_Logging_Service/RTEvent_Logging_Service.mpc
@@ -0,0 +1,5 @@
+// $Id$
+
+project: namingexe, iortable, core, rteventlogadmin_serv, valuetype {
+ exename = RTEvent_Logging_Service
+}
diff --git a/TAO/orbsvcs/Makefile.am b/TAO/orbsvcs/Makefile.am
new file mode 100644
index 00000000000..94851fb27c9
--- /dev/null
+++ b/TAO/orbsvcs/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
+
+SUBDIRS = \
+ TAO_Service \
+ orbsvcs \
+ Trading_Service \
+ Time_Service \
+ Scheduling_Service \
+ Notify_Service \
+ Naming_Service \
+ Logging_Service \
+ LoadBalancer \
+ LifeCycle_Service \
+ ImplRepo_Service \
+ IFR_Service \
+ Fault_Notifier \
+ Fault_Detector \
+ FT_ReplicationManager \
+ FTRT_Event_Service \
+ Event_Service \
+ Dump_Schedule \
+ CosEvent_Service \
+ Concurrency_Service
+
+if BUILD_TESTS
+SUBDIRS += \
+ performance-tests \
+ tests
+endif
+
+if BUILD_EXAMPLES
+SUBDIRS += \
+ examples
+endif
+
diff --git a/TAO/orbsvcs/Mobility_Service/GTP.idl b/TAO/orbsvcs/Mobility_Service/GTP.idl
new file mode 100644
index 00000000000..4f592550a5f
--- /dev/null
+++ b/TAO/orbsvcs/Mobility_Service/GTP.idl
@@ -0,0 +1,2 @@
+// $Id$
+//Hello
diff --git a/TAO/orbsvcs/Naming_Service/.cvsignore b/TAO/orbsvcs/Naming_Service/.cvsignore
new file mode 100644
index 00000000000..c089bb234b3
--- /dev/null
+++ b/TAO/orbsvcs/Naming_Service/.cvsignore
@@ -0,0 +1,2 @@
+NT_Naming_Service
+Naming_Service
diff --git a/TAO/orbsvcs/Naming_Service/Makefile.am b/TAO/orbsvcs/Naming_Service/Makefile.am
new file mode 100644
index 00000000000..dc236ad3e21
--- /dev/null
+++ b/TAO/orbsvcs/Naming_Service/Makefile.am
@@ -0,0 +1,101 @@
+## 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)
+
+bin_PROGRAMS =
+
+## Makefile.NT_Naming_Service.am
+
+if BUILD_WINNT
+if !BUILD_ACE_FOR_TAO
+
+bin_PROGRAMS += NT_Naming_Service
+
+NT_Naming_Service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+NT_Naming_Service_SOURCES = \
+ NT_Naming_Server.cpp \
+ NT_Naming_Service.cpp \
+ Naming_Service.cpp \
+ NT_Naming_Service.h \
+ Naming_Service.h
+
+NT_Naming_Service_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming_Serv.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_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming_Skel.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
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_WINNT
+
+## Makefile.Naming_Service.am
+
+if !BUILD_ACE_FOR_TAO
+
+bin_PROGRAMS += Naming_Service
+
+Naming_Service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+Naming_Service_SOURCES = \
+ Naming_Server.cpp \
+ Naming_Service.cpp \
+ Naming_Service.h
+
+Naming_Service_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_ImR_Client.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming_Serv.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_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming_Skel.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
+
+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/Naming_Service/NT_Naming_Server.cpp b/TAO/orbsvcs/Naming_Service/NT_Naming_Server.cpp
new file mode 100644
index 00000000000..dc1288420cb
--- /dev/null
+++ b/TAO/orbsvcs/Naming_Service/NT_Naming_Server.cpp
@@ -0,0 +1,228 @@
+// *- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// ace
+//
+// = FILENAME
+// NT_Naming_Server.cpp
+//
+//
+// = DESCRIPTION
+// Driver program that runs the TAO Naming Service as a Windows NT
+// Service.
+//
+// = AUTHORS
+// John Tucker <jtucker@infoglide.com> and
+// Mike Vitalo <mvitalo@infoglide.com>
+//
+// ============================================================================
+
+#include "ace/OS.h"
+
+#if !defined (ACE_WIN32)
+
+#include "ace/Log_Msg.h"
+
+int
+main (int, char*[])
+{
+ ACE_ERROR ((LM_INFO,
+ "This program is only supported "
+ "on Win32 platforms\n"));
+ return 1;
+}
+
+#else
+
+#include "ace/Get_Opt.h"
+
+#include "winreg.h"
+#include "NT_Naming_Service.h"
+
+// Default for the -i (install) option
+#define DEFAULT_SERVICE_INIT_STARTUP SERVICE_DEMAND_START
+
+class Options
+{
+ // = TITLE
+ // Keeps track of the command-line options for this program.
+public:
+ Options (void);
+ ~Options (void);
+
+ int run (int argc, char *argv[]);
+
+private:
+ void parse_args (int argc,
+ char *argv[]);
+ void print_usage_and_die (void);
+
+private:
+ char progname[128];
+
+ int opt_install;
+ int opt_remove;
+ int opt_start;
+ int opt_kill;
+ int opt_type;
+ int opt_debug;
+
+ int opt_startup;
+};
+
+typedef ACE_Singleton<Options, ACE_Mutex> OPTIONS;
+
+Options::Options (void)
+ : opt_install (0),
+ opt_remove (0),
+ opt_start (0),
+ opt_kill (0),
+ opt_type (0),
+ opt_debug (0),
+ opt_startup (0)
+{
+ ACE_OS::strcpy (progname,
+ "service");
+ ACE::init ();
+}
+
+Options::~Options (void)
+{
+ ACE::fini ();
+}
+
+void
+Options::print_usage_and_die (void)
+{
+ ACE_DEBUG ((LM_INFO,
+ "Usage: %s"
+ " -in -r -s -k -tn -d\n"
+ " -i: Install this program as an NT service, with specified startup\n"
+ " -r: Remove this program from the Service Manager\n"
+ " -s: Start the service\n"
+ " -k: Kill the service\n"
+ " -t: Set startup for an existing service\n"
+ " -d: Debug; run as a regular application\n",
+ progname,
+ 0));
+ ACE_OS::exit (1);
+}
+
+void
+Options::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opt (argc, argv, "i:rskt:d");
+ int c;
+
+ while ((c = get_opt ()) != -1)
+ switch (c)
+ {
+ case 'i':
+ opt_install = 1;
+ opt_startup = ACE_OS::atoi (get_opt.opt_arg ());
+ if (opt_startup <= 0)
+ print_usage_and_die ();
+ break;
+ case 'r':
+ opt_remove = 1;
+ break;
+ case 's':
+ opt_start = 1;
+ break;
+ case 'k':
+ opt_kill = 1;
+ break;
+ case 't':
+ opt_type = 1;
+ opt_startup = ACE_OS::atoi (get_opt.opt_arg ());
+ if (opt_startup <= 0)
+ print_usage_and_die ();
+ break;
+ case 'd':
+ //opt_debug = 1;
+ break;
+ default:
+ // -i can also be given without a value - if so, it defaults
+ // to defined value.
+ if (ACE_OS::strcmp (get_opt.argv ()[get_opt.opt_ind () - 1], "-i") == 0)
+ {
+ opt_install = 1;
+ opt_startup = DEFAULT_SERVICE_INIT_STARTUP;
+ }
+ else
+ this->print_usage_and_die ();
+ break;
+ }
+}
+
+// Define a function to handle Ctrl+C to cleanly shut this down.
+
+static BOOL __stdcall
+ConsoleHandler (DWORD /* ctrlType */)
+{
+ SERVICE::instance ()->handle_control (SERVICE_CONTROL_STOP);
+ return TRUE;
+}
+
+ACE_NT_SERVICE_DEFINE (service,
+ TAO_NT_Naming_Service,
+ "TAO NT Naming Service");
+
+int
+Options::run (int argc, char* argv[])
+{
+ SERVICE::instance ()->name ("TAO_NT_Naming_Service",
+ "TAO NT Naming Service");
+
+ this->parse_args (argc, argv);
+
+ if (opt_install && !opt_remove)
+ return SERVICE::instance ()->insert (opt_startup);
+
+ if (opt_remove && !opt_install)
+ return SERVICE::instance ()->remove ();
+
+ if (opt_start && opt_kill)
+ print_usage_and_die ();
+
+ if (opt_start)
+ return SERVICE::instance ()->start_svc ();
+
+ if (opt_kill)
+ return SERVICE::instance ()->stop_svc ();
+
+ if (opt_type)
+ return SERVICE::instance ()->startup (opt_startup);
+
+ // If we get here, we either run the app in debug mode (-d) or are
+ // being called from the service manager to start the service.
+
+ if (opt_debug)
+ {
+ SetConsoleCtrlHandler (&ConsoleHandler, 1);
+ SERVICE::instance ()->svc ();
+ }
+ else
+ {
+ ACE_NT_SERVICE_RUN (service,
+ SERVICE::instance (),
+ ret);
+ if (ret == 0)
+ ACE_ERROR ((LM_ERROR,
+ "%p\n",
+ "Couldn't start service"));
+ }
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ return OPTIONS::instance ()->run (argc, argv);
+}
+
+#endif /* ACE_WIN32 */
diff --git a/TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp
new file mode 100644
index 00000000000..506d38edb32
--- /dev/null
+++ b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.cpp
@@ -0,0 +1,199 @@
+// -*- C++ -*-
+
+// $Id$
+
+#include /**/ "NT_Naming_Service.h"
+
+#if defined (ACE_WIN32)
+
+#include /**/ "Naming_Service.h"
+#include "tao/ORB_Core.h"
+#include "ace/ARGV.h"
+
+#define REGISTRY_KEY_ROOT HKEY_LOCAL_MACHINE
+#define TAO_REGISTRY_SUBKEY "SOFTWARE\\ACE\\TAO"
+#define TAO_NAMING_SERVICE_OPTS_NAME "TaoNamingServiceOptions"
+#define TAO_SERVICE_PARAM_COUNT "TaoServiceParameterCount"
+
+AutoFinalizer::AutoFinalizer (TAO_NT_Naming_Service &service)
+ : service_ (service)
+{
+}
+
+AutoFinalizer::~AutoFinalizer ()
+{
+ service_.report_status (SERVICE_STOPPED);
+ ACE_DEBUG ((LM_DEBUG, "Reported service stoped\n"));
+}
+
+
+TAO_NT_Naming_Service::TAO_NT_Naming_Service (void)
+ : argc_ (0),
+ argc_save_ (0),
+ argv_ (0),
+ argv_save_ (0)
+{
+}
+
+TAO_NT_Naming_Service::~TAO_NT_Naming_Service (void)
+{
+ if (argv_save_)
+ {
+ for (int i = 0; i < argc_save_; i++)
+ ACE_OS::free (argv_save_[i]);
+
+ ACE_OS::free (argv_save_);
+ }
+}
+
+void
+TAO_NT_Naming_Service::handle_control (DWORD control_code)
+{
+ if (control_code == SERVICE_CONTROL_SHUTDOWN
+ || control_code == SERVICE_CONTROL_STOP)
+ {
+ // Just in case any of the following method calls
+ // throws in a way we do not expect.
+ // This instance's destructor will notify the OS.
+ AutoFinalizer afinalizer (*this);
+
+ report_status (SERVICE_STOP_PENDING);
+
+ // This must be all that needs to be done since this method is executing
+ // in a separate thread from the one running the reactor.
+ // When the reactor is stopped it calls ORB::destroy(), which in turn
+ // calls ORB::shutdown(1) *and* unbinds the ORB from the ORB table.
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ TAO_ORB_Core_instance ()->orb ()->shutdown (1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // What should we do here? Even the log messages are not
+ // showing up, since the thread that runs this is not an ACE
+ // thread. It is allways spawned/controlled by Windows ...
+ }
+ ACE_ENDTRY;
+ }
+ else
+ {
+ ACE_NT_Service::handle_control (control_code);
+ }
+}
+
+int
+TAO_NT_Naming_Service::handle_exception (ACE_HANDLE)
+{
+ return 0;
+}
+
+int
+TAO_NT_Naming_Service::init (int argc,
+ ACE_TCHAR *argv[])
+{
+ HKEY hkey = 0;
+ BYTE buf[ACE_DEFAULT_ARGV_BUFSIZ];
+
+ *buf = '\0';
+
+ // This solution is very kludgy. It looks in the NT Registry under
+ // \\HKEY_LOCAL_MACHINE\SOFTWARE\ACE\TAO for the value of
+ // "TaoNamingServiceOptions" for any Naming Service options such as
+ // "-ORBEndpoint".
+
+ // Get Naming Service options from the NT Registry.
+
+ ACE_TEXT_RegOpenKeyEx (REGISTRY_KEY_ROOT,
+ TAO_REGISTRY_SUBKEY,
+ 0,
+ KEY_READ,
+ &hkey);
+
+ DWORD type;
+ DWORD bufSize = sizeof (buf);
+
+ ACE_TEXT_RegQueryValueEx (hkey,
+ TAO_NAMING_SERVICE_OPTS_NAME,
+ NULL,
+ &type,
+ buf,
+ &bufSize);
+
+ RegCloseKey (hkey);
+
+ // Add options to the args list (if any).
+
+ if (ACE_OS::strlen ((char *) buf) > 0)
+ {
+ ACE_ARGV args ((const char*) buf);
+ // Allocate the internal args list to be one bigger than the
+ // args list passed into the function. We use a 'save' list in
+ // case we use a 'destructive' args list processor - this way we
+ // maintain the correct argv and argc for memory freeing
+ // operations in the destructor.
+ argv_save_ = (char **) ACE_OS::malloc (sizeof (char *) * (argc + args.argc ()));
+
+ // Copy the values into the internal args buffer.
+ int i;
+ for (i = 0; i < argc; i++)
+ argv_save_[i] = ACE_OS::strdup (argv[i]);
+
+ int j = 0;
+ for (i = argc; i < static_cast<int> ((args.argc () + argc)); i++)
+ argv_save_[i] = ACE_OS::strdup (args.argv ()[j++]);
+
+ // Set the arg counter.
+ argc_save_ = argc + args.argc ();
+ argc_ = argc_save_;
+ argv_ = argv_save_;
+ }
+ else
+ {
+ argc_ = argc;
+ argv_ = argv;
+ }
+
+ return 0;
+}
+
+int
+TAO_NT_Naming_Service::svc (void)
+{
+ TAO_Naming_Service naming_service;
+
+ if (naming_service.init (argc_,
+ argv_) == -1)
+ return -1;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Just in case handle_control does not get the chance
+ // to execute, or is never called by Windows. This instance's
+ // destructor will inform the OS of our demise.
+ AutoFinalizer afinalizer (*this);
+
+ ACE_DEBUG ((LM_INFO, "Notifying Windows of service startup\n"));
+ report_status (SERVICE_RUNNING);
+
+ naming_service.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_INFO, "Exception in service - exitting\n"));
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO NT Naming Service");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (1);
+
+ ACE_DEBUG ((LM_INFO, "Exiting gracefully\n"));
+ return 0;
+}
+
+#endif /* ACE_WIN32 */
diff --git a/TAO/orbsvcs/Naming_Service/NT_Naming_Service.h b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.h
new file mode 100644
index 00000000000..7d0ced9acf7
--- /dev/null
+++ b/TAO/orbsvcs/Naming_Service/NT_Naming_Service.h
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// ace
+//
+// = FILENAME
+// NT_Naming_Service.h
+//
+//
+// = DESCRIPTION
+// Run the TAO Naming Service as a Windows NT Service.
+//
+// = AUTHORS
+// John Tucker <jtucker@infoglide.com> and
+// Mike Vitalo <mvitalo@infoglide.com>
+//
+// ============================================================================
+
+#ifndef TAO_NT_NAMING_SERVICE_H
+#define TAO_NT_NAMING_SERVICE_H
+
+#include /**/ "ace/OS.h"
+
+#if defined (ACE_WIN32)
+
+#include /**/ "ace/NT_Service.h"
+#include /**/ "ace/Singleton.h"
+#include /**/ "ace/Synch.h"
+#include /**/ "tao/orbconf.h"
+
+class TAO_NT_Naming_Service : public ACE_NT_Service
+{
+ // = TITLE
+ // Run the TAO Naming Service as a Windows NT Service.
+public:
+ typedef TAO_SYNCH_RECURSIVE_MUTEX MUTEX;
+
+ // = Initialization and termination hooks.
+ TAO_NT_Naming_Service (void);
+ virtual ~TAO_NT_Naming_Service (void);
+
+ virtual void handle_control (DWORD control_code);
+ // We override <handle_control> because it handles stop requests
+ // privately.
+
+ virtual int handle_exception (ACE_HANDLE h);
+ // We override <handle_exception> so a 'stop' control code can pop
+ // the reactor off of its wait.
+
+ virtual int svc (void);
+ // This is a virtual method inherited from ACE_NT_Service.
+
+ virtual int init (int argc,
+ ACE_TCHAR *argv[]);
+ // Initialize the objects argc_ and argv_ attributes values.
+
+private:
+ // = Keep track of the "command-line" arguments.
+ int argc_;
+ int argc_save_;
+ // Argument count.
+
+ char **argv_;
+ char **argv_save_;
+ // Argument list.
+
+ friend class ACE_Singleton<TAO_NT_Naming_Service, MUTEX>;
+ friend class AutoFinalizer;
+
+};
+
+/**
+ * A class with a "magic" constructor/desructor to call the inherited
+ * from ACE_NT_Service report_status() when an instance of it goes out
+ * of scope, should an exception occurs.
+ */
+class AutoFinalizer
+{
+
+public:
+ AutoFinalizer (TAO_NT_Naming_Service &service);
+ ~AutoFinalizer ();
+
+private:
+ TAO_NT_Naming_Service &service_;
+};
+
+
+
+typedef ACE_Singleton<TAO_NT_Naming_Service, TAO_NT_Naming_Service::MUTEX> SERVICE;
+
+#endif /* ACE_WIN32 */
+#endif /* TAO_NT_NAMING_SERVER_H */
diff --git a/TAO/orbsvcs/Naming_Service/Naming_Server.cpp b/TAO/orbsvcs/Naming_Service/Naming_Server.cpp
new file mode 100644
index 00000000000..65631eb726e
--- /dev/null
+++ b/TAO/orbsvcs/Naming_Service/Naming_Server.cpp
@@ -0,0 +1,69 @@
+// $Id$
+
+#include "Naming_Service.h"
+#include "ace/OS_main.h"
+
+#include "orbsvcs/Shutdown_Utilities.h"
+#include "tao/debug.h"
+
+#include "tao/ImR_Client/ImR_Client.h"
+
+class Naming_Svc_Shutdown : public Shutdown_Functor
+{
+public:
+ Naming_Svc_Shutdown(TAO_Naming_Service& ns);
+
+ void operator() (int which_signal);
+private:
+ TAO_Naming_Service& ns_;
+};
+
+Naming_Svc_Shutdown::Naming_Svc_Shutdown (TAO_Naming_Service &ns)
+ : ns_(ns)
+{
+}
+
+void
+Naming_Svc_Shutdown::operator() (int which_signal)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Name Service: shutting down on signal %d\n",
+ which_signal));
+ (void) this->ns_.shutdown ();
+}
+
+// Driver function for the TAO Naming Service.
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ TAO_Naming_Service naming_service;
+
+ // Stuff to insure that we're gracefully shut down...
+ Naming_Svc_Shutdown killer (naming_service);
+ Service_Shutdown kill_contractor(killer);
+
+ if (naming_service.init (argc, argv) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("Failed to start the Naming Service.\n")),
+ 1);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ naming_service.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "NamingService");
+ return 1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (1);
+
+ naming_service.fini ();
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/Naming_Service/Naming_Service.cpp b/TAO/orbsvcs/Naming_Service/Naming_Service.cpp
new file mode 100644
index 00000000000..22e055649e3
--- /dev/null
+++ b/TAO/orbsvcs/Naming_Service/Naming_Service.cpp
@@ -0,0 +1,158 @@
+// $Id$
+
+#include "Naming_Service.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Argv_Type_Converter.h"
+
+ACE_RCSID(Naming_Service, Naming_Service, "$Id$")
+
+// Default Constructor.
+
+TAO_Naming_Service::TAO_Naming_Service (void)
+ : time_ (0)
+{
+}
+
+// Constructor taking command-line arguments.
+TAO_Naming_Service::TAO_Naming_Service (int argc,
+ ACE_TCHAR* argv[])
+ : time_ (0)
+{
+ this->init (argc, argv);
+}
+
+
+// Initialize the state of the TAO_Naming_Service object
+int
+TAO_Naming_Service::init (int argc,
+ ACE_TCHAR* argv[])
+{
+ int result;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Copy command line parameter.
+ ACE_Argv_Type_Converter command_line(argc, argv);
+
+ // Initialize the ORB
+ this->orb_ =
+ CORBA::ORB_init (command_line.get_argc(), command_line.get_ASCII_argv(), 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Parse the args for '-t' option. If '-t' option is passed, do
+ // the needful and then remove the option from the list of
+ // arguments.
+ this->parse_args (command_line.get_argc(), command_line.get_TCHAR_argv());
+
+ // This function call initializes the naming service and returns
+ // '-1' in case of an exception.
+ result = this->my_naming_server_.init_with_orb (command_line.get_argc(),
+ command_line.get_TCHAR_argv(),
+ this->orb_.in ());
+
+ if (result == -1)
+ return result;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Naming_Service::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+TAO_Naming_Service::parse_args (int &argc,
+ ACE_TCHAR* argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("-t:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 't':
+ {
+ int time = ACE_OS::atoi (get_opts.opt_arg ());
+ if (time >= 0)
+ this->time_ = time;
+
+ // Remove the option '-t' from argv []
+ // to avoid any confusion that might result.
+ for (int i = get_opts.opt_ind (); i != argc; ++i)
+ argv [i-2 ] = argv [i];
+
+ // Decrement the value of argc to reflect the removal
+ // of '-t' option.
+ argc = argc - 2;
+ break;
+ }
+ case '?':
+ default:
+ // Don't do anything. The TAO_Naming_Server::parse_args ()
+ // takes care of indicating an error in case of error.
+ break;
+ }
+ }
+ return 0;
+}
+
+// Run the ORB event loop.
+int
+TAO_Naming_Service::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (time_ == 0)
+ {
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ else
+ {
+ ACE_Time_Value tv (time_);
+ this->orb_->run (tv ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ return 0;
+}
+
+void
+TAO_Naming_Service::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+TAO_Naming_Service::fini (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ this->my_naming_server_.fini();
+
+ ACE_TRY
+ {
+ // destroy implies shutdown
+ this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Naming_Service::fini");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+// Destructor.
+TAO_Naming_Service::~TAO_Naming_Service (void)
+{
+ // Destructor
+}
diff --git a/TAO/orbsvcs/Naming_Service/Naming_Service.h b/TAO/orbsvcs/Naming_Service/Naming_Service.h
new file mode 100644
index 00000000000..2ad9cb1f7dd
--- /dev/null
+++ b/TAO/orbsvcs/Naming_Service/Naming_Service.h
@@ -0,0 +1,76 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs/Naming_Service/Naming_Service
+//
+// = FILENAME
+// Naming_Service.h
+//
+// = DESCRIPTION
+// This class implements the functionality of a Naming_Service in
+// a stand-alone process.
+//
+// = AUTHORS
+// Nagarajan Surendran (naga@cs.wustl.edu)
+// Marina Spivak <marina@cs.wustl.edu>
+// ============================================================================
+
+#ifndef TAO_NAMING_SERVICE_H
+#define TAO_NAMING_SERVICE_H
+
+#include "orbsvcs/Naming/Naming_Server.h"
+
+class TAO_Naming_Service
+{
+ // = TITLE
+ // Defines a class that encapsulates the implementation of the
+ // COS Naming Service.
+ //
+ // = DESCRIPTION
+ // This class makes use of the <TAO_Naming_Server> and
+ // <TAO_ORB_Manager> class to implement the COS Naming Service.
+public:
+ TAO_Naming_Service (void);
+ // Default Constructor.
+
+ TAO_Naming_Service (int argc, ACE_TCHAR* argv[]);
+ // Constructor taking the command-line arguments.
+
+ virtual int init (int argc, ACE_TCHAR* argv[]);
+ // Initialize the Naming Service with the arguments.
+
+ virtual int fini (void);
+ // The opposite of init().
+
+ int run (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ // Run the TAO_Naming_Service.
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ // Shut down the TAO_Naming_Service; you must still call fini().
+
+ virtual ~TAO_Naming_Service (void);
+ // Destructor.
+
+protected:
+
+ int parse_args (int &argc, ACE_TCHAR* argv[]);
+ // Parse the command line arguments to find
+ // the timeout period.
+
+ CORBA::ORB_var orb_;
+ // The ORB.
+
+ // PortableServer::POA_var root_poa_;
+ // The Root POA.
+
+ TAO_Naming_Server my_naming_server_;
+ // Naming Server instance.
+
+ long time_;
+ // After how long the server should stop listening to requests (in
+ // seconds).
+};
+
+#endif /* TAO_NAMING_SERVICE_H */
diff --git a/TAO/orbsvcs/Naming_Service/Naming_Service.mpc b/TAO/orbsvcs/Naming_Service/Naming_Service.mpc
new file mode 100644
index 00000000000..9382d787a92
--- /dev/null
+++ b/TAO/orbsvcs/Naming_Service/Naming_Service.mpc
@@ -0,0 +1,21 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcsexe, core, naming_serv, imr_client {
+ exename = Naming_Service
+ Source_Files {
+ Naming_Server.cpp
+ Naming_Service.cpp
+ }
+}
+
+project(NT_Naming_Service) : orbsvcsexe, core, naming_serv {
+ requires += winnt
+ exename = NT_Naming_Service
+ Source_Files {
+ Naming_Service.cpp
+ NT_Naming_Server.cpp
+ NT_Naming_Service.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/Naming_Service/README b/TAO/orbsvcs/Naming_Service/README
new file mode 100644
index 00000000000..9cc96f8575d
--- /dev/null
+++ b/TAO/orbsvcs/Naming_Service/README
@@ -0,0 +1,409 @@
+// README,v 1.19 2001/02/02 20:21:38 schmidt Exp
+
+This directory contains files that implement a server for the TAO
+Naming Service. In addition, it contains files that run the TAO
+Naming Service as a Windows NT Service. Both of these services are
+described below.
+
+How to Run the TAO Naming Service
+=================================
+
+The following describes how to run the TAO Naming Service.
+
+1. Syntax
+
+ % Naming_Service [-ORBNameServicePort nsport]
+ [-o ior_output_file]
+ [-p pid_file_name]
+ [-s context_size]
+ [-t time]
+ [-f persistence_file_name]
+ [-b base_address]
+ [-m (1=enable multicast responses,0=disable(default)]
+ [-z time]
+ [-d ]
+ [-u directory]
+ [-r directory]
+
+
+2. Optional Command-line Arguments
+
+ -ORBNameServicePort nsport
+ Multicast port for listening for requests from clients
+ trying to bootstrap to a Naming Service through the
+ use of multicast. This is only used when multicast
+ responding is enabled via '-m 1'.
+
+ -o ior_output_file
+ The name of the file, in which to store the IOR of the
+ root Naming Service context.
+
+ -p pid_file_name
+ The name of the file, in which to store the process id
+ of the Naming Service server.
+
+ -s context_size
+ Size of the hash table allocated for the root Naming
+ Context (if one is created). All contexts created
+ under the root will use the same size for their hash
+ tables. The default is 1024.
+
+ -t time
+ How long (in seconds) the server should listen for
+ client requests before terminating.
+
+ -f persistence_file_name
+ The name of the file to use to store/retrieve
+ persistent state of the Naming Service. Without this
+ option, Naming Service is started in non-persistent
+ mode.
+
+ -b base_address
+ The address used for memory mapping the file specified
+ with the "-f" option above. The value supplied with
+ this option is only used when the Naming Service runs
+ in persistent mode, i.e., "-f" option is present.
+
+ -m <0|1>
+ TAO offers a simple, very non-standard method for
+ clients to discover the initial reference for the
+ Naming Service. However, since it can be inadequate and cause
+ unexpected results if, for example, there are multiple
+ naming services running on the network, the DEFAULT
+ behavior is for the Naming Service to NOT RESPOND to
+ such multicast queries (use the Interoperable Naming
+ Service bootstrap options instead).
+
+ -z time
+ A relative round trip timeout value (in seconds) that
+ the service should wait for when trying to progress an
+ operation through a federated naming context before
+ timing out and throwing a 'Cannot proceed' exception
+ to the client. If no value is set this will never occur.
+
+ -d
+ Provides Naming Service specific debug information. By default
+ no diagnostics are given.
+
+ -u directory
+ Use a flat-file persistence implementation that stores object
+ reference information in a file per context. Each context file
+ is placed in the directory specified.
+
+ -r directory
+ Use redundant flat-file persistnece; same as the -u option,
+ except more than one instance of the TAO Naming Service server
+ can run, each using the same set of disk files, to achieve a
+ degree of fault tolerence (as long as directory is accessible
+ to both servers).
+
+
+3. Environment Variables
+
+ NameServicePort
+ Multicast port for listening for requests from clients
+ trying to bootstrap to a Naming Service through the
+ use of multicast. This is only used when multicast
+ responding is enabled via '-m 1'.
+
+4. Persistence
+
+ TAO Naming Service has an optional persistence capability. By
+ default, the Naming Service is started in a non-persistent
+ mode. Supplying "-f" command-line option to the server causes
+ a persistent version of the Naming Service to run.
+
+ The file specified with the "-f" option is used to store the
+ persistent state of the Naming Service, i.e., all Naming
+ Contexts and their bindings. When "-f" option is specified:
+
+ 1. If the specified file does not exist, it is created and
+ used to store the state of the Naming Service. An initial
+ (root) Naming Context is also created.
+
+ 2. If the specified file exists, it is scanned and:
+
+ a) If any inconsistency is detected in the stored
+ state, or the file is not recognized by the Naming
+ Service, the server exits. (This may happen, for
+ example, if a server or host crashed in the middle of
+ writing a record to this file on a previous run). A
+ noncorrupted version of the file must be used instead.
+
+ b) If the file is recognized and is ok, the state
+ stored in the file becomes the current state of the
+ Naming Service.
+
+ Internally, TAO uses memory mapped file to implement
+ persistence feature of the Naming Service. A default memory
+ address (ACE_DEFAULT_BASE_ADDR) is used for mapping the file.
+ Alternate mapping address can be specified at compile-time by
+ redefining TAO_NAMING_BASE_ADDR in tao/orbconf.h. Alternate
+ mapping address can also be specified at run-time
+ with the "-b" command-line option, which takes precedence over
+ TAO_NAMING_BASE_ADDR definition.
+ NOTE: Naming Service stores absolute pointers in its
+ memory-mapped file. Therefore, it is important to use the
+ same mapping address on each run for the same persistence file.
+
+
+5. Implementation Policies
+
+ a. Destroying Binding Iterators
+
+ A binding iterator is destroyed when client invokes
+ <destroy> operation either on the iterator itself or
+ on the naming context it is iterating over. In both
+ cases, subsequent calls on the binding iterator object
+ will cause OBJECT_NOT_EXIST exception.
+
+ b. Dealing with orphaned contexts
+
+ This implementation of the Naming Service does not
+ include any form of 'garbage collection' for orphaned
+ naming contexts. It is solely the responsibility of
+ clients to clean up after themselves and not leak
+ server resources. All the resources, including
+ orphaned contexts, are released during the Naming
+ Server shutdown.
+
+6. Clients: ways to bootstrap to the Naming Service:
+
+ There are several methods for a client to bootstrap to a
+ Naming Service, i.e., there are several mechanisms
+ <resolve_initial_references> can use when asked for
+ "NameService". In order of predictable behavior, they are:
+
+ 1. Command-line options
+
+ The "-ORBInitRef NameService=IOR:..." or environment
+ variable NameServiceIOR can be used on the client side
+ to specify the object that the call to
+ <resolve_initial_references> should return to the
+ client. (On the server side, -o option can be used to
+ get the ior).
+
+ Example (Unix, same host):
+
+ % $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ior_file
+ % my_client -ORBInitRef NameService=file://ior_file
+
+ On the first line, we start the Naming
+ Service, and output its ior to <ior_file>. On
+ the second line, we start some client, and
+ specify the ior <resolve_initial_references>
+ should return for the Naming Service in a file
+ format.
+
+ 2. Interoperable Naming Service.
+
+ TAO implements the standard CORBA Interoperable Naming
+ Service (ING). Therefore, most initialization options
+ provided by INS can be used to bootstrap to the Naming
+ Service (see TAO's release notes for the status of INS
+ implementation).
+
+ 3. Multicast
+
+ When started with the "respond to multicast queries"
+ option turned on ('-m 1'), clients can use IP
+ multicast to query for a Naming Service, and this
+ instance will respond. TAO Naming Server is listening
+ for client multicast requests on a specified port. On
+ the client side, <resolve_initial_references> sends
+ out a multicast request on the network, trying to
+ locate a Naming Service. When a Naming Server
+ receives a multicast request from a client, it replies
+ to the sender with the ior of its root Naming Context.
+ Note, the port used for this bootstrapping process,
+ i.e., 'multicast port', has nothing to do with the ORB
+ port used for CORBA communication. Other points worth
+ mentioning:
+
+ - A client and a server will only click through this
+ multicast protocol if they are using the same
+ multicast port. For both client and server
+ -ORBnameserviceport command-line option and
+ NameServicePort environment variable can be used to
+ specify the multicast port to use. If none is
+ specified, the default port is used. (The ability
+ to specify multicast ports can be used to match
+ certain clients with certain Naming Servers, when
+ there are more than one Naming Server running on the
+ network).
+
+ - If there are several Naming Servers running on the
+ network, each listening on the same port for
+ multicast requests, each will send a reply to a
+ client's request. The client's orb will use the
+ first response it receives, so the Naming Service
+ will, in fact, be selected at random.
+
+ Since this mechanism is proprietary to TAO (i.e.,
+ non-standard), it only works when both client and
+ server are written using TAO. There is no way to turn
+ multicasting off on the client side, but it is used
+ only as a last resort, i.e., any of the other options
+ will override it.
+
+ When OS platform doesn't support multicast, or client
+ or server isn't written using TAO, or a more
+ reliable/predictable location method is desired, etc.,
+ one of the other options can be used to bootstrap to
+ the Naming Service.
+
+
+How to use the NT_Naming_Service
+================================
+
+To set the options for the TAO Naming Service, go to the Services icon
+in the Settings group under the start menu (start menu -> settings ->
+services). There, highlight the NT_Naming_Service, which is the name
+used by the Naming Service when it is registered. After it's
+highlighted, you should see at the bottom of the dialog box an area to
+specify options. Just enter the options you wish in that edit box and
+everything should just work. However, some options, such as
+-ORBDebugLevel, won't work since an NT service can't write output to
+standard out.
+
+1. Syntax
+
+ % NT_Naming_Server [-i value]
+ [-r]
+ [-s]
+ [-k]
+ [-t n]
+ [-d]
+
+2. Optional Command-line Arguments
+
+ -i value
+ Install this program as an NT service, with specified startup
+
+ -r
+ Remove this program from the Service Manager
+ -s
+ Start the service
+
+ -k
+ Kill the service
+
+ -t value
+ Set startup for an existing service
+
+ -d
+ Debug; run as a regular application
+
+3. Usage
+
+ To see different stages of an NT service application, you have
+ to run the program several times, with different options.
+ Please note: run with only one option at a time.
+
+ a. First, you must initialize the service in the NT SCM
+ database. Run NT_Naming_Service with -in, where n is one of
+ the following startup options:
+
+ // Start Type (from WinNT.h)
+ //
+ #define SERVICE_SYSTEM_START 0x00000001
+ #define SERVICE_AUTO_START 0x00000002
+ #define SERVICE_DEMAND_START 0x00000003
+ #define SERVICE_DISABLED 0x00000004
+
+ If only -i is specified, SERVICE_DEMAND_START is default option.
+
+ b. Now you are ready to run the actual service. Run
+ NT_Naming_Service again, this time with -s option. If the
+ service starts successfully, it will ring the system
+ bell every second or so until the service is stopped.
+
+ c. To stop service execution, run NT_Naming_Service with the
+ -k option.
+
+ d. To remove the service from the Service Control Manager
+ database, run NT_Naming_Service with -r.
+
+ In addition, once you have initialized this service (by using
+ the -i option) you can change its startup type to one of the
+ other values above. To do this, run NT_Naming_Service with
+ -tn option. n is as explained above for -i.
+
+ In order to debug the service's execution itself, use the -d
+ option.
+
+Troubleshooting
+============================================
+
+Q1. Error Message: "subscribe: no such device"
+
+A1. On starting, the error message "subscribe: no such device" is a
+rather cryptic message saying that basically either you don't support
+multicasting or there is no route for multicasting on one of your
+network interfaces( e.g. eth0 ).
+
+---------------------------------------
+(Step 1)
+Check to see if you have multicasting enabled. In the case of Linux
+you will need to check the configuration of your kernel. RedHat users
+have multicasting enabled by default. Once you are sure that you have
+multicast enabled then move to the next step. Alternative is to start
+Naming_Service with multicast disabled.
+
+
+---------------------------------------
+(Step 2)
+Check to see if you have the route for multicasting. Linux users can
+do this by running:
+
+ /sbin/route
+
+You should see something like this:
+
+Kernel IP routing table
+Destination Gateway Genmask Flags Metric Ref Use Iface
+10.0.0.0 * 255.255.255.0 U 0 0 0 eth0
+127.0.0.0 * 255.0.0.0 U 0 0 0 lo
+224.0.0.0 * 240.0.0.0 U 0 0 0 eth0
+
+If you don't see the line for multicast routing:
+
+224.0.0.0 * 240.0.0.0 U 0 0 0 eth0
+
+You will need to add in the next step. If you do see that line and the
+problem is still there then contact the tao-users list by using
+email. Please remember to use the problem form. It helps developers to
+have a more educated guess at the exact problem you are having.
+
+
+---------------------------------------
+(Step 3)
+
+You can do this manually in a script that start the Naming service:
+
+(Linux/Unix):
+
+ /sbin/route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
+
+Alternatively for RedHat users you can add this into a file
+"/etc/sysconfig/static-routes". As of Redhat 7, you might have to
+create this file, you can make an entry:
+
+ eth0 net 240.0.0.0 netmask 240.0.0.0
+
+On startup when the network interfaces that will be supporting
+multicast routing are started the route will be added. In my case it
+adds multicasting routing to eth0 (the first NIC).
+
+----------------------------------------
+(Step 4)
+
+Double check that the route has been added correctly using /sbin/route.
+
+Kernel IP routing table
+Destination Gateway Genmask Flags Metric Ref Use Iface
+10.0.0.0 * 255.255.255.0 U 0 0 0 eth0
+127.0.0.0 * 255.0.0.0 U 0 0 0 lo
+224.0.0.0 * 240.0.0.0 U 0 0 0 eth0
+
+At this point you should be able to run Naming_Service. Have fun!
diff --git a/TAO/orbsvcs/Notify_Service/.cvsignore b/TAO/orbsvcs/Notify_Service/.cvsignore
new file mode 100644
index 00000000000..3de70f7f49a
--- /dev/null
+++ b/TAO/orbsvcs/Notify_Service/.cvsignore
@@ -0,0 +1,2 @@
+NT_Notify_Service
+Notify_Service
diff --git a/TAO/orbsvcs/Notify_Service/Makefile.am b/TAO/orbsvcs/Notify_Service/Makefile.am
new file mode 100644
index 00000000000..c7da6212cb3
--- /dev/null
+++ b/TAO/orbsvcs/Notify_Service/Makefile.am
@@ -0,0 +1,108 @@
+## 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)
+
+bin_PROGRAMS =
+
+## Makefile.NT_Notify_Service.am
+
+if BUILD_WINNT
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+bin_PROGRAMS += NT_Notify_Service
+
+NT_Notify_Service_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
+
+NT_Notify_Service_SOURCES = \
+ NT_Notify_Server.cpp \
+ NT_Notify_Service.cpp \
+ Notify_Service.cpp \
+ NT_Notify_Service.h \
+ Notify_Service.h
+
+NT_Notify_Service_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.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_CosNotification_Skel.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)/orbsvcs/orbsvcs/libTAO_Svc_Utils.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_ACE_FOR_TAO
+endif BUILD_WINNT
+
+## Makefile.Notify_Service.am
+
+if !BUILD_MINIMUM_CORBA
+
+bin_PROGRAMS += Notify_Service
+
+Notify_Service_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
+
+Notify_Service_SOURCES = \
+ Notify_Server.cpp \
+ Notify_Service.cpp \
+ Notify_Service.h
+
+Notify_Service_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.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_CosNotification_Skel.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)/orbsvcs/orbsvcs/libTAO_Svc_Utils.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
+
+## 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/Notify_Service/NT_Notify_Server.cpp b/TAO/orbsvcs/Notify_Service/NT_Notify_Server.cpp
new file mode 100644
index 00000000000..0b8dfac859c
--- /dev/null
+++ b/TAO/orbsvcs/Notify_Service/NT_Notify_Server.cpp
@@ -0,0 +1,231 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// ace
+//
+// = FILENAME
+// NT_Notify_Server.cpp
+//
+//
+// = DESCRIPTION
+// Driver program that runs the TAO Notification Service as a Windows NT
+// Service.
+//
+// = AUTHORS
+// John Tucker <jtucker@infoglide.com>,
+// Mike Vitalo <mvitalo@infoglide.com>, and
+// David Robison <drrobison@openroadsconsulting.com>
+//
+// ============================================================================
+
+#include "ace/OS.h"
+
+#if !defined (ACE_WIN32)
+
+#include "ace/Log_Msg.h"
+
+int
+main (int, char*[])
+{
+ ACE_ERROR ((LM_INFO,
+ "This program is only supported "
+ "on Win32 platforms\n"));
+ return 1;
+}
+
+#else
+
+#include "ace/Get_Opt.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/ARGV.h"
+#include "ace/Configuration.h"
+
+#include "winreg.h"
+#include "NT_Notify_Service.h"
+
+// Default for the -i (install) option
+#define DEFAULT_SERVICE_INIT_STARTUP SERVICE_DEMAND_START
+
+class Options
+{
+ // = TITLE
+ // Keeps track of the command-line options for this program.
+public:
+ Options (void);
+ ~Options (void);
+
+ int run (int argc, char *argv[]);
+
+private:
+ void parse_args (int argc, char *argv[]);
+ void print_usage_and_die (void);
+
+private:
+ char progname[128];
+
+ int opt_install;
+ int opt_remove;
+ int opt_start;
+ int opt_kill;
+ int opt_type;
+ int opt_debug;
+
+ int opt_startup;
+};
+
+typedef ACE_Singleton<Options, ACE_Mutex> OPTIONS;
+
+Options::Options (void)
+ : opt_install (0),
+ opt_remove (0),
+ opt_start (0),
+ opt_kill (0),
+ opt_type (0),
+ opt_debug (0),
+ opt_startup (0)
+{
+ ACE_OS::strcpy (progname,
+ "service");
+ ACE::init ();
+}
+
+Options::~Options (void)
+{
+ ACE::fini ();
+}
+
+void
+Options::print_usage_and_die (void)
+{
+ ACE_DEBUG ((LM_INFO,
+ "Usage: %s"
+ " -in -r -s -k -tn -d\n"
+ " -i: Install this program as an NT service, with specified startup\n"
+ " -r: Remove this program from the Service Manager\n"
+ " -s: Start the service\n"
+ " -k: Kill the service\n"
+ " -t: Set startup for an existing service\n"
+ " -d: Debug; run as a regular application\n",
+ progname,
+ 0));
+ ACE_OS::exit (1);
+}
+
+void
+Options::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opt (argc, argv, "i:rskt:d");
+ int c;
+
+ while ((c = get_opt ()) != -1)
+ switch (c)
+ {
+ case 'i':
+ opt_install = 1;
+ opt_startup = ACE_OS::atoi (get_opt.optarg);
+ if (opt_startup <= 0)
+ print_usage_and_die ();
+ break;
+ case 'r':
+ opt_remove = 1;
+ break;
+ case 's':
+ opt_start = 1;
+ break;
+ case 'k':
+ opt_kill = 1;
+ break;
+ case 't':
+ opt_type = 1;
+ opt_startup = ACE_OS::atoi (get_opt.optarg);
+ if (opt_startup <= 0)
+ print_usage_and_die ();
+ break;
+ case 'd':
+ //opt_debug = 1;
+ break;
+ default:
+ // -i can also be given without a value - if so, it defaults
+ // to defined value.
+ if (ACE_OS::strcmp (get_opt.argv_[get_opt.optind-1], "-i") == 0)
+ {
+ opt_install = 1;
+ opt_startup = DEFAULT_SERVICE_INIT_STARTUP;
+ }
+ else
+ this->print_usage_and_die ();
+ break;
+ }
+}
+
+// Define a function to handle Ctrl+C to cleanly shut this down.
+
+static BOOL __stdcall
+ConsoleHandler (DWORD /* ctrlType */)
+{
+ SERVICE::instance ()->handle_control (SERVICE_CONTROL_STOP);
+ return TRUE;
+}
+
+ACE_NT_SERVICE_DEFINE (service,
+ TAO_NT_Notify_Service,
+ "TAO NT Notify Service");
+
+int
+Options::run (int argc, char* argv[])
+{
+ SERVICE::instance ()->name ("TAO_NT_Notify_Service",
+ "TAO NT Notify Service");
+
+ this->parse_args (argc, argv);
+
+ if (opt_install && !opt_remove)
+ return SERVICE::instance ()->insert (opt_startup);
+
+ if (opt_remove && !opt_install)
+ return SERVICE::instance ()->remove ();
+
+ if (opt_start && opt_kill)
+ print_usage_and_die ();
+
+ if (opt_start)
+ return SERVICE::instance ()->start_svc ();
+
+ if (opt_kill)
+ return SERVICE::instance ()->stop_svc ();
+
+ if (opt_type)
+ return SERVICE::instance ()->startup (opt_startup);
+
+ // If we get here, we either run the app in debug mode (-d) or are
+ // being called from the service manager to start the service.
+
+ if (opt_debug)
+ {
+ SetConsoleCtrlHandler (&ConsoleHandler, 1);
+ SERVICE::instance ()->svc ();
+ }
+ else
+ {
+ ACE_NT_SERVICE_RUN (service,
+ SERVICE::instance (),
+ ret);
+ if (ret == 0)
+ ACE_ERROR ((LM_ERROR,
+ "%p\n",
+ "Couldn't start service"));
+ }
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ return OPTIONS::instance ()->run (argc, argv);
+}
+
+#endif /* ACE_WIN32 */
diff --git a/TAO/orbsvcs/Notify_Service/NT_Notify_Service.cpp b/TAO/orbsvcs/Notify_Service/NT_Notify_Service.cpp
new file mode 100644
index 00000000000..57cee4c14ed
--- /dev/null
+++ b/TAO/orbsvcs/Notify_Service/NT_Notify_Service.cpp
@@ -0,0 +1,154 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include /**/ "NT_Notify_Service.h"
+
+#if defined (ACE_WIN32)
+
+#include /**/ "Notify_Service.h"
+#include "tao/ORB_Core.h"
+#include "ace/ARGV.h"
+#include "ace/Reactor.h"
+
+#define REGISTRY_KEY_ROOT HKEY_LOCAL_MACHINE
+#define TAO_REGISTRY_SUBKEY "SOFTWARE\\ACE\\TAO"
+#define TAO_NOTIFY_SERVICE_OPTS_NAME "TaoNotifyServiceOptions"
+#define TAO_SERVICE_PARAM_COUNT "TaoServiceParameterCount"
+
+TAO_NT_Notify_Service::TAO_NT_Notify_Service (void)
+ : argc_ (0),
+ argc_save_ (0),
+ argv_ (0),
+ argv_save_ (0)
+{
+}
+
+TAO_NT_Notify_Service::~TAO_NT_Notify_Service (void)
+{
+ if (argv_save_)
+ {
+ for (int i = 0; i < argc_save_; i++)
+ ACE_OS::free (argv_save_[i]);
+
+ ACE_OS::free (argv_save_);
+ }
+}
+
+void
+TAO_NT_Notify_Service::handle_control (DWORD control_code)
+{
+ if (control_code == SERVICE_CONTROL_SHUTDOWN
+ || control_code == SERVICE_CONTROL_STOP)
+ {
+ report_status (SERVICE_STOP_PENDING);
+ TAO_ORB_Core_instance ()->reactor ()->end_reactor_event_loop ();
+ TAO_ORB_Core_instance ()->orb ()->shutdown (1);
+ report_status (SERVICE_STOPPED);
+ }
+ else
+ ACE_NT_Service::handle_control (control_code);
+}
+
+int
+TAO_NT_Notify_Service::handle_exception (ACE_HANDLE)
+{
+ return 0;
+}
+
+int
+TAO_NT_Notify_Service::init (int argc,
+ ACE_TCHAR *argv[])
+{
+ HKEY hkey = 0;
+ BYTE buf[ACE_DEFAULT_ARGV_BUFSIZ];
+
+ *buf = '\0';
+
+ // This solution is very kludgy. It looks in the NT Registry under
+ // \\HKEY_LOCAL_MACHINE\SOFTWARE\ACE\TAO for the value of
+ // "TaoNotifyServiceOptions" for any Notify Service options such as
+ // "-ORBEndpoint".
+
+ // Get Notify Service options from the NT Registry.
+
+ ACE_TEXT_RegOpenKeyEx (REGISTRY_KEY_ROOT,
+ TAO_REGISTRY_SUBKEY,
+ 0,
+ KEY_READ,
+ &hkey);
+
+ DWORD type;
+ DWORD bufSize = sizeof (buf);
+
+ ACE_TEXT_RegQueryValueEx (hkey,
+ TAO_NOTIFY_SERVICE_OPTS_NAME,
+ NULL,
+ &type,
+ buf,
+ &bufSize);
+
+ RegCloseKey (hkey);
+
+ // Add options to the args list (if any).
+
+ if (ACE_OS::strlen ((char *) buf) > 0)
+ {
+ ACE_ARGV args ((const char*) buf);
+ // Allocate the internal args list to be one bigger than the
+ // args list passed into the function. We use a 'save' list in
+ // case we use a 'destructive' args list processor - this way we
+ // maintain the correct argv and argc for memory freeing
+ // operations in the destructor.
+ argv_save_ = (char **) ACE_OS::malloc (sizeof (char *) * (argc + args.argc ()));
+
+ // Copy the values into the internal args buffer.
+ int i;
+ for (i = 0; i < argc; i++)
+ argv_save_[i] = ACE_OS::strdup (argv[i]);
+
+ int j = 0;
+ for (i = argc; i < static_cast<int> ((args.argc () + argc)); i++)
+ argv_save_[i] = ACE_OS::strdup (args.argv ()[j++]);
+
+ // Set the arg counter.
+ argc_save_ = argc + args.argc ();
+ argc_ = argc_save_;
+ argv_ = argv_save_;
+ }
+ else
+ {
+ argc_ = argc;
+ argv_ = argv;
+ }
+
+ return 0;
+}
+
+int
+TAO_NT_Notify_Service::svc (void)
+{
+ TAO_Notify_Service_Driver notify_service;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ if (notify_service.init (argc_, argv_ ACE_ENV_ARG_PARAMETER) == -1)
+ return -1;
+
+ report_status (SERVICE_RUNNING);
+ notify_service.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO NT Notify Service");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (1);
+
+ return 0;
+}
+
+#endif /* ACE_WIN32 */
diff --git a/TAO/orbsvcs/Notify_Service/NT_Notify_Service.h b/TAO/orbsvcs/Notify_Service/NT_Notify_Service.h
new file mode 100644
index 00000000000..9ec67e151c0
--- /dev/null
+++ b/TAO/orbsvcs/Notify_Service/NT_Notify_Service.h
@@ -0,0 +1,79 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// ace
+//
+// = FILENAME
+// NT_Notify_Service.h
+//
+//
+// = DESCRIPTION
+// Run the TAO Notify Service as a Windows NT Service.
+//
+// = AUTHORS
+// John Tucker <jtucker@infoglide.com>,
+// Mike Vitalo <mvitalo@infoglide.com>,
+// David Robison <drrobison@openroadsconsulting.com>
+//
+// ============================================================================
+
+#ifndef TAO_NT_NOTIFY_SERVICE_H
+#define TAO_NT_NOTIFY_SERVICE_H
+
+#include /**/ "ace/OS.h"
+
+#if defined (ACE_WIN32)
+
+#include /**/ "ace/NT_Service.h"
+#include /**/ "ace/Singleton.h"
+#include /**/ "ace/Synch.h"
+#include /**/ "tao/orbconf.h"
+
+class TAO_NT_Notify_Service : public ACE_NT_Service
+{
+ // = TITLE
+ // Run the TAO Notify Service as a Windows NT Service.
+public:
+ typedef TAO_SYNCH_RECURSIVE_MUTEX MUTEX;
+
+ // = Initialization and termination hooks.
+ TAO_NT_Notify_Service (void);
+ virtual ~TAO_NT_Notify_Service (void);
+
+ virtual void handle_control (DWORD control_code);
+ // We override <handle_control> because it handles stop requests
+ // privately.
+
+ virtual int handle_exception (ACE_HANDLE h);
+ // We override <handle_exception> so a 'stop' control code can pop
+ // the reactor off of its wait.
+
+ virtual int svc (void);
+ // This is a virtual method inherited from ACE_NT_Service.
+
+ virtual int init (int argc,
+ ACE_TCHAR *argv[]);
+ // Initialize the objects argc_ and argv_ attributes values.
+
+private:
+ // = Keep track of the "command-line" arguments.
+ int argc_;
+ int argc_save_;
+ // Argument count.
+
+ char **argv_;
+ char **argv_save_;
+ // Argument list.
+
+ friend class ACE_Singleton<TAO_NT_Notify_Service, MUTEX>;
+};
+
+typedef ACE_Singleton<TAO_NT_Notify_Service, TAO_NT_Notify_Service::MUTEX> SERVICE;
+
+#endif /* ACE_WIN32 */
+#endif /* TAO_NT_NOTIFY_SERVER_H */
+
+
diff --git a/TAO/orbsvcs/Notify_Service/Notify_Server.cpp b/TAO/orbsvcs/Notify_Service/Notify_Server.cpp
new file mode 100644
index 00000000000..2e74141b15d
--- /dev/null
+++ b/TAO/orbsvcs/Notify_Service/Notify_Server.cpp
@@ -0,0 +1,73 @@
+// $Id$
+
+#include "Notify_Service.h"
+
+// Must include this file to get a static initializer
+#include "tao/Valuetype/Valuetype_Adapter_Impl.h"
+
+#include "ace/OS_main.h"
+
+#include "orbsvcs/Shutdown_Utilities.h"
+#include "tao/debug.h"
+
+
+class Notify_Service_Shutdown_Functor
+ : public Shutdown_Functor
+{
+public:
+ Notify_Service_Shutdown_Functor (TAO_Notify_Service_Driver& svc);
+
+ void operator() (int which_signal);
+
+private:
+ TAO_Notify_Service_Driver& svc_;
+};
+
+Notify_Service_Shutdown_Functor::Notify_Service_Shutdown_Functor (TAO_Notify_Service_Driver& svc)
+ : svc_ (svc)
+{
+}
+
+void
+Notify_Service_Shutdown_Functor::operator() (int which_signal)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "shutting down on signal %d\n", which_signal));
+ (void) this->svc_.shutdown ();
+}
+
+// Driver function for the TAO Notify Service.
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ TAO_Notify_Service_Driver notify_service;
+
+ Notify_Service_Shutdown_Functor killer (notify_service);
+ Service_Shutdown kill_contractor (killer);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY_NEW_ENV
+ {
+ int result = notify_service.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("Failed to initialize the Notification Service.\n")),
+ 1);
+
+ notify_service.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT("Failed to run the Notification Service\n"));
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/Notify_Service/Notify_Service.cpp b/TAO/orbsvcs/Notify_Service/Notify_Service.cpp
new file mode 100644
index 00000000000..e7d95c4dd99
--- /dev/null
+++ b/TAO/orbsvcs/Notify_Service/Notify_Service.cpp
@@ -0,0 +1,446 @@
+// $Id$
+
+#include "Notify_Service.h"
+
+#include "orbsvcs/Notify/Service.h"
+
+#include "tao/debug.h"
+#include "tao/IORTable/IORTable.h"
+#include "tao/ORB_Core.h"
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Get_Opt.h"
+#include "ace/Sched_Params.h"
+#include "ace/Synch.h"
+#include "ace/Argv_Type_Converter.h"
+#include "ace/Dynamic_Service.h"
+
+TAO_Notify_Service_Driver::TAO_Notify_Service_Driver (void)
+: notify_service_ (0)
+, bootstrap_ (0)
+, use_name_svc_ (1)
+, ior_output_file_ (0)
+, notify_factory_name_ (NOTIFY_KEY)
+, notify_channel_name_ (NOTIFY_CHANNEL_NAME)
+, register_event_channel_ (0)
+, nthreads_ (1)
+{
+ // No-Op.
+}
+
+TAO_Notify_Service_Driver::~TAO_Notify_Service_Driver (void)
+{
+ if (ior_output_file_)
+ fclose(ior_output_file_);
+}
+
+int
+TAO_Notify_Service_Driver::init_ORB (int& argc, ACE_TCHAR *argv []
+ ACE_ENV_ARG_DECL)
+{
+ // Copy command line parameter.
+ 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);
+
+ CORBA::Object_var object =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to resolve the RootPOA.\n"),
+ -1);
+
+ this->poa_ =
+ PortableServer::POA::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-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);
+
+ return 0;
+}
+
+int
+TAO_Notify_Service_Driver::init (int argc, ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL)
+{
+ if (this->parse_args(argc, argv) != 0)
+ return -1;
+
+ // initalize the ORB.
+ if (this->init_ORB (argc, argv
+ ACE_ENV_ARG_PARAMETER) != 0)
+ return -1;
+
+ this->notify_service_ = ACE_Dynamic_Service<TAO_Notify_Service>::instance (TAO_NOTIFICATION_SERVICE_NAME);
+
+ if (this->notify_service_ == 0)
+ {
+ this->notify_service_ = ACE_Dynamic_Service<TAO_Notify_Service>::instance (TAO_NOTIFY_DEF_EMO_FACTORY_NAME);
+ }
+
+ if (this->notify_service_ == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Service not found. Check service configurator file.\n"));
+ return -1;
+ }
+
+ this->notify_service_->init_service (this->orb_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->nthreads_ > 0) // we have chosen to run in a thread pool.
+ {
+ ACE_DEBUG ((LM_DEBUG, "Running %d ORB threads\n", this->nthreads_));
+ worker_.orb (this->orb_.in ());
+
+ // Task activation flags.
+ long flags =
+ THR_NEW_LWP |
+ THR_JOINABLE |
+ this->orb_->orb_core ()->orb_params ()->thread_creation_flags ();
+
+ int priority =
+ ACE_Sched_Params::priority_min (this->orb_->orb_core ()->orb_params ()->sched_policy (),
+ this->orb_->orb_core ()->orb_params ()->scope_policy ());
+
+ if (worker_.activate (flags,
+ this->nthreads_, 0, priority) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot activate client threads\n"), -1);
+ }
+
+ // Check first if the naming service
+ if (this->use_name_svc_)
+ {
+ // Resolve the naming service.
+ int ns_ret = this->resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (ns_ret != 0)
+ return -1;
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\nStarting up the Notification Service...\n"));
+
+ // Activate the factory
+ this->notify_factory_ =
+ notify_service_->create (this->poa_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_ASSERT (!CORBA::is_nil (this->notify_factory_.in ()));
+
+ if (this->bootstrap_) // Enable corbaloc usage
+ {
+ CORBA::Object_var table_object =
+ this->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. corbaloc support not enabled.\n"));
+ }
+ else
+ {
+ CORBA::String_var ior =
+ this->orb_->object_to_string (this->notify_factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ adapter->bind (this->notify_factory_name_.c_str (), ior.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ }
+
+
+ // Register with the Name service, if asked
+ if (this->use_name_svc_)
+ {
+ ACE_ASSERT (!CORBA::is_nil (this->naming_.in ()));
+
+ CosNaming::Name_var name =
+ this->naming_->to_name (this->notify_factory_name_.c_str ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+
+ this->naming_->rebind (name.in (),
+ this->notify_factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Registered with the naming service as: %s\n",
+ this->notify_factory_name_.c_str()));
+
+ if (this->register_event_channel_ == 1)
+ {
+ // create an event channel
+ 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);
+
+ name = this->naming_->to_name (this->notify_channel_name_.c_str ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->naming_->rebind (name.in (),
+ ec.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Registered an Event Channel with the naming service as: %s\n",
+ this->notify_channel_name_.c_str()));
+
+ }
+ }
+
+ // Write IOR to a file, if asked.
+ // Note: do this last to ensure that we're up and running before the file is written
+ CORBA::String_var str =
+ this->orb_->object_to_string (this->notify_factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ 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;
+ }
+ else if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "The Notification Event Channel Factory IOR is <%s>\n",
+ str.in ()));
+ }
+
+ return 0;
+}
+
+int
+TAO_Notify_Service_Driver::resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Need to check return value for errors.
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to resolve the Naming Service.\n"),
+ -1);
+
+ this->naming_ =
+ CosNaming::NamingContextExt::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+TAO_Notify_Service_Driver::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (TAO_debug_level > 0 )
+ ACE_DEBUG ((LM_DEBUG, "%s: Running the Notification Service\n",
+ __FILE__));
+
+ if (this->nthreads_ > 0)
+ {
+ worker_.thr_mgr ()->wait ();
+ return 0;
+ }
+
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+void
+TAO_Notify_Service_Driver::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Deactivate.
+ if (this->use_name_svc_ && !CORBA::is_nil (this->naming_.in ()))
+ {
+ // Unbind from the naming service.
+ CosNaming::Name_var name =
+ this->naming_->to_name (this->notify_factory_name_.c_str ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->naming_->unbind (name.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // shutdown the ORB.
+ if (!CORBA::is_nil (this->orb_.in ()))
+ this->orb_->shutdown ();
+}
+
+int
+TAO_Notify_Service_Driver::parse_args (int &argc, ACE_TCHAR *argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ const ACE_TCHAR* current_arg = 0;
+ while (arg_shifter.is_anything_left ())
+ {
+ if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-Factory"))))
+ {
+ this->notify_factory_name_.set (ACE_TEXT_ALWAYS_CHAR(current_arg));
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Boot")) == 0)
+ {
+ this->bootstrap_ = 1;
+ // Make it bootstrappable
+
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-NameSvc")) == 0)
+ {
+ this->use_name_svc_ = 1;
+ // Register ref with the name service
+
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-NoNameSvc")) == 0)
+ {
+ this->use_name_svc_ = 0;
+ // Don't Register ref with the name service
+
+ arg_shifter.consume_arg ();
+ }
+ else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-IORoutput"))))
+ {
+ this->ior_output_file_ = ACE_OS::fopen (current_arg, ACE_TEXT("w"));
+ if (this->ior_output_file_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to open %s for writing: %p\n",
+ current_arg), -1);
+ arg_shifter.consume_arg ();
+ }
+ else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ChannelName"))))
+ {
+ this->notify_channel_name_.set(ACE_TEXT_ALWAYS_CHAR(current_arg));
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Channel")) == 0)
+ {
+ this->register_event_channel_ = 1;
+ // Register one EC with naming.
+
+ arg_shifter.consume_arg ();
+ }
+ else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-Notify_TPReactor"))))
+ {
+ ACE_DEBUG((LM_DEBUG, "-Notify_TPReactor option is deprecated, use -ORBRunThreads option\n"));
+
+ this->nthreads_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBRunThreads"))))
+ {
+ this->nthreads_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-?")) == 0)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "usage: %s -Factory factory_name "
+ "-Boot -[No]NameSvc "
+ "-IORoutput file_name "
+ "-Channel -ChannelName channel_name "
+ "-ORBRunThreads threads\n"
+ "default: %s -Factory NotifyEventChannelFactory "
+ "-NameSvc -Channel NotifyEventChannel -ORBRunThreads 1\n",
+ argv[0], argv[0]));
+
+ arg_shifter.consume_arg ();
+
+ return -1;
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+ return 0;
+}
+
+/*****************************************************************/
+
+Worker::Worker (void)
+{
+}
+
+void
+Worker::orb (CORBA::ORB_ptr orb)
+{
+ orb_ = CORBA::ORB::_duplicate (orb);
+}
+
+int
+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_DEBUG, "Activated Worker Thread to run the ORB @ priority:%d \n", priority));
+#endif
+
+ 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/Notify_Service/Notify_Service.h b/TAO/orbsvcs/Notify_Service/Notify_Service.h
new file mode 100644
index 00000000000..a32e6747b2a
--- /dev/null
+++ b/TAO/orbsvcs/Notify_Service/Notify_Service.h
@@ -0,0 +1,146 @@
+/* -*- C++ -*- */
+// $Id$
+// ============================================================================
+//
+// = FILENAME
+// Notify_Service.h
+//
+// = AUTHORS
+// Pradeep Gore <pradeep@cs.wustl.edu>
+// Service options code by Wei Chiang <Wei.Chiang@nokia.com>.
+//
+// = DESCRIPTION
+// Notification Service front end.
+//
+// ============================================================================
+
+#ifndef NOTIFY_SERVICE_H
+#define NOTIFY_SERVICE_H
+#include /**/ "ace/pre.h"
+
+#include "ace/Task.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "../orbsvcs/Notify/CosNotify_Initializer.h"
+#include "ace/SString.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+class TAO_Notify_Service;
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#define NOTIFY_KEY "NotifyEventChannelFactory"
+#define NOTIFY_CHANNEL_NAME "NotifyEventChannel"
+
+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.
+
+private:
+ CORBA::ORB_var orb_;
+ // The orb
+};
+
+class TAO_Notify_Service_Driver
+{
+ // = TITLE
+ // Notify_Service
+ //
+ // = DESCRIPTION
+ // Implementation of the Notification Service front end.
+
+ public:
+ // = Initialization and termination methods.
+ TAO_Notify_Service_Driver (void);
+ // Constructor.
+
+ virtual ~TAO_Notify_Service_Driver (void);
+ // Destructor.
+
+ int init (int argc, ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL);
+ // Initializes the Service.
+ // Returns 0 on success, -1 on error.
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // run the Service.
+ // Returns 0 on success, -1 on error.
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ // Shutdown the Service.
+ // Returns 0 on success, -1 on error.
+
+
+ // CosNotifyChannelAdmin::EventChannelFactory_var obj;
+ //
+protected:
+ int init_ORB (int& argc, ACE_TCHAR *argv []
+ ACE_ENV_ARG_DECL);
+ // initialize the ORB.
+
+ TAO_Notify_Service* notify_service_;
+
+ int resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL);
+ // Resolve the naming service.
+
+ int parse_args (int& argc, ACE_TCHAR *argv []);
+ // Parses the command line arguments.
+
+ // = Data members
+
+ int bootstrap_;
+ // 1: this service is bootstrappable
+
+ int use_name_svc_;
+ // 1: register itself with the name service
+
+ int register_ec_;
+ // 1:
+
+ FILE *ior_output_file_;
+ // File where the IOR of the server object is stored.
+
+ ACE_CString notify_factory_name_;
+ // The Factory name.
+
+ ACE_CString notify_channel_name_;
+ // The Factory name.
+
+ int register_event_channel_;
+ // 1: create an event channel and registers it with the Naming Service with
+ // the name <notify_channel_name_>
+
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory_;
+ // The Factory.
+
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ PortableServer::POA_var poa_;
+ // Reference to the root poa.
+
+ CosNaming::NamingContextExt_var naming_;
+ // A naming context.
+
+ Worker worker_;
+ // Worker for TP reactor mode.
+
+ int nthreads_;
+ // Number of worker threads.
+};
+
+#include /**/ "ace/post.h"
+#endif /* NOTIFY_SERVICE_H */
diff --git a/TAO/orbsvcs/Notify_Service/Notify_Service.mpc b/TAO/orbsvcs/Notify_Service/Notify_Service.mpc
new file mode 100644
index 00000000000..409614e0600
--- /dev/null
+++ b/TAO/orbsvcs/Notify_Service/Notify_Service.mpc
@@ -0,0 +1,28 @@
+// -*- MPC -*-
+// $Id$
+
+project : valuetype, orbsvcsexe, core, notification_serv, naming, iortable {
+ exename = Notify_Service
+ Source_Files {
+ Notify_Server.cpp
+ Notify_Service.cpp
+ }
+ Header_Files {
+ Notify_Service.h
+ }
+}
+
+project(NT_Notify_Service) : valuetype, orbsvcsexe, core, notification_serv, naming, iortable {
+ avoids += ace_for_tao
+ requires += winnt
+ exename = NT_Notify_Service
+ Source_Files {
+ Notify_Service.cpp
+ NT_Notify_Server.cpp
+ NT_Notify_Service.cpp
+ }
+ Header_Files {
+ Notify_Service.h
+ NT_Notify_Service.h
+ }
+}
diff --git a/TAO/orbsvcs/Notify_Service/README b/TAO/orbsvcs/Notify_Service/README
new file mode 100644
index 00000000000..b83e208ac12
--- /dev/null
+++ b/TAO/orbsvcs/Notify_Service/README
@@ -0,0 +1,250 @@
+$Id$
+
+This directory contains files that implement a server for the TAO
+Notification Service. In addition, it contains files that run the TAO
+Notification Service as a Windows NT Service. Both of these services
+are described below.
+
+How to Run the TAO Notification Service
+=======================================
+
+The Notify_Service executable starts up a Notification Service factory
+and registers it with the Naming Service under the name
+"NotifyEventChannelFactory"
+
+Command line arguments:
+----------------------
+"-?" : shows the options.
+
+"-Factory factory_name" : Uses the <factory_name> as the default name for the
+ Channel Factory
+ The default is "NotifyEventChannelFactory".
+
+"-Boot" : Flag asking that the <factory_name> be registered
+ in the IOR table.
+ The option is disabled by default.
+ See the "Using the Boot option" section below.
+
+"-NameSvc" : Registers the Factory and if specified, an Event
+ Channel with the Naming Service.
+ if this option is used, a Naming Service must
+ be accessible.
+ This option is enabled by default.
+
+"-NoNameSvc" : Asks to skip any registration with the
+ Naming Service.
+ This option is disabled by default.
+
+"-IORoutput file_name" : The IOR is output to the file <file_name>.
+ By default, the IOR is printed out.
+
+"-Channel" : If this option is specified, a EventChannel is
+ created and registered with the Naming Service.
+ This option is disabled by default.
+
+"-ChannelName channel_name" : Specifies the <channel_name> to register with the
+ Naming Service.
+ The default is "NotifyEventChannel".
+
+"-ORBRunThreads" : Number of threads to run the
+ ORB::run method.
+
+!! The -Notify_TPReactor option is deprecated!! use the -ORBRunThreads
+option instead.
+
+"-Notify_TPReactor [threads]": Tells the Notify Service that the ORB
+ will use a TP reactor and specifies the
+ number of worker threads to utilize.
+
+
+Note that the svc.conf file must instruct the ORB to use a TP reactor
+e.g. static Resource_Factory "-ORBReactorType tp -ORBReactorMaskSignals 0"
+Please look up the ORB configuration options to get more information
+on this.
+
+Running the Service:
+-------------------
+1. Start the Naming Service from
+
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -m 1
+
+if you are using the "-NameSvc" options.
+
+2.Start the Notify_Service from this directory. You should see a message saying
+ that the service has been started.
+
+ Note:
+ ====
+ By default, the Naming Service disables multicast discovery.
+ The "-m 1" option enables the Naming Service to be resolved via
+ multicast.
+
+ If you do not wish to do this, then use the
+ -ORBInitRef option in which case the Naming Service should be started
+ as:
+
+ $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o naming.ior
+
+ and the CosEvent_Service as
+
+ $ Notify_Service -ORBInitRef NameService=file://naming.ior
+
+Using the Boot option:
+----------------------
+an example on how to locate the Notify Factory without the Naming Service -
+
+./Notify_Service -Boot -NoNameSvc -d -ORBobjrefstyle url -ORBEndPoint "iiop://flamenco.cs:9999"
+
+The Factory object reference is not registered with the Naming Service.
+"-Boot" binds the Factory object reference with "NotifyEventChannelFactory" in
+the IOR table.
+See the $TAO_ROOT/docs/Options.html for details on "-ORBEndPoint"
+
+A client program can obtain the factory object reference in the following
+manner:
+./client -ORBInitRef "NotifyEventChannelFactory=corbaloc:iiop:flamenco.cs:9999/NotifyEventChannelFactory"
+
+Note that the client uses:
+ resolve_initial_references ("NotifyEventChannelFactory");
+to obtain the object reference.
+
+The svc.conf options:
+----------------------
+
+The "Notify_Default_Event_Manager_Objects_Factory" service object accepts the following options:
+
+"-DispatchingThreads [thread_count]" : How many threads for MT dispatching.
+
+"-ListenerThreads" : How many threads for listener filter evaluation.
+
+"-AsynchUpdates" : Send subscription and
+ publication updates
+ asynchronously.
+
+"-AllocateTaskperProxy" : Allocate worker tasks per
+ proxy
+ *see footnote below for explanation*
+"-AllowReconnect" : Allows consumers and suppliers to
+ reconnect to existing proxies.
+
+"-NoUpdates" : Globally disables subscription and
+ publication updates.
+
+All other options are deprecated and should not be used.
+
+e.g. svc.conf
+static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 2"
+
+This means that we want to enable event dispatching with 2 threads.
+
+----------------------------------------------------------------
+What does the "-AllocateTaskperProxy" option do?
+
+A Task here implies a thread pool that performs a fixed work in the
+Notify.
+e.g. When you specify "DispatchingThreads 1".
+It means that there is 1 thread to perform the event dispatching to
+consumers IRRESPECTIVE OF THE NUMBER OF PROXYSUPPLIERS. It also means that
+events destined for each consumer will be queued to a buffer for that consumer.
+Therefore, you can also think of this option as Enable Consumer-side Buffering
+of Events.
+
+This is the default case.
+
+When you specify "-AllocateTaskperProxy" it asks notify to create a
+dispatching task (with the specified thread pool size) PER
+PROXYSUPPLIER. So if you use this option and connect 50 consumers with
+1 thread for the dispatching task you will have created 50 dispatching
+threads! so use this option with care and you might not need it in
+most cases.
+
+Why have this feature in the first place? The intent is to allow the
+software architect of a Notify based system, fine control over where
+and how much thread resources are deployed. e.g. a channel could have
+2 proxy suppliers - the first one delivers an important event in huge
+quantities. A dedicated thread pool to this proxy will ensure better
+throughput to it's consumers. (Eventually I want to be able to set the
+thread pool size via a QoS property)
+Similarly "-ListenerThreads 2" specifies a thread pool for use by
+the supplier-side processing. This enables Buffering on the Supplier-side, with
+the thread pool being used to process supplier side filters and push the
+events to the Consumer side.
+
+How to use the NT_Notify_Service
+================================
+
+To set the options for the TAO Notification Service, go to the Services
+icon in the Settings group under the start menu (start menu ->
+settings -> services). There, highlight the NT_Notify_Service, which
+is the name used by the Notification Service when it is registered.
+After it's highlighted, you should see at the bottom of the dialog box
+an area to specify options. Just enter the options you wish in that
+edit box and everything should just work. However, some options, such
+as -ORBDebugLevel, won't work since an NT service can't write output
+to standard out.
+
+1. Syntax
+
+ % NT_Notify_Server [-i value]
+ [-r]
+ [-s]
+ [-k]
+ [-t n]
+ [-d]
+
+2. Optional Command-line Arguments
+
+ -i value
+ Install this program as an NT service, with specified startup
+
+ -r
+ Remove this program from the Service Manager
+ -s
+ Start the service
+
+ -k
+ Kill the service
+
+ -t value
+ Set startup for an existing service
+
+ -d
+ Debug; run as a regular application
+
+3. Usage
+
+ To see different stages of an NT service application, you have
+ to run the program several times, with different options.
+ Please note: run with only one option at a time.
+
+ a. First, you must initialize the service in the NT SCM
+ database. Run NT_Notify_Service with -in, where n is one of
+ the following startup options:
+
+ // Start Type (from WinNT.h)
+ //
+ #define SERVICE_SYSTEM_START 0x00000001
+ #define SERVICE_AUTO_START 0x00000002
+ #define SERVICE_DEMAND_START 0x00000003
+ #define SERVICE_DISABLED 0x00000004
+
+ If only -i is specified, SERVICE_AUTO_START is default option.
+
+ b. Now you are ready to run the actual service. Run
+ NT_Notify_Service again, this time with -s option. If the
+ service starts successfully, it will ring the system
+ bell every second or so until the service is stopped.
+
+ c. To stop service execution, run NT_Notify_Service with the
+ -k option.
+
+ d. To remove the service from the Service Control Manager
+ database, run NT_Notify_Service with -r.
+
+ In addition, once you have initialized this service (by using
+ the -i option) you can change its startup type to one of the
+ other values above. To do this, run NT_Notify_Service with
+ -tn option. n is as explained above for -i.
+
+ In order to debug the service's execution itself, use the -d
+ option.
diff --git a/TAO/orbsvcs/Notify_Service/svc.conf b/TAO/orbsvcs/Notify_Service/svc.conf
new file mode 100644
index 00000000000..8d973e09c33
--- /dev/null
+++ b/TAO/orbsvcs/Notify_Service/svc.conf
@@ -0,0 +1,3 @@
+## $Id$
+
+static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1"
diff --git a/TAO/orbsvcs/Notify_Service/svc.conf.xml b/TAO/orbsvcs/Notify_Service/svc.conf.xml
new file mode 100644
index 00000000000..237d7598804
--- /dev/null
+++ b/TAO/orbsvcs/Notify_Service/svc.conf.xml
@@ -0,0 +1,5 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/Notify_Service/svc.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/PSS/Dump_Visitor.cpp b/TAO/orbsvcs/PSS/Dump_Visitor.cpp
new file mode 100644
index 00000000000..0f9514e78e7
--- /dev/null
+++ b/TAO/orbsvcs/PSS/Dump_Visitor.cpp
@@ -0,0 +1,1651 @@
+// $Id$
+
+#include "Dump_Visitor.h"
+#include "ace/streams.h"
+
+Dump_Visitor::Dump_Visitor (int depth)
+ : depth_ (depth)
+{
+}
+
+Dump_Visitor::~Dump_Visitor ()
+{
+
+}
+
+int
+Dump_Visitor::visit_module (TAO_PSDL_Module *module)
+{
+ print_depth (this->depth_ + 10);
+
+ cout << "MODULE {" << endl;
+ if (module->identifier ()->accept (this) == -1)
+ return -1;
+
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (module->specification ()->accept (&body_visitor) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_identifier (TAO_PSDL_Identifier *identifier)
+{
+ print_depth (this->depth_ + 40);
+ cout << "IDENTIFIER {" << identifier->value () << "}\n" << endl;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_specification (TAO_PSDL_Specification *specification)
+{
+ cout << "SPECIFICATION {" << endl;
+ if (specification->definition ()->accept (this) == -1)
+ return -1;
+ if (specification->specification () != 0)
+ {
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (specification->specification ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+Dump_Visitor::visit_definition (TAO_PSDL_Definition *definition)
+{
+ print_depth (this->depth_ + 5);
+ cout << "DEFINITION {" << endl;
+ if (definition->definition_type ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagetype (TAO_PSDL_Abstract_Storagetype *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagetype_dcl (TAO_PSDL_Abstract_Storagetype_Dcl *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagetype_fwd_dcl (TAO_PSDL_Abstract_Storagetype_Fwd_Dcl *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagetype_header (TAO_PSDL_Abstract_Storagetype_Header *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagetype_body (TAO_PSDL_Abstract_Storagetype_Body *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagetype_member (TAO_PSDL_Abstract_Storagetype_Member *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagetype_inh_spec (TAO_PSDL_Abstract_Storagetype_Inh_Spec *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagetype_name (TAO_PSDL_Abstract_Storagetype_Name *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_psdl_state_dcl (TAO_PSDL_Psdl_State_Dcl *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_psdl_state_type_spec (TAO_PSDL_Psdl_State_Type_Spec *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagetype_ref_type (TAO_PSDL_Abstract_Storagetype_Ref_Type)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagehome (TAO_PSDL_Abstract_Storagehome *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagehome_fwd_dcl (TAO_PSDL_Abstract_Storagehome_Fwd_Dcl *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagehome_dcl (TAO_PSDL_Abstract_Storagehome_Dcl *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagehome_header (TAO_PSDL_Abstract_Storagehome_Header *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagehome_body (TAO_PSDL_Abstract_Storagehome_Body *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagehome_member (TAO_PSDL_Abstract_Storagehome_Member *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagehome_inh_spec (TAO_PSDL_Abstract_Storagehome_Inh_Spec *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_abstract_storagehome_name (TAO_PSDL_Abstract_Storagehome_Name *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_local_op_dcl (TAO_PSDL_Local_Op_Dcl *local_op_dcl)
+{
+ print_depth (this->depth_);
+
+ cout << "LOCAL_OP_DCL {" << endl;
+ if (local_op_dcl->op_type_spec ()->accept (this) == -1)
+ return -1;
+
+ if (local_op_dcl->identifier ()->accept (this) == -1)
+ return -1;
+
+ Dump_Visitor body_visitor (this->depth_ + 1);
+
+ if (local_op_dcl->parameter_dcls ()->accept (this) == -1)
+ return -1;
+
+ if (local_op_dcl->raises_expr () != 0)
+ {
+ if (local_op_dcl->raises_expr ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+Dump_Visitor::visit_key_dcl (TAO_PSDL_Key_Dcl *key_dcl)
+{
+ print_depth (this->depth_);
+
+ cout << "KEY_DCL {" << endl;
+ if (key_dcl->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (key_dcl->simple_declarator () != 0)
+ if (key_dcl->simple_declarator ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_catalog (TAO_PSDL_Catalog *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_catalog_inh_spec (TAO_PSDL_Catalog_Inh_Spec *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_catalog_name (TAO_PSDL_Catalog_Name *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_catalog_body (TAO_PSDL_Catalog_Body *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_catalog_member (TAO_PSDL_Catalog_Member *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagetype_member (TAO_PSDL_Storagetype_Member *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagetype_inh_spec (TAO_PSDL_Storagetype_Inh_Spec *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagetype_name (TAO_PSDL_Storagetype_Name *storagetype_name)
+{
+ print_depth (this->depth_ + 10);
+
+ cout << "STORAGETYPE_NAME {" << endl;
+ if (storagetype_name->scoped_name ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagetype_impl_spec (TAO_PSDL_Storagetype_Impl_Spec *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagetype_ref_type (TAO_PSDL_Storagetype_Ref_Type *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_store_directive (TAO_PSDL_Store_Directive *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_psdl_concrete_state_type (TAO_PSDL_Psdl_Concrete_State_Type *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_ref_rep_directive (TAO_PSDL_Ref_Rep_Directive *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagehome (TAO_PSDL_Storagehome *storagehome)
+{
+ print_depth (this->depth_ + 10);
+
+ cout << "STORAGEHOME {" << endl;
+ if (storagehome->storagehome_header ()->accept (this) == -1)
+ return -1;
+
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (storagehome->storagehome_body () != 0)
+ if (storagehome->storagehome_body ()->accept (&body_visitor) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagehome_header (TAO_PSDL_Storagehome_Header *sh_header)
+{
+ print_depth (this->depth_ + 10);
+
+ cout << "STORAGEHOME_HEADER {" << endl;
+ if (sh_header->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (sh_header->storagetype_name ()->accept (this) == -1)
+ return -1;
+
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (sh_header->storagehome_inh_spec () != 0)
+ if (sh_header->storagehome_inh_spec ()->accept (&body_visitor) == -1)
+ return -1;
+
+ if (sh_header->storagehome_impl_spec () != 0)
+ if (sh_header->storagehome_impl_spec ()->accept (&body_visitor) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagehome_body (TAO_PSDL_Storagehome_Body *sh_body)
+{
+ print_depth (this->depth_ + 10);
+
+ cout << "STORAGEHOME_BODY {" << endl;
+ if (sh_body->storagehome_member ()->accept (this) == -1)
+ return -1;
+
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (sh_body->storagehome_body () != 0)
+ if (sh_body->storagehome_body ()->accept (&body_visitor) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagehome_member (TAO_PSDL_Storagehome_Member *sh_member)
+{
+ print_depth (this->depth_ + 10);
+
+ cout << "STORAGEHOME_MEMBER {" << endl;
+ if (sh_member->key_dcl ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagehome_inh_spec (TAO_PSDL_Storagehome_Inh_Spec *sh_inh_spec)
+{
+ print_depth (this->depth_ + 10);
+
+ cout << "STORAGEHOME_INH_SPEC {" << endl;
+ if (sh_inh_spec->storagehome_name ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagehome_name (TAO_PSDL_Storagehome_Name *sh_name)
+{
+ print_depth (this->depth_ + 10);
+
+ cout << "STORAGEHOME_NAME {" << endl;
+ if (sh_name->scoped_name ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagehome_impl_spec (TAO_PSDL_Storagehome_Impl_Spec *sh_impl_spec)
+{
+ print_depth (this->depth_ + 10);
+
+ cout << "STORAGEHOME_IMPL_SPEC {" << endl;
+ if (sh_impl_spec->abstract_storagehome_name ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_primary_key_dcl (TAO_PSDL_Primary_Key_Dcl *primary_key_dcl)
+{
+ print_depth (this->depth_ + 10);
+
+ cout << "PRIMARY_KEY_DCL {" << endl;
+ if (primary_key_dcl->identifier ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_type_dcl (TAO_PSDL_Type_Dcl *type_dcl)
+{
+ print_depth (this->depth_ + 10);
+ cout << "TYPE_DCL {" << endl;
+
+ print_depth (this->depth_ + 15);
+ if (type_dcl->key_word () != 0)
+ {
+ cout << "KEY_WORD------------------------ {";
+ cout << type_dcl->key_word () << "}" << endl;
+ }
+
+ if (type_dcl->type_of_type_dcl ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_type_declarator (TAO_PSDL_Type_Declarator *type_declarator)
+{
+ print_depth (this->depth_ + 15);
+ cout << "TYPE_DECLARATOR {" << endl;
+
+ if (type_declarator->type_spec ()->accept (this) == -1)
+ return -1;
+
+ Dump_Visitor body_visitor (this->depth_);
+ if (type_declarator->declarators ()->accept (&body_visitor) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_type_spec (TAO_PSDL_Type_Spec *type_spec)
+{
+ print_depth (this->depth_ + 20);
+ cout << "TYPE_SPEC {" << endl;
+ if (type_spec->type_of_type_spec ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_simple_type_spec (TAO_PSDL_Simple_Type_Spec *simple_type_spec)
+{
+ print_depth (this->depth_ + 25);
+ cout << "SIMPLE TYPE_SPEC {" << endl;
+ if (simple_type_spec->type_of_simple_type_spec ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_base_type_spec (TAO_PSDL_Base_Type_Spec *base_type_spec)
+{
+ print_depth (this->depth_ + 25);
+ cout << "BASE TYPE_SPEC " << endl;
+ if (base_type_spec->type_of_base_type_spec ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_template_type_spec (TAO_PSDL_Template_Type_Spec *template_type_spec)
+{
+ print_depth (this->depth_ + 30);
+ cout << "TEMPLATE_TYPE_SPEC {" << endl;
+
+ if (template_type_spec->type_of_template_type_spec ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_constr_type_spec (TAO_PSDL_Constr_Type_Spec *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_declarators (TAO_PSDL_Declarators *declarators)
+{
+ print_depth (this->depth_ + 15);
+ cout << "DECLARATORS {" << endl;
+
+ if (declarators->declarator ()->accept (this) == -1)
+ return -1;
+
+ if (declarators->set_of_declarators () != 0)
+ {
+ Dump_Visitor body_visitor (this->depth_ + 1);
+
+ if (declarators->set_of_declarators ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+Dump_Visitor::visit_declarator (TAO_PSDL_Declarator *declarator)
+{
+ print_depth (this->depth_ + 20);
+ cout << "DECLARATOR {" << endl;
+ if (declarator->type_of_declarator ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_simple_declarator (TAO_PSDL_Simple_Declarator *simple_declarator)
+{
+ print_depth (this->depth_ + 25);
+ cout << "SIMPLE_DECLARATOR {" << endl;
+
+ if (simple_declarator->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (simple_declarator->simple_declarator () != 0)
+ {
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (simple_declarator->simple_declarator ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+Dump_Visitor::visit_simple_declarator_list (TAO_PSDL_Simple_Declarator_List *simple_decl_list)
+{
+ print_depth (this->depth_ + 25);
+ cout << "SIMPLE_DECLARATOR_LIST {" << endl;
+
+ if (simple_decl_list-> simple_declarator ()->accept (this) == -1)
+ return -1;
+
+ if (simple_decl_list->simple_declarator_list () != 0)
+ {
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (simple_decl_list->simple_declarator_list ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Dump_Visitor::visit_complex_declarator (TAO_PSDL_Complex_Declarator *complex_declarator)
+{
+ print_depth (this->depth_ + 25);
+ cout << "COMPLEX_DECLARATOR {" << endl;
+
+ if (complex_declarator->array_declarator ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Dump_Visitor::visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type)
+{
+ print_depth (this->depth_ + 40);
+ cout << "PREDEFINED_TYPE " ;
+
+ if (predefined_type->type_one () != 0)
+ cout << "{" << predefined_type->type_one () << "}" << endl;
+
+ if (predefined_type->type_two () != 0)
+ cout << "{" << predefined_type->type_two () << "}" << endl;
+
+ if (predefined_type->type_three () != 0)
+ cout << "{" << predefined_type->type_three () << "}" << endl;
+
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (predefined_type->type_of_variable_one () != 0)
+ {
+ cout << endl;
+ if (predefined_type->type_of_variable_one ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ if (predefined_type->type_of_variable_two () != 0)
+ {
+ cout << endl;
+ if (predefined_type->type_of_variable_two ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ if (predefined_type->type_of_variable_three () != 0)
+ {
+ cout << endl;
+ if (predefined_type->type_of_variable_three ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Dump_Visitor::visit_member_list (TAO_PSDL_Member_List *member_list)
+{
+ print_depth (this->depth_ + 15);
+
+ cout << "MEMBER_LIST {" << endl;
+ if (member_list->member ()->accept (this) == -1)
+ return -1;
+
+ if (member_list->member_list () != 0)
+ {
+ Dump_Visitor body_visitor (this->depth_ + 1);
+
+ if (member_list->member_list ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Dump_Visitor::visit_member (TAO_PSDL_Member *member)
+{
+ print_depth (this->depth_ + 15);
+
+ cout << "MEMBER {" << endl;
+ if (member->type_spec ()->accept (this) == -1)
+ return -1;
+
+ Dump_Visitor body_visitor (this->depth_ + 1);
+
+ if (member->declarators ()->accept (&body_visitor) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_union_type (TAO_PSDL_Union_Type *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_switch_type_spec (TAO_PSDL_Switch_Type_Spec *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_switch_body (TAO_PSDL_Switch_Body *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_case_case (TAO_PSDL_Case *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_case_label (TAO_PSDL_Case_Label *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_element_spec (TAO_PSDL_Element_Spec *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+ }
+
+int
+Dump_Visitor::visit_const_dcl (TAO_PSDL_Const_Dcl *const_dcl)
+{
+ print_depth (this->depth_ + 10);
+
+ cout << "CONST_DCL" << endl;
+
+ if (const_dcl->const_type () != 0)
+ {
+ if (const_dcl->const_type ()->accept (this) == -1)
+ return -1;
+ }
+
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (const_dcl->identifier ()->accept (&body_visitor) == -1)
+ return -1;
+
+ if (const_dcl->const_exp ()->accept (&body_visitor) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_const_type (TAO_PSDL_Const_Type *const_type)
+{
+ print_depth (this->depth_);
+
+ cout << "CONST_TYPE";
+ if (const_type->type ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_const_exp (TAO_PSDL_Const_Exp *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_or_expr (TAO_PSDL_Or_Expr *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_xor_expr (TAO_PSDL_Xor_Expr *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_and_expr (TAO_PSDL_And_Expr *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_shift_expr (TAO_PSDL_Shift_Expr *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_add_expr (TAO_PSDL_Add_Expr *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_mult_expr (TAO_PSDL_Mult_Expr *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_unary_expr (TAO_PSDL_Unary_Expr *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_primary_expr (TAO_PSDL_Primary_Expr *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_except_dcl (TAO_PSDL_Except_Dcl *except_dcl)
+{
+ print_depth (this->depth_ + 10);
+
+ cout << "EXCEPT_DCL " << endl;
+ if (except_dcl->identifier ()->accept (this) == -1)
+ return -1;
+
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (except_dcl->member_list () != 0)
+ {
+ if (except_dcl->member_list ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+Dump_Visitor::visit_op_dcl (TAO_PSDL_Op_Dcl *op_dcl)
+{
+ print_depth (this->depth_);
+
+ cout << "OP_DCL {" << endl;
+
+ if (op_dcl->op_attribute () != 0)
+ if (op_dcl->op_attribute ()->accept (this) == -1)
+ return -1;
+
+ if (op_dcl->op_type_spec ()->accept (this) == -1)
+ return -1;
+
+ if (op_dcl->identifier ()->accept (this) == -1)
+ return -1;
+
+ Dump_Visitor body_visitor (this->depth_ + 1);
+
+ if (op_dcl->parameter_dcls ()->accept (this) == -1)
+ return -1;
+
+ if (op_dcl->raises_expr () != 0)
+ if (op_dcl->raises_expr ()->accept (&body_visitor) == -1)
+ return -1;
+
+ if (op_dcl->context_expr () != 0)
+ if (op_dcl->context_expr ()->accept (&body_visitor) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagetype (TAO_PSDL_Storagetype *storagetype)
+{
+ print_depth (this->depth_ + 10);
+
+ cout << "STORAGETYPE {" << endl;
+
+ if (storagetype->declaration () != 0)
+ if (storagetype->declaration ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagetype_dcl (TAO_PSDL_Storagetype_Dcl *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagetype_fwd_dcl (TAO_PSDL_Storagetype_Fwd_Dcl *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagetype_header (TAO_PSDL_Storagetype_Header *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagetype_body (TAO_PSDL_Storagetype_Body *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_storagehome_scope (TAO_PSDL_Storagehome_Scope *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_provides_dcl (TAO_PSDL_Provides_Dcl *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_op_type_spec (TAO_PSDL_Op_Type_Spec *op_type_spec)
+{
+ print_depth (this->depth_);
+
+ cout << "OP_TYPE_SPEC {" << endl;
+ if (op_type_spec->type () != 0)
+ {
+ cout << "Type {" << op_type_spec->type () << "}" << endl;
+ }
+
+ if (op_type_spec->type_spec () != 0)
+ if (op_type_spec->type_spec ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_parameter_dcls (TAO_PSDL_Parameter_Dcls *parameter_dcls)
+{
+ print_depth (this->depth_);
+
+ cout << "PARAMETER_DCLS {" << endl;
+ if (parameter_dcls->param_dcl () != 0)
+ if (parameter_dcls->param_dcl ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_param_dcl (TAO_PSDL_Param_Dcl *param_dcl)
+{
+ print_depth (this->depth_);
+
+ cout << "PARAM_DCL {" << endl;
+ if (param_dcl->param_attribute ()->accept (this) == -1)
+ return -1;
+
+ Dump_Visitor body_visitor (this->depth_ + 1);
+
+ if (param_dcl->param_type_spec ()->accept (&body_visitor) == -1)
+ return -1;
+
+ Dump_Visitor body_visitor_two (this->depth_ + 2);
+
+ if (param_dcl->simple_declarator ()->accept (&body_visitor) == -1)
+ return -1;
+
+ if (param_dcl->param_dcl () != 0)
+ if (param_dcl->param_dcl ()->accept (&body_visitor) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_raises_expr (TAO_PSDL_Raises_Expr *raises_expr)
+{
+ print_depth (this->depth_);
+
+ cout << "RAISES_EXPR ";
+ if (raises_expr->first_scoped_name ()->accept (this) == -1)
+ return -1;
+
+ if (raises_expr->second_scoped_name () != 0)
+ if (raises_expr->first_scoped_name ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_context_expr (TAO_PSDL_Context_Expr *context_expr)
+{
+ print_depth (this->depth_);
+
+ cout << "CONTEXT_EXPR ";
+ if (context_expr->string_literal ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_param_type_spec (TAO_PSDL_Param_Type_Spec *param_type_spec)
+{
+ print_depth (this->depth_);
+
+ cout << "PARAM_TYPE_SPEC {" << endl;
+ if (param_type_spec->type_of_param ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+Dump_Visitor::visit_fixed_pt_type (TAO_PSDL_Fixed_Pt_Type *fixed_pt_type)
+{
+ print_depth (this->depth_);
+
+ cout << "FIXED_PT_TYPE ";
+ if (fixed_pt_type->positive_int_const_one ()->accept (this) == -1)
+ return -1;
+
+ if (fixed_pt_type->positive_int_const_two ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_constr_forward_decl (TAO_PSDL_Constr_Forward_Decl *constr_fwd_dcl)
+{
+ print_depth (this->depth_);
+
+ cout << "CONSTR_FWD_DCL ";
+ if (constr_fwd_dcl->type ()->accept (this) == -1)
+ return -1;
+
+ if (constr_fwd_dcl->identifier ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_interface (TAO_PSDL_Interface *interface)
+{
+ print_depth (this->depth_ + 10);
+
+ cout << "INTERFACE {" << endl;
+ if (interface->type_of_dcl ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_interface_body (TAO_PSDL_Interface_Body *interface_body)
+{
+ print_depth (this->depth_ + 15);
+
+ cout << "INTERFACE_BODY {" << endl;
+ if (interface_body->export_variable ()->accept (this) == -1)
+ return -1;
+
+ if (interface_body->interface_body () != 0)
+ {
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (interface_body->interface_body ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+Dump_Visitor::visit_interface_dcl (TAO_PSDL_Interface_Dcl *interface_dcl)
+{
+ print_depth (this->depth_ + 15);
+
+ cout << "INTERFACE_DCL {" << endl;
+ if (interface_dcl->interface_header ()->accept (this) == -1)
+ return -1;
+
+ if (interface_dcl->interface_body () != 0)
+ {
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (interface_dcl->interface_body ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+Dump_Visitor::visit_forward_dcl (TAO_PSDL_Forward_Dcl *forward_dcl)
+{
+ print_depth (this->depth_ + 15);
+
+ cout << "FORWARD_DCL {" << endl;
+ if (forward_dcl->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (forward_dcl->type () != 0)
+ {
+ cout << "{" << forward_dcl->type () << "}" << endl;
+ }
+ return 0;
+}
+
+int
+Dump_Visitor::visit_interface_header (TAO_PSDL_Interface_Header *interface_header)
+{
+ print_depth (this->depth_ + 15);
+
+ cout << "INTERFACE_HEADER {" << endl;
+ if (interface_header->identifier ()->accept (this) == -1)
+ return -1;
+
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (interface_header->type () != 0)
+ {
+ if (interface_header->type ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+
+ if (interface_header->interface_inheritance_spec () != 0)
+ {
+ if (interface_header->interface_inheritance_spec ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+Dump_Visitor::visit_export_dcl (TAO_PSDL_Export_Dcl *export_dcl)
+{
+ print_depth (this->depth_ + 15);
+
+ cout << "EXPORT_DCL {" << endl;
+ print_depth (this->depth_ + 5);
+ if (export_dcl->type_of_export_one ()->accept (this) == -1)
+ return -1;
+
+ if (export_dcl->type_of_export_two () != 0)
+ {
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (export_dcl->type_of_export_two ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+Dump_Visitor::visit_interface_inheritance_spec (TAO_PSDL_Interface_Inheritance_Spec *interface_inh_spec)
+{
+ print_depth (this->depth_);
+
+ cout << "INTERFACE_INH_SPEC ";
+ if (interface_inh_spec->interface_name ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_interface_name (TAO_PSDL_Interface_Name *interface_name)
+{
+ print_depth (this->depth_);
+
+ cout << "INTERFACE_NAME ";
+ if (interface_name->scoped_name ()->accept (this) == -1)
+ return -1;
+
+ if (interface_name->interface_name () != 0)
+ {
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (interface_name->interface_name ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+Dump_Visitor::visit_scoped_name (TAO_PSDL_Scoped_Name *scoped_name)
+{
+ print_depth (this->depth_ + 40);
+
+ cout << "SCOPED_NAME " << endl;
+ if (scoped_name->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (scoped_name->scoped_name () != 0)
+ {
+ Dump_Visitor body_visitor (this->depth_ + 1);
+ if (scoped_name->scoped_name ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+Dump_Visitor::visit_value (TAO_PSDL_Value *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_value_common_base (TAO_PSDL_Value_Common_Base *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_value_forward_dcl (TAO_PSDL_Value_Forward_Dcl *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_value_box_dcl (TAO_PSDL_Value_Box_Dcl *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_value_abs_dcl (TAO_PSDL_Value_Abs_Dcl *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_value_dcl (TAO_PSDL_Value_Dcl *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_value_header (TAO_PSDL_Value_Header *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_value_inheritance_spec (TAO_PSDL_Value_Inheritance_Spec *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_value_name (TAO_PSDL_Value_Name *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_value_element (TAO_PSDL_Value_Element *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_array_declarator (TAO_PSDL_Array_Declarator *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_fixed_array_size (TAO_PSDL_Fixed_Array_Size *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_enumerator (TAO_PSDL_Enumerator *enumerator)
+{
+ print_depth (this->depth_ + 15);
+
+ cout << "ENUMERATOR {" << endl;
+ if (enumerator->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (enumerator->enumerator () != 0)
+ {
+ Dump_Visitor body_visitor (this->depth_);
+ if (enumerator->enumerator ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+Dump_Visitor::visit_literal (TAO_PSDL_Literal *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_state_member (TAO_PSDL_State_Member *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_init_dcl (TAO_PSDL_Init_Dcl *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_init_param_decls (TAO_PSDL_Init_Param_Decls *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_init_param_decl (TAO_PSDL_Init_Param_Decl *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_factory_parameters (TAO_PSDL_Factory_Parameters *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_attr_dcl (TAO_PSDL_Attr_Dcl *attr_dcl)
+{
+ print_depth (this->depth_);
+
+ cout << "ATTR_DCL ";
+
+ if (attr_dcl->readonly () != 0)
+ {
+ cout << "{" << attr_dcl->readonly () << "}" << endl;
+ }
+
+ if (attr_dcl->param_type_spec ()->accept (this) == -1)
+ return -1;
+
+ Dump_Visitor body_visitor (this->depth_ + 1);
+
+ if (attr_dcl->simple_declarator ()->accept (&body_visitor) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Dump_Visitor::visit_factory_dcl (TAO_PSDL_Factory_Dcl *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+int
+Dump_Visitor::visit_positive_int_const (TAO_PSDL_Positive_Int_Const *)
+{
+ // @@ NOT YET SUPPORTED
+ return 0;
+}
+
+void
+Dump_Visitor::print_depth (int depth)
+{
+ for (int i = 0; i != depth; ++i)
+ {
+ cout << " ";
+ }
+}
diff --git a/TAO/orbsvcs/PSS/Dump_Visitor.h b/TAO/orbsvcs/PSS/Dump_Visitor.h
new file mode 100644
index 00000000000..501b28c211f
--- /dev/null
+++ b/TAO/orbsvcs/PSS/Dump_Visitor.h
@@ -0,0 +1,155 @@
+// $Id$
+
+#include "PSDL_Node_Visitor.h"
+
+class Dump_Visitor : public TAO_PSDL_Node_Visitor
+{
+public:
+
+ Dump_Visitor (int depth);
+
+ ~Dump_Visitor ();
+
+ // The following methods help print the parse tree. Each method
+ // will invoke the 'accept' methods of the private members (accessed
+ // via the public accessor methods) of the class. Again, we are
+ // making using of the visitor pattern here.
+ int visit_specification (TAO_PSDL_Specification *);
+ int visit_definition (TAO_PSDL_Definition *);
+ int visit_module (TAO_PSDL_Module *);
+ int visit_abstract_storagetype (TAO_PSDL_Abstract_Storagetype *);
+ int visit_abstract_storagetype_dcl (TAO_PSDL_Abstract_Storagetype_Dcl *);
+ int visit_abstract_storagetype_fwd_dcl (TAO_PSDL_Abstract_Storagetype_Fwd_Dcl *);
+ int visit_abstract_storagetype_header (TAO_PSDL_Abstract_Storagetype_Header *);
+ int visit_abstract_storagetype_body (TAO_PSDL_Abstract_Storagetype_Body *);
+ int visit_abstract_storagetype_member (TAO_PSDL_Abstract_Storagetype_Member *);
+ int visit_abstract_storagetype_inh_spec (TAO_PSDL_Abstract_Storagetype_Inh_Spec *);
+ int visit_abstract_storagetype_name (TAO_PSDL_Abstract_Storagetype_Name *);
+ int visit_psdl_state_dcl (TAO_PSDL_Psdl_State_Dcl *);
+ int visit_psdl_state_type_spec (TAO_PSDL_Psdl_State_Type_Spec *);
+
+ int visit_abstract_storagetype_ref_type (TAO_PSDL_Abstract_Storagetype_Ref_Type);
+
+ int visit_abstract_storagehome (TAO_PSDL_Abstract_Storagehome *);
+ int visit_abstract_storagehome_fwd_dcl (TAO_PSDL_Abstract_Storagehome_Fwd_Dcl *);
+ int visit_abstract_storagehome_dcl (TAO_PSDL_Abstract_Storagehome_Dcl *);
+
+ int visit_abstract_storagehome_header (TAO_PSDL_Abstract_Storagehome_Header *);
+ int visit_abstract_storagehome_body (TAO_PSDL_Abstract_Storagehome_Body *);
+ int visit_abstract_storagehome_member (TAO_PSDL_Abstract_Storagehome_Member *);
+ int visit_abstract_storagehome_inh_spec (TAO_PSDL_Abstract_Storagehome_Inh_Spec *);
+ int visit_abstract_storagehome_name (TAO_PSDL_Abstract_Storagehome_Name *);
+ int visit_local_op_dcl (TAO_PSDL_Local_Op_Dcl *);
+ int visit_key_dcl (TAO_PSDL_Key_Dcl *);
+ int visit_catalog (TAO_PSDL_Catalog *);
+ int visit_catalog_inh_spec (TAO_PSDL_Catalog_Inh_Spec *);
+ int visit_catalog_name (TAO_PSDL_Catalog_Name *);
+ int visit_catalog_body (TAO_PSDL_Catalog_Body *);
+ int visit_catalog_member (TAO_PSDL_Catalog_Member *);
+ int visit_storagetype_member (TAO_PSDL_Storagetype_Member *);
+ int visit_storagetype_inh_spec (TAO_PSDL_Storagetype_Inh_Spec *);
+ int visit_storagetype_name (TAO_PSDL_Storagetype_Name *);
+ int visit_storagetype_impl_spec (TAO_PSDL_Storagetype_Impl_Spec *);
+ int visit_storagetype_ref_type (TAO_PSDL_Storagetype_Ref_Type *);
+ int visit_store_directive (TAO_PSDL_Store_Directive *);
+ int visit_psdl_concrete_state_type (TAO_PSDL_Psdl_Concrete_State_Type *) ;
+ int visit_ref_rep_directive (TAO_PSDL_Ref_Rep_Directive *) ;
+ int visit_storagehome (TAO_PSDL_Storagehome *) ;
+ int visit_storagehome_header (TAO_PSDL_Storagehome_Header *) ;
+ int visit_storagehome_body (TAO_PSDL_Storagehome_Body *) ;
+ int visit_storagehome_member (TAO_PSDL_Storagehome_Member *) ;
+ int visit_storagehome_inh_spec (TAO_PSDL_Storagehome_Inh_Spec *) ;
+ int visit_storagehome_name (TAO_PSDL_Storagehome_Name *) ;
+
+ int visit_storagehome_impl_spec (TAO_PSDL_Storagehome_Impl_Spec *) ;
+ int visit_primary_key_dcl (TAO_PSDL_Primary_Key_Dcl *);
+ int visit_identifier (TAO_PSDL_Identifier *);
+
+ int visit_type_dcl (TAO_PSDL_Type_Dcl *) ;
+ int visit_type_declarator (TAO_PSDL_Type_Declarator *) ;
+ int visit_type_spec (TAO_PSDL_Type_Spec *) ;
+ int visit_simple_type_spec (TAO_PSDL_Simple_Type_Spec *) ;
+ int visit_base_type_spec (TAO_PSDL_Base_Type_Spec *) ;
+ int visit_template_type_spec (TAO_PSDL_Template_Type_Spec *) ;
+ int visit_constr_type_spec (TAO_PSDL_Constr_Type_Spec *) ;
+ int visit_declarators (TAO_PSDL_Declarators *) ;
+ int visit_declarator (TAO_PSDL_Declarator *) ;
+ int visit_simple_declarator (TAO_PSDL_Simple_Declarator *) ;
+ int visit_simple_declarator_list (TAO_PSDL_Simple_Declarator_List *) ;
+ int visit_complex_declarator (TAO_PSDL_Complex_Declarator *) ;
+ int visit_predefined_type (TAO_PSDL_Predefined_Type *) ;
+ int visit_member_list (TAO_PSDL_Member_List *) ;
+ int visit_member (TAO_PSDL_Member *) ;
+ int visit_union_type (TAO_PSDL_Union_Type *) ;
+ int visit_switch_type_spec (TAO_PSDL_Switch_Type_Spec *) ;
+ int visit_switch_body (TAO_PSDL_Switch_Body *) ;
+ int visit_case_case (TAO_PSDL_Case *) ;
+ int visit_case_label (TAO_PSDL_Case_Label *) ;
+ int visit_element_spec (TAO_PSDL_Element_Spec *) ;
+ int visit_const_dcl (TAO_PSDL_Const_Dcl *) ;
+ int visit_const_type (TAO_PSDL_Const_Type *) ;
+ int visit_const_exp (TAO_PSDL_Const_Exp *) ;
+ int visit_or_expr (TAO_PSDL_Or_Expr *) ;
+ int visit_xor_expr (TAO_PSDL_Xor_Expr *) ;
+ int visit_and_expr (TAO_PSDL_And_Expr *) ;
+ int visit_shift_expr (TAO_PSDL_Shift_Expr *) ;
+ int visit_add_expr (TAO_PSDL_Add_Expr *) ;
+ int visit_mult_expr (TAO_PSDL_Mult_Expr *) ;
+ int visit_unary_expr (TAO_PSDL_Unary_Expr *) ;
+ int visit_primary_expr (TAO_PSDL_Primary_Expr *) ;
+ int visit_except_dcl (TAO_PSDL_Except_Dcl *) ;
+ int visit_op_dcl (TAO_PSDL_Op_Dcl *) ;
+ int visit_storagetype (TAO_PSDL_Storagetype *) ;
+ int visit_storagetype_dcl (TAO_PSDL_Storagetype_Dcl *) ;
+ int visit_storagetype_fwd_dcl (TAO_PSDL_Storagetype_Fwd_Dcl *);
+ int visit_storagetype_header (TAO_PSDL_Storagetype_Header *);
+ int visit_storagetype_body (TAO_PSDL_Storagetype_Body *);
+ int visit_storagehome_scope (TAO_PSDL_Storagehome_Scope *);
+ int visit_provides_dcl (TAO_PSDL_Provides_Dcl *);
+ int visit_op_type_spec (TAO_PSDL_Op_Type_Spec *);
+ int visit_parameter_dcls (TAO_PSDL_Parameter_Dcls *);
+ int visit_param_dcl (TAO_PSDL_Param_Dcl *);
+ int visit_raises_expr (TAO_PSDL_Raises_Expr *);
+ int visit_context_expr (TAO_PSDL_Context_Expr *);
+ int visit_param_type_spec (TAO_PSDL_Param_Type_Spec *);
+ int visit_fixed_pt_type (TAO_PSDL_Fixed_Pt_Type *);
+ int visit_constr_forward_decl (TAO_PSDL_Constr_Forward_Decl *);
+ int visit_interface (TAO_PSDL_Interface *);
+ int visit_interface_body (TAO_PSDL_Interface_Body *);
+ int visit_interface_dcl (TAO_PSDL_Interface_Dcl *);
+ int visit_forward_dcl (TAO_PSDL_Forward_Dcl *);
+ int visit_interface_header (TAO_PSDL_Interface_Header *);
+ int visit_export_dcl (TAO_PSDL_Export_Dcl *);
+ int visit_interface_inheritance_spec (TAO_PSDL_Interface_Inheritance_Spec *);
+ int visit_interface_name (TAO_PSDL_Interface_Name *);
+ int visit_scoped_name (TAO_PSDL_Scoped_Name *);
+ int visit_value (TAO_PSDL_Value *);
+ int visit_value_common_base (TAO_PSDL_Value_Common_Base *);
+ int visit_value_forward_dcl (TAO_PSDL_Value_Forward_Dcl *);
+ int visit_value_box_dcl (TAO_PSDL_Value_Box_Dcl *);
+ int visit_value_abs_dcl (TAO_PSDL_Value_Abs_Dcl *);
+ int visit_value_dcl (TAO_PSDL_Value_Dcl *);
+ int visit_value_header (TAO_PSDL_Value_Header *);
+ int visit_value_inheritance_spec (TAO_PSDL_Value_Inheritance_Spec *);
+ int visit_value_name (TAO_PSDL_Value_Name *);
+ int visit_value_element (TAO_PSDL_Value_Element *);
+ int visit_array_declarator (TAO_PSDL_Array_Declarator *);
+ int visit_fixed_array_size (TAO_PSDL_Fixed_Array_Size *);
+ int visit_enumerator (TAO_PSDL_Enumerator *);
+ int visit_literal (TAO_PSDL_Literal *);
+ int visit_state_member (TAO_PSDL_State_Member *);
+ int visit_init_dcl (TAO_PSDL_Init_Dcl *);
+ int visit_init_param_decls (TAO_PSDL_Init_Param_Decls *);
+ int visit_init_param_decl (TAO_PSDL_Init_Param_Decl *);
+ int visit_factory_parameters (TAO_PSDL_Factory_Parameters *);
+ int visit_attr_dcl (TAO_PSDL_Attr_Dcl *);
+ int visit_factory_dcl (TAO_PSDL_Factory_Dcl *);
+ int visit_positive_int_const (TAO_PSDL_Positive_Int_Const *);
+
+ private:
+
+ void print_depth (int depth);
+
+private:
+ int depth_;
+};
diff --git a/TAO/orbsvcs/PSS/PSDL.ll b/TAO/orbsvcs/PSS/PSDL.ll
new file mode 100644
index 00000000000..50f292ce752
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL.ll
@@ -0,0 +1,209 @@
+%option noyywrap
+
+%{
+// $Id$
+// ========================================================================
+//
+// = LIBRARY
+// orbsvcs/PSS
+//
+// = FILENAME
+// PSDL.ll
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+// ========================================================================
+
+#include "ace/OS.h"
+
+#include "PSDL_Interpreter.h"
+#include "PSDL_Node.h"
+#include "PSDL_y.h"
+
+static const char * extract_string(char*);
+
+//#define TAO_YY_LEX_DEBUG
+
+#define TAO_YY_LEX_DEBUG ACE_OS::fprintf(stderr, "%s\n", yytext)
+
+#define YY_DECL int TAO_PSDL_yylex (TAO_PSDL_Node **lvalp, void* )
+
+#define YY_BREAK
+#define YY_NO_UNPUT
+
+%}
+
+white_space \t
+letter [a-zA-Z]
+digit [0-9]
+alpha_num ({letter}|{digit})
+integer {digit}+
+float ({digit}*\.{digit}+)([eE][-+]?{digit}+)?
+string '(([^'\\]*)|([^'\\]*\\')|([^'\\]*\\\\))*'
+base {letter}({alpha_num}|[_])*
+ident {base}|\\{base}
+newline \n
+
+%%
+
+";" { TAO_YY_LEX_DEBUG; return TAO_PSDL_SEMI; }
+":" { TAO_YY_LEX_DEBUG; return TAO_PSDL_COLON; }
+"{" { TAO_YY_LEX_DEBUG; return TAO_PSDL_OPEN_CURLY_BRACE; }
+"}" { TAO_YY_LEX_DEBUG; return TAO_PSDL_CLOSE_CURLY_BRACE; }
+"(" { TAO_YY_LEX_DEBUG; return TAO_PSDL_OPEN_BRACE; }
+")" { TAO_YY_LEX_DEBUG; return TAO_PSDL_CLOSE_BRACE; }
+"<" { TAO_YY_LEX_DEBUG; return TAO_PSDL_OPEN_ANGULAR_BRACE; }
+">" { TAO_YY_LEX_DEBUG; return TAO_PSDL_CLOSE_ANGULAR_BRACE; }
+"," { TAO_YY_LEX_DEBUG; return TAO_PSDL_COMMA; }
+"+" { TAO_YY_LEX_DEBUG; return TAO_PSDL_PLUS; }
+"-" { TAO_YY_LEX_DEBUG; return TAO_PSDL_MINUS; }
+"^" { TAO_YY_LEX_DEBUG; return TAO_PSDL_XOR; }
+"&" { TAO_YY_LEX_DEBUG; return TAO_PSDL_AND; }
+"*" { TAO_YY_LEX_DEBUG; return TAO_PSDL_MULT; }
+">>" { TAO_YY_LEX_DEBUG; return TAO_PSDL_RIGHT_SHIFT; }
+"<<" { TAO_YY_LEX_DEBUG; return TAO_PSDL_LEFT_SHIFT; }
+"/" { TAO_YY_LEX_DEBUG; return TAO_PSDL_DIV; }
+"%" { TAO_YY_LEX_DEBUG; return TAO_PSDL_PERCENT; }
+"~" { TAO_YY_LEX_DEBUG; return TAO_PSDL_TILDA; }
+"=" { TAO_YY_LEX_DEBUG; return TAO_PSDL_EQUAL; }
+"|" { TAO_YY_LEX_DEBUG; return TAO_PSDL_OR; }
+"::" { TAO_YY_LEX_DEBUG; return TAO_PSDL_DOUBLE_COLON; }
+"[" { TAO_YY_LEX_DEBUG; return TAO_PSDL_OPEN_SQUARE_BRACE; }
+"]" { TAO_YY_LEX_DEBUG; return TAO_PSDL_CLOSE_SQUARE_BRACE; }
+"in" { TAO_YY_LEX_DEBUG; return TAO_PSDL_IN; }
+"as" { TAO_YY_LEX_DEBUG; return TAO_PSDL_AS; }
+"of" { TAO_YY_LEX_DEBUG; return TAO_PSDL_OF; }
+"key" { TAO_YY_LEX_DEBUG; return TAO_PSDL_KEY; }
+"ref" { TAO_YY_LEX_DEBUG; return TAO_PSDL_REF; }
+"any" { TAO_YY_LEX_DEBUG; return TAO_PSDL_ANY; }
+"out" { TAO_YY_LEX_DEBUG; return TAO_PSDL_OUT; }
+"case" { TAO_YY_LEX_DEBUG; return TAO_PSDL_CASE; }
+"inout" { TAO_YY_LEX_DEBUG; return TAO_PSDL_INOUT; }
+"catalog" { TAO_YY_LEX_DEBUG; return TAO_PSDL_CATALOG; }
+"provides" { TAO_YY_LEX_DEBUG; return TAO_PSDL_PROVIDES; }
+"char" { TAO_YY_LEX_DEBUG; return TAO_PSDL_CHAR; }
+"implements" { TAO_YY_LEX_DEBUG; return TAO_PSDL_IMPLEMENTS; }
+"scope" { TAO_YY_LEX_DEBUG; return TAO_PSDL_SCOPE; }
+"stores" { TAO_YY_LEX_DEBUG; return TAO_PSDL_STORES; }
+"state" { TAO_YY_LEX_DEBUG; return TAO_PSDL_STATE; }
+"abstract" { TAO_YY_LEX_DEBUG; return TAO_PSDL_ABSTRACT; }
+"storagetype" { TAO_YY_LEX_DEBUG; return TAO_PSDL_STORAGETYPE; }
+"storagehome" { TAO_YY_LEX_DEBUG; return TAO_PSDL_STORAGEHOME; }
+"strong" { TAO_YY_LEX_DEBUG; return TAO_PSDL_STRONG; }
+"primary" { TAO_YY_LEX_DEBUG; return TAO_PSDL_PRIMARY; }
+"readonly" { TAO_YY_LEX_DEBUG; return TAO_PSDL_READONLY; }
+"union" { TAO_YY_LEX_DEBUG; return TAO_PSDL_UNION; }
+"switch" { TAO_YY_LEX_DEBUG; return TAO_PSDL_SWITCH; }
+"wchar" { TAO_YY_LEX_DEBUG; return TAO_PSDL_WCHAR; }
+"boolean" { TAO_YY_LEX_DEBUG; return TAO_PSDL_BOOLEAN; }
+"octet" { TAO_YY_LEX_DEBUG; return TAO_PSDL_OCTET; }
+"Object" { TAO_YY_LEX_DEBUG; return TAO_PSDL_OBJECT; }
+"struct" { TAO_YY_LEX_DEBUG; return TAO_PSDL_STRUCT; }
+"default" { TAO_YY_LEX_DEBUG; return TAO_PSDL_DEFAULT; }
+"float" { TAO_YY_LEX_DEBUG; return TAO_PSDL_FLOAT; }
+"double" { TAO_YY_LEX_DEBUG; return TAO_PSDL_DOUBLE; }
+"long" { TAO_YY_LEX_DEBUG; return TAO_PSDL_LONG; }
+"short" { TAO_YY_LEX_DEBUG; return TAO_PSDL_SHORT; }
+"unsigned" { TAO_YY_LEX_DEBUG; return TAO_PSDL_UNSIGNED; }
+"typedef" { TAO_YY_LEX_DEBUG; return TAO_PSDL_TYPEDEF; }
+"native" { TAO_YY_LEX_DEBUG; return TAO_PSDL_NATIVE; }
+"module" { TAO_YY_LEX_DEBUG; return TAO_PSDL_MODULE; }
+"oneway" { TAO_YY_LEX_DEBUG; return TAO_PSDL_ONEWAY; }
+"const" { TAO_YY_LEX_DEBUG; return TAO_PSDL_CONST; }
+"void" { TAO_YY_LEX_DEBUG; return TAO_PSDL_VOID; }
+"raises" { TAO_YY_LEX_DEBUG; return TAO_PSDL_RAISES; }
+"context" { TAO_YY_LEX_DEBUG; return TAO_PSDL_CONTEXT; }
+"fixed" { TAO_YY_LEX_DEBUG; return TAO_PSDL_FIXED; }
+"ValueBase" { TAO_YY_LEX_DEBUG; return TAO_PSDL_VALUEBASE; }
+"exception" { TAO_YY_LEX_DEBUG; return TAO_PSDL_EXCEPTION; }
+"interface" { TAO_YY_LEX_DEBUG; return TAO_PSDL_INTERFACE; }
+"local" { TAO_YY_LEX_DEBUG; return TAO_PSDL_LOCAL; }
+"valuetype" { TAO_YY_LEX_DEBUG; return TAO_PSDL_VALUETYPE; }
+"custom" { TAO_YY_LEX_DEBUG; return TAO_PSDL_CUSTOM; }
+"truncatable" { TAO_YY_LEX_DEBUG; return TAO_PSDL_TRUNCATABLE; }
+"supports" { TAO_YY_LEX_DEBUG; return TAO_PSDL_SUPPORTS; }
+"string" { TAO_YY_LEX_DEBUG; return TAO_PSDL_STRING; }
+"wstring" { TAO_YY_LEX_DEBUG; return TAO_PSDL_WSTRING; }
+"attribute" { TAO_YY_LEX_DEBUG; return TAO_PSDL_ATTRIBUTE; }
+"enum" { TAO_YY_LEX_DEBUG; return TAO_PSDL_ENUM; }
+"sequence" { TAO_YY_LEX_DEBUG; return TAO_PSDL_SEQUENCE; }
+"private" { TAO_YY_LEX_DEBUG; return TAO_PSDL_PRIVATE; }
+"public" { TAO_YY_LEX_DEBUG; return TAO_PSDL_PUBLIC; }
+"factory" { TAO_YY_LEX_DEBUG; return TAO_PSDL_FACTORY; }
+"TRUE" {
+ *lvalp =
+ new TAO_PSDL_Literal ((CORBA::Boolean) 1);
+ TAO_YY_LEX_DEBUG; return TAO_PSDL_TRUE;
+ }
+"FALSE" {
+ *lvalp =
+ new TAO_PSDL_Literal ((CORBA::Boolean) 0);
+ TAO_YY_LEX_DEBUG; return TAO_PSDL_FALSE;
+ }
+{integer} {
+ *lvalp =
+ new TAO_PSDL_Literal (ACE_OS::atoi (yytext));
+ TAO_YY_LEX_DEBUG; return TAO_PSDL_INTEGER;
+ }
+{float} {
+ double v;
+ sscanf (yytext, "%lf", &v);
+ *lvalp =
+ new TAO_PSDL_Literal (v);
+ TAO_YY_LEX_DEBUG; return TAO_PSDL_FLOATING_PT;
+ }
+{ident} {
+ *lvalp =
+ new TAO_PSDL_Identifier (yytext);
+ TAO_YY_LEX_DEBUG; return TAO_PSDL_IDENT;
+ }
+{string} {
+ *lvalp =
+ new TAO_PSDL_Literal (extract_string (yytext));
+ TAO_YY_LEX_DEBUG; return TAO_PSDL_STRING;
+ }
+{white_space} {
+ TAO_YY_LEX_DEBUG; break; // Ignore
+ }
+{newline} {
+ TAO_YY_LEX_DEBUG; break; // Ignore
+ }
+. {
+ TAO_YY_LEX_DEBUG; break; // @@ TODO
+ }
+%%
+
+const char*
+extract_string(char* str)
+{
+ char *t = str;
+ for (char * i = str + 1; *i != '\''; ++i, ++t)
+ {
+ if (*i == '\\')
+ {
+ ++i;
+ if (*i == 0)
+ return 0;
+ else if (*i == 't')
+ *t = '\t';
+ else if (*i == 'n')
+ *t = '\n';
+ else if (*i == '\\')
+ *t = '\\';
+ else
+ *t = *i;
+ continue;
+ }
+
+ *t = *i;
+ }
+
+ *t = '\0';
+ return str;
+}
+
+int
+yywrap ()
+{
+ return 1;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL.mpc b/TAO/orbsvcs/PSS/PSDL.mpc
new file mode 100644
index 00000000000..d6e16be462f
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL.mpc
@@ -0,0 +1,57 @@
+// -*- MPC -*-
+// $Id$
+
+project : taolib {
+ requires += dummy_label
+ sharedname = TAO_PSDL
+ dynamicflags += TAO_PSDL_BUILD_DLL
+ source_files {
+ PSDL_Node.cpp
+ PSDL_Interpreter.cpp
+ PSDL_Visitor_Factory.cpp
+ PSDL_Node_Visitor.cpp
+ PSDL_Module_Visitor.cpp
+ PSDL_Type_Dcl_Visitor.cpp
+ PSDL_Struct_Visitor.cpp
+ PSDL_Enum_Type_Visitor.cpp
+ PSDL_Interface_Visitor.cpp
+ PSDL_Exception_Visitor.cpp
+ PSDL_Typecode_Defn.cpp
+ PSDL_Scope.cpp
+ PSDL_Root_Scope.cpp
+ PSDL_Simple_Scope.cpp
+ PSDL_Module_Scope.cpp
+ PSDL_Interface_Scope.cpp
+ PSDL_Struct_Scope.cpp
+ PSDL_Exception_Scope.cpp
+ PSDL_Op_Dcl_Scope.cpp
+ PSDL_Scope_Visitor.cpp
+ PSDL_Stream.cpp
+ PSDL_Extern.cpp
+ PSDL_l.cpp
+ PSDL_y.cpp
+ }
+}
+
+project(*Datastore) : taolib {
+ requires += dummy_label
+ sharedname = TAO_PSDL_Datastore
+ dynamicflags += TAO_PSDL_BUILD_DLL
+ source_files {
+ PSDL_Code_Gen.cpp
+ PSDL_OctetSeq.cpp
+ PSDL_String.cpp
+ PSDL_Datastore.cpp
+ }
+}
+
+project(*Parser) : taoexe {
+ requires += dummy_label
+ after += PSDL
+ libs += TAO_PSDL
+ install = .
+ source_files {
+ Dump_Visitor.cpp
+ psdl_tao.cpp
+ }
+}
diff --git a/TAO/orbsvcs/PSS/PSDL.yy b/TAO/orbsvcs/PSS/PSDL.yy
new file mode 100644
index 00000000000..3a973035561
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL.yy
@@ -0,0 +1,1364 @@
+%{
+// $Id$
+// ========================================================================
+//
+// = LIBRARY
+// orbsvcs / Persistent State Definition Language parser.
+//
+// = FILENAME
+// PSDL.yy
+//
+// = AUTHOR
+// Priyanka Gontla <pgontla@doc.ece.uci.edu>
+//
+// ========================================================================
+
+#include "PSDL_y.h"
+#include "PSDL_Node.h"
+#include "PSDL_Interpreter.h"
+#include "PSDL_Scope.h"
+#include "PSDL_Module_Scope.h"
+
+#define YYPARSE_PARAM lex_state
+#define YYLEX_PARAM lex_state
+
+//extern int yylex (TAO_PSDL_Node **, void *);
+extern int yylex (void);
+
+static void yyerror (const char *error)
+{
+ printf ("Error %s\n", error);
+}
+
+%}
+
+%token TAO_PSDL_SEMI TAO_PSDL_MODULE TAO_PSDL_COLON
+%token TAO_PSDL_OPEN_CURLY_BRACE TAO_PSDL_CLOSE_CURLY_BRACE
+%token TAO_PSDL_OPEN_BRACE TAO_PSDL_CLOSE_BRACE
+%token TAO_PSDL_ABSTRACT TAO_PSDL_STORAGETYPE
+%token TAO_PSDL_STORAGEHOME
+%token TAO_PSDL_CATALOG TAO_PSDL_PROVIDES
+%token TAO_PSDL_IMPLEMENTS
+%token TAO_PSDL_SCOPE TAO_PSDL_STORES TAO_PSDL_STATE
+%token TAO_PSDL_AS TAO_PSDL_PRIMARY
+%token TAO_PSDL_STRONG TAO_PSDL_REF TAO_PSDL_OF
+%token TAO_PSDL_OPEN_ANGULAR_BRACE TAO_PSDL_CLOSE_ANGULAR_BRACE
+%token TAO_PSDL_COMMA TAO_PSDL_KEY TAO_PSDL_READONLY
+%token TAO_PSDL_UNION TAO_PSDL_SWITCH TAO_PSDL_CASE
+%token TAO_PSDL_WCHAR TAO_PSDL_BOOLEAN TAO_PSDL_OCTET
+%token TAO_PSDL_ANY TAO_PSDL_OBJECT TAO_PSDL_STRUCT
+%token TAO_PSDL_DEFAULT TAO_PSDL_FLOAT TAO_PSDL_DOUBLE
+%token TAO_PSDL_LONG TAO_PSDL_SHORT TAO_PSDL_UNSIGNED
+%token TAO_PSDL_CHAR TAO_PSDL_IDENT TAO_PSDL_TYPEDEF
+%token TAO_PSDL_NATIVE TAO_PSDL_PLUS TAO_PSDL_MINUS
+%token TAO_PSDL_XOR TAO_PSDL_AND TAO_PSDL_MULT
+%token TAO_PSDL_RIGHT_SHIFT TAO_PSDL_LEFT_SHIFT
+%token TAO_PSDL_DIV TAO_PSDL_PERCENT TAO_PSDL_TILDA
+%token TAO_PSDL_ONEWAY TAO_PSDL_CONST TAO_PSDL_EQUAL TAO_PSDL_OR
+%token TAO_PSDL_VOID TAO_PSDL_IN TAO_PSDL_OUT TAO_PSDL_INOUT
+%token TAO_PSDL_RAISES TAO_PSDL_CONTEXT TAO_PSDL_FIXED
+%token TAO_PSDL_VALUEBASE TAO_PSDL_EXCEPTION
+%token TAO_PSDL_INTERFACE
+%token TAO_PSDL_LOCAL TAO_PSDL_DOUBLE_COLON TAO_PSDL_VALUETYPE
+%token TAO_PSDL_CUSTOM TAO_PSDL_TRUNCATABLE TAO_PSDL_SUPPORTS
+%token TAO_PSDL_STRING TAO_PSDL_WSTRING TAO_PSDL_ATTRIBUTE
+%token TAO_PSDL_OPEN_SQUARE_BRACE TAO_PSDL_CLOSE_SQUARE_BRACE
+%token TAO_PSDL_ENUM TAO_PSDL_SEQUENCE
+%token TAO_PSDL_TRUE TAO_PSDL_FALSE
+%token TAO_PSDL_INTEGER TAO_PSDL_FLOATING
+%token TAO_PSDL_PRIVATE TAO_PSDL_PUBLIC TAO_PSDL_FACTORY
+%token TAO_PSDL_FLOATING_PT TAO_PSDL_CHAR_LITERAL
+%token TAO_PSDL_FIXED_PT
+
+%pure_parser
+%start psdl_specification
+
+%%
+
+psdl_specification: psdl_definition
+ { $$ = new TAO_PSDL_Specification ($1); }
+ |
+ psdl_specification psdl_definition
+ { $$ = new TAO_PSDL_Specification ($1, $2); }
+ ;
+
+psdl_definition: type_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Definition ($1); }
+ |
+ const_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Definition ($1); }
+ |
+ except_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Definition ($1); }
+ |
+ interface TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Definition ($1); }
+ |
+ psdl_module TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Definition ($1); }
+ |
+ catalog TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Definition ($1); }
+ |
+ storagehome TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Definition ($1); }
+ |
+ abstract_storagehome TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Definition ($1); }
+ |
+ storagetype TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Definition ($1); }
+ |
+ abstract_storagetype TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Definition ($1); }
+ |
+ value TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Definition ($1); }
+ ;
+
+psdl_module : TAO_PSDL_MODULE identifier
+ {
+ int good_module_name = TAO_PSDL_Scope::instance ()->pop_top_scope ()->add_module (TAO_PSDL_Scope::instance ()->get_identifier ());
+ if (good_module_name == -1)
+ YYABORT;
+ }
+ TAO_PSDL_OPEN_CURLY_BRACE psdl_specification TAO_PSDL_CLOSE_CURLY_BRACE
+ {
+ TAO_PSDL_Scope::instance ()->set_module_scope ();
+ $$ = new TAO_PSDL_Module (TAO_PSDL_MODULE, $2, $5); }
+ ;
+
+abstract_storagetype : abstract_storagetype_dcl
+ { TAO_PSDL_Scope::instance ()->set_scope ();
+ $$ = new TAO_PSDL_Abstract_Storagetype ($1); }
+ |
+ abstract_storagetype_fwd_dcl
+ { $$ = new TAO_PSDL_Abstract_Storagetype ($1); }
+ ;
+
+abstract_storagetype_dcl: abstract_storagetype_header TAO_PSDL_OPEN_CURLY_BRACE abstract_storagetype_body TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Abstract_Storagetype_Dcl ($1, $3); }
+ |
+ abstract_storagetype_header TAO_PSDL_OPEN_CURLY_BRACE TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Abstract_Storagetype_Dcl ($1); }
+ ;
+
+abstract_storagetype_fwd_dcl: TAO_PSDL_ABSTRACT TAO_PSDL_STORAGETYPE identifier
+ { $$ = new TAO_PSDL_Abstract_Storagetype_Fwd_Dcl ($3); }
+ ;
+
+storagetype_identifier: TAO_PSDL_STORAGETYPE identifier
+ {
+ int good_storagetype_name = TAO_PSDL_Scope::instance ()->pop_top_scope ()->add_interface (TAO_PSDL_Scope::instance ()->get_identifier ());
+ if (good_storagetype_name == -1)
+ YYABORT;
+
+ $$ = $2;
+ }
+ ;
+
+abstract_storagetype_header:
+ TAO_PSDL_ABSTRACT storagetype_identifier abstract_storagetype_inh_spec
+ { $$ = new TAO_PSDL_Abstract_Storagetype_Header ($2, $3); }
+ |
+ TAO_PSDL_ABSTRACT storagetype_identifier
+ { $$ = new TAO_PSDL_Abstract_Storagetype_Header ($2); }
+ ;
+
+abstract_storagetype_body:
+ abstract_storagetype_member
+ { $$ = new TAO_PSDL_Abstract_Storagetype_Body ($1); }
+ |
+ abstract_storagetype_member abstract_storagetype_body
+ { $$ = new TAO_PSDL_Abstract_Storagetype_Body ($1, $2); }
+ ;
+
+abstract_storagetype_member:
+ psdl_state_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Abstract_Storagetype_Member ($1); }
+ |
+ local_op_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Abstract_Storagetype_Member ($1); }
+ ;
+
+abstract_storagetype_inh_spec:
+ TAO_PSDL_COLON abstract_storagetype_name
+ { $$ = new TAO_PSDL_Abstract_Storagetype_Inh_Spec ($2); }
+ ;
+
+abstract_storagetype_name:
+ scoped_name
+ { $$ = new TAO_PSDL_Abstract_Storagetype_Name ($1); }
+ |
+ scoped_name TAO_PSDL_COMMA abstract_storagetype_name
+ { $$ = new TAO_PSDL_Abstract_Storagetype_Name ($1, $3); }
+ ;
+
+psdl_state_dcl : TAO_PSDL_READONLY TAO_PSDL_STATE psdl_state_type_spec simple_declarator
+ { $$ = new TAO_PSDL_Psdl_State_Dcl ($1, $3, $4); }
+ |
+ TAO_PSDL_STATE psdl_state_type_spec simple_declarator
+ { $$ = new TAO_PSDL_Psdl_State_Dcl ($2, $3); }
+ ;
+
+psdl_state_type_spec : base_type_spec
+ { $$ = new TAO_PSDL_Psdl_State_Type_Spec ($1); }
+ |
+ string_type
+ { $$ = new TAO_PSDL_Psdl_State_Type_Spec ($1); }
+ |
+ wide_string_type
+ { $$ = new TAO_PSDL_Psdl_State_Type_Spec ($1); }
+ |
+ abstract_storagetype_ref_type
+ { $$ = new TAO_PSDL_Psdl_State_Type_Spec ($1); }
+ |
+ scoped_name
+ { $$ = new TAO_PSDL_Psdl_State_Type_Spec ($1); }
+ ;
+
+abstract_storagetype_ref_type:
+ TAO_PSDL_STRONG TAO_PSDL_REF TAO_PSDL_OPEN_ANGULAR_BRACE abstract_storagetype_name TAO_PSDL_CLOSE_ANGULAR_BRACE
+ { $$ = new TAO_PSDL_Abstract_Storagetype_Ref_Type ($1, $4); }
+ |
+ TAO_PSDL_REF TAO_PSDL_OPEN_ANGULAR_BRACE abstract_storagetype_name TAO_PSDL_CLOSE_ANGULAR_BRACE
+ { $$ = new TAO_PSDL_Abstract_Storagetype_Ref_Type ($3); }
+ ;
+
+abstract_storagehome : abstract_storagehome_dcl
+ { $$ = new TAO_PSDL_Abstract_Storagehome ($1); }
+ |
+ abstract_storagehome_fwd_dcl
+ { $$ = new TAO_PSDL_Abstract_Storagehome ($1); }
+ ;
+
+abstract_storagehome_fwd_dcl:
+ TAO_PSDL_ABSTRACT TAO_PSDL_STORAGEHOME identifier
+ { $$ = new TAO_PSDL_Abstract_Storagehome_Fwd_Dcl ($3); }
+ ;
+
+abstract_storagehome_dcl:
+ abstract_storagehome_header TAO_PSDL_OPEN_CURLY_BRACE abstract_storagehome_body TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Abstract_Storagehome_Dcl ($1, $3); }
+ |
+ abstract_storagehome_header TAO_PSDL_OPEN_CURLY_BRACE TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Abstract_Storagehome_Dcl ($1); }
+ ;
+
+abstract_storagehome_header:
+ TAO_PSDL_ABSTRACT TAO_PSDL_STORAGEHOME identifier TAO_PSDL_OF abstract_storagetype_name abstract_storagehome_inh_spec
+ { $$ = new TAO_PSDL_Abstract_Storagehome_Header ($3, $5, $6); }
+ |
+ TAO_PSDL_ABSTRACT TAO_PSDL_STORAGEHOME identifier TAO_PSDL_OF abstract_storagetype_name
+ { $$ = new TAO_PSDL_Abstract_Storagehome_Header ($3, $5); }
+ ;
+
+abstract_storagehome_body:
+ abstract_storagehome_member
+ { $$ = new TAO_PSDL_Abstract_Storagehome_Body ($1); }
+ |
+ abstract_storagehome_member abstract_storagehome_body
+ { $$ = new TAO_PSDL_Abstract_Storagehome_Body ($1, $2); }
+ ;
+
+abstract_storagehome_member:
+ local_op_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Abstract_Storagehome_Member ($1); }
+ |
+ key_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Abstract_Storagehome_Member ($1); }
+ |
+ factory_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Abstract_Storagehome_Member ($1); }
+ ;
+
+abstract_storagehome_inh_spec:
+ TAO_PSDL_COLON abstract_storagehome_name
+ { $$ = new TAO_PSDL_Abstract_Storagehome_Inh_Spec ($2); }
+ ;
+
+abstract_storagehome_name:
+ scoped_name
+ { $$ = new TAO_PSDL_Abstract_Storagehome_Name ($1); }
+ |
+ scoped_name TAO_PSDL_COMMA abstract_storagehome_name
+ { $$ = new TAO_PSDL_Abstract_Storagehome_Name ($1, $3); }
+ ;
+
+local_op_dcl : op_type_spec op_name parameter_dcls raises_expr
+ { TAO_PSDL_Scope::instance ()->set_scope ();
+ $$ = new TAO_PSDL_Op_Dcl ($1, $2, $3, $4); }
+ |
+ op_type_spec op_name parameter_dcls
+ { TAO_PSDL_Scope::instance ()->set_scope ();
+ $$ = new TAO_PSDL_Op_Dcl ($1, $2, $3); }
+ ;
+
+key_dcl : TAO_PSDL_KEY identifier TAO_PSDL_OPEN_BRACE simple_declarator_list TAO_PSDL_CLOSE_BRACE
+ { $$ = new TAO_PSDL_Key_Dcl ($2, $4); }
+ |
+ TAO_PSDL_KEY identifier
+ { $$ = new TAO_PSDL_Key_Dcl ($2); }
+ ;
+
+catalog : TAO_PSDL_CATALOG identifier catalog_inh_spec TAO_PSDL_OPEN_CURLY_BRACE catalog_body TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Catalog ($2, $3, $5); }
+ |
+ TAO_PSDL_CATALOG identifier TAO_PSDL_OPEN_CURLY_BRACE catalog_body TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Catalog ($2, $4); }
+ |
+ TAO_PSDL_CATALOG identifier TAO_PSDL_OPEN_CURLY_BRACE TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Catalog ($2); }
+ |
+ TAO_PSDL_CATALOG identifier catalog_inh_spec TAO_PSDL_OPEN_CURLY_BRACE TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Catalog ($2, $3); }
+ ;
+
+catalog_inh_spec : TAO_PSDL_COLON catalog_name
+ { $$ = new TAO_PSDL_Catalog_Inh_Spec ($2); }
+ ;
+
+catalog_name : scoped_name
+ { $$ = new TAO_PSDL_Catalog_Name ($1); }
+ |
+ scoped_name TAO_PSDL_COMMA catalog_name
+ { $$ = new TAO_PSDL_Catalog_Name ($1, $3); }
+ ;
+
+catalog_body : catalog_member
+ { $$ = new TAO_PSDL_Catalog_Body ($1); }
+ |
+ catalog_member catalog_body
+ { $$ = new TAO_PSDL_Catalog_Body ($1, $2); }
+ ;
+
+catalog_member : provides_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Catalog_Member ($1); }
+ |
+ local_op_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Catalog_Member ($1); }
+ ;
+
+provides_dcl : TAO_PSDL_PROVIDES abstract_storagehome_name simple_declarator
+ { $$ = new TAO_PSDL_Provides_Dcl ($2, $3); }
+ ;
+
+storagetype : storagetype_dcl
+ { $$ = new TAO_PSDL_Storagetype ($1); }
+ |
+ storagetype_fwd_dcl
+ { $$ = new TAO_PSDL_Storagetype ($1); }
+ ;
+
+storagetype_dcl : storagetype_header TAO_PSDL_OPEN_CURLY_BRACE storagetype_body TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Storagetype_Dcl ($1, $3); }
+ |
+ storagetype_header TAO_PSDL_OPEN_CURLY_BRACE TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Storagetype_Dcl ($1); }
+ ;
+
+storagetype_fwd_dcl : TAO_PSDL_STORAGETYPE identifier
+ { $$ = new TAO_PSDL_Storagetype_Fwd_Dcl ($2); }
+ ;
+
+storagetype_header : TAO_PSDL_STORAGETYPE identifier storagetype_inh_spec storagetype_impl_spec
+ { $$ = new TAO_PSDL_Storagetype_Header ($2, $3, $4); }
+ |
+ TAO_PSDL_STORAGETYPE identifier storagetype_inh_spec
+ { $$ = new TAO_PSDL_Storagetype_Header ($2, $3); }
+ |
+ TAO_PSDL_STORAGETYPE identifier storagetype_impl_spec
+ { $$ = new TAO_PSDL_Storagetype_Header ($2, $3); }
+ ;
+
+storagetype_body : storagetype_member
+ { $$ = new TAO_PSDL_Storagetype_Body ($1); }
+ |
+ storagetype_member storagetype_body
+ { $$ = new TAO_PSDL_Storagetype_Body ($1, $2); }
+ ;
+
+storagetype_member : psdl_state_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Storagetype_Member ($1); }
+ |
+ store_directive TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Storagetype_Member ($1); }
+ |
+ ref_rep_directive TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Storagetype_Member ($1); }
+ ;
+
+storagetype_inh_spec : TAO_PSDL_COLON storagetype_name
+ { $$ = new TAO_PSDL_Storagetype_Inh_Spec ($2); }
+ ;
+
+storagetype_name : scoped_name
+ { $$ = new TAO_PSDL_Storagetype_Name ($1); }
+ ;
+
+storagetype_impl_spec : TAO_PSDL_IMPLEMENTS abstract_storagetype_name
+ { $$ = new TAO_PSDL_Storagetype_Impl_Spec ($2); }
+ ;
+
+storagetype_ref_type : TAO_PSDL_REF TAO_PSDL_OPEN_ANGULAR_BRACE storagetype_name TAO_PSDL_CLOSE_ANGULAR_BRACE
+ { $$ = new TAO_PSDL_Storagetype_Ref_Type ($3); }
+ ;
+
+storagehome_scope : TAO_PSDL_SCOPE storagehome_name
+ { $$ = new TAO_PSDL_Storagehome_Scope ($2); }
+ ;
+
+store_directive : TAO_PSDL_STORES simple_declarator TAO_PSDL_AS psdl_concrete_state_type storagehome_scope
+ { $$ = new TAO_PSDL_Store_Directive ($2, $4, $5); }
+ |
+ TAO_PSDL_STORES simple_declarator TAO_PSDL_AS psdl_concrete_state_type
+ { $$ = new TAO_PSDL_Store_Directive ($2, $4); }
+ ;
+
+psdl_concrete_state_type:
+ storagetype_name
+ { $$ = new TAO_PSDL_Psdl_Concrete_State_Type ($1); }
+ |
+ storagetype_ref_type
+ { $$ = new TAO_PSDL_Psdl_Concrete_State_Type ($1); }
+ ;
+
+ref_rep_directive : TAO_PSDL_REF TAO_PSDL_OPEN_BRACE simple_declarator TAO_PSDL_CLOSE_BRACE
+ { $$ = new TAO_PSDL_Ref_Rep_Directive ($3); }
+ ;
+
+storagehome : storagehome_header TAO_PSDL_OPEN_CURLY_BRACE storagehome_body TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Storagehome ($1, $3); }
+ |
+ storagehome_header TAO_PSDL_OPEN_CURLY_BRACE TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Storagehome ($1); }
+ ;
+
+storagehome_header : TAO_PSDL_STORAGEHOME identifier TAO_PSDL_OF storagetype_name storagehome_inh_spec storagehome_impl_spec
+ { $$ = new TAO_PSDL_Storagehome_Header ($2, $4, $5, $6); }
+ |
+ TAO_PSDL_STORAGEHOME identifier TAO_PSDL_OF storagetype_name storagehome_inh_spec
+ { $$ = new TAO_PSDL_Storagehome_Header ($2, $4, $5); }
+ |
+ TAO_PSDL_STORAGEHOME identifier TAO_PSDL_OF storagetype_name storagehome_impl_spec
+ { $$ = new TAO_PSDL_Storagehome_Header ($2, $4, $5); }
+ |
+ TAO_PSDL_STORAGEHOME identifier TAO_PSDL_OF storagetype_name
+ { $$ = new TAO_PSDL_Storagehome_Header ($2, $4); }
+ ;
+
+storagehome_body : storagehome_member
+ { $$ = new TAO_PSDL_Storagehome_Body ($1); }
+ |
+ storagehome_member storagehome_body
+ { $$ = new TAO_PSDL_Storagehome_Body ($1, $2); }
+ ;
+
+storagehome_member : key_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Storagehome_Member ($1); }
+ |
+ primary_key_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Storagehome_Member ($1); }
+ ;
+
+storagehome_inh_spec : TAO_PSDL_COLON storagehome_name
+ { $$ = new TAO_PSDL_Storagehome_Inh_Spec ($2); }
+ ;
+
+storagehome_name : scoped_name
+ { $$ = new TAO_PSDL_Storagehome_Name ($1); }
+ ;
+
+storagehome_impl_spec : TAO_PSDL_IMPLEMENTS abstract_storagehome_name
+ { $$ = new TAO_PSDL_Storagehome_Impl_Spec ($2); }
+ ;
+
+primary_key_dcl : TAO_PSDL_PRIMARY TAO_PSDL_KEY identifier
+ { $$ = new TAO_PSDL_Primary_Key_Dcl ($3); }
+ |
+ TAO_PSDL_PRIMARY TAO_PSDL_KEY TAO_PSDL_REF
+ { $$ = new TAO_PSDL_Primary_Key_Dcl (); }
+ ;
+
+identifier: TAO_PSDL_IDENT
+ { $$ = $1; }
+ ;
+
+type_dcl : TAO_PSDL_TYPEDEF type_declarator
+ { $$ = new TAO_PSDL_Type_Dcl (TAO_PSDL_TYPEDEF, $2); }
+ |
+ struct_type
+ { $$ = new TAO_PSDL_Type_Dcl ($1); }
+ |
+ union_type
+ { $$ = new TAO_PSDL_Type_Dcl ($1); }
+ |
+ enum_type
+ { $$ = new TAO_PSDL_Type_Dcl ($1); }
+ |
+ TAO_PSDL_NATIVE simple_declarator
+ { $$ = new TAO_PSDL_Type_Dcl (TAO_PSDL_NATIVE, $2); }
+ |
+ constr_forward_decl
+ { $$ = new TAO_PSDL_Type_Dcl ($1); }
+ ;
+
+type_declarator : type_spec declarators
+ { $$ = new TAO_PSDL_Type_Declarator ($1, $2); }
+ ;
+
+type_spec : simple_type_spec
+ { $$ = new TAO_PSDL_Type_Spec ($1); }
+ |
+ constr_type_spec
+ { $$ = new TAO_PSDL_Type_Spec ($1); }
+ ;
+
+simple_type_spec : base_type_spec
+ { $$ = new TAO_PSDL_Simple_Type_Spec ($1); }
+ |
+ template_type_spec
+ { $$ = new TAO_PSDL_Simple_Type_Spec ($1); }
+ |
+ scoped_name
+ { $$ = new TAO_PSDL_Simple_Type_Spec ($1); }
+ ;
+
+base_type_spec : floating_pt_type
+ { $$ = new TAO_PSDL_Base_Type_Spec ($1); }
+ |
+ integer_type
+ { $$ = new TAO_PSDL_Base_Type_Spec ($1); }
+ |
+ char_type
+ { $$ = new TAO_PSDL_Base_Type_Spec ($1); }
+ |
+ wide_char_type
+ { $$ = new TAO_PSDL_Base_Type_Spec ($1); }
+ |
+ boolean_type
+ { $$ = new TAO_PSDL_Base_Type_Spec ($1); }
+ |
+ octet_type
+ { $$ = new TAO_PSDL_Base_Type_Spec ($1); }
+ |
+ any_type
+ { $$ = new TAO_PSDL_Base_Type_Spec ($1); }
+ |
+ object_type
+ { $$ = new TAO_PSDL_Base_Type_Spec ($1); }
+ |
+ value_base_type
+ { $$ = new TAO_PSDL_Base_Type_Spec ($1); }
+ ;
+
+template_type_spec : sequence_type
+ { $$ = new TAO_PSDL_Template_Type_Spec ($1); }
+ |
+ string_type
+ { $$ = new TAO_PSDL_Template_Type_Spec ($1); }
+ |
+ wide_string_type
+ { $$ = new TAO_PSDL_Template_Type_Spec ($1); }
+ |
+ fixed_pt_type
+ { $$ = new TAO_PSDL_Template_Type_Spec ($1); }
+ ;
+
+constr_type_spec : struct_type
+ { $$ = new TAO_PSDL_Constr_Type_Spec ($1); }
+ |
+ union_type
+ { $$ = new TAO_PSDL_Constr_Type_Spec ($1); }
+ |
+ enum_type
+ { $$ = new TAO_PSDL_Constr_Type_Spec ($1); }
+ ;
+
+declarators : declarator
+ { $$ = new TAO_PSDL_Declarators ($1); }
+ |
+ declarator TAO_PSDL_COMMA declarators
+ { $$ = new TAO_PSDL_Declarators ($1, $3); }
+ ;
+
+declarator : simple_declarator
+ { $$ = new TAO_PSDL_Declarator ($1); }
+ |
+ complex_declarator
+ { $$ = new TAO_PSDL_Declarator ($1); }
+ ;
+
+simple_declarator : identifier
+ { $$ = $1; }
+ ;
+
+simple_declarator_list : simple_declarator
+ { $$ = new TAO_PSDL_Simple_Declarator_List ($1); }
+ |
+ simple_declarator_list TAO_PSDL_COMMA simple_declarator
+ { $$ = new TAO_PSDL_Simple_Declarator_List ($1, $3); }
+ ;
+
+complex_declarator : array_declarator
+ { $$ = new TAO_PSDL_Complex_Declarator ($1); }
+ ;
+
+floating_pt_type : TAO_PSDL_FLOAT
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_FLOAT); }
+ |
+ TAO_PSDL_DOUBLE
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_DOUBLE); }
+ |
+ TAO_PSDL_LONG TAO_PSDL_DOUBLE
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_LONG, TAO_PSDL_DOUBLE); }
+ ;
+
+integer_type : signed_int
+ { $$ = $1; }
+ |
+ unsigned_int
+ { $$ = $1; }
+ ;
+
+signed_int : signed_short_int
+ { $$ = $1; }
+ |
+ signed_long_int
+ { $$ = $1; }
+ |
+ signed_longlong_int
+ { $$ = $1; }
+ ;
+
+signed_short_int : TAO_PSDL_SHORT
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_SHORT); }
+ ;
+
+signed_long_int : TAO_PSDL_LONG
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_LONG); }
+ ;
+
+signed_longlong_int : TAO_PSDL_LONG TAO_PSDL_LONG
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_LONG, TAO_PSDL_LONG); }
+ ;
+
+unsigned_int : unsigned_short_int
+ { $$ = new TAO_PSDL_Predefined_Type ($1); }
+ |
+ unsigned_long_int
+ { $$ = new TAO_PSDL_Predefined_Type ($1); }
+ |
+ unsigned_longlong_int
+ { $$ = new TAO_PSDL_Predefined_Type ($1); }
+ ;
+
+unsigned_short_int : TAO_PSDL_UNSIGNED TAO_PSDL_SHORT
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_UNSIGNED, TAO_PSDL_SHORT); }
+ ;
+
+unsigned_long_int : TAO_PSDL_UNSIGNED TAO_PSDL_LONG
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_UNSIGNED, TAO_PSDL_LONG); }
+ ;
+
+unsigned_longlong_int : TAO_PSDL_UNSIGNED TAO_PSDL_LONG TAO_PSDL_LONG
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_UNSIGNED, TAO_PSDL_LONG, TAO_PSDL_LONG); }
+ ;
+
+char_type : TAO_PSDL_CHAR
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_CHAR); }
+ ;
+
+wide_char_type : TAO_PSDL_WCHAR
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_WCHAR); }
+ ;
+
+boolean_type : TAO_PSDL_BOOLEAN
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_BOOLEAN); }
+ ;
+
+octet_type : TAO_PSDL_OCTET
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_OCTET); }
+ ;
+
+any_type : TAO_PSDL_ANY
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_ANY); }
+ ;
+
+object_type : TAO_PSDL_OBJECT
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_OBJECT); }
+ ;
+
+struct_type : TAO_PSDL_STRUCT identifier
+ {
+ int good_struct_name = TAO_PSDL_Scope::instance ()->pop_top_scope ()->add_struct (TAO_PSDL_Scope::instance ()->get_identifier ());
+
+ if (good_struct_name == -1)
+ YYABORT;
+ }
+ TAO_PSDL_OPEN_CURLY_BRACE member_list TAO_PSDL_CLOSE_CURLY_BRACE
+ {
+ TAO_PSDL_Scope::instance ()->set_scope ();
+ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_STRUCT, $2, $5); }
+ ;
+
+member_list : member
+ { $$ = new TAO_PSDL_Member_List ($1); }
+ |
+ member member_list
+ { $$ = new TAO_PSDL_Member_List ($1, $2); }
+ ;
+
+member : type_spec declarators TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Member ($1, $2); }
+ ;
+
+union_type : TAO_PSDL_UNION identifier TAO_PSDL_SWITCH TAO_PSDL_OPEN_BRACE switch_type_spec TAO_PSDL_CLOSE_BRACE TAO_PSDL_OPEN_CURLY_BRACE switch_body TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Predefined_Type ($2, $5, $8); }
+ ;
+
+switch_type_spec : integer_type
+ { $$ = new TAO_PSDL_Switch_Type_Spec ($1); }
+ |
+ char_type
+ { $$ = new TAO_PSDL_Switch_Type_Spec ($1); }
+ |
+ boolean_type
+ { $$ = new TAO_PSDL_Switch_Type_Spec ($1); }
+ |
+ enum_type
+ { $$ = new TAO_PSDL_Switch_Type_Spec ($1); }
+ |
+ scoped_name
+ { $$ = new TAO_PSDL_Switch_Type_Spec ($1); }
+ ;
+
+switch_body : case
+ { $$ = new TAO_PSDL_Switch_Body ($1); }
+ |
+ case switch_body
+ { $$ = new TAO_PSDL_Switch_Body ($1, $2); }
+ ;
+
+case : case_label element_spec TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Case ($1, $2); }
+ ;
+
+case_label : TAO_PSDL_CASE const_exp TAO_PSDL_COLON
+ { $$ = new TAO_PSDL_Case_Label ($1, $2); }
+ |
+ TAO_PSDL_DEFAULT TAO_PSDL_COLON
+ { $$ = new TAO_PSDL_Case_Label ($1); }
+ |
+ TAO_PSDL_CASE const_exp TAO_PSDL_COLON case_label
+ { $$ = new TAO_PSDL_Case_Label ($1, $2, $4); }
+ |
+ TAO_PSDL_DEFAULT TAO_PSDL_COLON case_label
+ { $$ = new TAO_PSDL_Case_Label ($1, $3); }
+ ;
+
+element_spec : type_spec declarator
+ { $$ = new TAO_PSDL_Element_Spec ($1, $2); }
+ ;
+
+const_dcl : TAO_PSDL_CONST const_type identifier TAO_PSDL_EQUAL const_exp
+ { $$ = new TAO_PSDL_Const_Dcl ($2, $3, $5); }
+ ;
+
+const_type : integer_type
+ { $$ = new TAO_PSDL_Predefined_Type($1); }
+ |
+ char_type
+ { $$ = new TAO_PSDL_Predefined_Type($1); }
+ |
+ wide_char_type
+ { $$ = new TAO_PSDL_Predefined_Type($1); }
+ |
+ boolean_type
+ { $$ = new TAO_PSDL_Predefined_Type($1); }
+ |
+ floating_pt_type
+ { $$ = new TAO_PSDL_Predefined_Type($1); }
+ |
+ string_type
+ { $$ = new TAO_PSDL_Predefined_Type($1); }
+ |
+ wide_string_type
+ { $$ = new TAO_PSDL_Predefined_Type($1); }
+ |
+ fixed_pt_const_type
+ { $$ = new TAO_PSDL_Predefined_Type($1); }
+ |
+ scoped_name
+ { $$ = new TAO_PSDL_Predefined_Type($1); }
+ |
+ octet_type
+ { $$ = new TAO_PSDL_Predefined_Type($1); }
+ ;
+
+const_exp : or_expr
+ { $$ = new TAO_PSDL_Const_Exp ($1); }
+ ;
+
+or_expr : xor_expr
+ { $$ = new TAO_PSDL_Or_Expr ($1); }
+ |
+ or_expr TAO_PSDL_OR xor_expr
+ { $$ = new TAO_PSDL_Or_Expr ($1, $3); }
+ ;
+
+xor_expr : and_expr
+ { $$ = new TAO_PSDL_Xor_Expr ($1); }
+ |
+ xor_expr TAO_PSDL_XOR and_expr
+ { $$ = new TAO_PSDL_Xor_Expr ($1, $3); }
+ ;
+
+and_expr : shift_expr
+ { $$ = new TAO_PSDL_And_Expr ($1); }
+ |
+ and_expr TAO_PSDL_AND shift_expr
+ { $$ = new TAO_PSDL_And_Expr ($1, $3); }
+ ;
+
+shift_expr : add_expr
+ { $$ = new TAO_PSDL_Shift_Expr ($1); }
+ |
+ shift_expr TAO_PSDL_RIGHT_SHIFT add_expr
+ { $$ = new TAO_PSDL_Shift_Expr ($1, $2, $3); }
+ |
+ shift_expr TAO_PSDL_LEFT_SHIFT add_expr
+ { $$ = new TAO_PSDL_Shift_Expr ($1, $2, $3); }
+ ;
+
+add_expr : mult_expr
+ { $$ = new TAO_PSDL_Add_Expr ($1); }
+ |
+ add_expr TAO_PSDL_PLUS mult_expr
+ { $$ = new TAO_PSDL_Add_Expr ($1, $2, $3); }
+ |
+ add_expr TAO_PSDL_MINUS mult_expr
+ { $$ = new TAO_PSDL_Add_Expr ($1, $2, $3); }
+ ;
+
+mult_expr : unary_expr
+ { $$ = new TAO_PSDL_Mult_Expr ($1); }
+ |
+ mult_expr TAO_PSDL_MULT unary_expr
+ { $$ = new TAO_PSDL_Mult_Expr ($1, $3); }
+ |
+ mult_expr TAO_PSDL_DIV unary_expr
+ { $$ = new TAO_PSDL_Mult_Expr ($1, $3); }
+ |
+ mult_expr TAO_PSDL_PERCENT unary_expr
+ { $$ = new TAO_PSDL_Mult_Expr ($1, $3); }
+ ;
+
+unary_expr : unary_operator primary_expr
+ { $$ = new TAO_PSDL_Unary_Expr ($1, $2); }
+ |
+ primary_expr
+ { $$ = new TAO_PSDL_Unary_Expr ($1); }
+ ;
+
+unary_operator : TAO_PSDL_MINUS
+ { $$ = $1; }
+ |
+ TAO_PSDL_PLUS
+ { $$ = $1; }
+ |
+ TAO_PSDL_TILDA
+ { $$ = $1; }
+ ;
+
+primary_expr : scoped_name
+ { $$ = new TAO_PSDL_Primary_Expr ($1); }
+ |
+ literal
+ { $$ = new TAO_PSDL_Primary_Expr ($1); }
+ |
+ TAO_PSDL_OPEN_BRACE const_exp TAO_PSDL_CLOSE_BRACE
+ { $$ = new TAO_PSDL_Primary_Expr ($2); }
+ ;
+
+except_header : TAO_PSDL_EXCEPTION identifier
+ {
+ int good_except_name = TAO_PSDL_Scope::instance ()->pop_top_scope ()->add_exception (TAO_PSDL_Scope::instance ()->get_identifier ());
+ if (good_except_name == -1)
+ YYABORT;
+ $$ = $2;
+ }
+ ;
+
+except_dcl : except_header TAO_PSDL_OPEN_CURLY_BRACE member_list TAO_PSDL_CLOSE_CURLY_BRACE
+ {
+ TAO_PSDL_Scope::instance ()->set_scope ();
+ $$ = new TAO_PSDL_Except_Dcl ($1, $3);
+ }
+ |
+ except_header TAO_PSDL_OPEN_CURLY_BRACE TAO_PSDL_CLOSE_CURLY_BRACE
+ {
+ TAO_PSDL_Scope::instance ()->set_scope ();
+ $$ = new TAO_PSDL_Except_Dcl ($1);
+ }
+ ;
+
+op_name : identifier
+ {
+ int good_op_dcl_name = TAO_PSDL_Scope::instance ()->pop_top_scope ()->add_op_dcl (TAO_PSDL_Scope::instance ()->get_identifier ());
+
+ if (good_op_dcl_name == -1)
+ YYABORT;
+
+ $$ = $1;
+ }
+ ;
+
+op_dcl : op_attribute op_type_spec op_name parameter_dcls raises_expr context_expr
+ { TAO_PSDL_Scope::instance ()->set_scope ();
+ $$ = new TAO_PSDL_Op_Dcl ($1, $2, $3, $4, $5, $6); }
+ |
+ op_type_spec op_name parameter_dcls raises_expr context_expr
+ { TAO_PSDL_Scope::instance ()->set_scope ();
+ $$ = new TAO_PSDL_Op_Dcl ($1, $2, $3, $4, $5); }
+ |
+ op_attribute op_type_spec op_name parameter_dcls raises_expr
+ { TAO_PSDL_Scope::instance ()->set_scope ();
+ $$ = new TAO_PSDL_Op_Dcl ($1, $2, $3, $4, $5); }
+ |
+ op_attribute op_type_spec op_name parameter_dcls context_expr
+ { TAO_PSDL_Scope::instance ()->set_scope ();
+ $$ = new TAO_PSDL_Op_Dcl ($1, $2, $3, $4, $5); }
+ |
+ op_type_spec op_name parameter_dcls raises_expr
+ { TAO_PSDL_Scope::instance ()->set_scope ();
+ $$ = new TAO_PSDL_Op_Dcl ($1, $2, $3, $4); }
+ |
+ op_type_spec op_name parameter_dcls context_expr
+ { TAO_PSDL_Scope::instance ()->set_scope ();
+ $$ = new TAO_PSDL_Op_Dcl ($1, $2, $3, $4); }
+ |
+ op_type_spec op_name parameter_dcls
+ { TAO_PSDL_Scope::instance ()->set_scope ();
+ $$ = new TAO_PSDL_Op_Dcl ($1, $2, $3); }
+ ;
+
+op_attribute : TAO_PSDL_ONEWAY
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_ONEWAY); }
+ ;
+
+op_type_spec : param_type_spec
+ { $$ = new TAO_PSDL_Op_Type_Spec ($1); }
+ |
+ TAO_PSDL_VOID
+ { $$ = new TAO_PSDL_Op_Type_Spec (TAO_PSDL_VOID); }
+ ;
+
+parameter_dcls : TAO_PSDL_OPEN_BRACE param_dcl TAO_PSDL_CLOSE_BRACE
+ { $$ = new TAO_PSDL_Parameter_Dcls ($2); }
+ |
+ TAO_PSDL_OPEN_BRACE TAO_PSDL_CLOSE_BRACE
+ { $$ = new TAO_PSDL_Parameter_Dcls (); }
+ ;
+
+param_dcl : param_attribute param_type_spec simple_declarator
+ { $$ = new TAO_PSDL_Param_Dcl ($1, $2, $3); }
+ |
+ param_attribute param_type_spec simple_declarator TAO_PSDL_COMMA param_dcl
+ { $$ = new TAO_PSDL_Param_Dcl ($1, $2, $3, $5); }
+ ;
+
+param_attribute : TAO_PSDL_IN
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_IN); }
+ |
+ TAO_PSDL_OUT
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_OUT); }
+ |
+ TAO_PSDL_INOUT
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_INOUT); }
+ ;
+
+raises_expr : TAO_PSDL_RAISES TAO_PSDL_OPEN_BRACE scoped_name TAO_PSDL_CLOSE_BRACE
+ { $$ = new TAO_PSDL_Raises_Expr ($3); }
+ |
+ TAO_PSDL_RAISES TAO_PSDL_OPEN_BRACE scoped_name TAO_PSDL_COMMA comma_scoped_name TAO_PSDL_CLOSE_BRACE
+ { $$ = new TAO_PSDL_Raises_Expr ($3, $4); }
+ ;
+
+context_expr : TAO_PSDL_CONTEXT TAO_PSDL_OPEN_BRACE string_literal TAO_PSDL_CLOSE_BRACE
+ { $$ = new TAO_PSDL_Context_Expr ($3); }
+ ;
+
+param_type_spec : base_type_spec
+ { $$ = new TAO_PSDL_Param_Type_Spec ($1); }
+ |
+ string_type
+ { $$ = new TAO_PSDL_Param_Type_Spec ($1); }
+ |
+ wide_string_type
+ { $$ = new TAO_PSDL_Param_Type_Spec ($1); }
+ |
+ scoped_name
+ { $$ = new TAO_PSDL_Param_Type_Spec ($1); }
+ ;
+
+fixed_pt_type : TAO_PSDL_FIXED TAO_PSDL_OPEN_ANGULAR_BRACE positive_int_const TAO_PSDL_COMMA positive_int_const TAO_PSDL_CLOSE_ANGULAR_BRACE
+ { $$ = new TAO_PSDL_Predefined_Type ($3, $5); }
+ ;
+
+fixed_pt_const_type : TAO_PSDL_FIXED
+ { $$ = $1; }
+ ;
+
+value_base_type : TAO_PSDL_VALUEBASE
+ { $$ = $1; }
+ ;
+
+constr_forward_decl : TAO_PSDL_STRUCT identifier
+ { $$ = new TAO_PSDL_Constr_Forward_Decl ($1, $2); }
+ |
+ TAO_PSDL_UNION identifier
+ { $$ = new TAO_PSDL_Constr_Forward_Decl ($1, $2); }
+ ;
+
+interface : interface_dcl
+ { $$ = new TAO_PSDL_Interface ($1); }
+ |
+ forward_dcl
+ { $$ = new TAO_PSDL_Interface ($1); }
+ ;
+
+interface_dcl : interface_header TAO_PSDL_OPEN_CURLY_BRACE interface_body TAO_PSDL_CLOSE_CURLY_BRACE
+ {
+ TAO_PSDL_Scope::instance ()->set_interface_scope ();
+ $$ = new TAO_PSDL_Interface_Dcl ($1, $3);
+ }
+ |
+ interface_header TAO_PSDL_OPEN_CURLY_BRACE TAO_PSDL_CLOSE_CURLY_BRACE
+ {
+ TAO_PSDL_Scope::instance ()->set_interface_scope ();
+ $$ = new TAO_PSDL_Interface_Dcl ($1);
+ }
+ ;
+
+forward_dcl : TAO_PSDL_ABSTRACT TAO_PSDL_INTERFACE identifier
+ { $$ = new TAO_PSDL_Forward_Dcl (TAO_PSDL_ABSTRACT, $3); }
+ |
+ TAO_PSDL_LOCAL TAO_PSDL_INTERFACE identifier
+ { $$ = new TAO_PSDL_Forward_Dcl (TAO_PSDL_LOCAL, $3); }
+ |
+ TAO_PSDL_INTERFACE identifier
+ { $$ = new TAO_PSDL_Forward_Dcl ($2); }
+ ;
+
+interface_identifier: TAO_PSDL_INTERFACE identifier
+ {
+ int good_interface_name = TAO_PSDL_Scope::instance ()->pop_top_scope ()->add_interface (TAO_PSDL_Scope::instance ()->get_identifier ());
+ if (good_interface_name == -1)
+ YYABORT;
+
+ $$ = $2;
+ }
+ ;
+
+interface_header : TAO_PSDL_ABSTRACT interface_identifier
+ { $$ = new TAO_PSDL_Interface_Header ($1, $2); }
+ |
+ TAO_PSDL_LOCAL interface_identifier
+ { $$ = new TAO_PSDL_Interface_Header ($1, $2); }
+ |
+ interface_identifier
+ { $$ = new TAO_PSDL_Interface_Header ($1); }
+ |
+ TAO_PSDL_ABSTRACT interface_identifier interface_inheritance_spec
+ { $$ = new TAO_PSDL_Interface_Header ($1, $2, $3); }
+ |
+ TAO_PSDL_LOCAL interface_identifier interface_inheritance_spec
+ { $$ = new TAO_PSDL_Interface_Header ($1, $2, $3); }
+ |
+ interface_identifier interface_inheritance_spec
+ { $$ = new TAO_PSDL_Interface_Header ($2, $1); }
+ ;
+
+interface_body : export
+ { $$ = new TAO_PSDL_Interface_Body ($1); }
+ |
+ export interface_body
+ { $$ = new TAO_PSDL_Interface_Body ($1, $2); }
+ ;
+
+export : type_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Export_Dcl ($1); }
+ |
+ const_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Export_Dcl ($1); }
+ |
+ except_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Export_Dcl ($1); }
+ |
+ attr_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Export_Dcl ($1); }
+ |
+ op_dcl TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Export_Dcl ($1); }
+ ;
+
+interface_inheritance_spec:
+ TAO_PSDL_COLON interface_name
+ { $$ = new TAO_PSDL_Interface_Inheritance_Spec ($2); }
+ ;
+
+interface_name : scoped_name
+ { $$ = new TAO_PSDL_Interface_Name ($1); }
+ |
+ scoped_name TAO_PSDL_COMMA interface_name
+ { $$ = new TAO_PSDL_Interface_Name ($1, $2); }
+ ;
+
+scoped_name : identifier TAO_PSDL_DOUBLE_COLON scoped_name
+ { $$ = new TAO_PSDL_Scoped_Name ($1, $3); }
+ |
+ identifier
+ { $$ = $1; }
+ ;
+
+comma_scoped_name: identifier TAO_PSDL_COMMA comma_scoped_name
+ { $$ = new TAO_PSDL_Scoped_Name ($1, $3); }
+ |
+ identifier
+ { $$ = $1; }
+ ;
+
+value : value_dcl
+ { $$ = new TAO_PSDL_Value ($1); }
+ |
+ value_abs_dcl
+ { $$ = new TAO_PSDL_Value ($1); }
+ |
+ value_box_dcl
+ { $$ = new TAO_PSDL_Value ($1); }
+ |
+ value_forward_dcl
+ { $$ = new TAO_PSDL_Value ($1); }
+ ;
+
+value_common_base: TAO_PSDL_VALUETYPE identifier
+ { $$ = new TAO_PSDL_Value_Common_Base ($2); }
+ ;
+
+value_forward_dcl: TAO_PSDL_ABSTRACT value_common_base
+ { $$ = new TAO_PSDL_Value_Forward_Dcl ($1, $2); }
+ |
+ value_common_base
+ { $$ = new TAO_PSDL_Value_Forward_Dcl ($1); }
+ ;
+
+value_box_dcl : value_common_base type_spec
+ { $$ = new TAO_PSDL_Value_Box_Dcl ($1, $2); }
+ ;
+
+value_abs_dcl : TAO_PSDL_ABSTRACT value_common_base value_inheritance_spec TAO_PSDL_OPEN_CURLY_BRACE export TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Value_Abs_Dcl ($2, $3, $5); }
+ |
+ TAO_PSDL_ABSTRACT value_common_base TAO_PSDL_OPEN_CURLY_BRACE export TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Value_Abs_Dcl ($2, $4); }
+ ;
+
+value_dcl : value_header TAO_PSDL_OPEN_CURLY_BRACE value_element TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Value_Dcl ($1, $3); }
+ ;
+
+value_header : TAO_PSDL_CUSTOM value_common_base value_inheritance_spec
+ { $$ = new TAO_PSDL_Value_Header ($1, $2, $3); }
+ |
+ value_common_base value_inheritance_spec
+ { $$ = new TAO_PSDL_Value_Header ($1, $2); }
+ |
+ TAO_PSDL_CUSTOM value_common_base
+ { $$ = new TAO_PSDL_Value_Header ($1, $2); }
+ ;
+
+value_inheritance_spec : TAO_PSDL_COLON TAO_PSDL_TRUNCATABLE value_name TAO_PSDL_SUPPORTS interface_name
+ { $$ = new TAO_PSDL_Value_Inheritance_Spec ($2, $3, $5); }
+ |
+ TAO_PSDL_COLON value_name TAO_PSDL_SUPPORTS interface_name
+ { $$ = new TAO_PSDL_Value_Inheritance_Spec ($2, $4); }
+ |
+ TAO_PSDL_SUPPORTS interface_name
+ { $$ = new TAO_PSDL_Value_Inheritance_Spec ($2); }
+ |
+ TAO_PSDL_COLON TAO_PSDL_TRUNCATABLE value_name
+ { $$ = new TAO_PSDL_Value_Inheritance_Spec ($2, $3); }
+ |
+ TAO_PSDL_COLON value_name
+ { $$ = new TAO_PSDL_Value_Inheritance_Spec ($2); }
+ ;
+
+
+string_type: TAO_PSDL_STRING TAO_PSDL_OPEN_ANGULAR_BRACE positive_int_const TAO_PSDL_CLOSE_ANGULAR_BRACE
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_STRING, $3); }
+ |
+ TAO_PSDL_STRING
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_STRING); }
+ ;
+
+wide_string_type : TAO_PSDL_WSTRING TAO_PSDL_OPEN_ANGULAR_BRACE positive_int_const TAO_PSDL_CLOSE_ANGULAR_BRACE
+ { $$ = new TAO_PSDL_Predefined_Type ($3); }
+ |
+ TAO_PSDL_WSTRING
+ { $$ = $1; }
+ ;
+
+array_declarator : identifier fixed_array_size
+ { $$ = new TAO_PSDL_Array_Declarator ($1, $2); }
+ ;
+
+fixed_array_size : TAO_PSDL_OPEN_SQUARE_BRACE positive_int_const TAO_PSDL_CLOSE_SQUARE_BRACE
+ { $$ = new TAO_PSDL_Fixed_Array_Size ($2); }
+ ;
+
+attr_dcl : TAO_PSDL_READONLY TAO_PSDL_ATTRIBUTE param_type_spec simple_declarator
+ { $$ = new TAO_PSDL_Attr_Dcl (TAO_PSDL_READONLY, $3, $4); }
+ |
+ TAO_PSDL_ATTRIBUTE param_type_spec simple_declarator
+ { $$ = new TAO_PSDL_Attr_Dcl ($2, $3); }
+ ;
+
+enum_type : TAO_PSDL_ENUM identifier TAO_PSDL_OPEN_CURLY_BRACE enumerator TAO_PSDL_CLOSE_CURLY_BRACE
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_ENUM, $2, $4); }
+ ;
+
+enumerator : identifier
+ { $$ = new TAO_PSDL_Enumerator ($1); }
+ |
+ identifier TAO_PSDL_COMMA enumerator
+ { $$ = new TAO_PSDL_Enumerator ($1, $3); }
+ ;
+
+sequence_type : TAO_PSDL_SEQUENCE TAO_PSDL_OPEN_ANGULAR_BRACE simple_type_spec TAO_PSDL_COMMA positive_int_const TAO_PSDL_CLOSE_ANGULAR_BRACE
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_SEQUENCE, $3, $5); }
+ |
+ TAO_PSDL_SEQUENCE TAO_PSDL_OPEN_ANGULAR_BRACE simple_type_spec TAO_PSDL_CLOSE_ANGULAR_BRACE
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_SEQUENCE, $3); }
+ ;
+
+literal : integer_literal
+ { $$ = $1; }
+ |
+ string_literal
+ { $$ = $1; }
+ |
+ wide_string_literal
+ { $$ = $1; }
+ |
+ character_literal
+ { $$ = $1; }
+ |
+ wide_character_literal
+ { $$ = $1; }
+ |
+ fixed_pt_literal
+ { $$ = $1; }
+ |
+ floating_pt_literal
+ { $$ = $1; }
+ |
+ boolean_literal
+ { $$ = $1; }
+ ;
+
+boolean_literal : TAO_PSDL_TRUE
+ { $$ = $1; }
+ |
+ TAO_PSDL_FALSE
+ { $$ = $1; }
+ ;
+
+integer_literal: TAO_PSDL_INTEGER
+ { $$ = $1; }
+ ;
+
+floating_pt_literal: TAO_PSDL_FLOATING_PT
+ { $$ = $1; }
+ ;
+
+character_literal: TAO_PSDL_CHAR_LITERAL
+ { $$ = $1; }
+ ;
+
+wide_character_literal: TAO_PSDL_WCHAR
+ { $$ = $1; }
+ ;
+
+string_literal: TAO_PSDL_STRING
+ { $$ = $1; }
+ ;
+
+wide_string_literal: TAO_PSDL_WSTRING
+ { $$ = $1; }
+ ;
+
+fixed_pt_literal: TAO_PSDL_FIXED_PT
+ { $$ = $1; }
+ ;
+
+value_name: scoped_name
+ { $$ = new TAO_PSDL_Value_Name ($1); }
+ |
+ scoped_name TAO_PSDL_COMMA value_name
+ { $$ = new TAO_PSDL_Value_Name ($1, $3); }
+ ;
+
+value_element : export
+ { $$ = new TAO_PSDL_Value_Element ($1); }
+ |
+ state_member
+ { $$ = new TAO_PSDL_Value_Element ($1); }
+ |
+ init_dcl
+ { $$ = new TAO_PSDL_Value_Element ($1); }
+ ;
+
+state_member : TAO_PSDL_PUBLIC type_spec declarators TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_State_Member ($1, $2, $3); }
+ |
+ TAO_PSDL_PRIVATE type_spec declarators TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_State_Member ($1, $2, $3); }
+ ;
+
+init_dcl : TAO_PSDL_FACTORY identifier TAO_PSDL_OPEN_BRACE init_param_decls TAO_PSDL_CLOSE_BRACE TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Init_Dcl ($2, $4); }
+ |
+ TAO_PSDL_FACTORY identifier TAO_PSDL_OPEN_BRACE TAO_PSDL_CLOSE_BRACE TAO_PSDL_SEMI
+ { $$ = new TAO_PSDL_Init_Dcl ($2); }
+ ;
+
+init_param_decls: init_param_decl
+ { $$ = new TAO_PSDL_Init_Param_Decls ($1); }
+ |
+ init_param_decl TAO_PSDL_COMMA init_param_decls
+ { $$ = new TAO_PSDL_Init_Param_Decls ($1, $2); }
+ ;
+
+init_param_decl : init_param_attribute param_type_spec simple_declarator
+ { $$ = new TAO_PSDL_Init_Param_Decl ($1, $2, $3); }
+ ;
+
+init_param_attribute : TAO_PSDL_IN
+ { $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_IN); }
+ ;
+
+positive_int_const : const_exp
+ { $$ = new TAO_PSDL_Positive_Int_Const ($1); }
+ ;
+
+factory_dcl : TAO_PSDL_FACTORY identifier factory_parameters
+ { $$ = new TAO_PSDL_Factory_Dcl ($2, $3); }
+ ;
+
+factory_parameters: TAO_PSDL_OPEN_BRACE simple_declarator TAO_PSDL_CLOSE_BRACE
+ { $$ = new TAO_PSDL_Factory_Parameters ($2); }
+ |
+ TAO_PSDL_OPEN_BRACE TAO_PSDL_CLOSE_BRACE
+ { $$ = new TAO_PSDL_Factory_Parameters (); }
+ ;
diff --git a/TAO/orbsvcs/PSS/PSDL_Code_Gen.cpp b/TAO/orbsvcs/PSS/PSDL_Code_Gen.cpp
new file mode 100644
index 00000000000..fe23670c74e
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Code_Gen.cpp
@@ -0,0 +1,170 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Code_Gen.h"
+#include "PSDL_Datastore.h"
+#include "tao/OctetSeqC.h"
+#include "tao/AnyTypeCode/Any.h"
+#include "tao/CodecFactory/CodecFactory.h"
+
+ACE_RCSID (PSS, PSDL_Code_Gen, "$Id$")
+
+TAO_PSDL_Code_Gen::TAO_PSDL_Code_Gen (CORBA::ORB_ptr orb)
+ : file_name_ ("Data_Store"),
+ psdl_datastore_ (),
+ orb_ (orb),
+ codec_ (0)
+{
+ this->set_codec ();
+ ACE_NEW (this->psdl_datastore_,
+ TAO_PSDL_Datastore);
+
+}
+
+TAO_PSDL_Code_Gen::~TAO_PSDL_Code_Gen (void)
+{
+ delete this->psdl_datastore_;
+}
+
+int
+TAO_PSDL_Code_Gen::set_codec (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ // Obtain a reference to the CodecFactory.
+ CORBA::Object_var obj =
+ this->orb_->resolve_initial_references ("CodecFactory"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ IOP::CodecFactory_var codec_factory =
+ IOP::CodecFactory::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Set up a structure that contains information necessary to
+ // create a GIOP 1.1 CDR encapsulation Codec.
+ IOP::Encoding encoding;
+ encoding.format = IOP::ENCODING_CDR_ENCAPS;
+ encoding.major_version = 1;
+ encoding.minor_version = 1;
+
+ // Obtain the CDR encapsulation Codec.
+ this->codec_ =
+ codec_factory->create_codec (encoding ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->codec_.in () == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "codec pointer not set correctly\n"));
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_PSDL_Code_Gen::set_name_obj_ref (const char *name,
+ const char *string_obj_ref
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Invoke the helper encode method which will
+ // convert the stringified object reference to a CORBA::OctetSeq.
+ // Insert the name-CORBA::OCtetSeq pair to a hash_map and save the
+ // hash_map to the database.
+
+ // Encode the stringified object reference to a CORBA::OctetSeq *
+ CORBA::OctetSeq_var octet_seq = this->encode (string_obj_ref
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Insert the new entry to the hash map which contains all the
+ // name-octet_seq entries. And, write the hash_map to a file.
+ int result = this->psdl_datastore_->bind (name,
+ octet_seq.in ());
+
+ if (result == -1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Bind not done successfully \n"));
+ }
+ else if (result == 1)
+ {
+ /*ACE_DEBUG ((LM_DEBUG,
+ "Bind already done.\n"));
+ */
+ return 0;
+ }
+
+ return result;
+}
+
+const char *
+TAO_PSDL_Code_Gen::get_obj_ref (const char *name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Get from the hash_map saved in the database, the corresponding entry
+ // (CORBA::OctetSeq *) for the name. Then, decode the octetseq to
+ // get the stringified object reference and return it.
+
+ CORBA::OctetSeq octet_seq;
+
+ // Find the octet_seq for the name.
+ int result = this->psdl_datastore_->find (name,
+ octet_seq);
+
+ if (result == 0)
+ {
+ // Decode the octet_seq.
+ const char *obj_ref = this->decode (octet_seq
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return CORBA::string_dup (obj_ref);
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "An entry for name %s is not found\n",
+ name));
+ return 0;
+ }
+}
+
+
+CORBA::OctetSeq *
+TAO_PSDL_Code_Gen::encode (const char *string_obj_ref
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any data;
+ data <<= string_obj_ref;
+
+ CORBA::OctetSeq *encoded_data = 0;
+
+ encoded_data = this->codec_->encode (data ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::OctetSeq_var safe_encoded_data = encoded_data;
+
+ return safe_encoded_data._retn ();
+}
+
+const char *
+TAO_PSDL_Code_Gen::decode (const CORBA::OctetSeq &data
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ const char *extracted_value;
+
+ // Extract the data from the octet sequence.
+ CORBA::Any_var decoded_data =
+ this->codec_->decode (data
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ decoded_data.in() >>= extracted_value;
+
+ return CORBA::string_dup (extracted_value);
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Code_Gen.h b/TAO/orbsvcs/PSS/PSDL_Code_Gen.h
new file mode 100644
index 00000000000..60bfb96a508
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Code_Gen.h
@@ -0,0 +1,93 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ==================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Code_Gen
+//
+// = DESCRIPTION
+// This class acts as an interface to the database which is used
+// for the saving the state of the objects. Right now, the database
+// is a normal file.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ==================================================================
+
+#ifndef TAO_PSDL_CODE_GEN_H
+#define TAO_PSDL_CODE_GEN_H
+
+#include /**/ "ace/pre.h"
+
+#include "psdl_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/IOPC.h"
+#include "tao/ORB.h"
+
+class TAO_PSDL_Datastore;
+
+class TAO_PSDL_Export TAO_PSDL_Code_Gen
+{
+ public:
+
+ TAO_PSDL_Code_Gen (CORBA::ORB_ptr orb);
+
+ ~TAO_PSDL_Code_Gen (void);
+
+ /// Initializes a IOP::CodecFactory and IOP::Codec to take care of
+ /// the marshalling and demarshalling of data.
+ int set_codec (void);
+
+ /// Method to save the name-stringified object reference pair
+ /// to the database. Returns -1 on failure.
+ int set_name_obj_ref (const char *name,
+ const char *string_obj_ref
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Get the stringified form of the object reference given the name
+ /// of the object.
+ const char *get_obj_ref (const char *name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ private:
+
+ /// Helper method which serializes the data and saves it to the
+ /// database.
+ CORBA::OctetSeq *encode (const char *string_obj_ref
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+ /// Helper method to get the octet sequence
+ const char *decode (const CORBA::OctetSeq &data
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// File where the persistent data is stored.
+ const char *file_name_;
+
+ /// Pointer to the class which accesses the database
+ TAO_PSDL_Datastore *psdl_datastore_;
+
+ /// Pointer to ORB
+ CORBA::ORB_var orb_;
+
+ /// CDR encapsulation codec useful for encoding and decoding the
+ /// data
+ IOP::Codec_var codec_;
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_CODE_GEN_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Datastore.cpp b/TAO/orbsvcs/PSS/PSDL_Datastore.cpp
new file mode 100644
index 00000000000..0a57e27c9b3
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Datastore.cpp
@@ -0,0 +1,196 @@
+// $Id$
+
+#include "PSDL_Datastore.h"
+#include "PSDL_OctetSeq.h"
+#include "PSDL_String.h"
+#include "ace/SString.h"
+#include "ace/OS_NS_unistd.h"
+
+#include "tao/debug.h"
+#include "tao/OctetSeqC.h"
+
+#include "ace/Auto_Ptr.h"
+
+ACE_RCSID (PSS, PSDL_Datastore, "$Id$")
+
+TAO_PSDL_Datastore::TAO_PSDL_Datastore ()
+ : allocator_ (0),
+ obj_ref_map_ (0),
+ index_file_ ("Data_Store"),
+ base_address_ (ACE_DEFAULT_BASE_ADDR)
+{
+ this->open (this->index_file_,
+ this->base_address_);
+}
+
+TAO_PSDL_Datastore::~TAO_PSDL_Datastore (void)
+{
+ // delete allocator_;
+ // ACE_OS::free (const_cast<ACE_TCHAR *> (this->index_file_));
+}
+
+int
+TAO_PSDL_Datastore::unbind (const char *name)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, -1);
+
+ TAO_PSDL_String psdl_string (this->allocator_);
+
+ psdl_string = name;
+
+ if (this->obj_ref_map_->unbind (psdl_string, this->allocator_) != 0)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Datastore::bind (const char *name,
+ const CORBA::OctetSeq &octet_seq)
+{
+ int result = -1;
+
+ TAO_PSDL_OctetSeq psdl_octet_seq (this->allocator_);
+
+ psdl_octet_seq = octet_seq;
+
+ TAO_PSDL_String psdl_string (this->allocator_);
+
+ psdl_string = name;
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, -1);
+
+ // Do a normal bind. This will fail if there's already an
+ // entry with the same name
+ result = this->obj_ref_map_->bind (psdl_string,
+ psdl_octet_seq,
+ this->allocator_);
+
+ // if (result == 1): Entry already exists.
+ // if (result == -1): Bind failed.
+ // if (result == 0) success.
+ return result;
+}
+
+int
+TAO_PSDL_Datastore::find (const char *name,
+ CORBA::OctetSeq &octet_seq)
+{
+ TAO_PSDL_OctetSeq psdl_seq;
+
+ TAO_PSDL_String psdl_string (this->allocator_);
+
+ psdl_string = CORBA::string_dup (name);
+
+ int result = this->obj_ref_map_->find (psdl_string,
+ psdl_seq,
+ this->allocator_);
+
+ if (result == 0)
+ {
+ octet_seq.replace (psdl_seq.length_,
+ psdl_seq.length_,
+ psdl_seq.buffer_);
+ }
+ else
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "Couldnt find the entry in the Database. stopping",
+ -1));
+ }
+
+ return result;
+}
+
+ACE_Allocator*
+TAO_PSDL_Datastore::allocator (void)
+{
+ return allocator_;
+}
+
+int
+TAO_PSDL_Datastore::open (const ACE_TCHAR *file_name,
+ void *base_address)
+{
+ this->base_address_ = base_address;
+
+ this->index_file_ = ACE_OS::strdup (file_name);
+ if (this->index_file_ == 0)
+ return -1;
+
+ return create_index ();
+}
+
+int
+TAO_PSDL_Datastore::create_index (void)
+{
+ // Make sure that the file name is of the legal length.
+ if (ACE_OS::strlen (this->index_file_) >= MAXNAMELEN + MAXPATHLEN)
+ {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
+
+#if !defined (CHORUS)
+ ACE_MMAP_Memory_Pool::OPTIONS options (this->base_address_);
+#else
+ // Use base address == 0, don't use a fixed address.
+ ACE_MMAP_Memory_Pool::OPTIONS options (0,
+ 0,
+ 0,
+ ACE_CHORUS_LOCAL_NAME_SPACE_T_SIZE);
+#endif /* CHORUS */
+
+ // Create the allocator with the appropriate options. The name used
+ // for the lock is the same as one used for the file.
+ ACE_NEW_RETURN (this->allocator_,
+ ALLOCATOR (this->index_file_,
+ this->index_file_,
+ &options),
+ -1);
+
+#if !defined (ACE_LACKS_ACCESS)
+ // Now check if the backing store has been created successfully.
+ if (ACE_OS::access (this->index_file_, F_OK) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "create_index\n"),
+ -1);
+#endif /* ACE_LACKS_ACCESS */
+
+ void *name_obj_map = 0;
+
+ // This is the easy case since if we find hash table in the
+ // memory-mapped file we know it's already initialized.
+ if (this->allocator_->find (TAO_PERSISTENT_NAME_OBJ_MAP, name_obj_map) == 0)
+ {
+ this->obj_ref_map_ = static_cast<NAME_OBJ_REF_MAP *> (name_obj_map);
+ }
+ else
+ {
+ // Create a new <name_obj_map_> (because we've just created a new
+ // memory-mapped file).
+
+ size_t index_size = sizeof (NAME_OBJ_REF_MAP);
+ name_obj_map = this->allocator_->malloc (index_size);
+
+ if (name_obj_map == 0
+ || create_index_helper (name_obj_map) == -1
+ || this->allocator_->bind (TAO_PERSISTENT_NAME_OBJ_MAP,
+ name_obj_map) == -1)
+ {
+ // Attempt to clean up.
+ ACE_ERROR ((LM_ERROR,
+ "create_index\n"));
+ this->allocator_->remove ();
+ return -1;
+ }
+ }
+ return 0;
+}
+
+int
+TAO_PSDL_Datastore::create_index_helper (void *buffer)
+{
+ this->obj_ref_map_ = new(buffer) NAME_OBJ_REF_MAP(this->allocator_) ;
+ return 0;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Datastore.h b/TAO/orbsvcs/PSS/PSDL_Datastore.h
new file mode 100644
index 00000000000..c08e9afecf4
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Datastore.h
@@ -0,0 +1,135 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file PSDL_Datastore.h
+ *
+ * $Id$
+ *
+ * @author Priyanka Gontla <gontla_p@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PSDL_DATASTORE_H
+#define TAO_PSDL_DATASTORE_H
+#include /**/ "ace/pre.h"
+
+#include "PSDL_Code_Gen.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+// The name under which the index of naming contexts is stored in
+// persistent naming service.
+#if !defined (TAO_PERSISTENT_NAME_OBJ_MAP)
+# define TAO_PERSISTENT_NAME_OBJ_MAP "Persistent_Name_Obj_Map"
+#endif /* ! TAO_PERSISTENT_NAME_OBJ_MAP */
+
+#include "ace/Malloc.h"
+#include "ace/Hash_Map_With_Allocator_T.h"
+
+/**
+ * @class TAO_PSDL_Datastore
+ *
+ * @brief This class facilitates implementation of Persistent
+ * Service. Helps perform the bind and find to the hash_map
+ **/
+
+// Forward declarations.
+class TAO_PSDL_OctetSeq;
+class TAO_PSDL_String;
+
+class TAO_PSDL_Export TAO_PSDL_Datastore
+{
+public:
+ // = Some typedefs for convenience.
+
+ /// Hash map used by Persistent Naming Context to keep its state.
+ typedef ACE_Hash_Map_With_Allocator<TAO_PSDL_String, TAO_PSDL_OctetSeq> NAME_OBJ_REF_MAP;
+
+ typedef ACE_Hash_Map_Entry <TAO_PSDL_String, TAO_PSDL_OctetSeq> NAME_OBJ_REF_ENTRY;
+
+ /// Allocator we will be using to make the Naming Service persistent.
+ typedef ACE_Allocator_Adapter <ACE_Malloc <ACE_MMAP_MEMORY_POOL, TAO_SYNCH_MUTEX>
+ > ALLOCATOR;
+
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_PSDL_Datastore ();
+
+ /**
+ * Create ACE_Allocator, open/create memory-mapped file with the
+ * specified file name/base address. Find or allocate <index_>.
+ * Return 0 on success or -1 on failure.
+ */
+ int open (const ACE_TCHAR *file_name,
+ void * base_address = ACE_DEFAULT_BASE_ADDR);
+
+ /**
+ * If <index_> contains no entries (i.e., was just created), create
+ * a root Persistent servant with table of size
+ * <context_size>, and make an entry for it
+ * in the <index_>. If <index_> contains entries, create a
+ * Persistent servant for each entry. Return 0 on
+ * success and -1 on failure.
+ */
+ int init (size_t context_size);
+
+ /**
+ * Destructor. The memory mapped file that was opened/created is
+ * not deleted, since we want it to keep the state of the Database
+ * until the next run.
+ */
+ ~TAO_PSDL_Datastore (void);
+
+ // = Accessors.
+ int bind (const char *name,
+ const CORBA::OctetSeq &octetseq);
+
+ int unbind (const char *name);
+
+ int find (const char *name,
+ CORBA::OctetSeq &octet_seq);
+
+ /// Return allocator.
+ ACE_Allocator *allocator (void);
+
+private:
+
+ /// Helper for the <init> method. Iterates over <index_>, and
+ /// creates a servant for each entry.
+ int recreate_all (void);
+
+ /// Helper for the <open> method.
+ int create_index (void);
+
+ /// Helper for <create_index> method: places hash table into an
+ /// allocated space.
+ int create_index_helper (void *buffer);
+
+ /// Lock to prevent multiple threads from modifying entries in the
+ /// <index_> simultanneously.
+ TAO_SYNCH_MUTEX lock_;
+
+ /**
+ * Allocator that deals out memory from a memory-mapped file. We
+ * use it whenever we
+ * deal with data that should be kept in persistent store.
+ */
+ ALLOCATOR *allocator_;
+
+ /// Hash map where we keep entries for all Persistent entries
+ NAME_OBJ_REF_MAP *obj_ref_map_;
+
+ /// Name of the memory-mapped file used by <allocator_>.
+ const ACE_TCHAR *index_file_;
+
+ /// Base address for the memory-mapped file.
+ void *base_address_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_PSDL_DATASTORE_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Enum_Type_Visitor.cpp b/TAO/orbsvcs/PSS/PSDL_Enum_Type_Visitor.cpp
new file mode 100644
index 00000000000..865af26a348
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Enum_Type_Visitor.cpp
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Enum_Type_Visitor.h"
+#include "PSDL_Stream.h"
+
+ACE_RCSID (PSS, PSDL_Enum_Type_Visitor, "$Id$")
+
+TAO_PSDL_Enum_Type_Visitor::TAO_PSDL_Enum_Type_Visitor (void)
+{
+}
+
+TAO_PSDL_Enum_Type_Visitor::~TAO_PSDL_Enum_Type_Visitor (void)
+{
+}
+
+int
+TAO_PSDL_Enum_Type_Visitor::visit_identifier (TAO_PSDL_Identifier *identifier)
+{
+ // Save the identifiers for future use.
+ this->identifiers_.size (this->count_ + 1);
+
+ this->identifiers_ [this->count_] = identifier->value ();
+
+ ++this->count_;
+ return 0;
+}
+
+int
+TAO_PSDL_Enum_Type_Visitor::visit_enumerator (TAO_PSDL_Enumerator *enumerator)
+{
+ // Gets the enum name and saves it in the global array of
+ // identifiers.
+ if (enumerator->identifier ()->accept (this) == -1)
+ return -1;
+
+ // Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ *ps_sh<< " " << this->identifiers_ [this->count_ - 1]
+ << ";\n";
+
+ // Get the enum members and save them.
+ if (enumerator->enumerator () != 0)
+ if (enumerator->enumerator ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Enum_Type_Visitor::visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type)
+{
+ if (predefined_type->type_of_variable_one () != 0)
+ {
+ if (predefined_type->type_of_variable_one ()->accept (this) == -1)
+ return -1;
+ }
+
+ ACE_CString enum_type_name = this->identifiers_ [this->count_ - 1];
+
+ // Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ *ps_sh<< "enum " << enum_type_name.c_str () << "\n";
+ *ps_sh<< "{\n";
+
+ if (predefined_type->type_of_variable_two () != 0)
+ {
+ if (predefined_type->type_of_variable_two ()->accept (this) == -1)
+ return -1;
+ }
+
+ *ps_sh<< "};\n";
+
+ // Print the code that should go into the generated header file.
+ // @@ Update this method to get the code that should go to
+ // implementation method (as applies).
+ this->print_class_for_enum_type (enum_type_name);
+
+ return 0;
+}
+
+void
+TAO_PSDL_Enum_Type_Visitor::print_class_for_enum_type (ACE_CString enum_type_name)
+{
+// Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ ps_sh->nl ();
+
+ *ps_sh << "typedef " << enum_type_name << " &"
+ << enum_type_name << "_out;\n";
+
+ *ps_sh<< "TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr "
+ << "_tc_" << enum_type_name << ";\n";
+
+ ps_sh->nl ();
+
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Enum_Type_Visitor.h b/TAO/orbsvcs/PSS/PSDL_Enum_Type_Visitor.h
new file mode 100644
index 00000000000..22d0d2472c3
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Enum_Type_Visitor.h
@@ -0,0 +1,55 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Enum_Type_Visitor.h
+//
+// = DESCRIPTION
+// This class, as the name suggests, is for the generated code for
+// the enum types.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_ENUM_TYPE_VISITOR_H
+#define TAO_PSDL_ENUM_TYPE_VISITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "PSDL_Node_Visitor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_PSDL_Enum_Type_Visitor : public TAO_PSDL_Node_Visitor
+{
+ public:
+
+ TAO_PSDL_Enum_Type_Visitor ();
+
+ ~TAO_PSDL_Enum_Type_Visitor ();
+
+ // Override the necessary methods for the enum types.
+ int visit_identifier (TAO_PSDL_Identifier *identifier);
+
+ int visit_enumerator (TAO_PSDL_Enumerator *enumerator);
+
+ int visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type);
+
+ private:
+
+ void print_class_for_enum_type (ACE_CString enum_type_name);
+
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_ENUM_TYPE_VISITOR_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Exception_Scope.cpp b/TAO/orbsvcs/PSS/PSDL_Exception_Scope.cpp
new file mode 100644
index 00000000000..6771165044f
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Exception_Scope.cpp
@@ -0,0 +1,121 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Exception_Scope.h"
+
+
+ACE_RCSID (PSS, PSDL_Exception_Scope, "$Id$")
+
+TAO_PSDL_Exception_Scope::TAO_PSDL_Exception_Scope (TAO_PSDL_Scope *parent_scope)
+ : scope_map_ (),
+ parent_scope_ (parent_scope)
+{
+ // Constructor.
+}
+
+int
+TAO_PSDL_Exception_Scope::add_member_decl (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ // Add member declarations to this scope.
+ return TAO_PSDL_Scope::instance ()->add_member_decl_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+void
+TAO_PSDL_Exception_Scope::dump (CORBA::ULong depth)
+{
+ depth = depth + 5;
+
+ for (Scope_Map_Iterator i = this->scope_map_.begin ();
+ i != this->scope_map_.end ();
+ ++i)
+ {
+ this->print_depth (depth);
+ ACE_DEBUG ((LM_DEBUG,
+ "%s (%s)\n",
+ (*i).ext_id_.c_str (), (*i).int_id_));
+ }
+}
+
+int
+TAO_PSDL_Exception_Scope::find (const ACE_CString &identifier_name,
+ ACE_CString &identifier_type)
+{
+ for (Scope_Map_Iterator i = this->scope_map_.begin ();
+ i != this->scope_map_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ identifier_type = (*i).int_id_->identifier_type ();
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->find (identifier_name,
+ identifier_type) == 0)
+ {
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+int
+TAO_PSDL_Exception_Scope::find (const ACE_CString &identifier_name)
+{
+ for (Scope_Map_Iterator i = this->scope_map_.begin ();
+ i != this->scope_map_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->find (identifier_name) == 0)
+ {
+ // #@@@@ deal
+ // identifier_type = identifier_info->type;
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+TAO_PSDL_Scope *
+TAO_PSDL_Exception_Scope::parent_scope (void)
+{
+ return this->parent_scope_;
+}
+
+Scope_Map *
+TAO_PSDL_Exception_Scope::scope_map (void)
+{
+ return &this->scope_map_;
+}
+
+ACE_CString
+TAO_PSDL_Exception_Scope::identifier_type (void)
+{
+ return this->identifier_type_;
+}
+
+ACE_CString
+TAO_PSDL_Exception_Scope::module_name (void)
+{
+ return this->module_name_;
+}
+
+ACE_CString
+TAO_PSDL_Exception_Scope::interface_name (void)
+{
+ return this->interface_name_;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Exception_Scope.h b/TAO/orbsvcs/PSS/PSDL_Exception_Scope.h
new file mode 100644
index 00000000000..979f21fbc43
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Exception_Scope.h
@@ -0,0 +1,71 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Exception_Scope
+//
+// = DESCRIPTION
+// Scope class for the Exception type helpful for building the AST.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_EXCEPTION_SCOPE_H
+#define TAO_PSDL_EXCEPTION_SCOPE_H
+
+#include /**/ "ace/pre.h"
+
+#include "PSDL_Scope.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_PSDL_Export TAO_PSDL_Exception_Scope : public TAO_PSDL_Scope
+{
+ public:
+
+ TAO_PSDL_Exception_Scope (TAO_PSDL_Scope *parent_scope);
+
+ // Add member declaration to the exception's scope. Didnt override
+ // any other add method since exceptions have only member
+ // declarations with in them.
+ int add_member_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ // See the PSDL_Scope.h for description.
+ void dump (CORBA::ULong depth);
+
+ int find (const ACE_CString &identifier_name,
+ ACE_CString &identifier_type);
+
+ int find (const ACE_CString &identifier_name);
+
+ TAO_PSDL_Scope *parent_scope (void);
+
+ Scope_Map *scope_map (void);
+
+ ACE_CString identifier_type (void);
+ ACE_CString module_name (void);
+ ACE_CString interface_name (void);
+
+protected:
+
+ Scope_Map scope_map_;
+ TAO_PSDL_Scope *parent_scope_;
+ ACE_CString identifier_type_;
+ ACE_CString module_name_;
+ ACE_CString interface_name_;
+
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_MODULE_SCOPE_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Exception_Visitor.cpp b/TAO/orbsvcs/PSS/PSDL_Exception_Visitor.cpp
new file mode 100644
index 00000000000..b9644240c23
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Exception_Visitor.cpp
@@ -0,0 +1,221 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Exception_Visitor.h"
+#include "PSDL_Stream.h"
+
+ACE_RCSID (PSS, PSDL_Exception_Visitor, "$Id$")
+
+TAO_PSDL_Exception_Visitor::TAO_PSDL_Exception_Visitor (void)
+ : exception_name_ ()
+{
+ // Constructor
+}
+
+TAO_PSDL_Exception_Visitor::~TAO_PSDL_Exception_Visitor (void)
+{
+ // Destructor
+}
+
+int
+TAO_PSDL_Exception_Visitor::visit_identifier (TAO_PSDL_Identifier *identifier)
+{
+ // Save the identifiers for future use.
+ this->identifiers_.size (this->count_ +1);
+
+ this->identifiers_ [this->count_] = identifier->value ();
+
+ // Increment the count..for future purposes.
+ ++this->count_;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Exception_Visitor::visit_except_dcl (TAO_PSDL_Except_Dcl *except_dcl)
+{
+ // This is where the control first comes to this class. Set the
+ // initial size of this->identifiers_
+ this->identifiers_.size (1);
+
+ if (except_dcl->identifier ()->accept (this) == -1)
+ return -1;
+
+ // Save the exception name.
+ this->exception_name_ = this->identifiers_ [this->count_ - 1];
+
+ if (except_dcl->member_list () != 0)
+ if (except_dcl->member_list ()->accept (this) == -1)
+ return -1;
+
+ // Print the code that should go into the generated header file.
+ // @@ Update this method to get the code that should go to
+ // implementation method (as applies).
+ this->print_class_for_exception ();
+
+ return 0;
+}
+
+int
+TAO_PSDL_Exception_Visitor::visit_member_list (TAO_PSDL_Member_List *member_list)
+{
+ if (member_list->member ()->accept (this) == -1)
+ return -1;
+
+ if (member_list->member_list () != 0)
+ {
+ if (member_list->member_list ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_PSDL_Exception_Visitor::visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type)
+{
+ if (predefined_type->type_one () != 0)
+ {
+ this->identifiers_.size (this->count_ +1);
+
+ // Save the type of the identifier.
+ this->identifiers_ [this->count_] =
+ TAO_PSDL_Scope::instance ()->convert_str (predefined_type->type_one ());
+ ++this->count_;
+ }
+ return 0;
+}
+
+void
+TAO_PSDL_Exception_Visitor::print_class_for_exception (void)
+{
+ // Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ // Code that should be generated to the stub (idlC.h) according to
+ // the specification.
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ ACE_CString name_space =
+ TAO_PSDL_Scope::instance ()->get_name_space ();
+
+ ACE_CString interface_name =
+ TAO_PSDL_Scope::instance ()->get_interface_name ();
+
+ *ps_sh << "#if !defined (_" << name_space << "_"
+ << interface_name << "_" << this->exception_name_ << "_CH_)\n";
+ *ps_sh << "#define _" << name_space << "_" << interface_name
+ << "_" << this->exception_name_ << "_CH_\n";
+ ps_sh->nl ();
+ *ps_sh << " class " << this->exception_name_
+ << " : public CORBA::UserException\n";
+ *ps_sh << " {\n";
+
+ *ps_sh << " public:\n";
+
+ ACE_CString type;
+ for (unsigned int i = 1; i < this->count_; ++i)
+ {
+ if (this->base_type (this->identifiers_[i], type))
+ {
+ if (ACE_OS::strcmp (type.c_str (), "char *") == 0)
+ {
+ *ps_sh << " " << "TAO::String_Manager"
+ << " " << this->identifiers_[i+1]
+ << ";\n";
+ }
+ else
+ {
+ *ps_sh << " " << this->version_for_stub (type)
+ << " " << this->identifiers_[i+1]
+ << ";\n";
+ }
+ }
+ else
+ {
+ // Types defined previously in the idl.
+ *ps_sh << " ACE_NESTED_CLASS ("
+ //@@@deal << base_node_info.module_name << "::"
+ //@@@deal << base_node_info.interface_name
+ << ", " << this->identifiers_[i]
+ << ") " << this->identifiers_[i+1]
+ << ";\n";
+ }
+ ++i;
+ }
+
+ *ps_sh << " " << this->exception_name_
+ << " (void);\n";
+ *ps_sh << " " << this->exception_name_
+ << " (const " << this->exception_name_ << " &);\n";
+ *ps_sh << " ~" << this->exception_name_ << " (void);\n";
+ *ps_sh << "\n";
+ *ps_sh << " " << this->exception_name_
+ << " &operator= (const " << this->exception_name_ << " &);\n";
+ *ps_sh << "\n";
+ *ps_sh << " static void _tao_any_destructor (void*);\n";
+ *ps_sh << "\n";
+ *ps_sh << " static " << this->exception_name_
+ << " *_downcast (CORBA::Exception *);\n";
+ *ps_sh << " static CORBA::Exception *_alloc (void);\n";
+ *ps_sh << "\n";
+ *ps_sh << " virtual CORBA::Exception *_tao_duplicate (void) const;\n";
+ *ps_sh << "\n";
+ *ps_sh << " virtual void _raise (void);\n";
+ *ps_sh << "\n";
+ *ps_sh << " virtual void _tao_encode (\n";
+ *ps_sh << " TAO_OutputCDR &\n";
+ *ps_sh << " ACE_ENV_ARG_DECL_NOT_USED\n";
+ *ps_sh << " ) const;\n";
+ *ps_sh << " \n";
+ *ps_sh << " virtual void _tao_decode (\n";
+ *ps_sh << " TAO_InputCDR &\n";
+ *ps_sh << " ACE_ENV_ARG_DECL_NOT_USED\n";
+ *ps_sh << " );\n";
+ *ps_sh << " \n";
+
+ if (this->identifiers_.size () > 1)
+ {
+ *ps_sh << " " << this->exception_name_ << " (\n";
+
+ for (unsigned int i = 1; i < this->count_; ++i)
+ {
+ if (this->base_type (this->identifiers_[i], type))
+ {
+ if (ACE_OS::strcmp (type.c_str (), "char *") == 0)
+ {
+ *ps_sh << " " << "const char *"
+ << " " << this->identifiers_[i+1]
+ << ";\n";
+ }
+ else
+ {
+ *ps_sh << " " << this->version_for_stub (type)
+ << " " << this->identifiers_[i+1]
+ << ";\n";
+ }
+ }
+ else
+ {
+ // Types defined previously in the idl.
+ *ps_sh << " ACE_NESTED_CLASS ("
+ << name_space << "::" << interface_name
+ << ", " << this->identifiers_[i]
+ << ") " << this->identifiers_[i+1]
+ << ";\n";
+ }
+ ++i;
+ }
+ }
+
+ *ps_sh << " \n";
+ *ps_sh << " virtual CORBA::TypeCode_ptr _type (void) const;\n";
+ *ps_sh << " };\n";
+ *ps_sh << "\n";
+ *ps_sh << "static ::CORBA::TypeCode_ptr _tc_"
+ << this->exception_name_ << ";\n";
+ *ps_sh << " \n";
+ *ps_sh << " \n";
+ *ps_sh << "#endif /* end #if !defined */\n";
+ *ps_sh << " \n";
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Exception_Visitor.h b/TAO/orbsvcs/PSS/PSDL_Exception_Visitor.h
new file mode 100644
index 00000000000..f6115d55e55
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Exception_Visitor.h
@@ -0,0 +1,56 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Exception_Visitor.h
+//
+// = DESCRIPTION
+// Visitor class for the generated code for exceptions.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_EXCEPTION_VISITOR_H
+#define TAO_PSDL_EXCEPTION_VISITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "PSDL_Node_Visitor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_PSDL_Exception_Visitor : public TAO_PSDL_Node_Visitor
+{
+ public:
+
+ TAO_PSDL_Exception_Visitor ();
+
+ ~TAO_PSDL_Exception_Visitor ();
+
+ // Override the necessary methods for the exceptions.
+ int visit_identifier (TAO_PSDL_Identifier *identifier);
+
+ int visit_except_dcl (TAO_PSDL_Except_Dcl *except_dcl);
+
+ int visit_member_list (TAO_PSDL_Member_List *member_list);
+
+ int visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type);
+
+ private:
+
+ void print_class_for_exception (void);
+ ACE_CString exception_name_;
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_EXCEPTION_VISITOR_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Extern.cpp b/TAO/orbsvcs/PSS/PSDL_Extern.cpp
new file mode 100644
index 00000000000..b13196cbaef
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Extern.cpp
@@ -0,0 +1,31 @@
+// $Id$
+
+#include "PSDL_Extern.h"
+#include "PSDL_Node.h"
+
+extern int TAO_PSDL_yyparse (void *);
+extern FILE *TAO_PSDL_yyin;
+extern TAO_PSDL_Node *yyval;
+
+TAO_PSDL_Extern::TAO_PSDL_Extern (void)
+{
+ // Constructor
+}
+
+int
+TAO_PSDL_Extern::TAO_PSDL_Extern_yyparse (void *result)
+{
+ return TAO_PSDL_yyparse (result);
+}
+
+void
+TAO_PSDL_Extern::TAO_PSDL_Extern_yyin (FILE *fp)
+{
+ TAO_PSDL_yyin = fp;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Extern::TAO_PSDL_Extern_yyval (void)
+{
+ return yyval;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Extern.h b/TAO/orbsvcs/PSS/PSDL_Extern.h
new file mode 100644
index 00000000000..9ee62e240d0
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Extern.h
@@ -0,0 +1,50 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ==================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Extern
+//
+// = DESCRIPTION
+// Wrapper to make available yacc/lex related parameters outside
+// the PSDL library.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ==================================================================
+
+#ifndef TAO_PSDL_EXTERN_H
+#define TAO_PSDL_EXTERN_H
+#include /**/ "ace/pre.h"
+
+#include "psdl_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/FILE.h"
+
+//Forward declaration
+class TAO_PSDL_Node;
+
+class TAO_PSDL_Export TAO_PSDL_Extern
+{
+public:
+
+ TAO_PSDL_Extern (void);
+
+ int TAO_PSDL_Extern_yyparse (void *);
+
+ void TAO_PSDL_Extern_yyin (FILE *);
+
+ TAO_PSDL_Node *TAO_PSDL_Extern_yyval (void);
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_PSDL_EXTERN_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Interface_Scope.cpp b/TAO/orbsvcs/PSS/PSDL_Interface_Scope.cpp
new file mode 100644
index 00000000000..a0015737d6f
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Interface_Scope.cpp
@@ -0,0 +1,224 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Module_Scope.h"
+#include "PSDL_Interface_Scope.h"
+
+ACE_RCSID (PSS, PSDL_Interface_Scope, "$Id$")
+
+TAO_PSDL_Interface_Scope::TAO_PSDL_Interface_Scope (TAO_PSDL_Scope *parent_scope)
+ : interface_scope_ (),
+ parent_scope_ (parent_scope)
+{
+ // Constructor
+}
+
+TAO_PSDL_Interface_Scope::~TAO_PSDL_Interface_Scope (void)
+{
+ // destructor
+}
+
+int
+TAO_PSDL_Interface_Scope::add_interface (ACE_CString interface_name)
+{
+ return TAO_PSDL_Scope::instance ()->add_interface_to_scope (interface_name,
+ this);
+}
+
+int
+TAO_PSDL_Interface_Scope::add_struct (ACE_CString struct_name)
+{
+ return TAO_PSDL_Scope::instance ()->add_struct_to_scope (struct_name,
+ this);
+}
+
+int
+TAO_PSDL_Interface_Scope::add_typedef (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_typedef_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Interface_Scope::add_const_decl (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_const_decl_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Interface_Scope::add_except_decl (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_except_decl_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Interface_Scope::add_exception (ACE_CString identifier)
+{
+ return TAO_PSDL_Scope::instance ()->add_exception_to_scope (identifier,
+ this);
+}
+
+int
+TAO_PSDL_Interface_Scope::add_op_dcl (ACE_CString identifier)
+{
+ return TAO_PSDL_Scope::instance ()->add_op_dcl_to_scope (identifier,
+ this);
+}
+
+void
+TAO_PSDL_Interface_Scope::dump (CORBA::ULong depth)
+{
+ depth = depth + 5;
+
+ for (Scope_Map_Iterator i = this->interface_scope_.begin ();
+ i != this->interface_scope_.end ();
+ ++i)
+ {
+ this->print_depth (depth);
+ ACE_DEBUG ((LM_DEBUG,
+ "%s (interface/exception/struct)\n",
+ (*i).ext_id_.c_str ()));
+ (*i).int_id_->dump (depth);
+ }
+}
+
+int
+TAO_PSDL_Interface_Scope::find (const ACE_CString &identifier_name,
+ ACE_CString &identifier_type)
+{
+ for (Scope_Map_Iterator i = this->interface_scope_.begin ();
+ i != this->interface_scope_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ identifier_type = (*i).int_id_->identifier_type ();
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->find (identifier_name,
+ identifier_type) == 0)
+ {
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+int
+TAO_PSDL_Interface_Scope::find (const ACE_CString &identifier_name)
+{
+ for (Scope_Map_Iterator i = this->interface_scope_.begin ();
+ i != this->interface_scope_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->find (identifier_name) == 0)
+ {
+ // #@@@@ deal
+ // identifier_type = identifier_info->type;
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+int
+TAO_PSDL_Interface_Scope::get_module_name (const ACE_CString &identifier_name,
+ ACE_CString &module_name)
+{
+ for (Scope_Map_Iterator i = this->interface_scope_.begin ();
+ i != this->interface_scope_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ module_name = (*i).int_id_->module_name ();
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->get_module_name (identifier_name,
+ module_name) == 0)
+ {
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+int
+TAO_PSDL_Interface_Scope::get_interface_name (const ACE_CString &identifier_name,
+ ACE_CString &interface_name)
+{
+ for (Scope_Map_Iterator i = this->interface_scope_.begin ();
+ i != this->interface_scope_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ interface_name = (*i).int_id_->interface_name ();
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->get_interface_name (identifier_name,
+ interface_name) == 0)
+ {
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+TAO_PSDL_Scope *
+TAO_PSDL_Interface_Scope::parent_scope (void)
+{
+ return this->parent_scope_;
+}
+
+Scope_Map *
+TAO_PSDL_Interface_Scope::scope_map (void)
+{
+ return &this->interface_scope_;
+}
+
+ACE_CString
+TAO_PSDL_Interface_Scope::identifier_type (void)
+{
+ return this->identifier_type_;
+}
+
+ACE_CString
+TAO_PSDL_Interface_Scope::module_name (void)
+{
+ return this->module_name_;
+}
+
+ACE_CString
+TAO_PSDL_Interface_Scope::interface_name (void)
+{
+ return this->interface_name_;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Interface_Scope.h b/TAO/orbsvcs/PSS/PSDL_Interface_Scope.h
new file mode 100644
index 00000000000..3f28e08a3a3
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Interface_Scope.h
@@ -0,0 +1,95 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Interface_Scope
+//
+// = DESCRIPTION
+// Scope class for Interfaces helpful for building the ASTs.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_INTERFACE_SCOPE_H
+#define TAO_PSDL_INTERFACE_SCOPE_H
+
+#include /**/ "ace/pre.h"
+
+#include "PSDL_Scope.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_PSDL_Export TAO_PSDL_Interface_Scope : public TAO_PSDL_Scope
+{
+ public:
+
+ TAO_PSDL_Interface_Scope (TAO_PSDL_Scope *parent_scope);
+
+ ~TAO_PSDL_Interface_Scope (void);
+
+ // Override the add methods which will be useful in the interface
+ // scope. Interfaces can have other inteface declarations,
+ // interfaces, structs, typedefs, constant declarations, exceptions
+ // and operations. If the interfaces can have any other types,
+ // corresponding add methods should also go here.
+ int add_interface (ACE_CString identifier);
+
+ int add_struct (ACE_CString identifier);
+
+ int add_typedef (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_const_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_except_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_exception (ACE_CString identifier);
+
+ int add_op_dcl (ACE_CString identifier);
+
+ // See PSDL_Scope.h
+ void dump (CORBA::ULong depth);
+
+ int find (const ACE_CString &identifier_name,
+ ACE_CString &identifier_type);
+
+ int find (const ACE_CString &identifier_name);
+
+ int get_module_name (const ACE_CString &identifier_name,
+ ACE_CString &module_name);
+
+ int get_interface_name (const ACE_CString &identifier_name,
+ ACE_CString &interface_name);
+
+ // Helper methods to get a pointer to the private variables.
+ TAO_PSDL_Scope *parent_scope (void);
+
+ Scope_Map *scope_map (void);
+
+ ACE_CString identifier_type (void);
+ ACE_CString module_name (void);
+ ACE_CString interface_name (void);
+
+private:
+
+ Scope_Map interface_scope_;
+ TAO_PSDL_Scope *parent_scope_;
+ ACE_CString identifier_type_;
+ ACE_CString module_name_;
+ ACE_CString interface_name_;
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_INTERFACE_SCOPE_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Interface_Visitor.cpp b/TAO/orbsvcs/PSS/PSDL_Interface_Visitor.cpp
new file mode 100644
index 00000000000..597d23a7005
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Interface_Visitor.cpp
@@ -0,0 +1,2366 @@
+#include "PSDL_Interface_Visitor.h"
+#include "PSDL_Stream.h"
+
+ACE_RCSID (PSS,
+ PSDL_Interface_Visitor,
+ "$Id$")
+
+TAO_PSDL_Interface_Visitor::TAO_PSDL_Interface_Visitor (void)
+ : forward_dcl_ (0),
+ interface_name_ ()
+{
+ // constructor.
+}
+
+TAO_PSDL_Interface_Visitor::~TAO_PSDL_Interface_Visitor (void)
+{
+ // destructor.
+}
+
+int
+TAO_PSDL_Interface_Visitor::visit_identifier (TAO_PSDL_Identifier *identifier)
+{
+ this->identifiers_.size (1);
+ this->count_ = 0;
+
+ // Save the identifier.
+ this->identifiers_ [this->count_] = identifier->value ();
+
+ return 0;
+}
+
+int
+TAO_PSDL_Interface_Visitor::visit_forward_dcl (TAO_PSDL_Forward_Dcl *forward_dcl)
+{
+ if (forward_dcl->identifier ()->accept (this) == -1)
+ return -1;
+
+ this->interface_name_ = this->identifiers_[this->count_];
+
+ // Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ ps_sh->reset ();
+
+ *ps_sh << "class " << this->interface_name_ << ";";
+ ps_sh->nl ();
+
+ this->forward_dcl_ = 1;
+ this->print_for_forward_dcl ();
+
+ return 0;
+}
+
+int
+TAO_PSDL_Interface_Visitor::visit_interface_dcl (TAO_PSDL_Interface_Dcl *interface_dcl)
+{
+ if (interface_dcl->interface_header ()->accept (this) == -1)
+ return -1;
+
+ if (interface_dcl->interface_body () != 0)
+ {
+ if (interface_dcl->interface_body ()->accept (this) == -1)
+ return -1;
+ }
+
+ // The generated code for interfaces.
+ this->print_end_for_interface ();
+ return 0;
+}
+
+int
+TAO_PSDL_Interface_Visitor::visit_interface_header (TAO_PSDL_Interface_Header *interface_header)
+{
+ if (interface_header->identifier ()->accept (this) == -1)
+ return -1;
+
+ this->interface_name_ = this->identifiers_[this->count_];
+ TAO_PSDL_Scope::instance ()->set_interface_name (this->interface_name_);
+ this->print_class_for_interface ();
+
+ if (interface_header->type () != 0)
+ {
+ if (interface_header->type ()->accept (this) == -1)
+ return -1;
+ }
+
+ if (interface_header->interface_inheritance_spec () != 0)
+ {
+ if (interface_header->interface_inheritance_spec ()->accept (this) == -1)
+ return -1;
+ }
+
+ return 0;
+}
+
+void
+TAO_PSDL_Interface_Visitor::print_for_forward_dcl (void)
+{
+ // Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ ps_sh->reset ();
+
+ ps_sh->nl ();
+
+ ACE_CString name_space = TAO_PSDL_Scope::instance ()->get_name_space ();
+
+ *ps_sh << "#if !defined (_" << name_space << "_" << this->interface_name_
+ << "___PTR_CH_)"; ps_sh->nl ();
+
+ *ps_sh << "#define _" << name_space << "_"
+ << this->interface_name_ << "___PTR_CH_";
+
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ if (this->forward_dcl_ != 1)
+ {
+ *ps_sh << "class " << this->interface_name_ << ";"; ps_sh->nl ();
+ }
+
+ *ps_sh << "typedef " << this->interface_name_ << "*"
+ << this->interface_name_ << "_ptr;";
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "#endif /* end #if !defined */" << "\n\n"; ps_sh->nl ();
+
+ *ps_sh << "#if !defined (_" << name_space << "_"
+ << this->interface_name_ << "___VAR_CH_)";
+ ps_sh->nl ();
+
+ *ps_sh << "#define _" << name_space << "_"
+ << this->interface_name_ << "___VAR_CH_";
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "class " << this->interface_name_.c_str ()
+ << "_var : public TAO_Base_Var"; ps_sh->nl ();
+
+ *ps_sh << "{";
+ ps_sh->nl ();
+ ps_sh->incr_indent (0);
+
+ *ps_sh << "public:";
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_var (void);"
+ << "// default constructor";
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_var (" << this->interface_name_
+ << "_ptr p) : ptr_ (p) {}";
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_var (const "
+ << this->interface_name_
+ << "_var &);" << "// copy constructor";
+ ps_sh->nl ();
+
+ *ps_sh << " ~" << this->interface_name_ << "_var (void"
+ << "); // destructor";
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_var"
+ << "&operator= (" << this->interface_name_
+ << "_ptr);"; ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_var"
+ << "&operator= (const " << this->interface_name_
+ << "_var &);";
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_
+ << "_ptr operator-> (void) const;";
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "operator const "
+ << this->interface_name_ << "_ptr &() const;"; ps_sh->nl ();
+
+ *ps_sh << "operator "
+ << this->interface_name_ << "_ptr &();";
+
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "// in, inout, out, _retn"; ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_ptr in (void) const;";
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_ptr &inout (void);";
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_ptr &out (void);";
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_ptr _retn (void);";
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_ptr ptr (void) const;";
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "// Hooks used by template sequence and object manager classes";
+ ps_sh->nl ();
+
+ *ps_sh << "// for non-defined forward declared interfaces."; ps_sh->nl ();
+
+ *ps_sh << "static " << this->interface_name_ << "_ptr tao_duplicate ("
+ << this->interface_name_ << "_ptr);";
+ ps_sh->nl ();
+
+ *ps_sh << "static void tao_release ("
+ << this->interface_name_ << "_ptr);";
+ ps_sh->nl ();
+
+ *ps_sh << "static " << this->interface_name_
+ << "_ptr tao_nil (void);"; ps_sh->nl ();
+
+ *ps_sh << "static " << this->interface_name_ << "_ptr tao_narrow (";
+ ps_sh->incr_indent (0);
+ ps_sh->nl ();
+
+ *ps_sh << "CORBA::Object *";
+ ps_sh->nl ();
+ *ps_sh << "ACE_ENV_ARG_DECL_NOT_USED";
+
+ ps_sh->decr_indent (0);
+ ps_sh->nl ();
+
+ *ps_sh << ");";
+ ps_sh->nl ();
+
+ *ps_sh << "static CORBA::Object * tao_upcast (void *);";
+
+ ps_sh->reset ();
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "private:";
+ ps_sh->incr_indent (0);
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_ptr ptr_;";
+ ps_sh->nl ();
+
+ *ps_sh << "// Unimplemented - prevents widening assignment.";
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_var (const TAO_Base_var &rhs);";
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_
+ << "_var &operator= (const TAO_Base_var &rhs);";
+ ps_sh->nl ();
+
+ ps_sh->decr_indent (0);
+ ps_sh->nl ();
+
+ *ps_sh << "};";
+ ps_sh->nl ();
+
+ *ps_sh << "#endif /* end #if !defined */";
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ ps_sh->reset ();
+
+ *ps_sh << "#if !defined (_" << name_space
+ << "_" << this->interface_name_ << "___OUT_CH_)";
+ ps_sh->nl ();
+
+ *ps_sh << "#define _" << name_space
+ << "_" << this->interface_name_ << "___OUT_CH_";
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "class " << this->interface_name_ << "_out"; ps_sh->nl ();
+ *ps_sh << "{";
+ ps_sh->nl ();
+ ps_sh->incr_indent (0);
+
+ *ps_sh << "public:"; ps_sh->nl ();
+ *ps_sh << this->interface_name_ << "_out (" << this->interface_name_
+ << "_ptr &);"; ps_sh->nl ();
+ *ps_sh << this->interface_name_ << "_out (" << this->interface_name_
+ << "_var &);"; ps_sh->nl ();
+ *ps_sh << this->interface_name_ << "_out (const "
+ << this->interface_name_ << "_out &);"; ps_sh->nl ();
+ *ps_sh << this->interface_name_ << "_out &operator= (const "
+ << this->interface_name_ << "_out &);"; ps_sh->nl ();
+ *ps_sh << this->interface_name_ << "_out &operator= (const "
+ << this->interface_name_ << "_var &);"; ps_sh->nl ();
+ *ps_sh << this->interface_name_ << "_out &operator= ("
+ << this->interface_name_ << "_ptr);"; ps_sh->nl ();
+ *ps_sh << "operator " << this->interface_name_ << "_ptr &();"; ps_sh->nl ();
+ *ps_sh << this->interface_name_ << "_ptr &ptr (void);"; ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_ptr operator-> (void);";
+
+ ps_sh->reset ();
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "private:";
+ ps_sh->incr_indent (0);
+ ps_sh->nl ();
+ *ps_sh << this->interface_name_ << "_ptr &ptr_;"; ps_sh->nl ();
+
+ ps_sh->decr_indent (0);
+ ps_sh->nl ();
+
+ *ps_sh << "};\n";
+
+ *ps_sh << "#endif /* end #if !defined */";
+
+ ps_sh->reset ();
+
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+
+ *ps_sh << "// External declarations for undefined interface";
+ ps_sh->nl ();
+ *ps_sh << "//" << this->interface_name_;
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_ptr";
+ ps_sh->nl ();
+
+ *ps_sh << "tao_" << this->interface_name_ << "_duplicate (";
+ ps_sh->incr_indent (0);
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_ptr";
+
+ ps_sh->decr_indent (0);
+ ps_sh->nl ();
+ *ps_sh << ");";
+
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "void";
+ ps_sh->nl ();
+ *ps_sh << "tao_" << this->interface_name_ << "_release (";
+ ps_sh->incr_indent (0);
+ ps_sh->nl ();
+ *ps_sh << this->interface_name_ << "_ptr";
+ ps_sh->decr_indent (0);
+ ps_sh->nl ();
+ *ps_sh << ");";
+
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_ptr";
+ ps_sh->nl ();
+
+ *ps_sh << "tao_" << this->interface_name_ << "_nil (";
+ ps_sh->incr_indent (0);
+ ps_sh->nl ();
+ *ps_sh << "void";
+ ps_sh->decr_indent (0);
+ ps_sh->nl ();
+ *ps_sh << ");";
+
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "_ptr";
+ ps_sh->nl ();
+
+ *ps_sh << "tao_" << this->interface_name_ << "_narrow (";
+ ps_sh->incr_indent (0);
+ ps_sh->nl ();
+
+ *ps_sh << "CORBA::Object *";
+ ps_sh->nl ();
+
+ *ps_sh << "ACE_ENV_ARG_DECL_NOT_USED";
+
+ ps_sh->decr_indent (0);
+ ps_sh->nl ();
+ *ps_sh << ");";
+
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "CORBA::Object *";
+ ps_sh->nl ();
+ *ps_sh << "tao_" << this->interface_name_ << "_upcast (";
+ ps_sh->incr_indent (0);
+ ps_sh->nl ();
+ *ps_sh << "void *";
+ ps_sh->decr_indent (0);
+ ps_sh->nl ();
+ *ps_sh << ");";
+
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "// Any operators for interface " << this->interface_name_;
+ ps_sh->nl ();
+
+ *ps_sh << "void operator<<= (CORBA::Any &, " << this->interface_name_ << "_ptr);";
+ ps_sh->nl ();
+
+ *ps_sh << "CORBA::Boolean operator>>= (const CORBA::Any &, " << this->interface_name_ << " *&);";
+ ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << "#ifndef __ACE_INLINE__";
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << " CORBA::Boolean operator<< (TAO_OutputCDR &, const " << this->interface_name_ << "_ptr );";
+ ps_sh->nl ();
+ *ps_sh << " CORBA::Boolean operator>> (TAO_InputCDR &, " << this->interface_name_ << "_ptr &);";
+ ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << "#endif /* __ACE_INLINE__ */";
+ ps_sh->nl ();
+
+}
+
+void
+TAO_PSDL_Interface_Visitor::print_class_for_interface (void)
+{
+ this->print_for_forward_dcl ();
+
+ ACE_CString name_space = TAO_PSDL_Scope::instance ()->get_name_space ();
+
+ // Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ *ps_sh << "#if !defined (_" << name_space << "_" << this->interface_name_
+ << "_CH_)"; ps_sh->nl ();
+ *ps_sh << "#define _" << name_space << this->interface_name_
+ << "_CH_"; ps_sh->nl ();
+
+ *ps_sh << "// Forward Classes Declaration."; ps_sh->nl ();
+ *ps_sh << "class _TAO_" << this->interface_name_ << "_Proxy_Impl;"; ps_sh->nl ();
+ *ps_sh << "class _TAO_" << this->interface_name_ << "_Remote_Proxy_Impl;"; ps_sh->nl ();
+ *ps_sh << "class _TAO_" << this->interface_name_ << "_Proxy_Broker;"; ps_sh->nl ();
+ *ps_sh << "class _TAO_" << this->interface_name_ << "_Remote_Proxy_Broker;"; ps_sh->nl ();
+
+
+ *ps_sh << "class " << this->interface_name_;
+ *ps_sh << ": public virtual CORBA::Object"; ps_sh->nl ();
+
+ *ps_sh << "{";
+ ps_sh->nl ();
+ ps_sh->incr_indent (0);
+
+ *ps_sh << "public:"; ps_sh->nl ();
+
+ *ps_sh << "typedef " << this->interface_name_ << "_ptr _ptr_type;"; ps_sh->nl ();
+ *ps_sh << "typedef " << this->interface_name_ << "_var _var_type;"; ps_sh->nl ();
+
+ *ps_sh << "static int _tao_class_id;"; ps_sh->nl ();
+
+ *ps_sh << "// The static operations."; ps_sh->nl ();
+ *ps_sh << "static " << this->interface_name_
+ << "_ptr _duplicate ("
+ << this->interface_name_ << "_ptr obj);"
+ ;
+
+ *ps_sh << "static " << this->interface_name_ << "_ptr _narrow ("; ps_sh->nl ();
+ *ps_sh << "CORBA::Object_ptr obj"; ps_sh->nl ();
+ *ps_sh << "ACE_ENV_ARG_DECL_WITH_DEFAULTS"; ps_sh->nl ();
+ *ps_sh << ");"; ps_sh->nl ();
+
+ *ps_sh << "static " << this->interface_name_
+ << "_ptr _unchecked_narrow ("; ps_sh->nl ();
+ *ps_sh << "CORBA::Object_ptr obj"; ps_sh->nl ();
+ *ps_sh << "ACE_ENV_ARG_DECL_WITH_DEFAULTS"; ps_sh->nl ();
+ *ps_sh << ");"; ps_sh->nl ();
+
+ *ps_sh << "static " << this->interface_name_ << "_ptr _nil (void)"; ps_sh->nl ();
+ *ps_sh << "{"; ps_sh->nl ();
+ *ps_sh << "return (" << this->interface_name_ << "_ptr)0;";
+
+ ps_sh->decr_indent (0);
+ ps_sh->nl ();
+
+ *ps_sh << "}"; ps_sh->nl ();
+
+ *ps_sh << "static void _tao_any_destructor (void*);"; ps_sh->nl ();
+
+
+}
+
+void
+TAO_PSDL_Interface_Visitor::print_end_for_interface (void)
+{
+ ACE_CString name_space = TAO_PSDL_Scope::instance ()->get_name_space ();
+
+ // Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ *ps_sh << "virtual CORBA::Boolean _is_a ("; ps_sh->nl ();
+ *ps_sh << "const CORBA::Char *type_id"; ps_sh->nl ();
+ *ps_sh << "ACE_ENV_ARG_DECL_WITH_DEFAULTS"; ps_sh->nl ();
+ *ps_sh << ");"; ps_sh->nl ();
+
+ *ps_sh << "virtual void *_tao_QueryInterface (ptrdiff_t type);"; ps_sh->nl ();
+
+ *ps_sh << "virtual const char* _interface_repository_id (void) const;"; ps_sh->nl ();
+
+ *ps_sh << "private:"; ps_sh->nl ();
+ *ps_sh << "_TAO_" << this->interface_name_ << "_Proxy_Broker *the_TAO_" << this->interface_name_ << "_Proxy_Broker_;"; ps_sh->nl ();
+
+ *ps_sh << "protected:"; ps_sh->nl ();
+ *ps_sh << this->interface_name_ << "(int collocated = 0);"; ps_sh->nl ();
+
+ *ps_sh << "// These methods travese the inheritance tree and set the"; ps_sh->nl ();
+ *ps_sh << "// parents piece of the given class in the right mode"; ps_sh->nl ();
+ *ps_sh << "virtual void " << name_space << "_" << this->interface_name_
+ << "_setup_collocation (int collocated);"; ps_sh->nl ();
+
+ *ps_sh << this->interface_name_ << "("; ps_sh->nl ();
+ *ps_sh << "TAO_Stub *objref, "; ps_sh->nl ();
+ *ps_sh << "CORBA::Boolean _tao_collocated = 0,"; ps_sh->nl ();
+ *ps_sh << "TAO_Abstract_ServantBase *servant = 0"; ps_sh->nl ();
+ *ps_sh << ");"; ps_sh->nl ();
+
+ *ps_sh << "friend class _TAO_" << this->interface_name_ << "_Remote_Proxy_Impl;"; ps_sh->nl ();
+ *ps_sh << "friend class _TAO_" << this->interface_name_ << "_ThruPOA_Proxy_Impl;"; ps_sh->nl ();
+ *ps_sh << "friend class _TAO_" << this->interface_name_ << "_Direct_Proxy_Impl;"; ps_sh->nl ();
+
+ *ps_sh << "virtual ~" << this->interface_name_ << "(void);"; ps_sh->nl ();
+
+ *ps_sh << "private:"; ps_sh->nl ();
+ *ps_sh << this->interface_name_ << "(const " << this->interface_name_ << "&);"; ps_sh->nl ();
+ *ps_sh << "void operator= (const " << this->interface_name_ << "&);"; ps_sh->nl ();
+ *ps_sh << "};"; ps_sh->nl ();
+
+ *ps_sh << "// The Proxy Implementations are used by each interface to"; ps_sh->nl ();
+ *ps_sh << "// perform a call. Each different implementation encapsulate"; ps_sh->nl ();
+ *ps_sh << "// an invocation logics."; ps_sh->nl ();
+
+
+ *ps_sh << "///////////////////////////////////////////////////////////////////////"; ps_sh->nl ();
+ *ps_sh << "// Base Proxy Impl. Declaration"; ps_sh->nl ();
+ *ps_sh << "//"; ps_sh->nl ();
+
+ *ps_sh << "class _TAO_" << this->interface_name_ << "_Proxy_Impl"; ps_sh->nl ();
+ *ps_sh << ": public virtual TAO_Object_Proxy_Impl"; ps_sh->nl ();
+
+ *ps_sh << "{";
+ ps_sh->nl ();
+ ps_sh->incr_indent (0);
+
+ *ps_sh << "public:"; ps_sh->nl ();
+ *ps_sh << "virtual ~_TAO_" << this->interface_name_ << "_Proxy_Impl (void) { }"; ps_sh->nl ();
+
+ *ps_sh << "protected:"; ps_sh->nl ();
+ *ps_sh << "_TAO_" << this->interface_name_ << "_Proxy_Impl (void);"; ps_sh->nl ();
+ *ps_sh << "};"; ps_sh->nl ();
+
+ *ps_sh << "//"; ps_sh->nl ();
+ *ps_sh << "// End Base Proxy Impl. Declaration"; ps_sh->nl ();
+ *ps_sh << "///////////////////////////////////////////////////////////////////////"; ps_sh->nl ();
+
+
+ *ps_sh << "///////////////////////////////////////////////////////////////////////"; ps_sh->nl ();
+ *ps_sh << "// Remote Proxy Impl. Declaration"; ps_sh->nl ();
+ *ps_sh << "//"; ps_sh->nl ();
+
+ *ps_sh << "class _TAO_" << this->interface_name_ << "_Remote_Proxy_Impl"; ps_sh->nl ();
+ *ps_sh << ": public virtual _TAO_" << this->interface_name_ << "_Proxy_Impl,"; ps_sh->nl ();
+ *ps_sh << "public virtual TAO_Remote_Object_Proxy_Impl"; ps_sh->nl ();
+
+ *ps_sh << "{";
+ ps_sh->nl ();
+ ps_sh->incr_indent (0);
+
+ *ps_sh << "public:";
+ ps_sh->nl ();
+
+ *ps_sh << "_TAO_" << this->interface_name_
+ << "_Remote_Proxy_Impl (void);";
+ ps_sh->nl ();
+
+ *ps_sh << "virtual ~_TAO_" << this->interface_name_
+ << "_Remote_Proxy_Impl (void) { }";
+
+ ps_sh->decr_indent (0);
+ ps_sh->nl ();
+
+ *ps_sh << "};"; ps_sh->nl ();
+
+ *ps_sh << "//"; ps_sh->nl ();
+ *ps_sh << "// End Remote Proxy Impl. Declaration"; ps_sh->nl ();
+ *ps_sh << "///////////////////////////////////////////////////////////////////////"; ps_sh->nl ();
+
+ *ps_sh << "// The Proxy Brokers are used by each interface to get"; ps_sh->nl ();
+ *ps_sh << "// the right proxy for performing a call. In the new "; ps_sh->nl ();
+ *ps_sh << "// collocation scheme, the proxy to be used can vary on"; ps_sh->nl ();
+ *ps_sh << "// a call by call basis."; ps_sh->nl ();
+
+
+ *ps_sh << "///////////////////////////////////////////////////////////////////////"; ps_sh->nl ();
+ *ps_sh << "// Base Proxy Broker Declaration "; ps_sh->nl ();
+ *ps_sh << "//"; ps_sh->nl ();
+
+ *ps_sh << "class _TAO_" << this->interface_name_ << "_Proxy_Broker";
+ ps_sh->nl ();
+
+ *ps_sh << "{";
+ ps_sh->incr_indent (0);
+ ps_sh->nl ();
+
+ *ps_sh << "public:";
+ ps_sh->nl ();
+ *ps_sh << "virtual ~_TAO_" << this->interface_name_ << "_Proxy_Broker (void);"; ps_sh->nl ();
+ *ps_sh << "virtual _TAO_" << this->interface_name_ << "_Proxy_Impl &select_proxy ("; ps_sh->nl ();
+ *ps_sh << this->interface_name_ << "*object"; ps_sh->nl ();
+ *ps_sh << "ACE_ENV_ARG_DECL_WITH_DEFAULTS"; ps_sh->nl ();
+ *ps_sh << ") = 0;"; ps_sh->nl ();
+
+ *ps_sh << "protected:"; ps_sh->nl ();
+ *ps_sh << "_TAO_" << this->interface_name_ << "_Proxy_Broker (void);";
+ ps_sh->nl ();
+
+ *ps_sh << "};"; ps_sh->nl ();
+
+ *ps_sh << "//"; ps_sh->nl ();
+ *ps_sh << "// End Base Proxy Broker Declaration "; ps_sh->nl ();
+ *ps_sh << "///////////////////////////////////////////////////////////////";
+ ps_sh->nl ();
+
+
+ *ps_sh << "///////////////////////////////////////////////////////////////";
+ ps_sh->nl ();
+ *ps_sh << "// Remote Proxy Broker Declaration ";
+ ps_sh->nl ();
+ *ps_sh << "//";
+ ps_sh->nl ();
+
+ *ps_sh << "class _TAO_" << this->interface_name_ << "_Remote_Proxy_Broker";
+ ps_sh->nl ();
+ *ps_sh << ": public virtual _TAO_" << this->interface_name_
+ << "_Proxy_Broker";
+ ps_sh->nl ();
+
+ *ps_sh << "{";
+ ps_sh->incr_indent (0);
+ ps_sh->nl ();
+
+ *ps_sh << "public: "; ps_sh->nl ();
+ *ps_sh << "_TAO_" << this->interface_name_ << "_Remote_Proxy_Broker (void);"; ps_sh->nl ();
+
+ *ps_sh << "virtual ~_TAO_" << this->interface_name_ << "_Remote_Proxy_Broker (void);"; ps_sh->nl ();
+
+ *ps_sh << "virtual _TAO_" << this->interface_name_ << "_Proxy_Impl &select_proxy ("; ps_sh->nl ();
+ *ps_sh << this->interface_name_ << "*object"; ps_sh->nl ();
+ *ps_sh << "ACE_ENV_ARG_DECL"; ps_sh->nl ();
+ *ps_sh << ");"; ps_sh->nl ();
+
+ *ps_sh << "private:"; ps_sh->nl ();
+ *ps_sh << "_TAO_" << this->interface_name_ << "_Remote_Proxy_Impl remote_proxy_impl_;"; ps_sh->nl ();
+
+ *ps_sh << "public:"; ps_sh->nl ();
+ *ps_sh << "// This member function is used to get an handle to the unique instance"; ps_sh->nl ();
+ *ps_sh << "// of the Remote Proxy Broker that is available for a given"; ps_sh->nl ();
+ *ps_sh << "// interface."; ps_sh->nl ();
+ *ps_sh << "static _TAO_" << this->interface_name_ << "_Remote_Proxy_Broker *the_TAO_" << this->interface_name_ << "_Remote_Proxy_Broker (void);"; ps_sh->nl ();
+ *ps_sh << "};"; ps_sh->nl ();
+
+ *ps_sh << "//"; ps_sh->nl ();
+ *ps_sh << "// End Remote Proxy Broker Declaration "; ps_sh->nl ();
+ *ps_sh << "//////////////////////////////////////////////////////////////";
+ ps_sh->nl ();
+
+ *ps_sh << "#endif /* end #if !defined */"; ps_sh->nl ();
+
+ *ps_sh << "TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_"
+ << this->interface_name_ << ";";
+ ps_sh->nl ();
+}
+
+void
+TAO_PSDL_Interface_Visitor::gen_code_for_si (void)
+{
+ TAO_PSDL_Stream *ps_si = TAO_PSDL_Scope::instance ()->get_si ();
+
+ ps_si->reset ();
+ ps_si->indent (); // start from current indentation level
+
+ *ps_si << "int " << this->interface_name_ << "::_tao_class_id = 0;";
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_ptr";
+ ps_si->nl ();
+ *ps_si << "tao_" << this->interface_name_ << "_duplicate (";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << this->interface_name_ << "_ptr p";
+ ps_si->nl ();
+ *ps_si << ")";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "return " << this->interface_name_ << "::_duplicate (p);";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+ ps_si->nl ();
+
+ ps_si->nl ();
+
+ *ps_si << "void";
+ ps_si->nl ();
+
+ *ps_si << "tao_" << this->interface_name_ << "_release (";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_ptr p";
+ ps_si->nl ();
+
+ *ps_si << ")";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "{";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "CORBA::release (p);";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_ptr";
+ ps_si->nl ();
+ *ps_si << "tao_" << this->interface_name_ << "_nil (";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "void";
+ ps_si->nl ();
+ *ps_si << ")";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "return " << this->interface_name_ << "::_nil ();";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+ ps_si->nl ();
+
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_ptr";
+ ps_si->nl ();
+ *ps_si << "tao_" << this->interface_name_ << "_narrow (";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "CORBA::Object *p";
+ ps_si->nl ();
+
+ *ps_si << "ACE_ENV_ARG_DECL"; ps_si->nl ();
+ *ps_si << ")";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "{";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return " << this->interface_name_
+ << "::_narrow (p ACE_ENV_ARG_PARAMETER);";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "CORBA::Object *"; ps_si->nl ();
+ *ps_si << "tao_" << this->interface_name_ << "_upcast (";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "void *src"; ps_si->nl ();
+ *ps_si << ")";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << " **tmp =";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "ACE_static_cast (" << this->interface_name_ << " **, src);";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "return *tmp;";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "// ***********************************************************";
+ ps_si->nl ();
+ *ps_si << "// " << this->interface_name_ << "_var"; ps_si->nl ();
+ *ps_si << "// ***********************************************************";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_var::"
+ << this->interface_name_
+ << "_var (void) // default constructor";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << ": ptr_ (" << this->interface_name_ << "::_nil ())";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "{}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "::" << this->interface_name_ << "_ptr"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_var::ptr (void) const"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "return this->ptr_;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_var::"
+ << this->interface_name_ << "_var (const ::"
+ << this->interface_name_ << "_var &p) // copy constructor";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << ": TAO_Base_var (),";
+
+ ps_si->incr_indent (0); ps_si->nl ();
+ *ps_si << "ptr_ (" << this->interface_name_
+ << "::_duplicate (p.ptr ()))";
+
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "{}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_var::~"
+ << this->interface_name_ << "_var (void) // destructor";
+
+ ps_si->nl ();
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "CORBA::release (this->ptr_);";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_var &"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_var::operator= ("
+ << this->interface_name_ << "_ptr p)";
+
+ ps_si->nl ();
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "this->ptr_ = p;"; ps_si->nl ();
+ *ps_si << "return *this;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_var &"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_var::operator= (const ::"
+ << this->interface_name_ << "_var &p)";
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "if (this != &p)";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "{";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "CORBA::release (this->ptr_);"; ps_si->nl ();
+ *ps_si << "this->ptr_ = ::" << this->interface_name_
+ << "::_duplicate (p.ptr ());";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return *this;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_var::operator const ::"
+ << this->interface_name_ << "_ptr &() const // cast"; ps_si->nl ();
+ *ps_si << "{";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "return this->ptr_;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_var::operator ::"
+ << this->interface_name_ << "_ptr &() // cast "; ps_si->nl ();
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return this->ptr_;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "::" << this->interface_name_ << "_ptr"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_var::operator-> (void) const";
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return this->ptr_;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "::" << this->interface_name_ << "_ptr"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_var::in (void) const"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return this->ptr_;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "::" << this->interface_name_ << "_ptr &"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_var::inout (void)"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return this->ptr_;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "::" << this->interface_name_ << "_ptr &"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_var::out (void)"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "CORBA::release (this->ptr_);"; ps_si->nl ();
+ *ps_si << "this->ptr_ = ::" << this->interface_name_ << "::_nil ();";
+ ps_si->nl ();
+ *ps_si << "return this->ptr_;";
+
+ ps_si->nl ();
+ ps_si->decr_indent (0);
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "::" << this->interface_name_ << "_ptr"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_var::_retn (void)"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "// yield ownership of managed obj reference"; ps_si->nl ();
+ *ps_si << "::" << this->interface_name_ << "_ptr val = this->ptr_;";
+ ps_si->nl ();
+ *ps_si << "this->ptr_ = ::" << this->interface_name_ << "::_nil ();";
+ ps_si->nl ();
+ *ps_si << "return val;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "::" << this->interface_name_ << "_ptr"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_var::tao_duplicate ("
+ << this->interface_name_ << "_ptr p)";
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return ::" << this->interface_name_ << "::_duplicate (p);";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "void"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_var::tao_release ("
+ << this->interface_name_ << "_ptr p)";
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "CORBA::release (p);";
+
+ ps_si->nl ();
+ ps_si->decr_indent (0);
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "::" << this->interface_name_ << "_ptr"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_var::tao_nil (void)"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return ::" << this->interface_name_ << "::_nil ();";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "::" << this->interface_name_ << "_ptr"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_var::tao_narrow (";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "CORBA::Object *p"; ps_si->nl ();
+ *ps_si << "ACE_ENV_ARG_DECL"; ps_si->nl ();
+ *ps_si << ")";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return ::" << this->interface_name_
+ << "::_narrow (p ACE_ENV_ARG_PARAMETER);";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "CORBA::Object *"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_var::tao_upcast (void *src)";
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << " **tmp ="; ps_si->nl ();
+ *ps_si << "ACE_static_cast (" << this->interface_name_ << " **, src);";
+ ps_si->nl ();
+ *ps_si << "return *tmp;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "// **********************************************************";
+ ps_si->nl ();
+ *ps_si << "// " << this->interface_name_ << "_out"; ps_si->nl ();
+ *ps_si << "// **********************************************************";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_out::"
+ << this->interface_name_ << "_out ("
+ << this->interface_name_ << "_ptr &p)";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << ": ptr_ (p)";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "this->ptr_ = ::" << this->interface_name_ << "::_nil ();";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_out::"
+ << this->interface_name_ << "_out ("
+ << this->interface_name_
+ << "_var &p) // constructor from _var";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << ": ptr_ (p.out ())";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "CORBA::release (this->ptr_);"; ps_si->nl ();
+ *ps_si << "this->ptr_ = ::" << this->interface_name_ << "::_nil ();";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_out::"
+ << this->interface_name_ << "_out (const ::"
+ << this->interface_name_ << "_out &p) // copy constructor";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << ": ptr_ (ACE_const_cast ("
+ << this->interface_name_
+ << "_out &, p).ptr_)";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "::" << this->interface_name_ << "_out &"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_out::operator= (const ::"
+ << this->interface_name_ << "_out &p)"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "this->ptr_ = ACE_const_cast ("
+ << this->interface_name_ << "_out&, p).ptr_;"; ps_si->nl ();
+ *ps_si << "return *this;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_out &"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_out::operator= (const ::"
+ << this->interface_name_ << "_var &p)"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "this->ptr_ = ::" << this->interface_name_
+ << "::_duplicate (p.ptr ());"; ps_si->nl ();
+ *ps_si << "return *this;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_out &"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_out::operator= ("
+ << this->interface_name_ << "_ptr p)"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "this->ptr_ = p;"; ps_si->nl ();
+ *ps_si << "return *this;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_out::operator ::"
+ << this->interface_name_ << "_ptr &() // cast"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return this->ptr_;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "::" << this->interface_name_ << "_ptr &"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_out::ptr (void) // ptr"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return this->ptr_;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "::" << this->interface_name_ << "_ptr"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_out::operator-> (void)"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return this->ptr_;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "#if (TAO_HAS_INTERCEPTORS == 1)"; ps_si->nl ();
+ *ps_si << "#endif /* TAO_HAS_INTERCEPTORS */";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "///////////////////////////////////////////////////////////////"; ps_si->nl ();
+ *ps_si << "// Base & Remote Proxy Implementation. ";
+ ps_si->nl ();
+ *ps_si << "//";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "_TAO_" << this->interface_name_ << "_Proxy_Impl::_TAO_"
+ << this->interface_name_ << "_Proxy_Impl (void)"; ps_si->nl ();
+ *ps_si << "{}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "_TAO_" << this->interface_name_
+ << "_Remote_Proxy_Impl::_TAO_" << this->interface_name_
+ << "_Remote_Proxy_Impl (void)"; ps_si->nl ();
+ *ps_si << "{}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "// Remote Implementation of the IDL interface methods";
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "//"; ps_si->nl ();
+ *ps_si << "// End Base & Remote Proxy Implemeentation. ";
+ ps_si->nl ();
+
+ *ps_si << "///////////////////////////////////////////////////////////////";
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "///////////////////////////////////////////////////////////////"; ps_si->nl ();
+ *ps_si << "// Remote & Base Proxy Broker Implementation";
+ ps_si->nl ();
+ *ps_si << "//";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "_TAO_" << this->interface_name_ << "_Proxy_Broker::_TAO_"
+ << this->interface_name_ << "_Proxy_Broker (void)"; ps_si->nl ();
+ *ps_si << "{"; ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "_TAO_" << this->interface_name_ << "_Proxy_Broker::~_TAO_"
+ << this->interface_name_ << "_Proxy_Broker (void)"; ps_si->nl ();
+ *ps_si << "{"; ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "_TAO_" << this->interface_name_
+ << "_Proxy_Broker * (*_TAO_"
+ << this->interface_name_
+ << "_Proxy_Broker_Factory_function_pointer) (";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "CORBA::Object_ptr obj";
+
+ ps_si->nl ();
+ *ps_si << ") = 0;";
+
+ ps_si->decr_indent (0);
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "// Factory Member function Implementation."; ps_si->nl ();
+ *ps_si << "_TAO_" << this->interface_name_ << "_Remote_Proxy_Broker *";
+ ps_si->nl ();
+ *ps_si << "_TAO_" << this->interface_name_
+ << "_Remote_Proxy_Broker::the_TAO_"
+ << this->interface_name_
+ << "_Remote_Proxy_Broker (void)"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "static ::_TAO_" << this->interface_name_
+ << "_Remote_Proxy_Broker remote_proxy_broker;"; ps_si->nl ();
+ *ps_si << "return &remote_proxy_broker;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "_TAO_" << this->interface_name_
+ << "_Remote_Proxy_Broker::_TAO_"
+ << this->interface_name_ << "_Remote_Proxy_Broker (void)"; ps_si->nl ();
+ *ps_si << "{"; ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "_TAO_" << this->interface_name_
+ << "_Remote_Proxy_Broker::~_TAO_"
+ << this->interface_name_ << "_Remote_Proxy_Broker (void)"; ps_si->nl ();
+ *ps_si << "{"; ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "_TAO_" << this->interface_name_ << "_Proxy_Impl&"; ps_si->nl ();
+ *ps_si << "_TAO_" << this->interface_name_
+ << "_Remote_Proxy_Broker::select_proxy (";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "::" << this->interface_name_ << " *"; ps_si->nl ();
+ *ps_si << "ACE_ENV_ARG_DECL_NOT_USED"; ps_si->nl ();
+ *ps_si << ")";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return this->remote_proxy_impl_;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "//"; ps_si->nl ();
+ *ps_si << "// End Remote & Base Proxy Broker Implementation"; ps_si->nl ();
+ *ps_si << "///////////////////////////////////////////////////////////////"; ps_si->nl ();
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "::"
+ << this->interface_name_ << " (int collocated)"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "this->" << this->interface_name_
+ << "_setup_collocation (collocated);";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "::~"
+ << this->interface_name_ << " (void)"; ps_si->nl ();
+ *ps_si << "{}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "void"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "::"
+ << this->interface_name_
+ << "_setup_collocation (int collocated)"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "if (collocated)";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "this->the_TAO_"
+ << this->interface_name_ << "_Proxy_Broker_ =";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "::_TAO_" << this->interface_name_
+ << "_Proxy_Broker_Factory_function_pointer (this);";
+
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "else";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "this->the_TAO_"
+ << this->interface_name_
+ << "_Proxy_Broker_ =";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "::_TAO_" << this->interface_name_
+ << "_Remote_Proxy_Broker::the_TAO_"
+ << this->interface_name_
+ << "_Remote_Proxy_Broker ();";
+
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "void " << this->interface_name_
+ << "::_tao_any_destructor (void *_tao_void_pointer)"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_
+ << " *tmp = ACE_static_cast ("
+ << this->interface_name_ << "*, _tao_void_pointer);"; ps_si->nl ();
+ *ps_si << "CORBA::release (tmp);";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_ptr "
+ << this->interface_name_ << "::_narrow (";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "CORBA::Object_ptr obj"; ps_si->nl ();
+ *ps_si << "ACE_ENV_ARG_DECL";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << ")";
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "if (CORBA::is_nil (obj))";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return " << this->interface_name_ << "::_nil ();";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "if (! obj->_is_local ())";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "CORBA::Boolean is_a = obj->_is_a (\"IDL:"
+ << this->interface_name_ << ":1.0\" ACE_ENV_ARG_PARAMETER);";
+ ps_si->nl ();
+ *ps_si << "ACE_CHECK_RETURN (" << this->interface_name_ << "::_nil ());"; ps_si->nl ();
+
+ *ps_si << "if (is_a == 0)";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "return " << this->interface_name_ << "::_nil ();";
+
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return " << this->interface_name_
+ << "::_unchecked_narrow (obj ACE_ENV_ARG_PARAMETER);";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_ptr "; ps_si->nl ();
+ *ps_si << this->interface_name_ << "::_unchecked_narrow (";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "CORBA::Object_ptr obj"; ps_si->nl ();
+ *ps_si << "ACE_ENV_ARG_DECL_NOT_USED"; ps_si->nl ();
+ *ps_si << ")";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "if (CORBA::is_nil (obj))";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return " << this->interface_name_ << "::_nil ();";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "if (! obj->_is_local ())"; ps_si->nl ();
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "TAO_Stub* stub = obj->_stubobj ();"; ps_si->nl ();
+
+ *ps_si << "if (stub)";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << " stub->_incr_refcnt ();";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_ptr default_proxy = "
+ << this->interface_name_ << "::_nil ();"; ps_si->nl ();
+ ps_si->nl ();
+ *ps_si << "if (";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "!CORBA::is_nil (stub->servant_orb_var ().ptr ()) &&"; ps_si->nl ();
+ *ps_si << "stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects () &&"; ps_si->nl ();
+ *ps_si << "obj->_is_collocated () &&"; ps_si->nl ();
+ *ps_si << "_TAO_" << this->interface_name_
+ << "_Proxy_Broker_Factory_function_pointer != 0"; ps_si->nl ();
+ *ps_si << ")";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << " {";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << " ACE_NEW_RETURN (";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "default_proxy,"; ps_si->nl ();
+ *ps_si << "::" << this->interface_name_ << " (";
+ ps_si->incr_indent (0);
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "stub,"; ps_si->nl ();
+ *ps_si << "1,"; ps_si->nl ();
+ *ps_si << "obj->_servant ()"; ps_si->nl ();
+ *ps_si << "),";
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << this->interface_name_ << "::_nil ()"; ps_si->nl ();
+
+ *ps_si << ");";
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << " }";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "if (CORBA::is_nil (default_proxy))";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "{";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "ACE_NEW_RETURN (";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "default_proxy,"; ps_si->nl ();
+
+ *ps_si << "::" << this->interface_name_ << " (";
+ ps_si->incr_indent (0);
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "stub,"; ps_si->nl ();
+ *ps_si << "0,"; ps_si->nl ();
+ *ps_si << "obj->_servant ()"; ps_si->nl ();
+ *ps_si << "),";
+
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "::_nil ()"; ps_si->nl ();
+ *ps_si << ");";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << " }";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return default_proxy;";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "}"; ps_si->nl ();
+ *ps_si << "else";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "return";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "ACE_reinterpret_cast"; ps_si->nl ();
+ *ps_si << "(";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << this->interface_name_ << "_ptr,"; ps_si->nl ();
+ *ps_si << "obj->_tao_QueryInterface"; ps_si->nl ();
+ *ps_si << "(";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "ACE_reinterpret_cast"; ps_si->nl ();
+ *ps_si << "(";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "ptrdiff_t,"; ps_si->nl ();
+ *ps_si << "&" << this->interface_name_ << "::_tao_class_id";
+ ps_si->nl ();
+
+ *ps_si << ")";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << ")";
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << " );";
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << this->interface_name_ << "_ptr"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "::_duplicate ("
+ << this->interface_name_ << "_ptr obj)"; ps_si->nl ();
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "if (!CORBA::is_nil (obj))";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "obj->_add_ref ();";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return obj;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "CORBA::Boolean " << this->interface_name_
+ << "::_is_a (const CORBA::Char *value ACE_ENV_ARG_DECL)"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "if (";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "(!ACE_OS::strcmp ((char *)value, \"IDL:"
+ << this->interface_name_ << ":1.0\")) ||"; ps_si->nl ();
+ *ps_si << "(!ACE_OS::strcmp ((char *)value,"
+ << "\"IDL:omg.org/CORBA/Object:1.0\")))"; ps_si->nl ();
+
+ *ps_si << "return 1; // success using local knowledge";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "else";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "return this->Object::_is_a (value ACE_ENV_ARG_PARAMETER);";
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "void *" << this->interface_name_
+ << "::_tao_QueryInterface (ptrdiff_t type)"; ps_si->nl ();
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "void *retv = 0;"; ps_si->nl ();
+ *ps_si << "if (type == ACE_reinterpret_cast";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "(ptrdiff_t,"; ps_si->nl ();
+ *ps_si << "&" << this->interface_name_ << "::_tao_class_id))"; ps_si->nl ();
+ *ps_si << "retv = reinterpret_cast<void*> (this);";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "else if (type == ACE_reinterpret_cast "
+ << "(ptrdiff_t, &CORBA::Object::_tao_class_id))";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "retv = ACE_reinterpret_cast (void *,";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "static_cast<CORBA::Object_ptr> (this));";
+
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+
+ ps_si->nl ();
+ ps_si->nl ();
+ *ps_si << "if (retv)";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "this->_add_ref ();";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "return retv;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "const char* " << this->interface_name_
+ << "::_interface_repository_id (void) const"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "return \"IDL:" << this->interface_name_ << ":1.0\";";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "static const CORBA::Long _oc_"
+ << this->interface_name_ << "[] ="; ps_si->nl ();
+ *ps_si << "{"; ps_si->nl ();
+ *ps_si << "// typecode related information goes here";
+
+ ps_si->nl ();
+ *ps_si << "};";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+
+ *ps_si << "static CORBA::TypeCode _tc_TAO_tc_"
+ << this->interface_name_ << " (";
+
+ ps_si->incr_indent (0);
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "CORBA::tk_objref,"; ps_si->nl ();
+ *ps_si << "sizeof (_oc_" << this->interface_name_ << "),"; ps_si->nl ();
+ *ps_si << "(char *) &_oc_" << this->interface_name_ << ","; ps_si->nl ();
+ *ps_si << "0,"; ps_si->nl ();
+ *ps_si << "sizeof (" << this->interface_name_ << ")";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << ");";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "::CORBA::TypeCode_ptr _tc_" << this->interface_name_ << " =";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "&_tc_TAO_tc_" << this->interface_name_ << ";";
+ ps_si->decr_indent (0);
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "void operator<<= (";
+ ps_si->incr_indent (0);
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "CORBA::Any &_tao_any,"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_ptr _tao_elem";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << ")";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "TAO_OutputCDR stream;";
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "if (stream << _tao_elem)";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "_tao_any._tao_replace (";
+ ps_si->incr_indent (0);
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "_tc_" << this->interface_name_ << ", "; ps_si->nl ();
+ *ps_si << "TAO_ENCAP_BYTE_ORDER,"; ps_si->nl ();
+ *ps_si << "stream.begin (),"; ps_si->nl ();
+ *ps_si << "1,"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "::_duplicate (_tao_elem),"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "::_tao_any_destructor";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << ");";
+
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "void operator<<= (";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "CORBA::Any &_tao_any,"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_ptr *_tao_elem";
+ ps_si->nl ();
+
+ *ps_si << ")";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "TAO_OutputCDR stream;";
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "if (stream << *_tao_elem)";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "_tao_any._tao_replace (";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "_tc_" << this->interface_name_ << ", "; ps_si->nl ();
+ *ps_si << "TAO_ENCAP_BYTE_ORDER,"; ps_si->nl ();
+ *ps_si << "stream.begin (),"; ps_si->nl ();
+ *ps_si << "1,"; ps_si->nl ();
+ *ps_si << "*_tao_elem,"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "::_tao_any_destructor";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << ");";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "CORBA::Boolean operator>>= (";
+ ps_si->incr_indent (0);
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "const CORBA::Any &_tao_any,"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_ptr &_tao_elem";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << ")";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "ACE_TRY_NEW_ENV"; ps_si->nl ();
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "_tao_elem = " << this->interface_name_ << "::_nil ();";
+ ps_si->nl ();
+ *ps_si << "CORBA::TypeCode_var type = _tao_any.type ();";
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "CORBA::Boolean result =";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "type->equivalent (";
+ ps_si->incr_indent (0);
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "_tc_" << this->interface_name_ << ""; ps_si->nl ();
+ *ps_si << "ACE_ENV_ARG_PARAMETER";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << ");";
+
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "ACE_TRY_CHECK;";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "if (!result)";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "return 0; // not equivalent";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "TAO_InputCDR stream (";
+ ps_si->incr_indent (0);
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "_tao_any._tao_get_cdr (),";
+ ps_si->nl ();
+ *ps_si << "_tao_any._tao_byte_order ()";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << ");";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "if (stream >> _tao_elem)";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "((CORBA::Any *)&_tao_any)->_tao_replace (";
+ ps_si->incr_indent (0);
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "_tc_" << this->interface_name_ << ","; ps_si->nl ();
+ *ps_si << "1,"; ps_si->nl ();
+ *ps_si << "_tao_elem,"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "::_tao_any_destructor";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << ");";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ ps_si->nl ();
+ *ps_si << "return 1;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+ ps_si->nl ();
+
+ *ps_si << "ACE_CATCHANY";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "{"; ps_si->nl ();
+ *ps_si << "}";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "ACE_ENDTRY;";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "_tao_elem = " << this->interface_name_ << "::_nil ();";
+ ps_si->nl ();
+ *ps_si << "return 0;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "CORBA::Boolean operator<< (";
+
+ ps_si->incr_indent (0);
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "TAO_OutputCDR &strm,"; ps_si->nl ();
+ *ps_si << "const " << this->interface_name_ << "_ptr _tao_objref";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << ")";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "CORBA::Object_ptr _tao_corba_obj = _tao_objref;"; ps_si->nl ();
+ *ps_si << "return (strm << _tao_corba_obj);";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "CORBA::Boolean operator>> (";
+ ps_si->incr_indent (0);
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "TAO_InputCDR &strm,"; ps_si->nl ();
+ *ps_si << this->interface_name_ << "_ptr &_tao_objref";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << ")";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "ACE_TRY_NEW_ENV"; ps_si->nl ();
+ *ps_si << "{";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "CORBA::Object_var obj;"; ps_si->nl ();
+ *ps_si << "if ((strm >> obj.inout ()) == 0)";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "return 0;";
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "// narrow to the right type"; ps_si->nl ();
+ *ps_si << "_tao_objref =";
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << this->interface_name_ << "::_unchecked_narrow (";
+
+ ps_si->incr_indent (0);
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "obj.in ()"; ps_si->nl ();
+ *ps_si << "ACE_ENV_ARG_PARAMETER";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << ");";
+
+ ps_si->decr_indent (0);
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "ACE_TRY_CHECK;"; ps_si->nl ();
+ *ps_si << "return 1;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ *ps_si << "ACE_CATCHANY"; ps_si->nl ();
+ *ps_si << "{";
+
+ ps_si->incr_indent (0);
+ ps_si->nl ();
+ *ps_si << "// do nothing";
+
+ ps_si->decr_indent (0);ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+ *ps_si << "ACE_ENDTRY;"; ps_si->nl ();
+ *ps_si << "return 0;";
+
+ ps_si->decr_indent (0);
+ ps_si->nl ();
+
+ *ps_si << "}";
+
+ ps_si->nl ();
+ ps_si->nl ();
+
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Interface_Visitor.h b/TAO/orbsvcs/PSS/PSDL_Interface_Visitor.h
new file mode 100644
index 00000000000..936167922c1
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Interface_Visitor.h
@@ -0,0 +1,65 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Interface_Visitor.h
+//
+// = DESCRIPTION
+// Visitor class for the generated code for interfaces.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_INTERFACE_VISITOR_H
+#define TAO_PSDL_INTERFACE_VISITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "PSDL_Node_Visitor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_PSDL_Interface_Visitor : public TAO_PSDL_Node_Visitor
+{
+ public:
+
+ TAO_PSDL_Interface_Visitor ();
+
+ ~TAO_PSDL_Interface_Visitor ();
+
+ // Override the necessary methods for interfaces (including forward
+ // declarations).
+ int visit_identifier (TAO_PSDL_Identifier *identifier);
+
+ int visit_forward_dcl (TAO_PSDL_Forward_Dcl *forward_dcl);
+
+ int visit_interface_dcl (TAO_PSDL_Interface_Dcl *interface_dcl);
+
+ int visit_interface_header (TAO_PSDL_Interface_Header *interface_header);
+
+ // Generate the code that should go into the stub implementation
+ // file for the type_declarators.
+ void gen_code_for_si (void);
+
+ private:
+
+ void print_for_forward_dcl (void);
+ void print_class_for_interface (void);
+ void print_end_for_interface (void);
+
+ CORBA::Boolean forward_dcl_;
+ ACE_CString interface_name_;
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_INTERFACE_VISITOR_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Interpreter.cpp b/TAO/orbsvcs/PSS/PSDL_Interpreter.cpp
new file mode 100644
index 00000000000..0ee126084bc
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Interpreter.cpp
@@ -0,0 +1,107 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Interpreter.h"
+#include "PSDL_Node.h"
+#include "PSDL_y.h"
+
+ACE_RCSID(PSDL, PSDL_Interpreter, "$Id$")
+
+TAO_SYNCH_MUTEX TAO_PSDL_Interpreter::parserMutex__;
+
+TAO_PSDL_Interpreter::TAO_PSDL_Interpreter (void)
+ : root_ (0)
+{
+}
+
+TAO_PSDL_Interpreter::~TAO_PSDL_Interpreter (void)
+{
+ delete this->root_;
+}
+
+int
+TAO_PSDL_Interpreter::build_tree (const char* nodes)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ TAO_PSDL_Interpreter::parserMutex__,
+ -1);
+
+ TAO_Lex_String_Input::reset ((char*)nodes);
+
+ yyval = 0;
+ void *result_ptr = 0;
+ int return_value = TAO_PSDL_yyparse (result_ptr);
+
+ if (return_value == 0 && yyval != 0)
+ {
+ this->root_ = yyval;
+ }
+ else
+ {
+ this->root_ = 0;
+ }
+
+ return return_value;
+}
+
+int
+TAO_PSDL_Interpreter::is_empty_string (const char* str)
+{
+ int return_value = 0;
+
+ if (str != 0)
+ {
+ int i = 0;
+
+ while (str[i] != '\0')
+ {
+ if (str[i] != ' ')
+ {
+ break;
+ }
+
+ i++;
+ }
+
+ if (str[i] == '\0')
+ {
+ return_value = 1;
+ }
+ }
+
+ return return_value;
+}
+
+char* TAO_Lex_String_Input::string_ = 0;
+char* TAO_Lex_String_Input::current_ = 0;
+char* TAO_Lex_String_Input::end_ = 0;
+
+// Routine to have Lex read its input from the node string.
+
+int
+TAO_Lex_String_Input::copy_into (char* buf,
+ int max_size)
+{
+ int chars_left = TAO_Lex_String_Input::end_ - TAO_Lex_String_Input::current_;
+ int n = max_size > chars_left ? chars_left : max_size;
+
+ if (n > 0)
+ {
+ ACE_OS:: memcpy (buf,
+ TAO_Lex_String_Input::current_,
+ n);
+ TAO_Lex_String_Input::current_ += n;
+ }
+
+ return n;
+}
+
+void
+TAO_Lex_String_Input::reset (char* input_string)
+{
+ TAO_Lex_String_Input::string_ = input_string;
+ TAO_Lex_String_Input::current_ = input_string;
+ TAO_Lex_String_Input::end_ =
+ input_string + ACE_OS::strlen (TAO_Lex_String_Input::string_);
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Interpreter.h b/TAO/orbsvcs/PSS/PSDL_Interpreter.h
new file mode 100644
index 00000000000..f023f79b467
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Interpreter.h
@@ -0,0 +1,99 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ========================================================================
+//
+// = LIBRARY
+// orbsvcs/PSS
+//
+// = FILENAME
+// PSDL_Interpreter.h
+//
+// = AUTHOR
+// Priyanka Gontla <pgontla@doc.ece.uci.edu>
+//
+// ========================================================================
+
+#ifndef TAO_PSDL_INTERPRETER_H
+#define TAO_PSDL_INTERPRETER_H
+#include /**/ "ace/pre.h"
+
+#include "psdl_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/orbconf.h"
+#include "ace/Synch.h"
+
+class TAO_PSDL_Node;
+
+class TAO_PSDL_Export TAO_PSDL_Interpreter
+{
+ // = TITLE
+ // TAO_PSDL_Interpreter is the superclass for all PSDL interpreters.
+ // Its build tree method invokes the yacc parser to parse a constraint
+ // or preference string.
+protected:
+ // = Initialization and termination methods.
+ TAO_PSDL_Interpreter (void);
+ // Constructor.
+
+ ~TAO_PSDL_Interpreter (void);
+ // Destructor.
+
+ int build_tree (const char* constraints);
+ // Using the Yacc generated parser, construct an expression tree
+ // representing <nodes> from the tokens returned by it.
+
+ static int is_empty_string (const char* str);
+
+ TAO_PSDL_Node* root_;
+ // The root of the expression tree, not equal to null if build_tree
+ // successfully builds a tree from the constraints.
+private:
+ static TAO_SYNCH_MUTEX parserMutex__;
+ // This mutex protects the <build_tree> method from reentrance.
+};
+
+
+// Functions we need for parsing.
+extern int TAO_PSDL_yyparse (void *);
+extern void yyrestart (FILE*);
+extern int yylex (TAO_PSDL_Node **, void *);
+
+// Have yylex read from the node string, not from stdin.
+//#undef YY_INPUT
+//#define YY_INPUT(b, r, ms) (r = TAO_Lex_String_Input::copy_into(b, ms))
+
+class TAO_Lex_String_Input
+{
+ // = TITLE
+ // Have Lex read from a string and not from stdin. Essentially,
+ // the interpreter needs to call yylex() until EOF, and call
+ // TAO_Lex_String_Input::reset() with the new string, prior to
+ // calling yyparse.
+public:
+ static void reset (char* input_string);
+ // Reset the lex input.
+
+ static int copy_into (char* buf, int max_size);
+ // Method lex will call to read from the input string.
+
+private:
+
+ static char* string_;
+ static char* current_;
+ static char* end_;
+ // Pointers to keep track of the input string.
+};
+
+// The union used by lex and bison to build the Abstract Syntax Tree.
+#define YYSTYPE TAO_PSDL_Node *
+
+extern YYSTYPE yylval;
+extern YYSTYPE yyval;
+
+#include /**/ "ace/post.h"
+#endif /* TAO_PSDL_INTERPRETER_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Module_Scope.cpp b/TAO/orbsvcs/PSS/PSDL_Module_Scope.cpp
new file mode 100644
index 00000000000..bda3bbb4ff8
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Module_Scope.cpp
@@ -0,0 +1,237 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Module_Scope.h"
+#include "PSDL_Interface_Scope.h"
+
+ACE_RCSID (PSS, PSDL_Module_Scope, "$Id$")
+
+TAO_PSDL_Module_Scope::TAO_PSDL_Module_Scope (TAO_PSDL_Scope *parent_scope)
+ : module_scope_ (),
+ parent_scope_ (parent_scope),
+ identifier_type_ ("module")
+{
+}
+
+TAO_PSDL_Module_Scope::~TAO_PSDL_Module_Scope (void)
+{
+}
+
+int
+TAO_PSDL_Module_Scope::add_module (ACE_CString identifier)
+{
+ return TAO_PSDL_Scope::instance ()->add_module_to_scope (identifier,
+ this);
+}
+
+int
+TAO_PSDL_Module_Scope::add_interface (ACE_CString interface_name)
+{
+ return TAO_PSDL_Scope::instance ()->add_interface_to_scope (interface_name,
+ this);
+}
+
+int
+TAO_PSDL_Module_Scope::add_struct (ACE_CString struct_name)
+{
+ return TAO_PSDL_Scope::instance ()->add_struct_to_scope (struct_name,
+ this);
+}
+
+int
+TAO_PSDL_Module_Scope::add_typedef (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_typedef_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Module_Scope::add_const_decl (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_const_decl_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Module_Scope::add_except_decl (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_except_decl_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Module_Scope::add_exception (ACE_CString identifier)
+{
+ return TAO_PSDL_Scope::instance ()->add_exception_to_scope (identifier,
+ this);
+}
+
+int
+TAO_PSDL_Module_Scope::add_enum_decl (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_enum_decl_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Module_Scope::add_op_dcl (ACE_CString identifier)
+{
+ return TAO_PSDL_Scope::instance ()->add_op_dcl_to_scope (identifier,
+ this);
+}
+
+void
+TAO_PSDL_Module_Scope::dump (CORBA::ULong depth)
+{
+ depth = depth + 5;
+
+ for (Scope_Map_Iterator i = this->module_scope_.begin ();
+ i != this->module_scope_.end ();
+ ++i)
+ {
+ this->print_depth (depth);
+ ACE_DEBUG ((LM_DEBUG,
+ "%s (module/interface/storagebase/struct)\n",
+ (*i).ext_id_.c_str ()));
+ (*i).int_id_->dump (depth);
+ }
+}
+
+int
+TAO_PSDL_Module_Scope::find (const ACE_CString &identifier_name,
+ ACE_CString &identifier_type)
+{
+ for (Scope_Map_Iterator i = this->module_scope_.begin ();
+ i != this->module_scope_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ identifier_type = (*i).int_id_->identifier_type ();
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->find (identifier_name,
+ identifier_type) == 0)
+ {
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+int
+TAO_PSDL_Module_Scope::find (const ACE_CString &identifier_name)
+{
+ for (Scope_Map_Iterator i = this->module_scope_.begin ();
+ i != this->module_scope_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->find (identifier_name) == 0)
+ {
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+int
+TAO_PSDL_Module_Scope::get_module_name (const ACE_CString &identifier_name,
+ ACE_CString &module_name)
+{
+ for (Scope_Map_Iterator i = this->module_scope_.begin ();
+ i != this->module_scope_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ module_name = (*i).int_id_->module_name ();
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->get_module_name (identifier_name,
+ module_name) == 0)
+ {
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+int
+TAO_PSDL_Module_Scope::get_interface_name (const ACE_CString &identifier_name,
+ ACE_CString &interface_name)
+{
+ for (Scope_Map_Iterator i = this->module_scope_.begin ();
+ i != this->module_scope_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ interface_name = (*i).int_id_->interface_name ();
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->get_interface_name (identifier_name,
+ interface_name) == 0)
+ {
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+TAO_PSDL_Scope *
+TAO_PSDL_Module_Scope::parent_scope (void)
+{
+ return this->parent_scope_;
+}
+
+Scope_Map *
+TAO_PSDL_Module_Scope::scope_map (void)
+{
+ return &this->module_scope_;
+}
+
+ACE_CString
+TAO_PSDL_Module_Scope::identifier_type (void)
+{
+ return this->identifier_type_;
+}
+
+ACE_CString
+TAO_PSDL_Module_Scope::module_name (void)
+{
+ return this->module_name_;
+}
+
+ACE_CString
+TAO_PSDL_Module_Scope::interface_name (void)
+{
+ return this->interface_name_;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Module_Scope.h b/TAO/orbsvcs/PSS/PSDL_Module_Scope.h
new file mode 100644
index 00000000000..283a1067bb6
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Module_Scope.h
@@ -0,0 +1,97 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Module_Scope
+//
+// = DESCRIPTION
+// Scope class for the Exception type helpful for building the AST.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_MODULE_SCOPE_H
+#define TAO_PSDL_MODULE_SCOPE_H
+
+#include /**/ "ace/pre.h"
+
+#include "PSDL_Scope.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_PSDL_Export TAO_PSDL_Module_Scope : public TAO_PSDL_Scope
+{
+ public:
+
+ TAO_PSDL_Module_Scope (TAO_PSDL_Scope *parent_scope);
+
+ ~TAO_PSDL_Module_Scope (void);
+
+ // Override the necessary methods for the modules.
+ int add_module (ACE_CString identifier);
+
+ int add_interface (ACE_CString identifier);
+
+ int add_struct (ACE_CString identifier);
+
+ int add_typedef (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_const_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_except_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_exception (ACE_CString identifier);
+
+ int add_enum_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_op_dcl (ACE_CString identifier);
+
+ void dump (CORBA::ULong depth);
+
+ int find (const ACE_CString &identifier_name,
+ ACE_CString &identifier_type);
+
+ int find (const ACE_CString &identifier_name);
+
+ int get_module_name (const ACE_CString &identifier_name,
+ ACE_CString &module_name);
+
+ int get_interface_name (const ACE_CString &identifier_name,
+ ACE_CString &interface_name);
+
+ TAO_PSDL_Scope *parent_scope (void);
+
+ Scope_Map *scope_map (void);
+
+ ACE_CString identifier_type (void);
+ ACE_CString module_name (void);
+ ACE_CString interface_name (void);
+
+protected:
+
+ Scope_Map module_scope_;
+ TAO_PSDL_Scope *parent_scope_;
+
+ // Type of this scope. Useful later when needed to find the type of
+ // a particular PSDL_Scope *
+ ACE_CString identifier_type_;
+ ACE_CString module_name_;
+ ACE_CString interface_name_;
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_MODULE_SCOPE_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Module_Visitor.cpp b/TAO/orbsvcs/PSS/PSDL_Module_Visitor.cpp
new file mode 100644
index 00000000000..23c7d29490c
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Module_Visitor.cpp
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Module_Visitor.h"
+#include "PSDL_Scope.h"
+#include "PSDL_Stream.h"
+
+ACE_RCSID (PSS, PSDL_Module_Visitor, "$Id$")
+
+TAO_PSDL_Module_Visitor::TAO_PSDL_Module_Visitor (void)
+{
+}
+
+TAO_PSDL_Module_Visitor::~TAO_PSDL_Module_Visitor (void)
+{
+}
+
+int
+TAO_PSDL_Module_Visitor::visit_module (TAO_PSDL_Module *module)
+{
+ // Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ // The visitor method for the modules. We invoke the accept method
+ // of the TAO_PSDL_Module. This method is going to invoke the chain
+ // of visitor methods for members in the module scope.
+ *ps_sh << "TAO_NAMESPACE "
+ << module->identifier_name ().c_str ()
+ << " {";
+
+ ps_sh->nl ();
+
+ ps_sh->incr_indent ();
+ TAO_PSDL_Scope::instance ()->set_name_space (module->identifier_name ());
+
+ if (module->specification ()->accept (this) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) PSDL_Module_Visitor::"
+ "visit_module - "
+ "codegen for scope failed\n"), -1);
+ }
+
+ ps_sh->decr_indent ();
+ ps_sh->nl ();
+
+ *ps_sh << "} TAO_NAMESPACE_CLOSE // module "
+ << module->identifier_name ().c_str ()
+ << "\n\n";
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Module_Visitor.h b/TAO/orbsvcs/PSS/PSDL_Module_Visitor.h
new file mode 100644
index 00000000000..2419b4fb5ea
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Module_Visitor.h
@@ -0,0 +1,45 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Module_Visitor.h
+//
+// = DESCRIPTION
+// Visitor class for the generated code for modules.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_MODULE_VISITOR_H
+#define TAO_PSDL_MODULE_VISITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "PSDL_Node_Visitor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_PSDL_Module_Visitor : public TAO_PSDL_Node_Visitor
+{
+ public:
+
+ TAO_PSDL_Module_Visitor ();
+
+ ~TAO_PSDL_Module_Visitor ();
+
+ // Override the visit_module method.
+ int visit_module (TAO_PSDL_Module *node);
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_MODULE_VISITOR_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Node.cpp b/TAO/orbsvcs/PSS/PSDL_Node.cpp
new file mode 100644
index 00000000000..0b5a1e5ff49
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Node.cpp
@@ -0,0 +1,5215 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Node.h"
+#include "PSDL_Scope.h"
+#include "PSDL_Scope_Visitor.h"
+#include "PSDL_Node_Visitor.h"
+#include "PSDL_y.h"
+
+#include "PSDL_Stream.h"
+#include "tao/CORBA_String.h"
+
+ACE_RCSID (PSS, PSDL_Node, "$Id$")
+
+TAO_PSDL_Node::TAO_PSDL_Node (void)
+ : identifiers_ (),
+ count_ (0),
+ predefined_type_ (0),
+ psdl_scope_ (0),
+ psdl_scope_visitor_ (0)
+{
+}
+
+TAO_PSDL_Node::~TAO_PSDL_Node (void)
+{
+}
+
+int
+TAO_PSDL_Node::type_of_node (void) const
+{
+ return this->type_;
+}
+
+
+TAO_PSDL_Scope_Visitor *
+TAO_PSDL_Node::psdl_scope_visitor (void)
+{
+ if (this->psdl_scope_visitor_ == 0)
+ this->psdl_scope_visitor_ = new TAO_PSDL_Scope_Visitor (this);
+
+ return this->psdl_scope_visitor_;
+}
+
+TAO_PSDL_Scope *
+TAO_PSDL_Node::psdl_scope (void)
+{
+ this->psdl_scope_ = TAO_PSDL_Scope::instance ()->pop_top_scope ();
+
+ return this->psdl_scope_;
+}
+
+ACE_CString
+TAO_PSDL_Node::get_identifier_type (void)
+{
+ // We are going to save such that the first element is the type of the
+ // identifier and the second element is the actual identifier
+ return this->identifiers_[0];
+}
+
+ACE_CString
+TAO_PSDL_Node::get_identifier_value (void)
+{
+ // We are going to save such as the first element is the type of the
+ // identifier and
+ // the second element is the actual identifier
+ return this->identifiers_[1];
+}
+
+void
+TAO_PSDL_Node::set_identifier (ACE_CString identifier)
+{
+ if (this->identifiers_.size () == 0)
+ this->identifiers_.size (2);
+
+ this->identifiers_[this->count_] = identifier;
+ ++this->count_;
+}
+
+void
+TAO_PSDL_Node::set_predefined_type (void)
+{
+ this->predefined_type_ = 1;
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Specification::TAO_PSDL_Specification (TAO_PSDL_Node *definition)
+ : definition_ (definition),
+ specification_ (0)
+{
+}
+
+TAO_PSDL_Specification::TAO_PSDL_Specification (TAO_PSDL_Node *definition,
+ TAO_PSDL_Node *specification)
+ : definition_ (definition),
+ specification_ (specification)
+{
+}
+
+TAO_PSDL_Specification::~TAO_PSDL_Specification (void)
+{
+ delete this->definition_;
+ delete this->specification_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Specification::definition (void) const
+{
+ return this->definition_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Specification::specification (void) const
+{
+ return this->specification_;
+}
+
+int
+TAO_PSDL_Specification::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ int result = visitor->visit_specification (this);
+
+ // The control goes back to psdl_tao now. So, put in the end stuff
+ // to the header file.
+
+ // Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ *ps_sh << "#if defined (__ACE_INLINE__)"; ps_sh->nl ();
+ *ps_sh << "#include \""
+ << TAO_PSDL_Scope::instance ()->get_stub_prefix ()
+ << "C.i\""; ps_sh->nl ();
+ *ps_sh << "#endif /* defined INLINE */"; ps_sh->nl ();
+
+ ps_sh->nl ();
+
+ *ps_sh << "#if defined(_MSC_VER)"; ps_sh->nl ();
+ *ps_sh << "#pragma warning(pop)"; ps_sh->nl ();
+ *ps_sh << "#endif /* _MSC_VER */"; ps_sh->nl ();
+
+ *ps_sh << "#if defined (__BORLANDC__)"; ps_sh->nl ();
+ *ps_sh << "#pragma option pop"; ps_sh->nl ();
+ *ps_sh << "#endif /* __BORLANDC__ */"; ps_sh->nl ();
+
+ ps_sh->nl ();
+
+ *ps_sh << "#endif /* ifndef */"; ps_sh->nl ();
+
+ return result;
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Definition::TAO_PSDL_Definition (TAO_PSDL_Node *definition_type)
+ : definition_type_ (definition_type)
+{
+}
+
+TAO_PSDL_Definition::~TAO_PSDL_Definition (void)
+{
+ delete this->definition_type_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Definition::definition_type (void) const
+{
+ return this->definition_type_;
+}
+
+int
+TAO_PSDL_Definition::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_definition (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Module::TAO_PSDL_Module (int type,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *specification)
+ : identifier_ (identifier),
+ specification_ (specification)
+{
+ this->type_ = type;
+}
+
+TAO_PSDL_Module::~TAO_PSDL_Module (void)
+{
+ delete this->identifier_;
+ delete this->specification_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Module::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Module::specification (void) const
+{
+ return this->specification_;
+}
+
+void
+TAO_PSDL_Module::set_identifier_name (ACE_CString identifier_name)
+{
+ this->module_name_ = identifier_name;
+}
+
+ACE_CString
+TAO_PSDL_Module::identifier_name (void) const
+{
+ return this->module_name_;
+}
+
+int
+TAO_PSDL_Module::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_module (this);
+}
+
+/// ***************************************************************
+
+TAO_PSDL_Abstract_Storagetype::TAO_PSDL_Abstract_Storagetype (TAO_PSDL_Node *storagetype_dcl)
+ : storagetype_dcl_ (storagetype_dcl)
+{
+}
+
+TAO_PSDL_Abstract_Storagetype::~TAO_PSDL_Abstract_Storagetype (void)
+{
+ delete this->storagetype_dcl_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagetype::storagetype_dcl (void) const
+{
+ return this->storagetype_dcl_;
+}
+
+int
+TAO_PSDL_Abstract_Storagetype::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagetype (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Abstract_Storagetype_Dcl::TAO_PSDL_Abstract_Storagetype_Dcl (
+ TAO_PSDL_Node *abs_storagetype_header)
+ : abs_storagetype_header_ (abs_storagetype_header),
+ abs_storagetype_body_ (0)
+{
+}
+
+TAO_PSDL_Abstract_Storagetype_Dcl::TAO_PSDL_Abstract_Storagetype_Dcl (
+ TAO_PSDL_Node *abs_storagetype_header,
+ TAO_PSDL_Node *abs_storagetype_body)
+ : abs_storagetype_header_ (abs_storagetype_header),
+ abs_storagetype_body_ (abs_storagetype_body)
+{
+}
+
+TAO_PSDL_Abstract_Storagetype_Dcl::~TAO_PSDL_Abstract_Storagetype_Dcl (void)
+{
+ delete this->abs_storagetype_header_;
+ if (this->abs_storagetype_body_ != 0)
+ delete this->abs_storagetype_body_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagetype_Dcl::abs_storagetype_header (void) const
+{
+ return this->abs_storagetype_header_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagetype_Dcl::abs_storagetype_body (void) const
+{
+ return this->abs_storagetype_body_;
+}
+
+int
+TAO_PSDL_Abstract_Storagetype_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagetype_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Abstract_Storagetype_Fwd_Dcl::TAO_PSDL_Abstract_Storagetype_Fwd_Dcl (
+ TAO_PSDL_Node *identifier)
+ : identifier_ (identifier)
+{
+}
+
+TAO_PSDL_Abstract_Storagetype_Fwd_Dcl::~TAO_PSDL_Abstract_Storagetype_Fwd_Dcl (void)
+{
+ delete this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagetype_Fwd_Dcl::identifier (void) const
+{
+ return this->identifier_;
+}
+
+int
+TAO_PSDL_Abstract_Storagetype_Fwd_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagetype_fwd_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Abstract_Storagetype_Header::TAO_PSDL_Abstract_Storagetype_Header (TAO_PSDL_Node *identifier)
+ : identifier_ (identifier)
+{
+}
+
+TAO_PSDL_Abstract_Storagetype_Header::TAO_PSDL_Abstract_Storagetype_Header (
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *abs_storagetype_inh_spec)
+ : identifier_ (identifier),
+ abs_storagetype_inh_spec_ (abs_storagetype_inh_spec)
+{
+}
+
+TAO_PSDL_Abstract_Storagetype_Header::~TAO_PSDL_Abstract_Storagetype_Header (void)
+{
+ delete this->identifier_;
+ delete this->abs_storagetype_inh_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagetype_Header::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagetype_Header::abs_storagetype_inh_spec (void) const
+{
+ return this->abs_storagetype_inh_spec_;
+}
+
+int
+TAO_PSDL_Abstract_Storagetype_Header::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagetype_header (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Abstract_Storagetype_Body::TAO_PSDL_Abstract_Storagetype_Body (TAO_PSDL_Node *abs_storagetype_member)
+ : abs_storagetype_member_ (abs_storagetype_member)
+{
+}
+
+TAO_PSDL_Abstract_Storagetype_Body::TAO_PSDL_Abstract_Storagetype_Body (
+ TAO_PSDL_Node *abs_storagetype_member,
+ TAO_PSDL_Node *abs_storagetype_body)
+ : abs_storagetype_member_ (abs_storagetype_member),
+ abs_storagetype_body_ (abs_storagetype_body)
+{
+}
+
+TAO_PSDL_Abstract_Storagetype_Body::~TAO_PSDL_Abstract_Storagetype_Body (void)
+{
+ delete this->abs_storagetype_member_;
+ delete this->abs_storagetype_body_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagetype_Body::abs_storagetype_member (void) const
+{
+ return this->abs_storagetype_member_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagetype_Body::abs_storagetype_body (void) const
+{
+ return this->abs_storagetype_body_;
+}
+
+int
+TAO_PSDL_Abstract_Storagetype_Body::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagetype_body (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Abstract_Storagetype_Member::TAO_PSDL_Abstract_Storagetype_Member (TAO_PSDL_Node *declaration)
+ : declaration_ (declaration)
+{
+}
+
+TAO_PSDL_Abstract_Storagetype_Member::~TAO_PSDL_Abstract_Storagetype_Member (void)
+{
+ delete this->declaration_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagetype_Member::declaration (void) const
+{
+ return this->declaration_;
+}
+
+int
+TAO_PSDL_Abstract_Storagetype_Member::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagetype_member (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Abstract_Storagetype_Inh_Spec::TAO_PSDL_Abstract_Storagetype_Inh_Spec (TAO_PSDL_Node *abs_storagetype_name)
+ : abs_storagetype_name_ (abs_storagetype_name)
+{
+}
+
+TAO_PSDL_Abstract_Storagetype_Inh_Spec::~TAO_PSDL_Abstract_Storagetype_Inh_Spec (void)
+{
+ delete this->abs_storagetype_name_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagetype_Inh_Spec::abs_storagetype_name (void) const
+{
+ return this->abs_storagetype_name_;
+}
+
+int
+TAO_PSDL_Abstract_Storagetype_Inh_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagetype_inh_spec (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Abstract_Storagetype_Name::TAO_PSDL_Abstract_Storagetype_Name (TAO_PSDL_Node *scoped_name)
+ : scoped_name_ (scoped_name),
+ abs_storagetype_name_ (0)
+{
+}
+
+TAO_PSDL_Abstract_Storagetype_Name::TAO_PSDL_Abstract_Storagetype_Name (
+ TAO_PSDL_Node *scoped_name,
+ TAO_PSDL_Node *abs_storagetype_name)
+ : scoped_name_ (scoped_name),
+ abs_storagetype_name_ (abs_storagetype_name)
+{
+}
+
+TAO_PSDL_Abstract_Storagetype_Name::~TAO_PSDL_Abstract_Storagetype_Name (void)
+{
+ delete this->scoped_name_;
+ if (this->abs_storagetype_name_ != 0)
+ delete this->abs_storagetype_name_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagetype_Name::scoped_name (void) const
+{
+ return this->scoped_name_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagetype_Name::abs_storagetype_name (void) const
+{
+ return this->abs_storagetype_name_;
+}
+
+int
+TAO_PSDL_Abstract_Storagetype_Name::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagetype_name (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Psdl_State_Dcl::TAO_PSDL_Psdl_State_Dcl (TAO_PSDL_Node *key_word,
+ TAO_PSDL_Node *psdl_state_type_spec,
+ TAO_PSDL_Node *simple_declarator)
+ : key_word_ (key_word),
+ psdl_state_type_spec_ (psdl_state_type_spec),
+ simple_declarator_ (simple_declarator)
+{
+}
+
+TAO_PSDL_Psdl_State_Dcl::TAO_PSDL_Psdl_State_Dcl (TAO_PSDL_Node *psdl_state_type_spec,
+ TAO_PSDL_Node *simple_declarator)
+ : key_word_ (0),
+ psdl_state_type_spec_ (psdl_state_type_spec),
+ simple_declarator_ (simple_declarator)
+{
+}
+
+TAO_PSDL_Psdl_State_Dcl::~TAO_PSDL_Psdl_State_Dcl (void)
+{
+ if (this->key_word_ != 0)
+ delete this->key_word_;
+ delete this->psdl_state_type_spec_;
+ delete this->simple_declarator_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Psdl_State_Dcl::key_word (void) const
+{
+ return this->key_word_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Psdl_State_Dcl::psdl_state_type_spec (void) const
+{
+ return this->psdl_state_type_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Psdl_State_Dcl::simple_declarator (void) const
+{
+ return this->simple_declarator_;
+}
+
+int
+TAO_PSDL_Psdl_State_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_psdl_state_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Psdl_State_Type_Spec::TAO_PSDL_Psdl_State_Type_Spec (TAO_PSDL_Node *type_spec)
+ : type_spec_ (type_spec)
+{
+}
+
+TAO_PSDL_Psdl_State_Type_Spec::~TAO_PSDL_Psdl_State_Type_Spec (void)
+{
+ delete this->type_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Psdl_State_Type_Spec::type_spec (void) const
+{
+ return this->type_spec_;
+}
+
+int
+TAO_PSDL_Psdl_State_Type_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_psdl_state_type_spec (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Abstract_Storagetype_Ref_Type::TAO_PSDL_Abstract_Storagetype_Ref_Type (TAO_PSDL_Node *key_word,
+ TAO_PSDL_Node *abs_storagetype_name)
+ : key_word_ (key_word),
+ abs_storagetype_name_ (abs_storagetype_name)
+{
+}
+
+TAO_PSDL_Abstract_Storagetype_Ref_Type::TAO_PSDL_Abstract_Storagetype_Ref_Type (TAO_PSDL_Node *abs_storagetype_name)
+ : key_word_ (0),
+ abs_storagetype_name_ (abs_storagetype_name)
+{
+}
+
+TAO_PSDL_Abstract_Storagetype_Ref_Type::~TAO_PSDL_Abstract_Storagetype_Ref_Type (void)
+{
+ if (this->key_word_ != 0)
+ delete this->key_word_;
+ delete this->abs_storagetype_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagetype_Ref_Type::key_word (void) const
+{
+ return this->key_word_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagetype_Ref_Type::abs_storagetype_name (void) const
+{
+ return this->abs_storagetype_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Abstract_Storagetype_Ref_Type::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagetype_ref_type (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Abstract_Storagehome::TAO_PSDL_Abstract_Storagehome (TAO_PSDL_Node *abs_storagehome_dcl)
+ : abs_storagehome_dcl_ (abs_storagehome_dcl)
+{
+}
+
+TAO_PSDL_Abstract_Storagehome::~TAO_PSDL_Abstract_Storagehome (void)
+{
+ delete this->abs_storagehome_dcl_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagehome::abs_storagehome_dcl (void) const
+{
+ return this->abs_storagehome_dcl_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Abstract_Storagehome::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagehome (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Abstract_Storagehome_Fwd_Dcl::TAO_PSDL_Abstract_Storagehome_Fwd_Dcl (
+ TAO_PSDL_Node *identifier)
+ : identifier_ (identifier)
+{
+}
+
+TAO_PSDL_Abstract_Storagehome_Fwd_Dcl::~TAO_PSDL_Abstract_Storagehome_Fwd_Dcl (void)
+{
+ delete this->identifier_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagehome_Fwd_Dcl::identifier (void) const
+{
+ return this->identifier_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Abstract_Storagehome_Fwd_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagehome_fwd_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Abstract_Storagehome_Dcl::TAO_PSDL_Abstract_Storagehome_Dcl (TAO_PSDL_Node *abs_storagehome_header)
+ : abs_storagehome_header_ (abs_storagehome_header),
+ abs_storagehome_body_ (0)
+{
+}
+
+TAO_PSDL_Abstract_Storagehome_Dcl::TAO_PSDL_Abstract_Storagehome_Dcl (TAO_PSDL_Node *abs_storagehome_header,
+ TAO_PSDL_Node *abs_storagehome_body)
+ : abs_storagehome_header_ (abs_storagehome_header),
+ abs_storagehome_body_ (abs_storagehome_body)
+{
+}
+
+TAO_PSDL_Abstract_Storagehome_Dcl::~TAO_PSDL_Abstract_Storagehome_Dcl (void)
+{
+ delete this->abs_storagehome_header_;
+ delete this->abs_storagehome_body_;
+}
+
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagehome_Dcl::abs_storagehome_header (void) const
+{
+ return this->abs_storagehome_header_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagehome_Dcl::abs_storagehome_body (void) const
+{
+ return this->abs_storagehome_body_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Abstract_Storagehome_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagehome_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Abstract_Storagehome_Header::TAO_PSDL_Abstract_Storagehome_Header (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *abs_storagetype_name)
+ : identifier_ (identifier),
+ abs_storagetype_name_ (abs_storagetype_name),
+ abs_storagehome_inh_spec_ (0)
+{
+}
+
+TAO_PSDL_Abstract_Storagehome_Header::TAO_PSDL_Abstract_Storagehome_Header (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *abs_storagetype_name,
+ TAO_PSDL_Node *abs_storagehome_inh_spec)
+ : identifier_ (identifier),
+ abs_storagetype_name_ (abs_storagetype_name),
+ abs_storagehome_inh_spec_ (abs_storagehome_inh_spec)
+{
+}
+
+TAO_PSDL_Abstract_Storagehome_Header::~TAO_PSDL_Abstract_Storagehome_Header (void)
+{
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagehome_Header::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagehome_Header::abs_storagetype_name (void) const
+{
+ return this->abs_storagetype_name_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagehome_Header::abs_storagehome_inh_spec (void) const
+{
+ return this->abs_storagehome_inh_spec_;
+}
+
+
+/// = The Node methods.
+int
+TAO_PSDL_Abstract_Storagehome_Header::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagehome_header (this);
+}
+
+/// ****************************************************************
+
+
+TAO_PSDL_Abstract_Storagehome_Body::TAO_PSDL_Abstract_Storagehome_Body ()
+{
+}
+
+TAO_PSDL_Abstract_Storagehome_Body::TAO_PSDL_Abstract_Storagehome_Body (TAO_PSDL_Node *abs_storagehome_member)
+ : abs_storagehome_member_ (abs_storagehome_member)
+{
+}
+
+TAO_PSDL_Abstract_Storagehome_Body::TAO_PSDL_Abstract_Storagehome_Body (TAO_PSDL_Node *abs_storagehome_member,
+ TAO_PSDL_Node *abs_storagehome_body)
+ : abs_storagehome_member_ (abs_storagehome_member),
+ abs_storagehome_body_ (abs_storagehome_body)
+{
+}
+
+TAO_PSDL_Abstract_Storagehome_Body::~TAO_PSDL_Abstract_Storagehome_Body (void)
+{
+ delete this->abs_storagehome_member_;
+
+ if (this->abs_storagehome_body_ != 0)
+ delete this->abs_storagehome_body_;
+}
+
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagehome_Body::abs_storagehome_member (void) const
+{
+ return this->abs_storagehome_member_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagehome_Body::abs_storagehome_body (void) const
+{
+ return this->abs_storagehome_body_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Abstract_Storagehome_Body::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagehome_body (this);
+}
+
+
+/// ****************************************************************
+
+TAO_PSDL_Abstract_Storagehome_Member::TAO_PSDL_Abstract_Storagehome_Member (TAO_PSDL_Node *declaration_type)
+ : declaration_type_ (declaration_type)
+{
+}
+
+TAO_PSDL_Abstract_Storagehome_Member::~TAO_PSDL_Abstract_Storagehome_Member (void)
+{
+ delete this->declaration_type_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagehome_Member::declaration_type (void) const
+{
+ return this->declaration_type_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Abstract_Storagehome_Member::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagehome_member (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Abstract_Storagehome_Inh_Spec::TAO_PSDL_Abstract_Storagehome_Inh_Spec (TAO_PSDL_Node *abs_storagehome_name)
+ : abs_storagehome_name_ (abs_storagehome_name)
+{
+}
+
+TAO_PSDL_Abstract_Storagehome_Inh_Spec::~TAO_PSDL_Abstract_Storagehome_Inh_Spec (void)
+{
+ delete this->abs_storagehome_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagehome_Inh_Spec::abs_storagehome_name (void) const
+{
+ return this->abs_storagehome_name_;
+}
+
+
+/// = The Node methods.
+int
+TAO_PSDL_Abstract_Storagehome_Inh_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagehome_inh_spec (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Abstract_Storagehome_Name::TAO_PSDL_Abstract_Storagehome_Name (TAO_PSDL_Node *scoped_name)
+ : scoped_name_ (scoped_name),
+ abs_storagehome_name_ (0)
+{
+}
+
+TAO_PSDL_Abstract_Storagehome_Name::TAO_PSDL_Abstract_Storagehome_Name (TAO_PSDL_Node *scoped_name,
+ TAO_PSDL_Node *abs_storagehome_name)
+ : scoped_name_ (scoped_name),
+ abs_storagehome_name_ (abs_storagehome_name)
+{
+}
+
+TAO_PSDL_Abstract_Storagehome_Name::~TAO_PSDL_Abstract_Storagehome_Name (void)
+{
+ delete this->scoped_name_;
+ if (this->abs_storagehome_name_ != 0)
+ delete this->abs_storagehome_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagehome_Name::scoped_name (void) const
+{
+ return this->scoped_name_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Abstract_Storagehome_Name::abs_storagehome_name (void) const
+{
+ return this->abs_storagehome_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Abstract_Storagehome_Name::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_abstract_storagehome_name (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Local_Op_Dcl::TAO_PSDL_Local_Op_Dcl (TAO_PSDL_Node *op_type_spec,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *parameter_dcls,
+ TAO_PSDL_Node *raises_expr)
+ : op_type_spec_ (op_type_spec),
+ identifier_ (identifier),
+ parameter_dcls_ (parameter_dcls),
+ raises_expr_ (raises_expr)
+{
+}
+
+TAO_PSDL_Local_Op_Dcl::TAO_PSDL_Local_Op_Dcl (TAO_PSDL_Node *op_type_spec,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *parameter_dcls)
+ : op_type_spec_ (op_type_spec),
+ identifier_ (identifier),
+ parameter_dcls_ (parameter_dcls),
+ raises_expr_ (0)
+{
+}
+
+TAO_PSDL_Local_Op_Dcl::~TAO_PSDL_Local_Op_Dcl (void)
+{
+ delete this->op_type_spec_;
+ delete this->identifier_;
+ delete this->parameter_dcls_;
+ if (this->raises_expr_ != 0)
+ delete this->raises_expr_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Local_Op_Dcl::op_type_spec (void) const
+{
+ return this->op_type_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Local_Op_Dcl::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Local_Op_Dcl::parameter_dcls (void) const
+{
+ return this->parameter_dcls_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Local_Op_Dcl::raises_expr (void) const
+{
+ return this->raises_expr_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Local_Op_Dcl:: accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_local_op_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Key_Dcl::TAO_PSDL_Key_Dcl (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *simple_declarator)
+ : identifier_ (identifier),
+ simple_declarator_ (simple_declarator)
+{
+}
+
+TAO_PSDL_Key_Dcl::TAO_PSDL_Key_Dcl (TAO_PSDL_Node *identifier)
+ : identifier_ (identifier),
+ simple_declarator_ (0)
+{
+}
+
+TAO_PSDL_Key_Dcl::~TAO_PSDL_Key_Dcl (void)
+{
+ delete this->identifier_;
+ if (this->simple_declarator_ != 0)
+ delete this->simple_declarator_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Key_Dcl::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Key_Dcl::simple_declarator (void) const
+{
+ return this->simple_declarator_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Key_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_key_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Catalog::TAO_PSDL_Catalog (TAO_PSDL_Node *identifier)
+ : identifier_ (identifier),
+ catalog_inh_spec_ (0),
+ catalog_body_ (0)
+{
+}
+
+TAO_PSDL_Catalog::TAO_PSDL_Catalog (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *catalog_inh_spec,
+ TAO_PSDL_Node *catalog_body)
+ :identifier_ (identifier),
+ catalog_inh_spec_ (catalog_inh_spec),
+ catalog_body_ (catalog_body)
+{
+}
+
+TAO_PSDL_Catalog::TAO_PSDL_Catalog (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *catalog_body)
+ : identifier_ (identifier),
+ catalog_inh_spec_ (0),
+ catalog_body_ (catalog_body)
+{
+}
+
+TAO_PSDL_Catalog::~TAO_PSDL_Catalog (void)
+{
+ delete this->identifier_;
+
+ if (this->catalog_inh_spec_ != 0)
+ delete this->catalog_inh_spec_;
+
+ delete this->catalog_body_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Catalog::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Catalog::catalog_inh_spec (void) const
+{
+ return this->catalog_inh_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Catalog::catalog_body (void) const
+{
+ return this->catalog_body_;
+}
+
+ /// = The Node methods.
+int
+TAO_PSDL_Catalog::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_catalog (this);
+}
+
+/// ****************************************************************
+
+
+TAO_PSDL_Catalog_Inh_Spec::TAO_PSDL_Catalog_Inh_Spec (TAO_PSDL_Node *catalog_name)
+ : catalog_name_ (catalog_name)
+{
+}
+
+TAO_PSDL_Catalog_Inh_Spec::~TAO_PSDL_Catalog_Inh_Spec (void)
+{
+ delete this->catalog_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Catalog_Inh_Spec::catalog_name (void) const
+{
+ return this->catalog_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Catalog_Inh_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_catalog_inh_spec (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Catalog_Name::TAO_PSDL_Catalog_Name (TAO_PSDL_Node *scoped_name)
+ : scoped_name_ (scoped_name),
+ catalog_name_ (0)
+{
+}
+
+TAO_PSDL_Catalog_Name::TAO_PSDL_Catalog_Name (TAO_PSDL_Node *scoped_name,
+ TAO_PSDL_Node *catalog_name)
+ : scoped_name_ (scoped_name),
+ catalog_name_ (catalog_name)
+{
+}
+
+TAO_PSDL_Catalog_Name::~TAO_PSDL_Catalog_Name (void)
+{
+ delete this->scoped_name_;
+ if (this->catalog_name_ != 0)
+ delete this->catalog_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Catalog_Name::scoped_name (void) const
+{
+ return this->scoped_name_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Catalog_Name::catalog_name (void) const
+{
+ return this->catalog_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Catalog_Name::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_catalog_name (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Catalog_Body::TAO_PSDL_Catalog_Body ()
+ : catalog_member_ (0),
+ catalog_body_ (0)
+{
+}
+
+TAO_PSDL_Catalog_Body::TAO_PSDL_Catalog_Body (TAO_PSDL_Node *catalog_member)
+ : catalog_member_ (catalog_member)
+{
+}
+
+TAO_PSDL_Catalog_Body::TAO_PSDL_Catalog_Body (TAO_PSDL_Node *catalog_member,
+ TAO_PSDL_Node *catalog_body)
+ : catalog_member_ (catalog_member),
+ catalog_body_ (catalog_body)
+{
+}
+
+TAO_PSDL_Catalog_Body::~TAO_PSDL_Catalog_Body (void)
+{
+ if (this->catalog_member_ != 0)
+ delete this->catalog_member_;
+
+ if (this->catalog_body_ != 0)
+ delete this->catalog_body_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Catalog_Body::catalog_member (void) const
+{
+ return this->catalog_member_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Catalog_Body::catalog_body (void) const
+{
+ return this->catalog_body_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Catalog_Body::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_catalog_body (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Catalog_Member::TAO_PSDL_Catalog_Member (TAO_PSDL_Node *declaration)
+ : declaration_ (declaration)
+{
+}
+
+TAO_PSDL_Catalog_Member::~TAO_PSDL_Catalog_Member (void)
+{
+ delete this->declaration_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Catalog_Member::declaration (void) const
+{
+ return this->declaration_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Catalog_Member::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_catalog_member (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Provides_Dcl::TAO_PSDL_Provides_Dcl (
+ TAO_PSDL_Node *abs_storagehome_name,
+ TAO_PSDL_Node *simple_declarator)
+ : abs_storagehome_name_ (abs_storagehome_name),
+ simple_declarator_ (simple_declarator)
+{
+}
+
+TAO_PSDL_Provides_Dcl::~TAO_PSDL_Provides_Dcl (void)
+{
+ delete this->abs_storagehome_name_;
+ delete this->simple_declarator_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Provides_Dcl::abs_storagehome_name (void) const
+{
+ return this->abs_storagehome_name_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Provides_Dcl::simple_declarator (void) const
+{
+ return this->simple_declarator_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Provides_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_provides_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Storagetype::TAO_PSDL_Storagetype (TAO_PSDL_Node *declaration)
+ : declaration_ (declaration)
+{
+}
+
+TAO_PSDL_Storagetype::~TAO_PSDL_Storagetype (void)
+{
+ delete this->declaration_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagetype::declaration (void) const
+{
+ return this->declaration_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagetype::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagetype (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Storagetype_Dcl::TAO_PSDL_Storagetype_Dcl (TAO_PSDL_Node *storagetype_header)
+ : storagetype_header_ (storagetype_header),
+ storagetype_body_ (0)
+{
+}
+
+TAO_PSDL_Storagetype_Dcl::TAO_PSDL_Storagetype_Dcl (
+ TAO_PSDL_Node *storagetype_header,
+ TAO_PSDL_Node *storagetype_body)
+ : storagetype_header_ (storagetype_header),
+ storagetype_body_ (storagetype_body)
+{
+}
+
+TAO_PSDL_Storagetype_Dcl::~TAO_PSDL_Storagetype_Dcl (void)
+{
+ delete this->storagetype_header_;
+ if (this->storagetype_body_ != 0)
+ delete this->storagetype_body_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagetype_Dcl::storagetype_header (void) const
+{
+ return this->storagetype_header_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Storagetype_Dcl::storagetype_body (void) const
+{
+ return this->storagetype_body_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagetype_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagetype_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Storagetype_Fwd_Dcl::TAO_PSDL_Storagetype_Fwd_Dcl (TAO_PSDL_Node *identifier)
+ : identifier_ (identifier)
+{
+}
+
+TAO_PSDL_Storagetype_Fwd_Dcl::~TAO_PSDL_Storagetype_Fwd_Dcl (void)
+{
+ delete this->identifier_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagetype_Fwd_Dcl::identifier (void) const
+{
+ return this->identifier_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagetype_Fwd_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagetype_fwd_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Storagetype_Header::TAO_PSDL_Storagetype_Header (
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *storagetype_inh_spec,
+ TAO_PSDL_Node *storagetype_impl_spec)
+ : identifier_ (identifier),
+ storagetype_inh_spec_ (storagetype_inh_spec),
+ storagetype_impl_spec_ (storagetype_impl_spec)
+{
+}
+
+TAO_PSDL_Storagetype_Header::TAO_PSDL_Storagetype_Header (
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *storagetype_inh_spec)
+ : identifier_ (identifier),
+ storagetype_inh_spec_ (storagetype_inh_spec),
+ storagetype_impl_spec_ (0)
+{
+}
+
+TAO_PSDL_Storagetype_Header::TAO_PSDL_Storagetype_Header (
+ TAO_PSDL_Node *identifier)
+ : identifier_ (identifier),
+ storagetype_inh_spec_ (0),
+ storagetype_impl_spec_ (0)
+{
+}
+
+TAO_PSDL_Storagetype_Header::~TAO_PSDL_Storagetype_Header (void)
+{
+ delete this->identifier_;
+ if (this->storagetype_inh_spec_ != 0)
+ delete this->storagetype_inh_spec_;
+
+ if (this->storagetype_impl_spec_ != 0)
+ delete this->storagetype_impl_spec_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagetype_Header::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Storagetype_Header::storagetype_inh_spec (void) const
+{
+ return this->storagetype_inh_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Storagetype_Header::storagetype_impl_spec (void) const
+{
+ return this->storagetype_impl_spec_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagetype_Header::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagetype_header (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Storagetype_Body::TAO_PSDL_Storagetype_Body ()
+ : storagetype_member_ (0),
+ storagetype_body_ (0)
+{
+}
+
+TAO_PSDL_Storagetype_Body::TAO_PSDL_Storagetype_Body (
+ TAO_PSDL_Node *storagetype_member)
+ : storagetype_member_ (storagetype_member),
+ storagetype_body_ (0)
+{
+}
+
+TAO_PSDL_Storagetype_Body::TAO_PSDL_Storagetype_Body (
+ TAO_PSDL_Node *storagetype_member,
+ TAO_PSDL_Node *storagetype_body)
+ : storagetype_member_ (storagetype_member),
+ storagetype_body_ (storagetype_body)
+{
+}
+
+TAO_PSDL_Storagetype_Body::~TAO_PSDL_Storagetype_Body (void)
+{
+ if (this->storagetype_member_ != 0)
+ delete this->storagetype_member_;
+ if (this->storagetype_body_ != 0)
+ delete this->storagetype_body_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagetype_Body::storagetype_member (void) const
+{
+ return this->storagetype_member_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Storagetype_Body::storagetype_body (void) const
+{
+ return this->storagetype_body_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagetype_Body::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagetype_body (this);
+}
+
+/// ****************************************************************
+
+
+TAO_PSDL_Storagetype_Member::TAO_PSDL_Storagetype_Member (TAO_PSDL_Node *declaration)
+ : declaration_ (declaration)
+{
+}
+
+TAO_PSDL_Storagetype_Member::~TAO_PSDL_Storagetype_Member (void)
+{
+ delete this->declaration_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagetype_Member::declaration (void) const
+{
+ return this->declaration_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagetype_Member::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagetype_member (this);
+}
+
+/// ****************************************************************
+
+
+TAO_PSDL_Storagetype_Inh_Spec::TAO_PSDL_Storagetype_Inh_Spec (TAO_PSDL_Node *storagetype_name)
+ : storagetype_name_ (storagetype_name)
+{
+}
+
+TAO_PSDL_Storagetype_Inh_Spec::~TAO_PSDL_Storagetype_Inh_Spec (void)
+{
+ delete this->storagetype_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagetype_Inh_Spec::storagetype_name (void) const
+{
+ return this->storagetype_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagetype_Inh_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagetype_inh_spec (this);
+}
+
+/// ****************************************************************
+
+
+TAO_PSDL_Storagetype_Name::TAO_PSDL_Storagetype_Name (TAO_PSDL_Node *scoped_name)
+ : scoped_name_ (scoped_name)
+{
+}
+
+TAO_PSDL_Storagetype_Name::~TAO_PSDL_Storagetype_Name (void)
+{
+ delete this->scoped_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagetype_Name::scoped_name (void) const
+{
+ return this->scoped_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagetype_Name::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagetype_name (this);
+}
+
+/// ****************************************************************
+
+
+TAO_PSDL_Storagetype_Impl_Spec::TAO_PSDL_Storagetype_Impl_Spec (TAO_PSDL_Node *abstract_storagetype_name)
+ : abstract_storagetype_name_ (abstract_storagetype_name)
+{
+}
+
+TAO_PSDL_Storagetype_Impl_Spec::~TAO_PSDL_Storagetype_Impl_Spec (void)
+{
+ delete this->abstract_storagetype_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagetype_Impl_Spec::abstract_storagetype_name (void) const
+{
+ return this->abstract_storagetype_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagetype_Impl_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagetype_impl_spec (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Storagetype_Ref_Type::TAO_PSDL_Storagetype_Ref_Type (TAO_PSDL_Node *storagetype_name)
+ : storagetype_name_ (storagetype_name)
+{
+}
+
+TAO_PSDL_Storagetype_Ref_Type::~TAO_PSDL_Storagetype_Ref_Type (void)
+{
+ delete this->storagetype_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagetype_Ref_Type::storagetype_name (void) const
+{
+ return this->storagetype_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagetype_Ref_Type::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagetype_ref_type (this);
+}
+
+/// ****************************************************************
+TAO_PSDL_Storagehome_Scope::TAO_PSDL_Storagehome_Scope (TAO_PSDL_Node *storagehome_name)
+ : storagehome_name_ (storagehome_name)
+{
+}
+
+TAO_PSDL_Storagehome_Scope::~TAO_PSDL_Storagehome_Scope (void)
+{
+ delete this->storagehome_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagehome_Scope::storagehome_name (void) const
+{
+ return this->storagehome_name_;
+}
+
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagehome_Scope::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagehome_scope (this);
+}
+
+/// ****************************************************************
+
+
+TAO_PSDL_Store_Directive::TAO_PSDL_Store_Directive (
+ TAO_PSDL_Node *simple_declarator,
+ TAO_PSDL_Node *psdl_concrete_state_type,
+ TAO_PSDL_Node *storagehome_scope)
+ : simple_declarator_ (simple_declarator),
+ psdl_concrete_state_type_ (psdl_concrete_state_type),
+ storagehome_scope_ (storagehome_scope)
+{
+}
+
+TAO_PSDL_Store_Directive::TAO_PSDL_Store_Directive (
+ TAO_PSDL_Node *simple_declarator,
+ TAO_PSDL_Node *psdl_concrete_state_type)
+ : simple_declarator_ (simple_declarator),
+ psdl_concrete_state_type_ (psdl_concrete_state_type),
+ storagehome_scope_ (0)
+{
+}
+
+TAO_PSDL_Store_Directive::~TAO_PSDL_Store_Directive (void)
+{
+ delete this->simple_declarator_;
+ delete this->psdl_concrete_state_type_;
+
+ if (this->storagehome_scope_ != 0)
+ delete this->storagehome_scope_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Store_Directive::simple_declarator (void) const
+{
+ return this->simple_declarator_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Store_Directive::psdl_concrete_state_type (void) const
+{
+ return this->psdl_concrete_state_type_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Store_Directive::storagehome_scope (void) const
+{
+ return this->storagehome_scope_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Store_Directive::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_store_directive (this);
+}
+
+/// ****************************************************************
+TAO_PSDL_Psdl_Concrete_State_Type::TAO_PSDL_Psdl_Concrete_State_Type (TAO_PSDL_Node *storagetype)
+ : storagetype_ (storagetype)
+{
+}
+
+TAO_PSDL_Psdl_Concrete_State_Type::~TAO_PSDL_Psdl_Concrete_State_Type (void)
+{
+ delete this->storagetype_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Psdl_Concrete_State_Type::storagetype (void) const
+{
+ return this->storagetype_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Psdl_Concrete_State_Type::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_psdl_concrete_state_type (this);
+}
+
+/// ****************************************************************
+TAO_PSDL_Ref_Rep_Directive::TAO_PSDL_Ref_Rep_Directive (TAO_PSDL_Node *simple_declarator)
+ : simple_declarator_ (simple_declarator)
+{
+}
+
+TAO_PSDL_Ref_Rep_Directive::~TAO_PSDL_Ref_Rep_Directive (void)
+{
+ delete this->simple_declarator_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Ref_Rep_Directive::simple_declarator (void) const
+{
+ return this->simple_declarator_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Ref_Rep_Directive::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_ref_rep_directive (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Storagehome::TAO_PSDL_Storagehome (TAO_PSDL_Node *storagehome_header)
+ : storagehome_header_ (storagehome_header),
+ storagehome_body_ (0)
+{
+}
+
+TAO_PSDL_Storagehome::TAO_PSDL_Storagehome (TAO_PSDL_Node *storagehome_header,
+ TAO_PSDL_Node *storagehome_body)
+ : storagehome_header_ (storagehome_header),
+ storagehome_body_ (storagehome_body)
+{
+}
+
+TAO_PSDL_Storagehome::~TAO_PSDL_Storagehome (void)
+{
+ delete this->storagehome_header_;
+ delete this->storagehome_body_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagehome::storagehome_header (void) const
+{
+ return this->storagehome_header_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Storagehome::storagehome_body (void) const
+{
+ return this->storagehome_body_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagehome::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagehome (this);
+}
+
+/// ****************************************************************
+TAO_PSDL_Storagehome_Header::TAO_PSDL_Storagehome_Header (
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *storagetype_name,
+ TAO_PSDL_Node *storagehome_inh_spec,
+ TAO_PSDL_Node *storagehome_impl_spec)
+ : identifier_ (identifier),
+ storagetype_name_ (storagetype_name),
+ storagehome_inh_spec_ (storagehome_inh_spec),
+ storagehome_impl_spec_ (storagehome_impl_spec)
+{
+}
+
+TAO_PSDL_Storagehome_Header::TAO_PSDL_Storagehome_Header (
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *storagetype_name,
+ TAO_PSDL_Node *storagehome_inh_spec)
+ : identifier_ (identifier),
+ storagetype_name_ (storagetype_name),
+ storagehome_inh_spec_ (storagehome_inh_spec),
+ storagehome_impl_spec_ (0)
+{
+}
+
+TAO_PSDL_Storagehome_Header::TAO_PSDL_Storagehome_Header (
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *storagetype_name)
+ : identifier_ (identifier),
+ storagetype_name_ (storagetype_name),
+ storagehome_inh_spec_ (0),
+ storagehome_impl_spec_ (0)
+{
+}
+
+TAO_PSDL_Storagehome_Header::~TAO_PSDL_Storagehome_Header (void)
+{
+ delete this->identifier_;
+ delete this->storagetype_name_;
+ delete this->storagehome_inh_spec_;
+ delete this->storagehome_impl_spec_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagehome_Header::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Storagehome_Header::storagetype_name (void) const
+{
+ return this->storagetype_name_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Storagehome_Header::storagehome_inh_spec (void) const
+{
+ return this->storagehome_inh_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Storagehome_Header::storagehome_impl_spec (void) const
+{
+ return this->storagehome_impl_spec_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagehome_Header::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagehome_header (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Storagehome_Body::TAO_PSDL_Storagehome_Body ()
+ : storagehome_member_ (0),
+ storagehome_body_ (0)
+{
+}
+
+TAO_PSDL_Storagehome_Body::TAO_PSDL_Storagehome_Body (
+ TAO_PSDL_Node *storagehome_member)
+ : storagehome_member_ (storagehome_member),
+ storagehome_body_ (0)
+{
+}
+
+TAO_PSDL_Storagehome_Body::TAO_PSDL_Storagehome_Body (
+ TAO_PSDL_Node *storagehome_member,
+ TAO_PSDL_Node *storagehome_body)
+ : storagehome_member_ (storagehome_member),
+ storagehome_body_ (storagehome_body)
+{
+}
+
+TAO_PSDL_Storagehome_Body::~TAO_PSDL_Storagehome_Body (void)
+{
+ delete this->storagehome_member_;
+ delete this->storagehome_body_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagehome_Body::storagehome_member (void) const
+{
+ return this->storagehome_member_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Storagehome_Body::storagehome_body (void) const
+{
+ return this->storagehome_body_;
+}
+
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagehome_Body::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagehome_body (this);
+}
+
+/// ****************************************************************
+
+
+TAO_PSDL_Storagehome_Member::TAO_PSDL_Storagehome_Member (
+ TAO_PSDL_Node *key_dcl)
+ : key_dcl_ (key_dcl)
+{
+}
+
+TAO_PSDL_Storagehome_Member::~TAO_PSDL_Storagehome_Member (void)
+{
+ delete this->key_dcl_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagehome_Member::key_dcl (void) const
+{
+ return this->key_dcl_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagehome_Member::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagehome_member (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Storagehome_Inh_Spec::TAO_PSDL_Storagehome_Inh_Spec (TAO_PSDL_Node *storagehome_name)
+ : storagehome_name_ (storagehome_name)
+{
+}
+
+TAO_PSDL_Storagehome_Inh_Spec::~TAO_PSDL_Storagehome_Inh_Spec (void)
+{
+ delete this->storagehome_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagehome_Inh_Spec::storagehome_name (void) const
+{
+ return this->storagehome_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagehome_Inh_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagehome_inh_spec (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Storagehome_Name::TAO_PSDL_Storagehome_Name (TAO_PSDL_Node *scoped_name)
+ : scoped_name_ (scoped_name)
+{
+}
+
+TAO_PSDL_Storagehome_Name::~TAO_PSDL_Storagehome_Name (void)
+{
+ delete this->scoped_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagehome_Name::scoped_name (void) const
+{
+ return this->scoped_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagehome_Name::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagehome_name (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Storagehome_Impl_Spec::TAO_PSDL_Storagehome_Impl_Spec (
+ TAO_PSDL_Node *abstract_storagehome_name)
+ : abstract_storagehome_name_ (abstract_storagehome_name)
+{
+}
+
+TAO_PSDL_Storagehome_Impl_Spec::~TAO_PSDL_Storagehome_Impl_Spec (void)
+{
+ delete this->abstract_storagehome_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Storagehome_Impl_Spec::abstract_storagehome_name (void) const
+{
+ return this->abstract_storagehome_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Storagehome_Impl_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_storagehome_impl_spec (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Primary_Key_Dcl::TAO_PSDL_Primary_Key_Dcl ()
+ : identifier_ (0)
+{
+}
+
+TAO_PSDL_Primary_Key_Dcl::TAO_PSDL_Primary_Key_Dcl (TAO_PSDL_Node *identifier)
+ : identifier_ (identifier)
+{
+}
+
+TAO_PSDL_Primary_Key_Dcl::~TAO_PSDL_Primary_Key_Dcl (void)
+{
+ delete this->identifier_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Primary_Key_Dcl::identifier (void) const
+{
+ return this->identifier_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Primary_Key_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_primary_key_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Identifier::TAO_PSDL_Identifier (char *value)
+ : value_ (CORBA::string_dup (value)),
+ value_type_ (0)
+{
+ TAO_PSDL_Scope::instance ()->save_identifier (value);
+}
+
+TAO_PSDL_Identifier::TAO_PSDL_Identifier (int value_type)
+ : value_type_ (value_type)
+{
+}
+
+TAO_PSDL_Identifier::~TAO_PSDL_Identifier (void)
+{
+ if (this->value_ != 0)
+ delete this->value_;
+}
+
+/// Get the value
+char *
+TAO_PSDL_Identifier::value (void) const
+{
+ return this->value_;
+}
+
+int
+TAO_PSDL_Identifier::value_type (void) const
+{
+ return this->value_type_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Identifier::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_identifier (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Type_Dcl::TAO_PSDL_Type_Dcl (TAO_PSDL_Node *type_of_type_dcl)
+ : key_word_ (0),
+ type_of_type_dcl_ (type_of_type_dcl)
+{
+}
+
+TAO_PSDL_Type_Dcl::TAO_PSDL_Type_Dcl (int key_word,
+ TAO_PSDL_Node *type_of_type_dcl)
+ : key_word_ (key_word),
+ type_of_type_dcl_ (type_of_type_dcl)
+{
+ this->type_ = key_word;
+
+ this->psdl_scope_visitor ()->visit_type_dcl (this);
+
+ // @@ why this if loop
+ if (ACE_OS::strcmp (this->identifiers_[0].c_str (), "") == 0)
+ {
+ this->identifiers_[0] = this->psdl_scope_visitor ()->get_scoped_type ();
+ }
+
+ if (key_word != TAO_PSDL_TYPEDEF)
+ {
+ this->psdl_scope ()->check_name_in_scope (this->identifiers_[0],
+ this->psdl_scope ());
+ }
+
+ this->psdl_scope ()->add_typedef (this->identifiers_[1],
+ this->identifiers_[0]);
+
+ // We dont these values of the identifiers anymore as they have been
+ // added to the corresponding AST. So, set count to 'zero' again.
+ this->count_ = 0;
+
+}
+
+TAO_PSDL_Type_Dcl::~TAO_PSDL_Type_Dcl (void)
+{
+ delete this->type_of_type_dcl_;
+}
+
+/// Get the value
+int
+TAO_PSDL_Type_Dcl::key_word (void) const
+{
+ return this->key_word_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Type_Dcl::type_of_type_dcl (void) const
+{
+ return this->type_of_type_dcl_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Type_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_type_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Type_Declarator::TAO_PSDL_Type_Declarator (TAO_PSDL_Node *type_spec,
+ TAO_PSDL_Node *declarators)
+ : type_spec_ (type_spec),
+ declarators_ (declarators)
+{
+}
+
+TAO_PSDL_Type_Declarator::~TAO_PSDL_Type_Declarator (void)
+{
+ delete this->type_spec_;
+ delete this->declarators_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Type_Declarator::type_spec (void) const
+{
+ return this->type_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Type_Declarator::declarators (void) const
+{
+ return this->declarators_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Type_Declarator::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_type_declarator (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Type_Spec::TAO_PSDL_Type_Spec (TAO_PSDL_Node *type_of_type_spec)
+ : type_of_type_spec_ (type_of_type_spec)
+{
+}
+
+TAO_PSDL_Type_Spec::~TAO_PSDL_Type_Spec (void)
+{
+ delete this->type_of_type_spec_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Type_Spec::type_of_type_spec (void) const
+{
+ return this->type_of_type_spec_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Type_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_type_spec (this);
+}
+
+/// ****************************************************************
+TAO_PSDL_Simple_Type_Spec::TAO_PSDL_Simple_Type_Spec (TAO_PSDL_Node *type_of_simple_type_spec)
+ : type_of_simple_type_spec_ (type_of_simple_type_spec)
+{
+}
+
+TAO_PSDL_Simple_Type_Spec::~TAO_PSDL_Simple_Type_Spec (void)
+{
+ delete this->type_of_simple_type_spec_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Simple_Type_Spec::type_of_simple_type_spec (void) const
+{
+ return this->type_of_simple_type_spec_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Simple_Type_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_simple_type_spec (this);
+}
+
+/// ****************************************************************
+TAO_PSDL_Base_Type_Spec::TAO_PSDL_Base_Type_Spec (
+ TAO_PSDL_Node *type_of_base_type_spec)
+ : type_of_base_type_spec_ (type_of_base_type_spec)
+{
+}
+
+TAO_PSDL_Base_Type_Spec::~TAO_PSDL_Base_Type_Spec (void)
+{
+ delete this->type_of_base_type_spec_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Base_Type_Spec::type_of_base_type_spec (void) const
+{
+ return this->type_of_base_type_spec_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Base_Type_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_base_type_spec (this);
+}
+
+/// ****************************************************************
+TAO_PSDL_Template_Type_Spec::TAO_PSDL_Template_Type_Spec (
+ TAO_PSDL_Node *type_of_template_type_spec)
+ : type_of_template_type_spec_ (type_of_template_type_spec)
+{
+}
+
+TAO_PSDL_Template_Type_Spec::~TAO_PSDL_Template_Type_Spec (void)
+{
+ delete this->type_of_template_type_spec_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Template_Type_Spec::type_of_template_type_spec (void) const
+{
+ return this->type_of_template_type_spec_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Template_Type_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_template_type_spec (this);
+}
+
+/// ***********************************************************
+
+TAO_PSDL_Constr_Type_Spec::TAO_PSDL_Constr_Type_Spec (
+ TAO_PSDL_Node *type_of_constr_type_spec)
+ : type_of_constr_type_spec_ (type_of_constr_type_spec)
+{
+}
+
+TAO_PSDL_Constr_Type_Spec::~TAO_PSDL_Constr_Type_Spec (void)
+{
+ delete this->type_of_constr_type_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Constr_Type_Spec::type_of_constr_type_spec (void) const
+{
+ return this->type_of_constr_type_spec_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Constr_Type_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_constr_type_spec (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Declarators::TAO_PSDL_Declarators (TAO_PSDL_Node *declarator)
+ : declarator_ (declarator),
+ set_of_declarators_ (0)
+{
+}
+
+TAO_PSDL_Declarators::TAO_PSDL_Declarators (TAO_PSDL_Node *declarator,
+ TAO_PSDL_Node *set_of_declarators)
+ : declarator_ (declarator),
+ set_of_declarators_ (set_of_declarators)
+{
+}
+
+TAO_PSDL_Declarators::~TAO_PSDL_Declarators (void)
+{
+ delete this->declarator_;
+
+ if (this->set_of_declarators_ != 0)
+ delete this->set_of_declarators_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Declarators::declarator (void) const
+{
+ return this->declarator_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Declarators::set_of_declarators (void) const
+{
+ return this->set_of_declarators_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Declarators::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_declarators (this);
+}
+
+/// ****************************************************************
+TAO_PSDL_Declarator::TAO_PSDL_Declarator (TAO_PSDL_Node *type_of_declarator)
+ : type_of_declarator_ (type_of_declarator)
+{
+}
+
+TAO_PSDL_Declarator::~TAO_PSDL_Declarator (void)
+{
+ delete this->type_of_declarator_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Declarator::type_of_declarator (void) const
+{
+ return this->type_of_declarator_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Declarator::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_declarator (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Simple_Declarator::TAO_PSDL_Simple_Declarator (
+ TAO_PSDL_Node *identifier)
+ : identifier_ (identifier),
+ simple_declarator_ (0)
+{
+}
+
+TAO_PSDL_Simple_Declarator::TAO_PSDL_Simple_Declarator (
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *simple_declarator)
+ : identifier_ (identifier),
+ simple_declarator_ (simple_declarator)
+{
+}
+
+TAO_PSDL_Simple_Declarator::~TAO_PSDL_Simple_Declarator (void)
+{
+ delete this->identifier_;
+
+ if (this->simple_declarator_ != 0)
+ delete this->simple_declarator_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Simple_Declarator::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Simple_Declarator::simple_declarator (void) const
+{
+ return this->simple_declarator_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Simple_Declarator::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_simple_declarator (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Simple_Declarator_List::TAO_PSDL_Simple_Declarator_List (
+ TAO_PSDL_Node *simple_declarator)
+ : simple_declarator_list_ (0),
+ simple_declarator_ (simple_declarator)
+{
+}
+
+TAO_PSDL_Simple_Declarator_List::TAO_PSDL_Simple_Declarator_List (
+ TAO_PSDL_Node *simple_declarator_list,
+ TAO_PSDL_Node *simple_declarator)
+ : simple_declarator_list_ (simple_declarator_list),
+ simple_declarator_ (simple_declarator)
+{
+}
+
+TAO_PSDL_Simple_Declarator_List::~TAO_PSDL_Simple_Declarator_List (void)
+{
+ if (this->simple_declarator_list_ != 0)
+ delete this->simple_declarator_list_;
+
+ if (this->simple_declarator_ != 0)
+ delete this->simple_declarator_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Simple_Declarator_List::simple_declarator_list (void) const
+{
+ return this->simple_declarator_list_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Simple_Declarator_List::simple_declarator (void) const
+{
+ return this->simple_declarator_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Simple_Declarator_List::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_simple_declarator_list (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Complex_Declarator::TAO_PSDL_Complex_Declarator (TAO_PSDL_Node *array_declarator)
+ : array_declarator_ (array_declarator)
+{
+}
+
+TAO_PSDL_Complex_Declarator::~TAO_PSDL_Complex_Declarator (void)
+{
+ delete this->array_declarator_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Complex_Declarator::array_declarator (void) const
+{
+ return this->array_declarator_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Complex_Declarator::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_complex_declarator (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Predefined_Type::TAO_PSDL_Predefined_Type (int type_one)
+ : type_one_ (type_one),
+ type_two_ (0),
+ type_three_ (0),
+ type_of_variable_one_ (0),
+ type_of_variable_two_ (0),
+ type_of_variable_three_ (0)
+{
+}
+
+TAO_PSDL_Predefined_Type::TAO_PSDL_Predefined_Type (int type_one,
+ int type_two)
+ : type_one_ (type_one),
+ type_two_ (type_two),
+ type_three_ (0),
+ type_of_variable_one_ (0),
+ type_of_variable_two_ (0),
+ type_of_variable_three_ (0)
+{
+}
+
+TAO_PSDL_Predefined_Type::TAO_PSDL_Predefined_Type (int type_one,
+ int type_two,
+ int type_three)
+ : type_one_ (type_one),
+ type_two_ (type_two),
+ type_three_ (type_three),
+ type_of_variable_one_ (0),
+ type_of_variable_two_ (0),
+ type_of_variable_three_ (0)
+{
+}
+
+TAO_PSDL_Predefined_Type::TAO_PSDL_Predefined_Type (int type_one,
+ TAO_PSDL_Node *type_of_variable_one)
+ : type_one_ (type_one),
+ type_two_ (0),
+ type_three_ (0),
+ type_of_variable_one_ (type_of_variable_one),
+ type_of_variable_two_ (0),
+ type_of_variable_three_ (0)
+{
+}
+
+TAO_PSDL_Predefined_Type::TAO_PSDL_Predefined_Type (TAO_PSDL_Node *type_of_variable_one)
+ : type_one_ (0),
+ type_two_ (0),
+ type_three_ (0),
+ type_of_variable_one_ (type_of_variable_one),
+ type_of_variable_two_ (0),
+ type_of_variable_three_ (0)
+{
+}
+
+TAO_PSDL_Predefined_Type::TAO_PSDL_Predefined_Type (TAO_PSDL_Node *type_of_variable_one,
+ TAO_PSDL_Node *type_of_variable_two)
+ : type_one_ (0),
+ type_two_ (0),
+ type_three_ (0),
+ type_of_variable_one_ (type_of_variable_one),
+ type_of_variable_two_ (type_of_variable_two),
+ type_of_variable_three_ (0)
+{
+ this->psdl_scope_visitor ()->visit_predefined_type (this);
+ /*
+ this->psdl_scope ()->add_enum_decl (this->identifier_value_,
+ this->identifier_type_);
+ */
+}
+
+TAO_PSDL_Predefined_Type::TAO_PSDL_Predefined_Type (int type_one,
+ TAO_PSDL_Node *type_of_variable_one,
+ TAO_PSDL_Node *type_of_variable_two)
+ : type_one_ (type_one),
+ type_two_ (0),
+ type_three_ (0),
+ type_of_variable_one_ (type_of_variable_one),
+ type_of_variable_two_ (type_of_variable_two),
+ type_of_variable_three_ (0)
+{
+ // @@ I am not sure if it is needed. This is nto needed in case fo
+ // structs atleast. So, I will check it that it doesnt happen in
+ // case of structs. Or rather will comment it out and will check
+ // later if need arised by.
+ // this->psdl_scope_visitor ()->visit_predefined_type (this);
+
+ /* if (this->type_one_ == TAO_PSDL_ENUM)
+ {
+ this->psdl_scope ()->add_enum_decl (this->identifier_type_,
+ "enum");
+ }
+ */
+}
+
+TAO_PSDL_Predefined_Type::TAO_PSDL_Predefined_Type (
+ TAO_PSDL_Node *type_of_variable_one,
+ TAO_PSDL_Node *type_of_variable_two,
+ TAO_PSDL_Node *type_of_variable_three)
+ : type_one_ (0),
+ type_two_ (0),
+ type_three_ (0),
+ type_of_variable_one_ (type_of_variable_one),
+ type_of_variable_two_ (type_of_variable_two),
+ type_of_variable_three_ (type_of_variable_three)
+{
+}
+
+TAO_PSDL_Predefined_Type::~TAO_PSDL_Predefined_Type (void)
+{
+ if (this->type_of_variable_one_ != 0)
+ delete this->type_of_variable_one_;
+ if (this->type_of_variable_two_ != 0)
+ delete this->type_of_variable_two_;
+ if (this->type_of_variable_three_ != 0)
+ delete this->type_of_variable_three_;
+}
+
+/// Get the value
+int
+TAO_PSDL_Predefined_Type::type_one (void) const
+{
+ return this->type_one_;
+}
+
+int
+TAO_PSDL_Predefined_Type::type_two (void) const
+{
+ return this->type_two_;
+}
+
+int
+TAO_PSDL_Predefined_Type::type_three (void) const
+{
+ return this->type_three_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Predefined_Type::type_of_variable_one (void) const
+{
+ return this->type_of_variable_one_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Predefined_Type::type_of_variable_two (void) const
+{
+ return this->type_of_variable_two_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Predefined_Type::type_of_variable_three (void) const
+{
+ return this->type_of_variable_three_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Predefined_Type::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_predefined_type (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Member_List::TAO_PSDL_Member_List (TAO_PSDL_Node *member)
+ : member_ (member),
+ member_list_ (0)
+{
+}
+
+TAO_PSDL_Member_List::TAO_PSDL_Member_List (TAO_PSDL_Node *member,
+ TAO_PSDL_Node *member_list)
+ : member_ (member),
+ member_list_ (member_list)
+{
+}
+
+TAO_PSDL_Member_List::~TAO_PSDL_Member_List (void)
+{
+ delete this->member_;
+
+ if (this->member_list_ != 0)
+ delete this->member_list_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Member_List::member (void) const
+{
+ return this->member_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Member_List::member_list (void) const
+{
+ return this->member_list_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Member_List::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_member_list (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Member::TAO_PSDL_Member (TAO_PSDL_Node *type_spec,
+ TAO_PSDL_Node *declarators)
+ : type_spec_ (type_spec),
+ declarators_ (declarators)
+{
+ this->psdl_scope_visitor ()->visit_member (this);
+
+ if (this->predefined_type_)
+ {
+ // This is a predefined type. So, no need to check. But, reset the
+ // value to the default value.
+ this->predefined_type_ = 0;
+ }
+ else
+ {
+ // This is a user-defined type. So, check if it has already been
+ // defined.
+ this->psdl_scope ()->check_name_in_scope (this->identifiers_[0],
+ this->psdl_scope ());
+ }
+
+ this->psdl_scope ()->add_member_decl (this->identifiers_[1],
+ this->identifiers_[0]);
+
+ // We dont these values of the identifiers anymore as they have been
+ // added to the corresponding AST. So, set count to 'zero' again.
+ this->count_ = 0;
+}
+
+TAO_PSDL_Member::~TAO_PSDL_Member (void)
+{
+ delete this->type_spec_;
+ delete this->declarators_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Member::type_spec (void) const
+{
+ return this->type_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Member::declarators (void) const
+{
+ return this->declarators_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Member::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_member (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Union_Type::TAO_PSDL_Union_Type (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *switch_type_spec,
+ TAO_PSDL_Node *switch_body)
+ : identifier_ (identifier),
+ switch_type_spec_ (switch_type_spec),
+ switch_body_ (switch_body)
+{
+}
+
+TAO_PSDL_Union_Type::~TAO_PSDL_Union_Type (void)
+{
+ delete this->identifier_;
+ delete this->switch_type_spec_;
+ delete this->switch_body_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Union_Type::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Union_Type::switch_type_spec (void) const
+{
+ return this->switch_type_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Union_Type::switch_body (void) const
+{
+ return this->switch_body_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Union_Type::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_union_type (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Switch_Type_Spec::TAO_PSDL_Switch_Type_Spec (TAO_PSDL_Node *type)
+ : type_ (type)
+{
+}
+
+TAO_PSDL_Switch_Type_Spec::~TAO_PSDL_Switch_Type_Spec (void)
+{
+ delete this->type_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Switch_Type_Spec::type (void) const
+{
+ return this->type_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Switch_Type_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_switch_type_spec (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Switch_Body::TAO_PSDL_Switch_Body (TAO_PSDL_Node *switch_case)
+ : switch_case_ (switch_case),
+ switch_body_ (0)
+{
+}
+
+TAO_PSDL_Switch_Body::TAO_PSDL_Switch_Body (TAO_PSDL_Node *switch_case,
+ TAO_PSDL_Node *switch_body)
+ : switch_case_ (switch_case),
+ switch_body_ (switch_body)
+{
+}
+
+TAO_PSDL_Switch_Body::~TAO_PSDL_Switch_Body (void)
+{
+ delete this->switch_case_;
+ delete this->switch_body_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Switch_Body::switch_case (void) const
+{
+ return this->switch_case_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Switch_Body::switch_body (void) const
+{
+ return this->switch_body_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Switch_Body::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_switch_body (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Case::TAO_PSDL_Case (TAO_PSDL_Node *case_label,
+ TAO_PSDL_Node *element_spec)
+ : case_label_ (case_label),
+ element_spec_ (element_spec)
+{
+}
+
+TAO_PSDL_Case::~TAO_PSDL_Case (void)
+{
+ delete this->case_label_;
+ delete this->element_spec_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Case::case_label (void) const
+{
+ return this->case_label_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Case::element_spec (void) const
+{
+ return this->element_spec_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Case::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_case_case (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Case_Label::TAO_PSDL_Case_Label (TAO_PSDL_Node * type)
+ : type_ (type),
+ const_exp_ (0),
+ case_label_ (0)
+{
+}
+
+TAO_PSDL_Case_Label::TAO_PSDL_Case_Label (TAO_PSDL_Node * type,
+ TAO_PSDL_Node *const_exp)
+ : type_ (type),
+ const_exp_ (const_exp),
+ case_label_ (0)
+{
+}
+
+TAO_PSDL_Case_Label::TAO_PSDL_Case_Label (TAO_PSDL_Node * type,
+ TAO_PSDL_Node *const_exp,
+ TAO_PSDL_Node *case_label)
+ : type_ (type),
+ const_exp_ (const_exp),
+ case_label_ (case_label)
+{
+}
+
+TAO_PSDL_Case_Label::~TAO_PSDL_Case_Label (void)
+{
+ if (this->const_exp_ != 0)
+ delete this->const_exp_;
+
+ if (this->case_label_ != 0)
+ delete this->case_label_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Case_Label::type (void) const
+{
+ return this->type_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Case_Label::const_exp (void) const
+{
+ return this->const_exp_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Case_Label::case_label (void) const
+{
+ return this->case_label_;
+}
+
+int
+TAO_PSDL_Case_Label::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_case_label (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Element_Spec::TAO_PSDL_Element_Spec (TAO_PSDL_Node *type_spec,
+ TAO_PSDL_Node *declarator)
+ : type_spec_ (type_spec),
+ declarator_ (declarator)
+{
+}
+
+TAO_PSDL_Element_Spec::~TAO_PSDL_Element_Spec (void)
+{
+ delete this->type_spec_;
+ delete this->declarator_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Element_Spec::type_spec (void) const
+{
+ return this->type_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Element_Spec::declarator (void) const
+{
+ return this->declarator_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Element_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_element_spec (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Const_Dcl::TAO_PSDL_Const_Dcl (TAO_PSDL_Node *const_type,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *const_exp)
+ : const_type_ (const_type),
+ identifier_ (identifier),
+ const_exp_ (const_exp)
+{
+ this->psdl_scope_visitor ()->visit_const_dcl (this);
+
+ this->psdl_scope ()->add_const_decl (this->identifiers_[1],
+ this->identifiers_[0]);
+
+ // We dont these values of the identifiers anymore as they have been
+ // added to the corresponding AST. So, set count to 'zero' again.
+ this->count_ = 0;
+
+}
+
+TAO_PSDL_Const_Dcl::~TAO_PSDL_Const_Dcl (void)
+{
+ delete this->const_type_;
+ delete this->identifier_;
+ delete this->const_exp_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Const_Dcl::const_type (void) const
+{
+ return this->const_type_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Const_Dcl::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Const_Dcl::const_exp (void) const
+{
+ return this->const_exp_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Const_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_const_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Const_Type::TAO_PSDL_Const_Type (TAO_PSDL_Node *type)
+ : type_ (type)
+{
+}
+
+TAO_PSDL_Const_Type::~TAO_PSDL_Const_Type (void)
+{
+ delete this->type_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Const_Type::type (void) const
+{
+ return this->type_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Const_Type::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_const_type (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Const_Exp::TAO_PSDL_Const_Exp (TAO_PSDL_Node *expr)
+ : expr_ (expr)
+{
+}
+
+TAO_PSDL_Const_Exp::~TAO_PSDL_Const_Exp (void)
+{
+ delete this->expr_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Const_Exp::expr (void) const
+{
+ return this->expr_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Const_Exp::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_const_exp (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Or_Expr::TAO_PSDL_Or_Expr (TAO_PSDL_Node *xor_expr)
+ : or_expr_ (0),
+ xor_expr_ (xor_expr)
+{
+}
+
+TAO_PSDL_Or_Expr::TAO_PSDL_Or_Expr (TAO_PSDL_Node *or_expr,
+ TAO_PSDL_Node *xor_expr)
+ : or_expr_ (or_expr),
+ xor_expr_ (xor_expr)
+{
+}
+
+TAO_PSDL_Or_Expr::~TAO_PSDL_Or_Expr (void)
+{
+ if (this->or_expr_ != 0)
+ delete this->or_expr_;
+
+ delete this->xor_expr_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Or_Expr::or_expr (void) const
+{
+ return this->or_expr_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Or_Expr::xor_expr (void) const
+{
+ return this->xor_expr_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Or_Expr::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_or_expr (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Xor_Expr::TAO_PSDL_Xor_Expr (TAO_PSDL_Node *and_expr)
+ : xor_expr_ (0),
+ and_expr_ (and_expr)
+{
+}
+
+TAO_PSDL_Xor_Expr::TAO_PSDL_Xor_Expr (TAO_PSDL_Node *xor_expr,
+ TAO_PSDL_Node *and_expr)
+ : xor_expr_ (xor_expr),
+ and_expr_ (and_expr)
+{
+}
+
+TAO_PSDL_Xor_Expr::~TAO_PSDL_Xor_Expr (void)
+{
+ if (this->xor_expr_ != 0)
+ delete this->xor_expr_;
+
+ delete this->and_expr_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Xor_Expr::xor_expr (void) const
+{
+ return this->xor_expr_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Xor_Expr::and_expr (void) const
+{
+ return this->and_expr_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Xor_Expr::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_xor_expr (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_And_Expr::TAO_PSDL_And_Expr (TAO_PSDL_Node *shift_expr)
+ : and_expr_ (0),
+ shift_expr_ (shift_expr)
+{
+}
+
+TAO_PSDL_And_Expr::TAO_PSDL_And_Expr (TAO_PSDL_Node *and_expr,
+ TAO_PSDL_Node *shift_expr)
+ : and_expr_ (and_expr),
+ shift_expr_ (shift_expr)
+{
+}
+
+TAO_PSDL_And_Expr::~TAO_PSDL_And_Expr (void)
+{
+ if (this->shift_expr_ != 0)
+ delete this->shift_expr_;
+
+ delete this->and_expr_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_And_Expr::and_expr (void) const
+{
+ return this->and_expr_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_And_Expr::shift_expr (void) const
+{
+ return this->shift_expr_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_And_Expr::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_and_expr (this);
+}
+
+/// ****************************************************************
+TAO_PSDL_Shift_Expr::TAO_PSDL_Shift_Expr (TAO_PSDL_Node *add_expr)
+ : shift_expr_ (0),
+ type_ (0),
+ add_expr_ (add_expr)
+{
+}
+
+TAO_PSDL_Shift_Expr::TAO_PSDL_Shift_Expr (TAO_PSDL_Node *shift_expr,
+ TAO_PSDL_Node * type,
+ TAO_PSDL_Node *add_expr)
+ : shift_expr_ (shift_expr),
+ type_ (type),
+ add_expr_ (add_expr)
+{
+}
+
+TAO_PSDL_Shift_Expr::~TAO_PSDL_Shift_Expr (void)
+{
+ if (this->shift_expr_ != 0)
+ delete this->shift_expr_;
+
+ delete this->add_expr_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Shift_Expr::type (void) const
+{
+ return this->type_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Shift_Expr::add_expr (void) const
+{
+ return this->add_expr_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Shift_Expr::shift_expr (void) const
+{
+ return this->shift_expr_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Shift_Expr::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_shift_expr (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Add_Expr::TAO_PSDL_Add_Expr (TAO_PSDL_Node *mult_expr)
+ : add_expr_ (0),
+ type_ (0),
+ mult_expr_ (mult_expr)
+{
+}
+
+TAO_PSDL_Add_Expr::TAO_PSDL_Add_Expr (TAO_PSDL_Node *add_expr,
+ TAO_PSDL_Node * type,
+ TAO_PSDL_Node *mult_expr)
+ : add_expr_ (add_expr),
+ type_ (type),
+ mult_expr_ (mult_expr)
+{
+}
+
+TAO_PSDL_Add_Expr::~TAO_PSDL_Add_Expr (void)
+{
+ if (this->add_expr_ != 0)
+ delete this->add_expr_;
+
+ delete this->mult_expr_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Add_Expr::type (void) const
+{
+ return this->type_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Add_Expr::add_expr (void) const
+{
+ return this->add_expr_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Add_Expr::mult_expr (void) const
+{
+ return this->mult_expr_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Add_Expr::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_add_expr (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Mult_Expr::TAO_PSDL_Mult_Expr (TAO_PSDL_Node *unary_expr)
+ : mult_expr_ (0),
+ type_ (0),
+ unary_expr_ (unary_expr)
+{
+}
+
+TAO_PSDL_Mult_Expr::TAO_PSDL_Mult_Expr (TAO_PSDL_Node *mult_expr,
+ TAO_PSDL_Node *unary_expr)
+ : mult_expr_ (mult_expr),
+ type_ (0),
+ unary_expr_ (unary_expr)
+{
+}
+
+TAO_PSDL_Mult_Expr::TAO_PSDL_Mult_Expr (TAO_PSDL_Node *mult_expr,
+ TAO_PSDL_Node * type,
+ TAO_PSDL_Node *unary_expr)
+ : mult_expr_ (mult_expr),
+ type_ (type),
+ unary_expr_ (unary_expr)
+{
+}
+
+TAO_PSDL_Mult_Expr::~TAO_PSDL_Mult_Expr (void)
+{
+ if (this->mult_expr_ != 0)
+ delete this->mult_expr_;
+
+ if (this->type_ != 0)
+ delete this->type_;
+
+ delete this->unary_expr_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Mult_Expr::type (void) const
+{
+ return this->type_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Mult_Expr::unary_expr (void) const
+{
+ return this->unary_expr_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Mult_Expr::mult_expr (void) const
+{
+ return this->mult_expr_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Mult_Expr::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_mult_expr (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Unary_Expr::TAO_PSDL_Unary_Expr (TAO_PSDL_Node *unary_operator,
+ TAO_PSDL_Node *primary_expr)
+ : unary_operator_ (unary_operator),
+ primary_expr_ (primary_expr)
+{
+}
+
+TAO_PSDL_Unary_Expr::TAO_PSDL_Unary_Expr (TAO_PSDL_Node *primary_expr)
+ : unary_operator_ (0),
+ primary_expr_ (primary_expr)
+{
+}
+
+TAO_PSDL_Unary_Expr::~TAO_PSDL_Unary_Expr (void)
+{
+ if (this->unary_operator_ != 0)
+ delete this->unary_operator_;
+
+ delete this->primary_expr_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Unary_Expr::unary_operator (void) const
+{
+ return this->unary_operator_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Unary_Expr::primary_expr (void) const
+{
+ return this->primary_expr_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Unary_Expr::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_unary_expr (this);
+}
+
+/// ****************************************************************
+TAO_PSDL_Primary_Expr::TAO_PSDL_Primary_Expr (TAO_PSDL_Node *type_of_primary_expr)
+ : type_of_primary_expr_ (type_of_primary_expr)
+{
+}
+
+TAO_PSDL_Primary_Expr::~TAO_PSDL_Primary_Expr (void)
+{
+ delete this->type_of_primary_expr_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Primary_Expr::type_of_primary_expr (void) const
+{
+ return this->type_of_primary_expr_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Primary_Expr::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_primary_expr (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Except_Dcl::TAO_PSDL_Except_Dcl (TAO_PSDL_Node *identifier)
+ : identifier_ (identifier),
+ member_list_ (0)
+{
+}
+
+TAO_PSDL_Except_Dcl::TAO_PSDL_Except_Dcl (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *member_list)
+ : identifier_ (identifier),
+ member_list_ (member_list)
+{
+}
+
+TAO_PSDL_Except_Dcl::~TAO_PSDL_Except_Dcl (void)
+{
+ delete this->identifier_;
+ if (this->member_list_ != 0)
+ delete this->member_list_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Except_Dcl::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Except_Dcl::member_list (void) const
+{
+ return this->member_list_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Except_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_except_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Op_Dcl::TAO_PSDL_Op_Dcl (TAO_PSDL_Node *op_attribute,
+ TAO_PSDL_Node *op_type_spec,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node * parameter_dcls,
+ TAO_PSDL_Node * raises_expr,
+ TAO_PSDL_Node * context_expr)
+ : op_attribute_ (op_attribute),
+ op_type_spec_ (op_type_spec),
+ identifier_ (identifier),
+ parameter_dcls_ (parameter_dcls),
+ raises_expr_ (raises_expr),
+ context_expr_ (context_expr)
+{
+}
+
+TAO_PSDL_Op_Dcl::TAO_PSDL_Op_Dcl (TAO_PSDL_Node *op_type_spec,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node * parameter_dcls,
+ TAO_PSDL_Node * raises_expr,
+ TAO_PSDL_Node * context_expr)
+ : op_attribute_ (0),
+ op_type_spec_ (op_type_spec),
+ identifier_ (identifier),
+ parameter_dcls_ (parameter_dcls),
+ raises_expr_ (raises_expr),
+ context_expr_ (context_expr)
+{
+}
+
+TAO_PSDL_Op_Dcl::TAO_PSDL_Op_Dcl (TAO_PSDL_Node *op_type_spec,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node * parameter_dcls,
+ TAO_PSDL_Node * raises_expr)
+ : op_attribute_ (0),
+ op_type_spec_ (op_type_spec),
+ identifier_ (identifier),
+ parameter_dcls_ (parameter_dcls),
+ raises_expr_ (raises_expr),
+ context_expr_ (0)
+{
+}
+
+TAO_PSDL_Op_Dcl::TAO_PSDL_Op_Dcl (TAO_PSDL_Node *op_type_spec,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node * parameter_dcls)
+ : op_attribute_ (0),
+ op_type_spec_ (op_type_spec),
+ identifier_ (identifier),
+ parameter_dcls_ (parameter_dcls),
+ raises_expr_ (0),
+ context_expr_ (0)
+{
+}
+
+TAO_PSDL_Op_Dcl::~TAO_PSDL_Op_Dcl (void)
+{
+ if (this->op_attribute_ != 0)
+ delete this->op_attribute_;
+
+ delete this->op_type_spec_;
+ delete this->identifier_;
+ delete this->parameter_dcls_;
+
+ if (this->raises_expr_ != 0)
+ delete this->raises_expr_;
+
+ if (this->context_expr_ != 0)
+ delete this->context_expr_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Op_Dcl::op_attribute (void) const
+{
+ return this->op_attribute_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Op_Dcl::op_type_spec (void) const
+{
+ return this->op_type_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Op_Dcl::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Op_Dcl::parameter_dcls (void) const
+{
+ return this->parameter_dcls_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Op_Dcl::raises_expr (void) const
+{
+ return this->raises_expr_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Op_Dcl::context_expr (void) const
+{
+ return this->context_expr_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Op_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_op_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Op_Type_Spec::TAO_PSDL_Op_Type_Spec (TAO_PSDL_Node *type_spec)
+ : type_spec_ (type_spec),
+ type_ (0)
+{
+}
+
+TAO_PSDL_Op_Type_Spec::TAO_PSDL_Op_Type_Spec (int type)
+ : type_spec_ (0),
+ type_ (type)
+{
+}
+
+TAO_PSDL_Op_Type_Spec::~TAO_PSDL_Op_Type_Spec (void)
+{
+ if (this->type_spec_ != 0)
+ delete this->type_spec_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Op_Type_Spec::type_spec (void) const
+{
+ return this->type_spec_;
+}
+
+int
+TAO_PSDL_Op_Type_Spec::type (void) const
+{
+ return this->type_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Op_Type_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_op_type_spec (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Parameter_Dcls::TAO_PSDL_Parameter_Dcls ()
+ : param_dcl_ (0)
+{
+}
+
+TAO_PSDL_Parameter_Dcls::TAO_PSDL_Parameter_Dcls (TAO_PSDL_Node *param_dcl)
+ : param_dcl_ (param_dcl)
+{
+}
+
+TAO_PSDL_Parameter_Dcls::~TAO_PSDL_Parameter_Dcls (void)
+{
+ delete this->param_dcl_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Parameter_Dcls::param_dcl (void) const
+{
+ return this->param_dcl_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Parameter_Dcls::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_parameter_dcls (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Param_Dcl::TAO_PSDL_Param_Dcl (TAO_PSDL_Node *param_attribute,
+ TAO_PSDL_Node *param_type_spec,
+ TAO_PSDL_Node *simple_declarator)
+ : param_attribute_ (param_attribute),
+ param_type_spec_ (param_type_spec),
+ simple_declarator_ (simple_declarator),
+ param_dcl_ (0)
+{
+}
+
+TAO_PSDL_Param_Dcl::TAO_PSDL_Param_Dcl (TAO_PSDL_Node *param_attribute,
+ TAO_PSDL_Node *param_type_spec,
+ TAO_PSDL_Node *simple_declarator,
+ TAO_PSDL_Node *param_dcl)
+ : param_attribute_ (param_attribute),
+ param_type_spec_ (param_type_spec),
+ simple_declarator_ (simple_declarator),
+ param_dcl_ (param_dcl)
+{
+}
+
+TAO_PSDL_Param_Dcl::~TAO_PSDL_Param_Dcl (void)
+{
+ delete this->param_attribute_;
+ delete this->param_type_spec_;
+ delete this->simple_declarator_;
+
+ if (this->param_dcl_ != 0)
+ delete this->param_dcl_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Param_Dcl::param_attribute (void) const
+{
+ return this->param_attribute_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Param_Dcl::param_type_spec (void) const
+{
+ return this->param_type_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Param_Dcl::simple_declarator (void) const
+{
+ return this->simple_declarator_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Param_Dcl::param_dcl (void) const
+{
+ return this->param_dcl_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Param_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_param_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Raises_Expr::TAO_PSDL_Raises_Expr (TAO_PSDL_Node *first_scoped_name)
+ : first_scoped_name_ (first_scoped_name),
+ second_scoped_name_ (0)
+{
+ this->psdl_scope_visitor ()->visit_raises_expr (this);
+
+ this->set_identifier ("raises_exception");
+}
+
+TAO_PSDL_Raises_Expr::TAO_PSDL_Raises_Expr (TAO_PSDL_Node *first_scoped_name,
+ TAO_PSDL_Node *second_scoped_name)
+ : first_scoped_name_ (first_scoped_name),
+ second_scoped_name_ (second_scoped_name)
+{
+ this->set_identifier ("raises_exception");
+
+ this->psdl_scope_visitor ()->visit_raises_expr (this);
+}
+
+TAO_PSDL_Raises_Expr::~TAO_PSDL_Raises_Expr (void)
+{
+ delete this->first_scoped_name_;
+
+ if (this->second_scoped_name_ != 0)
+ delete this->second_scoped_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Raises_Expr::first_scoped_name (void) const
+{
+ return this->first_scoped_name_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Raises_Expr::second_scoped_name (void) const
+{
+ return this->second_scoped_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Raises_Expr::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_raises_expr (this);
+}
+
+/// ****************************************************************
+TAO_PSDL_Context_Expr::TAO_PSDL_Context_Expr (TAO_PSDL_Node *string_literal)
+ : string_literal_ (string_literal)
+{
+}
+
+TAO_PSDL_Context_Expr::~TAO_PSDL_Context_Expr (void)
+{
+ delete this->string_literal_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Context_Expr::string_literal (void) const
+{
+ return this->string_literal_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Context_Expr::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_context_expr (this);
+}
+
+/// ****************************************************************
+TAO_PSDL_Param_Type_Spec::TAO_PSDL_Param_Type_Spec (
+ TAO_PSDL_Node *type_of_param)
+ : type_of_param_ (type_of_param)
+{
+}
+
+TAO_PSDL_Param_Type_Spec::~TAO_PSDL_Param_Type_Spec (void)
+{
+ delete this->type_of_param_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Param_Type_Spec::type_of_param (void) const
+{
+ return this->type_of_param_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Param_Type_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_param_type_spec (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Fixed_Pt_Type::TAO_PSDL_Fixed_Pt_Type (
+ TAO_PSDL_Node *positive_int_const_one,
+ TAO_PSDL_Node *positive_int_const_two)
+ : positive_int_const_one_ (positive_int_const_one),
+ positive_int_const_two_ (positive_int_const_two)
+{
+}
+
+TAO_PSDL_Fixed_Pt_Type::~TAO_PSDL_Fixed_Pt_Type (void)
+{
+ delete this->positive_int_const_one_;
+ delete this->positive_int_const_two_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Fixed_Pt_Type::positive_int_const_one (void) const
+{
+ return this->positive_int_const_one_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Fixed_Pt_Type::positive_int_const_two (void) const
+{
+ return this->positive_int_const_two_;
+}
+
+int
+TAO_PSDL_Fixed_Pt_Type::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_fixed_pt_type (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Constr_Forward_Decl::TAO_PSDL_Constr_Forward_Decl (TAO_PSDL_Node * type,
+ TAO_PSDL_Node *identifier)
+ : type_ (type),
+ identifier_ (identifier)
+{
+}
+
+TAO_PSDL_Constr_Forward_Decl::~TAO_PSDL_Constr_Forward_Decl (void)
+{
+ delete this->identifier_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Constr_Forward_Decl::type (void) const
+{
+ return this->type_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Constr_Forward_Decl::identifier (void) const
+{
+ return this->identifier_;
+}
+
+int
+TAO_PSDL_Constr_Forward_Decl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_constr_forward_decl (this);
+}
+
+/// ***************************************************************
+
+TAO_PSDL_Interface::TAO_PSDL_Interface (TAO_PSDL_Node *type_of_dcl)
+ : type_of_dcl_ (type_of_dcl)
+{
+}
+
+TAO_PSDL_Interface::~TAO_PSDL_Interface (void)
+{
+ delete this->type_of_dcl_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Interface::type_of_dcl (void) const
+{
+ return this->type_of_dcl_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Interface::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_interface (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Interface_Body::TAO_PSDL_Interface_Body (TAO_PSDL_Node *export_variable)
+ : export_variable_ (export_variable),
+ interface_body_ (0)
+{
+}
+
+TAO_PSDL_Interface_Body::TAO_PSDL_Interface_Body (
+ TAO_PSDL_Node *export_variable,
+ TAO_PSDL_Node *interface_body)
+ : export_variable_ (export_variable),
+ interface_body_ (interface_body)
+{
+}
+
+TAO_PSDL_Interface_Body::~TAO_PSDL_Interface_Body (void)
+{
+ delete this->export_variable_;
+
+ if (this->interface_body_ != 0)
+ delete this->interface_body_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Interface_Body::export_variable (void) const
+{
+ return this->export_variable_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Interface_Body::interface_body (void) const
+{
+ return this->interface_body_;
+}
+
+
+/// = The Node methods.
+int
+TAO_PSDL_Interface_Body::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_interface_body (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Interface_Dcl::TAO_PSDL_Interface_Dcl (
+ TAO_PSDL_Node *interface_header)
+ : interface_header_ (interface_header),
+ interface_body_ (0)
+{
+}
+
+TAO_PSDL_Interface_Dcl::TAO_PSDL_Interface_Dcl (
+ TAO_PSDL_Node *interface_header,
+ TAO_PSDL_Node *interface_body)
+ : interface_header_ (interface_header),
+ interface_body_ (interface_body)
+{
+}
+
+
+TAO_PSDL_Interface_Dcl::~TAO_PSDL_Interface_Dcl (void)
+{
+ delete this->interface_header_;
+
+ if (this->interface_body_ != 0)
+ delete this->interface_body_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Interface_Dcl::interface_header (void) const
+{
+ return this->interface_header_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Interface_Dcl::interface_body (void) const
+{
+ return this->interface_body_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Interface_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_interface_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Forward_Dcl::TAO_PSDL_Forward_Dcl (TAO_PSDL_Node *identifier)
+ : type_ (0),
+ identifier_ (identifier)
+{
+ this->psdl_scope_visitor ()->visit_forward_dcl (this);
+
+ TAO_PSDL_Scope::instance ()->add_interface_dcl_to_scope (this->identifiers_[0],
+ //@@ deal "forward_dcl",
+ this->psdl_scope ());
+}
+
+TAO_PSDL_Forward_Dcl::TAO_PSDL_Forward_Dcl (int type,
+ TAO_PSDL_Node *identifier)
+ : type_ (type),
+ identifier_ (identifier)
+{
+ this->psdl_scope_visitor ()->visit_forward_dcl (this);
+
+ TAO_PSDL_Scope::instance ()->add_interface_dcl_to_scope (this->identifiers_[0],
+ //@@ deal "forward_dcl",
+ this->psdl_scope ());
+
+}
+
+TAO_PSDL_Forward_Dcl::~TAO_PSDL_Forward_Dcl (void)
+{
+ delete this->identifier_;
+}
+
+/// Get the value
+int
+TAO_PSDL_Forward_Dcl::type (void) const
+{
+ return this->type_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Forward_Dcl::identifier (void) const
+{
+ return this->identifier_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Forward_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_forward_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Interface_Header::TAO_PSDL_Interface_Header (TAO_PSDL_Node *identifier)
+ : type_ (0),
+ identifier_ (identifier),
+ interface_inheritance_spec_ (0)
+{
+}
+
+TAO_PSDL_Interface_Header::TAO_PSDL_Interface_Header (TAO_PSDL_Node *type,
+ TAO_PSDL_Node *identifier)
+ : type_ (type),
+ identifier_ (identifier),
+ interface_inheritance_spec_ (0)
+{
+}
+
+TAO_PSDL_Interface_Header::TAO_PSDL_Interface_Header (TAO_PSDL_Node * type,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *interface_inheritance_spec)
+ : type_ (type),
+ identifier_ (identifier),
+ interface_inheritance_spec_ (interface_inheritance_spec)
+{
+}
+
+TAO_PSDL_Interface_Header::~TAO_PSDL_Interface_Header (void)
+{
+ if (this->identifier_ != 0)
+ delete this->identifier_;
+
+ if (this->interface_inheritance_spec_ != 0)
+ delete this->interface_inheritance_spec_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Interface_Header::type (void) const
+{
+ return this->type_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Interface_Header::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Interface_Header::interface_inheritance_spec (void) const
+{
+ return this->interface_inheritance_spec_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Interface_Header::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_interface_header (this);
+}
+
+
+/// ****************************************************************
+TAO_PSDL_Export_Dcl::TAO_PSDL_Export_Dcl (TAO_PSDL_Node *type_of_export_one)
+ : type_of_export_one_ (type_of_export_one),
+ type_of_export_two_ (0)
+{
+}
+
+TAO_PSDL_Export_Dcl::TAO_PSDL_Export_Dcl (TAO_PSDL_Node *type_of_export_one,
+ TAO_PSDL_Node *type_of_export_two)
+ : type_of_export_one_ (type_of_export_one),
+ type_of_export_two_ (type_of_export_two)
+{
+}
+
+TAO_PSDL_Export_Dcl::~TAO_PSDL_Export_Dcl (void)
+{
+ delete this->type_of_export_one_;
+
+ if (this->type_of_export_two_ != 0)
+ delete this->type_of_export_two_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Export_Dcl::type_of_export_one (void) const
+{
+ return this->type_of_export_one_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Export_Dcl::type_of_export_two (void) const
+{
+ return this->type_of_export_two_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Export_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_export_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Interface_Inheritance_Spec::TAO_PSDL_Interface_Inheritance_Spec (
+ TAO_PSDL_Node *interface_name)
+ : interface_name_ (interface_name)
+{
+}
+
+TAO_PSDL_Interface_Inheritance_Spec::~TAO_PSDL_Interface_Inheritance_Spec (void)
+{
+ if (this->interface_name_ != 0)
+ delete this->interface_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Interface_Inheritance_Spec::interface_name (void) const
+{
+ return this->interface_name_;
+}
+
+
+/// = The Node methods.
+int
+TAO_PSDL_Interface_Inheritance_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_interface_inheritance_spec (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Interface_Name::TAO_PSDL_Interface_Name (
+ TAO_PSDL_Node *scoped_name)
+ : scoped_name_ (scoped_name),
+ interface_name_ (0)
+{
+}
+
+TAO_PSDL_Interface_Name::TAO_PSDL_Interface_Name (
+ TAO_PSDL_Node *scoped_name,
+ TAO_PSDL_Node *interface_name)
+ : scoped_name_ (scoped_name),
+ interface_name_ (interface_name)
+{
+}
+
+TAO_PSDL_Interface_Name::~TAO_PSDL_Interface_Name (void)
+{
+ delete this->scoped_name_;
+
+ if (this->interface_name_ != 0)
+ delete this->interface_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Interface_Name::scoped_name (void) const
+{
+ return this->scoped_name_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Interface_Name::interface_name (void) const
+{
+ return this->interface_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Interface_Name::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_interface_name (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Scoped_Name::TAO_PSDL_Scoped_Name (
+ TAO_PSDL_Node *identifier)
+ : identifier_ (identifier),
+ scoped_name_ (0)
+{
+ this->psdl_scope_visitor ()->visit_scoped_name (this);
+}
+
+TAO_PSDL_Scoped_Name::TAO_PSDL_Scoped_Name (
+ TAO_PSDL_Node *scoped_name,
+ TAO_PSDL_Node *identifier)
+ : identifier_ (identifier),
+ scoped_name_ (scoped_name)
+{
+ this->psdl_scope_visitor ()->visit_scoped_name (this);
+}
+
+TAO_PSDL_Scoped_Name::~TAO_PSDL_Scoped_Name (void)
+{
+ delete this->identifier_;
+
+ if (this->scoped_name_ != 0)
+ delete this->scoped_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Scoped_Name::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Scoped_Name::scoped_name (void) const
+{
+ return this->scoped_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Scoped_Name::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_scoped_name (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Value::TAO_PSDL_Value (TAO_PSDL_Node *type_of_value_dcl)
+ : type_of_value_dcl_ (type_of_value_dcl)
+{
+}
+
+TAO_PSDL_Value::~TAO_PSDL_Value (void)
+{
+ delete this->type_of_value_dcl_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Value::type_of_value_dcl (void) const
+{
+ return this->type_of_value_dcl_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Value::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_value (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Value_Common_Base::TAO_PSDL_Value_Common_Base (TAO_PSDL_Node *identifier)
+ : identifier_ (identifier)
+{
+}
+
+TAO_PSDL_Value_Common_Base::~TAO_PSDL_Value_Common_Base (void)
+{
+ delete this->identifier_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Value_Common_Base::identifier (void) const
+{
+ return this->identifier_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Value_Common_Base::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_value_common_base (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Value_Forward_Dcl::TAO_PSDL_Value_Forward_Dcl (
+ TAO_PSDL_Node *value_common_base)
+ : value_common_base_ (value_common_base),
+ abstract_ (0)
+{
+}
+
+TAO_PSDL_Value_Forward_Dcl::TAO_PSDL_Value_Forward_Dcl (
+ TAO_PSDL_Node *abstract,
+ TAO_PSDL_Node *value_common_base)
+ : value_common_base_ (value_common_base),
+ abstract_ (abstract)
+{
+}
+
+TAO_PSDL_Value_Forward_Dcl::~TAO_PSDL_Value_Forward_Dcl (void)
+{
+ delete this->value_common_base_;
+
+ if (this->abstract_ != 0)
+ delete this->abstract_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Value_Forward_Dcl::value_common_base (void) const
+{
+ return this->value_common_base_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Value_Forward_Dcl::abstract (void) const
+{
+ return this->abstract_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Value_Forward_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_value_forward_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Value_Box_Dcl::TAO_PSDL_Value_Box_Dcl (
+ TAO_PSDL_Node *value_common_base,
+ TAO_PSDL_Node *type_spec)
+ : value_common_base_ (value_common_base),
+ type_spec_ (type_spec)
+{
+}
+
+TAO_PSDL_Value_Box_Dcl::~TAO_PSDL_Value_Box_Dcl (void)
+{
+ delete this->value_common_base_;
+ delete this->type_spec_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Value_Box_Dcl::value_common_base (void) const
+{
+ return this->value_common_base_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Value_Box_Dcl::type_spec (void) const
+{
+ return this->type_spec_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Value_Box_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_value_box_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Value_Abs_Dcl::TAO_PSDL_Value_Abs_Dcl (
+ TAO_PSDL_Node *value_common_base,
+ TAO_PSDL_Node *export_variable)
+ : value_common_base_ (value_common_base),
+ value_inheritance_spec_ (0),
+ export_variable_ (export_variable)
+{
+}
+
+TAO_PSDL_Value_Abs_Dcl::TAO_PSDL_Value_Abs_Dcl (
+ TAO_PSDL_Node *value_common_base,
+ TAO_PSDL_Node *value_inheritance_spec,
+ TAO_PSDL_Node *export_variable)
+ : value_common_base_ (value_common_base),
+ value_inheritance_spec_ (value_inheritance_spec),
+ export_variable_ (export_variable)
+{
+}
+
+TAO_PSDL_Value_Abs_Dcl::~TAO_PSDL_Value_Abs_Dcl (void)
+{
+ delete this->value_common_base_;
+ delete this->export_variable_;
+
+ if (this->value_inheritance_spec_ != 0)
+ delete this->value_inheritance_spec_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Value_Abs_Dcl::value_common_base (void) const
+{
+ return this->value_common_base_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Value_Abs_Dcl::export_variable (void) const
+{
+ return this->export_variable_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Value_Abs_Dcl::value_inheritance_spec (void) const
+{
+ return this->value_inheritance_spec_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Value_Abs_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_value_abs_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Value_Dcl::TAO_PSDL_Value_Dcl (
+ TAO_PSDL_Node *value_header,
+ TAO_PSDL_Node *value_element)
+ : value_header_ (value_header),
+ value_element_ (value_element)
+{
+}
+
+TAO_PSDL_Value_Dcl::~TAO_PSDL_Value_Dcl (void)
+{
+ delete this->value_header_;
+ delete this->value_element_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Value_Dcl::value_header (void) const
+{
+ return this->value_header_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Value_Dcl::value_element (void) const
+{
+ return this->value_element_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Value_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_value_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Value_Header::TAO_PSDL_Value_Header (
+ TAO_PSDL_Node *value_common_base,
+ TAO_PSDL_Node *value_inheritance_spec)
+ : custom_ (0),
+ value_common_base_ (value_common_base),
+ value_inheritance_spec_ (value_inheritance_spec)
+{
+}
+
+TAO_PSDL_Value_Header::TAO_PSDL_Value_Header (TAO_PSDL_Node *custom,
+ TAO_PSDL_Node *value_common_base,
+ TAO_PSDL_Node *value_inheritance_spec)
+ : custom_ (custom),
+ value_common_base_ (value_common_base),
+ value_inheritance_spec_ (value_inheritance_spec)
+{
+}
+
+TAO_PSDL_Value_Header::~TAO_PSDL_Value_Header (void)
+{
+ delete this->value_common_base_;
+
+ if (this->custom_ != 0)
+ delete this->custom_;
+
+ delete this->value_inheritance_spec_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Value_Header::custom (void) const
+{
+ return this->custom_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Value_Header::value_common_base (void) const
+{
+ return this->value_common_base_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Value_Header::value_inheritance_spec (void) const
+{
+ return this->value_inheritance_spec_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Value_Header::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_value_header (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Value_Inheritance_Spec::TAO_PSDL_Value_Inheritance_Spec (
+ TAO_PSDL_Node *interface_name)
+ : truncatable_ (0),
+ value_name_ (0),
+ interface_name_ (interface_name)
+{
+}
+
+TAO_PSDL_Value_Inheritance_Spec::TAO_PSDL_Value_Inheritance_Spec (
+ TAO_PSDL_Node *value_name,
+ TAO_PSDL_Node *interface_name)
+ : truncatable_ (0),
+ value_name_ (value_name),
+ interface_name_ (interface_name)
+{
+}
+
+TAO_PSDL_Value_Inheritance_Spec::TAO_PSDL_Value_Inheritance_Spec (
+ TAO_PSDL_Node *truncatable,
+ TAO_PSDL_Node *value_name,
+ TAO_PSDL_Node *interface_name)
+ : truncatable_ (truncatable),
+ value_name_ (value_name),
+ interface_name_ (interface_name)
+{
+}
+
+TAO_PSDL_Value_Inheritance_Spec::~TAO_PSDL_Value_Inheritance_Spec (void)
+{
+ if (this->truncatable_ != 0)
+ delete this->truncatable_;
+
+ delete this->interface_name_;
+
+ if (this->value_name_ != 0)
+ delete this->value_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Value_Inheritance_Spec::truncatable (void) const
+{
+ return this->truncatable_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Value_Inheritance_Spec::value_name (void) const
+{
+ return this->value_name_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Value_Inheritance_Spec::interface_name (void) const
+{
+ return this->interface_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Value_Inheritance_Spec::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_value_inheritance_spec (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Value_Name::TAO_PSDL_Value_Name (TAO_PSDL_Node *scoped_name)
+ : scoped_name_ (scoped_name),
+ value_name_ (0)
+{
+}
+
+TAO_PSDL_Value_Name::TAO_PSDL_Value_Name (TAO_PSDL_Node *scoped_name,
+ TAO_PSDL_Node *value_name)
+ : scoped_name_ (scoped_name),
+ value_name_ (value_name)
+{
+}
+
+TAO_PSDL_Value_Name::~TAO_PSDL_Value_Name (void)
+{
+ if (this->scoped_name_ != 0)
+ delete this->scoped_name_;
+
+ if (this->value_name_ != 0)
+ delete this->value_name_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Value_Name::scoped_name (void) const
+{
+ return this->scoped_name_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Value_Name::value_name (void) const
+{
+ return this->value_name_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Value_Name::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_value_name (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Value_Element::TAO_PSDL_Value_Element (
+ TAO_PSDL_Node *type_of_element)
+ : type_of_element_ (type_of_element)
+{
+}
+
+TAO_PSDL_Value_Element::~TAO_PSDL_Value_Element (void)
+{
+ delete this->type_of_element_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Value_Element::type_of_element (void) const
+{
+ return this->type_of_element_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Value_Element::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_value_element (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Array_Declarator::TAO_PSDL_Array_Declarator (
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *fixed_array_size)
+ : identifier_ (identifier),
+ fixed_array_size_ (fixed_array_size)
+{
+}
+
+TAO_PSDL_Array_Declarator::~TAO_PSDL_Array_Declarator (void)
+{
+ delete this->identifier_;
+ delete this->fixed_array_size_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Array_Declarator::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Array_Declarator::fixed_array_size (void) const
+{
+ return this->fixed_array_size_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Array_Declarator::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_array_declarator (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Fixed_Array_Size::TAO_PSDL_Fixed_Array_Size (
+ TAO_PSDL_Node *positive_int_const)
+ : positive_int_const_ (positive_int_const)
+{
+}
+
+TAO_PSDL_Fixed_Array_Size::~TAO_PSDL_Fixed_Array_Size (void)
+{
+ delete this->positive_int_const_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Fixed_Array_Size::positive_int_const (void) const
+{
+ return this->positive_int_const_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Fixed_Array_Size::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_fixed_array_size (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Enumerator::TAO_PSDL_Enumerator (TAO_PSDL_Node *identifier)
+ : identifier_ (identifier),
+ enumerator_ (0)
+{
+}
+
+TAO_PSDL_Enumerator::TAO_PSDL_Enumerator (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *enumerator)
+ : identifier_ (identifier),
+ enumerator_ (enumerator)
+{
+}
+
+TAO_PSDL_Enumerator::~TAO_PSDL_Enumerator (void)
+{
+ delete this->identifier_;
+
+ if (this->enumerator_ != 0)
+ delete this->enumerator_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Enumerator::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Enumerator::enumerator (void) const
+{
+ return this->enumerator_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Enumerator::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_enumerator (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Literal::TAO_PSDL_Literal (CORBA::Boolean boolean_value)
+ : boolean_value_ (boolean_value),
+ int_value_ (0),
+ double_value_ (0),
+ char_value_ (0)
+{
+}
+
+TAO_PSDL_Literal::TAO_PSDL_Literal (int int_value)
+ : boolean_value_ (0),
+ int_value_ (int_value),
+ double_value_ (0),
+ char_value_ (0)
+{
+}
+
+TAO_PSDL_Literal::TAO_PSDL_Literal (double double_value)
+ : boolean_value_ (0),
+ int_value_ (0),
+ double_value_ (double_value),
+ char_value_ (0)
+{
+}
+
+TAO_PSDL_Literal::TAO_PSDL_Literal (const char *char_value)
+ : boolean_value_ (0),
+ int_value_ (0),
+ double_value_ (0),
+ char_value_ (char_value)
+{
+}
+
+TAO_PSDL_Literal::~TAO_PSDL_Literal (void)
+{
+ // We cannot delete this since it is a constant
+ /*if (this->char_value_ != 0)
+ delete this->char_value_; */
+}
+
+/// Get the value
+CORBA::Boolean
+TAO_PSDL_Literal::boolean_value (void) const
+{
+ return this->boolean_value_;
+}
+
+int
+TAO_PSDL_Literal::int_value (void) const
+{
+ return this->int_value_;
+}
+
+double
+TAO_PSDL_Literal::double_value (void) const
+{
+ return this->double_value_;
+}
+
+const char *
+TAO_PSDL_Literal::char_value (void) const
+{
+ return this->char_value_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Literal::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_literal (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_State_Member::TAO_PSDL_State_Member (TAO_PSDL_Node *public_or_private,
+ TAO_PSDL_Node *type_spec,
+ TAO_PSDL_Node *declarators)
+ : public_or_private_ (public_or_private),
+ type_spec_ (type_spec),
+ declarators_ (declarators)
+{
+}
+
+TAO_PSDL_State_Member::~TAO_PSDL_State_Member (void)
+{
+ delete this->public_or_private_;
+
+ delete this->type_spec_;
+
+ delete this->declarators_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_State_Member::public_or_private (void) const
+{
+ return this->public_or_private_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_State_Member::type_spec (void) const
+{
+ return this->type_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_State_Member::declarators (void) const
+{
+ return this->declarators_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_State_Member::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_state_member (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Init_Dcl::TAO_PSDL_Init_Dcl (TAO_PSDL_Node *identifier)
+ : identifier_ (identifier),
+ init_param_decls_ (0)
+{
+}
+
+TAO_PSDL_Init_Dcl::TAO_PSDL_Init_Dcl (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *init_param_decls)
+ : identifier_ (identifier),
+ init_param_decls_ (init_param_decls)
+{
+}
+
+TAO_PSDL_Init_Dcl::~TAO_PSDL_Init_Dcl (void)
+{
+ delete this->identifier_;
+
+ if (this->init_param_decls_ != 0)
+ delete this->init_param_decls_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Init_Dcl::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Init_Dcl::init_param_decls (void) const
+{
+ return this->init_param_decls_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Init_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_init_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Init_Param_Decls::TAO_PSDL_Init_Param_Decls (TAO_PSDL_Node *init_param_decl)
+ : init_param_decl_ (init_param_decl),
+ init_param_decls_ (0)
+{
+}
+
+TAO_PSDL_Init_Param_Decls::TAO_PSDL_Init_Param_Decls (TAO_PSDL_Node *init_param_decl,
+ TAO_PSDL_Node *init_param_decls)
+ : init_param_decl_ (init_param_decl),
+ init_param_decls_ (init_param_decls)
+{
+}
+
+TAO_PSDL_Init_Param_Decls::~TAO_PSDL_Init_Param_Decls (void)
+{
+ delete this->init_param_decl_;
+
+ if (this->init_param_decls_ != 0)
+ delete this->init_param_decls_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Init_Param_Decls::init_param_decl (void) const
+{
+ return this->init_param_decl_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Init_Param_Decls::init_param_decls (void) const
+{
+ return this->init_param_decls_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Init_Param_Decls::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_init_param_decls (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Init_Param_Decl::TAO_PSDL_Init_Param_Decl (TAO_PSDL_Node *init_param_attribute,
+ TAO_PSDL_Node *param_type_spec,
+ TAO_PSDL_Node *simple_declarator)
+ : init_param_attribute_ (init_param_attribute),
+ param_type_spec_ (param_type_spec),
+ simple_declarator_ (simple_declarator)
+{
+}
+
+TAO_PSDL_Init_Param_Decl::~TAO_PSDL_Init_Param_Decl (void)
+{
+ delete this->init_param_attribute_;
+
+ delete this->param_type_spec_;
+
+ delete this->simple_declarator_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Init_Param_Decl::init_param_attribute (void) const
+{
+ return this->init_param_attribute_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Init_Param_Decl::param_type_spec (void) const
+{
+ return this->param_type_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Init_Param_Decl::simple_declarator (void) const
+{
+ return this->simple_declarator_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Init_Param_Decl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_init_param_decl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Factory_Parameters::TAO_PSDL_Factory_Parameters ()
+ : simple_declarator_ (0)
+{
+}
+
+TAO_PSDL_Factory_Parameters::TAO_PSDL_Factory_Parameters (TAO_PSDL_Node *simple_declarator)
+ : simple_declarator_ (simple_declarator)
+{
+}
+
+TAO_PSDL_Factory_Parameters::~TAO_PSDL_Factory_Parameters (void)
+{
+ if (this->simple_declarator_ != 0)
+ delete this->simple_declarator_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Factory_Parameters::simple_declarator (void) const
+{
+ return this->simple_declarator_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Factory_Parameters::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_factory_parameters (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Attr_Dcl::TAO_PSDL_Attr_Dcl (int readonly,
+ TAO_PSDL_Node *param_type_spec,
+ TAO_PSDL_Node *simple_declarator)
+ : readonly_ (readonly),
+ param_type_spec_ (param_type_spec),
+ simple_declarator_ (simple_declarator)
+{
+}
+
+TAO_PSDL_Attr_Dcl::TAO_PSDL_Attr_Dcl (TAO_PSDL_Node *param_type_spec,
+ TAO_PSDL_Node *simple_declarator)
+ : readonly_ (0),
+ param_type_spec_ (param_type_spec),
+ simple_declarator_ (simple_declarator)
+{
+}
+
+TAO_PSDL_Attr_Dcl::~TAO_PSDL_Attr_Dcl (void)
+{
+ delete this->param_type_spec_;
+
+ delete this->simple_declarator_;
+}
+
+/// Get the value
+int
+TAO_PSDL_Attr_Dcl::readonly (void) const
+{
+ return this->readonly_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Attr_Dcl::param_type_spec (void) const
+{
+ return this->param_type_spec_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Attr_Dcl::simple_declarator (void) const
+{
+ return this->simple_declarator_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Attr_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_attr_dcl (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Positive_Int_Const::TAO_PSDL_Positive_Int_Const (TAO_PSDL_Node *const_exp)
+ : const_exp_ (const_exp)
+{
+}
+
+TAO_PSDL_Positive_Int_Const::~TAO_PSDL_Positive_Int_Const (void)
+{
+ delete this->const_exp_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Positive_Int_Const::const_exp (void) const
+{
+ return this->const_exp_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Positive_Int_Const::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_positive_int_const (this);
+}
+
+/// ****************************************************************
+
+TAO_PSDL_Factory_Dcl::TAO_PSDL_Factory_Dcl (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *factory_parameters)
+ : identifier_ (identifier),
+ factory_parameters_ (factory_parameters)
+{
+}
+
+TAO_PSDL_Factory_Dcl::~TAO_PSDL_Factory_Dcl (void)
+{
+ delete this->identifier_;
+
+ if (this->factory_parameters_ != 0)
+ delete this->factory_parameters_;
+}
+
+/// Get the value
+TAO_PSDL_Node *
+TAO_PSDL_Factory_Dcl::identifier (void) const
+{
+ return this->identifier_;
+}
+
+TAO_PSDL_Node *
+TAO_PSDL_Factory_Dcl::factory_parameters (void) const
+{
+ return this->factory_parameters_;
+}
+
+/// = The Node methods.
+int
+TAO_PSDL_Factory_Dcl::accept (TAO_PSDL_Node_Visitor *visitor)
+{
+ return visitor->visit_factory_dcl (this);
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Node.h b/TAO/orbsvcs/PSS/PSDL_Node.h
new file mode 100644
index 00000000000..464bcdc53bf
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Node.h
@@ -0,0 +1,3333 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Node
+//
+// = DESCRIPTION
+// This class is the base type for all the type of possible nodes
+// in the parse tree.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_NODE_H
+#define TAO_PSDL_NODE_H
+
+#include "psdl_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "PSDL_Scope.h"
+
+#include "tao/corbafwd.h"
+#include "ace/SString.h"
+
+
+class TAO_PSDL_Node_Visitor;
+class TAO_PSDL_Scope_Visitor;
+
+class TAO::String_Manager;
+
+class TAO_PSDL_Export TAO_PSDL_Node
+{
+public:
+
+ // Constructor and destructor
+ TAO_PSDL_Node (void);
+
+ virtual ~TAO_PSDL_Node (void);
+
+ // This method is for applying the visitor pattern. When the control
+ // reaches a particular node, since we donot know the type of the
+ // node, we invoke the accept method. Each derived classes accept
+ // method, will invoke the corresponding visitor method which does
+ // the needful for that particular type of the node.
+ virtual int accept (TAO_PSDL_Node_Visitor *visitor) = 0;
+
+ // Needed when writing to stubs.
+ virtual int type_of_node (void) const;
+
+ // Accessors to the identifiers for use while building the ASTs
+ ACE_CString get_identifier_type (void);
+ ACE_CString get_identifier_value (void);
+ void set_identifier (ACE_CString identifier);
+
+ // Set the predefined_type_ to 1 to indicate that the type is a
+ // predefined type.
+ void set_predefined_type (void);
+
+ /// Accessor methods.
+ TAO_PSDL_Scope *psdl_scope (void);
+ TAO_PSDL_Scope_Visitor *psdl_scope_visitor (void);
+
+protected :
+
+ int type_;
+
+ // Array to carry the temporary identifier_type and identifier_value
+ // before they are added to the related scope. ie,. to the ASTs
+ ACE_Array_Base <ACE_CString> identifiers_;
+
+ // Index to keep track of the present member of the identifiers_
+ // array.
+ CORBA::ULong count_;
+
+ // Check if the type of the identifier is a predefined one.
+ // The default value is that any identifier_type is a user-defined
+ // one i.e. if the value is zero, it is a user-defined type. When
+ // the identifier_type is actually a predefined one, its value is to
+ // be changed to 1.
+ CORBA::Boolean predefined_type_;
+ /// Pointer to psdl_scope_
+ TAO_PSDL_Scope *psdl_scope_;
+
+ // Pointer to the base visitor class
+ TAO_PSDL_Scope_Visitor *psdl_scope_visitor_;
+};
+
+// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Specification : public TAO_PSDL_Node
+{
+ // This class is for psdl_specification s.
+public:
+ TAO_PSDL_Specification (TAO_PSDL_Node *definition);
+ TAO_PSDL_Specification (TAO_PSDL_Node *definition,
+ TAO_PSDL_Node *specification);
+
+ virtual ~TAO_PSDL_Specification (void);
+
+ /// Get the values.
+ TAO_PSDL_Node *definition (void) const;
+ TAO_PSDL_Node *specification (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *definition_;
+ TAO_PSDL_Node *specification_;
+
+};
+
+// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Definition : public TAO_PSDL_Node
+{
+ // For psdl_definition
+public:
+ TAO_PSDL_Definition (TAO_PSDL_Node *definition_type);
+
+ virtual ~TAO_PSDL_Definition (void);
+
+ /// Get the value
+ TAO_PSDL_Node *definition_type (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *definition_type_;
+};
+
+// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Module : public TAO_PSDL_Node
+{
+ // for psdl_module
+public:
+ TAO_PSDL_Module (int type,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *specification);
+
+ virtual ~TAO_PSDL_Module (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *specification (void) const;
+
+ void set_identifier_name (ACE_CString);
+ ACE_CString identifier_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *specification_;
+ ACE_CString module_name_;
+};
+
+// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagetype : public TAO_PSDL_Node
+{
+ // For abstract_storagetype
+public:
+ TAO_PSDL_Abstract_Storagetype (TAO_PSDL_Node *storagetype_dcl);
+
+ virtual ~TAO_PSDL_Abstract_Storagetype (void);
+
+ /// Get the value
+ TAO_PSDL_Node *storagetype_dcl (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *storagetype_dcl_;
+};
+
+// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagetype_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Abstract_Storagetype_Dcl (TAO_PSDL_Node *abs_storagetype_header);
+
+ TAO_PSDL_Abstract_Storagetype_Dcl (TAO_PSDL_Node *abs_storagetype_header,
+ TAO_PSDL_Node *abs_storagetype_body);
+
+ virtual ~TAO_PSDL_Abstract_Storagetype_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *abs_storagetype_header (void) const;
+ TAO_PSDL_Node *abs_storagetype_body (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *abs_storagetype_header_;
+ TAO_PSDL_Node *abs_storagetype_body_;
+
+};
+
+// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagetype_Fwd_Dcl : public TAO_PSDL_Node
+{
+public:
+ TAO_PSDL_Abstract_Storagetype_Fwd_Dcl (TAO_PSDL_Node *identifer);
+
+ virtual ~TAO_PSDL_Abstract_Storagetype_Fwd_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *identifier_;
+};
+
+// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagetype_Header : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Abstract_Storagetype_Header (TAO_PSDL_Node *identifer);
+ TAO_PSDL_Abstract_Storagetype_Header (TAO_PSDL_Node *identifer,
+ TAO_PSDL_Node *abs_storagetype_inh_spec);
+
+ virtual ~TAO_PSDL_Abstract_Storagetype_Header (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *abs_storagetype_inh_spec (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *abs_storagetype_inh_spec_;
+};
+
+// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagetype_Body : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Abstract_Storagetype_Body (TAO_PSDL_Node *abs_storagetype_member);
+ TAO_PSDL_Abstract_Storagetype_Body (TAO_PSDL_Node *abs_storagetype_member,
+ TAO_PSDL_Node *abs_storagetype_body);
+
+ virtual ~TAO_PSDL_Abstract_Storagetype_Body (void);
+
+ /// Get the value
+ TAO_PSDL_Node *abs_storagetype_member (void) const;
+ TAO_PSDL_Node *abs_storagetype_body (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *abs_storagetype_member_;
+ TAO_PSDL_Node *abs_storagetype_body_;
+};
+
+// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagetype_Member : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Abstract_Storagetype_Member (TAO_PSDL_Node *declaration);
+ virtual ~TAO_PSDL_Abstract_Storagetype_Member (void);
+
+ /// Get the value
+ TAO_PSDL_Node *declaration (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *declaration_;
+};
+
+// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagetype_Inh_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Abstract_Storagetype_Inh_Spec (TAO_PSDL_Node *abs_storagetype_name);
+ virtual ~TAO_PSDL_Abstract_Storagetype_Inh_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *abs_storagetype_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *abs_storagetype_name_;
+};
+
+// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagetype_Name : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Abstract_Storagetype_Name (TAO_PSDL_Node *scoped_name);
+ TAO_PSDL_Abstract_Storagetype_Name (TAO_PSDL_Node *scoped_name,
+ TAO_PSDL_Node *abs_storagetype_name);
+ virtual ~TAO_PSDL_Abstract_Storagetype_Name (void);
+
+ /// Get the value
+ TAO_PSDL_Node *scoped_name (void) const;
+ TAO_PSDL_Node *abs_storagetype_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *scoped_name_;
+ TAO_PSDL_Node *abs_storagetype_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Psdl_State_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Psdl_State_Dcl (TAO_PSDL_Node *key_word,
+ TAO_PSDL_Node *psdl_state_type_spec,
+ TAO_PSDL_Node *simple_declarator);
+
+ TAO_PSDL_Psdl_State_Dcl (TAO_PSDL_Node *psdl_state_type_spec,
+ TAO_PSDL_Node *simple_declarator);
+
+ virtual ~TAO_PSDL_Psdl_State_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *psdl_state_type_spec (void) const;
+ TAO_PSDL_Node *simple_declarator (void) const;
+ TAO_PSDL_Node *key_word (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *key_word_;
+ TAO_PSDL_Node *psdl_state_type_spec_;
+ TAO_PSDL_Node *simple_declarator_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Psdl_State_Type_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Psdl_State_Type_Spec (TAO_PSDL_Node *type_spec);
+
+ virtual ~TAO_PSDL_Psdl_State_Type_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_spec (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *type_spec_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagetype_Ref_Type : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Abstract_Storagetype_Ref_Type (TAO_PSDL_Node *key_word,
+ TAO_PSDL_Node *abs_storagetype_name);
+
+ TAO_PSDL_Abstract_Storagetype_Ref_Type (TAO_PSDL_Node *abs_storagetype_name);
+
+ virtual ~TAO_PSDL_Abstract_Storagetype_Ref_Type (void);
+
+ /// Get the value
+ TAO_PSDL_Node *key_word (void) const;
+ TAO_PSDL_Node *abs_storagetype_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *key_word_;
+ TAO_PSDL_Node *abs_storagetype_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagehome : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Abstract_Storagehome (TAO_PSDL_Node *abs_storagehome_dcl);
+
+ virtual ~TAO_PSDL_Abstract_Storagehome (void);
+
+ /// Get the value
+ TAO_PSDL_Node *abs_storagehome_dcl (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *abs_storagehome_dcl_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagehome_Fwd_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Abstract_Storagehome_Fwd_Dcl (TAO_PSDL_Node *identifier);
+
+ virtual ~TAO_PSDL_Abstract_Storagehome_Fwd_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *identifier_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagehome_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Abstract_Storagehome_Dcl (TAO_PSDL_Node *abs_storagehome_header);
+
+ TAO_PSDL_Abstract_Storagehome_Dcl (TAO_PSDL_Node *abs_storagehome_header,
+ TAO_PSDL_Node *abs_storagehome_body);
+
+ virtual ~TAO_PSDL_Abstract_Storagehome_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *abs_storagehome_header (void) const;
+ TAO_PSDL_Node *abs_storagehome_body (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *abs_storagehome_header_;
+ TAO_PSDL_Node *abs_storagehome_body_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagehome_Header : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Abstract_Storagehome_Header (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *abs_storagetype_name);
+
+ TAO_PSDL_Abstract_Storagehome_Header (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *abs_storagetype_name,
+ TAO_PSDL_Node *abs_storagehome_inh_spec);
+
+ virtual ~TAO_PSDL_Abstract_Storagehome_Header (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *abs_storagetype_name (void) const;
+ TAO_PSDL_Node *abs_storagehome_inh_spec (void) const;
+
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *abs_storagetype_name_;
+ TAO_PSDL_Node *abs_storagehome_inh_spec_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagehome_Body : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Abstract_Storagehome_Body ();
+
+ TAO_PSDL_Abstract_Storagehome_Body (TAO_PSDL_Node *abs_storagehome_member);
+
+ TAO_PSDL_Abstract_Storagehome_Body (TAO_PSDL_Node *abs_storagehome_member,
+ TAO_PSDL_Node *abs_storagehome_body);
+
+ virtual ~TAO_PSDL_Abstract_Storagehome_Body (void);
+
+ /// Get the value
+ TAO_PSDL_Node *abs_storagehome_member (void) const;
+ TAO_PSDL_Node *abs_storagehome_body (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *abs_storagehome_member_;
+ TAO_PSDL_Node *abs_storagehome_body_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagehome_Member : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Abstract_Storagehome_Member (TAO_PSDL_Node *declaration_type);
+
+ virtual ~TAO_PSDL_Abstract_Storagehome_Member (void);
+
+ /// Get the value
+ TAO_PSDL_Node *declaration_type (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *declaration_type_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagehome_Inh_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Abstract_Storagehome_Inh_Spec (TAO_PSDL_Node *abs_storagehome_name);
+
+ virtual ~TAO_PSDL_Abstract_Storagehome_Inh_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *abs_storagehome_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *abs_storagehome_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Abstract_Storagehome_Name : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Abstract_Storagehome_Name (TAO_PSDL_Node *scoped_name);
+
+ TAO_PSDL_Abstract_Storagehome_Name (TAO_PSDL_Node *scoped_name,
+ TAO_PSDL_Node *abs_storagehome_name);
+
+ virtual ~TAO_PSDL_Abstract_Storagehome_Name (void);
+
+ /// Get the value
+ TAO_PSDL_Node *scoped_name (void) const;
+ TAO_PSDL_Node *abs_storagehome_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *scoped_name_;
+ TAO_PSDL_Node *abs_storagehome_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Local_Op_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Local_Op_Dcl (TAO_PSDL_Node *op_type_spec,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *parameter_dcls,
+ TAO_PSDL_Node *raises_expr);
+
+ TAO_PSDL_Local_Op_Dcl (TAO_PSDL_Node *op_type_spec,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *parameter_dcls);
+
+ virtual ~TAO_PSDL_Local_Op_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *op_type_spec (void) const;
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *parameter_dcls (void) const;
+ TAO_PSDL_Node *raises_expr (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *op_type_spec_;
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *parameter_dcls_;
+ TAO_PSDL_Node *raises_expr_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Key_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Key_Dcl (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *simple_declarator);
+
+ TAO_PSDL_Key_Dcl (TAO_PSDL_Node *identifier);
+
+ virtual ~TAO_PSDL_Key_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *simple_declarator (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *simple_declarator_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Catalog : public TAO_PSDL_Node
+{
+public:
+ TAO_PSDL_Catalog (TAO_PSDL_Node *identifier);
+
+ TAO_PSDL_Catalog (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *catalog_inh_spec,
+ TAO_PSDL_Node *catalog_body);
+
+ TAO_PSDL_Catalog (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *catalog_body);
+
+ virtual ~TAO_PSDL_Catalog (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *catalog_inh_spec (void) const;
+ TAO_PSDL_Node *catalog_body (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *catalog_inh_spec_;
+ TAO_PSDL_Node *catalog_body_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Catalog_Inh_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Catalog_Inh_Spec (TAO_PSDL_Node *catalog_name);
+
+ virtual ~TAO_PSDL_Catalog_Inh_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *catalog_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *catalog_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Catalog_Name : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Catalog_Name (TAO_PSDL_Node *scoped_name);
+ TAO_PSDL_Catalog_Name (TAO_PSDL_Node *scoped_name,
+ TAO_PSDL_Node *catalog_name);
+
+ virtual ~TAO_PSDL_Catalog_Name (void);
+
+ /// Get the value
+ TAO_PSDL_Node *scoped_name (void) const;
+ TAO_PSDL_Node *catalog_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *scoped_name_;
+ TAO_PSDL_Node *catalog_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Catalog_Body : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Catalog_Body ();
+ TAO_PSDL_Catalog_Body (TAO_PSDL_Node *catalog_member);
+ TAO_PSDL_Catalog_Body (TAO_PSDL_Node *catalog_member,
+ TAO_PSDL_Node *catalog_body);
+
+ virtual ~TAO_PSDL_Catalog_Body (void);
+
+ /// Get the value
+ TAO_PSDL_Node *catalog_member (void) const;
+ TAO_PSDL_Node *catalog_body (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *catalog_member_;
+ TAO_PSDL_Node *catalog_body_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Catalog_Member : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Catalog_Member (TAO_PSDL_Node *declaration);
+
+ virtual ~TAO_PSDL_Catalog_Member (void);
+
+ /// Get the value
+ TAO_PSDL_Node *declaration (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *declaration_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Provides_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Provides_Dcl (TAO_PSDL_Node *abs_storagehome_name,
+ TAO_PSDL_Node *simple_declarator);
+
+ virtual ~TAO_PSDL_Provides_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *abs_storagehome_name (void) const;
+ TAO_PSDL_Node *simple_declarator (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *abs_storagehome_name_;
+ TAO_PSDL_Node *simple_declarator_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagetype : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagetype (TAO_PSDL_Node *declaration);
+
+ virtual ~TAO_PSDL_Storagetype (void);
+
+ /// Get the value
+ TAO_PSDL_Node *declaration (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *declaration_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagetype_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagetype_Dcl (TAO_PSDL_Node *storagetype_header);
+
+ TAO_PSDL_Storagetype_Dcl (TAO_PSDL_Node *storagetype_header,
+ TAO_PSDL_Node *storagetype_body);
+
+ virtual ~TAO_PSDL_Storagetype_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *storagetype_header (void) const;
+ TAO_PSDL_Node *storagetype_body (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *storagetype_header_;
+ TAO_PSDL_Node *storagetype_body_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagetype_Fwd_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagetype_Fwd_Dcl (TAO_PSDL_Node *identifier);
+
+ virtual ~TAO_PSDL_Storagetype_Fwd_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *identifier_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagetype_Header : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagetype_Header (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *storagetype_inh_spec,
+ TAO_PSDL_Node *storagetype_impl_spec);
+
+ TAO_PSDL_Storagetype_Header (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *storagetype_inh_spec);
+
+ TAO_PSDL_Storagetype_Header (TAO_PSDL_Node *identifier);
+
+ virtual ~TAO_PSDL_Storagetype_Header (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *storagetype_inh_spec (void) const;
+ TAO_PSDL_Node *storagetype_impl_spec (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *storagetype_inh_spec_;
+ TAO_PSDL_Node *storagetype_impl_spec_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagetype_Body : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagetype_Body ();
+
+ TAO_PSDL_Storagetype_Body (TAO_PSDL_Node *storagetype_member);
+
+ TAO_PSDL_Storagetype_Body (TAO_PSDL_Node *storagetype_member,
+ TAO_PSDL_Node *storagetype_body);
+
+ virtual ~TAO_PSDL_Storagetype_Body (void);
+
+ /// Get the value
+ TAO_PSDL_Node *storagetype_member (void) const;
+ TAO_PSDL_Node *storagetype_body (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *storagetype_member_;
+ TAO_PSDL_Node *storagetype_body_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagetype_Member : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagetype_Member (TAO_PSDL_Node *declaration);
+
+ virtual ~TAO_PSDL_Storagetype_Member (void);
+
+ /// Get the value
+ TAO_PSDL_Node *declaration (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *declaration_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagetype_Inh_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagetype_Inh_Spec (TAO_PSDL_Node *storagetype_name);
+
+ virtual ~TAO_PSDL_Storagetype_Inh_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *storagetype_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *storagetype_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagetype_Name : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagetype_Name (TAO_PSDL_Node *scoped_name);
+
+ virtual ~TAO_PSDL_Storagetype_Name (void);
+
+ /// Get the value
+ TAO_PSDL_Node *scoped_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *scoped_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagetype_Impl_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagetype_Impl_Spec (TAO_PSDL_Node *abstract_storagetype_name);
+
+ virtual ~TAO_PSDL_Storagetype_Impl_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *abstract_storagetype_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *abstract_storagetype_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagetype_Ref_Type : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagetype_Ref_Type (TAO_PSDL_Node *storagetype_name);
+
+ virtual ~TAO_PSDL_Storagetype_Ref_Type (void);
+
+ /// Get the value
+ TAO_PSDL_Node *storagetype_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *storagetype_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagehome_Scope : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagehome_Scope (TAO_PSDL_Node *storagehome_name);
+
+ virtual ~TAO_PSDL_Storagehome_Scope (void);
+
+ /// Get the value
+ TAO_PSDL_Node *storagehome_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *storagehome_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Store_Directive : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Store_Directive (TAO_PSDL_Node *simple_declarator,
+ TAO_PSDL_Node *psdl_concrete_state_type,
+ TAO_PSDL_Node *storagehome_scope);
+
+ TAO_PSDL_Store_Directive (TAO_PSDL_Node *simple_declarator,
+ TAO_PSDL_Node *psdl_concrete_state_type);
+
+ virtual ~TAO_PSDL_Store_Directive (void);
+
+ /// Get the value
+ TAO_PSDL_Node *simple_declarator (void) const;
+ TAO_PSDL_Node *psdl_concrete_state_type (void) const;
+ TAO_PSDL_Node *storagehome_scope (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *simple_declarator_;
+ TAO_PSDL_Node *psdl_concrete_state_type_;
+ TAO_PSDL_Node *storagehome_scope_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Psdl_Concrete_State_Type : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Psdl_Concrete_State_Type (TAO_PSDL_Node *storagetype);
+
+ virtual ~TAO_PSDL_Psdl_Concrete_State_Type (void);
+
+ /// Get the value
+ TAO_PSDL_Node *storagetype (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *storagetype_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Ref_Rep_Directive : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Ref_Rep_Directive (TAO_PSDL_Node *simple_declarator);
+
+ virtual ~TAO_PSDL_Ref_Rep_Directive (void);
+
+ /// Get the value
+ TAO_PSDL_Node *simple_declarator (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *simple_declarator_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagehome : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagehome (TAO_PSDL_Node *storagehome_header);
+
+ TAO_PSDL_Storagehome (TAO_PSDL_Node *storagehome_header,
+ TAO_PSDL_Node *storagehome_body);
+
+ virtual ~TAO_PSDL_Storagehome (void);
+
+ /// Get the value
+ TAO_PSDL_Node *storagehome_header (void) const;
+ TAO_PSDL_Node *storagehome_body (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *storagehome_header_;
+ TAO_PSDL_Node *storagehome_body_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagehome_Header : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagehome_Header (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *storagetype_name,
+ TAO_PSDL_Node *storagehome_inh_spec,
+ TAO_PSDL_Node *storagehome_impl_spec);
+
+ TAO_PSDL_Storagehome_Header (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *storagetype_name,
+ TAO_PSDL_Node *storagehome_inh_spec);
+
+ TAO_PSDL_Storagehome_Header (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *storagetype_name);
+
+ virtual ~TAO_PSDL_Storagehome_Header (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *storagetype_name (void) const;
+ TAO_PSDL_Node *storagehome_inh_spec (void) const;
+ TAO_PSDL_Node *storagehome_impl_spec (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *storagetype_name_;
+ TAO_PSDL_Node *storagehome_inh_spec_;
+ TAO_PSDL_Node *storagehome_impl_spec_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagehome_Body : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagehome_Body ();
+
+ TAO_PSDL_Storagehome_Body (TAO_PSDL_Node *storagehome_member);
+
+ TAO_PSDL_Storagehome_Body (TAO_PSDL_Node *storagehome_member,
+ TAO_PSDL_Node *storagehome_body);
+
+ virtual ~TAO_PSDL_Storagehome_Body (void);
+
+ /// Get the value
+ TAO_PSDL_Node *storagehome_member (void) const;
+ TAO_PSDL_Node *storagehome_body (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *storagehome_member_;
+ TAO_PSDL_Node *storagehome_body_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagehome_Member : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagehome_Member (TAO_PSDL_Node *key_dcl);
+
+ virtual ~TAO_PSDL_Storagehome_Member (void);
+
+ /// Get the value
+ TAO_PSDL_Node *key_dcl (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *key_dcl_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagehome_Inh_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagehome_Inh_Spec (TAO_PSDL_Node *storagehome_name);
+
+ virtual ~TAO_PSDL_Storagehome_Inh_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *storagehome_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *storagehome_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagehome_Name : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagehome_Name (TAO_PSDL_Node *scoped_name);
+
+ virtual ~TAO_PSDL_Storagehome_Name (void);
+
+ /// Get the value
+ TAO_PSDL_Node *scoped_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *scoped_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Storagehome_Impl_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Storagehome_Impl_Spec (TAO_PSDL_Node *abstract_storagehome_name);
+
+ virtual ~TAO_PSDL_Storagehome_Impl_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *abstract_storagehome_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *abstract_storagehome_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Primary_Key_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Primary_Key_Dcl ();
+
+ TAO_PSDL_Primary_Key_Dcl (TAO_PSDL_Node *identifier);
+
+ virtual ~TAO_PSDL_Primary_Key_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *identifier_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Identifier : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Identifier (char *value);
+
+ TAO_PSDL_Identifier (int value_type);
+
+ virtual ~TAO_PSDL_Identifier (void);
+
+ /// Get the value
+ char *value (void) const;
+
+ int value_type (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ char *value_;
+ int value_type_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Type_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Type_Dcl (TAO_PSDL_Node *type_of_type_dcl);
+
+ TAO_PSDL_Type_Dcl (int key_word,
+ TAO_PSDL_Node *type_of_type_dcl);
+
+ virtual ~TAO_PSDL_Type_Dcl (void);
+
+ /// Get the value
+ int key_word (void) const;
+ TAO_PSDL_Node *type_of_type_dcl (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ int key_word_;
+ TAO_PSDL_Node *type_of_type_dcl_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Type_Declarator : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Type_Declarator (TAO_PSDL_Node *type_spec,
+ TAO_PSDL_Node *declarators);
+
+ virtual ~TAO_PSDL_Type_Declarator (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_spec (void) const;
+ TAO_PSDL_Node *declarators (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *type_spec_;
+ TAO_PSDL_Node *declarators_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Type_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Type_Spec (TAO_PSDL_Node *type_of_type_spec);
+
+ virtual ~TAO_PSDL_Type_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_of_type_spec (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *type_of_type_spec_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Simple_Type_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Simple_Type_Spec (TAO_PSDL_Node *type_of_simple_type_spec);
+
+ virtual ~TAO_PSDL_Simple_Type_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_of_simple_type_spec (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *type_of_simple_type_spec_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Base_Type_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Base_Type_Spec (TAO_PSDL_Node *type_of_base_type_spec);
+
+ virtual ~TAO_PSDL_Base_Type_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_of_base_type_spec (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *type_of_base_type_spec_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Template_Type_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Template_Type_Spec (TAO_PSDL_Node *type_of_template_type_spec);
+
+ virtual ~TAO_PSDL_Template_Type_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_of_template_type_spec (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *type_of_template_type_spec_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Constr_Type_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Constr_Type_Spec (TAO_PSDL_Node *type_of_constr_type_spec);
+
+ virtual ~TAO_PSDL_Constr_Type_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_of_constr_type_spec (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *type_of_constr_type_spec_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Declarators : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Declarators (TAO_PSDL_Node *declarator);
+
+ TAO_PSDL_Declarators (TAO_PSDL_Node *declarator,
+ TAO_PSDL_Node *set_of_declarators);
+
+ virtual ~TAO_PSDL_Declarators (void);
+
+ /// Get the value
+ TAO_PSDL_Node *declarator (void) const;
+ TAO_PSDL_Node *set_of_declarators (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *declarator_;
+ TAO_PSDL_Node *set_of_declarators_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Declarator : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Declarator (TAO_PSDL_Node *type_of_declarator);
+
+ virtual ~TAO_PSDL_Declarator (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_of_declarator (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *type_of_declarator_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Simple_Declarator : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Simple_Declarator (TAO_PSDL_Node *identifier);
+ TAO_PSDL_Simple_Declarator (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *simple_declarator);
+
+ virtual ~TAO_PSDL_Simple_Declarator (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *simple_declarator (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *simple_declarator_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Simple_Declarator_List : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Simple_Declarator_List (TAO_PSDL_Node *simple_declarator);
+
+ TAO_PSDL_Simple_Declarator_List (TAO_PSDL_Node *simple_declarator_list,
+ TAO_PSDL_Node *simple_declarator);
+
+ virtual ~TAO_PSDL_Simple_Declarator_List (void);
+
+ /// Get the value
+ TAO_PSDL_Node *simple_declarator_list (void) const;
+ TAO_PSDL_Node *simple_declarator (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *simple_declarator_list_;
+ TAO_PSDL_Node *simple_declarator_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Complex_Declarator : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Complex_Declarator (TAO_PSDL_Node *array_declarator);
+
+ virtual ~TAO_PSDL_Complex_Declarator (void);
+
+ /// Get the value
+ TAO_PSDL_Node *array_declarator (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *array_declarator_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Predefined_Type : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Predefined_Type (int type_one);
+
+ TAO_PSDL_Predefined_Type (int type_one,
+ int type_two);
+
+ TAO_PSDL_Predefined_Type (int type_one,
+ int type_two,
+ int type_three);
+
+ TAO_PSDL_Predefined_Type (int type_one,
+ TAO_PSDL_Node *type_of_variable_one);
+
+ TAO_PSDL_Predefined_Type (TAO_PSDL_Node *type_of_variable_one);
+
+ TAO_PSDL_Predefined_Type (int type_one,
+ TAO_PSDL_Node *type_of_variable_one,
+ TAO_PSDL_Node *type_of_variable_two);
+
+ TAO_PSDL_Predefined_Type (TAO_PSDL_Node *type_of_variable_one,
+ TAO_PSDL_Node *type_of_variable_two);
+
+ TAO_PSDL_Predefined_Type (TAO_PSDL_Node *type_of_variable_one,
+ TAO_PSDL_Node *type_of_variable_two,
+ TAO_PSDL_Node *type_of_variable_three);
+
+ virtual ~TAO_PSDL_Predefined_Type (void);
+
+ /// Get the value
+ int type_one (void) const;
+ int type_two (void) const;
+ int type_three (void) const;
+ TAO_PSDL_Node *type_of_variable_one (void) const;
+ TAO_PSDL_Node *type_of_variable_two (void) const;
+ TAO_PSDL_Node *type_of_variable_three (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ int type_one_;
+ int type_two_;
+ int type_three_;
+
+ TAO_PSDL_Node *type_of_variable_one_;
+ TAO_PSDL_Node *type_of_variable_two_;
+ TAO_PSDL_Node *type_of_variable_three_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Member_List : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Member_List (TAO_PSDL_Node *member);
+ TAO_PSDL_Member_List (TAO_PSDL_Node *member,
+ TAO_PSDL_Node *member_list);
+
+ virtual ~TAO_PSDL_Member_List (void);
+
+ /// Get the value
+ TAO_PSDL_Node *member (void) const;
+ TAO_PSDL_Node *member_list (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *member_;
+ TAO_PSDL_Node *member_list_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Member : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Member (TAO_PSDL_Node *type_spec,
+ TAO_PSDL_Node *declarators);
+
+ virtual ~TAO_PSDL_Member (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_spec (void) const;
+ TAO_PSDL_Node *declarators (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *type_spec_;
+ TAO_PSDL_Node *declarators_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Union_Type : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Union_Type (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *switch_type_spec,
+ TAO_PSDL_Node *switch_body);
+
+ virtual ~TAO_PSDL_Union_Type (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *switch_type_spec (void) const;
+ TAO_PSDL_Node *switch_body (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *switch_type_spec_;
+ TAO_PSDL_Node *switch_body_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Switch_Type_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Switch_Type_Spec (TAO_PSDL_Node *type);
+
+ virtual ~TAO_PSDL_Switch_Type_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *type_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Switch_Body : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Switch_Body (TAO_PSDL_Node *switch_case);
+
+ TAO_PSDL_Switch_Body (TAO_PSDL_Node *switch_case,
+ TAO_PSDL_Node *switch_body);
+
+ virtual ~TAO_PSDL_Switch_Body (void);
+
+ /// Get the value
+ TAO_PSDL_Node *switch_case (void) const;
+ TAO_PSDL_Node *switch_body (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *switch_case_;
+ TAO_PSDL_Node *switch_body_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Case : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Case (TAO_PSDL_Node *case_label,
+ TAO_PSDL_Node *element_spec);
+
+ virtual ~TAO_PSDL_Case (void);
+
+ /// Get the value
+ TAO_PSDL_Node *case_label (void) const;
+ TAO_PSDL_Node *element_spec (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *case_label_;
+ TAO_PSDL_Node *element_spec_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Case_Label : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Case_Label (TAO_PSDL_Node * type);
+
+ TAO_PSDL_Case_Label (TAO_PSDL_Node * type,
+ TAO_PSDL_Node *const_exp);
+
+ TAO_PSDL_Case_Label (TAO_PSDL_Node * type,
+ TAO_PSDL_Node *const_exp,
+ TAO_PSDL_Node *case_label);
+
+ virtual ~TAO_PSDL_Case_Label (void);
+
+ /// Get the value
+ TAO_PSDL_Node * type (void) const;
+ TAO_PSDL_Node *const_exp (void) const;
+ TAO_PSDL_Node *case_label (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node * type_;
+ TAO_PSDL_Node *const_exp_;
+ TAO_PSDL_Node *case_label_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Element_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Element_Spec (TAO_PSDL_Node *type_spec,
+ TAO_PSDL_Node *declarator);
+
+ virtual ~TAO_PSDL_Element_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_spec (void) const;
+ TAO_PSDL_Node *declarator (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *type_spec_;
+ TAO_PSDL_Node *declarator_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Const_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Const_Dcl (TAO_PSDL_Node *const_type,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *const_exp);
+
+ virtual ~TAO_PSDL_Const_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *const_type (void) const;
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *const_exp (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *const_type_;
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *const_exp_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Const_Type : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Const_Type (TAO_PSDL_Node *type);
+
+ virtual ~TAO_PSDL_Const_Type (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *type_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Const_Exp : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Const_Exp (TAO_PSDL_Node *expr);
+
+ virtual ~TAO_PSDL_Const_Exp (void);
+
+ /// Get the value
+ TAO_PSDL_Node *expr (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *expr_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Or_Expr : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Or_Expr (TAO_PSDL_Node *xor_expr);
+ TAO_PSDL_Or_Expr (TAO_PSDL_Node *or_expr,
+ TAO_PSDL_Node *xor_expr);
+
+ virtual ~TAO_PSDL_Or_Expr (void);
+
+ /// Get the value
+ TAO_PSDL_Node *or_expr (void) const;
+ TAO_PSDL_Node *xor_expr (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *or_expr_;
+ TAO_PSDL_Node *xor_expr_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Xor_Expr : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Xor_Expr (TAO_PSDL_Node *and_expr);
+ TAO_PSDL_Xor_Expr (TAO_PSDL_Node *xor_expr,
+ TAO_PSDL_Node *and_expr);
+
+ virtual ~TAO_PSDL_Xor_Expr (void);
+
+ /// Get the value
+ TAO_PSDL_Node *xor_expr (void) const;
+ TAO_PSDL_Node *and_expr (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *xor_expr_;
+ TAO_PSDL_Node *and_expr_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_And_Expr : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_And_Expr (TAO_PSDL_Node *shift_expr);
+ TAO_PSDL_And_Expr (TAO_PSDL_Node *and_expr,
+ TAO_PSDL_Node *shift_expr);
+
+ virtual ~TAO_PSDL_And_Expr (void);
+
+ /// Get the value
+ TAO_PSDL_Node *and_expr (void) const;
+ TAO_PSDL_Node *shift_expr (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *and_expr_;
+ TAO_PSDL_Node *shift_expr_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Shift_Expr : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Shift_Expr (TAO_PSDL_Node *add_expr);
+
+ TAO_PSDL_Shift_Expr (TAO_PSDL_Node *shift_expr,
+ TAO_PSDL_Node * type,
+ TAO_PSDL_Node *add_expr);
+
+ virtual ~TAO_PSDL_Shift_Expr (void);
+
+ /// Get the value
+ TAO_PSDL_Node * type (void) const;
+ TAO_PSDL_Node *add_expr (void) const;
+ TAO_PSDL_Node *shift_expr (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *shift_expr_;
+ TAO_PSDL_Node * type_;
+ TAO_PSDL_Node *add_expr_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Add_Expr : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Add_Expr (TAO_PSDL_Node *mult_expr);
+ TAO_PSDL_Add_Expr (TAO_PSDL_Node *add_expr,
+ TAO_PSDL_Node * type,
+ TAO_PSDL_Node *mult_expr);
+
+ virtual ~TAO_PSDL_Add_Expr (void);
+
+ /// Get the value
+ TAO_PSDL_Node * type (void) const;
+ TAO_PSDL_Node *add_expr (void) const;
+ TAO_PSDL_Node *mult_expr (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *add_expr_;
+ TAO_PSDL_Node * type_;
+ TAO_PSDL_Node *mult_expr_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Mult_Expr : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Mult_Expr (TAO_PSDL_Node *unary_expr);
+
+ TAO_PSDL_Mult_Expr (TAO_PSDL_Node *mult_expr,
+ TAO_PSDL_Node *unary_expr);
+
+ TAO_PSDL_Mult_Expr (TAO_PSDL_Node *mult_expr,
+ TAO_PSDL_Node * type,
+ TAO_PSDL_Node *unary_expr);
+
+ virtual ~TAO_PSDL_Mult_Expr (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type (void) const;
+ TAO_PSDL_Node *unary_expr (void) const;
+ TAO_PSDL_Node *mult_expr (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *mult_expr_;
+ TAO_PSDL_Node * type_;
+ TAO_PSDL_Node *unary_expr_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Unary_Expr : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Unary_Expr (TAO_PSDL_Node *unary_operator,
+ TAO_PSDL_Node *primary_expr);
+
+ TAO_PSDL_Unary_Expr (TAO_PSDL_Node *primary_expr);
+
+ virtual ~TAO_PSDL_Unary_Expr (void);
+
+ /// Get the value
+ TAO_PSDL_Node *unary_operator (void) const;
+ TAO_PSDL_Node *primary_expr (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *unary_operator_;
+ TAO_PSDL_Node *primary_expr_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Primary_Expr : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Primary_Expr (TAO_PSDL_Node *type_of_primary_expr);
+
+ virtual ~TAO_PSDL_Primary_Expr (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_of_primary_expr (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *type_of_primary_expr_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Except_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Except_Dcl (TAO_PSDL_Node *identifier);
+
+ TAO_PSDL_Except_Dcl (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *member_list);
+
+ virtual ~TAO_PSDL_Except_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *member_list (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *member_list_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Op_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Op_Dcl (TAO_PSDL_Node *op_attribute,
+ TAO_PSDL_Node *op_type_spec,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node * parameter_dcls,
+ TAO_PSDL_Node * raises_expr,
+ TAO_PSDL_Node * context_expr);
+
+ TAO_PSDL_Op_Dcl (TAO_PSDL_Node *op_type_spec,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node * parameter_dcls,
+ TAO_PSDL_Node * raises_expr,
+ TAO_PSDL_Node * context_expr);
+
+ TAO_PSDL_Op_Dcl (TAO_PSDL_Node *op_type_spec,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node * parameter_dcls,
+ TAO_PSDL_Node * raises_expr);
+
+ /*
+ Other kinds of similar constructors.
+
+ TAO_PSDL_Op_Dcl (TAO_PSDL_Node *op_attribute,
+ TAO_PSDL_Node *op_type_spec,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node * parameter_dcls,
+ TAO_PSDL_Node * raises_expr);
+
+ TAO_PSDL_Op_Dcl (TAO_PSDL_Node *op_attribute,
+ TAO_PSDL_Node *op_type_spec,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node * parameter_dcls,
+ TAO_PSDL_Node * context_expr);
+ */
+
+ TAO_PSDL_Op_Dcl (TAO_PSDL_Node *op_type_spec,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node * parameter_dcls);
+
+ virtual ~TAO_PSDL_Op_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *op_attribute (void) const;
+ TAO_PSDL_Node *op_type_spec (void) const;
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node * parameter_dcls (void) const;
+ TAO_PSDL_Node * raises_expr (void) const;
+ TAO_PSDL_Node * context_expr (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *op_attribute_;
+ TAO_PSDL_Node *op_type_spec_;
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node * parameter_dcls_;
+ TAO_PSDL_Node * raises_expr_;
+ TAO_PSDL_Node * context_expr_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Op_Type_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Op_Type_Spec (TAO_PSDL_Node *type_spec);
+
+ TAO_PSDL_Op_Type_Spec (int type);
+
+ virtual ~TAO_PSDL_Op_Type_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_spec (void) const;
+ int type (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node * type_spec_;
+ int type_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Parameter_Dcls : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Parameter_Dcls ();
+ TAO_PSDL_Parameter_Dcls (TAO_PSDL_Node *param_dcl);
+
+ virtual ~TAO_PSDL_Parameter_Dcls (void);
+
+ /// Get the value
+ TAO_PSDL_Node *param_dcl (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *param_dcl_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Param_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Param_Dcl (TAO_PSDL_Node *param_attribute,
+ TAO_PSDL_Node *param_type_spec,
+ TAO_PSDL_Node *simple_declarator);
+
+ TAO_PSDL_Param_Dcl (TAO_PSDL_Node *param_attribute,
+ TAO_PSDL_Node *param_type_spec,
+ TAO_PSDL_Node *simple_declarator,
+ TAO_PSDL_Node *param_dcl);
+
+ virtual ~TAO_PSDL_Param_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *param_attribute (void) const;
+ TAO_PSDL_Node *param_type_spec (void) const;
+ TAO_PSDL_Node *simple_declarator (void) const;
+ TAO_PSDL_Node *param_dcl (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *param_attribute_;
+ TAO_PSDL_Node *param_type_spec_;
+ TAO_PSDL_Node *simple_declarator_;
+ TAO_PSDL_Node *param_dcl_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Raises_Expr : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Raises_Expr (TAO_PSDL_Node *first_scoped_name);
+
+ TAO_PSDL_Raises_Expr (TAO_PSDL_Node *first_scoped_name,
+ TAO_PSDL_Node *second_scoped_name);
+
+ virtual ~TAO_PSDL_Raises_Expr (void);
+
+ /// Get the value
+ TAO_PSDL_Node *first_scoped_name (void) const;
+ TAO_PSDL_Node *second_scoped_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *first_scoped_name_;
+ TAO_PSDL_Node *second_scoped_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Context_Expr : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Context_Expr (TAO_PSDL_Node *string_literal);
+
+ virtual ~TAO_PSDL_Context_Expr (void);
+
+ /// Get the value
+ TAO_PSDL_Node *string_literal (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *string_literal_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Param_Type_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Param_Type_Spec (TAO_PSDL_Node *type_of_param);
+
+ virtual ~TAO_PSDL_Param_Type_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_of_param (void) const;
+
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *type_of_param_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Fixed_Pt_Type : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Fixed_Pt_Type (TAO_PSDL_Node *positive_int_const_one,
+ TAO_PSDL_Node *positive_int_const_two);
+
+ virtual ~TAO_PSDL_Fixed_Pt_Type (void);
+
+ /// Get the value
+ TAO_PSDL_Node *positive_int_const_one (void) const;
+ TAO_PSDL_Node *positive_int_const_two (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *positive_int_const_one_;
+ TAO_PSDL_Node *positive_int_const_two_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Constr_Forward_Decl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Constr_Forward_Decl (TAO_PSDL_Node * type,
+ TAO_PSDL_Node *identifier);
+
+ virtual ~TAO_PSDL_Constr_Forward_Decl (void);
+
+ /// Get the value
+ TAO_PSDL_Node * type (void) const;
+ TAO_PSDL_Node *identifier (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node * type_;
+ TAO_PSDL_Node *identifier_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Interface : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Interface (TAO_PSDL_Node *type_of_dcl);
+
+ virtual ~TAO_PSDL_Interface (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_of_dcl (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *type_of_dcl_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Interface_Body : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Interface_Body (TAO_PSDL_Node *export_variable);
+
+ TAO_PSDL_Interface_Body (TAO_PSDL_Node *export_variable,
+ TAO_PSDL_Node *interface_body);
+
+ virtual ~TAO_PSDL_Interface_Body (void);
+
+ /// Get the value
+ TAO_PSDL_Node *export_variable (void) const;
+ TAO_PSDL_Node *interface_body (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+ /// The values
+ TAO_PSDL_Node *export_variable_;
+ TAO_PSDL_Node *interface_body_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Interface_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Interface_Dcl (TAO_PSDL_Node *interface_header);
+
+ TAO_PSDL_Interface_Dcl (TAO_PSDL_Node *interface_header,
+ TAO_PSDL_Node *interface_body);
+
+ virtual ~TAO_PSDL_Interface_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *interface_header (void) const;
+ TAO_PSDL_Node *interface_body (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *interface_header_;
+ TAO_PSDL_Node *interface_body_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Forward_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Forward_Dcl (TAO_PSDL_Node *identifier);
+
+ TAO_PSDL_Forward_Dcl (int type,
+ TAO_PSDL_Node *identifier);
+
+ virtual ~TAO_PSDL_Forward_Dcl (void);
+
+ /// Get the value
+ int type (void) const;
+ TAO_PSDL_Node *identifier (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ int type_;
+ TAO_PSDL_Node *identifier_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Interface_Header : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Interface_Header (TAO_PSDL_Node *identifier);
+
+ TAO_PSDL_Interface_Header (TAO_PSDL_Node * type,
+ TAO_PSDL_Node *identifier);
+
+ TAO_PSDL_Interface_Header (TAO_PSDL_Node * type,
+ TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *interface_inheritance_spec);
+
+ /*
+ Other Possible values.
+ TAO_PSDL_Interface_Header (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *interface_inheritance_spec);
+ */
+
+ virtual ~TAO_PSDL_Interface_Header (void);
+
+ /// Get the value
+ TAO_PSDL_Node * type (void) const;
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *interface_inheritance_spec (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+
+ /// the value of type can be either type_ or
+ /// interface_inheritance_spec_ if interface_inheritance_spec_ is
+ /// zero. If it is not zero, everything is straight forward.
+ TAO_PSDL_Node * type_;
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *interface_inheritance_spec_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Export_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Export_Dcl (TAO_PSDL_Node *type_of_export_one);
+
+ TAO_PSDL_Export_Dcl (TAO_PSDL_Node *type_of_export_one,
+ TAO_PSDL_Node *type_of_export_two);
+
+ virtual ~TAO_PSDL_Export_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_of_export_one (void) const;
+ TAO_PSDL_Node *type_of_export_two (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *type_of_export_one_;
+ TAO_PSDL_Node *type_of_export_two_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Interface_Inheritance_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Interface_Inheritance_Spec (TAO_PSDL_Node *interface_name);
+
+ virtual ~TAO_PSDL_Interface_Inheritance_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *interface_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *interface_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Interface_Name : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Interface_Name (TAO_PSDL_Node *scoped_name);
+ TAO_PSDL_Interface_Name (TAO_PSDL_Node *scoped_name,
+ TAO_PSDL_Node *interface_name);
+
+ virtual ~TAO_PSDL_Interface_Name (void);
+
+ /// Get the value
+ TAO_PSDL_Node *scoped_name (void) const;
+ TAO_PSDL_Node *interface_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *scoped_name_;
+ TAO_PSDL_Node *interface_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Scoped_Name : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Scoped_Name (TAO_PSDL_Node *identifier);
+ TAO_PSDL_Scoped_Name (TAO_PSDL_Node *scoped_name,
+ TAO_PSDL_Node *identifier);
+
+ virtual ~TAO_PSDL_Scoped_Name (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *scoped_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *scoped_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Value : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Value (TAO_PSDL_Node *type_of_value_dcl);
+ virtual ~TAO_PSDL_Value (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_of_value_dcl (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *type_of_value_dcl_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Value_Common_Base : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Value_Common_Base (TAO_PSDL_Node *identifier);
+ virtual ~TAO_PSDL_Value_Common_Base (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *identifier_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Value_Forward_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Value_Forward_Dcl (TAO_PSDL_Node *value_common_base);
+ TAO_PSDL_Value_Forward_Dcl (TAO_PSDL_Node *abstract,
+ TAO_PSDL_Node *value_common_base);
+ virtual ~TAO_PSDL_Value_Forward_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *abstract (void) const;
+ TAO_PSDL_Node *value_common_base (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *value_common_base_;
+ TAO_PSDL_Node *abstract_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Value_Box_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Value_Box_Dcl (TAO_PSDL_Node *value_common_base,
+ TAO_PSDL_Node *type_spec);
+ virtual ~TAO_PSDL_Value_Box_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *value_common_base (void) const;
+ TAO_PSDL_Node *type_spec (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *value_common_base_;
+ TAO_PSDL_Node *type_spec_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Value_Abs_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Value_Abs_Dcl (TAO_PSDL_Node *value_common_base,
+ TAO_PSDL_Node *export_variable);
+
+ TAO_PSDL_Value_Abs_Dcl (TAO_PSDL_Node *value_common_base,
+ TAO_PSDL_Node *value_inheritance_spec,
+ TAO_PSDL_Node *export_variable);
+
+ virtual ~TAO_PSDL_Value_Abs_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *value_common_base (void) const;
+ TAO_PSDL_Node *value_inheritance_spec (void) const;
+ TAO_PSDL_Node *export_variable (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *value_common_base_;
+ TAO_PSDL_Node *value_inheritance_spec_;
+ TAO_PSDL_Node *export_variable_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Value_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Value_Dcl (TAO_PSDL_Node *value_header,
+ TAO_PSDL_Node *value_element);
+
+ virtual ~TAO_PSDL_Value_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *value_header (void) const;
+ TAO_PSDL_Node *value_element (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *value_header_;
+ TAO_PSDL_Node *value_element_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Value_Header : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Value_Header (TAO_PSDL_Node *value_common_base,
+ TAO_PSDL_Node *value_inheritance_spec);
+
+ TAO_PSDL_Value_Header (TAO_PSDL_Node *custom,
+ TAO_PSDL_Node *value_common_base,
+ TAO_PSDL_Node *value_inheritance_spec);
+
+ virtual ~TAO_PSDL_Value_Header (void);
+
+ /// Get the value
+ TAO_PSDL_Node *custom (void) const;
+ TAO_PSDL_Node *value_common_base (void) const;
+ TAO_PSDL_Node *value_inheritance_spec (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *custom_;
+ TAO_PSDL_Node *value_common_base_;
+ TAO_PSDL_Node *value_inheritance_spec_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Value_Inheritance_Spec : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Value_Inheritance_Spec (TAO_PSDL_Node *interface_name);
+
+ /*
+ Other forms
+ TAO_PSDL_Value_Inheritance_Spec (TAO_PSDL_Node *value_name);
+ */
+
+ TAO_PSDL_Value_Inheritance_Spec (TAO_PSDL_Node *value_name,
+ TAO_PSDL_Node *interface_name);
+
+ /*
+ Other forms of similar constuctors
+ TAO_PSDL_Value_Inheritance_Spec (TAO_PSDL_Node *truncatable,
+ TAO_PSDL_Node *value_name,
+ */
+
+ TAO_PSDL_Value_Inheritance_Spec (TAO_PSDL_Node *truncatable,
+ TAO_PSDL_Node *value_name,
+ TAO_PSDL_Node *interface_name);
+
+ virtual ~TAO_PSDL_Value_Inheritance_Spec (void);
+
+ /// Get the value
+ TAO_PSDL_Node *truncatable (void) const;
+ TAO_PSDL_Node *value_name (void) const;
+ TAO_PSDL_Node *interface_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *truncatable_;
+ TAO_PSDL_Node *value_name_;
+ TAO_PSDL_Node *interface_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Value_Name : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Value_Name (TAO_PSDL_Node *scoped_name);
+
+ TAO_PSDL_Value_Name (TAO_PSDL_Node *scoped_name,
+ TAO_PSDL_Node *value_name);
+
+ virtual ~TAO_PSDL_Value_Name (void);
+
+ /// Get the value
+ TAO_PSDL_Node *scoped_name (void) const;
+ TAO_PSDL_Node *value_name (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *scoped_name_;
+ TAO_PSDL_Node *value_name_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Value_Element : public TAO_PSDL_Node
+{
+public:
+
+ /// type_of_element can be export | state_member | init_dcl
+ TAO_PSDL_Value_Element (TAO_PSDL_Node *type_of_element);
+
+ virtual ~TAO_PSDL_Value_Element (void);
+
+ /// Get the value
+ TAO_PSDL_Node *type_of_element (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *type_of_element_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Array_Declarator : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Array_Declarator (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *fixed_array_size);
+
+ virtual ~TAO_PSDL_Array_Declarator (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *fixed_array_size (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *fixed_array_size_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Fixed_Array_Size : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Fixed_Array_Size (TAO_PSDL_Node *positive_int_const);
+
+ virtual ~TAO_PSDL_Fixed_Array_Size (void);
+
+ /// Get the value
+ TAO_PSDL_Node *positive_int_const (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *positive_int_const_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Attr_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Attr_Dcl (int readonly,
+ TAO_PSDL_Node *param_type_spec,
+ TAO_PSDL_Node *simple_declarator);
+
+ TAO_PSDL_Attr_Dcl (TAO_PSDL_Node *param_type_spec,
+ TAO_PSDL_Node *simple_declarator);
+
+ virtual ~TAO_PSDL_Attr_Dcl (void);
+
+ /// Get the value
+ int readonly (void) const;
+ TAO_PSDL_Node *param_type_spec (void) const;
+ TAO_PSDL_Node *simple_declarator (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ int readonly_;
+ TAO_PSDL_Node *param_type_spec_;
+ TAO_PSDL_Node *simple_declarator_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Enumerator : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Enumerator (TAO_PSDL_Node *identifier);
+
+ TAO_PSDL_Enumerator (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *enumerator);
+
+ virtual ~TAO_PSDL_Enumerator (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *enumerator (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *enumerator_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Literal : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Literal (CORBA::Boolean boolean_value);
+
+ TAO_PSDL_Literal (int int_value);
+
+ TAO_PSDL_Literal (double double_value);
+
+ TAO_PSDL_Literal (const char *char_value);
+
+ virtual ~TAO_PSDL_Literal (void);
+
+ /// Get the value
+ CORBA::Boolean boolean_value (void) const;
+ int int_value (void) const;
+ double double_value (void) const;
+ const char *char_value (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ CORBA::Boolean boolean_value_;
+ int int_value_;
+ double double_value_;
+ const char *char_value_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_State_Member : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_State_Member (TAO_PSDL_Node *public_or_private,
+ TAO_PSDL_Node *type_spec,
+ TAO_PSDL_Node *declarators);
+
+ /* Other forms
+ TAO_PSDL_State_Member (TAO_PSDL_Node *public_or_private,
+ TAO_PSDL_Node *type_spec,
+ TAO_PSDL_Node *declarators);
+ */
+
+ virtual ~TAO_PSDL_State_Member (void);
+
+ /// Get the value
+ TAO_PSDL_Node *public_or_private (void) const;
+ TAO_PSDL_Node *type_spec (void) const;
+ TAO_PSDL_Node *declarators (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *public_or_private_;
+ TAO_PSDL_Node *type_spec_;
+ TAO_PSDL_Node *declarators_;
+
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Init_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Init_Dcl (TAO_PSDL_Node *identifier);
+
+ TAO_PSDL_Init_Dcl (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *init_param_decls);
+
+ virtual ~TAO_PSDL_Init_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *init_param_decls (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *init_param_decls_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Init_Param_Decls : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Init_Param_Decls (TAO_PSDL_Node *init_param_decl);
+
+ TAO_PSDL_Init_Param_Decls (TAO_PSDL_Node *init_param_decl,
+ TAO_PSDL_Node *init_param_decls);
+
+ virtual ~TAO_PSDL_Init_Param_Decls (void);
+
+ /// Get the value
+ TAO_PSDL_Node *init_param_decl (void) const;
+ TAO_PSDL_Node *init_param_decls (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *init_param_decl_;
+ TAO_PSDL_Node *init_param_decls_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Init_Param_Decl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Init_Param_Decl (TAO_PSDL_Node *init_param_attribute,
+ TAO_PSDL_Node *param_type_spec,
+ TAO_PSDL_Node *simple_declarator);
+
+ virtual ~TAO_PSDL_Init_Param_Decl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *init_param_attribute (void) const;
+ TAO_PSDL_Node *param_type_spec (void) const;
+ TAO_PSDL_Node *simple_declarator (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *init_param_attribute_;
+ TAO_PSDL_Node *param_type_spec_;
+ TAO_PSDL_Node *simple_declarator_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Positive_Int_Const : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Positive_Int_Const (TAO_PSDL_Node *const_exp);
+
+ virtual ~TAO_PSDL_Positive_Int_Const (void);
+
+ /// Get the value
+ TAO_PSDL_Node *const_exp (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *const_exp_;
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Factory_Dcl : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Factory_Dcl (TAO_PSDL_Node *identifier,
+ TAO_PSDL_Node *factory_parameters);
+
+ virtual ~TAO_PSDL_Factory_Dcl (void);
+
+ /// Get the value
+ TAO_PSDL_Node *identifier (void) const;
+ TAO_PSDL_Node *factory_parameters (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *identifier_;
+ TAO_PSDL_Node *factory_parameters_;
+
+};
+
+/// ****************************************************************
+
+class TAO_PSDL_Export TAO_PSDL_Factory_Parameters : public TAO_PSDL_Node
+{
+public:
+
+ TAO_PSDL_Factory_Parameters ();
+ TAO_PSDL_Factory_Parameters (TAO_PSDL_Node *simple_declarator);
+
+ virtual ~TAO_PSDL_Factory_Parameters (void);
+
+ /// Get the value
+ TAO_PSDL_Node *simple_declarator (void) const;
+
+ /// = The Node methods.
+ int accept (TAO_PSDL_Node_Visitor *visitor);
+
+private:
+
+ /// The values
+ TAO_PSDL_Node *simple_declarator_;
+};
+
+#endif /* TAO_PSDL_NODE_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Node_Visitor.cpp b/TAO/orbsvcs/PSS/PSDL_Node_Visitor.cpp
new file mode 100644
index 00000000000..5bd628fd5d4
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Node_Visitor.cpp
@@ -0,0 +1,647 @@
+// $Id$
+
+#include "PSDL_Node_Visitor.h"
+#include "PSDL_Visitor_Factory.h"
+#include "PSDL_Typecode_Defn.h"
+#include "PSDL_y.h"
+
+TAO_PSDL_Node_Visitor::TAO_PSDL_Node_Visitor ()
+ : identifiers_ (0),
+ predefined_type_ (0),
+ count_ (0),
+ node_visitor_ (0)
+{
+ ACE_NEW (this->visitor_factory_,
+ TAO_PSDL_Visitor_Factory);
+}
+
+TAO_PSDL_Node_Visitor::~TAO_PSDL_Node_Visitor ()
+{
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_specification (TAO_PSDL_Specification *specification)
+{
+ if (specification->definition ()->accept (this) == -1)
+ return -1;
+
+ if (specification->specification () != 0)
+ {
+ if (specification->specification ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_definition (TAO_PSDL_Definition *definition)
+{
+ if (definition->definition_type ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_module (TAO_PSDL_Module *module)
+{
+ this->node_visitor_ =
+ this->visitor_factory_->make_visitor (module->type_of_node ());
+
+ if (this->node_visitor_ != 0)
+ {
+ return this->node_visitor_->visit_module (module);
+ }
+ else
+ {
+ return -1;
+ }
+}
+
+int TAO_PSDL_Node_Visitor::visit_abstract_storagetype (TAO_PSDL_Abstract_Storagetype *)
+{ return 0; }
+
+int
+TAO_PSDL_Node_Visitor::visit_abstract_storagetype_dcl (TAO_PSDL_Abstract_Storagetype_Dcl *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_abstract_storagetype_fwd_dcl (TAO_PSDL_Abstract_Storagetype_Fwd_Dcl *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_abstract_storagetype_header (TAO_PSDL_Abstract_Storagetype_Header *)
+{
+ return 0;
+}
+
+int TAO_PSDL_Node_Visitor::visit_abstract_storagetype_body (TAO_PSDL_Abstract_Storagetype_Body *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_abstract_storagetype_member (TAO_PSDL_Abstract_Storagetype_Member *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_abstract_storagetype_inh_spec (TAO_PSDL_Abstract_Storagetype_Inh_Spec *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_abstract_storagetype_name (TAO_PSDL_Abstract_Storagetype_Name *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_psdl_state_dcl (TAO_PSDL_Psdl_State_Dcl *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_psdl_state_type_spec (TAO_PSDL_Psdl_State_Type_Spec *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_abstract_storagetype_ref_type (TAO_PSDL_Abstract_Storagetype_Ref_Type)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_abstract_storagehome (TAO_PSDL_Abstract_Storagehome *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_abstract_storagehome_fwd_dcl (TAO_PSDL_Abstract_Storagehome_Fwd_Dcl *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_abstract_storagehome_dcl (TAO_PSDL_Abstract_Storagehome_Dcl *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_abstract_storagehome_header (TAO_PSDL_Abstract_Storagehome_Header *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_abstract_storagehome_body (TAO_PSDL_Abstract_Storagehome_Body *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_abstract_storagehome_member (TAO_PSDL_Abstract_Storagehome_Member *)
+{
+ return 0;
+}
+
+int TAO_PSDL_Node_Visitor::visit_abstract_storagehome_inh_spec (TAO_PSDL_Abstract_Storagehome_Inh_Spec *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_abstract_storagehome_name (TAO_PSDL_Abstract_Storagehome_Name *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_local_op_dcl (TAO_PSDL_Local_Op_Dcl *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_key_dcl (TAO_PSDL_Key_Dcl *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_catalog (TAO_PSDL_Catalog *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_catalog_inh_spec (TAO_PSDL_Catalog_Inh_Spec *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_catalog_name (TAO_PSDL_Catalog_Name *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_catalog_body (TAO_PSDL_Catalog_Body *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_catalog_member (TAO_PSDL_Catalog_Member *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagetype_member (TAO_PSDL_Storagetype_Member *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagetype_inh_spec (TAO_PSDL_Storagetype_Inh_Spec *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagetype_name (TAO_PSDL_Storagetype_Name *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagetype_impl_spec (TAO_PSDL_Storagetype_Impl_Spec *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagetype_ref_type (TAO_PSDL_Storagetype_Ref_Type *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_store_directive (TAO_PSDL_Store_Directive *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_psdl_concrete_state_type (TAO_PSDL_Psdl_Concrete_State_Type *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_ref_rep_directive (TAO_PSDL_Ref_Rep_Directive *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagehome (TAO_PSDL_Storagehome *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagehome_header (TAO_PSDL_Storagehome_Header *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagehome_body (TAO_PSDL_Storagehome_Body *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagehome_member (TAO_PSDL_Storagehome_Member *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagehome_inh_spec (TAO_PSDL_Storagehome_Inh_Spec *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagehome_name (TAO_PSDL_Storagehome_Name *) { return 0; }
+
+int TAO_PSDL_Node_Visitor::visit_storagehome_impl_spec (TAO_PSDL_Storagehome_Impl_Spec *) { return 0; }
+
+int
+TAO_PSDL_Node_Visitor::visit_primary_key_dcl (TAO_PSDL_Primary_Key_Dcl *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_identifier (TAO_PSDL_Identifier *identifier)
+{
+ if (this->identifiers_.size () == 0)
+ {
+ this->identifiers_.size (1);
+ this->count_ = 0;
+ }
+
+ this->identifiers_ [this->count_] = identifier->value ();
+ ++this->count_;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_type_dcl (TAO_PSDL_Type_Dcl *type_dcl)
+{
+ if (type_dcl->type_of_type_dcl ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_type_declarator (TAO_PSDL_Type_Declarator *type_declarator)
+{
+ int type = TAO_PSDL_TYPEDEF;
+ this->node_visitor_ =
+ this->visitor_factory_->make_visitor (type);
+
+ // Generates code into the client header
+ if (this->node_visitor_ != 0)
+ return this->node_visitor_->visit_type_declarator (type_declarator);
+ else
+ return -1;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_type_spec (TAO_PSDL_Type_Spec *type_spec)
+{
+ if (type_spec->type_of_type_spec ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_simple_type_spec (TAO_PSDL_Simple_Type_Spec *simple_type_spec)
+{
+ if (simple_type_spec->type_of_simple_type_spec ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_base_type_spec (TAO_PSDL_Base_Type_Spec *base_type_spec)
+{
+
+
+ if (base_type_spec->type_of_base_type_spec ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_template_type_spec (TAO_PSDL_Template_Type_Spec *template_type_spec)
+{
+ if (template_type_spec->type_of_template_type_spec ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_constr_type_spec (TAO_PSDL_Constr_Type_Spec *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_declarators (TAO_PSDL_Declarators *declarators)
+{
+ if (declarators->declarator ()->accept (this) == -1)
+ return -1;
+
+ if (declarators->set_of_declarators () != 0)
+ {
+ if (declarators->set_of_declarators ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_declarator (TAO_PSDL_Declarator *declarator)
+{
+ if (declarator->type_of_declarator ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_simple_declarator (TAO_PSDL_Simple_Declarator *simple_declarator)
+{
+ if (simple_declarator->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (simple_declarator->simple_declarator () != 0)
+ {
+ if (simple_declarator->simple_declarator ()->accept (this) == -1)
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_simple_declarator_list (TAO_PSDL_Simple_Declarator_List *) { return 0; }
+
+int
+TAO_PSDL_Node_Visitor::visit_complex_declarator (TAO_PSDL_Complex_Declarator *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type)
+{
+ if (predefined_type->type_one () != 0)
+ {
+ // @@ mainly for case 291:struct as of now.
+ this->node_visitor_ =
+ this->visitor_factory_->make_visitor (predefined_type->type_one ());
+
+ if (this->node_visitor_ != 0)
+ {
+ int result =
+ this->node_visitor_->visit_predefined_type (predefined_type);
+
+ if (result != 0)
+ return result;
+
+ this->node_visitor_->gen_code_for_si ();
+ this->node_visitor_->gen_code_for_sinline ();
+ }
+ }
+
+ if (predefined_type->type_two () != 0)
+ {}
+
+ if (predefined_type->type_three () != 0)
+ {}
+
+ // @@ Abt predefined PSDL_Nodes later.
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_member_list (TAO_PSDL_Member_List *member_list)
+{
+ if (member_list->member ()->accept (this) == -1)
+ return -1;
+
+ if (member_list->member_list () != 0)
+ {
+ if (member_list->member_list ()->accept (this) == -1)
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_member (TAO_PSDL_Member *member)
+{
+ if (member->type_spec ()->accept (this) == -1)
+ return -1;
+
+ if (member->declarators ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_union_type (TAO_PSDL_Union_Type *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_switch_type_spec (TAO_PSDL_Switch_Type_Spec *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_switch_body (TAO_PSDL_Switch_Body *)
+{
+ return 0;
+}
+
+int TAO_PSDL_Node_Visitor::visit_case_case (TAO_PSDL_Case *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_case_label (TAO_PSDL_Case_Label *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_element_spec (TAO_PSDL_Element_Spec *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_const_dcl (TAO_PSDL_Const_Dcl *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_const_type (TAO_PSDL_Const_Type *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_const_exp (TAO_PSDL_Const_Exp *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_or_expr (TAO_PSDL_Or_Expr *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_xor_expr (TAO_PSDL_Xor_Expr *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_and_expr (TAO_PSDL_And_Expr *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_shift_expr (TAO_PSDL_Shift_Expr *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_add_expr (TAO_PSDL_Add_Expr *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_mult_expr (TAO_PSDL_Mult_Expr *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_unary_expr (TAO_PSDL_Unary_Expr *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_primary_expr (TAO_PSDL_Primary_Expr *) { return 0; }
+
+int
+TAO_PSDL_Node_Visitor::visit_except_dcl (TAO_PSDL_Except_Dcl *except_dcl)
+{
+ int type = TAO_PSDL_EXCEPTION;
+ this->node_visitor_ =
+ this->visitor_factory_->make_visitor (type);
+
+ if (this->node_visitor_ != 0)
+ return this->node_visitor_->visit_except_dcl (except_dcl);
+
+ /*
+ if (except_dcl->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (except_dcl->member () != 0)
+ {
+ if (except_dcl->member ()->accept (&body_visitor) == -1)
+ return -1;
+ }
+ */
+ return -1;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_op_dcl (TAO_PSDL_Op_Dcl *)
+{
+ return 0;
+}
+
+int TAO_PSDL_Node_Visitor::visit_storagetype (TAO_PSDL_Storagetype *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagetype_dcl (TAO_PSDL_Storagetype_Dcl *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagetype_fwd_dcl (TAO_PSDL_Storagetype_Fwd_Dcl *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagetype_header (TAO_PSDL_Storagetype_Header *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagetype_body (TAO_PSDL_Storagetype_Body *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_storagehome_scope (TAO_PSDL_Storagehome_Scope *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_provides_dcl (TAO_PSDL_Provides_Dcl *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_op_type_spec (TAO_PSDL_Op_Type_Spec *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_parameter_dcls (TAO_PSDL_Parameter_Dcls *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_param_dcl (TAO_PSDL_Param_Dcl *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_raises_expr (TAO_PSDL_Raises_Expr *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_context_expr (TAO_PSDL_Context_Expr *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_param_type_spec (TAO_PSDL_Param_Type_Spec *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_fixed_pt_type (TAO_PSDL_Fixed_Pt_Type *) { return 0; }
+
+int
+TAO_PSDL_Node_Visitor::visit_constr_forward_decl (TAO_PSDL_Constr_Forward_Decl *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_interface (TAO_PSDL_Interface *interf)
+{
+ if (interf->type_of_dcl ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_interface_body (TAO_PSDL_Interface_Body *interface_body)
+{
+ if (interface_body->export_variable ()->accept (this) == -1)
+ return -1;
+
+ if (interface_body->interface_body () != 0)
+ {
+ if (interface_body->interface_body ()->accept (this) == -1)
+ return -1;
+
+ }
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_interface_dcl (TAO_PSDL_Interface_Dcl *interface_dcl)
+{
+ int type = TAO_PSDL_INTERFACE;
+ this->node_visitor_ =
+ this->visitor_factory_->make_visitor (type);
+
+ if (this->node_visitor_ != 0)
+ {
+ this->node_visitor_->visit_interface_dcl (interface_dcl);
+ this->node_visitor_->gen_code_for_si ();
+ }
+ else
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_forward_dcl (TAO_PSDL_Forward_Dcl *forward_dcl)
+{
+ int type = TAO_PSDL_INTERFACE;
+ this->node_visitor_ =
+ this->visitor_factory_->make_visitor (type);
+
+ if (this->node_visitor_ != 0)
+ return this->node_visitor_->visit_forward_dcl (forward_dcl);
+
+ return -1;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_interface_header (TAO_PSDL_Interface_Header *interface_header)
+{
+ int type = 325;
+ this->node_visitor_ =
+ this->visitor_factory_->make_visitor (type);
+
+ if (this->node_visitor_ != 0)
+ return this->node_visitor_->visit_interface_header (interface_header);
+ else
+ return -1;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_export_dcl (TAO_PSDL_Export_Dcl *export_dcl)
+{
+ if (export_dcl->type_of_export_one ()->accept (this) == -1)
+ return -1;
+
+ if (export_dcl->type_of_export_two () != 0)
+ {
+ if (export_dcl->type_of_export_two ()->accept (this) == -1)
+ return -1;
+ }
+
+ return 0;
+}
+
+int TAO_PSDL_Node_Visitor::visit_interface_inheritance_spec (TAO_PSDL_Interface_Inheritance_Spec *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_interface_name (TAO_PSDL_Interface_Name *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_scoped_name (TAO_PSDL_Scoped_Name *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_value (TAO_PSDL_Value *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_value_common_base (TAO_PSDL_Value_Common_Base *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_value_forward_dcl (TAO_PSDL_Value_Forward_Dcl *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_value_box_dcl (TAO_PSDL_Value_Box_Dcl *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_value_abs_dcl (TAO_PSDL_Value_Abs_Dcl *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_value_dcl (TAO_PSDL_Value_Dcl *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_value_header (TAO_PSDL_Value_Header *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_value_inheritance_spec (TAO_PSDL_Value_Inheritance_Spec *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_value_name (TAO_PSDL_Value_Name *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_value_element (TAO_PSDL_Value_Element *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_array_declarator (TAO_PSDL_Array_Declarator *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_fixed_array_size (TAO_PSDL_Fixed_Array_Size *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_enumerator (TAO_PSDL_Enumerator *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_literal (TAO_PSDL_Literal *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_state_member (TAO_PSDL_State_Member *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_init_dcl (TAO_PSDL_Init_Dcl *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_init_param_decls (TAO_PSDL_Init_Param_Decls *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_init_param_decl (TAO_PSDL_Init_Param_Decl *) { return 0; }
+int TAO_PSDL_Node_Visitor::visit_factory_parameters (TAO_PSDL_Factory_Parameters *) { return 0; }
+
+int
+TAO_PSDL_Node_Visitor::visit_attr_dcl (TAO_PSDL_Attr_Dcl *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_factory_dcl (TAO_PSDL_Factory_Dcl *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::visit_positive_int_const (TAO_PSDL_Positive_Int_Const *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Node_Visitor::base_type (const ACE_CString &identifier,
+ ACE_CString &identifier_type)
+{
+ ACE_CString identifier_name = identifier;
+ TAO_PSDL_Scope::instance ()->to_lower_case (identifier_name);
+
+ int result =
+ TAO_PSDL_Scope::instance ()->find (identifier_name,
+ identifier_type);
+
+ if (result == 0)
+ {
+ // check if the base type is a predefined base type defined in
+ // PSDL.yy
+ if (ACE_OS::strcmp (identifier_type.c_str (), "enum") == 0)
+ return 0;
+
+ // The way I am deciding is trying to find the idn
+ result = TAO_PSDL_Scope::instance ()->find (identifier_type);
+
+ if (result == 0)
+ {
+ return 0;
+ }
+ else
+ {
+ return 1;
+ }
+ }
+
+ // identifier_name is a predefined type like char *.
+ identifier_type = identifier_name;
+
+ return 1;
+}
+
+ACE_CString
+TAO_PSDL_Node_Visitor::version_for_stub (ACE_CString identifier_type)
+{
+ if (ACE_OS::strcmp (identifier_type.c_str (), "char *") == 0)
+ {
+ return "CORBA::String";
+ }
+ else if (ACE_OS::strcmp (identifier_type.c_str (), "long") == 0)
+ {
+ return "CORBA::Long";
+ }
+ else
+ return identifier_type;
+}
+
+void
+TAO_PSDL_Node_Visitor::gen_code_for_si (void)
+{
+ return;
+}
+
+void
+TAO_PSDL_Node_Visitor::gen_code_for_sinline (void)
+{
+ return;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Node_Visitor.h b/TAO/orbsvcs/PSS/PSDL_Node_Visitor.h
new file mode 100644
index 00000000000..08f95858aa5
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Node_Visitor.h
@@ -0,0 +1,368 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs/PSS
+//
+// = FILENAME
+// PSDL_Node_Visitor
+//
+// = DESCRIPTION
+// This class serves as a base class for the classes that put the
+// generated code that should go into the stubs. Derived classes
+// override the necessary methods. Uses the Visitor Pattern.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_NODE_VISITOR_H
+#define TAO_PSDL_NODE_VISITOR_H
+
+#include "psdl_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "PSDL_Node.h"
+#include "ace/Array_Base.h"
+
+// Forward declarations.
+class TAO_PSDL_Visitor_Factory;
+
+
+class TAO_PSDL_Specification;
+class TAO_PSDL_Definition;
+class TAO_PSDL_Module;
+class TAO_PSDL_Abstract_Storagetype;
+class TAO_PSDL_Abstract_Storagetype_Dcl;
+class TAO_PSDL_Abstract_Storagetype_Fwd_Dcl;
+class TAO_PSDL_Abstract_Storagetype_Header;
+class TAO_PSDL_Abstract_Storagetype_Body;
+class TAO_PSDL_Abstract_Storagetype_Member;
+class TAO_PSDL_Abstract_Storagetype_Inh_Spec;
+class TAO_PSDL_Abstract_Storagetype_Name;
+class TAO_PSDL_Psdl_State_Dcl;
+class TAO_PSDL_Psdl_State_Type_Spec;
+class TAO_PSDL_Abstract_Storagetype_Ref_Type;
+class TAO_PSDL_Abstract_Storagehome;
+class TAO_PSDL_Abstract_Storagehome_Fwd_Dcl;
+class TAO_PSDL_Abstract_Storagehome_Dcl;
+class TAO_PSDL_Abstract_Storagehome_Header;
+class TAO_PSDL_Abstract_Storagehome_Body;
+class TAO_PSDL_Abstract_Storagehome_Member;
+class TAO_PSDL_Abstract_Storagehome_Inh_Spec;
+class TAO_PSDL_Abstract_Storagehome_Name;
+class TAO_PSDL_Local_Op_Dcl;
+class TAO_PSDL_Key_Dcl;
+class TAO_PSDL_Catalog;
+class TAO_PSDL_Catalog_Inh_Spec;
+class TAO_PSDL_Catalog_Name;
+class TAO_PSDL_Catalog_Body;
+class TAO_PSDL_Catalog_Member;
+class TAO_PSDL_Provides_Dcl;
+class TAO_PSDL_Storagetype;
+class TAO_PSDL_Storagetype_Dcl;
+class TAO_PSDL_Abstract_Storagetype_Fwd_Dcl;
+class TAO_PSDL_Abstract_Storagetype_Header;
+class TAO_PSDL_Abstract_Storagetype_Body;
+class TAO_PSDL_Abstract_Storagetype_Member;
+class TAO_PSDL_Abstract_Storagetype_Inh_Spec;
+class TAO_PSDL_Abstract_Storagetype_Name;
+class TAO_PSDL_Psdl_State_Dcl;
+class TAO_PSDL_Psdl_State_Type_Spec;
+class TAO_PSDL_Abstract_Storagetype_Ref_Type;
+class TAO_PSDL_Abstract_Storagehome;
+class TAO_PSDL_Abstract_Storagehome_Fwd_Dcl;
+class TAO_PSDL_Abstract_Storagehome_Dcl;
+class TAO_PSDL_Abstract_Storagehome_Header;
+class TAO_PSDL_Abstract_Storagehome_Body;
+class TAO_PSDL_Abstract_Storagehome_Member;
+class TAO_PSDL_Abstract_Storagehome_Inh_Spec;
+class TAO_PSDL_Abstract_Storagehome_Name;
+class TAO_PSDL_Local_Op_Dcl;
+class TAO_PSDL_Key_Dcl;
+class TAO_PSDL_Catalog;
+class TAO_PSDL_Catalog_Inh_Spec;
+class TAO_PSDL_Catalog_Name;
+class TAO_PSDL_Catalog_Body;
+class TAO_PSDL_Catalog_Member;
+class TAO_PSDL_Provides_Dcl;
+class TAO_PSDL_Storagetype;
+class TAO_PSDL_Storagetype_Dcl;
+class TAO_PSDL_Storagetype_Fwd_Dcl;
+class TAO_PSDL_Storagetype_Header;
+class TAO_PSDL_Storagetype_Body;
+class TAO_PSDL_Storagetype_Member;
+class TAO_PSDL_Storagetype_Inh_Spec;
+class TAO_PSDL_Storagetype_Name;
+class TAO_PSDL_Storagetype_Impl_Spec;
+class TAO_PSDL_Storagetype_Ref_Type;
+class TAO_PSDL_Storagehome_Scope;
+class TAO_PSDL_Store_Directive;
+class TAO_PSDL_Psdl_Concrete_State_Type;
+class TAO_PSDL_Ref_Rep_Directive;
+class TAO_PSDL_Storagehome;
+class TAO_PSDL_Storagehome_Header;
+class TAO_PSDL_Storagehome_Body;
+class TAO_PSDL_Storagehome_Member;
+class TAO_PSDL_Storagehome_Inh_Spec;
+class TAO_PSDL_Storagehome_Name;
+class TAO_PSDL_Storagehome_Impl_Spec;
+class TAO_PSDL_Primary_Key_Dcl;
+class TAO_PSDL_Identifier;
+class TAO_PSDL_Type_Dcl;
+class TAO_PSDL_Type_Declarator;
+class TAO_PSDL_Type_Spec;
+class TAO_PSDL_Simple_Type_Spec;
+class TAO_PSDL_Base_Type_Spec;
+class TAO_PSDL_Template_Type_Spec;
+class TAO_PSDL_Constr_Type_Spec;
+class TAO_PSDL_Declarators;
+class TAO_PSDL_Declarator;
+class TAO_PSDL_Simple_Declarator;
+class TAO_PSDL_Simple_Declarator_List;
+class TAO_PSDL_Complex_Declarator;
+class TAO_PSDL_Predefined_Type;
+class TAO_PSDL_Member_List;
+class TAO_PSDL_Member;
+class TAO_PSDL_Union_Type;
+class TAO_PSDL_Switch_Type_Spec;
+class TAO_PSDL_Switch_Body;
+class TAO_PSDL_Case;
+class TAO_PSDL_Case_Label;
+class TAO_PSDL_Element_Spec;
+class TAO_PSDL_Const_Dcl;
+class TAO_PSDL_Const_Type;
+class TAO_PSDL_Const_Exp;
+class TAO_PSDL_Or_Expr;
+class TAO_PSDL_Xor_Expr;
+class TAO_PSDL_And_Expr;
+class TAO_PSDL_Shift_Expr;
+class TAO_PSDL_Add_Expr;
+class TAO_PSDL_Mult_Expr;
+class TAO_PSDL_Unary_Expr;
+class TAO_PSDL_Primary_Expr;
+class TAO_PSDL_Except_Dcl;
+class TAO_PSDL_Op_Dcl;
+class TAO_PSDL_Op_Type_Spec;
+class TAO_PSDL_Parameter_Dcls;
+class TAO_PSDL_Param_Dcl;
+class TAO_PSDL_Raises_Expr;
+class TAO_PSDL_Context_Expr;
+class TAO_PSDL_Param_Type_Spec;
+class TAO_PSDL_Fixed_Pt_Type;
+class TAO_PSDL_Constr_Forward_Decl;
+class TAO_PSDL_Interface;
+class TAO_PSDL_Interface_Body;
+class TAO_PSDL_Interface_Dcl;
+class TAO_PSDL_Forward_Dcl;
+class TAO_PSDL_Interface_Header;
+class TAO_PSDL_Export_Dcl;
+class TAO_PSDL_Storagetype_Dcl;
+class TAO_PSDL_Storagetype_Fwd_Dcl;
+class TAO_PSDL_Storagetype_Header;
+class TAO_PSDL_Storagetype_Body;
+class TAO_PSDL_Interface_Inheritance_Spec;
+class TAO_PSDL_Interface_Name;
+class TAO_PSDL_Scoped_Name;
+class TAO_PSDL_Value;
+class TAO_PSDL_Value_Common_Base;
+class TAO_PSDL_Value_Forward_Dcl;
+class TAO_PSDL_Value_Box_Dcl;
+class TAO_PSDL_Value_Abs_Dcl;
+class TAO_PSDL_Value_Dcl;
+class TAO_PSDL_Value_Header;
+class TAO_PSDL_Value_Inheritance_Spec;
+class TAO_PSDL_Value_Name;
+class TAO_PSDL_Value_Element;
+class TAO_PSDL_Enumerator;
+class TAO_PSDL_Literal;
+class TAO_PSDL_Array_Declarator;
+class TAO_PSDL_Fixed_Array_Size;
+class TAO_PSDL_State_Member;
+class TAO_PSDL_Init_Dcl;
+class TAO_PSDL_Init_Param_Decls;
+class TAO_PSDL_Init_Param_Decl;
+class TAO_PSDL_Factory_Parameters;
+class TAO_PSDL_Attr_Dcl;
+class TAO_PSDL_Factory_Dcl;
+class TAO_PSDL_Positive_Int_Const;
+
+class TAO_PSDL_Export TAO_PSDL_Node_Visitor
+{
+public:
+
+ TAO_PSDL_Node_Visitor ();
+
+ // Destructor.
+ virtual ~TAO_PSDL_Node_Visitor (void);
+
+ // All the nodes in the parse tree are of base type
+ // TAO_PSDL_Node. Based on the visitor pattern, the following
+ // methods are invoked depending on the actual type of the node.
+ // The visitor pattern is being used. And, the return value is a '0'
+ // when successful and '-1' on a failure.
+ virtual int visit_specification (TAO_PSDL_Specification *);
+ virtual int visit_definition (TAO_PSDL_Definition *);
+ virtual int visit_module (TAO_PSDL_Module *);
+ virtual int visit_abstract_storagetype (TAO_PSDL_Abstract_Storagetype *);
+ virtual int visit_abstract_storagetype_dcl (TAO_PSDL_Abstract_Storagetype_Dcl *);
+ virtual int visit_abstract_storagetype_fwd_dcl (TAO_PSDL_Abstract_Storagetype_Fwd_Dcl *);
+ virtual int visit_abstract_storagetype_header (TAO_PSDL_Abstract_Storagetype_Header *);
+ virtual int visit_abstract_storagetype_body (TAO_PSDL_Abstract_Storagetype_Body *);
+ virtual int visit_abstract_storagetype_member (TAO_PSDL_Abstract_Storagetype_Member *);
+ virtual int visit_abstract_storagetype_inh_spec (TAO_PSDL_Abstract_Storagetype_Inh_Spec *);
+ virtual int visit_abstract_storagetype_name (TAO_PSDL_Abstract_Storagetype_Name *);
+ virtual int visit_psdl_state_dcl (TAO_PSDL_Psdl_State_Dcl *);
+ virtual int visit_psdl_state_type_spec (TAO_PSDL_Psdl_State_Type_Spec *);
+
+ virtual int visit_abstract_storagetype_ref_type (TAO_PSDL_Abstract_Storagetype_Ref_Type);
+
+ virtual int visit_abstract_storagehome (TAO_PSDL_Abstract_Storagehome *);
+ virtual int visit_abstract_storagehome_fwd_dcl (TAO_PSDL_Abstract_Storagehome_Fwd_Dcl *);
+ virtual int visit_abstract_storagehome_dcl (TAO_PSDL_Abstract_Storagehome_Dcl *);
+
+ virtual int visit_abstract_storagehome_header (TAO_PSDL_Abstract_Storagehome_Header *);
+ virtual int visit_abstract_storagehome_body (TAO_PSDL_Abstract_Storagehome_Body *);
+ virtual int visit_abstract_storagehome_member (TAO_PSDL_Abstract_Storagehome_Member *);
+ virtual int visit_abstract_storagehome_inh_spec (TAO_PSDL_Abstract_Storagehome_Inh_Spec *);
+ virtual int visit_abstract_storagehome_name (TAO_PSDL_Abstract_Storagehome_Name *);
+ virtual int visit_local_op_dcl (TAO_PSDL_Local_Op_Dcl *);
+ virtual int visit_key_dcl (TAO_PSDL_Key_Dcl *);
+ virtual int visit_catalog (TAO_PSDL_Catalog *);
+ virtual int visit_catalog_inh_spec (TAO_PSDL_Catalog_Inh_Spec *);
+ virtual int visit_catalog_name (TAO_PSDL_Catalog_Name *);
+ virtual int visit_catalog_body (TAO_PSDL_Catalog_Body *);
+ virtual int visit_catalog_member (TAO_PSDL_Catalog_Member *);
+ virtual int visit_storagetype_member (TAO_PSDL_Storagetype_Member *);
+ virtual int visit_storagetype_inh_spec (TAO_PSDL_Storagetype_Inh_Spec *);
+ virtual int visit_storagetype_name (TAO_PSDL_Storagetype_Name *);
+ virtual int visit_storagetype_impl_spec (TAO_PSDL_Storagetype_Impl_Spec *);
+ virtual int visit_storagetype_ref_type (TAO_PSDL_Storagetype_Ref_Type *);
+ virtual int visit_store_directive (TAO_PSDL_Store_Directive *);
+ virtual int visit_psdl_concrete_state_type (TAO_PSDL_Psdl_Concrete_State_Type *);
+ virtual int visit_ref_rep_directive (TAO_PSDL_Ref_Rep_Directive *);
+ virtual int visit_storagehome (TAO_PSDL_Storagehome *);
+ virtual int visit_storagehome_header (TAO_PSDL_Storagehome_Header *);
+ virtual int visit_storagehome_body (TAO_PSDL_Storagehome_Body *);
+ virtual int visit_storagehome_member (TAO_PSDL_Storagehome_Member *);
+ virtual int visit_storagehome_inh_spec (TAO_PSDL_Storagehome_Inh_Spec *);
+ virtual int visit_storagehome_name (TAO_PSDL_Storagehome_Name *);
+
+ virtual int visit_storagehome_impl_spec (TAO_PSDL_Storagehome_Impl_Spec *);
+ virtual int visit_primary_key_dcl (TAO_PSDL_Primary_Key_Dcl *);
+ virtual int visit_identifier (TAO_PSDL_Identifier *);
+
+ virtual int visit_type_dcl (TAO_PSDL_Type_Dcl *);
+ virtual int visit_type_declarator (TAO_PSDL_Type_Declarator *);
+ virtual int visit_type_spec (TAO_PSDL_Type_Spec *);
+ virtual int visit_simple_type_spec (TAO_PSDL_Simple_Type_Spec *);
+ virtual int visit_base_type_spec (TAO_PSDL_Base_Type_Spec *);
+ virtual int visit_template_type_spec (TAO_PSDL_Template_Type_Spec *);
+ virtual int visit_constr_type_spec (TAO_PSDL_Constr_Type_Spec *);
+ virtual int visit_declarators (TAO_PSDL_Declarators *);
+ virtual int visit_declarator (TAO_PSDL_Declarator *);
+ virtual int visit_simple_declarator (TAO_PSDL_Simple_Declarator *);
+ virtual int visit_simple_declarator_list (TAO_PSDL_Simple_Declarator_List *);
+ virtual int visit_complex_declarator (TAO_PSDL_Complex_Declarator *);
+ virtual int visit_predefined_type (TAO_PSDL_Predefined_Type *);
+ virtual int visit_member_list (TAO_PSDL_Member_List *);
+ virtual int visit_member (TAO_PSDL_Member *);
+ virtual int visit_union_type (TAO_PSDL_Union_Type *);
+ virtual int visit_switch_type_spec (TAO_PSDL_Switch_Type_Spec *);
+ virtual int visit_switch_body (TAO_PSDL_Switch_Body *);
+ virtual int visit_case_case (TAO_PSDL_Case *);
+ virtual int visit_case_label (TAO_PSDL_Case_Label *);
+ virtual int visit_element_spec (TAO_PSDL_Element_Spec *);
+ virtual int visit_const_dcl (TAO_PSDL_Const_Dcl *);
+ virtual int visit_const_type (TAO_PSDL_Const_Type *);
+ virtual int visit_const_exp (TAO_PSDL_Const_Exp *);
+ virtual int visit_or_expr (TAO_PSDL_Or_Expr *);
+ virtual int visit_xor_expr (TAO_PSDL_Xor_Expr *);
+ virtual int visit_and_expr (TAO_PSDL_And_Expr *);
+ virtual int visit_shift_expr (TAO_PSDL_Shift_Expr *);
+ virtual int visit_add_expr (TAO_PSDL_Add_Expr *);
+ virtual int visit_mult_expr (TAO_PSDL_Mult_Expr *);
+ virtual int visit_unary_expr (TAO_PSDL_Unary_Expr *);
+ virtual int visit_primary_expr (TAO_PSDL_Primary_Expr *);
+ virtual int visit_except_dcl (TAO_PSDL_Except_Dcl *);
+ virtual int visit_op_dcl (TAO_PSDL_Op_Dcl *);
+ virtual int visit_storagetype (TAO_PSDL_Storagetype *);
+ virtual int visit_storagetype_dcl (TAO_PSDL_Storagetype_Dcl *);
+ virtual int visit_storagetype_fwd_dcl (TAO_PSDL_Storagetype_Fwd_Dcl *);
+ virtual int visit_storagetype_header (TAO_PSDL_Storagetype_Header *);
+ virtual int visit_storagetype_body (TAO_PSDL_Storagetype_Body *);
+ virtual int visit_storagehome_scope (TAO_PSDL_Storagehome_Scope *);
+ virtual int visit_provides_dcl (TAO_PSDL_Provides_Dcl *);
+ virtual int visit_op_type_spec (TAO_PSDL_Op_Type_Spec *);
+ virtual int visit_parameter_dcls (TAO_PSDL_Parameter_Dcls *);
+ virtual int visit_param_dcl (TAO_PSDL_Param_Dcl *);
+ virtual int visit_raises_expr (TAO_PSDL_Raises_Expr *);
+ virtual int visit_context_expr (TAO_PSDL_Context_Expr *);
+ virtual int visit_param_type_spec (TAO_PSDL_Param_Type_Spec *);
+ virtual int visit_fixed_pt_type (TAO_PSDL_Fixed_Pt_Type *);
+ virtual int visit_constr_forward_decl (TAO_PSDL_Constr_Forward_Decl *);
+ virtual int visit_interface (TAO_PSDL_Interface *);
+ virtual int visit_interface_body (TAO_PSDL_Interface_Body *);
+ virtual int visit_interface_dcl (TAO_PSDL_Interface_Dcl *);
+ virtual int visit_forward_dcl (TAO_PSDL_Forward_Dcl *);
+ virtual int visit_interface_header (TAO_PSDL_Interface_Header *);
+ virtual int visit_export_dcl (TAO_PSDL_Export_Dcl *);
+ virtual int visit_interface_inheritance_spec (TAO_PSDL_Interface_Inheritance_Spec *);
+ virtual int visit_interface_name (TAO_PSDL_Interface_Name *);
+ virtual int visit_scoped_name (TAO_PSDL_Scoped_Name *);
+ virtual int visit_value (TAO_PSDL_Value *);
+ virtual int visit_value_common_base (TAO_PSDL_Value_Common_Base *);
+ virtual int visit_value_forward_dcl (TAO_PSDL_Value_Forward_Dcl *);
+ virtual int visit_value_box_dcl (TAO_PSDL_Value_Box_Dcl *);
+ virtual int visit_value_abs_dcl (TAO_PSDL_Value_Abs_Dcl *);
+ virtual int visit_value_dcl (TAO_PSDL_Value_Dcl *);
+ virtual int visit_value_header (TAO_PSDL_Value_Header *);
+ virtual int visit_value_inheritance_spec (TAO_PSDL_Value_Inheritance_Spec *);
+ virtual int visit_value_name (TAO_PSDL_Value_Name *);
+ virtual int visit_value_element (TAO_PSDL_Value_Element *);
+ virtual int visit_array_declarator (TAO_PSDL_Array_Declarator *);
+ virtual int visit_fixed_array_size (TAO_PSDL_Fixed_Array_Size *);
+ virtual int visit_enumerator (TAO_PSDL_Enumerator *);
+ virtual int visit_literal (TAO_PSDL_Literal *);
+ virtual int visit_state_member (TAO_PSDL_State_Member *);
+ virtual int visit_init_dcl (TAO_PSDL_Init_Dcl *);
+ virtual int visit_init_param_decls (TAO_PSDL_Init_Param_Decls *);
+ virtual int visit_init_param_decl (TAO_PSDL_Init_Param_Decl *);
+ virtual int visit_factory_parameters (TAO_PSDL_Factory_Parameters *);
+ virtual int visit_attr_dcl (TAO_PSDL_Attr_Dcl *);
+ virtual int visit_factory_dcl (TAO_PSDL_Factory_Dcl *);
+ virtual int visit_positive_int_const (TAO_PSDL_Positive_Int_Const *);
+
+ /// To check if the identifier_type is a predefined type or one that
+ /// is defined in the idl in case.
+ virtual int base_type (const ACE_CString &identifier_name,
+ ACE_CString &identifier_type);
+
+ virtual ACE_CString version_for_stub (ACE_CString identifier_type);
+
+ // Generate the code that should go into the stub implementation
+ // file for the type_declarators.
+ virtual void gen_code_for_si (void);
+
+ // Generate the code that should go into the stub inline
+ // file for the type_declarators.
+ virtual void gen_code_for_sinline (void);
+
+protected:
+
+ // identifiers_ and predefined_type_ is used to store the temporary
+ // values while building ASTs.
+ ACE_Array_Base <ACE_CString> identifiers_;
+ ACE_Array_Base <CORBA::ULong> predefined_type_;
+ CORBA::ULong count_;
+ TAO_PSDL_Node_Visitor *node_visitor_;
+ TAO_PSDL_Visitor_Factory *visitor_factory_;
+};
+
+#endif /* TAO_PSDL_NODE_VISITOR_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_OctetSeq.cpp b/TAO/orbsvcs/PSS/PSDL_OctetSeq.cpp
new file mode 100644
index 00000000000..fb223b54ae9
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_OctetSeq.cpp
@@ -0,0 +1,124 @@
+// $Id$
+
+#include "PSDL_OctetSeq.h"
+
+#include "ace/Malloc_Base.h"
+
+ACE_RCSID (PSS, PSDL_OctetSeq, "$Id")
+
+// Constructor
+TAO_PSDL_OctetSeq::TAO_PSDL_OctetSeq ()
+ : allocator_ (0),
+ buffer_ (0),
+ length_ (0)
+{
+}
+
+// Constructor
+TAO_PSDL_OctetSeq::TAO_PSDL_OctetSeq (ACE_Allocator * persistent_allocator)
+ : allocator_ (persistent_allocator),
+ buffer_ (0),
+ length_ (0)
+{
+}
+
+// Destructor.
+TAO_PSDL_OctetSeq::~TAO_PSDL_OctetSeq (void)
+{
+ if (this->buffer_ != 0)
+ this->allocator_->free (this->buffer_);
+}
+
+// Copy constructor.
+TAO_PSDL_OctetSeq::TAO_PSDL_OctetSeq (const TAO_PSDL_OctetSeq & rhs)
+{
+ *this = rhs;
+}
+
+// Assignment operator.
+void
+TAO_PSDL_OctetSeq::operator= (const TAO_PSDL_OctetSeq & rhs)
+{
+ if (this == &rhs) // Prevent self assignment
+ return;
+
+ // Free the existing buffer before assigning a new
+ // allocator and buffer.
+ if (this->buffer_ != 0)
+ this->allocator_->free (this->buffer_);
+
+ this->allocator_ = rhs.allocator_;
+ void * buf = this->allocator_->malloc (rhs.length_);
+ this->buffer_ = static_cast<CORBA::Octet *> (buf);
+ if (this->buffer_)
+ {
+ // Deep copy the buffer.
+ ACE_OS::memcpy (this->buffer_, rhs.buffer_, rhs.length_);
+
+ this->length_ = rhs.length_;
+ }
+ else
+ this->length_ = 0;
+}
+
+void
+TAO_PSDL_OctetSeq::operator= (const CORBA::OctetSeq & rhs)
+{
+ // Free the existing buffer before assigning octet
+ // sequence.
+ if (this->buffer_ != 0)
+ this->allocator_->free (this->buffer_);
+
+ const CORBA::ULong len = rhs.length ();
+
+ void * buf = this->allocator_->malloc (len);
+ this->buffer_ = static_cast<CORBA::Octet *> (buf);
+ if (this->buffer_)
+ {
+ CORBA::Octet * dest = this->buffer_;
+ const CORBA::Octet * src = rhs.get_buffer ();
+
+ // Deep copy the buffer.
+ ACE_OS::memcpy (dest, src, len);
+
+ this->length_ = len;
+ }
+ else
+ this->length_ = 0;
+}
+
+// Conversion operators (cast)
+// (caller owns storage of return values)
+TAO_PSDL_OctetSeq::operator CORBA::OctetSeq *() const
+{
+ CORBA::OctetSeq * tmp;
+ ACE_NEW_RETURN (tmp,
+ CORBA::OctetSeq (this->length_),
+ 0);
+ CORBA::OctetSeq_var seq = tmp;
+
+ seq->length (this->length_);
+
+ CORBA::Octet * dest = seq->get_buffer ();
+ const CORBA::Octet * src = this->buffer_;
+ ACE_OS::memcpy (dest, src, this->length_);
+
+ return seq._retn ();
+}
+
+TAO_PSDL_OctetSeq::operator CORBA::OctetSeq *()
+{
+ CORBA::OctetSeq * tmp;
+ ACE_NEW_RETURN (tmp,
+ CORBA::OctetSeq (this->length_),
+ 0);
+ CORBA::OctetSeq_var seq = tmp;
+
+ seq->length (this->length_);
+
+ CORBA::Octet * dest = seq->get_buffer ();
+ const CORBA::Octet * src = this->buffer_;
+ ACE_OS::memcpy (dest, src, this->length_);
+
+ return seq._retn ();
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_OctetSeq.h b/TAO/orbsvcs/PSS/PSDL_OctetSeq.h
new file mode 100644
index 00000000000..723afb12916
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_OctetSeq.h
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PSDL_OctetSeq.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ * @author Priyanka Gontla <gontla_p@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PSDL_OCTETSEQ_H
+#define TAO_PSDL_OCTETSEQ_H
+#include /**/ "ace/pre.h"
+
+#include "psdl_export.h"
+#include "tao/OctetSeqC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "PSDL_Datastore.h"
+
+/**
+ * @class TAO_PSDL_OctetSeq
+ *
+ * @brief This class facilitates implementation of Persistent
+ * Service. Helps perform the bind and find to the hash_map and to
+ * make the data persistent.
+ **/
+
+class ACE_Allocator;
+
+class TAO_PSDL_Export TAO_PSDL_OctetSeq
+{
+public:
+
+ /// Constructor.
+ TAO_PSDL_OctetSeq (void);
+
+ /// Constructor.
+ TAO_PSDL_OctetSeq (ACE_Allocator *persistent_allocator);
+
+ /// Copy constructor.
+ TAO_PSDL_OctetSeq (const TAO_PSDL_OctetSeq & rhs);
+
+ /// Destructor.
+ ~TAO_PSDL_OctetSeq (void);
+
+ /// Assignment operator.
+ void operator= (const TAO_PSDL_OctetSeq & rhs);
+
+ // Conversion operator (assignment)
+ void operator= (const CORBA::OctetSeq & rhs);
+
+ // Conversion operators (cast)
+ // (caller owns storage of return values)
+ operator CORBA::OctetSeq *() const;
+
+ operator CORBA::OctetSeq *();
+
+ // Persistent allocator.
+ ACE_Allocator * allocator_;
+
+ // Persistent buffer.
+ CORBA::Octet * buffer_;
+
+ // Length of the persistent buffer.
+ CORBA::ULong length_;
+};
+
+
+#include /**/ "ace/post.h"
+#endif /* TAO_PSDL_OCTETSEQ_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Op_Dcl_Scope.cpp b/TAO/orbsvcs/PSS/PSDL_Op_Dcl_Scope.cpp
new file mode 100644
index 00000000000..279d0a6c0d9
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Op_Dcl_Scope.cpp
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Module_Scope.h"
+#include "PSDL_Op_Dcl_Scope.h"
+
+ACE_RCSID (PSS, PSDL_Op_Dcl_Scope, "$Id$")
+
+TAO_PSDL_Op_Dcl_Scope::TAO_PSDL_Op_Dcl_Scope (TAO_PSDL_Scope *parent_scope)
+ : scope_map_ (),
+ parent_scope_ (parent_scope)
+{
+}
+
+int
+TAO_PSDL_Op_Dcl_Scope::add_const_decl (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_const_decl_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Op_Dcl_Scope::add_member_decl (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_member_decl_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+void
+TAO_PSDL_Op_Dcl_Scope::dump (CORBA::ULong depth)
+{
+ depth = depth + 5;
+
+ for (Scope_Map_Iterator i = this->scope_map_.begin ();
+ i != this->scope_map_.end ();
+ ++i)
+ {
+ this->print_depth (depth);
+ ACE_DEBUG ((LM_DEBUG,
+ "%s (%s)\n",
+ (*i).ext_id_.c_str (), (*i).int_id_));
+ }
+}
+
+TAO_PSDL_Scope *
+TAO_PSDL_Op_Dcl_Scope::parent_scope (void)
+{
+ return this->parent_scope_;
+}
+
+Scope_Map *
+TAO_PSDL_Op_Dcl_Scope::scope_map (void)
+{
+ return &this->scope_map_;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Op_Dcl_Scope.h b/TAO/orbsvcs/PSS/PSDL_Op_Dcl_Scope.h
new file mode 100644
index 00000000000..6df594b464c
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Op_Dcl_Scope.h
@@ -0,0 +1,54 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Op_Dcl_Scope
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_OP_DCL_SCOPE_H
+#define TAO_PSDL_OP_DCL_SCOPE_H
+
+#include /**/ "ace/pre.h"
+
+#include "PSDL_Scope.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_PSDL_Export TAO_PSDL_Op_Dcl_Scope : public TAO_PSDL_Scope
+{
+ public:
+
+ TAO_PSDL_Op_Dcl_Scope (TAO_PSDL_Scope *parent_scope);
+
+ int add_const_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_member_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ void dump (CORBA::ULong depth);
+
+ TAO_PSDL_Scope *parent_scope (void);
+
+ Scope_Map *scope_map (void);
+
+protected:
+
+ Scope_Map scope_map_;
+ TAO_PSDL_Scope *parent_scope_;
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_OP_DCL_SCOPE_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Root_Scope.cpp b/TAO/orbsvcs/PSS/PSDL_Root_Scope.cpp
new file mode 100644
index 00000000000..32c1b429572
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Root_Scope.cpp
@@ -0,0 +1,205 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Root_Scope.h"
+#include "PSDL_Interface_Scope.h"
+
+ACE_RCSID (PSS, PSDL_Root_Scope, "$Id$")
+
+TAO_PSDL_Root_Scope::TAO_PSDL_Root_Scope ()
+ : root_scope_map_ ()
+{
+}
+
+TAO_PSDL_Root_Scope::~TAO_PSDL_Root_Scope ()
+{
+}
+
+int
+TAO_PSDL_Root_Scope::add_module (ACE_CString identifier)
+{
+ return TAO_PSDL_Scope::instance ()->add_module_to_scope (identifier,
+ this);
+}
+
+int
+TAO_PSDL_Root_Scope::add_interface (ACE_CString interface_name)
+{
+ // Add the actual interface.
+ return TAO_PSDL_Scope::instance ()->add_interface_to_scope (interface_name,
+ this);
+}
+
+int
+TAO_PSDL_Root_Scope::add_struct (ACE_CString struct_name)
+{
+ return TAO_PSDL_Scope::instance ()->add_struct_to_scope (struct_name,
+ this);
+}
+
+int
+TAO_PSDL_Root_Scope::add_typedef (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_typedef_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Root_Scope::add_const_decl (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_const_decl_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Root_Scope::add_except_decl (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_except_decl_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Root_Scope::add_op_dcl (ACE_CString identifier)
+{
+ return TAO_PSDL_Scope::instance ()->add_op_dcl_to_scope (identifier,
+ this);
+}
+
+void
+TAO_PSDL_Root_Scope::dump (CORBA::ULong depth)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "ROOT_SCOPE"));
+
+ depth = depth + 5;
+ for (Scope_Map_Iterator i = this->root_scope_map_.begin ();
+ i != this->root_scope_map_.end ();
+ ++i)
+ {
+ TAO_PSDL_Scope::instance ()->print_depth (depth);
+ ACE_DEBUG ((LM_DEBUG,
+ "%s (module)\n",
+ (*i).ext_id_.c_str ()));
+ (*i).int_id_->dump (depth);
+ }
+
+}
+
+int
+TAO_PSDL_Root_Scope::find (const ACE_CString &identifier_name,
+ ACE_CString &identifier_type)
+{
+ for (Scope_Map_Iterator i = this->root_scope_map_.begin ();
+ i != this->root_scope_map_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ identifier_type = (*i).int_id_->identifier_type ();
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->find (identifier_name,
+ identifier_type) == 0)
+ {
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+int
+TAO_PSDL_Root_Scope::find (const ACE_CString &identifier_name)
+{
+ for (Scope_Map_Iterator i = this->root_scope_map_.begin ();
+ i != this->root_scope_map_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->find (identifier_name) == 0)
+ {
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+int
+TAO_PSDL_Root_Scope::get_module_name (const ACE_CString &identifier_name,
+ ACE_CString &module_name)
+{
+ for (Scope_Map_Iterator i = this->root_scope_map_.begin ();
+ i != this->root_scope_map_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ module_name = (*i).int_id_->module_name ();
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->get_module_name (identifier_name,
+ module_name) == 0)
+ {
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+int
+TAO_PSDL_Root_Scope::get_interface_name (const ACE_CString &identifier_name,
+ ACE_CString &interface_name)
+{
+ for (Scope_Map_Iterator i = this->root_scope_map_.begin ();
+ i != this->root_scope_map_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ interface_name = (*i).int_id_->interface_name ();
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->get_interface_name (identifier_name,
+ interface_name) == 0)
+ {
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+TAO_PSDL_Scope *
+TAO_PSDL_Root_Scope::parent_scope (void)
+{
+ return 0;
+}
+
+Scope_Map *
+TAO_PSDL_Root_Scope::scope_map (void)
+{
+ return &this->root_scope_map_;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Root_Scope.h b/TAO/orbsvcs/PSS/PSDL_Root_Scope.h
new file mode 100644
index 00000000000..df0856c8880
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Root_Scope.h
@@ -0,0 +1,84 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Root_Scope
+//
+// = DESCRIPTION
+// Derived class from PSDL_Scope. This is for the Root Scope.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_ROOT_SCOPE_H
+#define TAO_PSDL_ROOT_SCOPE_H
+
+#include /**/ "ace/pre.h"
+
+#include "PSDL_Scope.h"
+#include "PSDL_Module_Scope.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_PSDL_Export TAO_PSDL_Root_Scope : public TAO_PSDL_Scope
+{
+public:
+
+ TAO_PSDL_Root_Scope (void);
+
+ ~TAO_PSDL_Root_Scope (void);
+
+ /// Methods to be able to add the respective types to the Root
+ /// Scope.
+ int add_module (ACE_CString identifier);
+
+ int add_interface (ACE_CString identifier);
+
+ int add_struct (ACE_CString identifier);
+
+ int add_typedef (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_const_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_except_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_op_dcl (ACE_CString identifier);
+
+ void dump (CORBA::ULong depth);
+
+ int find (const ACE_CString &identifier_name,
+ ACE_CString &identifier_type);
+
+ int find (const ACE_CString &identifier_name);
+
+ int get_module_name (const ACE_CString &identifier_name,
+ ACE_CString &module_name);
+
+ int get_interface_name (const ACE_CString &identifier_name,
+ ACE_CString &interface_name);
+
+ /// Public methods to return the scopes needed.
+ TAO_PSDL_Scope *parent_scope (void);
+
+ Scope_Map *scope_map (void);
+
+protected:
+
+ Scope_Map root_scope_map_;
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_ROOT_SCOPE_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Scope.cpp b/TAO/orbsvcs/PSS/PSDL_Scope.cpp
new file mode 100644
index 00000000000..13829c524af
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Scope.cpp
@@ -0,0 +1,928 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Scope.h"
+#include "PSDL_Root_Scope.h"
+#include "PSDL_Simple_Scope.h"
+#include "PSDL_Module_Scope.h"
+#include "PSDL_Interface_Scope.h"
+#include "PSDL_Struct_Scope.h"
+#include "PSDL_Exception_Scope.h"
+#include "PSDL_Op_Dcl_Scope.h"
+#include "PSDL_Stream.h"
+#include "ace/OS_NS_ctype.h"
+
+ACE_RCSID (PSS, PSDL_Scope, "$Id$")
+
+#undef INCREMENT
+#define INCREMENT 40
+
+TAO_PSDL_Scope::TAO_PSDL_Scope (void)
+ : psdl_scope_ (new TAO_PSDL_Scope *[INCREMENT]),
+ ast_scope_ (0),
+ module_names_ (0),
+ interface_names_ (0),
+ psdl_scope_top_ (0),
+ root_scope_ (0),
+ identifier_ (),
+ name_space_ (),
+ interface_name_ (),
+ ps_sh_ (0),
+ ps_si_ (0),
+ ps_sin_ (0)
+{
+}
+
+TAO_PSDL_Scope::~TAO_PSDL_Scope (void)
+{
+}
+
+void
+TAO_PSDL_Scope::to_lower_case (ACE_CString &identifier)
+{
+ size_t len = identifier.length ();
+ for (size_t i = 0; i <= len; ++i)
+ {
+ identifier[i] = ACE_OS::ace_tolower (identifier[i]);
+ }
+}
+
+int
+TAO_PSDL_Scope::check_identifier (ACE_CString identifier,
+ TAO_PSDL_Scope *scope)
+{
+ int result = 0;
+
+ this->to_lower_case (identifier);
+
+ // Check in the ROOT_SCOPE
+ if (scope->scope_map () != 0)
+ result = scope->scope_map ()->find (identifier);
+
+ if (result != 0)
+ {
+ // Didnt find in this scope. Check in the parents scope
+ // since that also counts.
+ if (scope->parent_scope () != 0)
+ {
+ result =
+ this->check_identifier (identifier,
+ scope->parent_scope ());
+ }
+ }
+
+ return result;
+}
+
+void
+TAO_PSDL_Scope::check_name_in_scope (ACE_CString identifier,
+ TAO_PSDL_Scope *scope)
+{
+ // This method is to be used in the cases when the identifier should
+ // have been declared before: for example, forward declarations.
+
+ // Check if it is a user-defined type defined in this scope.
+ int check_result = this->check_identifier (identifier,
+ scope);
+
+ if (check_result == -1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Identifier %s not defined before in the scope..aborting..\n",
+ identifier.c_str ()));
+
+ ACE_OS::exit (1);
+ }
+}
+
+int
+TAO_PSDL_Scope::add_module (ACE_CString)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_module_to_scope (ACE_CString identifier,
+ TAO_PSDL_Scope *scope)
+{
+ ACE_CString lower_identifier = identifier;
+ this->to_lower_case (lower_identifier);
+
+ if (this->check_identifier (lower_identifier, scope) == -1)
+ {
+ TAO_PSDL_Module_Scope *psdl_module =
+ new TAO_PSDL_Module_Scope (scope);
+
+ scope->scope_map ()->bind (lower_identifier,
+ psdl_module);
+
+ size_t cur_size = this->module_names_.size ();
+
+ /// @@ Rather than here .. you must have actually save the
+ /// identifier name in the instance of the module itself .. or
+ /// may be I should rather figure out a
+ this->module_names_.size (cur_size + 1);
+ this->module_names_[cur_size] = identifier;
+
+ TAO_PSDL_Scope::instance ()->push_scope (psdl_module);
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Error: module name re-defined: ABORTING\n"));
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_interface_dcl_to_scope (ACE_CString identifier,
+ TAO_PSDL_Scope *scope)
+{
+ this->to_lower_case (identifier);
+
+ if (this->check_identifier (identifier, scope) == -1)
+ {
+ TAO_PSDL_Simple_Scope *psdl_simple =
+ new TAO_PSDL_Simple_Scope (scope,
+ "forward_dcl");
+
+ scope->scope_map ()->bind (identifier,
+ psdl_simple);
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Error: interface_name %s re-defined\n",
+ identifier.c_str ()));
+
+ ACE_OS::exit (1);
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_interface (ACE_CString)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_interface_to_scope (ACE_CString identifier,
+ TAO_PSDL_Scope *scope)
+{
+ this->to_lower_case (identifier);
+
+ if (this->check_identifier (identifier, scope) == -1)
+ {
+ TAO_PSDL_Interface_Scope *psdl_interface =
+ new TAO_PSDL_Interface_Scope (scope);
+
+ scope->scope_map ()->bind (identifier,
+ psdl_interface);
+
+ TAO_PSDL_Scope::instance ()->push_scope (psdl_interface);
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Error: interface_name %s re-defined\n",
+ identifier.c_str ()));
+
+ ACE_OS::exit (1);
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_struct (ACE_CString)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_struct_to_scope (ACE_CString struct_name,
+ TAO_PSDL_Scope *scope)
+{
+ this->to_lower_case (struct_name);
+
+ if (this->check_identifier (struct_name, scope) == -1)
+ {
+ TAO_PSDL_Struct_Scope *psdl_struct =
+ new TAO_PSDL_Struct_Scope (scope);
+
+ scope->scope_map ()->bind (struct_name,
+ psdl_struct);
+
+ TAO_PSDL_Scope::instance ()->push_scope (psdl_struct);
+
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Error: identifier re-defined: ABORTING\n"));
+
+ ACE_OS::exit (1);
+
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_typedef (ACE_CString,
+ ACE_CString)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_typedef_to_scope (ACE_CString identifier,
+ ACE_CString identifier_type,
+ TAO_PSDL_Scope *scope)
+{
+ this->to_lower_case (identifier);
+ this->to_lower_case (identifier_type);
+
+ if (this->check_identifier (identifier, scope) == -1)
+ {
+ TAO_PSDL_Simple_Scope *psdl_simple =
+ new TAO_PSDL_Simple_Scope (scope,
+ identifier_type);
+
+ scope->scope_map ()->bind (identifier,
+ psdl_simple);
+ }
+ else
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "Error: trying to redefine typedef %s\n",
+ identifier.c_str ()));
+
+ ACE_OS::exit (1);
+
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_const_decl (ACE_CString,
+ ACE_CString)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_const_decl_to_scope (ACE_CString identifier,
+ ACE_CString identifier_type,
+ TAO_PSDL_Scope *scope)
+{
+ this->to_lower_case (identifier);
+ this->to_lower_case (identifier_type);
+
+ // First check if the identifier_type is either a predefined type
+ // or if it is defined before. If it is defined before, we will
+ // proceed.
+ this->check_name_in_scope (identifier_type, scope);
+
+ if (this->check_identifier (identifier, scope) == -1)
+ {
+ TAO_PSDL_Simple_Scope *psdl_simple =
+ new TAO_PSDL_Simple_Scope (scope,
+ identifier_type);
+
+ scope->scope_map ()->bind (identifier,
+ psdl_simple);
+
+ }
+ else
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "Error: const_decl re-defined %s\n",
+ identifier.c_str ()));
+
+ ACE_OS::exit (1);
+
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_except_decl (ACE_CString,
+ ACE_CString)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_except_decl_to_scope (ACE_CString identifier,
+ ACE_CString identifier_type,
+ TAO_PSDL_Scope *scope)
+{
+ this->to_lower_case (identifier);
+ this->to_lower_case (identifier_type);
+
+ if (this->check_identifier (identifier, scope) == -1)
+ {
+ TAO_PSDL_Simple_Scope *psdl_simple =
+ new TAO_PSDL_Simple_Scope (scope,
+ identifier_type);
+
+ scope->scope_map ()->bind (identifier,
+ psdl_simple);
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Error: exception_name %s re-defined\n",
+ identifier.c_str ()));
+
+ ACE_OS::exit (1);
+
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_op_dcl (ACE_CString)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_op_dcl_to_scope (ACE_CString op_name,
+ TAO_PSDL_Scope *scope)
+{
+ this->to_lower_case (op_name);
+
+ if (this->check_identifier (op_name, scope) == -1)
+ {
+ TAO_PSDL_Op_Dcl_Scope *psdl_op_dcl =
+ new TAO_PSDL_Op_Dcl_Scope (scope);
+
+ scope->scope_map ()->bind (op_name,
+ psdl_op_dcl);
+
+ TAO_PSDL_Scope::instance ()->push_scope (psdl_op_dcl);
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Error: op_name %s re-defined\n",
+ op_name.c_str ()));
+
+ ACE_OS::exit (1);
+
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_member_decl (ACE_CString,
+ ACE_CString)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_member_decl_to_scope (ACE_CString identifier,
+ ACE_CString identifier_type,
+ TAO_PSDL_Scope *scope)
+{
+ this->to_lower_case (identifier);
+ this->to_lower_case (identifier_type);
+
+ if (this->check_identifier (identifier, scope) == -1)
+ {
+ TAO_PSDL_Simple_Scope *psdl_simple =
+ new TAO_PSDL_Simple_Scope (scope,
+ identifier_type);
+
+ scope->scope_map ()->bind (identifier,
+ psdl_simple);
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Error: member_decl %s re-defined\n",
+ identifier.c_str ()));
+
+ ACE_OS::exit (1);
+
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_exception (ACE_CString)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_exception_to_scope (ACE_CString identifier,
+ TAO_PSDL_Scope *scope)
+{
+ this->to_lower_case (identifier);
+
+ if (this->check_identifier (identifier, scope) == -1)
+ {
+ TAO_PSDL_Exception_Scope *psdl_exception =
+ new TAO_PSDL_Exception_Scope (scope);
+
+ scope->scope_map ()->bind (identifier,
+ psdl_exception);
+
+ TAO_PSDL_Scope::instance ()->push_scope (psdl_exception);
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Error: exception %s re-defined: aborting\n",
+ identifier.c_str ()));
+
+ ACE_OS::exit (1);
+
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_scoped_decl_to_scope (ACE_CString identifier,
+ ACE_CString identifier_type,
+ TAO_PSDL_Scope *scope)
+{
+ this->to_lower_case (identifier);
+ this->to_lower_case (identifier_type);
+
+ TAO_PSDL_Simple_Scope *psdl_simple =
+ new TAO_PSDL_Simple_Scope (scope,
+ identifier_type);
+
+ scope->scope_map ()->bind (identifier,
+ psdl_simple);
+ return 0;
+}
+
+int
+TAO_PSDL_Scope::add_enum_decl_to_scope (ACE_CString identifier,
+ ACE_CString identifier_type,
+ TAO_PSDL_Scope *scope)
+{
+ this->to_lower_case (identifier);
+ this->to_lower_case (identifier_type);
+
+ TAO_PSDL_Simple_Scope *psdl_simple =
+ new TAO_PSDL_Simple_Scope (scope,
+ identifier_type);
+
+ scope->scope_map ()->bind (identifier,
+ psdl_simple);
+ return 0;
+}
+
+void
+TAO_PSDL_Scope::set_root_scope ()
+{
+ // This method is called to push the root_scope the first time.
+ if (this->root_scope_ == 0)
+ {
+ this->root_scope_ = new TAO_PSDL_Root_Scope ();
+ TAO_PSDL_Scope::instance ()->push_scope (this->root_scope_);
+ }
+}
+
+void
+TAO_PSDL_Scope::set_stub_prefix (const char *filename)
+{
+ this->stub_prefix_ = filename;
+}
+
+const ACE_CString &
+TAO_PSDL_Scope::get_stub_prefix (void)
+{
+ return this->stub_prefix_;
+}
+
+TAO_PSDL_Stream *
+TAO_PSDL_Scope::get_sh (void)
+{
+ if (this->ps_sh_ == 0)
+ {
+ ACE_NEW_RETURN (this->ps_sh_,
+ TAO_PSDL_Stream,
+ 0);
+
+ ACE_CString file_name =
+ TAO_PSDL_Scope::instance ()->get_stub_prefix () + "C.h";
+
+ this->ps_sh_->open (file_name.c_str ());
+
+ this->header_initialization (this->ps_sh_);
+ }
+
+ return this->ps_sh_;
+}
+
+TAO_PSDL_Stream *
+TAO_PSDL_Scope::get_si (void)
+{
+ if (this->ps_si_ == 0)
+ {
+ ACE_NEW_RETURN (this->ps_si_,
+ TAO_PSDL_Stream,
+ 0);
+
+ ACE_CString file_name =
+ TAO_PSDL_Scope::instance ()->get_stub_prefix () + "C.cpp";
+
+ this->ps_si_->open (file_name.c_str ());
+
+ this->stub_initialization (this->ps_si_);
+ }
+
+ return this->ps_si_;
+}
+
+TAO_PSDL_Stream *
+TAO_PSDL_Scope::get_sinline (void)
+{
+ if (this->ps_sin_ == 0)
+ {
+ ACE_NEW_RETURN (this->ps_sin_,
+ TAO_PSDL_Stream,
+ 0);
+
+ ACE_CString file_name =
+ TAO_PSDL_Scope::instance ()->get_stub_prefix () + "C.i";
+
+ this->ps_sin_->open (file_name.c_str ());
+ }
+
+ return this->ps_sin_;
+}
+
+void
+TAO_PSDL_Scope::header_initialization (TAO_PSDL_Stream *ps_sh)
+{
+ ps_sh->reset ();
+
+ *ps_sh << "#ifndef _TAO_PSDL_" << this->get_stub_prefix () << "C_H_";
+ ps_sh->nl ();
+
+ *ps_sh << "#define _TAO_PSDL_" << this->get_stub_prefix () << "C_H_";
+ ps_sh->nl ();
+
+ *ps_sh << "#include \"tao/corba.h\"";
+ ps_sh->nl ();
+
+ *ps_sh << "#if !defined (ACE_LACKS_PRAGMA_ONCE)";
+ ps_sh->nl ();
+ *ps_sh << "# pragma once";
+ ps_sh->nl ();
+ *ps_sh << "#endif /* ACE_LACKS_PRAGMA_ONCE */";
+ ps_sh->nl ();
+
+ ps_sh->nl ();
+
+ *ps_sh << "#if defined (TAO_EXPORT_MACRO)";
+ ps_sh->nl ();
+ *ps_sh << "#undef TAO_EXPORT_MACRO";
+ ps_sh->nl ();
+ *ps_sh << "#endif";
+ ps_sh->nl ();
+ *ps_sh << "#define TAO_EXPORT_MACRO";
+ ps_sh->nl ();
+
+ ps_sh->nl ();
+
+ *ps_sh << "#if defined (TAO_EXPORT_NESTED_CLASSES)";
+ ps_sh->nl ();
+ *ps_sh << "# if defined (TAO_EXPORT_NESTED_MACRO)";
+ ps_sh->nl ();
+ *ps_sh << "# undef TAO_EXPORT_NESTED_MACRO";
+ ps_sh->nl ();
+ *ps_sh << "# endif /* defined (TAO_EXPORT_NESTED_MACRO) */";
+ ps_sh->nl ();
+ *ps_sh << "# define TAO_EXPORT_NESTED_MACRO";
+ ps_sh->nl ();
+ *ps_sh << "#endif /* TAO_EXPORT_NESTED_CLASSES */";
+ ps_sh->nl ();
+
+ ps_sh->nl ();
+
+ *ps_sh << "#if defined(_MSC_VER)";
+ ps_sh->nl ();
+ *ps_sh << "#pragma warning(push)";
+ ps_sh->nl ();
+ *ps_sh << "#pragma warning(disable:4250)";
+ ps_sh->nl ();
+ *ps_sh << "#endif /* _MSC_VER */";
+ ps_sh->nl ();
+
+ ps_sh->nl ();
+
+ *ps_sh << "#if defined (__BORLANDC__)";
+ ps_sh->nl ();
+ *ps_sh << "#pragma option push -w-rvl -w-rch -w-ccc -w-inl";
+ ps_sh->nl ();
+ *ps_sh << "#endif /* __BORLANDC__ */";
+ ps_sh->nl ();
+
+ ps_sh->nl ();
+
+}
+
+void
+TAO_PSDL_Scope::stub_initialization (TAO_PSDL_Stream *ps_si)
+{
+
+ ps_si->reset ();
+
+ *ps_si << "#include \"" << this->get_stub_prefix () << "C.h\"";
+ ps_si->nl ();
+ *ps_si << "#include \"tao/Stub.h\"";
+ ps_si->nl ();
+ *ps_si << "#include \"tao/PortableInterceptor.h\"";
+ ps_si->nl ();
+
+ ps_si->nl ();
+
+ *ps_si << "#if TAO_HAS_INTERCEPTORS == 1";
+ ps_si->nl ();
+ *ps_si << "#include \"tao/RequestInfo_Util.h\"";
+ ps_si->nl ();
+ *ps_si << "#include \"tao/ClientRequestInfo_i.h\"";
+ ps_si->nl ();
+ *ps_si << "#endif /* TAO_HAS_INTERCEPTORS == 1 */";
+ ps_si->nl ();
+
+ ps_si->nl ();
+
+ *ps_si << "#if defined (__BORLANDC__)";
+ ps_si->nl ();
+ *ps_si << "#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig";
+ ps_si->nl ();
+ *ps_si << "#endif /* __BORLANDC__ */";
+ ps_si->nl ();
+
+ ps_si->nl ();
+
+ *ps_si << "#if !defined (__ACE_INLINE__)";
+ ps_si->nl ();
+ *ps_si << "#include \"" << this->get_stub_prefix () << "C.i\"";
+ ps_si->nl ();
+ *ps_si << "#endif /* !defined INLINE */";
+ ps_si->nl ();
+ ps_si->nl ();
+
+}
+
+TAO_PSDL_Scope *
+TAO_PSDL_Scope::pop_top_scope ()
+{
+ // Return the top Scope
+ if (this->psdl_scope_top_ <= 0)
+ return 0;
+
+ return this->psdl_scope_ [this->psdl_scope_top_ - 1];
+}
+
+void
+TAO_PSDL_Scope::set_module_scope (void)
+{
+ size_t cur_size = this->module_names_.size ();
+
+ // Resetting the module_names_
+ this->module_names_.size (cur_size -1);
+ this->set_scope ();
+}
+
+void
+TAO_PSDL_Scope::set_interface_scope (void)
+{
+ size_t cur_size = this->interface_names_.size ();
+
+ // Resetting the module_names_
+ this->interface_names_.size (cur_size -1);
+ this->set_scope ();
+}
+
+void
+TAO_PSDL_Scope::set_scope (void)
+{
+ // Remove the top scope. Its no longer needed.
+ if (this->psdl_scope_top_ <= 0)
+ {
+ return;
+ }
+
+ --this->psdl_scope_top_;
+}
+
+void
+TAO_PSDL_Scope::push_scope (TAO_PSDL_Scope *scope)
+{
+ // Push a new scope.
+ ++this->psdl_scope_top_;
+ this->psdl_scope_ [this->psdl_scope_top_ - 1] = scope;
+
+ // save for later.
+ size_t cur_size = this->ast_scope_.size ();
+ this->ast_scope_.size (cur_size + 1);
+ this->ast_scope_[cur_size] = scope;
+}
+
+void
+TAO_PSDL_Scope::save_identifier (ACE_CString identifier)
+{
+ this->identifier_ = identifier;
+}
+
+ACE_CString
+TAO_PSDL_Scope::get_identifier (void)
+{
+ return this->identifier_;
+}
+
+void
+TAO_PSDL_Scope::dump (CORBA::ULong depth)
+{
+ this->psdl_scope_[0]->dump (depth);
+}
+
+int
+TAO_PSDL_Scope::find (const ACE_CString &identifier_name,
+ ACE_CString &identifier_type)
+{
+ int result = this->root_scope_->find (identifier_name,
+ identifier_type);
+
+ return result;
+}
+
+int
+TAO_PSDL_Scope::find (const ACE_CString &identifier_name)
+{
+ int result = this->root_scope_->find (identifier_name);
+
+ return result;
+}
+
+int
+TAO_PSDL_Scope::get_module_name (const ACE_CString &identifier_name,
+ ACE_CString &module_name)
+{
+ return this->root_scope_->get_module_name (identifier_name,
+ module_name);
+}
+
+int
+TAO_PSDL_Scope::get_interface_name (const ACE_CString &identifier_name,
+ ACE_CString &interface_name)
+{
+ return this->root_scope_->get_interface_name (identifier_name,
+ interface_name);
+}
+
+ACE_CString
+TAO_PSDL_Scope::identifier_type (void)
+{
+ return "null";
+}
+
+ACE_CString
+TAO_PSDL_Scope::module_name (void)
+{
+ return "null";
+}
+
+ACE_CString
+TAO_PSDL_Scope::interface_name (void)
+{
+ return "null";
+}
+
+ACE_CString
+TAO_PSDL_Scope::convert_str (int identifier_type)
+{
+ switch (identifier_type)
+ {
+ case 258:
+ return "module";
+ case 264:
+ return "abstract";
+ case 288:
+ return "octet";
+ case 290:
+ return "object";
+ case 291:
+ return "struct";
+ case 295:
+ return "long";
+ case 296:
+ return "short";
+ case 298:
+ return "char";
+ case 300:
+ return "typedef";
+ case 301:
+ return "native";
+ case 316:
+ return "void";
+ case 317:
+ return "in";
+ case 324:
+ return "exception";
+ case 325:
+ return "interface";
+ case 326:
+ return "local";
+ case 332:
+ return "char *";
+ case 337:
+ return "enum";
+ case 338:
+ return "sequence";
+ default:
+ return "unknown";
+ };
+}
+
+
+void
+TAO_PSDL_Scope::print_depth (CORBA::ULong depth)
+{
+ for (CORBA::ULong i=0; i != depth; ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "-"));
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ ">"));
+}
+
+TAO_PSDL_Scope *
+TAO_PSDL_Scope::instance (void)
+{
+ return TAO_Singleton<TAO_PSDL_Scope, TAO_SYNCH_MUTEX>::instance ();
+}
+
+void
+TAO_PSDL_Scope::set_name_space (ACE_CString name_space)
+{
+ this->name_space_ = name_space;
+}
+
+ACE_CString
+TAO_PSDL_Scope::get_name_space (void)
+{
+ return this->name_space_;
+}
+
+void
+TAO_PSDL_Scope::set_interface_name (ACE_CString interface_name)
+{
+ this->interface_name_ = interface_name;
+}
+
+ACE_CString
+TAO_PSDL_Scope::get_interface_name (void)
+{
+ return this->interface_name_;
+}
+
+TAO_PSDL_Scope *
+TAO_PSDL_Scope::parent_scope (void)
+{
+ return 0;
+}
+
+Scope_Map *
+TAO_PSDL_Scope::scope_map (void)
+{
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template TAO_Singleton<TAO_PSDL_Scope, ACE_Thread_Mutex> *TAO_Singleton<TAO_PSDL_Scope, ACE_Thread_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/PSS/PSDL_Scope.h b/TAO/orbsvcs/PSS/PSDL_Scope.h
new file mode 100644
index 00000000000..0e7ad9d0862
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Scope.h
@@ -0,0 +1,294 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ==================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Scope
+//
+// = DESCRIPTION
+// This Class is a base class for building the ASTs. The derived
+// classes override the virtual methods that they need. The class
+// also contains the methods which are common to all the derived
+// classes.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ==================================================================
+
+#ifndef TAO_PSDL_SCOPE_H
+#define TAO_PSDL_SCOPE_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/corbafwd.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "psdl_export.h"
+
+#include "tao/TAO_Singleton.h"
+
+#include "ace/Hash_Map_Manager_T.h"
+#include "ace/Array_Base.h"
+#include "ace/SString.h"
+
+
+// Fwd Declarations.
+class TAO_PSDL_Node;
+class TAO_PSDL_Scope;
+class TAO_PSDL_Root_Scope;
+class TAO_PSDL_Stream;
+
+typedef ACE_Hash_Map_Manager_Ex<ACE_CString, TAO_PSDL_Scope *, ACE_Hash<ACE_CString>, ACE_Equal_To<ACE_CString>, TAO_SYNCH_MUTEX> Scope_Map;
+
+typedef Scope_Map::iterator Scope_Map_Iterator;
+
+class TAO_PSDL_Export TAO_PSDL_Scope
+{
+ // The TAO_PSDL_Scope class serves two purposes. One it acts as the
+ // base class from which the child classes derive to be able to add
+ // the members in their scopes. TAO_PSDL_Root_Scope is the root
+ // scope where any thing goes into. If there is a module in the idl
+ // file, all the members in the module are to be added to an
+ // instance of TAO_PSDL_Module_Scope. And, it also acts as a class
+ // that has the common members to be accessed by all the derived
+ // classes. For example, add_module_to_scope is the common method
+ // for all the sub-classes to invoke from the add_module method.
+ friend class TAO_Singleton<TAO_PSDL_Scope, TAO_SYNCH_MUTEX>;
+
+public:
+
+ TAO_PSDL_Scope (void);
+
+ virtual ~TAO_PSDL_Scope (void);
+
+ /// The add functions are overridden by the derived classes to add
+ /// the respective types in their scopes. The return value is a '0'
+ /// if successful and '-1' if it ends up as a failure.
+ virtual int add_module (ACE_CString identifier);
+
+ virtual int add_interface (ACE_CString identifier);
+
+ virtual int add_struct (ACE_CString identifier);
+
+ virtual int add_typedef (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ virtual int add_const_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ virtual int add_except_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ virtual int add_exception (ACE_CString identifier);
+
+ virtual int add_op_dcl (ACE_CString identifier);
+
+ virtual int add_member_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ /// Return the top scope.
+ virtual TAO_PSDL_Scope *pop_top_scope (void);
+
+ /// Push the scope that is passed into the stack of scopes.
+ virtual void push_scope (TAO_PSDL_Scope *scope);
+
+ /// Return the pointer to the parent scope.
+ virtual TAO_PSDL_Scope *parent_scope (void);
+
+ /// Return the pointer to Scope_Map of the instance.
+ virtual Scope_Map *scope_map (void);
+
+ /// Function to help indent the output of the parse tree.
+ virtual void dump (CORBA::ULong depth);
+
+ /// Function to find the TAO_PSDL_Scope for the given identifier_name
+ virtual int find (const ACE_CString &identifier_name,
+ ACE_CString &identifier_type);
+
+ /// Function to check if a particular identifier_name exists in the
+ /// scope.
+ virtual int find (const ACE_CString &identifier_name);
+
+ /// To get the name of the module to which an identifier_name
+ /// belongs. returns '0' on succes and '-1' on failure.
+ virtual int get_module_name (const ACE_CString &identifier_name,
+ ACE_CString &module_name);
+
+ /// To get the name of the interface to which an identifier_name
+ /// belongs. returns '0' on succes and '-1' on failure.
+ virtual int get_interface_name (const ACE_CString &identifier_name,
+ ACE_CString &interface_name);
+
+ /// Each identifier will have an instance of a derived type of
+ /// TAO_PSDL_Scope *.. the following method is an accessor to the
+ /// type of the identifier name
+ virtual ACE_CString identifier_type (void);
+ virtual ACE_CString module_name (void);
+ virtual ACE_CString interface_name (void);
+
+ /// As the function name implies, the following methods help add the
+ /// respective types to the scope passed in. The return value is a
+ /// '0' on success and '-1' on a failure.
+ int add_module_to_scope (ACE_CString identifier,
+ TAO_PSDL_Scope *scope);
+
+ int add_interface_to_scope (ACE_CString identifier,
+ TAO_PSDL_Scope *scope);
+
+ int add_interface_dcl_to_scope (ACE_CString identifier,
+ TAO_PSDL_Scope *scope);
+
+ int add_struct_to_scope (ACE_CString identifier,
+ TAO_PSDL_Scope *scope);
+
+ int add_typedef_to_scope (ACE_CString identifier,
+ ACE_CString identifier_type,
+ TAO_PSDL_Scope *scope);
+
+ int add_const_decl_to_scope (ACE_CString identifier,
+ ACE_CString identifier_type,
+ TAO_PSDL_Scope *scope);
+
+ int add_except_decl_to_scope (ACE_CString identifier,
+ ACE_CString identifier_type,
+ TAO_PSDL_Scope *scope);
+
+ int add_exception_to_scope (ACE_CString identifier,
+ TAO_PSDL_Scope *scope);
+
+ int add_scoped_decl_to_scope (ACE_CString identifier,
+ ACE_CString identifier_type,
+ TAO_PSDL_Scope *scope);
+
+ int add_enum_decl_to_scope (ACE_CString identifier,
+ ACE_CString identifier_type,
+ TAO_PSDL_Scope *scope);
+
+ int add_op_dcl_to_scope (ACE_CString identifier,
+ TAO_PSDL_Scope *scope);
+
+ int add_member_decl_to_scope (ACE_CString identifier,
+ ACE_CString identifier_type,
+ TAO_PSDL_Scope *scope);
+
+ /// Set the root scope the very first time.
+ void set_root_scope (void);
+
+ /// Set and get the name of the stub that has to be generated. The name
+ /// is based on the input file that is passed to the compiler.
+ void set_stub_prefix (const char *filename);
+ const ACE_CString &get_stub_prefix (void);
+
+ /// These methods help write the header files that needs to be
+ /// included and other initialization part to the stubs.
+ void header_initialization (TAO_PSDL_Stream *ps_sh);
+ void stub_initialization (TAO_PSDL_Stream *ps_si);
+
+ /// Get the pointer to the TAO_PSDL_Stream for the stub header.
+ TAO_PSDL_Stream *get_sh (void);
+
+ /// Get the pointer to the TAO_PSDL_Stream for the stub
+ /// implementation file.
+ TAO_PSDL_Stream *get_si (void);
+
+ /// Get the pointer to the TAO_PSDL_Stream for the stub
+ /// inline file.
+ TAO_PSDL_Stream *get_sinline (void);
+
+ /// As the name suggests, check if the identifier name is already
+ /// used for something else in the sc
+ int check_identifier (ACE_CString identifier,
+ TAO_PSDL_Scope *scope);
+
+ /// This is to check if a forward declaration has been done
+ /// already.
+ void check_name_in_scope (ACE_CString identifier,
+ TAO_PSDL_Scope *scope);
+
+ /// Return a unique instance
+ static TAO_PSDL_Scope *instance (void);
+
+ /// This wont be necessary in the final version .. its helpful to
+ /// print the symbol table to the std output for now.
+ void print_depth (CORBA::ULong depth);
+
+ /// Method used to set the scope back to the previous one.
+ void set_scope (void);
+
+ /// Set interface scope to the previous one.
+ void set_interface_scope (void);
+
+ /// Set module scope to the previous one.
+ void set_module_scope (void);
+
+ /// Methods to save and retrieve the identifier values.
+ void save_identifier (ACE_CString identifier);
+ ACE_CString get_identifier (void);
+
+ /// Accessor methods to the name of the name_space: Module name
+ void set_name_space (ACE_CString name_space);
+ ACE_CString get_name_space (void);
+
+ /// Accessor methods to the name of the current interface.
+ void set_interface_name (ACE_CString interface_name);
+ ACE_CString get_interface_name (void);
+
+ // Helper method for the semantic checking. By converting all the
+ // identifiers to lower case before adding to the scope.
+ void to_lower_case (ACE_CString &identifier);
+
+ /// Helper method to convert the int value of the identifier type to
+ /// its string equivalent based on the conversion values generated
+ /// by the Yacc Parser (please see PSDL_y.h for the conversion values).
+ ACE_CString convert_str (int identifier_type);
+
+private:
+
+ /// Array of TAO_PSDL_Scope pointers to be used with the singleton
+ /// instance.
+ TAO_PSDL_Scope **psdl_scope_;
+
+ /// Save the psdl_scopes for use while writing
+ /// to stubs.
+ ACE_Array_Base <TAO_PSDL_Scope *> ast_scope_;
+
+ /// Arrays to save the module and interface names
+ ACE_Array_Base <ACE_CString> module_names_;
+ ACE_Array_Base <ACE_CString> interface_names_;
+
+ /// Count of the members in the psdl_scope_
+ unsigned long psdl_scope_top_;
+
+ /// Pointer to the instance of the TAO_PSDL_Root_Scope.
+ TAO_PSDL_Root_Scope *root_scope_;
+
+ /// Identifier used for the save_identifier and get_identifier
+ /// methods.
+ ACE_CString identifier_;
+
+ /// Save for use while writing to stubs.
+ ACE_CString name_space_;
+ ACE_CString interface_name_;
+
+ /// Name of the filename that is passed to the compiler psdl_tao.
+ ACE_CString stub_prefix_;
+
+ /// Pointers to the TAO_PSDL_Streams for the stub header,
+ /// implementation and inline files.
+ TAO_PSDL_Stream *ps_sh_;
+ TAO_PSDL_Stream *ps_si_;
+ TAO_PSDL_Stream *ps_sin_;
+
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_SCOPE_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Scope_Visitor.cpp b/TAO/orbsvcs/PSS/PSDL_Scope_Visitor.cpp
new file mode 100644
index 00000000000..700b70dd62e
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Scope_Visitor.cpp
@@ -0,0 +1,1150 @@
+// $Id$
+
+#include "PSDL_Scope_Visitor.h"
+#include "PSDL_y.h"
+
+TAO_PSDL_Scope_Visitor::TAO_PSDL_Scope_Visitor (TAO_PSDL_Node *psdl_node)
+ : psdl_node_ (psdl_node)
+{
+}
+
+TAO_PSDL_Scope_Visitor::~TAO_PSDL_Scope_Visitor ()
+{
+}
+
+ACE_CString
+TAO_PSDL_Scope_Visitor::get_scoped_type (void)
+{
+ return this->scoped_type_;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_module (TAO_PSDL_Module *module)
+{
+ // this->psdl_node_->set_identifier ("module");
+
+ if (module->specification ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_identifier (TAO_PSDL_Identifier *identifier)
+{
+ this->psdl_node_->set_identifier (identifier->value ());
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_specification (TAO_PSDL_Specification *specification)
+{
+ if (specification->definition ()->accept (this) == -1)
+ return -1;
+
+ if (specification->specification () != 0)
+ {
+ if (specification->specification ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_definition (TAO_PSDL_Definition *definition)
+{
+ if (definition->definition_type ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_abstract_storagetype (TAO_PSDL_Abstract_Storagetype *)
+{
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_dcl (TAO_PSDL_Abstract_Storagetype_Dcl *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_fwd_dcl (TAO_PSDL_Abstract_Storagetype_Fwd_Dcl *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_header (TAO_PSDL_Abstract_Storagetype_Header *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_body (TAO_PSDL_Abstract_Storagetype_Body *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_member (TAO_PSDL_Abstract_Storagetype_Member *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_inh_spec (TAO_PSDL_Abstract_Storagetype_Inh_Spec *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_name (TAO_PSDL_Abstract_Storagetype_Name *)
+{
+ // NOT YET SUPPORTED
+ return 0; }
+
+int TAO_PSDL_Scope_Visitor::visit_psdl_state_dcl (TAO_PSDL_Psdl_State_Dcl *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_psdl_state_type_spec (TAO_PSDL_Psdl_State_Type_Spec *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_ref_type (TAO_PSDL_Abstract_Storagetype_Ref_Type)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome (TAO_PSDL_Abstract_Storagehome *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_fwd_dcl (TAO_PSDL_Abstract_Storagehome_Fwd_Dcl *)
+{ // NOT YET SUPPORTED
+
+
+ return 0; }
+
+int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_dcl (TAO_PSDL_Abstract_Storagehome_Dcl *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_header (TAO_PSDL_Abstract_Storagehome_Header *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_body (TAO_PSDL_Abstract_Storagehome_Body *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_member (TAO_PSDL_Abstract_Storagehome_Member *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_inh_spec (TAO_PSDL_Abstract_Storagehome_Inh_Spec *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_name (TAO_PSDL_Abstract_Storagehome_Name *)
+{ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_local_op_dcl (TAO_PSDL_Local_Op_Dcl *local_op_dcl)
+{
+ if (local_op_dcl->op_type_spec ()->accept (this) == -1)
+ return -1;
+
+ if (local_op_dcl->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (local_op_dcl->parameter_dcls ()->accept (this) == -1)
+ return -1;
+
+ if (local_op_dcl->raises_expr () != 0)
+ {
+ if (local_op_dcl->raises_expr ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_key_dcl (TAO_PSDL_Key_Dcl *key_dcl)
+{
+ if (key_dcl->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (key_dcl->simple_declarator () != 0)
+ if (key_dcl->simple_declarator ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_catalog (TAO_PSDL_Catalog *)
+{
+ // NOT YET SUPPORTED
+ return 0; }
+
+int TAO_PSDL_Scope_Visitor::visit_catalog_inh_spec (TAO_PSDL_Catalog_Inh_Spec *)
+{
+ // NOT YET SUPPORTED
+ return 0; }
+
+int TAO_PSDL_Scope_Visitor::visit_catalog_name (TAO_PSDL_Catalog_Name *)
+{ // NOT YET SUPPORTED
+ return 0; }
+
+int TAO_PSDL_Scope_Visitor::visit_catalog_body (TAO_PSDL_Catalog_Body *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_catalog_member (TAO_PSDL_Catalog_Member *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_storagetype_member (TAO_PSDL_Storagetype_Member *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_storagetype_inh_spec (TAO_PSDL_Storagetype_Inh_Spec *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_storagetype_name (TAO_PSDL_Storagetype_Name *storagetype_name)
+{
+ if (storagetype_name->scoped_name ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_storagetype_impl_spec (TAO_PSDL_Storagetype_Impl_Spec *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_storagetype_ref_type (TAO_PSDL_Storagetype_Ref_Type *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_store_directive (TAO_PSDL_Store_Directive *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_psdl_concrete_state_type (TAO_PSDL_Psdl_Concrete_State_Type *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_ref_rep_directive (TAO_PSDL_Ref_Rep_Directive *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_storagehome (TAO_PSDL_Storagehome *storagehome)
+{
+ if (storagehome->storagehome_header ()->accept (this) == -1)
+ return -1;
+
+ if (storagehome->storagehome_body () != 0)
+ if (storagehome->storagehome_body ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_storagehome_header (TAO_PSDL_Storagehome_Header *sh_header)
+{
+ if (sh_header->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (sh_header->storagetype_name ()->accept (this) == -1)
+ return -1;
+
+
+ if (sh_header->storagehome_inh_spec () != 0)
+ if (sh_header->storagehome_inh_spec ()->accept (this) == -1)
+ return -1;
+
+ if (sh_header->storagehome_impl_spec () != 0)
+ if (sh_header->storagehome_impl_spec ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_storagehome_body (TAO_PSDL_Storagehome_Body *sh_body)
+{
+ if (sh_body->storagehome_member ()->accept (this) == -1)
+ return -1;
+
+ if (sh_body->storagehome_body () != 0)
+ if (sh_body->storagehome_body ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_storagehome_member (TAO_PSDL_Storagehome_Member *sh_member)
+{
+ if (sh_member->key_dcl ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_storagehome_inh_spec (TAO_PSDL_Storagehome_Inh_Spec *sh_inh_spec)
+{
+ if (sh_inh_spec->storagehome_name ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_storagehome_name (TAO_PSDL_Storagehome_Name *sh_name)
+{
+ if (sh_name->scoped_name ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_storagehome_impl_spec (TAO_PSDL_Storagehome_Impl_Spec *sh_impl_spec)
+{
+ if (sh_impl_spec->abstract_storagehome_name ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_primary_key_dcl (TAO_PSDL_Primary_Key_Dcl *primary_key_dcl)
+{
+ if (primary_key_dcl->identifier ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_type_dcl (TAO_PSDL_Type_Dcl *type_dcl)
+{
+ if (type_dcl->key_word () == TAO_PSDL_NATIVE)
+ {
+ this->psdl_node_->set_identifier (TAO_PSDL_Scope::instance ()->convert_str (type_dcl->key_word ()));
+
+ this->psdl_node_->set_predefined_type ();
+ }
+
+ if (type_dcl->type_of_type_dcl ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_type_declarator (TAO_PSDL_Type_Declarator *type_declarator)
+{
+ if (type_declarator->type_spec ()->accept (this) == -1)
+ return -1;
+
+ if (type_declarator->declarators ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_type_spec (TAO_PSDL_Type_Spec *type_spec)
+{
+ if (type_spec->type_of_type_spec ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_simple_type_spec (TAO_PSDL_Simple_Type_Spec *simple_type_spec)
+{
+ if (simple_type_spec->type_of_simple_type_spec ()->accept (this) == -1)
+ return -1;
+
+ // @@ why this
+ this->scoped_type_ = TAO_PSDL_Scope::instance ()->get_identifier ();
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_base_type_spec (TAO_PSDL_Base_Type_Spec *base_type_spec)
+{
+ if (base_type_spec->type_of_base_type_spec ()->accept (this) == -1)
+ return -1;
+ return 0; }
+
+int TAO_PSDL_Scope_Visitor::visit_template_type_spec (TAO_PSDL_Template_Type_Spec *template_type_spec)
+{
+ if (template_type_spec->type_of_template_type_spec ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_constr_type_spec (TAO_PSDL_Constr_Type_Spec *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_declarators (TAO_PSDL_Declarators *declarators)
+{
+
+ if (declarators->declarator ()->accept (this) == -1)
+ return -1;
+
+ if (declarators->set_of_declarators () != 0)
+ {
+ if (declarators->set_of_declarators ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_declarator (TAO_PSDL_Declarator *declarator)
+{
+ if (declarator->type_of_declarator ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_simple_declarator (TAO_PSDL_Simple_Declarator *simple_declarator)
+{
+
+ if (simple_declarator->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (simple_declarator->simple_declarator () != 0)
+ {
+
+ if (simple_declarator->simple_declarator ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_simple_declarator_list (TAO_PSDL_Simple_Declarator_List *simple_decl_list)
+{
+
+ if (simple_decl_list-> simple_declarator ()->accept (this) == -1)
+ return -1;
+
+ if (simple_decl_list->simple_declarator_list () != 0)
+ {
+
+ if (simple_decl_list->simple_declarator_list ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_complex_declarator (TAO_PSDL_Complex_Declarator *complex_declarator)
+{
+ if (complex_declarator->array_declarator ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type)
+{
+ if ((predefined_type->type_one () != 0) && (predefined_type->type_one () != TAO_PSDL_SEQUENCE))
+ {
+ // This will happen in the case of typedefs like
+ // typedef sequence<Istring> Name. We neednot save the sequence
+ // @@ May be this is a wrong solution ... but atleast a
+ // temporary one :)
+ this->psdl_node_->set_identifier (TAO_PSDL_Scope::instance ()->convert_str (predefined_type->type_one ()));
+
+ this->psdl_node_->set_predefined_type ();
+ }
+ if (predefined_type->type_two () != 0) {}
+
+ if (predefined_type->type_three () != 0)
+ {}
+
+ if (predefined_type->type_of_variable_one () != 0)
+ {
+ if (predefined_type->type_of_variable_one ()->accept (this) == -1)
+ return -1;
+ }
+
+ if (predefined_type->type_of_variable_two () != 0)
+ {
+ if (predefined_type->type_of_variable_two ()->accept (this) == -1)
+ return -1;
+
+ // @@ I am not sure now if I need this here. So, commenting it
+ // out nad will get it back if need arises in future.
+ // this->psdl_node_->set_identifier (TAO_PSDL_Scope::instance ()->get_identifier ());
+ }
+
+ if (predefined_type->type_of_variable_three () != 0)
+ {
+ if (predefined_type->type_of_variable_three ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_member_list (TAO_PSDL_Member_List *member_list)
+{
+ if (member_list->member ()->accept (this) == -1)
+ return -1;
+
+ if (member_list->member_list () != 0)
+ {
+ if (member_list->member_list ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_member (TAO_PSDL_Member *member)
+{
+ if (member->type_spec ()->accept (this) == -1)
+ return -1;
+
+ if (member->declarators ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_union_type (TAO_PSDL_Union_Type *)
+{ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_switch_type_spec (TAO_PSDL_Switch_Type_Spec *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_switch_body (TAO_PSDL_Switch_Body *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_case_case (TAO_PSDL_Case *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_case_label (TAO_PSDL_Case_Label *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_element_spec (TAO_PSDL_Element_Spec *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_const_dcl (TAO_PSDL_Const_Dcl *const_dcl)
+{
+ if (const_dcl->const_type () != 0)
+ {
+ if (const_dcl->const_type ()->accept (this) == -1)
+ return -1;
+ }
+
+ if (const_dcl->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (const_dcl->const_exp ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_const_type (TAO_PSDL_Const_Type *const_type)
+{
+ if (const_type->type ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_const_exp (TAO_PSDL_Const_Exp *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_or_expr (TAO_PSDL_Or_Expr *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_xor_expr (TAO_PSDL_Xor_Expr *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_and_expr (TAO_PSDL_And_Expr *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_shift_expr (TAO_PSDL_Shift_Expr *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_add_expr (TAO_PSDL_Add_Expr *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_mult_expr (TAO_PSDL_Mult_Expr *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_unary_expr (TAO_PSDL_Unary_Expr *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_primary_expr (TAO_PSDL_Primary_Expr *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+ }
+
+int TAO_PSDL_Scope_Visitor::visit_except_dcl (TAO_PSDL_Except_Dcl *except_dcl)
+{
+ // @@ Do I really need this. Lets comment it for now and if it is
+ // really needed will uncomment it later,
+ /*
+ if (except_dcl->identifier ()->accept (this) == -1)
+ return -1;
+ */
+
+ if (except_dcl->member_list () != 0)
+ {
+ if (except_dcl->member_list ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_op_dcl (TAO_PSDL_Op_Dcl *op_dcl)
+{
+ if (op_dcl->op_attribute () != 0)
+ if (op_dcl->op_attribute ()->accept (this) == -1)
+ return -1;
+
+ if (op_dcl->op_type_spec ()->accept (this) == -1)
+ return -1;
+
+ if (op_dcl->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (op_dcl->parameter_dcls ()->accept (this) == -1)
+ return -1;
+
+ if (op_dcl->raises_expr () != 0)
+ if (op_dcl->raises_expr ()->accept (this) == -1)
+ return -1;
+
+ if (op_dcl->context_expr () != 0)
+ if (op_dcl->context_expr ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_storagetype (TAO_PSDL_Storagetype *storagetype)
+{
+ if (storagetype->declaration () != 0)
+ if (storagetype->declaration ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_storagetype_dcl (TAO_PSDL_Storagetype_Dcl *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_storagetype_fwd_dcl (TAO_PSDL_Storagetype_Fwd_Dcl *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_storagetype_header (TAO_PSDL_Storagetype_Header *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_storagetype_body (TAO_PSDL_Storagetype_Body *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_storagehome_scope (TAO_PSDL_Storagehome_Scope *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_provides_dcl (TAO_PSDL_Provides_Dcl *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_op_type_spec (TAO_PSDL_Op_Type_Spec *op_type_spec)
+{
+ if (op_type_spec->type () != 0)
+ {
+ this->psdl_node_->set_identifier (TAO_PSDL_Scope::instance ()->convert_str (op_type_spec->type ()));
+
+ this->psdl_node_->set_predefined_type ();
+ }
+
+ if (op_type_spec->type_spec () != 0)
+ if (op_type_spec->type_spec ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_parameter_dcls (TAO_PSDL_Parameter_Dcls *parameter_dcls)
+{
+ if (parameter_dcls->param_dcl () != 0)
+ if (parameter_dcls->param_dcl ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_param_dcl (TAO_PSDL_Param_Dcl *param_dcl)
+{
+ if (param_dcl->param_attribute ()->accept (this) == -1)
+ return -1;
+
+ if (param_dcl->param_type_spec ()->accept (this) == -1)
+ return -1;
+
+ if (param_dcl->simple_declarator ()->accept (this) == -1)
+ return -1;
+
+ if (param_dcl->param_dcl () != 0)
+ if (param_dcl->param_dcl ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_raises_expr (TAO_PSDL_Raises_Expr *raises_expr)
+{
+ this->psdl_node_->set_identifier ("raises_exception");
+
+ if (raises_expr->first_scoped_name ()->accept (this) == -1)
+ return -1;
+
+ if (raises_expr->second_scoped_name () != 0)
+ {
+ if (raises_expr->second_scoped_name ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_context_expr (TAO_PSDL_Context_Expr *context_expr)
+{
+ if (context_expr->string_literal ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_param_type_spec (TAO_PSDL_Param_Type_Spec *param_type_spec)
+{
+ if (param_type_spec->type_of_param ()->accept (this) == -1)
+ return -1;
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_fixed_pt_type (TAO_PSDL_Fixed_Pt_Type *fixed_pt_type)
+{
+ if (fixed_pt_type->positive_int_const_one ()->accept (this) == -1)
+ return -1;
+
+ if (fixed_pt_type->positive_int_const_two ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_constr_forward_decl (TAO_PSDL_Constr_Forward_Decl *constr_fwd_dcl)
+{
+ if (constr_fwd_dcl->type ()->accept (this) == -1)
+ return -1;
+
+ if (constr_fwd_dcl->identifier ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_interface (TAO_PSDL_Interface *interf)
+{
+ if (interf->type_of_dcl ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_interface_body (TAO_PSDL_Interface_Body *interface_body)
+{
+ if (interface_body->export_variable ()->accept (this) == -1)
+ return -1;
+
+ if (interface_body->interface_body () != 0)
+ {
+ if (interface_body->interface_body ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_interface_dcl (TAO_PSDL_Interface_Dcl *interface_dcl)
+{
+ if (interface_dcl->interface_header ()->accept (this) == -1)
+ return -1;
+
+ if (interface_dcl->interface_body () != 0)
+ {
+ if (interface_dcl->interface_body ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_forward_dcl (TAO_PSDL_Forward_Dcl *forward_dcl)
+{
+ if (forward_dcl->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (forward_dcl->type () != 0)
+ {
+ this->psdl_node_->set_identifier (TAO_PSDL_Scope::instance ()->convert_str (forward_dcl->type ()));
+ this->psdl_node_->set_predefined_type ();
+ }
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_interface_header (TAO_PSDL_Interface_Header *interface_header)
+{
+ // @@ Do I really need this. Lets comment it for now and if it is
+ // really needed will uncomment it later,
+
+ /*
+ if (interface_header->identifier ()->accept (this) == -1)
+ return -1;
+ */
+
+ if (interface_header->type () != 0)
+ {
+ if (interface_header->type ()->accept (this) == -1)
+ return -1;
+ }
+
+ if (interface_header->interface_inheritance_spec () != 0)
+ {
+ if (interface_header->interface_inheritance_spec ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_export_dcl (TAO_PSDL_Export_Dcl *export_dcl)
+{
+ if (export_dcl->type_of_export_one ()->accept (this) == -1)
+ return -1;
+
+ if (export_dcl->type_of_export_two () != 0)
+ {
+
+ if (export_dcl->type_of_export_two ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_interface_inheritance_spec (TAO_PSDL_Interface_Inheritance_Spec *interface_inh_spec)
+{
+ if (interface_inh_spec->interface_name ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_interface_name (TAO_PSDL_Interface_Name *interface_name)
+{
+ if (interface_name->scoped_name ()->accept (this) == -1)
+ return -1;
+
+ if (interface_name->interface_name () != 0)
+ {
+ if (interface_name->interface_name ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_scoped_name (TAO_PSDL_Scoped_Name *scoped_name)
+{
+ if (scoped_name->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (scoped_name->scoped_name () != 0)
+ {
+ if (scoped_name->scoped_name ()->accept (this) == -1)
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_value (TAO_PSDL_Value *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_value_common_base (TAO_PSDL_Value_Common_Base *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_value_forward_dcl (TAO_PSDL_Value_Forward_Dcl *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_value_box_dcl (TAO_PSDL_Value_Box_Dcl *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_value_abs_dcl (TAO_PSDL_Value_Abs_Dcl *)
+{
+ // NOT YET SUPPORTED
+ return 0; }
+
+int
+TAO_PSDL_Scope_Visitor::visit_value_dcl (TAO_PSDL_Value_Dcl *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_value_header (TAO_PSDL_Value_Header *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_value_inheritance_spec (TAO_PSDL_Value_Inheritance_Spec *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_value_name (TAO_PSDL_Value_Name *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_value_element (TAO_PSDL_Value_Element *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_array_declarator (TAO_PSDL_Array_Declarator *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_fixed_array_size (TAO_PSDL_Fixed_Array_Size *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_enumerator (TAO_PSDL_Enumerator *enumerator)
+{
+ if (enumerator->identifier ()->accept (this) == -1)
+ return -1;
+
+ if (enumerator->enumerator () != 0)
+ {
+ if (enumerator->enumerator ()->accept (this) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_literal (TAO_PSDL_Literal *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_state_member (TAO_PSDL_State_Member *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_init_dcl (TAO_PSDL_Init_Dcl *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int
+TAO_PSDL_Scope_Visitor::visit_init_param_decls (TAO_PSDL_Init_Param_Decls *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_init_param_decl (TAO_PSDL_Init_Param_Decl *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_factory_parameters (TAO_PSDL_Factory_Parameters *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_attr_dcl (TAO_PSDL_Attr_Dcl *attr_dcl)
+{
+ if (attr_dcl->readonly () != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "{ %s }\n",
+ attr_dcl->readonly ()));
+ }
+
+ if (attr_dcl->param_type_spec ()->accept (this) == -1)
+ return -1;
+
+ if (attr_dcl->simple_declarator ()->accept (this) == -1)
+ return -1;
+
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_factory_dcl (TAO_PSDL_Factory_Dcl *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
+
+int TAO_PSDL_Scope_Visitor::visit_positive_int_const (TAO_PSDL_Positive_Int_Const *)
+{
+ // NOT YET SUPPORTED
+ return 0;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Scope_Visitor.h b/TAO/orbsvcs/PSS/PSDL_Scope_Visitor.h
new file mode 100644
index 00000000000..fb9106b50ce
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Scope_Visitor.h
@@ -0,0 +1,186 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Scope_Visitor
+//
+// = DESCRIPTION
+// This class serves dual purposes: for generating a parse tree and for
+// being a base class for the classes that put the generated code
+// that should go into the stubs. Derived classes override the
+// necessary methods. Uses the Visitor Pattern.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_SCOPE_VISITOR_H
+#define TAO_PSDL_SCOPE_VISITOR_H
+
+#include "PSDL_Node_Visitor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "PSDL_Node.h"
+
+class TAO_PSDL_Export TAO_PSDL_Scope_Visitor : public TAO_PSDL_Node_Visitor
+{
+ public:
+
+ TAO_PSDL_Scope_Visitor (TAO_PSDL_Node *psdl_node);
+
+ ~TAO_PSDL_Scope_Visitor ();
+
+ // The following methods will contain code that should be executed
+ // for each particular type of a node. The derived classes override
+ // only the necessary methods. And, hence, the methods are not made
+ // pure virtual. asdkl
+ int visit_specification (TAO_PSDL_Specification *);
+ int visit_definition (TAO_PSDL_Definition *);
+ int visit_module (TAO_PSDL_Module *);
+ int visit_abstract_storagetype (TAO_PSDL_Abstract_Storagetype *);
+ int visit_abstract_storagetype_dcl (TAO_PSDL_Abstract_Storagetype_Dcl *);
+ int visit_abstract_storagetype_fwd_dcl (TAO_PSDL_Abstract_Storagetype_Fwd_Dcl *);
+ int visit_abstract_storagetype_header (TAO_PSDL_Abstract_Storagetype_Header *);
+ int visit_abstract_storagetype_body (TAO_PSDL_Abstract_Storagetype_Body *);
+ int visit_abstract_storagetype_member (TAO_PSDL_Abstract_Storagetype_Member *);
+ int visit_abstract_storagetype_inh_spec (TAO_PSDL_Abstract_Storagetype_Inh_Spec *);
+ int visit_abstract_storagetype_name (TAO_PSDL_Abstract_Storagetype_Name *);
+ int visit_psdl_state_dcl (TAO_PSDL_Psdl_State_Dcl *);
+ int visit_psdl_state_type_spec (TAO_PSDL_Psdl_State_Type_Spec *);
+
+ int visit_abstract_storagetype_ref_type (TAO_PSDL_Abstract_Storagetype_Ref_Type);
+
+ int visit_abstract_storagehome (TAO_PSDL_Abstract_Storagehome *);
+ int visit_abstract_storagehome_fwd_dcl (TAO_PSDL_Abstract_Storagehome_Fwd_Dcl *);
+ int visit_abstract_storagehome_dcl (TAO_PSDL_Abstract_Storagehome_Dcl *);
+
+ int visit_abstract_storagehome_header (TAO_PSDL_Abstract_Storagehome_Header *);
+ int visit_abstract_storagehome_body (TAO_PSDL_Abstract_Storagehome_Body *);
+ int visit_abstract_storagehome_member (TAO_PSDL_Abstract_Storagehome_Member *);
+ int visit_abstract_storagehome_inh_spec (TAO_PSDL_Abstract_Storagehome_Inh_Spec *);
+ int visit_abstract_storagehome_name (TAO_PSDL_Abstract_Storagehome_Name *);
+ int visit_local_op_dcl (TAO_PSDL_Local_Op_Dcl *);
+ int visit_key_dcl (TAO_PSDL_Key_Dcl *);
+ int visit_catalog (TAO_PSDL_Catalog *);
+ int visit_catalog_inh_spec (TAO_PSDL_Catalog_Inh_Spec *);
+ int visit_catalog_name (TAO_PSDL_Catalog_Name *);
+ int visit_catalog_body (TAO_PSDL_Catalog_Body *);
+ int visit_catalog_member (TAO_PSDL_Catalog_Member *);
+ int visit_storagetype_member (TAO_PSDL_Storagetype_Member *);
+ int visit_storagetype_inh_spec (TAO_PSDL_Storagetype_Inh_Spec *);
+ int visit_storagetype_name (TAO_PSDL_Storagetype_Name *);
+ int visit_storagetype_impl_spec (TAO_PSDL_Storagetype_Impl_Spec *);
+ int visit_storagetype_ref_type (TAO_PSDL_Storagetype_Ref_Type *);
+ int visit_store_directive (TAO_PSDL_Store_Directive *);
+ int visit_psdl_concrete_state_type (TAO_PSDL_Psdl_Concrete_State_Type *) ;
+ int visit_ref_rep_directive (TAO_PSDL_Ref_Rep_Directive *) ;
+ int visit_storagehome (TAO_PSDL_Storagehome *) ;
+ int visit_storagehome_header (TAO_PSDL_Storagehome_Header *) ;
+ int visit_storagehome_body (TAO_PSDL_Storagehome_Body *) ;
+ int visit_storagehome_member (TAO_PSDL_Storagehome_Member *) ;
+ int visit_storagehome_inh_spec (TAO_PSDL_Storagehome_Inh_Spec *) ;
+ int visit_storagehome_name (TAO_PSDL_Storagehome_Name *) ;
+
+ int visit_storagehome_impl_spec (TAO_PSDL_Storagehome_Impl_Spec *) ;
+ int visit_primary_key_dcl (TAO_PSDL_Primary_Key_Dcl *);
+ int visit_identifier (TAO_PSDL_Identifier *);
+
+ int visit_type_dcl (TAO_PSDL_Type_Dcl *) ;
+ int visit_type_declarator (TAO_PSDL_Type_Declarator *) ;
+ int visit_type_spec (TAO_PSDL_Type_Spec *) ;
+ int visit_simple_type_spec (TAO_PSDL_Simple_Type_Spec *) ;
+ int visit_base_type_spec (TAO_PSDL_Base_Type_Spec *) ;
+ int visit_template_type_spec (TAO_PSDL_Template_Type_Spec *) ;
+ int visit_constr_type_spec (TAO_PSDL_Constr_Type_Spec *) ;
+ int visit_declarators (TAO_PSDL_Declarators *) ;
+ int visit_declarator (TAO_PSDL_Declarator *) ;
+ int visit_simple_declarator (TAO_PSDL_Simple_Declarator *) ;
+ int visit_simple_declarator_list (TAO_PSDL_Simple_Declarator_List *) ;
+ int visit_complex_declarator (TAO_PSDL_Complex_Declarator *) ;
+ int visit_predefined_type (TAO_PSDL_Predefined_Type *) ;
+ int visit_member_list (TAO_PSDL_Member_List *) ;
+ int visit_member (TAO_PSDL_Member *) ;
+ int visit_union_type (TAO_PSDL_Union_Type *) ;
+ int visit_switch_type_spec (TAO_PSDL_Switch_Type_Spec *) ;
+ int visit_switch_body (TAO_PSDL_Switch_Body *) ;
+ int visit_case_case (TAO_PSDL_Case *) ;
+ int visit_case_label (TAO_PSDL_Case_Label *) ;
+ int visit_element_spec (TAO_PSDL_Element_Spec *) ;
+ int visit_const_dcl (TAO_PSDL_Const_Dcl *) ;
+ int visit_const_type (TAO_PSDL_Const_Type *) ;
+ int visit_const_exp (TAO_PSDL_Const_Exp *) ;
+ int visit_or_expr (TAO_PSDL_Or_Expr *) ;
+ int visit_xor_expr (TAO_PSDL_Xor_Expr *) ;
+ int visit_and_expr (TAO_PSDL_And_Expr *) ;
+ int visit_shift_expr (TAO_PSDL_Shift_Expr *) ;
+ int visit_add_expr (TAO_PSDL_Add_Expr *) ;
+ int visit_mult_expr (TAO_PSDL_Mult_Expr *) ;
+ int visit_unary_expr (TAO_PSDL_Unary_Expr *) ;
+ int visit_primary_expr (TAO_PSDL_Primary_Expr *) ;
+ int visit_except_dcl (TAO_PSDL_Except_Dcl *) ;
+ int visit_op_dcl (TAO_PSDL_Op_Dcl *) ;
+ int visit_storagetype (TAO_PSDL_Storagetype *) ;
+ int visit_storagetype_dcl (TAO_PSDL_Storagetype_Dcl *) ;
+ int visit_storagetype_fwd_dcl (TAO_PSDL_Storagetype_Fwd_Dcl *);
+ int visit_storagetype_header (TAO_PSDL_Storagetype_Header *);
+ int visit_storagetype_body (TAO_PSDL_Storagetype_Body *);
+ int visit_storagehome_scope (TAO_PSDL_Storagehome_Scope *);
+ int visit_provides_dcl (TAO_PSDL_Provides_Dcl *);
+ int visit_op_type_spec (TAO_PSDL_Op_Type_Spec *);
+ int visit_parameter_dcls (TAO_PSDL_Parameter_Dcls *);
+ int visit_param_dcl (TAO_PSDL_Param_Dcl *);
+ int visit_raises_expr (TAO_PSDL_Raises_Expr *);
+ int visit_context_expr (TAO_PSDL_Context_Expr *);
+ int visit_param_type_spec (TAO_PSDL_Param_Type_Spec *);
+ int visit_fixed_pt_type (TAO_PSDL_Fixed_Pt_Type *);
+ int visit_constr_forward_decl (TAO_PSDL_Constr_Forward_Decl *);
+ int visit_interface (TAO_PSDL_Interface *);
+ int visit_interface_body (TAO_PSDL_Interface_Body *);
+ int visit_interface_dcl (TAO_PSDL_Interface_Dcl *);
+ int visit_forward_dcl (TAO_PSDL_Forward_Dcl *);
+ int visit_interface_header (TAO_PSDL_Interface_Header *);
+ int visit_export_dcl (TAO_PSDL_Export_Dcl *);
+ int visit_interface_inheritance_spec (TAO_PSDL_Interface_Inheritance_Spec *);
+ int visit_interface_name (TAO_PSDL_Interface_Name *);
+ int visit_scoped_name (TAO_PSDL_Scoped_Name *);
+ int visit_value (TAO_PSDL_Value *);
+ int visit_value_common_base (TAO_PSDL_Value_Common_Base *);
+ int visit_value_forward_dcl (TAO_PSDL_Value_Forward_Dcl *);
+ int visit_value_box_dcl (TAO_PSDL_Value_Box_Dcl *);
+ int visit_value_abs_dcl (TAO_PSDL_Value_Abs_Dcl *);
+ int visit_value_dcl (TAO_PSDL_Value_Dcl *);
+ int visit_value_header (TAO_PSDL_Value_Header *);
+ int visit_value_inheritance_spec (TAO_PSDL_Value_Inheritance_Spec *);
+ int visit_value_name (TAO_PSDL_Value_Name *);
+ int visit_value_element (TAO_PSDL_Value_Element *);
+ int visit_array_declarator (TAO_PSDL_Array_Declarator *);
+ int visit_fixed_array_size (TAO_PSDL_Fixed_Array_Size *);
+ int visit_enumerator (TAO_PSDL_Enumerator *);
+ int visit_literal (TAO_PSDL_Literal *);
+ int visit_state_member (TAO_PSDL_State_Member *);
+ int visit_init_dcl (TAO_PSDL_Init_Dcl *);
+ int visit_init_param_decls (TAO_PSDL_Init_Param_Decls *);
+ int visit_init_param_decl (TAO_PSDL_Init_Param_Decl *);
+ int visit_factory_parameters (TAO_PSDL_Factory_Parameters *);
+ int visit_attr_dcl (TAO_PSDL_Attr_Dcl *);
+ int visit_factory_dcl (TAO_PSDL_Factory_Dcl *);
+ int visit_positive_int_const (TAO_PSDL_Positive_Int_Const *);
+
+ ACE_CString get_scoped_type (void);
+
+private:
+
+ TAO_PSDL_Node *psdl_node_;
+ ACE_CString scoped_type_;
+};
+
+#endif /* TAO_PSDL_SCOPE_VISITOR_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Simple_Scope.cpp b/TAO/orbsvcs/PSS/PSDL_Simple_Scope.cpp
new file mode 100644
index 00000000000..40f5bbfd332
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Simple_Scope.cpp
@@ -0,0 +1,160 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Simple_Scope.h"
+#include "PSDL_Interface_Scope.h"
+
+ACE_RCSID (PSS, PSDL_Simple_Scope, "$Id$")
+
+TAO_PSDL_Simple_Scope::TAO_PSDL_Simple_Scope (TAO_PSDL_Scope *parent_scope,
+ ACE_CString identifier_type)
+ : scope_map_ (),
+ parent_scope_ (parent_scope),
+ identifier_type_ (identifier_type)
+{
+}
+
+TAO_PSDL_Simple_Scope::~TAO_PSDL_Simple_Scope (void)
+{
+}
+
+int
+TAO_PSDL_Simple_Scope::add_typedef (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_typedef_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Simple_Scope::add_const_decl (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_const_decl_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Simple_Scope::add_except_decl (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_except_decl_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Simple_Scope::add_enum_decl (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_enum_decl_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Simple_Scope::add_op_dcl (ACE_CString identifier)
+{
+ return TAO_PSDL_Scope::instance ()->add_op_dcl_to_scope (identifier,
+ this);
+}
+
+void
+TAO_PSDL_Simple_Scope::dump (CORBA::ULong depth)
+{
+ depth = depth + 5;
+
+ for (Scope_Map_Iterator i = this->scope_map_.begin ();
+ i != this->scope_map_.end ();
+ ++i)
+ {
+ this->print_depth (depth);
+ ACE_DEBUG ((LM_DEBUG,
+ "%s (simple types)",
+ (*i).ext_id_.c_str ()));
+ (*i).int_id_->dump (depth);
+ }
+}
+
+int
+TAO_PSDL_Simple_Scope::find (const ACE_CString &identifier_name,
+ ACE_CString &identifier_type)
+{
+ for (Scope_Map_Iterator i = this->scope_map_.begin ();
+ i != this->scope_map_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ identifier_type = (*i).int_id_->identifier_type ();
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->find (identifier_name,
+ identifier_type) == 0)
+ {
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+int
+TAO_PSDL_Simple_Scope::find (const ACE_CString &identifier_name)
+{
+ for (Scope_Map_Iterator i = this->scope_map_.begin ();
+ i != this->scope_map_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->find (identifier_name) == 0)
+ {
+ // #@@@@ deal
+ // identifier_type = identifier_info->type;
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+ACE_CString
+TAO_PSDL_Simple_Scope::identifier_type (void)
+{
+ return this->identifier_type_;
+}
+
+ACE_CString
+TAO_PSDL_Simple_Scope::module_name (void)
+{
+ return this->module_name_;
+}
+
+ACE_CString
+TAO_PSDL_Simple_Scope::interface_name (void)
+{
+ return this->interface_name_;
+}
+
+TAO_PSDL_Scope *
+TAO_PSDL_Simple_Scope::parent_scope (void)
+{
+ return this->parent_scope_;
+}
+
+Scope_Map *
+TAO_PSDL_Simple_Scope::scope_map (void)
+{
+ return &this->scope_map_;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Simple_Scope.h b/TAO/orbsvcs/PSS/PSDL_Simple_Scope.h
new file mode 100644
index 00000000000..ef8e1d4ec69
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Simple_Scope.h
@@ -0,0 +1,81 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Simple_Scope
+//
+// = DESCRIPTION
+// Scope class for the Exception type helpful for building the AST.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_SIMPLE_SCOPE_H
+#define TAO_PSDL_SIMPLE_SCOPE_H
+
+#include /**/ "ace/pre.h"
+
+#include "PSDL_Scope.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_PSDL_Export TAO_PSDL_Simple_Scope : public TAO_PSDL_Scope
+{
+ public:
+
+ TAO_PSDL_Simple_Scope (TAO_PSDL_Scope *parent_scope,
+ ACE_CString identifier_type);
+
+ ~TAO_PSDL_Simple_Scope (void);
+
+ // Override the necessary methods for the simples.
+ int add_typedef (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_const_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_except_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_enum_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_op_dcl (ACE_CString identifier);
+
+ void dump (CORBA::ULong depth);
+
+ int find (const ACE_CString &identifier_name,
+ ACE_CString &identifier_type);
+
+ int find (const ACE_CString &identifier_name);
+
+ TAO_PSDL_Scope *parent_scope (void);
+
+ Scope_Map *scope_map (void);
+
+ ACE_CString identifier_type (void);
+ ACE_CString module_name (void);
+ ACE_CString interface_name (void);
+
+protected:
+
+ Scope_Map scope_map_;
+ TAO_PSDL_Scope *parent_scope_;
+ ACE_CString identifier_type_;
+ ACE_CString module_name_;
+ ACE_CString interface_name_;
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_SIMPLE_SCOPE_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Stream.cpp b/TAO/orbsvcs/PSS/PSDL_Stream.cpp
new file mode 100644
index 00000000000..eb5a8522c91
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Stream.cpp
@@ -0,0 +1,158 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Stream.h"
+
+ACE_RCSID (PSS, PSDL_Scope, "$Id$")
+
+TAO_PSDL_Stream::TAO_PSDL_Stream (void)
+{
+}
+
+TAO_PSDL_Stream::~TAO_PSDL_Stream (void)
+{
+}
+
+int
+TAO_PSDL_Stream::open (const char *fname)
+{
+ if (fname != 0)
+ {
+ // File name exists, open an I/O file handle.
+ this->fp_ = ACE_OS::fopen (fname, "w");
+
+ if (this->fp_ != 0)
+ {
+ return 0;
+ }
+ else
+ {
+ return -1;
+ }
+ }
+ else
+ {
+ return -1;
+ }
+}
+
+// Return the underlying lowlevel file pointer.
+// indentation.
+FILE *
+TAO_PSDL_Stream::file (void)
+{
+ return this->fp_;
+}
+
+int
+TAO_PSDL_Stream::incr_indent (unsigned short flag)
+{
+ indent_level_++;
+
+ if (flag != 0)
+ {
+ return this->indent ();
+ }
+ else
+ {
+ // Do not indent output.
+ return 0;
+ }
+}
+
+// Indentation
+int
+TAO_PSDL_Stream::decr_indent (unsigned short flag)
+{
+ this->indent_level_--;
+ // Just in case somebody gets "unindent happy".
+ if (this->indent_level_ < 0)
+ {
+ // ACE_DEBUG ((LM_DEBUG, "negative indentation?\n"));
+ this->indent_level_ = 0;
+ }
+
+ if (flag != 0)
+ {
+ return this->indent ();
+ }
+ else
+ {
+ // Do not indent output.
+ return 0;
+ }
+}
+
+int
+TAO_PSDL_Stream::reset (void)
+{
+ this->indent_level_ = 0;
+ return 0;
+}
+
+// Indented print.
+int
+TAO_PSDL_Stream::indent (void)
+{
+ // Based on the current indentation level, leave appropriate number of blank
+ // spaces in the output.
+ if (this->indent_level_ > 0)
+ {
+ for (int i = 0; i < this->indent_level_; i++)
+ {
+ ACE_OS::fprintf (this->fp_, " ");
+ ACE_OS::fflush (this->fp_);
+ }
+ }
+
+ return 0;
+}
+
+int
+TAO_PSDL_Stream::nl (void)
+{
+ ACE_OS::fprintf (this->fp_, "\n");
+ this->indent ();
+ return 0;
+}
+
+TAO_PSDL_Stream &
+TAO_PSDL_Stream::operator<< (const char *str)
+{
+ ACE_OS::fprintf (this->fp_, "%s", str);
+ ACE_OS::fflush (this->fp_);
+
+ return *this;
+}
+
+TAO_PSDL_Stream &
+TAO_PSDL_Stream::operator<< (ACE_CString str)
+{
+ ACE_OS::fprintf (this->fp_, "%s", str.c_str ());
+ ACE_OS::fflush (this->fp_);
+
+ return *this;
+}
+
+TAO_PSDL_Stream &
+TAO_PSDL_Stream::operator<< (const unsigned long num)
+{
+ ACE_OS::fprintf (this->fp_,
+ "%lu",
+ num);
+
+ ACE_OS::fflush (this->fp_);
+
+ return *this;
+}
+
+TAO_PSDL_Stream &
+TAO_PSDL_Stream::operator<< (const long num)
+{
+ ACE_OS::fprintf (this->fp_,
+ "%ld",
+ num);
+
+ ACE_OS::fflush (this->fp_);
+ return *this;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Stream.h b/TAO/orbsvcs/PSS/PSDL_Stream.h
new file mode 100644
index 00000000000..43e79f5b342
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Stream.h
@@ -0,0 +1,90 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ==================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Stream
+//
+// = DESCRIPTION
+// This class is to help write the generated code to files.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ==================================================================
+
+#ifndef TAO_PSDL_STREAM_H
+#define TAO_PSDL_STREAM_H
+
+#include /**/ "ace/pre.h"
+
+#include "PSDL_Scope.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_PSDL_Stream
+{
+ public:
+
+ TAO_PSDL_Stream (void);
+
+ ~TAO_PSDL_Stream (void);
+
+ /// Open the file name to be able to write to it.
+ int open (const char *fname);
+
+ /// Return the underlying lowlevel file pointer.
+ FILE *file (void);
+
+ /// increment the indentation level and by default actually indent the output
+ /// accordingly
+ int incr_indent (unsigned short flag=1);
+
+ /// decrease the indentation level and by default actually indent the output
+ /// accordingly
+ int decr_indent (unsigned short flag=1);
+
+ /// reset indentation level to 0
+ int reset (void);
+
+ /// indent starting next line
+ int indent (void);
+
+ /// put a newline and indent on the next line
+ int nl (void);
+
+ /// "printf" style variable argument print
+ int print (const char *format, ...);
+
+ // =overloaded operators
+
+ // output the char string and return a reference to ourselves
+ TAO_PSDL_Stream &operator<< (const char *str);
+
+ TAO_PSDL_Stream &operator<< (ACE_CString str);
+
+ TAO_PSDL_Stream &operator<< (const unsigned long num);
+ // output the integer and return a reference to ourselves
+
+ TAO_PSDL_Stream &operator<< (const long num);
+ // output the integer and return a reference to ourselves
+
+private:
+
+ // the underlying low-level I/O handle
+ FILE *fp_;
+
+ // indnetation level
+ int indent_level_;
+};
+
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_STREAM_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_String.cpp b/TAO/orbsvcs/PSS/PSDL_String.cpp
new file mode 100644
index 00000000000..56eb91f7886
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_String.cpp
@@ -0,0 +1,138 @@
+// $Id$
+
+#include "PSDL_String.h"
+
+#include "ace/Malloc_Base.h"
+#include "ace/SString.h"
+
+ACE_RCSID (PSS, PSDL_String, "$Id")
+
+// Constructor
+TAO_PSDL_String::TAO_PSDL_String ()
+ : allocator_ (0),
+ buffer_ (0),
+ length_ (0)
+{
+}
+
+// Constructor
+TAO_PSDL_String::TAO_PSDL_String (ACE_Allocator * persistent_allocator)
+ : allocator_ (persistent_allocator),
+ buffer_ (0),
+ length_ (0)
+{
+}
+
+// Destructor.
+TAO_PSDL_String::~TAO_PSDL_String (void)
+{
+ if (this->buffer_ != 0)
+ this->allocator_->free ((void *) this->buffer_);
+}
+
+// Copy constructor.
+TAO_PSDL_String::TAO_PSDL_String (const TAO_PSDL_String & rhs)
+{
+ *this = rhs;
+}
+
+// Assignment operator.
+void
+TAO_PSDL_String::operator= (const TAO_PSDL_String & rhs)
+{
+ if (this == &rhs) // Prevent self assignment
+ return;
+
+ // Free the existing buffer before assigning a new
+ // allocator and buffer.
+ if (this->buffer_ != 0)
+ this->allocator_->free ((void *) this->buffer_);
+
+ this->allocator_ = rhs.allocator_;
+ void * buf = this->allocator_->malloc (rhs.length_);
+ this->buffer_ = (const char *) buf;
+ if (this->buffer_)
+ {
+ // Deep copy the buffer.
+ ACE_OS::memcpy ( (void *) this->buffer_,
+ rhs.buffer_,
+ rhs.length_);
+
+ this->length_ = rhs.length_;
+ }
+ else
+ this->length_ = 0;
+}
+
+void
+TAO_PSDL_String::operator= (const ACE_CString & rhs)
+{
+ // Free the existing buffer before assigning octet
+ // sequence.
+ if (this->buffer_ != 0)
+ this->allocator_->free ((void *) this->buffer_);
+
+ const CORBA::ULong len = rhs.length ();
+
+ void * buf = this->allocator_->malloc (len);
+
+ this->buffer_ = (const char *) buf;
+
+ if (this->buffer_)
+ {
+ const char * dest = this->buffer_;
+ const char * src = rhs.rep ();
+
+ // Deep copy the buffer.
+ ACE_OS::memcpy ((void *)dest,
+ src,
+ len);
+
+ this->length_ = len;
+ }
+ else
+ this->length_ = 0;
+}
+
+bool
+TAO_PSDL_String::operator== (const TAO_PSDL_String &rhs) const
+{
+ return (ACE_OS::strcmp (buffer_, rhs.buffer_) == 0);
+}
+
+bool
+TAO_PSDL_String::operator!= (const TAO_PSDL_String &rhs) const
+{
+ return (ACE_OS::strcmp (buffer_, rhs.buffer_) != 0);
+}
+
+u_long
+TAO_PSDL_String::hash (void) const
+{
+ return ACE::hash_pjw (this->buffer_);
+}
+
+// Conversion operators (cast)
+// (caller owns storage of return values)
+TAO_PSDL_String::operator ACE_CString *() const
+{
+ ACE_CString *str = 0;
+
+ char * dest = str->rep ();
+ const char * src = this->buffer_;
+
+ ACE_OS::memcpy (dest, src, this->length_);
+
+ return str;
+}
+
+TAO_PSDL_String::operator ACE_CString *()
+{
+ ACE_CString *str = 0;
+
+ char * dest = str->rep ();
+ const char * src = this->buffer_;
+ ACE_OS::memcpy (dest, src, this->length_);
+
+ return str;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_String.h b/TAO/orbsvcs/PSS/PSDL_String.h
new file mode 100644
index 00000000000..a84e312677e
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_String.h
@@ -0,0 +1,85 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file PSDL_String.h
+ *
+ * $Id$
+ *
+ * @author Priyanka Gontla <gontla_p@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef TAO_PSDL_STRING_H
+#define TAO_PSDL_STRING_H
+#include /**/ "ace/pre.h"
+
+#include "psdl_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "PSDL_Datastore.h"
+
+/**
+ * @class TAO_PSDL_String
+ *
+ * @brief Wrapper for the ACE_CString to facilitate saving the string
+ * persistently.
+ *
+ *
+ **/
+
+class ACE_Allocator;
+
+class TAO_PSDL_Export TAO_PSDL_String
+{
+public:
+
+ /// Constructor.
+ TAO_PSDL_String (void);
+
+ /// Constructor.
+ TAO_PSDL_String (ACE_Allocator *persistent_allocator);
+
+ /// Copy constructor.
+ TAO_PSDL_String (const TAO_PSDL_String & rhs);
+
+ /// Destructor.
+ ~TAO_PSDL_String (void);
+
+ /// Assignment operator.
+ void operator= (const TAO_PSDL_String & rhs);
+
+ // Conversion operator (assignment)
+ void operator= (const ACE_CString & rhs);
+
+ /// Equality comparison operator.
+ bool operator== (const TAO_PSDL_String &rhs) const;
+
+ /// Inequality comparison operator.
+ bool operator!= (const TAO_PSDL_String &rhs) const;
+
+ /// Returns a hash value for this string.
+ u_long hash (void) const;
+
+ // Conversion operators (cast)
+ // (caller owns storage of return values)
+ operator ACE_CString *() const;
+
+ operator ACE_CString *();
+
+ // Persistent allocator.
+ ACE_Allocator * allocator_;
+
+ // Persistent buffer.
+ const char * buffer_;
+
+ // Length of the persistent buffer.
+ CORBA::ULong length_;
+};
+
+
+#include /**/ "ace/post.h"
+#endif /* TAO_PSDL_STRING_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Struct_Scope.cpp b/TAO/orbsvcs/PSS/PSDL_Struct_Scope.cpp
new file mode 100644
index 00000000000..cbbce2777cd
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Struct_Scope.cpp
@@ -0,0 +1,152 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Struct_Scope.h"
+
+ACE_RCSID (PSS, PSDL_Struct_Scope, "$Id$")
+
+TAO_PSDL_Struct_Scope::TAO_PSDL_Struct_Scope (TAO_PSDL_Scope *parent_scope)
+ : struct_scope_ (),
+ parent_scope_ (parent_scope),
+ identifier_type_ ("struct")
+{
+}
+
+int
+TAO_PSDL_Struct_Scope::add_module (ACE_CString identifier)
+{
+ return TAO_PSDL_Scope::instance ()->add_module_to_scope (identifier,
+ this);
+}
+
+int
+TAO_PSDL_Struct_Scope::add_struct (ACE_CString struct_name)
+{
+ return TAO_PSDL_Scope::instance ()->add_struct_to_scope (struct_name,
+ this);
+}
+
+int
+TAO_PSDL_Struct_Scope::add_typedef (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_typedef_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Struct_Scope::add_const_decl (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_const_decl_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+int
+TAO_PSDL_Struct_Scope::add_except_decl (ACE_CString identifier,
+ ACE_CString identifier_type)
+{
+ return TAO_PSDL_Scope::instance ()->add_except_decl_to_scope (identifier,
+ identifier_type,
+ this);
+}
+
+void
+TAO_PSDL_Struct_Scope::dump (CORBA::ULong depth)
+{
+ depth = depth + 5;
+
+ for (Scope_Map_Iterator i = this->struct_scope_.begin ();
+ i != this->struct_scope_.end ();
+ ++i)
+ {
+ this->print_depth (depth);
+ ACE_DEBUG ((LM_DEBUG,
+ "%s (struct)\n",
+ (*i).ext_id_.c_str ()));
+ (*i).int_id_->dump (depth);
+ }
+}
+
+int
+TAO_PSDL_Struct_Scope::find (const ACE_CString &identifier_name,
+ ACE_CString &identifier_type)
+{
+ for (Scope_Map_Iterator i = this->struct_scope_.begin ();
+ i != this->struct_scope_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ identifier_type = (*i).int_id_->identifier_type ();
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->find (identifier_name,
+ identifier_type) == 0)
+ {
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+int
+TAO_PSDL_Struct_Scope::find (const ACE_CString &identifier_name)
+{
+ for (Scope_Map_Iterator i = this->struct_scope_.begin ();
+ i != this->struct_scope_.end ();
+ ++i)
+ {
+ if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
+ {
+ return 0;
+ }
+ else
+ {
+ if ((*i).int_id_->find (identifier_name) == 0)
+ {
+ // #@@@@ deal
+ // identifier_type = identifier_info->type;
+ return 0;
+ }
+ }
+ }
+
+ return -1;
+}
+
+TAO_PSDL_Scope *
+TAO_PSDL_Struct_Scope::parent_scope (void)
+{
+ return this->parent_scope_;
+}
+
+Scope_Map *
+TAO_PSDL_Struct_Scope::scope_map (void)
+{
+ return &this->struct_scope_;
+}
+
+ACE_CString
+TAO_PSDL_Struct_Scope::identifier_type (void)
+{
+ return this->identifier_type_;
+}
+
+ACE_CString
+TAO_PSDL_Struct_Scope::module_name (void)
+{
+ return this->module_name_;
+}
+
+ACE_CString
+TAO_PSDL_Struct_Scope::interface_name (void)
+{
+ return this->interface_name_;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Struct_Scope.h b/TAO/orbsvcs/PSS/PSDL_Struct_Scope.h
new file mode 100644
index 00000000000..a1655c8868a
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Struct_Scope.h
@@ -0,0 +1,73 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Struct_Scope
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_STRUCT_SCOPE_H
+#define TAO_PSDL_STRUCT_SCOPE_H
+
+#include /**/ "ace/pre.h"
+
+#include "PSDL_Scope.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_PSDL_Export TAO_PSDL_Struct_Scope : public TAO_PSDL_Scope
+{
+ public:
+
+ TAO_PSDL_Struct_Scope (TAO_PSDL_Scope *parent_scope);
+
+ int add_module (ACE_CString identifier);
+
+ int add_struct (ACE_CString identifier);
+
+ int add_typedef (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_const_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ int add_except_decl (ACE_CString identifier,
+ ACE_CString identifier_type);
+
+ void dump (CORBA::ULong depth);
+
+ int find (const ACE_CString &identifier_name,
+ ACE_CString &identifier_type);
+
+ int find (const ACE_CString &identifier_name);
+
+ TAO_PSDL_Scope *parent_scope (void);
+
+ Scope_Map *scope_map (void);
+
+ ACE_CString identifier_type (void);
+ ACE_CString module_name (void);
+ ACE_CString interface_name (void);
+
+private:
+
+ Scope_Map struct_scope_;
+ TAO_PSDL_Scope *parent_scope_;
+ ACE_CString identifier_type_;
+ ACE_CString module_name_;
+ ACE_CString interface_name_;
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_STRUCT_SCOPE_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Struct_Visitor.cpp b/TAO/orbsvcs/PSS/PSDL_Struct_Visitor.cpp
new file mode 100644
index 00000000000..49f72b07b7e
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Struct_Visitor.cpp
@@ -0,0 +1,1160 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Struct_Visitor.h"
+#include "PSDL_Stream.h"
+#include "PSDL_y.h"
+#include "tao/CORBA_String.h"
+
+ACE_RCSID (PSS, PSDL_Struct_Visitor, "$Id$")
+
+TAO_PSDL_Struct_Visitor::TAO_PSDL_Struct_Visitor (void)
+ : identifiers_count_ (0),
+ struct_name_ ()
+{
+}
+
+TAO_PSDL_Struct_Visitor::~TAO_PSDL_Struct_Visitor (void)
+{
+}
+
+int
+TAO_PSDL_Struct_Visitor::visit_identifier (TAO_PSDL_Identifier *identifier)
+{
+ // The first time it will enter this function is to get the name of
+ // the struct. And, then on, for the members in the structure.
+ // so this->identifiers_[0] will be the name of the struct.
+ if (this->identifiers_.size () == 0)
+ {
+ this->identifiers_.size (1);
+ this->count_ = 0;
+ }
+
+ if (this->identifiers_.size () < this->count_ + 1)
+ this->identifiers_.size (this->count_ + 1);
+
+ this->identifiers_ [this->count_] = identifier->value ();
+ ++this->count_;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Struct_Visitor::visit_type_spec (TAO_PSDL_Type_Spec *type_spec)
+{
+ if (type_spec->type_of_type_spec ()->accept (this) == -1)
+ return -1;
+
+ ACE_CString type;
+ // Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ if (this->base_type (this->identifiers_[this->identifiers_count_], type))
+ {
+ // If this is a predefined type like long or char *
+ if (ACE_OS::strcmp (type.c_str (), "char *") == 0)
+ {
+ ps_sh->indent ();
+ *ps_sh << " TAO::String_Manager ";
+ }
+ else
+ {
+ *ps_sh << " "
+ << this->version_for_stub (type) << " ";
+ }
+ }
+ else
+ {
+ *ps_sh << "ACE_NESTED_CLASS ("
+ << TAO_PSDL_Scope::instance ()->get_name_space ()
+ << ", " << this->identifiers_ [this->identifiers_count_] << ") ";
+ }
+
+ ++this->identifiers_count_;
+ return 0;
+}
+
+int
+TAO_PSDL_Struct_Visitor::visit_declarator (TAO_PSDL_Declarator *declarator)
+{
+ if (declarator->type_of_declarator ()->accept (this) == -1)
+ return -1;
+
+ // Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ *ps_sh << this->identifiers_ [this->identifiers_count_].c_str ()
+ << ";\n";
+
+ ++this->identifiers_count_;
+ return 0;
+}
+
+int
+TAO_PSDL_Struct_Visitor::visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type)
+{
+ // Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ // Reset the indentation.
+ ps_sh->reset ();
+
+ if (predefined_type->type_of_variable_one () != 0)
+ {
+ if (predefined_type->type_of_variable_one ()->accept (this) == -1)
+ return -1;
+
+ this->struct_name_ = CORBA::string_dup (this->identifiers_ [0].c_str ());
+
+ *ps_sh << "struct " << this->struct_name_
+ << ";\n";
+
+ *ps_sh << "class " << this->struct_name_
+ << "_var;";
+
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "struct " << this->struct_name_;
+ ps_sh->nl ();
+
+ *ps_sh << "{";
+ ps_sh->nl ();
+
+ ps_sh->nl ();
+
+ *ps_sh << "typedef " << this->struct_name_ << "_var _var_type;\n";
+
+ ps_sh->nl ();
+
+ ps_sh->nl ();
+
+ *ps_sh << "static void _tao_any_destructor (void*);";
+
+ ps_sh->nl ();
+ ps_sh->nl ();
+ }
+
+ if (predefined_type->type_of_variable_two () != 0)
+ {
+ // Resetting the counter to be used while printing out the
+ // type_spec and declarator informations. See the corresponding
+ // visit_* methods.
+
+ if (this->count_ > 0)
+ this->identifiers_count_ = 1;
+
+ if (predefined_type->type_of_variable_two ()->accept (this) == -1)
+ return -1;
+
+ *ps_sh << "\n};\n\n";
+
+ this->print_class_for_structure (this->struct_name_);
+ }
+
+ if (predefined_type->type_one () != 0)
+ {
+ // If the member declarations in the structure include any
+ // predefined types like long, save them and increment the counter.
+ if (this->identifiers_.size () < this->count_ + 1)
+ this->identifiers_.size (this->count_ + 1);
+
+ this->identifiers_ [this->count_] =
+ TAO_PSDL_Scope::instance ()->convert_str (predefined_type->type_one ());
+
+ ++this->count_;
+ }
+
+ return 0;
+}
+
+void
+TAO_PSDL_Struct_Visitor::gen_code_for_si (void)
+{
+ TAO_PSDL_Stream *ps_si = TAO_PSDL_Scope::instance ()->get_si ();
+
+ ps_si->reset ();
+ ps_si->indent (); // start from current indentation level
+
+ // Generate the typecode information here
+ *ps_si << "static const CORBA::Long _oc_";
+
+ // Flat name generation.
+ *ps_si << this->struct_name_;
+ *ps_si << "[] =";
+ ps_si->nl ();
+ *ps_si << "{";
+ ps_si->nl ();
+
+ // Some invocation call to put in the stuff that goes between
+ // braces.
+ *ps_si << "TAO_ENCAP_BYTE_ORDER";
+ ps_si->nl ();
+ *ps_si << "// Typecode related information should go in here";
+ ps_si->nl ();
+
+ *ps_si << "};";
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "static CORBA::TypeCode _tc_TAO_tc_";
+ *ps_si << this->struct_name_;
+ *ps_si << " (";
+ ps_si->nl ();
+ ps_si->incr_indent (0);
+ *ps_si << "CORBA::tk_struct,";
+ ps_si->nl ();
+ *ps_si << "sizeof (_oc_" << this->struct_name_ << "),";
+ ps_si->nl ();
+ *ps_si << "(char *) &_oc_";
+ *ps_si << this->struct_name_ << ",";
+ ps_si->nl ();
+ *ps_si << "0,";
+ ps_si->nl ();
+ *ps_si << "sizeof (" << this->struct_name_ << ")";
+ ps_si->nl ();
+ *ps_si << ");";
+ ps_si->decr_indent ();
+
+ ps_si->nl ();
+ ps_si->nl ();
+ *ps_si << "::CORBA::TypeCode_ptr _tc_" << this->struct_name_ << " =";
+ ps_si->nl ();
+ ps_si->incr_indent (0);
+
+ *ps_si << "&_tc_TAO_tc_" << this->struct_name_ << ";";
+ ps_si->decr_indent ();
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "void ";
+ *ps_si << this->struct_name_
+ << "::_tao_any_destructor (void *_tao_void_pointer)";
+ ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->nl ();
+ ps_si->incr_indent (0);
+
+ *ps_si << this->struct_name_ << " *tmp = "
+ << "ACE_static_cast ("
+ << this->struct_name_
+ << "*, _tao_void_pointer);";
+
+ ps_si->nl ();
+ *ps_si << "delete tmp;";
+ ps_si->decr_indent ();
+ ps_si->nl ();
+ ps_si->decr_indent ();
+ *ps_si <<"}";
+ ps_si->nl ();
+ ps_si->nl ();
+
+ // Copying Insertion
+
+ *ps_si << "// Copying insertion.";
+ ps_si->nl ();
+
+ *ps_si << "void operator<<= (";
+
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "CORBA::Any &_tao_any,"; ps_si->nl ();
+ *ps_si << "const " << this->struct_name_ << " &_tao_elem"; ps_si->nl ();
+
+ ps_si->decr_indent ();
+
+ *ps_si << ")"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0); ps_si->nl ();
+ *ps_si << "TAO_OutputCDR stream;"; ps_si->nl ();
+
+ *ps_si << "if (stream << _tao_elem)"; ps_si->nl ();
+ *ps_si << "{";
+
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "_tao_any._tao_replace (";
+
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "_tc_" << this->struct_name_ << ","; ps_si->nl ();
+ *ps_si << "TAO_ENCAP_BYTE_ORDER,"; ps_si->nl ();
+ *ps_si << "stream.begin ()";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << ");";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->nl ();
+
+ ps_si->reset ();
+ ps_si->nl ();
+
+ *ps_si << "// Non-copying insertion."; ps_si->nl ();
+ *ps_si << "void operator<<= (";
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "CORBA::Any &_tao_any,"; ps_si->nl ();
+ *ps_si << this->struct_name_ << " *_tao_elem";
+
+ ps_si->nl ();
+ *ps_si << ")";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "TAO_OutputCDR stream;"; ps_si->nl ();
+
+ *ps_si << "if (stream << *_tao_elem)"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "_tao_any._tao_replace (";
+ ps_si->incr_indent (0);ps_si->nl ();
+
+ *ps_si << "_tc_" << this->struct_name_ << ","; ps_si->nl ();
+ *ps_si << "TAO_ENCAP_BYTE_ORDER,"; ps_si->nl ();
+ *ps_si << "stream.begin (),"; ps_si->nl ();
+ *ps_si << "1,"; ps_si->nl ();
+ *ps_si << "_tao_elem,"; ps_si->nl ();
+ *ps_si << this->struct_name_ << "::_tao_any_destructor";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << ");";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << "}"; ps_si->nl ();
+
+ ps_si->reset ();
+ ps_si->nl ();
+
+ *ps_si << "// Extraction to const pointer."; ps_si->nl ();
+
+ *ps_si << "CORBA::Boolean operator>>= (";
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "const CORBA::Any &_tao_any,"; ps_si->nl ();
+ *ps_si << "const " << this->struct_name_ << " *&_tao_elem"; ps_si->nl ();
+
+ *ps_si << ")";
+ ps_si->decr_indent (0); ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "_tao_elem = 0;"; ps_si->nl ();
+
+ *ps_si << "ACE_TRY_NEW_ENV"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "CORBA::TypeCode_var type = _tao_any.type ();"; ps_si->nl ();
+ *ps_si << "CORBA::Boolean result ="; ps_si->nl ();
+
+ *ps_si << "type->equivalent (";
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "_tc_" << this->struct_name_ << ""; ps_si->nl ();
+ *ps_si << "ACE_ENV_ARG_PARAMETER";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+
+ *ps_si << ");"; ps_si->nl ();
+ *ps_si << "ACE_TRY_CHECK;"; ps_si->nl ();
+
+ *ps_si << "if (result == 0)"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "return 0; // not equivalent";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << "}"; ps_si->nl ();
+
+ *ps_si << "if (_tao_any.any_owns_data ())"; ps_si->nl ();
+ *ps_si << "{";
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "_tao_elem = ACE_static_cast (";
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "const " << this->struct_name_ << "*,"; ps_si->nl ();
+ *ps_si << "_tao_any.value ()";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << ");"; ps_si->nl ();
+
+ *ps_si << "return 1;"; ps_si->nl ();
+
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << "}"; ps_si->nl ();
+
+ *ps_si << "else"; ps_si->nl ();
+ *ps_si << "{";
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << this->struct_name_ << " *tmp;"; ps_si->nl ();
+
+ *ps_si << "ACE_NEW_RETURN (";
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "tmp,"; ps_si->nl ();
+ *ps_si << this->struct_name_ << ","; ps_si->nl ();
+ *ps_si << "0"; ps_si->nl ();
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << ");"; ps_si->nl ();
+ *ps_si << ""; ps_si->nl ();
+
+ *ps_si << "TAO_InputCDR stream (";
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "_tao_any._tao_get_cdr (),"; ps_si->nl ();
+ *ps_si << "_tao_any._tao_byte_order ()";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << ");"; ps_si->nl ();
+
+ *ps_si << "if (stream >> *tmp)"; ps_si->nl ();
+ *ps_si << "{";
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "((CORBA::Any *)&_tao_any)->_tao_replace (";
+ ps_si->incr_indent (0); ps_si->nl ();
+ *ps_si << "_tc_" << this->struct_name_ << ","; ps_si->nl ();
+ *ps_si << "1,"; ps_si->nl ();
+ *ps_si << "static_cast<void *> (tmp),"; ps_si->nl ();
+ *ps_si << this->struct_name_ << "::_tao_any_destructor";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << ");"; ps_si->nl ();
+
+ *ps_si << "_tao_elem = tmp;"; ps_si->nl ();
+ *ps_si << "return 1;";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << "}"; ps_si->nl ();
+
+ *ps_si << "else"; ps_si->nl ();
+
+ *ps_si << "{";
+ ps_si->incr_indent (0); ps_si->nl ();
+
+ *ps_si << "delete tmp;";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << "}"; ps_si->nl ();
+
+ *ps_si << "ACE_CATCHANY"; ps_si->nl ();
+ *ps_si << "{";
+ ps_si->nl ();
+ *ps_si << "}"; ps_si->nl ();
+
+ *ps_si << "ACE_ENDTRY;"; ps_si->nl ();
+ *ps_si << "return 0;"; ps_si->nl ();
+ ps_si->decr_indent (0); ps_si->nl ();
+ *ps_si << "}";
+
+ ps_si->reset ();
+ ps_si->nl (); ps_si->nl ();
+
+ return;
+}
+
+void
+TAO_PSDL_Struct_Visitor::print_class_for_structure (ACE_CString struct_name)
+{
+ // Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ *ps_sh << "class " << struct_name.c_str () << "_var\n";
+ *ps_sh << "{\n";
+
+ *ps_sh << "public:\n";
+ *ps_sh << " " << struct_name << "_var (void);\n";
+ *ps_sh << " " << struct_name << "_var (" << struct_name
+ << " *);\n";
+ *ps_sh << " " << struct_name << "_var (const " << struct_name
+ << "_var &);\n";
+ *ps_sh << " ~" << struct_name << "_var (void"
+ << ");\n";
+
+ ps_sh->nl ();
+
+
+ *ps_sh << " " << struct_name << "_var"
+ << " &operator= (" << struct_name
+ << " *);\n";
+
+ *ps_sh << " " << struct_name << "_var"
+ << " &operator= (const " << struct_name
+ << "_var &);\n";
+
+ *ps_sh << " " << struct_name
+ << " *operator-> (void);\n";
+
+ *ps_sh << " const " << struct_name
+ << " *operator-> (void) const;\n";
+
+ ps_sh->nl ();
+
+
+ *ps_sh << " operator const "
+ << struct_name << "&() const;\n";
+
+ *ps_sh << " operator "
+ << struct_name << "&();\n";
+
+ *ps_sh << " operator "
+ << struct_name << "&() const;\n";
+
+ *ps_sh << " // Variable-size types only.\n";
+
+ *ps_sh << " operator "
+ << struct_name << "*&();\n";
+
+ *ps_sh << " // in inout, out, _retn\n";
+ *ps_sh << " const " << struct_name << "&in (void) const;\n";
+ *ps_sh << " " << struct_name << " &inout (void);\n";
+ *ps_sh << " " << struct_name << " *&out (void);\n";
+ *ps_sh << " " << struct_name << " *_retn (void);\n";
+ *ps_sh << " " << struct_name << " *ptr (void) const;\n";
+
+ *ps_sh << "private:\n";
+ *ps_sh << " " << struct_name << " *ptr_;\n";
+
+ *ps_sh << "};\n";
+
+ *ps_sh << "class " << struct_name << "_out \n";
+ *ps_sh << "{\n";
+ *ps_sh << " public:\n";
+ *ps_sh << " " << struct_name << "_out ("
+ << struct_name << " *&);\n";
+ *ps_sh << " " << struct_name << "_out ("
+ << struct_name << "_var &);\n";
+ *ps_sh << " " << struct_name << "_out (const "
+ << struct_name << "_out &);\n";
+ *ps_sh << " " << struct_name << "_out &operator= (const "
+ << struct_name << "_out &);\n";
+ *ps_sh << " " << struct_name << "_out &operator= ("
+ << struct_name << " *);\n";
+ *ps_sh << " operator " << struct_name << " *&();\n";
+ *ps_sh << " " << struct_name << " *&ptr (void);\n";
+ *ps_sh << " " << struct_name << " *operator-> (void);\n";
+ ps_sh->nl ();
+
+ *ps_sh << " private:\n";
+ *ps_sh << " " << struct_name << " *&ptr_;\n";
+ *ps_sh << " // Assignment from T_var not allowed.\n";
+ *ps_sh << " void operator= (const " << struct_name << "_var &);\n";
+ *ps_sh << " };\n";
+
+ *ps_sh << "TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr"
+ << " _tc_" << struct_name << ";";
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << " void operator<<= (CORBA::Any &, const " << struct_name << " &);"
+ << "// copying version";
+ ps_sh->nl ();
+
+ *ps_sh << " void operator<<= (CORBA::Any &, " << struct_name << "*);"
+ << "// noncopying version";
+ ps_sh->nl ();
+
+ *ps_sh << " CORBA::Boolean operator>>= "
+ << "(const CORBA::Any &, " << struct_name << " *&);"
+ << "// deprecated";
+ ps_sh->nl ();
+
+ *ps_sh << " CORBA::Boolean operator>>= "
+ << "(const CORBA::Any &, const " << struct_name << " *&);";
+ ps_sh->nl ();
+
+ ps_sh->nl ();
+
+ *ps_sh << "#ifndef __ACE_INLINE__";
+ ps_sh->incr_indent (0);
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << " CORBA::Boolean operator<< "
+ << "(TAO_OutputCDR &, const " << struct_name << " &);";
+ ps_sh->nl ();
+
+ *ps_sh << " CORBA::Boolean operator>> (TAO_InputCDR &, " << struct_name << " &);";
+
+ ps_sh->decr_indent (0);
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "#endif /* __ACE_INLINE__ */";
+
+ ps_sh->nl ();
+ ps_sh->nl ();
+}
+
+void
+TAO_PSDL_Struct_Visitor::gen_code_for_sinline (void)
+{
+ TAO_PSDL_Stream *ps_sin = TAO_PSDL_Scope::instance ()->get_sinline ();
+
+ if (ps_sin == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Null pointer to the psdl inline file\n"));
+ }
+ ps_sin->reset ();
+
+ *ps_sin << "// ********************************************************";
+ ps_sin->nl ();
+ *ps_sin << "// Inline operations for class " << this->struct_name_ << "_var"; ps_sin->nl ();
+ *ps_sin << "// ********************************************************";
+ ps_sin->nl ();
+
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::" << this->struct_name_ << "_var (void) // default constructor";
+
+ ps_sin->incr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << ": ptr_ (0)";
+
+ ps_sin->decr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "{}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::" << this->struct_name_ << "_var (" << this->struct_name_ << " *p)";
+
+ ps_sin->incr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << ": ptr_ (p)";
+
+ ps_sin->decr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "{}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::" << this->struct_name_ << "_var (const ::" << this->struct_name_ << "_var &p) // copy constructor"; ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "if (p.ptr_)";
+
+ ps_sin->incr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_NEW (this->ptr_, ::" << this->struct_name_ << " (*p.ptr_));";
+
+ ps_sin->decr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "else";
+
+ ps_sin->incr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "this->ptr_ = 0;";
+
+ ps_sin->decr_indent (0);
+ ps_sin->decr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::~" << this->struct_name_ << "_var (void) // destructor"; ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "delete this->ptr_;";
+
+ ps_sin->decr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE " << this->struct_name_ << "_var &"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::operator= (" << this->struct_name_ << " *p)"; ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "delete this->ptr_;"; ps_sin->nl ();
+ *ps_sin << "this->ptr_ = p;"; ps_sin->nl ();
+ *ps_sin << "return *this;";
+
+ ps_sin->decr_indent (0);
+ ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE ::" << this->struct_name_ << "_var &"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::operator= (const ::" << this->struct_name_ << "_var &p)"; ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "if (this != &p)";
+
+ ps_sin->incr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "if (p.ptr_ == 0)";
+
+ ps_sin->incr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "delete this->ptr_;"; ps_sin->nl ();
+ *ps_sin << "this->ptr_ = 0;";
+
+ ps_sin->decr_indent (0);
+ ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+
+ *ps_sin << "else";
+
+ ps_sin->incr_indent (0);
+ ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << this->struct_name_ << " *deep_copy =";
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "new " << this->struct_name_ << " (*p.ptr_);";
+
+ ps_sin->decr_indent (0);ps_sin->nl ();
+
+ ps_sin->nl ();
+
+ *ps_sin << "if (deep_copy != 0)";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << this->struct_name_ << " *tmp = deep_copy;"; ps_sin->nl ();
+ *ps_sin << "deep_copy = this->ptr_;"; ps_sin->nl ();
+ *ps_sin << "this->ptr_ = tmp;"; ps_sin->nl ();
+ *ps_sin << "delete deep_copy;";
+
+ ps_sin->decr_indent (0);ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->decr_indent (0);
+ ps_sin->decr_indent (0);ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->decr_indent (0);
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "return *this;";
+
+ ps_sin->decr_indent (0);
+ ps_sin->decr_indent (0);
+ ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE const ::" << this->struct_name_ << " *"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::operator-> (void) const"; ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "return this->ptr_;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE ::" << this->struct_name_ << " *"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::operator-> (void)"; ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "return this->ptr_;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::operator const ::" << this->struct_name_ << " &() const // cast"; ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "return *this->ptr_;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::operator ::" << this->struct_name_ << " &() // cast "; ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "return *this->ptr_;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::operator ::" << this->struct_name_ << " &() const // cast "; ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "return *this->ptr_;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "// variable-size types only"; ps_sin->nl ();
+ *ps_sin << "ACE_INLINE"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::operator ::" << this->struct_name_ << " *&() // cast "; ps_sin->nl ();
+ *ps_sin << "{";
+ ps_sin->incr_indent (0); ps_sin->nl ();
+
+ *ps_sin << "return this->ptr_;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE const ::" << this->struct_name_ << " &"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::in (void) const"; ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "return *this->ptr_;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE ::" << this->struct_name_ << " &"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::inout (void)"; ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "return *this->ptr_;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "// mapping for variable size "; ps_sin->nl ();
+ *ps_sin << "ACE_INLINE ::" << this->struct_name_ << " *&"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::out (void)"; ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "delete this->ptr_;"; ps_sin->nl ();
+ *ps_sin << "this->ptr_ = 0;"; ps_sin->nl ();
+ *ps_sin << "return this->ptr_;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE ::" << this->struct_name_ << " *"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::_retn (void)"; ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+
+ *ps_sin << "::" << this->struct_name_ << " *tmp = this->ptr_;"; ps_sin->nl ();
+ *ps_sin << "this->ptr_ = 0;"; ps_sin->nl ();
+ *ps_sin << "return tmp;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE ::" << this->struct_name_ << " *"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_var::ptr (void) const"; ps_sin->nl ();
+
+ *ps_sin << "{";
+ ps_sin->incr_indent (0); ps_sin->nl ();
+
+ *ps_sin << "return this->ptr_;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "// ************************************************************";
+ ps_sin->nl ();
+ *ps_sin << "// Inline operations for class " << this->struct_name_ << "_out";
+ ps_sin->nl ();
+ *ps_sin << "// ************************************************************"; ps_sin->nl ();
+
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_out::" << this->struct_name_ << "_out (::" << this->struct_name_ << " *&p)";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << ": ptr_ (p)";
+ ps_sin->decr_indent (0); ps_sin->nl ();
+
+ *ps_sin << "{";
+ ps_sin->incr_indent (0); ps_sin->nl ();
+
+ *ps_sin << "this->ptr_ = 0;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_out::" << this->struct_name_ << "_out (" << this->struct_name_ << "_var &p) // constructor from _var";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << ": ptr_ (p.out ())";
+ ps_sin->decr_indent (0); ps_sin->nl ();
+
+ *ps_sin << "{";
+ ps_sin->incr_indent (0);ps_sin->nl ();
+
+ *ps_sin << "delete this->ptr_;"; ps_sin->nl ();
+ *ps_sin << "this->ptr_ = 0;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_out::" << this->struct_name_ << "_out (const ::" << this->struct_name_ << "_out &p) // copy constructor";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << ": ptr_ (ACE_const_cast (" << this->struct_name_ << "_out&, p).ptr_)";
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "{}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE " << this->struct_name_ << "_out &"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_out::operator= (const ::" << this->struct_name_ << "_out &p)"; ps_sin->nl ();
+
+ *ps_sin << "{";
+ ps_sin->incr_indent (0);ps_sin->nl ();
+
+ *ps_sin << "this->ptr_ = ACE_const_cast (" << this->struct_name_ << "_out&, p).ptr_;"; ps_sin->nl ();
+ *ps_sin << "return *this;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE " << this->struct_name_ << "_out &"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_out::operator= (" << this->struct_name_ << " *p)"; ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "this->ptr_ = p;"; ps_sin->nl ();
+ *ps_sin << "return *this;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_out::operator ::" << this->struct_name_ << " *&() // cast"; ps_sin->nl ();
+ *ps_sin << "{";
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "return this->ptr_;";
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE ::" << this->struct_name_ << " *&"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_out::ptr (void) // ptr"; ps_sin->nl ();
+ *ps_sin << "{";
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "return this->ptr_;";
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE ::" << this->struct_name_ << " *"; ps_sin->nl ();
+ *ps_sin << this->struct_name_ << "_out::operator-> (void)"; ps_sin->nl ();
+ *ps_sin << "{";
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "return this->ptr_;";
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE CORBA::Boolean operator<< "
+ << "(TAO_OutputCDR &strm, const " << this->struct_name_ << " &_tao_aggregate)";
+ ps_sin->nl ();
+ *ps_sin << "{";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+
+ *ps_sin << "if (";
+ ps_sin->incr_indent (0); ps_sin->nl ();
+
+ *ps_sin << "(strm << _tao_aggregate.name.in ()) &&"; ps_sin->nl ();
+ *ps_sin << "(strm << _tao_aggregate.obj_ref.in ())";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << ")";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "return 1;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "else";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "return 0;";
+
+
+ ps_sin->decr_indent (0);
+ ps_sin->decr_indent (0);ps_sin->nl ();
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+ ps_sin->nl ();
+
+ *ps_sin << "ACE_INLINE CORBA::Boolean operator>> "
+ << "(TAO_InputCDR &strm, " << this->struct_name_ << " &_tao_aggregate)";
+ ps_sin->nl ();
+
+ *ps_sin << "{";
+ ps_sin->incr_indent (0); ps_sin->nl ();
+
+ *ps_sin << "if (";
+ ps_sin->incr_indent (0);ps_sin->nl ();
+
+ *ps_sin << "(strm >> _tao_aggregate.name.out ()) &&"; ps_sin->nl ();
+ *ps_sin << "(strm >> _tao_aggregate.obj_ref.out ())";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << ")";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "return 1;";
+
+ ps_sin->decr_indent (0); ps_sin->nl ();
+ *ps_sin << "else";
+
+ ps_sin->incr_indent (0); ps_sin->nl ();
+ *ps_sin << "return 0;";
+
+ ps_sin->decr_indent (0);
+ ps_sin->decr_indent (0);
+ ps_sin->nl ();
+
+ *ps_sin << "}";
+
+ ps_sin->nl ();
+
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Struct_Visitor.h b/TAO/orbsvcs/PSS/PSDL_Struct_Visitor.h
new file mode 100644
index 00000000000..7910bb72c38
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Struct_Visitor.h
@@ -0,0 +1,66 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Struct_Visitor.h
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_STRUCT_VISITOR_H
+#define TAO_PSDL_STRUCT_VISITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "PSDL_Node_Visitor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_PSDL_Struct_Visitor : public TAO_PSDL_Node_Visitor
+{
+ public:
+
+ TAO_PSDL_Struct_Visitor ();
+
+ ~TAO_PSDL_Struct_Visitor ();
+
+ int visit_identifier (TAO_PSDL_Identifier *identifier);
+
+ int visit_type_spec (TAO_PSDL_Type_Spec *type_spec);
+
+ int visit_declarator (TAO_PSDL_Declarator *declarator);
+
+ // For structs
+ int visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type);
+
+ // Generate the code that should go into the stub implementation
+ // file for the type_declarators.
+ void gen_code_for_si (void);
+
+ // Generate the code that should go into the stub inline
+ // file for the type_declarators.
+ void gen_code_for_sinline (void);
+
+ private:
+ void print_class_for_structure (ACE_CString struct_name);
+
+ // Counter to help print the type_specs and declarators of a
+ // structure.
+ int identifiers_count_;
+
+ // structure_name
+ const char *struct_name_;
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_STRUCT_VISITOR_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Type_Dcl_Visitor.cpp b/TAO/orbsvcs/PSS/PSDL_Type_Dcl_Visitor.cpp
new file mode 100644
index 00000000000..0bde2955e69
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Type_Dcl_Visitor.cpp
@@ -0,0 +1,445 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Type_Dcl_Visitor.h"
+#include "PSDL_Stream.h"
+
+ACE_RCSID (PSS, PSDL_Type_Dcl_Visitor, "$Id$")
+
+TAO_PSDL_Type_Dcl_Visitor::TAO_PSDL_Type_Dcl_Visitor (void)
+{
+}
+
+TAO_PSDL_Type_Dcl_Visitor::~TAO_PSDL_Type_Dcl_Visitor (void)
+{
+}
+
+int
+TAO_PSDL_Type_Dcl_Visitor::visit_identifier (TAO_PSDL_Identifier *identifier)
+{
+ if (this->identifiers_.size () == 0)
+ {
+ this->identifiers_.size (1);
+ this->count_ = 0;
+ }
+
+ if (this->identifiers_.size () < this->count_ + 1)
+ this->identifiers_.size (this->count_ + 1);
+
+ this->identifiers_ [this->count_] = identifier->value ();
+ ++this->count_;
+
+ return 0;
+}
+
+int
+TAO_PSDL_Type_Dcl_Visitor::visit_type_declarator (TAO_PSDL_Type_Declarator *type_declarator)
+{
+ // Typedefs.
+ this->count_ = 0;
+ this->identifiers_.size (2);
+ this->predefined_type_.size (2);
+
+ this->predefined_type_[this->count_] = 0;
+
+ if (type_declarator->type_spec ()->accept (this) == -1)
+ return -1;
+
+ if (type_declarator->declarators ()->accept (this) == -1)
+ return -1;
+
+ ACE_CString type;
+
+ // This flag is used to distinguish between the predefined types and
+ // types that are typedef'ed before.
+ if (this->predefined_type_ [0] == 0)
+ {
+ if (this->base_type (this->identifiers_[this->count_ -1], type))
+ {
+ if (ACE_OS::strcmp (type.c_str (), "struct") != 0)
+ this->identifiers_[0] = type;
+ }
+ }
+
+ // If the typedef is for a sequence of something, the very first
+ // element is going to be 'sequence' (check visit_predefined_type
+ // method in this class). We are basing our selection
+ // based on that.
+ if (ACE_OS::strcmp (this->identifiers_[0].c_str (), "sequence") != 0)
+ {
+ this->print_for_simple_typedefs ();
+ }
+ else
+ this->print_for_sequence_typedefs (this->identifiers_[1],
+ this->identifiers_[2]);
+
+ return 0;
+}
+
+/*
+ There seems to be a difference with what shoudl be printed adn what
+ is printed out as per the method. So commenting it for now. Will keep
+ it around for some time nad remove when I am sure its is totally wrong
+*/
+
+void
+TAO_PSDL_Type_Dcl_Visitor::print_for_sequence_typedefs (ACE_CString identifier_type,
+ ACE_CString identifier)
+{
+ ACE_CString name_space = TAO_PSDL_Scope::instance ()->get_name_space ();
+
+ // Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ ps_sh->nl ();
+ *ps_sh << "#if !defined (TAO_USE_SEQUENCE_TEMPLATES)";
+ ps_sh->nl ();
+ *ps_sh << "#if !defined (__TAO_UNBOUNDED_SEQUENCE_" << name_space.c_str ()
+ << "_" << identifier.c_str () << "_CH_)";
+ ps_sh->nl ();
+ *ps_sh << "#define __TAO_UNBOUNDED_SEQUENCE_" << name_space.c_str ()
+ << "_" << identifier.c_str () << "_CH_";
+ ps_sh->nl ();
+ *ps_sh << "class TAO_EXPORT_MACRO _TAO_Unbounded_Sequence_CosNaming_"
+ << identifier.c_str ();
+ ps_sh->nl ();
+ *ps_sh << ": public TAO_Unbounded_Base_Sequence";
+ ps_sh->nl ();
+ *ps_sh << "{";
+ ps_sh->incr_indent ();
+ ps_sh->nl ();
+ *ps_sh << "public:";
+ ps_sh->nl ();
+ *ps_sh << "// = Initialization and termination methods.";
+ ps_sh->nl ();
+ *ps_sh << "_TAO_Unbounded_Sequence_" << name_space.c_str ()
+ << "_" << identifier.c_str () << " (void);";
+ ps_sh->nl ();
+ *ps_sh << "_TAO_Unbounded_Sequence_" << name_space.c_str ()
+ << "_" << identifier.c_str () << " (CORBA::ULong maximum);";
+ ps_sh->nl ();
+ *ps_sh << "_TAO_Unbounded_Sequence_" << name_space.c_str () << "_"
+ << identifier.c_str () << " (";
+ ps_sh->nl ();
+ *ps_sh << "CORBA::ULong maximum,";
+ ps_sh->nl ();
+ *ps_sh << "CORBA::ULong length,";
+ ps_sh->nl ();
+ *ps_sh << identifier_type << " *data,";
+ ps_sh->nl ();
+ *ps_sh << "CORBA::Boolean release = 0";
+ ps_sh->nl ();
+ *ps_sh << ");";
+ ps_sh->nl ();
+ *ps_sh << "_TAO_Unbounded_Sequence_" << name_space.c_str () << "_" << identifier.c_str () << " (";
+ ps_sh->nl ();
+ *ps_sh << "const _TAO_Unbounded_Sequence_" << name_space.c_str () << "_" << identifier.c_str () << " &rhs\n";
+ *ps_sh << ");\n";
+ *ps_sh << "_TAO_Unbounded_Sequence_" << name_space.c_str () << "_" << identifier.c_str () << " &operator= (\n";
+ *ps_sh << "const _TAO_Unbounded_Sequence_" << name_space.c_str () << "_" << identifier.c_str () << " &rhs\n";
+ *ps_sh << ");\n";
+ *ps_sh << "virtual ~_TAO_Unbounded_Sequence_" << name_space << "_" << identifier << " (void);";
+ ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << "// = Accessors.\n";
+ *ps_sh << identifier_type << " &operator[] (CORBA::ULong i);\n";
+ *ps_sh << "const " << identifier_type << " &operator[] (CORBA::ULong i) const;\n";
+ ps_sh->nl ();
+ *ps_sh << "// = Static operations.\n";
+ *ps_sh << "static " << identifier_type << " *allocbuf (CORBA::ULong size);\n";
+ *ps_sh << "static void freebuf (" << identifier_type << " *buffer);\n";
+ ps_sh->nl ();
+ *ps_sh << "// Implement the TAO_Base_Sequence methods (see Sequence.h)"; ps_sh->nl ();
+ *ps_sh << "virtual void _allocate_buffer (CORBA::ULong length);"; ps_sh->nl ();
+ *ps_sh << "virtual void _deallocate_buffer (void);"; ps_sh->nl ();
+ *ps_sh << identifier_type << " *get_buffer (CORBA::Boolean orphan = 0);"; ps_sh->nl ();
+ *ps_sh << "const " << identifier_type << " *get_buffer (void) const;"; ps_sh->nl ();
+ *ps_sh << "void replace ("; ps_sh->nl ();
+ *ps_sh << " CORBA::ULong max,"; ps_sh->nl ();
+ *ps_sh << " CORBA::ULong length,"; ps_sh->nl ();
+ *ps_sh << identifier_type << " *data,"; ps_sh->nl ();
+ *ps_sh << "CORBA::Boolean release"; ps_sh->nl ();
+ *ps_sh << ");"; ps_sh->nl ();
+ ps_sh->decr_indent ();
+ *ps_sh << "};"; ps_sh->nl ();
+ ps_sh->decr_indent ();
+ ps_sh->nl ();
+ *ps_sh << "#endif /* end #if !defined */"; ps_sh->nl ();
+ ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << "#endif /* !TAO_USE_SEQUENCE_TEMPLATES */ "; ps_sh->nl ();
+
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "#if !defined (_" << name_space.c_str () << "_" << identifier.c_str () << "_CH_)"; ps_sh->nl ();
+ *ps_sh << "#define _" << name_space.c_str () << "_" << identifier.c_str () << "_CH_"; ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "class " << identifier.c_str () << ";"; ps_sh->nl ();
+ *ps_sh << "class " << identifier.c_str () << "_var;"; ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "// *************************************************************"; ps_sh->nl ();
+ *ps_sh << "// " << identifier.c_str () ; ps_sh->nl ();
+ *ps_sh << "// *************************************************************"; ps_sh->nl ();
+
+ ps_sh->nl ();
+
+ *ps_sh << "class " << identifier.c_str () << " : public"; ps_sh->nl ();
+
+ ps_sh->nl ();
+
+ *ps_sh << "#if !defined (TAO_USE_SEQUENCE_TEMPLATES)"; ps_sh->nl ();
+ *ps_sh << "_TAO_Unbounded_Sequence_" << name_space.c_str () << "_" << identifier.c_str () ; ps_sh->nl ();
+ *ps_sh << "#else /* TAO_USE_SEQUENCE_TEMPLATES */"; ps_sh->nl ();
+ *ps_sh << "TAO_Unbounded_Sequence<" << identifier.c_str () << "Component>"; ps_sh->nl ();
+ *ps_sh << "#endif /* !TAO_USE_SEQUENCE_TEMPLATES */ "; ps_sh->nl ();
+ *ps_sh << "{"; ps_sh->nl ();
+ ps_sh->incr_indent ();
+ *ps_sh << "public:"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << " (void); // default ctor"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << " (CORBA::ULong max); // uses max size"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << " ("; ps_sh->nl ();
+ *ps_sh << "CORBA::ULong max, "; ps_sh->nl ();
+ *ps_sh << "CORBA::ULong length, "; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << "Component *buffer, "; ps_sh->nl ();
+ *ps_sh << "CORBA::Boolean release = 0"; ps_sh->nl ();
+ *ps_sh << ");"; ps_sh->nl ();
+
+ *ps_sh << identifier.c_str () << " (const " << identifier.c_str () << " &); // copy ctor"; ps_sh->nl ();
+ *ps_sh << "~" << identifier.c_str () << " (void);"; ps_sh->nl ();
+ *ps_sh << "static void _tao_any_destructor (void*);"; ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << "typedef " << identifier.c_str () << "_var _var_type;"; ps_sh->nl ();
+ ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << "};"; ps_sh->nl ();
+ ps_sh->decr_indent ();
+ ps_sh->nl ();
+ *ps_sh << "#endif /* end #if !defined */"; ps_sh->nl ();
+ ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << "#if !defined (_" << name_space.c_str () << "_" << identifier.c_str () << "___VAR_CH_)"; ps_sh->nl ();
+ *ps_sh << "#define _" << name_space.c_str () << "_" << identifier.c_str () << "___VAR_CH_"; ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << "// *************************************************************"; ps_sh->nl ();
+ *ps_sh << "// class " << name_space.c_str () << "::" << identifier.c_str () << "_var"; ps_sh->nl ();
+ *ps_sh << "// *************************************************************"; ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << "class " << identifier.c_str () << "_var"; ps_sh->nl ();
+ *ps_sh << "{"; ps_sh->nl ();
+ ps_sh->incr_indent ();
+ *ps_sh << "public:"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << "_var (void);"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << "_var (" << identifier.c_str () << " *);"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << "_var (const " << identifier.c_str () << "_var &);"; ps_sh->nl ();
+ *ps_sh << "~" << identifier.c_str () << "_var (void);"; ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << identifier.c_str () << "_var &operator= (" << identifier.c_str () << " *);"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << "_var &operator= (const " << identifier.c_str () << "_var &);"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << " *operator-> (void);"; ps_sh->nl ();
+ *ps_sh << "const " << identifier.c_str () << " *operator-> (void) const;"; ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << "operator const " << identifier.c_str () << " &() const;"; ps_sh->nl ();
+ *ps_sh << "operator " << identifier.c_str () << " &();"; ps_sh->nl ();
+ *ps_sh << "operator " << identifier.c_str () << " &() const;"; ps_sh->nl ();
+ *ps_sh << "operator " << identifier.c_str () << " *&(); // variable-size base types only"; ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << identifier.c_str () << "Component & operator[] (CORBA::ULong index);"; ps_sh->nl ();
+ *ps_sh << "const " << identifier.c_str () << "Component & operator[] (CORBA::ULong index) const;";
+
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "// in, inout, out, _retn "; ps_sh->nl ();
+ *ps_sh << "const " << identifier.c_str () << " &in (void) const;"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << " &inout (void);"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << " *&out (void);"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << " *_retn (void);"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << " *ptr (void) const;";
+
+ ps_sh->decr_indent (0);
+
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "private:";
+
+ ps_sh->incr_indent (0);
+ ps_sh->nl ();
+
+ *ps_sh << identifier.c_str () << " *ptr_;"; ps_sh->nl ();
+ *ps_sh << "};";
+
+ ps_sh->nl ();
+ ps_sh->nl ();
+ ps_sh->nl ();
+
+ *ps_sh << "#endif /* end #if !defined */"; ps_sh->nl ();
+ ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << "#if !defined (_" << name_space.c_str () << "_" << identifier.c_str () << "___OUT_CH_)"; ps_sh->nl ();
+ *ps_sh << "#define _" << name_space.c_str () << "_" << identifier.c_str () << "___OUT_CH_"; ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << "class " << identifier.c_str () << "_out"; ps_sh->nl ();
+ *ps_sh << "{"; ps_sh->nl ();
+ ps_sh->incr_indent ();
+ *ps_sh << "public:"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << "_out (" << identifier.c_str () << " *&);"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << "_out (" << identifier.c_str () << "_var &);"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << "_out (const " << identifier.c_str () << "_out &);"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << "_out &operator= (const " << identifier.c_str () << "_out &);"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << "_out &operator= (" << identifier.c_str () << " *);"; ps_sh->nl ();
+ *ps_sh << "operator " << identifier.c_str () << " *&();"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << " *&ptr (void);"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << " *operator-> (void);"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << "Component & operator[] (CORBA::ULong index);"; ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << "private:"; ps_sh->nl ();
+ *ps_sh << identifier.c_str () << " *&ptr_;"; ps_sh->nl ();
+ *ps_sh << "// Assignment from T_var not allowed."; ps_sh->nl ();
+ *ps_sh << "void operator= (const " << identifier.c_str () << "_var &);"; ps_sh->nl ();
+ *ps_sh << "};"; ps_sh->nl ();
+ ps_sh->decr_indent ();
+ ps_sh->nl ();
+ ps_sh->nl ();
+ *ps_sh << "#endif /* end #if !defined */"; ps_sh->nl ();
+
+ *ps_sh << "TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr "
+ << "_tc_" << identifier.c_str () << ";"; ps_sh->nl ();
+}
+
+void
+TAO_PSDL_Type_Dcl_Visitor::print_for_simple_typedefs (void)
+{
+ ACE_CString type;
+
+ // Get the base type of the identifier name
+ this->base_type (this->identifiers_ [0], type);
+
+ // Get a pointer to PSDL_Stream of the stub header.
+ TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh ();
+
+ if (ACE_OS::strcmp (type.c_str (), "char *") == 0)
+ {
+ ps_sh->reset ();
+ ps_sh->nl ();
+
+ *ps_sh << "typedef " << type.c_str () << " "
+ << this->identifiers_ [1].c_str () << ";";
+ }
+
+ ps_sh->nl ();
+ *ps_sh << "typedef " << this->version_for_stub (type).c_str () << " "
+ << this->identifiers_[1].c_str ();
+
+ if (ACE_OS::strcmp (type.c_str (), "char *") == 0)
+ *ps_sh << "_var;";
+ else
+ *ps_sh << ";";
+
+ ps_sh->nl ();
+ *ps_sh << "typedef " << this->version_for_stub (type).c_str () << "_out"
+ << " " << this->identifiers_[1].c_str () << "_out;"; ps_sh->nl ();
+ *ps_sh << "TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr"
+ << " _tc_" << this->identifiers_[1].c_str () << ";"; ps_sh->nl ();
+ ps_sh->nl ();
+
+ // Generates code for the stub implementation files.
+ this->gen_code_for_si ();
+}
+
+void
+TAO_PSDL_Type_Dcl_Visitor::gen_code_for_si (void)
+{
+ TAO_PSDL_Stream *ps_si = TAO_PSDL_Scope::instance ()->get_si ();
+
+ ps_si->reset ();
+ ps_si->indent (); // start from current indentation level
+
+ // Generate the typecode information here
+ *ps_si << "static const CORBA::Long _oc_";
+
+ // Flat name generation.
+ *ps_si << this->identifiers_[1];
+ *ps_si << "[] =";
+ ps_si->nl ();
+ *ps_si << "{";
+ ps_si->nl ();
+
+ // Some invocation call to put in the stuff that goes between
+ // braces.
+ *ps_si << "// Typecode related information should go in here";
+ ps_si->nl ();
+
+ *ps_si << "};";
+ ps_si->nl ();
+ ps_si->nl ();
+
+ *ps_si << "static CORBA::TypeCode _tc_TAO_tc_";
+ *ps_si << this->identifiers_[1];
+ *ps_si << " (";
+ ps_si->nl ();
+ ps_si->incr_indent ();
+ *ps_si << "CORBA::tk_alias,";
+ ps_si->nl ();
+ *ps_si << "sizeof (_oc_" << this->identifiers_[1] << "),";
+ ps_si->nl ();
+ *ps_si << "(char *) &_oc_";
+ *ps_si << this->identifiers_[1] << ",";
+ ps_si->nl ();
+ *ps_si << "0,";
+ ps_si->nl ();
+ *ps_si << "sizeof (" << this->identifiers_[1] << ")";
+ ps_si->nl ();
+ *ps_si << ");";
+ ps_si->decr_indent ();
+
+ ps_si->nl ();
+ ps_si->nl ();
+ *ps_si << "::CORBA::TypeCode_ptr _tc_" << this->identifiers_[1] << " =";
+ ps_si->nl ();
+ ps_si->incr_indent ();
+
+ *ps_si << "&_tc_TAO_tc_" << this->identifiers_[1] << ";";
+ ps_si->decr_indent ();
+ ps_si->nl ();
+ ps_si->nl ();
+
+
+ return;
+}
+
+int
+TAO_PSDL_Type_Dcl_Visitor::visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type)
+{
+ if (predefined_type->type_one () != 0)
+ {
+ this->identifiers_ [this->count_] =
+ TAO_PSDL_Scope::instance ()->convert_str (predefined_type->type_one ());
+ if (this->count_ == 0)
+ {
+ // @@ implies this is the type.
+ this->predefined_type_ [this->count_] = 1;
+ }
+ ++this->count_;
+ }
+
+ if (predefined_type->type_two () != 0)
+ {}
+
+ if (predefined_type->type_three () != 0)
+ {}
+
+ if (predefined_type->type_of_variable_one () != 0)
+ {
+ if (predefined_type->type_of_variable_one ()->accept (this) == -1)
+ return -1;
+ }
+ if (predefined_type->type_of_variable_two () != 0)
+ {}
+ if (predefined_type->type_of_variable_three () != 0)
+ {}
+ return 0;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Type_Dcl_Visitor.h b/TAO/orbsvcs/PSS/PSDL_Type_Dcl_Visitor.h
new file mode 100644
index 00000000000..cd8d558a4a2
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Type_Dcl_Visitor.h
@@ -0,0 +1,58 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Type_Dcl_Visitor.h
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_TYPE_DCL_VISITOR_H
+#define TAO_PSDL_TYPE_DCL_VISITOR_H
+
+#include /**/ "ace/pre.h"
+#include "PSDL_Node_Visitor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+class TAO_PSDL_Type_Dcl_Visitor : public TAO_PSDL_Node_Visitor
+{
+ public:
+
+ TAO_PSDL_Type_Dcl_Visitor ();
+
+ ~TAO_PSDL_Type_Dcl_Visitor ();
+
+ // All type_dcl's except typedef (Refer to PSDL.yy for type_dcl's
+ int visit_identifier (TAO_PSDL_Identifier *identifier);
+
+ // For typedef s
+ int visit_type_declarator (TAO_PSDL_Type_Declarator *node);
+
+ int visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type);
+
+private:
+
+ void print_for_simple_typedefs (void);
+
+ void print_for_sequence_typedefs (ACE_CString identifier_type,
+ ACE_CString identifier);
+
+ // Generate the code that should go into the stub implementation
+ // file for the type_declarators.
+ void gen_code_for_si (void);
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_TYPE_DCL_VISITOR_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Typecode_Defn.cpp b/TAO/orbsvcs/PSS/PSDL_Typecode_Defn.cpp
new file mode 100644
index 00000000000..cb458ae9528
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Typecode_Defn.cpp
@@ -0,0 +1,33 @@
+// $Id$
+
+#include "PSDL_Typecode_Defn.h"
+#include "PSDL_Stream.h"
+
+ACE_RCSID(be_visitor_typecode, typecode_defn, "$Id$")
+
+
+TAO_PSDL_Typecode_Defn::TAO_PSDL_Typecode_Defn ()
+{
+ // Constructor
+}
+
+TAO_PSDL_Typecode_Defn::~TAO_PSDL_Typecode_Defn ()
+{
+ // Destructor
+}
+
+int
+TAO_PSDL_Typecode_Defn::visit_type_declarator (TAO_PSDL_Type_Declarator *type_declarator)
+{
+ ACE_UNUSED_ARG (type_declarator);
+ // Get a pointer to PSDL_Stream of the stub implementation file
+ TAO_PSDL_Stream *ps_si = TAO_PSDL_Scope::instance ()->get_si ();
+
+ ps_si->indent (); // start from current indentation level
+
+ // Generate the typecode information here
+ *ps_si << "static const CORBA::Long _oc_";
+
+ // Flat name generation.
+ return 0;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Typecode_Defn.h b/TAO/orbsvcs/PSS/PSDL_Typecode_Defn.h
new file mode 100644
index 00000000000..1a37d86f38f
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Typecode_Defn.h
@@ -0,0 +1,43 @@
+/* -*- c++ -*- */
+// $Id$
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs/PSS
+//
+// = FILENAME
+// PSDL_Typecode_Defn.h
+//
+// = DESCRIPTION
+// Helper for the generation of the typecodes.
+// This one generates the definitions.
+//
+// = AUTHOR
+// Priyanka Gontla <pgontla@doc.ece.uci.edu>
+//
+// ============================================================================
+
+#ifndef PSDL_TYPECODE_DEFN_H
+#define PSDL_TYPECODE_DEFN_H
+
+#include /**/ "ace/pre.h"
+#include "PSDL_Node_Visitor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+class TAO_PSDL_Typecode_Defn : public TAO_PSDL_Node_Visitor
+{
+ public:
+
+ TAO_PSDL_Typecode_Defn ();
+
+ ~TAO_PSDL_Typecode_Defn ();
+
+ int visit_type_declarator (TAO_PSDL_Type_Declarator *);
+};
+
+#include /**/ "ace/post.h"
+#endif /* PSDL_TYPECODE_DEFN_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_Visitor_Factory.cpp b/TAO/orbsvcs/PSS/PSDL_Visitor_Factory.cpp
new file mode 100644
index 00000000000..d33e61862db
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Visitor_Factory.cpp
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+// $Id$
+
+#include "PSDL_Visitor_Factory.h"
+#include "PSDL_Module_Visitor.h"
+#include "PSDL_Type_Dcl_Visitor.h"
+#include "PSDL_Interface_Visitor.h"
+#include "PSDL_Struct_Visitor.h"
+#include "PSDL_Enum_Type_Visitor.h"
+#include "PSDL_Exception_Visitor.h"
+
+ACE_RCSID (PSS, PSDL_Visitor_Factory, "$Id$")
+
+TAO_PSDL_Visitor_Factory::TAO_PSDL_Visitor_Factory (void)
+{
+}
+
+TAO_PSDL_Visitor_Factory::~TAO_PSDL_Visitor_Factory (void)
+{
+}
+
+TAO_PSDL_Node_Visitor *
+TAO_PSDL_Visitor_Factory::make_visitor (int type)
+{
+ switch (type)
+ {
+ case 258:
+ {
+ TAO_PSDL_Module_Visitor *module_visitor = 0;
+ ACE_NEW_RETURN (module_visitor,
+ TAO_PSDL_Module_Visitor,
+ 0);
+ return module_visitor;
+ }
+ case 291:
+ {
+ TAO_PSDL_Struct_Visitor *struct_visitor = 0;
+ ACE_NEW_RETURN (struct_visitor,
+ TAO_PSDL_Struct_Visitor,
+ 0);
+ return struct_visitor;
+ }
+ case 300:
+ {
+ TAO_PSDL_Type_Dcl_Visitor *type_dcl_visitor = 0;
+ ACE_NEW_RETURN (type_dcl_visitor,
+ TAO_PSDL_Type_Dcl_Visitor,
+ 0);
+ return type_dcl_visitor;
+ }
+ case 324:
+ {
+ TAO_PSDL_Exception_Visitor *exception_visitor = 0;
+ ACE_NEW_RETURN (exception_visitor,
+ TAO_PSDL_Exception_Visitor,
+ 0);
+ return exception_visitor;
+ }
+ case 325:
+ {
+ TAO_PSDL_Interface_Visitor *interface_visitor = 0;
+ ACE_NEW_RETURN (interface_visitor,
+ TAO_PSDL_Interface_Visitor,
+ 0);
+ return interface_visitor;
+ }
+ case 337:
+ {
+ TAO_PSDL_Enum_Type_Visitor *enum_type_visitor = 0;
+ ACE_NEW_RETURN (enum_type_visitor,
+ TAO_PSDL_Enum_Type_Visitor,
+ 0);
+ return enum_type_visitor;
+ }
+ default:
+ return 0;
+ }
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_Visitor_Factory.h b/TAO/orbsvcs/PSS/PSDL_Visitor_Factory.h
new file mode 100644
index 00000000000..0a9db809003
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_Visitor_Factory.h
@@ -0,0 +1,41 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// PSS
+//
+// = FILENAME
+// PSDL_Visitor_Factory.h
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_PSDL_VISITOR_FACTORY_H
+#define TAO_PSDL_VISITOR_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "PSDL_Node_Visitor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_PSDL_Export TAO_PSDL_Visitor_Factory
+{
+ public:
+
+ TAO_PSDL_Visitor_Factory ();
+
+ ~TAO_PSDL_Visitor_Factory ();
+
+ TAO_PSDL_Node_Visitor *make_visitor (int type);
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PSDL_VISITOR_FACTORY_H */
diff --git a/TAO/orbsvcs/PSS/PSDL_l.cpp b/TAO/orbsvcs/PSS/PSDL_l.cpp
new file mode 100644
index 00000000000..965c5e6a57c
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_l.cpp
@@ -0,0 +1,2317 @@
+#define yy_create_buffer TAO_PSDL_yy_create_buffer
+#define yy_delete_buffer TAO_PSDL_yy_delete_buffer
+#define yy_scan_buffer TAO_PSDL_yy_scan_buffer
+#define yy_scan_string TAO_PSDL_yy_scan_string
+#define yy_scan_bytes TAO_PSDL_yy_scan_bytes
+#define yy_flex_debug TAO_PSDL_yy_flex_debug
+#define yy_init_buffer TAO_PSDL_yy_init_buffer
+#define yy_flush_buffer TAO_PSDL_yy_flush_buffer
+#define yy_load_buffer_state TAO_PSDL_yy_load_buffer_state
+#define yy_switch_to_buffer TAO_PSDL_yy_switch_to_buffer
+#define yyin TAO_PSDL_yyin
+#define yyleng TAO_PSDL_yyleng
+#define yylex TAO_PSDL_yylex
+#define yyout TAO_PSDL_yyout
+#define yyrestart TAO_PSDL_yyrestart
+#define yytext TAO_PSDL_yytext
+
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * $Id$
+ */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+#include "ace/OS.h"
+
+#include <stdio.h>
+#include <errno.h>
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include <stdlib.h>
+#ifndef _Win32
+#include "ace/Synch.h"
+#else
+#ifndef YY_ALWAYS_INTERACTIVE
+#ifndef YY_NEVER_INTERACTIVE
+extern int isatty YY_PROTO(( int ));
+#endif
+#endif
+#endif
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define 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 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 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 YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+extern FILE *yyin, *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 )
+ * 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 yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ *yy_cp = yy_hold_char; \
+ YY_RESTORE_YY_MORE_OFFSET \
+ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, 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 yy_size_t;
+
+
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int 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 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 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 yy_at_bol;
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as 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 yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+ };
+
+static YY_BUFFER_STATE 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 YY_CURRENT_BUFFER yy_current_buffer
+
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin. A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_is_interactive = is_interactive; \
+ }
+
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_at_bol = at_bol; \
+ }
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+
+// #define yywrap() 1
+// #define YY_SKIP_YYWRAP
+typedef unsigned char YY_CHAR;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+typedef int yy_state_type;
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+ yytext_ptr = yy_bp; \
+ yyleng = (int) (yy_cp - yy_bp); \
+ yy_hold_char = *yy_cp; \
+ *yy_cp = '\0'; \
+ yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 94
+#define YY_END_OF_BUFFER 95
+static yyconst short int yy_accept[364] =
+ { 0,
+ 0, 0, 95, 93, 91, 92, 18, 13, 93, 5,
+ 6, 14, 10, 9, 11, 93, 17, 87, 2, 1,
+ 7, 20, 8, 89, 89, 89, 89, 89, 23, 93,
+ 24, 12, 89, 89, 89, 89, 89, 89, 89, 89,
+ 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
+ 89, 3, 21, 4, 19, 0, 90, 0, 88, 0,
+ 87, 22, 16, 15, 89, 89, 89, 89, 89, 89,
+ 89, 89, 26, 89, 89, 89, 89, 89, 89, 89,
+ 89, 89, 89, 89, 89, 89, 89, 25, 89, 89,
+ 89, 89, 89, 27, 89, 89, 89, 89, 89, 89,
+
+ 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
+ 89, 89, 89, 0, 0, 89, 89, 89, 89, 89,
+ 89, 30, 89, 89, 89, 89, 89, 89, 89, 89,
+ 89, 89, 89, 89, 89, 89, 89, 89, 89, 28,
+ 89, 89, 89, 89, 89, 89, 31, 89, 89, 89,
+ 89, 89, 29, 89, 89, 89, 89, 89, 89, 89,
+ 89, 89, 89, 89, 89, 89, 89, 89, 89, 0,
+ 88, 89, 89, 85, 89, 89, 89, 89, 32, 89,
+ 36, 89, 89, 89, 89, 89, 80, 89, 89, 89,
+ 89, 89, 89, 89, 89, 57, 89, 89, 89, 89,
+
+ 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
+ 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
+ 89, 65, 89, 89, 86, 89, 89, 89, 89, 89,
+ 89, 64, 89, 89, 89, 89, 89, 89, 68, 55,
+ 89, 33, 89, 72, 89, 89, 51, 89, 89, 89,
+ 89, 89, 89, 89, 38, 89, 58, 40, 89, 89,
+ 89, 89, 89, 89, 89, 89, 89, 47, 89, 89,
+ 49, 89, 52, 89, 89, 89, 89, 89, 89, 74,
+ 89, 56, 89, 89, 89, 89, 62, 61, 63, 89,
+ 89, 89, 83, 66, 89, 89, 89, 39, 77, 44,
+
+ 53, 89, 48, 89, 89, 89, 89, 89, 89, 89,
+ 89, 50, 34, 67, 54, 89, 84, 89, 89, 45,
+ 82, 89, 89, 89, 89, 89, 89, 60, 89, 89,
+ 78, 89, 41, 89, 89, 89, 89, 35, 46, 81,
+ 89, 89, 76, 89, 59, 89, 69, 79, 70, 89,
+ 71, 89, 89, 89, 73, 37, 89, 89, 89, 43,
+ 42, 75, 0
+ } ;
+
+static yyconst int yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 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, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 16, 17, 18,
+ 19, 20, 1, 1, 21, 22, 23, 23, 24, 25,
+ 23, 23, 23, 23, 23, 26, 23, 23, 27, 23,
+ 23, 28, 29, 30, 31, 32, 23, 23, 23, 23,
+ 33, 34, 35, 36, 37, 1, 38, 39, 40, 41,
+
+ 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 23, 63, 64, 65, 66, 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 yyconst int yy_meta[67] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 2, 1, 1, 1, 1, 1,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 1, 1, 1, 1, 2, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 1, 1, 1, 1
+ } ;
+
+static yyconst short int yy_base[368] =
+ { 0,
+ 0, 0, 391, 392, 392, 392, 392, 392, 61, 392,
+ 392, 392, 392, 392, 392, 375, 392, 55, 373, 392,
+ 370, 392, 367, 0, 365, 346, 356, 345, 392, 0,
+ 392, 392, 30, 330, 33, 30, 22, 50, 24, 339,
+ 328, 327, 340, 49, 21, 42, 61, 35, 326, 56,
+ 37, 392, 392, 392, 392, 92, 392, 96, 89, 361,
+ 96, 392, 392, 392, 0, 349, 327, 342, 323, 0,
+ 315, 308, 0, 312, 316, 58, 329, 315, 309, 321,
+ 305, 304, 321, 320, 298, 306, 304, 53, 294, 72,
+ 314, 297, 296, 0, 310, 294, 70, 311, 303, 82,
+
+ 296, 293, 294, 86, 292, 298, 285, 289, 71, 292,
+ 294, 294, 281, 122, 122, 308, 294, 311, 276, 0,
+ 276, 0, 277, 282, 288, 291, 273, 79, 270, 288,
+ 286, 274, 281, 265, 279, 282, 270, 260, 275, 0,
+ 278, 271, 256, 267, 270, 251, 0, 83, 251, 260,
+ 252, 266, 0, 253, 247, 249, 246, 247, 93, 248,
+ 243, 248, 256, 245, 250, 237, 253, 255, 237, 276,
+ 275, 265, 248, 0, 245, 231, 239, 242, 0, 234,
+ 0, 225, 239, 228, 221, 229, 0, 224, 224, 234,
+ 217, 231, 215, 216, 221, 0, 220, 209, 210, 228,
+
+ 227, 226, 217, 216, 219, 208, 217, 216, 200, 214,
+ 102, 204, 203, 213, 200, 211, 210, 208, 197, 203,
+ 204, 0, 190, 198, 0, 186, 220, 203, 201, 201,
+ 186, 0, 176, 186, 186, 192, 176, 177, 0, 0,
+ 181, 0, 187, 0, 187, 186, 0, 165, 171, 168,
+ 183, 183, 166, 170, 0, 169, 0, 0, 175, 162,
+ 173, 172, 158, 159, 168, 174, 169, 0, 159, 152,
+ 0, 157, 0, 169, 166, 147, 153, 159, 145, 0,
+ 144, 0, 154, 137, 156, 159, 0, 0, 0, 134,
+ 153, 152, 0, 0, 144, 152, 149, 0, 0, 0,
+
+ 0, 133, 0, 132, 145, 145, 124, 141, 128, 126,
+ 125, 0, 0, 0, 0, 129, 0, 129, 139, 0,
+ 0, 122, 115, 134, 98, 119, 136, 0, 132, 119,
+ 0, 129, 0, 128, 118, 111, 125, 0, 0, 0,
+ 114, 103, 0, 125, 0, 112, 0, 0, 0, 97,
+ 0, 102, 97, 100, 0, 0, 106, 105, 104, 0,
+ 0, 0, 392, 156, 158, 126, 160
+ } ;
+
+static yyconst short int yy_def[368] =
+ { 0,
+ 363, 1, 363, 363, 363, 363, 363, 363, 364, 363,
+ 363, 363, 363, 363, 363, 363, 363, 363, 363, 363,
+ 363, 363, 363, 365, 365, 365, 365, 365, 363, 366,
+ 363, 363, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 363, 363, 363, 363, 364, 363, 363, 363, 363,
+ 363, 363, 363, 363, 365, 365, 365, 365, 365, 367,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 364, 363, 365, 365, 365, 365, 367,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 363,
+ 363, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 0, 363, 363, 363, 363
+ } ;
+
+static yyconst short int yy_nxt[459] =
+ { 0,
+ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
+ 24, 24, 24, 24, 25, 24, 26, 24, 24, 27,
+ 24, 28, 29, 30, 31, 32, 4, 33, 34, 35,
+ 36, 37, 38, 24, 24, 39, 24, 40, 41, 42,
+ 43, 44, 45, 24, 46, 47, 48, 49, 50, 51,
+ 24, 24, 52, 53, 54, 55, 57, 60, 71, 61,
+ 76, 80, 82, 87, 88, 97, 112, 77, 98, 99,
+ 72, 81, 83, 100, 78, 73, 74, 84, 93, 107,
+ 79, 94, 113, 110, 58, 85, 108, 57, 86, 95,
+
+ 101, 114, 102, 59, 138, 103, 96, 111, 60, 139,
+ 61, 141, 115, 125, 126, 148, 164, 104, 105, 152,
+ 106, 149, 142, 157, 153, 58, 165, 57, 70, 114,
+ 115, 170, 201, 170, 182, 183, 171, 158, 212, 259,
+ 159, 202, 341, 260, 213, 362, 361, 360, 359, 358,
+ 214, 357, 356, 355, 342, 58, 56, 56, 56, 65,
+ 65, 120, 120, 354, 353, 352, 351, 350, 349, 348,
+ 347, 346, 345, 344, 343, 340, 339, 338, 337, 336,
+ 335, 334, 333, 332, 331, 330, 329, 328, 327, 326,
+ 325, 324, 323, 322, 321, 320, 319, 318, 317, 316,
+
+ 315, 314, 313, 312, 311, 310, 309, 308, 307, 306,
+ 305, 304, 303, 302, 301, 300, 299, 298, 297, 296,
+ 295, 294, 293, 292, 291, 290, 289, 288, 287, 286,
+ 285, 284, 283, 282, 281, 280, 279, 278, 277, 276,
+ 275, 274, 273, 272, 271, 270, 269, 268, 267, 266,
+ 265, 264, 263, 262, 261, 258, 257, 256, 255, 254,
+ 253, 252, 251, 250, 249, 248, 247, 246, 245, 244,
+ 243, 242, 241, 240, 239, 238, 237, 236, 235, 234,
+ 233, 232, 231, 230, 229, 228, 227, 226, 225, 171,
+ 171, 224, 223, 222, 221, 220, 219, 218, 217, 216,
+
+ 215, 211, 210, 209, 208, 207, 206, 205, 204, 203,
+ 200, 199, 198, 197, 196, 195, 194, 193, 192, 191,
+ 190, 189, 188, 187, 186, 185, 184, 181, 180, 179,
+ 178, 177, 176, 175, 174, 173, 172, 169, 168, 167,
+ 166, 163, 162, 161, 160, 156, 155, 154, 151, 150,
+ 147, 146, 145, 144, 143, 140, 137, 136, 135, 134,
+ 133, 132, 131, 130, 129, 128, 127, 124, 123, 122,
+ 121, 119, 118, 117, 116, 59, 109, 92, 91, 90,
+ 89, 75, 69, 68, 67, 66, 64, 63, 62, 59,
+ 363, 3, 363, 363, 363, 363, 363, 363, 363, 363,
+
+ 363, 363, 363, 363, 363, 363, 363, 363, 363, 363,
+ 363, 363, 363, 363, 363, 363, 363, 363, 363, 363,
+ 363, 363, 363, 363, 363, 363, 363, 363, 363, 363,
+ 363, 363, 363, 363, 363, 363, 363, 363, 363, 363,
+ 363, 363, 363, 363, 363, 363, 363, 363, 363, 363,
+ 363, 363, 363, 363, 363, 363, 363, 363
+ } ;
+
+static yyconst short int yy_chk[459] =
+ { 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,
+ 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, 9, 18, 33, 18,
+ 35, 36, 37, 39, 39, 45, 51, 35, 45, 46,
+ 33, 36, 37, 46, 35, 33, 33, 38, 44, 48,
+ 35, 44, 51, 50, 9, 38, 48, 56, 38, 44,
+
+ 47, 58, 47, 59, 88, 47, 44, 50, 61, 88,
+ 61, 90, 59, 76, 76, 97, 109, 47, 47, 100,
+ 47, 97, 90, 104, 100, 56, 109, 114, 366, 58,
+ 59, 115, 148, 115, 128, 128, 115, 104, 159, 211,
+ 104, 148, 325, 211, 159, 359, 358, 357, 354, 353,
+ 159, 352, 350, 346, 325, 114, 364, 364, 364, 365,
+ 365, 367, 367, 344, 342, 341, 337, 336, 335, 334,
+ 332, 330, 329, 327, 326, 324, 323, 322, 319, 318,
+ 316, 311, 310, 309, 308, 307, 306, 305, 304, 302,
+ 297, 296, 295, 292, 291, 290, 286, 285, 284, 283,
+
+ 281, 279, 278, 277, 276, 275, 274, 272, 270, 269,
+ 267, 266, 265, 264, 263, 262, 261, 260, 259, 256,
+ 254, 253, 252, 251, 250, 249, 248, 246, 245, 243,
+ 241, 238, 237, 236, 235, 234, 233, 231, 230, 229,
+ 228, 227, 226, 224, 223, 221, 220, 219, 218, 217,
+ 216, 215, 214, 213, 212, 210, 209, 208, 207, 206,
+ 205, 204, 203, 202, 201, 200, 199, 198, 197, 195,
+ 194, 193, 192, 191, 190, 189, 188, 186, 185, 184,
+ 183, 182, 180, 178, 177, 176, 175, 173, 172, 171,
+ 170, 169, 168, 167, 166, 165, 164, 163, 162, 161,
+
+ 160, 158, 157, 156, 155, 154, 152, 151, 150, 149,
+ 146, 145, 144, 143, 142, 141, 139, 138, 137, 136,
+ 135, 134, 133, 132, 131, 130, 129, 127, 126, 125,
+ 124, 123, 121, 119, 118, 117, 116, 113, 112, 111,
+ 110, 108, 107, 106, 105, 103, 102, 101, 99, 98,
+ 96, 95, 93, 92, 91, 89, 87, 86, 85, 84,
+ 83, 82, 81, 80, 79, 78, 77, 75, 74, 72,
+ 71, 69, 68, 67, 66, 60, 49, 43, 42, 41,
+ 40, 34, 28, 27, 26, 25, 23, 21, 19, 16,
+ 3, 363, 363, 363, 363, 363, 363, 363, 363, 363,
+
+ 363, 363, 363, 363, 363, 363, 363, 363, 363, 363,
+ 363, 363, 363, 363, 363, 363, 363, 363, 363, 363,
+ 363, 363, 363, 363, 363, 363, 363, 363, 363, 363,
+ 363, 363, 363, 363, 363, 363, 363, 363, 363, 363,
+ 363, 363, 363, 363, 363, 363, 363, 363, 363, 363,
+ 363, 363, 363, 363, 363, 363, 363, 363
+ } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *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 yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+#line 1 "PSDL.ll"
+#define INITIAL 0
+#line 4 "PSDL.ll"
+// $Id$
+// ========================================================================
+//
+// = LIBRARY
+// orbsvcs/PSS
+//
+// = FILENAME
+// PSDL.ll
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+// ========================================================================
+
+#include "ace/OS.h"
+
+#include "PSDL_Interpreter.h"
+#include "PSDL_Node.h"
+#include "PSDL_y.h"
+
+static const char * extract_string(char*);
+
+#define TAO_YY_LEX_DEBUG
+
+//#define TAO_YY_LEX_DEBUG ACE_OS::fprintf(stderr, "%s\n", yytext)
+
+#define YY_DECL int TAO_PSDL_yylex (TAO_PSDL_Node **lvalp, void* )
+
+#define YY_BREAK
+#define YY_NO_UNPUT
+
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+#ifdef YY_MALLOC_DECL
+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 YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef TAO_PSDL_ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define TAO_PSDL_ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ if ( yy_current_buffer->yy_is_interactive ) \
+ { \
+ int c = '*', n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(yyin); \
+ } \
+ }
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+ YY_USER_ACTION
+
+YY_DECL
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
+
+#line 47 "PSDL.ll"
+
+
+
+ if ( yy_init )
+ {
+ yy_init = 0;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! yy_start )
+ yy_start = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+
+ if ( ! yyout )
+ yyout = stdout;
+
+ if ( ! yy_current_buffer )
+ yy_current_buffer =
+ yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_load_buffer_state();
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = yy_c_buf_p;
+
+ /* Support of yytext. */
+ *yy_cp = yy_hold_char;
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = yy_start;
+yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 364 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ ++yy_cp;
+ }
+ while ( yy_base[yy_current_state] != 392 );
+
+yy_find_action:
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+
+do_action: /* This label is used only to access EOF actions. */
+
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = yy_hold_char;
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
+ goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+#line 49 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_SEMI; }
+ YY_BREAK
+case 2:
+YY_RULE_SETUP
+#line 50 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_COLON; }
+ YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 51 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_OPEN_CURLY_BRACE; }
+ YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 52 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_CLOSE_CURLY_BRACE; }
+ YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 53 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_OPEN_BRACE; }
+ YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 54 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_CLOSE_BRACE; }
+ YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 55 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_OPEN_ANGULAR_BRACE; }
+ YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 56 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_CLOSE_ANGULAR_BRACE; }
+ YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 57 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_COMMA; }
+ YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 58 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_PLUS; }
+ YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 59 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_MINUS; }
+ YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 60 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_XOR; }
+ YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 61 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_AND; }
+ YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 62 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_MULT; }
+ YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 63 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_RIGHT_SHIFT; }
+ YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 64 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_LEFT_SHIFT; }
+ YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 65 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_DIV; }
+ YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 66 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_PERCENT; }
+ YY_BREAK
+case 19:
+YY_RULE_SETUP
+#line 67 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_TILDA; }
+ YY_BREAK
+case 20:
+YY_RULE_SETUP
+#line 68 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_EQUAL; }
+ YY_BREAK
+case 21:
+YY_RULE_SETUP
+#line 69 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_OR; }
+ YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 70 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_DOUBLE_COLON; }
+ YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 71 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_OPEN_SQUARE_BRACE; }
+ YY_BREAK
+case 24:
+YY_RULE_SETUP
+#line 72 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_CLOSE_SQUARE_BRACE; }
+ YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 73 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_IN; }
+ YY_BREAK
+case 26:
+YY_RULE_SETUP
+#line 74 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_AS; }
+ YY_BREAK
+case 27:
+YY_RULE_SETUP
+#line 75 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_OF; }
+ YY_BREAK
+case 28:
+YY_RULE_SETUP
+#line 76 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_KEY; }
+ YY_BREAK
+case 29:
+YY_RULE_SETUP
+#line 77 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_REF; }
+ YY_BREAK
+case 30:
+YY_RULE_SETUP
+#line 78 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_ANY; }
+ YY_BREAK
+case 31:
+YY_RULE_SETUP
+#line 79 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_OUT; }
+ YY_BREAK
+case 32:
+YY_RULE_SETUP
+#line 80 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_CASE; }
+ YY_BREAK
+case 33:
+YY_RULE_SETUP
+#line 81 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_INOUT; }
+ YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 82 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_CATALOG; }
+ YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 83 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_PROVIDES; }
+ YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 84 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_CHAR; }
+ YY_BREAK
+case 37:
+YY_RULE_SETUP
+#line 85 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_IMPLEMENTS; }
+ YY_BREAK
+case 38:
+YY_RULE_SETUP
+#line 86 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_SCOPE; }
+ YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 87 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_STORES; }
+ YY_BREAK
+case 40:
+YY_RULE_SETUP
+#line 88 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_STATE; }
+ YY_BREAK
+case 41:
+YY_RULE_SETUP
+#line 89 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_ABSTRACT; }
+ YY_BREAK
+case 42:
+YY_RULE_SETUP
+#line 90 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_STORAGETYPE; }
+ YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 91 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_STORAGEHOME; }
+ YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 92 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_STRONG; }
+ YY_BREAK
+case 45:
+YY_RULE_SETUP
+#line 93 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_PRIMARY; }
+ YY_BREAK
+case 46:
+YY_RULE_SETUP
+#line 94 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_READONLY; }
+ YY_BREAK
+case 47:
+YY_RULE_SETUP
+#line 95 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_UNION; }
+ YY_BREAK
+case 48:
+YY_RULE_SETUP
+#line 96 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_SWITCH; }
+ YY_BREAK
+case 49:
+YY_RULE_SETUP
+#line 97 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_WCHAR; }
+ YY_BREAK
+case 50:
+YY_RULE_SETUP
+#line 98 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_BOOLEAN; }
+ YY_BREAK
+case 51:
+YY_RULE_SETUP
+#line 99 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_OCTET; }
+ YY_BREAK
+case 52:
+YY_RULE_SETUP
+#line 100 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_OBJECT; }
+ YY_BREAK
+case 53:
+YY_RULE_SETUP
+#line 101 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_STRUCT; }
+ YY_BREAK
+case 54:
+YY_RULE_SETUP
+#line 102 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_DEFAULT; }
+ YY_BREAK
+case 55:
+YY_RULE_SETUP
+#line 103 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_FLOAT; }
+ YY_BREAK
+case 56:
+YY_RULE_SETUP
+#line 104 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_DOUBLE; }
+ YY_BREAK
+case 57:
+YY_RULE_SETUP
+#line 105 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_LONG; }
+ YY_BREAK
+case 58:
+YY_RULE_SETUP
+#line 106 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_SHORT; }
+ YY_BREAK
+case 59:
+YY_RULE_SETUP
+#line 107 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_UNSIGNED; }
+ YY_BREAK
+case 60:
+YY_RULE_SETUP
+#line 108 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_TYPEDEF; }
+ YY_BREAK
+case 61:
+YY_RULE_SETUP
+#line 109 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_NATIVE; }
+ YY_BREAK
+case 62:
+YY_RULE_SETUP
+#line 110 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_MODULE; }
+ YY_BREAK
+case 63:
+YY_RULE_SETUP
+#line 111 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_ONEWAY; }
+ YY_BREAK
+case 64:
+YY_RULE_SETUP
+#line 112 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_CONST; }
+ YY_BREAK
+case 65:
+YY_RULE_SETUP
+#line 113 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_VOID; }
+ YY_BREAK
+case 66:
+YY_RULE_SETUP
+#line 114 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_RAISES; }
+ YY_BREAK
+case 67:
+YY_RULE_SETUP
+#line 115 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_CONTEXT; }
+ YY_BREAK
+case 68:
+YY_RULE_SETUP
+#line 116 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_FIXED; }
+ YY_BREAK
+case 69:
+YY_RULE_SETUP
+#line 117 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_VALUEBASE; }
+ YY_BREAK
+case 70:
+YY_RULE_SETUP
+#line 118 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_EXCEPTION; }
+ YY_BREAK
+case 71:
+YY_RULE_SETUP
+#line 119 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_INTERFACE; }
+ YY_BREAK
+case 72:
+YY_RULE_SETUP
+#line 120 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_LOCAL; }
+ YY_BREAK
+case 73:
+YY_RULE_SETUP
+#line 121 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_VALUETYPE; }
+ YY_BREAK
+case 74:
+YY_RULE_SETUP
+#line 122 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_CUSTOM; }
+ YY_BREAK
+case 75:
+YY_RULE_SETUP
+#line 123 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_TRUNCATABLE; }
+ YY_BREAK
+case 76:
+YY_RULE_SETUP
+#line 124 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_SUPPORTS; }
+ YY_BREAK
+case 77:
+YY_RULE_SETUP
+#line 125 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_STRING; }
+ YY_BREAK
+case 78:
+YY_RULE_SETUP
+#line 126 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_WSTRING; }
+ YY_BREAK
+case 79:
+YY_RULE_SETUP
+#line 127 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_ATTRIBUTE; }
+ YY_BREAK
+case 80:
+YY_RULE_SETUP
+#line 128 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_ENUM; }
+ YY_BREAK
+case 81:
+YY_RULE_SETUP
+#line 129 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_SEQUENCE; }
+ YY_BREAK
+case 82:
+YY_RULE_SETUP
+#line 130 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_PRIVATE; }
+ YY_BREAK
+case 83:
+YY_RULE_SETUP
+#line 131 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_PUBLIC; }
+ YY_BREAK
+case 84:
+YY_RULE_SETUP
+#line 132 "PSDL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_PSDL_FACTORY; }
+ YY_BREAK
+case 85:
+YY_RULE_SETUP
+#line 133 "PSDL.ll"
+{
+ *lvalp =
+ new TAO_PSDL_Literal ((CORBA::Boolean) 1);
+ TAO_YY_LEX_DEBUG; return TAO_PSDL_TRUE;
+ }
+ YY_BREAK
+case 86:
+YY_RULE_SETUP
+#line 138 "PSDL.ll"
+{
+ *lvalp =
+ new TAO_PSDL_Literal ((CORBA::Boolean) 0);
+ TAO_YY_LEX_DEBUG; return TAO_PSDL_FALSE;
+ }
+ YY_BREAK
+case 87:
+YY_RULE_SETUP
+#line 143 "PSDL.ll"
+{
+ *lvalp =
+ new TAO_PSDL_Literal (ACE_OS::atoi (yytext));
+ TAO_YY_LEX_DEBUG; return TAO_PSDL_INTEGER;
+ }
+ YY_BREAK
+case 88:
+YY_RULE_SETUP
+#line 148 "PSDL.ll"
+{
+ double v;
+ sscanf (yytext, "%lf", &v);
+ *lvalp =
+ new TAO_PSDL_Literal (v);
+ TAO_YY_LEX_DEBUG; return TAO_PSDL_FLOATING_PT;
+ }
+ YY_BREAK
+case 89:
+YY_RULE_SETUP
+#line 155 "PSDL.ll"
+{
+ *lvalp =
+ new TAO_PSDL_Identifier (yytext);
+ TAO_YY_LEX_DEBUG; return TAO_PSDL_IDENT;
+ }
+ YY_BREAK
+case 90:
+YY_RULE_SETUP
+#line 160 "PSDL.ll"
+{
+ *lvalp =
+ new TAO_PSDL_Literal (extract_string (yytext));
+ TAO_YY_LEX_DEBUG; return TAO_PSDL_STRING;
+ }
+ YY_BREAK
+case 91:
+YY_RULE_SETUP
+#line 165 "PSDL.ll"
+{
+ TAO_YY_LEX_DEBUG; break; // Ignore
+ }
+ YY_BREAK
+case 92:
+YY_RULE_SETUP
+#line 168 "PSDL.ll"
+{
+ TAO_YY_LEX_DEBUG; break; // Ignore
+ }
+ YY_BREAK
+case 93:
+YY_RULE_SETUP
+#line 171 "PSDL.ll"
+{
+ TAO_YY_LEX_DEBUG; break; // @@ TODO
+ }
+ YY_BREAK
+case 94:
+YY_RULE_SETUP
+#line 174 "PSDL.ll"
+TAO_PSDL_ECHO;
+ YY_BREAK
+case YY_STATE_EOF(INITIAL):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = yy_hold_char;
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
+ * consistency between 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.
+ */
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yy_current_buffer->yy_input_file = yyin;
+ yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since 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 ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * 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).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++yy_c_buf_p;
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = yy_c_buf_p;
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ yy_did_buffer_switch_on_eof = 0;
+
+ if ( yywrap() )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p =
+ yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ yy_c_buf_p =
+ &yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+ } /* end of yylex */
+
+
+/* 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 yy_get_next_buffer()
+ {
+ register char *dest = yy_current_buffer->yy_ch_buf;
+ register char *source = yytext_ptr;
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( yy_current_buffer->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( yy_c_buf_p - yytext_ptr - 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) (yy_c_buf_p - yytext_ptr) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+
+ else
+ {
+ int num_to_read =
+ yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+ YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = yy_current_buffer;
+
+ int yy_c_buf_p_offset =
+ (int) (yy_c_buf_p - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yy_flex_realloc( (void *) b->yy_ch_buf,
+ b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = yy_current_buffer->yy_buf_size -
+ number_to_move - 1;
+#endif
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+ yy_n_chars, num_to_read );
+
+ yy_current_buffer->yy_n_chars = yy_n_chars;
+ }
+
+ if ( yy_n_chars == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yyrestart( yyin );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ yy_current_buffer->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ yy_n_chars += number_to_move;
+ yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+ yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+ yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+ return ret_val;
+ }
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+static yy_state_type yy_get_previous_state()
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+
+ yy_current_state = yy_start;
+
+ for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 364 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
+ }
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+ {
+ register int yy_is_jam;
+ register char *yy_cp = yy_c_buf_p;
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 364 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 363);
+
+ return yy_is_jam ? 0 : yy_current_state;
+ }
+
+
+#ifndef YY_NO_UNPUT
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register char *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register char *yy_bp;
+#endif
+ {
+ register char *yy_cp = yy_c_buf_p;
+
+ /* undo effects of setting up yytext */
+ *yy_cp = yy_hold_char;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = yy_n_chars + 2;
+ register char *dest = &yy_current_buffer->yy_ch_buf[
+ yy_current_buffer->yy_buf_size + 2];
+ register char *source =
+ &yy_current_buffer->yy_ch_buf[number_to_move];
+
+ while ( source > yy_current_buffer->yy_ch_buf )
+ *--dest = *--source;
+
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ yy_current_buffer->yy_n_chars =
+ yy_n_chars = yy_current_buffer->yy_buf_size;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ *--yy_cp = (char) c;
+
+
+ yytext_ptr = yy_bp;
+ yy_hold_char = *yy_cp;
+ yy_c_buf_p = yy_cp;
+ }
+#endif /* ifndef YY_NO_UNPUT */
+
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+ {
+ int c;
+
+ *yy_c_buf_p = yy_hold_char;
+
+ if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ {
+ /* 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 ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ /* This was really a NUL. */
+ *yy_c_buf_p = '\0';
+
+ else
+ { /* need more input */
+ int offset = yy_c_buf_p - yytext_ptr;
+ ++yy_c_buf_p;
+
+ switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because 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. */
+ yyrestart( yyin );
+
+ /* fall through */
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( yywrap() )
+ return EOF;
+
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput();
+#else
+ return input();
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p = yytext_ptr + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
+ *yy_c_buf_p = '\0'; /* preserve yytext */
+ yy_hold_char = *++yy_c_buf_p;
+
+
+ return c;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+ {
+ if ( ! yy_current_buffer )
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_init_buffer( yy_current_buffer, input_file );
+ yy_load_buffer_state();
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+ {
+ if ( yy_current_buffer == new_buffer )
+ return;
+
+ if ( yy_current_buffer )
+ {
+ /* Flush out information for old buffer. */
+ *yy_c_buf_p = yy_hold_char;
+ yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+ yy_current_buffer->yy_n_chars = yy_n_chars;
+ }
+
+ yy_current_buffer = new_buffer;
+ yy_load_buffer_state();
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ yy_did_buffer_switch_on_eof = 1;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+ {
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+ yyin = yy_current_buffer->yy_input_file;
+ yy_hold_char = *yy_c_buf_p;
+ }
+
+
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+ {
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* 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->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ yy_init_buffer( b, file );
+
+ return b;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+ {
+ if ( ! b )
+ return;
+
+ if ( b == yy_current_buffer )
+ yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ yy_flex_free( (void *) b->yy_ch_buf );
+
+ yy_flex_free( (void *) b );
+ }
+
+
+#ifndef _Win32
+#include "ace/Synch.h"
+#else
+#ifndef YY_ALWAYS_INTERACTIVE
+#ifndef YY_NEVER_INTERACTIVE
+extern int isatty YY_PROTO(( int ));
+#endif
+#endif
+#endif
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+
+ {
+ yy_flush_buffer( b );
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+#if YY_ALWAYS_INTERACTIVE
+ b->yy_is_interactive = 1;
+#else
+#if YY_NEVER_INTERACTIVE
+ b->yy_is_interactive = 0;
+#else
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif
+#endif
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+ {
+ if ( ! b )
+ return;
+
+ b->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->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == yy_current_buffer )
+ yy_load_buffer_state();
+ }
+
+
+#ifndef YY_NO_SCAN_BUFFER
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+char *base;
+yy_size_t size;
+#endif
+ {
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ yy_switch_to_buffer( b );
+
+ return b;
+ }
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+#else
+YY_BUFFER_STATE yy_scan_string( yy_str )
+yyconst char *yy_str;
+#endif
+ {
+ int len;
+ for ( len = 0; yy_str[len]; ++len )
+ ;
+
+ return yy_scan_bytes( yy_str, len );
+ }
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+#else
+YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+yyconst char *bytes;
+int len;
+#endif
+ {
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = len + 2;
+ buf = (char *) yy_flex_alloc( n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+ for ( i = 0; i < len; ++i )
+ buf[i] = bytes[i];
+
+ buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = yy_scan_buffer( buf, n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+ }
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+ {
+ if ( yy_start_stack_ptr >= yy_start_stack_depth )
+ {
+ yy_size_t new_size;
+
+ yy_start_stack_depth += YY_START_STACK_INCR;
+ new_size = yy_start_stack_depth * sizeof( int );
+
+ if ( ! yy_start_stack )
+ yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+ else
+ yy_start_stack = (int *) yy_flex_realloc(
+ (void *) yy_start_stack, new_size );
+
+ if ( ! yy_start_stack )
+ YY_FATAL_ERROR(
+ "out of memory expanding start-condition stack" );
+ }
+
+ yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+ BEGIN(new_state);
+ }
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state()
+ {
+ if ( --yy_start_stack_ptr < 0 )
+ YY_FATAL_ERROR( "start-condition stack underflow" );
+
+ BEGIN(yy_start_stack[yy_start_stack_ptr]);
+ }
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state()
+ {
+ return yy_start_stack[yy_start_stack_ptr - 1];
+ }
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( yyconst char msg[] )
+#else
+static void yy_fatal_error( msg )
+char msg[];
+#endif
+ {
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+ }
+
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ yytext[yyleng] = yy_hold_char; \
+ yy_c_buf_p = yytext + n; \
+ yy_hold_char = *yy_c_buf_p; \
+ *yy_c_buf_p = '\0'; \
+ yyleng = n; \
+ } \
+ while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+yyconst char *s2;
+int n;
+#endif
+ {
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+ }
+#endif
+
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static int yy_flex_strlen( yyconst char *s )
+#else
+static int yy_flex_strlen( s )
+yyconst char *s;
+#endif
+ {
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+ }
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+ {
+ return (void *) malloc( size );
+ }
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+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 YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+ {
+ free( ptr );
+ }
+
+#if YY_MAIN
+int main()
+ {
+ yylex();
+ return 0;
+ }
+#endif
+#line 174 "PSDL.ll"
+
+
+const char*
+extract_string(char* str)
+{
+ char *t = str;
+ for (char * i = str + 1; *i != '\''; ++i, ++t)
+ {
+ if (*i == '\\')
+ {
+ ++i;
+ if (*i == 0)
+ return 0;
+ else if (*i == 't')
+ *t = '\t';
+ else if (*i == 'n')
+ *t = '\n';
+ else if (*i == '\\')
+ *t = '\\';
+ else
+ *t = *i;
+ continue;
+ }
+
+ *t = *i;
+ }
+
+ *t = '\0';
+ return str;
+}
+
+int
+yywrap ()
+{
+ return 1;
+}
diff --git a/TAO/orbsvcs/PSS/PSDL_y.cpp b/TAO/orbsvcs/PSS/PSDL_y.cpp
new file mode 100644
index 00000000000..35f7f3f1b6b
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_y.cpp
@@ -0,0 +1,3410 @@
+// $Id$
+/* A Bison parser, made from PSDL.yy
+ by GNU bison 1.35. */
+
+#define YYBISON 1 /* Identify Bison output. */
+
+#define yyparse TAO_PSDL_yyparse
+#define yylex TAO_PSDL_yylex
+#define yyerror TAO_PSDL_yyerror
+#define yylval TAO_PSDL_yylval
+#define yychar TAO_PSDL_yychar
+#define yydebug TAO_PSDL_yydebug
+#define yynerrs TAO_PSDL_yynerrs
+# define TAO_PSDL_SEMI 257
+# define TAO_PSDL_MODULE 258
+# define TAO_PSDL_COLON 259
+# define TAO_PSDL_OPEN_CURLY_BRACE 260
+# define TAO_PSDL_CLOSE_CURLY_BRACE 261
+# define TAO_PSDL_OPEN_BRACE 262
+# define TAO_PSDL_CLOSE_BRACE 263
+# define TAO_PSDL_ABSTRACT 264
+# define TAO_PSDL_STORAGETYPE 265
+# define TAO_PSDL_STORAGEHOME 266
+# define TAO_PSDL_CATALOG 267
+# define TAO_PSDL_PROVIDES 268
+# define TAO_PSDL_IMPLEMENTS 269
+# define TAO_PSDL_SCOPE 270
+# define TAO_PSDL_STORES 271
+# define TAO_PSDL_STATE 272
+# define TAO_PSDL_AS 273
+# define TAO_PSDL_PRIMARY 274
+# define TAO_PSDL_STRONG 275
+# define TAO_PSDL_REF 276
+# define TAO_PSDL_OF 277
+# define TAO_PSDL_OPEN_ANGULAR_BRACE 278
+# define TAO_PSDL_CLOSE_ANGULAR_BRACE 279
+# define TAO_PSDL_COMMA 280
+# define TAO_PSDL_KEY 281
+# define TAO_PSDL_READONLY 282
+# define TAO_PSDL_UNION 283
+# define TAO_PSDL_SWITCH 284
+# define TAO_PSDL_CASE 285
+# define TAO_PSDL_WCHAR 286
+# define TAO_PSDL_BOOLEAN 287
+# define TAO_PSDL_OCTET 288
+# define TAO_PSDL_ANY 289
+# define TAO_PSDL_OBJECT 290
+# define TAO_PSDL_STRUCT 291
+# define TAO_PSDL_DEFAULT 292
+# define TAO_PSDL_FLOAT 293
+# define TAO_PSDL_DOUBLE 294
+# define TAO_PSDL_LONG 295
+# define TAO_PSDL_SHORT 296
+# define TAO_PSDL_UNSIGNED 297
+# define TAO_PSDL_CHAR 298
+# define TAO_PSDL_IDENT 299
+# define TAO_PSDL_TYPEDEF 300
+# define TAO_PSDL_NATIVE 301
+# define TAO_PSDL_PLUS 302
+# define TAO_PSDL_MINUS 303
+# define TAO_PSDL_XOR 304
+# define TAO_PSDL_AND 305
+# define TAO_PSDL_MULT 306
+# define TAO_PSDL_RIGHT_SHIFT 307
+# define TAO_PSDL_LEFT_SHIFT 308
+# define TAO_PSDL_DIV 309
+# define TAO_PSDL_PERCENT 310
+# define TAO_PSDL_TILDA 311
+# define TAO_PSDL_ONEWAY 312
+# define TAO_PSDL_CONST 313
+# define TAO_PSDL_EQUAL 314
+# define TAO_PSDL_OR 315
+# define TAO_PSDL_VOID 316
+# define TAO_PSDL_IN 317
+# define TAO_PSDL_OUT 318
+# define TAO_PSDL_INOUT 319
+# define TAO_PSDL_RAISES 320
+# define TAO_PSDL_CONTEXT 321
+# define TAO_PSDL_FIXED 322
+# define TAO_PSDL_VALUEBASE 323
+# define TAO_PSDL_EXCEPTION 324
+# define TAO_PSDL_INTERFACE 325
+# define TAO_PSDL_LOCAL 326
+# define TAO_PSDL_DOUBLE_COLON 327
+# define TAO_PSDL_VALUETYPE 328
+# define TAO_PSDL_CUSTOM 329
+# define TAO_PSDL_TRUNCATABLE 330
+# define TAO_PSDL_SUPPORTS 331
+# define TAO_PSDL_STRING 332
+# define TAO_PSDL_WSTRING 333
+# define TAO_PSDL_ATTRIBUTE 334
+# define TAO_PSDL_OPEN_SQUARE_BRACE 335
+# define TAO_PSDL_CLOSE_SQUARE_BRACE 336
+# define TAO_PSDL_ENUM 337
+# define TAO_PSDL_SEQUENCE 338
+# define TAO_PSDL_TRUE 339
+# define TAO_PSDL_FALSE 340
+# define TAO_PSDL_INTEGER 341
+# define TAO_PSDL_FLOATING 342
+# define TAO_PSDL_PRIVATE 343
+# define TAO_PSDL_PUBLIC 344
+# define TAO_PSDL_FACTORY 345
+# define TAO_PSDL_FLOATING_PT 346
+# define TAO_PSDL_CHAR_LITERAL 347
+# define TAO_PSDL_FIXED_PT 348
+
+#line 1 "PSDL.yy"
+
+// $Id$
+// ========================================================================
+//
+// = LIBRARY
+// orbsvcs / Persistent State Definition Language parser.
+//
+// = FILENAME
+// PSDL.yy
+//
+// = AUTHOR
+// Priyanka Gontla <pgontla@doc.ece.uci.edu>
+//
+// ========================================================================
+
+#include "PSDL_y.h"
+#include "PSDL_Node.h"
+#include "PSDL_Interpreter.h"
+#include "PSDL_Scope.h"
+#include "PSDL_Module_Scope.h"
+
+#define YYPARSE_PARAM lex_state
+#define YYLEX_PARAM lex_state
+
+//extern int yylex (TAO_PSDL_Node **, void *);
+extern int yylex (void);
+
+static void yyerror (const char *error)
+{
+ printf ("Error %s\n", error);
+}
+
+#ifndef YYSTYPE
+# define YYSTYPE int
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+
+
+#define YYFINAL 593
+#define YYFLAG -32768
+#define YYNTBASE 95
+
+/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
+#define YYTRANSLATE(x) ((unsigned)(x) <= 348 ? yytranslate[x] : 262)
+
+/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
+static const char 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, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
+ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
+ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
+ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
+ 86, 87, 88, 89, 90, 91, 92, 93, 94
+};
+
+#if YYDEBUG
+static const short yyprhs[] =
+{
+ 0, 0, 2, 5, 8, 11, 14, 17, 20, 23,
+ 26, 29, 32, 35, 38, 39, 46, 48, 50, 55,
+ 59, 63, 66, 70, 73, 75, 78, 81, 84, 87,
+ 89, 93, 98, 102, 104, 106, 108, 110, 112, 118,
+ 123, 125, 127, 131, 136, 140, 147, 153, 155, 158,
+ 161, 164, 167, 170, 172, 176, 181, 185, 191, 194,
+ 201, 207, 212, 218, 221, 223, 227, 229, 232, 235,
+ 238, 242, 244, 246, 251, 255, 258, 263, 267, 271,
+ 273, 276, 279, 282, 285, 288, 290, 293, 298, 301,
+ 307, 312, 314, 316, 321, 326, 330, 337, 343, 349,
+ 354, 356, 359, 362, 365, 368, 370, 373, 377, 381,
+ 383, 386, 388, 390, 392, 395, 397, 400, 402, 404,
+ 406, 408, 410, 412, 414, 416, 418, 420, 422, 424,
+ 426, 428, 430, 432, 434, 436, 438, 440, 442, 444,
+ 448, 450, 452, 454, 456, 460, 462, 464, 466, 469,
+ 471, 473, 475, 477, 479, 481, 483, 486, 488, 490,
+ 492, 495, 498, 502, 504, 506, 508, 510, 512, 514,
+ 515, 522, 524, 527, 531, 541, 543, 545, 547, 549,
+ 551, 553, 556, 560, 564, 567, 572, 576, 579, 585,
+ 587, 589, 591, 593, 595, 597, 599, 601, 603, 605,
+ 607, 609, 613, 615, 619, 621, 625, 627, 631, 635,
+ 637, 641, 645, 647, 651, 655, 659, 662, 664, 666,
+ 668, 670, 672, 674, 678, 681, 686, 690, 692, 699,
+ 705, 711, 717, 722, 727, 731, 733, 735, 737, 741,
+ 744, 748, 754, 756, 758, 760, 765, 772, 777, 779,
+ 781, 783, 785, 792, 794, 796, 799, 802, 804, 806,
+ 811, 815, 819, 823, 826, 829, 832, 835, 837, 841,
+ 845, 848, 850, 853, 856, 859, 862, 865, 868, 871,
+ 873, 877, 881, 883, 887, 889, 891, 893, 895, 897,
+ 900, 903, 905, 908, 915, 921, 926, 930, 933, 936,
+ 942, 947, 950, 954, 957, 962, 964, 969, 971, 974,
+ 978, 983, 987, 993, 995, 999, 1006, 1011, 1013, 1015,
+ 1017, 1019, 1021, 1023, 1025, 1027, 1029, 1031, 1033, 1035,
+ 1037, 1039, 1041, 1043, 1045, 1047, 1051, 1053, 1055, 1057,
+ 1062, 1067, 1074, 1080, 1082, 1086, 1090, 1092, 1094, 1098,
+ 1102
+};
+static const short yyrhs[] =
+{
+ 96, 0, 95, 96, 0, 150, 3, 0, 188, 3,
+ 0, 201, 3, 0, 216, 3, 0, 97, 3, 0,
+ 121, 3, 0, 141, 3, 0, 111, 3, 0, 127,
+ 3, 0, 99, 3, 0, 227, 3, 0, 0, 4,
+ 149, 98, 6, 95, 7, 0, 100, 0, 101, 0,
+ 103, 6, 104, 7, 0, 103, 6, 7, 0, 10,
+ 11, 149, 0, 11, 149, 0, 10, 102, 106, 0,
+ 10, 102, 0, 105, 0, 105, 104, 0, 108, 3,
+ 0, 119, 3, 0, 5, 107, 0, 225, 0, 225,
+ 26, 107, 0, 28, 18, 109, 159, 0, 18, 109,
+ 159, 0, 154, 0, 235, 0, 236, 0, 110, 0,
+ 225, 0, 21, 22, 24, 107, 25, 0, 22, 24,
+ 107, 25, 0, 113, 0, 112, 0, 10, 12, 149,
+ 0, 114, 6, 115, 7, 0, 114, 6, 7, 0,
+ 10, 12, 149, 23, 107, 117, 0, 10, 12, 149,
+ 23, 107, 0, 116, 0, 116, 115, 0, 119, 3,
+ 0, 120, 3, 0, 260, 3, 0, 5, 118, 0,
+ 225, 0, 225, 26, 118, 0, 205, 202, 206, 209,
+ 0, 205, 202, 206, 0, 27, 149, 8, 160, 9,
+ 0, 27, 149, 0, 13, 149, 122, 6, 124, 7,
+ 0, 13, 149, 6, 124, 7, 0, 13, 149, 6,
+ 7, 0, 13, 149, 122, 6, 7, 0, 5, 123,
+ 0, 225, 0, 225, 26, 123, 0, 125, 0, 125,
+ 124, 0, 126, 3, 0, 119, 3, 0, 14, 118,
+ 159, 0, 128, 0, 129, 0, 130, 6, 131, 7,
+ 0, 130, 6, 7, 0, 11, 149, 0, 11, 149,
+ 133, 135, 0, 11, 149, 133, 0, 11, 149, 135,
+ 0, 132, 0, 132, 131, 0, 108, 3, 0, 138,
+ 3, 0, 140, 3, 0, 5, 134, 0, 225, 0,
+ 15, 107, 0, 22, 24, 134, 25, 0, 16, 146,
+ 0, 17, 159, 19, 139, 137, 0, 17, 159, 19,
+ 139, 0, 134, 0, 136, 0, 22, 8, 159, 9,
+ 0, 142, 6, 143, 7, 0, 142, 6, 7, 0,
+ 12, 149, 23, 134, 145, 147, 0, 12, 149, 23,
+ 134, 145, 0, 12, 149, 23, 134, 147, 0, 12,
+ 149, 23, 134, 0, 144, 0, 144, 143, 0, 120,
+ 3, 0, 148, 3, 0, 5, 146, 0, 225, 0,
+ 15, 118, 0, 20, 27, 149, 0, 20, 27, 22,
+ 0, 45, 0, 46, 151, 0, 178, 0, 182, 0,
+ 240, 0, 47, 159, 0, 215, 0, 152, 157, 0,
+ 153, 0, 156, 0, 154, 0, 155, 0, 225, 0,
+ 162, 0, 163, 0, 172, 0, 173, 0, 174, 0,
+ 175, 0, 176, 0, 177, 0, 214, 0, 242, 0,
+ 235, 0, 236, 0, 212, 0, 178, 0, 182, 0,
+ 240, 0, 158, 0, 158, 26, 157, 0, 159, 0,
+ 161, 0, 149, 0, 159, 0, 160, 26, 159, 0,
+ 237, 0, 39, 0, 40, 0, 41, 40, 0, 164,
+ 0, 168, 0, 165, 0, 166, 0, 167, 0, 42,
+ 0, 41, 0, 41, 41, 0, 169, 0, 170, 0,
+ 171, 0, 43, 42, 0, 43, 41, 0, 43, 41,
+ 41, 0, 44, 0, 32, 0, 33, 0, 34, 0,
+ 35, 0, 36, 0, 0, 37, 149, 179, 6, 180,
+ 7, 0, 181, 0, 181, 180, 0, 152, 157, 3,
+ 0, 29, 149, 30, 8, 183, 9, 6, 184, 7,
+ 0, 163, 0, 172, 0, 174, 0, 240, 0, 225,
+ 0, 185, 0, 185, 184, 0, 186, 187, 3, 0,
+ 31, 190, 5, 0, 38, 5, 0, 31, 190, 5,
+ 186, 0, 38, 5, 186, 0, 152, 158, 0, 59,
+ 189, 149, 60, 190, 0, 163, 0, 172, 0, 173,
+ 0, 174, 0, 162, 0, 235, 0, 236, 0, 213,
+ 0, 225, 0, 175, 0, 191, 0, 192, 0, 191,
+ 61, 192, 0, 193, 0, 192, 50, 193, 0, 194,
+ 0, 193, 51, 194, 0, 195, 0, 194, 53, 195,
+ 0, 194, 54, 195, 0, 196, 0, 195, 48, 196,
+ 0, 195, 49, 196, 0, 197, 0, 196, 52, 197,
+ 0, 196, 55, 197, 0, 196, 56, 197, 0, 198,
+ 199, 0, 199, 0, 49, 0, 48, 0, 57, 0,
+ 225, 0, 243, 0, 8, 190, 9, 0, 70, 149,
+ 0, 200, 6, 180, 7, 0, 200, 6, 7, 0,
+ 149, 0, 204, 205, 202, 206, 209, 210, 0, 205,
+ 202, 206, 209, 210, 0, 204, 205, 202, 206, 209,
+ 0, 204, 205, 202, 206, 210, 0, 205, 202, 206,
+ 209, 0, 205, 202, 206, 210, 0, 205, 202, 206,
+ 0, 58, 0, 211, 0, 62, 0, 8, 207, 9,
+ 0, 8, 9, 0, 208, 211, 159, 0, 208, 211,
+ 159, 26, 207, 0, 63, 0, 64, 0, 65, 0,
+ 66, 8, 225, 9, 0, 66, 8, 225, 26, 226,
+ 9, 0, 67, 8, 249, 9, 0, 154, 0, 235,
+ 0, 236, 0, 225, 0, 68, 24, 259, 26, 259,
+ 25, 0, 68, 0, 69, 0, 37, 149, 0, 29,
+ 149, 0, 217, 0, 218, 0, 220, 6, 221, 7,
+ 0, 220, 6, 7, 0, 10, 71, 149, 0, 72,
+ 71, 149, 0, 71, 149, 0, 71, 149, 0, 10,
+ 219, 0, 72, 219, 0, 219, 0, 10, 219, 223,
+ 0, 72, 219, 223, 0, 219, 223, 0, 222, 0,
+ 222, 221, 0, 150, 3, 0, 188, 3, 0, 201,
+ 3, 0, 239, 3, 0, 203, 3, 0, 5, 224,
+ 0, 225, 0, 225, 26, 224, 0, 149, 73, 225,
+ 0, 149, 0, 149, 26, 226, 0, 149, 0, 232,
+ 0, 231, 0, 230, 0, 229, 0, 74, 149, 0,
+ 10, 228, 0, 228, 0, 228, 152, 0, 10, 228,
+ 234, 6, 222, 7, 0, 10, 228, 6, 222, 7,
+ 0, 233, 6, 253, 7, 0, 75, 228, 234, 0,
+ 228, 234, 0, 75, 228, 0, 5, 76, 252, 77,
+ 224, 0, 5, 252, 77, 224, 0, 77, 224, 0,
+ 5, 76, 252, 0, 5, 252, 0, 78, 24, 259,
+ 25, 0, 78, 0, 79, 24, 259, 25, 0, 79,
+ 0, 149, 238, 0, 81, 259, 82, 0, 28, 80,
+ 211, 159, 0, 80, 211, 159, 0, 83, 149, 6,
+ 241, 7, 0, 149, 0, 149, 26, 241, 0, 84,
+ 24, 153, 26, 259, 25, 0, 84, 24, 153, 25,
+ 0, 245, 0, 249, 0, 250, 0, 247, 0, 248,
+ 0, 251, 0, 246, 0, 244, 0, 85, 0, 86,
+ 0, 87, 0, 92, 0, 93, 0, 32, 0, 78,
+ 0, 79, 0, 94, 0, 225, 0, 225, 26, 252,
+ 0, 222, 0, 254, 0, 255, 0, 90, 152, 157,
+ 3, 0, 89, 152, 157, 3, 0, 91, 149, 8,
+ 256, 9, 3, 0, 91, 149, 8, 9, 3, 0,
+ 257, 0, 257, 26, 256, 0, 258, 211, 159, 0,
+ 63, 0, 190, 0, 91, 149, 261, 0, 8, 159,
+ 9, 0, 8, 9, 0
+};
+
+#endif
+
+#if YYDEBUG
+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+static const short yyrline[] =
+{
+ 0, 78, 80, 85, 87, 90, 93, 96, 99, 102,
+ 105, 108, 111, 114, 119, 119, 131, 134, 139, 141,
+ 146, 150, 160, 163, 168, 171, 176, 179, 184, 189,
+ 192, 197, 199, 204, 206, 209, 212, 215, 220, 223,
+ 228, 230, 235, 240, 243, 248, 251, 256, 259, 264,
+ 267, 270, 275, 280, 283, 288, 291, 297, 299, 304,
+ 306, 309, 312, 317, 321, 323, 328, 330, 335, 337,
+ 342, 346, 348, 353, 355, 360, 364, 366, 369, 374,
+ 376, 381, 383, 386, 391, 395, 399, 403, 407, 411,
+ 413, 418, 421, 426, 430, 432, 437, 439, 442, 445,
+ 450, 452, 457, 459, 464, 468, 472, 476, 478, 483,
+ 487, 489, 492, 495, 498, 501, 506, 510, 512, 517,
+ 519, 522, 527, 529, 532, 535, 538, 541, 544, 547,
+ 550, 555, 557, 560, 563, 568, 570, 573, 578, 580,
+ 585, 587, 592, 596, 598, 603, 607, 609, 612, 617,
+ 619, 624, 626, 629, 634, 638, 642, 646, 648, 651,
+ 656, 660, 664, 668, 672, 676, 680, 684, 688, 692,
+ 692, 705, 707, 712, 716, 720, 722, 725, 728, 731,
+ 736, 738, 743, 747, 749, 752, 755, 760, 764, 768,
+ 770, 773, 776, 779, 782, 785, 788, 791, 794, 799,
+ 803, 805, 810, 812, 817, 819, 824, 826, 829, 834,
+ 836, 839, 844, 846, 849, 852, 857, 859, 864, 866,
+ 869, 874, 876, 879, 884, 893, 898, 906, 917, 920,
+ 924, 928, 932, 936, 940, 946, 950, 952, 957, 959,
+ 964, 966, 971, 973, 976, 981, 983, 988, 992, 994,
+ 997, 1000, 1005, 1009, 1013, 1017, 1019, 1024, 1026, 1031,
+ 1036, 1044, 1046, 1049, 1054, 1064, 1066, 1069, 1072, 1075,
+ 1078, 1083, 1085, 1090, 1092, 1095, 1098, 1101, 1106, 1111,
+ 1113, 1118, 1120, 1125, 1127, 1132, 1134, 1137, 1140, 1145,
+ 1149, 1151, 1156, 1160, 1162, 1167, 1171, 1173, 1176, 1181,
+ 1183, 1186, 1189, 1192, 1198, 1200, 1205, 1207, 1212, 1216,
+ 1220, 1222, 1227, 1231, 1233, 1238, 1240, 1245, 1247, 1250,
+ 1253, 1256, 1259, 1262, 1265, 1270, 1272, 1277, 1281, 1285,
+ 1289, 1293, 1297, 1301, 1305, 1307, 1312, 1314, 1317, 1322,
+ 1324, 1329, 1331, 1336, 1338, 1343, 1347, 1351, 1355, 1359,
+ 1361
+};
+#endif
+
+
+#if (YYDEBUG) || defined YYERROR_VERBOSE
+
+/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
+static const char *const yytname[] =
+{
+ "$", "error", "$undefined.", "TAO_PSDL_SEMI", "TAO_PSDL_MODULE",
+ "TAO_PSDL_COLON", "TAO_PSDL_OPEN_CURLY_BRACE",
+ "TAO_PSDL_CLOSE_CURLY_BRACE", "TAO_PSDL_OPEN_BRACE",
+ "TAO_PSDL_CLOSE_BRACE", "TAO_PSDL_ABSTRACT", "TAO_PSDL_STORAGETYPE",
+ "TAO_PSDL_STORAGEHOME", "TAO_PSDL_CATALOG", "TAO_PSDL_PROVIDES",
+ "TAO_PSDL_IMPLEMENTS", "TAO_PSDL_SCOPE", "TAO_PSDL_STORES",
+ "TAO_PSDL_STATE", "TAO_PSDL_AS", "TAO_PSDL_PRIMARY", "TAO_PSDL_STRONG",
+ "TAO_PSDL_REF", "TAO_PSDL_OF", "TAO_PSDL_OPEN_ANGULAR_BRACE",
+ "TAO_PSDL_CLOSE_ANGULAR_BRACE", "TAO_PSDL_COMMA", "TAO_PSDL_KEY",
+ "TAO_PSDL_READONLY", "TAO_PSDL_UNION", "TAO_PSDL_SWITCH",
+ "TAO_PSDL_CASE", "TAO_PSDL_WCHAR", "TAO_PSDL_BOOLEAN", "TAO_PSDL_OCTET",
+ "TAO_PSDL_ANY", "TAO_PSDL_OBJECT", "TAO_PSDL_STRUCT",
+ "TAO_PSDL_DEFAULT", "TAO_PSDL_FLOAT", "TAO_PSDL_DOUBLE",
+ "TAO_PSDL_LONG", "TAO_PSDL_SHORT", "TAO_PSDL_UNSIGNED", "TAO_PSDL_CHAR",
+ "TAO_PSDL_IDENT", "TAO_PSDL_TYPEDEF", "TAO_PSDL_NATIVE",
+ "TAO_PSDL_PLUS", "TAO_PSDL_MINUS", "TAO_PSDL_XOR", "TAO_PSDL_AND",
+ "TAO_PSDL_MULT", "TAO_PSDL_RIGHT_SHIFT", "TAO_PSDL_LEFT_SHIFT",
+ "TAO_PSDL_DIV", "TAO_PSDL_PERCENT", "TAO_PSDL_TILDA", "TAO_PSDL_ONEWAY",
+ "TAO_PSDL_CONST", "TAO_PSDL_EQUAL", "TAO_PSDL_OR", "TAO_PSDL_VOID",
+ "TAO_PSDL_IN", "TAO_PSDL_OUT", "TAO_PSDL_INOUT", "TAO_PSDL_RAISES",
+ "TAO_PSDL_CONTEXT", "TAO_PSDL_FIXED", "TAO_PSDL_VALUEBASE",
+ "TAO_PSDL_EXCEPTION", "TAO_PSDL_INTERFACE", "TAO_PSDL_LOCAL",
+ "TAO_PSDL_DOUBLE_COLON", "TAO_PSDL_VALUETYPE", "TAO_PSDL_CUSTOM",
+ "TAO_PSDL_TRUNCATABLE", "TAO_PSDL_SUPPORTS", "TAO_PSDL_STRING",
+ "TAO_PSDL_WSTRING", "TAO_PSDL_ATTRIBUTE", "TAO_PSDL_OPEN_SQUARE_BRACE",
+ "TAO_PSDL_CLOSE_SQUARE_BRACE", "TAO_PSDL_ENUM", "TAO_PSDL_SEQUENCE",
+ "TAO_PSDL_TRUE", "TAO_PSDL_FALSE", "TAO_PSDL_INTEGER",
+ "TAO_PSDL_FLOATING", "TAO_PSDL_PRIVATE", "TAO_PSDL_PUBLIC",
+ "TAO_PSDL_FACTORY", "TAO_PSDL_FLOATING_PT", "TAO_PSDL_CHAR_LITERAL",
+ "TAO_PSDL_FIXED_PT", "psdl_specification", "psdl_definition",
+ "psdl_module", "@1", "abstract_storagetype", "abstract_storagetype_dcl",
+ "abstract_storagetype_fwd_dcl", "storagetype_identifier",
+ "abstract_storagetype_header", "abstract_storagetype_body",
+ "abstract_storagetype_member", "abstract_storagetype_inh_spec",
+ "abstract_storagetype_name", "psdl_state_dcl", "psdl_state_type_spec",
+ "abstract_storagetype_ref_type", "abstract_storagehome",
+ "abstract_storagehome_fwd_dcl", "abstract_storagehome_dcl",
+ "abstract_storagehome_header", "abstract_storagehome_body",
+ "abstract_storagehome_member", "abstract_storagehome_inh_spec",
+ "abstract_storagehome_name", "local_op_dcl", "key_dcl", "catalog",
+ "catalog_inh_spec", "catalog_name", "catalog_body", "catalog_member",
+ "provides_dcl", "storagetype", "storagetype_dcl", "storagetype_fwd_dcl",
+ "storagetype_header", "storagetype_body", "storagetype_member",
+ "storagetype_inh_spec", "storagetype_name", "storagetype_impl_spec",
+ "storagetype_ref_type", "storagehome_scope", "store_directive",
+ "psdl_concrete_state_type", "ref_rep_directive", "storagehome",
+ "storagehome_header", "storagehome_body", "storagehome_member",
+ "storagehome_inh_spec", "storagehome_name", "storagehome_impl_spec",
+ "primary_key_dcl", "identifier", "type_dcl", "type_declarator",
+ "type_spec", "simple_type_spec", "base_type_spec", "template_type_spec",
+ "constr_type_spec", "declarators", "declarator", "simple_declarator",
+ "simple_declarator_list", "complex_declarator", "floating_pt_type",
+ "integer_type", "signed_int", "signed_short_int", "signed_long_int",
+ "signed_longlong_int", "unsigned_int", "unsigned_short_int",
+ "unsigned_long_int", "unsigned_longlong_int", "char_type",
+ "wide_char_type", "boolean_type", "octet_type", "any_type",
+ "object_type", "struct_type", "@2", "member_list", "member",
+ "union_type", "switch_type_spec", "switch_body", "case", "case_label",
+ "element_spec", "const_dcl", "const_type", "const_exp", "or_expr",
+ "xor_expr", "and_expr", "shift_expr", "add_expr", "mult_expr",
+ "unary_expr", "unary_operator", "primary_expr", "except_header",
+ "except_dcl", "op_name", "op_dcl", "op_attribute", "op_type_spec",
+ "parameter_dcls", "param_dcl", "param_attribute", "raises_expr",
+ "context_expr", "param_type_spec", "fixed_pt_type",
+ "fixed_pt_const_type", "value_base_type", "constr_forward_decl",
+ "interface", "interface_dcl", "forward_dcl", "interface_identifier",
+ "interface_header", "interface_body", "export",
+ "interface_inheritance_spec", "interface_name", "scoped_name",
+ "comma_scoped_name", "value", "value_common_base", "value_forward_dcl",
+ "value_box_dcl", "value_abs_dcl", "value_dcl", "value_header",
+ "value_inheritance_spec", "string_type", "wide_string_type",
+ "array_declarator", "fixed_array_size", "attr_dcl", "enum_type",
+ "enumerator", "sequence_type", "literal", "boolean_literal",
+ "integer_literal", "floating_pt_literal", "character_literal",
+ "wide_character_literal", "string_literal", "wide_string_literal",
+ "fixed_pt_literal", "value_name", "value_element", "state_member",
+ "init_dcl", "init_param_decls", "init_param_decl",
+ "init_param_attribute", "positive_int_const", "factory_dcl",
+ "factory_parameters", 0
+};
+#endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const short yyr1[] =
+{
+ 0, 95, 95, 96, 96, 96, 96, 96, 96, 96,
+ 96, 96, 96, 96, 98, 97, 99, 99, 100, 100,
+ 101, 102, 103, 103, 104, 104, 105, 105, 106, 107,
+ 107, 108, 108, 109, 109, 109, 109, 109, 110, 110,
+ 111, 111, 112, 113, 113, 114, 114, 115, 115, 116,
+ 116, 116, 117, 118, 118, 119, 119, 120, 120, 121,
+ 121, 121, 121, 122, 123, 123, 124, 124, 125, 125,
+ 126, 127, 127, 128, 128, 129, 130, 130, 130, 131,
+ 131, 132, 132, 132, 133, 134, 135, 136, 137, 138,
+ 138, 139, 139, 140, 141, 141, 142, 142, 142, 142,
+ 143, 143, 144, 144, 145, 146, 147, 148, 148, 149,
+ 150, 150, 150, 150, 150, 150, 151, 152, 152, 153,
+ 153, 153, 154, 154, 154, 154, 154, 154, 154, 154,
+ 154, 155, 155, 155, 155, 156, 156, 156, 157, 157,
+ 158, 158, 159, 160, 160, 161, 162, 162, 162, 163,
+ 163, 164, 164, 164, 165, 166, 167, 168, 168, 168,
+ 169, 170, 171, 172, 173, 174, 175, 176, 177, 179,
+ 178, 180, 180, 181, 182, 183, 183, 183, 183, 183,
+ 184, 184, 185, 186, 186, 186, 186, 187, 188, 189,
+ 189, 189, 189, 189, 189, 189, 189, 189, 189, 190,
+ 191, 191, 192, 192, 193, 193, 194, 194, 194, 195,
+ 195, 195, 196, 196, 196, 196, 197, 197, 198, 198,
+ 198, 199, 199, 199, 200, 201, 201, 202, 203, 203,
+ 203, 203, 203, 203, 203, 204, 205, 205, 206, 206,
+ 207, 207, 208, 208, 208, 209, 209, 210, 211, 211,
+ 211, 211, 212, 213, 214, 215, 215, 216, 216, 217,
+ 217, 218, 218, 218, 219, 220, 220, 220, 220, 220,
+ 220, 221, 221, 222, 222, 222, 222, 222, 223, 224,
+ 224, 225, 225, 226, 226, 227, 227, 227, 227, 228,
+ 229, 229, 230, 231, 231, 232, 233, 233, 233, 234,
+ 234, 234, 234, 234, 235, 235, 236, 236, 237, 238,
+ 239, 239, 240, 241, 241, 242, 242, 243, 243, 243,
+ 243, 243, 243, 243, 243, 244, 244, 245, 246, 247,
+ 248, 249, 250, 251, 252, 252, 253, 253, 253, 254,
+ 254, 255, 255, 256, 256, 257, 258, 259, 260, 261,
+ 261
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+static const short yyr2[] =
+{
+ 0, 1, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 0, 6, 1, 1, 4, 3,
+ 3, 2, 3, 2, 1, 2, 2, 2, 2, 1,
+ 3, 4, 3, 1, 1, 1, 1, 1, 5, 4,
+ 1, 1, 3, 4, 3, 6, 5, 1, 2, 2,
+ 2, 2, 2, 1, 3, 4, 3, 5, 2, 6,
+ 5, 4, 5, 2, 1, 3, 1, 2, 2, 2,
+ 3, 1, 1, 4, 3, 2, 4, 3, 3, 1,
+ 2, 2, 2, 2, 2, 1, 2, 4, 2, 5,
+ 4, 1, 1, 4, 4, 3, 6, 5, 5, 4,
+ 1, 2, 2, 2, 2, 1, 2, 3, 3, 1,
+ 2, 1, 1, 1, 2, 1, 2, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
+ 1, 1, 1, 1, 3, 1, 1, 1, 2, 1,
+ 1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
+ 2, 2, 3, 1, 1, 1, 1, 1, 1, 0,
+ 6, 1, 2, 3, 9, 1, 1, 1, 1, 1,
+ 1, 2, 3, 3, 2, 4, 3, 2, 5, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 3, 1, 3, 1, 3, 1, 3, 3, 1,
+ 3, 3, 1, 3, 3, 3, 2, 1, 1, 1,
+ 1, 1, 1, 3, 2, 4, 3, 1, 6, 5,
+ 5, 5, 4, 4, 3, 1, 1, 1, 3, 2,
+ 3, 5, 1, 1, 1, 4, 6, 4, 1, 1,
+ 1, 1, 6, 1, 1, 2, 2, 1, 1, 4,
+ 3, 3, 3, 2, 2, 2, 2, 1, 3, 3,
+ 2, 1, 2, 2, 2, 2, 2, 2, 2, 1,
+ 3, 3, 1, 3, 1, 1, 1, 1, 1, 2,
+ 2, 1, 2, 6, 5, 4, 3, 2, 2, 5,
+ 4, 2, 3, 2, 4, 1, 4, 1, 2, 3,
+ 4, 3, 5, 1, 3, 6, 4, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 3, 1, 1, 1, 4,
+ 4, 6, 5, 1, 3, 3, 1, 1, 3, 3,
+ 2
+};
+
+/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
+ doesn't specify something else to do. Zero means the default is an
+ error. */
+static const short yydefact[] =
+{
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 16, 17, 0, 0, 41, 40, 0, 0, 0,
+ 71, 72, 0, 0, 0, 0, 111, 112, 0, 0,
+ 0, 115, 0, 257, 258, 267, 0, 0, 291, 288,
+ 287, 286, 285, 0, 113, 109, 14, 0, 0, 0,
+ 23, 265, 290, 75, 0, 0, 256, 169, 0, 164,
+ 165, 166, 167, 168, 0, 146, 147, 155, 154, 0,
+ 163, 0, 254, 305, 307, 0, 282, 110, 0, 117,
+ 119, 120, 118, 122, 123, 149, 151, 152, 153, 150,
+ 157, 158, 159, 124, 125, 126, 127, 128, 129, 135,
+ 136, 134, 130, 121, 132, 133, 137, 131, 142, 114,
+ 253, 193, 189, 190, 191, 192, 198, 0, 196, 197,
+ 194, 195, 224, 264, 0, 266, 289, 298, 0, 2,
+ 7, 12, 0, 10, 0, 8, 11, 0, 9, 0,
+ 3, 4, 0, 5, 6, 0, 270, 0, 13, 0,
+ 0, 292, 297, 0, 0, 21, 42, 264, 0, 22,
+ 268, 0, 0, 0, 0, 77, 78, 0, 0, 0,
+ 0, 0, 0, 0, 169, 148, 156, 161, 160, 0,
+ 0, 0, 0, 0, 142, 116, 138, 140, 141, 145,
+ 0, 264, 269, 296, 0, 19, 0, 0, 237, 0,
+ 24, 0, 0, 248, 0, 236, 251, 249, 250, 44,
+ 0, 0, 0, 47, 0, 0, 0, 74, 0, 0,
+ 0, 0, 79, 0, 0, 95, 0, 0, 0, 100,
+ 0, 226, 0, 0, 171, 278, 279, 260, 0, 235,
+ 0, 0, 0, 0, 0, 0, 0, 0, 271, 0,
+ 0, 334, 303, 301, 0, 0, 0, 336, 0, 337,
+ 338, 0, 0, 28, 29, 0, 0, 84, 85, 86,
+ 76, 99, 63, 64, 61, 0, 0, 0, 66, 0,
+ 0, 0, 0, 162, 0, 330, 219, 218, 220, 331,
+ 332, 325, 326, 327, 328, 329, 333, 347, 199, 200,
+ 202, 204, 206, 209, 212, 0, 217, 221, 222, 324,
+ 317, 323, 320, 321, 318, 319, 322, 0, 0, 0,
+ 0, 281, 0, 308, 0, 0, 313, 0, 0, 0,
+ 0, 36, 33, 37, 34, 35, 0, 18, 25, 26,
+ 27, 227, 0, 58, 0, 43, 48, 49, 50, 51,
+ 0, 0, 81, 73, 80, 82, 83, 0, 102, 94,
+ 101, 103, 0, 225, 172, 0, 0, 0, 273, 274,
+ 275, 277, 0, 0, 259, 272, 276, 302, 0, 0,
+ 0, 0, 0, 295, 0, 46, 0, 294, 0, 0,
+ 0, 97, 98, 0, 0, 53, 69, 60, 67, 68,
+ 62, 0, 155, 175, 176, 177, 0, 179, 178, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 216, 0, 304, 306, 316, 0, 0, 139, 188,
+ 0, 312, 0, 0, 32, 0, 0, 56, 0, 0,
+ 348, 0, 0, 108, 107, 173, 280, 0, 311, 0,
+ 234, 0, 335, 300, 0, 0, 0, 15, 0, 45,
+ 30, 293, 104, 105, 106, 96, 65, 70, 0, 59,
+ 0, 170, 223, 201, 203, 205, 207, 208, 210, 211,
+ 213, 214, 215, 0, 0, 309, 314, 0, 0, 31,
+ 239, 242, 243, 244, 0, 0, 0, 55, 143, 0,
+ 350, 0, 0, 91, 92, 90, 93, 310, 0, 0,
+ 232, 233, 299, 340, 339, 0, 346, 0, 343, 0,
+ 52, 54, 0, 252, 315, 0, 39, 238, 0, 0,
+ 57, 0, 349, 0, 0, 89, 230, 231, 0, 229,
+ 342, 0, 0, 0, 0, 0, 0, 180, 0, 38,
+ 240, 0, 144, 0, 88, 228, 0, 341, 344, 345,
+ 0, 184, 174, 181, 0, 0, 0, 245, 0, 87,
+ 247, 183, 186, 187, 182, 241, 284, 0, 185, 0,
+ 246, 283, 0, 0
+};
+
+static const short yydefgoto[] =
+{
+ 17, 18, 19, 164, 20, 21, 22, 60, 23, 209,
+ 210, 169, 273, 211, 340, 341, 24, 25, 26, 27,
+ 222, 223, 469, 404, 286, 225, 28, 180, 282, 287,
+ 288, 289, 29, 30, 31, 32, 231, 232, 175, 277,
+ 176, 514, 545, 233, 515, 234, 33, 34, 238, 239,
+ 401, 472, 402, 240, 86, 251, 87, 242, 89, 213,
+ 91, 92, 195, 196, 197, 509, 198, 93, 94, 95,
+ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
+ 106, 107, 108, 36, 182, 243, 244, 37, 416, 556,
+ 557, 558, 575, 252, 127, 307, 308, 309, 310, 311,
+ 312, 313, 314, 315, 316, 39, 253, 352, 254, 255,
+ 214, 447, 504, 505, 507, 521, 215, 111, 128, 112,
+ 41, 42, 43, 44, 45, 46, 257, 258, 156, 245,
+ 317, 587, 47, 48, 49, 50, 51, 52, 53, 162,
+ 217, 218, 199, 333, 259, 54, 337, 117, 318, 319,
+ 320, 321, 322, 323, 324, 325, 326, 262, 268, 269,
+ 270, 527, 528, 529, 327, 226, 450
+};
+
+static const short yypact[] =
+{
+ 671, 66, 84, 66, 66, 66, 66, 66, 1142, 66,
+ 1060, 66, 66, 1, 66, 44, 66, 553,-32768, 87,
+ 129,-32768,-32768, 151, 175,-32768,-32768, 153, 209, 218,
+ -32768,-32768, 234, 246, 244, 251,-32768,-32768, 254, 252,
+ 256,-32768, 258,-32768,-32768, 176, 257, 261, 608,-32768,
+ -32768,-32768,-32768, 262,-32768,-32768,-32768, 66, 66, 66,
+ 268, 176, 43, 69, 259, 131, 245, 271, 66,-32768,
+ -32768,-32768,-32768,-32768, 66,-32768,-32768, 152,-32768, 174,
+ -32768, 255,-32768, 274, 282, 289, 243,-32768, 66,-32768,
+ -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+ -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+ -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+ -32768,-32768,-32768,-32768,-32768,-32768,-32768, 66,-32768,-32768,
+ -32768,-32768,-32768, 314, 66, 176,-32768, 35, 317,-32768,
+ -32768,-32768, 798,-32768, 442,-32768,-32768, 189,-32768, 146,
+ -32768,-32768, 724,-32768,-32768, 66,-32768, 742,-32768, 18,
+ 66,-32768,-32768, 979, 319, 323, 297, 324, 66,-32768,
+ -32768, 1090, 325, 66, 66, 315,-32768, 66, 66, 839,
+ 328, 330, 334, 245,-32768,-32768,-32768, 302,-32768, 372,
+ 372, 372, 1122, 66, 263,-32768, 320,-32768,-32768,-32768,
+ 285, 344,-32768,-32768, 66,-32768, 1042, 331,-32768, 341,
+ 1011, 347, 348,-32768, 66,-32768,-32768,-32768,-32768,-32768,
+ 66, 66, 345, 926, 350, 351, 352,-32768, 66, 349,
+ 353, 354, 208, 356, 359,-32768, 337, 362, 360, 89,
+ 367,-32768, 66, 364, 1142,-32768, 346,-32768, 293,-32768,
+ 1209, 371, 374, 376, 379, 1195, 66, 368, 1090, 380,
+ 66, 358, 308,-32768, 1142, 1142, 66,-32768, 385,-32768,
+ -32768, 671, 66,-32768, 369, 387, 1090,-32768,-32768,-32768,
+ -32768, 172,-32768, 370,-32768, 66, 383, 391, 895, 396,
+ 854, 105, 1142,-32768, 372,-32768,-32768,-32768,-32768,-32768,
+ -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 355, 357,
+ 363, 180, 190, 143,-32768, 36,-32768,-32768,-32768,-32768,
+ -32768,-32768,-32768,-32768,-32768,-32768,-32768, 384, 377, 381,
+ 217,-32768, 372,-32768, 66, 372, 398, 402, 403, 404,
+ 66,-32768,-32768,-32768,-32768,-32768, 1042,-32768,-32768,-32768,
+ -32768,-32768, 397, 418, 419,-32768,-32768,-32768,-32768,-32768,
+ 411, 66,-32768,-32768,-32768,-32768,-32768, 54,-32768,-32768,
+ -32768,-32768, 428,-32768,-32768, 66, 1209, 66,-32768,-32768,
+ -32768,-32768, 66, 397,-32768,-32768,-32768, 361, 66, 66,
+ 66, 66, 424,-32768, 651, 430, 66,-32768, 426, 66,
+ 66, 421,-32768, 66, 66, 414,-32768,-32768,-32768,-32768,
+ -32768, 434, 401,-32768,-32768,-32768, 436,-32768,-32768, 439,
+ 443, 372, 372, 372, 372, 372, 372, 372, 372, 372,
+ 372,-32768, 372,-32768,-32768,-32768, 372, 378,-32768,-32768,
+ 66,-32768, 413, 66,-32768, 66, 80, 388, 66, 53,
+ -32768, 58, 444,-32768,-32768,-32768,-32768, 66,-32768, 397,
+ 178, 66,-32768,-32768, 440, 459, 37,-32768, 66,-32768,
+ -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 66,-32768,
+ 461,-32768,-32768, 357, 363, 180, 190, 190, 143, 143,
+ -32768,-32768,-32768, 445, 446,-32768,-32768, 66, 447,-32768,
+ -32768,-32768,-32768,-32768, 470, 1209, 460,-32768,-32768, 115,
+ -32768, 479, 465,-32768,-32768, 475,-32768,-32768, 178, 484,
+ 427,-32768,-32768,-32768,-32768, 490,-32768, 486, 471, 1209,
+ -32768,-32768, 132,-32768,-32768, 473,-32768,-32768, 66, 66,
+ -32768, 66,-32768, 66, 66,-32768, 427,-32768, 422,-32768,
+ -32768, 493, 438, 66, 372, 494, 496, 132, 1142,-32768,
+ 481, 156,-32768, 483,-32768,-32768, 501,-32768,-32768,-32768,
+ 507, 132,-32768,-32768, 66, 510, 137,-32768, 66,-32768,
+ -32768, 132,-32768,-32768,-32768,-32768, 489, 509,-32768, 66,
+ -32768,-32768, 516,-32768
+};
+
+static const short yypgoto[] =
+{
+ 248, -16,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 312,
+ -32768,-32768, -165, -126, 177,-32768,-32768,-32768,-32768,-32768,
+ 301,-32768,-32768, -377, -83, -131,-32768,-32768, 122, -202,
+ -32768,-32768,-32768,-32768,-32768,-32768, 294,-32768,-32768, -150,
+ 373,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 288,-32768,
+ -32768, -15, 127,-32768, -1, 19,-32768, 29, 338, 77,
+ -32768,-32768, -230, -43, 57,-32768,-32768, 522, 4,-32768,
+ -32768,-32768,-32768,-32768,-32768,-32768,-32768, 21, 524, 31,
+ 525,-32768,-32768, 27,-32768, -190,-32768, 71,-32768, -21,
+ -32768, -387,-32768, 25,-32768, -243,-32768, 117, 120, 116,
+ -177, -174, -220,-32768, 228,-32768, 28, -240,-32768,-32768,
+ -124, -354, -32,-32768, -408, -449, -200,-32768,-32768,-32768,
+ -32768,-32768,-32768,-32768, 149,-32768, 287, -137, -18, -143,
+ 12, -42,-32768, 63,-32768,-32768,-32768,-32768,-32768, -24,
+ 22, 45,-32768,-32768,-32768, 16, 106,-32768,-32768,-32768,
+ -32768,-32768,-32768,-32768, 2,-32768,-32768, -253,-32768,-32768,
+ -32768, -3,-32768,-32768, -108,-32768,-32768
+};
+
+
+#define YYLAST 1288
+
+
+static const short yytable[] =
+{
+ 56, 139, 63, 64, 65, 66, 67, 387, 118, 279,
+ 132, 133, 372, 136, 122, 138, 383, 263, 237, 35,
+ 113, 230, 129, 474, 116, 38, 267, 281, 40, 460,
+ 114, 123, 130, 256, 275, 109, 35, 88, 172, 256,
+ 159, 125, 38, 170, 294, 40, 525, 256, 159, 171,
+ 377, 420, 520, 115, 374, 131, 165, 166, 167, 212,
+ 113, 224, 510, 55, 116, 62, 119, 183, 295, 547,
+ 114, 549, 134, 184, 173, 109, 453, 161, 137, 110,
+ 512, 55, 328, 329, 174, 90, 408, 194, 411, 500,
+ 140, 530, 439, 115, 260, 57, 58, 565, 55, 55,
+ 526, 531, 419, 55, 438, 518, 230, 395, 237, 236,
+ 546, 55, 160, 203, 299, 300, 220, 202, 14, 110,
+ 160, 301, 302, 303, 540, 90, 200, 212, 304, 305,
+ 306, 382, 141, 201, 256, 462, 178, 179, 70, 398,
+ 224, 541, 459, 501, 502, 503, 412, 78, 79, 80,
+ 55, 61, 256, 235, 216, 59, 216, 142, 14, 144,
+ 464, 465, 135, 554, 113, 577, 236, 246, 116, 216,
+ 555, 261, 246, 220, 114, 216, 457, 399, 143, 109,
+ 274, 155, 578, 216, 582, 278, 274, 400, 16, 278,
+ 283, 216, 185, 186, 588, 428, 227, 115, 429, 430,
+ 501, 502, 503, 336, 113, 331, 228, 206, 490, 491,
+ 492, 229, 145, 351, 114, 187, 188, 207, 343, 353,
+ 354, 146, 216, 110, 437, 228, 206, 118, 344, 90,
+ 229, 470, 456, 424, 425, 216, 207, 115, 426, 427,
+ 147, 194, 435, 436, 506, 519, 463, 486, 487, 148,
+ 149, 345, 488, 489, 150, 351, 113, 151, 152, 153,
+ 116, 154, 216, 157, 158, 392, 114, 216, 163, 90,
+ 216, 109, 261, 168, -255, 181, 113, 113, 498, 189,
+ 116, 116, 177, 342, 274, 360, 114, 114, 216, 115,
+ 35, 109, 109, 390, 391, 413, 38, 405, 190, 40,
+ 216, 513, 216, 417, 113, 538, 191, 418, 116, 115,
+ 115, 570, 414, 192, 114, 110, 193, -263, 522, 109,
+ 272, 90, 415, 204, 493, 271, -20, -261, 494, 553,
+ 174, 276, 535, 194, 290, 110, 110, 115, 291, 118,
+ 292, 90, 90, 293, 332, 335, 334, -262, 347, 346,
+ 349, 350, 355, 357, 358, 359, 362, 361, 343, 365,
+ 118, 363, 366, 110, 367, 368, 454, 369, 344, 90,
+ 371, 373, 375, 376, 378, 384, 118, 379, 139, 380,
+ 294, 351, 381, 386, 388, 389, 406, 246, 216, 194,
+ 194, 345, 393, 563, 397, 396, 403, 444, 407, 409,
+ 261, 246, 433, 118, 295, 446, 434, 422, 274, 441,
+ 432, 473, 405, 35, 423, 283, 421, 55, 452, 38,
+ 296, 297, 40, 342, 440, 442, 448, 449, 443, 298,
+ 451, 455, 466, 471, 458, 468, 400, 497, 461, 336,
+ 478, 479, 186, 523, 118, 480, 481, 118, 118, 219,
+ 299, 300, 482, 516, 506, 274, 118, 301, 302, 303,
+ 495, 477, 524, 278, 304, 305, 306, 532, 539, 220,
+ 533, 534, 536, 246, 69, 70, 71, 72, 73, 537,
+ 405, 75, 76, 77, 78, 79, 80, 55, 542, 543,
+ 405, 544, 548, 550, 519, 551, 567, 552, 559, 571,
+ 299, 526, 499, 572, 208, 508, 511, 576, 579, 274,
+ 580, 82, 581, 584, 517, 589, 593, 216, 590, 394,
+ 83, 84, 348, 445, 356, 476, 364, 370, 475, 564,
+ 330, 583, 121, 221, 124, 126, 573, 118, 483, 485,
+ 118, 216, 484, 431, 585, 385, 496, 591, 280, 568,
+ 566, 561, 118, 592, 0, 278, 473, 1, 0, 0,
+ 0, 0, 0, 2, 3, 4, 5, 0, 0, 0,
+ 113, 0, 0, 194, 116, 0, 0, 586, 0, 0,
+ 114, 0, 6, 0, 0, 109, 0, 574, 586, 0,
+ 7, 0, 0, 0, 0, 560, 0, 0, 562, 8,
+ 9, 0, 0, 115, 0, 0, 0, 0, 0, 0,
+ 569, 0, 10, 159, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 11, 12, 13, 0, 14, 15, 110,
+ 0, 0, 0, 0, 0, 90, 16, 68, 0, 0,
+ 69, 70, 71, 72, 73, 74, 0, 75, 76, 77,
+ 78, 79, 80, 55, 0, 1, 0, 0, 467, 0,
+ 0, 2, 3, 4, 5, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 81, 82, 0, 0,
+ 6, 2, 3, 4, 5, 160, 83, 84, 7, 0,
+ 0, 16, 85, 0, 0, 0, 0, 8, 9, 0,
+ 6, 0, 0, 0, 0, 0, 0, 0, 7, 0,
+ 10, 0, 0, 0, 0, 0, 0, 8, 9, 0,
+ 0, 11, 12, 13, 0, 14, 15, 0, 0, 0,
+ 10, 241, 0, 0, 16, 0, 0, 0, 0, 0,
+ 0, 11, 12, 13, 0, 14, 15, 0, 0, 247,
+ 0, 0, 0, 68, 16, 0, 69, 70, 71, 72,
+ 73, 74, 0, 75, 76, 77, 78, 79, 80, 55,
+ 248, 6, 0, 0, 69, 70, 71, 72, 73, 7,
+ 0, 75, 76, 77, 78, 79, 80, 55, 8, 9,
+ 0, 0, 81, 82, 0, 0, 0, 0, 0, 0,
+ 249, 10, 83, 84, 208, 205, 0, 16, 85, 0,
+ 0, 82, 11, 0, 0, 0, 206, 0, 0, 0,
+ 83, 84, 250, 0, 0, 16, 207, 0, 0, 0,
+ 69, 70, 71, 72, 73, 0, 0, 75, 76, 77,
+ 78, 79, 80, 55, 0, 0, 284, 0, 0, 0,
+ 0, 0, 0, 285, 0, 0, 0, 0, 0, 0,
+ 208, 410, 0, 0, 0, 0, 0, 82, 285, 0,
+ 0, 69, 70, 71, 72, 73, 83, 84, 75, 76,
+ 77, 78, 79, 80, 55, 0, 69, 70, 71, 72,
+ 73, 0, 0, 75, 76, 77, 78, 79, 80, 55,
+ 0, 208, 0, 0, 0, 0, 0, 0, 82, 285,
+ 0, 0, 0, 0, 0, 0, 208, 83, 84, 0,
+ 0, 0, 0, 82, 0, 0, 0, 69, 70, 71,
+ 72, 73, 83, 84, 75, 76, 77, 78, 79, 80,
+ 55, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 220, 0, 0, 0, 208, 69, 70,
+ 71, 72, 73, 0, 82, 75, 76, 77, 78, 79,
+ 80, 55, 0, 83, 84, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 208, 0,
+ 0, 0, 0, 0, 0, 82, 0, 0, 0, 0,
+ 0, 0, 0, 0, 83, 84, 0, 248, 6, 0,
+ 0, 69, 70, 71, 72, 73, 7, 221, 75, 76,
+ 77, 78, 79, 80, 55, 8, 9, 0, 0, 206,
+ 0, 0, 0, 0, 0, 0, 0, 249, 10, 207,
+ 0, 208, 0, 69, 70, 71, 72, 73, 82, 11,
+ 75, 76, 77, 78, 79, 80, 55, 83, 84, 250,
+ 0, 0, 16, 338, 339, 0, 0, 0, 264, 265,
+ 266, 0, 0, 208, 69, 70, 71, 72, 73, 0,
+ 82, 75, 76, 77, 78, 79, 80, 55, 0, 83,
+ 84, 0, 69, 70, 71, 0, 0, 0, 0, 75,
+ 76, 77, 78, 79, 80, 55, 0, 0, 0, 0,
+ 0, 82, 0, 0, 0, 0, 0, 0, 248, 6,
+ 83, 84, 69, 70, 71, 72, 73, 7, 120, 75,
+ 76, 77, 78, 79, 80, 55, 8, 9, 83, 84,
+ 0, 0, 0, 0, 0, 0, 0, 0, 249, 10,
+ 0, 0, 208, 0, 69, 70, 71, 72, 73, 82,
+ 11, 75, 76, 77, 78, 79, 80, 55, 83, 84,
+ 250, 68, 0, 16, 69, 70, 71, 72, 73, 74,
+ 0, 75, 76, 77, 78, 79, 80, 55, 0, 0,
+ 81, 82, 0, 0, 0, 0, 0, 0, 0, 0,
+ 83, 84, 0, 0, 0, 0, 85, 0, 0, 0,
+ 81, 82, 0, 0, 0, 0, 0, 0, 0, 0,
+ 83, 84, 0, 0, 0, 16, 85, 69, 70, 71,
+ 72, 73, 0, 0, 75, 76, 77, 78, 79, 80,
+ 55, 69, 70, 71, 72, 73, 0, 0, 75, 76,
+ 77, 78, 79, 80, 55, 0, 0, 208, 0, 0,
+ 0, 0, 0, 0, 82, 0, 0, 0, 0, 0,
+ 0, 0, 0, 83, 84, 0, 0, 0, 82, 0,
+ 0, 0, 0, 0, 0, 0, 0, 83, 84
+};
+
+static const short yycheck[] =
+{
+ 1, 17, 3, 4, 5, 6, 7, 260, 9, 174,
+ 11, 12, 242, 14, 10, 16, 256, 160, 149, 0,
+ 8, 147, 10, 400, 8, 0, 163, 177, 0, 383,
+ 8, 10, 10, 157, 171, 8, 17, 8, 62, 163,
+ 5, 10, 17, 61, 8, 17, 9, 171, 5, 6,
+ 250, 294, 460, 8, 244, 10, 57, 58, 59, 142,
+ 48, 144, 9, 45, 48, 2, 9, 68, 32, 518,
+ 48, 520, 71, 74, 5, 48, 22, 48, 15, 8,
+ 22, 45, 190, 191, 15, 8, 288, 88, 290, 9,
+ 3, 468, 335, 48, 76, 11, 12, 546, 45, 45,
+ 63, 478, 292, 45, 334, 459, 232, 272, 239, 20,
+ 518, 45, 77, 137, 78, 79, 27, 135, 74, 48,
+ 77, 85, 86, 87, 9, 48, 127, 210, 92, 93,
+ 94, 255, 3, 134, 258, 388, 5, 6, 33, 276,
+ 223, 26, 382, 63, 64, 65, 41, 42, 43, 44,
+ 45, 2, 276, 7, 142, 71, 144, 6, 74, 6,
+ 390, 391, 13, 31, 152, 9, 20, 155, 152, 157,
+ 38, 159, 160, 27, 152, 163, 376, 5, 3, 152,
+ 168, 5, 26, 171, 571, 173, 174, 15, 83, 177,
+ 178, 179, 40, 41, 581, 52, 7, 152, 55, 56,
+ 63, 64, 65, 204, 192, 193, 17, 18, 428, 429,
+ 430, 22, 3, 214, 192, 41, 42, 28, 206, 220,
+ 221, 3, 210, 152, 332, 17, 18, 228, 206, 152,
+ 22, 396, 375, 53, 54, 223, 28, 192, 48, 49,
+ 6, 242, 25, 26, 66, 67, 389, 424, 425, 3,
+ 6, 206, 426, 427, 3, 256, 244, 3, 6, 3,
+ 244, 3, 250, 6, 3, 266, 244, 255, 6, 192,
+ 258, 244, 260, 5, 3, 30, 264, 265, 443, 24,
+ 264, 265, 23, 206, 272, 228, 264, 265, 276, 244,
+ 271, 264, 265, 264, 265, 291, 271, 285, 24, 271,
+ 288, 451, 290, 291, 292, 505, 24, 291, 292, 264,
+ 265, 554, 291, 24, 292, 244, 73, 3, 461, 292,
+ 23, 244, 291, 6, 432, 6, 3, 3, 436, 529,
+ 15, 6, 497, 334, 6, 264, 265, 292, 8, 340,
+ 6, 264, 265, 41, 81, 60, 26, 3, 7, 18,
+ 3, 3, 7, 3, 3, 3, 3, 8, 346, 3,
+ 361, 7, 3, 292, 27, 3, 367, 7, 346, 292,
+ 3, 7, 26, 80, 3, 7, 377, 3, 394, 3,
+ 8, 382, 3, 3, 26, 77, 3, 375, 376, 390,
+ 391, 346, 7, 543, 7, 26, 26, 340, 7, 3,
+ 388, 389, 25, 404, 32, 8, 25, 50, 396, 7,
+ 26, 399, 400, 394, 51, 403, 61, 45, 361, 394,
+ 48, 49, 394, 346, 26, 22, 8, 8, 24, 57,
+ 19, 3, 8, 7, 377, 5, 15, 24, 77, 440,
+ 26, 7, 41, 3, 445, 9, 7, 448, 449, 7,
+ 78, 79, 9, 9, 66, 443, 457, 85, 86, 87,
+ 82, 404, 3, 451, 92, 93, 94, 6, 8, 27,
+ 25, 25, 25, 461, 32, 33, 34, 35, 36, 9,
+ 468, 39, 40, 41, 42, 43, 44, 45, 9, 24,
+ 478, 16, 8, 3, 67, 9, 3, 26, 25, 5,
+ 78, 63, 445, 7, 62, 448, 449, 26, 25, 497,
+ 9, 69, 5, 3, 457, 26, 0, 505, 9, 271,
+ 78, 79, 210, 346, 223, 403, 232, 239, 401, 544,
+ 192, 574, 10, 91, 10, 10, 557, 538, 421, 423,
+ 541, 529, 422, 315, 576, 258, 440, 589, 175, 552,
+ 548, 539, 553, 0, -1, 543, 544, 4, -1, -1,
+ -1, -1, -1, 10, 11, 12, 13, -1, -1, -1,
+ 558, -1, -1, 574, 558, -1, -1, 578, -1, -1,
+ 558, -1, 29, -1, -1, 558, -1, 558, 589, -1,
+ 37, -1, -1, -1, -1, 538, -1, -1, 541, 46,
+ 47, -1, -1, 558, -1, -1, -1, -1, -1, -1,
+ 553, -1, 59, 5, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 70, 71, 72, -1, 74, 75, 558,
+ -1, -1, -1, -1, -1, 558, 83, 29, -1, -1,
+ 32, 33, 34, 35, 36, 37, -1, 39, 40, 41,
+ 42, 43, 44, 45, -1, 4, -1, -1, 7, -1,
+ -1, 10, 11, 12, 13, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 4, 68, 69, -1, -1,
+ 29, 10, 11, 12, 13, 77, 78, 79, 37, -1,
+ -1, 83, 84, -1, -1, -1, -1, 46, 47, -1,
+ 29, -1, -1, -1, -1, -1, -1, -1, 37, -1,
+ 59, -1, -1, -1, -1, -1, -1, 46, 47, -1,
+ -1, 70, 71, 72, -1, 74, 75, -1, -1, -1,
+ 59, 7, -1, -1, 83, -1, -1, -1, -1, -1,
+ -1, 70, 71, 72, -1, 74, 75, -1, -1, 7,
+ -1, -1, -1, 29, 83, -1, 32, 33, 34, 35,
+ 36, 37, -1, 39, 40, 41, 42, 43, 44, 45,
+ 28, 29, -1, -1, 32, 33, 34, 35, 36, 37,
+ -1, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ -1, -1, 68, 69, -1, -1, -1, -1, -1, -1,
+ 58, 59, 78, 79, 62, 7, -1, 83, 84, -1,
+ -1, 69, 70, -1, -1, -1, 18, -1, -1, -1,
+ 78, 79, 80, -1, -1, 83, 28, -1, -1, -1,
+ 32, 33, 34, 35, 36, -1, -1, 39, 40, 41,
+ 42, 43, 44, 45, -1, -1, 7, -1, -1, -1,
+ -1, -1, -1, 14, -1, -1, -1, -1, -1, -1,
+ 62, 7, -1, -1, -1, -1, -1, 69, 14, -1,
+ -1, 32, 33, 34, 35, 36, 78, 79, 39, 40,
+ 41, 42, 43, 44, 45, -1, 32, 33, 34, 35,
+ 36, -1, -1, 39, 40, 41, 42, 43, 44, 45,
+ -1, 62, -1, -1, -1, -1, -1, -1, 69, 14,
+ -1, -1, -1, -1, -1, -1, 62, 78, 79, -1,
+ -1, -1, -1, 69, -1, -1, -1, 32, 33, 34,
+ 35, 36, 78, 79, 39, 40, 41, 42, 43, 44,
+ 45, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 27, -1, -1, -1, 62, 32, 33,
+ 34, 35, 36, -1, 69, 39, 40, 41, 42, 43,
+ 44, 45, -1, 78, 79, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 62, -1,
+ -1, -1, -1, -1, -1, 69, -1, -1, -1, -1,
+ -1, -1, -1, -1, 78, 79, -1, 28, 29, -1,
+ -1, 32, 33, 34, 35, 36, 37, 91, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, -1, -1, 18,
+ -1, -1, -1, -1, -1, -1, -1, 58, 59, 28,
+ -1, 62, -1, 32, 33, 34, 35, 36, 69, 70,
+ 39, 40, 41, 42, 43, 44, 45, 78, 79, 80,
+ -1, -1, 83, 21, 22, -1, -1, -1, 89, 90,
+ 91, -1, -1, 62, 32, 33, 34, 35, 36, -1,
+ 69, 39, 40, 41, 42, 43, 44, 45, -1, 78,
+ 79, -1, 32, 33, 34, -1, -1, -1, -1, 39,
+ 40, 41, 42, 43, 44, 45, -1, -1, -1, -1,
+ -1, 69, -1, -1, -1, -1, -1, -1, 28, 29,
+ 78, 79, 32, 33, 34, 35, 36, 37, 68, 39,
+ 40, 41, 42, 43, 44, 45, 46, 47, 78, 79,
+ -1, -1, -1, -1, -1, -1, -1, -1, 58, 59,
+ -1, -1, 62, -1, 32, 33, 34, 35, 36, 69,
+ 70, 39, 40, 41, 42, 43, 44, 45, 78, 79,
+ 80, 29, -1, 83, 32, 33, 34, 35, 36, 37,
+ -1, 39, 40, 41, 42, 43, 44, 45, -1, -1,
+ 68, 69, -1, -1, -1, -1, -1, -1, -1, -1,
+ 78, 79, -1, -1, -1, -1, 84, -1, -1, -1,
+ 68, 69, -1, -1, -1, -1, -1, -1, -1, -1,
+ 78, 79, -1, -1, -1, 83, 84, 32, 33, 34,
+ 35, 36, -1, -1, 39, 40, 41, 42, 43, 44,
+ 45, 32, 33, 34, 35, 36, -1, -1, 39, 40,
+ 41, 42, 43, 44, 45, -1, -1, 62, -1, -1,
+ -1, -1, -1, -1, 69, -1, -1, -1, -1, -1,
+ -1, -1, -1, 78, 79, -1, -1, -1, 69, -1,
+ -1, -1, -1, -1, -1, -1, -1, 78, 79
+};
+#define YYPURE 1
+
+/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
+#line 3 "/usr/share/bison/bison.simple"
+
+/* Skeleton output parser for bison,
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 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. */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+ infringing on user name space. This should be done even for local
+ variables, as they might otherwise be expanded by user macros.
+ There are some unavoidable exceptions within include files to
+ define necessary library symbols; they are noted "INFRINGES ON
+ USER NAME SPACE" below. */
+
+#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
+
+/* The parser invokes alloca or malloc; define the necessary symbols. */
+
+# if YYSTACK_USE_ALLOCA
+# define YYSTACK_ALLOC alloca
+# else
+# ifndef YYSTACK_USE_ALLOCA
+# if defined (alloca) || defined (_ALLOCA_H)
+# define YYSTACK_ALLOC alloca
+# else
+# ifdef __GNUC__
+# define YYSTACK_ALLOC __builtin_alloca
+# endif
+# endif
+# endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+ /* Pacify GCC's `empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# else
+# if defined (__STDC__) || defined (__cplusplus)
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
+# define YYSTACK_ALLOC malloc
+# define YYSTACK_FREE free
+# endif
+#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
+
+
+#if (! defined (yyoverflow) \
+ && (! defined (__cplusplus) \
+ || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member. */
+union yyalloc
+{
+ short yyss;
+ YYSTYPE yyvs;
+# if YYLSP_NEEDED
+ YYLTYPE yyls;
+# endif
+};
+
+/* The size of the maximum gap between one aligned stack and the next. */
+# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+ N elements. */
+# if YYLSP_NEEDED
+# define YYSTACK_BYTES(N) \
+ ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ + 2 * YYSTACK_GAP_MAX)
+# else
+# define YYSTACK_BYTES(N) \
+ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
+ + YYSTACK_GAP_MAX)
+# endif
+
+/* Copy COUNT objects from FROM to TO. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if 1 < __GNUC__
+# define YYCOPY(To, From, Count) \
+ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+# else
+# define YYCOPY(To, From, Count) \
+ do \
+ { \
+ register YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (To)[yyi] = (From)[yyi]; \
+ } \
+ while (0)
+# endif
+# endif
+
+/* Relocate STACK from its old location to the new one. The
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
+ elements in the stack, and YYPTR gives the new location of the
+ stack. Advance YYPTR to a properly aligned location for the next
+ stack. */
+# define YYSTACK_RELOCATE(Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack, Stack, yysize); \
+ Stack = &yyptr->Stack; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (0)
+
+#endif
+
+
+#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
+# define YYSIZE_T __SIZE_TYPE__
+#endif
+#if ! defined (YYSIZE_T) && defined (size_t)
+# define YYSIZE_T size_t
+#endif
+#if ! defined (YYSIZE_T)
+# if defined (__STDC__) || defined (__cplusplus)
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
+#endif
+#if ! defined (YYSIZE_T)
+# define YYSIZE_T unsigned int
+#endif
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY -2
+#define YYEOF 0
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrlab1
+/* Like YYERROR except do call yyerror. This remains here temporarily
+ to ease the transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
+#define YYFAIL goto yyerrlab
+#define YYRECOVERING() (!!yyerrstatus)
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ yychar1 = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror ("syntax error: cannot back up"); \
+ YYERROR; \
+ } \
+while (0)
+
+#define YYTERROR 1
+#define YYERRCODE 256
+
+
+/* YYLLOC_DEFAULT -- Compute the default location (before the actions
+ are run).
+
+ When YYLLOC_DEFAULT is run, CURRENT is set the location of the
+ first token. By default, to implement support for ranges, extend
+ its range to the last symbol. */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ Current.last_line = Rhs[N].last_line; \
+ Current.last_column = Rhs[N].last_column;
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments. */
+
+#if YYPURE
+# if YYLSP_NEEDED
+# ifdef YYLEX_PARAM
+# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
+# else
+# define YYLEX yylex (&yylval, &yylloc)
+# endif
+# else /* !YYLSP_NEEDED */
+# ifdef YYLEX_PARAM
+# define YYLEX yylex (&yylval, YYLEX_PARAM)
+# else
+# define YYLEX yylex (&yylval)
+# endif
+# endif /* !YYLSP_NEEDED */
+#else /* !YYPURE */
+# define YYLEX yylex ()
+#endif /* !YYPURE */
+
+
+/* Enable debugging if requested. */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+# define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (0)
+/* Nonzero means print parse trace. It is left uninitialized so that
+ multiple parsers can coexist. */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+#endif /* !YYDEBUG */
+
+/* YYINITDEPTH -- initial size of the parser's stacks. */
+#ifndef YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+ if the built-in stack extension method is used).
+
+ Do not make this value too large; the results are undefined if
+ SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+ evaluated with infinite-precision integer arithmetic. */
+
+#if YYMAXDEPTH == 0
+# undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+#ifdef YYERROR_VERBOSE
+
+# ifndef yystrlen
+# if defined (__GLIBC__) && defined (_STRING_H)
+# define yystrlen strlen
+# else
+/* Return the length of YYSTR. */
+static YYSIZE_T
+# if defined (__STDC__) || defined (__cplusplus)
+yystrlen (const char *yystr)
+# else
+yystrlen (yystr)
+ const char *yystr;
+# endif
+{
+ register const char *yys = yystr;
+
+ while (*yys++ != '\0')
+ continue;
+
+ return yys - yystr - 1;
+}
+# endif
+# endif
+
+# ifndef yystpcpy
+# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+# define yystpcpy stpcpy
+# else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+ YYDEST. */
+static char *
+# if defined (__STDC__) || defined (__cplusplus)
+yystpcpy (char *yydest, const char *yysrc)
+# else
+yystpcpy (yydest, yysrc)
+ char *yydest;
+ const char *yysrc;
+# endif
+{
+ register char *yyd = yydest;
+ register const char *yys = yysrc;
+
+ while ((*yyd++ = *yys++) != '\0')
+ continue;
+
+ return yyd - 1;
+}
+# endif
+# endif
+#endif
+
+#line 315 "/usr/share/bison/bison.simple"
+
+
+/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+ into 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 YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+# define YYPARSE_PARAM_DECL
+# else
+# define YYPARSE_PARAM_ARG YYPARSE_PARAM
+# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+# endif
+#else /* !YYPARSE_PARAM */
+# define YYPARSE_PARAM_ARG
+# define YYPARSE_PARAM_DECL
+#endif /* !YYPARSE_PARAM */
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+# ifdef YYPARSE_PARAM
+int yyparse (void *);
+# else
+int yyparse (void);
+# endif
+#endif
+
+/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
+ variables are global, or local to YYPARSE. */
+
+#define YY_DECL_NON_LSP_VARIABLES \
+/* The lookahead symbol. */ \
+int yychar; \
+ \
+/* The semantic value of the lookahead symbol. */ \
+YYSTYPE yylval; \
+
+/* The variables used to return semantic value and location from the
+ action routines. */
+ YYSTYPE yyval;
+#if YYLSP_NEEDED
+ YYLTYPE yyloc;
+#endif
+ \
+/* Number of parse errors so far. */ \
+int yynerrs;
+
+#if YYLSP_NEEDED
+# define YY_DECL_VARIABLES \
+YY_DECL_NON_LSP_VARIABLES \
+ \
+/* Location data for the lookahead symbol. */ \
+YYLTYPE yylloc;
+#else
+# define YY_DECL_VARIABLES \
+YY_DECL_NON_LSP_VARIABLES
+#endif
+
+
+/* If nonreentrant, generate the variables here. */
+
+#if !YYPURE
+YY_DECL_VARIABLES
+#endif /* !YYPURE */
+
+int
+yyparse (YYPARSE_PARAM_ARG)
+ YYPARSE_PARAM_DECL
+{
+ /* If reentrant, generate the variables here. */
+#if YYPURE
+ YY_DECL_VARIABLES
+#endif /* !YYPURE */
+
+ register int yystate;
+ register int yyn;
+ int yyresult;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+ /* Lookahead token as an internal (translated) token number. */
+ int yychar1 = 0;
+
+ /* Three stacks and their tools:
+ `yyss': related to states,
+ `yyvs': related to semantic values,
+ `yyls': related to locations.
+
+ Refer to the stacks thru separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+
+ /* The state stack. */
+ short yyssa[YYINITDEPTH];
+ short *yyss = yyssa;
+ register short *yyssp;
+
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs = yyvsa;
+ register YYSTYPE *yyvsp;
+
+#if YYLSP_NEEDED
+ /* The location stack. */
+ YYLTYPE yylsa[YYINITDEPTH];
+ YYLTYPE *yyls = yylsa;
+ YYLTYPE *yylsp;
+#endif
+
+#if YYLSP_NEEDED
+# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+#else
+# define YYPOPSTACK (yyvsp--, yyssp--)
+#endif
+
+ YYSIZE_T yystacksize = YYINITDEPTH;
+
+
+ /* When reducing, the number of symbols on the RHS of the reduced
+ rule. */
+ int yylen;
+
+ YYDPRINTF ((stderr, "Starting parse\n"));
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = 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. */
+
+ yyssp = yyss;
+ yyvsp = yyvs;
+#if YYLSP_NEEDED
+ yylsp = yyls;
+#endif
+ goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate. |
+`------------------------------------------------------------*/
+ yynewstate:
+ /* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks.
+ */
+ yyssp++;
+
+ yysetstate:
+ *yyssp = yystate;
+
+ if (yyssp >= yyss + yystacksize - 1)
+ {
+ /* Get the current used size of the three stacks, in elements. */
+ YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ {
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. */
+# if YYLSP_NEEDED
+ YYLTYPE *yyls1 = yyls;
+ /* This used to be a conditional around just the two extra args,
+ but that might be undefined if yyoverflow is a macro. */
+ yyoverflow ("parser stack overflow",
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+ &yyls1, yysize * sizeof (*yylsp),
+ &yystacksize);
+ yyls = yyls1;
+# else
+ yyoverflow ("parser stack overflow",
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+ &yystacksize);
+# endif
+ yyss = yyss1;
+ yyvs = yyvs1;
+ }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+ goto yyoverflowlab;
+# else
+ /* Extend the stack our own way. */
+ if (yystacksize >= YYMAXDEPTH)
+ goto yyoverflowlab;
+ yystacksize *= 2;
+ if (yystacksize > YYMAXDEPTH)
+ yystacksize = YYMAXDEPTH;
+
+ {
+ short *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyoverflowlab;
+ YYSTACK_RELOCATE (yyss);
+ YYSTACK_RELOCATE (yyvs);
+# if YYLSP_NEEDED
+ YYSTACK_RELOCATE (yyls);
+# endif
+# undef YYSTACK_RELOCATE
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
+ }
+# endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + yysize - 1;
+ yyvsp = yyvs + yysize - 1;
+#if YYLSP_NEEDED
+ yylsp = yyls + yysize - 1;
+#endif
+
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+ (unsigned long int) yystacksize));
+
+ if (yyssp >= yyss + yystacksize - 1)
+ YYABORT;
+ }
+
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+ goto yybackup;
+
+
+/*-----------.
+| yybackup. |
+`-----------*/
+yybackup:
+
+/* Do appropriate processing given the current state. */
+/* Read a lookahead token if we need one and don't already have one. */
+/* yyresume: */
+
+ /* First try to decide what to do without reference to lookahead token. */
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* yychar is either YYEMPTY or YYEOF
+ or a valid token in external form. */
+
+ if (yychar == YYEMPTY)
+ {
+ YYDPRINTF ((stderr, "Reading a token: "));
+ yychar = YYLEX;
+ }
+
+ /* Convert token to internal form (in yychar1) for indexing tables with */
+
+ if (yychar <= 0) /* This means end of input. */
+ {
+ yychar1 = 0;
+ yychar = YYEOF; /* Don't call YYLEX any more */
+
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+ yychar1 = YYTRANSLATE (yychar);
+
+#if YYDEBUG
+ /* We have to keep this `#if YYDEBUG', since we use variables
+ which are defined only if `YYDEBUG' is set. */
+ if (yydebug)
+ {
+ YYFPRINTF (stderr, "Next token is %d (%s",
+ yychar, yytname[yychar1]);
+ /* Give the individual parser a way to print the precise
+ meaning of a token, for further debugging info. */
+# ifdef YYPRINT
+ YYPRINT (stderr, yychar, yylval);
+# endif
+ YYFPRINTF (stderr, ")\n");
+ }
+#endif
+ }
+
+ yyn += yychar1;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
+ goto yydefault;
+
+ yyn = yytable[yyn];
+
+ /* yyn is what to do for this token type in this state.
+ Negative => reduce, -yyn is rule number.
+ Positive => shift, yyn is new state.
+ New state is final state => don't bother to shift,
+ just return success.
+ 0, or most negative number => error. */
+
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrlab;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the lookahead token. */
+ YYDPRINTF ((stderr, "Shifting token %d (%s), ",
+ yychar, yytname[yychar1]));
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+#if YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ /* Count tokens shifted since error; after three, turn off error
+ status. */
+ if (yyerrstatus)
+ yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state. |
+`-----------------------------------------------------------*/
+yydefault:
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+ goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction. |
+`-----------------------------*/
+yyreduce:
+ /* yyn is the number of a rule to reduce with. */
+ yylen = yyr2[yyn];
+
+ /* If YYLEN is nonzero, implement the default value of the action:
+ `$$ = $1'.
+
+ Otherwise, the following line sets YYVAL to the semantic value of
+ the lookahead token. This behavior is undocumented and Bison
+ users should not rely upon it. Assigning to YYVAL
+ unconditionally makes the parser a bit smaller, and it avoids a
+ GCC warning that YYVAL may be used uninitialized. */
+ yyval = yyvsp[1-yylen];
+
+#if YYLSP_NEEDED
+ /* Similarly for the default location. Let the user run additional
+ commands if for instance locations are ranges. */
+ yyloc = yylsp[1-yylen];
+ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
+#endif
+
+#if YYDEBUG
+ /* We have to keep this `#if YYDEBUG', since we use variables which
+ are defined only if `YYDEBUG' is set. */
+ if (yydebug)
+ {
+ int yyi;
+
+ YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
+ yyn, yyrline[yyn]);
+
+ /* Print the symbols being reduced, and their result. */
+ for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
+ YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
+ YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+ }
+#endif
+
+ switch (yyn) {
+
+case 1:
+#line 79 "PSDL.yy"
+{ yyval = new TAO_PSDL_Specification (yyvsp[0]); ;
+ break;}
+case 2:
+#line 82 "PSDL.yy"
+{ yyval = new TAO_PSDL_Specification (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 3:
+#line 86 "PSDL.yy"
+{ yyval = new TAO_PSDL_Definition (yyvsp[-1]); ;
+ break;}
+case 4:
+#line 89 "PSDL.yy"
+{ yyval = new TAO_PSDL_Definition (yyvsp[-1]); ;
+ break;}
+case 5:
+#line 92 "PSDL.yy"
+{ yyval = new TAO_PSDL_Definition (yyvsp[-1]); ;
+ break;}
+case 6:
+#line 95 "PSDL.yy"
+{ yyval = new TAO_PSDL_Definition (yyvsp[-1]); ;
+ break;}
+case 7:
+#line 98 "PSDL.yy"
+{ yyval = new TAO_PSDL_Definition (yyvsp[-1]); ;
+ break;}
+case 8:
+#line 101 "PSDL.yy"
+{ yyval = new TAO_PSDL_Definition (yyvsp[-1]); ;
+ break;}
+case 9:
+#line 104 "PSDL.yy"
+{ yyval = new TAO_PSDL_Definition (yyvsp[-1]); ;
+ break;}
+case 10:
+#line 107 "PSDL.yy"
+{ yyval = new TAO_PSDL_Definition (yyvsp[-1]); ;
+ break;}
+case 11:
+#line 110 "PSDL.yy"
+{ yyval = new TAO_PSDL_Definition (yyvsp[-1]); ;
+ break;}
+case 12:
+#line 113 "PSDL.yy"
+{ yyval = new TAO_PSDL_Definition (yyvsp[-1]); ;
+ break;}
+case 13:
+#line 116 "PSDL.yy"
+{ yyval = new TAO_PSDL_Definition (yyvsp[-1]); ;
+ break;}
+case 14:
+#line 120 "PSDL.yy"
+{
+ int good_module_name = TAO_PSDL_Scope::instance ()->pop_top_scope ()->add_module (TAO_PSDL_Scope::instance ()->get_identifier ());
+ if (good_module_name == -1)
+ YYABORT;
+ ;
+ break;}
+case 15:
+#line 126 "PSDL.yy"
+{
+ TAO_PSDL_Scope::instance ()->set_module_scope ();
+ yyval = new TAO_PSDL_Module (TAO_PSDL_MODULE, yyvsp[-4], yyvsp[-1]); ;
+ break;}
+case 16:
+#line 132 "PSDL.yy"
+{ TAO_PSDL_Scope::instance ()->set_scope ();
+ yyval = new TAO_PSDL_Abstract_Storagetype (yyvsp[0]); ;
+ break;}
+case 17:
+#line 136 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagetype (yyvsp[0]); ;
+ break;}
+case 18:
+#line 140 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagetype_Dcl (yyvsp[-3], yyvsp[-1]); ;
+ break;}
+case 19:
+#line 143 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagetype_Dcl (yyvsp[-2]); ;
+ break;}
+case 20:
+#line 147 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagetype_Fwd_Dcl (yyvsp[0]); ;
+ break;}
+case 21:
+#line 151 "PSDL.yy"
+{
+ int good_storagetype_name = TAO_PSDL_Scope::instance ()->pop_top_scope ()->add_interface (TAO_PSDL_Scope::instance ()->get_identifier ());
+ if (good_storagetype_name == -1)
+ YYABORT;
+
+ yyval = yyvsp[0];
+ ;
+ break;}
+case 22:
+#line 162 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagetype_Header (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 23:
+#line 165 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagetype_Header (yyvsp[0]); ;
+ break;}
+case 24:
+#line 170 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagetype_Body (yyvsp[0]); ;
+ break;}
+case 25:
+#line 173 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagetype_Body (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 26:
+#line 178 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagetype_Member (yyvsp[-1]); ;
+ break;}
+case 27:
+#line 181 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagetype_Member (yyvsp[-1]); ;
+ break;}
+case 28:
+#line 186 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagetype_Inh_Spec (yyvsp[0]); ;
+ break;}
+case 29:
+#line 191 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagetype_Name (yyvsp[0]); ;
+ break;}
+case 30:
+#line 194 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagetype_Name (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 31:
+#line 198 "PSDL.yy"
+{ yyval = new TAO_PSDL_Psdl_State_Dcl (yyvsp[-3], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 32:
+#line 201 "PSDL.yy"
+{ yyval = new TAO_PSDL_Psdl_State_Dcl (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 33:
+#line 205 "PSDL.yy"
+{ yyval = new TAO_PSDL_Psdl_State_Type_Spec (yyvsp[0]); ;
+ break;}
+case 34:
+#line 208 "PSDL.yy"
+{ yyval = new TAO_PSDL_Psdl_State_Type_Spec (yyvsp[0]); ;
+ break;}
+case 35:
+#line 211 "PSDL.yy"
+{ yyval = new TAO_PSDL_Psdl_State_Type_Spec (yyvsp[0]); ;
+ break;}
+case 36:
+#line 214 "PSDL.yy"
+{ yyval = new TAO_PSDL_Psdl_State_Type_Spec (yyvsp[0]); ;
+ break;}
+case 37:
+#line 217 "PSDL.yy"
+{ yyval = new TAO_PSDL_Psdl_State_Type_Spec (yyvsp[0]); ;
+ break;}
+case 38:
+#line 222 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagetype_Ref_Type (yyvsp[-4], yyvsp[-1]); ;
+ break;}
+case 39:
+#line 225 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagetype_Ref_Type (yyvsp[-1]); ;
+ break;}
+case 40:
+#line 229 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagehome (yyvsp[0]); ;
+ break;}
+case 41:
+#line 232 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagehome (yyvsp[0]); ;
+ break;}
+case 42:
+#line 237 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagehome_Fwd_Dcl (yyvsp[0]); ;
+ break;}
+case 43:
+#line 242 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagehome_Dcl (yyvsp[-3], yyvsp[-1]); ;
+ break;}
+case 44:
+#line 245 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagehome_Dcl (yyvsp[-2]); ;
+ break;}
+case 45:
+#line 250 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagehome_Header (yyvsp[-3], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 46:
+#line 253 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagehome_Header (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 47:
+#line 258 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagehome_Body (yyvsp[0]); ;
+ break;}
+case 48:
+#line 261 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagehome_Body (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 49:
+#line 266 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagehome_Member (yyvsp[-1]); ;
+ break;}
+case 50:
+#line 269 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagehome_Member (yyvsp[-1]); ;
+ break;}
+case 51:
+#line 272 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagehome_Member (yyvsp[-1]); ;
+ break;}
+case 52:
+#line 277 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagehome_Inh_Spec (yyvsp[0]); ;
+ break;}
+case 53:
+#line 282 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagehome_Name (yyvsp[0]); ;
+ break;}
+case 54:
+#line 285 "PSDL.yy"
+{ yyval = new TAO_PSDL_Abstract_Storagehome_Name (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 55:
+#line 289 "PSDL.yy"
+{ TAO_PSDL_Scope::instance ()->set_scope ();
+ yyval = new TAO_PSDL_Op_Dcl (yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 56:
+#line 293 "PSDL.yy"
+{ TAO_PSDL_Scope::instance ()->set_scope ();
+ yyval = new TAO_PSDL_Op_Dcl (yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 57:
+#line 298 "PSDL.yy"
+{ yyval = new TAO_PSDL_Key_Dcl (yyvsp[-3], yyvsp[-1]); ;
+ break;}
+case 58:
+#line 301 "PSDL.yy"
+{ yyval = new TAO_PSDL_Key_Dcl (yyvsp[0]); ;
+ break;}
+case 59:
+#line 305 "PSDL.yy"
+{ yyval = new TAO_PSDL_Catalog (yyvsp[-4], yyvsp[-3], yyvsp[-1]); ;
+ break;}
+case 60:
+#line 308 "PSDL.yy"
+{ yyval = new TAO_PSDL_Catalog (yyvsp[-3], yyvsp[-1]); ;
+ break;}
+case 61:
+#line 311 "PSDL.yy"
+{ yyval = new TAO_PSDL_Catalog (yyvsp[-2]); ;
+ break;}
+case 62:
+#line 314 "PSDL.yy"
+{ yyval = new TAO_PSDL_Catalog (yyvsp[-3], yyvsp[-2]); ;
+ break;}
+case 63:
+#line 318 "PSDL.yy"
+{ yyval = new TAO_PSDL_Catalog_Inh_Spec (yyvsp[0]); ;
+ break;}
+case 64:
+#line 322 "PSDL.yy"
+{ yyval = new TAO_PSDL_Catalog_Name (yyvsp[0]); ;
+ break;}
+case 65:
+#line 325 "PSDL.yy"
+{ yyval = new TAO_PSDL_Catalog_Name (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 66:
+#line 329 "PSDL.yy"
+{ yyval = new TAO_PSDL_Catalog_Body (yyvsp[0]); ;
+ break;}
+case 67:
+#line 332 "PSDL.yy"
+{ yyval = new TAO_PSDL_Catalog_Body (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 68:
+#line 336 "PSDL.yy"
+{ yyval = new TAO_PSDL_Catalog_Member (yyvsp[-1]); ;
+ break;}
+case 69:
+#line 339 "PSDL.yy"
+{ yyval = new TAO_PSDL_Catalog_Member (yyvsp[-1]); ;
+ break;}
+case 70:
+#line 343 "PSDL.yy"
+{ yyval = new TAO_PSDL_Provides_Dcl (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 71:
+#line 347 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype (yyvsp[0]); ;
+ break;}
+case 72:
+#line 350 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype (yyvsp[0]); ;
+ break;}
+case 73:
+#line 354 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype_Dcl (yyvsp[-3], yyvsp[-1]); ;
+ break;}
+case 74:
+#line 357 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype_Dcl (yyvsp[-2]); ;
+ break;}
+case 75:
+#line 361 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype_Fwd_Dcl (yyvsp[0]); ;
+ break;}
+case 76:
+#line 365 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype_Header (yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 77:
+#line 368 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype_Header (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 78:
+#line 371 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype_Header (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 79:
+#line 375 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype_Body (yyvsp[0]); ;
+ break;}
+case 80:
+#line 378 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype_Body (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 81:
+#line 382 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype_Member (yyvsp[-1]); ;
+ break;}
+case 82:
+#line 385 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype_Member (yyvsp[-1]); ;
+ break;}
+case 83:
+#line 388 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype_Member (yyvsp[-1]); ;
+ break;}
+case 84:
+#line 392 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype_Inh_Spec (yyvsp[0]); ;
+ break;}
+case 85:
+#line 396 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype_Name (yyvsp[0]); ;
+ break;}
+case 86:
+#line 400 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype_Impl_Spec (yyvsp[0]); ;
+ break;}
+case 87:
+#line 404 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagetype_Ref_Type (yyvsp[-1]); ;
+ break;}
+case 88:
+#line 408 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagehome_Scope (yyvsp[0]); ;
+ break;}
+case 89:
+#line 412 "PSDL.yy"
+{ yyval = new TAO_PSDL_Store_Directive (yyvsp[-3], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 90:
+#line 415 "PSDL.yy"
+{ yyval = new TAO_PSDL_Store_Directive (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 91:
+#line 420 "PSDL.yy"
+{ yyval = new TAO_PSDL_Psdl_Concrete_State_Type (yyvsp[0]); ;
+ break;}
+case 92:
+#line 423 "PSDL.yy"
+{ yyval = new TAO_PSDL_Psdl_Concrete_State_Type (yyvsp[0]); ;
+ break;}
+case 93:
+#line 427 "PSDL.yy"
+{ yyval = new TAO_PSDL_Ref_Rep_Directive (yyvsp[-1]); ;
+ break;}
+case 94:
+#line 431 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagehome (yyvsp[-3], yyvsp[-1]); ;
+ break;}
+case 95:
+#line 434 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagehome (yyvsp[-2]); ;
+ break;}
+case 96:
+#line 438 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagehome_Header (yyvsp[-4], yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 97:
+#line 441 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagehome_Header (yyvsp[-3], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 98:
+#line 444 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagehome_Header (yyvsp[-3], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 99:
+#line 447 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagehome_Header (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 100:
+#line 451 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagehome_Body (yyvsp[0]); ;
+ break;}
+case 101:
+#line 454 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagehome_Body (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 102:
+#line 458 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagehome_Member (yyvsp[-1]); ;
+ break;}
+case 103:
+#line 461 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagehome_Member (yyvsp[-1]); ;
+ break;}
+case 104:
+#line 465 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagehome_Inh_Spec (yyvsp[0]); ;
+ break;}
+case 105:
+#line 469 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagehome_Name (yyvsp[0]); ;
+ break;}
+case 106:
+#line 473 "PSDL.yy"
+{ yyval = new TAO_PSDL_Storagehome_Impl_Spec (yyvsp[0]); ;
+ break;}
+case 107:
+#line 477 "PSDL.yy"
+{ yyval = new TAO_PSDL_Primary_Key_Dcl (yyvsp[0]); ;
+ break;}
+case 108:
+#line 480 "PSDL.yy"
+{ yyval = new TAO_PSDL_Primary_Key_Dcl (); ;
+ break;}
+case 109:
+#line 484 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 110:
+#line 488 "PSDL.yy"
+{ yyval = new TAO_PSDL_Type_Dcl (TAO_PSDL_TYPEDEF, yyvsp[0]); ;
+ break;}
+case 111:
+#line 491 "PSDL.yy"
+{ yyval = new TAO_PSDL_Type_Dcl (yyvsp[0]); ;
+ break;}
+case 112:
+#line 494 "PSDL.yy"
+{ yyval = new TAO_PSDL_Type_Dcl (yyvsp[0]); ;
+ break;}
+case 113:
+#line 497 "PSDL.yy"
+{ yyval = new TAO_PSDL_Type_Dcl (yyvsp[0]); ;
+ break;}
+case 114:
+#line 500 "PSDL.yy"
+{ yyval = new TAO_PSDL_Type_Dcl (TAO_PSDL_NATIVE, yyvsp[0]); ;
+ break;}
+case 115:
+#line 503 "PSDL.yy"
+{ yyval = new TAO_PSDL_Type_Dcl (yyvsp[0]); ;
+ break;}
+case 116:
+#line 507 "PSDL.yy"
+{ yyval = new TAO_PSDL_Type_Declarator (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 117:
+#line 511 "PSDL.yy"
+{ yyval = new TAO_PSDL_Type_Spec (yyvsp[0]); ;
+ break;}
+case 118:
+#line 514 "PSDL.yy"
+{ yyval = new TAO_PSDL_Type_Spec (yyvsp[0]); ;
+ break;}
+case 119:
+#line 518 "PSDL.yy"
+{ yyval = new TAO_PSDL_Simple_Type_Spec (yyvsp[0]); ;
+ break;}
+case 120:
+#line 521 "PSDL.yy"
+{ yyval = new TAO_PSDL_Simple_Type_Spec (yyvsp[0]); ;
+ break;}
+case 121:
+#line 524 "PSDL.yy"
+{ yyval = new TAO_PSDL_Simple_Type_Spec (yyvsp[0]); ;
+ break;}
+case 122:
+#line 528 "PSDL.yy"
+{ yyval = new TAO_PSDL_Base_Type_Spec (yyvsp[0]); ;
+ break;}
+case 123:
+#line 531 "PSDL.yy"
+{ yyval = new TAO_PSDL_Base_Type_Spec (yyvsp[0]); ;
+ break;}
+case 124:
+#line 534 "PSDL.yy"
+{ yyval = new TAO_PSDL_Base_Type_Spec (yyvsp[0]); ;
+ break;}
+case 125:
+#line 537 "PSDL.yy"
+{ yyval = new TAO_PSDL_Base_Type_Spec (yyvsp[0]); ;
+ break;}
+case 126:
+#line 540 "PSDL.yy"
+{ yyval = new TAO_PSDL_Base_Type_Spec (yyvsp[0]); ;
+ break;}
+case 127:
+#line 543 "PSDL.yy"
+{ yyval = new TAO_PSDL_Base_Type_Spec (yyvsp[0]); ;
+ break;}
+case 128:
+#line 546 "PSDL.yy"
+{ yyval = new TAO_PSDL_Base_Type_Spec (yyvsp[0]); ;
+ break;}
+case 129:
+#line 549 "PSDL.yy"
+{ yyval = new TAO_PSDL_Base_Type_Spec (yyvsp[0]); ;
+ break;}
+case 130:
+#line 552 "PSDL.yy"
+{ yyval = new TAO_PSDL_Base_Type_Spec (yyvsp[0]); ;
+ break;}
+case 131:
+#line 556 "PSDL.yy"
+{ yyval = new TAO_PSDL_Template_Type_Spec (yyvsp[0]); ;
+ break;}
+case 132:
+#line 559 "PSDL.yy"
+{ yyval = new TAO_PSDL_Template_Type_Spec (yyvsp[0]); ;
+ break;}
+case 133:
+#line 562 "PSDL.yy"
+{ yyval = new TAO_PSDL_Template_Type_Spec (yyvsp[0]); ;
+ break;}
+case 134:
+#line 565 "PSDL.yy"
+{ yyval = new TAO_PSDL_Template_Type_Spec (yyvsp[0]); ;
+ break;}
+case 135:
+#line 569 "PSDL.yy"
+{ yyval = new TAO_PSDL_Constr_Type_Spec (yyvsp[0]); ;
+ break;}
+case 136:
+#line 572 "PSDL.yy"
+{ yyval = new TAO_PSDL_Constr_Type_Spec (yyvsp[0]); ;
+ break;}
+case 137:
+#line 575 "PSDL.yy"
+{ yyval = new TAO_PSDL_Constr_Type_Spec (yyvsp[0]); ;
+ break;}
+case 138:
+#line 579 "PSDL.yy"
+{ yyval = new TAO_PSDL_Declarators (yyvsp[0]); ;
+ break;}
+case 139:
+#line 582 "PSDL.yy"
+{ yyval = new TAO_PSDL_Declarators (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 140:
+#line 586 "PSDL.yy"
+{ yyval = new TAO_PSDL_Declarator (yyvsp[0]); ;
+ break;}
+case 141:
+#line 589 "PSDL.yy"
+{ yyval = new TAO_PSDL_Declarator (yyvsp[0]); ;
+ break;}
+case 142:
+#line 593 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 143:
+#line 597 "PSDL.yy"
+{ yyval = new TAO_PSDL_Simple_Declarator_List (yyvsp[0]); ;
+ break;}
+case 144:
+#line 600 "PSDL.yy"
+{ yyval = new TAO_PSDL_Simple_Declarator_List (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 145:
+#line 604 "PSDL.yy"
+{ yyval = new TAO_PSDL_Complex_Declarator (yyvsp[0]); ;
+ break;}
+case 146:
+#line 608 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_FLOAT); ;
+ break;}
+case 147:
+#line 611 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_DOUBLE); ;
+ break;}
+case 148:
+#line 614 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_LONG, TAO_PSDL_DOUBLE); ;
+ break;}
+case 149:
+#line 618 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 150:
+#line 621 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 151:
+#line 625 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 152:
+#line 628 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 153:
+#line 631 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 154:
+#line 635 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_SHORT); ;
+ break;}
+case 155:
+#line 639 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_LONG); ;
+ break;}
+case 156:
+#line 643 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_LONG, TAO_PSDL_LONG); ;
+ break;}
+case 157:
+#line 647 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (yyvsp[0]); ;
+ break;}
+case 158:
+#line 650 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (yyvsp[0]); ;
+ break;}
+case 159:
+#line 653 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (yyvsp[0]); ;
+ break;}
+case 160:
+#line 657 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_UNSIGNED, TAO_PSDL_SHORT); ;
+ break;}
+case 161:
+#line 661 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_UNSIGNED, TAO_PSDL_LONG); ;
+ break;}
+case 162:
+#line 665 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_UNSIGNED, TAO_PSDL_LONG, TAO_PSDL_LONG); ;
+ break;}
+case 163:
+#line 669 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_CHAR); ;
+ break;}
+case 164:
+#line 673 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_WCHAR); ;
+ break;}
+case 165:
+#line 677 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_BOOLEAN); ;
+ break;}
+case 166:
+#line 681 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_OCTET); ;
+ break;}
+case 167:
+#line 685 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_ANY); ;
+ break;}
+case 168:
+#line 689 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_OBJECT); ;
+ break;}
+case 169:
+#line 693 "PSDL.yy"
+{
+ int good_struct_name = TAO_PSDL_Scope::instance ()->pop_top_scope ()->add_struct (TAO_PSDL_Scope::instance ()->get_identifier ());
+
+ if (good_struct_name == -1)
+ YYABORT;
+ ;
+ break;}
+case 170:
+#line 700 "PSDL.yy"
+{
+ TAO_PSDL_Scope::instance ()->set_scope ();
+ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_STRUCT, yyvsp[-4], yyvsp[-1]); ;
+ break;}
+case 171:
+#line 706 "PSDL.yy"
+{ yyval = new TAO_PSDL_Member_List (yyvsp[0]); ;
+ break;}
+case 172:
+#line 709 "PSDL.yy"
+{ yyval = new TAO_PSDL_Member_List (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 173:
+#line 713 "PSDL.yy"
+{ yyval = new TAO_PSDL_Member (yyvsp[-2], yyvsp[-1]); ;
+ break;}
+case 174:
+#line 717 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (yyvsp[-7], yyvsp[-4], yyvsp[-1]); ;
+ break;}
+case 175:
+#line 721 "PSDL.yy"
+{ yyval = new TAO_PSDL_Switch_Type_Spec (yyvsp[0]); ;
+ break;}
+case 176:
+#line 724 "PSDL.yy"
+{ yyval = new TAO_PSDL_Switch_Type_Spec (yyvsp[0]); ;
+ break;}
+case 177:
+#line 727 "PSDL.yy"
+{ yyval = new TAO_PSDL_Switch_Type_Spec (yyvsp[0]); ;
+ break;}
+case 178:
+#line 730 "PSDL.yy"
+{ yyval = new TAO_PSDL_Switch_Type_Spec (yyvsp[0]); ;
+ break;}
+case 179:
+#line 733 "PSDL.yy"
+{ yyval = new TAO_PSDL_Switch_Type_Spec (yyvsp[0]); ;
+ break;}
+case 180:
+#line 737 "PSDL.yy"
+{ yyval = new TAO_PSDL_Switch_Body (yyvsp[0]); ;
+ break;}
+case 181:
+#line 740 "PSDL.yy"
+{ yyval = new TAO_PSDL_Switch_Body (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 182:
+#line 744 "PSDL.yy"
+{ yyval = new TAO_PSDL_Case (yyvsp[-2], yyvsp[-1]); ;
+ break;}
+case 183:
+#line 748 "PSDL.yy"
+{ yyval = new TAO_PSDL_Case_Label (yyvsp[-2], yyvsp[-1]); ;
+ break;}
+case 184:
+#line 751 "PSDL.yy"
+{ yyval = new TAO_PSDL_Case_Label (yyvsp[-1]); ;
+ break;}
+case 185:
+#line 754 "PSDL.yy"
+{ yyval = new TAO_PSDL_Case_Label (yyvsp[-3], yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 186:
+#line 757 "PSDL.yy"
+{ yyval = new TAO_PSDL_Case_Label (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 187:
+#line 761 "PSDL.yy"
+{ yyval = new TAO_PSDL_Element_Spec (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 188:
+#line 765 "PSDL.yy"
+{ yyval = new TAO_PSDL_Const_Dcl (yyvsp[-3], yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 189:
+#line 769 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type(yyvsp[0]); ;
+ break;}
+case 190:
+#line 772 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type(yyvsp[0]); ;
+ break;}
+case 191:
+#line 775 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type(yyvsp[0]); ;
+ break;}
+case 192:
+#line 778 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type(yyvsp[0]); ;
+ break;}
+case 193:
+#line 781 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type(yyvsp[0]); ;
+ break;}
+case 194:
+#line 784 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type(yyvsp[0]); ;
+ break;}
+case 195:
+#line 787 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type(yyvsp[0]); ;
+ break;}
+case 196:
+#line 790 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type(yyvsp[0]); ;
+ break;}
+case 197:
+#line 793 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type(yyvsp[0]); ;
+ break;}
+case 198:
+#line 796 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type(yyvsp[0]); ;
+ break;}
+case 199:
+#line 800 "PSDL.yy"
+{ yyval = new TAO_PSDL_Const_Exp (yyvsp[0]); ;
+ break;}
+case 200:
+#line 804 "PSDL.yy"
+{ yyval = new TAO_PSDL_Or_Expr (yyvsp[0]); ;
+ break;}
+case 201:
+#line 807 "PSDL.yy"
+{ yyval = new TAO_PSDL_Or_Expr (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 202:
+#line 811 "PSDL.yy"
+{ yyval = new TAO_PSDL_Xor_Expr (yyvsp[0]); ;
+ break;}
+case 203:
+#line 814 "PSDL.yy"
+{ yyval = new TAO_PSDL_Xor_Expr (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 204:
+#line 818 "PSDL.yy"
+{ yyval = new TAO_PSDL_And_Expr (yyvsp[0]); ;
+ break;}
+case 205:
+#line 821 "PSDL.yy"
+{ yyval = new TAO_PSDL_And_Expr (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 206:
+#line 825 "PSDL.yy"
+{ yyval = new TAO_PSDL_Shift_Expr (yyvsp[0]); ;
+ break;}
+case 207:
+#line 828 "PSDL.yy"
+{ yyval = new TAO_PSDL_Shift_Expr (yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 208:
+#line 831 "PSDL.yy"
+{ yyval = new TAO_PSDL_Shift_Expr (yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 209:
+#line 835 "PSDL.yy"
+{ yyval = new TAO_PSDL_Add_Expr (yyvsp[0]); ;
+ break;}
+case 210:
+#line 838 "PSDL.yy"
+{ yyval = new TAO_PSDL_Add_Expr (yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 211:
+#line 841 "PSDL.yy"
+{ yyval = new TAO_PSDL_Add_Expr (yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 212:
+#line 845 "PSDL.yy"
+{ yyval = new TAO_PSDL_Mult_Expr (yyvsp[0]); ;
+ break;}
+case 213:
+#line 848 "PSDL.yy"
+{ yyval = new TAO_PSDL_Mult_Expr (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 214:
+#line 851 "PSDL.yy"
+{ yyval = new TAO_PSDL_Mult_Expr (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 215:
+#line 854 "PSDL.yy"
+{ yyval = new TAO_PSDL_Mult_Expr (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 216:
+#line 858 "PSDL.yy"
+{ yyval = new TAO_PSDL_Unary_Expr (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 217:
+#line 861 "PSDL.yy"
+{ yyval = new TAO_PSDL_Unary_Expr (yyvsp[0]); ;
+ break;}
+case 218:
+#line 865 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 219:
+#line 868 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 220:
+#line 871 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 221:
+#line 875 "PSDL.yy"
+{ yyval = new TAO_PSDL_Primary_Expr (yyvsp[0]); ;
+ break;}
+case 222:
+#line 878 "PSDL.yy"
+{ yyval = new TAO_PSDL_Primary_Expr (yyvsp[0]); ;
+ break;}
+case 223:
+#line 881 "PSDL.yy"
+{ yyval = new TAO_PSDL_Primary_Expr (yyvsp[-1]); ;
+ break;}
+case 224:
+#line 885 "PSDL.yy"
+{
+ int good_except_name = TAO_PSDL_Scope::instance ()->pop_top_scope ()->add_exception (TAO_PSDL_Scope::instance ()->get_identifier ());
+ if (good_except_name == -1)
+ YYABORT;
+ yyval = yyvsp[0];
+ ;
+ break;}
+case 225:
+#line 894 "PSDL.yy"
+{
+ TAO_PSDL_Scope::instance ()->set_scope ();
+ yyval = new TAO_PSDL_Except_Dcl (yyvsp[-3], yyvsp[-1]);
+ ;
+ break;}
+case 226:
+#line 900 "PSDL.yy"
+{
+ TAO_PSDL_Scope::instance ()->set_scope ();
+ yyval = new TAO_PSDL_Except_Dcl (yyvsp[-2]);
+ ;
+ break;}
+case 227:
+#line 907 "PSDL.yy"
+{
+ int good_op_dcl_name = TAO_PSDL_Scope::instance ()->pop_top_scope ()->add_op_dcl (TAO_PSDL_Scope::instance ()->get_identifier ());
+
+ if (good_op_dcl_name == -1)
+ YYABORT;
+
+ yyval = yyvsp[0];
+ ;
+ break;}
+case 228:
+#line 918 "PSDL.yy"
+{ TAO_PSDL_Scope::instance ()->set_scope ();
+ yyval = new TAO_PSDL_Op_Dcl (yyvsp[-5], yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 229:
+#line 922 "PSDL.yy"
+{ TAO_PSDL_Scope::instance ()->set_scope ();
+ yyval = new TAO_PSDL_Op_Dcl (yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 230:
+#line 926 "PSDL.yy"
+{ TAO_PSDL_Scope::instance ()->set_scope ();
+ yyval = new TAO_PSDL_Op_Dcl (yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 231:
+#line 930 "PSDL.yy"
+{ TAO_PSDL_Scope::instance ()->set_scope ();
+ yyval = new TAO_PSDL_Op_Dcl (yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 232:
+#line 934 "PSDL.yy"
+{ TAO_PSDL_Scope::instance ()->set_scope ();
+ yyval = new TAO_PSDL_Op_Dcl (yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 233:
+#line 938 "PSDL.yy"
+{ TAO_PSDL_Scope::instance ()->set_scope ();
+ yyval = new TAO_PSDL_Op_Dcl (yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 234:
+#line 942 "PSDL.yy"
+{ TAO_PSDL_Scope::instance ()->set_scope ();
+ yyval = new TAO_PSDL_Op_Dcl (yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 235:
+#line 947 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_ONEWAY); ;
+ break;}
+case 236:
+#line 951 "PSDL.yy"
+{ yyval = new TAO_PSDL_Op_Type_Spec (yyvsp[0]); ;
+ break;}
+case 237:
+#line 954 "PSDL.yy"
+{ yyval = new TAO_PSDL_Op_Type_Spec (TAO_PSDL_VOID); ;
+ break;}
+case 238:
+#line 958 "PSDL.yy"
+{ yyval = new TAO_PSDL_Parameter_Dcls (yyvsp[-1]); ;
+ break;}
+case 239:
+#line 961 "PSDL.yy"
+{ yyval = new TAO_PSDL_Parameter_Dcls (); ;
+ break;}
+case 240:
+#line 965 "PSDL.yy"
+{ yyval = new TAO_PSDL_Param_Dcl (yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 241:
+#line 968 "PSDL.yy"
+{ yyval = new TAO_PSDL_Param_Dcl (yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 242:
+#line 972 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_IN); ;
+ break;}
+case 243:
+#line 975 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_OUT); ;
+ break;}
+case 244:
+#line 978 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_INOUT); ;
+ break;}
+case 245:
+#line 982 "PSDL.yy"
+{ yyval = new TAO_PSDL_Raises_Expr (yyvsp[-1]); ;
+ break;}
+case 246:
+#line 985 "PSDL.yy"
+{ yyval = new TAO_PSDL_Raises_Expr (yyvsp[-3], yyvsp[-2]); ;
+ break;}
+case 247:
+#line 989 "PSDL.yy"
+{ yyval = new TAO_PSDL_Context_Expr (yyvsp[-1]); ;
+ break;}
+case 248:
+#line 993 "PSDL.yy"
+{ yyval = new TAO_PSDL_Param_Type_Spec (yyvsp[0]); ;
+ break;}
+case 249:
+#line 996 "PSDL.yy"
+{ yyval = new TAO_PSDL_Param_Type_Spec (yyvsp[0]); ;
+ break;}
+case 250:
+#line 999 "PSDL.yy"
+{ yyval = new TAO_PSDL_Param_Type_Spec (yyvsp[0]); ;
+ break;}
+case 251:
+#line 1002 "PSDL.yy"
+{ yyval = new TAO_PSDL_Param_Type_Spec (yyvsp[0]); ;
+ break;}
+case 252:
+#line 1006 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (yyvsp[-3], yyvsp[-1]); ;
+ break;}
+case 253:
+#line 1010 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 254:
+#line 1014 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 255:
+#line 1018 "PSDL.yy"
+{ yyval = new TAO_PSDL_Constr_Forward_Decl (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 256:
+#line 1021 "PSDL.yy"
+{ yyval = new TAO_PSDL_Constr_Forward_Decl (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 257:
+#line 1025 "PSDL.yy"
+{ yyval = new TAO_PSDL_Interface (yyvsp[0]); ;
+ break;}
+case 258:
+#line 1028 "PSDL.yy"
+{ yyval = new TAO_PSDL_Interface (yyvsp[0]); ;
+ break;}
+case 259:
+#line 1032 "PSDL.yy"
+{
+ TAO_PSDL_Scope::instance ()->set_interface_scope ();
+ yyval = new TAO_PSDL_Interface_Dcl (yyvsp[-3], yyvsp[-1]);
+ ;
+ break;}
+case 260:
+#line 1038 "PSDL.yy"
+{
+ TAO_PSDL_Scope::instance ()->set_interface_scope ();
+ yyval = new TAO_PSDL_Interface_Dcl (yyvsp[-2]);
+ ;
+ break;}
+case 261:
+#line 1045 "PSDL.yy"
+{ yyval = new TAO_PSDL_Forward_Dcl (TAO_PSDL_ABSTRACT, yyvsp[0]); ;
+ break;}
+case 262:
+#line 1048 "PSDL.yy"
+{ yyval = new TAO_PSDL_Forward_Dcl (TAO_PSDL_LOCAL, yyvsp[0]); ;
+ break;}
+case 263:
+#line 1051 "PSDL.yy"
+{ yyval = new TAO_PSDL_Forward_Dcl (yyvsp[0]); ;
+ break;}
+case 264:
+#line 1055 "PSDL.yy"
+{
+ int good_interface_name = TAO_PSDL_Scope::instance ()->pop_top_scope ()->add_interface (TAO_PSDL_Scope::instance ()->get_identifier ());
+ if (good_interface_name == -1)
+ YYABORT;
+
+ yyval = yyvsp[0];
+ ;
+ break;}
+case 265:
+#line 1065 "PSDL.yy"
+{ yyval = new TAO_PSDL_Interface_Header (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 266:
+#line 1068 "PSDL.yy"
+{ yyval = new TAO_PSDL_Interface_Header (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 267:
+#line 1071 "PSDL.yy"
+{ yyval = new TAO_PSDL_Interface_Header (yyvsp[0]); ;
+ break;}
+case 268:
+#line 1074 "PSDL.yy"
+{ yyval = new TAO_PSDL_Interface_Header (yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 269:
+#line 1077 "PSDL.yy"
+{ yyval = new TAO_PSDL_Interface_Header (yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 270:
+#line 1080 "PSDL.yy"
+{ yyval = new TAO_PSDL_Interface_Header (yyvsp[0], yyvsp[-1]); ;
+ break;}
+case 271:
+#line 1084 "PSDL.yy"
+{ yyval = new TAO_PSDL_Interface_Body (yyvsp[0]); ;
+ break;}
+case 272:
+#line 1087 "PSDL.yy"
+{ yyval = new TAO_PSDL_Interface_Body (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 273:
+#line 1091 "PSDL.yy"
+{ yyval = new TAO_PSDL_Export_Dcl (yyvsp[-1]); ;
+ break;}
+case 274:
+#line 1094 "PSDL.yy"
+{ yyval = new TAO_PSDL_Export_Dcl (yyvsp[-1]); ;
+ break;}
+case 275:
+#line 1097 "PSDL.yy"
+{ yyval = new TAO_PSDL_Export_Dcl (yyvsp[-1]); ;
+ break;}
+case 276:
+#line 1100 "PSDL.yy"
+{ yyval = new TAO_PSDL_Export_Dcl (yyvsp[-1]); ;
+ break;}
+case 277:
+#line 1103 "PSDL.yy"
+{ yyval = new TAO_PSDL_Export_Dcl (yyvsp[-1]); ;
+ break;}
+case 278:
+#line 1108 "PSDL.yy"
+{ yyval = new TAO_PSDL_Interface_Inheritance_Spec (yyvsp[0]); ;
+ break;}
+case 279:
+#line 1112 "PSDL.yy"
+{ yyval = new TAO_PSDL_Interface_Name (yyvsp[0]); ;
+ break;}
+case 280:
+#line 1115 "PSDL.yy"
+{ yyval = new TAO_PSDL_Interface_Name (yyvsp[-2], yyvsp[-1]); ;
+ break;}
+case 281:
+#line 1119 "PSDL.yy"
+{ yyval = new TAO_PSDL_Scoped_Name (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 282:
+#line 1122 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 283:
+#line 1126 "PSDL.yy"
+{ yyval = new TAO_PSDL_Scoped_Name (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 284:
+#line 1129 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 285:
+#line 1133 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value (yyvsp[0]); ;
+ break;}
+case 286:
+#line 1136 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value (yyvsp[0]); ;
+ break;}
+case 287:
+#line 1139 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value (yyvsp[0]); ;
+ break;}
+case 288:
+#line 1142 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value (yyvsp[0]); ;
+ break;}
+case 289:
+#line 1146 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Common_Base (yyvsp[0]); ;
+ break;}
+case 290:
+#line 1150 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Forward_Dcl (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 291:
+#line 1153 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Forward_Dcl (yyvsp[0]); ;
+ break;}
+case 292:
+#line 1157 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Box_Dcl (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 293:
+#line 1161 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Abs_Dcl (yyvsp[-4], yyvsp[-3], yyvsp[-1]); ;
+ break;}
+case 294:
+#line 1164 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Abs_Dcl (yyvsp[-3], yyvsp[-1]); ;
+ break;}
+case 295:
+#line 1168 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Dcl (yyvsp[-3], yyvsp[-1]); ;
+ break;}
+case 296:
+#line 1172 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Header (yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 297:
+#line 1175 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Header (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 298:
+#line 1178 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Header (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 299:
+#line 1182 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Inheritance_Spec (yyvsp[-3], yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 300:
+#line 1185 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Inheritance_Spec (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 301:
+#line 1188 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Inheritance_Spec (yyvsp[0]); ;
+ break;}
+case 302:
+#line 1191 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Inheritance_Spec (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 303:
+#line 1194 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Inheritance_Spec (yyvsp[0]); ;
+ break;}
+case 304:
+#line 1199 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_STRING, yyvsp[-1]); ;
+ break;}
+case 305:
+#line 1202 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_STRING); ;
+ break;}
+case 306:
+#line 1206 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (yyvsp[-1]); ;
+ break;}
+case 307:
+#line 1209 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 308:
+#line 1213 "PSDL.yy"
+{ yyval = new TAO_PSDL_Array_Declarator (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 309:
+#line 1217 "PSDL.yy"
+{ yyval = new TAO_PSDL_Fixed_Array_Size (yyvsp[-1]); ;
+ break;}
+case 310:
+#line 1221 "PSDL.yy"
+{ yyval = new TAO_PSDL_Attr_Dcl (TAO_PSDL_READONLY, yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 311:
+#line 1224 "PSDL.yy"
+{ yyval = new TAO_PSDL_Attr_Dcl (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 312:
+#line 1228 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_ENUM, yyvsp[-3], yyvsp[-1]); ;
+ break;}
+case 313:
+#line 1232 "PSDL.yy"
+{ yyval = new TAO_PSDL_Enumerator (yyvsp[0]); ;
+ break;}
+case 314:
+#line 1235 "PSDL.yy"
+{ yyval = new TAO_PSDL_Enumerator (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 315:
+#line 1239 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_SEQUENCE, yyvsp[-3], yyvsp[-1]); ;
+ break;}
+case 316:
+#line 1242 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_SEQUENCE, yyvsp[-1]); ;
+ break;}
+case 317:
+#line 1246 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 318:
+#line 1249 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 319:
+#line 1252 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 320:
+#line 1255 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 321:
+#line 1258 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 322:
+#line 1261 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 323:
+#line 1264 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 324:
+#line 1267 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 325:
+#line 1271 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 326:
+#line 1274 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 327:
+#line 1278 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 328:
+#line 1282 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 329:
+#line 1286 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 330:
+#line 1290 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 331:
+#line 1294 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 332:
+#line 1298 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 333:
+#line 1302 "PSDL.yy"
+{ yyval = yyvsp[0]; ;
+ break;}
+case 334:
+#line 1306 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Name (yyvsp[0]); ;
+ break;}
+case 335:
+#line 1309 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Name (yyvsp[-2], yyvsp[0]); ;
+ break;}
+case 336:
+#line 1313 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Element (yyvsp[0]); ;
+ break;}
+case 337:
+#line 1316 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Element (yyvsp[0]); ;
+ break;}
+case 338:
+#line 1319 "PSDL.yy"
+{ yyval = new TAO_PSDL_Value_Element (yyvsp[0]); ;
+ break;}
+case 339:
+#line 1323 "PSDL.yy"
+{ yyval = new TAO_PSDL_State_Member (yyvsp[-3], yyvsp[-2], yyvsp[-1]); ;
+ break;}
+case 340:
+#line 1326 "PSDL.yy"
+{ yyval = new TAO_PSDL_State_Member (yyvsp[-3], yyvsp[-2], yyvsp[-1]); ;
+ break;}
+case 341:
+#line 1330 "PSDL.yy"
+{ yyval = new TAO_PSDL_Init_Dcl (yyvsp[-4], yyvsp[-2]); ;
+ break;}
+case 342:
+#line 1333 "PSDL.yy"
+{ yyval = new TAO_PSDL_Init_Dcl (yyvsp[-3]); ;
+ break;}
+case 343:
+#line 1337 "PSDL.yy"
+{ yyval = new TAO_PSDL_Init_Param_Decls (yyvsp[0]); ;
+ break;}
+case 344:
+#line 1340 "PSDL.yy"
+{ yyval = new TAO_PSDL_Init_Param_Decls (yyvsp[-2], yyvsp[-1]); ;
+ break;}
+case 345:
+#line 1344 "PSDL.yy"
+{ yyval = new TAO_PSDL_Init_Param_Decl (yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 346:
+#line 1348 "PSDL.yy"
+{ yyval = new TAO_PSDL_Predefined_Type (TAO_PSDL_IN); ;
+ break;}
+case 347:
+#line 1352 "PSDL.yy"
+{ yyval = new TAO_PSDL_Positive_Int_Const (yyvsp[0]); ;
+ break;}
+case 348:
+#line 1356 "PSDL.yy"
+{ yyval = new TAO_PSDL_Factory_Dcl (yyvsp[-1], yyvsp[0]); ;
+ break;}
+case 349:
+#line 1360 "PSDL.yy"
+{ yyval = new TAO_PSDL_Factory_Parameters (yyvsp[-1]); ;
+ break;}
+case 350:
+#line 1363 "PSDL.yy"
+{ yyval = new TAO_PSDL_Factory_Parameters (); ;
+ break;}
+}
+
+#line 705 "/usr/share/bison/bison.simple"
+
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+#if YYLSP_NEEDED
+ yylsp -= yylen;
+#endif
+
+#if YYDEBUG
+ if (yydebug)
+ {
+ short *yyssp1 = yyss - 1;
+ YYFPRINTF (stderr, "state stack now");
+ while (yyssp1 != yyssp)
+ YYFPRINTF (stderr, " %d", *++yyssp1);
+ YYFPRINTF (stderr, "\n");
+ }
+#endif
+
+ *++yyvsp = yyval;
+#if YYLSP_NEEDED
+ *++yylsp = yyloc;
+#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. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+ if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTBASE];
+
+ goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+ /* If not already recovering from an error, report this error. */
+ if (!yyerrstatus)
+ {
+ ++yynerrs;
+
+#ifdef YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+ if (yyn > YYFLAG && yyn < YYLAST)
+ {
+ YYSIZE_T yysize = 0;
+ char *yymsg;
+ int yyx, yycount;
+
+ yycount = 0;
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ for (yyx = yyn < 0 ? -yyn : 0;
+ yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
+ if (yycheck[yyx + yyn] == yyx)
+ yysize += yystrlen (yytname[yyx]) + 15, yycount++;
+ yysize += yystrlen ("parse error, unexpected ") + 1;
+ yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
+ yymsg = (char *) YYSTACK_ALLOC (yysize);
+ if (yymsg != 0)
+ {
+ char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
+ yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
+
+ if (yycount < 5)
+ {
+ yycount = 0;
+ for (yyx = yyn < 0 ? -yyn : 0;
+ yyx < (int) (sizeof (yytname) / sizeof (char *));
+ yyx++)
+ if (yycheck[yyx + yyn] == yyx)
+ {
+ const char *yyq = ! yycount ? ", expecting " : " or ";
+ yyp = yystpcpy (yyp, yyq);
+ yyp = yystpcpy (yyp, yytname[yyx]);
+ yycount++;
+ }
+ }
+ yyerror (yymsg);
+ YYSTACK_FREE (yymsg);
+ }
+ else
+ yyerror ("parse error; also virtual memory exhausted");
+ }
+ else
+#endif /* defined (YYERROR_VERBOSE) */
+ yyerror ("parse error");
+ }
+ goto yyerrlab1;
+
+
+/*--------------------------------------------------.
+| yyerrlab1 -- error raised explicitly by an action |
+`--------------------------------------------------*/
+yyerrlab1:
+ if (yyerrstatus == 3)
+ {
+ /* If just tried and failed to reuse lookahead token after an
+ error, discard it. */
+
+ /* return failure if at end of input */
+ if (yychar == YYEOF)
+ YYABORT;
+ YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
+ yychar, yytname[yychar1]));
+ yychar = YYEMPTY;
+ }
+
+ /* Else will try to reuse lookahead token after shifting the error
+ token. */
+
+ yyerrstatus = 3; /* Each real token shifted decrements this */
+
+ goto yyerrhandle;
+
+
+/*-------------------------------------------------------------------.
+| yyerrdefault -- current state does not do anything special for the |
+| error token. |
+`-------------------------------------------------------------------*/
+yyerrdefault:
+#if 0
+ /* This is wrong; only states that explicitly want error tokens
+ should shift them. */
+
+ /* If its default is to accept any token, ok. Otherwise pop it. */
+ yyn = yydefact[yystate];
+ if (yyn)
+ goto yydefault;
+#endif
+
+
+/*---------------------------------------------------------------.
+| yyerrpop -- pop the current state because it cannot handle the |
+| error token |
+`---------------------------------------------------------------*/
+yyerrpop:
+ if (yyssp == yyss)
+ YYABORT;
+ yyvsp--;
+ yystate = *--yyssp;
+#if YYLSP_NEEDED
+ yylsp--;
+#endif
+
+#if YYDEBUG
+ if (yydebug)
+ {
+ short *yyssp1 = yyss - 1;
+ YYFPRINTF (stderr, "Error: state stack now");
+ while (yyssp1 != yyssp)
+ YYFPRINTF (stderr, " %d", *++yyssp1);
+ YYFPRINTF (stderr, "\n");
+ }
+#endif
+
+/*--------------.
+| yyerrhandle. |
+`--------------*/
+yyerrhandle:
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yyerrdefault;
+
+ yyn += YYTERROR;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+ goto yyerrdefault;
+
+ yyn = yytable[yyn];
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrpop;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrpop;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ YYDPRINTF ((stderr, "Shifting error token, "));
+
+ *++yyvsp = yylval;
+#if YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here. |
+`-------------------------------------*/
+yyacceptlab:
+ yyresult = 0;
+ goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here. |
+`-----------------------------------*/
+yyabortlab:
+ yyresult = 1;
+ goto yyreturn;
+
+/*---------------------------------------------.
+| yyoverflowab -- parser overflow comes here. |
+`---------------------------------------------*/
+yyoverflowlab:
+ yyerror ("parser stack overflow");
+ yyresult = 2;
+ /* Fall through. */
+
+yyreturn:
+#ifndef yyoverflow
+ if (yyss != yyssa)
+ YYSTACK_FREE (yyss);
+#endif
+ return yyresult;
+}
+#line 1365 "PSDL.yy"
diff --git a/TAO/orbsvcs/PSS/PSDL_y.h b/TAO/orbsvcs/PSS/PSDL_y.h
new file mode 100644
index 00000000000..6ce00a83aed
--- /dev/null
+++ b/TAO/orbsvcs/PSS/PSDL_y.h
@@ -0,0 +1,93 @@
+// $Id$
+# define TAO_PSDL_SEMI 257
+# define TAO_PSDL_MODULE 258
+# define TAO_PSDL_COLON 259
+# define TAO_PSDL_OPEN_CURLY_BRACE 260
+# define TAO_PSDL_CLOSE_CURLY_BRACE 261
+# define TAO_PSDL_OPEN_BRACE 262
+# define TAO_PSDL_CLOSE_BRACE 263
+# define TAO_PSDL_ABSTRACT 264
+# define TAO_PSDL_STORAGETYPE 265
+# define TAO_PSDL_STORAGEHOME 266
+# define TAO_PSDL_CATALOG 267
+# define TAO_PSDL_PROVIDES 268
+# define TAO_PSDL_IMPLEMENTS 269
+# define TAO_PSDL_SCOPE 270
+# define TAO_PSDL_STORES 271
+# define TAO_PSDL_STATE 272
+# define TAO_PSDL_AS 273
+# define TAO_PSDL_PRIMARY 274
+# define TAO_PSDL_STRONG 275
+# define TAO_PSDL_REF 276
+# define TAO_PSDL_OF 277
+# define TAO_PSDL_OPEN_ANGULAR_BRACE 278
+# define TAO_PSDL_CLOSE_ANGULAR_BRACE 279
+# define TAO_PSDL_COMMA 280
+# define TAO_PSDL_KEY 281
+# define TAO_PSDL_READONLY 282
+# define TAO_PSDL_UNION 283
+# define TAO_PSDL_SWITCH 284
+# define TAO_PSDL_CASE 285
+# define TAO_PSDL_WCHAR 286
+# define TAO_PSDL_BOOLEAN 287
+# define TAO_PSDL_OCTET 288
+# define TAO_PSDL_ANY 289
+# define TAO_PSDL_OBJECT 290
+# define TAO_PSDL_STRUCT 291
+# define TAO_PSDL_DEFAULT 292
+# define TAO_PSDL_FLOAT 293
+# define TAO_PSDL_DOUBLE 294
+# define TAO_PSDL_LONG 295
+# define TAO_PSDL_SHORT 296
+# define TAO_PSDL_UNSIGNED 297
+# define TAO_PSDL_CHAR 298
+# define TAO_PSDL_IDENT 299
+# define TAO_PSDL_TYPEDEF 300
+# define TAO_PSDL_NATIVE 301
+# define TAO_PSDL_PLUS 302
+# define TAO_PSDL_MINUS 303
+# define TAO_PSDL_XOR 304
+# define TAO_PSDL_AND 305
+# define TAO_PSDL_MULT 306
+# define TAO_PSDL_RIGHT_SHIFT 307
+# define TAO_PSDL_LEFT_SHIFT 308
+# define TAO_PSDL_DIV 309
+# define TAO_PSDL_PERCENT 310
+# define TAO_PSDL_TILDA 311
+# define TAO_PSDL_ONEWAY 312
+# define TAO_PSDL_CONST 313
+# define TAO_PSDL_EQUAL 314
+# define TAO_PSDL_OR 315
+# define TAO_PSDL_VOID 316
+# define TAO_PSDL_IN 317
+# define TAO_PSDL_OUT 318
+# define TAO_PSDL_INOUT 319
+# define TAO_PSDL_RAISES 320
+# define TAO_PSDL_CONTEXT 321
+# define TAO_PSDL_FIXED 322
+# define TAO_PSDL_VALUEBASE 323
+# define TAO_PSDL_EXCEPTION 324
+# define TAO_PSDL_INTERFACE 325
+# define TAO_PSDL_LOCAL 326
+# define TAO_PSDL_DOUBLE_COLON 327
+# define TAO_PSDL_VALUETYPE 328
+# define TAO_PSDL_CUSTOM 329
+# define TAO_PSDL_TRUNCATABLE 330
+# define TAO_PSDL_SUPPORTS 331
+# define TAO_PSDL_STRING 332
+# define TAO_PSDL_WSTRING 333
+# define TAO_PSDL_ATTRIBUTE 334
+# define TAO_PSDL_OPEN_SQUARE_BRACE 335
+# define TAO_PSDL_CLOSE_SQUARE_BRACE 336
+# define TAO_PSDL_ENUM 337
+# define TAO_PSDL_SEQUENCE 338
+# define TAO_PSDL_TRUE 339
+# define TAO_PSDL_FALSE 340
+# define TAO_PSDL_INTEGER 341
+# define TAO_PSDL_FLOATING 342
+# define TAO_PSDL_PRIVATE 343
+# define TAO_PSDL_PUBLIC 344
+# define TAO_PSDL_FACTORY 345
+# define TAO_PSDL_FLOATING_PT 346
+# define TAO_PSDL_CHAR_LITERAL 347
+# define TAO_PSDL_FIXED_PT 348
diff --git a/TAO/orbsvcs/PSS/README b/TAO/orbsvcs/PSS/README
new file mode 100644
index 00000000000..106a07c5dd5
--- /dev/null
+++ b/TAO/orbsvcs/PSS/README
@@ -0,0 +1,261 @@
+
+ Persistence State Service
+ -------------------------
+
+ The Persistent State Service (PSS) provides a standard way to
+persistently save the state of objects in a datastore. A datastore is
+an entity that manages data like a database or a set of files. For
+TAO's implementation of PSS, the datastore is a normal file, for now.
+
+ The PSS defines two ways to define the datastore schema and
+the interfaces to the storage object instances in the datastore. One
+way is to use the Persistent State Definition Language (PSDL). PSDL
+language is a superset to the IDL language and introduces four new
+constructs: storagehome, storagetype, abstract storagehome and
+abstract storagetype. A PSDL file (which is similar to an IDL file)
+contain the definitions which describe the interface to the
+datastore. This psdl interface and the datastore is visible only to
+the server which saves the state of objects. The clients to this
+server do not idea about how the server saves the state of the
+objects and hence have no idea about the psdl interface or the
+datastore.
+
+ The PSS implementation provides a compiler tool to process
+the psdl file and generates stubs (I will use the name 'stub' just for
+the lack of any other name.. though this stub is not the same as the
+normal stub that is generated by the IDL compiler).
+
+ PSDL Compiler
+ =============
+
+ TAO's implementation of the PSS provides psdl_tao as the
+compiler to
+
+Design
+======
+
+ The Input file (of format pidl) is first parsed with the
+yacc-lex parser. The TAO_PSDL_Interpreter has a method (build_tree)
+which helps construct an expression tree representing nodes from the
+tokens returned by the Yacc generated parser. In addition, based on
+the grammar set in PSDL.yy, any syntax errors are checked by the yacc
+parser. Using the '-b' (build-tree) option, you can print out the
+generated parse-tree for debugging purposes. All the classes in
+PSDL_Node help build the parse tree.
+(@@ To-do: I should be adding an option to the executable so that the
+parse tree can be printed out when the option is set.)
+
+ Along with the basic parsing, we build the symbol
+table. The TAO_PSDL_Scope class is the base class which helps add each
+type (like interface, exceptions etc) to the symbol table.
+
+ The symbol table is constructed using the ACE hash maps.
+We use two kinds of hash-maps...one maps the identifier to a
+structure (Node_Info) which has information about the identifier
+(identifier_type, module_name & interface_name (module and interfaces
+to which this identifier belongs). This is used in cases where in the
+identifier doesnt have some members in itself.. constant declarations,
+typedefs, exceptions with no members etc.
+
+ Unlike a simple declaration or a typedef, types like
+interfaces have member declarations which come with their scope. For
+example, an interface has its own set of declarations, methods,
+interfaces etc. For such types, we will have a class derived from
+base TAO_PDSL_Scope. [In the case of interfaces, it is
+TAO_PSDL_Interface_Scope.] The second hash map is to
+map the identifier and the instance of the identifier's
+type... i.e. say the identifier is of type interface, this hash-map
+has a mapping between the identifier and the pointer to the instance
+of TAO_PSDL_Interface_Scope. [All the TAO_PSDL_*_Scope classes fall in
+this category.]
+
+ In this phase, along with building the symbol table, we also
+do the semantic checking. Semantic checking includes checking if an
+identifier that is declared before is now being redeclared.
+Identifiers are case-sensitive and case-insensitive too...
+ie. for ex: You cannot have CosNaming and cosnaming.
+
+ After the symbol tables are built, the next step is to
+generate code in to the stubs. The classes TAO_PSDL_*_Visitor generates
+this code. TAO_PSDL_Node_Visitor is the base class and the derived
+classes override the necessary methods. So, if you want to generate
+for some other type in future, we need to have another of
+TAO_PSDL_*_Visitor class and override the necessary virtual method.
+
+
+Implementation files of the stubs (idlC.cpp)
+=================================
+
+ The generation of the header and implementation files
+for the stubs can be done in a single pass. The implementation files
+mainly involves the '<<' and '>>' operator support. These operators
+support will be mainly useful while marshalling and demarshalling the
+data types.
+
+
+
+
+Status in a summary.
+=======
+
+1. Can parse any psdl file.
+2. Does syntax checking.
+3. Can build parse tree for most but not all of the types.
+4. Builds ASTs for the basic types which includes typedefs,
+ interfaces, structs, modules, exceptions, constant declarations.
+5. Generate the code that goes into the header file for the same types
+ listed above.
+
+
+Files and Description
+=====================
+
+PSDL.yy Yacc file which has the PSDL grammar.
+
+PSDL_y.cpp
+PSDL_y.h Yacc generated files.
+
+PSDL_l.cpp Lex generated file.
+
+PSDL_Node.h
+PSDL_Node.cpp Each node in the parse tree is derived from
+ the base type TAO_PSDL_Node. The classes in
+ this file provide the interface for the
+ different types. Each class will have accessor
+ methods to access the private members and an
+ accept method to invoke the corresponding
+ visitor method. (We are applying the visitor
+ pattern here.)
+
+
+PSDL_Scope.h
+PSDL_Scope.cpp
+PSDL_*_Scope.* The classes in these files are useful for
+ building the AST. TAO_PSDL_Scope is the base
+ class and there are classes for each type
+ (which has members in it, ex: interface)
+ which needs to be added to the AST which
+ derive from TAO_PSDL_Scope.
+
+PSDL_Node_Visitor.h
+PSDL_Node_Visitor.cpp
+PSDL_*_Visitor.* TAO_PSDL_Node_Visitor acts as a base class
+ useful for generating code into
+ stubs. TAO_PDSL_Node_Visitor derives from
+ TAO_PSDL_Scope_Visitor. The sub-classes (for
+ the different types) which
+ need to override the basic functionality of
+ the visitor methods in TAO_PSDL_Node_Visitor
+ derive from it and override accordingly. The
+derived classes methods are invoked from the base class as needed
+making use of the factory pattern (TAO_PSDL_Visitor_Factory).
+
+
+To-Do
+====
+
+1. The visitor classes should generate the code into a file and not to
+ stdout as I am doing now.
+
+2. Support for comments , pragmas etc. Right now, if you have
+ comments or pragmas, its going to fail.
+
+Test
+====
+
+% ./psdl_tao < trial_idl.idl
+
+
+Things to do
+============
+
+
+1. Have a test to include all the existing types. Should check the
+ generated code and check if it is the right thing. - 2 days
+
+2. Work on the stubs.
+ . Redirect the output to a file rather than to stdout.
+ . Work on the implementation files (*C.cpp). This will be based on
+ ACE Reliable Multicast framework.
+ ps: Bala told last friday that ACE Reliable Multicast Framework
+ has several bugs. So, this might end up taking longer. FYI,
+
+ - 2 weeks.
+
+3. Have a test/example for the total framework. 1 week- 10 days
+
+ - Have an application which is going to use the PSS framework.. have a server etc.
+
+4. Additional Documentation as needed including
+ . Steps for modifying the existing services to use PSS. 1 week.
+
+
+5. Include support for all the types in PSDL language in all the
+ stages which includes mainly
+ . Building the parse tree
+ . While building ASTs
+ . Generating the stubs.
+
+6. Extend the tests to include all the new types.
+
+
+
+IMR
+===
+
+1. Test
+
+2. Documentation abt the differences between old and new IMR.
+3. How to update/migrate to the new IMR.
+
+4. Code review. 2 days
+5. modift 2 days.
+
+
+MInor things
+============
+
+1. Print out the Caps of the names
+
+#if !defined (_TRIAL_INTERFACE___PTR_CH_)
+
+instead of
+
+#if !defined (__trial_interface___PTR_CH_)
+
+
+2. Check out TAO_NAMESPACE_STORAGE_CLASS and static nad extern storage classes before _tc_*
+
+
+Notes on how to proceed
+=======================
+
+1. Serialize the data using TAO_OutputCDR.
+
+The implementation files should have the '<<' and '>>' methods.
+
+2. There needs to be another executable or library which would be
+actually saving the state of objects to the database. Since RMCast is
+not working right now, we can save the data to a file and retrieve
+from it.
+
+
+Example
+=======
+
+1. Have a mini naming idl which just has the bind and find functions
+ support.
+
+ There can be just a server.cpp which will bind information.
+
+2. Have a psdl interface which has a
+
+ sequence of struct (name,
+ stringified_ior).
+
+ When a bind is done, it has to be going through the helper
+classes and inserted into a hash_map and saved to the file. And when
+find is invoked, it has to be read from the file and demarshalled.
+
+
+
diff --git a/TAO/orbsvcs/PSS/psdl_export.h b/TAO/orbsvcs/PSS/psdl_export.h
new file mode 100644
index 00000000000..19409b8a680
--- /dev/null
+++ b/TAO/orbsvcs/PSS/psdl_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_PSDL_EXPORT_H
+#define TAO_PSDL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_PSDL_HAS_DLL)
+# define TAO_PSDL_HAS_DLL 0
+# endif /* ! TAO_PSDL_HAS_DLL */
+#else
+#if !defined (TAO_PSDL_HAS_DLL)
+# define TAO_PSDL_HAS_DLL 1
+#endif /* ! TAO_PSDL_HAS_DLL */
+#endif /* TAO_AS_STATIC_LIBS */
+
+#if defined (TAO_PSDL_HAS_DLL) && (TAO_PSDL_HAS_DLL == 1)
+# if defined (TAO_PSDL_BUILD_DLL)
+# define TAO_PSDL_Export ACE_Proper_Export_Flag
+# define TAO_PSDL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_PSDL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_PSDL_BUILD_DLL */
+# define TAO_PSDL_Export ACE_Proper_Import_Flag
+# define TAO_PSDL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_PSDL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_PSDL_BUILD_DLL */
+#else /* TAO_PSDL_HAS_DLL == 1 */
+# define TAO_PSDL_Export
+# define TAO_PSDL_SINGLETON_DECLARATION(T)
+# define TAO_PSDL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_PSDL_HAS_DLL == 1 */
+
+#endif /* TAO_PSDL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/PSS/psdl_tao.cpp b/TAO/orbsvcs/PSS/psdl_tao.cpp
new file mode 100644
index 00000000000..48491264b97
--- /dev/null
+++ b/TAO/orbsvcs/PSS/psdl_tao.cpp
@@ -0,0 +1,65 @@
+// $Id$
+
+#include "PSDL_Scope.h"
+#include "PSDL_Extern.h"
+#include "Dump_Visitor.h"
+
+int main (int argc, char *argv [])
+{
+ void *result_ptr = 0;
+
+ TAO_PSDL_Extern psdl_extern;
+
+ if (argc < 2)
+ psdl_extern.TAO_PSDL_Extern_yyin (stdin);
+ else
+ psdl_extern.TAO_PSDL_Extern_yyin (ACE_OS::fopen (argv[1], "r"));
+
+ ACE_OS::strtok (argv[1], ".");
+
+ TAO_PSDL_Scope::instance ()->set_stub_prefix (argv[1]);
+ TAO_PSDL_Scope::instance ()->set_root_scope ();
+
+ // The syntax is checked and ASTs are build.
+ int result = psdl_extern.TAO_PSDL_Extern_yyparse (result_ptr);
+
+ if (result != 0)
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "Error in yyparse\n"));
+ return -1;
+ }
+
+ TAO_PSDL_Node *tree_node = psdl_extern.TAO_PSDL_Extern_yyval ();
+
+ // The following segment of the code is for printing out a parse
+ // tree. To-Do: have a parse option so that
+ // the parse tree will be printed out when that option is used.
+ // {@@
+ /*Dump_Visitor visitor (0);
+
+ int result_visitor = tree_node->accept (&visitor);
+
+ if (result_visitor != 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Error in creating the parse tree\n"));
+ // @@}
+ */
+
+ // This segment is responsible for generating code
+ // for the stubs.
+ // {@@
+ TAO_PSDL_Node_Visitor node_visitor;
+
+ result = tree_node->accept (&node_visitor);
+
+ if (result != 0)
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "Error in writing the stubs\n"));
+ return -1;
+ }
+ // @@}
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/Scheduling_Service/.cvsignore b/TAO/orbsvcs/Scheduling_Service/.cvsignore
new file mode 100644
index 00000000000..2239af45a8c
--- /dev/null
+++ b/TAO/orbsvcs/Scheduling_Service/.cvsignore
@@ -0,0 +1 @@
+Scheduling_Service
diff --git a/TAO/orbsvcs/Scheduling_Service/Makefile.am b/TAO/orbsvcs/Scheduling_Service/Makefile.am
new file mode 100644
index 00000000000..bb32c5e219f
--- /dev/null
+++ b/TAO/orbsvcs/Scheduling_Service/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.Scheduling_Service.am
+
+bin_PROGRAMS = Scheduling_Service
+
+Scheduling_Service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+Scheduling_Service_SOURCES = \
+ Scheduling_Service.cpp \
+ Scheduling_Service.h
+
+Scheduling_Service_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(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/Scheduling_Service/Scheduling_Service.cpp b/TAO/orbsvcs/Scheduling_Service/Scheduling_Service.cpp
new file mode 100644
index 00000000000..83e325bcde7
--- /dev/null
+++ b/TAO/orbsvcs/Scheduling_Service/Scheduling_Service.cpp
@@ -0,0 +1,303 @@
+// $Id$
+
+#include "Scheduling_Service.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/Argv_Type_Converter.h"
+#include "orbsvcs/CosNamingC.h"
+#include "ace/OS_main.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_strings.h"
+
+ACE_RCSID (Scheduling_Service,
+ Scheduling_Service,
+ "$Id$")
+
+// Default Constructor.
+
+TAO_Scheduling_Service::TAO_Scheduling_Service (void)
+ : scheduler_impl_ (0),
+ service_name_ ("ScheduleService"),
+ scheduler_type_ (CONFIG)
+{
+}
+
+
+// Constructor taking the command-line arguments.
+
+TAO_Scheduling_Service::TAO_Scheduling_Service (int argc, ACE_TCHAR* argv[])
+ : scheduler_impl_ (0),
+ service_name_ ("ScheduleService"),
+ scheduler_type_ (CONFIG)
+{
+ this->init (argc, argv);
+}
+
+// Destructor.
+
+TAO_Scheduling_Service::~TAO_Scheduling_Service (void)
+{
+}
+
+
+// Initialize the Scheduling Service with the arguments.
+
+int
+TAO_Scheduling_Service::init (int argc, ACE_TCHAR* argv[])
+{
+ int result;
+ CORBA::ORB_var orb;
+ PortableServer::POAManager_ptr poa_manager;
+
+ ACE_TRY_NEW_ENV
+ {
+ // Copy command line parameter.
+ ACE_Argv_Type_Converter command_line(argc, argv);
+
+ // Initialize ORB manager.
+ this->orb_manager_.init (command_line.get_argc(), command_line.get_ASCII_argv() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb = this->orb_manager_.orb ();
+ ACE_TRY_CHECK;
+
+ poa_manager = this->orb_manager_.poa_manager ();
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Check the non-ORB arguments. this needs to come before we
+ // initialize the scheduler implementation so that we know which
+ // type of scheduler to use.
+
+ result = this->parse_args (command_line.get_argc(), command_line.get_TCHAR_argv());
+ if (result < 0)
+ return result;
+
+ // Construct a scheduler implementation of the specified type.
+ switch (this->scheduler_type_)
+ {
+
+// The templatized method parameters needed by the reconfig scheduler
+// class template are hopelessly broken on pre-2.8 versions of g++.
+#if (! defined (__GNUC__)) || (__GNUC__ > 2) || \
+(__GNUC__ == 2 && defined (__GNUC_MINOR__) && __GNUC_MINOR__ >= 8)
+
+ case RECONFIG:
+ ACE_NEW_THROW_EX (scheduler_impl_,
+ RECONFIG_SCHED_TYPE,
+ CORBA::NO_MEMORY ());
+ ACE_TRY_CHECK;
+ break;
+
+#endif /* __GNUC__ */
+
+ case CONFIG:
+ ACE_NEW_THROW_EX (scheduler_impl_,
+ CONFIG_SCHED_TYPE,
+ CORBA::NO_MEMORY ());
+ ACE_TRY_CHECK;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_Scheduling_Service::init: "
+ "unrecognized Scheduler_Type"), -1);
+ }
+
+ // Locate the naming service.
+ 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 locate the Naming Service.\n"),
+ -1);
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecScheduler::Scheduler_var scheduler =
+ this->scheduler_impl_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var scheduler_ior_string =
+ orb->object_to_string (scheduler.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("The scheduler IOR is <%s>\n"),
+ ACE_TEXT_CHAR_TO_TCHAR(scheduler_ior_string.in ())));
+
+ // Register the servant with the Naming Context....
+ CosNaming::Name schedule_name (1);
+ schedule_name.length (1);
+ schedule_name[0].id = CORBA::string_dup (this->service_name_.rep());
+ naming_context->rebind (schedule_name, scheduler.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->ior_file_name_.rep() != 0)
+ {
+ FILE *iorf = fopen (this->ior_file_name_.rep(), "w");
+ if (iorf != 0)
+ {
+ ACE_OS::fprintf (iorf,
+ ACE_TEXT("%s\n"),
+ ACE_TEXT_CHAR_TO_TCHAR(scheduler_ior_string.in ()));
+ ACE_OS::fclose (iorf);
+ }
+ }
+
+ if (this->pid_file_name_.rep() != 0)
+ {
+ FILE *pidf = fopen (this->pid_file_name_.rep(), "w");
+ if (pidf != 0)
+ {
+ ACE_OS::fprintf (pidf,
+ ACE_TEXT("%ld\n"),
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pidf);
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Scheduling_Service::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+
+// Runs the TAO_Scheduling_Service.
+
+int
+TAO_Scheduling_Service::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Run the ORB manager.
+ return this->orb_manager_.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+
+// Parses the command line arguments.
+
+int
+TAO_Scheduling_Service::parse_args (int argc, ACE_TCHAR* argv[])
+{
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("n:p:o:s:"));
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'n':
+ this->service_name_ = ACE_TEXT_ALWAYS_CHAR(get_opt.opt_arg ());
+ break;
+
+ case 'p':
+ this->pid_file_name_ = ACE_TEXT_ALWAYS_CHAR(get_opt.opt_arg ());
+ break;
+
+ case 'o':
+ this->ior_file_name_ = ACE_TEXT_ALWAYS_CHAR(get_opt.opt_arg ());
+ break;
+
+// The templatized method parameters needed by the reconfig scheduler
+// class template are hopelessly broken on pre-2.8 versions of g++.
+#if (! defined (__GNUC__)) || (__GNUC__ > 2) || \
+(__GNUC__ == 2 && defined (__GNUC_MINOR__) && __GNUC_MINOR__ >= 8)
+
+ case 's':
+ if (ACE_OS::strcasecmp (ACE_TEXT("CONFIG"), get_opt.optarg) == 0)
+ {
+ this->scheduler_type_ = CONFIG;
+ }
+ else if (ACE_OS::strcasecmp (ACE_TEXT("RECONFIG"), get_opt.optarg) == 0)
+ {
+ this->scheduler_type_ = RECONFIG;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "[-n service_name] "
+ "[-p pid_file_name] "
+ "[-o ior_file_name] "
+ "[-s <CONFIG | reconfig>]"
+ "\n",
+ argv[0]));
+
+ return -1;
+ }
+ break;
+
+#endif /* __GNUC__ */
+
+ case '?':
+ default:
+
+// The templatized method parameters needed by the reconfig scheduler
+// class template are hopelessly broken on pre-2.8 versions of g++.
+#if (! defined (__GNUC__)) || (__GNUC__ > 2) || \
+(__GNUC__ == 2 && defined (__GNUC_MINOR__) && __GNUC_MINOR__ >= 8)
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "[-n service_name] "
+ "[-p pid_file_name] "
+ "[-o ior_file_name] "
+ "[-s <CONFIG | reconfig>]"
+ "\n",
+ argv[0]));
+
+#else /* __GNUC__ <= 2.8 */
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "[-n service_name] "
+ "[-p pid_file_name] "
+ "[-o ior_file_name] "
+ "\n",
+ argv[0]));
+
+#endif /* __GNUC__ */
+
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int ACE_TMAIN (int argc, ACE_TCHAR* argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ TAO_Scheduling_Service scheduling_service;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "%s; initializing scheduling service\n", __FILE__));
+
+ if (scheduling_service.init (argc, argv) < 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "init"), 1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "%s; running scheduling service\n", __FILE__));
+
+ scheduling_service.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "schedule_service");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/Scheduling_Service/Scheduling_Service.h b/TAO/orbsvcs/Scheduling_Service/Scheduling_Service.h
new file mode 100644
index 00000000000..3ffa5426945
--- /dev/null
+++ b/TAO/orbsvcs/Scheduling_Service/Scheduling_Service.h
@@ -0,0 +1,101 @@
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs/Scheduling_Service/Scheduling_Service
+//
+// = FILENAME
+// Scheduling_Service.h
+//
+// = DESCRIPTION
+// This class implements the functionality of a Scheduling Service in
+// a stand-alone process.
+//
+// = AUTHORS
+// Chris Gill (cdgill@cs.wustl.edu) Based on the original
+// Scheduling Service program by David Levine
+// (levine@cs.wustl.edu) and Carlos O'Ryan (coryan@cs.wustl.edu),
+// and on the Naming Service program implementation by Marina
+// Spivak (marina@cs.wustl.edu) and Nagarajan Surendran
+// (naga@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef TAO_SCHEDULING_SERVICE_H
+#define TAO_SCHEDULING_SERVICE_H
+
+#include "tao/Utils/ORB_Manager.h"
+#include "orbsvcs/Sched/Reconfig_Scheduler.h"
+#if defined (TAO_USES_STRATEGY_SCHEDULER)
+#include "orbsvcs/Sched/Strategy_Scheduler.h"
+#endif /* defined (TAO_USES_STRATEGY_SCHEDULER) */
+#include "orbsvcs/Sched/Config_Scheduler.h"
+#include "ace/SString.h"
+
+class TAO_Scheduling_Service
+{
+ // = TITLE
+ // Defines a class that encapsulates the implementation of the
+ // TAO Scheduling Service.
+ //
+ // = DESCRIPTION
+ // This class makes use of the <TAO_Reconfig_Scheduler> and
+ // <ACE_Config_Scheduler> classes to implement the Scheduling Service.
+public:
+ TAO_Scheduling_Service (void);
+ // Default Constructor.
+
+ TAO_Scheduling_Service (int argc, ACE_TCHAR* argv[]);
+ // Constructor taking the command-line arguments.
+
+ int init (int argc, ACE_TCHAR* argv[]);
+ // Initialize the Scheduling Service with the arguments.
+
+ int run (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ // Run the TAO_Scheduling_Service.
+
+ ~TAO_Scheduling_Service (void);
+ // Destructor.
+
+private:
+ typedef ACE_Config_Scheduler CONFIG_SCHED_TYPE;
+
+// The templatized method parameters needed by the reconfig scheduler
+// class template are hopelessly broken on pre-2.8 versions of g++.
+#if (! defined (__GNUC__)) || (__GNUC__ > 2) || \
+(__GNUC__ == 2 && defined (__GNUC_MINOR__) && __GNUC_MINOR__ >= 8)
+
+ typedef TAO_Reconfig_Scheduler<TAO_MUF_FAIR_Reconfig_Sched_Strategy,
+ TAO_SYNCH_MUTEX> RECONFIG_SCHED_TYPE;
+
+#endif /* __GNUC__ */
+
+ enum Scheduler_Type {CONFIG, RECONFIG};
+
+ int parse_args (int argc, ACE_TCHAR* argv[]);
+ // parses the arguments.
+
+ TAO_ORB_Manager orb_manager_;
+ // The ORB manager. This must be the first thing in the
+
+ POA_RtecScheduler::Scheduler *scheduler_impl_;
+ // Scheduler instance.
+
+ ACE_CString ior_file_name_;
+ // Name of the IOR output file.
+
+ ACE_CString pid_file_name_;
+ // Name of the process id output file.
+
+ ACE_CString service_name_;
+ // Name used to register the service.
+
+ Scheduler_Type scheduler_type_;
+ // Type of scheduler with which to instantiate the service.
+
+ CORBA::ORB_var orb_;
+ // A reference to the ORB, to shut it down properly.
+};
+
+#endif /* TAO_SCHEDULING_SERVICE_H */
diff --git a/TAO/orbsvcs/Scheduling_Service/Scheduling_Service.mpc b/TAO/orbsvcs/Scheduling_Service/Scheduling_Service.mpc
new file mode 100644
index 00000000000..d960fa1d23f
--- /dev/null
+++ b/TAO/orbsvcs/Scheduling_Service/Scheduling_Service.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcsexe, core, rtsched, naming, svc_utils, iortable, portableserver, utils {
+ exename = Scheduling_Service
+}
diff --git a/TAO/orbsvcs/TAO_Service/.cvsignore b/TAO/orbsvcs/TAO_Service/.cvsignore
new file mode 100644
index 00000000000..2b0613ab8bd
--- /dev/null
+++ b/TAO/orbsvcs/TAO_Service/.cvsignore
@@ -0,0 +1 @@
+TAO_Service
diff --git a/TAO/orbsvcs/TAO_Service/Makefile.am b/TAO/orbsvcs/TAO_Service/Makefile.am
new file mode 100644
index 00000000000..22bb2e9a651
--- /dev/null
+++ b/TAO/orbsvcs/TAO_Service/Makefile.am
@@ -0,0 +1,39 @@
+## 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_Service.am
+
+bin_PROGRAMS = TAO_Service
+
+TAO_Service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+TAO_Service_SOURCES = \
+ TAO_Service.cpp
+
+TAO_Service_LDADD = \
+ $(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/TAO_Service/README b/TAO/orbsvcs/TAO_Service/README
new file mode 100644
index 00000000000..799c4d1cb2f
--- /dev/null
+++ b/TAO/orbsvcs/TAO_Service/README
@@ -0,0 +1,118 @@
+// $Id$
+
+This directory has a generic server which opens and reads the svc.conf file in
+the directory and dynamically loads and unloads the various ORB services as per
+the entries made in the svc.conf file.
+
+To Load a Service Dynamically:
+*****************************
+
+1. Add an entry to the svc.conf which specifies the service name that you wish to
+ load dynamically.
+
+ The syntax for loading a service dynamically is:
+
+ dynamic < Service name i.e. name that you want the Service Repository to
+ use to identify the dynamically linked Service_Object
+ so that you can look it up later via,
+ e.g., ACE_Dynamic_Service::instance () > \
+ < The type of the service > \
+ < The shared DLL that has the function
+ _make_Service_Name () , called the factory function> : \
+ <factory_function> \
+ "< arguments to be passed to the service similar to command line arguments>"
+
+
+To load Naming Service dynamically :
+----------------------------------
+
+ dynamic TAO_Naming_Loader Service_Object * \
+ TAO_CosNaming_Serv:_make_TAO_Naming_Loader () "dummy -o ns.ior"
+
+ So, here we want our service name to be TAO_Naming_Loader and its a
+ <Service_Object *> and the factory function is in TAO_CosNaming_Serv
+ DLL. We specify argv [0] to be "dummy" and the actual arguments
+ start from argv [1] as in the usual case.
+
+To load Event Service dynamically:
+---------------------------------
+
+ In the case of Event Service, we also want to load the default
+Event Service Factory in addition to the Event Service. So, we need to
+add these two entries when we want to load the event service.
+
+# Dynamically configure the default Event Service Factory
+dynamic CEC_Factory Service_Object * \
+ TAO_CosEvent_Serv:_make_TAO_CEC_Default_Factory () ""
+
+# Dynamically configure the event service into the application process.
+dynamic TAO_CEC_Event_Loader Service_Object * \
+ TAO_CosEvent_Serv:_make_TAO_CEC_Event_Loader () "dummy -o foo.ref"
+
+To load Trading Service dynamically:
+---------------------------------
+
+# Dynamically configure the trading service into the application process.
+dynamic TAO_Trading_Loader Service_Object * \
+ TAO_CosTrading_Serv:_make_TAO_Trading_Loader () "dummy -TSdumpior foo.ref"
+
+To Remove a Service
+*******************
+
+ The directive for removing a service is <remove>. Removing a
+service is simpler. Add the following entry to the same svc.conf file
+after commenting the entry for loading the same service, so that
+the service is not loaded again.
+
+
+The generic entry is :
+
+remove Service_Name
+
+To Unload Naming Service :
+------------------------
+
+# Dynamically remove the Naming Service from the application process.
+remove TAO_Naming_Loader
+
+To Unload Event Service :
+------------------------
+
+# Dynamically remove the Event Service from the application process.
+remove TAO_Event_Loader
+
+To Unload Trading Service :
+------------------------
+
+# Dynamically remove the Event Service from the application process.
+remove TAO_Trading_Loader
+
+To Run TAO_Service :
+==================
+
+1. Start with a empty svc.conf file. Run the TAO_Service. Make sure
+that you start with an empty svc.conf file because the ORB_init () and
+the service configurator get pretty confused.
+
+In detail, the svc.conf file is read and services loaded when
+ORB_init () is called in the main (). But, to load any service, we
+need to initialize the ORB. Here, it gets confused. To avoid this,
+run the TAO_Service with no entries in the svc.conf file.
+
+2. After running the server, now start adding entries to the svc.conf
+file depending on the services you wish to load. After adding an
+entry, send a SIGHUP signal:
+
+% kill -1 PID_of_TAO_Service
+
+ to the TAO_Service. The service configurator reads the
+svc.conf file again and reconfigures the services.
+
+3. If you want to test if the service is loaded successfully, run the
+generic client program < tests_svc_loader.cpp > located in
+orbsvcs/tests/tests_svc_loader. For more details about the
+tests_svc_loader.cpp, read the README in the same directory.
+
+4. If you want to remove the service at any instant, add an entry to
+the svc.conf file to reflect your intent and send a signal to the
+TAO_Service again.
diff --git a/TAO/orbsvcs/TAO_Service/TAO_Service.cpp b/TAO/orbsvcs/TAO_Service/TAO_Service.cpp
new file mode 100644
index 00000000000..b711c0e363b
--- /dev/null
+++ b/TAO/orbsvcs/TAO_Service/TAO_Service.cpp
@@ -0,0 +1,77 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs/TAO_Service/
+//
+// = FILENAME
+// TAO_Service.cpp
+//
+// = DESCRIPTION
+// This directory contains an example that illustrates how the ACE
+// Service Configurator can dynamically configure an ORB and its
+// servants from a svc.conf file.
+//
+// = AUTHOR
+// Priyanka Gontla <pgontla@ece.uci.edu>
+//
+// ============================================================================
+
+#include "tao/ORB_Constants.h"
+#include "tao/ORB.h"
+#include "ace/Service_Config.h"
+#include "ace/Log_Msg.h"
+#include "ace/Signal.h"
+#include "ace/Time_Value.h"
+#include "ace/Argv_Type_Converter.h"
+
+ACE_RCSID (TAO_Service,
+ TAO_Service,
+ "$Id$")
+
+
+extern "C" void handler (int)
+{
+ ACE_Service_Config::reconfig_occurred (1);
+}
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ ACE_Argv_Type_Converter argcon (argc, argv);
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argcon.get_argc (), argcon.get_ASCII_argv (),
+ "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Sig_Action sa ((ACE_SignalHandler) handler, SIGHUP);
+
+ for (;;)
+ {
+ ACE_Time_Value tv (5, 0);
+
+ orb->perform_work (tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Reconfig flag = %d\n",
+ ACE_Service_Config::reconfig_occurred ()));
+
+ if (ACE_Service_Config::reconfig_occurred ())
+ ACE_Service_Config::reconfigure ();
+ }
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, argv[0]);
+ }
+ ACE_ENDTRY;
+
+ return -1;
+}
diff --git a/TAO/orbsvcs/TAO_Service/TAO_Service.mpc b/TAO/orbsvcs/TAO_Service/TAO_Service.mpc
new file mode 100644
index 00000000000..51b0f4deb3e
--- /dev/null
+++ b/TAO/orbsvcs/TAO_Service/TAO_Service.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project : taoexe, core {
+ exename = TAO_Service
+}
diff --git a/TAO/orbsvcs/TAO_Service/svc.conf b/TAO/orbsvcs/TAO_Service/svc.conf
new file mode 100644
index 00000000000..6168a3a624d
--- /dev/null
+++ b/TAO/orbsvcs/TAO_Service/svc.conf
@@ -0,0 +1,23 @@
+# Dynamically configure the naming service into the application process.
+#dynamic TAO_Naming_Loader Service_Object * TAO_CosNaming_Serv:_make_TAO_Naming_Loader () "dummy -o ns.ior"
+
+# Dynamically configure the default Event Service Factory
+#dynamic CEC_Factory Service_Object * TAO_CosEvent_Serv:_make_TAO_CEC_Default_Factory () ""
+
+# Dynamically configure the naming service into the application process.
+#dynamic TAO_CEC_Event_Loader Service_Object * TAO_CosEvent_Serv:_make_TAO_CEC_Event_Loader () "dummy -o foo.ref -x"
+
+# Dynamically configure the trading service into the application process.
+#dynamic TAO_Trading_Loader Service_Object * TAO_CosTrading_Serv:_make_TAO_Trading_Loader () "dummy -TSdumpior footra.ref"
+
+#Dynamically remove the trading service from the application process
+#remove TAO_Trading_Loader
+
+#Dynamically remove the event service from the application process
+#remove TAO_Event_Loader
+
+#Dynamically remove the event service factory from the application process
+#remove CEC_Factory
+
+#Dynamically remove the naming service from the application process
+#remove TAO_Naming_Loader
diff --git a/TAO/orbsvcs/TAO_Service/svc.conf.xml b/TAO/orbsvcs/TAO_Service/svc.conf.xml
new file mode 100644
index 00000000000..6601b96b6ee
--- /dev/null
+++ b/TAO/orbsvcs/TAO_Service/svc.conf.xml
@@ -0,0 +1,20 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/TAO_Service/svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- Dynamically configure the naming service into the application process. -->
+ <!-- dynamic TAO_Naming_Loader Service_Object * TAO_CosNaming:_make_TAO_Naming_Loader () "dummy -o ns.ior" -->
+ <!-- Dynamically configure the default Event Service Factory -->
+ <!-- dynamic CEC_Factory Service_Object * TAO_CosEvent:_make_TAO_CEC_Default_Factory () "" -->
+ <!-- Dynamically configure the naming service into the application process. -->
+ <!-- dynamic TAO_CEC_Event_Loader Service_Object * TAO_CosEvent:_make_TAO_CEC_Event_Loader () "dummy -o foo.ref -x" -->
+ <!-- Dynamically configure the trading service into the application process. -->
+ <!-- dynamic TAO_Trading_Loader Service_Object * TAO_CosTrading:_make_TAO_Trading_Loader () "dummy -TSdumpior footra.ref" -->
+ <!-- Dynamically remove the trading service from the application process -->
+ <!-- remove TAO_Trading_Loader -->
+ <!-- Dynamically remove the event service from the application process -->
+ <!-- remove TAO_Event_Loader -->
+ <!-- Dynamically remove the event service factory from the application process -->
+ <!-- remove CEC_Factory -->
+ <!-- Dynamically remove the naming service from the application process -->
+ <!-- remove TAO_Naming_Loader -->
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/Time_Service/.cvsignore b/TAO/orbsvcs/Time_Service/.cvsignore
new file mode 100644
index 00000000000..8c4ee3c5b18
--- /dev/null
+++ b/TAO/orbsvcs/Time_Service/.cvsignore
@@ -0,0 +1,2 @@
+Time_Service_Clerk
+Time_Service_Server
diff --git a/TAO/orbsvcs/Time_Service/Clerk_i.cpp b/TAO/orbsvcs/Time_Service/Clerk_i.cpp
new file mode 100644
index 00000000000..ab42e2787f7
--- /dev/null
+++ b/TAO/orbsvcs/Time_Service/Clerk_i.cpp
@@ -0,0 +1,562 @@
+// $Id$
+
+#include "Clerk_i.h"
+#include "tao/debug.h"
+#include "ace/Read_Buffer.h"
+#include "ace/Get_Opt.h"
+#include "ace/Argv_Type_Converter.h"
+#include "ace/OS_NS_stdio.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, Clerk_i, "$Id$")
+
+// Constructor.
+
+Clerk_i::Clerk_i (void)
+ : ior_output_file_ (0),
+ timer_value_ (3),
+ timer_value_usecs_ (0),
+ server_ (Clerk_i::DEFAULT_SERVER_COUNT),
+ ior_fp_ (0)
+{
+ // no-op.
+}
+
+// Destructor.
+
+Clerk_i::~Clerk_i (void)
+{
+ // no-op.
+}
+
+// Reads the Time Service Server iors from a file instead of using a
+// naming service.
+
+int
+Clerk_i::read_ior (const ACE_TCHAR* 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,
+ ACE_TEXT("[CLIENT] Process/Thread Id : (%P/%t) Unable to open %s for writing: %p\n"),
+ filename),
+ -1);
+ else
+ this->ior_fp_ = 1;
+
+ ACE_Read_Buffer ior_buffer (f_handle);
+
+ char *data = ior_buffer.read (EOF,'\n','\n');
+ if (data == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("[CLIENT] Process/Thread Id : (%P/%t) Unable to read ior: %p\n")),
+ -1);
+
+ int result = 0;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ for (char *str = ACE_OS::strtok (data, "\n");
+ str != 0 ;
+ str = ACE_OS::strtok (0, "\n"))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("iors -> |%s|\n"),
+ ACE_TEXT_CHAR_TO_TCHAR(str)));
+
+ CORBA::Object_var objref =
+ this->orb_->string_to_object (str
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Return if the server reference is nil.
+ if (CORBA::is_nil (objref.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("IOR for the server is Null\n")));
+ result = -1;
+ break;
+ }
+
+ CosTime::TimeService_ptr server =
+ CosTime::TimeService::_narrow (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->insert_server (server);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, ACE_TEXT("Exception"));
+ }
+ ACE_ENDTRY;
+
+ ACE_OS::close (f_handle);
+ ior_buffer.alloc ()->free (data);
+
+ return result;
+}
+
+// Parse the command-line arguments and set options.
+
+int
+Clerk_i::parse_args (int argc,
+ ACE_TCHAR* argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("dt:u:f:o:"));
+
+ int c, result;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // debug flag.
+ TAO_debug_level++;
+ break;
+
+ case 't': // time in secs after which the clerk should update time.
+ this->timer_value_ = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'u':
+ // time in usecs after which the clerk should update time.
+ // Continues the precision of the -t option.
+ this->timer_value_usecs_ = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'f': // read the server IORs from a file.
+ result = this->read_ior (get_opts.opt_arg ());
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("[CLERK] Process/Thread Id : (%P/%t) Unable to read ior from %s : %p\n"),
+ get_opts.opt_arg ()),
+ -1);
+ break;
+
+ case 'o': // output the Clerk IOR to a file.
+ this->ior_output_file_ =
+ ACE_OS::fopen (get_opts.opt_arg (), ACE_TEXT("w"));
+
+ if (this->ior_output_file_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("[SERVER] Process/Thread Id : (%P/%t)Unable to open %s for writing: %\n"),
+ get_opts.opt_arg ()), -1);
+ break;
+
+ case '?': // display help for use of the server.
+ /* FALLTHRU */
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("[SERVER] Process/Thread Id : (%P/%t)")
+ ACE_TEXT("usage: %s")
+ ACE_TEXT(" [-d]")
+ ACE_TEXT(" [-t] <Timer value inn Secs>")
+ ACE_TEXT(" [-u] <Timer value in uSecs>")
+ ACE_TEXT(" [-f] <ior_input_file>")
+ ACE_TEXT(" [-o] <ior_output_file>")
+ ACE_TEXT("\n"),
+ argv[0]),
+ 1);
+ }
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+// Get a reference to the Server Naming context and the first IOR.
+// The iterator returned from this is used to get the next n IORs.
+
+int
+Clerk_i::get_first_IOR (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ char host_name[MAXHOSTNAMELEN];
+
+ ACE_OS::hostname (host_name,
+ MAXHOSTNAMELEN);
+ CosNaming::BindingList_var bindings_list;
+ CosNaming::BindingIterator_var iter;
+
+ // Construct the server context name.
+ CosNaming::Name server_context_name;
+ server_context_name.length (1);
+ server_context_name[0].id = CORBA::string_dup ("ServerContext");
+
+ // Resolve name.
+ CORBA::Object_var temp_object =
+ this->naming_client_->resolve (server_context_name
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+ CosNaming::NamingContext_var server_context =
+ CosNaming::NamingContext::_narrow (temp_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (server_context.in ()))
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("TAO_Time_Service_Clerk::get_server_IORs:")
+ ACE_TEXT("No Active Servers in the Network\n")));
+
+ // Get the first element and an iterator over the other
+ // elements.
+ server_context->list (1,
+ bindings_list.out (),
+ iter.out ());
+ CosNaming::Name server_name;
+ server_name.length (1);
+ server_name[0].id = bindings_list[0u].binding_name[0].id;
+
+ temp_object =
+ server_context->resolve (server_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosTime::TimeService_var obj =
+ CosTime::TimeService::_narrow (temp_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("[CLERK] Process/Thread Id : (%P/%t) Unable to Resolve ")
+ ACE_TEXT("Server Reference\n")),
+ -1);
+
+ // Insert the first server IOR into the unbounded set of server
+ // IORs.
+
+ this->insert_server (obj.in ());
+
+ // Iterate over the server context to get the next N IORs.
+ if (next_n_IORs (iter,
+ server_context) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("[CLERK] Process/Thread Id : (%P/%t) Unable to get next N IORs ")),
+ -1);;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, ACE_TEXT("Exception"));
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+// Get the next n IORs of the time servers active in the Network and
+// registered with the Naming Service. This is done by iterating over
+// the naming context.
+
+int
+Clerk_i::next_n_IORs (CosNaming::BindingIterator_var iter,
+ CosNaming::NamingContext_var server_context)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosNaming::Binding_var binding;
+
+ if (!CORBA::is_nil (iter.in ()))
+ {
+ while (iter->next_one (binding.out ()
+ ACE_ENV_ARG_PARAMETER))
+ {
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("Getting IOR of the server: %s\n\n"),
+ ACE_TEXT_CHAR_TO_TCHAR(binding->binding_name[0].id.in ())));
+
+ CosNaming::Name server_name;
+ server_name.length (1);
+ server_name[0].id = binding->binding_name[0].id;
+
+ CORBA::Object_var temp_object =
+ server_context->resolve (server_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosTime::TimeService_ptr server =
+ CosTime::TimeService::_narrow (temp_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->insert_server (server);
+ }
+
+ ACE_TRY_CHECK;
+ }
+
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT("Unexpected exception in next_n_IORs\n"));
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+// Initialise the Naming Service.
+
+int
+Clerk_i::init_naming_service ()
+{
+ // Initialize the Naming Client.
+ return (this->naming_client_.init (this->orb_.in ()));
+}
+
+// Create an instance of the clerk with appropriate parameters.
+
+int
+Clerk_i::create_clerk (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+
+ // Create a new clerk object. Pass it the timer value, the set
+ // of server IORs and the no. of servers.
+ ACE_NEW_RETURN (this->time_service_clerk_impl_,
+ TAO_Time_Service_Clerk (this->timer_value_,
+ this->timer_value_usecs_,
+ this->server_),
+ 0);
+
+ // Generate IOR of the Clerk and register with POA.
+ this->time_service_clerk_ =
+ this->time_service_clerk_impl_->_this ();
+
+ // Convert the clerk reference to a string.
+ CORBA::String_var objref_clerk =
+ this->orb_->object_to_string (this->time_service_clerk_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Print the clerk IOR on the console.
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("[SERVER] Process/Thread Id : (%P/%t) The Time Service CLERK IOR is: <%s>\n"),
+ ACE_TEXT_CHAR_TO_TCHAR(objref_clerk.in ())));
+
+ // Print the Time Service clerk IOR to a file.
+ if (this->ior_output_file_)
+ {
+ ACE_OS::fprintf (this->ior_output_file_,
+ "%s",
+ objref_clerk.in ());
+ ACE_OS::fclose (this->ior_output_file_);
+ }
+
+ // Register the clerk implementation with the Interface
+ // Repository. init_IR();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, ACE_TEXT("Exception"));
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+// Binds the clerk in the context ClerkContext with the name
+// Clerk:<hostname>.
+
+int
+Clerk_i::register_clerk (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Bind the Clerk in its appropriate Context.
+
+ CosNaming::Name clerk_context_name;
+ clerk_context_name.length (1);
+ clerk_context_name[0].id = CORBA::string_dup ("ClerkContext");
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY_EX(bind_new_context)
+ {
+ CosNaming::NamingContext_var clerk_context =
+ this->naming_client_->bind_new_context(clerk_context_name);
+ ACE_TRY_CHECK_EX(bind_new_context);
+ }
+ ACE_CATCH(CosNaming::NamingContext::AlreadyBound, ex)
+ {
+ // OK, naming context already exists.
+ }
+ ACE_ENDTRY;
+
+ char host_name[MAXHOSTNAMELEN];
+ char clerk_mc_name[MAXHOSTNAMELEN];
+ ACE_OS::hostname (host_name, MAXHOSTNAMELEN);
+
+ //CosNaming::Name clerk_name (clerk_context_name);
+ CosNaming::Name clerk_name;
+ clerk_name.length (2);
+
+ ACE_OS::strcpy (clerk_mc_name, "Clerk:");
+ ACE_OS::strcat (clerk_mc_name, host_name);
+
+ clerk_name[0].id = CORBA::string_dup ("ClerkContext");
+ clerk_name[1].id = CORBA::string_dup (clerk_mc_name);
+
+ this->naming_client_->rebind (clerk_name,
+ this->time_service_clerk_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT("(%P|%t) Exception from init_naming_service ()\n"));
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+// Initialize the Clerk.
+
+int
+Clerk_i::init (int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ // Make a copy of command line parameter.
+ ACE_Argv_Type_Converter command(argc, argv);
+
+ // Set the size of the Server IOR Array.
+ this->server_.max_size (10);
+ this->server_.size (0);
+
+ // Call the init of <TAO_ORB_Manager> to initialize the ORB and
+ // create a child POA under the root POA.
+
+
+ this->orb_manager_.init (command.get_argc(),
+ command.get_ASCII_argv()
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+ if (this->orb_manager_.init_child_poa (command.get_argc(),
+ command.get_ASCII_argv(),
+ "child_poa"
+ ACE_ENV_ARG_PARAMETER) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("%p\n"),
+ ACE_TEXT("init_child_poa")),
+ -1);
+ ACE_TRY_CHECK;
+
+ // Get the ORB.
+ this->orb_ = this->orb_manager_.orb ();
+
+ // Parse commandline arguments.
+ if (this->parse_args (command.get_argc(), command.get_TCHAR_argv()) !=0 )
+ return -1;
+
+ // If IOR file has not been specified then try the Naming
+ // Service.
+
+ if (!this->ior_fp_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("IOR file not specified. Using the Naming Service instead\n")));
+
+ // Initialize the Naming Service.
+ if (this->init_naming_service () !=0 )
+ return -1;
+
+ // Get a reference to the Server Naming context and the
+ // first IOR.
+ if (this->get_first_IOR () != 0)
+ return -1;
+
+ }
+
+ // Create an instance of the Clerk.
+ if (this->create_clerk () != 0)
+ return -1;
+
+
+ // Register the clerk with the Naming Service.
+ if (this->ior_fp_ == 0)
+ {
+ if (this->register_clerk () != 0)
+ return -1;
+ }
+
+ // Close the open file handler.
+ // ACE_OS::fclose (this->ior_fp_);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT("(%P|%t) Exception in Clerk_i::init ()\n"));
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+Clerk_i::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ // Run the main event loop for the ORB.
+ int r = this->orb_manager_.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (r == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("[SERVER] Process/Thread Id : (%P/%t) Clerk_i::run")),
+ -1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT("(%P|%t) Exception in Clerk_i::run ()\n"));
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+void
+Clerk_i::insert_server (CosTime::TimeService_ptr server)
+{
+ // We duplicate the capacity of the Array.
+ size_t s = this->server_.size ();
+
+ if (this->server_.max_size () == s)
+ this->server_.max_size (2 * s);
+
+ this->server_[s] =
+ CosTime::TimeService::_duplicate (server);
+
+ this->server_.size (s + 1);
+}
diff --git a/TAO/orbsvcs/Time_Service/Clerk_i.h b/TAO/orbsvcs/Time_Service/Clerk_i.h
new file mode 100644
index 00000000000..9f3f9283837
--- /dev/null
+++ b/TAO/orbsvcs/Time_Service/Clerk_i.h
@@ -0,0 +1,139 @@
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/Time_Service
+//
+// = FILENAME
+// Clerk_i.h
+//
+// = AUTHOR
+// Vishal Kachroo <vishal@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef CLERK_I_H
+#define CLERK_I_H
+
+#include "ace/Get_Opt.h"
+#include "ace/Log_Msg.h"
+#include "tao/Utils/ORB_Manager.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/Time/TAO_Time_Service_Clerk.h"
+
+class Clerk_i
+{
+ // = TITLE
+ // CORBA Time Clerk implementation.
+ //
+ // = DESCRIPTION
+ // A CORBA server that initializes the TimeService clerk
+ // implementation and the ORB.
+public:
+
+ enum {
+ // Pre-allocate slots for this many servers. The capacity grows on
+ // demand.
+ DEFAULT_SERVER_COUNT = 8
+ };
+
+ // = Initialization and termination methods.
+ Clerk_i (void);
+ // Constructor.
+
+ ~Clerk_i (void);
+ // Destructor.
+
+ typedef ACE_Array_Base<CosTime::TimeService_var> IORS;
+ // Set of available Time servers.
+
+ int init (int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL);
+ // Initialize the Clerk state - parsing arguments and waiting.
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the orb.
+
+private:
+ void insert_server (CosTime::TimeService_ptr server);
+ // Insert a server in the internal data structure (servers_).
+
+private:
+
+ int read_ior (const ACE_TCHAR* filename);
+ // Read the server IORs from a file instead of using a naming
+ // service.
+
+ int parse_args (int argc,
+ ACE_TCHAR* argv[]);
+ // Parses the commandline arguments.
+
+ TAO_ORB_Manager orb_manager_;
+ // The ORB manager.
+
+ FILE *ior_output_file_;
+ // File where the IOR of the Clerk object is stored.
+
+ int init_naming_service ();
+ // Initialises the name client and registers the <TimeService> Clerk
+ // object with it.
+
+ int create_clerk (void);
+ // Create an instance of the clerk to use.
+
+ int register_clerk (void);
+ // Bind the clerk in the appropriate context in the Naming Service.
+
+ int init_IR (void);
+ // Initialise the Interface Repository and register the clerk
+ // implementation with it.
+
+ int get_first_IOR (void);
+ // Get the reference to the server naming context and the first
+ // server IOR.
+
+ int next_n_IORs (CosNaming::BindingIterator_var iter,
+ CosNaming::NamingContext_var server_context);
+ // Iterate over the given server context to get the rest of the
+ // server IORs.
+
+ TAO_Naming_Client naming_client_;
+ // An instance of the name server used for registering the
+ // <TimeService Clerk> object. The same instance is used by the
+ // Clerk to periodically iterate through the Server Naming Context
+ // and get IORs of the available servers.
+
+ TAO_Time_Service_Clerk *time_service_clerk_impl_;
+ // Implementation of the <TimeService> Clerk object.
+
+ CosTime::TimeService_var time_service_clerk_;
+ // Reference of the time service clerk.
+
+ CosNaming::NamingContext_var time_service_clerk_context_;
+ // Naming context for the Naming Service.
+
+ CORBA::ORB_var orb_;
+ // My orb.
+
+ int timer_value_ ;
+ // Clerk seeks time periodically after this interval in secs. from the
+ // servers in the network.
+
+ int timer_value_usecs_;
+ // Continues the precision of timer_value_ in microseconds.
+
+ // IR_Helper *ir_helper_;
+ // Helper class for using the IR.
+
+ IORS server_;
+ // The unbounded set of server IORS.
+
+ int ior_fp_;
+ // Read IORs from a file.
+};
+
+#endif /* CLERK_I_H */
diff --git a/TAO/orbsvcs/Time_Service/Makefile.am b/TAO/orbsvcs/Time_Service/Makefile.am
new file mode 100644
index 00000000000..474b5debdad
--- /dev/null
+++ b/TAO/orbsvcs/Time_Service/Makefile.am
@@ -0,0 +1,80 @@
+## 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_Service_Clerk.am
+
+bin_PROGRAMS = Time_Service_Clerk
+
+Time_Service_Clerk_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+Time_Service_Clerk_SOURCES = \
+ Clerk_i.cpp \
+ Time_Service_Clerk.cpp \
+ Clerk_i.h
+
+Time_Service_Clerk_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosTime.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Makefile.Time_Service_Server.am
+
+bin_PROGRAMS += Time_Service_Server
+
+Time_Service_Server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+Time_Service_Server_SOURCES = \
+ Server_i.cpp \
+ Time_Service_Server.cpp \
+ Server_i.h
+
+Time_Service_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_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosTime.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.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/Time_Service/README b/TAO/orbsvcs/Time_Service/README
new file mode 100644
index 00000000000..2ca9f457b45
--- /dev/null
+++ b/TAO/orbsvcs/Time_Service/README
@@ -0,0 +1,96 @@
+$Id $
+
+============================ TAO Time Service==============================
+
+This is a complete implementation of the CORBA time service spec. The
+service offers a globally synchronized time to a requesting
+client. The Time Service interface has been implemented as two servants:
+the clerk and the server. Clients who wish to use the service talk to
+clerks and the clerks in turn keep their time synchronized
+globally. The clerks do this by talking to the servers running on
+different machines.
+
+There needs to be at least one time server running in the network. The Clerks
+update their time periodically from the servers. The servers and clerks
+export their IORs through the
+ * Naming Service.
+ * Files
+The Servers can also be activated on demand by the Clerks if they have been
+registered with an Implementation Repository.
+
+If Naming Service is being used the clerks and servers are registered in
+different Naming Contexts as :
+
+For the clerks : ClerkContext->Clerk:<local_host_name>
+For the server : ServerContext->Server:<local_host_name>
+
+The machine name is included to make the object name unique and distinguish
+between the various servers and clerks.
+
+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.
+
+Version Updates : (10th March, 1999)
+-----------------
+
+The TAO Time Service has been updated to include the timezone information
+in the Universal Time Object. This object now also has an inaccuracy estimate
+in it. The inaccuracy is a measure of the skew in the synchronization of
+the clerks time. It is the difference between the highest and the lowest times
+from the servers that the clerk synchronizes its time with. The high-inaccuracy
+and the low-inaccuracy fields are also being calculated from the inaccuracy as
+follows :
+
+ Inaccuracy 64-bits
+ |------------------------------------|
+ | | inacchi | inacclo |
+ |------------------------------------|
+ 16-bits 16-bits 32-bits
+
+Thanks to Brian Dance <Brian_Dance@UECCS.co.uk> for reporting this.
+
+Future Versions of the service could include other measures of inaccuracy too,
+say the one based on precision in the time reported by servers. In this case
+the servers will have to supply an estimate of inaccuracy in their times.
+
+
diff --git a/TAO/orbsvcs/Time_Service/Server_i.cpp b/TAO/orbsvcs/Time_Service/Server_i.cpp
new file mode 100644
index 00000000000..b1c846e398f
--- /dev/null
+++ b/TAO/orbsvcs/Time_Service/Server_i.cpp
@@ -0,0 +1,286 @@
+// $Id$
+
+#include "Server_i.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/Argv_Type_Converter.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_string.h"
+#include "ace/os_include/os_netdb.h"
+
+ACE_RCSID(Time_Service, Server_i, "$Id$")
+
+// Constructor.
+Server_i::Server_i (void)
+ : ior_output_file_ (0)
+{
+ // no-op.
+}
+
+// Destructor.
+
+Server_i::~Server_i (void)
+{
+ // no-op.
+}
+
+// Parse the command-line arguments and set options.
+
+int
+Server_i::parse_args (int argc,
+ ACE_TCHAR* argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("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 (), ACE_TEXT("a"));
+
+ if (this->ior_output_file_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("[SERVER] Process/Thread Id : (%P/%t)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,
+ ACE_TEXT("[SERVER] Process/Thread Id : (%P/%t)")
+ ACE_TEXT("usage: %s")
+ ACE_TEXT(" [-d]")
+ ACE_TEXT(" [-o] <ior_output_file>")
+ ACE_TEXT("\n"),
+ argv[0]),
+ 1);
+ }
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+// Initialise the Naming Service and register the TimeService Object
+// with it.
+
+int
+Server_i::init_naming_service ()
+{
+ // Initialize the Naming Client.
+ return (this->naming_client_.init (this->orb_.in ()));
+}
+
+// Create a new time server object and register it with the child POA.
+// Print the IOR of the registered server on the console and in a file.
+
+int
+Server_i::create_server (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+
+ // Create a new server object.
+ ACE_NEW_RETURN (this->time_service_server_impl_,
+ TAO_Time_Service_Server,
+ 0);
+
+ // Register a servant with the child poa.
+ CORBA::String_var server_str =
+ this->orb_manager_.activate_under_child_poa ("server",
+ this->time_service_server_impl_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId ("server");
+
+ CORBA::Object_var server_ref =
+ this->orb_manager_.child_poa ()->id_to_reference (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->time_service_server_ = CosTime::TimeService::_narrow (server_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // All this !! just to register a servant with the child poa.
+ // Instead of using _this ().
+
+ //Convert the server reference to a string.
+
+ CORBA::String_var objref_server =
+ this->orb_->object_to_string (server_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Print the server IOR on the console.
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("[SERVER] Process/Thread Id : (%P/%t) The Time Service ")
+ ACE_TEXT("SERVER IOR: <%s>\n"),
+ ACE_TEXT_CHAR_TO_TCHAR(objref_server.in ())));
+
+ // Print the IOR to a file.
+
+ if (this->ior_output_file_)
+ {
+ // Write the IOR to the file.
+ ACE_OS::fprintf (this->ior_output_file_,
+ "%s\n",
+ objref_server.in ());
+ ACE_OS::fclose (this->ior_output_file_);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT("Exception in Server_i::create_server ()"));
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+
+// Bind the Server in the context 'ServerContext' with the name
+// 'Server:<hostname>'.
+
+int
+Server_i::register_server (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosNaming::Name server_context_name;
+ server_context_name.length (1);
+ server_context_name[0].id = CORBA::string_dup ("ServerContext");
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY_EX(bind_new_context)
+ {
+ CosNaming::NamingContext_var server_context =
+ this->naming_client_->bind_new_context(server_context_name);
+ ACE_TRY_CHECK_EX(bind_new_context);
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound, ex)
+ {
+ // OK, naming context already exists.
+ }
+ ACE_ENDTRY;
+
+ char host_name[MAXHOSTNAMELEN];
+ char server_mc_name[MAXHOSTNAMELEN];
+ ACE_OS::hostname (host_name,MAXHOSTNAMELEN);
+
+ CosNaming::Name server_name (server_context_name);
+
+ server_name.length (2);
+ ACE_OS::strcpy (server_mc_name, "Server:");
+ ACE_OS::strcat (server_mc_name, host_name);
+ server_name[1].id = CORBA::string_dup (server_mc_name);
+
+ // Bind the compound name (ServerContext(Server:<hostname>))
+ // to the Naming Server.
+
+ this->naming_client_->rebind (server_name,
+ this->time_service_server_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("Binding ServerContext -> %s\n"),
+ ACE_TEXT_CHAR_TO_TCHAR(server_name[1].id.in ())));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT("(%P|%t) Exception from Register Server ()\n"));
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+// Initialize the server. If a filename is specified with the -f
+// commandline option, the server writes its IOR to the file besides
+// binding itself with the Naming Service.
+
+int
+Server_i::init (int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ // Make a copy of command line parameter.
+ ACE_Argv_Type_Converter command(argc, argv);
+
+ // Call the init of <TAO_ORB_Manager> to initialize the ORB and
+ // create a child POA under the root POA.
+
+ int retval = this->orb_manager_.init_child_poa (
+ command.get_argc(),
+ command.get_ASCII_argv(),
+ "time_server"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (retval == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("%p\n"),
+ ACE_TEXT("init_child_poa")),
+ -1);
+
+ // Activate the POA Manager.
+ this->orb_manager_.activate_poa_manager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int result = this->parse_args (command.get_argc(), command.get_TCHAR_argv());
+
+ if (result != 0)
+ return result;
+
+ // Get the orb.
+ this->orb_ = this->orb_manager_.orb ();
+
+ // Initialize Naming Service.
+ this->init_naming_service ();
+
+ // Create the server object.
+ this->create_server ();
+
+ // Register the server object with the Naming Service.
+ this->register_server ();
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, ACE_TEXT("Exception:"));
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+
+// Run the event loop for ORB.
+
+int
+Server_i::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int retval = this->orb_manager_.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (retval == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("[SERVER] Process/Thread Id : (%P/%t) Server_i::run")),
+ -1);
+ return 0;
+}
diff --git a/TAO/orbsvcs/Time_Service/Server_i.h b/TAO/orbsvcs/Time_Service/Server_i.h
new file mode 100644
index 00000000000..7889d95e37b
--- /dev/null
+++ b/TAO/orbsvcs/Time_Service/Server_i.h
@@ -0,0 +1,89 @@
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/Time_Service
+//
+// = FILENAME
+// Server_i.h
+//
+// = AUTHOR
+// Vishal Kachroo <vishal@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef SERVER_I_H
+#define SERVER_I_H
+
+#include "ace/Get_Opt.h"
+#include "ace/Log_Msg.h"
+#include "tao/Utils/ORB_Manager.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/Time/TAO_Time_Service_Server.h"
+
+class Server_i
+{
+ // = TITLE
+ // CORBA Server implementation.
+ //
+ // = DESCRIPTION
+ // A CORBA server that initializes the <TimeService Server>
+ // servant implementation and the ORB.
+public:
+ // = Initialization and termination methods.
+ Server_i (void);
+ // Constructor.
+
+ ~Server_i (void);
+ // Destructor.
+
+ int init (int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL);
+ // Initialize the Server state.
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the orb.
+
+ int init_naming_service ();
+ // Initialises the name client.
+
+ int create_server (void);
+ // Create the time server object.
+
+ int register_server (void);
+ // Register the time server object with the Naming Service.
+
+ int parse_args (int argc,
+ ACE_TCHAR* argv[]);
+ // Parse the commandline arguments.
+
+private:
+
+ CORBA::ORB_var orb_;
+ // My orb.
+
+ TAO_ORB_Manager orb_manager_;
+ // The ORB manager.
+
+ FILE *ior_output_file_;
+ // File where the IOR of the Clerk object is stored.
+
+ TAO_Naming_Client naming_client_;
+ // An instance of the name server used for registering the
+ // <TimeService Server> object.
+
+ TAO_Time_Service_Server *time_service_server_impl_;
+ // Implementation of the <TimeService> Server object.
+
+ CosTime::TimeService_var time_service_server_;
+ // Reference of the time server.
+
+ CosNaming::NamingContext_var time_service_server_context_;
+ // Naming context for the Naming Service.
+};
+
+#endif /* SERVER_I_H */
diff --git a/TAO/orbsvcs/Time_Service/Time_Service.mpc b/TAO/orbsvcs/Time_Service/Time_Service.mpc
new file mode 100644
index 00000000000..b7342a0a223
--- /dev/null
+++ b/TAO/orbsvcs/Time_Service/Time_Service.mpc
@@ -0,0 +1,19 @@
+// -*- MPC -*-
+// $Id$
+
+project(Time_Service_Server) : orbsvcsexe, core, time, naming, utils {
+ exename = Time_Service_Server
+ Source_Files {
+ Server_i.cpp
+ Time_Service_Server.cpp
+ }
+}
+
+project(Time_Service_Clerk) : orbsvcsexe, core, time, naming, utils {
+ exename = Time_Service_Clerk
+ Source_Files {
+ Clerk_i.cpp
+ Time_Service_Clerk.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/Time_Service/Time_Service_Clerk.cpp b/TAO/orbsvcs/Time_Service/Time_Service_Clerk.cpp
new file mode 100644
index 00000000000..97d8d30a3db
--- /dev/null
+++ b/TAO/orbsvcs/Time_Service/Time_Service_Clerk.cpp
@@ -0,0 +1,44 @@
+// $Id$
+
+#include "Clerk_i.h"
+#include "ace/OS_main.h"
+
+ACE_RCSID(TimeService, Time_Service_Clerk, "$Id$")
+
+// This is the main driver program for the Time Service clerk.
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR* argv[])
+{
+ Clerk_i clerk;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "[SERVER] Process/Thread Id : (%P/%t) Time Service clerk\n"));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int r = clerk.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (r == -1)
+ return 1;
+ else
+ {
+ clerk.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;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/Time_Service/Time_Service_Server.cpp b/TAO/orbsvcs/Time_Service/Time_Service_Server.cpp
new file mode 100644
index 00000000000..a265a39ed35
--- /dev/null
+++ b/TAO/orbsvcs/Time_Service/Time_Service_Server.cpp
@@ -0,0 +1,45 @@
+// $Id$
+
+#include "Server_i.h"
+#include "ace/OS_main.h"
+
+ACE_RCSID(TimeService, Time_Service_Server, "$Id$")
+
+// This is the main driver program for the Time Service server.
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR* argv[])
+{
+ Server_i server;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "[SERVER] Process/Thread Id : (%P/%t) Time Service server\n"));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int r = server.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (r == -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;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/Trading_Service/.cvsignore b/TAO/orbsvcs/Trading_Service/.cvsignore
new file mode 100644
index 00000000000..6306e1e35ed
--- /dev/null
+++ b/TAO/orbsvcs/Trading_Service/.cvsignore
@@ -0,0 +1 @@
+Trading_Service
diff --git a/TAO/orbsvcs/Trading_Service/Makefile.am b/TAO/orbsvcs/Trading_Service/Makefile.am
new file mode 100644
index 00000000000..611a96415c7
--- /dev/null
+++ b/TAO/orbsvcs/Trading_Service/Makefile.am
@@ -0,0 +1,55 @@
+## 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.Trading_Service.am
+
+bin_PROGRAMS = Trading_Service
+
+Trading_Service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+Trading_Service_SOURCES = \
+ Trading_Server.cpp \
+ Trading_Service.cpp \
+ Trading_Service.h
+
+Trading_Service_LDADD = \
+ $(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)/orbsvcs/orbsvcs/libTAO_CosTrading.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(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)/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/Trading_Service/README b/TAO/orbsvcs/Trading_Service/README
new file mode 100644
index 00000000000..4aec9cb0b2f
--- /dev/null
+++ b/TAO/orbsvcs/Trading_Service/README
@@ -0,0 +1,10 @@
+$Id$
+
+The TAO Trading Service
+
+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
+
+Enjoy! \ No newline at end of file
diff --git a/TAO/orbsvcs/Trading_Service/Trading_Server.cpp b/TAO/orbsvcs/Trading_Service/Trading_Server.cpp
new file mode 100644
index 00000000000..21bbeee0fa2
--- /dev/null
+++ b/TAO/orbsvcs/Trading_Service/Trading_Server.cpp
@@ -0,0 +1,37 @@
+// $Id$
+
+#include "Trading_Service.h"
+#include "ace/OS_main.h"
+
+// Driver function for the TAO Trading Service.
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR* argv[])
+{
+ Trading_Service trader;
+
+ ACE_TRY_NEW_ENV
+ {
+ int check =
+ trader.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (check != -1)
+ {
+ trader.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Failed to initialize the trader.\n"),
+ 1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Trading Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/Trading_Service/Trading_Service.cpp b/TAO/orbsvcs/Trading_Service/Trading_Service.cpp
new file mode 100644
index 00000000000..d77402f07e2
--- /dev/null
+++ b/TAO/orbsvcs/Trading_Service/Trading_Service.cpp
@@ -0,0 +1,87 @@
+// $Id$
+
+#include "ace/OS.h"
+#include "ace/Arg_Shifter.h"
+#include "Trading_Service.h"
+
+ACE_RCSID(Trading_Service, Trading_Service, "$Id$")
+
+Trading_Shutdown::Trading_Shutdown (Trading_Service& trader)
+ : trader_ (trader)
+{
+ if (this->shutdown_.register_handler (SIGINT,
+ this) == -1)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("%p\n"),
+ ACE_TEXT("register_handler")));
+
+#ifndef ACE_HAS_WINCE
+ if (this->shutdown_.register_handler (SIGTERM,
+ this) == -1)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("%p\n"),
+ ACE_TEXT("register_handler")));
+#endif // ACE_HAS_WINCE
+}
+
+int
+Trading_Shutdown::handle_signal (int signum,
+ siginfo_t *sinfo,
+ ucontext_t *ucon)
+{
+ ACE_UNUSED_ARG (signum);
+ ACE_UNUSED_ARG (sinfo);
+ ACE_UNUSED_ARG (ucon);
+ this->trader_.~Trading_Service ();
+ ACE_OS::exit (0);
+ return 0;
+}
+
+Trading_Service::Trading_Service (void)
+{
+ // constructor
+}
+
+Trading_Service::~Trading_Service (void)
+{
+ this->shutdown ();
+}
+
+int
+Trading_Service::init (int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ int result_trader =
+ this->trading_loader_.init (argc, argv);
+
+ if (result_trader == -1)
+ return -1;
+
+ return 0;
+}
+
+int
+Trading_Service::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ Trading_Shutdown trading_shutdown (*this);
+
+ int return_value =
+ this->trading_loader_.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return return_value;
+}
+
+int
+Trading_Service::shutdown (void)
+{
+ // Invoke TAO_Trading_Loader::fini ()
+ int shutdown_result =
+ this->trading_loader_.fini ();
+
+ if (shutdown_result == -1)
+ return -1;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/Trading_Service/Trading_Service.h b/TAO/orbsvcs/Trading_Service/Trading_Service.h
new file mode 100644
index 00000000000..951b67e6ecf
--- /dev/null
+++ b/TAO/orbsvcs/Trading_Service/Trading_Service.h
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// ========================================================================
+//
+// = BINARY
+// trader
+//
+// = FILENAME
+// Trading_Service.h
+//
+// = AUTHOR
+// Seth Widoff <sbw1@cs.wustl.edu>
+//
+// =======================================================================
+
+#ifndef _TRADING_SERVICE_H
+#define _TRADING_SERVICE_H
+
+#include "ace/Auto_Ptr.h"
+#include "ace/Sig_Handler.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/IOR_Multicast.h"
+#include "orbsvcs/Trader/Trader.h"
+#include "orbsvcs/Trader/Service_Type_Repository.h"
+#include "orbsvcs/Trader/Trading_Loader.h"
+
+class Trading_Service;
+
+class Trading_Shutdown : public ACE_Event_Handler
+{
+ // = TITLE
+ // A class that shutsdown a Trading Service instance.
+public:
+ Trading_Shutdown (Trading_Service& trader);
+ // Constructor.
+
+ virtual int handle_signal (int,
+ siginfo_t *,
+ ucontext_t *);
+ // Signal handler.
+
+protected:
+ Trading_Service &trader_;
+ ACE_Sig_Handler shutdown_;
+};
+
+class Trading_Service
+{
+ // = TITLE
+ // A class that initializes a Trading Service instance.
+public:
+
+ Trading_Service (void);
+ // Default constructor.
+
+ ~Trading_Service (void);
+ // Destructor
+
+ int init (int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL);
+ // Initialize the Trading Service with arguments.
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the Trading Service.
+
+ int shutdown (void);
+
+protected:
+
+ auto_ptr<TAO_Trader_Factory::TAO_TRADER> trader_;
+ // Pointer to the linked trader.
+
+ TAO_Trading_Loader trading_loader_;
+ // Instance of TAO_Trading_Laoder
+};
+
+#endif /* _TRADING_SERVICE_H */
diff --git a/TAO/orbsvcs/Trading_Service/Trading_Service.mpc b/TAO/orbsvcs/Trading_Service/Trading_Service.mpc
new file mode 100644
index 00000000000..0e44f51f0b6
--- /dev/null
+++ b/TAO/orbsvcs/Trading_Service/Trading_Service.mpc
@@ -0,0 +1,7 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcsexe, utils, core, naming, trading_serv {
+ exename = Trading_Service
+}
+
diff --git a/TAO/orbsvcs/examples/CosEC/Factory/CosEC_Factory.mpc b/TAO/orbsvcs/examples/CosEC/Factory/CosEC_Factory.mpc
new file mode 100644
index 00000000000..2ff7ecdb1d7
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Factory/CosEC_Factory.mpc
@@ -0,0 +1,36 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl) : orbsvcslib {
+
+ IDL_Files {
+ CosEventChannelFactory.idl
+ }
+
+ custom_only = 1
+}
+
+project(*Client) : orbsvcsexe, event, event_skel, naming {
+ after += *idl
+ exename = FactoryClient
+ source_files {
+ FactoryClient.cpp
+ CosEventChannelFactoryC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Server) : orbsvcsexe, event, event_serv, naming {
+ after += *idl
+ exename = FactoryServer
+ source_files {
+ main.cpp
+ FactoryDriver.cpp
+ CosEventChannelFactory_i.cpp
+ CosEventChannelFactoryS.cpp
+ CosEventChannelFactoryC.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/examples/CosEC/Factory/CosEventChannelFactory.idl b/TAO/orbsvcs/examples/CosEC/Factory/CosEventChannelFactory.idl
new file mode 100644
index 00000000000..9e68302b882
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Factory/CosEventChannelFactory.idl
@@ -0,0 +1,83 @@
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// CosEventChannelFactory.idl
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_COSEVENTCHANNELFACTORY_IDL
+#define TAO_COSEVENTCHANNELFACTORY_IDL
+
+#include "orbsvcs/CosEventChannelAdmin.idl"
+
+module CosEventChannelFactory
+{
+ // = TITLE
+ // Module that describes the Channel Factory.
+ //
+ exception DuplicateChannel
+ {
+ // = TITLE
+ // This exception is raised to indicate that a specified
+ // channel already exists.
+ };
+
+ exception NoSuchChannel
+ {
+ // = TITLE
+ // This exception is raised to indicate that a specified
+ // channel does not exist.
+ };
+
+ exception BindFailed
+ {
+ // = TITLE
+ // This exception is raised to indicate that the EventChannel
+ // could not be registered with the naming service.
+ };
+
+ interface ChannelFactory
+ {
+ // = TITLE
+ // Interface definition of the ChannelFactory.
+ //
+ // = DESCRIPTION
+ // The ChannelFactory is used to create,destroy and
+ // locate CosEventChannels.
+
+ CosEventChannelAdmin::EventChannel create (
+ in string channel_id,
+ in boolean store_in_naming_service) raises (DuplicateChannel, BindFailed);
+ // Creates a CosEventChannel given a channel id.
+ // The DuplicateChannel exception is raised if the channel
+ // already exists.
+ // BindFailed is raised if we failed to register the newly created channel
+ // with the naming service.
+
+ void destroy (
+ in string channel_id,
+ in boolean unbind_from_naming_service) raises (NoSuchChannel);
+ // Destroys the channel specified by the channel id.
+ // If the channel does not exist then the NoSuchChannel exception
+ // is raised.
+
+ CosEventChannelAdmin::EventChannel find (
+ in string channel_id) raises (NoSuchChannel);
+ // Finds an EventChannel given the channel id.
+ // If the channel does not exist then the NoSuchChannel exception
+ // is raised.
+
+ string find_channel_id (
+ in CosEventChannelAdmin::EventChannel channel) raises (NoSuchChannel);
+ // Returns a channel id given a reference to it.
+ // If the channel does not exist then the NoSuchChannel exception
+ // is raised.
+ };
+};
+
+#endif /* TAO_COSEVENTCHANNELFACTORY_IDL */
diff --git a/TAO/orbsvcs/examples/CosEC/Factory/CosEventChannelFactory_i.cpp b/TAO/orbsvcs/examples/CosEC/Factory/CosEventChannelFactory_i.cpp
new file mode 100644
index 00000000000..78b17a2bac9
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Factory/CosEventChannelFactory_i.cpp
@@ -0,0 +1,327 @@
+// -*- C++ -*-
+// $Id$
+
+#include "CosEventChannelFactory_i.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "ace/Auto_Ptr.h"
+
+TAO_CosEventChannelFactory_i::TAO_CosEventChannelFactory_i (void)
+ :poa_ (PortableServer::POA::_nil ()),
+ naming_ (CosNaming::NamingContext::_nil ())
+{
+}
+
+TAO_CosEventChannelFactory_i::~TAO_CosEventChannelFactory_i (void)
+{
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ "in TAO_CosEventChannelFactory_i dtor"));
+#endif
+ // No-Op.
+}
+
+int
+TAO_CosEventChannelFactory_i::init (PortableServer::POA_ptr poa,
+ const char* child_poa_name,
+ CosNaming::NamingContext_ptr naming
+ ACE_ENV_ARG_DECL)
+{
+ // Check if we have a parent poa.
+ if (CORBA::is_nil (poa))
+ return -1;
+
+ this->naming_ = CosNaming::NamingContext::_duplicate (naming);
+ // Save the naming context.
+
+ // Create a UNIQUE_ID and USER_ID policy because we want the POA
+ // to detect duplicates for us.
+ PortableServer::IdUniquenessPolicy_var idpolicy =
+ poa->create_id_uniqueness_policy (PortableServer::UNIQUE_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ PortableServer::IdAssignmentPolicy_var assignpolicy =
+ poa->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Create a PolicyList
+ CORBA::PolicyList policy_list;
+ policy_list.length (2);
+ policy_list [0] =
+ PortableServer::IdUniquenessPolicy::_duplicate (idpolicy.in ());
+ policy_list [1] =
+ PortableServer::IdAssignmentPolicy::_duplicate (assignpolicy.in ());
+
+ PortableServer::POAManager_ptr manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ // @@ Pradeep : TODO - find a way to destroy the policy_list if we return here.
+
+ // Create the child POA.
+ this->poa_ = poa->create_POA (child_poa_name,
+ manager,
+ policy_list
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (-1);
+
+ idpolicy->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ assignpolicy->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ //this->poa_ = PortableServer::POA::_duplicate (poa);
+ // uncomment this if we want to use the parent poa for some reason.
+ return 0;
+}
+
+CosEventChannelAdmin::EventChannel_ptr
+TAO_CosEventChannelFactory_i::create (const char * channel_id,
+ CORBA::Boolean store_in_naming_service
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelFactory::DuplicateChannel,
+ CosEventChannelFactory::BindFailed
+ ))
+{
+ ACE_ASSERT (!CORBA::is_nil (this->poa_.in ()));
+
+ CosEventChannelAdmin::EventChannel_var ec_return;
+
+ ACE_TRY
+ {
+ PortableServer::ObjectId_var oid =
+ PortableServer::string_to_ObjectId (channel_id);
+
+ // let all those contained in FactoryEC use the default POA.
+ // We only need the FactoryEC's to be unique!
+ PortableServer::POA_ptr defPOA = this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_CEC_EventChannel_Attributes attr (defPOA, defPOA);
+
+ TAO_CEC_EventChannel *impl = 0;
+ ACE_NEW_THROW_EX (impl,
+ TAO_CEC_EventChannel (attr, 0, 0),
+ CORBA::NO_MEMORY ());
+ ACE_TRY_CHECK;
+
+ auto_ptr <TAO_CEC_EventChannel> ec (impl);
+
+ impl->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->poa_->activate_object_with_id (oid.in (),
+ ec.get ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ec.release ();
+
+ CORBA::Object_var obj =
+ this->poa_->id_to_reference (oid.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (store_in_naming_service &&
+ !CORBA::is_nil (this->naming_.in ()))
+ {
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (channel_id);
+
+ this->naming_->rebind (name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ec_return = CosEventChannelAdmin::EventChannel::_narrow (obj.in ());
+ }
+ ACE_CATCH (PortableServer::POA::ServantAlreadyActive, sa_ex)
+ {
+ ACE_THROW_RETURN (CosEventChannelFactory::DuplicateChannel (),
+ ec_return._retn ());
+ }
+ ACE_CATCH (PortableServer::POA::ObjectAlreadyActive, oaa_ex)
+ {
+ ACE_THROW_RETURN (CosEventChannelFactory::DuplicateChannel (),
+ ec_return._retn ());
+ }
+ ACE_CATCH (PortableServer::POA::WrongPolicy, wp_ex)
+ {
+ ACE_THROW_RETURN (CORBA::UNKNOWN (),
+ ec_return._retn ());
+ }
+ ACE_CATCH (PortableServer::POA::ObjectNotActive, ona_ex)
+ {
+ ACE_THROW_RETURN (CosEventChannelFactory::BindFailed (),
+ ec_return._retn ());
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, nf_ex)
+ {
+ ACE_THROW_RETURN (CosEventChannelFactory::BindFailed (),
+ ec_return._retn ());
+ }
+ ACE_CATCH (CosNaming::NamingContext::CannotProceed, cp_ex)
+ {
+ ACE_THROW_RETURN (CosEventChannelFactory::BindFailed (),
+ ec_return._retn ());
+ }
+ ACE_CATCH (CosNaming::NamingContext::InvalidName, in_ex)
+ {
+ ACE_THROW_RETURN (CosEventChannelFactory::BindFailed (),
+ ec_return._retn ());
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound, ab)
+ {
+ ACE_THROW_RETURN (CosEventChannelFactory::BindFailed (),
+ ec_return._retn ());
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (ec_return._retn ());
+
+ return ec_return._retn ();
+}
+
+void
+TAO_CosEventChannelFactory_i::destroy
+(
+ const char * channel_id,
+ CORBA::Boolean unbind_from_naming_service
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelFactory::NoSuchChannel
+ ))
+{
+ ACE_ASSERT (!CORBA::is_nil (this->poa_.in ()));
+
+ ACE_TRY
+ {
+ // Get hold of the objectid first.
+ PortableServer::ObjectId_var oid =
+ PortableServer::string_to_ObjectId (channel_id);
+
+ CORBA::Object_var obj =
+ this->poa_->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosEventChannelAdmin::EventChannel_var fact_ec =
+ CosEventChannelAdmin::EventChannel::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ fact_ec->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Remove from the naming service.
+ if (unbind_from_naming_service &&
+ !CORBA::is_nil (this->naming_.in ()))
+ {
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (channel_id);
+
+ this->naming_->unbind (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, nf_ex)
+ {
+ return; // don't bother the user with exceptions if unbind fails.
+ }
+ ACE_CATCH (CosNaming::NamingContext::CannotProceed, cp_ex)
+ {
+ return; // don't bother the user with exceptions if unbind fails.
+ }
+ ACE_CATCH (CosNaming::NamingContext::InvalidName, in_ex)
+ {
+ return; // don't bother the user with exceptions if unbind fails.
+ }
+ ACE_CATCH (CORBA::UserException, ue) // Translate any other user exception.
+ {
+ ACE_THROW (CosEventChannelFactory::NoSuchChannel ());
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+CosEventChannelAdmin::EventChannel_ptr
+TAO_CosEventChannelFactory_i::find
+(
+ const char * channel_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelFactory::NoSuchChannel
+ ))
+{
+ ACE_ASSERT (!CORBA::is_nil (this->poa_.in ()));
+
+ CosEventChannelAdmin::EventChannel_var ec_return;
+
+ ACE_TRY
+ {
+ PortableServer::ObjectId_var oid =
+ PortableServer::string_to_ObjectId (channel_id);
+
+ CORBA::Object_var obj =
+ this->poa_->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ec_return = CosEventChannelAdmin::EventChannel::_narrow (obj.in ());
+ }
+ ACE_CATCH (CORBA::UserException, ue) // Translate any user exception.
+ {
+ ACE_THROW_RETURN (CosEventChannelFactory::NoSuchChannel (),
+ ec_return._retn ());
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (ec_return._retn ());
+
+ return ec_return._retn ();
+}
+
+char*
+TAO_CosEventChannelFactory_i::find_channel_id
+(
+ CosEventChannelAdmin::EventChannel_ptr channel
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelFactory::NoSuchChannel
+ ))
+{
+ ACE_ASSERT (!CORBA::is_nil (this->poa_.in ()));
+
+ CORBA::String_var str_return;
+ ACE_TRY
+ {
+ PortableServer::ObjectId_var oid =
+ this->poa_->reference_to_id (channel
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ str_return = PortableServer::ObjectId_to_string (oid.in ());
+ }
+ ACE_CATCH (CORBA::UserException, ue) // Translate any user exception.
+ {
+ ACE_THROW_RETURN (CosEventChannelFactory::NoSuchChannel (),
+ str_return._retn ());
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (str_return._retn ());
+
+ return str_return._retn ();
+}
+
diff --git a/TAO/orbsvcs/examples/CosEC/Factory/CosEventChannelFactory_i.h b/TAO/orbsvcs/examples/CosEC/Factory/CosEventChannelFactory_i.h
new file mode 100644
index 00000000000..f1a137b5372
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Factory/CosEventChannelFactory_i.h
@@ -0,0 +1,119 @@
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/examples/CosEC/Factory
+//
+// = FILENAME
+// CosEventChannelFactory_i.h
+//
+// = DESCRIPTION
+// This class implements the CosEventChannelFactory
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_COSEVENTCHANNELFACTORY_I_H
+#define TAO_COSEVENTCHANNELFACTORY_I_H
+
+#include /**/ "ace/pre.h"
+
+#include "CosEventChannelFactoryS.h"
+#include "orbsvcs/CosNamingC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_CosEventChannelFactory_i :
+ public virtual POA_CosEventChannelFactory::ChannelFactory
+{
+ public:
+ // = Initialization and termination code.
+ TAO_CosEventChannelFactory_i (void);
+ // Constructor.
+
+ ~TAO_CosEventChannelFactory_i (void);
+ // Destructor.
+
+ int init (PortableServer::POA_ptr poa,
+ const char* child_poa_name,
+ CosNaming::NamingContext_ptr naming = CosNaming::NamingContext::_nil ()
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ // This method creates a child poa with <poa> as the
+ // parent. It also accepts a Naming_Context which is used to register
+ // the event channels if specified.
+ // Returns -1 on error, 0 on success.
+ // @@ Pradeep: this looks OK. I wonder if it would be a good idea to
+ // raise exceptions, but I'm undecided.
+ // @@ Pradeep: when is the child poa destroyed? Maybe we should add
+ // a destroy() method to the factory interface (in IDL).
+ // @@ Carlos: if we add a <destroy> to the factory, any client will be
+ // able to destroy the factory!
+ // @@ Pradeep: it could be a method of the Factory_i class, it
+ // doesn't have to be exposed through the IDL interface. Anyway,
+ // there must be a way to cleanup any resources created by the
+ // factory, and you must avoid CORBA calls in the destructor,
+ // first because you won't have an ACE_ENV_SINGLE_ARG_PARAMETER and second because
+ // exceptions in destructors are evil.
+ // @@ Pradeep: anyway you can just use exceptions and not return -1?
+
+ // = CosEventChannelFactory::ChannelFactory methods.
+ virtual CosEventChannelAdmin::EventChannel_ptr create
+ (
+ const char * channel_id,
+ CORBA::Boolean store_in_naming_service
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelFactory::DuplicateChannel,
+ CosEventChannelFactory::BindFailed
+ ));
+
+ virtual void destroy
+ (
+ const char * channel_id,
+ CORBA::Boolean unbind_from_naming_service
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelFactory::NoSuchChannel
+ ));
+
+ virtual CosEventChannelAdmin::EventChannel_ptr find
+ (
+ const char * channel_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelFactory::NoSuchChannel
+ ));
+
+ virtual char * find_channel_id
+ (
+ CosEventChannelAdmin::EventChannel_ptr channel
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelFactory::NoSuchChannel
+ ));
+ protected:
+
+ PortableServer::POA_var poa_;
+ // The Poa with which we activate all the Event Channels.
+
+ CosNaming::NamingContext_var naming_;
+ // The naming context to use.
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_COSEVENTCHANNELFACTORY_I_H */
diff --git a/TAO/orbsvcs/examples/CosEC/Factory/FactoryClient.cpp b/TAO/orbsvcs/examples/CosEC/Factory/FactoryClient.cpp
new file mode 100644
index 00000000000..72c9ebc763b
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Factory/FactoryClient.cpp
@@ -0,0 +1,418 @@
+// -*- C++ -*-
+// $Id$
+
+#include "CosEventChannelFactoryC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "ace/Log_Msg.h"
+
+class FactoryClient
+{
+ // = TITLE
+ // A simple client to test the CosEC factory
+ //
+ // = DESCRIPTION
+ // Test Client for the CosEC factory.
+
+public:
+ // Initialization and termination methods
+ FactoryClient (void);
+ // constructor.
+
+ virtual ~FactoryClient (void);
+ // destructor.
+
+ 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_factory (ACE_ENV_SINGLE_ARG_DECL);
+ // Try to resolve the factory from the Naming service.
+
+ CosEventChannelFactory::ChannelFactory_ptr
+ create_factory (ACE_ENV_SINGLE_ARG_DECL);
+ // Create a local Factory and also set the <factory_>.
+
+ virtual void run_test (ACE_ENV_SINGLE_ARG_DECL);
+ // Runs a couple of tests to check if the factory behaves correctly.
+
+protected:
+ CosEventChannelAdmin::EventChannel_ptr
+ create_channel (const char *channel_id,
+ CosEventChannelFactory::ChannelFactory_ptr factory
+ ACE_ENV_ARG_DECL);
+ // Create a channel.
+
+ void destroy_channel (const char *channel_id
+ ACE_ENV_ARG_DECL);
+ // Destroy the channel.
+
+ void find_channel (const char* channel_id
+ ACE_ENV_ARG_DECL);
+ // Find a channel.
+
+ void find_channel_id (CosEventChannelAdmin::EventChannel_ptr channel
+ ACE_ENV_ARG_DECL);
+ // Find a channel.
+
+ // = Protected Data members.
+ const char* factory_name_;
+ // The name of the factory registered with the naming service.
+
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ CosNaming::NamingContext_var naming_context_;
+ // Handle to the name service.
+
+ CosEventChannelFactory::ChannelFactory_var factory_;
+ // object from naming service.
+
+ int use_naming_service;
+ // flag to indicate if the naming service should be used.
+};
+
+FactoryClient::FactoryClient (void)
+ :factory_name_ ("CosEC_Factory"),
+ use_naming_service (0)
+{
+ // No-Op.
+}
+
+FactoryClient::~FactoryClient (void)
+{
+ // No-Op.
+}
+
+void
+FactoryClient::init_ORB (int argc,
+ char *argv []
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+FactoryClient::resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService"
+ 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;
+
+ this->use_naming_service = 1;
+}
+
+void
+FactoryClient::resolve_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_ASSERT (this->use_naming_service == 1);
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (this->factory_name_);
+
+ CORBA::Object_var obj =
+ this->naming_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->factory_ =
+ CosEventChannelFactory::ChannelFactory::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CosEventChannelFactory::ChannelFactory_ptr
+FactoryClient::create_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_THROW_RETURN (CORBA::UNKNOWN (),
+ CosEventChannelFactory::ChannelFactory::_nil ());
+}
+
+CosEventChannelAdmin::EventChannel_ptr
+FactoryClient::create_channel (const char *channel_id,
+ CosEventChannelFactory::ChannelFactory_ptr factory
+ ACE_ENV_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "Trying to create channel %s\n", channel_id));
+
+ CosEventChannelAdmin::EventChannel_var ec =
+ CosEventChannelAdmin::EventChannel::_nil ();
+
+ ACE_TRY
+ {
+ ec = factory->create (channel_id,
+ this->use_naming_service
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (ec.in ()));
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Created Cos Event Channel \"%s \"\n",
+ channel_id));
+ }
+ ACE_CATCH (CORBA::UserException, ue)
+ {
+ ACE_PRINT_EXCEPTION (ue,
+ "User Exception in createChannel: ");
+ return CosEventChannelAdmin::EventChannel::_nil ();
+ }
+ ACE_CATCH (CORBA::SystemException, se)
+ {
+ ACE_PRINT_EXCEPTION (se,
+ "System Exception in createChannel: ");
+ return CosEventChannelAdmin::EventChannel::_nil ();
+ }
+ ACE_ENDTRY;
+
+ return ec._retn ();
+}
+
+void
+FactoryClient::destroy_channel (const char *channel_id
+ ACE_ENV_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "Destroying Cos Event Channel \"%s \"\n",
+ channel_id));
+
+ this->factory_->destroy (channel_id,
+ use_naming_service
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+FactoryClient::find_channel (const char* channel_id
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "trying to find the Channel \"%s \"\n",
+ channel_id));
+
+ CosEventChannelAdmin::EventChannel_var channel =
+ this->factory_->find (channel_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ CORBA::String_var str =
+ orb_->object_to_string (channel.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Find returned - %s \n",
+ str.in ()));
+
+ this->find_channel_id (channel.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::UserException, ue)
+ {
+ ACE_PRINT_EXCEPTION (ue,
+ "User Exception in findchannel: ");
+ }
+ ACE_CATCH (CORBA::SystemException, se)
+ {
+ ACE_PRINT_EXCEPTION (se,
+ "System Exception in findchannel: ");
+ }
+ ACE_ENDTRY;
+}
+
+void
+FactoryClient::find_channel_id (CosEventChannelAdmin::EventChannel_ptr channel
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::String_var str =
+ orb_->object_to_string (channel
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "trying to find the Channel %s \n",
+ str.in ()));
+
+ char *channel_id =
+ this->factory_->find_channel_id (channel
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "find returned %s\n", channel_id));
+}
+
+/*
+ * excercise the factory: create 3 Channels and test the factory.
+ */
+
+void
+FactoryClient::run_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (this->factory_.in ()));
+
+ const char *channel_id [3] = {"cosec1", "cosec2", "cosec3"};
+ CosEventChannelAdmin::EventChannel_var cosec [3];
+
+ // create the first cosec
+ cosec[0] = this->create_channel (channel_id[0],
+ this->factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // create the second cosec
+ cosec[1] = this->create_channel (channel_id[1],
+ this->factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // create the third cosec
+ cosec[2] = this->create_channel (channel_id[2],
+ this->factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // see it we can destroy this one..
+ this->destroy_channel (channel_id[2]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // see if we can find it?
+ this->find_channel_id (cosec[2].in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // see if we can create it again?
+ cosec[2] = this->create_channel (channel_id[2],
+ this->factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // try and find a channel that does not exist.
+ this->find_channel ("areyouthere?"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // see if it can detect duplicates.
+ this->create_channel (channel_id[2],
+ this->factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // see if it can give us the id?
+ this->find_channel_id (cosec[0].in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->find_channel_id (cosec[1].in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->find_channel_id (cosec[2].in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // check if we can get the channels from the id.
+ this->find_channel (channel_id[0]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->find_channel (channel_id[1]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->find_channel (channel_id[2]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ //destroy them all.
+ this->destroy_channel (channel_id[0]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_channel (channel_id[1]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_channel (channel_id[2]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // end of testing.
+ ACE_DEBUG ((LM_DEBUG,
+ "Factory testing complete\n"));
+}
+
+int
+main (int argc, char *argv [])
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "The FactoryClient will test the Cos Event Channel Factory\n"));
+ ACE_TRY_NEW_ENV
+ {
+ FactoryClient ft;
+
+ ft.init_ORB (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TRY_EX (naming)
+ {
+ ft.resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (naming);
+
+ ft.resolve_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (naming);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Failed to resolve the naming service");
+ ACE_DEBUG ((LM_DEBUG,
+ "Creating a local Factory\n"));
+ // TBD:
+ ft.create_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_ENDTRY;
+
+ ft.run_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::UserException, ue)
+ {
+ ACE_PRINT_EXCEPTION (ue,
+ "test failed: User Exception in FactoryClient: ");
+ return 1;
+ }
+ ACE_CATCH (CORBA::SystemException, se)
+ {
+ ACE_PRINT_EXCEPTION (se,
+ "test failed: System Exception in FactoryClient: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.cpp b/TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.cpp
new file mode 100644
index 00000000000..845ee110d77
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.cpp
@@ -0,0 +1,168 @@
+// -*- C++ -*-
+// $Id$
+
+#include "FactoryDriver.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+
+FactoryDriver::FactoryDriver (const char* name)
+ :factoryName_ (name),
+ child_poa_name_ ("CosEC_ChildPOA"),
+ factory_servant_ (0)
+{
+ //No-Op.
+}
+
+FactoryDriver::~FactoryDriver (void)
+{
+ //No-Op.
+}
+
+int
+FactoryDriver::parse_args (int argc, char *argv [])
+{
+ ACE_Get_Opt get_opts (argc, argv, "dr:");
+ int c = 0;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // debug flag.
+ TAO_debug_level++;
+ break;
+
+ case 'r':
+ factoryName_ = get_opts.opt_arg ();
+ break;
+
+ case '?': // display help for use of the server.
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-r] <Factory Name>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+int
+FactoryDriver::start (int argc, char *argv [])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ orb_ = CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->parse_args (argc, argv) == -1)
+ return -1;
+
+ // Ref counted servants are on the heap..
+ ACE_NEW_RETURN (factory_servant_,
+ TAO_CosEventChannelFactory_i (),
+ -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);
+
+ 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;
+
+ // Initialization of the naming service.
+ if (naming_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 =
+ naming_client_.get_context ();
+
+ if (factory_servant_->init (root_poa_.in (),
+ child_poa_name_,
+ context.in ()
+ ACE_ENV_ARG_PARAMETER) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Unable to initialize "
+ "the factory. \n"),
+ 1);
+
+ // activate the factory in the root poa.
+ factory_ = factory_servant_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Give the ownership to the POA.
+ factory_servant_->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+ CORBA::String_var
+ str = orb_->object_to_string (factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "CosEvent_Service: The Cos Event Channel Factory IOR is <%s>\n",
+ str.in ()));
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (factoryName_);
+ naming_client_->rebind (name,
+ factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Registered with the naming service as %s\n", factoryName_));
+
+ orb_->run ();
+ }
+ ACE_CATCH (CORBA::UserException, ue)
+ {
+ ACE_PRINT_EXCEPTION (ue,
+ "cosecfactory: ");
+ return 1;
+ }
+ ACE_CATCH (CORBA::SystemException, se)
+ {
+ ACE_PRINT_EXCEPTION (se,
+ "cosecfactory: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (1);
+
+ return 0;
+}
+
+int
+FactoryDriver::stop (void)
+{
+ orb_->shutdown ();
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.h b/TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.h
new file mode 100644
index 00000000000..97d837a7c2e
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.h
@@ -0,0 +1,80 @@
+
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/examples/CosEC/Factory
+//
+// = FILENAME
+// FactoryDriver.h
+//
+// = DESCRIPTION
+// This class implements the Factory driver.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_FACTORYDRIVER_H
+#define TAO_FACTORYDRIVER_H
+
+#include "CosEventChannelFactory_i.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+
+// @@ Pradeep: I know this is just an example, but could you talk to
+// Vishal about making this a service that could be bootstraped
+// using the -ORBInitRef mechanisms? That way we can run this
+// stuff without the naming service running.
+
+class FactoryDriver
+{
+ // = TITLE
+ // Driver class for the CosEventChannel Factory.
+ // = DESCRIPTION
+ // creates a CosEventChannel Factory and registers it with the
+ // naming service.
+ //
+ public:
+ // = Initialization and termination code.
+ FactoryDriver (const char* factory = "CosEC_Factory");
+ // Constructor.
+
+ ~FactoryDriver (void);
+ // Destructor.
+
+ int start (int argc, char *argv []);
+ // Start the driver.
+
+ int stop (void);
+ //Stop the driver.
+
+ protected:
+ int parse_args (int argc, char *argv []);
+ // Parse the command-line arguments and set options.
+
+ const char* factoryName_;
+ // The name of the factory registered with the naming service.
+
+ const char* child_poa_name_;
+ // The name of the Child POA.
+
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ TAO_CosEventChannelFactory_i *factory_servant_;
+ // The factory servant.
+
+ PortableServer::POA_var root_poa_;
+ // Reference to the root poa.
+
+ CosEventChannelFactory::ChannelFactory_var factory_;
+ // The corba object after activation.
+
+ TAO_Naming_Client naming_client_;
+ // Use a naming client.
+
+};
+#endif /* TAO_FACTORYDRIVER_H */
diff --git a/TAO/orbsvcs/examples/CosEC/Factory/Makefile.am b/TAO/orbsvcs/examples/CosEC/Factory/Makefile.am
new file mode 100644
index 00000000000..9eeb947e9d0
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Factory/Makefile.am
@@ -0,0 +1,139 @@
+## 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.CosEC_Factory_Idl.am
+
+BUILT_SOURCES = \
+ CosEventChannelFactoryC.cpp \
+ CosEventChannelFactoryC.h \
+ CosEventChannelFactoryC.inl \
+ CosEventChannelFactoryS.cpp \
+ CosEventChannelFactoryS.h \
+ CosEventChannelFactoryS.inl \
+ CosEventChannelFactoryS_T.cpp \
+ CosEventChannelFactoryS_T.h \
+ CosEventChannelFactoryS_T.inl
+
+CLEANFILES = \
+ CosEventChannelFactory-stamp \
+ CosEventChannelFactoryC.cpp \
+ CosEventChannelFactoryC.h \
+ CosEventChannelFactoryC.inl \
+ CosEventChannelFactoryS.cpp \
+ CosEventChannelFactoryS.h \
+ CosEventChannelFactoryS.inl \
+ CosEventChannelFactoryS_T.cpp \
+ CosEventChannelFactoryS_T.h \
+ CosEventChannelFactoryS_T.inl
+
+CosEventChannelFactoryC.cpp CosEventChannelFactoryC.h CosEventChannelFactoryC.inl CosEventChannelFactoryS.cpp CosEventChannelFactoryS.h CosEventChannelFactoryS.inl CosEventChannelFactoryS_T.cpp CosEventChannelFactoryS_T.h CosEventChannelFactoryS_T.inl: CosEventChannelFactory-stamp
+
+CosEventChannelFactory-stamp: $(srcdir)/CosEventChannelFactory.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT $(srcdir)/CosEventChannelFactory.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ CosEventChannelFactory.idl
+
+## Makefile.CosEC_Factory_Client.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += FactoryClient
+
+FactoryClient_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
+
+FactoryClient_SOURCES = \
+ CosEventChannelFactoryC.cpp \
+ FactoryClient.cpp \
+ CosEventChannelFactory_i.h \
+ FactoryDriver.h
+
+FactoryClient_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.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
+
+## Makefile.CosEC_Factory_Server.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += FactoryServer
+
+FactoryServer_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
+
+FactoryServer_SOURCES = \
+ CosEventChannelFactoryC.cpp \
+ CosEventChannelFactoryS.cpp \
+ CosEventChannelFactory_i.cpp \
+ FactoryDriver.cpp \
+ main.cpp \
+ CosEventChannelFactory_i.h \
+ FactoryDriver.h
+
+FactoryServer_LDADD = \
+ $(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_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/examples/CosEC/Factory/README b/TAO/orbsvcs/examples/CosEC/Factory/README
new file mode 100644
index 00000000000..29104ea2b9f
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Factory/README
@@ -0,0 +1,45 @@
+// $Id$
+ CosEventChannelFactory
+ ======================================================
+
+The CosEventChannelFactory is a factory for creating COS Event
+Channels. The ChannelFactory interface allows a client to create,
+destroy and locate factories.
+
+IMPLEMENTATION
+==============
+
+The TAO_CosEventChannelFactory_i class implements the C++ servant for
+the ChannelFactory interface. The FactoryDriver class activates the
+ChannelFactory servant with the ORB. During initialization the
+ChannelFactory creates a child POA which is used to activate all the
+CosEC servants.The ChannelFactory uses the CosEC_ServantBase class to
+create the CosEvent Channels.
+
+The Makefile in this directory generates 2 executables: factory and
+factoryclient.
+
+FACTORY
+=======
+
+To allow client applications to obtain a reference to the factory, a
+Naming service must be started prior to running the factory.
+
+The factory options are:
+
+ -r <FactoryName> : specifies under what name the factory should be
+
+registered with the Naming Service. The default is "CosEC_Factory"
+
+FACTORYCLIENT
+=============
+
+The factory client is a test driver for the factory. It exercises all
+the features of the factory. A Naming Service and a factory must be
+running prior to running the factoryclient. factoryclient does not
+take any command line options.
+
+AUTHOR
+======
+
+Pradeep Gore <pradeep@cs.wustl.edu>
diff --git a/TAO/orbsvcs/examples/CosEC/Factory/main.cpp b/TAO/orbsvcs/examples/CosEC/Factory/main.cpp
new file mode 100644
index 00000000000..2ca49905292
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Factory/main.cpp
@@ -0,0 +1,14 @@
+// -*- C++ -*-
+// $Id$
+
+#include "FactoryDriver.h"
+#include "orbsvcs/CosEvent/CEC_Default_Factory.h"
+
+int
+main (int argc, char *argv [])
+{
+ TAO_CEC_Default_Factory::init_svcs ();
+ FactoryDriver driver;
+ driver.start (argc, argv);
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/CosEC/Makefile.am b/TAO/orbsvcs/examples/CosEC/Makefile.am
new file mode 100644
index 00000000000..fc83f662130
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/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 = \
+ Factory \
+ RtEC_Based \
+ Simple \
+ TypedSimple
+
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/Makefile.am b/TAO/orbsvcs/examples/CosEC/RtEC_Based/Makefile.am
new file mode 100644
index 00000000000..8c8daad071b
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/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 = \
+ lib \
+ bin \
+ tests
+
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/README b/TAO/orbsvcs/examples/CosEC/RtEC_Based/README
new file mode 100644
index 00000000000..a90ec511868
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/README
@@ -0,0 +1,7 @@
+# $Id$
+
+ This directory contains a partial implementation of the COS
+Event Service, using TAO's RT Event Service as the backend. It is
+preserved for historical reasons, most applications are better served
+by the full implementation of the COS Event Service included with TAO
+or by the standard Notification Service.
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/CosEC_RtEC_Based_bin.mpc b/TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/CosEC_RtEC_Based_bin.mpc
new file mode 100644
index 00000000000..d74001a0687
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/CosEC_RtEC_Based_bin.mpc
@@ -0,0 +1,15 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcsexe, rtevent_serv, event_skel, naming {
+ after += CosEC_RtEC_Based_lib
+ libs += CosEC_RtEC_Based
+
+ specific (automake) {
+ includes += $(srcdir)/../lib
+ } else {
+ includes += ../lib
+ }
+
+ libpaths += ../lib
+}
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/Makefile.am b/TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/Makefile.am
new file mode 100644
index 00000000000..74f7f1dd02d
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/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.CosEC_RtEC_Based_bin.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = RtEC_Based_CosEC
+
+RtEC_Based_CosEC_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
+
+RtEC_Based_CosEC_SOURCES = \
+ RtEC_Based_CosEC.cpp \
+ RtEC_Based_CosEC.h
+
+RtEC_Based_CosEC_LDADD = \
+ $(top_builddir)/orbsvcs/examples/CosEC/RtEC_Based/lib/libCosEC_RtEC_Based.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.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_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/examples/CosEC/RtEC_Based/bin/README b/TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/README
new file mode 100644
index 00000000000..9f9ac585a75
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/README
@@ -0,0 +1,82 @@
+ CORBA COS Event Service
+ -----------------------
+
+The CosEvent_Service is a COS compilant Event Service.
+
+The service is registered with the naming service with the name
+"CosEventService" . It exposes the <EventChannel> interface which can be
+used by suppliers and consumers to send and receive events.
+
+WARNING: In TAO 1.0.14 we introduced a new implementation of the COS
+Event Service, this new implementation supports both the push and pull
+models, and does not use the Real-time Event Service as its backend.
+Both implementations are useful, for example, the native
+implementation is more efficient and fully featured, but cannot
+exploit the features in the RTEC, such as filtering and multicast
+based federations.
+
+To run the Event Channel:
+------------------------
+1. you should have a running Naming Service.
+ if not, start one at $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service
+
+2. if you want to use the -t option you should have a running
+ Real Time Event Channel.
+ if not, start one at $TAO_ROOT/orbsvcs/Event_Service/Event_Service
+
+3. execute the CosEvent_Service.
+
+Command line parameters:
+------------------------
+ -n <COS Event Service name>
+ specifies the name with which to register the Event Service.
+
+ -r
+ specifies that a local Real Time Event Channel (Rtec) should be
+ created and used.
+
+ -t <Real Time Event Service name>
+ specifies the name with which to *look* for the RtEC.This option is
+ only useful along with the -r option.
+
+The next 3 options are used to introduce a filtering mechanism for the
+Event Channel based on event types and source ids.
+
+ -e ["EventType_1 EventType_2..."]
+ specifies the event types for the ConsumerQOS.When the Rtec is being
+ setup, the ConsumerQOS is specified.
+ The event types should start at >= ACE_ES_EVENT_UNDEFINED = 16.
+ e.g. -e "17 20 40" specifies that event types with ids 17, 20 and 40
+ should be passed to the consumers.
+
+ -o ["EventSourceID_1 EventSourceID_2.."]
+ specifies the source ids for the ConsumerQOS.
+
+ -p ["sourceID EventTypeID"]
+ specifies a pair of sourceid and event type for the Supplier QOS.
+
+
+Running the native COS Event Channel
+------------------------------------
+
+ The native implementation of the COS Event Channel is run
+using:
+
+$ CosEvent_Service_Native
+
+ on top of the regular -ORB arguments and the service
+configurator parameters described in:
+
+$TAO_ROOT/docs/cec_options.html
+
+ this implementation also understands the following arguments:
+
+ -n name Use <name> when binding the object
+ reference in the naming service
+ -r Use rebind() to store the object
+ reference in the naming service
+ -x do not use the naming service
+
+Author:
+-------
+Pradeep Gore <pradeep@cs.wustl.edu>
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/RtEC_Based_CosEC.cpp b/TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/RtEC_Based_CosEC.cpp
new file mode 100644
index 00000000000..68f393240e7
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/RtEC_Based_CosEC.cpp
@@ -0,0 +1,311 @@
+// $Id$
+
+#include "RtEC_Based_CosEC.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "ace/Get_Opt.h"
+
+RtEC_Based_CosEC::RtEC_Based_CosEC (void)
+ : service_name ("CosEventService"),
+ rt_service_name ("EventService"),
+ remote_rtec_ (0)
+{
+ // No-Op.
+}
+
+RtEC_Based_CosEC::~RtEC_Based_CosEC (void)
+{
+ // No-Op.
+}
+
+void
+RtEC_Based_CosEC::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_var poa_object =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->poa_ =
+ PortableServer::POA::_narrow (poa_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+RtEC_Based_CosEC::parse_args (int argc, char *argv [])
+{
+ ACE_Get_Opt get_opt (argc, argv, "t:n:e:o:p:r");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'n':
+ this->service_name = get_opt.opt_arg ();
+ break;
+
+ case 't':
+ this->rt_service_name = get_opt.opt_arg ();
+ break;
+
+ case 'r':
+ this->remote_rtec_ = 1;
+ break;
+
+ case 'e':
+ this->eventTypeIds_ = get_opt.opt_arg ();
+ break;
+
+ case 'o':
+ this->eventSourceIds_ = get_opt.opt_arg ();
+ break;
+
+ case 'p':
+ this->source_type_pairs_ = get_opt.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "\n\t-n <COS Event Service name>"
+ "\n\t-t <RealTime Event Service name>"
+ "\n\t-r" // creates the RtEC locally.
+ "\n\t-e [\"EventType_1, EventType_2...\"] for ConsumerQOS."
+ "\n\t-o [\"EventSourceID_1, [EventSourceID_2...\"] for ConsumerQOS."
+ "\n\t-p [\"Source, Event\" pairs] for SupplierQOS."
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+void
+RtEC_Based_CosEC::startup (int argc, char *argv[]
+ ACE_ENV_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "Starting up the CosEvent Service...\n"));
+
+ // initalize the ORB.
+ this->init_ORB (argc, argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->parse_args (argc, argv) == -1)
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ this->resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->init (this->poa_.in (),
+ this->poa_.in (),
+ this->eventTypeIds_,
+ this->eventSourceIds_,
+ this->source_type_pairs_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Register ourselves with the naming service.
+ ACE_ASSERT(!CORBA::is_nil (this->naming_.in ()));
+
+ CORBA::Object_var obj =
+ this->poa_->servant_to_reference (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::String_var str =
+ this->orb_->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "The CosEC IOR is <%s>\n", str.in ()));
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (this->service_name);
+
+ this->naming_->rebind (name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Registered with the naming service as: %s\n",
+ this->service_name));
+}
+
+POA_RtecEventChannelAdmin::EventChannel_ptr
+RtEC_Based_CosEC::create_rtec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // see if the user wants a local RtEC..
+ if (this->remote_rtec_ == 0)
+ return CosEC_ServantBase::create_rtec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ else
+ return 0;
+}
+
+void
+RtEC_Based_CosEC::activate_rtec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // see if the user wants to use a local RtEC..
+ if (this->remote_rtec_ == 0)
+ {
+ CosEC_ServantBase::activate_rtec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ // Try to locate a remote rtec.
+ this->locate_rtec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Use the return value to check success.
+ if (CORBA::is_nil (this->rtec_.in ()))
+ ACE_DEBUG ((LM_DEBUG,
+ "Could not locate a RT EventChannel.Please start one and try again\n"));
+ }
+}
+
+void
+RtEC_Based_CosEC::deactivate_rtec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Check if the local rtec is to be deactivated.
+ if (this->remote_rtec_ == 0)
+ {
+ CosEC_ServantBase::deactivate_rtec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+RtEC_Based_CosEC::locate_rtec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNaming::Name ref_name (1);
+ ref_name.length (1);
+ ref_name[0].id =
+ CORBA::string_dup (this->rt_service_name);
+
+ CORBA::Object_var obj =
+ this->naming_->resolve (ref_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->rtec_ =
+ RtecEventChannelAdmin::EventChannel::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+RtEC_Based_CosEC::resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService"
+ 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::NamingContext::_narrow (naming_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+RtEC_Based_CosEC::run (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "%s: Running the CosEventService\n", __FILE__));
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "run"), 1);
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+void
+RtEC_Based_CosEC::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Deactivate.
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Unbind from the naming service.
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (this->service_name);
+
+ this->naming_->unbind (name
+ ACE_ENV_ARG_PARAMETER);
+
+ // shutdown the ORB.
+ if (!CORBA::is_nil (this->orb_.in ()))
+ this->orb_->shutdown ();
+}
+
+int
+main (int argc, char *argv[])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ RtEC_Based_CosEC service;
+
+ ACE_TRY_NEW_ENV
+ {
+ service.startup (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (service.run () == -1)
+ {
+ service.shutdown ();
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Failed to run the CosEventService.\n"),
+ 1);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Failed to start CosEventService");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ service.shutdown ();
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/RtEC_Based_CosEC.h b/TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/RtEC_Based_CosEC.h
new file mode 100644
index 00000000000..72f1bd8224f
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/bin/RtEC_Based_CosEC.h
@@ -0,0 +1,106 @@
+/* -*- C++ -*- */
+// $Id$
+// ============================================================================
+//
+// = FILENAME
+// RtEC_Based_CosEC.h
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// = DESCRIPTION
+// The COS Event Channel service.
+//
+// ============================================================================
+
+#ifndef RTEC_BASED_COSEC_H
+#define RTEC_BASED_COSEC_H
+
+#include "CosEvent_Utilities.h"
+#include "orbsvcs/CosNamingC.h"
+
+#if defined (_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class RtEC_Based_CosEC : public CosEC_ServantBase
+{
+ // = TITLE
+ // RtEC_Based_CosEC
+ //
+ // = DESCRIPTION
+ // Implementation of the COS Event Service.
+
+ public:
+ // = Initialization and termination methods.
+ RtEC_Based_CosEC (void);
+ // Constructor.
+
+ virtual ~RtEC_Based_CosEC (void);
+ // Destructor.
+
+ int parse_args (int argc, char *argv []);
+ // Parses the command line arguments.
+
+ void startup (int argc, char *argv[]
+ ACE_ENV_ARG_DECL);
+ // Initializes the COS Event Service.
+ // Returns 0 on success, -1 on error.
+
+ int run (void);
+ // run the COS Event Service.
+ // Returns 0 on success, -1 on error.
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ // Shutdown the COS Event Service.
+ // Returns 0 on success, -1 on error.
+
+protected:
+ // = Methods from CosEC_ServantBase
+ virtual POA_RtecEventChannelAdmin::EventChannel_ptr
+ create_rtec (ACE_ENV_SINGLE_ARG_DECL);
+ // Create a local rtec.
+
+ virtual void activate_rtec (ACE_ENV_SINGLE_ARG_DECL);
+ // Activates the rtec.
+
+ virtual void deactivate_rtec (ACE_ENV_SINGLE_ARG_DECL);
+ // Deactivates the rtec.
+
+ void init_ORB (int& argc, char *argv []
+ ACE_ENV_ARG_DECL);
+ // initialize the ORB.
+
+ void resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL);
+ // Resolve the naming service.
+
+ void locate_rtec (ACE_ENV_SINGLE_ARG_DECL);
+ // Locate a rtec.
+
+ // = Data members
+ const char* service_name;
+ // The name we use to register with the Naming Service.
+
+ const char* rt_service_name;
+ // The name of the Real Time Event Service.
+
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ PortableServer::POA_var poa_;
+ // Reference to the root poa.
+
+ CosNaming::NamingContext_var naming_;
+ // A naming context.
+
+ CORBA::Boolean remote_rtec_;
+ // Flag to indicate if the RtEC is local/remote,
+ // 0 => local, 1 => remote, default is local.
+};
+
+#if defined (_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* RTEC_BASED_COSEC_H */
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ConsumerAdmin_i.cpp b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ConsumerAdmin_i.cpp
new file mode 100644
index 00000000000..8aa8fcdb042
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ConsumerAdmin_i.cpp
@@ -0,0 +1,68 @@
+// $Id$
+
+#include "ConsumerAdmin_i.h"
+#include "ace/Auto_Ptr.h"
+
+TAO_CosEC_ConsumerAdmin_i::TAO_CosEC_ConsumerAdmin_i (void)
+ : qos_ (),
+ rtec_consumeradmin_ (RtecEventChannelAdmin::ConsumerAdmin::_nil ())
+{
+ // No-Op.
+}
+
+TAO_CosEC_ConsumerAdmin_i::~TAO_CosEC_ConsumerAdmin_i (void)
+{
+ // No-Op.
+}
+
+int
+TAO_CosEC_ConsumerAdmin_i::init (const RtecEventChannelAdmin::ConsumerQOS &consumerqos,
+ RtecEventChannelAdmin::ConsumerAdmin_ptr rtec_consumeradmin)
+{
+ this->qos_ = consumerqos;
+ this->rtec_consumeradmin_ =
+ RtecEventChannelAdmin::ConsumerAdmin::_duplicate (rtec_consumeradmin);
+ return 0;
+}
+
+CosEventChannelAdmin::ProxyPushSupplier_ptr
+TAO_CosEC_ConsumerAdmin_i::obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosEventChannelAdmin::ProxyPushSupplier_ptr proxysupplier_nil =
+ CosEventChannelAdmin::ProxyPushSupplier::_nil ();
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var rtecproxypushsupplier =
+ this->rtec_consumeradmin_->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxysupplier_nil);
+
+ TAO_CosEC_ProxyPushSupplier_i *proxypushsupplier;
+
+ ACE_NEW_RETURN (proxypushsupplier,
+ TAO_CosEC_ProxyPushSupplier_i (this->qos_,
+ rtecproxypushsupplier.in ()),
+ proxysupplier_nil);
+
+ auto_ptr<TAO_CosEC_ProxyPushSupplier_i>
+ auto_proxysupplier (proxypushsupplier);
+
+ CosEventChannelAdmin::ProxyPushSupplier_ptr proxy_obj =
+ auto_proxysupplier.get ()->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxysupplier_nil);
+
+ // give the ownership to the POA.
+ auto_proxysupplier.get ()->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxysupplier_nil);
+
+ auto_proxysupplier.release ();
+ return proxy_obj;
+}
+
+CosEventChannelAdmin::ProxyPullSupplier_ptr
+TAO_CosEC_ConsumerAdmin_i::obtain_pull_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // TODO: implement this.
+ return CosEventChannelAdmin::ProxyPullSupplier::_nil ();
+}
+
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ConsumerAdmin_i.h b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ConsumerAdmin_i.h
new file mode 100644
index 00000000000..e6142c993ef
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ConsumerAdmin_i.h
@@ -0,0 +1,69 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO services
+//
+// = FILENAME
+// ConsumerAdmin_i
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// = DESCRIPTION
+// This has the implementation of the
+// CosEventChannelAdmin::ConsumerAdmin interface.
+//
+// ============================================================================
+
+#ifndef CONSUMERADMIN_I_H
+#define CONSUMERADMIN_I_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/CosEventChannelAdminS.h"
+#include "ProxyPushSupplier_i.h"
+
+class TAO_RTEC_COSEC_Export TAO_CosEC_ConsumerAdmin_i :
+ public virtual POA_CosEventChannelAdmin::ConsumerAdmin
+{
+ // = TITLE
+ // class TAO_CosEC_ConsumerAdmin_i implements the ConsumerAdmin interface.
+ //
+ // = DESCRIPTION
+ // This implementation of the ConsumerAdmin uses the
+ // RtecEventChannelAdmin::ConsumerAdmin.
+public:
+ // = Initialization and termination methods.
+ TAO_CosEC_ConsumerAdmin_i (void);
+ // Constructor.
+
+ ~TAO_CosEC_ConsumerAdmin_i (void);
+ // Destructor.
+
+ int init (const RtecEventChannelAdmin::ConsumerQOS &consumerqos,
+ RtecEventChannelAdmin::ConsumerAdmin_ptr rtec_consumeradmin);
+
+ virtual CosEventChannelAdmin::ProxyPushSupplier_ptr
+ obtain_push_supplier(ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Returns a new ProxyPushSupplier_ptr.
+
+ virtual CosEventChannelAdmin::ProxyPullSupplier_ptr
+ obtain_pull_supplier(ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Returns a new ProxyPullSupplier_ptr.
+
+private:
+ RtecEventChannelAdmin::ConsumerQOS qos_;
+ // The ConsumerQOS specified by the user of this class.
+
+ RtecEventChannelAdmin::ConsumerAdmin_var rtec_consumeradmin_;
+ // The RtecEventChannelAdmin::ConsumerAdmin specified by the user of
+ // this class.
+};
+
+#include /**/ "ace/post.h"
+#endif /* CONSUMERADMIN_I_H */
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEC_RtEC_Based_lib.mpc b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEC_RtEC_Based_lib.mpc
new file mode 100644
index 00000000000..8d6627c4a00
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEC_RtEC_Based_lib.mpc
@@ -0,0 +1,8 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcslib, event_skel, rtevent_serv {
+ sharedname = CosEC_RtEC_Based
+ dynamicflags += TAO_RTEC_COSEC_BUILD_DLL
+}
+
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEvent_Utilities.cpp b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEvent_Utilities.cpp
new file mode 100644
index 00000000000..543fb669bf8
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEvent_Utilities.cpp
@@ -0,0 +1,443 @@
+// -*- C++ -*-
+// $Id$
+
+#include "CosEvent_Utilities.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "EventChannel_i.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/OS_NS_string.h"
+
+CosEC_ServantBase::CosEC_ServantBase (void)
+ :poa_ (PortableServer::POA::_nil ()),
+ rtec_servant_ (0),
+ cosec_servant_ (0),
+ rtec_ (RtecEventChannelAdmin::EventChannel::_nil ()),
+ cosec_ (CosEventChannelAdmin::EventChannel::_nil ()),
+ eventTypeIds_ (0),
+ eventSourceIds_ (0),
+ source_type_pairs_ (0)
+{
+ // No-Op.
+}
+
+CosEC_ServantBase::~CosEC_ServantBase (void)
+{
+ // No-Op.
+#if 0
+ ACE_DEBUG ((LM_DEBUG, "in cosec servant base %d \n", this));
+#endif
+}
+
+void
+CosEC_ServantBase::init (PortableServer::POA_ptr thispoa,
+ PortableServer::POA_ptr poa,
+ char *,
+ char *,
+ char *
+ ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (thispoa));
+ ACE_ASSERT (!CORBA::is_nil (poa));
+
+ // Save the POA refs.
+ this->thispoa_ = PortableServer::POA::_duplicate (thispoa);
+ this->poa_ = PortableServer::POA::_duplicate (poa);
+
+ auto_ptr<POA_RtecEventChannelAdmin::EventChannel>
+ auto_rtec_servant_ (this->create_rtec (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+
+ auto_ptr<TAO_CosEC_EventChannel_i>
+ auto_cosec_servant_ (this->create_cosec (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+
+ // if all the servants were allocated then set the class pointers.
+ this->rtec_servant_ = auto_rtec_servant_.release ();
+ this->cosec_servant_ = auto_cosec_servant_.release ();
+}
+
+int
+CosEC_ServantBase::activate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (this->poa_.in ()));
+ ACE_ASSERT (!CORBA::is_nil (this->thispoa_.in ()));
+
+ // Activate the Rtec
+ this->activate_rtec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Activate the CosEC
+ int retval = this->activate_cosec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (retval != 0)
+ return -1;
+
+ // Activate ourselves..
+ // Note that the POA is <thispoa_>
+
+ PortableServer::ObjectId_var oid =
+ this->thispoa_->activate_object (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::Object_var obj =
+ this->thispoa_->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0; // success.
+}
+
+int
+CosEC_ServantBase::activate (const char* servant_id
+ ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (this->poa_.in ()));
+ ACE_ASSERT (!CORBA::is_nil (this->thispoa_.in ()));
+
+ // Activate the Rtec
+ this->activate_rtec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Activate the CosEC
+ int retval = this->activate_cosec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (retval != 0)
+ return -1;
+
+ PortableServer::ObjectId_var oid =
+ PortableServer::string_to_ObjectId (servant_id);
+
+ // Activate ourselves.
+ // Note that the POA is <thispoa_>
+ this->thispoa_->activate_object_with_id (oid.in (),
+ this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::Object_var obj =
+ this->thispoa_->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0; // success.
+}
+
+void
+CosEC_ServantBase::activate_rtec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Activate the Rtec
+ PortableServer::ObjectId_var oid =
+ this->poa_->activate_object (this->rtec_servant_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->rtec_servant_->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var obj =
+ this->poa_->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->rtec_ =
+ RtecEventChannelAdmin::EventChannel::_narrow (obj.in ());
+}
+
+int
+CosEC_ServantBase::activate_cosec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Initialize the CosEC servant.
+ RtecBase::handle_t supp_handle = 0;
+
+ this->init_SupplierQOS (supp_handle,
+ this->supplier_qos_,
+ this->source_type_pairs_);
+
+ RtecBase::handle_t cons_handle = 0;
+
+ this->init_ConsumerQOS (cons_handle,
+ this->consumer_qos_,
+ this->eventTypeIds_,
+ this->eventSourceIds_);
+
+ const RtecEventChannelAdmin::ConsumerQOS &consumerqos =
+ this->consumer_qos_.get_ConsumerQOS ();
+
+ const RtecEventChannelAdmin::SupplierQOS &supplierqos =
+ this->supplier_qos_.get_SupplierQOS ();
+
+ if (this->cosec_servant_->init (consumerqos,
+ supplierqos,
+ this->rtec_.in ()
+ ACE_ENV_ARG_PARAMETER) != 0)
+ return -1;
+ ACE_CHECK_RETURN (-1);
+
+ // Activate the CosEC
+ PortableServer::ObjectId_var oid =
+ this->poa_->activate_object (this->cosec_servant_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->cosec_servant_->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::Object_var obj =
+ this->poa_->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->cosec_ =
+ CosEventChannelAdmin::EventChannel::_narrow (obj.in ());
+ return 0; // success
+}
+
+void
+CosEC_ServantBase::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Deactivate all those we control...
+ this->deactivate_rtec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->deactivate_cosec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Finally we go away..
+ PortableServer::ObjectId_var oid =
+ this->thispoa_->servant_to_id (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // deactivate from the poa.
+ this->thispoa_->deactivate_object (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+CosEC_ServantBase::deactivate_rtec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Deactivate the rtec.
+ PortableServer::ObjectId_var oid =
+ this->poa_->servant_to_id (this->rtec_servant_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // deactivate from the poa.
+ this->poa_->deactivate_object (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+CosEC_ServantBase::deactivate_cosec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Deactivate the cosec.
+ PortableServer::ObjectId_var oid =
+ this->poa_->servant_to_id (this->cosec_servant_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // deactivate from the poa.
+ this->poa_->deactivate_object (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CosEventChannelAdmin::ConsumerAdmin_ptr
+CosEC_ServantBase::for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->cosec_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosEventChannelAdmin::SupplierAdmin_ptr
+CosEC_ServantBase::for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->cosec_->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+CosEC_ServantBase::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Deactivate all the contained servants and ourselves.
+ // The poa will "destroy" the ref counted servants.
+
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+POA_RtecEventChannelAdmin::EventChannel_ptr
+CosEC_ServantBase::create_rtec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Create the RtEC servant.
+ TAO_EC_Event_Channel_Attributes attr (this->poa_.in (),
+ this->poa_.in ());
+ TAO_EC_Event_Channel* _rtec_servant;
+ ACE_NEW_THROW_EX (_rtec_servant,
+ TAO_EC_Event_Channel (attr),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ return _rtec_servant;
+}
+
+TAO_CosEC_EventChannel_i*
+CosEC_ServantBase::create_cosec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Create the CosEC servant.
+ TAO_CosEC_EventChannel_i* _cosec_servant;
+ ACE_NEW_THROW_EX (_cosec_servant,
+ TAO_CosEC_EventChannel_i (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ return _cosec_servant;
+}
+
+void
+CosEC_ServantBase::init_SupplierQOS (RtecBase::handle_t supp_handle,
+ ACE_SupplierQOS_Factory &supplier_qos,
+ char *source_type_pairs)
+{
+ // @@ Pradeep: It is very important that you make the type of
+ // events generated by the CosEC an option.
+ // I know this is not very well documented, but the type should
+ // be >= ACE_ES_EVENT_UNDEFINED = 16
+ // Something else: please make the EventSourceID for the
+ // supplier also an option...
+
+ const char *c = " "; // space
+ char *tok = 0;
+
+ // if nothing was specified on the command line use defaults..
+ if (source_type_pairs == 0)
+ supplier_qos.insert (1,
+ ACE_ES_EVENT_ANY,
+ supp_handle,
+ 1);
+ else // parse the event types..
+ {
+ tok = ACE_OS::strtok (source_type_pairs, c);
+ if (tok == 0) // error
+ {
+ ACE_DEBUG ((LM_DEBUG, "error parsing source,event pairs for SupplierQOS, defaulting to source id = 1, eventid = ACE_ES_EVENT_ANY"));
+
+ supplier_qos.insert (1,
+ ACE_ES_EVENT_ANY,
+ supp_handle,
+ 1);
+ }
+ else
+ // we just use 1 source-type pair in the event channel.
+ // so scan for the 1st pair only.
+ {
+ int source_val = 0, type_val = 0;
+ source_val = ACE_OS::atoi (tok);
+
+ tok = ACE_OS::strtok (0, c);
+
+ if (tok != 0)
+ type_val = ACE_OS::atoi (tok);
+
+ ACE_DEBUG ((LM_DEBUG, "supplier_qos::insert (%d, %d)\n",
+ source_val, type_val));
+
+ // Setup the QOS params..
+ supplier_qos.insert (source_val,
+ type_val,
+ supp_handle,
+ 1);
+ }
+ }
+}
+
+void
+CosEC_ServantBase::init_ConsumerQOS (RtecBase::handle_t cons_handle,
+ ACE_ConsumerQOS_Factory &consumer_qos,
+ char *eventTypeIds,
+ char *eventSourceIds
+ )
+{
+ // @@ Pradeep: ditto here, make the set of sources (and/or type)
+ // a parameter, and make sure the user can specify multiple of
+ // them (just call insert_source() or insert_type() in the
+ // parse_args routine).
+
+ const char *c = " "; // space
+ char *tok = 0;
+
+ consumer_qos.start_disjunction_group ();
+
+ // insert the event ids first..
+
+ // if nothing was specified on the command line use defaults..
+ if (eventTypeIds == 0)
+ {
+ //consumer_qos.insert_type (ACE_ES_EVENT_ANY, // default
+ // cons_handle);
+ // @@ if i uncomment this line then the Rtec displays the message
+ // "Consumer tried to register for allevents! This is not implemented."
+ // whenever a consumer tries to register with it.
+ }
+ else // parse the event types..
+ {
+ tok = ACE_OS::strtok (eventTypeIds, c);
+ if (tok == 0) // error
+ {
+ ACE_DEBUG ((LM_DEBUG, "error parsing eventIds for ConsumerQOS, defaulting to 1"));
+ consumer_qos.insert_type (ACE_ES_EVENT_ANY,
+ cons_handle);
+ }
+ else
+ do
+ {
+ int type_val = ACE_OS::atoi (tok);
+ ACE_DEBUG ((LM_DEBUG, "consumer_qos::insert_type (%d)\n",
+ type_val));
+ consumer_qos.insert_type (type_val,
+ cons_handle);
+ tok = ACE_OS::strtok (0, c);
+ }
+ while (tok != 0);
+ }
+
+ // repeat for source ids..
+
+ // if nothing was specified on the command line use defaults..
+ if (eventSourceIds == 0)
+ consumer_qos.insert_source (1, // default = 1
+ cons_handle);
+ else // parse the event types..
+ {
+ tok = ACE_OS::strtok (eventSourceIds, c);
+ if (tok == 0) // error
+ {
+ ACE_DEBUG ((LM_DEBUG, "error parsing sourceIds for ConsumerQOS, defaulting to 1"));
+ consumer_qos.insert_source (1, // default = 1
+ cons_handle);
+ }
+ else
+ do
+ {
+ int source_val = ACE_OS::atoi (tok);
+ ACE_DEBUG ((LM_DEBUG, "consumer_qos::insert_source (%d)\n",
+ source_val));
+ consumer_qos.insert_type (source_val,
+ cons_handle);
+ tok = ACE_OS::strtok (0, c);
+ }
+ while (tok != 0);
+ }
+}
+
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEvent_Utilities.h b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEvent_Utilities.h
new file mode 100644
index 00000000000..2738ff890fe
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEvent_Utilities.h
@@ -0,0 +1,157 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs
+//
+// = FILENAME
+// CosEvent_Utilities.h
+//
+// = DESCRIPTION
+// A few utility classes to make it easier to write EC applications.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_COSEVENT_UTILITIES_H
+#define TAO_COSEVENT_UTILITIES_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecBaseC.h"
+#include "orbsvcs/RtecEventChannelAdminS.h"
+#include "orbsvcs/CosEventChannelAdminS.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "rtec_cosec_export.h"
+
+class TAO_CosEC_EventChannel_i;
+
+class TAO_RTEC_COSEC_Export CosEC_ServantBase :
+ public virtual POA_CosEventChannelAdmin::EventChannel
+{
+ // = TITLE
+ // A generic servant base class.
+ // = DESCRIPTION
+ // This class contains all the member data and methods required to
+ // create and manage a CosEC servant.
+ // Clients can derive from this class and create servants.
+ public:
+ // = Initialization method.
+ CosEC_ServantBase (void);
+ // Constructor.
+
+ virtual ~CosEC_ServantBase (void);
+ // Destructor.
+
+ virtual void init (PortableServer::POA_ptr thispoa,
+ PortableServer::POA_ptr poa,
+ char *eventTypeIds,
+ char *eventSourceIds,
+ char *source_type_pairs
+ ACE_ENV_ARG_DECL);
+ // This method creates a local scheduler, rtec and cosec.
+ // The POA <poa> specified here is used when <activate> is called to
+ // activate the contained servants.
+ // The POA <thispoa> is used to activate this.
+
+ int activate (ACE_ENV_SINGLE_ARG_DECL);
+ // Activates the CosEC with <thispoa_> and friends with the <poa_>
+
+ int activate (const char* servant_id ACE_ENV_ARG_DECL);
+ // If the servant_id is not nil then it is used to supply the object id
+ // for <this> servant.
+
+ void deactivate (ACE_ENV_SINGLE_ARG_DECL);
+ // Deactivates the CosEC and friends with the POA.
+
+ // = POA_CosEventChannelAdmin::EventChannel methods.
+ virtual CosEventChannelAdmin::ConsumerAdmin_ptr for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosEventChannelAdmin::SupplierAdmin_ptr for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Destroys this Event Channel object.
+
+ protected:
+ // = RtEC creation, activation and deactivation methods.
+ virtual POA_RtecEventChannelAdmin::EventChannel_ptr
+ create_rtec (ACE_ENV_SINGLE_ARG_DECL);
+ // Create a local rtec.
+
+ virtual void activate_rtec (ACE_ENV_SINGLE_ARG_DECL);
+ // Activates the rtec.
+
+ virtual void deactivate_rtec (ACE_ENV_SINGLE_ARG_DECL);
+ // Deactivates the rtec.
+
+ // = CosEC creation, activation and deactivation methods.
+ TAO_CosEC_EventChannel_i*
+ create_cosec (ACE_ENV_SINGLE_ARG_DECL);
+ // Create a local cosec.
+
+ int activate_cosec (ACE_ENV_SINGLE_ARG_DECL);
+ // Activates the cosec.
+
+ void deactivate_cosec (ACE_ENV_SINGLE_ARG_DECL);
+ // Deactivates the cosec.
+
+ void init_SupplierQOS (RtecBase::handle_t supp_handle,
+ ACE_SupplierQOS_Factory &supplier_qos,
+ char *source_type_pairs);
+ // Initialize the SupplierQOS Factory.
+
+
+ void init_ConsumerQOS (RtecBase::handle_t cons_handle,
+ ACE_ConsumerQOS_Factory &consumer_qos,
+ char *eventTypeIds,
+ char *eventSourceIds);
+ // Initialize the ConsumerQOS Factory.
+
+ // = Protected Data members.
+
+ PortableServer::POA_var thispoa_;
+ // The poa that we use to activate ourselves.
+
+ PortableServer::POA_var poa_;
+ // The poa that we use to activate others
+
+ POA_RtecEventChannelAdmin::EventChannel_ptr rtec_servant_;
+ // The Event Channel servant.
+
+ TAO_CosEC_EventChannel_i *cosec_servant_;
+ // The servant object of the COS Event Channel.
+
+ RtecEventChannelAdmin::EventChannel_var rtec_;
+ // Ref to the Rtec.
+
+ CosEventChannelAdmin::EventChannel_var cosec_;
+ // Ref to the cosec.
+
+ ACE_ConsumerQOS_Factory consumer_qos_;
+ // The Consumer QOS.
+
+ ACE_SupplierQOS_Factory supplier_qos_;
+ // The Supplier QOS.
+
+ char *eventTypeIds_;
+ // The list of EventTypeIDs (for ConsumerQOS) seperated by spaces.
+ // e.g. "1 2 3 4"
+
+ char *eventSourceIds_;
+ // The list of EventSourceIDs (for ConsumerQOS) seperated by spaces.
+ // e.g. "1 2 3 4"
+
+ char *source_type_pairs_;
+ // The pairs of Source and EventType Ids (for the SupplierQOS).
+ // e.g "1 4 2 5 3 6" where (1,4) (2,5) and (3,6) from source id,
+ // event id pairs.
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_COSEVENT_UTILITIES_H */
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/EventChannel_i.cpp b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/EventChannel_i.cpp
new file mode 100644
index 00000000000..e5dd9fb0348
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/EventChannel_i.cpp
@@ -0,0 +1,124 @@
+// $Id$
+#include "EventChannel_i.h"
+#include "ace/Auto_Ptr.h"
+
+TAO_CosEC_EventChannel_i::TAO_CosEC_EventChannel_i (void)
+ : consumer_admin_ (0),
+ supplier_admin_ (0),
+ consumeradmin_ (CosEventChannelAdmin::ConsumerAdmin::_nil ()),
+ supplieradmin_ (CosEventChannelAdmin::SupplierAdmin::_nil ())
+{
+ // No-Op.
+}
+
+TAO_CosEC_EventChannel_i::~TAO_CosEC_EventChannel_i (void)
+{
+ //No-Op.
+}
+
+int
+TAO_CosEC_EventChannel_i::init (const RtecEventChannelAdmin::ConsumerQOS &consumerqos,
+ const RtecEventChannelAdmin::SupplierQOS &supplierqos,
+ RtecEventChannelAdmin::EventChannel_ptr rtec
+ ACE_ENV_ARG_DECL)
+{
+ // Allocate the admins..
+ TAO_CosEC_ConsumerAdmin_i *consumer_;
+ ACE_NEW_RETURN (consumer_,
+ TAO_CosEC_ConsumerAdmin_i (),
+ -1);
+
+ auto_ptr <TAO_CosEC_ConsumerAdmin_i> auto_consumer_ (consumer_);
+
+ TAO_CosEC_SupplierAdmin_i *supplier_;
+ ACE_NEW_RETURN (supplier_,
+ TAO_CosEC_SupplierAdmin_i (),
+ -1);
+
+ auto_ptr <TAO_CosEC_SupplierAdmin_i> auto_supplier_ (supplier_);
+
+ RtecEventChannelAdmin::ConsumerAdmin_ptr rtec_consumeradmin =
+ rtec->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (auto_consumer_.get ()->init (consumerqos,
+ rtec_consumeradmin) == -1)
+ return -1;
+
+ this->consumeradmin_ =
+ auto_consumer_.get ()->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // give the ownership to the POA.
+ auto_consumer_.get ()->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ RtecEventChannelAdmin::SupplierAdmin_ptr rtec_supplieradmin =
+ rtec->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (auto_supplier_.get ()->init (supplierqos,
+ rtec_supplieradmin) == -1)
+ return -1;
+
+ this->supplieradmin_ =
+ auto_supplier_.get ()->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // give the ownership to the POA.
+ auto_supplier_.get ()->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->consumer_admin_ = auto_consumer_.release ();
+ this->supplier_admin_ = auto_supplier_.release ();
+
+ return 0;
+}
+
+CosEventChannelAdmin::ConsumerAdmin_ptr
+TAO_CosEC_EventChannel_i::for_consumers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // @@ Pradeep: you must make a copy here, because the caller is
+ // responsible of removing this object.
+ return
+ CosEventChannelAdmin::ConsumerAdmin::_duplicate (this->consumeradmin_.in());
+}
+
+CosEventChannelAdmin::SupplierAdmin_ptr
+TAO_CosEC_EventChannel_i::for_suppliers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // @@ Pradeep: you must make a copy here, because the caller is
+ // responsible of removing this object, same here..
+ return
+ CosEventChannelAdmin::SupplierAdmin::_duplicate (this->supplieradmin_.in ());
+}
+
+void
+TAO_CosEC_EventChannel_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Deactivate the CosEventChannel
+ 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->supplieradmin_ = CosEventChannelAdmin::SupplierAdmin::_nil ();
+ this->consumeradmin_ = CosEventChannelAdmin::ConsumerAdmin::_nil ();
+}
+
+void
+TAO_CosEC_EventChannel_i::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/EventChannel_i.h b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/EventChannel_i.h
new file mode 100644
index 00000000000..74f25ca3ec2
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/EventChannel_i.h
@@ -0,0 +1,92 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO services
+//
+// = FILENAME
+// EventChannel_i
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// = DESCRIPTION
+// This has the implementation of the
+// CosEventChannelAdmin::EventChannel interface.
+//
+// ============================================================================
+
+#ifndef EVENTCHANNEL_I_H
+#define EVENTCHANNEL_I_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/CosEventChannelAdminC.h"
+#include "ConsumerAdmin_i.h"
+#include "SupplierAdmin_i.h"
+
+class TAO_RTEC_COSEC_Export TAO_CosEC_EventChannel_i :
+ public virtual POA_CosEventChannelAdmin::EventChannel
+{
+ // = TITLE
+ // class TAO_CosEC_EventChannel_i implements the standard Cos EventChannel
+ // interface.
+ //
+ // = DESCRIPTION
+ // This Cos EventChannel implementation is based on TAO's
+ // Real-time Event Channel. This TAO_CosEC_EventChannel_i implementation
+ // delegates all its responsibility to corresponding objects from
+ // the real-time implementation.
+ //
+public:
+ // = Initialization and termination methods.
+ TAO_CosEC_EventChannel_i (void);
+ // Constructor.
+
+ ~TAO_CosEC_EventChannel_i (void);
+ // Destructor.
+
+ int init (const RtecEventChannelAdmin::ConsumerQOS &consumerqos,
+ const RtecEventChannelAdmin::SupplierQOS &supplierqos,
+ RtecEventChannelAdmin::EventChannel_ptr rtec
+ ACE_ENV_ARG_DECL);
+ // Activates the ConsumerAdmin and SupplierAdmin servants. Returns
+ // -1 on error, 0 on success.
+
+ virtual CosEventChannelAdmin::ConsumerAdmin_ptr for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The for_consumers method will return the same ConsumerAdmin_ptr
+ // everytime its called.
+
+ virtual CosEventChannelAdmin::SupplierAdmin_ptr for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The for_suppliers method will return the same SupplierAdmin_ptr
+ // everytime its called.
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Destroys this Event Channel object.
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+ // destroys this Event Channel object and <delete>s this object.
+
+private:
+ TAO_CosEC_ConsumerAdmin_i* consumer_admin_;
+ // ConsumerAdmin servant object.
+
+ TAO_CosEC_SupplierAdmin_i* supplier_admin_;
+ // SupplierAdmin servant object.
+
+ CosEventChannelAdmin::ConsumerAdmin_var consumeradmin_;
+ // The reference to the ConsumerAdmin interface returned after
+ // activating the servant in the ORB.
+
+ CosEventChannelAdmin::SupplierAdmin_var supplieradmin_;
+ // The reference to the SupplierAdmin interface returned after
+ // activating the servant in the ORB.
+};
+
+#include /**/ "ace/post.h"
+#endif /* EVENTCHANNEL_I_H */
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/Makefile.am b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/Makefile.am
new file mode 100644
index 00000000000..fd3d67b82b3
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/Makefile.am
@@ -0,0 +1,62 @@
+## 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.CosEC_RtEC_Based_lib.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_LTLIBRARIES = libCosEC_RtEC_Based.la
+
+libCosEC_RtEC_Based_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_RTEC_COSEC_BUILD_DLL
+
+libCosEC_RtEC_Based_la_SOURCES = \
+ ConsumerAdmin_i.cpp \
+ CosEvent_Utilities.cpp \
+ EventChannel_i.cpp \
+ ProxyPushConsumer_i.cpp \
+ ProxyPushSupplier_i.cpp \
+ SupplierAdmin_i.cpp
+
+noinst_HEADERS = \
+ ConsumerAdmin_i.h \
+ CosEvent_Utilities.h \
+ EventChannel_i.h \
+ ProxyPushConsumer_i.h \
+ ProxyPushSupplier_i.h \
+ SupplierAdmin_i.h \
+ rtec_cosec_export.h
+
+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/examples/CosEC/RtEC_Based/lib/ProxyPushConsumer_i.cpp b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ProxyPushConsumer_i.cpp
new file mode 100644
index 00000000000..5870b6c33c7
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ProxyPushConsumer_i.cpp
@@ -0,0 +1,207 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/CosEventChannelAdminC.h"
+#include "orbsvcs/CosEventChannelAdminS.h"
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/CosEventCommS.h"
+#include "ProxyPushConsumer_i.h"
+#include "ace/Auto_Ptr.h"
+
+#if defined(_MSC_VER)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class TAO_CosEC_PushSupplierWrapper :
+ public virtual POA_RtecEventComm::PushSupplier
+{
+ // = TITLE
+ // A Wrapper for the Rtec PushSupplier.
+ //
+ // = DESCRIPTION
+ // The Rtec ProxyPushConsumer uses a Rtec PushSupplier. This
+ // class wraps the Cos PushSupplier to make it look like a Rtec
+ // PushSupplier.
+public:
+ // = Initialization and termination methods.
+ TAO_CosEC_PushSupplierWrapper (CosEventComm::PushSupplier_ptr supplier);
+ // Constructor.
+
+ ~TAO_CosEC_PushSupplierWrapper (void);
+ // Destructor.
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Disconnects the push supplier.
+
+private:
+ // @@ Pradeep: are you sure you want to go through the CORBA
+ // interface? Maybe the implementation (ProxyPushConsumer_i) is good
+ // enough at this point? The tradeoff is flexibility (your scheme
+ // can use remote CosPushSuppliers), but suffers some performance
+ // penalty: do you need the extra flexibility? Can you use it? [I
+ // suspect the answers are "not" for both]
+ CosEventComm::PushSupplier_var supplier_;
+ // The Cos PushSupplier that we're proxying for.
+};
+
+#if defined(_MSC_VER)
+#pragma warning(default:4250)
+#endif /* _MSC_VER */
+
+TAO_CosEC_PushSupplierWrapper::TAO_CosEC_PushSupplierWrapper
+(CosEventComm::PushSupplier_ptr supplier)
+ : supplier_ (CosEventComm::PushSupplier::_duplicate (supplier))
+{
+ // No-Op.
+}
+
+TAO_CosEC_PushSupplierWrapper::~TAO_CosEC_PushSupplierWrapper (void)
+{
+ // No-Op.
+}
+
+void
+TAO_CosEC_PushSupplierWrapper::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->supplier_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Deactivate the supplier proxy
+ 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;
+
+ // @@ If we keep a list remember to remove this object from the
+ // list.
+}
+
+TAO_CosEC_ProxyPushConsumer_i::TAO_CosEC_ProxyPushConsumer_i (const RtecEventChannelAdmin::SupplierQOS &qos,
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr proxypushconsumer)
+ : qos_ (qos),
+ proxypushconsumer_ (RtecEventChannelAdmin::ProxyPushConsumer::_duplicate (proxypushconsumer)),
+ wrapper_ (0)
+{
+ // No-Op.
+}
+
+TAO_CosEC_ProxyPushConsumer_i::~TAO_CosEC_ProxyPushConsumer_i (void)
+{
+ // No-Op.
+}
+
+void
+TAO_CosEC_ProxyPushConsumer_i::push (const CORBA::Any &data
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ RtecEventComm::Event buffer[1];
+ // Create an event set that does not own the buffer....
+ RtecEventComm::EventSet events (1, 1, buffer, 0);
+ events.length (1);
+
+ RtecEventComm::Event &e = events[0];
+ RtecEventComm::Event eqos =
+ qos_.publications[0].event;
+
+ // @@ what if i initialize the entire <EventSet> with corresponding
+ // publications entries.
+
+ // NOTE: we initialize the <EventHeader> field using the 1st
+ // <publications> from the <SupplierQOS>.so we assume that
+ // publications[0] is initialized.
+ e.header.source = eqos.header.source;
+ e.header.ttl = eqos.header.ttl;
+ e.header.type = eqos.header.type;
+
+ ACE_hrtime_t t = ACE_OS::gethrtime ();
+
+ ORBSVCS_Time::hrtime_to_TimeT (e.header.creation_time,
+ t);
+#if !defined(TAO_LACKS_EVENT_CHANNEL_TIMESTAMPS)
+ e.header.ec_recv_time = ORBSVCS_Time::zero ();
+ e.header.ec_send_time = ORBSVCS_Time::zero ();
+#endif /* TAO_LACKS_EVENT_CHANNEL_TIMESTAMPS */
+
+ e.data.any_value = data;
+
+ this->proxypushconsumer_->push (events
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CosEC_ProxyPushConsumer_i::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->proxypushconsumer_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Deactivate the ProxyPushConsumer
+ 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
+TAO_CosEC_ProxyPushConsumer_i::connect_push_supplier (CosEventComm::PushSupplier_ptr push_supplier
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected))
+{
+ if (this->connected ())
+ ACE_THROW (CosEventChannelAdmin::AlreadyConnected ());
+
+ TAO_CosEC_PushSupplierWrapper *wrapper;
+
+ ACE_NEW_THROW_EX (wrapper,
+ TAO_CosEC_PushSupplierWrapper (push_supplier),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ auto_ptr <TAO_CosEC_PushSupplierWrapper>
+ auto_wrapper (wrapper);
+
+ RtecEventComm::PushSupplier_ptr rtecpushsupplier
+ = auto_wrapper.get ()->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // give the ownership to the POA.
+ auto_wrapper.get ()->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->proxypushconsumer_->connect_push_supplier
+ (rtecpushsupplier,
+ this->qos_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->wrapper_ = auto_wrapper.release ();
+}
+
+int
+TAO_CosEC_ProxyPushConsumer_i::connected (void)
+{
+ return this->wrapper_ == 0 ? 0 : 1;
+}
+
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ProxyPushConsumer_i.h b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ProxyPushConsumer_i.h
new file mode 100644
index 00000000000..b780b88d90a
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ProxyPushConsumer_i.h
@@ -0,0 +1,87 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ================================================================
+//
+// = LIBRARY
+// TAO services
+//
+// = FILENAME
+// ProxyPushConsumer_i
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// = DESCRIPTION
+// This has the implementation of the
+// CosEventChannelAdmin::ProxyPushConsumer interface.
+//
+// ================================================================
+
+#ifndef _PROXYPUSHCONSUMER_I_H
+#define _PROXYPUSHCONSUMER_I_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventChannelAdminS.h"
+#include "orbsvcs/CosEventChannelAdminS.h"
+#include "rtec_cosec_export.h"
+
+class TAO_CosEC_PushSupplierWrapper;
+
+class TAO_RTEC_COSEC_Export TAO_CosEC_ProxyPushConsumer_i :
+ public virtual POA_CosEventChannelAdmin::ProxyPushConsumer
+{
+ // = TITLE
+ // class TAO_CosEC_ProxyPushConsumer_i implements the ProxyPushConsumer
+ // interface.
+ //
+ // = DESCRIPTION
+ // This implementation of the ProxyPushConsumer uses the
+ // RtecEventChannelAdmin::ProxyPushConsumer.
+ //
+ // NOTE: RtecEventChannelAdmin::ProxyPushConsumer::push method is
+ // passed a RtecEventComm::EventSet.The <EventHeader> field in that is
+ // initialized using the the 1st <publications> from the <SupplierQOS>.
+ // so we assume that publications[0] is initialized.
+ //
+public:
+ // = Initialization and termination methods.
+ TAO_CosEC_ProxyPushConsumer_i (const RtecEventChannelAdmin::SupplierQOS &qos,
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr proxypushconsumer);
+ // Constructor.
+
+ ~TAO_CosEC_ProxyPushConsumer_i (void);
+ // Destructor.
+
+ virtual void push (const CORBA::Any &data
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Suppliers call this method to pass data to connected consumers.
+
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Disconnects the supplier from the event communication.
+
+ virtual void connect_push_supplier(CosEventComm::PushSupplier_ptr push_supplier
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected));
+ // Connects a push supplier.
+
+private:
+ int connected (void);
+ // Returns 0 if a push_supplier is already connected to this
+ // ProxyPushConsumer, otherwise it returns a 1.
+
+ const RtecEventChannelAdmin::SupplierQOS &qos_;
+ // The SupplierQOS specified by the user of this class.
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxypushconsumer_;
+ // The Rtec ProxyPushConsumer specified by the user of this class.
+
+ TAO_CosEC_PushSupplierWrapper *wrapper_;
+ // The Rtec PushSupplier wrapper used by the Rtec ProxyPushConsumer.
+};
+
+#include /**/ "ace/post.h"
+#endif /* _PROXYPUSHCONSUMER_I_H */
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ProxyPushSupplier_i.cpp b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ProxyPushSupplier_i.cpp
new file mode 100644
index 00000000000..866c8a9e1a3
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ProxyPushSupplier_i.cpp
@@ -0,0 +1,194 @@
+// $Id$
+//
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/CosEventChannelAdminC.h"
+#include "orbsvcs/CosEventChannelAdminS.h"
+#include "orbsvcs/CosEventCommS.h"
+#include "orbsvcs/RtecEventCommS.h"
+#include "ProxyPushSupplier_i.h"
+#include "ace/Auto_Ptr.h"
+
+#if defined(_MSC_VER)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class TAO_CosEC_PushConsumerWrapper :
+ public POA_RtecEventComm::PushConsumer
+{
+ // = TITLE
+ // Wrapper class for the Rtec PushConsumer.
+ //
+ // = DESCRIPTION
+ // The Rtec ProxyPushSupplier uses a Rtec PushConsumer. This
+ // class wraps the Cos PushConsumer to make it look like a Rtec
+ // PushConsumer.
+public:
+ // = Initialization and termination methods.
+ TAO_CosEC_PushConsumerWrapper (CosEventComm::PushConsumer_ptr consumer);
+ // Constructor.
+
+ ~TAO_CosEC_PushConsumerWrapper (void);
+ // Destructor.
+
+ virtual void push (const RtecEventComm::EventSet & data
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // This method is called by the RTEvent Channel to supply data.
+
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Disconnects the consumer from the event channel.
+
+private:
+ CosEventComm::PushConsumer_var consumer_;
+ // The Cos PushConsumer that we're proxying for.
+};
+
+#if defined(_MSC_VER)
+#pragma warning(default:4250)
+#endif /* _MSC_VER */
+
+TAO_CosEC_PushConsumerWrapper::TAO_CosEC_PushConsumerWrapper
+(CosEventComm::PushConsumer_ptr consumer)
+ : consumer_ (CosEventComm::PushConsumer::_duplicate (consumer))
+{
+ // No-Op.
+}
+
+TAO_CosEC_PushConsumerWrapper::~TAO_CosEC_PushConsumerWrapper ()
+{
+ // No-Op.
+}
+
+void
+TAO_CosEC_PushConsumerWrapper::push (const RtecEventComm::EventSet& set
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ for (CORBA::ULong i = 0;
+ i < set.length ();
+ ++i)
+ {
+ ACE_TRY
+ {
+ this->consumer_->push (set[i].data.any_value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore the exception...
+ }
+ ACE_ENDTRY;
+ }
+}
+
+void
+TAO_CosEC_PushConsumerWrapper::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Deactivate the supplier proxy.
+ this->consumer_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ 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;
+
+ // @@ If we keep a list remember to remove this object from the
+ // list.
+}
+
+TAO_CosEC_ProxyPushSupplier_i::TAO_CosEC_ProxyPushSupplier_i
+(const RtecEventChannelAdmin::ConsumerQOS &qos,
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr pps)
+ : qos_ (qos),
+ pps_ (RtecEventChannelAdmin::ProxyPushSupplier::_duplicate (pps)),
+ wrapper_ (0)
+{
+ // No-Op.
+}
+
+TAO_CosEC_ProxyPushSupplier_i::~TAO_CosEC_ProxyPushSupplier_i (void)
+{
+ // No-Op.
+}
+
+void
+TAO_CosEC_ProxyPushSupplier_i::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->pps_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Deactivate the supplier proxy
+ 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;
+
+ // @@ If we keep a list remember to remove this object from the
+ // list.
+}
+
+void
+TAO_CosEC_ProxyPushSupplier_i::connect_push_consumer (CosEventComm::PushConsumer_ptr push_consumer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError))
+{
+ if (this->connected ())
+ ACE_THROW (CosEventChannelAdmin::AlreadyConnected ());
+
+ if (push_consumer == CosEventComm::PushConsumer::_nil())
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ TAO_CosEC_PushConsumerWrapper *wrapper;
+ ACE_NEW_THROW_EX (wrapper,
+ TAO_CosEC_PushConsumerWrapper (push_consumer),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ auto_ptr <TAO_CosEC_PushConsumerWrapper> auto_wrapper (wrapper);
+
+ // @@ This code is not exception safe.
+ RtecEventComm::PushConsumer_ptr rtecpushconsumer =
+ auto_wrapper.get ()->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // give the ownership to the POA.
+ auto_wrapper.get ()->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->pps_->connect_push_consumer (rtecpushconsumer,
+ this->qos_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->wrapper_ = auto_wrapper.release ();
+}
+
+int
+TAO_CosEC_ProxyPushSupplier_i::connected (void)
+{
+ return this->wrapper_ == 0 ? 0 : 1;
+}
+
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ProxyPushSupplier_i.h b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ProxyPushSupplier_i.h
new file mode 100644
index 00000000000..199a596c0bf
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ProxyPushSupplier_i.h
@@ -0,0 +1,76 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ================================================================
+//
+// = LIBRARY
+// TAO services
+//
+// = FILENAME
+// ProxyPushSupplier_i
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// = DESCRIPTION
+// This has the implementation of the
+// CosEventChannelAdmin::ProxyPushSupplier interface.
+//
+// ================================================================
+
+#ifndef _PROXYPUSHSUPPLIER_H
+#define _PROXYPUSHSUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/CosEventChannelAdminC.h"
+#include "rtec_cosec_export.h"
+
+class TAO_CosEC_PushConsumerWrapper;
+
+class TAO_RTEC_COSEC_Export TAO_CosEC_ProxyPushSupplier_i :
+ public POA_CosEventChannelAdmin::ProxyPushSupplier
+{
+ // = TITLE
+ // class ProxyPushSupplier-i implements the ProxyPushConsumer interface.
+ //
+ // = DESCRIPTION
+ // This implementation of the ProxyPushSupplier uses the
+ // RtecEventChannelAdmin::ProxyPushSupplier.
+public:
+ // = Initialization and termination methods.
+ TAO_CosEC_ProxyPushSupplier_i (const RtecEventChannelAdmin::ConsumerQOS &qos,
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr pps);
+ // Constructor.
+
+ ~TAO_CosEC_ProxyPushSupplier_i (void);
+ // Destructor.
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Ends the event communication and disposes this object.
+
+ virtual void connect_push_consumer(CosEventComm::PushConsumer_ptr push_consumer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError));
+ // Connects the <push_consumer> to the Event Channel.
+
+private:
+ int connected (void);
+ // Returns 0 if a push_consumer is already connected to this
+ // ProxyPushSupplier, otherwise it returns a 1.
+
+ const RtecEventChannelAdmin::ConsumerQOS &qos_;
+ // The ConsumerQOS specified by the user of this class.
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var pps_;
+ // The Rtec ProxyPushSupplier specified by the user of this class.
+
+ TAO_CosEC_PushConsumerWrapper *wrapper_;
+ // The Rtec PushConsumer wrapper used by the Rtec ProxyPushSupplier.
+};
+
+#include /**/ "ace/post.h"
+#endif /* _PROXYPUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/SupplierAdmin_i.cpp b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/SupplierAdmin_i.cpp
new file mode 100644
index 00000000000..97af59df51a
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/SupplierAdmin_i.cpp
@@ -0,0 +1,67 @@
+// $Id$
+
+#include "SupplierAdmin_i.h"
+#include "ace/Auto_Ptr.h"
+
+TAO_CosEC_SupplierAdmin_i::TAO_CosEC_SupplierAdmin_i (void)
+ : qos_ (),
+ rtec_supplieradmin_ (RtecEventChannelAdmin::SupplierAdmin::_nil ())
+{
+ // No-Op.
+}
+
+TAO_CosEC_SupplierAdmin_i::~TAO_CosEC_SupplierAdmin_i (void)
+{
+ // No-Op.
+}
+
+int
+TAO_CosEC_SupplierAdmin_i::init (const RtecEventChannelAdmin::SupplierQOS &supplierqos,
+ RtecEventChannelAdmin::SupplierAdmin_ptr rtec_supplieradmin)
+{
+ this->qos_ = supplierqos;
+ this->rtec_supplieradmin_ =
+ RtecEventChannelAdmin::SupplierAdmin::_duplicate (rtec_supplieradmin);
+ return 0;
+}
+
+CosEventChannelAdmin::ProxyPushConsumer_ptr
+TAO_CosEC_SupplierAdmin_i::obtain_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosEventChannelAdmin::ProxyPushConsumer_ptr proxyconsumer_nil =
+ CosEventChannelAdmin::ProxyPushConsumer::_nil ();
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var rtecproxypushconsumer =
+ this->rtec_supplieradmin_->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxyconsumer_nil);
+
+ TAO_CosEC_ProxyPushConsumer_i *proxypushconsumer;
+
+ ACE_NEW_RETURN (proxypushconsumer,
+ TAO_CosEC_ProxyPushConsumer_i (this->qos_,
+ rtecproxypushconsumer.in ()),
+ proxyconsumer_nil);
+ auto_ptr <TAO_CosEC_ProxyPushConsumer_i>
+ auto_proxyconsumer (proxypushconsumer);
+
+ CosEventChannelAdmin::ProxyPushConsumer_ptr proxy_obj =
+ auto_proxyconsumer.get ()->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxyconsumer_nil);
+
+ // give the ownership to the POA.
+ auto_proxyconsumer.get ()->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxyconsumer_nil);
+
+ auto_proxyconsumer.release ();
+ return proxy_obj;
+}
+
+CosEventChannelAdmin::ProxyPullConsumer_ptr
+TAO_CosEC_SupplierAdmin_i::obtain_pull_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // TODO: implement this.
+ return CosEventChannelAdmin::ProxyPullConsumer::_nil ();
+}
+
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/SupplierAdmin_i.h b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/SupplierAdmin_i.h
new file mode 100644
index 00000000000..7642b282601
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/SupplierAdmin_i.h
@@ -0,0 +1,71 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO services
+//
+// = FILENAME
+// SupplierAdmin_i.h
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// = DESCRIPTION
+// This has the implementation of the
+// CosEventChannelAdmin::SupplierAdmin interface.
+//
+// ============================================================================
+
+#ifndef SUPPLIER_ADMIN_I_H
+#define SUPPLIER_ADMIN_I_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/CosEventChannelAdminC.h"
+#include "ProxyPushConsumer_i.h"
+
+class TAO_RTEC_COSEC_Export TAO_CosEC_SupplierAdmin_i :
+ public virtual POA_CosEventChannelAdmin::SupplierAdmin
+{
+ // = TITLE
+ // class TAO_CosEC_SupplierAdmin_i implements the SupplierAdmin interface.
+ //
+ // = DESCRIPTION
+ // This COS-compliant implementation of the SupplierAdmin uses
+ // TAO's RtecEventChannelAdmin::SupplierAdmin.
+public:
+ // = Initialization and termination methods.
+ TAO_CosEC_SupplierAdmin_i (void);
+ // Constructor.
+
+ ~TAO_CosEC_SupplierAdmin_i (void);
+ // Destructor.
+
+ int init (const RtecEventChannelAdmin::SupplierQOS &supplierqos,
+ RtecEventChannelAdmin::SupplierAdmin_ptr rtec_supplieradmin);
+ // Initializes the SupplierAdmin. Returns 0 on success, -1 on
+ // error.
+
+ virtual CosEventChannelAdmin::ProxyPushConsumer_ptr
+ obtain_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Returns a new ProxyPushConsumer_ptr.
+
+ virtual CosEventChannelAdmin::ProxyPullConsumer_ptr
+ obtain_pull_consumer(ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Returns a new ProxyPullConsumer_ptr.
+
+private:
+ RtecEventChannelAdmin::SupplierQOS qos_;
+ // The SupplierQOS specified by the user of this class.
+
+ RtecEventChannelAdmin::SupplierAdmin_var rtec_supplieradmin_;
+ // The RtecEventChannelAdmin::SupplierAdmin specified by the user of
+ // this class.
+};
+
+#include /**/ "ace/post.h"
+#endif /* SUPPLIER_ADMIN_I_H */
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/rtec_cosec_export.h b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/rtec_cosec_export.h
new file mode 100644
index 00000000000..4d2cbe378d2
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/rtec_cosec_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_RTEC_COSEC_EXPORT_H
+#define TAO_RTEC_COSEC_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_RTEC_COSEC_HAS_DLL)
+# define TAO_RTEC_COSEC_HAS_DLL 0
+# endif /* ! TAO_RTEC_COSEC_HAS_DLL */
+#else
+# if !defined (TAO_RTEC_COSEC_HAS_DLL)
+# define TAO_RTEC_COSEC_HAS_DLL 1
+# endif /* ! TAO_RTEC_COSEC_HAS_DLL */
+#endif
+
+#if defined (TAO_RTEC_COSEC_HAS_DLL) && (TAO_RTEC_COSEC_HAS_DLL == 1)
+# if defined (TAO_RTEC_COSEC_BUILD_DLL)
+# define TAO_RTEC_COSEC_Export ACE_Proper_Export_Flag
+# define TAO_RTEC_COSEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEC_COSEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RTEC_COSEC_BUILD_DLL */
+# define TAO_RTEC_COSEC_Export ACE_Proper_Import_Flag
+# define TAO_RTEC_COSEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEC_COSEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RTEC_COSEC_BUILD_DLL */
+#else /* TAO_RTEC_COSEC_HAS_DLL == 1 */
+# define TAO_RTEC_COSEC_Export
+# define TAO_RTEC_COSEC_SINGLETON_DECLARATION(T)
+# define TAO_RTEC_COSEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RTEC_COSEC_HAS_DLL == 1 */
+
+#endif /* TAO_RTEC_COSEC_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Basic.cpp b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Basic.cpp
new file mode 100644
index 00000000000..bd0b2585f86
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Basic.cpp
@@ -0,0 +1,176 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "Basic.h"
+#include "CosEvent_Utilities.h"
+
+int
+main (int argc, char *argv [])
+{
+ Basic basic;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ basic.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ basic.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ basic.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::UserException, ue)
+ {
+ ACE_PRINT_EXCEPTION (ue,
+ "CosEC_Basic user exception: ");
+ return 1;
+ }
+ ACE_CATCH (CORBA::SystemException, se)
+ {
+ ACE_PRINT_EXCEPTION (se,
+ "CosEC_Basic system exception: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (1);
+
+ return 0;
+}
+
+Basic::Basic (void)
+{
+ // No-Op.
+}
+
+Basic::~Basic (void)
+{
+ // No-Op.
+}
+
+void
+Basic::init (int argc, char *argv[]
+ ACE_ENV_ARG_DECL)
+{
+ this->init_ORB (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->init_CosEC (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Basic::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_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,
+ " (%P|%t) Unable to initialize the POA.\n"));
+
+ root_poa_ =
+ PortableServer::POA::_narrow (poa_object.in ()
+ 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;
+}
+
+void
+Basic::init_CosEC (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosEC_ServantBase *ec = 0;
+
+ ACE_NEW_THROW_EX (ec,
+ CosEC_ServantBase (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ PortableServer::ServantBase_var ec_var (ec);
+
+ ec->init (this->root_poa_.in(),
+ this->root_poa_.in(),
+ 0,0,0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ int retval = ec->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (retval == -1)
+ ACE_THROW (CORBA::UNKNOWN ());
+ // @@ look for more descriptive exception to throw here
+
+ CORBA::Object_var obj =
+ this->root_poa_->servant_to_reference (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->cos_ec_ =
+ CosEventChannelAdmin::EventChannel::_narrow (obj._retn ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Basic::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Create an Any type to pass to the Cos EC.
+ CORBA::Any any;
+ any <<= (CORBA::Long)50;
+
+ this->consumer_.open (this->cos_ec_.in (),
+ this->orb_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_.connect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_.open (this->cos_ec_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_.connect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_.send_event (any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // this->orb_->run ();
+ // @@ commenting out the run-shutdown mechanism for now because it gives
+ // an poa "unknown location" exception otherwise.
+
+ // wait here.
+ // When the consumer gets the event we pushed, it will shutdown the ORB.
+ // We will return from <run> then.
+}
+
+void
+Basic::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->supplier_.close (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_.close (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->cos_ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Basic.h b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Basic.h
new file mode 100644
index 00000000000..df713f5766f
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Basic.h
@@ -0,0 +1,75 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// Basic.h
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// = DESCRIPTION
+// This is a simple test class for the standard Cos Event Channel.
+//
+// ============================================================================
+
+#ifndef COSECBASIC_H
+#define COSECBASIC_H
+
+#include "Consumer.h"
+#include "Supplier.h"
+
+class Basic
+{
+ // = TITLE
+ // class Basic
+ //
+ // = DESCRIPTION
+ // Creates a CORBA Standard Event Channel (COSEC) implemented with
+ // TAO's Real-time Event Channel (RtEC) and sends an event across.
+public:
+ // = Initialization and termination methods.
+ Basic (void);
+ // Constructor.
+
+ ~Basic (void);
+ // Destructor.
+
+ void init (int argc, char *argv[] ACE_ENV_ARG_DECL);
+ // Starts up an ORB and the CosEC.
+ // Returns 0 on success, -1 on error.
+
+ void run (ACE_ENV_SINGLE_ARG_DECL);
+ // Connects a consumer and a supplier to the CosEC and sends 1 event
+ // across.
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+ // Closes down the CosEC.
+
+private:
+ void init_ORB (int argc, char *argv[] ACE_ENV_ARG_DECL);
+ // initializes the ORB.
+ // Returns 0 on success, -1 on error.
+
+ void init_CosEC (ACE_ENV_SINGLE_ARG_DECL);
+ // initializes the COS EC.
+ // Returns 0 on success, -1 on error.
+
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ PortableServer::POA_var root_poa_;
+ // The root poa.
+
+ CosEventChannelAdmin::EventChannel_var cos_ec_;
+ // Reference to the CosEC returned after activating it in the ORB.
+
+ Consumer consumer_;
+ // The Cos Consumer that will receive the event.
+
+ Supplier supplier_;
+ // The Cos Supplier that will supply the event.
+};
+
+#endif /* COSECBASIC_H */
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Consumer.cpp b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Consumer.cpp
new file mode 100644
index 00000000000..03259f3a123
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Consumer.cpp
@@ -0,0 +1,96 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "Consumer.h"
+
+void
+Consumer::open (CosEventChannelAdmin::EventChannel_ptr event_channel,
+ CORBA::ORB_ptr orb
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_ = orb;
+
+ // = Connect as a consumer.
+ this->consumer_admin_ =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Consumer::close (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_admin_ =
+ CosEventChannelAdmin::ConsumerAdmin::_nil ();
+}
+
+void
+Consumer::connect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->consumer_admin_.in ()))
+ return;
+
+ CosEventComm::PushConsumer_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_ =
+ this->consumer_admin_->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_->connect_push_consumer (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->supplier_proxy_.in ())
+ || CORBA::is_nil (this->consumer_admin_.in ()))
+ return;
+
+ this->supplier_proxy_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_ =
+ CosEventChannelAdmin::ProxyPushSupplier::_nil ();
+}
+
+void
+Consumer::push (const CORBA::Any &
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "in Consumer::push\n"));
+ // this->orb_->shutdown ();
+ // @@ read comment in run
+}
+
+void
+Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ // Deactivate this object.
+
+ 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;
+}
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Consumer.h b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Consumer.h
new file mode 100644
index 00000000000..c1ced5cbc08
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Consumer.h
@@ -0,0 +1,75 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// Consumer.h
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// = DESCRIPTION
+// Defines a simple Push Consumer.
+//
+// ============================================================================
+
+#ifndef COSECCONSUMER_H_
+#define COSECCONSUMER_H_
+
+#include "orbsvcs/CosEventCommC.h"
+#include "orbsvcs/CosEventChannelAdminC.h"
+#include "orbsvcs/CosEventCommS.h"
+#include "orbsvcs/CosEventChannelAdminS.h"
+
+class Consumer : public POA_CosEventComm::PushConsumer
+{
+ // = TITLE
+ // Consumer
+ //
+ // = DESCRIPTION
+ // The Consumer is a simple PushConsumer that connects to the
+ // CosEC and receives events from it.
+
+public:
+ void open (CosEventChannelAdmin::EventChannel_ptr event_channel,
+ CORBA::ORB_ptr orb
+ 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_ENV_SINGLE_ARG_DECL);
+ // Connect the Consumer to the EventChannel.
+
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the supplier, but do not forget about it or close
+ // it.
+
+ virtual void push (const CORBA::Any &data
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+ // push the event to the consumer.
+
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+ // disconnect the consumer from the EC.
+
+private:
+ CORBA::ORB_var orb_;
+ // The orb that we as using.
+
+ CosEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+ // We talk to the EC using this proxy.
+
+ CosEventChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ // We talk to the EC using this proxy.
+};
+
+#endif /* COSECCONSUMER_H_ */
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/CosEC_RtEC_Based_tests_Basic.mpc b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/CosEC_RtEC_Based_tests_Basic.mpc
new file mode 100644
index 00000000000..d3d306ab424
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/CosEC_RtEC_Based_tests_Basic.mpc
@@ -0,0 +1,15 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Client) : orbsvcsexe, event, event_skel, rtevent_serv, rtsched {
+ after += CosEC_RtEC_Based_lib
+ libs += CosEC_RtEC_Based
+
+ specific (automake) {
+ includes += $(srcdir)/../../lib
+ } else {
+ includes += ../../lib
+ }
+
+ libpaths += ../../lib
+}
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Makefile.am b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Makefile.am
new file mode 100644
index 00000000000..cd377c8edb7
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Makefile.am
@@ -0,0 +1,72 @@
+## 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.CosEC_RtEC_Based_Tests_Basic_Client.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = Basic
+
+Basic_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
+
+Basic_SOURCES = \
+ Basic.cpp \
+ Consumer.cpp \
+ Supplier.cpp \
+ Basic.h \
+ Consumer.h \
+ Supplier.h
+
+Basic_LDADD = \
+ $(top_builddir)/orbsvcs/examples/CosEC/RtEC_Based/lib/libCosEC_RtEC_Based.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_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.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/examples/CosEC/RtEC_Based/tests/Basic/README b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/README
new file mode 100644
index 00000000000..291ec0fa208
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/README
@@ -0,0 +1,26 @@
+$Id$
+
+The Cos_ECBasic test shows how to:
+
+ . Create a standard Cos Event Channel,
+ . Write simple COS compliant consumers and suppliers,
+ . Connect consumers and suppliers to the COSEC,
+ . Send and receive events form the EC.
+
+For initialization, the CosEC_Basic test first creates and initializes
+a TAO real-time EC (Rtec). Then, it initializes QOS parameters for
+the Supplier and Consumers and then initializes a COSEC (Corba Object
+Service compliant Event Channel).
+
+To test the COSEC the test initializes a Supplier and a Consumer ,
+connects them to the COSEC. The Supplier then sends an event to the
+channel which is delivered to the Consumer via the <push> method.
+This method then prints a message to show that an event was delivered
+to the Consumer.
+
+Finally the Rtec and COSEC are shutdown to finish the test.
+
+NOTE: please do not attempt to compile this test till I've integrated
+the COSEC code into orbsvcs.
+
+- Pradeep <pradeep@cs.wustl.edu>
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Supplier.cpp b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Supplier.cpp
new file mode 100644
index 00000000000..59cfc9cd251
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Supplier.cpp
@@ -0,0 +1,86 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "Supplier.h"
+
+void
+Supplier::open (CosEventChannelAdmin::EventChannel_ptr event_channel
+ ACE_ENV_ARG_DECL)
+{
+ // = Connect as a consumer.
+ this->supplier_admin_ =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Supplier::close (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_admin_ =
+ CosEventChannelAdmin::SupplierAdmin::_nil ();
+}
+
+void
+Supplier::connect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->supplier_admin_.in ()))
+ return;
+
+ this->consumer_proxy_ =
+ this->supplier_admin_->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosEventComm::PushSupplier_var objref = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_->connect_push_supplier (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Supplier::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->consumer_proxy_.in ())
+ || CORBA::is_nil (this->supplier_admin_.in ()))
+ return;
+
+ this->consumer_proxy_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_ =
+ CosEventChannelAdmin::ProxyPushConsumer::_nil ();
+}
+
+void
+Supplier::send_event (const CORBA::Any & data
+ ACE_ENV_ARG_DECL)
+{
+ this->consumer_proxy_->push (data ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ // Deactivate this object.
+
+ 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;
+}
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Supplier.h b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Supplier.h
new file mode 100644
index 00000000000..413244fc4f4
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Basic/Supplier.h
@@ -0,0 +1,64 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// Supplier.h
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// = DESCRIPTION
+// Defines a simple Push Supplier.
+//
+// ============================================================================
+
+#ifndef COSECSUPPLIER_H_
+#define COSECSUPPLIER_H_
+
+#include "orbsvcs/CosEventCommC.h"
+#include "orbsvcs/CosEventChannelAdminC.h"
+#include "orbsvcs/CosEventCommS.h"
+#include "orbsvcs/CosEventChannelAdminS.h"
+
+class Supplier : public POA_CosEventComm::PushSupplier
+{
+ // = TITLE
+ // Supplier
+ //
+ // = DESCRIPTION
+ // The Supplier is a simple Push Supplier that connects to
+ // the CosEC and sends events to it.
+public:
+ void open (CosEventChannelAdmin::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 connect (ACE_ENV_SINGLE_ARG_DECL);
+
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the EC, but do not forget about it or close it.
+
+ void send_event (const CORBA::Any &data
+ ACE_ENV_ARG_DECL);
+ // Send one event.
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+ // The POA_CosEventComm::PushSupplier method.
+
+private:
+ CosEventChannelAdmin::ProxyPushConsumer_var consumer_proxy_;
+ // We talk to the EC using this proxy.
+
+ CosEventChannelAdmin::SupplierAdmin_var supplier_admin_;
+ // We talk to the EC using this proxy.
+};
+
+#endif /* COSECSUPPLIER_H_ */
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Makefile.am b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Makefile.am
new file mode 100644
index 00000000000..6e509ce0f24
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/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 = \
+ Basic \
+ Multiple
+
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Consumer.cpp b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Consumer.cpp
new file mode 100644
index 00000000000..9cdb697eff1
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Consumer.cpp
@@ -0,0 +1,197 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "Consumer.h"
+#include "ace/Get_Opt.h"
+
+Consumer::Consumer ()
+ :event_count_ (1)
+{
+ // No-Op.
+}
+
+int
+Consumer::parse_args (int argc, char *argv [])
+{
+ ACE_Get_Opt get_opt (argc, argv, "n:c:");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'n':
+ this->service_name = get_opt.opt_arg ();
+ break;
+
+ case 'c':
+ this->event_count_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ " -n <COS Event Service name>"
+ " -c event_count"
+ " \n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+void
+Consumer::open (CosEventChannelAdmin::EventChannel_ptr event_channel
+ ACE_ENV_ARG_DECL)
+{
+ // = Connect as a consumer.
+ this->consumer_admin_ =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Consumer::close (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_admin_ =
+ CosEventChannelAdmin::ConsumerAdmin::_nil ();
+}
+
+void
+Consumer::connect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->consumer_admin_.in ()))
+ return;
+
+ CosEventComm::PushConsumer_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_ =
+ this->consumer_admin_->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_->connect_push_consumer (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->supplier_proxy_.in ())
+ || CORBA::is_nil (this->consumer_admin_.in ()))
+ return;
+
+ this->supplier_proxy_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_ =
+ CosEventChannelAdmin::ProxyPushSupplier::_nil ();
+}
+
+void
+Consumer::push (const CORBA::Any &
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P):%s\n",
+ " - In Consumer::push"));
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Event count = %d\n",
+ this->event_count_));
+
+ this->event_count_ = this->event_count_ - 1;
+ // decrement the count
+
+ if (this->event_count_ == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P):%s\n",
+ "exiting the consumer."));
+
+ this->close (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->shutdown ();
+ }
+}
+
+void
+Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ // Deactivate this object.
+
+ 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;
+}
+
+int
+Consumer::init_Consumer (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->open (this->cos_ec_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->connect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception in Consumer::connect (void)\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ Consumer cons;
+
+ if (cons.init (argc, argv) == -1)
+ return 1;
+
+ if (cons.init_Consumer () == -1)
+ return 1;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P): %s\n", "Started the consumer.."));
+
+ cons.runORB ();
+
+ cons.shutdown ();
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Consumer.h b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Consumer.h
new file mode 100644
index 00000000000..ce523fed960
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Consumer.h
@@ -0,0 +1,86 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// Consumer.h
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// = DESCRIPTION
+// Defines a simple Push Consumer.
+//
+// ============================================================================
+
+#ifndef COSECCONSUMER_H_
+#define COSECCONSUMER_H_
+
+#include "orbsvcs/CosEventCommC.h"
+#include "orbsvcs/CosEventChannelAdminC.h"
+#include "orbsvcs/CosEventCommS.h"
+#include "orbsvcs/CosEventChannelAdminS.h"
+#include "Multiple.h"
+
+class Consumer : public POA_CosEventComm::PushConsumer, public Multiple
+{
+ // = TITLE
+ // Consumer
+ //
+ // = DESCRIPTION
+ // The Consumer is a simple PushConsumer that connects to the
+ // CosEC and receives events from it.
+
+public:
+ // = Initializatiopn and termination methods.
+ Consumer ();
+ // Constructor.
+
+ int init_Consumer (void);
+ // Initialize the Consumer.
+
+ void open (CosEventChannelAdmin::EventChannel_ptr event_channel
+ 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_ENV_SINGLE_ARG_DECL);
+ // Connect the Consumer to the EventChannel.
+
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the supplier, but do not forget about it or close
+ // it.
+
+ virtual void push (const CORBA::Any &data
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+ // push the event to the consumer.
+
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+ // disconnect the consumer from the EC.
+
+ // = CosEC_Multiple methods.
+ virtual int parse_args (int argc, char *argv []);
+ // Parse the command line options.
+
+private:
+ CosEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+ // We talk to the EC using this proxy.
+
+ CosEventChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ // We talk to the EC using this proxy.
+
+ int event_count_;
+ // The number of Events to receive before switching off.
+};
+
+#endif /* COSECCONSUMER_H_ */
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/CosEC_RtEC_Based_Mult.mpc b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/CosEC_RtEC_Based_Mult.mpc
new file mode 100644
index 00000000000..8b13ff7e584
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/CosEC_RtEC_Based_Mult.mpc
@@ -0,0 +1,36 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Cons) : orbsvcsexe, event, event_skel, rtevent, rtsched, rtevent_serv {
+ after += CosEC_RtEC_Based_lib
+ libs += CosEC_RtEC_Based
+ libpaths += ../../lib
+
+ specific (automake) {
+ includes += $(srcdir)/../../lib
+ } else {
+ includes += ../../lib
+ }
+
+ source_files {
+ Consumer.cpp
+ Multiple.cpp
+ }
+}
+
+project(*Supp) : orbsvcsexe, event, event_skel, rtevent, rtsched, rtevent_serv {
+ after += CosEC_RtEC_Based_lib
+ libs += CosEC_RtEC_Based
+ libpaths += ../../lib
+
+ specific (automake) {
+ includes += $(srcdir)/../../lib
+ } else {
+ includes += ../../lib
+ }
+
+ source_files {
+ Supplier.cpp
+ Multiple.cpp
+ }
+}
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Makefile.am b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Makefile.am
new file mode 100644
index 00000000000..40a10fb6254
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/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.CosEC_RtEC_Based_Mult_Cons.am
+
+if BUILD_CORBA_MESSAGING
+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 \
+ -I$(srcdir)/../../lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Consumer_SOURCES = \
+ Consumer.cpp \
+ Multiple.cpp \
+ Consumer.h \
+ Multiple.h
+
+Consumer_LDADD = \
+ $(top_builddir)/orbsvcs/examples/CosEC/RtEC_Based/lib/libCosEC_RtEC_Based.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTSched.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.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_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.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.CosEC_RtEC_Based_Mult_Supp.am
+
+if BUILD_CORBA_MESSAGING
+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 \
+ -I$(srcdir)/../../lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Supplier_SOURCES = \
+ Multiple.cpp \
+ Supplier.cpp \
+ Multiple.h \
+ Supplier.h
+
+Supplier_LDADD = \
+ $(top_builddir)/orbsvcs/examples/CosEC/RtEC_Based/lib/libCosEC_RtEC_Based.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTSched.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.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_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.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/examples/CosEC/RtEC_Based/tests/Multiple/Multiple.cpp b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Multiple.cpp
new file mode 100644
index 00000000000..4af0b93b9aa
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Multiple.cpp
@@ -0,0 +1,151 @@
+// $Id$
+
+#include "Multiple.h"
+
+Multiple::Multiple (void)
+ : cos_ec_ (CosEventChannelAdmin::EventChannel::_nil ()),
+ service_name ("CosEventService"),
+ orb_ (CORBA::ORB::_nil ())
+{
+ // No-Op.
+}
+
+
+Multiple::~Multiple (void)
+{
+ // No-Op.
+}
+
+int
+Multiple::init (int argc, char *argv[])
+{
+ if (init_ORB (argc, argv) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "init_ORB returned error.\n"),
+ -1);
+
+ if (this->parse_args (argc, argv) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "parse error returned error.\n"),
+ -1);
+
+ if (init_CosEC () == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "init_CosEC returned error.\n"),
+ -1);
+ return 0;
+}
+
+int
+Multiple::init_ORB (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;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception in Multiple::init_ORB\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Multiple::init_CosEC (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialization of the naming service.
+ if (this->naming_client_.init (this->orb_.in ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
+
+ CosNaming::Name ec_ref_name (1);
+ ec_ref_name.length (1);
+ ec_ref_name[0].id =
+ CORBA::string_dup (this->service_name);
+
+ CORBA::Object_var EC_obj =
+ this->naming_client_->resolve (ec_ref_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The CORBA::Object_var object is downcast to
+ // CosEventChannelAdmin::EventChannel
+ // using the <_narrow> method.
+ this->cos_ec_ =
+ CosEventChannelAdmin::EventChannel::_narrow (EC_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception in Multiple::init_ORB\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Multiple::runORB (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "run"), 1);
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+void
+Multiple::shutdown (void)
+{
+ if (!this->orb_->_nil ())
+ this->orb_->shutdown ();
+}
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Multiple.h b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Multiple.h
new file mode 100644
index 00000000000..3248946ce78
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Multiple.h
@@ -0,0 +1,79 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// Multiple.h
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// = DESCRIPTION
+// This is a test class for the Cos Event Service.
+//
+// ============================================================================
+
+#ifndef COSECMULTIPLE_H
+#define COSECMULTIPLE_H
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/Naming/Naming_Server.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/CosEventChannelAdminC.h"
+
+class Multiple
+{
+ public:
+ // = TITLE
+ // class Multiple
+ //
+ // = DESCRIPTION
+ // Base class for suppliers and consumers to send/receive events
+ // via the Cos Event Service.
+ public:
+ // = Initialization and termination methods.
+ Multiple (void);
+ // Constructor.
+
+ virtual ~Multiple (void);
+ // Destructor.
+
+ int init (int argc, char *argv[]);
+ // Calls parse_args, Starts up an ORB, gets hold of the Event Service.
+ // Returns 0 on success, -1 on error.
+
+ int runORB (void);
+ // Calls the ORB's <run> method.
+
+ void shutdown (void);
+ // Closes down the ORB and exits.
+
+ protected:
+ virtual int parse_args (int argc, char *argv []) = 0;
+ // Parse the command line arguments.
+
+ CosEventChannelAdmin::EventChannel_ptr cos_ec_;
+ // Reference to a running Event Service.
+
+ const char* service_name;
+// The name with which to locate the Event Service.
+
+ private:
+ int init_ORB (int argc, char *argv[]);
+ // initializes the ORB.
+ // Returns 0 on success, -1 on error.
+
+ int init_CosEC (void);
+ // initializes the COS EC.
+ // Returns 0 on success, -1 on error.
+
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ TAO_Naming_Client naming_client_;
+ // An instance of the name client used for resolving the factory
+ // objects.
+};
+
+#endif /* COSECMULTIPLE_H */
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/README b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/README
new file mode 100644
index 00000000000..6b6d90cb706
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/README
@@ -0,0 +1,77 @@
+ CosEC_Multiple
+------------------------------------------------------------------------
+This test for the Cos Event Service has 2 executables - one for suppliers
+and the other for consumers.
+Both connect to a running Event Service.
+
+To run a test manually:
+1. Start one or more consumers.
+2. Run a Supplier, the consumer displays the data received.
+
+The command line parameters for the Supplier are:
+ -n <Name of the Event Service>,the default name is "CosEventService"
+
+ -c <event_count>, number of events to send to the CosEC.
+
+The command line parameters for the Consumer are:
+ -n <Name of the Event Service>,the default name is "CosEventService"
+
+ -c <event_count>, number of events to receive from the CosEC.
+
+------------------------------------------------------------------------
+Test Scripts:
+
+run_test.pl - Event filtering using the RtEC.
+
+This test starts up 2 CosEC's connected to one RtEC as shown..
+
+ ---------
+ | RtEC |
+ ---------
+ |
+ |
+ ________|____________
+ | |
+ ____|____ ____|____
+ | CosEC1 | | CosEC2 |
+ "cosec1" _________ _________ "cosec2"
+ | |
+ _____|________ _____|_______
+ | | | |
+ consumerA supplierB consumerB supplierA
+
+The CosEC1 (see fig.) is setup with these parameters:
+# cos event service name = "cosec1"
+# for ConsumerQOS: EventID = 21, SourceID = 6
+# for SupplierQOS: EventID = 20, SourceID = 5
+
+The CosEC2 (see fig.) is setup with these parameters:
+# cos event service name = "cosec2"
+# for ConsumerQOS: EventID = 20, SourceID = 5
+# for SupplierQOS: EventID = 21, SourceID = 6
+
+This setup configures the CosEC's such that consumerA connected to CosEC1 receives events from supplierA connected to CosEC2.
+similarly, consumerB and supplierB form the other pair.
+
+Parameters:
+
+-e event_count, The number of events supplied by each supplier
+ and also the number of events that a consumer will count
+ before shutting down.
+
+To execute this test, run the run_test.pl script.
+
+------------------------------------------------------------------------
+run_test2.pl: demostrates multiple consumers and suppliers connected
+to one CosEC.
+This test has the following params -
+
+-e event_count, The number of events supplied by each supplier
+ and also the number of events that a consumer will count
+ before shutting down.
+
+-c consumers, The number of consumers to connect the Event service.
+
+-s suppliers, The number of suppliers to connect the Event service.
+
+------------------------------------------------------------------------
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Supplier.cpp b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Supplier.cpp
new file mode 100644
index 00000000000..7d9a03c9261
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Supplier.cpp
@@ -0,0 +1,185 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "Supplier.h"
+#include "ace/Get_Opt.h"
+
+Supplier::Supplier ()
+ : event_count_ (1)
+{
+ // No-Op.
+}
+
+int
+Supplier::parse_args (int argc, char *argv [])
+{
+ ACE_Get_Opt get_opt (argc, argv, "n:c:");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'n':
+ this->service_name = get_opt.opt_arg ();
+ break;
+
+ case 'c':
+ this->event_count_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ " -n <COS Event Service name>"
+ " \n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+void
+Supplier::open (CosEventChannelAdmin::EventChannel_ptr event_channel
+ ACE_ENV_ARG_DECL)
+{
+ // = Connect as a consumer.
+ this->supplier_admin_ =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Supplier::close (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_admin_ =
+ CosEventChannelAdmin::SupplierAdmin::_nil ();
+}
+
+void
+Supplier::connect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->supplier_admin_.in ()))
+ return;
+
+ this->consumer_proxy_ =
+ this->supplier_admin_->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosEventComm::PushSupplier_var objref = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_->connect_push_supplier (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Supplier::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->consumer_proxy_.in ())
+ || CORBA::is_nil (this->supplier_admin_.in ()))
+ return;
+
+ this->consumer_proxy_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_ =
+ CosEventChannelAdmin::ProxyPushConsumer::_nil ();
+}
+
+void
+Supplier::send_event (const CORBA::Any & data
+ ACE_ENV_ARG_DECL)
+{
+ this->consumer_proxy_->push (data ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ // Deactivate this object.
+
+ 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::run (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Create an Any type to pass to the Cos EC.
+ CORBA::Any any;
+ any <<= CORBA::Long (50);
+
+ this->open (this->cos_ec_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->connect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P):sending %d events...\n",
+ this->event_count_));
+
+ for (int count = this->event_count_;
+ count != 0;
+ count--)
+ {
+ this->send_event (any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P):Done!. exiting now..\n"));
+
+ this->close (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception in CosEC_Multiple::run\n");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+int
+main (int argc, char *argv[])
+{
+ Supplier supp;
+
+ if (supp.init (argc, argv) == -1)
+ return 1;
+
+ supp.run ();
+
+ supp.shutdown ();
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Supplier.h b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Supplier.h
new file mode 100644
index 00000000000..29b213cd31f
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/Supplier.h
@@ -0,0 +1,79 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// Supplier.h
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// = DESCRIPTION
+// Defines a simple Push Supplier.
+//
+// ============================================================================
+
+#ifndef COSECSUPPLIER_H_
+#define COSECSUPPLIER_H_
+
+#include "orbsvcs/CosEventCommC.h"
+#include "orbsvcs/CosEventChannelAdminC.h"
+#include "orbsvcs/CosEventCommS.h"
+#include "orbsvcs/CosEventChannelAdminS.h"
+#include "Multiple.h"
+
+class Supplier : public POA_CosEventComm::PushSupplier,
+ public Multiple
+{
+ // = TITLE
+ // Supplier
+ //
+ // = DESCRIPTION
+ // The Supplier is a simple Push Supplier that connects to
+ // the CosEC and sends events to it.
+public:
+ // = Initializatiopn and termination methods.
+ Supplier ();
+ // Constructor.
+
+ void open (CosEventChannelAdmin::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 connect (ACE_ENV_SINGLE_ARG_DECL);
+
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the EC, but do not forget about it or close it.
+
+ void send_event (const CORBA::Any &data
+ ACE_ENV_ARG_DECL);
+ // Send one event.
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+ // The POA_CosEventComm::PushSupplier method.
+
+ void run (void);
+ // Sends the events to the EC.
+
+ // = Multiple methods.
+ virtual int parse_args (int argc, char *argv []);
+ // Parses the command line arguments.
+private:
+ CosEventChannelAdmin::ProxyPushConsumer_var consumer_proxy_;
+ // We talk to the EC using this proxy.
+
+ CosEventChannelAdmin::SupplierAdmin_var supplier_admin_;
+ // We talk to the EC using this proxy.
+
+ int event_count_;
+ // The number of Events to send to the EC.
+};
+
+#endif /* COSECSUPPLIER_H_ */
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/run_test.pl b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/run_test.pl
new file mode 100755
index 00000000000..6e98ae48afb
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/run_test.pl
@@ -0,0 +1,178 @@
+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;
+
+#event count
+$ev_count = 20;
+$status = 0;
+
+# setup CosEC params such that..
+# cos event service name = "cosec1"
+# for ConsumerQOS: EventID = 21, SourceID = 6
+# for SupplierQOS: EventID = 20, SourceID = 5.
+$CosEC1_params = "-n cosec1 -e 21 -o 6 -p \"5 20\"";
+
+# setup another CosEC params such that..
+# cos event service name = "cosec2"
+# for ConsumerQOS: EventID = 20, SourceID = 5
+# for SupplierQOS: EventID = 21, SourceID = 6.
+$CosEC2_params = "-n cosec2 -e 20 -o 5 -p \"6 21\"";
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+
+unlink $nsior;
+
+# Parse the arguments
+
+for ($i = 0; $i <= $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") {
+ print "usage: run_test.pl -e event_count -h help\n";
+ exit;
+ }
+ elsif ($ARGV[$i] eq "-e") {
+ $ev_count = $ARGV[$i + 1];
+ $i++;
+ }
+}
+
+$NS = new PerlACE::Process ("../../../../../Naming_Service/Naming_Service",
+ "-o $nsior");
+
+$EC = new PerlACE::Process ("../../../../../Event_Service/Event_Service",
+ "-t new -ORBInitRef NameService=file://$nsior");
+
+$CE1 = new PerlACE::Process ("../../bin/RtEC_Based_CosEC",
+ "-ORBInitRef NameService=file://$nsior $CosEC1_params");
+
+$CE2 = new PerlACE::Process ("../../bin/RtEC_Based_CosEC",
+ "-ORBInitRef NameService=file://$nsior $CosEC2_params");
+
+$CO1 = new PerlACE::Process ("Consumer",
+ "-ORBInitRef NameService=file://$nsior -n cosec1 -c $ev_count");
+
+$SU1 = new PerlACE::Process ("Supplier",
+ "-ORBInitRef NameService=file://$nsior -n cosec2 -c $ev_count");
+
+$CO2 = new PerlACE::Process ("Consumer",
+ "-ORBInitRef NameService=file://$nsior -n cosec2 -c $ev_count");
+
+$SU2 = new PerlACE::Process ("Supplier",
+ "-ORBInitRef NameService=file://$nsior -n cosec1 -c $ev_count");
+
+# first start the Naming service..
+$NS->Spawn ();
+
+sleep 10;
+
+# now start the Rt EC..
+$EC->Spawn ();
+
+sleep 10;
+
+# now start the CosEC1..
+$CE1->Spawn ();
+
+sleep 10;
+
+# now start the CosEC2..
+$CE2->Spawn ();
+
+sleep 10;
+
+# start 1 consumer that uses CosEC1 to receive events
+$CO1->Spawn ();
+
+sleep 10;
+
+# start 1 supplier that uses CosEC2 to send events
+$SU1->Spawn ();
+
+sleep 10;
+
+# wait for the supplier to finish
+$supplier = $SU1->WaitKill (60);
+
+if ($supplier != 0) {
+ print STDERR "ERROR: supplier returned $supplier\n";
+ $status = 1;
+}
+
+# wait for the consumer to finish
+$consumer = $CO1->WaitKill (60);
+
+if ($consumer != 0) {
+ print STDERR "ERROR: consumer returned $consumer\n";
+ $status = 1;
+}
+
+#----------
+
+# start 1 consumer that uses CosEC1 to receive events
+$CO2->Spawn ();
+
+sleep 10;
+
+# start 1 supplier that uses CosEC2 to send events
+$SU2->Spawn ();
+
+sleep 10;
+
+# wait for the supplier to finish
+$supplier = $SU2->WaitKill (60);
+
+if ($supplier != 0) {
+ print STDERR "ERROR: supplier returned $supplier\n";
+ $status = 1;
+}
+
+# wait for the consumer to finish
+
+$consumer = $CO2->WaitKill (60);
+
+if ($consumer != 0) {
+ print STDERR "ERROR: consumer returned $consumer\n";
+ $status = 1;
+}
+
+
+#----------
+
+# cleanup..
+
+$server = $CE2->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: CosEC2 returned $server\n";
+ $status = 1;
+}
+
+$CE1->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: CosEC1 returned $server\n";
+ $status = 1;
+}
+
+$EC->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: EC returned $server\n";
+ $status = 1;
+}
+
+$NS->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: NS returned $server\n";
+ $status = 1;
+}
+
+unlink $nsior;
+
+exit $status;
diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/run_test2.pl b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/run_test2.pl
new file mode 100755
index 00000000000..90852c11c68
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/tests/Multiple/run_test2.pl
@@ -0,0 +1,133 @@
+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;
+
+$con_count = 10;
+$sup_count = 10;
+$ev_count = 8;
+$status = 0;
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+
+unlink $nsior;
+
+# Parse the arguments
+
+for ($i = 0; $i <= $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") {
+ print "usage: run_test2.pl -e event_count -c consumers -s suppliers -h help\n";
+ exit;
+ }
+ elsif ($ARGV[$i] eq "-e") {
+ $ev_count = $ARGV[$i + 1];
+ $i++;
+ }
+ elsif ($ARGV[$i] eq "-c") {
+ $con_count = $ARGV[$i + 1];
+ $i++;
+ }
+ elsif ($ARGV[$i] eq "-s") {
+ $sup_count = $ARGV[$i + 1];
+ $i++;
+ }
+}
+
+$NS = new PerlACE::Process ("../../../../../Naming_Service/Naming_Service",
+ "-o $nsior");
+
+$EC = new PerlACE::Process ("../../../../../Event_Service/Event_Service",
+ "-t new -ORBInitRef NameService=file://$nsior");
+
+$CE1 = new PerlACE::Process ("../../bin/RtEC_Based_CosEC",
+ "-ORBInitRef NameService=file://$nsior");
+
+for ($cntr1 = 0; $cntr1 < $con_count ; ++$cntr1) {
+ push @CONS, (new PerlACE::Process ("Consumer", "-ORBInitRef NameService=file://$nsior -c $ev_count"));
+}
+
+for ($cntr2 = 0; $cntr2 < $con_count ; ++$cntr2) {
+ push @SUPS, (new PerlACE::Process ("Supplier", "-ORBInitRef NameService=file://$nsior -c $ev_count"));
+}
+
+# first start the Naming service..
+$NS->Spawn ();
+
+sleep 10;
+
+# now start the Rt EC..
+$EC->Spawn ();
+
+sleep 10;
+
+# now start the CosEC1..
+$CE1->Spawn ();
+
+sleep 10;
+
+# now start the consumers
+foreach $co (@CONS) {
+ print "creating consumer# $cntr1\n";
+ $co->Spawn ();
+ sleep 10;
+}
+
+# now start the suppliers
+foreach $su (@SUPS) {
+ print "creating supplier# $cntr2\n";
+ $su->Spawn ();
+ sleep 10;
+}
+
+print "waiting for the suppliers to finish\n";
+foreach $su (@SUPS) {
+ $supplier = $su->WaitKill (60);
+
+ if ($supplier != 0) {
+ print STDERR "ERROR: A supplier returned $supplier\n";
+ $status = 1;
+ }
+}
+
+
+print "waiting for the last consumer to finish\n";
+foreach $co (@CONS) {
+ $consumer = $co->WaitKill (60);
+
+ if ($consumer != 0) {
+ print STDERR "ERROR: A consumer returned $consumer\n";
+ $status = 1;
+ }
+}
+
+print "cleanup...\n";
+$CE1->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: CosEC1 returned $server\n";
+ $status = 1;
+}
+
+$EC->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: EC returned $server\n";
+ $status = 1;
+}
+
+$NS->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: NS returned $server\n";
+ $status = 1;
+}
+print "done!.\n";
+
+unlink $nsior;
+
+exit $status;
diff --git a/TAO/orbsvcs/examples/CosEC/Simple/Consumer.cpp b/TAO/orbsvcs/examples/CosEC/Simple/Consumer.cpp
new file mode 100644
index 00000000000..bcf4fcfc551
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Simple/Consumer.cpp
@@ -0,0 +1,130 @@
+// $Id$
+
+#include "Consumer.h"
+#include "orbsvcs/CosEventChannelAdminS.h"
+
+ACE_RCSID (CosEC_Examples,
+ Consumer,
+ "$Id$")
+
+int
+main (int argc, char* argv[])
+{
+ Consumer consumer;
+
+ return consumer.run (argc, argv);
+}
+
+// ****************************************************************
+
+Consumer::Consumer (void)
+ : event_count_ (0)
+{
+}
+
+int
+Consumer::run (int argc, char* argv[])
+{
+ 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;
+
+ // Do *NOT* make a copy because we don't want the ORB to outlive
+ // the Consumer object.
+ this->orb_ = orb.in ();
+
+ if (argc <= 1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Usage: Consumer <event_channel_ior>\n"));
+ return 1;
+ }
+
+ 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;
+
+ // Obtain the event channel, we could use a naming service, a
+ // command line argument or resolve_initial_references(), but
+ // this is simpler...
+ object =
+ orb->string_to_object (argv[1] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosEventChannelAdmin::EventChannel_var event_channel =
+ CosEventChannelAdmin::EventChannel::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The canonical protocol to connect to the EC
+ CosEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosEventChannelAdmin::ProxyPushSupplier_var supplier =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosEventComm::PushConsumer_var consumer =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ supplier->connect_push_consumer (consumer.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Wait for events, using work_pending()/perform_work() may help
+ // or using another thread, this example is too simple for that.
+ orb->run ();
+
+ // We don't do any cleanup, it is hard to do it after shutdown,
+ // and would complicate the example; plus it is almost
+ // impossible to do cleanup after ORB->run() because the POA is
+ // in the holding state. Applications should use
+ // work_pending()/perform_work() to do more interesting stuff.
+ // Check the supplier for the proper way to do cleanup.
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Consumer::run");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+Consumer::push (const CORBA::Any &
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->event_count_ ++;
+ if (this->event_count_ % 100 == 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)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // In this example we shutdown the ORB when we disconnect from the
+ // EC (or rather the EC disconnects from us), but this doesn't have
+ // to be the case....
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
diff --git a/TAO/orbsvcs/examples/CosEC/Simple/Consumer.h b/TAO/orbsvcs/examples/CosEC/Simple/Consumer.h
new file mode 100644
index 00000000000..7156353e483
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Simple/Consumer.h
@@ -0,0 +1,59 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS COS Event Channel examples
+//
+// = FILENAME
+// Consumer
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef CONSUMER_H
+#define CONSUMER_H
+
+#include "orbsvcs/CosEventCommS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Consumer : public POA_CosEventComm::PushConsumer
+{
+ // = TITLE
+ // Simple consumer object
+ //
+ // = DESCRIPTION
+ // This class is a consumer of events.
+ //
+public:
+ Consumer (void);
+ // Constructor
+
+ int run (int argc, char* argv[]);
+ // Run the test
+
+ // = The CosEventComm::PushConsumer methods
+
+ virtual void push (const CORBA::Any &event
+ 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));
+ // The skeleton methods.
+
+private:
+ CORBA::ULong event_count_;
+ // Keep track of the number of events received.
+
+ CORBA::ORB_ptr orb_;
+ // The orb, just a pointer because the ORB does not outlive the
+ // run() method...
+};
+
+#endif /* CONSUMER_H */
diff --git a/TAO/orbsvcs/examples/CosEC/Simple/CosEC_Simple.mpc b/TAO/orbsvcs/examples/CosEC/Simple/CosEC_Simple.mpc
new file mode 100644
index 00000000000..7a91454ad07
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Simple/CosEC_Simple.mpc
@@ -0,0 +1,20 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Service) : orbsvcsexe, event, event_serv, naming {
+ Source_Files {
+ Service.cpp
+ }
+}
+
+project(*Consumer) : orbsvcsexe, event, event_skel {
+ Source_Files {
+ Consumer.cpp
+ }
+}
+
+project(*Supplier) : orbsvcsexe, event, event_skel {
+ Source_Files {
+ Supplier.cpp
+ }
+}
diff --git a/TAO/orbsvcs/examples/CosEC/Simple/Makefile.am b/TAO/orbsvcs/examples/CosEC/Simple/Makefile.am
new file mode 100644
index 00000000000..9938d9c430d
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Simple/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.CosEC_Simple_Consumer.am
+
+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 \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Consumer_SOURCES = \
+ Consumer.cpp \
+ Consumer.h
+
+Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.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
+
+## Makefile.CosEC_Simple_Service.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Service
+
+Service_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
+
+Service_SOURCES = \
+ Service.cpp \
+ Consumer.h \
+ Supplier.h
+
+Service_LDADD = \
+ $(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_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.CosEC_Simple_Supplier.am
+
+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 \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Supplier_SOURCES = \
+ Supplier.cpp \
+ Supplier.h
+
+Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.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
+
+## 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/examples/CosEC/Simple/README b/TAO/orbsvcs/examples/CosEC/Simple/README
new file mode 100644
index 00000000000..6090cd7419e
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Simple/README
@@ -0,0 +1,15 @@
+# $Id$
+
+ This directory contains what possibly is the simplest example
+for a COS Event Service. It contains three executables; a consumer,
+supplier and a program to create the event channel itself.
+
+ To test is use the run_test.pl script, or:
+
+$ ./Service -o ec.ior
+$ ./Consumer file://ec.ior
+$ ./Supplier file://ec.ior
+
+ more advanced tests are located in:
+
+$TAO_ROOT/orbsvcs/tests/CosEvent
diff --git a/TAO/orbsvcs/examples/CosEC/Simple/Service.cpp b/TAO/orbsvcs/examples/CosEC/Simple/Service.cpp
new file mode 100644
index 00000000000..07a78aea874
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Simple/Service.cpp
@@ -0,0 +1,124 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_Default_Factory.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID (CosEC_Simple,
+ Service,
+ "$Id$")
+
+const char *ior_output_file = "ec.ior";
+
+int parse_args (int argc, char *argv[]);
+
+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;
+
+ if (parse_args (argc, argv) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Usage: Service [-o IOR_file_name]\n"));
+ return 1;
+ }
+
+ 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;
+
+ CORBA::String_var ior =
+ orb->object_to_string (event_channel.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);
+ }
+
+ // Wait for events, using work_pending()/perform_work() may help
+ // or using another thread, this example is too simple for that.
+ orb->run ();
+
+ // We don't do any cleanup, it is hard to do it after shutdown,
+ // and would complicate the example; plus it is almost
+ // impossible to do cleanup after ORB->run() because the POA is
+ // in the holding state. Applications should use
+ // work_pending()/perform_work() to do more interesting stuff.
+ // Check the supplier for the proper way to do cleanup.
+ }
+ 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, "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;
+}
+
diff --git a/TAO/orbsvcs/examples/CosEC/Simple/Supplier.cpp b/TAO/orbsvcs/examples/CosEC/Simple/Supplier.cpp
new file mode 100644
index 00000000000..3886f6d085a
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Simple/Supplier.cpp
@@ -0,0 +1,129 @@
+// $Id$
+
+#include "Supplier.h"
+#include "orbsvcs/CosEventChannelAdminS.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (CosEC_Examples,
+ Supplier,
+ "$Id$")
+
+int
+main (int argc, char* argv[])
+{
+ Supplier supplier;
+
+ return supplier.run (argc, argv);
+}
+
+// ****************************************************************
+
+Supplier::Supplier (void)
+{
+}
+
+int
+Supplier::run (int argc, char* argv[])
+{
+ 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;
+
+ if (argc <= 1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Usage: Supplier <event_channel_ior>\n"));
+ return 1;
+ }
+
+ 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;
+
+ // Obtain the event channel, we could use a naming service, a
+ // command line argument or resolve_initial_references(), but
+ // this is simpler...
+ object =
+ orb->string_to_object (argv[1] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosEventChannelAdmin::EventChannel_var event_channel =
+ CosEventChannelAdmin::EventChannel::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The canonical protocol to connect to the EC
+ CosEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosEventChannelAdmin::ProxyPushConsumer_var consumer =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosEventComm::PushSupplier_var supplier =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ consumer->connect_push_supplier (supplier.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Push the events...
+ ACE_Time_Value sleep_time (0, 10000); // 10 milliseconds
+
+ CORBA::Any event;
+ event <<= CORBA::ULong (10);
+
+ for (int i = 0; i != 2000; ++i)
+ {
+ consumer->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_OS::sleep (sleep_time);
+ }
+
+ // Disconnect from the EC
+ consumer->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Destroy the EC....
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Deactivate this object...
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Destroy the POA
+ poa->destroy (1, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Supplier::run");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
diff --git a/TAO/orbsvcs/examples/CosEC/Simple/Supplier.h b/TAO/orbsvcs/examples/CosEC/Simple/Supplier.h
new file mode 100644
index 00000000000..4fdc39bfa08
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Simple/Supplier.h
@@ -0,0 +1,50 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS COS Event Channel examples
+//
+// = FILENAME
+// Supplier
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef SUPPLIER_H
+#define SUPPLIER_H
+
+#include "orbsvcs/CosEventCommS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Supplier : public POA_CosEventComm::PushSupplier
+{
+ // = TITLE
+ // Simple supplier object
+ //
+ // = DESCRIPTION
+ // This class is a supplier of events.
+ //
+public:
+ Supplier (void);
+ // Constructor
+
+ int run (int argc, char* argv[]);
+ // Run the test
+
+ // = The CosEventComm::PushSupplier methods
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The skeleton methods.
+
+private:
+};
+
+#endif /* SUPPLIER_H */
diff --git a/TAO/orbsvcs/examples/CosEC/Simple/run_test.pl b/TAO/orbsvcs/examples/CosEC/Simple/run_test.pl
new file mode 100755
index 00000000000..704c4dd8b3a
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/Simple/run_test.pl
@@ -0,0 +1,56 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$iorfile = PerlACE::LocalFile ("ec.ior");
+
+unlink $iorfile;
+
+$T = new PerlACE::Process ("Service", "-o $iorfile");
+$C = new PerlACE::Process ("Consumer", "file://$iorfile");
+$S = new PerlACE::Process ("Supplier", "file://$iorfile");
+
+$T->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $T->Kill ();
+ exit 1;
+}
+
+$C->Spawn ();
+
+sleep 5;
+
+$supplier = $S->SpawnWaitKill (120);
+
+if ($supplier != 0) {
+ print STDERR "ERROR: supplier returned $supplier\n";
+ $status = 1;
+}
+
+$consumer = $C->WaitKill (15);
+
+if ($consumer != 0) {
+ print STDERR "ERROR: consumer returned $consumer\n";
+ $status = 1;
+}
+
+$service = $T->TerminateWaitKill (5);
+
+if ($service != 0) {
+ print STDERR "ERROR: service returned $service\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/examples/CosEC/TypedSimple/Consumer.cpp b/TAO/orbsvcs/examples/CosEC/TypedSimple/Consumer.cpp
new file mode 100644
index 00000000000..db6437a39bd
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/Consumer.cpp
@@ -0,0 +1,114 @@
+// $Id$
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/CosTypedEventChannelAdminC.h"
+#include "Country_i.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID (CosEC_Examples,
+ Consumer,
+ "$Id$")
+
+int
+main (int argc, char* argv[])
+{
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_obj =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (poa_obj.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;
+
+ // Obtain the event channel using the Naming Service.
+ CORBA::Object_var nam_obj =
+ orb->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ CosNaming::NamingContext_var root_context =
+ CosNaming::NamingContext::_narrow(nam_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name channel_name (1);
+ channel_name.length (1);
+ channel_name[0].id = CORBA::string_dup ("CountryEventChannel");
+
+ CORBA::Object_var ec_obj =
+ root_context->resolve(channel_name);
+ ACE_TRY_CHECK;
+
+ // Downcast the object reference to a TypedEventChannel reference
+ CosTypedEventChannelAdmin::TypedEventChannel_var typed_event_channel =
+ CosTypedEventChannelAdmin::TypedEventChannel::_narrow(ec_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialise the Country Impl
+ Country_i country (orb.in ());
+ Country_var typed_consumer = country._this();
+
+ // Connect to the typed channel
+ CosTypedEventChannelAdmin::TypedConsumerAdmin_var typed_consumer_admin =
+ typed_event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosEventChannelAdmin::ProxyPushSupplier_var proxy_push_supplier =
+ typed_consumer_admin->obtain_typed_push_supplier (_tc_Country->id()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ proxy_push_supplier->connect_push_consumer (typed_consumer.in () );
+
+ CORBA::String_var str =
+ orb->object_to_string (typed_consumer.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ const char* ior_file_name = "Consumer.ior";
+ FILE *output_file=
+ ACE_OS::fopen (ACE_TEXT_CHAR_TO_TCHAR(ior_file_name),
+ ACE_LIB_TEXT("w"));
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_file_name),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", str.in ());
+ ACE_OS::fclose (output_file);
+
+ // Wait for events.
+ ACE_DEBUG ((LM_DEBUG, "Waiting on orb->run for events...\n"));
+ orb->run ();
+
+ ACE_DEBUG ((LM_DEBUG, "...ORB shutdown\n"));
+
+ // Destroy the POA
+ poa->destroy (1, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Destroy the ORB
+ orb->destroy ();
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "main");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/examples/CosEC/TypedSimple/CosEC_TypedSimple.mpc b/TAO/orbsvcs/examples/CosEC/TypedSimple/CosEC_TypedSimple.mpc
new file mode 100644
index 00000000000..cddcd128801
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/CosEC_TypedSimple.mpc
@@ -0,0 +1,21 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Consumer) : event_skel, orbsvcsexe, portableserver, naming {
+ requires += ec_typed_events
+ source_files {
+ Consumer.cpp
+ Country_i.cpp
+ }
+}
+
+project(*Supplier) : event_skel, orbsvcsexe, portableserver, naming {
+ requires += ec_typed_events
+ after += CosEC_TypedSimple_Consumer
+ idl_files {
+ }
+ source_files {
+ CountryC.cpp
+ Supplier.cpp
+ }
+}
diff --git a/TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl b/TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl
new file mode 100644
index 00000000000..00424bfa608
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl
@@ -0,0 +1,16 @@
+// $Id$
+
+//IDL
+
+#ifndef TAO_COUNTRY_IDL
+#define TAO_COUNTRY_IDL
+
+#include "orbsvcs/CosTypedEventComm.idl"
+
+interface Country : ::CosTypedEventComm::TypedPushConsumer
+{
+ void update_population (in string country,
+ in long population);
+};
+
+#endif /* TAO_COUNTRY_IDL */
diff --git a/TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl.for_ifr b/TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl.for_ifr
new file mode 100644
index 00000000000..220d3c09aa0
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl.for_ifr
@@ -0,0 +1,16 @@
+// $Id$
+
+//IDL
+
+#ifndef TAO_COUNTRY_IDL
+#define TAO_COUNTRY_IDL
+
+//#include "orbsvcs/CosEventComm.idl"
+
+interface Country //: ::CosTypedEventComm::TypedPushConsumer
+{
+ void update_population (in string country,
+ in long population);
+};
+
+#endif /* TAO_COUNTRY_IDL */
diff --git a/TAO/orbsvcs/examples/CosEC/TypedSimple/Country_i.cpp b/TAO/orbsvcs/examples/CosEC/TypedSimple/Country_i.cpp
new file mode 100644
index 00000000000..bbf4b03a030
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/Country_i.cpp
@@ -0,0 +1,80 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "Country_i.h"
+
+// Implementation skeleton constructor
+Country_i::Country_i (CORBA::ORB_ptr orb) :
+ orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+// Implementation skeleton destructor
+Country_i::~Country_i (void)
+{
+}
+
+void Country_i::update_population (const char * country,
+ CORBA::Long population
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+
+{
+ //Add your implementation here
+ ACE_DEBUG ((LM_DEBUG, "Country %s has population %d\n",
+ country, population));
+}
+
+CORBA::Object_ptr
+Country_i::get_typed_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+
+{
+ //Add your implementation here
+ ACE_DEBUG ((LM_DEBUG, "Country_i::get_typed_consumer called...\n"));
+
+ Country_var ret = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ ACE_DEBUG ((LM_DEBUG, "...returning CORBA::Object_ptr for Country_i\n"));
+
+ return Country::_duplicate(ret.in ());
+}
+
+void
+Country_i::push (const CORBA::Any & /* data */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+
+{
+ //Add your implementation here
+}
+
+void
+Country_i::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+
+{
+ //Add your implementation here
+ ACE_DEBUG ((LM_DEBUG, "Country_i::disconnect_push_consumer called...\n"));
+
+ // Deactivate the impl
+ PortableServer::POA_var t_poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::ObjectId_var t_id =
+ t_poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ t_poa->deactivate_object (t_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Country_i::disconnect_push_consumer, ")
+ ACE_TEXT ("calling ORB shutdown...\n")));
+ orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/examples/CosEC/TypedSimple/Country_i.h b/TAO/orbsvcs/examples/CosEC/TypedSimple/Country_i.h
new file mode 100644
index 00000000000..3d658086c47
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/Country_i.h
@@ -0,0 +1,45 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef COUNTRYI_H_
+#define COUNTRYI_H_
+
+#include "CountryS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//Class Country_i
+class Country_i : public virtual POA_Country
+{
+public:
+ //Constructor
+ Country_i (CORBA::ORB_ptr orb);
+
+ //Destructor
+ virtual ~Country_i (void);
+
+ virtual void update_population (const char * country,
+ CORBA::Long population
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Object_ptr get_typed_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ 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));
+
+private:
+ /// The ORB
+ CORBA::ORB_var orb_;
+};
+
+#endif /* COUNTRYI_H_ */
diff --git a/TAO/orbsvcs/examples/CosEC/TypedSimple/Makefile.am b/TAO/orbsvcs/examples/CosEC/TypedSimple/Makefile.am
new file mode 100644
index 00000000000..615cd3440e0
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/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.CosEC_TypedSimple_Consumer.am
+
+if BUILD_EC_TYPED_EVENTS
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES = \
+ CountryC.cpp \
+ CountryC.h \
+ CountryC.inl \
+ CountryS.cpp \
+ CountryS.h \
+ CountryS.inl \
+ CountryS_T.cpp \
+ CountryS_T.h \
+ CountryS_T.inl
+
+CLEANFILES = \
+ Country-stamp \
+ CountryC.cpp \
+ CountryC.h \
+ CountryC.inl \
+ CountryS.cpp \
+ CountryS.h \
+ CountryS.inl \
+ CountryS_T.cpp \
+ CountryS_T.h \
+ CountryS_T.inl
+
+CountryC.cpp CountryC.h CountryC.inl CountryS.cpp CountryS.h CountryS.inl CountryS_T.cpp CountryS_T.h CountryS_T.inl: Country-stamp
+
+Country-stamp: $(srcdir)/Country.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT $(srcdir)/Country.idl
+ @touch $@
+
+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 \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Consumer_SOURCES = \
+ Consumer.cpp \
+ CountryC.cpp \
+ CountryS.cpp \
+ Country_i.cpp \
+ CountryC.h \
+ CountryC.inl \
+ CountryS.h \
+ CountryS.inl \
+ CountryS_T.h \
+ CountryS_T.inl \
+ Country_i.h
+
+Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.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_EC_TYPED_EVENTS
+
+## Makefile.CosEC_TypedSimple_Supplier.am
+
+if BUILD_EC_TYPED_EVENTS
+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 \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Supplier_SOURCES = \
+ CountryC.cpp \
+ Supplier.cpp \
+ Country_i.h
+
+Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.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_EC_TYPED_EVENTS
+
+## 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/examples/CosEC/TypedSimple/README b/TAO/orbsvcs/examples/CosEC/TypedSimple/README
new file mode 100644
index 00000000000..d722b0a9e0c
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/README
@@ -0,0 +1,18 @@
+# $Id$
+
+ This directory contains an example for a COS Event Service,
+using a typed channel.
+It contains two executables; a consumer and a supplier.
+
+ To test it use :
+
+# rm Country.ifr
+# IFR_Service -p -b Country.ifr -ORBEndPoint iiop://localhost:12345
+# tao_ifr -ORBInitRef InterfaceRepository=corbaloc:iiop:localhost:12345/InterfaceRepository -I$TAO_ROOT/orbsvcs Country.idl
+# Naming_Service -ORBEndPoint iiop://localhost:8000
+# CosEvent_Service -n CountryEventChannel -r -t -d -ORBInitRef InterfaceRepository=corbaloc:iiop:localhost:12345/InterfaceRepository -ORBInitRef NameService=corbaloc:iiop:localhost:8000/NameService
+# consumer -ORBInitRef NameService=corbaloc:iiop:localhost:8000/NameService
+# supplier -ORBInitRef NameService=corbaloc:iiop:localhost:8000/NameService
+
+Note: If the tao_ifr fails, use the Country.idl.for_ifr file to upload the idl into the IFR.
+ Please also report the problem in the usual manner.
diff --git a/TAO/orbsvcs/examples/CosEC/TypedSimple/Supplier.cpp b/TAO/orbsvcs/examples/CosEC/TypedSimple/Supplier.cpp
new file mode 100644
index 00000000000..d384fad33cf
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/Supplier.cpp
@@ -0,0 +1,93 @@
+// $Id$
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/CosTypedEventChannelAdminC.h"
+#include "CountryC.h"
+
+ACE_RCSID(CosEC_Examples, Supplier, "$Id:")
+
+int
+main (int argc, char* argv[])
+{
+
+ 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;
+
+ // Obtain the event channel using the Naming Service.
+ CORBA::Object_var nam_obj =
+ orb->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ CosNaming::NamingContext_var root_context =
+ CosNaming::NamingContext::_narrow(nam_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name channel_name (1);
+ channel_name.length (1);
+ channel_name[0].id = CORBA::string_dup ("CountryEventChannel");
+
+ CORBA::Object_var ec_obj =
+ root_context->resolve(channel_name);
+ ACE_TRY_CHECK;
+
+ // Downcast the object reference to a TypedEventChannel reference
+ CosTypedEventChannelAdmin::TypedEventChannel_var typed_event_channel =
+ CosTypedEventChannelAdmin::TypedEventChannel::_narrow(ec_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Connect to the typed channel
+ CosTypedEventChannelAdmin::TypedSupplierAdmin_var typed_supplier_admin =
+ typed_event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosTypedEventChannelAdmin::TypedProxyPushConsumer_var typed_proxy_push_consumer =
+ typed_supplier_admin->obtain_typed_push_consumer (_tc_Country->id()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ typed_proxy_push_consumer->connect_push_supplier (CosEventComm::PushSupplier::_nil()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the interface from the event channel
+ CORBA::Object_var typed_consumer =
+ typed_proxy_push_consumer->get_typed_consumer(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow the interface
+ Country_var typed_supplier = Country::_narrow(typed_consumer.in () );
+ ACE_TRY_CHECK;
+
+ // Invoke the events...
+ for (int i = 0; i != 100; ++i)
+ {
+ typed_supplier->update_population ("England", i ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Disconnect from the EC
+ typed_proxy_push_consumer->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Destroy the EC....
+ typed_event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "main");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+
+
diff --git a/TAO/orbsvcs/examples/CosEC/TypedSimple/run_test.pl b/TAO/orbsvcs/examples/CosEC/TypedSimple/run_test.pl
new file mode 100755
index 00000000000..d6d585ce8a9
--- /dev/null
+++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/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;
+
+$status = 0;
+
+$nsiorfile = PerlACE::LocalFile ("ns.ior");
+$ifriorfile = PerlACE::LocalFile ("ifr.ior");
+$eciorfile = PerlACE::LocalFile ("ec.ior");
+$consiorfile = PerlACE::LocalFile ("Consumer.ior");
+
+unlink $nsiorfile;
+unlink $ifriorfile;
+unlink $eciorfile;
+unlink $consiorfile;
+
+
+$IF = new PerlACE::Process ($ENV{"TAO_ROOT"}."/orbsvcs/IFR_Service/IFR_Service",
+ "-o $ifriorfile");
+$TI = new PerlACE::Process ($ENV{"ACE_ROOT"}."/bin/tao_ifr",
+ "-ORBInitRef InterfaceRepository=file://$ifriorfile " .
+ "-I".$ENV{"TAO_ROOT"}."/orbsvcs Country.idl");
+$NS = new PerlACE::Process ($ENV{"TAO_ROOT"}."/orbsvcs/Naming_Service/Naming_Service",
+ "-o $nsiorfile");
+$CE = new PerlACE::Process ($ENV{"TAO_ROOT"}."/orbsvcs/CosEvent_Service/CosEvent_Service",
+ "-n CountryEventChannel -r -t -d -o $eciorfile " .
+ "-ORBInitRef InterfaceRepository=file://$ifriorfile " .
+ "-ORBInitRef NameService=file://$nsiorfile ");
+$C = new PerlACE::Process ("Consumer", "-ORBInitRef NameService=file://$nsiorfile ");
+$S = new PerlACE::Process ("Supplier", "-ORBInitRef NameService=file://$nsiorfile ");
+
+$IF->Spawn ();
+
+if (PerlACE::waitforfile_timed ($ifriorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$ifriorfile>\n";
+ $IF->Kill ();
+ exit 1;
+}
+
+$TI->SpawnWaitKill (60);
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($nsiorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$nsiorfile>\n";
+ $IF->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+$CE->Spawn ();
+
+if (PerlACE::waitforfile_timed ($eciorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$eciorfile>\n";
+ $IF->Kill ();
+ $NS->Kill ();
+ $CE->Kill ();
+ exit 1;
+}
+
+$C->Spawn ();
+
+if (PerlACE::waitforfile_timed ($consiorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$consiorfile>\n";
+ $IF->Kill ();
+ $NS->Kill ();
+ $CE->Kill ();
+ $C->Kill ();
+ exit 1;
+}
+
+$supplier = $S->SpawnWaitKill (120);
+
+if ($supplier != 0) {
+ print STDERR "ERROR: supplier returned $supplier\n";
+ $status = 1;
+}
+
+$server = $C->WaitKill (15);
+
+if ($server != 0) {
+ print STDERR "ERROR: consumer returned $server\n";
+ $status = 1;
+}
+
+$server = $CE->WaitKill (15);
+
+if ($server != 0) {
+ print STDERR "ERROR: CosEvent_Service returned $server\n";
+ $status = 1;
+}
+
+$server = $NS->TerminateWaitKill (15);
+
+if ($server != 0) {
+ print STDERR "ERROR: name service returned $server\n";
+ $status = 1;
+}
+
+$server = $IF->TerminateWaitKill (15);
+
+if ($server != 0) {
+ print STDERR "ERROR: IFR_Service returned $server\n";
+ $status = 1;
+}
+
+unlink $nsiorfile;
+unlink $ifriorfile;
+unlink $eciorfile;
+unlink $consiorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/examples/FaultTolerance/Makefile.am b/TAO/orbsvcs/examples/FaultTolerance/Makefile.am
new file mode 100644
index 00000000000..8dd0d109288
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/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 = \
+ RolyPoly
+
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/CrashPoint.cpp b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/CrashPoint.cpp
new file mode 100644
index 00000000000..19fed3a32ea
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/CrashPoint.cpp
@@ -0,0 +1,7 @@
+// file : RolyPoly/CrashPoint.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "CrashPoint.h"
+
+short crash_point = 0;
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/CrashPoint.h b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/CrashPoint.h
new file mode 100644
index 00000000000..69f2e1a0044
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/CrashPoint.h
@@ -0,0 +1,19 @@
+// file : RolyPoly/CrashPoint.h
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef CRASH_POINT_H
+#define CRASH_POINT_H
+
+// Valid crash-point values:
+//
+// 0 no crash (default)
+//
+// 1 crash before logging the reply
+//
+// 2 crash after logging the reply but before replying to the client
+//
+
+extern short crash_point;
+
+#endif // CRASH_POINT_H
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/Log.h b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/Log.h
new file mode 100644
index 00000000000..a83d966dd69
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/Log.h
@@ -0,0 +1,10 @@
+// file : RolyPoly/Log.h
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef LOG_HPP
+#define LOG_HPP
+
+#include "LogACE_RB_Tree.h"
+
+#endif // LOG_HPP
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/LogACE_RB_Tree.h b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/LogACE_RB_Tree.h
new file mode 100644
index 00000000000..9b54d353315
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/LogACE_RB_Tree.h
@@ -0,0 +1,66 @@
+// file : RolyPoly/LogACE_RB_Tree.h
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef LOG_ACE_RB_TREE_H
+#define LOG_ACE_RB_TREE_H
+
+#include <ace/RB_Tree.h>
+#include <ace/Synch.h>
+
+template <typename RI, typename RV>
+class Log
+{
+public:
+ typedef RI RecordIdType;
+ typedef RV RecordValueType;
+
+private:
+ typedef
+ ACE_RB_Tree <RecordIdType,
+ RecordValueType,
+ ACE_Less_Than<RecordIdType>,
+ ACE_Null_Mutex>
+ Map_;
+
+public:
+ class Duplicate {};
+ class NotFound {};
+
+ void
+ insert (RecordIdType const& ri, RecordValueType const& rv)
+ throw (Duplicate)
+ {
+ if (map_.bind (ri, rv) != 0) throw Duplicate ();
+ }
+
+ bool
+ contains (RecordIdType const& ri) const
+ {
+ // Guess what: ACE_RB_Tree::find() is not const.
+ //
+ Map_& m = const_cast<Map_&> (map_);
+
+ RecordValueType tmp;
+
+ return m.find (ri, tmp) == 0;
+ }
+
+
+ RecordValueType const&
+ lookup (RecordIdType const& ri) const throw (NotFound)
+ {
+ Map_& m = const_cast<Map_&> (map_);
+
+ typename Map_::ENTRY* entry;
+
+ if (m.find (ri, entry) != 0) throw NotFound ();
+
+ return entry->item ();
+ }
+
+private:
+ Map_ map_;
+};
+
+#endif // LOG_ACE_RB_TREE_H
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/LogStdMap.h b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/LogStdMap.h
new file mode 100644
index 00000000000..29a5ff2be65
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/LogStdMap.h
@@ -0,0 +1,56 @@
+// file : RolyPoly/LogStdMap.h
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef LOG_STD_MAP_H
+#define LOG_STD_MAP_H
+
+#include <map>
+
+template <typename RI, typename RV>
+class Log
+{
+public:
+ typedef RI RecordIdType;
+ typedef RV RecordValueType;
+
+private:
+ typedef
+ std::map <RecordIdType, RecordValueType>
+ Map_;
+
+public:
+ class Duplicate {};
+ class NotFound {};
+
+ void
+ insert (RecordIdType const& ri, RecordValueType const& rv)
+ throw (Duplicate)
+ {
+ if (!map_.insert (std::make_pair (ri, rv)).second)
+ {
+ throw Duplicate ();
+ }
+ }
+
+ bool
+ contains (RecordIdType const& ri) const
+ {
+ return map_.count (ri) != 0;
+ }
+
+
+ RecordValueType const&
+ lookup (RecordIdType const& ri) const throw (NotFound)
+ {
+ typename Map_::const_iterator i = map_.find (ri);
+
+ if (i != map_.end ()) return i->second;
+ else throw NotFound ();
+ }
+
+private:
+ Map_ map_;
+};
+
+#endif // LOG_STD_MAP_H
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/Makefile.am b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/Makefile.am
new file mode 100644
index 00000000000..a25dd5aeef2
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/Makefile.am
@@ -0,0 +1,179 @@
+## 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.RolyPoly_Idl.am
+
+BUILT_SOURCES = \
+ RolyPolyC.cpp \
+ RolyPolyC.h \
+ RolyPolyC.inl \
+ RolyPolyS.cpp \
+ RolyPolyS.h \
+ RolyPolyS.inl
+
+CLEANFILES = \
+ RolyPoly-stamp \
+ RolyPolyC.cpp \
+ RolyPolyC.h \
+ RolyPolyC.inl \
+ RolyPolyS.cpp \
+ RolyPolyS.h \
+ RolyPolyS.inl
+
+RolyPolyC.cpp RolyPolyC.h RolyPolyC.inl RolyPolyS.cpp RolyPolyS.h RolyPolyS.inl: RolyPoly-stamp
+
+RolyPoly-stamp: $(srcdir)/RolyPoly.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/RolyPoly.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ RolyPoly.idl
+
+## Makefile.RolyPoly_Client.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_EXCEPTIONS
+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 \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+client_SOURCES = \
+ RolyPolyC.cpp \
+ client.cpp \
+ CrashPoint.h \
+ Log.h \
+ LogACE_RB_Tree.h \
+ LogStdMap.h \
+ ORB_Initializer.h \
+ ReplicaController.h \
+ RolyPoly_i.h \
+ StateUpdate.h
+
+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_EXCEPTIONS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.RolyPoly_Server.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_EXCEPTIONS
+if BUILD_INTERCEPTORS
+if BUILD_THREADS
+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 \
+ -I$(ACE_ROOT)/protocols \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+server_SOURCES = \
+ CrashPoint.cpp \
+ ORB_Initializer.cpp \
+ ReplicaController.cpp \
+ RolyPolyC.cpp \
+ RolyPolyS.cpp \
+ RolyPoly_i.cpp \
+ server.cpp \
+ CrashPoint.h \
+ ORB_Initializer.h \
+ ReplicaController.h \
+ RolyPoly_i.h
+
+server_LDADD = \
+ $(ACE_BUILDDIR)/protocols/ace/TMCast/libACE_TMCast.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_THREADS
+endif BUILD_INTERCEPTORS
+endif BUILD_EXCEPTIONS
+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/examples/FaultTolerance/RolyPoly/ORB_Initializer.cpp b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ORB_Initializer.cpp
new file mode 100644
index 00000000000..ed3b767e2f4
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ORB_Initializer.cpp
@@ -0,0 +1,56 @@
+// file : RolyPoly/ORB_Initializer.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "ace/Auto_Ptr.h"
+#include "tao/corba.h"
+#include "tao/PI/ORBInitInfo.h"
+#include "tao/ORB_Core.h"
+
+#include "ORB_Initializer.h"
+#include "ReplicaController.h"
+
+void
+ORB_Initializer::pre_init (PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ORB_Initializer::post_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Allocate slot id.
+ //
+ state_slot_id (info->allocate_slot_id ());
+
+ // Register replica controller as server request interceptor.
+ //
+ TAO_ORBInitInfo* tao_info = dynamic_cast<TAO_ORBInitInfo*> (info);
+
+ CORBA::ORB_var orb (tao_info->orb_core ()->orb ());
+
+ PortableInterceptor::ServerRequestInterceptor_var interceptor;
+
+ {
+ PortableInterceptor::ServerRequestInterceptor *tmp_interceptor = 0;
+
+ ACE_NEW_THROW_EX (tmp_interceptor,
+ ReplicaController (orb.in ()),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+
+ ACE_CHECK;
+
+ interceptor = tmp_interceptor;
+ }
+
+ info->add_server_request_interceptor (interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ORB_Initializer.h b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ORB_Initializer.h
new file mode 100644
index 00000000000..d11b2a41aa2
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ORB_Initializer.h
@@ -0,0 +1,28 @@
+// file : RolyPoly/ORB_Initializer.h
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef ORB_INITIALIZER_H
+#define ORB_INITIALIZER_H
+
+#include "tao/LocalObject.h"
+#include "tao/PI/PI.h"
+
+class ORB_Initializer :
+ 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));
+};
+
+#endif /* ORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/README b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/README
new file mode 100644
index 00000000000..786b42a81d9
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/README
@@ -0,0 +1,105 @@
+
+
+Overview
+
+RolyPoly is a simple example that shows how to increase application
+reliability by using replication to tolerate faults. It allows you
+to start two replicas of the same object which are logically seen as
+one object by a client. Furthermore, you can terminate one of the
+replicas without interrupting the service provided by the object.
+
+RolyPoly is using request/reply logging to suppress repeated
+requests (thus guaranteeing exactly-once semantic) and state
+synchronization (to ensure all replicas are in a consistent
+state). Since replicas are generally distributed across multiple
+nodes in the network, logging and state synchronizations are
+done using multicast group communication protocol.
+
+In order to make it illustrative, each replica can be set to
+fail in one of the predefined places called crash points. The
+following crash point numbers are defined:
+
+0 - no crash point (default).
+
+1 - fail before reply logging/state synchronization.
+
+2 - fail after reply logging/state synchronization but before
+ returning reply to the client.
+
+Essential difference between crash point 1 and 2 is that in
+the second case there should be reply replay while in the
+first case request is simply re-executed (this can be observed
+in the trace messages of the replicas).
+
+
+Execution Scenario
+
+In this example scenario we will start three replicas. For one
+of them (let us call it primary) we will specify a crash point
+other than 0. Then we will start a client to execute requests
+on the resulting object. After a few requests, primary will
+fail and we will be able to observe transparent shifting of
+client to the other replica. Also we will be able to make sure
+that, after this shifting, object is still in expected state
+(i.e. the sequence of returned numbers is not interrupted and
+that, in case of the crash point 2, request is not re-executed).
+
+Note, due to the underlying group communication architecture,
+the group with only one member (replica in our case) can only
+exist for a very short period of time. This, in turn, means
+that we need to start first two replicas virtually at the same
+time. This is also a reason why we need three replicas instead
+of two - if one replica is going to fail then the other one
+won't live very long alone. For more information on the reasons
+why it works this way please see documentation for TMCast
+available at $(ACE_ROOT)/ace/TMCast/README.
+
+Suppose we have node0, node1 and node2 on which we are going
+to start our replicas (it could be the same node). Then, to
+start our replicas we can execute the following commands:
+
+node0$ ./server -o replica-0.ior -c 2
+node1$ ./server -o replica-1.ior
+node2$ ./server -o replica-2.ior
+
+When all replicas are up we can start the client:
+
+$ ./client -k file://replica-0.ior -k file://replica-1.ior
+
+In this scenario, after executing a few requests, replica-0
+will fail in crash point 2. After that, replica-1 will continue
+executing client requests. You can see what's going on with
+replicas by looking at various trace messages printed during
+execution.
+
+
+Architecture
+
+The biggest part of the replication logic is carried out by
+the ReplicaController. In particular it performs the
+following tasks:
+
+* management of distributed request/reply log
+
+* state synchronization
+
+* repeated request suppression
+
+
+Object implementation (interface RolyPoly in our case) can use
+two different strategies for delivering state update to the
+ReplicaController:
+
+* push model: client calls Checkpointable::associate_state
+ to associate the state update with current request.
+
+* pull model: ReplicaController will call Checkpointable::get_state
+ implemented by the servant.
+
+This two model can be used simultaneously. In RolyPoly interface
+implementation you can comment out corresponding piece of code to
+chose one of the strategies.
+
+--
+Boris Kolpackov <boris@dre.vanderbilt.edu>
+
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ReplicaController.cpp b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ReplicaController.cpp
new file mode 100644
index 00000000000..210009bf339
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ReplicaController.cpp
@@ -0,0 +1,540 @@
+// file : RolyPoly/ReplicaController.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "tao/AnyTypeCode/Any_Impl.h"
+#include "tao/AnyTypeCode/DynamicC.h"
+#include "tao/PortableServer/Servant_Base.h"
+#include "tao/PI/PI.h"
+
+#include "orbsvcs/FT_CORBA_ORBC.h"
+
+#include "ace/UUID.h"
+#include "ace/Thread_Manager.h"
+#include "ace/TMCast/Group.hpp"
+
+#include "CrashPoint.h"
+#include "StateUpdate.h"
+#include "ReplicaController.h"
+
+
+// State slot.
+//
+//
+
+namespace
+{
+ PortableInterceptor::SlotId state_slot_id_;
+}
+
+PortableInterceptor::SlotId
+state_slot_id ()
+{
+ return state_slot_id_;
+}
+
+void
+state_slot_id (PortableInterceptor::SlotId slot_id)
+{
+ state_slot_id_ = slot_id;
+}
+
+Checkpointable::
+~Checkpointable ()
+{
+}
+
+CORBA::Any* Checkpointable::
+get_state ()
+{
+ return 0;
+}
+
+void Checkpointable::
+associate_state (CORBA::ORB_ptr orb, CORBA::Any const& state)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Object_var pic_obj =
+ orb->resolve_initial_references ("PICurrent" ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+ PortableInterceptor::Current_var pic =
+ PortableInterceptor::Current::_narrow (
+ pic_obj.in () ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+ pic->set_slot (state_slot_id (), state ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Caught exception:");
+ }
+ ACE_ENDTRY;
+}
+
+// ReplyLogger
+//
+//
+
+ReplicaController::
+~ReplicaController ()
+{
+}
+
+ReplicaController::
+ReplicaController (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Object_var poa_object =
+ orb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ root_poa_ = PortableServer::POA::_narrow (
+ poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Caught exception:");
+ ACE_OS::abort ();
+ }
+ ACE_ENDTRY;
+
+ // Generate member id
+ ACE_Utils::UUID uuid;
+ ACE_Utils::UUID_GENERATOR::instance ()->init ();
+ ACE_Utils::UUID_GENERATOR::instance ()->generateUUID (uuid);
+
+ ACE_INET_Addr address (10000, "239.255.0.1");
+
+ ACE_DEBUG ((LM_DEBUG, "Becoming a member with id %s\n",
+ uuid.to_string ()->c_str ()));
+
+ ACE_AUTO_PTR_RESET (group_, new ACE_TMCast::Group (address, uuid.to_string ()->c_str ()), ACE_TMCast::Group);
+
+ int r = ACE_Thread_Manager::instance ()->spawn (
+ &ReplicaController::listener_thunk, this);
+
+ if (r < 0)
+ {
+ orb_->shutdown (0);
+ }
+}
+
+void ReplicaController::
+listener ()
+{
+ try
+ {
+ for (char buffer[1024];;)
+ {
+ size_t n = group_->recv (buffer, sizeof (buffer));
+
+ ACE_HEX_DUMP ((LM_DEBUG, buffer, n));
+
+ TAO_InputCDR cdr (buffer, n);
+
+ CORBA::OctetSeq object_id;
+ PortableInterceptor::AdapterName adapter_name;
+ CORBA::String_var client_id;
+ CORBA::Long retention_id;
+ CORBA::OctetSeq reply;
+ CORBA::Any state;
+
+ cdr >> object_id;
+ cdr >> adapter_name;
+ cdr >> client_id.out ();
+ cdr >> retention_id;
+ cdr >> reply;
+ cdr >> state;
+
+ if (!cdr.good_bit ())
+ {
+ ACE_DEBUG ((LM_DEBUG, "CDR failed\n"));
+ //@@ what to do?
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Received log for %s with rid %i\n",
+ client_id.in (),
+ retention_id));
+
+
+ RecordId rid (client_id.in (), retention_id);
+
+ CORBA::OctetSeq_var tmp (new CORBA::OctetSeq (reply));
+ log_.insert (rid, tmp);
+
+ // Update state.
+ CORBA::TypeCode_var tc = state.type ();
+
+ if (tc->kind () != CORBA::tk_null)
+ {
+ PortableServer::POA_var poa = resolve_poa (adapter_name);
+
+ PortableServer::ServantBase_var servant =
+ poa->id_to_servant (object_id);
+
+ Checkpointable* target =
+ dynamic_cast<Checkpointable*> (servant.in ());
+
+ if (target) target->set_state (state);
+ }
+ }
+ }
+ catch (ACE_TMCast::Group::Failed const&)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Group failure. Perhaps, I am alone in the group.\n"));
+ }
+ catch (ACE_TMCast::Group::InsufficienSpace const&)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Group::InsufficienSpace\n"));
+ }
+
+ orb_->shutdown (0);
+}
+
+PortableServer::POA_ptr ReplicaController::
+resolve_poa (PortableInterceptor::AdapterName const&)
+{
+ //@@ Assume for now it's a root poa.
+ return PortableServer::POA::_duplicate (root_poa_.in ());
+}
+
+
+ACE_THR_FUNC_RETURN ReplicaController::
+listener_thunk (void* p)
+{
+ ReplicaController* obj = reinterpret_cast<ReplicaController*> (p);
+ obj->listener();
+ return 0;
+}
+
+namespace
+{
+ FT::FTRequestServiceContext*
+ extract_context (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException));
+}
+
+#if TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1
+void
+ReplicaController::tao_ft_interception_point (
+ PortableInterceptor::ServerRequestInfo_ptr ri,
+ CORBA::OctetSeq_out ocs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ FT::FTRequestServiceContext_var ftr (
+ extract_context (ri ACE_ENV_ARG_PARAMETER));
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Received request from %s with rid %i\n",
+ ftr->client_id.in (),
+ ftr->retention_id));
+
+ // Check if this request is eligible for replay.
+
+ RecordId rid (ftr->client_id.in (), ftr->retention_id);
+
+ if (log_.contains (rid))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Replaying reply for %s with rid %i\n",
+ ftr->client_id.in (),
+ ftr->retention_id));
+
+ CORBA::OctetSeq_var copy (log_.lookup (rid)); // make a copy
+
+ ocs = copy._retn ();
+ }
+
+ return;
+}
+
+#endif /*TAO_HAS_EXTENDED_FT_INTERCEPTORS*/
+
+void
+ReplicaController::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ FT::FTRequestServiceContext_var ftr (
+ extract_context (ri ACE_ENV_ARG_PARAMETER));
+
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Sending reply for %s with rid %i\n",
+ ftr->client_id.in (),
+ ftr->retention_id));
+
+
+ // Prepare reply for logging.
+
+ CORBA::Any_var result =
+ ri->result (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_OutputCDR cdr;
+ result->impl ()->marshal_value (cdr);
+
+ Dynamic::ParameterList_var pl =
+ ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong len = pl->length ();
+
+ for (CORBA::ULong index = 0; index != len ; ++index)
+ {
+ //@@ No chance for PARAM_OUT
+ if ((*pl)[index].mode == CORBA::PARAM_INOUT)
+ {
+ (*pl)[index].argument.impl ()->marshal_value (cdr);
+ }
+ }
+
+ CORBA::OctetSeq_var reply;
+
+ ACE_NEW (reply.out (), CORBA::OctetSeq (cdr.total_length ()));
+
+ reply->length (cdr.total_length ());
+
+ CORBA::Octet* buf = reply->get_buffer ();
+
+ // @@ What if this throws an exception?? We don't have any way to
+ // check whether this succeeded
+ for (ACE_Message_Block const* mb = cdr.begin ();
+ mb != 0;
+ mb = mb->cont ())
+ {
+ ACE_OS::memcpy (buf, mb->rd_ptr (), mb->length ());
+ buf += mb->length ();
+ }
+
+ // Logging the reply and state update.
+ //
+
+ // First send message to members.
+ //
+ {
+ // Extract state update.
+
+ CORBA::OctetSeq_var oid = ri->object_id ();
+ PortableInterceptor::AdapterName_var an = ri->adapter_name ();
+
+ CORBA::Any_var state = ri->get_slot (state_slot_id ());
+
+ CORBA::TypeCode_var tc = state->type ();
+
+ if (tc->kind () == CORBA::tk_null)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Slot update is void\n"));
+
+ PortableServer::POA_var poa = resolve_poa (an.in ());
+
+ PortableServer::ServantBase_var servant =
+ poa->id_to_servant (oid.in ());
+
+ Checkpointable* target =
+ dynamic_cast<Checkpointable*> (servant.in ());
+
+ if (target)
+ {
+ CORBA::Any_var tmp = target->get_state ();
+
+ if (tmp.ptr () != 0) state = tmp._retn ();
+ }
+ }
+
+ TAO_OutputCDR cdr;
+
+ cdr << oid.in ();
+ cdr << an.in ();
+ cdr << ftr->client_id.in ();
+ cdr << ftr->retention_id;
+ cdr << reply.in ();
+ cdr << state.in ();
+
+ size_t size = cdr.total_length ();
+
+ CORBA::OctetSeq_var msg;
+
+ ACE_NEW (msg.out (), CORBA::OctetSeq (size));
+
+ msg->length (size);
+
+ {
+ CORBA::Octet* buf = msg->get_buffer ();
+
+ for (ACE_Message_Block const* mb = cdr.begin ();
+ mb != 0;
+ mb = mb->cont ())
+ {
+ ACE_OS::memcpy (buf, mb->rd_ptr (), mb->length ());
+ buf += mb->length ();
+ }
+ }
+
+ CORBA::Octet* buf = msg->get_buffer ();
+
+ // Crash point 1.
+ //
+ if (crash_point == 1 && ftr->retention_id > 2) exit (1);
+
+ try
+ {
+ while (true)
+ {
+ try
+ {
+ group_->send (buf, size);
+ ACE_DEBUG ((LM_DEBUG, "Sent log record of length %i\n", size));
+ break;
+ }
+ catch (ACE_TMCast::Group::Aborted const&)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Retrying to send log record.\n"));
+ }
+ }
+ }
+ catch (ACE_TMCast::Group::Failed const&)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Group failure. Perhaps, I am alone in the group.\n"));
+ }
+ }
+
+
+ // Now perform local logging.
+ //
+ RecordId rid (ftr->client_id.in (), ftr->retention_id);
+
+ // This is slow but eh-safe ;-).
+ //
+ log_.insert (rid, reply);
+
+
+ // Crash point 2.
+ //
+ if (crash_point == 2 && ftr->retention_id > 2) exit (1);
+}
+
+
+namespace
+{
+ FT::FTRequestServiceContext*
+ extract_context (PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ IOP::ServiceContext_var svc =
+ ri->get_request_service_context (IOP::FT_REQUEST
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ 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)
+ {
+ //@@ what to throw?
+ ACE_THROW (CORBA::BAD_CONTEXT ());
+ }
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ // Funny, the following two lines should normally translate
+ // just to one ctor call. But because we have to use this
+ // ACE_NEW macro hackery we have a default ctor call plus
+ // assignment operator call. Yet another example how the
+ // majority is being penalized by some broken platforms.
+ //
+ FT::FTRequestServiceContext_var req;
+
+ //@@ completed status maybe wrong
+ //
+ ACE_NEW_THROW_EX (req,
+ FT::FTRequestServiceContext,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+
+ cdr >> *req;
+
+ if (!cdr.good_bit ())
+ {
+ //@@ what to throw?
+ ACE_THROW (CORBA::UNKNOWN ());
+ }
+
+ return req._retn ();
+ }
+}
+
+
+char*
+ReplicaController::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("ReplicaController");
+}
+
+void
+ReplicaController::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+ReplicaController::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+ReplicaController::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ReplicaController::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+
+}
+
+void
+ReplicaController::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ReplicaController.h b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ReplicaController.h
new file mode 100644
index 00000000000..6c7bcadb647
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ReplicaController.h
@@ -0,0 +1,138 @@
+// file : RolyPoly/ReplicaController.h
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef REPLICA_CONTROLLER_H
+#define REPLICA_CONTROLLER_H
+
+#include "ace/TMCast/GroupFwd.hpp"
+
+#include "tao/LocalObject.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI_Server/PI_Server.h"
+#include "tao/PortableServer/PortableServer.h"
+
+#include "Log.h"
+
+// State management
+//
+//
+
+PortableInterceptor::SlotId
+state_slot_id ();
+
+void
+state_slot_id (PortableInterceptor::SlotId slot_id);
+
+// ReplicaController
+//
+//
+
+class ReplicaController
+ : public virtual PortableInterceptor::ServerRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+ virtual
+ ~ReplicaController ();
+
+ ReplicaController (CORBA::ORB_ptr orb);
+
+public:
+ 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));
+
+#if TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1
+ virtual void
+ tao_ft_interception_point (
+ PortableInterceptor::ServerRequestInfo_ptr ri,
+ CORBA::OctetSeq_out ocs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+#endif /*TAO_HAS_EXTENDED_FT_INTERCEPTORS*/
+
+ 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:
+ static ACE_THR_FUNC_RETURN
+ listener_thunk (void* p);
+
+ void
+ listener ();
+
+ PortableServer::POA_ptr
+ resolve_poa (PortableInterceptor::AdapterName const& name);
+
+private:
+
+ class RecordId
+ {
+ public:
+ RecordId (char const* client_id, CORBA::Long retention_id)
+ : client_id_ (CORBA::string_dup (client_id)),
+ retention_id_ (retention_id)
+ {
+ }
+
+ friend bool
+ operator< (RecordId const& a, RecordId const& b)
+ {
+ int r (ACE_OS::strcmp (a.client_id_.in (), b.client_id_.in ()));
+
+ return (r < 0) || (r == 0 && a.retention_id_ < b.retention_id_);
+ }
+
+ private:
+ CORBA::String_var client_id_;
+ CORBA::Long retention_id_;
+ };
+
+ typedef
+ Log<RecordId, CORBA::OctetSeq_var>
+ Log_;
+
+ Log_ log_;
+ CORBA::ORB_var orb_;
+ PortableServer::POA_var root_poa_;
+ auto_ptr<ACE_TMCast::Group> group_;
+};
+
+#endif /* REPLICA_CONTROLLER_H */
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly.idl b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly.idl
new file mode 100644
index 00000000000..7ab87e6d98d
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly.idl
@@ -0,0 +1,15 @@
+// file : RolyPoly/RolyPoly.idl
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+interface RolyPoly
+{
+ exception E
+ {
+ string s;
+ };
+
+ short number (inout string m) raises (E);
+
+ oneway void shutdown ();
+};
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly.mpc b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly.mpc
new file mode 100644
index 00000000000..dea14f4a82c
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly.mpc
@@ -0,0 +1,32 @@
+// $Id$
+project(*idl): taoidldefaults {
+ IDL_Files {
+ RolyPoly.idl
+ }
+ custom_only = 1
+}
+
+project(*Server): orbsvcsexe, fault_tolerance, tmcast, pi_server, interceptors {
+ after += *idl
+ Source_Files {
+ RolyPolyS.cpp
+ RolyPolyC.cpp
+ RolyPoly_i.cpp
+ ORB_Initializer.cpp
+ ReplicaController.cpp
+ CrashPoint.cpp
+ server.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Client): taoclient, fault_tolerance, exceptions {
+ after += *idl
+ Source_Files {
+ RolyPolyC.cpp
+ client.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly_i.cpp b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly_i.cpp
new file mode 100644
index 00000000000..d3c4a92cde6
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly_i.cpp
@@ -0,0 +1,72 @@
+// file : RolyPoly/RolyPoly_i.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "RolyPoly_i.h"
+#include "StateUpdate.h"
+#include "tao/AnyTypeCode/Any.h"
+
+RolyPoly_i::RolyPoly_i (CORBA::ORB_ptr orb)
+ : number_ (0)
+ , orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+RolyPoly_i::~RolyPoly_i (void)
+{
+}
+
+CORBA::Any* RolyPoly_i::
+get_state ()
+{
+ /*
+ CORBA::Any_var state (new CORBA::Any);
+
+ *state <<= this->number_;
+
+ return state._retn ();
+ */
+
+ return 0;
+}
+
+
+void RolyPoly_i::
+set_state (CORBA::Any const& state)
+{
+ state >>= this->number_;
+}
+
+
+CORBA::Short
+RolyPoly_i::number (char *&str
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException, RolyPoly::E))
+{
+ CORBA::string_free (str);
+
+ str = CORBA::string_dup ("Greetings from RolyPoly.");
+
+ ++this->number_;
+
+
+ // Preppare state update.
+ //
+
+ CORBA::Any a;
+
+ a <<= this->number_;
+
+ associate_state (orb_.in (), a);
+
+ return this->number_;
+}
+
+void
+RolyPoly_i::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG, "Server is shutting down.\n"));
+
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly_i.h b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly_i.h
new file mode 100644
index 00000000000..86098f033e9
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/RolyPoly_i.h
@@ -0,0 +1,44 @@
+// file : RolyPoly/RolyPoly_i.h
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef ROLY_POLY_I_H
+#define ROLY_POLY_I_H
+
+#include "RolyPolyS.h"
+#include "StateUpdate.h"
+
+class RolyPoly_i : public virtual POA_RolyPoly,
+ public virtual Checkpointable
+{
+public:
+ RolyPoly_i (CORBA::ORB_ptr orb);
+
+ ~RolyPoly_i (void);
+
+ // Checkpointable
+ //
+ virtual CORBA::Any*
+ get_state ();
+
+ virtual void
+ set_state (CORBA::Any const& state);
+
+
+ // RolyPoly
+ //
+ virtual CORBA::Short
+ number (char *&s ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, RolyPoly::E));
+
+ virtual void
+ shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ CORBA::Short number_;
+
+ CORBA::ORB_var orb_;
+};
+
+#endif /* ROLY_POLY_I_H */
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/StateUpdate.h b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/StateUpdate.h
new file mode 100644
index 00000000000..2d9aec49fe8
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/StateUpdate.h
@@ -0,0 +1,27 @@
+// file : RolyPoly/StateUpdate.h
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef STATE_UPDATE_H
+#define STATE_UPDATE_H
+
+#include "tao/corba.h"
+
+class Checkpointable
+{
+public:
+ virtual
+ ~Checkpointable ();
+
+ virtual CORBA::Any*
+ get_state ();
+
+ static void
+ associate_state (CORBA::ORB_ptr orb, CORBA::Any const& state);
+
+ virtual void
+ set_state (CORBA::Any const& state) = 0;
+};
+
+
+#endif // STATE_UPDATE_H
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/client.cpp b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/client.cpp
new file mode 100644
index 00000000000..af43025ffa2
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/client.cpp
@@ -0,0 +1,239 @@
+// file : RolyPoly/client.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/SString.h"
+#include "ace/Unbounded_Queue.h"
+
+// IOR manipulation.
+#include "tao/IORManipulation/IORManip_Loader.h"
+#include "orbsvcs/FaultTolerance/FT_Service_Activate.h"
+#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h"
+
+#include "RolyPolyC.h"
+
+typedef ACE_Unbounded_Queue<ACE_SString> IOR_QUEUE;
+
+IOR_QUEUE ior_strs;
+
+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':
+ {
+ ACE_SString ior(get_opts.opt_arg ());
+ if (ior_strs.enqueue_tail (ior) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to enqueue IOR: %s\n",
+ ior.c_str ()),
+ -1);
+ else
+ ACE_DEBUG ((LM_DEBUG, "Enqueued IOR: %s\n", ior.c_str ()));
+ }
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-k IOR ...\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;
+
+ if (ior_strs.is_empty ())
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "No IOR provided\n"),
+ -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;
+
+ if (ior_strs.size() > 1)
+ {
+ // merge case
+
+ ACE_DEBUG ((LM_DEBUG, "We got %d iors\n", ior_strs.size ()));
+ IOR_QUEUE::ITERATOR ior_go = ior_strs.begin ();
+ ACE_SString *pior = 0;
+ while (ior_go.next (pior) != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "IOR: %s\n", pior->c_str ()));
+ ior_go.advance ();
+ }
+
+
+ IOR_QUEUE::ITERATOR ior_iter = ior_strs.begin ();
+
+ ACE_SString *ior = 0;
+ ior_iter.next (ior);
+
+ CORBA::Object_var object_primary;
+
+ object_primary =
+ orb->string_to_object (ior->c_str() ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (-1);
+
+ // Get an object reference for the ORBs IORManipultion object!
+ CORBA::Object_ptr IORM =
+ orb->resolve_initial_references (TAO_OBJID_IORMANIPULATION,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ TAO_IOP::TAO_IOR_Manipulation_ptr iorm =
+ TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+
+ // Create the list
+ TAO_IOP::TAO_IOR_Manipulation::IORList iors (ior_strs.size ());
+ iors.length(ior_strs.size ());
+ size_t cntr = 0;
+ iors [cntr] = CORBA::Object::_duplicate (object_primary.in ());
+
+ while (ior_iter.advance ())
+ {
+ ++cntr;
+ ior_iter.next (ior);
+ ACE_DEBUG ((LM_DEBUG, "IOR%d: %s\n",cntr, ior->c_str ()));
+ iors [cntr] =
+ orb->string_to_object (ior->c_str() ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (-1);
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "Prepare to merge IORs.\n"));
+ // Create a merged set 1;
+ object = iorm->merge_iors (iors ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (-1);
+
+
+ FT::TagFTGroupTaggedComponent ft_tag_component;
+
+ // Property values
+
+ // Major and Minor revision numbers
+ ft_tag_component.object_group_ref_version = 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,
+ object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ retval = iorm->set_primary (&iogr_prop,
+ object_primary.in (),
+ object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ }
+ else
+ {
+ ACE_SString *ior = 0;
+ if (ior_strs.get (ior) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to extract the only IOR string\n"),
+ -1);
+ object = orb->string_to_object (ior->c_str() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ RolyPoly_var server =
+ RolyPoly::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Object reference is nil\n"),
+ 1);
+ }
+
+ CORBA::Short number = 0;
+
+
+ for (int i = 1; i < 500; ++i)
+ {
+ CORBA::String_var str;
+
+ try
+ {
+ number = server->number (str.inout ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+ catch (RolyPoly::E const& e)
+ {
+ ACE_DEBUG ((LM_INFO,
+ "client: received exception %s .\n",
+ e.s.in ()));
+ continue;
+ }
+
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_INFO,
+ "client: received %d\n",
+ number));
+ ACE_OS::sleep (1);
+ }
+
+ server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return status;
+}
diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/server.cpp b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/server.cpp
new file mode 100644
index 00000000000..65c0587a9b7
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/server.cpp
@@ -0,0 +1,140 @@
+// file : RolyPoly/server.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+
+#include "RolyPoly_i.h"
+#include "CrashPoint.h"
+#include "ORB_Initializer.h"
+#include "tao/ORBInitializer_Registry.h"
+
+const char *ior_file = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:c:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_file = get_opts.opt_arg ();
+ break;
+ case 'c':
+ crash_point = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-o <IOR> "
+ "-c <CrashPoint>\n",
+ argv[0]),
+ -1);
+ }
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ if (::parse_args (argc, argv) != 0) return -1;
+
+ ORB_Initializer *temp_initializer = 0;
+ ACE_NEW_RETURN (temp_initializer,
+ ORB_Initializer,
+ -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;
+
+ RolyPoly_i* roly_poly_impl;
+
+ ACE_NEW_RETURN (roly_poly_impl,
+ RolyPoly_i (orb.in ()),
+ 1);
+
+ PortableServer::ServantBase_var owner_transfer (roly_poly_impl);
+
+ RolyPoly_var t =
+ roly_poly_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::PolicyList policies; // Empty policy list.
+
+ CORBA::String_var ior =
+ orb->object_to_string (t.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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);
+
+ ACE_DEBUG ((LM_DEBUG, "Server is ready\n"));
+
+ // 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;
+}
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/Advanced.mpc b/TAO/orbsvcs/examples/ImR/Advanced/Advanced.mpc
new file mode 100644
index 00000000000..11a89093d9b
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/Advanced.mpc
@@ -0,0 +1,54 @@
+//$Id$
+project(*IDL): taoidldefaults {
+ IDL_Files {
+ Manager.idl
+ Messenger.idl
+ }
+ custom_only = 1
+}
+
+project(*Manager): orbsvcsexe, portableserver, exceptions {
+ after += *IDL
+ Source_Files {
+ manager_main.cpp
+ Manager_i.cpp
+ ManagerS.cpp
+ ManagerC.cpp
+ }
+ Documentation_Files {
+ Advanced.mpc
+ run_test.pl
+ README
+ drivers/*
+ }
+ IDL_Files {
+ }
+}
+
+project(*Server): orbsvcsexe, portableserver, iortable, exceptions {
+ after += *IDL
+ Source_Files {
+ server_main.cpp
+ TestServer.cpp
+ ManagerC.cpp
+ MessengerS.cpp
+ MessengerC.cpp
+ Messenger_i.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Client): orbsvcsexe, exceptions {
+ after += *IDL
+ Source_Files {
+ client_main.cpp
+ TestClient.cpp
+ MessengerC.cpp
+ }
+ IDL_Files {
+ }
+ verbatim(gnuace, macros) {
+ VDIR := .obj/Client/
+ }
+}
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/Makefile.am b/TAO/orbsvcs/examples/ImR/Advanced/Makefile.am
new file mode 100644
index 00000000000..967ebae0a58
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/Makefile.am
@@ -0,0 +1,163 @@
+## 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.Advanced_IDL.am
+
+BUILT_SOURCES = \
+ ManagerC.cpp \
+ ManagerC.h \
+ ManagerC.inl \
+ ManagerS.cpp \
+ ManagerS.h \
+ ManagerS.inl
+
+CLEANFILES = \
+ Manager-stamp \
+ ManagerC.cpp \
+ ManagerC.h \
+ ManagerC.inl \
+ ManagerS.cpp \
+ ManagerS.h \
+ ManagerS.inl
+
+ManagerC.cpp ManagerC.h ManagerC.inl ManagerS.cpp ManagerS.h ManagerS.inl: Manager-stamp
+
+Manager-stamp: $(srcdir)/Manager.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Manager.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ MessengerC.cpp \
+ MessengerC.h \
+ MessengerC.inl \
+ MessengerS.cpp \
+ MessengerS.h \
+ MessengerS.inl
+
+CLEANFILES += \
+ Messenger-stamp \
+ MessengerC.cpp \
+ MessengerC.h \
+ MessengerC.inl \
+ MessengerS.cpp \
+ MessengerS.h \
+ MessengerS.inl
+
+MessengerC.cpp MessengerC.h MessengerC.inl MessengerS.cpp MessengerS.h MessengerS.inl: Messenger-stamp
+
+Messenger-stamp: $(srcdir)/Messenger.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Messenger.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ Manager.idl \
+ Messenger.idl
+
+## Makefile.Advanced_Client.am
+
+if BUILD_EXCEPTIONS
+
+noinst_PROGRAMS += client_main
+
+client_main_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+client_main_SOURCES = \
+ MessengerC.cpp \
+ TestClient.cpp \
+ client_main.cpp \
+ TestClient.h
+
+client_main_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif BUILD_EXCEPTIONS
+
+## Makefile.Advanced_Manager.am
+
+if BUILD_EXCEPTIONS
+
+noinst_PROGRAMS += manager_main
+
+manager_main_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+manager_main_SOURCES = \
+ ManagerC.cpp \
+ ManagerS.cpp \
+ Manager_i.cpp \
+ manager_main.cpp \
+ Manager_i.h
+
+manager_main_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif BUILD_EXCEPTIONS
+
+## Makefile.Advanced_Server.am
+
+if BUILD_EXCEPTIONS
+
+noinst_PROGRAMS += server_main
+
+server_main_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+server_main_SOURCES = \
+ ManagerC.cpp \
+ MessengerC.cpp \
+ MessengerS.cpp \
+ Messenger_i.cpp \
+ TestServer.cpp \
+ server_main.cpp \
+ Messenger_i.h \
+ TestServer.h
+
+server_main_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_EXCEPTIONS
+
+## 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/examples/ImR/Advanced/Manager.idl b/TAO/orbsvcs/examples/ImR/Advanced/Manager.idl
new file mode 100644
index 00000000000..3b01e2ff7e3
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/Manager.idl
@@ -0,0 +1,9 @@
+//$Id$
+interface Manager
+{
+ long registerServer();
+
+ void startRetry(in long count);
+
+ long endRetry(); // returns unused attempts
+};
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/Manager_i.cpp b/TAO/orbsvcs/examples/ImR/Advanced/Manager_i.cpp
new file mode 100644
index 00000000000..7a03c0c7de4
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/Manager_i.cpp
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+//
+// $Id$
+#include "Manager_i.h"
+
+Manager_i::Manager_i (long retryCount)
+: server_instance_(0)
+, retry_count_(retryCount)
+, retry_attempt_(0)
+{
+}
+
+Manager_i::~Manager_i (void)
+{
+}
+
+CORBA::Long Manager_i::registerServer ()
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (retry_attempt_ < retry_count_)
+ {
+ ++retry_attempt_;
+ return -1;
+ }
+ return ++server_instance_;
+}
+
+void Manager_i::startRetry (CORBA::Long count)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ retry_count_ = count;
+ retry_attempt_ = 0;
+}
+
+CORBA::Long Manager_i::endRetry ()
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return retry_count_ - retry_attempt_;
+}
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/Manager_i.h b/TAO/orbsvcs/examples/ImR/Advanced/Manager_i.h
new file mode 100644
index 00000000000..5c45021ce6e
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/Manager_i.h
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//
+// $Id$
+#ifndef MANAGERI_H_
+#define MANAGERI_H_
+
+#include "ManagerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Manager_i
+ : public virtual POA_Manager
+{
+public:
+ Manager_i (long retryCount);
+
+ virtual ~Manager_i (void);
+
+ virtual CORBA::Long registerServer ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void startRetry (CORBA::Long count)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Long endRetry ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ long server_instance_;
+ long retry_count_;
+ long retry_attempt_;
+};
+
+
+#endif /* MANAGERI_H_ */
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/Messenger.idl b/TAO/orbsvcs/examples/ImR/Advanced/Messenger.idl
new file mode 100644
index 00000000000..421512c8587
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/Messenger.idl
@@ -0,0 +1,6 @@
+//$Id$
+interface Messenger
+{
+ long send_message(in long thread, in long iter, in long obj, in long req);
+ oneway void shutdownOrb();
+};
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/Messenger_i.cpp b/TAO/orbsvcs/examples/ImR/Advanced/Messenger_i.cpp
new file mode 100644
index 00000000000..235c97a6b6a
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/Messenger_i.cpp
@@ -0,0 +1,41 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "Messenger_i.h"
+
+#include <ace/streams.h>
+
+Messenger_i::Messenger_i (CORBA::ORB_ptr orb, long instance)
+: instance_(instance)
+, orb_(CORBA::ORB::_duplicate(orb))
+, isHit_(false)
+{
+}
+
+Messenger_i::~Messenger_i (void)
+{
+}
+
+bool Messenger_i::acknowledgeHit()
+{
+ bool isHit = isHit_;
+ isHit_ = false;
+ return isHit;
+}
+
+CORBA::Long Messenger_i::send_message (CORBA::Long thread,
+ CORBA::Long iter,
+ CORBA::Long obj,
+ CORBA::Long req) ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ cout << "* Invoked: (" << instance_ << "." << thread << "." << iter
+ << "." << obj << "." << req << ")" << endl;
+ isHit_ = true;
+ return instance_;
+}
+
+void Messenger_i::shutdownOrb () ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ orb_->shutdown(0);
+}
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/Messenger_i.h b/TAO/orbsvcs/examples/ImR/Advanced/Messenger_i.h
new file mode 100644
index 00000000000..07730db0cbd
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/Messenger_i.h
@@ -0,0 +1,41 @@
+// -*- C++ -*-
+//
+// $Id$
+#ifndef MESSENGERI_H_
+#define MESSENGERI_H_
+
+#include "MessengerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Messenger_i
+ : public virtual POA_Messenger
+{
+public:
+ Messenger_i (CORBA::ORB_ptr orb, long instance);
+
+ virtual ~Messenger_i (void);
+
+ virtual
+ CORBA::Long send_message (
+ ::CORBA::Long thread,
+ ::CORBA::Long iter,
+ ::CORBA::Long obj,
+ ::CORBA::Long req
+ ) ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void shutdownOrb ()
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ bool acknowledgeHit();
+
+private:
+ long instance_;
+ CORBA::ORB_var orb_;
+ bool isHit_;
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/README b/TAO/orbsvcs/examples/ImR/Advanced/README
new file mode 100644
index 00000000000..08a1a004523
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/README
@@ -0,0 +1,37 @@
+This example tests several uses of the Implementation Repository.
+
+How to Run
+----------
+
+Create driver files:
+------------------------------------------------------
+Driver files are stored in the drivers directory.
+Each file contains a set of parameters for each execution of the
+test.
+
+Each line item in the file has one of the follow forms.
+Empty lines are ignored.
+
+ # <Comment>
+ begin
+ <param>=<value>
+ do <command>
+ - <Disabled Line>
+ -- (Begin/End Disabled Block)
+
+* Comment lines are printed to standard-out.
+* 'begin' resets all parameters to default and clears temporary files.
+* Parameter assignments override the default values.
+* 'do' executes the specified command
+ - There are three predefined use-case commands
+ * use_invocation
+ * use_persistence
+ * use_environment
+ - All methods in run-test can be executed with the do command
+* Disabled lines are ignored
+* The -- designates the begin and end of a block of lines to ignore
+
+Execute the example script
+----------------------------------------------------------------------
+The run_test.pl script reads the driver file and executes each line.
+Simply execute run_test.pl to run all test in the drivers directory.
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/TestClient.cpp b/TAO/orbsvcs/examples/ImR/Advanced/TestClient.cpp
new file mode 100644
index 00000000000..9b2da4d88c8
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/TestClient.cpp
@@ -0,0 +1,258 @@
+//$Id$
+#include "TestClient.h"
+#include "MessengerC.h"
+
+#include "tao/ORB_Constants.h"
+
+#include "ace/OS_NS_time.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_stdlib.h"
+#include "ace/Get_Opt.h"
+
+TestClient::TestClient(CORBA::ORB_ptr orb, int argc, char* argv[])
+: orb_(CORBA::ORB::_duplicate(orb))
+, pauseType_('s')
+, startupPause_(0)
+, threadCount_(0)
+, instance_(0)
+, iterations_(0)
+, requestCount_(0)
+, randomRequests_(false)
+, shutdownOrb_(false)
+, expectHolding_(false)
+, expectNoProfile_(false)
+{
+ parseCommands(argc, argv);
+}
+
+TestClient::~TestClient()
+{
+}
+
+int TestClient::parseCommands(int argc, char* argv[])
+{
+ ACE_Get_Opt get_opts(argc, argv, "s:t:i:r:x:e:z:");
+ int c;
+ while ((c = get_opts()) != -1)
+ {
+ switch (c)
+ {
+ case 's':
+ startupPause_ = ::atoi(get_opts.opt_arg());
+ break;
+
+ case 't':
+ threadCount_ = ::atoi(get_opts.opt_arg());
+ break;
+
+ case 'i':
+ iterations_ = ::atoi(get_opts.opt_arg());
+ break;
+
+ case 'r':
+ {
+ const char* opt = get_opts.opt_arg();
+ if (opt[0] == 'r') { randomRequests_ = true; opt++; }
+ requestCount_ = ::atoi(opt);
+ break;
+ }
+
+ case 'x':
+ {
+ const char* opt = get_opts.opt_arg();
+ shutdownOrb_ = (opt && opt[0] != '0');
+ break;
+ }
+
+ case 'e':
+ {
+ const char* opt = get_opts.opt_arg();
+ while (opt && *opt != '\0')
+ {
+ if (*opt == 'h') expectHolding_ = true;
+ else if (*opt == 'n') expectNoProfile_ = true;
+ opt++;
+ }
+ break;
+ }
+
+ case 'z':
+ pauseType_ = get_opts.opt_arg()[0];
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN((LM_ERROR,
+ "usage: %s\n"
+ "\t-s <startup pause in milliseconds>\n"
+ "\t-t <number of threads>\n"
+ "\t-i <number of iterations per thread>\n"
+ "\t-r <r><number of requests per string_to_object>\n"
+ "\t-x 'shutdown server orb at end of a string_to_object'\n"
+ "\t-e <h><n> 'catch holding or no profile exceptions'\n"
+ "\n",
+ argv[0]),
+ -1);
+ }
+ }
+ return 0;
+}
+
+void TestClient::pause(int milliseconds)
+{
+ if (milliseconds > 0)
+ {
+ if (pauseType_ == 's')
+ {
+ ACE_OS::sleep(ACE_Time_Value(0, milliseconds * 1000));
+ }
+ else if (pauseType_ == 'r')
+ {
+ ACE_Time_Value tv(0, milliseconds * 1000);
+ orb_->run(tv);
+ }
+ }
+}
+
+void TestClient::run()
+{
+ ACE_DEBUG((LM_DEBUG, "Starting Client.\n"));
+ pause(startupPause_);
+ ACE_DEBUG((LM_DEBUG, "* Client started.\n"));
+
+ buildIORList();
+
+ if (this->activate(THR_NEW_LWP, threadCount_) == -1)
+ {
+ ACE_ERROR((LM_ERROR, "%p\n", "activate failed"));
+ }
+ wait();
+
+ ACE_DEBUG((LM_DEBUG, "* Client ended.\n"));
+
+}
+
+// Read in the stringified object references into an array
+// Warning: The file may contain many separate IORs separated by linefeeds.
+void TestClient::buildIORList()
+{
+ FILE* iorFile = ACE_OS::fopen ("imr_test.ior", "r");
+ if ( iorFile == NULL )
+ ACE_ERROR ((LM_ERROR, "Fail to open imr_test.ior\n"));
+
+ ACE_TString ior;
+ while (getline(iorFile, ior) != EOF )
+ {
+ if (ior.length() > 0)
+ iors_.push_back(ior);
+ else
+ break;
+ }
+}
+
+int TestClient::svc()
+{
+ // Every invocation of svc increates the thread count
+ instance_++;
+ int threadNum = instance_;
+ size_t vec_size = iors_.size();
+
+ ACE_DEBUG((LM_DEBUG, "* Client Thread started (%d.%d.%d.%d)\n",
+ threadNum, iterations_, vec_size, requestCount_));
+
+ int i = 0;
+ size_t objIter = 0;
+ int requestIter = 0;
+
+ ACE_TString currentIOR;
+
+ ACE_OS::srand(ACE_OS::time());
+
+ try
+ {
+ int holdingCount = 0;
+ int noProfileCount = 0;
+
+ // For each iteration
+ for (i = 1; i <= iterations_; i++)
+ {
+ // For each object reference read from file
+ for (objIter = 1; objIter <= vec_size; objIter++)
+ {
+ requestIter = -1;
+ // Get a imr_test_var
+ currentIOR = iors_[objIter - 1];
+ CORBA::Object_var obj = orb_->string_to_object(currentIOR.c_str());
+ if (CORBA::is_nil(obj.in()) == false)
+ {
+ requestIter = 0;
+ Messenger_var test = Messenger::_narrow(obj.in());
+
+ if (CORBA::is_nil(test.in()) == false)
+ {
+ // Calculate the number of requests
+ int newReqCount (randomRequests_ == false ? requestCount_ :
+ (int)((((double)ACE_OS::rand() / (double)RAND_MAX) * (double)(requestCount_ - 1)) + .5) + 1);
+ int serverInstance = 0;
+ // For each request
+ for (requestIter = 1; requestIter <= newReqCount; requestIter++)
+ {
+ try
+ {
+ serverInstance = test->send_message(threadNum, i, objIter, requestIter);
+ }
+ catch (CORBA::SystemException& ex)
+ {
+ // If these exceptions are expected record the number of instances, otherwise rethrow
+ if (expectHolding_ == true && ex.minor() == TAO_POA_HOLDING)
+ {
+ ACE_ERROR((LM_ERROR, "Caught expected holding exception with (%d.%d.%d)\n",
+ threadNum, objIter, requestIter));
+ holdingCount++;
+ }
+ else
+ {
+ throw;
+ }
+ if (expectNoProfile_ == true
+ && ex.minor() == TAO_INVOCATION_SEND_REQUEST_MINOR_CODE)
+ {
+ ACE_ERROR((LM_ERROR, "Caught expected holding exception with (%d.%d.%d)\n",
+ threadNum, objIter, requestIter));
+ noProfileCount++;
+ }
+ else
+ {
+ throw;
+ }
+ } // catch
+ } // for request
+ // We are done with our non-nil narrowed obj ref
+ if (shutdownOrb_ == true) test->shutdownOrb();
+ } // if narrow
+ } // if obj
+ } // for obj
+ } // for iter
+ // Report expected exceptions
+ if (holdingCount > 0)
+ {
+ ACE_DEBUG((LM_DEBUG,"Client thread %d received %d holding error(s).\n",
+ threadNum, holdingCount));
+ }
+
+ if (noProfileCount > 0)
+ {
+ ACE_DEBUG((LM_DEBUG,"Client thread %d received %d no profile error(s).\n",
+ threadNum, noProfileCount));
+ }
+
+ return 0;
+ } // try
+ catch (CORBA::Exception& ex)
+ {
+ ACE_ERROR((LM_ERROR,"CORBA client error with (%d.%d.%d.%d):%s\n",
+ threadNum, i, objIter, requestIter, currentIOR.c_str()));
+ ACE_PRINT_EXCEPTION(ex, "");
+ }
+ return 1;
+}
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/TestClient.h b/TAO/orbsvcs/examples/ImR/Advanced/TestClient.h
new file mode 100644
index 00000000000..237437daa5c
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/TestClient.h
@@ -0,0 +1,38 @@
+//$Id$
+#include "tao/ORB.h"
+
+#include "ace/Task.h"
+
+#include <vector>
+#include <string>
+#include "ace/Capabilities.h"
+
+class TestClient : public ACE_Task_Base, public ACE_Capabilities
+{
+public:
+ TestClient(CORBA::ORB_ptr orb, int argc, char* argv[]);
+
+ virtual ~TestClient();
+
+ void run();
+
+private:
+ int parseCommands(int argc, char* argv[]);
+ void buildIORList();
+ void pause(int milliseconds);
+ virtual int svc();
+
+ CORBA::ORB_var orb_;
+ std::vector<ACE_TString> iors_;
+
+ char pauseType_;
+ int startupPause_;
+ int threadCount_;
+ int instance_;
+ int iterations_;
+ int requestCount_;
+ bool randomRequests_;
+ bool shutdownOrb_;
+ bool expectHolding_;
+ bool expectNoProfile_;
+};
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/TestServer.cpp b/TAO/orbsvcs/examples/ImR/Advanced/TestServer.cpp
new file mode 100644
index 00000000000..0b01378ccf8
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/TestServer.cpp
@@ -0,0 +1,514 @@
+//$Id$
+#include "TestServer.h"
+
+#include "ManagerC.h"
+
+#include "tao/Profile.h"
+#include "tao/Stub.h"
+#include "tao/ORB_Core.h"
+#include "tao/PortableServer/Root_POA.h"
+
+#include "ace/streams.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_ctype.h"
+#include "ace/os_include/os_ctype.h"
+#include "ace/Get_Opt.h"
+
+#include <sstream>
+#include <utility>
+
+using std::string;
+
+// Does this function already exist?
+// Is there a path class?
+
+string normalizePath(const string& dir, char delim = '/', bool toLower = false);
+string getWorkingPath(char delim = '/', bool toLower = false);
+
+string deleteLeaf(const string& dir)
+{
+ string temp = dir;
+ temp.resize(dir.find_last_of("/\\"));
+ return temp;
+}
+
+string getWorkingPath(char delim, bool toLower)
+{
+ char buffer[PATH_MAX + 2];
+ ACE_OS::getcwd(buffer, PATH_MAX);
+ return normalizePath(buffer, delim, toLower);
+}
+
+string normalizePath(const string& dir, char delim, bool toLower)
+{
+ if (dir.empty() == true) return string();
+ char buffer[PATH_MAX + 2];
+
+ string::size_type i = 0;
+
+ for (; ACE_OS::ace_isspace(dir[i]); i++);
+
+ string::size_type begin = i;
+
+ int j = 0;
+ for (; i < dir.size(); i++)
+ {
+ if (dir[i] == '\\' || dir[i] == '/')
+ {
+ // skip redundant
+ if (dir[i + 1] == '\\' || dir[i + 1] == '/')
+ {
+ }
+ // Convert to proper delim
+ else
+ {
+ buffer[j] = delim; j++;
+ }
+ }
+ else if (dir[i] == '.')
+ {
+ // If specifying current, skip
+ if (dir[i + 1] == '\\' || dir[i + 1] == '/' || dir[i + 1] == '\0')
+ {
+ if (i == begin) // relative start
+ {
+ string curDir = getWorkingPath();
+ ACE_OS::strncpy(buffer, curDir.c_str(), sizeof(buffer));
+ j = curDir.length();
+ }
+ else
+ {
+ i += 2;
+ }
+ }
+ // If specifying parent, go back
+ else if (dir[i + 1] == '.')
+ {
+ if (i == begin) // relative start
+ {
+ string curDir = getWorkingPath();
+ ACE_OS::strncpy(buffer, curDir.c_str(), sizeof(buffer));
+ j = curDir.length();
+ }
+ int k = j;
+ for (; buffer[k] != delim; k--);
+ k--;
+ for (; buffer[k] != delim; k--);
+ j = (k + 1);
+ i+=2;
+ }
+ else
+ {
+ if (toLower)
+ buffer[j] = ::tolower(dir[i]);
+ else
+ buffer[j] = dir[i];
+ j++;
+ }
+ }
+ // normal character
+ else
+ {
+ if (toLower)
+ buffer[j] = ::tolower(dir[i]);
+ else
+ buffer[j] = dir[i];
+ j++;
+ }
+ }
+
+ if (buffer[j - 1] == delim) j--;
+ buffer[j] ='\0';
+ return string(buffer);
+}
+
+TestServer::TestServer(CORBA::ORB_ptr orb, int argc, char* argv[])
+: serverID_(1)
+, serverInstanceID_(-1)
+, useIORTable_(false)
+, writeIORFile_(false)
+, retryQuery_(false)
+, pauseType_('s')
+, startupPause_(0)
+, objActivatePause_(0)
+, activatePause_(0)
+, runPause_(0)
+, numPOAS_(0)
+, numObjsPerPOA_(0)
+, useItLoseItSecs_(0)
+, orb_(CORBA::ORB::_duplicate(orb))
+, iorTable_(IORTable::Table::_nil())
+, root_(PortableServer::POA::_nil())
+, mgr_(PortableServer::POAManager::_nil())
+{
+ parseCommands(argc, argv);
+
+ verifyEnvironment();
+
+ // We really do not want the current directory set by the
+ // activator. baseDir_ is where all the operation files are.
+ if (baseDir_.empty() == false)
+ {
+ ACE_OS::chdir(baseDir_.c_str());
+ }
+}
+
+TestServer::~TestServer()
+{
+ root_->destroy(1, 1);
+}
+
+// TestServer::parseCommands
+// Reads params from command line
+//
+int TestServer::parseCommands(int argc, char* argv[])
+{
+ ACE_Get_Opt get_opts(argc, argv, "w:e:d:t:o:s:c:a:r:p:n:x:z:q:b:");
+ int c;
+ while ((c = get_opts()) != -1)
+ {
+ switch (c)
+ {
+ case 'w':
+ expectedDir_ = normalizePath(get_opts.opt_arg());
+ break;
+
+ case 'e':
+ {
+ string name = get_opts.opt_arg();
+ string::size_type i = name.find_first_of("=");
+ string value = name.substr(i + 1, name.length() - 1);
+ name.resize(i);
+ expectedEnv_.push_back(std::make_pair(name, value));
+ break;
+ }
+
+ case 'd':
+ serverID_ = ACE_OS::atoi(get_opts.opt_arg());
+ break;
+
+ case 't':
+ {
+ const char* opt = get_opts.opt_arg();
+ useIORTable_ = (opt && opt[0] != '0');
+ break;
+ }
+
+ case 'q':
+ {
+ const char* opt = get_opts.opt_arg();
+ retryQuery_ = (opt && opt[0] != '0');
+ break;
+ }
+
+ case 'o':
+ {
+ const char* opt = get_opts.opt_arg();
+ writeIORFile_ = (opt && opt[0] != '0');
+ break;
+ }
+
+ case 's':
+ startupPause_ = ACE_OS::atoi(get_opts.opt_arg());
+ break;
+
+ case 'c':
+ objActivatePause_ = ACE_OS::atoi(get_opts.opt_arg());
+ break;
+
+ case 'a':
+ activatePause_ = ACE_OS::atoi(get_opts.opt_arg());
+ break;
+
+ case 'r':
+ runPause_ = ACE_OS::atoi(get_opts.opt_arg());
+ break;
+
+ case 'p':
+ numPOAS_ = ACE_OS::atoi(get_opts.opt_arg());
+ break;
+
+ case 'n':
+ numObjsPerPOA_ = ACE_OS::atoi(get_opts.opt_arg());
+ break;
+
+ case 'x':
+ useItLoseItSecs_ = ACE_OS::atoi(get_opts.opt_arg());
+ break;
+
+ case 'z':
+ pauseType_ = get_opts.opt_arg()[0];
+ break;
+
+ case 'b':
+ baseDir_ = get_opts.opt_arg();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN((LM_ERROR,
+ "usage: %s\n"
+ "\t-d <startup pause in milliseconds>\n"
+ "\t-t 'use IOR Table'\n"
+ "\t-o 'write the IOR file'\n"
+ "\t-s <startup pause in milliseconds>\n"
+ "\t-a <activation pause in milliseconds>\n"
+ "\t-r <run pause in milliseconds>\n"
+ "\t-p <number of POAS>\n"
+ "\t-n <number of objects per POA>\n"
+ "\t-x <number of seconds from last hit till exit>\n"
+ "\t-e <expected_env_var_name>=<value> 'can be repeated'\n"
+ "\t-w <expected_working_directory>\n"
+ "\n",
+ argv[0]),
+ -1);
+ }
+ }
+ return 0;
+}
+
+// TestServer::verifyEnvironment
+// Checks to see if the activator setup requested env vars and current directory
+//
+bool TestServer::verifyEnvironment() const
+{
+ bool err = false;
+
+ // Check paths
+ string currentDir = getWorkingPath();
+ if (expectedDir_.empty() == false && currentDir != expectedDir_)
+ {
+ ACE_DEBUG((LM_DEBUG, "Error: directory paths (%s,%s) do not match.\n",
+ currentDir.c_str(), expectedDir_.c_str()));
+ err |= true;
+ }
+
+ // Check env vars
+ for (string::size_type i = 0; i < expectedEnv_.size(); i++)
+ {
+ const char* realValue = ACE_OS::getenv(expectedEnv_[i].first.c_str()) ;
+ if (realValue == NULL)
+ {
+ ACE_DEBUG((LM_DEBUG, "Error, env variable '%s' not found\n",
+ expectedEnv_[i].first.c_str()));
+ err |= true;
+ }
+ else if (expectedEnv_[i].second != realValue)
+ {
+ ACE_DEBUG((LM_DEBUG, "Error, env variable '%s' values (%s,%s) do not match.\n",
+ expectedEnv_[i].first.c_str(), realValue, expectedEnv_[i].second.c_str()));
+ err |= true;
+ }
+ }
+
+ return (err ? 1 : 0);
+}
+
+// TestServer::pause
+// Pause processing by either sleep or timed run-loop
+//
+void TestServer::pause(int milliseconds)
+{
+ if (milliseconds > 0)
+ {
+ if (pauseType_ == 's')
+ {
+ ACE_OS::sleep(ACE_Time_Value(0, milliseconds * 1000));
+ }
+ else if (pauseType_ == 'r')
+ {
+ ACE_Time_Value tv(0, milliseconds * 1000);
+ orb_->run(tv);
+ }
+ else
+ {
+ ACE_ASSERT(pauseType_ == 'r');
+ }
+ }
+}
+
+void TestServer::run()
+{
+ pause(startupPause_);
+
+ // FUZZ: disable check_for_missing_rir_env
+ CORBA::Object_var obj = orb_->resolve_initial_references("RootPOA");
+ root_ = PortableServer::POA::_narrow(obj.in());
+ mgr_ = root_->the_POAManager();
+
+ if (registerWithManager() == false)
+ return;
+
+ ACE_DEBUG((LM_DEBUG, "* Server (%d.%d) started.\n",
+ serverID_, serverInstanceID_));
+
+ if (useIORTable_ == true)
+ {
+ // FUZZ: disable check_for_missing_rir_env
+ CORBA::Object_var obj = orb_->resolve_initial_references("IORTable");
+ iorTable_ = IORTable::Table::_narrow(obj.in());
+ }
+
+ servant_.reset(new Messenger_i(orb_.in(), serverInstanceID_));
+
+ buildObjects();
+
+ pause(activatePause_);
+ mgr_->activate();
+
+ if (useItLoseItSecs_ > 0)
+ {
+ pause(runPause_);
+ do
+ {
+ ACE_Time_Value tv(useItLoseItSecs_);
+ orb_->run(tv);
+ } while (orb_->orb_core()->has_shutdown() == 0
+ && servant_->acknowledgeHit());
+ }
+
+ if (orb_->orb_core()->has_shutdown() != 0)
+ {
+ ACE_DEBUG((LM_DEBUG, "* Server (%d.%d) ended.\n",
+ serverID_, serverInstanceID_));
+ }
+ else
+ {
+ ACE_DEBUG((LM_DEBUG, "* Server (%d.%d) self terminated.\n",
+ serverID_, serverInstanceID_));
+ }
+}
+
+// TestServer::registerServer
+// This will register the server with the manager.
+//
+bool TestServer::registerWithManager()
+{
+ // So-far, the use cases dictate writting IOR
+ // responsibility is exclusive of registering
+ if (writeIORFile_ == false)
+ {
+ // Get the manager's ref
+ CORBA::Object_var obj = orb_->string_to_object("file://manager.ior");
+ if (CORBA::is_nil(obj.in()))
+ {
+ cerr << "Server Error: Could not get Manager IOR." << endl;
+ return false;
+ }
+ Manager_var manager = Manager::_narrow(obj.in());
+ if (CORBA::is_nil(manager.in())) {
+ cerr << "Server Error: IOR was not a Manager object reference." << endl;
+ return false;
+ }
+
+ // If this is a query process
+ if (retryQuery_ == true)
+ {
+ int diff = manager->endRetry();
+ if (diff != 0)
+ {
+ ACE_DEBUG((LM_DEBUG, "* Server Error: Not all retry attempts were made.\n"));
+ }
+ return false;
+ }
+ else // Get the server ID
+ {
+ serverInstanceID_ = manager->registerServer();
+ if (serverInstanceID_ == -1)
+ {
+ ACE_DEBUG((LM_DEBUG, "* Server (%d,%d) could not register.\n",
+ serverID_, serverInstanceID_));
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+// TestServer::buildObjects
+// Builds all the objects required by the client and server
+// Writes IORs if requested
+//
+void TestServer::buildObjects()
+{
+ // Append to existing file
+ ofstream iorFile("imr_test.ior", ios::app);
+
+ // Create number of requested POAS
+ for (int i = 0; i < numPOAS_; i++)
+ {
+ CORBA::PolicyList policies(3);
+ policies.length(3);
+ policies[0] = root_->create_id_assignment_policy(PortableServer::USER_ID);
+ policies[1] = root_->create_id_uniqueness_policy(PortableServer::MULTIPLE_ID);
+ policies[2] = root_->create_lifespan_policy(PortableServer::PERSISTENT);
+
+ // Create a POA
+ string poaName;
+ {
+ std::stringstream poaStream;
+ poaStream << "POA_" << serverID_ << "_" << (i + 1);
+ poaName = poaStream.str();
+ }
+
+ ACE_DEBUG((LM_DEBUG, "* Creating POA: %s\n", poaName.c_str()));
+
+ PortableServer::POA_var sub_poa = root_->create_POA(poaName.c_str(), mgr_.in(), policies);
+
+ pause(objActivatePause_);
+ // Create number of requested object references
+ for (int j = 0; j < numObjsPerPOA_; j++)
+ {
+ // Create object reference and activate it
+ string objName;
+ {
+ std::stringstream objStream;
+ objStream << "OBJ_" << serverID_ << "_" << (i + 1) << "_" << (j + 1);
+ objName = objStream.str();
+ }
+ ACE_DEBUG((LM_DEBUG, "* Activating Obj: %s\n", objName.c_str()));
+
+ PortableServer::ObjectId_var oid = PortableServer::string_to_ObjectId(objName.c_str());
+ sub_poa->activate_object_with_id(oid.in(), servant_.get());
+
+ // Output the stringified ID to the file for the client
+ if (! useIORTable_)
+ {
+ if (writeIORFile_)
+ {
+ // Write out IOR
+ CORBA::Object_var obj = sub_poa->id_to_reference(oid.in());
+ CORBA::String_var ior = orb_->object_to_string(obj.in());
+ iorFile << ior.in () << endl;
+ }
+ }
+ else // use IOR table
+ {
+ // Write out corbaloc
+ TAO_Root_POA* tmp_poa = dynamic_cast<TAO_Root_POA*>(sub_poa.in());
+ // Make entry into ior table using the non IMRified object ref.
+ CORBA::Object_var obj = tmp_poa->id_to_reference_i(oid.in(), false);
+ CORBA::String_var ior = orb_->object_to_string(obj.in());
+ string key = (poaName + "/" + objName);
+ iorTable_->bind(key.c_str(), ior.in());
+
+ if (writeIORFile_)
+ {
+ // Use the IMRified object ref to create the corbaloc.
+ CORBA::Object_var obj = sub_poa->id_to_reference(oid.in());
+
+ // Create a corbaloc
+ TAO_Profile* profile = obj->_stubobj()->profile_in_use();
+ CORBA::String_var temp = profile->to_string();
+ string corbaloc = temp.in();
+ corbaloc.resize(corbaloc.find_first_of(profile->object_key_delimiter()) + 1);
+ corbaloc += key;
+
+ // Write out corbaloc
+ iorFile << corbaloc.c_str() << endl;
+ }
+ }
+ }
+ }
+}
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/TestServer.h b/TAO/orbsvcs/examples/ImR/Advanced/TestServer.h
new file mode 100644
index 00000000000..d18bd441c6b
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/TestServer.h
@@ -0,0 +1,50 @@
+//$Id$
+#include "Messenger_i.h"
+
+#include "ace/Auto_Ptr.h"
+
+#include "tao/IORTable/IORTable.h"
+
+#include <string>
+#include <vector>
+
+class TestServer
+{
+public:
+ TestServer(CORBA::ORB_ptr, int argc, char* argv[]);
+
+ ~TestServer();
+
+ void run();
+
+private:
+ int parseCommands(int argc, char* argv[]);
+ bool verifyEnvironment() const;
+ bool registerWithManager();
+ void buildObjects();
+ void pause(int milliseconds);
+
+ int serverID_;
+ int serverInstanceID_;
+ bool useIORTable_;
+ bool writeIORFile_;
+ bool retryQuery_;
+ char pauseType_;
+ int startupPause_;
+ int objActivatePause_;
+ int activatePause_;
+ int runPause_;
+ int numPOAS_;
+ int numObjsPerPOA_;
+ int useItLoseItSecs_;
+
+ std::string baseDir_;
+ std::string expectedDir_;
+ std::vector<std::pair<std::string, std::string> > expectedEnv_;
+ ACE_Auto_Ptr<Messenger_i> servant_;
+
+ CORBA::ORB_var orb_;
+ IORTable::Table_var iorTable_;
+ PortableServer::POA_var root_;
+ PortableServer::POAManager_var mgr_;
+};
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/client_main.cpp b/TAO/orbsvcs/examples/ImR/Advanced/client_main.cpp
new file mode 100644
index 00000000000..bcebff9a94f
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/client_main.cpp
@@ -0,0 +1,25 @@
+//$Id$
+#include "TestClient.h"
+
+#include <ace/streams.h>
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ {
+ TestClient client(orb.in(), argc, argv);
+ client.run();
+ }
+
+ orb->destroy();
+ return 0;
+ }
+ catch (CORBA::Exception& ex)
+ {
+ cerr << "TestClient: " << ex << endl;
+ }
+ return 1;
+}
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/drivers/all b/TAO/orbsvcs/examples/ImR/Advanced/drivers/all
new file mode 100644
index 00000000000..d4a342bc676
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/drivers/all
@@ -0,0 +1,6 @@
+# All Tests
+run invocation
+run environment
+run persistence
+run retry
+
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/drivers/defaults b/TAO/orbsvcs/examples/ImR/Advanced/drivers/defaults
new file mode 100644
index 00000000000..212a54c6bfb
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/drivers/defaults
@@ -0,0 +1,76 @@
+- General
+
+- How should pauses be performed
+pause_type=s
+- Which file to parse next
+file=
+
+- IMR
+
+- Is the ImR even turned on
+imr_on=1
+- Shutdown the ImR using the tao_imr tool
+imr_shutdown=0
+- Time between pings, in milliseconds
+imr_ping_interval=10
+- Timeout for server activation, in seconds
+imr_startup_timeout=5
+- The IMR's debug level [0-2]
+imr_debug_level=1
+- How the IMR saves its information (registry, binary, XML)
+imr_persistence=
+- Clear the persistence on load
+imr_persistence_clear=1
+- The enpoint for the IMR service
+imr_endpoint=iiop://:33333
+
+- Activator
+
+- Activator mode (empty), normal, manual, auto_start, per_client
+activate_mode=
+- Server retry count for the activator
+activate_retry=0
+- How to register the servers, update or add
+registration_type=update
+- Number of test environment varaiables
+env_varnum=0
+- Test working directory
+env_dir=
+
+- Server
+
+- Server's reference style
+server_ref_style=
+- Use IORTable
+server_ior_table=0
+- Pause before POA and servant creation, in milliseconds
+server_start_pause=0
+- Pause before object activation, in milliseconds
+server_obj_act_pause=0
+- Pause before POA MGR activate, in milliseconds
+server_activate_pause=0
+- Pause before orb run, in milliseconds
+server_run_pause=0
+- Inactivity shutdown time during run, in seconds
+server_hit_time_min=15
+- Number of POAS to create
+server_poas=2
+- Number of servant activations (IORS)per POA to create
+server_poa_objs=2
+
+- Client
+
+- Pause before thread creation, in milliseconds
+client_start_pause=100
+- Number of threads to create
+client_threads=2
+- Number of work iterations per thread
+client_iterations=2
+- Number of requests per IOR
+client_requests=2
+- Make the number of requests random per IOR
+client_rand_req=0
+- Expect holding exceptions
+client_holding=0
+- Expent no-profile exceptions
+client_noprofile=0 \ No newline at end of file
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/drivers/environment b/TAO/orbsvcs/examples/ImR/Advanced/drivers/environment
new file mode 100644
index 00000000000..5002846cc03
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/drivers/environment
@@ -0,0 +1,14 @@
+#
+# Environment Tests
+#
+
+# Simple Environment
+begin
+imr_shutdown=2
+server_poas=1
+server_poa_objs=0
+activate_mode=manual
+registration_type=add
+env_varnum=4
+env_dir=./drivers
+run use_environment
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/drivers/invocation b/TAO/orbsvcs/examples/ImR/Advanced/drivers/invocation
new file mode 100644
index 00000000000..5a91bc532f3
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/drivers/invocation
@@ -0,0 +1,48 @@
+#
+# Invocation Tests
+#
+
+# Default test
+begin
+run use_invocation
+
+# Default IOR Table
+begin
+server_ior_table=1
+run use_invocation
+
+# Default Activator
+begin
+activate_mode=normal
+run use_invocation
+
+# Default Activator IOR Table
+begin
+server_ior_table=1
+activate_mode=normal
+run use_invocation
+
+# Default Activator Per Client
+begin
+activate_mode=per_client
+run use_invocation
+
+# Default Activator Per Client IOR Table
+begin
+server_ior_table=1
+activate_mode=per_client
+run use_invocation
+
+# Default Activator Manual
+begin
+activate_mode=manual
+run use_invocation
+
+# Default Activator Manual IOR Table
+begin
+server_ior_table=1
+activate_mode=manual
+run use_invocation
+
+- activate_mode=auto_start is tested in persistence.txt
+
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/drivers/persistence b/TAO/orbsvcs/examples/ImR/Advanced/drivers/persistence
new file mode 100644
index 00000000000..4d522eddc11
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/drivers/persistence
@@ -0,0 +1,57 @@
+#
+# Persistence Tests
+#
+
+# Default Persistence w/ auto_start - XML
+begin
+server_poas=1
+server_poa_objs=1
+client_threads=1
+client_iterations=1
+client_requests=1
+imr_persistence=XML
+activate_mode=manual
+env_varnum=4
+env_dir=./drivers
+run use_persistence
+
+# Default Persistence w/ auto_start - Binary
+begin
+server_poas=1
+server_poa_objs=1
+client_threads=1
+client_iterations=1
+client_requests=1
+imr_persistence=binary
+activate_mode=auto_start
+env_varnum=4
+env_dir=./drivers
+run use_persistence
+
+# Default Persistence w/ auto_start - Registry
+begin
+server_poas=1
+server_poa_objs=1
+client_threads=1
+client_iterations=1
+client_requests=1
+imr_persistence=registry
+activate_mode=auto_start
+env_varnum=4
+env_dir=./drivers
+run use_persistence
+
+--
+# Clear the persistence
+begin
+imr_persistence_clear=1
+imr_persistence=registry
+do start_imr();
+do kill_imr();
+imr_persistence=XML
+do start_imr();
+do kill_imr();
+imr_persistence=binary
+do start_imr();
+do kill_imr();
+-- \ No newline at end of file
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/drivers/retry b/TAO/orbsvcs/examples/ImR/Advanced/drivers/retry
new file mode 100644
index 00000000000..7bcfdd99631
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/drivers/retry
@@ -0,0 +1,28 @@
+#
+# Retry Tests
+#
+
+# Simple Retry Test
+begin
+server_poas=1
+server_poa_objs=1
+client_threads=1
+client_iterations=1
+client_requests=1
+activate_retry=4
+activate_mode=per_client
+run use_invocation
+
+# Simple Ping Test
+begin
+debug_level=2
+activate_mode=manual
+server_poas=1
+server_poa_objs=1
+client_threads=1
+client_iterations=1
+client_requests=1
+env_pause_type=r
+ping_interval=500
+server_activate_pause=10000
+run use_invocation
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/drivers/use_environment b/TAO/orbsvcs/examples/ImR/Advanced/drivers/use_environment
new file mode 100644
index 00000000000..35b5c3f0525
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/drivers/use_environment
@@ -0,0 +1,19 @@
+- use_environment
+
+do start_imr
+do start_activator
+
+# Regester Server (1/2)
+do register_server
+do activate_server
+do kill_server
+do unregister_server
+
+# Regester Server (2/2)
+do register_server
+do activate_server
+do kill_server
+do unregister_server
+
+do kill_activator
+do kill_imr \ No newline at end of file
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/drivers/use_invocation b/TAO/orbsvcs/examples/ImR/Advanced/drivers/use_invocation
new file mode 100644
index 00000000000..927d1ab4100
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/drivers/use_invocation
@@ -0,0 +1,12 @@
+- use_invocation
+
+do invoke_stats
+do start_imr
+do write_iors
+do start_activator
+do register_server
+do start_server
+do launch_client
+do kill_server
+do kill_activator
+do kill_imr
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/drivers/use_persistence b/TAO/orbsvcs/examples/ImR/Advanced/drivers/use_persistence
new file mode 100644
index 00000000000..9124a28ceaa
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/drivers/use_persistence
@@ -0,0 +1,22 @@
+- use_persistence
+
+# Start the IMR
+#
+imr_persistence_clear=1
+do invoke_stats
+do start_imr();
+do start_activator
+do write_iors
+do register_server
+do kill_imr
+
+# Reload the IMR
+#
+imr_persistence_clear=0
+do start_imr
+do activator_list
+do start_server
+do launch_client
+do kill_server
+do kill_activator
+do kill_imr \ No newline at end of file
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/manager_main.cpp b/TAO/orbsvcs/examples/ImR/Advanced/manager_main.cpp
new file mode 100644
index 00000000000..6be76baf992
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/manager_main.cpp
@@ -0,0 +1,59 @@
+//$Id$
+#include "Manager_i.h"
+
+#include <ace/Get_Opt.h>
+#include <ace/streams.h>
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ long retryCount = 0;
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ ACE_Get_Opt get_opts(argc, argv, "r:");
+ int c;
+ while ((c = get_opts()) != -1)
+ {
+ switch (c)
+ {
+ case 'r':
+ retryCount = ::atoi(get_opts.opt_arg());
+ break;
+ case '?':
+ default:
+ cout << "Usage: " << argv[0] << " [-r retryCount]" << endl;
+ break;
+ }
+ }
+
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in());
+
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+
+ Manager_i servant(retryCount);
+ PortableServer::ObjectId_var oid = poa->activate_object(&servant);
+ obj = poa->id_to_reference(oid.in());
+ {
+ CORBA::String_var ior = orb->object_to_string(obj.in());
+ ofstream iorFile("manager.ior");
+ iorFile << ior.in() << endl;
+ }
+
+ cout << "IMR Test Manager activated (servers retry = " << retryCount << ")." << endl;
+
+ mgr->activate();
+
+ orb->run();
+
+ poa->destroy(1, 1);
+ orb->destroy();
+ return 0;
+ }
+ catch (CORBA::Exception& ex)
+ {
+ cerr << "Manager: " << ex << endl;
+ }
+ return 1;
+}
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/run_test.pl b/TAO/orbsvcs/examples/ImR/Advanced/run_test.pl
new file mode 100755
index 00000000000..ff25de6d125
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/run_test.pl
@@ -0,0 +1,519 @@
+##$Id$
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# This test currently does not perform
+# ImplRepo_Service -m (multicast)
+# ImplRepo_Service -l (loack database)
+# ImplRepo_Service -c (install/remove Windows service)
+# tao_imr shutdown -l hostname (shutdown servers on a specific host)
+# tao_imr shutdown_repo (shutting down ImplRepo_Service via tao_imr)
+
+#use strict;
+use lib "$ENV{ACE_ROOT}/bin";
+use PerlACE::Run_Test;
+use Sys::Hostname;
+use File::Spec;
+use Getopt::Long;
+
+
+# Initialize variables
+my %TestParams;
+my $IMPL_IOR = "-ORBInitRef ImplRepoService=file://implrepo.ior";
+my $ENV_CMD;
+my $IMR_CMD;
+my $ACT_CMD;
+my $IOR_CMD;
+my $SERVER_CMD;
+my $CLIENT_CMD;
+my $MGR;
+my $IMPL;
+my $ACT;
+my $SERVER;
+
+# Get command line params
+$TestParams{file} = "./drivers/all";
+GetOptions("file|f=s" => \$TestParams{file});
+parse_file();
+
+# Open the Param file and run the tests within
+sub parse_file
+{
+ my $fh;
+ my $file = $TestParams{file};
+
+ my $disabled_block = 0;
+ if (open($fh, $file))
+ {
+ while (<$fh>)
+ {
+ my $line = $_;
+ $line =~ s/\s+$//;
+
+ # If the line is negated, ignore it
+ if ($line =~ /^--/)
+ {
+ $disabled_block = ! ($disabled_block);
+ }
+
+ elsif ($disabled_block == 0)
+ {
+ # If the line is negated, ignore it
+ if ($line =~ /^-/)
+ {
+ }
+
+ # If the line is a comment, print it
+ elsif ($line =~ /^#/)
+ {
+ print "$line\n";
+ }
+
+ # Start defining an execution
+ elsif ($line =~ /^begin/)
+ {
+ $TestParams{file} = "./drivers/defaults";
+ parse_file();
+ }
+
+ # Parse a new file
+ elsif ($line =~ /^run (\w+)/)
+ {
+ $TestParams{file} = "./drivers/$1";
+ parse_file();
+ }
+
+ # Acquire parameter
+ elsif ($line =~ /(\w+)=(.*)/)
+ {
+ &acquire_param($1, $2);
+ }
+
+ # Execute a single line
+ elsif ($line =~ /^do (\w+)/)
+ {
+ my $methodRef = $1;
+ &$methodRef(); #how do I do this in the strict mode?
+ }
+ }
+ }
+ }
+}
+
+sub invoke_stats()
+{
+ my $IORS = ($TestParams{server_poas} * $TestParams{server_poa_objs});
+ my $THREAD_REQ = ($TestParams{client_iterations} * $IORS * $TestParams{client_requests});
+ my $TOTAL_REQ = ($TestParams{client_threads} * $THREAD_REQ);
+
+ my $RAND_MSG = "";
+ if ($TestParams{client_rand_req} ne "0")
+ {
+ $RAND_MSG = "(max random)";
+ }
+ print "* Invocation Stats\n";
+ print "* POAs: $TestParams{server_poas}\n";
+ print "* Obj/POA: $TestParams{server_poa_objs}\n";
+ print "* IORs: $IORS\n";
+ print "* Threads: $TestParams{client_threads}\n";
+ print "* Iterations/Thread: $TestParams{client_iterations}\n";
+ print "* Requests/Thread: $THREAD_REQ $RAND_MSG\n";
+ print "* Total Requests: $TOTAL_REQ $RAND_MSG\n";
+}
+
+sub start_imr
+{
+ generateCommands();
+
+ # Start the manager
+ unlink "manager.ior";
+ $MGR = new PerlACE::Process("manager_main", "-r $TestParams{activate_retry}");
+ $MGR->Spawn();
+ PerlACE::waitforfile_timed("manager.ior", 10);
+
+ if ($TestParams{imr_on} eq "1")
+ {
+ # Start the IMR Service
+ unlink "implrepo.ior";
+ $IMPL = new PerlACE::Process(
+ "$ENV{ACE_ROOT}/TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service",
+ $IMR_CMD);
+ $IMPL->Spawn();
+ PerlACE::waitforfile_timed("implrepo.ior", 10);
+ }
+}
+
+sub kill_imr
+{
+ if ($TestParams{imr_on} eq "1")
+ {
+ if ($TestParams{imr_shutdown} ne "0")
+ {
+ my $tool_params = "$IMPL_IOR shutdown-repo";
+ if ($TestParams{imr_shutdown} eq "2" && $TestParams{activate_mode} ne "")
+ {
+ $tool_params = "$tool_params -a";
+ }
+
+ my $TOOL = new PerlACE::Process("$ENV{ACE_ROOT}/bin/tao_imr", $tool_params);
+ $TOOL->IgnoreExeSubDir(1);
+ $TOOL->SpawnWaitKill(5);
+
+ # test $IMPL
+ if ($TestParams{imr_shutdown} eq "2" && $TestParams{activate_mode} ne "")
+ {
+ $ACT->WaitKill(5);
+ print "* Activator Killed.\n";
+ }
+ $IMPL->WaitKill(5);
+ }
+ else
+ {
+ $IMPL->TerminateWaitKill(1);
+ }
+ print "* IMR Killed.\n";
+ }
+
+ my $TEMP_SERV = new PerlACE::Process("server_main", "-q 1 -x 0");
+ $TEMP_SERV->SpawnWaitKill(5);
+ $MGR->Kill();
+}
+
+# write_iors
+# creates the IORS for all the objects the client will invoke
+# The POAs will be temporarely registered with the IMR.
+sub write_iors
+{
+ generateCommands();
+ unlink "imr_test.ior";
+ if ($TestParams{activate_mode} eq "per_client")
+ {
+ # Run a single fake server for every POA
+ for (my $i = 1; $i <= $TestParams{server_poas}; $i++)
+ {
+ my $TEMP_SERV = new PerlACE::Process("server_main", "$IOR_CMD -p 1 -d " . $i);
+ $TEMP_SERV->SpawnWaitKill(5);
+ }
+ print "* IORs Written\n";
+ }
+ elsif ($TestParams{activate_mode} ne "")
+ {
+ # Run a single fake server for all POAs
+ my $TEMP_SERV = new PerlACE::Process("server_main", "$IOR_CMD -d 1 -p $TestParams{server_poas}");
+ $TEMP_SERV->SpawnWaitKill(5);
+ PerlACE::waitforfile_timed("imr_test.ior", 10);
+ print "* IORs Written\n";
+ }
+ else
+ {
+ # Without an activator, the server will write the IORs when manually launched
+ }
+}
+
+sub start_activator
+{
+ if ($TestParams{activate_mode} ne "")
+ {
+ generateCommands();
+
+ # Start the Activator
+ unlink "activator.ior";
+ $ACT = new PerlACE::Process(
+ "$ENV{ACE_ROOT}/TAO/orbsvcs/ImplRepo_Service/ImR_Activator",
+ $ACT_CMD);
+ $ACT->Spawn();
+ PerlACE::waitforfile_timed("activator.ior", 5);
+ }
+}
+
+sub kill_activator()
+{
+ if ($TestParams{activate_mode} ne "")
+ {
+ if ($TestParams{imr_shutdown} ne "2")
+ {
+ $ACT->TerminateWaitKill(1);
+ print "* Activator Killed.\n";
+ }
+ }
+}
+
+# activator_list
+# Lists the known servers
+sub activator_list()
+{
+ my $TOOL = new PerlACE::Process("$ENV{ACE_ROOT}/bin/tao_imr", "$IMPL_IOR list -v");
+ $TOOL->IgnoreExeSubDir(1);
+ $TOOL->SpawnWaitKill(5);
+
+ # TODO: parse output and check values
+}
+
+# register_server
+# Makes the activator know about the server
+# Does nothing for the no-activator mode
+sub register_server()
+{
+ if ($TestParams{activate_mode} eq "per_client")
+ {
+ # Register a single POA for each server
+ generateCommands();
+ my $actname = hostname;
+ for (my $i = 1; $i <= $TestParams{server_poas}; $i++)
+ {
+ my $TOOL = new PerlACE::Process("$ENV{ACE_ROOT}/bin/tao_imr", "$IMPL_IOR $TestParams{registration_type} POA_".$i."_1 -c \"server_main $SERVER_CMD -d ".$i." -p 1\" -a $TestParams{activate_mode} -r $TestParams{activate_retry} -l $actname $ENV_CMD");
+ $TOOL->IgnoreExeSubDir(1);
+ $TOOL->SpawnWaitKill(5);
+ }
+ }
+ elsif ($TestParams{activate_mode} ne "")
+ {
+ # Register only the first POA for our server
+ # The remaining POAs will auto-register when the server is started
+ generateCommands();
+ my $actname = hostname;
+ my $TOOL = new PerlACE::Process("$ENV{ACE_ROOT}/bin/tao_imr", "$IMPL_IOR $TestParams{registration_type} POA_1_1 -c \"server_main $SERVER_CMD -d 1 -p $TestParams{server_poas}\" -a $TestParams{activate_mode} -r $TestParams{activate_retry} -l $actname $ENV_CMD");
+ $TOOL->IgnoreExeSubDir(1);
+ $TOOL->SpawnWaitKill(5);
+ }
+ else
+ {
+ # nothing to register without an activator
+ }
+}
+
+sub unregister_server()
+{
+ if ($TestParams{activate_mode} eq "per_client")
+ {
+ # Register a single POA for each server
+ generateCommands();
+ my $actname = hostname;
+ for (my $i = 1; $i <= $TestParams{server_poas}; $i++)
+ {
+ my $TOOL = new PerlACE::Process("$ENV{ACE_ROOT}/bin/tao_imr", "$IMPL_IOR remove POA_".$i."_1");
+ $TOOL->IgnoreExeSubDir(1);
+ $TOOL->SpawnWaitKill(5);
+ }
+ }
+ elsif ($TestParams{activate_mode} ne "")
+ {
+ # Register only the first POA for our server
+ # The remaining POAs will auto-register when the server is started
+ generateCommands();
+ my $actname = hostname;
+ my $TOOL = new PerlACE::Process("$ENV{ACE_ROOT}/bin/tao_imr", "$IMPL_IOR remove POA_1_1");
+ $TOOL->IgnoreExeSubDir(1);
+ $TOOL->SpawnWaitKill(5);
+ }
+ else
+ {
+ # nothing is registered without an activator
+ }
+}
+
+
+# start_server
+# This method is called before the client is luanched.
+# It only launches the server for the two manual modes (no-act and manual-act).
+sub start_server()
+{
+ if ($TestParams{activate_mode} eq "")
+ {
+ generateCommands();
+ $SERVER = new PerlACE::Process("server_main", "$SERVER_CMD -d 1 -o 1 -p $TestParams{server_poas}");
+ $SERVER->Spawn();
+ PerlACE::waitforfile_timed("imr_test.ior", 10);
+ }
+ elsif ($TestParams{activate_mode} eq "manual")
+ {
+ activate_server();
+ }
+ else
+ {
+ # The server will be launched by the ImR or Client
+ }
+}
+
+# Activate Server
+# This method is an alternative way to start the server.
+# It will activate the servers regardless of mode.
+sub activate_server
+{
+ if ($TestParams{activate_mode} eq "per_client")
+ {
+ # Register a single POA for each server
+ generateCommands();
+ my $actname = hostname;
+ for (my $i = 1; $i <= $TestParams{server_poas}; $i++)
+ {
+ my $TOOL = new PerlACE::Process("$ENV{ACE_ROOT}/bin/tao_imr", "$IMPL_IOR activate POA_".$i."_1");
+ $TOOL->IgnoreExeSubDir(1);
+ $TOOL->SpawnWaitKill(5);
+ }
+ }
+ elsif ($TestParams{activate_mode} ne "")
+ {
+ # Register only the first POA for our server
+ # The remaining POAs will auto-register when the server is started
+ generateCommands();
+ my $actname = hostname;
+ my $TOOL = new PerlACE::Process("$ENV{ACE_ROOT}/bin/tao_imr", "$IMPL_IOR activate POA_1_1");
+ $TOOL->IgnoreExeSubDir(1);
+ $TOOL->SpawnWaitKill(5);
+ }
+ else # No activator
+ {
+ start_server();
+ }
+}
+
+# kill server
+# This method is called when the services of the server are no longer required.
+# per_client does nothing.
+sub kill_server()
+{
+ if ($TestParams{activate_mode} eq "per_client")
+ {
+ # clients do this
+ }
+ elsif ($TestParams{activate_mode} ne "")
+ {
+ # Kill the single server
+ my $TOOL = new PerlACE::Process("$ENV{ACE_ROOT}/bin/tao_imr", "$IMPL_IOR shutdown POA_1_1");
+ $TOOL->SpawnWaitKill(5);
+ }
+ else
+ {
+ $SERVER->Kill();
+ print "* Server Killed.\n";
+ }
+}
+
+# launch_client
+# This method spawns the client and blocks until the client is done
+sub launch_client
+{
+ generateCommands();
+ if ($TestParams{activate_mode} eq "per_client")
+ {
+ my $CLIENT = new PerlACE::Process("client_main", "$CLIENT_CMD -x 1");
+ $CLIENT->SpawnWaitKill(500);
+ }
+ else
+ {
+ my $CLIENT = new PerlACE::Process("client_main", "$CLIENT_CMD");
+ $CLIENT->SpawnWaitKill(500);
+ }
+}
+
+# Private methods
+
+# acquire_param
+# Transforms certain parameters into usable forms
+sub acquire_param
+{
+ $TestParams{$_[0]} = $_[1];
+
+ if ($_[0] eq "imr_persistence")
+ {
+ if ($TestParams{imr_persistence} eq "registry")
+ {
+ $TestParams{imr_persistence} = "-r";
+ }
+ elsif ($TestParams{imr_persistence} eq "binary")
+ {
+ $TestParams{imr_persistence} = "-p imr_persist";
+ }
+ elsif ($TestParams{imr_persistence} eq "XML")
+ {
+ $TestParams{imr_persistence} = "-x imr_persist";
+ }
+ }
+
+ elsif ($_[0] eq "imr_persistence_clear")
+ {
+ if ($TestParams{imr_persistence_clear} eq "1")
+ {
+ $TestParams{imr_persistence_clear} = "-e";
+ }
+ else
+ {
+ $TestParams{imr_persistence_clear} = "";
+ }
+ }
+
+ elsif ($_[0] eq "server_ref_style" && $TestParams{server_ref_style} ne "")
+ {
+ $TestParams{server_ref_style} = "-ORBObjRefStyle $TestParams{server_ref_style}";
+ }
+
+ elsif ($_[0] eq "client_rand_req" && $TestParams{client_rand_req} eq "1")
+ {
+ $TestParams{client_rand_req} = "r";
+ }
+
+ elsif ($_[0] eq "client_holding" && $TestParams{client_holding} eq "1")
+ {
+ $TestParams{client_holding} = "h";
+ }
+
+ elsif ($_[0] eq "client_noprofile" && $TestParams{client_noprofile} eq "1")
+ {
+ $TestParams{client_noprofile} = "n";
+ }
+}
+
+# generateCommands
+# Create common cammand line sets
+sub generateCommands
+{
+ $ENV_CMD = "";
+ for (my $i = 0; $i < $TestParams{env_varnum}; $i++)
+ {
+ $ENV_CMD = "$ENV_CMD -e Name_" . $i . "=Value_" . $i . " ";
+ }
+
+ if ($TestParams{env_dir} ne "")
+ {
+ $ENV_CMD = "$ENV_CMD -w " . File::Spec->rel2abs($TestParams{env_dir}) . " ";
+ }
+
+ $IMR_CMD = "-o implrepo.ior "
+ . "$TestParams{imr_persistence} "
+ . "$TestParams{imr_persistence_clear} "
+ . "-ORBEndPoint $TestParams{imr_endpoint} "
+ . "-d $TestParams{imr_debug_level} "
+ . "-v $TestParams{imr_ping_interval} "
+ . "-t $TestParams{imr_startup_timeout} ";
+
+ $ACT_CMD = "$IMPL_IOR -o activator.ior -d $TestParams{imr_debug_level}";
+
+ $SERVER_CMD = "-ORBUseIMR $TestParams{imr_on} $IMPL_IOR "
+ . "$ENV_CMD "
+ . "$TestParams{server_ref_style} "
+ . "-b " . File::Spec->rel2abs(".") . " "
+ . "-t $TestParams{server_ior_table} "
+ . "-z $TestParams{env_pause_type} "
+ . "-s $TestParams{server_start_pause} "
+ . "-c $TestParams{server_obj_act_pause} "
+ . "-a $TestParams{server_activate_pause} "
+ . "-r $TestParams{server_run_pause} "
+ . "-n $TestParams{server_poa_objs} "
+ . "-x $TestParams{server_hit_time_min} ";
+
+ $CLIENT_CMD = "-z $TestParams{env_pause_type} "
+ . "-s $TestParams{client_start_pause} "
+ . "-t $TestParams{client_threads} "
+ . "-i $TestParams{client_iterations} "
+ . "-r $TestParams{client_rand_req}$TestParams{client_requests} "
+ . "-e $TestParams{client_holding}$TestParams{client_noprofile} ";
+
+ $IOR_CMD = "-ORBUseIMR $TestParams{imr_on} $IMPL_IOR "
+ . "$TestParams{server_ref_style} "
+ . "-b " . File::Spec->rel2abs(".") . " "
+ . "-t $TestParams{server_ior_table} "
+ . "-n $TestParams{server_poa_objs} "
+ . "-z s -s 100 -o 1 -x 0 " # sleep 100, write iors, and exit
+}
diff --git a/TAO/orbsvcs/examples/ImR/Advanced/server_main.cpp b/TAO/orbsvcs/examples/ImR/Advanced/server_main.cpp
new file mode 100644
index 00000000000..ccf813d0e9c
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Advanced/server_main.cpp
@@ -0,0 +1,26 @@
+//$Id$
+#include "TestServer.h"
+
+#include <ace/streams.h>
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb;
+ orb = CORBA::ORB_init(argc, argv);
+
+ {
+ TestServer server(orb.in(), argc, argv);
+ server.run();
+ }
+
+ orb->destroy();
+ return 0;
+ }
+ catch (CORBA::Exception& ex)
+ {
+ cerr << "CORBA error: " << ex << endl;
+ }
+ return 1;
+}
diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/ImR_Combined_Service.mpc b/TAO/orbsvcs/examples/ImR/Combined_Service/ImR_Combined_Service.mpc
new file mode 100644
index 00000000000..fc8803905f7
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Combined_Service/ImR_Combined_Service.mpc
@@ -0,0 +1,83 @@
+// $Id$
+project(*IDL): taoidldefaults {
+ idl_files {
+ service_config.idl
+ test.idl
+ }
+ custom_only = 1
+}
+
+project : orbsvcsexe, portableserver, exceptions {
+ exename = combined_service
+ after += *IDL
+ source_files {
+ combined.cpp
+ service_configC.cpp
+ service_configS.cpp
+ }
+ idl_files {
+ }
+}
+
+project(*Controller) : orbsvcsexe, exceptions {
+ exename = controller
+ after += *IDL
+ source_files {
+ controller.cpp
+ service_configC.cpp
+ }
+ idl_files {
+ }
+}
+
+// A client that uses corba to test out basic imr functionality
+project(*Test) : orbsvcsexe, exceptions {
+ after += *IDL
+ source_files {
+ test.cpp
+ testC.cpp
+ }
+ idl_files {
+ }
+}
+
+// A server to use with the imr
+project(*TestServer) : orbsvcsexe, portableserver, iortable, exceptions {
+ after += *IDL
+ // The gnuace specific portion is to prevent invalid object files from
+ // IDL generated files being compiled simultaneously with parallel builds.
+ specific(gnuace) {
+ after += *Test
+ }
+ source_files {
+ test_server.cpp
+ testC.cpp
+ testS.cpp
+ }
+ idl_files {
+ }
+}
+
+// Another simple server that can be loaded dynamically into the
+// combined_service.
+project(*DynamicServer) : taolib, portableserver, iortable, exceptions {
+ dynamicflags = DYNSERVER_BUILD_DLL
+ sharedname = DynServer
+ after += *IDL
+ // The gnuace specific portion is to prevent invalid object files from
+ // IDL-generated files being compiled simultaneously with parallel builds.
+ specific(gnuace) {
+ after += *TestServer
+ }
+ source_files {
+ testC.cpp
+ testS.cpp
+ dynserver.cpp
+ }
+ header_files {
+ dynserver.h
+ dynserver_export.h
+ }
+ idl_files {
+ }
+}
diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/Makefile.am b/TAO/orbsvcs/examples/ImR/Combined_Service/Makefile.am
new file mode 100644
index 00000000000..88a88d3093b
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Combined_Service/Makefile.am
@@ -0,0 +1,209 @@
+## 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.ImR_Combined_Service_IDL.am
+
+BUILT_SOURCES = \
+ service_configC.cpp \
+ service_configC.h \
+ service_configC.inl \
+ service_configS.cpp \
+ service_configS.h \
+ service_configS.inl
+
+CLEANFILES = \
+ service_config-stamp \
+ service_configC.cpp \
+ service_configC.h \
+ service_configC.inl \
+ service_configS.cpp \
+ service_configS.h \
+ service_configS.inl
+
+service_configC.cpp service_configC.h service_configC.inl service_configS.cpp service_configS.h service_configS.inl: service_config-stamp
+
+service_config-stamp: $(srcdir)/service_config.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/service_config.idl
+ @touch $@
+
+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 = \
+ service_config.idl \
+ test.idl
+
+## Makefile.ImR_Combined_Service.am
+
+if BUILD_EXCEPTIONS
+
+noinst_PROGRAMS += combined_service
+
+combined_service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+combined_service_SOURCES = \
+ combined.cpp \
+ service_configC.cpp \
+ service_configS.cpp \
+ dynserver.h \
+ dynserver_export.h
+
+combined_service_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif BUILD_EXCEPTIONS
+
+## Makefile.ImR_Combined_Service_Controller.am
+
+if BUILD_EXCEPTIONS
+
+noinst_PROGRAMS += controller
+
+controller_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+controller_SOURCES = \
+ controller.cpp \
+ service_configC.cpp \
+ dynserver.h \
+ dynserver_export.h
+
+controller_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif BUILD_EXCEPTIONS
+
+## Makefile.ImR_Combined_Service_DynamicServer.am
+
+if BUILD_EXCEPTIONS
+
+noinst_LTLIBRARIES = libDynServer.la
+
+libDynServer_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -DDYNSERVER_BUILD_DLL
+
+libDynServer_la_SOURCES = \
+ dynserver.cpp \
+ testC.cpp \
+ testS.cpp
+
+noinst_HEADERS += \
+ dynserver.h \
+ dynserver_export.h
+
+endif BUILD_EXCEPTIONS
+
+## Makefile.ImR_Combined_Service_Test.am
+
+if BUILD_EXCEPTIONS
+
+noinst_PROGRAMS += test
+
+test_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+test_SOURCES = \
+ test.cpp \
+ testC.cpp \
+ dynserver.h \
+ dynserver_export.h
+
+test_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif BUILD_EXCEPTIONS
+
+## Makefile.ImR_Combined_Service_TestServer.am
+
+if BUILD_EXCEPTIONS
+
+noinst_PROGRAMS += test_server
+
+test_server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+test_server_SOURCES = \
+ testC.cpp \
+ testS.cpp \
+ test_server.cpp \
+ dynserver.h \
+ dynserver_export.h
+
+test_server_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_EXCEPTIONS
+
+## 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/examples/ImR/Combined_Service/combined.cpp b/TAO/orbsvcs/examples/ImR/Combined_Service/combined.cpp
new file mode 100644
index 00000000000..5864e974d00
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Combined_Service/combined.cpp
@@ -0,0 +1,81 @@
+// $Id$
+// This is a simple example, showing how you can load an
+// ImR Locator and/or Activator as ACE Service Objects
+// using the ACE Service Configurator framework.
+
+#include "service_configS.h"
+
+#include "ace/Service_Config.h"
+#include "ace/streams.h"
+#include "ace/OS_NS_string.h"
+
+
+using namespace CORBA;
+using namespace PortableServer;
+
+class SvcConf
+ : public POA_ServiceConfigurator
+{
+ ACE_Service_Config& asc_;
+public:
+ SvcConf(ACE_Service_Config& asc)
+ : asc_(asc)
+ {
+ }
+ virtual CORBA::Long process_directive(const char* s)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_ASSERT(s != 0);
+ ACE_ASSERT(ACE_OS::strlen(s) > 0);
+ return asc_.process_directive(s);
+ }
+
+ virtual void reconfigure() ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ asc_.reconfigure();
+ }
+};
+
+int main (int argc, char* argv[])
+{
+ try {
+
+ ACE_Service_Config config;
+ config.open(argc, argv);
+
+ ORB_var orb = ORB_init(argc, argv);
+
+ Object_var obj = orb->resolve_initial_references("RootPOA");
+ POA_var poa = POA::_narrow(obj.in());
+ ACE_ASSERT(! is_nil(poa.in()));
+ POAManager_var poaman = poa->the_POAManager();
+
+ SvcConf svt(config);
+
+ ObjectId_var id = poa->activate_object(&svt);
+ obj = poa->id_to_reference(id.in());
+ ACE_ASSERT(! is_nil(obj.in()));
+ String_var ior = orb->object_to_string(obj.in());
+
+ poaman->activate();
+
+ {
+ ofstream out("combined.ior");
+ out << ior;
+ }
+
+ ACE_DEBUG((LM_DEBUG, "Combined service started.\n"));
+
+ orb->run();
+
+ ACE_DEBUG((LM_DEBUG, "Combined service shutdown.\n"));
+
+ poa->destroy(1, 1);
+ orb->destroy();
+
+ } catch (CORBA::Exception& e) {
+ ACE_PRINT_EXCEPTION(e, "Combined Service:");
+ }
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/controller.cpp b/TAO/orbsvcs/examples/ImR/Combined_Service/controller.cpp
new file mode 100644
index 00000000000..0bab1bfd6aa
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Combined_Service/controller.cpp
@@ -0,0 +1,73 @@
+// $Id$
+// This is a simple test of an ImR using the corba interfaces
+
+#include "service_configC.h"
+
+#include <ace/streams.h>
+#include <ace/SString.h>
+#include <ace/Log_Msg.h>
+
+using namespace CORBA;
+
+namespace {
+
+ ACE_CString directive;
+
+ void showusage() {
+ ACE_DEBUG((LM_DEBUG, "Usage: controller [-r | -c \"service_configurator_directive\"]\n"
+ "(e.g. dynamic mysvc Service_Object * MySvc:_make_MySvc() \"-arg1 one\"\n\n"));
+ }
+
+ bool parse_args(int argc, char* argv[]) {
+ if (argc != 2 && argc != 3) {
+ ACE_ERROR((LM_ERROR, "Controller: wrong number of arguments. %d\n", argc - 1));
+ return false;
+ }
+ for (int i = 1; i < argc; ++i) {
+ ACE_CString s(argv[i]);
+ if (s == "-h" || s == "-help" || s == "--help" || s == "-?")
+ return false;
+ if (s == "-r") {
+ return true;
+ }
+ if (s == "-c" && ++i < argc) {
+ directive = argv[i];
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+int main(int argc, char* argv[]) {
+
+ try {
+
+ ORB_var orb = ORB_init(argc, argv);
+
+ if (! parse_args(argc, argv)) {
+ showusage();
+ return 1;
+ }
+
+ ACE_DEBUG((LM_DEBUG, "Controller: Connecting to combined service...\n"));
+
+ Object_var obj = orb->resolve_initial_references("ServiceConfig");
+ ServiceConfigurator_var sc = ServiceConfigurator::_narrow(obj.in());
+ ACE_ASSERT(! is_nil(sc.in()));
+
+ if (directive.length() > 0) {
+ ACE_DEBUG((LM_DEBUG, "Controller: sending directive <%s>...\n", directive.c_str()));
+ sc->process_directive(directive.c_str());
+ } else {
+ ACE_DEBUG((LM_DEBUG, "Controller: reloading config file...\n"));
+ sc->reconfigure();
+ }
+ ACE_DEBUG((LM_DEBUG, "Controller: done.\n"));
+
+ return 0;
+ } catch (CORBA::Exception& e) {
+ ACE_PRINT_EXCEPTION(e, "Controller:");
+ }
+ return 1;
+}
diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.conf b/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.conf
new file mode 100644
index 00000000000..4d63029f52e
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.conf
@@ -0,0 +1 @@
+dynamic DynServer_Loader Service_Object * DynServer:_make_DynServer_Loader() '-orbcollocation per-orb -orbuseimr 1 -orbinitref ImplRepoService=corbaloc::localhost:9999/ImplRepoService'
diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.cpp b/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.cpp
new file mode 100644
index 00000000000..8566023c945
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.cpp
@@ -0,0 +1,154 @@
+// $Id$
+#include "dynserver.h"
+
+#include "tao/IORTable/IORTable.h"
+#include "tao/PortableServer/Root_POA.h"
+
+#include "ace/Dynamic_Service.h"
+#include "ace/Task.h"
+
+using namespace CORBA;
+using namespace PortableServer;
+
+DynServer::DynServer()
+: n_(0)
+{
+}
+
+DynServer::~DynServer() {
+}
+
+Long DynServer::get() ACE_THROW_SPEC ((SystemException)) {
+ ACE_DEBUG((LM_DEBUG, "dynserver: get() %d\n", ++n_));
+ return n_;
+}
+
+namespace {
+ POA_ptr createPersistPOA(const char* name, POA_ptr root_poa, POAManager_ptr poaman) {
+ PolicyList policies (2);
+ policies.length (2);
+ policies[0] = root_poa->create_id_assignment_policy(USER_ID);
+ policies[1] = root_poa->create_lifespan_policy(PERSISTENT);
+ POA_var poa = root_poa->create_POA(name, poaman, policies);
+ policies[0]->destroy();
+ policies[1]->destroy();
+ return poa._retn();
+ }
+}
+
+class DynServer_ORB_Runner : public ACE_Task_Base
+{
+ ORB_var orb_;
+public:
+ DynServer_ORB_Runner(ORB_ptr orb)
+ : orb_(ORB::_duplicate(orb))
+ {
+ }
+ void end() {
+ if (! is_nil(orb_.in())) {
+ orb_->shutdown(1);
+ wait();
+ }
+ }
+ virtual int svc()
+ {
+ orb_->run();
+ orb_ = ORB::_nil();
+ return 0;
+ }
+};
+
+DynServer_Loader::DynServer_Loader(void)
+{
+}
+
+int
+DynServer_Loader::init (int argc, ACE_TCHAR* argv[] ACE_ENV_ARG_DECL)
+{
+ try {
+
+ orb_ = ORB_init(argc, argv, "DynServer");
+
+ Object_var obj = orb_->resolve_initial_references("RootPOA");
+ root_poa_ = POA::_narrow(obj.in());
+ POAManager_var poaman = root_poa_->the_POAManager();
+ obj = this->orb_->resolve_initial_references ("IORTable");
+ IORTable::Table_var ior_table = IORTable::Table::_narrow (obj.in());
+ ACE_ASSERT(! is_nil(ior_table.in()));
+
+ ACE_DEBUG((LM_DEBUG, "dynserver: creating poas. (Registers with ImR)\n"));
+
+ POA_var poa1 = createPersistPOA("DynObject1", root_poa_.in(), poaman.in());
+ POA_var poa2 = createPersistPOA("DynObject2", root_poa_.in(), poaman.in());
+
+ ACE_DEBUG((LM_DEBUG, "dynserver: activating objects.\n"));
+
+ DynServer* svt1 = new DynServer;
+ ServantBase_var scoped_svt1(svt1);
+ DynServer* svt2 = new DynServer;
+ ServantBase_var scoped_svt2(svt2);
+
+ ObjectId_var id = string_to_ObjectId("myobject");
+
+ poa1->activate_object_with_id(id.in(), svt1);
+ poa2->activate_object_with_id(id.in(), svt2);
+
+ TAO_Root_POA* tmp_poa = dynamic_cast<TAO_Root_POA*>(poa1.in());
+ obj = tmp_poa->id_to_reference_i (id.in(), false);
+ String_var ior = orb_->object_to_string(obj.in());
+ ior_table->bind ("DynObject1", ior.in());
+
+ tmp_poa = dynamic_cast<TAO_Root_POA*>(poa2.in());
+ obj = tmp_poa->id_to_reference_i (id.in(), false);
+ ior = orb_->object_to_string(obj.in());
+ ior_table->bind ("DynObject2", ior.in());
+
+ poaman->activate();
+
+ runner_.reset(new DynServer_ORB_Runner(orb_.in()));
+ runner_->activate();
+
+ ACE_DEBUG((LM_DEBUG, "dynserver: running.\n"));
+
+ } catch (Exception& e) {
+ ACE_PRINT_EXCEPTION(e, "DynServer::init()");
+ }
+ return 0;
+}
+
+int
+DynServer_Loader::fini (void)
+{
+ ACE_ASSERT(runner_.get() != 0);
+ try {
+
+ ACE_DEBUG((LM_DEBUG, "dynserver: shutting down.\n"));
+
+ runner_->end();
+ runner_.reset(0);
+
+ root_poa_->destroy(1, 1);
+ orb_->destroy();
+
+ ACE_DEBUG((LM_DEBUG, "dynserver: shut down successfully.\n"));
+
+ return 0;
+
+ } catch (Exception& e) {
+ ACE_PRINT_EXCEPTION(e, "DynServer::fini()");
+ }
+ return -1;
+}
+
+Object_ptr
+DynServer_Loader::create_object (ORB_ptr,
+ int,
+ ACE_TCHAR **
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((SystemException))
+{
+ ACE_THROW_RETURN(NO_IMPLEMENT(), Object::_nil());
+}
+
+ACE_FACTORY_DEFINE (DynServer, DynServer_Loader)
+
diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.h b/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.h
new file mode 100644
index 00000000000..c222ebe531e
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.h
@@ -0,0 +1,58 @@
+// $Id$
+#ifndef DYNSERVER_H
+#define DYNSERVER_H
+
+#include "dynserver_export.h"
+
+#include "testS.h"
+
+#include "tao/Object_Loader.h"
+
+#include "ace/Auto_Ptr.h"
+
+// Trivial test corba object
+class DynServer_Export DynServer
+ : public POA_test
+{
+ int n_;
+public:
+ DynServer(void);
+ virtual ~DynServer();
+ virtual CORBA::Long get() ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+class DynServer_ORB_Runner;
+
+// This dll supports the service configurator framework
+class DynServer_Export DynServer_Loader : public TAO_Object_Loader
+{
+public:
+ DynServer_Loader(void);
+
+ // spawns a thread to run an internal orb which has activated
+ // a single DynServer servant.
+ virtual int init (int argc, ACE_TCHAR *argv[]);
+
+ // Allows the service configurator to shutdown the orb
+ virtual int fini (void);
+
+ // Not supported
+ virtual CORBA::Object_ptr create_object (CORBA::ORB_ptr orb,
+ int argc,
+ ACE_TCHAR *argv[])
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ CORBA::ORB_var orb_;
+ PortableServer::POA_var root_poa_;
+ DynServer service_;
+ ACE_Auto_Ptr<DynServer_ORB_Runner> runner_;
+
+private:
+ ACE_UNIMPLEMENTED_FUNC (DynServer_Loader (const DynServer_Loader &))
+ ACE_UNIMPLEMENTED_FUNC (DynServer_Loader &operator = (const DynServer_Loader &))
+};
+
+ACE_FACTORY_DECLARE (DynServer, DynServer_Loader)
+
+#endif
diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver_export.h b/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver_export.h
new file mode 100644
index 00000000000..459e4532891
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver_export.h
@@ -0,0 +1,54 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl -s DynServer
+// ------------------------------
+#ifndef DYNSERVER_EXPORT_H
+#define DYNSERVER_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (DYNSERVER_HAS_DLL)
+# define DYNSERVER_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && DYNSERVER_HAS_DLL */
+
+#if !defined (DYNSERVER_HAS_DLL)
+# define DYNSERVER_HAS_DLL 1
+#endif /* ! DYNSERVER_HAS_DLL */
+
+#if defined (DYNSERVER_HAS_DLL) && (DYNSERVER_HAS_DLL == 1)
+# if defined (DYNSERVER_BUILD_DLL)
+# define DynServer_Export ACE_Proper_Export_Flag
+# define DYNSERVER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define DYNSERVER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* DYNSERVER_BUILD_DLL */
+# define DynServer_Export ACE_Proper_Import_Flag
+# define DYNSERVER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define DYNSERVER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* DYNSERVER_BUILD_DLL */
+#else /* DYNSERVER_HAS_DLL == 1 */
+# define DynServer_Export
+# define DYNSERVER_SINGLETON_DECLARATION(T)
+# define DYNSERVER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* DYNSERVER_HAS_DLL == 1 */
+
+// Set DYNSERVER_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (DYNSERVER_NTRACE)
+# if (ACE_NTRACE == 1)
+# define DYNSERVER_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define DYNSERVER_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !DYNSERVER_NTRACE */
+
+#if (DYNSERVER_NTRACE == 1)
+# define DYNSERVER_TRACE(X)
+#else /* (DYNSERVER_NTRACE == 1) */
+# define DYNSERVER_TRACE(X) ACE_TRACE_IMPL(X)
+#endif /* (DYNSERVER_NTRACE == 1) */
+
+#endif /* DYNSERVER_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/readme b/TAO/orbsvcs/examples/ImR/Combined_Service/readme
new file mode 100644
index 00000000000..e10a95336ef
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Combined_Service/readme
@@ -0,0 +1,28 @@
+Test Description:
+
+The test consists of several processes and the usual run_test.pl script.
+
+controller.exe -- This is a simple corba wrapper around the ServiceConfigurator
+ which takes -c <cmd> and -r options to run a command and
+ reload the conf file respectively.
+
+combined_service.exe -- It combines the tao imr locator, activator, and a dynamic
+ server in a single process. You can use any service
+ configurator command line options, and it also writes
+ out a combined.ior file that can be use d with the controller above.
+
+test_server.exe -- This is a simple tao server that exposes two imr-ified objects
+ called TestObject1 and TestObject2. You must start it with
+ -orbuseimr 1 as usual.
+
+dynserver.dll -- This is the same server as above, except for use with the ServiceConfigurator.
+ It exposes DynObject1 and DynObject2. This program is not currently used as
+ part of the run_test.pl
+
+test.exe -- This is a simple client that invokes the test() operation on the Test object.
+ Start it with -orbinitref Test=... It can be used against any of the
+ four objects above.
+
+There are also comments within the run_test.pl that describe the
+test and expected results at various stages.
+
diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/run_test.pl b/TAO/orbsvcs/examples/ImR/Combined_Service/run_test.pl
new file mode 100755
index 00000000000..f55689a5446
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Combined_Service/run_test.pl
@@ -0,0 +1,184 @@
+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;
+}
+
+# this matches the orbendpoint used in start_all.conf
+my $imr_corbaloc = "corbaloc::localhost:9999";
+my $imr_initref = "-orbinitref ImplRepoService=$imr_corbaloc/ImplRepoService";
+
+my $imr_start_file = PerlACE::LocalFile ("imr_status");
+my $server_start_file = PerlACE::LocalFile ("server_status");
+
+my $start_conf = PerlACE::LocalFile ("start_all.conf");
+
+my $COMB = new PerlACE::Process (PerlACE::LocalFile ("combined_service"));
+my $combined_ior = PerlACE::LocalFile ("combined.ior");
+my $cs_initref = "-orbinitref ServiceConfig=file://$combined_ior";
+
+my $SERV = new PerlACE::Process (PerlACE::LocalFile ("test_server"));
+my $test_server = $SERV->Executable ();
+
+my $IMRUTIL = new PerlACE::Process("$ACE_ROOT/bin/tao_imr");
+
+my $CLI = new PerlACE::Process ('test');
+my $test_initref = "-orbinitref Test=$imr_corbaloc";
+
+my $hostname = hostname();
+###############################################################################
+
+sub do_test
+{
+ unlink $combined_ior;
+
+ my $start_time = time();
+print STDERR "Starting comb -f $start_conf\n";
+ # First we start all the servers, including the test server
+ $COMB->Arguments("-f $start_conf");
+ my $ret = $COMB->Spawn();
+ if ($ret != 0) {
+ print "ERROR : spawning combined service.\n";
+ return $ret;
+ }
+
+ ## Wait a little bit for everything to get started
+ sleep(2);
+print STDERR "Starting test_server -orbuseimr 1 $imr_initref\n";
+
+ $SERV->Arguments("-orbuseimr 1 $imr_initref");
+ my $ret = $SERV->Spawn();
+ if ($ret != 0) {
+ print "ERROR : spawning test server.\n";
+ return $ret;
+ }
+
+ ## Wait a little bit for everything to get started
+ sleep(2);
+print STDERR "Starting client\n";
+
+ # The client should pass the simple test
+ $CLI->Arguments("$test_initref/TestObject1");
+ $ret = $CLI->SpawnWaitKill(5);
+ if ($ret != 0) {
+ print "ERROR : spawning test client 1.\n";
+ return $ret;
+ }
+
+ # The client should pass the simple test again, this time with obj #2
+ $CLI->Arguments("$test_initref/TestObject2");
+ $ret = $CLI->SpawnWaitKill(5);
+ if ($ret != 0) {
+ print "ERROR : spawning test client 2.\n";
+ return $ret;
+ }
+print STDERR "Starting imr\n";
+
+ # The server was autoregistered without any start information. We
+ # need to update the registration with a command line so that the
+ # activator can be used to re-launch it.
+ $IMRUTIL->Arguments("$imr_initref update TestObject1 -l $hostname -c \"$test_server -orbuseimr 1 $imr_initref\"");
+ $ret = $IMRUTIL->SpawnWaitKill(5);
+ if ($ret != 0) {
+ print "ERROR : Updating TestObject1 cmdline.\n";
+ return $ret;
+ }
+
+ # The new command line should now be registered, but only for TestObject1
+ $IMRUTIL->Arguments("$imr_initref list -v");
+ $ret = $IMRUTIL->SpawnWaitKill(5);
+ if ($ret != 0) {
+ print "ERROR : Listing ImR Servers.\n";
+ return $ret;
+ }
+
+ # Now we can kill the server.
+ $IMRUTIL->Arguments("$imr_initref shutdown TestObject1");
+ $ret = $IMRUTIL->SpawnWaitKill(5);
+ if ($ret != 0) {
+ print "ERROR : Shutting down test server.\n";
+ return $ret;
+ }
+
+ # Both TestObject1 and TestObject2 should now show up as "not running"
+ $IMRUTIL->Arguments("$imr_initref list -v");
+ $ret = $IMRUTIL->SpawnWaitKill(5);
+ if ($ret != 0) {
+ print "ERROR : Listing ImR Servers.\n";
+ return $ret;
+ }
+print STDERR "Starting client\n";
+
+ # The client should pass the simple test again, because the Activator will
+ # restart test_server
+ $CLI->Arguments("$test_initref/TestObject1");
+ $ret = $CLI->SpawnWaitKill(5);
+ if ($ret != 0) {
+ print "ERROR : spawning test client 3.\n";
+ return $ret;
+ }
+
+ # The client should pass the simple test again with obj #2, because both
+ # are started by the server
+ $CLI->Arguments("$test_initref/TestObject2");
+ $ret = $CLI->SpawnWaitKill(5);
+ if ($ret != 0) {
+ print "ERROR : spawning test client 4.\n";
+ return $ret;
+ }
+
+ # We have to kill the server, since $SERV most likely does
+ # not refer to the actual process anymore since a new server
+ # was started by the ImR Activator.
+ $IMRUTIL->Arguments("$imr_initref shutdown TestObject1");
+ $ret = $IMRUTIL->SpawnWaitKill(5);
+ if ($ret != 0) {
+ print "ERROR : Shutting down test server.\n";
+ return $ret;
+ }
+
+ $COMB->TerminateWaitKill(5);
+ if ($ret != 0) {
+ print "ERROR : Terminating combined service.\n";
+ return $ret;
+ }
+
+ $SERV->TerminateWaitKill(5);
+ if ($ret != 0) {
+ print "ERROR : Terminating test server.\n";
+ return $ret;
+ }
+
+ unlink $combined_ior;
+
+ return $ret;
+}
+
+my $ret = do_test();
+
+# Regardless of the return value, ensure that the processes
+# are terminated before exiting
+$CLI->Kill();
+$COMB->Kill();
+$SERV->Kill();
+
+exit $ret;
diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/service_config.idl b/TAO/orbsvcs/examples/ImR/Combined_Service/service_config.idl
new file mode 100644
index 00000000000..f4fb3363f8e
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Combined_Service/service_config.idl
@@ -0,0 +1,6 @@
+// $Id$
+// Just provides a corba interface to the ACE Service Configurator
+interface ServiceConfigurator {
+ long process_directive(in string s);
+ void reconfigure();
+};
diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/start_all.conf b/TAO/orbsvcs/examples/ImR/Combined_Service/start_all.conf
new file mode 100644
index 00000000000..23e3db5379c
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Combined_Service/start_all.conf
@@ -0,0 +1,2 @@
+dynamic ImR_Locator_Loader Service_Object * TAO_ImR_Locator:_make_ImR_Locator_Loader() '-orbcollocation no -orbobjrefstyle url -t 5 -d 2 -orbendpoint iiop://:9999'
+dynamic ImR_Activator_Loader Service_Object * TAO_ImR_Activator:_make_ImR_Activator_Loader() '-orbcollocation per-orb -d 2 -orbinitref ImplRepoService=corbaloc::localhost:9999/ImplRepoService'
diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/test.cpp b/TAO/orbsvcs/examples/ImR/Combined_Service/test.cpp
new file mode 100644
index 00000000000..0976425f762
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Combined_Service/test.cpp
@@ -0,0 +1,47 @@
+// $Id$
+// This is a simple test of an ImR using the corba interfaces
+
+#include "testC.h"
+
+#include "ace/SString.h"
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_stdio.h"
+#include <stdexcept>
+#include <string>
+
+#define assertTrue(CONDITION) \
+ if (CONDITION == false) { \
+ ACE_CString str ("Error : "#CONDITION" "__FILE__":"); \
+ char line[32]; \
+ ACE_OS::sprintf (line, "%d", __LINE__); \
+ throw std::runtime_error (str.c_str ()); \
+ }
+
+using namespace CORBA;
+
+int
+main (int argc, char* argv[])
+{
+ try
+ {
+
+ ORB_var orb = ORB_init (argc, argv);
+
+ Object_var obj = orb->resolve_initial_references ("Test");
+ test_var test = test::_narrow (obj.in ());
+ assertTrue (!is_nil (test.in ()));
+
+ Long n = test->get ();
+ Long m = test->get ();
+ assertTrue (m == n + 1);
+
+ ACE_DEBUG ((LM_DEBUG, "All tests ran successfully.\n"));
+
+ return 0;
+ }
+ catch (CORBA::Exception& e)
+ {
+ ACE_PRINT_EXCEPTION (e, "test:");
+ }
+ return 1;
+}
diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/test.idl b/TAO/orbsvcs/examples/ImR/Combined_Service/test.idl
new file mode 100644
index 00000000000..9ff40e9c6a9
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Combined_Service/test.idl
@@ -0,0 +1,4 @@
+// $Id$
+interface test {
+ long get();
+};
diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/test_server.cpp b/TAO/orbsvcs/examples/ImR/Combined_Service/test_server.cpp
new file mode 100644
index 00000000000..a3d821fde70
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/Combined_Service/test_server.cpp
@@ -0,0 +1,93 @@
+// $Id$
+// This is a simple test of an ImR using the corba interfaces
+// It uses multicast to find the ImplRepoService
+
+#include "testS.h"
+
+#include "tao/IORTable/IORTable.h"
+#include "tao/PortableServer/Root_POA.h"
+
+#include "ace/streams.h"
+#include "ace/ARGV.h"
+
+using namespace CORBA;
+using namespace PortableServer;
+
+class test_i : public virtual POA_test {
+ int n_;
+public:
+ test_i (void) : n_(0)
+ {
+ }
+ virtual ~test_i (void) {
+ }
+ virtual CORBA::Long get (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) {
+ ACE_DEBUG((LM_DEBUG, "dynserver: get() %d\n", ++n_));
+ return n_;
+ }
+};
+
+POA_ptr createPersistPOA(const char* name, POA_ptr root_poa, POAManager_ptr poaman) {
+ CORBA::PolicyList policies (2);
+ policies.length (2);
+ policies[0] = root_poa->create_id_assignment_policy(USER_ID);
+ policies[1] = root_poa->create_lifespan_policy(PERSISTENT);
+ POA_var poa = root_poa->create_POA(name, poaman, policies);
+ policies[0]->destroy();
+ policies[1]->destroy();
+ return poa._retn();
+}
+
+int main(int argc, char* argv[]) {
+
+ try {
+
+ ORB_var orb = ORB_init(argc, argv);
+
+ Object_var obj = orb->resolve_initial_references("RootPOA");
+ POA_var root_poa = POA::_narrow(obj.in());
+ POAManager_var poaman = root_poa->the_POAManager();
+ obj = orb->resolve_initial_references ("IORTable");
+ IORTable::Table_var ior_table = IORTable::Table::_narrow (obj.in());
+ ACE_ASSERT(! is_nil(ior_table.in()));
+
+ ACE_DEBUG((LM_DEBUG, "test_server: creating poas. (Registers with ImR)\n"));
+
+ POA_var poa1 = createPersistPOA("TestObject1", root_poa.in(), poaman.in());
+ POA_var poa2 = createPersistPOA("TestObject2", root_poa.in(), poaman.in());
+
+ ACE_DEBUG((LM_DEBUG, "test_server: activating objects.\n"));
+
+ test_i svt1, svt2;
+
+ ObjectId_var id = string_to_ObjectId("myobject");
+
+ poa1->activate_object_with_id(id.in(), &svt1);
+ poa2->activate_object_with_id(id.in(), &svt2);
+
+ TAO_Root_POA* tmp_poa = dynamic_cast<TAO_Root_POA*>(poa1.in());
+ obj = tmp_poa->id_to_reference_i (id.in(), false);
+ String_var ior = orb->object_to_string(obj.in());
+ ior_table->bind ("TestObject1", ior.in());
+
+ tmp_poa = dynamic_cast<TAO_Root_POA*>(poa2.in());
+ obj = tmp_poa->id_to_reference_i (id.in(), false);
+ ior = orb->object_to_string(obj.in());
+ ior_table->bind ("TestObject2", ior.in());
+
+ poaman->activate();
+
+ ACE_DEBUG((LM_DEBUG, "test_server: Running...\n"));
+
+ orb->run();
+
+ ACE_DEBUG((LM_DEBUG, "test_server: Shutting down...\n"));
+
+ root_poa->destroy(1, 1);
+ orb->destroy();
+
+ } catch (CORBA::Exception& e) {
+ ACE_PRINT_EXCEPTION(e, "TestServer::init()");
+ }
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/ImR/Makefile.am b/TAO/orbsvcs/examples/ImR/Makefile.am
new file mode 100644
index 00000000000..0b48755fb65
--- /dev/null
+++ b/TAO/orbsvcs/examples/ImR/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 = \
+ Advanced \
+ Combined_Service
+
diff --git a/TAO/orbsvcs/examples/LoadBalancing/LoadBalancing.mpc b/TAO/orbsvcs/examples/LoadBalancing/LoadBalancing.mpc
new file mode 100644
index 00000000000..3797e1cd0af
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/LoadBalancing.mpc
@@ -0,0 +1,34 @@
+// $Id$
+project(*idl) : taoidldefaults, anytypecode {
+ IDL_Files {
+ Test.idl
+ }
+ custom_only = 1
+}
+
+project(*Server): taoexe, loadbalancing, pi_server, exceptions {
+ avoids += ace_for_tao
+ after += *idl
+ Source_Files {
+ ServerRequestInterceptor.cpp
+ ORBInitializer.cpp
+ StockFactory.cpp
+ RPS_Monitor.cpp
+ Stock.cpp
+ server.cpp
+ TestS.cpp
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Client): taoclient, strategies {
+ after += *idl
+ Source_Files {
+ TestC.cpp
+ client.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/examples/LoadBalancing/Makefile.am b/TAO/orbsvcs/examples/LoadBalancing/Makefile.am
new file mode 100644
index 00000000000..b4b3d851ccb
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/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_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.LoadBalancing_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) $(srcdir)/Test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ Test.idl
+
+## Makefile.LoadBalancing_Client.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 = \
+ TestC.cpp \
+ client.cpp \
+ ORBInitializer.h \
+ RPS_Monitor.h \
+ ServerRequestInterceptor.h \
+ Stock.h \
+ StockFactory.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.LoadBalancing_Server.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+if BUILD_EXCEPTIONS
+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 = \
+ ORBInitializer.cpp \
+ RPS_Monitor.cpp \
+ ServerRequestInterceptor.cpp \
+ Stock.cpp \
+ StockFactory.cpp \
+ TestC.cpp \
+ TestS.cpp \
+ server.cpp \
+ ORBInitializer.h \
+ RPS_Monitor.h \
+ ServerRequestInterceptor.h \
+ Stock.h \
+ StockFactory.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_ACE_FOR_TAO
+endif BUILD_EXCEPTIONS
+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/examples/LoadBalancing/ORBInitializer.cpp b/TAO/orbsvcs/examples/LoadBalancing/ORBInitializer.cpp
new file mode 100644
index 00000000000..f6239df905c
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/ORBInitializer.cpp
@@ -0,0 +1,81 @@
+#include "ORBInitializer.h"
+#include "ServerRequestInterceptor.h"
+
+#include "orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.h"
+
+#include "orbsvcs/CosLoadBalancingC.h"
+#include "tao/ORB_Constants.h"
+
+
+ACE_RCSID (LoadBalancing,
+ ORBInitializer,
+ "$Id$")
+
+
+ORBInitializer::ORBInitializer (void)
+ : load_alert_ (),
+ interceptor_ (0)
+{
+}
+
+void
+ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ ACE_NEW_THROW_EX (this->interceptor_,
+ ServerRequestInterceptor,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableInterceptor::ServerRequestInterceptor_var sr_interceptor =
+ this->interceptor_;
+
+ info->add_server_request_interceptor (sr_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableInterceptor::ServerRequestInterceptor_ptr reject_interceptor;
+ ACE_NEW_THROW_EX (reject_interceptor,
+ TAO_LB_ServerRequestInterceptor (this->load_alert_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableInterceptor::ServerRequestInterceptor_var safe_reject_interceptor =
+ reject_interceptor;
+
+ info->add_server_request_interceptor (safe_reject_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+TAO_LB_LoadAlert &
+ORBInitializer::load_alert (void)
+{
+ return this->load_alert_;
+}
+
+ServerRequestInterceptor *
+ORBInitializer::interceptor (void) const
+{
+ return this->interceptor_;
+}
diff --git a/TAO/orbsvcs/examples/LoadBalancing/ORBInitializer.h b/TAO/orbsvcs/examples/LoadBalancing/ORBInitializer.h
new file mode 100644
index 00000000000..b366f733e93
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/ORBInitializer.h
@@ -0,0 +1,96 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file ORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef ORB_INITIALIZER_H
+#define ORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/LoadBalancing/LB_LoadAlert.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+#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 */
+
+
+class ServerRequestInterceptor;
+
+/**
+ * @class ORBInitializer
+ *
+ * @brief ORBInitializer
+ *
+ * ORBInitializer
+ */
+class ORBInitializer
+ : public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ ORBInitializer (void);
+
+ /**
+ * @name PortableInterceptor::ORBInitializer Methods
+ *
+ * Methods required by the PortableInterceptor::ORBInitializer
+ * interface.
+ */
+ //@{
+ 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 a reference to the LoadAlert object.
+ TAO_LB_LoadAlert & load_alert (void);
+
+ ServerRequestInterceptor * interceptor (void) const;
+
+private:
+
+ /// The CosLoadBalancing::LoadAlert servant to be used at this
+ /// location.
+ /**
+ * This is the servant supplied by TAO's Load Balancer. It is
+ * used out of convencience.
+ */
+ TAO_LB_LoadAlert load_alert_;
+
+ ServerRequestInterceptor * interceptor_;
+
+};
+
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* ORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.cpp b/TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.cpp
new file mode 100644
index 00000000000..431ebd7622f
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.cpp
@@ -0,0 +1,91 @@
+#include "RPS_Monitor.h"
+#include "ServerRequestInterceptor.h"
+#include "ace/UUID.h"
+#include "tao/ORB_Constants.h"
+#include "ace/OS_NS_sys_time.h"
+
+ACE_RCSID (LoadBalancing,
+ RPS_Monitor,
+ "$Id$")
+
+
+RPS_Monitor::RPS_Monitor (ServerRequestInterceptor * interceptor)
+ : location_ (1),
+ interceptor_ (interceptor),
+ last_time_ (ACE_OS::gettimeofday ()),
+ lock_ ()
+{
+ this->location_.length (1);
+
+ ACE_Utils::UUID_GENERATOR::instance ()->init ();
+
+ ACE_Utils::UUID uuid;
+ ACE_Utils::UUID_GENERATOR::instance ()->generateUUID (uuid);
+
+ this->location_[0].id = CORBA::string_dup (uuid.to_string ()->c_str ());
+ this->location_[0].kind = CORBA::string_dup ("UUID");
+}
+
+RPS_Monitor::~RPS_Monitor (void)
+{
+}
+
+CosLoadBalancing::Location *
+RPS_Monitor::the_location (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosLoadBalancing::Location * location;
+ ACE_NEW_THROW_EX (location,
+ CosLoadBalancing::Location (this->location_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ return location;
+}
+
+CosLoadBalancing::LoadList *
+RPS_Monitor::loads (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ const ACE_Time_Value current_time = ACE_OS::gettimeofday ();
+
+ ACE_Time_Value elapsed_time;
+
+ {
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, monitor, this->lock_, 0);
+
+ elapsed_time = current_time - this->last_time_;
+ this->last_time_ = current_time;
+ }
+
+ const CORBA::Long request_count = this->interceptor_->request_count ();
+
+ CosLoadBalancing::LoadList * tmp;
+ ACE_NEW_THROW_EX (tmp,
+ CosLoadBalancing::LoadList (1),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ CosLoadBalancing::LoadList_var load_list = tmp;
+
+ load_list->length (1);
+
+ load_list[0].id = CosLoadBalancing::RequestsPerSecond;
+
+ // VC 7.1 gives a warning without an explicit cast.
+ load_list[0].value =
+ static_cast<CORBA::Float> (request_count / elapsed_time.msec () * 1000);
+
+ // Strictly for debugging or
+ ACE_DEBUG ((LM_DEBUG, "%f\n", load_list[0].value));
+
+ return load_list._retn ();
+}
diff --git a/TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.h b/TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.h
new file mode 100644
index 00000000000..fb623e0852e
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/RPS_Monitor.h
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file RPS_Monitor.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_RPS_MONITOR_H
+#define TAO_RPS_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosLoadBalancingS.h"
+
+# if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+# endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+class ServerRequestInterceptor;
+
+/**
+ * @class RPS_Monitor
+ *
+ * @brief LoadMonitor implementation that calculates the number of
+ * request arriving per second.
+ */
+class RPS_Monitor
+ : public virtual POA_CosLoadBalancing::LoadMonitor
+{
+public:
+
+ /// Constructor
+ RPS_Monitor (ServerRequestInterceptor * interceptor);
+
+ /**
+ * @name CosLoadBalancing::LoadMonitor Methods
+ *
+ * Methods required by the CosLoadBalancing::LoadMonitor interface.
+ */
+ //@{
+
+ /// Return the location at which the LoadMonitor resides.
+ /**
+ * The returned "Location" is a sequence of length 1.
+ */
+ virtual CosLoadBalancing::Location * the_location (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the average CPU load at the location which this
+ /// LoadMonitor resides.
+ /**
+ * @return A "Load" sequence of length 1 that contains a LoadId
+ * equal to CosLoadBalancing::LoadAverage, and the average CPU
+ * load.
+ */
+ virtual CosLoadBalancing::LoadList * loads (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ //@}
+
+protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management through
+ * reference counting.
+ */
+ ~RPS_Monitor (void);
+
+private:
+
+ /// The name of the location at which this LoadMonitor resides.
+ CosLoadBalancing::Location location_;
+
+ ServerRequestInterceptor * interceptor_;
+
+ ACE_Time_Value last_time_;
+
+ ACE_SYNCH_MUTEX lock_;
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_RPS_MONITOR_H */
diff --git a/TAO/orbsvcs/examples/LoadBalancing/ServerRequestInterceptor.cpp b/TAO/orbsvcs/examples/LoadBalancing/ServerRequestInterceptor.cpp
new file mode 100644
index 00000000000..8deb50cae85
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/ServerRequestInterceptor.cpp
@@ -0,0 +1,82 @@
+#include "ServerRequestInterceptor.h"
+
+ACE_RCSID (LoadBalancing,
+ ServerRequestInterceptor,
+ "$Id$")
+
+
+ServerRequestInterceptor::ServerRequestInterceptor (void)
+ : request_count_ (0)
+{
+}
+
+ServerRequestInterceptor::~ServerRequestInterceptor (void)
+{
+}
+
+char *
+ServerRequestInterceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("ServerRequestInterceptor");
+}
+
+void
+ServerRequestInterceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ServerRequestInterceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr /* ri */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ++this->request_count_;
+}
+
+void
+ServerRequestInterceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+ServerRequestInterceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr /* ri */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ServerRequestInterceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+ServerRequestInterceptor::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+CORBA::Long
+ServerRequestInterceptor::request_count (void)
+{
+ const CORBA::Long r = this->request_count_.value ();
+ this->request_count_ = 0;
+
+ return r;
+}
diff --git a/TAO/orbsvcs/examples/LoadBalancing/ServerRequestInterceptor.h b/TAO/orbsvcs/examples/LoadBalancing/ServerRequestInterceptor.h
new file mode 100644
index 00000000000..7768134b610
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/ServerRequestInterceptor.h
@@ -0,0 +1,123 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file ServerRequestInterceptor.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SERVER_REQUEST_INTERCEPTOR_H
+#define TAO_SERVER_REQUEST_INTERCEPTOR_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PI_Server/PI_Server.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+
+#include "ace/Atomic_Op.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+class TAO_LB_LoadAlert;
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ServerRequestInterceptor
+ *
+ * @brief ServerRequestInterceptor that calculates the number of
+ * requests arriving per second.
+ *
+ * This ServerRequestInterceptor is responsible for redirecting
+ * requests back to the LoadManager.
+ */
+class ServerRequestInterceptor
+ : public virtual PortableInterceptor::ServerRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ ServerRequestInterceptor (void);
+
+ /**
+ * @name Methods Required by the ServerRequestInterceptor
+ * Interface
+ *
+ * These are the canonical methods required for all
+ * ServerRequestInterceptors.
+ */
+ //@{
+ 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));
+ //@}
+
+ CORBA::Long request_count (void);
+
+protected:
+
+ /// Destructor.
+ /**
+ * Protected destructor to enforce correct memory management via
+ * reference counting.
+ */
+ ~ServerRequestInterceptor (void);
+
+private:
+
+ /// The number of requests that have arrived on the server.
+ ACE_Atomic_Op<ACE_SYNCH_MUTEX, long> request_count_;
+
+};
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+
+#endif /* TAO_SERVER_REQUEST_INTERCEPTOR_H */
diff --git a/TAO/orbsvcs/examples/LoadBalancing/Stock.cpp b/TAO/orbsvcs/examples/LoadBalancing/Stock.cpp
new file mode 100644
index 00000000000..fd6a8f70e77
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/Stock.cpp
@@ -0,0 +1,32 @@
+//
+// $Id$
+//
+
+#include "Stock.h"
+
+Stock::Stock (const char *symbol,
+ const char *full_name,
+ CORBA::Double price)
+ : symbol_ (symbol),
+ full_name_ (full_name),
+ price_ (price)
+{
+}
+
+char *
+Stock::symbol () throw (CORBA::SystemException)
+{
+ return CORBA::string_dup (this->symbol_.c_str ());
+}
+
+char *
+Stock::full_name () throw (CORBA::SystemException)
+{
+ return CORBA::string_dup (this->full_name_.c_str ());
+}
+
+CORBA::Double
+Stock::price () throw (CORBA::SystemException)
+{
+ return this->price_;
+}
diff --git a/TAO/orbsvcs/examples/LoadBalancing/Stock.h b/TAO/orbsvcs/examples/LoadBalancing/Stock.h
new file mode 100644
index 00000000000..3a902ed5261
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/Stock.h
@@ -0,0 +1,34 @@
+//
+// $Id$
+//
+
+#ifndef STOCK_H
+#define STOCK_H
+
+#include "TestS.h"
+#include <string>
+
+class Stock
+ : public POA_Test::Stock
+{
+public:
+ Stock (const char *symbol,
+ const char *full_name,
+ CORBA::Double price);
+
+ char *symbol () throw (CORBA::SystemException);
+ char *full_name () throw (CORBA::SystemException);
+ CORBA::Double price () throw (CORBA::SystemException);
+
+private:
+#if defined (HPUX) && (ACE_HAS_STANDARD_CPP_LIBRARY == 0)
+ string symbol_;
+ string full_name_;
+#else
+ std::string symbol_;
+ std::string full_name_;
+#endif /* HPUX */
+ CORBA::Double price_;
+};
+
+#endif /* STOCK_H */
diff --git a/TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp b/TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp
new file mode 100644
index 00000000000..59c96439de0
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/StockFactory.cpp
@@ -0,0 +1,34 @@
+//
+// $Id$
+//
+
+#include "StockFactory.h"
+#include "ace/streams.h"
+
+StockFactory::StockFactory (CORBA::ORB_ptr orb, int number)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ rhat_ ("RHAT", "RedHat, Inc.", 210),
+ msft_ ("MSFT", "Microsoft, Inc.", 91),
+ number_ (number)
+{
+}
+
+Test::Stock_ptr
+StockFactory::get_stock (const char *symbol)
+ throw (Test::Invalid_Stock_Symbol)
+{
+ cout << "Server Number is " << number_ << endl;
+ if (strcmp (symbol, "RHAT") == 0) {
+ return this->rhat_._this ();
+ } else if (strcmp (symbol, "MSFT") == 0) {
+ return this->msft_._this ();
+ }
+ throw Test::Invalid_Stock_Symbol ();
+}
+
+void
+StockFactory::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/examples/LoadBalancing/StockFactory.h b/TAO/orbsvcs/examples/LoadBalancing/StockFactory.h
new file mode 100644
index 00000000000..47bf026ce81
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/StockFactory.h
@@ -0,0 +1,30 @@
+//
+// $Id$
+//
+
+#ifndef STOCKFACTORY_H
+#define STOCKFACTORY_H
+
+#include "TestS.h"
+#include "Stock.h"
+
+class StockFactory
+ : public POA_Test::StockFactory
+{
+public:
+ StockFactory (CORBA::ORB_ptr orb, int number);
+
+ Test::Stock_ptr get_stock (const char *symbol)
+ throw (Test::Invalid_Stock_Symbol);
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ CORBA::ORB_var orb_;
+ Stock rhat_;
+ Stock msft_;
+ int number_;
+};
+
+#endif /* STOCKFACTORY_H */
diff --git a/TAO/orbsvcs/examples/LoadBalancing/Test.idl b/TAO/orbsvcs/examples/LoadBalancing/Test.idl
new file mode 100644
index 00000000000..c9f270a36a3
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/Test.idl
@@ -0,0 +1,47 @@
+//
+// $Id$
+//
+
+module Test
+{
+ exception Invalid_Stock_Symbol {};
+ // Used to report an invalid stock name
+
+ // Forward declare the Stock interface
+ interface Stock;
+
+ interface StockFactory
+ {
+ // = TITLE
+ // A factory class for the stock interfaces
+ //
+ // = DESCRIPTION
+ // Return the Stock interfaces based on their names
+ //
+ Stock get_stock (in string stock_symbol)
+ raises (Invalid_Stock_Symbol);
+
+ oneway void shutdown ();
+
+ };
+
+ interface Stock
+ {
+ // = TITLE
+ // A simple interface to query the name and price of stock
+ //
+ // = DESCRIPTION
+ // Return the price and name of a single stock
+ //
+
+ readonly attribute string symbol;
+ // Get the stock symbol.
+
+ readonly attribute string full_name;
+ // Get the name.
+
+ double price ();
+ // Get the price
+
+ };
+};
diff --git a/TAO/orbsvcs/examples/LoadBalancing/client.cpp b/TAO/orbsvcs/examples/LoadBalancing/client.cpp
new file mode 100644
index 00000000000..47508dba78e
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/client.cpp
@@ -0,0 +1,110 @@
+#include "TestC.h"
+#include "ace/Get_Opt.h"
+#include "ace/streams.h"
+
+
+ACE_RCSID (LoadBalancing,
+ client,
+ "$Id$")
+
+
+const char *ior = "file://obj.ior";
+
+int niterations = 100;
+int number;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:n:i:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case 'n':
+ number = 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 "
+ "-k <ior> "
+ "-i <niterations> "
+ "\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::StockFactory_var stockfactory =
+ Test::StockFactory::_narrow (tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (stockfactory.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Nil Test::StockFactory reference <%s>\n",
+ ior),
+ 1);
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "Starting Client %d\n", number));
+
+ for (int i = 0; i < niterations; ++i)
+ {
+ Test::Stock_var stock =
+ stockfactory->get_stock ("RHAT");
+
+ CORBA::String_var full_name = stock->full_name ();
+
+ CORBA::Double price = stock->price ();
+
+ ACE_DEBUG ((LM_DEBUG, "The price of a stock in \"%s\" is $%f\n",
+ full_name.in (),
+ price));
+ }
+
+ //stockfactory->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/examples/LoadBalancing/run_test.pl b/TAO/orbsvcs/examples/LoadBalancing/run_test.pl
new file mode 100755
index 00000000000..06107b7b97d
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/run_test.pl
@@ -0,0 +1,105 @@
+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;
+$ns_ior = "ns.ior";
+unlink $ns_ior;
+
+$status = 0;
+
+$init_ref = "-ORBInitRef LoadManager=file://lm.ior -n 1 -ORBInitRef NameService=file://ns.ior -s LeastLoaded -r 9000 -c 10300 -d 0.1 ";
+$init_ref_backup = "-ORBInitRef LoadManager=file://lm.ior -n 2 -ORBInitRef NameService=file://ns.ior -s LeastLoaded -r 9000 -c 10300 -d 0.1 ";
+
+$init_client_ref = "-k file://$iorfile -i 5 -n 1 -ORBInitRef NameService=file://ns.ior ";
+$init_client_ref_backup = "-k file://$iorfile -i 5 -n 2 -ORBInitRef NameService=file://ns.ior ";
+
+$LM = new PerlACE::Process ("../../LoadBalancer/LoadManager", "-o lm.ior");
+$NS = new PerlACE::Process ("../../Naming_Service/Naming_Service", "-o ns.ior");
+$SV = new PerlACE::Process ("server", $init_ref);
+$SR = new PerlACE::Process ("server", $init_ref_backup);
+$CL = new PerlACE::Process ("client", $init_client_ref);
+$CR = new PerlACE::Process ("client", $init_client_ref_backup);
+
+$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;
+}
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ("ns.ior", 5) == -1) {
+ print STDERR "ERROR: cannot find file NameService IOR: ns.ior\n";
+ $NS->Kill (); $NS->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;
+}
+
+$SR->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 10) == -1) {
+ print STDERR "ERROR: cannot find server file <$iorfile>\n";
+ $SR->Kill (); $SR->TimedWait (1);
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (100);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$clientbackup = $CR->SpawnWaitKill (100);
+
+if ($clientbackup != 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;
+}
+
+$name_service = $NS->TerminateWaitKill (10);
+
+if ($name_service != 0) {
+ print STDERR "ERROR: NameService returned $name_service\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+unlink $lm_ior;
+unlink $ns_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/examples/LoadBalancing/server.cpp b/TAO/orbsvcs/examples/LoadBalancing/server.cpp
new file mode 100644
index 00000000000..66d41596ce8
--- /dev/null
+++ b/TAO/orbsvcs/examples/LoadBalancing/server.cpp
@@ -0,0 +1,370 @@
+#include "tao/ORBInitializer_Registry.h"
+#include "StockFactory.h"
+#include "ORBInitializer.h"
+#include "RPS_Monitor.h"
+#include "ace/OS.h"
+
+#include "ace/Get_Opt.h"
+
+ACE_RCSID (LoadBalancing,
+ server,
+ "$Id$")
+
+const char *ior_output_file = "obj.ior";
+
+CORBA::Float reject_threshold = 0;
+CORBA::Float critical_threshold = 0;
+CORBA::Float dampening = 0;
+const char * strategy = "LeastLoaded";
+int number;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:n:s:r:c:d:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+
+ case 's':
+ strategy = get_opts.opt_arg ();
+ break;
+
+ case 'n':
+ number = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'r':
+ reject_threshold =
+ static_cast<CORBA::Float> (::atof (get_opts.opt_arg ()));
+ break;
+
+ case 'c':
+ critical_threshold =
+ static_cast<CORBA::Float> (::atof (get_opts.opt_arg ()));
+ break;
+
+ case 'd':
+ dampening =
+ static_cast<CORBA::Float> (::atof (get_opts.opt_arg ()));
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s\n"
+ " -o <iorfile>\n"
+ " -s <RoundRobin | Random | LeastLoaded>\n"
+ " -r <reject threshold> (LeastLoaded only)\n"
+ " -c <critical threshold> (LeastLoaded only)\n"
+ " -d <damping value> (LeastLoaded only)\n"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+CORBA::Object_ptr
+join_object_group (CORBA::ORB_ptr orb,
+ CosLoadBalancing::LoadManager_ptr lm,
+ const PortableGroup::Location & location
+ ACE_ENV_ARG_PARAMETER)
+{
+ CORBA::Object_var ns_object =
+ orb->resolve_initial_references ("NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ CosNaming::NamingContext_var nc =
+ CosNaming::NamingContext::_narrow (ns_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ CosNaming::Name name (1);
+ name.length (1);
+
+ name[0].id = "StockFactoryObjectGroup";
+ name[0].kind = "Object Group";
+
+ CORBA::Object_var group;
+
+ ACE_TRY
+ {
+ group = nc->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ // Object group not created. Create one.
+ const char repository_id[] = "IDL:Test/StockFactory: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 ("omg.org.PortableGroup.MembershipStyle");
+
+ PortableGroup::MembershipStyleValue msv =
+ PortableGroup::MEMB_APP_CTRL;
+ property.val <<= msv;
+
+ PortableGroup::GenericFactory::FactoryCreationId_var fcid;
+
+ group = lm->create_object (repository_id,
+ criteria,
+ fcid.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TRY_EX (foo)
+ {
+ nc->bind (name,
+ group.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (foo);
+
+ PortableGroup::Properties props (1);
+ props.length (1);
+ props[0].nam.length (1);
+ props[0].nam[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.StrategyInfo");
+
+ CosLoadBalancing::StrategyInfo strategy_info;
+
+ strategy_info.name = CORBA::string_dup (strategy);
+
+ if (ACE_OS::strcasecmp (strategy, "LeastLoaded") == 0
+ && (reject_threshold != 0
+ || critical_threshold != 0
+ || dampening != 0))
+ {
+ CORBA::ULong len = 1;
+
+ PortableGroup::Properties & props =
+ strategy_info.props;
+
+ if (reject_threshold != 0)
+ {
+ const CORBA::ULong i = len - 1;
+
+ props.length (len++);
+
+ props[i].nam.length (1);
+ props[i].nam[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.Strategy.LeastLoaded.RejectThreshold");
+ props[i].val <<= reject_threshold;
+ }
+
+ if (critical_threshold != 0)
+ {
+ const CORBA::ULong i = len - 1;
+
+ props.length (len++);
+
+ props[i].nam.length (1);
+ props[i].nam[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.Strategy.LeastLoaded.CriticalThreshold");
+ props[i].val <<= critical_threshold;
+ }
+
+ if (dampening != 0)
+ {
+ const CORBA::ULong i = len - 1;
+
+ props.length (len++);
+
+ props[i].nam.length (1);
+ props[i].nam[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.Strategy.LeastLoaded.Dampening");
+ props[i].val <<= dampening;
+ }
+
+ }
+
+ props[0].val <<= strategy_info;
+
+ lm->set_default_properties (props
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound, ex)
+ {
+ // Somebody beat us to creating the object group. Clean up
+ // the one we created.
+ lm->delete_object (fcid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (foo);
+
+ group = nc->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (foo);
+ }
+ ACE_ENDTRY;
+ ACE_TRY_CHECK;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ StockFactory * stockfactory_impl;
+ ACE_NEW_THROW_EX (stockfactory_impl,
+ StockFactory (orb, number),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ PortableServer::ServantBase_var owner_transfer (stockfactory_impl);
+
+ Test::StockFactory_var stockfactory =
+ stockfactory_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ group = lm->add_member (group.in (),
+ location,
+ stockfactory.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ return group._retn ();
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ ORBInitializer *initializer = 0;
+ ACE_NEW_RETURN (initializer,
+ ORBInitializer,
+ -1); // No exceptions yet!
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ 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;
+
+ 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;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var lm_object =
+ orb->resolve_initial_references ("LoadManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosLoadBalancing::LoadManager_var load_manager =
+ CosLoadBalancing::LoadManager::_narrow (lm_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RPS_Monitor * monitor_servant;
+ ACE_NEW_THROW_EX (monitor_servant,
+ RPS_Monitor (initializer->interceptor ()),
+ CORBA::NO_MEMORY ());
+ ACE_TRY_CHECK;
+
+ PortableServer::ServantBase_var safe_monitor_servant (monitor_servant);
+
+ CosLoadBalancing::LoadMonitor_var load_monitor =
+ monitor_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableGroup::Location_var location =
+ load_monitor->the_location (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var stockfactory =
+ ::join_object_group (orb.in (),
+ load_manager.in (),
+ location.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_LB_LoadAlert & alert_servant = initializer->load_alert ();
+
+ CosLoadBalancing::LoadAlert_var load_alert =
+ alert_servant._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ CORBA::String_var ior =
+ orb->object_to_string (stockfactory.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", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ load_manager->register_load_monitor (location.in (),
+ load_monitor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ load_manager->register_load_alert (location.in (),
+ load_alert.in ()
+ ACE_ENV_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,
+ "lb_server exception");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/Log/Basic/Log_Basic.mpc b/TAO/orbsvcs/examples/Log/Basic/Log_Basic.mpc
new file mode 100644
index 00000000000..73476b098d4
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Basic/Log_Basic.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Client) : orbsvcsexe, dslogadmin, naming {
+ exename = client
+}
diff --git a/TAO/orbsvcs/examples/Log/Basic/Makefile.am b/TAO/orbsvcs/examples/Log/Basic/Makefile.am
new file mode 100644
index 00000000000..9d3b10cddcc
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Basic/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.Log_Basic_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 = \
+ TLS_Client.cpp \
+ main.cpp \
+ TLS_Client.h
+
+client_LDADD = \
+ $(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/examples/Log/Basic/README b/TAO/orbsvcs/examples/Log/Basic/README
new file mode 100644
index 00000000000..573d86b75cb
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Basic/README
@@ -0,0 +1,17 @@
+// $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) ./tls_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/examples/Log/Basic/TLS_Client.cpp b/TAO/orbsvcs/examples/Log/Basic/TLS_Client.cpp
new file mode 100644
index 00000000000..6c4fd3a47b3
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Basic/TLS_Client.cpp
@@ -0,0 +1,198 @@
+#include "TLS_Client.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID (Basic,
+ TLS_Client,
+ "$Id$")
+
+#define NAMING_SERVICE_NAME "NameService"
+#define BASIC_TLS_LOG_FACTORY_NAME "BasicLogFactory"
+#define LOG_EVENT_COUNT 9
+#define QUERY_1 "id < 5"
+#define QUERY_2 "id >= 0"
+#define QUERY_LANG "TCL"
+
+
+
+TLS_Client::TLS_Client (void)
+{
+ // No-Op.
+}
+
+TLS_Client::~TLS_Client ()
+{
+ // No-Op.
+}
+
+void
+TLS_Client::init (int argc, char *argv [] ACE_ENV_ARG_DECL)
+{
+ init_ORB (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ resolve_TLS_Basic_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TLS_Client::init_ORB (int argc,
+ char *argv []
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TLS_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
+TLS_Client::resolve_TLS_Basic_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (BASIC_TLS_LOG_FACTORY_NAME);
+
+ CORBA::Object_var obj =
+ this->naming_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->basic_log_factory_ =
+ DsLogAdmin::BasicLogFactory::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TLS_Client::run_tests (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (this->basic_log_factory_.in ()));
+
+ // create a log..
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\nCalling BasicLogFactory::create...\n"));
+
+ DsLogAdmin::LogFullActionType logfullaction = DsLogAdmin::halt;
+ CORBA::ULongLong max_size = 0; // 0 means "infinite"
+
+ DsLogAdmin::LogId logid = 0;
+
+ DsLogAdmin::BasicLog_var basic_log =
+ this->basic_log_factory_->create (logfullaction,
+ max_size,
+ logid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Create returned logid = %d\n",logid));
+
+ // Create some fake log events.
+ DsLogAdmin::Anys any_seq (LOG_EVENT_COUNT);
+ any_seq.length (LOG_EVENT_COUNT);
+
+ for (int i = 0; i < LOG_EVENT_COUNT; i++)
+ {
+ any_seq [i] <<= "Foo";
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Writing %d records...\n", LOG_EVENT_COUNT));
+ basic_log->write_records (any_seq ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Calling BasicLog::get_n_records...\n"));
+#ifndef ACE_LACKS_LONGLONG_T
+ CORBA::ULongLong retval = basic_log->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+#else
+ CORBA::Long retval = basic_log->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Number of records in Log = %d \n", retval));
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Calling BasicLog::get_current_size...\n"));
+#ifndef ACE_LACKS_LONGLONG_T
+ retval = basic_log->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+#else
+ retval = basic_log->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Size of data in Log = %d \n", retval));
+
+ ACE_DEBUG ((LM_DEBUG, "Querying the Log: %s\n", QUERY_1));
+ DsLogAdmin::Iterator_var iter_out;
+ DsLogAdmin::RecordList_var rec_list =
+ basic_log->query (QUERY_LANG, QUERY_1, 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
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Deleting records... \n"));
+
+ retval = basic_log->delete_records (QUERY_LANG, QUERY_2 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Calling BasicLog::get_n_records...\n"));
+#ifndef ACE_LACKS_LONGLONG_T
+ retval = basic_log->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+#else
+ retval = basic_log->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Number of records in Log after delete = %d \n",
+ retval));
+
+ ACE_DEBUG ((LM_DEBUG, "Geting the current_size again...\n"));
+#ifndef ACE_LACKS_LONGLONG_T
+ retval = basic_log->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+#else
+ retval = basic_log->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Size of data in Log = %d \n", retval));
+
+ basic_log->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/examples/Log/Basic/TLS_Client.h b/TAO/orbsvcs/examples/Log/Basic/TLS_Client.h
new file mode 100644
index 00000000000..b06ffc65f92
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Basic/TLS_Client.h
@@ -0,0 +1,63 @@
+/* -*- C++ -*- */
+
+// ============================================================================
+/**
+ * @file TLS_Client.h
+ *
+ * $Id$
+ *
+ * An example of using the Basic_Logging_Service
+ *
+ *
+ *
+ * @author D A Hanvey (d.hanvey@qub.ac.uk)
+ */
+// ============================================================================
+
+#ifndef TLS_CLIENT_H
+#define TLS_CLIENT_H
+
+#include "orbsvcs/DsLogAdminC.h"
+#include "orbsvcs/CosNamingC.h"
+
+class TLS_Client
+{
+ // = TITLE
+ // Telecom Log Service Client
+ // = DESCRIPTION
+ // This client demonstates how to use the log service.
+ public:
+ // = Initialization and Termination
+ TLS_Client (void);
+ ~TLS_Client ();
+
+ void init (int argc, char *argv [] ACE_ENV_ARG_DECL);
+ // Init the Client.
+
+ void run_tests (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the tests..
+
+ 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_TLS_Basic_factory (ACE_ENV_SINGLE_ARG_DECL);
+ // Try to resolve the TLS factory from the Naming service.
+
+ // = Data Members
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ CosNaming::NamingContext_var naming_context_;
+ // Handle to the name service.
+
+ DsLogAdmin::BasicLogFactory_var basic_log_factory_;
+ // The basic log factory from the Log Service.
+
+
+
+};
+#endif /* TLS_CLIENT_H */
diff --git a/TAO/orbsvcs/examples/Log/Basic/main.cpp b/TAO/orbsvcs/examples/Log/Basic/main.cpp
new file mode 100644
index 00000000000..3b5098b43ad
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Basic/main.cpp
@@ -0,0 +1,39 @@
+#include "TLS_Client.h"
+#include "ace/OS_main.h"
+
+ACE_RCSID (Basic,
+ main,
+ "$Id$")
+
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ TLS_Client client; // Telecom Log Service Client
+
+ ACE_TRY_NEW_ENV
+ {
+ client.init (argc, argv
+ ACE_ENV_ARG_PARAMETER); //Init the Client
+ ACE_TRY_CHECK;
+
+ client.run_tests (ACE_ENV_SINGLE_ARG_PARAMETER); //Init the Client
+
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::UserException, ue)
+ {
+ ACE_PRINT_EXCEPTION (ue,
+ "TLS_Client user error: ");
+ return 1;
+ }
+ ACE_CATCH (CORBA::SystemException, se)
+ {
+ ACE_PRINT_EXCEPTION (se,
+ "TLS_Client system error: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/Log/Basic/run_test.pl b/TAO/orbsvcs/examples/Log/Basic/run_test.pl
new file mode 100755
index 00000000000..8cd52e4559d
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Basic/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/examples/Log/Event/Event_Consumer.cpp b/TAO/orbsvcs/examples/Log/Event/Event_Consumer.cpp
new file mode 100644
index 00000000000..1b102beac2f
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Event/Event_Consumer.cpp
@@ -0,0 +1,131 @@
+#include "Event_Consumer.h"
+#include "orbsvcs/CosEventChannelAdminS.h"
+#include "ace/OS_main.h"
+
+ACE_RCSID (Event,
+ Event_Consumer,
+ "$Id$")
+
+#define NAMING_SERVICE_NAME "NameService"
+#define EVENT_TLS_LOG_FACTORY_NAME "EventLogFactory"
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ Consumer consumer;
+
+ return consumer.run (argc, argv);
+}
+
+// ****************************************************************
+
+Consumer::Consumer (void)
+ : event_count_ (0)
+{
+}
+
+int
+Consumer::run (int argc, char* argv[])
+{
+ 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;
+
+ // Do *NOT* make a copy because we don't want the ORB to outlive
+ // the Consumer object.
+ this->orb_ = orb.in ();
+
+ 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;
+
+ // Obtain the event channel
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references (NAMING_SERVICE_NAME
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Need to check return value for errors.
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_THROW_RETURN (CORBA::UNKNOWN (),0);
+
+ this->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 (EVENT_TLS_LOG_FACTORY_NAME);
+
+ CORBA::Object_var obj =
+ this->naming_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->event_log_factory_ =
+ DsEventLogAdmin::EventLogFactory::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->supplier_ =
+ this->event_log_factory_->obtain_push_supplier ();
+
+ CosEventComm::PushConsumer_var consumer =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->supplier_->connect_push_consumer (consumer.in () ACE_ENV_ARG_PARAMETER);
+
+ orb_->run ();
+
+ // We don't do any cleanup, it is hard to do it after shutdown,
+ // and would complicate the example; plus it is almost
+ // impossible to do cleanup after ORB->run() because the POA is
+ // in the holding state. Applications should use
+ // work_pending()/perform_work() to do more interesting stuff.
+ // Check the supplier for the proper way to do cleanup.
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Consumer::run");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+Consumer::push (const CORBA::Any &
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ this->event_count_ ++;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Consumer (%P|%t): %d log generated events received\n",
+ this->event_count_));
+
+}
+
+void
+Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // In this example we shutdown the ORB when we disconnect from the
+ // EC (or rather the EC disconnects from us), but this doesn't have
+ // to be the case....
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
diff --git a/TAO/orbsvcs/examples/Log/Event/Event_Consumer.h b/TAO/orbsvcs/examples/Log/Event/Event_Consumer.h
new file mode 100644
index 00000000000..946299dc55d
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Event/Event_Consumer.h
@@ -0,0 +1,74 @@
+/* -*- C++ -*- */
+
+// ============================================================================
+/**
+ * @file Event_Consumer.h
+ *
+ * $Id$
+ *
+ * An example of using the Event_Logging_Service.
+ * The Event_Consumer consumes log-generated events.
+ *
+ *
+ * @author D A Hanvey (d.hanvey@qub.ac.uk)
+ */
+// ============================================================================
+
+#ifndef EVENT_CONSUMER_H
+#define EVENT_CONSUMER_H
+
+#include "orbsvcs/DsEventLogAdminC.h"
+#include "orbsvcs/CosEventCommS.h"
+#include "orbsvcs/CosNamingC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Consumer : public POA_CosEventComm::PushConsumer
+{
+ // = TITLE
+ // Simple consumer object
+ //
+ // = DESCRIPTION
+ // This class is a consumer of log generated events.
+ //
+public:
+ Consumer (void);
+ // Constructor
+
+ int run (int argc, char* argv[]);
+ // Run the test
+
+ // = The CosEventComm::PushConsumer methods
+
+ virtual void push (const CORBA::Any &event
+ 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));
+ // The skeleton methods.
+
+private:
+
+ // = Data Members
+ CORBA::ULong event_count_;
+ // Keep track of the number of events received.
+
+ CORBA::ORB_var orb_;
+ // The orb, just a pointer because the ORB does not outlive the
+ // run() method...
+
+ CosNaming::NamingContext_var naming_context_;
+ // Handle to the name service.
+
+ DsEventLogAdmin::EventLogFactory_var event_log_factory_;
+ // The Event Log Factory that generates the events to be consumed.
+
+ CosEventChannelAdmin::ProxyPushSupplier_var supplier_;
+ // The proxy that we are connected to.
+
+};
+
+#endif /* EVENT_CONSUMER_H */
diff --git a/TAO/orbsvcs/examples/Log/Event/Event_Supplier.cpp b/TAO/orbsvcs/examples/Log/Event/Event_Supplier.cpp
new file mode 100644
index 00000000000..f65f4a420e9
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Event/Event_Supplier.cpp
@@ -0,0 +1,240 @@
+#include "Event_Supplier.h"
+#include "orbsvcs/CosEventChannelAdminS.h"
+#include "ace/OS_main.h"
+
+ACE_RCSID (Event,
+ Event_Supplier,
+ "$Id$")
+
+#define NAMING_SERVICE_NAME "NameService"
+#define EVENT_TLS_LOG_FACTORY_NAME "EventLogFactory"
+#define LOG_EVENT_COUNT 9
+#define QUERY_1 "id > 0"
+#define QUERY_2 "id >= 0"
+#define QUERY_LANG "TCL"
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ Supplier supplier;
+
+ return supplier.run (argc, argv);
+}
+
+// ****************************************************************
+
+Supplier::Supplier (void)
+{
+}
+
+int
+Supplier::run (int argc, char* argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ this->orb_ =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ this->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;
+
+
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references (NAMING_SERVICE_NAME
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Need to check return value for errors.
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_THROW_RETURN (CORBA::UNKNOWN (), 0);
+
+ this->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 (EVENT_TLS_LOG_FACTORY_NAME);
+
+ CORBA::Object_var obj =
+ this->naming_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->event_log_factory_ =
+ DsEventLogAdmin::EventLogFactory::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (this->event_log_factory_.in ()));
+
+
+ // create a log..
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\nCalling EventLogFactory::create...\n"));
+
+ DsLogAdmin::LogFullActionType logfullaction = DsLogAdmin::halt;
+ DsLogAdmin::CapacityAlarmThresholdList threshold = 0;
+ CORBA::ULongLong max_size = 0; // 0 means "infinite"
+
+ DsLogAdmin::LogId logid = 0;
+
+ DsEventLogAdmin::EventLog_var event_log =
+ // DsLogAdmin::Log_var event_log =
+ this->event_log_factory_->create (logfullaction,
+ max_size,
+ threshold,
+ logid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Create returned logid = %d\n",logid));
+
+ CosEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_log->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->consumer_ =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ CosEventComm::PushSupplier_var supplier =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ this->consumer_->connect_push_supplier (supplier.in () ACE_ENV_ARG_PARAMETER);
+
+ // Create some fake log events.
+ CORBA::Any event;
+ event <<= CORBA::ULong (10);
+
+ for (int d = 0; d < LOG_EVENT_COUNT; d++)
+ {
+ this->consumer_->push (event ACE_ENV_ARG_PARAMETER);
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Writing %d records...\n", LOG_EVENT_COUNT));
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Calling EventLog::get_n_records...\n"));
+#ifndef ACE_LACKS_LONGLONG_T
+ CORBA::ULongLong retval = event_log->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#else
+ CORBA::Long retval = event_log->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_TRY_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Number of records in Log = %d \n", retval));
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Calling EventLog::get_current_size...\n"));
+#ifndef ACE_LACKS_LONGLONG_T
+ retval = event_log->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#else
+ retval = event_log->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_TRY_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Size of data in Log = %d \n", retval));
+
+ ACE_DEBUG ((LM_DEBUG, "Querying the Log: %s\n", QUERY_1));
+ DsLogAdmin::Iterator_var iter_out;
+ DsLogAdmin::RecordList_var rec_list =
+ event_log->query (QUERY_LANG, QUERY_1, iter_out);
+
+ CORBA::ULong j = 0;
+ for (; j < rec_list->length();++j)
+#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
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Deleting records... \n"));
+
+ retval = event_log->delete_records (QUERY_LANG, QUERY_2 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Calling EventLog::get_n_records...\n"));
+#ifndef ACE_LACKS_LONGLONG_T
+ retval = event_log->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#else
+ retval = event_log->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_TRY_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Number of records in Log after delete = %d \n",
+ retval));
+
+ ACE_DEBUG ((LM_DEBUG, "Geting the current_size again...\n"));
+#ifndef ACE_LACKS_LONGLONG_T
+ retval = event_log->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#else
+ retval = event_log->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_TRY_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Size of data in Log = %d \n", retval));
+
+ // Disconnect from the EC
+ this->consumer_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Destroy the EC....
+ //event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ event_log->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Deactivate this object...
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Destroy the POA
+ poa->destroy (1, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Supplier::run");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
diff --git a/TAO/orbsvcs/examples/Log/Event/Event_Supplier.h b/TAO/orbsvcs/examples/Log/Event/Event_Supplier.h
new file mode 100644
index 00000000000..c37b9a5c9df
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Event/Event_Supplier.h
@@ -0,0 +1,66 @@
+/* -*- C++ -*- */
+
+// ============================================================================
+/**
+ * @file Event_Supplier.h
+ *
+ * $Id$
+ *
+ * An example of using the Event_Logging_Service.
+ *
+ *
+ *
+ * @author D A Hanvey (d.hanvey@qub.ac.uk)
+ */
+// ============================================================================
+
+#ifndef EVENT_SUPPLIER_H
+#define EVENT_SUPPLIER_H
+
+#include "orbsvcs/DsEventLogAdminC.h"
+#include "orbsvcs/CosEventCommS.h"
+#include "orbsvcs/CosNamingC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Supplier : public POA_CosEventComm::PushSupplier
+{
+ // = TITLE
+ // Simple supplier object
+ //
+ // = DESCRIPTION
+ // This class is a supplier of events.
+ //
+public:
+ Supplier (void);
+ // Constructor
+
+ int run (int argc, char* argv[]);
+ // Run the test
+
+ // = The CosEventComm::PushSupplier methods
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The skeleton methods.
+
+private:
+
+ // = Data Members
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ CosNaming::NamingContext_var naming_context_;
+ // Handle to the name service.
+
+ DsEventLogAdmin::EventLogFactory_var event_log_factory_;
+ // The Event Log Factory that generates the events to be consumed.
+
+ CosEventChannelAdmin::ProxyPushConsumer_var consumer_;
+ // The proxy that we are connected to.
+
+};
+
+#endif /* EVENT_SUPPLIER_H */
diff --git a/TAO/orbsvcs/examples/Log/Event/Log_Event.mpc b/TAO/orbsvcs/examples/Log/Event/Log_Event.mpc
new file mode 100644
index 00000000000..c96507ed65c
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Event/Log_Event.mpc
@@ -0,0 +1,16 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Consumer) : orbsvcsexe, dseventlogadmin, event_skel, naming {
+ exename = Event_Consumer
+ source_files {
+ Event_Consumer.cpp
+ }
+}
+
+project(*Supplier) : orbsvcsexe, dseventlogadmin, event_skel, naming {
+ exename = Event_Supplier
+ source_files {
+ Event_Supplier.cpp
+ }
+}
diff --git a/TAO/orbsvcs/examples/Log/Event/Makefile.am b/TAO/orbsvcs/examples/Log/Event/Makefile.am
new file mode 100644
index 00000000000..5fad8b3b991
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Event/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.Log_Event_Consumer.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Event_Consumer
+
+Event_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
+
+Event_Consumer_SOURCES = \
+ Event_Consumer.cpp \
+ Event_Consumer.h
+
+Event_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsEventLogAdmin.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Makefile.Log_Event_Supplier.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Event_Supplier
+
+Event_Supplier_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
+
+Event_Supplier_SOURCES = \
+ Event_Supplier.cpp \
+ Event_Supplier.h
+
+Event_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsEventLogAdmin.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin.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/examples/Log/Event/README b/TAO/orbsvcs/examples/Log/Event/README
new file mode 100644
index 00000000000..ab49cd6d438
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Event/README
@@ -0,0 +1,18 @@
+// $Id$
+
+Telecom Log Service (TLS) Client example
+----------------------------------------
+This is a simple example example to show how to create an event 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 Event Logging Service, $TAO_ROOT/orbsvcs/Logging_Service/Event_Logging_Service
+3) To collect log-generated events you will need to run, ./Event_Consumer
+4) To run the sample log events run, ./Event_Supplier
+
+The client locates the log service factory from the naming service.
+Then it creates a DsEventLogAdmin::EventLog 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/examples/Log/Event/run_test.pl b/TAO/orbsvcs/examples/Log/Event/run_test.pl
new file mode 100755
index 00000000000..5d7a369ed5d
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Event/run_test.pl
@@ -0,0 +1,67 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $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/Event_Logging_Service/Event_Logging_Service", "-ORBInitRef NameService=file://$nsior");
+$consumer = new PerlACE::Process ("Event_Consumer", "-ORBInitRef NameService=file://$nsior");
+$supplier = new PerlACE::Process ("Event_Supplier", "-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 naming service.
+sleep (5);
+
+print STDERR "Starting Consumer\n";
+
+$consumer->Spawn ();
+
+sleep (1);
+
+print STDERR "Starting Supplier\n";
+
+$supplier->Spawn ();
+
+
+$supplier->WaitKill (5);
+
+$consumer->Kill ();
+
+$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/examples/Log/Makefile.am b/TAO/orbsvcs/examples/Log/Makefile.am
new file mode 100644
index 00000000000..2ce0dbc980d
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/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 = \
+ Basic \
+ Event \
+ Notify \
+ RTEvent
+
diff --git a/TAO/orbsvcs/examples/Log/Notify/Log_Notify.mpc b/TAO/orbsvcs/examples/Log/Notify/Log_Notify.mpc
new file mode 100644
index 00000000000..9082517a64c
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Notify/Log_Notify.mpc
@@ -0,0 +1,16 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Consumer) : orbsvcsexe, dsnotifylogadmin, notification_skel, naming {
+ exename = Notify_Consumer
+ source_files {
+ Notify_Consumer.cpp
+ }
+}
+
+project(*Supplier) : orbsvcsexe, dsnotifylogadmin, notification_skel, naming {
+ exename = Notify_Supplier
+ source_files {
+ Notify_Supplier.cpp
+ }
+}
diff --git a/TAO/orbsvcs/examples/Log/Notify/Makefile.am b/TAO/orbsvcs/examples/Log/Notify/Makefile.am
new file mode 100644
index 00000000000..46d235ac030
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Notify/Makefile.am
@@ -0,0 +1,94 @@
+## 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.Log_Notify_Consumer.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Notify_Consumer
+
+Notify_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
+
+Notify_Consumer_SOURCES = \
+ Notify_Consumer.cpp \
+ Notify_Consumer.h
+
+Notify_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.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_DsNotifyLogAdmin.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsEventLogAdmin.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Makefile.Log_Notify_Supplier.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Notify_Supplier
+
+Notify_Supplier_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
+
+Notify_Supplier_SOURCES = \
+ Notify_Supplier.cpp \
+ Notify_Supplier.h
+
+Notify_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.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_DsNotifyLogAdmin.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsEventLogAdmin.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin.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/examples/Log/Notify/Notify_Consumer.cpp b/TAO/orbsvcs/examples/Log/Notify/Notify_Consumer.cpp
new file mode 100644
index 00000000000..0d27c8860d3
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Notify/Notify_Consumer.cpp
@@ -0,0 +1,174 @@
+#include "Notify_Consumer.h"
+#include "orbsvcs/CosEventChannelAdminS.h"
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "ace/OS_main.h"
+
+ACE_RCSID (Notify,
+ Notify_Consumer,
+ "$Id$")
+
+#define NAMING_SERVICE_NAME "NameService"
+#define NOTIFY_TLS_LOG_FACTORY_NAME "NotifyLogFactory"
+#define LOG_EVENT_COUNT 29
+#define QUERY_1 "id > 0"
+#define QUERY_2 "id >= 0"
+#define QUERY_LANG "TCL"
+#define SA_FILTER "threshold > 10"
+#define TCL_GRAMMAR "TCL"
+#define EVENTS_TO_SEND 30
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ Consumer consumer;
+
+ return consumer.run (argc, argv);
+}
+
+// ****************************************************************
+
+Consumer::Consumer (void)
+ : event_count_ (0)
+{
+}
+
+int
+Consumer::run (int argc, char* argv[])
+{
+ 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;
+
+ // Do *NOT* make a copy because we don't want the ORB to outlive
+ // the Consumer object.
+ this->orb_ = orb.in ();
+
+ 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;
+
+ // Obtain the event channel
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references (NAMING_SERVICE_NAME
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Need to check return value for errors.
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_THROW_RETURN (CORBA::UNKNOWN (), 0);
+
+ this->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 (NOTIFY_TLS_LOG_FACTORY_NAME);
+
+ CORBA::Object_var obj =
+ this->naming_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->notify_log_factory_ =
+ DsNotifyLogAdmin::NotifyLogFactory::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyComm::PushConsumer_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (objref.in ()));
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier =
+ this->notify_log_factory_->obtain_notification_push_supplier (CosNotifyChannelAdmin::ANY_EVENT, proxy_supplier_id_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (proxysupplier.in ()));
+
+
+ this->proxy_supplier_ =
+ CosNotifyChannelAdmin::ProxyPushSupplier::
+ _narrow (proxysupplier.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (proxy_supplier_.in ()));
+
+ proxy_supplier_->connect_any_push_consumer (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb_->run ();
+
+ // We don't do any cleanup, it is hard to do it after shutdown,
+ // and would complicate the example; plus it is almost
+ // impossible to do cleanup after ORB->run() because the POA is
+ // in the holding state. Applications should use
+ // work_pending()/perform_work() to do more interesting stuff.
+ // Check the supplier for the proper way to do cleanup.
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Consumer::run");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+Consumer::push (const CORBA::Any &event
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ ACE_UNUSED_ARG (event);
+
+ this->event_count_ ++;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Consumer (%P|%t): %d log generated events received\n",
+ this->event_count_));
+}
+
+void
+Consumer::disconnect_push_consumer
+ (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ this->proxy_supplier_->
+ disconnect_push_supplier(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Consumer::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.
+}
+
diff --git a/TAO/orbsvcs/examples/Log/Notify/Notify_Consumer.h b/TAO/orbsvcs/examples/Log/Notify/Notify_Consumer.h
new file mode 100644
index 00000000000..0a125e95824
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Notify/Notify_Consumer.h
@@ -0,0 +1,100 @@
+/* -*- C++ -*- */
+
+// ============================================================================
+/**
+ * @file Notify_Consumer.h
+ *
+ * $Id$
+ *
+ * An example of using the Notify_Logging_Service.
+ * The Notify_Consumer consumes log-generated events.
+ *
+ *
+ * @author D A Hanvey (d.hanvey@qub.ac.uk)
+ */
+// ============================================================================
+
+#ifndef NOTIFY_CONSUMER_H
+#define NOTIFY_CONSUMER_H
+
+#include "orbsvcs/DsNotifyLogAdminS.h"
+#include "orbsvcs/DsEventLogAdminC.h"
+#include "orbsvcs/CosEventCommS.h"
+#include "orbsvcs/CosNotifyCommS.h"
+#include "orbsvcs/CosNamingC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Consumer
+ : public POA_CosNotifyComm::PushConsumer
+{
+ // = TITLE
+ // Simple consumer object
+ //
+ // = DESCRIPTION
+ // This class is a consumer of log generated events.
+ //
+public:
+ Consumer (void);
+ // Constructor
+
+ int run (int argc, char* argv[]);
+ // Run the test
+
+protected:
+
+ CosNotifyChannelAdmin::ProxyID proxy_supplier_id_;
+ // The proxy_supplier id.
+
+ // = Methods
+
+ // 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 (const CORBA::Any &event
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+
+
+ virtual void disconnect_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+private:
+ CORBA::ULong event_count_;
+ // Keep track of the number of events received.
+
+ // = Data Members
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ CosNaming::NamingContext_var naming_context_;
+ // Handle to the name service.
+
+ DsNotifyLogAdmin::NotifyLogFactory_var notify_log_factory_;
+
+ CosNotifyChannelAdmin::ProxyPushSupplier_var proxy_supplier_;
+
+
+};
+
+#endif /* NOTIFY_CONSUMER_H */
diff --git a/TAO/orbsvcs/examples/Log/Notify/Notify_Supplier.cpp b/TAO/orbsvcs/examples/Log/Notify/Notify_Supplier.cpp
new file mode 100644
index 00000000000..86fbfd2be3c
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Notify/Notify_Supplier.cpp
@@ -0,0 +1,362 @@
+#include "Notify_Supplier.h"
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "ace/OS_main.h"
+
+ACE_RCSID (Notify,
+ Notify_Supplier,
+ "$Id$")
+
+
+#define NAMING_SERVICE_NAME "NameService"
+#define NOTIFY_TLS_LOG_FACTORY_NAME "NotifyLogFactory"
+#define LOG_EVENT_COUNT 10
+#define QUERY_1 "id > 0"
+#define QUERY_2 "id >= 0"
+#define QUERY_LANG "TCL"
+#define SA_FILTER "threshold > 10"
+#define TCL_GRAMMAR "TCL"
+#define EVENTS_TO_SEND 10
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ Supplier supplier;
+
+ return supplier.run (argc, argv);
+}
+
+// ****************************************************************
+
+Supplier::Supplier (void)
+{
+}
+
+Supplier::~Supplier ()
+{
+
+}
+
+int
+Supplier::run (int argc, char* argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ this->orb_ =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references (NAMING_SERVICE_NAME
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Need to check return value for errors.
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_THROW_RETURN (CORBA::UNKNOWN (), 0);
+
+ this->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 (NOTIFY_TLS_LOG_FACTORY_NAME);
+
+ CORBA::Object_var obj =
+ this->naming_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->notify_log_factory_ =
+ DsNotifyLogAdmin::NotifyLogFactory::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (this->notify_log_factory_.in ()));
+
+ // create a log..
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\nCalling NotifyLogFactory::create...\n"));
+
+ DsLogAdmin::LogFullActionType logfullaction = DsLogAdmin::halt;
+ DsLogAdmin::CapacityAlarmThresholdList threshold = 0;
+ CORBA::ULongLong max_size = 0; // 0 means "infinite"
+
+ DsLogAdmin::LogId logid = 0;
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+
+ this->notify_log_ =
+ this->notify_log_factory_->create (logfullaction,
+ max_size,
+ threshold,
+ initial_qos,
+ initial_admin,
+ logid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Create returned logid = %d\n",logid));
+
+ // Create some fake log events.
+ DsLogAdmin::Anys any_seq (LOG_EVENT_COUNT);
+ any_seq.length (LOG_EVENT_COUNT);
+
+ //DsLogAdmin::RecordIdList id_seq (LOG_EVENT_COUNT);
+ //id_seq.length (LOG_EVENT_COUNT);
+
+ for (int i = 0; i < LOG_EVENT_COUNT; i++)
+ {
+ any_seq [i] <<= i;
+ }
+
+ CosNotifyChannelAdmin::AdminID adminID = 0;
+ this->supplier_admin_ =
+ notify_log_->new_for_suppliers (CosNotifyChannelAdmin::OR_OP, adminID);
+ ACE_ASSERT (!CORBA::is_nil (supplier_admin_.in ()));
+
+ CosNotifyFilter::FilterFactory_var ffact =
+ notify_log_->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // setup a filter at the consumer admin
+ CosNotifyFilter::Filter_var sa_filter =
+ ffact->create_filter (TCL_GRAMMAR ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (sa_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 (SA_FILTER);
+
+ sa_filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ supplier_admin_->add_filter (sa_filter.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // startup the first supplier
+ ACE_NEW_THROW_EX (supplier_1,
+ Filter_StructuredPushSupplier (ACE_ENV_SINGLE_ARG_PARAMETER),
+ CORBA::NO_MEMORY ());
+
+ supplier_1->connect (supplier_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // 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 (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;
+
+ event.filterable_data[0].value <<= (CORBA::Long)4;
+
+ // any
+ event.remainder_of_body <<= (CORBA::Long)4;
+
+ for (int k = 0; k < EVENTS_TO_SEND; k++)
+ {
+ event.filterable_data[0].value <<= (CORBA::Long)k;
+
+ // any
+ event.remainder_of_body <<= (CORBA::Long)k;
+
+ supplier_1->send_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Calling NotifyLog get_n_records...\n"));
+
+#ifndef ACE_LACKS_LONGLONG_T
+ CORBA::ULongLong retval = notify_log_->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#else
+ CORBA::Long retval = notify_log_->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_TRY_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Number of records in Log = %d \n", retval));
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Calling NotifyLog::get_current_size...\n"));
+#ifndef ACE_LACKS_LONGLONG_T
+ retval = notify_log_->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#else
+ retval = notify_log_->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_TRY_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Size of data in Log = %d \n", retval));
+
+ ACE_DEBUG ((LM_DEBUG, "Querying the Log: %s\n", QUERY_1));
+ DsLogAdmin::Iterator_var iter_out;
+ DsLogAdmin::RecordList_var rec_list =
+ notify_log_->query (QUERY_LANG, QUERY_1, iter_out);
+
+ CORBA::ULong j = 0;
+ for (; j < rec_list->length();++j)
+#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
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Deleting records... \n"));
+
+ retval = notify_log_->delete_records (QUERY_LANG, QUERY_2 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Calling NotifyLog::get_n_records...\n"));
+#ifndef ACE_LACKS_LONGLONG_T
+ retval = notify_log_->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#else
+ retval = notify_log_->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_TRY_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Number of records in Log after delete = %d \n",
+ retval));
+
+ ACE_DEBUG ((LM_DEBUG, "Geting the current_size again...\n"));
+#ifndef ACE_LACKS_LONGLONG_T
+ retval = notify_log_->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#else
+ retval = notify_log_->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_TRY_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Size of data in Log = %d \n", retval));
+
+ this->notify_log_->destroy();
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Supplier::run");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+
+Filter_StructuredPushSupplier::Filter_StructuredPushSupplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+}
+
+Filter_StructuredPushSupplier::~Filter_StructuredPushSupplier ()
+{
+}
+
+void
+Filter_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
+Filter_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
+Filter_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
+Filter_StructuredPushSupplier::send_event
+ (const CosNotification::StructuredEvent& event ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (this->proxy_consumer_.in ()));
+
+ proxy_consumer_->push_structured_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Filter_StructuredPushSupplier::disconnect_structured_push_supplier
+ (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ // No-Op.
+}
+
diff --git a/TAO/orbsvcs/examples/Log/Notify/Notify_Supplier.h b/TAO/orbsvcs/examples/Log/Notify/Notify_Supplier.h
new file mode 100644
index 00000000000..bd4e26f2fda
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Notify/Notify_Supplier.h
@@ -0,0 +1,128 @@
+/* -*- C++ -*- */
+
+// ============================================================================
+/**
+ * @file Notify_Supplier.h
+ *
+ * $Id$
+ *
+ * An example of using the Notify_Logging_Service.
+ *
+ *
+ *
+ * @author D A Hanvey (d.hanvey@qub.ac.uk)
+ */
+// ============================================================================
+
+#ifndef NOTIFY_SUPPLIER_H
+#define NOTIFY_SUPPLIER_H
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/DsNotifyLogAdminC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/CosNotifyCommS.h"
+
+
+class Filter_StructuredPushSupplier;
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Supplier
+{
+ // = TITLE
+ // Simple supplier object
+ //
+ // = DESCRIPTION
+ // This class is a supplier of events.
+ //
+public:
+ Supplier (void);
+ // Constructor
+
+ ~Supplier ();
+ // Destructor.
+
+ int run (int argc, char* argv[]);
+ // Run the test
+
+private:
+
+ // = Data Members
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ CosNaming::NamingContext_var naming_context_;
+ // Handle to the name service.
+
+ DsNotifyLogAdmin::NotifyLogFactory_var notify_log_factory_;
+ // The notify log factory from the Log Service.
+
+ DsNotifyLogAdmin::NotifyLog_var notify_log_;
+
+ Filter_StructuredPushSupplier* supplier_1;
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
+};
+
+class Filter_StructuredPushSupplier
+ : public POA_CosNotifyComm::StructuredPushSupplier
+{
+ // = TITLE
+ // Filter_StructuredPushSupplier
+ //
+ // = DESCRIPTION
+ // Supplier for the filter example.
+ //
+ public:
+ // = Initialization and Termination code
+ Filter_StructuredPushSupplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // 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 (const CosNotification::StructuredEvent& event
+ ACE_ENV_ARG_DECL);
+ // Send one event.
+
+protected:
+ // = Data members
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var proxy_consumer_;
+ // The proxy that we are connected to.
+
+ CosNotifyChannelAdmin::ProxyID proxy_consumer_id_;
+ // This supplier's id.
+
+ // = Protected Methods
+ virtual ~Filter_StructuredPushSupplier ();
+ // Destructor
+
+ // = NotifySubscribe
+ 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
+ ));
+};
+
+
+#endif /* NOTIFY_SUPPLIER_H */
diff --git a/TAO/orbsvcs/examples/Log/Notify/README b/TAO/orbsvcs/examples/Log/Notify/README
new file mode 100644
index 00000000000..9de15b27dae
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Notify/README
@@ -0,0 +1,18 @@
+// $Id$
+
+Telecom Log Service (TLS) Client example
+----------------------------------------
+This is a simple example example to show how to create a notify 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 Notify Logging Service, $TAO_ROOT/orbsvcs/Logging_Service/Notify_Logging_Service
+3) To collect log-generated events you will need to run, ./Notify_Consumer
+4) To run the sample log events run, ./Notify_Supplier
+
+The client locates the log service factory from the naming service.
+Then it creates a DsNotifyLogAdmin::NotifyLog 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/examples/Log/Notify/run_test.pl b/TAO/orbsvcs/examples/Log/Notify/run_test.pl
new file mode 100755
index 00000000000..781e0e05543
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/Notify/run_test.pl
@@ -0,0 +1,67 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $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/Notify_Logging_Service/Notify_Logging_Service", "-ORBInitRef NameService=file://$nsior");
+$consumer = new PerlACE::Process ("Notify_Consumer", "-ORBInitRef NameService=file://$nsior");
+$supplier = new PerlACE::Process ("Notify_Supplier", "-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 naming service.
+sleep (5);
+
+print STDERR "Starting Consumer\n";
+
+$consumer->Spawn ();
+
+sleep (1);
+
+print STDERR "Starting Supplier\n";
+
+$supplier->Spawn ();
+
+
+$supplier->WaitKill (5);
+
+$consumer->Kill ();
+
+$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/examples/Log/README b/TAO/orbsvcs/examples/Log/README
new file mode 100644
index 00000000000..aa5579fff01
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/README
@@ -0,0 +1,18 @@
+Logging Service
+===============
+
+PLEASE NOTE - the Logging_Service test that was previously in this directory
+has been moved to $TAO_ROOT/orbsvcs/tests/Log.
+
+ALSO - the example that was contained in Client has been deleted.
+----------------------------------------------------------------------
+
+These examples show basic operations of the 4 logging services.
+
+Please see the README documents in each of the above folders for details
+on how to execute the respective services.
+
+Author:
+-------
+David Hanvey
+send suggestions, bugs, to David Hanvey <d.hanvey@qub.ac.uk>
diff --git a/TAO/orbsvcs/examples/Log/RTEvent/Log_RTEvent.mpc b/TAO/orbsvcs/examples/Log/RTEvent/Log_RTEvent.mpc
new file mode 100644
index 00000000000..83fed7aa672
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/RTEvent/Log_RTEvent.mpc
@@ -0,0 +1,16 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Consumer) : orbsvcsexe, rtevent_skel, naming, rteventlogadmin {
+ exename = RTEvent_Consumer
+ source_files {
+ RTEvent_Consumer.cpp
+ }
+}
+
+project(*Supplier) : orbsvcsexe, rtevent_skel, naming, rteventlogadmin {
+ exename = RTEvent_Supplier
+ source_files {
+ RTEvent_Supplier.cpp
+ }
+}
diff --git a/TAO/orbsvcs/examples/Log/RTEvent/Makefile.am b/TAO/orbsvcs/examples/Log/RTEvent/Makefile.am
new file mode 100644
index 00000000000..0c83282a06d
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/RTEvent/Makefile.am
@@ -0,0 +1,96 @@
+## 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.Log_RTEvent_Consumer.am
+
+if BUILD_CORBA_MESSAGING
+
+noinst_PROGRAMS += RTEvent_Consumer
+
+RTEvent_Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+RTEvent_Consumer_SOURCES = \
+ RTEvent_Consumer.cpp \
+ RTEvent_Consumer.h
+
+RTEvent_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEventLogAdmin.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin.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.Log_RTEvent_Supplier.am
+
+if BUILD_CORBA_MESSAGING
+
+noinst_PROGRAMS += RTEvent_Supplier
+
+RTEvent_Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+RTEvent_Supplier_SOURCES = \
+ RTEvent_Supplier.cpp \
+ RTEvent_Supplier.h
+
+RTEvent_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEventLogAdmin.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin.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
+
+## 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/examples/Log/RTEvent/README b/TAO/orbsvcs/examples/Log/RTEvent/README
new file mode 100644
index 00000000000..103bab83664
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/RTEvent/README
@@ -0,0 +1,18 @@
+// $Id$
+
+Telecom Log Service (TLS) Client example
+----------------------------------------
+This is a simple example example to show how to create an real-time event 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 Event Logging Service, $TAO_ROOT/orbsvcs/Logging_Service/RTEvent_Logging_Service
+3) To collect log-generated events you will need to run, ./RTEvent_Consumer
+4) To run the sample log events run, ./RTEvent_Supplier
+
+The client locates the log service factory from the naming service.
+Then it creates a RTEventLogAdmin::RTEventLog 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/examples/Log/RTEvent/RTEvent_Consumer.cpp b/TAO/orbsvcs/examples/Log/RTEvent/RTEvent_Consumer.cpp
new file mode 100644
index 00000000000..a9ce5387a62
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/RTEvent/RTEvent_Consumer.cpp
@@ -0,0 +1,175 @@
+#include "RTEvent_Consumer.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "ace/OS_main.h"
+
+ACE_RCSID (RTEvent,
+ RTEvent_Consumer,
+ "$Id$")
+
+#define NAMING_SERVICE_NAME "NameService"
+#define EVENT_TLS_LOG_FACTORY_NAME "RTEventLogFactory"
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ Consumer consumer;
+
+ return consumer.run (argc, argv);
+}
+
+// ****************************************************************
+
+Consumer::Consumer (void)
+ : event_count_ (0)
+{
+}
+
+int
+Consumer::run (int argc, char* argv[])
+{
+ 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;
+
+ // Do *NOT* make a copy because we don't want the ORB to outlive
+ // the run() method.
+ this->orb_ = orb.in ();
+/*
+ if (argc <= 1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Usage: Consumer <event_channel_ior>\n"));
+ return 1;
+ }
+*/
+ 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;
+
+ // Obtain the event channel, we could use a naming service, a
+ // command line argument or resolve_initial_references(), but
+ // this is simpler...
+/* object =
+ orb->string_to_object (argv[1] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ RtecEventChannelAdmin::EventChannel::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+*/
+
+ // Obtain the event channel
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references (NAMING_SERVICE_NAME
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Need to check return value for errors.
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_THROW_RETURN (CORBA::UNKNOWN (), 0);
+
+ this->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 (EVENT_TLS_LOG_FACTORY_NAME);
+
+ CORBA::Object_var obj =
+ this->naming_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->event_log_factory_ =
+ RTEventLogAdmin::EventLogFactory::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ // The canonical protocol to connect to the EC
+
+ this->supplier_ =
+ this->event_log_factory_->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventComm::PushConsumer_var consumer =
+ this->_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 qos;
+ qos.dependencies.length (2);
+ RtecEventComm::EventHeader& h0 =
+ qos.dependencies[0].event.header;
+ h0.type = ACE_ES_DISJUNCTION_DESIGNATOR;
+ h0.source = ACE_ES_EVENT_SOURCE_ANY;
+
+ 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;
+
+ this->supplier_->connect_push_consumer (consumer.in (), qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Wait for events, using work_pending()/perform_work() may help
+ // or using another thread, this example is too simple for that.
+ orb->run ();
+
+ // We don't do any cleanup, it is hard to do it after shutdown,
+ // and would complicate the example; plus it is almost
+ // impossible to do cleanup after ORB->run() because the POA is
+ // in the holding state. Applications should use
+ // work_pending()/perform_work() to do more interesting stuff.
+ // Check the supplier for the proper way to do cleanup.
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Consumer::run");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+Consumer::push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG (events);
+
+ this->event_count_ ++;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Consumer (%P|%t): %d log generated events received\n",
+ this->event_count_));
+}
+
+void
+Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // In this example we shutdown the ORB when we disconnect from the
+ // EC (or rather the EC disconnects from us), but this doesn't have
+ // to be the case....
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
diff --git a/TAO/orbsvcs/examples/Log/RTEvent/RTEvent_Consumer.h b/TAO/orbsvcs/examples/Log/RTEvent/RTEvent_Consumer.h
new file mode 100644
index 00000000000..5c908495901
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/RTEvent/RTEvent_Consumer.h
@@ -0,0 +1,72 @@
+/* -*- C++ -*- */
+
+// ============================================================================
+/**
+ * @file RTEvent_Consumer.h
+ *
+ * $Id$
+ *
+ * An example of using the RTEvent_Logging_Service.
+ * The RTEvent_Consumer consumes log-generated events.
+ *
+ *
+ * @author D A Hanvey (d.hanvey@qub.ac.uk)
+ */
+// ============================================================================
+
+#ifndef RTEVENT_CONSUMER_H
+#define RTEVENT_CONSUMER_H
+
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/RTEventLogAdminC.h"
+#include "orbsvcs/CosNamingC.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 registers for one event type.
+ //
+public:
+ Consumer (void);
+ // Constructor
+
+ int run (int argc, char* argv[]);
+ // Run the test
+
+ // = 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.
+
+ CORBA::ORB_ptr orb_;
+ // The orb, just a pointer because the ORB does not outlive the
+ // run() method...
+
+ CosNaming::NamingContext_var naming_context_;
+ // Handle to the name service.
+
+ RTEventLogAdmin::EventLogFactory_var event_log_factory_;
+ // The Event Log Factory that generates the events to be consumed.
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_;
+ // The proxy that we are connected to.
+
+};
+
+#endif /* RTEVENT_CONSUMER_H */
diff --git a/TAO/orbsvcs/examples/Log/RTEvent/RTEvent_Supplier.cpp b/TAO/orbsvcs/examples/Log/RTEvent/RTEvent_Supplier.cpp
new file mode 100644
index 00000000000..1a2de3ca9b9
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/RTEvent/RTEvent_Supplier.cpp
@@ -0,0 +1,297 @@
+#include "RTEvent_Supplier.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "ace/OS_main.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (RTEvent,
+ RTEvent_Supplier,
+ "$Id$")
+
+#define NAMING_SERVICE_NAME "NameService"
+#define EVENT_TLS_LOG_FACTORY_NAME "RTEventLogFactory"
+#define LOG_EVENT_COUNT 29
+#define QUERY_1 "id > 0"
+#define QUERY_2 "id >= 0"
+#define QUERY_LANG "TCL"
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ Supplier supplier;
+
+ return supplier.run (argc, argv);
+
+}
+
+// ****************************************************************
+
+Supplier::Supplier (void)
+{
+}
+
+int
+Supplier::run (int argc, char* argv[])
+{
+ 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;
+
+
+/*
+ if (argc <= 1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Usage: Supplier <event_channel_ior>\n"));
+ return 1;
+ }
+*/
+
+ // Do *NOT* make a copy because we don't want the ORB to outlive
+ // the run() method.
+ // this->orb_ = orb.in ();
+
+ 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;
+
+ // Obtain the event channel, we could use a naming service, a
+ // command line argument or resolve_initial_references(), but
+ // this is simpler...
+/* object =
+ orb->string_to_object (argv[1] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ RtecEventChannelAdmin::EventChannel::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+*/
+
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references (NAMING_SERVICE_NAME
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Need to check return value for errors.
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_THROW_RETURN (CORBA::UNKNOWN (), 0);
+
+ this->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 (EVENT_TLS_LOG_FACTORY_NAME);
+
+ CORBA::Object_var obj =
+ this->naming_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->event_log_factory_ =
+ RTEventLogAdmin::EventLogFactory::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (this->event_log_factory_.in ()));
+
+
+
+
+
+ // create a log..
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\nCalling EventLogFactory::create...\n"));
+
+ DsLogAdmin::LogFullActionType logfullaction = DsLogAdmin::halt;
+ DsLogAdmin::CapacityAlarmThresholdList threshold = 0;
+ CORBA::ULongLong max_size = 0; // 0 means "infinite"
+
+ DsLogAdmin::LogId logid = 0;
+
+ RTEventLogAdmin::EventLog_var event_log =
+ // DsLogAdmin::Log_var event_log =
+ this->event_log_factory_->create (logfullaction,
+ max_size,
+ threshold,
+ logid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Create returned logid = %d\n",logid));
+
+ // The canonical protocol to connect to the EC
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_log->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->consumer_ =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventComm::PushSupplier_var supplier =
+ this->_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 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
+
+ this->consumer_->connect_push_supplier (supplier.in (), qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ // Create some fake log events.
+ // Push the events...
+ ACE_Time_Value sleep_time (0, 10000); // 10 milliseconds
+
+ 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;
+
+ for (int i = 0; i != LOG_EVENT_COUNT; ++i)
+ {
+ this->consumer_->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_OS::sleep (sleep_time);
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Writing %d records...\n", LOG_EVENT_COUNT));
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Calling EventLog::get_n_records...\n"));
+#ifndef ACE_LACKS_LONGLONG_T
+ CORBA::ULongLong retval = event_log->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#else
+ CORBA::Long retval = event_log->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_TRY_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Number of records in Log = %d \n", retval));
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Calling EventLog::get_current_size...\n"));
+#ifndef ACE_LACKS_LONGLONG_T
+ retval = event_log->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#else
+ retval = event_log->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_TRY_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Size of data in Log = %d \n", retval));
+
+ ACE_DEBUG ((LM_DEBUG, "Querying the Log: %s\n", QUERY_1));
+ DsLogAdmin::Iterator_var iter_out;
+ DsLogAdmin::RecordList_var rec_list =
+ event_log->query (QUERY_LANG, QUERY_1, iter_out);
+
+ CORBA::ULong j = 0;
+ for (; j < rec_list->length();++j)
+#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
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Deleting records... \n"));
+
+ retval = event_log->delete_records (QUERY_LANG, QUERY_2 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Calling EventLog::get_n_records...\n"));
+#ifndef ACE_LACKS_LONGLONG_T
+ retval = event_log->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#else
+ retval = event_log->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_TRY_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Number of records in Log after delete = %d \n",
+ retval));
+
+ ACE_DEBUG ((LM_DEBUG, "Geting the current_size again...\n"));
+#ifndef ACE_LACKS_LONGLONG_T
+ retval = event_log->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#else
+ retval = event_log->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER).lo();
+ ACE_TRY_CHECK;
+#endif
+
+ ACE_DEBUG ((LM_DEBUG, "Size of data in Log = %d \n", retval));
+
+ // Disconnect from the EC
+ this->consumer_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Destroy the EC....
+ //event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ event_log->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Deactivate this object...
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Destroy the POA
+ poa->destroy (1, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Supplier::run");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
diff --git a/TAO/orbsvcs/examples/Log/RTEvent/RTEvent_Supplier.h b/TAO/orbsvcs/examples/Log/RTEvent/RTEvent_Supplier.h
new file mode 100644
index 00000000000..170a98db896
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/RTEvent/RTEvent_Supplier.h
@@ -0,0 +1,63 @@
+/* -*- C++ -*- */
+
+// ============================================================================
+/**
+ * @file RTEvent_Supplier.h
+ *
+ * $Id$
+ *
+ * An example of using the RTEvent_Logging_Service.
+ *
+ *
+ *
+ * @author D A Hanvey (d.hanvey@qub.ac.uk)
+ */
+// ============================================================================
+
+#ifndef RTEVENT_SUPPLIER_H
+#define RTEVENT_SUPPLIER_H
+
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/RTEventLogAdminC.h"
+#include "orbsvcs/CosNamingC.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.
+ //
+public:
+ Supplier (void);
+ // Constructor
+
+ int run (int argc, char* argv[]);
+ // Run the test
+
+ // = 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:
+
+ // = Data Members
+ CosNaming::NamingContext_var naming_context_;
+ // Handle to the name service.
+
+ RTEventLogAdmin::EventLogFactory_var event_log_factory_;
+ // The Event Log Factory that generates the events to be consumed.
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer_;
+ // The proxy that we are connected to.
+};
+
+#endif /* RTEVENT_SUPPLIER_H */
diff --git a/TAO/orbsvcs/examples/Log/RTEvent/run_test.pl b/TAO/orbsvcs/examples/Log/RTEvent/run_test.pl
new file mode 100755
index 00000000000..bb8d0417f41
--- /dev/null
+++ b/TAO/orbsvcs/examples/Log/RTEvent/run_test.pl
@@ -0,0 +1,67 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $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/RTEvent_Logging_Service/RTEvent_Logging_Service", "-ORBInitRef NameService=file://$nsior");
+$consumer = new PerlACE::Process ("RTEvent_Consumer", "-ORBInitRef NameService=file://$nsior");
+$supplier = new PerlACE::Process ("RTEvent_Supplier", "-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 naming service.
+sleep (5);
+
+print STDERR "Starting Consumer\n";
+
+$consumer->Spawn ();
+
+sleep (1);
+
+print STDERR "Starting Supplier\n";
+
+$supplier->Spawn ();
+
+
+$supplier->WaitKill (5);
+
+$consumer->Kill ();
+
+$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/examples/Makefile.am b/TAO/orbsvcs/examples/Makefile.am
new file mode 100644
index 00000000000..b93a6688dc9
--- /dev/null
+++ b/TAO/orbsvcs/examples/Makefile.am
@@ -0,0 +1,21 @@
+## 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 = \
+ CosEC \
+ FaultTolerance \
+ ImR \
+ LoadBalancing \
+ Log \
+ Notify \
+ ORT \
+ RtEC \
+ Security
+
diff --git a/TAO/orbsvcs/examples/Notify/Federation/Agent/Agent.cpp b/TAO/orbsvcs/examples/Notify/Federation/Agent/Agent.cpp
new file mode 100644
index 00000000000..3e6109e1ee1
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Federation/Agent/Agent.cpp
@@ -0,0 +1,346 @@
+// file : Agent.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include <ace/streams.h>
+#if defined(ACE_USES_OLD_IOSTREAMS)
+# if defined(_MSC_VER)
+# include <strstrea.h>
+# else
+# include <strstream.h>
+# endif
+#else
+# include <sstream>
+#endif
+
+#include "ace/OS.h"
+
+#include "tao/corba.h"
+
+#include "orbsvcs/CosNotificationC.h"
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNotifyCommS.h"
+
+// For in-process Notification Service.
+//
+#include "ace/Dynamic_Service.h"
+#include "orbsvcs/Notify/Service.h"
+#include "orbsvcs/Notify/CosNotify_Initializer.h" // NS static link helper.
+
+
+#include "Gate/Gate.h"
+
+using namespace CORBA;
+using namespace CosNotifyComm;
+using namespace CosNotification;
+using namespace CosNotifyChannelAdmin;
+
+class Agent : public POA_CosNotifyComm::StructuredPushConsumer,
+ public PortableServer::RefCountServantBase
+{
+public:
+ Agent (char const* space_craft_name,
+ char const* agent_name,
+ EventChannel_ptr ch)
+ : space_craft_name_ (space_craft_name),
+ agent_name_ (agent_name),
+ counter_ (0)
+ {
+ // Obtain a proxy consumer.
+ //
+ ProxyConsumer_var pc (
+ ch->default_supplier_admin ()->obtain_notification_push_consumer (
+ STRUCTURED_EVENT, consumer_id_));
+
+ consumer_ = StructuredProxyPushConsumer::_narrow (pc.in ());
+
+ consumer_->connect_structured_push_supplier (
+ StructuredPushSupplier::_nil ());
+
+ // Register as a consumer.
+ //
+ StructuredPushConsumer_var ref (_this ()); // Activate on the default POA.
+
+ ProxySupplier_var ps (
+ ch->default_consumer_admin ()->obtain_notification_push_supplier (
+ STRUCTURED_EVENT, supplier_id_));
+
+ supplier_ = StructuredProxyPushSupplier::_narrow (ps.in ());
+
+ supplier_->connect_structured_push_consumer (ref.in ());
+
+ // Start tracker thread.
+ //
+ if (ACE_OS::thr_create (&tracker_thunk,
+ this,
+ THR_JOINABLE,
+ &thread_) != 0) ::abort ();
+ }
+
+private:
+ static ACE_THR_FUNC_RETURN
+ tracker_thunk (void* arg)
+ {
+ Agent* a = reinterpret_cast<Agent*> (arg);
+ a->tracker ();
+ return 0;
+ }
+
+ void
+ tracker ()
+ {
+ while (true)
+ {
+ StructuredEvent e;
+
+ // Header.
+ //
+ e.header.fixed_header.event_type.domain_name = string_dup ("Aerospace");
+ e.header.fixed_header.event_type.type_name = string_dup ("AgentDiscovery");
+
+ // Make a unique "event id" by combining space_craft_name, agent_name,
+ // and counter. This can be handy for debugging.
+ //
+#if defined(ACE_USES_OLD_IOSTREAMS)
+ ostrstream ostr;
+#else
+ std::ostringstream ostr;
+#endif
+ ostr << space_craft_name_ << ":" << agent_name_ << ":" << counter_++;
+
+#if defined(ACE_USES_OLD_IOSTREAMS)
+ e.header.fixed_header.event_name = ostr.str ();
+#else
+ e.header.fixed_header.event_name = ostr.str ().c_str ();
+#endif
+
+ // Also add space_craft_name and agent_name fields separately
+ // into variable_header. This will make filtering easier.
+ //
+ e.header.variable_header.length (2);
+
+ e.header.variable_header[0].name = string_dup ("space_craft_name");
+ e.header.variable_header[0].value <<= string_dup (space_craft_name_.in ());
+
+ e.header.variable_header[1].name = string_dup ("agent_name");
+ e.header.variable_header[1].value <<= string_dup (agent_name_.in ());
+
+ // Add the counter value into filterable_data section of the event.
+ //
+ e.filterable_data.length (1);
+
+ e.filterable_data[0].name = string_dup ("counter");
+ e.filterable_data[0].value <<= counter_;
+
+
+ consumer_->push_structured_event (e);
+
+ ACE_OS::sleep (ACE_Time_Value (3, 0));
+ }
+ }
+
+private:
+ // NotifyPublish interface.
+ //
+ virtual void
+ offer_change (EventTypeSeq const&,
+ EventTypeSeq const&
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyComm::InvalidEventType))
+ {
+ // We don't care.
+ }
+
+ // StructuredPushSupplier interface.
+ //
+ virtual void
+ push_structured_event (StructuredEvent const& e ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+ {
+ // Extract space_craft_name and agent_name.
+ //
+ Char const* space_craft_name = 0;
+ Char const* agent_name = 0;
+
+ e.header.variable_header[0].value >>= space_craft_name;
+ e.header.variable_header[1].value >>= agent_name;
+
+ // Extract the counter value.
+ //
+ CORBA::ULong counter;
+ e.filterable_data[0].value >>= counter;
+
+ cerr << e.header.fixed_header.event_type.domain_name << "::"
+ << e.header.fixed_header.event_type.type_name << " "
+ << "id=" << e.header.fixed_header.event_name << " from "
+ << "(" << space_craft_name << ", " << agent_name << ")"
+ << ": " << counter << endl;
+ }
+
+
+ virtual void
+ disconnect_structured_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ // We don't care.
+ }
+
+private:
+ String_var space_craft_name_;
+ String_var agent_name_;
+ ULong counter_;
+
+ ACE_thread_t thread_;
+
+ ProxyID consumer_id_;
+ StructuredProxyPushConsumer_var consumer_;
+
+ ProxyID supplier_id_;
+ StructuredProxyPushSupplier_var supplier_;
+
+};
+
+int
+main (int argc, char* argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ ORB_var orb (ORB_init (argc, argv));
+
+ if (argc < 2)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Usage: %s <agent-name> [<space-craft-name>={a, b, c}]\n",
+ argv[0]));
+ return 1;
+ }
+
+
+ // Activate the root POA.
+ //
+ 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 ()));
+
+ PortableServer::POAManager_var poa_manager (root_poa->the_POAManager ());
+
+ poa_manager->activate ();
+
+
+ // Initialize Notification Service.
+ //
+ TAO_Notify_Service* ns =
+ ACE_Dynamic_Service<TAO_Notify_Service>::instance (
+ TAO_NOTIFICATION_SERVICE_NAME);
+
+ if (ns == 0)
+ {
+ ns =
+ ACE_Dynamic_Service<TAO_Notify_Service>::instance (
+ TAO_NOTIFY_DEF_EMO_FACTORY_NAME);
+ }
+
+ if (ns == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Notification Service not found! check svc.conf\n"));
+ return -1;
+ }
+
+
+ ns->init_service (orb.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create the channel factory.
+ //
+ EventChannelFactory_var factory (ns->create (root_poa.in ()
+ ACE_ENV_ARG_PARAMETER));
+ ACE_TRY_CHECK;
+
+ if (is_nil (factory.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Unable to create channel factory\n"));
+ return 1;
+ }
+
+
+ // Create the channel.
+ //
+ QoSProperties qosp;
+ AdminProperties ap;
+ ChannelID id;
+
+ EventChannel_var channel (factory->create_channel (qosp, ap, id));
+
+ // Find which space craft we are on.
+ //
+ ACE_INET_Addr addr;
+ char const* space_craft_name = 0;
+
+ if (argc < 3)
+ space_craft_name = "a"; // Default to spacecraft "a".
+ else
+ space_craft_name = argv[2];
+
+ // Do a quick mapping to mcast addresses.
+ //
+ switch (space_craft_name[0])
+ {
+ case 'a':
+ {
+ addr = ACE_INET_Addr ("224.1.0.1:10000");
+ break;
+ }
+ case 'b':
+ {
+ addr = ACE_INET_Addr ("224.1.0.2:10000");
+ break;
+ }
+ case 'c':
+ {
+ addr = ACE_INET_Addr ("224.1.0.3:10000");
+ break;
+ }
+ default:
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Space craft name should be either 'a', 'b', or 'c'.\n"));
+ return 1;
+ }
+ }
+
+ // Create the gate.
+ //
+ Gate gate (addr, channel.in ());
+
+ // Start the agent.
+ //
+ Agent agent (space_craft_name, argv[1], channel.in ());
+
+ orb->run ();
+
+ return 0;
+ }
+ ACE_CATCH (CORBA::UserException, ue)
+ {
+ ACE_PRINT_EXCEPTION (ue,
+ "User exception: ");
+ return 1;
+ }
+ ACE_CATCH (CORBA::SystemException, se)
+ {
+ ACE_PRINT_EXCEPTION (se,
+ "System exception: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/examples/Notify/Federation/Agent/Agent.mpc b/TAO/orbsvcs/examples/Notify/Federation/Agent/Agent.mpc
new file mode 100644
index 00000000000..1083905d845
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Federation/Agent/Agent.mpc
@@ -0,0 +1,14 @@
+// -*- MPC -*-
+// $Id$
+
+project : rmcast, orbsvcsexe, notification, notification_skel, notification_serv, typecodefactory {
+ exename = agent
+ after += Gate
+ libs += Gate
+
+ specific (automake) {
+ includes += $(srcdir)/..
+ } else {
+ includes += ..
+ }
+}
diff --git a/TAO/orbsvcs/examples/Notify/Federation/Agent/Makefile.am b/TAO/orbsvcs/examples/Notify/Federation/Agent/Makefile.am
new file mode 100644
index 00000000000..ae1c7216075
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Federation/Agent/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.Agent.am
+
+if BUILD_THREADS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = agent
+
+agent_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(ACE_ROOT)/protocols \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/.. \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+agent_SOURCES = \
+ Agent.cpp
+
+agent_LDADD = \
+ $(top_builddir)/orbsvcs/examples/Notify/Federation/Gate/libGate.la \
+ $(TAO_BUILDDIR)/tao/libTAO_TypeCodeFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.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)/protocols/ace/RMCast/libACE_RMCast.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_THREADS
+
+## 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/examples/Notify/Federation/Agent/README b/TAO/orbsvcs/examples/Notify/Federation/Agent/README
new file mode 100644
index 00000000000..53f999666f6
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Federation/Agent/README
@@ -0,0 +1,12 @@
+Agent is a simple application which sends and receives discovery messages
+via multicast-based federation of Notification Service. To run the example
+you don't need to start Notification Service; each agent process will create
+its own. Just start a few agents (in different terminal windows):
+
+
+$ ./agent smith
+$ ./agent johnson
+
+
+--
+Boris Kolpackov <boris@kolpackov.net>
diff --git a/TAO/orbsvcs/examples/Notify/Federation/Agent/agent.dia b/TAO/orbsvcs/examples/Notify/Federation/Agent/agent.dia
new file mode 100644
index 00000000000..9840e3fe8a6
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Federation/Agent/agent.dia
Binary files differ
diff --git a/TAO/orbsvcs/examples/Notify/Federation/Gate/Export.h b/TAO/orbsvcs/examples/Notify/Federation/Gate/Export.h
new file mode 100644
index 00000000000..c813c802bc0
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Federation/Gate/Export.h
@@ -0,0 +1,44 @@
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by
+// generate_export_file.pl
+// ------------------------------
+#if !defined (GATE_EXPORT_H)
+#define GATE_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (GATE_HAS_DLL)
+# define GATE_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && GATE_HAS_DLL */
+
+#if !defined (GATE_HAS_DLL)
+#define GATE_HAS_DLL 1
+#endif /* ! GATE_HAS_DLL */
+
+#if defined (GATE_HAS_DLL)
+# if (GATE_HAS_DLL == 1)
+# if defined (GATE_BUILD_DLL)
+# define Gate_Export ACE_Proper_Export_Flag
+# define GATE_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define GATE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else
+# define Gate_Export ACE_Proper_Import_Flag
+# define GATE_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define GATE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* GATE_BUILD_DLL */
+# else
+# define Gate_Export
+# define GATE_SINGLETON_DECLARATION(T)
+# define GATE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* ! GATE_HAS_DLL == 1 */
+#else
+# define Gate_Export
+# define GATE_SINGLETON_DECLARATION(T)
+# define GATE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* GATE_HAS_DLL */
+
+#endif /* GATE_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.cpp b/TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.cpp
new file mode 100644
index 00000000000..f34fd4bd09c
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.cpp
@@ -0,0 +1,266 @@
+// file : Gate.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "Gate.h"
+
+/*
+#include <iostream>
+
+using std::cerr;
+using std::endl;
+*/
+
+using namespace CORBA;
+using namespace CosNotifyComm;
+using namespace CosNotification;
+using namespace CosNotifyChannelAdmin;
+
+Gate::
+~Gate ()
+{
+ // Stop tracker thread.
+ //
+ {
+ Lock l (mutex_);
+ stop_ = true;
+ }
+
+ thread_mgr_.wait ();
+}
+
+
+Gate::
+Gate (ACE_INET_Addr const& group, EventChannel_ptr ch)
+ : socket_ (group, false),
+ stop_ (false)
+{
+ init (ch->default_consumer_admin (),
+ ch->default_supplier_admin ());
+}
+
+Gate::
+Gate (ACE_INET_Addr const& group,
+ ConsumerAdmin_ptr consumer_admin,
+ SupplierAdmin_ptr supplier_admin)
+ : socket_ (group, false),
+ stop_ (false)
+{
+ init (consumer_admin, supplier_admin);
+}
+
+void Gate::
+init (ConsumerAdmin_ptr consumer_admin,
+ SupplierAdmin_ptr supplier_admin)
+{
+ // Generate unique id. It is used to prevent event looping.
+ //
+ ACE_Utils::UUID uuid;
+ ACE_Utils::UUID_GENERATOR::instance ()->init ();
+ ACE_Utils::UUID_GENERATOR::instance ()->generateUUID (uuid);
+
+ id_ = string_alloc (uuid.to_string ()->length () + 2);
+ strcpy (id_.inout (), "_");
+ strcpy (id_.inout () + 1, uuid.to_string ()->rep ());
+
+ // ACE_DEBUG ((LM_DEBUG, "ID: %s\n", id_.in ()));
+
+
+ // Obtain proxy consumer.
+ //
+ ProxyConsumer_var pc (
+ supplier_admin->obtain_notification_push_consumer (
+ STRUCTURED_EVENT, consumer_id_));
+
+ consumer_ = StructuredProxyPushConsumer::_narrow (pc.in ());
+
+ consumer_->connect_structured_push_supplier (
+ StructuredPushSupplier::_nil ());
+
+
+ // Register as consumer.
+ //
+ StructuredPushConsumer_var ref (_this ()); // Activate on default POA.
+
+ ProxySupplier_var ps (
+ consumer_admin->obtain_notification_push_supplier (
+ STRUCTURED_EVENT, supplier_id_));
+
+ supplier_ = StructuredProxyPushSupplier::_narrow (ps.in ());
+
+ supplier_->connect_structured_push_consumer (ref.in ());
+
+
+ // Create tracker thread.
+ //
+ thread_mgr_.spawn (tracker_thunk, this);
+}
+
+ACE_THR_FUNC_RETURN Gate::
+tracker_thunk (void* arg)
+{
+ Gate* a = reinterpret_cast<Gate*> (arg);
+ a->tracker ();
+ return 0;
+}
+
+void Gate::
+tracker ()
+{
+ // Time period after which a manual cancellation request is
+ // checked for.
+ //
+ ACE_Time_Value const timeout (0, 500);
+
+ while (true)
+ {
+ ssize_t n;
+
+ while (true)
+ {
+ n = socket_.size (timeout);
+
+ // Check for cancellation request.
+ //
+ {
+ Lock l (mutex_);
+
+ if (stop_)
+ return;
+ }
+
+ if (n == -1)
+ {
+ if (errno != ETIME)
+ abort ();
+ }
+ else
+ break;
+ }
+
+ OctetSeq seq (n);
+ seq.length (n);
+
+ char* buffer = reinterpret_cast<char*> (seq.get_buffer ());
+
+ if (socket_.recv (buffer, n) != n)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "recv() reported different size than size()\n"));
+ continue;
+ }
+
+ TAO_InputCDR cdr (buffer, n);
+
+ StructuredEvent e;
+
+ cdr >> e;
+
+ // Add TTL header to prevent infinite message looping.
+ //
+ ULong i (0);
+
+ for (; i < e.header.variable_header.length (); ++i)
+ {
+ if (strcmp (e.header.variable_header[i].name.in (), id_.in ()) == 0)
+ break;
+ }
+
+ if (i == e.header.variable_header.length ())
+ {
+ e.header.variable_header.length (i + 1);
+
+ e.header.variable_header[i].name = string_dup (id_.in ());
+ }
+
+ //ACE_DEBUG ((LM_DEBUG,
+ // "adding %s as header #%d\n",
+ // e.header.variable_header[i].name.in (), i));
+
+ e.header.variable_header[i].value <<= ULong (1);
+
+ /*
+ cerr << "IN: "
+ << e.header.fixed_header.event_type.domain_name << "::"
+ << e.header.fixed_header.event_type.type_name << " "
+ << e.header.fixed_header.event_name << endl;
+ */
+
+ consumer_->push_structured_event (e);
+ }
+}
+
+void Gate::
+push_structured_event (StructuredEvent const& e ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+{
+ for (ULong i (0); i < e.header.variable_header.length (); ++i)
+ {
+ if (strcmp (e.header.variable_header[i].name.in (), id_.in ()) == 0)
+ {
+ ULong ttl;
+
+ e.header.variable_header[i].value >>= ttl;
+
+ if (ttl <= 1)
+ {
+ //ACE_DEBUG ((LM_DEBUG,
+ // "DROPPED\n"));
+ return;
+ }
+
+ break;
+ }
+ }
+
+ /*
+ cerr << "OUT: "
+ << e.header.fixed_header.event_type.domain_name << "::"
+ << e.header.fixed_header.event_type.type_name << " "
+ << e.header.fixed_header.event_name << endl;
+ */
+
+ TAO_OutputCDR cdr;
+
+ cdr << e;
+
+ size_t size (cdr.total_length ());
+
+ OctetSeq seq (size);
+ seq.length (size);
+
+ char* buffer = reinterpret_cast<char*> (seq.get_buffer ());
+
+ {
+ char* buf = buffer;
+
+ for (ACE_Message_Block const* mb = cdr.begin ();
+ mb != 0;
+ mb = mb->cont ())
+ {
+ ACE_OS::memcpy (buf, mb->rd_ptr (), mb->length ());
+ buf += mb->length ();
+ }
+ }
+
+ socket_.send (buffer, size);
+}
+
+
+void Gate::
+disconnect_structured_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // We don't care.
+}
+
+void Gate::
+offer_change (EventTypeSeq const&,
+ EventTypeSeq const&
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyComm::InvalidEventType))
+{
+ // We don't care.
+}
diff --git a/TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.h b/TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.h
new file mode 100644
index 00000000000..312bb6b5a20
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.h
@@ -0,0 +1,93 @@
+// file : Gate.h
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef GATE_H
+#define GATE_H
+
+#include "ace/OS.h"
+#include "ace/INET_Addr.h"
+#include "ace/UUID.h"
+
+#include "ace/Thread_Mutex.h"
+#include "ace/Thread_Manager.h"
+
+#include "tao/corba.h"
+
+#include "orbsvcs/CosNotificationC.h"
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNotifyCommS.h"
+
+#include "ace/RMCast/Socket.h"
+
+#include "Export.h"
+
+class Gate_Export Gate : public POA_CosNotifyComm::StructuredPushConsumer
+{
+public:
+ virtual
+ ~Gate ();
+
+ Gate (ACE_INET_Addr const& group,
+ CosNotifyChannelAdmin::EventChannel_ptr ch);
+
+ Gate (ACE_INET_Addr const& group,
+ CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin);
+
+private:
+ void
+ init (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin);
+
+ static ACE_THR_FUNC_RETURN
+ tracker_thunk (void* arg);
+
+ void
+ tracker ();
+
+private:
+ // NotifyPublish interface.
+ //
+ virtual void
+ offer_change (CosNotification::EventTypeSeq const&,
+ CosNotification::EventTypeSeq const&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyComm::InvalidEventType));
+
+ // StructuredPushSupplier interface.
+ //
+ virtual void
+ push_structured_event (CosNotification::StructuredEvent const& e
+ 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));
+
+private:
+ ACE_thread_t thread_;
+
+ CosNotifyChannelAdmin::ProxyID consumer_id_;
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var consumer_;
+
+ CosNotifyChannelAdmin::ProxyID supplier_id_;
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_var supplier_;
+
+ ACE_RMCast::Socket socket_;
+ CORBA::String_var id_;
+
+ typedef ACE_SYNCH_MUTEX Mutex;
+ typedef ACE_Guard<Mutex> Lock;
+
+ bool stop_;
+ Mutex mutex_;
+ ACE_Thread_Manager thread_mgr_;
+};
+
+#endif // GATE_H
diff --git a/TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.mpc b/TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.mpc
new file mode 100644
index 00000000000..c533b204bba
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Federation/Gate/Gate.mpc
@@ -0,0 +1,7 @@
+// -*- MPC -*-
+// $Id$
+
+project(Gate) : rmcast, orbsvcsexe, notification, notification_skel {
+ sharedname = Gate
+ dynamicflags = GATE_BUILD_DLL
+}
diff --git a/TAO/orbsvcs/examples/Notify/Federation/Gate/Makefile.am b/TAO/orbsvcs/examples/Notify/Federation/Gate/Makefile.am
new file mode 100644
index 00000000000..30fdd5a97a3
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Federation/Gate/Makefile.am
@@ -0,0 +1,53 @@
+## 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.Gate.am
+
+if BUILD_THREADS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_LTLIBRARIES = libGate.la
+
+libGate_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(ACE_ROOT)/protocols \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL \
+ -DGATE_BUILD_DLL
+
+libGate_la_SOURCES = \
+ Gate.cpp
+
+noinst_HEADERS = \
+ Export.h \
+ Gate.h
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_THREADS
+
+## 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/examples/Notify/Federation/Makefile.am b/TAO/orbsvcs/examples/Notify/Federation/Makefile.am
new file mode 100644
index 00000000000..3e06864939a
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Federation/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 = \
+ Gate \
+ Agent \
+ SpaceCraft
+
diff --git a/TAO/orbsvcs/examples/Notify/Federation/SpaceCraft/Makefile.am b/TAO/orbsvcs/examples/Notify/Federation/SpaceCraft/Makefile.am
new file mode 100644
index 00000000000..dc08a9bae17
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Federation/SpaceCraft/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.SpaceCraft.am
+
+if BUILD_THREADS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = craft
+
+craft_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(ACE_ROOT)/protocols \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/.. \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+craft_SOURCES = \
+ SpaceCraft.cpp
+
+craft_LDADD = \
+ $(top_builddir)/orbsvcs/examples/Notify/Federation/Gate/libGate.la \
+ $(TAO_BUILDDIR)/tao/libTAO_TypeCodeFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.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)/protocols/ace/RMCast/libACE_RMCast.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_THREADS
+
+## 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/examples/Notify/Federation/SpaceCraft/README b/TAO/orbsvcs/examples/Notify/Federation/SpaceCraft/README
new file mode 100644
index 00000000000..3be18eaa394
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Federation/SpaceCraft/README
@@ -0,0 +1,27 @@
+This example simulates spacecraft constellation. Each spacecraft
+connects to a constellation-wide multicast group to which it
+forwards pre-filtered messages on behalf of its agents. To run
+the example start a few spacecrafts (in separate terminal windows):
+
+$ ./craft a
+$ ./craft b
+$ ./craft c
+
+Then start a few agents (from ../Agent) for each spacecraft:
+
+$ ./agent 1 a
+$ ./agent 2 a
+
+$ ./agent 1 b
+$ ./agent 2 b
+
+$ ./agent 1 c
+$ ./agent 2 c
+
+You should be able to observer that each agent receives only
+every third message from the agents on other spacecrafts.
+
+
+--
+Boris Kolpackov <boris@kolpackov.net>
+
diff --git a/TAO/orbsvcs/examples/Notify/Federation/SpaceCraft/SpaceCraft.cpp b/TAO/orbsvcs/examples/Notify/Federation/SpaceCraft/SpaceCraft.cpp
new file mode 100644
index 00000000000..2751694dcd7
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Federation/SpaceCraft/SpaceCraft.cpp
@@ -0,0 +1,197 @@
+// file : SpaceCraft.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include <iostream>
+#include <sstream>
+
+#include "ace/OS.h"
+
+#include "tao/corba.h"
+
+#include "orbsvcs/CosNotificationC.h"
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNotifyCommS.h"
+
+// For in-process Notification Service.
+//
+#include "ace/Dynamic_Service.h"
+#include "orbsvcs/Notify/Service.h"
+#include "orbsvcs/Notify/CosNotify_Initializer.h" // NS static link helper.
+
+
+#include "Gate/Gate.h"
+
+using std::cerr;
+using std::endl;
+
+using namespace CORBA;
+using namespace CosNotifyComm;
+using namespace CosNotifyFilter;
+using namespace CosNotification;
+using namespace CosNotifyChannelAdmin;
+
+int
+main (int argc, char* argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ ORB_var orb (ORB_init (argc, argv));
+
+ if (argc < 2)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Usage: %s <space-craft-name>={a, b, c}\n",
+ argv[0]));
+ return 1;
+ }
+
+ // Activate the root POA.
+ //
+ 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 ()));
+
+ PortableServer::POAManager_var poa_manager (root_poa->the_POAManager ());
+
+ poa_manager->activate ();
+
+
+ // Initialize Notification Service.
+ //
+ TAO_Notify_Service* ns =
+ ACE_Dynamic_Service<TAO_Notify_Service>::instance (
+ TAO_NOTIFICATION_SERVICE_NAME);
+
+ if (ns == 0)
+ {
+ ns =
+ ACE_Dynamic_Service<TAO_Notify_Service>::instance (
+ TAO_NOTIFY_DEF_EMO_FACTORY_NAME);
+ }
+
+ if (ns == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Notification Service not found! check svc.conf\n"));
+ return -1;
+ }
+
+
+ ns->init_service (orb.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create the channel factory.
+ //
+ EventChannelFactory_var factory (ns->create (root_poa.in ()
+ ACE_ENV_ARG_PARAMETER));
+ ACE_TRY_CHECK;
+
+ if (is_nil (factory.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Unable to create channel factory\n"));
+ return 1;
+ }
+
+ // Create the channel.
+ //
+ QoSProperties qosp;
+ AdminProperties ap;
+ ChannelID id;
+
+ EventChannel_var channel (factory->create_channel (qosp, ap, id));
+
+ // Create and install the filter. We want to reduce the amount
+ // of dicovery messages that are propagated between space crafts.
+ //
+ FilterFactory_var filter_factory (channel->default_filter_factory ());
+ Filter_var filter (filter_factory->create_filter ("EXTENDED_TCL"));
+
+ ConstraintExpSeq constraints (1);
+ constraints.length (1);
+
+ constraints[0].event_types.length (0);
+ constraints[0].constraint_expr = string_dup (
+ "$domain_name == 'Aerospace' and "
+ "$type_name == 'AgentDiscovery' and "
+ "($.counter - 3 * ($.counter / 3)) == 0");// ETCL (or TAO) doesn't have %?
+
+ filter->add_constraints (constraints);
+
+ AdminID admin_id = 0;
+ ConsumerAdmin_var consumer_admin (
+ channel->new_for_consumers (AND_OP, admin_id));
+
+ consumer_admin->add_filter (filter.in ());
+
+ // Find which space craft we are.
+ //
+ ACE_INET_Addr space_craft_addr;
+ char const* space_craft_name = 0;
+
+ space_craft_name = argv[1];
+
+ // Do a quick mapping to mcast addresses.
+ //
+ switch (space_craft_name[0])
+ {
+ case 'a':
+ {
+ space_craft_addr = ACE_INET_Addr ("224.1.0.1:10000");
+ break;
+ }
+ case 'b':
+ {
+ space_craft_addr = ACE_INET_Addr ("224.1.0.2:10000");
+ break;
+ }
+ case 'c':
+ {
+ space_craft_addr = ACE_INET_Addr ("224.1.0.3:10000");
+ break;
+ }
+ default:
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Space craft name should be either 'a', 'b', or 'c'.\n"));
+ return 1;
+ }
+ }
+
+ // Create the SpaceCraft <=> Channel gate.
+ //
+ Gate space_craft_gate (space_craft_addr,
+ consumer_admin.in (),
+ channel->default_supplier_admin ());
+
+
+ // Create the Channel <=> Constellation gate.
+ //
+ ACE_INET_Addr constellation_addr ("224.1.1.1:10000");
+ Gate constellation_gate (constellation_addr, channel.in ());
+
+ orb->run ();
+
+ return 0;
+ }
+ ACE_CATCH (CORBA::UserException, ue)
+ {
+ ACE_PRINT_EXCEPTION (ue,
+ "User exception: ");
+ return 1;
+ }
+ ACE_CATCH (CORBA::SystemException, se)
+ {
+ ACE_PRINT_EXCEPTION (se,
+ "System exception: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/examples/Notify/Federation/SpaceCraft/SpaceCraft.mpc b/TAO/orbsvcs/examples/Notify/Federation/SpaceCraft/SpaceCraft.mpc
new file mode 100644
index 00000000000..8c44304de30
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Federation/SpaceCraft/SpaceCraft.mpc
@@ -0,0 +1,14 @@
+// -*- MPC -*-
+// $Id$
+
+project : rmcast, orbsvcsexe, notification, notification_skel, notification_serv, typecodefactory {
+ exename = craft
+ after += Gate
+ libs += Gate
+
+ specific (automake) {
+ includes += $(srcdir)/..
+ } else {
+ includes += ..
+ }
+}
diff --git a/TAO/orbsvcs/examples/Notify/Filter/Filter.cpp b/TAO/orbsvcs/examples/Notify/Filter/Filter.cpp
new file mode 100644
index 00000000000..a2aa9dbf434
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Filter/Filter.cpp
@@ -0,0 +1,507 @@
+/* -*- C++ -*- $Id$ */
+
+#include "Filter.h"
+
+ACE_RCSID(Filter, Filter, "$Id$")
+
+#define NOTIFY_FACTORY_NAME "NotifyEventChannelFactory"
+#define NAMING_SERVICE_NAME "NameService"
+#define CA_FILTER "threshold < 20"
+#define SA_FILTER "threshold > 10"
+#define TCL_GRAMMAR "TCL"
+#define EVENTS_TO_SEND 30
+#define EVENTS_EXPECTED_TO_RECEIVE 9*4 // 2 consumers get the same events from 2 suppliers
+
+ ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> g_result_count = 0;
+
+FilterClient::FilterClient (void)
+ :done_ (0)
+{
+ g_result_count = 0;
+ // No-Op.
+ ifgop_ = CosNotifyChannelAdmin::AND_OP;
+}
+
+FilterClient::~FilterClient ()
+{
+ this->ec_->destroy ();
+}
+
+void
+FilterClient::init (int argc, char *argv [] ACE_ENV_ARG_DECL)
+{
+ init_ORB (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ resolve_Notify_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ create_EC (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ create_supplieradmin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ create_consumeradmin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ create_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ create_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+FilterClient::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ send_events (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (g_result_count != EVENTS_EXPECTED_TO_RECEIVE)
+ { // if we still need to wait for events, run the orb.
+ while (!this->done_)
+ if (this->orb_->work_pending ())
+ this->orb_->perform_work ();
+ }
+}
+
+void
+FilterClient::done (void)
+{
+ this->done_ = 1;
+}
+
+void
+FilterClient::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;
+}
+
+void
+FilterClient::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
+FilterClient::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
+FilterClient::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
+FilterClient::create_supplieradmin (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+
+ supplier_admin_ =
+ ec_->new_for_suppliers (this->ifgop_, adminid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (supplier_admin_.in ()));
+
+ CosNotifyFilter::FilterFactory_var ffact =
+ ec_->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // setup a filter at the consumer admin
+ CosNotifyFilter::Filter_var sa_filter =
+ ffact->create_filter (TCL_GRAMMAR ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (sa_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 (SA_FILTER);
+
+ sa_filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_admin_->add_filter (sa_filter.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+FilterClient:: create_consumeradmin (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+
+ consumer_admin_ =
+ ec_->new_for_consumers (this->ifgop_, adminid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (consumer_admin_.in ()));
+
+ CosNotifyFilter::FilterFactory_var ffact =
+ ec_->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // setup a filter at the consumer admin
+ CosNotifyFilter::Filter_var ca_filter =
+ ffact->create_filter (TCL_GRAMMAR ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (ca_filter.in ()));
+
+ /* struct ConstraintExp {
+ CosNotification::EventTypeSeq event_types;
+ string constraint_expr;
+ };
+ */
+ CosNotifyFilter::ConstraintExpSeq constraint_list (1);
+ constraint_list.length (1);
+
+ constraint_list[0].event_types.length (0);
+ constraint_list[0].constraint_expr = CORBA::string_dup (CA_FILTER);
+
+ ca_filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer_admin_->add_filter (ca_filter.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+FilterClient::create_consumers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // startup the first consumer.
+ ACE_NEW_THROW_EX (consumer_1,
+ Filter_StructuredPushConsumer (this, "consumer1"),
+ CORBA::NO_MEMORY ());
+
+ consumer_1->connect (consumer_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // startup the second consumer.
+ ACE_NEW_THROW_EX (consumer_2,
+ Filter_StructuredPushConsumer (this, "consumer2"),
+ CORBA::NO_MEMORY ());
+
+ consumer_2->connect (consumer_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+FilterClient::create_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // startup the first supplier
+ ACE_NEW_THROW_EX (supplier_1,
+ Filter_StructuredPushSupplier ("supplier1"),
+ CORBA::NO_MEMORY ());
+
+ supplier_1->connect (supplier_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // startup the second supplier
+ ACE_NEW_THROW_EX (supplier_2,
+ Filter_StructuredPushSupplier ("supplier2"),
+ CORBA::NO_MEMORY ());
+
+ supplier_2->connect (supplier_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+FilterClient::send_events (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
+ event.header.variable_header.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;
+
+ event.filterable_data[0].value <<= (CORBA::Long)4;
+
+ // any
+ event.remainder_of_body <<= (CORBA::Long)4;
+
+ for (int i = 0; i < EVENTS_TO_SEND; i++)
+ {
+ event.filterable_data[0].value <<= (CORBA::Long)i;
+
+ // any
+ event.remainder_of_body <<= (CORBA::Long)i;
+
+ supplier_1->send_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_2->send_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+
+Filter_StructuredPushConsumer::Filter_StructuredPushConsumer (FilterClient* filter, const char* my_name)
+ :filter_ (filter),
+ my_name_ (my_name)
+{
+}
+
+Filter_StructuredPushConsumer::~Filter_StructuredPushConsumer (void)
+{
+}
+
+void
+Filter_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
+Filter_StructuredPushConsumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->proxy_supplier_->
+ disconnect_structured_push_supplier(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Filter_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
+Filter_StructuredPushConsumer::push_structured_event
+ (const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ CORBA::Long val;
+
+ notification.remainder_of_body >>= val;
+
+ // @@ Pradeep: for your tests try to make sure that you count the
+ // number of expected and sent events to verify that things work
+ // correctly in an automatic way...
+
+
+ ACE_DEBUG ((LM_DEBUG,
+ "%s received event, %d\n", my_name_.fast_rep (), val));
+
+ ACE_DEBUG ((LM_DEBUG,"event count %d\n", g_result_count.value ()));
+
+ if (++g_result_count == EVENTS_EXPECTED_TO_RECEIVE)
+ this->filter_->done (); // all events received, we're done.
+}
+
+void
+Filter_StructuredPushConsumer::disconnect_structured_push_consumer
+ (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ // No-Op.
+}
+
+
+/*****************************************************************/
+
+Filter_StructuredPushSupplier::Filter_StructuredPushSupplier (const char* my_name)
+ :my_name_ (my_name)
+{
+}
+
+Filter_StructuredPushSupplier::~Filter_StructuredPushSupplier ()
+{
+}
+
+void
+Filter_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
+Filter_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
+Filter_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
+Filter_StructuredPushSupplier::send_event
+ (const CosNotification::StructuredEvent& event ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (this->proxy_consumer_.in ()));
+
+ ACE_DEBUG ((LM_DEBUG,
+ "%s is sending an event \n", my_name_.fast_rep ()));
+
+ proxy_consumer_->push_structured_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Filter_StructuredPushSupplier::disconnect_structured_push_supplier
+ (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ // No-Op.
+}
+
diff --git a/TAO/orbsvcs/examples/Notify/Filter/Filter.h b/TAO/orbsvcs/examples/Notify/Filter/Filter.h
new file mode 100644
index 00000000000..e7f9cd236a4
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Filter/Filter.h
@@ -0,0 +1,261 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// Filter.h
+//
+// = DESCRIPTION
+// Class to demo structured event filtering.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_FILTER_CLIENT_H
+#define NOTIFY_FILTER_CLIENT_H
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "ace/SString.h"
+
+class Filter_StructuredPushConsumer;
+class Filter_StructuredPushSupplier;
+
+class FilterClient
+{
+ // = TITLE
+ // Filter Client
+ // = DESCRIPTION
+ // Client example that shows how to do Structured Event filtering
+ // in the Notification Service.
+
+ public:
+ // = Initialization and Termination
+ FilterClient (void);
+ // Constructor
+
+ ~FilterClient ();
+ // Destructor
+
+ void init (int argc, char *argv [] ACE_ENV_ARG_DECL);
+ // Init the Client.
+
+ void run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the demo.
+
+ void done (void);
+ // Consumer calls done, We're done.
+
+ 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.
+
+ Filter_StructuredPushConsumer* consumer_1;
+ // Consumer #1
+
+ Filter_StructuredPushConsumer* consumer_2;
+ // Consumer #2
+
+ Filter_StructuredPushSupplier* supplier_1;
+ // Supplier #1
+
+ Filter_StructuredPushSupplier* supplier_2;
+ // Supplier #2
+
+ CORBA::Boolean done_;
+ // Set this flag to exit the run loop.
+};
+
+/*****************************************************************/
+class Filter_StructuredPushConsumer
+ : public POA_CosNotifyComm::StructuredPushConsumer
+{
+ // = TITLE
+ // Filter_StructuredPushConsumer
+ //
+ // = DESCRIPTION
+ // Consumer for the Filter example.
+ //
+
+ public:
+ // = Initialization and Termination code
+ Filter_StructuredPushConsumer (FilterClient* filter, const char *my_name);
+ // 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.
+
+protected:
+ // = Data members
+
+ FilterClient* filter_;
+ // The callback for <done>
+
+ ACE_CString my_name_;
+ // The name of this consumer.
+
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_var proxy_supplier_;
+ // The proxy that we are connected to.
+
+ CosNotifyChannelAdmin::ProxyID proxy_supplier_id_;
+ // The proxy_supplier id.
+
+ // = Methods
+ virtual ~Filter_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 Filter_StructuredPushSupplier
+ : public POA_CosNotifyComm::StructuredPushSupplier
+{
+ // = TITLE
+ // Filter_StructuredPushSupplier
+ //
+ // = DESCRIPTION
+ // Supplier for the filter example.
+ //
+ public:
+ // = Initialization and Termination code
+ Filter_StructuredPushSupplier (const char* my_name);
+ // 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 (const CosNotification::StructuredEvent& event
+ ACE_ENV_ARG_DECL);
+ // Send one event.
+
+protected:
+ // = Data members
+ ACE_CString my_name_;
+ // The name of this consumer.
+
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var proxy_consumer_;
+ // The proxy that we are connected to.
+
+ CosNotifyChannelAdmin::ProxyID proxy_consumer_id_;
+ // This supplier's id.
+
+ // = Protected Methods
+ virtual ~Filter_StructuredPushSupplier ();
+ // Destructor
+
+ // = NotifySubscribe
+ 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
+ ));
+};
+
+#endif /* NOTIFY_FILTER_CLIENT_H */
diff --git a/TAO/orbsvcs/examples/Notify/Filter/Makefile.am b/TAO/orbsvcs/examples/Notify/Filter/Makefile.am
new file mode 100644
index 00000000000..f7fb9130144
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Filter/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
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.Notify_Filter.am
+
+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 = \
+ Filter.cpp \
+ main.cpp \
+ Filter.h
+
+main_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.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
+
+## 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/examples/Notify/Filter/Notify_Filter.mpc b/TAO/orbsvcs/examples/Notify/Filter/Notify_Filter.mpc
new file mode 100644
index 00000000000..0c0e54324fc
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Filter/Notify_Filter.mpc
@@ -0,0 +1,5 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcsexe, notification, notification_skel, naming {
+}
diff --git a/TAO/orbsvcs/examples/Notify/Filter/README b/TAO/orbsvcs/examples/Notify/Filter/README
new file mode 100644
index 00000000000..ddc5af0fca2
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Filter/README
@@ -0,0 +1,23 @@
+Filter example:
+
+This example shows how to filter structured events in the Notification Service.
+
+The Notification service must be up and running before launching this example.
+(See the README under $TAO_ROOT/orbsvcs/Notify_Service for more details.)
+
+The example connects to the Notification Service's factory object and creates
+an event channel. It then hooks up 2 suppliers and consumers with the EC.
+The consumers and suppliers use the <TAO_Notify_StructuredPushConsumer> and
+<TAO_Notify_StructuredPushSupplier> classes which are utility classes included
+with the Notification Service to help developers write consumers and suppliers.
+
+Both the suppliers send 30 events to the EC and contain the event property
+"threshold".
+Only events in the "threshold" range 10 to 20 are delivered to the consumers
+because of the filters setup at the ConsumerAdmin and SupplierAdmin.
+
+Similar filters can be setup in the ConsumerProxy and SupplierProxy classes.
+
+thanks,
+Pradeep
+<pradeep@cs.wustl.edu>
diff --git a/TAO/orbsvcs/examples/Notify/Filter/main.cpp b/TAO/orbsvcs/examples/Notify/Filter/main.cpp
new file mode 100644
index 00000000000..845f7ab68f7
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Filter/main.cpp
@@ -0,0 +1,35 @@
+// -*- C++ -*-
+// $Id$
+
+#include "Filter.h"
+
+int
+main (int argc, char *argv [])
+{
+ FilterClient client;
+
+ 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;
+ }
+ ACE_CATCH (CORBA::UserException, ue)
+ {
+ ACE_PRINT_EXCEPTION (ue,
+ "TLS_Client user error: ");
+ return 1;
+ }
+ ACE_CATCH (CORBA::SystemException, se)
+ {
+ ACE_PRINT_EXCEPTION (se,
+ "Filter system error: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/Notify/Filter/run_test.pl b/TAO/orbsvcs/examples/Notify/Filter/run_test.pl
new file mode 100755
index 00000000000..0a8753dc3e5
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Filter/run_test.pl
@@ -0,0 +1,73 @@
+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_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 ";
+
+$Filter = new PerlACE::Process ("Filter");
+
+$Filter_Args = "-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;
+}
+
+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;
+}
+
+$Filter->Arguments ($Filter_Args);
+$args = $Filter->Arguments ();
+print STDERR "Running Filter with arguments: $args\n";
+$status = $Filter->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Filter returned $status\n";
+ $Filter->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+$Notification->Kill ();
+unlink $notify_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/Consumer.cpp b/TAO/orbsvcs/examples/Notify/Lanes/Consumer.cpp
new file mode 100644
index 00000000000..17d2109cfb0
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/Consumer.cpp
@@ -0,0 +1,171 @@
+// $Id$
+
+#include "Consumer.h"
+
+ACE_RCSID (Notify,
+ TAO_Notify_Lanes_Consumer,
+ "$Id$")
+
+
+TAO_Notify_Lanes_Consumer::TAO_Notify_Lanes_Consumer (TAO_Notify_ORB_Objects& orb_objects)
+ : orb_objects_ (orb_objects)
+{
+}
+
+TAO_Notify_Lanes_Consumer::~TAO_Notify_Lanes_Consumer (void)
+{
+}
+
+void
+TAO_Notify_Lanes_Consumer::init (PortableServer::POA_var& poa, CosNotifyChannelAdmin::ConsumerAdmin_var& admin, ACE_CString& event_type ACE_ENV_ARG_DECL)
+{
+ this->default_POA_ = poa;
+ this->admin_ = admin;
+ this->event_type_ = event_type;
+
+ this->connect (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+PortableServer::POA_ptr
+TAO_Notify_Lanes_Consumer::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+void
+TAO_Notify_Lanes_Consumer::run (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ // Nothing to do.
+}
+
+void
+TAO_Notify_Lanes_Consumer::connect (ACE_ENV_SINGLE_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 =
+ this->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 ()));
+
+ this->proxy_supplier_->connect_structured_push_consumer (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Call subscription_change to inform the supplier that this consumer is available.
+ CosNotification::EventTypeSeq added (1);
+ CosNotification::EventTypeSeq removed;
+
+ added.length (1);
+ added[0].domain_name = CORBA::string_dup ("TEST_DOMAIN");
+ added[0].type_name = CORBA::string_dup (this->event_type_.c_str ());
+
+ this->proxy_supplier_->subscription_change (added, removed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Lanes_Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->proxy_supplier_->disconnect_structured_push_supplier(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Lanes_Consumer::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
+TAO_Notify_Lanes_Consumer::push_structured_event (const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Check the current threads priority.
+ RTCORBA::Priority thread_priority =
+ this->orb_objects_.current_->the_priority (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ const CosNotification::PropertySeq& prop_seq = notification.header.variable_header;
+
+ // Extract the priority at which the supplier send it.
+ RTCORBA::Priority 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;
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t) Consumer received event with priority = %d and thread priority = %d\n",
+ event_priority, thread_priority));
+
+ // The current thread priority and the event priority must match.
+ if (event_priority != thread_priority)
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t) Error: Event priority and thread priority are different. \n"));
+
+ // Disconnect from the EC
+ this->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ // Deactivate this object.
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ // We received the event, shutdown the ORB.
+ this->orb_objects_.orb_->shutdown (1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Consumer error "));
+
+ return;
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_Notify_Lanes_Consumer::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ 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
+TAO_Notify_Lanes_Consumer::disconnect_structured_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/Consumer.h b/TAO/orbsvcs/examples/Notify/Lanes/Consumer.h
new file mode 100644
index 00000000000..0f3c3d76dd9
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/Consumer.h
@@ -0,0 +1,111 @@
+/* -*- C++ -*- */
+/**
+ * @file Consumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_CONSUMER_H
+#define TAO_Notify_CONSUMER_H
+
+#include /**/ "ace/pre.h"
+
+#include "ORB_Objects.h"
+#include "tao/RTCORBA/RTCORBA.h"
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "ace/SString.h"
+
+/**
+ * @class TAO_Notify_Lanes_Consumer
+ *
+ * @brief Consumer
+ *
+ */
+
+class TAO_Notify_Lanes_Consumer
+ : public POA_CosNotifyComm::StructuredPushConsumer
+{
+public:
+ /// Constuctor
+ TAO_Notify_Lanes_Consumer (TAO_Notify_ORB_Objects& orb_objects);
+
+ /// Init
+ void init (PortableServer::POA_var& poa, CosNotifyChannelAdmin::ConsumerAdmin_var& admin, ACE_CString& event_type ACE_ENV_ARG_DECL);
+
+ /// Run
+ void run (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+protected:
+ // = Data members
+
+ /// ORB Objects.
+ TAO_Notify_ORB_Objects orb_objects_;
+
+ /// The proxy that we are connected to.
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_var proxy_supplier_;
+
+ /// The proxy_supplier id.
+ CosNotifyChannelAdmin::ProxyID proxy_supplier_id_;
+
+ // POA.
+ PortableServer::POA_var default_POA_;
+
+ // The Consumer Admin
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin_;
+
+ /// The Type the Consumer should subscribe to.
+ ACE_CString event_type_;
+
+ // = Methods
+ /// Destructor
+ virtual ~TAO_Notify_Lanes_Consumer (void);
+
+ // = ServantBase operations
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// Connect the Consumer to the EventChannel.
+ /// Creates a new proxy supplier and connects to it.
+ void connect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Disconnect the supplier.
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Deactivate.
+ void deactivate (ACE_ENV_SINGLE_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
+ ));
+
+ // = 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
+ ));
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_CONSUMER_H */
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/Consumer_Client.cpp b/TAO/orbsvcs/examples/Notify/Lanes/Consumer_Client.cpp
new file mode 100644
index 00000000000..942d444d0cf
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/Consumer_Client.cpp
@@ -0,0 +1,269 @@
+// $Id$
+
+#include "Consumer_Client.h"
+#include "Consumer.h"
+#include "ORB_Run_Task.h"
+#include "ace/Arg_Shifter.h"
+#include "orbsvcs/NotifyExtC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "tao/ORB_Core.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_errno.h"
+
+ACE_RCSID (Notify, TAO_Notify_Lanes_Consumer_Client, "$Id$")
+
+TAO_Notify_Lanes_Consumer_Client::TAO_Notify_Lanes_Consumer_Client (TAO_Notify_ORB_Objects& orb_objects)
+ : orb_objects_ (orb_objects)
+ , lane_priority_ (0)
+ , consumer_ (0)
+{
+}
+
+TAO_Notify_Lanes_Consumer_Client::~TAO_Notify_Lanes_Consumer_Client ()
+{
+}
+
+int
+TAO_Notify_Lanes_Consumer_Client::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("-LanePriority")))) // LanePriority
+ {
+ if (current_arg != 0)
+ {
+ this->lane_priority_ = ACE_OS::atoi (current_arg);
+
+ char type[BUFSIZ];
+ ACE_OS::sprintf (type, "TEST_TYPE_%d", this->lane_priority_);
+ this->event_type_ = type;
+ }
+
+ arg_shifter.consume_arg ();
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+
+ return 0;
+}
+
+void
+TAO_Notify_Lanes_Consumer_Client::initialize (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t)Initializing Consumer Client with lane priority = %d, event type = (%s)\n"
+ , this->lane_priority_, this->event_type_.c_str ()));
+
+ PortableServer::POAManager_var poa_manager =
+ this->orb_objects_.root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Resolve the Notification Factory.
+ CosNotifyChannelAdmin::EventChannelFactory_var ecf = this->orb_objects_.notify_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Find the EventChannel created by the supplier.
+ CosNotifyChannelAdmin::ChannelIDSeq_var channel_seq = ecf->get_all_channels (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::EventChannel_var ec;
+
+ if (channel_seq->length() > 0)
+ {
+ ec = ecf->get_event_channel (channel_seq[0] ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "No Event Channel active!\n"));
+ return;
+ }
+
+ // Create a Consumer Admin
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->new_for_consumers (CosNotifyChannelAdmin::AND_OP, adminid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (consumer_admin.in ()));
+
+ PortableServer::POA_var rt_poa = this->create_rt_poa (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Create a Consumer
+ this->consumer_ = new TAO_Notify_Lanes_Consumer (this->orb_objects_);
+
+ // Initialize it.
+ this->consumer_->init (rt_poa, consumer_admin, this->event_type_ ACE_ENV_ARG_PARAMETER);
+}
+
+PortableServer::POA_ptr
+TAO_Notify_Lanes_Consumer_Client::create_rt_poa (ACE_ENV_SINGLE_ARG_DECL)
+{
+ PortableServer::POA_var rt_poa;
+
+ // Create an RT POA with a lane at the given priority.
+ CORBA::Policy_var priority_model_policy;
+ CORBA::Policy_var lanes_policy;
+
+ CORBA::Policy_var activation_policy =
+ this->orb_objects_.root_poa_->create_implicit_activation_policy (PortableServer::IMPLICIT_ACTIVATION ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (rt_poa._retn ());
+
+ // Create a priority model policy.
+ priority_model_policy =
+ this->orb_objects_.rt_orb_->create_priority_model_policy (RTCORBA::CLIENT_PROPAGATED
+ , 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (rt_poa._retn ());
+
+ RTCORBA::ThreadpoolLanes lanes (1);
+ lanes.length (1);
+
+ lanes[0].lane_priority = this->lane_priority_;
+ lanes[0].static_threads = 1;
+ lanes[0].dynamic_threads = 0;
+
+
+ // Create a thread-pool.
+ CORBA::ULong stacksize = 0;
+ CORBA::Boolean allow_request_buffering = 0;
+ CORBA::ULong max_buffered_requests = 0;
+ CORBA::ULong max_request_buffer_size = 0;
+ CORBA::Boolean allow_borrowing = 0;
+
+ // Create the thread-pool.
+ RTCORBA::ThreadpoolId threadpool_id =
+ this->orb_objects_.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_RETURN (rt_poa._retn ());
+
+ // Create a thread-pool policy.
+ lanes_policy =
+ this->orb_objects_.rt_orb_->create_threadpool_policy (threadpool_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (rt_poa._retn ());
+
+ CORBA::PolicyList poa_policy_list;
+
+ poa_policy_list.length (3);
+ poa_policy_list[0] = priority_model_policy;
+ poa_policy_list[1] = activation_policy;
+ poa_policy_list[2] = lanes_policy;
+
+ PortableServer::POAManager_var poa_manager =
+ this->orb_objects_.root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (rt_poa._retn ());
+
+ rt_poa = this->orb_objects_.root_poa_->create_POA ("RT POA!",
+ poa_manager.in (),
+ poa_policy_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (rt_poa._retn ());
+
+ return rt_poa._retn ();
+}
+
+void
+TAO_Notify_Lanes_Consumer_Client::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->consumer_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+int
+TAO_Notify_Lanes_Consumer_Client::svc (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize this threads priority.
+ this->orb_objects_.current_->the_priority (0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->initialize (ACE_ENV_SINGLE_ARG_PARAMETER); //Init the Client
+ ACE_TRY_CHECK;
+
+ this->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Supplier error "));
+
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+main (int argc, char *argv [])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize an ORB
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_Notify_ORB_Objects orb_objects;
+
+ orb_objects.init (orb ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_Notify_ORB_Run_Task orb_run_task (orb_objects);
+
+ TAO_Notify_Lanes_Consumer_Client client (orb_objects);
+
+ if (client.parse_args (argc, argv) != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Consumer_Client::Error parsing options\n"));
+ return -1;
+ }
+
+ long flags = THR_NEW_LWP | THR_JOINABLE;
+
+ flags |=
+ orb->orb_core ()->orb_params ()->thread_creation_flags ();
+
+
+ if (orb_run_task.activate (flags) == -1 || client.activate (flags) == -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. \n")));
+ }
+
+ orb_run_task.thr_mgr ()->wait ();
+ client.thr_mgr ()->wait ();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Consumer Client error "));
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/Consumer_Client.h b/TAO/orbsvcs/examples/Notify/Lanes/Consumer_Client.h
new file mode 100644
index 00000000000..31193b994f2
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/Consumer_Client.h
@@ -0,0 +1,77 @@
+/* -*- C++ -*- */
+/**
+ * @file Consumer_Client.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_CONSUMER_CLIENT_H
+#define TAO_Notify_CONSUMER_CLIENT_H
+
+#include /**/ "ace/pre.h"
+
+#include "ORB_Objects.h"
+
+#include "tao/RTCORBA/RTCORBA.h"
+
+#include "ace/SString.h"
+#include "ace/Task.h"
+
+class TAO_Notify_Lanes_Consumer;
+
+/**
+ * @class TAO_Notify_Lanes_Consumer_Client
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Lanes_Consumer_Client : public ACE_Task_Base
+{
+public:
+ /// Constuctor
+ TAO_Notify_Lanes_Consumer_Client (TAO_Notify_ORB_Objects& orb_objects);
+
+ /// Destructor
+ ~TAO_Notify_Lanes_Consumer_Client ();
+
+ /// Init
+ void initialize (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Run
+ void run (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Parse Args
+ int parse_args (int argc, char *argv[]);
+
+ /// The thread entry point.
+ virtual int svc (void);
+
+protected:
+ /// Create an RT POA with a single lane at the specified RT Priority.
+ PortableServer::POA_ptr create_rt_poa (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// ORB Objects.
+ TAO_Notify_ORB_Objects orb_objects_;
+
+ /// Lock to serialize internal state.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// Count how many consumers are done
+ int consumer_done_count_;
+
+ /// The Priority that we want the consumer lane to be at.
+ RTCORBA::Priority lane_priority_;
+
+ /// The Consumer.
+ TAO_Notify_Lanes_Consumer* consumer_;
+
+ /// The Type the Consumer should subscribe to.
+ ACE_CString event_type_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_CONSUMER_CLIENT_H */
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/Makefile.am b/TAO/orbsvcs/examples/Notify/Lanes/Makefile.am
new file mode 100644
index 00000000000..3115e27c5f6
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/Makefile.am
@@ -0,0 +1,129 @@
+## 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.Notify_Lanes_Consumer.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+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_Client.cpp \
+ ORB_Objects.cpp \
+ ORB_Run_Task.cpp \
+ Consumer.h \
+ Consumer_Client.h \
+ ORB_Objects.h \
+ ORB_Run_Task.h
+
+Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RT_Notification.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.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_RT_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Notify_Lanes_Supplier.am
+
+if BUILD_RT_CORBA
+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 \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Supplier_SOURCES = \
+ ORB_Objects.cpp \
+ ORB_Run_Task.cpp \
+ Supplier.cpp \
+ Supplier_Client.cpp \
+ ORB_Objects.h \
+ ORB_Run_Task.h \
+ Supplier.h \
+ Supplier_Client.h
+
+Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RT_Notification.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_CosNotification_Skel.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)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+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/examples/Notify/Lanes/Notify_Lanes.mpc b/TAO/orbsvcs/examples/Notify/Lanes/Notify_Lanes.mpc
new file mode 100644
index 00000000000..147604e0274
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/Notify_Lanes.mpc
@@ -0,0 +1,22 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Supplier): rtcorba, rtnotify, minimum_corba, naming {
+ exename = Supplier
+ Source_Files {
+ Supplier.cpp
+ Supplier_Client.cpp
+ ORB_Objects.cpp
+ ORB_Run_Task.cpp
+ }
+}
+
+project(*Consumer): notifytest, rtcorba, rtnotify, minimum_corba {
+ exename = Consumer
+ Source_Files {
+ Consumer.cpp
+ Consumer_Client.cpp
+ ORB_Objects.cpp
+ ORB_Run_Task.cpp
+ }
+}
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/ORB_Objects.cpp b/TAO/orbsvcs/examples/Notify/Lanes/ORB_Objects.cpp
new file mode 100644
index 00000000000..b26b9dbb0ec
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/ORB_Objects.cpp
@@ -0,0 +1,71 @@
+// $Id$
+
+#include "ORB_Objects.h"
+
+ACE_RCSID (Notify, TAO_Notify_ORB_Objects, "$Id$")
+
+TAO_Notify_ORB_Objects::TAO_Notify_ORB_Objects (void)
+{
+}
+
+void
+TAO_Notify_ORB_Objects::init (CORBA::ORB_var& orb ACE_ENV_ARG_DECL)
+{
+ this->orb_ = orb;
+
+ CORBA::Object_var object = this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->root_poa_ = PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Resolve the RTORB.
+ object = this->orb_->resolve_initial_references ("RTORB"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->rt_orb_ = RTCORBA::RTORB::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Resolve the Current
+ object = this->orb_->resolve_initial_references ("RTCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->current_ = RTCORBA::Current::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Resolve the Naming service
+ object = this->orb_->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->naming_ = CosNaming::NamingContextExt::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_Notify_ORB_Objects::~TAO_Notify_ORB_Objects ()
+{
+}
+
+CosNotifyChannelAdmin::EventChannelFactory_ptr
+TAO_Notify_ORB_Objects::notify_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::EventChannelFactory_var ecf;
+
+ // Look for the Notification Service
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup ("NotifyEventChannelFactory");
+
+ CORBA::Object_var object = this->naming_->resolve (name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ecf._retn ());
+
+ ecf = CosNotifyChannelAdmin::EventChannelFactory::_narrow (object.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ecf._retn ());
+
+ return ecf._retn ();
+}
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/ORB_Objects.h b/TAO/orbsvcs/examples/Notify/Lanes/ORB_Objects.h
new file mode 100644
index 00000000000..e846e43303b
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/ORB_Objects.h
@@ -0,0 +1,56 @@
+/* -*- C++ -*- */
+/**
+ * @file ORB_Objects.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_ORB_OBJECTS_H
+#define TAO_Notify_ORB_OBJECTS_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/RTCORBA/RTCORBA.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "orbsvcs/NotifyExtC.h"
+#include "orbsvcs/CosNamingC.h"
+
+/**
+ * @class TAO_Notify_ORB_Objects
+ *
+ * @brief Handy Objects that we keep asking the ORB for.
+ *
+ */
+class TAO_Notify_ORB_Objects
+{
+public:
+ /// Constuctor
+ TAO_Notify_ORB_Objects (void);
+
+ /// Destructor
+ ~TAO_Notify_ORB_Objects ();
+
+ /// Resolves all the references.
+ void init (CORBA::ORB_var& orb ACE_ENV_ARG_DECL);
+
+ /// Resolve Notification
+ CosNotifyChannelAdmin::EventChannelFactory_ptr notify_factory (ACE_ENV_SINGLE_ARG_DECL);
+
+ ///= Public Data
+ CORBA::ORB_var orb_;
+
+ PortableServer::POA_var root_poa_;
+
+ RTCORBA::RTORB_var rt_orb_;
+
+ RTCORBA::Current_var current_;
+
+ CosNaming::NamingContextExt_var naming_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_ORB_OBJECTS_H */
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/ORB_Run_Task.cpp b/TAO/orbsvcs/examples/Notify/Lanes/ORB_Run_Task.cpp
new file mode 100644
index 00000000000..953328f78c5
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/ORB_Run_Task.cpp
@@ -0,0 +1,33 @@
+// $Id$
+
+#include "ORB_Run_Task.h"
+
+ACE_RCSID (Notify, TAO_Notify_ORB_Run_Task, "$Id$")
+
+TAO_Notify_ORB_Run_Task::TAO_Notify_ORB_Run_Task (TAO_Notify_ORB_Objects& orb_objects)
+ : orb_objects_ (orb_objects)
+{
+}
+
+TAO_Notify_ORB_Run_Task::~TAO_Notify_ORB_Run_Task ()
+{
+}
+
+int
+TAO_Notify_ORB_Run_Task::svc (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->orb_objects_.current_->the_priority (0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->orb_objects_.orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/ORB_Run_Task.h b/TAO/orbsvcs/examples/Notify/Lanes/ORB_Run_Task.h
new file mode 100644
index 00000000000..83fd657406b
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/ORB_Run_Task.h
@@ -0,0 +1,44 @@
+/* -*- C++ -*- */
+/**
+ * @file ORB_Run_Task.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_ORB_RUN_TASK_H
+#define TAO_Notify_ORB_RUN_TASK_H
+
+#include /**/ "ace/pre.h"
+#include "ace/Task.h"
+
+#include "ORB_Objects.h"
+
+/**
+ * @class TAO_Notify_ORB_Run_Task
+ *
+ * @brief Run the ORB::run method in a seperate thread.
+ *
+ */
+class TAO_Notify_ORB_Run_Task : public ACE_Task_Base
+{
+public:
+ /// Constuctor
+ TAO_Notify_ORB_Run_Task (TAO_Notify_ORB_Objects& orb_objects);
+
+ /// Destructor
+ ~TAO_Notify_ORB_Run_Task ();
+
+ /// The thread entry point.
+ virtual int svc (void);
+
+private:
+ /// ORB Objects.
+ TAO_Notify_ORB_Objects orb_objects_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_ORB_RUN_TASK_H */
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/README b/TAO/orbsvcs/examples/Notify/Lanes/README
new file mode 100644
index 00000000000..f08b653ab39
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/README
@@ -0,0 +1,62 @@
+
+Lanes example
+=============
+
+This example shows how to use RTCORBA lanes with Notification to
+create a priority path between suppliers and consumers.
+
+The example consists of 2 executables:
+./Supplier and ./Consumer
+
+Each of these encapsulate a Supplier and Consumer process consisting
+of exactly 1 Notification PushSupplier and a Notification PushConsumer
+respectively.
+
+First we start the Naming and RT Notification Service.
+
+Then we start the Supplier. The Supplier starts up and creates an event channel. It uses the
+<set_qos> to set the ThreadpoolLanesParams QoS on the event
+channel. This QoS specifies a lane for each priority that a consumer
+will run at. There is also an extra lane created at priority 0 (Note:
+the example uses the continuous priority mapping policy) to facilitate
+invocations by the supplier's worker thread for administrative methods
+(such as <subscription_change>).
+
+Then we start each consumer at prorities 1,2.3.. sequentially. The
+run_test.pl script shows 2 consumers at priority 1 and 2.
+
+Each consumer is specified a priority at which it is hosted in an RT
+POA. The consumer client process creates an RT POA with 1 lane and
+activates the consumer in it.
+
+Each consumer send a subscription change message to the event channel
+for its type. The message reaches the supplier and it updates its
+count of the consumers that have connected.
+
+When the expected number of consumers have connected, the suppliers
+starts a loop in which it send an event each to the event channel with
+the correct priority and evvent type for each consumer.
+
+The RT_Notification matches the lane for the proxy consumer and sends
+the event to the consumer using the CLIENT_PROPAGATED priority model.
+
+Running the example
+===================
+
+Simply execute the run_test.pl script in this directoty.
+Remember, you must have root privileges to set RT priorities.
+
+Expected result:
+================
+
+You should see the following messages:
+
+(4784, 328)Initializing Consumer Client with lane priority = 2, event type = (TEST_TYPE_2)
+(6020, 6032)Initializing Consumer Client with lane priority = 1, event type = (TEST_TYPE_1)
+(6060, 4532) Supplier is sending an event of type TEST_TYPE_1 at priority 1
+(6020, 6068) Consumer received event with priority = 1 and thread priority = 1
+(6060, 4532) Supplier is sending an event of type TEST_TYPE_2 at priority 2
+(4784, 4760) Consumer received event with priority = 2 and thread priority = 2
+
+if there is a mismatch in the expected results. The consumer will
+print a warning message.
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/Supplier.cpp b/TAO/orbsvcs/examples/Notify/Lanes/Supplier.cpp
new file mode 100644
index 00000000000..8b3a2a50862
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/Supplier.cpp
@@ -0,0 +1,185 @@
+// $Id$
+
+#include "Supplier.h"
+
+ACE_RCSID (Notify, TAO_Notify_Lanes_Supplier, "$Id$")
+
+#include "tao/ORB_Core.h"
+
+TAO_Notify_Lanes_Supplier::TAO_Notify_Lanes_Supplier (TAO_Notify_ORB_Objects& orb_objects)
+ : orb_objects_ (orb_objects)
+ , proxy_consumer_id_ (0)
+ , expected_consumer_count_ (2)
+ , consumers_connected_ (lock_)
+ , consumer_count_ (0)
+{
+}
+
+TAO_Notify_Lanes_Supplier::~TAO_Notify_Lanes_Supplier ()
+{
+}
+
+void
+TAO_Notify_Lanes_Supplier::init (CosNotifyChannelAdmin::SupplierAdmin_var& admin, int expected_consumer_count ACE_ENV_ARG_DECL)
+{
+ // First initialize the class members.
+ this->admin_ = admin;
+ this->expected_consumer_count_ = expected_consumer_count;
+
+ this->connect (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Lanes_Supplier::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // The Priority at which we send the first event to the first consumer.
+ RTCORBA::Priority priority = 1;
+
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_);
+
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t) Waiting for %d consumers to connect...\n", this->expected_consumer_count_));
+
+ // Wait till the consumers are ready to go.
+ while (this->consumer_count_ != this->expected_consumer_count_)
+ this->consumers_connected_.wait ();
+ }
+
+ // Send an event each to each consumer.
+ // Each Consumer expects a different priority.
+ for (int i = 0; i < this->expected_consumer_count_; ++i, ++priority)
+ {
+ // Set this threads priority.
+ this->orb_objects_.current_->the_priority (priority ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Make sure the priority was set, get the priority of the current thread.
+ RTCORBA::Priority thread_priority =
+ this->orb_objects_.current_->the_priority (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // We will send this event.
+ CosNotification::StructuredEvent event;
+
+ // Populate the Priority field so that the consumer can deduce the suppliers priority
+ // to do a sanity check when it receives the event.
+ CosNotification::PropertySeq& opt = event.header.variable_header;
+ opt.length (1);
+
+ CORBA::Any buffer;
+ buffer <<= (CORBA::Short) thread_priority;
+
+ opt[0].name = CORBA::string_dup (CosNotification::Priority);
+ opt[0].value = buffer;
+
+ // Set the domain and type nams in the event's fixed header.
+ char type[BUFSIZ];
+ ACE_OS::sprintf (type, "TEST_TYPE_%d", thread_priority);
+
+ event.header.fixed_header.event_type.domain_name = CORBA::string_dup("TEST_DOMAIN");
+ event.header.fixed_header.event_type.type_name = CORBA::string_dup(type);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P, %t) Supplier is sending an event of type %s at priority %d\n", type, thread_priority));
+
+ // send the event
+ this->send_event (event ACE_ENV_ARG_PARAMETER);
+ } // repeat for the next consumer at the next priority.
+
+ // Disconnect from the EC
+ this->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ // Deactivate this object.
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ // we're done. shutdown the ORB to exit the process.
+ this->orb_objects_.orb_->shutdown (1);
+}
+
+void
+TAO_Notify_Lanes_Supplier::connect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Activate the supplier object.
+ CosNotifyComm::StructuredPushSupplier_var objref = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Obtain the proxy.
+ CosNotifyChannelAdmin::ProxyConsumer_var proxyconsumer =
+ this->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 ()));
+
+ // connect to the proxyconsumer.
+ proxy_consumer_->connect_structured_push_supplier (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Lanes_Supplier::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
+TAO_Notify_Lanes_Supplier::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ 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
+TAO_Notify_Lanes_Supplier::subscription_change (const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & /*removed */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType
+ ))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_);
+
+ // Count the number of consumers connect and signal the supplier thread when the expected count have connected.
+ if (added.length () > 0)
+ {
+ if (++this->consumer_count_ == this->expected_consumer_count_)
+ this->consumers_connected_.signal ();
+ }
+}
+
+void
+TAO_Notify_Lanes_Supplier::send_event (const CosNotification::StructuredEvent& event ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (this->proxy_consumer_.in ()));
+
+ proxy_consumer_->push_structured_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Lanes_Supplier::disconnect_structured_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/Supplier.h b/TAO/orbsvcs/examples/Notify/Lanes/Supplier.h
new file mode 100644
index 00000000000..db4a8f816cd
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/Supplier.h
@@ -0,0 +1,110 @@
+/* -*- C++ -*- */
+/**
+ * @file Supplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_SUPPLIER_H
+#define TAO_Notify_SUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "ORB_Objects.h"
+#include "tao/RTCORBA/RTCORBA.h"
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "ace/SString.h"
+#include "ace/Condition_Thread_Mutex.h"
+
+/**
+ * @class TAO_Notify_Lanes_Supplier
+ *
+ * @brief Implement a Structured Supplier.
+ *
+ */
+class TAO_Notify_Lanes_Supplier
+ : public POA_CosNotifyComm::StructuredPushSupplier
+{
+ public:
+ // = Initialization and Termination code
+
+ /// Constructor.
+ TAO_Notify_Lanes_Supplier (TAO_Notify_ORB_Objects& orb_objects);
+
+ /// Init
+ void init (CosNotifyChannelAdmin::SupplierAdmin_var& admin, int count ACE_ENV_ARG_DECL);
+
+ /// Run
+ void run (ACE_ENV_SINGLE_ARG_DECL);
+
+protected:
+ // = Protected Methods
+
+ /// Connect the Supplier to the EventChannel.
+ /// Creates a new proxy consumer and connects to it.
+ void connect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Disconnect the supplier.
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Deactivate.
+ void deactivate (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Send one event.
+ virtual void send_event (const CosNotification::StructuredEvent& event ACE_ENV_ARG_DECL);
+
+ /// Destructor
+ virtual ~TAO_Notify_Lanes_Supplier ();
+
+ // = NotifySubscribe
+ 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
+ ));
+ /// = Data members
+
+ /// ORB Objects.
+ TAO_Notify_ORB_Objects orb_objects_;
+
+ /// The proxy that we are connected to.
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var proxy_consumer_;
+
+ /// This supplier's id.
+ CosNotifyChannelAdmin::ProxyID proxy_consumer_id_;
+
+ /// Number of Consumers expected to connect.
+ int expected_consumer_count_;
+
+ // The ORB that we use.
+ CORBA::ORB_var orb_;
+
+ // The Supplier Admin
+ CosNotifyChannelAdmin::SupplierAdmin_var admin_;
+
+ /// Lock to serialize internal state.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// Condition that consumers are connected.
+ TAO_SYNCH_CONDITION consumers_connected_;
+
+ /// Number of consumers connected.
+ int consumer_count_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_SUPPLIER_H */
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/Supplier_Client.cpp b/TAO/orbsvcs/examples/Notify/Lanes/Supplier_Client.cpp
new file mode 100644
index 00000000000..2acb6bcc18b
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/Supplier_Client.cpp
@@ -0,0 +1,272 @@
+// $Id$
+
+#include "Supplier_Client.h"
+
+#include "ORB_Run_Task.h"
+#include "ace/Arg_Shifter.h"
+#include "tao/ORB_Core.h"
+#include "ace/Sched_Params.h"
+#include "Supplier.h"
+#include "orbsvcs/NotifyExtC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "ace/OS_NS_errno.h"
+
+ACE_RCSID (Notify, TAO_Notify_Lanes_Supplier_Client, "$Id$")
+
+TAO_Notify_Lanes_Supplier_Client::TAO_Notify_Lanes_Supplier_Client (TAO_Notify_ORB_Objects& orb_objects)
+ : orb_objects_ (orb_objects)
+ ,supplier_ (0)
+ , consumer_count_ (2)
+{
+}
+
+TAO_Notify_Lanes_Supplier_Client::~TAO_Notify_Lanes_Supplier_Client ()
+{
+}
+
+int
+TAO_Notify_Lanes_Supplier_Client::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("-Consumers")))) // Number of consumers that we need to send an event to.
+ {
+ if (current_arg != 0)
+ {
+ this->consumer_count_ = ACE_OS::atoi (current_arg);
+ }
+
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-IORoutput")))) // The file to output the supplier ior to.
+ {
+ if (current_arg != 0)
+ {
+ this->ior_file_name_ = current_arg;
+ }
+
+ arg_shifter.consume_arg ();
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+
+ return 0;
+}
+
+void
+TAO_Notify_Lanes_Supplier_Client::initialize (ACE_ENV_SINGLE_ARG_DECL)
+{
+ PortableServer::POAManager_var poa_manager =
+ this->orb_objects_.root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::EventChannel_var ec = this->create_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Create a Supplier Admin
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP, adminid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (supplier_admin.in ()));
+
+ // Create a Supplier
+ this->supplier_ = new TAO_Notify_Lanes_Supplier (this->orb_objects_);
+
+ // Initialize it.
+ this->supplier_->init (supplier_admin, this->consumer_count_ ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::EventChannel_ptr
+TAO_Notify_Lanes_Supplier_Client::create_ec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::EventChannel_var ec;
+
+ CosNotifyChannelAdmin::EventChannelFactory_var ecf = this->orb_objects_.notify_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ec._retn ());
+
+ // Create an EventChannel
+ CosNotification::QoSProperties qos;
+ CosNotification::AdminProperties admin;
+
+ // Create an event channel
+ CosNotifyChannelAdmin::ChannelID id;
+
+ ec = ecf->create_channel (qos,
+ admin,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ec._retn ());
+
+ // Set the Qos : 2 Lanes
+ NotifyExt::ThreadPoolLanesParams tpl_params;
+
+ tpl_params.priority_model = NotifyExt::CLIENT_PROPAGATED;
+ tpl_params.server_priority = 0;
+ tpl_params.stacksize = 0;
+ tpl_params.lanes.length (this->consumer_count_ + 1);
+ tpl_params.allow_borrowing = 0;
+ tpl_params.allow_request_buffering = 0;
+ tpl_params.max_buffered_requests = 0;
+ tpl_params.max_request_buffer_size = 0;
+
+ /*
+ * Note that we actually create 1 extra Lane.
+ * The extra Lane at priority 0 is created to match the priority 0 of the supplier thread.
+ * As the ProxyConsumer is activated in an RT POA with lanes, each invocation must mach some lane.
+ * Now, we typically reserve higer priorities to make requests and the lowest priority 0 for administrative calls
+ * e.g. <subscription_change>. If we do not have a lane at the lowest 0 priority, then the invocation made from
+ * the supplier at priority 0 will fail.
+ */
+ tpl_params.lanes[0].lane_priority = 0; // Priority 0
+ tpl_params.lanes[0].static_threads = 1;
+ tpl_params.lanes[0].dynamic_threads = 0;
+
+ RTCORBA::Priority priority = 1; // The priority at which we send an event each.
+
+ for (int i = 1; i <= this->consumer_count_; ++i, ++priority)
+ {
+ tpl_params.lanes[i].lane_priority = priority;
+ tpl_params.lanes[i].static_threads = 1;
+ tpl_params.lanes[i].dynamic_threads = 0;
+ }
+
+ qos.length (1);
+ qos[0].name = CORBA::string_dup (NotifyExt::ThreadPoolLanes);
+ qos[0].value <<= tpl_params;
+
+ // Note that instead of <set_qos>, the <qos> can also be passed while creating the channel.
+ ec->set_qos (qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ec._retn ());
+
+ return ec._retn ();
+}
+
+void
+TAO_Notify_Lanes_Supplier_Client::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ /// First, signal that the supplier is ready.
+ this->write_ior (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Lanes_Supplier_Client::write_ior (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyComm::StructuredPushSupplier_var objref = this->supplier_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Write the ior to a file to signal waiting consumers.
+ FILE *ior_output_file = ACE_OS::fopen (this->ior_file_name_.c_str (), ACE_TEXT("w"));
+
+ if (ior_output_file != 0)
+ {
+ CORBA::String_var str =
+ this->orb_objects_.orb_->object_to_string (objref.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_OS::fprintf (ior_output_file,
+ "%s",
+ str.in ());
+ ACE_OS::fclose (ior_output_file);
+ }
+}
+
+int
+TAO_Notify_Lanes_Supplier_Client::svc (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->orb_objects_.current_->the_priority (0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->initialize (ACE_ENV_SINGLE_ARG_PARAMETER); //Init the Client
+ ACE_TRY_CHECK;
+
+ this->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Supplier error "));
+
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+main (int argc, char *argv [])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize an ORB
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create a holder for the common ORB Objects.
+ TAO_Notify_ORB_Objects orb_objects;
+
+ orb_objects.init (orb ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /* Run the ORB in a seperate thread */
+ TAO_Notify_ORB_Run_Task orb_run_task (orb_objects);
+
+ /* Create a Client */
+ TAO_Notify_Lanes_Supplier_Client client (orb_objects);
+
+ if (client.parse_args (argc, argv) != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Supplier_Client::Error parsing options\n"));
+ return -1;
+ }
+
+ long flags = THR_NEW_LWP | THR_JOINABLE;
+
+ flags |=
+ orb->orb_core ()->orb_params ()->thread_creation_flags ();
+
+ /* Both the tasks initialize themselves at Priority 0*/
+ if (orb_run_task.activate (flags) == -1 || client.activate (flags) == -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. \n")));
+ }
+
+ orb_run_task.thr_mgr ()->wait ();
+ client.thr_mgr ()->wait ();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Supplier Client error "));
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/Supplier_Client.h b/TAO/orbsvcs/examples/Notify/Lanes/Supplier_Client.h
new file mode 100644
index 00000000000..7dd4eb19259
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/Supplier_Client.h
@@ -0,0 +1,71 @@
+/* -*- C++ -*- */
+/**
+ * @file Supplier_Client.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_SUPPLIER_CLIENT_H
+#define TAO_Notify_SUPPLIER_CLIENT_H
+
+#include /**/ "ace/pre.h"
+#include "ace/Task.h"
+#include "ace/SString.h"
+
+#include "ORB_Objects.h"
+
+class TAO_Notify_Lanes_Supplier;
+
+/**
+ * @class TAO_Notify_Lanes_Supplier_Client
+ *
+ * @brief Supplier Client
+ *
+ */
+class TAO_Notify_Lanes_Supplier_Client : public ACE_Task_Base
+{
+public:
+ /// Constuctor
+ TAO_Notify_Lanes_Supplier_Client (TAO_Notify_ORB_Objects& orb_objects);
+
+ /// Destructor
+ ~TAO_Notify_Lanes_Supplier_Client ();
+
+ /// Init
+ void initialize (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Run
+ void run (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Parse Args
+ int parse_args (int argc, char *argv[]);
+
+ /// The thread entry point.
+ virtual int svc (void);
+
+protected:
+ /// Create an EC
+ CosNotifyChannelAdmin::EventChannel_ptr create_ec (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Write ior to file.
+ void write_ior (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// ORB Objects.
+ TAO_Notify_ORB_Objects orb_objects_;
+
+ /// Supplier that sends events.
+ TAO_Notify_Lanes_Supplier* supplier_;
+
+ /// The Number of consumers that we expect to send an event to.
+ int consumer_count_;
+
+ /// Name of the file to write the supplier ior to.
+ ACE_CString ior_file_name_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_SUPPLIER_CLIENT_H */
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/client.conf b/TAO/orbsvcs/examples/Notify/Lanes/client.conf
new file mode 100644
index 00000000000..52878238bc7
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/client.conf
@@ -0,0 +1 @@
+static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM -ORBPriorityMapping continuous" \ No newline at end of file
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/notify.conf b/TAO/orbsvcs/examples/Notify/Lanes/notify.conf
new file mode 100644
index 00000000000..9aa94294430
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/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_Service Service_Object * TAO_RT_Notification:_make_TAO_RT_Notify_Service () ""
diff --git a/TAO/orbsvcs/examples/Notify/Lanes/run_test.pl b/TAO/orbsvcs/examples/Notify/Lanes/run_test.pl
new file mode 100755
index 00000000000..5b808cbd5f6
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Lanes/run_test.pl
@@ -0,0 +1,128 @@
+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;
+
+# Lanes Example
+#
+
+$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 ("client.conf");
+
+$consumer_conf = PerlACE::LocalFile ("client.conf");
+
+$consumer2_conf = PerlACE::LocalFile ("client.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 ("Supplier");
+
+$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -ORBSvcConf $supplier_conf -IORoutput $supplier_ior";
+#$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -ORBSvcConf $supplier_conf -ORBDebugLevel 1";
+
+$Consumer = new PerlACE::Process ("Consumer");
+
+$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -ORBSvcConf $consumer_conf -LanePriority 1";
+#$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -ORBSvcConf $consumer_conf -ORBDebugLevel 1";
+
+$Consumer2 = new PerlACE::Process ("Consumer");
+
+$Consumer2_Args = "-ORBInitRef NameService=file://$naming_ior -ORBSvcConf $consumer2_conf -LanePriority 2";
+#$Consumer2_Args = "-ORBInitRef NameService=file://$naming_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";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+$Consumer->Arguments ($Consumer_Args);
+$args = $Consumer->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$status = $Consumer->Spawn ();
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Consumer returned $status\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+$Consumer2->Arguments ($Consumer2_Args);
+$args = $Consumer2->Arguments ();
+print STDERR "Running Consumer2 with arguments: $args\n";
+$status = $Consumer2->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Consumer2 returned $status\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+$Consumer->Wait ();
+$Supplier->Wait ();
+
+unlink $supplier_ior;
+
+$Notification->Kill ();
+unlink $notify_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/examples/Notify/Makefile.am b/TAO/orbsvcs/examples/Notify/Makefile.am
new file mode 100644
index 00000000000..2ddbd449fb9
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Makefile.am
@@ -0,0 +1,17 @@
+## 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 = \
+ Federation \
+ Filter \
+ Lanes \
+ Subscribe \
+ ThreadPool
+
diff --git a/TAO/orbsvcs/examples/Notify/README b/TAO/orbsvcs/examples/Notify/README
new file mode 100644
index 00000000000..7028c60fe5d
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/README
@@ -0,0 +1,18 @@
+
+Notification Service examples:
+
+This directory has examples to illustrate how to use the Notification Service
+
+Examples:
+
+Filter: A simple example to how how to do filtering of events.
+------
+An event passing through the channel encounters filters at the proxy,
+admin and channel level.This example shows how to setup filters and use them.
+
+Subscribe: A simple example to show how to specify subscription constraints.
+---------
+This example does not add any filters to keep the example simple.
+If filters are added, then they would be evaluated *after* the event type
+constraints have been met.
+Thus subscriptions are a way of provide coarse grain filtering.
diff --git a/TAO/orbsvcs/examples/Notify/Subscribe/Makefile.am b/TAO/orbsvcs/examples/Notify/Subscribe/Makefile.am
new file mode 100644
index 00000000000..fcbd47a2d9c
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Subscribe/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
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.Notify_Subscribe.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = Subscribe
+
+Subscribe_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
+
+Subscribe_SOURCES = \
+ Subscribe.cpp \
+ main.cpp \
+ Subscribe.h
+
+Subscribe_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.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
+
+## 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/examples/Notify/Subscribe/Notify_Subscribe.mpc b/TAO/orbsvcs/examples/Notify/Subscribe/Notify_Subscribe.mpc
new file mode 100644
index 00000000000..39521d11a30
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Subscribe/Notify_Subscribe.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcsexe, notification, notification_skel, naming, minimum_corba {
+ exename = Subscribe
+}
diff --git a/TAO/orbsvcs/examples/Notify/Subscribe/README b/TAO/orbsvcs/examples/Notify/Subscribe/README
new file mode 100644
index 00000000000..8dc7fac8cb6
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Subscribe/README
@@ -0,0 +1,28 @@
+Subscribe example:
+----------------
+Note: This example is under construction.
+
+The Notification service must be up and running before launching this example.
+(See the README under $TAO_ROOT/orbsvcs/Notify_Service for more details.)
+
+Description:
+------------
+This example sets subscription event type constraints (domain_name,type_name):
+
+At the consumer admin. C1 = ("domain_A", "Type_1").
+This means that all consumers connected to this admin object are interested
+in receiving events of "domain_A" and "Type_1".
+
+At consumer 1, C2 = ("domain_B", Type_2")
+At consumer 2, C3 = ("domain_C", Type_3")
+
+A supplier then send events of all 3 types to the event channel.
+i,e. event E1 with event type C1,
+ event E2 with event type C2 and
+ event E3 with event type C3.
+
+From the subscriptions, consumer1 receives E1 and E2, (not E3) and
+consumer2 receives E1 and E3 (not E2).
+
+running the ./Subscribe example will output the events received by each
+consumer. \ No newline at end of file
diff --git a/TAO/orbsvcs/examples/Notify/Subscribe/Subscribe.cpp b/TAO/orbsvcs/examples/Notify/Subscribe/Subscribe.cpp
new file mode 100644
index 00000000000..a7a0e96183f
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Subscribe/Subscribe.cpp
@@ -0,0 +1,471 @@
+/* -*- C++ -*- $Id$ */
+#include "Subscribe.h"
+
+ACE_RCSID(Notify, Subscribe, "$Id$")
+
+#define NOTIFY_FACTORY_NAME "NotifyEventChannelFactory"
+#define NAMING_SERVICE_NAME "NameService"
+
+#define DOMAIN_A "domain_a"
+#define DOMAIN_B "domain_b"
+#define DOMAIN_C "domain_c"
+
+#define TYPE_A "type_a"
+#define TYPE_B "type_b"
+#define TYPE_C "type_c"
+
+#define EVENT_COUNT 4 // number of events we expect the consumer to get from the EC
+
+ ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> g_result_count = 0; // we wait for 4 events.
+
+Subscribe::Subscribe (void)
+ : done_ (0)
+{
+ // No-Op.
+ ifgop_ = CosNotifyChannelAdmin::OR_OP;
+}
+
+Subscribe::~Subscribe ()
+{
+ this->ec_->destroy ();
+}
+
+void
+Subscribe::init (int argc, char *argv [] ACE_ENV_ARG_DECL)
+{
+ init_ORB (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ resolve_Notify_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ create_EC (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ create_supplieradmin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ create_consumeradmin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ create_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ create_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Subscribe::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->send_events (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (g_result_count != EVENT_COUNT) // if we still need to wait for events, run the orb.
+ { // if we still need to wait for events, run the orb.
+ while (!this->done_)
+ if (this->orb_->work_pending ())
+ this->orb_->perform_work ();
+ }
+}
+
+void
+Subscribe::done (void)
+{
+ this->done_ = 1;
+}
+
+void
+Subscribe::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;
+}
+
+void
+Subscribe::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
+Subscribe::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
+Subscribe::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
+Subscribe::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
+Subscribe:: 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
+Subscribe::create_consumers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ consumer_1_ = new Subscribe_StructuredPushConsumer (this);
+ consumer_1_->connect (this->consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer_2_ = new Subscribe_StructuredPushConsumer (this);
+ consumer_2_->connect (this->consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Subscribe::create_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ supplier_1_ = new Subscribe_StructuredPushSupplier ();
+ supplier_1_->connect (this->supplier_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_2_ = new Subscribe_StructuredPushSupplier ();
+ supplier_2_->connect (this->supplier_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Subscribe::send_events (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Setup the CA to receive event_type : "domain_A", "Type_a"
+ CosNotification::EventTypeSeq added(1);
+ CosNotification::EventTypeSeq removed (0);
+ added.length (1);
+
+ added[0].domain_name = CORBA::string_dup (DOMAIN_A);
+ added[0].type_name = CORBA::string_dup (TYPE_A);
+
+ this->consumer_admin_->subscription_change (added, removed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Setup the Consumer 1 to receive event_type : "domain_B", "Type_b"
+ CosNotification::EventTypeSeq added_1(1);
+ CosNotification::EventTypeSeq removed_1 (0);
+
+ added_1[0].domain_name = CORBA::string_dup (DOMAIN_B);
+ added_1[0].type_name = CORBA::string_dup (TYPE_B);
+ added_1.length (1);
+ removed_1.length (0);
+
+ this->consumer_1_->get_proxy_supplier ()->subscription_change (added_1, removed_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Setup the Consumer 2 to receive event_type : "domain_C", "Type_c"
+ CosNotification::EventTypeSeq added_2(1);
+ CosNotification::EventTypeSeq removed_2 (0);
+
+ added_2[0].domain_name = CORBA::string_dup (DOMAIN_C);
+ added_2[0].type_name = CORBA::string_dup (TYPE_C);
+ added_2.length (1);
+ removed_2.length (0);
+
+ this->consumer_2_->get_proxy_supplier ()->subscription_change (added_2, removed_2
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Create the events - one of each type
+ // Event 1
+ CosNotification::StructuredEvent event1;
+ event1.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup(DOMAIN_A);
+ event1.header.fixed_header.event_type.type_name =
+ CORBA::string_dup(TYPE_A);
+ event1.header.fixed_header.event_name = CORBA::string_dup("");
+ event1.header.variable_header.length (0); // put nothing here
+ event1.filterable_data.length (0);
+ event1.remainder_of_body <<= (CORBA::Long)10;
+
+ // Event 2
+ CosNotification::StructuredEvent event2;
+ event2.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup(DOMAIN_B);
+ event2.header.fixed_header.event_type.type_name =
+ CORBA::string_dup(TYPE_B);
+ event2.header.fixed_header.event_name = CORBA::string_dup("");
+ event2.header.variable_header.length (0); // put nothing here
+ event2.filterable_data.length (0);
+ event2.remainder_of_body <<= (CORBA::Long)10;
+
+ // event 3
+ CosNotification::StructuredEvent event3;
+ event3.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup(DOMAIN_C);
+ event3.header.fixed_header.event_type.type_name =
+ CORBA::string_dup(TYPE_C);
+ event3.header.fixed_header.event_name = CORBA::string_dup("");
+ event3.header.variable_header.length (0); // put nothing here
+ event3.filterable_data.length (0);
+ event3.remainder_of_body <<= (CORBA::Long)10;
+
+ // let supplier 1 send all these events
+ for (int i = 0; i < 1; ++i)
+ {
+ supplier_1_->send_event (event1 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ supplier_1_->send_event (event2 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ supplier_1_->send_event (event3 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+/*****************************************************************/
+Subscribe_StructuredPushConsumer::Subscribe_StructuredPushConsumer (Subscribe* subscribe)
+ : subscribe_ (subscribe)
+{
+}
+
+Subscribe_StructuredPushConsumer::~Subscribe_StructuredPushConsumer ()
+{
+}
+
+void
+Subscribe_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
+Subscribe_StructuredPushConsumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->proxy_supplier_->
+ disconnect_structured_push_supplier(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Subscribe_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
+Subscribe_StructuredPushConsumer::push_structured_event
+ (const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ const char* domain_name =
+ notification.header.fixed_header.event_type.domain_name;
+
+ const char* type_name =
+ notification.header.fixed_header.event_type.type_name;
+
+ ACE_DEBUG ((LM_DEBUG, "Structured Subscribe Consumer %d received event, domain = %s, type = %s\n", this->proxy_supplier_id_, domain_name, type_name));
+
+ if (++g_result_count == EVENT_COUNT)
+ subscribe_->done ();
+
+}
+
+void
+Subscribe_StructuredPushConsumer::disconnect_structured_push_consumer
+ (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ // No-Op.
+}
+
+CosNotifyChannelAdmin::StructuredProxyPushSupplier_ptr
+Subscribe_StructuredPushConsumer::get_proxy_supplier (void)
+{
+ return proxy_supplier_.in ();
+}
+
+/*****************************************************************/
+
+Subscribe_StructuredPushSupplier::Subscribe_StructuredPushSupplier (void)
+{
+}
+
+Subscribe_StructuredPushSupplier::~Subscribe_StructuredPushSupplier ()
+{
+}
+
+void
+Subscribe_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
+Subscribe_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
+Subscribe_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
+Subscribe_StructuredPushSupplier::send_event
+ (const CosNotification::StructuredEvent& event
+ ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (this->proxy_consumer_.in ()));
+
+ proxy_consumer_->push_structured_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Subscribe_StructuredPushSupplier::disconnect_structured_push_supplier
+ (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ // No-Op.
+}
+
diff --git a/TAO/orbsvcs/examples/Notify/Subscribe/Subscribe.h b/TAO/orbsvcs/examples/Notify/Subscribe/Subscribe.h
new file mode 100644
index 00000000000..126b842a4ca
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Subscribe/Subscribe.h
@@ -0,0 +1,246 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// Subscribe.h
+//
+// = DESCRIPTION
+// Class to demo structured event subscription.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_SUBSCRIBE_CLIENT_H
+#define NOTIFY_SUBSCRIBE_CLIENT_H
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+
+class Subscribe_StructuredPushConsumer;
+class Subscribe_StructuredPushSupplier;
+
+class Subscribe
+{
+ // = TITLE
+ // Subscribe
+ // = DESCRIPTION
+ // Shows how consumers subscribe for events.
+
+ public:
+ // = Initialization and Termination
+ Subscribe (void);
+ ~Subscribe ();
+
+ void init (int argc, char *argv [] ACE_ENV_ARG_DECL);
+ // Init 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.
+
+ 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.
+
+ Subscribe_StructuredPushConsumer* consumer_1_;
+ Subscribe_StructuredPushConsumer* consumer_2_;
+
+ Subscribe_StructuredPushSupplier* supplier_1_;
+ Subscribe_StructuredPushSupplier* supplier_2_;
+
+ CORBA::Boolean done_;
+ // Set this flag to exit the run loop.
+};
+
+/*****************************************************************/
+class Subscribe_StructuredPushConsumer
+ : public POA_CosNotifyComm::StructuredPushConsumer
+{
+ // = TITLE
+ // Subscribe_StructuredPushConsumer
+ //
+ // = DESCRIPTION
+ // Consumer for the Subscribe example.
+ //
+
+ public:
+ // = Initialization and Termination code
+ Subscribe_StructuredPushConsumer (Subscribe* subscribe);
+ // 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.
+
+protected:
+ // = Data members
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_var proxy_supplier_;
+ // The proxy that we are connected to.
+
+ CosNotifyChannelAdmin::ProxyID proxy_supplier_id_;
+ // The proxy_supplier id.
+
+ Subscribe* subscribe_;
+ // callback <done>
+
+ // = Methods
+ virtual ~Subscribe_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 Subscribe_StructuredPushSupplier
+ : public POA_CosNotifyComm::StructuredPushSupplier
+{
+ // = TITLE
+ // Subscribe_StructuredPushSupplier
+ //
+ // = DESCRIPTION
+ // Supplier for the SUBSCRIBE example.
+ //
+ public:
+ // = Initialization and Termination code
+ Subscribe_StructuredPushSupplier (void);
+ // Constructor.
+
+ void connect (CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin
+ ACE_ENV_ARG_DECL);
+ // Connect the Supplier to the EventChannel.
+ // Creates a new proxy consumer and connects to it.
+
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the supplier.
+
+ virtual void send_event (const CosNotification::StructuredEvent& event
+ ACE_ENV_ARG_DECL);
+ // Send one event.
+
+protected:
+ // = Data members
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var proxy_consumer_;
+ // The proxy that we are connected to.
+
+ CosNotifyChannelAdmin::ProxyID proxy_consumer_id_;
+ // This supplier's id.
+
+ // = Protected Methods
+ virtual ~Subscribe_StructuredPushSupplier ();
+ // Destructor
+
+ // = NotifySubscribe
+ 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
+ ));
+};
+
+#endif /* NOTIFY_SUBSCRIBE_CLIENT_H */
diff --git a/TAO/orbsvcs/examples/Notify/Subscribe/main.cpp b/TAO/orbsvcs/examples/Notify/Subscribe/main.cpp
new file mode 100644
index 00000000000..b817728c231
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Subscribe/main.cpp
@@ -0,0 +1,35 @@
+// -*- C++ -*-
+// $Id$
+
+#include "Subscribe.h"
+
+int
+main (int argc, char *argv [])
+{
+ Subscribe client;
+
+ 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;
+ }
+ ACE_CATCH (CORBA::UserException, ue)
+ {
+ ACE_PRINT_EXCEPTION (ue,
+ "TLS_Client user error: ");
+ return 1;
+ }
+ ACE_CATCH (CORBA::SystemException, se)
+ {
+ ACE_PRINT_EXCEPTION (se,
+ "Filter system error: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/Notify/Subscribe/run_test.pl b/TAO/orbsvcs/examples/Notify/Subscribe/run_test.pl
new file mode 100755
index 00000000000..7b14c5cee62
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/Subscribe/run_test.pl
@@ -0,0 +1,73 @@
+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_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 ";
+
+$Subscribe = new PerlACE::Process ("Subscribe");
+
+$Subscribe_Args = "-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;
+}
+
+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;
+}
+
+$Subscribe->Arguments ($Subscribe_Args);
+$args = $Subscribe->Arguments ();
+print STDERR "Running Subscribe with arguments: $args\n";
+$status = $Subscribe->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Subscribe returned $status\n";
+ $Subscribe->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+$Notification->Kill ();
+unlink $notify_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/Consumer.cpp b/TAO/orbsvcs/examples/Notify/ThreadPool/Consumer.cpp
new file mode 100644
index 00000000000..3f8b943dba2
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/Consumer.cpp
@@ -0,0 +1,219 @@
+// $Id$
+
+#include "Consumer.h"
+
+ACE_RCSID (Notify,
+ TAO_Notify_ThreadPool_Consumer,
+ "$Id$")
+
+#include "tao/debug.h"
+
+#include "ace/High_Res_Timer.h"
+#include "ace/Stats.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+
+TAO_Notify_ThreadPool_Consumer::TAO_Notify_ThreadPool_Consumer (TAO_Notify_ORB_Objects& orb_objects)
+ : orb_objects_ (orb_objects)
+ , proxy_supplier_thread_count_ (0)
+ , max_events_ (10)
+ , events_received_count_ (0)
+ , t_first_ (0)
+ , t_last_ (0)
+{
+}
+
+TAO_Notify_ThreadPool_Consumer::~TAO_Notify_ThreadPool_Consumer (void)
+{
+}
+
+void
+TAO_Notify_ThreadPool_Consumer::init (PortableServer::POA_var& poa, CosNotifyChannelAdmin::ConsumerAdmin_var& admin,
+ int proxy_supplier_thread_count, int max_events, long delay ACE_ENV_ARG_DECL)
+{
+ this->default_POA_ = poa;
+ this->admin_ = admin;
+ this->proxy_supplier_thread_count_ = proxy_supplier_thread_count;
+ this->max_events_ = max_events;
+ this->delay_ = ACE_Time_Value (delay, 0);
+
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t)Consumer Delay = %d, param = %d\n", delay_.sec (), delay));
+
+ this->connect (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+PortableServer::POA_ptr
+TAO_Notify_ThreadPool_Consumer::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+void
+TAO_Notify_ThreadPool_Consumer::run (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ // Nothing to do.
+}
+
+void
+TAO_Notify_ThreadPool_Consumer::connect (ACE_ENV_SINGLE_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;
+
+ if (this->proxy_supplier_thread_count_ != 0)
+ {
+ // Narrow to the extended interface.
+ NotifyExt::ConsumerAdmin_var admin_ext = NotifyExt::ConsumerAdmin::_narrow (this->admin_.in ()ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ NotifyExt::ThreadPoolParams tp_params = { NotifyExt::CLIENT_PROPAGATED, 0,
+ 0, this->proxy_supplier_thread_count_, 0, 0, 0, 0, 0 };
+
+ CosNotification::QoSProperties qos (1);
+ qos.length (1);
+ qos[0].name = CORBA::string_dup (NotifyExt::ThreadPool);
+ qos[0].value <<= tp_params;
+
+ // Obtain the proxy. The QoS is applied to the POA in which the Proxy is hosted.
+ proxysupplier = admin_ext->obtain_notification_push_supplier_with_qos (CosNotifyChannelAdmin::STRUCTURED_EVENT
+ , proxy_supplier_id_, qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ proxysupplier = this->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 ()));
+
+ this->proxy_supplier_->connect_structured_push_consumer (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Call subscription_change to inform the supplier that this consumer is available.
+ CosNotification::EventTypeSeq added (1);
+ CosNotification::EventTypeSeq removed;
+
+ added.length (1);
+ added[0].domain_name = CORBA::string_dup ("TEST_DOMAIN");
+
+ /* We generate a unique Id for the consumer type so that the supplier can distinguish between the consumers.*/
+ char type[BUFSIZ];
+ ACE_OS::sprintf (type, "TEST_TYPE_%d", this->proxy_supplier_id_);
+
+ added[0].type_name = CORBA::string_dup (type);
+
+ this->proxy_supplier_->subscription_change (added, removed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P,%t) Created Consumer %d with %d threads at the ProxySupplier\n", proxy_supplier_id_,
+ this->proxy_supplier_thread_count_));
+}
+
+void
+TAO_Notify_ThreadPool_Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->proxy_supplier_->disconnect_structured_push_supplier(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_ThreadPool_Consumer::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
+TAO_Notify_ThreadPool_Consumer::push_structured_event (const CosNotification::StructuredEvent & /*notification*/
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t) Consumer received event %d\n",
+ this->events_received_count_));
+
+ // Increment the received count.
+ ++this->events_received_count_;
+
+ if (this->events_received_count_ == 1)
+ {
+ this->t_first_ = ACE_OS::gethrtime ();
+ }
+ else if (this->events_received_count_ == this->max_events_)
+ {
+ this->t_last_ = ACE_OS::gethrtime ();
+
+ // Disconnect from the EC
+ this->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Deactivate this object.
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // We received the event, shutdown the ORB.
+ this->orb_objects_.orb_->shutdown (1);
+ }
+
+ // Eat CPU:
+ ACE_OS::sleep (this->delay_);
+}
+
+void
+TAO_Notify_ThreadPool_Consumer::dump_throughput (void)
+{
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P,%t) Consumer %d \n", proxy_supplier_id_));
+
+ ACE_Throughput_Stats::dump_throughput ("Total", gsf,
+ t_last_ - t_first_,
+ this->max_events_);
+}
+
+void
+TAO_Notify_ThreadPool_Consumer::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ 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
+TAO_Notify_ThreadPool_Consumer::disconnect_structured_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/Consumer.h b/TAO/orbsvcs/examples/Notify/ThreadPool/Consumer.h
new file mode 100644
index 00000000000..0af5b74d5fa
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/Consumer.h
@@ -0,0 +1,138 @@
+/* -*- C++ -*- */
+/**
+ * @file Consumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_CONSUMER_H
+#define TAO_Notify_CONSUMER_H
+
+#include /**/ "ace/pre.h"
+
+#include "ORB_Objects.h"
+#include "tao/RTCORBA/RTCORBA.h"
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "ace/SString.h"
+#include "ace/OS_NS_time.h"
+
+/**
+ * @class TAO_Notify_ThreadPool_Consumer
+ *
+ * @brief Consumer
+ *
+ */
+
+class TAO_Notify_ThreadPool_Consumer
+ : public POA_CosNotifyComm::StructuredPushConsumer
+{
+public:
+ /// Constuctor
+ TAO_Notify_ThreadPool_Consumer (TAO_Notify_ORB_Objects& orb_objects);
+
+ /// Init
+ void init (PortableServer::POA_var& poa, CosNotifyChannelAdmin::ConsumerAdmin_var& admin, int proxy_supplier_thread_count, int max_events, long delay ACE_ENV_ARG_DECL);
+
+ /// Run
+ void run (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+ /// Print the consumer throughput
+ void dump_throughput (void);
+
+protected:
+ // = Methods
+ /// Destructor
+ virtual ~TAO_Notify_ThreadPool_Consumer (void);
+
+ /// Connect the Consumer to the EventChannel.
+ /// Creates a new proxy supplier and connects to it.
+ void connect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Disconnect the supplier.
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Deactivate.
+ void deactivate (ACE_ENV_SINGLE_ARG_DECL);
+
+ // = ServantBase operations
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ // = 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
+ ));
+
+ // = Data members
+
+ /// Lock
+ TAO_SYNCH_MUTEX lock_;
+
+ /// ORB Objects.
+ TAO_Notify_ORB_Objects orb_objects_;
+
+ // POA.
+ PortableServer::POA_var default_POA_;
+
+ /// The proxy that we are connected to.
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_var proxy_supplier_;
+
+ /// The proxy_supplier id.
+ CosNotifyChannelAdmin::ProxyID proxy_supplier_id_;
+
+ // The Consumer Admin
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin_;
+
+ /// The Type the Consumer should subscribe to.
+ ACE_CString event_type_;
+
+ /// ProxySupplier thread count.
+ int proxy_supplier_thread_count_;
+
+ /// Max events to receive
+ int max_events_;
+
+ /// Count the number of events received.
+ int events_received_count_;
+
+ /// Time when the first sample was received.
+ //ACE_UINT64 t_first_;
+ ACE_hrtime_t t_first_;
+
+ /// Time when the last sample was received.
+ //ACE_UINT64 t_last_;
+ ACE_hrtime_t t_last_;
+
+ /// Delay: Sec of wait in each push.
+ ACE_Time_Value delay_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_CONSUMER_H */
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/Consumer_Client.cpp b/TAO/orbsvcs/examples/Notify/ThreadPool/Consumer_Client.cpp
new file mode 100644
index 00000000000..480dbb5005c
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/Consumer_Client.cpp
@@ -0,0 +1,274 @@
+// $Id$
+
+#include "Consumer_Client.h"
+#include "Consumer.h"
+#include "ORB_Run_Task.h"
+#include "ace/Arg_Shifter.h"
+#include "orbsvcs/NotifyExtC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "tao/ORB_Core.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_errno.h"
+
+ACE_RCSID (Notify, TAO_Notify_ThreadPool_Consumer_Client, "$Id$")
+
+TAO_Notify_ThreadPool_Consumer_Client::TAO_Notify_ThreadPool_Consumer_Client (TAO_Notify_ORB_Objects& orb_objects)
+ : orb_objects_ (orb_objects)
+ , consumer_ (0)
+ , proxy_supplier_thread_count_ (0)
+ , max_events_ (10)
+ , delay_ (0)
+{
+}
+
+TAO_Notify_ThreadPool_Consumer_Client::~TAO_Notify_ThreadPool_Consumer_Client ()
+{
+}
+
+int
+TAO_Notify_ThreadPool_Consumer_Client::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("-ProxySupplier_ThreadPool")))) // Specify a threadpool.
+ {
+ this->proxy_supplier_thread_count_ = ACE_OS::atoi (arg_shifter.get_current ());
+
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter(ACE_TEXT("-MaxEvents")))) // Max Events
+ {
+ this->max_events_ = ACE_OS::atoi (arg_shifter.get_current ());
+
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter(ACE_TEXT("-Delay")))) // seconds wait in consumer per push.
+ {
+ this->delay_ = ACE_OS::atoi (current_arg);
+
+ arg_shifter.consume_arg ();
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+
+ return 0;
+}
+
+void
+TAO_Notify_ThreadPool_Consumer_Client::_init (ACE_ENV_SINGLE_ARG_DECL)
+{
+ PortableServer::POAManager_var poa_manager =
+ this->orb_objects_.root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Resolve the Notification Factory.
+ CosNotifyChannelAdmin::EventChannelFactory_var ecf = this->orb_objects_.notify_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Find the EventChannel created by the supplier.
+ CosNotifyChannelAdmin::ChannelIDSeq_var channel_seq = ecf->get_all_channels (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::EventChannel_var ec;
+
+ if (channel_seq->length() > 0)
+ {
+ ec = ecf->get_event_channel (channel_seq[0] ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "No Event Channel active!\n"));
+ return;
+ }
+
+ // Create a Consumer Admin
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->new_for_consumers (CosNotifyChannelAdmin::AND_OP, adminid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (consumer_admin.in ()));
+
+ PortableServer::POA_var rt_poa = this->create_rt_poa (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Create a Consumer
+ this->consumer_ = new TAO_Notify_ThreadPool_Consumer (this->orb_objects_);
+
+ // Initialize it.
+ this->consumer_->init (rt_poa, consumer_admin, this->proxy_supplier_thread_count_, this->max_events_, this->delay_ ACE_ENV_ARG_PARAMETER);
+}
+
+PortableServer::POA_ptr
+TAO_Notify_ThreadPool_Consumer_Client::create_rt_poa (ACE_ENV_SINGLE_ARG_DECL)
+{
+ PortableServer::POA_var rt_poa;
+
+ // Create an RT POA with a lane at the given priority.
+ CORBA::Policy_var priority_model_policy;
+ CORBA::Policy_var thread_pool_policy;
+
+ CORBA::Policy_var activation_policy =
+ this->orb_objects_.root_poa_->create_implicit_activation_policy (PortableServer::IMPLICIT_ACTIVATION ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (rt_poa._retn ());
+
+ // Create a priority model policy.
+ priority_model_policy =
+ this->orb_objects_.rt_orb_->create_priority_model_policy (RTCORBA::CLIENT_PROPAGATED
+ , 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (rt_poa._retn ());
+
+ CORBA::ULong stacksize = 0;
+ CORBA::ULong static_threads = 1;
+ CORBA::ULong dynamic_threads = 0;
+ RTCORBA::Priority default_priority = 0;
+ 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 =
+ this->orb_objects_.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_RETURN (rt_poa._retn ());
+
+ thread_pool_policy =
+ this->orb_objects_.rt_orb_->create_threadpool_policy (threadpool_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (rt_poa._retn ());
+
+ CORBA::PolicyList poa_policy_list;
+
+ poa_policy_list.length (3);
+ poa_policy_list[0] = priority_model_policy;
+ poa_policy_list[1] = activation_policy;
+ poa_policy_list[2] = thread_pool_policy;
+
+ PortableServer::POAManager_var poa_manager =
+ this->orb_objects_.root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (rt_poa._retn ());
+
+ rt_poa = this->orb_objects_.root_poa_->create_POA ("RT POA!",
+ poa_manager.in (),
+ poa_policy_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (rt_poa._retn ());
+
+ return rt_poa._retn ();
+}
+
+void
+TAO_Notify_ThreadPool_Consumer_Client::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->consumer_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_ThreadPool_Consumer_Client::dump_stats (void)
+{
+ this->consumer_->dump_throughput ();
+}
+
+int
+TAO_Notify_ThreadPool_Consumer_Client::svc (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize this threads priority.
+ this->orb_objects_.current_->the_priority (0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->_init (ACE_ENV_SINGLE_ARG_PARAMETER); //Init the Client
+ ACE_TRY_CHECK;
+
+ this->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Supplier error "));
+
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+main (int argc, char *argv [])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize an ORB
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_Notify_ORB_Objects orb_objects;
+
+ orb_objects.init (orb ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_Notify_ORB_Run_Task orb_run_task (orb_objects);
+
+ TAO_Notify_ThreadPool_Consumer_Client client (orb_objects);
+
+ if (client.parse_args (argc, argv) != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Consumer_Client::Error parsing options\n"));
+ return -1;
+ }
+
+ long flags = THR_NEW_LWP | THR_JOINABLE;
+
+ flags |=
+ orb->orb_core ()->orb_params ()->thread_creation_flags ();
+
+
+ if (orb_run_task.activate (flags) == -1 || client.activate (flags) == -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. \n")));
+ }
+
+ orb_run_task.thr_mgr ()->wait ();
+ client.thr_mgr ()->wait ();
+
+ client.dump_stats ();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Consumer Client error "));
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/Consumer_Client.h b/TAO/orbsvcs/examples/Notify/ThreadPool/Consumer_Client.h
new file mode 100644
index 00000000000..158c1005daa
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/Consumer_Client.h
@@ -0,0 +1,83 @@
+/* -*- C++ -*- */
+/**
+ * @file Consumer_Client.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_CONSUMER_CLIENT_H
+#define TAO_Notify_CONSUMER_CLIENT_H
+
+#include /**/ "ace/pre.h"
+#include "ace/Task.h"
+#include "ace/SString.h"
+
+/// @@Pradeep, pragma please...
+
+#include "ORB_Objects.h"
+#include "tao/RTCORBA/RTCORBA.h"
+
+class TAO_Notify_ThreadPool_Consumer;
+
+/**
+ * @class TAO_Notify_ThreadPool_Consumer_Client
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_ThreadPool_Consumer_Client : public ACE_Task_Base
+{
+public:
+ /// Constuctor
+ TAO_Notify_ThreadPool_Consumer_Client (TAO_Notify_ORB_Objects& orb_objects);
+
+ /// Destructor
+ ~TAO_Notify_ThreadPool_Consumer_Client ();
+
+ /// Init
+ void _init (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Run
+ void run (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Parse Args
+ int parse_args (int argc, char *argv[]);
+
+ /// The thread entry point.
+ virtual int svc (void);
+
+ /// Dump stats.
+ void dump_stats (void);
+
+protected:
+ /// Create an RT POA with a single threadpool.
+ PortableServer::POA_ptr create_rt_poa (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// ORB Objects.
+ TAO_Notify_ORB_Objects orb_objects_;
+
+ /// Lock to serialize internal state.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// Count how many consumers are done
+ int consumer_done_count_;
+
+ /// The Consumer.
+ TAO_Notify_ThreadPool_Consumer* consumer_;
+
+ /// ProxySuppler Thread count.
+ int proxy_supplier_thread_count_;
+
+ /// Max events that we expect to receive.
+ int max_events_;
+
+ /// Delay in ms
+ long delay_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_CONSUMER_CLIENT_H */
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/Makefile.am b/TAO/orbsvcs/examples/Notify/ThreadPool/Makefile.am
new file mode 100644
index 00000000000..130c85fa5b5
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/Makefile.am
@@ -0,0 +1,140 @@
+## 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.Notify_ThreadPool_Consumer.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+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_Client.cpp \
+ ORB_Objects.cpp \
+ ORB_Run_Task.cpp \
+ Consumer.h \
+ Consumer_Client.h \
+ ORB_Objects.h \
+ ORB_Run_Task.h
+
+Consumer_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_RTPortableServer.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_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RT_Notification.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.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_CosNotification_Skel.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)/orbsvcs/orbsvcs/libTAO_Svc_Utils.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_RT_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Notify_ThreadPool_Supplier.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+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 = \
+ ORB_Objects.cpp \
+ ORB_Run_Task.cpp \
+ Supplier.cpp \
+ Supplier_Client.cpp \
+ ORB_Objects.h \
+ ORB_Run_Task.h \
+ Supplier.h \
+ Supplier_Client.h
+
+Supplier_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_RTPortableServer.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_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RT_Notification.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.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_CosNotification_Skel.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)/orbsvcs/orbsvcs/libTAO_Svc_Utils.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_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/examples/Notify/ThreadPool/Notify_ThreadPool.mpc b/TAO/orbsvcs/examples/Notify/ThreadPool/Notify_ThreadPool.mpc
new file mode 100644
index 00000000000..ed469821a28
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/Notify_ThreadPool.mpc
@@ -0,0 +1,20 @@
+// $Id$
+project(*Supplier): rtnotify, notifytest, rtportableserver, minimum_corba {
+ exename = Supplier
+ Source_Files {
+ Supplier.cpp
+ Supplier_Client.cpp
+ ORB_Objects.cpp
+ ORB_Run_Task.cpp
+ }
+}
+
+project(*Consumer): rtnotify, notifytest, rtportableserver, minimum_corba {
+ exename = Consumer
+ Source_Files {
+ Consumer.cpp
+ Consumer_Client.cpp
+ ORB_Objects.cpp
+ ORB_Run_Task.cpp
+ }
+}
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Objects.cpp b/TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Objects.cpp
new file mode 100644
index 00000000000..b26b9dbb0ec
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Objects.cpp
@@ -0,0 +1,71 @@
+// $Id$
+
+#include "ORB_Objects.h"
+
+ACE_RCSID (Notify, TAO_Notify_ORB_Objects, "$Id$")
+
+TAO_Notify_ORB_Objects::TAO_Notify_ORB_Objects (void)
+{
+}
+
+void
+TAO_Notify_ORB_Objects::init (CORBA::ORB_var& orb ACE_ENV_ARG_DECL)
+{
+ this->orb_ = orb;
+
+ CORBA::Object_var object = this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->root_poa_ = PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Resolve the RTORB.
+ object = this->orb_->resolve_initial_references ("RTORB"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->rt_orb_ = RTCORBA::RTORB::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Resolve the Current
+ object = this->orb_->resolve_initial_references ("RTCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->current_ = RTCORBA::Current::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Resolve the Naming service
+ object = this->orb_->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->naming_ = CosNaming::NamingContextExt::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_Notify_ORB_Objects::~TAO_Notify_ORB_Objects ()
+{
+}
+
+CosNotifyChannelAdmin::EventChannelFactory_ptr
+TAO_Notify_ORB_Objects::notify_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::EventChannelFactory_var ecf;
+
+ // Look for the Notification Service
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup ("NotifyEventChannelFactory");
+
+ CORBA::Object_var object = this->naming_->resolve (name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ecf._retn ());
+
+ ecf = CosNotifyChannelAdmin::EventChannelFactory::_narrow (object.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ecf._retn ());
+
+ return ecf._retn ();
+}
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Objects.h b/TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Objects.h
new file mode 100644
index 00000000000..7ca6ab99442
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Objects.h
@@ -0,0 +1,55 @@
+/* -*- C++ -*- */
+/**
+ * @file ORB_Objects.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_ORB_OBJECTS_H
+#define TAO_Notify_ORB_OBJECTS_H
+#include /**/ "ace/pre.h"
+
+#include "tao/RTCORBA/RTCORBA.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "orbsvcs/NotifyExtC.h"
+#include "orbsvcs/CosNamingC.h"
+
+/**
+ * @class TAO_Notify_ORB_Objects
+ *
+ * @brief Handy Objects that we keep asking the ORB for.
+ *
+ */
+class TAO_Notify_ORB_Objects
+{
+public:
+ /// Constuctor
+ TAO_Notify_ORB_Objects (void);
+
+ /// Destructor
+ ~TAO_Notify_ORB_Objects ();
+
+ /// Resolves all the references.
+ void init (CORBA::ORB_var& orb ACE_ENV_ARG_DECL);
+
+ /// Resolve Notification
+ CosNotifyChannelAdmin::EventChannelFactory_ptr notify_factory (ACE_ENV_SINGLE_ARG_DECL);
+
+ ///= Public Data
+ CORBA::ORB_var orb_;
+
+ PortableServer::POA_var root_poa_;
+
+ RTCORBA::RTORB_var rt_orb_;
+
+ RTCORBA::Current_var current_;
+
+ CosNaming::NamingContextExt_var naming_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_ORB_OBJECTS_H */
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Run_Task.cpp b/TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Run_Task.cpp
new file mode 100644
index 00000000000..953328f78c5
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Run_Task.cpp
@@ -0,0 +1,33 @@
+// $Id$
+
+#include "ORB_Run_Task.h"
+
+ACE_RCSID (Notify, TAO_Notify_ORB_Run_Task, "$Id$")
+
+TAO_Notify_ORB_Run_Task::TAO_Notify_ORB_Run_Task (TAO_Notify_ORB_Objects& orb_objects)
+ : orb_objects_ (orb_objects)
+{
+}
+
+TAO_Notify_ORB_Run_Task::~TAO_Notify_ORB_Run_Task ()
+{
+}
+
+int
+TAO_Notify_ORB_Run_Task::svc (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->orb_objects_.current_->the_priority (0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->orb_objects_.orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Run_Task.h b/TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Run_Task.h
new file mode 100644
index 00000000000..83fd657406b
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/ORB_Run_Task.h
@@ -0,0 +1,44 @@
+/* -*- C++ -*- */
+/**
+ * @file ORB_Run_Task.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_ORB_RUN_TASK_H
+#define TAO_Notify_ORB_RUN_TASK_H
+
+#include /**/ "ace/pre.h"
+#include "ace/Task.h"
+
+#include "ORB_Objects.h"
+
+/**
+ * @class TAO_Notify_ORB_Run_Task
+ *
+ * @brief Run the ORB::run method in a seperate thread.
+ *
+ */
+class TAO_Notify_ORB_Run_Task : public ACE_Task_Base
+{
+public:
+ /// Constuctor
+ TAO_Notify_ORB_Run_Task (TAO_Notify_ORB_Objects& orb_objects);
+
+ /// Destructor
+ ~TAO_Notify_ORB_Run_Task ();
+
+ /// The thread entry point.
+ virtual int svc (void);
+
+private:
+ /// ORB Objects.
+ TAO_Notify_ORB_Objects orb_objects_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_ORB_RUN_TASK_H */
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/README b/TAO/orbsvcs/examples/Notify/ThreadPool/README
new file mode 100644
index 00000000000..f02bd65b73c
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/README
@@ -0,0 +1,57 @@
+
+ThreadPool example for RT-Notification
+======================================
+
+This example has 1 Supplier and 2 Consumers.
+
+The supplier sends an different event to each of the consumers in a
+supplier thread continuously.
+
+One of the consumers has 1 second delay in its push method.
+let us call it the "slow" consumer and the other consumer - the "fast" consumer.
+
+If no threadpools are used then the throughput of both consumers is ~1
+event per second.
+
+We deploy a threadpool at each proxysupplier.
+This causes each consumer to have a seperate data path.
+
+Hence the fast consumer finishes first without any interference from
+the slow consumer.
+
+Command Line Options
+====================
+
+Supplier:
+--------
+
+-Consumers count
+
+-Event_Channel_ThreradPool static_threads
+
+-ProxyConsumer_ThreadPool static_threads
+
+-IORoutput ior_file
+
+-MaxEvents count
+
+
+Consumer:
+--------
+
+-ProxySupplier_ThreadPool static_threads
+
+-MaxEvents count
+
+-Delay seconds
+
+Running the example
+===================
+
+Simply run the run_test.pl file.
+
+The run_test.pl file has options that can be modified to run the
+example with threadpools deployed at different points.
+
+
+
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/Supplier.cpp b/TAO/orbsvcs/examples/Notify/ThreadPool/Supplier.cpp
new file mode 100644
index 00000000000..bb29cbd1af7
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/Supplier.cpp
@@ -0,0 +1,194 @@
+// $Id$
+
+#include "Supplier.h"
+
+ACE_RCSID (Notify, TAO_Notify_ThreadPool_Supplier, "$Id$")
+
+#include "tao/ORB_Core.h"
+
+TAO_Notify_ThreadPool_Supplier::TAO_Notify_ThreadPool_Supplier (TAO_Notify_ORB_Objects& orb_objects)
+ : orb_objects_ (orb_objects)
+ , proxy_consumer_id_ (0)
+ , expected_consumer_count_ (2)
+ , consumers_connected_ (lock_)
+ , consumer_count_ (0)
+ , max_events_ (10)
+ , proxy_consumer_thread_count_ (0)
+{
+}
+
+TAO_Notify_ThreadPool_Supplier::~TAO_Notify_ThreadPool_Supplier ()
+{
+}
+
+void
+TAO_Notify_ThreadPool_Supplier::init (CosNotifyChannelAdmin::SupplierAdmin_var& admin, int expected_consumer_count ,int max_events,
+ int proxy_consumer_thread_count ACE_ENV_ARG_DECL)
+{
+ // First initialize the class members.
+ this->admin_ = admin;
+ this->expected_consumer_count_ = expected_consumer_count;
+ this->max_events_ = max_events;
+ this->proxy_consumer_thread_count_ = proxy_consumer_thread_count;
+
+ this->connect (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_ThreadPool_Supplier::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_);
+
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t) Waiting for %d consumers to connect...\n", this->expected_consumer_count_-1));
+
+ // Wait till the consumers are ready to go.
+ while (this->consumer_count_ != this->expected_consumer_count_)
+ this->consumers_connected_.wait ();
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P, %t) Supplier is sending an events...\n"));
+
+ // Send events to each consumer.
+ for (int i = 0; i < this->max_events_; ++i)
+ {
+ for (int j = 0; j < this->expected_consumer_count_; ++j)
+ {
+ // send the event
+ this->send_event (this->event_[j] ACE_ENV_ARG_PARAMETER);
+ }
+ }
+
+ // Disconnect from the EC
+ this->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ // Deactivate this object.
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ // we're done. shutdown the ORB to exit the process.
+ this->orb_objects_.orb_->shutdown (1);
+}
+
+void
+TAO_Notify_ThreadPool_Supplier::connect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Activate the supplier object.
+ CosNotifyComm::StructuredPushSupplier_var objref = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxyConsumer_var proxyconsumer;
+
+ if (this->proxy_consumer_thread_count_ != 0)
+ {
+ // Narrow to the extended interface.
+ NotifyExt::SupplierAdmin_var admin_ext = NotifyExt::SupplierAdmin::_narrow (this->admin_.in ()ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ NotifyExt::ThreadPoolParams tp_params = { NotifyExt::CLIENT_PROPAGATED, 0,
+ 0, this->proxy_consumer_thread_count_, 0, 0, 0, 0, 0 };
+
+ CosNotification::QoSProperties qos (1);
+ qos.length (1);
+ qos[0].name = CORBA::string_dup (NotifyExt::ThreadPool);
+ qos[0].value <<= tp_params;
+
+ // Obtain the proxy. The QoS is applied to the POA in which the Proxy is hosted.
+ proxyconsumer = admin_ext->obtain_notification_push_consumer_with_qos (CosNotifyChannelAdmin::STRUCTURED_EVENT
+ , proxy_consumer_id_, qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ // Obtain the proxy.
+ proxyconsumer = this->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 ()));
+
+ // connect to the proxyconsumer.
+ proxy_consumer_->connect_structured_push_supplier (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P,%t) Created Supplier %d with %d threads at the ProxyConsumer\n", proxy_consumer_id_,
+ this->proxy_consumer_thread_count_));
+}
+
+void
+TAO_Notify_ThreadPool_Supplier::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
+TAO_Notify_ThreadPool_Supplier::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ 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
+TAO_Notify_ThreadPool_Supplier::subscription_change (const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & /*removed */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType
+ ))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_);
+
+ // Count the number of consumers connect and signal the supplier thread when the expected count have connected.
+ // Only 1 consumer connects at a time.
+ if (added.length () > 0)
+ {
+ // Set the domain and type nams in the event's fixed header.
+ this->event_[consumer_count_].header.fixed_header.event_type.domain_name = CORBA::string_dup(added[0].domain_name);
+ this->event_[consumer_count_].header.fixed_header.event_type.type_name = CORBA::string_dup(added[0].type_name);
+
+ ++this->consumer_count_;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P,%t) Received Type %d: (%s)\n", this->consumer_count_, added[0].type_name.in ()));
+
+ if (this->consumer_count_ == this->expected_consumer_count_)
+ this->consumers_connected_.signal ();
+ }
+}
+
+void
+TAO_Notify_ThreadPool_Supplier::send_event (const CosNotification::StructuredEvent& event ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (this->proxy_consumer_.in ()));
+
+ proxy_consumer_->push_structured_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_ThreadPool_Supplier::disconnect_structured_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/Supplier.h b/TAO/orbsvcs/examples/Notify/ThreadPool/Supplier.h
new file mode 100644
index 00000000000..e5238d0af7e
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/Supplier.h
@@ -0,0 +1,121 @@
+/* -*- C++ -*- */
+/**
+ * @file Supplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_SUPPLIER_H
+#define TAO_Notify_SUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "ORB_Objects.h"
+#include "tao/RTCORBA/RTCORBA.h"
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "ace/Condition_Thread_Mutex.h"
+
+#define TEST_MAX_CONSUMERS 10
+
+/**
+ * @class TAO_Notify_ThreadPool_Supplier
+ *
+ * @brief Implement a Structured Supplier.
+ *
+ */
+class TAO_Notify_ThreadPool_Supplier
+ : public POA_CosNotifyComm::StructuredPushSupplier
+{
+public:
+ // = Initialization and Termination code
+
+ /// Constructor.
+ TAO_Notify_ThreadPool_Supplier (TAO_Notify_ORB_Objects& orb_objects);
+
+ /// Init
+ void init (CosNotifyChannelAdmin::SupplierAdmin_var& admin, int expected_consumer_count, int max_events,
+ int proxy_consumer_thread_count ACE_ENV_ARG_DECL);
+
+ /// Run
+ void run (ACE_ENV_SINGLE_ARG_DECL);
+
+protected:
+ // = Protected Methods
+
+ /// Connect the Supplier to the EventChannel.
+ /// Creates a new proxy consumer and connects to it.
+ void connect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Disconnect the supplier.
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Deactivate.
+ void deactivate (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Send one event.
+ virtual void send_event (const CosNotification::StructuredEvent& event ACE_ENV_ARG_DECL);
+
+ /// Destructor
+ virtual ~TAO_Notify_ThreadPool_Supplier ();
+
+ // = NotifySubscribe
+ 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
+ ));
+ /// = Data members
+
+ /// ORB Objects.
+ TAO_Notify_ORB_Objects orb_objects_;
+
+ /// The proxy that we are connected to.
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var proxy_consumer_;
+
+ /// This supplier's id.
+ CosNotifyChannelAdmin::ProxyID proxy_consumer_id_;
+
+ /// Number of Consumers expected to connect.
+ int expected_consumer_count_;
+
+ // The ORB that we use.
+ CORBA::ORB_var orb_;
+
+ // The Supplier Admin
+ CosNotifyChannelAdmin::SupplierAdmin_var admin_;
+
+ /// Lock to serialize internal state.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// Condition that consumers are connected.
+ TAO_SYNCH_CONDITION consumers_connected_;
+
+ /// Number of consumers connected.
+ int consumer_count_;
+
+ /// Number of events to send.
+ int max_events_;
+
+ /// Number of Threads at the ProxyConsumer.
+ int proxy_consumer_thread_count_;
+
+ /// Array of events to send.
+ CosNotification::StructuredEvent event_[TEST_MAX_CONSUMERS];
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_SUPPLIER_H */
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/Supplier_Client.cpp b/TAO/orbsvcs/examples/Notify/ThreadPool/Supplier_Client.cpp
new file mode 100644
index 00000000000..fb8dcf0c8ad
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/Supplier_Client.cpp
@@ -0,0 +1,270 @@
+// $Id$
+
+#include "Supplier_Client.h"
+
+#include "ORB_Run_Task.h"
+#include "ace/Arg_Shifter.h"
+#include "tao/ORB_Core.h"
+#include "ace/Sched_Params.h"
+#include "Supplier.h"
+#include "orbsvcs/NotifyExtC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "ace/OS_NS_errno.h"
+
+ACE_RCSID (Notify, TAO_Notify_ThreadPool_Supplier_Client, "$Id$")
+
+TAO_Notify_ThreadPool_Supplier_Client::TAO_Notify_ThreadPool_Supplier_Client (TAO_Notify_ORB_Objects& orb_objects)
+ : orb_objects_ (orb_objects)
+ , supplier_ (0)
+ , consumer_count_ (2)
+ , ec_thread_count_ (0)
+ , proxy_consumer_thread_count_ (0)
+ , max_events_ (10)
+{
+}
+
+TAO_Notify_ThreadPool_Supplier_Client::~TAO_Notify_ThreadPool_Supplier_Client ()
+{
+}
+
+int
+TAO_Notify_ThreadPool_Supplier_Client::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("-Consumers")))) // Number of consumers that we need to send an event to.
+ {
+ if (current_arg != 0)
+ {
+ this->consumer_count_ = ACE_OS::atoi (current_arg);
+ }
+
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter(ACE_TEXT("-EventChannel_ThreadPool")))) // Specify a threadpool.
+ {
+ this->ec_thread_count_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter(ACE_TEXT("-ProxyConsumer_ThreadPool")))) // Specify a threadpool.
+ {
+ this->proxy_consumer_thread_count_= ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-IORoutput")))) // The file to output the supplier ior to.
+ {
+ if (current_arg != 0)
+ {
+ this->ior_file_name_ = current_arg;
+ }
+
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter(ACE_TEXT("-MaxEvents")))) // Max Events
+ {
+ this->max_events_ = ACE_OS::atoi (arg_shifter.get_current ());
+
+ arg_shifter.consume_arg ();
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+
+ return 0;
+}
+
+void
+TAO_Notify_ThreadPool_Supplier_Client::_init (ACE_ENV_SINGLE_ARG_DECL)
+{
+ PortableServer::POAManager_var poa_manager =
+ this->orb_objects_.root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::EventChannel_var ec = this->create_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Create a Supplier Admin
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP, adminid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (supplier_admin.in ()));
+
+ // Create a Supplier
+ this->supplier_ = new TAO_Notify_ThreadPool_Supplier (this->orb_objects_);
+
+ // Initialize it.
+ this->supplier_->init (supplier_admin, this->consumer_count_, this->max_events_, this->proxy_consumer_thread_count_
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::EventChannel_ptr
+TAO_Notify_ThreadPool_Supplier_Client::create_ec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::EventChannel_var ec;
+
+ CosNotifyChannelAdmin::EventChannelFactory_var ecf = this->orb_objects_.notify_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ec._retn ());
+
+ // Create an EventChannel
+ CosNotification::QoSProperties qos;
+ CosNotification::AdminProperties admin;
+
+ // Create an event channel
+ CosNotifyChannelAdmin::ChannelID id;
+
+ ec = ecf->create_channel (qos,
+ admin,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ec._retn ());
+
+ // Set the Qos
+ // See $TAO_ROOT/orbsvcs/orbsvcs/NotifyExt.idl
+ if (this->ec_thread_count_)
+ {
+ NotifyExt::ThreadPoolParams tp_params = { NotifyExt::CLIENT_PROPAGATED, 0,
+ 0, this->ec_thread_count_, 0, 0, 0, 0, 0 };
+
+ CosNotification::QoSProperties qos (1);
+ qos.length (1);
+ qos[0].name = CORBA::string_dup (NotifyExt::ThreadPool);
+ qos[0].value <<= tp_params;
+
+ // Note that instead of <set_qos>, the <qos> can also be passed while creating the channel.
+ ec->set_qos (qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ec._retn ());
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "(%P,%t) Created Event Channel with %d threads\n", this->ec_thread_count_));
+
+ return ec._retn ();
+}
+
+void
+TAO_Notify_ThreadPool_Supplier_Client::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ /// First, signal that the supplier is ready.
+ this->write_ior (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_ThreadPool_Supplier_Client::write_ior (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyComm::StructuredPushSupplier_var objref = this->supplier_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Write the ior to a file to signal waiting consumers.
+ FILE *ior_output_file = ACE_OS::fopen (this->ior_file_name_.c_str (), ACE_TEXT("w"));
+
+ if (ior_output_file != 0)
+ {
+ CORBA::String_var str =
+ this->orb_objects_.orb_->object_to_string (objref.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_OS::fprintf (ior_output_file,
+ "%s",
+ str.in ());
+ ACE_OS::fclose (ior_output_file);
+ }
+}
+
+int
+TAO_Notify_ThreadPool_Supplier_Client::svc (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->orb_objects_.current_->the_priority (0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->_init (ACE_ENV_SINGLE_ARG_PARAMETER); //Init the Client
+ ACE_TRY_CHECK;
+
+ this->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Supplier error "));
+
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+main (int argc, char *argv [])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize an ORB
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create a holder for the common ORB Objects.
+ TAO_Notify_ORB_Objects orb_objects;
+
+ orb_objects.init (orb ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /* Run the ORB in a seperate thread */
+ TAO_Notify_ORB_Run_Task orb_run_task (orb_objects);
+
+ /* Create a Client */
+ TAO_Notify_ThreadPool_Supplier_Client client (orb_objects);
+
+ if (client.parse_args (argc, argv) != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Supplier_Client::Error parsing options\n"));
+ return -1;
+ }
+
+ long flags = THR_NEW_LWP | THR_JOINABLE;
+
+ flags |=
+ orb->orb_core ()->orb_params ()->thread_creation_flags ();
+
+ /* Both the tasks initialize themselves at Priority 0*/
+ if (orb_run_task.activate (flags) == -1 || client.activate (flags) == -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. \n")));
+ }
+
+ orb_run_task.thr_mgr ()->wait ();
+ client.thr_mgr ()->wait ();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Supplier Client error "));
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/Supplier_Client.h b/TAO/orbsvcs/examples/Notify/ThreadPool/Supplier_Client.h
new file mode 100644
index 00000000000..b54786ea808
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/Supplier_Client.h
@@ -0,0 +1,79 @@
+/* -*- C++ -*- */
+/**
+ * @file Supplier_Client.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_SUPPLIER_CLIENT_H
+#define TAO_Notify_SUPPLIER_CLIENT_H
+#include /**/ "ace/pre.h"
+
+#include "ORB_Objects.h"
+#include "ace/Task.h"
+#include "ace/SString.h"
+
+class TAO_Notify_ThreadPool_Supplier;
+
+/**
+ * @class TAO_Notify_ThreadPool_Supplier_Client
+ *
+ * @brief Supplier Client
+ *
+ */
+class TAO_Notify_ThreadPool_Supplier_Client : public ACE_Task_Base
+{
+public:
+ /// Constuctor
+ TAO_Notify_ThreadPool_Supplier_Client (TAO_Notify_ORB_Objects& orb_objects);
+
+ /// Destructor
+ ~TAO_Notify_ThreadPool_Supplier_Client ();
+
+ /// Init
+ void _init (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Run
+ void run (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Parse Args
+ int parse_args (int argc, char *argv[]);
+
+ /// The thread entry point.
+ virtual int svc (void);
+
+protected:
+ /// Create an EC
+ CosNotifyChannelAdmin::EventChannel_ptr create_ec (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Write ior to file.
+ void write_ior (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// ORB Objects.
+ TAO_Notify_ORB_Objects orb_objects_;
+
+ /// Supplier that sends events.
+ TAO_Notify_ThreadPool_Supplier* supplier_;
+
+ /// The Number of consumers that we expect to send an event to.
+ int consumer_count_;
+
+ /// Name of the file to write the supplier ior to.
+ ACE_CString ior_file_name_;
+
+ /// Number of threads at the EC
+ int ec_thread_count_;
+
+ /// Number of Therads at the ProxyConsumer.
+ int proxy_consumer_thread_count_;
+
+ // Max events to send.
+ int max_events_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_SUPPLIER_CLIENT_H */
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/client.conf b/TAO/orbsvcs/examples/Notify/ThreadPool/client.conf
new file mode 100644
index 00000000000..52878238bc7
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/client.conf
@@ -0,0 +1 @@
+static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM -ORBPriorityMapping continuous" \ No newline at end of file
diff --git a/TAO/orbsvcs/examples/Notify/ThreadPool/notify.conf b/TAO/orbsvcs/examples/Notify/ThreadPool/notify.conf
new file mode 100644
index 00000000000..80a46e01105
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/notify.conf
@@ -0,0 +1,3 @@
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM -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/examples/Notify/ThreadPool/run_test.pl b/TAO/orbsvcs/examples/Notify/ThreadPool/run_test.pl
new file mode 100755
index 00000000000..26f20dccf8d
--- /dev/null
+++ b/TAO/orbsvcs/examples/Notify/ThreadPool/run_test.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 -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+# ThreadPool Example
+#
+
+$experiment_timeout = 60;
+$startup_timeout = 60;
+$max_events = 10;
+$ec_tp = 0;
+$pc_tp = 0;
+$ps1_tp = 1;
+$ps2_tp = 1;
+$debug = 0;
+
+$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 ("client.conf");
+
+$consumer_conf = PerlACE::LocalFile ("client.conf");
+
+$consumer2_conf = PerlACE::LocalFile ("client.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 -ORBDebugLevel $debug";
+
+$Supplier = new PerlACE::Process ("Supplier");
+
+$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -ORBSvcConf $supplier_conf -IORoutput $supplier_ior -Consumers 2 -EventChannel_ThreadPool $ec_tp -MaxEvents $max_events -ProxyConsumer_ThreadPool $pc_tp -ORBDebugLevel $debug";
+
+$Consumer = new PerlACE::Process ("Consumer");
+
+$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -ORBSvcConf $consumer_conf -MaxEvents $max_events -Delay 1 -ProxySupplier_ThreadPool $ps1_tp -ORBDebugLevel $debug";
+
+$Consumer2 = new PerlACE::Process ("Consumer");
+
+$Consumer2_Args = "-ORBInitRef NameService=file://$naming_ior -ORBSvcConf $consumer2_conf -MaxEvents $max_events -ProxySupplier_ThreadPool $ps2_tp -ORBDebugLevel $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 $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";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+$Consumer->Arguments ($Consumer_Args);
+$args = $Consumer->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$status = $Consumer->Spawn ();
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Consumer returned $status\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+$Consumer2->Arguments ($Consumer2_Args);
+$args = $Consumer2->Arguments ();
+print STDERR "Running Consumer2 with arguments: $args\n";
+$status = $Consumer2->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Consumer2 returned $status\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+$Consumer->Wait ();
+$Supplier->Wait ();
+
+unlink $supplier_ior;
+
+$Notification->Kill ();
+unlink $notify_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/examples/ORT/Gateway.idl b/TAO/orbsvcs/examples/ORT/Gateway.idl
new file mode 100644
index 00000000000..7f97783707c
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/Gateway.idl
@@ -0,0 +1,16 @@
+// $Id$
+
+#ifndef GATEWAY_IDL
+#define GATEWAY_IDL
+
+module Gateway
+{
+ interface Object_Factory
+ {
+ Object create_object (in string interface_repository_id,
+ in Object gatewayed_object);
+ };
+
+};
+
+#endif /* GATEWAY_IDL */
diff --git a/TAO/orbsvcs/examples/ORT/Gateway_ObjRef_Factory.cpp b/TAO/orbsvcs/examples/ORT/Gateway_ObjRef_Factory.cpp
new file mode 100644
index 00000000000..ecc1d6e1055
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/Gateway_ObjRef_Factory.cpp
@@ -0,0 +1,35 @@
+// $Id$
+
+#include "Gateway_ObjRef_Factory.h"
+
+Gateway_ObjRef_Factory::
+Gateway_ObjRef_Factory (
+ Gateway::Object_Factory_ptr gateway_object_factory,
+ PortableInterceptor::ObjectReferenceFactory *old_factory)
+ : gateway_object_factory_ (gateway_object_factory),
+ old_factory_ (old_factory)
+{
+ CORBA::add_ref (old_factory);
+}
+
+CORBA::Object_ptr
+Gateway_ObjRef_Factory::
+make_object (const char *interface_repository_id,
+ const PortableInterceptor::ObjectId & id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Object_var object =
+ this->old_factory_->make_object (interface_repository_id,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ CORBA::Object_ptr object_ptr =
+ this->gateway_object_factory_->create_object (interface_repository_id,
+ object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ return object_ptr;
+}
diff --git a/TAO/orbsvcs/examples/ORT/Gateway_ObjRef_Factory.h b/TAO/orbsvcs/examples/ORT/Gateway_ObjRef_Factory.h
new file mode 100644
index 00000000000..3af0da985b3
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/Gateway_ObjRef_Factory.h
@@ -0,0 +1,40 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef GATEWAY_OBJREF_FACTORY_H
+#define GATEWAY_OBJREF_FACTORY_H
+
+#include "ObjectReferenceFactoryC.h"
+#include "GatewayC.h"
+
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+class Gateway_ObjRef_Factory
+ : public CORBA::DefaultValueRefCountBase,
+ public virtual OBV_ORT::ObjectReferenceFactory
+{
+public:
+
+ Gateway_ObjRef_Factory (
+ Gateway::Object_Factory_ptr gateway_object_factory,
+ PortableInterceptor::ObjectReferenceFactory *old_factory);
+
+ virtual CORBA::Object_ptr make_object (
+ const char *repository_id,
+ const PortableInterceptor::ObjectId &id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ Gateway::Object_Factory_var gateway_object_factory_;
+
+ PortableInterceptor::ObjectReferenceFactory_var old_factory_;
+};
+
+#endif /* GATEWAY_OBJREF_FACTORY_H */
diff --git a/TAO/orbsvcs/examples/ORT/Gateway_i.cpp b/TAO/orbsvcs/examples/ORT/Gateway_i.cpp
new file mode 100644
index 00000000000..f4ce9754556
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/Gateway_i.cpp
@@ -0,0 +1,181 @@
+//$Id$
+
+#include "Gateway_i.h"
+
+#include "tao/AnyTypeCode/Any.h"
+#include "tao/AnyTypeCode/NVList.h"
+#include "tao/AnyTypeCode/ExceptionA.h"
+
+#include "tao/IFR_Client/IFR_BasicC.h"
+
+#include "tao/DynamicInterface/Server_Request.h"
+#include "tao/DynamicInterface/Request.h"
+#include "tao/DynamicInterface/Unknown_User_Exception.h"
+
+#include "tao/ORB.h"
+#include "tao/LocalObject.h"
+
+ACE_RCSID (ORT,
+ Gateway_i,
+ "$Id$")
+
+Gateway_i::
+Gateway_i (CORBA::ORB_ptr orb,
+ PortableServer::Current_ptr poa_current)
+ : orb_ (orb),
+ poa_current_ (poa_current)
+{
+ /// Constructor
+}
+
+void
+Gateway_i::invoke (CORBA::ServerRequest_ptr request
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::ObjectId_var target_id =
+ this->poa_current_->get_object_id ();
+
+ CORBA::String_var stringified_object_id =
+ PortableServer::ObjectId_to_string (target_id.in ());
+
+ CORBA::Object_var target_object =
+ this->orb_->string_to_object (stringified_object_id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Use the IfR interfaces to query the NVList for this object...
+ CORBA::InterfaceDef_var target_interface =
+ target_object->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (target_interface.in ()))
+ {
+ ///
+ }
+
+ // This is the target operation...
+ CORBA::String_var operation_name =
+ request->operation ();
+
+ CORBA::Contained_var contained_operation =
+ target_interface->lookup (operation_name.in ());
+
+ CORBA::OperationDef_var operation =
+ CORBA::OperationDef::_narrow (contained_operation.in ());
+
+ // Save the result typecode...
+ CORBA::TypeCode_var result_typecode =
+ operation.in ()->result (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ParDescriptionSeq_var parameters =
+ operation.in ()->params ();
+
+ // Build the NVList based on the info from the IfR
+ CORBA::NVList_ptr arguments;
+ this->orb_->create_list (parameters->length (),
+ arguments
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Flags flags = 0;
+
+ CORBA::ULong length = parameters->length ();
+
+ CORBA::ULong i = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ switch (parameters[i].mode)
+ {
+ case CORBA::PARAM_IN:
+ flags = CORBA::ARG_IN;
+ break;
+ case CORBA::PARAM_OUT:
+ flags = CORBA::ARG_OUT;
+ break;
+ case CORBA::PARAM_INOUT:
+ flags = CORBA::ARG_INOUT;
+ break;
+ }
+ }
+
+ for (i = 0; i != length; ++i)
+ {
+ CORBA::Any any;
+ any._tao_set_typecode (parameters[i].type.in ());
+
+ arguments->add_value (parameters[i].name,
+ any,
+ flags
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // Extract the values of the arguments from the DSI ServerRequest
+ request->arguments (arguments ACE_ENV_ARG_PARAMETER);
+
+ // Use the NVList (with values) to create a DII Request...
+ CORBA::Request_var dii_request;
+
+ CORBA::NamedValue *named_value = 0;
+
+ this->orb_->create_named_value (named_value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ContextList *context_list = 0;
+ CORBA::ExceptionList *exceptions = 0;
+
+ target_object->_create_request (CORBA::Context::_nil (),
+ operation_name.in (),
+ arguments,
+ named_value, /* Result */
+ exceptions,
+ context_list, /* Context List */
+ dii_request.inout (),
+ CORBA::Flags (0)
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Set the return type...
+ dii_request->set_return_type (result_typecode.in ());
+
+ ACE_TRY
+ {
+ // Make the DII request
+ dii_request->invoke (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // At this point the NVList contains all the out and inout
+ // arguments, but we need to extract the return value...
+ }
+ ACE_CATCH (CORBA::UnknownUserException, user_ex)
+ {
+ // Pass the exception back to the server request...
+ request->set_exception (user_ex.exception ());
+ return;
+ }
+ ACE_CATCH (CORBA::SystemException, sys_ex)
+ {
+ CORBA::Any any;
+ any <<= sys_ex;
+ // Pass the exception back to the server request...
+ request->set_exception (any);
+ return;
+ }
+ ACE_CATCHANY;
+ ACE_ENDTRY;
+
+ request->set_result (dii_request->return_value ());
+ // Using the same NVList for both the DSI Server Request and the DII
+ // Request takes care of the out and inout arguments (whew!)
+}
+
+CORBA::RepositoryId
+Gateway_i::_primary_interface (const PortableServer::ObjectId &,
+ PortableServer::POA_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/ORT/Gateway_i.h b/TAO/orbsvcs/examples/ORT/Gateway_i.h
new file mode 100644
index 00000000000..a49d7a1e73a
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/Gateway_i.h
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+//
+// $Id$
+
+//=============================================================================
+/**
+ * @file Gateway_i.h
+ *
+ * $Id$
+ *
+ * Implementation header used for forwarding the requests from the
+ * gateway to the server and reply to the client
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ * @author Priyanka Gontla <gontla_p@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef GATEWAY_I_H
+#define GATEWAY_I_H
+
+#include "tao/IFR_Client/IFR_Client_Adapter_Impl.h"
+#include "tao/AnyTypeCode/AnyTypeCode_methods.h"
+#include "tao/DynamicInterface/DII_CORBA_methods.h"
+#include "tao/DynamicInterface/Dynamic_Implementation.h"
+#include "tao/PortableServer/PortableServer.h"
+
+class Gateway_i
+ : public virtual PortableServer::DynamicImplementation
+{
+public:
+ Gateway_i (CORBA::ORB_ptr orb,
+ PortableServer::Current_ptr poa_current);
+
+ virtual void invoke (CORBA::ServerRequest_ptr request
+ ACE_ENV_ARG_DECL);
+
+ virtual CORBA::RepositoryId _primary_interface (
+ const PortableServer::ObjectId &oid,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL);
+
+ private:
+
+ CORBA::ORB_ptr orb_;
+
+ PortableServer::Current_ptr poa_current_;
+};
+
+#endif /* GATEWAY_I_H */
diff --git a/TAO/orbsvcs/examples/ORT/Makefile.am b/TAO/orbsvcs/examples/ORT/Makefile.am
new file mode 100644
index 00000000000..03e2618d646
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/Makefile.am
@@ -0,0 +1,225 @@
+## 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)
+
+CLEANFILES =
+noinst_PROGRAMS =
+BUILT_SOURCES =
+
+## Makefile.ORT_Idl.am
+
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES += \
+ GatewayC.cpp \
+ GatewayC.h \
+ GatewayC.inl \
+ GatewayS.cpp \
+ GatewayS.h \
+ GatewayS.inl
+
+CLEANFILES += \
+ Gateway-stamp \
+ GatewayC.cpp \
+ GatewayC.h \
+ GatewayC.inl \
+ GatewayS.cpp \
+ GatewayS.h \
+ GatewayS.inl
+
+GatewayC.cpp GatewayC.h GatewayC.inl GatewayS.cpp GatewayS.h GatewayS.inl: Gateway-stamp
+
+Gateway-stamp: $(srcdir)/Gateway.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Gateway.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ ObjectReferenceFactoryC.cpp \
+ ObjectReferenceFactoryC.h \
+ ObjectReferenceFactoryC.inl \
+ ObjectReferenceFactoryS.cpp \
+ ObjectReferenceFactoryS.h \
+ ObjectReferenceFactoryS.inl
+
+CLEANFILES += \
+ ObjectReferenceFactory-stamp \
+ ObjectReferenceFactoryC.cpp \
+ ObjectReferenceFactoryC.h \
+ ObjectReferenceFactoryC.inl \
+ ObjectReferenceFactoryS.cpp \
+ ObjectReferenceFactoryS.h \
+ ObjectReferenceFactoryS.inl
+
+ObjectReferenceFactoryC.cpp ObjectReferenceFactoryC.h ObjectReferenceFactoryC.inl ObjectReferenceFactoryS.cpp ObjectReferenceFactoryS.h ObjectReferenceFactoryS.inl: ObjectReferenceFactory-stamp
+
+ObjectReferenceFactory-stamp: $(srcdir)/ObjectReferenceFactory.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/ObjectReferenceFactory.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ sum_serverC.cpp \
+ sum_serverC.h \
+ sum_serverC.inl \
+ sum_serverS.cpp \
+ sum_serverS.h \
+ sum_serverS.inl
+
+CLEANFILES += \
+ sum_server-stamp \
+ sum_serverC.cpp \
+ sum_serverC.h \
+ sum_serverC.inl \
+ sum_serverS.cpp \
+ sum_serverS.h \
+ sum_serverS.inl
+
+sum_serverC.cpp sum_serverC.h sum_serverC.inl sum_serverS.cpp sum_serverS.h sum_serverS.inl: sum_server-stamp
+
+sum_server-stamp: $(srcdir)/sum_server.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/sum_server.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ Gateway.idl \
+ ObjectReferenceFactory.idl \
+ sum_server.idl
+
+endif !BUILD_MINIMUM_CORBA
+
+## Makefile.ORT_Gateway.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += gateway_server
+
+gateway_server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+gateway_server_SOURCES = \
+ GatewayC.cpp \
+ GatewayS.cpp \
+ Gateway_i.cpp \
+ Object_Factory_i.cpp \
+ gateway_server.cpp \
+ Gateway_i.h \
+ Object_Factory_i.h
+
+gateway_server_LDADD = \
+ $(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_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.ORT_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 = \
+ GatewayC.cpp \
+ Gateway_ObjRef_Factory.cpp \
+ ObjectReferenceFactoryC.cpp \
+ Server_IORInterceptor.cpp \
+ Server_IORInterceptor_ORBInitializer.cpp \
+ server.cpp \
+ sum_serverC.cpp \
+ sum_serverS.cpp \
+ sum_server_i.cpp \
+ Gateway_ObjRef_Factory.h \
+ Server_IORInterceptor.h \
+ Server_IORInterceptor_ORBInitializer.h \
+ sum_server_i.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORInterceptor.la \
+ $(TAO_BUILDDIR)/tao/libTAO_ObjRefTemplate.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_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.ORT_Client.am
+
+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 \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+client_SOURCES = \
+ client.cpp \
+ sum_serverC.cpp \
+ Gateway_ObjRef_Factory.h \
+ Gateway_i.h \
+ Object_Factory_i.h \
+ Server_IORInterceptor.h \
+ Server_IORInterceptor_ORBInitializer.h \
+ sum_server_i.h
+
+client_LDADD = \
+ $(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
+
+## 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/examples/ORT/ORT.mpc b/TAO/orbsvcs/examples/ORT/ORT.mpc
new file mode 100644
index 00000000000..82fc927aab8
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/ORT.mpc
@@ -0,0 +1,52 @@
+// $Id$
+
+project(*idl): taoidldefaults, minimum_corba {
+ idl_files {
+ Gateway.idl
+ ObjectReferenceFactory.idl
+ sum_server.idl
+ }
+ custom_only = 1
+}
+
+project(*Gateway) : orbsvcsexe, dynamicinterface, ifr_client, minimum_corba {
+ after += *idl
+
+ source_files {
+ GatewayC.cpp
+ GatewayS.cpp
+ gateway_server.cpp
+ Gateway_i.cpp
+ Object_Factory_i.cpp
+ }
+ idl_files {
+ }
+}
+
+project(*Server) : orbsvcsexe, dynamicinterface, ifr_client, minimum_corba, iorinterceptor {
+ exename = server
+ after += *Gateway
+ source_files {
+ server.cpp
+ GatewayC.cpp
+ Gateway_ObjRef_Factory.cpp
+ sum_serverC.cpp
+ sum_serverS.cpp
+ sum_server_i.cpp
+ Server_IORInterceptor_ORBInitializer.cpp
+ Server_IORInterceptor.cpp
+ ObjectReferenceFactoryC.cpp
+ }
+ idl_files {
+ }
+}
+
+project(*Client) : orbsvcsexe, event, minimum_corba {
+ after += *Idl *Server
+ source_files {
+ client.cpp
+ sum_serverC.cpp
+ }
+ idl_files {
+ }
+}
diff --git a/TAO/orbsvcs/examples/ORT/ObjectReferenceFactory.idl b/TAO/orbsvcs/examples/ORT/ObjectReferenceFactory.idl
new file mode 100644
index 00000000000..0b7c8d10bee
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/ObjectReferenceFactory.idl
@@ -0,0 +1,16 @@
+// -*- IDL -*-
+//
+// $Id$
+
+#ifndef OBJECT_REFERENCE_FACTORY_IDL
+#define OBJECT_REFERENCE_FACTORY_IDL
+
+#include "tao/ObjRefTemplate/ObjectReferenceTemplate_include.pidl"
+
+module ORT
+{
+ valuetype ObjectReferenceFactory
+ : PortableInterceptor::ObjectReferenceFactory {};
+};
+
+#endif /* OBJECT_REFERENCE_FACTORY_IDL */
diff --git a/TAO/orbsvcs/examples/ORT/Object_Factory_i.cpp b/TAO/orbsvcs/examples/ORT/Object_Factory_i.cpp
new file mode 100644
index 00000000000..32c4e9ce579
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/Object_Factory_i.cpp
@@ -0,0 +1,49 @@
+// $Id$
+
+#include "Object_Factory_i.h"
+#include "tao/PortableServer/Root_POA.h"
+
+Object_Factory_i::Object_Factory_i (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr gateway_poa)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ gateway_poa_ (gateway_poa)
+{
+ /// Constructor
+}
+
+
+CORBA::Object_ptr
+Object_Factory_i::create_object (const char *interface_repository_id,
+ CORBA::Object_ptr gatewayed_object
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::String_var stringified_object =
+ this->orb_->object_to_string (gatewayed_object ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ const PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId (stringified_object.in ());
+
+ const PortableInterceptor::ObjectId *obj_id =
+ reinterpret_cast<const PortableInterceptor::ObjectId *> (&id.in ());
+ ACE_UNUSED_ARG(obj_id);
+ ACE_UNUSED_ARG(interface_repository_id);
+/*
+ TAO_POA *poa = dynamic_cast <TAO_POA *> (this->gateway_poa_);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ PortableInterceptor::ObjectReferenceTemplate *ort_template =
+ poa->get_adapter_template();
+
+ TAO_ObjectReferenceTemplate *ort =
+ dynamic_cast <TAO_ObjectReferenceTemplate *> (ort_template);
+
+ CORBA::Object_ptr object_ptr =
+ ort->make_object (interface_repository_id,
+ *obj_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());*/
+
+ return CORBA::Object::_nil();
+}
diff --git a/TAO/orbsvcs/examples/ORT/Object_Factory_i.h b/TAO/orbsvcs/examples/ORT/Object_Factory_i.h
new file mode 100644
index 00000000000..add32112dbd
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/Object_Factory_i.h
@@ -0,0 +1,45 @@
+// $Id$
+
+//=============================================================================
+/**
+ * @file Object_Factory_i.h
+ *
+ * $Id$
+ *
+ * Implementation header for the "Gateway" IDL interface for the
+ * ORT example.
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ * @author Priyanka Gontla <gontla_p@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef OBJECT_FACTORY_I_H
+#define OBJECT_FACTORY_I_H
+
+#include "GatewayS.h"
+
+#include "tao/PortableServer/PortableServerC.h"
+#include "tao/ORB.h"
+
+class Object_Factory_i : public virtual POA_Gateway::Object_Factory
+{
+ public:
+
+ /// Constructor
+ Object_Factory_i (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr gateway_poa);
+
+ CORBA::Object_ptr
+ create_object (const char *interface_repository_id,
+ CORBA::Object_ptr gatewayed_object
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ private:
+
+ CORBA::ORB_ptr orb_;
+ PortableServer::POA_ptr gateway_poa_;
+};
+
+#endif /* OBJECT_FACTORY_I_H */
diff --git a/TAO/orbsvcs/examples/ORT/README b/TAO/orbsvcs/examples/ORT/README
new file mode 100644
index 00000000000..2b1b313b3e6
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/README
@@ -0,0 +1,69 @@
+$Id$
+
+This example shows the use of ORT Template by a simple application.
+
+Scenario:
+========
+
+1. There's a server which has a dummy method that adds the two 'in' variables
+ and return the sum to the client.
+
+2. There is a Gateway which receives the requests on behalf of the
+ server and redirects to the server. So the client never knows about
+ the actual server but only the gateway.
+
+3. And, as always we will have a client that invokes the server
+ method.
+
+Files and Small Description
+=====================
+
+
+Gateway.idl IDL for the Gateway
+
+Gateway_IORInterceptor IORInterceptor for the Gateway.
+
+Gateway_i Implementation of the Gateway which changes the DSI to DII.
+
+Object_Factory_i Implementation for the
+ Gateway IDL method. This method
+ creates a reference which points to the gateway
+ instead of the server.
+
+gateway_server As the name means, gateway server
+ implementation.
+
+sum_server.idl idl for the sum_server.
+
+server The main server which is being
+ gatewayed by the gateway
+
+sum_server_i Implementation of sum_server.idl methods.
+
+client Simple client which invokes the sum_server
+ method add_variables.
+
+How to run the example
+======================
+
+1. First run the IFR_Service.
+
+% $IFR_Service
+
+ It generates an ior in if_repo.ior by default.
+
+2. Then, run the tao_ifr passing sum_server.idl as its argument,
+
+% $tao_ifr sum_server.idl
+
+3. Run the gateway server
+
+% ./gateway_server -o gateway_ior -ORBInitRef IFR_Service=file://if_repo.ior
+
+4. Run the actual server.
+
+% ./server -o server_ior -ORBInitRef Gateway_Object_Factory=file://gateway_ior
+
+5. Run the client
+
+% ./client -k file://server_ior
diff --git a/TAO/orbsvcs/examples/ORT/Server_IORInterceptor.cpp b/TAO/orbsvcs/examples/ORT/Server_IORInterceptor.cpp
new file mode 100644
index 00000000000..2cd8117b443
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/Server_IORInterceptor.cpp
@@ -0,0 +1,85 @@
+// $Id$
+
+#include "Server_IORInterceptor.h"
+#include "Gateway_ObjRef_Factory.h"
+
+ACE_RCSID (ORT,
+ Server_IORInterceptor,
+ "$Id$")
+
+
+Server_IORInterceptor::
+Server_IORInterceptor (Gateway::Object_Factory_ptr factory)
+ : gateway_object_factory_ (Gateway::Object_Factory::_duplicate (factory))
+{
+}
+
+Server_IORInterceptor::~Server_IORInterceptor (void)
+{
+ CORBA::release (this->gateway_object_factory_);
+}
+
+
+char *
+Server_IORInterceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("Server_IORInterceptor");
+}
+
+void
+Server_IORInterceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::release (this->gateway_object_factory_);
+ this->gateway_object_factory_ = Gateway::Object_Factory::_nil ();
+}
+
+void
+Server_IORInterceptor::establish_components (
+ PortableInterceptor::IORInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+Server_IORInterceptor::components_established (
+ PortableInterceptor::IORInfo_ptr ior_info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ Gateway_ObjRef_Factory *my_factory = 0;
+
+ PortableInterceptor::ObjectReferenceFactory_var current_factory =
+ ior_info->current_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_NEW_THROW_EX (my_factory,
+ Gateway_ObjRef_Factory (this->gateway_object_factory_,
+ current_factory.in ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ ior_info->current_factory (my_factory
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Server_IORInterceptor::adapter_manager_state_changed (
+ const char *,
+ PortableInterceptor::AdapterState
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+Server_IORInterceptor:: adapter_state_changed (
+ const PortableInterceptor::ObjectReferenceTemplateSeq &,
+ PortableInterceptor::AdapterState
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
diff --git a/TAO/orbsvcs/examples/ORT/Server_IORInterceptor.h b/TAO/orbsvcs/examples/ORT/Server_IORInterceptor.h
new file mode 100644
index 00000000000..da243325d05
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/Server_IORInterceptor.h
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+//
+//$Id$
+
+#ifndef SERVER_IORINTERCEPTOR_H
+#define SERVER_IORINTERCEPTOR_H
+
+#include "GatewayC.h"
+#include "tao/IORInterceptor/IORInterceptor.h"
+#include "tao/LocalObject.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 Server_IORInterceptor
+ : public virtual PortableInterceptor::IORInterceptor_3_0,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ Server_IORInterceptor (Gateway::Object_Factory_ptr gateway_object_factory);
+
+ /**
+ * @name Methods Required by the IOR 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 IOR interceptors.
+ */
+ //@{
+ /// Return the name of this IORInterceptor.
+ virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Cleanup resources acquired by this IORInterceptor.
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Add the tagged components to the IOR.
+ virtual void establish_components (
+ PortableInterceptor::IORInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void components_established (
+ PortableInterceptor::IORInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void adapter_manager_state_changed (
+ const char * id,
+ PortableInterceptor::AdapterState state
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void adapter_state_changed (
+ const PortableInterceptor::ObjectReferenceTemplateSeq & templates,
+ PortableInterceptor::AdapterState state
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ //@}
+
+protected:
+
+ ~Server_IORInterceptor (void);
+
+private:
+
+ Gateway::Object_Factory_ptr gateway_object_factory_;
+
+};
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* SERVER_IORINTERCEPTOR_H */
diff --git a/TAO/orbsvcs/examples/ORT/Server_IORInterceptor_ORBInitializer.cpp b/TAO/orbsvcs/examples/ORT/Server_IORInterceptor_ORBInitializer.cpp
new file mode 100644
index 00000000000..93fd158c07b
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/Server_IORInterceptor_ORBInitializer.cpp
@@ -0,0 +1,59 @@
+// $Id$
+
+#include "Server_IORInterceptor_ORBInitializer.h"
+#include "Server_IORInterceptor.h"
+#include "tao/ORB_Constants.h"
+
+#include "GatewayC.h"
+
+ACE_RCSID (ORT,
+ Server_IORInterceptor_ORBInitializer,
+ "$Id: ")
+
+void
+Server_IORInterceptor_ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr /* info */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+Server_IORInterceptor_ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Object_var obj =
+ info->resolve_initial_references ("Gateway_Object_Factory"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ /// Narrow it down correctly.
+ Gateway::Object_Factory_var gateway_object_factory =
+ Gateway::Object_Factory::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ /// Check for nil reference
+ if (CORBA::is_nil (gateway_object_factory.in ()))
+ ACE_ERROR ((LM_ERROR,
+ "Unable to obtain reference to Gateway::Object_Factory "
+ "object.\n"));
+
+ PortableInterceptor::IORInterceptor_ptr gateway;
+ ACE_NEW_THROW_EX (gateway,
+ Server_IORInterceptor (gateway_object_factory.in ()),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableInterceptor::IORInterceptor_var ior_interceptor = gateway;
+
+ info->add_ior_interceptor (ior_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/examples/ORT/Server_IORInterceptor_ORBInitializer.h b/TAO/orbsvcs/examples/ORT/Server_IORInterceptor_ORBInitializer.h
new file mode 100644
index 00000000000..5fd0887f014
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/Server_IORInterceptor_ORBInitializer.h
@@ -0,0 +1,44 @@
+// $Id$
+
+#ifndef SERVER_IOR_INTERCEPTOR_ORB_INITIALIZER_H
+#define SERVER_IOR_INTERCEPTOR_ORB_INITIALIZER_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PI/PI.h"
+#include "tao/LocalObject.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class Server_IORInterceptor_ORBInitializer
+ : public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+ public:
+
+ //@{
+ /// The pre-initialization hook.
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// The post-initialization hook.
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+};
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* SERVER_IOR_INTERCEPTOR_ORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/examples/ORT/client.cpp b/TAO/orbsvcs/examples/ORT/client.cpp
new file mode 100644
index 00000000000..699985a1993
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/client.cpp
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+
+#include "sum_serverC.h"
+#include "ace/Get_Opt.h"
+
+ACE_RCSID (ORT,
+ 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.optarg;
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-k IOR "
+ "\n",
+ argv[0]),
+ -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, "client_sum_orb" 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;
+
+ ORT::sum_server_var server =
+ ORT::sum_server::_narrow (obj.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);
+ }
+
+ CORBA::ULong a = 5;
+ CORBA::ULong b = 3;
+
+ CORBA::ULong result = server->add_variables (a,
+ b
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result != 8)
+ ACE_DEBUG ((LM_DEBUG,
+ "Error: Add Variables did not return the right value\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ORT example on client side :");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/ORT/gateway_server.cpp b/TAO/orbsvcs/examples/ORT/gateway_server.cpp
new file mode 100644
index 00000000000..d52bc63f0f2
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/gateway_server.cpp
@@ -0,0 +1,189 @@
+// $Id$
+
+#include "Object_Factory_i.h"
+#include "Gateway_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.optarg;
+ break;
+ 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,
+ "gateway_server_orb"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return -1;
+
+ /// Resolve reference to RootPOA
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// Narrow it down correctly.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// Check for nil references
+ if (CORBA::is_nil (root_poa.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to obtain RootPOA reference.\n"),
+ -1);
+
+ /// Get poa_manager reference
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// Activate it.
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ///@}
+
+ CORBA::PolicyList policies (3);
+ policies.length (3);
+
+ policies [0] =
+ root_poa->create_servant_retention_policy (PortableServer::RETAIN
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ policies [1] =
+ root_poa->create_request_processing_policy (PortableServer::USE_DEFAULT_SERVANT
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+ policies [2] =
+ root_poa->create_id_uniqueness_policy (PortableServer::MULTIPLE_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var gateway_poa =
+ root_poa->create_POA ("Gateway_POA",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ for (CORBA::ULong i = 0; i != policies.length (); ++i) {
+ policies[i]->destroy ();
+ }
+
+ // Get the POA Current object reference
+ obj =
+ orb->resolve_initial_references ("POACurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow the object reference to a POA Current reference
+ PortableServer::Current_var poa_current =
+ PortableServer::Current::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Gateway_i *gateway;
+
+ ACE_NEW_THROW_EX (gateway,
+ Gateway_i (orb.in (),
+ poa_current.in ()),
+ CORBA::NO_MEMORY ());
+ ACE_TRY_CHECK;
+
+ gateway_poa->set_servant (gateway ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// Get the ObjectID
+ PortableServer::ObjectId_var oid =
+ PortableServer::string_to_ObjectId ("Object_Factory");
+
+ /// This class is used to create a object reference.
+ Object_Factory_i *object_factory;
+
+ ACE_NEW_THROW_EX (object_factory,
+ Object_Factory_i (orb.in (),
+ gateway_poa.in ()),
+ CORBA::NO_MEMORY ());
+ ACE_TRY_CHECK;
+
+ /// Activate the Object_Factory_i Object
+ gateway_poa->activate_object_with_id (oid.in (),
+ object_factory
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the object reference.
+ CORBA::Object_var gateway_object_factory =
+ gateway_poa->id_to_reference (oid.in ());
+
+ /// Convert the object reference to a string format.
+ CORBA::String_var ior =
+ orb->object_to_string (gateway_object_factory.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);
+ }
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ORT test (gateway_server):");
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/ORT/run_test.pl b/TAO/orbsvcs/examples/ORT/run_test.pl
new file mode 100755
index 00000000000..9554ac4bc46
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/run_test.pl
@@ -0,0 +1,130 @@
+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";
+$srv_iorfile = "iorfile.ior";
+$gateway_iorfile = "gateway_ior.ior";
+$test_idl = PerlACE::LocalFile ("sum_server.idl");
+
+# 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;
+ }
+}
+
+$lookup_by_name = "";
+$other = "";
+
+for ($i = 0; $i <= $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-n") {
+ $lookup_by_name = "-n";
+ }
+ else {
+ $other .= $ARGV[$i];
+ }
+}
+
+$TAO_IFR = new PerlACE::Process ($tao_ifr);
+$IFR = new PerlACE::Process ("../../IFR_Service/IFR_Service", " -o $ifr_iorfile");
+$GATEWAYSV = new PerlACE::Process ("gateway_server", "-o $gateway_iorfile -ORBInitRef IFR_Service=file://$ifr_iorfile");
+$SV = new PerlACE::Process ("server", "-o $srv_iorfile -ORBInitRef Gateway_Object_Factory=file://$gateway_iorfile");
+$CL2 = new PerlACE::Process ("client", "-k file://$srv_iorfile");
+
+unlink $ifr_iorfile;
+unlink $svr_iorfile;
+unlink $gateway_iorfile;
+
+$IFR->Spawn ();
+
+if (PerlACE::waitforfile_timed ($ifr_iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$ifr_iorfile>\n";
+ $IFR->Kill ();
+ exit 1;
+}
+
+$TAO_IFR->Arguments ("-ORBInitRef InterfaceRepository=file://$ifr_iorfile $test_idl");
+
+$tresult = $TAO_IFR->SpawnWaitKill (30);
+
+$GATEWAYSV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($gateway_iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$gateway_iorfile>\n";
+ $IFR->Kill ();
+ $GATEWAYSV->Kill ();
+ exit 1;
+}
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($svr_iorfile, 1500) == -1) {
+ print STDERR "ERROR: cannot find file <$srv_iorfile>\n";
+ $IFR->Kill ();
+ $GATEWAYSV->Kill ();
+ $SV->Kill ();
+ exit 1;
+}
+
+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;
+}
+
+$tresult = $TAO_IFR->SpawnWaitKill (30);
+
+if ($tresult != 0) {
+ print STDERR "ERROR: tao_ifr (-r test.idl) returned $tresult\n";
+ $status = 1;
+}
+
+$gatewayserver = $GATEWAYSV->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\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 $srv_iorfile;
+unlink $gateway_iorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/examples/ORT/server.cpp b/TAO/orbsvcs/examples/ORT/server.cpp
new file mode 100644
index 00000000000..1b76cecb393
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/server.cpp
@@ -0,0 +1,152 @@
+// $Id$
+
+#include "sum_server_i.h"
+#include "Server_IORInterceptor_ORBInitializer.h"
+#include "tao/ORBInitializer_Registry.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.optarg;
+ break;
+ 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
+ {
+#if TAO_HAS_INTERCEPTORS == 1
+
+ PortableInterceptor::ORBInitializer_ptr orb_initializer =
+ PortableInterceptor::ORBInitializer::_nil ();
+
+ ACE_NEW_RETURN (orb_initializer,
+ Server_IORInterceptor_ORBInitializer,
+ -1); // No CORBA exceptions yet!
+
+ PortableInterceptor::ORBInitializer_var orb_initializer_var =
+ orb_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer_var.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+
+ // The usual initialization stuff
+
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ "server_sum_orb"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return -1;
+
+ // Resolve reference to RootPOA
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow it down correctly.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Check for nil references
+ if (CORBA::is_nil (root_poa.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to obtain RootPOA reference.\n"),
+ -1);
+
+ // Get poa_manager reference
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Activate it.
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // initialize the sum_server
+ sum_server_i sum_server_impl;
+
+ // Activate
+ obj = sum_server_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow it down.
+ ORT::sum_server_var sum_server =
+ ORT::sum_server::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Check for nil reference
+ if (CORBA::is_nil (sum_server.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to obtain reference to ORT::sum_server "
+ "object.\n"),
+ -1);
+
+ // Convert the object reference to a string format.
+ CORBA::String_var ior =
+ orb->object_to_string (sum_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,
+ "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);
+ }
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_INFO, "Successful.\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ORT example server:");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/ORT/sum_server.idl b/TAO/orbsvcs/examples/ORT/sum_server.idl
new file mode 100644
index 00000000000..31c599c88e4
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/sum_server.idl
@@ -0,0 +1,10 @@
+// $Id$
+
+module ORT
+{
+ interface sum_server
+ {
+ long add_variables (in long a,
+ in long b);
+ };
+};
diff --git a/TAO/orbsvcs/examples/ORT/sum_server_i.cpp b/TAO/orbsvcs/examples/ORT/sum_server_i.cpp
new file mode 100644
index 00000000000..9b14117125e
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/sum_server_i.cpp
@@ -0,0 +1,20 @@
+// $Id$
+
+#include "sum_server_i.h"
+
+ACE_RCSID (ORT,
+ sum_server_i,
+ "$Id$")
+
+sum_server_i::sum_server_i ()
+{
+}
+
+CORBA::Long
+sum_server_i::add_variables (CORBA::Long a,
+ CORBA::Long b
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return a+b;
+}
diff --git a/TAO/orbsvcs/examples/ORT/sum_server_i.h b/TAO/orbsvcs/examples/ORT/sum_server_i.h
new file mode 100644
index 00000000000..ea38c4ae7ab
--- /dev/null
+++ b/TAO/orbsvcs/examples/ORT/sum_server_i.h
@@ -0,0 +1,40 @@
+// $Id$
+
+//=============================================================================
+/**
+ * @file sum_server_i.h
+ *
+ * $Id$
+ *
+ * Implementation header for the "server" IDL interface for the
+ * ORT example.
+ *
+ * @author Priyanka Gontla <gontla_p@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef SUM_SERVER_I_H
+#define SUM_SERVER_I_H
+
+#include "sum_serverS.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 sum_server_i : public virtual POA_ORT::sum_server
+{
+ public:
+
+ /// Constructor
+ sum_server_i ();
+
+ /// add variables method
+ CORBA::Long add_variables (CORBA::Long a,
+ CORBA::Long b
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+};
+
+#endif /* SUM_SERVER_I_H */
diff --git a/TAO/orbsvcs/examples/PSS/README b/TAO/orbsvcs/examples/PSS/README
new file mode 100644
index 00000000000..bd87fa9ac2c
--- /dev/null
+++ b/TAO/orbsvcs/examples/PSS/README
@@ -0,0 +1,58 @@
+
+This example show the usage of PSS for persistently saving data.
+
+
+For this example, we will have a simple_naming.idl which will have just
+two methods: bind and find. As you can guess, the bind function is to
+be used for binding the name of an object with its object
+reference. And, the find function helps find the object reference
+related to the 'name'. To make it simple, we will just bind the
+stringified form of a name to the stringified form of the object reference.
+
+How to Run
+----------
+
+As with the naming_service, we will first run the Simple_Naming
+
+% ./Simple_Naming -o simple_naming.ior
+
+
+Next Run the server giving it the reference to Simple_Naming. As this
+is an example, didnt bother about making the Simple_Naming multicast
+enabled... kept it simple.
+
+
+% ./server -ORBInitRef Simple_Naming=file://simple_naming.ior
+
+The Simple_Naming writes down the server -> IOR mapping to a file
+(Data_Store) .. this serves as the database used to help make the PSS
+persistent.
+
+
+Then Run the Client
+
+% ./client -ORBInitRef Simple_Naming=file://simple_naming.ior
+
+
+On Success, you will not get debug statements.
+
+
+To test the persistency offered by the Persistent State Service, lets
+keep the server running .. but kill the Simple_Naming.
+
+% kill -9 pid_of_simple_naming
+
+Now, restart the Simple_Naming as before
+
+% ./Simple_Naming
+
+And, run the client to see if the Simple_Naming can help get the
+request sent to the correct server.
+
+
+% ./client -ORBInitRef Simple_Naming=file://simple_naming.ior
+
+
+
+Note: If running the example fresh, make sure you remove the
+previously generated 'Data_Store'.
diff --git a/TAO/orbsvcs/examples/PSS/Server.idl b/TAO/orbsvcs/examples/PSS/Server.idl
new file mode 100644
index 00000000000..b9edd30e302
--- /dev/null
+++ b/TAO/orbsvcs/examples/PSS/Server.idl
@@ -0,0 +1,31 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/examples/PSS
+//
+// = FILENAME
+// Server.idl
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_SERVER_IDL
+#define TAO_SERVER_IDL
+
+#pragma prefix "omg.org"
+
+module Simple_Server
+{
+ interface Server
+ {
+ string get_status ();
+ };
+
+};
+
+#endif /* TAO_SERVER_IDL */
diff --git a/TAO/orbsvcs/examples/PSS/Server_i.cpp b/TAO/orbsvcs/examples/PSS/Server_i.cpp
new file mode 100644
index 00000000000..0d5e1bcfe43
--- /dev/null
+++ b/TAO/orbsvcs/examples/PSS/Server_i.cpp
@@ -0,0 +1,20 @@
+// $Id$
+
+#include "Server_i.h"
+
+ACE_RCSID (PSS, Server_i, "$Id$")
+
+Server_i::Server_i (void)
+{
+}
+
+Server_i::~Server_i (void)
+{
+}
+
+char *
+Server_i::get_status (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("active");
+}
diff --git a/TAO/orbsvcs/examples/PSS/Server_i.h b/TAO/orbsvcs/examples/PSS/Server_i.h
new file mode 100644
index 00000000000..5f5937e24a5
--- /dev/null
+++ b/TAO/orbsvcs/examples/PSS/Server_i.h
@@ -0,0 +1,40 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/examples/PSS
+//
+// = FILENAME
+// Server_i.h
+//
+// = DESCRIPTION
+// This class implements the get_status method in server.idl
+//
+// = AUTHORS
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef SERVER_I_H
+#define SERVER_I_H
+#include /**/ "ace/pre.h"
+
+#include "ServerS.h"
+
+class Server_i : public virtual POA_Simple_Server::Server
+{
+ public:
+
+ Server_i ();
+
+ ~Server_i ();
+
+ virtual char *get_status (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+#include /**/ "ace/post.h"
+#endif /* SERVER_I_H */
+
diff --git a/TAO/orbsvcs/examples/PSS/Simple_Naming.cpp b/TAO/orbsvcs/examples/PSS/Simple_Naming.cpp
new file mode 100644
index 00000000000..91add5d9900
--- /dev/null
+++ b/TAO/orbsvcs/examples/PSS/Simple_Naming.cpp
@@ -0,0 +1,164 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/examples/PSS
+//
+// = FILENAME
+// server.cpp
+//
+// = DESCRIPTION
+// This class implements a simple CORBA server which uses the
+// simple_naming.idl to bind and find a object reference and uses
+// Persistent State Service to save the information persistently.
+// Serves like a Simple naming service.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+// ============================================================================
+
+#include "Simple_Naming_i.h"
+#include "ace/Get_Opt.h"
+
+ACE_RCSID (PSS, client, "$Id$")
+
+const char *ior_output_file = "simple_naming.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_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) == -1)
+ return -1;
+
+ // 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 root_poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Set a POA Manager
+ PortableServer::POAManager_var poa_manager =
+ root_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::PolicyList policies (2);
+ policies.length (2);
+
+ // Id Assignment policy
+ policies[0] =
+ root_poa->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Lifespan policy
+ policies[1] =
+ root_poa->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // We use a different POA, otherwise the user would have to change
+ // the object key each time it invokes the server.
+ PortableServer::POA_var poa =
+ root_poa->create_POA ("Simple_Naming",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Creation of the new POAs 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;
+ }
+
+ Naming_Context_i simple_naming_i (orb.in ());
+
+ // Activate it to obtain the reference
+ Simple_Naming::Naming_Context_var simple_naming =
+ simple_naming_i._this ();
+
+ CORBA::String_var string_obj_ref =
+ orb->object_to_string (simple_naming.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", string_obj_ref.in ());
+ ACE_OS::fclose (output_file);
+
+ 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,
+ "Unexpected excpeption in PSS Test");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/PSS/Simple_Naming.idl b/TAO/orbsvcs/examples/PSS/Simple_Naming.idl
new file mode 100644
index 00000000000..e7728b70306
--- /dev/null
+++ b/TAO/orbsvcs/examples/PSS/Simple_Naming.idl
@@ -0,0 +1,36 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/examples/PSS
+//
+// = FILENAME
+// Simple_Naming.idl
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_SIMPLE_NAMING_IDL
+#define TAO_SIMPLE_NAMING_IDL
+
+#pragma prefix "omg.org"
+
+module Simple_Naming
+{
+ typedef string Name;
+ typedef string Str_Obj;
+
+ interface Naming_Context
+ {
+ long bind (in Name n, in Str_Obj obj);
+
+ Str_Obj find (in Name n);
+ };
+
+};
+
+#endif /* TAO_SIMPLE_NAMING_IDL */
diff --git a/TAO/orbsvcs/examples/PSS/Simple_Naming_i.cpp b/TAO/orbsvcs/examples/PSS/Simple_Naming_i.cpp
new file mode 100644
index 00000000000..41178b04976
--- /dev/null
+++ b/TAO/orbsvcs/examples/PSS/Simple_Naming_i.cpp
@@ -0,0 +1,47 @@
+// $Id$
+
+#include "Simple_Naming_i.h"
+#include "orbsvcs/PSS/PSDL_Code_Gen.h"
+
+Naming_Context_i::Naming_Context_i (CORBA::ORB_ptr orb)
+ : code_gen_ (0),
+ orb_ (orb)
+{
+ // constructor
+ // An instance of TAO_PSDL_Code_Gen
+ ACE_NEW (this->code_gen_,
+ TAO_PSDL_Code_Gen (this->orb_.in ()));
+}
+
+Naming_Context_i::~Naming_Context_i ()
+{
+ delete this->code_gen_;
+}
+
+int
+Naming_Context_i::bind (const char *n,
+ const char *obj
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Save the binding to database.
+ int result =
+ this->code_gen_->set_name_obj_ref (n, obj ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return result;
+}
+
+char *
+Naming_Context_i::find (const char *n
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Get the Stringified object reference corresponding to
+ // 'n'
+ CORBA::String_var obj_ref =
+ this->code_gen_->get_obj_ref (n ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return CORBA::string_dup (obj_ref.in ());
+}
diff --git a/TAO/orbsvcs/examples/PSS/Simple_Naming_i.h b/TAO/orbsvcs/examples/PSS/Simple_Naming_i.h
new file mode 100644
index 00000000000..1306d245f9b
--- /dev/null
+++ b/TAO/orbsvcs/examples/PSS/Simple_Naming_i.h
@@ -0,0 +1,56 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/examples/PSS
+//
+// = FILENAME
+// simple_naming_i.h
+//
+// = DESCRIPTION
+// This class implements the bind and find methods in
+// simple_naming.idl which in turn use the PSDL implementation.
+//
+// = AUTHORS
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef SIMPLE_NAMING_I_H
+#define SIMPLE_NAMING_I_H
+#include /**/ "ace/pre.h"
+
+#include "Simple_NamingS.h"
+#include "Simple_NamingC.h"
+
+class TAO_PSDL_Code_Gen;
+
+class Naming_Context_i : public virtual POA_Simple_Naming::Naming_Context
+{
+ public:
+
+ Naming_Context_i (CORBA::ORB_ptr orb);
+
+ ~Naming_Context_i (void);
+
+ virtual int bind (const char *n,
+ const char *obj
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual char *find (const char *n
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ TAO_PSDL_Code_Gen *code_gen_;
+
+ CORBA::ORB_var orb_;
+};
+
+
+#include /**/ "ace/post.h"
+#endif /* SIMPLE_NAMING_I_H */
diff --git a/TAO/orbsvcs/examples/PSS/client.cpp b/TAO/orbsvcs/examples/PSS/client.cpp
new file mode 100644
index 00000000000..a634a736993
--- /dev/null
+++ b/TAO/orbsvcs/examples/PSS/client.cpp
@@ -0,0 +1,107 @@
+// $Id$
+
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs/examples/PSS
+//
+// = FILENAME
+// client.cpp
+//
+// = DESCRIPTION
+// This implements a simple CORBA client for the
+// Server.idl
+//
+// = AUTHOR
+// Priyanka Gontla <pgontla@ece.uci.edu>
+//
+//
+// ============================================================================
+
+#include "ServerC.h"
+#include "Simple_Naming_i.h"
+
+int main (int argc, char *argv [])
+{
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ 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;
+
+ // Get a reference to Simple_Naming
+ CORBA::Object_var simple_naming_object =
+ orb->resolve_initial_references ("Simple_Naming" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow down the reference
+ Simple_Naming::Naming_Context_var simple_naming =
+ Simple_Naming::Naming_Context::_narrow (simple_naming_object.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Simple_Naming::Name name = CORBA::string_dup ("Server");
+
+ CORBA::String_var ior_string =
+ simple_naming->find (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Connect to the server
+ CORBA::Object_var tmp =
+ orb->string_to_object(ior_string.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Simple_Server::Server_var server =
+ Simple_Server::Server::_narrow (tmp.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var status =
+ server->get_status (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ACE_OS::strcmp (status.in (), "active") != 0)
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "ERROR: The server didnt return the active status\n"));
+ return -1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Client raised an exception:\n");
+ ACE_CHECK_RETURN (-1);
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/PSS/naming_data.psdl b/TAO/orbsvcs/examples/PSS/naming_data.psdl
new file mode 100644
index 00000000000..65afe097ab5
--- /dev/null
+++ b/TAO/orbsvcs/examples/PSS/naming_data.psdl
@@ -0,0 +1,5 @@
+struct Data
+ {
+ string name;
+ string obj_ref;
+ };
diff --git a/TAO/orbsvcs/examples/PSS/oldmpc_pss b/TAO/orbsvcs/examples/PSS/oldmpc_pss
new file mode 100644
index 00000000000..c47c4b1992d
--- /dev/null
+++ b/TAO/orbsvcs/examples/PSS/oldmpc_pss
@@ -0,0 +1,44 @@
+project(*Simple_Naming) : orbsvcslib, portableserver, psdl {
+ source_files {
+ Simple_NamingC.cpp
+ Simple_NamingS.cpp
+ Simple_Naming_i.cpp
+ Simple_Naming.cpp
+ }
+ idl_files {
+ Simple_Naming.idl
+ }
+}
+
+project(*Server) : orbsvcsexe, portableserver, psdl {
+ after += *Simple_Naming
+ source_files {
+ ServerC.cpp
+ ServerS.cpp
+ Server_i.cpp
+ Simple_NamingS.cpp
+ Simple_NamingC.cpp
+ Simple_Naming_i.cpp
+ server.cpp
+ }
+ idl_files {
+ Server.idl
+ Simple_Naming.idl
+ }
+}
+
+project(*Client) : orbsvcsexe, psdl, portableserver {
+ after += *Server
+ source_files {
+ Simple_NamingS.cpp
+ Simple_NamingC.cpp
+ Simple_Naming_i.cpp
+ ServerC.cpp
+ client.cpp
+ }
+ idl_files {
+ Server.idl
+ Simple_Naming.idl
+ }
+}
+
diff --git a/TAO/orbsvcs/examples/PSS/server.cpp b/TAO/orbsvcs/examples/PSS/server.cpp
new file mode 100644
index 00000000000..0f305dfae1d
--- /dev/null
+++ b/TAO/orbsvcs/examples/PSS/server.cpp
@@ -0,0 +1,108 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/examples/PSS
+//
+// = FILENAME
+// server.cpp
+//
+// = DESCRIPTION
+// This class implements a simple CORBA server which uses the
+// simple_naming.idl to bind and find a object reference and uses
+// Persistent State Service to save the information persistently.
+// Serves like a mini naming service.
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+// ============================================================================
+
+#include "Simple_Naming_i.h"
+#include "Server_i.h"
+#include "ace/Get_Opt.h"
+
+ACE_RCSID (PSS, client, "$Id$")
+
+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;
+
+ // 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;
+
+ Server_i server_i;
+
+ Simple_Server::Server_var server = server_i._this ();
+
+ CORBA::String_var string_obj_ref =
+ orb->object_to_string (server.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get a reference to Simple_Naming
+ CORBA::Object_var simple_naming_object =
+ orb->resolve_initial_references ("Simple_Naming"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow down the reference
+ Simple_Naming::Naming_Context_var simple_naming =
+ Simple_Naming::Naming_Context::_narrow (simple_naming_object.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Simple_Naming::Name name = CORBA::string_dup ("Server");
+
+ // Bind the name to stringified objecte refernce
+ simple_naming->bind (CORBA::string_dup (name),
+ string_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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,
+ "Unexpected excpeption in PSS Test");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/Consumer.cpp b/TAO/orbsvcs/examples/RtEC/IIOPGateway/Consumer.cpp
new file mode 100644
index 00000000000..05b214aabbc
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/Consumer.cpp
@@ -0,0 +1,200 @@
+// $Id$
+
+#include "Consumer.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/CosNamingC.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/OS_NS_string.h"
+
+ACE_RCSID (EC_Examples,
+ Consumer,
+ "$Id$")
+
+const RtecEventComm::EventSourceID MY_SOURCE_ID = ACE_ES_EVENT_SOURCE_ANY + 1;
+const RtecEventComm::EventType MY_EVENT_TYPE = ACE_ES_EVENT_UNDEFINED + 1;
+
+static const char* ecname = 0;
+
+int
+main (int argc, char* argv[])
+{
+ Consumer consumer;
+
+ return consumer.run (argc, argv);
+}
+
+// ****************************************************************
+
+Consumer::Consumer (void)
+ : event_count_ (0)
+{
+}
+
+int
+Consumer::run (int argc, char* argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // First parse our command line options
+ if (this->parse_args(argc, argv) != 0)
+ {
+ return -1;
+ }
+
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Do *NOT* make a copy because we don't want the ORB to outlive
+ // the run() method.
+ this->orb_ = orb.in ();
+
+ 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;
+
+ // Obtain the event channel from the naming service
+ 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 (ecname);
+
+ CORBA::Object_var ec_obj =
+ naming_context->resolve (name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ RtecEventChannelAdmin::EventChannel::_narrow (ec_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (event_channel.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to get Event Channel.\n"),
+ 1);
+
+ // The canonical protocol to connect to the EC
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_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;
+
+ RtecEventComm::PushConsumer_var consumer =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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
+ for (int i = 0; i < 10; i++)
+ {
+ qos.insert (MY_SOURCE_ID + i, // Source ID
+ MY_EVENT_TYPE + i, // Event Type
+ 0); // handle to the rt_info
+ }
+ supplier->connect_push_consumer (consumer.in (), qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Wait for events, using work_pending()/perform_work() may help
+ // or using another thread, this example is too simple for that.
+ orb->run ();
+
+ // We don't do any cleanup, it is hard to do it after shutdown,
+ // and would complicate the example; plus it is almost
+ // impossible to do cleanup after ORB->run() because the POA is
+ // in the holding state. Applications should use
+ // work_pending()/perform_work() to do more interesting stuff.
+ // Check the supplier for the proper way to do cleanup.
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Consumer::run");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+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_ % 100 == 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)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // In this example we shutdown the ORB when we disconnect from the
+ // EC (or rather the EC disconnects from us), but this doesn't have
+ // to be the case....
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
+int
+Consumer::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, "-e") == 0)
+ {
+ arg_shifter.consume_arg ();
+ ecname = arg_shifter.get_current ();
+ }
+
+ arg_shifter.ignore_arg ();
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/Consumer.h b/TAO/orbsvcs/examples/RtEC/IIOPGateway/Consumer.h
new file mode 100644
index 00000000000..c8268e1c3ea
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/Consumer.h
@@ -0,0 +1,57 @@
+/* -*- C++ -*- */
+/**
+ * @file Consumer.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Consumer
+ */
+
+#ifndef CONSUMER_H
+#define CONSUMER_H
+
+#include "orbsvcs/RtecEventCommS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Consumer
+ *
+ * @brief Simple consumer object
+ *
+ * This class is a consumer of events. It simply registers for one event type.
+ */
+class Consumer : public POA_RtecEventComm::PushConsumer
+{
+public:
+ /// Constructor
+ Consumer (void);
+
+ /// Run the test
+ int run (int argc, char* argv[]);
+
+ // = 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:
+ int parse_args (int argc, char *argv[]);
+
+ /// Keep track of the number of events received.
+ CORBA::ULong event_count_;
+
+ /// The orb, just a pointer because the ORB does not outlive the
+ /// run() method...
+ CORBA::ORB_ptr orb_;
+};
+
+#endif /* CONSUMER_H */
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/EC.cpp b/TAO/orbsvcs/examples/RtEC/IIOPGateway/EC.cpp
new file mode 100644
index 00000000000..a25e9f67569
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/EC.cpp
@@ -0,0 +1,159 @@
+// $Id$
+
+#include "EC.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Event/EC_Gateway.h"
+#include "ace/Arg_Shifter.h"
+
+ACE_RCSID (EC_Examples,
+ Supplier,
+ "$Id$")
+
+static const char* ecname = 0;
+
+int
+main (int argc, char* argv[])
+{
+ EC channel;
+
+ return channel.run (argc, argv);
+}
+
+// ****************************************************************
+
+EC::EC (void)
+{
+}
+
+int
+EC::run (int argc, char* argv[])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // First parse our command line options
+ if (this->parse_args(argc, argv) != 0)
+ {
+ return -1;
+ }
+
+ // 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 rootpoa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var root_poa_manager =
+ rootpoa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create persistent POA
+ CORBA::PolicyList policies (2);
+ policies.length (2);
+
+ policies[0] =
+ rootpoa->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ policies[1] =
+ rootpoa->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_CString poaname = "POA";
+ PortableServer::POA_var child_poa_ =
+ rootpoa->create_POA (poaname.c_str (),
+ root_poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+
+ // Create a local event channel and register it with the RootPOA.
+ TAO_EC_Event_Channel_Attributes attributes (rootpoa.in (), rootpoa.in ());
+ attributes.consumer_reconnect = 1;
+ attributes.supplier_reconnect = 1;
+
+ TAO_EC_Event_Channel ec_impl (attributes);
+ ec_impl.activate ();
+
+ PortableServer::ObjectId_var ecId = PortableServer::string_to_ObjectId(ecname);
+
+ child_poa_->activate_object_with_id(ecId.in(), &ec_impl ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var ec_obj = child_poa_->id_to_reference(ecId.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow(ec_obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Find the Naming Service.
+ object = orb->resolve_initial_references("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::NamingContextExt_var naming_context =
+ CosNaming::NamingContextExt::_narrow(object.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create a name.
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup (ecname);
+ name[0].kind = CORBA::string_dup ("");
+
+ // Register with the name server
+ naming_context->rebind (name, ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ root_poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Wait for events, using work_pending()/perform_work() may help
+ // or using another thread, this example is too simple for that.
+ orb->run ();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "EC::run");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+EC::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, "-e") == 0)
+ {
+ arg_shifter.consume_arg ();
+ ecname = arg_shifter.get_current ();
+ }
+
+ arg_shifter.ignore_arg ();
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/EC.h b/TAO/orbsvcs/examples/RtEC/IIOPGateway/EC.h
new file mode 100644
index 00000000000..2734de1dcd0
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/EC.h
@@ -0,0 +1,39 @@
+/* -*- C++ -*- */
+/**
+ * @file EC.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Event channel
+ */
+
+#ifndef EC_H
+#define EC_H
+
+#include "orbsvcs/RtecEventCommS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class EC
+ *
+ * @brief Simple event channel
+ */
+class EC
+{
+public:
+ /// Constructor
+ EC (void);
+
+ /// Run the test
+ int run (int argc, char* argv[]);
+
+private:
+ int parse_args (int argc, char *argv[]);
+};
+
+#endif /* EC_H */
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/Gateway.cpp b/TAO/orbsvcs/examples/RtEC/IIOPGateway/Gateway.cpp
new file mode 100644
index 00000000000..c1be767ffd8
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/Gateway.cpp
@@ -0,0 +1,185 @@
+// $Id$
+
+#include "Gateway.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Event/EC_Gateway_IIOP.h"
+#include "orbsvcs/Event/EC_Gateway_IIOP_Factory.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/Dynamic_Service.h"
+
+ACE_RCSID (EC_Examples,
+ Supplier,
+ "$Id$")
+
+static const char* supplierec = 0;
+static const char* consumerec = 0;
+
+int
+main (int argc, char* argv[])
+{
+ Gateway gateway;
+
+ return gateway.run (argc, argv);
+}
+
+// ****************************************************************
+
+Gateway::Gateway (void)
+{
+}
+
+int
+Gateway::run (int argc, char* argv[])
+{
+ TAO_EC_Gateway_IIOP_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // First parse our command line options
+ if (this->parse_args(argc, argv) != 0)
+ {
+ return -1;
+ }
+
+ // 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;
+
+ // Obtain the event channel from the naming service
+ 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 supplierecname (1);
+ supplierecname.length (1);
+ supplierecname[0].id = CORBA::string_dup (supplierec);
+
+ CORBA::Object_var supplierec_obj =
+ naming_context->resolve (supplierecname ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name consumerecname (1);
+ consumerecname.length (1);
+ consumerecname[0].id = CORBA::string_dup (consumerec);
+
+ CORBA::Object_var consumerec_obj =
+ naming_context->resolve (consumerecname ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var supplier_event_channel =
+ RtecEventChannelAdmin::EventChannel::_narrow (supplierec_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (supplier_event_channel.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to get the supplier event channel.\n"),
+ 1);
+
+ RtecEventChannelAdmin::EventChannel_var consumer_event_channel =
+ RtecEventChannelAdmin::EventChannel::_narrow (consumerec_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (consumer_event_channel.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to get the consumer event channel.\n"),
+ 1);
+
+ TAO_EC_Gateway_IIOP gateway;
+
+ gateway.init(supplier_event_channel.in(), consumer_event_channel.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::ObjectId_var gateway_oid =
+ poa->activate_object(&gateway ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var gateway_obj =
+ poa->id_to_reference(gateway_oid.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::Observer_var obs =
+ RtecEventChannelAdmin::Observer::_narrow(gateway_obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::Observer_Handle local_ec_obs_handle =
+ consumer_event_channel->append_observer (obs.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Wait for events, using work_pending()/perform_work() may help
+ // or using another thread, this example is too simple for that.
+ orb->run ();
+
+ consumer_event_channel->remove_observer (local_ec_obs_handle
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa->deactivate_object (gateway_oid.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Destroy the POA
+ poa->destroy (1, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Gateway::run");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+Gateway::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, "-s") == 0)
+ {
+ arg_shifter.consume_arg ();
+ supplierec = arg_shifter.get_current ();
+ }
+ if (ACE_OS::strcmp (arg, "-c") == 0)
+ {
+ arg_shifter.consume_arg ();
+ consumerec = arg_shifter.get_current ();
+ }
+
+ arg_shifter.ignore_arg ();
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/Gateway.h b/TAO/orbsvcs/examples/RtEC/IIOPGateway/Gateway.h
new file mode 100644
index 00000000000..6c7d931d988
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/Gateway.h
@@ -0,0 +1,38 @@
+/* -*- C++ -*- */
+/**
+ * @file Gateway.h
+ *
+ * $Id$
+ *
+ * @author Johnny Willemsen (jwillemsen@remedy.nl)
+ *
+ * IIOP Gateway
+ */
+#ifndef GATEWAY_H
+#define GATEWAY_H
+
+#include "orbsvcs/RtecEventCommS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Gateway
+ *
+ * @brief Simple gateway
+ */
+class Gateway
+{
+public:
+ /// Constructor
+ Gateway (void);
+
+ /// Run the test
+ int run (int argc, char* argv[]);
+
+private:
+ int parse_args (int argc, char *argv[]);
+};
+
+#endif /* GATEWAY_H */
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/Makefile.am b/TAO/orbsvcs/examples/RtEC/IIOPGateway/Makefile.am
new file mode 100644
index 00000000000..73c1ace16cb
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/Makefile.am
@@ -0,0 +1,166 @@
+## 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.RtEC_IIOPGateway.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
+
+Gateway_SOURCES = \
+ Gateway.cpp \
+ Gateway.h
+
+Gateway_LDADD = \
+ $(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.RtEC_IIOPGateway_Consumer.am
+
+if BUILD_CORBA_MESSAGING
+
+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 = \
+ Consumer.cpp \
+ Consumer.h
+
+Consumer_LDADD = \
+ $(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.RtEC_IIOPGateway_EC.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += EC
+
+EC_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+EC_SOURCES = \
+ EC.cpp \
+ EC.h
+
+EC_LDADD = \
+ $(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.RtEC_IIOPGateway_Supplier.am
+
+if BUILD_CORBA_MESSAGING
+
+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 = \
+ Supplier.cpp \
+ Supplier.h
+
+Supplier_LDADD = \
+ $(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
+
+## 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/examples/RtEC/IIOPGateway/README b/TAO/orbsvcs/examples/RtEC/IIOPGateway/README
new file mode 100644
index 00000000000..501bc694e31
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/README
@@ -0,0 +1,19 @@
+# $Id$
+
+ This directory contains an example of the real-time event service
+and the IIOP Gateway. There are four executables, the consumer, supplier,
+the channel and the gateway.
+
+ The idea is that we have a supplier that pushes to event channel
+channel1, this channel1 pushes the events to the gateway, the gateway to
+channel2 and then channel2 to the real consumer.
+
+ Run using the run_test.pl script.
+
+ In the script consumerec_crash script channel2 and the consumer
+are killed and restarted after a few seconds. When the gateway uses the
+reconnect policy you will see that after the timeout in the gateway has
+expired the consumer receives events again.
+
+ More advanced tests are available in
+$TAO_ROOT/orbsvcs/tests/Event and $TAO_ROOT/orbsvcs/EC_*
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/RtEC_IIOPGateway.mpc b/TAO/orbsvcs/examples/RtEC/IIOPGateway/RtEC_IIOPGateway.mpc
new file mode 100644
index 00000000000..2ece2c2a38d
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/RtEC_IIOPGateway.mpc
@@ -0,0 +1,35 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Consumer): messaging, rteventexe, naming {
+ requires += corba_messaging
+
+ Source_Files {
+ Consumer.cpp
+ }
+}
+
+project(*Supplier): messaging, rteventexe, naming {
+ requires += corba_messaging
+
+ Source_Files {
+ Supplier.cpp
+ }
+}
+
+project(*): messaging, rteventexe, rtevent_serv, naming {
+ requires += corba_messaging
+
+ Source_Files {
+ Gateway.cpp
+ }
+}
+
+project(*EC): messaging, rteventexe, rtevent_serv, naming {
+ requires += corba_messaging
+
+ Source_Files {
+ EC.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/Supplier.cpp b/TAO/orbsvcs/examples/RtEC/IIOPGateway/Supplier.cpp
new file mode 100644
index 00000000000..aad09c037e8
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/Supplier.cpp
@@ -0,0 +1,195 @@
+// $Id$
+
+#include "Supplier.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/CosNamingC.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (EC_Examples,
+ Supplier,
+ "$Id$")
+
+const RtecEventComm::EventSourceID MY_SOURCE_ID = ACE_ES_EVENT_SOURCE_ANY + 1;
+const RtecEventComm::EventType MY_EVENT_TYPE = ACE_ES_EVENT_UNDEFINED + 1;
+
+static const char* ecname = 0;
+
+int
+main (int argc, char* argv[])
+{
+ Supplier supplier;
+
+ return supplier.run (argc, argv);
+}
+
+// ****************************************************************
+
+Supplier::Supplier (void)
+{
+}
+
+int
+Supplier::run (int argc, char* argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // First parse our command line options
+ if (this->parse_args(argc, argv) != 0)
+ {
+ return -1;
+ }
+
+ // 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;
+
+ // Obtain the event channel from the naming service
+ 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 (ecname);
+
+ CORBA::Object_var ec_obj =
+ naming_context->resolve (name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ RtecEventChannelAdmin::EventChannel::_narrow (ec_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The canonical protocol to connect to the EC
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventComm::PushSupplier_var supplier =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Publish the events the supplier provides.
+ ACE_SupplierQOS_Factory qos;
+ qos.insert (MY_SOURCE_ID, // Supplier's unique id
+ MY_EVENT_TYPE, // Event type
+ 0, // handle to the rt_info structure
+ 1); // number of calls
+
+ consumer->connect_push_supplier (supplier.in (), qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Push the events...
+ ACE_Time_Value sleep_time (0, 10000); // 10 milliseconds
+
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+ for (int j = 0; j < 1; j++)
+ {
+ event[j].header.source = MY_SOURCE_ID;
+ event[j].header.ttl = 1;
+ event[j].header.type = MY_EVENT_TYPE;
+ }
+
+ for (int i = 1; i != 4000; ++i)
+ {
+ if (i % 100 == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Supplier (%P|%t): %d events send\n",
+ i));
+ }
+ consumer->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_OS::sleep (sleep_time);
+ }
+
+ // Disconnect from the EC
+ consumer->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Destroy the EC....
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Deactivate this object...
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Destroy the POA
+ poa->destroy (1, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Supplier::run");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+int
+Supplier::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, "-e") == 0)
+ {
+ arg_shifter.consume_arg ();
+ ecname = arg_shifter.get_current ();
+ }
+
+ arg_shifter.ignore_arg ();
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/Supplier.h b/TAO/orbsvcs/examples/RtEC/IIOPGateway/Supplier.h
new file mode 100644
index 00000000000..98e87ec39d2
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/Supplier.h
@@ -0,0 +1,46 @@
+/* -*- C++ -*- */
+/**
+ * @file Supplier.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * IIOP Gateway
+ */
+#ifndef SUPPLIER_H
+#define SUPPLIER_H
+
+#include "orbsvcs/RtecEventCommS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Supplier
+ *
+ * @brief Simple supplier object
+ *
+ * This class is a supplier of events. It simply publishes one event type.
+ */
+class Supplier : public POA_RtecEventComm::PushSupplier
+{
+public:
+ /// Constructor
+ Supplier (void);
+
+ /// Run the test
+ int run (int argc, char* argv[]);
+
+ // = The RtecEventComm::PushSupplier methods
+
+ /// The skeleton methods.
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ int parse_args (int argc, char *argv[]);
+};
+
+#endif /* SUPPLIER_H */
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/consumerec_crash.pl b/TAO/orbsvcs/examples/RtEC/IIOPGateway/consumerec_crash.pl
new file mode 100755
index 00000000000..3267bd38a30
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/consumerec_crash.pl
@@ -0,0 +1,150 @@
+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 ("ns.ior");
+$conffile = PerlACE::LocalFile ("ec" . "$PerlACE::svcconf_ext");
+$gatewayconffile = PerlACE::LocalFile ("gateway" . "$PerlACE::svcconf_ext");
+
+unlink $ns_ior;
+
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-o $ns_ior");
+
+$T1 = new PerlACE::Process ("EC",
+ "-ORBInitRef NameService=file://$ns_ior "
+ . "-ORBsvcconf $conffile "
+# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile supplierec.log "
+ . "-e channel1 ");
+
+$T2 = new PerlACE::Process ("EC",
+ "-ORBInitRef NameService=file://$ns_ior -ORBEndpoint iiop://localhost:6000 "
+ . "-ORBsvcconf $conffile "
+# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile consumerec.log "
+ . "-e channel2 ");
+
+$G = new PerlACE::Process ("Gateway",
+ "-ORBInitRef NameService=file://$ns_ior "
+ . "-ORBSvcconf $gatewayconffile "
+ . "-c channel2 "
+# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile gateway.log "
+ . "-s channel1 ");
+
+$C = new PerlACE::Process ("Consumer",
+ "-ORBInitRef NameService=file://$ns_ior "
+# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile consumer.log "
+ . "-e channel2 ");
+
+$S = new PerlACE::Process ("Supplier",
+ "-ORBInitRef NameService=file://$ns_ior "
+# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile supplier.log "
+ . "-e channel1 ");
+
+print STDOUT "Starting name server\n";
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($ns_ior, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$ns_ior>\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDOUT "Starting event channel 1\n";
+$T1->Spawn ();
+
+sleep 2;
+
+print STDOUT "Starting event channel 2\n";
+$T2->Spawn ();
+
+sleep 2;
+
+print STDOUT "Starting gateway\n";
+$G->Spawn ();
+
+sleep 2;
+
+print STDOUT "Starting consumer\n";
+$C->Spawn ();
+
+sleep 1;
+
+print STDOUT "Starting supplier\n";
+#$supplier = $S->SpawnWaitKill (12000);
+$S->Spawn();
+
+sleep 1;
+
+if ($supplier != 0) {
+ print STDERR "ERROR: supplier returned $supplier\n";
+ $status = 1;
+}
+
+#$consumer = $C->WaitKill (10);
+#
+#if ($consumer != 0) {
+# print STDERR "ERROR: consumer returned $consumer\n";
+# $status = 1;
+#}
+
+print STDOUT "Terminating event channel 2 and consumer in 10 seconds...\n";
+#$service = $T2->TerminateWaitKill (5);
+$service = $T2->WaitKill (10);
+$C->Kill();
+
+if ($service != 0) {
+ print STDERR "ERROR: service returned $service\n";
+ $status = 1;
+}
+
+sleep 10;
+
+print STDOUT "Starting event channel 2 again...\n";
+$T2->Spawn ();
+
+sleep 2;
+
+print STDOUT "Starting consumer again...\n";
+$C->Spawn ();
+
+#$supplier = $C->WaitKill (15);
+#
+#if ($supplier != 0) {
+# print STDERR "ERROR: supplier returned $supplier\n";
+# $status = 1;
+#}
+
+print STDOUT "1500 seconds before termination...\n";
+sleep 1500;
+
+print STDOUT "Terminating supplier...\n";
+$S->TerminateWaitKill (5);
+
+print STDOUT "Terminating consumer...\n";
+$C->TerminateWaitKill (5);
+
+print STDOUT "Terminating gateway...\n";
+$G->TerminateWaitKill (5);
+
+print STDOUT "Terminating event channels...\n";
+$T1->TerminateWaitKill (5);
+$T2->TerminateWaitKill (5);
+
+$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/examples/RtEC/IIOPGateway/ec.conf b/TAO/orbsvcs/examples/RtEC/IIOPGateway/ec.conf
new file mode 100644
index 00000000000..73633a3f946
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/ec.conf
@@ -0,0 +1,4 @@
+# $Id$
+#static EC_Factory "-ECobserver basic -ECDispatching reactive -ECFiltering basic -ECSupplierFiltering per-supplier -ECProxyConsumerLock thread -ECProxySupplierLock thread -ECConsumerControl reactive -ECSupplierControl reactive -ECConsumerControlPeriod 50000 -ECSupplierControlPeriod 50000"
+static EC_Factory "-ECobserver basic "
+#static EC_Gateway_IIOP "-ECGIIOPConsumerECControl reactive"
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/ec.conf.xml b/TAO/orbsvcs/examples/RtEC/IIOPGateway/ec.conf.xml
new file mode 100644
index 00000000000..8c526f5a8cb
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/ec.conf.xml
@@ -0,0 +1,5 @@
+<?xml version='1.0'?>
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="static EC_Factory "-ECobserver basic ""/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/gateway.conf b/TAO/orbsvcs/examples/RtEC/IIOPGateway/gateway.conf
new file mode 100644
index 00000000000..8319c781e4e
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/gateway.conf
@@ -0,0 +1,6 @@
+# $Id$
+#static EC_Factory "-ECobserver basic -ECDispatching reactive -ECFiltering basic -ECSupplierFiltering per-supplier -ECProxyConsumerLock thread -ECProxySupplierLock thread -ECConsumerControl reactive -ECSupplierControl reactive -ECConsumerControlPeriod 50000 -ECSupplierControlPeriod 50000"
+#static EC_Factory "-ECobserver basic "
+#dynamic Logger Service_Object * ACE:_make_ACE_Logging_Strategy() "-f STDERR|VERBOSE_LITE"
+static EC_Gateway_IIOP_Factory "-ECGIIOPConsumerECControl reconnect -ECGIIOPConsumerECControlPeriod 1000000 -ECGIIOPConsumerECControlTimeout 500000 -ECGIIOPUseConsumerProxyMap 0"
+#static EC_Gateway_IIOP_Factory "-ECGIIOPConsumerECControl reactive -ECGIIOPConsumerECControlPeriod 100000 -ECGIIOPConsumerECControlTimeout 50000"
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/gateway.conf.xml b/TAO/orbsvcs/examples/RtEC/IIOPGateway/gateway.conf.xml
new file mode 100644
index 00000000000..39ef790c9d7
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/gateway.conf.xml
@@ -0,0 +1,5 @@
+<?xml version='1.0'?>
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="static EC_Gateway_IIOP_Factory "-ECGIIOPConsumerECControl reconnect -ECGIIOPConsumerECControlPeriod 1000000 -ECGIIOPConsumerECControlTimeout 500000 -ECGIIOPUseConsumerProxyMap 0"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/run_test.pl b/TAO/orbsvcs/examples/RtEC/IIOPGateway/run_test.pl
new file mode 100755
index 00000000000..ba1896e9eb6
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/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;
+
+$status = 0;
+
+$ns_ior = PerlACE::LocalFile ("ns.ior");
+$conffile = PerlACE::LocalFile ("ec" . "$PerlACE::svcconf_ext");
+$gatewayconffile = PerlACE::LocalFile ("gateway" . "$PerlACE::svcconf_ext");
+
+unlink $ns_ior;
+
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-o $ns_ior ");
+
+$T1 = new PerlACE::Process ("EC",
+ "-ORBInitRef NameService=file://$ns_ior "
+# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile supplierec.log "
+ . "-ORBsvcconf $conffile "
+ . "-e channel1 ");
+
+$T2 = new PerlACE::Process ("EC",
+ "-ORBInitRef NameService=file://$ns_ior "
+# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile consumerec.log "
+ . "-ORBsvcconf $conffile "
+ . "-e channel2 ");
+
+$G = new PerlACE::Process ("Gateway",
+ "-ORBInitRef NameService=file://$ns_ior "
+# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile gateway.log "
+ . "-ORBSvcconf $gatewayconffile "
+ . "-c channel2 "
+ . "-s channel1 ");
+
+$C = new PerlACE::Process ("Consumer",
+ "-ORBInitRef NameService=file://$ns_ior "
+# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile consumer.log "
+ . "-e channel2 ");
+
+$S = new PerlACE::Process ("Supplier",
+ "-ORBInitRef NameService=file://$ns_ior "
+# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile supplier.log "
+ . "-e channel1 ");
+
+print STDOUT "Starting name server\n";
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($ns_ior, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$ns_ior>\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDOUT "Starting event channel 1\n";
+$T1->Spawn ();
+
+sleep 2;
+
+print STDOUT "Starting event channel 2\n";
+$T2->Spawn ();
+
+sleep 2;
+
+print STDOUT "Starting gateway\n";
+$G->Spawn ();
+
+sleep 2;
+
+print STDOUT "Starting consumer\n";
+$C->Spawn ();
+
+sleep 1;
+
+print STDOUT "Starting supplier\n";
+#$supplier = $S->SpawnWaitKill (12000);
+$S->Spawn();
+
+sleep 1;
+
+if ($supplier != 0) {
+ print STDERR "ERROR: supplier returned $supplier\n";
+ $status = 1;
+}
+
+$consumer = $C->WaitKill (10);
+
+if ($consumer != 0) {
+ print STDERR "ERROR: consumer returned $consumer\n";
+ $status = 1;
+}
+
+$service = $T2->TerminateWaitKill (5);
+
+if ($service != 0) {
+ print STDERR "ERROR: service returned $service\n";
+ $status = 1;
+}
+
+#$supplier = $C->WaitKill (15);
+#
+#if ($supplier != 0) {
+# print STDERR "ERROR: supplier returned $supplier\n";
+# $status = 1;
+#}
+
+print STDOUT "15 seconds before termination...\n";
+sleep 15;
+
+$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/examples/RtEC/Kokyu/Consumer.cpp b/TAO/orbsvcs/examples/RtEC/Kokyu/Consumer.cpp
new file mode 100644
index 00000000000..4f23249c145
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Kokyu/Consumer.cpp
@@ -0,0 +1,32 @@
+// $Id$
+
+#include "Consumer.h"
+
+ACE_RCSID(EC_Examples, Consumer, "$Id$")
+
+Consumer::Consumer (void)
+{
+}
+
+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;
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "Consumer (%P|%t) we received event type %d\n",
+ events[0].header.type));
+}
+
+void
+Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
diff --git a/TAO/orbsvcs/examples/RtEC/Kokyu/Consumer.h b/TAO/orbsvcs/examples/RtEC/Kokyu/Consumer.h
new file mode 100644
index 00000000000..bdbdbaad894
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Kokyu/Consumer.h
@@ -0,0 +1,55 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Real-time Event Channel examples
+//
+// = FILENAME
+// Consumer
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef CONSUMER_H
+#define CONSUMER_H
+
+#include "orbsvcs/RtecEventCommS.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 register for two event typesone event type
+ // 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.
+ //
+public:
+ Consumer (void);
+ // Constructor
+
+ // = 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.
+};
+
+#endif /* CONSUMER_H */
diff --git a/TAO/orbsvcs/examples/RtEC/Kokyu/Makefile.am b/TAO/orbsvcs/examples/RtEC/Kokyu/Makefile.am
new file mode 100644
index 00000000000..f2e00e44bc0
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Kokyu/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.RtECKokyu.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS = Service
+
+Service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(ACE_ROOT)/Kokyu
+
+Service_SOURCES = \
+ Consumer.cpp \
+ Service.cpp \
+ Supplier.cpp \
+ Consumer.h \
+ Supplier.h
+
+Service_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTKokyuEvent.la \
+ $(ACE_BUILDDIR)/Kokyu/libKokyu.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTSched.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.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/examples/RtEC/Kokyu/README b/TAO/orbsvcs/examples/RtEC/Kokyu/README
new file mode 100644
index 00000000000..f7a98f7acc7
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Kokyu/README
@@ -0,0 +1,66 @@
+# $Id$
+
+Shows how to use the scheduling service in conjunction with
+the real-time event channel. The test also uses the Kokyu
+dispatching module within the RTEC, which provides the
+dispatching queues for the isolation of events based on
+their preemption priority generated by the scheduler. The
+test has two consumers and two suppliers. The test also
+demonstrates how to use timers in the EC to trigger timeout
+events for timeout consumers which inturn act as suppliers
+to other consumers. The following shows the test setup.
+
+
+LO_CRIT |-----|
+1Hz EC Timer1 ----> TimerConsumer1 ---> Supplier1 --->| |---> Consumer1
+ | EC |
+ | |
+1/3Hz EC Timer2 ----> TimerConsumer2 ---> Supplier2 --->| |---> Consumer2
+HI_CRIT |-----|
+
+The event-channel cooperates with the scheduling service to
+compute a schedule and assign priorities to each event. The event
+channel will use different queues for those events, each queue
+serviced by threads at different priorities. In the above
+test case, there will be two dispatching queues, one for each
+flow. The 1Hz flow will have higher priority than the 1/3Hz flow
+wirh plain RMS scheduling. With MUF scheduling, the HI_CRIT
+flow will have higher priority than the LO_CRIT flow.
+
+The example can be run as follows:
+
+$ ./Service -s<rms|muf>
+
+Please make sure you run the example with root privileges.
+
+Expected output for RMS
+-----------------------
+You should see the 1Hz events dispatched by a higher priority
+thread than the 1/3Hz events. Sample output is shown below. Here
+2051 is the thread id of the thread dispatching 1/3Hz events
+and 1026 is the thread id of the thread dispatching 1Hz events.
+The latter runs at a higher real-time thread priority than the
+former under RMS scheduling strategy.
+
+Consumer (27703|2051) we received event type 17
+Consumer (27703|1026) we received event type 16
+Consumer (27703|1026) we received event type 16
+Consumer (27703|1026) we received event type 16
+Consumer (27703|2051) we received event type 17
+
+Expected output for MUF
+-----------------------
+You should see the 1/3Hz events dispatched by a higher priority
+thread than the 1Hz events since the former is more critical
+than the latter. Sample output is shown below. Here
+2051 is the thread id of the thread dispatching 1Hz events
+and 1026 is the thread id of the thread dispatching 1/3Hz events.
+The latter runs at a higher real-time thread priority than the
+former under MUF scheduling strategy.
+
+Consumer (28191|2051) we received event type 16
+Consumer (28191|2051) we received event type 16
+Consumer (28191|2051) we received event type 16
+Consumer (28191|1026) we received event type 17
+Consumer (28191|2051) we received event type 16
+
diff --git a/TAO/orbsvcs/examples/RtEC/Kokyu/RtECKokyu.mpc b/TAO/orbsvcs/examples/RtEC/Kokyu/RtECKokyu.mpc
new file mode 100644
index 00000000000..88d36ead38f
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Kokyu/RtECKokyu.mpc
@@ -0,0 +1,3 @@
+// $Id$
+project: orbsvcsexe, rtkokyuevent, rtevent_serv {
+}
diff --git a/TAO/orbsvcs/examples/RtEC/Kokyu/Service.cpp b/TAO/orbsvcs/examples/RtEC/Kokyu/Service.cpp
new file mode 100644
index 00000000000..3a01a04e9c0
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Kokyu/Service.cpp
@@ -0,0 +1,522 @@
+// $Id$
+
+#include "orbsvcs/Sched/Reconfig_Scheduler.h"
+#include "orbsvcs/Runtime_Scheduler.h"
+//#include "orbsvcs/Event/Module_Factory.h"
+//#include "orbsvcs/Event/Event_Channel.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Scheduler_Factory.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "orbsvcs/Event/EC_Kokyu_Factory.h"
+#include "Consumer.h"
+#include "Supplier.h"
+
+
+#include "ace/Get_Opt.h"
+#include "ace/Sched_Params.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/SString.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/Thread.h"
+
+ACE_RCSID(EC_Examples, Service, "$Id$")
+
+namespace
+{
+ int config_run = 0;
+ ACE_CString sched_type ="rms";
+}
+
+inline RtecScheduler::Period_t time_val_to_period (const ACE_Time_Value &tv)
+{
+ //100s of nanoseconds
+ return (tv.sec () * 1000000 + tv.usec ())*10;
+}
+
+int parse_args (int argc, char *argv[]);
+
+typedef TAO_Reconfig_Scheduler<TAO_RMS_FAIR_Reconfig_Sched_Strategy, TAO_SYNCH_MUTEX> RECONFIG_RMS_SCHED_TYPE;
+
+typedef TAO_Reconfig_Scheduler<TAO_MUF_FAIR_Reconfig_Sched_Strategy, TAO_SYNCH_MUTEX> RECONFIG_MUF_SCHED_TYPE;
+
+int
+main (int argc, char* argv[])
+{
+ //TAO_EC_Default_Factory::init_svcs ();
+
+ TAO_EC_Kokyu_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;
+
+ if (parse_args (argc, argv) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Usage: Service [-o IOR_file_name]\n"));
+ return 1;
+ }
+
+ 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;
+
+ // ****************************************************************
+
+ // Create an scheduling service
+ POA_RtecScheduler::Scheduler* sched_impl = 0;
+
+ if (ACE_OS::strcasecmp(sched_type.c_str(), "rms") == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Creating RMS scheduler\n"));
+ ACE_NEW_RETURN (sched_impl,
+ RECONFIG_RMS_SCHED_TYPE,
+ 1);
+ }
+ else if (ACE_OS::strcasecmp(sched_type.c_str(), "muf") == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Creating MUF scheduler\n"));
+ ACE_NEW_RETURN (sched_impl,
+ RECONFIG_MUF_SCHED_TYPE,
+ 1);
+ }
+
+ RtecScheduler::Scheduler_var scheduler =
+ sched_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+ TAO_EC_Event_Channel_Attributes attributes (poa.in (),
+ poa.in ());
+ attributes.scheduler = scheduler.in (); // no need to dup
+
+ TAO_EC_Event_Channel ec_impl (attributes);
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ // ****************************************************************
+
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+ Consumer consumer_impl1, consumer_impl2;
+
+ RtecScheduler::handle_t consumer1_rt_info =
+ scheduler->create ("consumer1" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecScheduler::handle_t consumer2_rt_info =
+ scheduler->create ("consumer2" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //consumer's rate will get propagated from the supplier.
+ //so no need to specify a period here. Specifying
+ //criticality is crucial since it propagates from
+ //consumer to supplier.
+ ACE_Time_Value tv (0,0);
+ TimeBase::TimeT tmp;
+ ORBSVCS_Time::Time_Value_to_TimeT (tmp, tv);
+ scheduler->set (consumer1_rt_info,
+ RtecScheduler::VERY_LOW_CRITICALITY,
+ tmp, tmp, tmp,
+ time_val_to_period (tv),
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ tmp,
+ 0,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ scheduler->set (consumer2_rt_info,
+ RtecScheduler::VERY_HIGH_CRITICALITY,
+ tmp, tmp, tmp,
+ time_val_to_period (tv),
+ RtecScheduler::VERY_HIGH_IMPORTANCE,
+ tmp,
+ 0,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ConsumerQOS_Factory consumer_qos1, consumer_qos2;
+ //consumer_qos.start_disjunction_group ();
+ // The types int the range [0,ACE_ES_EVENT_UNDEFINED) are
+ // reserved for the EC...
+ consumer_qos1.insert_type (ACE_ES_EVENT_UNDEFINED,
+ consumer1_rt_info);
+
+ RtecEventChannelAdmin::ConsumerQOS qos =
+ consumer_qos1.get_ConsumerQOS ();
+/*
+ for (int i=0;i<qos.dependencies.length (); ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "consumer_qos1[%d] event.header.type = %d, "
+ "consumer_qos1[%d] rt_info = %d, "
+ "consumer_qos1[%d] event.header.source = %d\n",
+ i,qos.dependencies[i].event.header.type,
+ i,qos.dependencies[i].rt_info,
+ i,qos.dependencies[i].event.header.source));
+ }
+*/
+
+ consumer_qos2.insert_type (ACE_ES_EVENT_UNDEFINED + 1,
+ consumer2_rt_info);
+
+ // The canonical protocol to connect to the EC
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy1 =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy2 =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventComm::PushConsumer_var consumer1 =
+ consumer_impl1._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventComm::PushConsumer_var consumer2 =
+ consumer_impl2._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connecting consumers\n"));
+ ACE_DEBUG ((LM_DEBUG, "connecting consumer1\n"));
+ supplier_proxy1->connect_push_consumer (consumer1.in (),
+ consumer_qos1.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connecting consumer2\n"));
+ supplier_proxy2->connect_push_consumer (consumer2.in (),
+ consumer_qos2.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "consumers connected\n"));
+
+ // ****************************************************************
+
+ RtecScheduler::handle_t supplier1_rt_info =
+ scheduler->create ("supplier1" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecScheduler::handle_t supplier2_rt_info =
+ scheduler->create ("supplier2" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventComm::EventSourceID supplier_id1 = 1, supplier_id2 = 2;
+ ACE_SupplierQOS_Factory supplier_qos1, supplier_qos2;
+ supplier_qos1.insert (supplier_id1,
+ ACE_ES_EVENT_UNDEFINED,
+ supplier1_rt_info,
+ 1 /* number of calls, but what does that mean? */);
+ supplier_qos2.insert (supplier_id2,
+ ACE_ES_EVENT_UNDEFINED + 1,
+ supplier2_rt_info,
+ 1 /* number of calls, but what does that mean? */);
+
+ // The canonical protocol to connect to the EC
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer_proxy1 =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer_proxy2 =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Supplier supplier_impl1(supplier_id1, consumer_proxy1.in ());
+ Supplier supplier_impl2(supplier_id2, consumer_proxy2.in ());
+
+ RtecEventComm::PushSupplier_var supplier1 =
+ supplier_impl1._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventComm::PushSupplier_var supplier2 =
+ supplier_impl2._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connecting suppliers\n"));
+ ACE_DEBUG ((LM_DEBUG, "connecting supplier1\n"));
+ consumer_proxy1->connect_push_supplier (supplier1.in (),
+ supplier_qos1.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connecting supplier2\n"));
+ consumer_proxy2->connect_push_supplier (supplier2.in (),
+ supplier_qos2.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "suppliers connected\n"));
+
+ // ****************************************************************
+
+ //Timer Registration part
+
+ //Timeout consumers for the two suppliers.
+ Timeout_Consumer timeout_consumer_impl1(&supplier_impl1);
+ Timeout_Consumer timeout_consumer_impl2(&supplier_impl2);
+
+ RtecScheduler::handle_t supplier1_timeout_consumer_rt_info =
+ scheduler->create ("supplier1_timeout_consumer" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //Period = 1sec
+ tv.set (1,0);
+ ORBSVCS_Time::Time_Value_to_TimeT (tmp, tv);
+
+ scheduler->set (supplier1_timeout_consumer_rt_info,
+ RtecScheduler::VERY_LOW_CRITICALITY,
+ tmp, tmp, tmp,
+ time_val_to_period (tv),
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ tmp,
+ 0,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecScheduler::handle_t supplier2_timeout_consumer_rt_info =
+ scheduler->create ("supplier2_timeout_consumer" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //Period = 3sec
+ tv.set (3, 0);
+ ORBSVCS_Time::Time_Value_to_TimeT (tmp, tv);
+
+ scheduler->set (supplier2_timeout_consumer_rt_info,
+ RtecScheduler::VERY_HIGH_CRITICALITY,
+ tmp, tmp, tmp,
+ time_val_to_period (tv),
+ RtecScheduler::VERY_HIGH_IMPORTANCE,
+ tmp,
+ 0,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ConsumerQOS_Factory timer_qos1, timer_qos2;
+ timer_qos1.insert_time (ACE_ES_EVENT_INTERVAL_TIMEOUT,
+ 10000000, //in 100s of nanosec
+ supplier1_timeout_consumer_rt_info);
+ timer_qos2.insert_time (ACE_ES_EVENT_INTERVAL_TIMEOUT,
+ 30000000, //in 100s of nanosec
+ supplier2_timeout_consumer_rt_info);
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var timeout_supplier_proxy1 =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var timeout_supplier_proxy2 =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventComm::PushConsumer_var safe_timeout_consumer1 =
+ timeout_consumer_impl1._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventComm::PushConsumer_var safe_timeout_consumer2 =
+ timeout_consumer_impl2._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connecting timeout consumers\n"));
+ timeout_supplier_proxy1->
+ connect_push_consumer (safe_timeout_consumer1.in (),
+ timer_qos1.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ timeout_supplier_proxy2->
+ connect_push_consumer (safe_timeout_consumer2.in (),
+ timer_qos2.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "timeout consumers connected\n"));
+
+ // ****************************************************************
+ //Registering dependency between timeout consumers and our suppliers
+ //with the scheduler
+
+ scheduler->add_dependency (supplier1_timeout_consumer_rt_info,
+ supplier1_rt_info,
+ 1,
+ RtecBase::TWO_WAY_CALL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ scheduler->add_dependency (supplier2_timeout_consumer_rt_info,
+ supplier2_rt_info,
+ 1,
+ RtecBase::TWO_WAY_CALL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ // At this point the consumer and supplier are connected to the
+ // EC, they have provided their QoS info to the Scheduling
+ // Service and the EC has informed the Scheduler about the
+ // dependencies between them.
+ // We can now compute the schedule for this configuration...
+
+ // The schedule is returned in this variables....
+
+ ACE_DEBUG ((LM_DEBUG, "Computing schedule\n"));
+ RtecScheduler::RT_Info_Set_var infos;
+ RtecScheduler::Config_Info_Set_var configs;
+ RtecScheduler::Dependency_Set_var dependencies;
+ RtecScheduler::Scheduling_Anomaly_Set unsafe_anomalies;
+ RtecScheduler::Scheduling_Anomaly_Set_var anomalies;
+
+ scheduler->get_rt_info_set (infos.out() );
+ scheduler->get_dependency_set (dependencies.out() );
+ scheduler->get_config_info_set (configs.out() );
+
+ ACE_DEBUG ((LM_DEBUG, "Printing intermediate results\n"));
+ ACE_Scheduler_Factory::dump_schedule (infos.in (),
+ dependencies.in (),
+ configs.in (),
+ unsafe_anomalies,
+ "schedule.out");
+
+ // Obtain the range of valid priorities in the current
+ // platform, the scheduler hard-code this values in the
+ // generated file, but in the future we may just use the
+ // "logical" priorities and define the mapping to OS
+ // priorities at run-time.
+ int min_os_priority =
+ ACE_Sched_Params::priority_min (ACE_SCHED_FIFO,
+ ACE_SCOPE_THREAD);
+ int max_os_priority =
+ ACE_Sched_Params::priority_max (ACE_SCHED_FIFO,
+ ACE_SCOPE_THREAD);
+ scheduler->compute_scheduling (min_os_priority,
+ max_os_priority,
+ infos.out (),
+ dependencies.out (),
+ configs.out (),
+ anomalies.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Dump the schedule to a file..
+ ACE_Scheduler_Factory::dump_schedule (infos.in (),
+ dependencies.in (),
+ configs.in (),
+ anomalies.in (),
+ "schedule.out");
+
+ // ****************************************************************
+ ACE_DEBUG ((LM_DEBUG, "Pushing events\n"));
+
+ ACE_hthread_t thr_handle;
+ ACE_Thread::self (thr_handle);
+
+ int prio = ACE_Sched_Params::priority_max (ACE_SCHED_FIFO);
+ ACE_OS::thr_setprio (thr_handle, prio);
+
+// // Generate a few events....
+// RtecEventComm::EventSet event1 (1);
+// event1.length (1);
+// event1[0].header.type = ACE_ES_EVENT_UNDEFINED;
+// event1[0].header.source = supplier_id1;
+// event1[0].header.ttl = 1;
+
+// RtecEventComm::EventSet event2 (1);
+// event2.length (1);
+// event2[0].header.type = ACE_ES_EVENT_UNDEFINED + 1;
+// event2[0].header.source = supplier_id2;
+// event2[0].header.ttl = 1;
+
+// for (int i = 0; i != 200; ++i)
+// {
+// if (i % 2 == 0)
+// {
+// consumer_proxy1->push (event1 ACE_ENV_ARG_PARAMETER);
+// ACE_TRY_CHECK;
+// }
+// else
+// {
+// consumer_proxy2->push (event2 ACE_ENV_ARG_PARAMETER);
+// ACE_TRY_CHECK;
+// }
+
+// ACE_Time_Value rate (0, 10000);
+// ACE_OS::sleep (rate);
+// }
+
+ ACE_DEBUG ((LM_DEBUG, "(%t) activating EC\n"));
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "EC activated\n"));
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ // ****************************************************************
+
+ // We should do a lot of cleanup (disconnect from the EC,
+ // deactivate all the objects with the POA, etc.) but this is
+ // just a simple demo so we are going to be lazy.
+
+ }
+ 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, "cs:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 's':
+ sched_type = ACE_TEXT_ALWAYS_CHAR(get_opts.opt_arg ());
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s %s"
+ "\n",
+ argv [0],
+ "-s <rms|muf>"),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/examples/RtEC/Kokyu/Supplier.cpp b/TAO/orbsvcs/examples/RtEC/Kokyu/Supplier.cpp
new file mode 100644
index 00000000000..11b8f70666b
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Kokyu/Supplier.cpp
@@ -0,0 +1,71 @@
+// $Id$
+
+#include "Supplier.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/RtecEventCommC.h"
+
+ACE_RCSID(EC_Examples, Supplier, "$Id$")
+
+Supplier::Supplier (RtecEventComm::EventSourceID id,
+ const RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer_proxy)
+:id_ (id),
+ consumer_proxy_ (consumer_proxy)
+{
+}
+
+void
+Supplier::timeout_occured (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RtecEventComm::EventSet event (1);
+ if (id_ == 1)
+ {
+ event.length (1);
+ event[0].header.type = ACE_ES_EVENT_UNDEFINED;
+ event[0].header.source = id_;
+ event[0].header.ttl = 1;
+ }
+ else
+ {
+ event.length (1);
+ event[0].header.type = ACE_ES_EVENT_UNDEFINED + 1;
+ event[0].header.source = id_;
+ event[0].header.ttl = 1;
+ }
+
+ consumer_proxy_->push (event ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+Timeout_Consumer::Timeout_Consumer (Supplier* supplier)
+ :supplier_impl_ (supplier)
+{
+}
+
+void
+Timeout_Consumer::push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (events.length () == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TimeoutConsumer (%t) no events\n"));
+ return;
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "(%t) Timeout Event received\n"));
+ supplier_impl_->timeout_occured (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+Timeout_Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
diff --git a/TAO/orbsvcs/examples/RtEC/Kokyu/Supplier.h b/TAO/orbsvcs/examples/RtEC/Kokyu/Supplier.h
new file mode 100644
index 00000000000..977586a3ec0
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Kokyu/Supplier.h
@@ -0,0 +1,87 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Real-time Event Channel examples
+//
+// = FILENAME
+// Supplier
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef SUPPLIER_H
+#define SUPPLIER_H
+
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/Event/EC_Event_Channel.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 register for two event typesone event type
+ // 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.
+ //
+public:
+ Supplier (RtecEventComm::EventSourceID id,
+ const RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer_proxy);
+ // Constructor
+
+ // = The RtecEventComm::PushSupplier methods
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The skeleton methods.
+
+ void timeout_occured (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ RtecEventComm::EventSourceID id_;
+ const RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer_proxy_;
+};
+
+class Timeout_Consumer : public POA_RtecEventComm::PushConsumer
+{
+ // = TITLE
+ // Timer consumer object
+ //
+ // = DESCRIPTION
+ // This class is a consumer of timeout events from EC.
+ // It registers for timeout event with EC and calls
+ // the
+ //
+public:
+ Timeout_Consumer (Supplier * supplier_impl);
+ // Constructor
+
+ // = 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:
+ Supplier *supplier_impl_;
+};
+
+#endif /* SUPPLIER_H */
diff --git a/TAO/orbsvcs/examples/RtEC/Kokyu/svc.conf b/TAO/orbsvcs/examples/RtEC/Kokyu/svc.conf
new file mode 100644
index 00000000000..60b006dd1ef
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Kokyu/svc.conf
@@ -0,0 +1,3 @@
+# $Id$
+#change SCHED_OTHER to SCHED_FIFO or SCHED_RR to run in Real time class
+static EC_Factory "-ECProxyPushConsumerCollection mt:immediate:list -ECProxyPushSupplierCollection mt:immediate:list -ECdispatching kokyu SCHED_OTHER -ECscheduling kokyu -ECfiltering kokyu -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"
diff --git a/TAO/orbsvcs/examples/RtEC/Kokyu/svc.conf.xml b/TAO/orbsvcs/examples/RtEC/Kokyu/svc.conf.xml
new file mode 100644
index 00000000000..41409e40ec9
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Kokyu/svc.conf.xml
@@ -0,0 +1,7 @@
+<?xml version='1.0'?>
+<!-- Converted from svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <!-- change SCHED_OTHER to SCHED_FIFO or SCHED_RR to run in Real time class -->
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection mt:immediate:list -ECProxyPushSupplierCollection mt:immediate:list -ECdispatching kokyu SCHED_OTHER -ECscheduling kokyu -ECfiltering kokyu -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/examples/RtEC/MCast/AddrServer.cpp b/TAO/orbsvcs/examples/RtEC/MCast/AddrServer.cpp
new file mode 100644
index 00000000000..05fd4d9c983
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/MCast/AddrServer.cpp
@@ -0,0 +1,19 @@
+// $Id$
+
+#include "AddrServer.h"
+
+ACE_RCSID(EC_Examples, 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/examples/RtEC/MCast/AddrServer.h b/TAO/orbsvcs/examples/RtEC/MCast/AddrServer.h
new file mode 100644
index 00000000000..8439914f22b
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/MCast/AddrServer.h
@@ -0,0 +1,53 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Real-time Event Channel examples
+//
+// = FILENAME
+// Consumer
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#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/examples/RtEC/MCast/Consumer.cpp b/TAO/orbsvcs/examples/RtEC/MCast/Consumer.cpp
new file mode 100644
index 00000000000..b85abca57ee
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/MCast/Consumer.cpp
@@ -0,0 +1,104 @@
+// $Id$
+
+#include "Consumer.h"
+#include "orbsvcs/RtecEventChannelAdminS.h"
+#include "orbsvcs/Event_Service_Constants.h"
+
+ACE_RCSID (EC_Examples,
+ 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_ % 100 == 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/examples/RtEC/MCast/Consumer.h b/TAO/orbsvcs/examples/RtEC/MCast/Consumer.h
new file mode 100644
index 00000000000..536404b824b
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/MCast/Consumer.h
@@ -0,0 +1,64 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Real-time Event Channel examples
+//
+// = FILENAME
+// Consumer
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#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/examples/RtEC/MCast/MCast.cpp b/TAO/orbsvcs/examples/RtEC/MCast/MCast.cpp
new file mode 100644
index 00000000000..f61cb958eeb
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/MCast/MCast.cpp
@@ -0,0 +1,379 @@
+// $Id$
+
+
+#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/ORB_Core.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (EC_Examples,
+ MCast,
+ "$Id$")
+
+const char *udp_mcast_address =
+ ACE_DEFAULT_MULTICAST_ADDR ":10001";
+
+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 ();
+
+ // The exception macros are described in $ACE_ROOT/docs/exceptions.html
+ // and defined in $ACE_ROOT/ace/CORBA_macros.h.
+ // If your platform supports native exceptions, and TAO was compiled
+ // with native exception support then you can simply use try/catch
+ // and avoid the ACE_ENV_SINGLE_ARG_PARAMETER argument.
+ // Unfortunately many embedded systems cannot use exceptions due to
+ // the space and time overhead.
+ //
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // **************** HERE STARTS THE ORB SETUP
+
+ // Create the ORB, pass the argv list for parsing.
+ CORBA::ORB_var 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 COMPLETS THE ORB SETUP
+
+ // **************** HERE START 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 STARTS 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_Refcounted_Endpoint endpoint(new TAO_ECG_UDP_Out_Endpoint);
+ 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 = 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 = 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 STARTS THE CLIENT SETUP
+
+ // First let us create a consumer and connect it to the event
+ // channel
+ Consumer consumer;
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer.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 STARTS THE EVENT LOOP
+
+ // Wait for events, including incoming multicast data.
+ // We could also use orb->run(), but that will not let us
+ // terminate the application in a nice way.
+ for (int i = 0; i != 1000; ++i)
+ {
+ 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_Time_Value tv (0, 100000);
+ ACE_OS::sleep (tv);
+ supplier.perform_push (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // **************** THAT COMPLETES THE EVENT LOOP
+
+ // **************** HERE STARTS THE CLEANUP CODE
+
+ // First the easy ones
+ supplier.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Now let us close 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 close 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 terminated\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/examples/RtEC/MCast/Makefile.am b/TAO/orbsvcs/examples/RtEC/MCast/Makefile.am
new file mode 100644
index 00000000000..48805140016
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/MCast/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.RtEC_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)/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/examples/RtEC/MCast/README b/TAO/orbsvcs/examples/RtEC/MCast/README
new file mode 100644
index 00000000000..55aad804e20
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/MCast/README
@@ -0,0 +1,26 @@
+# $Id$
+
+ This directory contains a very simple example of a
+multicast-based federation of event services.
+
+ The example is a single process that contains:
+
+1) An event service
+2) A supplier
+3) A consumer
+4) The gateways required to send and receive data through the
+ multicast group.
+
+ The tests should be executed as follows:
+
+$ MCast
+
+ If you need to set the multicast group and port you can use
+the -m option:
+
+$ MCast -m 224.100.2.1:12345
+
+ Run the test in multiple machines on the same network. If
+there is only one process you should only receive 1000 events in the
+local consumer. If there is more than one machine you should receive
+more events.
diff --git a/TAO/orbsvcs/examples/RtEC/MCast/RtEC_MCast.mpc b/TAO/orbsvcs/examples/RtEC/MCast/RtEC_MCast.mpc
new file mode 100644
index 00000000000..ebe69a8ddbc
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/MCast/RtEC_MCast.mpc
@@ -0,0 +1,5 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcsexe, rtevent_serv, rtsched {
+}
diff --git a/TAO/orbsvcs/examples/RtEC/MCast/Supplier.cpp b/TAO/orbsvcs/examples/RtEC/MCast/Supplier.cpp
new file mode 100644
index 00000000000..f835dcb6daa
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/MCast/Supplier.cpp
@@ -0,0 +1,94 @@
+// $Id$
+
+#include "Supplier.h"
+#include "orbsvcs/RtecEventChannelAdminS.h"
+#include "orbsvcs/Event_Service_Constants.h"
+
+ACE_RCSID (EC_Examples,
+ 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/examples/RtEC/MCast/Supplier.h b/TAO/orbsvcs/examples/RtEC/MCast/Supplier.h
new file mode 100644
index 00000000000..7c591f5fdb7
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/MCast/Supplier.h
@@ -0,0 +1,62 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Real-time Event Channel examples
+//
+// = FILENAME
+// Supplier
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#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/examples/RtEC/MCast/svc.conf b/TAO/orbsvcs/examples/RtEC/MCast/svc.conf
new file mode 100644
index 00000000000..d0297d4649e
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/MCast/svc.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECObserver basic -ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list -ECDispatching reactive -ECScheduling null -ECFiltering prefix -ECSupplierFilter per-supplier"
diff --git a/TAO/orbsvcs/examples/RtEC/MCast/svc.conf.xml b/TAO/orbsvcs/examples/RtEC/MCast/svc.conf.xml
new file mode 100644
index 00000000000..159faa97abc
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/MCast/svc.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/examples/RtEC/MCast/svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECObserver basic -ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list -ECDispatching reactive -ECScheduling null -ECFiltering prefix -ECSupplierFilter per-supplier"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/examples/RtEC/Makefile.am b/TAO/orbsvcs/examples/RtEC/Makefile.am
new file mode 100644
index 00000000000..7fc730d6850
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Makefile.am
@@ -0,0 +1,17 @@
+## 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 = \
+ IIOPGateway \
+ Kokyu \
+ MCast \
+ Schedule \
+ Simple
+
diff --git a/TAO/orbsvcs/examples/RtEC/Schedule/Consumer.cpp b/TAO/orbsvcs/examples/RtEC/Schedule/Consumer.cpp
new file mode 100644
index 00000000000..4f23249c145
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Schedule/Consumer.cpp
@@ -0,0 +1,32 @@
+// $Id$
+
+#include "Consumer.h"
+
+ACE_RCSID(EC_Examples, Consumer, "$Id$")
+
+Consumer::Consumer (void)
+{
+}
+
+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;
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "Consumer (%P|%t) we received event type %d\n",
+ events[0].header.type));
+}
+
+void
+Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
diff --git a/TAO/orbsvcs/examples/RtEC/Schedule/Consumer.h b/TAO/orbsvcs/examples/RtEC/Schedule/Consumer.h
new file mode 100644
index 00000000000..bdbdbaad894
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Schedule/Consumer.h
@@ -0,0 +1,55 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Real-time Event Channel examples
+//
+// = FILENAME
+// Consumer
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef CONSUMER_H
+#define CONSUMER_H
+
+#include "orbsvcs/RtecEventCommS.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 register for two event typesone event type
+ // 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.
+ //
+public:
+ Consumer (void);
+ // Constructor
+
+ // = 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.
+};
+
+#endif /* CONSUMER_H */
diff --git a/TAO/orbsvcs/examples/RtEC/Schedule/Makefile.am b/TAO/orbsvcs/examples/RtEC/Schedule/Makefile.am
new file mode 100644
index 00000000000..84401da731f
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Schedule/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.RtEC_Schedule.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS = Service
+
+Service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+Service_SOURCES = \
+ Consumer.cpp \
+ Service.cpp \
+ Supplier.cpp \
+ Consumer.h \
+ Schedule.h \
+ Supplier.h
+
+Service_LDADD = \
+ $(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/examples/RtEC/Schedule/README b/TAO/orbsvcs/examples/RtEC/Schedule/README
new file mode 100644
index 00000000000..8435319a51b
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Schedule/README
@@ -0,0 +1,23 @@
+# $Id$
+
+ Shows how to use the scheduling service in conjunction with
+the real-time event channel. The test has a single consumer that
+subscribes for two event types, using different RT_Infos for each. A
+supplier pushes those events also using different RT_Infos.
+ The event-channel cooperates with the scheduling service to
+compute a schedule and assign priorities to each event. The event
+channel will use different queues for those events, each queue
+serviced by threads at different priorities.
+
+ The example can be run using a pre-computed schedule:
+
+$ ./Service
+
+ or it can generate the schedule again:
+
+$ ./Service -c
+
+
+ NOTE: the current version uses the old event channel because
+we haven't coimpleted the integration between the new EC and the
+scheduling service.
diff --git a/TAO/orbsvcs/examples/RtEC/Schedule/RtEC_Schedule.mpc b/TAO/orbsvcs/examples/RtEC/Schedule/RtEC_Schedule.mpc
new file mode 100644
index 00000000000..ebe69a8ddbc
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Schedule/RtEC_Schedule.mpc
@@ -0,0 +1,5 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcsexe, rtevent_serv, rtsched {
+}
diff --git a/TAO/orbsvcs/examples/RtEC/Schedule/Schedule.h b/TAO/orbsvcs/examples/RtEC/Schedule/Schedule.h
new file mode 100644
index 00000000000..3a6d4463fa3
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Schedule/Schedule.h
@@ -0,0 +1,42 @@
+// $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[] = {
+{"Dispatching_Task-250000.us", 1, 0, 0, 0, 250000, (RtecScheduler::Criticality_t) 0, (RtecScheduler::Importance_t) 0, 0, 1, 58, 4, 1, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{"Dispatching_Task-500000.us", 2, 0, 0, 0, 500000, (RtecScheduler::Criticality_t) 0, (RtecScheduler::Importance_t) 0, 0, 1, 58, 5, 1, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{"Dispatching_Task-1000000.us", 3, 0, 0, 0, 1000000, (RtecScheduler::Criticality_t) 0, (RtecScheduler::Importance_t) 0, 0, 1, 58, 6, 1, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{"Dispatching_Task-2000000.us", 4, 0, 0, 0, 2000000, (RtecScheduler::Criticality_t) 0, (RtecScheduler::Importance_t) 0, 0, 1, 58, 7, 1, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{"Dispatching_Task-10000000.us", 5, 0, 0, 0, 10000000, (RtecScheduler::Criticality_t) 0, (RtecScheduler::Importance_t) 0, 0, 1, 58, 8, 1, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "consumer_event_1", 6, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 0, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "consumer_event_2", 7, 10000, 10000, 10000, 0, (RtecScheduler::Criticality_t) 0, (RtecScheduler::Importance_t) 0, 10000, 0, 58, 1, 1, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{"(consumer_event_1#rep||consumer_event_2#rep)", 8, 0, 0, 0, 0, (RtecScheduler::Criticality_t) 0, (RtecScheduler::Importance_t) 0, 0, 0, 58, 3, 1, (RtecScheduler::Info_Type_t) 2 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{"consumer_event_1#rep", 9, 0, 0, 0, 0, (RtecScheduler::Criticality_t) 0, (RtecScheduler::Importance_t) 0, 0, 0, 58, 0, 1, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{"consumer_event_2#rep", 10, 0, 0, 0, 0, (RtecScheduler::Criticality_t) 0, (RtecScheduler::Importance_t) 0, 0, 0, 58, 2, 1, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "supplier_event_1", 11, 0, 0, 0, 100000, (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 },
+{ "supplier_event_2", 12, 0, 0, 0, 200000, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 0, 1, 59, 2, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED }
+};
+
+static int infos_size = sizeof(infos)/sizeof(infos[0]);
+
+
+static ACE_Scheduler_Factory::POD_Config_Info configs[] = {
+ { 0, 59, (RtecScheduler::Dispatching_Type_t) 2 },
+ { 1, 58, (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/examples/RtEC/Schedule/Service.cpp b/TAO/orbsvcs/examples/RtEC/Schedule/Service.cpp
new file mode 100644
index 00000000000..bb27f0bad68
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Schedule/Service.cpp
@@ -0,0 +1,408 @@
+// $Id$
+
+#include "orbsvcs/Sched/Reconfig_Scheduler.h"
+#include "orbsvcs/Runtime_Scheduler.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "Consumer.h"
+#include "Supplier.h"
+
+#include "Schedule.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Sched_Params.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID(EC_Examples, Service, "$Id$")
+
+int config_run = 0;
+
+int parse_args (int argc, char *argv[]);
+
+typedef TAO_Reconfig_Scheduler<TAO_MUF_FAIR_Reconfig_Sched_Strategy, TAO_SYNCH_MUTEX> RECONFIG_SCHED_TYPE;
+
+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;
+
+ if (parse_args (argc, argv) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Usage: Service [-o IOR_file_name]\n"));
+ return 1;
+ }
+
+ 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;
+
+ // ****************************************************************
+
+#if 0
+ // Obtain a reference to the naming service...
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#endif /* 0 */
+
+ // ****************************************************************
+
+ // Create an scheduling service
+ POA_RtecScheduler::Scheduler* sched_impl = 0;
+ if (config_run)
+ {
+ ACE_NEW_RETURN (sched_impl,
+ RECONFIG_SCHED_TYPE,
+ 1);
+ }
+ else
+ {
+ ACE_NEW_RETURN (sched_impl,
+ RECONFIG_SCHED_TYPE (configs_size,
+ configs,
+ infos_size,
+ infos,
+ 0, 0,
+ 0),
+ 1);
+ }
+
+ RtecScheduler::Scheduler_var scheduler =
+ sched_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+#if 0
+ // Bind the scheduler with the naming service so clients
+ // (consumers and suppliers) can resolve it, some (old)
+ // implementations of the EC will try to do the same thing
+ // (yikes!)
+ CosNaming::Name schedule_name (1);
+ schedule_name.length (1);
+ schedule_name[0].id = CORBA::string_dup ("ScheduleService");
+ // Register the servant with the Naming Context....
+ naming_context->rebind (schedule_name, scheduler.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#endif /* 0 */
+
+ // ****************************************************************
+
+ TAO_EC_Event_Channel_Attributes attributes (poa.in (),
+ poa.in ());
+ attributes.scheduler = scheduler.in (); // no need to dup
+
+ TAO_EC_Event_Channel ec_impl (attributes);
+ ACE_DEBUG ((LM_DEBUG, "activating EC\n"));
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "EC activated\n"));
+
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+ Consumer consumer_impl;
+
+ RtecScheduler::handle_t consumer_rt_info1 =
+ scheduler->create ("consumer_event_1" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Let's say that the execution time for event 1 is 2
+ // milliseconds...
+ ACE_Time_Value tv (0, 2000);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+ scheduler->set (consumer_rt_info1,
+ RtecScheduler::VERY_HIGH_CRITICALITY,
+ time, time, time,
+ 0,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ time,
+ 0,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecScheduler::handle_t consumer_rt_info2 =
+ scheduler->create ("consumer_event_2" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Let's say that the execution time for event 2 is 1
+ // milliseconds...
+ tv.set (0, 1000);
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+ scheduler->set (consumer_rt_info2,
+ RtecScheduler::VERY_LOW_CRITICALITY,
+ time, time, time,
+ 0,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ time,
+ 0,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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_type (ACE_ES_EVENT_UNDEFINED,
+ consumer_rt_info1);
+ consumer_qos.insert_type (ACE_ES_EVENT_UNDEFINED + 1,
+ consumer_rt_info2);
+
+ // The canonical protocol to connect to the EC
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventComm::PushConsumer_var consumer =
+ consumer_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connecting consumer\n"));
+ supplier_proxy->connect_push_consumer (consumer.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "consumer connected\n"));
+
+ // ****************************************************************
+
+ Supplier supplier_impl;
+
+ RtecScheduler::handle_t supplier_rt_info1 =
+ scheduler->create ("supplier_event_1" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_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.
+ tv.set (0, 10000);
+ TimeBase::TimeT tmp;
+ ORBSVCS_Time::Time_Value_to_TimeT (tmp, tv);
+ RtecScheduler::Period_t rate = ACE_U64_TO_U32(tmp);
+
+ scheduler->set (supplier_rt_info1,
+ RtecScheduler::VERY_HIGH_CRITICALITY,
+ 0, 0, 0,
+ rate,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ 0,
+ 1,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecScheduler::handle_t supplier_rt_info2 =
+ scheduler->create ("supplier_event_2" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_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.
+ tv.set (0, 20000);
+ ORBSVCS_Time::Time_Value_to_TimeT (tmp, tv);
+ rate = ACE_U64_TO_U32(tmp);
+
+ scheduler->set (supplier_rt_info2,
+ RtecScheduler::VERY_HIGH_CRITICALITY,
+ 0, 0, 0,
+ rate,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ 0,
+ 1,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventComm::EventSourceID supplier_id = 1;
+ ACE_SupplierQOS_Factory supplier_qos;
+ supplier_qos.insert (supplier_id,
+ ACE_ES_EVENT_UNDEFINED,
+ supplier_rt_info1,
+ 1 /* number of calls, but what does that mean? */);
+ supplier_qos.insert (supplier_id,
+ ACE_ES_EVENT_UNDEFINED + 1,
+ supplier_rt_info2,
+ 1 /* number of calls, but what does that mean? */);
+
+ // The canonical protocol to connect to the EC
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer_proxy =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventComm::PushSupplier_var supplier =
+ supplier_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connecting supplier\n"));
+ consumer_proxy->connect_push_supplier (supplier.in (),
+ supplier_qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "supplier connected\n"));
+
+ // ****************************************************************
+
+ // At this point the consumer and supplier are connected to the
+ // EC, they have provided their QoS info to the Scheduling
+ // Service and the EC has informed the Scheduler about the
+ // dependencies between them.
+ // We can now compute the schedule for this configuration...
+
+ // The schedule is returned in this variables....
+
+ if (config_run)
+ {
+ ACE_DEBUG ((LM_DEBUG, "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;
+
+ // Obtain the range of valid priorities in the current
+ // platform, the scheduler hard-code this values in the
+ // generated file, but in the future we may just use the
+ // "logical" priorities and define the mapping to OS
+ // priorities at run-time.
+ int min_os_priority =
+ ACE_Sched_Params::priority_min (ACE_SCHED_FIFO,
+ ACE_SCOPE_THREAD);
+ int max_os_priority =
+ ACE_Sched_Params::priority_max (ACE_SCHED_FIFO,
+ ACE_SCOPE_THREAD);
+ scheduler->compute_scheduling (min_os_priority,
+ max_os_priority,
+ infos.out (),
+ deps.out (),
+ configs.out (),
+ anomalies.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Dump the schedule to a file..
+ ACE_Scheduler_Factory::dump_schedule (infos.in (),
+ deps.in (),
+ configs.in (),
+ anomalies.in (),
+ "schedule.out");
+ }
+
+ // ****************************************************************
+
+ ACE_DEBUG ((LM_DEBUG, "Pushing events\n"));
+
+ // Generate a few events....
+
+ RtecEventComm::EventSet event1 (1);
+ event1.length (1);
+ event1[0].header.type = ACE_ES_EVENT_UNDEFINED;
+ event1[0].header.source = supplier_id;
+ event1[0].header.ttl = 1;
+
+ RtecEventComm::EventSet event2 (1);
+ event2.length (1);
+ event2[0].header.type = ACE_ES_EVENT_UNDEFINED + 1;
+ event2[0].header.source = supplier_id;
+ event2[0].header.ttl = 1;
+
+ for (int i = 0; i != 200; ++i)
+ {
+ if (i % 2 == 0)
+ {
+ consumer_proxy->push (event1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ consumer_proxy->push (event2 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_Time_Value rate (0, 10000);
+ ACE_OS::sleep (rate);
+ }
+
+ // ****************************************************************
+
+ // We should do a lot of cleanup (disconnect from the EC,
+ // deactivate all the objects with the POA, etc.) but this is
+ // just a simple demo so we are going to be lazy.
+
+ }
+ 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, "c");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'c':
+ config_run = 1;
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-c (config run)"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/examples/RtEC/Schedule/Supplier.cpp b/TAO/orbsvcs/examples/RtEC/Schedule/Supplier.cpp
new file mode 100644
index 00000000000..947378d616a
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Schedule/Supplier.cpp
@@ -0,0 +1,18 @@
+// $Id$
+
+#include "Supplier.h"
+
+ACE_RCSID (EC_Examples,
+ Supplier,
+ "$Id$")
+
+Supplier::Supplier (void)
+{
+}
+
+void
+Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
diff --git a/TAO/orbsvcs/examples/RtEC/Schedule/Supplier.h b/TAO/orbsvcs/examples/RtEC/Schedule/Supplier.h
new file mode 100644
index 00000000000..b0391f7602b
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Schedule/Supplier.h
@@ -0,0 +1,54 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Real-time Event Channel examples
+//
+// = FILENAME
+// Supplier
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef SUPPLIER_H
+#define SUPPLIER_H
+
+#include "orbsvcs/RtecEventCommS.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 register for two event typesone event type
+ // 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.
+ //
+public:
+ Supplier (void);
+ // Constructor
+
+ // = 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:
+};
+
+#endif /* SUPPLIER_H */
diff --git a/TAO/orbsvcs/examples/RtEC/Schedule/svc.conf b/TAO/orbsvcs/examples/RtEC/Schedule/svc.conf
new file mode 100644
index 00000000000..c0bbc7fc673
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Schedule/svc.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:immediate:list -ECProxyPushSupplierCollection mt:immediate:list -ECdispatching priority -ECscheduling priority -ECfiltering priority -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"
diff --git a/TAO/orbsvcs/examples/RtEC/Schedule/svc.conf.xml b/TAO/orbsvcs/examples/RtEC/Schedule/svc.conf.xml
new file mode 100644
index 00000000000..8d634c164f8
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Schedule/svc.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/examples/RtEC/Schedule/svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection mt:immediate:list -ECProxyPushSupplierCollection mt:immediate:list -ECdispatching priority -ECscheduling priority -ECfiltering priority -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/examples/RtEC/Simple/Consumer.cpp b/TAO/orbsvcs/examples/RtEC/Simple/Consumer.cpp
new file mode 100644
index 00000000000..e8af9a77ed8
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Simple/Consumer.cpp
@@ -0,0 +1,162 @@
+// $Id$
+
+#include "Consumer.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/CosNamingC.h"
+
+ACE_RCSID (EC_Examples,
+ Consumer,
+ "$Id$")
+
+int
+main (int argc, char* argv[])
+{
+ Consumer consumer;
+
+ return consumer.run (argc, argv);
+}
+
+// ****************************************************************
+
+Consumer::Consumer (void)
+ : event_count_ (0)
+{
+}
+
+int
+Consumer::run (int argc, char* argv[])
+{
+ 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;
+
+ // Do *NOT* make a copy because we don't want the ORB to outlive
+ // the run() method.
+ this->orb_ = orb.in ();
+
+ 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;
+
+ // Obtain the event channel from the naming service
+ 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 event_channel =
+ RtecEventChannelAdmin::EventChannel::_narrow (ec_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The canonical protocol to connect to the EC
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_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;
+
+ RtecEventComm::PushConsumer_var consumer =
+ this->_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 qos;
+ qos.dependencies.length (2);
+ RtecEventComm::EventHeader& h0 =
+ qos.dependencies[0].event.header;
+ h0.type = ACE_ES_DISJUNCTION_DESIGNATOR;
+ h0.source = ACE_ES_EVENT_SOURCE_ANY;
+
+ 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;
+
+ supplier->connect_push_consumer (consumer.in (), qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Wait for events, using work_pending()/perform_work() may help
+ // or using another thread, this example is too simple for that.
+ orb->run ();
+
+ // We don't do any cleanup, it is hard to do it after shutdown,
+ // and would complicate the example; plus it is almost
+ // impossible to do cleanup after ORB->run() because the POA is
+ // in the holding state. Applications should use
+ // work_pending()/perform_work() to do more interesting stuff.
+ // Check the supplier for the proper way to do cleanup.
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Consumer::run");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+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_ % 100 == 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)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // In this example we shutdown the ORB when we disconnect from the
+ // EC (or rather the EC disconnects from us), but this doesn't have
+ // to be the case....
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
diff --git a/TAO/orbsvcs/examples/RtEC/Simple/Consumer.h b/TAO/orbsvcs/examples/RtEC/Simple/Consumer.h
new file mode 100644
index 00000000000..19005b96ec1
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Simple/Consumer.h
@@ -0,0 +1,60 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Real-time Event Channel examples
+//
+// = FILENAME
+// Consumer
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef CONSUMER_H
+#define CONSUMER_H
+
+#include "orbsvcs/RtecEventCommS.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 registers for one event type.
+ //
+public:
+ Consumer (void);
+ // Constructor
+
+ int run (int argc, char* argv[]);
+ // Run the test
+
+ // = 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.
+
+ CORBA::ORB_ptr orb_;
+ // The orb, just a pointer because the ORB does not outlive the
+ // run() method...
+};
+
+#endif /* CONSUMER_H */
diff --git a/TAO/orbsvcs/examples/RtEC/Simple/Makefile.am b/TAO/orbsvcs/examples/RtEC/Simple/Makefile.am
new file mode 100644
index 00000000000..d9066e3eddc
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Simple/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_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.RtEC_Simple_Consumer.am
+
+if BUILD_CORBA_MESSAGING
+
+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 = \
+ Consumer.cpp \
+ Consumer.h
+
+Consumer_LDADD = \
+ $(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.RtEC_Simple_Service.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Service
+
+Service_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+Service_SOURCES = \
+ Service.cpp \
+ Consumer.h \
+ Supplier.h
+
+Service_LDADD = \
+ $(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.RtEC_Simple_Supplier.am
+
+if BUILD_CORBA_MESSAGING
+
+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 = \
+ Supplier.cpp \
+ Supplier.h
+
+Supplier_LDADD = \
+ $(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
+
+## 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/examples/RtEC/Simple/README b/TAO/orbsvcs/examples/RtEC/Simple/README
new file mode 100644
index 00000000000..96dae4b1cca
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Simple/README
@@ -0,0 +1,15 @@
+# $Id$
+
+ This directory contains possibly the most simple example of
+the real-time event service. It contains three executables; a
+consumer, supplier and a program to create the event channel itself.
+
+ Run using the run_test.pl script or:
+
+$ ../../../Naming_Service/Naming_Service
+$ ./Service
+$ ./Consumer
+$ ./Supplier
+
+ more advanced tests are available in
+$TAO_ROOT/orbsvcs/tests/Event and $TAO_ROOT/orbsvcs/tests/EC_*
diff --git a/TAO/orbsvcs/examples/RtEC/Simple/RtEC_Simple.mpc b/TAO/orbsvcs/examples/RtEC/Simple/RtEC_Simple.mpc
new file mode 100644
index 00000000000..b98ff0f88e4
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Simple/RtEC_Simple.mpc
@@ -0,0 +1,20 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Service) : orbsvcsexe, rtevent_serv, naming {
+ source_files {
+ Service.cpp
+ }
+}
+
+project(*Supplier) : orbsvcsexe, rtevent_skel, naming {
+ source_files {
+ Supplier.cpp
+ }
+}
+
+project(*Consumer) : orbsvcsexe, rtevent_skel, naming {
+ source_files {
+ Consumer.cpp
+ }
+}
diff --git a/TAO/orbsvcs/examples/RtEC/Simple/Service.cpp b/TAO/orbsvcs/examples/RtEC/Simple/Service.cpp
new file mode 100644
index 00000000000..a3bd5e5740d
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Simple/Service.cpp
@@ -0,0 +1,141 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/CosNamingC.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID (EC_Examples,
+ Service,
+ "$Id$")
+
+const char *ior_output_file = "ec.ior";
+
+int parse_args (int argc, char *argv[]);
+
+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;
+
+ // Obtain the naming service
+ 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;
+
+ 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;
+
+ // Create a name.
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup ("EventService");
+ name[0].kind = CORBA::string_dup ("");
+
+ // Register with the name server
+ naming_context->bind (name, event_channel.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Example code: How to write ior to file
+ CORBA::String_var ior =
+ orb->object_to_string (event_channel.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);
+ }
+
+ // Wait for events, using work_pending()/perform_work() may help
+ // or using another thread, this example is too simple for that.
+ orb->run ();
+
+ // We don't do any cleanup, it is hard to do it after shutdown,
+ // and would complicate the example; plus it is almost
+ // impossible to do cleanup after ORB->run() because the POA is
+ // in the holding state. Applications should use
+ // work_pending()/perform_work() to do more interesting stuff.
+ // Check the supplier for the proper way to do cleanup.
+ }
+ 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, "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;
+}
+
diff --git a/TAO/orbsvcs/examples/RtEC/Simple/Supplier.cpp b/TAO/orbsvcs/examples/RtEC/Simple/Supplier.cpp
new file mode 100644
index 00000000000..21ced08639e
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Simple/Supplier.cpp
@@ -0,0 +1,152 @@
+// $Id$
+
+#include "Supplier.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/CosNamingC.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (EC_Examples,
+ Supplier,
+ "$Id$")
+
+int
+main (int argc, char* argv[])
+{
+ Supplier supplier;
+
+ return supplier.run (argc, argv);
+}
+
+// ****************************************************************
+
+Supplier::Supplier (void)
+{
+}
+
+int
+Supplier::run (int argc, char* argv[])
+{
+ 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;
+
+ // Obtain the event channel from the naming service
+ 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 event_channel =
+ RtecEventChannelAdmin::EventChannel::_narrow (ec_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The canonical protocol to connect to the EC
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventComm::PushSupplier_var supplier =
+ this->_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 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
+
+ consumer->connect_push_supplier (supplier.in (), qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Push the events...
+ ACE_Time_Value sleep_time (0, 10000); // 10 milliseconds
+
+ 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;
+
+ for (int i = 0; i != 2000; ++i)
+ {
+ consumer->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_OS::sleep (sleep_time);
+ }
+
+ // Disconnect from the EC
+ consumer->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Destroy the EC....
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Deactivate this object...
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Destroy the POA
+ poa->destroy (1, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Supplier::run");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
diff --git a/TAO/orbsvcs/examples/RtEC/Simple/Supplier.h b/TAO/orbsvcs/examples/RtEC/Simple/Supplier.h
new file mode 100644
index 00000000000..b1fce544ccc
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Simple/Supplier.h
@@ -0,0 +1,51 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Real-time Event Channel examples
+//
+// = FILENAME
+// Supplier
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef SUPPLIER_H
+#define SUPPLIER_H
+
+#include "orbsvcs/RtecEventCommS.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.
+ //
+public:
+ Supplier (void);
+ // Constructor
+
+ int run (int argc, char* argv[]);
+ // Run the test
+
+ // = 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:
+};
+
+#endif /* SUPPLIER_H */
diff --git a/TAO/orbsvcs/examples/RtEC/Simple/ec.conf b/TAO/orbsvcs/examples/RtEC/Simple/ec.conf
new file mode 100644
index 00000000000..d3d61260f68
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Simple/ec.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECDispatching reactive -ECFiltering basic -ECSupplierFiltering per-supplier -ECProxyConsumerLock thread -ECProxySupplierLock thread -ECConsumerControl reactive -ECSupplierControl reactive -ECConsumerControlPeriod 50000 -ECSupplierControlPeriod 50000"
diff --git a/TAO/orbsvcs/examples/RtEC/Simple/ec.conf.xml b/TAO/orbsvcs/examples/RtEC/Simple/ec.conf.xml
new file mode 100644
index 00000000000..63807cba8d3
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Simple/ec.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/examples/RtEC/Simple/ec.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECDispatching reactive -ECFiltering basic -ECSupplierFiltering per-supplier -ECProxyConsumerLock thread -ECProxySupplierLock thread -ECConsumerControl reactive -ECSupplierControl reactive -ECConsumerControlPeriod 50000 -ECSupplierControlPeriod 50000"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/examples/RtEC/Simple/run_test.pl b/TAO/orbsvcs/examples/RtEC/Simple/run_test.pl
new file mode 100755
index 00000000000..ca45c8b972e
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/Simple/run_test.pl
@@ -0,0 +1,83 @@
+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 ("ns.ior");
+$conffile = PerlACE::LocalFile ("ec" . "$PerlACE::svcconf_ext");
+
+unlink $ns_ior;
+
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-o $ns_ior ");
+
+$T = new PerlACE::Process ("Service",
+ "-ORBInitRef NameService=file://$ns_ior "
+ . "-ORBsvcconf $conffile");
+
+$C = new PerlACE::Process ("Consumer",
+ "-ORBInitRef NameService=file://$ns_ior ");
+
+$S = new PerlACE::Process ("Supplier",
+ "-ORBInitRef NameService=file://$ns_ior ");
+
+
+
+print STDOUT "Starting name server\n";
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($ns_ior, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$ns_ior>\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDOUT "Starting event server\n";
+$T->Spawn ();
+
+sleep 2;
+
+print STDOUT "Starting consumer\n";
+$C->Spawn ();
+
+sleep 1;
+
+print STDOUT "Starting supplier\n";
+$supplier = $S->SpawnWaitKill (120);
+
+if ($supplier != 0) {
+ print STDERR "ERROR: supplier returned $supplier\n";
+ $status = 1;
+}
+
+$consumer = $C->WaitKill (15);
+
+if ($consumer != 0) {
+ print STDERR "ERROR: consumer returned $consumer\n";
+ $status = 1;
+}
+
+$service = $T->TerminateWaitKill (5);
+
+if ($service != 0) {
+ print STDERR "ERROR: service returned $service\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/examples/Security/Makefile.am b/TAO/orbsvcs/examples/Security/Makefile.am
new file mode 100644
index 00000000000..9772a9daeed
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/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 = \
+ Send_File
+
diff --git a/TAO/orbsvcs/examples/Security/README b/TAO/orbsvcs/examples/Security/README
new file mode 100644
index 00000000000..db13c886738
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/README
@@ -0,0 +1,9 @@
+# $Id$
+
+TAO CORBA Security Service Examples
+===================================
+
+Directory Description
+--------- -----------
+Send_File Example that demonstrates use of SSLIOP pluggable protocol
+
diff --git a/TAO/orbsvcs/examples/Security/SecurityLevel1/README b/TAO/orbsvcs/examples/Security/SecurityLevel1/README
new file mode 100644
index 00000000000..a29c58d2ee7
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/SecurityLevel1/README
@@ -0,0 +1,47 @@
+$Id$
+
+* README *
+
+
+ In this example, the server will have some (or may be just
+one, if that will serve the purpose .. anyways since these will be
+just simple dummy methods, it shouldnt matter) methods with different
+levels of authorization. When a client wants to invoke any of these
+methods, it has to be authenticated first(I am not sure, as of now,
+the way for authenticating or the fact if this is really needed
+.. well for starters, I will leave authentication). Then based on the
+principals privilege attributes, the invocation will be
+successful or denied.
+
+This test makes use of the Current::get_attributes to get the
+attributes of the prinicipal which are used to provide or deny
+access.
+
+We will check the values for all the possible attribute types that a
+server could check in the remote case. And, as in the example, run
+clients with both valid and invalid credentials.
+
+Also, we also need to make sure that the server is actually
+returning the correct credentials and not garbling or giving some
+random values.
+
+This will prove that
+
+1. Authorization is working.
+2. All the attribute types which are supposed to work are working
+ properly.
+3. Authentication is already working but we could also check that once
+ again. But, authentication is not limited to the ORB. It could be
+ checked using an outside agent too.
+
+
+ Since, the only thing that the SecurityLevel1 does is to get the
+credentials of the initiating principal, to test the implementation,
+in my view,
+
+1. We need to see if the method is returning the correct credentials.
+2. If all the attribute types are working... ie.. show what are the
+ different types of attributes and what can be valid values for them
+ etc.
+3. We need to show how one can make use of these values to provide or
+ deny access to the initiating principal.
diff --git a/TAO/orbsvcs/examples/Security/SecurityLevel1/SLevel1_Test.idl b/TAO/orbsvcs/examples/Security/SecurityLevel1/SLevel1_Test.idl
new file mode 100644
index 00000000000..f2c1b7ecbdf
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/SecurityLevel1/SLevel1_Test.idl
@@ -0,0 +1,10 @@
+/*
+ * $Id$
+ */
+
+interface SLevel1_Server
+{
+ boolean authorize_level1 ();
+
+ boolean authorize_level2 ();
+};
diff --git a/TAO/orbsvcs/examples/Security/SecurityLevel1/SLevel1_Test_i.cpp b/TAO/orbsvcs/examples/Security/SecurityLevel1/SLevel1_Test_i.cpp
new file mode 100644
index 00000000000..2153014c111
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/SecurityLevel1/SLevel1_Test_i.cpp
@@ -0,0 +1,122 @@
+// $Id$
+
+#include "SLevel1_Test_i.h"
+
+#if !defined(__ACE_INLINE__)
+#include "test_i.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (SecurityLevel1,
+ SLevel1_Test_i,
+ "$Id$")
+
+static int authorize_1 = 1;
+static int authorize_2 = 1;
+
+CORBA::Boolean
+SLevel1_Server_i::authorize_level1 (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ /// Get a reference to the SecurityCurrent object.
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("SecurityCurrent" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ /// Narrow it down correctly.
+ SecurityLevel1::Current_var current =
+ SecurityLevel1::Current::_narrow (obj.in ());
+
+ /// Check for nil reference.
+ if (CORBA::is_nil (current.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the SecurityCurrent object\n"),
+ 1);
+
+ Security::AttributeType desired_attribute_1;
+
+ /// @@ Need to check more abt this variable
+ desired_attribute.attribute_family.family_definer = 0;
+
+ /// Implies Privilege Attributes
+ desired_attribute.attribute_family.family = 1;
+
+ /// AccessId: the identity of the principal used for access
+ /// control
+ desired_attribute.attibute_type = 2;
+
+ // Second desired attribute
+ Security::AttributeType desired_attribute_2;
+
+ /// @@ Need to check more abt this variable
+ desired_attribute.attribute_family.family_definer = 0;
+
+ /// Implies Privilege Attributes.
+ desired_attribute.attribute_family.family = 1;
+
+ /// Primary Group ID.
+ /// @@ I am not sure if Ossama will have all these attribute types
+ /// If it is not the same, one might have to change the comments
+ /// to show the attribute_type that is checked and change the
+ /// number accordingly.
+ desired_attribute.attibute_type = 3;
+
+ /// Define the AttributeTypeList
+ Security::AttributeTypeList attribute_type_list;
+ attribute_type_list.length (2);
+ attribute_type_list[0] = &desired_attribute_1;
+ attribute_type_list[1] = &desired_attribute_2;
+
+ /// Get the desired security attributes
+ Security::AttributeList_var attribute_list =
+ current->get_attributes (attribute_type_list);
+
+ /* @@ What did we do till now ??
+ * We set attribute_type_list so that we get the values of
+ * the variables we are interested in. Depending on how Ossama
+ * implements, the valid values of family_definer, family and the
+ * attribute type and its values all change .. but the process is
+ * similar.
+ * The type which is returned from the get_attribute method is a
+ * sequence of the AttributeList struct. This struct has three
+ * members: the attribute type, the defining_authority and the
+ * value of the attribute type.
+ *
+ * @@ What should we do now ??
+ * Compare the returned values with the values we, as in the
+ * server, decided and check if they are the same.
+
+ * Once we retrieve this sequence, we can invoke a method which
+ * has a generic list of attribute_types and corresponding values
+ * which are valid to authorize access to the requested
+ * invocation. Or complete this stuff with a single if condition
+ * make things easier.
+ *
+ */
+
+ if ((attribute_type == 1) && (attribute_value == 10))
+ {
+ // Lets say, this is the valid case.
+ authorize_1 = 0;
+ }
+
+ /// If the owner of this invocation is authorized to invoke this
+ /// method, return 0 else return 1.
+ if (authorize_1 == 0)
+ return 0;
+ else
+ return 1;
+}
+
+
+CORBA::Boolean
+SLevel1_Server_i::authorize_level2 (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ /// If the owner of this invocation is authorized to invoke this
+ /// method, return 0 else return 1.
+ if (authorize_2 == 0)
+ return 0;
+ else
+ return 1;
+}
diff --git a/TAO/orbsvcs/examples/Security/SecurityLevel1/SLevel1_Test_i.h b/TAO/orbsvcs/examples/Security/SecurityLevel1/SLevel1_Test_i.h
new file mode 100644
index 00000000000..d284e65c293
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/SecurityLevel1/SLevel1_Test_i.h
@@ -0,0 +1,39 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs/examples/Security/SecurityLevel1
+//
+// = FILENAME
+// SLevel1_Test_i.h
+//
+// = AUTHOR
+// Priyanka Gontla <gontla_p@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_SLEVEL1_TEST_I_H
+#define TAO_SLEVEL1_TEST_I_H
+
+#include "SLevel1_TestS.h"
+
+class SLevel1_Server_i : public POA_SLevel1_Server
+{
+ public:
+ /// Constructor
+ SLevel1_Server_i ();
+
+ ///
+ CORBA::Boolean authorize_level1 (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Boolean authorize_level2 (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ static int authorized_1;
+ static int authorized_2;
+
+};
+
+#endif /* TAO_SLEVEL1_TEST_I_H */
diff --git a/TAO/orbsvcs/examples/Security/SecurityLevel1/client.cpp b/TAO/orbsvcs/examples/Security/SecurityLevel1/client.cpp
new file mode 100644
index 00000000000..b7779c65615
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/SecurityLevel1/client.cpp
@@ -0,0 +1,89 @@
+// $Id$
+
+#include "SLevel1_TestC.h"
+
+ACE_RCSID (SecurityLevel1, 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_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 object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ SLevel1_Server_var server =
+ SLevel1_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);
+ }
+
+ CORBA::Boolean authorized =
+ server->authorize_level1 (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (authorized == 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "AUTHORIZED\n"));
+ else if (authorized == 1)
+ ACE_DEBUG ((LM_DEBUG,
+ "DENIED: You Do NOT have enough privileges\n"));
+
+ server->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,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/examples/Security/SecurityLevel1/server.cpp b/TAO/orbsvcs/examples/Security/SecurityLevel1/server.cpp
new file mode 100644
index 00000000000..2b39bda82e3
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/SecurityLevel1/server.cpp
@@ -0,0 +1,75 @@
+// $Id$
+
+#include "SLevel1_Test_i.h"
+
+ACE_RCSID (SecurityLevel1,
+ server,
+ "$Id$")
+
+const char *ior_output_file = 0;
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ /// Our regular ORB Initialization.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" 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;
+
+ if (CORBA::is_nil (poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"),
+ 1);
+
+ /// Narrow down the reference to the currect interface.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ SLevel1_Server_i level1_server ();
+
+ SLevel1_Server_var server =
+ level1_server._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;
+
+ // 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);
+ }
+
+ // Start the ORB
+ orb->run ();
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCH (CORBA::SytemException, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "System Exception raised: %s", ex));
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/Security/Send_File/Makefile.am b/TAO/orbsvcs/examples/Security/Send_File/Makefile.am
new file mode 100644
index 00000000000..c65c9708777
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/Makefile.am
@@ -0,0 +1,100 @@
+## 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.Security_Send_File_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_Send_File_Client.am
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+client_SOURCES = \
+ client.cpp \
+ testC.cpp \
+ test_i.h \
+ test_i.i
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Makefile.Security_Send_File_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_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/examples/Security/Send_File/README b/TAO/orbsvcs/examples/Security/Send_File/README
new file mode 100644
index 00000000000..c02ca187f21
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/README
@@ -0,0 +1,73 @@
+# $Id$
+
+Description:
+
+ This is a simple test for SSLIOP, it sends a file,
+line-per-line to the server, using truss we can take a look at the
+buffers and verify that they are giberish.
+
+Expected output:
+ The server prints out the IOR of the object it serves. Later
+it prints all the lines sent by the client. The client shouldn't
+print out anything, it returns 0 on success.
+
+How to run:
+
+# Setup the environment and add the fake CA to your trusted list:
+$ SSL_CERT_FILE=cacert.pem
+$ export SSL_CERT_FILE
+
+ Now run the simplest test:
+
+# Run the server
+$ server -ORBSvcConf server_nopasswd.conf -o test.ior
+
+# Run the client
+$ client -ORBSvcConf client_nopasswd.conf -k file://test.ior < myfile
+
+ notice that this test uses unsecure private key files. This
+could be appropriate if the keys are kept is a very trusted system,
+but usually you will want to use a pass phrase protected key:
+
+$ server -ORBSvcConf server.conf -o test.ior
+$ client -ORBSvcConf client.conf -k file://test.ior < myfile
+
+ In this case both the client and the server ask for the pass
+phrase (it is 'test').
+
+======= Testing IIOP interoperability
+
+ We also want to verify that the client and server (assuming
+ "-SSLNoProtection" flag is set in server's `server.conf' file)
+ can interoperate with regular IIOP servers and clients.
+ First setup a pure IIOP server:
+
+$ server -o test.ior
+$ client -ORBSvcConf client.conf -k file://test.ior < myfile
+
+ next a pure IIOP client (assuming "-SSLNoProtection" flag is
+ set in server's `server.conf' file):
+
+$ server -ORBSvcConf server.conf -o test.ior
+$ client -k file://test.ior < myfile
+
+ and finally both are pure IIOP:
+
+$ server -o test.ior
+$ client -k file://test.ior < certificate.pem
+
+======= Testing failed authentications:
+
+ To test failed server authentications we simply run the client
+and server as indicated below, but we enter invalid pass phrases in
+the client and/or server.
+
+$ server -ORBSvcConf server.conf -o test.ior
+$ client -ORBSvcConf client.conf -k file://test.ior < myfile
+
+======= Testing connections without client authentication:
+
+ We run the server and client as follows:
+
+$ server -ORBSvcConf server_none.conf -o test.ior
+$ client -ORBSvcConf client.conf -k file://test.ior < myfile
diff --git a/TAO/orbsvcs/examples/Security/Send_File/Security_Send_File.mpc b/TAO/orbsvcs/examples/Security/Send_File/Security_Send_File.mpc
new file mode 100644
index 00000000000..7752e40754b
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/Security_Send_File.mpc
@@ -0,0 +1,31 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Idl) : taoidldefaults {
+ IDL_Files {
+ test.idl
+ }
+ custom_only = 1
+}
+
+project(*Client) : orbsvcsexe, portableserver {
+ after += *Idl
+ source_files {
+ client.cpp
+ testC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Server) : orbsvcsexe, portableserver {
+ after += *Idl
+ source_files {
+ server.cpp
+ test_i.cpp
+ testS.cpp
+ testC.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/examples/Security/Send_File/cacert.pem b/TAO/orbsvcs/examples/Security/Send_File/cacert.pem
new file mode 100644
index 00000000000..a9e905f4e6c
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/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/examples/Security/Send_File/client.conf b/TAO/orbsvcs/examples/Security/Send_File/client.conf
new file mode 100644
index 00000000000..5847fa22a03
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/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/examples/Security/Send_File/client.conf.xml b/TAO/orbsvcs/examples/Security/Send_File/client.conf.xml
new file mode 100644
index 00000000000..957235c7149
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/client.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/examples/Security/Send_File/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/examples/Security/Send_File/client.cpp b/TAO/orbsvcs/examples/Security/Send_File/client.cpp
new file mode 100644
index 00000000000..507bdde5847
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/client.cpp
@@ -0,0 +1,90 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+#include "testC.h"
+
+ACE_RCSID(Send_File, 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_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 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);
+ }
+
+ while (!feof (stdin))
+ {
+ ACE_Read_Buffer buf (stdin, 0);
+ char *line = buf.read ('\n');
+ if (line == 0)
+ break;
+ server->send_line (line ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ buf.alloc ()->free (line);
+ }
+
+ server->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,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/Security/Send_File/client_cert.pem b/TAO/orbsvcs/examples/Security/Send_File/client_cert.pem
new file mode 100644
index 00000000000..0bebb696cfc
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/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/examples/Security/Send_File/client_key.pem b/TAO/orbsvcs/examples/Security/Send_File/client_key.pem
new file mode 100644
index 00000000000..1428b501712
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/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/examples/Security/Send_File/client_key_nopasswd.pem b/TAO/orbsvcs/examples/Security/Send_File/client_key_nopasswd.pem
new file mode 100644
index 00000000000..35e449a2493
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/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/examples/Security/Send_File/client_nopasswd.conf b/TAO/orbsvcs/examples/Security/Send_File/client_nopasswd.conf
new file mode 100644
index 00000000000..b351c69d88a
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/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.pem -SSLCertificate PEM:client_cert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/orbsvcs/examples/Security/Send_File/client_nopasswd.conf.xml b/TAO/orbsvcs/examples/Security/Send_File/client_nopasswd.conf.xml
new file mode 100644
index 00000000000..a008b48bff7
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/client_nopasswd.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/examples/Security/Send_File/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.pem -SSLCertificate PEM:client_cert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/examples/Security/Send_File/run_test.pl b/TAO/orbsvcs/examples/Security/Send_File/run_test.pl
new file mode 100755
index 00000000000..b7b2ed47fea
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/run_test.pl
@@ -0,0 +1,52 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use Env (ACE_ROOT);
+
+unshift @INC, "$ACE_ROOT/bin";
+require ACEutils;
+
+$status = 0;
+
+# Set the SSL environment
+$ENV{'SSL_CERT_FILE'} = 'cacert.pem';
+
+$iorfile = "server.ior";
+unlink $iorfile;
+$SV = Process::Create ($EXEPREFIX."server$EXE_EXT ",
+ " -ORBSvcConf server_nopasswd" .
+ "$PerlACE::svcconf_ext " .
+ " -o $iorfile");
+
+if (ACE::waitforfile_timed ($iorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$CL = Process::Create ($EXEPREFIX."client$EXE_EXT ",
+ " -ORBSvcConf client_nopasswd" .
+ "$PerlACE::svcconf_ext " .
+ " -k file://$iorfile < client.cpp");
+
+$client = $CL->TimedWait (60);
+if ($client == -1) {
+ print STDERR "ERROR: client timedout\n";
+ $CL->Kill (); $CL->TimedWait (1);
+ $status = 1;
+}
+
+$server = $SV->TimedWait (15);
+if ($server == -1) {
+ print STDERR "ERROR: server timedout\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ $status = 1;
+}
+
+unlink $iorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/examples/Security/Send_File/server.conf b/TAO/orbsvcs/examples/Security/Send_File/server.conf
new file mode 100644
index 00000000000..e178933feb9
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/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 -SSLNoProtection"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/orbsvcs/examples/Security/Send_File/server.conf.xml b/TAO/orbsvcs/examples/Security/Send_File/server.conf.xml
new file mode 100644
index 00000000000..ffcee284699
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/server.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/examples/Security/Send_File/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/examples/Security/Send_File/server.cpp b/TAO/orbsvcs/examples/Security/Send_File/server.cpp
new file mode 100644
index 00000000000..97a4beace1c
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/server.cpp
@@ -0,0 +1,113 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "test_i.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID(Send_File, server, "$Id$")
+
+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_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;
+
+ 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;
+
+ orb->run (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_OS::sleep (5);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/examples/Security/Send_File/server_cert.pem b/TAO/orbsvcs/examples/Security/Send_File/server_cert.pem
new file mode 100644
index 00000000000..0fc394c24d7
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/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/examples/Security/Send_File/server_key.pem b/TAO/orbsvcs/examples/Security/Send_File/server_key.pem
new file mode 100644
index 00000000000..567a41da6dc
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/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/examples/Security/Send_File/server_key_nopasswd.pem b/TAO/orbsvcs/examples/Security/Send_File/server_key_nopasswd.pem
new file mode 100644
index 00000000000..2381bdcc6df
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/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/examples/Security/Send_File/server_none.conf b/TAO/orbsvcs/examples/Security/Send_File/server_none.conf
new file mode 100644
index 00000000000..e445c19615f
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/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/examples/Security/Send_File/server_none.conf.xml b/TAO/orbsvcs/examples/Security/Send_File/server_none.conf.xml
new file mode 100644
index 00000000000..bb29d1e558d
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/server_none.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/examples/Security/Send_File/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/examples/Security/Send_File/server_nopasswd.conf b/TAO/orbsvcs/examples/Security/Send_File/server_nopasswd.conf
new file mode 100644
index 00000000000..e445c19615f
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/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.pem -SSLCertificate PEM:server_cert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/orbsvcs/examples/Security/Send_File/server_nopasswd.conf.xml b/TAO/orbsvcs/examples/Security/Send_File/server_nopasswd.conf.xml
new file mode 100644
index 00000000000..9e391e67290
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/server_nopasswd.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/examples/Security/Send_File/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.pem -SSLCertificate PEM:server_cert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/examples/Security/Send_File/test.idl b/TAO/orbsvcs/examples/Security/Send_File/test.idl
new file mode 100644
index 00000000000..a62d8becc91
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/test.idl
@@ -0,0 +1,10 @@
+/*
+ * $Id$
+ */
+
+interface Simple_Server
+{
+ void send_line (in string line);
+
+ oneway void shutdown ();
+};
diff --git a/TAO/orbsvcs/examples/Security/Send_File/test_i.cpp b/TAO/orbsvcs/examples/Security/Send_File/test_i.cpp
new file mode 100644
index 00000000000..62d1ff2e04a
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/test_i.cpp
@@ -0,0 +1,24 @@
+// $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 *line
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ 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/examples/Security/Send_File/test_i.h b/TAO/orbsvcs/examples/Security/Send_File/test_i.h
new file mode 100644
index 00000000000..10b18e60116
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/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/examples/Security/Send_File/test_i.i b/TAO/orbsvcs/examples/Security/Send_File/test_i.i
new file mode 100644
index 00000000000..97524552ff4
--- /dev/null
+++ b/TAO/orbsvcs/examples/Security/Send_File/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/examples/examples.mwc b/TAO/orbsvcs/examples/examples.mwc
new file mode 100644
index 00000000000..dd297256b34
--- /dev/null
+++ b/TAO/orbsvcs/examples/examples.mwc
@@ -0,0 +1,5 @@
+// -*- MPC -*-
+// $Id$
+
+workspace {
+}
diff --git a/TAO/orbsvcs/orbsvcs/ATLAS.idl b/TAO/orbsvcs/orbsvcs/ATLAS.idl
new file mode 100644
index 00000000000..c313ef474c6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ATLAS.idl
@@ -0,0 +1,88 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file ATLAS.idl
+ *
+ * $Id$
+ *
+ * IDL for Authorization Token Layer Acquisition Service (ATLAS).
+ *
+ * @author Object Management Group
+ */
+//=============================================================================
+
+
+#ifndef _ATLAS_IDL_
+#define _ATLAS_IDL_
+
+#include <TimeBase.idl>
+#include <CosNaming.idl>
+#include <CSI.idl>
+#include <CSIIOP.idl>
+
+#pragma prefix "omg.org"
+
+module ATLAS {
+ typedef sequence<TimeBase::UtcT, 1> ExpiryTime;
+ typedef sequence<CSI::IdentityToken, 1> IdTokenOption;
+
+ struct AuthTokenData {
+ IdTokenOption ident_token;
+ CSI::AuthorizationToken auth_token;
+ ExpiryTime expiry_time;
+ };
+
+ exception IllegalTokenRequest {
+ unsigned long the_errnum;
+ string the_reason;
+ };
+
+ exception TokenOkay {};
+
+ interface AuthTokenDispenser {
+ AuthTokenData get_my_authorization_token ()
+ raises (IllegalTokenRequest);
+
+ AuthTokenData translate_authorization_token (
+ in CSI::IdentityToken the_subject,
+ in CSI::AuthorizationToken the_token)
+ raises (IllegalTokenRequest,
+ TokenOkay);
+ };
+
+ struct CosNamingLocator {
+ CosNaming::NamingContext name_service;
+ CosNaming::Name the_name;
+ };
+
+ //
+ // This type specifies a string encoded in UTF-8 form [IETF RFC 2044].
+ //
+ typedef sequence<octet> UTF8String;
+ typedef CosNaming::NamingContextExt::URLString URLocator;
+
+ typedef unsigned long ATLASLocatorType;
+
+ const ATLASLocatorType ATLASCosNaming = 1;
+ const ATLASLocatorType ATLASURL = 2;
+ const ATLASLocatorType ATLASObject = 3;
+
+ union ATLASLocator switch (ATLASLocatorType)
+ {
+ case ATLASCosNaming: CosNamingLocator naming_locator;
+ case ATLASURL: URLocator the_url;
+ case ATLASObject: AuthTokenDispenser the_depenser;
+ };
+
+ typedef sequence<octet> ATLASCacheId;
+
+ struct ATLASProfile {
+ ATLASLocator the_locator;
+ ATLASCacheId the_cache_id;
+ };
+
+ const CSIIOP::ServiceConfigurationSyntax SCS_ATLAS = 3;
+};
+
+#endif // _ATLAS_IDL_
diff --git a/TAO/orbsvcs/orbsvcs/AV.mpc b/TAO/orbsvcs/orbsvcs/AV.mpc
new file mode 100644
index 00000000000..1a2b0bdadab
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV.mpc
@@ -0,0 +1,85 @@
+// -*- MPC -*-
+// $Id$
+
+project(AV) : orbsvcslib, core, property_serv, naming, qos, tao_versioning_idl_defaults {
+ avoids += ace_for_tao
+ sharedname = TAO_AV
+ idlflags += -Wb,export_macro=TAO_AV_Export -Wb,export_include=orbsvcs/AV/AV_export.h
+ dynamicflags = TAO_AV_BUILD_DLL
+ tagchecks += AV
+ pch_header =
+ pch_source =
+
+ IDL_Files {
+ AVStreams.idl
+ Null_MediaCtrl.idl
+ sfp.idl
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ AV {
+ AVStreamsC.cpp
+ AVStreamsS.cpp
+ Null_MediaCtrlC.cpp
+ Null_MediaCtrlS.cpp
+ sfpC.cpp
+ sfpS.cpp
+ AV/AVStreams_i.cpp
+ AV/AV_Core.cpp
+ AV/Endpoint_Strategy.cpp
+ AV/Endpoint_Strategy_T.cpp
+ AV/Fill_ACE_QoS.cpp
+ AV/FlowSpec_Entry.cpp
+ AV/Flows_T.cpp
+ AV/MCast.cpp
+ AV/md5c.cpp
+ AV/Policy.cpp
+ AV/Protocol_Factory.cpp
+ AV/QoS_UDP.cpp
+ AV/RTCP.cpp
+ AV/RTCP_Channel.cpp
+ AV/RTCP_Packet.cpp
+ AV/RTP.cpp
+ AV/TCP.cpp
+ AV/Transport.cpp
+ AV/UDP.cpp
+ AV/default_resource.cpp
+ AV/media_timer.cpp
+ AV/sfp.cpp
+ AV/SCTP_SEQ.cpp
+ }
+ }
+
+ Header_Files {
+ AV/AVStreams_i.h
+ AV/AV_Core.h
+ AV/AV_export.h
+ AV/Endpoint_Strategy.h
+ AV/Endpoint_Strategy_T.h
+ AV/Fill_ACE_QoS.h
+ AV/FlowSpec_Entry.h
+ AV/Flows_T.h
+ AV/MCast.h
+ AV/md5.h
+ AV/Policy.h
+ AV/Protocol_Factory.h
+ AV/QoS_UDP.h
+ AV/RTCP.h
+ AV/RTCP_Channel.h
+ AV/RTCP_Packet.h
+ AV/RTP.h
+ AV/Resource_Factory.h
+ AV/UDP.h
+ AV/default_resource.h
+ AV/global.h
+ AV/media_timer.h
+ AV/ntp-time.h
+ AV/sfp.h
+ AV/SCTP_SEQ.h
+ }
+ Template_Files {
+ AV/Endpoint_Strategy_T.cpp
+ AV/Flows_T.cpp
+ }
+
+}
diff --git a/TAO/orbsvcs/orbsvcs/AV.rc b/TAO/orbsvcs/orbsvcs/AV.rc
new file mode 100644
index 00000000000..f781e232026
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "AV\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_AVDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_AV.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp
new file mode 100644
index 00000000000..3b21cf04246
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp
@@ -0,0 +1,5309 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// AVStreams_i.cpp
+//
+// = AUTHOR
+// Sumedh Mungee <sumedh@cs.wustl.edu>
+// Nagarajan Surendran <naga@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/sfp.h"
+#include "orbsvcs/AV/MCast.h"
+#include "orbsvcs/AV/RTCP.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+#include "tao/AnyTypeCode/Any.h"
+#include "ace/OS_NS_arpa_inet.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/AV/AVStreams_i.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (AV,
+ AVStreams_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//------------------------------------------------------------
+// TAO_AV_Qos
+//------------------------------------------------------------
+
+TAO_AV_QoS::TAO_AV_QoS (void)
+{
+}
+
+TAO_AV_QoS::TAO_AV_QoS (AVStreams::streamQoS &stream_qos)
+{
+ this->set (stream_qos);
+}
+
+int
+TAO_AV_QoS::convert (AVStreams::streamQoS &/*network_qos*/)
+{
+ return -1;
+}
+
+
+// ----------------------------------------------------------------------
+// AV_Null_MediaCtrl
+// ----------------------------------------------------------------------
+AV_Null_MediaCtrl::AV_Null_MediaCtrl (void)
+{
+}
+
+AV_Null_MediaCtrl::~AV_Null_MediaCtrl (void)
+{
+}
+
+
+// ----------------------------------------------------------------------
+// TAO_Basic_StreamCtrl
+// ----------------------------------------------------------------------
+
+// Constructor
+TAO_Basic_StreamCtrl::TAO_Basic_StreamCtrl (void)
+ :flow_count_ (0)
+{
+}
+
+
+// Stop the transfer of data of the stream
+// Empty the_spec means apply operation to all flows
+void
+TAO_Basic_StreamCtrl::stop (const AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow))
+{
+ ACE_TRY
+ {
+ // @@Call stop on the Related MediaCtrl. call stop on the flow
+ // connections.
+ if (this->flow_connection_map_.current_size () > 0)
+ {
+ if (flow_spec.length () > 0)
+ for (u_int i=0;i<flow_spec.length ();i++)
+ {
+ char *flowname = TAO_AV_Core::get_flowname (flow_spec[i]);
+ ACE_CString flow_name_key (flowname);
+ AVStreams::FlowConnection_var flow_connection_entry;
+ if (this->flow_connection_map_.find (flow_name_key,
+ flow_connection_entry) == 0)
+ {
+ flow_connection_entry->stop (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ else
+ {
+ // call stop on all the flows.
+ FlowConnection_Map_Iterator iterator (this->flow_connection_map_);
+ FlowConnection_Map_Entry *entry;
+ for (;iterator.next (entry) != 0;iterator.advance ())
+ {
+ entry->int_id_->stop (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Basic_StreamCtrl::stop");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+// Start the transfer of data in the stream.
+// Empty the_spec means apply operation to all flows
+void
+TAO_Basic_StreamCtrl::start (const AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow))
+{
+ ACE_TRY
+ {
+ // @@Call start on the Related MediaCtrl.
+
+ // call start on the flow connections.
+ if (this->flow_connection_map_.current_size () > 0)
+ {
+ if (flow_spec.length () > 0)
+ for (u_int i = 0; i < flow_spec.length (); i++)
+ {
+ char *flowname = TAO_AV_Core::get_flowname (flow_spec[i]);
+ ACE_CString flow_name_key (flowname);
+ FlowConnection_Map::ENTRY *flow_connection_entry = 0;
+ if (this->flow_connection_map_.find (flow_name_key,
+ flow_connection_entry) == 0)
+ {
+ flow_connection_entry->int_id_->start (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ else
+ {
+ // call start on all the flows.
+ FlowConnection_Map_Iterator iterator (this->flow_connection_map_);
+ FlowConnection_Map_Entry *entry = 0;
+ for (;iterator.next (entry) != 0;iterator.advance ())
+ {
+ entry->int_id_->start (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Basic_StreamCtrl::start");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+// Tears down the stream. This will close the connection, and delete
+// the streamendpoint and vdev associated with this stream Empty
+// the_spec means apply operation to all flows
+
+void
+TAO_Basic_StreamCtrl::destroy (const AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow))
+{
+ ACE_TRY
+ {
+ // call stop on the flow connections.
+ if (this->flow_connection_map_.current_size () > 0)
+ {
+ if (flow_spec.length () > 0)
+ {
+ for (u_int i=0;i<flow_spec.length ();i++)
+ {
+ char *flowname = TAO_AV_Core::get_flowname (flow_spec[i]);
+ ACE_CString flow_name_key (flowname);
+ FlowConnection_Map::ENTRY *flow_connection_entry = 0;
+ if (this->flow_connection_map_.find (flow_name_key, flow_connection_entry) == 0)
+ {
+ flow_connection_entry->int_id_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ else
+ {
+ // call destroy on all the flows.
+ FlowConnection_Map_Iterator iterator (this->flow_connection_map_);
+ FlowConnection_Map_Entry *entry = 0;
+ for (;iterator.next (entry) != 0;iterator.advance ())
+ {
+ entry->int_id_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Basic_StreamCtrl::destroy");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+// Changes the QoS associated with the stream
+// Empty the_spec means apply operation to all flows
+CORBA::Boolean
+
+TAO_Basic_StreamCtrl::modify_QoS (AVStreams::streamQoS & /*new_qos*/,
+ const AVStreams::flowSpec &/*flowspec*/
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed))
+{
+ return 1;
+}
+
+// Used by StreamEndPoint and VDev to inform StreamCtrl of events.
+// E.g., loss of flow, reestablishment of flow, etc..
+void
+TAO_Basic_StreamCtrl::push_event (const struct CosPropertyService::Property &/*the_event*/
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "\n(%P|%t) Recieved event \""));
+}
+
+// Sets the flow protocol status.
+void
+TAO_Basic_StreamCtrl::set_FPStatus (const AVStreams::flowSpec &flow_spec,
+ const char *fp_name,
+ const CORBA::Any &fp_settings
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::FPError))
+
+{
+ if (!CORBA::is_nil (this->sep_a_.in ()))
+ {
+ this->sep_a_->set_FPStatus (flow_spec, fp_name, fp_settings ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+// Gets the flow connection.
+CORBA::Object_ptr
+TAO_Basic_StreamCtrl::get_flow_connection (const char *flow_name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::notSupported))
+{
+ ACE_CString flow_name_key (flow_name);
+ AVStreams::FlowConnection_var flow_connection_entry;
+
+ if (this->flow_connection_map_.find (flow_name_key, flow_connection_entry) == 0){
+ return flow_connection_entry._retn();
+ }
+ else{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "(%N,%l) Cannot find flow: %s\n", flow_name ));
+ ACE_THROW_RETURN (AVStreams::noSuchFlow (), CORBA::Object::_nil ());
+ }
+}
+
+// Sets the flow connection.
+void
+TAO_Basic_StreamCtrl::set_flow_connection (const char *flow_name,
+ CORBA::Object_ptr flow_connection_obj
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::notSupported))
+{
+ AVStreams::FlowConnection_var flow_connection;
+ ACE_TRY
+ {
+ flow_connection = AVStreams::FlowConnection::_narrow (flow_connection_obj ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Basic_StreamCtrl::set_flow_connection");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ // add the flowname and the flowconnection to the hashtable.
+ this->flows_.length (this->flow_count_ + 1);
+ this->flows_ [this->flow_count_++] = CORBA::string_dup (flow_name);
+ ACE_CString flow_name_key (flow_name);
+ if (this->flow_connection_map_.bind (flow_name_key, flow_connection) != 0)
+ {
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "(%N,%l) Cannot find flow: %s\n", flow_name ));
+ ACE_THROW (AVStreams::noSuchFlow ());// is this right?
+ }
+}
+
+TAO_Basic_StreamCtrl::~TAO_Basic_StreamCtrl (void)
+{
+}
+
+// ----------------------------------------------------------------------
+// TAO_Negotiator
+// ----------------------------------------------------------------------
+
+CORBA::Boolean
+TAO_Negotiator::negotiate (AVStreams::Negotiator_ptr /* remote_negotiator */,
+ const AVStreams::streamQoS &/* qos_spec */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_Negotiator::negotiate\n"));
+ return 0;
+}
+
+// ----------------------------------------------------------------------
+// MMDevice_Map_Hash_Key
+// ----------------------------------------------------------------------
+
+const int MMDevice_Map_Hash_Key::hash_maximum_ = 10000;
+
+//default constructor.
+MMDevice_Map_Hash_Key::MMDevice_Map_Hash_Key (void)
+{
+ this->mmdevice_ = AVStreams::MMDevice::_nil ();
+}
+
+// constructor.
+MMDevice_Map_Hash_Key::MMDevice_Map_Hash_Key (AVStreams::MMDevice_ptr mmdevice)
+{
+ this->mmdevice_ = AVStreams::MMDevice::_duplicate (mmdevice);
+}
+
+// copy constructor.
+MMDevice_Map_Hash_Key::MMDevice_Map_Hash_Key (const MMDevice_Map_Hash_Key& hash_key)
+{
+ this->mmdevice_ = AVStreams::MMDevice::_duplicate (hash_key.mmdevice_);
+}
+
+// destructor.
+MMDevice_Map_Hash_Key::~MMDevice_Map_Hash_Key (void)
+{
+ CORBA::release (this->mmdevice_);
+}
+
+bool
+MMDevice_Map_Hash_Key::operator == (const MMDevice_Map_Hash_Key &hash_key) const
+{
+ CORBA::Boolean result = 0;
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ result =
+ this->mmdevice_->_is_equivalent (hash_key.mmdevice_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "MMDevice_Map_Hash_Key::operator == ");
+ return false;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (false);
+
+ return result;
+}
+
+bool
+operator < (const MMDevice_Map_Hash_Key &left,
+ const MMDevice_Map_Hash_Key &right)
+{
+ bool result = false;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ const CORBA::ULong left_hash =
+ left.mmdevice_->_hash (left.hash_maximum_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ const CORBA::ULong right_hash =
+ right.mmdevice_->_hash (right.hash_maximum_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ result = left_hash < right_hash;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "operator < for MMDevice_Map_Hash_Key");
+ return false;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (false);
+
+ return result;
+}
+
+u_long
+MMDevice_Map_Hash_Key::hash (void) const
+{
+ u_long result = 0;
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ result = this->mmdevice_->_hash (this->hash_maximum_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "MMDevice_Map_Hash_Key::hash");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return result;
+}
+
+// ----------------------------------------------------------------------
+// TAO_StreamCtrl
+// ----------------------------------------------------------------------
+
+TAO_StreamCtrl::TAO_StreamCtrl (void)
+ :mcastconfigif_ (0)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->streamctrl_ = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ char buf [BUFSIZ];
+ int result = ACE_OS::hostname (buf, BUFSIZ);
+ unsigned long ipaddr = 0;
+ if (result == 0)
+ ipaddr = ACE_OS::inet_addr (buf);
+ this->source_id_ = TAO_AV_RTCP::alloc_srcid (ipaddr);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamCtrl::TAO_StreamCtrl");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+TAO_StreamCtrl::~TAO_StreamCtrl (void)
+{
+ delete this->mcastconfigif_;
+}
+
+
+// Stop the transfer of data of the stream
+// Empty the_spec means apply operation to all flows
+void
+TAO_StreamCtrl::stop (const AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow))
+{
+ ACE_TRY
+ {
+ TAO_Basic_StreamCtrl::stop (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (this->flow_connection_map_.current_size () > 0)
+ return;
+ MMDevice_Map_Iterator a_iterator (this->mmdevice_a_map_);
+ MMDevice_Map::ENTRY *entry = 0;
+ for (;a_iterator.next (entry)!= 0;a_iterator.advance ())
+ {
+ entry->int_id_.sep_->stop (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ MMDevice_Map_Iterator b_iterator (this->mmdevice_b_map_);
+ for (;b_iterator.next (entry)!= 0;b_iterator.advance ())
+ {
+ entry->int_id_.sep_->stop (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Basic_StreamCtrl::stop");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+// Start the transfer of data in the stream.
+// Empty the_spec means apply operation to all flows
+void
+TAO_StreamCtrl::start (const AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow))
+{
+ ACE_TRY
+ {
+ TAO_Basic_StreamCtrl::start (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (this->flow_connection_map_.current_size () > 0)
+ return;
+
+ MMDevice_Map_Iterator a_iterator (this->mmdevice_a_map_);
+ MMDevice_Map::ENTRY *entry = 0;
+ for (;a_iterator.next (entry)!= 0;a_iterator.advance ())
+ {
+ entry->int_id_.sep_->start (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ MMDevice_Map_Iterator b_iterator (this->mmdevice_b_map_);
+ for (;b_iterator.next (entry)!= 0;b_iterator.advance ())
+ {
+ entry->int_id_.sep_->start (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamCtrl::start");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+// Tears down the stream. This will close the connection, and delete
+// the streamendpoint and vdev associated with this stream
+// Empty the_spec means apply operation to all flows
+void
+TAO_StreamCtrl::destroy (const AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow))
+{
+ ACE_TRY
+ {
+ TAO_Basic_StreamCtrl::destroy (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (this->flow_connection_map_.current_size () > 0)
+ return;
+
+ MMDevice_Map_Iterator a_iterator (this->mmdevice_a_map_);
+ MMDevice_Map::ENTRY *entry = 0;
+ for (;a_iterator.next (entry)!= 0;a_iterator.advance ())
+ {
+ entry->int_id_.sep_->destroy (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ MMDevice_Map_Iterator b_iterator (this->mmdevice_b_map_);
+ for (;b_iterator.next (entry)!= 0;b_iterator.advance ())
+ {
+ entry->int_id_.sep_->destroy (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamCtrl::destroy");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ int result = TAO_AV_Core::deactivate_servant (this);
+ if (result < 0)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_StreamCtrl::destroy failed\n"));
+}
+
+// request the two MMDevices to create vdev and stream endpoints. save
+// the references returned.
+
+// The interaction diagram for this method is on page 13 of the spec
+CORBA::Boolean
+TAO_StreamCtrl::bind_devs (AVStreams::MMDevice_ptr a_party,
+ AVStreams::MMDevice_ptr b_party,
+ AVStreams::streamQoS &the_qos,
+ const AVStreams::flowSpec &the_flows
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed))
+{
+ ACE_TRY
+ {
+ if (CORBA::is_nil (a_party) && CORBA::is_nil (b_party))
+ ACE_ERROR_RETURN ((LM_ERROR, "Both parties are nil\n"), 0);
+ // Check to see if we have non-nil parties to bind!
+ if (TAO_debug_level > 0)
+ if (CORBA::is_nil (a_party) ||
+ CORBA::is_nil (b_party))
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) TAO_StreamCtrl::bind_devs: "
+ "a_party or b_party is null"
+ "Multicast mode\n"));
+
+ // Request a_party to create the endpoint and vdev
+ CORBA::Boolean met_qos;
+ CORBA::String_var named_vdev;
+
+ if (!CORBA::is_nil (a_party))
+ {
+ MMDevice_Map_Hash_Key find_key (a_party);
+ MMDevice_Map_Entry find_entry;
+ int result =
+ this->mmdevice_a_map_.find (find_key, find_entry);
+ if (result == 0)
+ {
+ if (TAO_debug_level > 0)
+ {
+ // Already in the map.
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "mmdevice a_party is already bound\n"));
+ }
+ return 1;
+ }
+ else
+ {
+ this->sep_a_ =
+ a_party-> create_A (this->streamctrl_.in (),
+ this->vdev_a_.out (),
+ the_qos,
+ met_qos,
+ named_vdev.inout (),
+ the_flows
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) TAO_StreamCtrl::create_A: succeeded\n"));
+ // Define ourselves as the related_streamctrl property of the sep.
+ CORBA::Any streamctrl_any;
+ streamctrl_any <<= this->streamctrl_.in ();
+ this->sep_a_->define_property ("Related_StreamCtrl",
+ streamctrl_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any vdev_a_any;
+ vdev_a_any <<= this->vdev_a_.in ();
+ this->sep_a_->define_property ("Related_VDev",
+ vdev_a_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any streamendpoint_a_any;
+ streamendpoint_a_any <<= this->sep_a_.in ();
+ this->vdev_a_->define_property ("Related_StreamEndpoint",
+ streamendpoint_a_any
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+ CORBA::Any mmdevice_a_any;
+ mmdevice_a_any <<= a_party;
+ this->vdev_a_->define_property ("Related_MMDevice",
+ mmdevice_a_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // add the mmdevice, sep and vdev to the map.
+ MMDevice_Map_Entry map_entry;
+ MMDevice_Map_Hash_Key key (a_party);
+ map_entry.sep_ = AVStreams::StreamEndPoint_A::_duplicate (this->sep_a_.in ());
+ map_entry.vdev_ = AVStreams::VDev::_duplicate (this->vdev_a_.in ());
+ map_entry.flowspec_ = the_flows;
+ map_entry.qos_ = the_qos;
+ result =
+ this->mmdevice_a_map_.bind (key, map_entry);
+ if (result < 0)
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Error binding mmdevice entry in the a_map"));
+ }
+ }
+ // Request b_party to create the endpoint and vdev
+ if (!CORBA::is_nil (b_party))
+ {
+ MMDevice_Map_Hash_Key find_key (b_party);
+ MMDevice_Map_Entry find_entry;
+ int result =
+ this->mmdevice_b_map_.find (find_key, find_entry);
+ if (result == 0)
+ {
+ // Already in the map.
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "mmdevice b_party is already bound\n"));
+ return 1;
+ }
+ else
+ {
+ this->sep_b_ =
+ b_party-> create_B (this->streamctrl_.in (),
+ this->vdev_b_.out (),
+ the_qos,
+ met_qos,
+ named_vdev.inout (),
+ the_flows
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "(%P|%t) TAO_StreamCtrl::create_B: succeeded\n"));
+
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
+ "\n(%P|%t)stream_endpoint_b_ = %s",
+ TAO_ORB_Core_instance ()->orb ()->object_to_string (this->sep_b_.in ()
+ ACE_ENV_ARG_PARAMETER)));
+ ACE_TRY_CHECK;
+ // Define ourselves as the related_streamctrl property of the sep.
+ CORBA::Any streamctrl_any;
+ streamctrl_any <<= this->streamctrl_.in ();
+ this->sep_b_->define_property ("Related_StreamCtrl",
+ streamctrl_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any vdev_b_any;
+ vdev_b_any <<= this->vdev_b_.in ();
+ this->sep_b_->define_property ("Related_VDev",
+ vdev_b_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any streamendpoint_b_any;
+ streamendpoint_b_any <<= this->sep_b_.in ();
+ this->vdev_b_->define_property ("Related_StreamEndpoint",
+ streamendpoint_b_any
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+ CORBA::Any mmdevice_b_any;
+ mmdevice_b_any <<= b_party;
+ this->vdev_b_->define_property ("Related_MMDevice",
+ mmdevice_b_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ // add the mmdevice, sep and vdev to the map.
+ MMDevice_Map_Entry map_entry;
+ MMDevice_Map_Hash_Key key (b_party);
+ map_entry.sep_ = AVStreams::StreamEndPoint::_duplicate (this->sep_b_.in ());
+ map_entry.vdev_ = AVStreams::VDev::_duplicate(this->vdev_b_.in ());
+ map_entry.flowspec_ = the_flows;
+ map_entry.qos_ = the_qos;
+ int result =
+ this->mmdevice_b_map_.bind (key, map_entry);
+ if (result < 0)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "Error binding mmdevice entry in the b_map"));
+ }
+ }
+
+ // Tell the endpoints about each other.
+ if ((!CORBA::is_nil (a_party)) && (!CORBA::is_nil (b_party)))
+ {
+ CORBA::Any sep_a_peer_any;
+ CORBA::Any sep_b_peer_any;
+
+ sep_a_peer_any <<= this->sep_b_.in();
+ sep_b_peer_any <<= this->sep_a_.in();
+ this->sep_a_->define_property ("PeerAdapter",
+ sep_a_peer_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->sep_b_->define_property ("PeerAdapter",
+ sep_b_peer_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // In the full profile case there's no VDev.
+ if (CORBA::is_nil (b_party) && (!CORBA::is_nil (this->vdev_a_.in ())))
+ {
+ // Now set the source id for this A endpoint.
+ // If the sep contains flow producers then set the source ids for those
+ // instead.
+ ACE_TRY_EX (set_source_id)
+ {
+ CORBA::Any_ptr flows_any = this->sep_a_->get_property_value ("Flows"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (set_source_id);
+ AVStreams::flowSpec_var flows;
+ *flows_any >>= flows.out ();
+ for (CORBA::ULong i=0; i< flows->length ();++i)
+ {
+ CORBA::Object_var fep_obj =
+ this->sep_a_->get_fep (flows [i] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (set_source_id);
+ ACE_TRY_EX (producer_check)
+ {
+ AVStreams::FlowProducer_var producer =
+ AVStreams::FlowProducer::_narrow (fep_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (producer_check);
+ producer->set_source_id (this->source_id_++);
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, " %s ", static_cast<char const*>(flows[i])));
+
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "producer_check: not a producer");
+
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Since the full profile failed try setting the source id
+ // for the sep instead.
+ // @@Naga: What do we do if in the light profile the sep has
+ // many producers who do not have flow interfaces. Then
+ // the streamctrl has to give an array of source ids to
+ // the sep.
+ this->sep_a_->set_source_id (this->source_id_++
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ if (!this->mcastconfigif_)
+ {
+ ACE_NEW_RETURN (this->mcastconfigif_,
+ TAO_MCastConfigIf,
+ 0);
+ // @@: Deactivating the object thru poa means calling remove_ref after _this.
+ this->mcastconfigif_ptr_ = this->mcastconfigif_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ // Multicast source being added.
+ CORBA::Boolean result = this->vdev_a_->set_Mcast_peer (this->streamctrl_.in (),
+ this->mcastconfigif_ptr_.in (),
+ the_qos,
+ the_flows
+ ACE_ENV_ARG_PARAMETER);
+ if (!result)
+ ACE_ERROR_RETURN ((LM_ERROR, "set_Mcast_peer failed\n"), 0);
+ }
+
+ if (CORBA::is_nil (a_party))
+ {
+ if (!CORBA::is_nil (this->vdev_b_.in ()))
+ {
+ // Multicast sink being added.
+ if (!this->mcastconfigif_)
+ ACE_ERROR_RETURN ((LM_ERROR, "first add a source and then a sink\n"), 0);
+ this->mcastconfigif_->set_peer (this->vdev_b_.in (),
+ the_qos,
+ the_flows
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ int connect_leaf_success = 0;
+ ACE_TRY_EX (connect_leaf)
+ {
+ // @@: define null interfaces for Atm so that they can be implemented once
+ // ACE adds support for ATM multicast.
+ connect_leaf_success = this->sep_a_->connect_leaf (this->sep_b_.in (),
+ the_qos,
+ the_flows
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (connect_leaf);
+ connect_leaf_success = 1;
+ }
+ ACE_CATCH (AVStreams::notSupported, ex)
+ {
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "connect_leaf failed\n"));
+ connect_leaf_success = 0;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamCtrl::bind_devs");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ if (!connect_leaf_success)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"TAO_StreamCtrl::bind_devs Multiconnect\n"));
+ AVStreams::flowSpec connect_flows = the_flows;
+ this->sep_a_->multiconnect (the_qos, connect_flows ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->sep_b_->multiconnect (the_qos, connect_flows ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ if (!CORBA::is_nil (a_party) && !CORBA::is_nil (b_party))
+ {
+ // Check to see if the MMDevice contains FDev objects
+ // If it contains FDev objects, then we are using the
+ // Full profile, and we want to call bind() instead
+ // of connect() on the the streamctrl
+ if( a_party->is_property_defined("Flows") &&
+ b_party->is_property_defined("Flows") )
+ {
+ if (TAO_debug_level > 0) {
+ ACE_DEBUG ((LM_DEBUG, "(%N,%l) Full profile, invoking bind()\n"));
+ }
+
+ // It is full profile
+ // we have feps in the sep then dont call connect
+ // instead call bind on the streamctrl.
+ this->bind (this->sep_a_.in (),
+ this->sep_b_.in (),
+ the_qos,
+ the_flows
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+
+ }
+ // This is the light profile, call connect()
+ else if (!CORBA::is_nil (this->vdev_a_.in ()) && !CORBA::is_nil (this->vdev_b_.in ()))
+ {
+ if (TAO_debug_level > 0) {
+ ACE_DEBUG ((LM_DEBUG, "(%N,%l) Light profile, invoking connect()\n"));
+ }
+
+ // Tell the 2 VDev's about one another
+ this->vdev_a_->set_peer (this->streamctrl_.in (),
+ this->vdev_b_.in (),
+ the_qos,
+ the_flows
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+ this->vdev_b_->set_peer (this->streamctrl_.in (),
+ this->vdev_a_.in (),
+ the_qos,
+ the_flows
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+ // Now connect the streams together. This will
+ // establish the connection
+ CORBA::Boolean result =
+ this->sep_a_->connect (this->sep_b_.in (),
+ the_qos,
+ the_flows
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "sep_a->connect (sep_b) failed\n"), 0);
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamCtrl::bind_devs");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return 1;
+}
+
+// Used to establish a connection between two endpoints
+// directly, i.e. without a MMDevice
+CORBA::Boolean
+TAO_StreamCtrl::bind (AVStreams::StreamEndPoint_A_ptr sep_a,
+ AVStreams::StreamEndPoint_B_ptr sep_b,
+ AVStreams::streamQoS &stream_qos,
+ const AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed))
+{
+ this->sep_a_ = AVStreams::StreamEndPoint_A::_duplicate(sep_a);
+ this->sep_b_ = AVStreams::StreamEndPoint_B::_duplicate(sep_b);
+
+ int result = 0;
+ ACE_TRY
+ {
+ if (CORBA::is_nil (sep_a_.in() ) ||
+ CORBA::is_nil (sep_b_.in() ))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) TAO_StreamCtrl::bind:"
+ "a_party or b_party null!"),
+ 0);
+
+ // Define each other as their peers.
+ CORBA::Any sep_any;
+ sep_any <<= sep_b;
+ sep_a_->define_property ("PeerAdapter",
+ sep_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ sep_any <<= sep_a;
+ sep_b_->define_property ("PeerAdapter",
+ sep_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ // since its full profile we do the viable stream setup algorithm.
+ // get the flows for the A streamendpoint.
+ // the flows spec is empty and hence we do a exhaustive match.
+ AVStreams::flowSpec a_flows, b_flows;
+ CORBA::Any_var flows_any;
+ flows_any = sep_a_->get_property_value ("Flows" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ AVStreams::flowSpec *temp_flows;
+ flows_any.in () >>= temp_flows;
+ a_flows = *temp_flows;
+ flows_any = sep_b_->get_property_value ("Flows" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ flows_any.in () >>= temp_flows;
+ b_flows = *temp_flows;
+ u_int i;
+ FlowEndPoint_Map *a_fep_map;
+ FlowEndPoint_Map *b_fep_map;
+ ACE_NEW_RETURN (a_fep_map,
+ FlowEndPoint_Map,
+ 0);
+ ACE_NEW_RETURN (b_fep_map,
+ FlowEndPoint_Map,
+ 0);
+ for (i=0;i<a_flows.length ();i++)
+ {
+ const char *flowname = a_flows[i];
+ // get the flowendpoint references.
+ CORBA::Object_var fep_obj =
+ sep_a_->get_fep (flowname
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ AVStreams::FlowEndPoint_var fep =
+ AVStreams::FlowEndPoint::_narrow (fep_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_CString fep_key (flowname);
+ result = a_fep_map->bind (fep_key, fep);
+ if (result == -1)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_StreamCtrl::bind failed for %s\n", flowname));
+ }
+ // get the flowendpoints for streamendpoint_b
+ for (i=0;i<b_flows.length ();i++)
+ {
+ const char *flowname = b_flows[i];
+ // get the flowendpoint references.
+ CORBA::Object_var fep_obj =
+ sep_b->get_fep (flowname
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ AVStreams::FlowEndPoint_var fep =
+ AVStreams::FlowEndPoint::_narrow (fep_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_CString fep_key (flowname);
+ result = b_fep_map->bind (fep_key, fep);
+ if (result == -1)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_StreamCtrl::bind failed for %s\n", flowname));
+ }
+ FlowEndPoint_Map *map_a = 0, *map_b = 0;
+ if (flow_spec.length () == 0)
+ {
+ map_a = a_fep_map;
+ map_b = b_fep_map;
+ }
+ else
+ {
+ FlowEndPoint_Map *spec_fep_map_a, *spec_fep_map_b;
+ ACE_NEW_RETURN (spec_fep_map_a,
+ FlowEndPoint_Map,
+ 0);
+ ACE_NEW_RETURN (spec_fep_map_b,
+ FlowEndPoint_Map,
+ 0);
+ for (i=0; i< flow_spec.length ();i++)
+ {
+ TAO_Forward_FlowSpec_Entry *entry = 0;
+ ACE_NEW_RETURN (entry,
+ TAO_Forward_FlowSpec_Entry,
+ 0);
+ entry->parse (flow_spec[i]);
+ ACE_CString fep_key (entry->flowname ());
+ AVStreams::FlowEndPoint_var fep;
+ result = a_fep_map->find (fep_key, fep);
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR, "Fep not found on A side for flowname: %s\n", flow_spec[i]), 0);
+
+ result = spec_fep_map_a->bind (fep_key, fep);
+ if (result == -1)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "Bind failed for %s\n", flow_spec[i]));
+
+ result = b_fep_map->find (fep_key, fep);
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR, "Fep not found on B side for flowname: %s\n", flow_spec[i]), 0);
+
+ result = spec_fep_map_b->bind (fep_key, fep);
+ if (result == -1)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "Bind failed for %s\n", flow_spec[i]));
+ }
+ map_a = spec_fep_map_a;
+ map_b = spec_fep_map_b;
+ }
+
+ TAO_AV_QoS qos (stream_qos);
+ // Now go thru the list of flow endpoint and match them.
+ // uses the first match policy.
+ FlowEndPoint_Map_Iterator a_feps_iterator (*map_a);
+ FlowEndPoint_Map_Entry *a_feps_entry, *b_feps_entry;
+ ACE_TRY_EX (flow_connect)
+ {
+
+ for (;a_feps_iterator.next (a_feps_entry) != 0;
+ a_feps_iterator.advance ())
+ {
+ AVStreams::FlowEndPoint_var fep_a = a_feps_entry->int_id_;
+ AVStreams::FlowEndPoint_var connected_to =
+ fep_a->get_connected_fep (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flow_connect);
+
+ if (!CORBA::is_nil (connected_to.in ()))
+ {
+ // Skip this one, it is already connected...
+ continue;
+ }
+
+ FlowEndPoint_Map_Iterator b_feps_iterator (*map_b);
+ for (;b_feps_iterator.next (b_feps_entry) != 0;
+ b_feps_iterator.advance ())
+ {
+ AVStreams::FlowEndPoint_var fep_b = b_feps_entry->int_id_;
+ AVStreams::FlowConnection_var flow_connection;
+
+ AVStreams::FlowEndPoint_var connected_to =
+ fep_b->get_connected_fep (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flow_connect);
+
+ if (!CORBA::is_nil (connected_to.in ()))
+ {
+ // Skip this one, it is already connected...
+ continue;
+ }
+
+ if (fep_a->is_fep_compatible (fep_b.in()
+ ACE_ENV_ARG_PARAMETER) == 1)
+ {
+ ACE_TRY_CHECK_EX (flow_connect);
+ // assume that flow names are same so that we
+ // can use either of them.
+ CORBA::Object_var flow_connection_obj;
+ CORBA::Any_var flowname_any =
+ fep_a->get_property_value ("FlowName"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flow_connect);
+ const char *flowname = 0;
+ flowname_any.in () >>= flowname;
+ ACE_TRY_EX (flow_connection)
+ {
+ flow_connection_obj =
+ this->get_flow_connection (flowname
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flow_connection);
+ flow_connection =
+ AVStreams::FlowConnection::_narrow (flow_connection_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flow_connection);
+ }
+ ACE_CATCHANY
+ {
+ TAO_FlowConnection *flowConnection;
+ ACE_NEW_RETURN (flowConnection,
+ TAO_FlowConnection,
+ 0);
+ flow_connection = flowConnection->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flow_connect);
+ this->set_flow_connection (flowname,
+ flow_connection.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flow_connect);
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ // make sure that a_feps is flow_producer
+ // and b_feps is flow_consumer
+ // There should be a way to find which flow
+ // endpoint is producer and which is
+ // consumer.
+
+ AVStreams::FlowProducer_var producer;
+ AVStreams::FlowConsumer_var consumer;
+
+ ACE_TRY_EX (producer_check)
+ {
+ producer =
+ AVStreams::FlowProducer::_narrow (fep_a.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (producer_check);
+ consumer =
+ AVStreams::FlowConsumer::_narrow (fep_b.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (producer_check);
+
+ // If the types don't match then try in
+ // the opposite order
+ if (CORBA::is_nil (producer.in ()))
+ {
+ producer =
+ AVStreams::FlowProducer::_narrow (fep_b.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (producer_check);
+ consumer =
+ AVStreams::FlowConsumer::_narrow (fep_a.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (producer_check);
+ }
+ // At this point they should both be
+ // non-nil
+ // @@ raise an exception (which one?) if
+ // this is not true...
+ ACE_ASSERT (!CORBA::is_nil (producer.in ()));
+ ACE_ASSERT (!CORBA::is_nil (consumer.in ()));
+ }
+ ACE_CATCHANY
+ {
+ //Yamuna : Recheck this
+ ACE_RE_THROW;//_EX (producer_check);
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ CORBA::String_var fep_a_name, fep_b_name;
+ flowname_any = fep_a->get_property_value ("FlowName"
+ ACE_ENV_ARG_PARAMETER);
+ const char *temp_name;
+ flowname_any.in () >>= temp_name;
+ fep_a_name = CORBA::string_dup (temp_name);
+ flowname_any = fep_b->get_property_value ("FlowName"
+ ACE_ENV_ARG_PARAMETER);
+ flowname_any.in () >>= temp_name;
+ fep_b_name = CORBA::string_dup (temp_name);
+ AVStreams::QoS flow_qos;
+ flow_qos.QoSType = fep_a_name;
+ flow_qos.QoSParams.length (0);
+ result = qos.get_flow_qos (fep_a_name.in (), flow_qos);
+ if (result == -1)
+ {
+ flow_qos.QoSType = fep_b_name;
+ result = qos.get_flow_qos (fep_b_name.in (),
+ flow_qos);
+ if (result == -1 && TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "No QoS Specified for this flow <%s>\n", flowname));
+ }
+ flow_connection->connect (producer.in (),
+ consumer.in (),
+ flow_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flow_connect);
+ }
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_StreamCtrl::bind:flow_connect block");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ }
+ ACE_CATCHANY
+ {
+ // error was thrown because one of the streamendpoints is light profile.
+ // Now connect the streams together
+ this->sep_a_->connect (this->sep_b_.in (),
+ stream_qos,
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return 1;
+}
+
+void
+TAO_StreamCtrl::unbind (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed))
+{
+ ACE_TRY
+ {
+ if (this->flow_connection_map_.current_size () > 0)
+ return;
+
+ AVStreams::flowSpec flow_spec;
+ flow_spec.length(0);
+
+ MMDevice_Map_Iterator a_iterator (this->mmdevice_a_map_);
+ MMDevice_Map::ENTRY *entry = 0;
+ for (;a_iterator.next (entry)!= 0;a_iterator.advance ())
+ {
+ entry->int_id_.sep_->destroy (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ MMDevice_Map_Iterator b_iterator (this->mmdevice_b_map_);
+ for (;b_iterator.next (entry)!= 0;b_iterator.advance ())
+ {
+ entry->int_id_.sep_->destroy (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamCtrl::unbind");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+TAO_StreamCtrl::unbind_party (AVStreams::StreamEndPoint_ptr /* the_ep */,
+ const AVStreams::flowSpec &/* the_spec */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow))
+{
+}
+
+void
+TAO_StreamCtrl::unbind_dev (AVStreams::MMDevice_ptr /* dev */,
+ const AVStreams::flowSpec & /* the_spec */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow))
+{
+}
+
+AVStreams::VDev_ptr
+TAO_StreamCtrl::get_related_vdev (AVStreams::MMDevice_ptr adev,
+ AVStreams::StreamEndPoint_out sep
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed))
+{
+ MMDevice_Map_Hash_Key key (adev);
+ MMDevice_Map_Entry entry;
+ int result = -1;
+ result = this->mmdevice_a_map_.find (key, entry);
+ if (result < 0)
+ {
+ result = this->mmdevice_a_map_.find (key, entry);
+ if (result < 0)
+ return AVStreams::VDev::_nil ();
+ }
+ sep = AVStreams::StreamEndPoint::_duplicate (entry.sep_.in ());
+ return AVStreams::VDev::_duplicate (entry.vdev_.in ());
+}
+
+CORBA::Boolean
+
+TAO_StreamCtrl::modify_QoS (AVStreams::streamQoS &new_qos,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed))
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_StreamCtrl::modify_QoS\n"));
+
+
+ if (this->mcastconfigif_ != 0)
+ {
+ // call modify_Qos on the root VDev which is the mcast configif.
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "Cannot Modify the Qos for multipoint streams\n"));
+ }
+ else
+ {
+ ACE_TRY
+ {
+ AVStreams::flowSpec in_flowspec;
+ AVStreams::flowSpec out_flowspec;
+
+ in_flowspec.length (0);
+ out_flowspec.length (0);
+
+ int in_index = 0;
+ int out_index = 0;
+
+ AVStreams::flowSpec flowspec;
+ if (the_spec.length () == 0)
+ {
+ // Apply modify_qos to all the flows
+ flowspec = this->flows_;
+ MMDevice_Map_Iterator iterator (this->mmdevice_a_map_);
+ MMDevice_Map::ENTRY *entry = 0;
+ for (;iterator.next (entry) != 0;iterator.advance ())
+ {
+ flowspec = entry->int_id_.flowspec_;
+ }
+ }
+ else
+ {
+ flowspec = the_spec;
+ }
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_StreamCtrl::modify_QoS\n"));
+
+
+ for (u_int i=0;i < flowspec.length ();i++)
+ {
+ TAO_Forward_FlowSpec_Entry entry;
+ entry.parse (flowspec [i]);
+ int direction = entry.direction ();
+ if (direction == 0)
+ {
+ in_flowspec.length (in_index + 1);
+ in_flowspec [in_index++] = CORBA::string_dup (entry.entry_to_string ());
+ }
+ else
+ {
+ out_flowspec.length (out_index + 1);
+ out_flowspec [out_index++] = CORBA::string_dup (entry.entry_to_string ());
+ }
+ }
+
+ if (in_flowspec.length () != 0)
+ {
+ this->vdev_a_->modify_QoS (new_qos, in_flowspec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ if (out_flowspec.length () != 0)
+ {
+ this->vdev_b_->modify_QoS (new_qos, out_flowspec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamCtrl::modify_QoS");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ }
+ return 1;
+}
+
+// ----------------------------------------------------------------------
+// TAO_MCastConfigIf
+// ----------------------------------------------------------------------
+
+TAO_MCastConfigIf::TAO_MCastConfigIf (void)
+ :peer_list_iterator_ (peer_list_)
+{
+}
+
+TAO_MCastConfigIf::~TAO_MCastConfigIf (void)
+{
+ //no-op
+}
+
+// In future this should be a multicast message instead of point-to-point unicasts.
+CORBA::Boolean
+TAO_MCastConfigIf::set_peer (CORBA::Object_ptr peer,
+ AVStreams::streamQoS & qos,
+ const AVStreams::flowSpec & flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::QoSRequestFailed,
+ AVStreams::streamOpFailed))
+{
+ ACE_TRY
+ {
+ Peer_Info *info;
+ ACE_NEW_RETURN (info,
+ Peer_Info,
+ 0);
+ info->peer_ = AVStreams::VDev::_narrow (peer ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ info->qos_ = qos;
+ info->flow_spec_ = flow_spec;
+ this->peer_list_.insert_tail (info);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_MCastConfigIf::set_peer");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return 1;
+}
+
+// In future this should be a multicast message instead of point-to-point unicasts.
+void
+TAO_MCastConfigIf::configure (const CosPropertyService::Property & a_configuration
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ Peer_Info *info;
+ ACE_TRY
+ {
+ for (this->peer_list_iterator_.first ();
+ (info = this->peer_list_iterator_.next ()) != 0;
+ this->peer_list_iterator_.advance ())
+ {
+ info->peer_->configure (a_configuration ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_MCastConfigIf::set_configure");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+
+void
+TAO_MCastConfigIf::set_initial_configuration (const CosPropertyService::Properties &initial
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->initial_configuration_ = initial;
+}
+
+// In future this should be a multicast message instead of point-to-point unicasts.
+void
+TAO_MCastConfigIf::set_format (const char * flowName,
+ const char * format_name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported))
+{
+ Peer_Info *info;
+ ACE_TRY
+ {
+ for (this->peer_list_iterator_.first ();
+ (info = this->peer_list_iterator_.next ()) != 0;
+ this->peer_list_iterator_.advance ())
+ {
+ if (this->in_flowSpec (info->flow_spec_, flowName))
+ {
+ info->peer_->set_format (flowName, format_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_MCastConfigIf::set_format");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+// In future this should be a multicast message instead of point-to-point unicasts.
+void
+TAO_MCastConfigIf::set_dev_params (const char * flowName,
+ const CosPropertyService::Properties & new_params
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::PropertyException,
+ AVStreams::streamOpFailed))
+{
+ Peer_Info *info;
+ ACE_TRY
+ {
+
+ for (this->peer_list_iterator_.first ();
+ (info = this->peer_list_iterator_.next ()) != 0;
+ this->peer_list_iterator_.advance ())
+ {
+ if (this->in_flowSpec (info->flow_spec_, flowName))
+ {
+ info->peer_->set_dev_params (flowName, new_params ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_MCastConfigIf::set_dev_params");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+int
+TAO_MCastConfigIf::in_flowSpec (const AVStreams::flowSpec& flow_spec, const char *flow_name)
+{
+ size_t len = ACE_OS::strlen (flow_name);
+ for (CORBA::ULong i = 0; i < flow_spec.length (); i++)
+ if (ACE_OS::strncmp (flow_spec[i], flow_name, len) == 0)
+ {
+ return 1;
+ }
+ return 0;
+}
+
+// ----------------------------------------------------------------------
+// TAO_Base_StreamEndPoint
+// ----------------------------------------------------------------------
+
+TAO_Base_StreamEndPoint::TAO_Base_StreamEndPoint (void)
+ : protocol_object_set_ (0)
+{
+}
+
+TAO_Base_StreamEndPoint::~TAO_Base_StreamEndPoint (void)
+{
+}
+
+int
+TAO_Base_StreamEndPoint::handle_close (void)
+{
+ // This method should not be defined, but EGCS complains endlessly
+ // about it.
+ return -1;
+}
+
+int
+TAO_Base_StreamEndPoint::handle_open (void)
+{
+ return 0;
+}
+
+int
+TAO_Base_StreamEndPoint::handle_stop (const AVStreams::flowSpec &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return 0;
+}
+
+int
+TAO_Base_StreamEndPoint::handle_start (const AVStreams::flowSpec &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return 0;
+}
+
+int
+TAO_Base_StreamEndPoint::handle_destroy (const AVStreams::flowSpec &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return 0;
+}
+
+// The following function is for backward compatibility.
+CORBA::Boolean
+TAO_Base_StreamEndPoint::handle_preconnect (AVStreams::flowSpec &)
+{
+ return 1;
+}
+
+// The following function is for backward compatibility.
+CORBA::Boolean
+TAO_Base_StreamEndPoint::handle_postconnect (AVStreams::flowSpec &)
+{
+
+ while (!this->is_protocol_object_set ())
+ TAO_AV_CORE::instance ()->orb ()->perform_work ();
+ return 1;
+}
+
+// The following function is for backward compatibility.
+CORBA::Boolean
+TAO_Base_StreamEndPoint::handle_connection_requested (AVStreams::flowSpec &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return 1;
+}
+
+int
+TAO_Base_StreamEndPoint::set_protocol_object (const char * /*flowname*/,
+ TAO_AV_Protocol_Object * /*sfp_object*/)
+{
+ return -1;
+}
+
+void
+TAO_Base_StreamEndPoint::protocol_object_set (void)
+{
+ this->protocol_object_set_ = 1;
+}
+
+
+int
+TAO_Base_StreamEndPoint::is_protocol_object_set (void)
+{
+ return this->protocol_object_set_;
+}
+
+int
+TAO_Base_StreamEndPoint::get_callback (const char * /*flowname*/,
+ TAO_AV_Callback *&/*sfp_callback*/)
+{
+ return -1;
+}
+
+int
+TAO_Base_StreamEndPoint::get_control_callback (const char * /*flowname*/,
+ TAO_AV_Callback *&/*sfp_callback*/)
+{
+ return -1;
+}
+
+void
+TAO_Base_StreamEndPoint::set_flow_handler (const char *flowname,
+ TAO_AV_Flow_Handler *handler)
+{
+ if(TAO_debug_level > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%N,%l) TAO_Base_StreamEndPoint::set_flow_handler(), flowname: %s\n", flowname));
+ }
+ ACE_CString flow_name_key (flowname);
+ if (this->flow_handler_map_.bind (flow_name_key, handler) != 0)
+ ACE_ERROR ((LM_ERROR,
+ "Error in storing flow handler\n"));
+}
+
+void
+TAO_Base_StreamEndPoint::set_control_flow_handler (const char *flowname,
+ TAO_AV_Flow_Handler *handler)
+{
+ ACE_CString flow_name_key (flowname);
+ if (this->control_flow_handler_map_.bind (flow_name_key, handler) != 0)
+ ACE_ERROR ((LM_ERROR,
+ "Error in storing control flow handler\n"));
+}
+
+// ----------------------------------------------------------------------
+// TAO_StreamEndPoint
+// ----------------------------------------------------------------------
+
+// constructor.
+
+TAO_StreamEndPoint::TAO_StreamEndPoint (void)
+ :flow_count_ (0),
+ flow_num_ (0),
+ mcast_port_ (ACE_DEFAULT_MULTICAST_PORT+1)
+{
+ //is->mcast_addr_ = ACE_OS::inet_addr (ACE_DEFAULT_MULTICAST_ADDR);
+ this->mcast_addr_.set (ACE_DEFAULT_MULTICAST_ADDR);
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_StreamEndPoint::TAO_StreamEndPoint::mcast_addr = %s", this->mcast_addr_.c_str ()));
+ // this->handle_open ();
+}
+
+
+CORBA::Boolean
+TAO_StreamEndPoint::connect (AVStreams::StreamEndPoint_ptr responder,
+ AVStreams::streamQoS &qos,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed,
+ AVStreams::streamOpFailed))
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "TAO_StreamEndPoint::Connect ()\n"));
+ CORBA::Boolean retv = 0;
+ this->peer_sep_ = AVStreams::StreamEndPoint::_duplicate (responder);
+ ACE_TRY_EX (negotiate)
+ {
+ if (!CORBA::is_nil (this->negotiator_.in ()))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "NEGOTIATOR AVIALABLE\n"));
+
+ CORBA::Any_var negotiator_any = responder->get_property_value ("Negotiator");
+
+ AVStreams::Negotiator_ptr peer_negotiator;
+ negotiator_any.in () >>= peer_negotiator;
+ if (!CORBA::is_nil (peer_negotiator))
+ {
+ CORBA::Boolean result =
+ this->negotiator_->negotiate (peer_negotiator,
+ qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (negotiate);
+ if (!result)
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "TAO_StreamEndPoint::Connect (): negotiate failed\n"));
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamEndPoint::negotiate");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ ACE_TRY_EX (available_protocols)
+ {
+ if (this->protocols_.length () > 0)
+ {
+ // choose protocols based on what the remote endpoint can support.
+ CORBA::Any_var protocols_any =
+ responder->get_property_value ("AvailableProtocols" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (available_protocols);
+ AVStreams::protocolSpec peer_protocols;
+ AVStreams::protocolSpec *temp_protocols;
+ protocols_any.in () >>= temp_protocols;
+ peer_protocols = *temp_protocols;
+ for (u_int i=0;i<peer_protocols.length ();i++)
+ {
+ for (u_int j=0;j<this->protocols_.length ();j++)
+ if (ACE_OS::strcmp (peer_protocols [i],
+ this->protocols_[j]) == 0)
+ {
+ // we'll agree upon the first protocol that matches.
+ this->protocol_ = CORBA::string_dup (peer_protocols [i]);
+ break;
+ }
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "Availableprotocols property not defined\n"));
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ ACE_TRY
+ {
+ AVStreams::streamQoS network_qos;
+ if (qos.length () > 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "QoS is Specified\n"));
+
+ int result = this->translate_qos (qos,
+ network_qos);
+ if (result != 0)
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "QoS translation failed\n"));
+
+ this->qos ().set (network_qos);
+ }
+
+
+ AVStreams::flowSpec flow_spec (the_spec);
+ this->handle_preconnect (flow_spec);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_StreamEndPoint::connect: flow_spec_length = %d\n",
+ flow_spec.length ()));
+ u_int i;
+ for (i=0;i<flow_spec.length ();i++)
+ {
+ TAO_Forward_FlowSpec_Entry *entry = 0;
+ ACE_NEW_RETURN (entry,
+ TAO_Forward_FlowSpec_Entry,
+ 0);
+
+ if (entry->parse (flow_spec[i]) == -1)
+ return 0;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "TAO_StreamEndPoint::Connect: %s\n", entry->entry_to_string ()));
+
+ this->forward_flow_spec_set.insert (entry);
+ }
+
+ int result =TAO_AV_CORE::instance ()->init_forward_flows (this,
+ this->forward_flow_spec_set,
+ TAO_AV_Core::TAO_AV_ENDPOINT_A,
+ flow_spec);
+
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "%N:%l TAO_AV_Core::init_forward_flows failed\n"), 0);
+
+
+ AVStreams::StreamEndPoint_var streamendpoint = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ retv = responder->request_connection (streamendpoint.in (),
+ 0,
+ network_qos,
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "%N:%l request_connection returned %d\n", retv));
+
+ if (retv == 0)
+ return retv;
+ for (i=0;i<flow_spec.length ();i++)
+ {
+ TAO_Reverse_FlowSpec_Entry *entry = 0;
+ ACE_NEW_RETURN (entry,
+ TAO_Reverse_FlowSpec_Entry,
+ 0);
+ if (entry->parse (flow_spec[i]) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Reverse_Flow_Spec_Set::parse failed\n"),
+ 0);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_StreamEndPoint::Connect: Reverse Flow Spec %s\n",
+ entry->entry_to_string ()));
+
+ this->reverse_flow_spec_set.insert (entry);
+ }
+
+ result = TAO_AV_CORE::instance ()->init_reverse_flows (this,
+ this->forward_flow_spec_set,
+ this->reverse_flow_spec_set,
+ TAO_AV_Core::TAO_AV_ENDPOINT_A);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_AV_Core::init_reverse_flows failed\n"),
+ 0);
+
+ // Make the upcall to the app
+ retv = this->handle_postconnect (flow_spec);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamEndPoint::connect");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return retv;
+}
+
+int
+TAO_StreamEndPoint::translate_qos (const AVStreams::streamQoS& application_qos,
+ AVStreams::streamQoS& network_qos)
+{
+ u_int len = application_qos.length ();
+ network_qos.length (len);
+ for (u_int i=0;i<len;i++)
+ {
+ network_qos [i].QoSType = application_qos [i].QoSType;
+ network_qos [i].QoSParams = application_qos [i].QoSParams;
+ }
+ return 0;
+}
+
+// Stop the physical flow of data on the stream
+// Empty the_spec --> apply to all flows
+
+void
+TAO_StreamEndPoint::stop (const AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow))
+{
+ // Make the upcall into the app
+ this->handle_stop (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (flow_spec.length () > 0)
+ {
+
+ for (u_int i=0;i<flow_spec.length ();i++)
+ {
+ TAO_AV_FlowSpecSetItor end = this->forward_flow_spec_set.end ();
+ for (TAO_AV_FlowSpecSetItor begin = this->forward_flow_spec_set.begin ();
+ begin != end; ++begin)
+ {
+ TAO_Forward_FlowSpec_Entry entry;
+ entry.parse (flow_spec[i]);
+ if (ACE_OS::strcmp ((*begin)->flowname (), entry.flowname ()) == 0)
+ {
+ TAO_FlowSpec_Entry *entry = *begin;
+ // (*begin)->protocol_object ()->stop ();
+ if (entry->handler() != 0)
+ entry->handler ()->stop (entry->role ());
+ if (entry->control_handler () != 0)
+ entry->control_handler ()->stop (entry->role ());
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ TAO_AV_FlowSpecSetItor end = this->forward_flow_spec_set.end ();
+ for (TAO_AV_FlowSpecSetItor begin = this->forward_flow_spec_set.begin ();
+ begin != end; ++begin)
+ {
+ TAO_FlowSpec_Entry *entry = *begin;
+ // entry->protocol_object ()->stop ();
+ if (entry->handler() != 0)
+ entry->handler ()->stop (entry->role ());
+ if (entry->control_handler () != 0)
+ entry->control_handler ()->stop (entry->role ());
+ }
+ }
+}
+
+// Start the physical flow of data on the stream
+// Empty the_spec --> apply to all flows
+void
+TAO_StreamEndPoint::start (const AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow))
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_StreamEndPoint::start\n"));
+ // Make the upcall into the app
+ this->handle_start (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (flow_spec.length () > 0)
+ {
+ // Now call start on all the flow handlers.
+ for (u_int i=0;i<flow_spec.length ();i++)
+ {
+ TAO_AV_FlowSpecSetItor end = this->forward_flow_spec_set.end ();
+ for (TAO_AV_FlowSpecSetItor forward_begin = this->forward_flow_spec_set.begin ();
+ forward_begin != end; ++forward_begin)
+ {
+ TAO_FlowSpec_Entry *entry = *forward_begin;
+ if (ACE_OS::strcmp (entry->flowname (), flow_spec [i]) == 0)
+ {
+ // entry->protocol_object ()->start ();
+ if (entry->handler () != 0)
+ {
+ entry->handler ()->start (entry->role ());
+ }
+ if (entry->control_handler () != 0)
+ {
+ entry->control_handler ()->start (entry->role ());
+ }
+ }
+ }
+
+ end = this->reverse_flow_spec_set.end ();
+ for (TAO_AV_FlowSpecSetItor reverse_begin = this->reverse_flow_spec_set.begin ();
+ reverse_begin != end; ++reverse_begin)
+ {
+ TAO_FlowSpec_Entry *entry = *reverse_begin;
+ if (ACE_OS::strcmp (entry->flowname (), flow_spec [i]) == 0)
+ {
+ // entry->protocol_object ()->start ();
+ if (entry->handler () != 0)
+ {
+ entry->handler ()->start (entry->role ());
+ }
+ if (entry->control_handler () != 0)
+ {
+ entry->control_handler ()->start (entry->role ());
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ TAO_AV_FlowSpecSetItor end = this->forward_flow_spec_set.end ();
+ for (TAO_AV_FlowSpecSetItor forwardbegin = this->forward_flow_spec_set.begin ();
+ forwardbegin != end; ++forwardbegin)
+ {
+ TAO_FlowSpec_Entry *entry = *forwardbegin;
+ if (entry->handler () != 0)
+ {
+ entry->handler ()->start (entry->role ());
+ }
+ if (entry->control_handler () != 0)
+ {
+ entry->control_handler ()->start (entry->role ());
+ }
+ }
+
+ end = this->reverse_flow_spec_set.end ();
+ for (TAO_AV_FlowSpecSetItor reversebegin = this->reverse_flow_spec_set.begin ();
+ reversebegin != end; ++reversebegin)
+ {
+ TAO_FlowSpec_Entry *entry = *reversebegin;
+ // entry->protocol_object ()->start ();
+ if (entry->handler () != 0)
+ {
+ entry->handler ()->start (entry->role ());
+ }
+ if (entry->control_handler () != 0)
+ {
+ entry->control_handler ()->start (entry->role ());
+ }
+ }
+ }
+}
+
+// Close the connection
+void
+TAO_StreamEndPoint::destroy (const AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow))
+{
+ CORBA::Any_var vdev_any = this->get_property_value ("Related_VDev"
+ ACE_ENV_ARG_PARAMETER);
+
+ AVStreams::VDev_ptr vdev;
+
+ vdev_any.in() >>= vdev;
+ CORBA::Any_var mc_any = vdev->get_property_value ("Related_MediaCtrl"
+ ACE_ENV_ARG_PARAMETER);
+
+ // The Related_MediaCtrl property was inserted as a CORBA::Object, so we
+ // must extract it as the same type.
+ CORBA::Object_var obj;
+ mc_any.in() >>= CORBA::Any::to_object( obj.out() );
+
+ AVStreams::MediaControl_var media_ctrl =
+ AVStreams::MediaControl::_narrow( obj.in() );
+
+ // deactivate the associated vdev and media ctrl
+
+ if ( !CORBA::is_nil( vdev ) )
+ {
+ PortableServer::ServantBase_var vdev_servant =
+ TAO_AV_CORE::instance()->poa()->reference_to_servant ( vdev );
+ TAO_AV_Core::deactivate_servant (vdev_servant.in());
+ }
+
+ if ( !CORBA::is_nil ( media_ctrl.in () ) )
+ {
+ PortableServer::ServantBase_var mc_servant =
+ TAO_AV_CORE::instance()->poa()->reference_to_servant (media_ctrl.in());
+ TAO_AV_Core::deactivate_servant (mc_servant.in());
+ }
+
+ int result = TAO_AV_Core::deactivate_servant (this);
+ if (result < 0)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_StreamEndPoint::destroy failed\n"));
+
+ if (flow_spec.length () > 0)
+ {
+ for (u_int i=0;i<flow_spec.length ();i++)
+ {
+ {
+ TAO_AV_FlowSpecSetItor end = this->forward_flow_spec_set.end ();
+ for (TAO_AV_FlowSpecSetItor begin = this->forward_flow_spec_set.begin ();
+ begin != end; ++begin)
+ {
+ TAO_FlowSpec_Entry *entry = *begin;
+ TAO_Tokenizer flow_name (flow_spec [i], '\\');
+ if (ACE_OS::strcmp (entry->flowname (), flow_name[0]) == 0)
+ {
+ if (entry->protocol_object ())
+ {
+ entry->protocol_object ()->destroy ();
+ }
+ break;
+ }
+ }
+ }
+ {
+ TAO_AV_FlowSpecSetItor end = this->reverse_flow_spec_set.end ();
+ for (TAO_AV_FlowSpecSetItor begin = this->reverse_flow_spec_set.begin ();
+ begin != end; ++begin)
+ {
+ TAO_FlowSpec_Entry *entry = *begin;
+ TAO_Tokenizer flow_name (flow_spec [i], '\\');
+ if (ACE_OS::strcmp (entry->flowname (), flow_name[0]) == 0)
+ {
+ if (entry->protocol_object ())
+ {
+ entry->protocol_object ()->destroy ();
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ {
+ TAO_AV_FlowSpecSetItor end = this->forward_flow_spec_set.end ();
+ for (TAO_AV_FlowSpecSetItor begin = this->forward_flow_spec_set.begin ();
+ begin != end; ++begin)
+ {
+ TAO_FlowSpec_Entry *entry = *begin;
+ if (entry->protocol_object ())
+ {
+ entry->protocol_object ()->stop ();
+
+ ACE_CString control_flowname =
+ TAO_AV_Core::get_control_flowname (entry->flowname ());
+ TAO_AV_CORE::instance()->remove_acceptor(entry->flowname());
+ TAO_AV_CORE::instance()->remove_acceptor(control_flowname.c_str());
+
+ entry->protocol_object ()->destroy ();
+ }
+ }
+ }
+ {
+ TAO_AV_FlowSpecSetItor end = this->reverse_flow_spec_set.end ();
+ for (TAO_AV_FlowSpecSetItor begin = this->reverse_flow_spec_set.begin ();
+ begin != end; ++begin)
+ {
+ TAO_FlowSpec_Entry *entry = *begin;
+ if (entry->protocol_object ())
+ {
+ entry->protocol_object ()->stop ();
+
+ ACE_CString control_flowname =
+ TAO_AV_Core::get_control_flowname (entry->flowname ());
+ TAO_AV_CORE::instance()->remove_connector(entry->flowname());
+ TAO_AV_CORE::instance()->remove_connector(control_flowname.c_str());
+ entry->protocol_object ()->destroy ();
+
+ }
+ }
+ }
+ }
+
+ // Make the upcall into the app
+ // this->handle_destroy (the_spec ACE_ENV_ARG_PARAMETER);
+ //
+}
+
+// Called by our peer endpoint, requesting us to establish
+// a connection
+CORBA::Boolean
+TAO_StreamEndPoint::request_connection (AVStreams::StreamEndPoint_ptr /*initiator*/,
+ CORBA::Boolean /*is_mcast*/,
+ AVStreams::streamQoS &qos,
+ AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpDenied,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed,
+ AVStreams::FPError))
+
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "\n(%P|%t) TAO_StreamEndPoint::request_connection called"));
+
+ int result = 0;
+ ACE_TRY
+ {
+ AVStreams::streamQoS network_qos;
+ if (qos.length () > 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "QoS is Specified\n"));
+
+ int result = this->translate_qos (qos, network_qos);
+ if (result != 0)
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "QoS translation failed\n"));
+
+ this->qos ().set (network_qos);
+ }
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "\n(%P|%t) TAO_StreamEndPoint::request_connection: "
+ "flowspec has length = %d and the strings are:\n",
+ flow_spec.length ()));
+ CORBA::ULong i;
+
+ for (i=0;i<flow_spec.length ();i++)
+ {
+ TAO_Forward_FlowSpec_Entry *entry = 0;
+ ACE_NEW_RETURN (entry,
+ TAO_Forward_FlowSpec_Entry,
+ 0);
+
+ CORBA::String_var string_entry = CORBA::string_dup (flow_spec[i]);
+
+ if(TAO_debug_level > 0)
+ ACE_DEBUG(( LM_DEBUG,
+ "%N:%l Parsing flow spec: [%s]\n",
+ string_entry.in ()));
+
+ if (entry->parse (string_entry.in ()) == -1)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "%N:%l Error parsing flow_spec: [%s]\n",
+ string_entry.in ()));
+ return 0;
+ }
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_StreamEndPoint::request_connection flow spec [%s]\n",
+ entry->entry_to_string ()));
+
+ this->forward_flow_spec_set.insert (entry);
+ }
+
+ result = TAO_AV_CORE::instance ()->init_forward_flows (this,
+ this->forward_flow_spec_set,
+ TAO_AV_Core::TAO_AV_ENDPOINT_B,
+ flow_spec);
+
+ if (result < 0)
+ return 0;
+
+ // Make the upcall to the app
+ result = this->handle_connection_requested (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_StreamEndpoint::request_connection");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return result;
+}
+
+int
+TAO_StreamEndPoint::change_qos (AVStreams::streamQoS &new_qos,
+ const AVStreams::flowSpec &the_flows
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_StreamEndPoint::change_qos\n"));
+
+ TAO_AV_QoS qos (new_qos);
+ for (int i = 0; (unsigned) i < the_flows.length (); i++)
+ {
+ TAO_Forward_FlowSpec_Entry entry;
+ entry.parse (the_flows [i]);
+ ACE_CString flow_name_key (entry.flowname ());
+ Flow_Handler_Map_Entry *handler_entry;
+ if (this->flow_handler_map_.find (flow_name_key,
+ handler_entry) == 0)
+ {
+ AVStreams::QoS flow_qos;
+ if (qos.get_flow_qos (entry.flowname (), flow_qos) != 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "New QoS for the flow %s is not specified\n",
+ entry.flowname ()));
+ int result;
+ result = handler_entry->int_id_->change_qos (flow_qos);
+ if (result != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Modifying QoS Failed\n"),
+ -1);
+
+ }
+ }
+ return 0;
+}
+
+// Refers to modification of transport QoS.
+CORBA::Boolean
+TAO_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))
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_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;
+
+}
+
+// Sets the list of protocols this streamendpoint can understand.
+
+CORBA::Boolean
+TAO_StreamEndPoint::set_protocol_restriction (const AVStreams::protocolSpec &protocols
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ CORBA::Any protocol_restriction_any;
+
+ protocol_restriction_any <<= protocols;
+ this->define_property ("ProtocolRestriction",
+ protocol_restriction_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->protocols_ = protocols;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamEndPoint::set_protocol_restriction");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return 1;
+}
+
+
+void
+TAO_StreamEndPoint::disconnect (const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::streamOpFailed))
+{
+ ACE_UNUSED_ARG (the_spec);
+}
+
+// Sets the status of the flow protocol.
+
+void
+TAO_StreamEndPoint::set_FPStatus (const AVStreams::flowSpec &/*the_spec*/,
+ const char *fp_name,
+ const CORBA::Any &fp_settings
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::FPError))
+{
+ if (ACE_OS::strcmp (fp_name, "SFP1.0") != 0)
+ return;
+ fp_settings >>= this->sfp_status_;
+ // @@Naga: We should call set_FPStatus on all the protocol objects.
+}
+
+
+CORBA::Object_ptr
+TAO_StreamEndPoint::get_fep (const char *flow_name
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::noSuchFlow))
+{
+ ACE_CString fep_name_key (flow_name);
+ AVStreams::FlowEndPoint_var fep_entry;
+ if (this->fep_map_.find (fep_name_key, fep_entry) == 0)
+ return fep_entry._retn();
+ return 0;
+}
+
+char*
+TAO_StreamEndPoint::add_fep_i_add_property (AVStreams::FlowEndPoint_ptr fep
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::streamOpFailed))
+{
+ ACE_CString flow_name;
+
+ ACE_TRY
+ {
+ // exception implies the flow name is not defined and is system
+ // generated.
+ flow_name = "flow";
+ char tmp[255];
+ ACE_OS::sprintf (tmp, "%u", this->flow_num_++);
+ flow_name += tmp;
+
+ CORBA::Any flowname_any;
+ flowname_any <<= flow_name.c_str ();
+ fep->define_property ("Flow",
+ flowname_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_StreamEndPoint::add_fep");
+ return 0;
+ }
+ ACE_ENDTRY;
+ return ACE_OS::strdup( flow_name.c_str () );
+}
+
+char*
+TAO_StreamEndPoint::add_fep_i (AVStreams::FlowEndPoint_ptr fep
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::streamOpFailed))
+{
+ CORBA::String_var flow_name;
+ ACE_TRY
+ {
+ CORBA::Any_var flow_name_any =
+ fep->get_property_value ("FlowName" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ const char *tmp;
+ flow_name_any >>= tmp;
+ flow_name = CORBA::string_dup (tmp);
+ }
+ ACE_CATCHANY
+ {
+ flow_name =
+ this->add_fep_i_add_property (fep ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ ACE_ENDTRY;
+ return flow_name._retn ();
+}
+
+char *
+TAO_StreamEndPoint::add_fep (CORBA::Object_ptr fep_obj
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::streamOpFailed))
+{
+ AVStreams::FlowEndPoint_var fep =
+ AVStreams::FlowEndPoint::_narrow (fep_obj ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::String_var flow_name =
+ this->add_fep_i (fep.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ACE_TRY
+ {
+ fep->lock (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ // Add it to the sequence of flowNames supported.
+ // put the flowname and the flowendpoint in a hashtable.
+ ACE_CString fep_name_key (CORBA::string_dup (flow_name.in ()));
+ if (this->fep_map_.bind (fep_name_key, AVStreams::FlowEndPoint::_duplicate (fep.in ())) != 0)
+ {
+ ACE_THROW_RETURN (AVStreams::streamOpFailed (), 0);
+ }
+ // increment the flow count.
+ this->flow_count_++;
+ this->flows_.length (this->flow_count_);
+ this->flows_[this->flow_count_-1] = flow_name;
+ // define/modify the "Flows" property.
+ CORBA::Any flows_any;
+ flows_any <<= this->flows_;
+ this->define_property ("Flows",
+ flows_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamEndPoint::add_fep");
+ return 0;
+ }
+ ACE_ENDTRY;
+ return flow_name._retn ();
+}
+
+
+void
+TAO_StreamEndPoint::remove_fep (const char *flow_name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::streamOpFailed))
+{
+ ACE_TRY
+ {
+ ACE_CString fep_name_key (flow_name);
+ AVStreams::FlowEndPoint_var fep_entry;
+ // Remove the fep from the hash table.
+ if (this->fep_map_.unbind (fep_name_key, fep_entry)!= 0)
+ ACE_THROW (AVStreams::streamOpFailed ());
+ // redefine the "Flows" property
+ AVStreams::flowSpec new_flows (this->flows_.length ());
+ for (u_int i=0, j=0 ; i <this->flows_.length (); i++)
+ if (ACE_OS::strcmp (flow_name, this->flows_[i]) != 0)
+ new_flows[j++] = this->flows_[i];
+
+ CORBA::Any flows;
+ flows <<= new_flows;
+ this->flows_ = new_flows;
+ this->define_property ("Flows",
+ flows
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamEndPoint::remove_fep");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+// Sets the negotiator object.
+void
+TAO_StreamEndPoint::set_negotiator (AVStreams::Negotiator_ptr new_negotiator
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ CORBA::Any negotiator;
+ negotiator <<= new_negotiator;
+ this->define_property ("Negotiator",
+ negotiator
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->negotiator_ = AVStreams::Negotiator::_duplicate (new_negotiator);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamEndPoint::set_negotiator");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+
+// Sets the public key used for this streamendpoint.
+void
+TAO_StreamEndPoint::set_key (const char *flow_name,
+ const AVStreams::key & the_key
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ this->key_ = the_key;
+ CORBA::Any PublicKey;
+ PublicKey <<= the_key;
+ char PublicKey_property [BUFSIZ];
+ ACE_OS::sprintf (PublicKey_property, "%s_PublicKey", flow_name);
+ this->define_property (PublicKey_property,
+ PublicKey
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamEndPoint::set_key");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+// Set the source id.
+void
+TAO_StreamEndPoint::set_source_id (CORBA::Long source_id
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->source_id_ = source_id;
+}
+
+CORBA::Boolean
+TAO_StreamEndPoint::multiconnect (AVStreams::streamQoS &/*the_qos*/,
+ AVStreams::flowSpec &/*flow_spec*/
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "TAO_StreamEndPoint::multiconnect\n"));
+ return 0;
+}
+
+TAO_StreamEndPoint::~TAO_StreamEndPoint (void)
+{
+ //this->handle_close ();
+ TAO_AV_FlowSpecSetItor begin = this->forward_flow_spec_set.begin ();
+ TAO_AV_FlowSpecSetItor end = this->forward_flow_spec_set.end ();
+
+ int i=0;
+ // @@ Naga: Will the iterator always give the entries in the order of insertion.
+ // or is it an implementation fact of ACE containers.
+ for ( ; begin != end; ++begin, ++i)
+ {
+// if (i >= FLOWSPEC_MAX)
+// {
+ TAO_FlowSpec_Entry *entry = *begin;
+ delete entry;
+ // }
+ }
+ begin = this->reverse_flow_spec_set.begin ();
+ end = this->reverse_flow_spec_set.end ();
+ i = 0;
+ for (; begin != end; ++begin)
+ {
+// if (i >= FLOWSPEC_MAX)
+// {
+ TAO_FlowSpec_Entry *entry = *begin;
+ delete entry;
+ // }
+ }
+}
+
+
+// ----------------------------------------------------------------------
+// TAO_StreamEndPoint_A
+// ----------------------------------------------------------------------
+
+TAO_StreamEndPoint_A::TAO_StreamEndPoint_A (void)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "(%P|%t) TAO_StreamEndPoint_A::TAO_StreamEndPoint_A: created\n"));
+}
+
+// IP Multicast style connect.
+CORBA::Boolean
+TAO_StreamEndPoint_A::multiconnect (AVStreams::streamQoS &stream_qos,
+ AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed,
+ AVStreams::streamOpFailed))
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_StreamEndPointA::multiconnect\n"));
+ ACE_TRY
+ {
+ int result = 0;
+ TAO_AV_QoS qos (stream_qos);
+ for (u_int i=0;i< flow_spec.length ();i++)
+ {
+ TAO_Forward_FlowSpec_Entry *forward_entry = 0;
+ ACE_NEW_RETURN (forward_entry,
+ TAO_Forward_FlowSpec_Entry,
+ 0);
+ forward_entry->parse (flow_spec[i]);
+ ACE_CString mcast_key (forward_entry->flowname ());
+ AVStreams::FlowEndPoint_var flow_endpoint;
+
+ // @@Naga: There is a problem in the full profile case for multiconnect. Since
+ // multiconnect on sep_a is called everytime a sink is added and if called for
+ // the same flow twice, the following code will just call add producer on the flow connection.
+ // It is however very hard to find out if the flow producer is already in the flow connection
+ // since comparing object references will not work and the flowproducer reference is
+ // generated by _narrow. Our only hope is that _narrow on the same fep will return the same
+ // pointer for the flowproducer in which case we can find out if the flowproducer exists in
+ // fep set for that flowconnection.
+ if (this->fep_map_.find (mcast_key, flow_endpoint) == 0)
+ {
+ ACE_TRY_EX (narrow)
+ {
+ AVStreams::QoS flow_qos;
+ result = qos.get_flow_qos (forward_entry->flowname (), flow_qos);
+ if (result < 0)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "QoS not found for %s\n", forward_entry->flowname ()));
+ // Narrow it to FlowProducer.
+ AVStreams::FlowProducer_var producer;
+ producer = AVStreams::FlowProducer::_narrow (flow_endpoint.in() ACE_ENV_ARG_PARAMETER);
+ //
+ ACE_TRY_CHECK_EX (narrow);
+ // Else narrow succeeeded.
+ if (!CORBA::is_nil (producer.in ()))
+ {
+ AVStreams::FlowConnection_var flow_connection;
+ ACE_TRY_EX (flow_connection)
+ {
+ if (CORBA::is_nil (this->streamctrl_.in ()))
+ {
+ CORBA::Any_var streamctrl_any;
+ streamctrl_any = this->get_property_value ("Related_StreamCtrl"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ AVStreams::StreamCtrl_ptr streamctrl;
+ streamctrl_any.in () >>= streamctrl;
+ this->streamctrl_ = AVStreams::StreamCtrl::_duplicate (streamctrl);
+ }
+
+ CORBA::Object_var flow_connection_obj =
+ this->streamctrl_->get_flow_connection (forward_entry->flowname ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flow_connection);
+ flow_connection = AVStreams::FlowConnection::_narrow (flow_connection_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flow_connection);
+ }
+ ACE_CATCHANY
+ {
+ TAO_FlowConnection *flowConnection;
+ ACE_NEW_RETURN (flowConnection,
+ TAO_FlowConnection,
+ 0);
+ //@@ Strategize the multicast address allocation.
+ flowConnection->set_mcast_addr (this->mcast_addr_, this->mcast_port_);
+ this->mcast_port_++;
+ flowConnection->set_protocol (forward_entry->carrier_protocol_str ());
+ flow_connection = flowConnection->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->streamctrl_->set_flow_connection (forward_entry->flowname (),
+ flow_connection.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ if (ACE_OS::strcmp (forward_entry->flow_protocol_str (), "") != 0)
+ {
+ CORBA::Any fp_settings;
+ flow_connection->use_flow_protocol (forward_entry->flow_protocol_str (),
+ fp_settings
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ result = flow_connection->add_producer (producer.in (),
+ flow_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "TAO_StreamEndPoint_A::multiconnect: add_producer failed\n"), 0);
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Narrow failed and since its not a flowproducer its an error.
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "FlowProducer::_narrow");
+ ACE_ERROR_RETURN ((LM_ERROR, "sep_a doesn't contain a flowproducer"), 0);
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ }
+ else
+ {
+ ACE_INET_Addr *mcast_addr;
+ TAO_FlowSpec_Entry *entry = 0;
+ result = this->mcast_entry_map_.find (mcast_key, entry);
+ if (result == 0)
+ {
+ mcast_addr = dynamic_cast<ACE_INET_Addr *> (entry->address ());
+ char str_addr [BUFSIZ];
+ result = mcast_addr->addr_to_string (str_addr, BUFSIZ);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "TAO_StreamEndPointA::multiconnect ::addr_to_string failed\n"), 0);
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_StreamEndPoint_A::multiconnect:%s\n", str_addr));
+ TAO_Forward_FlowSpec_Entry new_entry (entry->flowname (),
+ entry->direction_str (),
+ entry->format (),
+ entry->flow_protocol_str (),
+ entry->carrier_protocol_str (),
+ entry->address ());
+ flow_spec[i] = CORBA::string_dup (new_entry.entry_to_string ());
+ }
+ else
+ {
+
+ switch (forward_entry->direction ())
+ {
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_IN:
+ {
+ ACE_NEW_RETURN (mcast_addr,
+ ACE_INET_Addr,
+ 0);
+ mcast_addr->set (this->mcast_port_, this->mcast_addr_.c_str ());
+ this->mcast_port_++;
+ char buf[BUFSIZ];
+ mcast_addr->addr_to_string (buf, BUFSIZ);
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "%s\n", buf));
+ TAO_Forward_FlowSpec_Entry *new_entry;
+ ACE_NEW_RETURN (new_entry,
+ TAO_Forward_FlowSpec_Entry (forward_entry->flowname (),
+ forward_entry->direction_str (),
+ forward_entry->format (),
+ forward_entry->flow_protocol_str (),
+ forward_entry->carrier_protocol_str (),
+ mcast_addr),
+ 0);
+ flow_spec[i] = CORBA::string_dup (new_entry->entry_to_string ());
+ //new_entry->is_multicast (1);
+
+ this->forward_flow_spec_set.insert (new_entry);
+ TAO_AV_Acceptor_Registry *acceptor_registry = TAO_AV_CORE::instance ()->acceptor_registry ();
+ result = acceptor_registry->open (this,
+ TAO_AV_CORE::instance (),
+ this->forward_flow_spec_set);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "Acceptor_Registry::open failed\n"), 0);
+ result = this->mcast_entry_map_.bind (mcast_key, new_entry);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "mcast_entry::bind failed"), 0);
+ }
+ break;
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
+ // OUT implies we're the sink.
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamEndPoint_A::multiconnect");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return 1;
+}
+
+// ATM style Multicast is not supported yet.
+CORBA::Boolean
+TAO_StreamEndPoint_A::connect_leaf (AVStreams::StreamEndPoint_B_ptr /* the_ep */,
+ AVStreams::streamQoS & /* the_qos */,
+ const AVStreams::flowSpec & /* the_flows */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed,
+ AVStreams::notSupported))
+{
+ ACE_THROW_RETURN (AVStreams::notSupported (), 0);
+}
+
+// Multicast not supported yet.
+void
+TAO_StreamEndPoint_A::disconnect_leaf (AVStreams::StreamEndPoint_B_ptr /* the_ep */,
+ const AVStreams::flowSpec & /* theSpec */
+ ACE_ENV_ARG_DECL)
+
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow,
+ AVStreams::notSupported))
+{
+
+ ACE_THROW (AVStreams::notSupported ());
+
+}
+
+TAO_StreamEndPoint_A::~TAO_StreamEndPoint_A (void)
+{
+}
+
+// ----------------------------------------------------------------------
+// TAO_StreamEndPoint_B
+// ----------------------------------------------------------------------
+
+TAO_StreamEndPoint_B::TAO_StreamEndPoint_B (void)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
+ "\n(%P|%t) TAO_StreamEndPoint_B::TAO_StreamEndPoint_B: created"));
+}
+
+CORBA::Boolean
+TAO_StreamEndPoint_B::multiconnect (AVStreams::streamQoS &stream_qos,
+ AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed,
+ AVStreams::FPError))
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_StreamEndPoint_B::multiconnect\n"));
+ ACE_TRY
+ {
+ int result = 0;
+ TAO_AV_QoS qos (stream_qos);
+ for (u_int i=0;i< flow_spec.length ();i++)
+ {
+ TAO_Forward_FlowSpec_Entry *forward_entry;
+ ACE_NEW_RETURN (forward_entry,
+ TAO_Forward_FlowSpec_Entry,
+ 0);
+ forward_entry->parse (flow_spec[i]);
+ ACE_CString mcast_key (forward_entry->flowname ());
+ AVStreams::FlowEndPoint_var flow_endpoint;
+ if (this->fep_map_.find (mcast_key, flow_endpoint ) == 0)
+ {
+ AVStreams::FlowConsumer_var consumer;
+ ACE_TRY_EX (narrow)
+ {
+ consumer = AVStreams::FlowConsumer::_narrow (flow_endpoint.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (narrow);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "FlowConsumer::_narrow");
+ ACE_ERROR_RETURN ((LM_ERROR, "sep_b doesn't contain a flowconsumer"), 0);
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ AVStreams::QoS flow_qos;
+ result = qos.get_flow_qos (forward_entry->flowname (), flow_qos);
+ if (result < 0)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "QoS not found for %s", forward_entry->flowname ()));
+ AVStreams::FlowConnection_var flow_connection;
+ ACE_TRY_EX (flow_connection)
+ {
+ if (CORBA::is_nil (this->streamctrl_.in ()))
+ {
+ CORBA::Any_var streamctrl_any;
+ streamctrl_any = this->get_property_value ("Related_StreamCtrl"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ AVStreams::StreamCtrl_ptr streamctrl;
+ streamctrl_any.in () >>= streamctrl;
+ this->streamctrl_ = AVStreams::StreamCtrl::_duplicate (streamctrl);
+ }
+ CORBA::Object_var flow_connection_obj =
+ this->streamctrl_->get_flow_connection (forward_entry->flowname ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flow_connection);
+ flow_connection = AVStreams::FlowConnection::_narrow (flow_connection_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flow_connection);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamEndPoint_B::multiconnect::get_flow_connection");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ result = flow_connection->add_consumer (consumer.in (),
+ flow_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "TAO_StreamEndPoint_B::multiconnect:add_consumer failed\n"), 0);
+ }
+ else
+ {
+ TAO_FlowSpec_Entry *mcast_entry = 0;
+ ACE_INET_Addr *mcast_addr;
+ mcast_addr = dynamic_cast<ACE_INET_Addr *> (forward_entry->address ());
+ if (mcast_addr == 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "TAO_StreamEndPoint_B::multiconnect::Address missing in flowspec_entry\n"), 0);
+ result = this->mcast_entry_map_.find (mcast_key, mcast_entry);
+ if (result == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "TAO_StreamEndPoint_B::multiconnect::handler already found\n"), 0);
+ }
+ else
+ {
+ switch (forward_entry->direction ())
+ {
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_IN:
+ {
+ // IN means we're the sink.
+ // @@ We have to take care of this.
+ // result = this->make_dgram_mcast_flow_handler (mcast_dgram);
+ // if (result < 0)
+ // return 0;
+
+ this->forward_flow_spec_set.insert (forward_entry);
+ TAO_AV_Connector_Registry *connector_registry = TAO_AV_CORE::instance ()->connector_registry ();
+ result = connector_registry->open (this,
+ TAO_AV_CORE::instance (),
+ this->forward_flow_spec_set);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "connector_registry::open failed\n"), 0);
+ result = this->mcast_entry_map_.bind (mcast_key, forward_entry);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "dgram_mcast_handler::bind failed"), 0);
+ }
+ break;
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
+ // OUT implies we're the source., which is an error.
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamEndPoint_B::multiconnect");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return 1;
+}
+
+TAO_StreamEndPoint_B::~TAO_StreamEndPoint_B (void)
+{
+}
+
+// ----------------------------------------------------------------------
+// TAO_VDev
+// ----------------------------------------------------------------------
+
+TAO_VDev::TAO_VDev (void)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) TAO_VDev::TAO_VDev: created\n"));
+}
+
+// StreamCtrl will call this to give us a reference to itself, and to
+// our peer vdev..
+CORBA::Boolean
+TAO_VDev::set_peer (AVStreams::StreamCtrl_ptr the_ctrl,
+ AVStreams::VDev_ptr the_peer_dev,
+ AVStreams::streamQoS &the_qos,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed,
+ AVStreams::streamOpFailed))
+{
+ ACE_UNUSED_ARG (the_qos);
+ ACE_UNUSED_ARG (the_spec);
+
+ CORBA::Boolean result = 0;
+ ACE_TRY
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) TAO_VDev::set_peer: called\n"));
+
+
+ CORBA::Any anyval;
+ anyval <<= the_peer_dev;
+ this->define_property ("Related_VDev",
+ anyval
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+ this->streamctrl_ = AVStreams::StreamCtrl::_duplicate (the_ctrl);
+ this->peer_ = AVStreams::VDev::_duplicate (the_peer_dev);
+
+ CORBA::Any_var anyptr;
+ anyptr = this->peer_->get_property_value ("Related_MediaCtrl"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_ptr media_ctrl_obj = 0;
+
+ anyptr.in () >>= CORBA::Any::to_object(media_ctrl_obj);
+ ACE_TRY_CHECK;
+
+ result = this->set_media_ctrl (media_ctrl_obj ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_VDev::set_peer");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return result;
+}
+
+CORBA::Boolean
+TAO_VDev::set_media_ctrl (CORBA::Object_ptr media_ctrl
+ ACE_ENV_ARG_DECL_NOT_USED)
+
+{
+ // since the media ctrl is not stored or used, delete it.
+
+ CORBA::release( media_ctrl);
+
+ return 1;
+}
+
+// Sets the multicast VDev peer.
+CORBA::Boolean
+TAO_VDev::set_Mcast_peer (AVStreams::StreamCtrl_ptr /* the_ctrl */,
+ AVStreams::MCastConfigIf_ptr mcast_peer,
+ AVStreams::streamQoS &/* the_qos */,
+ const AVStreams::flowSpec &/* the_spec */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed,
+ AVStreams::streamOpFailed))
+{
+ this->mcast_peer_ = AVStreams::MCastConfigIf::_duplicate (mcast_peer);
+ return 1;
+}
+
+// applications should override this to handle configuration changes.
+void
+TAO_VDev::configure (const CosPropertyService::Property &/*the_config_mesg*/
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::PropertyException,
+ AVStreams::streamOpFailed))
+{
+}
+
+// sets the media format used for the flowname as a property.
+void
+TAO_VDev::set_format (const char *flowName,
+ const char *format_name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported))
+{
+ ACE_TRY
+ {
+ if (flowName == 0 || format_name == 0)
+ ACE_ERROR ((LM_ERROR, "TAO_VDev::set_format: flowName or format_name is null\n"));
+ char format_property [BUFSIZ];
+ ACE_OS::sprintf (format_property, "%s_currFormat", flowName);
+ CORBA::Any format;
+ format <<= format_name;
+ this->define_property (format_property,
+ format
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_VDev::set_format");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ return;
+}
+
+// sets the device parameters for the flowname as a property.
+void
+TAO_VDev::set_dev_params (const char *flowName,
+ const CosPropertyService::Properties &new_params
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::PropertyException,
+ AVStreams::streamOpFailed))
+{
+ ACE_TRY
+ {
+ if (flowName == 0)
+ ACE_ERROR ((LM_ERROR, "TAO_VDev::set_dev_params:flowName is null\n"));
+ char devParams_property[BUFSIZ];
+ ACE_OS::sprintf (devParams_property, "%s_devParams", flowName);
+ CORBA::Any devParams;
+ devParams <<= new_params;
+ this->define_property (devParams_property,
+ devParams
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_VDev::set_dev_params");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ return;
+}
+
+// QoS Modification should be handled by the application currently.
+CORBA::Boolean
+TAO_VDev::modify_QoS (AVStreams::streamQoS &the_qos,
+ const AVStreams::flowSpec &flowspec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed))
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_VDev::modify_QoS\n"));
+
+ if (flowspec.length () != 0)
+ {
+ TAO_Forward_FlowSpec_Entry entry;
+ entry.parse (flowspec [0]);
+ int direction = entry.direction ();
+ if (direction == 0)
+ {
+ AVStreams::StreamEndPoint_A_ptr sep_a;
+
+ CORBA::Any_ptr streamendpoint_a_any =
+ this->get_property_value ("Related_StreamEndpoint"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ *streamendpoint_a_any >>= sep_a;
+ if (sep_a != 0)
+ {
+ sep_a->modify_QoS (the_qos, flowspec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ else ACE_DEBUG ((LM_DEBUG,
+ "Stream EndPoint Not Found\n"));
+ }
+ else
+ {
+ AVStreams::StreamEndPoint_B_ptr sep_b;
+
+ CORBA::Any_ptr streamendpoint_b_any =
+ this->get_property_value ("Related_StreamEndpoint"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ *streamendpoint_b_any >>= sep_b;
+ sep_b->modify_QoS (the_qos, flowspec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ }
+ return 1;
+}
+
+TAO_VDev::~TAO_VDev (void)
+{
+}
+
+// ----------------------------------------------------------------------
+// TAO_MMDevice
+// ----------------------------------------------------------------------
+
+
+TAO_MMDevice::TAO_MMDevice (TAO_AV_Endpoint_Strategy *endpoint_strategy)
+ : endpoint_strategy_ (endpoint_strategy),
+ flow_count_ (0),
+ flow_num_ (0),
+ stream_ctrl_ (0)
+{
+}
+
+// create a streamctrl which is colocated with me, use that streamctrl
+// to bind the peer_device with me.
+AVStreams::StreamCtrl_ptr
+TAO_MMDevice::bind (AVStreams::MMDevice_ptr peer_device,
+ AVStreams::streamQoS &the_qos,
+ CORBA::Boolean_out is_met,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed))
+{
+ AVStreams::StreamCtrl_ptr streamctrl (AVStreams::StreamCtrl::_nil ());
+ ACE_TRY
+ {
+ ACE_UNUSED_ARG (is_met);
+ ACE_NEW_RETURN (this->stream_ctrl_,
+ TAO_StreamCtrl,
+ 0);
+ AVStreams::MMDevice_var mmdevice = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->stream_ctrl_->bind_devs (peer_device,
+ mmdevice.in (),
+ the_qos,
+ the_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ streamctrl = this->stream_ctrl_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_MMDevice::bind");
+ return streamctrl;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (streamctrl);
+ return streamctrl;
+}
+
+// Multicast is not supported yet.
+AVStreams::StreamCtrl_ptr
+TAO_MMDevice::bind_mcast (AVStreams::MMDevice_ptr first_peer,
+ AVStreams::streamQoS &the_qos,
+ CORBA::Boolean_out is_met,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed))
+{
+ ACE_UNUSED_ARG (first_peer);
+ ACE_UNUSED_ARG (the_qos);
+ ACE_UNUSED_ARG (is_met);
+ ACE_UNUSED_ARG (the_spec);
+
+ return 0;
+}
+
+AVStreams::StreamEndPoint_ptr
+TAO_MMDevice::create_A_B (MMDevice_Type type,
+ AVStreams::StreamCtrl_ptr streamctrl,
+ AVStreams::VDev_out the_vdev,
+ AVStreams::streamQoS &the_qos,
+ CORBA::Boolean_out met_qos,
+ char *&/*named_vdev*/,
+ const AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+{
+ AVStreams::StreamEndPoint_A_ptr sep_a (AVStreams::StreamEndPoint_A::_nil ());
+ AVStreams::StreamEndPoint_B_ptr sep_b (AVStreams::StreamEndPoint_B::_nil ());
+ AVStreams::StreamEndPoint_ptr sep (AVStreams::StreamEndPoint::_nil ());
+ ACE_TRY
+ {
+ switch (type)
+ {
+ case MMDEVICE_A:
+ {
+ if (this->endpoint_strategy_->create_A (sep_a,
+ the_vdev
+ ACE_ENV_ARG_PARAMETER) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_MMDevice::create_A_B (%P|%t) - "
+ "error in create_A\n"),
+ 0);
+ sep = sep_a;
+ }
+ break;
+ case MMDEVICE_B:
+ {
+ if (this->endpoint_strategy_->create_B (sep_b,
+ the_vdev
+ ACE_ENV_ARG_PARAMETER) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_MMDevice::create_A_B (%P|%t) - "
+ "error in create_B\n"),
+ 0);
+ sep = sep_b;
+ }
+ break;
+ default:
+ break;
+ }
+ ACE_TRY_CHECK;
+ if (this->fdev_map_.current_size () > 0)
+ {
+ TAO_AV_QoS qos (the_qos);
+ // create flowendpoints from the FDevs.
+ for (u_int i=0;i<flow_spec.length ();i++)
+ {
+ TAO_Forward_FlowSpec_Entry forward_entry;
+ forward_entry.parse (flow_spec[i]);
+ ACE_CString flow_key (forward_entry.flowname ());
+ AVStreams::FDev_var flow_dev;
+ AVStreams::FlowConnection_var flowconnection;
+ ACE_TRY_EX (flowconnection)
+ {
+ // Get the flowconnection for this flow.
+ //static int blah = 0; if(blah == 1){blah=0; abort();}else{blah=1;}
+ CORBA::Object_var flowconnection_obj =
+ streamctrl->get_flow_connection (forward_entry.flowname () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flowconnection);
+ printf("successfully called get_flow_connection\n");
+ if (!CORBA::is_nil (flowconnection_obj.in ()))
+ {
+ flowconnection = AVStreams::FlowConnection::_narrow (flowconnection_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flowconnection);
+ }
+ }
+ ACE_CATCH(AVStreams::noSuchFlow, nsf)
+ {
+ TAO_FlowConnection *flowConnection;
+ ACE_NEW_RETURN (flowConnection,
+ TAO_FlowConnection,
+ 0);
+ flowconnection = flowConnection->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ streamctrl->set_flow_connection (forward_entry.flowname(),
+ flowconnection.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ //if (TAO_debug_level >= 0)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_MMDevice::create_a::get_flow_connection");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ int result = this->fdev_map_.find (flow_key, flow_dev);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "(%N,%l) fdev_map::find failed\n"), 0);
+
+ CORBA::String_var named_fdev;
+ AVStreams::FlowEndPoint_var flow_endpoint;
+ AVStreams::QoS flow_qos;
+ result = qos.get_flow_qos (forward_entry.flowname (), flow_qos);
+ if (result < 0)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "(%N,%l) get_flow_qos failed for %s\n", forward_entry.flowname ()));
+ switch (forward_entry.direction ())
+ {
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_IN:
+ {
+ switch (type)
+ {
+ case MMDEVICE_A:
+ {
+ // In implies flow is from A to B and
+ // hence A is the producer for this flow and B is the consumer for this flow.
+ // We have to create a producer from the FDev for this flow.
+ flow_endpoint =
+ flow_dev->create_producer (flowconnection.in (),
+ flow_qos,
+ met_qos,
+ named_fdev.inout ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+ case MMDEVICE_B:
+ {
+ flow_endpoint =
+ flow_dev->create_consumer (flowconnection.in (),
+ flow_qos,
+ met_qos,
+ named_fdev.inout ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+ }
+ ACE_TRY_CHECK;
+ }
+ break;
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
+ {
+ switch (type)
+ {
+ case MMDEVICE_A:
+ {
+ // OUT implies flow is from B to A and
+ // hence B is the producer for this flow and A is the consumer for this flow.
+ // We have to create a consumer from the FDev for this flow.
+ flow_endpoint =
+ flow_dev->create_consumer (flowconnection.in (),
+ flow_qos,
+ met_qos,
+ named_fdev.inout ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+ case MMDEVICE_B:
+ {
+ // In implies flow is from A to B and
+ // hence A is the producer for this flow and B is the consumer for this flow.
+ // We have to create a producer from the FDev for this flow.
+ flow_endpoint =
+ flow_dev->create_producer (flowconnection.in (),
+ flow_qos,
+ met_qos,
+ named_fdev.inout ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+ }
+ ACE_TRY_CHECK;
+ }
+ break;
+ default:
+ break;
+ }
+ CORBA::Any flowname_any;
+ flowname_any <<= forward_entry.flowname ();
+ flow_endpoint->define_property ("FlowName", flowname_any ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ sep->add_fep (flow_endpoint.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_MMDevice::create_A");
+ return sep;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (sep);
+ return sep;
+}
+
+AVStreams::StreamEndPoint_A_ptr
+TAO_MMDevice::create_A (AVStreams::StreamCtrl_ptr streamctrl,
+ AVStreams::VDev_out the_vdev,
+ AVStreams::streamQoS &stream_qos,
+ CORBA::Boolean_out met_qos,
+ char *&named_vdev,
+ const AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::streamOpDenied,
+ AVStreams::notSupported,
+ AVStreams::QoSRequestFailed,
+ AVStreams::noSuchFlow))
+{
+ AVStreams::StreamEndPoint_A_ptr sep_a = 0;
+ AVStreams::StreamEndPoint_var sep;
+ ACE_TRY
+ {
+ sep = this->create_A_B (MMDEVICE_A, streamctrl, the_vdev, stream_qos, met_qos, named_vdev, flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ sep_a = AVStreams::StreamEndPoint_A::_narrow (sep.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT( !CORBA::is_nil( sep_a ) );
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_MMDevice::create_A");
+ return sep_a;
+ }
+ ACE_ENDTRY;
+
+ return sep_a;
+}
+
+
+AVStreams::StreamEndPoint_B_ptr
+TAO_MMDevice::create_B (AVStreams::StreamCtrl_ptr streamctrl,
+ AVStreams::VDev_out the_vdev,
+ AVStreams::streamQoS &stream_qos,
+ CORBA::Boolean_out met_qos,
+ char *&named_vdev,
+ const AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::streamOpDenied,
+ AVStreams::notSupported,
+ AVStreams::QoSRequestFailed,
+ AVStreams::noSuchFlow))
+{
+ AVStreams::StreamEndPoint_B_ptr sep_b = AVStreams::StreamEndPoint_B::_nil ();
+ AVStreams::StreamEndPoint_var sep;
+
+ ACE_TRY
+ {
+ sep = this->create_A_B (MMDEVICE_B, streamctrl, the_vdev, stream_qos, met_qos, named_vdev, flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ sep_b = AVStreams::StreamEndPoint_B::_narrow (sep.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT ( !CORBA::is_nil( sep_b ) );
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_MMDevice::create_B");
+ return sep_b;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (sep_b);
+ return sep_b;
+}
+
+
+// destroys the streamendpoint and the Vdev.
+void
+TAO_MMDevice::destroy (AVStreams::StreamEndPoint_ptr /* the_ep */,
+ const char * /* vdev_name */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported))
+{
+ // Remove self from POA. Because of reference counting, the POA
+ // will automatically delete the servant when all pending requests
+ // on this servant are complete.
+ int result = TAO_AV_Core::deactivate_servant (this);
+ if (result < 0)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_MMDevice::destroy failed\n"));
+}
+
+char *
+TAO_MMDevice::add_fdev_i (AVStreams::FDev_ptr fdev
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::streamOpFailed))
+{
+ char* tmp;
+ ACE_NEW_RETURN (tmp,
+ char[64],
+ 0);
+ CORBA::String_var flow_name = tmp;
+
+ ACE_TRY
+ {
+ // exception implies the flow name is not defined and is system
+ // generated.
+ ACE_OS::sprintf (tmp, "flow%d", flow_num_++);
+ CORBA::Any flowname_any;
+ flowname_any <<= flow_name.in ();
+ fdev->define_property ("Flow", flowname_any ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_MMDevice::add_fdev");
+ return 0;
+ }
+ ACE_ENDTRY;
+ return flow_name._retn ();
+}
+
+// Adds the fdev object to the MMDevice.
+char *
+TAO_MMDevice::add_fdev (CORBA::Object_ptr fdev_obj
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::streamOpFailed))
+{
+ CORBA::String_var flow_name;
+ AVStreams::FDev_var fdev;
+ ACE_TRY_EX (flow_name)
+ {
+ CORBA::Any_ptr flow_name_any;
+ fdev = AVStreams::FDev::_narrow (fdev_obj ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flow_name);
+
+ if (CORBA::is_nil (fdev.in ()))
+ return 0;
+
+
+ flow_name_any = fdev->get_property_value ("Flow" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flow_name);
+
+ const char *tmp;
+ *flow_name_any >>= tmp;
+ flow_name = CORBA::string_dup (tmp);
+ }
+ ACE_CATCHANY
+ {
+ flow_name =
+ this->add_fdev_i (fdev.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+
+ // Add it to the sequence of flowNames supported.
+ // put the flowname and the fdev in a hashtable.
+ ACE_CString fdev_name_key ( flow_name.in () );
+
+
+ if ( (this->fdev_map_.bind (fdev_name_key, fdev )) != 0)
+ ACE_THROW_RETURN (AVStreams::streamOpFailed (), 0);
+ // increment the flow count.
+ this->flow_count_++;
+ this->flows_.length (this->flow_count_);
+ this->flows_ [this->flow_count_-1] = flow_name;
+ // define/modify the "Flows" property.
+ CORBA::Any flows_any;
+ flows_any <<= this->flows_;
+ ACE_TRY_EX (flows)
+ {
+ this->define_property ("Flows",
+ flows_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (flows);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_MMDevice::add_fdev");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return flow_name._retn ();
+}
+
+// Gets the FDev object associated with this flow.
+CORBA::Object_ptr
+TAO_MMDevice::get_fdev (const char *flow_name
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::noSuchFlow))
+{
+
+ ACE_CString fdev_name_key (flow_name);
+ AVStreams::FDev_var fdev_entry;
+ if (this->fdev_map_.find (fdev_name_key, fdev_entry) == 0)
+ return fdev_entry._retn() ;
+ return 0;
+}
+
+// Removes the fdev from this MMDevice.
+void
+TAO_MMDevice::remove_fdev (const char *flow_name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::noSuchFlow,
+ AVStreams::streamOpFailed))
+{
+ ACE_TRY
+ {
+ ACE_CString fdev_name_key (flow_name);
+ AVStreams::FDev_var fdev_entry;
+ // Remove the fep from the hash table.
+ if (this->fdev_map_.unbind (fdev_name_key, fdev_entry)!= 0)
+ ACE_THROW (AVStreams::streamOpFailed ());
+
+ AVStreams::flowSpec new_flows (this->flows_.length ());
+ for (u_int i=0, j=0 ; i <this->flows_.length (); i++)
+ if (ACE_OS::strcmp (flow_name, this->flows_[i]) != 0)
+ new_flows[j++] = this->flows_[i];
+
+ CORBA::Any flows;
+ flows <<= new_flows;
+ this->flows_ = new_flows;
+ this->define_property ("Flows",
+ flows
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_MMDevice::remove_fdev");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+// destructor.
+TAO_MMDevice::~TAO_MMDevice (void)
+{
+ delete this->stream_ctrl_;
+}
+
+//------------------------------------------------------------------
+// TAO_FlowConnection
+//------------------------------------------------------------------
+
+// default constructor.
+TAO_FlowConnection::TAO_FlowConnection (void)
+ :fp_name_ (CORBA::string_dup ("")),
+ ip_multicast_ (0)
+{
+}
+
+// int
+// TAO_FlowConnection::set_mcast_addr (ACE_UINT32 mcast_addr, u_short mcast_port)
+// {
+// this->mcast_addr_ = mcast_addr;
+// this->mcast_port_ = mcast_port;
+// return 0;
+// }
+
+int
+TAO_FlowConnection::set_mcast_addr (ACE_CString mcast_addr, u_short mcast_port)
+{
+ this->mcast_addr_ = mcast_addr;
+ this->mcast_port_ = mcast_port;
+ return 0;
+}
+
+void
+TAO_FlowConnection::set_protocol (const char *protocol)
+{
+ this->protocol_ = protocol;
+}
+
+// stop this flow.
+void
+TAO_FlowConnection::stop (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ FlowProducer_SetItor producer_begin = this->flow_producer_set_.begin
+ ();
+ for (FlowProducer_SetItor producer_end =
+ this->flow_producer_set_.end ();
+ producer_begin != producer_end; ++producer_begin)
+ {
+ (*producer_begin)->stop (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ FlowConsumer_SetItor consumer_begin = this->flow_consumer_set_.begin
+ ();
+ for (FlowConsumer_SetItor consumer_end =
+ this->flow_consumer_set_.end ();
+ consumer_begin != consumer_end; ++consumer_begin)
+ {
+ (*consumer_begin)->stop (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_FlowConnection::stop");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+// start this flow.
+void
+TAO_FlowConnection::start (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ FlowConsumer_SetItor consumer_begin = this->flow_consumer_set_.begin
+ ();
+ for (FlowConsumer_SetItor consumer_end =
+ this->flow_consumer_set_.end ();
+ consumer_begin != consumer_end; ++consumer_begin)
+ {
+ (*consumer_begin)->start (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ FlowProducer_SetItor producer_begin = this->flow_producer_set_.begin
+ ();
+ for (FlowProducer_SetItor producer_end =
+ this->flow_producer_set_.end ();
+ producer_begin != producer_end; ++producer_begin)
+ {
+ (*producer_begin)->start (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_FlowConnection::start");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+// destroy this flow.
+void
+TAO_FlowConnection::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ FlowProducer_SetItor producer_begin = this->flow_producer_set_.begin
+ ();
+ for (FlowProducer_SetItor producer_end =
+ this->flow_producer_set_.end ();
+ producer_begin != producer_end; ++producer_begin)
+ {
+ (*producer_begin)->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ FlowConsumer_SetItor consumer_begin = this->flow_consumer_set_.begin
+ ();
+ for (FlowConsumer_SetItor consumer_end =
+ this->flow_consumer_set_.end ();
+ consumer_begin != consumer_end; ++consumer_begin)
+ {
+ (*consumer_begin)->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_FlowConnection::destroy");
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ int result = TAO_AV_Core::deactivate_servant (this);
+ if (result < 0)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_FlowConnection::destroy failed\n"));
+}
+
+// modify the QoS for this flow.
+CORBA::Boolean
+TAO_FlowConnection::modify_QoS (AVStreams::QoS & new_qos
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::QoSRequestFailed))
+{
+ ACE_UNUSED_ARG (new_qos);
+ return 0;
+}
+
+// use the specified flow protocol for this flow.
+CORBA::Boolean
+TAO_FlowConnection::use_flow_protocol (const char * fp_name,
+ const CORBA::Any & fp_settings
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::FPError,
+ AVStreams::notSupported))
+{
+ this->fp_name_ = fp_name;
+ this->fp_settings_ = fp_settings;
+ FlowProducer_SetItor producer_begin = this->flow_producer_set_.begin
+ ();
+ for (FlowProducer_SetItor producer_end =
+ this->flow_producer_set_.end ();
+ producer_begin != producer_end; ++producer_begin)
+ {
+ (*producer_begin)->use_flow_protocol
+ (fp_name, fp_settings ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ FlowConsumer_SetItor consumer_begin = this->flow_consumer_set_.begin
+ ();
+ for (FlowConsumer_SetItor consumer_end =
+ this->flow_consumer_set_.end ();
+ consumer_begin != consumer_end; ++consumer_begin)
+ {
+ (*consumer_begin)->use_flow_protocol
+ (fp_name, fp_settings ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ return 1;
+}
+
+void
+TAO_FlowConnection::push_event (const AVStreams::streamEvent & the_event
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG (the_event);
+}
+
+CORBA::Boolean
+TAO_FlowConnection::connect_devs (AVStreams::FDev_ptr a_party,
+ AVStreams::FDev_ptr b_party,
+ AVStreams::QoS & flow_qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::streamOpDenied,
+ AVStreams::QoSRequestFailed))
+{
+ CORBA::Boolean result = 0;
+ ACE_TRY
+ {
+ AVStreams::FlowConnection_var flowconnection = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::Boolean met_qos;
+ CORBA::String_var named_fdev ((const char *)"");
+ AVStreams::FlowProducer_var producer =
+ a_party->create_producer (flowconnection.in (),
+ flow_qos,
+ met_qos,
+ named_fdev.inout ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ AVStreams::FlowConsumer_var consumer =
+ b_party->create_consumer (flowconnection.in (),
+ flow_qos,
+ met_qos,
+ named_fdev.inout ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ result = this->connect (producer.in (),
+ consumer.in (),
+ flow_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_FlowConnection::connect_devs");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return result;
+}
+
+// connect the producer and the consumer
+CORBA::Boolean
+TAO_FlowConnection::connect (AVStreams::FlowProducer_ptr producer,
+ AVStreams::FlowConsumer_ptr consumer,
+ AVStreams::QoS & the_qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::formatMismatch,
+ AVStreams::FEPMismatch,
+ AVStreams::alreadyConnected))
+{
+ ACE_TRY
+ {
+
+ AVStreams::FlowProducer_ptr flow_producer =
+ AVStreams::FlowProducer::_duplicate (producer);
+ AVStreams::FlowConsumer_ptr flow_consumer =
+ AVStreams::FlowConsumer::_duplicate (consumer);
+
+ this->flow_producer_set_.insert (flow_producer);
+ this->flow_consumer_set_.insert (flow_consumer);
+ AVStreams::FlowConnection_var flowconnection =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ flow_producer->set_peer (flowconnection.in (),
+ flow_consumer,
+ the_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ flow_consumer->set_peer (flowconnection.in (),
+ flow_producer,
+ the_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ char *consumer_address =
+ flow_consumer->go_to_listen (the_qos,
+ 0, // false for is_mcast
+ flow_producer,
+ this->fp_name_.inout ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ACE_OS::strcmp (consumer_address, "") == 0)
+ {
+ // Consumer is not willing to listen, so try the producer.
+ consumer_address = flow_producer->go_to_listen (the_qos,
+ 0, // false for is_mcast
+ flow_consumer,
+ this->fp_name_.inout ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ flow_consumer->connect_to_peer (the_qos,
+ consumer_address,
+ this->fp_name_.inout ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ // @@ Naga: We have to find means to set the reverse channel for the producer.
+ // Its broken in the point-to_point case for UDP.
+ }
+ else
+ {
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_FlowConnection::connect_to_peer addres: %s", consumer_address));
+ flow_producer->connect_to_peer (the_qos,
+ consumer_address,
+ this->fp_name_.inout ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_FlowConnection::connect");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return 1;
+}
+
+
+CORBA::Boolean
+TAO_FlowConnection::disconnect (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return 0;
+}
+
+CORBA::Boolean
+TAO_FlowConnection::add_producer (AVStreams::FlowProducer_ptr producer,
+ AVStreams::QoS & the_qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::alreadyConnected,
+ AVStreams::notSupported))
+{
+ ACE_TRY
+ {
+ AVStreams::FlowProducer_ptr flow_producer =
+ AVStreams::FlowProducer::_duplicate (producer);
+ // @@Naga:Sometimes the same producer could be added with a different object reference.
+ // There's no portable way of comparing obj refs. but we have to do this till we find
+ // a permanent solution.For eg. 2 different flowproducers for the same flow in a
+ // Multipoint to Multipoint binding will have the same flowname and hence cannot be
+ // used for resolving ties.
+ FlowProducer_SetItor begin = this->flow_producer_set_.begin ();
+ FlowProducer_SetItor end = this->flow_producer_set_.end ();
+ for (; begin != end; ++begin)
+ {
+ if ((*begin)->_is_equivalent (producer
+ ACE_ENV_ARG_PARAMETER))
+ // producer exists in the set, a duplicate.
+ ACE_ERROR_RETURN ((LM_WARNING, "TAO_FlowConnection::add_producer: producer already exists\n"), 1);
+ }
+ // We need to check the return value of the insert into the flow producer
+ // set, since multiconnect could be called many times which will lead to
+ // a call to add_producer every time a sink is added. If the producer is already
+ // present in our list we just return immediately.
+ int result = this->flow_producer_set_.insert (flow_producer);
+ if (result == 1)
+ {
+ // producer exists in the set, a duplicate.
+ ACE_ERROR_RETURN ((LM_WARNING, "TAO_FlowConnection::add_producer: producer already exists\n"), 1);
+ }
+ CORBA::Boolean met_qos;
+ char mcast_address[BUFSIZ];
+ if (this->producer_address_.in () == 0)
+ {
+ ACE_INET_Addr mcast_addr;
+ mcast_addr.set (this->mcast_port_,
+ this->mcast_addr_.c_str ()
+ );
+
+ char buf [BUFSIZ];
+ mcast_addr.addr_to_string (buf, BUFSIZ);
+ ACE_OS::sprintf (mcast_address, "%s=%s", this->protocol_.in (), buf);
+ }
+ else
+ {
+ ACE_OS::strcpy (mcast_address, this->producer_address_.in ());
+ }
+ char *address = flow_producer->connect_mcast (the_qos,
+ met_qos,
+ mcast_address,
+ this->fp_name_.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+ if (this->producer_address_.in () == 0)
+ {
+ TAO_Forward_FlowSpec_Entry entry ("", "", "", "", address);
+ if (entry.address () != 0)
+ {
+ // Internet multicasting is in use.
+ this->producer_address_ = address;
+ }
+ else
+ {
+ // ATM Multicasting is in use.
+ this->ip_multicast_ = 0;
+ }
+ }
+ // set the multicast peer.
+ if (CORBA::is_nil (this->mcastconfigif_.in ()))
+ {
+ ACE_NEW_RETURN (this->mcastconfigif_i_,
+ TAO_MCastConfigIf,
+ 0);
+ this->mcastconfigif_ = this->mcastconfigif_i_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ AVStreams::FlowConnection_var flowconnection = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ flow_producer->set_Mcast_peer (flowconnection.in (),
+ this->mcastconfigif_.in (),
+ the_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_FlowConnection::add_producer");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return 1;
+}
+
+CORBA::Boolean
+TAO_FlowConnection::add_consumer (AVStreams::FlowConsumer_ptr consumer,
+ AVStreams::QoS & the_qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::alreadyConnected))
+{
+ ACE_TRY
+ {
+ AVStreams::FlowConsumer_ptr flow_consumer =
+ AVStreams::FlowConsumer::_duplicate (consumer);
+ FlowConsumer_SetItor begin = this->flow_consumer_set_.begin ();
+ FlowConsumer_SetItor end = this->flow_consumer_set_.end ();
+ for (; begin != end; ++begin)
+ {
+ if ((*begin)->_is_equivalent (consumer
+ ACE_ENV_ARG_PARAMETER))
+ // Consumer exists in the set, a duplicate.
+ ACE_ERROR_RETURN ((LM_WARNING, "TAO_FlowConnection::add_Consumer: Consumer already exists\n"), 1);
+ }
+ int result = this->flow_consumer_set_.insert (flow_consumer);
+ if (result == 1)
+ {
+ // consumer exists in the set, a duplicate.
+ ACE_ERROR_RETURN ((LM_WARNING, "TAO_FlowConnection::add_consumer: consumer already exists\n"), 1);
+ }
+
+ FlowProducer_SetItor producer_begin = this->flow_producer_set_.begin ();
+ // @@Lets take that the first entry as the only producer. We're
+ // not sure if we can have multiple flow producers in a
+ // flowconnection. We can have multiple producer in the MtM binding,
+ // in which case the first producer that gets added is the leader.
+ AVStreams::FlowProducer_ptr flow_producer = (*producer_begin);
+
+ AVStreams::protocolSpec protocols (1);
+ protocols.length (1);
+ protocols [0] = CORBA::string_dup (this->producer_address_.in ());
+
+ if (!this->ip_multicast_)
+ {
+ flow_consumer->set_protocol_restriction (protocols
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ char * address =
+ flow_consumer->go_to_listen (the_qos,
+ 1,
+ flow_producer,
+ this->fp_name_.inout ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::Boolean is_met;
+ flow_producer->connect_mcast (the_qos,
+ is_met,
+ address,
+ this->fp_name_.inout ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ // The spec says go_to_listen is called with the multicast
+ // address returned from the connect_mcast call called
+ // during add_producer. But go_to_listen doesn't have a
+ // address parameter. I guess it should be connect_to_peer.
+ // IP Multicasting.
+ flow_consumer->connect_to_peer (the_qos,
+ this->producer_address_.in (),
+ this->fp_name_.inout ()
+ ACE_ENV_ARG_PARAMETER);
+
+ // char * address =
+ // flow_consumer->go_to_listen (the_qos,
+ // 1,
+ // flow_producer,
+ // this->fp_name_.inout ()
+ // ACE_ENV_ARG_PARAMETER);
+
+ // ACE_TRY_CHECK;
+ }
+ if (CORBA::is_nil (this->mcastconfigif_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR, "TAO_FlowConnection::add_consumer: first add a producer and then a consumer\n"), 0);
+ // @@ Is this the right place to do set_peer?
+ AVStreams::flowSpec flow_spec;
+ AVStreams::streamQoS stream_qos (1);
+ stream_qos.length (1);
+ stream_qos [0] = the_qos;
+ this->mcastconfigif_->set_peer (flow_consumer,
+ stream_qos,
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_FlowConnection::add_consumer");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return 1;
+}
+
+CORBA::Boolean
+TAO_FlowConnection::drop (AVStreams::FlowEndPoint_ptr target
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notConnected))
+{
+ ACE_UNUSED_ARG (target);
+ return 0;
+}
+
+// -----------------------------------------------------------------
+// TAO_FlowEndPoint
+// -----------------------------------------------------------------
+
+//default constructor.
+TAO_FlowEndPoint::TAO_FlowEndPoint (void)
+ :lock_ (0)
+{
+}
+
+TAO_FlowEndPoint::TAO_FlowEndPoint (const char *flowname,
+ AVStreams::protocolSpec &protocols,
+ const char *format)
+{
+ this->open (flowname, protocols, format);
+}
+
+void
+TAO_FlowEndPoint::set_flow_handler (const char * /*flowname*/,
+ TAO_AV_Flow_Handler * /*handler*/)
+{
+}
+
+int
+TAO_FlowEndPoint::open (const char *flowname,
+ AVStreams::protocolSpec &protocols,
+ const char *format)
+{
+ this->flowname_ = flowname;
+ this->format_ = format;
+
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_FlowEndPoint::open\n"));
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Any flowname_any;
+ flowname_any <<= flowname;
+ this->define_property ("FlowName",
+ flowname_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->set_format (format
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->protocol_addresses_ = protocols;
+ AVStreams::protocolSpec protocol_spec (protocols.length ());
+ protocol_spec.length (protocols.length ());
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "%N:%l\n"));
+ for (u_int i=0;i<protocols.length ();i++)
+ {
+ CORBA::String_var address = CORBA::string_dup (protocols [i]);
+ TAO_Forward_FlowSpec_Entry entry ("", "", "", "", address.in ());
+ protocol_spec [i] = CORBA::string_dup (entry.carrier_protocol_str ());
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "[%s]\n",
+ static_cast<char const*>(protocol_spec[i])));
+ }
+ this->set_protocol_restriction (protocol_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_FlowEndPoint::open");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+
+int
+TAO_FlowEndPoint::set_flowname (const char *flowname)
+{
+ this->flowname_ = flowname;
+ return 0;
+}
+
+// used by one flowconnection so that multiple connections cant use
+// the same flowendpoint.
+CORBA::Boolean
+TAO_FlowEndPoint::lock (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // lock the current flowendpoint
+
+ if (this->lock_)
+ return 0;
+ this->lock_ = 1;
+ return 1;
+}
+
+// unlocks the flowendpoint , becomes free to be used in another flow.
+void
+TAO_FlowEndPoint::unlock (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->lock_ = 0;
+}
+
+
+void
+TAO_FlowEndPoint::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ int result = TAO_AV_Core::deactivate_servant (this);
+ if (result < 0)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_StreamEndPoint::destroy failed\n"));
+ TAO_AV_FlowSpecSetItor end = this->flow_spec_set_.end ();
+ for (TAO_AV_FlowSpecSetItor begin = this->flow_spec_set_.begin ();
+ begin != end; ++begin)
+ (*begin)->protocol_object ()->destroy ();
+}
+
+AVStreams::StreamEndPoint_ptr
+TAO_FlowEndPoint::related_sep (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ return AVStreams::StreamEndPoint::_duplicate (this->related_sep_.in ());
+}
+
+void
+TAO_FlowEndPoint::related_sep (AVStreams::StreamEndPoint_ptr related_sep
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->related_sep_ = AVStreams::StreamEndPoint::_duplicate (related_sep);
+}
+
+AVStreams::FlowConnection_ptr
+TAO_FlowEndPoint::related_flow_connection (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return AVStreams::FlowConnection::_duplicate (this->related_flow_connection_.in ());
+}
+
+void
+TAO_FlowEndPoint::related_flow_connection (AVStreams::FlowConnection_ptr related_flow_connection
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->related_flow_connection_ = AVStreams::FlowConnection::_duplicate (related_flow_connection);
+}
+
+// returns the connected peer for this flow
+AVStreams::FlowEndPoint_ptr
+TAO_FlowEndPoint::get_connected_fep (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notConnected,
+ AVStreams::notSupported))
+{
+ return AVStreams::FlowEndPoint::_duplicate (this->peer_fep_.in ());
+}
+
+CORBA::Boolean
+TAO_FlowEndPoint::use_flow_protocol (const char * fp_name,
+ const CORBA::Any &
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::FPError,
+ AVStreams::notSupported))
+{
+ ACE_TRY
+ {
+ // Define the property called FlowProtocol
+ CORBA::Any flowname_property;
+ flowname_property <<= fp_name;
+ this->define_property ("FlowProtocol",
+ flowname_property
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_FlowEndPoint::use_flow_protocol");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return 1;
+}
+
+void
+TAO_FlowEndPoint::set_format (const char * format
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported))
+{
+ this->format_ = format;
+ ACE_TRY
+ {
+ // make this a property so that is_fep_compatible can query this and
+ // check if 2 flowendpoints are compatible.
+ CORBA::Any format_val;
+ format_val <<= format;
+ this->define_property ("Format",
+ format_val
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_FlowEndpoint::set_format");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+TAO_FlowEndPoint::set_dev_params (const CosPropertyService::Properties & new_settings
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::PropertyException,
+ AVStreams::streamOpFailed))
+{
+ this->dev_params_ = new_settings;
+ ACE_TRY
+ {
+ CORBA::Any DevParams_property;
+ DevParams_property <<= new_settings;
+ this->define_property ("DevParams",
+ DevParams_property
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_FlowEndPoint::set_dev_params");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+TAO_FlowEndPoint::set_protocol_restriction (const AVStreams::protocolSpec & protocols
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported))
+{
+ ACE_TRY
+ {
+ u_int i = 0;
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "%N:%l\n"));
+ for (i=0;i<protocols.length ();i++)
+ {
+ const char *protocol = (protocols)[i];
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "%s\n", protocol));
+ }
+ CORBA::Any AvailableProtocols_property;
+ AvailableProtocols_property <<= protocols;
+ this->define_property ("AvailableProtocols",
+ AvailableProtocols_property
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ AVStreams::protocolSpec *temp_spec;
+ CORBA::Any_var temp_any = this->get_property_value ("AvailableProtocols"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ temp_any.in () >>= temp_spec;
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "%N:%l\n"));
+ for (i=0;i<temp_spec->length ();i++)
+ {
+ const char *protocol = (*temp_spec)[i];
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "%s\n", protocol));
+ }
+ this->protocols_ = protocols;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_FlowEndpoint::set_protocol_restriction");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+CORBA::Boolean
+TAO_FlowEndPoint::is_fep_compatible (AVStreams::FlowEndPoint_ptr peer_fep
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::formatMismatch,
+ AVStreams::deviceQosMismatch))
+{
+ const char *exception_message = "";
+ ACE_TRY
+ {
+ // check whether the passed flowendpoint is compatible with this flowendpoint.
+ // should we check for the availableFormats and choose one format.
+ // get my format value
+ CORBA::Any_var format_ptr;
+ CORBA::String_var my_format, peer_format;
+
+ exception_message = "TAO_FlowEndPoint::is_fep_compatible - Format";
+ format_ptr = this->get_property_value ("Format"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ const char *temp_format;
+ format_ptr.in () >>= temp_format;
+ my_format = CORBA::string_dup (temp_format);
+ // get my peer's format value
+ exception_message = "TAO_FlowEndPoint::is_fep_compatible - Format[2]";
+ format_ptr = peer_fep->get_property_value ("Format"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ format_ptr.in () >>= temp_format;
+ peer_format = CORBA::string_dup (temp_format);
+ if (ACE_OS::strcmp (my_format.in (),
+ peer_format.in ()) != 0)
+ return 0;
+
+ // since formats are same, check for a common protocol
+ CORBA::Any_var AvailableProtocols_ptr;
+ AVStreams::protocolSpec my_protocol_spec, peer_protocol_spec;
+ AVStreams::protocolSpec *temp_protocols;;
+
+ exception_message =
+ "TAO_FlowEndPoint::is_fep_compatible - AvailableProtocols";
+ AvailableProtocols_ptr = this->get_property_value ("AvailableProtocols"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ AvailableProtocols_ptr.in () >>= temp_protocols;
+ my_protocol_spec = *temp_protocols;
+
+ exception_message =
+ "TAO_FlowEndPoint::is_fep_compatible - AvailableProtocols[2]";
+ AvailableProtocols_ptr = peer_fep->get_property_value ("AvailableProtocols"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ AvailableProtocols_ptr.in () >>= temp_protocols;
+ peer_protocol_spec = *temp_protocols;
+
+ int protocol_match = 0;
+ for (u_int i=0;i<my_protocol_spec.length ();i++)
+ {
+ CORBA::String_var my_protocol_string;
+ for (u_int j=0;j<peer_protocol_spec.length ();j++)
+ {
+ CORBA::String_var peer_protocol_string;
+ my_protocol_string = CORBA::string_dup (my_protocol_spec[i]);
+ peer_protocol_string = CORBA::string_dup (peer_protocol_spec[j]);
+ if (ACE_OS::strcmp (my_protocol_string.in (), peer_protocol_string.in ()) == 0)
+ {
+ protocol_match = 1;
+ break;
+ }
+ }
+ if (protocol_match)
+ break;
+ }
+ if (!protocol_match)
+ return 0;
+ }
+ ACE_CATCH (CosPropertyService::PropertyNotFound, nf)
+ {
+ ACE_PRINT_EXCEPTION (nf,
+ exception_message);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_FlowEndPoint::is_fep_compatible");
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ return 1;
+}
+
+CORBA::Boolean
+TAO_FlowEndPoint::set_peer (AVStreams::FlowConnection_ptr /* the_fc */,
+ AVStreams::FlowEndPoint_ptr the_peer_fep,
+ AVStreams::QoS & /* the_qos */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::QoSRequestFailed,
+ AVStreams::streamOpFailed))
+{
+ this->peer_fep_ =
+ AVStreams::FlowEndPoint::_duplicate (the_peer_fep);
+ return 1;
+}
+
+CORBA::Boolean
+TAO_FlowEndPoint::set_Mcast_peer (AVStreams::FlowConnection_ptr /* the_fc */,
+ AVStreams::MCastConfigIf_ptr mcast_peer,
+ AVStreams::QoS & /* the_qos */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::QoSRequestFailed))
+{
+ this->mcast_peer_ = AVStreams::MCastConfigIf::_duplicate (mcast_peer);
+ return 0;
+}
+
+char *
+TAO_FlowEndPoint::go_to_listen_i (TAO_FlowSpec_Entry::Role role,
+ AVStreams::QoS & /*the_qos*/,
+ CORBA::Boolean /*is_mcast*/,
+ AVStreams::FlowEndPoint_ptr peer_fep,
+ char *& flowProtocol
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToListen,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed))
+{
+ char direction [BUFSIZ];
+ switch (role)
+ {
+ case TAO_FlowSpec_Entry::TAO_AV_PRODUCER:
+ ACE_OS::strcpy (direction, "IN");
+ break;
+ case TAO_FlowSpec_Entry::TAO_AV_CONSUMER:
+ ACE_OS::strcpy (direction, "OUT");
+ break;
+ default:
+ break;
+ }
+ AVStreams::protocolSpec my_protocol_spec, peer_protocol_spec;
+ AVStreams::protocolSpec *temp_protocols;
+ CORBA::Any_var AvailableProtocols_ptr =
+ peer_fep->get_property_value ("AvailableProtocols"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ AvailableProtocols_ptr.in () >>= temp_protocols;
+ peer_protocol_spec = *temp_protocols;
+ AvailableProtocols_ptr =
+ this->get_property_value ("AvailableProtocols"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ AvailableProtocols_ptr.in () >>= temp_protocols;
+ my_protocol_spec = *temp_protocols;
+ int protocol_match = 0;
+ CORBA::String_var listen_protocol;
+ u_int i =0;
+ for (i=0;i<my_protocol_spec.length ();i++)
+ {
+ CORBA::String_var my_protocol_string;
+ for (u_int j=0;j<peer_protocol_spec.length ();j++)
+ {
+ CORBA::String_var peer_protocol_string;
+ my_protocol_string = CORBA::string_dup (my_protocol_spec[i]);
+ peer_protocol_string = CORBA::string_dup (peer_protocol_spec[j]);
+ if (ACE_OS::strcmp (my_protocol_string.in (), peer_protocol_string.in ()) == 0)
+ {
+ listen_protocol = my_protocol_string;
+ protocol_match = 1;
+ break;
+ }
+ }
+ if (protocol_match)
+ break;
+ }
+ if (!protocol_match)
+ ACE_ERROR_RETURN ((LM_ERROR, "TAO_FlowEndPoint::go_to_listen failed: no protoocol match\n"), 0);
+
+ for (u_int j=0;j<this->protocol_addresses_.length ();j++)
+ if (ACE_OS::strncmp (this->protocol_addresses_ [j], listen_protocol.in (), ACE_OS::strlen (listen_protocol.in ())) == 0)
+ {
+ // Now listen on that protocol.
+ TAO_Forward_FlowSpec_Entry *entry;
+ ACE_NEW_RETURN (entry,
+ TAO_Forward_FlowSpec_Entry (this->flowname_.in (),
+ direction,
+ this->format_.in (),
+ flowProtocol,
+ this->protocol_addresses_ [j]),
+ 0);
+
+ TAO_AV_Acceptor_Registry *acceptor_registry = TAO_AV_CORE::instance ()->acceptor_registry ();
+ this->flow_spec_set_.insert (entry);
+ int result = acceptor_registry->open (this,
+ TAO_AV_CORE::instance (),
+ this->flow_spec_set_);
+ if (result < 0)
+ return 0;
+ char *listen_address = entry->get_local_addr_str ();
+ char *address;
+ ACE_NEW_RETURN (address,
+ char [BUFSIZ],
+ 0);
+ ACE_OS::sprintf (address, "%s=%s", listen_protocol.in (), listen_address);
+ return address;
+ }
+ return 0;
+}
+
+
+CORBA::Boolean
+TAO_FlowEndPoint::connect_to_peer_i (TAO_FlowSpec_Entry::Role role,
+ AVStreams::QoS & /*the_qos*/,
+ const char * address,
+ const char * use_flow_protocol
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToConnect,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed))
+{
+ char direction [BUFSIZ];
+ switch (role)
+ {
+ case TAO_FlowSpec_Entry::TAO_AV_PRODUCER:
+ ACE_OS::strcpy (direction, "IN");
+ break;
+ case TAO_FlowSpec_Entry::TAO_AV_CONSUMER:
+ ACE_OS::strcpy (direction, "OUT");
+ break;
+ default:
+ break;
+ }
+ TAO_Forward_FlowSpec_Entry *entry;
+ ACE_NEW_RETURN (entry,
+ TAO_Forward_FlowSpec_Entry (this->flowname_.in (),
+ direction,
+ this->format_.in (),
+ use_flow_protocol,
+ address),
+ 0);
+ this->flow_spec_set_.insert (entry);
+ TAO_AV_Connector_Registry *connector_registry = TAO_AV_CORE::instance ()->connector_registry ();
+ int result = connector_registry->open (this,
+ TAO_AV_CORE::instance (),
+ this->flow_spec_set_);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "TAO_FlowEndPoint::connector_registry::open failed\n"), 0);
+ this->reverse_channel_ = entry->get_local_addr_str ();
+ return 1;
+}
+
+int
+TAO_FlowEndPoint::set_protocol_object (const char * /*flowname*/,
+ TAO_AV_Protocol_Object * /*object*/)
+{
+ return 0;
+}
+
+
+// ------------------------------------------------------------
+// TAO_FlowProducer class
+// ------------------------------------------------------------
+
+//default constructor
+TAO_FlowProducer::TAO_FlowProducer (void)
+{
+}
+
+TAO_FlowProducer::TAO_FlowProducer (const char *flowname,
+ AVStreams::protocolSpec protocols,
+ const char *format)
+{
+ this->open (flowname, protocols, format);
+}
+
+// gets the reverse channel for feedback.
+char *
+TAO_FlowProducer::get_rev_channel (const char * /*pcol_name*/
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return 0;
+}
+
+// The start, stop and destroy are to be handled by the application.
+void
+TAO_FlowProducer::stop (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_AV_FlowSpecSetItor end = this->flow_spec_set_.end ();
+ for (TAO_AV_FlowSpecSetItor begin = this->flow_spec_set_.begin ();
+ begin != end; ++begin)
+ {
+ TAO_FlowSpec_Entry *entry = (*begin);
+ entry->handler ()->stop (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
+ }
+}
+
+void
+TAO_FlowProducer::start (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_AV_FlowSpecSetItor end = this->flow_spec_set_.end ();
+ for (TAO_AV_FlowSpecSetItor begin = this->flow_spec_set_.begin ();
+ begin != end; ++begin)
+ {
+ TAO_FlowSpec_Entry *entry = (*begin);
+ if (entry->handler () != 0)
+ {
+ entry->handler ()->start (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
+ }
+ if (entry->control_handler () != 0)
+ {
+ entry->control_handler ()->start (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
+ }
+ }
+}
+
+char *
+TAO_FlowProducer::go_to_listen (AVStreams::QoS & the_qos,
+ CORBA::Boolean is_mcast,
+ AVStreams::FlowEndPoint_ptr peer_fep,
+ char *& flowProtocol
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToListen,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed))
+{
+ return this->go_to_listen_i (TAO_FlowSpec_Entry::TAO_AV_PRODUCER,
+ the_qos,
+ is_mcast,
+ peer_fep,
+ flowProtocol
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_FlowProducer::connect_to_peer (AVStreams::QoS & the_qos,
+ const char * address,
+ const char * use_flow_protocol
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToConnect,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed))
+{
+ return this->connect_to_peer_i (TAO_FlowSpec_Entry::TAO_AV_PRODUCER,
+ the_qos,
+ address,
+ use_flow_protocol
+ ACE_ENV_ARG_PARAMETER);
+}
+// Connect to a IP multicast address.
+char *
+TAO_FlowProducer::connect_mcast (AVStreams::QoS & /* the_qos */,
+ CORBA::Boolean_out /* is_met */,
+ const char *address,
+ const char * use_flow_protocol
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToConnect,
+ AVStreams::notSupported,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed))
+{
+ // The address variable gives the multicast address to subscribe to.
+ for (u_int i=0;i<this->protocols_.length ();i++)
+ {
+ // choose the protocol which supports multicast.
+ }
+
+ if (address == 0)
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "TAO_FlowProducer::connect_mcast address is 0\n"));
+ TAO_Forward_FlowSpec_Entry *entry;
+ ACE_NEW_RETURN (entry,
+ TAO_Forward_FlowSpec_Entry(this->flowname_.in (),
+ "IN",
+ this->format_.in (),
+ use_flow_protocol,
+ address),
+ 0);
+
+ this->flow_spec_set_.insert (entry);
+ TAO_AV_Acceptor_Registry *acceptor_registry =
+ TAO_AV_CORE::instance ()->acceptor_registry ();
+ int result = acceptor_registry->open (this,
+ TAO_AV_CORE::instance (),
+ this->flow_spec_set_);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "TAO_FlowProducer::connect_mcast:acceptor_registry open failed\n"), 0);
+ // Now remove our handler from the reactor since we're a producer and dont want to get called for
+ // multicast packets.
+ ACE_Event_Handler *event_handler = entry->handler ()->event_handler ();
+ event_handler->reactor ()->remove_handler (event_handler,
+ ACE_Event_Handler::READ_MASK);
+ return CORBA::string_dup (address);
+}
+
+// sets the key for this flow.
+void
+TAO_FlowProducer::set_key (const AVStreams::key & the_key
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ CORBA::Any anyval;
+ anyval <<= the_key;
+ this->define_property ("PublicKey",
+ anyval
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_FlowProducer::set_key");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+// source id to be used to distinguish this source from others.
+void
+TAO_FlowProducer::set_source_id (CORBA::Long source_id
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->source_id_ = source_id;
+}
+
+// ------------------------------------------------------------
+// TAO_FlowConsumer
+// ------------------------------------------------------------
+
+
+// default constructor.
+TAO_FlowConsumer::TAO_FlowConsumer (void)
+{
+}
+
+TAO_FlowConsumer::TAO_FlowConsumer (const char *flowname,
+ AVStreams::protocolSpec protocols,
+ const char *format)
+{
+ this->open (flowname, protocols, format);
+}
+
+// The start, stop and destroy are to be handled by the application.
+void
+TAO_FlowConsumer::stop (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_AV_FlowSpecSetItor end = this->flow_spec_set_.end ();
+ for (TAO_AV_FlowSpecSetItor begin = this->flow_spec_set_.begin ();
+ begin != end; ++begin)
+ (*begin)->handler ()->stop (TAO_FlowSpec_Entry::TAO_AV_CONSUMER);
+}
+
+void
+TAO_FlowConsumer::start (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_AV_FlowSpecSetItor end = this->flow_spec_set_.end ();
+ for (TAO_AV_FlowSpecSetItor begin = this->flow_spec_set_.begin ();
+ begin != end; ++begin)
+ {
+ (*begin)->handler ()->start (TAO_FlowSpec_Entry::TAO_AV_CONSUMER);
+ }
+}
+
+char *
+TAO_FlowConsumer::go_to_listen (AVStreams::QoS & the_qos,
+ CORBA::Boolean is_mcast,
+ AVStreams::FlowEndPoint_ptr peer_fep,
+ char *& flowProtocol
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToListen,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed))
+{
+ return this->go_to_listen_i (TAO_FlowSpec_Entry::TAO_AV_CONSUMER,
+ the_qos,
+ is_mcast,
+ peer_fep,
+ flowProtocol
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_FlowConsumer::connect_to_peer (AVStreams::QoS & the_qos,
+ const char * address,
+ const char * use_flow_protocol
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToConnect,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed))
+{
+ return this->connect_to_peer_i (TAO_FlowSpec_Entry::TAO_AV_CONSUMER,
+ the_qos,
+ address,
+ use_flow_protocol
+ ACE_ENV_ARG_PARAMETER);
+}
+
+//------------------------------------------------------------
+// TAO_Tokenizer
+//------------------------------------------------------------
+TAO_Tokenizer::TAO_Tokenizer (const char *string, char delimiter)
+ :token_array_ (10),
+ count_ (0)
+{
+ this->parse (string, delimiter);
+}
+
+TAO_Tokenizer::~TAO_Tokenizer ()
+{
+ for (unsigned int i=0; i<this->num_tokens_; i++)
+ CORBA::string_free (this->token_array_[i]);
+}
+
+
+int
+TAO_Tokenizer::parse (const char *string, char delimiter)
+{
+ ACE_CString new_string (string);
+ u_int pos =0;
+ ACE_CString::size_type slash_pos = 0;
+ u_int count = 0;
+ int result;
+ while (pos < new_string.length ())
+ {
+ slash_pos = new_string.find (delimiter, pos);
+ ACE_CString substring;
+ if (slash_pos != new_string.npos)
+ {
+ substring = new_string.substring (pos,
+ slash_pos - pos);
+ pos = slash_pos + 1;
+ }
+ else
+ {
+ substring = new_string.substring (pos);
+ pos = static_cast<int> (new_string.length ());
+ }
+ char *token = CORBA::string_dup (substring.c_str ());
+ result = this->token_array_.set (token, count);
+ if (result == -1)
+ {
+ this->token_array_.size (this->token_array_.size ()*2);
+ result = this->token_array_.set (token, count);
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR, "TAO_Tokenizer::parse error"), -1);
+ }
+ count++;
+ }
+
+ /*
+ ACE_OS::strcpy (this->string_ , string);
+ char delimiter_str [2] = {0, 0};
+ delimiter_str [0] = delimiter;
+ char *token = ACE_OS::strtok (this->string_, delimiter_str);
+
+ while (token != 0)
+ {
+ result = this->token_array_.set (token, count);
+ if (result == -1)
+ {
+ this->token_array_.size (this->token_array_.size ()*2);
+ result = this->token_array_.set (token, count);
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR, "TAO_Tokenizer::parse error"), -1);
+ }
+ token = ACE_OS::strtok (0, delimiter_str);
+ count++;
+ }
+ */
+ this->num_tokens_ = count;
+ return 0;
+}
+
+char*
+TAO_Tokenizer::token (void)
+{
+ if (count_ < num_tokens_)
+ return CORBA::string_dup (this->token_array_[this->count_++]);
+ else
+ return 0;
+}
+
+int
+TAO_Tokenizer::num_tokens (void)
+{
+ return static_cast<int> (this->num_tokens_);
+}
+
+const char *
+TAO_Tokenizer::operator [] (size_t index) const
+{
+ if (index >= this->num_tokens_)
+ return 0;
+
+ return this->token_array_[index];
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h
new file mode 100644
index 00000000000..8e23294c9bc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h
@@ -0,0 +1,1536 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file AVStreams_i.h
+ *
+ * $Id$
+ *
+ * @author Sumedh Mungee <sumedh@cs.wustl.edu>
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef AVSTREAMS_I_H
+#define AVSTREAMS_I_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/AV_Core.h"
+
+#include "orbsvcs/AV/AV_export.h"
+#include "orbsvcs/CosPropertyS.h"
+#include "orbsvcs/AVStreamsS.h"
+#include "orbsvcs/Property/CosPropertyService_i.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/AV/AV_Core.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/Null_MediaCtrlS.h"
+#include "orbsvcs/AV/FlowSpec_Entry.h"
+
+#include "ace/OS.h"
+#include "ace/SOCK_Dgram_Mcast.h"
+#include "ace/ATM_Addr.h"
+#include "ace/Containers_T.h"
+#include "ace/Process.h"
+#include "ace/SOCK_CODgram.h"
+#include "ace/SOCK_Connector.h"
+#include "ace/Connector.h"
+#include "ace/Acceptor.h"
+#include "ace/SOCK_Stream.h"
+#include "ace/Svc_Handler.h"
+#include "ace/SOCK_Acceptor.h"
+
+#define FLOWSPEC_MAX 5
+// for the Hash_Map helper classes.
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef ACE_Hash_Map_Manager <ACE_CString,AVStreams::FlowEndPoint_var,ACE_Null_Mutex> FlowEndPoint_Map;
+typedef ACE_Hash_Map_Entry <ACE_CString,AVStreams::FlowEndPoint_var> FlowEndPoint_Map_Entry;
+typedef ACE_Hash_Map_Iterator <ACE_CString,AVStreams::FlowEndPoint_var,ACE_Null_Mutex> FlowEndPoint_Map_Iterator;
+
+typedef ACE_Hash_Map_Manager <ACE_CString,TAO_AV_Flow_Handler*,ACE_Null_Mutex> Flow_Handler_Map;
+typedef ACE_Hash_Map_Entry <ACE_CString,TAO_AV_Flow_Handler*> Flow_Handler_Map_Entry;
+typedef ACE_Hash_Map_Iterator <ACE_CString,TAO_AV_Flow_Handler*,ACE_Null_Mutex> Flow_Handler_Map_Iterator;
+
+
+
+class TAO_AV_Export AV_Null_MediaCtrl
+ : public virtual POA_Null_MediaCtrl
+{
+public:
+ AV_Null_MediaCtrl (void);
+
+protected:
+
+ virtual ~AV_Null_MediaCtrl (void);
+
+};
+
+/**
+ * @class TAO_Basic_StreamCtrl
+ * @brief Base class for StreamCtrl, implements basic stream start
+ * and stop functionality.
+ */
+class TAO_AV_Export TAO_Basic_StreamCtrl
+ : public virtual POA_AVStreams::Basic_StreamCtrl,
+ public virtual TAO_PropertySet
+{
+
+public:
+ /// Default Constructor
+ TAO_Basic_StreamCtrl (void);
+
+ /// Stop the transfer of data of the stream
+ /// Empty the_spec means apply operation to all flows
+ virtual void stop (const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow));
+
+ /// Start the transfer of data in the stream.
+ /// Empty the_spec means apply operation to all flows
+ virtual void start (const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow));
+
+ /**
+ * Tears down the stream. This will close the connection, and delete
+ * the streamendpoint and vdev associated with this stream
+ * Empty the_spec means apply operation to all flows
+ */
+ virtual void destroy (const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow));
+
+ /// Changes the QoS associated with the stream
+ /// Empty the_spec means apply operation to all flows
+ virtual CORBA::Boolean modify_QoS (AVStreams::streamQoS &new_qos,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed));
+
+ /// Used by StreamEndPoint and VDev to inform StreamCtrl of events.
+ /// E.g., loss of flow, reestablishment of flow, etc..
+ virtual void push_event (const struct CosPropertyService::Property & the_event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Used to control the flow protocol parameters.
+ virtual void set_FPStatus (const AVStreams::flowSpec &the_spec,
+ const char *fp_name,
+ const CORBA::Any &fp_settings
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::FPError));
+
+ /// Not implemented in the light profile, will raise the notsupported
+ /// exception
+ virtual CORBA::Object_ptr get_flow_connection (const char *flow_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::notSupported));
+
+ /// Not implemented in the light profile, will raise the notsupported
+ /// exception
+ virtual void set_flow_connection (const char *flow_name,
+ CORBA::Object_ptr flow_connection
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::notSupported));
+
+protected:
+
+ /// Destructor.
+ virtual ~TAO_Basic_StreamCtrl (void);
+
+
+ /// The Virtual Devices for this stream
+ AVStreams::VDev_var vdev_a_;
+ AVStreams::VDev_var vdev_b_;
+
+ /// The Endpoints for this stream
+ AVStreams::StreamEndPoint_A_var sep_a_;
+ AVStreams::StreamEndPoint_B_var sep_b_;
+
+ /// Hash table for the flow names and its corresponding flowconnection object reference.
+ typedef ACE_Hash_Map_Manager <ACE_CString,AVStreams::FlowConnection_var,ACE_Null_Mutex> FlowConnection_Map;
+ typedef ACE_Hash_Map_Iterator <ACE_CString,AVStreams::FlowConnection_var,ACE_Null_Mutex> FlowConnection_Map_Iterator;
+ typedef ACE_Hash_Map_Entry <ACE_CString,AVStreams::FlowConnection_var> FlowConnection_Map_Entry;
+ FlowConnection_Map flow_connection_map_;
+ AVStreams::FlowConnection_seq flowConnections_;
+
+ ///sequence of flow names.
+ u_int flow_count_;
+ AVStreams::flowSpec flows_;
+};
+
+class TAO_AV_Export TAO_Negotiator
+ : public POA_AVStreams::Negotiator
+{
+public:
+ virtual CORBA::Boolean negotiate (AVStreams::Negotiator_ptr remote_negotiator,
+ const AVStreams::streamQoS &qos_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+class TAO_MCastConfigIf;
+
+class TAO_AV_Export MMDevice_Map_Hash_Key
+{
+public:
+ /// default constructor.
+ MMDevice_Map_Hash_Key (void);
+
+ /// constructor.
+ MMDevice_Map_Hash_Key (AVStreams::MMDevice_ptr mmdevice);
+
+ /// copy constructor.
+ MMDevice_Map_Hash_Key (const MMDevice_Map_Hash_Key&);
+
+ /// destructor.
+ ~MMDevice_Map_Hash_Key (void);
+
+ /// operator== needed by ACE_Hash_Map_Manager.
+ bool operator == (const MMDevice_Map_Hash_Key &hash_key) const;
+
+ /// operator== needed by ACE_Hash_Map_Manager.
+ friend bool operator < (const MMDevice_Map_Hash_Key &left,
+ const MMDevice_Map_Hash_Key &right);
+
+ /// hash function for this mmdevice.
+ u_long hash (void) const;
+
+ static const int hash_maximum_;
+protected:
+ AVStreams::MMDevice_ptr mmdevice_;
+};
+
+/**
+ * @class TAO_StreamCtrl
+ * @brief Implementation the A/V StreamCtrl class. this class
+ * is used to control the stream. It should be subclassed
+ * by applications that want to provide more control features.
+ */
+class TAO_AV_Export TAO_StreamCtrl
+ : public virtual POA_AVStreams::StreamCtrl,
+ public virtual TAO_Basic_StreamCtrl
+{
+
+public:
+
+ /// Default Constructor
+ TAO_StreamCtrl (void);
+
+ /// virtual destructor.
+ virtual ~TAO_StreamCtrl (void);
+
+ /// Stop the transfer of data of the stream
+ /// Empty the_spec means apply operation to all flows
+ virtual void stop (const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow));
+
+ /// Start the transfer of data in the stream.
+ /// Empty the_spec means apply operation to all flows
+ virtual void start (const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow));
+
+ /**
+ * Tears down the stream. This will close the connection, and delete
+ * the streamendpoint and vdev associated with this stream
+ * Empty the_spec means apply operation to all flows
+ */
+ virtual void destroy (const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow));
+
+ /**
+ * Establish a stream between a_party and b_party,
+ * with qos the_qos, and for the flows in the_flows
+ * if the_flows is empty, bind all the flows
+ * Causes a connection to be established between the StreamEndpoints.
+ * Returns success/failure
+ */
+ virtual CORBA::Boolean bind_devs (AVStreams::MMDevice_ptr a_party,
+ AVStreams::MMDevice_ptr b_party,
+ AVStreams::streamQoS& the_qos,
+ const AVStreams::flowSpec& the_flows
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed));
+
+ /**
+ * Establish a connection between two streamendpoints. This can
+ * be used if the streamendpoints have been created independent of
+ * a MMDevice
+ */
+ virtual CORBA::Boolean bind (AVStreams::StreamEndPoint_A_ptr a_party,
+ AVStreams::StreamEndPoint_B_ptr b_party,
+ AVStreams::streamQoS &the_qos,
+ const AVStreams::flowSpec &the_flows
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed));
+
+ virtual void unbind_dev (AVStreams::MMDevice_ptr dev,
+ const AVStreams::flowSpec & the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow));
+
+ /// Unbind the_ep from the stream. Empty the_spec means apply to all flows.
+ virtual void unbind_party (AVStreams::StreamEndPoint_ptr the_ep,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow));
+
+ /// unbind the stream. Same effect as Basic_StreamCtrl::destroy ()
+ virtual void unbind (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed));
+
+ virtual AVStreams::VDev_ptr get_related_vdev (AVStreams::MMDevice_ptr adev,
+ AVStreams::StreamEndPoint_out sep
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed));
+
+ /// Changes the QoS associated with the stream
+ /// Empty the_spec means apply operation to all flows
+ virtual CORBA::Boolean modify_QoS (AVStreams::streamQoS &new_qos,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed));
+
+protected:
+
+ struct MMDevice_Map_Entry
+ {
+ AVStreams::StreamEndPoint_var sep_;
+ AVStreams::VDev_var vdev_;
+ AVStreams::flowSpec flowspec_;
+ AVStreams::streamQoS qos_;
+ };
+
+ typedef ACE_Hash_Map_Manager <MMDevice_Map_Hash_Key,MMDevice_Map_Entry,ACE_Null_Mutex> MMDevice_Map;
+ typedef ACE_Hash_Map_Iterator <MMDevice_Map_Hash_Key,MMDevice_Map_Entry,ACE_Null_Mutex> MMDevice_Map_Iterator;
+
+ MMDevice_Map mmdevice_a_map_;
+ MMDevice_Map mmdevice_b_map_;
+ TAO_MCastConfigIf *mcastconfigif_;
+ AVStreams::MCastConfigIf_var mcastconfigif_ptr_;
+ AVStreams::StreamCtrl_var streamctrl_;
+ CORBA::ULong source_id_;
+};
+
+class TAO_AV_Export TAO_MCastConfigIf
+ : public virtual POA_AVStreams::MCastConfigIf,
+ public virtual TAO_PropertySet
+{
+public:
+
+ enum Peer_Interface {VDEV = 0, FLOWENDPOINT=1};
+ struct Peer_Info
+ {
+ AVStreams::VDev_var peer_;
+ AVStreams::FlowEndPoint_var fep_;
+ AVStreams::streamQoS qos_;
+ AVStreams::flowSpec flow_spec_;
+ Peer_Interface interface_;
+ };
+
+ /// Default constructor.
+ TAO_MCastConfigIf (void);
+
+ /// Dtor
+ ~TAO_MCastConfigIf (void);
+
+ virtual CORBA::Boolean set_peer (CORBA::Object_ptr peer,
+ AVStreams::streamQoS & the_qos,
+ const AVStreams::flowSpec & the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::QoSRequestFailed,
+ AVStreams::streamOpFailed));
+
+ virtual void configure (const CosPropertyService::Property & a_configuration
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void set_initial_configuration (const CosPropertyService::Properties & initial
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void set_format (const char * flowName,
+ const char * format_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported));
+
+ virtual void set_dev_params (const char * flowName,
+ const CosPropertyService::Properties & new_params
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::PropertyException,
+ AVStreams::streamOpFailed));
+
+protected:
+ /// checks whether the flowname is in the flow_spec.
+ int in_flowSpec (const AVStreams::flowSpec& flow_spec, const char *flow_name);
+
+ /// Multicast socket.
+ ACE_SOCK_Dgram_Mcast sock_mcast_;
+
+ /// Initial configuration to be distributed to all B parties when they join.
+ CosPropertyService::Properties initial_configuration_;
+
+ ACE_DLList<Peer_Info> peer_list_;
+ ACE_DLList_Iterator<Peer_Info> peer_list_iterator_;
+};
+
+/**
+ * @class TAO_AV_QoS
+ * @brief Class for getting and setting the QoS characteristics of
+ * an AV Stream.
+ */
+class TAO_AV_Export TAO_AV_QoS
+{
+public:
+ /// constructor.
+ TAO_AV_QoS (void);
+
+ /// constructor taking a stream qos parameter.
+ TAO_AV_QoS (AVStreams::streamQoS &stream_qos);
+
+ /// sets the maps with the QoS paramter.
+ int set (AVStreams::streamQoS &stream_qos);
+
+ /// gets the flow_qos.
+ int get_flow_qos (const char *flowname,AVStreams::QoS &flow_qos);
+
+ /// converts the application level QoS to Network-level QoS.
+ int convert (AVStreams::streamQoS &network_qos);
+
+
+protected:
+ /// Stream Qos.
+ AVStreams::streamQoS stream_qos_;
+
+ ACE_Hash_Map_Manager<ACE_CString,AVStreams::QoS,ACE_Null_Mutex> qos_map_;
+};
+
+
+// Forward declarations.
+class TAO_AV_TCP_Flow_Handler;
+class TAO_AV_UDP_Flow_Handler;
+class TAO_AV_UDP_MCast_Flow_Handler;
+class TAO_AV_Protocol_Object;
+class TAO_AV_Callback;
+class TAO_AV_SourceManager;
+class TAO_AV_Source;
+class TAO_AV_RTP_State;
+class TAO_AV_Flow_Handler;
+
+/**
+ * @class TAO_Base_StreamEndPoint
+ *
+ * Base class for the A/V StreamEndPoint class. this class
+ * is used to control the stream. It should be subclassed
+ * by applications that want to provide more control features.
+ */
+class TAO_AV_Export TAO_Base_StreamEndPoint
+ :public virtual TAO_PropertySet
+{
+
+ // @@Naga: Rename this class to TAO_Base_EndPoint since both stream and flowendpoints derive from it.
+public:
+ TAO_Base_StreamEndPoint (void);
+ virtual ~TAO_Base_StreamEndPoint (void);
+
+ /// called when streamendpoint is instantiated
+ virtual int handle_open (void);
+
+ /// called when streamendpoint is being destructed
+ virtual int handle_close (void);
+
+ /// Application needs to define this
+ virtual int handle_stop (const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Application needs to define this
+ virtual int handle_start (const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Application needs to define this
+ virtual int handle_destroy (const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Application needs to define this
+ virtual CORBA::Boolean handle_preconnect (AVStreams::flowSpec &the_spec);
+
+ /// Application needs to define this
+ virtual CORBA::Boolean handle_postconnect (AVStreams::flowSpec &the_spec);
+
+ /// Application needs to define this
+ virtual CORBA::Boolean handle_connection_requested (AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ virtual int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+ virtual int get_control_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+ virtual int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+
+ virtual void set_flow_handler (const char *flowname,
+ TAO_AV_Flow_Handler *handler);
+
+ virtual void set_control_flow_handler (const char *flowname,
+ TAO_AV_Flow_Handler *handler);
+
+ TAO_AV_QoS &qos (void);
+
+ void protocol_object_set (void);
+ int is_protocol_object_set (void);
+
+protected:
+
+ TAO_AV_QoS qos_;
+ Flow_Handler_Map flow_handler_map_;
+ Flow_Handler_Map control_flow_handler_map_;
+ int protocol_object_set_;
+};
+
+// Forward declarations.
+class TAO_AV_Acceptor;
+class TAO_AV_Connector;
+class TAO_Forward_FlowSpec_Entry;
+class TAO_Reverse_FlowSpec_Entry;
+
+/**
+ * @class TAO_StreamEndPoint
+ * @brief The Stream EndPoint. Used to implement one endpoint of a stream
+ * that implements the transport layer.
+ */
+class TAO_AV_Export TAO_StreamEndPoint
+ : public virtual POA_AVStreams::StreamEndPoint,
+ public virtual TAO_Base_StreamEndPoint
+{
+
+public:
+ /// Constructor
+ TAO_StreamEndPoint (void);
+
+ /// Stop the stream. Empty the_spec means, for all the flows
+ virtual void stop (const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow));
+
+ /// Start the stream, Empty the_spec means, for all the flows
+ virtual void start (const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow));
+
+ /// Destroy the stream, Empty the_spec means, for all the flows
+ virtual void destroy (const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow));
+
+ /// Called by StreamCtrl. responder is the peer to connect to
+ virtual CORBA::Boolean connect (AVStreams::StreamEndPoint_ptr responder,
+ AVStreams::streamQoS& qos_spec,
+ const AVStreams::flowSpec& the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed,
+ AVStreams::streamOpFailed));
+
+ /// Called by the peer StreamEndPoint. The flow_spec indicates the
+ /// flows (which contain transport addresses etc.)
+ virtual CORBA::Boolean request_connection (AVStreams::StreamEndPoint_ptr initiator,
+ CORBA::Boolean is_mcast,
+ AVStreams::streamQoS &qos,
+ AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpDenied,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed,
+ AVStreams::FPError));
+
+ /// Change the transport qos on a stream
+ virtual CORBA::Boolean modify_QoS (AVStreams::streamQoS &new_qos,
+ const AVStreams::flowSpec &the_flows
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed));
+
+ virtual int change_qos (AVStreams::streamQoS &new_qos,
+ const AVStreams::flowSpec &the_flows
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Used to restrict the set of protocols
+ virtual CORBA::Boolean set_protocol_restriction (const AVStreams::protocolSpec &the_pspec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// disconnect the flows
+ virtual void disconnect (const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::streamOpFailed));
+
+ /// Used to control the flow
+ virtual void set_FPStatus (const AVStreams::flowSpec &the_spec,
+ const char *fp_name,
+ const CORBA::Any &fp_settings
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::FPError));
+
+ /// Not implemented in the light profile, throws notsupported
+ virtual CORBA::Object_ptr get_fep (const char *flow_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::noSuchFlow));
+
+ /// Not implemented in the light profile, throws notsupported
+ virtual char * add_fep (CORBA::Object_ptr the_fep
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::streamOpFailed));
+
+ /// Not implemented in the light profile, throws notsupported
+ virtual void remove_fep (const char *fep_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::streamOpFailed));
+
+ /// Used to "attach" a negotiator to the endpoint
+ virtual void set_negotiator (AVStreams::Negotiator_ptr new_negotiator
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Used for public key encryption.
+ virtual void set_key (const char *flow_name,
+ const AVStreams::key & the_key
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Used to set a unique id for packets sent by this streamendpoint
+ virtual void set_source_id (CORBA::Long source_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Destructor
+ virtual ~TAO_StreamEndPoint (void);
+
+ CORBA::Boolean multiconnect (AVStreams::streamQoS &the_qos,
+ AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL);
+
+protected:
+ /// Helper methods to implement add_fep()
+ char* add_fep_i (AVStreams::FlowEndPoint_ptr fep
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::streamOpFailed));
+ char* add_fep_i_add_property (AVStreams::FlowEndPoint_ptr fep
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::streamOpFailed));
+
+ /// translate from application level to network level qos.
+ int translate_qos (const AVStreams::streamQoS& application_qos,
+ AVStreams::streamQoS& network_qos);
+
+ /// Count of the number of flows in this streamendpoint, used to
+ /// generate unique names for the flows.
+ u_int flow_count_;
+
+ /// current flow number used for system generation of flow names.
+ u_int flow_num_;
+
+ /// hash table for the flownames and its corresponding flowEndpoint reference.
+ FlowEndPoint_Map fep_map_;
+
+ /// sequence of supported flow names.
+ AVStreams::flowSpec flows_;
+
+ /// source id used for multicast.
+ CORBA::Long source_id_;
+
+ /// our local negotiator for QoS.
+ AVStreams::Negotiator_var negotiator_;
+
+ /// Our available list of protocols.
+ AVStreams::protocolSpec protocols_;
+
+ /// Chosen protocol for this streamendpoint based on availableprotocols property.
+ CORBA::String_var protocol_;
+
+ /// Key used for encryption.
+ AVStreams::key key_;
+
+/// TAO_Forward_FlowSpec_Entry forward_entries_ [FLOWSPEC_MAX];
+/// TAO_Reverse_FlowSpec_Entry reverse_entries_ [FLOWSPEC_MAX];
+ u_short mcast_port_;
+ ACE_CString mcast_addr_;
+ ACE_Hash_Map_Manager <ACE_CString, TAO_FlowSpec_Entry*,ACE_Null_Mutex> mcast_entry_map_;
+ TAO_AV_FlowSpecSet forward_flow_spec_set;
+ TAO_AV_FlowSpecSet reverse_flow_spec_set;
+ AVStreams::StreamEndPoint_var peer_sep_;
+ AVStreams::SFPStatus *sfp_status_;
+ AVStreams::StreamCtrl_var streamctrl_;
+};
+
+/**
+ * @class TAO_StreamEndPoint_A
+ * @brief The "A" side of a streamendpoint
+ */
+class TAO_AV_Export TAO_StreamEndPoint_A :
+ public virtual POA_AVStreams::StreamEndPoint_A,
+ public virtual TAO_StreamEndPoint
+{
+
+public:
+ /// Constructor
+ TAO_StreamEndPoint_A (void);
+
+ /// Used for ATM-style multicast
+ virtual CORBA::Boolean multiconnect (AVStreams::streamQoS &the_qos,
+ AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed,
+ AVStreams::streamOpFailed));
+
+ /// Used for ATM-style multicast
+ virtual CORBA::Boolean connect_leaf (AVStreams::StreamEndPoint_B_ptr the_ep,
+ AVStreams::streamQoS &the_qos,
+ const AVStreams::flowSpec &the_flows
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed,
+ AVStreams::notSupported));
+
+ /// Used to remove a multicast leaf
+ virtual void disconnect_leaf (AVStreams::StreamEndPoint_B_ptr the_ep,
+ const AVStreams::flowSpec &theSpec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow,
+ AVStreams::notSupported));
+
+ /// Destructor
+ virtual ~TAO_StreamEndPoint_A (void);
+
+};
+
+// For backward compatibility.
+#define TAO_Client_StreamEndPoint TAO_StreamEndPoint_A
+#define TAO_Server_StreamEndPoint TAO_StreamEndPoint_B
+
+/**
+ * @class TAO_StreamEndPoint_B
+ * @brief The "B" side of a streamendpoint
+ */
+class TAO_AV_Export TAO_StreamEndPoint_B :
+ public virtual POA_AVStreams::StreamEndPoint_B,
+ public virtual TAO_StreamEndPoint
+{
+ // = DESCRIPTION
+ // The "B" side of a streamendpoint
+public:
+ /// Constructor
+ TAO_StreamEndPoint_B (void);
+
+ /// Used for internet-style multicast
+ virtual CORBA::Boolean multiconnect (AVStreams::streamQoS &the_qos,
+ AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed,
+ AVStreams::FPError));
+
+ /// Destructor
+ virtual ~TAO_StreamEndPoint_B (void);
+};
+
+/**
+ * @class TAO_VDev
+ * @brief Implements the VDev interface. One of these is created per
+ * connection, and represents device-specific parameters.
+ */
+class TAO_AV_Export TAO_VDev
+ :public virtual TAO_PropertySet,
+ public virtual POA_AVStreams::VDev
+{
+
+public:
+ /// Default Constructor
+ TAO_VDev (void);
+
+ /// Called to tell the vdev who the streamctrl, peer vdev is
+ virtual CORBA::Boolean set_peer (AVStreams::StreamCtrl_ptr the_ctrl,
+ AVStreams::VDev_ptr the_peer_dev,
+ AVStreams::streamQoS &the_qos,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed,
+ AVStreams::streamOpFailed));
+
+ /// Used to set the streamctrl and multicast device
+ virtual CORBA::Boolean set_Mcast_peer (AVStreams::StreamCtrl_ptr the_ctrl,
+ AVStreams::MCastConfigIf_ptr a_mcastconfigif,
+ AVStreams::streamQoS &the_qos,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed,
+ AVStreams::streamOpFailed));
+
+ /// Called by the peer VDev to configure the device (catch all)
+ virtual void configure (const CosPropertyService::Property &the_config_mesg
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::PropertyException,
+ AVStreams::streamOpFailed));
+
+ /// Used to set a format on a flowname
+ virtual void set_format (const char *flowName,
+ const char *format_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported));
+
+ /// Used to set device parameters
+ virtual void set_dev_params (const char *flowName,
+ const CosPropertyService::Properties &new_params
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::PropertyException,
+ AVStreams::streamOpFailed));
+
+ /// Called to change QoS of the device
+ virtual CORBA::Boolean modify_QoS (AVStreams::streamQoS &the_qos,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed));
+
+protected:
+ /// Destructor for a servant should be protected or private.
+ /// Use _remove_ref() to delete this servant.
+ virtual ~TAO_VDev (void);
+
+ /// hook called after set_peer is done to set the media ctrl of the peer vdev.
+ virtual CORBA::Boolean set_media_ctrl (CORBA::Object_ptr media_ctrl
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// My stream controller
+ AVStreams::StreamCtrl_var streamctrl_;
+
+ /// My peer
+ AVStreams::VDev_var peer_;
+
+ /// The multicast VDev peer.
+ AVStreams::MCastConfigIf_var mcast_peer_;
+};
+
+class TAO_AV_Endpoint_Strategy;
+
+/**
+ * @class TAO_MMDevice
+ * @brief Implements a factory to create Endpoints and VDevs
+ */
+class TAO_AV_Export TAO_MMDevice
+ :public virtual POA_AVStreams::MMDevice,
+ public virtual TAO_PropertySet
+{
+
+public:
+
+ /// Constructor
+ enum MMDevice_Type {MMDEVICE_A = 0,MMDEVICE_B = 1};
+ TAO_MMDevice (TAO_AV_Endpoint_Strategy *endpoint_strategy_);
+
+ virtual AVStreams::StreamEndPoint_ptr create_A_B (MMDevice_Type type,
+ AVStreams::StreamCtrl_ptr the_requester,
+ AVStreams::VDev_out the_vdev,
+ AVStreams::streamQoS &the_qos,
+ CORBA::Boolean_out met_qos,
+ char *&named_vdev,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Can be used to request the MMDevice to create a new StreamCtrl,
+ /// and call bind_devs on it
+ virtual AVStreams::StreamCtrl_ptr bind (AVStreams::MMDevice_ptr peer_device,
+ AVStreams::streamQoS &the_qos,
+ CORBA::Boolean_out is_met,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed));
+
+ /// Multicast bind
+ virtual AVStreams::StreamCtrl_ptr bind_mcast (AVStreams::MMDevice_ptr first_peer,
+ AVStreams::streamQoS &the_qos,
+ CORBA::Boolean_out is_met,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed));
+
+ /// Called by StreamCtrl to create a "A" type streamandpoint and vdev
+ virtual AVStreams::StreamEndPoint_A_ptr create_A (AVStreams::StreamCtrl_ptr the_requester,
+ AVStreams::VDev_out the_vdev,
+ AVStreams::streamQoS &the_qos,
+ CORBA::Boolean_out met_qos,
+ char *&named_vdev,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::streamOpDenied,
+ AVStreams::notSupported,
+ AVStreams::QoSRequestFailed,
+ AVStreams::noSuchFlow));
+
+ /// Called by StreamCtrl to create a "B" type streamandpoint and vdev
+ virtual AVStreams::StreamEndPoint_B_ptr create_B (AVStreams::StreamCtrl_ptr the_requester,
+ AVStreams::VDev_out the_vdev,
+ AVStreams::streamQoS &the_qos,
+ CORBA::Boolean_out met_qos,
+ char *&named_vdev,
+ const AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::streamOpDenied,
+ AVStreams::notSupported,
+ AVStreams::QoSRequestFailed,
+ AVStreams::noSuchFlow));
+
+ /// Remove the StreamEndPoint and the related vdev
+ virtual void destroy (AVStreams::StreamEndPoint_ptr the_ep,
+ const char *vdev_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported));
+
+ /// Not supported in the light profile, raises notsupported
+ virtual char * add_fdev (CORBA::Object_ptr the_fdev
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::streamOpFailed));
+
+ /// Not supported in the light profile, raises notsupported
+ virtual CORBA::Object_ptr get_fdev (const char *flow_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::noSuchFlow));
+
+ /// Not supported in the light profile, raises notsupported
+ virtual void remove_fdev (const char *flow_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::noSuchFlow,
+ AVStreams::streamOpFailed));
+
+ /// Destructor
+ virtual ~TAO_MMDevice (void);
+
+protected:
+ /// Helper method to implement add_fdev()
+ char* add_fdev_i (AVStreams::FDev_ptr fdev
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported,
+ AVStreams::streamOpFailed));
+
+protected:
+
+ TAO_AV_Endpoint_Strategy *endpoint_strategy_;
+
+ /// Count of the number of flows in this MMDevice , used to
+ /// generate unique names for the flows.
+ u_int flow_count_;
+
+ /// current flow number used for system generation of flow names.
+ u_int flow_num_;
+
+ typedef ACE_Hash_Map_Manager <ACE_CString,AVStreams::FDev_var,ACE_Null_Mutex> FDev_Map;
+ typedef ACE_Hash_Map_Iterator <ACE_CString,AVStreams::FDev_var,ACE_Null_Mutex> FDev_Map_Iterator;
+ typedef ACE_Hash_Map_Entry <ACE_CString,AVStreams::FDev_var> FDev_Map_Entry;
+
+ /// hash table for the flownames and its corresponding flowEndpoint
+ /// reference.
+ FDev_Map fdev_map_;
+
+ /// sequence of supported flow names.
+ AVStreams::flowSpec flows_;
+
+ TAO_StreamCtrl *stream_ctrl_;
+};
+
+class TAO_FlowConsumer;
+class TAO_FlowProducer;
+
+/**
+ * @class TAO_FlowConnection
+ * @brief This class currently supports only one producer and one
+ * consumer per flow.
+ */
+class TAO_AV_Export TAO_FlowConnection
+ : public virtual POA_AVStreams::FlowConnection,
+ public virtual TAO_PropertySet
+{
+
+public:
+ /// default constructor.
+ TAO_FlowConnection (void);
+
+ /// stop this flow.
+ virtual void stop (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// start this flow.
+ virtual void start (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// destroy this flow.
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// modify the QoS for this flow.
+ virtual CORBA::Boolean modify_QoS (AVStreams::QoS & new_qos
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::QoSRequestFailed));
+
+ /// use the specified flow protocol for this flow.
+ virtual CORBA::Boolean use_flow_protocol (const char * fp_name,
+ const CORBA::Any & fp_settings
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::FPError,
+ AVStreams::notSupported));
+
+ /// pushes an event , to be handled by the application.
+ virtual void push_event (const AVStreams::streamEvent & the_event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+ /// connect 2 Flow Devices.
+ virtual CORBA::Boolean connect_devs (AVStreams::FDev_ptr a_party,
+ AVStreams::FDev_ptr b_party,
+ AVStreams::QoS & the_qos
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::streamOpDenied,
+ AVStreams::QoSRequestFailed));
+
+ /// Connect a flow producer and consumer under this flow connection.
+ virtual CORBA::Boolean connect (AVStreams::FlowProducer_ptr flow_producer,
+ AVStreams::FlowConsumer_ptr flow_consumer,
+ AVStreams::QoS & the_qos
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::formatMismatch,
+ AVStreams::FEPMismatch,
+ AVStreams::alreadyConnected));
+
+ /// disconnect this flow connection.
+ virtual CORBA::Boolean disconnect (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// adds the producer to this flow connection.
+ virtual CORBA::Boolean add_producer (AVStreams::FlowProducer_ptr flow_producer,
+ AVStreams::QoS & the_qos
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::alreadyConnected,
+ AVStreams::notSupported));
+
+ /// adds a consumer to this flow connection.
+ virtual CORBA::Boolean add_consumer (AVStreams::FlowConsumer_ptr flow_consumer,
+ AVStreams::QoS & the_qos
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::alreadyConnected));
+
+ /// drops a flow endpoint from the flow.
+ virtual CORBA::Boolean drop (AVStreams::FlowEndPoint_ptr target
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notConnected));
+
+ int set_mcast_addr (ACE_CString addr,u_short port);
+ void set_protocol (const char *protocol);
+protected:
+ typedef ACE_Unbounded_Set<AVStreams::FlowProducer_ptr> FlowProducer_Set;
+ typedef ACE_Unbounded_Set_Iterator<AVStreams::FlowProducer_ptr> FlowProducer_SetItor;
+ typedef ACE_Unbounded_Set<AVStreams::FlowConsumer_ptr> FlowConsumer_Set;
+ typedef ACE_Unbounded_Set_Iterator<AVStreams::FlowConsumer_ptr> FlowConsumer_SetItor;
+
+ /// The multicast address returned by the producer.
+ FlowProducer_Set flow_producer_set_;
+ FlowConsumer_Set flow_consumer_set_;
+ CORBA::String_var fp_name_;
+ CORBA::Any fp_settings_;
+ CORBA::String_var producer_address_;
+
+ /// IP Multicasting is used.
+ int ip_multicast_;
+ TAO_MCastConfigIf *mcastconfigif_i_;
+ AVStreams::MCastConfigIf_var mcastconfigif_;
+ u_short mcast_port_;
+ ACE_CString mcast_addr_;
+ CORBA::String_var protocol_;
+};
+
+/**
+ * @class TAO_FlowEndPoint
+ * @brief This class is used per flow e.g video flow and an audio flow
+ * to encapsulate the transport details.
+ */
+class TAO_AV_Export TAO_FlowEndPoint :
+ public virtual POA_AVStreams::FlowEndPoint,
+ public virtual TAO_Base_StreamEndPoint
+{
+
+public:
+
+ ///default constructor.
+ TAO_FlowEndPoint (void);
+
+ TAO_FlowEndPoint (const char *flowname,
+ AVStreams::protocolSpec &protocols,
+ const char *format);
+
+ int open (const char *flowname,
+ AVStreams::protocolSpec &protocols,
+ const char *format);
+
+ int set_flowname (const char *flowname);
+
+ virtual void set_flow_handler (const char *flowname,
+ TAO_AV_Flow_Handler *handler);
+
+ virtual int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+
+ /// lock the flow endpoint for a particular flow.
+ virtual CORBA::Boolean lock (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// unlock the flow endpoint for subsequent use.
+ virtual void unlock (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+ /// destroy this flow.
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// get method for the related streamendpoint under which this
+ /// flowendpoint is.
+ virtual AVStreams::StreamEndPoint_ptr related_sep(ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// set method for the related streamendpoint under which this
+ /// flowendpoint is.
+ virtual void related_sep (AVStreams::StreamEndPoint_ptr related_sep
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual AVStreams::FlowConnection_ptr related_flow_connection(ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // accessor for the related flow connection attribute.
+
+ /// set method for the related flow connection attribute.
+ virtual void related_flow_connection (AVStreams::FlowConnection_ptr related_flow_connection
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// returns the other flowendpoint to which this is connected.
+ virtual AVStreams::FlowEndPoint_ptr get_connected_fep (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notConnected,
+ AVStreams::notSupported));
+
+ //// use the specified flow protocol.
+ virtual CORBA::Boolean use_flow_protocol (const char * fp_name,
+ const CORBA::Any & fp_settings
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::FPError,
+ AVStreams::notSupported));
+
+ /// sets the data format.
+ virtual void set_format (const char * format
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported));
+
+ /// sets the device parameters.
+ virtual void set_dev_params (const CosPropertyService::Properties & new_settings
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::PropertyException,
+ AVStreams::streamOpFailed));
+
+ /// sets the list of protocols to be used.
+ virtual void set_protocol_restriction (const AVStreams::protocolSpec & the_spec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported));
+
+ /// checks whether the passed flowendpoint is compatible with this.
+ virtual CORBA::Boolean is_fep_compatible (AVStreams::FlowEndPoint_ptr fep
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::formatMismatch,
+ AVStreams::deviceQosMismatch));
+
+ /// sets the peer flowendpoint.
+ virtual CORBA::Boolean set_peer (AVStreams::FlowConnection_ptr the_fc,
+ AVStreams::FlowEndPoint_ptr the_peer_fep,
+ AVStreams::QoS & the_qos
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::QoSRequestFailed,
+ AVStreams::streamOpFailed));
+
+ /// sets the multicast peer flowendpoint, not implemented.
+ virtual CORBA::Boolean set_Mcast_peer (AVStreams::FlowConnection_ptr the_fc,
+ AVStreams::MCastConfigIf_ptr a_mcastconfigif,
+ AVStreams::QoS & the_qos
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::QoSRequestFailed));
+
+
+ /**
+ * This should be implemented in both the FlowProducer and consumer and hence is
+ * pure virtual since we need to know the role of the flowendpoint to create appropriate
+ * protocol objects. eg. in SFP to create Producer Object/ Consumer Object.
+ */
+ virtual CORBA::Boolean connect_to_peer (AVStreams::QoS & the_qos,
+ const char * address,
+ const char * use_flow_protocol
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToConnect,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed)) = 0;
+
+ /// connect to the peer endpoint.
+ virtual CORBA::Boolean connect_to_peer_i (TAO_FlowSpec_Entry::Role role,
+ AVStreams::QoS & the_qos,
+ const char * address,
+ const char * use_flow_protocol
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToConnect,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed));
+
+ /**
+ * This should be implemented in both the FlowProducer and consumer and hence is
+ * pure virtual since we need to know the role of the flowendpoint to create appropriate
+ * protocol objects. eg. in SFP to create Producer Object/ Consumer Object.
+ */
+ virtual char * go_to_listen (AVStreams::QoS & the_qos,
+ CORBA::Boolean is_mcast,
+ AVStreams::FlowEndPoint_ptr peer,
+ char *& flowProtocol
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToListen,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed)) = 0;
+
+ /// listen request from the peer.
+ virtual char * go_to_listen_i (TAO_FlowSpec_Entry::Role role,
+ AVStreams::QoS & the_qos,
+ CORBA::Boolean is_mcast,
+ AVStreams::FlowEndPoint_ptr peer,
+ char *& flowProtocol
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToListen,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed));
+
+
+protected:
+ /// The related streamendpoint.
+ AVStreams::StreamEndPoint_var related_sep_;
+
+ /// The related flow connection reference
+ AVStreams::FlowConnection_var related_flow_connection_;
+
+ /// The peer flowendpoint reference.
+ AVStreams::FlowEndPoint_var peer_fep_;
+
+ /// Available protocols for this flowendpoint.
+ AVStreams::protocolSpec protocols_;
+
+ /// Address information for the protocols.
+ AVStreams::protocolSpec protocol_addresses_;
+
+ /// The multicast peer endpoint.
+ AVStreams::MCastConfigIf_var mcast_peer_;
+
+ /// Lock.
+ CORBA::Boolean lock_;
+
+ CORBA::String_var format_;
+ CORBA::String_var flowname_;
+ CosPropertyService::Properties dev_params_;
+ TAO_AV_FlowSpecSet flow_spec_set_;
+ CORBA::String_var reverse_channel_;
+};
+
+class TAO_AV_Export TAO_FlowProducer:
+ public virtual POA_AVStreams::FlowProducer,
+ public virtual TAO_FlowEndPoint
+{
+public:
+ /// default constructor
+ TAO_FlowProducer (void);
+
+ TAO_FlowProducer (const char *flowname,
+ AVStreams::protocolSpec protocols,
+ const char *format);
+
+ /**
+ * get the reverse channel, to be used for feedback for protocols like UDP.
+ * @@Naga: In the spec this is defined in the TAO_FlowProducer but it seems more reasonable for this
+ * to be in a FlowEndPoint since any of the flowendpoints can be made to listen. So in the case of
+ * UDP if the producer is listening and the consumer connects (logically) then the producer needs to
+ * know the reverse channel on its peer fep to send data to.
+ */
+ virtual char * get_rev_channel (const char * pcol_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// stop this flow, to be overridden by the application.
+ virtual void stop (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// start this flow, to be overridden by the application.
+ virtual void start (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual char * go_to_listen (AVStreams::QoS & the_qos,
+ CORBA::Boolean is_mcast,
+ AVStreams::FlowEndPoint_ptr peer,
+ char *& flowProtocol
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToListen,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed));
+
+ virtual CORBA::Boolean connect_to_peer (AVStreams::QoS & the_qos,
+ const char * address,
+ const char * use_flow_protocol
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToConnect,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed));
+
+ /// connect to the multicast address, not implemented.
+ virtual char * connect_mcast (AVStreams::QoS & the_qos,
+ CORBA::Boolean_out is_met,
+ const char * address,
+ const char * use_flow_protocol
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToConnect,
+ AVStreams::notSupported,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed));
+
+
+
+ /// sets the public key to be used for encryption of the data.
+ virtual void set_key (const AVStreams::key & the_key
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// sets the source id of this flow producer so that it can be used
+ /// to distinguish this producer from others in the multicast case.
+ virtual void set_source_id (CORBA::Long source_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+ /// source id of this producer.
+ CORBA::Long source_id_;
+ CORBA::String_var peer_address_;
+};
+
+class TAO_AV_Export TAO_FlowConsumer :
+ public virtual POA_AVStreams::FlowConsumer,
+ public virtual TAO_FlowEndPoint
+{
+public:
+ /// default constructor.
+ TAO_FlowConsumer (void);
+
+ TAO_FlowConsumer (const char *flowname,
+ AVStreams::protocolSpec protocols,
+ const char *format);
+
+ /// stop this flow, to be overridden by the application.
+ virtual void stop (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// start this flow, to be overridden by the application.
+ virtual void start (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual char * go_to_listen (AVStreams::QoS & the_qos,
+ CORBA::Boolean is_mcast,
+ AVStreams::FlowEndPoint_ptr peer,
+ char *& flowProtocol
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToListen,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed));
+
+ virtual CORBA::Boolean connect_to_peer (AVStreams::QoS & the_qos,
+ const char * address,
+ const char * use_flow_protocol
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::failedToConnect,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed));
+};
+
+/**
+ * @class TAO_MediaControl
+ * @brief Abstract Mediacontrol class.
+ * The following are to be handled by the specialized media control
+ * for the specific media like camera, speaker.
+ */
+class TAO_AV_Export TAO_MediaControl
+ :public virtual POA_AVStreams::MediaControl
+{
+
+public:
+ /// default constructor
+ TAO_MediaControl (void);
+
+ virtual AVStreams::Position get_media_position (AVStreams::PositionOrigin an_origin,
+ AVStreams::PositionKey a_key
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::MediaControl::PostionKeyNotSupported)) =0;
+
+ virtual void set_media_position (const AVStreams::Position & a_position
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::MediaControl::PostionKeyNotSupported,
+ AVStreams::InvalidPosition)) =0;
+
+ virtual void start (const AVStreams::Position & a_position
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::InvalidPosition)) =0;
+
+ virtual void pause (const AVStreams::Position & a_position
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::InvalidPosition)) =0;
+
+ virtual void resume (const AVStreams::Position & a_position
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::InvalidPosition)) =0;
+
+ virtual void stop (const AVStreams::Position & a_position
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::InvalidPosition)) =0;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include "orbsvcs/AV/Transport.h"
+
+#if defined (__ACE_INLINE__)
+#include "tao/debug.h"
+#include "orbsvcs/AV/AVStreams_i.i"
+#endif /* __ACE_INLINE__ */
+
+#include "orbsvcs/AV/Flows_T.h"
+
+#include /**/ "ace/post.h"
+#endif /* AVSTREAMS_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.i b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.i
new file mode 100644
index 00000000000..81731c09f05
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.i
@@ -0,0 +1,62 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_AV_QoS &
+TAO_Base_StreamEndPoint::qos (void)
+{
+ return this->qos_;
+}
+
+ACE_INLINE
+int
+TAO_AV_QoS::set (AVStreams::streamQoS &stream_qos)
+{
+ this->stream_qos_ = stream_qos;
+
+ for (u_int j=0;j<this->stream_qos_.length ();j++)
+ {
+ ACE_CString qos_key (CORBA::string_dup (this->stream_qos_[j].QoSType));
+ int result = this->qos_map_.bind (qos_key,this->stream_qos_[j]);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N,%l) TAO_AV_QoS::set qos_map::bind failed\n"),-1);
+ }
+ return 0;
+}
+
+
+ACE_INLINE
+int
+TAO_AV_QoS::get_flow_qos (const char *flowname,
+ AVStreams::QoS &flow_qos)
+{
+ int result = this->qos_map_.find (flowname,
+ flow_qos);
+
+ if (result < 0)
+ {
+ if (TAO_debug_level > 0 ) {
+ ACE_DEBUG((LM_DEBUG, "(%N,%l) qos_map contains the flows:\n"));
+
+ ACE_Hash_Map_Manager<ACE_CString,AVStreams::QoS,ACE_Null_Mutex>::ITERATOR iter
+ = qos_map_.begin();
+
+ while( iter != qos_map_.end() )
+ {
+ ACE_DEBUG((LM_DEBUG, " %s\n", (*iter).ext_id_.c_str() ));
+ ++iter;
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) TAO_AV_QOS::get_flow_qos qos_map::find failed for %s\n", flowname));
+ }
+ return -1;
+ }
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/AV_Core.cpp b/TAO/orbsvcs/orbsvcs/AV/AV_Core.cpp
new file mode 100644
index 00000000000..830f8fe5e98
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/AV_Core.cpp
@@ -0,0 +1,1186 @@
+// $Id$
+
+#include "orbsvcs/AV/AV_Core.h"
+#include "orbsvcs/AV/FlowSpec_Entry.h"
+#include "orbsvcs/AV/Transport.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+#include "orbsvcs/AV/UDP.h"
+#include "orbsvcs/AV/TCP.h"
+#include "orbsvcs/AV/RTP.h"
+#include "orbsvcs/AV/RTCP.h"
+#include "orbsvcs/AV/sfp.h"
+#include "orbsvcs/AV/default_resource.h"
+
+#if defined (ACE_HAS_RAPI) || defined (ACE_HAS_WINSOCK2_GQOS)
+#include "orbsvcs/AV/QoS_UDP.h"
+#endif /* ACE_HAS_RAPI || ACE_HAS_WINSOCK2_GQOS */
+
+#if defined (ACE_HAS_SCTP)
+#include "orbsvcs/AV/SCTP_SEQ.h"
+#endif // ACE_HAS_SCTP
+
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+
+#include "ace/Dynamic_Service.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//------------------------------------------------------------
+// TAO_AV_Core
+//------------------------------------------------------------
+
+TAO_AV_Core::TAO_AV_Core (void)
+ :connector_registry_ (0),
+ acceptor_registry_ (0)
+{
+ ACE_NEW (this->connector_registry_,
+ TAO_AV_Connector_Registry
+ );
+ ACE_NEW (this->acceptor_registry_,
+ TAO_AV_Acceptor_Registry
+ );
+}
+
+TAO_AV_Core::~TAO_AV_Core (void)
+{
+ delete this->connector_registry_;
+ delete this->acceptor_registry_;
+
+ TAO_AV_TransportFactorySetItor transport_iter =
+ this->transport_factories_.begin();
+
+ while (transport_iter != this->transport_factories_.end())
+ {
+ if ((*transport_iter)->factory()->ref_count != 1)
+ {
+ delete (*transport_iter)->factory();
+ }
+ delete (*transport_iter);
+ transport_iter++;
+ }
+
+ TAO_AV_Flow_ProtocolFactorySetItor flow_iter =
+ this->flow_protocol_factories_.begin();
+
+ while (flow_iter != this->flow_protocol_factories_.end())
+ {
+ if ((*flow_iter)->factory()->ref_count != 1)
+ {
+ delete (*flow_iter)->factory();
+ }
+ delete (*flow_iter);
+
+ flow_iter++;
+ }
+}
+
+CORBA::ORB_ptr
+TAO_AV_Core::orb (void)
+{
+ return this->orb_.in ();
+}
+
+void
+TAO_AV_Core::orb (CORBA::ORB_ptr orb)
+{
+ this->orb_ = orb;
+}
+
+PortableServer::POA_ptr
+TAO_AV_Core::poa (void)
+{
+ return this->poa_.in ();
+}
+
+void
+TAO_AV_Core::poa (PortableServer::POA_ptr poa)
+{
+ this->poa_ = poa;
+}
+
+TAO_AV_Connector_Registry*
+TAO_AV_Core::connector_registry (void)
+{
+ return this->connector_registry_;
+}
+
+TAO_AV_Acceptor_Registry*
+TAO_AV_Core::acceptor_registry (void)
+{
+ return this->acceptor_registry_;
+}
+
+TAO_AV_TransportFactorySet *
+TAO_AV_Core::transport_factories (void)
+{
+ return &this->transport_factories_;
+}
+
+TAO_AV_Flow_ProtocolFactorySet*
+TAO_AV_Core::flow_protocol_factories (void)
+{
+ return &this->flow_protocol_factories_;
+}
+
+int
+TAO_AV_Core::stop_run (void)
+{
+ this->stop_run_ = 1;
+ return 0;
+}
+
+int
+TAO_AV_Core::run (void)
+{
+ this->stop_run_ = 0;
+ while (!this->stop_run_ && this->orb_->work_pending ())
+ this->orb_->perform_work ();
+ return 0;
+}
+
+void
+TAO_AV_Core::reactor (ACE_Reactor *r)
+{
+ this->reactor_ = r;
+}
+
+ACE_Reactor *
+TAO_AV_Core::reactor (void)
+{
+ return this->reactor_;
+}
+
+
+int
+TAO_AV_Core::init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_Core::init "));
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+ this->poa_ = PortableServer::POA::_duplicate (poa);
+ this->reactor (this->orb_->orb_core ()->reactor ());
+ this->init_transport_factories ();
+ this->init_flow_protocol_factories ();
+ return 0;
+}
+
+int
+TAO_AV_Core::init_forward_flows (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_FlowSpecSet &flow_spec_set,
+ TAO_AV_Core::EndPoint direction,
+ AVStreams::flowSpec &flow_spec)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_Core::init_forward_flows\n"));
+
+ TAO_AV_FlowSpecSet address_flow_set;
+ TAO_AV_FlowSpecSet flow_set;
+ TAO_AV_FlowSpecSetItor end = flow_spec_set.end ();
+ for (TAO_AV_FlowSpecSetItor start = flow_spec_set.begin ();
+ start != end; ++start)
+ {
+ TAO_FlowSpec_Entry *entry = (*start);
+ switch (direction)
+ {
+ case TAO_AV_Core::TAO_AV_ENDPOINT_B:
+ {
+ switch (entry->direction ())
+ {
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_IN:
+ {
+ entry->role (TAO_FlowSpec_Entry::TAO_AV_CONSUMER);
+ break;
+ }
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
+ {
+ entry->role (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
+ break;
+ }
+ }
+ break;
+ }
+ case TAO_AV_Core::TAO_AV_ENDPOINT_A:
+ {
+ switch (entry->direction ())
+ {
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_IN:
+ entry->role (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
+ break;
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
+ entry->role (TAO_FlowSpec_Entry::TAO_AV_CONSUMER);
+ break;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ ACE_Addr *address = entry->address ();
+ if (address != 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "address given for flow %s\n",
+ entry->flowname ()));
+
+ address_flow_set.insert (entry);
+ }
+ else
+ flow_set.insert (entry);
+ } //End of For Loop
+
+
+ int result = -1;
+ switch (direction)
+ {
+ case TAO_AV_Core::TAO_AV_ENDPOINT_A:
+ if (address_flow_set.size () > 0)
+ {
+ result = this->acceptor_registry_->open (endpoint,
+ this,
+ address_flow_set);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_AV_Core::init_forward_flows::acceptor_registry::open failed\n"),
+ -1);
+ TAO_AV_FlowSpecSetItor end = address_flow_set.end ();
+ for (TAO_AV_FlowSpecSetItor start = address_flow_set.begin ();
+ start != end; ++start)
+ {
+ TAO_FlowSpec_Entry *entry = (*start);
+ switch (entry->direction ())
+ {
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_IN:
+ {
+ if (entry->handler () != 0)
+ {
+ //Yamuna:PLEASE CHECK THIS LATER
+#if defined ACE_HAS_RAPI || defined (ACE_HAS_WINSOCK2_GQOS)
+ // For IN flows on the A side we should remove the handlers from the reactor.
+ ACE_Event_Handler *event_handler = entry->handler ()->event_handler ();
+
+ if (event_handler->reactor () != 0)
+ {
+ result = event_handler->reactor ()->remove_handler (event_handler,
+ ACE_Event_Handler::READ_MASK);
+
+ if (result < 0)
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_Core::init_forward_flows: remove_handler failed\n"));
+ }
+#endif //ACE_HAS_RAPI || ACE_HAS_WINSOCK2_GQOS
+ }
+ }
+ default:
+ break;
+ }
+ // Now if the address_set has been changed due to the addition of a control entry we should
+ // add that to the flow_spec_set also.
+ if (flow_spec_set.find (entry) < 0)
+ {
+ // entry doesn't exist so add it.
+ flow_spec_set.insert (entry);
+ // size_t len = flow_spec.length ();
+ // flow_spec.length (len+1);
+ // flow_spec [len] = entry->entry_to_string ();
+ }
+ }
+ }
+ break;
+ case TAO_AV_Core::TAO_AV_ENDPOINT_B:
+ {
+ if (address_flow_set.size () > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) This connector registry is called\n"));
+
+ result = this->connector_registry_->open (endpoint,
+ this,
+ address_flow_set);
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_Core::init_Forward_flows: connector_registry open failed\n"),-1);
+ TAO_AV_FlowSpecSetItor end = address_flow_set.end ();
+ for (TAO_AV_FlowSpecSetItor start = address_flow_set.begin ();
+ start != end; ++start)
+ {
+ TAO_FlowSpec_Entry *entry = (*start);
+ switch (entry->direction ())
+ {
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
+ {
+ if (entry->handler () != 0)
+ {
+ // @@Naga: This wont be called in the case of Full Profile.
+ // For IN flows on the A side we should remove the handlers from the reactor.
+ ACE_Event_Handler *event_handler = entry->handler ()->event_handler ();
+ result = event_handler->reactor ()->remove_handler (event_handler,
+ ACE_Event_Handler::READ_MASK);
+ if (result < 0)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_Core::init_forward_flows: remove_handler failed\n"));
+ }
+ }
+ default:
+ break;
+ }
+ // Now if the address_set has been changed due to the addition of a control entry we should
+ // add that to the flow_spec_set also.
+ if (flow_spec_set.find (entry) < 0)
+ {
+ // entry doesn't exist so add it.
+ flow_spec_set.insert (entry);
+ }
+ }
+ }
+ if (flow_set.size () > 0)
+ {
+ TAO_AV_FlowSpecSet tmp_flow_set (flow_set);
+ flow_set.reset ();
+ TAO_AV_FlowSpecSetItor end = tmp_flow_set.end ();
+ TAO_AV_FlowSpecSetItor start = tmp_flow_set.begin ();
+ for (; start != end; ++start)
+ {
+ TAO_FlowSpec_Entry *entry = *start;
+ TAO_FlowSpec_Entry *new_entry;
+ ACE_CString dir;
+ if (entry->direction () == 0)
+ dir += "IN";
+ else if (entry->direction () == 1)
+ dir += "OUT";
+ if (entry->get_peer_addr () != 0)
+ {
+ ACE_NEW_RETURN (new_entry,
+ TAO_Forward_FlowSpec_Entry (entry->flowname (),
+ dir.c_str (),
+ entry->format (),
+ entry->flow_protocol_str (),
+ entry->carrier_protocol_str (),
+ entry->get_peer_addr (),
+ entry->control_address ()),
+ -1);
+ }
+ else
+ {
+ ACE_NEW_RETURN (new_entry,
+ TAO_Forward_FlowSpec_Entry (entry->flowname (),
+ dir.c_str (),
+ entry->format (),
+ entry->flow_protocol_str (),
+ entry->carrier_protocol_str (),
+ entry->address (),
+ entry->control_address ()),
+ -1);
+ }
+ flow_set.insert (new_entry);
+ }
+ result = this->acceptor_registry_->open (endpoint,
+ this,
+ flow_set);
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_Core::init_Forward_flows: Acceptor_registry open failed\n"),-1);
+ end = address_flow_set.end ();
+ start = address_flow_set.begin ();
+ for (; start != end; ++start)
+ {
+ TAO_FlowSpec_Entry *entry = (*start);
+ switch (entry->direction ())
+ {
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
+ {
+ if (entry->handler () != 0)
+ {
+ // For IN flows on the A side we should remove the handlers from the reactor.
+ ACE_Event_Handler *event_handler = entry->handler ()->event_handler ();
+ result = event_handler->reactor ()->remove_handler (event_handler,
+ ACE_Event_Handler::READ_MASK);
+ if (result < 0)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_Core::init_forward_flows: remove_handler failed\n"));
+ }
+ }
+ default:
+ break;
+ }
+ // Now if the address_set has been changed due to the addition of a control entry we should
+ // add that to the flow_spec_set also.
+ if (flow_spec_set.find (entry) < 0)
+ {
+ // entry doesn't exist so add it.
+ flow_spec_set.insert (entry);
+ }
+ }
+ }
+
+ AVStreams::flowSpec new_flowspec (static_cast<CORBA::ULong> (flow_spec_set.size ()));
+ int i=0;
+ TAO_AV_FlowSpecSetItor connect_end = address_flow_set.end ();
+ TAO_AV_FlowSpecSetItor connect = address_flow_set.begin ();
+ for (;connect != connect_end; ++connect)
+ {
+ ACE_Addr *local_addr;
+ ACE_Addr *local_control_addr;
+ local_addr = (*connect)->get_local_addr ();
+ local_control_addr = (*connect)->get_local_control_addr ();
+ if (local_addr != 0)
+ {
+ TAO_Reverse_FlowSpec_Entry entry ((*connect)->flowname (),
+ (*connect)->direction_str (),
+ (*connect)->format (),
+ (*connect)->flow_protocol_str (),
+ (*connect)->carrier_protocol_str (),
+ local_addr,
+ local_control_addr);
+ /*
+ ACE_Addr *addr;
+ if ((addr = (*connect)->get_peer_addr ()) != 0)
+ {
+ entry.set_peer_addr (addr);
+ };
+ */
+ int len = new_flowspec.length ();
+ if (i == len)
+ new_flowspec.length (len+1);
+ new_flowspec [i++] = entry.entry_to_string ();
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "reverse Flow Spec Is %s\n", entry.entry_to_string ()));
+ }
+ }
+ connect_end = flow_set.end ();
+ for (connect = flow_set.begin ();
+ connect != connect_end; ++connect)
+ {
+ ACE_Addr *local_addr;
+ ACE_Addr *local_control_addr;
+ local_addr = (*connect)->get_local_addr ();
+ local_control_addr = (*connect)->get_local_control_addr ();
+ if (local_addr != 0)
+ {
+ TAO_Reverse_FlowSpec_Entry entry ((*connect)->flowname (),
+ (*connect)->direction_str (),
+ (*connect)->format (),
+ (*connect)->flow_protocol_str (),
+ (*connect)->carrier_protocol_str (),
+ local_addr,
+ local_control_addr);
+
+ int len = new_flowspec.length ();
+ if (i == len)
+ new_flowspec.length (len+1);
+ new_flowspec [i++] = entry.entry_to_string ();
+ }
+ }
+ // Change the reverse flow spec to be sent.
+ // int index = flow_spec.length () + 1;
+ int index = new_flowspec.length ();
+ flow_spec.length (index);
+ for (i = 0; i < index; i++)
+ {
+ flow_spec [i] = new_flowspec [i];
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
+int
+TAO_AV_Core::init_reverse_flows (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_FlowSpecSet &forward_flow_spec_set,
+ TAO_AV_FlowSpecSet &reverse_flow_spec_set,
+ TAO_AV_Core::EndPoint direction)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Core::init_reverse_flows\n"));
+ TAO_AV_FlowSpecSet acceptor_flow_set;
+ TAO_AV_FlowSpecSet connector_flow_set;
+ TAO_AV_FlowSpecSetItor end = reverse_flow_spec_set.end ();
+ TAO_AV_FlowSpecSetItor start = reverse_flow_spec_set.begin ();
+ for (;start != end; ++start)
+ {
+ TAO_FlowSpec_Entry *entry = (*start);
+ ACE_Addr *address = entry->address ();
+ switch (direction)
+ {
+ case TAO_AV_Core::TAO_AV_ENDPOINT_B:
+ {
+ switch (entry->direction ())
+ {
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_IN:
+ entry->role (TAO_FlowSpec_Entry::TAO_AV_CONSUMER);
+ break;
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
+ entry->role (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
+ break;
+ }
+ break;
+ }
+ case TAO_AV_Core::TAO_AV_ENDPOINT_A:
+ {
+ switch (entry->direction ())
+ {
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_IN:
+ entry->role (TAO_FlowSpec_Entry::TAO_AV_PRODUCER);
+ break;
+ case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
+ entry->role (TAO_FlowSpec_Entry::TAO_AV_CONSUMER);
+ break;
+ }
+ break;
+ }
+ default: break;
+ }
+
+ if (address != 0)
+ {
+ if (this->get_acceptor (entry->flowname ())!= 0)
+ {
+ ACE_Addr *address = entry->address ();
+ TAO_FlowSpec_Entry *forward_entry =
+ this->get_flow_spec_entry (forward_flow_spec_set,
+ entry->flowname ());
+ if (forward_entry != 0)
+ forward_entry->set_peer_addr (address);
+ }
+ else
+ connector_flow_set.insert (entry);
+ }
+ }
+ int result = -1;
+ switch (direction)
+ {
+
+ case TAO_AV_Core::TAO_AV_ENDPOINT_A:
+ {
+ result = this->connector_registry_->open (endpoint,
+ this,
+ connector_flow_set);
+ }
+ break;
+ default:
+ break;
+ }
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,"acceptor_registry::open"),-1);
+ return 0;
+}
+
+TAO_FlowSpec_Entry *
+TAO_AV_Core::get_flow_spec_entry (TAO_AV_FlowSpecSet &flow_spec_set,
+ const char *flowname)
+{
+ TAO_AV_FlowSpecSetItor end = flow_spec_set.end ();
+ TAO_AV_FlowSpecSetItor begin = flow_spec_set.begin ();
+ for (;
+ begin != end;
+ ++begin)
+ {
+ if (ACE_OS::strcmp ((*begin)->flowname (),flowname) == 0)
+ return (*begin);
+ }
+ return 0;
+}
+
+TAO_AV_Acceptor*
+TAO_AV_Core::get_acceptor (const char *flowname)
+{
+
+ ACE_TRY_NEW_ENV
+ {
+
+ TAO_AV_AcceptorSetItor acceptor = this->acceptor_registry_->begin ();
+ ACE_TRY_CHECK;
+
+ TAO_AV_AcceptorSetItor end =
+ this->acceptor_registry_->end ();
+
+ for (;acceptor != end; ++acceptor)
+ {
+ if (ACE_OS::strcmp ((*acceptor)->flowname (),flowname) == 0)
+ return *acceptor;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_AV_Core::get_acceptor");
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+TAO_AV_Core::remove_acceptor (const char *flowname)
+{
+
+ ACE_TRY_NEW_ENV
+ {
+
+ TAO_AV_AcceptorSetItor acceptor = this->acceptor_registry_->begin ();
+ ACE_TRY_CHECK;
+
+ TAO_AV_AcceptorSetItor end =
+ this->acceptor_registry_->end ();
+
+ for (;acceptor != end; ++acceptor)
+ {
+ if (ACE_OS::strcmp ((*acceptor)->flowname (),flowname) == 0)
+ {
+ this->acceptor_registry_->close (*acceptor);
+ return 0;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_AV_Core::get_acceptor");
+ }
+ ACE_ENDTRY;
+ return -1;
+}
+
+TAO_AV_Connector*
+TAO_AV_Core::get_connector (const char *flowname)
+{
+ TAO_AV_ConnectorSetItor connector =
+ this->connector_registry_->begin ();
+ TAO_AV_ConnectorSetItor end =
+ this->connector_registry_->end ();
+
+ for (;connector != end; ++connector)
+ {
+ if (ACE_OS::strcmp ((*connector)->flowname (),flowname) == 0)
+ return *connector;
+ }
+ return 0;
+}
+
+int
+TAO_AV_Core::remove_connector (const char *flowname)
+{
+ TAO_AV_ConnectorSetItor connector =
+ this->connector_registry_->begin ();
+ TAO_AV_ConnectorSetItor end =
+ this->connector_registry_->end ();
+
+ for (;connector != end; ++connector)
+ {
+ if (ACE_OS::strcmp ((*connector)->flowname (),flowname) == 0)
+ {
+ this->connector_registry_->close (*connector);
+ return 0;
+ }
+ }
+ return -1;
+}
+
+TAO_AV_Flow_Protocol_Factory *
+TAO_AV_Core::get_flow_protocol_factory(const char *flow_protocol)
+{
+ if (flow_protocol == 0)
+ return 0;
+
+ for (TAO_AV_Flow_ProtocolFactorySetItor control_flow_factory =
+ this->flow_protocol_factories_.begin ();
+ control_flow_factory !=
+ this->flow_protocol_factories_.end ();
+ ++control_flow_factory)
+ {
+ if ((*control_flow_factory)->factory ()->match_protocol (flow_protocol))
+ {
+ return (*control_flow_factory)->factory ();
+ }
+ }
+
+ // Not found.
+ return 0;
+}
+
+TAO_AV_Transport_Factory *
+TAO_AV_Core::get_transport_factory(const char *transport_protocol)
+{
+ if (transport_protocol == 0)
+ return 0;
+
+ for (TAO_AV_TransportFactorySetItor transport_factory =
+ this->transport_factories_.begin ();
+ transport_factory != this->transport_factories_.end ();
+ ++transport_factory)
+ {
+ if ((*transport_factory)->factory ()->match_protocol (transport_protocol))
+ {
+ return (*transport_factory)->factory ();
+ }
+ }
+
+ // Not found.
+ return 0;
+}
+
+int
+TAO_AV_Core::load_default_transport_factories (void)
+{
+ const char *udp_factory_str = "UDP_Factory";
+ const char *tcp_factory_str = "TCP_Factory";
+
+ TAO_AV_Transport_Factory *udp_factory = 0;
+ TAO_AV_Transport_Item *udp_item = 0;
+
+ udp_factory =
+ ACE_Dynamic_Service<TAO_AV_Transport_Factory>::instance (udp_factory_str);
+ if (udp_factory == 0)
+ {
+ if (TAO_debug_level)
+ ACE_ERROR ((LM_WARNING,
+ "(%P|%t) WARNING - No %s found in Service Repository."
+ " Using default instance.\n",
+ "UDP Factory"));
+
+ ACE_NEW_RETURN (udp_factory,
+ TAO_AV_UDP_Factory,
+ -1);
+ }
+ else udp_factory->ref_count = 1;
+
+ ACE_NEW_RETURN (udp_item, TAO_AV_Transport_Item ("UDP_Factory"), -1);
+ udp_item->factory (udp_factory);
+
+ this->transport_factories_.insert (udp_item);
+
+ TAO_AV_Transport_Factory *tcp_factory = 0;
+ TAO_AV_Transport_Item *tcp_item = 0;
+
+ tcp_factory =
+ ACE_Dynamic_Service<TAO_AV_Transport_Factory>::instance (tcp_factory_str);
+ if (tcp_factory == 0)
+ {
+ if (TAO_debug_level)
+ ACE_ERROR ((LM_WARNING,
+ "(%P|%t) WARNING - No %s found in Service Repository."
+ " Using default instance.\n",
+ "TCP Factory"));
+
+ ACE_NEW_RETURN (tcp_factory,
+ TAO_AV_TCP_Factory,
+ -1);
+ }
+ else tcp_factory->ref_count = 1;
+
+ ACE_NEW_RETURN (tcp_item, TAO_AV_Transport_Item ("TCP_Factory"), -1);
+ tcp_item->factory (tcp_factory);
+
+ this->transport_factories_.insert (tcp_item);
+
+#if defined (ACE_HAS_RAPI) || defined (ACE_HAS_WINSOCK2_GQOS)
+ const char *udp_qos_factory_str = "UDP_QoS_Factory";
+
+ TAO_AV_Transport_Factory *udp_qos_factory = 0;
+ TAO_AV_Transport_Item *udp_qos_item = 0;
+
+ udp_qos_factory =
+ ACE_Dynamic_Service<TAO_AV_Transport_Factory>::instance (udp_qos_factory_str);
+ if (udp_qos_factory == 0)
+ {
+ if (TAO_debug_level)
+ ACE_ERROR ((LM_WARNING,
+ "(%P|%t) WARNING - No %s found in Service Repository."
+ " Using default instance.\n",
+ "UDP QoS Factory"));
+
+ ACE_NEW_RETURN (udp_qos_factory,
+ TAO_AV_UDP_QoS_Factory,
+ -1);
+ }
+ else udp_qos_factory->ref_count = 1;
+
+ ACE_NEW_RETURN (udp_qos_item,
+ TAO_AV_Transport_Item ("UDP_QoS_Factory"),
+ -1);
+
+ udp_qos_item->factory (udp_qos_factory);
+
+ this->transport_factories_.insert (udp_qos_item);
+#endif /* ACE_HAS_RAPI || ACE_HAS_WINSOCK2_GQOS */
+
+#if defined ACE_HAS_SCTP
+ const char *sctp_seq_factory_str = "SCTP_SEQ_Factory";
+
+ TAO_AV_Transport_Factory *sctp_seq_factory = 0;
+ TAO_AV_Transport_Item *sctp_seq_item = 0;
+
+ sctp_seq_factory =
+ ACE_Dynamic_Service<TAO_AV_Transport_Factory>::instance (sctp_seq_factory_str);
+ if (sctp_seq_factory == 0)
+ {
+ if (TAO_debug_level)
+ ACE_ERROR ((LM_WARNING,
+ "(%P|%t) WARNING - No %s found in Service Repository."
+ " Using default instance.\n",
+ "SCTP SEQ Factory"));
+
+ ACE_NEW_RETURN (sctp_seq_factory,
+ TAO_AV_SCTP_SEQ_Factory,
+ -1);
+ }
+ else sctp_seq_factory->ref_count = 1;
+
+ ACE_NEW_RETURN (sctp_seq_item,
+ TAO_AV_Transport_Item ("SCTP_SEQ_Factory"),
+ -1);
+
+ sctp_seq_item->factory (sctp_seq_factory);
+
+ this->transport_factories_.insert (sctp_seq_item);
+#endif /* ACE_HAS_SCTP */
+
+ return 0;
+}
+
+int
+TAO_AV_Core::init_transport_factories (void)
+{
+ TAO_AV_TransportFactorySetItor end = this->transport_factories_.end ();
+ TAO_AV_TransportFactorySetItor factory = this->transport_factories_.begin ();
+
+
+ if (factory == end)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Loading default transport protocols\n"));
+ this->load_default_transport_factories ();
+ }
+ else
+ {
+ for (; factory != end; factory++)
+ {
+ const ACE_CString &name = (*factory)->name ();
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "%s \n",
+ name.c_str ()));
+
+ (*factory)->factory (
+ ACE_Dynamic_Service<TAO_AV_Transport_Factory>::instance (name.c_str ()));
+ if ((*factory)->factory () == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Unable to load ")
+ ACE_TEXT ("protocol <%s>, %p\n"),
+ name.c_str (), ""),
+ -1);
+ }
+ (*factory)->factory ()->ref_count = 1;
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) Loaded protocol <%s>\n"),
+ name.c_str ()));
+ }
+ }
+ }
+
+ return 0;
+}
+
+int
+TAO_AV_Core::load_default_flow_protocol_factories (void)
+{
+ const char *udp_flow = "UDP_Flow_Factory";
+ const char *tcp_flow = "TCP_Flow_Factory";
+ const char *rtp_flow = "RTP_Flow_Factory";
+ const char *rtcp_flow = "RTCP_Flow_Factory";
+ const char *sfp_flow = "SFP_Flow_Factory";
+
+ TAO_AV_Flow_Protocol_Factory *udp_flow_factory = 0;
+ TAO_AV_Flow_Protocol_Item *udp_item = 0;
+
+ udp_flow_factory =
+ ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (udp_flow);
+ if (udp_flow_factory == 0)
+ {
+ if (TAO_debug_level)
+ ACE_ERROR ((LM_WARNING,
+ "(%P|%t) WARNING - No %s found in Service Repository."
+ " Using default instance.\n",
+ "UDP Flow Factory"));
+
+ ACE_NEW_RETURN (udp_flow_factory,
+ TAO_AV_UDP_Flow_Factory,
+ -1);
+ }
+ else udp_flow_factory->ref_count = 1;
+
+ ACE_NEW_RETURN (udp_item, TAO_AV_Flow_Protocol_Item ("UDP_Flow_Factory"), -1);
+ udp_item->factory (udp_flow_factory);
+
+ this->flow_protocol_factories_.insert (udp_item);
+
+#if defined (ACE_HAS_RAPI) || defined (ACE_HAS_WINSOCK2_GQOS)
+
+ const char *udp_qos_flow = "UDP_QoS_Flow_Factory";
+ TAO_AV_Flow_Protocol_Factory *udp_qos_flow_factory = 0;
+ TAO_AV_Flow_Protocol_Item *udp_qos_flow_item = 0;
+
+ udp_qos_flow_factory =
+ ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (udp_qos_flow);
+ if (udp_qos_flow_factory == 0)
+ {
+ if (TAO_debug_level)
+ ACE_ERROR ((LM_WARNING,
+ "(%P|%t) WARNING - No %s found in Service Repository."
+ " Using default instance.\n",
+ "UDP QoS Flow Factory"));
+
+ ACE_NEW_RETURN (udp_qos_flow_factory,
+ TAO_AV_UDP_QoS_Flow_Factory,
+ -1);
+ }
+ else udp_qos_flow_factory->ref_count = 1;
+
+ ACE_NEW_RETURN (udp_qos_flow_item, TAO_AV_Flow_Protocol_Item ("UDP_QoS_Flow_Factory"), -1);
+ udp_qos_flow_item->factory (udp_qos_flow_factory);
+
+ this->flow_protocol_factories_.insert (udp_qos_flow_item);
+
+#endif /* defined (ACE_HAS_RAPI) || defined (ACE_HAS_WINSOCK2_GQOS) */
+
+#if defined ACE_HAS_SCTP
+
+ const char *sctp_seq_flow = "SCTP_SEQ_Flow_Factory";
+ TAO_AV_Flow_Protocol_Factory *sctp_seq_flow_factory = 0;
+ TAO_AV_Flow_Protocol_Item *sctp_seq_flow_item = 0;
+
+ sctp_seq_flow_factory =
+ ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (sctp_seq_flow);
+ if (sctp_seq_flow_factory == 0)
+ {
+ if (TAO_debug_level)
+ ACE_ERROR ((LM_WARNING,
+ "(%P|%t) WARNING - No %s found in Service Repository."
+ " Using default instance.\n",
+ "SCTP SEQ Flow Factory"));
+
+ ACE_NEW_RETURN (sctp_seq_flow_factory,
+ TAO_AV_SCTP_SEQ_Flow_Factory,
+ -1);
+ }
+ else sctp_seq_flow_factory->ref_count = 1;
+
+ ACE_NEW_RETURN (sctp_seq_flow_item, TAO_AV_Flow_Protocol_Item ("SCTP_SEQ_Flow_Factory"), -1);
+ sctp_seq_flow_item->factory (sctp_seq_flow_factory);
+
+ this->flow_protocol_factories_.insert (sctp_seq_flow_item);
+
+#endif /* ACE_HAS_SCTP */
+
+ TAO_AV_Flow_Protocol_Factory *tcp_flow_factory = 0;
+ TAO_AV_Flow_Protocol_Item *tcp_item = 0;
+
+ tcp_flow_factory =
+ ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (tcp_flow);
+ if (tcp_flow_factory == 0)
+ {
+ if (TAO_debug_level)
+ ACE_ERROR ((LM_WARNING,
+ "(%P|%t) WARNING - No %s found in Service Repository."
+ " Using default instance.\n",
+ "TCP Flow Factory"));
+
+ ACE_NEW_RETURN (tcp_flow_factory,
+ TAO_AV_TCP_Flow_Factory,
+ -1);
+ }
+ else tcp_flow_factory->ref_count = 1;
+
+ ACE_NEW_RETURN (tcp_item, TAO_AV_Flow_Protocol_Item ("TCP_Flow_Factory"), -1);
+ tcp_item->factory (tcp_flow_factory);
+
+ this->flow_protocol_factories_.insert (tcp_item);
+
+ TAO_AV_Flow_Protocol_Factory *rtp_flow_factory = 0;
+ TAO_AV_Flow_Protocol_Item *rtp_item = 0;
+
+ rtp_flow_factory =
+ ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (rtp_flow);
+ if (rtp_flow_factory == 0)
+ {
+ if (TAO_debug_level)
+ ACE_ERROR ((LM_WARNING,
+ "(%P|%t) WARNING - No %s found in Service Repository."
+ " Using default instance.\n",
+ "RTP Flow Factory"));
+
+ ACE_NEW_RETURN (rtp_flow_factory,
+ TAO_AV_RTP_Flow_Factory,
+ -1);
+ }
+ else rtp_flow_factory->ref_count = 1;
+
+ ACE_NEW_RETURN (rtp_item, TAO_AV_Flow_Protocol_Item ("RTP_Flow_Factory"), -1);
+ rtp_item->factory (rtp_flow_factory);
+
+ this->flow_protocol_factories_.insert (rtp_item);
+
+ TAO_AV_Flow_Protocol_Factory *rtcp_flow_factory = 0;
+ TAO_AV_Flow_Protocol_Item *rtcp_item = 0;
+
+ rtcp_flow_factory =
+ ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (rtcp_flow);
+ if (rtcp_flow_factory == 0)
+ {
+ if (TAO_debug_level)
+ ACE_ERROR ((LM_WARNING,
+ "(%P|%t) WARNING - No %s found in Service Repository."
+ " Using default instance.\n",
+ "RTCP Flow Factory"));
+
+ ACE_NEW_RETURN (rtcp_flow_factory,
+ TAO_AV_RTCP_Flow_Factory,
+ -1);
+ }
+ else rtcp_flow_factory->ref_count = 1;
+
+ ACE_NEW_RETURN (rtcp_item, TAO_AV_Flow_Protocol_Item ("RTCP_Flow_Factory"), -1);
+ rtcp_item->factory (rtcp_flow_factory);
+
+ this->flow_protocol_factories_.insert (rtcp_item);
+
+ TAO_AV_Flow_Protocol_Factory *sfp_flow_factory = 0;
+ TAO_AV_Flow_Protocol_Item *sfp_item = 0;
+
+ sfp_flow_factory =
+ ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (sfp_flow);
+ if (sfp_flow_factory == 0)
+ {
+ if (TAO_debug_level)
+ ACE_ERROR ((LM_WARNING,
+ "(%P|%t) WARNING - No %s found in Service Repository."
+ " Using default instance.\n",
+ "SFP Flow Factory"));
+
+ ACE_NEW_RETURN (sfp_flow_factory,
+ TAO_AV_SFP_Factory,
+ -1);
+ }
+ else sfp_flow_factory->ref_count = 1;
+
+ ACE_NEW_RETURN (sfp_item, TAO_AV_Flow_Protocol_Item ("SFP_Flow_Factory"), -1);
+ sfp_item->factory (sfp_flow_factory);
+
+ this->flow_protocol_factories_.insert (sfp_item);
+
+ return 0;
+}
+
+int
+TAO_AV_Core::init_flow_protocol_factories (void)
+{
+ TAO_AV_Flow_ProtocolFactorySetItor end = this->flow_protocol_factories_.end ();
+ TAO_AV_Flow_ProtocolFactorySetItor factory = this->flow_protocol_factories_.begin ();
+
+ if (factory == end)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Loading default flow protocol factories\n"));
+
+ this->load_default_flow_protocol_factories ();
+ }
+ else
+ {
+ for (; factory != end; factory++)
+ {
+ const ACE_CString &name = (*factory)->name ();
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "%s \n",
+ name.c_str ()));
+
+ (*factory)->factory (
+ ACE_Dynamic_Service<TAO_AV_Flow_Protocol_Factory>::instance (name.c_str ()));
+ if ((*factory)->factory () == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Unable to load ")
+ ACE_TEXT ("protocol <%s>, %p\n"),
+ name.c_str (), ""),
+ -1);
+ }
+
+ (*factory)->factory ()->ref_count = 1;
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) Loaded protocol <%s>\n"),
+ name.c_str ()));
+ }
+ }
+ }
+
+ return 0;
+}
+
+/* static */
+int
+TAO_AV_Core::deactivate_servant (PortableServer::Servant servant)
+{
+ // Because of reference counting, the POA will automatically delete
+ // the servant when all pending requests on this servant are
+ // complete.
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ PortableServer::POA_var poa = servant->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::ObjectId_var id = poa->servant_to_id (servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa->deactivate_object (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "deactivate_servant");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+/* static */
+char *
+TAO_AV_Core::get_flowname (const char *flow_spec_entry_str)
+{
+ ACE_CString flow_spec_entry (flow_spec_entry_str);
+ ACE_CString::size_type slash_pos = flow_spec_entry.find ('\\');
+ ACE_CString flow_name;
+ if (slash_pos != flow_spec_entry.npos)
+ flow_name = flow_spec_entry.substring (0, slash_pos);
+ else
+ flow_name = flow_spec_entry_str;
+ return CORBA::string_dup (flow_name.c_str ());
+}
+
+ACE_CString
+TAO_AV_Core::get_control_flowname(const char *flowname)
+{
+ ACE_CString control_flowname;
+ control_flowname = "c_";
+ control_flowname = control_flowname + flowname;
+
+ return flowname;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Singleton<TAO_AV_Core, ACE_Null_Mutex> *ACE_Singleton<TAO_AV_Core, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/AV_Core.h b/TAO/orbsvcs/orbsvcs/AV/AV_Core.h
new file mode 100644
index 00000000000..4a8f29aa137
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/AV_Core.h
@@ -0,0 +1,181 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file AV_Core.h
+ *
+ * $Id$
+ *
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_AV_CORE_H
+#define TAO_AV_CORE_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/AV_export.h"
+#include "orbsvcs/AVStreamsC.h"
+
+#include "tao/PortableServer/PortableServer.h"
+
+#include "ace/Singleton.h"
+#include "ace/Unbounded_Set.h"
+#include "ace/Null_Mutex.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Reactor;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Base_StreamEndPoint;
+class TAO_AV_Connector_Registry;
+class TAO_AV_Acceptor_Registry;
+class TAO_AV_Acceptor;
+class TAO_AV_Connector;
+class TAO_FlowSpec_Entry;
+class TAO_AV_Transport_Item;
+class TAO_AV_Transport_Factory;
+class TAO_AV_Flow_Protocol_Item;
+class TAO_AV_Flow_Protocol_Factory;
+
+typedef ACE_Unbounded_Set <TAO_FlowSpec_Entry*> TAO_AV_FlowSpecSet;
+typedef ACE_Unbounded_Set_Iterator <TAO_FlowSpec_Entry*> TAO_AV_FlowSpecSetItor;
+
+typedef ACE_Unbounded_Set<TAO_AV_Transport_Item*> TAO_AV_TransportFactorySet;
+typedef ACE_Unbounded_Set_Iterator<TAO_AV_Transport_Item*> TAO_AV_TransportFactorySetItor;
+
+// typedefs for containers containing the list of loaded Flow_Protocol factories.
+typedef ACE_Unbounded_Set<TAO_AV_Flow_Protocol_Item*> TAO_AV_Flow_ProtocolFactorySet;
+typedef ACE_Unbounded_Set_Iterator<TAO_AV_Flow_Protocol_Item*> TAO_AV_Flow_ProtocolFactorySetItor;
+
+/**
+ * @class TAO_AV_Core
+ * @brief This class encapsulates access to the TAO AV Core's resources
+ * and its state.
+ */
+class TAO_AV_Export TAO_AV_Core
+{
+public:
+ enum EndPoint {TAO_AV_ENDPOINT_A,TAO_AV_ENDPOINT_B};
+
+ enum Protocol
+ {
+ TAO_AV_NOPROTOCOL = -1,
+ TAO_AV_TCP = 0,
+ TAO_AV_UDP = 1,
+ TAO_AV_AAL5 = 2,
+ TAO_AV_AAL3_4 = 3,
+ TAO_AV_AAL1 = 4,
+ TAO_AV_RTP_UDP = 5,
+ TAO_AV_RTP_AAL5 = 6,
+ TAO_AV_IPX = 7,
+ TAO_AV_SFP_UDP = 8,
+ TAO_AV_UDP_MCAST = 9,
+ TAO_AV_RTP_UDP_MCAST = 10,
+ TAO_AV_SFP_UDP_MCAST = 11,
+ TAO_AV_QOS_UDP = 12,
+ TAO_AV_USERDEFINED_UDP = 13,
+ TAO_AV_USERDEFINED_UDP_MCAST = 14,
+ TAO_AV_SCTP_SEQ = 15
+ };
+
+ enum Flow_Component
+ {
+ TAO_AV_DATA = 1,
+ TAO_AV_CONTROL = 2,
+ TAO_AV_BOTH = 3
+ };
+
+ /// Default constructor.
+ TAO_AV_Core (void);
+
+ /// Destructor.
+ ~TAO_AV_Core (void);
+
+ int init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL);
+ int run (void);
+ int stop_run (void);
+ int init_forward_flows (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_FlowSpecSet &flow_spec_set,
+ EndPoint direction,
+ AVStreams::flowSpec &flow_spec);
+ int init_reverse_flows (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_FlowSpecSet &forward_flow_spec_set,
+ TAO_AV_FlowSpecSet &reverse_flow_spec_set,
+ EndPoint direction);
+ int init_transport_factories (void);
+ int init_flow_protocol_factories (void);
+
+ int load_default_transport_factories (void);
+ int load_default_flow_protocol_factories (void);
+
+ /// = Get the acceptor registry
+ TAO_AV_Acceptor *get_acceptor (const char *flowname);
+ TAO_AV_Connector *get_connector (const char *flowname);
+ int remove_acceptor (const char *flowname);
+ int remove_connector (const char *flowname);
+ TAO_AV_Connector_Registry *connector_registry (void);
+ TAO_FlowSpec_Entry *get_flow_spec_entry (TAO_AV_FlowSpecSet &flow_spec_set,
+ const char *flowname);
+ TAO_AV_Acceptor_Registry *acceptor_registry (void);
+
+ // = Get the protocol factories
+ /// = Set/get the <ACE_Reactor>.
+ TAO_AV_Flow_Protocol_Factory *get_flow_protocol_factory(const char *flow_protocol);
+ TAO_AV_Transport_Factory *get_transport_factory(const char *transport_protocol);
+ TAO_AV_Flow_ProtocolFactorySet *flow_protocol_factories (void);
+ TAO_AV_TransportFactorySet *transport_factories (void);
+ void reactor (ACE_Reactor *r);
+ ACE_Reactor *reactor (void);
+ CORBA::ORB_ptr orb (void);
+ void orb (CORBA::ORB_ptr orb_);
+ PortableServer::POA_ptr poa (void);
+ void poa (PortableServer::POA_ptr poa_);
+
+ static int deactivate_servant (PortableServer::Servant servant);
+ static char *get_flowname (const char *flow_spec_entry_str);
+ static ACE_CString get_control_flowname(const char *flowname);
+
+protected:
+ /// The connector registry which all active connecters must register
+ /// themselves with.
+ TAO_AV_Connector_Registry *connector_registry_;
+
+ /// The registry which maintains a list of acceptor factories for each
+ /// loaded protocol.
+ TAO_AV_Acceptor_Registry *acceptor_registry_;
+
+ /// Pointer to the list of transports loaded into this AV_Core instance.
+ TAO_AV_TransportFactorySet transport_factories_;
+
+ /// Pointer to the list of flow protocol loaded into this AV_Core instance.
+ TAO_AV_Flow_ProtocolFactorySet flow_protocol_factories_;
+
+ ACE_Reactor *reactor_;
+ CORBA::ORB_var orb_;
+ PortableServer::POA_var poa_;
+ CORBA::Boolean stop_run_;
+};
+
+#if defined (__BORLANDC__)
+# if !defined (TAO_AV_BUILD_DLL)
+# pragma option push -Jgx
+# endif
+#endif
+TAO_AV_SINGLETON_DECLARE (ACE_Singleton, TAO_AV_Core, ACE_Null_Mutex)
+#if defined (__BORLANDC__)
+# if !defined(TAO_AV_BUILD_DLL)
+# pragma option pop
+# endif
+#endif
+
+typedef ACE_Singleton<TAO_AV_Core, ACE_Null_Mutex> TAO_AV_CORE;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_CORE_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/AV_Pluggable_Framework.html b/TAO/orbsvcs/orbsvcs/AV/AV_Pluggable_Framework.html
new file mode 100644
index 00000000000..ca4db983b3c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/AV_Pluggable_Framework.html
@@ -0,0 +1,377 @@
+<!$Id$>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22 i686) [Netscape]">
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000">
+
+<center>
+<h1>
+Implementing Pluggable Protocol in TAO AV Streaming Service</h1></center>
+
+<center>
+<h4>
+<a href="mailto:naga@cs.wustl.edu">Nagarajan Surendran </a>and <a href="mailto:yamuna@cs.wustl.edu">Yamuna
+Krishnamurthy</a></h4></center>
+
+<center>Center for Distributed Object Computing
+<br>Washington University in St.Louis</center>
+
+<hr WIDTH="100%">
+<h3>
+Overview</h3>
+Traditionally DOC Middleware has provided facilities to design application-level
+objects at a higher level of abstraction, away from low-level details of
+network programming and distribution. The aspect of multimedia application
+that could benefit from this is an interoperable standard design of multimedia
+interfaces defined in IDL. The OMG A/V Specification defines such a set
+of interfaces which helps in type-safe ,robust and flexible applications.
+Also as proved in our earlier work,ORBs with IIOP implementation cannot
+be used for streaming multimedia data since they're optimized for request-response
+semantics. To circumvent this the application developer will have to use
+Out of Band data connection to stream the data while using the ORB to negotiate
+QoS, bind type-safe devices and explore their properties.
+<p>Also it is important for a Multimedia framework to have the ability
+to support different transports and be able to plug and configure them
+dynamically and statically .For example, a wireless link based application
+may want to use the Wireless link protocol to stream the data. RTP is gaining
+wide significance as the Transport protocol for streaming Audio and Video
+Data over the Internet. Our framework provides an implementation of RTP/RTCP
+for the audio/video profile. RTP is internet-centric and doesn't provide
+facilities to transport&nbsp; IDL-defined flows. SFP is a Simple Flow Protocol
+specified by the OMG for A/V Streaming and it can be mapped to different
+transports like UDP, RTP and ATM AAL5. Our framework provides an implementation
+of SFP that runs over UDP and multicast UDP.
+<p>The OMG specification defines the flow specification syntax that is
+to be used for the bind_devs calls for connection establishment. It defines
+the protocol names and also the syntax for specifying the transport/flow
+protocol information but it doesn't define any interfaces for the protocol
+implementation as such. Our framework bridges this gap by defining a uniform
+API&nbsp; for the different flow protocols like RTP and SFP while taking
+care of the variations using a Policy interface. We solve this with our
+Pluggable Protocol Framework using design patterns like Layer,
+<br>Acceptor, Connector, Facade and Abstract Factory. Please look at this
+<a href="http://www.cs.wustl.edu/~naga/pluggable_av.ps.gz">paper</a>
+for more documentation on the TAO AV Service Pluggable Protocol Framework.
+<p>
+<hr WIDTH="100%">
+<h3>
+Implementing the Pluggable Protocol</h3>
+In order to add a new pluggable transport and flow protocol to the AVStreams
+framework, without making changes to the framework itself, the pluggable
+protocol must implement the following components of the Pluggable Protocol
+framework:
+<h4>
+The Transport Protocol Components</h4>
+
+<h4>
+<i>Acceptor and Connector:&nbsp;</i></h4>
+These are implementations of the Acceptor and Connector design patterns.
+In the case of connectionless protocols like UDP, calling accept and connect
+will result in the creation of handlers immediately.
+<p>The pluggable transport protocol implementation should inherit from
+the following abstract classes declared in <a href="./Transport.h">&lt;orbsvcs/orbsvcs/AV/Transport.h>:</a>
+<p>/**
+<br>&nbsp;* @class TAO_AV_Acceptor
+<br>&nbsp;* @brief
+<br>&nbsp;*/
+<br>class TAO_AV_Export TAO_AV_Acceptor
+<br>{
+<br>public:
+<br>&nbsp; TAO_AV_Acceptor (void);
+<br>&nbsp; virtual ~TAO_AV_Acceptor (void);
+<br>&nbsp; virtual int open (TAO_Base_StreamEndPoint *endpoint,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_AV_Core *av_core,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_FlowSpec_Entry *entry,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_AV_Flow_Protocol_Factory *factory) = 0;
+<p>&nbsp; virtual int open_default (TAO_Base_StreamEndPoint *endpoint,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_AV_Core *av_core,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_FlowSpec_Entry *entry,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_AV_Flow_Protocol_Factory *factory) = 0;
+<p>&nbsp; const char *flowname ();
+<br>&nbsp; virtual int close (void) = 0;
+<br>protected:
+<br>&nbsp; ACE_CString flowname_;
+<br>&nbsp; TAO_AV_Core *av_core_;
+<br>&nbsp; ACE_Addr *address_;
+<br>};
+<br>&nbsp;
+<p>/**
+<br>&nbsp;* @class TAO_AV_Connector
+<br>&nbsp;* @brief
+<br>&nbsp;*/
+<br>class TAO_AV_Export TAO_AV_Connector
+<br>{
+<br>public:
+<br>&nbsp; TAO_AV_Connector (void);
+<br>&nbsp; virtual ~TAO_AV_Connector (void);
+<br>&nbsp; const char *flowname (void);
+<p>&nbsp; virtual int open (TAO_Base_StreamEndPoint *endpoint,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_AV_Core *av_core,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_AV_Flow_Protocol_Factory *factory) = 0;
+<p>&nbsp; virtual int connect (TAO_FlowSpec_Entry *entry,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_AV_Transport *&amp;transport) = 0;
+<p>&nbsp; virtual int close (void) = 0;
+<br>protected:
+<br>&nbsp; ACE_CString flowname_;
+<br>};
+<br>&nbsp;
+<br>&nbsp;
+<h4>
+<i>Transport and Transport Factory:</i></h4>
+The transport class provides a common interface for different protocols
+for performing operations like open, close, send and recv. The trasnport
+factory is an interface for creating acceptors and connectors.
+<p>The pluggable transport protocol implementation should inherit from
+the following abstract classes declared in&nbsp;<a href="./Transport.h">
+&lt;orbsvcs/orbsvcs/AV/Transport.h>:</a><i></i>
+<p>/**
+<br>&nbsp;* @class TAO_AV_Transport
+<br>&nbsp;* @brief A Base class for the different transport protocols.
+<br>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; All the different
+transports should derive and implement
+<br>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the open,close,send
+and recv methods.
+<br>&nbsp;*/
+<br>class TAO_AV_Export TAO_AV_Transport
+<br>{
+<br>public:
+<br>&nbsp; TAO_AV_Transport (void);
+<p>&nbsp; virtual ~TAO_AV_Transport (void);
+<p>&nbsp; virtual int open (ACE_Addr *address) = 0;
+<p>&nbsp; virtual int close (void) = 0;
+<p>&nbsp; virtual int mtu (void) = 0;
+<br>&nbsp; virtual ACE_Addr *get_peer_addr (void) = 0;
+<br>&nbsp; virtual ACE_Addr *get_local_addr (void);
+<p>&nbsp; virtual ssize_t send (const ACE_Message_Block *mblk,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ACE_Time_Value *s = 0) = 0;
+<p>&nbsp; /// Write the contents of the buffer of length len to the connection.
+<br>&nbsp; virtual ssize_t send (const char *buf,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+size_t len,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ACE_Time_Value *s = 0) = 0;
+<p>&nbsp; /// Write the contents of iovcnt iovec's to the connection.
+<br>&nbsp; virtual ssize_t send (const iovec *iov,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+int iovcnt,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ACE_Time_Value *s = 0) = 0;
+<p>&nbsp; /// Read len bytes from into buf.
+<br>&nbsp; virtual ssize_t recv (char *buf,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+size_t len,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ACE_Time_Value *s = 0) = 0;
+<p>&nbsp; /// Read len bytes from into buf using flags.
+<br>&nbsp; virtual ssize_t recv (char *buf,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+size_t len,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+int flags,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ACE_Time_Value *s = 0) = 0;
+<p>&nbsp; ///&nbsp; Read received data into the iovec buffers.
+<br>&nbsp; virtual ssize_t recv (iovec *iov,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+int iovcnt,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ACE_Time_Value *s = 0) = 0;
+<p>};
+<br>&nbsp;
+<p>/**
+<br>&nbsp;* @class TAO_AV_Transport_Factory
+<br>&nbsp;* @brief
+<br>&nbsp;*/
+<br>class TAO_AV_Export TAO_AV_Transport_Factory : public ACE_Service_Object
+<br>{
+<br>public:
+<br>&nbsp; /// Initialization hook.
+<br>&nbsp; TAO_AV_Transport_Factory (void);
+<br>&nbsp; virtual ~TAO_AV_Transport_Factory (void);
+<br>&nbsp; virtual int init (int argc, char *argv[]);
+<br>&nbsp; virtual int match_protocol (const char *protocol_string);
+<br>&nbsp; virtual TAO_AV_Acceptor *make_acceptor (void);
+<br>&nbsp; virtual TAO_AV_Connector *make_connector (void);
+<br>};
+<br>&nbsp;
+<h4>
+<i>Flow handler :</i></h4>
+All the transport handlers derive from the&nbsp; TAO_AV_Flow_Handler which
+has methods to start and stop and provide flow specific functionality for
+timeout upcalls to the Callbacks.
+<p>The pluggable transport protocol implementation should inherit from
+the following abstract class declared in<a href="./Transport.h">
+&lt;orbsvcs/orbsvcs/AV/Transport.h>:</a>
+<p>/**
+<br>&nbsp;* @class TAO_AV_Flow_Handler
+<br>&nbsp;* @brief
+<br>&nbsp;*/
+<br>class TAO_AV_Export TAO_AV_Flow_Handler
+<br>{
+<br>public:
+<br>&nbsp; /// Constructor.
+<br>&nbsp; TAO_AV_Flow_Handler (void);
+<p>&nbsp; /// Start/stop the flow handler.
+<br>&nbsp; virtual int start (TAO_FlowSpec_Entry::Role role);
+<br>&nbsp; virtual int stop&nbsp; (TAO_FlowSpec_Entry::Role role);
+<p>&nbsp; /// Schedule timer. Uses the get_timeout method on the callback.
+<br>&nbsp; virtual int schedule_timer (void);
+<p>&nbsp; /// get the transport.
+<br>&nbsp; TAO_AV_Transport *transport (void);
+<p>&nbsp; /// set/get protocol_object.
+<br>&nbsp; TAO_AV_Protocol_Object* protocol_object (void);
+<br>&nbsp; void protocol_object (TAO_AV_Protocol_Object *protocol_object);
+<p>&nbsp; /// set the callback.
+<br>&nbsp; void callback (TAO_AV_Callback *callback);
+<p>&nbsp; /// Handle timeout. called from reactor.
+<br>&nbsp; int handle_timeout (const ACE_Time_Value &amp;tv, const void
+*arg = 0);
+<p>&nbsp; /// set the remote address.
+<br>&nbsp; virtual int set_remote_address (ACE_Addr *address);
+<p>&nbsp; /// get the underlying event handler. To be overridden by the
+derived clases.
+<br>&nbsp; virtual ACE_Event_Handler* event_handler (void) = 0;
+<p>&nbsp; virtual int change_qos (AVStreams::QoS);
+<p>protected:
+<br>&nbsp; TAO_AV_Transport *transport_;
+<br>&nbsp; TAO_AV_Callback *callback_;
+<br>&nbsp; TAO_AV_Protocol_Object *protocol_object_;
+<br>&nbsp; long timer_id_;
+<br>&nbsp; ACE_Reactor *reactor_;
+<br>&nbsp; void *timeout_arg_;
+<br>};
+<br>&nbsp;
+<h3>
+The Flow&nbsp;Protocol Components</h3>
+
+<h4>
+<i>Flow Protocol Factory:</i></h4>
+The&nbsp; flow protocol factory is an interface for creating flow protocol
+objects.
+<p>The pluggable flow protocol implementation should inherit from the following
+abstract class declared in <a href="./Protocol_Factory.h">&lt;orbsvcs/orbsvcs/AV/Protocol_Factory>:</a>
+<p>/**
+<br>&nbsp;* @class TAO_AV_Flow_Protocol_Factory
+<br>&nbsp;* @brief
+<br>&nbsp;*/
+<br>class TAO_AV_Export TAO_AV_Flow_Protocol_Factory : public ACE_Service_Object
+<br>{
+<br>public:
+<br>&nbsp; /// Initialization hook.
+<br>&nbsp; TAO_AV_Flow_Protocol_Factory (void);
+<br>&nbsp; virtual ~TAO_AV_Flow_Protocol_Factory (void);
+<br>&nbsp; virtual int init (int argc, char *argv[]);
+<br>&nbsp; virtual int match_protocol (const char *flow_string);
+<br>&nbsp; virtual TAO_AV_Protocol_Object* make_protocol_object (TAO_FlowSpec_Entry
+*entry,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_Base_StreamEndPoint *endpoint,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_AV_Flow_Handler *handler,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_AV_Transport *transport);
+<br>&nbsp; virtual const char *control_flow_factory (void);
+<br>};
+<br>&nbsp;
+<h4>
+<i>Protocol Object:</i></h4>
+This is a concrete implementation providing the flow protocol functionality.
+Applications use this interface to send frames and the Protocol_Object
+uses application specified&nbsp; Callback objects to deliver frames.
+<p>The pluggable flow protocol implementation should inherit from the following
+abstract class declared in <a href="./Protocol_Factory.h">&lt;orbsvcs/orbsvcs/AV/Protocol_Factory>:</a>
+<p>/**
+<br>&nbsp;* @class TAO_AV_Protocol_Object
+<br>&nbsp;* @brief
+<br>&nbsp;*/
+<br>class TAO_AV_Export TAO_AV_Protocol_Object
+<br>{
+<br>public:
+<br>&nbsp; TAO_AV_Protocol_Object (void);
+<p>&nbsp; /// constructor.
+<br>&nbsp; TAO_AV_Protocol_Object (TAO_AV_Callback *callback,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_AV_Transport *transport);
+<p>&nbsp; /// Destructor
+<br>&nbsp; virtual ~TAO_AV_Protocol_Object (void);
+<p>&nbsp; virtual int open (TAO_AV_Callback *callback,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_AV_Transport *transport);
+<p>&nbsp; virtual int handle_input (void) = 0;
+<p>&nbsp; /// Called on a control object.
+<br>&nbsp; virtual int handle_control_input (ACE_Message_Block *control_frame,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+const ACE_Addr &amp;peer_address);
+<p>&nbsp; /// set/get policies.
+<br>&nbsp; virtual int set_policies (const TAO_AV_PolicyList &amp;policy_list);
+<br>&nbsp; virtual TAO_AV_PolicyList get_policies (void);
+<p>&nbsp; /// start/stop the flow.
+<br>&nbsp; virtual int start (void);
+<br>&nbsp; virtual int stop (void);
+<p>&nbsp; /// send a data frame.
+<br>&nbsp; virtual int send_frame (ACE_Message_Block *frame,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_AV_frame_info *frame_info = 0) = 0;
+<p>&nbsp; /// send a frame in iovecs.
+<br>&nbsp; virtual int send_frame (const iovec *iov,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+int iovcnt,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+TAO_AV_frame_info *frame_info = 0) = 0;
+<p>&nbsp; virtual int send_frame (const char *buf,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+size_t len) = 0;
+<p>&nbsp; /// end the stream.
+<br>&nbsp; virtual void control_object (TAO_AV_Protocol_Object *object);
+<br>&nbsp; virtual int destroy (void) = 0;
+<br>&nbsp; TAO_AV_Transport *transport (void);
+<br>protected:
+<br>&nbsp; TAO_AV_Transport *transport_;
+<br>&nbsp; TAO_AV_PolicyList policy_list_;
+<br>&nbsp; TAO_AV_Callback *callback_;
+<br>};
+<p>For an example of how all the above components are implemented refer
+to the implementation of the UDP transport <a href="./UDP.h">&lt;orbsvcs/orbsvcs/AV/UDP.h>&nbsp;</a>
+and&nbsp;<a href="./UDP.cpp">&lt;orbsvcs/orbsvcs/AV/UDP.cpp></a>
+<p>
+<hr WIDTH="100%">
+<h3>
+Using a Pluggable Protocol</h3>
+Once the TAO&nbsp;AV&nbsp;pluggable transport and flow protocols are implemented
+they can be loaded into the AV&nbsp;Streams framework by adding their entries
+to the Service Configurator file (eg. svc.conf) for that protocol:
+<p>A typical svc.conf will look like this:
+<p>dynamic TAO_AV_Resource_Factory Service_Object * TAO_AV:_make_TAO_AV_Resource_Factory()
+""
+<br>dynamic ATM_Factory Service_Object * TAO_AV:_make_TAO_AV_ATM_Factory()
+""
+<br>static TAO_AV_Resource_Factory "-AVTransportFactory ATM_Factory"
+<br>dynamic SFP_Factory Service_Object * TAO_AV:_make_TAO_AV_SFP_Factory()
+""
+<br>static TAO_AV_Resource_Factory "-AVFlowProtocolFactory SFP_Factory"
+<p>The TAO_AV_Resource_Factory is a the default resource factory that helps
+to load the different transport and flow protocols to the corresponding
+factory sets.
+<p><b><i>NOTE: The TAO_AV_Resource_Factory must be loaded in order to load
+the pluggable protocols, ie. the first statement shown above is mandatory
+to load the protocols.</i></b><b><i></i></b>
+<p>The above entries show how to add a transport factory eg. ATM&nbsp;Factory
+and a flow protocol factory eg. SFP&nbsp;Factory. The -AVTransportFactory
+option causes the specified transport protocol factory to be loaded into
+the AV Core and the -AVFlowProtocolFactory option causes the specified
+flow protocol factory to be loaded into the AV&nbsp;Core.
+</body>
+</html>
diff --git a/TAO/orbsvcs/orbsvcs/AV/AV_export.h b/TAO/orbsvcs/orbsvcs/AV/AV_export.h
new file mode 100644
index 00000000000..bfabf3dcde8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/AV_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_AV_EXPORT_H
+#define TAO_AV_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_AV_HAS_DLL)
+# define TAO_AV_HAS_DLL 0
+# endif /* ! TAO_AV_HAS_DLL */
+#else
+# if !defined (TAO_AV_HAS_DLL)
+# define TAO_AV_HAS_DLL 1
+# endif /* ! TAO_AV_HAS_DLL */
+#endif
+
+#if defined (TAO_AV_HAS_DLL) && (TAO_AV_HAS_DLL == 1)
+# if defined (TAO_AV_BUILD_DLL)
+# define TAO_AV_Export ACE_Proper_Export_Flag
+# define TAO_AV_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_AV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_AV_BUILD_DLL */
+# define TAO_AV_Export ACE_Proper_Import_Flag
+# define TAO_AV_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_AV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_AV_BUILD_DLL */
+#else /* TAO_AV_HAS_DLL == 1 */
+# define TAO_AV_Export
+# define TAO_AV_SINGLETON_DECLARATION(T)
+# define TAO_AV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_AV_HAS_DLL == 1 */
+
+#endif /* TAO_AV_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy.cpp b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy.cpp
new file mode 100644
index 00000000000..4d15bdd853a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy.cpp
@@ -0,0 +1,435 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// Endpoint_Strategy.cpp
+//
+// = AUTHOR
+// Sumedh Mungee <sumedh@cs.wustl.edu>
+//
+//
+// ============================================================================
+
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+
+#include "ace/Process_Semaphore.h"
+
+ACE_RCSID(AV, Endpoint_Strategy, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// ----------------------------------------------------------------------
+// TAO_AV_Endpoint_Strategy
+// ----------------------------------------------------------------------
+
+// Constructor
+TAO_AV_Endpoint_Strategy::TAO_AV_Endpoint_Strategy (void)
+{
+}
+
+// Destructor.
+TAO_AV_Endpoint_Strategy::~TAO_AV_Endpoint_Strategy (void)
+{
+
+}
+
+// The base class defines the "failure" case, so that unless the
+// subclasses override this, the call will fail. This is done so that
+// subclasses need only define the calls that they want to support,
+// and the remaining calls will fail automagically
+int
+TAO_AV_Endpoint_Strategy::create_A (AVStreams::StreamEndPoint_A_ptr & /* stream_endpoint */,
+ AVStreams::VDev_ptr & /* vdev */
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Error creating A endpoint\n"),
+ -1);
+}
+
+// The base class defines the "failure" case, so that unless the
+// subclasses override this, the call will fail. This is done so that
+// subclasses need only define the calls that they want to support,
+// and the remaining calls will fail automagically
+int
+TAO_AV_Endpoint_Strategy::create_B (AVStreams::StreamEndPoint_B_ptr & /* stream_endpoint */,
+ AVStreams::VDev_ptr & /*vdev */
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Error creating B endpoint\n"),
+ -1);
+}
+
+
+// ----------------------------------------------------------------------
+// TAO_AV_Endpoint_Process_Strategy
+// ----------------------------------------------------------------------
+
+// Constructor
+TAO_AV_Endpoint_Process_Strategy::TAO_AV_Endpoint_Process_Strategy (ACE_Process_Options *process_options)
+ : process_options_ (process_options),
+ pid_ (-1)
+{
+ ACE_OS::hostname (this->host_,
+ sizeof this->host_);
+}
+
+// Destructor.
+TAO_AV_Endpoint_Process_Strategy::~TAO_AV_Endpoint_Process_Strategy (void)
+{
+}
+
+// Spawns the process, and waits for it to finish booting.
+// Then uses bind_to_naming_service, get_stream_endpoint, and get_vdev
+// to get the object references to the various objects created in the
+// child
+int
+TAO_AV_Endpoint_Process_Strategy::activate (void)
+{
+ ACE_Process process;
+
+ // Create a new process to contain this endpoint
+ this->pid_ = process.spawn (*this->process_options_);
+
+ // Process creation failed
+ if (this->pid_ == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) ACE_Process:: spawn failed: %p\n",
+ "spawn"),
+ -1);
+
+ // Create a unique semaphore name, using my hostname, and pid.
+ char sem_str [BUFSIZ];
+
+ // create a unique semaphore name
+ ACE_OS::sprintf (sem_str,
+ "%s:%s:%ld",
+ "TAO_AV_Process_Semaphore",
+ this->host_,
+ static_cast<long int> (this->pid_));
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) semaphore is %s\n",
+ sem_str));
+ // Create the semaphore
+ ACE_Process_Semaphore semaphore (0, // 0 means that the
+ // semaphore is locked initially
+ sem_str);
+
+ // wait until the child finishes booting
+ while (1)
+ {
+ if (semaphore.acquire () == -1)
+ {
+ // See if my child process is still alive -- if not, return an error
+ if (ACE_OS::kill (this->pid_,
+ 0) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Process_Strategy: Process being waited on died unexpectedly.\n"),
+ -1);
+ // if we were not interrupted due to a EINTR, break
+ if (errno != EINTR)
+ break;
+ }
+ else
+ break;
+ }
+
+ // The job of the semaphore is done, remove it.
+ if (semaphore.remove () == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) semaphore remove failed: %p\n",
+ "remove"),
+ -1);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Get ourselves a Naming service
+ this->bind_to_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the stream endpoint created by the child from the naming service
+ this->get_stream_endpoint (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the Vdev created by the child from the naming service
+ this->get_vdev (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Process_Strategy::activate");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+// Get ourselves a Naming service reference
+int
+TAO_AV_Endpoint_Process_Strategy::bind_to_naming_service (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ if (CORBA::is_nil (this->naming_context_.in ()) == 0)
+ return 0;
+
+ CORBA::Object_var naming_obj =
+ TAO_ORB_Core_instance ()->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 resolve the Name Service.\n"),
+ -1);
+ this->naming_context_ =
+ CosNaming::NamingContext::_narrow (naming_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Process_Strategy::bind_to_naming_service");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+// Get the VDev created in the child process from the namingservice
+int
+TAO_AV_Endpoint_Process_Strategy::get_vdev (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ char vdev_name [BUFSIZ];
+ ACE_OS::sprintf (vdev_name,
+ "%s:%s:%ld",
+ "VDev",
+ this->host_,
+ (long) this->pid_);
+
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)%s\n",vdev_name));
+
+ // Create the name
+ CosNaming::Name VDev_Name (1);
+ VDev_Name.length (1);
+ VDev_Name [0].id = CORBA::string_dup (vdev_name);
+
+ // Get the CORBA::Object
+ CORBA::Object_var vdev =
+ this->naming_context_->resolve (VDev_Name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow it
+ this->vdev_ =
+ AVStreams::VDev::_narrow (vdev.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Check if valid
+ if (CORBA::is_nil (this->vdev_.in() ))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " could not resolve Stream_Endpoint_B in Naming service <%s>\n"),
+ -1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Process_Strategy::get_vdev");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+// ----------------------------------------------------------------------
+// TAO_AV_Endpoint_Process_Strategy_A
+// ----------------------------------------------------------------------
+
+// Constructor
+TAO_AV_Endpoint_Process_Strategy_A::TAO_AV_Endpoint_Process_Strategy_A (ACE_Process_Options *process_options)
+ : TAO_AV_Endpoint_Process_Strategy (process_options)
+{
+}
+
+// Destructor
+TAO_AV_Endpoint_Process_Strategy_A::~TAO_AV_Endpoint_Process_Strategy_A (void)
+{
+}
+
+// the "A" type endpoint creator
+int
+TAO_AV_Endpoint_Process_Strategy_A::create_A (AVStreams::StreamEndPoint_A_ptr &stream_endpoint,
+ AVStreams::VDev_ptr &vdev
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ // use the baseclass activate
+ if (this->activate () == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) TAO_AV_Endpoint_Process_Strategy: Error in activate ()\n"),
+ -1);
+
+ // return the object references
+ stream_endpoint = AVStreams::StreamEndPoint_A::_duplicate( this->stream_endpoint_a_.in() );
+ vdev = AVStreams::VDev::_duplicate( this->vdev_.in() );
+ return 0;
+
+}
+
+// Gets the stream endpoint object reference from the naming service
+int
+TAO_AV_Endpoint_Process_Strategy_A::get_stream_endpoint (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ char stream_endpoint_name[BUFSIZ];
+ ACE_OS::sprintf (stream_endpoint_name,
+ "%s:%s:%ld",
+ "Stream_Endpoint_A",
+ this->host_,
+ (long) this->pid_);
+
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)%s\n",stream_endpoint_name));
+
+ // Create the name
+ CosNaming::Name Stream_Endpoint_A_Name (1);
+
+ Stream_Endpoint_A_Name.length (1);
+ Stream_Endpoint_A_Name [0].id = CORBA::string_dup (stream_endpoint_name);
+
+ // Get the CORBA::Object
+ CORBA::Object_var stream_endpoint_a =
+ this->naming_context_->resolve (Stream_Endpoint_A_Name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow the reference
+ this->stream_endpoint_a_ =
+ AVStreams::StreamEndPoint_A::_narrow (stream_endpoint_a.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Check for validity
+ if (CORBA::is_nil (this->stream_endpoint_a_.in() ))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " could not resolve Stream_Endpoint_A in Naming service <%s>\n"),
+ -1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Process_Strategy_A::get_stream_endpoint");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+// ----------------------------------------------------------------------
+// TAO_AV_Endpoint_Process_Strategy_B
+// ----------------------------------------------------------------------
+
+// Constructor
+TAO_AV_Endpoint_Process_Strategy_B::TAO_AV_Endpoint_Process_Strategy_B (ACE_Process_Options *process_options)
+ : TAO_AV_Endpoint_Process_Strategy (process_options)
+{
+}
+
+// Destructor
+TAO_AV_Endpoint_Process_Strategy_B::~TAO_AV_Endpoint_Process_Strategy_B (void)
+{
+}
+
+// Creates and returns a "B" type endpoint
+int
+TAO_AV_Endpoint_Process_Strategy_B::create_B (AVStreams::StreamEndPoint_B_ptr &stream_endpoint,
+ AVStreams::VDev_ptr &vdev
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ if (this->activate () == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) TAO_AV_Endpoint_Process_Strategy: Error in activate ()\n"),
+ -1);
+
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Process_Strategy_B::create_B ()\n: stream_endpoint is:%s\n",
+ TAO_ORB_Core_instance ()->orb ()->object_to_string (this->stream_endpoint_b_.in()
+ ACE_ENV_ARG_PARAMETER)));
+ ACE_TRY_CHECK;
+ stream_endpoint = AVStreams::StreamEndPoint_B::_duplicate ( this->stream_endpoint_b_.in() );
+ vdev = AVStreams::VDev::_duplicate( this->vdev_.in() );
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Process_Strategy_B::create_B\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+// Gets the B type stream_endpoint from the Naming service
+int
+TAO_AV_Endpoint_Process_Strategy_B::get_stream_endpoint (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ char stream_endpoint_name[BUFSIZ];
+ ACE_OS::sprintf (stream_endpoint_name,
+ "%s:%s:%ld",
+ "Stream_Endpoint_B",
+ this->host_,
+ (long) this->pid_);
+
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)%s\n",stream_endpoint_name));
+
+ // Create the name
+ CosNaming::Name Stream_Endpoint_B_Name (1);
+
+ Stream_Endpoint_B_Name.length (1);
+ Stream_Endpoint_B_Name [0].id = CORBA::string_dup (stream_endpoint_name);
+
+ // Get the CORBA::Object reference
+ CORBA::Object_var stream_endpoint_b =
+ this->naming_context_->resolve (Stream_Endpoint_B_Name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow the reference
+ this->stream_endpoint_b_ =
+ AVStreams::StreamEndPoint_B::_narrow (stream_endpoint_b.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Check for validity
+ if (CORBA::is_nil (this->stream_endpoint_b_.in() ))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " could not resolve Stream_Endpoint_B in Naming service <%s>\n"),
+ -1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Process_Strategy_B::get_stream_endpoint");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h
new file mode 100644
index 00000000000..2cc9158853b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h
@@ -0,0 +1,190 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Endpoint_Strategy.h
+ *
+ * $Id$
+ *
+ * @author Sumedh Mungee <sumedh@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_AV_ENDPOINT_STRATEGY_H
+#define TAO_AV_ENDPOINT_STRATEGY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "ace/os_include/os_netdb.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 */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Process_Options;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_AV_Endpoint_Strategy
+ *
+ * Base class to define various endpoint strategies
+ * used by the MMDevice to create the Endpoint and Vdev
+ */
+class TAO_AV_Export TAO_AV_Endpoint_Strategy
+{
+
+public:
+ /// Constructor
+ TAO_AV_Endpoint_Strategy (void);
+
+ /// Destructor
+ virtual ~TAO_AV_Endpoint_Strategy (void);
+
+ /// Called by the MMDevice, when it needs to create an A type endpoint
+ virtual int create_A (AVStreams::StreamEndPoint_A_ptr &stream_endpoint,
+ AVStreams::VDev_ptr &vdev
+ ACE_ENV_ARG_DECL);
+
+ /// Called by the MMDevice, when it needs to create an B type endpoint
+ virtual int create_B (AVStreams::StreamEndPoint_B_ptr &stream_endpoint,
+ AVStreams::VDev_ptr &vdev
+ ACE_ENV_ARG_DECL);
+
+protected:
+ /// The "A" stream endpoint
+ AVStreams::StreamEndPoint_A_var stream_endpoint_a_;
+
+ /// The "B" stream endpoint
+ AVStreams::StreamEndPoint_B_var stream_endpoint_b_;
+
+ /// The vdev
+ AVStreams::VDev_var vdev_;
+
+};
+
+// ----------------------------------------------------------------------
+/**
+ * @class TAO_AV_Endpoint_Process_Strategy
+ * @brief Process-based strategy for creating endpoints.
+ * Abstract base class.
+ */
+class TAO_AV_Export TAO_AV_Endpoint_Process_Strategy
+ : public TAO_AV_Endpoint_Strategy
+{
+
+public:
+ /// Constructor. The process_options contain the name and arguments
+ /// for the process to be created
+ TAO_AV_Endpoint_Process_Strategy (ACE_Process_Options *process_options);
+
+ /// Destructor.
+ virtual ~TAO_AV_Endpoint_Process_Strategy (void);
+
+ /// creates a new child process, and waits on a semaphore
+ /// until the child process has finished creating the endpoints
+ virtual int activate (void);
+
+protected:
+ /// Bind to the naming service
+ virtual int bind_to_naming_service (ACE_ENV_SINGLE_ARG_DECL);
+
+ /**
+ * Get the object reference for the newly created stream
+ * endpoint (which will be in the child process)
+ * Subclasses will define the functionality for this
+ */
+ virtual int get_stream_endpoint (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ /// Get the Vdev object reference for the newly created
+ /// endpoint
+ virtual int get_vdev (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Naming context
+ CosNaming::NamingContext_var naming_context_;
+
+ /// Name and arguments for the process to be created
+ ACE_Process_Options *process_options_;
+
+ /// name of this host used for resolving unique names.
+ char host_[MAXHOSTNAMELEN];
+
+ /// My child's process id.
+ pid_t pid_;
+};
+
+
+// ----------------------------------------------------------------------
+
+/**
+ * @class TAO_AV_Endpoint_Process_Strategy_A
+ * @brief Process-based strategy to create "A" type endpoints
+ */
+class TAO_AV_Export TAO_AV_Endpoint_Process_Strategy_A
+ : public TAO_AV_Endpoint_Process_Strategy
+{
+
+public:
+ /// Constructor
+ TAO_AV_Endpoint_Process_Strategy_A (ACE_Process_Options *process_options);
+
+ /// Destructor.
+ virtual ~TAO_AV_Endpoint_Process_Strategy_A (void);
+
+protected:
+ /// Creates an "A" type stream endpoint, and a vdev
+ virtual int create_A (AVStreams::StreamEndPoint_A_ptr &stream_endpoint,
+ AVStreams::VDev_ptr &vdev
+ ACE_ENV_ARG_DECL);
+
+ /// Gets the "A" type stream endpoint from the child process
+ virtual int get_stream_endpoint (ACE_ENV_SINGLE_ARG_DECL);
+
+};
+
+// ----------------------------------------------------------------------
+
+/**
+ * @class TAO_AV_Endpoint_Process_Strategy_B
+ * @brief Process-based strategy to create "B" type endpoints
+ */
+class TAO_AV_Export TAO_AV_Endpoint_Process_Strategy_B
+ : public TAO_AV_Endpoint_Process_Strategy
+{
+
+public:
+ /// Constructor
+ TAO_AV_Endpoint_Process_Strategy_B (ACE_Process_Options *process_options);
+
+ /// Destructor.
+ virtual ~TAO_AV_Endpoint_Process_Strategy_B (void);
+
+protected:
+ /// Creates a "B" type stream endpoint, and a vdev
+ virtual int create_B (AVStreams::StreamEndPoint_B_ptr &stream_endpoint,
+ AVStreams::VDev_ptr &vdev
+ ACE_ENV_ARG_DECL);
+
+
+ /// Gets the object reference of the "B" type streamendpoint.
+ virtual int get_stream_endpoint (ACE_ENV_SINGLE_ARG_DECL);
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// Include the templates here.
+#include "orbsvcs/AV/Endpoint_Strategy_T.h"
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_ENDPOINT_STRATEGY_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp
new file mode 100644
index 00000000000..b52287ef621
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp
@@ -0,0 +1,837 @@
+// $Id$
+
+#ifndef TAO_AV_ENDPOINT_STRATEGY_T_CPP
+#define TAO_AV_ENDPOINT_STRATEGY_T_CPP
+
+#include "orbsvcs/AV/Endpoint_Strategy_T.h"
+
+#include "tao/debug.h"
+
+#include "ace/Process_Semaphore.h"
+#include "ace/OS_NS_unistd.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// ----------------------------------------------------------------------
+// TAO_AV_Endpoint_Reactive_Strategy
+// ----------------------------------------------------------------------
+
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::TAO_AV_Endpoint_Reactive_Strategy (void)
+ : stream_endpoint_a_servant_(0), stream_endpoint_b_servant_(0), vdev_servant_(0),
+ media_ctrl_servant_(0)
+{
+}
+
+template <class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
+TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Endpoint_Reactive_Strategy (void)
+{
+ // Do not allow exceptions to escape from the destructor
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ if(this->stream_endpoint_a_servant_ )
+ {
+ stream_endpoint_a_servant_->_remove_ref (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ if(this->stream_endpoint_b_servant_)
+ {
+ stream_endpoint_b_servant_->_remove_ref (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ if(this->vdev_servant_)
+ {
+ vdev_servant_->_remove_ref (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ if(this->media_ctrl_servant_)
+ {
+ media_ctrl_servant_->_remove_ref (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ }
+# if defined (ACE_HAS_EXCEPTIONS) \
+ && defined (ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS)
+ ACE_CATCHALL
+ {
+ }
+# endif /* ACE_HAS_EXCEPTIONS && ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS */
+ ACE_ENDTRY;
+
+}
+
+// Create, activate the objects with the POA
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->activate_stream_endpoint (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activated stream_endpoint\n"));
+
+ this->activate_vdev (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activated vdev\n"));
+
+ this->activate_mediactrl (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activated mediactrl\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_Endpoint_Reactive_Strategy::activate");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+char *
+TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_with_poa (PortableServer::Servant servant ACE_ENV_ARG_DECL)
+{
+
+ PortableServer::ObjectId_var id =
+ this->poa_->activate_object (servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Object_var obj =
+ this->poa_->id_to_reference (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::String_var str =
+ this->orb_->object_to_string (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return str._retn ();
+}
+
+
+// Activate VDev into the POA
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_vdev (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ // Bridge pattern. Allow subclasses to override this behavior
+ T_VDev *vdev = 0;
+ if (this->make_vdev (vdev) == -1)
+ return -1;
+
+ // Activate the object under the root poa.
+// CORBA::String_var vdev_ior = this->activate_with_poa (vdev,
+// ACE_ENV_ARG_PARAMETER);
+// ACE_TRY_CHECK;
+// if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activate_vdev, vdev ior is:%s\n",
+// vdev_ior. in ()));
+
+ // Save the object reference, so that create_A can return it
+ this->vdev_ = vdev->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Reactive_Strategy::activate_vdev");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+
+// Activate the media_controller
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_mediactrl (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ // Bridge pattern. Subclasses can override this
+ if (this->make_mediactrl ( media_ctrl_servant_ ) == -1)
+ return -1;
+
+ // Associate the media controller object reference with the vdev, as per the OMG spec
+ CORBA::Any anyval;
+ media_ctrl_obj_
+ = media_ctrl_servant_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ anyval <<= media_ctrl_obj_.in();
+
+ ACE_TRY_CHECK;
+
+ this->vdev_->define_property ("Related_MediaCtrl",
+ anyval
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Reactive_Strategy::activate_mediactrl");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+// Bridge method
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Endpoint_Reactive_Strategy<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_stream_endpoint (T_StreamEndpoint *&stream_endpoint)
+{
+ ACE_NEW_RETURN (stream_endpoint,
+ T_StreamEndpoint,
+ -1);
+ return 0;
+}
+
+// Bridge method
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Endpoint_Reactive_Strategy<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_vdev (T_VDev *&vdev)
+{
+ ACE_NEW_RETURN (vdev,
+ T_VDev,
+ -1);
+ return 0;
+}
+
+// Bridge method
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Endpoint_Reactive_Strategy<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_mediactrl (T_MediaCtrl *&media_ctrl)
+{
+ ACE_NEW_RETURN (media_ctrl,
+ T_MediaCtrl,
+ -1);
+ return 0;
+}
+
+
+// ----------------------------------------------------------------------
+
+// ----------------------------------------------------------------------
+// TAO_AV_Endpoint_Reactive_Strategy_A
+// ----------------------------------------------------------------------
+
+//Constructor
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+TAO_AV_Endpoint_Reactive_Strategy_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::TAO_AV_Endpoint_Reactive_Strategy_A (void)
+{
+}
+
+
+// Destructor
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+TAO_AV_Endpoint_Reactive_Strategy_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Endpoint_Reactive_Strategy_A (void)
+{
+}
+
+
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Endpoint_Reactive_Strategy_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::init (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa)
+{
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+ this->poa_ = PortableServer::POA::_duplicate (poa);
+ return 0;
+}
+
+// Creates an "A" type streamendpoint, and a vdev and returns the
+// object references
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Endpoint_Reactive_Strategy_A<T_StreamEndpoint, T_VDev, T_MediaCtrl>::create_A (AVStreams::StreamEndPoint_A_ptr &stream_endpoint,
+ AVStreams::VDev_ptr &vdev
+ ACE_ENV_ARG_DECL_NOT_USED/* ACE_ENV_SINGLE_ARG_PARAMETER */)
+{
+ if (this->activate () == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) TAO_AV_Endpoint_Reactive_Strategy_A: Error in activate ()\n"),
+ -1);
+
+ stream_endpoint = AVStreams::StreamEndPoint_A::_duplicate( this->stream_endpoint_a_.in() );
+ vdev = AVStreams::VDev::_duplicate( this->vdev_.in() );
+ return 0;
+
+}
+
+// Put the stream_endpoint into the POA
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Endpoint_Reactive_Strategy_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_stream_endpoint (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+
+ // Use the bridge method
+ if (this->make_stream_endpoint (this->stream_endpoint_a_servant_) == -1)
+ return -1;
+
+ // Save the object references, so that create_a can return them
+ this->stream_endpoint_a_ = this->stream_endpoint_a_servant_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Reactive_Strategy_A::activate_stream_endpoint");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+// ----------------------------------------------------------------------
+// TAO_AV_Endpoint_Reactive_Strategy_B
+// ----------------------------------------------------------------------
+
+
+// Constructor
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+TAO_AV_Endpoint_Reactive_Strategy_B <T_StreamEndpoint, T_VDev, T_MediaCtrl>::TAO_AV_Endpoint_Reactive_Strategy_B (void)
+{
+}
+
+// Destructor
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+TAO_AV_Endpoint_Reactive_Strategy_B <T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Endpoint_Reactive_Strategy_B (void)
+{
+}
+
+
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Endpoint_Reactive_Strategy_B <T_StreamEndpoint, T_VDev, T_MediaCtrl>::init (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa)
+{
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+ this->poa_ = PortableServer::POA::_duplicate (poa);
+ return 0;
+}
+
+// Activate stream_endpoint
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Endpoint_Reactive_Strategy_B <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_stream_endpoint (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ if (this->make_stream_endpoint ( this->stream_endpoint_b_servant_ ) == -1)
+ return -1;
+
+ this->stream_endpoint_b_ = this->stream_endpoint_b_servant_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Reactive_Strategy_B::activate_stream_endpoint");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+// Returns a "B" type stream_endpoint and a vdev
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Endpoint_Reactive_Strategy_B<T_StreamEndpoint, T_VDev, T_MediaCtrl>::create_B (AVStreams::StreamEndPoint_B_ptr &stream_endpoint,
+ AVStreams::VDev_ptr &vdev
+ ACE_ENV_ARG_DECL_NOT_USED/* ACE_ENV_SINGLE_ARG_PARAMETER */)
+{
+ if (this->activate () == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) TAO_AV_Endpoint_Reactive_Strategy_B: Error in activate ()\n"),
+ -1);
+
+ stream_endpoint = AVStreams::StreamEndPoint_B::_duplicate( this->stream_endpoint_b_.in() );
+ vdev = AVStreams::VDev::_duplicate( this->vdev_.in() );
+
+ return 0;
+}
+
+// ----------------------------------------------------------------------
+// TAO_AV_Child_Process
+// ----------------------------------------------------------------------
+
+// Constructor
+template <class T_StreamEndpoint_B, class T_VDev , class T_MediaCtrl>
+TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::TAO_AV_Child_Process ()
+ : stream_endpoint_name_ (0),
+ pid_ (-1)
+{
+ this->pid_ = ACE_OS::getpid ();
+ if (this->pid_ == 0)
+ ACE_ERROR ((LM_ERROR,"getpid () failed\n"));
+ ACE_OS::hostname (this->host_,
+ sizeof this->host_);
+}
+
+// Initializes the ORB, activates the objects, and release the semaphore
+template <class T_StreamEndpoint_B, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::init (int argc,
+ char **argv,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->orb_ = orb;
+
+ this->poa_ = poa;
+
+ // create the objects and activate them in the poa
+ this->activate_objects (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get ourselves a naming_service object reference
+ this->bind_to_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Register the vdev with the naming service
+ this->register_vdev (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // register the stream_endpoing with the naming_service
+ this->register_stream_endpoint (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_Child_Process");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ // release the semaphore the parent is waiting on
+ if (this->release_semaphore () == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Error releasing semaphores\n"),
+ -1);
+
+ return 0;
+}
+
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+char *
+TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_with_poa (PortableServer::Servant servant
+ ACE_ENV_ARG_DECL)
+{
+
+ PortableServer::ObjectId_var id =
+ this->poa_->activate_object (servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Object_var obj =
+ this->poa_->id_to_reference (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::String_var str =
+ this->orb_->object_to_string (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return str._retn ();
+}
+
+// initializes the orb, and activates the objects
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_objects (int /*argc*/,
+ char ** /*argv*/
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ // bridge method to make a new stream endpoint
+ if (this->make_stream_endpoint (this->stream_endpoint_) == -1)
+ return -1;
+
+ // bridge method to make a new vdev
+ if (this->make_vdev (this->vdev_) == -1)
+ return -1;
+
+ // bridge method to make a new media controller
+ if (this->make_mediactrl (this->media_ctrl_) == -1)
+ return -1;
+
+ // activate the stream_endpoint
+ CORBA::String_var stream_endpoint_ior = this->activate_with_poa (this->stream_endpoint_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t)TAO_AV_Child_Process::activate_objects,stream_endpoint_ior :%s\n",
+ stream_endpoint_ior.in ()));
+
+ // activate the vdev
+ CORBA::String_var vdev_ior = this->activate_with_poa (this->vdev_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t)TAO_AV_Child_Process::activate_objects, vdev ior is :%s\n",
+ vdev_ior.in ()));
+
+ // activate the media controller
+ CORBA::String_var media_ctrl_ior = this->activate_with_poa (this->media_ctrl_
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Child_Process::activate_objects,media_ctrl_ior is: %s\n",media_ctrl_ior.in ()));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Child_Process::init ");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+// Bind to the namingservice
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::bind_to_naming_service (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ 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 resolve the Name Service.\n"),
+ -1);
+ // if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "(%P|%t) %s:%d\n", __FILE__, __LINE__));
+ this->naming_context_ =
+ CosNaming::NamingContext::_narrow (naming_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Child_Process::bind_to_naming_service");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+// register the vdev with the naming service
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_vdev (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ char vdev_name [BUFSIZ];
+ ACE_OS::sprintf (vdev_name,
+ "%s:%s:%ld",
+ "VDev",
+ this->host_,
+ static_cast<long> (this->pid_));
+
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)%s\n",vdev_name));
+ // create the name
+ this->vdev_name_.length (1);
+ this->vdev_name_ [0].id = CORBA::string_dup (vdev_name);
+
+ // make the media controller a property of the vdev
+ CORBA::Any media_ctrl_property;
+ media_ctrl_obj_ =
+ this->media_ctrl_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->vdev_->define_property ("Related_MediaCtrl",
+ media_ctrl_obj_.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ vdev_obj_ = this->vdev_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TRY_CHECK;
+ ACE_TRY_EX (bind)
+ {
+ // Register the vdev with the naming server.
+ this->naming_context_->bind (this->vdev_name_,
+ vdev_obj_.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (bind);
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound,ex)
+ {
+ // If the object was already there, replace the older reference
+ // with this one
+ this->naming_context_->rebind (this->vdev_name_,
+ vdev_obj_.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Child_Process::register_vdev");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Child_Process::register_vdev");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+// run the orb event look
+template <class T_StreamEndpoint_B, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::run (ACE_Time_Value *tv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->orb_->run (tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"orb.run ()");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+// release the semaphore the parent is waiting on
+template <class T_StreamEndpoint_B, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::release_semaphore ()
+{
+ char sem_str [BUFSIZ];
+
+ long pid = this->pid_;
+ sprintf (sem_str,
+ "%s:%s:%ld",
+ "TAO_AV_Process_Semaphore",
+ this->host_,
+ pid);
+
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) semaphore is %s\n",
+ sem_str));
+
+ // Release the lock on which the server is waiting
+ ACE_Process_Semaphore semaphore (0, // 0 means that the semaphore is
+ // initially locked
+ sem_str);
+
+ if (semaphore.release () == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Error releasing semaphore %s: %p\n",
+ sem_str,
+ "semaphore.release ()"),
+ -1);
+
+ return 0;
+}
+
+// register the stream_endpoint with the naming service
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_stream_endpoint (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_ptr stream_endpoint_obj = CORBA::Object::_nil ();
+ ACE_TRY
+ {
+ stream_endpoint_obj = this->stream_endpoint_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create a name for the video control object
+ // subclasses can define their own name for the streamendpoint
+ // Register the stream endpoint object with the naming server.
+ this->naming_context_->bind (this->stream_endpoint_name_,
+ stream_endpoint_obj
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound,ex)
+ {
+ // if the name was already there, replace the reference with the new one
+ this->naming_context_->rebind (this->stream_endpoint_name_,
+ stream_endpoint_obj
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_Endpoint_Reactive_Strategy::activate");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+// Bridge method to make a new stream_endpoint
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Child_Process<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_stream_endpoint (T_StreamEndpoint *&stream_endpoint)
+{
+ ACE_NEW_RETURN (stream_endpoint,
+ T_StreamEndpoint,
+ -1);
+ return 0;
+}
+
+// Bridge method to make a new vdev
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Child_Process<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_vdev (T_VDev *&vdev)
+{
+ ACE_NEW_RETURN (vdev,
+ T_VDev,
+ -1);
+ return 0;
+}
+
+// Bridge method to make a new media controller
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Child_Process<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_mediactrl (T_MediaCtrl *&media_ctrl)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t) TAO_AV_Child_Process::make_mediactrl ()\n"));
+ ACE_NEW_RETURN (media_ctrl,
+ T_MediaCtrl,
+ -1);
+ return 0;
+}
+
+
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+int
+TAO_AV_Child_Process<T_StreamEndpoint, T_VDev, T_MediaCtrl>::unbind_names (void)
+{
+ // Remove the names from the naming service
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ if (CORBA::is_nil (this->naming_context_.in ()) == 0)
+ return 0;
+ this->naming_context_->unbind (this->stream_endpoint_name_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->naming_context_->unbind (this->vdev_name_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_Endpoint_Process_Strategy::activate");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+// %% its not clear whether we should be deleting the objects, since
+// if the application overrides the make_mediactrl methods etc.,
+// then, we may not own these objects.
+// For now, we dont delete the objects, since they exist for the
+// lifetime of the process anyway
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+TAO_AV_Child_Process<T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Child_Process ()
+{
+ this->unbind_names ();
+}
+
+// ----------------------------------------------------------------------
+// TAO_AV_Child_Process_A
+// ----------------------------------------------------------------------
+
+// Define the name of the stream_endpoint, as used to register with
+// the naming service
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+TAO_AV_Child_Process_A<T_StreamEndpoint, T_VDev, T_MediaCtrl>::TAO_AV_Child_Process_A ()
+{
+ char stream_endpoint_name[BUFSIZ];
+ ACE_OS::sprintf (stream_endpoint_name,
+ "%s:%s:%ld",
+ "Stream_Endpoint_A",
+ this->host_,
+ static_cast<long> (this->pid_));
+
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)%s\n",stream_endpoint_name));
+ this->stream_endpoint_name_.length (1);
+ this->stream_endpoint_name_ [0].id = CORBA::string_dup (stream_endpoint_name);
+}
+
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+TAO_AV_Child_Process_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Child_Process_A ()
+{
+}
+
+// ----------------------------------------------------------------------
+// TAO_AV_Child_Process_B
+// ----------------------------------------------------------------------
+
+// Define the name of the stream_endpoint, as used to register with
+// the naming service
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+TAO_AV_Child_Process_B<T_StreamEndpoint, T_VDev, T_MediaCtrl>::TAO_AV_Child_Process_B ()
+{
+ char stream_endpoint_name[BUFSIZ];
+ ACE_OS::sprintf (stream_endpoint_name,
+ "%s:%s:%ld",
+ "Stream_Endpoint_B",
+ this->host_,
+ static_cast<long> (this->pid_));
+
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)%s\n",stream_endpoint_name));
+ this->stream_endpoint_name_.length (1);
+ this->stream_endpoint_name_ [0].id = CORBA::string_dup (stream_endpoint_name);
+}
+
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+TAO_AV_Child_Process_B<T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Child_Process_B ()
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_AV_ENDPOINT_STRATEGY_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h
new file mode 100644
index 00000000000..45210da5406
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h
@@ -0,0 +1,293 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Endpoint_Strategy_T.h
+ *
+ * $Id$
+ *
+ * @author Sumedh Mungee <sumedh@cs.wustl.edu>
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_AV_ENDPOINT_STRATEGY_T_H
+#define TAO_AV_ENDPOINT_STRATEGY_T_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_AV_Endpoint_Reactive_Strategy
+ * @brief Reactive strategy base class
+ */
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+class TAO_AV_Endpoint_Reactive_Strategy
+: public TAO_AV_Endpoint_Strategy
+{
+
+protected:
+ // Constructor
+
+ /// Constructor
+ TAO_AV_Endpoint_Reactive_Strategy (void);
+
+ /// Destructor.
+ virtual ~TAO_AV_Endpoint_Reactive_Strategy (void);
+
+ /// creates and activates the streamendpoint, vdev, and mediacontrol
+ virtual int activate (void);
+
+ /// activates the stream_endpoint with the POA
+ virtual int activate_stream_endpoint (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ /// activates the vdev with the POA
+ virtual int activate_vdev (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// activates the media controller with the POA
+ virtual int activate_mediactrl (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Bridge method to create a vdev, a la Acceptor. Applications
+ /// can override this
+ virtual int make_vdev (T_VDev *&vdev);
+
+ /// Bridge method to create a stream_endpoint, a la Acceptor. Applications
+ /// can override this
+ virtual int make_stream_endpoint (T_StreamEndpoint *&stream_endpoint);
+
+ /// Bridge method to create a media_ctrl, a la Acceptor. Applications
+ /// can override this
+ virtual int make_mediactrl (T_MediaCtrl *&media_ctrl);
+
+
+ char* activate_with_poa (PortableServer::Servant servant ACE_ENV_ARG_DECL);
+
+ CORBA::ORB_var orb_;
+
+ PortableServer::POA_var poa_;
+
+ CORBA::Object_var media_ctrl_obj_;
+
+ T_StreamEndpoint *stream_endpoint_a_servant_;
+
+ T_StreamEndpoint *stream_endpoint_b_servant_;
+
+ T_VDev *vdev_servant_;
+
+ T_MediaCtrl *media_ctrl_servant_;
+};
+// ----------------------------------------------------------------------
+
+/**
+ * @class TAO_AV_Endpoint_Reactive_Strategy_A
+ * @brief Reactive strategy
+ */
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+class TAO_AV_Endpoint_Reactive_Strategy_A
+ : public TAO_AV_Endpoint_Reactive_Strategy<T_StreamEndpoint, T_VDev , T_MediaCtrl>
+{
+
+public:
+
+ TAO_AV_Endpoint_Reactive_Strategy_A (void);
+
+ /// Constructor
+ int init (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa);
+
+ /// Destructor.
+ virtual ~TAO_AV_Endpoint_Reactive_Strategy_A (void);
+
+ /// Overrides the base class stream_endpoint activator, to activate
+ /// an "A" type endpoint
+ virtual int activate_stream_endpoint (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Called by the MMDevice, when it needs to create an A type endpoint
+ virtual int create_A (AVStreams::StreamEndPoint_A_ptr &stream_endpoint,
+ AVStreams::VDev_ptr &vdev
+ ACE_ENV_ARG_DECL);
+
+};
+
+// ----------------------------------------------------------------------
+/**
+ * @class TAO_AV_Endpoint_Reactive_Strategy_B
+ * @brief Reactive strategy
+ */
+template <class T_StreamEndpoint, class T_Vdev , class T_MediaCtrl>
+class TAO_AV_Endpoint_Reactive_Strategy_B
+ : public TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_Vdev, T_MediaCtrl>
+{
+
+public:
+
+ /// Constructor
+ TAO_AV_Endpoint_Reactive_Strategy_B (void);
+
+ /// Destructor.
+ virtual ~TAO_AV_Endpoint_Reactive_Strategy_B (void);
+
+ int init (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa);
+
+ /// Overrides the base class stream_endpoint activator, to activate
+ /// a "B" type endpoint
+ virtual int activate_stream_endpoint (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Called by the MMDevice, when it needs to create a B type endpoint
+ virtual int create_B (AVStreams::StreamEndPoint_B_ptr &stream_endpoint,
+ AVStreams::VDev_ptr &vdev
+ ACE_ENV_ARG_DECL);
+};
+
+// ----------------------------------------------------------------------
+
+/**
+ * @class TAO_AV_Child_Process
+ *
+ * @brief Helper class for the child process created in
+ * TAO_AV_Endpoint_Process_Strategy
+ */
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+class TAO_AV_Child_Process
+{
+
+public:
+ /// Constructor
+ TAO_AV_Child_Process ();
+
+ /// Destructor
+ virtual ~TAO_AV_Child_Process ();
+
+ /// Initializes the ORB, creates and activates the
+ /// T_StreamEndpoint, T_VDev, T_MediaCtrl in the POA
+ int init (int argc, char **argv, CORBA::ORB_ptr orb, PortableServer::POA_ptr poa);
+
+ /// runs the ORB event loop
+ int run (ACE_Time_Value *tv = 0);
+
+protected:
+ /**
+ * Creates the objects and inserts them into the Naming
+ * Service, so the parent can pick the IOR's and
+ * return them to the client
+ */
+ int activate_objects (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL);
+
+ ///activate the servant with the poa
+ char* activate_with_poa (PortableServer::Servant servant ACE_ENV_ARG_DECL);
+
+ /// Removes the vdev and streamendpoint names from the naming service.
+ int unbind_names (void);
+
+ /// Binds to the naming service
+ int bind_to_naming_service (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Registers vdev with the naming service
+ int register_vdev (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Registers stream_endpoint with the naming service
+ int register_stream_endpoint (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Releases the semaphore on which the parent is waiting on
+ int release_semaphore ();
+
+ /// Bridge method to create a vdev, a la Acceptor. Applications
+ /// can override this
+ virtual int make_vdev (T_VDev *&vdev);
+
+ /// Bridge method to create a stream_endpoint, a la Acceptor. Applications
+ /// can override this
+ virtual int make_stream_endpoint (T_StreamEndpoint *&stream_endpoint);
+
+ /// Bridge method to create a media_ctrl, a la Acceptor. Applications
+ /// can override this
+ virtual int make_mediactrl (T_MediaCtrl *&media_ctrl);
+
+ /// The root Naming Context of the TAO naming service
+ CosNaming::NamingContext_var naming_context_;
+
+ /// Name of the vdev
+ CosNaming::Name vdev_name_;
+
+ /// Name of the stream_endpoint
+ CosNaming::Name stream_endpoint_name_;
+
+ /// The stream endpoint member
+ T_StreamEndpoint *stream_endpoint_;
+
+ /// The virtual device
+ T_VDev *vdev_;
+
+ /// Virtual device CORBA object reference
+ CORBA::Object_var vdev_obj_;
+
+ /// Media controller
+ T_MediaCtrl *media_ctrl_;
+
+ // Media controller CORBA object reference
+ CORBA::Object_var media_ctrl_obj_;
+
+ /// pid of this process
+ pid_t pid_;
+
+ /// Name of the host.
+ char host_[MAXHOSTNAMELEN];
+
+ CORBA::ORB_ptr orb_;
+
+ PortableServer::POA_ptr poa_;
+
+};
+
+// ----------------------------------------------------------------------
+/**
+ * @class TAO_AV_Child_Process_A
+ * @brief Helper class for the child process created in TAO_AV_Child_Process
+ */
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+class TAO_AV_Child_Process_A
+ : public TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>
+{
+
+public:
+ /// Constructor.
+ TAO_AV_Child_Process_A (void);
+
+ /// Destructor.
+ virtual ~TAO_AV_Child_Process_A (void);
+};
+
+// ----------------------------------------------------------------------
+
+/**
+ * @class TAO_AV_Child_Process_B
+ * @brief Helper class for the child process created in TAO_AV_Child_Process
+ */
+template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
+class TAO_AV_Child_Process_B
+ : public TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>
+{
+
+public:
+ /// Constructor.
+ TAO_AV_Child_Process_B (void);
+
+ /// Destructor.
+ virtual ~TAO_AV_Child_Process_B (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/AV/Endpoint_Strategy_T.cpp"
+#endif /*ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Endpoint_Strategy_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_ENDPOINT_STRATEGY_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/Fill_ACE_QoS.cpp b/TAO/orbsvcs/orbsvcs/AV/Fill_ACE_QoS.cpp
new file mode 100644
index 00000000000..e7cca074af3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Fill_ACE_QoS.cpp
@@ -0,0 +1,75 @@
+// $Id$
+
+#include "orbsvcs/AV/Fill_ACE_QoS.h"
+
+#if defined (ACE_HAS_RAPI) || defined (ACE_HAS_WINSOCK2_GQOS)
+
+ACE_RCSID(QOS, Fill_ACE_QoS,"$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+const iovec Fill_ACE_QoS::iov_ = {0,0};
+
+Fill_ACE_QoS::Fill_ACE_QoS (void)
+{
+ ACE_NEW (this->default_traffic_,
+ ACE_Flow_Spec (ACE_QOS_NOT_SPECIFIED,
+ ACE_QOS_NOT_SPECIFIED,
+ ACE_QOS_NOT_SPECIFIED,
+ ACE_QOS_NOT_SPECIFIED,
+ ACE_QOS_NOT_SPECIFIED,
+ ACE_SERVICETYPE_NOTRAFFIC,
+ ACE_QOS_NOT_SPECIFIED,
+ ACE_QOS_NOT_SPECIFIED,
+ 25,
+ 1));
+}
+
+// destructor.
+Fill_ACE_QoS::~Fill_ACE_QoS (void)
+{}
+
+int
+Fill_ACE_QoS::fill_simplex_receiver_qos (ACE_QoS &ace_qos,
+ ACE_Flow_Spec *ace_flow_spec)
+{
+ ace_qos.receiving_flowspec (ace_flow_spec);
+ ace_qos.sending_flowspec ((this->default_traffic_));
+ ace_qos.provider_specific (Fill_ACE_QoS::iov_);
+
+ return 0;
+}
+
+
+int
+Fill_ACE_QoS::fill_simplex_sender_qos (ACE_QoS &ace_qos,
+ ACE_Flow_Spec *sender_flow_spec)
+{
+ ace_qos.receiving_flowspec ((this->default_traffic_));
+ ace_qos.sending_flowspec (sender_flow_spec);
+ ace_qos.provider_specific (Fill_ACE_QoS::iov_);
+
+ return 0;
+}
+
+int
+Fill_ACE_QoS::fill_duplex_qos (ACE_QoS &ace_qos,
+ ACE_Flow_Spec *recv_flow_spec,
+ ACE_Flow_Spec *sender_flow_spec)
+{
+ ace_qos.receiving_flowspec (recv_flow_spec);
+ ace_qos.sending_flowspec (sender_flow_spec);
+ ace_qos.provider_specific (Fill_ACE_QoS::iov_);
+
+ return 0;
+}
+
+Fill_ACE_QoS::FLOW_SPEC_HASH_MAP&
+Fill_ACE_QoS::map (void)
+{
+ return this->flow_spec_map_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_RAPI || ACE_HAS_WINSOCK2_GQOS */
diff --git a/TAO/orbsvcs/orbsvcs/AV/Fill_ACE_QoS.h b/TAO/orbsvcs/orbsvcs/AV/Fill_ACE_QoS.h
new file mode 100644
index 00000000000..ede10e0e1ec
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Fill_ACE_QoS.h
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Fill_ACE_QoS.h
+ *
+ * $Id$
+ *
+ * @author Vishal Kachroo <vishal@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef FILL_ACE_QOS_H
+#define FILL_ACE_QOS_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_HAS_RAPI) || defined (ACE_HAS_WINSOCK2_GQOS)
+
+#include "tao/Versioned_Namespace.h"
+
+#include "ace/SString.h"
+#include "ace/Hash_Map_Manager_T.h"
+#include "ace/Synch.h"
+#include "ace/ACE.h"
+#include "ace/OS_QoS.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class Fill_ACE_QoS
+ *
+ * This class helps users to add new flow specs and provides
+ * utility functions for filling up the flow specs for simplex/duplex
+ * sessions.
+ */
+class Fill_ACE_QoS
+{
+
+public:
+ typedef ACE_Hash_Map_Manager <ACE_CString, ACE_Flow_Spec *, ACE_Null_Mutex> FLOW_SPEC_HASH_MAP;
+
+ //Initialization and termination methods.
+ /// constructor.
+ Fill_ACE_QoS (void);
+
+ /// destructor.
+ ~Fill_ACE_QoS (void);
+
+ /// To be used by receivers. Fills the receiver qos and sets the
+ /// sender qos to NO_TRAFFIC.
+ int fill_simplex_receiver_qos (ACE_QoS &ace_qos,
+ ACE_Flow_Spec *recv_flow_spec);
+
+ /// To be used by senders. Fills the sender qos and sets the receiver
+ /// qos to NO_TRAFFIC.
+ int fill_simplex_sender_qos (ACE_QoS &ace_qos,
+ ACE_Flow_Spec *recv_flow_spec);
+
+ /// To be used by applications that wish to be both receivers and
+ /// senders.
+ int fill_duplex_qos (ACE_QoS &ace_qos,
+ ACE_Flow_Spec *recv_flow_spec,
+ ACE_Flow_Spec *sender_flow_spec);
+
+ /// Returns the hash map of flowspecs indexed by flowspec name.
+ FLOW_SPEC_HASH_MAP& map (void);
+
+private:
+
+ // The Service Provider is currently set to NULL for all ACE_QoS.
+ static const iovec iov_;
+
+ // A NO_TRAFFIC flow spec. Senders set the receiving qos to this
+ // while the receivers set the sending qos to this.
+ ACE_Flow_Spec *default_traffic_;
+
+ // A list of flowspecs indexed by the flowspec name.
+ FLOW_SPEC_HASH_MAP flow_spec_map_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_RAPI || ACE_HAS_WINSOCK2_GQOS */
+#endif /* FILL_ACE_QOS_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/FlowSpec_Entry.cpp b/TAO/orbsvcs/orbsvcs/AV/FlowSpec_Entry.cpp
new file mode 100644
index 00000000000..76476dafb8b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/FlowSpec_Entry.cpp
@@ -0,0 +1,1018 @@
+// $Id$
+
+//------------------------------------------------------------
+// TAO_FlowSpec_Entry
+//------------------------------------------------------------
+
+#include "orbsvcs/AV/FlowSpec_Entry.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+#include "tao/debug.h"
+
+#include "ace/OS_NS_strings.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/AV/FlowSpec_Entry.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// constructor.
+TAO_FlowSpec_Entry::TAO_FlowSpec_Entry (void)
+ :address_ (0),
+ clean_up_address_ (0),
+ control_address_ (0),
+ clean_up_control_address_ (0),
+ address_str_ (),
+ format_ (),
+ direction_ (TAO_AV_INVALID),
+ direction_str_ (),
+ flowname_ (),
+ protocol_ (TAO_AV_Core::TAO_AV_NOPROTOCOL),
+ carrier_protocol_ (),
+ flow_protocol_ (),
+ use_flow_protocol_ (0),
+ entry_ (),
+ is_multicast_ (0),
+ delete_peer_addr_ (false),
+ peer_addr_ (0),
+ local_sec_addr_ (0),
+ num_local_sec_addrs_ (0),
+ peer_sec_addr_ (0),
+ num_peer_sec_addrs_ (0),
+ peer_control_addr_ (0),
+ local_addr_ (0),
+ local_control_addr_ (0),
+ transport_ (0),
+ control_transport_ (0),
+ handler_ (0),
+ control_handler_ (0),
+ protocol_object_ (0),
+ control_protocol_object_ (0),
+ role_ (TAO_AV_INVALID_ROLE)
+{
+}
+
+// constructor.
+TAO_FlowSpec_Entry::TAO_FlowSpec_Entry (const char *flowname,
+ const char *direction,
+ const char *format_name,
+ const char *flow_protocol,
+ const char *carrier_protocol,
+ ACE_Addr *fwd_address,
+ //ACE_Addr *peer_address,
+ ACE_Addr *control_address)
+ :address_ (fwd_address),
+ clean_up_address_ (0),
+ control_address_ (control_address),
+ clean_up_control_address_ (0),
+ address_str_ (),
+ format_ (format_name),
+ direction_str_ (direction ),
+ flowname_ ( flowname ),
+ carrier_protocol_ ( carrier_protocol ),
+ flow_protocol_ ( flow_protocol ),
+ use_flow_protocol_ (0),
+ entry_ (),
+ is_multicast_ (0),
+ delete_peer_addr_ (false),
+ peer_addr_ (0),
+ local_sec_addr_ (0),
+ num_local_sec_addrs_ (0),
+ peer_sec_addr_ (0),
+ num_peer_sec_addrs_ (0),
+ peer_control_addr_ (0),
+ local_addr_ (0),
+ local_control_addr_ (0),
+ transport_ (0),
+ control_transport_ (0),
+ handler_ (0),
+ control_handler_ (0),
+ protocol_object_ (0),
+ control_protocol_object_ (0),
+ role_ (TAO_AV_INVALID_ROLE)
+{
+ this->set_protocol ();
+ this->set_direction (this->direction_str_.c_str());
+ this->parse_flow_protocol_string (this->flow_protocol_.c_str() );
+}
+
+TAO_FlowSpec_Entry::TAO_FlowSpec_Entry (const char *flowname,
+ const char *direction,
+ const char *format_name,
+ const char *flow_protocol,
+ const char *address)
+ //const char *peer_address)
+ :address_ (0),
+ clean_up_address_ (0),
+ control_address_ (0),
+ clean_up_control_address_ (0),
+ address_str_ ( address ),
+ format_ ( format_name ),
+ direction_str_ ( direction ),
+ flowname_ ( flowname ),
+ carrier_protocol_ (),
+ flow_protocol_ ( flow_protocol ),
+ use_flow_protocol_ (0),
+ entry_ (),
+ is_multicast_ (0),
+ peer_addr_ (0),
+ local_sec_addr_ (0),
+ num_local_sec_addrs_ (0),
+ peer_sec_addr_ (0),
+ num_peer_sec_addrs_ (0),
+ peer_control_addr_ (0),
+ local_addr_ (0),
+ local_control_addr_ (0),
+ transport_ (0),
+ control_transport_ (0),
+ handler_ (0),
+ control_handler_ (0),
+ protocol_object_ (0),
+ control_protocol_object_ (0),
+ role_ (TAO_AV_INVALID_ROLE)
+{
+ this->parse_flow_protocol_string (this->flow_protocol_.c_str() );
+ this->parse_address (this->address_str_.c_str(), TAO_AV_Core::TAO_AV_DATA);
+ this->set_direction (this->direction_str_.c_str());
+}
+
+// Destructor.
+TAO_FlowSpec_Entry::~TAO_FlowSpec_Entry (void)
+{
+ if (this->delete_peer_addr_)
+ delete this->peer_addr_;
+
+ if (this->clean_up_address_)
+ delete address_;
+ if (this->clean_up_control_address_)
+ delete control_address_;
+ if (local_control_addr_ != 0)
+ delete local_control_addr_;
+}
+
+int
+TAO_FlowSpec_Entry::set_protocol (void)
+{
+ if (!this->use_flow_protocol_)
+ {
+ if (ACE_OS::strcasecmp (this->carrier_protocol_.c_str(),"TCP") == 0)
+ this->protocol_ = TAO_AV_Core::TAO_AV_TCP;
+ else if (ACE_OS::strcasecmp (this->carrier_protocol_.c_str(),"SCTP_SEQ") == 0)
+ this->protocol_ = TAO_AV_Core::TAO_AV_SCTP_SEQ;
+ else if (ACE_OS::strcasecmp (this->carrier_protocol_.c_str(),"UDP") == 0)
+ this->protocol_ = TAO_AV_Core::TAO_AV_UDP;
+ else if (ACE_OS::strcasecmp (this->carrier_protocol_.c_str(),"QoS_UDP") == 0)
+ this->protocol_ = TAO_AV_Core::TAO_AV_QOS_UDP;
+ else if (ACE_OS::strcasecmp (this->carrier_protocol_.c_str(),"AAL5") == 0)
+ this->protocol_ = TAO_AV_Core::TAO_AV_AAL5;
+ else if (ACE_OS::strcasecmp (this->carrier_protocol_.c_str(),"AAL3_4") == 0)
+ this->protocol_ = TAO_AV_Core::TAO_AV_AAL3_4;
+ else if (ACE_OS::strcasecmp (this->carrier_protocol_.c_str(),"AAL1") == 0)
+ this->protocol_ = TAO_AV_Core::TAO_AV_AAL1;
+ else if (ACE_OS::strcasecmp (this->carrier_protocol_.c_str(),"RTP/UDP") == 0){
+ this->protocol_ = TAO_AV_Core::TAO_AV_UDP;
+ flow_protocol_ = "RTP";
+ }
+ else if (ACE_OS::strcasecmp (this->carrier_protocol_.c_str(),"RTP/AAL5") == 0)
+ this->protocol_ = TAO_AV_Core::TAO_AV_RTP_AAL5;
+ else if (ACE_OS::strcasecmp (this->carrier_protocol_.c_str(),"IPX") == 0)
+ this->protocol_ = TAO_AV_Core::TAO_AV_IPX;
+ else
+ {
+ this->protocol_ = TAO_AV_Core::TAO_AV_NOPROTOCOL;
+ return -1;
+ }
+ }
+ else
+ {
+ if (ACE_OS::strcasecmp (this->carrier_protocol_.c_str(),"UDP") == 0)
+ {
+ if (ACE_OS::strncasecmp (this->flow_protocol_.c_str (),"sfp",3) == 0)
+ {
+ this->protocol_ = TAO_AV_Core::TAO_AV_SFP_UDP;
+ }
+ else this->protocol_ = TAO_AV_Core::TAO_AV_USERDEFINED_UDP;
+ }
+ else
+ {
+ this->protocol_ = TAO_AV_Core::TAO_AV_NOPROTOCOL;
+ return -1;
+ }
+ }
+
+ if (this->address_ != 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "TAO_FlowSpec_Entry::set_protocol address is not 0\n"));
+ ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (this->address_);
+ char buf[BUFSIZ];
+ inet_addr->addr_to_string (buf,BUFSIZ);
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"TAO_FlowSpec_Entry::set_protocol:%s %x\n",buf, inet_addr->get_ip_address ()));
+ if (IN_CLASSD (inet_addr->get_ip_address ()))
+ {
+ this->is_multicast_ = 1;
+ switch (this->protocol_)
+ {
+ case TAO_AV_Core::TAO_AV_UDP:
+ this->protocol_ = TAO_AV_Core::TAO_AV_UDP_MCAST;
+ break;
+ case TAO_AV_Core::TAO_AV_RTP_UDP:
+ this->protocol_ = TAO_AV_Core::TAO_AV_RTP_UDP_MCAST;
+ break;
+ case TAO_AV_Core::TAO_AV_SFP_UDP:
+ this->protocol_ = TAO_AV_Core::TAO_AV_SFP_UDP_MCAST;
+ break;
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP:
+ this->protocol_ = TAO_AV_Core::TAO_AV_USERDEFINED_UDP_MCAST;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ return 0;
+}
+
+int
+TAO_FlowSpec_Entry::parse_address (const char *address,
+ TAO_AV_Core::Flow_Component flow_comp)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "TAO_FlowSpec_Entry::parse_address [%s]\n", address));
+
+ if (address == 0)
+ return 0;
+ if (ACE_OS::strcmp (address,"") == 0)
+ return 0;
+ TAO_Tokenizer protocol_tokenizer (address,'=');
+
+ this->carrier_protocol_ = protocol_tokenizer[0];
+
+ int result = this->set_protocol ();
+ if (result < 0)
+ return result;
+
+ if (protocol_tokenizer [1] != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Protocol tokenixer is not null\n"));
+ if ((flow_comp == TAO_AV_Core::TAO_AV_DATA) ||
+ //(flow_comp == TAO_AV_Core::TAO_AV_BOTH) ||
+ (flow_comp == TAO_AV_Core::TAO_AV_CONTROL) )
+ {
+ ACE_CString addr;
+ if (this->protocol_ == TAO_AV_Core::TAO_AV_SCTP_SEQ)
+ {
+ TAO_Tokenizer addr_token (protocol_tokenizer [1], ';');
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Number of local sec addresses = %d\n",
+ addr_token.num_tokens () - 1));
+
+ if (addr_token.num_tokens () != 0)
+ {
+ addr += addr_token [0];
+ ACE_NEW_RETURN (local_sec_addr_, char* [addr_token.num_tokens () - 1],-1);
+ for (int j = 1; j <= addr_token.num_tokens () - 1; j++)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "adding addresses to sequence %s\n",
+ addr_token [j]));
+
+ local_sec_addr_ [j-1] = CORBA::string_dup (addr_token [j]);
+ }
+ num_local_sec_addrs_ = addr_token.num_tokens () - 1;
+ }
+ }
+ else addr += protocol_tokenizer[1];
+
+
+ switch (this->protocol_)
+ {
+ case TAO_AV_Core::TAO_AV_SFP_UDP:
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP:
+ case TAO_AV_Core::TAO_AV_RTP_UDP:
+ case TAO_AV_Core::TAO_AV_TCP:
+ case TAO_AV_Core::TAO_AV_SCTP_SEQ:
+ case TAO_AV_Core::TAO_AV_UDP:
+ case TAO_AV_Core::TAO_AV_QOS_UDP:
+ {
+ if (flow_comp == TAO_AV_Core::TAO_AV_DATA)
+ this->address_str_ = addr;
+ ACE_INET_Addr *inet_addr;
+ ACE_NEW_RETURN (inet_addr,
+ ACE_INET_Addr (addr.c_str() ),
+ -1);
+ if (flow_comp == TAO_AV_Core::TAO_AV_DATA)
+ {
+ this->clean_up_address_ = 1;
+ this->address_ = inet_addr;
+ }
+ else
+ {
+ this->clean_up_control_address_ = 1;
+ this->control_address_ = inet_addr;
+ }
+
+ if (IN_CLASSD (inet_addr->get_ip_address ()))
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "TAO_FlowSpec_Entry::parse_address is multicast\n"));
+
+ this->is_multicast_ = 1;
+ switch (this->protocol_)
+ {
+ case TAO_AV_Core::TAO_AV_UDP:
+ this->protocol_ = TAO_AV_Core::TAO_AV_UDP_MCAST;
+ break;
+ case TAO_AV_Core::TAO_AV_RTP_UDP:
+ this->protocol_ = TAO_AV_Core::TAO_AV_RTP_UDP_MCAST;
+ break;
+ case TAO_AV_Core::TAO_AV_SFP_UDP:
+ this->protocol_ = TAO_AV_Core::TAO_AV_SFP_UDP_MCAST;
+ break;
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP:
+ this->protocol_ = TAO_AV_Core::TAO_AV_USERDEFINED_UDP_MCAST;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ break;
+ default:
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"ATM support not added yet\n"));
+ }
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "AV BOTH %s \n",
+ protocol_tokenizer[1]));
+
+ TAO_Tokenizer address_tokenizer (protocol_tokenizer[1], ':');
+ TAO_Tokenizer port_tokenizer (address_tokenizer[1], ';');
+ ACE_CString addr;
+ addr += address_tokenizer[0];
+ addr += ":";
+ addr += port_tokenizer[0];
+
+ if (this->protocol_ == TAO_AV_Core::TAO_AV_SCTP_SEQ)
+ {
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Number of local sec addresses = %d\n",
+ port_tokenizer.num_tokens () - 1));
+
+ if (port_tokenizer.num_tokens () - 1 != 0)
+ {
+ ACE_NEW_RETURN (local_sec_addr_, char* [port_tokenizer.num_tokens () - 1],-1);
+ for (int j = 1; j <= port_tokenizer.num_tokens () - 1; j++)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "adding addresses to sequence %s\n",
+ port_tokenizer [j]));
+
+ local_sec_addr_ [j-1] = CORBA::string_dup (port_tokenizer [j]);
+ }
+ num_local_sec_addrs_ = port_tokenizer.num_tokens () - 1;
+ }
+ }
+
+ short control_port = static_cast<short> (ACE_OS::atoi(port_tokenizer[0])) + 1;
+ char control_port_str[6];
+ sprintf (control_port_str, "%d", control_port);
+
+ ACE_CString control_addr = "";
+ if (ACE_OS::strcasecmp (this->carrier_protocol_.c_str(),"RTP/UDP") == 0)
+ {
+ control_addr += address_tokenizer[0];
+ control_addr += ":";
+ if (port_tokenizer[1] != 0)
+ control_addr += port_tokenizer[1];
+ else
+ control_addr += control_port_str;
+ }
+
+ switch (this->protocol_)
+ {
+ case TAO_AV_Core::TAO_AV_SFP_UDP:
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP:
+ case TAO_AV_Core::TAO_AV_RTP_UDP:
+ case TAO_AV_Core::TAO_AV_TCP:
+ case TAO_AV_Core::TAO_AV_SCTP_SEQ:
+ case TAO_AV_Core::TAO_AV_UDP:
+ case TAO_AV_Core::TAO_AV_QOS_UDP:
+ {
+ this->address_str_ = addr;
+ ACE_INET_Addr *inet_addr;
+ ACE_NEW_RETURN (inet_addr,
+ ACE_INET_Addr (addr.c_str() ),
+ -1);
+ this->clean_up_address_ = 1;
+ this->address_ = inet_addr;
+
+ if (ACE_OS::strcasecmp (this->carrier_protocol_.c_str(),"RTP/UDP") == 0)
+ {
+ ACE_INET_Addr *control_inet_addr;
+ ACE_NEW_RETURN (control_inet_addr,
+ ACE_INET_Addr (control_addr.c_str() ),
+ -1);
+ this->clean_up_control_address_ = 1;
+ this->control_address_ = control_inet_addr;
+ }
+
+ if (IN_CLASSD (inet_addr->get_ip_address ()))
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "TAO_FlowSpec_Entry::parse_address is multicast\n"));
+
+ this->is_multicast_ = 1;
+ switch (this->protocol_)
+ {
+ case TAO_AV_Core::TAO_AV_UDP:
+ this->protocol_ = TAO_AV_Core::TAO_AV_UDP_MCAST;
+ break;
+ case TAO_AV_Core::TAO_AV_RTP_UDP:
+ this->protocol_ = TAO_AV_Core::TAO_AV_RTP_UDP_MCAST;
+ break;
+ case TAO_AV_Core::TAO_AV_SFP_UDP:
+ this->protocol_ = TAO_AV_Core::TAO_AV_SFP_UDP_MCAST;
+ break;
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP:
+ this->protocol_ = TAO_AV_Core::TAO_AV_USERDEFINED_UDP_MCAST;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ break;
+ default:
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"ATM support not added yet\n"));
+ }
+ }
+ }
+ ACE_DEBUG ((LM_DEBUG,
+ "Return from parse address\n"));
+ return 0;
+}
+
+char *
+TAO_FlowSpec_Entry::get_local_addr_str (void)
+{
+ if (this->local_addr_ == 0)
+ return 0;
+
+ switch (this->local_addr_->get_type ())
+ {
+ case AF_INET:
+ {
+ char *buf;
+ ACE_NEW_RETURN (buf,
+ char [BUFSIZ],
+ 0);
+
+ ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr *> (this->local_addr_);
+ inet_addr->addr_to_string (buf,BUFSIZ);
+ ACE_CString cstring (buf, 0, 0);
+
+ return cstring.rep ();
+ }
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,"Address family not supported"),0);
+ }
+}
+
+//------------------------------------------------------------
+// TAO_Forward_FlowSpec_Entry
+//------------------------------------------------------------
+
+// default constructor.
+TAO_Forward_FlowSpec_Entry::TAO_Forward_FlowSpec_Entry (void)
+{
+ // no-op.
+}
+
+// constructor to construct the entry from the arguments.
+TAO_Forward_FlowSpec_Entry::TAO_Forward_FlowSpec_Entry (const char *flowname,
+ const char *direction,
+ const char *format_name ,
+ const char *flow_protocol ,
+ const char *carrier_protocol ,
+ ACE_Addr *address,
+ ACE_Addr *control_address )
+ :TAO_FlowSpec_Entry (flowname,
+ direction,
+ format_name,
+ flow_protocol,
+ carrier_protocol,
+ address,
+ control_address)
+{
+ // no-op.
+}
+
+// constructor to construct the entry from the arguments.
+TAO_Forward_FlowSpec_Entry::TAO_Forward_FlowSpec_Entry (const char *flowname,
+ const char *direction,
+ const char *format_name ,
+ const char *flow_protocol ,
+ const char *address )
+ :TAO_FlowSpec_Entry (flowname,
+ direction,
+ format_name,
+ flow_protocol,
+ address)
+{
+ // no-op.
+}
+
+TAO_Forward_FlowSpec_Entry::~TAO_Forward_FlowSpec_Entry (void)
+{
+ // no-op.
+}
+
+int
+TAO_Forward_FlowSpec_Entry::parse (const char *flowSpec_entry)
+{
+ TAO_Tokenizer tokenizer (flowSpec_entry,'\\');
+
+ this->flowname_ = tokenizer [TAO_AV_FLOWNAME];
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_Forward_FlowSpec_Entry::parse [%s]\n",
+ flowSpec_entry));
+
+ if (tokenizer [TAO_AV_DIRECTION] != 0)
+ this->set_direction (tokenizer [TAO_AV_DIRECTION]);
+
+ if (tokenizer [TAO_AV_FORMAT] != 0)
+ this->format_ = tokenizer [TAO_AV_FORMAT];
+
+ if (tokenizer [TAO_AV_ADDRESS] != 0)
+ if (this->parse_address (tokenizer [TAO_AV_ADDRESS], TAO_AV_Core::TAO_AV_BOTH) < 0)
+ return -1;
+
+ if (tokenizer [TAO_AV_PEER_ADDR] != 0)
+ {
+ ACE_INET_Addr *addr = 0;
+
+
+ if (this->protocol_ == TAO_AV_Core::TAO_AV_SCTP_SEQ)
+ {
+ TAO_Tokenizer addr_token (tokenizer [TAO_AV_PEER_ADDR], ';');
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Number of peer sec addresses = %d\n",
+ addr_token.num_tokens () - 1));
+
+ if (addr_token.num_tokens () != 0)
+ {
+ ACE_NEW_RETURN (addr,
+ ACE_INET_Addr (addr_token [0]),
+ 0);
+
+ ACE_NEW_RETURN (peer_sec_addr_, char* [addr_token.num_tokens () - 1],-1);
+ for (int j = 1; j <= addr_token.num_tokens () - 1; j++)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "adding addresses to sequence %s\n",
+ addr_token [j]));
+
+ peer_sec_addr_ [j-1] = CORBA::string_dup (addr_token [j]);
+ }
+ num_peer_sec_addrs_ = addr_token.num_tokens () - 1;
+ }
+ }
+ else
+ {
+ ACE_NEW_RETURN (addr,
+ ACE_INET_Addr (tokenizer [TAO_AV_PEER_ADDR]),
+ 0);
+ }
+ this->delete_peer_addr_ = true;
+ this->peer_addr_ = addr;
+
+ char buf [BUFSIZ];
+ addr->addr_to_string (buf, BUFSIZ);
+ ACE_DEBUG ((LM_DEBUG,
+ "Peer Address %s \n",
+ buf));
+
+ }
+
+ if (tokenizer [TAO_AV_FLOW_PROTOCOL] != 0)
+ if (this->parse_flow_protocol_string (tokenizer [TAO_AV_FLOW_PROTOCOL]) < 0)
+ return -1;
+
+ return 0;
+}
+
+TAO_FlowSpec_Entry::Role
+TAO_Forward_FlowSpec_Entry::role (void)
+{
+ if (this->role_ != TAO_AV_INVALID_ROLE)
+ return this->role_;
+
+ switch (this->direction_)
+ {
+ case TAO_AV_DIR_IN:
+ // Forward IN means we're the Source.
+ return TAO_AV_PRODUCER;
+ case TAO_AV_DIR_OUT:
+ // Forward out means we're the sink.
+ return TAO_AV_CONSUMER;
+ default:
+ return TAO_AV_INVALID_ROLE;
+ }
+}
+
+const char *
+TAO_Forward_FlowSpec_Entry::entry_to_string (void)
+{
+ if (this->flowname_.length() == 0)
+ return "";
+
+ char address [BUFSIZ];
+ ACE_CString address_str;
+ ACE_CString peer_address_str;
+
+ if (this->address_ != 0)
+ {
+ switch (this->protocol_)
+ {
+ case TAO_AV_Core::TAO_AV_SFP_UDP:
+ case TAO_AV_Core::TAO_AV_SFP_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP:
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_RTP_UDP:
+ case TAO_AV_Core::TAO_AV_RTP_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_UDP:
+ case TAO_AV_Core::TAO_AV_QOS_UDP:
+ case TAO_AV_Core::TAO_AV_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_TCP:
+ case TAO_AV_Core::TAO_AV_SCTP_SEQ:
+ {
+ ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (this->address_);
+ inet_addr->addr_to_string (address,BUFSIZ);
+ }
+ break;
+ default:
+ break;
+ }
+ ACE_CString cstring (address);
+
+ address_str = this->carrier_protocol_;
+ address_str += "=";
+ address_str += cstring;
+
+ if (this->protocol_ == TAO_AV_Core::TAO_AV_SCTP_SEQ)
+ {
+ for (int i = 0; i < this->num_local_sec_addrs_; i++)
+ {
+ address_str += ";";
+ address_str += this->local_sec_addr_ [i];
+ }
+ }
+
+ }
+ else
+ {
+ address_str = this->carrier_protocol_;
+ }
+
+
+ if ( (this->address_ != 0) &&
+ (this->control_address_ == 0) &&
+ (ACE_OS::strncasecmp (this->flow_protocol_.c_str(), "RTP", 3) == 0))
+ {
+ u_short control_port;
+
+ switch (this->protocol_)
+ {
+ case TAO_AV_Core::TAO_AV_SFP_UDP:
+ case TAO_AV_Core::TAO_AV_SFP_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP:
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_RTP_UDP:
+ case TAO_AV_Core::TAO_AV_RTP_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_UDP:
+ case TAO_AV_Core::TAO_AV_QOS_UDP:
+ case TAO_AV_Core::TAO_AV_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_TCP:
+ case TAO_AV_Core::TAO_AV_SCTP_SEQ:
+ {
+ ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (this->address_);
+ control_port = inet_addr->get_port_number() + 1;
+ ACE_INET_Addr *inet_control_addr;
+ ACE_NEW_RETURN (inet_control_addr,
+ ACE_INET_Addr (control_port, inet_addr->get_host_addr ()),
+ "");
+ this->control_address_ = inet_control_addr;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+
+ if (this->peer_addr_ != 0)
+ {
+ switch (this->protocol_)
+ {
+ case TAO_AV_Core::TAO_AV_SFP_UDP:
+ case TAO_AV_Core::TAO_AV_SFP_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP:
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_RTP_UDP:
+ case TAO_AV_Core::TAO_AV_RTP_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_UDP:
+ case TAO_AV_Core::TAO_AV_QOS_UDP:
+ case TAO_AV_Core::TAO_AV_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_TCP:
+ case TAO_AV_Core::TAO_AV_SCTP_SEQ:
+ {
+ ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (this->peer_addr_);
+ inet_addr->addr_to_string (address,BUFSIZ);
+ //inet_addr->get_host_name (address, BUFSIZ);
+
+ //cstring += ACE_OS::itoa (address, BUFSIZ, inet_addr->get_port_number ());
+
+ }
+ break;
+ default:
+ break;
+ }
+
+ ACE_CString cstring (address);
+
+ //peer_address_str = this->carrier_protocol_;
+ //peer_address_str += "=";
+ peer_address_str += cstring;
+
+ if (this->protocol_ == TAO_AV_Core::TAO_AV_SCTP_SEQ)
+ {
+ for (int i = 0; i < this->num_peer_sec_addrs_; i++)
+ {
+ peer_address_str += ";";
+ peer_address_str += this->peer_sec_addr_ [i];
+ }
+ }
+
+ }
+
+ if (this->control_address_ != 0)
+ {
+ u_short control_port = 0;
+
+ switch (this->protocol_)
+ {
+ case TAO_AV_Core::TAO_AV_SFP_UDP:
+ case TAO_AV_Core::TAO_AV_SFP_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP:
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_RTP_UDP:
+ case TAO_AV_Core::TAO_AV_RTP_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_UDP:
+ case TAO_AV_Core::TAO_AV_QOS_UDP:
+ case TAO_AV_Core::TAO_AV_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_TCP:
+ case TAO_AV_Core::TAO_AV_SCTP_SEQ:
+ {
+ ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (this->control_address_);
+ control_port = inet_addr->get_port_number();
+ }
+ break;
+ default:
+ break;
+ }
+
+ address_str += ";";
+ char port_str[10];
+ sprintf(port_str, "%u", control_port);
+ address_str += port_str;
+ }
+
+ this->entry_ = this->flowname_;
+ this->entry_ += "\\";
+ this->entry_ += this->direction_str_;
+ this->entry_ += "\\";
+ this->entry_ += this->format_;
+ this->entry_ += "\\";
+ this->entry_ += this->flow_protocol_;
+ this->entry_ += "\\";
+ this->entry_ += address_str;
+
+ if (this->peer_addr_ != 0)
+ {
+ this->entry_ += "\\";
+ this->entry_ += peer_address_str;
+ }
+ else ACE_DEBUG ((LM_DEBUG,
+ "No peer address specified\n"));
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"Forward entry_to_string: entry = %s\n",this->entry_.c_str()));
+
+ return this->entry_.c_str();
+}
+
+//------------------------------------------------------------
+// TAO_Reverse_FlowSpec_Entry
+//------------------------------------------------------------
+
+//default constructor.
+TAO_Reverse_FlowSpec_Entry::TAO_Reverse_FlowSpec_Entry (void)
+{
+ // no-op
+}
+
+// constructor to construct an entry from the arguments.
+TAO_Reverse_FlowSpec_Entry::TAO_Reverse_FlowSpec_Entry (const char *flowname,
+ const char *direction,
+ const char *format_name ,
+ const char *flow_protocol ,
+ const char *carrier_protocol,
+ ACE_Addr *address,
+ ACE_Addr *control_address )
+ :TAO_FlowSpec_Entry (flowname,
+ direction,
+ format_name,
+ flow_protocol,
+ carrier_protocol,
+ address,
+ control_address)
+{
+ // no-op
+}
+
+// constructor to construct an entry from the arguments.
+TAO_Reverse_FlowSpec_Entry::TAO_Reverse_FlowSpec_Entry (const char *flowname,
+ const char *direction,
+ const char *format_name ,
+ const char *flow_protocol ,
+ const char *address)
+ :TAO_FlowSpec_Entry (flowname,
+ direction,
+ format_name,
+ flow_protocol,
+ address)
+{
+ // no-op.
+}
+
+TAO_Reverse_FlowSpec_Entry::~TAO_Reverse_FlowSpec_Entry (void)
+{
+ // no-op.
+}
+
+TAO_FlowSpec_Entry::Role
+TAO_Reverse_FlowSpec_Entry::role (void)
+{
+ if (this->role_ != TAO_AV_INVALID_ROLE)
+ return this->role_;
+ switch (this->direction_)
+ {
+ case TAO_AV_DIR_IN:
+ // Forward IN means we're the Source.
+ return TAO_AV_CONSUMER;
+ case TAO_AV_DIR_OUT:
+ // Forward out means we're the sink.
+ return TAO_AV_PRODUCER;
+ default:
+ return TAO_AV_INVALID_ROLE;
+ }
+}
+
+int
+TAO_Reverse_FlowSpec_Entry::parse (const char *flowSpec_entry)
+{
+ TAO_Tokenizer tokenizer (flowSpec_entry,'\\');
+ this->flowname_ = tokenizer [TAO_AV_FLOWNAME];
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_Reverse_FlowSpec_Entry::parse [%s]\n",
+ flowSpec_entry));
+
+ if (tokenizer [TAO_AV_ADDRESS] != 0)
+ if (this->parse_address (tokenizer [TAO_AV_ADDRESS], TAO_AV_Core::TAO_AV_BOTH) < 0)
+ return -1;
+
+ if (tokenizer [TAO_AV_FLOW_PROTOCOL] != 0)
+ if (this->parse_flow_protocol_string (tokenizer [TAO_AV_FLOW_PROTOCOL]) < 0)
+ return -1;
+
+// if (tokenizer [TAO_AV_DIRECTION] != 0)
+// this->set_direction (tokenizer [TAO_AV_DIRECTION]);
+
+// if (tokenizer [TAO_AV_FORMAT] != 0)
+// this->format_ = tokenizer [TAO_AV_FORMAT];
+
+ return 0;
+}
+
+
+const char *
+TAO_Reverse_FlowSpec_Entry::entry_to_string (void)
+{
+ if (this->flowname_.length() == 0)
+ return "";
+
+ char address [BUFSIZ];
+ ACE_CString address_str;
+ if (this->address_ != 0)
+ {
+ switch (this->protocol_)
+ {
+ case TAO_AV_Core::TAO_AV_RTP_UDP:
+ case TAO_AV_Core::TAO_AV_UDP:
+ case TAO_AV_Core::TAO_AV_QOS_UDP:
+ case TAO_AV_Core::TAO_AV_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_TCP:
+ case TAO_AV_Core::TAO_AV_SCTP_SEQ:
+ case TAO_AV_Core::TAO_AV_SFP_UDP:
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP:
+ {
+ ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (this->address_);
+ inet_addr->addr_to_string (address,BUFSIZ);
+ }
+ break;
+ default:
+ break;
+ }
+ ACE_CString cstring (address);
+
+ address_str = this->carrier_protocol_;
+ address_str += "=";
+ address_str += cstring;
+
+ if (this->protocol_ == TAO_AV_Core::TAO_AV_SCTP_SEQ)
+ {
+ for (int i = 0; i < this->num_local_sec_addrs_; i++)
+ {
+ address_str += ";";
+ address_str += this->local_sec_addr_ [i];
+ }
+ }
+
+ }
+ else
+ {
+ address_str = "";
+ }
+
+ if (this->control_address_ != 0)
+ {
+ u_short control_port = 0;
+
+
+ switch (this->protocol_)
+ {
+ case TAO_AV_Core::TAO_AV_SFP_UDP:
+ case TAO_AV_Core::TAO_AV_SFP_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP:
+ case TAO_AV_Core::TAO_AV_USERDEFINED_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_RTP_UDP:
+ case TAO_AV_Core::TAO_AV_RTP_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_UDP:
+ case TAO_AV_Core::TAO_AV_QOS_UDP:
+ case TAO_AV_Core::TAO_AV_UDP_MCAST:
+ case TAO_AV_Core::TAO_AV_TCP:
+ case TAO_AV_Core::TAO_AV_SCTP_SEQ:
+ {
+ ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (this->control_address_);
+ control_port = inet_addr->get_port_number();
+ }
+ break;
+ default:
+ break;
+ }
+
+ address_str += ";";
+ char port_str[10];
+ sprintf(port_str, "%u", control_port);
+ address_str += port_str;
+
+ }
+
+ this->entry_ = this->flowname_;
+ this->entry_ += "\\";
+ this->entry_ += address_str;
+ this->entry_ += "\\";
+ this->entry_ += this->flow_protocol_;
+// this->entry_ += "\\";
+// this->entry_ += this->direction_str_;
+// this->entry_ += "\\";
+// this->entry_ += format_;
+
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"Reverse entry_to_string: entry = %s\n",this->entry_.c_str() ));
+ return this->entry_.c_str();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h b/TAO/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h
new file mode 100644
index 00000000000..58f018bc45e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h
@@ -0,0 +1,359 @@
+// -*- C++ -*-
+
+// ============================================================================
+/**
+ * @file FlowSpec_Entry.h
+ *
+ * $Id$
+ *
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ *
+ */
+// ============================================================================
+
+#ifndef TAO_AV_FLOWSPEC_ENTRY_H
+#define TAO_AV_FLOWSPEC_ENTRY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/AV_export.h"
+#include "orbsvcs/AV/AV_Core.h"
+#include "ace/Addr.h"
+#include "ace/Containers.h"
+#include "ace/SString.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Tokenizer
+ * @brief
+ */
+class TAO_AV_Export TAO_Tokenizer
+{
+public:
+ /// constructor.
+ TAO_Tokenizer (const char *string,char delimiter);
+
+ /// destructor.
+ ~TAO_Tokenizer (void);
+
+ /// parses the string and tokenizes it.
+ int parse (const char *string,char delimiter);
+
+ /// Returns the next token.
+ char *token (void);
+
+ /// Number of tokens.
+ int num_tokens (void);
+
+ const char *operator [] (size_t index) const;
+
+protected:
+ ACE_Array<char*> token_array_;
+ size_t count_;
+ size_t num_tokens_;
+ char string_ [BUFSIZ];
+};
+
+// Forward declaration.
+class TAO_AV_Transport;
+class TAO_AV_Flow_Handler;
+class TAO_AV_Protocol_Object;
+
+/**
+ * @class TAO_FlowSpec_Entry
+ * @brief A helper entry class in the flow spec sequence passed to
+ * bind_devs.
+ */
+class TAO_AV_Export TAO_FlowSpec_Entry
+{
+public:
+
+ enum Direction
+ {
+ TAO_AV_INVALID = -1,
+ TAO_AV_DIR_IN = 0,
+ TAO_AV_DIR_OUT = 1
+ };
+
+ enum Role
+ {
+ TAO_AV_INVALID_ROLE = -1,
+ TAO_AV_PRODUCER = 0,
+ TAO_AV_CONSUMER = 1
+ };
+
+ /// default constructor.
+ TAO_FlowSpec_Entry (void);
+
+ /// constructor to construct an entry from the arguments.
+ TAO_FlowSpec_Entry (const char *flowname,
+ const char *direction,
+ const char *format_name,
+ const char *flow_protocol,
+ const char *carrier_protocol,
+ ACE_Addr *fwd_address,
+ //ACE_Addr *peer_address,
+ ACE_Addr *control_address = 0);
+
+ TAO_FlowSpec_Entry (const char *flowname,
+ const char *direction,
+ const char *format_name,
+ const char *flow_protocol,
+ const char *fwd_address);
+ //const char *peer_address);
+
+ /// construct the entry from a string specified by the flowSpec grammar.
+ virtual int parse (const char* flowSpec_entry) = 0;
+
+ /// virtual destructor.
+ virtual ~TAO_FlowSpec_Entry (void);
+
+ /// accessor to the direction.
+ int direction (void);
+
+ virtual Role role (void) = 0;
+ void role (Role role);
+ /// accessor to string version of direction .
+ const char * direction_str (void) const;
+
+ /// accessor to the flow protocol string.
+ const char *flow_protocol_str (void) const;
+
+ /// set the flow protocol string.
+ void flow_protocol_str (const char *flow_protocol_str);
+
+ /// accessor to address of the carrier protocol.
+ //ACE_Addr *fwd_address (void);
+ ACE_Addr *address (void);
+ ACE_Addr *control_address (void);
+ void address (ACE_Addr *address);
+ void control_address (ACE_Addr *address);
+
+ /// Address in string format i. hostname:port.
+ const char *address_str (void) const;
+ // const char * peer_address_str (void) const;
+
+ /// accessor to carrier protocol i.e TCP,UDP,RTP/UDP.
+ TAO_AV_Core::Protocol carrier_protocol (void);
+
+ /// accessor to string version of carrier protocol.
+ const char * carrier_protocol_str (void) const;
+
+ /// accessor to format to be used for this flow.
+ const char *format (void) const;
+
+ /// accessor to name of this flow.
+ const char *flowname (void) const;
+
+ /// converts the entry to a string.
+ virtual const char *entry_to_string (void) = 0;
+
+ int set_peer_addr (ACE_Addr *peer_addr);
+ ACE_Addr *get_peer_addr (void);
+ int set_peer_control_addr (ACE_Addr *peer_control_addr);
+ ACE_Addr *get_peer_control_addr (void);
+
+ int set_local_sec_addr (char** local_sec_addr, int size);
+ char** get_local_sec_addr (void);
+ int num_local_sec_addrs (void);
+
+ int set_peer_sec_addr (char** peer_sec_addr, int size);
+ char** get_peer_sec_addr (void);
+ int num_peer_sec_addrs (void);
+
+ int set_local_addr (ACE_Addr *local_addr);
+ ACE_Addr *get_local_addr (void);
+ char *get_local_addr_str (void);
+ int set_local_control_addr (ACE_Addr *local_control_addr);
+ ACE_Addr *get_local_control_addr (void);
+ char *get_local_control_addr_str (void);
+
+ TAO_AV_Transport *transport (void);
+ void transport (TAO_AV_Transport *transport);
+ TAO_AV_Transport *control_transport (void);
+ void control_transport (TAO_AV_Transport *control_transport);
+
+ TAO_AV_Flow_Handler* handler (void);
+ void handler (TAO_AV_Flow_Handler *handler);
+ TAO_AV_Flow_Handler* control_handler (void);
+ void control_handler (TAO_AV_Flow_Handler *control_handler);
+
+ TAO_AV_Protocol_Object* protocol_object (void);
+ void protocol_object (TAO_AV_Protocol_Object *object);
+ TAO_AV_Protocol_Object* control_protocol_object (void);
+ void control_protocol_object (TAO_AV_Protocol_Object *object);
+
+ /// sets the address for this flow.
+ int parse_address (const char *format_string,
+ TAO_AV_Core::Flow_Component flow_component);
+
+ /// returns true for a multicast address.
+ int is_multicast (void);
+
+protected:
+
+ /// parses the flow protocol string with tokens separated by :
+ int parse_flow_protocol_string (const char *flow_options_string);
+
+ /// sets the direction flag.
+ int set_direction (const char *direction_string);
+
+ /// sets the protocol_ enum from the carrier_protocol_ string.
+ int set_protocol (void);
+
+ /// Addr information for the carrier protocol.
+ ACE_Addr *address_;
+ int clean_up_address_; // added to clean up a memory leak
+ ACE_Addr *control_address_;
+ int clean_up_control_address_; // added to clean up a memory leak
+
+ /// Fwd Addr in string format i.e hostname:port.
+ ACE_CString address_str_;
+
+ /// Peer Addr in string format i.e hostname:port.
+ ACE_CString peer_address_str_;
+
+ /// format string.
+ ACE_CString format_;
+
+ /// Direction of this flow.
+ Direction direction_;
+
+ /// string representation of the direction.
+ ACE_CString direction_str_;
+
+ /// name of this flow.
+ ACE_CString flowname_;
+
+ /// name of the protocol used.
+ TAO_AV_Core::Protocol protocol_;
+
+ /// carrier protocol string.
+ ACE_CString carrier_protocol_;
+
+ /// flow protocol string.
+ ACE_CString flow_protocol_;
+
+ int use_flow_protocol_;
+
+ /// The flowspec entry;
+ ACE_CString entry_;
+
+ int is_multicast_;
+ bool delete_peer_addr_;
+ ACE_Addr *peer_addr_;
+ char** local_sec_addr_;
+ int num_local_sec_addrs_;
+ char** peer_sec_addr_;
+ int num_peer_sec_addrs_;
+ ACE_Addr *peer_control_addr_;
+ ACE_Addr *local_addr_;
+ ACE_Addr *local_control_addr_;
+ TAO_AV_Transport *transport_;
+ TAO_AV_Transport *control_transport_;
+ TAO_AV_Flow_Handler *handler_;
+ TAO_AV_Flow_Handler *control_handler_;
+ TAO_AV_Protocol_Object *protocol_object_;
+ TAO_AV_Protocol_Object *control_protocol_object_;
+ Role role_;
+};
+
+
+/**
+ * @class TAO_Forward_FlowSpec_Entry
+ */
+class TAO_AV_Export TAO_Forward_FlowSpec_Entry
+ : public TAO_FlowSpec_Entry
+{
+public:
+ enum Position {TAO_AV_FLOWNAME = 0,
+ TAO_AV_DIRECTION = 1,
+ TAO_AV_FORMAT = 2,
+ TAO_AV_FLOW_PROTOCOL = 3,
+ TAO_AV_ADDRESS = 4,
+ TAO_AV_PEER_ADDR = 5};
+
+ /// default constructor.
+ TAO_Forward_FlowSpec_Entry (void);
+
+ /// constructor to construct an entry from the arguments.
+ TAO_Forward_FlowSpec_Entry (const char *flowname,
+ const char *direction,
+ const char *format_name,
+ const char *flow_protocol,
+ const char *carrier_protocol,
+ ACE_Addr *address,
+ ACE_Addr *control_address = 0);
+
+ TAO_Forward_FlowSpec_Entry (const char *flowname,
+ const char *direction,
+ const char *format_name,
+ const char *flow_protocol,
+ const char *address);
+
+ virtual ~TAO_Forward_FlowSpec_Entry (void);
+
+ /// converts the entry to a string.
+ virtual const char *entry_to_string (void);
+
+ virtual Role role (void);
+
+ /// construct the entry from a string specified by the flowSpec grammar.
+ virtual int parse (const char* flowSpec_entry);
+};
+
+/**
+ * @class TAO_Reverse_FlowSpec_Entry
+ * @brief
+ */
+class TAO_AV_Export TAO_Reverse_FlowSpec_Entry
+ :public TAO_FlowSpec_Entry
+{
+public:
+ enum Position {TAO_AV_FLOWNAME = 0,
+ TAO_AV_ADDRESS = 1,
+ TAO_AV_FLOW_PROTOCOL = 2,
+ TAO_AV_DIRECTION = 3,
+ TAO_AV_FORMAT = 4};
+
+ // default constructor.
+ TAO_Reverse_FlowSpec_Entry (void);
+
+ // constructor to construct an entry from the arguments.
+ TAO_Reverse_FlowSpec_Entry (const char *flowname,
+ const char *direction,
+ const char *format_name,
+ const char *flow_protocol,
+ const char *carrier_protocol,
+ ACE_Addr *address,
+ ACE_Addr *control_address = 0);
+
+ // Takes the address in protocol=endpoint form.
+ TAO_Reverse_FlowSpec_Entry (const char *flowname,
+ const char *direction,
+ const char *format_name,
+ const char *flow_protocol,
+ const char *address);
+
+ virtual ~TAO_Reverse_FlowSpec_Entry (void);
+
+ /// converts the entry to a string.
+ virtual const char *entry_to_string (void);
+
+ virtual Role role (void);
+
+ /// construct the entry from a string specified by the flowSpec grammar.
+ virtual int parse (const char* flowSpec_entry);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include "orbsvcs/AV/Transport.h"
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/AV/FlowSpec_Entry.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_FLOWSPEC_ENTRY_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i b/TAO/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i
new file mode 100644
index 00000000000..3af4438dd98
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i
@@ -0,0 +1,347 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "ace/OS_NS_strings.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+int
+TAO_FlowSpec_Entry::set_direction (const char *direction)
+{
+ this->direction_str_ = direction;
+ if (direction == 0)
+ {
+ this->direction_ = TAO_AV_INVALID;
+ return -1;
+ }
+ if (ACE_OS::strcasecmp (direction,"in") == 0)
+ this->direction_ = TAO_AV_DIR_IN;
+ else if (ACE_OS::strcasecmp (direction,"out") == 0)
+ this->direction_ = TAO_AV_DIR_OUT;
+ return 0;
+}
+
+ACE_INLINE
+int
+TAO_FlowSpec_Entry::parse_flow_protocol_string (const char *flow_string)
+{
+ if (flow_string == 0)
+ return 0;
+
+ if (ACE_OS::strcmp (flow_string,"") == 0)
+ return 0;
+
+ this->use_flow_protocol_ = 1;
+ // do some flow protocol processing.
+ this->flow_protocol_ = flow_string;
+
+ return 0;
+}
+
+ACE_INLINE
+int
+TAO_FlowSpec_Entry::direction (void)
+{
+ return this->direction_;
+}
+
+ACE_INLINE
+const char *
+TAO_FlowSpec_Entry::direction_str (void) const
+{
+ return this->direction_str_.c_str();
+}
+
+ACE_INLINE
+const char *
+TAO_FlowSpec_Entry::flow_protocol_str (void) const
+{
+ return this->flow_protocol_.c_str();
+}
+
+ACE_INLINE
+void
+TAO_FlowSpec_Entry::flow_protocol_str (const char *str)
+{
+ this->flow_protocol_ = CORBA::string_dup (str);
+}
+
+ACE_INLINE
+TAO_AV_Core::Protocol
+TAO_FlowSpec_Entry::carrier_protocol (void)
+{
+ return this->protocol_;
+}
+
+ACE_INLINE
+const char *
+TAO_FlowSpec_Entry::carrier_protocol_str (void) const
+{
+ return this->carrier_protocol_.c_str();
+}
+
+ACE_INLINE
+ACE_Addr *
+TAO_FlowSpec_Entry::address (void)
+{
+ return this->address_;
+}
+
+ACE_INLINE
+void
+TAO_FlowSpec_Entry::address (ACE_Addr *addr)
+{
+ this->address_ = addr;
+}
+
+ACE_INLINE
+ACE_Addr *
+TAO_FlowSpec_Entry::control_address (void)
+{
+ return this->control_address_;
+}
+
+ACE_INLINE
+void
+TAO_FlowSpec_Entry::control_address (ACE_Addr *addr)
+{
+ this->control_address_ = addr;
+}
+
+ACE_INLINE
+const char *
+TAO_FlowSpec_Entry::address_str (void) const
+{
+ return this->address_str_.c_str();
+}
+
+ACE_INLINE
+const char*
+TAO_FlowSpec_Entry::format (void) const
+{
+ return this->format_.c_str();
+}
+
+ACE_INLINE
+const char *
+TAO_FlowSpec_Entry::flowname (void) const
+{
+ return this->flowname_.c_str();
+}
+
+
+ACE_INLINE
+int
+TAO_FlowSpec_Entry::set_peer_addr (ACE_Addr *peer_addr)
+{
+ if (this->delete_peer_addr_)
+ delete this->peer_addr_;
+
+ this->delete_peer_addr_ = false;
+ this->peer_addr_ = peer_addr;
+
+ if (this->handler_ != 0)
+ this->handler_->set_remote_address (peer_addr);
+ return 0;
+}
+
+ACE_INLINE
+ACE_Addr *
+TAO_FlowSpec_Entry::get_peer_addr (void)
+{
+ return this->peer_addr_;
+}
+
+ACE_INLINE
+int
+TAO_FlowSpec_Entry::set_local_addr (ACE_Addr *local_addr)
+{
+ this->local_addr_ = local_addr;
+ return 0;
+}
+
+ACE_INLINE
+int
+TAO_FlowSpec_Entry::set_local_control_addr (ACE_Addr *local_addr)
+{
+ this->local_control_addr_ = local_addr;
+ return 0;
+}
+
+ACE_INLINE
+ACE_Addr*
+TAO_FlowSpec_Entry::get_local_addr (void)
+{
+ return this->local_addr_;
+}
+
+ACE_INLINE
+ACE_Addr*
+TAO_FlowSpec_Entry::get_local_control_addr (void)
+{
+ return this->local_control_addr_;
+}
+
+ACE_INLINE
+int
+TAO_FlowSpec_Entry::set_local_sec_addr (char** local_sec_addr,
+ int size)
+{
+ this->local_sec_addr_ = local_sec_addr;
+ this->num_local_sec_addrs_ = size;
+ return 0;
+}
+
+ACE_INLINE
+char**
+TAO_FlowSpec_Entry::get_local_sec_addr (void)
+{
+ return this->local_sec_addr_;
+}
+
+ACE_INLINE
+int
+TAO_FlowSpec_Entry::num_local_sec_addrs (void)
+{
+ return this->num_local_sec_addrs_;
+}
+
+ACE_INLINE
+int
+TAO_FlowSpec_Entry::set_peer_sec_addr (char** peer_sec_addr,
+ int size)
+{
+ this->peer_sec_addr_ = peer_sec_addr;
+ this->num_peer_sec_addrs_ = size;
+ return 0;
+}
+
+ACE_INLINE
+char**
+TAO_FlowSpec_Entry::get_peer_sec_addr (void)
+{
+ return this->peer_sec_addr_;
+}
+
+ACE_INLINE
+int
+TAO_FlowSpec_Entry::num_peer_sec_addrs (void)
+{
+ return this->num_peer_sec_addrs_;
+}
+
+ACE_INLINE
+TAO_AV_Transport*
+TAO_FlowSpec_Entry::transport (void)
+{
+ return this->transport_;
+}
+
+ACE_INLINE
+void
+TAO_FlowSpec_Entry::transport (TAO_AV_Transport *transport)
+{
+ this->transport_ = transport;
+}
+
+ACE_INLINE
+TAO_AV_Transport*
+TAO_FlowSpec_Entry::control_transport (void)
+{
+ return this->control_transport_;
+}
+
+ACE_INLINE
+void
+TAO_FlowSpec_Entry::control_transport (TAO_AV_Transport *control_transport)
+{
+ this->control_transport_ = control_transport;
+}
+
+ACE_INLINE
+TAO_AV_Flow_Handler *
+TAO_FlowSpec_Entry::handler (void)
+{
+ return this->handler_;
+}
+
+ACE_INLINE
+TAO_AV_Flow_Handler *
+TAO_FlowSpec_Entry::control_handler (void)
+{
+ return this->control_handler_;
+}
+
+ACE_INLINE
+void
+TAO_FlowSpec_Entry::handler (TAO_AV_Flow_Handler *handler)
+{
+ this->handler_ = handler;
+
+// // Now remove the handler from the reactor if the handler is for a producer.
+// switch (this->role ())
+// {
+// case TAO_AV_PRODUCER:
+// {
+// ACE_Event_Handler *event_handler = handler->event_handler ();
+// int result = event_handler->reactor ()->remove_handler (event_handler,
+// ACE_Event_Handler::READ_MASK);
+// if (result < 0)
+// ACE_ERROR ((LM_ERROR,"TAO_FlowSpec_Entry::handler\n"));
+// break;
+// }
+// }
+}
+
+ACE_INLINE
+void
+TAO_FlowSpec_Entry::control_handler (TAO_AV_Flow_Handler *handler)
+{
+ this->control_handler_ = handler;
+}
+
+ACE_INLINE
+TAO_AV_Protocol_Object*
+TAO_FlowSpec_Entry::protocol_object (void)
+{
+ return this->protocol_object_;
+}
+
+ACE_INLINE
+void
+TAO_FlowSpec_Entry::protocol_object (TAO_AV_Protocol_Object *object)
+{
+ this->protocol_object_ = object;
+}
+
+ACE_INLINE
+TAO_AV_Protocol_Object*
+TAO_FlowSpec_Entry::control_protocol_object (void)
+{
+ return this->control_protocol_object_;
+}
+
+ACE_INLINE
+void
+TAO_FlowSpec_Entry::control_protocol_object (TAO_AV_Protocol_Object *object)
+{
+ this->control_protocol_object_ = object;
+}
+
+ACE_INLINE
+int
+TAO_FlowSpec_Entry::is_multicast (void)
+{
+ return this->is_multicast_;
+}
+
+ACE_INLINE
+void
+TAO_FlowSpec_Entry::role (TAO_FlowSpec_Entry::Role role)
+{
+ this->role_ = role;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/Flows_T.cpp b/TAO/orbsvcs/orbsvcs/AV/Flows_T.cpp
new file mode 100644
index 00000000000..c2e6683d223
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Flows_T.cpp
@@ -0,0 +1,252 @@
+//$Id$
+
+#ifndef TAO_AV_FLOWS_T_CPP
+#define TAO_AV_FLOWS_T_CPP
+
+#include "orbsvcs/AV/Flows_T.h"
+#include "tao/debug.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// ------------------------------------------------------------
+// TAO_FDev
+// ------------------------------------------------------------
+
+// default constructor
+template <class T_Producer, class T_Consumer>
+TAO_FDev<T_Producer, T_Consumer>::TAO_FDev (void)
+{
+}
+
+template <class T_Producer, class T_Consumer>
+TAO_FDev<T_Producer, T_Consumer>::TAO_FDev (const char *flowname)
+ :flowname_ (flowname)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Any flowname_any;
+ flowname_any <<= flowname;
+ this->define_property ("Flow",
+ flowname_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_FDev::TAO_FDev");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+template <class T_Producer, class T_Consumer>
+TAO_FDev<T_Producer, T_Consumer>::~TAO_FDev (void)
+{
+ //no-op
+}
+
+template <class T_Producer, class T_Consumer>
+const char *
+TAO_FDev<T_Producer, T_Consumer>::flowname (void)
+{
+ return this->flowname_.in ();
+}
+
+template <class T_Producer, class T_Consumer>
+void
+TAO_FDev<T_Producer, T_Consumer>::flowname (const char *flow_name)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Any flowname_any;
+ flowname_any <<= flow_name;
+ this->define_property ("Flow",
+ flowname_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_FDev::flowname");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ this->flowname_ = flow_name;
+}
+
+template <class T_Producer, class T_Consumer>
+AVStreams::FlowProducer_ptr
+TAO_FDev<T_Producer, T_Consumer>::create_producer (AVStreams::FlowConnection_ptr the_requester,
+ AVStreams::QoS & the_qos,
+ CORBA::Boolean_out met_qos,
+ char *& named_fdev
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::streamOpDenied,
+ AVStreams::notSupported,
+ AVStreams::QoSRequestFailed))
+{
+ // call the bridge method.
+ return this->make_producer (the_requester,
+ the_qos,
+ met_qos,
+ named_fdev
+ ACE_ENV_ARG_PARAMETER);
+}
+
+template <class T_Producer, class T_Consumer>
+// hook for the applications to override the creation process.
+AVStreams::FlowProducer_ptr
+TAO_FDev<T_Producer, T_Consumer>::make_producer (AVStreams::FlowConnection_ptr /* the_requester */,
+ AVStreams::QoS & /* the_qos */,
+ CORBA::Boolean_out /* met_qos */,
+ char *& /* named_fdev */
+ ACE_ENV_ARG_DECL)
+{
+ AVStreams::FlowProducer_ptr producer = AVStreams::FlowProducer::_nil ();
+ ACE_TRY
+ {
+ // Activate the producer implementation under the Root POA.
+ T_Producer *producer_i;
+ ACE_NEW_RETURN (producer_i, T_Producer, 0);
+ this->producer_list_.insert_tail (producer_i);
+ producer = producer_i->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_FDev::make_producer");
+ return producer;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (producer);
+ return producer;
+}
+
+template <class T_Producer, class T_Consumer>
+// hook for the applications to override the consumer creation.
+AVStreams::FlowConsumer_ptr
+TAO_FDev<T_Producer, T_Consumer>::make_consumer (AVStreams::FlowConnection_ptr /* the_requester */,
+ AVStreams::QoS & /* the_qos */,
+ CORBA::Boolean_out /* met_qos */,
+ char *& /* named_fdev */
+ ACE_ENV_ARG_DECL)
+{
+ AVStreams::FlowConsumer_ptr consumer = AVStreams::FlowConsumer::_nil ();
+ ACE_TRY
+ {
+ // Activate the consumer implementation under the Root POA.
+ T_Consumer *consumer_i;
+ ACE_NEW_RETURN (consumer_i, T_Consumer, 0 );
+
+ this->consumer_list_.insert_tail (consumer_i);
+ consumer = consumer_i->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_FDev::make_consumer");
+ return consumer;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (consumer);
+ return consumer;
+}
+
+template <class T_Producer, class T_Consumer>
+AVStreams::FlowConsumer_ptr
+TAO_FDev<T_Producer, T_Consumer>::create_consumer (AVStreams::FlowConnection_ptr the_requester,
+ AVStreams::QoS & the_qos,
+ CORBA::Boolean_out met_qos,
+ char *& named_fdev
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::streamOpDenied,
+ AVStreams::notSupported,
+ AVStreams::QoSRequestFailed))
+{
+ return this->make_consumer (the_requester,
+ the_qos,
+ met_qos,
+ named_fdev
+ ACE_ENV_ARG_PARAMETER);
+}
+
+template <class T_Producer, class T_Consumer>
+// not implemented yet.
+AVStreams::FlowConnection_ptr
+TAO_FDev<T_Producer, T_Consumer>::bind (AVStreams::FDev_ptr peer_device,
+ AVStreams::QoS & the_qos,
+ CORBA::Boolean_out is_met
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::QoSRequestFailed))
+{
+ ACE_UNUSED_ARG (peer_device);
+ ACE_UNUSED_ARG (the_qos);
+ ACE_UNUSED_ARG (is_met);
+ ACE_CHECK_RETURN (0);
+ return 0;
+}
+
+template <class T_Producer, class T_Consumer>
+// multicast is not supported yet.
+AVStreams::FlowConnection_ptr
+TAO_FDev<T_Producer, T_Consumer>::bind_mcast (AVStreams::FDev_ptr first_peer,
+ AVStreams::QoS & the_qos,
+ CORBA::Boolean_out is_met
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::QoSRequestFailed))
+{
+ ACE_UNUSED_ARG (first_peer);
+ ACE_UNUSED_ARG (the_qos);
+ ACE_UNUSED_ARG (is_met);
+ ACE_CHECK_RETURN (0);
+ return 0;
+}
+
+template <class T_Producer, class T_Consumer>
+void
+TAO_FDev<T_Producer, T_Consumer>::destroy (AVStreams::FlowEndPoint_ptr /* the_ep */,
+ const char * /* fdev_name */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported))
+{
+ // @@ Shouldn't the parameters be made use of!
+ // Destroy/delete all the producers and consumers.
+
+ TAO_FlowProducer *producer_i;
+
+ for (PRODUCER_LIST_ITERATOR producer_list_iterator (this->producer_list_);
+ (producer_i = producer_list_iterator.next ()) != 0;
+ producer_list_iterator.advance ())
+ {
+ TAO_AV_Core::deactivate_servant (producer_i);
+ delete producer_i;
+ }
+
+ TAO_FlowConsumer *consumer_i;
+
+ for (CONSUMER_LIST_ITERATOR consumer_list_iterator (this->consumer_list_);
+ (consumer_i = consumer_list_iterator.next ()) != 0;
+ consumer_list_iterator.advance ())
+ {
+ TAO_AV_Core::deactivate_servant (consumer_i);
+ delete consumer_i;
+ }
+ int result = TAO_AV_Core::deactivate_servant (this);
+ if (result < 0)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_StreamEndPoint::destroy failed\n"));
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_AV_FLOWS_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/AV/Flows_T.h b/TAO/orbsvcs/orbsvcs/AV/Flows_T.h
new file mode 100644
index 00000000000..d0810ab65e1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Flows_T.h
@@ -0,0 +1,130 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Flows_T.h
+ *
+ * $Id$
+ *
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_AV_FLOWS_T_H
+#define TAO_AV_FLOWS_T_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/AVStreams_i.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_FDev
+ * @brief Implementation of the AV/Streams Flow Device.
+ * A FlowConnection is used to bind FDevs for flows,
+ * much like how a StreamCtrl is used to bind MMDevices for streams.
+ */
+template <class T_Producer, class T_Consumer>
+class TAO_FDev :
+ public virtual POA_AVStreams::FDev,
+ public virtual TAO_PropertySet
+{
+public:
+ /// default constructor
+ TAO_FDev (void);
+
+ /// constructor taking a flowname.
+ TAO_FDev (const char *flowname);
+
+ /// Destructor..
+ ~TAO_FDev (void);
+
+ /// set/get the flowname.
+ /// create a flow producer object.
+ const char *flowname (void);
+ void flowname (const char *flowname);
+ AVStreams::FlowProducer_ptr create_producer (AVStreams::FlowConnection_ptr the_requester,
+ AVStreams::QoS & the_qos,
+ CORBA::Boolean_out met_qos,
+ char *& named_fdev
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::streamOpDenied,
+ AVStreams::notSupported,
+ AVStreams::QoSRequestFailed));
+
+ /// bridge method for the application to override the producer object
+ /// creation. Default implementation creates a TAO_FlowProducer.
+ virtual AVStreams::FlowProducer_ptr make_producer (AVStreams::FlowConnection_ptr the_requester,
+ AVStreams::QoS & the_qos,
+ CORBA::Boolean_out met_qos,
+ char *& named_fdev
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// create a flow consumer object.
+ virtual AVStreams::FlowConsumer_ptr create_consumer (AVStreams::FlowConnection_ptr the_requester,
+ AVStreams::QoS & the_qos,
+ CORBA::Boolean_out met_qos,
+ char *& named_fdev
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::streamOpDenied,
+ AVStreams::notSupported,
+ AVStreams::QoSRequestFailed));
+
+ /// bridge method for the application to override the consumer object
+ /// creation. Default implementation creates a TAO_FlowConsumer.
+ 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_ARG_DECL_WITH_DEFAULTS);
+
+ /// bind this FDev with another FDev.
+ virtual AVStreams::FlowConnection_ptr bind (AVStreams::FDev_ptr peer_device,
+ AVStreams::QoS & the_qos,
+ CORBA::Boolean_out is_met
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::QoSRequestFailed));
+
+ /// multicast bind is not implemented yet.
+ virtual AVStreams::FlowConnection_ptr bind_mcast (AVStreams::FDev_ptr first_peer,
+ AVStreams::QoS & the_qos,
+ CORBA::Boolean_out is_met
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::streamOpFailed,
+ AVStreams::QoSRequestFailed));
+
+ /// destroys this FDev.
+ virtual void destroy (AVStreams::FlowEndPoint_ptr the_ep,
+ const char * fdev_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ AVStreams::notSupported));
+
+protected:
+ ACE_DLList <TAO_FlowProducer> producer_list_;
+ typedef ACE_DLList_Iterator <TAO_FlowProducer> PRODUCER_LIST_ITERATOR;
+ ACE_DLList <TAO_FlowConsumer> consumer_list_;
+ typedef ACE_DLList_Iterator <TAO_FlowConsumer> CONSUMER_LIST_ITERATOR;
+ CORBA::String_var flowname_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/AV/Flows_T.cpp"
+#endif /*ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Flows_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_FLOWS_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/MCast.cpp b/TAO/orbsvcs/orbsvcs/AV/MCast.cpp
new file mode 100644
index 00000000000..5ccb9148c4f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/MCast.cpp
@@ -0,0 +1,220 @@
+// $Id$
+
+#include "orbsvcs/AV/MCast.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "tao/debug.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/AV/MCast.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//------------------------------------------------------------
+//TAO_AV_UDP_MCast_Flow_Handler
+//------------------------------------------------------------
+
+TAO_AV_UDP_MCast_Flow_Handler::TAO_AV_UDP_MCast_Flow_Handler (void)
+{
+ ACE_NEW (transport_,
+ TAO_AV_UDP_MCast_Transport (this));
+ ACE_NEW (dgram_mcast_,
+ ACE_SOCK_Dgram_Mcast);
+}
+
+TAO_AV_UDP_MCast_Flow_Handler::~TAO_AV_UDP_MCast_Flow_Handler (void)
+{
+ delete this->transport_;
+ delete this->dgram_mcast_;
+}
+
+
+int
+TAO_AV_UDP_MCast_Flow_Handler::handle_input (ACE_HANDLE /*fd*/)
+{
+ return this->protocol_object_->handle_input ();
+// return 0;
+}
+
+int
+TAO_AV_UDP_MCast_Flow_Handler::handle_timeout (const ACE_Time_Value &tv,
+ const void *arg)
+{
+ return TAO_AV_Flow_Handler::handle_timeout (tv,arg);
+}
+
+ACE_HANDLE
+TAO_AV_UDP_MCast_Flow_Handler::get_handle (void) const
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_MCast_Flow_Handler::get_handle "));
+ return this->get_mcast_socket ()->get_handle () ;
+}
+
+void
+TAO_AV_UDP_MCast_Flow_Handler::set_peer_addr (ACE_INET_Addr *peer_addr)
+{
+ this->peer_addr_ = peer_addr;
+}
+
+//------------------------------------------------------------
+// TAO_AV_UDP_MCast_Transport
+//------------------------------------------------------------
+
+TAO_AV_UDP_MCast_Transport::TAO_AV_UDP_MCast_Transport (void)
+ :handler_ (0)
+{
+}
+
+TAO_AV_UDP_MCast_Transport::TAO_AV_UDP_MCast_Transport (TAO_AV_UDP_MCast_Flow_Handler *handler)
+ :handler_ (handler)
+{
+}
+
+TAO_AV_UDP_MCast_Transport::~TAO_AV_UDP_MCast_Transport (void)
+{
+}
+
+int
+TAO_AV_UDP_MCast_Transport::open (ACE_Addr * /*address*/)
+{
+ return 0;
+}
+
+int
+TAO_AV_UDP_MCast_Transport::close (void)
+{
+ return 0;
+}
+
+
+ACE_Addr*
+TAO_AV_UDP_MCast_Transport::get_peer_addr (void)
+{
+ return &this->peer_addr_;
+}
+
+ACE_Addr*
+TAO_AV_UDP_MCast_Transport::get_local_addr (void)
+{
+ this->handler_->get_mcast_socket ()->get_local_addr (this->local_addr_);
+ return &this->local_addr_;
+}
+
+ssize_t
+TAO_AV_UDP_MCast_Transport::send (const ACE_Message_Block *mblk, ACE_Time_Value *)
+{
+ // For the most part this was copied from GIOP::send_request and
+ // friends.
+
+ iovec iov[ACE_IOV_MAX];
+ int iovcnt = 0;
+ ssize_t n = 0;
+ ssize_t nbytes = 0;
+
+ for (const ACE_Message_Block *i = mblk;
+ i != 0;
+ i = i->cont ())
+ {
+ // Make sure there is something to send!
+ if (i->length () > 0)
+ {
+ iov[iovcnt].iov_base = i->rd_ptr ();
+ iov[iovcnt].iov_len = static_cast<u_long> (i->length ());
+ iovcnt++;
+
+ // The buffer is full make a OS call. @@ TODO this should
+ // be optimized on a per-platform basis, for instance, some
+ // platforms do not implement writev() there we should copy
+ // the data into a buffer and call send_n(). In other cases
+ // there may be some limits on the size of the iovec, there
+ // we should set ACE_IOV_MAX to that limit.
+ if (iovcnt == ACE_IOV_MAX)
+ {
+ n = this->handler_->get_mcast_socket ()->send ((const iovec *) iov,
+ iovcnt);
+
+ if (n < 1)
+ return n;
+
+ nbytes += n;
+ iovcnt = 0;
+ }
+ }
+ }
+
+ // Check for remaining buffers to be sent!
+ if (iovcnt != 0)
+ {
+ n = this->handler_->get_mcast_socket ()->send ((const iovec *) iov,
+ iovcnt);
+ if (n < 1)
+ return n;
+
+ nbytes += n;
+ }
+
+ return nbytes;
+}
+
+ssize_t
+TAO_AV_UDP_MCast_Transport::send (const char *buf,
+ size_t len,
+ ACE_Time_Value *)
+{
+// if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_MCast_Transport::send "));
+// char addr [BUFSIZ];
+// this->peer_addr_.addr_to_string (addr,BUFSIZ);
+// if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"to %s\n",addr));
+
+ return this->handler_->get_mcast_socket ()->send (buf, len);
+
+}
+
+ssize_t
+TAO_AV_UDP_MCast_Transport::send (const iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *)
+{
+ return this->handler_->get_mcast_socket ()->send (iov,
+ iovcnt,
+ 0);
+
+}
+
+int
+TAO_AV_UDP_MCast_Transport::mtu (void)
+{
+ return ACE_MAX_DGRAM_SIZE;
+}
+
+
+ssize_t
+TAO_AV_UDP_MCast_Transport::recv (char *buf,
+ size_t len,
+ ACE_Time_Value *)
+{
+ return this->handler_->get_mcast_socket ()->recv (buf, len,this->peer_addr_);
+}
+
+ssize_t
+TAO_AV_UDP_MCast_Transport::recv (char *buf,
+ size_t len,
+ int flags,
+ ACE_Time_Value *timeout)
+{
+ return this->handler_->get_mcast_socket ()->recv (buf,
+ len,
+ this->peer_addr_,
+ flags,
+ timeout);
+}
+
+ssize_t
+TAO_AV_UDP_MCast_Transport::recv (iovec *iov,
+ int /*iovcnt*/,
+ ACE_Time_Value *timeout)
+{
+ return handler_->get_mcast_socket ()->recv (iov,this->peer_addr_,0,timeout);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/MCast.h b/TAO/orbsvcs/orbsvcs/AV/MCast.h
new file mode 100644
index 00000000000..fde288896ed
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/MCast.h
@@ -0,0 +1,117 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file MCast.h
+ *
+ * $Id$
+ *
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_AV_MCAST_H
+#define TAO_AV_MCAST_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/FlowSpec_Entry.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+#include "ace/INET_Addr.h"
+#include "ace/SOCK_Dgram_Mcast.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_AV_UDP_MCast_Flow_Handler;
+
+/**
+ * @class TAO_AV_UDP_MCast_Transport
+ * @brief A transport abstraction for Multicast dgram sockets.
+ * Uses the ACE_SOCK_Dgram_Mcast to send data.
+ */
+class TAO_AV_UDP_MCast_Transport
+ :public TAO_AV_Transport
+{
+
+public:
+ TAO_AV_UDP_MCast_Transport (void);
+
+ TAO_AV_UDP_MCast_Transport (TAO_AV_UDP_MCast_Flow_Handler *handler);
+
+ virtual ~TAO_AV_UDP_MCast_Transport (void);
+
+ virtual int open (ACE_Addr *address);
+
+ virtual int close (void);
+
+ virtual int mtu (void);
+
+ /// Write the complete Message_Block chain to the connection.
+ virtual ACE_Addr *get_peer_addr (void);
+ virtual ACE_Addr *get_local_addr (void);
+ virtual ssize_t send (const ACE_Message_Block *mblk,
+ ACE_Time_Value *s = 0);
+
+ /// Write the contents of the buffer of length len to the connection.
+ virtual ssize_t send (const char *buf,
+ size_t len,
+ ACE_Time_Value *s = 0);
+
+ /// Write the contents of iovcnt iovec's to the connection.
+ virtual ssize_t send (const iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *s = 0);
+
+ /// Read len bytes from into buf.
+ virtual ssize_t recv (char *buf,
+ size_t len,
+ ACE_Time_Value *s = 0);
+
+ /// Read len bytes from into buf using flags.
+ virtual ssize_t recv (char *buf,
+ size_t len,
+ int flags,
+ ACE_Time_Value *s = 0);
+
+ /// Read received data into the iovec buffers.
+ virtual ssize_t recv (iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *s = 0);
+protected:
+ TAO_AV_UDP_MCast_Flow_Handler *handler_;
+ ACE_INET_Addr peer_addr_;
+ ACE_INET_Addr local_addr_;
+};
+
+/**
+ * @class TAO_AV_UDP_MCast_Flow_Handler
+ * @brief Flow Handler for data sent over multicast sockets.
+ */
+class TAO_AV_UDP_MCast_Flow_Handler
+ :public virtual TAO_AV_Flow_Handler,
+ public virtual ACE_Event_Handler
+{
+public:
+ /// Ctor
+ /// Dtor
+ TAO_AV_UDP_MCast_Flow_Handler (void);
+ virtual ~TAO_AV_UDP_MCast_Flow_Handler (void);
+ virtual ACE_HANDLE get_handle (void) const;
+ virtual int handle_input (ACE_HANDLE fd);
+ virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg = 0);
+ ACE_SOCK_Dgram_Mcast *get_mcast_socket (void) const;
+ virtual ACE_Event_Handler* event_handler (void){ return this; }
+ void set_peer_addr (ACE_INET_Addr *peer_addr);
+protected:
+ ACE_INET_Addr *peer_addr_;
+ ACE_SOCK_Dgram_Mcast *dgram_mcast_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/AV/MCast.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_MCAST_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/MCast.i b/TAO/orbsvcs/orbsvcs/AV/MCast.i
new file mode 100644
index 00000000000..08d994f23ed
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/MCast.i
@@ -0,0 +1,17 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//------------------------------------------------------------
+// TAO_AV_UDP_MCast_Flow_Handler
+//-----------------------------------------------------------
+
+ACE_INLINE ACE_SOCK_Dgram_Mcast *
+TAO_AV_UDP_MCast_Flow_Handler::get_mcast_socket (void) const
+{
+ return this->dgram_mcast_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/Policy.cpp b/TAO/orbsvcs/orbsvcs/AV/Policy.cpp
new file mode 100644
index 00000000000..0fa94820c07
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Policy.cpp
@@ -0,0 +1,150 @@
+// $Id$
+
+#include "orbsvcs/AV/FlowSpec_Entry.h"
+#include "tao/debug.h"
+#include "orbsvcs/AV/Policy.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/AV/Policy.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_AV_Policy::TAO_AV_Policy (CORBA::ULong type)
+ :type_ (type)
+{
+}
+
+TAO_AV_SSRC_Policy::TAO_AV_SSRC_Policy (CORBA::ULong ssrc)
+ :TAO_AV_Policy (TAO_AV_SSRC_POLICY),
+ ssrc_ (ssrc)
+{
+}
+
+TAO_AV_Payload_Type_Policy::TAO_AV_Payload_Type_Policy (int payload_type)
+ :TAO_AV_Policy (TAO_AV_PAYLOAD_TYPE_POLICY),
+ payload_type_ (payload_type)
+{
+}
+
+// TAO_AV_RTP_Sdes_Policy
+TAO_AV_RTCP_Sdes_Policy::TAO_AV_RTCP_Sdes_Policy (void)
+ :TAO_AV_Policy (TAO_AV_RTCP_SDES_POLICY)
+{
+}
+
+TAO_AV_SFP_Credit_Policy::TAO_AV_SFP_Credit_Policy (void)
+ :TAO_AV_Policy (TAO_AV_SFP_CREDIT_POLICY)
+{
+}
+
+// TAO_AV_Callback
+TAO_AV_Callback::TAO_AV_Callback (void)
+ :protocol_object_ (0)
+{
+}
+
+TAO_AV_Callback::~TAO_AV_Callback (void)
+{
+}
+
+int
+TAO_AV_Callback::open (TAO_AV_Protocol_Object *object,
+ TAO_AV_Flow_Handler *handler)
+{
+ this->protocol_object_ = object;
+ this->handler_ = handler;
+ handler->callback (this);
+ return 0;
+}
+
+int
+TAO_AV_Callback::handle_start (void)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_Callback::handle_start\n"));
+ return -1;
+}
+
+int
+TAO_AV_Callback::handle_stop (void)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_Callback::handle_stop\n"));
+ return -1;
+}
+
+int
+TAO_AV_Callback::receive_frame (ACE_Message_Block * /*frame*/,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_Callback::receive_frame\n"));
+ return -1;
+}
+
+int
+TAO_AV_Callback::receive_control_frame (ACE_Message_Block *,
+ const ACE_Addr& )
+{
+ return 0;
+}
+
+int
+TAO_AV_Callback::handle_destroy (void)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_Callback::handle_end_stream\n"));
+ return -1;
+}
+
+void
+TAO_AV_Callback::get_timeout (ACE_Time_Value *& tv,
+ void *& /*arg*/)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_Callback::get_timeout\n"));
+ tv = 0;
+}
+
+int
+TAO_AV_Callback::handle_timeout (void * /*arg*/)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_Callback::handle_timeout\n"));
+ return 0;
+}
+
+TAO_AV_PolicyList
+TAO_AV_Callback::get_policies (void)
+{
+ TAO_AV_PolicyList list;
+ return list;
+}
+
+// TAO_AV_Transport*
+// TAO_AV_Callback::transport (void)
+// {
+// return this->transport_;
+// }
+
+// void
+// TAO_AV_Callback::transport (TAO_AV_Transport *transport)
+// {
+// this->transport_ = transport;
+// }
+
+TAO_AV_Protocol_Object*
+TAO_AV_Callback::protocol_object (void)
+{
+ return this->protocol_object_;
+}
+
+// void
+// TAO_AV_Callback::protocol_object (TAO_AV_Protocol_Object *object)
+// {
+// this->protocol_object_ = object;
+// }
+
+int
+TAO_AV_Callback::schedule_timer (void)
+{
+ return this->handler_->schedule_timer ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/Policy.h b/TAO/orbsvcs/orbsvcs/AV/Policy.h
new file mode 100644
index 00000000000..a34a9604e22
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Policy.h
@@ -0,0 +1,176 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Policy.h
+ *
+ * $Id$
+ *
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_AV_POLICY_H
+#define TAO_AV_POLICY_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Addr.h"
+#include "tao/Basic_Types.h"
+#include "tao/CORBA_String.h"
+#include "tao/Sequence_T.h"
+#include "ace/Time_Value.h"
+#include "orbsvcs/AV/AV_export.h"
+
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Message_Block;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+struct TAO_AV_frame_info
+{
+ CORBA::Boolean boundary_marker;
+ CORBA::Octet format;
+ // @@ Shouldn't this be a string.
+ CORBA::ULong timestamp;
+ CORBA::ULong ssrc;
+ CORBA::ULong sequence_num;
+};
+
+#define TAO_AV_SSRC_POLICY 100
+#define TAO_AV_PAYLOAD_TYPE_POLICY 101
+#define TAO_AV_TIMEOUT_POLICY 102
+#define TAO_AV_RTCP_SDES_POLICY 103
+#define TAO_AV_SFP_CREDIT_POLICY 104
+
+struct TAO_AV_RTCP_Sdes
+{
+ CORBA::String_var name_;
+ CORBA::String_var value_;
+};
+
+class TAO_AV_Export TAO_AV_Policy
+{
+public:
+ TAO_AV_Policy (CORBA::ULong type);
+ CORBA::ULong type (void);
+protected:
+ CORBA::ULong type_;
+};
+
+class TAO_AV_Export TAO_AV_SSRC_Policy : public TAO_AV_Policy
+{
+public:
+ TAO_AV_SSRC_Policy (CORBA::ULong ssrc = 0);
+ CORBA::ULong value (void);
+ void value (CORBA::ULong ssrc);
+protected:
+ CORBA::ULong ssrc_;
+};
+
+class TAO_AV_Export TAO_AV_Payload_Type_Policy : public TAO_AV_Policy
+{
+public:
+ TAO_AV_Payload_Type_Policy (int payload_type = -1);
+ int value (void);
+ void value (int pt);
+protected:
+ int payload_type_;
+};
+
+class TAO_AV_Export TAO_AV_RTCP_Sdes_Policy : public TAO_AV_Policy
+{
+public:
+ TAO_AV_RTCP_Sdes_Policy (void);
+ TAO_AV_RTCP_Sdes &value (void);
+ void value (const TAO_AV_RTCP_Sdes& sdes_val);
+protected:
+ TAO_AV_RTCP_Sdes sdes_;
+};
+
+class TAO_AV_Export TAO_AV_SFP_Credit_Policy : public TAO_AV_Policy
+{
+public:
+ TAO_AV_SFP_Credit_Policy (void);
+ int value (void);
+ void value (int val);
+protected:
+ int value_;
+};
+
+typedef TAO::unbounded_value_sequence<TAO_AV_Policy*> TAO_AV_PolicyList;
+
+class TAO_AV_Protocol_Object;
+class TAO_AV_Transport;
+class TAO_AV_Flow_Handler;
+
+/**
+ * @class TAO_AV_Callback
+ *
+ * @brief Callback class that the user will be implementing for receiving
+ * frames from the network and also for timer events.
+ */
+class TAO_AV_Export TAO_AV_Callback
+{
+public:
+ TAO_AV_Callback (void);
+ virtual ~TAO_AV_Callback (void);
+
+ /// Called for opening the callback.
+ int open (TAO_AV_Protocol_Object *object,
+ TAO_AV_Flow_Handler *handler);
+
+ /// Called during Streamctrl->start.
+ virtual int handle_start (void);
+
+ /// Called during Streamctrl->stop.
+ virtual int handle_stop (void);
+
+ /// Called during timeout for Flow Producers.
+ virtual int handle_timeout (void *arg);
+
+ virtual int schedule_timer (void);
+
+ virtual int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info = 0,
+ const ACE_Addr &address = ACE_Addr::sap_any);
+
+ // Called when a frame arrives for a FlowConsumer.
+
+ /// address from which the frame was received.
+ virtual int receive_control_frame (ACE_Message_Block *frame,
+ const ACE_Addr &address = ACE_Addr::sap_any);
+
+ /// Called during Streamctrl->destroy i.e tear_down of the stream
+ virtual int handle_destroy (void);
+
+ /**
+ * Called to get the timeout. If tv is 0 then the framework stop
+ * calling this. This will be called during the start of the frame
+ * and also if schedule_timer is called to get the timeout.
+ */
+ virtual void get_timeout (ACE_Time_Value *&tv,
+ void *&arg);
+
+ /// Accessor to protocol object.
+ TAO_AV_Protocol_Object *protocol_object (void);
+
+ /// get the policies for the protocol object.
+ virtual TAO_AV_PolicyList get_policies (void);
+protected:
+ TAO_AV_Protocol_Object *protocol_object_;
+ TAO_AV_Flow_Handler *handler_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/AV/Policy.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_AV_POLICY_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/Policy.i b/TAO/orbsvcs/orbsvcs/AV/Policy.i
new file mode 100644
index 00000000000..3ff570e0e6f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Policy.i
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//--------------------------------------------------
+// TAO_AV_Policy
+//--------------------------------------------------
+
+ACE_INLINE CORBA::ULong
+TAO_AV_Policy::type (void)
+{
+ return this->type_;
+}
+
+//--------------------------------------------------
+// TAO_AV_SSRC_Policy
+//--------------------------------------------------
+
+ACE_INLINE CORBA::ULong
+TAO_AV_SSRC_Policy::value (void)
+{
+ return this->ssrc_;
+}
+
+
+ACE_INLINE void
+TAO_AV_SSRC_Policy::value (CORBA::ULong ssrc)
+{
+ this->ssrc_ = ssrc;
+}
+
+//--------------------------------------------------
+// TAO_AV_Payload_Type_Policy
+//--------------------------------------------------
+ACE_INLINE void
+TAO_AV_Payload_Type_Policy::value (int pt)
+{
+ this->payload_type_ = pt;
+}
+
+ACE_INLINE int
+TAO_AV_Payload_Type_Policy::value (void)
+{
+ return this->payload_type_;
+}
+
+
+// TAO_AV_RTCP_Sdes_Policy
+ACE_INLINE TAO_AV_RTCP_Sdes &
+TAO_AV_RTCP_Sdes_Policy::value (void)
+{
+ return this->sdes_;
+}
+
+ACE_INLINE void
+TAO_AV_RTCP_Sdes_Policy::value (const TAO_AV_RTCP_Sdes &sdes_val)
+{
+ this->sdes_ = sdes_val;
+}
+
+//----------------------------------------------------------------------
+// TAO_AV_SFP_Credit_Policy
+//----------------------------------------------------------------------
+
+ACE_INLINE
+void
+TAO_AV_SFP_Credit_Policy::value (int credit)
+{
+ this->value_ = credit;
+}
+
+ACE_INLINE
+int
+TAO_AV_SFP_Credit_Policy::value (void)
+{
+ return this->value_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/Protocol_Factory.cpp b/TAO/orbsvcs/orbsvcs/AV/Protocol_Factory.cpp
new file mode 100644
index 00000000000..55f5767c9ca
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Protocol_Factory.cpp
@@ -0,0 +1,131 @@
+// $Id$
+
+
+#include "orbsvcs/AV/Protocol_Factory.h"
+#include "tao/debug.h"
+#include "ace/Dynamic_Service.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// TAO_AV_Flow_Protocol_Factory
+TAO_AV_Flow_Protocol_Factory::TAO_AV_Flow_Protocol_Factory (void)
+{
+}
+
+TAO_AV_Flow_Protocol_Factory::~TAO_AV_Flow_Protocol_Factory (void)
+{
+}
+
+int
+TAO_AV_Flow_Protocol_Factory::init (int /* argc */,
+ char * /* argv */ [])
+{
+ return -1;
+}
+
+int
+TAO_AV_Flow_Protocol_Factory::match_protocol (const char * /* protocol_string */)
+{
+ return 0;
+}
+
+TAO_AV_Protocol_Object*
+TAO_AV_Flow_Protocol_Factory::make_protocol_object (TAO_FlowSpec_Entry * /* entry */,
+ TAO_Base_StreamEndPoint * /* endpoint */ ,
+ TAO_AV_Flow_Handler * /* handler */,
+ TAO_AV_Transport * /* transport */)
+{
+ return 0;
+}
+
+const char *
+TAO_AV_Flow_Protocol_Factory::control_flow_factory (void)
+{
+ return 0;
+}
+
+//----------------------------------------------------------------------
+// TAO_AV_Protocol_Object
+//----------------------------------------------------------------------
+TAO_AV_Protocol_Object::TAO_AV_Protocol_Object (void)
+ :transport_ (0),
+ callback_ (0)
+{
+ // no-op.
+}
+
+TAO_AV_Protocol_Object::TAO_AV_Protocol_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport)
+ :transport_ (transport),
+ callback_ (callback)
+{
+ // no-op.
+}
+
+int
+TAO_AV_Protocol_Object::open (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport)
+{
+ this->callback_ = callback;
+ this->transport_ = transport;
+ return 0;
+}
+
+TAO_AV_Protocol_Object::~TAO_AV_Protocol_Object (void)
+{
+}
+
+int
+TAO_AV_Protocol_Object::start (void)
+{
+ return this->callback_->handle_start ();
+}
+
+int
+TAO_AV_Protocol_Object::stop (void)
+{
+ return this->callback_->handle_stop ();
+}
+
+int
+TAO_AV_Protocol_Object::set_policies (const TAO_AV_PolicyList &policy_list)
+{
+ this->policy_list_ = policy_list;
+ return 0;
+}
+
+TAO_AV_PolicyList
+TAO_AV_Protocol_Object::get_policies (void)
+{
+ return this->policy_list_;
+}
+
+TAO_AV_Transport*
+TAO_AV_Protocol_Object::transport (void)
+{
+ return this->transport_;
+}
+
+// void
+// TAO_AV_Protocol_Object::transport (TAO_AV_Transport *transport)
+// {
+// this->transport_ = transport;
+// }
+
+void
+TAO_AV_Protocol_Object::control_object (TAO_AV_Protocol_Object * /* object */)
+{
+ return;
+}
+
+int
+TAO_AV_Protocol_Object::handle_control_input (ACE_Message_Block *,
+ const ACE_Addr &)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"TAO_AV_Protocol_Object::handle_control_input\n"));
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/Protocol_Factory.h b/TAO/orbsvcs/orbsvcs/AV/Protocol_Factory.h
new file mode 100644
index 00000000000..f18774d3006
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Protocol_Factory.h
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Protocol_Factory.h
+ *
+ * $Id$
+ *
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_AV_PROTOCOL_FACTORY_T_H
+#define TAO_AV_PROTOCOL_FACTORY_T_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/FlowSpec_Entry.h"
+#include "orbsvcs/AV/Policy.h"
+
+#include "ace/Service_Object.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_AV_Protocol_Object
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_Protocol_Object
+{
+public:
+ TAO_AV_Protocol_Object (void);
+
+ /// constructor.
+ TAO_AV_Protocol_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport);
+
+ /// Destructor
+ virtual ~TAO_AV_Protocol_Object (void);
+
+ virtual int open (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport);
+
+ virtual int handle_input (void) = 0;
+
+ /// Called on a control object.
+ virtual int handle_control_input (ACE_Message_Block *control_frame,
+ const ACE_Addr &peer_address);
+
+ /// set/get policies.
+ virtual int set_policies (const TAO_AV_PolicyList &policy_list);
+ virtual TAO_AV_PolicyList get_policies (void);
+
+ /// start/stop the flow.
+ virtual int start (void);
+ virtual int stop (void);
+
+ /// send a data frame.
+ virtual int send_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info = 0) = 0;
+
+ /// send a frame in iovecs.
+ virtual int send_frame (const iovec *iov,
+ int iovcnt,
+ TAO_AV_frame_info *frame_info = 0) = 0;
+
+ virtual int send_frame (const char *buf,
+ size_t len) = 0;
+
+ /// end the stream.
+ virtual void control_object (TAO_AV_Protocol_Object *object);
+ virtual int destroy (void) = 0;
+ TAO_AV_Transport *transport (void);
+protected:
+ TAO_AV_Transport *transport_;
+ TAO_AV_PolicyList policy_list_;
+ TAO_AV_Callback *callback_;
+};
+
+/**
+ * @class TAO_AV_Flow_Protocol_Factory
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_Flow_Protocol_Factory : public ACE_Service_Object
+{
+public:
+ /// Initialization hook.
+ TAO_AV_Flow_Protocol_Factory (void);
+ virtual ~TAO_AV_Flow_Protocol_Factory (void);
+ virtual int init (int argc, char *argv[]);
+ virtual int match_protocol (const char *flow_string);
+ 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);
+ virtual const char *control_flow_factory (void);
+ int ref_count;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_PROTOCOL_FACTORY_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/QoS_UDP.cpp b/TAO/orbsvcs/orbsvcs/AV/QoS_UDP.cpp
new file mode 100644
index 00000000000..19aba484619
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/QoS_UDP.cpp
@@ -0,0 +1,1537 @@
+// $Id$
+
+
+#include "orbsvcs/AV/QoS_UDP.h"
+
+#if defined (ACE_HAS_RAPI) || defined (ACE_HAS_WINSOCK2_GQOS)
+
+#include "orbsvcs/AV/UDP.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/MCast.h"
+#include "orbsvcs/AV/Fill_ACE_QoS.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/AV/QoS_UDP.i"
+#endif /* __ACE_INLINE__ */
+
+//------------------------------------------------------------
+// TAO_AV_UDP_Flow_Handler
+//------------------------------------------------------------
+
+static int resv_error = 0;
+static int resv_confirm = 0;
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int
+FillQoSParams (ACE_QoS_Params &qos_params,
+ iovec* iov,
+ ACE_QoS* qos)
+{
+ qos_params.callee_data (iov);
+ qos_params.caller_data (0);
+ qos_params.socket_qos (qos);
+ qos_params.group_socket_qos (0);
+ qos_params.flags (ACE_JL_BOTH);
+
+ return 0;
+}
+
+TAO_AV_UDP_QoS_Session_Helper::TAO_AV_UDP_QoS_Session_Helper (void)
+{
+
+}
+
+TAO_AV_UDP_QoS_Session_Helper::~TAO_AV_UDP_QoS_Session_Helper (void)
+{
+}
+
+int
+TAO_AV_UDP_QoS_Session_Helper::set_qos (ACE_Flow_Spec &ace_flow_spec,
+ TAO_AV_UDP_QoS_Flow_Handler *handler)
+{
+ ACE_QoS* ace_qos = 0;
+
+ ACE_NEW_RETURN (ace_qos,
+ ACE_QoS,
+ -1);
+
+ Fill_ACE_QoS fill_ace_qos;
+
+ if (handler->flowspec_entry ()->role () == TAO_FlowSpec_Entry::TAO_AV_PRODUCER)
+ {
+ if (fill_ace_qos.fill_simplex_sender_qos (*ace_qos,
+ &ace_flow_spec) !=0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to fill simplex sender qos (%N|%l)\n"),
+ -1);
+ else
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Filled up the Sender QoS parameters\n"));
+ }
+ else if (handler->flowspec_entry ()->role () == TAO_FlowSpec_Entry::TAO_AV_CONSUMER)
+ {
+ if (fill_ace_qos.fill_simplex_receiver_qos (*ace_qos,
+ &ace_flow_spec) !=0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to fill simplex receiver qos (%N|%l)\n"),
+ -1);
+ else
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Filled up the Receiver QoS parameters\n"));
+
+ }
+
+ ACE_QoS_Manager qos_manager = handler->get_socket ()->qos_manager ();
+
+ // Set the QoS for the session. Replaces the ioctl () call that
+ // was being made previously.
+ if (handler->qos_session ()->qos (handler->get_socket (),
+ &qos_manager,
+ *ace_qos) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to set QoS (%N|%l)\n"),
+ -1);
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "Setting QOS succeeds\n"));
+
+ return 0;
+}
+
+ACE_QoS_Session *
+TAO_AV_UDP_QoS_Session_Helper::open_qos_session (TAO_AV_UDP_QoS_Flow_Handler *handler,
+ ACE_INET_Addr &addr)
+{
+ ACE_QoS_Params qos_params;
+
+ ACE_QoS* ace_qos = 0;
+
+ FillQoSParams (qos_params,
+ 0,
+ ace_qos);
+
+
+ // Create a QoS Session Factory.
+ ACE_QoS_Session_Factory session_factory;
+
+ // Ask the factory to create a QoS session.
+ ACE_QoS_Session *qos_session = session_factory.create_session ();
+
+ // Create a destination address for the QoS session. The same
+ // address should be used for the subscribe call later. A copy
+ // is made below only to distinguish the two usages of the dest
+ // address.
+ ACE_INET_Addr dest_addr (addr);
+
+ // A QoS session is defined by the 3-tuple [DestAddr, DestPort,
+ // Protocol]. Initialize the QoS session.
+ if (qos_session->open (dest_addr,
+ IPPROTO_UDP) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error in opening the QoS session\n"),
+ 0);
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "QoS session opened successfully\n"));
+
+ if (handler->flowspec_entry ()->role () == TAO_FlowSpec_Entry::TAO_AV_PRODUCER)
+ {
+ // This is a sender
+ qos_session->flags (ACE_QoS_Session::ACE_QOS_SENDER);
+ }
+ else if (handler->flowspec_entry ()->role () == TAO_FlowSpec_Entry::TAO_AV_CONSUMER)
+ {
+ // This is a receiver
+ qos_session->flags (ACE_QoS_Session::ACE_QOS_RECEIVER);
+ }
+
+ return qos_session;
+}
+
+int
+TAO_AV_UDP_QoS_Session_Helper::activate_qos_handler (ACE_QoS_Session *qos_session,
+ TAO_AV_UDP_QoS_Flow_Handler *handler)
+{
+ ACE_QoS_Decorator* qos_decorator;
+
+ // Decorate the above handler with QoS functionality.
+ ACE_NEW_RETURN (qos_decorator,
+ ACE_QoS_Decorator (handler,
+ qos_session,
+ handler->av_core ()->reactor ()),
+ -1);
+
+ // Initialize the Decorator.
+ if (qos_decorator->init () != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "QoS Decorator init () failed (%N|%l)\n"),
+ -1);
+
+ // Register the decorated Event Handler with the Reactor.
+ int result = handler->av_core ()->reactor ()->register_handler (qos_decorator,
+ ACE_Event_Handler::QOS_MASK |
+ ACE_Event_Handler::READ_MASK);
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error in registering the Decorator with the Reactor (%N|%l)\n"),
+ -1);
+
+ return 0;
+
+}
+
+TAO_AV_UDP_QoS_Flow_Handler::TAO_AV_UDP_QoS_Flow_Handler (void)
+{
+ ACE_NEW (this->transport_,
+ TAO_AV_UDP_QoS_Transport (this));
+}
+
+TAO_AV_UDP_QoS_Flow_Handler::~TAO_AV_UDP_QoS_Flow_Handler (void)
+{
+ delete this->transport_;
+}
+
+TAO_AV_Transport *
+TAO_AV_UDP_QoS_Flow_Handler::transport (void)
+{
+ return this->transport_;
+}
+
+int
+TAO_AV_UDP_QoS_Flow_Handler::handle_input (ACE_HANDLE /*fd*/)
+{
+ this->protocol_object_->handle_input ();
+ return 0;
+}
+
+int
+TAO_AV_UDP_QoS_Flow_Handler::translate (CosPropertyService::Properties &qos_params,
+ ACE_Flow_Spec *ace_flow_spec)
+{
+ for (unsigned int i = 0;
+ i < qos_params.length ();
+ i++)
+ {
+ if (ACE_OS::strcmp (qos_params [i].property_name, "Service_Type") == 0)
+ {
+ CORBA::Short type;
+ qos_params [i].property_value >>= type;
+ ace_flow_spec->service_type (type);
+ }
+ else if (ACE_OS::strcmp (qos_params [i].property_name, "Token_Rate") == 0)
+ {
+ CORBA::ULong tok_rate;
+ qos_params [i].property_value >>= tok_rate;
+ ace_flow_spec->token_rate (tok_rate);
+ }
+ else if (ACE_OS::strcmp (qos_params [i].property_name, "Token_Bucket_Size") == 0)
+ {
+ CORBA::ULong tok_buck_size;
+ qos_params [i].property_value >>= tok_buck_size;
+ ace_flow_spec->token_bucket_size (tok_buck_size);
+ }
+ else if (ACE_OS::strcmp (qos_params [i].property_name, "Peak_Bandwidth") == 0)
+ {
+ CORBA::ULong peak_bw;
+ qos_params [i].property_value >>= peak_bw;
+ ace_flow_spec->peak_bandwidth (peak_bw);
+ }
+ else if (ACE_OS::strcmp (qos_params [i].property_name, "Latency") == 0)
+ {
+ CORBA::ULong lat;
+ qos_params [i].property_value >>= lat;
+ ace_flow_spec->latency (lat);
+ }
+ else if (ACE_OS::strcmp (qos_params [i].property_name, "Delay_Variation") == 0)
+ {
+ CORBA::ULong delay_var;
+ qos_params [i].property_value >>= delay_var;
+ ace_flow_spec->delay_variation (delay_var);
+ }
+ else if (ACE_OS::strcmp (qos_params [i].property_name, "Max_SDU_Size") == 0)
+ {
+ CORBA::ULong max_sdu;
+ qos_params [i].property_value >>= max_sdu;
+ ace_flow_spec->max_sdu_size (max_sdu);
+ }
+ else if (ACE_OS::strcmp (qos_params [i].property_name, "Minimum_Policed_Size") == 0)
+ {
+ CORBA::ULong min_pol_size;
+ qos_params [i].property_value >>= min_pol_size;
+ ace_flow_spec->minimum_policed_size (min_pol_size);
+ }
+ else if (ACE_OS::strcmp (qos_params [i].property_name, "TTL") == 0)
+ {
+ CORBA::ULong ttl;
+ qos_params [i].property_value >>= ttl;
+ ace_flow_spec->ttl (ttl);
+ }
+ else if (ACE_OS::strcmp (qos_params [i].property_name, "Priority") == 0)
+ {
+ CORBA::ULong priority;
+ qos_params [i].property_value >>= priority;
+ ace_flow_spec->priority (priority);
+ }
+ }
+
+ return 0;
+}
+
+int
+TAO_AV_UDP_QoS_Flow_Handler::translate (ACE_Flow_Spec *ace_flow_spec,
+ CosPropertyService::Properties &qos_params)
+{
+ qos_params.length (9);
+
+ qos_params [0].property_name = CORBA::string_dup ("Service_Type");
+ qos_params [0].property_value <<= (CORBA::Short) ace_flow_spec->service_type ();
+
+ qos_params [1].property_name = CORBA::string_dup ("Token_Rate");
+ qos_params [1].property_value <<= (CORBA::ULong) ace_flow_spec->token_rate ();
+
+ qos_params [2].property_name = CORBA::string_dup ("Token_Bucket_Size");
+ qos_params [2].property_value <<= (CORBA::ULong) ace_flow_spec->token_bucket_size ();
+
+ qos_params [3].property_name = CORBA::string_dup ("Peak_Bandwidth");
+ qos_params [3].property_value <<= (CORBA::ULong) ace_flow_spec->peak_bandwidth ();
+
+ qos_params [4].property_name = CORBA::string_dup ("Latency");
+ qos_params [4].property_value <<= (CORBA::ULong) ace_flow_spec->latency ();
+
+ qos_params [5].property_name = CORBA::string_dup ("Delay_Variation");
+ qos_params [5].property_value <<= (CORBA::ULong) ace_flow_spec->delay_variation ();
+
+ qos_params [6].property_name = CORBA::string_dup ("Max_SDU_Size");
+ qos_params [6].property_value <<= (CORBA::ULong) ace_flow_spec->max_sdu_size ();
+
+ qos_params [7].property_name = CORBA::string_dup ("Minimum_Policed_Size");
+ qos_params [7].property_value <<= (CORBA::ULong) ace_flow_spec->minimum_policed_size ();
+
+ qos_params [8].property_name = CORBA::string_dup ("TTL");
+ qos_params [8].property_value <<= (CORBA::ULong) ace_flow_spec->ttl ();
+
+ return 0;
+}
+
+int
+TAO_AV_UDP_QoS_Flow_Handler::handle_qos (ACE_HANDLE /*fd*/)
+{
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) TAO_AV_UDP_QoS_Flow_Handler::handle_qos\n"));
+
+ if (this->qos_session_->update_qos () == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error in updating QoS\n"),
+ -1);
+ else
+ {
+ if(TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) Updating QOS succeeds.\n"));
+ }
+
+ if (this->qos_session_->rsvp_event_type () == ACE_QoS_Session::RSVP_RESV_ERROR)
+ {
+ resv_error = 1;
+ }
+
+ if (this->qos_session_->rsvp_event_type () == ACE_QoS_Session::RSVP_RESV_CONFIRM)
+ {
+ resv_confirm = 1;
+ }
+
+ if (this->qos_session_->flags () == ACE_QoS_Session::ACE_QOS_SENDER)
+ {
+ if (this->qos_session_->rsvp_event_type () == ACE_QoS_Session::RSVP_RESV_EVENT)
+ {
+ if( TAO_debug_level > 0 )
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) Resv Event Received\n"));
+ }
+ if (!CORBA::is_nil (this->negotiator_))
+ {
+ if( TAO_debug_level > 0 )
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) Negotiator Specified\n"));
+ }
+
+ AVStreams::streamQoS new_qos;
+ ACE_Flow_Spec *ace_flow_spec =
+ this->qos_session_->qos ().sending_flowspec ();
+
+ if (ace_flow_spec != 0)
+ {
+ new_qos.length (1);
+ this->translate (ace_flow_spec,
+ new_qos [0].QoSParams);
+ }
+
+ AVStreams::Negotiator_var remote_negotiator;
+ this->negotiator_->negotiate (remote_negotiator.in (),
+ new_qos
+ ACE_ENV_ARG_PARAMETER);
+ }
+ }
+ }
+ else if (this->qos_session_->flags () == ACE_QoS_Session::ACE_QOS_RECEIVER)
+ {
+ if (this->qos_session_->rsvp_event_type () == ACE_QoS_Session::RSVP_PATH_EVENT)
+ {
+ ACE_QoS_Manager qos_manager =
+ this->get_socket ()->qos_manager ();
+
+ ACE_QoS ace_qos = this->qos_session_->qos ();
+
+ this->qos_session_->qos (this->get_socket (),
+ &qos_manager,
+ ace_qos);
+ }
+ }
+
+ return 0;
+}
+
+int
+TAO_AV_UDP_QoS_Flow_Handler::change_qos (AVStreams::QoS new_qos)
+{
+ if( TAO_debug_level > 0 )
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) TAO_AV_UDP_QoS_Flow_Handler::change_qos\n"));
+ }
+
+ ACE_QoS* ace_qos = 0;
+
+ ACE_NEW_RETURN (ace_qos,
+ ACE_QoS,
+ -1);
+
+ if (new_qos.QoSParams.length () != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "New QoS Params are not Empty\n"));
+
+ ACE_Flow_Spec *ace_flow_spec;
+
+ ACE_NEW_RETURN (ace_flow_spec,
+ ACE_Flow_Spec,
+ -1);
+
+ this->translate (new_qos.QoSParams,
+ ace_flow_spec);
+
+
+ Fill_ACE_QoS fill_ace_qos;
+
+ if (this->qos_session_->flags () == ACE_QoS_Session::ACE_QOS_SENDER)
+ {
+ if (fill_ace_qos.fill_simplex_sender_qos (*ace_qos,
+ ace_flow_spec) !=0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to fill simplex sender qos\n"),
+ -1);
+ else
+ {
+ if( TAO_debug_level > 0 )
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) Filled up the Sender QoS parameters\n"));
+ }
+ }
+ else if (this->qos_session_->flags () == ACE_QoS_Session::ACE_QOS_RECEIVER)
+ {
+ if (fill_ace_qos.fill_simplex_receiver_qos (*ace_qos,
+ ace_flow_spec) !=0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to fill simplex receiver qos\n"),
+ -1);
+ else
+ {
+ if( TAO_debug_level > 0 )
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) Filled up the Receiver QoS parameters\n"));
+ }
+
+ }
+
+ ACE_QoS_Params qos_params;
+ FillQoSParams (qos_params,
+ 0,
+ ace_qos);
+ }
+
+ ACE_QoS_Manager qos_manager =
+ this->get_socket ()->qos_manager ();
+
+ int result = this->qos_session_->qos (this->get_socket (),
+ &qos_manager,
+ *ace_qos);
+ if (result != 0)
+ return result;
+
+ return 0;
+}
+
+int
+TAO_AV_UDP_QoS_Flow_Handler::handle_timeout (const ACE_Time_Value &tv,
+ const void *arg)
+{
+ return TAO_AV_Flow_Handler::handle_timeout (tv,arg);
+}
+
+int
+TAO_AV_UDP_QoS_Flow_Handler::set_remote_address (ACE_Addr *address)
+{
+
+ if (TAO_debug_level > 0)
+ {
+ char buf [BUFSIZ];
+ ACE_INET_Addr *remote_addr = dynamic_cast<ACE_INET_Addr*> (address);
+ remote_addr->addr_to_string (buf,
+ BUFSIZ);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) TAO_AV_UDP_QoS_Flow_Handler::set_remote_address %s\n",
+ buf));
+ }
+
+
+ ACE_INET_Addr *inet_addr =
+ dynamic_cast<ACE_INET_Addr*> (address);
+
+ this->peer_addr_ = *inet_addr;
+
+ TAO_AV_UDP_QoS_Transport *transport =
+ dynamic_cast<TAO_AV_UDP_QoS_Transport*> (this->transport_);
+
+ if (this->entry_->role () == TAO_FlowSpec_Entry::TAO_AV_PRODUCER)
+ {
+
+ TAO_AV_UDP_QoS_Session_Helper helper;
+
+ this->qos_session_ = helper.open_qos_session (this,
+ *inet_addr);
+
+ if (this->qos_session_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "QoS Session Open Failed (%N|%l)\n"),
+ -1);
+
+ ACE_INET_Addr local_addr;
+ this->get_socket ()->get_local_addr (local_addr);
+
+ ACE_INET_Addr* src_addr;
+ ACE_NEW_RETURN (src_addr,
+ ACE_INET_Addr (local_addr.get_port_number (),
+ local_addr.get_host_name ()),
+ -1);
+
+ this->qos_session_->source_addr (src_addr);
+
+ if (helper.activate_qos_handler (this->qos_session_,
+ this) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Activating QoS Handler Failed (%N|%l)\n"),
+ -1);
+ }
+ return transport->set_remote_address (*inet_addr);
+}
+
+
+ACE_HANDLE
+TAO_AV_UDP_QoS_Flow_Handler::get_handle (void) const
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) TAO_AV_UDP_QoS_Flow_Handler::get_handle:%d\n",
+ this->qos_sock_dgram_.get_handle ()));
+
+ return this->qos_sock_dgram_.get_handle () ;
+}
+
+//------------------------------------------------------------
+// TAO_AV_UDP_Transport
+//------------------------------------------------------------
+
+TAO_AV_UDP_QoS_Transport::TAO_AV_UDP_QoS_Transport (void)
+ :handler_ (0)
+{
+}
+
+TAO_AV_UDP_QoS_Transport::TAO_AV_UDP_QoS_Transport (TAO_AV_UDP_QoS_Flow_Handler *handler)
+ :handler_ (handler),
+ addr_ (0)
+{
+}
+
+TAO_AV_UDP_QoS_Transport::~TAO_AV_UDP_QoS_Transport (void)
+{
+}
+
+int
+TAO_AV_UDP_QoS_Transport::set_remote_address (const ACE_INET_Addr &address)
+{
+ this->peer_addr_ = address;
+ return 0;
+}
+
+int
+TAO_AV_UDP_QoS_Transport::open (ACE_Addr * /*address*/)
+{
+ return 0;
+}
+
+int
+TAO_AV_UDP_QoS_Transport::close (void)
+{
+ return 0;
+}
+
+int
+TAO_AV_UDP_QoS_Transport::mtu (void)
+{
+ return ACE_MAX_DGRAM_SIZE;
+}
+
+ACE_Addr*
+TAO_AV_UDP_QoS_Transport::get_peer_addr (void)
+{
+ return &this->peer_addr_;
+}
+
+ssize_t
+TAO_AV_UDP_QoS_Transport::send (const ACE_Message_Block *mblk,
+ ACE_Time_Value *)
+{
+ // For the most part this was copied from GIOP::send_request and
+ // friends.
+
+ iovec iov[IOV_MAX];
+ int iovcnt = 0;
+ ssize_t n = 0;
+ ssize_t nbytes = 0;
+
+ for (const ACE_Message_Block *i = mblk;
+ i != 0;
+ i = i->cont ())
+ {
+ // Make sure there is something to send!
+ if (i->length () > 0)
+ {
+ iov[iovcnt].iov_base = i->rd_ptr ();
+ iov[iovcnt].iov_len = static_cast<u_long> (i->length ());
+ iovcnt++;
+
+ // The buffer is full make a OS call. @@ TODO this should
+ // be optimized on a per-platform basis, for instance, some
+ // platforms do not implement writev() there we should copy
+ // the data into a buffer and call send_n(). In other cases
+ // there may be some limits on the size of the iovec, there
+ // we should set IOV_MAX to that limit.
+
+ size_t bytes_sent = 0;
+
+ if (iovcnt == IOV_MAX)
+ {
+ if (this->handler_->get_socket ()->send (iov,
+ 1,
+ bytes_sent,
+ 0,
+ this->handler_->qos_session ()->dest_addr (),
+ 0,
+ 0) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error in dgram_mcast.send () (%N|%l)\n"),
+ -1);
+ else
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Using ACE_OS::sendto () : Bytes sent : %d",
+ bytes_sent));
+
+ if (n < 1)
+ return n;
+
+ nbytes += bytes_sent;
+ iovcnt = 0;
+ }
+ }
+ }
+
+ size_t bytes_sent = 0;
+
+ // Check for remaining buffers to be sent!
+ if (iovcnt != 0)
+ {
+ if (this->handler_->get_socket ()->send (iov,
+ 1,
+ bytes_sent,
+ 0,
+ this->handler_->qos_session ()->dest_addr (),
+ 0,
+ 0) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error in dgram_mcast.send ()\n"),
+ -1);
+ else
+ if( TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) Using ACE_OS::sendto () : Bytes sent : %d",
+ bytes_sent));
+
+ if (n < 1)
+ return n;
+
+ nbytes += bytes_sent;
+ }
+
+ return nbytes;
+}
+
+ssize_t
+TAO_AV_UDP_QoS_Transport::send (const char *buf,
+ size_t len,
+ ACE_Time_Value *)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) TAO_AV_UDP_QoS_Transport::send "));
+
+ char addr [BUFSIZ];
+ this->peer_addr_.addr_to_string (addr,BUFSIZ);
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) to %s\n",
+ addr));
+
+ return this->handler_->get_socket ()->send (buf,
+ len,
+ this->handler_->qos_session ()->dest_addr (),
+ 0,
+ 0,
+ 0);
+}
+
+ssize_t
+TAO_AV_UDP_QoS_Transport::send (const iovec *iov,
+ int /*iovcnt*/,
+ ACE_Time_Value *)
+{
+ size_t bytes_sent = 0;
+ if (this->handler_->get_socket ()->send (iov,
+ 1,
+ bytes_sent,
+ 0,
+ this->handler_->qos_session ()->dest_addr (),
+ 0,
+ 0) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error in dgram_mcast.send ()\n"),
+ -1);
+ else
+ {
+ if( TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) Using ACE_OS::sendto () : Bytes sent : %d",
+ bytes_sent));
+ }
+
+
+ return bytes_sent;
+}
+
+ssize_t
+TAO_AV_UDP_QoS_Transport::recv (char *buf,
+ size_t len,
+ ACE_Time_Value *)
+{
+ return this->handler_->get_socket ()->recv (buf, len,this->peer_addr_);
+}
+
+ssize_t
+TAO_AV_UDP_QoS_Transport::recv (char *buf,
+ size_t len,
+ int flags,
+ ACE_Time_Value *timeout)
+{
+ return this->handler_->get_socket ()->recv (buf,
+ len,
+ this->peer_addr_,
+ flags,
+ timeout);
+}
+
+ssize_t
+TAO_AV_UDP_QoS_Transport::recv (iovec *iov,
+ int /*iovcnt*/,
+ ACE_Time_Value *timeout)
+{
+ return handler_->get_socket ()->recv (iov,this->peer_addr_,0,timeout);
+}
+
+
+//------------------------------------------------------------
+// TAO_AV_UDP_Acceptor
+//------------------------------------------------------------
+
+TAO_AV_UDP_QoS_Acceptor::TAO_AV_UDP_QoS_Acceptor (void)
+{
+}
+
+TAO_AV_UDP_QoS_Acceptor::~TAO_AV_UDP_QoS_Acceptor (void)
+{
+}
+
+int
+TAO_AV_UDP_QoS_Acceptor::activate_svc_handler (TAO_AV_UDP_QoS_Flow_Handler *handler)
+{
+ int result = 0;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) Acceptor Svc Handler QOS ENABLED \n"));
+
+ TAO_AV_UDP_QoS_Session_Helper helper;
+
+ result = helper.activate_qos_handler (handler->qos_session (),
+ handler);
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error in registering the Decorator with the Reactor\n"),
+ -1);
+
+ return result;
+}
+
+int
+TAO_AV_UDP_QoS_Acceptor::open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp)
+{
+ ACE_UNUSED_ARG (flow_comp);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) TAO_AV_UDP_QoS_Acceptor::open "));
+
+ this->av_core_ = av_core;
+ this->endpoint_ = endpoint;
+ this->entry_ = entry;
+
+
+ this->flow_protocol_factory_ = factory;
+ this->flowname_ = entry->flowname ();
+ ACE_INET_Addr *inet_addr = (ACE_INET_Addr *) entry->address ();
+// inet_addr->set (inet_addr->get_port_number (),
+// inet_addr->get_host_name ());
+ char buf[BUFSIZ];
+ inet_addr->addr_to_string (buf,
+ BUFSIZ);
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) TAO_AV_UDP_QoS_Acceptor::open: %s",
+ buf));
+
+ int result = this->open_i (inet_addr);
+
+ if (result < 0)
+ return result;
+
+ return 0;
+}
+
+int
+TAO_AV_UDP_QoS_Acceptor::open_default (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp)
+{
+ ACE_UNUSED_ARG (flow_comp);
+
+ this->av_core_ = av_core;
+ this->endpoint_ = endpoint;
+ this->entry_ = entry;
+ this->flow_protocol_factory_ = factory;
+ this->flowname_ = entry->flowname ();
+ char buf [BUFSIZ];
+ ACE_OS::hostname (buf,
+ BUFSIZ);
+ qos_acceptor_addr_.set((u_short)0, buf);
+/* ACE_INET_Addr *address;
+ ACE_NEW_RETURN (address,
+ ACE_INET_Addr ("0"),
+ -1);
+
+ address->addr_to_string (buf,
+ BUFSIZ);*/
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) ADDRESS IS %s:%d\n",
+ buf, qos_acceptor_addr_.get_port_number() ));
+
+ int result = this->open_i (&qos_acceptor_addr_);
+ if (result < 0)
+ return result;
+ return 0;
+}
+
+
+int
+TAO_AV_UDP_QoS_Acceptor::open_i (ACE_INET_Addr *inet_addr)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ int result = 0;
+
+ // TAO_AV_Callback *callback = 0;
+ // this->endpoint_->get_callback (this->flowname_.c_str (),
+ // callback);
+ ACE_INET_Addr *local_addr;
+
+ ACE_NEW_RETURN (local_addr,
+ ACE_INET_Addr (*inet_addr),
+ -1);
+
+ ACE_QoS_Params qos_params;
+
+ ACE_QoS* ace_qos = 0;
+
+ FillQoSParams (qos_params,
+ 0,
+ ace_qos);
+
+
+ TAO_AV_UDP_QoS_Flow_Handler* handler;
+ ACE_NEW_RETURN (handler,
+ TAO_AV_UDP_QoS_Flow_Handler,
+ -1);
+
+
+ TAO_AV_Flow_Handler *flow_handler = 0;
+ flow_handler = handler;
+
+ handler->endpoint (this->endpoint_);
+ handler->flowspec_entry (this->entry_);
+ handler->av_core (this->av_core_);
+
+ if (this->entry_->role () == TAO_FlowSpec_Entry::TAO_AV_CONSUMER)
+ {
+
+ TAO_AV_UDP_QoS_Session_Helper helper;
+
+ int result = handler->get_socket ()->open (*inet_addr,
+ qos_params,
+ AF_INET,
+ 0,
+ 0,
+ 0,
+ ACE_OVERLAPPED_SOCKET_FLAG
+ | ACE_FLAG_MULTIPOINT_C_LEAF
+ | ACE_FLAG_MULTIPOINT_D_LEAF,
+ 1);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_AV_QOS_UDP_MCast_Acceptor data socket open failed (%N|%l)\n"),
+ -1);
+
+ result = handler->get_socket ()->get_local_addr (*local_addr);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error in getting Local Address (%N|%l)\n"),
+ -1);
+
+ // Create a destination address for the QoS session. The same
+ // address should be used for the subscribe call later. A copy
+ // is made below only to distinguish the two usages of the dest
+ // address.
+ ACE_INET_Addr dest_addr;
+ dest_addr.set (local_addr->get_port_number (),
+ local_addr->get_host_name ());
+
+ char dest_buf [BUFSIZ];
+ dest_addr.addr_to_string (dest_buf,
+ BUFSIZ);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Session Address is %s\n",
+ dest_buf));
+
+ this->qos_session_ = helper.open_qos_session (handler,
+ dest_addr);
+
+ if (this->qos_session_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "QoS Session Open Failed (%N|%l)\n"),
+ -1);
+
+ handler->qos_session (this->qos_session_);
+
+ if (this->activate_svc_handler (handler) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Activate Svc Handler Failed (%N|%l)\n"),
+ -1);
+
+ AVStreams::QoS qos;
+ int qos_available = this->endpoint_->qos ().get_flow_qos (this->flowname_.c_str (),
+ qos);
+
+ if (qos_available == 0)
+ {
+
+ ACE_Flow_Spec *ace_flow_spec = 0;
+ ACE_NEW_RETURN (ace_flow_spec,
+ ACE_Flow_Spec,
+ -1);
+
+ handler->translate (qos.QoSParams,
+ ace_flow_spec);
+
+ if (helper.set_qos (*ace_flow_spec,
+ handler) == -1)
+
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Set QoS Failed (%N|%l)\n"),
+ -1);
+ }
+ }
+ else
+ {
+
+ int result = handler->get_socket ()->open (*inet_addr,
+ qos_params,
+ AF_INET,
+ 0,
+ 0,
+ 0,
+ ACE_OVERLAPPED_SOCKET_FLAG
+ | ACE_FLAG_MULTIPOINT_C_LEAF
+ | ACE_FLAG_MULTIPOINT_D_LEAF,
+ 1);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_AV_QOS_UDP_MCast_Acceptor data socket open failed (%N|%l)\n"),
+ -1);
+ }
+
+ TAO_AV_Protocol_Object *object =
+ this->flow_protocol_factory_->make_protocol_object (this->entry_,
+ this->endpoint_,
+ flow_handler,
+ flow_handler->transport ());
+ flow_handler->protocol_object (object);
+
+ AVStreams::Negotiator_ptr negotiator;
+
+ ACE_TRY_EX (negotiator)
+ {
+ CORBA::Any_ptr negotiator_any =
+ this->endpoint_->get_property_value ("Negotiator"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (negotiator);
+
+ *negotiator_any >>= negotiator;
+ handler->negotiator (negotiator);
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) Negotiator Not Found \n"));
+ }
+ ACE_ENDTRY;
+
+ this->endpoint_->set_flow_handler (this->flowname_.c_str (),flow_handler);
+ this->entry_->protocol_object (object);
+
+ result = handler->get_socket ()->get_local_addr (*local_addr);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_Dgram_Connector::open: get_local_addr failed\n"),result);
+ local_addr->set (local_addr->get_port_number (),
+ local_addr->get_host_name ());
+
+ if (TAO_debug_level > 0)
+ {
+ char buf [BUFSIZ];
+ local_addr->addr_to_string (buf,
+ BUFSIZ);
+ ACE_DEBUG ((LM_DEBUG,
+ "Local Address is %s\n",
+ buf));
+ }
+
+ this->entry_->set_local_addr (local_addr);
+ this->entry_->handler (flow_handler);
+
+ return 0;
+
+}
+
+int
+TAO_AV_UDP_QoS_Acceptor::close (void)
+{
+ return 0;
+}
+
+//------------------------------------------------------------
+// TAO_AV_UDP_Connector
+//------------------------------------------------------------
+TAO_AV_UDP_QoS_Connector::TAO_AV_UDP_QoS_Connector (void)
+{
+}
+
+TAO_AV_UDP_QoS_Connector::~TAO_AV_UDP_QoS_Connector (void)
+{
+}
+
+int
+TAO_AV_UDP_QoS_Connector::open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_AV_Flow_Protocol_Factory *factory)
+
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_UDP_QoS_Connector::open "));
+
+ this->endpoint_ = endpoint;
+ this->av_core_ = av_core;
+ this->flow_protocol_factory_ = factory;
+ return 0;
+}
+
+// int
+// TAO_AV_UDP_QoS_Connector::translate (CosPropertyService::Properties &qos_params,
+// ACE_Flow_Spec *ace_flow_spec)
+// {
+// for (unsigned int i = 0;
+// i < qos_params.length ();
+// i++)
+// {
+// if (ACE_OS::strcmp (qos_params [i].property_name, "Service_Type") == 0)
+// {
+// CORBA::Short type;
+// qos_params [i].property_value >>= type;
+// ace_flow_spec->service_type (type);
+// }
+// else if (ACE_OS::strcmp (qos_params [i].property_name, "Token_Rate") == 0)
+// {
+// CORBA::ULong tok_rate;
+// qos_params [i].property_value >>= tok_rate;
+// ace_flow_spec->token_rate (tok_rate);
+// }
+// else if (ACE_OS::strcmp (qos_params [i].property_name, "Token_Bucket_Rate") == 0)
+// {
+// CORBA::ULong tok_buck_size;
+// qos_params [i].property_value >>= tok_buck_size;
+// ace_flow_spec->token_bucket_size (tok_buck_size);
+// }
+// else if (ACE_OS::strcmp (qos_params [i].property_name, "Peak_Bandwidth") == 0)
+// {
+// CORBA::ULong peak_bw;
+// qos_params [i].property_value >>= peak_bw;
+// ace_flow_spec->peak_bandwidth (peak_bw);
+// }
+// else if (ACE_OS::strcmp (qos_params [i].property_name, "Latency") == 0)
+// {
+// CORBA::ULong lat;
+// qos_params [i].property_value >>= lat;
+// ace_flow_spec->latency (lat);
+// }
+// else if (ACE_OS::strcmp (qos_params [i].property_name, "Delay_Variation") == 0)
+// {
+// CORBA::ULong delay_var;
+// qos_params [i].property_value >>= delay_var;
+// ace_flow_spec->delay_variation (delay_var);
+// }
+
+// }
+
+// return 0;
+// }
+
+
+int
+TAO_AV_UDP_QoS_Connector::connect (TAO_FlowSpec_Entry *entry,
+ TAO_AV_Transport *&transport,
+ TAO_AV_Core::Flow_Component flow_comp)
+{
+ ACE_UNUSED_ARG (flow_comp);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ int result = 0;
+ this->entry_ = entry;
+ this->flowname_ = entry->flowname ();
+
+ ACE_INET_Addr *local_addr;
+
+ if (entry->get_peer_addr () != 0)
+ {
+ local_addr = dynamic_cast<ACE_INET_Addr*> (entry->get_peer_addr ());
+ }
+ else
+ ACE_NEW_RETURN (local_addr,
+ ACE_INET_Addr ("0"),
+ -1);
+
+ TAO_AV_Flow_Handler *flow_handler = 0;
+
+ TAO_AV_UDP_QoS_Flow_Handler *handler;
+ ACE_NEW_RETURN (handler,
+ TAO_AV_UDP_QoS_Flow_Handler,
+ -1);
+
+ flow_handler = handler;
+
+ handler->endpoint (this->endpoint_);
+ handler->flowspec_entry (this->entry_);
+ handler->av_core (this->av_core_);
+
+ ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (entry->address ());
+
+ ACE_QoS_Params qos_params;
+
+ ACE_QoS* ace_qos = 0;
+
+ FillQoSParams (qos_params,
+ 0,
+ ace_qos);
+
+ result = handler->get_socket ()->open (*local_addr,
+ qos_params,
+ AF_INET,
+ 0,
+ 0,
+ 0,
+ ACE_OVERLAPPED_SOCKET_FLAG
+ | ACE_FLAG_MULTIPOINT_C_LEAF
+ | ACE_FLAG_MULTIPOINT_D_LEAF,
+ 1);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Data socket open failed (%N|%l)\n"),
+ -1);
+
+ result = handler->get_socket ()->get_local_addr (*local_addr);
+
+
+ ACE_INET_Addr *session_addr = 0;
+ if (this->entry_->role () == TAO_FlowSpec_Entry::TAO_AV_CONSUMER)
+ {
+ ACE_NEW_RETURN (session_addr,
+ ACE_INET_Addr,
+ -1);
+
+ session_addr->set (local_addr->get_port_number (),
+ local_addr->get_host_name ());
+
+ }
+ else
+ {
+ session_addr = inet_addr;
+ }
+
+ char sess_buf [BUFSIZ];
+ session_addr->addr_to_string (sess_buf,
+ BUFSIZ);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Session Address is %s\n",
+ sess_buf));
+
+ // Create a destination address for the QoS session. The same
+ // address should be used for the subscribe call later. A copy
+ // is made below only to distinguish the two usages of the dest
+ // address.
+ ACE_INET_Addr dest_addr (*session_addr);
+
+ TAO_AV_UDP_QoS_Session_Helper helper;
+
+ this->qos_session_ = helper.open_qos_session (handler,
+ *session_addr);
+
+ if (this->qos_session_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "QoS Session Open Failed (%N|%l)\n"),
+ -1);
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "QoS session opened successfully\n"));
+
+ if (this->entry_->role () == TAO_FlowSpec_Entry::TAO_AV_PRODUCER)
+ {
+ //this->qos_session_->source_port (local_addr->get_port_number ());
+ ACE_INET_Addr* src_addr;
+ ACE_NEW_RETURN (src_addr,
+ ACE_INET_Addr (local_addr->get_port_number (),
+ local_addr->get_host_name ()),
+ -1);
+
+ this->qos_session_->source_addr (src_addr);
+
+ }
+
+ handler->qos_session (this->qos_session_);
+
+ this->qos_manager_ =
+ handler->get_socket ()->qos_manager ();
+
+ AVStreams::QoS qos;
+
+ int qos_available = this->endpoint_->qos ().get_flow_qos (this->flowname_.c_str (),
+ qos);
+ if (qos_available == 0)
+ {
+
+ ACE_Flow_Spec* ace_flow_spec;
+ ACE_NEW_RETURN (ace_flow_spec,
+ ACE_Flow_Spec,
+ -1);
+
+ handler->translate (qos.QoSParams,
+ ace_flow_spec);
+
+ if (helper.set_qos (*ace_flow_spec,
+ handler) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to set QoS (%N|%l)\n"),
+ -1);
+ else
+ {
+ if( TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) Setting QOS succeeds.\n"));
+ }
+ }
+
+ TAO_AV_Protocol_Object *object =
+ this->flow_protocol_factory_->make_protocol_object (this->entry_,
+ this->endpoint_,
+ flow_handler,
+ flow_handler->transport ());
+
+ AVStreams::Negotiator_ptr negotiator;
+
+ ACE_TRY_EX (negotiator)
+ {
+ CORBA::Any_ptr negotiator_any =
+ this->endpoint_->get_property_value ("Negotiator"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (negotiator);
+
+ *negotiator_any >>= negotiator;
+ handler->negotiator (negotiator);
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Negotiator not found for flow %s\n",
+ this->entry_->flowname ()));
+ }
+ ACE_ENDTRY;
+
+ flow_handler->protocol_object (object);
+
+ this->endpoint_->set_flow_handler (this->flowname_.c_str (),flow_handler);
+ this->entry_->protocol_object (object);
+
+ result = handler->get_socket ()->get_local_addr (*local_addr);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Get local addr failed (%N|%l)\n"),
+ result);
+
+ local_addr->set (local_addr->get_port_number (),
+ local_addr->get_host_name ());
+
+ if (TAO_debug_level > 0)
+ {
+ char buf[BUFSIZ];
+ local_addr->addr_to_string (buf,
+ BUFSIZ);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Local Address is %s\n",
+ buf));
+ }
+
+ entry->set_local_addr (local_addr);
+ entry->handler (flow_handler);
+ transport = flow_handler->transport ();
+
+ // call activate svc handler.
+ return this->activate_svc_handler (handler);
+}
+
+int
+TAO_AV_UDP_QoS_Connector::activate_svc_handler (TAO_AV_UDP_QoS_Flow_Handler *handler)
+{
+ int result = 0;
+
+ TAO_AV_UDP_QoS_Session_Helper helper;
+
+ result = helper.activate_qos_handler (this->qos_session_,
+ handler);
+
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N,%l) Error in registering the Decorator with the Reactor\n"),
+ -1);
+
+ return result;
+}
+
+int
+TAO_AV_UDP_QoS_Connector::close (void)
+{
+ return 0;
+}
+
+//------------------------------------------------------------
+// TAO_AV_UDP_Protocol_Factory
+//------------------------------------------------------------
+
+TAO_AV_UDP_QoS_Factory::TAO_AV_UDP_QoS_Factory (void)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_UDP_QoS_Factory::TAO_AV_UDP_QoS_Factory\n"));
+}
+
+TAO_AV_UDP_QoS_Factory::~TAO_AV_UDP_QoS_Factory (void)
+{
+}
+
+int
+TAO_AV_UDP_QoS_Factory::match_protocol (const char *protocol_string)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_UDP_QoS_Factory::match_protocol\n"));
+
+ if (ACE_OS::strcasecmp (protocol_string,"QoS_UDP") == 0)
+ return 1;
+ return 0;
+}
+
+TAO_AV_Acceptor*
+TAO_AV_UDP_QoS_Factory::make_acceptor (void)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_UDP_QoS_Factory::make_acceptor "));
+
+ TAO_AV_Acceptor *acceptor = 0;
+ ACE_NEW_RETURN (acceptor,
+ TAO_AV_UDP_QoS_Acceptor,
+ 0);
+ return acceptor;
+}
+
+TAO_AV_Connector*
+TAO_AV_UDP_QoS_Factory::make_connector (void)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_UDP_QoS_Factory::make_connector "));
+
+ TAO_AV_Connector *connector = 0;
+ ACE_NEW_RETURN (connector,
+ TAO_AV_UDP_QoS_Connector,
+ 0);
+ return connector;
+}
+
+int
+TAO_AV_UDP_QoS_Factory::init (int /* argc */,
+ char * /* argv */ [])
+{
+ return 0;
+}
+
+
+//------------------------------------------------------------
+// TAO_AV_UDP_Flow_Factory
+//------------------------------------------------------------
+TAO_AV_UDP_QoS_Flow_Factory::TAO_AV_UDP_QoS_Flow_Factory (void)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_UDP_QoS_Flow_Factory::TAO_AV_UDP_QoS_Flow_Factory\n"));
+}
+
+TAO_AV_UDP_QoS_Flow_Factory::~TAO_AV_UDP_QoS_Flow_Factory (void)
+{
+}
+
+int
+TAO_AV_UDP_QoS_Flow_Factory::init (int /* argc */,
+ char * /* argv */ [])
+{
+ return 0;
+}
+
+int
+TAO_AV_UDP_QoS_Flow_Factory::match_protocol (const char *flow_string)
+{
+ if (ACE_OS::strcasecmp (flow_string,"QoS_UDP") == 0)
+ return 1;
+ return 0;
+}
+
+TAO_AV_Protocol_Object*
+TAO_AV_UDP_QoS_Flow_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);
+
+
+ TAO_AV_UDP_Object *object = 0;
+ ACE_NEW_RETURN (object,
+ TAO_AV_UDP_Object (callback,
+ transport),
+ 0);
+ callback->open (object,
+ handler);
+ endpoint->set_protocol_object (entry->flowname (),
+ object);
+ return object;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_AV, TAO_AV_UDP_QoS_Flow_Factory)
+ACE_STATIC_SVC_DEFINE (TAO_AV_UDP_QoS_Flow_Factory,
+ ACE_TEXT ("UDP_QoS_Flow_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_AV_UDP_QoS_Flow_Factory),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+ACE_FACTORY_DEFINE (TAO_AV, TAO_AV_UDP_QoS_Factory)
+
+ACE_STATIC_SVC_DEFINE (TAO_AV_UDP_QoS_Factory,
+ ACE_TEXT ("UDP_QoS_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_AV_UDP_QoS_Factory),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+#endif /* ACE_HAS_RAPI || ACE_HAS_WINSOCK2_GQOS */
diff --git a/TAO/orbsvcs/orbsvcs/AV/QoS_UDP.h b/TAO/orbsvcs/orbsvcs/AV/QoS_UDP.h
new file mode 100644
index 00000000000..7100217f263
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/QoS_UDP.h
@@ -0,0 +1,306 @@
+// -*- C++ -*-
+
+// $Id$
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS AVStreams
+//
+// = FILENAME
+// UDP.h
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_AV_QOS_UDP_H
+#define TAO_AV_QOS_UDP_H
+#include /**/ "ace/pre.h"
+
+
+#include "ace/config-all.h"
+
+#if defined (ACE_HAS_RAPI) || defined (ACE_HAS_WINSOCK2_GQOS)
+
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+#include "ace/OS.h"
+#include "ace/Service_Config.h"
+#include "ace/QoS/QoS_Session_Factory.h"
+#include "ace/QoS/QoS_Decorator.h"
+#include "ace/QoS/SOCK_Dgram_Mcast_QoS.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_AV_Export TAO_AV_UDP_QoS_Factory : public TAO_AV_Transport_Factory
+{
+public:
+ TAO_AV_UDP_QoS_Factory (void);
+ virtual ~TAO_AV_UDP_QoS_Factory (void);
+ virtual int init (int argc, char *argv[]);
+ // Initialization hook.
+ virtual int match_protocol (const char *protocol_string);
+ virtual TAO_AV_Acceptor *make_acceptor (void);
+ virtual TAO_AV_Connector *make_connector (void);
+};
+
+class TAO_AV_UDP_QoS_Flow_Handler;
+
+/**
+ * @class TAO_AV_UDP_QoS_Transport
+ *
+ * @brief A transport abstraction for udp sockets.
+ *
+ * Uses the ACE_SOCK_Dgram to send the data.
+ */
+class TAO_AV_UDP_QoS_Transport
+ :public TAO_AV_Transport
+{
+public:
+ TAO_AV_UDP_QoS_Transport (void);
+
+ TAO_AV_UDP_QoS_Transport (TAO_AV_UDP_QoS_Flow_Handler *handler);
+
+ virtual ~TAO_AV_UDP_QoS_Transport (void);
+
+ virtual int open (ACE_Addr *addr);
+
+ virtual int close (void);
+
+ virtual int mtu (void);
+
+ virtual ACE_Addr *get_peer_addr (void);
+
+ virtual int set_remote_address (const ACE_INET_Addr &address);
+
+ /// Write the complete Message_Block chain to the connection.
+ virtual ssize_t send (const ACE_Message_Block *mblk,
+ ACE_Time_Value *s = 0);
+
+ /// Write the contents of the buffer of length len to the connection.
+ virtual ssize_t send (const char *buf,
+ size_t len,
+ ACE_Time_Value *s = 0);
+
+ /// Write the contents of iovcnt iovec's to the connection.
+ virtual ssize_t send (const iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *s = 0);
+
+ /// Read len bytes from into buf.
+ virtual ssize_t recv (char *buf,
+ size_t len,
+ ACE_Time_Value *s = 0);
+
+ /// Read len bytes from into buf using flags.
+ virtual ssize_t recv (char *buf,
+ size_t len,
+ int flags,
+ ACE_Time_Value *s = 0);
+
+ /// Read received data into the iovec buffers.
+ virtual ssize_t recv (iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *s = 0);
+protected:
+ TAO_AV_UDP_QoS_Flow_Handler *handler_;
+ ACE_Addr *addr_;
+ ACE_INET_Addr peer_addr_;
+};
+
+class TAO_AV_UDP_QoS_Flow_Handler
+ :public virtual TAO_AV_Flow_Handler,
+ public virtual ACE_Event_Handler
+{
+public:
+ /// Constructor.
+ TAO_AV_UDP_QoS_Flow_Handler (void);
+ /// Destructor.
+ ~TAO_AV_UDP_QoS_Flow_Handler (void);
+ int open (ACE_Addr &address);
+ virtual TAO_AV_Transport *transport (void);
+ virtual int set_remote_address (ACE_Addr *address);
+ virtual ACE_HANDLE get_handle (void) const;
+ virtual int handle_input (ACE_HANDLE fd);
+ virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg = 0);
+ virtual int change_qos (AVStreams::QoS);
+ /// Handles a QoS event. Right now, just
+ /// prints a message.
+ virtual int handle_qos (ACE_HANDLE fd);
+ ACE_SOCK_Dgram_Mcast_QoS *get_socket (void);
+ virtual ACE_Event_Handler* event_handler (void){ return this; }
+ virtual ACE_QoS_Session* qos_session (void);
+ virtual void qos_session (ACE_QoS_Session *qos_session);
+
+ int translate (ACE_Flow_Spec *ace_flow_spec,
+ CosPropertyService::Properties &qos_params);
+ int translate (CosPropertyService::Properties &qos_params,
+ ACE_Flow_Spec *ace_flow_spec);
+
+ void negotiator (AVStreams::Negotiator_ptr);
+
+ void endpoint (TAO_Base_StreamEndPoint *endpoint);
+ TAO_Base_StreamEndPoint* endpoint (void);
+
+ void flowspec_entry (TAO_FlowSpec_Entry *entry);
+ TAO_FlowSpec_Entry* flowspec_entry (void);
+
+ void av_core (TAO_AV_Core *avcore);
+ TAO_AV_Core* av_core (void);
+
+protected:
+ TAO_AV_Core *av_core_;
+ ACE_INET_Addr peer_addr_;
+ ACE_SOCK_Dgram_Mcast_QoS qos_sock_dgram_;
+ ACE_QoS_Session *qos_session_;
+ TAO_FlowSpec_Entry *entry_;
+ TAO_Base_StreamEndPoint *endpoint_;
+ AVStreams::Negotiator_ptr negotiator_;
+};
+
+class TAO_AV_UDP_QoS_Acceptor
+ :public TAO_AV_Acceptor
+{
+public:
+ TAO_AV_UDP_QoS_Acceptor (void);
+ virtual ~TAO_AV_UDP_QoS_Acceptor (void);
+ virtual int open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp =
+ TAO_AV_Core::TAO_AV_DATA);
+
+ virtual int open_default (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp =
+ TAO_AV_Core::TAO_AV_DATA);
+
+ virtual int open_i (ACE_INET_Addr *address);
+
+ virtual int close (void);
+
+ virtual int activate_svc_handler (TAO_AV_UDP_QoS_Flow_Handler *handler);
+
+
+protected:
+ TAO_Base_StreamEndPoint *endpoint_;
+ TAO_FlowSpec_Entry *entry_;
+ TAO_AV_Flow_Protocol_Factory *flow_protocol_factory_;
+ ACE_QoS_Session *qos_session_;
+ ACE_QoS_Manager qos_manager_;
+ ACE_INET_Addr qos_acceptor_addr_;
+};
+
+class TAO_AV_UDP_QoS_Connector
+ :public TAO_AV_Connector
+{
+public:
+ TAO_AV_UDP_QoS_Connector (void);
+ ~TAO_AV_UDP_QoS_Connector (void);
+ virtual int open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_AV_Flow_Protocol_Factory *factory);
+
+ virtual int connect (TAO_FlowSpec_Entry *entry,
+ TAO_AV_Transport *&transport,
+ TAO_AV_Core::Flow_Component flow_comp =
+ TAO_AV_Core::TAO_AV_DATA);
+ virtual int activate_svc_handler (TAO_AV_UDP_QoS_Flow_Handler *handler);
+ virtual int close (void);
+
+ int translate (CosPropertyService::Properties &qos_params,
+ ACE_Flow_Spec *ace_flow_spec);
+
+protected:
+ TAO_Base_StreamEndPoint *endpoint_;
+ TAO_AV_Core *av_core_;
+ TAO_FlowSpec_Entry *entry_;
+ TAO_AV_Flow_Protocol_Factory *flow_protocol_factory_;
+ ACE_QoS_Session *qos_session_;
+ ACE_QoS_Manager qos_manager_;
+};
+
+// class TAO_AV_Export TAO_AV_UDP_Object : public TAO_AV_Protocol_Object
+// {
+// public:
+// TAO_AV_UDP_Object (TAO_AV_Callback *callback,
+// TAO_AV_Transport *transport = 0);
+
+// virtual ~TAO_AV_UDP_Object (void);
+// // Dtor
+
+// virtual int handle_input (void);
+
+// virtual int send_frame (ACE_Message_Block *frame,
+// TAO_AV_frame_info *frame_info = 0);
+// // send a data frame.
+
+// virtual int send_frame (const iovec *iov,
+// int iovcnt,
+// TAO_AV_frame_info *frame_info = 0);
+
+// virtual int destroy (void);
+// // end the stream.
+
+// private:
+// ACE_Message_Block frame_;
+// // Pre-allocated memory to receive the data...
+// };
+
+class TAO_AV_UDP_QoS_Flow_Factory : public TAO_AV_Flow_Protocol_Factory
+{
+public:
+ TAO_AV_UDP_QoS_Flow_Factory (void);
+ virtual ~TAO_AV_UDP_QoS_Flow_Factory (void);
+ virtual int init (int argc, char *argv[]);
+ // Initialization hook.
+ virtual int match_protocol (const char *flow_string);
+ TAO_AV_Protocol_Object* make_protocol_object (TAO_FlowSpec_Entry *entry,
+ TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Flow_Handler *handler,
+ TAO_AV_Transport *transport);
+};
+
+/// Helper class to create qos sessions,
+/// activate qos handlers and set qos
+/// (For separation of concerns)
+class TAO_AV_UDP_QoS_Session_Helper
+{
+public:
+ TAO_AV_UDP_QoS_Session_Helper (void);
+ ~TAO_AV_UDP_QoS_Session_Helper (void);
+
+ /// Open a QoS Session with the specified address
+ ACE_QoS_Session* open_qos_session (TAO_AV_UDP_QoS_Flow_Handler *handler,
+ ACE_INET_Addr &addr);
+
+ /// Activate the QoS handler to receive QoS events
+ int activate_qos_handler (ACE_QoS_Session *qos_session,
+ TAO_AV_UDP_QoS_Flow_Handler *handler);
+
+ /// Set the required QoS for the session
+ int set_qos (ACE_Flow_Spec& ace_flow_spec,
+ TAO_AV_UDP_QoS_Flow_Handler *handler);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (TAO_AV_UDP_QoS_Flow_Factory)
+ACE_FACTORY_DECLARE (TAO_AV, TAO_AV_UDP_QoS_Flow_Factory)
+
+ACE_STATIC_SVC_DECLARE (TAO_AV_UDP_QoS_Factory)
+ACE_FACTORY_DECLARE (TAO_AV, TAO_AV_UDP_QoS_Factory)
+
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/AV/QoS_UDP.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* ACE_HAS_RAPI || ACE_HAS_WINSOCK2_GQOS */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_QOS_UDP_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/QoS_UDP.i b/TAO/orbsvcs/orbsvcs/AV/QoS_UDP.i
new file mode 100644
index 00000000000..9ae1b828b0f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/QoS_UDP.i
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//----------------------------------------------------------------------
+// TAO_AV_UDP_Flow_Handler
+//----------------------------------------------------------------------
+
+ACE_INLINE
+ACE_SOCK_Dgram_Mcast_QoS *
+TAO_AV_UDP_QoS_Flow_Handler::get_socket (void)
+{
+ return &this->qos_sock_dgram_;
+}
+
+ACE_INLINE
+int
+TAO_AV_UDP_QoS_Flow_Handler::open (ACE_Addr &address)
+{
+ // return this->qos_sock_dgram_.open (address);
+ ACE_UNUSED_ARG( address );
+ return 0;
+}
+
+ACE_INLINE ACE_QoS_Session*
+TAO_AV_UDP_QoS_Flow_Handler::qos_session (void)
+{
+ return this->qos_session_;
+}
+
+ACE_INLINE void
+TAO_AV_UDP_QoS_Flow_Handler::qos_session (ACE_QoS_Session *qos_session)
+{
+ this->qos_session_ = qos_session;
+}
+
+ACE_INLINE void
+TAO_AV_UDP_QoS_Flow_Handler::negotiator (AVStreams::Negotiator_ptr negotiator)
+{
+ this->negotiator_ = AVStreams::Negotiator::_duplicate (negotiator);
+}
+
+ACE_INLINE void
+TAO_AV_UDP_QoS_Flow_Handler::endpoint (TAO_Base_StreamEndPoint *endpoint)
+{
+ this->endpoint_ = endpoint;
+}
+
+ACE_INLINE TAO_Base_StreamEndPoint *
+TAO_AV_UDP_QoS_Flow_Handler::endpoint (void)
+{
+ return this->endpoint_;
+}
+
+ACE_INLINE void
+TAO_AV_UDP_QoS_Flow_Handler::flowspec_entry (TAO_FlowSpec_Entry *entry)
+{
+ this->entry_ = entry;
+}
+
+ACE_INLINE TAO_FlowSpec_Entry *
+TAO_AV_UDP_QoS_Flow_Handler::flowspec_entry (void)
+{
+ return this->entry_;
+}
+
+ACE_INLINE void
+TAO_AV_UDP_QoS_Flow_Handler::av_core (TAO_AV_Core *avcore)
+{
+ this->av_core_ = avcore;
+}
+
+ACE_INLINE TAO_AV_Core *
+TAO_AV_UDP_QoS_Flow_Handler::av_core (void)
+{
+ return this->av_core_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/README b/TAO/orbsvcs/orbsvcs/AV/README
new file mode 100644
index 00000000000..e3482716a80
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/README
@@ -0,0 +1,27 @@
+// $Id$
+
+TAO Audio/Video Streaming service
+---------------------------------
+
+
+This is a prototype implementation of the CORBA "Control and
+Management of A/V streams" specification, that defines various
+interfaces for controlling multimedia streams.
+
+This directory contains the following files
+
+AVStreams_i.{h,cpp}: Implementation of the A/V handshake specification, as well
+ as base classes for the various interfaces defined in the spec.
+
+Endpoint_Strategy.{h,cpp}: Implementation of various multimedia endpoint activation strategies.
+
+A complete distributed audio/video streaming application that
+illustrates the use of the various components defined above is
+available in the following directory:
+
+TAO/orbsvcs/tests/AVStreams/mpeg/source/
+
+
+Sumedh Mungee <sumedh@cs.wustl.edu>
+Nagarajan Surendran <naga@cs.wustl.edu>
+
diff --git a/TAO/orbsvcs/orbsvcs/AV/RTCP.cpp b/TAO/orbsvcs/orbsvcs/AV/RTCP.cpp
new file mode 100644
index 00000000000..e0466db3a3c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/RTCP.cpp
@@ -0,0 +1,826 @@
+/**
+ * Copyright (c) 1994-1995 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and the Network Research Group at
+ * Lawrence Berkeley Laboratory.
+ * 4. Neither the name of the University nor of the Laboratory may be used
+ * to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+// $Id$
+#include "orbsvcs/AV/ntp-time.h"
+#include "orbsvcs/AV/RTCP.h"
+#include "orbsvcs/AV/media_timer.h"
+#include "tao/debug.h"
+#include "orbsvcs/AV/global.h"
+#include "orbsvcs/AV/md5.h"
+
+#include "orbsvcs/AV/RTCP_Packet.h"
+#include "ace/OS_NS_time.h"
+#include "ace/OS_NS_strings.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int
+TAO_AV_RTCP_Callback::receive_control_frame (ACE_Message_Block *data,
+ const ACE_Addr &peer_address)
+{
+ int length = static_cast<int> (data->length ());
+ int more = length;
+ char *buf_ptr = data->rd_ptr ();
+ char first_rtcp_packet = 1;
+ RTCP_Channel_In *c;
+
+ // This code performs the RTCP Header validity checks detailed in RFC 1889
+ // Appendix A.2
+
+ while (more > 0)
+ {
+ // the second byte of the control packet is the type
+ switch ((unsigned char)buf_ptr[length - more + 1])
+ {
+ case RTCP_PT_SR:
+ {
+ RTCP_SR_Packet sr(&buf_ptr[length-more],
+ &more);
+
+ if (!sr.is_valid(first_rtcp_packet))
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_RTCP_Callback::receive_control_frame - "
+ "warning invalid rtcp packet\n"));
+
+ if (this->inputs_.find (sr.ssrc (), c) == -1)
+ {
+ ACE_NEW_RETURN (c,
+ RTCP_Channel_In (sr.ssrc (),
+ &peer_address),
+ -1);
+ this->inputs_.bind (sr.ssrc (), c);
+ }
+ c->updateStatistics (&sr);
+
+ if (TAO_debug_level > 0)
+ sr.dump ();
+ break;
+ }
+ case RTCP_PT_RR:
+ {
+ RTCP_RR_Packet rr(&buf_ptr[length-more],
+ &more);
+
+ if (!rr.is_valid(first_rtcp_packet))
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_RTCP_Callback::receive_control_frame - "
+ "warning invalid rtcp packet\n"));
+
+ if (this->inputs_.find (rr.ssrc (), c) == -1)
+ {
+ ACE_NEW_RETURN (c,
+ RTCP_Channel_In (rr.ssrc (),
+ &peer_address),
+ -1);
+ this->inputs_.bind (rr.ssrc (), c);
+ }
+
+ c->updateStatistics (&rr);
+
+ if (TAO_debug_level > 0)
+ rr.dump ();
+ break;
+ }
+ case RTCP_PT_SDES:
+ {
+ RTCP_SDES_Packet sdes (&buf_ptr[length-more],
+ &more);
+
+ if (!sdes.is_valid(first_rtcp_packet))
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_RTCP_Callback::receive_control_frame - "
+ "warning invalid rtcp packet\n"));
+
+ if (TAO_debug_level > 0)
+ sdes.dump ();
+ break;
+ }
+ case RTCP_PT_BYE:
+ {
+ RTCP_BYE_Packet bye (&buf_ptr[length-more],
+ &more);
+
+ if (!bye.is_valid(first_rtcp_packet))
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_RTCP_Callback::receive_control_frame - "
+ "warning invalid rtcp packet\n"));
+
+ // Inform the listener that a source(s) has left the session
+ ACE_UINT32 *ssrc_list;
+ unsigned char length;
+
+ bye.ssrc_list(&ssrc_list, length);
+
+ for (int i=0; i<length; i++)
+ {
+ RTCP_Channel_In *c = 0;
+
+ // remove the channel from the list
+ this->inputs_.unbind(ssrc_list[i], c);
+
+ if (c != 0)
+ delete c;
+ }
+
+ if (TAO_debug_level > 0)
+ bye.dump ();
+
+ break;
+ }
+ case RTCP_PT_APP:
+ // If we receive one of these, ignore it.
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_RTCP_Callback::receive_control_frame - "
+ "APP packet - ignore\n"));
+ more -= (4 + (ACE_UINT16)buf_ptr[length - more + 2]);
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_RTCP_Callback::receive_control_frame - "
+ "UNKNOWN packet type %u; ignore the rest\n",
+ (int)buf_ptr[length - more + 1]));
+ more = 0;
+ }
+
+ first_rtcp_packet = 0;
+
+ }
+
+ if (more != 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_RTCP_Callback::receive_control_frame - "
+ "Error in overall packet length\n"));
+ return 0;
+}
+
+ACE_INT32 random32 (int);
+
+ACE_UINT32
+TAO_AV_RTCP::alloc_srcid (ACE_UINT32 addr)
+{
+ md5_string s;
+
+ s.type = addr;
+ s.tv = ACE_OS::gettimeofday ();
+ s.pid = ACE_OS::getpid();
+ s.pgid = ACE_OS::getpgid(s.pid);
+ s.ppid = ACE_OS::getppid();
+ s.uid = ACE_OS::getuid();
+ s.gid = ACE_OS::getgid();
+
+ unsigned char *string_val = (unsigned char *) &s;
+ int length = sizeof(s);
+
+ MD5_CTX context;
+ union
+ {
+ char c[16];
+ u_long x[4];
+ } digest;
+ ACE_UINT32 r;
+ int i;
+
+ MD5Init (&context);
+ MD5Update (&context, string_val, length);
+ MD5Final ((unsigned char*)&digest, &context);
+ r=0;
+ for (i=0; i<3; i++)
+ r ^= digest.x[i];
+
+ return r;
+
+/* used to be this
+ ACE_Time_Value tv = ACE_OS::gettimeofday ();
+ ACE_UINT32 srcid = ACE_UINT32 (tv.sec () + tv.usec ());
+ srcid += (ACE_UINT32)ACE_OS::getuid();
+ srcid += (ACE_UINT32)ACE_OS::getpid();
+ srcid += addr;
+ return (srcid);
+*/
+}
+
+
+double
+TAO_AV_RTCP::rtcp_interval (int members,
+ int senders,
+ double rtcp_bw,
+ int we_sent,
+ int packet_size,
+ int *avg_rtcp_size,
+ int initial)
+{
+ // Minimum time between RTCP packets from this site (in sec.).
+ // This time prevents the reports from 'clumping' when sessions
+ // are small and the law of large numbers isn't helping to smooth
+ // out the traffic. It also keeps the report interval from
+ // becoming ridiculously small during transient outages like a
+ // network partition.
+// double const RTCP_MIN_TIME = 5.0; (from RTP.h)
+
+ // Fraction of the RTCP bandwidth to be shared among active
+ // senders. (This fraction was chosen so that in a typical
+ // session with one or two active senders, the computed report
+ // time would be roughly equal to the minimum report time so that
+ // we don't unnecessarily slow down receiver reports.) The
+ // receiver fraction must be 1 - the sender fraction.
+// double const RTCP_SENDER_BW_FRACTION = 0.25; (from RTP.h)
+// double const RTCP_RCVR_BW_FRACTION = (1-RTCP_SENDER_BW_FRACTION); (from RTP.h)
+
+ // Gain (smoothing constant) for the low-pass filter that
+ // estimates the average RTCP packet size
+// double const RTCP_SIZE_GAIN = (1.0/16.0); (from RTP.h)
+
+ double t;
+ double rtcp_min_time = RTCP_MIN_RPT_TIME;
+ int n; // number of members for computation
+
+ // Very first call at application start-up uses half the min
+ // delay for quicker notification while still allowing some time
+ // before reporting for randomization and to learn about other
+ // sources so the report interval will converge to the correct
+ // interval more quickly. The average RTCP size is initialized
+ // to 128 octets which is conservative (it assumes everyone else
+ // is generating SRs instead of RRs: 20 IP + 8 UDP + 52 SR + 48
+ // SDES CNAME).
+ if (initial)
+ {
+ // initialize the random number generator
+ ACE_OS::srand(ACE_OS::time(0L));
+
+ rtcp_min_time /= 2;
+ *avg_rtcp_size = 128;
+ }
+
+ // If there were active senders, give them at least a minimum
+ // share of the RTCP bandwidth. Otherwise all participants share
+ // the RTCP bandwidth equally.
+ n = members;
+ if ((senders > 0) && (senders < members*RTCP_SENDER_BW_FRACTION))
+ {
+ if (we_sent)
+ {
+ rtcp_bw *= RTCP_SENDER_BW_FRACTION;
+ n = senders;
+ }
+ else
+ {
+ rtcp_bw *= RTCP_RECEIVER_BW_FRACTION;
+ n -= senders;
+ }
+ }
+
+ // Update the average size estimate by the size of the report
+ // packet we just sent.
+ *avg_rtcp_size += (int)((packet_size - *avg_rtcp_size)*RTCP_SIZE_GAIN);
+
+ // The effective number of sites times the average packet size is
+ // the total number of octets sent when each site sends a report.
+ // Dividing this by the effective bandwidth gives the time
+ // interval over which those packets must be sent in order to
+ // meet the bandwidth target, with a minimum enforced. In that
+ // time interval we send one report so this time is also our
+ // average time between reports.
+ t = (*avg_rtcp_size) * n / rtcp_bw;
+ if (t < rtcp_min_time)
+ t = rtcp_min_time;
+
+ // To avoid traffic bursts from unintended synchronization with
+ // other sites, we then pick our actual next report interval as a
+ // random number uniformly distributed between 0.5*t and 1.5*t.
+
+ // TODO: this may not be right. need a random number between 0 and 1
+ int max_rand = 32768;
+
+ return t * ((double)ACE_OS::rand()/max_rand + 0.5);
+// return t * (drand48() + 0.5);
+}
+
+
+
+// TAO_AV_RTCP_Flow_Factory
+TAO_AV_RTCP_Flow_Factory::TAO_AV_RTCP_Flow_Factory (void)
+{
+}
+
+TAO_AV_RTCP_Flow_Factory::~TAO_AV_RTCP_Flow_Factory (void)
+{
+}
+
+int
+TAO_AV_RTCP_Flow_Factory::match_protocol (const char *flow_string)
+{
+ if (ACE_OS::strncasecmp (flow_string,"RTCP",4) == 0)
+ return 1;
+
+ return 0;
+}
+
+int
+TAO_AV_RTCP_Flow_Factory::init (int /* argc */,
+ char * /* argv */ [])
+{
+ return 0;
+}
+
+TAO_AV_Protocol_Object*
+TAO_AV_RTCP_Flow_Factory::make_protocol_object (TAO_FlowSpec_Entry * /*entry*/,
+ TAO_Base_StreamEndPoint * /*endpoint*/,
+ TAO_AV_Flow_Handler *handler,
+ TAO_AV_Transport *transport)
+{
+ TAO_AV_Callback *client_cb = 0;
+ TAO_AV_RTCP_Callback *rtcp_cb = 0;
+
+ // TODO: need to handle a client callback at some point
+// endpoint->get_control_callback (entry->flowname (),
+// client_cb);
+
+ TAO_AV_Protocol_Object *object = 0;
+ ACE_NEW_RETURN (object,
+ TAO_AV_RTCP_Object (client_cb,
+ rtcp_cb,
+ transport),
+ 0);
+
+ rtcp_cb->open (object, handler);
+
+ return object;
+}
+
+// TAO_AV_RTCP_Object
+int
+TAO_AV_RTCP_Object::handle_input (void)
+{
+ size_t bufsiz = 2*this->transport_->mtu ();
+ ACE_Message_Block data (bufsiz);
+
+ int n = this->transport_->recv (data.rd_ptr (),bufsiz);
+ if (n == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_ERROR, "TAO_AV_RTCP::handle_input:connection closed\n"));
+ return -1;
+ }
+ if (n < 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_ERROR,"TAO_AV_RTCP::handle_input:recv error\n"));
+ return -1;
+ }
+ data.wr_ptr (n);
+ ACE_Addr *peer_addr = this->transport_->get_peer_addr ();
+ this->callback_->receive_control_frame (&data,*peer_addr);
+ return 0;
+}
+
+int
+TAO_AV_RTCP_Object::send_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info * /*frame_info*/)
+{
+ return this->transport_->send (frame);
+}
+
+int
+TAO_AV_RTCP_Object::send_frame (const iovec *iov,
+ int iovcnt,
+ TAO_AV_frame_info * /*frame_info*/)
+{
+ return this->transport_->send (iov,
+ iovcnt);
+}
+
+int
+TAO_AV_RTCP_Object::send_frame (const char*,
+ size_t)
+{
+ return 0;
+}
+
+TAO_AV_RTCP_Object::TAO_AV_RTCP_Object (TAO_AV_Callback *client_cb,
+ TAO_AV_RTCP_Callback *&rtcp_cb,
+ TAO_AV_Transport *transport)
+ :TAO_AV_Protocol_Object (&rtcp_cb_, transport)
+{
+ rtcp_cb = &this->rtcp_cb_;
+ this->client_cb_ = client_cb;
+
+}
+
+TAO_AV_RTCP_Object::~TAO_AV_RTCP_Object (void)
+{
+}
+
+int
+TAO_AV_RTCP_Object::destroy (void)
+{
+ this->callback_->handle_destroy ();
+ delete this;
+
+ return 0;
+}
+
+int
+TAO_AV_RTCP_Object::set_policies (const TAO_AV_PolicyList &/*policy_list*/)
+{
+ return -1;
+}
+
+int
+TAO_AV_RTCP_Object::start (void)
+{
+ return this->callback_->handle_start ();
+}
+
+int
+TAO_AV_RTCP_Object::stop (void)
+{
+ return this->callback_->handle_stop ();
+}
+
+int
+TAO_AV_RTCP_Object::handle_control_input (ACE_Message_Block *frame,
+ const ACE_Addr &peer_address)
+{
+ return this->callback_->receive_frame (frame,
+ 0,
+ peer_address);
+}
+
+int
+TAO_AV_RTCP_Object::handle_control_output (ACE_Message_Block *frame)
+{
+ TAO_AV_RTCP_Callback *cb = dynamic_cast<TAO_AV_RTCP_Callback*> (this->callback_);
+
+ return cb->send_frame (frame);
+}
+
+void
+TAO_AV_RTCP_Object::ts_offset (ACE_UINT32 ts_offset)
+{
+ TAO_AV_RTCP_Callback *cb = dynamic_cast<TAO_AV_RTCP_Callback*> (this->callback_);
+ cb->ts_offset (ts_offset);
+}
+
+// TAO_AV_RTCP_Callback
+TAO_AV_RTCP_Callback::TAO_AV_RTCP_Callback (void)
+ :is_initial_timeout_(1),
+ packet_size_(0)
+{
+ char cname[256];
+ char host[256];
+ ACE_OS::hostname(host, sizeof(host));
+
+ // TODO: determine username auto-magically?
+ ACE_OS::sprintf(cname, "username@%s", host);
+
+ this->output_.cname(cname);
+}
+
+TAO_AV_RTCP_Callback::~TAO_AV_RTCP_Callback (void)
+{
+}
+
+void
+TAO_AV_RTCP_Callback::schedule (int ms)
+{
+ this->timeout_ = ms;
+}
+
+int
+TAO_AV_RTCP_Callback::handle_start (void)
+{
+ return 0;
+}
+
+int
+TAO_AV_RTCP_Callback::handle_stop (void)
+{
+ return this->send_report(1);
+}
+
+int
+TAO_AV_RTCP_Callback::handle_timeout (void * /*arg*/)
+{
+ return this->send_report(0);
+}
+
+int
+TAO_AV_RTCP_Callback::send_report (int bye)
+{
+ // get the RTCP control object in order to get the ssrc
+ TAO_AV_RTCP_Object *rtcp_prot_obj = dynamic_cast<TAO_AV_RTCP_Object*> (this->protocol_object_);
+ ACE_UINT32 my_ssrc = rtcp_prot_obj->ssrc ();
+
+ RTCP_Packet *cp;
+ RTCP_SDES_Packet sdes;
+ ACE_CString value = "";
+ ACE_CString note = "";
+ unsigned char sdes_type = 0;
+ RTCP_BYE_Packet *bye_packet = 0; // only used for bye
+ ACE_UINT32 ssrc_list[1]; // only used for bye
+
+ // get an iterator for the incoming channels.
+ ACE_Hash_Map_Iterator<ACE_UINT32, RTCP_Channel_In*, ACE_Null_Mutex> iter (this->inputs_);
+ iter = this->inputs_.begin();
+
+ // first send an SR/RR
+ RR_Block *blocks = 0;
+ RR_Block *b_iter = 0;
+ RR_Block *b_ptr = 0;
+
+ while (iter != this->inputs_.end() )
+ {
+ if (!b_iter)
+ {
+ b_ptr = (*iter).int_id_->getRRBlock ();
+ if (b_ptr)
+ {
+ blocks = b_ptr;
+ b_iter = b_ptr;
+ }
+ }
+ else
+ {
+ b_ptr = (*iter).int_id_->getRRBlock ();
+ if (b_ptr)
+ {
+ b_iter->next_ = b_ptr;
+ }
+ }
+
+ iter++;
+ }
+
+ if (b_iter)
+ b_iter->next_ = 0;
+
+ if (this->output_.active ())
+ {
+ // get the NTP timestamp
+ ACE_Time_Value unix_now = ACE_OS::gettimeofday ();
+ TAO_AV_RTCP::ntp64 ntp_now = ntp64time (unix_now);
+ ACE_UINT32 rtp_ts = unix_now.sec () * 8000 + unix_now.usec () / 125 +
+ this->timestamp_offset_;
+ ACE_NEW_RETURN(cp,
+ RTCP_SR_Packet (my_ssrc,
+ ntp_now.upper,
+ ntp_now.lower,
+ rtp_ts,
+ this->output_.packets_sent (),
+ this->output_.octets_sent (),
+ blocks),
+ -1);
+ }
+ else
+ {
+ ACE_NEW_RETURN(cp,
+ RTCP_RR_Packet (my_ssrc,
+ blocks),
+ -1);
+ }
+
+ /*
+ * We always send a cname plus one other sdes
+ * There's a schedule for what we send sequenced by sdes_seq_:
+ * - send 'email' every 0th & 4th packet
+ * - send 'note' every 2nd packet
+ * - send 'tool' every 6th packet
+ * - send 'name' in all the odd slots
+ * (if 'note' is not the empty string, we switch the roles
+ * of name & note)
+ */
+
+ // TODO: need capability to change these settings
+ switch (this->sdes_count_%8)
+ {
+ case 0:
+ case 4:
+ value = "tao-users@wustl.edu";
+ sdes_type = RTCP_SDES_EMAIL;
+ break;
+ case 2:
+ if (note.length () > 0)
+ {
+ value = "Joe User";
+ sdes_type = RTCP_SDES_NAME;
+ }
+ else
+ {
+ value = "An important note...";
+ sdes_type = RTCP_SDES_NOTE;
+ }
+ break;
+ case 6:
+ value = "TAO A/V Service";
+ sdes_type = RTCP_SDES_TOOL;
+ break;
+ case 1:
+ case 3:
+ case 5:
+ case 7:
+ if (note.length () == 0)
+ {
+ value = "Joe User";
+ sdes_type = RTCP_SDES_NAME;
+ }
+ else
+ {
+ value = "An important note...";
+ sdes_type = RTCP_SDES_NOTE;
+ }
+ break;
+ }
+
+ ++this->sdes_count_;
+
+ sdes.add_item (my_ssrc,
+ RTCP_SDES_CNAME,
+ static_cast<unsigned char> (ACE_OS::strlen(this->output_.cname())),
+ this->output_.cname());
+ if (bye)
+ {
+ ssrc_list[0] = rtcp_prot_obj->ssrc ();
+
+ ACE_NEW_RETURN (bye_packet,
+ RTCP_BYE_Packet(ssrc_list,
+ sizeof(ssrc_list)/sizeof(ssrc_list[0]),
+ "Got bored."),
+ -1);
+ }
+ else
+ {
+ unsigned char length = (unsigned char)(value.length() & 0xFF);
+ sdes.add_item (my_ssrc, sdes_type, length, value.c_str ());
+ }
+
+ // create the message block
+ char *cp_ptr;
+ char *sdes_ptr;
+ char *bye_ptr = 0;
+ ACE_UINT16 cp_length;
+ ACE_UINT16 sdes_length;
+ ACE_UINT16 bye_length = 0;
+ cp->get_packet_data (&cp_ptr, cp_length);
+ sdes.get_packet_data (&sdes_ptr, sdes_length);
+ if (bye_packet)
+ bye_packet->get_packet_data(&bye_ptr, bye_length);
+
+ ACE_Message_Block mb (cp_length + sdes_length + bye_length);
+
+ memcpy (mb.wr_ptr (), cp_ptr, cp_length);
+ mb.wr_ptr (cp_length);
+ memcpy (mb.wr_ptr (), sdes_ptr, sdes_length);
+ mb.wr_ptr (sdes_length);
+ if (bye_length)
+ {
+ memcpy (mb.wr_ptr (), bye_ptr, bye_length);
+ mb.wr_ptr (bye_length);
+ }
+
+ // send the report
+ this->protocol_object_->send_frame (&mb);
+
+ this->packet_size_ = cp_length + sdes_length + bye_length;
+
+ delete cp;
+ if (bye_packet)
+ delete bye_packet;
+
+ return 0;
+}
+
+void
+//TAO_AV_RTCP_Callback::get_timeout (ACE_Time_Value *tv,
+TAO_AV_RTCP_Callback::get_timeout (ACE_Time_Value *&tv,
+ void *& /*arg*/)
+{
+ int senders = 0;
+ int members = 1; // count self as member
+
+ // TODO: this should be 5% of the session bw
+ double rtcp_bw = 1000;
+ double interval;
+
+ ACE_Hash_Map_Iterator<ACE_UINT32, RTCP_Channel_In*, ACE_Null_Mutex> iter (this->inputs_);
+ iter = this->inputs_.begin();
+
+ if (this->output_.active ())
+ senders++;
+
+ // determine the number of senders and members of this session
+ while (iter != this->inputs_.end ())
+ {
+ if ((*iter).int_id_->active ())
+ {
+ if ((*iter).int_id_->sender ())
+ senders++;
+ members++;
+ }
+ iter++;
+ }
+
+ // Here we do the RTCP timeout calculation.
+ interval = TAO_AV_RTCP::rtcp_interval (members, // members
+ senders, // senders
+ rtcp_bw, // rtcp_bw
+ this->output_.active (), // we_sent
+ this->packet_size_, // packet_size
+ &this->avg_rtcp_size_, // avg_rtcp_size
+ this->is_initial_timeout_); // initial)
+
+ this->is_initial_timeout_ = 0;
+
+ ACE_NEW (tv,
+ ACE_Time_Value);
+
+ tv->sec ((int)interval);
+ tv->usec ((int)((interval - (int)interval) * 1000000));
+}
+
+int
+TAO_AV_RTCP_Callback::handle_destroy (void)
+{
+ return 0;
+}
+
+int
+TAO_AV_RTCP_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &peer_address)
+{
+ RTCP_Channel_In *c;
+
+ RTP_Packet packet (frame->rd_ptr(), static_cast<int> (frame->length()));
+
+ if (this->inputs_.find (packet.ssrc(), c) < 0)
+ {
+ ACE_NEW_RETURN (c,
+ RTCP_Channel_In (packet.ssrc(),
+ &peer_address),
+ -1);
+
+ this->inputs_.bind (packet.ssrc(), c);
+ }
+
+ c->recv_rtp_packet (frame, &peer_address);
+ return 0;
+}
+
+int
+TAO_AV_RTCP_Callback::send_frame (ACE_Message_Block *frame)
+{
+ RTP_Packet packet (frame->rd_ptr(), static_cast<int> (frame->length()));
+ this->output_.updateStatistics (&packet);
+
+ return 0;
+}
+
+void
+TAO_AV_RTCP_Callback::ts_offset (ACE_UINT32 offset)
+{
+ this->timestamp_offset_ = offset;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_AV, TAO_AV_RTCP_Flow_Factory)
+ACE_STATIC_SVC_DEFINE (TAO_AV_RTCP_Flow_Factory,
+ ACE_TEXT ("RTCP_Flow_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_AV_RTCP_Flow_Factory),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
+
diff --git a/TAO/orbsvcs/orbsvcs/AV/RTCP.h b/TAO/orbsvcs/orbsvcs/AV/RTCP.h
new file mode 100644
index 00000000000..58688376837
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/RTCP.h
@@ -0,0 +1,256 @@
+// -*- C++ -*-
+
+/**
+ * Copyright (c) 1993-1994 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and the Network Research Group at
+ * Lawrence Berkeley Laboratory.
+ * 4. Neither the name of the University nor of the Laboratory may be used
+ * to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+//=============================================================================
+/**
+ * @file RTCP.h
+ *
+ * $Id$
+ *
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_AV_RTCP_H
+#define TAO_AV_RTCP_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/RTCP_Channel.h"
+
+// FUZZ: disable check_for_math_include
+
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/UDP.h"
+#include "orbsvcs/AV/RTP.h"
+#include "ace/Hash_Map_Manager_T.h"
+#include <math.h>
+#include <stdlib.h>
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_AV_RTCP_Callback;
+
+/**
+ * @class TAO_AV_RTCP
+ * @brief Encapsulate the header format for the Real Time Control
+ * Protocol (RTCP)
+ */
+class TAO_AV_Export TAO_AV_RTCP
+{
+public:
+ struct rtcphdr
+ {
+ ACE_UINT16 rh_flags; /* T:2 P:1 CNT:5 PT:8 */
+ ACE_UINT16 rh_len; /* length of message (in bytes) */
+ ACE_UINT32 rh_ssrc; /* synchronization src id */
+ };
+
+ struct ntp64
+ {
+ ACE_UINT32 upper; /* more significant 32 bits */
+ ACE_UINT32 lower; /* less significant 32 bits */
+ };
+
+ struct md5_string
+ {
+ int type;
+ ACE_Time_Value tv;
+ pid_t pid;
+ pid_t pgid;
+ pid_t ppid;
+ uid_t uid;
+ gid_t gid;
+ };
+
+ static void send_report (ACE_Message_Block *mb);
+
+ static ACE_UINT32 alloc_srcid (ACE_UINT32 addr);
+
+ static double rtcp_interval (int members,
+ int senders,
+ double rtcp_bw,
+ int we_sent,
+ int packet_size,
+ int *avg_rtcp_size,
+ int initial);
+};
+
+
+
+/**
+ * @class TAO_AV_RTCP_Flow_Factory
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_RTCP_Flow_Factory
+ :public TAO_AV_Flow_Protocol_Factory
+{
+public:
+ TAO_AV_RTCP_Flow_Factory (void);
+ virtual ~TAO_AV_RTCP_Flow_Factory (void);
+ virtual int init (int argc, char *argv[]);
+ virtual int match_protocol (const char *flow_string);
+ 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);
+};
+
+class TAO_AV_Callback;
+
+
+/**
+ * @class TAO_AV_RTCP_Callback
+ * @brief TAO_AV_Callback for RTCP protocol
+ */
+class TAO_AV_Export TAO_AV_RTCP_Callback : public TAO_AV_Callback
+{
+public:
+ /// RTCP callback.
+ TAO_AV_RTCP_Callback (void);
+
+ /// virtual destructor.
+ virtual ~TAO_AV_RTCP_Callback (void);
+
+ /// Called during Streamctrl->start.
+ virtual int handle_start (void);
+
+ /// Called during Streamctrl->stop.
+ virtual int handle_stop (void);
+
+ /// Called during timeout for Flow Producers.
+ virtual int handle_timeout (void *arg);
+
+ /// Called when a frame arrives for a FlowConsumer.
+ virtual int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info = 0,
+ const ACE_Addr &peer_address = ACE_Addr::sap_any);
+ int send_frame (ACE_Message_Block *frame);
+
+ virtual int receive_control_frame (ACE_Message_Block *frame,
+ const ACE_Addr &peer_address = ACE_Addr::sap_any);
+
+ /// Called during Streamctrl->destroy i.e tear_down of the stream
+ /// @@coryan:Call it handle_destroy or handle_close.
+ virtual int handle_destroy (void);
+
+ /// Called to get the timeout. If tv is 0 then the framework stop
+ /// calling this.
+ virtual void get_timeout (ACE_Time_Value *&tv,
+ void *&arg);
+
+ int send_report(int bye);
+ void schedule (int ms);
+ TAO_AV_RTP_State *state (void);
+ void ts_offset (ACE_UINT32 offset);
+
+protected:
+ ACE_Hash_Map_Manager<ACE_UINT32, RTCP_Channel_In*, ACE_Null_Mutex> inputs_;
+ RTCP_Channel_Out output_;
+ int timeout_;
+ int timestamp_offset_;
+ int sdes_count_;
+
+ int is_initial_timeout_;
+ int avg_rtcp_size_;
+ int packet_size_;
+};
+
+class RTP_Packet;
+
+
+/**
+ * @class TAO_AV_RTCP_Object
+ * @brief TAO_AV_Protocol_Object for RTCP protocol
+ */
+class TAO_AV_Export TAO_AV_RTCP_Object
+ : public TAO_AV_Protocol_Object
+{
+public:
+ /// constructor.
+ TAO_AV_RTCP_Object (TAO_AV_Callback *client_cb,
+ TAO_AV_RTCP_Callback *&rtcp_cb,
+ TAO_AV_Transport *transport = 0);
+
+ /// Destructor
+ virtual ~TAO_AV_RTCP_Object (void);
+
+ virtual int handle_input (void);
+ virtual int handle_control_input (ACE_Message_Block *frame,
+ const ACE_Addr &peer_address);
+ virtual int handle_control_output (ACE_Message_Block *frame);
+
+ /// set/get policies.
+ virtual int set_policies (const TAO_AV_PolicyList &policy_list);
+
+ /// start/stop the flow.
+ virtual int start (void);
+ virtual int stop (void);
+
+ /// send a data frame.
+ virtual int send_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info = 0);
+
+ /// send a frame in iovecs.
+ virtual int send_frame (const iovec *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);
+
+ void ssrc (ACE_UINT32 ssrc) {this->ssrc_ = ssrc; }
+ ACE_UINT32 ssrc (void) { return this->ssrc_; }
+
+ void ts_offset (ACE_UINT32 ts_offset);
+
+
+private:
+ TAO_AV_Callback *client_cb_;
+ TAO_AV_RTCP_Callback rtcp_cb_;
+ ACE_UINT32 ssrc_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (TAO_AV_RTCP_Flow_Factory)
+ACE_FACTORY_DECLARE (TAO_AV, TAO_AV_RTCP_Flow_Factory)
+
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_RTCP_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/RTCP_Channel.cpp b/TAO/orbsvcs/orbsvcs/AV/RTCP_Channel.cpp
new file mode 100644
index 00000000000..7011dab5371
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/RTCP_Channel.cpp
@@ -0,0 +1,364 @@
+// $Id$
+
+#include "orbsvcs/AV/RTCP_Channel.h"
+#include "orbsvcs/AV/RTP.h"
+#include "tao/debug.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+RTCP_Channel_In::RTCP_Channel_In (ACE_UINT32 ssrc,
+ const ACE_Addr *peer_addr)
+ : remote_ssrc_ (ssrc),
+ cname_ (""),
+ transit_ (0),
+ jitter_ (0.0),
+ first_data_packet_ (1),
+ ntp_ts_msw_ (0),
+ ntp_ts_lsw_ (0),
+ last_sr_time_ (0),
+ active_ (0),
+ no_data_counter_ (0),
+ data_since_last_report_ (0)
+{
+ const ACE_INET_Addr *const_inet_addr = dynamic_cast<const ACE_INET_Addr*> (peer_addr);
+
+ ACE_INET_Addr *inet_addr;
+ ACE_NEW (inet_addr,
+ ACE_INET_Addr (*const_inet_addr));
+
+ this->peer_address_ = inet_addr;
+}
+
+RTCP_Channel_In::~RTCP_Channel_In(void)
+{
+ delete this->peer_address_;
+}
+
+void
+RTCP_Channel_In::updateStatistics(RTP_Packet* dataPkt)
+{
+ ACE_Time_Value current_time;
+ ACE_UINT32 arrival;
+ int transit, d;
+
+ this->active_ = 0;
+
+ // determine if the source has been declared valid
+ if (update_seq(dataPkt->sn ()) == 0)
+ return;
+
+ // Set initial values if this is the first data packet.
+ if (this->first_data_packet_)
+ {
+ // store the initial timestamp
+ this->init_time_stamp_ = dataPkt->ts ();
+ this->init_local_time_ = ACE_OS::gettimeofday ();
+ this->first_data_packet_ = 0;
+ }
+
+ // Get the current time.
+ current_time = ACE_OS::gettimeofday ();
+
+ unsigned int samples_per_sec;
+ double samples_per_usec;
+
+
+ switch (dataPkt->pt())
+ {
+ case RTP_PT_PCMU:
+ case RTP_PT_CELP:
+ case RTP_PT_G721:
+ case RTP_PT_GSM:
+ case RTP_PT_DVI:
+ case RTP_PT_LPC:
+ case RTP_PT_PCMA:
+ case RTP_PT_G722:
+ samples_per_sec = 8000;
+ break;
+ case RTP_PT_L16_STEREO:
+ case RTP_PT_L16_MONO:
+ samples_per_sec = 44100;
+ break;
+ default:
+ samples_per_sec = 1000000;
+ };
+
+ samples_per_usec = samples_per_sec/1000000.0;
+
+ // Calculate the current timestamp.
+ arrival = (ACE_UINT32)((current_time.sec () -
+ this->init_local_time_.sec ()) * samples_per_sec +
+ ((double)(current_time.usec () -
+ (double)this->init_local_time_.usec ()) * samples_per_usec) +
+ this->init_time_stamp_);
+
+
+ // jitter calc from RFC 1889 app a.8
+ transit = arrival - dataPkt->ts ();
+ d = transit - this->transit_;
+ this->transit_ = transit;
+ if (d < 0)
+ d = -d;
+
+ // Calculate the inter-arrival jitter.
+ this->jitter_ += (1./16.)*((double)d - this->jitter_);
+
+ // Indicate that data has been received since the last report.
+ this->data_since_last_report_ = 1;
+
+ // Store the payload type.
+ this->payload_type_ = dataPkt->pt ();
+}
+
+int
+RTCP_Channel_In::updateStatistics(RTCP_SR_Packet *sr)
+{
+ // calculate the last SR time in 1/65536 sec.
+ ACE_Time_Value now = ACE_OS::gettimeofday ();
+ this->last_sr_time_ = (ACE_UINT32)
+ (now.sec () * 65536 +
+ now.usec () * 0.065536);
+
+ this->ntp_ts_msw_ = sr->ntp_ts_msw ();
+ this->ntp_ts_lsw_ = sr->ntp_ts_lsw ();
+
+ return 0;
+}
+
+int
+RTCP_Channel_In::updateStatistics(RTCP_RR_Packet * /*rr*/)
+{
+ return 0;
+}
+
+void
+RTCP_Channel_In::init_seq(ACE_UINT16 seq)
+{
+ this->base_seq_ = seq - 1;
+ this->max_seq_ = seq;
+ this->bad_seq_ = RTP_SEQ_MOD + 1;
+ this->cycles_ = 0;
+ this->received_ = 0;
+ this->received_prior_ = 0;
+ this->expected_prior_ = 0;
+}
+
+int
+RTCP_Channel_In::update_seq(ACE_UINT16 seq)
+{
+ // The following is taken from RFC 1889 Appendix A.1
+ ACE_UINT16 udelta = seq - this->max_seq_;
+ const int MAX_DROPOUT = 3000;
+ const int MAX_MISORDER = 100;
+ const int MIN_SEQUENTIAL = 2;
+
+ // Source is not valid until MIN_SEQUENTIAL packets with
+ // sequential sequence numbers have been received.
+ if (this->probation_)
+ {
+ // packet is in sequence
+ if (seq == this->max_seq_ + (ACE_UINT16)1)
+ {
+ this->probation_ --;
+ this->max_seq_ = seq;
+ if (this->probation_ == 0)
+ {
+ this->init_seq(seq);
+ this->received_++;
+ return 1;
+ }
+ }
+ else
+ {
+ this->probation_ = MIN_SEQUENTIAL - 1;
+ this->max_seq_ = seq;
+ }
+ return 0;
+ }
+ else if (udelta < MAX_DROPOUT)
+ {
+ // in order, with permissible gap
+ if (seq < this->max_seq_)
+ {
+ // seq number wrapped - count another 64k cycle
+ this->cycles_+=RTP_SEQ_MOD;
+ }
+ this->max_seq_ = seq;
+ }
+ else if (udelta <= RTP_SEQ_MOD - MAX_MISORDER)
+ {
+ // the sequence number made a large jump
+ ACE_UINT32 temp = seq; // Borland reports a warning on the next line
+ // without this line.
+ if (temp == this->bad_seq_)
+ {
+ // two sequential packets, assume the other side restarted without
+ // telling us so just re-sync
+ // (i.e., pretend this was the first packet).
+ this->init_seq (seq);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "RTCP_Channel_In: large jump in sequence number",
+ "; init seq\n"));
+ }
+ else
+ {
+ this->bad_seq_ = (seq+1)&(RTP_SEQ_MOD-1);
+ return 0;
+ }
+ }
+ else
+ {
+ // dup or reordered packet
+ }
+ this->received_++;
+
+ return 1;
+}
+
+void
+RTCP_Channel_In::recv_rtp_packet(ACE_Message_Block *mb,
+ const ACE_Addr *peer_address)
+{
+ if (*peer_address != *this->peer_address_)
+ ACE_DEBUG ((LM_DEBUG,
+ "RTCP_Channel_In::recv_rtp_packet - possible loop/collision detected"));
+
+ RTP_Packet data_packet(mb->rd_ptr (), static_cast<int> (mb->length ()));
+
+ // make sure the packet is valid
+ if (data_packet.is_valid ())
+ this->updateStatistics(&data_packet);
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "RTCP_Channel_In::recvDataPacket - invalid RTP packet\n"));
+}
+
+
+RR_Block *
+RTCP_Channel_In::getRRBlock(void)
+{
+ // If no data has been received since the last report, don't create a block.
+ if (!this->data_since_last_report_)
+ {
+ this->no_data_counter_++;
+
+ // make the source inactive if significant time has passed since last report
+ if (this->no_data_counter_ == 32)
+ this->active_ = 0;
+
+ return 0;
+ }
+
+ this->no_data_counter_ = 0;
+
+ RR_Block *local_block_ptr = 0;
+
+ ACE_NEW_RETURN (local_block_ptr,
+ RR_Block,
+ 0);
+
+ ACE_OS::memset(local_block_ptr, 0, sizeof(RR_Block));
+
+ // Set the ssrc of the source this report is for.
+ local_block_ptr->ssrc_ = this->remote_ssrc_;
+
+ // Calculate packets expected/lost (from RFC 1889 Appendix A.3)
+ ACE_UINT32 extended_max;
+ ACE_UINT32 expected;
+ ACE_UINT32 expected_interval;
+ ACE_UINT32 received_interval;
+ int lost_interval;
+
+ extended_max = this->cycles_ + this->max_seq_;
+ expected = extended_max - this->base_seq_ + 1;
+
+ local_block_ptr->lost_ = expected - this->received_;
+ expected_interval = expected - this->expected_prior_;
+ this->expected_prior_ = expected;
+ received_interval = this->received_ - this->received_prior_;
+ this->received_prior_ = this->received_;
+ lost_interval = expected_interval - received_interval;
+
+ if ((expected_interval == 0) || (lost_interval <= 0))
+ local_block_ptr->fraction_ = 0;
+ else
+ local_block_ptr->fraction_ = (lost_interval << 8) / expected_interval;
+
+
+ local_block_ptr->last_seq_ = extended_max;
+
+ // taken from RFC 1889 App A.8
+ local_block_ptr->jitter_ = (ACE_UINT32)this->jitter_;
+
+ // calculate the last SR timestamp (lsr)
+ local_block_ptr->lsr_ = ((this->ntp_ts_msw_ & 0xFFFF) << 16) |
+ ((this->ntp_ts_lsw_ & 0xFFFF0000) >> 16);
+
+ // calculate the delay since last SR (dlsr)
+ ACE_Time_Value now = ACE_OS::gettimeofday ();
+ ACE_UINT32 now32 = (ACE_UINT32)
+ (now.sec () * 65536 +
+ now.usec () * 0.065536);
+
+ local_block_ptr->dlsr_ = now32 - this->last_sr_time_;
+
+ // indicate that no data has been received since the last report
+ this->data_since_last_report_ = 0;
+
+ return local_block_ptr;
+}
+
+RTCP_Channel_Out::RTCP_Channel_Out(void)
+ :cname_ ("cname"),
+ active_ (0),
+ timestamp_ (0),
+ timestamp_offset_ (0),
+ packets_sent_ (0),
+ octets_sent_ (0)
+{
+}
+
+RTCP_Channel_Out::~RTCP_Channel_Out(void)
+{
+}
+
+void
+RTCP_Channel_Out::updateStatistics (RTP_Packet *data_packet)
+{
+ // indicate that this source is active
+ this->active_ = 1;
+
+ // Update various counters.
+ this->octets_sent_ += data_packet->payload_size();
+ this->packets_sent_ ++;
+ this->seq_num_ = data_packet->sn ();
+ this->timestamp_ = data_packet->ts ();
+}
+
+ACE_UINT32
+RTCP_Channel_Out::timestamp (void)
+{
+ return this->timestamp_;
+}
+
+ACE_UINT32
+RTCP_Channel_Out::packets_sent (void)
+{
+ return this->packets_sent_;
+}
+
+ACE_UINT32
+RTCP_Channel_Out::octets_sent (void)
+{
+ return this->octets_sent_;
+}
+
+char
+RTCP_Channel_Out::active (void)
+{
+ return this->active_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/RTCP_Channel.h b/TAO/orbsvcs/orbsvcs/AV/RTCP_Channel.h
new file mode 100644
index 00000000000..a9d717a33b0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/RTCP_Channel.h
@@ -0,0 +1,223 @@
+// $Id$
+
+#ifndef RTCP_CHANNEL_INCLUDE
+#define RTCP_CHANNEL_INCLUDE
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/RTP.h"
+#include "orbsvcs/AV/RTCP_Packet.h"
+
+#include "ace/Message_Block.h"
+#include "ace/SString.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class RTCP_Channel_In
+ * @brief The RTCP_Channel_In class represents a single incoming data channel,
+ * or stream. The class has several responsibilities. When the class is
+ * instantiated, the incoming RTP traffic must be declared a valid source based
+ * on the RTP packets received. Once declared valie, this class is responsible
+ * for keeping up with reception statistics and other information. When an SR
+ * or RR is created (outside of this class), this class is used to get the
+ * Receiver Report block for this particular stream.
+ */
+
+class RTCP_Channel_In
+{
+public:
+ /// Constructor for an incoming channel. Requires the synchronization source
+ /// id and address of the sender.
+ RTCP_Channel_In(ACE_UINT32 ssrc,
+ const ACE_Addr *addr);
+
+ /// Destructor
+ ~RTCP_Channel_In(void);
+
+ /// This operation takes the incoming ACE_Message_Block, converts it to an
+ /// RTP_Packet and calls updateStatistics. It also uses compares the peer_addr
+ /// to the stored peer_address_ to check for loops.
+ void recv_rtp_packet (ACE_Message_Block *mb,
+ const ACE_Addr *peer_addr);
+
+ /// Takes statistics of incoming RTP traffic and creates a receiver report block.
+ RR_Block *getRRBlock(void);
+
+ /// Returns the delay since last sender report.
+ ACE_UINT32 dlsr (void);
+
+ /// Returns the last sender report timestamp.
+ ACE_UINT32 lsr (void);
+
+ /// Updates channel information with incoming sender report.
+ int updateStatistics(RTCP_SR_Packet *sr);
+
+ /// Updates channel information with incoming receiver report.
+ int updateStatistics(RTCP_RR_Packet *rr);
+
+ /// Returns 1 if data has been sent since the last report, 0 if not.
+ int sender (void) { return this->data_since_last_report_; }
+
+ /// Returns 1 if this is an active source, 0 if not.
+ int active (void) { return this->active_; }
+
+private:
+ /// Don't want default constructor.
+ RTCP_Channel_In(void);
+
+ /// Don't want copy constructor.
+ RTCP_Channel_In(const RTCP_Channel_In &ch);
+
+ /// The synchronization source id of the source this channel represents.
+ ACE_UINT32 remote_ssrc_;
+
+ /// The canonical name of the source this channel represents.
+ ACE_CString cname_;
+
+ // Used to declare a source valid
+ /// The highest sequence number seen.
+ ACE_UINT16 max_seq_;
+
+ /// The shifted count of sequence number cycles (ie when sequence number wraps)
+ ACE_UINT32 cycles_;
+
+ /// The first sequence number received.
+ ACE_UINT32 base_seq_;
+
+ /// last 'bad' sequence number + 1
+ ACE_UINT32 bad_seq_;
+
+ /// The number of in sequence packets until a source is declared valid.
+ ACE_UINT32 probation_;
+
+ /// The number of packets received.
+ ACE_UINT32 received_;
+
+ /// The packet expected at last interval.
+ ACE_UINT32 expected_prior_;
+
+ /// The packet received at last interval.
+ ACE_UINT32 received_prior_;
+
+ /// The last transit time.
+ ACE_UINT32 transit_;
+
+ /// The inter-arrival jitter measured in timestamp units.
+ double jitter_;
+
+ // Used for jitter calculations
+ /// Flag to indicate the first data packet received.
+ char first_data_packet_;
+
+ /// The first timestamp received.
+ ACE_UINT32 init_time_stamp_;
+
+ /// The local time that the initial packet was received.
+ ACE_Time_Value init_local_time_;
+
+ /// The address that the first RTP packet was received from.
+ ACE_Addr *peer_address_;
+
+ /// The most significant word of the last sender report NTP timestamp.
+ ACE_UINT32 ntp_ts_msw_;
+
+ /// The least significant word of the last sender report NTP timestamp.
+ ACE_UINT32 ntp_ts_lsw_;
+
+ /// The last sender report RTP timestamp.
+ ACE_UINT32 rtp_ts_;
+
+ /// The last time a sender report was received in 1/65536 seconds.
+ /// Used to calculate DLSR.
+ ACE_UINT32 last_sr_time_;
+
+ /// Flag to indicate whether or not the source is active.
+ int active_;
+
+ /// This is a counter to indicate the number of reporting intervals that have
+ /// passed since data has been received. After 32, declare the source inactive.
+ int no_data_counter_;
+
+ /// This flag indicates that data has been received since the last report was
+ /// sent.
+ char data_since_last_report_;
+
+ /// The RTP payload type.
+ int payload_type_;
+
+ /// This operation is used update statistics for the incoming RTP packet.
+ void updateStatistics(RTP_Packet *pkt);
+
+ /// This is called when the first RTP packet is received.
+ void init_seq(ACE_UINT16 seq);
+
+ /// This is called when each RTP packet is received. It is used to declare
+ /// a source as valid.
+ int update_seq(ACE_UINT16 seq);
+};
+
+/**
+ * @class RTCP_Channel_Out
+ * @brief The RTCP_Channel_Out class represents a single outgoing data channel,
+ * or stream. It keeps track of statistics such as number of packets sent and
+ * number of bytes sent.
+ */
+
+class RTCP_Channel_Out
+{
+public:
+ /// Constructor.
+ RTCP_Channel_Out(void);
+
+ /// Destructor.
+ ~RTCP_Channel_Out(void);
+
+ /// Update the channel statistics each time an RTP packet is sent.
+ void updateStatistics (RTP_Packet *pkt);
+
+ /// Returns the timestamp of the last RTP packet sent.
+ ACE_UINT32 timestamp (void);
+
+ /// Returns the number of packets sent.
+ ACE_UINT32 packets_sent (void);
+
+ /// Returns the number of octets sent.
+ ACE_UINT32 octets_sent (void);
+
+ /// Sets the canonical name of the source.
+ void cname (const char *cname) { this->cname_ = cname; }
+
+ /// Returns the canonical name of the source.
+ const char *cname (void) { return this->cname_.c_str(); }
+
+ /// Returns whether or not this source is active.
+ char active (void);
+
+private:
+ /// Holds the canonical name for this channel.
+ ACE_CString cname_;
+
+ /// Flag to indicate whether or not this channel is active.
+ char active_;
+
+ /// The sequence number of the last RTP packet sent.
+ unsigned int seq_num_;
+
+ /// The timestamp of the last RTP packet sent.
+ unsigned int timestamp_;
+
+ /// The initial offset of the timestamp.
+ unsigned int timestamp_offset_;
+
+ /// The total number of packets sent.
+ unsigned int packets_sent_;
+
+ /// The total numbef of octets sent.
+ unsigned int octets_sent_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* RTCP_CHANNEL_INCLUDE */
diff --git a/TAO/orbsvcs/orbsvcs/AV/RTCP_Packet.cpp b/TAO/orbsvcs/orbsvcs/AV/RTCP_Packet.cpp
new file mode 100644
index 00000000000..8ef82e30bb3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/RTCP_Packet.cpp
@@ -0,0 +1,1212 @@
+// $Id$
+#include "orbsvcs/AV/RTCP_Packet.h"
+#include "orbsvcs/AV/RTP.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+RTCP_Packet::RTCP_Packet(void)
+{
+ this->chd_.ver_ = 2;
+ this->chd_.count_ = 0;
+ this->chd_.pad_ = 0;
+ this->chd_.length_ = 0;
+ this->packet_data_ = 0;
+}
+
+RTCP_Packet::RTCP_Packet(char* buffer)
+{
+ // Parse the common part of the control packet header.
+ this->chd_.ver_ = (buffer[0] & 0xC0) >> 6;
+
+ if (this->chd_.ver_ != RTP_VERSION)
+ ACE_DEBUG ((LM_DEBUG,
+ "RTCP_Packet::RTCP_Packet version incorrect"));
+
+ this->chd_.pad_ = (buffer[0] & 0x20) >> 5;
+ this->chd_.count_ = buffer[0] & 0x1F;
+ this->chd_.pt_ = buffer[1];
+ this->chd_.length_ = ntohs(*(ACE_UINT16*)&buffer[2]);
+ this->packet_data_ = 0;
+}
+
+RTCP_Packet::~RTCP_Packet(void)
+{
+}
+
+void
+RTCP_Packet::get_packet_data(char **buffer, ACE_UINT16 &length)
+{
+ length = static_cast<ACE_UINT16> (this->packet_size());
+
+ // buiidPacket is defined for each child of RTCP_Packet
+ // buildPacket creates a snapshot of the RTCP packet in the buffer pktData
+ this->build_packet ();
+
+ *buffer = this->packet_data_;
+}
+
+int
+RTCP_Packet::is_valid (char is_first)
+{
+ // make sure the RTP version is correct
+ if (this->chd_.ver_ != RTP_VERSION)
+ return 0;
+
+ // these checks are only for the first RTCP packet in a compound packet
+ if (is_first)
+ {
+ // the payload type must be RR or SR
+ if ((this->chd_.pt_ != RTCP_PT_SR) && (this->chd_.pt_ != RTCP_PT_RR))
+ return 0;
+
+ // the padding bit must not be set
+ if (this->chd_.pad_ != 0)
+ return 0;
+ }
+
+ return 1;
+
+}
+
+/*
+ * RTCP_BYE_Packet
+ */
+
+RTCP_BYE_Packet::RTCP_BYE_Packet(ACE_UINT32 *ssrc_list,
+ unsigned char length,
+ const char *text)
+{
+ this->chd_.ver_ = 2;
+ this->chd_.count_ = length;
+ this->chd_.pt_ = RTCP_PT_BYE;
+
+ if (length)
+ {
+ ACE_NEW (this->ssrc_list_,
+ ACE_UINT32[length]);
+
+ this->ssrc_list_length_ = length;
+
+ for (int i=0; i<length; i++)
+ this->ssrc_list_[i] = ssrc_list[i];
+ }
+
+ // Optional - if there is a reason for leaving, store it.
+ // The reason is padded with extra zeros because the packet must
+ // end on an even 32-bit boundary.
+ memset(this->reason_, 0, sizeof(this->reason_));
+ if (text)
+ {
+ size_t text_length = ACE_OS::strlen(text);
+ memcpy(this->reason_, text, text_length);
+ this->reason_length_ = static_cast<unsigned char> (text_length);
+ }
+ else
+ this->reason_length_ = 0;
+
+ // Set the packet length
+ this->chd_.length_ = static_cast<ACE_UINT16> (this->chd_.count_ + (this->reason_length_+1)/4);
+ if ((this->reason_length_+1)%4)
+ this->chd_.length_++;
+
+ this->packet_data_ = 0;
+}
+
+//==============================================================================
+
+RTCP_BYE_Packet::RTCP_BYE_Packet(char* buffer, int *len)
+ : RTCP_Packet(buffer)
+{
+ unsigned int index = 0;
+ unsigned int j;
+
+ // The common part of the header is initialized in the parent.
+ index=4;
+
+ ACE_NEW (this->ssrc_list_,
+ ACE_UINT32[this->chd_.count_]);
+ this->ssrc_list_length_ = this->chd_.count_;
+
+ // Store the source ids of the sources leaving the session
+ for (j=0; j<this->chd_.count_; j++)
+ {
+ this->ssrc_list_[j] = ntohl(*(ACE_UINT32*)&buffer[index]);
+ index+=4;
+ }
+
+ // Optional - store the reason for leaving
+ unsigned int temp = this->chd_.length_; // Borland reports a warning on the
+ // following line with out this.
+ memset(this->reason_, 0, sizeof(this->reason_));
+ if (temp > this->chd_.count_)
+ {
+ this->reason_length_ = buffer[index];
+ index++;
+ memcpy(this->reason_, &buffer[index], this->reason_length_);
+ index+=this->reason_length_;
+
+ }
+ else
+ this->reason_length_ = 0;
+
+ // Decrement the length by the size of this message. This is necessary
+ // because multiple RTCP packets may be contained in a single UDP packet.
+ *len-=(chd_.length_+1)*4;
+
+ this->packet_data_ = 0;
+}
+
+//==============================================================================
+
+RTCP_BYE_Packet::~RTCP_BYE_Packet(void)
+{
+ if (this->ssrc_list_)
+ delete []this->ssrc_list_;
+ if (this->packet_data_)
+ delete []this->packet_data_;
+}
+
+//==============================================================================
+
+unsigned int
+RTCP_BYE_Packet::packet_size(void)
+{
+ ACE_UINT16 size = static_cast<ACE_UINT16> ((1+chd_.count_) * 4);
+
+ if (this->reason_length_ > 0)
+ {
+ size += this->reason_length_ + 1;
+ if (size%4)
+ size += 4 - size%4; // pad with zeros to even 32 bit bound
+ }
+
+ return size;
+}
+
+//==============================================================================
+
+void
+RTCP_BYE_Packet::ssrc_list(ACE_UINT32 **ssrc_list, unsigned char &length)
+{
+ *ssrc_list = this->ssrc_list_;
+ length = this->ssrc_list_length_;
+}
+
+//==============================================================================
+
+const char *
+RTCP_BYE_Packet::reason (void)
+{
+ ACE_CString reason = (const char *)this->reason_;
+
+ return reason.c_str();
+}
+
+//==============================================================================
+
+void
+RTCP_BYE_Packet::build_packet(void)
+{
+ unsigned int index;
+ unsigned int i;
+
+ if (this->packet_data_)
+ delete []this->packet_data_;
+
+ ACE_NEW (this->packet_data_,
+ char[this->packet_size()]);
+
+ index = 0;
+ this->packet_data_[index] = static_cast<char> ((this->chd_.ver_ << 6) |
+ (this->chd_.pad_ << 5) |
+ this->chd_.count_);
+ index++;
+ this->packet_data_[index] = this->chd_.pt_;
+ index++;
+ *((ACE_UINT16*)&this->packet_data_[index]) = htons(this->chd_.length_);
+ index+=2;
+
+ for (i=0; i<this->chd_.count_; i++)
+ {
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(this->ssrc_list_[i]);
+ index+=4;
+ }
+
+ if (this->reason_)
+ {
+ this->packet_data_[index] = this->reason_length_;
+ index++;
+ memcpy(&this->packet_data_[index], this->reason_, this->reason_length_);
+ index += this->reason_length_;
+ while (index < this->packet_size())
+ {
+ this->packet_data_[index] = 0;
+ index ++;
+ }
+ }
+}
+
+void
+RTCP_BYE_Packet::dump (void)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "\nRTCP_BYE_Packet:: from ssrc(s) "));
+ for (int i=0; i< this->ssrc_list_length_; i++)
+ ACE_DEBUG ((LM_DEBUG,
+ "%u ",
+ this->ssrc_list_[i]));
+ ACE_DEBUG ((LM_DEBUG,
+ "\n Reason '%s'\n",
+ this->reason_));
+}
+
+RTCP_RR_Packet::RTCP_RR_Packet(ACE_UINT32 ssrc, RR_Block *blocks)
+{
+ RR_Block *block_ptr = blocks;
+
+ this->chd_.count_ = 0;
+ this->chd_.ver_ = 2;
+ this->chd_.pt_ = RTCP_PT_RR;
+ this->ssrc_ = ssrc;
+ this->rr_ = blocks;
+
+ while (block_ptr)
+ {
+ this->chd_.count_++;
+
+ // Can only have 31 receiver reports
+ if (this->chd_.count_ == 31)
+ {
+ block_ptr->next_ = 0;
+ break;
+ }
+
+ block_ptr = block_ptr->next_;
+ }
+
+ this->chd_.length_ = static_cast<ACE_UINT16> (1+6*(this->chd_.count_)); // + profile specific extensions ??
+
+ this->packet_data_ = 0;
+}
+
+//==============================================================================
+
+RTCP_RR_Packet::RTCP_RR_Packet (char* buffer,
+ int *len)
+ :RTCP_Packet (buffer)
+{
+ unsigned int i = 0;
+ RR_Block *local_block_ptr = 0;
+
+ this->rr_ = 0;
+
+ // The common part of the header is initialized in the parent.
+ i=4;
+ this->ssrc_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ for (unsigned int j=0; j<this->chd_.count_; j++)
+ {
+ if (j==0)
+ {
+ ACE_NEW (this->rr_,
+ RR_Block);
+ local_block_ptr = this->rr_;
+ }
+ else
+ {
+ ACE_NEW (local_block_ptr->next_,
+ RR_Block);
+ local_block_ptr = local_block_ptr->next_;
+ }
+
+ local_block_ptr->next_ = 0;
+ local_block_ptr->ssrc_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ ACE_UINT32 temp = ntohl(*(ACE_UINT32*)&buffer[i]);
+ local_block_ptr->fraction_ = (temp&0xff000000) >> 24;
+ local_block_ptr->lost_ = temp & 0x00ffffff;
+ i+=4;
+ local_block_ptr->last_seq_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ local_block_ptr->jitter_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ local_block_ptr->lsr_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ local_block_ptr->dlsr_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ }
+
+ *len-=(this->chd_.length_+1)*4;
+
+ this->packet_data_ = 0;
+}
+
+//==============================================================================
+
+RTCP_RR_Packet::~RTCP_RR_Packet(void)
+{
+ RR_Block *prev;
+
+ if (this->rr_)
+ {
+ while (this->rr_)
+ {
+ prev = this->rr_;
+ this->rr_ = this->rr_->next_;
+ delete prev;
+ }
+ }
+
+ if (this->packet_data_)
+ delete []this->packet_data_;
+}
+
+//==============================================================================
+
+unsigned int
+RTCP_RR_Packet::packet_size(void)
+{
+ ACE_UINT16 size = static_cast<ACE_UINT16> ((2+this->chd_.count_*6) * 4);
+ return size;
+}
+
+//==============================================================================
+
+void
+RTCP_RR_Packet::build_packet(void)
+{
+ int index;
+ RR_Block *local_block_ptr;
+
+ if (this->packet_data_)
+ delete []this->packet_data_;
+
+ ACE_NEW (this->packet_data_,
+ char [this->packet_size ()]);
+
+ index = 0;
+ this->packet_data_[index] = static_cast<char> ((this->chd_.ver_ << 6) |
+ (this->chd_.pad_ << 5) |
+ this->chd_.count_);
+ index++;
+ this->packet_data_[index] = chd_.pt_;
+ index++;
+ *((ACE_UINT16*)&this->packet_data_[index]) = htons(chd_.length_);
+ index+=2;
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(this->ssrc_);
+ index+=4;
+
+ local_block_ptr = this->rr_;
+ while (local_block_ptr)
+ {
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(local_block_ptr->ssrc_);
+ index+=4;
+ ACE_UINT32 temp = htonl((local_block_ptr->fraction_&0xff) << 24) &
+ local_block_ptr->lost_;
+ *((ACE_UINT32*)&this->packet_data_[index]) = temp;
+ index+=4;
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(local_block_ptr->last_seq_);
+ index+=4;
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(local_block_ptr->jitter_);
+ index+=4;
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(local_block_ptr->lsr_);
+ index+=4;
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(local_block_ptr->dlsr_);
+ index+=4;
+ local_block_ptr = local_block_ptr->next_;
+ }
+}
+
+void
+RTCP_RR_Packet::dump (void)
+{
+ RR_Block *b = this->rr_;
+ int count = 1;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\nRTCP_RR_Packet:: from %u - %d rr blocks follow.\n",
+ this->ssrc_,
+ this->chd_.count_));
+
+ while (b)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ " Block %d: ssrc %u; frac %u; lost %u; last seq %u\n",
+ count,
+ b->ssrc_,
+ b->fraction_,
+ b->lost_,
+ b->last_seq_));
+ ACE_DEBUG ((LM_DEBUG,
+ " jitter %u; lsr %u; dlsr %u;\n",
+ b->jitter_,
+ b->lsr_,
+ b->dlsr_));
+
+ b = b->next_;
+ ++count;
+ }
+}
+
+
+RTCP_SDES_Packet::RTCP_SDES_Packet(void) :
+ RTCP_Packet ()
+{
+ this->chd_.pt_ = RTCP_PT_SDES;
+ this->chunk_ = 0;
+ this->packet_data_ = 0;
+ this->num_chunks_ = 0;
+// this->num_items_ = 0;
+}
+
+//==============================================================================
+
+RTCP_SDES_Packet::RTCP_SDES_Packet(char* buffer, int *len):
+ RTCP_Packet (buffer)
+{
+ unsigned int i;
+ sdesChunk_t *cp = 0; // pointer to chunk
+ sdesItem_t *ip = 0; // pointer to item
+
+ // The common part of the control packet header is processed
+ // in the parent. It is 4 bytes long.
+
+ i=4;
+ for (unsigned int j=0; j<this->chd_.count_; j++)
+ {
+ if (j==0)
+ {
+ ACE_NEW (this->chunk_,
+ sdesChunk_t);
+ cp = this->chunk_;
+
+ this->num_chunks_ = 1;
+ }
+ else
+ {
+ ACE_NEW (cp->next_,
+ sdesChunk_t);
+ cp = cp->next_;
+
+ this->num_chunks_++;
+ }
+ cp->next_ = 0;
+ cp->item_ = 0;
+ cp->ssrc_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+
+ while (buffer[i]!=RTCP_SDES_END)
+ {
+ if (!cp->item_)
+ {
+ ACE_NEW (cp->item_,
+ sdesItem_t);
+ ip = cp->item_;
+
+// this->num_items_ = 1;
+ }
+ else
+ {
+ ACE_NEW (ip->next_,
+ sdesItem_t);
+ ip = ip->next_;
+
+// this->num_items_++;
+ }
+ ip->next_ = 0;
+ ip->type_ = buffer[i];
+ i++;
+ if (ip->type_ != RTCP_SDES_PRIV)
+ {
+ ip->info_.standard_.length_ = buffer[i];
+ i++;
+ ACE_NEW (ip->info_.standard_.data_,
+ char[ip->info_.standard_.length_+1]);
+ memcpy(ip->info_.standard_.data_,
+ &buffer[i],
+ ip->info_.standard_.length_);
+ ip->info_.standard_.data_[ip->info_.standard_.length_] = 0;
+ i+=ip->info_.standard_.length_;
+ }
+ else
+ {
+ ip->info_.priv_.name_length_ = buffer[i];
+ i++;
+ ip->info_.priv_.data_length_ = buffer[i];
+ i++;
+ ACE_NEW (ip->info_.priv_.name_,
+ char[ip->info_.priv_.name_length_+1]);
+ memcpy(ip->info_.priv_.name_,
+ &buffer[i],
+ ip->info_.priv_.name_length_);
+ ip->info_.priv_.name_[ip->info_.priv_.name_length_] = 0;
+ i+=ip->info_.priv_.name_length_;
+ ACE_NEW (ip->info_.priv_.data_,
+ char[ip->info_.priv_.data_length_+1]);
+ memcpy(ip->info_.priv_.data_,
+ &buffer[i],
+ ip->info_.priv_.data_length_);
+ ip->info_.priv_.data_[ip->info_.priv_.data_length_] = 0;
+ i+=ip->info_.priv_.data_length_;
+ }
+ }
+ i++; // each chunk ends with a zero (END) item
+ // each chunk must end on an even 32 bit boundary
+ while (i%4) i++;
+ }
+
+ *len-=(this->chd_.length_+1)*4;
+
+ this->packet_data_ = 0;
+}
+
+//==============================================================================
+
+RTCP_SDES_Packet::~RTCP_SDES_Packet(void)
+{
+ sdesChunk_t *cp; // pointer to chunk
+ sdesChunk_t *cpprev;
+ sdesItem_t *ip; // pointer to item
+ sdesItem_t *ipprev;
+
+ cp = this->chunk_;
+ while (cp)
+ {
+ ip = cp->item_;
+ while (ip)
+ {
+ ipprev = ip;
+ ip = ip->next_;
+ if (ipprev->type_ != RTCP_SDES_PRIV)
+ {
+ delete []ipprev->info_.standard_.data_;
+ }
+ else
+ {
+ delete []ipprev->info_.priv_.name_;
+ delete []ipprev->info_.priv_.data_;
+ }
+
+ delete ipprev;
+ }
+ cpprev = cp;
+ cp = cp->next_;
+ delete cpprev;
+ }
+
+ if (this->packet_data_)
+ delete []this->packet_data_;
+}
+
+//==============================================================================
+
+void
+RTCP_SDES_Packet::add_chunk(ACE_UINT32 ssrc)
+{
+ sdesChunk_t *cp = 0; // pointer to chunk
+
+ // If this is the first chunk.
+ if (chd_.count_ == 0)
+ {
+ ACE_NEW (this->chunk_,
+ sdesChunk_t);
+ this->chunk_->next_ = 0;
+ this->chunk_->item_ = 0;
+ cp = this->chunk_;
+ }
+ else
+ {
+ cp = this->chunk_;
+ while (cp->next_)
+ cp = cp->next_;
+
+ ACE_NEW (cp->next_,
+ sdesChunk_t);
+ cp = cp->next_;
+ cp->next_ = 0;
+ cp->item_ = 0;
+ }
+ cp->ssrc_ = ssrc; // store the source
+ chd_.count_++; // increment the source count
+}
+
+//==============================================================================
+
+void
+RTCP_SDES_Packet::add_item (ACE_UINT32 ssrc,
+ unsigned char type,
+ unsigned char length,
+ const char *data)
+{
+ sdesChunk_t *cp; // pointer to chunk
+ sdesItem_t *ip; // pointer to item
+
+ if (this->chunk_ == 0)
+ {
+ this->add_chunk(ssrc);
+ }
+
+ cp = this->chunk_;
+
+ while (cp != 0)
+ {
+ if (cp->ssrc_ == ssrc)
+ {
+ break;
+ }
+
+ if (!cp->next_)
+ {
+ this->add_chunk(ssrc);
+ cp = cp->next_;
+ break;
+ }
+
+ cp = cp->next_;
+ }
+
+ ip = cp->item_;
+
+ if (ip == 0)
+ {
+ ACE_NEW (cp->item_,
+ sdesItem_t);
+
+ ip = cp->item_;
+ ip->next_= 0;
+ }
+ else
+ {
+ while (ip->next_)
+ {
+ ip = ip->next_;
+ }
+
+ ACE_NEW (ip->next_,
+ sdesItem_t);
+
+ ip = ip->next_;
+ ip->next_ = 0;
+ }
+
+ ip->type_ = type;
+
+ ip->info_.standard_.length_ = length;
+
+ ACE_NEW (ip->info_.standard_.data_,
+ char[length]);
+
+ memcpy(ip->info_.standard_.data_, data, length);
+}
+
+//==============================================================================
+
+void
+RTCP_SDES_Packet::add_priv_item (ACE_UINT32 ssrc,
+ unsigned char nameLength,
+ const char* name,
+ unsigned char dataLength,
+ const char* data)
+{
+ sdesChunk_t *cp; // pointer to chunk
+ sdesItem_t *ip; // pointer to item
+
+ if (this->chunk_ == 0)
+ {
+ this->add_chunk(ssrc);
+ }
+
+ cp = this->chunk_;
+
+ while (cp != 0)
+ {
+ if (cp->ssrc_ == ssrc)
+ {
+ break;
+ }
+
+ if (!cp->next_)
+ {
+ this->add_chunk(ssrc);
+ cp = cp->next_;
+ break;
+ }
+
+ cp = cp->next_;
+ }
+
+ ip = cp->item_;
+
+ if (ip == 0)
+ {
+ ACE_NEW (cp->item_,
+ sdesItem_t);
+
+ ip = cp->item_;
+ ip->next_ = 0;
+ }
+ else
+ {
+ while (ip->next_)
+ {
+ ip = ip->next_;
+ }
+
+ ACE_NEW (ip->next_,
+ sdesItem_t);
+
+ ip = ip->next_;
+ ip->next_ = 0;
+ }
+
+ ip->type_ = RTCP_SDES_PRIV;
+
+ ip->info_.priv_.name_length_ = nameLength;
+ ip->info_.priv_.data_length_ = dataLength;
+
+ ACE_NEW (ip->info_.priv_.name_,
+ char[nameLength]);
+
+ ACE_NEW (ip->info_.priv_.data_,
+ char[dataLength]);
+
+ memcpy(ip->info_.priv_.name_, name, nameLength);
+ memcpy(ip->info_.priv_.data_, data, dataLength);
+}
+
+//==============================================================================
+
+unsigned int
+RTCP_SDES_Packet::packet_size(void)
+{
+ int size;
+ sdesChunk_t *cp; // pointer to chunk
+ sdesItem_t *ip; // pointer to item
+
+ // Determine the size of the packet.
+ size = 4; // size of common header data in octets
+
+ cp = this->chunk_;
+ while (cp)
+ {
+ size += 4; // size of ssrc
+ ip = cp->item_;
+
+ while (ip && (ip->type_ != 0))
+ {
+ if (ip->type_ != RTCP_SDES_PRIV)
+ {
+ size += 2 + ip->info_.standard_.length_; // size of item
+ }
+ else
+ {
+ size += 3 + ip->info_.priv_.name_length_ + ip->info_.priv_.data_length_;
+ }
+ ip = ip->next_;
+ }
+ size += 4 - size%4; // pad with zeros to even 32 bit bound
+ cp = cp->next_;
+ }
+
+ chd_.length_ = static_cast<ACE_UINT16> (size/4 - 1);
+
+ return size;
+}
+
+//==============================================================================
+
+void
+RTCP_SDES_Packet::build_packet(void)
+{
+ sdesChunk_t *cp; // pointer to chunk
+ sdesItem_t *ip; // pointer to item
+ int index, i;
+
+ if (this->packet_data_)
+ delete this->packet_data_;
+
+ ACE_NEW (this->packet_data_,
+ char[this->packet_size()]);
+
+ index = 0;
+ this->packet_data_[index] = static_cast<char> ((chd_.ver_ << 6) |
+ (chd_.pad_ << 5) |
+ chd_.count_);
+ index++;
+ this->packet_data_[index] = chd_.pt_;
+ index++;
+ *((ACE_UINT16*)&this->packet_data_[index]) = htons(chd_.length_);
+ index+=2;
+
+ cp = this->chunk_;
+ while (cp)
+ {
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(cp->ssrc_);
+ index+=4;
+
+ ip = cp->item_;
+ while (ip && (ip->type_ != 0))
+ {
+ this->packet_data_[index] = ip->type_;
+ index++;
+ if (ip->type_ != RTCP_SDES_PRIV)
+ {
+ this->packet_data_[index] = ip->info_.standard_.length_;
+ index++;
+ for (i=0; i<ip->info_.standard_.length_; i++)
+ {
+ this->packet_data_[index] = ip->info_.standard_.data_[i];
+ index++;
+ }
+ }
+ else
+ {
+ this->packet_data_[index] = ip->info_.priv_.name_length_;
+ index++;
+ this->packet_data_[index] = ip->info_.priv_.data_length_;
+ index++;
+ for (i=0; i<ip->info_.priv_.name_length_; i++)
+ {
+ this->packet_data_[index] = ip->info_.priv_.name_[i];
+ index++;
+ }
+ for (i=0; i<ip->info_.priv_.data_length_; i++)
+ {
+ this->packet_data_[index] = ip->info_.priv_.data_[i];
+ index++;
+ }
+ }
+
+ ip = ip->next_;
+ }
+
+ this->packet_data_[index] = 0;
+ index++;
+
+ i=1;
+ while ((index)%4)
+ { // pad chunk with zeros to 32 bit bound
+ this->packet_data_[index] = 0;
+ index++;
+ i++;
+ }
+
+ // Store the number of bytes added. TODO: do we need this
+ // this->packet_data_[index - 1] = i;
+
+ cp = cp->next_;
+ }
+}
+
+void
+RTCP_SDES_Packet::dump (void)
+{
+ sdesItem_t *ip;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\nRTCP_SDES_Packet:: "));
+
+ if (this->num_chunks_ != 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Mixers not currently supported.\n"));
+ return;
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "from ssrc %u\n",
+ this->chunk_->ssrc_));
+
+ // Loop through all of the items.
+ ip = this->chunk_->item_;
+
+ while (ip)
+ {
+ // If there is no data to store, continue.
+ if (ip->info_.standard_.length_ == 0)
+ {
+ ip = ip->next_;
+ continue;
+ }
+
+ switch (ip->type_)
+ {
+ case RTCP_SDES_END:
+ break;
+ case RTCP_SDES_CNAME:
+ ACE_DEBUG ((LM_DEBUG,
+ " CNAME '%s'\n",
+ ip->info_.standard_.data_));
+ break;
+ case RTCP_SDES_NAME:
+ ACE_DEBUG ((LM_DEBUG,
+ " NAME '%s'\n",
+ ip->info_.standard_.data_));
+ break;
+ case RTCP_SDES_EMAIL:
+ ACE_DEBUG ((LM_DEBUG,
+ " EMAIL '%s'\n",
+ ip->info_.standard_.data_));
+ break;
+ case RTCP_SDES_PHONE:
+ ACE_DEBUG ((LM_DEBUG,
+ " PHONE '%s'\n",
+ ip->info_.standard_.data_));
+ break;
+ case RTCP_SDES_LOC:
+ ACE_DEBUG ((LM_DEBUG,
+ " LOC '%s'\n",
+ ip->info_.standard_.data_));
+ break;
+ case RTCP_SDES_TOOL:
+ ACE_DEBUG ((LM_DEBUG,
+ " TOOL '%s'\n",
+ ip->info_.standard_.data_));
+ break;
+ case RTCP_SDES_NOTE:
+ ACE_DEBUG ((LM_DEBUG,
+ " NOTE '%s'\n",
+ ip->info_.standard_.data_));
+ break;
+ case RTCP_SDES_PRIV:
+ ACE_DEBUG ((LM_DEBUG,
+ " '%s' '%s'\n",
+ ip->info_.priv_.name_,
+ ip->info_.priv_.data_));
+ break;
+ }
+ ip = ip->next_;
+ }
+
+}
+
+RTCP_SR_Packet::RTCP_SR_Packet(ACE_UINT32 ssrc,
+ ACE_UINT32 ntp_ts_msw,
+ ACE_UINT32 ntp_ts_lsw,
+ ACE_UINT32 timestamp,
+ ACE_UINT32 packets_sent,
+ ACE_UINT32 octets_sent,
+ RR_Block *blocks)
+{
+ RR_Block *block_ptr= 0;
+ chd_.count_ = 0;
+ chd_.ver_ = 2;
+ chd_.pt_ = RTCP_PT_SR;
+
+ this->ssrc_ = ssrc;
+ this->ntp_ts_msw_ = ntp_ts_msw;
+ this->ntp_ts_lsw_ = ntp_ts_lsw;
+ this->rtp_ts_ = timestamp;
+ this->psent_ = packets_sent;
+ this->osent_ = octets_sent;
+ this->rr_ = blocks;
+
+ block_ptr = blocks;
+
+ while (block_ptr)
+ {
+ chd_.count_++;
+
+ // Can only have 31 receiver reports
+ if (this->chd_.count_ == 31)
+ {
+ block_ptr->next_ = 0;
+ break;
+ }
+
+ block_ptr = block_ptr->next_;
+ }
+
+ this->chd_.length_ = static_cast<ACE_UINT16> (6 + 6*(chd_.count_)); //+profile specific extensions ??
+
+ this->packet_data_ = 0;
+}
+
+//==============================================================================
+
+RTCP_SR_Packet::RTCP_SR_Packet (char* buffer,
+ int *len)
+ : RTCP_Packet (buffer)
+{
+ unsigned int i = 0;
+ RR_Block *local_block_ptr = 0;
+
+ this->rr_ = 0;
+
+ // The common part of the header is initialized in the parent.
+ i=4;
+ this->ssrc_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ this->ntp_ts_msw_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ this->ntp_ts_lsw_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ this->rtp_ts_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ this->psent_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ this->osent_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ for (unsigned int j=0; j<this->chd_.count_; j++)
+ {
+ if (j==0)
+ {
+ ACE_NEW (local_block_ptr,
+ RR_Block);
+ this->rr_ = local_block_ptr;
+ }
+ else
+ {
+ ACE_NEW (local_block_ptr->next_,
+ RR_Block);
+ local_block_ptr = local_block_ptr->next_;
+ }
+
+ local_block_ptr->next_ = 0;
+ local_block_ptr->ssrc_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ ACE_UINT32 temp = ntohl(*(ACE_UINT32*)&buffer[i]);
+ local_block_ptr->fraction_ = (temp&0xff000000) >> 24;
+ local_block_ptr->lost_ = temp & 0x00ffffff;
+ i+=4;
+ local_block_ptr->last_seq_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ local_block_ptr->jitter_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ local_block_ptr->lsr_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ local_block_ptr->dlsr_ = ntohl(*(ACE_UINT32*)&buffer[i]);
+ i+=4;
+ }
+
+ *len-=(this->chd_.length_+1)*4;
+
+ this->packet_data_ = 0;
+}
+
+//==============================================================================
+
+RTCP_SR_Packet::~RTCP_SR_Packet(void)
+{
+ RR_Block *prev;
+
+ if (this->rr_)
+ {
+ while (this->rr_)
+ {
+ prev = this->rr_;
+ this->rr_ = this->rr_->next_;
+ delete prev;
+ }
+ }
+
+ if (this->packet_data_)
+ delete []this->packet_data_;
+}
+
+//==============================================================================
+
+unsigned int RTCP_SR_Packet::packet_size (void)
+{
+ ACE_UINT16 size = static_cast<ACE_UINT16> ((2+chd_.count_*6) * 4); // + profile specific extensions ?
+ size += 20; // the first line is the same as RR; 20 more bytes for SR
+
+ return size;
+}
+
+//==============================================================================
+
+void RTCP_SR_Packet::build_packet(void)
+{
+ int index = 0;
+ RR_Block *local_block_ptr;
+
+ if (this->packet_data_)
+ delete []this->packet_data_;
+
+ ACE_NEW (this->packet_data_,
+ char[this->packet_size()]);
+
+ this->packet_data_[index] = static_cast<char> ((this->chd_.ver_ << 6) |
+ (this->chd_.pad_ << 5) |
+ this->chd_.count_);
+ index++;
+ this->packet_data_[index] = this->chd_.pt_;
+ index++;
+ *((ACE_UINT16*)&this->packet_data_[index]) = htons(this->chd_.length_);
+ index+=2;
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(this->ssrc_);
+ index+=4;
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(this->ntp_ts_msw_);
+ index+=4;
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(this->ntp_ts_lsw_);
+ index+=4;
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(this->rtp_ts_);
+ index+=4;
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(this->psent_);
+ index+=4;
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(this->osent_);
+ index+=4;
+
+ local_block_ptr = this->rr_;
+ while (local_block_ptr)
+ {
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(local_block_ptr->ssrc_);
+ index+=4;
+ ACE_UINT32 temp = htonl((local_block_ptr->fraction_&0xff) << 24) &
+ local_block_ptr->lost_;
+ *((ACE_UINT32*)&this->packet_data_[index]) = temp;
+ index+=4;
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(local_block_ptr->last_seq_);
+ index+=4;
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(local_block_ptr->jitter_);
+ index+=4;
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(local_block_ptr->lsr_);
+ index+=4;
+ *((ACE_UINT32*)&this->packet_data_[index]) = htonl(local_block_ptr->dlsr_);
+ index+=4;
+ local_block_ptr = local_block_ptr->next_;
+ }
+}
+
+void
+RTCP_SR_Packet::dump (void)
+{
+ RR_Block *b = this->rr_;
+ int count = 1;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\nRTCP_SR_Packet:: from %u - %d rr blocks follow.\n",
+ this->ssrc_,
+ this->chd_.count_));
+ ACE_DEBUG ((LM_DEBUG,
+ " NTP(sec) %u.%u; RTP ts %u\n",
+ this->ntp_ts_msw_,
+ this->ntp_ts_lsw_,
+ this->rtp_ts_));
+ ACE_DEBUG ((LM_DEBUG,
+ " packets sent %u; octets sent %u\n",
+ this->psent_,
+ this->osent_));
+
+ while (b)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ " Block %d: ssrc %u; frac %u; lost %u; last seq %u\n",
+ count,
+ b->ssrc_,
+ b->fraction_,
+ b->lost_,
+ b->last_seq_));
+ ACE_DEBUG ((LM_DEBUG,
+ " jitter %u; lsr %u; dlsr %u;\n",
+ b->jitter_,
+ b->lsr_,
+ b->dlsr_));
+
+ b = b->next_;
+ ++count;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/RTCP_Packet.h b/TAO/orbsvcs/orbsvcs/AV/RTCP_Packet.h
new file mode 100644
index 00000000000..696378258af
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/RTCP_Packet.h
@@ -0,0 +1,405 @@
+// -*- C++ -*-
+
+// $Id$
+
+#ifndef RTCP_PACKET_INCLUDE
+#define RTCP_PACKET_INCLUDE
+
+#include /**/ "ace/pre.h"
+
+#include "tao/orbconf.h"
+#include "tao/Versioned_Namespace.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @struct RTCP_Common_Header
+ * @brief This is the header data that is common to all RTCP messages.
+ */
+typedef struct
+{
+ /// the RTP version being used
+ unsigned int ver_:2;
+
+ /// indicates whether or not the end of the packet is padded with zeros
+ unsigned int pad_:1;
+
+ /// this value varies by packet type
+ unsigned int count_:5;
+
+ /// RTCP packet type (eg BYE, SR, RR, SDES)
+ unsigned int pt_:8;
+
+ /// packet length in words without this word
+ ACE_UINT16 length_;
+} RTCP_Common_Header;
+
+/**
+ * @class RTCP_Packet
+ * @brief This is an abstract class from which all RTCP packet types are derived.
+ * It contains code used to validate the RTCP packet.
+ */
+
+class RTCP_Packet
+{
+public:
+ /// Constructor for outgoing RTCP packets.
+ RTCP_Packet(void);
+
+ /// Constructor for incoming RTCP packets.
+ RTCP_Packet(char *buffer);
+
+ /// Destructor
+ virtual ~RTCP_Packet();
+
+ /// Returns a pointer to a local buffer containing the packet.
+ void get_packet_data(char **buffer, ACE_UINT16 &length);
+
+ /// Returns the size of the packet.
+ /// Defined in child class.
+ virtual unsigned int packet_size(void) = 0;
+
+ /// Checks the validity of an RTCP packet. RTCP packets can be sent
+ /// together in a compound packet and is_first indicates the first packet
+ /// in a compound packet
+ int is_valid (char is_first);
+
+protected:
+ /// Header data common to all RTCP packets.
+ RTCP_Common_Header chd_;
+
+ /// Buffer to hold byte representation of the RTCP packet.
+ char *packet_data_;
+
+ /// Used to create the byte representation of the RTCP packet.
+ /// Defined in child class.
+ virtual void build_packet(void) = 0;
+};
+
+/**
+ * @class RTCP_BYE_Packet
+ * @brief The BYE RTCP packet is sent by a party when leaving an RTP session.
+ */
+
+class RTCP_BYE_Packet : public RTCP_Packet
+{
+public:
+ /// Constructor for outgoing BYE RTCP packets.
+ /// Takes a synchronization source id list, the list length (1 for non-mixers),
+ /// and an optional reason for leaving the session.
+ RTCP_BYE_Packet (ACE_UINT32 *srcList,
+ unsigned char length,
+ const char* text=0);
+
+ /// Constructor for incoming BYE RTCP packets.
+ RTCP_BYE_Packet (char *buffer,
+ int *len);
+
+ /// Destructor.
+ virtual ~RTCP_BYE_Packet (void);
+
+ /// Returns the size of the packet in bytes.
+ unsigned int packet_size (void);
+
+ /// Returns a pointer to a local list of synchronization source ids that are
+ /// leaving the session.
+ void ssrc_list (ACE_UINT32 **ssrc_list,
+ unsigned char &length);
+
+ /// Returns the reason for leaving the session.
+ const char *reason (void);
+
+ /// Prints the contents of the packet.
+ void dump (void);
+
+private:
+ /// Used to create the byte representation of the RTCP packet.
+ void build_packet();
+
+ /// List of synchronization source ids that are leaving the session.
+ ACE_UINT32 *ssrc_list_;
+
+ /// The number of ssrc's that are leaving the session (1 for non-mixers).
+ unsigned char ssrc_list_length_;
+
+ /// An optional reason for leaving the session.
+ char reason_[256];
+
+ /// The number of bytes in the reason for leaving the session.
+ unsigned char reason_length_;
+};
+
+/**
+ * @struct RR_Block
+ * @brief The receiver report block encapsulates the data that represents the
+ * reception statistics for a particular stream.
+ */
+
+struct RR_Block
+{
+ /// The synchronization source id of the source of the data.
+ ACE_UINT32 ssrc_;
+
+ /// The fraction of RTP data packets lost since the previous SR or RR was sent.
+ unsigned int fraction_:8;
+
+ /// The cumulative number of packets lost.
+ int lost_:24;
+
+ /// The highest extended sequence number received in an RTP packet.
+ ACE_UINT32 last_seq_;
+
+ /// An estimate of the statistical variance of the RTP data packet interarrival
+ /// time measured in timestamp units.
+ ACE_UINT32 jitter_;
+
+ /// The middle 32 bits of the NTP timestamp received in the most recent sender
+ /// report.
+ ACE_UINT32 lsr_;
+
+ /// The delay in 1/65536 seconds since receiving the last sender report.
+ ACE_UINT32 dlsr_;
+
+ /// Link to the next receiver report block.
+ RR_Block *next_;
+};
+
+/**
+ * @class RTCP_RR_Packet
+ * @brief The Receiver Report packet is sent by all members of a session that
+ * are not sending data. It contains a list of RR_Block to represent each
+ * source this party is receiving data from.
+ */
+
+class RTCP_RR_Packet : public RTCP_Packet
+{
+public:
+ /// Constructor for incoming receiver reports.
+ RTCP_RR_Packet (char *buffer, int* len);
+
+ /// Constructor for outgoing receiver reports.
+ RTCP_RR_Packet (ACE_UINT32 ssrc, RR_Block *blocks);
+
+ /// Destructor.
+ virtual ~RTCP_RR_Packet (void);
+
+ /// Returns the size of the packet in bytes.
+ unsigned int packet_size(void);
+
+ /// Returns the synchronization source id of the source sending this packet.
+ ACE_INT32 ssrc (void) { return this->ssrc_; }
+
+ /// Prints the contents of the packet.
+ void dump (void);
+
+private:
+ /// Used to create the byte representation of the RTCP packet.
+ void build_packet(void);
+
+ /// The synchronization source id of the sender of this report.
+ ACE_UINT32 ssrc_;
+
+ /// A linked list of the receiver report block(s) being sent.
+ RR_Block *rr_;
+};
+
+typedef struct sdesItem_s sdesItem_t;
+
+/**
+ * @struct sdesItem_s
+ * @brief This is a linked list of structures containing source description
+ * 'items' such as canonical name, email, location etc.
+ */
+
+struct sdesItem_s
+{
+ /// link to next item.
+ sdesItem_t *next_;
+
+ /// Type of item (eg canonical name).
+ unsigned char type_;
+
+ union
+ {
+ struct
+ {
+ /// Length of an item (in octets).
+ unsigned char length_;
+
+ /// Item text, not null-terminated.
+ char *data_;
+ } standard_;
+ struct
+ {
+ /// Length of the name of an item (in octets).
+ unsigned char name_length_;
+
+ /// Length of the item data (in octets).
+ unsigned char data_length_;
+
+ /// The name of the item, not null-terminated.
+ char *name_;
+
+ /// Item data, not null-terminated.
+ char *data_;
+ } priv_;
+ } info_;
+};
+
+typedef struct sdesChunk_s sdesChunk_t;
+
+/**
+ * @struct sdesChunk_s
+ * @brief This is a linked list of structures containing groups of source
+ * description items. A group of items for a particular synchronization source
+ * id is referred to as a 'chunk'.
+ */
+struct sdesChunk_s
+{
+ /// Link to next item.
+ sdesChunk_t *next_;
+
+ /// The synchronization source id that this chunk describes.
+ ACE_UINT32 ssrc_;
+
+ /// A linked list of items to describe this source.
+ sdesItem_t *item_;
+};
+
+/**
+ * @class RTCP_SDES_Packet
+ * @brief The Source Description packet is sent by all members of a session.
+ * At a minimum, the canonical name (or CNAME) is sent with each RTCP packet.
+ * Other items such as name, email, or location are included less frequently.
+ */
+class RTCP_SDES_Packet : public RTCP_Packet
+{
+public:
+ /// Constructor for incoming SDES packets.
+ RTCP_SDES_Packet(char* buffer, int *len);
+
+ /// Constructor for outgoing SDES packets.
+ RTCP_SDES_Packet(void);
+
+ /// Destructor.
+ virtual ~RTCP_SDES_Packet(void);
+
+ /// This will add a standard item of type and length for the ssrc specified.
+ /// When the first item for a ssrc is added, a chunk is created. Subsequent
+ /// items for that ssrc are added to the same chunk. New chunks are created
+ /// for each unique ssrc.
+ void add_item(ACE_UINT32 ssrc,
+ unsigned char type,
+ unsigned char length,
+ const char* data);
+
+ /// This will add a private item using the name and data for the ssrc specified.
+ /// When the first item for a ssrc is added, a chunk is created. Subsequent
+ /// items for that ssrc are added to the same chunk. New chunks are created
+ /// for each unique ssrc.
+ void add_priv_item(ACE_UINT32 ssrc,
+ unsigned char nameLength,
+ const char *name,
+ unsigned char dataLength,
+ const char *data);
+
+ /// Returns the size of the packet in bytes.
+ unsigned int packet_size(void);
+
+ /// Prints the contents of the packet.
+ void dump (void);
+
+ /// This returns the synchronization source id for this packet. This assumes
+ /// that this source is only receiving messages from end systems (i.e. only
+ /// one source id per SDES)
+ ACE_UINT32 ssrc (void) { return this->chunk_->ssrc_; }
+
+private:
+ /// Used to create the byte representation of the RTCP packet.
+ void build_packet(void);
+
+ /// Add a chunk to the packet.
+ void add_chunk(ACE_UINT32 ssrc);
+
+ /// The number of chunks contained in this packet.
+ /// 1 for end systems, 1+ for mixers
+ unsigned long num_chunks_;
+
+// unsigned long num_items_;
+
+ /// A linked list of chunks for this packet (only 1 for non-mixers).
+ sdesChunk_t *chunk_;
+};
+
+/**
+ * @class RTCP_SR_Packet
+ * @brief The Sender Report packet is sent by all members of a session that
+ * are sending data. It contains statistics on the data being sent out. It
+ * also contains a list of RR_Block to represent each source this party is
+ * receiving data from.
+ */
+
+class RTCP_SR_Packet : public RTCP_Packet
+{
+public:
+ /// Constructor for incoming SR packets.
+ RTCP_SR_Packet(char *buffer, int *len);
+
+ /// Constructor for outgoing SR packets.
+ RTCP_SR_Packet(ACE_UINT32 ssrcVal,
+ ACE_UINT32 ntpMSByte,
+ ACE_UINT32 ntpLSByte,
+ ACE_UINT32 timestamp,
+ ACE_UINT32 pktsSent,
+ ACE_UINT32 octetsSent,
+ RR_Block *rrBlocks);
+
+ /// Destructor
+ virtual ~RTCP_SR_Packet(void);
+
+ /// Returns the size of the packet in bytes.
+ unsigned int packet_size(void);
+
+ /// Returns the synchronization source id for the sender of this packet.
+ ACE_UINT32 ssrc (void) { return this->ssrc_; }
+
+ /// Returns the most significant word of the NTP timestamp.
+ ACE_UINT32 ntp_ts_msw (void) { return this->ntp_ts_msw_; }
+
+ /// Returns the least significant word of the NTP timestamp.
+ ACE_UINT32 ntp_ts_lsw (void) { return this->ntp_ts_lsw_; }
+
+ /// Prints the contents of the packet.
+ void dump (void);
+
+private:
+ /// Used to create the byte representation of the RTCP packet.
+ void build_packet(void);
+
+ /// The synchronization source id of the sender generating this report.
+ ACE_UINT32 ssrc_;
+
+ /// The most significant word of the NTP timestamp.
+ ACE_UINT32 ntp_ts_msw_;
+
+ /// The least significant word of the NTP timestamp.
+ ACE_UINT32 ntp_ts_lsw_;
+
+ /// The RTP timestamp
+ ACE_UINT32 rtp_ts_;
+
+ /// The total number of packets sent.
+ ACE_UINT32 psent_;
+
+ /// The total number of octets sent.
+ ACE_UINT32 osent_;
+
+ /// A linked list of receiver report blocks.
+ RR_Block *rr_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* RTCP_PACKET_INCLUDE */
diff --git a/TAO/orbsvcs/orbsvcs/AV/RTP.cpp b/TAO/orbsvcs/orbsvcs/AV/RTP.cpp
new file mode 100644
index 00000000000..4e53a5f63e5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/RTP.cpp
@@ -0,0 +1,785 @@
+/*
+ * Copyright (c) 1994-1995 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and the Network Research Group at
+ * Lawrence Berkeley Laboratory.
+ * 4. Neither the name of the University nor of the Laboratory may be used
+ * to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+// $Id$
+
+#include "orbsvcs/AV/RTP.h"
+#include "orbsvcs/AV/RTCP.h"
+
+#include "tao/debug.h"
+#include "ace/OS_NS_arpa_inet.h"
+#include "ace/OS_NS_strings.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// RTP_Packet
+
+// Constructor for RTP packets received
+RTP_Packet::RTP_Packet(char* buffer, int length)
+{
+ // skip the standard header info
+ int index = 12;
+
+ memcpy(this->packet_, buffer, length);
+
+ for (int j=0; j<(int)this->cc(); j++)
+ {
+ this->host_byte_order_csrc_list_[j] = ntohl(*(ACE_UINT32*)&buffer[index]);
+ index+=4;
+ }
+
+ // ignore the header extension if there is one
+ if (this->ext())
+ {
+ index+=2;
+ int extension_data_size = ntohs(*(ACE_UINT16*)&buffer[index]);
+ index+=2;
+ index+=extension_data_size;
+
+ this->extension_bytes_ = 4 + extension_data_size;
+ }
+ else
+ this->extension_bytes_ = 0;
+
+ this->packet_size_ = static_cast<ACE_UINT16> (length);
+ this->payload_size_ = static_cast<ACE_UINT16> (length-index);
+
+ // This is necessary only for payload types that have 16 bit values to correct
+ // the network byte ordering.
+ if ((this->pt() == RTP_PT_L16_OTHER) ||
+ (this->pt() == RTP_PT_L16_STEREO) ||
+ (this->pt() == RTP_PT_L16_MONO))
+ {
+ for (int i=0; i < payload_size_; i+=2)
+ {
+ *(ACE_UINT16*)&this->host_byte_order_payload_[i] = ntohs(*(ACE_UINT16*)&this->packet_[index]);
+ index+=2;
+ }
+ }
+ else
+ for (int i=0; i<this->payload_size_; i++)
+ {
+ this->host_byte_order_payload_[i] = this->packet_[index];
+ index++;
+ }
+}
+
+RTP_Packet::RTP_Packet(unsigned char padding,
+ unsigned char marker,
+ unsigned char payload_type,
+ ACE_UINT32 seq_num,
+ ACE_UINT32 timestamp,
+ ACE_UINT32 ssrc,
+ unsigned char csrc_count,
+ ACE_UINT32 *csrc_list,
+ char *data,
+ ACE_UINT16 data_size)
+ :extension_bytes_(0)
+{
+ //size of header (in octets) without contributing sources
+ ACE_UINT16 size = 3*4;
+ int index = 0;
+
+ if (data_size > RTP_MTU-12)
+ {
+ data_size = RTP_MTU-12;
+ ACE_DEBUG ((LM_DEBUG, "\n(%N,%l) RTP_Packet: Warning - packet truncated\n"));
+ }
+
+ if (csrc_count > 15)
+ csrc_count = 15; // Only 15 contributing sources can be specified.
+
+ if (csrc_list != 0)
+ for (unsigned char i=0; i<csrc_count; i++)
+ {
+ size+=4;
+ this->host_byte_order_csrc_list_[i] = csrc_list[i];
+ }
+
+ this->packet_size_ = size + data_size;
+
+ index = 0;
+ this->packet_[index] = ((RTP_VERSION & 0x3) << 6) |
+ ((padding & 0x1) << 5) |
+ ((0 & 0x1) << 4) | // extension bit
+ ((csrc_count & 0xf));
+
+ index++;
+ this->packet_[index] = ((marker & 0x1) << 7 ) |
+ ((payload_type & 0x7f));
+ index++;
+ *((ACE_UINT16*)&this->packet_[index]) = (ACE_UINT16)htons(static_cast<u_short> (seq_num));
+ index+=2;
+ *((ACE_UINT32*)&this->packet_[index]) = (ACE_UINT32)htonl(timestamp);
+ index+=4;
+ *((ACE_UINT32*)&this->packet_[index]) = htonl(ssrc);
+ index+=4;
+
+ for (int i=0; i<csrc_count; i++)
+ {
+ *((ACE_UINT32*)&this->packet_[index]) = htonl(this->host_byte_order_csrc_list_[i]);
+ index+=4;
+ }
+
+ memcpy (this->host_byte_order_payload_, data, data_size);
+
+ this->payload_size_ = data_size;
+
+ // Correct byte ordering for multi-byte payload types.
+ if ((this->pt() == RTP_PT_L16_OTHER) ||
+ (this->pt() == RTP_PT_L16_STEREO) ||
+ (this->pt() == RTP_PT_L16_MONO))
+ {
+ for (int i=0; i<this->payload_size_; i+=2)
+ {
+ *(ACE_UINT16*)&this->packet_[index] = htons(*(ACE_UINT16*)&data[i]);
+ index+=2;
+ }
+ }
+ else
+ for (int i=0; i<this->payload_size_; i++)
+ {
+ this->packet_[index] = data[i];
+ index++;
+ }
+}
+
+RTP_Packet::~RTP_Packet(void)
+{
+}
+
+ACE_UINT16
+RTP_Packet::packet_size(void)
+{
+ return this->packet_size_;
+}
+
+ACE_UINT16
+RTP_Packet::payload_size(void)
+{
+ return this->payload_size_;
+}
+
+unsigned int
+RTP_Packet::ver (void)
+{
+ return ( this->packet_[0] & 0xC0 ) >> 6;
+}
+
+unsigned int
+RTP_Packet::pad (void)
+{
+ return ( this->packet_[0] & 0x20 ) >> 5;
+}
+
+unsigned int
+RTP_Packet::ext (void)
+{
+ return ( this->packet_[0] & 0x10 ) >> 4;
+}
+
+unsigned int
+RTP_Packet::cc (void)
+{
+ return ( this->packet_[0] & 0x0F ) ;
+}
+
+unsigned int
+RTP_Packet::mrk (void)
+{
+ return ( this->packet_[1] & 0x80 ) >> 7;
+}
+
+unsigned int
+RTP_Packet::pt (void)
+{
+ return ( this->packet_[1] & 0x7F ) ;
+}
+
+ACE_UINT16
+RTP_Packet::sn (void)
+{
+ return ntohs(*(ACE_UINT16*)(&this->packet_[2])) ;
+}
+
+ACE_UINT32
+RTP_Packet::ts (void)
+{
+ return ntohl(*(ACE_UINT32*)(&this->packet_[4])) ;
+}
+
+ACE_UINT32
+RTP_Packet::ssrc (void)
+{
+ return ntohl(*(ACE_UINT32*)(&this->packet_[8])) ;
+}
+
+unsigned int
+RTP_Packet::ext_bytes (void)
+{
+ return this->extension_bytes_;
+}
+
+void
+RTP_Packet::get_frame_info (TAO_AV_frame_info *frame_info)
+{
+ frame_info->timestamp = this->mrk();
+ frame_info->timestamp = this->ts();
+ frame_info->ssrc = this->ssrc();
+ frame_info->sequence_num = this->sn();
+ frame_info->format = static_cast<CORBA::Octet> (this->pt());
+}
+
+int
+RTP_Packet::is_valid (void)
+{
+ // taken from RFC 1889 - Appendix A.1
+
+ // make sure the RTP version is correct
+ if (this->ver() != RTP_VERSION)
+ return 0;
+
+ // make sure the payload type is not SR or RR
+ if ((this->pt() == RTCP_PT_SR) || (this->pt() == RTCP_PT_RR))
+ return 0;
+
+ // if the p bit is set, the last octet of the packet must contain a valid
+ // octet count, in particular, less than the total packet length minus
+ // the header size.
+ if (this->pad() != 0)
+ if ((unsigned int)this->packet_[this->packet_size_] >=
+ (this->packet_size_ - (12 + this->cc() + this->extension_bytes_)))
+ return 0;
+
+ // If there is an extension, it is ignored (taken care of in constructor)
+
+ // The length of the packet must be consistent with CC and payload type (if
+ // payloads have a known length)
+
+ return 1;
+}
+
+void
+RTP_Packet::get_csrc_list (ACE_UINT32 **csrc_list, ACE_UINT16 &length)
+{
+ *csrc_list = this->host_byte_order_csrc_list_;
+ length = static_cast<ACE_UINT16> (this->cc ());
+}
+
+void
+RTP_Packet::get_payload (char **payload, ACE_UINT16 &length)
+{
+ *payload = this->host_byte_order_payload_ ;
+ length = this->payload_size_;
+}
+
+void
+RTP_Packet::get_packet_data (char **packet, ACE_UINT16 &length)
+{
+ *packet = this->packet_;
+ length = this->packet_size_;
+}
+
+
+// TAO_AV_RTP_Object
+
+int
+TAO_AV_RTP_Object::handle_input (void)
+{
+ TAO_AV_frame_info frame_info;
+
+ if (TAO_debug_level > 1)
+ ACE_DEBUG ((LM_DEBUG,
+ "\nTAO_AV_RTP_Object::handle_input\n"));
+
+ // Handles the incoming RTP packet input.
+ this->frame_.rd_ptr (this->frame_.base ());
+
+ int n = this->transport_->recv (this->frame_.rd_ptr (),
+ this->frame_.size ());
+ if (n == 0)
+ ACE_ERROR_RETURN ( (LM_ERROR,"TAO_AV_RTP::handle_input:connection closed\n"),-1);
+ if (n < 0)
+ {
+ if ((errno == EADDRNOTAVAIL) || (errno == ECONNRESET))
+ {
+ this->connection_gone_ = 1;
+ return -1;
+ }
+ else
+ ACE_ERROR_RETURN ( (LM_ERROR,"TAO_AV_RTP::handle_input:recv error\n"),-1);
+ }
+
+ this->frame_.wr_ptr (this->frame_.rd_ptr () + n);
+ ACE_Addr *addr = this->transport_->get_peer_addr ();
+
+ if(this->control_object_)
+ this->control_object_->handle_control_input (&this->frame_, *addr);
+
+ // Get payload that has been converted to host byte order
+ char *data_ptr;
+ ACE_UINT16 length;
+ RTP_Packet rtp_packet(this->frame_.rd_ptr (),
+ static_cast<int> (this->frame_.length ()));
+
+ rtp_packet.get_frame_info (&frame_info);
+ rtp_packet.get_payload(&data_ptr, length);
+
+ this->frame_.rd_ptr (this->frame_.base ());
+ memcpy (this->frame_.rd_ptr (), data_ptr, length);
+ this->frame_.wr_ptr (this->frame_.rd_ptr() + length);
+
+ this->callback_->receive_frame (&this->frame_, &frame_info, *addr);
+
+ return 0;
+}
+
+int
+TAO_AV_RTP_Object::send_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info)
+{
+// ACE_Addr *addr = this->transport_->get_peer_addr ();
+
+ if (this->connection_gone_)
+ {
+ errno = ECONNRESET;
+ return -1;
+ }
+
+ int result = -1;
+ RTP_Packet *rtp_packet;
+ ACE_UINT32 csrc_count = 0; // Assume for now no mixers/translators
+ ACE_UINT32 *csrc_list = 0;
+
+ if (frame_info != 0)
+ {
+ if (frame_info->format != this->format_)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_RTP_Object::send_frame - error: format type mismatch"));
+ if (frame_info->ssrc != 0)
+ this->ssrc_ = frame_info->ssrc;
+
+ TAO_AV_RTCP_Object *rtcp_prot_obj = dynamic_cast<TAO_AV_RTCP_Object*> (this->control_object_);
+ // set the ssrc on the control object so the RTCP traffic can be matched
+ // to the RTP traffic
+ rtcp_prot_obj->ssrc(this->ssrc_);
+
+ ACE_NEW_RETURN (rtp_packet,
+ RTP_Packet (0, // padding
+ frame_info->boundary_marker, // marker
+ static_cast<unsigned char> (this->format_), // payload type
+ frame_info->sequence_num, // sequence num
+ frame_info->timestamp, // time stamp
+ this->ssrc_, // ssrc
+ static_cast<unsigned char> (csrc_count), // csrc count
+ csrc_list, // csrc list
+ frame->rd_ptr (), // data
+ (ACE_UINT16)frame->length ()),// data size
+ -1);
+
+ frame_info->sequence_num ++;
+ }
+ else
+ {
+ // TODO: For periodic RTP packets (constant rate), the RFC suggests
+ // increasing the clock by the number of samples each frame rather
+ // than relying on the system time
+
+ // The RFC specifies at least one timestamp unit per sample as well as a
+ // random offset. It used to be in milliseconds so I left it that way
+ // for non-audio streams.
+ unsigned int samples_per_sec;
+ double samples_per_usec;
+
+ switch (this->format_)
+ {
+ case RTP_PT_PCMU:
+ case RTP_PT_CELP:
+ case RTP_PT_G721:
+ case RTP_PT_GSM:
+ case RTP_PT_DVI:
+ case RTP_PT_LPC:
+ case RTP_PT_PCMA:
+ case RTP_PT_G722:
+ samples_per_sec = 8000;
+ break;
+ case RTP_PT_L16_STEREO:
+ case RTP_PT_L16_MONO:
+ samples_per_sec = 44100;
+ break;
+ default:
+ samples_per_sec = 1000000;
+ };
+
+ samples_per_usec = samples_per_sec/1000000.0;
+
+ ACE_Time_Value now = ACE_OS::gettimeofday();
+
+ ACE_UINT32 ts = (ACE_UINT32)
+ (now.sec () * samples_per_sec +
+ ((double)now.usec () * samples_per_usec) +
+ this->timestamp_offset_);
+
+ ACE_NEW_RETURN (rtp_packet,
+ RTP_Packet (0, // padding
+ 0, // marker
+ static_cast<unsigned char> (this->format_), // payload type
+ this->sequence_num_, // sequence num
+ ts, // time stamp
+ this->ssrc_, // ssrc
+ static_cast<unsigned char> (csrc_count), // csrc count
+ csrc_list, // csrc list
+ frame->rd_ptr (), // data
+ (ACE_UINT16)frame->length ()),// data size
+ -1);
+
+ this->sequence_num_ ++;
+ }
+
+ char *data_ptr;
+ ACE_UINT16 data_length;
+ rtp_packet->get_packet_data (&data_ptr, data_length);
+
+ ACE_Message_Block mb (data_ptr, data_length);
+ mb.wr_ptr (data_length);
+
+ result = this->transport_->send (&mb);
+ if (result < 0)
+ ACE_ERROR_RETURN ( (LM_ERROR,"TAO_AV_RTP::send_frame failed\n"),result);
+
+ TAO_AV_RTCP_Object *rtcp_prot_obj = dynamic_cast<TAO_AV_RTCP_Object*> (this->control_object_);
+ if (rtcp_prot_obj)
+ rtcp_prot_obj->handle_control_output (&mb);
+
+ delete rtp_packet;
+
+ return 0;
+}
+
+int
+TAO_AV_RTP_Object::send_frame (const iovec *iov,
+ int iovcnt,
+ TAO_AV_frame_info *frame_info)
+{
+ int result = -1;
+ RTP_Packet *rtp_packet = 0;
+ ACE_UINT32 csrc_count = 0; // Assume for now no mixers/translators
+ ACE_UINT32 *csrc_list = 0;
+
+ if (this->connection_gone_)
+ {
+ errno = ECONNRESET;
+ return -1;
+ }
+
+ if (frame_info != 0)
+ {
+ if (frame_info->format != this->format_)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_RTP_Object::send_frame - error: format type mismatch"));
+ this->sequence_num_ = static_cast<ACE_UINT16> (frame_info->sequence_num);
+ if (frame_info->ssrc != 0)
+ this->ssrc_ = frame_info->ssrc;
+
+ TAO_AV_RTCP_Object *rtcp_prot_obj = dynamic_cast<TAO_AV_RTCP_Object*> (this->control_object_);
+ // set the ssrc on the control object so the RTCP traffic can be matched
+ // to the RTP traffic
+ rtcp_prot_obj->ssrc(this->ssrc_);
+ ACE_UINT16 data_size = static_cast<ACE_UINT16> (iov[0].iov_len);
+
+ ACE_NEW_RETURN (rtp_packet,
+ RTP_Packet (0, // padding
+ frame_info->boundary_marker, // marker
+ static_cast<unsigned char> (this->format_), // payload type
+ frame_info->sequence_num, // sequence num
+ frame_info->timestamp, // time stamp
+ this->ssrc_, // ssrc
+ static_cast<unsigned char> (csrc_count), // csrc count
+ csrc_list, // csrc list
+ (char *)iov[0].iov_base, // data
+ data_size), // data size
+ -1);
+
+ frame_info->sequence_num ++;
+ }
+ else
+ {
+ // TODO: For periodic RTP packets (constant rate), the RFC suggests
+ // increasing the clock by the number of samples each frame rather
+ // than relying on the system time
+
+ // The RFC specifies at least one timestamp unit per sample as well as a
+ // random offset. It used to be in milliseconds so I left it that way
+ // for non-audio streams.
+
+ unsigned int samples_per_sec;
+ double samples_per_usec;
+
+ switch (this->format_)
+ {
+ case RTP_PT_PCMU:
+ case RTP_PT_CELP:
+ case RTP_PT_G721:
+ case RTP_PT_GSM:
+ case RTP_PT_DVI:
+ case RTP_PT_LPC:
+ case RTP_PT_PCMA:
+ case RTP_PT_G722:
+ samples_per_sec = 8000;
+ break;
+ case RTP_PT_L16_STEREO:
+ case RTP_PT_L16_MONO:
+ samples_per_sec = 44100;
+ break;
+ default:
+ samples_per_sec = 1000000;
+ };
+
+ samples_per_usec = samples_per_sec/1000000.0;
+
+ ACE_Time_Value now = ACE_OS::gettimeofday();
+
+ ACE_UINT32 ts = (ACE_UINT32)
+ (now.sec () * samples_per_sec +
+ ((double)now.usec () * samples_per_usec) +
+ this->timestamp_offset_);
+ ACE_UINT16 data_size = static_cast<ACE_UINT16> (iov[0].iov_len);
+
+ ACE_NEW_RETURN (rtp_packet,
+ RTP_Packet (0, // padding
+ 0, // marker
+ static_cast<unsigned char> (this->format_), // payload type
+ this->sequence_num_, // sequence num
+ ts, // time stamp
+ this->ssrc_, // ssrc
+ static_cast<unsigned char> (csrc_count), // csrc count
+ csrc_list, // csrc list
+ (char *)iov[0].iov_base, // data
+ data_size), // data size
+ -1);
+
+ this->sequence_num_ ++;
+ }
+
+ char *data_ptr;
+ ACE_UINT16 data_length;
+ rtp_packet->get_packet_data (&data_ptr, data_length);
+
+ iovec send_iov[ACE_IOV_MAX];
+ send_iov [0].iov_base = data_ptr;
+ send_iov [0].iov_len = data_length;
+ for (int i=1;i<iovcnt; i++)
+ send_iov [i] = iov [i];
+ result = this->transport_->send (send_iov, iovcnt);
+
+ delete rtp_packet;
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_RTP::send_frame failed\n"),result);
+
+ return 0;
+}
+
+int
+TAO_AV_RTP_Object::send_frame (const char*,
+ size_t)
+{
+ return 0;
+}
+
+
+TAO_AV_RTP_Object::TAO_AV_RTP_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport)
+ :TAO_AV_Protocol_Object (callback,transport),
+ control_object_ (0),
+ connection_gone_ (0)
+{
+ this->sequence_num_ = static_cast<ACE_UINT16> (ACE_OS::rand ());
+ this->timestamp_offset_ = ACE_OS::rand ();
+
+ char buf [BUFSIZ];
+ int result = ACE_OS::hostname (buf, BUFSIZ);
+ unsigned long ipaddr = 0;
+ if (result == 0)
+ ipaddr = ACE_OS::inet_addr (buf);
+ this->ssrc_ = TAO_AV_RTCP::alloc_srcid (ipaddr);
+
+ this->frame_.size (2 * this->transport_->mtu ());
+}
+
+TAO_AV_RTP_Object::~TAO_AV_RTP_Object (void)
+{
+}
+
+int
+TAO_AV_RTP_Object::destroy (void)
+{
+ if(this->control_object_)
+ this->control_object_->destroy ();
+
+ this->callback_->handle_destroy ();
+ delete this;
+
+ return 0;
+}
+
+int
+TAO_AV_RTP_Object::set_policies (const TAO_AV_PolicyList &policy_list)
+{
+ this->policy_list_ = policy_list;
+ CORBA::ULong const num_policies = this->policy_list_.length ();
+ TAO_AV_Policy *policy = 0;
+
+ for (u_int i=0; i< num_policies;i++)
+ {
+ policy = this->policy_list_ [i];
+ switch (policy->type ())
+ {
+ case TAO_AV_PAYLOAD_TYPE_POLICY:
+ {
+ TAO_AV_Payload_Type_Policy *payload_policy =
+ static_cast<TAO_AV_Payload_Type_Policy *> (policy);
+ if (payload_policy == 0)
+ ACE_ERROR_RETURN ( (LM_ERROR,"TAO_AV_RTP_Object::send_frame:Payload policy not defined\n"),-1);
+ this->format_ = payload_policy->value ();
+ }
+ break;
+ case TAO_AV_SSRC_POLICY:
+ {
+ TAO_AV_SSRC_Policy *ssrc_policy =
+ static_cast<TAO_AV_SSRC_Policy *> (policy);
+ if (ssrc_policy == 0)
+ ACE_ERROR_RETURN ( (LM_ERROR,"TAO_AV_RTP_Object::send_frame:SSRC policy not defined\n"),-1);
+ this->ssrc_ = ssrc_policy->value ();;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ return 0;
+}
+
+void
+TAO_AV_RTP_Object::control_object (TAO_AV_Protocol_Object *object)
+{
+ this->control_object_ = object;
+ TAO_AV_RTCP_Object *rtcp_prot_obj = dynamic_cast<TAO_AV_RTCP_Object*> (this->control_object_);
+ rtcp_prot_obj->ssrc (this->ssrc_);
+ rtcp_prot_obj->ts_offset (this->timestamp_offset_);
+}
+
+int
+TAO_AV_RTP_Object::start (void)
+{
+ this->control_object_->start ();
+ return this->callback_->handle_start ();
+}
+
+int
+TAO_AV_RTP_Object::stop (void)
+{
+ this->control_object_->stop ();
+ return this->callback_->handle_stop ();
+}
+
+// TAO_AV_RTP_Flow_Factory
+TAO_AV_RTP_Flow_Factory::TAO_AV_RTP_Flow_Factory (void)
+{
+}
+
+TAO_AV_RTP_Flow_Factory::~TAO_AV_RTP_Flow_Factory (void)
+{
+}
+
+int
+TAO_AV_RTP_Flow_Factory::init (int /* argc */,
+ char * /* argv */ [])
+{
+ return 0;
+}
+
+TAO_AV_Protocol_Object*
+TAO_AV_RTP_Flow_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;
+
+ if( endpoint->get_callback (entry->flowname (), callback) ) {
+ ACE_ERROR_RETURN ((LM_ERROR, "(%N,%l) Invalid callback\n"), 0);
+ }
+
+ TAO_AV_Protocol_Object *object = 0;
+ ACE_NEW_RETURN (object,
+ TAO_AV_RTP_Object (callback,
+ transport),
+ 0);
+ callback->open (object,
+ handler);
+ endpoint->set_protocol_object (entry->flowname (),
+ object);
+
+ endpoint->protocol_object_set ();
+ return object;
+}
+
+int
+TAO_AV_RTP_Flow_Factory::match_protocol (const char *flow_string)
+{
+ if (ACE_OS::strncasecmp (flow_string,"RTP",3) == 0)
+ {
+ return 1;
+ }
+ return 0;
+}
+
+const char *
+TAO_AV_RTP_Flow_Factory::control_flow_factory (void)
+{
+ return "RTCP";
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_AV, TAO_AV_RTP_Flow_Factory)
+ACE_STATIC_SVC_DEFINE (TAO_AV_RTP_Flow_Factory,
+ ACE_TEXT ("RTP_Flow_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_AV_RTP_Flow_Factory),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
diff --git a/TAO/orbsvcs/orbsvcs/AV/RTP.h b/TAO/orbsvcs/orbsvcs/AV/RTP.h
new file mode 100644
index 00000000000..8cc883386a4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/RTP.h
@@ -0,0 +1,423 @@
+// -*- C++ -*-
+
+/*-
+ * Copyright (c) 1993-1994 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and the Network Research Group at
+ * Lawrence Berkeley Laboratory.
+ * 4. Neither the name of the University nor of the Laboratory may be used
+ * to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+//=============================================================================
+/**
+ * @file RTP.h
+ *
+ * $Id$
+ *
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_AV_RTP_H
+#define TAO_AV_RTP_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/AV_export.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+#include "ace/Service_Config.h"
+
+
+#define RTP_PT_BVC 22 /* Berkeley video codec */
+
+/* RTP standard content encodings for video */
+#define RTP_PT_RGB8 23 /* 8-bit dithered RGB */
+#define RTP_PT_HDCC 24 /* SGI proprietary */
+#define RTP_PT_CELLB 25 /* Sun CellB */
+#define RTP_PT_JPEG 26 /* JPEG */
+#define RTP_PT_CUSEEME 27 /* Cornell CU-SeeMe */
+#define RTP_PT_NV 28 /* Xerox PARC nv */
+#define RTP_PT_PICW 29 /* BB&N PictureWindow */
+#define RTP_PT_CPV 30 /* Concept/Bolter/Viewpoint codec */
+#define RTP_PT_H261 31 /* ITU H.261 */
+#define RTP_PT_MPEG 32 /* MPEG-I & MPEG-II */
+#define RTP_PT_MP2T 33 /* MPEG-II either audio or video */
+
+/* backward compat hack for decoding RTPv1 ivs streams */
+#define RTP_PT_H261_COMPAT 127
+
+/* RTP standard content encodings for audio */
+#define RTP_PT_PCMU 0 /* 8k */
+#define RTP_PT_CELP 1 /* 8k */
+#define RTP_PT_G721 2 /* 8k */
+#define RTP_PT_GSM 3 /* 8k */
+#define RTP_PT_DVI 5 /* 8k */
+#define RTP_PT_LPC 7 /* 8k */
+#define RTP_PT_PCMA 8 /* 8k */
+#define RTP_PT_G722 9 /* 8k */
+#define RTP_PT_L16_STEREO 10 /* 44.1k */
+#define RTP_PT_L16_MONO 11 /* 44.1k */
+
+/* TODO: keep??
+ non-standard encodings for audio
+ */
+#define RTP_PT_L16_OTHER 23 /* */
+
+/* Offset from UNIX's epoch to the NTP epoch in seconds (NTP's JAN_1970) */
+#define RTP_EPOCH_OFFSET 2208988800UL
+#define RTP_VERSION 2
+
+#define RTP_M 0x0080 /* Marker: significant event <e.g. frame boundary> */
+#define RTP_P 0x2000 /* Padding is present */
+#define RTP_X 0x1000 /* Extension Header is present */
+
+
+#define RTCP_PT_SR 200 /* sender report */
+#define RTCP_PT_RR 201 /* receiver report */
+#define RTCP_PT_SDES 202 /* source description */
+#define RTCP_SDES_END 0 /* indicates the end of the sdes message */
+#define RTCP_SDES_CNAME 1 /* official name (mandatory) */
+#define RTCP_SDES_NAME 2 /* personal name (optional) */
+#define RTCP_SDES_EMAIL 3 /* e-mail addr (optional) */
+#define RTCP_SDES_PHONE 4 /* telephone # (optional) */
+#define RTCP_SDES_LOC 5 /* geographical location */
+#define RTCP_SDES_TOOL 6 /* name/(vers) of app */
+#define RTCP_SDES_NOTE 7 /* transient messages */
+#define RTCP_SDES_PRIV 8 /* private SDES extensions */
+#define RTCP_PT_BYE 203 /* end of participation */
+#define RTCP_PT_APP 204 /* application specific functions */
+
+#define RTCP_SDES_MIN 1
+
+#define RTP_SEQ_MOD (1<<16)
+
+
+/*
+ * Parameters controling the RTCP report rate timer.
+ */
+#define RTCP_SESSION_BW_FRACTION (0.05)
+#define RTCP_MIN_RPT_TIME (5.)
+#define RTCP_SENDER_BW_FRACTION (0.25)
+#define RTCP_RECEIVER_BW_FRACTION (1. - RTCP_SENDER_BW_FRACTION)
+#define RTCP_SIZE_GAIN (1./8.)
+
+/*
+ * Largest (user-level) packet size generated by our rtp applications.
+ * Individual video formats may use smaller mtu's.
+ */
+#define RTP_MTU 2*ACE_MAX_DGRAM_SIZE
+
+#define MAXHDR 24
+
+#include "orbsvcs/AV/Policy.h"
+#include "orbsvcs/AV/FlowSpec_Entry.h"
+#include "orbsvcs/AV/MCast.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//------------------------------------------------------------
+// TAO_AV_RTP
+//------------------------------------------------------------
+
+/**
+ * @class TAO_AV_RTP
+ * @brief Encapsulate the Real Time Protocol (RTP) header format.
+ */
+class TAO_AV_Export TAO_AV_RTP
+{
+public:
+ /* Basic RTP header */
+ struct rtphdr
+ {
+ ACE_UINT16 rh_flags; /* T:2 P:1 X:1 CC:4 M:1 PT:7 */
+ ACE_UINT16 rh_seqno; /* sequence number */
+ ACE_UINT32 rh_ts; /* media-specific time stamp */
+ ACE_UINT32 rh_ssrc; /* synchronization src id */
+ /* data sources follow per cc */
+ };
+
+ /*
+ * Motion JPEG encapsulation.
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | MBZ | frag offset |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Type | Q | Width | Height |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ * Type = Index into a table of predefined JPEG parameters
+ * Width = Width of input in 8-pixel blocks
+ * Height = Height of input in 8-pixel blocks
+ * Q = Quality factor (0-100 = std, >100 = custom)
+ * Frag offset = The byte offset into the frame for the data in
+ * this packet
+ */
+ struct jpeghdr
+ {
+ ACE_UINT32 off; /* fragment offset */
+ unsigned char type; /* id of jpeg decoder params */
+ unsigned char q; /* quantization factor (or table id) */
+ unsigned char width; /* 1/8 frame width */
+ unsigned char height; /* 1/8 frame height */
+ };
+
+ /*
+ * NV encapsulation.
+ */
+ struct nvhdr
+ {
+ ACE_UINT16 width;
+ ACE_UINT16 height;
+ /* nv data */
+ };
+
+ /*
+ * CellB encapsulation.
+ */
+ struct cellbhdr
+ {
+ ACE_UINT16 x;
+ ACE_UINT16 y;
+ ACE_UINT16 width;
+ ACE_UINT16 height;
+ /* cells */
+ };
+
+ /*
+ * H.261 encapsulation.
+ * See Internet draft.
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |SBIT |EBIT |I|V| GOBN | MBAP | QUANT | HMVD | VMVD |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+#ifdef notdef
+ struct h261hdr
+ {
+ ACE_UINT16 flags;
+ ACE_UINT16 off;
+ };
+#endif
+
+ struct bvchdr
+ {
+ unsigned char version;
+ unsigned char pad;
+ unsigned char width;
+ unsigned char height;
+ ACE_UINT32 quant;
+ unsigned char sbit;
+ unsigned char ebit;
+ ACE_UINT16 blkno;
+ };
+
+};
+
+/**
+ * @class RTP_Packet
+ * @brief This class encapsulates all the necessary information to break down
+ * or build up an RTP data packet as well as operations to access all data
+ * items in the packet.
+ */
+class RTP_Packet
+{
+public:
+ /// Constructor for incoming RTP packets.
+ RTP_Packet(char* buffer,
+ int length);
+
+ /// Constructor for outgoing RTP packets
+ RTP_Packet(unsigned char padding,
+ unsigned char marker,
+ unsigned char payloadType,
+ ACE_UINT32 sequenceNumber,
+ ACE_UINT32 timeStamp,
+ ACE_UINT32 syncSource,
+ unsigned char contribSourcCount,
+ ACE_UINT32 contribSourceList[],
+ char *data,
+ ACE_UINT16 dataSize);
+
+ /// Destructor
+ ~RTP_Packet(void);
+
+ /// Returns the size of the RTP packet in bytes.
+ ACE_UINT16 packet_size(void);
+
+ /// Returns the size of the payload in bytes.
+ ACE_UINT16 payload_size(void);
+
+ /// Populates the passed in frame_info.
+ void get_frame_info (TAO_AV_frame_info *frame_info);
+
+ /// Returns 1 if packet is valid and 0 if not.
+ int is_valid (void);
+
+ /// Returns the RTP version of the packet.
+ unsigned int ver (void);
+
+ /// Returns 1 if the padding bit is set, 0 if not.
+ unsigned int pad (void);
+
+ /// Returns 1 if the header extension bit is set, 0 if not.
+ unsigned int ext (void);
+
+ /// Returns the number of bytes in the header extension or 0 if no extension.
+ unsigned int ext_bytes (void);
+
+ /// Returns the contributing source count.
+ /// This should only be non-zero for mixers.
+ unsigned int cc (void);
+
+ /// Returns 1 if the marker bit is set, 0 if not.
+ unsigned int mrk (void);
+
+ /// Returns the payload type of the packet.
+ unsigned int pt (void);
+
+ /// Returns the sequence number of the packet.
+ ACE_UINT16 sn (void);
+
+ /// Returns the timestamp of the packet.
+ ACE_UINT32 ts (void);
+
+ /// Returns the synchronization source id of the packet.
+ ACE_UINT32 ssrc (void);
+
+ /// Returns a pointer to the local contributing source list and its length.
+ /// This should be empty except for mixers.
+ /// RTP_Packet retains ownership.
+ void get_csrc_list (ACE_UINT32 **csrc_list, ACE_UINT16 &length);
+
+ /// Returns a pointer to the locally stored payload and its size in bytes.
+ /// The payload is returned in host byte order.
+ /// RTP_Packet retains ownership.
+ void get_payload (char **payload, ACE_UINT16 &size);
+
+ /// Returns a pointer to the locally stored rtp packet and its size in bytes.
+ /// RTP_Packet retains ownership.
+ void get_packet_data (char **packet, ACE_UINT16 &size);
+
+private:
+ /// Local buffer to hold the RTP packet.
+ char packet_[RTP_MTU];
+
+ /// Local buffer to hold the contributing source list with the values stored
+ /// in host byte order.
+ ACE_UINT32 host_byte_order_csrc_list_[15];
+
+ /// Local buffer to hold the payload with the values stored in host byte order.
+ char host_byte_order_payload_[RTP_MTU];
+
+ /// The number of bytes in the header extension - 0 if no extension.
+ unsigned int extension_bytes_;
+
+ /// The size of the overall data packet.
+ ACE_UINT16 packet_size_;
+
+ /// The size of the payload portion of the packet.
+ ACE_UINT16 payload_size_;
+};
+
+/**
+ * @class TAO_AV_RTP_Object
+ * @brief TAO_AV_Protocol_object for the RTP protocol
+ */
+class TAO_AV_Export TAO_AV_RTP_Object : public TAO_AV_Protocol_Object
+{
+public:
+ TAO_AV_RTP_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport);
+
+ virtual ~TAO_AV_RTP_Object (void);
+
+ virtual int start (void);
+ virtual int stop (void);
+ virtual int handle_input (void);
+ virtual int send_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info = 0);
+
+ virtual int send_frame (const iovec *iov,
+ int iovcnt,
+ TAO_AV_frame_info *frame_info = 0);
+
+ virtual int send_frame (const char*buf,
+ size_t len);
+
+ virtual int destroy (void);
+ virtual int set_policies (const TAO_AV_PolicyList &policy_list);
+ virtual void control_object (TAO_AV_Protocol_Object *object);
+
+protected:
+ ACE_UINT16 sequence_num_;
+ ACE_UINT32 timestamp_offset_;
+ int format_;
+ ACE_UINT32 ssrc_;
+ TAO_AV_Protocol_Object *control_object_;
+
+ /// Pre-allocated memory to receive the data...
+ ACE_Message_Block frame_;
+
+ int connection_gone_;
+};
+
+
+
+/**
+ * @class TAO_AV_RTP_Flow_Factory
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_RTP_Flow_Factory : public TAO_AV_Flow_Protocol_Factory
+{
+public:
+ /// Initialization hook.
+ TAO_AV_RTP_Flow_Factory (void);
+ virtual ~TAO_AV_RTP_Flow_Factory (void);
+ virtual int init (int argc, char *argv[]);
+ virtual int match_protocol (const char *flow_string);
+ 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);
+ virtual const char*control_flow_factory (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (TAO_AV_RTP_Flow_Factory)
+ACE_FACTORY_DECLARE (TAO_AV, TAO_AV_RTP_Flow_Factory)
+
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_RTP_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/Resource_Factory.h b/TAO/orbsvcs/orbsvcs/AV/Resource_Factory.h
new file mode 100644
index 00000000000..a14a9087531
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Resource_Factory.h
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Resource_Factory.h
+ * $Id$
+ *
+ * @author Yamuna Krishnamurthy
+ */
+//=============================================================================
+
+
+#ifndef TAO_AV_DEFAULT_RESOURCE_FACTORY_H
+#define TAO_AV_DEFAULT_RESOURCE_FCATORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/AVStreams_i.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Service_Config.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_AV_Resource_Factory
+ *
+ * @brief TAO AV Streams default resource factory abstract
+ * The AV Streams resource factory loads the
+ * pluggable transport and flow protocol factories
+ * in the corresponding factory sets.
+ *
+ *
+ */
+class TAO_AV_Export TAO_AV_Resource_Factory
+: public ACE_Service_Object
+{
+public:
+
+ /**
+ * @name Service Configurator Hooks
+ */
+ //@{
+ /// Dynamic linking hook
+ virtual int init (int argc, char *argv[]) = 0;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_DEFAULT_RESOURCE_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.cpp b/TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.cpp
new file mode 100644
index 00000000000..1197d709257
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.cpp
@@ -0,0 +1,932 @@
+// $Id$
+
+#include "orbsvcs/AV/SCTP_SEQ.h"
+
+#if defined (ACE_HAS_SCTP)
+
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "ace/Multihomed_INET_Addr.h"
+#include "tao/debug.h"
+#include "ace/Arg_Shifter.h"
+
+ACE_RCSID (AV,
+ SCTP_SEQ,
+ "SCTP_SEQ.cpp,v 1.3 2003/11/05 21:06:53 yamuna Exp")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//------------------------------------------------------------
+// TAO_AV_SCTP_SEQ_Transport
+//------------------------------------------------------------
+
+TAO_AV_SCTP_SEQ_Transport::TAO_AV_SCTP_SEQ_Transport (void)
+ :handler_ (0)
+{
+}
+
+TAO_AV_SCTP_SEQ_Transport::TAO_AV_SCTP_SEQ_Transport (TAO_AV_SCTP_SEQ_Flow_Handler *handler)
+ :handler_ (handler)
+{
+}
+
+TAO_AV_SCTP_SEQ_Transport::~TAO_AV_SCTP_SEQ_Transport (void)
+{
+}
+
+int
+TAO_AV_SCTP_SEQ_Transport::open (ACE_Addr * /*address*/)
+{
+ return 0;
+}
+
+int
+TAO_AV_SCTP_SEQ_Transport::close (void)
+{
+ return 0;
+}
+
+int
+TAO_AV_SCTP_SEQ_Transport::mtu (void)
+{
+ return 0;
+}
+
+ACE_Addr*
+TAO_AV_SCTP_SEQ_Transport::get_peer_addr (void)
+{
+ return 0;
+}
+
+ssize_t
+TAO_AV_SCTP_SEQ_Transport::send (const ACE_Message_Block *mblk, ACE_Time_Value *)
+{
+ // For the most part this was copied from GIOP::send_request and
+ // friends.
+
+ // ACE_Time_Value timeout;
+
+ iovec iov[ACE_IOV_MAX];
+ int iovcnt = 0;
+ ssize_t n = 0;
+ ssize_t nbytes = 0;
+
+ for (const ACE_Message_Block *i = mblk;
+ i != 0;
+ i = i->cont ())
+ {
+ // Make sure there is something to send!
+ if (i->length () > 0)
+ {
+ iov[iovcnt].iov_base = i->rd_ptr ();
+ iov[iovcnt].iov_len = static_cast<u_long> (i->length ());
+ iovcnt++;
+
+ // The buffer is full make a OS call. @@ TODO this should
+ // be optimized on a per-platform basis, for instance, some
+ // platforms do not implement writev() there we should copy
+ // the data into a buffer and call send_n(). In other cases
+ // there may be some limits on the size of the iovec, there
+ // we should set ACE_IOV_MAX to that limit.
+ if (iovcnt == ACE_IOV_MAX)
+ {
+ n = this->handler_->peer ().sendv_n ((const iovec *) iov,
+ iovcnt);
+ //&timeout);
+ if (n < 1)
+ return n;
+
+ nbytes += n;
+ iovcnt = 0;
+ }
+ }
+ }
+
+ // Check for remaining buffers to be sent!
+ if (iovcnt != 0)
+ {
+ n = this->handler_->peer ().sendv_n ((const iovec *) iov,
+ iovcnt);
+ if (n < 1)
+ return n;
+
+ nbytes += n;
+ }
+
+ return nbytes;
+}
+
+ssize_t
+TAO_AV_SCTP_SEQ_Transport::send (const char *buf,
+ size_t len,
+ ACE_Time_Value *)
+{
+ return this->handler_->peer ().send_n (buf, len);
+}
+
+ssize_t
+TAO_AV_SCTP_SEQ_Transport::send (const iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *)
+{
+ return this->handler_->peer ().sendv_n (iov,
+ iovcnt);
+}
+
+ssize_t
+TAO_AV_SCTP_SEQ_Transport::recv (char *buf,
+ size_t len,
+ ACE_Time_Value *)
+{
+ return this->handler_->peer ().recv (buf, len);
+}
+
+ssize_t
+TAO_AV_SCTP_SEQ_Transport::recv (char *buf,
+ size_t len,
+ int flags,
+ ACE_Time_Value *)
+{
+ return this->handler_->peer ().recv (buf,
+ len,
+ flags);
+}
+
+ssize_t
+TAO_AV_SCTP_SEQ_Transport::recv (iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *)
+{
+ return handler_->peer ().recvv_n (iov, iovcnt);
+}
+
+//------------------------------------------------------------
+// TAO_AV_SCTP_SEQ_Base_Acceptor
+//------------------------------------------------------------
+
+int
+TAO_AV_SCTP_SEQ_Base_Acceptor::acceptor_open (TAO_AV_SCTP_SEQ_Acceptor *acceptor,
+ ACE_Reactor *reactor,
+ const ACE_INET_Addr &local_addr,
+ TAO_FlowSpec_Entry *entry)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "In base acceptor open"));
+
+ this->acceptor_ = acceptor;
+ this->reactor_ = reactor;
+ this->entry_ = entry;
+
+ ACE_UINT32 local_ip_addr [entry->num_local_sec_addrs ()];
+ ACE_INET_Addr ip_addr;
+ char** addrs = entry->get_local_sec_addr ();
+ for (int i = 0; i < entry->num_local_sec_addrs (); i++)
+ {
+ ACE_CString addr_str (addrs[i]);
+ addr_str += ":";
+ ip_addr.set (addr_str.c_str ());
+ local_ip_addr [i] = ip_addr.get_ip_address ();
+ }
+
+
+ ACE_Multihomed_INET_Addr multi_addr;
+ multi_addr.set (local_addr.get_port_number (),
+ local_addr.get_ip_address (),
+ 1,
+ local_ip_addr,
+ entry->num_local_sec_addrs ());
+
+ char buf[BUFSIZ];
+ multi_addr.addr_to_string (buf,
+ BUFSIZ);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_SCTP_SEQ_Base_Acceptor::open: %s",
+ buf
+ ));
+
+ int result = this->open (multi_addr,reactor);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_SCTP_SEQ_Base_Acceptor::open failed\n"),-1);
+
+ return 0;
+}
+
+int
+TAO_AV_SCTP_SEQ_Base_Acceptor::make_svc_handler (TAO_AV_SCTP_SEQ_Flow_Handler *&handler)
+{
+ int result = this->acceptor_->make_svc_handler (handler);
+ if (result < 0)
+ return result;
+ handler->reactor (this->reactor_);
+ this->entry_->handler (handler);
+
+ return 0;
+}
+
+//------------------------------------------------------------
+// TAO_AV_SCTP_SEQ_Acceptor
+//------------------------------------------------------------
+
+TAO_AV_SCTP_SEQ_Acceptor::TAO_AV_SCTP_SEQ_Acceptor (void)
+{
+}
+
+TAO_AV_SCTP_SEQ_Acceptor::~TAO_AV_SCTP_SEQ_Acceptor (void)
+{
+}
+
+int
+TAO_AV_SCTP_SEQ_Acceptor::make_svc_handler (TAO_AV_SCTP_SEQ_Flow_Handler *&sctp_handler)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_SCTP_SEQ_Acceptor::make_svc_handler\n"
+ ));
+
+ if (this->endpoint_ != 0)
+ {
+ ACE_NEW_RETURN (sctp_handler,
+ TAO_AV_SCTP_SEQ_Flow_Handler,
+ -1);
+
+ TAO_AV_Protocol_Object *object =
+ this->flow_protocol_factory_->make_protocol_object (this->entry_,
+ this->endpoint_,
+ sctp_handler,
+ sctp_handler->transport ());
+
+ sctp_handler->protocol_object (object);
+ this->endpoint_->set_flow_handler (this->flowname_.c_str (),sctp_handler);
+ this->entry_->protocol_object (object);
+ this->entry_->handler (sctp_handler);
+ }
+ return 0;
+}
+
+int
+TAO_AV_SCTP_SEQ_Acceptor::open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp)
+{
+ this->flow_protocol_factory_ = factory;
+
+ this->av_core_ = av_core;
+ this->endpoint_ = endpoint;
+ this->entry_ = entry;
+
+ if (flow_comp == TAO_AV_Core::TAO_AV_CONTROL)
+ this->flowname_ = TAO_AV_Core::get_control_flowname (entry->flowname ());
+ else
+ this->flowname_ = entry->flowname ();
+
+ ACE_Addr *address = entry->address ();
+
+ ACE_INET_Addr *inet_addr = (ACE_INET_Addr *) address;
+
+ char buf[BUFSIZ];
+ inet_addr->addr_to_string (buf,
+ BUFSIZ);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_SCTP_SEQ_Acceptor::open: %s",
+ buf
+ ));
+
+ //Add code for reading multihomed addresses and pass the multihomed
+ //addr to the following method. ACE_Multihomed_addr derives from
+ //ACE_INET_Addr, hence this should not be an issue.
+ int result = this->acceptor_.acceptor_open (this,
+ av_core->reactor (),
+ *inet_addr,
+ entry);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_AV_SCTP_SEQ_Acceptor::open failed"),
+ -1);
+
+ entry->set_local_addr (address);
+ return 0;
+}
+
+int
+TAO_AV_SCTP_SEQ_Acceptor::open_default (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp)
+{
+ this->flow_protocol_factory_ = factory;
+ this->av_core_ = av_core;
+ this->endpoint_ = endpoint;
+ this->entry_ = entry;
+ if (flow_comp == TAO_AV_Core::TAO_AV_CONTROL)
+ this->flowname_ = TAO_AV_Core::get_control_flowname (entry->flowname());
+ else
+ this->flowname_ = entry->flowname ();
+
+ ACE_INET_Addr *address;
+ ACE_NEW_RETURN (address,
+ ACE_INET_Addr ("0"),
+ -1);
+
+ int result = this->acceptor_.acceptor_open (this,
+ av_core->reactor (),
+ *address,
+ entry);
+
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_AV_SCTP_SEQ_Acceptor::open failed"),
+ -1);
+
+ this->acceptor_.acceptor ().get_local_addr (*address);
+
+ address->set (address->get_port_number (),
+ address->get_host_name ());
+
+ char buf[BUFSIZ];
+ address->addr_to_string (buf,BUFSIZ);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_SCTP_SEQ_Acceptor::open_default: %s\n",
+ buf));
+
+ entry->set_local_addr (address);
+
+ return 0;
+}
+
+
+int
+TAO_AV_SCTP_SEQ_Acceptor::close (void)
+{
+ return 0;
+}
+
+//------------------------------------------------------------
+// TAO_AV_SCTP_SEQ_Base_Connector
+//------------------------------------------------------------
+
+int
+TAO_AV_SCTP_SEQ_Base_Connector::connector_open (TAO_AV_SCTP_SEQ_Connector *connector,
+ ACE_Reactor *reactor)
+{
+ this->connector_ = connector;
+ this->reactor_ = reactor;
+
+ int result = this->open (reactor);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_SCTP_SEQ_Base_Connector::open failed\n"),-1);
+ return 0;
+}
+
+int
+TAO_AV_SCTP_SEQ_Base_Connector::make_svc_handler (TAO_AV_SCTP_SEQ_Flow_Handler *&sctp_handler)
+{
+ int result =
+ this->connector_->make_svc_handler (sctp_handler);
+ if (result < 0)
+ return result;
+ sctp_handler->reactor (this->reactor_);
+ return 0;
+}
+
+int
+TAO_AV_SCTP_SEQ_Base_Connector::connector_connect (TAO_AV_SCTP_SEQ_Flow_Handler *&handler,
+ const ACE_Multihomed_INET_Addr &remote_addr,
+ const ACE_Multihomed_INET_Addr &local_addr)
+{
+ int result = this->connect (handler,
+ remote_addr,
+ 0,
+ local_addr);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_SCTP_SEQ_Base_Connector::connect failed\n"),-1);
+ return 0;
+}
+
+//------------------------------------------------------------
+// TAO_AV_SCTP_SEQ_Connector
+//------------------------------------------------------------
+TAO_AV_SCTP_SEQ_Connector::TAO_AV_SCTP_SEQ_Connector (void)
+{
+}
+
+TAO_AV_SCTP_SEQ_Connector::~TAO_AV_SCTP_SEQ_Connector (void)
+{
+}
+
+int
+TAO_AV_SCTP_SEQ_Connector::make_svc_handler (TAO_AV_SCTP_SEQ_Flow_Handler *&sctp_handler)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"TAO_AV_SCTP_SEQ_Connector::make_svc_handler\n"));
+
+ // TAO_AV_Callback *callback = 0;
+ if (this->endpoint_ != 0)
+ {
+ // this->endpoint_->get_callback (this->flowname_.c_str (),
+ // callback);
+ ACE_NEW_RETURN (sctp_handler,
+ // TAO_AV_SCTP_SEQ_Flow_Handler (callback),
+ TAO_AV_SCTP_SEQ_Flow_Handler,
+ -1);
+ TAO_AV_Protocol_Object *object =
+ this->flow_protocol_factory_->make_protocol_object (this->entry_,
+ this->endpoint_,
+ sctp_handler,
+ sctp_handler->transport ());
+ sctp_handler->protocol_object (object);
+ // callback->protocol_object (object);
+ // this->endpoint_->set_protocol_object (this->flowname_.c_str (),
+ // object);
+ this->endpoint_->set_flow_handler (this->flowname_.c_str (),sctp_handler);
+ this->entry_->protocol_object (object);
+ this->entry_->handler (sctp_handler);
+ }
+ return 0;
+}
+
+int
+TAO_AV_SCTP_SEQ_Connector::open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_AV_Flow_Protocol_Factory *factory)
+
+{
+ this->endpoint_ = endpoint;
+ this->flow_protocol_factory_ = factory;
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"TAO_AV_SCTP_SEQ_Connector::open "));
+ int result = this->connector_.connector_open(this,
+ av_core->reactor ());
+ return result;
+}
+
+int
+TAO_AV_SCTP_SEQ_Connector::connect (TAO_FlowSpec_Entry *entry,
+ TAO_AV_Transport *&transport,
+ TAO_AV_Core::Flow_Component flow_comp)
+{
+ this->entry_ = entry;
+ if (flow_comp == TAO_AV_Core::TAO_AV_CONTROL)
+ this->flowname_ = TAO_AV_Core::get_control_flowname (entry->flowname ());
+ else
+ this->flowname_ = entry->flowname ();
+ ACE_Addr *remote_addr = entry->address ();
+ ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr *> (remote_addr);
+ TAO_AV_SCTP_SEQ_Flow_Handler *handler = 0;
+
+ ACE_Multihomed_INET_Addr remote_multi_addr;
+ remote_multi_addr.set (inet_addr->get_port_number (),
+ inet_addr->get_ip_address (),
+ 1,
+ 0,
+ 0);
+
+ ACE_Multihomed_INET_Addr local_addr; //This can be a multihomed address
+ ACE_INET_Addr *addr;
+ if (entry->get_peer_addr () != 0)
+ {
+ addr = dynamic_cast<ACE_INET_Addr *> (entry->get_peer_addr ());
+ }
+ else
+ {
+ ACE_NEW_RETURN (addr,
+ ACE_INET_Addr ("0"),
+ -1);
+ }
+
+ ACE_UINT32 local_ip_addr [entry->num_peer_sec_addrs ()];
+ ACE_INET_Addr ip_addr;
+ char** addrs = entry->get_peer_sec_addr ();
+ for (int i = 0; i < entry->num_peer_sec_addrs (); i++)
+ {
+ ACE_CString addr_str (addrs[i]);
+ addr_str += ":";
+ ip_addr.set (addr_str.c_str ());
+ local_ip_addr [i] = ip_addr.get_ip_address ();
+ }
+
+ if (entry->num_peer_sec_addrs () != 0)
+ local_addr.set (addr->get_port_number (),
+ addr->get_ip_address (),
+ 1,
+ local_ip_addr,
+ entry->num_peer_sec_addrs ());
+ else
+ local_addr.set (addr->get_port_number (),
+ addr->get_ip_address (),
+ 1,
+ 0,
+ entry->num_peer_sec_addrs ());
+
+
+ int result = this->connector_.connector_connect (handler,
+ remote_multi_addr,
+ local_addr);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_SCTP_SEQ_connector::connect failed\n"),-1);
+ entry->handler (handler);
+ transport = handler->transport ();
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Local Addrs\n"));
+ char buf [BUFSIZ];
+ size_t size = BUFSIZ;
+ ACE_INET_Addr *peer_addrs = 0;
+ ACE_NEW_RETURN (peer_addrs,ACE_INET_Addr [size], -1);
+ handler->peer ().get_local_addrs (peer_addrs, size);
+ for (unsigned int i=0; i < size;i++)
+ {
+ peer_addrs [i].addr_to_string (buf,
+ BUFSIZ);
+ ACE_DEBUG ((LM_DEBUG,
+ "%s %d\n",
+ buf,
+ size));
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Remote Addrs\n"));
+
+ size = BUFSIZ;
+ handler->peer ().get_remote_addrs (peer_addrs, size);
+ for (unsigned int i=0; i < size;i++)
+ {
+ peer_addrs [i].addr_to_string (buf,
+ BUFSIZ);
+ ACE_DEBUG ((LM_DEBUG,
+ "%s %d\n",
+ buf,
+ size));
+ }
+ //delete peer_addrs;
+ }
+
+ return 0;
+}
+
+int
+TAO_AV_SCTP_SEQ_Connector::close (void)
+{
+ return 0;
+}
+
+//------------------------------------------------------------
+// TAO_AV_SCTP_SEQ_Protocol_Factory
+//------------------------------------------------------------
+
+
+TAO_AV_SCTP_SEQ_Factory::TAO_AV_SCTP_SEQ_Factory (void)
+{
+}
+
+TAO_AV_SCTP_SEQ_Factory::~TAO_AV_SCTP_SEQ_Factory (void)
+{
+}
+
+
+int
+TAO_AV_SCTP_SEQ_Factory::match_protocol (const char *protocol_string)
+{
+ if (ACE_OS::strcasecmp (protocol_string,"SCTP_SEQ") == 0)
+ return 1;
+ return 0;
+}
+
+TAO_AV_Acceptor*
+TAO_AV_SCTP_SEQ_Factory::make_acceptor (void)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"TAO_AV_SCTP_SEQ_Factory::make_acceptor\n"));
+ TAO_AV_Acceptor *acceptor = 0;
+ ACE_NEW_RETURN (acceptor,
+ TAO_AV_SCTP_SEQ_Acceptor,
+ 0);
+ return acceptor;
+}
+
+TAO_AV_Connector*
+TAO_AV_SCTP_SEQ_Factory::make_connector (void)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"TAO_AV_SCTP_SEQ_Factory::make_connector\n"));
+ TAO_AV_Connector *connector = 0;
+ ACE_NEW_RETURN (connector,
+ TAO_AV_SCTP_SEQ_Connector,
+ 0);
+ return connector;
+}
+
+
+int
+TAO_AV_SCTP_SEQ_Factory::init (int,
+ char *[])
+{
+
+ return 0;
+}
+
+//------------------------------------------------------------
+// TAO_AV_SCTP_SEQ_Object
+//------------------------------------------------------------
+
+int
+TAO_AV_SCTP_SEQ_Object::handle_input (void)
+{
+ int n = this->transport_->recv (this->frame_.rd_ptr (),
+ this->frame_.size ());
+ if (n == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_SCTP_SEQ_Flow_Handler::handle_input recv failed\n"),-1);
+ if (n == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_SCTP_SEQ_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
+TAO_AV_SCTP_SEQ_Object::send_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info * /*frame_info*/)
+{
+ int result = this->transport_->send (frame);
+ return result;
+}
+
+int
+TAO_AV_SCTP_SEQ_Object::send_frame (const iovec *iov,
+ int iovcnt,
+ TAO_AV_frame_info * /*frame_info*/)
+{
+ return this->transport_->send (iov,iovcnt);
+}
+
+int
+TAO_AV_SCTP_SEQ_Object::send_frame (const char*buf,
+ size_t len)
+{
+ int result = this->transport_->send (buf, len, 0);
+ return result;
+}
+
+
+TAO_AV_SCTP_SEQ_Object::TAO_AV_SCTP_SEQ_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport)
+ :TAO_AV_Protocol_Object (callback,transport)
+{
+ // @@ Is this a good size?
+ this->frame_.size (BUFSIZ);
+}
+
+TAO_AV_SCTP_SEQ_Object::~TAO_AV_SCTP_SEQ_Object (void)
+{
+ // No-op
+}
+int
+TAO_AV_SCTP_SEQ_Object::destroy (void)
+{
+ this->callback_->handle_destroy ();
+ delete this;
+ return 0;
+}
+
+//------------------------------------------------------------
+// TAO_AV_SCTP_SEQ_Flow_Handler
+//------------------------------------------------------------
+
+TAO_AV_SCTP_SEQ_Flow_Handler::TAO_AV_SCTP_SEQ_Flow_Handler (TAO_AV_Callback * /*callback*/)
+ // :TAO_AV_Flow_Handler (callback)
+{
+ ACE_NEW (this->transport_,
+ TAO_AV_SCTP_SEQ_Transport (this));
+}
+
+TAO_AV_SCTP_SEQ_Flow_Handler::~TAO_AV_SCTP_SEQ_Flow_Handler (void)
+{
+ delete this->transport_;
+}
+
+TAO_AV_Transport *
+TAO_AV_SCTP_SEQ_Flow_Handler::transport (void)
+{
+ return this->transport_;
+}
+
+int
+TAO_AV_SCTP_SEQ_Flow_Handler::change_qos (AVStreams::QoS qos)
+{
+ if( TAO_debug_level > 0 )
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) TAO_AV_SCTP_SEQ_Flow_Handler::change_qos\n"));
+ }
+
+ unsigned int i=0;
+
+ int ret = 0;
+ CORBA::Long dscp = 0;
+ CORBA::Long ecn = 0;
+ int dscp_flag=0;
+ for(i=0; i < qos.QoSParams.length(); i++)
+ {
+
+ if( ACE_OS::strcmp( qos.QoSParams[i].property_name.in(), "Diffserv_Codepoint") == 0)
+ {
+ qos.QoSParams[i].property_value >>= dscp;
+ ACE_DEBUG ((LM_DEBUG,
+ "DSCP %d\n",
+ dscp));
+ dscp_flag=1;
+ // DSCP value can only be 6 bits wide
+ if(!((dscp >= 0) && (dscp <= 63)))
+ {
+ dscp_flag = 0;
+ ACE_DEBUG((LM_DEBUG, "(%N,%l) ECN value can only be (0-3) not %d\n", ecn));
+ return -1;
+ }
+ }
+
+ if( ACE_OS::strcmp( qos.QoSParams[i].property_name.in(), "ECN") == 0)
+ {
+ qos.QoSParams[i].property_value >>= ecn;
+ // ECN value can only occupy bits 6 and 7 of the
+ // IP Diffserv byte
+ if(!((ecn >= 0) && (ecn <= 3)))
+ {
+ ACE_DEBUG((LM_DEBUG, "(%N,%l) ECN value can only be (0-3) not %d\n", ecn));
+ ecn = 0;
+ }
+
+ }
+ }
+ // Set the Diffserv byte only if we specified
+ // the Diffserv Codepoint (DSCP) or ECN via QoSParams
+ // passed into this method
+ if(dscp_flag || ecn)
+ {
+ int tos;
+ tos = (int)(dscp << 2);
+ if(ecn)
+ {
+ tos |= ecn;
+ }
+ ret = this->peer ().set_option(IPPROTO_IP, IP_TOS, (int *)&tos , (int)sizeof(tos));
+
+ if(TAO_debug_level > 0)
+ {
+ ACE_DEBUG((LM_DEBUG, "(%N,%l) set tos: ret: %d %d\n", tos, ret));
+ }
+ }
+
+ if(TAO_debug_level > 0)
+ {
+ if(ret < 0 )
+ {
+ ACE_DEBUG((LM_DEBUG, "(%N,%l) errno: %p\n"));
+ }
+ }
+ return ret;
+}
+
+int
+TAO_AV_SCTP_SEQ_Flow_Handler::open (void * /*arg*/)
+{
+ ACE_CDR::Long nodelay = 1;
+
+#if defined (SCTP_NODELAY)
+ if (this->peer ().set_option (IPPROTO_SCTP,
+ SCTP_NODELAY,
+ (void *) &nodelay,
+ sizeof (nodelay)) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "NODELAY failed\n"),
+ -1);
+#endif /* SCTP_NODELAY */
+
+ // Called by the <Strategy_Acceptor> when the handler is completely
+ // connected.
+ ACE_INET_Addr addr;
+
+ if (this->peer ().get_remote_addr (addr) == -1)
+ return -1;
+
+ char server[MAXHOSTNAMELEN + 16];
+
+ (void) addr.addr_to_string (server, sizeof (server));
+
+ if (TAO_debug_level > 0)
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) connection to server <%s> on %d\n",
+ server, this->peer ().get_handle ()));
+
+ this->peer ().disable (ACE_NONBLOCK);
+
+ // Register the handler with the reactor.
+ if (this->reactor ()
+ && this->reactor ()->register_handler
+ (this,
+ ACE_Event_Handler::READ_MASK) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("%p\n"),
+ ACE_TEXT ("unable to register client handler")),
+ -1);
+ return 0;
+}
+
+int
+TAO_AV_SCTP_SEQ_Flow_Handler::handle_input (ACE_HANDLE /*fd*/)
+{
+ return this->protocol_object_->handle_input ();
+}
+
+int
+TAO_AV_SCTP_SEQ_Flow_Handler::handle_timeout (const ACE_Time_Value &tv,
+ const void *arg)
+{
+ return TAO_AV_Flow_Handler::handle_timeout (tv,arg);
+}
+
+
+//------------------------------------------------------------
+// TAO_AV_SCTP_SEQ_Flow_Factory
+//------------------------------------------------------------
+TAO_AV_SCTP_SEQ_Flow_Factory::TAO_AV_SCTP_SEQ_Flow_Factory (void)
+{
+}
+
+TAO_AV_SCTP_SEQ_Flow_Factory::~TAO_AV_SCTP_SEQ_Flow_Factory (void)
+{
+}
+
+int
+TAO_AV_SCTP_SEQ_Flow_Factory::init (int /* argc */,
+ char * /* argv */ [])
+{
+ return 0;
+}
+
+int
+TAO_AV_SCTP_SEQ_Flow_Factory::match_protocol (const char *flow_string)
+{
+ if (ACE_OS::strcasecmp (flow_string,"SCTP_SEQ") == 0)
+ return 1;
+ return 0;
+}
+
+TAO_AV_Protocol_Object*
+TAO_AV_SCTP_SEQ_Flow_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;
+ if( endpoint->get_callback (entry->flowname (), callback) ) {
+ ACE_ERROR_RETURN ((LM_ERROR, "(%N,%l) Invalid callback\n"), 0);
+ }
+
+ TAO_AV_SCTP_SEQ_Object *object = 0;
+ ACE_NEW_RETURN (object,
+ TAO_AV_SCTP_SEQ_Object (callback,
+ transport),
+ 0);
+ callback->open (object,
+ handler);
+ endpoint->set_protocol_object (entry->flowname (),
+ object);
+
+ endpoint->protocol_object_set ();
+ return object;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_AV, TAO_AV_SCTP_SEQ_Flow_Factory)
+ACE_STATIC_SVC_DEFINE (TAO_AV_SCTP_SEQ_Flow_Factory,
+ ACE_TEXT ("SCTP_SEQ_Flow_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_AV_SCTP_SEQ_Flow_Factory),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+ACE_FACTORY_DEFINE (TAO_AV, TAO_AV_SCTP_SEQ_Factory)
+ACE_STATIC_SVC_DEFINE (TAO_AV_SCTP_SEQ_Factory,
+ ACE_TEXT ("SCTP_SEQ_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_AV_SCTP_SEQ_Factory),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+#endif // ACE_HAS_SCTP
diff --git a/TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.h b/TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.h
new file mode 100644
index 00000000000..4e3ec871b71
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.h
@@ -0,0 +1,308 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SCTP_SEQ.h
+ *
+ * $Id$
+ *
+ * @author Yamuna Krishnamurthy <yamuna@oomworks.com>
+ */
+//=============================================================================
+
+#ifndef TAO_AV_SCTP_SEQ_H
+#define TAO_AV_SCTP_SEQ_H
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+
+#if defined (ACE_HAS_SCTP)
+
+#include "ace/Auto_Ptr.h"
+#include "ace/Service_Config.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+#include "ace/SOCK_SEQPACK_Association.h"
+#include "ace/SOCK_SEQPACK_Acceptor.h"
+#include "ace/SOCK_SEQPACK_Connector.h"
+
+extern "C" {
+#include <netinet/sctp.h>
+};
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef ACE_Unbounded_Set <ACE_CString> Interface_Seq;
+typedef ACE_Unbounded_Set_Iterator <ACE_CString> Interface_Seq_Itor;
+
+//typedef auto_ptr <Interface_Seq> Interface_Seq_Ptr;
+typedef ACE_Hash_Map_Manager <ACE_CString,Interface_Seq,ACE_Null_Mutex> Secondary_Addr_Map;
+typedef ACE_Hash_Map_Entry <ACE_CString,Interface_Seq> Secondary_Addr_Map_Entry;
+typedef ACE_Hash_Map_Iterator <ACE_CString,Interface_Seq,ACE_Null_Mutex> Secondary_Addr_Map_Iterator;
+
+/**
+ * @class TAO_AV_SCTP_SEQ_Factory
+ */
+class TAO_AV_Export TAO_AV_SCTP_SEQ_Factory : public TAO_AV_Transport_Factory
+{
+public:
+ /// Initialization hook.
+ TAO_AV_SCTP_SEQ_Factory (void);
+ virtual ~TAO_AV_SCTP_SEQ_Factory (void);
+ virtual int init (int argc, char *argv[]);
+ virtual int match_protocol (const char *protocol_string);
+ virtual TAO_AV_Acceptor *make_acceptor (void);
+ virtual TAO_AV_Connector *make_connector (void);
+};
+
+class TAO_AV_SCTP_SEQ_Flow_Handler;
+
+/**
+ * @class TAO_AV_SCTP_SEQ_Transport
+ * @brief A transport abstraction for udp sockets.
+ * Uses the ACE_SOCK_Dgram to send the data.
+ */
+class TAO_AV_Export TAO_AV_SCTP_SEQ_Transport
+ :public TAO_AV_Transport
+{
+public:
+ TAO_AV_SCTP_SEQ_Transport (void);
+
+ TAO_AV_SCTP_SEQ_Transport (TAO_AV_SCTP_SEQ_Flow_Handler *handler);
+
+ virtual ~TAO_AV_SCTP_SEQ_Transport (void);
+ virtual int open (ACE_Addr *addr);
+
+ virtual int close (void);
+
+ virtual int mtu (void);
+
+ virtual ACE_Addr *get_peer_addr (void);
+
+ /// Write the complete Message_Block chain to the connection.
+ virtual ssize_t send (const ACE_Message_Block *mblk,
+ ACE_Time_Value *s = 0);
+
+ /// Write the contents of the buffer of length len to the connection.
+ virtual ssize_t send (const char *buf,
+ size_t len,
+ ACE_Time_Value *s = 0);
+
+ /// Write the contents of iovcnt iovec's to the connection.
+ virtual ssize_t send (const iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *s = 0);
+
+ /// Read len bytes from into buf.
+ virtual ssize_t recv (char *buf,
+ size_t len,
+ ACE_Time_Value *s = 0);
+
+ /// Read len bytes from into buf using flags.
+ virtual ssize_t recv (char *buf,
+ size_t len,
+ int flags,
+ ACE_Time_Value *s = 0);
+
+ /// Read received data into the iovec buffers.
+ virtual ssize_t recv (iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *s = 0);
+
+ TAO_AV_SCTP_SEQ_Flow_Handler *handler (void) { return this->handler_; }
+
+protected:
+ TAO_AV_SCTP_SEQ_Flow_Handler *handler_;
+ ACE_Addr *addr_;
+ ACE_INET_Addr peer_addr_;
+};
+
+/**
+ * @class TAO_AV_SCTP_SEQ_Flow_Handler
+ */
+class TAO_AV_SCTP_SEQ_Flow_Handler
+ :public virtual TAO_AV_Flow_Handler,
+ public ACE_Svc_Handler <ACE_SOCK_SEQPACK_ASSOCIATION, ACE_NULL_SYNCH>
+{
+public:
+ TAO_AV_SCTP_SEQ_Flow_Handler (TAO_AV_Callback *callback = 0);
+ virtual ~TAO_AV_SCTP_SEQ_Flow_Handler (void);
+ virtual TAO_AV_Transport *transport (void);
+ virtual int open (void * = 0);
+ virtual int handle_input (ACE_HANDLE fd);
+ virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg = 0);
+ virtual ACE_Event_Handler* event_handler (void){ return this; }
+ /// Change the QoS
+ virtual int change_qos (AVStreams::QoS);
+
+protected:
+ TAO_AV_Core *av_core_;
+};
+
+class TAO_AV_SCTP_SEQ_Acceptor;
+
+/**
+ * @class TAO_AV_SCTP_SEQ_Base_Acceptor
+ */
+class TAO_AV_SCTP_SEQ_Base_Acceptor :public ACE_Acceptor <TAO_AV_SCTP_SEQ_Flow_Handler,ACE_SOCK_SEQPACK_ACCEPTOR>
+{
+ public:
+ virtual int acceptor_open (TAO_AV_SCTP_SEQ_Acceptor *acceptor,
+ ACE_Reactor *reactor,
+ const ACE_INET_Addr &local_addr,
+ TAO_FlowSpec_Entry *entry);
+ virtual int make_svc_handler (TAO_AV_SCTP_SEQ_Flow_Handler *& handler);
+ protected:
+ TAO_AV_SCTP_SEQ_Acceptor *acceptor_;
+ ACE_Reactor *reactor_;
+ TAO_FlowSpec_Entry *entry_;
+};
+
+/**
+ * @class TAO_AV_SCTP_SEQ_Acceptor
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_SCTP_SEQ_Acceptor
+ :public TAO_AV_Acceptor
+{
+public:
+ TAO_AV_SCTP_SEQ_Acceptor (void);
+ virtual ~TAO_AV_SCTP_SEQ_Acceptor (void);
+ virtual int open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp =
+ TAO_AV_Core::TAO_AV_DATA);
+
+ virtual int open_default (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp =
+ TAO_AV_Core::TAO_AV_DATA);
+
+ virtual int close (void);
+ virtual int make_svc_handler (TAO_AV_SCTP_SEQ_Flow_Handler *&handler);
+
+protected:
+ ACE_INET_Addr *address_;
+ TAO_AV_SCTP_SEQ_Base_Acceptor acceptor_;
+ TAO_Base_StreamEndPoint *endpoint_;
+ TAO_FlowSpec_Entry *entry_;
+ TAO_AV_Flow_Protocol_Factory *flow_protocol_factory_;
+};
+
+class TAO_AV_SCTP_SEQ_Connector;
+
+/**
+ * @class TAO_AV_Base_Connector
+ */
+class TAO_AV_SCTP_SEQ_Base_Connector : public ACE_Connector <TAO_AV_SCTP_SEQ_Flow_Handler,ACE_SOCK_SEQPACK_CONNECTOR>
+{
+public:
+ // To avoid warnings of open and connect hiding the base class functions these have to renamed.
+ int connector_open (TAO_AV_SCTP_SEQ_Connector *connector,
+ ACE_Reactor *reactor);
+ int connector_connect (TAO_AV_SCTP_SEQ_Flow_Handler *&handler,
+ const ACE_Multihomed_INET_Addr &remote_addr,
+ const ACE_Multihomed_INET_Addr &local_addr);
+ virtual int make_svc_handler (TAO_AV_SCTP_SEQ_Flow_Handler *& handler);
+protected:
+ TAO_AV_SCTP_SEQ_Connector *connector_;
+ ACE_Reactor *reactor_;
+};
+
+/**
+ * @class TAO_AV_SCTP_SEQ_Connector
+ * @brief
+ */
+class TAO_AV_SCTP_SEQ_Connector : public TAO_AV_Connector
+{
+public:
+ TAO_AV_SCTP_SEQ_Connector (void);
+ virtual ~TAO_AV_SCTP_SEQ_Connector (void);
+
+ virtual int open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_AV_Flow_Protocol_Factory *factory);
+
+ virtual int connect (TAO_FlowSpec_Entry *entry,
+ TAO_AV_Transport *&transport,
+ TAO_AV_Core::Flow_Component flow_comp =
+ TAO_AV_Core::TAO_AV_DATA);
+ virtual int close (void);
+ virtual int make_svc_handler (TAO_AV_SCTP_SEQ_Flow_Handler *&handler);
+protected:
+ TAO_AV_Core *av_core_;
+ TAO_AV_SCTP_SEQ_Base_Connector connector_;
+ TAO_Base_StreamEndPoint *endpoint_;
+ TAO_FlowSpec_Entry *entry_;
+ TAO_AV_Flow_Protocol_Factory *flow_protocol_factory_;
+};
+
+/**
+ * @class TAO_AV_SCTP_SEQ_Object
+ * @brief TAO_AV_Protocol_Object for the User Datagram Protocol (SCTP_SEQ)
+ */
+class TAO_AV_Export TAO_AV_SCTP_SEQ_Object : public TAO_AV_Protocol_Object
+{
+public:
+ TAO_AV_SCTP_SEQ_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport = 0);
+
+ /// Dtor
+ virtual ~TAO_AV_SCTP_SEQ_Object (void);
+
+ 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 (const iovec *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_AV_SCTP_SEQ_Flow_Factory
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_SCTP_SEQ_Flow_Factory : public TAO_AV_Flow_Protocol_Factory
+{
+public:
+ /// Initialization hook.
+ TAO_AV_SCTP_SEQ_Flow_Factory (void);
+ virtual ~TAO_AV_SCTP_SEQ_Flow_Factory (void);
+ virtual int init (int argc, char *argv[]);
+ virtual int match_protocol (const char *flow_string);
+ TAO_AV_Protocol_Object* make_protocol_object (TAO_FlowSpec_Entry *entry,
+ TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Flow_Handler *handler,
+ TAO_AV_Transport *transport);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (TAO_AV_SCTP_SEQ_Flow_Factory)
+ACE_FACTORY_DECLARE (TAO_AV, TAO_AV_SCTP_SEQ_Flow_Factory)
+
+ACE_STATIC_SVC_DECLARE (TAO_AV_SCTP_SEQ_Factory)
+ACE_FACTORY_DECLARE (TAO_AV, TAO_AV_SCTP_SEQ_Factory)
+
+
+#endif // ACE_HAS_SCTP
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_AV_SCTP_SEQ_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/TCP.cpp b/TAO/orbsvcs/orbsvcs/AV/TCP.cpp
new file mode 100644
index 00000000000..1ed5739a2de
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/TCP.cpp
@@ -0,0 +1,721 @@
+// $Id$
+
+#include "orbsvcs/AV/TCP.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+
+#include "tao/debug.h"
+#include "ace/OS_NS_strings.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//------------------------------------------------------------
+// TAO_AV_TCP_Transport
+//------------------------------------------------------------
+
+TAO_AV_TCP_Transport::TAO_AV_TCP_Transport (void)
+ :handler_ (0)
+{
+}
+
+TAO_AV_TCP_Transport::TAO_AV_TCP_Transport (TAO_AV_TCP_Flow_Handler *handler)
+ :handler_ (handler)
+{
+}
+
+TAO_AV_TCP_Transport::~TAO_AV_TCP_Transport (void)
+{
+}
+
+int
+TAO_AV_TCP_Transport::open (ACE_Addr * /*address*/)
+{
+ return 0;
+}
+
+int
+TAO_AV_TCP_Transport::close (void)
+{
+ return 0;
+}
+
+int
+TAO_AV_TCP_Transport::mtu (void)
+{
+ return -1;
+}
+
+ACE_Addr*
+TAO_AV_TCP_Transport::get_peer_addr (void)
+{
+ return 0;
+}
+
+ssize_t
+TAO_AV_TCP_Transport::send (const ACE_Message_Block *mblk, ACE_Time_Value *)
+{
+ // For the most part this was copied from GIOP::send_request and
+ // friends.
+
+ iovec iov[ACE_IOV_MAX];
+ int iovcnt = 0;
+ ssize_t n = 0;
+ ssize_t nbytes = 0;
+
+ for (const ACE_Message_Block *i = mblk;
+ i != 0;
+ i = i->cont ())
+ {
+ // Make sure there is something to send!
+ if (i->length () > 0)
+ {
+ iov[iovcnt].iov_base = i->rd_ptr ();
+ iov[iovcnt].iov_len = static_cast<u_long> (i->length ());
+ iovcnt++;
+
+ // The buffer is full make a OS call. @@ TODO this should
+ // be optimized on a per-platform basis, for instance, some
+ // platforms do not implement writev() there we should copy
+ // the data into a buffer and call send_n(). In other cases
+ // there may be some limits on the size of the iovec, there
+ // we should set ACE_IOV_MAX to that limit.
+ if (iovcnt == ACE_IOV_MAX)
+ {
+ n = this->handler_->peer ().sendv_n ((const iovec *) iov,
+ iovcnt);
+ if (n < 1)
+ return n;
+
+ nbytes += n;
+ iovcnt = 0;
+ }
+ }
+ }
+
+ // Check for remaining buffers to be sent!
+ if (iovcnt != 0)
+ {
+ n = this->handler_->peer ().sendv_n ((const iovec *) iov,
+ iovcnt);
+ if (n < 1)
+ return n;
+
+ nbytes += n;
+ }
+
+ return nbytes;
+}
+
+ssize_t
+TAO_AV_TCP_Transport::send (const char *buf,
+ size_t len,
+ ACE_Time_Value *)
+{
+ return this->handler_->peer ().send_n (buf, len);
+}
+
+ssize_t
+TAO_AV_TCP_Transport::send (const iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *)
+{
+ return this->handler_->peer ().sendv_n ((const iovec *) iov,
+ iovcnt);
+}
+
+ssize_t
+TAO_AV_TCP_Transport::recv (char *buf,
+ size_t len,
+ ACE_Time_Value *)
+{
+ return this->handler_->peer ().recv (buf, len);
+}
+
+ssize_t
+TAO_AV_TCP_Transport::recv (char *buf,
+ size_t len,
+ int flags,
+ ACE_Time_Value *)
+{
+ return this->handler_->peer ().recv (buf,
+ len,
+ flags);
+}
+
+ssize_t
+TAO_AV_TCP_Transport::recv (iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *)
+{
+ return handler_->peer ().recvv_n (iov, iovcnt);
+}
+
+//------------------------------------------------------------
+// TAO_AV_TCP_Protocol_Factory
+//------------------------------------------------------------
+
+TAO_AV_TCP_Factory::TAO_AV_TCP_Factory (void)
+{
+}
+
+TAO_AV_TCP_Factory::~TAO_AV_TCP_Factory (void)
+{
+}
+
+int
+TAO_AV_TCP_Factory::init (int /* argc */,
+ char * /* argv */ [])
+{
+ return 0;
+}
+
+int
+TAO_AV_TCP_Factory::match_protocol (const char *protocol_string)
+{
+ if (ACE_OS::strcasecmp (protocol_string,"TCP") == 0)
+ return 1;
+ return 0;
+}
+
+TAO_AV_Acceptor*
+TAO_AV_TCP_Factory::make_acceptor (void)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_TCP_Factory::make_acceptor "));
+ TAO_AV_Acceptor *acceptor = 0;
+ ACE_NEW_RETURN (acceptor,
+ TAO_AV_TCP_Acceptor,
+ 0);
+ return acceptor;
+}
+
+TAO_AV_Connector*
+TAO_AV_TCP_Factory::make_connector (void)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_TCP_Factory::make_connector "));
+ TAO_AV_Connector *connector = 0;
+ ACE_NEW_RETURN (connector,
+ TAO_AV_TCP_Connector,
+ 0);
+ return connector;
+}
+
+//------------------------------------------------------------
+// TAO_AV_TCP_Object
+//------------------------------------------------------------
+
+int
+TAO_AV_TCP_Object::handle_input (void)
+{
+ int n = this->transport_->recv (this->frame_.rd_ptr (),
+ this->frame_.size ());
+ 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);
+ this->frame_.wr_ptr (this->frame_.rd_ptr () + n);
+
+ return this->callback_->receive_frame (&this->frame_);
+}
+
+int
+TAO_AV_TCP_Object::send_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info * /*frame_info*/)
+{
+ int result = this->transport_->send (frame);
+ return result;
+}
+
+int
+TAO_AV_TCP_Object::send_frame (const iovec *iov,
+ int iovcnt,
+ TAO_AV_frame_info * /*frame_info*/)
+{
+ return this->transport_->send (iov,iovcnt);
+}
+
+int
+TAO_AV_TCP_Object::send_frame (const char*buf,
+ size_t len)
+{
+ int result = this->transport_->send (buf, len, 0);
+ return result;
+}
+
+
+TAO_AV_TCP_Object::TAO_AV_TCP_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport)
+ :TAO_AV_Protocol_Object (callback,transport)
+{
+ // @@ Is this a good size?
+ this->frame_.size (BUFSIZ);
+}
+
+TAO_AV_TCP_Object::~TAO_AV_TCP_Object (void)
+{
+ // No-op
+}
+int
+TAO_AV_TCP_Object::destroy (void)
+{
+ this->callback_->handle_destroy ();
+ delete this;
+ return 0;
+}
+
+//------------------------------------------------------------
+// TAO_AV_TCP_Flow_Factory
+//------------------------------------------------------------
+TAO_AV_TCP_Flow_Factory::TAO_AV_TCP_Flow_Factory (void)
+{
+}
+
+TAO_AV_TCP_Flow_Factory::~TAO_AV_TCP_Flow_Factory (void)
+{
+}
+
+int
+TAO_AV_TCP_Flow_Factory::init (int /* argc */,
+ char * /* argv */ [])
+{
+ return 0;
+}
+
+int
+TAO_AV_TCP_Flow_Factory::match_protocol (const char *flow_string)
+{
+ if (ACE_OS::strcasecmp (flow_string,"TCP") == 0)
+ return 1;
+ return 0;
+}
+
+TAO_AV_Protocol_Object*
+TAO_AV_TCP_Flow_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;
+ if (endpoint->get_callback (entry->flowname (), callback))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "(%N,%l) Invalid callback\n"), 0);
+ }
+
+ TAO_AV_TCP_Object *object = 0;
+ ACE_NEW_RETURN (object,
+ TAO_AV_TCP_Object (callback,
+ transport),
+ 0);
+ callback->open (object,
+ handler);
+ endpoint->set_protocol_object (entry->flowname (),
+ object);
+
+ endpoint->protocol_object_set ();
+
+ return object;
+}
+
+//------------------------------------------------------------
+// TAO_AV_TCP_Base_Connector
+//------------------------------------------------------------
+
+int
+TAO_AV_TCP_Base_Connector::connector_open (TAO_AV_TCP_Connector *connector,
+ ACE_Reactor *reactor)
+{
+ this->connector_ = connector;
+ this->reactor_ = reactor;
+
+ int result = ACE_Connector <TAO_AV_TCP_Flow_Handler,ACE_SOCK_CONNECTOR>::open (reactor);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_TCP_Base_Connector::open failed\n"),-1);
+ return 0;
+}
+
+int
+TAO_AV_TCP_Base_Connector::make_svc_handler (TAO_AV_TCP_Flow_Handler *&tcp_handler)
+{
+ int const result =
+ this->connector_->make_svc_handler (tcp_handler);
+ if (result < 0)
+ return result;
+ tcp_handler->reactor (this->reactor_);
+ return 0;
+}
+
+int
+TAO_AV_TCP_Base_Connector::connector_connect (TAO_AV_TCP_Flow_Handler *&handler,
+ const ACE_INET_Addr &remote_addr)
+{
+ int const result =
+ ACE_Connector <TAO_AV_TCP_Flow_Handler,ACE_SOCK_CONNECTOR>::connect (handler,
+ remote_addr);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_TCP_Base_Connector::connect failed\n"),-1);
+ return 0;
+}
+
+//------------------------------------------------------------
+// TAO_AV_TCP_Connector
+//------------------------------------------------------------
+TAO_AV_TCP_Connector::TAO_AV_TCP_Connector (void)
+{
+}
+
+TAO_AV_TCP_Connector::~TAO_AV_TCP_Connector (void)
+{
+}
+
+int
+TAO_AV_TCP_Connector::make_svc_handler (TAO_AV_TCP_Flow_Handler *&tcp_handler)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_TCP_Connector::make_svc_handler\n"));
+ // TAO_AV_Callback *callback = 0;
+ if (this->endpoint_ != 0)
+ {
+// this->endpoint_->get_callback (this->flowname_.c_str (),
+// callback);
+ ACE_NEW_RETURN (tcp_handler,
+ // TAO_AV_TCP_Flow_Handler (callback),
+ TAO_AV_TCP_Flow_Handler,
+ -1);
+ TAO_AV_Protocol_Object *object =
+ this->flow_protocol_factory_->make_protocol_object (this->entry_,
+ this->endpoint_,
+ tcp_handler,
+ tcp_handler->transport ());
+ tcp_handler->protocol_object (object);
+ // callback->protocol_object (object);
+// this->endpoint_->set_protocol_object (this->flowname_.c_str (),
+// object);
+ this->endpoint_->set_flow_handler (this->flowname_.c_str (),tcp_handler);
+ this->entry_->protocol_object (object);
+ this->entry_->handler (tcp_handler);
+ }
+ return 0;
+}
+
+int
+TAO_AV_TCP_Connector::open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_AV_Flow_Protocol_Factory *factory)
+
+{
+ this->endpoint_ = endpoint;
+ this->flow_protocol_factory_ = factory;
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_TCP_Connector::open "));
+ int result = this->connector_.connector_open(this,
+ av_core->reactor ());
+ return result;
+}
+
+int
+TAO_AV_TCP_Connector::connect (TAO_FlowSpec_Entry *entry,
+ TAO_AV_Transport *&transport,
+ TAO_AV_Core::Flow_Component flow_comp)
+{
+ this->entry_ = entry;
+ if (flow_comp == TAO_AV_Core::TAO_AV_CONTROL)
+ this->flowname_ = TAO_AV_Core::get_control_flowname (entry->flowname ());
+ else
+ this->flowname_ = entry->flowname ();
+ ACE_Addr *remote_addr = entry->address ();
+ ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr *> (remote_addr);
+ TAO_AV_TCP_Flow_Handler *handler = 0;
+ int result = this->connector_.connector_connect (handler,
+ *inet_addr);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_TCP_connector::connect failed\n"),-1);
+ entry->handler (handler);
+ transport = handler->transport ();
+ return 0;
+}
+
+int
+TAO_AV_TCP_Connector::close (void)
+{
+ return 0;
+}
+
+//------------------------------------------------------------
+// TAO_AV_TCP_Base_Connector
+//------------------------------------------------------------
+
+int
+TAO_AV_TCP_Base_Acceptor::acceptor_open (TAO_AV_TCP_Acceptor *acceptor,
+ ACE_Reactor *reactor,
+ const ACE_INET_Addr &local_addr,
+ TAO_FlowSpec_Entry *entry)
+{
+ this->acceptor_ = acceptor;
+ this->reactor_ = reactor;
+ this->entry_ = entry;
+
+ int const result =
+ ACE_Acceptor <TAO_AV_TCP_Flow_Handler,ACE_SOCK_ACCEPTOR>::open (local_addr,reactor);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_TCP_Base_Connector::open failed\n"),-1);
+ return 0;
+}
+
+int
+TAO_AV_TCP_Base_Acceptor::make_svc_handler (TAO_AV_TCP_Flow_Handler *&handler)
+{
+ int const result = this->acceptor_->make_svc_handler (handler);
+ if (result < 0)
+ return result;
+ handler->reactor (this->reactor_);
+ this->entry_->handler (handler);
+ return 0;
+}
+
+
+//------------------------------------------------------------
+// TAO_AV_TCP_Acceptor
+//------------------------------------------------------------
+
+TAO_AV_TCP_Acceptor::TAO_AV_TCP_Acceptor (void)
+{
+}
+
+TAO_AV_TCP_Acceptor::~TAO_AV_TCP_Acceptor (void)
+{
+}
+
+int
+TAO_AV_TCP_Acceptor::make_svc_handler (TAO_AV_TCP_Flow_Handler *&tcp_handler)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_TCP_Acceptor::make_svc_handler\n"
+ ));
+
+ if (this->endpoint_ != 0)
+ {
+ ACE_NEW_RETURN (tcp_handler,
+ TAO_AV_TCP_Flow_Handler,
+ -1);
+
+ TAO_AV_Protocol_Object *object =
+ this->flow_protocol_factory_->make_protocol_object (this->entry_,
+ this->endpoint_,
+ tcp_handler,
+ tcp_handler->transport ());
+
+ tcp_handler->protocol_object (object);
+
+ this->endpoint_->set_flow_handler (this->flowname_.c_str (),tcp_handler);
+ this->entry_->protocol_object (object);
+ this->entry_->handler (tcp_handler);
+ }
+ return 0;
+}
+
+int
+TAO_AV_TCP_Acceptor::open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp)
+{
+ this->flow_protocol_factory_ = factory;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_TCP_Acceptor::open "));
+
+ this->av_core_ = av_core;
+ this->endpoint_ = endpoint;
+ this->entry_ = entry;
+ if (flow_comp == TAO_AV_Core::TAO_AV_CONTROL)
+ this->flowname_ = TAO_AV_Core::get_control_flowname (entry->flowname ());
+ else
+ this->flowname_ = entry->flowname ();
+ ACE_Addr *address = entry->address ();
+
+ ACE_INET_Addr *inet_addr = (ACE_INET_Addr *) address;
+
+ inet_addr->set (inet_addr->get_port_number (),
+ inet_addr->get_host_name ());
+
+ char buf[BUFSIZ];
+ inet_addr->addr_to_string (buf,
+ BUFSIZ);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_TCP_Acceptor::open: %s",
+ buf
+ ));
+
+ int result = this->acceptor_.acceptor_open (this,
+ av_core->reactor (),
+ *inet_addr,
+ entry);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_AV_TCP_Acceptor::open failed"),
+ -1);
+
+ entry->set_local_addr (address);
+ return 0;
+}
+
+int
+TAO_AV_TCP_Acceptor::open_default (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp)
+{
+ this->flow_protocol_factory_ = factory;
+ this->av_core_ = av_core;
+ this->endpoint_ = endpoint;
+ this->entry_ = entry;
+ if (flow_comp == TAO_AV_Core::TAO_AV_CONTROL)
+ this->flowname_ = TAO_AV_Core::get_control_flowname (entry->flowname());
+ else
+ this->flowname_ = entry->flowname ();
+
+ ACE_INET_Addr *address = 0;
+ ACE_NEW_RETURN (address,
+ ACE_INET_Addr ("0"),
+ -1);
+
+ int result = this->acceptor_.acceptor_open (this,
+ av_core->reactor (),
+ *address,
+ entry);
+
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_AV_TCP_Acceptor::open failed"),
+ -1);
+
+ this->acceptor_.acceptor ().get_local_addr (*address);
+
+ address->set (address->get_port_number (),
+ address->get_host_name ());
+
+ char buf[BUFSIZ];
+ address->addr_to_string (buf,BUFSIZ);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_TCP_Acceptor::open_default: %s\n",
+ buf));
+
+ entry->set_local_addr (address);
+
+ return 0;
+}
+
+
+int
+TAO_AV_TCP_Acceptor::close (void)
+{
+ return 0;
+}
+
+//------------------------------------------------------------
+// TAO_AV_TCP_Flow_Handler
+//------------------------------------------------------------
+
+TAO_AV_TCP_Flow_Handler::TAO_AV_TCP_Flow_Handler (TAO_AV_Callback * /*callback*/)
+ // :TAO_AV_Flow_Handler (callback)
+{
+ ACE_NEW (this->transport_,
+ TAO_AV_TCP_Transport (this));
+}
+
+TAO_AV_TCP_Flow_Handler::~TAO_AV_TCP_Flow_Handler (void)
+{
+ delete this->transport_;
+}
+
+TAO_AV_Transport *
+TAO_AV_TCP_Flow_Handler::transport (void)
+{
+ return this->transport_;
+}
+
+int
+TAO_AV_TCP_Flow_Handler::open (void * /*arg*/)
+{
+
+#if defined (TCP_NODELAY)
+ int nodelay = 1;
+
+ if (this->peer ().set_option (IPPROTO_TCP,
+ TCP_NODELAY,
+ (void *) &nodelay,
+ sizeof (nodelay)) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "NODELAY failed\n"),
+ -1);
+#endif /* TCP_NODELAY */
+
+ // Called by the <Strategy_Acceptor> when the handler is completely
+ // connected.
+ ACE_INET_Addr addr;
+
+ if (this->peer ().get_remote_addr (addr) == -1)
+ return -1;
+
+ char server[MAXHOSTNAMELEN + 16];
+
+ (void) addr.addr_to_string (server, sizeof (server));
+
+ if (TAO_debug_level > 0)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) connection to server <%s> on %d\n",
+ server, this->peer ().get_handle ()));
+
+ this->peer ().enable (ACE_NONBLOCK);
+ // Register the handler with the reactor.
+ if (this->reactor ()
+ && this->reactor ()->register_handler
+ (this,
+ ACE_Event_Handler::READ_MASK) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("%p\n"),
+ ACE_TEXT ("unable to register client handler")),
+ -1);
+ return 0;
+}
+
+int
+TAO_AV_TCP_Flow_Handler::handle_input (ACE_HANDLE /*fd*/)
+{
+ return this->protocol_object_->handle_input ();
+}
+
+int
+TAO_AV_TCP_Flow_Handler::handle_timeout (const ACE_Time_Value &tv,
+ const void *arg)
+{
+ return TAO_AV_Flow_Handler::handle_timeout (tv,arg);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DEFINE (TAO_AV_TCP_Flow_Factory,
+ ACE_TEXT ("TCP_Flow_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_AV_TCP_Flow_Factory),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+ACE_FACTORY_DEFINE (TAO_AV, TAO_AV_TCP_Flow_Factory)
+
+ACE_STATIC_SVC_DEFINE (TAO_AV_TCP_Factory,
+ ACE_TEXT ("TCP_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_AV_TCP_Factory),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+ACE_FACTORY_DEFINE (TAO_AV, TAO_AV_TCP_Factory)
diff --git a/TAO/orbsvcs/orbsvcs/AV/TCP.h b/TAO/orbsvcs/orbsvcs/AV/TCP.h
new file mode 100644
index 00000000000..1f51a7329be
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/TCP.h
@@ -0,0 +1,283 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file TCP.h
+ *
+ * $Id$
+ *
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_AV_TCP_H
+#define TAO_AV_TCP_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/Protocol_Factory.h"
+#include "orbsvcs/AV/FlowSpec_Entry.h"
+
+#include "ace/Service_Config.h"
+#include "ace/Svc_Handler.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_AV_TCP_Factory
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_TCP_Factory : public TAO_AV_Transport_Factory
+{
+public:
+ /// Initialization hook.
+ TAO_AV_TCP_Factory (void);
+ virtual ~TAO_AV_TCP_Factory (void);
+ virtual int init (int argc, char *argv[]);
+ virtual int match_protocol (const char *protocol_string);
+ virtual TAO_AV_Acceptor *make_acceptor (void);
+ virtual TAO_AV_Connector *make_connector (void);
+};
+
+class TAO_AV_TCP_Flow_Handler;
+
+/**
+ * @class TAO_AV_TCP_Transport
+ * @brief A transport abstraction for socket streams.
+ * Uses the ACE_SOCK_Stream to send the data.
+ */
+class TAO_AV_TCP_Transport
+ : public TAO_AV_Transport
+{
+
+public:
+ TAO_AV_TCP_Transport (void);
+
+ TAO_AV_TCP_Transport (TAO_AV_TCP_Flow_Handler *handler);
+
+ virtual ~TAO_AV_TCP_Transport (void);
+
+ virtual int open (ACE_Addr *address);
+
+ virtual int close (void);
+
+ virtual int mtu (void);
+
+ virtual ACE_Addr *get_peer_addr (void);
+
+ /// Write the complete Message_Block chain to the connection.
+ virtual ssize_t send (const ACE_Message_Block *mblk,
+ ACE_Time_Value *s = 0);
+
+ /// Write the contents of the buffer of length len to the connection.
+ virtual ssize_t send (const char *buf,
+ size_t len,
+ ACE_Time_Value *s = 0);
+
+ /// Write the contents of iovcnt iovec's to the connection.
+ virtual ssize_t send (const iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *s = 0);
+
+ /// Read len bytes from into buf.
+ virtual ssize_t recv (char *buf,
+ size_t len,
+ ACE_Time_Value *s = 0);
+
+ /// Read len bytes from into buf using flags.
+ virtual ssize_t recv (char *buf,
+ size_t len,
+ int flags,
+ ACE_Time_Value *s = 0);
+
+ /// Read received data into the iovec buffers.
+ virtual ssize_t recv (iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *s = 0);
+protected:
+ TAO_AV_TCP_Flow_Handler *handler_;
+};
+
+/**
+ * @class TAO_AV_TCP_Flow_Handler
+ * @brief
+ */
+class TAO_AV_TCP_Flow_Handler
+ :public virtual TAO_AV_Flow_Handler,
+ public virtual ACE_Svc_Handler <ACE_SOCK_STREAM, ACE_NULL_SYNCH>
+{
+public:
+ TAO_AV_TCP_Flow_Handler (TAO_AV_Callback *callback = 0);
+ virtual ~TAO_AV_TCP_Flow_Handler (void);
+ virtual TAO_AV_Transport *transport (void);
+ virtual int open (void * = 0);
+ virtual int handle_input (ACE_HANDLE fd);
+ virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg = 0);
+ virtual ACE_Event_Handler* event_handler (void){ return this; }
+protected:
+ TAO_AV_Core *av_core_;
+};
+
+class TAO_AV_TCP_Acceptor;
+
+/**
+ * @class TAO_AV_TCP_Base_Acceptor
+ * @brief
+ */
+class TAO_AV_TCP_Base_Acceptor : public ACE_Acceptor <TAO_AV_TCP_Flow_Handler,ACE_SOCK_ACCEPTOR>
+{
+public:
+ virtual int acceptor_open (TAO_AV_TCP_Acceptor *acceptor,
+ ACE_Reactor *reactor,
+ const ACE_INET_Addr &local_addr,
+ TAO_FlowSpec_Entry *entry);
+ virtual int make_svc_handler (TAO_AV_TCP_Flow_Handler *& handler);
+protected:
+ TAO_AV_TCP_Acceptor *acceptor_;
+ ACE_Reactor *reactor_;
+ TAO_FlowSpec_Entry *entry_;
+};
+
+/**
+ * @class TAO_AV_TCP_Acceptor
+ * @brief
+ */
+class TAO_AV_TCP_Acceptor : public TAO_AV_Acceptor
+{
+public:
+ TAO_AV_TCP_Acceptor (void);
+ virtual ~TAO_AV_TCP_Acceptor (void);
+
+ virtual int open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_component =
+ TAO_AV_Core::TAO_AV_DATA);
+
+ virtual int open_default (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_component =
+ TAO_AV_Core::TAO_AV_DATA);
+
+ virtual int close (void);
+ virtual int make_svc_handler (TAO_AV_TCP_Flow_Handler *&handler);
+protected:
+ TAO_AV_TCP_Base_Acceptor acceptor_;
+ TAO_FlowSpec_Entry *entry_;
+ TAO_Base_StreamEndPoint *endpoint_;
+ TAO_AV_Flow_Protocol_Factory *flow_protocol_factory_;
+};
+
+class TAO_AV_TCP_Connector;
+
+/**
+ * @class TAO_AV_Base_Connector
+ * @brief
+ */
+class TAO_AV_TCP_Base_Connector : public ACE_Connector <TAO_AV_TCP_Flow_Handler,ACE_SOCK_CONNECTOR>
+{
+public:
+ // To avoid warnings of open and connect hiding the base class functions these have to renamed.
+ int connector_open (TAO_AV_TCP_Connector *connector,
+ ACE_Reactor *reactor);
+ int connector_connect (TAO_AV_TCP_Flow_Handler *&handler,
+ const ACE_INET_Addr &remote_addr);
+ virtual int make_svc_handler (TAO_AV_TCP_Flow_Handler *& handler);
+protected:
+ TAO_AV_TCP_Connector *connector_;
+ ACE_Reactor *reactor_;
+};
+
+/**
+ * @class TAO_AV_TCP_Connector
+ * @brief
+ */
+class TAO_AV_TCP_Connector : public TAO_AV_Connector
+{
+public:
+ TAO_AV_TCP_Connector (void);
+ virtual ~TAO_AV_TCP_Connector (void);
+
+ virtual int open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_AV_Flow_Protocol_Factory *factory);
+
+ virtual int connect (TAO_FlowSpec_Entry *entry,
+ TAO_AV_Transport *&transport,
+ TAO_AV_Core::Flow_Component flow_comp =
+ TAO_AV_Core::TAO_AV_DATA);
+ virtual int close (void);
+ virtual int make_svc_handler (TAO_AV_TCP_Flow_Handler *&handler);
+protected:
+ TAO_AV_Core *av_core_;
+ TAO_AV_TCP_Base_Connector connector_;
+ TAO_Base_StreamEndPoint *endpoint_;
+ TAO_FlowSpec_Entry *entry_;
+ TAO_AV_Flow_Protocol_Factory *flow_protocol_factory_;
+};
+
+/**
+ * @class TAO_AV_TCP_Object
+ * @brief TAO_AV_Protocol_Object for Transmission Control Protocol (TCP)
+ */
+class TAO_AV_Export TAO_AV_TCP_Object : public TAO_AV_Protocol_Object
+{
+public:
+ TAO_AV_TCP_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport = 0);
+
+ /// Dtor
+ virtual ~TAO_AV_TCP_Object (void);
+
+ 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 (const iovec *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_AV_TCP_Flow_Factory
+ * @brief
+ */
+class TAO_AV_TCP_Flow_Factory : public TAO_AV_Flow_Protocol_Factory
+{
+public:
+ /// Initialization hook.
+ TAO_AV_TCP_Flow_Factory (void);
+ virtual ~TAO_AV_TCP_Flow_Factory (void);
+ virtual int init (int argc, char *argv[]);
+ virtual int match_protocol (const char *flow_string);
+ TAO_AV_Protocol_Object* make_protocol_object (TAO_FlowSpec_Entry *entry,
+ TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Flow_Handler *handler,
+ TAO_AV_Transport *transport);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (TAO_AV_TCP_Flow_Factory)
+ACE_FACTORY_DECLARE (TAO_AV, TAO_AV_TCP_Flow_Factory)
+
+ACE_STATIC_SVC_DECLARE (TAO_AV_TCP_Factory)
+ACE_FACTORY_DECLARE (TAO_AV, TAO_AV_TCP_Factory)
+
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_TCP_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/Transport.cpp b/TAO/orbsvcs/orbsvcs/AV/Transport.cpp
new file mode 100644
index 00000000000..03047ef23e6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Transport.cpp
@@ -0,0 +1,682 @@
+// $Id$
+
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/sfp.h"
+#include "orbsvcs/AV/MCast.h"
+#include "orbsvcs/AV/RTCP.h"
+#include "orbsvcs/AV/RTP.h"
+#include "orbsvcs/AV/UDP.h"
+#include "orbsvcs/AV/TCP.h"
+#include "orbsvcs/AV/FlowSpec_Entry.h"
+#include "orbsvcs/AV/AV_Core.h"
+
+#if defined (ACE_HAS_RAPI) || defined (ACE_HAS_WINSOCK2_GQOS)
+#include "orbsvcs/AV/QoS_UDP.h"
+#endif /* defined (ACE_HAS_RAPI) || defined (ACE_HAS_WINSOCK2_GQOS) */
+
+#include "tao/debug.h"
+
+#include "ace/Dynamic_Service.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/AV/Transport.i"
+#endif /* __ACE_INLINE__ */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//------------------------------------------------------------
+// TAO_AV_Transport_Item
+//------------------------------------------------------------
+TAO_AV_Transport_Item::TAO_AV_Transport_Item (const ACE_CString &name)
+ : name_ (name),
+ factory_ (0)
+{
+}
+
+//------------------------------------------------------------
+// TAO_AV_Transport_Item
+//------------------------------------------------------------
+TAO_AV_Flow_Protocol_Item::TAO_AV_Flow_Protocol_Item (const ACE_CString &name)
+ : name_ (name),
+ factory_ (0)
+{
+}
+
+//------------------------------------------------------------
+// TAO_AV_Connector_Registry
+//------------------------------------------------------------
+
+TAO_AV_Connector_Registry::TAO_AV_Connector_Registry (void)
+{
+}
+
+int
+TAO_AV_Connector_Registry::open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core* av_core,
+ TAO_AV_FlowSpecSet &flow_spec_set)
+{
+
+ TAO_AV_FlowSpecSetItor last_flowspec = flow_spec_set.end ();
+
+ for (TAO_AV_FlowSpecSetItor flow_spec = flow_spec_set.begin ();
+ flow_spec != last_flowspec;
+ ++flow_spec)
+ {
+ TAO_FlowSpec_Entry *entry = (*flow_spec);
+ ACE_Addr *address = entry->address ();
+ const char *flow_protocol = entry->flow_protocol_str ();
+ const char *transport_protocol = entry->carrier_protocol_str ();
+
+ if (ACE_OS::strcmp (flow_protocol,"") == 0)
+ flow_protocol = transport_protocol;
+
+ if (address == 0)
+ {
+ // Protocol was specified without an endpoint. According to
+ // the "iioploc" spec, this is valid. As such, we extend
+ // this feature to all pluggable protocols. All TAO
+ // pluggable protocols are expected to have the ability to
+ // create a default endpoint.
+
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Protocol was specified without an endpoint\n"),
+ -1);
+ }
+ else
+ {
+ TAO_AV_Flow_Protocol_Factory *flow_factory =
+ av_core->get_flow_protocol_factory (flow_protocol);
+ TAO_AV_Transport_Factory *transport_factory =
+ av_core->get_transport_factory (transport_protocol);
+
+ if ((flow_factory != 0) && (transport_factory != 0))
+ {
+ // @@Naga:Instead of making a new connector every time we should try and see if a connector exists
+ // for this transport already and hence we can reuse it.
+
+ TAO_AV_Connector *connector = transport_factory->make_connector ();
+
+ if (connector != 0)
+ {
+ // add connector to list.
+ this->connectors_.insert (connector);
+
+ if (connector->open (endpoint,
+ av_core,
+ flow_factory) == -1)
+ return -1;
+
+ TAO_AV_Transport *transport = 0;
+ if (connector->connect (entry,
+ transport,
+ TAO_AV_Core::TAO_AV_DATA) == -1)
+ return -1;
+ entry->transport (transport);
+ }
+ else
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Unable to create an "
+ "connector for <%s>\n",
+ entry->flowname ()),
+ -1);
+
+ // Now see if the flow factory has a control flow factory.
+ TAO_AV_Flow_Protocol_Factory *control_flow_factory =
+ av_core->get_flow_protocol_factory(flow_factory->control_flow_factory ());
+
+ if (control_flow_factory != 0)
+ {
+ TAO_AV_Connector *control_connector =
+ transport_factory->make_connector ();
+
+ if (control_connector != 0)
+ {
+ // add connector to list.
+ this->connectors_.insert (control_connector);
+
+ if (control_connector->open (endpoint,
+ av_core,
+ control_flow_factory) == -1)
+ return -1;
+
+ TAO_AV_Transport *control_transport = 0;
+ if (control_connector->connect (entry,
+ control_transport,
+ TAO_AV_Core::TAO_AV_CONTROL) == -1)
+ return -1;
+ entry->control_transport (control_transport);
+
+ // Now set the control object on the data flow object.
+ entry->protocol_object ()->control_object (entry->control_protocol_object ());
+ }
+ else
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Unable to create an "
+ "connector for <%s>\n",
+ entry->flowname ()),
+ -1);
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+int
+TAO_AV_Connector_Registry::close (TAO_AV_Connector *connector)
+{
+ this->connectors_.remove (connector);
+
+ if (connector != 0)
+ delete connector;
+ return 0;
+}
+
+int
+TAO_AV_Connector_Registry::close_all (void)
+{
+ for (TAO_AV_ConnectorSetItor i = this->connectors_.begin ();
+ i != this->connectors_.end ();
+ ++i)
+ {
+ if (*i != 0)
+ continue;
+
+ (*i)->close ();
+
+ this->close (*i);
+ }
+
+ this->connectors_.reset ();
+ return 0;
+}
+
+TAO_AV_Connector_Registry::~TAO_AV_Connector_Registry (void)
+{
+ this->close_all ();
+}
+
+//------------------------------------------------------------
+// TAO_AV_Acceptor_Registry
+//------------------------------------------------------------
+
+TAO_AV_Acceptor_Registry::TAO_AV_Acceptor_Registry (void)
+{
+}
+
+TAO_AV_Acceptor_Registry::~TAO_AV_Acceptor_Registry (void)
+{
+ this->close_all();
+}
+
+int
+TAO_AV_Acceptor_Registry::open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_AV_FlowSpecSet &flow_spec_set)
+{
+ int retv = 0;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_Acceptor_Registry::open \n"));
+
+ TAO_AV_FlowSpecSetItor last_flowspec
+ = flow_spec_set.end ();
+
+ for (TAO_AV_FlowSpecSetItor flow_spec = flow_spec_set.begin ();
+ flow_spec != last_flowspec;
+ ++flow_spec)
+ {
+ TAO_FlowSpec_Entry *entry = (*flow_spec);
+ ACE_Addr *address = entry->address ();
+ const char *flow_protocol = entry->flow_protocol_str ();
+ const char *transport_protocol = entry->carrier_protocol_str ();
+
+ if (ACE_OS::strcmp (flow_protocol,"") == 0)
+ flow_protocol = transport_protocol;
+
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_Acceptor_Registry::protocol for flow %s is %s\n",
+ entry->flowname (),
+ transport_protocol));
+
+ if (address == 0)
+ {
+ retv = this->open_default (endpoint,
+ av_core,
+ entry);
+ if(retv < 0)
+ return retv;
+ continue;
+ }
+ else
+ {
+ TAO_AV_Flow_Protocol_Factory *flow_factory =
+ av_core->get_flow_protocol_factory (flow_protocol);
+
+ if (flow_protocol != 0)
+ {
+ TAO_AV_Transport_Factory *transport_factory =
+ av_core->get_transport_factory (transport_protocol);
+
+ if (transport_protocol != 0)
+ {
+ TAO_AV_Acceptor *acceptor = transport_factory->make_acceptor ();
+ if (acceptor != 0)
+ {
+ // add acceptor to list.
+ this->acceptors_.insert (acceptor);
+
+ if (acceptor->open (endpoint,
+ av_core,
+ entry,
+ flow_factory,
+ TAO_AV_Core::TAO_AV_DATA) == -1)
+ return -1;
+
+ TAO_AV_Flow_Protocol_Factory *control_flow_factory =
+ av_core->get_flow_protocol_factory (flow_factory->control_flow_factory ());
+
+ if (control_flow_factory != 0)
+ {
+ TAO_AV_Acceptor *acceptor = transport_factory->make_acceptor ();
+ if (acceptor != 0)
+ {
+ if (acceptor->open (endpoint,
+ av_core,
+ entry,
+ control_flow_factory,
+ TAO_AV_Core::TAO_AV_CONTROL) == -1)
+ return -1;
+ // add acceptor to list.
+ this->acceptors_.insert (acceptor);
+
+ entry->protocol_object ()->control_object (entry->control_protocol_object ());
+
+ }
+ else
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Unable to create an "
+ "acceptor for <%s>\n",
+ entry->flowname ()),
+ -1);
+ }
+ }
+ else
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Unable to create an "
+ "acceptor for <%s>\n",
+ entry->flowname ()),
+ -1);
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+int
+TAO_AV_Acceptor_Registry::open_default (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_Acceptor_Registry::open_default "));
+
+ // No endpoints were specified, we let each protocol pick its own
+ // default...
+
+ const char *flow_protocol = entry->flow_protocol_str ();
+ const char *transport_protocol = entry->carrier_protocol_str ();
+
+ if (ACE_OS::strcmp (flow_protocol,"") == 0)
+ flow_protocol = transport_protocol;
+
+ TAO_AV_Flow_Protocol_Factory *flow_factory =
+ av_core->get_flow_protocol_factory (flow_protocol);
+
+ // No matching flow protocol.
+ if (flow_factory == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO (%P|%t) (%N,%l) Unable to match protocol prefix "
+ "for <%s>\n",
+ flow_protocol),
+ -1);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG((LM_DEBUG, "(%N,%l) Matched flow_protocol: %s, Looking for transport protocol: %s\n", flow_protocol, transport_protocol));
+
+ TAO_AV_Transport_Factory *transport_factory =
+ av_core->get_transport_factory (transport_protocol);
+
+ if (transport_factory == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO (%P|%t) (%N,%l) Unable to match protocol prefix "
+ "for <%s>\n",
+ transport_protocol),
+ -1);
+
+ // make an acceptor
+ TAO_AV_Acceptor *acceptor =
+ transport_factory->make_acceptor();
+
+ if (acceptor == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO (%P|%t) unable to create "
+ "an acceptor for <%d>\n",
+ transport_protocol),
+ -1);
+
+ if (acceptor->open_default (endpoint,
+ av_core,
+ entry,
+ flow_factory,
+ TAO_AV_Core::TAO_AV_DATA) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO (%P|%t) unable to open "
+ "default acceptor for <%s>%p\n",
+ flow_protocol),
+ -1);
+
+ this->acceptors_.insert (acceptor);
+
+ const char *control_flow_factory_name = flow_factory->control_flow_factory ();
+
+ if (control_flow_factory_name != 0)
+ {
+
+ TAO_AV_Flow_Protocol_Factory *control_flow_factory =
+ av_core->get_flow_protocol_factory (control_flow_factory_name);
+
+ if (control_flow_factory == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO (%P|%t) Unable to match control flow "
+ "for <%s>\n",
+ control_flow_factory_name),
+ -1);
+
+ TAO_AV_Acceptor *control_acceptor = transport_factory->make_acceptor ();
+
+ if (control_acceptor == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO (%P|%t) unable to create "
+ "an acceptor for <%d>\n",
+ transport_protocol),
+ -1);
+
+ if (control_acceptor->open_default (endpoint,
+ av_core,
+ entry,
+ control_flow_factory,
+ TAO_AV_Core::TAO_AV_CONTROL) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO (%P|%t) unable to open "
+ "default acceptor for <%s>%p\n",
+ transport_protocol),
+ -1);
+
+ this->acceptors_.insert (control_acceptor);
+
+ entry->protocol_object ()->control_object (entry->control_protocol_object ());
+ }
+
+ if (this->acceptors_.size () == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "TAO (%P%t) cannot create any default acceptor\n"));
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_AV_Acceptor_Registry::close (TAO_AV_Acceptor *acceptor)
+{
+ this->acceptors_.remove (acceptor);
+ delete acceptor;
+
+ return 0;
+}
+
+int
+TAO_AV_Acceptor_Registry::close_all (void)
+{
+ for (TAO_AV_AcceptorSetItor i = this->acceptors_.begin ();
+ i != this->acceptors_.end ();
+ ++i)
+ {
+ if (*i == 0)
+ continue;
+
+ (*i)->close ();
+
+ delete *i;
+ }
+
+ this->acceptors_.reset ();
+ return 0;
+}
+
+//----------------------------------------------------------------------
+// TAO_AV_Transport
+//----------------------------------------------------------------------
+
+TAO_AV_Transport::TAO_AV_Transport (void)
+{
+}
+
+// Virtual destructor.
+TAO_AV_Transport::~TAO_AV_Transport (void)
+{
+}
+
+ACE_Addr*
+TAO_AV_Transport::get_local_addr (void)
+{
+ return 0;
+}
+
+//----------------------------------------------------------------------
+// TAO_AV_Flow_Handler
+//----------------------------------------------------------------------
+
+//TAO_AV_Flow_Handler::TAO_AV_Flow_Handler (TAO_AV_Callback *callback)
+TAO_AV_Flow_Handler::TAO_AV_Flow_Handler (void)
+ :transport_ (0),
+ callback_ (0),
+ protocol_object_ (0),
+ timer_id_ (-1)
+{
+}
+
+TAO_AV_Flow_Handler::~TAO_AV_Flow_Handler(void)
+{
+ // cancel the timer (if there is one)
+ this->cancel_timer();
+}
+
+int
+TAO_AV_Flow_Handler::set_remote_address (ACE_Addr * /* address */)
+{
+ return 0;
+}
+
+int
+TAO_AV_Flow_Handler::start (TAO_FlowSpec_Entry::Role role)
+{
+ this->callback_->handle_start ();
+ switch (role)
+ {
+ // only for producer we register for the timeout.
+ case TAO_FlowSpec_Entry::TAO_AV_PRODUCER:
+ {
+ this->schedule_timer ();
+ }
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
+int
+TAO_AV_Flow_Handler::schedule_timer (void)
+{
+ ACE_Event_Handler *event_handler = this->event_handler ();
+ ACE_Time_Value *tv = 0;
+
+ this->callback_->get_timeout (tv, this->timeout_arg_);
+ if (tv == 0)
+ return 0;
+
+ this->timer_id_ =
+ TAO_AV_CORE::instance()->reactor ()->schedule_timer (event_handler,
+ 0,
+ *tv);
+
+ if (this->timer_id_ < 0)
+ return -1;
+
+ return 0;
+}
+
+
+int
+TAO_AV_Flow_Handler::cancel_timer (void)
+{
+ if (this->timer_id_ != -1)
+ return TAO_AV_CORE::instance()->reactor ()->cancel_timer (this->timer_id_);
+ else
+ return 0;
+}
+
+
+int
+TAO_AV_Flow_Handler::stop (TAO_FlowSpec_Entry::Role role)
+{
+ this->callback_->handle_stop ();
+ switch (role)
+ {
+ case TAO_FlowSpec_Entry::TAO_AV_PRODUCER:
+ {
+ int result = this->event_handler ()->reactor ()->cancel_timer (this->timer_id_);
+ if (result < 0)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_Flow_Handler::stop:cancel_timer failed\n"));
+ }
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
+int
+TAO_AV_Flow_Handler::handle_timeout (const ACE_Time_Value & /*tv*/,
+ const void * /*arg*/)
+{
+ int result = this->callback_->handle_timeout (this->timeout_arg_);
+ if (result < 0)
+ return result;
+ ACE_Event_Handler *event_handler = this->event_handler ();
+ ACE_Time_Value *timeout = 0;
+
+ this->callback_->get_timeout (timeout, this->timeout_arg_);
+ if (timeout == 0)
+ return 0;
+
+ this->timer_id_ = event_handler->reactor ()->schedule_timer (event_handler,
+ 0,
+ *timeout);
+
+ if (this->timer_id_ < 0)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_AV_Flow_Handler::change_qos (AVStreams::QoS)
+{
+ return 0;
+}
+
+TAO_AV_Transport*
+TAO_AV_Flow_Handler::transport (void)
+{
+ return this->transport_;
+}
+
+void
+TAO_AV_Flow_Handler::protocol_object (TAO_AV_Protocol_Object *protocol_object)
+{
+ this->protocol_object_ = protocol_object;
+}
+
+TAO_AV_Protocol_Object*
+TAO_AV_Flow_Handler::protocol_object (void)
+{
+ return this->protocol_object_;
+}
+
+void
+TAO_AV_Flow_Handler::callback (TAO_AV_Callback *callback)
+{
+ this->callback_ = callback;
+}
+
+// TAO_AV_Connector
+TAO_AV_Connector::TAO_AV_Connector (void)
+{
+}
+
+TAO_AV_Connector::~TAO_AV_Connector (void)
+{
+}
+
+// TAO_AV_Acceptor
+TAO_AV_Acceptor::TAO_AV_Acceptor (void)
+{
+}
+
+TAO_AV_Acceptor::~TAO_AV_Acceptor (void)
+{
+}
+
+TAO_AV_Transport_Factory::TAO_AV_Transport_Factory (void)
+{
+}
+
+TAO_AV_Transport_Factory::~TAO_AV_Transport_Factory (void)
+{
+}
+
+int
+TAO_AV_Transport_Factory::init (int /* argc */,
+ char * /* argv */ [])
+{
+ return -1;
+}
+
+int
+TAO_AV_Transport_Factory::match_protocol (const char * /* protocol_string */)
+{
+ return 0;
+}
+
+TAO_AV_Acceptor *
+TAO_AV_Transport_Factory::make_acceptor (void)
+{
+ return 0;
+}
+
+TAO_AV_Connector *
+TAO_AV_Transport_Factory::make_connector (void)
+{
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/Transport.h b/TAO/orbsvcs/orbsvcs/AV/Transport.h
new file mode 100644
index 00000000000..e494a20b9d4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Transport.h
@@ -0,0 +1,345 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Transport.h
+ *
+ * $Id$
+ *
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_AV_TRANSPORT_H
+#define TAO_AV_TRANSPORT_H
+#include /**/ "ace/pre.h"
+
+
+#include "orbsvcs/AV/FlowSpec_Entry.h"
+#include "orbsvcs/AV/AV_Core.h"
+
+#include "orbsvcs/AV/AV_export.h"
+
+#include "ace/Service_Object.h"
+#include "ace/Acceptor.h"
+#include "ace/SOCK_Acceptor.h"
+#include "ace/SOCK_Connector.h"
+#include "ace/Connector.h"
+#include "ace/Addr.h"
+#include "ace/SOCK_Dgram.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward declarations.
+class TAO_AV_Core;
+class TAO_AV_Transport_Factory;
+class TAO_AV_Protocol_Object;
+class TAO_AV_Callback;
+class TAO_AV_Transport;
+
+/**
+ * @class TAO_AV_Transport_Item
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_Transport_Item
+{
+public:
+ /// creator method, the Transport name can only be set when the
+ /// object is created.
+ TAO_AV_Transport_Item (const ACE_CString &name);
+
+ /// return a reference to the character representation of the Transport
+ /// factories name.
+ const ACE_CString &name (void);
+
+ /// return a pointer to the Transport factory.
+ TAO_AV_Transport_Factory *factory (void);
+
+ /// set the factory pointer's valus.
+ void factory (TAO_AV_Transport_Factory *factory);
+
+private:
+ /// Transport factory name.
+ ACE_CString name_;
+
+ /// pointer to factory object.
+ TAO_AV_Transport_Factory *factory_;
+};
+
+
+
+
+class TAO_AV_Flow_Protocol_Factory;
+
+/**
+ * @class TAO_AV_Flow_Protocol_Item
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_Flow_Protocol_Item
+{
+public:
+ /// creator method, the Flow_Protocol name can only be set when the
+ /// object is created.
+ TAO_AV_Flow_Protocol_Item (const ACE_CString &name);
+
+ /// return a reference to the character representation of the Flow_Protocol
+ /// factories name.
+ const ACE_CString &name (void);
+
+ /// return a pointer to the Flow_Protocol factory.
+ TAO_AV_Flow_Protocol_Factory *factory (void);
+
+ /// set the factory pointer's valus.
+ void factory (TAO_AV_Flow_Protocol_Factory *factory);
+
+private:
+ /// Flow_Protocol factory name.
+ ACE_CString name_;
+
+ /// pointer to factory object.
+ TAO_AV_Flow_Protocol_Factory *factory_;
+};
+
+
+/**
+ * @class TAO_AV_Flow_Handler
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_Flow_Handler
+{
+public:
+ /// Constructor.
+ TAO_AV_Flow_Handler (void);
+
+ virtual ~TAO_AV_Flow_Handler (void);
+ /// Start/stop the flow handler.
+ virtual int start (TAO_FlowSpec_Entry::Role role);
+ virtual int stop (TAO_FlowSpec_Entry::Role role);
+
+ /// Schedule timer. Uses the get_timeout method on the callback.
+ virtual int schedule_timer (void);
+ virtual int cancel_timer (void);
+
+ /// get the transport.
+ TAO_AV_Transport *transport (void);
+
+ /// set/get protocol_object.
+ TAO_AV_Protocol_Object* protocol_object (void);
+ void protocol_object (TAO_AV_Protocol_Object *protocol_object);
+
+ /// set the callback.
+ void callback (TAO_AV_Callback *callback);
+
+ /// Handle timeout. called from reactor.
+ virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg = 0);
+
+ /// set the remote address.
+ virtual int set_remote_address (ACE_Addr *address);
+
+ /// get the underlying event handler. To be overridden by the derived clases.
+ virtual ACE_Event_Handler* event_handler (void) = 0;
+
+ virtual int change_qos (AVStreams::QoS);
+
+protected:
+ TAO_AV_Transport *transport_;
+ TAO_AV_Callback *callback_;
+ TAO_AV_Protocol_Object *protocol_object_;
+ long timer_id_;
+ ACE_Reactor *reactor_;
+ void *timeout_arg_;
+};
+
+// Transports
+/**
+ * @class TAO_AV_Transport
+ * @brief A Base class for the different transport protocols.
+ * All the different transports should derive and implement
+ * the open,close,send and recv methods.
+ */
+class TAO_AV_Export TAO_AV_Transport
+{
+public:
+ TAO_AV_Transport (void);
+
+ virtual ~TAO_AV_Transport (void);
+
+ virtual int open (ACE_Addr *address) = 0;
+
+ virtual int close (void) = 0;
+
+ /// Write the complete Message_Block chain to the connection.
+ virtual int mtu (void) = 0;
+ virtual ACE_Addr *get_peer_addr (void) = 0;
+ virtual ACE_Addr *get_local_addr (void);
+ virtual ssize_t send (const ACE_Message_Block *mblk,
+ ACE_Time_Value *s = 0) = 0;
+
+ /// Write the contents of the buffer of length len to the connection.
+ virtual ssize_t send (const char *buf,
+ size_t len,
+ ACE_Time_Value *s = 0) = 0;
+
+ /// Write the contents of iovcnt iovec's to the connection.
+ virtual ssize_t send (const iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *s = 0) = 0;
+
+ /// Read len bytes from into buf.
+ virtual ssize_t recv (char *buf,
+ size_t len,
+ ACE_Time_Value *s = 0) = 0;
+
+ /// Read len bytes from into buf using flags.
+ virtual ssize_t recv (char *buf,
+ size_t len,
+ int flags,
+ ACE_Time_Value *s = 0) = 0;
+
+ /// Read received data into the iovec buffers.
+ virtual ssize_t recv (iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *s = 0) = 0;
+
+};
+
+class TAO_Base_StreamEndPoint;
+class TAO_AV_Core;
+class TAO_FlowSpec_Entry;
+
+/**
+ * @class TAO_AV_Acceptor
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_Acceptor
+{
+public:
+ TAO_AV_Acceptor (void);
+ virtual ~TAO_AV_Acceptor (void);
+ virtual int open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp) = 0;
+
+ virtual int open_default (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp) = 0;
+
+ const char *flowname ();
+ virtual int close (void) = 0;
+protected:
+ ACE_CString flowname_;
+ TAO_AV_Core *av_core_;
+ ACE_Addr *address_;
+};
+
+/**
+ * @class TAO_AV_Connector
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_Connector
+{
+public:
+ TAO_AV_Connector (void);
+ virtual ~TAO_AV_Connector (void);
+ const char *flowname (void);
+
+ virtual int open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_AV_Flow_Protocol_Factory *factory) = 0;
+
+ virtual int connect (TAO_FlowSpec_Entry *entry,
+ TAO_AV_Transport *&transport,
+ TAO_AV_Core::Flow_Component flow_component) = 0;
+
+ virtual int close (void) = 0;
+protected:
+ ACE_CString flowname_;
+};
+
+
+typedef ACE_Unbounded_Set<TAO_AV_Connector*> TAO_AV_ConnectorSet;
+typedef ACE_Unbounded_Set_Iterator<TAO_AV_Connector*> TAO_AV_ConnectorSetItor;
+
+/**
+ * @class TAO_AV_Connector_Registry
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_Connector_Registry
+{
+public:
+ /**
+ * int connect (TAO_FlowSpec_Entry *flowspec,
+ * TAO_AV_Transport *&transport);
+ * TAO_AV_Connector *get_connector (TAO_AV_Core::Protocol protocol);
+ * Return the connector bridges
+ */
+ TAO_AV_Connector_Registry (void);
+ ~TAO_AV_Connector_Registry (void);
+ int open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_AV_FlowSpecSet &flow_spec_set);
+ int close (TAO_AV_Connector *connector);
+ int close_all (void);
+ TAO_AV_ConnectorSetItor begin (void);
+ TAO_AV_ConnectorSetItor end (void);
+protected:
+ TAO_AV_ConnectorSet connectors_;
+};
+
+typedef ACE_Unbounded_Set<TAO_AV_Acceptor*> TAO_AV_AcceptorSet;
+typedef ACE_Unbounded_Set_Iterator<TAO_AV_Acceptor*> TAO_AV_AcceptorSetItor;
+
+/**
+ * @class TAO_AV_Acceptor_Registry
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_Acceptor_Registry
+{
+public:
+ TAO_AV_Acceptor_Registry (void);
+ ~TAO_AV_Acceptor_Registry (void);
+ int open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_AV_FlowSpecSet &flow_spec_set);
+ int close (TAO_AV_Acceptor *acceptor);
+ int close_all (void);
+ TAO_AV_AcceptorSetItor begin (void);
+ TAO_AV_AcceptorSetItor end (void);
+protected:
+ int open_default (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry);
+ TAO_AV_AcceptorSet acceptors_;
+};
+
+/**
+ * @class TAO_AV_Transport_Factory
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_Transport_Factory : public ACE_Service_Object
+{
+public:
+ /// Initialization hook.
+ TAO_AV_Transport_Factory (void);
+ virtual ~TAO_AV_Transport_Factory (void);
+ virtual int init (int argc, char *argv[]);
+ virtual int match_protocol (const char *protocol_string);
+ virtual TAO_AV_Acceptor *make_acceptor (void);
+ virtual TAO_AV_Connector *make_connector (void);
+ int ref_count;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/AV/Transport.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_TRANSPORT_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/Transport.i b/TAO/orbsvcs/orbsvcs/AV/Transport.i
new file mode 100644
index 00000000000..c05c2474e2b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/Transport.i
@@ -0,0 +1,111 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//------------------------------------------------------------
+// TAO_AV_Transport_Item
+//------------------------------------------------------------
+ACE_INLINE
+const ACE_CString &
+TAO_AV_Transport_Item::name (void)
+{
+ return this->name_;
+}
+
+ACE_INLINE
+TAO_AV_Transport_Factory *
+TAO_AV_Transport_Item::factory (void)
+{
+ return this->factory_;
+}
+
+ACE_INLINE
+void
+TAO_AV_Transport_Item::factory (TAO_AV_Transport_Factory *factory)
+{
+ this->factory_ = factory;
+}
+
+
+//------------------------------------------------------------
+// TAO_AV_Flow_Protocol_Item
+//------------------------------------------------------------
+ACE_INLINE
+const ACE_CString &
+TAO_AV_Flow_Protocol_Item::name (void)
+{
+ return this->name_;
+}
+
+ACE_INLINE
+TAO_AV_Flow_Protocol_Factory *
+TAO_AV_Flow_Protocol_Item::factory (void)
+{
+ return this->factory_;
+}
+
+ACE_INLINE
+void
+TAO_AV_Flow_Protocol_Item::factory (TAO_AV_Flow_Protocol_Factory *factory)
+{
+ this->factory_ = factory;
+}
+
+//------------------------------------------------------------
+// TAO_AV_Connector_Registry
+//------------------------------------------------------------
+
+ACE_INLINE
+TAO_AV_ConnectorSetItor
+TAO_AV_Connector_Registry::begin (void)
+{
+ return this->connectors_.begin ();
+}
+
+ACE_INLINE
+TAO_AV_ConnectorSetItor
+TAO_AV_Connector_Registry::end (void)
+{
+ return this->connectors_.end ();
+}
+
+//------------------------------------------------------------
+// TAO_AV_Acceptor_Registry
+//------------------------------------------------------------
+ACE_INLINE
+TAO_AV_AcceptorSetItor
+TAO_AV_Acceptor_Registry::begin (void)
+{
+ return this->acceptors_.begin ();
+}
+
+ACE_INLINE
+TAO_AV_AcceptorSetItor
+TAO_AV_Acceptor_Registry::end (void)
+{
+ return this->acceptors_.end ();
+}
+
+//------------------------------------------------------------
+// TAO_AV_Acceptor
+//------------------------------------------------------------
+ACE_INLINE
+const char *
+TAO_AV_Acceptor::flowname (void)
+{
+ return this->flowname_.c_str ();
+}
+
+//------------------------------------------------------------
+// TAO_AV_Connector
+//------------------------------------------------------------
+ACE_INLINE
+const char *
+TAO_AV_Connector::flowname (void)
+{
+ return this->flowname_.c_str ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/UDP.cpp b/TAO/orbsvcs/orbsvcs/AV/UDP.cpp
new file mode 100644
index 00000000000..827079c3c90
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/UDP.cpp
@@ -0,0 +1,1094 @@
+// $Id$
+
+#include "orbsvcs/AV/UDP.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/MCast.h"
+
+#include "tao/debug.h"
+#include "ace/OS_NS_strings.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/AV/UDP.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (AV,
+ UDP,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//------------------------------------------------------------
+// TAO_AV_UDP_Flow_Handler
+//------------------------------------------------------------
+
+TAO_AV_UDP_Flow_Handler::TAO_AV_UDP_Flow_Handler (void)
+{
+ ACE_NEW (this->transport_,
+ TAO_AV_UDP_Transport (this));
+}
+
+TAO_AV_UDP_Flow_Handler::~TAO_AV_UDP_Flow_Handler (void)
+{
+ // remove the event handler from the reactor.
+ TAO_AV_CORE::instance()->reactor ()->remove_handler (this->event_handler(),
+ ACE_Event_Handler::READ_MASK);
+
+ // close the socket.
+ this->close ();
+ delete this->transport_;
+}
+
+TAO_AV_Transport *
+TAO_AV_UDP_Flow_Handler::transport (void)
+{
+ return this->transport_;
+}
+
+int
+TAO_AV_UDP_Flow_Handler::handle_input (ACE_HANDLE /*fd*/)
+{
+ return this->protocol_object_->handle_input ();
+}
+
+int
+TAO_AV_UDP_Flow_Handler::handle_timeout (const ACE_Time_Value &tv,
+ const void *arg)
+{
+ return TAO_AV_Flow_Handler::handle_timeout (tv,arg);
+}
+
+int
+TAO_AV_UDP_Flow_Handler::set_remote_address (ACE_Addr *address)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_Flow_Handler::set_remote_address\n"));
+
+ ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (address);
+ this->peer_addr_ = *inet_addr;
+ TAO_AV_UDP_Transport *transport = dynamic_cast<TAO_AV_UDP_Transport*> (this->transport_);
+
+ return transport->set_remote_address (*inet_addr);
+}
+
+
+ACE_HANDLE
+TAO_AV_UDP_Flow_Handler::get_handle (void) const
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_UDP_Flow_Handler::get_handle:%d\n",
+ this->sock_dgram_.get_handle ()));
+
+ return this->sock_dgram_.get_handle () ;
+}
+
+int
+TAO_AV_UDP_Flow_Handler::change_qos(AVStreams::QoS qos)
+{
+ if( TAO_debug_level > 0 )
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) TAO_AV_UDP_Flow_Handler::change_qos\n"));
+ }
+
+ unsigned int i=0;
+
+ int ret = 0;
+ CORBA::Long dscp = 0;
+ CORBA::Long ecn = 0;
+ int dscp_flag=0;
+ for(i=0; i < qos.QoSParams.length(); i++)
+ {
+
+ if( ACE_OS::strcmp( qos.QoSParams[i].property_name.in(), "Diffserv_Codepoint") == 0)
+ {
+ qos.QoSParams[i].property_value >>= dscp;
+ dscp_flag=1;
+ // DSCP value can only be 6 bits wide
+ if(!((dscp >= 0) && (dscp <= 63)))
+ {
+ dscp_flag = 0;
+ ACE_DEBUG((LM_DEBUG, "(%N,%l) ECN value can only be (0-3) not %d\n", ecn));
+ return -1;
+ }
+ }
+
+ if( ACE_OS::strcmp( qos.QoSParams[i].property_name.in(), "ECN") == 0)
+ {
+ qos.QoSParams[i].property_value >>= ecn;
+ // ECN value can only occupy bits 6 and 7 of the
+ // IP Diffserv byte
+ if(!((ecn >= 0) && (ecn <= 3)))
+ {
+ ACE_DEBUG((LM_DEBUG, "(%N,%l) ECN value can only be (0-3) not %d\n", ecn));
+ ecn = 0;
+ }
+
+ }
+ }
+ // Set the Diffserv byte only if we specified
+ // the Diffserv Codepoint (DSCP) or ECN via QoSParams
+ // passed into this method
+ if(dscp_flag || ecn)
+ {
+ int tos;
+ tos = (int)(dscp << 2);
+ if(ecn)
+ {
+ tos |= ecn;
+ }
+ ret = sock_dgram_.set_option(IPPROTO_IP, IP_TOS, (int *)&tos , (int)sizeof(tos));
+
+ if(TAO_debug_level > 1)
+ {
+ ACE_DEBUG((LM_DEBUG, "(%N,%l) set tos: ret: %d\n", ret));
+ }
+ }
+
+ if(TAO_debug_level > 1)
+ {
+ if(ret < 0 )
+ {
+ ACE_DEBUG((LM_DEBUG, "(%N,%l) errno: %p\n"));
+ }
+ }
+ return ret;
+}
+
+//------------------------------------------------------------
+// TAO_AV_UDP_Transport
+//------------------------------------------------------------
+
+TAO_AV_UDP_Transport::TAO_AV_UDP_Transport (void)
+ :handler_ (0)
+{
+}
+
+TAO_AV_UDP_Transport::TAO_AV_UDP_Transport (TAO_AV_UDP_Flow_Handler *handler)
+ :handler_ (handler),
+ addr_ (0)
+{
+}
+
+TAO_AV_UDP_Transport::~TAO_AV_UDP_Transport (void)
+{
+}
+
+int
+TAO_AV_UDP_Transport::set_remote_address (const ACE_INET_Addr &address)
+{
+ this->peer_addr_ = address;
+ return 0;
+}
+
+int
+TAO_AV_UDP_Transport::open (ACE_Addr * /*address*/)
+{
+ return 0;
+}
+
+int
+TAO_AV_UDP_Transport::close (void)
+{
+ return 0;
+}
+
+int
+TAO_AV_UDP_Transport::mtu (void)
+{
+ return 65535;
+}
+
+ACE_Addr*
+TAO_AV_UDP_Transport::get_peer_addr (void)
+{
+ return &this->peer_addr_;
+}
+
+ssize_t
+TAO_AV_UDP_Transport::send (const ACE_Message_Block *mblk, ACE_Time_Value *)
+{
+ // For the most part this was copied from GIOP::send_request and
+ // friends.
+
+ iovec iov[ACE_IOV_MAX];
+ int iovcnt = 0;
+ ssize_t n = 0;
+ ssize_t nbytes = 0;
+
+ for (const ACE_Message_Block *i = mblk;
+ i != 0;
+ i = i->cont ())
+ {
+ // Make sure there is something to send!
+ if (i->length () > 0)
+ {
+ iov[iovcnt].iov_base = i->rd_ptr ();
+ iov[iovcnt].iov_len = static_cast<u_long> (i->length ());
+ iovcnt++;
+
+ // The buffer is full make a OS call. @@ TODO this should
+ // be optimized on a per-platform basis, for instance, some
+ // platforms do not implement writev() there we should copy
+ // the data into a buffer and call send_n(). In other cases
+ // there may be some limits on the size of the iovec, there
+ // we should set ACE_IOV_MAX to that limit.
+ if (iovcnt == ACE_IOV_MAX)
+ {
+ n = this->handler_->get_socket ()->send ((const iovec *) iov,
+ iovcnt,
+ this->peer_addr_);
+
+ if (n < 1)
+ return n;
+
+ nbytes += n;
+ iovcnt = 0;
+ }
+ }
+ }
+
+ // Check for remaining buffers to be sent!
+ if (iovcnt != 0)
+ {
+ n = this->handler_->get_socket ()->send ((const iovec *) iov,
+ iovcnt,
+ this->peer_addr_);
+
+ if (n < 1)
+ return n;
+
+ nbytes += n;
+ }
+
+ return nbytes;
+}
+
+ssize_t
+TAO_AV_UDP_Transport::send (const char *buf,
+ size_t len,
+ ACE_Time_Value *)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_Transport::send "));
+ char addr [BUFSIZ];
+ this->peer_addr_.addr_to_string (addr,BUFSIZ);
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"to %s\n",addr));
+
+ return this->handler_->get_socket ()->send (buf, len,this->peer_addr_);
+}
+
+ssize_t
+TAO_AV_UDP_Transport::send (const iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *)
+{
+ return this->handler_->get_socket ()->send ((const iovec *) iov,
+ iovcnt,
+ this->peer_addr_);
+
+}
+
+ssize_t
+TAO_AV_UDP_Transport::recv (char *buf,
+ size_t len,
+ ACE_Time_Value *)
+{
+ return this->handler_->get_socket ()->recv (buf, len,this->peer_addr_);
+}
+
+ssize_t
+TAO_AV_UDP_Transport::recv (char *buf,
+ size_t len,
+ int flags,
+ ACE_Time_Value *timeout)
+{
+ return this->handler_->get_socket ()->recv (buf,
+ len,
+ this->peer_addr_,
+ flags,
+ timeout);
+}
+
+ssize_t
+TAO_AV_UDP_Transport::recv (iovec *iov,
+ int /*iovcnt*/,
+ ACE_Time_Value *timeout)
+{
+ return handler_->get_socket ()->recv (iov,this->peer_addr_,0,timeout);
+}
+
+
+//------------------------------------------------------------
+// TAO_AV_UDP_Acceptor
+//------------------------------------------------------------
+
+TAO_AV_UDP_Acceptor::TAO_AV_UDP_Acceptor (void)
+ : address_ (0),
+ control_inet_address_ (0)
+{
+}
+
+TAO_AV_UDP_Acceptor::~TAO_AV_UDP_Acceptor (void)
+{
+ if (this->flow_component_ == TAO_AV_Core::TAO_AV_CONTROL)
+ delete this->entry_->control_handler ();
+
+ delete this->address_;
+ delete this->control_inet_address_;
+}
+
+int
+TAO_AV_UDP_Acceptor::activate_svc_handler (TAO_AV_Flow_Handler *handler)
+{
+ ACE_Event_Handler *event_handler = handler->event_handler ();
+ int result = this->av_core_->reactor ()->register_handler (event_handler,
+ ACE_Event_Handler::READ_MASK);
+
+ if (this->flow_component_ == TAO_AV_Core::TAO_AV_CONTROL)
+ handler->schedule_timer ();
+
+ return result;
+}
+
+int
+TAO_AV_UDP_Acceptor::open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_Acceptor::open\n"));
+ this->av_core_ = av_core;
+ this->endpoint_ = endpoint;
+ this->entry_ = entry;
+ this->flow_component_ = flow_comp;
+ this->flow_protocol_factory_ = factory;
+ ACE_INET_Addr *inet_addr;
+ if (flow_comp == TAO_AV_Core::TAO_AV_CONTROL)
+ {
+ this->flowname_ = TAO_AV_Core::get_control_flowname (entry->flowname ());
+ inet_addr = (ACE_INET_Addr *) entry->control_address ();
+ }
+ else
+ {
+ this->flowname_ = entry->flowname ();
+ inet_addr = (ACE_INET_Addr *) entry->address ();
+ }
+
+ if (inet_addr != 0)
+ {
+ char buf[BUFSIZ];
+ inet_addr->addr_to_string (buf,
+ BUFSIZ);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_UDP_Acceptor::open: %s\n",
+ buf));
+ }
+
+ int result = this->open_i (inet_addr, 0);
+
+ if (result < 0)
+ return result;
+ return 0;
+}
+
+int
+TAO_AV_UDP_Acceptor::open_default (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp)
+{
+ this->av_core_ = av_core;
+ this->endpoint_ = endpoint;
+ this->entry_ = entry;
+ this->flow_component_ = flow_comp;
+ this->flow_protocol_factory_ = factory;
+ if (flow_comp == TAO_AV_Core::TAO_AV_CONTROL)
+ {
+ this->flowname_ = TAO_AV_Core::get_control_flowname (entry->flowname ());
+ }
+ else
+ {
+ this->flowname_ = entry->flowname ();
+ ACE_NEW_RETURN (this->address_,
+ ACE_INET_Addr ("0"),
+ -1);
+ }
+
+ int result = this->open_i (this->address_, 1);
+ if (result < 0)
+ return result;
+
+ return 0;
+}
+
+int
+TAO_AV_UDP_Acceptor::open_i (ACE_INET_Addr *inet_addr,
+ int is_default_addr)
+{
+ int result = -1;
+ ACE_INET_Addr *local_addr = 0;
+
+ TAO_AV_Flow_Handler *flow_handler = 0;
+
+ // if using a default address and this is the control flow component, the
+ // handler and local address are already set in the flow spec entry
+ if (is_default_addr &&
+ (this->flow_component_ == TAO_AV_Core::TAO_AV_CONTROL) &&
+ (ACE_OS::strcasecmp(this->entry_->flow_protocol_str (), "RTP") == 0))
+ {
+ flow_handler = this->entry_->control_handler ();
+
+ local_addr = dynamic_cast<ACE_INET_Addr*> (this->entry_->get_local_control_addr ());
+ }
+ else
+ {
+ // this variable is only used for RTP/UDP; RFC 1889 requires an even/odd
+ // consecutive port pair
+ int get_new_port = 1;
+
+ while (get_new_port)
+ {
+ // assume the ports will be OK
+ get_new_port = 0;
+
+ result = TAO_AV_UDP_Connection_Setup::setup (flow_handler,
+ inet_addr,
+ local_addr,
+ this->entry_->is_multicast (),
+ TAO_AV_UDP_Connection_Setup::ACCEPTOR);
+
+ if (result < 0)
+ {
+ ACE_DEBUG((LM_DEBUG,"(%N,%l) Error during connection setup: %d\n", result));
+ }
+
+ local_addr->set (local_addr->get_port_number (),
+ local_addr->get_host_name ());
+
+ if (is_default_addr)
+ {
+ if ((ACE_OS::strcasecmp(this->entry_->flow_protocol_str (), "RTP") == 0) &&
+ (this->flow_component_ == TAO_AV_Core::TAO_AV_DATA))
+ {
+ if (is_default_addr && local_addr->get_port_number ()%2 != 0)
+ {
+ // RTP port should be even
+ delete local_addr;
+ delete flow_handler;
+ get_new_port = 1;
+ }
+ else
+ {
+ ACE_INET_Addr *local_control_addr;
+ TAO_AV_Flow_Handler *control_flow_handler = 0;
+
+ ACE_NEW_RETURN (this->control_inet_address_,
+ ACE_INET_Addr ("0"),
+ -1);
+
+ TAO_AV_UDP_Connection_Setup::setup(control_flow_handler,
+ this->control_inet_address_,
+ local_control_addr,
+ this->entry_->is_multicast (),
+ TAO_AV_UDP_Connection_Setup::ACCEPTOR);
+
+ if (local_control_addr->get_port_number () !=
+ local_addr->get_port_number () +1)
+ {
+ delete this->control_inet_address_;
+ delete local_addr;
+ delete flow_handler;
+ delete local_control_addr;
+ delete control_flow_handler;
+ get_new_port = 1;
+ }
+ else
+ {
+ this->entry_->control_address (this->control_inet_address_);
+ this->entry_->set_local_control_addr (local_control_addr);
+ this->entry_->control_handler (control_flow_handler);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ TAO_AV_Protocol_Object *object =
+ this->flow_protocol_factory_->make_protocol_object (this->entry_,
+ this->endpoint_,
+ flow_handler,
+ flow_handler->transport ());
+ flow_handler->protocol_object (object);
+
+ if (this->flow_component_ == TAO_AV_Core::TAO_AV_DATA)
+ {
+ this->endpoint_->set_flow_handler (this->flowname_.c_str (),flow_handler);
+
+ this->entry_->protocol_object (object);
+ this->entry_->set_local_addr (local_addr);
+ this->entry_->handler (flow_handler);
+ //this->entry_->address (inet_addr);
+ this->entry_->address (local_addr);
+ }
+ else
+ {
+ this->endpoint_->set_control_flow_handler (this->flowname_.c_str (),flow_handler);
+
+ this->entry_->control_protocol_object (object);
+ this->entry_->set_local_control_addr (local_addr);
+ this->entry_->control_handler (flow_handler);
+ }
+
+ char buf[BUFSIZ];
+ local_addr->addr_to_string (buf,BUFSIZ);
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_UDP_ACCEPTOR::open:%s \n",
+ buf));
+
+ // call activate svc handler.
+ return this->activate_svc_handler (flow_handler);
+}
+
+int
+TAO_AV_UDP_Acceptor::close (void)
+{
+ return 0;
+}
+
+//------------------------------------------------------------
+// TAO_AV_UDP_Connector
+//------------------------------------------------------------
+TAO_AV_UDP_Connector::TAO_AV_UDP_Connector (void)
+ : control_inet_address_ (0)
+{
+}
+
+TAO_AV_UDP_Connector::~TAO_AV_UDP_Connector (void)
+{
+ if (this->flow_component_ == TAO_AV_Core::TAO_AV_CONTROL)
+ {
+ delete this->entry_->control_handler ();
+ }
+
+ if (this->control_inet_address_ != 0)
+ delete this->control_inet_address_;
+}
+
+int
+TAO_AV_UDP_Connector::open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_AV_Flow_Protocol_Factory *factory)
+
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_Connector::open "));
+ this->endpoint_ = endpoint;
+ this->av_core_ = av_core;
+ this->flow_protocol_factory_ = factory;
+ return 0;
+}
+
+int
+TAO_AV_UDP_Connector::connect (TAO_FlowSpec_Entry *entry,
+ TAO_AV_Transport *&transport,
+ TAO_AV_Core::Flow_Component flow_component)
+{
+ ACE_INET_Addr *local_addr = 0;
+ ACE_INET_Addr *control_inet_addr = 0;
+
+ this->entry_ = entry;
+ this->flow_component_ = flow_component;
+
+ ACE_INET_Addr *inet_addr;
+
+ if (flow_component == TAO_AV_Core::TAO_AV_CONTROL)
+ {
+ this->flowname_ = TAO_AV_Core::get_control_flowname (entry->flowname());
+ inet_addr = dynamic_cast<ACE_INET_Addr*> (entry->control_address ());
+ }
+ else
+ {
+ this->flowname_ = entry->flowname ();
+ inet_addr = dynamic_cast<ACE_INET_Addr*> (entry->address ());
+ control_inet_addr = dynamic_cast<ACE_INET_Addr*> (entry->control_address ());
+ }
+
+ TAO_AV_Flow_Handler *flow_handler = 0;
+
+ // if this is the control flow component, the
+ // handler and local address are already set in the flow spec entry
+ if ((flow_component == TAO_AV_Core::TAO_AV_CONTROL) &&
+ (ACE_OS::strcasecmp(this->entry_->flow_protocol_str (), "RTP") == 0) &&
+ !entry->is_multicast ())
+ {
+ flow_handler = this->entry_->control_handler ();
+ flow_handler->set_remote_address (inet_addr);
+
+ local_addr = dynamic_cast<ACE_INET_Addr*> (this->entry_->get_local_control_addr ());
+ }
+ else
+ {
+ // this variable is only used for RTP/UDP; RFC 1889 requires an even/odd
+ // consecutive port pair
+ int get_new_port = 1;
+
+ while (get_new_port)
+ {
+ // assume the ports will be OK
+ get_new_port = 0;
+
+ ACE_Addr *addr;
+ if ((addr = entry->get_peer_addr ()) != 0)
+ {
+ local_addr = dynamic_cast<ACE_INET_Addr*> (addr);
+ char buf [BUFSIZ];
+ local_addr->addr_to_string (buf, BUFSIZ);
+ }
+
+ TAO_AV_UDP_Connection_Setup::setup (flow_handler,
+ inet_addr,
+ local_addr,
+ entry->is_multicast (),
+ TAO_AV_UDP_Connection_Setup::CONNECTOR);
+
+ if ((ACE_OS::strcasecmp(this->entry_->flow_protocol_str (), "RTP") == 0) &&
+ (flow_component == TAO_AV_Core::TAO_AV_DATA) &&
+ !entry->is_multicast ())
+ {
+ if (local_addr->get_port_number ()%2 != 0)
+ {
+ // RTP port should be even
+ delete local_addr;
+ delete flow_handler;
+ get_new_port = 1;
+ }
+ else
+ {
+ ACE_INET_Addr *local_control_addr;
+ TAO_AV_Flow_Handler *control_flow_handler = 0;
+
+ if (entry->is_multicast ())
+ control_inet_addr = dynamic_cast<ACE_INET_Addr*> (entry->control_address ()) ;
+ else
+ {
+
+ if (local_addr != 0)
+ {
+ char buf [BUFSIZ];
+ ACE_CString addr_str (local_addr->get_host_name ());
+ addr_str += ":";
+ addr_str += ACE_OS::itoa (local_addr->get_port_number () + 1, buf, 10);
+ ACE_NEW_RETURN (local_control_addr,
+ ACE_INET_Addr (addr_str.c_str ()),
+ -1);
+ local_control_addr->addr_to_string (buf, BUFSIZ);
+ }
+
+
+ if (entry->control_address () == 0)
+ ACE_NEW_RETURN (this->control_inet_address_,
+ ACE_INET_Addr ("0"),
+ -1);
+ else
+ control_inet_address_ = dynamic_cast<ACE_INET_Addr*> (entry->control_address ());
+ }
+
+ TAO_AV_UDP_Connection_Setup::setup (control_flow_handler,
+ control_inet_addr,
+ local_control_addr,
+ entry->is_multicast (),
+ TAO_AV_UDP_Connection_Setup::CONNECTOR);
+
+ if (local_control_addr->get_port_number () !=
+ local_addr->get_port_number () +1)
+ {
+ delete local_addr;
+ delete flow_handler;
+ delete local_control_addr;
+ delete control_flow_handler;
+ get_new_port = 1;
+ }
+ else
+ {
+ this->entry_->set_local_control_addr (local_control_addr);
+ this->entry_->control_handler (control_flow_handler);
+ }
+ }
+ }
+ }
+ }
+
+ TAO_AV_Protocol_Object *object =
+ this->flow_protocol_factory_->make_protocol_object (this->entry_,
+ this->endpoint_,
+ flow_handler,
+ flow_handler->transport ());
+
+ flow_handler->protocol_object (object);
+
+ if (flow_component == TAO_AV_Core::TAO_AV_DATA)
+ {
+ this->endpoint_->set_flow_handler (this->flowname_.c_str (),
+ flow_handler);
+ this->entry_->protocol_object (object);
+ entry->set_local_addr (local_addr);
+ entry->handler (flow_handler);
+ transport = flow_handler->transport ();
+ }
+ else
+ {
+ this->endpoint_->set_control_flow_handler (this->flowname_.c_str (),
+ flow_handler);
+ this->entry_->control_protocol_object (object);
+ entry->set_local_control_addr (local_addr);
+ entry->control_handler (flow_handler);
+ transport = flow_handler->transport ();
+ }
+
+ char buf[BUFSIZ];
+ local_addr->addr_to_string (buf,BUFSIZ);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_CONNECTOR::connect:%s \n",buf));
+
+ // call activate svc handler.
+ return this->activate_svc_handler (flow_handler);
+}
+
+int
+TAO_AV_UDP_Connector::activate_svc_handler (TAO_AV_Flow_Handler *handler)
+{
+ ACE_Event_Handler *event_handler = handler->event_handler ();
+ int result = this->av_core_->reactor ()->register_handler (event_handler,
+ ACE_Event_Handler::READ_MASK);
+
+ if (this->flow_component_ == TAO_AV_Core::TAO_AV_CONTROL)
+ handler->schedule_timer ();
+
+ return result;
+}
+
+int
+TAO_AV_UDP_Connector::close (void)
+{
+ return 0;
+}
+
+//------------------------------------------------------------
+// TAO_AV_UDP_Connection_Setup
+//------------------------------------------------------------
+
+int
+TAO_AV_UDP_Connection_Setup::setup (TAO_AV_Flow_Handler *&flow_handler,
+ ACE_INET_Addr *inet_addr,
+ ACE_INET_Addr *&local_addr,
+ int is_multicast,
+ ConnectionType ct)
+{
+ int result;
+
+ if (is_multicast)
+ {
+ TAO_AV_UDP_MCast_Flow_Handler *handler;
+ ACE_NEW_RETURN (handler,
+ TAO_AV_UDP_MCast_Flow_Handler,
+ -1);
+
+ flow_handler = handler;
+
+ result = handler->get_mcast_socket ()->subscribe (*inet_addr);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_UDP_MCast_connector::open failed\n"),-1);
+
+ // Now disable Multicast loopback.
+ // @@Should we make this a policy?
+#if defined (ACE_HAS_IP_MULTICAST)
+ if (handler->get_mcast_socket ()->set_option (IP_MULTICAST_LOOP,
+ 0) < 0)
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_MCast_Acceptor::multicast loop disable failed\n"));
+ // @@ This should also be policies.
+#endif /*ACE_HAS_IP_MULTICAST*/
+
+ int bufsize = 80 * 1024;
+ if (handler->get_mcast_socket ()->ACE_SOCK::set_option (SOL_SOCKET,
+ SO_RCVBUF,
+ (char *)&bufsize,
+ sizeof(bufsize)) < 0)
+ {
+ bufsize = 32 * 1024;
+ if (handler->get_mcast_socket ()->ACE_SOCK::set_option (SOL_SOCKET,
+ SO_RCVBUF,
+ (char *)&bufsize,
+ sizeof(bufsize)) < 0)
+ perror("SO_RCVBUF");
+ }
+ ACE_NEW_RETURN (local_addr,
+ ACE_INET_Addr ("0"),
+ -1);
+
+ if (ct == ACCEPTOR)
+ {
+ result = handler->get_mcast_socket ()->get_local_addr (*local_addr);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_Dgram_Connector::open: get_local_addr failed\n"),result);
+
+ local_addr->set (local_addr->get_port_number (),
+ local_addr->get_host_name ());
+ handler->set_peer_addr (local_addr);
+ }
+ }
+ else
+ {
+ if (local_addr == 0)
+ ACE_NEW_RETURN (local_addr,
+ ACE_INET_Addr ("0"),
+ -1);
+
+ TAO_AV_UDP_Flow_Handler *handler;
+ ACE_NEW_RETURN (handler,
+ TAO_AV_UDP_Flow_Handler,
+ -1);
+
+ flow_handler = handler;
+
+ if (ct == ACCEPTOR)
+ result = handler->open (*inet_addr);
+ else
+ result = handler->open (*local_addr);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"handler::open failed\n"),-1);
+
+ // set the socket buffer sizes to 64k.
+ int sndbufsize = ACE_DEFAULT_MAX_SOCKET_BUFSIZ;
+ int rcvbufsize = ACE_DEFAULT_MAX_SOCKET_BUFSIZ;
+
+ if (handler->get_socket ()->set_option (SOL_SOCKET,
+ SO_SNDBUF,
+ (void *) &sndbufsize,
+ sizeof (sndbufsize)) == -1
+ && errno != ENOTSUP)
+ return 0;
+ else if (handler->get_socket ()->set_option (SOL_SOCKET,
+ SO_RCVBUF,
+ (void *) &rcvbufsize,
+ sizeof (rcvbufsize)) == -1
+ && errno != ENOTSUP)
+ return 0;
+
+ if (ct == CONNECTOR)
+ handler->set_remote_address (inet_addr);
+
+ result = handler->get_socket ()->get_local_addr (*local_addr);
+
+ local_addr->set (local_addr->get_port_number (),
+ local_addr->get_host_name ());
+
+ char buf [BUFSIZ];
+ local_addr->addr_to_string (buf, BUFSIZ);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_Dgram_Connector::open: get_local_addr failed\n"),result);
+ }
+
+ return 1;
+}
+
+//------------------------------------------------------------
+// TAO_AV_UDP_Protocol_Factory
+//------------------------------------------------------------
+
+TAO_AV_UDP_Factory::TAO_AV_UDP_Factory (void)
+{
+}
+
+TAO_AV_UDP_Factory::~TAO_AV_UDP_Factory (void)
+{
+}
+
+int
+TAO_AV_UDP_Factory::match_protocol (const char *protocol_string)
+{
+ if (ACE_OS::strcasecmp (protocol_string,"UDP") == 0)
+ return 1;
+ if (ACE_OS::strcasecmp (protocol_string,"RTP/UDP") == 0)
+ return 1;
+ return 0;
+}
+
+TAO_AV_Acceptor*
+TAO_AV_UDP_Factory::make_acceptor (void)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_Factory::make_acceptor\n"));
+ TAO_AV_Acceptor *acceptor = 0;
+ ACE_NEW_RETURN (acceptor,
+ TAO_AV_UDP_Acceptor,
+ 0);
+ return acceptor;
+}
+
+TAO_AV_Connector*
+TAO_AV_UDP_Factory::make_connector (void)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_Factory::make_connector\n"));
+ TAO_AV_Connector *connector = 0;
+ ACE_NEW_RETURN (connector,
+ TAO_AV_UDP_Connector,
+ 0);
+ return connector;
+}
+
+int
+TAO_AV_UDP_Factory::init (int /* argc */,
+ char * /* argv */ [])
+{
+ return 0;
+}
+
+//------------------------------------------------------------
+// TAO_AV_UDP_Object
+//------------------------------------------------------------
+
+int
+TAO_AV_UDP_Object::handle_input (void)
+{
+ int n = this->transport_->recv (this->frame_.rd_ptr (),
+ this->frame_.size ());
+ if (n == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,"(%N,%l) TAO_AV_UDP_Flow_Handler::handle_input recv failed: errno: %m\n"),-1);
+
+ this->frame_.wr_ptr (this->frame_.rd_ptr () + n);
+
+ return this->callback_->receive_frame (&this->frame_);
+}
+
+int
+TAO_AV_UDP_Object::send_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info * /*frame_info*/)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_Object::send_frame\n"));
+ int result = this->transport_->send (frame);
+ if (result < 0)
+ return result;
+ return 0;
+}
+
+int
+TAO_AV_UDP_Object::send_frame (const iovec *iov,
+ int iovcnt,
+ TAO_AV_frame_info * /*frame_info*/)
+{
+ int result = this->transport_->send (iov,iovcnt);
+ if (result < 0)
+ return result;
+ return 0;
+}
+
+int
+TAO_AV_UDP_Object::send_frame (const char*buf,
+ size_t len)
+{
+ int result = this->transport_->send (buf, len, 0);
+ if (result < 0)
+ return result;
+ return 0;
+}
+
+TAO_AV_UDP_Object::TAO_AV_UDP_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport)
+ :TAO_AV_Protocol_Object (callback,transport)
+{
+ this->frame_.size (this->transport_->mtu ());
+}
+
+TAO_AV_UDP_Object::~TAO_AV_UDP_Object (void)
+{
+ //no-op
+}
+
+int
+TAO_AV_UDP_Object::destroy (void)
+{
+ this->callback_->handle_destroy ();
+ delete this;
+
+ return 0;
+}
+
+
+//------------------------------------------------------------
+// TAO_AV_UDP_Flow_Factory
+//------------------------------------------------------------
+TAO_AV_UDP_Flow_Factory::TAO_AV_UDP_Flow_Factory (void)
+{
+}
+
+TAO_AV_UDP_Flow_Factory::~TAO_AV_UDP_Flow_Factory (void)
+{
+}
+
+int
+TAO_AV_UDP_Flow_Factory::init (int /* argc */,
+ char * /* argv */ [])
+{
+ return 0;
+}
+
+int
+TAO_AV_UDP_Flow_Factory::match_protocol (const char *flow_string)
+{
+ if (ACE_OS::strcasecmp (flow_string,"UDP") == 0)
+ return 1;
+ return 0;
+}
+
+TAO_AV_Protocol_Object*
+TAO_AV_UDP_Flow_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;
+ if( endpoint->get_callback (entry->flowname (), callback) ) {
+ ACE_ERROR_RETURN ((LM_ERROR, "(%N,%l) Invalid callback\n"), 0);
+ }
+
+ TAO_AV_UDP_Object *object = 0;
+ ACE_NEW_RETURN (object,
+ TAO_AV_UDP_Object (callback,
+ transport),
+ 0);
+ callback->open (object,
+ handler);
+ endpoint->set_protocol_object (entry->flowname (),
+ object);
+
+ endpoint->protocol_object_set ();
+
+ return object;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_AV, TAO_AV_UDP_Flow_Factory)
+ACE_STATIC_SVC_DEFINE (TAO_AV_UDP_Flow_Factory,
+ ACE_TEXT ("UDP_Flow_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_AV_UDP_Flow_Factory),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+ACE_FACTORY_DEFINE (TAO_AV, TAO_AV_UDP_Factory)
+ACE_STATIC_SVC_DEFINE (TAO_AV_UDP_Factory,
+ ACE_TEXT ("UDP_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_AV_UDP_Factory),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
diff --git a/TAO/orbsvcs/orbsvcs/AV/UDP.h b/TAO/orbsvcs/orbsvcs/AV/UDP.h
new file mode 100644
index 00000000000..f582af25ec7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/UDP.h
@@ -0,0 +1,296 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file UDP.h
+ *
+ * $Id$
+ *
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_AV_UDP_H
+#define TAO_AV_UDP_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+#include "ace/Service_Config.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_AV_UDP_Factory
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_UDP_Factory : public TAO_AV_Transport_Factory
+{
+public:
+ /// Initialization hook.
+ TAO_AV_UDP_Factory (void);
+ virtual ~TAO_AV_UDP_Factory (void);
+ virtual int init (int argc, char *argv[]);
+ virtual int match_protocol (const char *protocol_string);
+ virtual TAO_AV_Acceptor *make_acceptor (void);
+ virtual TAO_AV_Connector *make_connector (void);
+};
+
+class TAO_AV_UDP_Flow_Handler;
+
+/**
+ * @class TAO_AV_UDP_Transport
+ * @brief A transport abstraction for udp sockets.
+ * Uses the ACE_SOCK_Dgram to send the data.
+ */
+class TAO_AV_Export TAO_AV_UDP_Transport
+ :public TAO_AV_Transport
+{
+
+public:
+ TAO_AV_UDP_Transport (void);
+
+ TAO_AV_UDP_Transport (TAO_AV_UDP_Flow_Handler *handler);
+
+ virtual ~TAO_AV_UDP_Transport (void);
+ virtual int open (ACE_Addr *addr);
+
+ virtual int close (void);
+
+ virtual int mtu (void);
+
+ virtual ACE_Addr *get_peer_addr (void);
+
+ virtual int set_remote_address (const ACE_INET_Addr &address);
+
+ /// Write the complete Message_Block chain to the connection.
+ virtual ssize_t send (const ACE_Message_Block *mblk,
+ ACE_Time_Value *s = 0);
+
+ /// Write the contents of the buffer of length len to the connection.
+ virtual ssize_t send (const char *buf,
+ size_t len,
+ ACE_Time_Value *s = 0);
+
+ /// Write the contents of iovcnt iovec's to the connection.
+ virtual ssize_t send (const iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *s = 0);
+
+ /// Read len bytes from into buf.
+ virtual ssize_t recv (char *buf,
+ size_t len,
+ ACE_Time_Value *s = 0);
+
+ /// Read len bytes from into buf using flags.
+ virtual ssize_t recv (char *buf,
+ size_t len,
+ int flags,
+ ACE_Time_Value *s = 0);
+
+ /// Read received data into the iovec buffers.
+ virtual ssize_t recv (iovec *iov,
+ int iovcnt,
+ ACE_Time_Value *s = 0);
+
+ TAO_AV_UDP_Flow_Handler *handler (void) { return this->handler_; }
+
+protected:
+ TAO_AV_UDP_Flow_Handler *handler_;
+ ACE_Addr *addr_;
+ ACE_INET_Addr peer_addr_;
+};
+
+/**
+ * @class TAO_AV_UDP_Flow_Handler
+ * @brief Flow Handler for UDP flows.
+ */
+class TAO_AV_Export TAO_AV_UDP_Flow_Handler
+ :public virtual TAO_AV_Flow_Handler,
+ public virtual ACE_Event_Handler
+{
+public:
+ ///Ctor
+ /// Dtor
+ TAO_AV_UDP_Flow_Handler (void);
+ virtual ~TAO_AV_UDP_Flow_Handler (void);
+ int open (ACE_Addr &address);
+ int close (void);
+ virtual TAO_AV_Transport *transport (void);
+ virtual int set_remote_address (ACE_Addr *address);
+ virtual ACE_HANDLE get_handle (void) const;
+ virtual int handle_input (ACE_HANDLE fd);
+ virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg = 0);
+ const ACE_SOCK_Dgram *get_socket (void) const;
+ virtual ACE_Event_Handler* event_handler (void){ return this; }
+ /// Change the QoS
+ virtual int change_qos (AVStreams::QoS);
+
+protected:
+ TAO_AV_Core *av_core_;
+ ACE_INET_Addr peer_addr_;
+ ACE_SOCK_Dgram sock_dgram_;
+};
+
+/**
+ * @class TAO_AV_UDP_Acceptor
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_UDP_Acceptor
+ :public TAO_AV_Acceptor
+{
+public:
+ TAO_AV_UDP_Acceptor (void);
+ virtual ~TAO_AV_UDP_Acceptor (void);
+ virtual int open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp =
+ TAO_AV_Core::TAO_AV_DATA);
+
+ virtual int open_default (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_FlowSpec_Entry *entry,
+ TAO_AV_Flow_Protocol_Factory *factory,
+ TAO_AV_Core::Flow_Component flow_comp =
+ TAO_AV_Core::TAO_AV_DATA);
+
+ virtual int open_i (ACE_INET_Addr *address, int is_default_open);
+
+ virtual int close (void);
+ virtual int activate_svc_handler (TAO_AV_Flow_Handler *handler);
+
+
+protected:
+ ACE_INET_Addr *address_;
+ ACE_INET_Addr *control_inet_address_;
+ TAO_Base_StreamEndPoint *endpoint_;
+ TAO_FlowSpec_Entry *entry_;
+ TAO_AV_Flow_Protocol_Factory *flow_protocol_factory_;
+ TAO_AV_Core::Flow_Component flow_component_;
+
+
+};
+
+/**
+ * @class TAO_AV_UDP_Connector
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_UDP_Connector
+ :public TAO_AV_Connector
+{
+public:
+ TAO_AV_UDP_Connector (void);
+ ~TAO_AV_UDP_Connector (void);
+ virtual int open (TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Core *av_core,
+ TAO_AV_Flow_Protocol_Factory *factory);
+
+ virtual int connect (TAO_FlowSpec_Entry *entry,
+ TAO_AV_Transport *&transport,
+ TAO_AV_Core::Flow_Component flow_comp =
+ TAO_AV_Core::TAO_AV_DATA);
+ virtual int activate_svc_handler (TAO_AV_Flow_Handler *handler);
+ virtual int close (void);
+protected:
+ ACE_INET_Addr *control_inet_address_;
+ TAO_Base_StreamEndPoint *endpoint_;
+ TAO_AV_Core *av_core_;
+ TAO_FlowSpec_Entry *entry_;
+ TAO_AV_Flow_Protocol_Factory *flow_protocol_factory_;
+ TAO_AV_Core::Flow_Component flow_component_;
+
+};
+
+/**
+ * @class TAO_AV_UDP_Connection_Setup
+ * @brief This class is a helper for the TAO_AV_UDP_Acceptor and
+ * TAO_AV_UDP_Connector. It basically just reduces duplicate code. It takes
+ * the address of the peer in the connection, whether or not it is a multicast
+ * connection, and whether it is a connector or acceptor; and creates the local
+ * address and flow handler associated with the connection.
+ */
+class TAO_AV_Export TAO_AV_UDP_Connection_Setup
+{
+public:
+ /// Indicates whether this setup is for a Connector or an Acceptor
+ enum ConnectionType {CONNECTOR, ACCEPTOR};
+
+ static int setup (TAO_AV_Flow_Handler *&flow_handler,
+ ACE_INET_Addr *inet_addr,
+ ACE_INET_Addr *&local_addr,
+ int is_multicast,
+ ConnectionType ct);
+};
+
+/**
+ * @class TAO_AV_UDP_Object
+ * @brief TAO_AV_Protocol_Object for the User Datagram Protocol (UDP)
+ */
+class TAO_AV_Export TAO_AV_UDP_Object : public TAO_AV_Protocol_Object
+{
+public:
+ TAO_AV_UDP_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport = 0);
+
+ /// Dtor
+ virtual ~TAO_AV_UDP_Object (void);
+
+ 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 (const iovec *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_AV_UDP_Flow_Factory
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_UDP_Flow_Factory : public TAO_AV_Flow_Protocol_Factory
+{
+public:
+ /// Initialization hook.
+ TAO_AV_UDP_Flow_Factory (void);
+ virtual ~TAO_AV_UDP_Flow_Factory (void);
+ virtual int init (int argc, char *argv[]);
+ virtual int match_protocol (const char *flow_string);
+ TAO_AV_Protocol_Object* make_protocol_object (TAO_FlowSpec_Entry *entry,
+ TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Flow_Handler *handler,
+ TAO_AV_Transport *transport);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (TAO_AV_UDP_Flow_Factory)
+ACE_FACTORY_DECLARE (TAO_AV, TAO_AV_UDP_Flow_Factory)
+
+ACE_STATIC_SVC_DECLARE (TAO_AV_UDP_Factory)
+ACE_FACTORY_DECLARE (TAO_AV, TAO_AV_UDP_Factory)
+
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/AV/UDP.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_AV_UDP_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/UDP.i b/TAO/orbsvcs/orbsvcs/AV/UDP.i
new file mode 100644
index 00000000000..72025b94dd5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/UDP.i
@@ -0,0 +1,32 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//----------------------------------------------------------------------
+// TAO_AV_UDP_Flow_Handler
+//----------------------------------------------------------------------
+
+ACE_INLINE
+const ACE_SOCK_Dgram *
+TAO_AV_UDP_Flow_Handler::get_socket (void) const
+{
+ return &this->sock_dgram_;
+}
+
+ACE_INLINE
+int
+TAO_AV_UDP_Flow_Handler::open (ACE_Addr &address)
+{
+ return this->sock_dgram_.open (address);
+}
+
+ACE_INLINE
+int
+TAO_AV_UDP_Flow_Handler::close (void)
+{
+ return this->sock_dgram_.close ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/default_resource.cpp b/TAO/orbsvcs/orbsvcs/AV/default_resource.cpp
new file mode 100644
index 00000000000..708bfd80308
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/default_resource.cpp
@@ -0,0 +1,107 @@
+// $Id$
+
+#include "orbsvcs/AV/default_resource.h"
+
+#include "tao/ORB_Core.h"
+#include "tao/debug.h"
+#include "ace/OS_NS_strings.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_AV_Default_Resource_Factory::TAO_AV_Default_Resource_Factory (void)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_Default_Resource_Factory::TAO_AV_Default_Resource_Factory %d\n"));
+}
+
+TAO_AV_Default_Resource_Factory::~TAO_AV_Default_Resource_Factory (void)
+{
+ TAO_AV_TransportFactorySetItor t_end = TAO_AV_CORE::instance ()->transport_factories ()->end ();
+ for (TAO_AV_TransportFactorySetItor tfiterator =
+ TAO_AV_CORE::instance ()->transport_factories ()->begin ();
+ tfiterator != t_end;
+ ++tfiterator)
+ delete *tfiterator;
+
+ TAO_AV_CORE::instance ()->transport_factories ()->reset ();
+
+ TAO_AV_Flow_ProtocolFactorySetItor fp_end = TAO_AV_CORE::instance ()->flow_protocol_factories ()->end ();
+ for (TAO_AV_Flow_ProtocolFactorySetItor pfiterator =
+ TAO_AV_CORE::instance ()->flow_protocol_factories ()->begin ();
+ pfiterator != fp_end;
+ ++pfiterator)
+ delete *pfiterator;
+
+ TAO_AV_CORE::instance ()->flow_protocol_factories ()->reset ();
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_Default_Resource_Factory::~TAO_AV_Default_Resource_Factory\n"));
+}
+
+int
+TAO_AV_Default_Resource_Factory::init (int argc, char *argv[])
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_AV_Default_Resource_Factory::init\n"));
+
+ int curarg = 0;
+
+ for (curarg = 0; curarg < argc; ++curarg)
+ {
+ if (ACE_OS::strcasecmp (argv[curarg],
+ "-AVTransportFactory") == 0)
+ {
+ TAO_AV_TransportFactorySet *tset = TAO_AV_CORE::instance ()->transport_factories ();
+ curarg++;
+ if (curarg < argc)
+ {
+ TAO_AV_Transport_Item *item = 0;
+ ACE_NEW_RETURN (item,
+ TAO_AV_Transport_Item (argv[curarg]),
+ -1);
+ if (tset->insert (item) == -1)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Unable to add transport factories for %s: %p\n"),
+ argv[curarg]));
+ }
+ }
+ else if (ACE_OS::strcasecmp (argv[curarg],
+ "-AVFlowProtocolFactory") == 0)
+ {
+ TAO_AV_Flow_ProtocolFactorySet *fpset = TAO_AV_CORE::instance ()->flow_protocol_factories ();
+ curarg++;
+ if (curarg < argc)
+ {
+ TAO_AV_Flow_Protocol_Item *item = 0;
+ ACE_NEW_RETURN (item,
+ TAO_AV_Flow_Protocol_Item (argv[curarg]),
+ -1);
+ if (fpset->insert (item) == -1)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Unable to add flow protocol factories for %s: %p\n"),
+ argv[curarg]));
+ }
+ }
+
+ }
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+// ****************************************************************
+
+ACE_STATIC_SVC_DEFINE (TAO_AV_Default_Resource_Factory,
+ ACE_TEXT ("AV_Default_Resource_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_AV_Default_Resource_Factory),
+ ACE_Service_Type::DELETE_THIS
+ | ACE_Service_Type::DELETE_OBJ,
+ 0)
+ACE_FACTORY_DEFINE (TAO_AV, TAO_AV_Default_Resource_Factory)
+
+// ****************************************************************
diff --git a/TAO/orbsvcs/orbsvcs/AV/default_resource.h b/TAO/orbsvcs/orbsvcs/AV/default_resource.h
new file mode 100644
index 00000000000..0bf2a7b930f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/default_resource.h
@@ -0,0 +1,66 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file default_resource.h
+ *
+ * $Id$
+ *
+ * @author Yamuna Krishnamurthy
+ */
+//=============================================================================
+
+
+#ifndef TAO_AV_DEFAULT_RESOURCE_H
+#define TAO_AV_DEFAULT_RESOURCE_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Resource_Factory.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Service_Config.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_AV_Default_Resource_Factory
+ *
+ * @brief TAO AV Streams default resource factory
+ * The AV Streams resource factory loads the
+ * pluggable transport and flow protocol factories
+ * in the corresponding factory sets.
+ *
+ *
+ */
+
+class TAO_AV_Export TAO_AV_Default_Resource_Factory
+ : public TAO_AV_Resource_Factory
+{
+public:
+
+ /// Constructor.
+ TAO_AV_Default_Resource_Factory (void);
+
+ /// Destructor.
+ virtual ~TAO_AV_Default_Resource_Factory (void);
+
+ /**
+ * @name Service Configurator Hooks
+ */
+ //@{
+ /// Dynamic linking hook
+ virtual int init (int argc, char *argv[]);
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE_EXPORT (TAO_AV, TAO_AV_Default_Resource_Factory)
+ACE_FACTORY_DECLARE (TAO_AV, TAO_AV_Default_Resource_Factory)
+
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_DEFAULT_RESOURCE_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/global.h b/TAO/orbsvcs/orbsvcs/AV/global.h
new file mode 100644
index 00000000000..bcc4d2fa15a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/global.h
@@ -0,0 +1,33 @@
+/* $Id$ */
+/* GLOBAL.H - RSAREF types and constants
+ */
+
+/* PROTOTYPES should be set to one if and only if the compiler supports
+ function argument prototyping.
+The following makes PROTOTYPES default to 0 if it has not already
+ been defined with C compiler flags.
+ */
+#ifndef PROTOTYPES
+#define PROTOTYPES 0
+#endif
+
+/* POINTER defines a generic pointer type */
+typedef unsigned char *POINTER;
+
+#if !defined(INTEGRITY)
+/* UINT2 defines a two byte word */
+typedef unsigned short int UINT2;
+
+/* UINT4 defines a four byte word */
+typedef unsigned long int UINT4;
+#endif
+
+/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
+If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
+ returns an empty list.
+ */
+#if PROTOTYPES
+#define PROTO_LIST(list) list
+#else
+#define PROTO_LIST(list) ()
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/AV/md5.h b/TAO/orbsvcs/orbsvcs/AV/md5.h
new file mode 100644
index 00000000000..4bcb01b04b4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/md5.h
@@ -0,0 +1,49 @@
+/* $Id$ */
+
+/* MD5.H - header file for MD5C.C
+ */
+
+/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
+rights reserved.
+
+License to copy and use this software is granted provided that it
+is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+Algorithm" in all material mentioning or referencing this software
+or this function.
+
+License is also granted to make and use derivative works provided
+that such works are identified as "derived from the RSA Data
+Security, Inc. MD5 Message-Digest Algorithm" in all material
+mentioning or referencing the derived work.
+
+RSA Data Security, Inc. makes no representations concerning either
+the merchantability of this software or the suitability of this
+software for any particular purpose. It is provided "as is"
+without express or implied warranty of any kind.
+
+These notices must be retained in any copies of any part of this
+documentation and/or software.
+ */
+
+/* MD5 context. */
+typedef struct {
+ UINT4 state[4]; /* state (ABCD) */
+ UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
+ unsigned char buffer[64]; /* input buffer */
+} MD5_CTX;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* void MD5Init PROTO_LIST ((MD5_CTX *)); */
+void MD5Init (MD5_CTX *context);
+/* void MD5Update PROTO_LIST */
+/* ((MD5_CTX *, unsigned char *, unsigned int)); */
+void MD5Update (MD5_CTX *context, unsigned char *input, unsigned int inputLen);
+/* void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); */
+void MD5Final (unsigned char digest[16], MD5_CTX *context);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/AV/md5c.cpp b/TAO/orbsvcs/orbsvcs/AV/md5c.cpp
new file mode 100644
index 00000000000..aa4a99f8fb3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/md5c.cpp
@@ -0,0 +1,326 @@
+/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
+ */
+
+/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
+rights reserved.
+
+License to copy and use this software is granted provided that it
+is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+Algorithm" in all material mentioning or referencing this software
+or this function.
+
+License is also granted to make and use derivative works provided
+that such works are identified as "derived from the RSA Data
+Security, Inc. MD5 Message-Digest Algorithm" in all material
+mentioning or referencing the derived work.
+
+RSA Data Security, Inc. makes no representations concerning either
+the merchantability of this software or the suitability of this
+software for any particular purpose. It is provided "as is"
+without express or implied warranty of any kind.
+
+These notices must be retained in any copies of any part of this
+documentation and/or software.
+ */
+
+/* $Id$ */
+
+#include "orbsvcs/AV/global.h"
+#include "orbsvcs/AV/md5.h"
+
+/* Constants for MD5Transform routine.
+ */
+
+#define S11 7
+#define S12 12
+#define S13 17
+#define S14 22
+#define S21 5
+#define S22 9
+#define S23 14
+#define S24 20
+#define S31 4
+#define S32 11
+#define S33 16
+#define S34 23
+#define S41 6
+#define S42 10
+#define S43 15
+#define S44 21
+
+/*static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64]));
+static void Encode PROTO_LIST
+ ((unsigned char *, UINT4 *, unsigned int));
+static void Decode PROTO_LIST
+ ((UINT4 *, unsigned char *, unsigned int));
+static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int));
+static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int));*/
+static void MD5Transform (UINT4 [4], unsigned char [64]);
+static void Encode (unsigned char *, UINT4 *, unsigned int);
+static void Decode (UINT4 *, unsigned char *, unsigned int);
+static void MD5_memcpy (POINTER, POINTER, unsigned int);
+static void MD5_memset (POINTER, int, unsigned int);
+
+static unsigned char PADDING[64] = {
+ 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/* F, G, H and I are basic MD5 functions.
+ */
+#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
+#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
+#define H(x, y, z) ((x) ^ (y) ^ (z))
+#define I(x, y, z) ((y) ^ ((x) | (~z)))
+
+/* ROTATE_LEFT rotates x left n bits.
+ */
+#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
+
+/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
+Rotation is separate from addition to prevent recomputation.
+ */
+#define FF(a, b, c, d, x, s, ac) { \
+ (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+ }
+#define GG(a, b, c, d, x, s, ac) { \
+ (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+ }
+#define HH(a, b, c, d, x, s, ac) { \
+ (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+ }
+#define II(a, b, c, d, x, s, ac) { \
+ (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+ }
+
+/* MD5 initialization. Begins an MD5 operation, writing a new context.
+ */
+void MD5Init (MD5_CTX *context)
+{
+ context->count[0] = context->count[1] = 0;
+ /* Load magic initialization constants.
+*/
+ context->state[0] = 0x67452301;
+ context->state[1] = 0xefcdab89;
+ context->state[2] = 0x98badcfe;
+ context->state[3] = 0x10325476;
+}
+
+/* MD5 block update operation. Continues an MD5 message-digest
+ operation, processing another message block, and updating the
+ context.
+ */
+void MD5Update (MD5_CTX *context, unsigned char *input, unsigned int inputLen)
+{
+ unsigned int i, index, partLen;
+
+ /* Compute number of bytes mod 64 */
+ index = (unsigned int)((context->count[0] >> 3) & 0x3F);
+
+ /* Update number of bits */
+ if ((context->count[0] += ((UINT4)inputLen << 3))
+
+ < ((UINT4)inputLen << 3))
+ context->count[1]++;
+ context->count[1] += ((UINT4)inputLen >> 29);
+
+ partLen = 64 - index;
+
+ /* Transform as many times as possible.
+*/
+ if (inputLen >= partLen) {
+ MD5_memcpy
+ ((POINTER)&context->buffer[index], (POINTER)input, partLen);
+ MD5Transform (context->state, context->buffer);
+
+ for (i = partLen; i + 63 < inputLen; i += 64)
+ MD5Transform (context->state, &input[i]);
+
+ index = 0;
+ }
+ else
+ i = 0;
+
+ /* Buffer remaining input */
+ MD5_memcpy
+ ((POINTER)&context->buffer[index], (POINTER)&input[i],
+ inputLen-i);
+}
+
+/* MD5 finalization. Ends an MD5 message-digest operation, writing the
+ the message digest and zeroizing the context.
+ */
+void MD5Final (unsigned char digest[16], MD5_CTX *context)
+{
+ unsigned char bits[8];
+ unsigned int index, padLen;
+
+ /* Save number of bits */
+ Encode (bits, context->count, 8);
+
+ /* Pad out to 56 mod 64.
+*/
+ index = (unsigned int)((context->count[0] >> 3) & 0x3f);
+ padLen = (index < 56) ? (56 - index) : (120 - index);
+ MD5Update (context, PADDING, padLen);
+
+ /* Append length (before padding) */
+ MD5Update (context, bits, 8);
+
+ /* Store state in digest */
+ Encode (digest, context->state, 16);
+
+ /* Zeroize sensitive information.
+*/
+ MD5_memset ((POINTER)context, 0, sizeof (*context));
+}
+
+/* MD5 basic transformation. Transforms state based on block.
+ */
+static void MD5Transform (UINT4 state[4], unsigned char block[64])
+{
+ UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
+
+ Decode (x, block, 64);
+
+ /* Round 1 */
+ FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
+ FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
+ FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
+ FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
+ FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
+ FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
+ FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
+ FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
+ FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
+ FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
+ FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
+ FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
+ FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
+ FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
+ FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
+ FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
+
+ /* Round 2 */
+ GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
+ GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
+ GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
+ GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
+ GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
+ GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */
+ GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
+ GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
+ GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
+ GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
+ GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
+
+ GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
+ GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
+ GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
+ GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
+ GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
+
+ /* Round 3 */
+ HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
+ HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
+ HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
+ HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
+ HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
+ HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
+ HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
+ HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
+ HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
+ HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
+ HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
+ HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
+ HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
+ HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
+ HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
+ HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
+
+ /* Round 4 */
+ II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
+ II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
+ II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
+ II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
+ II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
+ II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
+ II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
+ II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
+ II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
+ II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
+ II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
+ II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
+ II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
+ II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
+ II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
+ II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
+
+ state[0] += a;
+ state[1] += b;
+ state[2] += c;
+ state[3] += d;
+
+ /* Zeroize sensitive information.
+
+*/
+ MD5_memset ((POINTER)x, 0, sizeof (x));
+}
+
+/* Encodes input (UINT4) into output (unsigned char). Assumes len is
+ a multiple of 4.
+ */
+static void Encode (unsigned char *output, UINT4 *input, unsigned int len)
+{
+ unsigned int i, j;
+
+ for (i = 0, j = 0; j < len; i++, j += 4) {
+ output[j] = (unsigned char)(input[i] & 0xff);
+ output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
+ output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
+ output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
+ }
+}
+
+/* Decodes input (unsigned char) into output (UINT4). Assumes len is
+ a multiple of 4.
+ */
+static void Decode (UINT4 *output, unsigned char *input, unsigned int len)
+{
+ unsigned int i, j;
+
+ for (i = 0, j = 0; j < len; i++, j += 4)
+ output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
+ (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
+}
+
+/* Note: Replace "for loop" with standard memcpy if possible.
+ */
+
+static void MD5_memcpy (POINTER output, POINTER input, unsigned int len)
+{
+ unsigned int i;
+
+ for (i = 0; i < len; i++)
+
+ output[i] = input[i];
+}
+
+/* Note: Replace "for loop" with standard memset if possible.
+ */
+static void MD5_memset (POINTER output, int value, unsigned int len)
+{
+ unsigned int i;
+
+ for (i = 0; i < len; i++)
+ ((char *)output)[i] = (char)value;
+}
diff --git a/TAO/orbsvcs/orbsvcs/AV/media_timer.cpp b/TAO/orbsvcs/orbsvcs/AV/media_timer.cpp
new file mode 100644
index 00000000000..1a5b9cd1e42
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/media_timer.cpp
@@ -0,0 +1,95 @@
+//$Id$
+/*
+ * Copyright (c) 1995 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the Computer Systems
+ * Engineering Group at Lawrence Berkeley Laboratory.
+ * 4. Neither the name of the University nor of the Laboratory may be used
+ * to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+static const char rcsid[] =
+ "@(#) $Header$";
+*/
+
+#include "orbsvcs/AV/media_timer.h"
+#include "ace/Time_Value.h"
+#include "ace/OS_NS_sys_time.h"
+#include "ace/OS_NS_stdlib.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+MediaTimer* MediaTimer::instance_;
+
+MediaTimer::MediaTimer()
+{
+ instance_ = this;
+ offset_ = ACE_OS::rand ();
+}
+
+MediaTimer::~MediaTimer()
+{
+ instance_ = 0;
+}
+
+/*
+ * Default media timestamp -- convert unix system clock
+ * into a 90Khz timestamp. Grabbers override this virtual
+ * method if they can provide their own time base.
+ *
+ * XXX
+ * We save the corresponding unix time stamp to handle the
+ * unix_ts() call the transmitter will make to get the correspondence
+ * between the media timestamp & unix time.
+ */
+ACE_UINT32 MediaTimer::media_ts()
+{
+ //timeval tv;
+ ACE_Time_Value tv = ACE_OS::gettimeofday();
+ ACE_UINT32 u = tv.usec ();
+ u = (u << 3) + u; /* x 9 */
+ /* sec * 90Khz + (usec * 90Khz) / 1e6 */
+ u = tv.sec () * 90000 + (u / 100);
+ return (u + offset_);
+}
+
+/*
+ * compute media time corresponding to the current unix time.
+ * in this generic routine, this is the same as media_ts() but,
+ * if a grabber has hardware or kernel timestamping, this routine
+ * must compute the correspondence between the hardware timestamp
+ * and the unix clock and appropriately offset the timestamp to
+ * correspond to the current clock. (This information if vital
+ * for cross-media synchronization.)
+ */
+ACE_UINT32 MediaTimer::ref_ts()
+{
+ return (media_ts());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/AV/media_timer.h b/TAO/orbsvcs/orbsvcs/AV/media_timer.h
new file mode 100644
index 00000000000..e7e060d5cb4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/media_timer.h
@@ -0,0 +1,69 @@
+// -*- C++ -*-
+
+// $Id$
+
+/*
+ * Copyright (c) 1995 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the Computer Systems
+ * Engineering Group at Lawrence Berkeley Laboratory.
+ * 4. Neither the name of the University nor of the Laboratory may be used
+ * to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#) $Header$
+ */
+
+#ifndef TAO_AV_MEDIA_TIMER_H
+#define TAO_AV_MEDIA_TIMER_H
+#include /**/ "ace/pre.h"
+
+#include "tao/orbconf.h"
+#include "tao/Versioned_Namespace.h"
+
+//long random (void);
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class MediaTimer
+{
+ public:
+ MediaTimer();
+ virtual ~MediaTimer();
+ static inline MediaTimer* instance() { return (instance_); }
+ virtual ACE_UINT32 media_ts();
+ virtual ACE_UINT32 ref_ts();
+ inline ACE_UINT32 offset() const { return (offset_); }
+ private:
+ static MediaTimer* instance_;
+ protected:
+ ACE_UINT32 offset_; /* random offset */
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_MEDIA_TIMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/ntp-time.h b/TAO/orbsvcs/orbsvcs/AV/ntp-time.h
new file mode 100644
index 00000000000..11dcd720911
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/ntp-time.h
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+
+// $Id$
+/*
+ * Copyright (c) 1995 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the Network Research
+ * Group at Lawrence Berkeley National Laboratory.
+ * 4. Neither the name of the University nor of the Laboratory may be used
+ * to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef TAO_AV_NTP_TIME_H
+#define TAO_AV_NTP_TIME_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/RTCP.h"
+
+/*
+ * convert microseconds to fraction of second * 2^32 (i.e., the lsw of
+ * a 64-bit ntp timestamp). This routine uses the factorization
+ * 2^32/10^6 = 4096 + 256 - 1825/32 which results in a max conversion
+ * error of 3 * 10^-7 and an average error of half that.
+ */
+ACE_INLINE u_int usec2ntp(u_int usec)
+{
+ u_int const t = (usec * 1825) >> 5;
+ return ((usec << 12) + (usec << 8) - t);
+}
+
+/*
+ * Number of seconds between 1-Jan-1900 and 1-Jan-1970
+ */
+const ACE_UINT32 GETTIMEOFDAY_TO_NTP_OFFSET = 2208988800U;
+
+/*
+ * Return a 64-bit ntp timestamp (UTC time relative to Jan 1, 1970).
+ * gettimeofday conveniently gives us the correct reference -- we just
+ * need to convert sec+usec to a 64-bit fixed point (with binary point
+ * at bit 32).
+ */
+ACE_INLINE TAO_AV_RTCP::ntp64
+ntp64time (timeval tv)
+{
+ TAO_AV_RTCP::ntp64 n;
+ n.upper = (u_int)tv.tv_sec + GETTIMEOFDAY_TO_NTP_OFFSET;
+ n.lower = usec2ntp((u_int)tv.tv_usec);
+ return (n);
+}
+
+ACE_INLINE ACE_UINT32
+ntptime (timeval t)
+{
+ u_int s = (u_int)t.tv_sec + GETTIMEOFDAY_TO_NTP_OFFSET;
+ return (s << 16 | usec2ntp((u_int)t.tv_usec) >> 16);
+}
+
+ACE_INLINE ACE_UINT32
+ntptime()
+{
+ //
+ ACE_Time_Value tim_v = ACE_OS::gettimeofday();
+ //struct timeval tv = (timeval) tim_v;
+ return (ntptime ((timeval) tim_v));
+}
+
+ACE_INLINE timeval unixtime()
+{
+ ACE_Time_Value tv = ACE_OS::gettimeofday();
+ return ((timeval) tv);
+}
+#include /**/ "ace/post.h"
+#endif /* TAO_AV_NTP_TIME_H */
diff --git a/TAO/orbsvcs/orbsvcs/AV/sfp.cpp b/TAO/orbsvcs/orbsvcs/AV/sfp.cpp
new file mode 100644
index 00000000000..2f3d578b3a4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/sfp.cpp
@@ -0,0 +1,1336 @@
+// $Id$
+
+#include "orbsvcs/AV/sfp.h"
+#include "tao/debug.h"
+#include "ace/ARGV.h"
+#include "ace/OS_NS_strings.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// default arguments to pass to use for the ORB
+const char TAO_SFP_Base::TAO_SFP_ORB_ARGUMENTS[] = "-ORBObjRefStyle URL";
+
+// SFP magic numbers
+const char TAO_SFP_Base::TAO_SFP_MAGIC_NUMBER[] = "=SFP";
+const char TAO_SFP_Base::TAO_SFP_FRAGMENT_MAGIC_NUMBER[] = "FRAG";
+const char TAO_SFP_Base::TAO_SFP_START_MAGIC_NUMBER[] = "=STA";
+const char TAO_SFP_Base::TAO_SFP_CREDIT_MAGIC_NUMBER[] = "=CRE";
+const char TAO_SFP_Base::TAO_SFP_STARTREPLY_MAGIC_NUMBER[] = "=STR";
+
+// SFP version 1.0
+const unsigned char TAO_SFP_Base::TAO_SFP_MAJOR_VERSION = 1;
+const unsigned char TAO_SFP_Base::TAO_SFP_MINOR_VERSION = 0;
+
+// lengths of various SFP headers
+const unsigned char TAO_SFP_Base::TAO_SFP_FRAME_HEADER_LEN = 12;
+const unsigned char TAO_SFP_Base::TAO_SFP_MESSAGE_SIZE_OFFSET = 8;
+const unsigned char TAO_SFP_Base::TAO_SFP_FRAGMENT_SIZE_OFFSET = 16;
+
+u_int TAO_SFP_Base::frame_header_len;
+u_int TAO_SFP_Base::start_reply_len;
+u_int TAO_SFP_Base::start_len;
+u_int TAO_SFP_Base::credit_len;
+u_int TAO_SFP_Base::fragment_len;
+
+bool
+operator< (const TAO_SFP_Fragment_Node& left,
+ const TAO_SFP_Fragment_Node& right)
+{
+ return left.fragment_info_.frag_number < right.fragment_info_.frag_number;
+}
+
+
+//------------------------------------------------------------
+// TAO_SFP_Base
+//------------------------------------------------------------
+
+TAO_SFP_Base::TAO_SFP_Base (void)
+{
+ TAO_OutputCDR output_cdr;
+ flowProtocol::frameHeader frame_header;
+ flowProtocol::fragment fragment;
+ flowProtocol::credit credit;
+ flowProtocol::Start start;
+ flowProtocol::StartReply start_reply;
+
+ // fill in the default frameHeader fields.
+ frame_header.magic_number [0] = '=';
+ frame_header.magic_number [1] = 'S';
+ frame_header.magic_number [2] = 'F';
+ frame_header.magic_number [3] = 'P';
+ frame_header.flags = TAO_ENCAP_BYTE_ORDER;
+ output_cdr.reset ();
+ if (!(output_cdr << frame_header))
+ {
+ ACE_ERROR ((LM_ERROR, "TAO_SFP constructor\n"));
+ return;
+ }
+
+ frame_header_len = static_cast<u_int> (output_cdr.total_length ());
+ // fill in the default fragment message fields.
+ fragment.magic_number [0] = 'F';
+ fragment.magic_number [1] = 'R';
+ fragment.magic_number [2] = 'A';
+ fragment.magic_number [3] = 'G';
+ output_cdr.reset ();
+ if (!(output_cdr << fragment))
+ {
+ ACE_ERROR ((LM_ERROR, "TAO_SFP constructor\n"));
+ return;
+ }
+
+ fragment_len = static_cast<u_int> (output_cdr.total_length ());
+ // fill in the default Start message fields.
+ start.magic_number [0] = '=';
+ start.magic_number [1] = 'S';
+ start.magic_number [2] = 'T';
+ start.magic_number [3] = 'A';
+ start.major_version = TAO_SFP_Base::TAO_SFP_MAJOR_VERSION;
+ start.minor_version = TAO_SFP_Base::TAO_SFP_MINOR_VERSION;
+ start.flags = 0;
+ output_cdr.reset ();
+ if (!(output_cdr << start))
+ {
+ ACE_ERROR ((LM_ERROR, "TAO_SFP constructor\n"));
+ return;
+ }
+
+ start_len = static_cast<u_int> (output_cdr.total_length ());
+ // fill in the default StartReply message fields.
+ start_reply.magic_number [0] = '=';
+ start_reply.magic_number [1] = 'S';
+ start_reply.magic_number [2] = 'T';
+ start_reply.magic_number [3] = 'R';
+ start_reply.flags = 0;
+ output_cdr.reset ();
+ if (!(output_cdr << start_reply))
+ {
+ ACE_ERROR ((LM_ERROR, "TAO_SFP constructor\n"));
+ return;
+ }
+
+ start_reply_len = static_cast<u_int> (output_cdr.total_length ());
+
+ // fill in the default Credit message fields.
+ credit.magic_number [0] = '=';
+ credit.magic_number [1] = 'C';
+ credit.magic_number [2] = 'R';
+ credit.magic_number [3] = 'E';
+ output_cdr.reset ();
+
+ if (!(output_cdr << credit))
+ {
+ ACE_ERROR ((LM_ERROR, "TAO_SFP constructor\n"));
+ return;
+ }
+ credit_len = static_cast<u_int> (output_cdr.total_length ());
+}
+
+int
+TAO_SFP_Base::handle_input (TAO_AV_Transport *transport,
+ TAO_SFP_Frame_State &state,
+ TAO_AV_frame_info *&frame_info)
+{
+ int result;
+ flowProtocol::MsgType msg_type;
+ result = TAO_SFP_Base::peek_message_type (transport,
+ msg_type);
+ if (result < 0)
+ return result;
+ // TAO_InputCDR &input = state.cdr;
+ switch (msg_type)
+ {
+ case flowProtocol::SimpleFrame_Msg:
+ case flowProtocol::Frame_Msg:
+ {
+ result = TAO_SFP_Base::peek_frame_header (transport,
+ state.frame_header_,
+ state.cdr);
+ if (result < 0)
+ return result;
+ int result =TAO_SFP_Base::read_frame (transport,
+ state.frame_header_,
+ state,
+ frame_info);
+ if (result < 0)
+ return result;
+ break;
+ }
+ case flowProtocol::Fragment_Msg:
+ {
+ result = TAO_SFP_Base::peek_fragment_header (transport,
+ state.fragment_,
+ state.cdr);
+ if (result < 0)
+ return result;
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"Fragment received\n"));
+ result = TAO_SFP_Base::read_fragment (transport,
+ state.fragment_,
+ state,
+ frame_info);
+ if (result < 0)
+ return result;
+ break;
+ }
+ case flowProtocol::EndofStream_Msg:
+ {
+ result = TAO_SFP_Base::read_endofstream_message (transport,
+ state.frame_header_,
+ state.cdr);
+ if (result < 0)
+ return result;
+ break;
+ }
+ default:
+ break;
+ }
+ return 0;
+}
+
+int
+TAO_SFP_Base::read_frame (TAO_AV_Transport *transport,
+ flowProtocol::frameHeader &frame_header,
+ TAO_SFP_Frame_State &state,
+ TAO_AV_frame_info *&frame_info)
+{
+ ACE_Message_Block *message_block = 0;
+ int result = -1;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"Reading simple frame\n"));
+ // Check to see what the length of the message is.
+ int byte_order = frame_header.flags & 0x1;
+ int message_len = frame_header.message_size;
+
+// ACE_NEW_RETURN (message_block,
+// ACE_Message_Block (message_len),
+// 0);
+ state.static_frame_.rd_ptr (state.static_frame_.base ());
+ state.static_frame_.wr_ptr (state.static_frame_.base ());
+ int n = transport->recv (state.static_frame_.rd_ptr (),message_len);
+ if (n == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,"SFP::handle_input -peek"),0);
+ else if (n==0)
+ ACE_ERROR_RETURN ((LM_ERROR,"SFP::handle_input -peek"),0);
+ else if (n != message_len)
+ ACE_ERROR_RETURN ((LM_ERROR,"SFP::read_simple_frame:message truncated\n"),0);
+ message_block = &state.static_frame_;
+ // print the buffer.
+ // this->dump_buf (message,n);
+ // skip over the frame header.
+ message_block->rd_ptr (frame_header_len);
+ message_block->wr_ptr (n);
+ CORBA::ULong ssrc = 0;
+ TAO_SFP_Fragment_Table_Entry *fragment_entry = 0;
+ if (frame_header.flags & 0x2)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"fragmented frame:0th fragment\n"));
+ state.more_fragments_ = 1;
+ ACE_Message_Block *data = 0;
+ switch (frame_header.message_type)
+ {
+ case flowProtocol::Frame_Msg:
+ {
+ // read the frame info.
+ ACE_Message_Block frame_info_mb (message_len-frame_header_len+ACE_CDR::MAX_ALIGNMENT);
+ ACE_CDR::mb_align (&frame_info_mb);
+ frame_info_mb.copy (message_block->rd_ptr (),
+ message_block->length ());
+ // print the buffer.
+ // this->dump_buf (message_block->rd_ptr (),16);
+ TAO_InputCDR frame_info_cdr (&frame_info_mb,byte_order);
+ frame_info_cdr >> state.frame_;
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "frame.timestamp = %d, "
+ "frame.synchsource = %d, "
+ "frame.sequence_num = %d\n",
+ state.frame_.timestamp,
+ state.frame_.synchSource,
+ state.frame_.sequence_num));
+ ssrc = state.frame_.synchSource;
+ // The remaining message in the CDR stream is the fragment
+ // data for frag.0
+ data = frame_info_cdr.start ()->clone ();
+ break;
+ }
+ case flowProtocol::SimpleFrame_Msg:
+ {
+ data = message_block->clone ();
+ break;
+ }
+ case flowProtocol::SequencedFrame_Msg:
+ break;
+ case flowProtocol::SpecialFrame_Msg:
+ break;
+ }
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"Length of 0th fragment= %d\n",data->length ()));
+ TAO_SFP_Fragment_Table *fragment_table = 0;
+ result = state.fragment_table_map_.find (ssrc,fragment_table);
+ if (result != 0)
+ {
+ ACE_NEW_RETURN (fragment_table,
+ TAO_SFP_Fragment_Table,
+ -1);
+ result = state.fragment_table_map_.bind (ssrc,fragment_table);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_SFP_Base::read_frame: "
+ "fragment_table_map:bind failed\n"),-1);
+ }
+
+ TAO_SFP_Fragment_Node *new_node;
+ ACE_NEW_RETURN (new_node,
+ TAO_SFP_Fragment_Node,
+ 0);
+ new_node->fragment_info_.frag_sz = static_cast<CORBA::ULong> (data->length ());
+ new_node->fragment_info_.frag_number = 0;
+ if (state.frame_.source_ids.length () > 0)
+ new_node->fragment_info_.source_id = state.frame_.source_ids [0];
+ else
+ new_node->fragment_info_.source_id = 0;
+ new_node->data_ = data;
+ // TAO_SFP_Base::dump_buf (data->rd_ptr (),data->length ());
+ if (fragment_table->find (state.frame_.sequence_num,fragment_entry) == 0)
+ {
+ // This case can happen where a nth (n > 0)fragment is
+ // received before the 0th fragment.
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "fragment table entry found for 0th fragment:\n"));
+ result = fragment_entry->fragment_set_.insert (*new_node);
+ if (result != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "insert for 0th fragment failed\n"),0);
+ // enter the frame info.
+
+ // check if all the fragments have been received.
+ state.frame_block_ =
+ TAO_SFP_Base::check_all_fragments (fragment_entry);
+ if (state.frame_block_ != 0)
+ state.more_fragments_ = 0;
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "fragment table entry not found for 0th fragment\n"));
+ TAO_SFP_Fragment_Table_Entry *new_entry;
+ ACE_NEW_RETURN (new_entry,
+ TAO_SFP_Fragment_Table_Entry,
+ 0);
+ result = new_entry->fragment_set_.insert (*new_node);
+ if (result != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"insert for 0th fragment failed\n"),0);
+ fragment_entry = new_entry;
+ // not found. so bind a new entry.
+ result = fragment_table->bind (state.frame_.sequence_num,new_entry);
+ if (result != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"fragment table bind failed\n"),0);
+ if (frame_header.message_type & 4 )
+ fragment_entry->frame_info.boundary_marker = 1;
+ switch (frame_header.message_type)
+ {
+ case flowProtocol::Frame_Msg:
+ fragment_entry->frame_info.ssrc = state.frame_.synchSource;
+ fragment_entry->frame_info.timestamp = state.frame_.timestamp;
+ fragment_entry->frame_info.sequence_num = state.frame_.sequence_num;
+ break;
+ case flowProtocol::SimpleFrame_Msg:
+ fragment_entry->frame_info.ssrc =
+ fragment_entry->frame_info.timestamp =
+ fragment_entry->frame_info.sequence_num = 0;
+ break;
+ }
+ return 0;
+ }
+ }
+ else
+ {
+ state.more_fragments_ = 0;
+ state.frame_block_ = message_block;
+ }
+ if (state.more_fragments_ == 0)
+ {
+ if (fragment_entry != 0)
+ {
+ ACE_NEW_RETURN (frame_info,
+ TAO_AV_frame_info,
+ -1);
+ *frame_info = fragment_entry->frame_info;
+ }
+ }
+ return 0;
+}
+
+int
+TAO_SFP_Base::read_fragment (TAO_AV_Transport *transport,
+ flowProtocol::fragment &fragment,
+ TAO_SFP_Frame_State &state,
+ TAO_AV_frame_info *&frame_info)
+{
+ TAO_SFP_Fragment_Table_Entry *fragment_entry = 0;
+ int result = -1;
+
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"frag_number = %d, frag_size = %d,source_id = %d sequnce_num = %d\n",
+ fragment.frag_number,fragment.frag_sz,fragment.source_id,fragment.sequence_num));
+
+ ACE_Message_Block *data;
+ ACE_NEW_RETURN (data,
+ ACE_Message_Block(fragment.frag_sz),
+ -1);
+
+ // Read the fragment.
+ int n = transport->recv (data->wr_ptr (),fragment.frag_sz);
+ if ((n == -1) || (n==0))
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_SFP::read_fragment:%p",""),-1);
+ // move past the fragment header.
+ data->rd_ptr (fragment_len);
+ data->wr_ptr (n);
+ // TAO_SFP_Base::dump_buf (data->rd_ptr (),data->length ());
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"length of %dth fragment is: %d\n",
+ fragment.frag_number,
+ data->length ()));
+
+ TAO_SFP_Fragment_Node *new_node;
+ ACE_NEW_RETURN (new_node,
+ TAO_SFP_Fragment_Node,
+ -1);
+ new_node->fragment_info_ = fragment;
+ new_node->data_ = data;
+ TAO_SFP_Fragment_Table *fragment_table = 0;
+ result = state.fragment_table_map_.find (fragment.source_id,fragment_table);
+ if (result != 0)
+ {
+ ACE_NEW_RETURN (fragment_table,
+ TAO_SFP_Fragment_Table,
+ -1);
+ result = state.fragment_table_map_.bind (fragment.source_id,fragment_table);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_SFP_Base::read_fragment:fragment_table_map:bind failed\n"),-1);
+ }
+ if (fragment_table->find (fragment.sequence_num,fragment_entry) == 0)
+ {
+ // Already an entry exists. Traverse the list and insert it at the right place.
+ result = fragment_entry->fragment_set_.insert (*new_node);
+ if (result != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"insert for %dth node failed\n",fragment.frag_number),-1);
+ // check if all the fragments have been received.
+ }
+ else
+ {
+ ACE_NEW_RETURN (fragment_entry,
+ TAO_SFP_Fragment_Table_Entry,
+ -1);
+ fragment_entry->fragment_set_.insert (*new_node);
+ // bind a new entry for this sequence number.
+ result = fragment_table->bind (fragment.sequence_num,fragment_entry);
+ if (result != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"bind for %dth fragment failed\n",
+ fragment.frag_number),-1);
+ }
+ if (!(fragment.flags & 0x2))
+ {
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"Last fragment received\n"));
+ // if bit 1 is not set then there are
+ // no more fragments.
+ fragment_entry->last_received_ = 1;
+ // since fragment number starts from 0 to n-1 we add 1.
+ fragment_entry->num_fragments_ = fragment.frag_number + 1;
+ }
+
+
+ state.frame_block_ = check_all_fragments (fragment_entry);
+ if (state.frame_block_ != 0)
+ {
+ state.more_fragments_ = 0;
+ ACE_NEW_RETURN (frame_info,
+ TAO_AV_frame_info,
+ -1);
+ *frame_info = fragment_entry->frame_info;
+ }
+ return 0;
+}
+
+ACE_Message_Block*
+TAO_SFP_Base::check_all_fragments (TAO_SFP_Fragment_Table_Entry *fragment_entry)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"table size: %d, num_fragments: %d\n",fragment_entry->fragment_set_.size (),fragment_entry->num_fragments_));
+ // check to see if all the frames have been received.
+ if (fragment_entry->fragment_set_.size () == fragment_entry->num_fragments_)
+ {
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"all fragments have been received\n"));
+ // all the fragments have been received
+ // we can now chain the ACE_Message_Blocks in the fragment_set_ and then return them
+ // back.
+ ACE_Message_Block *frame = 0,*head = 0;
+ FRAGMENT_SET_ITERATOR frag_iterator (fragment_entry->fragment_set_);
+ TAO_SFP_Fragment_Node *node;
+ for (;frag_iterator.next (node) != 0;frag_iterator.advance ())
+ {
+ if (!head)
+ head = frame = node->data_;
+ else
+ {
+ frame->cont (node->data_);
+ frame = node->data_;
+ }
+ }
+ return head;
+ }
+ return 0;
+}
+
+CORBA::Boolean
+TAO_SFP_Base::start_frame (CORBA::Octet flags,
+ flowProtocol::MsgType type,
+ TAO_OutputCDR &msg)
+{
+ msg.reset ();
+ flowProtocol::frameHeader frame_header;
+
+ frame_header.magic_number [0] = '=';
+ frame_header.magic_number [1] = 'S';
+ frame_header.magic_number [2] = 'F';
+ frame_header.magic_number [3] = 'P';
+ frame_header.flags = flags;
+ frame_header.message_type = static_cast<CORBA::Octet> (type);
+ frame_header.message_size = 0;
+ if (!(msg << frame_header))
+ return 0;
+ return 1;
+}
+
+CORBA::Boolean
+TAO_SFP_Base::write_start_message (TAO_OutputCDR &msg)
+{
+ flowProtocol::Start start;
+
+ start.magic_number [0] = '=';
+ start.magic_number [1] = 'S';
+ start.magic_number [2] = 'T';
+ start.magic_number [3] = 'A';
+ start.major_version = TAO_SFP_MAJOR_VERSION;
+ start.minor_version = TAO_SFP_MINOR_VERSION;
+ start.flags = 0;
+ if (!(msg << start))
+ return 0;
+ return 1;
+}
+
+CORBA::Boolean
+TAO_SFP_Base::write_start_reply_message (TAO_OutputCDR &msg)
+{
+ flowProtocol::StartReply start_reply;
+
+ start_reply.magic_number [0] = '=';
+ start_reply.magic_number [1] = 'S';
+ start_reply.magic_number [2] = 'T';
+ start_reply.magic_number [3] = 'R';
+ start_reply.flags = 0;
+ if (!(msg << start_reply))
+ return 0;
+ return 1;
+}
+
+CORBA::Boolean
+TAO_SFP_Base::write_credit_message (CORBA::ULong cred_num,
+ TAO_OutputCDR &msg)
+{
+ flowProtocol::credit credit;
+
+ credit.magic_number [0] = '=';
+ credit.magic_number [1] = 'C';
+ credit.magic_number [2] = 'R';
+ credit.magic_number [3] = 'E';
+ credit.cred_num = cred_num;
+ if (!(msg << credit))
+ return 0;
+ return 1;
+}
+
+CORBA::Boolean
+TAO_SFP_Base::write_fragment_message (CORBA::Octet flags,
+ CORBA::ULong fragment_number,
+ CORBA::ULong sequence_number,
+ CORBA::ULong source_id,
+ TAO_OutputCDR &msg)
+{
+ msg.reset ();
+ flowProtocol::fragment fragment;
+
+ fragment.magic_number [0] = 'F';
+ fragment.magic_number [1] = 'R';
+ fragment.magic_number [2] = 'A';
+ fragment.magic_number [3] = 'G';
+ fragment.flags = flags;
+ fragment.frag_number = fragment_number;
+ fragment.sequence_num = sequence_number;
+ fragment.source_id = source_id;
+ if (!(msg << fragment))
+ return 0;
+ return 1;
+}
+
+CORBA::Boolean
+TAO_SFP_Base::write_frame_message (CORBA::ULong timestamp,
+ CORBA::ULong synchSource,
+ flowProtocol::my_seq_ulong source_ids,
+ CORBA::ULong sequence_num,
+ TAO_OutputCDR &msg)
+{
+ flowProtocol::frame frame;
+
+ frame.timestamp = timestamp;
+ frame.synchSource = synchSource;
+ frame.source_ids = source_ids;
+ frame.sequence_num = sequence_num;
+ if (!(msg << frame))
+ return 0;
+ return 1;
+}
+
+int
+TAO_SFP_Base::send_message (TAO_AV_Transport *transport,
+ TAO_OutputCDR &stream,
+ ACE_Message_Block *mb)
+{
+ CORBA::ULong total_len = static_cast<CORBA::ULong> (stream.total_length ());
+ if (mb != 0)
+ {
+ for (ACE_Message_Block *temp = mb;temp != 0;temp = temp->cont ())
+ total_len += static_cast<CORBA::ULong> (temp->length ());
+
+ char *buf = (char *) stream.buffer ();
+ size_t offset = TAO_SFP_MESSAGE_SIZE_OFFSET;
+ // second character distinguished =SFP and FRAG.
+ if (*(buf) == 'F')
+ {
+ // Fragment message.
+ offset = TAO_SFP_FRAGMENT_SIZE_OFFSET;
+ }
+#if !defined (ACE_ENABLE_SWAP_ON_WRITE)
+ *reinterpret_cast<CORBA::ULong *> (buf + offset) = total_len;
+#else
+ if (!stream.do_byte_swap ())
+ *reinterpret_cast<CORBA::ULong *> (buf + offset) = total_len;
+ else
+ ACE_CDR::swap_4 (reinterpret_cast<char *> (&total_len),
+ buf + offset);
+#endif /* ACE_ENABLE_SWAP_ON_WRITE */
+ }
+ // we join the data block with the cdr block.
+ ACE_Message_Block *end = (ACE_Message_Block *)stream.end ();
+ if (end == 0)
+ {
+ // There is only one message block.
+ end = (ACE_Message_Block *)stream.begin ();
+ // TAO_SFP_Base::dump_buf (end->rd_ptr (),end->length ());
+ }
+ end->cont (mb);
+ ssize_t n = transport->send (stream.begin ());
+ if (n == -1)
+ {
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
+ "TAO: (%P|%t) closing conn after fault %p\n",
+ "GIOP::send_request ()"));
+ return -1;
+ }
+ // EOF.
+ if (n == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO: (%P|%t) GIOP::send_request () "
+ "EOF, closing conn:\n"));
+ return -1;
+ }
+ return 1;
+
+}
+
+int
+TAO_SFP_Base::peek_message_type (TAO_AV_Transport *transport,
+ flowProtocol::MsgType &msg_type)
+{
+ char peek_buffer [TAO_SFP_MAGIC_NUMBER_LEN+2];// 2 is for flags + message_type.
+ int peek_len = TAO_SFP_MAGIC_NUMBER_LEN +2;
+ char magic_number [TAO_SFP_MAGIC_NUMBER_LEN+1];
+ ssize_t n =transport->recv (peek_buffer,
+ peek_len,
+ MSG_PEEK);
+ ACE_OS::strncpy (magic_number,
+ peek_buffer,
+ TAO_SFP_MAGIC_NUMBER_LEN);
+ magic_number [TAO_SFP_MAGIC_NUMBER_LEN] = 0;
+ if (n == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,"SFP::handle_input -peek"),-1);
+ else if (n==0)
+ ACE_ERROR_RETURN ((LM_ERROR,"SFP::handle_input -peek"),-1);
+
+ if (ACE_OS::strcmp (magic_number,TAO_SFP_START_MAGIC_NUMBER) == 0)
+ {
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)Start message received\n"));
+ msg_type = flowProtocol::Start_Msg;
+ }
+ else if (ACE_OS::strcmp (magic_number,TAO_SFP_STARTREPLY_MAGIC_NUMBER) == 0)
+ {
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)StartReply message received\n"));
+ msg_type = flowProtocol::StartReply_Msg;
+ }
+ else if (ACE_OS::strcmp (magic_number,TAO_SFP_MAGIC_NUMBER) == 0)
+ {
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t) frameHeader received\n"));
+ // msg_type = flowProtocol::SimpleFrame;
+ msg_type = (flowProtocol::MsgType)peek_buffer [TAO_SFP_MESSAGE_TYPE_OFFSET];
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"Message Type = %d\n",msg_type));
+ }
+ else if (ACE_OS::strcmp (magic_number,TAO_SFP_FRAGMENT_MAGIC_NUMBER) == 0)
+ {
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t) fragment Header received\n"));
+ msg_type = flowProtocol::Fragment_Msg;
+ }
+ else if (ACE_OS::strcmp (magic_number,TAO_SFP_CREDIT_MAGIC_NUMBER) == 0)
+ {
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t) credit message received\n"));
+ msg_type = flowProtocol::Credit_Msg;
+ }
+ else
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_SFP:Invalid magic number\n"),-1);
+ return 0;
+}
+
+int
+TAO_SFP_Base::read_start_message (TAO_AV_Transport *transport,
+ flowProtocol::Start &start,
+ TAO_InputCDR &input)
+{
+ input.grow (start_len);
+ char *buf = input.rd_ptr ();
+ int n = transport->recv (buf,
+ start_len);
+ if (n != static_cast<int> (start_len))
+ ACE_ERROR_RETURN ((LM_ERROR,"%p","TAO_SFP_Base::read_start\n"),0);
+ else
+ {
+ if (!(input >> start))
+ return -1;
+ }
+ return 0;
+}
+
+
+int
+TAO_SFP_Base::read_start_reply_message (TAO_AV_Transport *transport,
+ flowProtocol::StartReply &start_reply,
+ TAO_InputCDR &input)
+{
+ input.grow (start_len);
+ char *buf = input.rd_ptr ();
+ int n = transport->recv (buf,
+ start_reply_len);
+ if (n != static_cast<int> (start_len))
+ ACE_ERROR_RETURN ((LM_ERROR,"%p","TAO_SFP_Base::read_start_reply_message"),0);
+ else
+ {
+ if (!(input >> start_reply))
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_SFP_Base::read_credit_message (TAO_AV_Transport *transport,
+ flowProtocol::credit &credit,
+ TAO_InputCDR &input)
+{
+ input.grow (start_len);
+ char *buf = input.rd_ptr ();
+ int n = transport->recv (buf,
+ credit_len);
+ if (n != static_cast<int> (credit_len))
+ ACE_ERROR_RETURN ((LM_ERROR,"%p","TAO_SFP_Base::read_credit_message"),0);
+ else
+ {
+ if (!(input >> credit))
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_SFP_Base::read_endofstream_message (TAO_AV_Transport *transport,
+ flowProtocol::frameHeader &endofstream,
+ TAO_InputCDR &input)
+{
+ input.grow (start_len);
+ char *buf = input.rd_ptr ();
+ int n = transport->recv (buf,
+ frame_header_len);
+ if (n != static_cast<int> (frame_header_len))
+ ACE_ERROR_RETURN ((LM_ERROR,"%p","TAO_SFP_Base::read_endofstream_message"),0);
+ else
+ {
+ if (!(input >> endofstream))
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_SFP_Base::peek_frame_header (TAO_AV_Transport *transport,
+ flowProtocol::frameHeader &header,
+ TAO_InputCDR &input)
+{
+ input.grow (frame_header_len);
+ char *buf = input.rd_ptr ();
+ int n = transport->recv (buf,
+ frame_header_len,
+ MSG_PEEK);
+ if (n != static_cast<int> (frame_header_len))
+ ACE_ERROR_RETURN ((LM_ERROR,"%p","TAO_SFP_Base::read_endofstream_message"),0);
+ else
+ {
+ if (!(input >> header))
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_SFP_Base::peek_fragment_header (TAO_AV_Transport *transport,
+ flowProtocol::fragment &fragment,
+ TAO_InputCDR &input)
+{
+ input.grow (fragment_len);
+ char *buf = input.rd_ptr ();
+ int n = transport->recv (buf,
+ fragment_len,
+ MSG_PEEK);
+ if (n != static_cast<int> (fragment_len))
+ ACE_ERROR_RETURN ((LM_ERROR,"%p","TAO_SFP_Base::read_endofstream_message"),0);
+ else
+ {
+ if (!(input >> fragment))
+ return -1;
+ }
+ return 0;
+}
+
+void
+TAO_SFP_Base::dump_buf (char *buffer,int size)
+{
+ char *buf = buffer;
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"\n========================================\n"));
+ for (int i=0;i<size;i++)
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"%d ",buf[i]));
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"\n========================================\n"));
+}
+
+//------------------------------------------------------------
+// TAO_SFP_Object
+//------------------------------------------------------------
+
+TAO_SFP_Object::TAO_SFP_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport)
+ :TAO_AV_Protocol_Object (callback,transport),
+ source_id_ (10),
+ max_credit_ (-1),
+ current_credit_ (-1)
+{
+ TAO_SFP_BASE::instance ();
+ this->state_.static_frame_.size (2* this->transport_->mtu ());
+}
+
+TAO_SFP_Object::~TAO_SFP_Object (void)
+{
+ //no-op
+}
+
+int
+TAO_SFP_Object::destroy (void)
+{
+ int result = -1;
+ TAO_OutputCDR out_stream;
+ result = TAO_SFP_Base::start_frame (TAO_ENCAP_BYTE_ORDER,
+ flowProtocol::EndofStream_Msg,
+ out_stream);
+ if (result < 0)
+ return result;
+ result = TAO_SFP_Base::send_message (this->transport_,
+ out_stream);
+ if (result < 0)
+ return result;
+ this->callback_->handle_destroy ();
+ return 0;
+}
+
+int
+TAO_SFP_Object::send_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info)
+{
+ TAO_OutputCDR out_stream;
+ CORBA::Boolean result = 0;
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_SFP_Object::send_frame\n"));
+ CORBA::Octet flags = TAO_ENCAP_BYTE_ORDER;
+ if (this->transport_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_SFP_Object::send_frame: transport is null\n"),-1);
+ if (this->current_credit_ != 0)
+ {
+ // if we have enough credit then we send.
+ size_t total_length = 0;
+ for (ACE_Message_Block *temp = frame;temp != 0;temp = temp->cont ())
+ total_length += temp->length ();
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"total_length of frame=%d\n",total_length));
+ if (total_length < (TAO_SFP_MAX_PACKET_SIZE -TAO_SFP_Base::frame_header_len))
+ {
+ if (frame_info != 0)
+ {
+ if (frame_info->boundary_marker)
+ flags |= 4;
+ CORBA::Boolean result = TAO_SFP_Base::start_frame (flags,
+ flowProtocol::Frame_Msg,
+ out_stream);
+ if (result == 0)
+ return 0;
+ flowProtocol::my_seq_ulong source_ids;
+ source_ids.length (1);
+ source_ids [0] = 0;
+ TAO_SFP_Base::write_frame_message (frame_info->timestamp,
+ frame_info->ssrc,
+ source_ids,
+ this->sequence_num_,
+ out_stream);
+ }
+ else
+ {
+ CORBA::Boolean result = TAO_SFP_Base::start_frame (flags,
+ flowProtocol::SimpleFrame_Msg,
+ out_stream);
+ if (result == 0)
+ return 0;
+ }
+ TAO_SFP_Base::send_message (this->transport_,
+ out_stream,
+ frame);
+ }
+ else // larger frame,fragment and send it.
+ {
+ flags = flags | 2;
+ if (frame_info != 0)
+ {
+ if (frame_info->boundary_marker)
+ flags |= 4;
+ result = TAO_SFP_Base::start_frame (flags,
+ flowProtocol::Frame_Msg,
+ out_stream);
+ if (result == 0)
+ return result;
+ flowProtocol::my_seq_ulong source_ids;
+ source_ids.length (1);
+ source_ids [0] = 0;
+ TAO_SFP_Base::write_frame_message (frame_info->timestamp,
+ frame_info->ssrc,
+ source_ids,
+ this->sequence_num_,
+ out_stream);
+ }
+ else
+ {
+ CORBA::Boolean result = TAO_SFP_Base::start_frame (flags,
+ flowProtocol::SimpleFrame_Msg,
+ out_stream);
+ if (result == 0)
+ return 0;
+ }
+ size_t last_len,current_len;
+ int message_len = static_cast<int> (out_stream.total_length ());
+ ACE_Message_Block *mb = frame;
+ ACE_Message_Block *fragment_mb =
+ this->get_fragment (mb,
+ message_len,
+ last_len,
+ current_len);
+ // This can be either a simpleframe or a sequenced frame,other types of frames.
+ TAO_SFP_Base::send_message (this->transport_,
+ out_stream,
+ fragment_mb);
+ out_stream.reset ();
+ int frag_number = 1;
+ mb->length (last_len);
+ mb->rd_ptr (current_len);
+ // If there is any more data send those as fragments.
+ while (mb != 0)
+ {
+ message_len = TAO_SFP_Base::fragment_len;
+ fragment_mb = this->get_fragment (mb,
+ message_len,
+ last_len,
+ current_len);
+ if (mb == 0)
+ {
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"sending the last fragment\n"));
+ // This is the last fragment so clear the fragments bit.
+ flags = TAO_ENCAP_BYTE_ORDER;
+ }
+ if (fragment_mb == 0)
+ break;
+ if (frame_info != 0)
+ {
+ TAO_SFP_Base::write_fragment_message (flags,
+ frag_number++,
+ this->sequence_num_,
+ frame_info->ssrc,
+ out_stream);
+ }
+ else
+ {
+ TAO_SFP_Base::write_fragment_message (flags,
+ frag_number++,
+ this->sequence_num_,
+ 0,
+ out_stream);
+ }
+ // send the fragment now.
+ // without the sleep the fragments gets lost!
+ // probably because the UDP buffer queue on the sender side
+ // is overflown it drops the packets.
+ // XXX: This is a hack.
+ ACE_OS::sleep (1);
+ result = TAO_SFP_Base::send_message (this->transport_,
+ out_stream,
+ fragment_mb);
+ if (mb != 0)
+ {
+ mb->length (last_len);
+ mb->rd_ptr (current_len);
+ }
+ }
+ // Increment the sequence_num after sending the message.
+ this->sequence_num_++;
+ // Also reduce the number of credits.
+ if (this->max_credit_ > 0)
+ this->current_credit_--;
+ }
+ }
+ else
+ {
+ // flow controlled so wait.
+ // A greater than 0 value indicates that flow control is being exercised.
+ return 1;
+ }
+ return 0;
+}
+
+int
+TAO_SFP_Object::send_frame (const iovec * /*iov*/,
+ int /*iovcnt*/,
+ TAO_AV_frame_info * /*frame_info*/)
+{
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_SFP_Object::send_frame"),-1);
+}
+
+int
+TAO_SFP_Object::send_frame (const char* /*buf*/,
+ size_t /*len*/)
+{
+ return 0;
+}
+
+
+ACE_Message_Block*
+TAO_SFP_Object::get_fragment (ACE_Message_Block *&mb,
+ size_t initial_len,
+ size_t &last_mb_orig_len,
+ size_t &last_mb_current_len)
+{
+ ACE_Message_Block *fragment_mb = 0,*temp_mb = 0;
+ size_t prev_len,last_len = 0;
+ size_t current_len = 0;
+ size_t message_len = initial_len;
+ while (mb != 0)
+ {
+ prev_len = message_len;
+ message_len += mb->length ();
+ if (fragment_mb == 0)
+ fragment_mb = temp_mb = mb->duplicate ();
+ if (message_len > TAO_SFP_MAX_PACKET_SIZE)
+ {
+ // get only the length that we can accomodate.
+ current_len = TAO_SFP_MAX_PACKET_SIZE - prev_len;
+ if (current_len < mb->length ())
+ {
+ // The above condition is an assertion.
+ message_len += (current_len-mb->length ());
+ last_len = mb->length ();
+ mb->length (current_len);
+ temp_mb->length (current_len);
+ }
+ break;
+ }
+ else
+ {
+ // we can accomodate this message block
+ message_len += mb->length ();
+ mb = mb->cont ();
+ temp_mb = temp_mb->cont ();
+ }
+ }
+ last_mb_orig_len = last_len;
+ last_mb_current_len = current_len;
+ return fragment_mb;
+}
+
+int
+TAO_SFP_Object::set_policies (const TAO_AV_PolicyList& policies)
+{
+ TAO_AV_Policy *policy = 0;
+ for (CORBA::ULong i=0;i<policies.length ();i++)
+ {
+ policy = policies[i];
+ switch (policies[i]->type ())
+ {
+
+ case TAO_AV_SFP_CREDIT_POLICY:
+ {
+ TAO_AV_SFP_Credit_Policy *credit_policy =
+ reinterpret_cast<TAO_AV_SFP_Credit_Policy*> (policy);
+ this->max_credit_ = credit_policy->value ();
+ }
+ default:
+ break;
+ }
+ }
+ return 0;
+}
+
+// TAO_SFP_Consumer_Object
+TAO_SFP_Consumer_Object::TAO_SFP_Consumer_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport,
+ ACE_CString& sfp_options)
+ :TAO_SFP_Object (callback,transport)
+{
+ TAO_AV_PolicyList policies = callback->get_policies ();
+ if (policies.length () == 0)
+ return;
+ this->set_policies (policies);
+ if (this->max_credit_ > 0)
+ {
+ sfp_options = "sfp:1.0:credit=";
+ char buf[10];
+ ACE_OS::sprintf(buf, "%d", this->max_credit_);
+ sfp_options += buf;
+ }
+}
+
+int
+TAO_SFP_Consumer_Object::handle_input (void)
+{
+ if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_SFP_Consumer_Object::handle_input\n"));
+ // This is the entry point for receiving data.
+ TAO_AV_frame_info *frame_info = 0;
+ int result = TAO_SFP_Base::handle_input (this->transport_,
+ this->state_,
+ frame_info);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"ERROR in TAO_SFP_Consumer_Object::handle_input"),result);
+ if (this->state_.frame_header_.message_type == flowProtocol::EndofStream_Msg)
+ this->callback_->handle_destroy ();
+ if (this->state_.is_complete ())
+ {
+ this->callback_->receive_frame (this->state_.frame_block_,
+ frame_info);
+ // Now release the memory for the frame.
+ if (this->state_.frame_block_ != &this->state_.static_frame_)
+ {
+ ACE_Message_Block *temp = 0;
+ for (temp = this->state_.frame_block_;
+ temp != 0;
+ temp = temp->cont ())
+ {
+ temp->release ();
+ delete temp;
+ }
+ }
+ this->state_.reset ();
+ }
+ return 0;
+}
+
+TAO_SFP_Producer_Object::TAO_SFP_Producer_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport,
+ const char *sfp_options)
+ :TAO_SFP_Object (callback,transport),
+ credit_sequence_num_ (0)
+
+{
+ TAO_Tokenizer flow_string (sfp_options,':');
+ if (flow_string [2] != 0)
+ {
+ TAO_Tokenizer options (flow_string[2],'=');
+ if (options [1] != 0)
+ this->max_credit_ = ACE_OS::atoi (options[1]);
+ }
+}
+
+int
+TAO_SFP_Producer_Object::handle_input (void)
+{
+ // A producer can only receive credit messages.
+ int result;
+ flowProtocol::MsgType msg_type = flowProtocol::Start_Msg;
+ result = TAO_SFP_Base::peek_message_type (this->transport_,
+ msg_type);
+ if (result < 0)
+ return result;
+ switch (msg_type)
+ {
+ case flowProtocol::Credit_Msg:
+ {
+ flowProtocol::credit credit;
+ result = TAO_SFP_Base::read_credit_message (this->transport_,
+ credit,
+ this->state_.cdr);
+ if (result < 0)
+ return result;
+ if (!this->credit_sequence_num_)
+ this->credit_sequence_num_ = credit.cred_num;
+ else
+ {
+ // check that the sequence number is above the last sequence number
+ // else its a duplicate credit message so we can ignore it.
+ if (credit.cred_num <= this->credit_sequence_num_)
+ return 0;
+ else // Update our credit now.
+ this->current_credit_ = this->max_credit_;
+ }
+ }
+ break;
+ default:
+ {
+ ACE_Message_Block mb (2*this->transport_->mtu ());
+
+ // Ignore the rest of the message by just reading.
+ this->transport_->recv (mb.rd_ptr (),
+ mb.size ());
+ break;
+ }
+ }
+ return 0;
+}
+
+// TAO_AV_SFP_Factory
+TAO_AV_SFP_Factory::TAO_AV_SFP_Factory (void)
+{
+}
+
+TAO_AV_SFP_Factory::~TAO_AV_SFP_Factory (void)
+{
+}
+
+// Initialization hook from service configurator.
+int
+TAO_AV_SFP_Factory::init (int /*argc*/, char ** /*argv*/)
+{
+ return 0;
+}
+
+int
+TAO_AV_SFP_Factory::match_protocol (const char *flow_string)
+{
+ if (ACE_OS::strncasecmp (flow_string,"sfp",3) == 0)
+ return 1;
+ return 0;
+}
+
+TAO_AV_Protocol_Object*
+TAO_AV_SFP_Factory::make_protocol_object (TAO_FlowSpec_Entry *entry,
+ TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Flow_Handler *handler,
+ TAO_AV_Transport *transport)
+{
+ TAO_AV_Protocol_Object *object = 0;
+ TAO_AV_Callback *callback = 0;
+ endpoint->get_callback (entry->flowname (),
+ callback);
+ ACE_CString flow_string( entry->flow_protocol_str () );
+ switch (entry->role ())
+ {
+ case TAO_FlowSpec_Entry::TAO_AV_PRODUCER:
+ {
+ ACE_NEW_RETURN (object,
+ TAO_SFP_Producer_Object (callback,
+ transport,
+ flow_string.c_str() ),
+ 0);
+ }
+ break;
+ case TAO_FlowSpec_Entry::TAO_AV_CONSUMER:
+ {
+
+ ACE_NEW_RETURN (object,
+ TAO_SFP_Consumer_Object (callback,
+ transport,
+ flow_string),
+ 0);
+ entry->flow_protocol_str( flow_string.c_str() );
+ }
+ break;
+ case TAO_FlowSpec_Entry::TAO_AV_INVALID_ROLE:
+ return 0;
+ }
+ callback->open (object,
+ handler);
+ endpoint->set_protocol_object (entry->flowname (),
+ object);
+ return object;
+}
+
+//------------------------------------------------------------
+// TAO_SFP_Frame_State
+//------------------------------------------------------------
+
+TAO_SFP_Frame_State::TAO_SFP_Frame_State (void)
+ :cdr (new ACE_Data_Block (ACE_CDR::DEFAULT_BUFSIZE,
+ ACE_Message_Block::MB_DATA,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0),
+ 0,
+ TAO_ENCAP_BYTE_ORDER),
+ more_fragments_ (0),
+ frame_block_ (0)
+{
+}
+
+CORBA::Boolean
+TAO_SFP_Frame_State::is_complete (void)
+{
+ return (!this->more_fragments_) && (this->frame_block_);
+}
+
+int
+TAO_SFP_Frame_State::reset (void)
+{
+ this->frame_block_ = 0;
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Singleton<TAO_SFP_Base, ACE_Thread_Mutex> *ACE_Singleton<TAO_SFP_Base, ACE_Thread_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_AV, TAO_AV_SFP_Factory)
+ACE_STATIC_SVC_DEFINE (TAO_AV_SFP_Factory,
+ ACE_TEXT ("SFP_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_AV_SFP_Factory),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
diff --git a/TAO/orbsvcs/orbsvcs/AV/sfp.h b/TAO/orbsvcs/orbsvcs/AV/sfp.h
new file mode 100644
index 00000000000..35ab492f34f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AV/sfp.h
@@ -0,0 +1,306 @@
+// -*- C++ -*-
+
+// ============================================================================
+/**
+ * @file sfp.h
+ *
+ * $Id$
+ *
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+// ============================================================================
+
+#ifndef TAO_AV_SFP_H
+#define TAO_AV_SFP_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/AV/AV_export.h"
+
+#include "orbsvcs/AV/Policy.h"
+#include "orbsvcs/AV/MCast.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/UDP.h"
+
+#include "orbsvcs/sfpC.h"
+
+#include "tao/CDR.h"
+
+#include "ace/SOCK_Dgram.h"
+#include "ace/INET_Addr.h"
+
+
+#define TAO_SFP_MAGIC_NUMBER_LEN 4
+#define TAO_SFP_MESSAGE_TYPE_OFFSET 5
+#define TAO_SFP_WRITEV_MAX 128
+
+#define TAO_SFP_MAX_PACKET_SIZE ACE_MAX_DGRAM_SIZE
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_SFP_Fragment_Node
+ * @brief
+ */
+class TAO_SFP_Fragment_Node
+{
+public:
+ TAO_SFP_Fragment_Node (void) : data_ (0) {}
+ flowProtocol::fragment fragment_info_;
+ ACE_Message_Block *data_;
+ friend bool operator< (const TAO_SFP_Fragment_Node& left,
+ const TAO_SFP_Fragment_Node& right);
+};
+
+/**
+ * @class TAO_SFP_Fragment_Table_Entry
+ * @brief
+ */
+class TAO_SFP_Fragment_Table_Entry
+{
+public:
+ TAO_SFP_Fragment_Table_Entry (void)
+ :last_received_ (0),
+ num_fragments_ (0)
+ {}
+ int last_received_;
+ size_t num_fragments_;
+ TAO_AV_frame_info frame_info;
+ ACE_Ordered_MultiSet<TAO_SFP_Fragment_Node> fragment_set_;
+};
+
+typedef ACE_Ordered_MultiSet_Iterator<TAO_SFP_Fragment_Node> FRAGMENT_SET_ITERATOR;
+typedef ACE_Hash_Map_Manager<CORBA::ULong,TAO_SFP_Fragment_Table_Entry*,ACE_Null_Mutex> TAO_SFP_Fragment_Table;
+typedef ACE_Hash_Map_Manager<CORBA::ULong,TAO_SFP_Fragment_Table*,ACE_Null_Mutex> TAO_SFP_Fragment_Table_Map;
+
+/**
+ * @class TAO_SFP_Frame_State
+ * @brief
+ */
+class TAO_AV_Export TAO_SFP_Frame_State
+{
+public:
+ TAO_SFP_Frame_State (void);
+ CORBA::Boolean is_complete (void);
+
+ int reset (void);
+
+ TAO_InputCDR cdr;
+ // This is the InputCDR that will be used to decode the message.
+ flowProtocol::frameHeader frame_header_;
+ flowProtocol::fragment fragment_;
+ flowProtocol::frame frame_;
+ CORBA::Boolean more_fragments_;
+ ACE_Message_Block *frame_block_;
+ // boolean flags indicating that there are more fragments.
+ ACE_Message_Block static_frame_;
+ TAO_SFP_Fragment_Table_Map fragment_table_map_;
+};
+
+class TAO_AV_Transport;
+class TAO_AV_Core;
+
+/**
+ * @class TAO_SFP_Base
+ * @brief
+ */
+class TAO_AV_Export TAO_SFP_Base
+{
+public:
+ // default arguments to pass to use for the ORB
+ static const char TAO_SFP_ORB_ARGUMENTS[];
+
+ // SFP magic numbers
+ static const char TAO_SFP_MAGIC_NUMBER[];
+ static const char TAO_SFP_FRAGMENT_MAGIC_NUMBER[];
+ static const char TAO_SFP_START_MAGIC_NUMBER[];
+ static const char TAO_SFP_CREDIT_MAGIC_NUMBER[];
+ static const char TAO_SFP_STARTREPLY_MAGIC_NUMBER[];
+
+ // SFP version 1.0
+ static const unsigned char TAO_SFP_MAJOR_VERSION;
+ static const unsigned char TAO_SFP_MINOR_VERSION;
+
+ // lengths of various SFP headers
+ static const unsigned char TAO_SFP_FRAME_HEADER_LEN;
+ static const unsigned char TAO_SFP_MESSAGE_SIZE_OFFSET;
+ static const unsigned char TAO_SFP_FRAGMENT_SIZE_OFFSET;
+ static u_int frame_header_len;
+ static u_int start_reply_len;
+ static u_int start_len;
+ static u_int credit_len;
+ static u_int fragment_len;
+
+ enum State
+ {
+ ACTIVE_START,
+ PASSIVE_START,
+ TIMEDOUT_T1,
+ TIMEDOUT_T2,
+ REPLY_RECEIVED,
+ START_RECEIVED
+ };
+
+ TAO_SFP_Base (void);
+ static CORBA::Boolean start_frame (CORBA::Octet flags,
+ flowProtocol::MsgType type,
+ TAO_OutputCDR &msg);
+
+ static CORBA::Boolean write_start_message (TAO_OutputCDR &msg);
+ static CORBA::Boolean write_start_reply_message (TAO_OutputCDR &msg);
+ static CORBA::Boolean write_credit_message (CORBA::ULong cred_num,
+ TAO_OutputCDR &msg);
+ static CORBA::Boolean write_fragment_message (CORBA::Octet flags,
+ CORBA::ULong fragment_number,
+ CORBA::ULong sequence_number,
+ CORBA::ULong source_id,
+ TAO_OutputCDR &msg);
+
+ static CORBA::Boolean write_frame_message (CORBA::ULong timestamp,
+ CORBA::ULong synchSource,
+ flowProtocol::my_seq_ulong source_ids,
+ CORBA::ULong sequence_num,
+ TAO_OutputCDR &msg);
+
+ static int send_message (TAO_AV_Transport *transport,
+ TAO_OutputCDR &stream,
+ ACE_Message_Block *mb = 0);
+ static int peek_message_type (TAO_AV_Transport *transport,
+ flowProtocol::MsgType &type);
+ static int read_start_message (TAO_AV_Transport *transport,
+ flowProtocol::Start &start,
+ TAO_InputCDR &cdr);
+ static int read_start_reply_message (TAO_AV_Transport *transport,
+ flowProtocol::StartReply &start_reply,
+ TAO_InputCDR &cdr);
+ static int read_credit_message (TAO_AV_Transport *transport,
+ flowProtocol::credit &credit,
+ TAO_InputCDR &cdr);
+ static int read_endofstream_message (TAO_AV_Transport *transport,
+ flowProtocol::frameHeader &endofstream,
+ TAO_InputCDR &cdr);
+
+ static int read_frame (TAO_AV_Transport *transport,
+ flowProtocol::frameHeader &frame_header,
+ TAO_SFP_Frame_State &state,
+ TAO_AV_frame_info *&frame_info);
+
+ static int read_fragment (TAO_AV_Transport *transport,
+ flowProtocol::fragment &fragment,
+ TAO_SFP_Frame_State &state,
+ TAO_AV_frame_info *&frame_info);
+
+ static int peek_frame_header (TAO_AV_Transport *transport,
+ flowProtocol::frameHeader &header,
+ TAO_InputCDR &cdr);
+
+ static int peek_fragment_header (TAO_AV_Transport *transport,
+ flowProtocol::fragment &fragment,
+ TAO_InputCDR &cdr);
+
+ static int handle_input (TAO_AV_Transport *transport,
+ TAO_SFP_Frame_State &state,
+ TAO_AV_frame_info *&frame_info);
+
+ static ACE_Message_Block* check_all_fragments (TAO_SFP_Fragment_Table_Entry *fragment_entry);
+
+protected:
+ static void dump_buf (char *buf,int n);
+ // dumps the buffer to the screen.
+};
+
+// Beware the SFP_Base code relies on the Singleton being initialized.
+typedef ACE_Singleton <TAO_SFP_Base,TAO_SYNCH_MUTEX> TAO_SFP_BASE;
+
+/**
+ * @class TAO_SFP_Object
+ * @brief
+ */
+class TAO_AV_Export TAO_SFP_Object : public TAO_AV_Protocol_Object
+{
+public:
+ TAO_SFP_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport);
+ // We should add a sfp options parameter.
+
+ virtual ~TAO_SFP_Object (void);
+ // Dtor
+
+ virtual int handle_input (void) = 0;
+ virtual int send_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info = 0);
+
+ virtual int send_frame (const iovec *iov,
+ int iovcnt,
+ TAO_AV_frame_info *frame_info = 0);
+
+ virtual int send_frame (const char*buf,
+ size_t len);
+
+ virtual int destroy (void);
+ virtual int set_policies (const TAO_AV_PolicyList &policies);
+
+protected:
+ ACE_Message_Block *get_fragment (ACE_Message_Block *&frame,
+ size_t initial_len,
+ size_t &last_mb_orig_len,
+ size_t &last_mb_current_len);
+ CORBA::ULong sequence_num_;
+ CORBA::ULong source_id_;
+ CORBA::Long max_credit_;
+ CORBA::Long current_credit_;
+ TAO_SFP_Frame_State state_;
+};
+
+/**
+ * @class TAO_SFP_Producer_Object
+ * @brief
+ */
+class TAO_AV_Export TAO_SFP_Producer_Object : public TAO_SFP_Object
+{
+public:
+ TAO_SFP_Producer_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport,
+ const char *flow_options);
+ virtual int handle_input (void);
+protected:
+ CORBA::ULong credit_sequence_num_;
+};
+
+/**
+ * @class TAO_SFP_Consumer_Object
+ * @brief
+ */
+class TAO_AV_Export TAO_SFP_Consumer_Object : public TAO_SFP_Object
+{
+public:
+ TAO_SFP_Consumer_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport,
+ ACE_CString& flow_options);
+ virtual int handle_input (void);
+};
+
+/**
+ * @class TAO_AV_SFP_Factory
+ * @brief
+ */
+class TAO_AV_Export TAO_AV_SFP_Factory : public TAO_AV_Flow_Protocol_Factory
+{
+public:
+ TAO_AV_SFP_Factory (void);
+ virtual ~TAO_AV_SFP_Factory (void);
+ virtual int init (int argc, char *argv[]);
+ // Initialization hook.
+ virtual int match_protocol (const char *flow_string);
+ 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);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (TAO_AV_SFP_Flow_Factory)
+ACE_FACTORY_DECLARE (TAO_AV, TAO_AV_SFP_Flow_Factory)
+
+#include /**/ "ace/post.h"
+#endif /* TAO_SFP_H */
diff --git a/TAO/orbsvcs/orbsvcs/AVStreams.idl b/TAO/orbsvcs/orbsvcs/AVStreams.idl
new file mode 100644
index 00000000000..1e40c191651
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/AVStreams.idl
@@ -0,0 +1,795 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file AVStreams.idl
+ *
+ * $Id$
+ *
+ * @author Sumedh Mungee <sumedh@cs.wustl.edu>
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_AV_STREAMS_IDL
+#define TAO_AV_STREAMS_IDL
+
+#include "CosProperty.idl"
+
+#pragma prefix "omg.org"
+
+/**
+ * @brief IDL for Control and Management of Audio/Video Streams
+ * Revised Submission.
+ */
+module AVStreams
+{
+
+ /**
+ * @struct QoS
+ * @brief This structure represents QoS for a given type.
+ * E.g. {"video_qos", <"video_framerate", 26>,
+ * <"video_depth", 9>}
+ */
+ struct QoS
+ {
+ string QoSType;
+ /// Name of the Qos type, e.g. "video_qos"
+
+ CosPropertyService::Properties QoSParams;
+ /// Sequence of name value pairs, see e.g. above.
+ };
+
+ /// The QoS of a stream is a sequence of QoS structs (defined above)
+ typedef sequence<QoS> streamQoS;
+
+ /// flowSpec is used to keep transport protocol information Each
+ /// string is one endpoint.
+ typedef sequence<string> flowSpec;
+
+ /// List of protocols supported protocol names registered by OMG.
+ /// e.g., TCP, UDP, AAL5, IPX, RTP
+ typedef sequence<string> protocolSpec;
+
+ /// Used as a key for public-key encryption
+ typedef sequence<octet> key;
+
+ /**
+ * @struct SFPStatus
+ * @brief This structure is defined for SFP1.0 Subsequent versions of
+ * the protocol may specify new structures.
+ */
+ struct SFPStatus
+ {
+ boolean isFormatted;
+ boolean isSpecialFormat;
+ boolean seqNums;
+ boolean timestamps;
+ boolean sourceIndicators;
+ };
+
+ /**
+ * @enum flowState
+ * @brief Represents the state of a flow
+ */
+ enum flowState
+ {
+ stopped,
+ started,
+ dead
+ };
+
+ /**
+ * @enum dirType
+ * @brief The direction of a flow.
+ */
+ enum dirType
+ {
+ dir_in,
+ dir_out
+ };
+
+ /**
+ * @struct flowStatus
+ * @brief Used to store the status of a flow.
+ */
+ struct flowStatus
+ {
+
+ string flowName;
+ dirType directionality;
+ flowState status;
+ SFPStatus theFormat;
+ QoS theQoS;
+ };
+
+ /// Used to convey events, in Basic_StreamCtrl::push_event.
+ typedef CosPropertyService::Property streamEvent;
+
+
+ exception notSupported
+ {
+ /// Used to indicate that an operation is not supported.
+ };
+
+ exception PropertyException
+ {
+ /// Property exception: raised by VDev::configure ().
+ };
+
+ exception FPError
+ {
+ /// An flow protocol related error.
+ string flow_name;
+ };
+
+
+ exception streamOpFailed
+ {
+ /// Raised by operations on streams.
+ string reason;
+ };
+
+ exception streamOpDenied
+ {
+ /// Raised by operations on streams.
+ string reason;
+ };
+
+ exception noSuchFlow
+ {
+ /// Used to indicate that an invalid flow name was used for the
+ /// operation.
+ };
+
+ exception QoSRequestFailed
+ {
+ /// Used to indicate failure in changing QoS.
+ string reason;
+ };
+
+ /**
+ * @interface Basic_StreamCtrl
+ * @brief Base class for StreamCtrl, implements basic stream start
+ * and stop functionality.
+ */
+ interface Basic_StreamCtrl : CosPropertyService::PropertySet {
+
+ // = Empty flowSpec => apply operation to all flows
+ /// Stop the transfer of data of the stream.Empty the_spec means
+ /// apply operation to all flows.
+ void stop (in flowSpec the_spec) raises (noSuchFlow);
+
+ /// Start the transfer of data in the stream. Empty the_spec
+ /// means apply operation to all flows.
+ void start (in flowSpec the_spec) raises (noSuchFlow);
+
+ /// Tears down the stream. This will close the connection, and
+ /// delete the streamendpoint and vdev associated with this
+ /// stream Empty the_spec means apply operation to all flows.
+ void destroy (in flowSpec the_spec) raises (noSuchFlow);
+
+ /// Changes the QoS associated with the stream Empty the_spec
+ /// means apply operation to all flows.
+ boolean modify_QoS (inout streamQoS new_qos,
+ in flowSpec the_spec)
+ raises (noSuchFlow,
+ QoSRequestFailed);
+
+ /// Called by StreamEndPoint when something goes wrong with a
+ /// flow.
+ oneway void push_event (in streamEvent the_event);
+
+ /// Used to control the flow protocol parameters.
+ void set_FPStatus (in flowSpec the_spec,
+ in string fp_name,
+ in any fp_settings)
+ raises (noSuchFlow,
+ FPError);
+
+ /// Not implemented in the light profile, will raise the
+ /// notsupported exception.
+ Object get_flow_connection (in string flow_name)
+ raises (noSuchFlow,
+ notSupported);
+
+ /// Not implemented in the light profile, will raise the
+ /// notsupported exception.
+ void set_flow_connection (in string flow_name,
+ in Object flow_connection)
+ raises (noSuchFlow,
+ notSupported);
+ };
+
+ /**
+ * @interface Negotiator
+ * @brief This interface is used to negotiate QoS between two stream
+ * endpoints.
+ */
+ interface Negotiator
+ {
+ /// Initiates the process of negotiating the qos_spec.
+ boolean negotiate (in Negotiator remote_negotiator,
+ in streamQoS qos_spec);
+ };
+
+ // Forward declarations.
+ interface VDev;
+ interface MMDevice;
+ interface StreamEndPoint;
+ interface StreamEndPoint_A;
+ interface StreamEndPoint_B;
+
+ /**
+ * @interface StreamCtrl
+ * @brief Implementation the A/V StreamCtrl class. this class
+ * is used to control the stream. It should be subclassed
+ * by applications that want to provide more control features.
+ */
+ interface StreamCtrl : Basic_StreamCtrl
+ {
+
+ boolean bind_devs (in MMDevice a_party, in MMDevice b_party,
+ inout streamQoS the_qos,
+ in flowSpec the_flows)
+ raises (streamOpFailed,
+ noSuchFlow,
+ QoSRequestFailed);
+ /// Establish a stream between a_party and b_party, with qos
+ /// the_qos, and for the flows in the_flows if the_flows is
+ /// empty, bind all the flows Causes a connection to be
+ /// established between the StreamEndpoints. Returns
+ /// success/failure
+
+ boolean bind (in StreamEndPoint_A a_party,
+ in StreamEndPoint_B b_party,
+ inout streamQoS the_qos,
+ in flowSpec the_flows)
+ raises (streamOpFailed,
+ noSuchFlow,
+ QoSRequestFailed);
+ /// Establish a connection between two streamendpoints. This can
+ /// be used if the streamendpoints have been created independent
+ /// of a MMDevice
+
+ void unbind_dev(in MMDevice dev, in flowSpec the_spec)
+ raises (streamOpFailed, noSuchFlow);
+
+ /// Unbind the_ep from the stream. Empty the_spec means apply to
+ /// all flows.
+ void unbind_party (in StreamEndPoint the_ep,
+ in flowSpec the_spec)
+ raises (streamOpFailed, noSuchFlow);
+
+ /// unbind the stream. Same effect as Basic_StreamCtrl::destroy ()
+ void unbind ()
+ raises (streamOpFailed);
+
+ VDev get_related_vdev(in MMDevice adev,
+ out StreamEndPoint sep)
+ raises (streamOpFailed);
+
+ };
+
+ /**
+ * @interface MCastConfigIf
+ * @brief Interface for multicasting operations.
+ */
+ interface MCastConfigIf : CosPropertyService::PropertySet{
+ /// Set a peer in the multicast tree.
+ boolean set_peer (in Object peer,
+ inout streamQoS the_qos,
+ in flowSpec the_spec)
+ raises (QoSRequestFailed,
+ streamOpFailed);
+
+ /// Configure the multicast stream.
+ void configure (in CosPropertyService::Property a_configuration);
+
+ /// Sets the initial configuration to be used for all added peers.
+ void set_initial_configuration (in CosPropertyService::Properties initial);
+
+
+ /// Uses <format_name> standardised by OMG and IETF
+ /// Multicasting operations are not supported yet.
+ void set_format (in string flowName,
+ in string format_name)
+ raises (notSupported);
+
+
+ /// Note, some of these device params are standardised by OMG
+ /// Multicasting operations are not supported yet.
+ void set_dev_params (in string flowName,
+ in CosPropertyService::Properties new_params)
+ // raises (CosPropertyService::PropertyException,
+ // streamOpFailed);
+ raises (PropertyException,
+ streamOpFailed);
+
+ };
+
+ /**
+ * @interface StreamEndpoint
+ * @brief The Stream EndPoint. Used to implement one endpoint of a
+ * stream that implements the transport layer.
+ */
+ interface StreamEndPoint : CosPropertyService::PropertySet{
+
+ /// Stop the stream. Empty the_spec means, for all the flows.
+ void stop (in flowSpec the_spec)
+ raises (noSuchFlow);
+
+ /// Start the stream, Empty the_spec means, for all the flows.
+ void start (in flowSpec the_spec)
+ raises (noSuchFlow);
+
+ /// Destroy the stream, Empty the_spec means, for all the flows.
+ void destroy (in flowSpec the_spec)
+ raises (noSuchFlow);
+
+ /// Called by StreamCtrl. responder is the peer to connect with.
+ boolean connect (in StreamEndPoint responder,
+ inout streamQoS qos_spec,
+ in flowSpec the_spec)
+ raises (noSuchFlow,
+ QoSRequestFailed,
+ streamOpFailed);
+
+ /// Called by the peer StreamEndPoint. The flow_spec indicates
+ /// the flows (which contain transport addresses etc.).
+ boolean request_connection (in StreamEndPoint initiator,
+ in boolean is_mcast,
+ inout streamQoS qos,
+ inout flowSpec the_spec)
+ raises (streamOpDenied, noSuchFlow,
+ QoSRequestFailed, FPError);
+
+ /// Change the transport qos on a stream.
+ boolean modify_QoS (inout streamQoS new_qos,
+ in flowSpec the_flows)
+ raises (noSuchFlow,
+ QoSRequestFailed);
+
+ /// Used to restrict the set of protocols.
+ boolean set_protocol_restriction (in protocolSpec the_pspec);
+
+ /// Disconnect the flows.
+ void disconnect(in flowSpec the_spec)
+ raises (noSuchFlow,
+ streamOpFailed);
+
+ /// Used to control the SFP parameters.
+ void set_FPStatus (in flowSpec the_spec,
+ in string fp_name,
+ in any fp_settings)
+ raises (noSuchFlow,
+ FPError);
+
+ /// Not implemented in the light profile, throws notsupported.
+ Object get_fep (in string flow_name)
+ raises (notSupported,
+ noSuchFlow);
+
+ /// Not implemented in the light profile, throws notsupported.
+ string add_fep (in Object the_fep)
+ /// Can fail for reasons {duplicateFepName, duplicateRef}
+ raises (notSupported,
+ streamOpFailed);
+
+ /// Not implemented in the light profile, throws notsupported.
+ void remove_fep (in string fep_name)
+ raises (notSupported,
+ streamOpFailed);
+
+ /// Used to "attach" a negotiator to the endpoint.
+ void set_negotiator (in Negotiator new_negotiator);
+
+ /// Used for public key encryption.
+ void set_key (in string flow_name,
+ in key the_key);
+
+ /// Used to set a unique id for packets sent by this
+ /// streamendpoint.
+ void set_source_id (in long source_id);
+ };
+
+ /**
+ * @interface StreamEndPoint_A
+ * @brief The "A" side of a streamendpoint.
+ */
+ interface StreamEndPoint_A : StreamEndPoint
+ {
+ /// Used for ATM-style multicast.
+ boolean multiconnect (inout streamQoS the_qos,
+ inout flowSpec the_spec)
+ raises (noSuchFlow, QoSRequestFailed, streamOpFailed);
+
+ /// Used for ATM-style multicast.
+ boolean connect_leaf (in StreamEndPoint_B the_ep,
+ inout streamQoS the_qos,
+ in flowSpec the_flows)
+ raises (streamOpFailed, noSuchFlow,
+ QoSRequestFailed, notSupported);
+
+ /// Used for ATM-style multicast.
+ void disconnect_leaf (in StreamEndPoint_B the_ep,
+ in flowSpec theSpec)
+ raises(streamOpFailed, noSuchFlow, notSupported);
+ };
+
+ /**
+ * @interface StreamEndPoint_B
+ * @brief The "B" side of a streamendpoint.
+ */
+ interface StreamEndPoint_B : StreamEndPoint
+ {
+ /// Used for ATM-style multicast.
+ boolean multiconnect (inout streamQoS the_qos,
+ inout flowSpec the_spec)
+ raises (streamOpFailed, noSuchFlow,
+ QoSRequestFailed, FPError);
+
+ };
+
+ /**
+ * @interface VDev
+ * @brief Implements the VDev interface. One of these is created per
+ * connection, and represents device-specific parameters.
+ */
+ interface VDev : CosPropertyService::PropertySet
+ {
+ /// Called to tell the vdev who the streamctrl, peer vdev is.
+ boolean set_peer (in StreamCtrl the_ctrl,
+ in VDev the_peer_dev,
+ inout streamQoS the_qos,
+ in flowSpec the_spec)
+ raises (noSuchFlow,
+ QoSRequestFailed,
+ streamOpFailed);
+
+ /// Used to set the streamctrl and multicast device.
+ boolean set_Mcast_peer (in StreamCtrl the_ctrl,
+ in MCastConfigIf a_mcastconfigif,
+ inout streamQoS the_qos,
+ in flowSpec the_spec)
+ raises (noSuchFlow,
+ QoSRequestFailed,
+ streamOpFailed);
+
+ /// Called by the peer VDev to configure the device (catch all).
+ void configure (in CosPropertyService::Property the_config_mesg)
+ raises (PropertyException,
+ streamOpFailed);
+
+ /// Uses <formatName> standardised by OMG and IETF
+ /// Used to set a format on a flowname.
+ void set_format (in string flowName,
+ in string format_name)
+ raises (notSupported);
+
+ // = Note, some of these device params are standardised by OMG
+ /// Used to set device parameters.
+ void set_dev_params (in string flowName,
+ in CosPropertyService::Properties new_params)
+ raises (PropertyException,
+ streamOpFailed);
+
+ /// Called to change QoS of the device.
+ boolean modify_QoS (inout streamQoS the_qos,
+ in flowSpec the_spec)
+ raises (noSuchFlow,
+ QoSRequestFailed);
+
+
+ };
+
+ /**
+ * @interface MMDevice
+ * @brief Implements a factory to create Endpoints and VDevs.
+ */
+ interface MMDevice : CosPropertyService::PropertySet
+ {
+ /// Called by StreamCtrl to create a "A" type streamendpoint and
+ /// vdev.
+ StreamEndPoint_A create_A (in StreamCtrl the_requester,
+ out VDev the_vdev,
+ inout streamQoS the_qos,
+ out boolean met_qos,
+ inout string named_vdev,
+ in flowSpec the_spec)
+ raises (streamOpFailed,
+ streamOpDenied,
+ notSupported,
+ QoSRequestFailed,
+ noSuchFlow);
+
+ /// Called by StreamCtrl to create a "B" type streamendpoint and
+ /// vdev.
+ StreamEndPoint_B create_B(in StreamCtrl the_requester,
+ out VDev the_vdev,
+ inout streamQoS the_qos,
+ out boolean met_qos,
+ inout string named_vdev,
+ in flowSpec the_spec)
+ raises (streamOpFailed,
+ streamOpDenied,
+ notSupported,
+ QoSRequestFailed,
+ noSuchFlow);
+
+ /// Can be used to request the MMDevice to create a new
+ /// StreamCtrl, and call bind_devs on it.
+ StreamCtrl bind (in MMDevice peer_device,
+ inout streamQoS the_qos,
+ out boolean is_met,
+ in flowSpec the_spec)
+ raises (streamOpFailed,
+ noSuchFlow,
+ QoSRequestFailed);
+
+ /// Multicast bind.
+ StreamCtrl bind_mcast (in MMDevice first_peer,
+ inout streamQoS the_qos,
+ out boolean is_met,
+ in flowSpec the_spec)
+ raises (streamOpFailed,
+ noSuchFlow,
+ QoSRequestFailed);
+
+ /// Remove the StreamEndPoint and the related vdev.
+ void destroy (in StreamEndPoint the_ep,
+ in string vdev_name)
+ // ie VDev not found
+ raises (notSupported);
+
+ /// Not supported in the light profile, raises notsupported.
+ string add_fdev (in Object the_fdev)
+ raises (notSupported,
+ streamOpFailed);
+
+ /// Not supported in the light profile, raises notsupported.
+ Object get_fdev (in string flow_name)
+ raises (notSupported,
+ noSuchFlow);
+
+ /// Not supported in the light profile, raises notsupported.
+ void remove_fdev (in string flow_name)
+ raises (notSupported,
+ noSuchFlow,
+ streamOpFailed);
+ };
+
+ // Define the exceptions.
+ exception protocolNotSupported{};
+ exception formatNotSupported{};
+ exception formatMismatch{};
+ exception FEPMismatch{};
+ exception alreadyConnected{};
+ exception invalidSettings{string settings;};
+ exception notConnected{};
+ exception deviceQosMismatch{};
+ exception failedToConnect{string reason;};
+ exception failedToListen{string reason;};
+
+ // Forward declarations of the interfaces.
+ interface FlowProducer;
+ interface FlowConsumer;
+ interface FlowEndPoint;
+ interface FDev;
+
+ interface FlowConnection : CosPropertyService::PropertySet{
+ void stop();
+ void start();
+ void destroy();
+
+ boolean modify_QoS(inout AVStreams::QoS new_qos)
+ raises (AVStreams::QoSRequestFailed);
+
+ boolean use_flow_protocol(in string fp_name,
+ in any fp_settings)
+ raises (AVStreams::FPError, AVStreams::notSupported);
+
+ oneway void push_event(in AVStreams::streamEvent the_event);
+
+ boolean connect_devs(in FDev a_party, in FDev b_party,
+ inout AVStreams::QoS the_qos)
+ raises (AVStreams::streamOpFailed,
+ AVStreams::streamOpDenied,
+ AVStreams::QoSRequestFailed);
+
+ boolean connect(in FlowProducer flow_producer,
+ in FlowConsumer flow_consumer,
+ inout AVStreams::QoS the_qos)
+ raises (formatMismatch, FEPMismatch, alreadyConnected);
+
+ boolean disconnect();
+
+ // The notSupported exception is raised where
+ // flow cannot have multiple producers
+ boolean add_producer(in FlowProducer flow_producer,
+ inout AVStreams::QoS the_qos)
+ raises (alreadyConnected, AVStreams::notSupported);
+
+ boolean add_consumer(in FlowConsumer flow_consumer,
+ inout AVStreams::QoS the_qos)
+ raises (alreadyConnected);
+
+ boolean drop(in FlowEndPoint target)
+ raises (notConnected);
+ };
+
+ interface FlowEndPoint : CosPropertyService::PropertySet
+ {
+ boolean lock();
+ void unlock();
+
+ void stop();
+ void start();
+ void destroy();
+
+ /// Default is a nil object reference
+ attribute AVStreams::StreamEndPoint related_sep;
+ attribute FlowConnection related_flow_connection;
+
+ FlowEndPoint get_connected_fep()
+ raises (notConnected,AVStreams::notSupported);
+
+ /// syntax of fp_name is <flowProtocol>
+ boolean use_flow_protocol(in string fp_name,
+ in any fp_settings)
+ raises (AVStreams::FPError, AVStreams::notSupported);
+
+ /// set_format() initializes ëformatí
+ /// as current media format e.g. MPEG.
+ void set_format(in string format)
+ raises (AVStreams::notSupported);
+
+ void set_dev_params(in CosPropertyService::Properties new_settings)
+ // raises (CosPropertyService::PropertyException, AVStreams::streamOpFailed);
+ raises (PropertyException, AVStreams::streamOpFailed);
+
+ void set_protocol_restriction(in AVStreams::protocolSpec the_spec)
+ raises (AVStreams::notSupported);
+
+ boolean is_fep_compatible(in FlowEndPoint fep)
+ raises (formatMismatch, deviceQosMismatch);
+
+ boolean set_peer(in FlowConnection the_fc,
+ in FlowEndPoint the_peer_fep,
+ inout AVStreams::QoS the_qos)
+ raises (AVStreams::QoSRequestFailed,
+ AVStreams::streamOpFailed);
+
+ boolean set_Mcast_peer(in FlowConnection the_fc,
+ in AVStreams::MCastConfigIf a_mcastconfigif,
+ inout AVStreams::QoS the_qos)
+ raises (AVStreams::QoSRequestFailed);
+
+ boolean connect_to_peer(inout AVStreams::QoS the_qos,
+ in string address,
+ in string use_flow_protocol) // syntax <flowProtocol>
+ raises(failedToConnect,AVStreams::FPError, AVStreams::QoSRequestFailed);
+
+ /// Needs to know its peer to choose its protocol correctly
+ /// Also to ask for a reverse channel for credit-based flow
+ /// control, if one is required
+ string go_to_listen(inout AVStreams::QoS the_qos,
+ in boolean is_mcast,
+ in FlowEndPoint peer,
+ inout string flowProtocol)// syntax <flowProtocol>
+ // The out value of flowProtocol contains SFP version
+ // supported and all options including "Credit".
+ raises(failedToListen, AVStreams::FPError,
+ AVStreams::QoSRequestFailed);
+ };
+
+ interface FlowProducer : FlowEndPoint
+ {
+ string connect_mcast(inout AVStreams::QoS the_qos,
+ out boolean is_met,
+ in string address,
+ in string use_flow_protocol)
+ raises (failedToConnect,
+ AVStreams::notSupported,
+ AVStreams::FPError,
+ AVStreams::QoSRequestFailed);
+
+ string get_rev_channel(in string pcol_name);
+ void set_key(in AVStreams::key the_key);
+ void set_source_id(in long source_id);
+ };
+
+ interface FlowConsumer : FlowEndPoint
+ {
+ };
+
+ interface FDev : CosPropertyService::PropertySet {
+ FlowProducer create_producer(in FlowConnection the_requester,
+ inout AVStreams::QoS the_qos,
+ out boolean met_qos,
+ inout string named_fdev)
+ raises(AVStreams::streamOpFailed,
+ AVStreams::streamOpDenied,
+ AVStreams::notSupported,
+ AVStreams::QoSRequestFailed);
+
+ FlowConsumer create_consumer(in FlowConnection the_requester,
+ inout AVStreams::QoS the_qos,
+ out boolean met_qos,
+ inout string named_fdev)
+ raises(AVStreams::streamOpFailed,
+ AVStreams::streamOpDenied,
+ AVStreams::notSupported,
+ AVStreams::QoSRequestFailed);
+
+ FlowConnection bind(in FDev peer_device,
+ inout AVStreams::QoS the_qos,
+ out boolean is_met)
+ raises (AVStreams::streamOpFailed,
+ AVStreams::QoSRequestFailed);
+
+ FlowConnection bind_mcast(in FDev first_peer,
+ inout AVStreams::QoS the_qos,
+ out boolean is_met)
+ raises (AVStreams::streamOpFailed,
+ AVStreams::QoSRequestFailed);
+
+ void destroy(in FlowEndPoint the_ep, in string fdev_name)
+ // ie FDev not found
+ raises (AVStreams::notSupported);
+ };
+
+ enum PositionOrigin {
+ AbsolutePosition, RelativePosition, ModuloPosition
+ };
+
+ enum PositionKey {
+ ByteCount, SampleCount, MediaTime
+ };
+
+ struct Position {
+ PositionOrigin origin;
+ PositionKey key;
+ long value;
+ };
+
+ exception PostionKeyNotSupported { PositionKey key;};
+ exception InvalidPosition { PositionKey key;};
+
+ /**
+ * @interface MediaControl
+ * @brief MediaControl interface is similar to ControlledStream
+ * interface in MSS. It can be inherited by flow endpoints or
+ * FlowConnection interfaces.
+ */
+ interface MediaControl{
+
+ exception PostionKeyNotSupported { PositionKey key;};
+
+ Position get_media_position(in PositionOrigin an_origin,
+ in PositionKey a_key)
+ raises (PostionKeyNotSupported);
+
+ void set_media_position(in Position a_position)
+ raises (PostionKeyNotSupported, InvalidPosition);
+
+ void start(in Position a_position)
+ raises(InvalidPosition);
+ void pause(in Position a_position)
+ raises(InvalidPosition);
+ void resume(in Position a_position)
+ raises(InvalidPosition);
+ void stop(in Position a_position)
+ raises(InvalidPosition);
+ };
+
+ // Additional sequences needed for the properties.
+
+ typedef sequence<FlowConnection> FlowConnection_seq;
+ typedef sequence<StreamEndPoint_A> StreamEndPoint_A_seq;
+ typedef sequence<StreamEndPoint_B> StreamEndPoint_B_seq;
+ typedef sequence<FlowEndPoint> FlowEndPoint_seq;
+ typedef sequence<Object> Object_seq;
+};
+
+#endif /* TAO_AV_STREAMS_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/CSI.idl b/TAO/orbsvcs/orbsvcs/CSI.idl
new file mode 100644
index 00000000000..bf19d332c1e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CSI.idl
@@ -0,0 +1,201 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file CSI.idl
+ *
+ * $Id$
+ *
+ * @author Object Management Group
+ */
+//=============================================================================
+
+
+#ifndef _CSI_IDL_
+#define _CSI_IDL_
+
+// #include <IOP.idl>
+#include "tao/IOP_IOR.pidl"
+
+module IOP
+{
+ const ServiceId SecurityAttributeService = 15;
+};
+
+module CSI {
+ typeprefix CSI "omg.org";
+
+ // The OMG VMCID; same value as CORBA::OMGVMCID. Do not change ever.
+ const unsigned long OMGVMCID = 0x4F4D0;
+
+ // An X509CertificateChain contains an ASN.1 BER encoded SEQUENCE
+ // [1..MAX] OF X.509 certificates encapsulated in a sequence of octets. The
+ // subject's certificate shall come first in the list. Each following
+ // certificate shall directly certify the one preceding it. The ASN.1
+ // representation of Certificate is as defined in [IETF RFC 2459].
+ typedef sequence <octet> X509CertificateChain;
+
+ // an X.501 type name or Distinguished Name encapsulated in a sequence of
+ // octets containing the ASN.1 encoding.
+ typedef sequence <octet> X501DistinguishedName;
+
+ // UTF-8 Encoding of String
+ typedef sequence <octet> UTF8String;
+
+ // ASN.1 Encoding of an OBJECT IDENTIFIER
+ typedef sequence <octet> OID;
+ typedef sequence <OID> OIDList;
+
+ // A sequence of octets containing a GSStoken. Initial context tokens are
+ // ASN.1 encoded as defined in [IETF RFC 2743] Section 3.1,
+ // "Mechanism-Independent token Format", pp. 81-82. Initial context tokens
+ // contain an ASN.1 tag followed by a token length, a mechanism identifier,
+ // and a mechanism-specific token (i.e. a GSSUP::InitialContextToken). The
+ // encoding of all other GSS tokens (e.g. error tokens and final context
+ // tokens) is mechanism dependent.
+ typedef sequence <octet> GSSToken;
+
+ // An encoding of a GSS Mechanism-Independent Exported Name Object as
+ // defined in [IETF RFC 2743] Section 3.2, "GSS Mechanism-Independent
+ // Exported Name Object Format," p. 84.
+ typedef sequence <octet> GSS_NT_ExportedName;
+ typedef sequence <GSS_NT_ExportedName> GSS_NT_ExportedNameList;
+
+ // The MsgType enumeration defines the complete set of service context
+ // message types used by the CSI context management protocols, including
+ // those message types pertaining only to the stateful application of the
+ // protocols (to insure proper alignment of the identifiers between
+ // stateless and stateful implementations). Specifically, the
+ // MTMessageInContext is not sent by stateless clients (although it may
+ // be received by stateless targets).
+ typedef short MsgType;
+
+ const MsgType MTEstablishContext = 0;
+ const MsgType MTCompleteEstablishContext = 1;
+ const MsgType MTContextError = 4;
+ const MsgType MTMessageInContext = 5;
+
+ // The ContextId type is used carry session identifiers. A stateless
+ // application of the service context protocol is indicated by a session
+ // identifier value of 0.
+ typedef unsigned long long ContextId;
+
+ // The AuthorizationElementType defines the contents and encoding of
+ // the_element field of the AuthorizationElement.
+ // The high order 20-bits of each AuthorizationElementType constant
+ // shall contain the Vendor Minor Codeset ID (VMCID) of the
+ // organization that defined the element type. The low order 12 bits
+ // shall contain the organization-scoped element type identifier. The
+ // high-order 20 bits of all element types defined by the OMG shall
+ // contain the VMCID allocated to the OMG (that is, 0x4F4D0).
+ typedef unsigned long AuthorizationElementType;
+
+ // An AuthorizationElementType of X509AttributeCertChain indicates
+ // that the_element field of the AuthorizationElement contains an
+ // ASN.1 BER SEQUENCE composed of an (X.509) AttributeCertificate
+ // followed by a SEQUENCE OF (X.509) Certificate. The two-part
+ // SEQUENCE is encapsulated in an octet stream. The chain of
+ // identity certificates is provided to certify the attribute
+ // certificate. Each certificate in the chain shall directly certify
+ // the one preceding it. The first certificate in the chain shall
+ // certify the attribute certificate. The ASN.1 representation of
+ // (X.509) Certificate is as defined in [IETF RFC 2459]. The ASN.1
+ // representation of (X.509) AttributeCertificate is as defined in
+ // [IETF ID PKIXAC].
+ const AuthorizationElementType X509AttributeCertChain = OMGVMCID | 1;
+
+ typedef sequence <octet> AuthorizationElementContents;
+
+ // The AuthorizationElement contains one element of an authorization token.
+ // Each element of an authorization token is logically a PAC.
+ struct AuthorizationElement {
+ AuthorizationElementType the_type;
+ AuthorizationElementContents the_element;
+ };
+
+ // The AuthorizationToken is made up of a sequence of
+ // AuthorizationElements
+ typedef sequence <AuthorizationElement> AuthorizationToken;
+ typedef unsigned long IdentityTokenType;
+
+ // Additional standard identity token types shall only be defined by the
+ // OMG. All IdentityTokenType constants shall be a power of 2.
+ const IdentityTokenType ITTAbsent = 0;
+ const IdentityTokenType ITTAnonymous = 1;
+ const IdentityTokenType ITTPrincipalName = 2;
+ const IdentityTokenType ITTX509CertChain = 4;
+ const IdentityTokenType ITTDistinguishedName = 8;
+
+ typedef sequence <octet> IdentityExtension;
+
+ union IdentityToken switch ( IdentityTokenType ) {
+ case ITTAbsent: boolean absent;
+ case ITTAnonymous: boolean anonymous;
+ case ITTPrincipalName: GSS_NT_ExportedName principal_name;
+ case ITTX509CertChain: X509CertificateChain certificate_chain;
+ case ITTDistinguishedName: X501DistinguishedName dn;
+ default: IdentityExtension id;
+ };
+
+ struct EstablishContext {
+ ContextId client_context_id;
+ AuthorizationToken authorization_token;
+ IdentityToken identity_token;
+ GSSToken client_authentication_token;
+ };
+
+ struct CompleteEstablishContext {
+ ContextId client_context_id;
+ boolean context_stateful;
+ GSSToken final_context_token;
+ };
+
+ struct ContextError {
+ ContextId client_context_id;
+ long major_status;
+ long minor_status;
+ GSSToken error_token;
+ };
+
+ // Not sent by stateless clients. If received by a stateless server, a
+ // ContextError message should be returned, indicating the session does
+ // not exist.
+ struct MessageInContext {
+ ContextId client_context_id;
+ boolean discard_context;
+ };
+
+ union SASContextBody switch ( MsgType ) {
+ case MTEstablishContext: EstablishContext establish_msg;
+ case MTCompleteEstablishContext: CompleteEstablishContext
+ complete_msg;
+ case MTContextError: ContextError error_msg;
+ case MTMessageInContext: MessageInContext in_context_msg;
+ };
+
+ // The following type represents the string representation of an ASN.1
+ // OBJECT IDENTIFIER (OID). OIDs are represented by the string "oid:"
+ // followed by the integer base 10 representation of the OID separated
+ // by dots. For example, the OID corresponding to the OMG is represented
+ // as: "oid:2.23.130"
+ typedef string StringOID;
+
+ // The GSS Object Identifier for the KRB5 mechanism is:
+ // { iso(1) member-body(2) United States(840) mit(113554) infosys(1)
+ // gssapi(2) krb5(2) }
+ const StringOID KRB5MechOID = "oid:1.2.840.113554.1.2.2";
+
+ // The GSS Object Identifier for name objects of the Mechanism-independent
+ // Exported Name Object type is:
+ // { iso(1) org(3) dod(6) internet(1) security(5) nametypes(6)
+ // gss-api-exported-name(4) }
+ const StringOID GSS_NT_Export_Name_OID = "oid:1.3.6.1.5.6.4";
+
+ // The GSS Object Identifier for the scoped-username name form is:
+ // { iso-itu-t (2) international-organization (23) omg (130) security (1)
+ // naming (2) scoped-username(1) }
+ const StringOID GSS_NT_Scoped_Username_OID = "oid:2.23.130.1.2.1";
+
+}; // CSI
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/CSIIOP.idl b/TAO/orbsvcs/orbsvcs/CSIIOP.idl
new file mode 100644
index 00000000000..548ddb0f76d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CSIIOP.idl
@@ -0,0 +1,153 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file CSIIOP.idl
+ *
+ * $Id$
+ *
+ * @author Object Management Group
+ */
+//=============================================================================
+
+#ifndef _CSIIOP_IDL_
+#define _CSIIOP_IDL_
+
+//#include <tao/IOP.pidl>
+#include "tao/IOP_IOR.pidl"
+#include "CSI.idl"
+//import ::IOP
+//import ::CSI
+
+module IOP
+{
+ const ComponentId TAG_CSI_SEC_MECH_LIST = 33;
+ const ComponentId TAG_NULL_TAG = 34;
+ const ComponentId TAG_SECIOP_SEC_TRANS = 35;
+ const ComponentId TAG_TLS_SEC_TRANS = 36;
+};
+
+module CSIIOP {
+ typeprefix CSIIOP "omg.org";
+
+ // Association options
+ typedef unsigned short AssociationOptions;
+
+ const AssociationOptions NoProtection = 1;
+ const AssociationOptions Integrity = 2;
+ const AssociationOptions Confidentiality = 4;
+ const AssociationOptions DetectReplay = 8;
+ const AssociationOptions DetectMisordering = 16;
+ const AssociationOptions EstablishTrustInTarget = 32;
+ const AssociationOptions EstablishTrustInClient = 64;
+ const AssociationOptions NoDelegation = 128;
+ const AssociationOptions SimpleDelegation = 256;
+ const AssociationOptions CompositeDelegation = 512;
+ const AssociationOptions IdentityAssertion = 1024;
+ const AssociationOptions DelegationByClient = 2048;
+
+ // The high order 20-bits of each ServiceConfigurationSyntax constant
+ // shall contain the Vendor Minor Codeset ID (VMCID) of the
+ // organization that defined the syntax. The low order 12 bits shall
+ // contain the organization-scoped syntax identifier. The high-order 20
+ // bits of all syntaxes defined by the OMG shall contain the VMCID
+ // allocated to the OMG (that is, 0x4F4D0).
+ typedef unsigned long ServiceConfigurationSyntax;
+
+ const ServiceConfigurationSyntax SCS_GeneralNames = CSI::OMGVMCID | 0;
+ const ServiceConfigurationSyntax SCS_GSSExportedName = CSI::OMGVMCID | 1;
+
+ typedef sequence <octet> ServiceSpecificName;
+
+ // The name field of the ServiceConfiguration structure identifies a
+ // privilege authority in the format identified in the syntax field. If the
+ // syntax is SCS_GeneralNames, the name field contains an ASN.1 (BER)
+ // SEQUENCE [1..MAX] OF GeneralName, as defined by the type GeneralNames in
+ // [IETF RFC 2459]. If the syntax is SCS_GSSExportedName, the name field
+ // contains a GSS exported name encoded according to the rules in
+ // [IETF RFC 2743] Section 3.2, "Mechanism-Independent Exported Name
+ // Object Format," p. 84.
+
+ struct ServiceConfiguration {
+ ServiceConfigurationSyntax syntax;
+ ServiceSpecificName name;
+ };
+
+ typedef sequence <ServiceConfiguration> ServiceConfigurationList;
+
+ // The body of the TAG_NULL_TAG component is a sequence of octets of
+ // length 0.
+
+ // type used to define AS layer functionality within a compound mechanism
+ // definition
+
+ struct AS_ContextSec {
+ AssociationOptions target_supports;
+ AssociationOptions target_requires;
+ CSI::OID client_authentication_mech;
+ CSI::GSS_NT_ExportedName target_name;
+ };
+
+ // type used to define SAS layer functionality within a compound mechanism
+ // definition
+
+ struct SAS_ContextSec {
+ AssociationOptions target_supports;
+ AssociationOptions target_requires;
+ ServiceConfigurationList privilege_authorities;
+ CSI::OIDList supported_naming_mechanisms;
+ CSI::IdentityTokenType supported_identity_types;
+ };
+
+ // type used in the body of a TAG_CSI_SEC_MECH_LIST component to
+ // describe a compound mechanism
+
+ struct CompoundSecMech {
+ AssociationOptions target_requires;
+ IOP::TaggedComponent transport_mech;
+ AS_ContextSec as_context_mech;
+ SAS_ContextSec sas_context_mech;
+ };
+
+ typedef sequence <CompoundSecMech> CompoundSecMechanisms;
+
+ // type corresponding to the body of a TAG_CSI_SEC_MECH_LIST
+ // component
+
+ struct CompoundSecMechList {
+ boolean stateful;
+ CompoundSecMechanisms mechanism_list;
+ };
+
+ struct TransportAddress {
+ string host_name;
+ unsigned short port;
+ };
+
+ typedef sequence <TransportAddress> TransportAddressList;
+
+ // Tagged component for configuring SECIOP as a CSIv2 transport mechanism
+
+ const IOP::ComponentId TAG_SECIOP_SEC_TRANS = 35;
+
+ struct SECIOP_SEC_TRANS {
+ AssociationOptions target_supports;
+ AssociationOptions target_requires;
+ CSI::OID mech_oid;
+ CSI::GSS_NT_ExportedName target_name;
+ TransportAddressList addresses;
+ };
+
+ // tagged component for configuring TLS/SSL as a CSIv2 transport mechanism
+
+ const IOP::ComponentId TAG_TLS_SEC_TRANS = 36;
+
+ struct TLS_SEC_TRANS {
+ AssociationOptions target_supports;
+ AssociationOptions target_requires;
+ TransportAddressList addresses;
+ };
+
+}; //CSIIOP
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/Channel_Clients_T.cpp b/TAO/orbsvcs/orbsvcs/Channel_Clients_T.cpp
new file mode 100644
index 00000000000..80eeaf1d7ac
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Channel_Clients_T.cpp
@@ -0,0 +1,41 @@
+// $Id$
+
+#ifndef ACE_CHANNEL_CLIENTS_T_CPP
+#define ACE_CHANNEL_CLIENTS_T_CPP
+
+#include "orbsvcs/Channel_Clients_T.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/Channel_Clients_T.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class TARGET> void
+ACE_PushConsumer_Adapter<TARGET>::push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ target_->push (events ACE_ENV_ARG_PARAMETER);
+}
+
+template<class TARGET> void
+ACE_PushConsumer_Adapter<TARGET>::disconnect_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ target_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+template<class TARGET> void
+ACE_PushSupplier_Adapter<TARGET>::disconnect_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ target_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_CHANNEL_CLIENTS_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Channel_Clients_T.h b/TAO/orbsvcs/orbsvcs/Channel_Clients_T.h
new file mode 100644
index 00000000000..10071d978ea
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Channel_Clients_T.h
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// ace
+//
+// = FILENAME
+// Channel_Clients_T
+//
+// = AUTHOR
+// Tim Harrison (harrison@cs.wustl.edu) and
+// Douglas Schmidt (schmidt@cs.wustl.edu)
+//
+// = DESCRIPTION
+// These classes allow applications to be consumer, suppliers, and
+// consumer suppliers, as well as being active objects. This is
+// accomplished with adapters to prevent the use of multiple
+// inheritence (which is this root of all evil.)
+//
+// ============================================================================
+
+#ifndef ACE_CHANNEL_CLIENTS_T_H
+#define ACE_CHANNEL_CLIENTS_T_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventCommS.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ACE_PushConsumer_Adapter
+ *
+ * @brief ACE Push Consumer Adapter
+ *
+ * Forwards all calls to the target_.
+ */
+template <class TARGET>
+class ACE_PushConsumer_Adapter : public POA_RtecEventComm::PushConsumer
+{
+public:
+ /// Forwards all calls to @a target.
+ ACE_PushConsumer_Adapter (TARGET *target);
+
+ /// Forwards to target_.
+ virtual void push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC (( CORBA::SystemException));
+
+ /// Forwards to target_.
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC (( CORBA::SystemException));
+
+private:
+ TARGET *target_;
+};
+
+// ************************************************************
+
+/**
+ * @class ACE_PushSupplier_Adapter
+ *
+ * @brief ACE Push Supplier Adapter
+ *
+ * Forwards all calls to disconnect_push_supplier to the target_.
+ */
+template <class TARGET>
+class ACE_PushSupplier_Adapter : public POA_RtecEventComm::PushSupplier
+{
+public:
+ /// Forwards all calls to <owner>.
+ ACE_PushSupplier_Adapter (TARGET *target);
+
+ /// Forwards to target_.
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC (( CORBA::SystemException));
+
+private:
+ TARGET *target_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Channel_Clients_T.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Channel_Clients_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Channel_Clients_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_CHANNEL_CLIENTS_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Channel_Clients_T.i b/TAO/orbsvcs/orbsvcs/Channel_Clients_T.i
new file mode 100644
index 00000000000..3c21f6c9bb2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Channel_Clients_T.i
@@ -0,0 +1,19 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class TARGET> ACE_INLINE
+ACE_PushConsumer_Adapter<TARGET>::ACE_PushConsumer_Adapter (TARGET *t)
+ : target_ (t)
+{
+}
+
+template<class TARGET> ACE_INLINE
+ACE_PushSupplier_Adapter<TARGET>::ACE_PushSupplier_Adapter (TARGET *t)
+ : target_ (t)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Concurrency/CC_Lock.cpp b/TAO/orbsvcs/orbsvcs/Concurrency/CC_Lock.cpp
new file mode 100644
index 00000000000..3e62837cfdb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Concurrency/CC_Lock.cpp
@@ -0,0 +1,246 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/Concurrency_Service
+//
+// = FILENAME
+// CC_Lock.cpp
+//
+// = DESCRIPTION
+// This class implements a lock used by the lock set from the
+// concurrency control service.
+//
+// = AUTHORS
+// Torben Worm <tworm@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Concurrency/CC_Lock.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID (Concurrency,
+ CC_Lock,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+CC_Lock::CC_Lock (void)
+ : mode_ (CosConcurrencyControl::intention_read),
+ lock_held_ (0)
+{
+}
+
+CC_Lock::CC_Lock (CosConcurrencyControl::lock_mode mode)
+ : mode_ (mode),
+ lock_held_ (0)
+{
+}
+
+CC_Lock::~CC_Lock (void)
+{
+}
+
+void
+CC_Lock::lock (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "CC_Lock::lock\n"));
+ lock_held_++;
+}
+
+CORBA::Boolean
+CC_Lock::try_lock (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "CC_Lock::try_lock. "));
+
+ lock_held_++;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "lock_held_: %i, ",
+ lock_held_));
+
+ int success = 0;//semaphore_.tryacquire ();
+
+ ACE_DEBUG ((LM_DEBUG,
+ "success: %i\n", success));
+
+ if (success == -1)
+ {
+ if (errno == EBUSY)
+ {
+ lock_held_--;
+ return 0;
+ }
+ else
+ ACE_THROW_RETURN (CORBA::INTERNAL (),
+ 0);
+ }
+ ACE_DEBUG ((LM_DEBUG,
+ "lock_held_: %i, ",
+ lock_held_));
+
+ return 1;
+}
+
+void
+CC_Lock::unlock (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "CC_Lock::unlock\n"));
+ if (lock_held_ == 0)
+ ACE_THROW (CosConcurrencyControl::LockNotHeld ());
+
+ int success = 0; //semaphore_.release ();
+
+ if (success == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+
+ lock_held_--;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "lock_held_: %i, ",
+ lock_held_));
+}
+
+void
+CC_Lock::change_mode (CosConcurrencyControl::lock_mode new_mode
+ ACE_ENV_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "CC_Lock::change_mode\n"));
+
+ // @@TAO Hmmm, we cannot really do anything at present since there
+ // is only one lock per lock set and that lock is essentially a
+ // write lock
+
+ if (lock_held_ == 0)
+ ACE_THROW (CosConcurrencyControl::LockNotHeld ());
+
+ this->mode_ = new_mode;
+}
+
+void
+CC_Lock::set_mode (CosConcurrencyControl::lock_mode mode)
+{
+ this->mode_ = mode;
+}
+
+CORBA::Boolean
+CC_Lock::Compatible (const CC_Lock &other)
+{
+ return this->Compatible (other.mode_);
+}
+
+CORBA::Boolean
+CC_Lock::Compatible (CosConcurrencyControl::lock_mode mode)
+{
+ return compatible_[this->mode_][mode];
+}
+
+CosConcurrencyControl::lock_mode
+CC_Lock::GetMode (void)
+{
+ return mode_;
+}
+
+int
+CC_Lock::GetLocksHeld (void)
+{
+ return this->lock_held_;
+}
+
+void
+CC_Lock::DecLocksHeld (void)
+{
+ this->lock_held_--;
+}
+
+void
+CC_Lock::dump (void)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "mode_ %i, lock_held_: %i\n",
+ mode_,
+ lock_held_));
+}
+
+// The check of compatibility is a hard coded table statically
+// allocated. This table must be changed if the number of lock modes
+// or their compatibility are changed. The table here looks different
+// from the table in the spec, this is due to the different ordering
+// of the lock modes in the table and in the enum in the IDL. The
+// first index in the array is the mode held by this lock and the
+// second index is the requested mode.
+// Requested mode
+// Held mode R W U IR IW
+// R X X
+// W X X X X X
+// U X X X X = conflict
+// IR X
+// IW X X X
+//
+CORBA::Boolean CC_Lock::compatible_[NUMBER_OF_LOCK_MODES][NUMBER_OF_LOCK_MODES] ={
+ {1, 0, 1, 1, 0},
+ {0, 0, 0, 0, 0},
+ {1, 0, 0, 1, 0},
+ {1, 0, 1, 1, 1},
+ {0, 0, 0, 1, 1}};
+
+// CC_LockModeterator
+
+CC_LockModeIterator::CC_LockModeIterator (void)
+ : current_ (CosConcurrencyControl::intention_read)
+{
+}
+
+CC_LockModeIterator::~CC_LockModeIterator (void)
+{
+ // Do nothing
+}
+void CC_LockModeIterator::First (void)
+{
+ current_ = CosConcurrencyControl::intention_read;
+}
+
+void CC_LockModeIterator::Next (ACE_ENV_SINGLE_ARG_DECL)
+{
+ switch (current_)
+ {
+ case CosConcurrencyControl::intention_read:
+ current_ = CosConcurrencyControl::read;
+ break;
+ case CosConcurrencyControl::read:
+ current_ = CosConcurrencyControl::upgrade;
+ break;
+ case CosConcurrencyControl::upgrade:
+ current_ = CosConcurrencyControl::intention_write;
+ break;
+ case CosConcurrencyControl::intention_write:
+ current_ = CosConcurrencyControl::write;
+ break;
+ case CosConcurrencyControl::write:
+ ACE_THROW (CORBA::INTERNAL ());
+ default:
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+}
+
+CORBA::Boolean
+CC_LockModeIterator::IsDone (void)
+{
+ if (current_ == CosConcurrencyControl::write)
+ return 1;
+ else
+ return 0;
+}
+
+CosConcurrencyControl::lock_mode
+CC_LockModeIterator::GetLockMode (void)
+{
+ return current_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Concurrency/CC_Lock.h b/TAO/orbsvcs/orbsvcs/Concurrency/CC_Lock.h
new file mode 100644
index 00000000000..622f973a9df
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Concurrency/CC_Lock.h
@@ -0,0 +1,148 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CC_Lock.h
+ *
+ * $Id$
+ *
+ * This class implements a lock used by the lock set from the
+ * concurrency control service
+ *
+ *
+ * @author Torben Worm <tworm@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef _CC_LOCK_H
+#define _CC_LOCK_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/CosConcurrencyControlC.h"
+#include "orbsvcs/Concurrency/concurrency_serv_export.h"
+
+/// This constant defines the number of lock modes. There is really no
+/// way to set this constant dynamically because the nuber of lock
+/// modes are not stated as part of the IDL.
+#define NUMBER_OF_LOCK_MODES 5
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class CC_Lock
+ *
+ * @brief CC_Lock
+ *
+ * This class implements the lock concept from the concurrency
+ * control service. The lock holds its mode - this might later
+ * be changed to subclasses depending on the differences of the
+ * locks. At present the is only a lock-pr-thread/client-type
+ * which is essentially a write lock since it is not allowed to
+ * have more than one lock pr. servant in this implementation.
+ */
+class TAO_Concurrency_Serv_Export CC_Lock
+{
+public:
+ /// Creates the lock with mode = intention_read (weakest)
+ CC_Lock (void);
+
+ /// Creates the lock with the desired mode
+ CC_Lock (CosConcurrencyControl::lock_mode mode);
+
+ /// Deletes the lock
+ ~CC_Lock (void);
+
+ /// Acquires this lock. Blocks until lock is obtained
+ void lock (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Tries to acquire this lock. If it is not possible to acquire the
+ /// lock, false is returned
+ CORBA::Boolean try_lock (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Releases this lock.
+ void unlock (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Changes the mode of this lock.
+ void change_mode (CosConcurrencyControl::lock_mode new_mode
+ ACE_ENV_ARG_DECL);
+
+ /// Sets the mode_ of the lock. Used in initialization
+ void set_mode (CosConcurrencyControl::lock_mode mode);
+
+ /// Returns true if this lock is compatible with the other lock.
+ CORBA::Boolean Compatible (const CC_Lock &other);
+
+ /// Returns true is this lock is compatible with the referenced mode.
+ CORBA::Boolean Compatible (CosConcurrencyControl::lock_mode mode);
+
+ /// Returns the mode of the lock.
+ CosConcurrencyControl::lock_mode GetMode (void);
+
+ /// Returns the number of times this lock have been locked
+ int GetLocksHeld(void);
+
+ /// Decrements the number of locks held in this mode. Used by change_mode.
+ void DecLocksHeld(void);
+
+ /// Dumps the state of the object to stdout
+ void dump(void);
+
+protected:
+ /// Holds the lock's mode.
+ CosConcurrencyControl::lock_mode mode_;
+
+private:
+ /// If greater than zero the lock is held (that number of times).
+ int lock_held_;
+
+ /// Defines the compatibility of the locks.
+ static CORBA::Boolean compatible_[NUMBER_OF_LOCK_MODES][NUMBER_OF_LOCK_MODES];
+};
+
+/**
+ * @class CC_LockModeIterator
+ *
+ * @brief CC_LockModeIterator
+ *
+ * This class implements an iterator over the lock modes in
+ * order to make an ordered traversal over the locks from the
+ * weakest (intention read) to the strongest (write).
+ * Ordering: IR -> R -> U -> IW -> W
+ */
+class TAO_Concurrency_Serv_Export CC_LockModeIterator
+{
+public:
+ /// Default constructor
+ CC_LockModeIterator(void);
+
+ /// Destructor
+ ~CC_LockModeIterator(void);
+
+ /// Reset the iterator to the first element
+ void First(void);
+
+ /// Advance the iterator to the next element
+ /// Throws exception if out of range
+ void Next(ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Returns true if the iterator has reached the last element
+ CORBA::Boolean IsDone(void);
+
+ /// Get the current element
+ CosConcurrencyControl::lock_mode GetLockMode(void);
+
+private:
+ CosConcurrencyControl::lock_mode current_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* !defined (_CC_LOCK_H) */
diff --git a/TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSet.cpp b/TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSet.cpp
new file mode 100644
index 00000000000..91ef3d63be5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSet.cpp
@@ -0,0 +1,330 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// CC_LockSet.cpp
+//
+// = AUTHOR
+// Torben Worm <tworm@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Concurrency/CC_LockSet.h"
+
+ACE_RCSID (Concurrency,
+ CC_LockSet,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Default constructor.
+
+CC_LockSet::CC_LockSet (void)
+ : related_lockset_ (0)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->Init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CC_LockSet::CC_LockSet (void)");
+ }
+ ACE_ENDTRY;
+}
+
+// Constructor used to create related lock sets.
+
+CC_LockSet::CC_LockSet (CosConcurrencyControl::LockSet_ptr related)
+ : related_lockset_ (related)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->Init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CC_LockSet::CC_LockSet (...)");
+ }
+ ACE_ENDTRY;
+}
+
+// Initialization.
+
+void
+CC_LockSet::Init (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Set the mode of the statically allocated locks
+ lock_[CC_IR] = 0;
+ lock_[CC_R] = 0;
+ lock_[CC_U] = 0;
+ lock_[CC_IW] = 0;
+ lock_[CC_W] = 0;
+
+ // Acquire the semaphore in order to be able to put requests on hold
+ if (semaphore_.acquire () == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+}
+
+// Destructor
+
+CC_LockSet::~CC_LockSet (void)
+{
+}
+
+// Returns true if the requested lock mode is compatible with the
+// modes held. False otherwise.
+
+CORBA::Boolean CC_LockSet::compatible (CC_LockModeEnum mr)
+{
+ for (size_t i = CC_IR; i <= CC_W; i++)
+ if (this->lock_[i] > 0)
+ if (this->compatible_[i][mr] == 0)
+ return 0;
+
+ return 1;
+}
+
+// Locks the lock in the desired mode. Blocks until success.
+
+void
+CC_LockSet::lock (CosConcurrencyControl::lock_mode mode
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG, "CC_LockSet::lock\n"));
+
+ CC_LockModeEnum lm = lmconvert (mode);
+
+ // Check to see if the requested mode is compatible with the modes
+ // held so far. If not put the request on hold.
+
+ // @@ It's important to document somewhere that this code relies on
+ // the FIFO properties of ACE_Token!
+ if (this->lock_i (lm) == 1)
+ if (semaphore_.acquire () == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+}
+
+// Tries to lock. If it is not possible false is returned.
+
+CORBA::Boolean
+CC_LockSet::try_lock (CosConcurrencyControl::lock_mode mode
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CC_LockModeEnum lm = lmconvert (mode);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "CC_LockSet::try_lock\n"));
+
+ if (this->try_lock_i (lm) == 0)
+ return 0;
+ else
+ return 1;
+}
+
+// Converts the enum from the spec to the internally (ordered)
+// enum.
+
+CC_LockModeEnum
+CC_LockSet::lmconvert (CosConcurrencyControl::lock_mode mode)
+{
+ switch (mode)
+ {
+ case CosConcurrencyControl::intention_read:
+ return CC_IR;
+ case CosConcurrencyControl::read:
+ return CC_R;
+ case CosConcurrencyControl::upgrade:
+ return CC_U;
+ case CosConcurrencyControl::intention_write:
+ return CC_IW;
+ case CosConcurrencyControl::write:
+ return CC_W;
+ default:
+ return CC_EM;
+ }
+}
+
+// Unlock the lock
+
+void
+CC_LockSet::unlock (CosConcurrencyControl::lock_mode mode
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosConcurrencyControl::LockNotHeld))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "CC_LockSet::unlock\n"));
+
+ CC_LockModeEnum lm = lmconvert (mode);
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mlock_);
+
+ if (lock_[lm] == 0) // This lock is not held.
+ ACE_THROW (CosConcurrencyControl::LockNotHeld());
+ else
+ lock_[lm]--;
+
+ // If we do not have a lock held in a weaker mode than the
+ // strongest held and we have requests on the semaphore signal
+ // the semaphore.
+ while (lock_queue_.size () > 0)
+ {
+ CC_LockModeEnum lock_on_queue = CC_EM;
+
+ lock_queue_.dequeue_head (lock_on_queue);
+
+ if (compatible (lock_on_queue) == 1)
+ {
+ if (semaphore_.release () == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+ lock_[lock_on_queue]++;
+ }
+ else
+ {
+ lock_queue_.enqueue_head (lock_on_queue);
+ break;
+ }
+ }
+ this->dump ();
+}
+
+// Changes the mode of a held lock.
+
+void
+CC_LockSet::change_mode (CosConcurrencyControl::lock_mode held_mode,
+ CosConcurrencyControl::lock_mode new_mode
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosConcurrencyControl::LockNotHeld))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "CC_LockSet::change_mode\n"));
+ CC_LockModeEnum lm_held = lmconvert (held_mode);
+ CC_LockModeEnum lm_new = lmconvert (new_mode);
+
+ if (this->lock_held (lm_held) == 0) // This lock is not held
+ ACE_THROW (CosConcurrencyControl::LockNotHeld());
+ else if (this->change_mode_i (lm_held, lm_new)==1)
+ {
+ this->unlock (held_mode ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (semaphore_.acquire () == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+ // this->dump ();
+}
+
+int
+CC_LockSet::lock_i (CC_LockModeEnum lm)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mlock_, 1);
+ // If the lock is not compatible with the locks we hold allready or
+ // there is lock requests in the queue we cannot grant the lock and
+ // thus we queue the request. Otherwise update the lock count.
+ if (compatible (lm) == 0 || lock_queue_.size () > 0)
+ {
+ // Put the lock mode in the queue
+ lock_queue_.enqueue_tail (lm);
+ this->dump ();
+ return 1; // Lock the semaphore.
+ }
+ else
+ lock_[lm]++;
+
+ this->dump ();
+ return 0;
+}
+
+int
+CC_LockSet::try_lock_i (CC_LockModeEnum lm)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mlock_, 1);
+ // If the lock we try is compatible with the locks we hold we just
+ // opdates the count. Otherwise we return false.
+ if (compatible (lm) == 0)
+ {
+ this->dump ();
+ return 0;
+ }
+ else
+ lock_[lm]++;
+
+ this->dump ();
+ return 1;
+}
+
+int
+CC_LockSet::change_mode_i (CC_LockModeEnum lm_held,
+ CC_LockModeEnum lm_new)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mlock_, 1);
+ // If the new mode is compatible with the modes we hold we change
+ // the counts for the two locks. If not we must queue the new
+ // request. We can decrement the count for the old mode without
+ // signalling the semaphore because we know we only check modes
+ // granted this far.
+
+ lock_[lm_held]--;
+
+ if (compatible (lm_new) == 1)
+ {
+ lock_[lm_new]++;
+ this->dump ();
+ return 0;
+ }
+ else
+ {
+ lock_[lm_held]++;
+ lock_queue_.enqueue_tail (lm_new);
+ this->dump ();
+ return 1;
+ }
+}
+
+int
+CC_LockSet::lock_held (CC_LockModeEnum lm)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mlock_, 1);
+ if (lock_[lm] > 0)
+ return 1;
+ else
+ return 0;
+}
+
+void
+CC_LockSet::dump (void)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "waiting_calls_: %i, IR: %i, R: %i, U: %i, IW: %i, W: %i\n",
+ lock_queue_.size (),
+ lock_[CC_IR],
+ lock_[CC_R],
+ lock_[CC_U],
+ lock_[CC_IW],
+ lock_[CC_W]));
+}
+
+CORBA::Boolean const
+CC_LockSet::compatible_[NUMBER_OF_LOCK_MODES][NUMBER_OF_LOCK_MODES] =
+ {
+ {1, 1, 1, 1, 0},
+ {1, 1, 1, 0, 0},
+ {1, 1, 0, 0, 0},
+ {1, 0, 0, 1, 0},
+ {0, 0, 0, 0, 0}
+ };
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSet.h b/TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSet.h
new file mode 100644
index 00000000000..1d01ebeef27
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSet.h
@@ -0,0 +1,199 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CC_LockSet.h
+ *
+ * $Id$
+ *
+ * This class implements the lock set interface from the
+ * concurrency service.
+ *
+ * In the present implementation the multiple possesion semantics
+ * is implemented for non-transactional clients. In future
+ * versions this should be changed because the multiple possesion
+ * semantics does not apply to non-transactional clients. This
+ * can be accomplished in the following manner:
+ * - Make a class with the same functiallity as the CC_LockSet
+ * class as a base class for both implementations.
+ * - The functionallity that should be separated out in the
+ * subclasses is the compatible function which should always
+ * return false because no locks can be held simultanously with
+ * non-transactional clients.
+ * - Use these classes from the classes that inherits the
+ * servant properties, i.e. the way CC_LockSet does now.
+ *
+ *
+ * @author Torben Worm <tworm@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef _CC_LOCKSET_H
+#define _CC_LOCKSET_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Thread_Mutex.h"
+#include "ace/Token.h"
+#include "ace/Unbounded_Queue.h"
+
+#include "orbsvcs/CosConcurrencyControlS.h"
+#include "orbsvcs/Concurrency/concurrency_serv_export.h"
+
+#if defined (lock_held)
+#undef lock_held
+#endif /* lock_held */
+
+/// This constant defines the number of lock modes. There is really no
+/// way to set this constant dynamically because the nuber of lock
+/// modes are not stated as part of the IDL.
+#define NUMBER_OF_LOCK_MODES 5
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Enummeration representing the lock modes. The incoming request is
+/// always converted to this representation. There are two reasons for
+/// this: Firstly the lock modes are ordered from weakest to strongest
+/// in the internal representation, and secondly it is possible to
+/// indicate a 'non-mode' (CC_EM)
+typedef enum {CC_EM=-1, CC_IR=0, CC_R, CC_U, CC_IW, CC_W} CC_LockModeEnum;
+
+/**
+ * @class CC_LockSet
+ *
+ * @brief CC_LockSet
+ *
+ * This class implements the LockSet interface that is part of
+ * the CosConcurrency service. Please consult the idl file for
+ * detailed descriptions apart from the comments in this file At
+ * present the lock set is not really a set, but only one lock.
+ */
+class TAO_Concurrency_Serv_Export CC_LockSet : public POA_CosConcurrencyControl::LockSet
+{
+public:
+
+ // = Initialization and termination methods.
+ /// Default constructor
+ CC_LockSet (void);
+
+ /// Constructor used if create_related is used to create the lock
+ /// set.
+ CC_LockSet (CosConcurrencyControl::LockSet_ptr related);
+
+ /// Destructor.
+ ~CC_LockSet (void);
+
+ // = CosConcurrencyControl methods
+ /// Acquires this lock. Blocks until lock is obtained
+ virtual void lock (CosConcurrencyControl::lock_mode mode
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Tries to acquire this lock. If it is not possible to acquire the
+ /// lock, false is returned
+ virtual CORBA::Boolean try_lock (CosConcurrencyControl::lock_mode mode
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Releases this lock.
+ virtual void unlock (CosConcurrencyControl::lock_mode mode
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosConcurrencyControl::LockNotHeld));
+
+ /// Changes the mode of this lock.
+ virtual void change_mode (CosConcurrencyControl::lock_mode held_mode,
+ CosConcurrencyControl::lock_mode new_mode
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosConcurrencyControl::LockNotHeld));
+
+ // = Debugging methods
+ /// Dump the state of the object to stdout
+ void dump (void);
+
+private:
+ /// Converts the CORBA specification's lock mode to the internal
+ /// representation
+ CC_LockModeEnum lmconvert (CosConcurrencyControl::lock_mode mode);
+
+ /// Initiatlizes the lock set array and acquires the initial
+ /// semaphore.
+ void Init (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Returns true if the held lock and the requested lock are compatible
+ CORBA::Boolean compatible (CC_LockModeEnum mr);
+
+ // The _i functions below ensures atomical access the the state data
+ // for the lock set. The functions acquires a thread lock in order
+ // to insure consistency within the lock set. The return value
+ // typically indicates whether the current thread should be
+ // suspended or not (by locking the semaphore.
+
+ /// Locks the access to the data and decides whether to lock or
+ /// not. Returns 1 if the semaphore should be locked.
+ int lock_i (CC_LockModeEnum lm);
+
+ // int unlock_i (CosConcurrencyControl::lock_mode lm);
+ // This function is not necessary because we lock access to the data
+ // and unlocks the semaphore until an invalid lock mode is first on
+ // the queue. Thereafter we release the lock.
+
+ /// Locks the access to the data and determines whether to return
+ /// true or false. Returns 1 if true should be returned.
+ int try_lock_i (CC_LockModeEnum lm);
+
+ /// Locks access to the data and determines if the semaphore should
+ /// be locked. Returns 1 if the semaphore should be locked.
+ int change_mode_i (CC_LockModeEnum lm_held,
+ CC_LockModeEnum lm_new);
+
+ /// Locks access ti the data and checks whether the lock is held.
+ int lock_held (CC_LockModeEnum lm);
+
+ /// An array of lock counters that counts how many locks of that type
+ /// that the lock set holds.
+ int lock_[NUMBER_OF_LOCK_MODES];
+
+ // ACE_Thread_Semaphore semaphore_;
+ /**
+ * This is the semaphore for the lock set. The semaphore is used to
+ * queue requests for locks in modes stronger than currently
+ * possible to grant. Note that the <ACE_Token> provides strict
+ * FIFO ordering of acquisition/release of the lock.
+ */
+ ACE_Token semaphore_;
+
+ /**
+ * If this lock set is related to another lock set, this is the
+ * pointer to the related lock set. This is a really simple
+ * solution, but since transactions are not supported in the first
+ * version there should be no reason to drop lock sets together. The
+ * <LockSetCoordinator> is not implemented (it has the
+ * responsibilities of dropping the locks).
+ */
+ CosConcurrencyControl::LockSet_ptr related_lockset_;
+
+ /// Mapping between requested and held lock modes. Used by compatible
+ /// (...). Uses the internal enumeration as indices.
+ static CORBA::Boolean const compatible_[NUMBER_OF_LOCK_MODES][NUMBER_OF_LOCK_MODES];
+
+ /// Lock to ensure that race conditions does not occur.
+ TAO_SYNCH_MUTEX mlock_;
+
+ /// Queue to hold the requested locks not yet granted.
+ ACE_Unbounded_Queue <CC_LockModeEnum> lock_queue_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* _CC_LOCKSET_H */
diff --git a/TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSetFactory.cpp b/TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSetFactory.cpp
new file mode 100644
index 00000000000..dfe17f3913a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSetFactory.cpp
@@ -0,0 +1,62 @@
+//=============================================================================
+/**
+ * @file CC_LockSetFactory.cpp
+ *
+ * $Id$
+ *
+ * @author Torben Worm <tworm@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#include "orbsvcs/Concurrency/CC_LockSetFactory.h"
+#include "orbsvcs/Concurrency/CC_LockSet.h"
+
+ACE_RCSID(Concurrency, CC_LockSetFactory, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Default constructor
+CC_LockSetFactory::CC_LockSetFactory (void)
+{
+}
+
+// Destructor.
+CC_LockSetFactory::~CC_LockSetFactory (void)
+{
+}
+
+CosConcurrencyControl::LockSet_ptr
+CC_LockSetFactory::create (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CC_LockSet *ls = 0;
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, CosConcurrencyControl::LockSet::_nil ());
+
+ ACE_NEW_THROW_EX (ls,
+ CC_LockSet,
+ CORBA::NO_MEMORY());
+ ACE_CHECK_RETURN (CosConcurrencyControl::LockSet::_nil ());
+
+ return ls->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosConcurrencyControl::LockSet_ptr
+CC_LockSetFactory::create_related (CosConcurrencyControl::LockSet_ptr which
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CC_LockSet *ls = 0;
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, CosConcurrencyControl::LockSet::_nil ());
+
+ ACE_NEW_THROW_EX (ls,
+ CC_LockSet (which),
+ CORBA::NO_MEMORY());
+ ACE_CHECK_RETURN (CosConcurrencyControl::LockSet::_nil ());
+
+ return ls->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSetFactory.h b/TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSetFactory.h
new file mode 100644
index 00000000000..6a02b8ed68d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Concurrency/CC_LockSetFactory.h
@@ -0,0 +1,68 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CC_LockSetFactory.h
+ *
+ * $Id$
+ *
+ * This class implements the lock set factory interface from the
+ * concurrency service.
+ *
+ *
+ * @author Torben Worm <tworm@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef _CC_LOCKSETFACTORY_H
+#define _CC_LOCKSETFACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosConcurrencyControlS.h"
+#include "orbsvcs/Concurrency/concurrency_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class CC_LockSetFactory
+ *
+ * @brief CC_LockSetFactory
+ *
+ * This class implements the LockSetFactory interface that is
+ * part of the CosConcurrency service. Please consult the idl
+ * file for detailed descriptions apart from the comments in
+ * this file.
+ */
+class TAO_Concurrency_Serv_Export CC_LockSetFactory
+ : public POA_CosConcurrencyControl::LockSetFactory
+{
+public:
+
+ // = Initialization and termination methods.
+ /// Default constructor.
+ CC_LockSetFactory (void);
+
+ /// Destructor.
+ ~CC_LockSetFactory (void);
+
+ virtual CosConcurrencyControl::LockSet_ptr create (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosConcurrencyControl::LockSet_ptr create_related (
+ CosConcurrencyControl::LockSet_ptr which
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// Lock to serialize the access to the factory.
+ TAO_SYNCH_MUTEX lock_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* _CC_LOCKSETFACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Loader.cpp b/TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Loader.cpp
new file mode 100644
index 00000000000..b12a3a41e57
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Loader.cpp
@@ -0,0 +1,88 @@
+// $Id$
+
+// ================================================================
+// LIBRARY
+// libTAO_CosConcurrency.so
+//
+// DESCRIPTION
+// This class allows for dynamically loading
+// the Concurrency Service.
+//
+// AUTHORS
+// Priyanka Gontla <pgontla@ece.uci.edu>
+// Jaiganesh Balasubramanian <jai@doc.ece.uci.edu>
+// ================================================================
+
+#include "orbsvcs/Concurrency/Concurrency_Loader.h"
+#include "ace/Dynamic_Service.h"
+
+ACE_RCSID (Concurrency, Concurrency_Loader, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Concurrency_Loader::TAO_Concurrency_Loader (void)
+{
+}
+
+TAO_Concurrency_Loader::~TAO_Concurrency_Loader (void)
+{
+}
+
+int
+TAO_Concurrency_Loader::init (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This function call initializes the Concurrency Service
+ CORBA::Object_var object =
+ this->create_object (orb.in (), argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // @@ Should we log this???
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+TAO_Concurrency_Loader::fini (void)
+{
+ // Remove the Concurrency Service.
+ this->concurrency_server_.fini();
+ return 0;
+}
+
+CORBA::Object_ptr
+TAO_Concurrency_Loader::create_object (CORBA::ORB_ptr orb,
+ int /* argc */,
+ char * /* argv */ []
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ return this->concurrency_server_.init (orb, poa.in ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_Concurrency_Serv, TAO_Concurrency_Loader)
diff --git a/TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Loader.h b/TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Loader.h
new file mode 100644
index 00000000000..b49ae60f6f8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Loader.h
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ===========================================================================
+// FILENAME
+// Concurrency_Loader.h
+//
+// DESCRIPTION
+// This class loads the Concurrency Service dynamically
+// either from svc.conf file or <string_to_object> call.
+//
+// AUTHORS
+// Jaiganesh Balasubramanian <jai@doc.ece.uci.edu>
+// Priyanka Gontla <pgontla<ece.uci.edu>
+//
+// ===========================================================================
+
+#ifndef TAO_CONCURRENCY_LOADER_H
+#define TAO_CONCURRENCY_LOADER_H
+
+#include "tao/Object_Loader.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Concurrency/Concurrency_Utils.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Concurrency_Serv_Export TAO_Concurrency_Loader : public TAO_Object_Loader
+{
+public:
+
+ /// Constructor
+ TAO_Concurrency_Loader (void);
+
+ /// Destructor
+ ~TAO_Concurrency_Loader (void);
+
+ /// Called by the Service Configurator framework to initialize the
+ /// Event Service. Defined in <ace/Service_Config.h>
+ virtual int init (int argc, char *argv[]);
+
+ /// Called by the Service Configurator framework to remove the
+ /// Event Service. Defined in <ace/Service_Config.h>
+ virtual int fini (void);
+
+ /// This function call initializes the Concurrency Service given a
+ /// reference to the ORB and the command line parameters.
+ CORBA::Object_ptr create_object (CORBA::ORB_ptr orb,
+ int argc, char *argv[]
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+ protected:
+ /// Instance of the TAO_Concurrency_Server
+ TAO_Concurrency_Server concurrency_server_;
+
+private:
+
+ // Disallow copying and assignment.
+ TAO_Concurrency_Loader (const TAO_Concurrency_Loader &);
+ TAO_Concurrency_Loader &operator = (const TAO_Concurrency_Loader &);
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DECLARE (TAO_Concurrency_Serv, TAO_Concurrency_Loader)
+
+#endif /* TAO_CONCURRENCY_LOADER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Utils.cpp b/TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Utils.cpp
new file mode 100644
index 00000000000..570cef2f20f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Utils.cpp
@@ -0,0 +1,126 @@
+//=============================================================================
+/**
+ * @file Concurrency_Utils.cpp
+ *
+ * $Id$
+ *
+ * @author Torben Worm <tworm@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#include "ace/streams.h"
+#include "orbsvcs/CosConcurrencyControlC.h"
+#include "tao/debug.h"
+#include "orbsvcs/Concurrency/Concurrency_Utils.h"
+
+ACE_RCSID (Concurrency,
+ Concurrency_Utils,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Default constructor
+TAO_Concurrency_Server::TAO_Concurrency_Server (void)
+{
+}
+
+// Constructor which takes an ORB and POA.
+TAO_Concurrency_Server::TAO_Concurrency_Server (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa)
+{
+ CORBA::Object_var obj = this->init (orb, poa);
+}
+
+// Function to initialize the concurrency server object under the
+// passed orb and poa.
+CORBA::Object_ptr
+TAO_Concurrency_Server::init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa)
+{
+ CORBA::Object_var obj;
+
+ ACE_TRY_NEW_ENV
+ {
+ // @@ Huh?!?
+
+ this->poa_= PortableServer::POA::_duplicate (poa);
+
+ // Get the naming context ptr to NameService.
+ // ACE_TRY_CHECK;
+
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId ("ConcurrencyService");
+
+ poa->activate_object_with_id (id.in (),
+ &this->lock_set_factory_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Stringify the objref we'll be implementing, and print it to
+ // stdout. Someone will take that string and give it to a
+ // client. Then release the object.
+ obj =
+ poa->id_to_reference (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var str =
+ orb->object_to_string (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "listening as object <%s>\n",
+ str.in ()));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Concurrency Service");
+ return CORBA::Object::_nil ();
+ }
+ ACE_ENDTRY;
+
+ return obj._retn ();
+}
+
+int
+TAO_Concurrency_Server::fini (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ PortableServer::ObjectId_var id =
+ this->poa_->servant_to_id (&this->lock_set_factory_);
+
+ this->poa_->deactivate_object (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("TAO_Concurrency_Server"));
+ }
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+CC_LockSetFactory *
+TAO_Concurrency_Server::GetLockSetFactory(void)
+{
+ return &this->lock_set_factory_;
+}
+
+TAO_Concurrency_Server::~TAO_Concurrency_Server (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Utils.h b/TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Utils.h
new file mode 100644
index 00000000000..bd2b7173f37
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Concurrency/Concurrency_Utils.h
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Concurrency_Utils.h
+ *
+ * $Id$
+ *
+ * This class implements a Concurrency Server wrapper class which
+ * holds a number of lock sets. The server must run in the
+ * thread per request concurrency model in order to let the
+ * clients block on the semaphores.
+ *
+ *
+ * @author Torben Worm <tworm@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef _CONCURRENCY_SERVER_H
+#define _CONCURRENCY_SERVER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosConcurrencyControlC.h"
+#include "orbsvcs/Concurrency/CC_LockSetFactory.h"
+#include "orbsvcs/Concurrency/concurrency_serv_export.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Concurrency_Server
+ *
+ * @brief Defines a wrapper class for the implementation of the
+ * concurrency server.
+ *
+ * This class takes an orb and Poa reference and activates the
+ * concurrency service lock set factory object under them.
+ */
+class TAO_Concurrency_Serv_Export TAO_Concurrency_Server
+{
+public:
+ // = Initialization and termination methods.
+ ///Default constructor.
+ TAO_Concurrency_Server (void);
+
+ /// Takes the POA under which to register the Concurrency Service
+ /// implementation object.
+ TAO_Concurrency_Server (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa);
+
+ /// Destructor.
+ ~TAO_Concurrency_Server (void);
+
+ /// Initialize the concurrency server under the given ORB and POA.
+ CORBA::Object_ptr init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa);
+
+ /// Cleanup resources.
+ int fini (void);
+
+ /// Get the lock set factory.
+ CC_LockSetFactory *GetLockSetFactory (void);
+
+private:
+ /// This is the lock set factory activated under the POA.
+ CC_LockSetFactory lock_set_factory_;
+
+ /// The POA which the lock set factory servant was registered.
+ PortableServer::POA_var poa_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* _CONCURRENCY_SERVER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Concurrency/concurrency_export.h b/TAO/orbsvcs/orbsvcs/Concurrency/concurrency_export.h
new file mode 100644
index 00000000000..4406ec2e93f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Concurrency/concurrency_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_CONCURRENCY_EXPORT_H
+#define TAO_CONCURRENCY_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_CONCURRENCY_HAS_DLL)
+# define TAO_CONCURRENCY_HAS_DLL 0
+# endif /* ! TAO_CONCURRENCY_HAS_DLL */
+#else
+# if !defined (TAO_CONCURRENCY_HAS_DLL)
+# define TAO_CONCURRENCY_HAS_DLL 1
+# endif /* ! TAO_CONCURRENCY_HAS_DLL */
+#endif
+
+#if defined (TAO_CONCURRENCY_HAS_DLL) && (TAO_CONCURRENCY_HAS_DLL == 1)
+# if defined (TAO_CONCURRENCY_BUILD_DLL)
+# define TAO_Concurrency_Export ACE_Proper_Export_Flag
+# define TAO_CONCURRENCY_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_CONCURRENCY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_CONCURRENCY_BUILD_DLL */
+# define TAO_Concurrency_Export ACE_Proper_Import_Flag
+# define TAO_CONCURRENCY_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_CONCURRENCY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_CONCURRENCY_BUILD_DLL */
+#else /* TAO_CONCURRENCY_HAS_DLL == 1 */
+# define TAO_Concurrency_Export
+# define TAO_CONCURRENCY_SINGLETON_DECLARATION(T)
+# define TAO_CONCURRENCY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_CONCURRENCY_HAS_DLL == 1 */
+
+#endif /* TAO_CONCURRENCY_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Concurrency/concurrency_serv_export.h b/TAO/orbsvcs/orbsvcs/Concurrency/concurrency_serv_export.h
new file mode 100644
index 00000000000..fe99ece77aa
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Concurrency/concurrency_serv_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_CONCURRENCY_SERV_EXPORT_H
+#define TAO_CONCURRENCY_SERV_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_CONCURRENCY_SERV_HAS_DLL)
+# define TAO_CONCURRENCY_SERV_HAS_DLL 0
+# endif /* ! TAO_CONCURRENCY_SERV_HAS_DLL */
+#else
+# if !defined (TAO_CONCURRENCY_SERV_HAS_DLL)
+# define TAO_CONCURRENCY_SERV_HAS_DLL 1
+# endif /* ! TAO_CONCURRENCY_SERV_HAS_DLL */
+#endif
+
+#if defined (TAO_CONCURRENCY_SERV_HAS_DLL) && (TAO_CONCURRENCY_SERV_HAS_DLL == 1)
+# if defined (TAO_CONCURRENCY_SERV_BUILD_DLL)
+# define TAO_Concurrency_Serv_Export ACE_Proper_Export_Flag
+# define TAO_CONCURRENCY_SERV_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_CONCURRENCY_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_CONCURRENCY_SERV_BUILD_DLL */
+# define TAO_Concurrency_Serv_Export ACE_Proper_Import_Flag
+# define TAO_CONCURRENCY_SERV_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_CONCURRENCY_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_CONCURRENCY_SERV_BUILD_DLL */
+#else /* TAO_CONCURRENCY_SERV_HAS_DLL == 1 */
+# define TAO_Concurrency_Serv_Export
+# define TAO_CONCURRENCY_SERV_SINGLETON_DECLARATION(T)
+# define TAO_CONCURRENCY_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_CONCURRENCY_SERV_HAS_DLL == 1 */
+
+#endif /* TAO_CONCURRENCY_SERV_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Concurrency/concurrency_skel_export.h b/TAO/orbsvcs/orbsvcs/Concurrency/concurrency_skel_export.h
new file mode 100644
index 00000000000..5894da8e9de
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Concurrency/concurrency_skel_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_CONCURRENCY_SKEL_EXPORT_H
+#define TAO_CONCURRENCY_SKEL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_CONCURRENCY_SKEL_HAS_DLL)
+# define TAO_CONCURRENCY_SKEL_HAS_DLL 0
+# endif /* ! TAO_CONCURRENCY_SKEL_HAS_DLL */
+#else
+# if !defined (TAO_CONCURRENCY_SKEL_HAS_DLL)
+# define TAO_CONCURRENCY_SKEL_HAS_DLL 1
+# endif /* ! TAO_CONCURRENCY_SKEL_HAS_DLL */
+#endif
+
+#if defined (TAO_CONCURRENCY_SKEL_HAS_DLL) && (TAO_CONCURRENCY_SKEL_HAS_DLL == 1)
+# if defined (TAO_CONCURRENCY_SKEL_BUILD_DLL)
+# define TAO_Concurrency_Skel_Export ACE_Proper_Export_Flag
+# define TAO_CONCURRENCY_SKEL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_CONCURRENCY_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_CONCURRENCY_SKEL_BUILD_DLL */
+# define TAO_Concurrency_Skel_Export ACE_Proper_Import_Flag
+# define TAO_CONCURRENCY_SKEL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_CONCURRENCY_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_CONCURRENCY_SKEL_BUILD_DLL */
+#else /* TAO_CONCURRENCY_SKEL_HAS_DLL == 1 */
+# define TAO_Concurrency_Skel_Export
+# define TAO_CONCURRENCY_SKEL_SINGLETON_DECLARATION(T)
+# define TAO_CONCURRENCY_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_CONCURRENCY_SKEL_HAS_DLL == 1 */
+
+#endif /* TAO_CONCURRENCY_SKEL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/CosConcurrency.mpc b/TAO/orbsvcs/orbsvcs/CosConcurrency.mpc
new file mode 100644
index 00000000000..99fab62e680
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosConcurrency.mpc
@@ -0,0 +1,106 @@
+// -*- MPC -*-
+// $Id$
+
+project(CosConcurrency_IDL): orbsvcslib, core, tao_versioning_idl_defaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=TAO_Concurrency_Export -Wb,stub_export_include=orbsvcs/Concurrency/concurrency_export.h -Wb,skel_export_macro=TAO_Concurrency_Skel_Export -Wb,skel_export_include=orbsvcs/Concurrency/concurrency_skel_export.h
+
+ IDL_Files {
+ CosConcurrencyControl.idl
+ }
+}
+
+project(CosConcurrency) : orbsvcslib, core {
+ sharedname = TAO_CosConcurrency
+ dynamicflags = TAO_CONCURRENCY_BUILD_DLL
+ tagchecks += Concurrency
+ after += CosConcurrency_IDL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ CosConcurrencyControlC.cpp
+ }
+
+ Header_Files {
+ CosConcurrencyControlC.h
+ Concurrency/concurrency_export.h
+ }
+
+ Inline_Files {
+ CosConcurrencyControlC.inl
+ }
+
+ Template_Files {
+ }
+
+ // explicit Resource_Files to avoid including _Skel & _Serv rc files.
+ Resource_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_CosConcurrency.pc.in
+ }
+}
+
+project(CosConcurrency_Skel): orbsvcslib, core, concurrency, portableserver {
+ sharedname = TAO_CosConcurrency_Skel
+ dynamicflags = TAO_CONCURRENCY_SKEL_BUILD_DLL
+ tagchecks += Concurrency
+ after += CosConcurrency_IDL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ CosConcurrencyControlS.cpp
+ }
+
+ Header_Files {
+ CosConcurrencyControlS.h
+ Concurrency/concurrency_skel_export.h
+ }
+
+ Inline_Files {
+ CosConcurrencyControlS.inl
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_CosConcurrency_Skel.pc.in
+ }
+}
+
+project(CosConcurrency_Serv) : orbsvcslib, core, concurrency_skel {
+ sharedname = TAO_CosConcurrency_Serv
+ dynamicflags = TAO_CONCURRENCY_SERV_BUILD_DLL
+ tagchecks += Concurrency
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Concurrency
+ }
+
+ Header_Files {
+ Concurrency
+ ^Concurrency/concurrency_export.h
+ ^Concurrency/concurrency_skel_export.h
+ }
+
+ Inline_Files {
+ Concurrency
+ }
+
+ Template_Files {
+ Concurrency
+ }
+
+ Pkgconfig_Files {
+ TAO_CosConcurrency_Serv.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/CosConcurrency.rc b/TAO/orbsvcs/orbsvcs/CosConcurrency.rc
new file mode 100644
index 00000000000..f331603d81c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosConcurrency.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosConcurrency\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosConcurrencyDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosConcurrency.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosConcurrencyControl.idl b/TAO/orbsvcs/orbsvcs/CosConcurrencyControl.idl
new file mode 100644
index 00000000000..3579be999c3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosConcurrencyControl.idl
@@ -0,0 +1,199 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// CosTransaction.idl
+//
+// = DESCRIPTION
+// Described in CORBAservices: Common Object Services
+// Specification, chapter 7 The concurrency service description can
+// be downloaded from
+// ftp://www.omg.org/pub/docs/formal/97-11-02.idl
+//
+// = AUTHOR
+// Torben Worm <tworm@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_CONCURRENCY_IDL
+#define TAO_CONCURRENCY_IDL
+
+//CosConcurrencyControl Module, page 7-8
+//Includes the following interfaces:
+// LockCoordinator, LockSet, TransactionalLockSet, LockSetFactory
+
+// The part depending on the transaction service may be included by defining
+// TAO_HAS_TRANSACTION_CONTROL_SERVICE
+
+#ifdef TAO_HAS_TRANSACTION_CONTROL_SERVICE
+#include <CosTransactions.idl>
+#endif /* TAO_HAS_TRANSACTION_CONTROL_SERVICE */
+
+#pragma prefix "omg.org"
+
+module CosConcurrencyControl
+{
+ // = TITLE
+ // CosConcurrencyControl
+ //
+ // = DESCRIPTION
+ // This idl file describes the concurrency control service. The
+ // purpose of the concurrency control service is to mediate
+ // concurrent access to an pbject such that the consistency of
+ // the object is not compromised when accessed by concurrently
+ // executing computations.
+
+ // = These are the different lock types supported by this module.
+
+ // For a description of the compatability between the different lock
+ // types please consult the service description (OMG).
+ enum lock_mode
+ {
+ read,
+ write,
+ upgrade,
+ intention_read,
+ intention_write
+ };
+
+ exception LockNotHeld {};
+ // The LockNotHeld exception is is raised when an operation to
+ // unlock or change the mode of a lock is called and the specified
+ // lock is not held
+
+#ifdef TAO_HAS_TRANSACTION_CONTROL_SERVICE
+ // @@ The lock coordinator is designed for transactional lock sets,
+ // so we don't support it (yet).
+ interface LockCoordinator
+ {
+ // = TITLE
+ // LockCoordinator drops all locks associated with a transaction.
+ // = DESCRIPTION
+ // The LockCoordinator interface enables a transaction service to
+ // drop all locks held by a transaction.
+
+ void drop_locks ();
+ // Releases all the locks held by the transaction. Designet to be
+ // used by transaction service when a transaction commits or aborts.
+ };
+#endif /* TAO_HAS_TRANSACTION_CONTROL_SERVICE */
+
+ interface LockSet
+ {
+ // = TITLE
+ // LockSet inteface to the concurrency service in implicit
+ // mode.
+ //
+ // = DESCRIPTION
+ // Clients operating in the implicit mode
+ // (i.e. non-transactional mode) acquire and release locks
+ // in lock sets throug this interface. The interface only
+ // provides operations to acquire and release locks on
+ // behalf of the calling thread or transaction.
+
+ void lock (in lock_mode mode);
+ // Acquires a lock on the specified lock set in the specified
+ // mode. Blocks until lock is obtained.
+
+ boolean try_lock (in lock_mode mode);
+ // Tries to acquire a lock on the specified lock set. If it is
+ // not possible to acquire the lock false is returned.
+
+ void unlock (in lock_mode mode)
+ raises (LockNotHeld);
+ // Releases a single lock on the specified lock set. A lock can
+ // be held multiple times in the same mode. If the lock is not
+ // held the exception LockNotHeld is raised.
+
+ void change_mode (in lock_mode held_mode,
+ in lock_mode new_mode)
+ raises (LockNotHeld);
+ // Changes the mode of the lock on the specified lock set. If a
+ // conflicting lock is held by another client the call blocks
+ // until the new mode can be granted. If the lock is not held in
+ // the specified mode the exception LockNotHeld is raised.
+
+#ifdef TAO_HAS_TRANSACTION_CONTROL_SERVICE
+ LockCoordinator get_coordinator (in CosTransactions::Coordinator which);
+ // Returns the lock coordinator associated with the specified
+ // transaction.
+#endif /* TAO_HAS_TRANSACTION_CONTROL_SERVICE */
+ };
+
+#ifdef TAO_HAS_TRANSACTION_CONTROL_SERVICE
+ interface TransactionalLockSet
+ {
+ // = TITLE
+ // TransactionalLockSet interface to the concurrency service
+ // in transactional mode.
+ //
+ // = DESCRIPTION
+ // Clients operating in the transactional mode acquire and
+ // release locks in lock sets through this interface. The
+ // interface provides operations identical to the operations
+ // described in the LockSet interface section. The
+ // difference beeing that the coordinator for the
+ // transaction is explicitly passed as a reference to the
+ // operations. Please see the description of the LockSet
+ // interface for a detailed description.
+
+ void lock (in CosTransactions::Coordinator current,
+ in lock_mode mode);
+ // See LockSet::lock
+
+ boolean try_lock (in CosTransactions::Coordinator current,
+ in lock_mode mode);
+ // See LockSet::try_lock
+
+ void unlock (in CosTransactions::Coordinator current,
+ in lock_mode mode)
+ raises (LockNotHeld);
+ // See LockSet::unlock
+
+ void change_mode (in CosTransactions::Coordinator current,
+ in lock_mode held_mode,
+ in lock_mode new_mode)
+ raises (LockNotHeld);
+ // See LockSet::change_mode
+
+ LockCoordinator get_coordinator (in CosTransactions::Coordinator which);
+ // See LockSet::get_coordinator
+ };
+#endif /* TAO_HAS_TRANSACTION_CONTROL_SERVICE */
+
+ interface LockSetFactory
+ {
+ // = TITLE
+ // Factory interface for the LockSet and
+ // TransactionalLockSet interfaces.
+ //
+ // = DESCRIPTION
+ // Factory for creating the lock sets.
+
+ LockSet create ();
+ // Creates a new LockSet and lock coordinator
+ // @@TAO ??? is this correct? Lock coordinators are associated with
+ // transactions. - tworm
+
+ LockSet create_related (in LockSet which);
+ // Creates a lock set related to the specified lock set. Related lock
+ // sets drop their locks together.
+
+#ifdef TAO_HAS_TRANSACTION_CONTROL_SERVICE
+ TransactionalLockSet create_transactional ();
+ // Creates a new TransactionalLockSet and lock coordinator for
+ // transactional mode clients.
+
+ TransactionalLockSet create_transactional_related (in TransactionalLockSet which);
+ // Creates a new transactional lock set related to the specified lock
+ // set. Related lock sets drop locks together.
+#endif /* TAO_HAS_TRANSACTION_CONTROL_SERVICE */
+ };
+};
+
+#endif /* TAO_CONCURRENCY_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent.mpc b/TAO/orbsvcs/orbsvcs/CosEvent.mpc
new file mode 100644
index 00000000000..c3666a5ddfe
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent.mpc
@@ -0,0 +1,135 @@
+// $Id$
+
+project (CosEvent_IDL) : orbsvcslib, core, minimum_corba, ec_typed_events_idl, tao_versioning_idl_defaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=TAO_Event_Export -Wb,stub_export_include=orbsvcs/CosEvent/event_export.h -Wb,skel_export_macro=TAO_Event_Skel_Export -Wb,skel_export_include=orbsvcs/CosEvent/event_skel_export.h
+
+ IDL_Files {
+ CosEventComm.idl
+ CosEventChannelAdmin.idl
+ }
+}
+
+project (CosEvent) : orbsvcslib, core, minimum_corba, ec_typed_events {
+ sharedname = TAO_CosEvent
+ dynamicflags = TAO_EVENT_BUILD_DLL
+ tagchecks += CosEvent
+ after += CosEvent_IDL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ CosEventCommC.cpp
+ CosEventChannelAdminC.cpp
+ }
+
+ Header_Files {
+ CosEventCommC.h
+ CosEventChannelAdminC.h
+ CosEvent/event_export.h
+ }
+
+ Inline_Files {
+ CosEventCommC.inl
+ CosEventChannelAdminC.inl
+ }
+
+ Template_Files {
+ }
+
+ // explicit Resource_Files to avoid including _Skel & _Serv rc files.
+ Resource_Files {
+ CosEvent.rc
+ }
+
+ Pkgconfig_Files {
+ TAO_CosEvent.pc.in
+ }
+}
+
+
+project (CosEvent_Skel) : orbsvcslib, core, minimum_corba, event, portableserver, ec_typed_events_skel {
+ sharedname = TAO_CosEvent_Skel
+ dynamicflags = TAO_EVENT_SKEL_BUILD_DLL
+ tagchecks += CosEvent
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ CosEventCommS.cpp
+ CosEventChannelAdminS.cpp
+ }
+
+ Header_Files {
+ CosEventCommS.h
+ CosEventChannelAdminS.h
+ CosEventCommS_T.h
+ CosEventChannelAdminS_T.h
+ CosEvent/event_skel_export.h
+ }
+
+ Inline_Files {
+ CosEventCommS.inl
+ CosEventChannelAdminS.inl
+ CosEventCommS_T.inl
+ CosEventChannelAdminS_T.inl
+ }
+
+ Template_Files {
+ CosEventCommS_T.cpp
+ CosEventChannelAdminS_T.cpp
+ }
+
+ Pkgconfig_Files {
+ TAO_CosEvent_Skel.pc.in
+ }
+}
+
+
+project (CosEvent_Serv) : orbsvcslib, core, minimum_corba, event_skel, ec_typed_events_serv, messaging_optional, naming, svc_utils {
+ sharedname = TAO_CosEvent_Serv
+ dynamicflags = TAO_EVENT_SERV_BUILD_DLL
+ tagchecks += CosEvent
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ CosEvent/CEC_ConsumerAdmin.cpp
+ CosEvent/CEC_ConsumerControl.cpp
+ CosEvent/CEC_Default_Factory.cpp
+ CosEvent/CEC_Dispatching.cpp
+ CosEvent/CEC_Dispatching_Task.cpp
+ CosEvent/CEC_EventChannel.cpp
+ CosEvent/CEC_Event_Loader.cpp
+ CosEvent/CEC_Factory.cpp
+ CosEvent/CEC_MT_Dispatching.cpp
+ CosEvent/CEC_ProxyPullConsumer.cpp
+ CosEvent/CEC_ProxyPullSupplier.cpp
+ CosEvent/CEC_ProxyPushConsumer.cpp
+ CosEvent/CEC_ProxyPushSupplier.cpp
+ CosEvent/CEC_Pulling_Strategy.cpp
+ CosEvent/CEC_Reactive_ConsumerControl.cpp
+ CosEvent/CEC_Reactive_Pulling_Strategy.cpp
+ CosEvent/CEC_Reactive_SupplierControl.cpp
+ CosEvent/CEC_SupplierAdmin.cpp
+ CosEvent/CEC_SupplierControl.cpp
+ }
+
+ Header_Files {
+ CosEvent/CEC_Defaults.h
+ CosEvent/event_serv_export.h
+ }
+
+ Inline_Files {
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_CosEvent_Serv.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent.rc b/TAO/orbsvcs/orbsvcs/CosEvent.rc
new file mode 100644
index 00000000000..ca6c862fa4e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosEvent\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosEventDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosEvent.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerAdmin.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerAdmin.cpp
new file mode 100644
index 00000000000..298c8981d9d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerAdmin.cpp
@@ -0,0 +1,141 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_ConsumerAdmin.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPushSupplier.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPullSupplier.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPushConsumer.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+
+#include "orbsvcs/ESF/ESF_Shutdown_Proxy.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_ConsumerAdmin.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (CosEvent,
+ CEC_ConsumerAdmin,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_CEC_ConsumerAdmin::TAO_CEC_ConsumerAdmin (TAO_CEC_EventChannel *ec)
+ : event_channel_ (ec),
+ push_admin_ (ec),
+ pull_admin_ (ec)
+{
+ this->default_POA_ =
+ this->event_channel_->consumer_poa ();
+}
+
+TAO_CEC_ConsumerAdmin::~TAO_CEC_ConsumerAdmin (void)
+{
+}
+
+void
+TAO_CEC_ConsumerAdmin::push (const CORBA::Any &event
+ ACE_ENV_ARG_DECL)
+{
+ TAO_CEC_Propagate_Event_Push push_worker (event);
+
+ this->push_admin_.for_each (&push_worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_CEC_Propagate_Event_Pull pull_worker (event);
+
+ this->pull_admin_.for_each (&pull_worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_ConsumerAdmin::connected (TAO_CEC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->push_admin_.connected (supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_ConsumerAdmin::reconnected (TAO_CEC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->push_admin_.reconnected (supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_ConsumerAdmin::disconnected (TAO_CEC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->push_admin_.disconnected (supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_ConsumerAdmin::connected (TAO_CEC_ProxyPullSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->pull_admin_.connected (supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_ConsumerAdmin::reconnected (TAO_CEC_ProxyPullSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->pull_admin_.reconnected (supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_ConsumerAdmin::disconnected (TAO_CEC_ProxyPullSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->pull_admin_.disconnected (supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_ConsumerAdmin::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->push_admin_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->pull_admin_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CosEventChannelAdmin::ProxyPushSupplier_ptr
+TAO_CEC_ConsumerAdmin::obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->push_admin_.obtain (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosEventChannelAdmin::ProxyPullSupplier_ptr
+TAO_CEC_ConsumerAdmin::obtain_pull_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->pull_admin_.obtain (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+PortableServer::POA_ptr
+TAO_CEC_ConsumerAdmin::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+// ****************************************************************
+
+void
+TAO_CEC_Propagate_Event_Push::work (TAO_CEC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ supplier->push (this->event_ ACE_ENV_ARG_PARAMETER);
+}
+
+// ****************************************************************
+
+void
+TAO_CEC_Propagate_Event_Pull::work (TAO_CEC_ProxyPullSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ supplier->push (this->event_ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerAdmin.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerAdmin.h
new file mode 100644
index 00000000000..529e6a28197
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerAdmin.h
@@ -0,0 +1,157 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file CEC_ConsumerAdmin.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_CONSUMERADMIN_H
+#define TAO_CEC_CONSUMERADMIN_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEventChannelAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Proxy_Admin.h"
+
+#include "orbsvcs/CosEvent/CEC_ProxyPushSupplier.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPullSupplier.h"
+#include "orbsvcs/CosEvent/event_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_EventChannel;
+
+/**
+ * @class TAO_CEC_ConsumerAdmin
+ *
+ * @brief ConsumerAdmin
+ *
+ * Implements the ConsumerAdmin interface, i.e. the factory for
+ * ProxyPushSupplier objects.
+ * = MEMORY MANAGMENT
+ * It does not assume ownership of the TAO_CEC_EventChannel
+ * object; but it *does* assume ownership of the
+ * TAO_CEC_ProxyPushSupplier_Set object.
+ * = LOCKING
+ * No provisions for locking, access must be serialized
+ * externally.
+ * = TODO
+ */
+class TAO_Event_Serv_Export TAO_CEC_ConsumerAdmin
+ : public POA_CosEventChannelAdmin::ConsumerAdmin
+{
+public:
+ /**
+ * constructor. If <supplier_set> is nil then it builds one using
+ * the <event_channel> argument.
+ * In any case it assumes ownership.
+ */
+ TAO_CEC_ConsumerAdmin (TAO_CEC_EventChannel* event_channel);
+
+ /// destructor...
+ virtual ~TAO_CEC_ConsumerAdmin (void);
+
+ /// For each elements call <worker->work()>.
+ void for_each (TAO_ESF_Worker<TAO_CEC_ProxyPushSupplier> *worker
+ ACE_ENV_ARG_DECL);
+ void for_each (TAO_ESF_Worker<TAO_CEC_ProxyPullSupplier> *worker
+ ACE_ENV_ARG_DECL);
+
+ /// Push the event to all the consumers
+ void push (const CORBA::Any &event
+ ACE_ENV_ARG_DECL);
+
+ /// Used to inform the EC that a Supplier has connected or
+ /// disconnected from it.
+ virtual void connected (TAO_CEC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void reconnected (TAO_CEC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_CEC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void connected (TAO_CEC_ProxyPullSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void reconnected (TAO_CEC_ProxyPullSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_CEC_ProxyPullSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// The event channel is shutting down, inform all the consumers of
+ /// this
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+ // = The CosEventChannelAdmin::ConsumerAdmin methods...
+ virtual CosEventChannelAdmin::ProxyPushSupplier_ptr
+ obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual CosEventChannelAdmin::ProxyPullSupplier_ptr
+ obtain_pull_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // = The PortableServer::ServantBase methods
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// The Event Channel we belong to
+ TAO_CEC_EventChannel *event_channel_;
+
+ /// Store the default POA.
+ PortableServer::POA_var default_POA_;
+
+ /// Implement the push side of this class
+ TAO_ESF_Proxy_Admin<TAO_CEC_EventChannel,TAO_CEC_ProxyPushSupplier,CosEventChannelAdmin::ProxyPushSupplier> push_admin_;
+
+ /// Implement the pull side of this class
+ TAO_ESF_Proxy_Admin<TAO_CEC_EventChannel,TAO_CEC_ProxyPullSupplier,CosEventChannelAdmin::ProxyPullSupplier> pull_admin_;
+
+};
+
+// ****************************************************************
+
+class TAO_CEC_Propagate_Event_Push : public TAO_ESF_Worker<TAO_CEC_ProxyPushSupplier>
+{
+public:
+ TAO_CEC_Propagate_Event_Push (const CORBA::Any& event);
+
+ void work (TAO_CEC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL);
+
+private:
+ /// The event
+ CORBA::Any event_;
+};
+
+// ****************************************************************
+
+class TAO_CEC_Propagate_Event_Pull : public TAO_ESF_Worker<TAO_CEC_ProxyPullSupplier>
+{
+public:
+ TAO_CEC_Propagate_Event_Pull (const CORBA::Any& event);
+
+ void work (TAO_CEC_ProxyPullSupplier *supplier
+ ACE_ENV_ARG_DECL);
+
+private:
+ /// The event
+ CORBA::Any event_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_ConsumerAdmin.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_CONSUMERADMIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerAdmin.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerAdmin.i
new file mode 100644
index 00000000000..d7761a1f51d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerAdmin.i
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE void
+TAO_CEC_ConsumerAdmin::
+ for_each (TAO_ESF_Worker<TAO_CEC_ProxyPushSupplier> *worker
+ ACE_ENV_ARG_DECL)
+{
+ this->push_admin_.for_each (worker ACE_ENV_ARG_PARAMETER);
+}
+
+ACE_INLINE void
+TAO_CEC_ConsumerAdmin::
+ for_each (TAO_ESF_Worker<TAO_CEC_ProxyPullSupplier> *worker
+ ACE_ENV_ARG_DECL)
+{
+ this->pull_admin_.for_each (worker ACE_ENV_ARG_PARAMETER);
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_CEC_Propagate_Event_Push::TAO_CEC_Propagate_Event_Push (const CORBA::Any& event)
+ : event_ (event)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_CEC_Propagate_Event_Pull::TAO_CEC_Propagate_Event_Pull (const CORBA::Any& event)
+ : event_ (event)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerControl.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerControl.cpp
new file mode 100644
index 00000000000..5c0068aa874
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerControl.cpp
@@ -0,0 +1,62 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_ConsumerControl.h"
+
+ACE_RCSID (CosEvent,
+ CEC_ConsumerControl,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_CEC_ConsumerControl::TAO_CEC_ConsumerControl (void)
+{
+}
+
+TAO_CEC_ConsumerControl::~TAO_CEC_ConsumerControl (void)
+{
+}
+
+int
+TAO_CEC_ConsumerControl::activate (void)
+{
+ return 0;
+}
+
+int
+TAO_CEC_ConsumerControl::shutdown (void)
+{
+ return 0;
+}
+
+void
+TAO_CEC_ConsumerControl::consumer_not_exist (TAO_CEC_ProxyPushSupplier *
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_CEC_ConsumerControl::consumer_not_exist (TAO_CEC_ProxyPullSupplier *
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_CEC_ConsumerControl::system_exception (TAO_CEC_ProxyPushSupplier *,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+bool
+TAO_CEC_ConsumerControl::need_to_disconnect (PortableServer::ServantBase*)
+{
+ return true;
+}
+
+void
+TAO_CEC_ConsumerControl::successful_transmission (PortableServer::ServantBase*)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerControl.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerControl.h
new file mode 100644
index 00000000000..b0c0f22ceaa
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ConsumerControl.h
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_ConsumerControl.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)More details can be found in:http://www.cs.wustl.edu/~coryan/EC/index.html
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_CONSUMERCONTROL_H
+#define TAO_CEC_CONSUMERCONTROL_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEvent/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PortableServer/PortableServer.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_EventChannel;
+class TAO_CEC_ProxyPushSupplier;
+class TAO_CEC_ProxyPullSupplier;
+
+namespace CORBA
+{
+ class SystemException;
+}
+
+/**
+ * @class TAO_CEC_ConsumerControl
+ *
+ * @brief ConsumerControl
+ *
+ * Defines the interface for the consumer control strategy.
+ * This strategy handles misbehaving or failing consumers.
+ * = MEMORY MANAGMENT
+ * = LOCKING
+ * = TODO
+ */
+class TAO_Event_Serv_Export TAO_CEC_ConsumerControl
+{
+public:
+ /// Constructor. It does not assume ownership of the <event_channel>
+ /// parameter.
+ TAO_CEC_ConsumerControl (void);
+
+ /// destructor...
+ virtual ~TAO_CEC_ConsumerControl (void);
+
+ /// Activate any internal threads or timers used to poll the state of
+ /// the consumers
+ virtual int activate (void);
+ virtual int shutdown (void);
+
+ /**
+ * When pushing an event to the consumer a CORBA::OBJECT_NOT_EXIST
+ * exception was raised. The only interpretation is that the object
+ * has been destroyed. The strategy has to (at the very least),
+ * reclaim all the resources attached to that object.
+ */
+ virtual void consumer_not_exist (TAO_CEC_ProxyPushSupplier *proxy
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /**
+ * Invoked by helper classes when they detect that a consumer no
+ * longer exists (i.e. _non_existent() returns true and/or the
+ * CORBA::OBJECT_NOT_EXIST exception has been raised).
+ */
+ virtual void consumer_not_exist (TAO_CEC_ProxyPullSupplier *proxy
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Some system exception was rasied while trying to push an event.
+ virtual void system_exception (TAO_CEC_ProxyPushSupplier *proxy,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Do we need to disconnect this supplier? The parameter type for
+ /// proxy is PortableServer::ServantBase* due to the fact that this
+ /// method will be used for TAO_CEC_ProxyPushSupplier's and
+ /// TAO_CEC_ProxyPullSupplier's.
+ virtual bool need_to_disconnect (PortableServer::ServantBase* proxy);
+
+ /// Allow others to inform us when a send or receive was successful.
+ virtual void successful_transmission (PortableServer::ServantBase* proxy);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_CEC_CONSUMERCONTROL_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Default_Factory.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Default_Factory.cpp
new file mode 100644
index 00000000000..19b4f4d46d6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Default_Factory.cpp
@@ -0,0 +1,1403 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_Default_Factory.h"
+#include "orbsvcs/CosEvent/CEC_MT_Dispatching.h"
+#include "orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.h"
+#include "orbsvcs/CosEvent/CEC_ConsumerAdmin.h"
+#include "orbsvcs/CosEvent/CEC_SupplierAdmin.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPushConsumer.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPullConsumer.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPushSupplier.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPullSupplier.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.h"
+#include "orbsvcs/CosEvent/CEC_Reactive_SupplierControl.h"
+
+#include "orbsvcs/ESF/ESF_Immediate_Changes.h"
+#include "orbsvcs/ESF/ESF_Delayed_Changes.h"
+#include "orbsvcs/ESF/ESF_Copy_On_Write.h"
+#include "orbsvcs/ESF/ESF_Copy_On_Read.h"
+#include "orbsvcs/ESF/ESF_Proxy_List.h"
+#include "orbsvcs/ESF/ESF_Proxy_RB_Tree.h"
+#include "orbsvcs/Time_Utilities.h"
+
+#include "tao/Messaging/Messaging_RT_PolicyC.h"
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/Null_Mutex.h"
+#include "ace/Null_Condition.h"
+#include "ace/Recursive_Thread_Mutex.h"
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+#include "orbsvcs/CosEvent/CEC_TypedConsumerAdmin.h"
+#include "orbsvcs/CosEvent/CEC_TypedSupplierAdmin.h"
+#include "orbsvcs/CosEvent/CEC_TypedEventChannel.h"
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_Default_Factory.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (CosEvent,
+ CEC_Default_Factory,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_CEC_Default_Factory::~TAO_CEC_Default_Factory (void)
+{
+ if (orbid_dupped_ != 0)
+ {
+ ACE_OS::free (orbid_);
+ }
+}
+
+int
+TAO_CEC_Default_Factory::init_svcs (void)
+{
+ return
+ ACE_Service_Config::static_svcs ()->insert (
+ &ace_svc_desc_TAO_CEC_Default_Factory
+ );
+}
+
+int
+TAO_CEC_Default_Factory::parse_collection_arg (ACE_TCHAR* opt)
+{
+ int collection_type = 0;
+ int synch_type = 0;
+ int iteration_type = 0;
+
+ ACE_TCHAR* aux = 0;
+ for (ACE_TCHAR* arg = ACE_OS::strtok_r (opt, ACE_TEXT(":"), &aux);
+ arg != 0;
+ arg = ACE_OS::strtok_r (0, ACE_TEXT(":"), &aux))
+ {
+ if (ACE_OS::strcasecmp (arg, ACE_TEXT("mt")) == 0)
+ synch_type = 0;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("st")) == 0)
+ synch_type = 1;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("list")) == 0)
+ collection_type = 0;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("rb_tree")) == 0)
+ collection_type = 1;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("immediate")) == 0)
+ iteration_type = 0;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("copy_on_read")) == 0)
+ iteration_type = 1;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("copy_on_write")) == 0)
+ iteration_type = 2;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("delayed")) == 0)
+ iteration_type = 3;
+ else
+ ACE_ERROR ((LM_ERROR,
+ "CEC_Default_Factory - "
+ "unknown collection modifier <%s>\n",
+ arg));
+ }
+ return (synch_type << 8) |(collection_type << 4) | iteration_type;
+}
+
+int
+TAO_CEC_Default_Factory::init (int argc, ACE_TCHAR* argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ this->dispatching_threads_flags_ =
+ THR_SCHED_DEFAULT|THR_BOUND|THR_NEW_LWP;
+ this->dispatching_threads_priority_ =
+ ACE_THR_PRI_OTHER_DEF;
+
+ while (arg_shifter.is_anything_left ())
+ {
+ const ACE_TCHAR *arg = arg_shifter.get_current ();
+
+ if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECDispatching")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
+ {
+ this->dispatching_ = 0;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("mt")) == 0)
+ {
+ this->dispatching_ = 1;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "CEC_Default_Factory - "
+ "unsupported dispatching <%s>\n",
+ opt));
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECDispatchingThreads")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ this->dispatching_threads_ = ACE_OS::atoi (opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECProxyConsumerCollection")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR *current_arg = arg_shifter.get_current ();
+ ACE_TCHAR *opt = ACE_OS::strdup (current_arg);
+ this->consumer_collection_ = this->parse_collection_arg (opt);
+ ACE_OS::free (opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECProxySupplierCollection")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR *current_arg = arg_shifter.get_current();
+ ACE_TCHAR* opt = ACE_OS::strdup(current_arg);
+ this->supplier_collection_ =
+ this->parse_collection_arg (opt);
+ ACE_OS::free(opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECProxyConsumerLock")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ {
+ this->consumer_lock_ = 0;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("thread")) == 0)
+ {
+ this->consumer_lock_ = 1;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("recursive")) == 0)
+ {
+ this->consumer_lock_ = 2;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "CEC_Default_Factory - "
+ "unsupported consumer lock <%s>\n",
+ opt));
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECProxySupplierLock")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ {
+ this->supplier_lock_ = 0;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("thread")) == 0)
+ {
+ this->supplier_lock_ = 1;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("recursive")) == 0)
+ {
+ this->supplier_lock_ = 2;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "CEC_Default_Factory - "
+ "unsupported supplier lock <%s>\n",
+ opt));
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECReactivePullingPeriod")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ this->reactive_pulling_period_ = ACE_OS::atoi (opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECUseORBId")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ // Copy argument for later use
+ this->orbid_ = ACE_OS::strdup(ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ()));
+ orbid_dupped_ = 1;
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECConsumerControl")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ {
+ this->consumer_control_ = 0;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
+ {
+ this->consumer_control_ = 1;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "CEC_Default_Factory - "
+ "unsupported consumer control <%s>\n",
+ opt));
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECSupplierControl")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ {
+ this->supplier_control_ = 0;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
+ {
+ this->supplier_control_ = 1;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "CEC_Default_Factory - "
+ "unsupported supplier control <%s>\n",
+ opt));
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECConsumerControlPeriod")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ this->consumer_control_period_ = ACE_OS::atoi (opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECSupplierControlPeriod")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ this->supplier_control_period_ = ACE_OS::atoi (opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECConsumerControlTimeout")) == 0 ||
+ ACE_OS::strcasecmp (arg, ACE_TEXT("-CECConsumerControlRoundtripTimeout")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ unsigned long timeout_ = ACE_OS::strtoul(opt, 0, 10);
+ this->consumer_control_timeout_.usec(timeout_);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECSupplierControlTimeout")) == 0 ||
+ ACE_OS::strcasecmp (arg, ACE_TEXT("-CECSupplierControlRoundtripTimeout")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ unsigned long timeout_ = ACE_OS::strtoul(opt, 0, 10);
+ this->supplier_control_timeout_.usec(timeout_);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECConsumerOperationTimeout")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ unsigned long timeout = ACE_OS::strtoul (opt, 0, 10);
+ this->consumer_timeout_.usec (timeout);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECSupplierOperationTimeout")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ unsigned long timeout = ACE_OS::strtoul (opt, 0, 10);
+ this->supplier_timeout_.usec (timeout);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECProxyDisconnectRetries")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ this->proxy_disconnect_retries_ = ACE_OS::atoi (opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strncmp (arg, ACE_TEXT("-CEC"), 3) == 0)
+ {
+ arg_shifter.consume_arg ();
+ ACE_ERROR ((LM_ERROR,
+ "CEC_Default_Factory - "
+ "unknown option <%s>\n",
+ arg));
+ }
+ else
+ {
+ arg_shifter.consume_arg ();
+ ACE_DEBUG ((LM_DEBUG,
+ "CEC_Default_Factory - "
+ "ignoring option <%s>\n",
+ arg));
+ }
+ }
+ return 0;
+}
+
+int
+TAO_CEC_Default_Factory::fini (void)
+{
+ return 0;
+}
+
+// ****************************************************************
+
+TAO_CEC_Dispatching*
+TAO_CEC_Default_Factory::create_dispatching (TAO_CEC_EventChannel *)
+{
+ if (this->dispatching_ == 0)
+ return new TAO_CEC_Reactive_Dispatching ();
+ else if (this->dispatching_ == 1)
+ return new TAO_CEC_MT_Dispatching (this->dispatching_threads_,
+ this->dispatching_threads_flags_,
+ this->dispatching_threads_priority_,
+ this->dispatching_threads_force_active_);
+ return 0;
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+TAO_CEC_Dispatching*
+TAO_CEC_Default_Factory::create_dispatching (TAO_CEC_TypedEventChannel *)
+{
+ if (this->dispatching_ == 0)
+ return new TAO_CEC_Reactive_Dispatching ();
+ else if (this->dispatching_ == 1)
+ return new TAO_CEC_MT_Dispatching (this->dispatching_threads_,
+ this->dispatching_threads_flags_,
+ this->dispatching_threads_priority_,
+ this->dispatching_threads_force_active_);
+ return 0;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+void
+TAO_CEC_Default_Factory::destroy_dispatching (TAO_CEC_Dispatching *x)
+{
+ delete x;
+}
+
+TAO_CEC_Pulling_Strategy*
+TAO_CEC_Default_Factory::create_pulling_strategy (TAO_CEC_EventChannel *ec)
+{
+ if (this->pulling_strategy_ == 0)
+ {
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, this->orbid_);
+
+ ACE_Time_Value rate (0, this->reactive_pulling_period_);
+ return new TAO_CEC_Reactive_Pulling_Strategy (
+ rate, this->supplier_control_timeout_,
+ ec, orb.in ());
+ }
+ return 0;
+}
+
+void
+TAO_CEC_Default_Factory::destroy_pulling_strategy (TAO_CEC_Pulling_Strategy *x)
+{
+ delete x;
+}
+
+TAO_CEC_ConsumerAdmin*
+TAO_CEC_Default_Factory::create_consumer_admin (TAO_CEC_EventChannel *ec)
+{
+ return new TAO_CEC_ConsumerAdmin (ec);
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+TAO_CEC_TypedConsumerAdmin*
+TAO_CEC_Default_Factory::create_consumer_admin (TAO_CEC_TypedEventChannel *ec)
+{
+ return new TAO_CEC_TypedConsumerAdmin (ec);
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+void
+TAO_CEC_Default_Factory::destroy_consumer_admin (TAO_CEC_ConsumerAdmin *x)
+{
+ delete x;
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+void
+TAO_CEC_Default_Factory::destroy_consumer_admin (TAO_CEC_TypedConsumerAdmin *x)
+{
+ delete x;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+TAO_CEC_SupplierAdmin*
+TAO_CEC_Default_Factory::create_supplier_admin (TAO_CEC_EventChannel *ec)
+{
+ return new TAO_CEC_SupplierAdmin (ec);
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+TAO_CEC_TypedSupplierAdmin*
+TAO_CEC_Default_Factory::create_supplier_admin (TAO_CEC_TypedEventChannel *ec)
+{
+ return new TAO_CEC_TypedSupplierAdmin (ec);
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+void
+TAO_CEC_Default_Factory::destroy_supplier_admin (TAO_CEC_SupplierAdmin *x)
+{
+ delete x;
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+void
+TAO_CEC_Default_Factory::destroy_supplier_admin (TAO_CEC_TypedSupplierAdmin *x)
+{
+ delete x;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+TAO_CEC_ProxyPushSupplier*
+TAO_CEC_Default_Factory::create_proxy_push_supplier (TAO_CEC_EventChannel *ec)
+{
+ TAO_CEC_ProxyPushSupplier *created;
+ ACE_Time_Value timeout = this->consumer_control_ ? this->consumer_timeout_
+ : ACE_Time_Value::zero;
+ ACE_NEW_RETURN (created, TAO_CEC_ProxyPushSupplier (ec, timeout), 0);
+ return created;
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+TAO_CEC_ProxyPushSupplier*
+TAO_CEC_Default_Factory::create_proxy_push_supplier (TAO_CEC_TypedEventChannel *ec)
+{
+ TAO_CEC_ProxyPushSupplier *created;
+ ACE_Time_Value timeout = this->consumer_control_ ? this->consumer_timeout_
+ : ACE_Time_Value::zero;
+ ACE_NEW_RETURN (created, TAO_CEC_ProxyPushSupplier (ec, timeout), 0);
+ return created;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+void
+TAO_CEC_Default_Factory::destroy_proxy_push_supplier (TAO_CEC_ProxyPushSupplier *x)
+{
+ delete x;
+}
+
+TAO_CEC_ProxyPullSupplier*
+TAO_CEC_Default_Factory::create_proxy_pull_supplier (TAO_CEC_EventChannel *ec)
+{
+ TAO_CEC_ProxyPullSupplier *created;
+ ACE_Time_Value timeout = this->consumer_control_ ? this->consumer_timeout_
+ : ACE_Time_Value::zero;
+ ACE_NEW_RETURN (created, TAO_CEC_ProxyPullSupplier (ec, timeout), 0);
+ return created;
+}
+
+void
+TAO_CEC_Default_Factory::destroy_proxy_pull_supplier (TAO_CEC_ProxyPullSupplier *x)
+{
+ delete x;
+}
+
+TAO_CEC_ProxyPushConsumer*
+TAO_CEC_Default_Factory::create_proxy_push_consumer (TAO_CEC_EventChannel *ec)
+{
+ TAO_CEC_ProxyPushConsumer *created;
+ ACE_Time_Value timeout = this->supplier_control_ ? this->supplier_timeout_
+ : ACE_Time_Value::zero;
+ ACE_NEW_RETURN (created, TAO_CEC_ProxyPushConsumer (ec, timeout), 0);
+ return created;
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+TAO_CEC_TypedProxyPushConsumer*
+TAO_CEC_Default_Factory::create_proxy_push_consumer (TAO_CEC_TypedEventChannel *ec)
+{
+ TAO_CEC_TypedProxyPushConsumer *created;
+ ACE_Time_Value timeout = this->supplier_control_ ? this->supplier_timeout_
+ : ACE_Time_Value::zero;
+ ACE_NEW_RETURN (created, TAO_CEC_TypedProxyPushConsumer (ec, timeout), 0);
+ return created;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+void
+TAO_CEC_Default_Factory::destroy_proxy_push_consumer (TAO_CEC_ProxyPushConsumer *x)
+{
+ delete x;
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+void
+TAO_CEC_Default_Factory::destroy_proxy_push_consumer (TAO_CEC_TypedProxyPushConsumer *x)
+{
+ delete x;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+TAO_CEC_ProxyPullConsumer*
+TAO_CEC_Default_Factory::create_proxy_pull_consumer (TAO_CEC_EventChannel *ec)
+{
+ TAO_CEC_ProxyPullConsumer *created;
+ ACE_Time_Value timeout = this->supplier_control_ ? this->supplier_timeout_
+ : ACE_Time_Value::zero;
+ ACE_NEW_RETURN (created, TAO_CEC_ProxyPullConsumer (ec, timeout), 0);
+ return created;
+}
+
+void
+TAO_CEC_Default_Factory::destroy_proxy_pull_consumer (TAO_CEC_ProxyPullConsumer *x)
+{
+ delete x;
+}
+
+// These typedefs workaround a SunCC 4.2 bug
+typedef
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>::Iterator
+ TAO_CEC_PushConsumer_List_Iterator;
+typedef
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>::Iterator
+ TAO_CEC_PushConsumer_RB_Tree_Iterator;
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+typedef
+ TAO_ESF_Proxy_List<TAO_CEC_TypedProxyPushConsumer>::Iterator
+ TAO_CEC_TypedPushConsumer_List_Iterator;
+typedef
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_TypedProxyPushConsumer>::Iterator
+ TAO_CEC_TypedPushConsumer_RB_Tree_Iterator;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+typedef
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>::Iterator
+ TAO_CEC_PullConsumer_List_Iterator;
+typedef
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>::Iterator
+ TAO_CEC_PullConsumer_RB_Tree_Iterator;
+typedef
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>::Iterator
+ TAO_CEC_PushSupplier_List_Iterator;
+typedef
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>::Iterator
+ TAO_CEC_PushSupplier_RB_Tree_Iterator;
+typedef
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>::Iterator
+ TAO_CEC_PullSupplier_List_Iterator;
+typedef
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>::Iterator
+ TAO_CEC_PullSupplier_RB_Tree_Iterator;
+
+TAO_CEC_ProxyPushConsumer_Collection*
+TAO_CEC_Default_Factory::create_proxy_push_consumer_collection (TAO_CEC_EventChannel *)
+{
+ if (this->consumer_collection_ == 0x000)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x001)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x002)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x003)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x010)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x011)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x012)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x013)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x100)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x101)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x102)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->consumer_collection_ == 0x103)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->consumer_collection_ == 0x110)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x111)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x112)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->consumer_collection_ == 0x113)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
+ TAO_CEC_PushConsumer_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+
+ return 0;
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+TAO_CEC_TypedProxyPushConsumer_Collection*
+TAO_CEC_Default_Factory::create_proxy_push_consumer_collection (TAO_CEC_TypedEventChannel *)
+{
+ if (this->consumer_collection_ == 0x000)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x001)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x002)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x003)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x010)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x011)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x012)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x013)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x100)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x101)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x102)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->consumer_collection_ == 0x103)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->consumer_collection_ == 0x110)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x111)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x112)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->consumer_collection_ == 0x113)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_TypedProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_TypedProxyPushConsumer>,
+ TAO_CEC_TypedPushConsumer_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+
+ return 0;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+void
+TAO_CEC_Default_Factory::destroy_proxy_push_consumer_collection (TAO_CEC_ProxyPushConsumer_Collection *x)
+{
+ delete x;
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+void
+TAO_CEC_Default_Factory::destroy_proxy_push_consumer_collection (TAO_CEC_TypedProxyPushConsumer_Collection *x)
+{
+ delete x;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+TAO_CEC_ProxyPullConsumer_Collection*
+TAO_CEC_Default_Factory::create_proxy_pull_consumer_collection (TAO_CEC_EventChannel *)
+{
+ if (this->consumer_collection_ == 0x000)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x001)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x002)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x003)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x010)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x011)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x012)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x013)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x100)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x101)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x102)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->consumer_collection_ == 0x103)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->consumer_collection_ == 0x110)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x111)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x112)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->consumer_collection_ == 0x113)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
+ TAO_CEC_PullConsumer_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+
+ return 0;
+}
+
+void
+TAO_CEC_Default_Factory::destroy_proxy_pull_consumer_collection (TAO_CEC_ProxyPullConsumer_Collection *x)
+{
+ delete x;
+}
+
+TAO_CEC_ProxyPushSupplier_Collection*
+TAO_CEC_Default_Factory::create_proxy_push_supplier_collection (TAO_CEC_EventChannel *)
+{
+ if (this->supplier_collection_ == 0x000)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x001)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x002)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x003)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x010)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x011)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x012)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x013)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x100)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x101)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x102)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->supplier_collection_ == 0x103)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->supplier_collection_ == 0x110)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x111)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x112)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->supplier_collection_ == 0x113)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+
+ return 0;
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+TAO_CEC_ProxyPushSupplier_Collection*
+TAO_CEC_Default_Factory::create_proxy_push_supplier_collection (TAO_CEC_TypedEventChannel *)
+{
+ if (this->supplier_collection_ == 0x000)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x001)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x002)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x003)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x010)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x011)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x012)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x013)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x100)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x101)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x102)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->supplier_collection_ == 0x103)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->supplier_collection_ == 0x110)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x111)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x112)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->supplier_collection_ == 0x113)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
+ TAO_CEC_PushSupplier_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+
+ return 0;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+void
+TAO_CEC_Default_Factory::destroy_proxy_push_supplier_collection (TAO_CEC_ProxyPushSupplier_Collection *x)
+{
+ delete x;
+}
+
+TAO_CEC_ProxyPullSupplier_Collection*
+TAO_CEC_Default_Factory::create_proxy_pull_supplier_collection (TAO_CEC_EventChannel *)
+{
+ if (this->supplier_collection_ == 0x000)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x001)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x002)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x003)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x010)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x011)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x012)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x013)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x100)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x101)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x102)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->supplier_collection_ == 0x103)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->supplier_collection_ == 0x110)
+ return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x111)
+ return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x112)
+ return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->supplier_collection_ == 0x113)
+ return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
+ TAO_CEC_PullSupplier_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+
+ return 0;
+}
+
+void
+TAO_CEC_Default_Factory::destroy_proxy_pull_supplier_collection (TAO_CEC_ProxyPullSupplier_Collection *x)
+{
+ delete x;
+}
+
+ACE_Lock*
+TAO_CEC_Default_Factory::create_consumer_lock (void)
+{
+ if (this->consumer_lock_ == 0)
+ return new ACE_Lock_Adapter<ACE_Null_Mutex>;
+ else if (this->consumer_lock_ == 1)
+ return new ACE_Lock_Adapter<TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_lock_ == 2)
+ return new ACE_Lock_Adapter<TAO_SYNCH_RECURSIVE_MUTEX> ();
+ return 0;
+}
+
+void
+TAO_CEC_Default_Factory::destroy_consumer_lock (ACE_Lock* x)
+{
+ delete x;
+}
+
+ACE_Lock*
+TAO_CEC_Default_Factory::create_supplier_lock (void)
+{
+ if (this->supplier_lock_ == 0)
+ return new ACE_Lock_Adapter<ACE_Null_Mutex>;
+ else if (this->supplier_lock_ == 1)
+ return new ACE_Lock_Adapter<TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_lock_ == 2)
+ return new ACE_Lock_Adapter<TAO_SYNCH_RECURSIVE_MUTEX> ();
+ return 0;
+}
+
+void
+TAO_CEC_Default_Factory::destroy_supplier_lock (ACE_Lock* x)
+{
+ delete x;
+}
+
+TAO_CEC_ConsumerControl*
+TAO_CEC_Default_Factory::create_consumer_control (TAO_CEC_EventChannel* ec)
+{
+ if (this->consumer_control_ == 0)
+ return new TAO_CEC_ConsumerControl ();
+ else if (this->consumer_control_ == 1)
+ {
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, this->orbid_);
+
+ ACE_Time_Value rate (0, this->consumer_control_period_);
+ return new TAO_CEC_Reactive_ConsumerControl (
+ rate, this->consumer_control_timeout_,
+ this->proxy_disconnect_retries_,
+ ec, orb.in ());
+ }
+ return 0;
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+TAO_CEC_ConsumerControl*
+TAO_CEC_Default_Factory::create_consumer_control (TAO_CEC_TypedEventChannel* ec)
+{
+ if (this->consumer_control_ == 0)
+ return new TAO_CEC_ConsumerControl ();
+ else if (this->consumer_control_ == 1)
+ {
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, this->orbid_);
+
+ ACE_Time_Value rate (0, this->consumer_control_period_);
+ return new TAO_CEC_Reactive_ConsumerControl (
+ rate, this->consumer_control_timeout_,
+ this->proxy_disconnect_retries_,
+ ec, orb.in ());
+ }
+ return 0;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+void
+TAO_CEC_Default_Factory::destroy_consumer_control (TAO_CEC_ConsumerControl* x)
+{
+ delete x;
+}
+
+TAO_CEC_SupplierControl*
+TAO_CEC_Default_Factory::create_supplier_control (TAO_CEC_EventChannel* ec)
+{
+ if (this->supplier_control_ == 0)
+ return new TAO_CEC_SupplierControl ();
+ else if (this->supplier_control_ == 1)
+ {
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, this->orbid_);
+
+ ACE_Time_Value rate (0, this->supplier_control_period_);
+ return new TAO_CEC_Reactive_SupplierControl (
+ rate, this->supplier_control_timeout_,
+ this->proxy_disconnect_retries_,
+ ec, orb.in ());
+ }
+ return 0;
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+TAO_CEC_SupplierControl*
+TAO_CEC_Default_Factory::create_supplier_control (TAO_CEC_TypedEventChannel* ec)
+{
+ if (this->supplier_control_ == 0)
+ return new TAO_CEC_SupplierControl ();
+ else if (this->supplier_control_ == 1)
+ {
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, this->orbid_);
+
+ ACE_Time_Value rate (0, this->supplier_control_period_);
+ return new TAO_CEC_Reactive_SupplierControl (
+ rate, this->supplier_control_timeout_,
+ this->proxy_disconnect_retries_,
+ ec, orb.in ());
+ }
+ return 0;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+void
+TAO_CEC_Default_Factory::destroy_supplier_control (TAO_CEC_SupplierControl* x)
+{
+ delete x;
+}
+
+CORBA::Policy_ptr TAO_CEC_Default_Factory::create_roundtrip_timeout_policy
+(const ACE_Time_Value &timeout)
+{
+ //get the existing orb
+ int fake_argc = 0;
+ CORBA::ORB_var orb = CORBA::ORB_init (fake_argc, 0, this->orbid_);
+
+ CORBA::Any value;
+ TimeBase::TimeT timet;
+ ORBSVCS_Time::Time_Value_to_TimeT (timet, timeout);
+ value <<= timet;
+ return orb->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
+ value);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+ACE_STATIC_SVC_DEFINE (TAO_CEC_Default_Factory,
+ ACE_TEXT ("CEC_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_CEC_Default_Factory),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
+ACE_FACTORY_DEFINE (TAO_Event_Serv, TAO_CEC_Default_Factory)
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Default_Factory.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Default_Factory.h
new file mode 100644
index 00000000000..8f072c7bd62
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Default_Factory.h
@@ -0,0 +1,231 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_Default_Factory.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_DEFAULT_FACTORY_H
+#define TAO_CEC_DEFAULT_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEvent/CEC_Factory.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosEvent/CEC_Defaults.h"
+
+#include "ace/Service_Config.h"
+#include "ace/Time_Value.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_CEC_Default_Factory
+ *
+ * @brief A generic factory for EC experimentation.
+ *
+ * This class allows the user to experiment with different EC
+ * configurations. Using a command-line like interface the user
+ * can specify which strategies will this factory generate.
+ * Since the class can be dynamically loaded the strategies can be
+ * set in the service configurator file.
+ * = MEMORY MANAGMENT
+ */
+class TAO_Event_Serv_Export TAO_CEC_Default_Factory : public TAO_CEC_Factory
+{
+public:
+ /// Constructor
+ TAO_CEC_Default_Factory (void);
+
+ /// destructor...
+ virtual ~TAO_CEC_Default_Factory (void);
+
+ /// Helper function to register the default factory into the service
+ /// configurator.
+ static int init_svcs (void);
+
+ // = The Service_Object entry points
+ virtual int init (int argc, ACE_TCHAR* argv[]);
+ virtual int fini (void);
+
+ // = The CEC_Factory methods
+ virtual TAO_CEC_Dispatching*
+ create_dispatching (TAO_CEC_EventChannel*);
+ virtual void
+ destroy_dispatching (TAO_CEC_Dispatching*);
+ virtual TAO_CEC_Pulling_Strategy*
+ create_pulling_strategy (TAO_CEC_EventChannel*);
+ virtual void
+ destroy_pulling_strategy (TAO_CEC_Pulling_Strategy*);
+ virtual TAO_CEC_ConsumerAdmin*
+ create_consumer_admin (TAO_CEC_EventChannel*);
+ virtual void
+ destroy_consumer_admin (TAO_CEC_ConsumerAdmin*);
+ virtual TAO_CEC_SupplierAdmin*
+ create_supplier_admin (TAO_CEC_EventChannel*);
+ virtual void
+ destroy_supplier_admin (TAO_CEC_SupplierAdmin*);
+ virtual TAO_CEC_ProxyPushSupplier*
+ create_proxy_push_supplier (TAO_CEC_EventChannel*);
+ virtual void
+ destroy_proxy_push_supplier (TAO_CEC_ProxyPushSupplier*);
+ virtual TAO_CEC_ProxyPullSupplier*
+ create_proxy_pull_supplier (TAO_CEC_EventChannel*);
+ virtual void
+ destroy_proxy_pull_supplier (TAO_CEC_ProxyPullSupplier*);
+ virtual TAO_CEC_ProxyPushConsumer*
+ create_proxy_push_consumer (TAO_CEC_EventChannel*);
+ virtual void
+ destroy_proxy_push_consumer (TAO_CEC_ProxyPushConsumer*);
+ virtual TAO_CEC_ProxyPullConsumer*
+ create_proxy_pull_consumer (TAO_CEC_EventChannel*);
+ virtual void
+ destroy_proxy_pull_consumer (TAO_CEC_ProxyPullConsumer*);
+ virtual TAO_CEC_ProxyPushConsumer_Collection*
+ create_proxy_push_consumer_collection (TAO_CEC_EventChannel*);
+ virtual void
+ destroy_proxy_push_consumer_collection (
+ TAO_CEC_ProxyPushConsumer_Collection*
+ );
+ virtual TAO_CEC_ProxyPullConsumer_Collection*
+ create_proxy_pull_consumer_collection (TAO_CEC_EventChannel*);
+ virtual void
+ destroy_proxy_pull_consumer_collection (
+ TAO_CEC_ProxyPullConsumer_Collection*
+ );
+ virtual TAO_CEC_ProxyPushSupplier_Collection*
+ create_proxy_push_supplier_collection (TAO_CEC_EventChannel*);
+ virtual void
+ destroy_proxy_push_supplier_collection (
+ TAO_CEC_ProxyPushSupplier_Collection*
+ );
+ virtual TAO_CEC_ProxyPullSupplier_Collection*
+ create_proxy_pull_supplier_collection (TAO_CEC_EventChannel*);
+ virtual void
+ destroy_proxy_pull_supplier_collection (
+ TAO_CEC_ProxyPullSupplier_Collection*
+ );
+
+ virtual ACE_Lock* create_consumer_lock (void);
+ virtual void destroy_consumer_lock (ACE_Lock*);
+ virtual ACE_Lock* create_supplier_lock (void);
+ virtual void destroy_supplier_lock (ACE_Lock*);
+
+ virtual TAO_CEC_ConsumerControl*
+ create_consumer_control (TAO_CEC_EventChannel*);
+ virtual void
+ destroy_consumer_control (TAO_CEC_ConsumerControl*);
+ virtual TAO_CEC_SupplierControl*
+ create_supplier_control (TAO_CEC_EventChannel*);
+ virtual void
+ destroy_supplier_control (TAO_CEC_SupplierControl*);
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ virtual TAO_CEC_Dispatching*
+ create_dispatching (TAO_CEC_TypedEventChannel*);
+ virtual TAO_CEC_TypedConsumerAdmin*
+ create_consumer_admin (TAO_CEC_TypedEventChannel*);
+ virtual void
+ destroy_consumer_admin (TAO_CEC_TypedConsumerAdmin*);
+ virtual TAO_CEC_TypedSupplierAdmin*
+ create_supplier_admin (TAO_CEC_TypedEventChannel*);
+ virtual void
+ destroy_supplier_admin (TAO_CEC_TypedSupplierAdmin*);
+ virtual TAO_CEC_ProxyPushSupplier*
+ create_proxy_push_supplier (TAO_CEC_TypedEventChannel*);
+ virtual TAO_CEC_ProxyPushSupplier_Collection*
+ create_proxy_push_supplier_collection (TAO_CEC_TypedEventChannel*);
+ virtual TAO_CEC_TypedProxyPushConsumer*
+ create_proxy_push_consumer (TAO_CEC_TypedEventChannel*);
+ virtual void
+ destroy_proxy_push_consumer (TAO_CEC_TypedProxyPushConsumer*);
+ virtual TAO_CEC_TypedProxyPushConsumer_Collection*
+ create_proxy_push_consumer_collection (TAO_CEC_TypedEventChannel*);
+ virtual void
+ destroy_proxy_push_consumer_collection (
+ TAO_CEC_TypedProxyPushConsumer_Collection*
+ );
+ virtual TAO_CEC_ConsumerControl*
+ create_consumer_control (TAO_CEC_TypedEventChannel*);
+ virtual TAO_CEC_SupplierControl*
+ create_supplier_control (TAO_CEC_TypedEventChannel*);
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ virtual CORBA::Policy_ptr
+ create_roundtrip_timeout_policy (const ACE_Time_Value &timeout);
+
+private:
+ /// Parse an argument to set the type of collections used.
+ int parse_collection_arg (ACE_TCHAR* opt);
+
+private:
+ /// Several flags to control the kind of object created.
+ int dispatching_;
+ int pulling_strategy_;
+ int consumer_collection_;
+ int supplier_collection_;
+ int consumer_lock_;
+ int supplier_lock_;
+
+ /// The MT dispatching priority has several arguments that could be
+ /// controlled here...
+ int dispatching_threads_;
+ int dispatching_threads_flags_;
+ int dispatching_threads_priority_;
+ int dispatching_threads_force_active_;
+
+ /// How often (in microseconds) are the pull suppliers polled by the
+ /// reactive pulling strategy.
+ int reactive_pulling_period_;
+
+ /// Use this ORB to locate global resources.
+ char *orbid_;
+
+ /// Indicate ORB ID has been duplicated (memory allocated).
+ int orbid_dupped_;
+
+ /// The consumer and supplier control policies.
+ int consumer_control_;
+ int supplier_control_;
+
+ /// The consumer and supplier control periods in usecs
+ int consumer_control_period_;
+ int supplier_control_period_;
+
+ /// The consumer and supplier control timeout in usecs
+ ACE_Time_Value consumer_control_timeout_;
+ ACE_Time_Value supplier_control_timeout_;
+
+ /// The consumer and supplier operation timeouts.
+ /// Only in effect if the corresponding "reactive control" is enabled.
+ /// Applies the given timeout as the round-trip time policy on the
+ /// object reference.
+ ACE_Time_Value consumer_timeout_;
+ ACE_Time_Value supplier_timeout_;
+
+ /// The number of retries before disconnecting a proxy
+ unsigned int proxy_disconnect_retries_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_Default_Factory.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_STATIC_SVC_DECLARE (TAO_CEC_Default_Factory)
+ACE_FACTORY_DECLARE (TAO_Event_Serv, TAO_CEC_Default_Factory)
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_DEFAULT_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Default_Factory.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Default_Factory.i
new file mode 100644
index 00000000000..0dd3d37f8cb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Default_Factory.i
@@ -0,0 +1,32 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_CEC_Default_Factory::TAO_CEC_Default_Factory (void)
+ : dispatching_ (TAO_CEC_DEFAULT_DISPATCHING),
+ pulling_strategy_ (TAO_CEC_DEFAULT_PULLING_STRATEGY),
+ consumer_collection_ (TAO_CEC_DEFAULT_CONSUMER_COLLECTION),
+ supplier_collection_ (TAO_CEC_DEFAULT_SUPPLIER_COLLECTION),
+ consumer_lock_ (TAO_CEC_DEFAULT_CONSUMER_LOCK),
+ supplier_lock_ (TAO_CEC_DEFAULT_SUPPLIER_LOCK),
+ dispatching_threads_ (TAO_CEC_DEFAULT_DISPATCHING_THREADS),
+ dispatching_threads_flags_ (TAO_CEC_DEFAULT_DISPATCHING_THREADS_FLAGS),
+ dispatching_threads_priority_ (TAO_CEC_DEFAULT_DISPATCHING_THREADS_PRIORITY),
+ dispatching_threads_force_active_ (TAO_CEC_DEFAULT_DISPATCHING_THREADS_FORCE_ACTIVE),
+ reactive_pulling_period_ (TAO_CEC_DEFAULT_REACTIVE_PULLING_PERIOD),
+ orbid_ ((char*)TAO_CEC_DEFAULT_ORB_ID),
+ orbid_dupped_(0),
+ consumer_control_ (TAO_CEC_DEFAULT_CONSUMER_CONTROL),
+ supplier_control_ (TAO_CEC_DEFAULT_SUPPLIER_CONTROL),
+ consumer_control_period_ (TAO_CEC_DEFAULT_CONSUMER_CONTROL_PERIOD),
+ supplier_control_period_ (TAO_CEC_DEFAULT_SUPPLIER_CONTROL_PERIOD),
+ consumer_control_timeout_ (0, TAO_CEC_DEFAULT_CONSUMER_CONTROL_TIMEOUT),
+ supplier_control_timeout_ (0, TAO_CEC_DEFAULT_SUPPLIER_CONTROL_TIMEOUT),
+ proxy_disconnect_retries_ (TAO_CEC_DEFAULT_PROXY_DISCONNECT_RETRIES)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Defaults.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Defaults.h
new file mode 100644
index 00000000000..f7fabae1b16
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Defaults.h
@@ -0,0 +1,127 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_Defaults.h
+ *
+ * $Id$
+ *
+ * In this file we set the compile time defaults for the event
+ * channel.
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_DEFAULTS_H
+#define TAO_CEC_DEFAULTS_H
+
+#include /**/ "ace/pre.h"
+
+#ifndef TAO_CEC_ENABLE_DEBUG_MESSAGES
+#define TAO_CEC_ENABLE_DEBUG_MESSAGES 0
+#endif /* TAO_CEC_ENABLE_DEBUG_MESSAGES */
+
+// Any of the definitions below can be overriden in the config.h file
+// or the compilation line.
+
+// Control consumer and supplier reconnections
+#ifndef TAO_CEC_DEFAULT_CONSUMER_RECONNECT
+# define TAO_CEC_DEFAULT_CONSUMER_RECONNECT 0
+#endif /* TAO_CEC_DEFAULT_CONSUMER_RECONNECT */
+
+#ifndef TAO_CEC_DEFAULT_SUPPLIER_RECONNECT
+#define TAO_CEC_DEFAULT_SUPPLIER_RECONNECT 0
+#endif /* TAO_CEC_DEFAULT_SUPPLIER_RECONNECT */
+
+// Control callbacks when proxies are disconnected
+#ifndef TAO_CEC_DEFAULT_DISCONNECT_CALLBACKS
+# define TAO_CEC_DEFAULT_DISCONNECT_CALLBACKS 0
+#endif /* TAO_CEC_DEFAULT_DISCONNECT_CALLBACKS */
+
+// The defaults for the default factory.
+// The TAO_CEC_Default_Factory is a run-time configurable factory for
+// the event channel. Using the service configurator the user can
+// specify what strategies should the factory produce.
+// This macros control the default values for those strategies.
+//
+#ifndef TAO_CEC_DEFAULT_DISPATCHING
+# define TAO_CEC_DEFAULT_DISPATCHING 0 /* reactive */
+#endif /* TAO_CEC_DEFAULT_DISPATCHING */
+
+#ifndef TAO_CEC_DEFAULT_PULLING_STRATEGY
+# define TAO_CEC_DEFAULT_PULLING_STRATEGY 0 /* reactive */
+#endif /* TAO_CEC_DEFAULT_PULLING_STRATEGY */
+
+#ifndef TAO_CEC_DEFAULT_CONSUMER_COLLECTION
+# define TAO_CEC_DEFAULT_CONSUMER_COLLECTION 0x003 /* delayed MT-safe */
+#endif /* TAO_CEC_DEFAULT_CONSUMER_COLLECTION */
+
+#ifndef TAO_CEC_DEFAULT_SUPPLIER_COLLECTION
+# define TAO_CEC_DEFAULT_SUPPLIER_COLLECTION 0x003 /* delayed MT-safe */
+#endif /* TAO_CEC_DEFAULT_SUPPLIER_COLLECTION */
+
+#ifndef TAO_CEC_DEFAULT_CONSUMER_LOCK
+# define TAO_CEC_DEFAULT_CONSUMER_LOCK 1 /* thread */
+#endif /* TAO_CEC_DEFAULT_CONSUMER_LOCK */
+
+#ifndef TAO_CEC_DEFAULT_SUPPLIER_LOCK
+# define TAO_CEC_DEFAULT_SUPPLIER_LOCK 1 /* thread */
+#endif /* TAO_CEC_DEFAULT_SUPPLIER_LOCK */
+
+#ifndef TAO_CEC_DEFAULT_DISPATCHING_THREADS
+# define TAO_CEC_DEFAULT_DISPATCHING_THREADS 1 /* */
+#endif /* TAO_CEC_DEFAULT_DISPATCHING_THREADS */
+
+#ifndef TAO_CEC_DEFAULT_DISPATCHING_THREADS_FLAGS
+# define TAO_CEC_DEFAULT_DISPATCHING_THREADS_FLAGS THR_NEW_LWP|THR_BOUND|THR_SCHED_DEFAULT
+#endif /* TAO_CEC_DEFAULT_DISPATCHING_THREADS */
+
+#ifndef TAO_CEC_DEFAULT_DISPATCHING_THREADS_PRIORITY
+# define TAO_CEC_DEFAULT_DISPATCHING_THREADS_PRIORITY ACE_THR_PRI_OTHER_DEF
+#endif /* TAO_CEC_DEFAULT_DISPATCHING_THREADS_PRIORITY */
+
+#ifndef TAO_CEC_DEFAULT_DISPATCHING_THREADS_FORCE_ACTIVE
+# define TAO_CEC_DEFAULT_DISPATCHING_THREADS_FORCE_ACTIVE 1
+#endif /* TAO_CEC_DEFAULT_DISPATCHING_THREADS_FORCE_ACTIVE */
+
+#ifndef TAO_CEC_DEFAULT_REACTIVE_PULLING_PERIOD
+# define TAO_CEC_DEFAULT_REACTIVE_PULLING_PERIOD 5000000 /* usecs */
+#endif /* TAO_CEC_DEFAULT_REACTIVE_PULLING_PERIOD */
+
+#ifndef TAO_CEC_DEFAULT_ORB_ID
+# define TAO_CEC_DEFAULT_ORB_ID "" /* */
+#endif /* TAO_CEC_DEFAULT_ORB_ID */
+
+#ifndef TAO_CEC_DEFAULT_CONSUMER_CONTROL
+# define TAO_CEC_DEFAULT_CONSUMER_CONTROL 0 /* null */
+#endif /* TAO_CEC_DEFAULT_CONSUMER_CONTROL */
+
+#ifndef TAO_CEC_DEFAULT_SUPPLIER_CONTROL
+# define TAO_CEC_DEFAULT_SUPPLIER_CONTROL 0 /* null */
+#endif /* TAO_CEC_DEFAULT_SUPPLIER_CONTROL */
+
+#ifndef TAO_CEC_DEFAULT_CONSUMER_CONTROL_PERIOD
+# define TAO_CEC_DEFAULT_CONSUMER_CONTROL_PERIOD 5000000 /* usecs */
+#endif /* TAO_CEC_DEFAULT_CONSUMER_CONTROL_PERIOD */
+
+#ifndef TAO_CEC_DEFAULT_SUPPLIER_CONTROL_PERIOD
+# define TAO_CEC_DEFAULT_SUPPLIER_CONTROL_PERIOD 5000000 /* usecs */
+#endif /* TAO_CEC_DEFAULT_SUPPLIER_CONTROL_PERIOD */
+
+#ifndef TAO_CEC_DEFAULT_CONSUMER_CONTROL_TIMEOUT
+# define TAO_CEC_DEFAULT_CONSUMER_CONTROL_TIMEOUT 10000 /* usecs */
+#endif /* TAO_CEC_DEFAULT_CONSUMER_CONTROL_TIMEOUT */
+
+#ifndef TAO_CEC_DEFAULT_SUPPLIER_CONTROL_TIMEOUT
+# define TAO_CEC_DEFAULT_SUPPLIER_CONTROL_TIMEOUT 10000 /* usecs */
+#endif /* TAO_CEC_DEFAULT_SUPPLIER_CONTROL_TIMEOUT */
+
+#ifndef TAO_CEC_DEFAULT_PROXY_DISCONNECT_RETRIES
+# define TAO_CEC_DEFAULT_PROXY_DISCONNECT_RETRIES 0
+#endif /* TAO_CEC_DEFAULT_PROXY_DISCONNECT_RETRIES */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_DEFAULTS_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching.cpp
new file mode 100644
index 00000000000..14c6d6c21ca
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching.cpp
@@ -0,0 +1,64 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_Dispatching.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPushSupplier.h"
+
+ACE_RCSID(CosEvent, CEC_Dispatching, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_CEC_Dispatching::~TAO_CEC_Dispatching (void)
+{
+}
+
+// ****************************************************************
+
+TAO_CEC_Reactive_Dispatching::TAO_CEC_Reactive_Dispatching (void)
+{
+}
+
+void
+TAO_CEC_Reactive_Dispatching::activate (void)
+{
+}
+
+void
+TAO_CEC_Reactive_Dispatching::shutdown (void)
+{
+}
+
+void
+TAO_CEC_Reactive_Dispatching::push (TAO_CEC_ProxyPushSupplier* proxy,
+ const CORBA::Any& event
+ ACE_ENV_ARG_DECL)
+{
+ proxy->reactive_push_to_consumer (event ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_Reactive_Dispatching::push_nocopy (TAO_CEC_ProxyPushSupplier* proxy,
+ CORBA::Any& event
+ ACE_ENV_ARG_DECL)
+{
+ proxy->reactive_push_to_consumer (event ACE_ENV_ARG_PARAMETER);
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+void
+TAO_CEC_Reactive_Dispatching::invoke (TAO_CEC_ProxyPushSupplier* proxy,
+ const TAO_CEC_TypedEvent& typed_event
+ ACE_ENV_ARG_DECL)
+{
+ proxy->reactive_invoke_to_consumer (typed_event ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_Reactive_Dispatching::invoke_nocopy (TAO_CEC_ProxyPushSupplier* proxy,
+ TAO_CEC_TypedEvent& typed_event
+ ACE_ENV_ARG_DECL)
+{
+ proxy->reactive_invoke_to_consumer (typed_event ACE_ENV_ARG_PARAMETER);
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching.h
new file mode 100644
index 00000000000..48806cdafba
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching.h
@@ -0,0 +1,119 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_Dispatching.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_DISPATCHING_H
+#define TAO_CEC_DISPATCHING_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEventCommC.h"
+
+#include "orbsvcs/CosEvent/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_ProxyPushSupplier;
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+class TAO_CEC_TypedEvent;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+/**
+ * @class TAO_CEC_Dispatching
+ *
+ * @brief Define the interface for the dispatching strategies.
+ *
+ * The EC may be configured with different dispatching strategies,
+ * for instance, it can use a pool of threads to dispatch the
+ * events, or a set of queues with threads at different priorities
+ * for each queue or can simply push the event to the consumer in
+ * FIFO order.
+ */
+class TAO_Event_Serv_Export TAO_CEC_Dispatching
+{
+public:
+ /// destructor...
+ virtual ~TAO_CEC_Dispatching (void);
+
+ /// Initialize all the data structures, activate any internal threads,
+ /// etc.
+ virtual void activate (void) = 0;
+
+ /**
+ * Deactivate any internal threads and cleanup internal data
+ * structures, it should only return once the threads have finished
+ * their jobs.
+ */
+ virtual void shutdown (void) = 0;
+
+ /// The consumer represented by <proxy> should receive <event>.
+ virtual void push (TAO_CEC_ProxyPushSupplier *proxy,
+ const CORBA::Any &event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS) = 0;
+ virtual void push_nocopy (TAO_CEC_ProxyPushSupplier *proxy,
+ CORBA::Any &event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS) = 0;
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ virtual void invoke (TAO_CEC_ProxyPushSupplier *proxy,
+ const TAO_CEC_TypedEvent &typed_event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS) = 0;
+ virtual void invoke_nocopy (TAO_CEC_ProxyPushSupplier *proxy,
+ TAO_CEC_TypedEvent &typed_event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS) = 0;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_CEC_Reactive_Dispatching
+ *
+ * @brief Dispatch using the caller thread.
+ *
+ * The events are dispatched in FIFO ordering, using the invoking
+ * thread to push the event to the consumer.
+ */
+class TAO_Event_Serv_Export TAO_CEC_Reactive_Dispatching : public TAO_CEC_Dispatching
+{
+public:
+ /// The scheduler is used to find the range of priorities and similar
+ /// info.
+ TAO_CEC_Reactive_Dispatching (void);
+
+ // = The CEC_Dispatching methods.
+ virtual void activate (void);
+ virtual void shutdown (void);
+ virtual void push (TAO_CEC_ProxyPushSupplier *proxy,
+ const CORBA::Any &event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ virtual void push_nocopy (TAO_CEC_ProxyPushSupplier *proxy,
+ CORBA::Any &event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ virtual void invoke (TAO_CEC_ProxyPushSupplier *proxy,
+ const TAO_CEC_TypedEvent &typed_event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ virtual void invoke_nocopy (TAO_CEC_ProxyPushSupplier *proxy,
+ TAO_CEC_TypedEvent &typed_event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_DISPATCHING_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching_Task.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching_Task.cpp
new file mode 100644
index 00000000000..363d2600717
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching_Task.cpp
@@ -0,0 +1,156 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_Dispatching_Task.h"
+
+#include "tao/ORB_Constants.h"
+#include "ace/OS_NS_errno.h"
+
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_Dispatching_Task.i"
+#endif /* __ACE_INLINE__ */
+
+#include "ace/OS_NS_errno.h"
+
+ACE_RCSID (CosEvent,
+ CEC_Dispatching,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int
+TAO_CEC_Dispatching_Task::svc (void)
+{
+ int done = 0;
+ while (!done)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ ACE_Message_Block *mb;
+ if (this->getq (mb) == -1)
+ if (ACE_OS::last_error () == ESHUTDOWN)
+ return 0;
+ else
+ ACE_ERROR ((LM_ERROR,
+ "EC (%P|%t) getq error in Dispatching Queue\n"));
+
+ TAO_CEC_Dispatch_Command *command =
+ dynamic_cast<TAO_CEC_Dispatch_Command*> (mb);
+
+ if (command == 0)
+ {
+ ACE_Message_Block::release (mb);
+ continue;
+ }
+
+ int result = command->execute (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Message_Block::release (mb);
+
+ if (result == -1)
+ done = 1;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "EC (%P|%t) exception in dispatching queue");
+ }
+ ACE_ENDTRY;
+ }
+ return 0;
+}
+
+void
+TAO_CEC_Dispatching_Task::push (TAO_CEC_ProxyPushSupplier *proxy,
+ CORBA::Any& event
+ ACE_ENV_ARG_DECL)
+{
+ if (this->allocator_ == 0)
+ this->allocator_ = ACE_Allocator::instance ();
+
+ void* buf = this->allocator_->malloc (sizeof (TAO_CEC_Push_Command));
+
+ if (buf == 0)
+ ACE_THROW (CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+
+ ACE_Message_Block *mb =
+ new (buf) TAO_CEC_Push_Command (proxy,
+ event,
+ this->data_block_.duplicate (),
+ this->allocator_);
+ this->putq (mb);
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+void
+TAO_CEC_Dispatching_Task::invoke (TAO_CEC_ProxyPushSupplier *proxy,
+ TAO_CEC_TypedEvent& typed_event
+ ACE_ENV_ARG_DECL)
+{
+ if (this->allocator_ == 0)
+ this->allocator_ = ACE_Allocator::instance ();
+
+ void* buf = this->allocator_->malloc (sizeof (TAO_CEC_Invoke_Command));
+
+ if (buf == 0)
+ ACE_THROW (CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+
+ ACE_Message_Block *mb =
+ new (buf) TAO_CEC_Invoke_Command (proxy,
+ typed_event,
+ this->data_block_.duplicate (),
+ this->allocator_);
+ this->putq (mb);
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+// ****************************************************************
+
+TAO_CEC_Dispatch_Command::~TAO_CEC_Dispatch_Command (void)
+{
+}
+
+// ****************************************************************
+
+int
+TAO_CEC_Shutdown_Task_Command::execute (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return -1;
+}
+
+// ****************************************************************
+
+TAO_CEC_Push_Command::~TAO_CEC_Push_Command (void)
+{
+ this->proxy_->_decr_refcnt ();
+}
+
+int
+TAO_CEC_Push_Command::execute (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->proxy_->push_to_consumer (this->event_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+// ****************************************************************
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+TAO_CEC_Invoke_Command::~TAO_CEC_Invoke_Command (void)
+{
+ this->proxy_->_decr_refcnt ();
+}
+
+int
+TAO_CEC_Invoke_Command::execute (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->proxy_->invoke_to_consumer (this->typed_event_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching_Task.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching_Task.h
new file mode 100644
index 00000000000..fcdcb8a564a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching_Task.h
@@ -0,0 +1,165 @@
+// $Id$
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_Dispatching_Task.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_DISPATCHING_TASK_H
+#define TAO_CEC_DISPATCHING_TASK_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEvent/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosEvent/CEC_ProxyPushSupplier.h"
+
+#include "tao/Basic_Types.h"
+
+#include "ace/Message_Block.h"
+#include "ace/Lock_Adapter_T.h"
+#include "ace/Task.h"
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+#include "orbsvcs/CosEvent/CEC_TypedEvent.h"
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_CEC_Dispatching_Task
+ *
+ * @brief Implement the dispatching queues for FIFO and Priority
+ * dispatching.
+ *
+ */
+class TAO_Event_Serv_Export TAO_CEC_Dispatching_Task : public ACE_Task<ACE_SYNCH>
+{
+public:
+ /// Constructor
+ TAO_CEC_Dispatching_Task (ACE_Thread_Manager* thr_manager = 0);
+
+ /// Process the events in the queue.
+ virtual int svc (void);
+
+ virtual void push (TAO_CEC_ProxyPushSupplier *proxy,
+ CORBA::Any& event
+ ACE_ENV_ARG_DECL);
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ virtual void invoke (TAO_CEC_ProxyPushSupplier *proxy,
+ TAO_CEC_TypedEvent& typed_event
+ ACE_ENV_ARG_DECL);
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+private:
+ /// An per-task allocator
+ ACE_Allocator *allocator_;
+
+ /// Helper data structure to minimize memory allocations...
+ ACE_Locked_Data_Block<ACE_Lock_Adapter<TAO_SYNCH_MUTEX> > data_block_;
+};
+
+// ****************************************************************
+
+class TAO_Event_Serv_Export TAO_CEC_Dispatch_Command : public ACE_Message_Block
+{
+public:
+ /// Constructor, it will allocate its own data block
+ TAO_CEC_Dispatch_Command (ACE_Allocator *mb_allocator = 0);
+
+ /// Constructor, it assumes ownership of the data block
+ TAO_CEC_Dispatch_Command (ACE_Data_Block*,
+ ACE_Allocator *mb_allocator = 0);
+
+ /// Destructor
+ virtual ~TAO_CEC_Dispatch_Command (void);
+
+ /// Command callback
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) = 0;
+};
+
+// ****************************************************************
+
+class TAO_Event_Serv_Export TAO_CEC_Shutdown_Task_Command : public TAO_CEC_Dispatch_Command
+{
+public:
+ /// Constructor
+ TAO_CEC_Shutdown_Task_Command (ACE_Allocator *mb_allocator = 0);
+
+ /// Command callback
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+};
+
+// ****************************************************************
+
+class TAO_Event_Serv_Export TAO_CEC_Push_Command : public TAO_CEC_Dispatch_Command
+{
+public:
+ /// Constructor
+ TAO_CEC_Push_Command (TAO_CEC_ProxyPushSupplier* proxy,
+ CORBA::Any& event,
+ ACE_Data_Block* data_block,
+ ACE_Allocator *mb_allocator);
+
+ /// Destructor
+ virtual ~TAO_CEC_Push_Command (void);
+
+ /// Command callback
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+private:
+ /// The proxy
+ TAO_CEC_ProxyPushSupplier* proxy_;
+
+ /// The event
+ CORBA::Any event_;
+};
+
+// ****************************************************************
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+class TAO_Event_Serv_Export TAO_CEC_Invoke_Command : public TAO_CEC_Dispatch_Command
+{
+public:
+ /// Constructor
+ TAO_CEC_Invoke_Command (TAO_CEC_ProxyPushSupplier* proxy,
+ TAO_CEC_TypedEvent& typed_event,
+ ACE_Data_Block* data_block,
+ ACE_Allocator *mb_allocator);
+
+ /// Destructor
+ virtual ~TAO_CEC_Invoke_Command (void);
+
+ /// Command callback
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+private:
+ /// The proxy
+ TAO_CEC_ProxyPushSupplier* proxy_;
+
+ /// The event
+ TAO_CEC_TypedEvent typed_event_;
+};
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_Dispatching_Task.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_DISPATCHING_TASK_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching_Task.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching_Task.i
new file mode 100644
index 00000000000..1432528492a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Dispatching_Task.i
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_CEC_Dispatching_Task::
+TAO_CEC_Dispatching_Task (ACE_Thread_Manager* thr_manager)
+ : ACE_Task<ACE_SYNCH> (thr_manager),
+ allocator_ (0)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_CEC_Dispatch_Command::TAO_CEC_Dispatch_Command (ACE_Allocator *mb_allocator)
+ : ACE_Message_Block (mb_allocator)
+{
+}
+
+ACE_INLINE
+TAO_CEC_Dispatch_Command::TAO_CEC_Dispatch_Command (ACE_Data_Block *data_block,
+ ACE_Allocator *mb_allocator)
+ : ACE_Message_Block (data_block, 0, mb_allocator)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_CEC_Shutdown_Task_Command::
+ TAO_CEC_Shutdown_Task_Command (ACE_Allocator *mb_allocator)
+ : TAO_CEC_Dispatch_Command (mb_allocator)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_CEC_Push_Command::TAO_CEC_Push_Command (TAO_CEC_ProxyPushSupplier* proxy,
+ CORBA::Any& event,
+ ACE_Data_Block* data_block,
+ ACE_Allocator *mb_allocator)
+ : TAO_CEC_Dispatch_Command (data_block, mb_allocator),
+ proxy_ (proxy)
+{
+ //
+ // Efficient copy, steal the buffer from <event>
+ // We cannot do this on the initialization because get_buffer()
+ // could get called first, effectively setting maximum() and
+ // length() to 0!
+ //
+ // @@ TODO
+ this->event_ = event;
+
+ this->proxy_->_incr_refcnt ();
+}
+
+// ****************************************************************
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ACE_INLINE
+TAO_CEC_Invoke_Command::TAO_CEC_Invoke_Command (TAO_CEC_ProxyPushSupplier* proxy,
+ TAO_CEC_TypedEvent& typed_event,
+ ACE_Data_Block* data_block,
+ ACE_Allocator *mb_allocator)
+ : TAO_CEC_Dispatch_Command (data_block, mb_allocator),
+ proxy_ (proxy)
+{
+ //
+ // Efficient copy, steal the buffer from <event>
+ // We cannot do this on the initialization because get_buffer()
+ // could get called first, effectively setting maximum() and
+ // length() to 0!
+ //
+ // @@ TODO
+ this->typed_event_ = typed_event;
+
+ this->proxy_->_incr_refcnt ();
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_DynamicImplementation.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_DynamicImplementation.cpp
new file mode 100644
index 00000000000..75813fad39b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_DynamicImplementation.cpp
@@ -0,0 +1,179 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_DynamicImplementation.h"
+#include "tao/DynamicInterface/Request.h"
+#include "tao/DynamicInterface/Unknown_User_Exception.h"
+#include "tao/debug.h"
+#include "orbsvcs/CosEvent/CEC_TypedEvent.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_DynamicImplementation.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Destructor
+TAO_CEC_DynamicImplementationServer::~TAO_CEC_DynamicImplementationServer (void)
+{
+}
+
+// The DSI invoke request
+void
+TAO_CEC_DynamicImplementationServer::invoke (CORBA::ServerRequest_ptr request
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Trap the _is_a request
+ if (ACE_OS::strcmp ("_is_a", request->operation () ) == 0)
+ {
+ this->is_a (request ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ CORBA::NVList_ptr list;
+
+ // Get the operation paramter information from the IFR cache.
+ TAO_CEC_Operation_Params *oper_params =
+ this->typed_event_channel_->find_from_ifr_cache (request->operation () );
+
+ if (oper_params == 0)
+ {
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** Operation not found in IFR cache *****\n")));
+ }
+
+ this->typed_event_channel_->create_list (0, list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ // Populate the NVList from the parameter information.
+ this->typed_event_channel_->create_operation_list (oper_params, list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Get the operation arguments. This ahould demarshal correctly.
+ request->arguments (list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Populate the TypedEvent with the list and operation name.
+ TAO_CEC_TypedEvent typed_event (list, request->operation () );
+
+ // Pass the TypedEvent to the TypedProxyPushConsumer
+ this->typed_pp_consumer_->invoke (typed_event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+}
+
+CORBA::RepositoryId
+TAO_CEC_DynamicImplementationServer::_primary_interface (const PortableServer::ObjectId &,
+ PortableServer::POA_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC (())
+{
+ return CORBA::string_dup (repository_id_);
+}
+
+PortableServer::POA_ptr
+TAO_CEC_DynamicImplementationServer::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
+
+void
+TAO_CEC_DynamicImplementationServer::is_a (CORBA::ServerRequest_ptr request
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::NVList_ptr list;
+
+ this->typed_event_channel_->create_list (0, list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Any any_1;
+ any_1._tao_set_typecode(CORBA::_tc_string);
+
+ list->add_value ("value",
+ any_1,
+ CORBA::ARG_IN
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ request->arguments (list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::NamedValue_ptr nv = list->item (0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Any_ptr ap = nv->value ();
+ const char *value;
+ *ap >>= value;
+
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** TAO_CEC_DynamicImplementationServer::is_a called with value %s *****\n"),
+ value));
+ }
+
+ const char *object_id =
+ CORBA::_tc_Object->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** is_a using Server's RepositoryId %s *****\n"),
+ this->repository_id_));
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** is_a using base interface %s *****\n"),
+ object_id));
+ }
+
+ CORBA::Boolean result = 0;
+ if (ACE_OS::strcmp (value, this->repository_id_) == 0
+ || ACE_OS::strcmp (value, object_id) == 0)
+ {
+ result = 1;
+ }
+ else
+ {
+ CORBA::ULong num = this->typed_event_channel_->number_of_base_interfaces ();
+ for (CORBA::ULong base=0; base<num; base++)
+ {
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** is_a using base interface %s *****\n"),
+ this->typed_event_channel_->base_interfaces (base) ));
+ }
+
+ if (ACE_OS::strcmp (value, this->typed_event_channel_->base_interfaces (base) ) == 0)
+ {
+ result = 1;
+ }
+ }
+ }
+
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** is_a returning %d *****\n"),
+ result));
+ }
+
+ CORBA::Any result_any;
+ CORBA::Any::from_boolean from_boolean (result);
+ result_any <<= from_boolean;
+
+ request->set_result (result_any ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_DynamicImplementation.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_DynamicImplementation.h
new file mode 100644
index 00000000000..98c4b91c1cd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_DynamicImplementation.h
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_DynamicImplementation.h
+ *
+ * $Id$
+ *
+ * @author Jon Astle (jon@astle45.fsnet.co.uk)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_DYNAMICIMPLEMENTATION_H
+#define TAO_CEC_DYNAMICIMPLEMENTATION_H
+
+#include "orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.h"
+#include "orbsvcs/CosEvent/CEC_TypedEventChannel.h"
+#include "tao/DynamicInterface/Server_Request.h"
+#include "tao/DynamicInterface/Dynamic_Implementation.h"
+#include "tao/ORB.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_DynamicImplementationServer : public TAO_DynamicImplementation
+{
+ // = TITLE
+ // DSI TAO_CEC_DynamicImplementationServer implementation
+ //
+ // = DESCRIPTION
+ // Implements the DSI impl object
+ //
+public:
+
+ // Constructure
+ TAO_CEC_DynamicImplementationServer (PortableServer::POA_ptr poa,
+ TAO_CEC_TypedProxyPushConsumer *typed_pp_consumer,
+ TAO_CEC_TypedEventChannel *typed_event_channel);
+
+ //Destructor
+ virtual ~TAO_CEC_DynamicImplementationServer (void);
+
+ // = The DynamicImplementation methods.
+ virtual void invoke (CORBA::ServerRequest_ptr request
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::RepositoryId _primary_interface (
+ const PortableServer::ObjectId &oid,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC (());
+
+ virtual PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL
+ );
+
+ // Handles the _is_a call
+ virtual void is_a (CORBA::ServerRequest_ptr request
+ ACE_ENV_ARG_DECL);
+
+private:
+ // The POA
+ PortableServer::POA_var poa_;
+
+ // The Typed Proxy Push Consumer Implementation
+ TAO_CEC_TypedProxyPushConsumer *typed_pp_consumer_;
+
+ // The Typed Event Channel Implementation
+ TAO_CEC_TypedEventChannel *typed_event_channel_;
+
+ // The RepositoryId
+ CORBA::RepositoryId repository_id_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_DynamicImplementation.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_CEC_DYNAMICIMPLEMENTATION_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_DynamicImplementation.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_DynamicImplementation.i
new file mode 100644
index 00000000000..2f1bff715f7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_DynamicImplementation.i
@@ -0,0 +1,19 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_CEC_DynamicImplementationServer::TAO_CEC_DynamicImplementationServer
+ (PortableServer::POA_ptr poa,
+ TAO_CEC_TypedProxyPushConsumer *typed_pp_consumer,
+ TAO_CEC_TypedEventChannel *typed_event_channel)
+ : poa_ (PortableServer::POA::_duplicate (poa)),
+ typed_pp_consumer_ (typed_pp_consumer),
+ typed_event_channel_ (typed_event_channel),
+ repository_id_ (CORBA::string_dup (typed_event_channel->supported_interface () ))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.cpp
new file mode 100644
index 00000000000..11fb1dd92d7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.cpp
@@ -0,0 +1,241 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_Dispatching.h"
+#include "orbsvcs/CosEvent/CEC_Pulling_Strategy.h"
+#include "orbsvcs/CosEvent/CEC_ConsumerAdmin.h"
+#include "orbsvcs/CosEvent/CEC_SupplierAdmin.h"
+#include "orbsvcs/CosEvent/CEC_ConsumerControl.h"
+#include "orbsvcs/CosEvent/CEC_SupplierControl.h"
+#include "ace/Dynamic_Service.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_EventChannel.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(CosEvent, CEC_EventChannel, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_CEC_EventChannel::
+TAO_CEC_EventChannel (const TAO_CEC_EventChannel_Attributes& attr,
+ TAO_CEC_Factory* factory,
+ int own_factory)
+ : supplier_poa_ (PortableServer::POA::_duplicate (attr.supplier_poa)),
+ consumer_poa_ (PortableServer::POA::_duplicate (attr.consumer_poa)),
+ factory_ (factory),
+ own_factory_ (own_factory),
+ consumer_reconnect_ (attr.consumer_reconnect),
+ supplier_reconnect_ (attr.supplier_reconnect),
+ disconnect_callbacks_ (attr.disconnect_callbacks)
+{
+ if (this->factory_ == 0)
+ {
+ this->factory_ =
+ ACE_Dynamic_Service<TAO_CEC_Factory>::instance ("CEC_Factory");
+ this->own_factory_ = 0;
+ ACE_ASSERT (this->factory_ != 0);
+ }
+
+ this->dispatching_ =
+ this->factory_->create_dispatching (this);
+ this->pulling_strategy_ =
+ this->factory_->create_pulling_strategy (this);
+ this->consumer_admin_ =
+ this->factory_->create_consumer_admin (this);
+ this->supplier_admin_ =
+ this->factory_->create_supplier_admin (this);
+ this->consumer_control_ =
+ this->factory_->create_consumer_control (this);
+ this->supplier_control_ =
+ this->factory_->create_supplier_control (this);
+}
+
+TAO_CEC_EventChannel::~TAO_CEC_EventChannel (void)
+{
+ this->factory_->destroy_dispatching (this->dispatching_);
+ this->dispatching_ = 0;
+
+ this->factory_->destroy_pulling_strategy (this->pulling_strategy_);
+ this->pulling_strategy_ = 0;
+
+ this->factory_->destroy_consumer_admin (this->consumer_admin_);
+ this->consumer_admin_ = 0;
+ this->factory_->destroy_supplier_admin (this->supplier_admin_);
+ this->supplier_admin_ = 0;
+
+ this->factory_->destroy_consumer_control (this->consumer_control_);
+ this->consumer_control_ = 0;
+ this->factory_->destroy_supplier_control (this->supplier_control_);
+ this->supplier_control_ = 0;
+
+ if (this->own_factory_)
+ delete this->factory_;
+}
+
+void
+TAO_CEC_EventChannel::activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->dispatching_->activate ();
+ this->pulling_strategy_->activate ();
+ this->consumer_control_->activate ();
+ this->supplier_control_->activate ();
+}
+
+void
+TAO_CEC_EventChannel::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->dispatching_->shutdown ();
+ this->pulling_strategy_->shutdown ();
+ this->supplier_control_->shutdown ();
+ this->consumer_control_->shutdown ();
+
+ PortableServer::POA_var consumer_poa =
+ this->consumer_admin_->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var consumer_id =
+ consumer_poa->servant_to_id (this->consumer_admin_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_poa->deactivate_object (consumer_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::POA_var supplier_poa =
+ this->supplier_admin_->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var supplier_id =
+ supplier_poa->servant_to_id (this->supplier_admin_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ supplier_poa->deactivate_object (supplier_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_admin_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_admin_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_EventChannel::connected (TAO_CEC_ProxyPushConsumer* consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_admin_->connected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_EventChannel::reconnected (TAO_CEC_ProxyPushConsumer* consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_admin_->reconnected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_EventChannel::disconnected (TAO_CEC_ProxyPushConsumer* consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_admin_->disconnected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_EventChannel::connected (TAO_CEC_ProxyPullConsumer* consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_admin_->connected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_EventChannel::reconnected (TAO_CEC_ProxyPullConsumer* consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_admin_->reconnected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_EventChannel::disconnected (TAO_CEC_ProxyPullConsumer* consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_admin_->disconnected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_EventChannel::connected (TAO_CEC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->consumer_admin_->connected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_EventChannel::reconnected (TAO_CEC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->consumer_admin_->reconnected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_EventChannel::disconnected (TAO_CEC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->consumer_admin_->disconnected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_EventChannel::connected (TAO_CEC_ProxyPullSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->consumer_admin_->connected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_EventChannel::reconnected (TAO_CEC_ProxyPullSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->consumer_admin_->reconnected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_EventChannel::disconnected (TAO_CEC_ProxyPullSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->consumer_admin_->disconnected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CosEventChannelAdmin::ConsumerAdmin_ptr
+TAO_CEC_EventChannel::for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->consumer_admin_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosEventChannelAdmin::SupplierAdmin_ptr
+TAO_CEC_EventChannel::for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->supplier_admin_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_EventChannel::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Policy_ptr TAO_CEC_EventChannel::create_roundtrip_timeout_policy
+(const ACE_Time_Value &timeout)
+{
+ return this->factory_->create_roundtrip_timeout_policy (timeout);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.h
new file mode 100644
index 00000000000..b25f91e9054
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.h
@@ -0,0 +1,316 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_EventChannel.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * A new implementation of the COS Event Channel.
+ * This version does not rely on the RTEC in its implementation.
+ *
+ *
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_EVENTCHANNEL_H
+#define TAO_CEC_EVENTCHANNEL_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEvent/CEC_Factory.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosEventChannelAdminS.h"
+
+#include "orbsvcs/CosEvent/CEC_Defaults.h"
+#include "orbsvcs/CosEvent/event_serv_export.h"
+#include "ace/Hash_Map_Manager.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_CEC_EventChannel_Attributes
+ *
+ * @brief Defines the construction time attributes for the Event
+ * Channel.
+ *
+ * The event channel implementation is controlled by two
+ * mechanisms:
+ * The CEC_Factory that provides the strategies for the EC
+ * implementation.
+ * The EC attributes that define constants and values required
+ * by the EC construction.
+ * This class encapsulates those constants and values, providing
+ * an easy mechanism to extend the attributes without requiring
+ * changes in the EC constructor.
+ */
+class TAO_Event_Serv_Export TAO_CEC_EventChannel_Attributes
+{
+public:
+ /**
+ * The basic constructor.
+ * The attributes listed as arguments are *required* by the EC, and
+ * no appropiate defaults are available for them.
+ */
+ TAO_CEC_EventChannel_Attributes (PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa);
+
+ // Most fields are public, there is no need to protect them, in fact
+ // the user should be able to set any values she wants.
+
+ /// Can consumers or suppliers invoke connect_push_* multiple times?
+ int consumer_reconnect;
+ int supplier_reconnect;
+
+ /**
+ * If not zero the event channel will send disconnect callbacks when
+ * a disconnect method is called on a Proxy. In other words, if a
+ * consumer calls disconnect_push_supplier() on its proxy the EC
+ * will invoke disconnect_push_consumer() on the consumer. A
+ * similar thing is done for suppliers.
+ * It is a matter of debate what the spec requires for the regular
+ * event service.
+ */
+ int disconnect_callbacks;
+
+private:
+ /// Only the EC can read the private fields.
+ friend class TAO_CEC_EventChannel;
+
+ /// The POAs
+ PortableServer::POA_ptr supplier_poa;
+ PortableServer::POA_ptr consumer_poa;
+};
+
+/**
+ * @class TAO_CEC_EventChannel
+ *
+ * @brief The CosEventChannelAdmin::EventChannel implementation.
+ *
+ * This class is the Mediator between all the classes in the EC
+ * implementation, its main task is to redirect the messages to
+ * the right components, to hold and manage the lifetime of the
+ * long lived objects (Timer_Module, SupplierAdmin,
+ * ConsumerAdmin and Dispatching) and to provide a simpler
+ * interface to the CEC_Factory.
+ */
+class TAO_Event_Serv_Export TAO_CEC_EventChannel : public POA_CosEventChannelAdmin::EventChannel
+{
+public:
+ class ServantBaseHash
+ {
+ public:
+ u_long operator() (PortableServer::ServantBase* const & ptr) const {
+ return reinterpret_cast<u_long> (ptr);
+ }
+ };
+
+ typedef ACE_Hash_Map_Manager_Ex<PortableServer::ServantBase*,
+ unsigned int,
+ ServantBaseHash,
+ ACE_Equal_To<PortableServer::ServantBase*>,
+ TAO_SYNCH_MUTEX> ServantRetryMap;
+
+ /**
+ * constructor
+ * If <own_factory> is not 0 it assumes ownership of the factory.
+ * If the factory is <nil> it uses the Service_Configurator to load
+ * the Factory, if not found it uses TAO_CEC_Default_Resource_Factory
+ */
+ TAO_CEC_EventChannel (const TAO_CEC_EventChannel_Attributes& attributes,
+ TAO_CEC_Factory* factory = 0,
+ int own_factory = 0);
+
+ /// destructor
+ virtual ~TAO_CEC_EventChannel (void);
+
+ /// Start the internal threads (if any), etc.
+ /// After this call the EC can be used.
+ virtual void activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// Shutdown any internal threads, cleanup all the internal
+ /// structures, flush all the messages, etc.
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// Access the dispatching module....
+ TAO_CEC_Dispatching* dispatching (void) const;
+
+ /// Access the consumer admin implementation.
+ TAO_CEC_ConsumerAdmin* consumer_admin (void) const;
+
+ /// Access the supplier admin implementation.
+ TAO_CEC_SupplierAdmin* supplier_admin (void) const;
+
+ /// Access the consumer control strategy.
+ TAO_CEC_ConsumerControl* consumer_control (void) const;
+
+ /// Access the supplier control strategy.
+ TAO_CEC_SupplierControl* supplier_control (void) const;
+
+ // = The factory methods, they delegate on the CEC_Factory.
+ /// Create and destroy a ProxyPushSupplier
+ void create_proxy (TAO_CEC_ProxyPushSupplier*&);
+ void destroy_proxy (TAO_CEC_ProxyPushSupplier*);
+
+ /// Create and destroy a ProxyPullSupplier
+ void create_proxy (TAO_CEC_ProxyPullSupplier*&);
+ void destroy_proxy (TAO_CEC_ProxyPullSupplier*);
+
+ /// Create and destroy a ProxyPushConsumer
+ void create_proxy (TAO_CEC_ProxyPushConsumer*&);
+ void destroy_proxy (TAO_CEC_ProxyPushConsumer*);
+
+ /// Create and destroy a ProxyPushConsumer
+ void create_proxy (TAO_CEC_ProxyPullConsumer*&);
+ void destroy_proxy (TAO_CEC_ProxyPullConsumer*);
+
+ /// Create and destroy a the collections used to store
+ /// Proxy*Suppliers
+ void create_proxy_collection (TAO_CEC_ProxyPushSupplier_Collection*&);
+ void destroy_proxy_collection (TAO_CEC_ProxyPushSupplier_Collection*);
+ void create_proxy_collection (TAO_CEC_ProxyPullSupplier_Collection*&);
+ void destroy_proxy_collection (TAO_CEC_ProxyPullSupplier_Collection*);
+
+ /// Create and destroy a the collections used to store
+ /// Proxy*Consumers
+ void create_proxy_collection (TAO_CEC_ProxyPushConsumer_Collection*&);
+ void destroy_proxy_collection (TAO_CEC_ProxyPushConsumer_Collection*);
+ void create_proxy_collection (TAO_CEC_ProxyPullConsumer_Collection*&);
+ void destroy_proxy_collection (TAO_CEC_ProxyPullConsumer_Collection*);
+
+ /// Access the supplier and consumer POAs from the factory.
+ PortableServer::POA_ptr supplier_poa (void);
+ PortableServer::POA_ptr consumer_poa (void);
+
+ /// Locking strategies for the ProxyPushConsumer and
+ /// ProxyPushSupplier objects
+ ACE_Lock* create_consumer_lock (void);
+ void destroy_consumer_lock (ACE_Lock*);
+ ACE_Lock* create_supplier_lock (void);
+ void destroy_supplier_lock (ACE_Lock*);
+
+ /// Used to inform the EC that a Consumer has connected or
+ /// disconnected from it.
+ virtual void connected (TAO_CEC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void reconnected (TAO_CEC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_CEC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void connected (TAO_CEC_ProxyPullConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void reconnected (TAO_CEC_ProxyPullConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_CEC_ProxyPullConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Used to inform the EC that a Supplier has connected or
+ /// disconnected from it.
+ virtual void connected (TAO_CEC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void reconnected (TAO_CEC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_CEC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void connected (TAO_CEC_ProxyPullSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void reconnected (TAO_CEC_ProxyPullSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_CEC_ProxyPullSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ // Simple flags to control the EC behavior, set by the application
+ // at construction time.
+
+ /// Can the consumers reconnect to the EC?
+ int consumer_reconnect (void) const;
+
+ /// Can the suppliers reconnect to the EC?
+ int supplier_reconnect (void) const;
+
+ /// Should we send callback disconnect messages when a proxy is
+ /// disconnected by the client
+ int disconnect_callbacks (void) const;
+
+ // = The CosEventChannelAdmin::EventChannel methods...
+ /// The default implementation is:
+ /// this->consumer_admin ()->_this (env);
+ virtual CosEventChannelAdmin::ConsumerAdmin_ptr
+ for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// The default implementation is:
+ /// this->supplier_admin ()->_this (env);
+ virtual CosEventChannelAdmin::SupplierAdmin_ptr
+ for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Commit suicide.
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ServantRetryMap& get_servant_retry_map (void);
+
+ /// Forwarded to the factory
+ CORBA::Policy_ptr
+ create_roundtrip_timeout_policy (const ACE_Time_Value &timeout);
+
+private:
+ /// The POAs used to activate "supplier-side" and "consumer-side"
+ /// objects.
+ PortableServer::POA_var supplier_poa_;
+ PortableServer::POA_var consumer_poa_;
+
+ /**
+ * This is the abstract factory that creates all the objects that
+ * compose an event channel, the event channel simply acts as a
+ * Mediator among them.
+ */
+ TAO_CEC_Factory *factory_;
+
+ /// Flag that indicates if we own the factory.
+ int own_factory_;
+
+ /// The dispatching "module"
+ TAO_CEC_Dispatching *dispatching_;
+
+ /// The pulling strategy
+ TAO_CEC_Pulling_Strategy *pulling_strategy_;
+
+ /// The ConsumerAdmin implementation
+ TAO_CEC_ConsumerAdmin *consumer_admin_;
+
+ /// The SupplierAdmin implementation
+ TAO_CEC_SupplierAdmin *supplier_admin_;
+
+ /// Consumer/Supplier reconnection flags
+ int consumer_reconnect_;
+ int supplier_reconnect_;
+
+ /// If not zero we send callbacks when a proxy is disconnected
+ int disconnect_callbacks_;
+
+ /// Strategies to disconnect misbehaving or destroyed consumers and
+ /// suppliers
+ TAO_CEC_ConsumerControl *consumer_control_;
+ TAO_CEC_SupplierControl *supplier_control_;
+
+ ServantRetryMap retry_map_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_EventChannel.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_EVENT_CHANNEL_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.i
new file mode 100644
index 00000000000..23f8e906f7c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_EventChannel.i
@@ -0,0 +1,205 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_CEC_EventChannel_Attributes::
+TAO_CEC_EventChannel_Attributes (PortableServer::POA_ptr s_poa,
+ PortableServer::POA_ptr c_poa)
+ : consumer_reconnect (TAO_CEC_DEFAULT_CONSUMER_RECONNECT),
+ supplier_reconnect (TAO_CEC_DEFAULT_SUPPLIER_RECONNECT),
+ disconnect_callbacks (TAO_CEC_DEFAULT_DISCONNECT_CALLBACKS),
+ supplier_poa (s_poa),
+ consumer_poa (c_poa)
+{
+}
+
+ACE_INLINE TAO_CEC_Dispatching*
+TAO_CEC_EventChannel::dispatching (void) const
+{
+ return this->dispatching_;
+}
+
+ACE_INLINE TAO_CEC_ConsumerAdmin*
+TAO_CEC_EventChannel::consumer_admin (void) const
+{
+ return this->consumer_admin_;
+}
+
+ACE_INLINE TAO_CEC_SupplierAdmin*
+TAO_CEC_EventChannel::supplier_admin (void) const
+{
+ return this->supplier_admin_;
+}
+
+ACE_INLINE TAO_CEC_ConsumerControl*
+TAO_CEC_EventChannel::consumer_control (void) const
+{
+ return this->consumer_control_;
+}
+
+ACE_INLINE TAO_CEC_SupplierControl*
+TAO_CEC_EventChannel::supplier_control (void) const
+{
+ return this->supplier_control_;
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::create_proxy (TAO_CEC_ProxyPushSupplier* &x)
+{
+ x = this->factory_->create_proxy_push_supplier (this);
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::destroy_proxy (TAO_CEC_ProxyPushSupplier* supplier)
+{
+ this->factory_->destroy_proxy_push_supplier (supplier);
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::create_proxy (TAO_CEC_ProxyPullSupplier* &x)
+{
+ x = this->factory_->create_proxy_pull_supplier (this);
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::destroy_proxy (TAO_CEC_ProxyPullSupplier* supplier)
+{
+ this->factory_->destroy_proxy_pull_supplier (supplier);
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::create_proxy (TAO_CEC_ProxyPushConsumer* &x)
+{
+ x = this->factory_->create_proxy_push_consumer (this);
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::destroy_proxy (TAO_CEC_ProxyPushConsumer* consumer)
+{
+ this->factory_->destroy_proxy_push_consumer (consumer);
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::create_proxy (TAO_CEC_ProxyPullConsumer* &x)
+{
+ x = this->factory_->create_proxy_pull_consumer (this);
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::destroy_proxy (TAO_CEC_ProxyPullConsumer* consumer)
+{
+ this->factory_->destroy_proxy_pull_consumer (consumer);
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::create_proxy_collection (TAO_CEC_ProxyPushConsumer_Collection* &x)
+{
+ x = this->factory_->create_proxy_push_consumer_collection (this);
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::destroy_proxy_collection (TAO_CEC_ProxyPushConsumer_Collection* x)
+{
+ this->factory_->destroy_proxy_push_consumer_collection (x);
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::create_proxy_collection (TAO_CEC_ProxyPullConsumer_Collection* &x)
+{
+ x = this->factory_->create_proxy_pull_consumer_collection (this);
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::destroy_proxy_collection (TAO_CEC_ProxyPullConsumer_Collection* x)
+{
+ this->factory_->destroy_proxy_pull_consumer_collection (x);
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::create_proxy_collection (TAO_CEC_ProxyPushSupplier_Collection* &x)
+{
+ x = this->factory_->create_proxy_push_supplier_collection (this);
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::destroy_proxy_collection (TAO_CEC_ProxyPushSupplier_Collection* x)
+{
+ this->factory_->destroy_proxy_push_supplier_collection (x);
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::create_proxy_collection (TAO_CEC_ProxyPullSupplier_Collection* &x)
+{
+ x = this->factory_->create_proxy_pull_supplier_collection (this);
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::destroy_proxy_collection (TAO_CEC_ProxyPullSupplier_Collection* x)
+{
+ this->factory_->destroy_proxy_pull_supplier_collection (x);
+}
+
+ACE_INLINE PortableServer::POA_ptr
+TAO_CEC_EventChannel::supplier_poa (void)
+{
+ return PortableServer::POA::_duplicate (this->supplier_poa_.in ());
+}
+
+ACE_INLINE PortableServer::POA_ptr
+TAO_CEC_EventChannel::consumer_poa (void)
+{
+ return PortableServer::POA::_duplicate (this->consumer_poa_.in ());
+}
+
+ACE_INLINE ACE_Lock*
+TAO_CEC_EventChannel::create_consumer_lock (void)
+{
+ return this->factory_->create_consumer_lock ();
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::destroy_consumer_lock (ACE_Lock* x)
+{
+ this->factory_->destroy_consumer_lock (x);
+}
+
+ACE_INLINE ACE_Lock*
+TAO_CEC_EventChannel::create_supplier_lock (void)
+{
+ return this->factory_->create_supplier_lock ();
+}
+
+ACE_INLINE void
+TAO_CEC_EventChannel::destroy_supplier_lock (ACE_Lock* x)
+{
+ this->factory_->destroy_supplier_lock (x);
+}
+
+ACE_INLINE int
+TAO_CEC_EventChannel::consumer_reconnect (void) const
+{
+ return this->consumer_reconnect_;
+}
+
+ACE_INLINE int
+TAO_CEC_EventChannel::supplier_reconnect (void) const
+{
+ return this->supplier_reconnect_;
+}
+
+ACE_INLINE int
+TAO_CEC_EventChannel::disconnect_callbacks (void) const
+{
+ return this->disconnect_callbacks_;
+}
+
+ACE_INLINE TAO_CEC_EventChannel::ServantRetryMap&
+TAO_CEC_EventChannel::get_servant_retry_map (void)
+{
+ return this->retry_map_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Event_Loader.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Event_Loader.cpp
new file mode 100644
index 00000000000..e9a9e726717
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Event_Loader.cpp
@@ -0,0 +1,536 @@
+// $Id$
+
+//==========================================================================
+// LIBRARY
+// libTAO_CosEvent.so
+//
+// DESCRIPTION
+// This class allows for dynamically loading
+// the Event Service.
+//
+// AUTHOR
+// Priyanka Gontla <pgontla@ece.uci.edu>
+// Carlos O'Ryan <coryan@uci.edu>
+// Jon Astle <jon@astle45.fsnet.co.uk>
+//
+//===========================================================================
+
+#include "orbsvcs/CosEvent/CEC_Event_Loader.h"
+#include "ace/Dynamic_Service.h"
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_Default_Factory.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Argv_Type_Converter.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+#include "tao/debug.h"
+
+ACE_RCSID (CosEvent,
+ CEC_Event_Loader,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_CEC_Event_Loader::TAO_CEC_Event_Loader (void) :
+ attributes_ (0)
+ , factory_ (0)
+ , ec_impl_ (0)
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ , typed_attributes_ (0)
+ , typed_ec_impl_ (0)
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+{
+ // Constructor
+}
+
+TAO_CEC_Event_Loader::~TAO_CEC_Event_Loader (void)
+{
+ // Destructor
+}
+
+int
+TAO_CEC_Event_Loader::init (int argc, ACE_TCHAR *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Copy command line parameter.
+ ACE_Argv_Type_Converter command_line(argc, argv);
+
+ // ORB initialization boiler plate...
+ this->orb_=
+ CORBA::ORB_init (command_line.get_argc(), command_line.get_ASCII_argv(), 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj =
+ this->create_object (this->orb_.in (), command_line.get_argc(), command_line.get_TCHAR_argv() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (obj.in() ))
+ return -1;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, argv[0]);
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+
+CORBA::Object_ptr
+TAO_CEC_Event_Loader::create_object (CORBA::ORB_ptr orb,
+ int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ // ****************************************************************
+
+ // @@ Some ideas for improvement (not that you have to implement
+ // them):
+ // - Receive a child POA name from the command line, and create
+ // all the objects in that child POA (easier to destroy stuff
+ // that way).
+ // - Receive an option to register the Event Service with the
+ // _tao_add_to_IOR_table() stuff..
+
+ // Parse the options, check if we should bind with the naming
+ // service and under what name...
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("n:o:p:xrtdb"));
+ int opt;
+ const ACE_TCHAR *service_name = ACE_TEXT("CosEventService");
+ const ACE_TCHAR *ior_file = 0;
+ const ACE_TCHAR *pid_file = 0;
+ this->bind_to_naming_service_ = 1;
+ int use_rebind = 0;
+ int disconnect_callbacks = 0;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ // Flag to create a typed event channel
+ int typed_ec = 0;
+ // Flag to destroy the event channel on shutdown
+ int destroy = 0;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'n':
+ service_name = get_opt.opt_arg ();
+ break;
+
+ case 'o':
+ ior_file = get_opt.opt_arg ();
+ break;
+
+ case 'p':
+ pid_file = get_opt.opt_arg ();
+ break;
+
+ case 'x':
+ this->bind_to_naming_service_ = 0;
+ break;
+
+ case 'r':
+ use_rebind = 1;
+ break;
+
+ case 'b':
+ disconnect_callbacks = 1;
+ break;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ case 't':
+ typed_ec = 1;
+ break;
+
+ case 'd':
+ destroy = 1;
+ break;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ case '?':
+ default:
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Usage: %s ")
+ ACE_TEXT ("-n service_name ")
+ ACE_TEXT ("-o ior_file_name ")
+ ACE_TEXT ("-p pid_file_name ")
+ ACE_TEXT ("-x [disable naming service bind]")
+ ACE_TEXT ("-r [rebind, no AlreadyBound failures] ")
+ ACE_TEXT ("-b [send callBacks on disconnect] ")
+ ACE_TEXT ("-t [enable typed event channel]")
+ ACE_TEXT ("-d [destroy typed event channelon shutdown] ")
+ ACE_TEXT ("\n"),
+ argv[0]));
+#else
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Usage: %s ")
+ ACE_TEXT ("-n service_name ")
+ ACE_TEXT ("-o ior_file_name ")
+ ACE_TEXT ("-p pid_file_name ")
+ ACE_TEXT ("-x [disable naming service bind] ")
+ ACE_TEXT ("-r [rebind, no AlreadyBound failures] ")
+ ACE_TEXT ("-b [send callBacks on disconnect] ")
+ ACE_TEXT ("\n"),
+ argv[0]));
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+ return CORBA::Object::_nil ();
+ }
+ }
+
+ // ***************************************************************
+
+ // POA initialization and activation ...
+ 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;
+
+
+ // ****************************************************************
+
+ // Control the event loop
+ this->terminate_flag_ = 0;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (!typed_ec)
+ {
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ // Create and activate the event service
+ this->attributes_ = new TAO_CEC_EventChannel_Attributes(poa.in (),
+ poa.in ());
+
+ this->attributes_->disconnect_callbacks = disconnect_callbacks;
+
+ this->factory_ = 0;
+
+ this->ec_impl_ = new TAO_CEC_EventChannel (*this->attributes_,
+ this->factory_,
+ this->terminate_flag_);
+
+ this->ec_impl_->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosEventChannelAdmin::EventChannel_var event_channel =
+ this->ec_impl_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ior_file != 0)
+ {
+ CORBA::String_var ior =
+ orb->object_to_string (event_channel.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ FILE *iorf = ACE_OS::fopen (ior_file, ACE_TEXT("w"));
+ if (iorf != 0)
+ {
+ ACE_OS::fprintf (iorf, "%s\n", ior.in ());
+ ACE_OS::fclose (iorf);
+ }
+ }
+
+ if (pid_file != 0)
+ {
+ FILE *pidf = ACE_OS::fopen (pid_file, ACE_TEXT("w"));
+ if (pidf != 0)
+ {
+ ACE_OS::fprintf (pidf,
+ "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pidf);
+ }
+ }
+
+ // ****************************************************************
+
+ this->channel_name_.length (1);
+
+ if (this->bind_to_naming_service_)
+ {
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->naming_context_ =
+ CosNaming::NamingContext::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->channel_name_.length (1);
+ this->channel_name_[0].id = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR(service_name));
+
+ if (use_rebind)
+ {
+ this->naming_context_->rebind (this->channel_name_,
+ event_channel.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ this->naming_context_->bind (this->channel_name_,
+ event_channel.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ return CosEventChannelAdmin::EventChannel::_duplicate (event_channel.in () );
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ }
+ else
+ {
+ // If Typed EC, initialize the IFR, then create and activate the typed event service
+
+ // ****************************************************************
+ // IFR initialization
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** Initializing the IFR connection... *****\n")));
+ }
+
+ CORBA::Repository_var interface_repository;
+
+ CORBA::Object_var ifr_obj_var =
+ orb->resolve_initial_references ("InterfaceRepository" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil(ifr_obj_var.in () ))
+ {
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** resolve_initial_references for IFR failed\n *****")));
+ }
+ return CORBA::Object::_nil ();
+ }
+ else
+ {
+ interface_repository = CORBA::Repository::_narrow(ifr_obj_var.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil(interface_repository.in () ))
+ {
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** CORBA::Repository::_narrow failed *****\n")));
+ }
+ return CORBA::Object::_nil ();
+ }
+ else
+ {
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** ...IFR connection completed *****\n")));
+ }
+ }
+ }
+
+ // Create and activate the typed event service
+ this->typed_attributes_ = new TAO_CEC_TypedEventChannel_Attributes(poa.in (),
+ poa.in (),
+ orb,
+ interface_repository.in ());
+ if (destroy == 1)
+ {
+ this->typed_attributes_->destroy_on_shutdown = 1;
+ }
+
+ this->typed_attributes_->disconnect_callbacks = disconnect_callbacks;
+
+ this->factory_ = 0;
+
+ this->typed_ec_impl_ = new TAO_CEC_TypedEventChannel (*this->typed_attributes_,
+ this->factory_,
+ this->terminate_flag_);
+
+ this->typed_ec_impl_->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosTypedEventChannelAdmin::TypedEventChannel_var event_channel =
+ this->typed_ec_impl_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ior_file != 0)
+ {
+ CORBA::String_var ior =
+ orb->object_to_string (event_channel.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ FILE *iorf = ACE_OS::fopen (ior_file, ACE_TEXT("w"));
+ if (iorf != 0)
+ {
+ ACE_OS::fprintf (iorf, "%s\n", ior.in ());
+ ACE_OS::fclose (iorf);
+ }
+ }
+
+ if (pid_file != 0)
+ {
+ FILE *pidf = ACE_OS::fopen (pid_file, ACE_TEXT("w"));
+ if (pidf != 0)
+ {
+ ACE_OS::fprintf (pidf,
+ "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pidf);
+ }
+ }
+
+ // ****************************************************************
+
+ this->channel_name_.length (1);
+
+ if (this->bind_to_naming_service_)
+ {
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->naming_context_ =
+ CosNaming::NamingContext::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->channel_name_.length (1);
+ this->channel_name_[0].id = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR(service_name));
+
+ if (use_rebind)
+ {
+ this->naming_context_->rebind (this->channel_name_,
+ event_channel.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ this->naming_context_->bind (this->channel_name_,
+ event_channel.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ return CosTypedEventChannelAdmin::TypedEventChannel::_duplicate (event_channel.in () );
+ }
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ // ****************************************************************
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, argv[0]);
+ return CORBA::Object::_nil ();
+ }
+ ACE_ENDTRY;
+}
+
+int
+TAO_CEC_Event_Loader::fini (void)
+{
+ // + Since it was activated with _this() you have to do the
+ // canonical:
+ // get_object_id
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if(this->typed_ec_impl_)
+ {
+ // Release the resources of the Typed Event Channel
+ this->typed_ec_impl_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Deactivate the Typed EC
+ // This will raise an exception if destroy == 1
+ PortableServer::POA_var t_poa =
+ this->typed_ec_impl_->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::ObjectId_var t_id =
+ t_poa->servant_to_id (this->typed_ec_impl_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ t_poa->deactivate_object (t_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+#else
+ // Release the resources of the Event Channel
+ this->ec_impl_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Deactivate the EC
+ PortableServer::POA_var poa =
+ this->ec_impl_->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this->ec_impl_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+ }
+ ACE_CATCHANY
+ {
+ // Do Nothing
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_TRY_EX (foo)
+ {
+ // Unbind the Naming Service
+ if (this->bind_to_naming_service_)
+ {
+ this->naming_context_->unbind (this->channel_name_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (foo);
+ }
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ // Since we created them, we also have to delete them.
+ delete this->typed_attributes_;
+ delete this->typed_ec_impl_;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+ delete this->attributes_;
+ delete this->ec_impl_;
+ }
+ ACE_CATCHANY
+ {
+ // Do Nothing
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_Event_Serv, TAO_CEC_Event_Loader)
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Event_Loader.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Event_Loader.h
new file mode 100644
index 00000000000..28bfe57bad7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Event_Loader.h
@@ -0,0 +1,110 @@
+// -*- C++ -*-
+
+/**
+ * @file CEC_Event_Loader.h
+ *
+ * $Id$
+ *
+ * Define a class to dynamically load the COS Event Service.
+ *
+ * @author Priyanka Gontla <pgontla@ece.uci.edu>
+ */
+
+#ifndef TAO_CEC_EVENT_LOADER_H
+#define TAO_CEC_EVENT_LOADER_H
+
+#include "tao/Object_Loader.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+#include "orbsvcs/CosEvent/CEC_TypedEventChannel.h"
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+#include "orbsvcs/CosNamingC.h"
+
+#include "ace/Service_Config.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_CEC_Event_Loader
+ *
+ * @brief Dynamically load an instance of the COS Event Service.
+ */
+class TAO_Event_Serv_Export TAO_CEC_Event_Loader : public TAO_Object_Loader
+{
+public:
+ /// Constructor
+ TAO_CEC_Event_Loader (void);
+
+ /// Destructor
+ ~TAO_CEC_Event_Loader (void);
+
+ //@{
+ /**
+ * @name Derived from ACE_Service_Object
+ */
+ virtual int init (int argc, ACE_TCHAR *argv[]);
+ virtual int fini (void);
+ //@}
+
+ //@{
+ /**
+ * @name Derived from TAO_Object_Loader
+ */
+ virtual CORBA::Object_ptr create_object (CORBA::ORB_ptr orb,
+ int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+protected:
+ /// Keep a pointer to the underlying ORB.
+ CORBA::ORB_var orb_;
+
+ /// Flag to control the event loop
+ int terminate_flag_;
+
+ /// Attributes used to configure the Event Service properties.
+ TAO_CEC_EventChannel_Attributes *attributes_;
+
+ /// Factory used to configure the Event Service strategies.
+ TAO_CEC_Factory *factory_;
+
+ /// The Event Service implementation class.
+ TAO_CEC_EventChannel *ec_impl_;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ /// Attributes used to configure the Typed Event Service properties.
+ TAO_CEC_TypedEventChannel_Attributes *typed_attributes_;
+
+ /// The Typed Event Service implementation class.
+ TAO_CEC_TypedEventChannel *typed_ec_impl_;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /// Naming Context needed if '-x' option is passed
+ CosNaming::NamingContext_var naming_context_;
+
+ /// Flag to check if '-x' option is passed
+ int bind_to_naming_service_;
+
+ /// The name used when binding to the NamingService.
+ CosNaming::Name channel_name_;
+
+private:
+ // Disallow copying and assignment.
+ TAO_CEC_Event_Loader (const TAO_CEC_Event_Loader &);
+ TAO_CEC_Event_Loader &operator= (const TAO_CEC_Event_Loader &);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DECLARE (TAO_Event_Serv, TAO_CEC_Event_Loader)
+
+#endif /* TAO_CEC_EVENT_LOADER_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Factory.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Factory.cpp
new file mode 100644
index 00000000000..e2ffe759211
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Factory.cpp
@@ -0,0 +1,14 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_Factory.h"
+#include "ace/Dynamic_Service.h"
+
+ACE_RCSID(CosEvent, CEC_Factory, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_CEC_Factory::~TAO_CEC_Factory (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Factory.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Factory.h
new file mode 100644
index 00000000000..787bdca5177
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Factory.h
@@ -0,0 +1,235 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_Factory.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_FACTORY_H
+#define TAO_CEC_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEvent/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Service_Object.h"
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+#include "tao/AnyTypeCode/AnyTypeCode_methods.h"
+#endif
+
+#include "tao/Policy_ForwardC.h"
+#include "tao/Versioned_Namespace.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Lock;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_EventChannel;
+
+class TAO_CEC_Dispatching;
+class TAO_CEC_Pulling_Strategy;
+class TAO_CEC_ConsumerAdmin;
+class TAO_CEC_SupplierAdmin;
+class TAO_CEC_ProxyPushConsumer;
+class TAO_CEC_ProxyPullConsumer;
+class TAO_CEC_ProxyPushSupplier;
+class TAO_CEC_ProxyPullSupplier;
+template<class PROXY> class TAO_ESF_Proxy_Collection;
+class TAO_CEC_ConsumerControl;
+class TAO_CEC_SupplierControl;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+class TAO_CEC_TypedEventChannel;
+class TAO_CEC_TypedProxyPushConsumer;
+class TAO_CEC_TypedConsumerAdmin;
+class TAO_CEC_TypedSupplierAdmin;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+typedef TAO_ESF_Proxy_Collection<TAO_CEC_ProxyPushConsumer> TAO_CEC_ProxyPushConsumer_Collection;
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+typedef TAO_ESF_Proxy_Collection<TAO_CEC_TypedProxyPushConsumer> TAO_CEC_TypedProxyPushConsumer_Collection;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+typedef TAO_ESF_Proxy_Collection<TAO_CEC_ProxyPullConsumer> TAO_CEC_ProxyPullConsumer_Collection;
+typedef TAO_ESF_Proxy_Collection<TAO_CEC_ProxyPushSupplier> TAO_CEC_ProxyPushSupplier_Collection;
+typedef TAO_ESF_Proxy_Collection<TAO_CEC_ProxyPullSupplier> TAO_CEC_ProxyPullSupplier_Collection;
+
+/**
+ * @class TAO_CEC_Factory
+ *
+ * @brief Abstract factory for the CosEventChannel components.
+ *
+ * The CosEventChannel implementation can be configured at
+ * initialization time through several strategies and
+ * components. This class defines the interface of an Abstract
+ * Factory that creates all such components.
+ * = MEMORY MANAGMENT
+ * The objects it creates are owned by this class, the client must
+ * invoke the corresponding destroy() method to release them.
+ * Some implementations may require a different instance for the
+ * CEC_Factory for each instance of a CEC_EventChannel.
+ */
+class TAO_Event_Serv_Export TAO_CEC_Factory : public ACE_Service_Object
+{
+public:
+ /// destructor...
+ virtual ~TAO_CEC_Factory (void);
+
+ /// Create and destroy the dispatching module.
+ virtual TAO_CEC_Dispatching*
+ create_dispatching (TAO_CEC_EventChannel*) = 0;
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ virtual TAO_CEC_Dispatching*
+ create_dispatching (TAO_CEC_TypedEventChannel*) = 0;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+ virtual void
+ destroy_dispatching (TAO_CEC_Dispatching*) = 0;
+
+ /// Create and destroy the pulling strategy.
+ virtual TAO_CEC_Pulling_Strategy*
+ create_pulling_strategy (TAO_CEC_EventChannel*) = 0;
+ virtual void
+ destroy_pulling_strategy (TAO_CEC_Pulling_Strategy*) = 0;
+
+ /// Create and destroy the consumer admin implementation.
+ virtual TAO_CEC_ConsumerAdmin*
+ create_consumer_admin (TAO_CEC_EventChannel*) = 0;
+ virtual void
+ destroy_consumer_admin (TAO_CEC_ConsumerAdmin*) = 0;
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ virtual TAO_CEC_TypedConsumerAdmin*
+ create_consumer_admin (TAO_CEC_TypedEventChannel*) = 0;
+ virtual void
+ destroy_consumer_admin (TAO_CEC_TypedConsumerAdmin*) = 0;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /// Create and destroy the supplier admin implementation.
+ virtual TAO_CEC_SupplierAdmin*
+ create_supplier_admin (TAO_CEC_EventChannel*) = 0;
+ virtual void
+ destroy_supplier_admin (TAO_CEC_SupplierAdmin*) = 0;
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ virtual TAO_CEC_TypedSupplierAdmin*
+ create_supplier_admin (TAO_CEC_TypedEventChannel*) = 0;
+ virtual void
+ destroy_supplier_admin (TAO_CEC_TypedSupplierAdmin*) = 0;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /// Create and destroy a ProxyPushSupplier
+ virtual TAO_CEC_ProxyPushSupplier*
+ create_proxy_push_supplier (TAO_CEC_EventChannel*) = 0;
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ virtual TAO_CEC_ProxyPushSupplier*
+ create_proxy_push_supplier (TAO_CEC_TypedEventChannel*) = 0;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+ virtual void
+ destroy_proxy_push_supplier (TAO_CEC_ProxyPushSupplier*) = 0;
+
+ /// Create and destroy a ProxyPullSupplier
+ virtual TAO_CEC_ProxyPullSupplier*
+ create_proxy_pull_supplier (TAO_CEC_EventChannel*) = 0;
+ virtual void
+ destroy_proxy_pull_supplier (TAO_CEC_ProxyPullSupplier*) = 0;
+
+ /// Create and destroy a ProxyPushConsumer
+ virtual TAO_CEC_ProxyPushConsumer*
+ create_proxy_push_consumer (TAO_CEC_EventChannel*) = 0;
+ virtual void
+ destroy_proxy_push_consumer (TAO_CEC_ProxyPushConsumer*) = 0;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ /// Create and destroy a TypedProxyPushConsumer
+ virtual TAO_CEC_TypedProxyPushConsumer*
+ create_proxy_push_consumer (TAO_CEC_TypedEventChannel*) = 0;
+ virtual void
+ destroy_proxy_push_consumer (TAO_CEC_TypedProxyPushConsumer*) = 0;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /// Create and destroy a ProxyPullConsumer
+ virtual TAO_CEC_ProxyPullConsumer*
+ create_proxy_pull_consumer (TAO_CEC_EventChannel*) = 0;
+ virtual void
+ destroy_proxy_pull_consumer (TAO_CEC_ProxyPullConsumer*) = 0;
+
+ /// Create and destroy a collection of TAO_CEC_ProxyPushConsumers
+ virtual TAO_CEC_ProxyPushConsumer_Collection*
+ create_proxy_push_consumer_collection (TAO_CEC_EventChannel*) = 0;
+ virtual void
+ destroy_proxy_push_consumer_collection (TAO_CEC_ProxyPushConsumer_Collection*) = 0;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ /// Create and destroy a collection of TAO_CEC_TypedProxyPushConsumers
+ virtual TAO_CEC_TypedProxyPushConsumer_Collection*
+ create_proxy_push_consumer_collection (TAO_CEC_TypedEventChannel*) = 0;
+ virtual void
+ destroy_proxy_push_consumer_collection (TAO_CEC_TypedProxyPushConsumer_Collection*) = 0;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /// Create and destroy a collection of TAO_CEC_ProxyPullConsumers
+ virtual TAO_CEC_ProxyPullConsumer_Collection*
+ create_proxy_pull_consumer_collection (TAO_CEC_EventChannel*) = 0;
+ virtual void
+ destroy_proxy_pull_consumer_collection (TAO_CEC_ProxyPullConsumer_Collection*) = 0;
+
+ /// Create and destroy a collection of TAO_CEC_ProxyPushSuppliers
+ virtual TAO_CEC_ProxyPushSupplier_Collection*
+ create_proxy_push_supplier_collection (TAO_CEC_EventChannel*) = 0;
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ virtual TAO_CEC_ProxyPushSupplier_Collection*
+ create_proxy_push_supplier_collection (TAO_CEC_TypedEventChannel*) = 0;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+ virtual void
+ destroy_proxy_push_supplier_collection (TAO_CEC_ProxyPushSupplier_Collection*) = 0;
+
+ /// Create and destroy a collection of TAO_CEC_ProxyPullSuppliers
+ virtual TAO_CEC_ProxyPullSupplier_Collection*
+ create_proxy_pull_supplier_collection (TAO_CEC_EventChannel*) = 0;
+ virtual void
+ destroy_proxy_pull_supplier_collection (TAO_CEC_ProxyPullSupplier_Collection*) = 0;
+
+ /// Create and destroy the locking strategies for both
+ /// ProxyPushConsumers and ProxyPushSuppliers
+ virtual ACE_Lock* create_consumer_lock (void) = 0;
+ virtual void destroy_consumer_lock (ACE_Lock*) = 0;
+ virtual ACE_Lock* create_supplier_lock (void) = 0;
+ virtual void destroy_supplier_lock (ACE_Lock*) = 0;
+
+ /// The ConsumerControl and SupplierControl strategies are used to
+ /// discard non-existent consumers and suppliers
+ virtual TAO_CEC_ConsumerControl*
+ create_consumer_control (TAO_CEC_EventChannel*) = 0;
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ virtual TAO_CEC_ConsumerControl*
+ create_consumer_control (TAO_CEC_TypedEventChannel*) = 0;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+ virtual void
+ destroy_consumer_control (TAO_CEC_ConsumerControl*) = 0;
+ virtual TAO_CEC_SupplierControl*
+ create_supplier_control (TAO_CEC_EventChannel*) = 0;
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ virtual TAO_CEC_SupplierControl*
+ create_supplier_control (TAO_CEC_TypedEventChannel*) = 0;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+ virtual void
+ destroy_supplier_control (TAO_CEC_SupplierControl*) = 0;
+
+ virtual CORBA::Policy_ptr
+ create_roundtrip_timeout_policy (const ACE_Time_Value &timeout) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_CEC_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_MT_Dispatching.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_MT_Dispatching.cpp
new file mode 100644
index 00000000000..41f29d8a59e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_MT_Dispatching.cpp
@@ -0,0 +1,108 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_MT_Dispatching.h"
+
+ACE_RCSID(CosEvent, CEC_MT_Dispatching, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+
+TAO_CEC_MT_Dispatching::TAO_CEC_MT_Dispatching (int nthreads,
+ int thread_creation_flags,
+ int thread_priority,
+ int force_activate)
+ : nthreads_ (nthreads),
+ thread_creation_flags_ (thread_creation_flags),
+ thread_priority_ (thread_priority),
+ force_activate_ (force_activate),
+ task_ (&this->thread_manager_),
+ active_ (0)
+{
+}
+
+void
+TAO_CEC_MT_Dispatching::activate (void)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (this->active_ != 0)
+ return;
+
+ this->active_ = 1;
+
+ if (this->task_.activate (this->thread_creation_flags_,
+ this->nthreads_,
+ 1,
+ this->thread_priority_) == -1)
+ {
+ if (this->force_activate_ != 0)
+ {
+ if (this->task_.activate (THR_BOUND, this->nthreads_) == -1)
+ ACE_ERROR ((LM_ERROR,
+ "EC (%P|%t) cannot activate dispatching queue"));
+ }
+ }
+}
+
+void
+TAO_CEC_MT_Dispatching::shutdown (void)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (this->active_ == 0)
+ return;
+
+ for (int i = 0; i < this->nthreads_; ++i)
+ {
+ this->task_.putq (new TAO_CEC_Shutdown_Task_Command);
+ }
+ this->thread_manager_.wait ();
+}
+
+void
+TAO_CEC_MT_Dispatching::push (TAO_CEC_ProxyPushSupplier* proxy,
+ const CORBA::Any& event
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Any event_copy = event;
+ this->push_nocopy (proxy, event_copy ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_MT_Dispatching::push_nocopy (TAO_CEC_ProxyPushSupplier* proxy,
+ CORBA::Any& event
+ ACE_ENV_ARG_DECL)
+{
+ // Double checked locking....
+ if (this->active_ == 0)
+ this->activate ();
+
+ this->task_.push (proxy, event ACE_ENV_ARG_PARAMETER);
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+void
+TAO_CEC_MT_Dispatching::invoke (TAO_CEC_ProxyPushSupplier* proxy,
+ const TAO_CEC_TypedEvent& typed_event
+ ACE_ENV_ARG_DECL)
+{
+ TAO_CEC_TypedEvent typed_event_copy = typed_event;
+ this->invoke_nocopy (proxy, typed_event_copy ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_MT_Dispatching::invoke_nocopy (TAO_CEC_ProxyPushSupplier* proxy,
+ TAO_CEC_TypedEvent& typed_event
+ ACE_ENV_ARG_DECL)
+{
+ // Double checked locking....
+ if (this->active_ == 0)
+ this->activate ();
+
+ this->task_.invoke (proxy, typed_event ACE_ENV_ARG_PARAMETER);
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_MT_Dispatching.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_MT_Dispatching.h
new file mode 100644
index 00000000000..458110cad9a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_MT_Dispatching.h
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_MT_Dispatching.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_MT_DISPATCHING_H
+#define TAO_CEC_MT_DISPATCHING_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEvent/CEC_Dispatching.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosEvent/CEC_Dispatching_Task.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_EventChannel;
+
+/**
+ * @class TAO_CEC_MT_Dispatching
+ *
+ * @brief Dispatching strategy that minimizes mt inversion.
+ *
+ * This strategy uses a single queue, serviced by one or more
+ * threads. It's main purpose is to decouple the suppliers from
+ * the client execution time, specially in the collocated case.
+ */
+class TAO_Event_Serv_Export TAO_CEC_MT_Dispatching : public TAO_CEC_Dispatching
+{
+public:
+ /// Constructor
+ /// It will create <nthreads> servicing threads...
+ TAO_CEC_MT_Dispatching (int nthreads,
+ int thread_creation_flags,
+ int thread_priority,
+ int force_activate);
+
+ // = The EC_Dispatching methods.
+ virtual void activate (void);
+ virtual void shutdown (void);
+ virtual void push (TAO_CEC_ProxyPushSupplier* proxy,
+ const CORBA::Any & event
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (TAO_CEC_ProxyPushSupplier* proxy,
+ CORBA::Any& event
+ ACE_ENV_ARG_DECL);
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ virtual void invoke (TAO_CEC_ProxyPushSupplier *proxy,
+ const TAO_CEC_TypedEvent & typed_event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ virtual void invoke_nocopy (TAO_CEC_ProxyPushSupplier *proxy,
+ TAO_CEC_TypedEvent & typed_event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+private:
+ /// Use our own thread manager.
+ ACE_Thread_Manager thread_manager_;
+
+ /// The number of active tasks
+ int nthreads_;
+
+ /// The flags (THR_BOUND, THR_NEW_LWP, etc.) used to create the
+ /// dispatching threads.
+ int thread_creation_flags_;
+
+ /// The priority of the dispatching threads.
+ int thread_priority_;
+
+ /// If activation at the requested priority fails then we fallback on
+ /// the defaults for thread activation.
+ int force_activate_;
+
+ /// The dispatching task
+ TAO_CEC_Dispatching_Task task_;
+
+ /// Synchronize access to internal data
+ TAO_SYNCH_MUTEX lock_;
+
+ /// Are the threads running?
+ int active_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_MT_DISPATCHING_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullConsumer.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullConsumer.cpp
new file mode 100644
index 00000000000..4aedb1f17c0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullConsumer.cpp
@@ -0,0 +1,423 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_ProxyPullConsumer.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_ConsumerAdmin.h"
+#include "orbsvcs/CosEvent/CEC_SupplierControl.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPullSupplier.h"
+
+#include "ace/Reverse_Lock_T.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_ProxyPullConsumer.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (CosEvent,
+ CEC_ProxyPullConsumer,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef ACE_Reverse_Lock<ACE_Lock> TAO_CEC_Unlock;
+
+TAO_CEC_ProxyPullConsumer::
+TAO_CEC_ProxyPullConsumer (TAO_CEC_EventChannel* ec,
+ const ACE_Time_Value &timeout)
+ : event_channel_ (ec),
+ timeout_ (timeout),
+ refcount_ (1)
+{
+ this->lock_ =
+ this->event_channel_->create_consumer_lock ();
+
+ this->default_POA_ =
+ this->event_channel_->consumer_poa ();
+
+ this->event_channel_->get_servant_retry_map ().bind (this, 0);
+}
+
+TAO_CEC_ProxyPullConsumer::~TAO_CEC_ProxyPullConsumer (void)
+{
+ this->event_channel_->get_servant_retry_map ().unbind (this);
+ this->event_channel_->destroy_consumer_lock (this->lock_);
+}
+
+void
+TAO_CEC_ProxyPullConsumer::activate (
+ CosEventChannelAdmin::ProxyPullConsumer_ptr &activated_proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosEventChannelAdmin::ProxyPullConsumer_var result;
+ ACE_TRY
+ {
+ result = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ result = CosEventChannelAdmin::ProxyPullConsumer::_nil ();
+ }
+ ACE_ENDTRY;
+ activated_proxy = result._retn ();
+}
+
+void
+TAO_CEC_ProxyPullConsumer::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ PortableServer::POA_var poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Exceptions here should not be propagated. They usually
+ // indicate that an object is beign disconnected twice, or some
+ // race condition, but not a fault that the user needs to know
+ // about.
+ }
+ ACE_ENDTRY;
+}
+
+// NOTE: There is some amount of duplicated code here, but it is
+// intentional. Mainly we want to avoid locking overhead when
+// possible, thus the code flow is optimized for that case more than
+// for small code.
+
+CORBA::Any*
+TAO_CEC_ProxyPullConsumer::try_pull_from_supplier (
+ CORBA::Boolean_out has_event
+ ACE_ENV_ARG_DECL)
+{
+ has_event = 0;
+ CosEventComm::PullSupplier_var supplier;
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK_RETURN (0);
+
+ if (this->is_connected_i () == 0)
+ return 0; // ACE_THROW (CosEventComm::Disconnected ());????
+
+ supplier =
+ CosEventComm::PullSupplier::_duplicate (this->supplier_.in ());
+
+ // The refcount cannot be zero, because we have at least two
+ // references,
+ }
+
+ CORBA::Any_var any;
+ TAO_CEC_SupplierControl *control =
+ this->event_channel_->supplier_control ();
+
+ ACE_TRY
+ {
+ any = supplier->try_pull (has_event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Inform the control that we got something from the supplier
+ control->successful_transmission(this);
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ control->supplier_not_exist (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ control->system_exception (this,
+ sysex
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // @@ Should not happen
+ }
+ ACE_ENDTRY;
+ return any._retn ();
+}
+
+CORBA::Any*
+TAO_CEC_ProxyPullConsumer::pull_from_supplier (
+ ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosEventComm::PullSupplier_var supplier;
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK_RETURN (0);
+
+ if (this->is_connected_i () == 0)
+ return 0; // ACE_THROW (CosEventComm::Disconnected ());????
+
+ supplier =
+ CosEventComm::PullSupplier::_duplicate (this->supplier_.in ());
+
+ // The refcount cannot be zero, because we have at least two
+ // references,
+ }
+
+ CORBA::Any_var any;
+ ACE_TRY
+ {
+ any = supplier->pull (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // @@ This is where the policies for misbehaving suppliers
+ // should kick in.... for the moment just ignore them.
+ }
+ ACE_ENDTRY;
+ return any._retn ();
+}
+
+CORBA::Boolean
+TAO_CEC_ProxyPullConsumer::supplier_non_existent (
+ CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var supplier;
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ disconnected = 0;
+ if (this->is_connected_i () == 0)
+ {
+ disconnected = 1;
+ return 0;
+ }
+ if (CORBA::is_nil (this->nopolicy_supplier_.in ()))
+ {
+ return 0;
+ }
+ supplier = CORBA::Object::_duplicate (this->nopolicy_supplier_.in ());
+ }
+
+#if (TAO_HAS_MINIMUM_CORBA == 0)
+ return supplier->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER);
+#else
+ return 0;
+#endif /* TAO_HAS_MINIMUM_CORBA */
+}
+
+void
+TAO_CEC_ProxyPullConsumer::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosEventComm::PullSupplier_var supplier;
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ supplier = this->supplier_._retn ();
+ }
+
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (supplier.in ()))
+ return;
+
+ ACE_TRY
+ {
+ supplier->disconnect_pull_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // failures on this one.
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_CEC_ProxyPullConsumer::cleanup_i (void)
+{
+ this->supplier_ =
+ CosEventComm::PullSupplier::_nil ();
+}
+
+CORBA::ULong
+TAO_CEC_ProxyPullConsumer::_incr_refcnt (void)
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ return this->refcount_++;
+}
+
+CORBA::ULong
+TAO_CEC_ProxyPullConsumer::_decr_refcnt (void)
+{
+ {
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ this->refcount_--;
+ if (this->refcount_ != 0)
+ return this->refcount_;
+ }
+
+ // Notify the event channel
+ this->event_channel_->destroy_proxy (this);
+ return 0;
+}
+
+void
+TAO_CEC_ProxyPullConsumer::connect_pull_supplier (
+ CosEventComm::PullSupplier_ptr pull_supplier
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected))
+{
+ // Nil PullSuppliers are illegal
+ if (CORBA::is_nil (pull_supplier))
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i ())
+ {
+ if (this->event_channel_->supplier_reconnect () == 0)
+ ACE_THROW (CosEventChannelAdmin::AlreadyConnected ());
+
+ // Re-connections are allowed, go ahead and disconnect the
+ // consumer...
+ this->cleanup_i ();
+
+ // @@ Please read the comments in CEC_ProxyPullSupplier about
+ // possible race conditions in this area...
+ TAO_CEC_Unlock reverse_lock (*this->lock_);
+
+ {
+ ACE_GUARD_THROW_EX (
+ TAO_CEC_Unlock, ace_mon, reverse_lock,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ this->event_channel_->disconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // What if a second thread connected us after this?
+ if (this->is_connected_i ())
+ return;
+ }
+ this->supplier_ = apply_policy (pull_supplier);
+ }
+
+ // Notify the event channel...
+ this->event_channel_->connected (this ACE_ENV_ARG_PARAMETER);
+}
+
+CosEventComm::PullSupplier_ptr
+TAO_CEC_ProxyPullConsumer::apply_policy (CosEventComm::PullSupplier_ptr pre)
+{
+ this->nopolicy_supplier_ = CosEventComm::PullSupplier::_duplicate (pre);
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ CosEventComm::PullSupplier_var post =
+ CosEventComm::PullSupplier::_duplicate (pre);
+ if (this->timeout_ > ACE_Time_Value::zero)
+ {
+ CORBA::PolicyList policy_list;
+ policy_list.length (1);
+ policy_list[0] = this->event_channel_->
+ create_roundtrip_timeout_policy (this->timeout_);
+
+ CORBA::Object_var post_obj = pre->_set_policy_overrides
+ (policy_list, CORBA::ADD_OVERRIDE);
+ post = CosEventComm::PullSupplier::_narrow (post_obj.in ());
+
+ policy_list[0]->destroy ();
+ policy_list.length (0);
+ }
+ return post._retn ();
+#else
+ return CosEventComm::PullSupplier::_duplicate (pre);
+#endif /* TAO_HAS_CORBA_MESSAGING */
+}
+
+void
+TAO_CEC_ProxyPullConsumer::disconnect_pull_consumer (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosEventComm::PullSupplier_var supplier;
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i () == 0)
+ ACE_THROW (CORBA::BAD_INV_ORDER ()); // @@ add user exception?
+
+ supplier = this->supplier_._retn ();
+
+ this->cleanup_i ();
+ }
+
+ // Notify the event channel...
+ this->event_channel_->disconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->event_channel_->disconnect_callbacks ())
+ {
+ ACE_TRY
+ {
+ supplier->disconnect_pull_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // failures on this one.
+ }
+ ACE_ENDTRY;
+ }
+}
+
+PortableServer::POA_ptr
+TAO_CEC_ProxyPullConsumer::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+void
+TAO_CEC_ProxyPullConsumer::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_incr_refcnt ();
+}
+
+void
+TAO_CEC_ProxyPullConsumer::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_decr_refcnt ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullConsumer.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullConsumer.h
new file mode 100644
index 00000000000..1949abadced
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullConsumer.h
@@ -0,0 +1,158 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_ProxyPullConsumer.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+#ifndef TAO_CEC_PROXYPULLCONSUMER_H
+#define TAO_CEC_PROXYPULLCONSUMER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEventChannelAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+#include "orbsvcs/CosEvent/event_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_EventChannel;
+class TAO_CEC_Dispatching;
+class TAO_CEC_ProxyPullSupplier;
+
+/**
+ * @class TAO_CEC_ProxyPullConsumer
+ *
+ * @brief ProxyPullConsumer
+ *
+ * Implement the CosEventChannelAdmin::ProxyPullConsumer interface,
+ * remember that this class is used to communicate with a
+ * PullSupplier, so, in effect, this is the ambassador for a
+ * supplier inside the event channel.
+ * = MEMORY MANAGMENT
+ * The object commits suicide when disconnect_pull_consumer() is
+ * called.
+ */
+class TAO_Event_Serv_Export TAO_CEC_ProxyPullConsumer : public POA_CosEventChannelAdmin::ProxyPullConsumer
+{
+public:
+ typedef CosEventChannelAdmin::ProxyPullConsumer_ptr _ptr_type;
+ typedef CosEventChannelAdmin::ProxyPullConsumer_var _var_type;
+
+ /// constructor...
+ TAO_CEC_ProxyPullConsumer (TAO_CEC_EventChannel* event_channel,
+ const ACE_Time_Value &timeout);
+
+ /// destructor...
+ virtual ~TAO_CEC_ProxyPullConsumer (void);
+
+ /// Activate in the POA
+ virtual void activate (
+ CosEventChannelAdmin::ProxyPullConsumer_ptr &activated_proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Deactivate from the POA
+ virtual void deactivate (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return 0 if no supplier is connected...
+ CORBA::Boolean is_connected (void) const;
+
+ /// Return the consumer object reference. It returns nil() if it has
+ /// not connected yet.
+ CosEventComm::PullSupplier_ptr supplier (void) const;
+
+ /// Pulls from the supplier, verifies that it is connected.
+ CORBA::Any* try_pull_from_supplier (CORBA::Boolean_out has_event
+ ACE_ENV_ARG_DECL);
+ CORBA::Any* pull_from_supplier (ACE_ENV_SINGLE_ARG_DECL);
+
+ /**
+ * Invoke the _non_existent() pseudo-operation on the supplier. If
+ * it is disconnected then it returns true and sets the
+ * <disconnected> flag.
+ */
+ CORBA::Boolean supplier_non_existent (CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL);
+
+ /// The event channel is shutting down
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+ /// Increment and decrement the reference count.
+ CORBA::ULong _incr_refcnt (void);
+ CORBA::ULong _decr_refcnt (void);
+
+ // = The CosEventChannelAdmin::ProxyPullConsumer methods...
+ virtual void connect_pull_supplier (
+ CosEventComm::PullSupplier_ptr pull_supplier
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected));
+ virtual void disconnect_pull_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // = The Servant methods
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+protected:
+ /// Set the supplier, used by some implementations to change the
+ /// policies used when invoking operations on the supplier.
+ void supplier (CosEventComm::PullSupplier_ptr supplier);
+ void supplier_i (CosEventComm::PullSupplier_ptr supplier);
+
+ /// The private version (without locking) of is_connected().
+ CORBA::Boolean is_connected_i (void) const;
+
+ /// Release the supplier
+ void cleanup_i (void);
+
+ /// Assigns the parameter to both supplier_ and nopolicy_supplier_, and
+ /// applies policies (when appropriate) to supplier_.
+ CosEventComm::PullSupplier_ptr apply_policy
+ (CosEventComm::PullSupplier_ptr s);
+
+private:
+ /// The supplier admin, used for activation and memory managment.
+ TAO_CEC_EventChannel* event_channel_;
+
+ ACE_Time_Value timeout_;
+
+ /// The locking strategy.
+ ACE_Lock* lock_;
+
+ /// The reference count.
+ CORBA::ULong refcount_;
+
+ /// The supplier -- use apply_policy() instead of assigning directly to
+ /// supplier_. This will keep supplier_ and nopolicy_supplier_ in sync.
+ CosEventComm::PullSupplier_var supplier_;
+
+ /// The supplier without any policies applied
+ CosEventComm::PullSupplier_var nopolicy_supplier_;
+
+ /// Store the default POA.
+ PortableServer::POA_var default_POA_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_ProxyPullConsumer.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_PROXYPULLCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullConsumer.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullConsumer.i
new file mode 100644
index 00000000000..3c22bfb9af4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullConsumer.i
@@ -0,0 +1,42 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE CORBA::Boolean
+TAO_CEC_ProxyPullConsumer::is_connected_i (void) const
+{
+ return !CORBA::is_nil (this->supplier_.in ());
+}
+
+ACE_INLINE CORBA::Boolean
+TAO_CEC_ProxyPullConsumer::is_connected (void) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+
+ return this->is_connected_i ();
+}
+
+ACE_INLINE CosEventComm::PullSupplier_ptr
+TAO_CEC_ProxyPullConsumer::supplier (void) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ return CosEventComm::PullSupplier::_duplicate (this->supplier_.in ());
+}
+
+ACE_INLINE void
+TAO_CEC_ProxyPullConsumer::supplier_i (CosEventComm::PullSupplier_ptr supplier)
+{
+ this->supplier_ = supplier;
+}
+
+ACE_INLINE void
+TAO_CEC_ProxyPullConsumer::supplier (CosEventComm::PullSupplier_ptr supplier)
+{
+ ACE_GUARD (ACE_Lock, ace_mon, *this->lock_);
+
+ this->supplier_i (supplier);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullSupplier.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullSupplier.cpp
new file mode 100644
index 00000000000..99208b46ef1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullSupplier.cpp
@@ -0,0 +1,389 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_ProxyPullSupplier.h"
+#include "orbsvcs/CosEvent/CEC_Dispatching.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+
+#include "ace/Reverse_Lock_T.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_ProxyPullSupplier.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (CosEvent,
+ CEC_ProxyPullSupplier,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef ACE_Reverse_Lock<ACE_Lock> TAO_CEC_Unlock;
+
+TAO_CEC_ProxyPullSupplier::TAO_CEC_ProxyPullSupplier
+(TAO_CEC_EventChannel* ec, const ACE_Time_Value &timeout)
+ : event_channel_ (ec),
+ timeout_ (timeout),
+ refcount_ (1),
+ connected_ (0),
+ wait_not_empty_ (queue_lock_)
+{
+ this->lock_ =
+ this->event_channel_->create_supplier_lock ();
+
+ this->default_POA_ =
+ this->event_channel_->supplier_poa ();
+
+ this->event_channel_->get_servant_retry_map ().bind (this, 0);
+}
+
+TAO_CEC_ProxyPullSupplier::~TAO_CEC_ProxyPullSupplier (void)
+{
+ this->event_channel_->get_servant_retry_map ().unbind (this);
+ this->event_channel_->destroy_supplier_lock (this->lock_);
+}
+
+void
+TAO_CEC_ProxyPullSupplier::activate (
+ CosEventChannelAdmin::ProxyPullSupplier_ptr &activated_proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosEventChannelAdmin::ProxyPullSupplier_var result;
+ ACE_TRY
+ {
+ result = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ result = CosEventChannelAdmin::ProxyPullSupplier::_nil ();
+ }
+ ACE_ENDTRY;
+ activated_proxy = result._retn ();
+}
+
+void
+TAO_CEC_ProxyPullSupplier::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ PortableServer::POA_var poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Exceptions here should not be propagated. They usually
+ // indicate that an object is beign disconnected twice, or some
+ // race condition, but not a fault that the user needs to know
+ // about.
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_CEC_ProxyPullSupplier::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Save the consumer we where connected to, we need to send a
+ // disconnect message to it.
+ CosEventComm::PullConsumer_var consumer;
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ consumer = this->consumer_._retn ();
+ }
+
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (consumer.in ()))
+ return;
+
+ ACE_TRY
+ {
+ consumer->disconnect_pull_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // problems on this one.
+ }
+ ACE_ENDTRY;
+}
+
+CORBA::Boolean
+TAO_CEC_ProxyPullSupplier::consumer_non_existent (
+ CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var consumer;
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ disconnected = 0;
+ if (this->is_connected_i () == 0)
+ {
+ disconnected = 1;
+ return 0;
+ }
+ if (CORBA::is_nil (this->nopolicy_consumer_.in ()))
+ {
+ return 0;
+ }
+ consumer = CORBA::Object::_duplicate (this->nopolicy_consumer_.in ());
+ }
+
+#if (TAO_HAS_MINIMUM_CORBA == 0)
+ return consumer->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER);
+#else
+ return 0;
+#endif /* TAO_HAS_MINIMUM_CORBA */
+}
+
+void
+TAO_CEC_ProxyPullSupplier::push (const CORBA::Any &event
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ if (this->is_connected () == 0)
+ return;
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->queue_lock_);
+
+ // Ignore errors
+ (void) this->queue_.enqueue_tail (event);
+
+ this->wait_not_empty_.signal ();
+}
+
+CORBA::Any *
+TAO_CEC_ProxyPullSupplier::pull (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+{
+ if (this->is_connected () == 0)
+ ACE_THROW_RETURN (CosEventComm::Disconnected (), 0);
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, queue_lock_, 0);
+ while (this->queue_.is_empty ())
+ {
+ this->wait_not_empty_.wait ();
+ }
+ CORBA::Any any;
+ if (this->queue_.dequeue_head (any) != 0)
+ {
+ ACE_THROW_RETURN (CORBA::INTERNAL (), 0);
+ }
+ return new CORBA::Any (any);
+}
+
+CORBA::Any *
+TAO_CEC_ProxyPullSupplier::try_pull (CORBA::Boolean_out has_event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,CosEventComm::Disconnected))
+{
+ has_event = 0;
+ if (this->is_connected () == 0)
+ ACE_THROW_RETURN (CosEventComm::Disconnected (), 0);
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, queue_lock_, 0);
+ CORBA::Any any;
+ if (this->queue_.is_empty ())
+ {
+ any <<= CORBA::Long(0);
+ return new CORBA::Any (any);
+ }
+
+ if (this->queue_.dequeue_head (any) != 0)
+ {
+ ACE_THROW_RETURN (CORBA::INTERNAL (), 0);
+ }
+ has_event = 1;
+ return new CORBA::Any (any);
+}
+
+void
+TAO_CEC_ProxyPullSupplier::cleanup_i (void)
+{
+ this->consumer_ =
+ CosEventComm::PullConsumer::_nil ();
+ this->connected_ = 0;
+}
+
+CORBA::ULong
+TAO_CEC_ProxyPullSupplier::_incr_refcnt (void)
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ return this->refcount_++;
+}
+
+CORBA::ULong
+TAO_CEC_ProxyPullSupplier::_decr_refcnt (void)
+{
+ {
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ this->refcount_--;
+ if (this->refcount_ != 0)
+ return this->refcount_;
+ }
+
+ // Notify the event channel
+ this->event_channel_->destroy_proxy (this);
+ return 0;
+}
+
+void
+TAO_CEC_ProxyPullSupplier::connect_pull_consumer (
+ CosEventComm::PullConsumer_ptr pull_consumer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected))
+{
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i ())
+ {
+ if (this->event_channel_->consumer_reconnect () == 0)
+ ACE_THROW (CosEventChannelAdmin::AlreadyConnected ());
+
+ // Re-connections are allowed....
+ this->cleanup_i ();
+
+ this->consumer_ = apply_policy (pull_consumer);
+ this->connected_ = 1;
+
+ TAO_CEC_Unlock reverse_lock (*this->lock_);
+
+ {
+ ACE_GUARD_THROW_EX (
+ TAO_CEC_Unlock, ace_mon, reverse_lock,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ this->event_channel_->reconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ return;
+ }
+
+ this->consumer_ = apply_policy (pull_consumer);
+ this->connected_ = 1;
+ }
+
+ // Notify the event channel...
+ this->event_channel_->connected (this ACE_ENV_ARG_PARAMETER);
+}
+
+CosEventComm::PullConsumer_ptr
+TAO_CEC_ProxyPullSupplier::apply_policy (CosEventComm::PullConsumer_ptr pre)
+{
+ if (CORBA::is_nil (pre)) return pre;
+ this->nopolicy_consumer_ = CosEventComm::PullConsumer::_duplicate (pre);
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ CosEventComm::PullConsumer_var post =
+ CosEventComm::PullConsumer::_duplicate (pre);
+ if (this->timeout_ > ACE_Time_Value::zero)
+ {
+ CORBA::PolicyList policy_list;
+ policy_list.length (1);
+ policy_list[0] = this->event_channel_->
+ create_roundtrip_timeout_policy (this->timeout_);
+
+ CORBA::Object_var post_obj = pre->_set_policy_overrides
+ (policy_list, CORBA::ADD_OVERRIDE);
+ post = CosEventComm::PullConsumer::_narrow(post_obj.in ());
+
+ policy_list[0]->destroy ();
+ policy_list.length (0);
+ }
+ return post._retn ();
+#else
+ return CosEventComm::PullConsumer::_duplicate (pre);
+#endif /* TAO_HAS_CORBA_MESSAGING */
+}
+
+void
+TAO_CEC_ProxyPullSupplier::disconnect_pull_supplier (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosEventComm::PullConsumer_var consumer;
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i () == 0)
+ ACE_THROW (CORBA::BAD_INV_ORDER ());
+
+ consumer = this->consumer_._retn ();
+
+ this->cleanup_i ();
+ }
+
+ // Notify the event channel....
+ this->event_channel_->disconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (consumer.in ()))
+ return;
+
+ if (this->event_channel_->disconnect_callbacks ())
+ {
+ ACE_TRY
+ {
+ consumer->disconnect_pull_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // problems on this one.
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ProxySupplier::disconnect_pull_supplier");
+ }
+ ACE_ENDTRY;
+ }
+}
+
+PortableServer::POA_ptr
+TAO_CEC_ProxyPullSupplier::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+void
+TAO_CEC_ProxyPullSupplier::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_incr_refcnt ();
+}
+
+void
+TAO_CEC_ProxyPullSupplier::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_decr_refcnt ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullSupplier.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullSupplier.h
new file mode 100644
index 00000000000..67eca07678f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullSupplier.h
@@ -0,0 +1,182 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_ProxyPullSupplier.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_PROXYPULLSUPPLIER_H
+#define TAO_CEC_PROXYPULLSUPPLIER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEventChannelAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Message_Queue.h"
+#include "ace/Condition_Thread_Mutex.h"
+#include "ace/Unbounded_Queue.h"
+
+#include "orbsvcs/CosEvent/event_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_EventChannel;
+class TAO_CEC_ProxyPullConsumer;
+
+/**
+ * @class TAO_CEC_ProxyPullSupplier
+ *
+ * @brief ProxyPullSupplier
+ *
+ * Implement the CosEventChannelAdmin::ProxyPullSupplier interface,
+ * remember that this class is used to communicate with a
+ * PullConsumer, so, in effect, this is the ambassador for a
+ * consumer inside the event channel.
+ * = MEMORY MANAGMENT
+ * It does not assume ownership of the TAO_CEC_Dispatching object.
+ * It makes a copy of the ConsumerQOS and the consumer object
+ * reference.
+ * = LOCKING
+ * Locking is strategized, the event channel acts as a factory for
+ * the locking strategies.
+ */
+class TAO_Event_Serv_Export TAO_CEC_ProxyPullSupplier : public POA_CosEventChannelAdmin::ProxyPullSupplier
+{
+public:
+ typedef CosEventChannelAdmin::ProxyPullSupplier_ptr _ptr_type;
+ typedef CosEventChannelAdmin::ProxyPullSupplier_var _var_type;
+
+ /// constructor...
+ TAO_CEC_ProxyPullSupplier (TAO_CEC_EventChannel* event_channel,
+ const ACE_Time_Value &timeout);
+
+ /// destructor...
+ virtual ~TAO_CEC_ProxyPullSupplier (void);
+
+ /// Activate in the POA
+ virtual void activate (
+ CosEventChannelAdmin::ProxyPullSupplier_ptr &activated_proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Deactivate from the POA
+ virtual void deactivate (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return 0 if no consumer is connected...
+ CORBA::Boolean is_connected (void) const;
+
+ /**
+ * Return the consumer object reference. It returns nil() if it has
+ * not connected yet.
+ * NOTE: This method does not return a new reference!!! Doing so
+ * will increase the locking overhead on the critical path.
+ */
+ CosEventComm::PullConsumer_ptr consumer (void) const;
+
+ /// The event channel is shutting down
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+ /**
+ * Invoke the _non_existent() pseudo-operation on the consumer. If
+ * it is disconnected then it returns true and sets the
+ * <disconnected> flag.
+ */
+ CORBA::Boolean consumer_non_existent (CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL);
+
+ /// Push an event into the queue.
+ void push (const CORBA::Any &event
+ ACE_ENV_ARG_DECL);
+
+ // = The CosEventChannelAdmin::ProxyPullSupplier methods...
+ virtual void connect_pull_consumer (
+ CosEventComm::PullConsumer_ptr pull_consumer
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected));
+ virtual CORBA::Any * pull (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,CosEventComm::Disconnected));
+ virtual CORBA::Any * try_pull (CORBA::Boolean_out has_event
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,CosEventComm::Disconnected));
+ virtual void disconnect_pull_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Increment and decrement the reference count.
+ CORBA::ULong _incr_refcnt (void);
+ CORBA::ULong _decr_refcnt (void);
+
+ // = The Servant methods
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL);
+
+protected:
+ /// Set the consumer, used by some implementations to change the
+ /// policies used when invoking operations on the consumer.
+ void consumer (CosEventComm::PullConsumer_ptr consumer);
+ void consumer_i (CosEventComm::PullConsumer_ptr consumer);
+
+ /// The private version (without locking) of is_connected().
+ CORBA::Boolean is_connected_i (void) const;
+
+ /// Release the child and the consumer
+ void cleanup_i (void);
+
+ /// Assigns the parameter to both consumer_ and nopolicy_consumer_, and
+ /// applies policies (when appropriate) to consumer_.
+ CosEventComm::PullConsumer_ptr apply_policy
+ (CosEventComm::PullConsumer_ptr c);
+
+private:
+ /// The Event Channel that owns this object.
+ TAO_CEC_EventChannel* event_channel_;
+
+ ACE_Time_Value timeout_;
+
+ /// The locking strategy.
+ ACE_Lock* lock_;
+
+ /// The reference count.
+ CORBA::ULong refcount_;
+
+ /// The consumer -- use apply_policy() instead of assigning directly to
+ /// consumer_. This will keep consumer_ and nopolicy_consumer_ in sync.
+ CosEventComm::PullConsumer_var consumer_;
+
+ /// The consumer without any policies applied
+ CosEventComm::PullConsumer_var nopolicy_consumer_;
+
+ /// If the flag is not zero then we are connected, notice that the
+ /// consumer can be nil.
+ int connected_;
+
+ /// Store the default POA.
+ PortableServer::POA_var default_POA_;
+
+ /// Use a message queue to pass the
+ TAO_SYNCH_MUTEX queue_lock_;
+ TAO_SYNCH_CONDITION wait_not_empty_;
+ ACE_Unbounded_Queue<CORBA::Any> queue_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_ProxyPullSupplier.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_PROXYPULLSUPPLIER_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullSupplier.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullSupplier.i
new file mode 100644
index 00000000000..8519794c295
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPullSupplier.i
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE CORBA::Boolean
+TAO_CEC_ProxyPullSupplier::is_connected_i (void) const
+{
+ return this->connected_;
+}
+
+ACE_INLINE CORBA::Boolean
+TAO_CEC_ProxyPullSupplier::is_connected (void) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+
+ return this->is_connected_i ();
+}
+
+ACE_INLINE CosEventComm::PullConsumer_ptr
+TAO_CEC_ProxyPullSupplier::consumer (void) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+
+ return this->consumer_.in ();
+}
+
+ACE_INLINE void
+TAO_CEC_ProxyPullSupplier::consumer_i (CosEventComm::PullConsumer_ptr consumer)
+{
+ this->consumer_ = consumer;
+}
+
+ACE_INLINE void
+TAO_CEC_ProxyPullSupplier::consumer (CosEventComm::PullConsumer_ptr consumer)
+{
+ ACE_GUARD (ACE_Lock, ace_mon, *this->lock_);
+
+ this->consumer_i (consumer);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushConsumer.cpp
new file mode 100644
index 00000000000..dc056d83a65
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushConsumer.cpp
@@ -0,0 +1,397 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_ProxyPushConsumer.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_ConsumerAdmin.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPushSupplier.h"
+
+#include "ace/Reverse_Lock_T.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_ProxyPushConsumer.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (CosEvent,
+ CEC_ProxyPushConsumer,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef ACE_Reverse_Lock<ACE_Lock> TAO_CEC_Unlock;
+
+TAO_CEC_ProxyPushConsumer::
+TAO_CEC_ProxyPushConsumer (TAO_CEC_EventChannel* ec,
+ const ACE_Time_Value &timeout)
+ : event_channel_ (ec),
+ timeout_(timeout),
+ refcount_ (1),
+ connected_ (false)
+{
+ this->lock_ =
+ this->event_channel_->create_consumer_lock ();
+
+ this->default_POA_ =
+ this->event_channel_->consumer_poa ();
+
+ this->event_channel_->get_servant_retry_map ().bind (this, 0);
+}
+
+TAO_CEC_ProxyPushConsumer::~TAO_CEC_ProxyPushConsumer (void)
+{
+ this->event_channel_->get_servant_retry_map ().unbind (this);
+ this->event_channel_->destroy_consumer_lock (this->lock_);
+}
+
+void
+TAO_CEC_ProxyPushConsumer::activate (
+ CosEventChannelAdmin::ProxyPushConsumer_ptr &activated_proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosEventChannelAdmin::ProxyPushConsumer_var result;
+ ACE_TRY
+ {
+ result = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ result = CosEventChannelAdmin::ProxyPushConsumer::_nil ();
+ }
+ ACE_ENDTRY;
+ activated_proxy = result._retn ();
+}
+
+void
+TAO_CEC_ProxyPushConsumer::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ PortableServer::POA_var poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Exceptions here should not be propagated. They usually
+ // indicate that an object is beign disconnected twice, or some
+ // race condition, but not a fault that the user needs to know
+ // about.
+ }
+ ACE_ENDTRY;
+}
+
+CORBA::Boolean
+TAO_CEC_ProxyPushConsumer::supplier_non_existent (
+ CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var supplier;
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ disconnected = false;
+ if (!this->is_connected_i ())
+ {
+ disconnected = true;
+ return false;
+ }
+ if (CORBA::is_nil (this->nopolicy_supplier_.in ()))
+ {
+ return false;
+ }
+ supplier = CORBA::Object::_duplicate (this->nopolicy_supplier_.in ());
+ }
+
+#if (TAO_HAS_MINIMUM_CORBA == 0)
+ return supplier->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER);
+#else
+ return false;
+#endif /* TAO_HAS_MINIMUM_CORBA */
+}
+
+void
+TAO_CEC_ProxyPushConsumer::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosEventComm::PushSupplier_var supplier;
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ supplier = this->supplier_._retn ();
+ this->connected_ = false;
+ }
+
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (supplier.in ()))
+ return;
+
+ ACE_TRY
+ {
+ supplier->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // failures on this one.
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_CEC_ProxyPushConsumer::cleanup_i (void)
+{
+ this->supplier_ =
+ CosEventComm::PushSupplier::_nil ();
+ this->connected_ = false;
+}
+
+CORBA::ULong
+TAO_CEC_ProxyPushConsumer::_incr_refcnt (void)
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ return this->refcount_++;
+}
+
+CORBA::ULong
+TAO_CEC_ProxyPushConsumer::_decr_refcnt (void)
+{
+ {
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ --this->refcount_;
+ if (this->refcount_ != 0)
+ return this->refcount_;
+ }
+
+ // Notify the event channel
+ this->event_channel_->destroy_proxy (this);
+ return 0;
+}
+
+void
+TAO_CEC_ProxyPushConsumer::connect_push_supplier (
+ CosEventComm::PushSupplier_ptr push_supplier
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected))
+{
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i ())
+ {
+ if (this->event_channel_->supplier_reconnect () == 0)
+ ACE_THROW (CosEventChannelAdmin::AlreadyConnected ());
+
+ // Re-connections are allowed, go ahead and disconnect the
+ // consumer...
+ this->cleanup_i ();
+
+ // @@ Please read the comments in CEC_ProxyPushSupplier about
+ // possible race conditions in this area...
+ TAO_CEC_Unlock reverse_lock (*this->lock_);
+
+ {
+ ACE_GUARD_THROW_EX (
+ TAO_CEC_Unlock, ace_mon, reverse_lock,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ this->event_channel_->disconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // What if a second thread connected us after this?
+ if (this->is_connected_i ())
+ return;
+ }
+ this->supplier_ = apply_policy (push_supplier);
+ this->connected_ = true;
+ }
+
+ // Notify the event channel...
+ this->event_channel_->connected (this ACE_ENV_ARG_PARAMETER);
+}
+
+CosEventComm::PushSupplier_ptr
+TAO_CEC_ProxyPushConsumer::apply_policy (CosEventComm::PushSupplier_ptr pre)
+{
+ if (CORBA::is_nil (pre)) return pre;
+ this->nopolicy_supplier_ = CosEventComm::PushSupplier::_duplicate (pre);
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ CosEventComm::PushSupplier_var post =
+ CosEventComm::PushSupplier::_duplicate (pre);
+ if (this->timeout_ > ACE_Time_Value::zero)
+ {
+ CORBA::PolicyList policy_list;
+ policy_list.length (1);
+ policy_list[0] = this->event_channel_->
+ create_roundtrip_timeout_policy (this->timeout_);
+
+ CORBA::Object_var post_obj = pre->_set_policy_overrides
+ (policy_list, CORBA::ADD_OVERRIDE);
+ post = CosEventComm::PushSupplier::_narrow(post_obj.in ());
+
+ policy_list[0]->destroy ();
+ policy_list.length (0);
+ }
+ return post._retn ();
+#else
+ return CosEventComm::PushSupplier::_duplicate (pre);
+#endif /* TAO_HAS_CORBA_MESSAGING */
+}
+
+void
+TAO_CEC_ProxyPushConsumer::push (const CORBA::Any& event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_CEC_ProxyPushConsumer_Guard ace_mon (this->lock_,
+ this->refcount_,
+ this->event_channel_,
+ this);
+ if (!ace_mon.locked ())
+ return;
+
+ this->event_channel_->consumer_admin ()->push (event
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_ProxyPushConsumer::disconnect_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosEventComm::PushSupplier_var supplier;
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (!this->is_connected_i ())
+ ACE_THROW (CORBA::BAD_INV_ORDER ()); // @@ add user exception?
+
+ supplier = this->supplier_._retn ();
+
+ this->cleanup_i ();
+ }
+
+ // Notify the event channel...
+ this->event_channel_->disconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (supplier.in ()))
+ return;
+
+ if (this->event_channel_->disconnect_callbacks ())
+ {
+ ACE_TRY
+ {
+ supplier->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // failures on this one.
+ }
+ ACE_ENDTRY;
+ }
+}
+
+PortableServer::POA_ptr
+TAO_CEC_ProxyPushConsumer::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+void
+TAO_CEC_ProxyPushConsumer::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_incr_refcnt ();
+}
+
+void
+TAO_CEC_ProxyPushConsumer::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_decr_refcnt ();
+}
+
+// ****************************************************************
+
+TAO_CEC_ProxyPushConsumer_Guard::
+ TAO_CEC_ProxyPushConsumer_Guard (ACE_Lock *lock,
+ CORBA::ULong &refcount,
+ TAO_CEC_EventChannel *ec,
+ TAO_CEC_ProxyPushConsumer *proxy)
+ : lock_ (lock),
+ refcount_ (refcount),
+ event_channel_ (ec),
+ proxy_ (proxy),
+ locked_ (false)
+{
+ ACE_Guard<ACE_Lock> ace_mon (*this->lock_);
+ // If the guard fails there is not much we can do, raising an
+ // exception is wrong, the client has *no* way to handle that kind
+ // of error. Even worse, there is no exception to raise in that
+ // case.
+ // @@ Returning something won't work either, the error should be
+ // logged though!
+
+ if (!proxy->is_connected_i ())
+ return;
+
+ this->locked_ = true;
+ ++this->refcount_;
+}
+
+TAO_CEC_ProxyPushConsumer_Guard::
+ ~TAO_CEC_ProxyPushConsumer_Guard (void)
+{
+ // This access is safe because guard objects are created on the
+ // stack, only one thread has access to them
+ if (!this->locked_)
+ return;
+
+ {
+ ACE_Guard<ACE_Lock> ace_mon (*this->lock_);
+ // If the guard fails there is not much we can do, raising an
+ // exception is wrong, the client has *no* way to handle that kind
+ // of error. Even worse, there is no exception to raise in that
+ // case.
+ // @@ Returning something won't work either, the error should be
+ // logged though!
+
+ --this->refcount_;
+ if (this->refcount_ != 0)
+ return;
+ }
+ this->event_channel_->destroy_proxy (this->proxy_);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushConsumer.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushConsumer.h
new file mode 100644
index 00000000000..a7922405f2a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushConsumer.h
@@ -0,0 +1,210 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_ProxyPushConsumer.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_PROXYPUSHCONSUMER_H
+#define TAO_CEC_PROXYPUSHCONSUMER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEventChannelAdminS.h"
+#include "orbsvcs/CosEvent/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_EventChannel;
+class TAO_CEC_Dispatching;
+class TAO_CEC_ProxyPushSupplier;
+
+/**
+ * @class TAO_CEC_ProxyPushConsumer
+ *
+ * @brief ProxyPushConsumer
+ *
+ * Implement the CosEventChannelAdmin::ProxyPushConsumer interface,
+ * remember that this class is used to communicate with a
+ * PushSupplier, so, in effect, this is the ambassador for a
+ * supplier inside the event channel.
+ * = MEMORY MANAGMENT
+ * The object commits suicide when disconnect_push_consumer() is
+ * called.
+ */
+class TAO_Event_Serv_Export TAO_CEC_ProxyPushConsumer
+ : public POA_CosEventChannelAdmin::ProxyPushConsumer
+{
+public:
+ typedef CosEventChannelAdmin::ProxyPushConsumer_ptr _ptr_type;
+ typedef CosEventChannelAdmin::ProxyPushConsumer_var _var_type;
+
+ /// constructor...
+ TAO_CEC_ProxyPushConsumer (TAO_CEC_EventChannel* event_channel,
+ const ACE_Time_Value &timeout);
+
+ /// destructor...
+ virtual ~TAO_CEC_ProxyPushConsumer (void);
+
+ /// Activate in the POA
+ virtual void activate (
+ CosEventChannelAdmin::ProxyPushConsumer_ptr &activated_proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Deactivate from the POA
+ virtual void deactivate (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return false if no supplier is connected...
+ CORBA::Boolean is_connected (void) const;
+
+ /// Return the consumer object reference. It returns nil() if it has
+ /// not connected yet.
+ CosEventComm::PushSupplier_ptr supplier (void) const;
+
+ /**
+ * Invoke the _non_existent() pseudo-operation on the supplier. If
+ * it is disconnected then it returns true and sets the
+ * <disconnected> flag.
+ */
+ CORBA::Boolean supplier_non_existent (CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL);
+
+ /// The event channel is shutting down
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+ /// Increment and decrement the reference count.
+ CORBA::ULong _incr_refcnt (void);
+ CORBA::ULong _decr_refcnt (void);
+
+ // = The CosEventChannelAdmin::ProxyPushConsumer methods...
+ virtual void connect_push_supplier (
+ CosEventComm::PushSupplier_ptr push_supplier
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected));
+ virtual void push (const CORBA::Any& event
+ 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));
+
+ // = The Servant methods
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+protected:
+ /// Set the supplier, used by some implementations to change the
+ /// policies used when invoking operations on the supplier.
+ void supplier (CosEventComm::PushSupplier_ptr supplier);
+ void supplier_i (CosEventComm::PushSupplier_ptr supplier);
+
+ friend class TAO_CEC_ProxyPushConsumer_Guard;
+ // The guard needs access to the following protected methods.
+
+ /// The private version (without locking) of is_connected().
+ CORBA::Boolean is_connected_i (void) const;
+
+ /// Release the supplier
+ void cleanup_i (void);
+
+ /// Assigns the parameter to both supplier_ and nopolicy_supplier_, and
+ /// applies policies (when appropriate) to supplier_.
+ CosEventComm::PushSupplier_ptr apply_policy
+ (CosEventComm::PushSupplier_ptr s);
+
+private:
+ /// The supplier admin, used for activation and memory managment.
+ TAO_CEC_EventChannel* event_channel_;
+
+ ACE_Time_Value timeout_;
+
+ /// The locking strategy.
+ ACE_Lock* lock_;
+
+ /// The reference count.
+ CORBA::ULong refcount_;
+
+ /// The supplier -- use apply_policy() instead of assigning directly to
+ /// supplier_. This will keep supplier_ and nopolicy_supplier_ in sync.
+ CosEventComm::PushSupplier_var supplier_;
+
+ /// The supplier without any policies applied
+ CosEventComm::PushSupplier_var nopolicy_supplier_;
+
+ /// If the flag is true then we are connected, notice that the
+ /// supplier can be nil.
+ bool connected_;
+
+ /// Store the default POA.
+ PortableServer::POA_var default_POA_;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_CEC_ProxyPushConsumer_Guard
+ *
+ * @brief A Guard for the ProxyPushConsumer reference count
+ *
+ * This is a helper class used in the implementation of
+ * ProxyPushConumer. It provides a Guard mechanism to increment
+ * the reference count on the proxy, eliminating the need to hold
+ * mutexes during long operations.
+ */
+class TAO_Event_Serv_Export TAO_CEC_ProxyPushConsumer_Guard
+{
+public:
+ /// Constructor
+ TAO_CEC_ProxyPushConsumer_Guard (ACE_Lock *lock,
+ CORBA::ULong &refcount,
+ TAO_CEC_EventChannel *ec,
+ TAO_CEC_ProxyPushConsumer *proxy);
+
+ /// Destructor
+ ~TAO_CEC_ProxyPushConsumer_Guard (void);
+
+ /// Returns true if the reference count successfully acquired
+ bool locked (void) const;
+
+private:
+ /// The lock used to protect the reference count
+ ACE_Lock *lock_;
+
+ /// The reference count
+ CORBA::ULong &refcount_;
+
+ /// The event channel used to destroy the proxy
+ TAO_CEC_EventChannel *event_channel_;
+
+ /// The proxy whose lifetime is controlled by the reference count
+ TAO_CEC_ProxyPushConsumer *proxy_;
+
+ /// This flag is set to true if the reference count was successfully
+ /// acquired.
+ bool locked_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_ProxyPushConsumer.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_PROXYPUSHCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushConsumer.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushConsumer.i
new file mode 100644
index 00000000000..422c95863c6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushConsumer.i
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE CORBA::Boolean
+TAO_CEC_ProxyPushConsumer::is_connected_i (void) const
+{
+ return this->connected_;
+}
+
+ACE_INLINE CORBA::Boolean
+TAO_CEC_ProxyPushConsumer::is_connected (void) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+
+ return this->is_connected_i ();
+}
+
+ACE_INLINE CosEventComm::PushSupplier_ptr
+TAO_CEC_ProxyPushConsumer::supplier (void) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ return CosEventComm::PushSupplier::_duplicate (this->supplier_.in ());
+}
+
+ACE_INLINE void
+TAO_CEC_ProxyPushConsumer::supplier_i (CosEventComm::PushSupplier_ptr supplier)
+{
+ this->supplier_ = supplier;
+}
+
+ACE_INLINE void
+TAO_CEC_ProxyPushConsumer::supplier (CosEventComm::PushSupplier_ptr supplier)
+{
+ ACE_GUARD (ACE_Lock, ace_mon, *this->lock_);
+
+ this->supplier_i (supplier);
+}
+
+// ****************************************************************
+
+ACE_INLINE bool
+TAO_CEC_ProxyPushConsumer_Guard::locked (void) const
+{
+ return this->locked_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushSupplier.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushSupplier.cpp
new file mode 100644
index 00000000000..a25b00b5942
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushSupplier.cpp
@@ -0,0 +1,983 @@
+// $Id$
+
+// Force CORBA::release(CORBA::Request...) prototype to be parsed
+// before TAO_Pseudo_{Var,Out}_T templates. All required
+// non-dependent names must be parsed prior to the template in
+// question when using compilers like g++ 3.4.x.
+#include "tao/DynamicInterface/DII_CORBA_methods.h"
+
+#include "orbsvcs/CosEvent/CEC_ProxyPushSupplier.h"
+#include "orbsvcs/CosEvent/CEC_Dispatching.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_ConsumerControl.h"
+#include "orbsvcs/ESF/ESF_RefCount_Guard.h"
+#include "orbsvcs/ESF/ESF_Proxy_RefCount_Guard.h"
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+#include "orbsvcs/CosEvent/CEC_TypedEvent.h"
+#include "orbsvcs/CosEvent/CEC_TypedEventChannel.h"
+#include "tao/DynamicInterface/Request.h"
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+#include "tao/debug.h"
+#include "ace/Reverse_Lock_T.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_ProxyPushSupplier.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (CosEvent,
+ CEC_ProxyPushSupplier,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef ACE_Reverse_Lock<ACE_Lock> TAO_CEC_Unlock;
+
+// TAO_CEC_ProxyPushSupplier Constructure (Un-typed EC)
+TAO_CEC_ProxyPushSupplier::
+TAO_CEC_ProxyPushSupplier (TAO_CEC_EventChannel* ec,
+ const ACE_Time_Value &timeout)
+ : event_channel_ (ec),
+ timeout_ (timeout),
+ refcount_ (1)
+{
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ typed_event_channel_ = 0;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ this->lock_ =
+ this->event_channel_->create_supplier_lock ();
+
+ this->default_POA_ =
+ this->event_channel_->supplier_poa ();
+
+ this->event_channel_->get_servant_retry_map ().bind (this, 0);
+}
+
+// TAO_CEC_ProxyPushSupplier Constructure (Typed EC)
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+TAO_CEC_ProxyPushSupplier::
+TAO_CEC_ProxyPushSupplier (TAO_CEC_TypedEventChannel* ec,
+ const ACE_Time_Value &timeout)
+ : timeout_ (timeout),
+ typed_event_channel_ (ec),
+ refcount_ (1)
+{
+ event_channel_ = 0;
+
+ this->lock_ =
+ this->typed_event_channel_->create_supplier_lock ();
+
+ this->default_POA_ =
+ this->typed_event_channel_->typed_supplier_poa ();
+
+ this->typed_event_channel_->get_servant_retry_map ().bind (this, 0);
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+TAO_CEC_ProxyPushSupplier::~TAO_CEC_ProxyPushSupplier (void)
+{
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (this->is_typed_ec () )
+ {
+ this->typed_event_channel_->get_servant_retry_map ().unbind (this);
+ this->typed_event_channel_->destroy_supplier_lock (this->lock_);
+ }
+ else
+ {
+ this->event_channel_->get_servant_retry_map ().unbind (this);
+ this->event_channel_->destroy_supplier_lock (this->lock_);
+ }
+#else
+ this->event_channel_->get_servant_retry_map ().unbind (this);
+ this->event_channel_->destroy_supplier_lock (this->lock_);
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+}
+
+void
+TAO_CEC_ProxyPushSupplier::activate (
+ CosEventChannelAdmin::ProxyPushSupplier_ptr &activated_proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosEventChannelAdmin::ProxyPushSupplier_var result;
+ ACE_TRY
+ {
+ result = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ result = CosEventChannelAdmin::ProxyPushSupplier::_nil ();
+ }
+ ACE_ENDTRY;
+ activated_proxy = result._retn ();
+}
+
+void
+TAO_CEC_ProxyPushSupplier::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ PortableServer::POA_var poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Exceptions here should not be propagated. They usually
+ // indicate that an object is beign disconnected twice, or some
+ // race condition, but not a fault that the user needs to know
+ // about.
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_CEC_ProxyPushSupplier::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (this->is_typed_ec () )
+ {
+ // Save the consumer we where connected to, we need to send a
+ // disconnect message to it.
+ CosTypedEventComm::TypedPushConsumer_var typed_consumer;
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ typed_consumer = this->typed_consumer_._retn ();
+ }
+
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (typed_consumer.in ()))
+ return;
+
+ ACE_TRY_EX (typed)
+ {
+ typed_consumer->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (typed);
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // problems on this one.
+ }
+ ACE_ENDTRY;
+ } /* this->is_typed_ec */
+ else
+ {
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ // Save the consumer we where connected to, we need to send a
+ // disconnect message to it.
+ CosEventComm::PushConsumer_var consumer;
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ consumer = this->consumer_._retn ();
+ }
+
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (consumer.in ()))
+ return;
+
+ ACE_TRY
+ {
+ consumer->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // problems on this one.
+ }
+ ACE_ENDTRY;
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ } /* ! this->is_typed_ec */
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+}
+
+typedef TAO_ESF_Proxy_RefCount_Guard<TAO_CEC_EventChannel,TAO_CEC_ProxyPushSupplier> Destroy_Guard;
+
+void
+TAO_CEC_ProxyPushSupplier::push (const CORBA::Any &event
+ ACE_ENV_ARG_DECL)
+{
+ Destroy_Guard auto_destroy (this->refcount_,
+ this->event_channel_,
+ this);
+
+ {
+ ACE_GUARD (ACE_Lock, ace_mon, *this->lock_);
+
+ if (this->is_connected_i () == 0)
+ return;
+
+ TAO_ESF_RefCount_Guard<CORBA::ULong> cnt_mon (this->refcount_);
+
+ {
+ TAO_CEC_Unlock reverse_lock (*this->lock_);
+
+ ACE_GUARD (TAO_CEC_Unlock, ace_mon, reverse_lock);
+ this->event_channel_->dispatching ()->push (this,
+ event
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+typedef TAO_ESF_Proxy_RefCount_Guard<TAO_CEC_TypedEventChannel,TAO_CEC_ProxyPushSupplier> Destroy_Guard_Typed;
+
+void
+TAO_CEC_ProxyPushSupplier::invoke (const TAO_CEC_TypedEvent& typed_event
+ ACE_ENV_ARG_DECL)
+{
+ Destroy_Guard_Typed auto_destroy (this->refcount_,
+ this->typed_event_channel_,
+ this);
+ {
+
+ ACE_GUARD (ACE_Lock, ace_mon, *this->lock_);
+
+ if (this->is_connected_i () == 0)
+ return;
+
+ TAO_ESF_RefCount_Guard<CORBA::ULong> cnt_mon (this->refcount_);
+
+ {
+ TAO_CEC_Unlock reverse_lock (*this->lock_);
+
+ ACE_GUARD (TAO_CEC_Unlock, ace_mon, reverse_lock);
+ this->typed_event_channel_->dispatching ()->invoke (this,
+ typed_event
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+void
+TAO_CEC_ProxyPushSupplier::push_nocopy (CORBA::Any &event
+ ACE_ENV_ARG_DECL)
+{
+ Destroy_Guard auto_destroy (this->refcount_,
+ this->event_channel_,
+ this);
+
+ {
+ ACE_GUARD (ACE_Lock, ace_mon, *this->lock_);
+
+ if (this->is_connected_i () == 0)
+ return;
+
+ TAO_ESF_RefCount_Guard<CORBA::ULong> cnt_mon (this->refcount_);
+
+ {
+ TAO_CEC_Unlock reverse_lock (*this->lock_);
+
+ ACE_GUARD (TAO_CEC_Unlock, ace_mon, reverse_lock);
+ this->event_channel_->dispatching ()->push_nocopy (this,
+ event
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+}
+
+void
+TAO_CEC_ProxyPushSupplier::cleanup_i (void)
+{
+ this->consumer_ =
+ CosEventComm::PushConsumer::_nil ();
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ this->typed_consumer_ =
+ CosTypedEventComm::TypedPushConsumer::_nil ();
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+}
+
+CORBA::ULong
+TAO_CEC_ProxyPushSupplier::_incr_refcnt (void)
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ return this->refcount_++;
+}
+
+CORBA::ULong
+TAO_CEC_ProxyPushSupplier::_decr_refcnt (void)
+{
+ {
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ --this->refcount_;
+ if (this->refcount_ != 0)
+ return this->refcount_;
+ }
+
+ // Notify the event channel
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (this->is_typed_ec () )
+ {
+ this->typed_event_channel_->destroy_proxy (this);
+ }
+ else
+ {
+ this->event_channel_->destroy_proxy (this);
+ }
+#else
+ this->event_channel_->destroy_proxy (this);
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+ return 0;
+}
+
+void
+TAO_CEC_ProxyPushSupplier::connect_push_consumer (
+ CosEventComm::PushConsumer_ptr push_consumer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError))
+{
+ // Nil PushConsumers are illegal
+ if (CORBA::is_nil (push_consumer))
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ {
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ // Check if we have a typed event channel
+ if (this->is_typed_ec () )
+ {
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** connect_push_consumer, ")
+ ACE_TEXT ("Event channel is typed *****\n")));
+ }
+
+ // Temporary for the TypedPushConsumer and it's Typed interface,
+ // declared and obtained before the Guard to avoid deadlock during the
+ // _is_a (during _narrow) and get_typed_consumer invocations.
+ // They are eventually assigned onto this object inside the Guard.
+ CosTypedEventComm::TypedPushConsumer_var local_typed_consumer =
+ CosTypedEventComm::TypedPushConsumer::_narrow (push_consumer
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Obtain the typed object interface from the consumer
+ CORBA::Object_var local_typed_consumer_obj =
+ CORBA::Object::_duplicate (local_typed_consumer->get_typed_consumer (
+ ACE_ENV_SINGLE_ARG_PARAMETER) );
+ ACE_CHECK;
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i ())
+ {
+ if (this->typed_event_channel_->consumer_reconnect () == 0)
+ ACE_THROW (CosEventChannelAdmin::AlreadyConnected ());
+
+ // Re-connections are allowed....
+ this->cleanup_i ();
+
+ this->typed_consumer_ = apply_policy (local_typed_consumer.in () );
+ ACE_CHECK;
+
+ TAO_CEC_Unlock reverse_lock (*this->lock_);
+
+ {
+ ACE_GUARD_THROW_EX (
+ TAO_CEC_Unlock, ace_mon, reverse_lock,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ this->typed_event_channel_->reconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ return;
+
+ }
+
+ this->typed_consumer_ = apply_policy (local_typed_consumer.in () );
+ ACE_CHECK;
+
+ // Store the typed object interface from the consumer
+ this->typed_consumer_obj_ =
+ apply_policy_obj (local_typed_consumer_obj.in () );
+ ACE_CHECK;
+ }
+
+ // Notify the event channel...
+ this->typed_event_channel_->connected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ } /* this->is_typed_ec */
+ else
+ {
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** connect_push_consumer, ")
+ ACE_TEXT ("Event channel is un-typed *****\n")));
+ }
+
+ {
+
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i ())
+ {
+ if (this->event_channel_->consumer_reconnect () == 0)
+ ACE_THROW (CosEventChannelAdmin::AlreadyConnected ());
+
+ // Re-connections are allowed....
+ this->cleanup_i ();
+
+ this->consumer_ = apply_policy (push_consumer);
+
+ TAO_CEC_Unlock reverse_lock (*this->lock_);
+
+ {
+ ACE_GUARD_THROW_EX (
+ TAO_CEC_Unlock, ace_mon, reverse_lock,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ this->event_channel_->reconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ return;
+ }
+
+ this->consumer_ = apply_policy (push_consumer);
+ }
+
+ // Notify the event channel...
+ this->event_channel_->connected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ } /* ! this->is_typed_ec */
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+ }
+}
+
+CORBA::Object_ptr
+TAO_CEC_ProxyPushSupplier::apply_policy_obj (CORBA::Object_ptr pre)
+{
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ CORBA::Object_var post = CORBA::Object::_duplicate (pre);
+ if (this->timeout_ > ACE_Time_Value::zero)
+ {
+ CORBA::PolicyList policy_list;
+ policy_list.length (1);
+ if (this->typed_event_channel_)
+ {
+ policy_list[0] = this->typed_event_channel_->
+ create_roundtrip_timeout_policy (this->timeout_);
+ }
+ else
+ {
+ policy_list[0] = this->event_channel_->
+ create_roundtrip_timeout_policy (this->timeout_);
+ }
+ post = pre->_set_policy_overrides (policy_list, CORBA::ADD_OVERRIDE);
+
+ policy_list[0]->destroy ();
+ policy_list.length (0);
+ }
+ return post._retn ();
+#else
+ return CORBA::Object::_duplicate (pre);
+#endif /* TAO_HAS_CORBA_MESSAGING */
+}
+
+CosEventComm::PushConsumer_ptr
+TAO_CEC_ProxyPushSupplier::apply_policy (CosEventComm::PushConsumer_ptr pre)
+{
+ this->nopolicy_consumer_ = CosEventComm::PushConsumer::_duplicate (pre);
+ CORBA::Object_var post_obj = apply_policy_obj (pre);
+ CosEventComm::PushConsumer_var post =
+ CosEventComm::PushConsumer::_narrow (post_obj.in ());
+ return post._retn ();
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+CosTypedEventComm::TypedPushConsumer_ptr
+TAO_CEC_ProxyPushSupplier::apply_policy
+ (CosTypedEventComm::TypedPushConsumer_ptr pre)
+{
+ this->nopolicy_typed_consumer_ =
+ CosTypedEventComm::TypedPushConsumer::_duplicate (pre);
+ CORBA::Object_var post_obj = apply_policy_obj (pre);
+ CosTypedEventComm::TypedPushConsumer_var post =
+ CosTypedEventComm::TypedPushConsumer::_narrow (post_obj.in ());
+ return post._retn ();
+}
+#endif
+
+void
+TAO_CEC_ProxyPushSupplier::disconnect_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosEventComm::PushConsumer_var consumer;
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ CosTypedEventComm::TypedPushConsumer_var typed_consumer;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i () == 0)
+ ACE_THROW (CORBA::BAD_INV_ORDER ());
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (this->is_typed_ec () )
+ {
+ typed_consumer = this->typed_consumer_._retn ();
+ }
+ else
+ {
+ consumer = this->consumer_._retn ();
+ }
+#else
+ consumer = this->consumer_._retn ();
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ this->cleanup_i ();
+ }
+
+ // Notify the event channel....
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (this->is_typed_ec () )
+ {
+ this->typed_event_channel_->disconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ this->event_channel_->disconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+#else
+ this->event_channel_->disconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ // Disconnect callbacks
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (this->is_typed_ec () )
+ {
+ if (this->typed_event_channel_->disconnect_callbacks ())
+ {
+ ACE_TRY_EX (typed)
+ {
+ typed_consumer->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (typed);
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // problems on this one.
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ProxySupplier::disconnect_push_supplier");
+ }
+ ACE_ENDTRY;
+ }
+ } /* this->is_typed_ec */
+ else
+ {
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ if (this->event_channel_->disconnect_callbacks ())
+ {
+ ACE_TRY
+ {
+ consumer->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // problems on this one.
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ProxySupplier::disconnect_push_supplier");
+ }
+ ACE_ENDTRY;
+ }
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ } /* ! this->is_typed_ec */
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+}
+
+void
+TAO_CEC_ProxyPushSupplier::push_to_consumer (const CORBA::Any& event
+ ACE_ENV_ARG_DECL)
+{
+ CosEventComm::PushConsumer_var consumer;
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i () == 0)
+ return; // ACE_THROW (CosEventComm::Disconnected ());????
+
+ consumer =
+ CosEventComm::PushConsumer::_duplicate (this->consumer_.in ());
+ }
+
+ TAO_CEC_ConsumerControl *control =
+ this->event_channel_->consumer_control ();
+ ACE_TRY
+ {
+ consumer->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Inform the control that we were able to push something
+ control->successful_transmission(this);
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, not_used)
+ {
+ control->consumer_not_exist (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ control->system_exception (this,
+ sysex
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Shouldn't happen, but does not hurt
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_CEC_ProxyPushSupplier::reactive_push_to_consumer (
+ const CORBA::Any& event
+ ACE_ENV_ARG_DECL)
+{
+ CosEventComm::PushConsumer_var consumer;
+ {
+ ACE_GUARD (ACE_Lock, ace_mon, *this->lock_);
+ if (this->is_connected_i () == 0)
+ return; // TAO_THROW (CosEventComm::Disconnected ());????
+
+ consumer =
+ CosEventComm::PushConsumer::_duplicate (this->consumer_.in ());
+ }
+
+ TAO_CEC_ConsumerControl *control =
+ this->event_channel_->consumer_control ();
+
+ ACE_TRY
+ {
+ consumer->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Inform the control that we were able to push something
+ control->successful_transmission(this);
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, not_used)
+ {
+ if (TAO_debug_level >= 4)
+ {
+ ACE_PRINT_EXCEPTION (not_used, "during TAO_CEC_ProxyPushSupplier::reactive_push_to_consumer");
+ }
+ control->consumer_not_exist (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ if (TAO_debug_level >= 4)
+ {
+ ACE_PRINT_EXCEPTION (sysex, "during TAO_CEC_ProxyPushSupplier::reactive_push_to_consumer");
+ }
+
+ control->system_exception (this,
+ sysex
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Shouldn't happen, but does not hurt
+ }
+ ACE_ENDTRY;
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+void
+TAO_CEC_ProxyPushSupplier::invoke_to_consumer (const TAO_CEC_TypedEvent &typed_event
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var typed_consumer_obj;
+
+ // The DII target request object
+ CORBA::Request_var target_request;
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i () == 0)
+ return; // ACE_THROW (CosEventComm::Disconnected ());????
+
+ typed_consumer_obj =
+ CORBA::Object::_duplicate (this->typed_consumer_obj_.in ());
+ }
+
+ TAO_CEC_ConsumerControl *control =
+ this->typed_event_channel_->consumer_control ();
+
+ // Create the DII request
+ ACE_TRY
+ {
+ typed_consumer_obj_->_create_request (0, // ctx
+ typed_event.operation_,
+ typed_event.list_,
+ 0, // result
+ 0, // exception_list,
+ 0, // context_list,
+ target_request.inout(),
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Call the DII invoke for the operation on the target object
+ target_request->invoke (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Inform the control that we were able to invoke something
+ control->successful_transmission(this);
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, not_used)
+ {
+ if (TAO_debug_level >= 4)
+ {
+ ACE_PRINT_EXCEPTION (not_used, "during TAO_CEC_ProxyPushSupplier::invoke_to_consumer");
+ }
+ control->consumer_not_exist (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ if (TAO_debug_level >= 4)
+ {
+ ACE_PRINT_EXCEPTION (sysex, "during TAO_CEC_ProxyPushSupplier::invoke_to_consumer");
+ }
+ control->system_exception (this,
+ sysex
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Shouldn't happen, but does not hurt
+ if (TAO_debug_level >= 4)
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ACE_ANY_EXCEPTION raised during TAO_CEC_ProxyPushSupplier::invoke_to_consumer");
+ }
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_CEC_ProxyPushSupplier::reactive_invoke_to_consumer (
+ const TAO_CEC_TypedEvent& typed_event
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var typed_consumer_obj;
+
+ // The DII target request object
+ CORBA::Request_var target_request;
+
+ {
+ ACE_GUARD (ACE_Lock, ace_mon, *this->lock_);
+ if (this->is_connected_i () == 0)
+ {
+ return; // TAO_THROW (CosEventComm::Disconnected ());????
+ }
+ if (CORBA::is_nil(this->typed_consumer_obj_.in()))
+ {
+ return; // TAO_THROW ...
+ }
+
+ typed_consumer_obj =
+ CORBA::Object::_duplicate (this->typed_consumer_obj_.in ());
+ }
+
+ TAO_CEC_ConsumerControl *control =
+ this->typed_event_channel_->consumer_control ();
+
+ // Create the DII request
+ ACE_TRY
+ {
+ typed_consumer_obj_->_create_request (0, // ctx
+ typed_event.operation_,
+ typed_event.list_,
+ 0, // result
+ 0, // exception_list,
+ 0, // context_list,
+ target_request.inout(),
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Call the DII invoke for the operation on the target object
+ target_request->invoke (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Inform the control that we were able to invoke something
+ control->successful_transmission(this);
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, not_used)
+ {
+ if (TAO_debug_level >= 4)
+ {
+ ACE_PRINT_EXCEPTION (not_used, "during TAO_CEC_ProxyPushSupplier::reactive_invoke_to_consumer");
+ }
+ control->consumer_not_exist (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ if (TAO_debug_level >= 4)
+ {
+ ACE_PRINT_EXCEPTION (sysex, "during TAO_CEC_ProxyPushSupplier::reactive_invoke_to_consumer");
+ }
+ control->system_exception (this,
+ sysex
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level >= 4)
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ACE_ANY_EXCEPTION raised during TAO_CEC_ProxyPushSupplier::reactive_invoke_to_consumer");
+ }
+ }
+ ACE_ENDTRY;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+CORBA::Boolean
+TAO_CEC_ProxyPushSupplier::consumer_non_existent (
+ CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var consumer;
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ disconnected = 0;
+ if (this->is_connected_i () == 0)
+ {
+ disconnected = 1;
+ return 0;
+ }
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (this->is_typed_ec () )
+ {
+ if (CORBA::is_nil (this->nopolicy_typed_consumer_.in ()))
+ {
+ return 0;
+ }
+ consumer = CORBA::Object::_duplicate
+ (this->nopolicy_typed_consumer_.in ());
+ }
+ else
+ {
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+ if (CORBA::is_nil (this->nopolicy_consumer_.in ()))
+ {
+ return 0;
+ }
+ consumer = CORBA::Object::_duplicate (this->nopolicy_consumer_.in ());
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ } /* ! this->is_typed_ec */
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+ }
+
+#if (TAO_HAS_MINIMUM_CORBA == 0)
+ return consumer->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER);
+#else
+ return 0;
+#endif /* TAO_HAS_MINIMUM_CORBA */
+}
+
+PortableServer::POA_ptr
+TAO_CEC_ProxyPushSupplier::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+void
+TAO_CEC_ProxyPushSupplier::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_incr_refcnt ();
+}
+
+void
+TAO_CEC_ProxyPushSupplier::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_decr_refcnt ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushSupplier.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushSupplier.h
new file mode 100644
index 00000000000..ab39589a301
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushSupplier.h
@@ -0,0 +1,233 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_ProxyPushSupplier.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ * @author Jon Astle (jon@astle45.fsnet.co.uk)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_PROXYPUSHSUPPLIER_H
+#define TAO_CEC_PROXYPUSHSUPPLIER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEventChannelAdminS.h"
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+#include "orbsvcs/CosTypedEventChannelAdminS.h"
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+#include "orbsvcs/CosEvent/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_EventChannel;
+class TAO_CEC_ProxyPushConsumer;
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+class TAO_CEC_TypedEvent;
+class TAO_CEC_TypedEventChannel;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+/**
+ * @class TAO_CEC_ProxyPushSupplier
+ *
+ * @brief ProxyPushSupplier
+ *
+ * Implement the CosEventChannelAdmin::ProxyPushSupplier interface,
+ * remember that this class is used to communicate with a
+ * PushConsumer, so, in effect, this is the ambassador for a
+ * consumer inside the event channel.
+ * = MEMORY MANAGMENT
+ * It does not assume ownership of the TAO_CEC_Dispatching object.
+ * It makes a copy of the ConsumerQOS and the consumer object
+ * reference.
+ * = LOCKING
+ * Locking is strategized, the event channel acts as a factory for
+ * the locking strategies.
+ */
+class TAO_Event_Serv_Export TAO_CEC_ProxyPushSupplier : public POA_CosEventChannelAdmin::ProxyPushSupplier
+{
+public:
+ typedef CosEventChannelAdmin::ProxyPushSupplier_ptr _ptr_type;
+ typedef CosEventChannelAdmin::ProxyPushSupplier_var _var_type;
+
+ /// constructor...
+ TAO_CEC_ProxyPushSupplier (TAO_CEC_EventChannel* event_channel,
+ const ACE_Time_Value &timeout);
+
+ /// typed ec constructor
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ TAO_CEC_ProxyPushSupplier (TAO_CEC_TypedEventChannel* typed_event_channel,
+ const ACE_Time_Value &timeout);
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /// destructor...
+ virtual ~TAO_CEC_ProxyPushSupplier (void);
+
+ /// Activate in the POA
+ virtual void activate (
+ CosEventChannelAdmin::ProxyPushSupplier_ptr &
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Deactivate from the POA
+ virtual void deactivate (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return 0 if no consumer is connected...
+ CORBA::Boolean is_connected (void) const;
+
+ /**
+ * Return the consumer object reference. It returns nil() if it has
+ * not connected yet.
+ * NOTE: This method does not return a new reference!!! Doing so
+ * will increase the locking overhead on the critical path.
+ */
+ CosEventComm::PushConsumer_ptr consumer (void) const;
+
+ /// The event channel is shutting down
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Internal methods to push an event to each consumer.
+ virtual void push (const CORBA::Any &event
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (CORBA::Any &event
+ ACE_ENV_ARG_DECL);
+ /// Internal methods to invoke a typed event to each consumer.
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ virtual void invoke (const TAO_CEC_TypedEvent& typed_event
+ ACE_ENV_ARG_DECL);
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /// Pushes to the consumer, verifies that it is connected.
+ void push_to_consumer (const CORBA::Any &event
+ ACE_ENV_ARG_DECL);
+ void reactive_push_to_consumer (const CORBA::Any &event
+ ACE_ENV_ARG_DECL);
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ void invoke_to_consumer (const TAO_CEC_TypedEvent &typed_event
+ ACE_ENV_ARG_DECL);
+ void reactive_invoke_to_consumer (const TAO_CEC_TypedEvent &typed_event
+ ACE_ENV_ARG_DECL);
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /**
+ * Invoke the _non_existent() pseudo-operation on the consumer. If
+ * it is disconnected then it returns true and sets the
+ * <disconnected> flag.
+ */
+ CORBA::Boolean consumer_non_existent (CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL);
+
+ // = The CosEventChannelAdmin::ProxyPushSupplier methods...
+ virtual void connect_push_consumer (
+ CosEventComm::PushConsumer_ptr push_consumer
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError));
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Increment and decrement the reference count.
+ CORBA::ULong _incr_refcnt (void);
+ CORBA::ULong _decr_refcnt (void);
+
+ // = The Servant methods
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL);
+
+protected:
+ /// Set the consumer, used by some implementations to change the
+ /// policies used when invoking operations on the consumer.
+ void consumer (CosEventComm::PushConsumer_ptr consumer);
+ void consumer_i (CosEventComm::PushConsumer_ptr consumer);
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ void consumer (CosTypedEventComm::TypedPushConsumer_ptr typed_consumer);
+ void consumer_i (CosTypedEventComm::TypedPushConsumer_ptr typed_consumer);
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /// The private version (without locking) of is_connected().
+ CORBA::Boolean is_connected_i (void) const;
+
+ /// Release the child and the consumer
+ void cleanup_i (void);
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ CORBA::Boolean is_typed_ec (void) const;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /// Assigns the parameter to both consumer_ and nopolicy_consumer_, and
+ /// applies policies (when appropriate) to consumer_.
+ CosEventComm::PushConsumer_ptr apply_policy
+ (CosEventComm::PushConsumer_ptr c);
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ CosTypedEventComm::TypedPushConsumer_ptr apply_policy
+ (CosTypedEventComm::TypedPushConsumer_ptr c);
+#endif
+
+ CORBA::Object_ptr apply_policy_obj (CORBA::Object_ptr c);
+
+private:
+ /// The Event Channel that owns this object.
+ TAO_CEC_EventChannel* event_channel_;
+
+ ACE_Time_Value timeout_;
+
+ /// The Typed Event Channel that owns this object.
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ TAO_CEC_TypedEventChannel *typed_event_channel_;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /// The locking strategy.
+ ACE_Lock* lock_;
+
+ /// The reference count.
+ CORBA::ULong refcount_;
+
+ /// The consumer -- use apply_policy() instead of assigning directly to
+ /// consumer_. This will keep consumer_ and nopolicy_consumer_ in sync.
+ CosEventComm::PushConsumer_var consumer_;
+
+ /// The consumer without any policies applied
+ CosEventComm::PushConsumer_var nopolicy_consumer_;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ /// The typed consumer -- use apply_policy() instead of assigning directly to
+ /// typed_consumer_. This will keep typed_consumer_ and
+ /// nopolicy_typed_consumer_ in sync.
+ CosTypedEventComm::TypedPushConsumer_var typed_consumer_;
+
+ /// The consumer object returned from get_typed_consumer()
+ CORBA::Object_var typed_consumer_obj_;
+
+ /// The typed consumer without any policies applied
+ CosTypedEventComm::TypedPushConsumer_var nopolicy_typed_consumer_;
+
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /// Store the default POA.
+ PortableServer::POA_var default_POA_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_ProxyPushSupplier.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_PROXYPUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushSupplier.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushSupplier.i
new file mode 100644
index 00000000000..9f92df16b06
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_ProxyPushSupplier.i
@@ -0,0 +1,98 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE CORBA::Boolean
+TAO_CEC_ProxyPushSupplier::is_connected_i (void) const
+{
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (this->is_typed_ec ())
+ {
+ return !CORBA::is_nil (this->typed_consumer_.in ());
+ }
+ else
+ {
+ return !CORBA::is_nil (this->consumer_.in ());
+ }
+#else
+ return !CORBA::is_nil (this->consumer_.in ());
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+}
+
+ACE_INLINE CORBA::Boolean
+TAO_CEC_ProxyPushSupplier::is_connected (void) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+
+ return this->is_connected_i ();
+}
+
+ACE_INLINE CosEventComm::PushConsumer_ptr
+TAO_CEC_ProxyPushSupplier::consumer (void) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (this->is_typed_ec ())
+ {
+ return this->typed_consumer_.in ();
+ }
+ else
+ {
+ return this->consumer_.in ();
+ }
+#else
+ return this->consumer_.in ();
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+}
+
+ACE_INLINE void
+TAO_CEC_ProxyPushSupplier::consumer_i (CosEventComm::PushConsumer_ptr consumer)
+{
+ this->consumer_ = consumer;
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ACE_INLINE void
+TAO_CEC_ProxyPushSupplier::consumer_i (CosTypedEventComm::TypedPushConsumer_ptr typed_consumer)
+{
+ this->typed_consumer_ = typed_consumer;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ACE_INLINE void
+TAO_CEC_ProxyPushSupplier::consumer (CosEventComm::PushConsumer_ptr consumer)
+{
+ ACE_GUARD (ACE_Lock, ace_mon, *this->lock_);
+
+ this->consumer_i (consumer);
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ACE_INLINE void
+TAO_CEC_ProxyPushSupplier::consumer (CosTypedEventComm::TypedPushConsumer_ptr typed_consumer)
+{
+ ACE_GUARD (ACE_Lock, ace_mon, *this->lock_);
+
+ this->consumer_i (typed_consumer);
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ACE_INLINE CORBA::Boolean
+TAO_CEC_ProxyPushSupplier::is_typed_ec (void) const
+{
+ if (this->typed_event_channel_ != 0)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Pulling_Strategy.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Pulling_Strategy.cpp
new file mode 100644
index 00000000000..eeb8c998046
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Pulling_Strategy.cpp
@@ -0,0 +1,13 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_Pulling_Strategy.h"
+
+ACE_RCSID(CosEvent, CEC_Pulling_Strategy, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_CEC_Pulling_Strategy::~TAO_CEC_Pulling_Strategy (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Pulling_Strategy.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Pulling_Strategy.h
new file mode 100644
index 00000000000..791dda5c1d2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Pulling_Strategy.h
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_Pulling_Strategy.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_PULLING_STRATEGY_H
+#define TAO_CEC_PULLING_STRATEGY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEvent/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Basic_Types.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_CEC_Pulling_Strategy
+ *
+ * @brief Define the interface for the pulling strategies.
+ *
+ * The EC may be configured with different pulling strategies,
+ * for instance, it can use a pool of threads to dispatch the
+ * events, or a set of queues with threads at different priorities
+ * for each queue or can simply push the event to the consumer in
+ * FIFO order.
+ */
+class TAO_Event_Serv_Export TAO_CEC_Pulling_Strategy
+{
+public:
+ /// destructor...
+ virtual ~TAO_CEC_Pulling_Strategy (void);
+
+ /// Initialize all the data structures, activate any internal threads,
+ /// etc.
+ virtual void activate (void) = 0;
+
+ /**
+ * Deactivate any internal threads and cleanup internal data
+ * structures, it should only return once the threads have finished
+ * their jobs.
+ */
+ virtual void shutdown (void) = 0;
+
+#if 0
+ /// Some strategies may want to keep track of connected consumers.
+ virtual void connected (TAO_CEC_ProxyPullConsumer *
+ ACE_ENV_ARG_DECL_NOT_USED) = 0;
+ virtual void reconnected (TAO_CEC_ProxyPullConsumer *
+ ACE_ENV_ARG_DECL_NOT_USED) = 0;
+ virtual void diconnected (TAO_CEC_ProxyPullConsumer *
+ ACE_ENV_ARG_DECL_NOT_USED) = 0;
+#endif /* 0 */
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_CEC_PULLING_STRATEGY_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.cpp
new file mode 100644
index 00000000000..934fc6e4c82
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.cpp
@@ -0,0 +1,492 @@
+// $Id$
+
+// Note: This class controls the behaviour of consumers connected to both
+// the Typed and Un-typed Event Channels. A check must be made in the code
+// to ensure the correct EC is referenced.
+
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_ConsumerAdmin.h"
+#include "orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.h"
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+#include "orbsvcs/CosEvent/CEC_TypedEventChannel.h"
+#include "orbsvcs/CosEvent/CEC_TypedConsumerAdmin.h"
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+#include "orbsvcs/CosEvent/CEC_ProxyPushSupplier.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPullSupplier.h"
+
+#include "orbsvcs/Time_Utilities.h"
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+#include "tao/Messaging/Messaging.h"
+#endif
+
+#include "tao/ORB_Core.h"
+#include "tao/debug.h"
+#include "ace/Reactor.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (CosEvent,
+ CEC_Reactive_ConsumerControl,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// TAO_CEC_Reactive_ConsumerControl constructor for the Un-typed EC
+TAO_CEC_Reactive_ConsumerControl::
+ TAO_CEC_Reactive_ConsumerControl (const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ unsigned int retries,
+ TAO_CEC_EventChannel *ec,
+ CORBA::ORB_ptr orb)
+ : rate_ (rate),
+ timeout_ (timeout),
+ retries_ (retries),
+ adapter_ (this),
+ event_channel_ (ec),
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ typed_event_channel_ (0),
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+ orb_ (CORBA::ORB::_duplicate (orb))
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ // Initialise timer_id_ to an invalid timer id, so that in case we don't
+ // schedule a timer, we don't cancel a random timer at shutdown
+ , timer_id_ (-1)
+#endif /* TAO_HAS_CORBA_MESSAGING */
+{
+ this->reactor_ =
+ this->orb_->orb_core ()->reactor ();
+}
+
+// TAO_CEC_Reactive_ConsumerControl constructor for the Typed EC
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+TAO_CEC_Reactive_ConsumerControl::
+ TAO_CEC_Reactive_ConsumerControl (const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ unsigned int retries,
+ TAO_CEC_TypedEventChannel *ec,
+ CORBA::ORB_ptr orb)
+ : rate_ (rate),
+ timeout_ (timeout),
+ retries_ (retries),
+ adapter_ (this),
+ event_channel_ (0),
+ typed_event_channel_ (ec),
+ orb_ (CORBA::ORB::_duplicate (orb))
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ // Initialise timer_id_ to an invalid timer id, so that in case we don't
+ // schedule a timer, we don't cancel a random timer at shutdown
+ , timer_id_ (-1)
+#endif /* TAO_HAS_CORBA_MESSAGING */
+{
+ this->reactor_ =
+ this->orb_->orb_core ()->reactor ();
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+TAO_CEC_Reactive_ConsumerControl::~TAO_CEC_Reactive_ConsumerControl (void)
+{
+}
+
+void
+TAO_CEC_Reactive_ConsumerControl::query_consumers (
+ ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_CEC_Ping_Push_Consumer push_worker (this);
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (this->typed_event_channel_)
+ {
+ // Typed EC
+ this->typed_event_channel_->typed_consumer_admin ()->for_each (&push_worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ // Un-typed EC
+ this->event_channel_->consumer_admin ()->for_each (&push_worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_CEC_Ping_Pull_Consumer pull_worker (this);
+ this->event_channel_->consumer_admin ()->for_each (&pull_worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ }
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+}
+
+bool
+TAO_CEC_Reactive_ConsumerControl::need_to_disconnect (
+ PortableServer::ServantBase* proxy)
+{
+ bool disconnect = true;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (this->typed_event_channel_)
+ {
+ // Typed EC
+ TAO_CEC_TypedEventChannel::ServantRetryMap::ENTRY* entry = 0;
+ if (this->typed_event_channel_->
+ get_servant_retry_map ().find (proxy, entry) == 0)
+ {
+ ++entry->int_id_;
+ if (entry->int_id_ <= this->retries_)
+ {
+ disconnect = false;
+ }
+ }
+ }
+ else
+ {
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ // Un-typed EC
+ TAO_CEC_EventChannel::ServantRetryMap::ENTRY* entry = 0;
+ if (this->event_channel_->
+ get_servant_retry_map ().find (proxy, entry) == 0)
+ {
+ ++entry->int_id_;
+ if (entry->int_id_ <= this->retries_)
+ {
+ disconnect = false;
+ }
+ }
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ }
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ return disconnect;
+}
+
+void
+TAO_CEC_Reactive_ConsumerControl::successful_transmission (
+ PortableServer::ServantBase* proxy)
+{
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (this->typed_event_channel_)
+ {
+ // Typed EC
+ TAO_CEC_TypedEventChannel::ServantRetryMap::ENTRY* entry = 0;
+ if (this->typed_event_channel_->
+ get_servant_retry_map ().find (proxy, entry) == 0)
+ {
+ entry->int_id_ = 0;
+ }
+ }
+ else
+ {
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ // Un-typed EC
+ TAO_CEC_EventChannel::ServantRetryMap::ENTRY* entry = 0;
+ if (this->event_channel_->
+ get_servant_retry_map ().find (proxy, entry) == 0)
+ {
+ entry->int_id_ = 0;
+ }
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ }
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+}
+
+void
+TAO_CEC_Reactive_ConsumerControl::handle_timeout (
+ const ACE_Time_Value &,
+ const void *)
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Query the state of the Current object *before* we initiate
+ // the iteration...
+ CORBA::PolicyTypeSeq types;
+ CORBA::PolicyList_var policies =
+ this->policy_current_->get_policy_overrides (types
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Change the timeout
+ this->policy_current_->set_policy_overrides (this->policy_list_,
+ CORBA::ADD_OVERRIDE
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TRY_EX (query)
+ {
+ // Query the state of the consumers...
+ this->query_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (query);
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+
+ this->policy_current_->set_policy_overrides (policies.in (),
+ CORBA::SET_OVERRIDE
+ 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;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+int
+TAO_CEC_Reactive_ConsumerControl::activate (void)
+{
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ ACE_TRY_NEW_ENV
+ {
+ // Get the PolicyCurrent object
+ CORBA::Object_var tmp =
+ this->orb_->resolve_initial_references ("PolicyCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->policy_current_ =
+ CORBA::PolicyCurrent::_narrow (tmp.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Pre-compute the policy list to the set the right timeout
+ // value...
+ // We need to convert the relative timeout into 100's of nano seconds.
+ TimeBase::TimeT timeout;
+ ORBSVCS_Time::Time_Value_to_TimeT (timeout,
+ this->timeout_);
+ CORBA::Any any;
+ any <<= timeout;
+
+ this->policy_list_.length (1);
+ this->policy_list_[0] =
+ this->orb_->create_policy (
+ Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
+ any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Only schedule the timer, when the rate is not zero
+ if (this->rate_ != ACE_Time_Value::zero)
+ {
+ // Schedule the timer after these policies has been set, because the
+ // handle_timeout uses these policies, if done in front, the channel
+ // can crash when the timeout expires before initiazation is ready.
+ timer_id_ = this->reactor_->schedule_timer (&this->adapter_,
+ 0,
+ this->rate_,
+ this->rate_);
+ if (timer_id_ == -1)
+ return -1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+#endif /* TAO_HAS_CORBA_MESSAGING */
+
+ return 0;
+}
+
+int
+TAO_CEC_Reactive_ConsumerControl::shutdown (void)
+{
+ int r = 0;
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ r = this->reactor_->cancel_timer (timer_id_);
+#endif /* TAO_HAS_CORBA_MESSAGING */
+ this->adapter_.reactor (0);
+ return r;
+}
+
+void
+TAO_CEC_Reactive_ConsumerControl::consumer_not_exist (
+ TAO_CEC_ProxyPushSupplier *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ proxy->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ProxyPushSupplier disconnected due to consumer_not_exist\n")));
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Reactive_ConsumerControl::consumer_not_exist"));
+ // Ignore all exceptions..
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_CEC_Reactive_ConsumerControl::consumer_not_exist (
+ TAO_CEC_ProxyPullSupplier *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ proxy->disconnect_pull_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Reactive_ConsumerControl::consumer_not_exist"));
+ // Ignore all exceptions..
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_CEC_Reactive_ConsumerControl::system_exception (
+ TAO_CEC_ProxyPushSupplier *proxy,
+ CORBA::SystemException & /* exception */
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ if (this->need_to_disconnect (proxy))
+ {
+ proxy->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ProxyPushSupplier disconnected due to consumer_not_exist\n")));
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions..
+ }
+ ACE_ENDTRY;
+}
+
+// ****************************************************************
+
+TAO_CEC_ConsumerControl_Adapter::TAO_CEC_ConsumerControl_Adapter (
+ TAO_CEC_Reactive_ConsumerControl *adaptee)
+ : adaptee_ (adaptee)
+{
+}
+
+int
+TAO_CEC_ConsumerControl_Adapter::handle_timeout (
+ const ACE_Time_Value &tv,
+ const void *arg)
+{
+ this->adaptee_->handle_timeout (tv, arg);
+ return 0;
+}
+
+// ****************************************************************
+
+void
+TAO_CEC_Ping_Push_Consumer::work (TAO_CEC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CORBA::Boolean disconnected;
+ CORBA::Boolean non_existent =
+ supplier->consumer_non_existent (disconnected
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (non_existent && !disconnected)
+ {
+ this->control_->consumer_not_exist (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ this->control_->consumer_not_exist (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TRANSIENT, transient)
+ {
+ if (this->control_->need_to_disconnect (supplier))
+ {
+ this->control_->consumer_not_exist (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+// ****************************************************************
+
+void
+TAO_CEC_Ping_Pull_Consumer::work (TAO_CEC_ProxyPullSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CORBA::Boolean disconnected;
+ CORBA::Boolean non_existent =
+ supplier->consumer_non_existent (disconnected
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (non_existent && !disconnected)
+ {
+ this->control_->consumer_not_exist (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ this->control_->consumer_not_exist (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TRANSIENT, transient)
+ {
+ if (this->control_->need_to_disconnect (supplier))
+ {
+ this->control_->consumer_not_exist (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.h
new file mode 100644
index 00000000000..f1cc2e40767
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.h
@@ -0,0 +1,213 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_Reactive_ConsumerControl.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_REACTIVE_CONSUMERCONTROL_H
+#define TAO_CEC_REACTIVE_CONSUMERCONTROL_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEvent/CEC_ConsumerControl.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+#include "tao/ORB.h"
+
+#include "ace/Event_Handler.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_EventChannel;
+
+class TAO_CEC_Reactive_ConsumerControl;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+class TAO_CEC_TypedEventChannel;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+/**
+ * @class TAO_CEC_ConsumerControl_Adapter
+ *
+ * @brief Forwards timeout events to the Reactive ConsumerControl
+ *
+ * The Reactive ConsumerControl strategy uses the reactor to
+ * periodically wakeup and verify the state of the consumers
+ * registered with the Event Channel.
+ */
+class TAO_Event_Serv_Export TAO_CEC_ConsumerControl_Adapter : public ACE_Event_Handler
+{
+public:
+ /// Constructor
+ TAO_CEC_ConsumerControl_Adapter (TAO_CEC_Reactive_ConsumerControl *adaptee);
+
+ // = Documented in ACE_Event_Handler.
+ virtual int handle_timeout (const ACE_Time_Value &tv,
+ const void *arg = 0);
+
+private:
+ /// The adapted object
+ TAO_CEC_Reactive_ConsumerControl *adaptee_;
+};
+
+/**
+ * @class TAO_CEC_Reactive_ConsumerControl
+ *
+ * @brief ConsumerControl
+ *
+ * Defines the interface for the consumer control strategy.
+ * This strategy handles misbehaving or failing consumers.
+ * = MEMORY MANAGMENT
+ * = LOCKING
+ * = TODO
+ */
+class TAO_Event_Serv_Export TAO_CEC_Reactive_ConsumerControl
+ : public TAO_CEC_ConsumerControl
+{
+public:
+ /// Constructor. It does not assume ownership of the <event_channel>
+ /// parameter.
+ TAO_CEC_Reactive_ConsumerControl (const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ unsigned int retries,
+ TAO_CEC_EventChannel *event_channel,
+ CORBA::ORB_ptr orb);
+
+ /// Constructor for the typed ec.
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ TAO_CEC_Reactive_ConsumerControl (
+ const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ unsigned int retries,
+ TAO_CEC_TypedEventChannel *typed_event_channel,
+ CORBA::ORB_ptr orb
+ );
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /// destructor...
+ virtual ~TAO_CEC_Reactive_ConsumerControl (void);
+
+ /// Receive the timeout from the adapter
+ void handle_timeout (const ACE_Time_Value &tv,
+ const void* arg);
+
+ // = Documented in TAO_CEC_ConsumerControl
+ virtual int activate (void);
+ virtual int shutdown (void);
+ virtual void consumer_not_exist (TAO_CEC_ProxyPushSupplier *proxy
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void consumer_not_exist (TAO_CEC_ProxyPullSupplier *proxy
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void system_exception (TAO_CEC_ProxyPushSupplier *proxy,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Do we need to disconnect this supplier? The parameter type for
+ /// proxy is PortableServer::ServantBase* due to the fact that this
+ /// method will be used for TAO_CEC_ProxyPushSupplier's and
+ /// TAO_CEC_ProxyPullSupplier's.
+ virtual bool need_to_disconnect (PortableServer::ServantBase* proxy);
+
+ /// Allow others to inform us when a send or receive was successful.
+ virtual void successful_transmission (PortableServer::ServantBase* proxy);
+
+private:
+ /// Check if the consumers still exists. It is a helper method for
+ /// handle_timeout() to isolate the exceptions.
+ void query_consumers (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// The polling rate
+ ACE_Time_Value rate_;
+
+ /// The polling timeout
+ ACE_Time_Value timeout_;
+
+ /// The number of retries per proxy until it is disconnected
+ unsigned int retries_;
+
+ /// The Adapter for the reactor events
+ TAO_CEC_ConsumerControl_Adapter adapter_;
+
+ /// The event channel
+ TAO_CEC_EventChannel *event_channel_;
+
+ /// The typed event channel
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ TAO_CEC_TypedEventChannel *typed_event_channel_;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /// The ORB
+ CORBA::ORB_var orb_;
+
+ /// To control the timeout policy in the thread
+ CORBA::PolicyCurrent_var policy_current_;
+
+ /// Precomputed policy list to the set timeout.
+ CORBA::PolicyList policy_list_;
+
+ /// The ORB reactor
+ ACE_Reactor *reactor_;
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ /// The timer id
+ long timer_id_;
+#endif /* TAO_HAS_CORBA_MESSAGING */
+};
+
+// ****************************************************************
+
+class TAO_CEC_Ping_Push_Consumer
+ : public TAO_ESF_Worker<TAO_CEC_ProxyPushSupplier>
+{
+public:
+ TAO_CEC_Ping_Push_Consumer (TAO_CEC_ConsumerControl *control);
+
+ virtual void work (TAO_CEC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_CEC_ConsumerControl *control_;
+};
+
+// ****************************************************************
+
+class TAO_CEC_Ping_Pull_Consumer
+ : public TAO_ESF_Worker<TAO_CEC_ProxyPullSupplier>
+{
+public:
+ TAO_CEC_Ping_Pull_Consumer (TAO_CEC_ConsumerControl *control);
+
+ virtual void work (TAO_CEC_ProxyPullSupplier *supplier
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_CEC_ConsumerControl *control_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_CONSUMERCONTROL_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.i
new file mode 100644
index 00000000000..cd61d83efce
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_ConsumerControl.i
@@ -0,0 +1,23 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_CEC_Ping_Push_Consumer::
+ TAO_CEC_Ping_Push_Consumer (TAO_CEC_ConsumerControl *control)
+ : control_ (control)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_CEC_Ping_Pull_Consumer::
+ TAO_CEC_Ping_Pull_Consumer (TAO_CEC_ConsumerControl *control)
+ : control_ (control)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.cpp
new file mode 100644
index 00000000000..55063132e47
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.cpp
@@ -0,0 +1,204 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_ProxyPullConsumer.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_SupplierAdmin.h"
+#include "orbsvcs/CosEvent/CEC_ConsumerAdmin.h"
+#include "orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.h"
+
+#include "orbsvcs/Time_Utilities.h"
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+#include "tao/Messaging/Messaging.h"
+#endif
+
+#include "tao/ORB_Core.h"
+
+#include "ace/Reactor.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(CosEvent, CEC_Reactive_Pulling_Strategy, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_CEC_Reactive_Pulling_Strategy::
+ TAO_CEC_Reactive_Pulling_Strategy (const ACE_Time_Value &rate,
+ const ACE_Time_Value &relative_timeout,
+ TAO_CEC_EventChannel *event_channel,
+ CORBA::ORB_ptr orb)
+ : adapter_ (this),
+ rate_ (rate),
+ relative_timeout_ (relative_timeout),
+ event_channel_ (event_channel),
+ orb_ (CORBA::ORB::_duplicate (orb))
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ // Initialise timer_id_ to an invalid timer id, so that in case we don't
+ // schedule a timer, we don't cancel a random timer at shutdown
+ , timer_id_ (-1)
+#endif /* TAO_HAS_CORBA_MESSAGING */
+{
+ this->reactor_ =
+ this->orb_->orb_core ()->reactor ();
+}
+
+void
+TAO_CEC_Reactive_Pulling_Strategy::handle_timeout (
+ const ACE_Time_Value &,
+ const void *)
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Query the state of the Current object *before* we initiate
+ // the iteration...
+ CORBA::PolicyTypeSeq types;
+ CORBA::PolicyList_var policies =
+ this->policy_current_->get_policy_overrides (types
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Change the timeout
+ this->policy_current_->set_policy_overrides (this->policy_list_,
+ CORBA::ADD_OVERRIDE
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TRY_EX (query)
+ {
+ TAO_CEC_Pull_Event worker (this->event_channel_->consumer_admin (),
+ this->event_channel_->supplier_control ());
+
+ this->event_channel_->supplier_admin ()->for_each (&worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (query);
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+
+ this->policy_current_->set_policy_overrides (policies.in (),
+ CORBA::SET_OVERRIDE
+ 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;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_CEC_Reactive_Pulling_Strategy::activate (void)
+{
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ timer_id_ = this->reactor_->schedule_timer (&this->adapter_,
+ 0,
+ this->rate_,
+ this->rate_);
+ if (timer_id_ == -1)
+ return;
+
+ ACE_TRY_NEW_ENV
+ {
+ // Get the PolicyCurrent object
+ CORBA::Object_var tmp =
+ this->orb_->resolve_initial_references ("PolicyCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->policy_current_ =
+ CORBA::PolicyCurrent::_narrow (tmp.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Pre-compute the policy list to the set the right timeout
+ // value...
+ // We need to convert the relative timeout into 100's of nano seconds.
+ TimeBase::TimeT timeout;
+ ORBSVCS_Time::Time_Value_to_TimeT (timeout,
+ this->relative_timeout_);
+ CORBA::Any any;
+ any <<= timeout;
+
+ this->policy_list_.length (1);
+ this->policy_list_[0] =
+ this->orb_->create_policy (
+ Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
+ any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+#endif /* TAO_HAS_CORBA_MESSAGING */
+}
+
+void
+TAO_CEC_Reactive_Pulling_Strategy::shutdown (void)
+{
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ this->reactor_->cancel_timer (timer_id_);
+#endif /* TAO_HAS_CORBA_MESSAGING */
+ this->adapter_.reactor (0);
+}
+
+// ****************************************************************
+
+TAO_CEC_Pulling_Strategy_Adapter::TAO_CEC_Pulling_Strategy_Adapter (
+ TAO_CEC_Reactive_Pulling_Strategy *adaptee)
+ : adaptee_ (adaptee)
+{
+}
+
+int
+TAO_CEC_Pulling_Strategy_Adapter::handle_timeout (
+ const ACE_Time_Value &tv,
+ const void *arg)
+{
+ this->adaptee_->handle_timeout (tv, arg);
+ return 0;
+}
+
+// ****************************************************************
+
+void
+TAO_CEC_Pull_Event::work (TAO_CEC_ProxyPullConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Boolean has_event = 0;
+ CORBA::Any_var any;
+
+ ACE_TRY
+ {
+ any = consumer->try_pull_from_supplier (has_event
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ return;
+ }
+ ACE_ENDTRY;
+
+ if (has_event)
+ {
+ this->consumer_admin_->push (any.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.h
new file mode 100644
index 00000000000..a43c423f3a3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.h
@@ -0,0 +1,151 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_Reactive_Pulling_Strategy.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_REACTIVE_PULLING_STRATEGY_H
+#define TAO_CEC_REACTIVE_PULLING_STRATEGY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEvent/CEC_Pulling_Strategy.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+#include "tao/ORB.h"
+#include "tao/PolicyC.h"
+
+#include "ace/Event_Handler.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_ProxyPullConsumer;
+class TAO_CEC_EventChannel;
+class TAO_CEC_ConsumerAdmin;
+class TAO_CEC_SupplierControl;
+class TAO_CEC_Reactive_Pulling_Strategy;
+
+/**
+ * @class TAO_CEC_Pulling_Strategy_Adapter
+ *
+ * @brief Forwards timeout events to the Reactive Pulling Strategy
+ *
+ * The Reactive Pulling Strategy strategy uses the reactor to
+ * periodically wakeup and try top pull events from each
+ * PullSupplier connected to the EventChannel.
+ */
+class TAO_Event_Serv_Export TAO_CEC_Pulling_Strategy_Adapter : public ACE_Event_Handler
+{
+public:
+ /// Constructor
+ TAO_CEC_Pulling_Strategy_Adapter (TAO_CEC_Reactive_Pulling_Strategy *adaptee);
+
+ // = Documented in ACE_Event_Handler.
+ virtual int handle_timeout (const ACE_Time_Value &tv,
+ const void *arg = 0);
+
+private:
+ /// The adapted object
+ TAO_CEC_Reactive_Pulling_Strategy *adaptee_;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_CEC_Reactive_Pulling_Strategy
+ *
+ * @brief Dispatch using the caller thread.
+ *
+ * The events are dispatched in FIFO ordering, using the invoking
+ * thread to push the event to the consumer.
+ */
+class TAO_Event_Serv_Export TAO_CEC_Reactive_Pulling_Strategy : public TAO_CEC_Pulling_Strategy
+{
+public:
+ /// The scheduler is used to find the range of priorities and similar
+ /// info.
+ TAO_CEC_Reactive_Pulling_Strategy (const ACE_Time_Value &rate,
+ const ACE_Time_Value &relative_timeout,
+ TAO_CEC_EventChannel *event_channel,
+ CORBA::ORB_ptr orb);
+
+ /// Receive the timeout from the adapter
+ void handle_timeout (const ACE_Time_Value &tv,
+ const void* arg);
+
+ // = The CEC_Pulling_Strategy methods.
+ virtual void activate (void);
+ virtual void shutdown (void);
+
+private:
+ /// The Adapter for the reactor events
+ TAO_CEC_Pulling_Strategy_Adapter adapter_;
+
+ /// The polling rate
+ ACE_Time_Value rate_;
+
+ /// The relative timeout
+ ACE_Time_Value relative_timeout_;
+
+ /// The event channel
+ TAO_CEC_EventChannel *event_channel_;
+
+ /// The ORB
+ CORBA::ORB_var orb_;
+
+ /// To control the timeout policy in the thread
+ CORBA::PolicyCurrent_var policy_current_;
+
+ /// Precomputed policy list to the set timeout.
+ CORBA::PolicyList policy_list_;
+
+ /// The ORB reactor
+ ACE_Reactor *reactor_;
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ /// The timer id
+ long timer_id_;
+#endif /* TAO_HAS_CORBA_MESSAGING */
+};
+
+// ****************************************************************
+
+class TAO_CEC_Pull_Event : public TAO_ESF_Worker<TAO_CEC_ProxyPullConsumer>
+{
+public:
+ TAO_CEC_Pull_Event (TAO_CEC_ConsumerAdmin *consumer_admin,
+ TAO_CEC_SupplierControl *control);
+
+ virtual void work (TAO_CEC_ProxyPullConsumer *consumer
+ ACE_ENV_ARG_DECL);
+
+private:
+ /// Used to propagate the events.
+ TAO_CEC_ConsumerAdmin *consumer_admin_;
+
+ /// To report failed or dead suppliers
+ TAO_CEC_SupplierControl *supplier_control_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_REACTIVE_PULLING_STRATEGY_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.i
new file mode 100644
index 00000000000..319de5688f5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_Pulling_Strategy.i
@@ -0,0 +1,15 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_CEC_Pull_Event::TAO_CEC_Pull_Event (TAO_CEC_ConsumerAdmin *consumer_admin,
+ TAO_CEC_SupplierControl *control)
+ : consumer_admin_ (consumer_admin),
+ supplier_control_ (control)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.cpp
new file mode 100644
index 00000000000..b7a49603b36
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.cpp
@@ -0,0 +1,537 @@
+// $Id$
+
+// Note: This class controls the behaviour of suppliers connected to both
+// the Typed and Un-typed Event Channels. A check must be made in the code
+// to ensure the correct EC is referenced.
+
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_SupplierAdmin.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPushConsumer.h"
+#include "orbsvcs/CosEvent/CEC_Reactive_SupplierControl.h"
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+#include "orbsvcs/CosEvent/CEC_TypedEventChannel.h"
+#include "orbsvcs/CosEvent/CEC_TypedSupplierAdmin.h"
+#include "orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.h"
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+#include "orbsvcs/CosEvent/CEC_ProxyPullConsumer.h"
+
+#include "orbsvcs/Time_Utilities.h"
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+#include "tao/Messaging/Messaging.h"
+#endif
+
+#include "tao/ORB_Core.h"
+
+#include "ace/Reactor.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_Reactive_SupplierControl.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (CosEvent,
+ CEC_Reactive_SupplierControl,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// TAO_CEC_Reactive_SupplierControl constructor for the Un-typed EC
+TAO_CEC_Reactive_SupplierControl::
+ TAO_CEC_Reactive_SupplierControl (const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ unsigned int retries,
+ TAO_CEC_EventChannel *ec,
+ CORBA::ORB_ptr orb)
+ : rate_ (rate),
+ timeout_ (timeout),
+ retries_ (retries),
+ adapter_ (this),
+ event_channel_ (ec),
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ typed_event_channel_ (0),
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+ orb_ (CORBA::ORB::_duplicate (orb))
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ // Initialise timer_id_ to an invalid timer id, so that in case we don't
+ // schedule a timer, we don't cancel a random timer at shutdown
+ , timer_id_ (-1)
+#endif /* TAO_HAS_CORBA_MESSAGING */
+{
+ this->reactor_ =
+ this->orb_->orb_core ()->reactor ();
+}
+
+// TAO_CEC_Reactive_SupplierControl constructor for the Typed EC
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+TAO_CEC_Reactive_SupplierControl::
+ TAO_CEC_Reactive_SupplierControl (const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ unsigned int retries,
+ TAO_CEC_TypedEventChannel *ec,
+ CORBA::ORB_ptr orb)
+ : rate_ (rate),
+ timeout_ (timeout),
+ retries_ (retries),
+ adapter_ (this),
+ event_channel_ (0),
+ typed_event_channel_ (ec),
+ orb_ (CORBA::ORB::_duplicate (orb))
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ // Initialise timer_id_ to an invalid timer id, so that in case we don't
+ // schedule a timer, we don't cancel a random timer at shutdown
+ , timer_id_ (-1)
+#endif /* TAO_HAS_CORBA_MESSAGING */
+{
+ this->reactor_ =
+ this->orb_->orb_core ()->reactor ();
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+TAO_CEC_Reactive_SupplierControl::~TAO_CEC_Reactive_SupplierControl (void)
+{
+}
+
+void
+TAO_CEC_Reactive_SupplierControl::query_suppliers (
+ ACE_ENV_SINGLE_ARG_DECL)
+{
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (this->typed_event_channel_)
+ {
+ // Typed EC
+ TAO_CEC_Ping_Typed_Push_Supplier push_worker (this);
+
+ this->typed_event_channel_->typed_supplier_admin ()->for_each (&push_worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ // Un-typed EC
+ TAO_CEC_Ping_Push_Supplier push_worker (this);
+ this->event_channel_->supplier_admin ()->for_each (&push_worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_CEC_Ping_Pull_Supplier pull_worker (this);
+ this->event_channel_->supplier_admin ()->for_each (&pull_worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ }
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+}
+
+bool
+TAO_CEC_Reactive_SupplierControl::need_to_disconnect (
+ PortableServer::ServantBase* proxy)
+{
+ bool disconnect = true;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (this->typed_event_channel_)
+ {
+ // Typed EC
+ TAO_CEC_TypedEventChannel::ServantRetryMap::ENTRY* entry = 0;
+ if (this->typed_event_channel_->
+ get_servant_retry_map ().find (proxy, entry) == 0)
+ {
+ ++entry->int_id_;
+ if (entry->int_id_ <= this->retries_)
+ {
+ disconnect = false;
+ }
+ }
+ }
+ else
+ {
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ // Un-typed EC
+ TAO_CEC_EventChannel::ServantRetryMap::ENTRY* entry = 0;
+ if (this->event_channel_->
+ get_servant_retry_map ().find (proxy, entry) == 0)
+ {
+ ++entry->int_id_;
+ if (entry->int_id_ <= this->retries_)
+ {
+ disconnect = false;
+ }
+ }
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ }
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ return disconnect;
+}
+
+void
+TAO_CEC_Reactive_SupplierControl::successful_transmission (
+ PortableServer::ServantBase* proxy)
+{
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ if (this->typed_event_channel_)
+ {
+ // Typed EC
+ TAO_CEC_TypedEventChannel::ServantRetryMap::ENTRY* entry = 0;
+ if (this->typed_event_channel_->
+ get_servant_retry_map ().find (proxy, entry) == 0)
+ {
+ entry->int_id_ = 0;
+ }
+ }
+ else
+ {
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ // Un-typed EC
+ TAO_CEC_EventChannel::ServantRetryMap::ENTRY* entry = 0;
+ if (this->event_channel_->
+ get_servant_retry_map ().find (proxy, entry) == 0)
+ {
+ entry->int_id_ = 0;
+ }
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ }
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+}
+
+void
+TAO_CEC_Reactive_SupplierControl::handle_timeout (
+ const ACE_Time_Value &,
+ const void *)
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Query the state of the Current object *before* we initiate
+ // the iteration...
+ CORBA::PolicyTypeSeq types;
+ CORBA::PolicyList_var policies =
+ this->policy_current_->get_policy_overrides (types
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Change the timeout
+ this->policy_current_->set_policy_overrides (this->policy_list_,
+ CORBA::ADD_OVERRIDE
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TRY_EX (query)
+ {
+ // Query the state of the suppliers...
+ this->query_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (query);
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+
+ this->policy_current_->set_policy_overrides (policies.in (),
+ CORBA::SET_OVERRIDE
+ 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;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+int
+TAO_CEC_Reactive_SupplierControl::activate (void)
+{
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ ACE_TRY_NEW_ENV
+ {
+ // Get the PolicyCurrent object
+ CORBA::Object_var tmp =
+ this->orb_->resolve_initial_references ("PolicyCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->policy_current_ =
+ CORBA::PolicyCurrent::_narrow (tmp.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Pre-compute the policy list to the set the right timeout
+ // value...
+ // We need to convert the relative timeout into 100's of nano seconds.
+ TimeBase::TimeT timeout;
+ ORBSVCS_Time::Time_Value_to_TimeT (timeout,
+ this->timeout_);
+ CORBA::Any any;
+ any <<= timeout;
+
+ this->policy_list_.length (1);
+ this->policy_list_[0] =
+ this->orb_->create_policy (
+ Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
+ any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Only schedule the timer, when the rate is not zero
+ if (this->rate_ != ACE_Time_Value::zero)
+ {
+ // Schedule the timer after these policies has been set, because the
+ // handle_timeout uses these policies, if done in front, the channel
+ // can crash when the timeout expires before initiazation is ready.
+ timer_id_ = this->reactor_->schedule_timer (&this->adapter_,
+ 0,
+ this->rate_,
+ this->rate_);
+ if (timer_id_ == -1)
+ return -1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+#endif /* TAO_HAS_CORBA_MESSAGING */
+
+ return 0;
+}
+
+int
+TAO_CEC_Reactive_SupplierControl::shutdown (void)
+{
+ int r = 0;
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ r = this->reactor_->cancel_timer (timer_id_);
+#endif /* TAO_HAS_CORBA_MESSAGING */
+ this->adapter_.reactor (0);
+ return r;
+}
+
+void
+TAO_CEC_Reactive_SupplierControl::supplier_not_exist (
+ TAO_CEC_ProxyPushConsumer *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ proxy->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions..
+ }
+ ACE_ENDTRY;
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+void
+TAO_CEC_Reactive_SupplierControl::supplier_not_exist (
+ TAO_CEC_TypedProxyPushConsumer *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ proxy->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions..
+ }
+ ACE_ENDTRY;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+void
+TAO_CEC_Reactive_SupplierControl::supplier_not_exist (
+ TAO_CEC_ProxyPullConsumer *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ proxy->disconnect_pull_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions..
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_CEC_Reactive_SupplierControl::system_exception (
+ TAO_CEC_ProxyPullConsumer *proxy,
+ CORBA::SystemException & /* exception */
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ if (this->need_to_disconnect (proxy))
+ {
+ proxy->disconnect_pull_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions..
+ }
+ ACE_ENDTRY;
+}
+
+// ****************************************************************
+
+TAO_CEC_SupplierControl_Adapter::TAO_CEC_SupplierControl_Adapter (
+ TAO_CEC_Reactive_SupplierControl *adaptee)
+ : adaptee_ (adaptee)
+{
+}
+
+int
+TAO_CEC_SupplierControl_Adapter::handle_timeout (
+ const ACE_Time_Value &tv,
+ const void *arg)
+{
+ this->adaptee_->handle_timeout (tv, arg);
+ return 0;
+}
+
+// ****************************************************************
+
+void
+TAO_CEC_Ping_Push_Supplier::work (TAO_CEC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CORBA::Boolean disconnected;
+ CORBA::Boolean non_existent =
+ consumer->supplier_non_existent (disconnected
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (non_existent && !disconnected)
+ {
+ this->control_->supplier_not_exist (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ this->control_->supplier_not_exist (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TRANSIENT, transient)
+ {
+ if (this->control_->need_to_disconnect (consumer))
+ {
+ this->control_->supplier_not_exist (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+// ****************************************************************
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+void
+TAO_CEC_Ping_Typed_Push_Supplier::work (TAO_CEC_TypedProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CORBA::Boolean disconnected;
+ CORBA::Boolean non_existent =
+ consumer->supplier_non_existent (disconnected
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (non_existent && !disconnected)
+ {
+ this->control_->supplier_not_exist (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ this->control_->supplier_not_exist (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TRANSIENT, transient)
+ {
+ if (this->control_->need_to_disconnect (consumer))
+ {
+ this->control_->supplier_not_exist (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+// ****************************************************************
+
+void
+TAO_CEC_Ping_Pull_Supplier::work (TAO_CEC_ProxyPullConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CORBA::Boolean disconnected;
+ CORBA::Boolean non_existent =
+ consumer->supplier_non_existent (disconnected
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (non_existent && !disconnected)
+ {
+ this->control_->supplier_not_exist (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ this->control_->supplier_not_exist (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TRANSIENT, transient)
+ {
+ if (this->control_->need_to_disconnect (consumer))
+ {
+ this->control_->supplier_not_exist (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.h
new file mode 100644
index 00000000000..bd7cbe1fd94
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.h
@@ -0,0 +1,229 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_Reactive_SupplierControl.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/
+ */
+//=============================================================================
+
+#ifndef TAO_CEC_REACTIVE_SUPPLIERCONTROL_H
+#define TAO_CEC_REACTIVE_SUPPLIERCONTROL_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEvent/CEC_SupplierControl.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+#include "tao/ORB.h"
+
+#include "ace/Event_Handler.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_EventChannel;
+class TAO_CEC_Reactive_SupplierControl;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+class TAO_CEC_TypedEventChannel;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+/**
+ * @class TAO_CEC_SupplierControl_Adapter
+ *
+ * @brief Forwards timeout events to the Reactive SupplierControl
+ *
+ * The Reactive SupplierControl strategy uses the reactor to
+ * periodically wakeup and verify the state of the suppliers
+ * registered with the Event Channel.
+ */
+class TAO_Event_Serv_Export TAO_CEC_SupplierControl_Adapter
+ : public ACE_Event_Handler
+{
+public:
+ /// Constructor
+ TAO_CEC_SupplierControl_Adapter (TAO_CEC_Reactive_SupplierControl *adaptee);
+
+ // = Documented in ACE_Event_Handler.
+ virtual int handle_timeout (const ACE_Time_Value &tv,
+ const void *arg = 0);
+
+private:
+ /// The adapted object
+ TAO_CEC_Reactive_SupplierControl *adaptee_;
+};
+
+/**
+ * @class TAO_CEC_Reactive_SupplierControl
+ *
+ * @brief SupplierControl
+ *
+ * Defines the interface for the supplier control strategy.
+ * This strategy handles misbehaving or failing suppliers.
+ * = MEMORY MANAGMENT
+ * = LOCKING
+ * = TODO
+ */
+class TAO_Event_Serv_Export TAO_CEC_Reactive_SupplierControl
+ : public TAO_CEC_SupplierControl
+{
+public:
+ /// Constructor. It does not assume ownership of the <event_channel>
+ /// parameter.
+ TAO_CEC_Reactive_SupplierControl (const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ unsigned int retries,
+ TAO_CEC_EventChannel *event_channel,
+ CORBA::ORB_ptr orb);
+
+ /// Constructor for the typed ec.
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ TAO_CEC_Reactive_SupplierControl (
+ const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ unsigned int retries,
+ TAO_CEC_TypedEventChannel *typed_event_channel,
+ CORBA::ORB_ptr orb
+ );
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /// destructor...
+ virtual ~TAO_CEC_Reactive_SupplierControl (void);
+
+ /// Receive the timeout from the adapter
+ void handle_timeout (const ACE_Time_Value &tv,
+ const void* arg);
+
+ // = Documented in TAO_CEC_SupplierControl
+ virtual int activate (void);
+ virtual int shutdown (void);
+ virtual void supplier_not_exist (TAO_CEC_ProxyPushConsumer *proxy
+ ACE_ENV_ARG_DECL_NOT_USED);
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ virtual void supplier_not_exist (TAO_CEC_TypedProxyPushConsumer *proxy
+ ACE_ENV_ARG_DECL_NOT_USED);
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+ virtual void supplier_not_exist (TAO_CEC_ProxyPullConsumer *proxy
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void system_exception (TAO_CEC_ProxyPullConsumer *proxy,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Do we need to disconnect this supplier? The parameter type for
+ /// proxy is PortableServer::ServantBase* due to the fact that this
+ /// method will be used for TAO_CEC_ProxyPushSupplier's and
+ /// TAO_CEC_ProxyPullSupplier's.
+ virtual bool need_to_disconnect (PortableServer::ServantBase* proxy);
+
+ /// Allow others to inform us when a send or receive was successful.
+ virtual void successful_transmission (PortableServer::ServantBase* proxy);
+
+private:
+ /// Check if the suppliers still exists. It is a helper method for
+ /// handle_timeout() to isolate the exceptions.
+ void query_suppliers (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// The polling rate
+ ACE_Time_Value rate_;
+
+ /// The polling timeout
+ ACE_Time_Value timeout_;
+
+ /// The number of retries per proxy until it is disconnected
+ unsigned int retries_;
+
+ /// The Adapter for the reactor events
+ TAO_CEC_SupplierControl_Adapter adapter_;
+
+ /// The event channel
+ TAO_CEC_EventChannel *event_channel_;
+
+ /// The typed event channel
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ TAO_CEC_TypedEventChannel *typed_event_channel_;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /// The ORB
+ CORBA::ORB_var orb_;
+
+ /// To control the timeout policy in the thread
+ CORBA::PolicyCurrent_var policy_current_;
+
+ /// Precomputed policy list to the set timeout.
+ CORBA::PolicyList policy_list_;
+
+ /// The ORB reactor
+ ACE_Reactor *reactor_;
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ /// The timer id
+ long timer_id_;
+#endif /* TAO_HAS_CORBA_MESSAGING */
+};
+
+// ****************************************************************
+
+class TAO_CEC_Ping_Push_Supplier : public TAO_ESF_Worker<TAO_CEC_ProxyPushConsumer>
+{
+public:
+ TAO_CEC_Ping_Push_Supplier (TAO_CEC_SupplierControl *control);
+
+ virtual void work (TAO_CEC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_CEC_SupplierControl *control_;
+};
+
+// ****************************************************************
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+class TAO_CEC_Ping_Typed_Push_Supplier : public TAO_ESF_Worker<TAO_CEC_TypedProxyPushConsumer>
+{
+public:
+ TAO_CEC_Ping_Typed_Push_Supplier (TAO_CEC_SupplierControl *control);
+
+ virtual void work (TAO_CEC_TypedProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_CEC_SupplierControl *control_;
+};
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+// ****************************************************************
+
+class TAO_CEC_Ping_Pull_Supplier : public TAO_ESF_Worker<TAO_CEC_ProxyPullConsumer>
+{
+public:
+ TAO_CEC_Ping_Pull_Supplier (TAO_CEC_SupplierControl *control);
+
+ virtual void work (TAO_CEC_ProxyPullConsumer *consumer
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_CEC_SupplierControl *control_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_Reactive_SupplierControl.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_SUPPLIERCONTROL_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.i
new file mode 100644
index 00000000000..e166f46ecf6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_Reactive_SupplierControl.i
@@ -0,0 +1,34 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_CEC_Ping_Push_Supplier::
+ TAO_CEC_Ping_Push_Supplier (TAO_CEC_SupplierControl *control)
+ : control_ (control)
+{
+}
+
+// ****************************************************************
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ACE_INLINE
+TAO_CEC_Ping_Typed_Push_Supplier::
+ TAO_CEC_Ping_Typed_Push_Supplier (TAO_CEC_SupplierControl *control)
+ : control_ (control)
+{
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_CEC_Ping_Pull_Supplier::
+ TAO_CEC_Ping_Pull_Supplier (TAO_CEC_SupplierControl *control)
+ : control_ (control)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierAdmin.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierAdmin.cpp
new file mode 100644
index 00000000000..e667fe96e0d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierAdmin.cpp
@@ -0,0 +1,105 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_SupplierAdmin.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPushConsumer.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPullConsumer.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/ESF/ESF_Shutdown_Proxy.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_SupplierAdmin.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (CosEvent,
+ CEC_SupplierAdmin,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_CEC_SupplierAdmin::TAO_CEC_SupplierAdmin (TAO_CEC_EventChannel *ec)
+ : event_channel_ (ec),
+ push_admin_ (ec),
+ pull_admin_ (ec)
+{
+ this->default_POA_ =
+ this->event_channel_->supplier_poa ();
+}
+
+TAO_CEC_SupplierAdmin::~TAO_CEC_SupplierAdmin (void)
+{
+}
+
+PortableServer::POA_ptr
+TAO_CEC_SupplierAdmin::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+void
+TAO_CEC_SupplierAdmin::connected (TAO_CEC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->push_admin_.connected (consumer ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_SupplierAdmin::reconnected (TAO_CEC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->push_admin_.reconnected (consumer ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_SupplierAdmin::disconnected (TAO_CEC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->push_admin_.disconnected (consumer ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_SupplierAdmin::connected (TAO_CEC_ProxyPullConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->pull_admin_.connected (consumer ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_SupplierAdmin::reconnected (TAO_CEC_ProxyPullConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->pull_admin_.reconnected (consumer ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_SupplierAdmin::disconnected (TAO_CEC_ProxyPullConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->pull_admin_.disconnected (consumer ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_SupplierAdmin::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->push_admin_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->pull_admin_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CosEventChannelAdmin::ProxyPushConsumer_ptr
+TAO_CEC_SupplierAdmin::obtain_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->push_admin_.obtain (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosEventChannelAdmin::ProxyPullConsumer_ptr
+TAO_CEC_SupplierAdmin::obtain_pull_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->pull_admin_.obtain (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierAdmin.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierAdmin.h
new file mode 100644
index 00000000000..a1e67f65c71
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierAdmin.h
@@ -0,0 +1,127 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_SupplierAdmin.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/
+ */
+//=============================================================================
+
+#ifndef TAO_CEC_SUPPLIERADMIN_H
+#define TAO_CEC_SUPPLIERADMIN_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEventChannelAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Proxy_Admin.h"
+
+#include "orbsvcs/CosEvent/CEC_ProxyPushConsumer.h"
+#include "orbsvcs/CosEvent/CEC_ProxyPullConsumer.h"
+#include "orbsvcs/CosEvent/event_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_EventChannel;
+
+/**
+ * @class TAO_CEC_SupplierAdmin
+ *
+ * @brief ProxyPushSupplier
+ *
+ * Implement the CosEventChannelAdmin::SupplierAdmin interface.
+ * This class is an Abstract Factory for the
+ * TAO_CEC_ProxyPushConsumer.
+ * = MEMORY MANAGMENT
+ * It does not assume ownership of the TAO_CEC_EventChannel object
+ * = LOCKING
+ * @@ TODO
+ * No provisions for locking, access must be serialized
+ * externally.
+ * = TODO
+ */
+class TAO_Event_Serv_Export TAO_CEC_SupplierAdmin
+ : public POA_CosEventChannelAdmin::SupplierAdmin
+{
+public:
+ /// constructor...
+ TAO_CEC_SupplierAdmin (TAO_CEC_EventChannel* event_channel);
+
+ /// destructor...
+ virtual ~TAO_CEC_SupplierAdmin (void);
+
+ /// For each elements call <worker->work()>.
+ void for_each (TAO_ESF_Worker<TAO_CEC_ProxyPushConsumer> *worker
+ ACE_ENV_ARG_DECL);
+
+ /// For each elements call <worker->work()>.
+ void for_each (TAO_ESF_Worker<TAO_CEC_ProxyPullConsumer> *worker
+ ACE_ENV_ARG_DECL);
+
+ /// Keep track of connected consumers.
+ virtual void connected (TAO_CEC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void reconnected (TAO_CEC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_CEC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void connected (TAO_CEC_ProxyPullConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void reconnected (TAO_CEC_ProxyPullConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_CEC_ProxyPullConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// The event channel is shutting down, inform all the consumers of
+ /// this
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+ // = The CosEventChannelAdmin::SupplierAdmin methods...
+ virtual CosEventChannelAdmin::ProxyPushConsumer_ptr
+ obtain_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual CosEventChannelAdmin::ProxyPullConsumer_ptr
+ obtain_pull_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // = The PortableServer::ServantBase methods
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// The Event Channel we belong to
+ TAO_CEC_EventChannel *event_channel_;
+
+ /// The push and pull aspects are implemented using these classes
+ TAO_ESF_Proxy_Admin<TAO_CEC_EventChannel,
+ TAO_CEC_ProxyPushConsumer,
+ CosEventChannelAdmin::ProxyPushConsumer>
+ push_admin_;
+ TAO_ESF_Proxy_Admin<TAO_CEC_EventChannel,
+ TAO_CEC_ProxyPullConsumer,
+ CosEventChannelAdmin::ProxyPullConsumer>
+ pull_admin_;
+
+ /// Store the default POA.
+ PortableServer::POA_var default_POA_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_SupplierAdmin.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_SUPPLIERADMIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierAdmin.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierAdmin.i
new file mode 100644
index 00000000000..ec420d2c576
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierAdmin.i
@@ -0,0 +1,23 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE void
+TAO_CEC_SupplierAdmin::
+ for_each (TAO_ESF_Worker<TAO_CEC_ProxyPushConsumer> *worker
+ ACE_ENV_ARG_DECL)
+{
+ this->push_admin_.for_each (worker ACE_ENV_ARG_PARAMETER);
+}
+
+ACE_INLINE void
+TAO_CEC_SupplierAdmin::
+ for_each (TAO_ESF_Worker<TAO_CEC_ProxyPullConsumer> *worker
+ ACE_ENV_ARG_DECL)
+{
+ this->pull_admin_.for_each (worker ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierControl.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierControl.cpp
new file mode 100644
index 00000000000..e9b79b992cd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierControl.cpp
@@ -0,0 +1,67 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_SupplierControl.h"
+
+ACE_RCSID(CosEvent, CEC_SupplierControl, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_CEC_SupplierControl::TAO_CEC_SupplierControl (void)
+{
+}
+
+TAO_CEC_SupplierControl::~TAO_CEC_SupplierControl (void)
+{
+}
+
+int
+TAO_CEC_SupplierControl::activate (void)
+{
+ return 0;
+}
+
+int
+TAO_CEC_SupplierControl::shutdown (void)
+{
+ return 0;
+}
+
+void
+TAO_CEC_SupplierControl::supplier_not_exist (TAO_CEC_ProxyPushConsumer *
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+void
+TAO_CEC_SupplierControl::supplier_not_exist (TAO_CEC_TypedProxyPushConsumer *
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+void
+TAO_CEC_SupplierControl::supplier_not_exist (TAO_CEC_ProxyPullConsumer *
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_CEC_SupplierControl::system_exception (TAO_CEC_ProxyPullConsumer *,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+bool
+TAO_CEC_SupplierControl::need_to_disconnect (PortableServer::ServantBase*)
+{
+ return true;
+}
+
+void
+TAO_CEC_SupplierControl::successful_transmission (PortableServer::ServantBase*)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierControl.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierControl.h
new file mode 100644
index 00000000000..4de8fc0c3f6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_SupplierControl.h
@@ -0,0 +1,112 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_SupplierControl.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_SUPPLIERCONTROL_H
+#define TAO_CEC_SUPPLIERCONTROL_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEvent/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/Basic_Types.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_EventChannel;
+class TAO_CEC_ProxyPushConsumer;
+class TAO_CEC_ProxyPullConsumer;
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+class TAO_CEC_TypedProxyPushConsumer;
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+namespace CORBA
+{
+ class SystemException;
+}
+
+/**
+ * @class TAO_CEC_SupplierControl
+ *
+ * @brief SupplierControl
+ *
+ * Defines the interface for the supplier control strategy.
+ * This strategy handles misbehaving or failing suppliers.
+ * = MEMORY MANAGMENT
+ * = LOCKING
+ * = TODO
+ */
+class TAO_Event_Serv_Export TAO_CEC_SupplierControl
+{
+public:
+ /// Constructor. It does not assume ownership of the <event_channel>
+ /// parameter.
+ TAO_CEC_SupplierControl (void);
+
+ /// destructor...
+ virtual ~TAO_CEC_SupplierControl (void);
+
+ /// Activate any internal threads or timers used to poll the state of
+ /// the suppliers
+ virtual int activate (void);
+ virtual int shutdown (void);
+
+ /**
+ * Invoked by helper classes when they detect that a supplier does
+ * not exists (i.e. _non_existent() returns true and/or the
+ * CORBA::OBJECT_NOT_EXIST exception has been raised).
+ */
+ virtual void supplier_not_exist (TAO_CEC_ProxyPushConsumer *proxy
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
+ virtual void supplier_not_exist (TAO_CEC_TypedProxyPushConsumer *proxy
+ ACE_ENV_ARG_DECL_NOT_USED);
+#endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
+
+ /**
+ * Invoked by helper classes when they detect that a supplier does
+ * not exists (i.e. _non_existent() returns true and/or the
+ * CORBA::OBJECT_NOT_EXIST exception has been raised).
+ */
+ virtual void supplier_not_exist (TAO_CEC_ProxyPullConsumer *proxy
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Some system exception was rasied while trying to push an event.
+ virtual void system_exception (TAO_CEC_ProxyPullConsumer *proxy,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Do we need to disconnect this supplier? The parameter type for
+ /// proxy is PortableServer::ServantBase* due to the fact that this
+ /// method will be used for TAO_CEC_ProxyPushSupplier's and
+ /// TAO_CEC_ProxyPullSupplier's.
+ virtual bool need_to_disconnect (PortableServer::ServantBase* proxy);
+
+ /// Allow others to inform us when a send or receive was successful.
+ virtual void successful_transmission (PortableServer::ServantBase* proxy);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_CEC_SUPPLIERCONTROL_H */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.cpp
new file mode 100644
index 00000000000..69c08a7b739
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.cpp
@@ -0,0 +1,135 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_TypedConsumerAdmin.h"
+
+#include "orbsvcs/CosEvent/CEC_TypedEventChannel.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_TypedConsumerAdmin.i"
+#endif /* __ACE_INLINE__ */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Implementation skeleton constructor
+TAO_CEC_TypedConsumerAdmin::TAO_CEC_TypedConsumerAdmin (TAO_CEC_TypedEventChannel *ec)
+ : typed_event_channel_ (ec),
+ typed_push_admin_ (ec)
+{
+ this->default_POA_ =
+ this->typed_event_channel_->typed_consumer_poa ();
+}
+
+// Implementation skeleton destructor
+TAO_CEC_TypedConsumerAdmin::~TAO_CEC_TypedConsumerAdmin (void)
+{
+}
+
+void
+TAO_CEC_TypedConsumerAdmin::invoke (const TAO_CEC_TypedEvent& typed_event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_CEC_Propagate_Typed_Event typed_event_worker (typed_event, this->typed_event_channel_);
+
+ this->typed_push_admin_.for_each (&typed_event_worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_TypedConsumerAdmin::connected (TAO_CEC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->typed_push_admin_.connected (supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_TypedConsumerAdmin::reconnected (TAO_CEC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->typed_push_admin_.reconnected (supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_TypedConsumerAdmin::disconnected (TAO_CEC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->typed_push_admin_.disconnected (supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_TypedConsumerAdmin::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->typed_push_admin_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CosTypedEventChannelAdmin::TypedProxyPullSupplier_ptr
+TAO_CEC_TypedConsumerAdmin::obtain_typed_pull_supplier (
+ const char * /*supported_interface*/
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosTypedEventChannelAdmin::InterfaceNotSupported
+ ))
+{
+ ACE_THROW_RETURN (CosTypedEventChannelAdmin::InterfaceNotSupported (), 0);
+}
+
+CosEventChannelAdmin::ProxyPushSupplier_ptr
+TAO_CEC_TypedConsumerAdmin::obtain_typed_push_supplier (
+ const char * uses_interface
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosTypedEventChannelAdmin::NoSuchImplementation
+ ))
+
+{
+ // Register the consumer uses_interface with the EC
+ int result = this->typed_event_channel_->consumer_register_uses_interace (uses_interface ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (result == -1)
+ {
+ ACE_THROW_RETURN (CosTypedEventChannelAdmin::NoSuchImplementation (), 0);
+ }
+
+ return this->typed_push_admin_.obtain (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosEventChannelAdmin::ProxyPushSupplier_ptr
+TAO_CEC_TypedConsumerAdmin::obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+CosEventChannelAdmin::ProxyPullSupplier_ptr
+TAO_CEC_TypedConsumerAdmin::obtain_pull_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+PortableServer::POA_ptr
+TAO_CEC_TypedConsumerAdmin::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+// ****************************************************************
+
+void
+TAO_CEC_Propagate_Typed_Event::work (TAO_CEC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ supplier->invoke (this->typed_event_ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.h
new file mode 100644
index 00000000000..72925fb2c00
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.h
@@ -0,0 +1,129 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_TypedConsumerAdmin.h
+ *
+ * $Id$
+ *
+ * @author Jon Astle (jon@astle45.fsnet.co.uk)
+ *
+ * Based on the untyped version by Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_TYPEDCONSUMERADMIN_H_
+#define TAO_CEC_TYPEDCONSUMERADMIN_H_
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosTypedEventChannelAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Proxy_Admin.h"
+
+#include "orbsvcs/CosEvent/CEC_ProxyPushSupplier.h"
+#include "orbsvcs/CosEvent/CEC_TypedEvent.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_TypedEventChannel;
+
+//Class TAO_CEC_TypedConsumerAdmin
+class TAO_Event_Serv_Export TAO_CEC_TypedConsumerAdmin
+ : public POA_CosTypedEventChannelAdmin::TypedConsumerAdmin
+{
+public:
+
+ // Constructor
+ TAO_CEC_TypedConsumerAdmin (TAO_CEC_TypedEventChannel* typed_event_channel);
+
+ // Destructor
+ virtual ~TAO_CEC_TypedConsumerAdmin (void);
+
+ /// For each elements call <worker->work()>.
+ void for_each (TAO_ESF_Worker<TAO_CEC_ProxyPushSupplier> *worker
+ ACE_ENV_ARG_DECL);
+
+ /// Invoke the typed event on all the consumers
+ virtual void invoke (const TAO_CEC_TypedEvent& typed_event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Used to inform the EC that a Supplier has connected or
+ /// disconnected from it.
+ virtual void connected (TAO_CEC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void reconnected (TAO_CEC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_CEC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// The typed event channel is shutting down, inform all the consumers of
+ /// this
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+ // = The CosTypedEventChannelAdmin::TypedConsumerAdmin methods...
+ virtual CosEventChannelAdmin::ProxyPushSupplier_ptr
+ obtain_typed_push_supplier (const char * uses_interface ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTypedEventChannelAdmin::NoSuchImplementation));
+ virtual CosTypedEventChannelAdmin::TypedProxyPullSupplier_ptr
+ obtain_typed_pull_supplier (const char * supported_interface ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTypedEventChannelAdmin::InterfaceNotSupported));
+
+ // = The CosEventChannelAdmin::ConsumerAdmin methods...
+ virtual CosEventChannelAdmin::ProxyPushSupplier_ptr
+ obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosEventChannelAdmin::ProxyPullSupplier_ptr
+ obtain_pull_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // = The PortableServer::ServantBase methods
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// The Event Channel we belong to
+ TAO_CEC_TypedEventChannel *typed_event_channel_;
+
+ /// Store the default POA.
+ PortableServer::POA_var default_POA_;
+
+ /// Implement the push side of this class
+ TAO_ESF_Proxy_Admin<TAO_CEC_TypedEventChannel,TAO_CEC_ProxyPushSupplier,CosEventChannelAdmin::ProxyPushSupplier> typed_push_admin_;
+};
+
+// ****************************************************************
+
+class TAO_CEC_Propagate_Typed_Event : public TAO_ESF_Worker<TAO_CEC_ProxyPushSupplier>
+{
+public:
+ TAO_CEC_Propagate_Typed_Event (const TAO_CEC_TypedEvent& typed_event,
+ TAO_CEC_TypedEventChannel* typed_event_channel);
+
+ void work (TAO_CEC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL);
+
+private:
+ /// The typed event
+ const TAO_CEC_TypedEvent typed_event_;
+
+ /// The typed EC
+ TAO_CEC_TypedEventChannel* typed_event_channel_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_TypedConsumerAdmin.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_CEC_TYPEDCONSUMERADMIN_H_ */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.i
new file mode 100644
index 00000000000..37a0dd30d28
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedConsumerAdmin.i
@@ -0,0 +1,24 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE void
+TAO_CEC_TypedConsumerAdmin::
+ for_each (TAO_ESF_Worker<TAO_CEC_ProxyPushSupplier> *worker
+ ACE_ENV_ARG_DECL)
+{
+ this->typed_push_admin_.for_each (worker ACE_ENV_ARG_PARAMETER);
+}
+
+ACE_INLINE
+TAO_CEC_Propagate_Typed_Event::TAO_CEC_Propagate_Typed_Event (
+ const TAO_CEC_TypedEvent& typed_event,
+ TAO_CEC_TypedEventChannel* typed_event_channel)
+ : typed_event_ (typed_event),
+ typed_event_channel_ (typed_event_channel)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEvent.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEvent.cpp
new file mode 100644
index 00000000000..9142e04e6bb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEvent.cpp
@@ -0,0 +1,9 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_TypedEvent.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_TypedEvent.i"
+#endif /* __ACE_INLINE__ */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEvent.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEvent.h
new file mode 100644
index 00000000000..8dff16f8bf1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEvent.h
@@ -0,0 +1,69 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_TypedEvent.h
+ *
+ * $Id$
+ *
+ * @author Jon Astle (jon@astle45.fsnet.co.uk)
+ */
+//=============================================================================
+
+#ifndef TAO_CEC_TYPEDEVENT_H_
+#define TAO_CEC_TYPEDEVENT_H_
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEvent/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/AnyTypeCode/NVList.h"
+#include "tao/CORBA_String.h"
+#include "tao/CORBA_methods.h"
+
+// ****************************************************************
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_CEC_TypedEvent
+ *
+ * @brief Defines the operation and args list for the TypedEvent
+ *
+ * Used to store the TypedEvent as it is passed from the supplier
+ * side to the consumer side, in the TypedEventChannel.
+ */
+
+class TAO_CEC_ProxyPushSupplier;
+
+class TAO_Event_Serv_Export TAO_CEC_TypedEvent
+{
+public:
+ /// constructors...
+ TAO_CEC_TypedEvent (void);
+
+ TAO_CEC_TypedEvent (CORBA::NVList_ptr list,
+ const char * operation);
+
+ TAO_CEC_TypedEvent & operator= (const TAO_CEC_TypedEvent &);
+
+private:
+ /// Only the ProxyPushSupplier can read the private fields.
+ friend class TAO_CEC_ProxyPushSupplier;
+
+ CORBA::NVList_ptr list_;
+ CORBA::String_var operation_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_TypedEvent.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_TYPEDEVENT_H_ */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEvent.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEvent.i
new file mode 100644
index 00000000000..4c8f0aab997
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEvent.i
@@ -0,0 +1,30 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_CEC_TypedEvent::TAO_CEC_TypedEvent (void)
+{
+}
+
+ACE_INLINE
+TAO_CEC_TypedEvent::TAO_CEC_TypedEvent (CORBA::NVList_ptr list,
+ const char * operation)
+ : list_ (list),
+ operation_ (operation)
+{
+}
+
+ACE_INLINE
+TAO_CEC_TypedEvent&
+TAO_CEC_TypedEvent::operator= (const TAO_CEC_TypedEvent& other)
+{
+ this->list_ = CORBA::NVList::_duplicate (other.list_);
+ this->operation_ = CORBA::string_dup (other.operation_);
+
+ return *this;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEventChannel.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEventChannel.cpp
new file mode 100644
index 00000000000..f29d1421580
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEventChannel.cpp
@@ -0,0 +1,597 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_TypedEventChannel.h"
+#include "orbsvcs/CosEvent/CEC_Dispatching.h"
+#include "orbsvcs/CosEvent/CEC_TypedConsumerAdmin.h"
+#include "orbsvcs/CosEvent/CEC_TypedSupplierAdmin.h"
+#include "orbsvcs/CosEvent/CEC_ConsumerControl.h"
+#include "orbsvcs/CosEvent/CEC_SupplierControl.h"
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/Reactor.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_TypedEventChannel.i"
+#endif /* __ACE_INLINE__ */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Implementation skeleton constructor
+TAO_CEC_TypedEventChannel::
+TAO_CEC_TypedEventChannel (const TAO_CEC_TypedEventChannel_Attributes& attr,
+ TAO_CEC_Factory* factory,
+ int own_factory)
+ : typed_supplier_poa_ (PortableServer::POA::_duplicate (attr.typed_supplier_poa)),
+ typed_consumer_poa_ (PortableServer::POA::_duplicate (attr.typed_consumer_poa)),
+ orb_ (CORBA::ORB::_duplicate (attr.orb)),
+ interface_repository_ (CORBA::Repository::_duplicate (attr.interface_repository)),
+ factory_ (factory),
+ own_factory_ (own_factory),
+ consumer_reconnect_ (attr.consumer_reconnect),
+ supplier_reconnect_ (attr.supplier_reconnect),
+ disconnect_callbacks_ (attr.disconnect_callbacks),
+ destroy_on_shutdown_ (attr.destroy_on_shutdown),
+ destroyed_ (0)
+{
+ if (this->factory_ == 0)
+ {
+ this->factory_ =
+ ACE_Dynamic_Service<TAO_CEC_Factory>::instance ("CEC_Factory");
+ this->own_factory_ = 0;
+ ACE_ASSERT (this->factory_ != 0);
+ }
+
+ this->dispatching_ =
+ this->factory_->create_dispatching (this);
+ this->typed_consumer_admin_ =
+ this->factory_->create_consumer_admin (this);
+ this->typed_supplier_admin_ =
+ this->factory_->create_supplier_admin (this);
+ this->consumer_control_ =
+ this->factory_->create_consumer_control (this);
+ this->supplier_control_ =
+ this->factory_->create_supplier_control (this);
+}
+
+// Implementation skeleton destructor
+TAO_CEC_TypedEventChannel::~TAO_CEC_TypedEventChannel (void)
+{
+ this->clear_ifr_cache ();
+ this->interface_description_.close ();
+
+ this->factory_->destroy_dispatching (this->dispatching_);
+ this->dispatching_ = 0;
+
+ this->factory_->destroy_consumer_admin (this->typed_consumer_admin_);
+ this->typed_consumer_admin_ = 0;
+ this->factory_->destroy_supplier_admin (this->typed_supplier_admin_);
+ this->typed_supplier_admin_ = 0;
+
+ if (this->own_factory_)
+ delete this->factory_;
+}
+
+void
+TAO_CEC_TypedEventChannel::activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->dispatching_->activate ();
+ this->consumer_control_->activate ();
+ this->supplier_control_->activate ();
+}
+
+namespace
+{
+ struct ShutdownHandler : ACE_Event_Handler
+ {
+ ShutdownHandler (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb)) {}
+ CORBA::ORB_var orb_;
+
+ virtual int handle_timeout (const ACE_Time_Value&, const void*)
+ {
+ orb_->shutdown (1);
+ return 0;
+ }
+
+ };
+}
+
+void
+TAO_CEC_TypedEventChannel::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->dispatching_->shutdown ();
+ this->supplier_control_->shutdown ();
+ this->consumer_control_->shutdown ();
+
+ PortableServer::POA_var typed_consumer_poa =
+ this->typed_consumer_admin_->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var typed_consumer_id =
+ typed_consumer_poa->servant_to_id (this->typed_consumer_admin_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ typed_consumer_poa->deactivate_object (typed_consumer_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::POA_var typed_supplier_poa =
+ this->typed_supplier_admin_->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var typed_supplier_id =
+ typed_supplier_poa->servant_to_id (this->typed_supplier_admin_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ typed_supplier_poa->deactivate_object (typed_supplier_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->typed_supplier_admin_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->typed_consumer_admin_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (destroy_on_shutdown_)
+ {
+ // Deactivate the Typed EC
+ PortableServer::POA_var t_poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::ObjectId_var t_id =
+ t_poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ t_poa->deactivate_object (t_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_Event_Handler *timer;
+ ACE_NEW (timer, ShutdownHandler (this->orb_.in ()));
+ ACE_Reactor *reactor = this->orb_->orb_core ()->reactor ();
+ reactor->schedule_timer (timer, 0, ACE_Time_Value (1));
+ }
+}
+
+void
+TAO_CEC_TypedEventChannel::connected (TAO_CEC_TypedProxyPushConsumer* consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->typed_supplier_admin_->connected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_TypedEventChannel::reconnected (TAO_CEC_TypedProxyPushConsumer* consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->typed_supplier_admin_->reconnected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_TypedEventChannel::disconnected (TAO_CEC_TypedProxyPushConsumer* consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->typed_supplier_admin_->disconnected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_TypedEventChannel::connected (TAO_CEC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->typed_consumer_admin_->connected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_TypedEventChannel::reconnected (TAO_CEC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->typed_consumer_admin_->reconnected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CEC_TypedEventChannel::disconnected (TAO_CEC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->typed_consumer_admin_->disconnected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// Find from the ifr cache the operation and return the parameter array pointer.
+TAO_CEC_Operation_Params *
+TAO_CEC_TypedEventChannel::find_from_ifr_cache (const char *operation)
+{
+ TAO_CEC_Operation_Params *found = 0;
+
+ this->interface_description_.find (operation, found);
+
+ return found;
+}
+
+// Insert the operation and its parameters into the ifr cache.
+int
+TAO_CEC_TypedEventChannel::insert_into_ifr_cache (const char *operation_,
+ TAO_CEC_Operation_Params *parameters_)
+{
+ // Make sure that the supplied Object reference is valid,
+ // i.e. not nil.
+ if (operation_ == 0 || parameters_ == 0)
+ {
+ errno = EINVAL;
+ return -1;
+ };
+
+ CORBA::String_var operation = CORBA::string_dup (operation_);
+
+ int result = this->interface_description_.bind (operation.in (), parameters_);
+
+ if (result == 0)
+ {
+ // Transfer ownership to the Object InterfaceDescription map.
+ (void) operation._retn ();
+ }
+
+ return result;
+}
+
+// Clear the ifr cache, freeing up all its contents.
+int
+TAO_CEC_TypedEventChannel::clear_ifr_cache (void)
+{
+ for (Iterator i = this->interface_description_.begin ();
+ i != this->interface_description_.end ();
+ ++i)
+ {
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** Destroying operation %s from ifr cache *****\n"),
+ const_cast<char *> ((*i).ext_id_)));
+ }
+
+ // Deallocate the operation
+ CORBA::string_free (const_cast<char *> ((*i).ext_id_));
+
+ // Destroy the parameter
+ delete ((*i).int_id_);
+ }
+
+ int result = this->interface_description_.unbind_all ();
+
+ return result;
+}
+
+
+// The function performs a lookup_id of the passed interface in the IFR,
+// and then obtains the FullInterfaceDescription.
+// The base interfaces for the interface are stored on this class.
+// All the operations and their parameters are then inserted in the ifr cache.
+// Function returns 0 if successful or -1 on a failure.
+int
+TAO_CEC_TypedEventChannel::cache_interface_description (const char *interface_
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ // Lookup the Interface Name in the IFR
+ CORBA::Contained_var contained =
+ this->interface_repository_->lookup_id (interface_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow the interface
+ CORBA::InterfaceDef_var interface =
+ CORBA::InterfaceDef::_narrow (contained.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (interface.in () ))
+ {
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** CORBA::InterfaceDef::_narrow failed for interface %s *****\n"),
+ interface_));
+ }
+ return -1;
+ }
+ else
+ {
+ // Obtain the full interface description
+ CORBA::InterfaceDef::FullInterfaceDescription_var fid =
+ interface->describe_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the base interfaces
+ this->base_interfaces_ = fid->base_interfaces;
+ if (TAO_debug_level >= 10)
+ {
+ for (CORBA::ULong base=0; base<fid->base_interfaces.length(); base++)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** Base interface %s found on interface %s *****\n"),
+ static_cast<char const*>(fid->base_interfaces[base]),
+ interface_ ));
+ }
+ }
+
+ // Obtain the operations
+ for (CORBA::ULong oper=0; oper<fid->operations.length(); oper++)
+ {
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** Operation %s found on interface %s, num params %d *****\n"),
+ fid->operations[oper].name.in(),
+ interface_,
+ fid->operations[oper].parameters.length() ));
+ }
+
+ // Obtain the parameters
+ CORBA::ULong num_params = fid->operations[oper].parameters.length();
+ TAO_CEC_Operation_Params *oper_params = new TAO_CEC_Operation_Params (num_params);
+
+ for (CORBA::ULong param=0; param<num_params; param++)
+ {
+ oper_params->parameters_[param].name_ = fid->operations[oper].parameters[param].name.in();
+ oper_params->parameters_[param].type_ = fid->operations[oper].parameters[param].type;
+ switch (fid->operations[oper].parameters[param].mode)
+ {
+ case CORBA::PARAM_IN:
+ oper_params->parameters_[param].direction_ = CORBA::ARG_IN;
+ break;
+ case CORBA::PARAM_OUT:
+ oper_params->parameters_[param].direction_ = CORBA::ARG_OUT;
+ break;
+ case CORBA::PARAM_INOUT:
+ oper_params->parameters_[param].direction_ = CORBA::ARG_INOUT;
+ break;
+ }
+
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** Parameter %s found on operation %s *****\n"),
+ oper_params->parameters_[param].name_.in(),
+ fid->operations[oper].name.in() ));
+ }
+ }
+
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** Adding operation %s with %d parameters to the IFR cache *****\n"),
+ fid->operations[oper].name.in(),
+ oper_params->num_params_ ));
+ }
+
+ int result = insert_into_ifr_cache (fid->operations[oper].name.in(), oper_params);
+ if (result != 0)
+ {
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** Adding operation to IFR cache failed *****\n")));
+ }
+ }
+ }
+ }
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ if (TAO_debug_level >= 4)
+ {
+ ACE_PRINT_EXCEPTION (sysex, "during TAO_CEC_TypedEventChannel::cache_interface_description");
+ }
+ return -1;
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level >= 4)
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ACE_ANY_EXCEPTION raised during TAO_CEC_TypedEventChannel::cache_interface_description");
+ }
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+// A consumer is attempting to register its uses_interface.
+// Note only a single interface can be registered with this version of the EC.
+// For users that require more than one interface, start another EC.
+// If the passed uses_interface is the same as a registered interface the function returns 0.
+// If an attempt is made to register a second interface, this function will return -1
+// and the TypedConsumerAdmin will throw CosTypedEventChannelAdmin::NoSuchImplementation.
+// If neither a consumer nor a supplier has registered an interface,
+// the function calls cache_interface_description and returns 0 if successful.
+int
+TAO_CEC_TypedEventChannel::consumer_register_uses_interace (const char *uses_interface
+ ACE_ENV_ARG_DECL)
+{
+ // Check if a consumer has already registered an interface with the typed EC
+ if (this->uses_interface_.length() > 0)
+ {
+ // Check if the registered uses_interface_ == the new uses_interface
+ if (this->uses_interface_ == ACE_CString (uses_interface))
+ {
+ return 0;
+ }
+ else
+ {
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** different uses_interface_ already registered *****\n")));
+ }
+ return -1;
+ }
+ }
+
+ // Check if a supplier has already registered an inerface with the typed EC
+ if (this->supported_interface_.length() > 0)
+ {
+ // Check if the registered supported_interface_ == the new uses_interface
+ if (this->supported_interface_ == ACE_CString (uses_interface))
+ {
+ this->uses_interface_ = uses_interface;
+ return 0;
+ }
+ else
+ {
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** different supported_interface_ already registered *****\n")));
+ }
+ return -1;
+ }
+ }
+ else
+ {
+ // Neither a consumer nor a supplier has connected yet
+ int result = cache_interface_description (uses_interface ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (result == 0)
+ {
+ this->uses_interface_ = uses_interface;
+ }
+ return result;
+ }
+}
+
+// A supplier is attempting to register its supported_interface.
+// Note only a single interface can be registered with this version of the EC.
+// For users that require more than one interface, start another EC.
+// If the passed supported_interface is the same as a registered interface the function returns 0.
+// If an attempt is made to register a second interface, this function will return -1
+// and the TypedSupplierAdmin will throw CosTypedEventChannelAdmin::InterfaceNotSupported.
+// If neither a consumer nor a supplier has registered an interface,
+// the function calls cache_interface_description and returns 0 if successful.
+int
+TAO_CEC_TypedEventChannel::supplier_register_supported_interface (const char *supported_interface
+ ACE_ENV_ARG_DECL)
+{
+ // Check if a supplier has already registered an interface with the typed EC
+ if (this->supported_interface_.length() > 0)
+ {
+ // Check if the registered interface == the new supported_interface
+ if (this->supported_interface_ == ACE_CString (supported_interface))
+ {
+ return 0;
+ }
+ else
+ {
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** different supported_interface_ already registered *****\n")));
+ }
+ return -1;
+ }
+ }
+
+ // Check if a consumer has already registered an inerface with the typed EC
+ if (this->uses_interface_.length() > 0)
+ {
+ // Check if the registered uses_interface_ == the new supported_interface
+ if (this->uses_interface_ == ACE_CString (supported_interface))
+ {
+ this->supported_interface_ = supported_interface;
+ return 0;
+ }
+ else
+ {
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** different uses_interface_ already registered *****\n")));
+ }
+ return -1;
+ }
+ }
+ else
+ {
+ // Neither a consumer nor a supplier has connected yet
+ int result = cache_interface_description (supported_interface ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (result == 0)
+ {
+ this->supported_interface_ = supported_interface;
+ }
+ return result;
+ }
+}
+
+// Function creates a NVList and populates it from the parameter information.
+void
+TAO_CEC_TypedEventChannel::create_operation_list (TAO_CEC_Operation_Params *oper_params,
+ CORBA::NVList_out new_list
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_->create_list (0, new_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ for (CORBA::ULong param=0; param<oper_params->num_params_; param++)
+ {
+
+ CORBA::Any any_1;
+ any_1._tao_set_typecode(oper_params->parameters_[param].type_.in ());
+
+ new_list->add_value (oper_params->parameters_[param].name_. in (),
+ any_1,
+ oper_params->parameters_[param].direction_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+// Function creates an empty NVList.
+void
+TAO_CEC_TypedEventChannel::create_list (CORBA::Long count,
+ CORBA::NVList_out new_list
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_->create_list (count, new_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// The CosTypedEventChannelAdmin::TypedEventChannel methods...
+CosTypedEventChannelAdmin::TypedConsumerAdmin_ptr
+TAO_CEC_TypedEventChannel::for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->typed_consumer_admin_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosTypedEventChannelAdmin::TypedSupplierAdmin_ptr
+TAO_CEC_TypedEventChannel::for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->typed_supplier_admin_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_TypedEventChannel::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (!destroyed_)
+ {
+ destroyed_ = 1;
+ this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+CORBA::Policy_ptr
+TAO_CEC_TypedEventChannel::create_roundtrip_timeout_policy
+(const ACE_Time_Value &timeout)
+{
+ return this->factory_->create_roundtrip_timeout_policy (timeout);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEventChannel.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEventChannel.h
new file mode 100644
index 00000000000..d41f719f6d4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEventChannel.h
@@ -0,0 +1,393 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_TypedEventChannel.h
+ *
+ * @author Jon Astle (jon@astle45.fsnet.co.uk)
+ *
+ * $Id$
+ *
+ * A new implementation of the COS Typed Event Channel, based on
+ * the untyped version by Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ */
+//=============================================================================
+
+#ifndef TAO_CEC_TYPEDEVENTCHANNEL_H_
+#define TAO_CEC_TYPEDEVENTCHANNEL_H_
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEvent/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosEvent/CEC_Defaults.h"
+
+#include "orbsvcs/CosTypedEventChannelAdminS.h"
+
+#include "orbsvcs/CosEvent/CEC_Factory.h"
+
+#include "tao/IFR_Client/IFR_BasicC.h"
+#include "tao/AnyTypeCode/NVList.h"
+
+#include "ace/Hash_Map_Manager.h"
+#include "ace/Null_Mutex.h"
+#include "ace/SString.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_CEC_TypedEventChannel_Attributes
+ *
+ * @brief Defines the construction time attributes for the Typed
+ * Event Channel.
+ *
+ * The typed event channel implementation is controlled by
+ * two mechanisms:
+ * The CEC_Factory that provides the strategies for the EC
+ * implementation.
+ * The EC attributes that define constants and values required
+ * by the EC construction.
+ * This class encapsulates those constants and values, providing
+ * an easy mechanism to extend the attributes without requiring
+ * changes in the EC constructor.
+ */
+class TAO_Event_Serv_Export TAO_CEC_TypedEventChannel_Attributes
+{
+public:
+ /**
+ * The basic constructor.
+ * The attributes listed as arguments are *required* by the EC, and
+ * no appropiate defaults are available for them.
+ */
+ TAO_CEC_TypedEventChannel_Attributes (PortableServer::POA_ptr typed_supplier_poa,
+ PortableServer::POA_ptr typed_consumer_poa,
+ CORBA::ORB_ptr orb,
+ CORBA::Repository_ptr interface_repository);
+
+ // Most fields are public, there is no need to protect them, in fact
+ // the user should be able to set any values she wants.
+
+ /// Can consumers or suppliers invoke connect_push_* multiple times?
+ int consumer_reconnect;
+ int supplier_reconnect;
+
+ /**
+ * It not zero the event channel will send disconnect callbacks when
+ * a disconnect method is called on a Proxy. In other words, if a
+ * consumer calls disconnect_push_supplier() on its proxy the EC
+ * will invoke disconnect_push_consumer() on the consumer. A
+ * similar thing is done for suppliers.
+ * It is a matter of debate what the spec requires for the regular
+ * event service.
+ */
+ int disconnect_callbacks;
+
+ /**
+ * If not zero the event channel will deactive its Impl and call
+ * orb->shutdown(0), when destoy is invoked.
+ */
+ int destroy_on_shutdown;
+
+private:
+ /// Only the EC can read the private fields.
+ friend class TAO_CEC_TypedEventChannel;
+
+ /// The POAs
+ PortableServer::POA_ptr typed_supplier_poa;
+ PortableServer::POA_ptr typed_consumer_poa;
+
+ /// The ORB
+ CORBA::ORB_ptr orb;
+
+ /// The Interface Repository
+ CORBA::Repository_ptr interface_repository;
+};
+
+class TAO_CEC_Operation_Params;
+
+//Class TAO_CEC_TypedEventChannel
+class TAO_Event_Serv_Export TAO_CEC_TypedEventChannel : public virtual POA_CosTypedEventChannelAdmin::TypedEventChannel
+{
+public:
+ class ServantBaseHash
+ {
+ public:
+ u_long operator() (PortableServer::ServantBase* const & ptr) const {
+ return reinterpret_cast<u_long> (ptr);
+ }
+ };
+
+ typedef ACE_Hash_Map_Manager_Ex<PortableServer::ServantBase*,
+ unsigned int,
+ ServantBaseHash,
+ ACE_Equal_To<PortableServer::ServantBase*>,
+ TAO_SYNCH_MUTEX> ServantRetryMap;
+
+ /**
+ * Constructor
+ * If <own_factory> is not 0 it assumes ownership of the factory.
+ * If the factory is <nil> it uses the Service_Configurator to load
+ * the Factory, if not found it uses TAO_CEC_Default_Resource_Factory
+ */
+ TAO_CEC_TypedEventChannel (const TAO_CEC_TypedEventChannel_Attributes& attributes,
+ TAO_CEC_Factory* factory = 0,
+ int own_factory = 0);
+
+ /// Destructor
+ virtual ~TAO_CEC_TypedEventChannel (void);
+
+ /// Start the internal threads (if any), etc.
+ /// After this call the EC can be used.
+ virtual void activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// Shutdown any internal threads, cleanup all the internal
+ /// structures, flush all the messages, etc.
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// Access the dispatching module....
+ TAO_CEC_Dispatching* dispatching (void) const;
+
+ /// Access the consumer admin implementation.
+ TAO_CEC_TypedConsumerAdmin* typed_consumer_admin (void) const;
+
+ /// Access the supplier admin implementation.
+ TAO_CEC_TypedSupplierAdmin* typed_supplier_admin (void) const;
+
+ /// Access the consumer control strategy.
+ TAO_CEC_ConsumerControl* consumer_control (void) const;
+
+ /// Access the supplier control strategy.
+ TAO_CEC_SupplierControl* supplier_control (void) const;
+
+ // = The factory methods, they delegate on the CEC_Factory.
+ /// Create and destroy a ProxyPushSupplier
+ void create_proxy (TAO_CEC_ProxyPushSupplier*&);
+ void destroy_proxy (TAO_CEC_ProxyPushSupplier*);
+
+ /// Create and destroy a TypedProxyPushConsumer
+ void create_proxy (TAO_CEC_TypedProxyPushConsumer*&);
+ void destroy_proxy (TAO_CEC_TypedProxyPushConsumer*);
+
+ /// Create and destroy a the collections used to store
+ /// Proxy*Suppliers
+ void create_proxy_collection (TAO_CEC_ProxyPushSupplier_Collection*&);
+ void destroy_proxy_collection (TAO_CEC_ProxyPushSupplier_Collection*);
+
+ /// Create and destroy a the collections used to store
+ /// Proxy*Consumers
+ void create_proxy_collection (TAO_CEC_TypedProxyPushConsumer_Collection*&);
+ void destroy_proxy_collection (TAO_CEC_TypedProxyPushConsumer_Collection*);
+
+ /// Access the supplier and consumer POAs from the factory.
+ PortableServer::POA_ptr typed_supplier_poa (void);
+ PortableServer::POA_ptr typed_consumer_poa (void);
+
+ /// Locking strategies for the ProxyPushConsumer and
+ /// ProxyPushSupplier objects
+ ACE_Lock* create_consumer_lock (void);
+ void destroy_consumer_lock (ACE_Lock*);
+ ACE_Lock* create_supplier_lock (void);
+ void destroy_supplier_lock (ACE_Lock*);
+
+ /// Used to inform the EC that a Consumer has connected or
+ /// disconnected from it.
+ virtual void connected (TAO_CEC_TypedProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void reconnected (TAO_CEC_TypedProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_CEC_TypedProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Used to inform the EC that a Supplier has connected or
+ /// disconnected from it.
+ virtual void connected (TAO_CEC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void reconnected (TAO_CEC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_CEC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Can the consumers reconnect to the EC?
+ int consumer_reconnect (void) const;
+
+ /// Can the suppliers reconnect to the EC?
+ int supplier_reconnect (void) const;
+
+ /// Should we send callback disconnect messages when a proxy is
+ /// disconnected by the client
+ int disconnect_callbacks (void) const;
+
+ // Hash map which will operate as a IFR cache for the Supported Interface's operations and parameters
+ typedef ACE_Hash_Map_Manager_Ex<const char *, TAO_CEC_Operation_Params *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, ACE_Null_Mutex> InterfaceDescription;
+ typedef InterfaceDescription::iterator Iterator;
+
+ /// Finds a operation/parameter from the IFR cache
+ TAO_CEC_Operation_Params * find_from_ifr_cache (const char *operation);
+
+ /// Function allows consumer admin to register the uses interface
+ int consumer_register_uses_interace (const char *uses_interface ACE_ENV_ARG_DECL);
+
+ /// Function allows supplier admin to register the supported interface
+ int supplier_register_supported_interface (const char *supported_interface ACE_ENV_ARG_DECL);
+
+ /// Function to return the supported_interface_
+ const char * supported_interface (void) const;
+
+ /// Function to return the base_interfaces_
+ CORBA::RepositoryId base_interfaces (CORBA::ULong index) const;
+
+ /// Function to return the number of base_interfaces_
+ CORBA::ULong number_of_base_interfaces (void) const;
+
+ /// Function populates the NVList from the provide param information
+ virtual void create_operation_list (TAO_CEC_Operation_Params *oper_params,
+ CORBA::NVList_out new_list
+ ACE_ENV_ARG_DECL);
+
+ /// Function creates an empty NVList
+ virtual void create_list (CORBA::Long count,
+ CORBA::NVList_out new_list
+ ACE_ENV_ARG_DECL);
+
+ // = The CosTypedEventChannelAdmin::TypedEventChannel methods...
+ virtual ::CosTypedEventChannelAdmin::TypedConsumerAdmin_ptr
+ for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::CosTypedEventChannelAdmin::TypedSupplierAdmin_ptr
+ for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ServantRetryMap& get_servant_retry_map (void);
+
+ /// Forwarded to the factory
+ CORBA::Policy_ptr
+ create_roundtrip_timeout_policy (const ACE_Time_Value &timeout);
+
+protected:
+ /// Function caches the full interface description from the IFR
+ int cache_interface_description (const char *interface ACE_ENV_ARG_DECL);
+
+ /// Insert a operation/parameter into the IFR cache
+ int insert_into_ifr_cache (const char *operation, TAO_CEC_Operation_Params *parameters);
+
+ /// Function clears the IFR cache
+ int clear_ifr_cache (void);
+
+private:
+ /// The POAs used to activate "supplier-side" and "consumer-side"
+ /// objects.
+ PortableServer::POA_var typed_supplier_poa_;
+ PortableServer::POA_var typed_consumer_poa_;
+
+ /// The ORB
+ CORBA::ORB_var orb_;
+
+ /// Storage of the IFR reference
+ CORBA::Repository_var interface_repository_;
+
+ /**
+ * This is the abstract factory that creates all the objects that
+ * compose an event channel, the event channel simply acts as a
+ * Mediator among them.
+ */
+ TAO_CEC_Factory *factory_;
+
+ /// Flag that indicates if we own the factory.
+ int own_factory_;
+
+ /// The dispatching "module"
+ TAO_CEC_Dispatching *dispatching_;
+
+ /// The ConsumerAdmin implementation
+ TAO_CEC_TypedConsumerAdmin *typed_consumer_admin_;
+
+ /// The SupplierAdmin implementation
+ TAO_CEC_TypedSupplierAdmin *typed_supplier_admin_;
+
+ /// Consumer reconnection flags
+ int consumer_reconnect_;
+
+ /// Supplier reconnection flags
+ int supplier_reconnect_;
+
+ /// If not zero we send callbacks when a proxy is disconnected
+ int disconnect_callbacks_;
+
+ /// If not zero the event channel is destroyed on shutdown
+ int destroy_on_shutdown_;
+
+ /// Set if the event channel has been destroyed
+ int destroyed_;
+
+ /// Strategies to disconnect misbehaving or destroyed consumers and
+ /// suppliers
+ TAO_CEC_ConsumerControl *consumer_control_;
+ ServantRetryMap retry_map_;
+
+ TAO_CEC_SupplierControl *supplier_control_;
+
+ /// The uses_interface_ for the TypedConsumerAdmin.
+ ACE_CString uses_interface_;
+
+ /// The supported_interface_ for the TypedSupplierAdmin.
+ ACE_CString supported_interface_;
+
+ /// The IFR cache for the interface description
+ InterfaceDescription interface_description_;
+
+ /// The supported_interface_ base interfaces
+ CORBA::RepositoryIdSeq base_interfaces_;
+};
+
+
+class TAO_Event_Serv_Export TAO_CEC_Param
+{
+public:
+ /// Constructor
+ TAO_CEC_Param (void);
+
+ /// Destructor
+ ~TAO_CEC_Param (void);
+
+private:
+ /// Only the TypedEventChannel can read the private fields.
+ friend class TAO_CEC_TypedEventChannel;
+
+ CORBA::String_var name_;
+ CORBA::TypeCode_var type_;
+ CORBA::Flags direction_;
+};
+
+
+class TAO_Event_Serv_Export TAO_CEC_Operation_Params
+{
+ /// constructor
+ TAO_CEC_Operation_Params (CORBA::ULong num_params);
+ /// destructor
+ ~TAO_CEC_Operation_Params (void);
+
+private:
+ /// Only the TypedEventChannel can read the private fields.
+ friend class TAO_CEC_TypedEventChannel;
+
+ CORBA::ULong num_params_;
+ TAO_CEC_Param * parameters_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_TypedEventChannel.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_TYPEDEVENTCHANNEL_H_ */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEventChannel.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEventChannel.i
new file mode 100644
index 00000000000..ec52c543383
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedEventChannel.i
@@ -0,0 +1,205 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_CEC_TypedEventChannel_Attributes::
+TAO_CEC_TypedEventChannel_Attributes (PortableServer::POA_ptr s_poa,
+ PortableServer::POA_ptr c_poa,
+ CORBA::ORB_ptr _orb,
+ CORBA::Repository_ptr _interface_repository)
+ : consumer_reconnect (TAO_CEC_DEFAULT_CONSUMER_RECONNECT),
+ supplier_reconnect (TAO_CEC_DEFAULT_SUPPLIER_RECONNECT),
+ disconnect_callbacks (TAO_CEC_DEFAULT_DISCONNECT_CALLBACKS),
+ destroy_on_shutdown (0),
+ //busy_hwm (TAO_CEC_DEFAULT_BUSY_HWM),
+ //max_write_delay (TAO_CEC_DEFAULT_MAX_WRITE_DELAY),
+ typed_supplier_poa (s_poa),
+ typed_consumer_poa (c_poa),
+ orb (_orb),
+ interface_repository (_interface_repository)
+{
+}
+
+ACE_INLINE TAO_CEC_Dispatching*
+TAO_CEC_TypedEventChannel::dispatching (void) const
+{
+ return this->dispatching_;
+}
+
+ACE_INLINE TAO_CEC_TypedConsumerAdmin*
+TAO_CEC_TypedEventChannel::typed_consumer_admin (void) const
+{
+ return this->typed_consumer_admin_;
+}
+
+ACE_INLINE TAO_CEC_TypedSupplierAdmin*
+TAO_CEC_TypedEventChannel::typed_supplier_admin (void) const
+{
+ return this->typed_supplier_admin_;
+}
+
+ACE_INLINE TAO_CEC_ConsumerControl*
+TAO_CEC_TypedEventChannel::consumer_control (void) const
+{
+ return this->consumer_control_;
+}
+
+ACE_INLINE TAO_CEC_SupplierControl*
+TAO_CEC_TypedEventChannel::supplier_control (void) const
+{
+ return this->supplier_control_;
+}
+
+ACE_INLINE void
+TAO_CEC_TypedEventChannel::create_proxy (TAO_CEC_ProxyPushSupplier* &x)
+{
+ x = this->factory_->create_proxy_push_supplier (this);
+}
+
+ACE_INLINE void
+TAO_CEC_TypedEventChannel::destroy_proxy (TAO_CEC_ProxyPushSupplier* supplier)
+{
+ this->factory_->destroy_proxy_push_supplier (supplier);
+}
+
+ACE_INLINE void
+TAO_CEC_TypedEventChannel::create_proxy (TAO_CEC_TypedProxyPushConsumer* &x)
+{
+ x = this->factory_->create_proxy_push_consumer (this);
+}
+
+ACE_INLINE void
+TAO_CEC_TypedEventChannel::destroy_proxy (TAO_CEC_TypedProxyPushConsumer* consumer)
+{
+ this->factory_->destroy_proxy_push_consumer (consumer);
+}
+
+ACE_INLINE void
+TAO_CEC_TypedEventChannel::create_proxy_collection (TAO_CEC_ProxyPushSupplier_Collection* &x)
+{
+ x = this->factory_->create_proxy_push_supplier_collection (this);
+}
+
+ACE_INLINE void
+TAO_CEC_TypedEventChannel::destroy_proxy_collection (TAO_CEC_ProxyPushSupplier_Collection* x)
+{
+ this->factory_->destroy_proxy_push_supplier_collection (x);
+}
+
+ACE_INLINE void
+TAO_CEC_TypedEventChannel::create_proxy_collection (TAO_CEC_TypedProxyPushConsumer_Collection* &x)
+{
+ x = this->factory_->create_proxy_push_consumer_collection (this);
+}
+
+ACE_INLINE void
+TAO_CEC_TypedEventChannel::destroy_proxy_collection (TAO_CEC_TypedProxyPushConsumer_Collection* x)
+{
+ this->factory_->destroy_proxy_push_consumer_collection (x);
+}
+
+ACE_INLINE PortableServer::POA_ptr
+TAO_CEC_TypedEventChannel::typed_supplier_poa (void)
+{
+ return PortableServer::POA::_duplicate (this->typed_supplier_poa_.in ());
+}
+
+ACE_INLINE PortableServer::POA_ptr
+TAO_CEC_TypedEventChannel::typed_consumer_poa (void)
+{
+ return PortableServer::POA::_duplicate (this->typed_consumer_poa_.in ());
+}
+
+ACE_INLINE ACE_Lock*
+TAO_CEC_TypedEventChannel::create_consumer_lock (void)
+{
+ return this->factory_->create_consumer_lock ();
+}
+
+ACE_INLINE void
+TAO_CEC_TypedEventChannel::destroy_consumer_lock (ACE_Lock* x)
+{
+ this->factory_->destroy_consumer_lock (x);
+}
+
+ACE_INLINE ACE_Lock*
+TAO_CEC_TypedEventChannel::create_supplier_lock (void)
+{
+ return this->factory_->create_supplier_lock ();
+}
+
+ACE_INLINE void
+TAO_CEC_TypedEventChannel::destroy_supplier_lock (ACE_Lock* x)
+{
+ this->factory_->destroy_supplier_lock (x);
+}
+
+ACE_INLINE int
+TAO_CEC_TypedEventChannel::consumer_reconnect (void) const
+{
+ return this->consumer_reconnect_;
+}
+
+ACE_INLINE int
+TAO_CEC_TypedEventChannel::supplier_reconnect (void) const
+{
+ return this->supplier_reconnect_;
+}
+
+ACE_INLINE int
+TAO_CEC_TypedEventChannel::disconnect_callbacks (void) const
+{
+ return this->disconnect_callbacks_;
+}
+
+ACE_INLINE const char *
+TAO_CEC_TypedEventChannel::supported_interface (void) const
+{
+ return this->supported_interface_.c_str ();
+}
+
+ACE_INLINE CORBA::RepositoryId
+TAO_CEC_TypedEventChannel::base_interfaces (CORBA::ULong index) const
+{
+ return const_cast <CORBA::RepositoryId>(this->base_interfaces_[index]);
+}
+
+ACE_INLINE CORBA::ULong
+TAO_CEC_TypedEventChannel::number_of_base_interfaces (void) const
+{
+ return this->base_interfaces_.length ();
+}
+
+ACE_INLINE TAO_CEC_TypedEventChannel::ServantRetryMap&
+TAO_CEC_TypedEventChannel::get_servant_retry_map (void)
+{
+ return this->retry_map_;
+}
+
+ACE_INLINE
+TAO_CEC_Param::TAO_CEC_Param (void)
+{
+}
+
+ACE_INLINE
+TAO_CEC_Param::~TAO_CEC_Param (void)
+{
+}
+
+ACE_INLINE
+TAO_CEC_Operation_Params::TAO_CEC_Operation_Params (CORBA::ULong num_params)
+ : num_params_ (num_params)
+{
+ parameters_ = new TAO_CEC_Param[num_params];
+}
+
+ACE_INLINE
+TAO_CEC_Operation_Params::~TAO_CEC_Operation_Params (void)
+{
+ delete [] parameters_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.cpp
new file mode 100644
index 00000000000..cdb9787b230
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.cpp
@@ -0,0 +1,450 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.h"
+#include "orbsvcs/CosEvent/CEC_TypedEventChannel.h"
+#include "orbsvcs/CosEvent/CEC_TypedConsumerAdmin.h"
+#include "orbsvcs/CosEvent/CEC_DynamicImplementation.h"
+#include "tao/debug.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.i"
+#endif /* __ACE_INLINE__ */
+
+#include "ace/Reverse_Lock_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef ACE_Reverse_Lock<ACE_Lock> TAO_CEC_Unlock;
+
+// Implementation skeleton constructor
+TAO_CEC_TypedProxyPushConsumer::TAO_CEC_TypedProxyPushConsumer
+(TAO_CEC_TypedEventChannel* ec, const ACE_Time_Value &timeout)
+ : typed_event_channel_ (ec),
+ timeout_ (timeout),
+ refcount_ (1),
+ connected_ (0)
+{
+ this->lock_ =
+ this->typed_event_channel_->create_consumer_lock ();
+
+ this->default_POA_ =
+ this->typed_event_channel_->typed_consumer_poa ();
+
+ this->typed_event_channel_->get_servant_retry_map ().bind (this, 0);
+
+ // DSI initialization
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("***** Initializing the DSI for the new TypedProxyPushConsumer *****\n")));
+ }
+
+ this->dsi_impl_ = new
+ TAO_CEC_DynamicImplementationServer (this->default_POA_.in(),
+ this,
+ this->typed_event_channel_);
+
+ ACE_TRY_NEW_ENV {
+ // tempporary fix, should put this into some init function.
+
+ this->oid_ =
+ this->default_POA_->activate_object (this->dsi_impl_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL {
+ }
+ ACE_ENDTRY;
+}
+
+// Implementation skeleton destructor
+TAO_CEC_TypedProxyPushConsumer::~TAO_CEC_TypedProxyPushConsumer (void)
+{
+ ACE_TRY_NEW_ENV {
+ this->default_POA_->deactivate_object (this->oid_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL {
+ }
+ ACE_ENDTRY;
+
+ delete dsi_impl_;
+
+ this->typed_event_channel_->get_servant_retry_map ().unbind (this);
+ this->typed_event_channel_->destroy_consumer_lock (this->lock_);
+}
+
+void
+TAO_CEC_TypedProxyPushConsumer::activate (
+ CosTypedEventChannelAdmin::TypedProxyPushConsumer_ptr &activated_proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosTypedEventChannelAdmin::TypedProxyPushConsumer_var result;
+ ACE_TRY
+ {
+ result = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ result = CosTypedEventChannelAdmin::TypedProxyPushConsumer::_nil ();
+ }
+ ACE_ENDTRY;
+ activated_proxy = result._retn ();
+}
+
+void
+TAO_CEC_TypedProxyPushConsumer::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ PortableServer::POA_var poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Exceptions here should not be propagated. They usually
+ // indicate that an object is beign disconnected twice, or some
+ // race condition, but not a fault that the user needs to know
+ // about.
+ }
+ ACE_ENDTRY;
+}
+
+CORBA::Boolean
+TAO_CEC_TypedProxyPushConsumer::supplier_non_existent (
+ CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var supplier;
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ disconnected = 0;
+ if (this->is_connected_i () == 0)
+ {
+ disconnected = 1;
+ return 0;
+ }
+ if (CORBA::is_nil (this->nopolicy_typed_supplier_.in ()))
+ {
+ return 0;
+ }
+ supplier = CORBA::Object::_duplicate
+ (this->nopolicy_typed_supplier_.in ());
+ }
+
+#if (TAO_HAS_MINIMUM_CORBA == 0)
+ return supplier->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER);
+#else
+ return 0;
+#endif /* TAO_HAS_MINIMUM_CORBA */
+}
+
+void
+TAO_CEC_TypedProxyPushConsumer::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosEventComm::PushSupplier_var supplier;
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ supplier = this->typed_supplier_._retn ();
+ this->connected_ = 0;
+ }
+
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (supplier.in ()))
+ return;
+
+ ACE_TRY
+ {
+ supplier->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // failures on this one.
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_CEC_TypedProxyPushConsumer::cleanup_i (void)
+{
+ this->typed_supplier_ =
+ CosEventComm::PushSupplier::_nil ();
+ this->connected_ = 0;
+}
+
+CORBA::ULong
+TAO_CEC_TypedProxyPushConsumer::_incr_refcnt (void)
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ return this->refcount_++;
+}
+
+CORBA::ULong
+TAO_CEC_TypedProxyPushConsumer::_decr_refcnt (void)
+{
+ {
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ this->refcount_--;
+ if (this->refcount_ != 0)
+ return this->refcount_;
+ }
+
+ // Notify the event channel
+ this->typed_event_channel_->destroy_proxy (this);
+ return 0;
+}
+
+void
+TAO_CEC_TypedProxyPushConsumer::connect_push_supplier (
+ CosEventComm::PushSupplier_ptr push_supplier
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected))
+{
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i ())
+ {
+ if (this->typed_event_channel_->supplier_reconnect () == 0)
+ ACE_THROW (CosEventChannelAdmin::AlreadyConnected ());
+
+ // Re-connections are allowed, go ahead and disconnect the
+ // consumer...
+ this->cleanup_i ();
+
+ // @@ Please read the comments in CEC_ProxyPushSupplier about
+ // possible race conditions in this area...
+ TAO_CEC_Unlock reverse_lock (*this->lock_);
+
+ {
+ ACE_GUARD_THROW_EX (
+ TAO_CEC_Unlock, ace_mon, reverse_lock,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ this->typed_event_channel_->disconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // What if a second thread connected us after this?
+ if (this->is_connected_i ())
+ return;
+ }
+ this->typed_supplier_ = apply_policy (push_supplier);
+ this->connected_ = 1;
+ }
+
+ // Notify the event channel...
+ this->typed_event_channel_->connected (this ACE_ENV_ARG_PARAMETER);
+}
+
+CosEventComm::PushSupplier_ptr
+TAO_CEC_TypedProxyPushConsumer::apply_policy
+ (CosEventComm::PushSupplier_ptr pre)
+{
+ if (CORBA::is_nil(pre)) return pre;
+ this->nopolicy_typed_supplier_ =
+ CosEventComm::PushSupplier::_duplicate (pre);
+ CosEventComm::PushSupplier_var post =
+ CosEventComm::PushSupplier::_duplicate (pre);
+ if (this->timeout_ > ACE_Time_Value::zero)
+ {
+ CORBA::PolicyList policy_list;
+ policy_list.length (1);
+ policy_list[0] = this->typed_event_channel_->
+ create_roundtrip_timeout_policy (this->timeout_);
+
+ CORBA::Object_var post_obj = pre->_set_policy_overrides
+ (policy_list, CORBA::ADD_OVERRIDE);
+ post = CosEventComm::PushSupplier::_narrow(post_obj.in ());
+
+ policy_list[0]->destroy ();
+ policy_list.length (0);
+ }
+ return post._retn ();
+}
+
+void
+TAO_CEC_TypedProxyPushConsumer::push (const CORBA::Any& /* event */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+void
+TAO_CEC_TypedProxyPushConsumer::disconnect_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosEventComm::PushSupplier_var supplier;
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i () == 0)
+ ACE_THROW (CORBA::BAD_INV_ORDER ()); // @@ add user exception?
+
+ supplier = this->typed_supplier_._retn ();
+
+ this->cleanup_i ();
+ }
+
+ // Notify the event channel...
+ this->typed_event_channel_->disconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (!CORBA::is_nil (supplier.in ()))
+ {
+ if (this->typed_event_channel_->disconnect_callbacks ())
+ {
+ ACE_TRY
+ {
+ supplier->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // failures on this one.
+ }
+ ACE_ENDTRY;
+ }
+ }
+}
+
+PortableServer::POA_ptr
+TAO_CEC_TypedProxyPushConsumer::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+void
+TAO_CEC_TypedProxyPushConsumer::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_incr_refcnt ();
+}
+
+void
+TAO_CEC_TypedProxyPushConsumer::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_decr_refcnt ();
+}
+
+CORBA::Object_ptr
+TAO_CEC_TypedProxyPushConsumer::get_typed_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+
+{
+ CORBA::Object_var server =
+ default_POA_->id_to_reference (this->oid_.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ return CORBA::Object::_duplicate (server.in());
+}
+
+void
+TAO_CEC_TypedProxyPushConsumer::invoke (const TAO_CEC_TypedEvent& typed_event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_CEC_TypedProxyPushConsumer_Guard ace_mon (this->lock_,
+ this->refcount_,
+ this->typed_event_channel_,
+ this);
+ if (!ace_mon.locked ())
+ return;
+
+ this->typed_event_channel_->typed_consumer_admin ()->invoke (typed_event
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// ****************************************************************
+
+TAO_CEC_TypedProxyPushConsumer_Guard::
+ TAO_CEC_TypedProxyPushConsumer_Guard (ACE_Lock *lock,
+ CORBA::ULong &refcount,
+ TAO_CEC_TypedEventChannel *ec,
+ TAO_CEC_TypedProxyPushConsumer *proxy)
+ : lock_ (lock),
+ refcount_ (refcount),
+ typed_event_channel_ (ec),
+ proxy_ (proxy),
+ locked_ (0)
+{
+ ACE_Guard<ACE_Lock> ace_mon (*this->lock_);
+ // If the guard fails there is not much we can do, raising an
+ // exception is wrong, the client has *no* way to handle that kind
+ // of error. Even worse, there is no exception to raise in that
+ // case.
+ // @@ Returning something won't work either, the error should be
+ // logged though!
+
+ if (proxy->is_connected_i () == 0)
+ return;
+
+ this->locked_ = 1;
+ this->refcount_++;
+}
+
+TAO_CEC_TypedProxyPushConsumer_Guard::
+ ~TAO_CEC_TypedProxyPushConsumer_Guard (void)
+{
+ // This access is safe because guard objects are created on the
+ // stack, only one thread has access to them
+ if (!this->locked_)
+ return;
+
+ {
+ ACE_Guard<ACE_Lock> ace_mon (*this->lock_);
+ // If the guard fails there is not much we can do, raising an
+ // exception is wrong, the client has *no* way to handle that kind
+ // of error. Even worse, there is no exception to raise in that
+ // case.
+ // @@ Returning something won't work either, the error should be
+ // logged though!
+
+ this->refcount_--;
+ if (this->refcount_ != 0)
+ return;
+ }
+ this->typed_event_channel_->destroy_proxy (this->proxy_);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.h
new file mode 100644
index 00000000000..9595edd9420
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.h
@@ -0,0 +1,210 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_TypedProxyPushConsumer.h
+ *
+ * $Id$
+ *
+ * @author Jon Astle (jon@astle45.fsnet.co.uk)
+ *
+ * Based on the untyped version by Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_TYPEDPROXYPUSHCONSUMER_H_
+#define TAO_CEC_TYPEDPROXYPUSHCONSUMER_H_
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosTypedEventChannelAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+#include "orbsvcs/CosEvent/event_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_TypedEvent;
+class TAO_CEC_TypedEventChannel;
+class TAO_CEC_DynamicImplementationServer;
+
+//Class TAO_CEC_TypedProxyPushConsumer
+class TAO_Event_Serv_Export TAO_CEC_TypedProxyPushConsumer
+ : public virtual POA_CosTypedEventChannelAdmin::TypedProxyPushConsumer
+{
+public:
+ typedef CosTypedEventChannelAdmin::TypedProxyPushConsumer_ptr _ptr_type;
+ typedef CosTypedEventChannelAdmin::TypedProxyPushConsumer_var _var_type;
+
+ //Constructor
+ TAO_CEC_TypedProxyPushConsumer (
+ TAO_CEC_TypedEventChannel* typed_event_channel,
+ const ACE_Time_Value &timeout
+ );
+
+ //Destructor
+ virtual ~TAO_CEC_TypedProxyPushConsumer (void);
+
+ /// Activate in the POA
+ virtual void activate (
+ CosTypedEventChannelAdmin::TypedProxyPushConsumer_ptr &activated_proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Deactivate from the POA
+ virtual void deactivate (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * Invoke the _non_existent() pseudo-operation on the supplier. If
+ * it is disconnected then it returns true and sets the
+ * <disconnected> flag.
+ */
+ CORBA::Boolean supplier_non_existent (CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL);
+
+ /// The event channel is shutting down
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+ /// Increment and decrement the reference count.
+ CORBA::ULong _incr_refcnt (void);
+ CORBA::ULong _decr_refcnt (void);
+
+ // = The CosEventChannelAdmin::ProxyPushConsumer methods (abstract overloads)...
+ virtual void connect_push_supplier (
+ CosEventComm::PushSupplier_ptr push_supplier
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected));
+
+ virtual void push (const CORBA::Any& event
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void invoke (const TAO_CEC_TypedEvent& typed_event
+ 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 CosTypedEventComm::TypedPushConsumer methods (abstract overloads)...
+ virtual CORBA::Object_ptr get_typed_consumer (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // = The Servant methods
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+protected:
+ // The guard needs access to the following protected methods.
+ friend class TAO_CEC_TypedProxyPushConsumer_Guard;
+
+ /// The private version (without locking) of is_connected().
+ CORBA::Boolean is_connected_i (void) const;
+
+ /// Release the supplier
+ void cleanup_i (void);
+
+ /// Assigns the parameter to both supplier_ and nopolicy_supplier_, and
+ /// applies policies (when appropriate) to supplier_.
+ CosEventComm::PushSupplier_ptr apply_policy
+ (CosEventComm::PushSupplier_ptr pre);
+
+private:
+ /// The typed supplier admin, used for activation and memory managment.
+ TAO_CEC_TypedEventChannel* typed_event_channel_;
+
+ ACE_Time_Value timeout_;
+
+ /// The locking strategy.
+ ACE_Lock* lock_;
+
+ /// The reference count.
+ CORBA::ULong refcount_;
+
+ /// The typed supplier -- use apply_policy() instead of assigning directly to
+ /// typed_supplier_. This will keep typed_supplier_ and
+ /// nopolicy_typed_supplier_ in sync.
+ CosEventComm::PushSupplier_var typed_supplier_;
+
+ /// The typed supplier without any policies applied
+ CosEventComm::PushSupplier_var nopolicy_typed_supplier_;
+
+ /// The DSI impl
+ TAO_CEC_DynamicImplementationServer* dsi_impl_;
+
+ /// The DSI Portable Server OID
+ PortableServer::ObjectId_var oid_;
+
+ /// If the flag is not zero then we are connected, notice that the
+ /// supplier can be nil.
+ int connected_;
+
+ /// Store the default POA.
+ PortableServer::POA_var default_POA_;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_CEC_TypedProxyPushConsumer_Guard
+ *
+ * @brief A Guard for the TypedProxyPushConsumer reference count
+ *
+ * This is a helper class used in the implementation of
+ * TypedProxyPushConumer. It provides a Guard mechanism to increment
+ * the reference count on the proxy, eliminating the need to hold
+ * mutexes during long operations.
+ */
+class TAO_Event_Serv_Export TAO_CEC_TypedProxyPushConsumer_Guard
+{
+public:
+ /// Constructor
+ TAO_CEC_TypedProxyPushConsumer_Guard (
+ ACE_Lock *lock,
+ CORBA::ULong &refcount,
+ TAO_CEC_TypedEventChannel *ec,
+ TAO_CEC_TypedProxyPushConsumer *proxy
+ );
+
+ /// Destructor
+ ~TAO_CEC_TypedProxyPushConsumer_Guard (void);
+
+ /// Returns 1 if the reference count successfully acquired
+ int locked (void) const;
+
+private:
+ /// The lock used to protect the reference count
+ ACE_Lock *lock_;
+
+ /// The reference count
+ CORBA::ULong &refcount_;
+
+ /// The event channel used to destroy the proxy
+ TAO_CEC_TypedEventChannel *typed_event_channel_;
+
+ /// The proxy whose lifetime is controlled by the reference count
+ TAO_CEC_TypedProxyPushConsumer *proxy_;
+
+ /// This flag is set to 1 if the reference count was successfully
+ /// acquired.
+ int locked_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_TYPEDPROXYPUSHCONSUMER_H_ */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.i
new file mode 100644
index 00000000000..86eee941060
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.i
@@ -0,0 +1,21 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE CORBA::Boolean
+TAO_CEC_TypedProxyPushConsumer::is_connected_i (void) const
+{
+ return this->connected_;
+}
+
+// ****************************************************************
+
+ACE_INLINE int
+TAO_CEC_TypedProxyPushConsumer_Guard::locked (void) const
+{
+ return this->locked_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedSupplierAdmin.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedSupplierAdmin.cpp
new file mode 100644
index 00000000000..a156440cc16
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedSupplierAdmin.cpp
@@ -0,0 +1,111 @@
+// $Id$
+
+#include "orbsvcs/CosEvent/CEC_TypedSupplierAdmin.h"
+
+#include "orbsvcs/CosEvent/CEC_TypedEventChannel.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_TypedSupplierAdmin.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Implementation skeleton constructor
+TAO_CEC_TypedSupplierAdmin::TAO_CEC_TypedSupplierAdmin (TAO_CEC_TypedEventChannel *ec)
+ : typed_event_channel_ (ec),
+ typed_push_admin_ (ec)
+{
+ this->default_POA_ =
+ this->typed_event_channel_->typed_supplier_poa ();
+}
+
+// Implementation skeleton destructor
+TAO_CEC_TypedSupplierAdmin::~TAO_CEC_TypedSupplierAdmin (void)
+{
+}
+
+PortableServer::POA_ptr
+TAO_CEC_TypedSupplierAdmin::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+void
+TAO_CEC_TypedSupplierAdmin::connected (TAO_CEC_TypedProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->typed_push_admin_.connected (consumer ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_TypedSupplierAdmin::reconnected (TAO_CEC_TypedProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->typed_push_admin_.reconnected (consumer ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_TypedSupplierAdmin::disconnected (TAO_CEC_TypedProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->typed_push_admin_.disconnected (consumer ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CEC_TypedSupplierAdmin::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->typed_push_admin_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CosTypedEventChannelAdmin::TypedProxyPushConsumer_ptr
+TAO_CEC_TypedSupplierAdmin::obtain_typed_push_consumer (
+ const char * supported_interface
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosTypedEventChannelAdmin::InterfaceNotSupported
+ ))
+
+{
+ int result = this->typed_event_channel_->supplier_register_supported_interface (supported_interface ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (result == -1)
+ {
+ ACE_THROW_RETURN (CosTypedEventChannelAdmin::InterfaceNotSupported (),0);
+ }
+
+ return this->typed_push_admin_.obtain (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosEventChannelAdmin::ProxyPullConsumer_ptr
+TAO_CEC_TypedSupplierAdmin::obtain_typed_pull_consumer (
+ const char * /* uses_interface */
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosTypedEventChannelAdmin::NoSuchImplementation
+ ))
+
+{
+ ACE_THROW_RETURN (CosTypedEventChannelAdmin::NoSuchImplementation (), 0);
+}
+
+CosEventChannelAdmin::ProxyPushConsumer_ptr
+TAO_CEC_TypedSupplierAdmin::obtain_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+CosEventChannelAdmin::ProxyPullConsumer_ptr
+TAO_CEC_TypedSupplierAdmin::obtain_pull_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedSupplierAdmin.h b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedSupplierAdmin.h
new file mode 100644
index 00000000000..eaa3747387f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedSupplierAdmin.h
@@ -0,0 +1,109 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CEC_TypedSupplierAdmin.h
+ *
+ * $Id$
+ *
+ * @author Jon Astle (jon@astle45.fsnet.co.uk)
+ *
+ * Based on the untyped version by Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef TAO_CEC_TYPEDSUPPLIERADMIN_H_
+#define TAO_CEC_TYPEDSUPPLIERADMIN_H_
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosTypedEventChannelAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Proxy_Admin.h"
+
+#include "orbsvcs/CosEvent/CEC_TypedProxyPushConsumer.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CEC_TypedEventChannel;
+
+//Class TAO_CEC_TypedSupplierAdmin
+class TAO_Event_Serv_Export TAO_CEC_TypedSupplierAdmin
+ : public POA_CosTypedEventChannelAdmin::TypedSupplierAdmin
+{
+public:
+ //Constructor
+ TAO_CEC_TypedSupplierAdmin (TAO_CEC_TypedEventChannel* event_channel);
+
+ //Destructor
+ virtual ~TAO_CEC_TypedSupplierAdmin (void);
+
+ /// For each elements call <worker->work()>.
+ void for_each (TAO_ESF_Worker<TAO_CEC_TypedProxyPushConsumer> *worker
+ ACE_ENV_ARG_DECL);
+
+ /// Keep track of connected consumers.
+ virtual void connected (TAO_CEC_TypedProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void reconnected (TAO_CEC_TypedProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_CEC_TypedProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// The typed event channel is shutting down, inform all the consumers of
+ /// this
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+ // = The CosTypedEventChannelAdmin::TypedSupplierAdmin methods...
+ virtual CosTypedEventChannelAdmin::TypedProxyPushConsumer_ptr
+ obtain_typed_push_consumer (const char * supported_interface
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTypedEventChannelAdmin::InterfaceNotSupported));
+
+ virtual CosEventChannelAdmin::ProxyPullConsumer_ptr
+ obtain_typed_pull_consumer (const char * uses_interface
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTypedEventChannelAdmin::NoSuchImplementation));
+
+ // = The CosEventChannelAdmin::SupplierAdmin methods...
+ virtual CosEventChannelAdmin::ProxyPushConsumer_ptr
+ obtain_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosEventChannelAdmin::ProxyPullConsumer_ptr
+ obtain_pull_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // = The PortableServer::ServantBase methods
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// The Event Channel we belong to
+ TAO_CEC_TypedEventChannel *typed_event_channel_;
+
+ /// Store the default POA.
+ PortableServer::POA_var default_POA_;
+
+ /// The push and pull aspects are implemented using these classes
+ TAO_ESF_Proxy_Admin<TAO_CEC_TypedEventChannel,
+ TAO_CEC_TypedProxyPushConsumer,
+ CosTypedEventChannelAdmin::TypedProxyPushConsumer>
+ typed_push_admin_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/CosEvent/CEC_TypedSupplierAdmin.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CEC_TYPEDSUPPLIERADMIN_H_ */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedSupplierAdmin.i b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedSupplierAdmin.i
new file mode 100644
index 00000000000..4a3111bc176
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/CEC_TypedSupplierAdmin.i
@@ -0,0 +1,15 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE void
+TAO_CEC_TypedSupplierAdmin::
+ for_each (TAO_ESF_Worker<TAO_CEC_TypedProxyPushConsumer> *worker
+ ACE_ENV_ARG_DECL)
+{
+ this->typed_push_admin_.for_each (worker ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/event_export.h b/TAO/orbsvcs/orbsvcs/CosEvent/event_export.h
new file mode 100644
index 00000000000..5d16512df9b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/event_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_EVENT_EXPORT_H
+#define TAO_EVENT_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_EVENT_HAS_DLL)
+# define TAO_EVENT_HAS_DLL 0
+# endif /* ! TAO_EVENT_HAS_DLL */
+#else
+# if !defined (TAO_EVENT_HAS_DLL)
+# define TAO_EVENT_HAS_DLL 1
+# endif /* ! TAO_EVENT_HAS_DLL */
+#endif
+
+#if defined (TAO_EVENT_HAS_DLL) && (TAO_EVENT_HAS_DLL == 1)
+# if defined (TAO_EVENT_BUILD_DLL)
+# define TAO_Event_Export ACE_Proper_Export_Flag
+# define TAO_EVENT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_EVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_EVENT_BUILD_DLL */
+# define TAO_Event_Export ACE_Proper_Import_Flag
+# define TAO_EVENT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_EVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_EVENT_BUILD_DLL */
+#else /* TAO_EVENT_HAS_DLL == 1 */
+# define TAO_Event_Export
+# define TAO_EVENT_SINGLETON_DECLARATION(T)
+# define TAO_EVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_EVENT_HAS_DLL == 1 */
+
+#endif /* TAO_EVENT_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/event_serv_export.h b/TAO/orbsvcs/orbsvcs/CosEvent/event_serv_export.h
new file mode 100644
index 00000000000..3bc4d00b86a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/event_serv_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_EVENT_SERV_EXPORT_H
+#define TAO_EVENT_SERV_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_EVENT_SERV_HAS_DLL)
+# define TAO_EVENT_SERV_HAS_DLL 0
+# endif /* ! TAO_EVENT_SERV_HAS_DLL */
+#else
+# if !defined (TAO_EVENT_SERV_HAS_DLL)
+# define TAO_EVENT_SERV_HAS_DLL 1
+# endif /* ! TAO_EVENT_SERV_HAS_DLL */
+#endif
+
+#if defined (TAO_EVENT_SERV_HAS_DLL) && (TAO_EVENT_SERV_HAS_DLL == 1)
+# if defined (TAO_EVENT_SERV_BUILD_DLL)
+# define TAO_Event_Serv_Export ACE_Proper_Export_Flag
+# define TAO_EVENT_SERV_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_EVENT_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_EVENT_SERV_BUILD_DLL */
+# define TAO_Event_Serv_Export ACE_Proper_Import_Flag
+# define TAO_EVENT_SERV_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_EVENT_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_EVENT_SERV_BUILD_DLL */
+#else /* TAO_EVENT_SERV_HAS_DLL == 1 */
+# define TAO_Event_Serv_Export
+# define TAO_EVENT_SERV_SINGLETON_DECLARATION(T)
+# define TAO_EVENT_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_EVENT_SERV_HAS_DLL == 1 */
+
+#endif /* TAO_EVENT_SERV_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/event_skel_export.h b/TAO/orbsvcs/orbsvcs/CosEvent/event_skel_export.h
new file mode 100644
index 00000000000..f5194fa05a9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent/event_skel_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_EVENT_SKEL_EXPORT_H
+#define TAO_EVENT_SKEL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_EVENT_SKEL_HAS_DLL)
+# define TAO_EVENT_SKEL_HAS_DLL 0
+# endif /* ! TAO_EVENT_SKEL_HAS_DLL */
+#else
+# if !defined (TAO_EVENT_SKEL_HAS_DLL)
+# define TAO_EVENT_SKEL_HAS_DLL 1
+# endif /* ! TAO_EVENT_SKEL_HAS_DLL */
+#endif
+
+#if defined (TAO_EVENT_SKEL_HAS_DLL) && (TAO_EVENT_SKEL_HAS_DLL == 1)
+# if defined (TAO_EVENT_SKEL_BUILD_DLL)
+# define TAO_Event_Skel_Export ACE_Proper_Export_Flag
+# define TAO_EVENT_SKEL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_EVENT_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_EVENT_SKEL_BUILD_DLL */
+# define TAO_Event_Skel_Export ACE_Proper_Import_Flag
+# define TAO_EVENT_SKEL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_EVENT_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_EVENT_SKEL_BUILD_DLL */
+#else /* TAO_EVENT_SKEL_HAS_DLL == 1 */
+# define TAO_Event_Skel_Export
+# define TAO_EVENT_SKEL_SINGLETON_DECLARATION(T)
+# define TAO_EVENT_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_EVENT_SKEL_HAS_DLL == 1 */
+
+#endif /* TAO_EVENT_SKEL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/CosEventChannelAdmin.idl b/TAO/orbsvcs/orbsvcs/CosEventChannelAdmin.idl
new file mode 100644
index 00000000000..88492c0996d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEventChannelAdmin.idl
@@ -0,0 +1,246 @@
+/**
+ * @file CosEventChannelAdmin.idl
+ *
+ * @brief Define the CosEventChannelAdmin module
+ *
+ * $Id$
+ *
+ * Described in CORBAservices: Common Object Services Specification,
+ * chapter 4.
+ *
+ * CosEventChannelAdmin Module, page 4-15 includes the following
+ * interfaces: ProxyPushConsumer, ProxyPullSupplier,
+ * ProxyPullConsumer, ProxyPushSupplier, ConsumerAdmin, SupplierAdmin,
+ * EventChannel
+ *
+ * The Event Service IDL can be downloaded from
+ * ftp://www.omg.org/pub/docs/formal/97-11-02.idl
+ *
+ * The complete specification is available from:
+ * http://www.omg.org/technology/documents/formal/event_service.htm
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ */
+#ifndef TAO_EVENTCHANNELADMIN_IDL
+#define TAO_EVENTCHANNELADMIN_IDL
+
+#include "CosEventComm.idl"
+
+#pragma prefix "omg.org"
+
+/**
+ * @namespace CosEventChannelAdmin
+ *
+ * @brief Define the interfaces implemented by providers of the CORBA
+ * Event Service.
+ */
+module CosEventChannelAdmin
+{
+ /**
+ * @exception AlreadyConnected
+ *
+ * @brief Exception raised if the user tries to connect to an
+ * already connected proxy
+ */
+ exception AlreadyConnected {};
+
+ /**
+ * @exception TypeError
+ *
+ * @brief Exception raised in Typed Event Services if there is a
+ * mismatch between the proxy and its peer (supplier or consumer.)
+ */
+ exception TypeError {};
+
+ /**
+ * @interface ProxyPushConsumer
+ *
+ * @brief Interface used by push-style suppliers.
+ *
+ * The application can use the methods derived from
+ * CosEventComm::PushConsumer to disconnect from the Event Service
+ * and push events.
+ */
+ interface ProxyPushConsumer : CosEventComm::PushConsumer
+ {
+ /// Connect a push-style supplier to the Event Service
+ /**
+ * Before pushing events into its Proxy the application must call
+ * the following operation.
+ *
+ * @param push_supplier Callback interface, invoked by the Event
+ * Service if it is destroyed while the push-style supplier
+ * is still connected. If the argument is nil the callback
+ * is not invoked.
+ * @throws AlreadyConnected if the operation is called a second
+ * time.
+ */
+ void connect_push_supplier (in CosEventComm::PushSupplier push_supplier)
+ raises (AlreadyConnected);
+ };
+
+ /**
+ * @interface ProxyPushSupplier
+ *
+ * @brief Interface used by push-style consumers
+ *
+ * Push-style consumers used this interface to connect and
+ * disconnect from the Event Service.
+ *
+ * The disconnect_push_supplier() operation, derived from the
+ * CosEventEventComm::PushSupplier interface, is used to disconnect
+ * the ProxyPushSupplier and reclaim all resources attached to it
+ * from the Event Service.
+ */
+ interface ProxyPushSupplier : CosEventComm::PushSupplier
+ {
+ /// Connect a push-style consumer to the Event Service.
+ /**
+ * The following operation must be invoked before the Event
+ * Service can deliver any events to the consumer.
+ *
+ * @param push_consumer The consumer, must be non-nil.
+ * @throws CORBA::BAD_PARAM if the consumer argument is nil.
+ * @throws AlreadyConnected if the operation is called a second
+ * time.
+ * @throws TypeError In Typed Event Services if the consumer does
+ * not match the expected type.
+ */
+ void connect_push_consumer (in CosEventComm::PushConsumer push_consumer)
+ raises (AlreadyConnected, TypeError);
+ };
+
+ /**
+ * @interface ProxyPullSupplier
+ *
+ * @brief Interface used by pull-style consumers.
+ *
+ * Pull-style suppliers use this interface to connect and disconnect
+ * from the Event Service.
+ *
+ * The disconnect_pull_supplier() operation, derived from
+ * CosEventComm::PullSupplier, is used by the application to
+ * disconnect from the Event Service.
+ * The application can use the pull() and try_pull() operations to
+ * pull data from the Event Service.
+ */
+ interface ProxyPullSupplier : CosEventComm::PullSupplier
+ {
+ /// Connect a pull consumer to the Event Service.
+ /**
+ * Applications cannot pull events before this operation is
+ * invoked.
+ *
+ * @param pull_consumer Callback interface used to inform the
+ * the application when the Event Service is destroyed. The
+ * argument can be nil.
+ * @throws AlreadyConnected if the operation is called a second
+ * time.
+ */
+ void connect_pull_consumer (in CosEventComm::PullConsumer pull_consumer)
+ raises (AlreadyConnected);
+ };
+
+ /**
+ * @interface ProxyPullConsumer
+ *
+ * @brief Interface used by pull-style suppliers.
+ *
+ * Pull-style consumers use this interface to connect, disconnect
+ * and pull events from the Event Service.
+ *
+ * The disconnect_pull_consumer() operation, derived from
+ * CosEventEventComm::PullConsumer, is used to disconnect from the
+ * Event Service.
+ */
+ interface ProxyPullConsumer : CosEventComm::PullConsumer
+ {
+ /// Connect a pull supplier to the Event Service.
+ /**
+ * The Event Service will not start pulling events until this
+ * operation is invoked.
+ *
+ * @param pull_supplier Callback interface used to (1) inform the
+ * application when the Event Service is destroyed, and (2) pull
+ * events from the application. The argument cannot be nil.
+ * @throws CORBA::BAD_PARAM if the pull_supplier argument is nil.
+ * @throws AlreadyConnected if the operation is called a second
+ * time.
+ * @throws TypeError In Typed Event Services if the consumer does
+ * not match the expected type.
+ */
+ void connect_pull_supplier (in CosEventComm::PullSupplier pull_supplier)
+ raises (AlreadyConnected, TypeError);
+ };
+
+ /**
+ * @interface ConsumerAdmin
+ *
+ * @brief Abstract Factory used to create proxies for pull-style and
+ * push-style consumers.
+ */
+ interface ConsumerAdmin
+ {
+ /// Create a new ProxyPushSupplier object.
+ ProxyPushSupplier obtain_push_supplier ();
+
+ /// Create a new ProxyPullSupplier object.
+ ProxyPullSupplier obtain_pull_supplier ();
+ };
+
+ /**
+ * @interface SupplierAdmin
+ *
+ * @brief Abstract Factory used to create proxies for pull-style and
+ * push-style suppliers.
+ */
+ interface SupplierAdmin
+ {
+ /// Create a new ProxyPushConsumer object.
+ ProxyPushConsumer obtain_push_consumer ();
+
+ /// Create a new ProxyPullConsumer object.
+ ProxyPullConsumer obtain_pull_consumer ();
+ };
+
+ /**
+ * @interface EventChannel
+ *
+ * @brief Main interface for the Event Service.
+ */
+ interface EventChannel
+ {
+ /// Obtain a ConsumerAdmin interface for this EventChannel
+ /**
+ * Normally a single EventChannel provides a single ConsumerAdmin,
+ * but advanced ECs, for example, those based in the
+ * CosNotification service, can provide multiple ConsumerAdmin
+ * interfaces.
+ */
+ ConsumerAdmin for_consumers ();
+
+ /// Obtain a SupplierAdmin interface for this EventChannel
+ /**
+ * Normally a single EventChannel provides a single SupplierAdmin,
+ * but advanced ECs, for example, those based in the
+ * CosNotification service, can provide multiple SupplierAdmin
+ * interfaces.
+ */
+ SupplierAdmin for_suppliers ();
+
+ /// Destroy the EventChannel
+ /**
+ * Calling this operation destroys the EventChannel, its
+ * ConsumerAdmin and SupplierAdmin interfaces as well as the
+ * proxies obtained from those.
+ * Any consumers or suppliers still connected are notified of the
+ * destruction. In some cases, the process running the
+ * EventChannel is terminated too.
+ */
+ void destroy ();
+ };
+};
+
+#pragma prefix ""
+
+#endif /* TAO_EVENTCHANNELADMIN_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/CosEventComm.idl b/TAO/orbsvcs/orbsvcs/CosEventComm.idl
new file mode 100644
index 00000000000..e97413fa618
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEventComm.idl
@@ -0,0 +1,177 @@
+/**
+ * @file CosEventComm.idl
+ *
+ * @brief Define the CosEventComm module
+ *
+ * $Id$
+ *
+ * Described in CORBAservices: Common Object Services Specification,
+ * chapter 4.
+ *
+ * CosEventComm Module, page 4-8 includes the following interfaces:
+ * PushConsumer, PushSupplier, PullSupplier, PullConsumer
+ *
+ * The Event service IDL can be downloaded from
+ * ftp://www.omg.org/pub/docs/formal/97-11-02.idl
+ *
+ * The complete specification is available from:
+ * http://www.omg.org/technology/documents/formal/event_service.htm
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ */
+
+#ifndef TAO_EVENTCOMM_IDL
+#define TAO_EVENTCOMM_IDL
+
+#pragma prefix "omg.org"
+
+/**
+ * @namespace CosEventComm
+ *
+ * @brief Define the interfaces implemented by users of the CORBA
+ * Event Service.
+ */
+module CosEventComm
+{
+ /**
+ * @exception Disconnected
+ *
+ * @brief Exception raised when a client tries to communicate with
+ * the Event Service after it has disconnected.
+ *
+ * The exception is raised if:
+ *
+ * - If supplier tries to push an event before fully connecting to
+ * the EC.
+ * - A consumer tries to pull an event before fully connecting to
+ * the EC.
+ */
+ exception Disconnected {};
+
+ /**
+ * @interface PushConsumer
+ *
+ * @brief Define the interface implemented by push-style consumers
+ *
+ * A push-style consumer passively receives events from the Event
+ * Service. Applications simply implement this interface, connect
+ * to the Event Service and receive events.
+ */
+ interface PushConsumer
+ {
+ /// Receive one event from the Consumer's peer.
+ /**
+ * A supplier communicates event data to the consumer by
+ * invoking the push operation.
+ * @param data The event
+ * @throws CosEventComm::Disconnected if the object considers
+ * itself no longer connected to its peer.
+ */
+ void push (in any data) raises (Disconnected);
+
+ /// The peer has disconnected from the PushConsumer.
+ /**
+ * The disconnect_push_consumer operation indicates that the peer
+ * has disconnected, for example, because it has been destroyed.
+ * The application can safely release all resources attached to
+ * this consumer and destroy it, no further push() calls should be
+ * expected.
+ */
+ void disconnect_push_consumer ();
+ };
+
+ /**
+ * @interface PushSupplier
+ *
+ * @brief Define the interface implemented by push-style suppliers.
+ *
+ * A push-style supplier actively pushes events into the Event
+ * Service
+ */
+ interface PushSupplier
+ {
+ /// The peer has disconnected from the push-style supplier
+ /**
+ * The disconnect_push_supplier operation indicates that the peer
+ * has disconnected, for example, because it has been destroyed.
+ * The application can safe release all resource attached to this
+ * supplier and destroy it, further attempts to push events into
+ * its peer will fail.
+ */
+ void disconnect_push_supplier ();
+ };
+
+ /**
+ * @interface PullConsumer
+ *
+ * @brief Define the interface implemented by pull-style consumers
+ *
+ * A pull-style consumer actively queries the Event Channel for
+ * events.
+ */
+ interface PullConsumer
+ {
+ /// The peer has disconnected from the pull-style consumer.
+ /**
+ * The disconnect_pull_consumer operation indicates that the peer
+ * has disconnected, for example, because it has been destroyed.
+ * The application can safely release all resources attached to
+ * this consumer and destroy it, any attemps to pull more data
+ * should fail.
+ */
+ void disconnect_pull_consumer ();
+ };
+
+ /**
+ * @interface PullSupplier
+ *
+ * @brief Define the interface implemented by pull-style suppliers.
+ *
+ * A pull-style supplier passively generates events for the Event
+ * Service
+ */
+ interface PullSupplier
+ {
+ /// Pull (blocking) one event from the supplier.
+ /**
+ * The pull operation should block until the next event becomes
+ * available.
+ * @return The next event
+ * @throws CosEventComm::Disconnected if the object considers
+ * itself no longer connected to its peer.
+ */
+ any pull () raises (Disconnected);
+
+ /// Pull (non-blocking) one event from the supplier.
+ /**
+ * The try_pull operation does not block: if the event data is
+ * available, it returns the event data and sets the has_event
+ * parameter to true; if the event is not available, it sets the
+ * has_event parameter to false and the event data is returned
+ * as long with an undefined value.
+ *
+ * @param has_event Set to TRUE if there was another event
+ * available, FALSE otherwise.
+ * @return The next event if one was available, an any containing
+ * a 'long' with an undefined value otherwise.
+ * @throws CosEventComm::Disconnected if the object considers
+ * itself no longer connected to its peer.
+ */
+ any try_pull (out boolean has_event) raises (Disconnected);
+
+ /// The peer has disconnected from the pull-style supplier.
+ /**
+ * The disconnect_pull_supplier operation indicates that the peer
+ * has disconnected, for example, because it has been destroyed.
+ * The application can safe release all resource attached to this
+ * supplier and destroy it, the peer should not make any attempts
+ * to pull more data after this request.
+ */
+ void disconnect_pull_supplier ();
+ };
+
+};
+
+#pragma prefix ""
+
+#endif /* TAO_EVENTCOMM_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent_Serv.rc b/TAO/orbsvcs/orbsvcs/CosEvent_Serv.rc
new file mode 100644
index 00000000000..3acf53a2b6a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent_Serv.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosEvent_Serv\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosEvent_ServDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosEvent_Serv.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent_Skel.rc b/TAO/orbsvcs/orbsvcs/CosEvent_Skel.rc
new file mode 100644
index 00000000000..96c8513c4d2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosEvent_Skel.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosEvent_Skel\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosEvent_SkelDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosEvent_Skel.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosLifeCycle.idl b/TAO/orbsvcs/orbsvcs/CosLifeCycle.idl
new file mode 100644
index 00000000000..33b6bdbffed
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosLifeCycle.idl
@@ -0,0 +1,127 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// CosLifeCycle.idl
+//
+// = DESCRIPTION
+// Described in CORBAservices: Common Object Services Specification,
+// chapter 6.
+// The life cycle service description can be downloaded from:
+// ftp://www.omg.org/pub/docs/formal/97-12-13.pdf
+// The original IDL file can be downloaded from:
+// ftp://www.omg.org/pub/docs/formal/97-11-02.idl
+//
+// = AUTHOR
+// OMG, Torben Worm <tworm@cs.wustl.edu>, and Michael Kircher <mk1@cec.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_LIFECYCLE_IDL
+#define TAO_LIFECYCLE_IDL
+
+// OMG IDL for CosLifeCycle Module, page 6-10 in
+// Includes the following interfaces:
+// FactoryFinder, LifeCycleObject, GenericFactory
+
+#include "CosNaming.idl"
+
+#pragma prefix "omg.org"
+
+module CosLifeCycle
+{
+ // = TITLE
+ // CosLifeCycle
+ //
+ // = DESCRIPTION
+ // This idl file describes the life cycle service.
+ // The purpose of the life cycle service is to
+
+ typedef CosNaming::Name Key;
+ typedef Object _Factory;
+ typedef sequence <_Factory> Factories;
+
+ struct NameValuePair
+ {
+ CosNaming::Istring name;
+ any value;
+ };
+
+ typedef sequence <NameValuePair> Criteria;
+
+ exception NoFactory
+ {
+ Key search_key;
+ };
+ exception NotCopyable { string reason; };
+ exception NotMovable { string reason; };
+ exception NotRemovable { string reason; };
+ exception InvalidCriteria
+ {
+ Criteria invalid_criteria;
+ };
+ exception CannotMeetCriteria
+ {
+ Criteria unmet_criteria;
+ };
+
+ interface FactoryFinder
+ {
+ // = TITLE
+ // @@ Please fill in.
+ // = DESCRIPTION
+ // @@ Please fill in.
+
+ Factories find_factories (in Key factory_key)
+ raises (NoFactory);
+ };
+
+ interface LifeCycleObject
+ {
+ // = TITLE
+ // @@ Please fill in.
+ // = DESCRIPTION
+ // @@ Please fill in.
+
+ LifeCycleObject copy (in FactoryFinder there,
+ in Criteria the_criteria)
+ raises (NoFactory, NotCopyable, InvalidCriteria, CannotMeetCriteria);
+ void move (in FactoryFinder there,
+ in Criteria the_criteria)
+ raises (NoFactory, NotMovable, InvalidCriteria, CannotMeetCriteria);
+ void remove ()
+ raises (NotRemovable);
+ };
+
+ interface GenericFactory
+ {
+ // = TITLE
+ // @@ Please fill in.
+ // = DESCRIPTION
+ // @@ Please fill in.
+
+ boolean _supports (in Key k);
+ Object create_object (in Key k,
+ in Criteria the_criteria)
+ raises (NoFactory, InvalidCriteria, CannotMeetCriteria);
+ };
+};
+
+// Criteria, page 6-17:
+/*
+typedef struct NVP
+{
+ CosNaming::Istring name;
+ any value;
+} NameValuePair;
+
+typedef sequence <NameValuePair> Criteria;
+*/
+
+#endif /* TAO_LIFECYCLE_IDL */
+
diff --git a/TAO/orbsvcs/orbsvcs/CosLifeCycle.mpc b/TAO/orbsvcs/orbsvcs/CosLifeCycle.mpc
new file mode 100644
index 00000000000..e6ceedced03
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosLifeCycle.mpc
@@ -0,0 +1,32 @@
+// -*- MPC -*-
+// $Id$
+
+project(CosLifeCycle) : orbsvcslib, core, naming, portableserver, tao_versioning_idl_defaults {
+ sharedname = TAO_CosLifeCycle
+ idlflags += -Wb,export_macro=TAO_LifeCycle_Export -Wb,export_include=orbsvcs/LifeCycle/lifecycle_export.h
+ dynamicflags = TAO_LIFECYCLE_BUILD_DLL
+ tagchecks += LifeCycle
+ pch_header =
+ pch_source =
+
+ IDL_Files {
+ CosLifeCycle.idl
+ LifeCycleService.idl
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ LifeCycle {
+ CosLifeCycleC.cpp
+ CosLifeCycleS.cpp
+ LifeCycleServiceC.cpp
+ LifeCycleServiceS.cpp
+ }
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_CosLifeCycle.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/CosLifeCycle.rc b/TAO/orbsvcs/orbsvcs/CosLifeCycle.rc
new file mode 100644
index 00000000000..abcd96fbf8b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosLifeCycle.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosLifeCycle\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosLifeCycleDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosLifeCycle.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosLoadBalancing.idl b/TAO/orbsvcs/orbsvcs/CosLoadBalancing.idl
new file mode 100644
index 00000000000..b93e66a11b6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosLoadBalancing.idl
@@ -0,0 +1,202 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file CosLoadBalancing.idl
+ *
+ * $Id$
+ *
+ * @author Object Management Group
+ */
+//=============================================================================
+
+
+#ifndef COSLOADBALANCING_IDL
+#define COSLOADBALANCING_IDL
+
+#include "PortableGroup.idl"
+#include "orb.idl"
+
+/**
+ * @class CosLoadBalancing
+ *
+ * @brief This module defines the interfaces and data types used in
+ * TAO's Load Balancing service.
+ * @par
+ * TAO's Load Balancer manages distribution of requests to replicas of
+ * a given Object in an effort to ensure that the applications/hosts
+ * pointed to by the Object reference are as equally loaded as
+ * possible, i.e. load balanced.
+ * @par
+ * The definition of 'load' is application specific, for example, some
+ * applications may choose to load balance access to multiple
+ * dedicated lines, or separate network interfaces, as well as more
+ * traditional load balancing metrics, such as CPU or power load.
+ */
+module CosLoadBalancing
+{
+ typeprefix CosLoadBalancing "tao.lb";
+
+ const IOP::ServiceId LOAD_MANAGED = 123456; // @todo TBA by OMG
+
+ typedef PortableGroup::Location Location;
+ typedef PortableGroup::Properties Properties;
+
+ // Types used for obtaining and/or reporting loads
+ typedef unsigned long LoadId;
+
+ // OMG defined LoadId constants.
+ const LoadId LoadAverage = 0;
+ const LoadId Disk = 1;
+ const LoadId Memory = 2;
+ const LoadId Network = 3;
+ const LoadId RequestsPerSecond = 4;
+
+ struct Load {
+ LoadId id;
+ float value;
+ };
+ typedef sequence<Load> LoadList;
+
+ exception MonitorAlreadyPresent {};
+ exception LocationNotFound {};
+ exception LoadAlertNotFound {};
+ exception LoadAlertAlreadyPresent {};
+ exception LoadAlertNotAdded {};
+
+ exception StrategyNotAdaptive {};
+
+ interface LoadManager;
+
+ interface Strategy
+ {
+ readonly attribute string name;
+
+ Properties get_properties ();
+
+ // Report loads at given location to the LoadManager.
+ void push_loads (in PortableGroup::Location the_location,
+ in LoadList loads)
+ raises (StrategyNotAdaptive);
+
+ // Get loads, if any, at the given location. Load balancing
+ // strategies may use this method to query loads at specific
+ // locations. Returned loads are the effective loads computed by
+ // the Strategy, as opposed to the raw loads maintained by the
+ // LoadManager.
+ LoadList get_loads (in LoadManager load_manager,
+ in PortableGroup::Location the_location)
+ raises (LocationNotFound);
+
+ // Return the next member from the given object group which will
+ // requests will be forward to.
+ Object next_member (in PortableGroup::ObjectGroup object_group,
+ in LoadManager load_manager)
+ raises (PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound);
+
+ // Ask the Strategy to analyze loads, and enable or disable alerts
+ // at object group members residing at appropriate locations.
+ oneway void analyze_loads (in PortableGroup::ObjectGroup object_group,
+ in LoadManager load_manager);
+
+ // The loads at the given location should no longer be considered
+ // when performing load analysis.
+ // void location_removed (in PortableGroup::Location the_location)
+ // raises (LocationNotFound);
+ };
+
+ typedef Strategy CustomStrategy;
+
+ // Property value for built-in load balancing Strategy.
+ struct StrategyInfo
+ {
+ string name;
+ Properties props;
+ };
+
+ interface LoadAlert
+ {
+ // Forward requests back to the load manager via the object group
+ // reference.
+ void enable_alert ();
+
+ // Stop forwarding requests, and begin accepting them again.
+ void disable_alert ();
+ };
+
+ // Interface that all load monitors must implement.
+ interface LoadMonitor
+ {
+ // Retrieve the location at which the LoadMonitor resides.
+ readonly attribute Location the_location;
+
+ // Retrieve the current load at the location LoadMonitor resides.
+ readonly attribute LoadList loads;
+ };
+
+ // Specification of LoadManager Interface
+ interface LoadManager
+ : PortableGroup::PropertyManager,
+ PortableGroup::ObjectGroupManager,
+ PortableGroup::GenericFactory
+ {
+ // For the PUSH load monitoring style.
+ void push_loads (in PortableGroup::Location the_location,
+ in LoadList loads);
+
+ // Return the raw loads at the given location, as opposed to the
+ // potentially different effective loads returned by the
+ // Strategy::get_loads() method.
+ LoadList get_loads (in PortableGroup::Location the_location)
+ raises (LocationNotFound);
+
+ // Inform member at given location of load alert condition.
+ void enable_alert (in PortableGroup::Location the_location)
+ raises (LoadAlertNotFound);
+
+ // Inform member at given location that load alert condition has
+ // passed.
+ void disable_alert (in PortableGroup::Location the_location)
+ raises (LoadAlertNotFound);
+
+ // Register a LoadAlert object for the member at the given
+ // location.
+ void register_load_alert (in PortableGroup::Location the_location,
+ in LoadAlert load_alert)
+ raises (LoadAlertAlreadyPresent,
+ LoadAlertNotAdded);
+
+ // Retrieve the LoadAlert object for the member at the given
+ // location.
+ LoadAlert get_load_alert (in PortableGroup::Location the_location)
+ raises (LoadAlertNotFound);
+
+ // Remove (de-register) the LoadAlert object for the member at the
+ // given location.
+ void remove_load_alert (in PortableGroup::Location the_location)
+ raises (LoadAlertNotFound);
+
+ // The following load monitor methods are only used for the PULL
+ // load monitoring style.
+
+ // Register a LoadMonitor object for "pull" monitoring of the
+ // given location.
+ void register_load_monitor (in PortableGroup::Location the_location,
+ in LoadMonitor load_monitor)
+ raises (MonitorAlreadyPresent);
+
+ // Retrieve the LoadMonitor object for the given location.
+ LoadMonitor get_load_monitor (in PortableGroup::Location the_location)
+ raises (LocationNotFound);
+
+ // Remove (de-register) the LoadMonitor object for the given
+ // location.
+ void remove_load_monitor (in PortableGroup::Location the_location)
+ raises (LocationNotFound);
+
+ };
+
+};
+
+#endif /* COSLOADBALANCING_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/CosLoadBalancing.mpc b/TAO/orbsvcs/orbsvcs/CosLoadBalancing.mpc
new file mode 100644
index 00000000000..7ea375e45af
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosLoadBalancing.mpc
@@ -0,0 +1,50 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcslib, core, naming, iormanip, portablegroup, ami, minimum_corba, pi, pi_server, iorinterceptor, tao_versioning_idl_defaults {
+ sharedname = TAO_CosLoadBalancing
+ idlflags += -Wb,export_macro=TAO_LoadBalancing_Export -Wb,export_include=orbsvcs/LoadBalancing/LoadBalancing_export.h
+ dynamicflags = TAO_LOADBALANCING_BUILD_DLL
+ tagchecks += CosLoadBalancing
+
+ IDL_Files {
+ CosLoadBalancing.idl
+ LB_ORT.idl
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ CosLoadBalancing {
+ CosLoadBalancingC.cpp
+ CosLoadBalancingS.cpp
+ LB_ORTC.cpp
+ LoadBalancing/LB_LeastLoaded.cpp
+ LoadBalancing/LB_LoadMinimum.cpp
+ LoadBalancing/LB_LoadAverage.cpp
+ LoadBalancing/LB_LoadAlert.cpp
+ LoadBalancing/LB_LoadAlertInfo.cpp
+ LoadBalancing/LB_LoadAlert_Handler.cpp
+ LoadBalancing/LB_LoadManager.cpp
+ LoadBalancing/LB_MemberLocator.cpp
+ LoadBalancing/LB_Pull_Handler.cpp
+ LoadBalancing/LB_Random.cpp
+ LoadBalancing/LB_RoundRobin.cpp
+ LoadBalancing/LB_ClientComponent.cpp
+ LoadBalancing/LB_ClientORBInitializer.cpp
+ LoadBalancing/LB_ClientRequestInterceptor.cpp
+ LoadBalancing/LB_ServerRequestInterceptor.cpp
+ LoadBalancing/LB_IORInterceptor.cpp
+ LoadBalancing/LB_ObjectReferenceFactory.cpp
+ LoadBalancing/LB_ORBInitializer.cpp
+ LoadBalancing/LB_Component.cpp
+ LoadBalancing/LB_CPU_Utilization_Monitor.cpp
+ LoadBalancing/LB_CPU_Load_Average_Monitor.cpp
+ }
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_CosLoadBalancing.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/CosLoadBalancing.rc b/TAO/orbsvcs/orbsvcs/CosLoadBalancing.rc
new file mode 100644
index 00000000000..95b44fda7f1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosLoadBalancing.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosLoadBalancing\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosLoadBalancingDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosLoadBalancing.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosNaming.idl b/TAO/orbsvcs/orbsvcs/CosNaming.idl
new file mode 100644
index 00000000000..78241d6a49d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosNaming.idl
@@ -0,0 +1,291 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// CosNaming.idl
+//
+// = AUTHOR
+// Marina Spivak <marina@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_NAMING_IDL
+#define TAO_NAMING_IDL
+
+#pragma prefix "omg.org"
+
+module CosNaming
+{
+ // = TITLE
+ // This module provides interface for using COS Naming Service.
+
+ typedef string Istring;
+ // Define a typedef for String. Maybe at some point, <Istring> will
+ // be different to support Internationalization.
+
+ struct NameComponent
+ {
+ // = TITLE
+ // This is a 'simple' name.
+ //
+ // = DESCRIPTION
+ // Both id and kind fields are used in resolving names.
+
+ Istring id;
+ // This is the name that is used to identify object references.
+
+ Istring kind;
+ // Stores any addtional info about the object reference.
+ };
+
+ typedef sequence <NameComponent> Name;
+ // This is a compound name: <c1; c2; c3; cn> where c1 to cn-1 are
+ // the names of the nested contexts, and cn is the name of the
+ // object bound in cn-1.
+
+ enum BindingType
+ {
+ nobject,
+ // object binding.
+
+ ncontext
+ // Naming context binding.
+ };
+
+ struct Binding
+ {
+ Name binding_name;
+ // Simple name, under which an object is bound in a given context.
+
+ BindingType binding_type;
+ // Indicates whether the binding_name identifies a context, and, therefore, can
+ // participate in name resolution.
+ };
+
+ typedef sequence <Binding> BindingList;
+
+ interface BindingIterator;
+ // Forward declaration.
+
+ interface NamingContext
+ {
+ // = TITLE
+ // Interface for managing name bindings and naming contexts.
+
+ // = Exceptions.
+
+ enum NotFoundReason
+ {
+ missing_node,
+ not_context,
+ not_object
+ };
+
+ exception NotFound
+ {
+ // = TITLE
+ // Indicates that the name does not identify a binding.
+
+ NotFoundReason why;
+ Name rest_of_name;
+ };
+
+ exception CannotProceed
+ {
+ // = TITLE
+ // Implementation may throw this exception if some reason it cannot
+ // complete the operation. This is currently not used in TAO.
+
+ NamingContext cxt;
+ Name rest_of_name;
+ };
+
+ exception InvalidName
+ {
+ // = TITLE
+ // A name of length 0 is invalid. Implementations may place
+ // further restrictions.
+ };
+
+ exception AlreadyBound
+ {
+ // = TITLE
+ // Indicates that the specified name is already bound to
+ // some object. Only one object can be bound to a
+ // particular name in an context. To change the binding,
+ // <rebind> and <rebind_context> can be used.
+ };
+
+ exception NotEmpty
+ {
+ // = TITLE
+ // Indicates that the context is not empty.
+ };
+
+ // = Binding operations.
+
+ void bind (in Name n, in Object obj)
+ raises (NotFound, CannotProceed, InvalidName, AlreadyBound);
+ // Create a binding for name <n> and object <obj> in the naming
+ // context. Compound names are treated as follows: ctx->bind
+ // (<c1; c2; c3; cn>, obj) = (ctx->resolve (<c1; c2;
+ // cn-1>))->bind (<cn>, obj) if the there already exists a
+ // binding for the specified name, <AlreadyBound> exception is
+ // thrown. Naming contexts should be bound using <bind_context>
+ // and <rebind_context> in order to participate in name
+ // resolution later.
+
+ void rebind (in Name n, in Object obj)
+ raises (NotFound, CannotProceed, InvalidName);
+ // This is similar to <bind> operation above, except for when
+ // the binding for the specified name already exists in the
+ // specified context. In that case, the existing binding is
+ // replaced with the new one.
+
+ void bind_context (in Name n, in NamingContext nc)
+ raises(NotFound, CannotProceed, InvalidName, AlreadyBound);
+ // This is the version of <bind> specifically for binding naming
+ // contexts, so that they will participate in name resolution
+ // when compound names are passed to be resolved.
+
+ void rebind_context (in Name n, in NamingContext nc)
+ raises (NotFound, CannotProceed, InvalidName);
+ // This is a version of <rebind> specifically for naming
+ // contexts, so that they can participate in name resolution
+ // when compound names are passed.
+
+ // = Resolving names.
+
+ Object resolve (in Name n)
+ raises (NotFound, CannotProceed, InvalidName);
+ // Return object reference that is bound to the name. Compound
+ // name resolve is defined as follows: ctx->resolve (<c1; c2;
+ // cn>) = ctx->resolve (<c1; c2 cn-1>)->resolve (<cn>) The
+ // naming service does not return the type of the object.
+ // Clients are responsible for "narrowing" the object to the
+ // appropriate type.
+
+ // = Unbinding names.
+
+ void unbind (in Name n)
+ raises (NotFound, CannotProceed, InvalidName);
+ // Remove the name binding from the context. When compound
+ // names are used, unbind is defined as follows: ctx->unbind
+ // (<c1; c2; cn>) = (ctx->resolve (<c1; c2; cn-1>))->unbind
+ // (<cn>)
+
+ // = Creating Naming Contexts.
+
+ NamingContext new_context ();
+ // This operation returns a new naming context implemented by
+ // the same naming server in which the operation was invoked.
+ // The context is not bound.
+
+ NamingContext bind_new_context (in Name n)
+ raises (NotFound, AlreadyBound, CannotProceed, InvalidName);
+ // This operation creates a new context and binds it to the name
+ // supplied as an argument. The newly-created context is
+ // implemented by the same server as the context in which it was
+ // bound (the name argument excluding the last component).
+
+ // = Deleting contexts.
+
+ void destroy ()
+ raises (NotEmpty);
+ // Delete the naming context. NOTE: the user should <unbind>
+ // any bindings in which the given context is bound to some
+ // names before invoking <destroy> operation on it.
+
+
+ // = Listing the naming context.
+
+ void list (in unsigned long how_many,
+ out BindingList bl,
+ out BindingIterator bi);
+ // Returns at most the requested number of bindings <how_many>
+ // in <bl>. If the naming context contains additional bindings,
+ // they are returned with a BindingIterator. In the naming
+ // context does not contain any additional bindings <bi>
+ // returned as null.
+ };
+
+ interface BindingIterator
+ {
+ // = TITLE
+ // Interface for iterating over Bindings returned with the
+ // <list> operation.
+
+ boolean next_one (out Binding b);
+ // This operation returns the next binding. If there are no
+ // more bindings false is returned.
+
+ boolean next_n (in unsigned long how_many,
+ out BindingList bl);
+ // This operation returns at most the requested number of
+ // bindings.
+
+ void destroy ();
+ // This operation destroys the iterator.
+ };
+
+ interface NamingContextExt : NamingContext
+ {
+ // = TITLE
+ // Interface for providing operations required to use URLs and
+ // stringified names.
+ //
+ // Reference to: Document orbos/98-10-11 (Interoperable Naming Joint Revised Submission)
+ // Joint Submission by BEA Systems, DSTC, IONA, and Inprise
+
+ typedef string StringName;
+ // Stringified form of a Name.
+
+ typedef string Address;
+ // URL<address> such as myhost.xyz.com.
+
+ typedef string URLString;
+ // Stringified form of a URL<address> componoent.
+
+ StringName to_string (in Name n)
+ raises (InvalidName);
+ // This operation accepts a Name and returns a stringified
+ // name. If the name is invalid, an InvalidName exception is
+ // raised.
+
+ Name to_name (in StringName sn)
+ raises (InvalidName);
+ // This operation returns a Name. If the input stringified
+ // name is syntactically malformed or violates an
+ // implementation limit, an InvalidName exception is
+ // raised.
+
+ exception InvalidAddress {
+ // = TITLE
+ // Indicates that the URL<address> is invalid.
+ };
+
+ URLString to_url (in Address addr,
+ in StringName sn)
+ raises (InvalidAddress, InvalidName);
+ //
+ // It performs any escapes necessary on the stringified name
+ // and returns a fully formed URL string. An exception is
+ // raised if either the protocol or name parameters are invalid.
+
+
+ Object resolve_str (in StringName n)
+ raises (NotFound, CannotProceed, InvalidName);
+ //
+ // This is similar to <resolve> as in the
+ // CosNaming::NamingContext interface, except that it accepts
+ // a stringified name as an argument instead of a Name.
+
+ };
+};
+
+#endif /* TAO_NAMING_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/CosNaming.mpc b/TAO/orbsvcs/orbsvcs/CosNaming.mpc
new file mode 100644
index 00000000000..991012a2a9f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosNaming.mpc
@@ -0,0 +1,48 @@
+// -*- MPC -*-
+// $Id$
+
+project(CosNaming_IDL) : orbsvcslib, core, tao_versioning_idl_defaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=TAO_Naming_Export -Wb,stub_export_include=orbsvcs/Naming/naming_export.h -Wb,skel_export_macro=TAO_Naming_Skel_Export -Wb,skel_export_include=orbsvcs/Naming/naming_skel_export.h
+
+ IDL_Files {
+ CosNaming.idl
+ }
+}
+
+project(CosNaming) : orbsvcslib, core {
+ sharedname = TAO_CosNaming
+ dynamicflags = TAO_NAMING_BUILD_DLL
+ tagchecks += Naming
+ after += CosNaming_IDL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ CosNamingC.cpp
+ Naming/Naming_Client.cpp
+ }
+
+ Header_Files {
+ CosNamingC.h
+ Naming/Naming_Client.h
+ Naming/naming_export.h
+ }
+
+ Inline_Files {
+ CosNamingC.inl
+ }
+
+ Template_Files {
+ }
+
+ // explicit Resource_Files to avoid including _Skel & _Serv rc files.
+ Resource_Files{
+ CosNaming.rc
+ }
+
+ Pkgconfig_Files {
+ TAO_CosNaming.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/CosNaming.rc b/TAO/orbsvcs/orbsvcs/CosNaming.rc
new file mode 100644
index 00000000000..f588ff31b1b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosNaming.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosNaming\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosNamingDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosNaming.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosNaming_Serv.mpc b/TAO/orbsvcs/orbsvcs/CosNaming_Serv.mpc
new file mode 100644
index 00000000000..02f81cd7b59
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosNaming_Serv.mpc
@@ -0,0 +1,53 @@
+// -*- MPC -*-
+//
+// $Id$
+
+project(CosNaming_Serv) : orbsvcslib, core, naming_skel, messaging_optional, svc_utils, iortable {
+ avoids += ace_for_tao // Requires MMAP_Memory_Pool
+ sharedname = TAO_CosNaming_Serv
+ dynamicflags = TAO_NAMING_SERV_BUILD_DLL
+ tagchecks += Naming
+
+ IDL_Files {
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ Naming {
+ Naming/Entries.cpp
+ Naming/Flat_File_Persistence.cpp
+ Naming/Hash_Naming_Context.cpp
+ Naming/Naming_Context_Interface.cpp
+ Naming/Naming_Loader.cpp
+ Naming/Naming_Server.cpp
+ Naming/Persistent_Context_Index.cpp
+ Naming/Persistent_Entries.cpp
+ Naming/Persistent_Naming_Context.cpp
+ Naming/Storable.cpp
+ Naming/Storable_Naming_Context.cpp
+ Naming/Storable_Naming_Context_Activator.cpp
+ Naming/Transient_Naming_Context.cpp
+ }
+ }
+
+ Header_Files {
+ Naming/naming_serv_export.h
+ Naming/nsconf.h
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_CosNaming_Serv.pc.in
+ }
+
+ verbatim(gnuace, local) {
+ ## The optimizer in cxx (as of V6.5-014) is broken. Evidence can
+ ## be found in the iterator portion of Simple_Naming test
+ ifeq ($(CXX), cxx)
+ ifeq ($(findstring Tru64, $(ACE_DU_SUBVERSION)), Tru64)
+ OCFLAGS += -O0
+ endif
+ endif
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/CosNaming_Serv.rc b/TAO/orbsvcs/orbsvcs/CosNaming_Serv.rc
new file mode 100644
index 00000000000..8a78d7cceae
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosNaming_Serv.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosNaming_Serv\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosNaming_ServDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosNaming_Serv.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosNaming_Skel.mpc b/TAO/orbsvcs/orbsvcs/CosNaming_Skel.mpc
new file mode 100644
index 00000000000..c5859a1c573
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosNaming_Skel.mpc
@@ -0,0 +1,35 @@
+// -*- MPC -*-
+// $Id$
+
+project(CosNaming_Skel) : orbsvcslib, core, naming, portableserver {
+ sharedname = TAO_CosNaming_Skel
+ dynamicflags = TAO_NAMING_SKEL_BUILD_DLL
+ tagchecks += Naming
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ CosNamingS.cpp
+ }
+
+ Header_Files {
+ CosNamingS.h
+ CosNamingS_T.h
+ Naming/naming_skel_export.h
+ }
+
+ Inline_Files {
+ CosNamingS.inl
+ CosNamingS_T.inl
+ }
+
+ Template_Files {
+ CosNamingS_T.cpp
+ }
+
+ Pkgconfig_Files {
+ TAO_CosNaming_Skel.pc.in
+ }
+}
+
diff --git a/TAO/orbsvcs/orbsvcs/CosNaming_Skel.rc b/TAO/orbsvcs/orbsvcs/CosNaming_Skel.rc
new file mode 100644
index 00000000000..4e11b908403
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosNaming_Skel.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosNaming_Skel\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosNaming_SkelDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosNaming_Skel.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosNotification.idl b/TAO/orbsvcs/orbsvcs/CosNotification.idl
new file mode 100644
index 00000000000..ae9ed5a4e9b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosNotification.idl
@@ -0,0 +1,390 @@
+/**
+ * @file CosNotification.idl
+ *
+ * @brief Define the CosNotification module
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ */
+
+#ifndef _COS_NOTIFICATION_IDL_
+#define _COS_NOTIFICATION_IDL_
+
+#pragma prefix "omg.org"
+
+/**
+ * @namespace CosNotification
+ *
+ * @brief Define basic data structures used by the Notification
+ * Service
+ */
+module CosNotification
+{
+ /// Dummy typedef for strings, if the intent was to support I18N
+ /// strings the spec should have used wstring
+ typedef string Istring;
+
+ /// Properties are named using a string
+ typedef Istring PropertyName;
+
+ /// Property values are stored using anys
+ typedef any PropertyValue;
+
+ /**
+ * @struct Property
+ *
+ * @brief Define a name/value pair.
+ *
+ * Events are described using named/value sequences, this structure
+ * defines the name/value pair.
+ */
+ struct Property {
+ /// The name
+ PropertyName name;
+ /// The value
+ PropertyValue value;
+ };
+
+ /// Define a sequence of properties.
+ typedef sequence<Property> PropertySeq;
+
+ //@{
+ /**
+ * @name Different kinds of property sequences
+ *
+ * @brief The following are all sequences of Property, but
+ * serve different purposes.
+ */
+ /// Property sequence used for optional header fields
+ typedef PropertySeq OptionalHeaderFields;
+
+ /// Property sequence used for the event body that can be used
+ /// in filtering
+ typedef PropertySeq FilterableEventBody;
+
+ /// Specify quality of service properties
+ typedef PropertySeq QoSProperties;
+
+ /// Specify administrative properties
+ typedef PropertySeq AdminProperties;
+ //@}
+
+ /**
+ * @struct _EventType
+ *
+ * @brief Define event type names.
+ *
+ * Different vertical industries (domains) can define well-known
+ * events (event_types). This structure is used for that purpose
+ */
+ struct _EventType {
+ /// The name of the vertical industry defining the event type.
+ string domain_name;
+ /// The type of event.
+ string type_name;
+ };
+ /// A sequence of event types
+ typedef sequence<_EventType> EventTypeSeq;
+
+ /**
+ * @struct PropertyRange
+ *
+ * @brief A structure to define property ranges.
+ *
+ */
+ struct PropertyRange {
+ /// Lower end of the range
+ PropertyValue low_val;
+ /// High end of the range
+ PropertyValue high_val;
+ };
+
+ /**
+ * @struct NamedPropertyRange
+ *
+ * @brief A named property range
+ */
+ struct NamedPropertyRange {
+ /// The name
+ PropertyName name;
+ /// The range
+ PropertyRange range;
+ };
+ /// A sequence of named property ranges
+ typedef sequence<NamedPropertyRange> NamedPropertyRangeSeq;
+
+ /**
+ * @enum QoSError_code
+ *
+ * @brief Describe QoS errors.
+ */
+ enum QoSError_code {
+ /// The application has requested an unsupported QoS property
+ UNSUPPORTED_PROPERTY,
+ /// The application has requested a QoS property that, though
+ /// supported, cannot be set in the requested scope.
+ UNAVAILABLE_PROPERTY,
+ /// The application has requested a QoS property with an
+ /// unsupported value.
+ UNSUPPORTED_VALUE,
+ /// The application has requested a QoS property with a supported
+ /// value, but unavailable at the requeste scope.
+ UNAVAILABLE_VALUE,
+ /// The property name is unknown or not recognized.
+ BAD_PROPERTY,
+ /// The value type for the requested property is invalid
+ BAD_TYPE,
+ /// The value for the requested property is illegal
+ BAD_VALUE
+ };
+
+ /**
+ * @struct PropertyError
+ *
+ * @brief Describe the problems detected with an application
+ * requested QoS.
+ *
+ * If there are any problems with an application request for QoS the
+ * problems are raised using an exception that contains all the
+ * problems, and a description of the valid values (if they apply).
+ */
+ struct PropertyError {
+ /// Property error description
+ QoSError_code code;
+ /// Property name with a problem
+ PropertyName name;
+ /// Valid range for that property in the Notification Service
+ /// implementation
+ PropertyRange available_range;
+ };
+ /// List of property errors.
+ typedef sequence<PropertyError> PropertyErrorSeq;
+
+ /**
+ * @exception UnsupportedQoS
+ *
+ * @brief Exception used to describe problems with one or more QoS
+ * requests
+ *
+ */
+ exception UnsupportedQoS {
+ /// Complete description of the properties in error
+ PropertyErrorSeq qos_err;
+ };
+
+ /**
+ * @exception UnsupportedAdmin
+ *
+ * @brief Exception used to describe problems with one or more Admin
+ * properties
+ */
+ exception UnsupportedAdmin {
+ /// The complete description of the invalid properties.
+ PropertyErrorSeq admin_err;
+ };
+
+ /**
+ * @struct FixedEventHeader
+ *
+ * @brief Define the 'fixed' part of the event header
+ */
+ struct FixedEventHeader {
+ /// The event type
+ _EventType event_type;
+ /// A (possibly unique) name for the particular event
+ string event_name;
+ };
+
+ /**
+ * @struct EventHeader
+ *
+ * @brief Complete event header
+ */
+ struct EventHeader {
+ /// The fixed part of the event header
+ FixedEventHeader fixed_header;
+ /// The optional part
+ OptionalHeaderFields variable_header;
+ };
+
+ /**
+ * @struct StructuredEvent
+ *
+ * @brief Define structured events
+ */
+ struct StructuredEvent {
+ /// The header
+ EventHeader header;
+ /// The part of the body used for filtering
+ FilterableEventBody filterable_data;
+ /// The part of the body not used for filtering
+ any remainder_of_body;
+ };
+ /// Sequence of events, for batch processing
+ typedef sequence<StructuredEvent> EventBatch;
+
+ //@{
+ /**
+ * @name Constants for QoS Properties
+ *
+ * The following constant declarations define the standard QoS
+ * property names and the associated values each property can take
+ * on. The name/value pairs for each standard property are grouped,
+ * beginning with a string constant defined for the property name,
+ * followed by the values the property can take on.
+ */
+
+ const string EventReliability = "EventReliability";
+ const short BestEffort = 0;
+ const short Persistent = 1;
+
+ /// Can take on the same values as EventReliability
+ const string ConnectionReliability = "ConnectionReliability";
+
+ const string Priority = "Priority";
+ const short LowestPriority = -32767;
+ const short HighestPriority = 32767;
+ const short DefaultPriority = 0;
+
+ /// StartTime takes a value of type TimeBase::UtcT.
+ const string StartTime = "StartTime";
+
+ /// StopTime takes a value of type TimeBase::UtcT.
+ const string StopTime = "StopTime";
+
+ /// Timeout takes on a value of type TimeBase::TimeT
+ const string Timeout = "Timeout";
+
+ const string OrderPolicy = "OrderPolicy";
+ const short AnyOrder = 0;
+ const short FifoOrder = 1;
+ const short PriorityOrder = 2;
+ const short DeadlineOrder = 3;
+
+ /// DiscardPolicy takes on the same values as OrderPolicy, plus
+ const string DiscardPolicy = "DiscardPolicy";
+ const short LifoOrder = 4;
+
+ /// MaximumBatchSize takes on a value of type long
+ const string MaximumBatchSize = "MaximumBatchSize";
+
+ /// PacingInterval takes on a value of type TimeBase::TimeT
+ const string PacingInterval = "PacingInterval";
+
+ /// StartTimeSupported takes on a boolean value
+ const string StartTimeSupported = "StartTimeSupported";
+
+ /// StopTimeSupported takes on a boolean value
+ const string StopTimeSupported = "StopTimeSupported";
+
+ /// MaxEventsPerConsumer takes on a value of type long
+ const string MaxEventsPerConsumer = "MaxEventsPerConsumer";
+
+ //@}
+
+ /**
+ * @interface QoSAdmin
+ *
+ * @brief Interface used to control the QoS properties of an Event
+ * Service components (Channel, Proxy, etc.)
+ *
+ * QoS properties of a channel can be set at different levels,
+ * including the proxies, the ConsumerAdmin and the SupplierAdmin
+ * objects. Each one of those components offers this interface to
+ * allow control over the properties.
+ */
+ interface QoSAdmin {
+ /// Get the current QoS properties
+ /**
+ * The operation returns the properties set:
+ * - At the level queried
+ * - Not set at the level queried but set at a higher-level
+ * - Not set at all but having a default value.
+ */
+ QoSProperties get_qos();
+
+ /// Set the QoS properties
+ /**
+ * @param qos The requested QoS properties
+ * @throws UnsupportedQoS if the requested QoS cannot be
+ * implemented or is invalid. The exception contents describe
+ * the problem(s) in detail.
+ */
+ void set_qos ( in QoSProperties qos)
+ raises ( UnsupportedQoS );
+
+ /// Validate a set of QoS properties
+ /**
+ * @param required_qos the list of properties requested by the
+ * application
+ * @param available_qos If the properties are supported this
+ * argument returns a list of any other properties that
+ * could also be set.
+ * @throws UnsupportedQoS if the requested QoS cannot be
+ * implemented or is invalid. The exception contents describe
+ * the problem(s) in detail.
+ */
+ void validate_qos (in QoSProperties required_qos,
+ out NamedPropertyRangeSeq available_qos )
+ raises ( UnsupportedQoS );
+ };
+
+ //@{
+ /**
+ * @name Constants for Admin Properties
+ *
+ * Admin properties are defined in similar manner as QoS
+ * properties. The only difference is that these properties are
+ * related to channel administration policies, as opposed message
+ * quality of service
+ */
+ /// MaxQueueLength takes on a value of type long
+ const string MaxQueueLength = "MaxQueueLength";
+
+ /// MaxConsumers takes on a value of type long
+ const string MaxConsumers = "MaxConsumers";
+
+ /// MaxSuppliers takes on a value of type long
+ const string MaxSuppliers = "MaxSuppliers";
+
+ /// RejectNewEvents takes on a value of type Boolean
+ const string RejectNewEvents = "RejectNewEvents";
+ //@}
+
+ /**
+ * @interface AdminPropertiesAdmin
+ *
+ * @brief Define the interface to manipulate the Admin properties of
+ * a Notification Service components
+ *
+ * Several Notification Service components have Admin properties,
+ * including the Event Channel, its ConsumerAdmin and SupplierAdmin
+ * objects as well as the proxies. This interface is used to
+ * control the Admin properties of each one of those components.
+ */
+ interface AdminPropertiesAdmin {
+ /// Get the Admin properties
+ /**
+ * The operation returns the properties set:
+ * - At the level queried
+ * - Not set at the level queried but set at a higher-level
+ * - Not set at all but having a default value.
+ */
+ AdminProperties get_admin();
+
+ /// Set the Admin properities
+ /**
+ * @param admin The list of Admin properties requested
+ * @throws UnsupportedAdmin if the requested admin properties
+ * cannot be implemented or are invalid
+ */
+ void set_admin (in AdminProperties admin)
+ raises ( UnsupportedAdmin);
+ };
+
+};
+
+#pragma prefix ""
+
+#endif /* _COS_NOTIFICATION_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/CosNotification.mpc b/TAO/orbsvcs/orbsvcs/CosNotification.mpc
new file mode 100644
index 00000000000..87fab05f21c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosNotification.mpc
@@ -0,0 +1,267 @@
+// -*- MPC -*-
+// $Id$
+
+project(CosNotification_IDL) : orbsvcslib, core, event, tao_versioning_idl_defaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=TAO_Notify_Export -Wb,stub_export_include=orbsvcs/Notify/notify_export.h -Wb,skel_export_macro=TAO_Notify_Skel_Export -Wb,skel_export_include=orbsvcs/Notify/notify_skel_export.h
+
+ IDL_Files {
+ CosNotification.idl
+ CosNotifyComm.idl
+ CosNotifyFilter.idl
+ CosNotifyChannelAdmin.idl
+ NotifyExt.idl
+ Event_Forwarder.idl
+ }
+}
+
+project(CosNotification) : orbsvcslib, core, event {
+ sharedname = TAO_CosNotification
+ dynamicflags = TAO_NOTIFY_BUILD_DLL
+ tagchecks += Notify
+ after += CosNotification_IDL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ CosNotificationC.cpp
+ CosNotifyCommC.cpp
+ CosNotifyFilterC.cpp
+ CosNotifyChannelAdminC.cpp
+ NotifyExtC.cpp
+ Event_ForwarderC.cpp
+ Notify/Notify_Extensions.cpp
+ }
+
+ Header_Files {
+ CosNotificationC.h
+ CosNotifyCommC.h
+ CosNotifyFilterC.h
+ CosNotifyChannelAdminC.h
+ NotifyExtC.h
+ Event_ForwarderC.h
+ Notify/Notify_Extensions.h
+ Notify/notify_export.h
+ }
+
+ Inline_Files {
+ CosNotificationC.inl
+ CosNotifyCommC.inl
+ CosNotifyFilterC.inl
+ CosNotifyChannelAdminC.inl
+ NotifyExtC.inl
+ Event_ForwarderC.inl
+ }
+
+ Template_Files {
+ }
+
+ Resource_Files {
+ CosNotification.rc
+ }
+
+ Pkgconfig_Files {
+ TAO_CosNotification.pc.in
+ }
+}
+
+
+project(CosNotification_Skel) : orbsvcslib, core, notification, event_skel, portableserver {
+ sharedname = TAO_CosNotification_Skel
+ dynamicflags = TAO_NOTIFY_SKEL_BUILD_DLL
+ tagchecks += Notify
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ CosNotificationS.cpp
+ CosNotifyCommS.cpp
+ CosNotifyFilterS.cpp
+ CosNotifyChannelAdminS.cpp
+ NotifyExtS.cpp
+ Event_ForwarderS.cpp
+ }
+
+ Header_Files {
+ CosNotificationS.h
+ CosNotifyCommS.h
+ CosNotifyFilterS.h
+ CosNotifyChannelAdminS.h
+ NotifyExtS.h
+ Event_ForwarderS.h
+
+ CosNotificationS_T.h
+ CosNotifyCommS_T.h
+ CosNotifyFilterS_T.h
+ CosNotifyChannelAdminS_T.h
+ NotifyExtS_T.h
+ Event_ForwarderS_T.h
+
+ Notify/notify_skel_export.h
+ }
+
+ Inline_Files {
+ CosNotificationS.inl
+ CosNotifyCommS.inl
+ CosNotifyFilterS.inl
+ CosNotifyChannelAdminS.inl
+ NotifyExtS.inl
+ Event_ForwarderS.inl
+
+ CosNotificationS_T.inl
+ CosNotifyCommS_T.inl
+ CosNotifyFilterS_T.inl
+ CosNotifyChannelAdminS_T.inl
+ NotifyExtS_T.inl
+ Event_ForwarderS_T.inl
+ }
+
+ Template_Files {
+ CosNotificationS_T.cpp
+ CosNotifyCommS_T.cpp
+ CosNotifyFilterS_T.cpp
+ CosNotifyChannelAdminS_T.cpp
+ NotifyExtS_T.cpp
+ Event_ForwarderS_T.cpp
+ }
+
+ Pkgconfig_Files {
+ TAO_CosNotification_Skel.pc.in
+ }
+}
+
+project(CosNotification_Serv) : orbsvcslib, svc_utils, core, notification_skel, dynamicany, etcl{
+ sharedname = TAO_CosNotification_Serv
+ dynamicflags = TAO_NOTIFY_SERV_BUILD_DLL
+ tagchecks += Notify
+
+ IDL_Files {
+ }
+
+ // The following could be simplified if RT stuff was
+ // put into another subdirectory.
+
+ Source_Files {
+ Notify/Admin.cpp
+ Notify/AdminProperties.cpp
+ Notify/Bit_Vector.cpp
+ Notify/Buffering_Strategy.cpp
+ Notify/Builder.cpp
+ Notify/Consumer.cpp
+ Notify/ConsumerAdmin.cpp
+ Notify/CosNotify_Initializer.cpp
+ Notify/CosNotify_Service.cpp
+ Notify/Default_Factory.cpp
+ Notify/Delivery_Request.cpp
+ Notify/ETCL_Filter.cpp
+ Notify/ETCL_FilterFactory.cpp
+ Notify/Event.cpp
+ Notify/EventChannel.cpp
+ Notify/EventChannelFactory.cpp
+ Notify/EventType.cpp
+ Notify/EventTypeSeq.cpp
+ Notify/Event_Manager.cpp
+ Notify/Event_Persistence_Factory.cpp
+ Notify/FilterAdmin.cpp
+ Notify/ID_Factory.cpp
+ Notify/Method_Request.cpp
+ Notify/Method_Request_Dispatch.cpp
+ Notify/Method_Request_Event.cpp
+ Notify/Method_Request_Lookup.cpp
+ Notify/Method_Request_Shutdown.cpp
+ Notify/Method_Request_Updates.cpp
+ Notify/Name_Value_Pair.cpp
+ Notify/Notify_Constraint_Interpreter.cpp
+ Notify/Notify_Constraint_Visitors.cpp
+ Notify/Notify_Default_Collection_Factory.cpp
+ Notify/Notify_Default_CO_Factory.cpp
+ Notify/Notify_Default_EMO_Factory.cpp
+ Notify/Notify_Default_POA_Factory.cpp
+ Notify/Notify_EventChannelFactory_i.cpp
+ Notify/Object.cpp
+ Notify/Peer.cpp
+ Notify/Persistent_File_Allocator.cpp
+ Notify/POA_Helper.cpp
+ Notify/Properties.cpp
+ Notify/PropertySeq.cpp
+ Notify/Property_Boolean.cpp
+ Notify/Proxy.cpp
+ Notify/ProxyConsumer.cpp
+ Notify/ProxySupplier.cpp
+ Notify/QoSProperties.cpp
+ Notify/Random_File.cpp
+ Notify/Reactive_Task.cpp
+ Notify/Refcountable.cpp
+ Notify/Reconnection_Registry.cpp
+ Notify/Routing_Slip.cpp
+ Notify/Routing_Slip_Persistence_Manager.cpp
+ Notify/Routing_Slip_Queue.cpp
+ Notify/Service.cpp
+ Notify/Subscription_Change_Worker.cpp
+ Notify/Supplier.cpp
+ Notify/SupplierAdmin.cpp
+ Notify/Standard_Event_Persistence.cpp
+ Notify/ThreadPool_Task.cpp
+ Notify/Timer_Queue.cpp
+ Notify/Timer_Reactor.cpp
+ Notify/Topology_Loader.cpp
+ Notify/Topology_Object.cpp
+ Notify/Topology_Saver.cpp
+ Notify/Worker_Task.cpp
+ Notify/Any/AnyEvent.cpp
+ Notify/Any/CosEC_ProxyPushConsumer.cpp
+ Notify/Any/CosEC_ProxyPushSupplier.cpp
+ Notify/Any/ProxyPushConsumer.cpp
+ Notify/Any/ProxyPushSupplier.cpp
+ Notify/Any/PushConsumer.cpp
+ Notify/Any/PushSupplier.cpp
+ Notify/Sequence/SequenceProxyPushConsumer.cpp
+ Notify/Sequence/SequenceProxyPushSupplier.cpp
+ Notify/Sequence/SequencePushConsumer.cpp
+ Notify/Sequence/SequencePushSupplier.cpp
+ Notify/Structured/StructuredEvent.cpp
+ Notify/Structured/StructuredProxyPushConsumer.cpp
+ Notify/Structured/StructuredProxyPushSupplier.cpp
+ Notify/Structured/StructuredPushConsumer.cpp
+ Notify/Structured/StructuredPushSupplier.cpp
+ }
+
+ Header_Files {
+ Notify/notify_serv_export.h
+ }
+
+ Inline_Files {
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_CosNotification_Serv.pc.in
+ }
+
+}
+
+project(CosNotification_Persist) : notification_serv, core, acexml {
+ sharedname = TAO_CosNotification_Persist
+ dynamicflags = TAO_NOTIFY_PERSIST_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Notify/XML_*.cpp
+ }
+
+ Header_Files {
+ Notify/notify_persist_export.h
+ }
+
+ Inline_Files {
+ }
+
+ Template_Files {
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/CosNotification.rc b/TAO/orbsvcs/orbsvcs/CosNotification.rc
new file mode 100644
index 00000000000..f39d9fe9699
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosNotification.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosNotification\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosNotificationDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosNotification.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosNotification_Serv.rc b/TAO/orbsvcs/orbsvcs/CosNotification_Serv.rc
new file mode 100644
index 00000000000..c261ee4d0e9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosNotification_Serv.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosNotification_Serv\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosNotification_ServDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosNotification_Serv.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosNotification_Skel.rc b/TAO/orbsvcs/orbsvcs/CosNotification_Skel.rc
new file mode 100644
index 00000000000..534ac2e6d2c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosNotification_Skel.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosNotification_Skel\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosNotification_SkelDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosNotification_Skel.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosNotifyChannelAdmin.idl b/TAO/orbsvcs/orbsvcs/CosNotifyChannelAdmin.idl
new file mode 100644
index 00000000000..b792ae547ff
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosNotifyChannelAdmin.idl
@@ -0,0 +1,1027 @@
+/**
+ * @file CosNotifyChannelAdmin.idl
+ *
+ * @brief Define the CosNotifyChannel module
+ *
+ * $Id$
+ *
+ * This module is taken from the standard CORBA Notification Service
+ * 1.0, as described in:
+ *
+ * http://www.omg.org/technology/documents/formal/notification_service.htm
+ *
+ * In particular the following two documents were used:
+ * formal/2000-06-20
+ * formal/01-03-03
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ */
+
+#ifndef _COS_NOTIFY_CHANNEL_ADMIN_IDL_
+#define _COS_NOTIFY_CHANNEL_ADMIN_IDL_
+
+#include "CosNotification.idl"
+#include "CosNotifyFilter.idl"
+#include "CosNotifyComm.idl"
+#include "CosEventChannelAdmin.idl"
+
+#pragma prefix "omg.org"
+
+/**
+ * @namespace CosNotifyChannelAdmin
+ *
+ * @brief Defines the interfaces to connect and manipulate the
+ * Notification Service.
+ */
+module CosNotifyChannelAdmin
+{
+ /**
+ * @exception ConnectionAlreadyActive
+ *
+ * @brief Exception Raised if an attempt is made to resume a
+ * connection that has not been suspended.
+ */
+ exception ConnectionAlreadyActive {};
+
+ /**
+ * @exception ConnectionAlreadyInactive
+ *
+ * @brief Exception raised if an attempt is made to suspend a
+ * connection already suspended.
+ */
+ exception ConnectionAlreadyInactive {};
+
+ /**
+ * @exception NotConnected
+ *
+ * @brief Exception raised if an attempt is made to suspend or
+ * resume a proxy that has not been connected.
+ */
+ exception NotConnected {};
+
+ // Forward declarations
+ interface ConsumerAdmin;
+ interface SupplierAdmin;
+ interface EventChannel;
+ interface EventChannelFactory;
+
+ /**
+ * @enum ProxyType
+ *
+ * @brief Helper typedef to inspect the types of proxies connected
+ * to an EventChannel
+ */
+ enum ProxyType {
+ /// A push-style proxy that uses the 'any' format
+ PUSH_ANY,
+ /// A pull-style proxy that uses the 'any' format
+ PULL_ANY,
+ /// A push-style proxy that uses structured events
+ PUSH_STRUCTURED,
+ /// A pull-style proxy that uses structured events
+ PULL_STRUCTURED,
+ /// A push-style proxy that uses event batches
+ PUSH_SEQUENCE,
+ /// A pull-style proxy that uses event batches
+ PULL_SEQUENCE,
+ /// A typed, push-style proxy
+ PUSH_TYPED,
+ /// A typed, pull-style proxy
+ PULL_TYPED
+ };
+
+ /**
+ * @enum ObtainInfoMode
+ *
+ * @brief Define the modes to fetch subscriptions and publication
+ * lists from the Notification Service.
+ */
+ enum ObtainInfoMode {
+ /// Get all the current subscriptions/publications, do not send
+ /// updates to the peer
+ ALL_NOW_UPDATES_OFF,
+ /// Get all the current subscriptions/publications, send updates
+ /// to the peer
+ ALL_NOW_UPDATES_ON,
+ /// Do not get any of the current subscriptions/publications, do
+ /// not send updates to the peer either
+ NONE_NOW_UPDATES_OFF,
+ /// Do not get any of the current subscriptions/publications, but
+ /// send updates to the peer
+ NONE_NOW_UPDATES_ON
+ };
+
+ /**
+ * @interface ProxyConsumer
+ *
+ * @brief Defines the interface shared by all consumer proxies
+ *
+ * Consumer proxies are used by suppliers to provide events into the
+ * Notification Service, this interface captures the shared
+ * operations in all those proxies.
+ */
+ interface ProxyConsumer
+ : CosNotification::QoSAdmin
+ , CosNotifyFilter::FilterAdmin
+ {
+ /// The style and event format for this proxy
+ readonly attribute ProxyType MyType;
+
+ /// The SupplierAdmin this proxy belongs to
+ readonly attribute SupplierAdmin MyAdmin;
+
+ /// Get the list of event types that this proxy could potentially
+ /// forward to any consumer connected to the EventChannel
+ /**
+ * @param mode Describe how the subscriptions should be fetched
+ * @return The list of current subscriptions, if requested in the
+ * mode argument
+ */
+ CosNotification::EventTypeSeq obtain_subscription_types(
+ in ObtainInfoMode mode );
+
+ /// Validate a list of QoS properties for an event
+ /**
+ * Suppliers can provide events with specific QoS properties, the
+ * following operation allows suppliers to verify if a given set
+ * of QoS properties would be honored by the proxy.
+ *
+ * @param required_qos The QoS properties required by the supplier
+ * @param available_qos If the QoS properties required are
+ * supported this argument returns any other QoS properties that
+ * the application may set without breaking the proxy
+ * capabilities.
+ * @throws CosNotification::UnsupportedQoS if the QoS properties
+ * required cannot be supported. The exception describes the
+ * problems and any legal values in detail.
+ */
+ void validate_event_qos (
+ in CosNotification::QoSProperties required_qos,
+ out CosNotification::NamedPropertyRangeSeq available_qos)
+ raises (CosNotification::UnsupportedQoS);
+ };
+
+ /**
+ * @interface ProxySupplier
+ *
+ * @brief Defines the interface shared by all supplier proxies
+ *
+ * Supplier proxies are used by consumers to communicate with the
+ * Notification Service, this interface captures the shared
+ * operations in all those proxies.
+ */
+ interface ProxySupplier
+ : CosNotification::QoSAdmin
+ , CosNotifyFilter::FilterAdmin
+ {
+ /// The style and event format for this proxy
+ readonly attribute ProxyType MyType;
+
+ /// The ConsumerAdmin this proxy belongs to
+ readonly attribute ConsumerAdmin MyAdmin;
+
+ /// Get and set the mapping filter used to change the priority
+ /// property for this proxy.
+ /**
+ * The filter is initialized to the nil reference
+ */
+ attribute CosNotifyFilter::MappingFilter priority_filter;
+
+ /// Get and set the mapping filter used to change the lifetime
+ /// property for this proxy.
+ /**
+ * The filter is initialized to the nil reference
+ */
+ attribute CosNotifyFilter::MappingFilter lifetime_filter;
+
+ /// Get the list of event types that this proxy could potentially
+ /// forward to its connected supplier
+ /**
+ * @param mode Describe how the publications should be fetched
+ * @return The list of current subscriptions, if requested in the
+ * mode argument
+ */
+ CosNotification::EventTypeSeq obtain_offered_types(
+ in ObtainInfoMode mode );
+
+ /// Validate a list of QoS properties for an event
+ /**
+ * Applications send events with specific QoS properties, the
+ * following operation allows consumers to verify if a given set
+ * of QoS properties would be honored by the proxy.
+ *
+ * @param required_qos The QoS properties required by the supplier
+ * @param available_qos If the QoS properties required are
+ * supported this argument returns any other QoS properties that
+ * the application may set without breaking the proxy
+ * capabilities.
+ * @throws CosNotification::UnsupportedQoS if the QoS properties
+ * required cannot be supported. The exception describes the
+ * problems and any legal values in detail.
+ */
+ void validate_event_qos (
+ in CosNotification::QoSProperties required_qos,
+ out CosNotification::NamedPropertyRangeSeq available_qos)
+ raises (CosNotification::UnsupportedQoS);
+ };
+
+ /**
+ * @interface ProxyPushConsumer
+ *
+ * @brief Defines the interface provided for push-style suppliers
+ * using the 'any' event format.
+ */
+ interface ProxyPushConsumer
+ : ProxyConsumer
+ , CosNotifyComm::PushConsumer
+ {
+ /// Connect a supplier to the proxy
+ /**
+ * Suppliers cannot push events into a ProxyPushConsumer until
+ * this method is invoked.
+ *
+ * @param push_supplier the callback object used to inform the
+ * application if the event channel is destroyed. If the
+ * argument is nil no destroy notification is provided.
+ * @throws CosEventChannelAdmin::AlreadyConnected if the proxy is
+ * already connected, i.e. if this operation is invoked more than
+ * one time.
+ */
+ void connect_any_push_supplier (
+ in CosEventComm::PushSupplier push_supplier)
+ raises(CosEventChannelAdmin::AlreadyConnected);
+ };
+
+ /**
+ * @interface StructuredProxyPushConsumer
+ *
+ * @brief Defines the interface provided for push-style suppliers
+ * using the 'structured' event format.
+ */
+ interface StructuredProxyPushConsumer
+ : ProxyConsumer
+ , CosNotifyComm::StructuredPushConsumer
+ {
+ /// Connect a supplier to the proxy
+ /**
+ * Suppliers cannot push events into a ProxyPushConsumer until
+ * this method is invoked.
+ *
+ * @param push_supplier the callback object used to inform the
+ * application if the event channel is destroyed. If the
+ * argument is nil no destroy notification is provided.
+ * @throws CosEventChannelAdmin::AlreadyConnected if the proxy is
+ * already connected, i.e. if this operation is invoked more than
+ * one time.
+ */
+ void connect_structured_push_supplier (
+ in CosNotifyComm::StructuredPushSupplier push_supplier)
+ raises(CosEventChannelAdmin::AlreadyConnected);
+ };
+
+ /**
+ * @interface SequenceProxyPushConsumer
+ *
+ * @brief Defines the interface provided for push-style suppliers
+ * using the 'batched' event format.
+ */
+ interface SequenceProxyPushConsumer
+ : ProxyConsumer
+ , CosNotifyComm::SequencePushConsumer
+ {
+ /// Connect a supplier to the proxy
+ /**
+ * Suppliers cannot push events into a ProxyPushConsumer until
+ * this method is invoked.
+ *
+ * @param push_supplier the callback object used to inform the
+ * application if the event channel is destroyed. If the
+ * argument is nil no destroy notification is provided.
+ * @throws CosEventChannelAdmin::AlreadyConnected if the proxy is
+ * already connected, i.e. if this operation is invoked more than
+ * one time.
+ */
+ void connect_sequence_push_supplier (
+ in CosNotifyComm::SequencePushSupplier push_supplier)
+ raises(CosEventChannelAdmin::AlreadyConnected);
+ };
+
+#ifdef TAO_HAS_NOTIFY_PULL_INTERFACES
+
+ /**
+ * @interface ProxyPullSupplier
+ *
+ * @brief Defines the interface provided for pull-style consumers
+ * using the 'any' event format.
+ */
+ interface ProxyPullSupplier
+ : ProxySupplier
+ , CosNotifyComm::PullSupplier
+ {
+ /// Connect a consumer to the proxy
+ /**
+ * The consumer cannot pull events until this operation is invoked.
+ *
+ * @param pull_consumer the callback object used to inform the
+ * application if the event channel is destroyed. If the
+ * argument is nil no destroy notification is provided.
+ * @throws CosEventChannelAdmin::AlreadyConnected if the proxy is
+ * already connected, i.e. if this operation is invoked more than
+ * one time.
+ */
+ void connect_any_pull_consumer (
+ in CosEventComm::PullConsumer pull_consumer)
+ raises(CosEventChannelAdmin::AlreadyConnected);
+ };
+
+ /**
+ * @interface StructuredProxyPullSupplier
+ *
+ * @brief Defines the interface provided for pull-style consumers
+ * using the 'structured' event format.
+ */
+ interface StructuredProxyPullSupplier
+ : ProxySupplier
+ , CosNotifyComm::StructuredPullSupplier
+ {
+ /// Connect a consumer to the proxy
+ /**
+ * The consumer cannot pull events until this operation is invoked.
+ *
+ * @param pull_consumer the callback object used to inform the
+ * application if the event channel is destroyed. If the
+ * argument is nil no destroy notification is provided.
+ * @throws CosEventChannelAdmin::AlreadyConnected if the proxy is
+ * already connected, i.e. if this operation is invoked more than
+ * one time.
+ */
+ void connect_structured_pull_consumer (
+ in CosNotifyComm::StructuredPullConsumer pull_consumer)
+ raises(CosEventChannelAdmin::AlreadyConnected);
+ };
+
+ /**
+ * @interface SequenceProxyPullSupplier
+ *
+ * @brief Defines the interface provided for pull-style consumer
+ * using the 'batched' event format.
+ */
+ interface SequenceProxyPullSupplier
+ : ProxySupplier
+ , CosNotifyComm::SequencePullSupplier
+ {
+ /// Connect a consumer to the proxy
+ /**
+ * The consumer cannot pull events until this operation is invoked.
+ *
+ * @param pull_consumer the callback object used to inform the
+ * application if the event channel is destroyed. If the
+ * argument is nil no destroy notification is provided.
+ * @throws CosEventChannelAdmin::AlreadyConnected if the proxy is
+ * already connected, i.e. if this operation is invoked more than
+ * one time.
+ */
+ void connect_sequence_pull_consumer (
+ in CosNotifyComm::SequencePullConsumer pull_consumer)
+ raises(CosEventChannelAdmin::AlreadyConnected);
+ };
+
+ /**
+ * @interface ProxyPullConsumer
+ *
+ * @brief Defines the interface provided for pull-style suppliers
+ * using the 'any' event format.
+ */
+ interface ProxyPullConsumer
+ : ProxyConsumer
+ , CosNotifyComm::PullConsumer
+ {
+ /// Connect a supplier to the proxy
+ /**
+ * The event channel will not pull events from the supplier until
+ * this operation is invoked.
+ *
+ * @param pull_supplier the callback object used to inform the
+ * application if the event channel is destroyed.
+ * @throws CORBA::BAD_PARAM if the pull_supplier argument is nil
+ * @throws CosEventChannelAdmin::AlreadyConnected if the proxy is
+ * already connected, i.e. if this operation is invoked more than
+ * one time.
+ */
+ void connect_any_pull_supplier (
+ in CosEventComm::PullSupplier pull_supplier)
+ raises(CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError );
+
+ /// Suspend the connection, the event channel will stop pulling
+ /// events.
+ /**
+ * @throws ConnectionAlreadyInactive if the method is invoked
+ * while the connection is suspended
+ * @throws NotConnected if the method is invoked before the
+ * supplier connects
+ */
+ void suspend_connection()
+ raises(ConnectionAlreadyInactive, NotConnected);
+
+ /// Resume the connection, the event channel will start pulling
+ /// events one more.
+ /**
+ * @throws ConnectionAlreadyActive if the method is invoked
+ * while the connection is active
+ * @throws NotConnected if the method is invoked before the
+ * supplier connects
+ */
+ void resume_connection()
+ raises(ConnectionAlreadyActive, NotConnected);
+ };
+
+ /**
+ * @interface StructuredProxyPullConsumer
+ *
+ * @brief Defines the interface provided for pull-style suppliers
+ * using the 'structured' event format.
+ */
+ interface StructuredProxyPullConsumer
+ : ProxyConsumer
+ , CosNotifyComm::StructuredPullConsumer
+ {
+ /// Connect a supplier to the proxy
+ /**
+ * The event channel will not pull events from the supplier until
+ * this operation is invoked.
+ *
+ * @param pull_supplier the callback object used to inform the
+ * application if the event channel is destroyed.
+ * @throws CORBA::BAD_PARAM if the pull_supplier argument is nil
+ * @throws CosEventChannelAdmin::AlreadyConnected if the proxy is
+ * already connected, i.e. if this operation is invoked more than
+ * one time.
+ */
+ void connect_structured_pull_supplier (
+ in CosNotifyComm::StructuredPullSupplier pull_supplier)
+ raises(CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError );
+
+ /// Suspend the connection, the event channel will stop pulling
+ /// events.
+ /**
+ * @throws ConnectionAlreadyInactive if the method is invoked
+ * while the connection is suspended
+ * @throws NotConnected if the method is invoked before the
+ * supplier connects
+ */
+ void suspend_connection()
+ raises(ConnectionAlreadyInactive, NotConnected);
+
+ /// Resume the connection, the event channel will start pulling
+ /// events one more.
+ /**
+ * @throws ConnectionAlreadyActive if the method is invoked
+ * while the connection is active
+ * @throws NotConnected if the method is invoked before the
+ * supplier connects
+ */
+ void resume_connection()
+ raises(ConnectionAlreadyActive, NotConnected);
+ };
+
+ /**
+ * @interface SequenceProxyPullConsumer
+ *
+ * @brief Defines the interface provided for pull-style suppliers
+ * using the 'batched' event format.
+ */
+ interface SequenceProxyPullConsumer
+ : ProxyConsumer
+ , CosNotifyComm::SequencePullConsumer
+ {
+ /// Connect a supplier to the proxy
+ /**
+ * The event channel will not pull events from the supplier until
+ * this operation is invoked.
+ *
+ * @param pull_supplier the callback object used to inform the
+ * application if the event channel is destroyed.
+ * @throws CORBA::BAD_PARAM if the pull_supplier argument is nil
+ * @throws CosEventChannelAdmin::AlreadyConnected if the proxy is
+ * already connected, i.e. if this operation is invoked more than
+ * one time.
+ */
+ void connect_sequence_pull_supplier (
+ in CosNotifyComm::SequencePullSupplier pull_supplier)
+ raises(CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError );
+
+ /// Suspend the connection, the event channel will stop pulling
+ /// events.
+ /**
+ * @throws ConnectionAlreadyInactive if the method is invoked
+ * while the connection is suspended
+ * @throws NotConnected if the method is invoked before the
+ * supplier connects
+ */
+ void suspend_connection()
+ raises(ConnectionAlreadyInactive, NotConnected);
+
+ /// Resume the connection, the event channel will start pulling
+ /// events one more.
+ /**
+ * @throws ConnectionAlreadyActive if the method is invoked
+ * while the connection is active
+ * @throws NotConnected if the method is invoked before the
+ * supplier connects
+ */
+ void resume_connection()
+ raises(ConnectionAlreadyActive, NotConnected);
+ };
+#endif /* TAO_HAS_NOTIFY_PULL_INTERFACES */
+
+ /**
+ * @interface ProxyPushSupplier
+ *
+ * @brief Defines the interface provided for push-style consumers
+ * using the 'any' event format.
+ */
+ interface ProxyPushSupplier
+ : ProxySupplier
+ , CosNotifyComm::PushSupplier
+ {
+ /// Connect a consumer to the proxy
+ /**
+ * The event channel will not push events to the consumer until
+ * this operation is invoked.
+ *
+ * @param push_consumer the callback object used to push events to
+ * the application and inform if the event channel is destroyed
+ * @throws CORBA::BAD_PARAM if the push_consumer argument is nil
+ * @throws CosEventChannelAdmin::AlreadyConnected if the proxy is
+ * already connected, i.e. if this operation is invoked more than
+ * one time.
+ */
+ void connect_any_push_consumer (
+ in CosEventComm::PushConsumer push_consumer)
+ raises(CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError );
+
+ /// Suspend the connection, the event channel will stop pushing
+ /// events to the consumer.
+ /**
+ * @throws ConnectionAlreadyInactive if the method is invoked
+ * while the connection is suspended
+ * @throws NotConnected if the method is invoked before the
+ * supplier connects
+ */
+ void suspend_connection()
+ raises(ConnectionAlreadyInactive, NotConnected);
+
+ /// Resume the connection, the event channel will start pushing
+ /// events to the consumer once more
+ /**
+ * @throws ConnectionAlreadyActive if the method is invoked
+ * while the connection is active
+ * @throws NotConnected if the method is invoked before the
+ * supplier connects
+ */
+ void resume_connection()
+ raises(ConnectionAlreadyActive, NotConnected);
+ };
+
+ /**
+ * @interface StructuredProxyPushSupplier
+ *
+ * @brief Defines the interface provided for push-style consumers
+ * using the 'structured' event format.
+ */
+ interface StructuredProxyPushSupplier
+ : ProxySupplier
+ , CosNotifyComm::StructuredPushSupplier
+ {
+ /// Connect a consumer to the proxy
+ /**
+ * The event channel will not push events to the consumer until
+ * this operation is invoked.
+ *
+ * @param push_consumer the callback object used to push events to
+ * the application and inform if the event channel is destroyed
+ * @throws CORBA::BAD_PARAM if the push_consumer argument is nil
+ * @throws CosEventChannelAdmin::AlreadyConnected if the proxy is
+ * already connected, i.e. if this operation is invoked more than
+ * one time.
+ */
+ void connect_structured_push_consumer (
+ in CosNotifyComm::StructuredPushConsumer push_consumer)
+ raises(CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError );
+
+ /// Suspend the connection, the event channel will stop pushing
+ /// events to the consumer.
+ /**
+ * @throws ConnectionAlreadyInactive if the method is invoked
+ * while the connection is suspended
+ * @throws NotConnected if the method is invoked before the
+ * supplier connects
+ */
+ void suspend_connection()
+ raises(ConnectionAlreadyInactive, NotConnected);
+
+ /// Resume the connection, the event channel will start pushing
+ /// events to the consumer once more
+ /**
+ * @throws ConnectionAlreadyActive if the method is invoked
+ * while the connection is active
+ * @throws NotConnected if the method is invoked before the
+ * supplier connects
+ */
+ void resume_connection()
+ raises(ConnectionAlreadyActive, NotConnected);
+ };
+
+ /**
+ * @interface SequenceProxyPushSupplier
+ *
+ * @brief Defines the interface provided for push-style consumers
+ * using the 'batched' event format.
+ */
+ interface SequenceProxyPushSupplier
+ : ProxySupplier
+ , CosNotifyComm::SequencePushSupplier
+ {
+ /// Connect a consumer to the proxy
+ /**
+ * The event channel will not push events to the consumer until
+ * this operation is invoked.
+ *
+ * @param push_consumer the callback object used to push events to
+ * the application and inform if the event channel is destroyed
+ * @throws CORBA::BAD_PARAM if the push_consumer argument is nil
+ * @throws CosEventChannelAdmin::AlreadyConnected if the proxy is
+ * already connected, i.e. if this operation is invoked more than
+ * one time.
+ */
+ void connect_sequence_push_consumer (
+ in CosNotifyComm::SequencePushConsumer push_consumer)
+ raises(CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError );
+
+ /// Suspend the connection, the event channel will stop pushing
+ /// events to the consumer.
+ /**
+ * @throws ConnectionAlreadyInactive if the method is invoked
+ * while the connection is suspended
+ * @throws NotConnected if the method is invoked before the
+ * supplier connects
+ */
+ void suspend_connection()
+ raises(ConnectionAlreadyInactive, NotConnected);
+
+ /// Resume the connection, the event channel will start pushing
+ /// events to the consumer once more
+ /**
+ * @throws ConnectionAlreadyActive if the method is invoked
+ * while the connection is active
+ * @throws NotConnected if the method is invoked before the
+ * supplier connects
+ */
+ void resume_connection()
+ raises(ConnectionAlreadyActive, NotConnected);
+ };
+
+ /// Each proxy is assigned a unique ID by its proxy admin
+ typedef long ProxyID;
+ /// Helper type to query or fetch multiple IDs simulatenously
+ typedef sequence <ProxyID> ProxyIDSeq;
+
+ /**
+ * @enum ClientType
+ *
+ * @brief Helper type used to fetch proxies
+ */
+ enum ClientType {
+ /// The proxy uses the 'any' event format
+ ANY_EVENT,
+ /// The proxy uses the 'structured' event format
+ STRUCTURED_EVENT,
+ /// The proxy uses the 'sequence' (or batch) event format
+ SEQUENCE_EVENT
+ };
+
+ /**
+ * @enum InterFilterGroupOperator
+ *
+ * @brief Define how multiple Filters are considered in a proxy
+ * admin
+ */
+ enum InterFilterGroupOperator {
+ AND_OP,
+ OR_OP
+ };
+
+ /// Each proxy admin is assigned a unique number by its EventChannel
+ typedef long AdminID;
+ /// List of Admin IDs
+ typedef sequence<AdminID> AdminIDSeq;
+
+ /**
+ * @exception AdminNotFound
+ *
+ * @brief Exception raised if a lookup for a specific Admin ID
+ * fails.
+ */
+ exception AdminNotFound {};
+
+ /**
+ * @exception ProxyNotFound
+ *
+ * @brief Exception raised if a lookup for a specific Proxy ID
+ * fails.
+ */
+ exception ProxyNotFound {};
+
+ /**
+ * @struct AdminLimit
+ *
+ * @brief Helper structure to represent a violation of the limits in
+ * a proxy admin.
+ */
+ struct AdminLimit {
+ CosNotification::PropertyName name;
+ CosNotification::PropertyValue value;
+ };
+
+ /**
+ * @exception AdminLimitExceeded
+ *
+ * @brief Exception raised if a limit in a proxy admin is breached
+ */
+ exception AdminLimitExceeded {
+ /// The limit that caused the problem.
+ AdminLimit admin_property_err;
+ };
+
+ /**
+ * @interface ConsumerAdmin
+ *
+ * @brief Interface used to control and obtain the proxies used by
+ * consumers.
+ */
+ interface ConsumerAdmin
+ : CosNotification::QoSAdmin
+ , CosNotifyComm::NotifySubscribe
+ , CosNotifyFilter::FilterAdmin
+ , CosEventChannelAdmin::ConsumerAdmin
+ {
+ /// The ID assigned to this admin by its event channel
+ readonly attribute AdminID MyID;
+
+ /// The event channel this admin belongs to
+ readonly attribute EventChannel MyChannel;
+
+ /// How are multiple filters interpreted
+ readonly attribute InterFilterGroupOperator MyOperator;
+
+ /// A special mapping filter to change the priority property of
+ /// events
+ attribute CosNotifyFilter::MappingFilter priority_filter;
+
+ /// A special mapping filter to change the lifetime property of
+ /// events
+ attribute CosNotifyFilter::MappingFilter lifetime_filter;
+
+ /// Get the complete list of pull proxy suppliers
+ readonly attribute ProxyIDSeq pull_suppliers;
+
+ /// Get the complete list of push proxy suppliers
+ readonly attribute ProxyIDSeq push_suppliers;
+
+ /// Get an specific ProxySupplier
+ /**
+ * @param proxy_id The proxy ID that will be retrieved
+ * @throws ProxyNotFound if the proxy_id is not found in this
+ * ConsumerAdmin
+ */
+ ProxySupplier get_proxy_supplier (in ProxyID proxy_id)
+ raises (ProxyNotFound );
+
+ /// Create a new pull-style proxy supplier
+ /**
+ * @param ctype The event format that the ProxySupplier should
+ * support
+ * @param proxy_id The ID assigned to the new proxy supplier
+ * @return The new ProxySupplier
+ * @throws AdminLimitExceeded if a limit in this admin is reached,
+ * such as the maximum number of proxies.
+ */
+ ProxySupplier obtain_notification_pull_supplier (in ClientType ctype,
+ out ProxyID proxy_id)
+ raises ( AdminLimitExceeded );
+
+ /// Create a new push-style proxy supplier
+ /**
+ * @param ctype The event format that the ProxySupplier should
+ * support
+ * @param proxy_id The ID assigned to the new proxy supplier
+ * @return The new ProxySupplier
+ * @throws AdminLimitExceeded if a limit in this admin is reached,
+ * such as the maximum number of proxies.
+ */
+ ProxySupplier obtain_notification_push_supplier (in ClientType ctype,
+ out ProxyID proxy_id)
+ raises ( AdminLimitExceeded );
+
+ /// Destroy the Admin
+ void destroy();
+ };
+
+ /**
+ * @interface SupplierAdmin
+ *
+ * @brief Interface used to control and obtain the proxies used by
+ * suppliers.
+ */
+ interface SupplierAdmin
+ : CosNotification::QoSAdmin
+ , CosNotifyComm::NotifyPublish
+ , CosNotifyFilter::FilterAdmin
+ , CosEventChannelAdmin::SupplierAdmin
+ {
+ /// The ID assigned to this admin by its event channel
+ readonly attribute AdminID MyID;
+
+ /// The event channel this admin belongs to
+ readonly attribute EventChannel MyChannel;
+
+ /// How are multiple filters interpreted
+ readonly attribute InterFilterGroupOperator MyOperator;
+
+ /// Get the complete list of pull proxy consumers
+ readonly attribute ProxyIDSeq pull_consumers;
+
+ /// Get the complete list of push proxy consumers
+ readonly attribute ProxyIDSeq push_consumers;
+
+ /// Get an specific ProxyConsumer
+ /**
+ * @param proxy_id The proxy ID that will be retrieved
+ * @throws ProxyNotFound if the proxy_id is not found in this
+ * SupplierAdmin
+ */
+ ProxyConsumer get_proxy_consumer (in ProxyID proxy_id )
+ raises ( ProxyNotFound );
+
+ /// Create a new pull-style proxy consumer
+ /**
+ * @param ctype The event format that the ProxyConsumer should
+ * support
+ * @param proxy_id The ID assigned to the new proxy consumer
+ * @return The new ProxyConsumer
+ * @throws AdminLimitExceeded if a limit in this admin is reached,
+ * such as the maximum number of proxies.
+ */
+ ProxyConsumer obtain_notification_pull_consumer (in ClientType ctype,
+ out ProxyID proxy_id)
+ raises ( AdminLimitExceeded );
+
+ /// Create a new push-style proxy consumer
+ /**
+ * @param ctype The event format that the ProxyConsumer should
+ * support
+ * @param proxy_id The ID assigned to the new proxy consumer
+ * @return The new ProxySupplier
+ * @throws AdminLimitExceeded if a limit in this admin is reached,
+ * such as the maximum number of proxies.
+ */
+ ProxyConsumer obtain_notification_push_consumer (in ClientType ctype,
+ out ProxyID proxy_id)
+ raises ( AdminLimitExceeded );
+
+ /// Destroy the Admin
+ void destroy();
+ };
+
+ /**
+ * @interface EventChannel
+ *
+ * @brief Defines the interface to control an use an event channel
+ */
+ interface EventChannel
+ : CosNotification::QoSAdmin
+ , CosNotification::AdminPropertiesAdmin
+ , CosEventChannelAdmin::EventChannel
+ {
+ /// The factory this event channel belongs to
+ readonly attribute EventChannelFactory MyFactory;
+
+ /// The default consumer admin
+ readonly attribute ConsumerAdmin default_consumer_admin;
+
+ /// The default supplier admin
+ readonly attribute SupplierAdmin default_supplier_admin;
+
+ /// The default filter factory for this event channel
+ readonly attribute CosNotifyFilter::FilterFactory default_filter_factory;
+
+ /// Create a new consumer admin
+ /**
+ * @param op Defines how multiple filters would be interpreted in
+ * the new consumer admin
+ * @param id Returns the ID assigned to the new consumer admin
+ * @return The new consumer admin
+ */
+ ConsumerAdmin new_for_consumers(in InterFilterGroupOperator op,
+ out AdminID id );
+
+ /// Create a new supplier admin
+ /**
+ * @param op Defines how multiple filters would be interpreted in
+ * the new supplier admin
+ * @param id Returns the ID assigned to the new supplier admin
+ * @return The new supplier admin
+ */
+ SupplierAdmin new_for_suppliers(in InterFilterGroupOperator op,
+ out AdminID id );
+
+ /// Fetch an specific consumer admin based on its ID
+ /**
+ * @param id The id of the consumer that should be returned
+ * @return The consumer admin assigned the given ID
+ * @throws AdminNotFound if there is no consumer admin with the ID
+ * provided
+ */
+ ConsumerAdmin get_consumeradmin ( in AdminID id )
+ raises (AdminNotFound);
+
+ /// Fetch an specific supplier admin based on its ID
+ /**
+ * @param id The id of the supplier that should be returned
+ * @return The supplier admin assigned the given ID
+ * @throws AdminNotFound if there is no supplier admin with the ID
+ * provided
+ */
+ SupplierAdmin get_supplieradmin ( in AdminID id )
+ raises (AdminNotFound);
+
+ /// Get the IDs of all the consumer admins
+ AdminIDSeq get_all_consumeradmins();
+
+ /// Get the IDs of all the supplier admins
+ AdminIDSeq get_all_supplieradmins();
+ };
+
+ /// Each event channel is assigned a unique ID by its factory
+ typedef long ChannelID;
+
+ /// Helper type used to return the complete list of event channel
+ /// IDs
+ typedef sequence<ChannelID> ChannelIDSeq;
+
+ /**
+ * @exception ChannelNotFound
+ *
+ * @brief Exception raised if an specific ChannelID is not found.
+ */
+ exception ChannelNotFound {};
+
+ /**
+ * @interface EventChannelFactory
+ *
+ * @brief Defines the interface used to build event channels
+ */
+ interface EventChannelFactory {
+ /// Create a new event channel
+ /**
+ * @param initial_qos Configure the initial QoS properties of the
+ * new EventChannel
+ * @param initial_admin Configure the initial Admin properties of
+ * the new EventChannel
+ * @param id Returns the ID assigned to the new EventChannel
+ * @return The new event channel
+ * @throws CosNotification::UnsupportedQoS if the requested QoS
+ * properties cannot be satisfied or are invalid
+ * @throws CosNotification::UnsupportedAdmin if the requested
+ * admin properties cannot be satisfied or are invalid
+ */
+ EventChannel create_channel (in CosNotification::QoSProperties initial_qos,
+ in CosNotification::AdminProperties initial_admin,
+ out ChannelID id)
+ raises(CosNotification::UnsupportedQoS,
+ CosNotification::UnsupportedAdmin );
+
+ /// Get the complete list of event channels in this factory
+ ChannelIDSeq get_all_channels();
+
+ /// Get an event channel given its ID
+ /**
+ * @param id The ID of the event channel the application wants
+ * @return The event channel
+ * @throws ChannelNotFound if the give ID is unknown on this
+ * factory
+ */
+ EventChannel get_event_channel ( in ChannelID id )
+ raises (ChannelNotFound);
+ };
+};
+
+#pragma prefix ""
+
+#endif /* _COS_NOTIFY_CHANNEL_ADMIN_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/CosNotifyComm.idl b/TAO/orbsvcs/orbsvcs/CosNotifyComm.idl
new file mode 100644
index 00000000000..59a19564db8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosNotifyComm.idl
@@ -0,0 +1,387 @@
+/**
+ * @file CosNotifyComm.idl
+ *
+ * @brief Define the CosNotifyComm module
+ *
+ * $Id$
+ *
+ * This module is taken from the standard CORBA Notification Service
+ * 1.0, as described in:
+ *
+ * http://www.omg.org/technology/documents/formal/notification_service.htm
+ *
+ * In particular the following two documents were used:
+ * formal/2000-06-20
+ * formal/01-03-03
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ */
+
+#ifndef _COS_NOTIFY_COMM_IDL_
+#define _COS_NOTIFY_COMM_IDL_
+
+#include "CosNotification.idl"
+#include "CosEventComm.idl"
+
+#pragma prefix "omg.org"
+
+/**
+ * @namespace CosNotifyComm
+ *
+ * @brief Define the interfaces implemented by users of the CORBA
+ * Notification Service.
+ */
+module CosNotifyComm
+{
+ /**
+ * @exception InvalidEventType
+ *
+ * @brief Exception raised to indicate that an EventType is
+ * syntactically or semantically invalid.
+ */
+ exception InvalidEventType {
+ /// Type of invalid event
+ CosNotification::_EventType type;
+ };
+
+ /**
+ * @interface NotifyPublish
+ *
+ * @brief Defines interface to report changes in the events
+ * published to a consumer.
+ *
+ * Interfaces that represent consumers (or the consumer aspects of
+ * an Notification Service) provide this interface to receive
+ * notifications in the list of events they support.
+ */
+ interface NotifyPublish {
+ /// Report a change in the list of publications.
+ /**
+ * @param added The list of new event types that the consumer can
+ * expect.
+ * @param removed The list of event types that the consumer should
+ * no longer expect.
+ * @throws InvalidEventType if the one or more event types
+ * provided is invalid
+ */
+ void offer_change (in CosNotification::EventTypeSeq added,
+ in CosNotification::EventTypeSeq removed )
+ raises ( InvalidEventType );
+ };
+
+ /**
+ * @interface NotifySubscribe
+ *
+ * @brief Defines interface to report changes in the events required
+ * from a supplier.
+ *
+ * Interfaces that represent suppliers (or the supplier aspects of
+ * the Notification Service) provide this interface to receive
+ * changes
+ */
+ interface NotifySubscribe {
+ /// Report a change in the list of subscriptions
+ /**
+ * @param added The list of new event types that are interesting
+ * for the supplier's peer.
+ * @param removed The list of event types that are no longer
+ * interesting for the supplier's peer.
+ * @throws InvalidEventType if the one or more event types
+ * provided is invalid
+ */
+ void subscription_change(in CosNotification::EventTypeSeq added,
+ in CosNotification::EventTypeSeq removed )
+ raises ( InvalidEventType );
+ };
+
+ /**
+ * @interface PushConsumer
+ *
+ * @brief Defines the interface used by push-style consumers
+ *
+ * Push-style consumers passively accept events as anys.
+ */
+ interface PushConsumer :
+ NotifyPublish,
+ CosEventComm::PushConsumer {
+ };
+
+#ifdef TAO_HAS_NOTIFY_PULL_INTERFACES
+ /**
+ * @interface PullConsumer
+ *
+ * @brief Defines the interface used by pull-style consumers
+ *
+ * Pull-style consumer actively query the Notification Service to
+ * receive events.
+ */
+ interface PullConsumer :
+ NotifyPublish,
+ CosEventComm::PullConsumer {
+ };
+
+ /**
+ * @interface PullSupplier
+ *
+ * @brief Defines the interface used by pull-style suppliers
+ *
+ * Pull-style suppliers passively provide events to the Notification
+ * Service.
+ */
+ interface PullSupplier :
+ NotifySubscribe,
+ CosEventComm::PullSupplier {
+ };
+#endif /* TAO_HAS_NOTIFY_PULL_INTERFACES */
+ /**
+ * @interface PushSupplier
+ *
+ * @brief Defines the interface used by push-style suppliers
+ *
+ * Push-style suppliers actively provide events to the Notifcation
+ * Service.
+ */
+ interface PushSupplier :
+ NotifySubscribe,
+ CosEventComm::PushSupplier {
+ };
+
+ /**
+ * @interface StructuredPushConsumer
+ *
+ * @brief Defines the interface used by push-style consumers of
+ * structured events
+ *
+ * Push-style consumers passively receive events from the
+ * Notification Service. The events are provided using the
+ * CosNotification::StructuredEvent structure.
+ */
+ interface StructuredPushConsumer : NotifyPublish {
+ /// Receive one structured event
+ /**
+ * This operation is invoked to provide one event to the
+ * consumer.
+ * @throws CosEventComm::Disconnected if the object considers
+ * itself no longer connected to its peer.
+ */
+ void push_structured_event(
+ in CosNotification::StructuredEvent notification)
+ raises(CosEventComm::Disconnected);
+
+ /// The peer has disconnected
+ /**
+ * This operation is invoked by the consumer peer when it wishes
+ * to disconnect. The consumer can safely assume that no more
+ * events will follow this request.
+ */
+ void disconnect_structured_push_consumer();
+ };
+
+#ifdef TAO_HAS_NOTIFY_PULL_INTERFACES
+ /**
+ * @interface StructuredPullConsumer
+ *
+ * @brief Defines the interface used by pull-style consumers of
+ * structured events
+ *
+ * Pull-style consumers actively retrieve events from the
+ * Notification Service. The events use the
+ * CosNotification::StructuredEvent format.
+ */
+ interface StructuredPullConsumer : NotifyPublish {
+ /// The peer has disconnected
+ /**
+ * This operation is invoked by the consumer peer when it wishes
+ * to disconnect. The consumer can safely assume that no more
+ * events will follow this request.
+ */
+ void disconnect_structured_pull_consumer();
+ };
+
+ /**
+ * @interface StructuredPullSupplier
+ *
+ * @brief Defines the interface used by pull-style suppliers of
+ * structured events
+ *
+ * Pull-style suppliers passively generate events for the
+ * Notification Service. The events use the
+ * CosNotification::StructuredEvent format.
+ */
+ interface StructuredPullSupplier : NotifySubscribe {
+ /// Pull (blocking) one event from the supplier.
+ /**
+ * This operation should block until the next event becomes
+ * available.
+ * @throws CosEventComm::Disconnected if the object considers
+ * itself no longer connected to its peer.
+ */
+ CosNotification::StructuredEvent pull_structured_event()
+ raises(CosEventComm::Disconnected);
+
+ /// Pull (non-blocking) one event from the supplier.
+ /**
+ * The try_pull operation does not block: if the event data is
+ * available, it returns the event data and sets the has_event
+ * parameter to true; if the event is not available, it sets the
+ * has_event parameter to false and the event data is returned
+ * as long with an undefined value.
+ * @throws CosEventComm::Disconnected if the object considers
+ * itself no longer connected to its peer.
+ */
+ CosNotification::StructuredEvent try_pull_structured_event(
+ out boolean has_event)
+ raises(CosEventComm::Disconnected);
+
+ /// The peer has disconnected
+ /**
+ * This operation is invoked by the consumer peer when it wishes
+ * to disconnect. The consumer can safely assume that no more
+ * events will follow this request.
+ */
+ void disconnect_structured_pull_supplier();
+ };
+#endif /* TAO_HAS_NOTIFY_PULL_INTERFACES */
+
+ /**
+ * @interface StructuredPushSupplier
+ *
+ * @brief Defines the interface used by push-style suppliers that
+ * provide structure events.
+ *
+ * Push-style suppliers actively provide events, in this case using
+ * the CosEventComm::StructuredEvent format.
+ */
+ interface StructuredPushSupplier : NotifySubscribe {
+ /// The peer has disconnected
+ /**
+ * This operation is invoked by the consumer peer when it wishes
+ * to disconnect. The consumer can safely assume that no more
+ * events will follow this request.
+ */
+ void disconnect_structured_push_supplier();
+ };
+
+ /**
+ * @interface SequencePushConsumer
+ *
+ * @brief Defines the interface used by push-style consumers that
+ * interested in event batches.
+ *
+ * Push-style consumer passively accept events, in this case
+ * multiple events can be delivered simulatneously.
+ */
+ interface SequencePushConsumer : NotifyPublish {
+ /// Receive an event batch
+ /**
+ * This operation is invoked to provide an event batch to the
+ * consumer.
+ * @throws CosEventComm::Disconnected if the object considers
+ * itself no longer connected to its peer.
+ */
+ void push_structured_events(
+ in CosNotification::EventBatch notifications)
+ raises(CosEventComm::Disconnected);
+
+ /// The peer has disconnected
+ /**
+ * This operation is invoked by the consumer peer when it wishes
+ * to disconnect. The consumer can safely assume that no more
+ * events will follow this request.
+ */
+ void disconnect_sequence_push_consumer();
+ };
+
+#ifdef TAO_HAS_NOTIFY_PULL_INTERFACES
+
+/**
+ * @interface SequencePullConsumer
+ *
+ * @brief Defines the interface used by pull-style consumers that
+ * deal with event batches.
+ *
+ * Pull-style consumer actively query the Notification Service for
+ * events, this particular interface can obtain multiple events
+ * simultaneously.
+ */
+ interface SequencePullConsumer : NotifyPublish {
+ /// The peer has disconnected
+ /**
+ * This operation is invoked by the consumer peer when it wishes
+ * to disconnect. The consumer can safely assume that no more
+ * events will follow this request.
+ */
+ void disconnect_sequence_pull_consumer();
+ };
+
+ /**
+ * @interface SequencePullSupplier
+ *
+ * @brief Defines the interface used by pull-style suppliers that
+ * provide event batches.
+ *
+ * Pull-style suppliers passively provide events to the Notification
+ * Service. This particular interface can provide multiple events
+ * simultaneously.
+ */
+ interface SequencePullSupplier : NotifySubscribe {
+ /// Pull (blocking) an event batch from the supplier
+ /**
+ * @param max_number Maximum number of events expected by the
+ * caller.
+ * @throws CosEventComm::Disconnected if the object considers
+ * itself no longer connected to its peer.
+ */
+ CosNotification::EventBatch pull_structured_events(
+ in long max_number )
+ raises(CosEventComm::Disconnected);
+
+ /// Pull (non-blocking) an event batch from the supplier
+ /**
+ * @param max_number Maximum number of events expected by the
+ * caller.
+ * @param has_event Return FALSE if there are no events available,
+ * TRUE otherwise.
+ * @throws CosEventComm::Disconnected if the object considers
+ * itself no longer connected to its peer.
+ */
+ CosNotification::EventBatch try_pull_structured_events(
+ in long max_number,
+ out boolean has_event)
+ raises(CosEventComm::Disconnected);
+
+ /// The peer has disconnected
+ /**
+ * This operation is invoked by the consumer peer when it wishes
+ * to disconnect. The consumer can safely assume that no more
+ * events will follow this request.
+ */
+ void disconnect_sequence_pull_supplier();
+ };
+
+#endif /* TAO_HAS_NOTIFY_PULL_INTERFACES */
+
+ /**
+ * @interface SequencePushSupplier
+ *
+ * @brief Defines the interface used by push-style suppliers that
+ * provide event batches.
+ *
+ * Push-style suppliers actively generate events for the
+ * Notification Service. This particular interface can provide
+ * multiple events simultaneously.
+ */
+ interface SequencePushSupplier : NotifySubscribe {
+ /// The peer has disconnected
+ /**
+ * This operation is invoked by the consumer peer when it wishes
+ * to disconnect. The consumer can safely assume that no more
+ * events will follow this request.
+ */
+ void disconnect_sequence_push_supplier();
+ };
+};
+
+#pragma prefix ""
+
+#endif /* _COS_NOTIFY_COMM_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/CosNotifyFilter.idl b/TAO/orbsvcs/orbsvcs/CosNotifyFilter.idl
new file mode 100644
index 00000000000..1326fb193bd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosNotifyFilter.idl
@@ -0,0 +1,505 @@
+/**
+ * @file CosNotifyFilter.idl
+ *
+ * @brief Defines the CosNotifyFilter module
+ *
+ * $Id$
+ *
+ * This module is taken from the standard CORBA Notification Service
+ * 1.0, as described in:
+ *
+ * http://www.omg.org/technology/documents/formal/notification_service.htm
+ *
+ * In particular the following two documents were used:
+ * formal/2000-06-20
+ * formal/01-03-03
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ */
+
+#ifndef _COS_NOTIFY_FILTER_IDL_
+#define _COS_NOTIFY_FILTER_IDL_
+
+#include <orb.idl>
+
+#include "CosNotifyComm.idl"
+
+#pragma prefix "omg.org"
+
+/**
+ * @namespace CosNotifyFilter
+ *
+ * @brief Defines the interfaces used in Event Filtering
+ */
+module CosNotifyFilter
+{
+ /// Constraints are assigned IDs by each Filter object, and can be
+ /// modified using those IDs.
+ typedef long ConstraintID;
+
+ /**
+ * @struct ConstraintExp
+ *
+ * @brief Defines a constraint expression.
+ */
+ struct ConstraintExp {
+ /// The list of event types accepted
+ CosNotification::EventTypeSeq event_types;
+ /// A constraint (or filtering) expression
+ string constraint_expr;
+ };
+
+ /// A sequence of constraint IDs
+ typedef sequence<ConstraintID> ConstraintIDSeq;
+
+ /// A sequence of constraint expressions
+ typedef sequence<ConstraintExp> ConstraintExpSeq;
+
+ /**
+ * @struct ConstraintInfo
+ *
+ * @brief Helper data structure to modify a constraint expression.
+ */
+ struct ConstraintInfo {
+ /// New constraint expression
+ ConstraintExp constraint_expression;
+ /// ID of the expression modified
+ ConstraintID constraint_id;
+ };
+
+ /// Sequence of Constraint infos, modify multiple constraints.
+ typedef sequence<ConstraintInfo> ConstraintInfoSeq;
+
+ /**
+ * @struct MappingConstraintPair
+ *
+ * @brief Helper structure used to modify a mapping constraint
+ * expression.
+ */
+ struct MappingConstraintPair {
+ /// Constraint expression
+ ConstraintExp constraint_expression;
+ /// Value to set in the property if the constraint expression
+ /// matches
+ any result_to_set;
+ };
+
+ /// Sequence of mapping constraint pairs
+ typedef sequence<MappingConstraintPair> MappingConstraintPairSeq;
+
+ /**
+ * @struct MappingConstraintInfo
+ *
+ * @brief Helper structure used to represent a mapping constraint,
+ * its property value and the ID assigned to it in a MappingFilter.
+ */
+ struct MappingConstraintInfo {
+ ConstraintExp constraint_expression;
+ ConstraintID constraint_id;
+ any value;
+ };
+ /// A list of MappingConstraintInfo
+ typedef sequence<MappingConstraintInfo> MappingConstraintInfoSeq;
+
+ /// Each callback object receives a unique ID when it is attached to
+ /// a Filter
+ typedef long CallbackID;
+
+ /// Batch management of callback objects in the Filter interface
+ typedef sequence<CallbackID> CallbackIDSeq;
+
+ /**
+ * @exception UnsupportedFilterableData
+ *
+ * @brief Exception raised when an event with unsupported filtered
+ * data is tested against a Filter.
+ */
+ exception UnsupportedFilterableData {};
+
+ /**
+ * @exception InvalidGrammar
+ *
+ * @brief Exception raised if the filtering expression is using an
+ * invalid grammar.
+ */
+ exception InvalidGrammar {};
+
+ /**
+ * @exception InvalidConstraint
+ *
+ * @brief Exception raised if a constraint's grammar does not match
+ * the Filter grammar.
+ *
+ * The constraint that is deemed invalid is returned as part of the
+ * exception.
+ */
+ exception InvalidConstraint {
+ /// Constraint that caused the problem
+ ConstraintExp constr;
+ };
+
+ /**
+ * @exception DuplicateConstraintID
+ *
+ * @brief Exception raised if a duplicate ID is used while modifying
+ * or removing multiple constraints.
+ */
+ exception DuplicateConstraintID {
+ /// ID causing the problem
+ ConstraintID id;
+ };
+
+ /**
+ * @exception ConstraintNotFound
+ *
+ * @brief Exception raised if a constraint ID is not found while
+ * modifying or removing multiple constraints.
+ */
+ exception ConstraintNotFound {
+ /// ID causing the problem
+ ConstraintID id;
+ };
+
+ /**
+ * @exception CallbackNotFound
+ *
+ * @brief Exception raised if the application tries to remove a
+ * Filter callback that does not exists.
+ */
+ exception CallbackNotFound {};
+
+ /**
+ * @exception InvalidValue
+ *
+ * @brief Exception raised if a modification or addition of a
+ * mapping constraint does not matches the mapping filter type.
+ */
+ exception InvalidValue {
+ /// Constraint expression that cause the problem
+ ConstraintExp constr;
+ /// Value that caused the problem
+ any value;
+ };
+
+ /**
+ * @interface Filter
+ *
+ * @brief Interface used to manipulate and evaluate filters.
+ *
+ * An event filter posseses multiple constraints, each constraint
+ * applies to a limited range of event types, the filter is accepted
+ * if it matches one or more constraint expressions that apply to
+ * its event type.
+ */
+ interface Filter {
+ /// Constraint grammar used in this filter
+ /**
+ * All filtering expressions in the filter should use this
+ * grammar.
+ */
+ readonly attribute string constraint_grammar;
+
+ /// Add constraints to a filter
+ /**
+ * Return the constraints and their IDs.
+ *
+ * @throws InvalidConstraint if one or more constraints contain
+ * invalid an invalid expression in the Filter constraint
+ * grammar.
+ */
+ ConstraintInfoSeq add_constraints (
+ in ConstraintExpSeq constraint_list)
+ raises (InvalidConstraint);
+
+ /// Modify and/or remove multiple constraints in the Filter
+ /**
+ * The operation can raise InvalidConstraint if one or more
+ * constraints contain invalid expressions in the constraint
+ * grammar.
+ *
+ * @param del_list List of constraint IDs to be removed
+ * @param modify_list List of constrained modified
+ *
+ * @throws ConstraintNotFound If one or more of the ConstraintID
+ * supplied are not found.
+ */
+ void modify_constraints (
+ in ConstraintIDSeq del_list,
+ in ConstraintInfoSeq modify_list)
+ raises (InvalidConstraint, ConstraintNotFound);
+
+ /// Obtain the one or more constraints given their IDs
+ /**
+ * @param id_list List of IDs queried
+ *
+ * @throws ConstraintNotFound if one or more of
+ * the ConstraintID supplied are not found.
+ */
+ ConstraintInfoSeq get_constraints(
+ in ConstraintIDSeq id_list)
+ raises (ConstraintNotFound);
+
+ /// The all the constraints in the Filter
+ ConstraintInfoSeq get_all_constraints();
+
+ /// Remove all the constraints from the Filter
+ void remove_all_constraints();
+
+ /// Destroy the Filter
+ void destroy();
+
+ /// Match a regular event against the constraints in the filter
+ /**
+ * @param filterable_data The Notification Service event to be
+ * tested against the constraints in this Filter
+ * @return TRUE if at least one constraint evaluates to TRUE for
+ * the event.
+ * @throws UnsupportedFilterableData if the event contents do not
+ * match the filtering expression, for example, if the
+ * expression for a filterable field expects a string, but the
+ * actual value is a number.
+ */
+ boolean match ( in any filterable_data )
+ raises (UnsupportedFilterableData);
+
+ /// Match a structured event against the constraints in the filter
+ /**
+ * @param filterable_data The Notification Service event to be
+ * tested against the constraints in this Filter
+ * @return TRUE if at least one constraint expression evaluates
+ * to TRUE for the event.
+ * @throws UnsupportedFilterableData if the event contents do not
+ * match the filtering expression, for example, if the
+ * expression for a filterable field expects a string, but the
+ * actual value is a number.
+ */
+ boolean match_structured (
+ in CosNotification::StructuredEvent filterable_data )
+ raises (UnsupportedFilterableData);
+
+ /// Match a typed event against the constraints in the filter
+ /**
+ * @param filterable_data The sequence of properties that make the
+ * filterable portion of the Typed event.
+ * @return TRUE if at least one constraint expression evaluates
+ * to TRUE for the event.
+ * @throws UnsupportedFilterableData if the event contents do not
+ * match the filtering expression, for example, if the
+ * expression for a filterable field expects a string, but the
+ * actual value is a number.
+ */
+ boolean match_typed (
+ in CosNotification::PropertySeq filterable_data )
+ raises (UnsupportedFilterableData);
+
+ /// Add a callback interface to the filter
+ /**
+ * Filters can communicate changes in the list of event types they
+ * potentially accept.
+ *
+ * @param callback the object interested about changes in the
+ * Filter event type list.
+ * @return A unique ID attached to the callback interface.
+ */
+ CallbackID attach_callback (
+ in CosNotifyComm::NotifySubscribe callback);
+
+ /// Remove a callback interface from the filter
+ /**
+ * @param callback The ID of the callback removed
+ *
+ * @throws CallbackNotFound if the callback id supplied is not
+ * found in the internal list of callbacks.
+ */
+ void detach_callback ( in CallbackID callback)
+ raises ( CallbackNotFound );
+
+ /// Return all the callback IDs in the Filter object
+ CallbackIDSeq get_callbacks();
+ };
+
+ /**
+ * @interface MappingFilter
+ *
+ * @brief Mapping filters can be used to change properties of an
+ * event as it traverses the Notification Service.
+ */
+ interface MappingFilter {
+ /// Return the constraint grammar used in the mapping filter
+ readonly attribute string constraint_grammar;
+
+ /// Return the type code for the property affected by this mapping
+ /// filter
+ readonly attribute CORBA::TypeCode value_type;
+
+ /// Return the default value set by this mapping filter
+ /**
+ * The default value is used if there are no mapping constraint
+ * expressions matching the event.
+ */
+ readonly attribute any default_value;
+
+ /// Add multiple mapping constraints to the filter
+ /**
+ * @param pair_list List of constraint expressions and the
+ * corresponding property value
+ *
+ * @return The list of constraint expressions, their values, and
+ * the IDs assigned to them in this Filter.
+ *
+ * @throws InvalidConstraint if one or more constraint expressions
+ * do not match the constraint grammar of this mapping filter
+ * @throws InvalidValue if the value in one or more mapping
+ * constraint pairs does not match the type code for this
+ * mapping filter.
+ */
+ MappingConstraintInfoSeq add_mapping_constraints (
+ in MappingConstraintPairSeq pair_list)
+ raises (InvalidConstraint, InvalidValue);
+
+ /// Modify and/or remove mapping constraints in the filter
+ /**
+ * @param del_list list of constraint IDs that should be removed
+ * @param modify_list list of constraints that would be modified
+ *
+ * @throws InvalidConstraint if one or more constraint expressions
+ * do not match the constraint grammar of this mapping filter
+ * @throws InvalidValue if the value in one or more mapping
+ * constraint pairs does not match the type code for this
+ * mapping filter.
+ * @throws ConstraintNotFound if one or more mapping constraint
+ * IDs are not found in the filter
+ */
+ void modify_mapping_constraints (
+ in ConstraintIDSeq del_list,
+ in MappingConstraintInfoSeq modify_list)
+ raises (InvalidConstraint, InvalidValue, ConstraintNotFound);
+
+ /// Retrieve multiple mapping constraints from the filter
+ /**
+ * @param id_list the list of mapping constraint IDs requested
+ * @return The list of constraint expressions, their values and
+ * IDs.
+ * @throws ConstraintNotFound if one or more mapping constraint
+ * IDs are not found in the filter
+ */
+ MappingConstraintInfoSeq get_mapping_constraints (
+ in ConstraintIDSeq id_list)
+ raises (ConstraintNotFound);
+
+ /// Get all the mapping constraints from the Filter
+ MappingConstraintInfoSeq get_all_mapping_constraints();
+
+ /// Remove all the mapping constraints in the Filter
+ void remove_all_mapping_constraints();
+
+ /// Destroy the mapping filter
+ void destroy();
+
+ /// Test an event against the mapping constraints
+ boolean match ( in any filterable_data,
+ out any result_to_set )
+ raises (UnsupportedFilterableData);
+
+ boolean match_structured (
+ in CosNotification::StructuredEvent filterable_data,
+ out any result_to_set)
+ raises (UnsupportedFilterableData);
+
+ boolean match_typed (
+ in CosNotification::PropertySeq filterable_data,
+ out any result_to_set)
+ raises (UnsupportedFilterableData);
+ };
+
+ /**
+ * @interface FilterFactory
+ *
+ * @brief Create Filter and MappingFilter objects
+ */
+ interface FilterFactory {
+ /// Create a new Filter object
+ /**
+ * @param constraint_grammar The name of the grammar used for this
+ * filter
+ * @throws InvalidGrammar The grammar name provided is invalid or
+ * unsupported
+ */
+ Filter create_filter (in string constraint_grammar)
+ raises (InvalidGrammar);
+
+ /// Create a new MappingFilter object
+ /**
+ * @param constraint_grammar The name of the grammar used for this
+ * filter
+ * @param default_value The default property value used if no
+ * mapping constraint matches
+ * @throws InvalidGrammar The grammar name provided is invalid or
+ * unsupported
+ */
+ MappingFilter create_mapping_filter (
+ in string constraint_grammar,
+ in any default_value)
+ raises(InvalidGrammar);
+ };
+
+ /// Each filter is assigned a unique ID
+ typedef long FilterID;
+
+ /// List of filter IDs
+ typedef sequence<FilterID> FilterIDSeq;
+
+ /**
+ * @exception FilterNotFound
+ *
+ * @brief Exception raised if a filter ID is not found.
+ */
+ exception FilterNotFound {};
+
+ /**
+ * @interface FilterAdmin
+ *
+ * @brief Interface used to modify the Filters attached to a
+ * Notification Service component
+ */
+ interface FilterAdmin {
+ /// Add a filter
+ /**
+ * @param new_filter Filter to be added
+ * @return The ID assigned to the new filter
+ */
+ FilterID add_filter ( in Filter new_filter );
+
+ /// Remove a filter
+ /**
+ * @param filter ID of the filter to be removed
+ * @throws FilterNotFound if the filter ID is not found in this
+ * FilterAdmin
+ */
+ void remove_filter ( in FilterID filter )
+ raises ( FilterNotFound );
+
+ /// Get a filter
+ /**
+ * @param filter ID of the filter returned
+ * @return The filter
+ * @throws FilterNotFound if the filter ID is not found in this
+ * FilterAdmin
+ */
+ Filter get_filter ( in FilterID filter )
+ raises ( FilterNotFound );
+
+ /// Get the IDs of all the filters
+ /**
+ * @return The list of all filter IDs in this component
+ */
+ FilterIDSeq get_all_filters();
+
+ /// Remove all the filters from this component
+ void remove_all_filters();
+ };
+};
+
+#pragma prefix ""
+
+#endif /* _COS_NOTIFY_FILTER_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/CosProperty.idl b/TAO/orbsvcs/orbsvcs/CosProperty.idl
new file mode 100644
index 00000000000..47049146af2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosProperty.idl
@@ -0,0 +1,413 @@
+// -*-c++-*-
+
+// $Id$
+
+// ================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// CosProperty.idl
+//
+// = DESCRITION
+// The property service, downloaded from
+// ftp://ftp.omg.org/pub/docs/1995/95-06-01.ps
+//
+// = AUTHOR
+// Alexander Babu Arulanthu <alex@cs.wustl.edu>
+//
+// ================================================================
+
+#ifndef TAO_PROPERTY_IDL
+#define TAO_PROPERTY_IDL
+
+#include <orb.idl>
+
+#pragma prefix "omg.org"
+
+module CosPropertyService
+{
+ // = TITLE
+ // CosPropertyService : To support properties (that are typed
+ // named values dynamically associated with an object, outside
+ // of the type system.
+ //
+ // = DESCRIPTION
+ // The data types and interfaces to deal with property names,
+ // property values, property modes etc.
+
+ // = Data Types.
+
+ typedef string PropertyName;
+
+ struct Property
+ {
+ PropertyName property_name;
+ any property_value;
+ };
+
+ enum PropertyModeType
+ {
+ normal,
+ read_only,
+ fixed_normal,
+ fixed_readonly,
+ undefined
+ };
+
+ struct PropertyDef
+ {
+ PropertyName property_name;
+ any property_value;
+ PropertyModeType property_mode;
+ };
+
+ struct PropertyMode
+ {
+ PropertyName property_name;
+ PropertyModeType property_mode;
+ };
+
+ typedef sequence<PropertyName> PropertyNames;
+ typedef sequence<Property> Properties;
+ typedef sequence<PropertyDef> PropertyDefs;
+ typedef sequence<PropertyMode> PropertyModes;
+ typedef sequence<CORBA::TypeCode> PropertyTypes;
+
+ interface PropertyNamesIterator;
+ interface PropertiesIterator;
+ interface PropertySetFactory;
+ interface PropertySetDef;
+ interface PropertySet;
+
+ // = Exceptions
+
+ exception ConstraintNotSupported {};
+ exception InvalidPropertyName {};
+ exception ConflictingProperty {};
+ exception PropertyNotFound {};
+ exception UnsupportedTypeCode {};
+ exception UnsupportedProperty {};
+ exception UnsupportedMode {};
+ exception FixedProperty {};
+ exception ReadOnlyProperty {};
+
+ enum ExceptionReason
+ {
+ invalid_property_name,
+ conflicting_property,
+ property_not_found,
+ unsupported_type_code,
+ unsupported_property,
+ unsupported_mode,
+ fixed_property,
+ read_only_property
+ };
+
+ struct PropertyException
+ {
+ ExceptionReason reason;
+ PropertyName failing_property_name;
+ };
+
+ typedef sequence<PropertyException> PropertyExceptions;
+
+ exception MultipleExceptions
+ {
+ PropertyExceptions exceptions;
+ };
+
+ // = Interface Definitions.
+
+ interface PropertySetFactory
+ {
+ // = TITLE
+ // Factory class for PropertySet interface.
+ // = DESCRIPTION
+ // Support for creating PropertySets with initial
+ // constraints and properties.
+
+ PropertySet create_propertyset ();
+ // The create_propertyset operation returns a new
+ // PropertySet. It is considered an implementation issue as to
+ // whether the PropertySet contains any initial properties or
+ // has constraints.
+
+ PropertySet create_constrained_propertyset (in PropertyTypes allowed_property_types,
+ in Properties allowed_properties)
+ raises (ConstraintNotSupported);
+ // The create_constrained_propertyset operation allows a client
+ // to create a new PropertySet with specific constraints.
+
+ PropertySet create_initial_propertyset (in Properties initial_properties)
+ raises (MultipleExceptions);
+ // The create_initial_propertyset operation allows a client to
+ // create a new PropertySet with specific initial properties.
+ };
+
+ interface PropertySetDefFactory
+ {
+ // = TITLE
+ // Factory class for PropertySetDef interface.
+ // = DESCRIPTION
+ // Support for creating Propsetdefs with initial constraints
+ // and properties.
+
+ PropertySetDef create_propertysetdef ();
+ // The create_propertysetdef operation returns a new
+ // PropertySetDef.
+
+ PropertySetDef create_constrained_propertysetdef (in PropertyTypes allowed_property_types,
+ in PropertyDefs allowed_property_defs)
+ raises (ConstraintNotSupported);
+ // The create_constrained_propertysetdef operation allows a
+ // client to create a new PropertySetDef with specific
+ // constraints, including property modes.
+
+ PropertySetDef create_initial_propertysetdef (in PropertyDefs initial_property_defs)
+ raises (MultipleExceptions);
+ // The create_initial_propertysetdef operation allows a client
+ // to create a new PropertySetDef with specific initial
+ // properties, including property modes.
+ };
+
+ interface PropertySet
+ {
+ // = TITLE
+ // The PropertySet interface provides operations to define
+ // and modify properties, list and get properties, and
+ // delete properties.
+ //
+ // = DESCRIPTION
+ // Provides support for defining and modifying properties,
+ // getting properties and their names and deleting properties.
+
+ // = Support for defining and modifying properties.
+
+ void define_property (in PropertyName property_name,
+ in any property_value)
+ raises (InvalidPropertyName,
+ ConflictingProperty,
+ UnsupportedTypeCode,
+ UnsupportedProperty,
+ ReadOnlyProperty);
+ // Will modify or add a property to the PropertySet. If the
+ // property already exists, then the property type is checked
+ // before the value is overwritten. If the property does not
+ // exist, then the property is added to the PropertySet.
+
+ void define_properties (in Properties nproperties)
+ raises (MultipleExceptions);
+ // Will modify or add each of the properties in Properties
+ // parameter to the PropertySet. For each property in the list,
+ // if the property already exists, then the property type is
+ // checked before overwriting the value. If the property does
+ // not exist, then the property is added to the PropertySet.
+
+ // = Support for Getting Properties and their Names.
+
+ unsigned long get_number_of_properties ();
+ // Returns the current number of properties associated with this
+ // PropertySet.
+
+ void get_all_property_names (in unsigned long how_many,
+ out PropertyNames property_names,
+ out PropertyNamesIterator rest);
+ // Returns all of the property names currently defined in the
+ // PropertySet. If the PropertySet contains more than how_many
+ // property names, then the remaining property names are put
+ // into the PropertyNamesIterator.
+
+ any get_property_value (in PropertyName property_name)
+ raises (PropertyNotFound,
+ InvalidPropertyName);
+ // Returns the value of a property in the PropertySet.
+
+ boolean get_properties (in PropertyNames property_names,
+ out Properties nproperties);
+ // Returns the values of the properties listed in
+ // property_names.
+
+ void get_all_properties (in unsigned long how_many,
+ out Properties nproperties,
+ out PropertiesIterator rest);
+ // Returns all of the property names currently defined in the
+ // PropertySet. If the PropertySet contains more than how_many
+ // property names, then the remaining property names are put
+ // into the PropertyNamesIterator.
+
+ // = Support for Deleting Properties.
+
+ void delete_property (in PropertyName property_name)
+ raises (PropertyNotFound,
+ InvalidPropertyName,
+ FixedProperty);
+ // Deletes the specified property if it exists from a
+ // PropertySet.
+
+
+ void delete_properties (in PropertyNames property_names)
+ raises (MultipleExceptions);
+ // Deletes the properties defined in the property_names
+ // parameter. This is a batch operation that returns the
+ // MultipleExceptions exception if any delete failed.
+
+ boolean delete_all_properties ();
+ // Variation of delete_properties. Applies to all properties.
+
+ // = Support for Existence Check.
+
+ boolean is_property_defined (in PropertyName property_name)
+ raises (InvalidPropertyName);
+ // The is_property_defined operation returns true if the
+ // property is defined in the PropertySet, and returns false
+ // otherwise.
+ };
+
+ interface PropertySetDef:PropertySet
+ {
+ // = TITLE
+ // Interface to deal with the Property Modes.
+ //
+ // = DESCRIPTION
+ // The PropertySetDef interface is a specialization
+ // (subclass) of the PropertySet interface. The
+ // PropertySetDef interface provides operations to retrieve
+ // PropertySet constraints, define and modify properties
+ // with modes, and to get or set property modes.
+
+ void get_allowed_property_types (out PropertyTypes property_types);
+ // Indicates which types of properties are supported by this
+ // PropertySet. If the output sequence is empty, then there is
+ // no restrictions on the any TypeCode portion of the
+ // property_value field of a Property in this PropertySet,
+ // unless the get_allowed_properties output sequence is not empty.
+
+ void get_allowed_properties (out PropertyDefs property_defs);
+ // Indicates which properties are supported by this
+ // PropertySet. If the output sequence is empty, then there is
+ // no restrictions on the properties that can be in this
+ // PropertySet, unless the get_allowed_property_types output
+ // sequence is not empty.
+
+ void define_property_with_mode (in PropertyName property_name,
+ in any property_value,
+ in PropertyModeType property_mode)
+ raises (InvalidPropertyName,
+ ConflictingProperty,
+ UnsupportedTypeCode,
+ UnsupportedProperty,
+ UnsupportedMode,
+ ReadOnlyProperty);
+ // This operation will modify or add a property to the
+ // PropertySet. If the property already exists, then the
+ // property type is checked before the value is overwritten. The
+ // property mode is also checked to be sure a new value may be
+ // written. If the property does not exist, then the property is
+ // added to the PropertySet. To change the any TypeCode portion
+ // of the property_value of a property, a client must first
+ // delete_property, then invoke the define_property_with_mode.
+
+ void define_properties_with_modes (in PropertyDefs property_defs)
+ raises (MultipleExceptions);
+ // This operation will modify or add each of the properties in
+ // the Properties parameter to the PropertySet. For each
+ // property in the list, if the property already exists, then
+ // the property type is checked before overwriting the
+ // value. The property mode is also checked to be sure a new
+ // value may be written. If the property does not exist, then
+ // the property is added to the PropertySet. This is a batch
+ // operation that returns the MultipleExceptions exception if
+ // any define operation failed.
+
+ // = Support for Getting and Setting Property Modes.
+
+ PropertyModeType get_property_mode (in PropertyName property_name)
+ raises (PropertyNotFound,
+ InvalidPropertyName);
+ // Support for Getting and Setting Property Modes.
+
+ boolean get_property_modes (in PropertyNames property_names,
+ out PropertyModes property_modes);
+ // Support for Getting and Setting Property Modes.
+
+ void set_property_mode (in PropertyName property_name,
+ in PropertyModeType property_mode)
+ raises (InvalidPropertyName,
+ PropertyNotFound,
+ UnsupportedMode);
+ // Sets the mode of a property in the PropertySet.
+
+ void set_property_modes (in PropertyModes property_modes)
+ raises (MultipleExceptions);
+ // Sets the mode for each property in the property_modes
+ // parameter. This is a batch operation that returns the
+ // MultipleExceptions exception if any set failed.
+
+ };
+
+ interface PropertyNamesIterator
+ {
+ // = TITLE
+ // Interface for iterating thru the Property Names.
+ //
+ // = DESCRIPTION
+ // The PropertyNamesIterator interface allows a client to
+ // iterate through the names using the next_one or next_n operations.
+
+ void reset ();
+ // The reset operation resets the position in an iterator to the
+ // first property, if one exists.
+
+ boolean next_one (out PropertyName property_name);
+ // The next_one operation returns true if an item exists at the
+ // current position in the iterator with an output parameter of
+ // a property name. A return of false signifies no more items in
+ // the iterator.
+
+ boolean next_n (in unsigned long how_many,
+ out PropertyNames property_names);
+ // The next_n operation returns true if an item exists at the
+ // current position in the iterator and the how_many parameter
+ // was set greater than zero. The output is a PropertyNames
+ // sequence with at most the how_many number of names. A return
+ // of false signifies no more items in the iterator.
+
+ void destroy ();
+ // The destroy operation destroys the iterator.
+ };
+
+ interface PropertiesIterator
+ {
+ // = TITLE
+ // Interface for iterating thru the Properties.
+ //
+ // = DESCRIPTION
+ // allows a client to through the name-value pairs using the
+ // next_one or next_n operations.
+
+ void reset ();
+ // The reset operation resets the position in an iterator to the
+ // first property, if one exists.
+
+ boolean next_one (out Property aproperty);
+ // The next_one operation returns true if an item exists at the
+ // current position in the iterator with an output parameter of
+ // a property. A return of false signifies no more items in the
+ // iterator.
+
+ boolean next_n (in unsigned long how_many,
+ out Properties nproperties);
+ // The next_n operation returns true if an item exists at the
+ // current position in the iterator and the how_many parameter
+ // was set greater than zero. The output is a properties
+ // sequence with at most the how_many number of properties. A
+ // return of false signifies no more items in the iterator.
+
+ void destroy ();
+ // The destroy operation destroys the iterator.
+ };
+};
+
+#endif /* TAO_PROPERTY_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/CosProperty.mpc b/TAO/orbsvcs/orbsvcs/CosProperty.mpc
new file mode 100644
index 00000000000..cc73a0a5fc8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosProperty.mpc
@@ -0,0 +1,120 @@
+// -*- MPC -*-
+// $Id$
+
+project(CosProperty_IDL) : orbsvcslib, core, tao_versioning_idl_defaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=TAO_Property_Export -Wb,stub_export_include=orbsvcs/Property/property_export.h -Wb,skel_export_macro=TAO_Property_Skel_Export -Wb,skel_export_include=orbsvcs/Property/property_skel_export.h
+
+ IDL_Files {
+ CosProperty.idl
+
+ // This is a wrappper for backwards compatibility
+ CosPropertyService.idl
+ }
+}
+
+project(CosProperty) : orbsvcslib, core {
+ sharedname = TAO_CosProperty
+ dynamicflags = TAO_PROPERTY_BUILD_DLL
+ tagchecks += Property
+ after += CosProperty_IDL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ CosPropertyC.cpp
+ CosPropertyServiceC.cpp
+ }
+
+ Header_Files {
+ CosPropertyC.h
+ CosPropertyServiceC.h
+ Property/property_export.h
+ }
+
+ Inline_Files {
+ CosPropertyC.inl
+ CosPropertyServiceC.inl
+ }
+
+ Template_Files {
+ }
+
+ // explicit Resource_Files to avoid including _Skel and _Serv rc files.
+ Resource_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_CosProperty.pc.in
+ }
+}
+
+project(CosProperty_Skel) : orbsvcslib, core, property, portableserver {
+ sharedname = TAO_CosProperty_Skel
+ dynamicflags = TAO_PROPERTY_SKEL_BUILD_DLL
+ tagchecks += Property
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ CosPropertyS.cpp
+ CosPropertyServiceS.cpp
+ }
+
+ Header_Files {
+ CosPropertyS.h
+ CosPropertyS_T.h
+ CosPropertyServiceS.h
+ CosPropertyServiceS_T.h
+ Property/property_skel_export.h
+ }
+
+ Inline_Files {
+ CosPropertyS.inl
+ CosPropertyS_T.inl
+ CosPropertyServiceS.inl
+ CosPropertyServiceS_T.inl
+ }
+
+ Template_Files {
+ CosPropertyS_T.cpp
+ CosPropertyServiceS_T.cpp
+ }
+
+ Pkgconfig_Files {
+ TAO_CosProperty_Skel.pc.in
+ }
+}
+
+project(CosProperty_Serv) : orbsvcslib, core, property_skel {
+ sharedname = TAO_CosProperty_Serv
+ dynamicflags = TAO_PROPERTY_SERV_BUILD_DLL
+ tagchecks += Property
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Property
+ }
+
+ Header_Files {
+ Property
+ ^Property/property_export.h
+ ^Property/property_skel_export.h
+ }
+
+ Inline_Files {
+ Property
+ }
+
+ Template_Files {
+ Property
+ }
+
+ Pkgconfig_Files {
+ TAO_CosProperty_Serv.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/CosProperty.rc b/TAO/orbsvcs/orbsvcs/CosProperty.rc
new file mode 100644
index 00000000000..7ac83c90c20
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosProperty.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosProperty\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosPropertyDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosProperty.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosPropertyService.idl b/TAO/orbsvcs/orbsvcs/CosPropertyService.idl
new file mode 100644
index 00000000000..90246368491
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosPropertyService.idl
@@ -0,0 +1,16 @@
+//
+// $Id$
+//
+
+#ifndef TAO_PROPERTYSERVICE_IDL
+#define TAO_PROPERTYSERVICE_IDL
+
+// Force the IDL compiler to include this file [it does not include
+// empty files]
+#pragma prefix "omg.org"
+
+#include "CosProperty.idl"
+
+#pragma prefix ""
+
+#endif /* TAO_PROPERTYSERVICE_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/CosTime.mpc b/TAO/orbsvcs/orbsvcs/CosTime.mpc
new file mode 100644
index 00000000000..417a1c0d6ff
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosTime.mpc
@@ -0,0 +1,33 @@
+// -*- MPC -*-
+// $Id$
+
+project(CosTime) : orbsvcslib, svc_utils, core, portableserver, tao_versioning_idl_defaults {
+ sharedname = TAO_CosTime
+ idlflags += -Wb,export_macro=TAO_Time_Export -Wb,export_include=orbsvcs/Time/time_export.h
+ dynamicflags = TAO_TIME_BUILD_DLL
+ tagchecks += Time
+
+ IDL_Files {
+ TimeService.idl
+ }
+
+ Source_Files {
+ TimeServiceC.cpp
+ TimeServiceS.cpp
+ Time
+ }
+
+ Header_Files {
+ Time/time_export.h
+ }
+
+ Inline_Files {
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_CosTime.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/CosTime.rc b/TAO/orbsvcs/orbsvcs/CosTime.rc
new file mode 100644
index 00000000000..98a8443e7c0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosTime.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosTime\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosTimeDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosTime.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosTrading.idl b/TAO/orbsvcs/orbsvcs/CosTrading.idl
new file mode 100644
index 00000000000..c93ca6bef72
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosTrading.idl
@@ -0,0 +1,522 @@
+/* -*- C++ -*- */
+
+// ========================================================================
+// $Id$
+//
+// = FILENAME
+// CosTrading.idl
+//
+// = DESCRIPTION
+// Trader Service v1.0 described in CORBAservices: Common Object
+// Services Specification, chapter 16 OMG IDL for Trading Function
+// Module, p 16-74
+//
+// ========================================================================
+
+#ifndef TAO_TRADING_IDL
+#define TAO_TRADING_IDL
+
+#pragma prefix "omg.org"
+
+module CosTrading
+{
+ // forward references to our interfaces
+
+ interface Lookup;
+ interface Register;
+ interface Link;
+ interface Proxy;
+ interface Admin;
+ interface OfferIterator;
+ interface OfferIdIterator;
+
+ // type definitions used in more than one interface
+ typedef string Istring;
+ typedef Object TypeRepository;
+
+ typedef Istring PropertyName;
+ typedef sequence<PropertyName> PropertyNameSeq;
+ typedef any PropertyValue;
+
+ struct Property
+ {
+ PropertyName name;
+ PropertyValue value;
+ };
+ typedef sequence<Property> PropertySeq;
+
+ struct Offer
+ {
+ Object reference;
+ PropertySeq properties;
+ };
+ typedef sequence<Offer> OfferSeq;
+
+ typedef string OfferId;
+ typedef sequence<OfferId> OfferIdSeq;
+
+ typedef Istring ServiceTypeName; // similar structure to IR::Identifier
+
+ typedef Istring Constraint;
+
+ enum FollowOption
+ {
+ local_only,
+ if_no_local,
+ always
+ };
+
+ typedef Istring LinkName;
+ typedef sequence<LinkName> LinkNameSeq;
+ typedef LinkNameSeq TraderName;
+
+ typedef string PolicyName; // policy names restricted to Latin1
+ typedef sequence<PolicyName> PolicyNameSeq;
+ typedef any PolicyValue;
+
+ struct Policy
+ {
+ PolicyName name;
+ PolicyValue value;
+ };
+ typedef sequence<Policy> PolicySeq;
+
+ // exceptions used in more than one interface
+
+ exception UnknownMaxLeft {};
+
+ exception NotImplemented {};
+
+ exception IllegalServiceType
+ {
+ ServiceTypeName type;
+ };
+
+ exception UnknownServiceType
+ {
+ ServiceTypeName type;
+ };
+
+ exception IllegalPropertyName
+ {
+ PropertyName name;
+ };
+
+ exception DuplicatePropertyName
+ {
+ PropertyName name;
+ };
+
+ exception PropertyTypeMismatch
+ {
+ ServiceTypeName type;
+ Property prop;
+ };
+
+ exception MissingMandatoryProperty
+ {
+ ServiceTypeName type;
+ PropertyName name;
+ };
+
+ exception ReadonlyDynamicProperty
+ {
+ ServiceTypeName type;
+ PropertyName name;
+ };
+
+ exception IllegalConstraint
+ {
+ Constraint constr;
+ };
+
+ exception InvalidLookupRef
+ {
+ Lookup target;
+ };
+
+ exception IllegalOfferId
+ {
+ OfferId id;
+ };
+
+ exception UnknownOfferId
+ {
+ OfferId id;
+ };
+
+ exception DuplicatePolicyName
+ {
+ PolicyName name;
+ };
+
+ // the interfaces
+
+ interface TraderComponents
+ {
+ readonly attribute Lookup lookup_if;
+ readonly attribute Register register_if;
+ readonly attribute Link link_if;
+ readonly attribute Proxy proxy_if;
+ readonly attribute Admin admin_if;
+ };
+
+ interface SupportAttributes
+ {
+ readonly attribute boolean supports_modifiable_properties;
+ readonly attribute boolean supports_dynamic_properties;
+ readonly attribute boolean supports_proxy_offers;
+ readonly attribute TypeRepository type_repos;
+ };
+
+ interface ImportAttributes
+ {
+ readonly attribute unsigned long def_search_card;
+ readonly attribute unsigned long max_search_card;
+ readonly attribute unsigned long def_match_card;
+ readonly attribute unsigned long max_match_card;
+ readonly attribute unsigned long def_return_card;
+ readonly attribute unsigned long max_return_card;
+ readonly attribute unsigned long max_list;
+ readonly attribute unsigned long def_hop_count;
+ readonly attribute unsigned long max_hop_count;
+ readonly attribute FollowOption def_follow_policy;
+ readonly attribute FollowOption max_follow_policy;
+ };
+
+ interface LinkAttributes
+ {
+ readonly attribute FollowOption max_link_follow_policy;
+ };
+
+ interface Lookup:TraderComponents,SupportAttributes,ImportAttributes
+ {
+ typedef Istring Preference;
+
+ enum HowManyProps { none, some, all };
+
+ union SpecifiedProps switch ( HowManyProps )
+ {
+ case some: PropertyNameSeq prop_names;
+ };
+
+ exception IllegalPreference {
+ Preference pref;
+ };
+
+ exception IllegalPolicyName {
+ PolicyName name;
+ };
+
+ exception PolicyTypeMismatch {
+ Policy the_policy;
+ };
+
+ exception InvalidPolicyValue {
+ Policy the_policy;
+ };
+
+ void query (in ServiceTypeName type,
+ in Constraint constr,
+ in Preference pref,
+ in PolicySeq policies,
+ in SpecifiedProps desired_props,
+ in unsigned long how_many,
+ out OfferSeq offers,
+ out OfferIterator offer_itr,
+ out PolicyNameSeq limits_applied)
+ raises (IllegalServiceType,
+ UnknownServiceType,
+ IllegalConstraint,
+ IllegalPreference,
+ IllegalPolicyName,
+ PolicyTypeMismatch,
+ InvalidPolicyValue,
+ IllegalPropertyName,
+ DuplicatePropertyName,
+ DuplicatePolicyName);
+ };
+
+ interface Register : TraderComponents, SupportAttributes
+ {
+ struct OfferInfo
+ {
+ Object reference;
+ ServiceTypeName type;
+ PropertySeq properties;
+ };
+
+ exception InvalidObjectRef {
+ Object ref;
+ };
+
+ exception UnknownPropertyName {
+ PropertyName name;
+ };
+
+ exception InterfaceTypeMismatch {
+ ServiceTypeName type;
+ Object reference;
+ };
+
+ exception ProxyOfferId {
+ OfferId id;
+ };
+
+ exception MandatoryProperty {
+ ServiceTypeName type;
+ PropertyName name;
+ };
+
+ exception ReadonlyProperty {
+ ServiceTypeName type;
+ PropertyName name;
+ };
+
+ exception NoMatchingOffers {
+ Constraint constr;
+ };
+
+ exception IllegalTraderName {
+ TraderName name;
+ };
+
+ exception UnknownTraderName {
+ TraderName name;
+ };
+
+ exception RegisterNotSupported {
+ TraderName name;
+ };
+
+ OfferId export (in Object reference,
+ in ServiceTypeName type,
+ in PropertySeq properties)
+ raises (InvalidObjectRef,
+ IllegalServiceType,
+ UnknownServiceType,
+ InterfaceTypeMismatch,
+ IllegalPropertyName, // e.g. prop_name = "<foo-bar"
+ PropertyTypeMismatch,
+ ReadonlyDynamicProperty,
+ MissingMandatoryProperty,
+ DuplicatePropertyName);
+
+ void withdraw (in OfferId id)
+ raises (IllegalOfferId,
+ UnknownOfferId,
+ ProxyOfferId);
+
+ OfferInfo describe (in OfferId id)
+ raises (IllegalOfferId,
+ UnknownOfferId,
+ ProxyOfferId);
+
+ void modify (in OfferId id,
+ in PropertyNameSeq del_list,
+ in PropertySeq modify_list)
+ raises (NotImplemented,
+ IllegalOfferId,
+ UnknownOfferId,
+ ProxyOfferId,
+ IllegalPropertyName,
+ UnknownPropertyName,
+ PropertyTypeMismatch,
+ ReadonlyDynamicProperty,
+ MandatoryProperty,
+ ReadonlyProperty,
+ DuplicatePropertyName);
+
+ void withdraw_using_constraint (in ServiceTypeName type,
+ in Constraint constr)
+ raises (IllegalServiceType,
+ UnknownServiceType,
+ IllegalConstraint,
+ NoMatchingOffers);
+
+ Register resolve (in TraderName name)
+ raises (IllegalTraderName,
+ UnknownTraderName,
+ RegisterNotSupported);
+ };
+
+ interface Link : TraderComponents, SupportAttributes, LinkAttributes
+ {
+ struct LinkInfo
+ {
+ Lookup target;
+ Register target_reg;
+ FollowOption def_pass_on_follow_rule;
+ FollowOption limiting_follow_rule;
+ };
+
+ exception IllegalLinkName {
+ LinkName name;
+ };
+
+ exception UnknownLinkName {
+ LinkName name;
+ };
+
+ exception DuplicateLinkName {
+ LinkName name;
+ };
+
+ exception DefaultFollowTooPermissive {
+ FollowOption def_pass_on_follow_rule;
+ FollowOption limiting_follow_rule;
+ };
+
+ exception LimitingFollowTooPermissive {
+ FollowOption limiting_follow_rule;
+ FollowOption max_link_follow_policy;
+ };
+
+ void add_link (in LinkName name,
+ in Lookup target,
+ in FollowOption def_pass_on_follow_rule,
+ in FollowOption limiting_follow_rule)
+ raises (IllegalLinkName,
+ DuplicateLinkName,
+ InvalidLookupRef, // e.g. nil
+ DefaultFollowTooPermissive,
+ LimitingFollowTooPermissive);
+
+ void remove_link (in LinkName name)
+ raises (IllegalLinkName,
+ UnknownLinkName);
+
+ LinkInfo describe_link (in LinkName name)
+ raises (IllegalLinkName,
+ UnknownLinkName);
+
+ LinkNameSeq list_links ( );
+
+ void modify_link (in LinkName name,
+ in FollowOption def_pass_on_follow_rule,
+ in FollowOption limiting_follow_rule)
+ raises (IllegalLinkName,
+ UnknownLinkName,
+ DefaultFollowTooPermissive,
+ LimitingFollowTooPermissive);
+ };
+
+ interface Proxy : TraderComponents, SupportAttributes
+ {
+ typedef Istring ConstraintRecipe;
+
+ struct ProxyInfo
+ {
+ ServiceTypeName type;
+ Lookup target;
+ PropertySeq properties;
+ boolean if_match_all;
+ ConstraintRecipe recipe;
+ PolicySeq policies_to_pass_on;
+ };
+
+ exception IllegalRecipe {
+ ConstraintRecipe recipe;
+ };
+
+ exception NotProxyOfferId {
+ OfferId id;
+ };
+
+ OfferId export_proxy (in Lookup target,
+ in ServiceTypeName type,
+ in PropertySeq properties,
+ in boolean if_match_all,
+ in ConstraintRecipe recipe,
+ in PolicySeq policies_to_pass_on)
+ raises (IllegalServiceType,
+ UnknownServiceType,
+ InvalidLookupRef, // e.g. nil
+ IllegalPropertyName,
+ PropertyTypeMismatch,
+ ReadonlyDynamicProperty,
+ MissingMandatoryProperty,
+ IllegalRecipe,
+ DuplicatePropertyName,
+ DuplicatePolicyName);
+
+ void withdraw_proxy (in OfferId id)
+ raises (IllegalOfferId,
+ UnknownOfferId,
+ NotProxyOfferId);
+
+ ProxyInfo describe_proxy (in OfferId id)
+ raises (IllegalOfferId,
+ UnknownOfferId,
+ NotProxyOfferId);
+ };
+
+ interface Admin : TraderComponents, SupportAttributes, ImportAttributes, LinkAttributes
+ {
+ typedef sequence<octet> OctetSeq;
+
+ readonly attribute OctetSeq request_id_stem;
+
+ unsigned long set_def_search_card (in unsigned long value);
+ unsigned long set_max_search_card (in unsigned long value);
+
+ unsigned long set_def_match_card (in unsigned long value);
+ unsigned long set_max_match_card (in unsigned long value);
+
+ unsigned long set_def_return_card (in unsigned long value);
+ unsigned long set_max_return_card (in unsigned long value);
+
+ unsigned long set_max_list (in unsigned long value);
+
+ boolean set_supports_modifiable_properties (in boolean value);
+ boolean set_supports_dynamic_properties (in boolean value);
+ boolean set_supports_proxy_offers (in boolean value);
+
+ unsigned long set_def_hop_count (in unsigned long value);
+ unsigned long set_max_hop_count (in unsigned long value);
+
+ FollowOption set_def_follow_policy (in FollowOption policy);
+ FollowOption set_max_follow_policy (in FollowOption policy);
+
+ FollowOption set_max_link_follow_policy (in FollowOption policy);
+
+ TypeRepository set_type_repos (in TypeRepository repository);
+
+ OctetSeq set_request_id_stem (in OctetSeq stem);
+
+ void list_offers (in unsigned long how_many,
+ out OfferIdSeq ids,
+ out OfferIdIterator id_itr)
+ raises (NotImplemented);
+
+ void list_proxies (in unsigned long how_many,
+ out OfferIdSeq ids,
+ out OfferIdIterator id_itr)
+ raises (NotImplemented);
+ };
+
+ interface OfferIterator
+ {
+ unsigned long max_left ()
+ raises (UnknownMaxLeft);
+
+ boolean next_n (in unsigned long n,
+ out OfferSeq offers);
+
+ void destroy ();
+ };
+
+ interface OfferIdIterator
+ {
+ unsigned long max_left ()
+ raises (UnknownMaxLeft);
+
+ boolean next_n (in unsigned long n,
+ out OfferIdSeq ids);
+
+ void destroy ();
+ };
+
+}; /* end module CosTrading */
+
+#endif /* TAO_TRADING_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/CosTrading.mpc b/TAO/orbsvcs/orbsvcs/CosTrading.mpc
new file mode 100644
index 00000000000..ef436ac2479
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosTrading.mpc
@@ -0,0 +1,133 @@
+// -*- MPC -*-
+// $Id$
+
+project(CosTrading_IDL) : orbsvcslib, core, tao_versioning_idl_defaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=TAO_Trading_Export -Wb,stub_export_include=orbsvcs/Trader/trading_export.h -Wb,skel_export_macro=TAO_Trading_Skel_Export -Wb,skel_export_include=orbsvcs/Trader/trading_skel_export.h
+
+ IDL_Files {
+ CosTrading.idl
+ CosTradingRepos.idl
+ CosTradingDynamic.idl
+ }
+}
+
+
+project(CosTrading) : orbsvcslib, core {
+ sharedname = TAO_CosTrading
+ dynamicflags = TAO_TRADING_BUILD_DLL
+ tagchecks += Trader
+ after += CosTrading_IDL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ CosTradingC.cpp
+ CosTradingReposC.cpp
+ CosTradingDynamicC.cpp
+ }
+
+ Header_Files {
+ CosTradingC.h
+ CosTradingReposC.h
+ CosTradingDynamicC.h
+ Trader/trading_export.h
+ }
+
+ Inline_Files {
+ CosTradingC.inl
+ CosTradingReposC.inl
+ CosTradingDynamicC.inl
+ }
+
+ Template_Files {
+ }
+
+ // explicit Resource_Files to avoid including _Skel & _Serv rc files.
+ Resource_Files {
+ CosTrading.rc
+ }
+
+ Pkgconfig_Files {
+ TAO_CosTrading.pc.in
+ }
+}
+
+
+project(CosTrading_Skel) : orbsvcslib, core, trading, portableserver {
+ sharedname = TAO_CosTrading_Skel
+ dynamicflags = TAO_TRADING_SKEL_BUILD_DLL
+ tagchecks += Trader
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ CosTradingS.cpp
+ CosTradingReposS.cpp
+ CosTradingDynamicS.cpp
+ }
+
+ Header_Files {
+ CosTradingS.h
+ CosTradingReposS.h
+ CosTradingDynamicS.h
+
+ CosTradingS_T.h
+ CosTradingReposS_T.h
+ CosTradingDynamicS_T.h
+
+ Trader/trading_skel_export.h
+ }
+
+ Inline_Files {
+ CosTradingS.inl
+ CosTradingReposS.inl
+ CosTradingDynamicS.inl
+
+ CosTradingS_T.inl
+ CosTradingReposS_T.inl
+ CosTradingDynamicS_T.inl
+ }
+
+ Template_Files {
+ CosTradingS_T.cpp
+ CosTradingReposS_T.cpp
+ CosTradingDynamicS_T.cpp
+ }
+
+ Pkgconfig_Files {
+ TAO_CosTrading_Skel.pc.in
+ }
+}
+
+
+project(CosTrading_Serv) : orbsvcslib, core, trading_skel, dynamicany, svc_utils, utils, iortable {
+ sharedname = TAO_CosTrading_Serv
+ dynamicflags = TAO_TRADING_SERV_BUILD_DLL
+ tagchecks += Trader
+ pch_header =
+ pch_source =
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Trader
+ }
+
+ Header_Files {
+ Trader/trading_serv_export.h
+ }
+
+ Inline_Files {
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_CosTrading_Serv.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/CosTrading.rc b/TAO/orbsvcs/orbsvcs/CosTrading.rc
new file mode 100644
index 00000000000..4c97fd47c18
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosTrading.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosTrading\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosTradingDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosTrading.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosTradingDynamic.idl b/TAO/orbsvcs/orbsvcs/CosTradingDynamic.idl
new file mode 100644
index 00000000000..27ffedbbf35
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosTradingDynamic.idl
@@ -0,0 +1,50 @@
+/* -*- C++ -*- */
+
+// ========================================================================
+// $Id$
+//
+// = FILENAME
+// CosTradingDynamic.idl
+//
+// = DESCRIPTION
+// Trader Service v1.0 described in CORBAservices: Common Object
+// Services Specification, chapter 16 OMG IDL for Trading Function
+// Module, p 16-74
+//
+// ========================================================================
+
+#ifndef TAO_TRADING_DYNAMIC_IDL
+#define TAO_TRADING_DYNAMIC_IDL
+
+#include <orb.idl>
+#include "CosTrading.idl"
+
+#pragma prefix "omg.org"
+
+// OMG IDL for Dynamic Property Module, p 16-88
+
+module CosTradingDynamic
+{
+
+ exception DPEvalFailure {
+ CosTrading::PropertyName name;
+ CORBA::TypeCode returned_type;
+ any extra_info;
+ };
+
+ interface DynamicPropEval
+ {
+ any evalDP (in CosTrading::PropertyName name,
+ in CORBA::TypeCode returned_type,
+ in any extra_info)
+ raises (DPEvalFailure);
+ };
+
+ struct DynamicProp {
+ DynamicPropEval eval_if;
+ CORBA::TypeCode returned_type;
+ any extra_info;
+ };
+}; /* end module CosTradingDynamic */
+
+#endif /* TAO_TRADING_DYNAMIC_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/CosTradingRepos.idl b/TAO/orbsvcs/orbsvcs/CosTradingRepos.idl
new file mode 100644
index 00000000000..0462030155e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosTradingRepos.idl
@@ -0,0 +1,159 @@
+/* -*- C++ -*- */
+
+// ========================================================================
+// $Id$
+//
+// = FILENAME
+// CosTradingRepos.idl
+//
+// = DESCRIPTION
+// Trader Service v1.0 described in CORBAservices: Common Object
+// Services Specification, chapter 16 OMG IDL for Trading Function
+// Module, p 16-74
+//
+// ========================================================================
+
+#ifndef TAO_TRADING_REPOS_IDL
+#define TAO_TRADING_REPOS_IDL
+
+#include <orb.idl>
+#include "CosTrading.idl"
+
+#pragma prefix "omg.org"
+
+// OMG IDL for Service Type Repository Module, p 16-89
+
+module CosTradingRepos
+{
+ interface ServiceTypeRepository
+ {
+ // local types
+ typedef sequence<CosTrading::ServiceTypeName> ServiceTypeNameSeq;
+ enum PropertyMode {
+ PROP_NORMAL, PROP_READONLY,
+ PROP_MANDATORY, PROP_MANDATORY_READONLY
+ };
+ struct PropStruct
+ {
+ CosTrading::PropertyName name;
+ CORBA::TypeCode value_type;
+ PropertyMode mode;
+ };
+ typedef sequence<PropStruct> PropStructSeq;
+
+ typedef CosTrading::Istring Identifier; // IR::Identifier
+
+ struct IncarnationNumber
+ {
+ unsigned long high;
+ unsigned long low;
+ };
+
+ struct TypeStruct
+ {
+ Identifier if_name;
+ PropStructSeq props;
+ ServiceTypeNameSeq super_types;
+ boolean masked;
+ IncarnationNumber incarnation;
+ };
+
+ enum ListOption { all, since };
+ union SpecifiedServiceTypes switch ( ListOption ) {
+ case all: boolean all_;
+ case since: IncarnationNumber incarnation;
+ };
+
+ // local exceptions
+ exception ServiceTypeExists {
+ CosTrading::ServiceTypeName name;
+ };
+
+ exception InterfaceTypeMismatch {
+ CosTrading::ServiceTypeName base_service;
+ Identifier base_if;
+ CosTrading::ServiceTypeName derived_service;
+ Identifier derived_if;
+ };
+
+ exception HasSubTypes {
+ CosTrading::ServiceTypeName the_type;
+ CosTrading::ServiceTypeName sub_type;
+ };
+
+ exception AlreadyMasked {
+ CosTrading::ServiceTypeName name;
+ };
+
+ exception NotMasked {
+ CosTrading::ServiceTypeName name;
+ };
+
+ exception ValueTypeRedefinition {
+ CosTrading::ServiceTypeName type_1;
+ PropStruct definition_1;
+ CosTrading::ServiceTypeName type_2;
+ PropStruct definition_2;
+ };
+
+ exception DuplicateServiceTypeName {
+ CosTrading::ServiceTypeName name;
+ };
+
+ // attributes
+ readonly attribute IncarnationNumber incarnation;
+
+ // operation signatures
+ IncarnationNumber add_type (in CosTrading::ServiceTypeName name,
+ in Identifier if_name,
+ in PropStructSeq props,
+ in ServiceTypeNameSeq super_types)
+ raises (CosTrading::IllegalServiceType,
+ ServiceTypeExists,
+ InterfaceTypeMismatch,
+ CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName,
+ ValueTypeRedefinition,
+ CosTrading::UnknownServiceType,
+ DuplicateServiceTypeName);
+
+ void remove_type (in CosTrading::ServiceTypeName name)
+ raises (CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ HasSubTypes);
+
+ ServiceTypeNameSeq list_types (in SpecifiedServiceTypes which_types);
+
+ TypeStruct describe_type (in CosTrading::ServiceTypeName name)
+ raises (CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType);
+
+ TypeStruct fully_describe_type (in CosTrading::ServiceTypeName name)
+ raises (CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType);
+
+ void mask_type (in CosTrading::ServiceTypeName name)
+ raises (CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ AlreadyMasked);
+
+ void unmask_type (in CosTrading::ServiceTypeName name)
+ raises (CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ NotMasked);
+ };
+}; /* end module CosTradingRepos */
+
+module CosTradingSequences
+{
+ 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;
+};
+
+#endif /* TAO_TRADING_REPOS_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/CosTrading_Serv.rc b/TAO/orbsvcs/orbsvcs/CosTrading_Serv.rc
new file mode 100644
index 00000000000..f079fe2686c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosTrading_Serv.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosTrading_Serv\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosTrading_ServDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosTrading_Serv.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosTrading_Skel.rc b/TAO/orbsvcs/orbsvcs/CosTrading_Skel.rc
new file mode 100644
index 00000000000..587858c0034
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosTrading_Skel.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosTrading_Skel\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosTrading_SkelDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosTrading_Skel.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/CosTypedEventChannelAdmin.idl b/TAO/orbsvcs/orbsvcs/CosTypedEventChannelAdmin.idl
new file mode 100644
index 00000000000..5a809fb1642
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosTypedEventChannelAdmin.idl
@@ -0,0 +1,62 @@
+
+//=============================================================================
+/**
+* @file CosTypedEventChannelAdmin.idl
+*
+* $Id$
+*
+* @brief Part of the Event Service
+* See http://www.omg.org/docs/formal/01-03-01.pdf
+*/
+//=============================================================================
+
+#ifndef _COS_TYPED_EVENT_CHANNEL_ADMIN_IDL_
+#define _COS_TYPED_EVENT_CHANNEL_ADMIN_IDL_
+
+#include "CosEventChannelAdmin.idl"
+#include "CosTypedEventComm.idl"
+
+#pragma prefix "omg.org"
+
+module CosTypedEventChannelAdmin {
+
+ exception InterfaceNotSupported {};
+ exception NoSuchImplementation {};
+ typedef string Key;
+
+ interface TypedProxyPushConsumer :
+ CosEventChannelAdmin::ProxyPushConsumer,
+ CosTypedEventComm::TypedPushConsumer { };
+
+ interface TypedProxyPullSupplier :
+ CosEventChannelAdmin::ProxyPullSupplier,
+ CosTypedEventComm::TypedPullSupplier { };
+
+ interface TypedSupplierAdmin :
+ CosEventChannelAdmin::SupplierAdmin {
+ TypedProxyPushConsumer obtain_typed_push_consumer(
+ in Key supported_interface)
+ raises(InterfaceNotSupported);
+ CosEventChannelAdmin::ProxyPullConsumer obtain_typed_pull_consumer (
+ in Key uses_interface)
+ raises(NoSuchImplementation);
+ };
+
+ interface TypedConsumerAdmin :
+ CosEventChannelAdmin::ConsumerAdmin {
+ TypedProxyPullSupplier obtain_typed_pull_supplier(
+ in Key supported_interface)
+ raises (InterfaceNotSupported);
+ CosEventChannelAdmin::ProxyPushSupplier obtain_typed_push_supplier(
+ in Key uses_interface)
+ raises(NoSuchImplementation);
+ };
+
+ interface TypedEventChannel {
+ TypedConsumerAdmin for_consumers();
+ TypedSupplierAdmin for_suppliers();
+ void destroy ();
+ };
+};
+
+#endif /* _COS_TYPED_EVENT_CHANNEL_ADMIN_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/CosTypedEventComm.idl b/TAO/orbsvcs/orbsvcs/CosTypedEventComm.idl
new file mode 100644
index 00000000000..a210c06d616
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/CosTypedEventComm.idl
@@ -0,0 +1,32 @@
+
+//=============================================================================
+/**
+* @file CosTypedEventComm.idl
+*
+* $Id$
+*
+* @brief Part of the Event Service
+* See http://www.omg.org/docs/formal/01-03-01.pdf
+*/
+//=============================================================================
+
+#ifndef _COS_TYPED_EVENT_COMM_IDL_
+#define _COS_TYPED_EVENT_COMM_IDL_
+
+#include "CosEventComm.idl"
+
+#pragma prefix "omg.org"
+
+module CosTypedEventComm {
+
+ interface TypedPushConsumer : CosEventComm::PushConsumer {
+ Object get_typed_consumer();
+ };
+
+ interface TypedPullSupplier : CosEventComm::PullSupplier {
+ Object get_typed_supplier();
+ };
+
+};
+
+#endif // _COS_TYPED_EVENT_COMM_IDL
diff --git a/TAO/orbsvcs/orbsvcs/DsEventLogAdmin.idl b/TAO/orbsvcs/orbsvcs/DsEventLogAdmin.idl
new file mode 100644
index 00000000000..0bebdb87218
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/DsEventLogAdmin.idl
@@ -0,0 +1,56 @@
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// DsEventLogAdmin.idl
+//
+// = DESCRIPTION
+// This module defines the EventLog and
+// EventLogFactory interfaces.
+//
+// = AUTHOR
+// D A Hanvey (d.hanvey@qub.ac.uk)
+//
+// ============================================================================
+
+#ifndef DS_EVENT_LOG_ADMIN_IDL
+#define DS_EVENT_LOG_ADMIN_IDL
+
+#include "CosEventChannelAdmin.idl"
+// CORBA Event Service
+
+#include "DsLogAdmin.idl"
+
+#pragma prefix "omg.org"
+
+module DsEventLogAdmin
+{
+ interface EventLog : DsLogAdmin::Log,
+ CosEventChannelAdmin::EventChannel{};
+
+ interface EventLogFactory : DsLogAdmin::LogMgr,
+ CosEventChannelAdmin::ConsumerAdmin
+ {
+ EventLog create (
+ in DsLogAdmin::LogFullActionType full_action,
+ in unsigned long long max_size,
+ in DsLogAdmin::CapacityAlarmThresholdList thresholds,
+ out DsLogAdmin::LogId id
+ ) raises (DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold);
+
+ EventLog create_with_id (
+ in DsLogAdmin::LogId id,
+ in DsLogAdmin::LogFullActionType full_action,
+ in unsigned long long max_size,
+ in DsLogAdmin::CapacityAlarmThresholdList thresholds
+ ) raises (DsLogAdmin::LogIdAlreadyExists,
+ DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold);
+
+ };
+
+};
+
+#endif /* DS_EVENT_LOG_ADMIN_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/DsEventLogAdmin.mpc b/TAO/orbsvcs/orbsvcs/DsEventLogAdmin.mpc
new file mode 100644
index 00000000000..4322406dedc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/DsEventLogAdmin.mpc
@@ -0,0 +1,108 @@
+// -*- MPC -*-
+// $Id$
+
+project(DsEventLogAdmin_IDL) : orbsvcslib, core, dslogadmin, event, tao_versioning_idl_defaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=TAO_EventLog_Export -Wb,stub_export_include=orbsvcs/Log/eventlog_export.h -Wb,skel_export_macro=TAO_EventLog_Skel_Export -Wb,skel_export_include=orbsvcs/Log/eventlog_skel_export.h
+
+ IDL_Files {
+ DsEventLogAdmin.idl
+ }
+}
+
+project(DsEventLogAdmin) : orbsvcslib, core, dslogadmin, event {
+ sharedname = TAO_DsEventLogAdmin
+ dynamicflags = TAO_EVENTLOG_BUILD_DLL
+ tagchecks += EventLog
+ after += DsEventLogAdmin_IDL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ DsEventLogAdminC.cpp
+ }
+
+ Header_Files {
+ DsEventLogAdminC.h
+ Log/eventlog_export.h
+ }
+
+ Inline_Files {
+ DsEventLogAdminC.inl
+ }
+
+ Template_Files {
+ }
+
+ // explicit Resource_Files to avoid including _Skel & _Serv rc files.
+ Resource_Files {
+ DsEventLogAdmin.rc
+ }
+
+ Pkgconfig_Files {
+ TAO_DsEventLogAdmin.pc.in
+ }
+}
+
+project(DsEventLogAdmin_Skel) : orbsvcslib, core, dseventlogadmin, dslogadmin_skel, event_skel, portableserver {
+ sharedname = TAO_DsEventLogAdmin_Skel
+ dynamicflags = TAO_EVENTLOG_SKEL_BUILD_DLL
+ tagchecks += EventLog
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ DsEventLogAdminS.cpp
+ }
+
+ Header_Files {
+ DsEventLogAdminS.h
+ DsEventLogAdminS_T.h
+ Log/eventlog_skel_export.h
+ }
+
+ Inline_Files {
+ DsEventLogAdminS.inl
+ DsEventLogAdminS_T.inl
+ }
+
+ Template_Files {
+ DsEventLogAdminS_T.cpp
+ }
+
+ Pkgconfig_Files {
+ TAO_DsEventLogAdmin_Skel.pc.in
+ }
+}
+
+project(DsEventLogAdmin_Serv) : orbsvcslib, core, dseventlogadmin_skel, dslogadmin_serv, event_serv {
+ sharedname = TAO_DsEventLogAdmin_Serv
+ dynamicflags = TAO_EVENTLOG_SERV_BUILD_DLL
+ tagchecks += EventLog
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Log/EventLogConsumer.cpp
+ Log/EventLogFactory_i.cpp
+ Log/EventLogNotification.cpp
+ Log/EventLog_i.cpp
+ }
+
+ Header_Files {
+ Log/eventlog_serv_export.h
+ }
+
+ Inline_Files {
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_DsEventLogAdmin_Serv.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/DsEventLogAdmin.rc b/TAO/orbsvcs/orbsvcs/DsEventLogAdmin.rc
new file mode 100644
index 00000000000..0fec7155d31
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/DsEventLogAdmin.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "DsEventLogAdmin\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_DsEventLogAdminDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_DsEventLogAdmin.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/DsLogAdmin.idl b/TAO/orbsvcs/orbsvcs/DsLogAdmin.idl
new file mode 100644
index 00000000000..9e5fa09bae9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/DsLogAdmin.idl
@@ -0,0 +1,337 @@
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// DsLogAdmin.idl
+//
+// = DESCRIPTION
+// This module defines the Log, Iterator, LogMgr and LogFactory
+// interfaces for the OMG's Telecom Event Log Service
+//
+// ============================================================================
+
+#ifndef DS_LOG_ADMIN_IDL
+#define DS_LOG_ADMIN_IDL
+
+#include "tao/TimeBase.pidl"
+// CORBA Time Service
+
+#pragma prefix "omg.org"
+
+module DsLogAdmin
+{
+ exception InvalidParam {string details;};
+ exception InvalidThreshold {};
+ exception InvalidTime {};
+ exception InvalidTimeInterval {};
+ exception InvalidMask {};
+ exception LogIdAlreadyExists {};
+ exception InvalidGrammar{};
+ exception InvalidConstraint{};
+ exception LogFull {short n_records_written;};
+ exception LogOffDuty {};
+ exception LogLocked {};
+ exception LogDisabled {};
+ exception InvalidRecordId {};
+ exception InvalidAttribute {string attr_name; any value;};
+ exception InvalidLogFullAction {};
+
+
+ typedef unsigned long LogId;
+ // LogIds are unique within the scope of the log factory.
+
+ typedef unsigned long long RecordId;
+ // RecordIds are unique within the scope of one log.
+
+ typedef sequence<RecordId> RecordIdList;
+ const string default_grammar = "EXTENDED_TCL";
+ // Default grammar used for log record queries.
+ typedef string Constraint;
+ // A query string
+ typedef TimeBase::TimeT TimeT;
+
+ struct NVPair
+ {
+ string name;
+ any value;
+ };
+ typedef sequence<NVPair> NVList;
+
+ struct TimeInterval
+ {
+ TimeT start;
+ TimeT stop;
+ };
+
+ typedef sequence<TimeInterval> TimeIntervalSeq;
+
+ struct LogRecord
+ {
+ RecordId id;
+ // Unique number assigned by the log
+ TimeT time;
+ // Time when the event is logged
+ NVList attr_list;
+ // List of user defined name/value pairs. Not part of the event
+ // received by the log. Optional.
+ any info;
+ // Event content
+ };
+
+ typedef sequence<LogRecord> RecordList;
+ typedef sequence<any> Anys;
+
+
+ interface Iterator
+ {
+ // = TITLE
+ // Iterator with bulk operation support; returned as a
+ // result of querying the Log
+ //
+ // = DESCRIPTION
+ // Allows clients to iterate over a list of LogRecords
+ // returned from a query () or retrieve () operation
+
+ RecordList get(in unsigned long position,
+ in unsigned long how_many) raises(InvalidParam);
+ // Returns a maximum of <how_many> records, starting from
+ // position <position>
+
+ void destroy();
+ // Destroy the iterator
+ };
+
+ struct AvailabilityStatus
+ {
+ boolean off_duty;
+ boolean log_full;
+ };
+
+ typedef unsigned short LogFullActionType;
+
+ const LogFullActionType wrap = 0;
+ const LogFullActionType halt = 1;
+
+ struct Time24
+ {
+ unsigned short hour;// 0-23
+ unsigned short minute;// 0-59
+ };
+
+ struct Time24Interval
+ {
+ Time24 start;
+ Time24 stop;
+ };
+
+ typedef sequence<Time24Interval> IntervalsOfDay;
+ const unsigned short Sunday = 1;
+ const unsigned short Monday = 2;
+ const unsigned short Tuesday = 4;
+ const unsigned short Wednesday = 8;
+ const unsigned short Thursday = 16;
+ const unsigned short Friday = 32;
+ const unsigned short Saturday = 64;
+ typedef unsigned short DaysOfWeek;// Bit mask of week days
+
+ struct WeekMaskItem
+ {
+ DaysOfWeek days;
+ IntervalsOfDay intervals;
+ };
+
+ typedef sequence<WeekMaskItem> WeekMask;
+ typedef unsigned short Threshold; // 0-100 %
+ typedef sequence<Threshold> CapacityAlarmThresholdList;
+ interface LogMgr;
+
+ enum OperationalState { disabled, enabled };
+ // Logging enabled/disabled. If the log is enabled, it can be
+ // queried. If it is disabled, is may not be.
+
+ enum AdministrativeState { locked, unlocked };
+ // Logging on/off. If the log is locked, new records cannot be
+ // added, but records can be queried.
+
+ enum ForwardingState { on, off };
+ // Forwarding on/off. If forwarding is on, the log should forward
+ // records to other event consumers.
+
+ typedef unsigned short QoSType;
+ typedef sequence<QoSType> QoSList;
+
+ exception UnsupportedQoS { QoSList denied; };
+ const QoSType QoSNone = 0;
+ const QoSType QoSFlush = 1;
+ const QoSType QoSReliability = 2;
+
+
+ interface Log
+ {
+ LogMgr my_factory();
+ // Return the factory of the log
+
+ LogId id();
+ // Return the id of the log
+
+ QoSList get_log_qos();
+ void set_log_qos(in QoSList qos) raises(UnsupportedQoS);
+ // Get or set the list of the QoS properties supported by the log
+
+ unsigned long get_max_record_life();
+ void set_max_record_life(in unsigned long life);
+ // Get and set the record life in seconds (0 == infinite)
+
+ unsigned long long get_max_size();
+ void set_max_size(in unsigned long long size) raises (InvalidParam);
+ // Get and set the maximum size in octets (0 == no limit)
+
+ unsigned long long get_current_size();
+ // Return the current size in octets
+
+ unsigned long long get_n_records();
+ // Return the number of records in the log
+
+ LogFullActionType get_log_full_action();
+ void set_log_full_action(in LogFullActionType action)
+ raises(InvalidLogFullAction);
+ // Get and set the action to be taken when the log reaches its
+ // maximum size
+
+ AdministrativeState get_administrative_state();
+ void set_administrative_state(in AdministrativeState state);
+ // Get and set the administrative state (locked/unlocked)
+
+ ForwardingState get_forwarding_state();
+ void set_forwarding_state(in ForwardingState state);
+ // Get and set the forwarding state (on or off)
+
+ OperationalState get_operational_state();
+ // Returns the operational state (disabled or enabled)
+
+ TimeInterval get_interval();
+ void set_interval(in TimeInterval interval)
+ raises (InvalidTime, InvalidTimeInterval);
+ // Get and set the log duration
+
+ AvailabilityStatus get_availability_status();
+ // Return the availability status (off_duty or log_full)
+
+ CapacityAlarmThresholdList get_capacity_alarm_thresholds();
+ void set_capacity_alarm_thresholds(in CapacityAlarmThresholdList
+ threshs)
+ raises (InvalidThreshold);
+ // Get and set the capacity alarm threshold
+
+
+ WeekMask get_week_mask();
+ void set_week_mask(in WeekMask masks)
+ raises (InvalidTime, InvalidTimeInterval, InvalidMask);
+ // Get and set the weekly scheduling parameters
+
+ RecordList query(in string grammar,
+ in Constraint c,
+ out Iterator i)
+ raises(InvalidGrammar, InvalidConstraint);
+ // Returns all records in the log that match the given
+ // constraint <c>. Note that match () only returns the number
+ // of matches, whereas query () returns the actual matches.
+
+ RecordList retrieve(in TimeT from_time,
+ in long how_many,
+ out Iterator i);
+ // Retrieve <how_many> records from time <from_time> using
+ // iterator <i>. Negative <how_many> indicates backwards
+ // retrieval
+
+ unsigned long match(in string grammar,
+ in Constraint c)
+ raises(InvalidGrammar, InvalidConstraint);
+ // Returns the number of records matching constraint <c>
+
+
+ unsigned long delete_records(in string grammar,
+ in Constraint c)
+ raises(InvalidGrammar, InvalidConstraint);
+ unsigned long delete_records_by_id(in RecordIdList ids);
+ // Delete records matching constraint <c> or with ids in
+ // <ids>. Both operations return the number of records deleted
+
+ void write_records(in Anys records)
+ raises(LogFull, LogOffDuty, LogLocked, LogDisabled);
+ // Write records to the log storage
+
+ void write_recordlist(in RecordList list)
+ raises(LogFull, LogOffDuty, LogLocked, LogDisabled);
+ // Write a list of record ids to storage
+
+ void set_record_attribute(in RecordId id,
+ in NVList attr_list)
+ raises(InvalidRecordId, InvalidAttribute);
+ // Set single record attributes
+
+
+ unsigned long set_records_attribute(in string grammar,
+ in Constraint c,
+ in NVList attr_list)
+ raises(InvalidGrammar, InvalidConstraint, InvalidAttribute);
+ // Set the attributes of all records that matches the
+ // constraints with same attr_list. Returns number of records
+ // whose attributes have been set
+
+ NVList get_record_attribute(in RecordId id)
+ raises(InvalidRecordId);
+ // Get the attributes of the record with id <id>
+
+ Log copy(out LogId id);
+ Log copy_with_id (in LogId id) raises (LogIdAlreadyExists);
+ // Copy the log on which the operation was invoked. copy ()
+ // Returns the unique id of the newly created
+ // log. copy_with_id () attempts to create the new log with
+ // the specified id, but may fail if the id is in use
+
+ void flush() raises (UnsupportedQoS);
+ // Causes all pending events to be written to storage before
+ // flush () returns
+ };
+
+
+ interface BasicLog : Log
+ {
+ void destroy();
+ // Destroy the log object and all contained records
+ };
+
+ typedef sequence<Log> LogList;
+ typedef sequence<LogId> LogIdList;
+
+ interface LogMgr
+ {
+ LogList list_logs();
+ // Lists all logs created by the log factory
+
+ Log find_log(in LogId id);
+ // Returns a reference to the log with the supplied id
+
+ LogIdList list_logs_by_id();
+ // Lists all log ids
+ };
+
+ interface BasicLogFactory : LogMgr
+ {
+ BasicLog create (in LogFullActionType full_action,
+ in unsigned long long max_size,
+ out LogId id)
+ raises (InvalidLogFullAction);
+ // Allows clients to create new BasicLog objects.
+
+ BasicLog create_with_id (in LogId id,
+ in LogFullActionType full_action,
+ in unsigned long long max_size)
+ raises (LogIdAlreadyExists, InvalidLogFullAction);
+ // Same as create (), but allows clients to specify the id
+ };
+};
+
+#endif /* DS_LOG_ADMIN_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/DsLogAdmin.mpc b/TAO/orbsvcs/orbsvcs/DsLogAdmin.mpc
new file mode 100644
index 00000000000..d0d9a4dea5e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/DsLogAdmin.mpc
@@ -0,0 +1,137 @@
+// -*- MPC -*-
+// $Id$
+
+project(DsLogAdmin_IDL) : orbsvcslib, core, tao_versioning_idl_defaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=TAO_Log_Export -Wb,stub_export_include=orbsvcs/Log/log_export.h -Wb,skel_export_macro=TAO_Log_Skel_Export -Wb,skel_export_include=orbsvcs/Log/log_skel_export.h
+
+ IDL_Files {
+ DsLogAdmin.idl
+ DsLogNotification.idl
+ }
+}
+
+project(DsLogAdmin) : orbsvcslib, core {
+ sharedname = TAO_DsLogAdmin
+ dynamicflags = TAO_LOG_BUILD_DLL
+ tagchecks += Log
+ after += DsLogAdmin_IDL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ DsLogAdminC.cpp
+ DsLogNotificationC.cpp
+ }
+
+ Header_Files {
+ DsLogAdminC.h
+ DsLogNotificationC.h
+ Log/log_export.h
+ }
+
+ Inline_Files {
+ DsLogAdminC.inl
+ DsLogNotificationC.inl
+ }
+
+ Template_Files {
+ }
+
+ // explicit Resource_Files to avoid including _Skel & _Serv rc files.
+ Resource_Files {
+ DsLogAdmin.rc
+ }
+
+ Pkgconfig_Files {
+ TAO_DsLogAdmin.pc.in
+ }
+}
+
+
+project(DsLogAdmin_Skel) : orbsvcslib, core, dslogadmin, portableserver {
+ sharedname = TAO_DsLogAdmin_Skel
+ dynamicflags = TAO_LOG_SKEL_BUILD_DLL
+ tagchecks += Log
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ DsLogAdminS.cpp
+ DsLogNotificationS.cpp
+ }
+
+ Header_Files {
+ DsLogAdminS.h
+ DsLogNotificationS.h
+
+ DsLogAdminS_T.h
+ DsLogNotificationS_T.h
+
+ Log/log_skel_export.h
+ }
+
+ Inline_Files {
+ DsLogAdminS.inl
+ DsLogNotificationS.inl
+
+ DsLogAdminS_T.inl
+ DsLogNotificationS_T.inl
+ }
+
+ Template_Files {
+ DsLogAdminS_T.cpp
+ DsLogNotificationS_T.cpp
+ }
+
+ Pkgconfig_Files {
+ TAO_DsLogAdmin_Skel.pc.in
+ }
+}
+
+
+project(DsLogAdmin_Serv) : orbsvcslib, core, dslogadmin_skel, dynamicany, etcl, utils, svc_utils {
+ sharedname = TAO_DsLogAdmin_Serv
+ dynamicflags = TAO_LOG_SERV_BUILD_DLL
+ tagchecks += Log
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Log/BasicLogFactory_i.cpp
+ Log/BasicLog_i.cpp
+ Log/Hash_Iterator_i.cpp
+ Log/Hash_LogRecordStore.cpp
+ Log/Hash_LogStore.cpp
+ Log/Hash_Persistence_Strategy.cpp
+ Log/Iterator_i.cpp
+ Log/LogActivator.cpp
+ Log/LogMgr_i.cpp
+ Log/LogNotification.cpp
+ Log/LogRecordStore.cpp
+ Log/Log_Compaction_Handler.cpp
+ Log/Log_Constraint_Interpreter.cpp
+ Log/Log_Constraint_Visitors.cpp
+ Log/Log_Flush_Handler.cpp
+ Log/Log_i.cpp
+ }
+
+ Header_Files {
+ Log/LogStore.h
+ Log/Log_Persistence_Strategy.h
+ Log/log_serv_export.h
+ }
+
+ Inline_Files {
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_DsLogAdmin_Serv.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/DsLogAdmin.rc b/TAO/orbsvcs/orbsvcs/DsLogAdmin.rc
new file mode 100644
index 00000000000..d9c4397bc94
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/DsLogAdmin.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "DsLogAdmin\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_DsLogAdminDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_DsLogAdmin.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/DsLogNotification.idl b/TAO/orbsvcs/orbsvcs/DsLogNotification.idl
new file mode 100644
index 00000000000..ff06d490c53
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/DsLogNotification.idl
@@ -0,0 +1,112 @@
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// DsLogNotification.idl
+//
+// = DESCRIPTION
+// This module defines the Log Generated Events module
+// for the OMG's Telecom Event Log Service
+//
+// ============================================================================
+
+#ifndef DS_LOG_NOTIFICATION_IDL
+#define DS_LOG_NOTIFICATION_IDL
+
+#include "DsLogAdmin.idl"
+// CORBA Log Service
+
+#pragma prefix "omg.org"
+
+module DsLogNotification
+{
+
+ typedef DsLogAdmin::Log Log;
+ typedef DsLogAdmin::LogId LogId;
+ typedef DsLogAdmin::Threshold Threshold;
+ typedef TimeBase::TimeT TimeT;
+
+ // definition of ThresholdAlarm, the event generated by Log when
+ // Log reaches its capacity alarm threshold
+
+ typedef unsigned short PerceivedSeverityType;
+
+ const PerceivedSeverityType critical = 0;
+ const PerceivedSeverityType minor = 1;
+ const PerceivedSeverityType cleared = 2;
+
+ struct ThresholdAlarm {
+ Log logref;
+ LogId id;
+ TimeT time;
+ Threshold crossed_value; // the threshold level just being crossed
+ Threshold observed_value; // the current percentage
+ PerceivedSeverityType perceived_severity;
+ };
+
+ // the events generated by
+ // Log when a Log object is created or deleted
+
+ struct ObjectCreation {
+ LogId id;
+ TimeT time;
+ };
+
+ // NOTE: cannot say "typedef ObjectCreation ObjectDeletion because
+ // type would be lost in current C++ mappings for Anys.
+
+ struct ObjectDeletion {
+ LogId id;
+ TimeT time;
+ };
+
+ // definition of AttributeValueChange notification, the event generated by
+ // Log when a Log's attribute has changed
+
+ typedef unsigned short AttributeType;
+ const AttributeType capacityAlarmThreshold = 0;
+ const AttributeType logFullAction = 1;
+ const AttributeType maxLogSize = 2;
+ const AttributeType startTime = 3;
+ const AttributeType stopTime = 4;
+ const AttributeType weekMask = 5;
+ const AttributeType filter = 6;
+ const AttributeType maxRecordLife = 7;
+ const AttributeType qualityOfService = 8;
+
+ struct AttributeValueChange {
+ Log logref;
+ LogId id;
+ TimeT time;
+ AttributeType type;
+ any old_value;
+ any new_value;
+ };
+
+ // definition of StateChange notification, the event generated by
+ // Log when a Log's state has changed
+
+ typedef unsigned short StateType;
+ const StateType administrativeState = 0;
+ const StateType operationalState = 1;
+ const StateType forwardingState = 2;
+
+ struct StateChange {
+ Log logref;
+ LogId id;
+ TimeT time;
+ StateType type;
+ any new_value;
+ };
+
+ struct ProcessingErrorAlarm {
+ // Event generated by a log when a problem occurs within the log.
+ // The highest 20 bits or error_num are reserved for vender
+ // specific Ids.
+ long error_num;
+ string error_string;
+ };
+};
+
+#endif /* DS_LOG_NOTIFICATION_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin.idl b/TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin.idl
new file mode 100644
index 00000000000..36ebae57f5f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin.idl
@@ -0,0 +1,66 @@
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// DsNotifyLogAdmin.idl
+//
+// = DESCRIPTION
+// This module defines the NotifyLog and
+// NotifyLogFactory interfaces.
+//
+// = AUTHOR
+// David Hanvey (d.hanvey@qub.ac.uk)
+//
+// ============================================================================
+
+#ifndef DS_NOTIFY_LOG_ADMIN_IDL
+#define DS_NOTIFY_LOG_ADMIN_IDL
+
+#include "DsEventLogAdmin.idl"
+#include "CosNotifyChannelAdmin.idl"
+#include "CosNotifyFilter.idl"
+#include "CosNotification.idl"
+#pragma prefix "omg.org"
+
+module DsNotifyLogAdmin
+{
+ interface NotifyLog : DsEventLogAdmin::EventLog,
+ CosNotifyChannelAdmin::EventChannel
+ {
+ CosNotifyFilter::Filter get_filter();
+ void set_filter(in CosNotifyFilter::Filter filter);
+ };
+
+ interface NotifyLogFactory : DsLogAdmin::LogMgr,
+ CosNotifyChannelAdmin::ConsumerAdmin
+ {
+ NotifyLog create (
+ in DsLogAdmin::LogFullActionType full_action,
+ in unsigned long long max_size,
+ in DsLogAdmin::CapacityAlarmThresholdList thresholds,
+ in CosNotification::QoSProperties initial_qos,
+ in CosNotification::AdminProperties initial_admin,
+ out DsLogAdmin::LogId id
+ ) raises (DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold,
+ CosNotification::UnsupportedQoS,
+ CosNotification::UnsupportedAdmin);
+
+ NotifyLog create_with_id (
+ in DsLogAdmin::LogId id,
+ in DsLogAdmin::LogFullActionType full_action,
+ in unsigned long long max_size,
+ in DsLogAdmin::CapacityAlarmThresholdList thresholds,
+ in CosNotification::QoSProperties initial_qos,
+ in CosNotification::AdminProperties initial_admin
+ ) raises (DsLogAdmin::LogIdAlreadyExists,
+ DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold,
+ CosNotification::UnsupportedQoS,
+ CosNotification::UnsupportedAdmin);
+ };
+
+};
+
+#endif /* DS_NOTIFY_LOG_ADMIN_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin.mpc b/TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin.mpc
new file mode 100644
index 00000000000..bf66701ee09
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin.mpc
@@ -0,0 +1,110 @@
+// -*- MPC -*-
+// $Id$
+
+project(DsNotifyLogAdmin_IDL) : orbsvcslib, core, dslogadmin, dseventlogadmin, event, notification, tao_versioning_idl_defaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=TAO_NotifyLog_Export -Wb,stub_export_include=orbsvcs/Log/notifylog_export.h -Wb,skel_export_macro=TAO_NotifyLog_Skel_Export -Wb,skel_export_include=orbsvcs/Log/notifylog_skel_export.h
+
+ IDL_Files {
+ DsNotifyLogAdmin.idl
+ }
+}
+
+project(DsNotifyLogAdmin) : orbsvcslib, core, dslogadmin, dseventlogadmin, event, notification {
+ sharedname = TAO_DsNotifyLogAdmin
+ dynamicflags = TAO_NOTIFYLOG_BUILD_DLL
+ tagchecks += Log
+ after += DsNotifyLogAdmin_IDL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ DsNotifyLogAdminC.cpp
+ }
+
+ Header_Files {
+ DsNotifyLogAdminC.h
+ Log/notifylog_export.h
+ }
+
+ Inline_Files {
+ DsNotifyLogAdminC.inl
+ }
+
+ Template_Files {
+ }
+
+ // explicit Resource_Files to avoid including _Skel & _Serv rc files.
+ Resource_Files {
+ DsNotifyLogAdmin.rc
+ }
+
+ Pkgconfig_Files {
+ TAO_DsNotifyLogAdmin.pc.in
+ }
+}
+
+
+project(DsNotifyLogAdmin_Skel) : orbsvcslib, core, dsnotifylogadmin, dseventlogadmin_skel, dslogadmin_skel, event_skel, notification_skel, portableserver {
+ sharedname = TAO_DsNotifyLogAdmin_Skel
+ dynamicflags = TAO_NOTIFYLOG_SKEL_BUILD_DLL
+ tagchecks += Log
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ DsNotifyLogAdminS.cpp
+ }
+
+ Header_Files {
+ DsNotifyLogAdminS.h
+ DsNotifyLogAdminS_T.h
+ Log/notifylog_skel_export.h
+ }
+
+ Inline_Files {
+ DsNotifyLogAdminS.inl
+ DsNotifyLogAdminS_T.inl
+ }
+
+ Template_Files {
+ DsNotifyLogAdminS_T.cpp
+ }
+
+ Pkgconfig_Files {
+ TAO_DsNotifyLogAdmin_Skel.pc.in
+ }
+}
+
+
+project(DsNotifyLogAdmin_Serv) : orbsvcslib, core, dsnotifylogadmin_skel, dslogadmin_serv {
+ sharedname = TAO_DsNotifyLogAdmin_Serv
+ dynamicflags = TAO_NOTIFYLOG_SERV_BUILD_DLL
+ tagchecks += Log
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Log/NotifyLogConsumer.cpp
+ Log/NotifyLogFactory_i.cpp
+ Log/NotifyLogNotification.cpp
+ Log/NotifyLog_i.cpp
+ }
+
+ Header_Files {
+ Log/notifylog_serv_export.h
+ }
+
+ Inline_Files {
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_DsNotifyLogAdmin_Serv.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin.rc b/TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin.rc
new file mode 100644
index 00000000000..52b474bacc0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "DsNotifyLogAdmin\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_DsNotifyLogAdminDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_DsNotifyLogAdmin.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Busy_Lock.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Busy_Lock.cpp
new file mode 100644
index 00000000000..0cca17fb185
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Busy_Lock.cpp
@@ -0,0 +1,64 @@
+// $Id$
+
+#ifndef TAO_ESF_BUSY_LOCK_CPP
+#define TAO_ESF_BUSY_LOCK_CPP
+
+#include "orbsvcs/ESF/ESF_Busy_Lock.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Busy_Lock.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class T>
+int TAO_ESF_Busy_Lock_Adapter<T>::remove (void)
+{
+ return 0;
+}
+
+template<class T>
+int TAO_ESF_Busy_Lock_Adapter<T>::acquire (void)
+{
+ return this->adaptee_->busy ();
+}
+
+template<class T>
+int TAO_ESF_Busy_Lock_Adapter<T>::tryacquire (void)
+{
+ return this->adaptee_->busy ();
+}
+
+template<class T>
+int TAO_ESF_Busy_Lock_Adapter<T>::release (void)
+{
+ return this->adaptee_->idle ();
+}
+
+template<class T>
+int TAO_ESF_Busy_Lock_Adapter<T>::acquire_read (void)
+{
+ return this->adaptee_->busy ();
+}
+
+template<class T>
+int TAO_ESF_Busy_Lock_Adapter<T>::acquire_write (void)
+{
+ return this->adaptee_->busy ();
+}
+
+template<class T>
+int TAO_ESF_Busy_Lock_Adapter<T>::tryacquire_read (void)
+{
+ return this->adaptee_->busy ();
+}
+
+template<class T>
+int TAO_ESF_Busy_Lock_Adapter<T>::tryacquire_write (void)
+{
+ return this->adaptee_->busy ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ESF_BUSY_LOCK_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Busy_Lock.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Busy_Lock.h
new file mode 100644
index 00000000000..2c112e4f25e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Busy_Lock.h
@@ -0,0 +1,80 @@
+/* -*- C++ -*- */
+/**
+ * @file ESF_Busy_Lock.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ESF_BUSY_LOCK_H
+#define TAO_ESF_BUSY_LOCK_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Adapt classes that implement the "busy lock" protocol, to conform
+/// to the ACE Lock interface.
+/**
+ * The ACE Lock interface allows us to use any mutex-like object with
+ * the ACE synchronization components (such as guards, Lock_Adapter,
+ * etc.).
+ * One of the synchronization protocols used in the event services
+ * uses the following protocol:
+ * <UL>
+ * <LI> To acquire the lock the @c busy method of the object is invoked.
+ * <LI> To release the lock the @c idle method of the object is invoked.
+ * <LI> Any changes performed while the lock is held are delayed until
+ * all the locks are released, i.e. the last call to @c idle
+ * executes the changes.
+ * </UL>
+ */
+template<class Adaptee>
+class TAO_ESF_Busy_Lock_Adapter
+{
+public:
+ /// Constructor
+ TAO_ESF_Busy_Lock_Adapter (Adaptee* adaptee);
+
+ /**
+ * @name The ACE_Lock methods
+ *
+ * Check the documentation in ace/Synch.h for details.
+ */
+ //@{
+ int remove (void);
+ int acquire (void);
+ int tryacquire (void);
+ int release (void);
+ int acquire_read (void);
+ int acquire_write (void);
+ int tryacquire_read (void);
+ int tryacquire_write (void);
+ //@}
+
+private:
+ Adaptee* adaptee_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Busy_Lock.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_Busy_Lock.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_Busy_Lock.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_ESF_BUSY_LOCK_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Busy_Lock.i b/TAO/orbsvcs/orbsvcs/ESF/ESF_Busy_Lock.i
new file mode 100644
index 00000000000..8c39a00c2e9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Busy_Lock.i
@@ -0,0 +1,13 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class T> ACE_INLINE
+TAO_ESF_Busy_Lock_Adapter<T>::TAO_ESF_Busy_Lock_Adapter (T* adaptee)
+ : adaptee_ (adaptee)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Read.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Read.cpp
new file mode 100644
index 00000000000..ea15a0e703e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Read.cpp
@@ -0,0 +1,120 @@
+// $Id$
+
+#ifndef TAO_ESF_COPY_ON_READ_CPP
+#define TAO_ESF_COPY_ON_READ_CPP
+
+#include "orbsvcs/ESF/ESF_Copy_On_Read.h"
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK>
+TAO_ESF_Copy_On_Read<PROXY,COLLECTION,ITERATOR,ACE_LOCK>::
+ TAO_ESF_Copy_On_Read (void)
+{
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK>
+TAO_ESF_Copy_On_Read<PROXY,COLLECTION,ITERATOR,ACE_LOCK>::
+ TAO_ESF_Copy_On_Read (const COLLECTION &collection)
+ : collection_ (collection)
+{
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK> void
+TAO_ESF_Copy_On_Read<PROXY,COLLECTION,ITERATOR,ACE_LOCK>::
+ for_each (TAO_ESF_Worker<PROXY> *worker
+ ACE_ENV_ARG_DECL)
+{
+ // @@ Use an allocator for this memory...
+ PROXY **proxies = 0;
+ size_t size = 0;
+ ACE_TRY
+ {
+ {
+ ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
+
+ size = this->collection_.size ();
+ ACE_NEW (proxies, PROXY*[size]);
+ PROXY **j = proxies;
+
+ for (; j != proxies + size; ++j)
+ *j = 0;
+
+ j = proxies;
+
+ ITERATOR end = this->collection_.end ();
+ for (ITERATOR i = this->collection_.begin (); i != end; ++i)
+ {
+ *j = *i;
+ (*j)->_incr_refcnt ();
+ ++j;
+ }
+ }
+ worker->set_size(size);
+ for (PROXY **j = proxies; j != proxies + size; ++j)
+ {
+ worker->work (*j ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ (*j)->_decr_refcnt ();
+ }
+ delete[] proxies;
+ }
+ ACE_CATCHANY
+ {
+ for (PROXY **j = proxies; j != proxies + size; ++j)
+ {
+ if (*j != 0)
+ (*j)->_decr_refcnt ();
+ }
+ delete[] proxies;
+
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK> void
+TAO_ESF_Copy_On_Read<PROXY,COLLECTION,ITERATOR,ACE_LOCK>::
+ connected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
+
+ proxy->_incr_refcnt ();
+ this->collection_.connected (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK> void
+TAO_ESF_Copy_On_Read<PROXY,COLLECTION,ITERATOR,ACE_LOCK>::
+ reconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
+
+ proxy->_incr_refcnt ();
+ this->collection_.reconnected (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK> void
+TAO_ESF_Copy_On_Read<PROXY,COLLECTION,ITERATOR,ACE_LOCK>::
+ disconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
+
+ this->collection_.disconnected (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK> void
+TAO_ESF_Copy_On_Read<PROXY,COLLECTION,ITERATOR,ACE_LOCK>::
+ shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
+
+ this->collection_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ESF_COPY_ON_READ_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Read.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Read.h
new file mode 100644
index 00000000000..d5c7c22fcd8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Read.h
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+/**
+ * @file ESF_Copy_On_Read.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ESF_COPY_ON_READ_H
+#define TAO_ESF_COPY_ON_READ_H
+
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class Target> class TAO_ESF_Worker;
+
+// ****************************************************************
+
+/**
+ * @class TAO_ESF_Copy_On_Read
+ *
+ * @brief Implement the Copy_On_Read protocol
+ *
+ *
+ * The class is parametric on the kind of collection and locking
+ * mechanism used.
+ */
+template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK>
+class TAO_ESF_Copy_On_Read : public TAO_ESF_Proxy_Collection<PROXY>
+{
+public:
+ /// Constructors
+ TAO_ESF_Copy_On_Read (void);
+ TAO_ESF_Copy_On_Read (const COLLECTION &collection);
+
+ // = The TAO_ESF_Proxy_Collection methods
+ virtual void for_each (TAO_ESF_Worker<PROXY> *worker
+ ACE_ENV_ARG_DECL);
+ virtual void connected (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+ virtual void reconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+ virtual void disconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ COLLECTION collection_;
+
+ ACE_LOCK lock_;
+};
+
+// ****************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_Copy_On_Read.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_Copy_On_Read.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_ESF_COPY_ON_READ_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.cpp
new file mode 100644
index 00000000000..169f5eac972
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.cpp
@@ -0,0 +1,208 @@
+// $Id$
+
+#ifndef TAO_ESF_COPY_ON_WRITE_CPP
+#define TAO_ESF_COPY_ON_WRITE_CPP
+
+#include "orbsvcs/ESF/ESF_Copy_On_Write.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Copy_On_Write.i"
+#endif /* __ACE_INLINE__ */
+
+#include "tao/Environment.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class COLLECTION, class ITERATOR> CORBA::ULong
+TAO_ESF_Copy_On_Write_Collection<COLLECTION,ITERATOR>::_incr_refcnt (void)
+{
+ // LOCKING: no locking is required, the caller grabs the mutex.
+ return this->refcount_++;
+}
+
+template<class COLLECTION, class ITERATOR> CORBA::ULong
+TAO_ESF_Copy_On_Write_Collection<COLLECTION,ITERATOR>::_decr_refcnt (void)
+{
+ // LOCKING: no locking is required, the caller grabs the mutex.
+ {
+ this->refcount_--;
+ if (this->refcount_ != 0)
+ return this->refcount_;
+ }
+
+ ITERATOR end = this->collection.end ();
+ for (ITERATOR i = this->collection.begin (); i != end; ++i)
+ {
+ (*i)->_decr_refcnt ();
+ }
+
+ delete this;
+ return 0;
+}
+
+// ****************************************************************
+
+template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL>
+TAO_ESF_Copy_On_Write<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>::
+ TAO_ESF_Copy_On_Write (void)
+ : pending_writes_ (0),
+ writing_ (0),
+ cond_ (mutex_)
+{
+ ACE_NEW (this->collection_, Collection);
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL>
+TAO_ESF_Copy_On_Write<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>::
+ ~TAO_ESF_Copy_On_Write (void)
+{
+ ACE_GUARD (ACE_SYNCH_MUTEX_T, ace_mon, this->mutex_);
+
+ while (this->pending_writes_ != 0)
+ this->cond_.wait ();
+
+ this->collection_->_decr_refcnt ();
+ this->collection_ = 0;
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL> void
+TAO_ESF_Copy_On_Write<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>::
+ for_each (TAO_ESF_Worker<PROXY> *worker
+ ACE_ENV_ARG_DECL)
+{
+ Read_Guard ace_mon (this->mutex_,
+ this->collection_);
+
+ worker->set_size(ace_mon.collection->collection.size());
+ ITERATOR end = ace_mon.collection->collection.end ();
+ for (ITERATOR i = ace_mon.collection->collection.begin (); i != end; ++i)
+ {
+ worker->work (*i ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL> void
+TAO_ESF_Copy_On_Write<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>::
+ connected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ Write_Guard ace_mon (this->mutex_,
+ this->cond_,
+ this->pending_writes_,
+ this->writing_,
+ this->collection_);
+
+ proxy->_incr_refcnt ();
+ ace_mon.copy->collection.connected (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL> void
+TAO_ESF_Copy_On_Write<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>::
+ reconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ Write_Guard ace_mon (this->mutex_,
+ this->cond_,
+ this->pending_writes_,
+ this->writing_,
+ this->collection_);
+
+ proxy->_incr_refcnt ();
+ ace_mon.copy->collection.reconnected (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL> void
+TAO_ESF_Copy_On_Write<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>::
+ disconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ Write_Guard ace_mon (this->mutex_,
+ this->cond_,
+ this->pending_writes_,
+ this->writing_,
+ this->collection_);
+
+ ace_mon.copy->collection.disconnected (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL> void
+TAO_ESF_Copy_On_Write<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>::
+ shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // We need to perform a copy to follow the protocol.
+ Write_Guard ace_mon (this->mutex_,
+ this->cond_,
+ this->pending_writes_,
+ this->writing_,
+ this->collection_);
+
+ ace_mon.copy->collection.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+template<class COLLECTION, class ITERATOR, ACE_SYNCH_DECL>
+TAO_ESF_Copy_On_Write_Write_Guard<COLLECTION,ITERATOR,ACE_SYNCH_USE>::
+ TAO_ESF_Copy_On_Write_Write_Guard (ACE_SYNCH_MUTEX_T &m,
+ ACE_SYNCH_CONDITION_T &c,
+ int &p,
+ int &w,
+ Collection*& cr)
+ : copy (0),
+ mutex (m),
+ cond (c),
+ pending_writes (p),
+ writing_flag (w),
+ collection (cr)
+{
+ {
+ ACE_GUARD (ACE_SYNCH_MUTEX_T, ace_mon, this->mutex);
+
+ this->pending_writes++;
+
+ while (this->writing_flag != 0)
+ this->cond.wait ();
+
+ this->writing_flag = 1;
+ }
+
+ // Copy outside the mutex, because it may take a long time.
+ // Nobody can change it, because it is protected by the
+ // writing_flag.
+
+ // First initialize it (with the correct reference count
+ ACE_NEW (this->copy, Collection);
+ // Copy the contents
+ this->copy->collection = this->collection->collection;
+
+ // Increase the reference counts
+ ITERATOR end = this->copy->collection.end ();
+ for (ITERATOR i = this->copy->collection.begin (); i != end; ++i)
+ {
+ (*i)->_incr_refcnt ();
+ }
+}
+
+template<class COLLECTION, class ITERATOR, ACE_SYNCH_DECL>
+TAO_ESF_Copy_On_Write_Write_Guard<COLLECTION,ITERATOR,ACE_SYNCH_USE>::
+ ~TAO_ESF_Copy_On_Write_Write_Guard (void)
+{
+ Collection *tmp = 0;
+ {
+ ACE_GUARD (ACE_SYNCH_MUTEX_T, ace_mon, this->mutex);
+
+ tmp = this->collection;
+ this->collection = this->copy;
+ this->writing_flag = 0;
+ this->pending_writes--;
+
+ this->cond.signal ();
+ }
+ // Delete outside the mutex, because it may take a long time.
+ tmp->_decr_refcnt ();
+}
+
+// ****************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ESF_COPY_ON_WRITE_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.h
new file mode 100644
index 00000000000..a34659b6e57
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.h
@@ -0,0 +1,184 @@
+// -*- C++ -*-
+
+/**
+ * @file ESF_Copy_On_Write.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ESF_COPY_ON_WRITE_H
+#define TAO_ESF_COPY_ON_WRITE_H
+
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+
+#include "tao/Basic_Types.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class COLLECTION, class ITERATOR>
+class TAO_ESF_Copy_On_Write_Collection
+{
+public:
+ TAO_ESF_Copy_On_Write_Collection (void);
+
+ /// Increment the reference count
+ CORBA::ULong _incr_refcnt (void);
+
+ /// Decrement the reference count
+ CORBA::ULong _decr_refcnt (void);
+
+ /// The actual collection
+ COLLECTION collection;
+
+private:
+ /// The reference count
+ CORBA::ULong refcount_;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_ESF_Copy_On_Write_Read_Guard
+ *
+ * @brief TAO_ESF_Copy_On_Write_Read_Guard
+ *
+ * This helper class atomically increments the reference count of
+ * a TAO_ESF_Copy_On_Write_Collection and reads the current
+ * collection in the Copy_On_Write class.
+ */
+template<class COLLECTION, class ITERATOR, class ACE_LOCK>
+class TAO_ESF_Copy_On_Write_Read_Guard
+{
+public:
+ /// Constructor
+ typedef TAO_ESF_Copy_On_Write_Collection<COLLECTION,ITERATOR> Collection;
+ TAO_ESF_Copy_On_Write_Read_Guard (ACE_LOCK &mutex,
+ Collection *&collection);
+
+ /// Destructor
+ ~TAO_ESF_Copy_On_Write_Read_Guard (void);
+
+ Collection *collection;
+
+private:
+ ACE_LOCK &mutex;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_ESF_Copy_On_Write_Write_Guard
+ *
+ * @brief TAO_ESF_Copy_On_Write_Write_Guard
+ *
+ * This helper class atomically increments the reference count of
+ * a TAO_ESF_Copy_On_Write_Collection and reads the current
+ * collection in the Copy_On_Write class.
+ */
+template<class COLLECTION, class ITERATOR, ACE_SYNCH_DECL>
+class TAO_ESF_Copy_On_Write_Write_Guard
+{
+public:
+ /// Constructor
+ typedef TAO_ESF_Copy_On_Write_Collection<COLLECTION,ITERATOR> Collection;
+ TAO_ESF_Copy_On_Write_Write_Guard (ACE_SYNCH_MUTEX_T &mutex,
+ ACE_SYNCH_CONDITION_T &cond,
+ int &pending_writes,
+ int &writing_flag,
+ Collection*& collection);
+
+ /// Destructor
+ ~TAO_ESF_Copy_On_Write_Write_Guard (void);
+
+ Collection *copy;
+
+private:
+ ACE_SYNCH_MUTEX_T &mutex;
+ ACE_SYNCH_CONDITION_T &cond;
+ int &pending_writes;
+ int &writing_flag;
+ Collection *&collection;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_ESF_Copy_On_Write
+ *
+ * @brief TAO_ESF_Copy_On_Write
+ *
+ * Implement the Copy_On_Write protocol
+ * The class is parametric on the kind of collection and locking
+ * mechanism used.
+ */
+template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL>
+class TAO_ESF_Copy_On_Write : public TAO_ESF_Proxy_Collection<PROXY>
+{
+public:
+ /// Constructor
+ typedef TAO_ESF_Copy_On_Write_Read_Guard<COLLECTION,ITERATOR,ACE_SYNCH_MUTEX_T> Read_Guard;
+ typedef TAO_ESF_Copy_On_Write_Write_Guard<COLLECTION,ITERATOR,ACE_SYNCH_USE> Write_Guard;
+ TAO_ESF_Copy_On_Write (void);
+
+ /// Destructor
+ ~TAO_ESF_Copy_On_Write (void);
+
+ // = The TAO_ESF_Proxy methods
+ virtual void for_each (TAO_ESF_Worker<PROXY> *worker
+ ACE_ENV_ARG_DECL);
+ virtual void connected (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+ virtual void reconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+ virtual void disconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ typedef TAO_ESF_Copy_On_Write_Collection<COLLECTION,ITERATOR> Collection;
+
+ /// A mutex to serialize access to the collection pointer.
+ ACE_SYNCH_MUTEX_T mutex_;
+
+ /// Number of pending writes
+ int pending_writes_;
+
+ /**
+ * If non-zero then a thread is changing the collection. Many
+ * threads can use the collection simulatenously, but only one
+ * change it.
+ */
+ int writing_;
+
+ /// A condition variable to wait to synchronize multiple writers.
+ ACE_SYNCH_CONDITION_T cond_;
+
+ /// The collection, with reference counting added
+ Collection *collection_;
+};
+
+// ****************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Copy_On_Write.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_Copy_On_Write.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_Copy_On_Write.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_ESF_COPY_ON_WRITE_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.i b/TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.i
new file mode 100644
index 00000000000..d3ad3d108c7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Copy_On_Write.i
@@ -0,0 +1,41 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class COLLECTION, class ITERATOR> ACE_INLINE
+TAO_ESF_Copy_On_Write_Collection<COLLECTION,ITERATOR>::
+ TAO_ESF_Copy_On_Write_Collection (void)
+ : refcount_ (1)
+{
+}
+
+// ****************************************************************
+
+template<class COLLECTION, class ITERATOR, class ACE_LOCK> ACE_INLINE
+TAO_ESF_Copy_On_Write_Read_Guard<COLLECTION,ITERATOR,ACE_LOCK>::
+ TAO_ESF_Copy_On_Write_Read_Guard (ACE_LOCK &m,
+ Collection*& collection_ref)
+ : collection (0),
+ mutex (m)
+{
+ ACE_GUARD (ACE_LOCK, ace_mon, this->mutex);
+ this->collection = collection_ref;
+ this->collection->_incr_refcnt ();
+}
+
+template<class COLLECTION, class ITERATOR, class ACE_LOCK> ACE_INLINE
+TAO_ESF_Copy_On_Write_Read_Guard<COLLECTION,ITERATOR,ACE_LOCK>::
+ ~TAO_ESF_Copy_On_Write_Read_Guard (void)
+{
+ if (this->collection != 0)
+ {
+ ACE_GUARD (ACE_LOCK, ace_mon, this->mutex);
+ this->collection->_decr_refcnt ();
+ }
+}
+
+// ****************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Defaults.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Defaults.h
new file mode 100644
index 00000000000..7eaa3a6d306
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Defaults.h
@@ -0,0 +1,37 @@
+// -*- C++ -*-
+/**
+ * @file ESF_Defaults.h
+ *
+ * $Id$
+ *
+ * In this file we set the compile time defaults for the framework.
+ *
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ESF_DEFAULTS_H
+#define TAO_ESF_DEFAULTS_H
+
+#ifndef TAO_ESF_ENABLE_DEBUG_MESSAGES
+#define TAO_ESF_ENABLE_DEBUG_MESSAGES 0
+#endif /* TAO_ESF_ENABLE_DEBUG_MESSAGES */
+
+// Control the maximum degree of concurrency tolerated by the EC, some
+// kind of limit is required to avoid starvation of delayed write
+// operations.
+#ifndef TAO_ESF_DEFAULT_BUSY_HWM
+# define TAO_ESF_DEFAULT_BUSY_HWM 1024
+#endif /* TAO_ESF_DEFAULT_BUSY_HWM */
+
+#ifndef TAO_ESF_DEFAULT_MAX_WRITE_DELAY
+# define TAO_ESF_DEFAULT_MAX_WRITE_DELAY 2048
+#endif /* TAO_ESF_DEFAULT_MAX_WRITE_DELAY */
+
+#ifndef TAO_ESF_DEFAULT_ORB_ID
+# define TAO_ESF_DEFAULT_ORB_ID "" /* */
+#endif /* TAO_ESF_DEFAULT_ORB_ID */
+
+#endif /* TAO_ESF_DEFAULTS_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.cpp
new file mode 100644
index 00000000000..5398387800c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.cpp
@@ -0,0 +1,216 @@
+// $Id$
+
+#ifndef TAO_ESF_DELAYED_CHANGES_CPP
+#define TAO_ESF_DELAYED_CHANGES_CPP
+
+#include "orbsvcs/ESF/ESF_Delayed_Changes.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Delayed_Changes.i"
+#endif /* __ACE_INLINE__ */
+
+#include "orbsvcs/ESF/ESF_Defaults.h"
+#include "orbsvcs/ESF/ESF_Worker.h"
+#include "orbsvcs/ESF/ESF_Delayed_Command.h"
+
+#include "ace/Functor.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL>
+TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>::
+ TAO_ESF_Delayed_Changes (void)
+ : lock_ (this),
+ busy_cond_ (busy_lock_),
+ busy_count_ (0),
+ write_delay_count_ (0),
+ busy_hwm_ (TAO_ESF_DEFAULT_BUSY_HWM),
+ max_write_delay_ (TAO_ESF_DEFAULT_MAX_WRITE_DELAY)
+{
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL>
+TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>::
+ TAO_ESF_Delayed_Changes (const COLLECTION &collection)
+ : collection_ (collection),
+ lock_ (this),
+ busy_cond_ (busy_lock_),
+ busy_count_ (0),
+ write_delay_count_ (0),
+ busy_hwm_ (TAO_ESF_DEFAULT_BUSY_HWM),
+ max_write_delay_ (TAO_ESF_DEFAULT_MAX_WRITE_DELAY)
+{
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL> void
+TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>::
+ for_each (TAO_ESF_Worker<PROXY> *worker
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD (Busy_Lock, ace_mon, this->lock_);
+
+ worker->set_size(this->collection_.size());
+ ITERATOR end = this->collection_.end ();
+ for (ITERATOR i = this->collection_.begin (); i != end; ++i)
+ {
+ worker->work (*i ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ }
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL> int
+TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>::
+ busy (void)
+{
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->busy_lock_, -1);
+
+ while (this->busy_count_ >= this->busy_hwm_
+ || this->write_delay_count_ >= this->max_write_delay_)
+ this->busy_cond_.wait ();
+ this->busy_count_++;
+
+ return 0;
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL> int
+TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>::
+ idle (void)
+{
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->busy_lock_, -1);
+
+ this->busy_count_--;
+ if (this->busy_count_ == 0)
+ {
+ this->write_delay_count_ = 0;
+ this->execute_delayed_operations ();
+ this->busy_cond_.broadcast ();
+ }
+ return 0;
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL> int
+TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>::
+ execute_delayed_operations (void)
+{
+ while (!this->command_queue_.is_empty ())
+ {
+ ACE_Command_Base* command = 0;
+ this->command_queue_.dequeue_head (command);
+
+ command->execute ();
+
+ delete command;
+ }
+ return 0;
+}
+
+template<class PROXY, class C, class I,ACE_SYNCH_DECL> void
+TAO_ESF_Delayed_Changes<PROXY,C,I,ACE_SYNCH_USE>::
+ connected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (ACE_SYNCH_MUTEX_T, ace_mon, this->busy_lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ proxy->_incr_refcnt ();
+ if (this->busy_count_ == 0)
+ {
+ // We can add the object immediately
+ this->connected_i (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ ACE_Command_Base* command = 0;
+ ACE_NEW (command,
+ Connected_Command (this,
+ proxy));
+ this->command_queue_.enqueue_tail (command);
+ this->write_delay_count_++;
+ }
+}
+
+template<class PROXY, class C, class I,ACE_SYNCH_DECL> void
+TAO_ESF_Delayed_Changes<PROXY,C,I,ACE_SYNCH_USE>::
+ reconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (ACE_SYNCH_MUTEX_T, ace_mon, this->busy_lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ proxy->_incr_refcnt ();
+ if (this->busy_count_ == 0)
+ {
+ // We can reconnect the object immediately
+ this->reconnected_i (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ ACE_Command_Base* command;
+ ACE_NEW (command,
+ Reconnected_Command (this,
+ proxy));
+ this->command_queue_.enqueue_tail (command);
+ this->write_delay_count_++;
+ }
+}
+
+template<class PROXY, class C, class I,ACE_SYNCH_DECL> void
+TAO_ESF_Delayed_Changes<PROXY,C,I,ACE_SYNCH_USE>::
+ disconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (ACE_SYNCH_MUTEX_T, ace_mon, this->busy_lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ if (this->busy_count_ == 0)
+ {
+ // We can remove the object immediately
+ this->disconnected_i (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ ACE_Command_Base* command;
+ ACE_NEW (command,
+ Disconnected_Command (this,
+ proxy));
+ this->command_queue_.enqueue_tail (command);
+ this->write_delay_count_++;
+ }
+}
+
+template<class PROXY, class C, class I,ACE_SYNCH_DECL> void
+TAO_ESF_Delayed_Changes<PROXY,C,I,ACE_SYNCH_USE>::
+ shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (ACE_SYNCH_MUTEX_T, ace_mon, this->busy_lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ if (this->busy_count_ == 0)
+ {
+ // We can shutdown the object immediately
+ this->shutdown_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ ACE_Command_Base* command;
+ ACE_NEW (command,
+ Shutdown_Command (this));
+ this->command_queue_.enqueue_tail (command);
+ this->write_delay_count_++;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ESF_DELAYED_CHANGES_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.h
new file mode 100644
index 00000000000..2bf47dd49b4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.h
@@ -0,0 +1,160 @@
+// -*- C++ -*-
+/**
+ * @file ESF_Delayed_Changes.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ESF_DELAYED_CHANGES_H
+#define TAO_ESF_DELAYED_CHANGES_H
+
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Busy_Lock.h"
+
+#include "ace/Containers.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Command_Base;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class Target,class Object> class TAO_ESF_Connected_Command;
+template<class Target,class Object> class TAO_ESF_Disconnected_Command;
+template<class Target,class Object> class TAO_ESF_Reconnected_Command;
+template<class Target> class TAO_ESF_Shutdown_Command;
+
+/**
+ * @class TAO_ESF_Delayed_Changes
+ *
+ * @brief TAO_ESF_Delayed_Operations
+ *
+ * This class implements the Delayed Operations protocol to solve
+ * the concurrency challenges outlined in the documentation of
+ * TAO_ESF_Proxy_Collection.
+ * In short the class delays changes by putting them on an
+ * "operation queue", the operations are stored as command objects
+ * in this queue and executed once the system is quiescent
+ * (i.e. no threads are iterating over the collection).
+ * The algorithm implemented so far is:
+ * - If a thread is using the set then it increases the busy
+ * count, this is done by calling the busy() method. Once the
+ * thread has stopped using the collection the idle() method is
+ * invoked and the busy count is decreased.
+ * A helper class (Busy_Lock) is used to hide this protocol
+ * behind the familiar GUARD idiom.
+ * - If the busy count reaches the busy_hwm then the thread must
+ * wait until the count reaches 0 again.
+ * This can be used to control the maximum concurrency in the
+ * EC, matching it (for example) with the number of
+ * processors. Setting the concurrency to a high value (say one
+ * million) allows for an arbitrary number of threads to execute
+ * concurrently.
+ * - If a modification is posted to the collection we need to
+ * execute it at some point.
+ * Just using the busy_hwm would not work, the HWM may not be
+ * reached ever, so another form of control is needed.
+ * Instead we use another counter, that keeps track of how many
+ * threads have used the set since the modification was
+ * posted. If this number of threads reaches max_write_delay then
+ * we don't allow any more threads to go in, eventually the
+ * thread count reaches 0 and we can proceed with the operations.
+ * - There is one aspect of concurrency that can be problematic: if
+ * thread pushes events as part of an upcall then the same thread
+ * could be counted twice, we need to keep track of the threads
+ * that are dispatching events and not increase (or decrease) the
+ * reference count when a thread iterates twice over the same
+ * set.
+ * This solves the major problems, but there are other issues to
+ * be addressed:
+ * + How do we ensure that the operations are eventually executed?
+ * + How do we simplify the execution of the locking protocol for
+ * clients of this class?
+ * + How do we minimize overhead for single threaded execution?
+ * + How do we minimize the overhead for the cases where the
+ * threads dispatching events don't post changes to the
+ * collection?
+ */
+template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL>
+class TAO_ESF_Delayed_Changes : public TAO_ESF_Proxy_Collection<PROXY>
+{
+public:
+ TAO_ESF_Delayed_Changes (void);
+ TAO_ESF_Delayed_Changes (const COLLECTION &collection);
+
+ int busy (void);
+ int idle (void);
+ int execute_delayed_operations (void);
+
+ void connected_i (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+ void reconnected_i (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+ void disconnected_i (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+ void shutdown_i (ACE_ENV_SINGLE_ARG_DECL);
+
+ typedef TAO_ESF_Connected_Command<TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>,PROXY> Connected_Command;
+ typedef TAO_ESF_Reconnected_Command<TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>,PROXY> Reconnected_Command;
+ typedef TAO_ESF_Disconnected_Command<TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE>,PROXY> Disconnected_Command;
+ typedef TAO_ESF_Shutdown_Command<TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE> > Shutdown_Command;
+
+ // = The TAO_ESF_Proxy methods
+ virtual void for_each (TAO_ESF_Worker<PROXY> *worker
+ ACE_ENV_ARG_DECL);
+ virtual void connected (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+ virtual void reconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+ virtual void disconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ COLLECTION collection_;
+
+ typedef TAO_ESF_Busy_Lock_Adapter<TAO_ESF_Delayed_Changes<PROXY,COLLECTION,ITERATOR,ACE_SYNCH_USE> > Busy_Lock;
+
+ Busy_Lock lock_;
+
+ ACE_SYNCH_MUTEX_T busy_lock_;
+
+ ACE_SYNCH_CONDITION_T busy_cond_;
+
+ CORBA::ULong busy_count_;
+
+ CORBA::ULong write_delay_count_;
+
+ /// Control variables for the concurrency policies.
+ CORBA::ULong busy_hwm_;
+ CORBA::ULong max_write_delay_;
+
+ ACE_Unbounded_Queue<ACE_Command_Base*> command_queue_;
+};
+
+// ****************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Delayed_Changes.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_Delayed_Changes.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_Delayed_Changes.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_ESF_DELAYED_CHANGES_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.i b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.i
new file mode 100644
index 00000000000..4a2192e5a18
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Changes.i
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class PROXY, class C, class I,ACE_SYNCH_DECL> void
+TAO_ESF_Delayed_Changes<PROXY,C,I,ACE_SYNCH_USE>::
+ connected_i (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ this->collection_.connected (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+template<class PROXY, class C, class I,ACE_SYNCH_DECL> void
+TAO_ESF_Delayed_Changes<PROXY,C,I,ACE_SYNCH_USE>::
+ reconnected_i (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ this->collection_.reconnected (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+template<class PROXY, class C, class I,ACE_SYNCH_DECL> void
+TAO_ESF_Delayed_Changes<PROXY,C,I,ACE_SYNCH_USE>::
+ disconnected_i (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ this->collection_.disconnected (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+template<class PROXY, class C, class I,ACE_SYNCH_DECL> void
+TAO_ESF_Delayed_Changes<PROXY,C,I,ACE_SYNCH_USE>::
+ shutdown_i (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->collection_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp
new file mode 100644
index 00000000000..fe0a7812db0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp
@@ -0,0 +1,97 @@
+// $Id$
+
+#ifndef TAO_ESF_DELAYED_COMMAND_CPP
+#define TAO_ESF_DELAYED_COMMAND_CPP
+
+#include "orbsvcs/ESF/ESF_Delayed_Command.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Delayed_Command.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class Target, class Object> int
+TAO_ESF_Connected_Command<Target,Object>::execute (void* arg)
+{
+ if (arg != 0)
+ {
+ ACE_ENV_EMIT_CODE (CORBA::Environment &ACE_TRY_ENV =
+ *static_cast<CORBA::Environment*> (arg));
+ this->target_->connected_i (this->object_
+ ACE_ENV_ARG_PARAMETER);
+ }
+ else
+ {
+ ACE_ENV_EMIT_CODE (ACE_DECLARE_NEW_CORBA_ENV);
+ this->target_->connected_i (this->object_
+ ACE_ENV_ARG_PARAMETER);
+ }
+
+ return 0;
+}
+
+// ****************************************************************
+
+template<class Target, class Object> int
+TAO_ESF_Reconnected_Command<Target,Object>::execute (void* arg)
+{
+ if (arg != 0)
+ {
+ ACE_ENV_EMIT_CODE (CORBA::Environment &ACE_TRY_ENV =
+ *static_cast<CORBA::Environment*> (arg));
+ this->target_->reconnected_i (this->object_
+ ACE_ENV_ARG_PARAMETER);
+ }
+ else
+ {
+ ACE_ENV_EMIT_CODE (ACE_DECLARE_NEW_CORBA_ENV);
+ this->target_->reconnected_i (this->object_
+ ACE_ENV_ARG_PARAMETER);
+ }
+ return 0;
+}
+
+// ****************************************************************
+
+template<class Target, class Object> int
+TAO_ESF_Disconnected_Command<Target,Object>::execute (void* arg)
+{
+ if (arg != 0)
+ {
+ ACE_ENV_EMIT_CODE (CORBA::Environment &ACE_TRY_ENV =
+ *static_cast<CORBA::Environment*> (arg));
+ this->target_->disconnected_i (this->object_
+ ACE_ENV_ARG_PARAMETER);
+ }
+ else
+ {
+ ACE_ENV_EMIT_CODE (ACE_DECLARE_NEW_CORBA_ENV);
+ this->target_->disconnected_i (this->object_
+ ACE_ENV_ARG_PARAMETER);
+ }
+ return 0;
+}
+
+// ****************************************************************
+
+template<class Target> int
+TAO_ESF_Shutdown_Command<Target>::execute (void* arg)
+{
+ if (arg != 0)
+ {
+ ACE_ENV_EMIT_CODE (CORBA::Environment &ACE_TRY_ENV =
+ *static_cast<CORBA::Environment*> (arg));
+ this->target_->shutdown_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ else
+ {
+ ACE_ENV_EMIT_CODE (ACE_DECLARE_NEW_CORBA_ENV);
+ this->target_->shutdown_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ESF_DELAYED_COMMAND_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.h
new file mode 100644
index 00000000000..a827c4e6415
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.h
@@ -0,0 +1,187 @@
+// -*- C++ -*-
+
+/**
+ * @file ESF_Delayed_Command.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ESF_DELAYED_COMMAND_H
+#define TAO_ESF_DELAYED_COMMAND_H
+
+#include "ace/Functor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ESF_Connected_Command
+ *
+ * @brief Implements a Command object that invokes the connected_i()
+ * method on the target, passing an argument of type Object.
+ *
+ * <H2>Memory Managment</H2>
+ * It does not assume ownership of Object nor the Target
+ * arguments.
+ * Usually allocated from the heap or an allocator; but it is not
+ * self-managed.
+ *
+ * <H2>Locking</H2>
+ * No provisions for locking, access must be serialized
+ * externally.
+ */
+template<class Target, class Object>
+class TAO_ESF_Connected_Command : public ACE_Command_Base
+{
+public:
+ /// constructor...
+ TAO_ESF_Connected_Command (Target *target,
+ Object *object);
+
+ /// The callback method, if the argument is not nil it is interpreted
+ /// as a CORBA::Environment.
+ virtual int execute (void *arg);
+
+private:
+ /// The target
+ Target *target_;
+
+ /// The argument
+ Object *object_;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_ESF_Reconnected_Command
+ *
+ * @brief Implements a Command object that invokes the reconnected_i()
+ * method on the target, passing an argument of type Object.
+ *
+ * <H2>Memory Managment</H2>
+ * It does not assume ownership of Object nor the Target
+ * arguments.
+ * Usually allocated from the heap or an allocator; but it is not
+ * self-managed.
+ *
+ * <H2>Locking</H2>
+ * No provisions for locking, access must be serialized
+ * externally.
+ */
+template<class Target, class Object>
+class TAO_ESF_Reconnected_Command : public ACE_Command_Base
+{
+public:
+ /// constructor...
+ TAO_ESF_Reconnected_Command (Target *target,
+ Object *object);
+
+ /// The callback method, if the argument is not nil it is interpreted
+ /// as a CORBA::Environment.
+ virtual int execute (void *arg);
+
+private:
+ /// The target
+ Target *target_;
+
+ /// The argument
+ Object *object_;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_ESF_Disconnected_Command
+ *
+ * @brief Implements a Command object that invokes the
+ * disconnected_i() method on the target, passing an argument of type
+ * Object.
+ *
+ * <H2>Memory Managment</H2>
+ * It does not assume ownership of Object nor the Target
+ * arguments.
+ * Usually allocated from the heap or an allocator; but it is not
+ * self-managed.
+ *
+ * <H2>Locking</H2>
+ * No provisions for locking, access must be serialized
+ * externally.
+ */
+template<class Target, class Object>
+class TAO_ESF_Disconnected_Command : public ACE_Command_Base
+{
+public:
+ /// constructor...
+ TAO_ESF_Disconnected_Command (Target *target,
+ Object *object);
+
+ /// The callback method, if the argument is not nil it is interpreted
+ /// as a CORBA::Environment.
+ virtual int execute (void *arg);
+
+private:
+ /// The target
+ Target *target_;
+
+ /// The argument
+ Object *object_;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_ESF_Shutdown_Command
+ *
+ * @brief Implements a Command object that invokes the shutdown_i()
+ * method on the target, passing an argument of type Object.
+ *
+ * <H2>Memory Management</H2>
+ * It does not assume ownership of Object nor the Target
+ * arguments.
+ * Usually allocated from the heap or an allocator; but it is not
+ * self-managed.
+ *
+ * <H2>Locking</H2>
+ * No provisions for locking, access must be serialized
+ * externally.
+ */
+template<class Target>
+class TAO_ESF_Shutdown_Command : public ACE_Command_Base
+{
+public:
+ /// constructor...
+ TAO_ESF_Shutdown_Command (Target *target);
+
+ /// The callback method, if the argument is not nil it is interpreted
+ /// as a CORBA::Environment.
+ virtual int execute (void *arg);
+
+private:
+ /// The target
+ Target *target_;
+};
+
+// ****************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Delayed_Command.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_Delayed_Command.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_Delayed_Command.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_ESF_DELAYED_COMMAND_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.i b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.i
new file mode 100644
index 00000000000..3ffe5697959
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.i
@@ -0,0 +1,47 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class Target, class Object>
+TAO_ESF_Connected_Command<Target,Object>::
+ TAO_ESF_Connected_Command (Target *target,
+ Object *object)
+ : target_ (target),
+ object_ (object)
+{
+}
+
+// ****************************************************************
+
+template<class Target, class Object>
+TAO_ESF_Reconnected_Command<Target,Object>::
+ TAO_ESF_Reconnected_Command (Target *target,
+ Object *object)
+ : target_ (target),
+ object_ (object)
+{
+}
+
+// ****************************************************************
+
+template<class Target, class Object>
+TAO_ESF_Disconnected_Command<Target,Object>::
+ TAO_ESF_Disconnected_Command (Target *target,
+ Object *object)
+ : target_ (target),
+ object_ (object)
+{
+}
+
+// ****************************************************************
+
+template<class Target>
+TAO_ESF_Shutdown_Command<Target>::
+ TAO_ESF_Shutdown_Command (Target *target)
+ : target_ (target)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Immediate_Changes.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Immediate_Changes.cpp
new file mode 100644
index 00000000000..c1bbac9dad0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Immediate_Changes.cpp
@@ -0,0 +1,49 @@
+// $Id$
+
+#ifndef TAO_ESF_IMMEDIATE_CHANGES_CPP
+#define TAO_ESF_IMMEDIATE_CHANGES_CPP
+
+#include "orbsvcs/ESF/ESF_Immediate_Changes.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Immediate_Changes.i"
+#endif /* __ACE_INLINE__ */
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+template<class PROXY, class C, class ITERATOR, class ACE_LOCK>
+TAO_ESF_Immediate_Changes<PROXY,C,ITERATOR,ACE_LOCK>::
+ TAO_ESF_Immediate_Changes (void)
+{
+}
+
+template<class PROXY, class C, class ITERATOR, class ACE_LOCK>
+TAO_ESF_Immediate_Changes<PROXY,C,ITERATOR,ACE_LOCK>::
+ TAO_ESF_Immediate_Changes (const C &collection)
+ : collection_ (collection)
+{
+}
+
+template<class PROXY, class C, class ITERATOR, class ACE_LOCK> void
+TAO_ESF_Immediate_Changes<PROXY,C,ITERATOR,ACE_LOCK>::
+ for_each (TAO_ESF_Worker<PROXY> *worker
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
+
+ worker->set_size(this->collection_.size());
+ ITERATOR end = this->collection_.end ();
+ for (ITERATOR i = this->collection_.begin (); i != end; ++i)
+ {
+ worker->work ((*i) ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ESF_IMMEDIATE_CHANGES_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Immediate_Changes.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Immediate_Changes.h
new file mode 100644
index 00000000000..bcd9b19edd4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Immediate_Changes.h
@@ -0,0 +1,69 @@
+// -*- C++ -*-
+/**
+ * @file ESF_Immediate_Changes.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ESF_IMMEDIATE_CHANGES_H
+#define TAO_ESF_IMMEDIATE_CHANGES_H
+
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ESF_Immediate_Changes
+ *
+ * @brief Implement the Immediate_Changes strategy
+ *
+ */
+template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK>
+class TAO_ESF_Immediate_Changes : public TAO_ESF_Proxy_Collection<PROXY>
+{
+public:
+ TAO_ESF_Immediate_Changes (void);
+ TAO_ESF_Immediate_Changes (const COLLECTION &collection);
+
+ // = The TAO_ESF_Proxy methods
+ virtual void for_each (TAO_ESF_Worker<PROXY> *worker
+ ACE_ENV_ARG_DECL);
+ virtual void connected (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+ virtual void reconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+ virtual void disconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ COLLECTION collection_;
+
+ ACE_LOCK lock_;
+};
+
+// ****************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Immediate_Changes.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_Immediate_Changes.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_Immediate_Changes.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_ESF_IMMEDIATE_CHANGES_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Immediate_Changes.i b/TAO/orbsvcs/orbsvcs/ESF/ESF_Immediate_Changes.i
new file mode 100644
index 00000000000..ac26e4d5800
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Immediate_Changes.i
@@ -0,0 +1,48 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK> void
+TAO_ESF_Immediate_Changes<PROXY,COLLECTION,ITERATOR,ACE_LOCK>::
+ connected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
+
+ proxy->_incr_refcnt ();
+ this->collection_.connected (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK> void
+TAO_ESF_Immediate_Changes<PROXY,COLLECTION,ITERATOR,ACE_LOCK>::
+ reconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
+
+ proxy->_incr_refcnt ();
+ this->collection_.reconnected (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK> void
+TAO_ESF_Immediate_Changes<PROXY,COLLECTION,ITERATOR,ACE_LOCK>::
+ disconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
+
+ this->collection_.disconnected (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK> void
+TAO_ESF_Immediate_Changes<PROXY,COLLECTION,ITERATOR,ACE_LOCK>::
+ shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
+
+ this->collection_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Admin.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Admin.cpp
new file mode 100644
index 00000000000..40afd8d452f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Admin.cpp
@@ -0,0 +1,58 @@
+// $Id$
+
+#ifndef TAO_ESF_PEER_ADMIN_CPP
+#define TAO_ESF_PEER_ADMIN_CPP
+
+#include "orbsvcs/ESF/ESF_Peer_Workers.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class EVENT_CHANNEL, class PROXY, class INTERFACE, class PEER>
+TAO_ESF_Peer_Admin<EVENT_CHANNEL,PROXY,INTERFACE,PEER>::
+ TAO_ESF_Peer_Admin (EVENT_CHANNEL *ec)
+ : TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE> (ec)
+{
+}
+
+template<class EVENT_CHANNEL, class PROXY, class INTERFACE, class PEER>
+TAO_ESF_Peer_Admin<EVENT_CHANNEL,PROXY,INTERFACE,PEER>::
+ ~TAO_ESF_Peer_Admin (void)
+{
+}
+
+template<class EVENT_CHANNEL, class PROXY, class INTERFACE, class PEER> void
+TAO_ESF_Peer_Admin<EVENT_CHANNEL,PROXY,INTERFACE,PEER>::
+ peer_connected (PEER *peer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_ESF_Peer_Connected<PROXY,PEER> worker (peer);
+
+ this->for_each (&worker ACE_ENV_ARG_PARAMETER);
+}
+
+template<class EVENT_CHANNEL, class PROXY, class INTERFACE, class PEER> void
+TAO_ESF_Peer_Admin<EVENT_CHANNEL,PROXY,INTERFACE,PEER>::
+ peer_reconnected (PEER *peer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_ESF_Peer_Reconnected<PROXY,PEER> worker (peer);
+
+ this->for_each (&worker ACE_ENV_ARG_PARAMETER);
+}
+
+template<class EVENT_CHANNEL, class PROXY, class INTERFACE, class PEER> void
+TAO_ESF_Peer_Admin<EVENT_CHANNEL,PROXY,INTERFACE,PEER>::
+ peer_disconnected (PEER *peer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_ESF_Peer_Disconnected<PROXY,PEER> worker (peer);
+
+ this->for_each (&worker ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ESF_PEER_ADMIN_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Admin.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Admin.h
new file mode 100644
index 00000000000..95a188cf661
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Admin.h
@@ -0,0 +1,108 @@
+// -*- C++ -*-
+
+/**
+ * @file ESF_Peer_Admin.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ESF_PEER_ADMIN_H
+#define TAO_ESF_PEER_ADMIN_H
+
+#include "orbsvcs/ESF/ESF_Proxy_Admin.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ESF_Peer_Admin
+ *
+ * @brief Extend the Proxy_Admin interface to provide methods for
+ * filtering
+ *
+ * Some Event Services that perform filtering have to propagate
+ * the consumer connect/disconnect activities to the suppliers,
+ * and vice-versa.
+ * In that scenario the ESF_Proxy_Admin<> interface is augmented
+ * with connected()/reconnected()/disconnected() operations for
+ * the proxy peers (i.e. the ProxySuppliers for the ProxyConsumers
+ * and vice-versa).
+ *
+ * <H2>Requirements</H2>
+ *
+ * In addition to the requirements imposed by ESF_Proxy_Admin<>
+ * the PROXY interface must implement:
+ *
+ * @verbatim
+ * void connected (PEER *peer ACE_ENV_ARG_DECL_NOT_USED) throw ();
+ * void reconnected (PEER *peer ACE_ENV_ARG_DECL_NOT_USED) throw ();
+ * void disconnected (PEER *peer ACE_ENV_ARG_DECL_NOT_USED) throw ();
+ * @endverbatim
+ *
+ * Similarly, the PEER interface must implement:
+ *
+ * @verbatim
+ * void connected (PROXY *proxy ACE_ENV_ARG_DECL_NOT_USED) throw ();
+ * void reconnected (PROXY *proxy ACE_ENV_ARG_DECL_NOT_USED) throw ();
+ * void disconnected (PROXY *proxy ACE_ENV_ARG_DECL_NOT_USED) throw ();
+ * @endverbatim
+ */
+template<class EVENT_CHANNEL, class PROXY, class INTERFACE, class PEER>
+class TAO_ESF_Peer_Admin : public TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE>
+{
+public:
+ /// Constructor
+ TAO_ESF_Peer_Admin (EVENT_CHANNEL *ec);
+
+ /// destructor
+ virtual ~TAO_ESF_Peer_Admin (void);
+
+ /**
+ * A <peer> has connected, this is invoked when the peer's client
+ * has invoked the connect_xxx_yyy() method.
+ * The default implementation is a no-op.
+ */
+ virtual void peer_connected (PEER *peer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * A <peer> has reconnected, i.e. its client has invoked the
+ * connect_xxx_yyy() method, but the peer was connected already.
+ * The default implementation delegates on the collection
+ * <reconnected> method
+ */
+ virtual void peer_reconnected (PEER *peer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * A <peer> has been disconnected. The default implementation
+ * removes the object from the collection and deactivates the
+ * proxy.
+ */
+ virtual void peer_disconnected (PEER *peer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+// ****************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_Peer_Admin.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_Peer_Admin.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_ESF_PEER_ADMIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Workers.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Workers.cpp
new file mode 100644
index 00000000000..354daec8bed
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Workers.cpp
@@ -0,0 +1,53 @@
+// $Id$
+
+#ifndef TAO_ESF_PEER_WORKERS_CPP
+#define TAO_ESF_PEER_WORKERS_CPP
+
+#include "orbsvcs/ESF/ESF_Peer_Workers.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Peer_Workers.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class P, class R> void
+TAO_ESF_Peer_Connected<P,R>::work (P *proxy
+ ACE_ENV_ARG_DECL)
+{
+ proxy->connected (this->peer_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK; // Shouldn't happen, just following the discipline
+
+ this->peer_->connected (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK; // Shouldn't happen, just following the discipline
+}
+
+// ****************************************************************
+
+template<class P, class R> void
+TAO_ESF_Peer_Reconnected<P,R>::work (P *proxy
+ ACE_ENV_ARG_DECL)
+{
+ proxy->reconnected (this->peer_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK; // Shouldn't happen, just following the discipline
+
+ this->peer_->reconnected (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK; // Shouldn't happen, just following the discipline
+}
+
+// ****************************************************************
+
+template<class P, class R> void
+TAO_ESF_Peer_Disconnected<P,R>::work (P *proxy
+ ACE_ENV_ARG_DECL)
+{
+ proxy->disconnected (this->peer_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK; // Shouldn't happen, just following the discipline
+
+ this->peer_->disconnected (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK; // Shouldn't happen, just following the discipline
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ESF_PEER_WORKERS_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Workers.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Workers.h
new file mode 100644
index 00000000000..793e41f422e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Workers.h
@@ -0,0 +1,107 @@
+// -*- C++ -*-
+
+/**
+ * @file ESF_Peer_Workers.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/ESF/index.html
+ */
+
+#ifndef TAO_ESF_PEER_WORKERS_H
+#define TAO_ESF_PEER_WORKERS_H
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ESF_Peer_Connected
+ *
+ * Helper class.
+ * Used to iterate over a Proxy_Collection and invoke:
+ * PROXY->connected (peer);
+ * peer->connected (proxy);
+ */
+template<class PROXY, class PEER>
+class TAO_ESF_Peer_Connected : public TAO_ESF_Worker<PROXY>
+{
+public:
+ TAO_ESF_Peer_Connected (PEER *peer);
+
+ void work (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+
+private:
+ PEER* peer_;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_ESF_Peer_Reconnected
+ *
+ * Helper class.
+ * Used to iterate over a Proxy_Collection and invoke:
+ * PROXY->reconnected (peer);
+ * peer->reconnected (proxy);
+ */
+template<class PROXY, class PEER>
+class TAO_ESF_Peer_Reconnected : public TAO_ESF_Worker<PROXY>
+{
+public:
+ TAO_ESF_Peer_Reconnected (PEER *peer);
+
+ void work (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+
+private:
+ PEER* peer_;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_ESF_Peer_Disconnected
+ *
+ * Helper class.
+ * Used to iterate over a Proxy_Collection and invoke:
+ * PROXY->disconnected (peer);
+ * peer->disconnected (proxy);
+ */
+template<class PROXY, class PEER>
+class TAO_ESF_Peer_Disconnected : public TAO_ESF_Worker<PROXY>
+{
+public:
+ TAO_ESF_Peer_Disconnected (PEER *peer);
+
+ void work (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+
+private:
+ PEER* peer_;
+};
+
+// ****************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Peer_Workers.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_Peer_Workers.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_Peer_Workers.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_ESF_PEER_WORKERS_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Workers.i b/TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Workers.i
new file mode 100644
index 00000000000..02201bde5d5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Peer_Workers.i
@@ -0,0 +1,31 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class P, class R>
+TAO_ESF_Peer_Connected<P,R>::TAO_ESF_Peer_Connected (R *peer)
+ : peer_ (peer)
+{
+}
+
+// ****************************************************************
+
+template<class P, class R>
+TAO_ESF_Peer_Reconnected<P,R>::TAO_ESF_Peer_Reconnected (R *peer)
+ : peer_ (peer)
+{
+}
+
+// ****************************************************************
+
+template<class P, class R>
+TAO_ESF_Peer_Disconnected<P,R>::TAO_ESF_Peer_Disconnected (R *peer)
+ : peer_ (peer)
+{
+}
+
+// ****************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Admin.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Admin.cpp
new file mode 100644
index 00000000000..8449b48d0b2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Admin.cpp
@@ -0,0 +1,110 @@
+// $Id$
+
+#ifndef TAO_ESF_PROXY_ADMIN_CPP
+#define TAO_ESF_PROXY_ADMIN_CPP
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Proxy_Admin.i"
+#endif /* __ACE_INLINE__ */
+
+#include "orbsvcs/ESF/ESF_Shutdown_Proxy.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class EVENT_CHANNEL, class PROXY, class INTERFACE>
+TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE>::
+ TAO_ESF_Proxy_Admin (EVENT_CHANNEL *ec)
+ : event_channel_ (ec)
+{
+ this->event_channel_->create_proxy_collection (this->collection_);
+}
+
+template<class EVENT_CHANNEL, class PROXY, class INTERFACE>
+TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE>::
+ ~TAO_ESF_Proxy_Admin (void)
+{
+ this->event_channel_->destroy_proxy_collection (this->collection_);
+}
+
+template<class EVENT_CHANNEL, class PROXY, class INTERFACE> INTERFACE*
+TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE>::
+ obtain (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PROXY* proxy;
+ this->event_channel_->create_proxy (proxy);
+
+ TAO_ESF_RefCountedRef<PROXY> holder (proxy);
+
+ ACE_TYPENAME PROXY::_ptr_type r;
+ proxy->activate (r ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (INTERFACE::_nil ());
+
+ ACE_TYPENAME PROXY::_var_type result = r;
+
+ this->collection_->connected (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (INTERFACE::_nil ());
+
+ return result._retn ();
+}
+
+template<class EVENT_CHANNEL, class PROXY, class INTERFACE> void
+TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE>::
+ shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_ESF_Shutdown_Proxy<PROXY> worker;
+
+ this->collection_->for_each (&worker ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK; // Cannot happen, just following the discipline.
+
+ this->collection_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+template<class EVENT_CHANNEL, class PROXY, class INTERFACE> void
+TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE>::
+ connected (PROXY *
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+template<class EVENT_CHANNEL, class PROXY, class INTERFACE> void
+TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE>::
+ reconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->collection_->reconnected (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+template<class EVENT_CHANNEL, class PROXY, class INTERFACE> void
+TAO_ESF_Proxy_Admin<EVENT_CHANNEL,PROXY,INTERFACE>::
+ disconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ proxy->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK; // Cannot happen, just following the discipline.
+
+ ACE_TRY
+ {
+ this->collection_->disconnected (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // @@ In the future the collections may raise exceptions to
+ // report errors (such as out of memory or things like that).
+ // We must decide how is that info going to be used, and how
+ // would we propagate the exception to the application.
+ // For example: the CosEC has no exceptions for "out of
+ // resources" or something similar, and i've never seen a spec
+ // that has an exception for "could not acquire a mutex".
+ }
+ ACE_ENDTRY;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ESF_PROXY_ADMIN_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Admin.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Admin.h
new file mode 100644
index 00000000000..5c56884654e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Admin.h
@@ -0,0 +1,167 @@
+// -*- C++ -*-
+
+/**
+ * @file ESF_Proxy_Admin.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ESF_PROXY_ADMIN_H
+#define TAO_ESF_PROXY_ADMIN_H
+
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ESF_Proxy_Admin
+ *
+ * @brief Implement common tasks in the Admin interfaces.
+ *
+ * <H2>Requirements</H2>
+ *
+ * The EVENT_CHANNEL interface must implement:
+ *
+ * @verbatim
+ * void create_proxy (PROXY*&);
+ * // create a new proxy
+ *
+ * void destroy_proxy (PROXY*);
+ * // destroy a proxy
+ *
+ * void create_proxy_collection (TAO_ESF_Proxy_Collection<PROXY>*&);
+ * // create a proxy collection
+ *
+ * void destroy_proxy_collection (TAO_ESF_Proxy_Collection<PROXY>*&);
+ * // destroy a proxy collection
+ * @endverbatim
+ *
+ * In addition to the requirements imposed by
+ * TAO_ESF_Proxy_Collection<>, the PROXY interface must define:
+ *
+ * @verbatim
+ * typename .... _ptr_type;
+ * // The T_ptr for the IDL interface implemented by the PROXY.
+ *
+ * typename .... _var_type;
+ * // The T_var for the IDL interface implemented by the PROXY.
+ *
+ * PROXY::_ptr_type
+ * PROXY::activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) throw ();
+ * // activate the proxy and return the object reference
+ * @endverbatim
+ *
+ */
+template<class EVENT_CHANNEL, class PROXY, class INTERFACE>
+class TAO_ESF_Proxy_Admin
+{
+public:
+ /// Constructor, allocate the internal collection
+ TAO_ESF_Proxy_Admin (EVENT_CHANNEL *ec);
+
+ /// Cleanup internal resources, destroy the internal collection
+ virtual ~TAO_ESF_Proxy_Admin (void);
+
+ /// Iterate over its internal collection.
+ void for_each (TAO_ESF_Worker<PROXY> *worker
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // @todo We should use INTERFACE::_ptr_type or PROXY::_ptr_type, but
+ // the MSVC compiler (v6.0) gets confused when we do so. So we have
+ // to choose for the lesser evil. The code works because TAO uses
+ // pointers to implement the _ptr types, and that is OK because this
+ // code is supposed to run under TAO only.
+ /// Create a new PROXY and activate it.
+ virtual INTERFACE*
+ obtain (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * The Event Channel that owns this Admin object is going
+ * down. Invoke <shutdown> on all the proxies, cleanup the
+ * collection and prepare to terminate.
+ */
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * A <proxy> has connected, this is invoked when the proxy's client
+ * has invoked the connect_xxx_yyy() method.
+ * The default implementation is a no-op.
+ */
+ virtual void connected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * A <proxy> has reconnected, i.e. its client has invoked the
+ * connect_xxx_yyy() method, but the proxy was connected already.
+ * The default implementation delegates on the collection
+ * <reconnected> method
+ */
+ virtual void reconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * A <proxy> has been disconnected. The default implementation
+ * removes the object from the collection and deactivates the
+ * proxy.
+ */
+ virtual void disconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+ /// The Event Channel we belong to
+ EVENT_CHANNEL *event_channel_;
+
+private:
+ /// Shorthand for the Proxy collection
+ typedef TAO_ESF_Proxy_Collection<PROXY> Collection;
+
+ /// The proxy collection object
+ Collection *collection_;
+};
+
+// ****************************************************************
+template <class COUNTED>
+class TAO_ESF_RefCountedRef
+{
+public:
+ TAO_ESF_RefCountedRef (COUNTED *counted);
+ ~TAO_ESF_RefCountedRef ();
+private:
+ TAO_ESF_RefCountedRef (TAO_ESF_RefCountedRef<COUNTED> const & );
+ TAO_ESF_RefCountedRef& operator= (TAO_ESF_RefCountedRef<COUNTED> const & );
+
+ COUNTED *counted_;
+};
+
+// ****************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Proxy_Admin.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_Proxy_Admin.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_Proxy_Admin.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_ESF_PROXY_ADMIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Admin.i b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Admin.i
new file mode 100644
index 00000000000..882e6c9c056
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Admin.i
@@ -0,0 +1,32 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class EC,class P,class I> ACE_INLINE void
+TAO_ESF_Proxy_Admin<EC,P,I>::
+ for_each (TAO_ESF_Worker<P> *worker
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->collection_->for_each (worker ACE_ENV_ARG_PARAMETER);
+}
+
+template <class C>
+ACE_INLINE
+TAO_ESF_RefCountedRef<C>::TAO_ESF_RefCountedRef (C *counted)
+ : counted_ (counted)
+{}
+
+template <class C>
+ACE_INLINE
+TAO_ESF_RefCountedRef<C>::~TAO_ESF_RefCountedRef ()
+{
+ if (this->counted_ != 0)
+ {
+ this->counted_->_decr_refcnt ();
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Collection.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Collection.cpp
new file mode 100644
index 00000000000..1691a2dcc02
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Collection.cpp
@@ -0,0 +1,20 @@
+// $Id$
+
+#ifndef TAO_ESF_PROXY_COLLECTION_CPP
+#define TAO_ESF_PROXY_COLLECTION_CPP
+
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+template<class PROXY>
+TAO_ESF_Proxy_Collection<PROXY>::~TAO_ESF_Proxy_Collection (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ESF_PROXY_COLLECTION_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Collection.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Collection.h
new file mode 100644
index 00000000000..ceaeda03db0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_Collection.h
@@ -0,0 +1,174 @@
+// -*- C++ -*-
+
+/**
+ * @file ESF_Proxy_Collection.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ESF_PROXY_COLLECTION_H
+#define TAO_ESF_PROXY_COLLECTION_H
+#include /**/ "ace/pre.h"
+
+#include "ace/CORBA_macros.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class Target> class TAO_ESF_Worker;
+
+/**
+ * @class TAO_ESF_Proxy_Collection
+ *
+ * @brief ESF_Proxy_Collection
+ *
+ * Many components in an Event Service need to keep a collection
+ * of proxies; these collections must be able to cope with several
+ * concurrency issues:
+ * + Some threads may need to iterate over the collection and
+ * invoke a method on each element. Locking the collection
+ * while this is done is not feasible in all cases: under some
+ * configurations the same thread that is iterating over the
+ * collection may need to make changes to the set.
+ * + A recursive lock does not solve the concurrency problems
+ * because recursive changes to the collection still invalidate
+ * the iterators.
+ *
+ * There are several solutions to this problem (see the VARIANTS)
+ * section, and there is no single one that works bests in all
+ * cases. As usual, we wish the strategize the protocol used to
+ * serialize iterations and changes to the collection. This class
+ * encapsulates that protocol.
+ *
+ * The usual form of the Iterator pattern does not work well in
+ * this case: in several variants the synchronization protocol and
+ * the iteration loop must collaborate to work efficiently.
+ * Exposing an external iterator would require that every other
+ * component in the system can support all the synchronization
+ * protocols. It is possible to hide some of that complexity
+ * using heavy weight iterators, but their use is ackward,
+ * specially since the Koening-style iterators have become more
+ * popular.
+ *
+ * Regular member functions are used to insert, remove and update
+ * members of the collection and to shutdown (i.e. perform final
+ * cleanup operations).
+ *
+ * The class must also collaborate with other components of the
+ * EC to efficiently and safely perform memory managment of the
+ * members in the collection.
+ *
+ * The PROXY object must be reference counted with the following
+ * operations:
+ *
+ * + _incr_refcnt() - increment the reference count.
+ * + _decr_refcnt() - decrement the reference count.
+ *
+ * = VARIANTS
+ *
+ * We identify several sources of variation:
+ *
+ * + Immediate_Changes: in this variant the iteration in performed
+ * while holding some kind of synchronization primitive, such as a
+ * thread mutex, a recursive mutex, a RW lock, etc.
+ * This is only useful in configurations where a separate thread
+ * dispatches the events, and thus, can only be used with real
+ * locks.
+ * + Copy_On_Read: before performing the iteration the collection
+ * is duplicated into a temporary array. Thus no locks are held
+ * during the iteration. This is a very expensive approach, but
+ * useful in many cases.
+ * The kind of lock is also strategized in this case.
+ * + Copy_On_Write: this is very similar to the previous approach,
+ * but the collection is only duplicated when a change is required
+ * while some thread is performing an iteration. The iteration
+ * continues over the original copy, while the changes are
+ * performed in the duplicate. The new copy of the collection is
+ * used for any subsequent operations, the original is discarded
+ * when the last thread using it completes its work.
+ * This approach optimizes for the case where no changes are
+ * is duplicated into a temporary array. Thus no locks are held
+ * during the iteration. This is a very expensive approach, but
+ * useful in many cases.
+ * The kind of lock is also strategized in this case.
+ * + Delayed_Changes: before starting the iteration a counter is
+ * incremented, this counter is used to keep track of the number
+ * of threads concurrently using the collection.
+ * If a thread wants to perform a change to the collection it must
+ * first verify that there are no threads iterating over it. If
+ * there are any threads then the thread queues the modification
+ * for later execution, using the Command pattern.
+ * The kind of lock is strategized, as this approach is used in
+ * single threaded configurations.
+ * There are two main variations:
+ * - An upcall can result in new dispatches: in this case we
+ * have to keep track of a the list of current threads using
+ * a Set, to avoid dead-locks. The design is not complete,
+ * probably similar to the next one.
+ * - Otherwise we just need to control the concurrency using the
+ * algorithm described below.
+ *
+ * It assumes ownership of the proxies added to the collection,
+ * it increases the reference count.
+ *
+ * Locking is provided by derived classes.
+ */
+template<class PROXY>
+class TAO_ESF_Proxy_Collection
+{
+public:
+ /// destructor
+ virtual ~TAO_ESF_Proxy_Collection (void);
+
+ /**
+ * Iterate over the collection and invoke worker->work() for each
+ * member of the collection.
+ * This encapsulates
+ */
+ virtual void for_each (TAO_ESF_Worker<PROXY> *worker
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Insert a new element into the collection. The collection assumes
+ /// ownership of the element.
+ virtual void connected (PROXY *proxy
+ ACE_ENV_ARG_DECL) = 0;
+
+ /**
+ * Insert an element into the collection. No errors can be raised
+ * if the element is already present.
+ * The collection assumes ownership, i.e. must invoke
+ * <proxy->_decr_refcnt()> if the element is already present in the
+ * collection.
+ */
+ virtual void reconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Remove an element from the collection.
+ virtual void disconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// The EC is shutting down, must release all the elements.
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) = 0;
+};
+
+// ****************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_Proxy_Collection.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_Proxy_Collection.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_ESF_PROXY_COLLECTION_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.cpp
new file mode 100644
index 00000000000..ebe73ce7996
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.cpp
@@ -0,0 +1,93 @@
+// $Id$
+
+#ifndef TAO_ESF_PROXY_LIST_CPP
+#define TAO_ESF_PROXY_LIST_CPP
+
+#include "orbsvcs/ESF/ESF_Proxy_List.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Proxy_List.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class PROXY>
+TAO_ESF_Proxy_List<PROXY>::TAO_ESF_Proxy_List (void)
+{
+}
+
+template<class PROXY> void
+TAO_ESF_Proxy_List<PROXY>::connected (PROXY *proxy
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ int r = this->impl_.insert (proxy);
+ if (r == 0)
+ return;
+
+ if (r == 1)
+ {
+ // @@ Already there, throw some user exception..
+ proxy->_decr_refcnt ();
+ }
+ if (r == -1)
+ {
+ // @@ Cannot insert, running out of memory? throw some other
+ // user exception
+ proxy->_decr_refcnt ();
+ }
+}
+
+template<class PROXY> void
+TAO_ESF_Proxy_List<PROXY>::reconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ int r = this->impl_.insert (proxy);
+ if (r == 0)
+ return;
+
+ if (r == 1)
+ {
+ // Reference count is incremented by the callers to [re]connected.
+ // @@ Find out if the protocol could be simplified, and decoupling
+ // increased.
+ proxy->_decr_refcnt ();
+ return;
+ }
+
+ if (r == -1)
+ {
+ // @@ Cannot insert, running out of memory? throw some other
+ // user exception
+ proxy->_decr_refcnt ();
+ }
+}
+
+template<class PROXY> void
+TAO_ESF_Proxy_List<PROXY>::disconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ int r = this->impl_.remove (proxy);
+ if (r != 0)
+ {
+ // @@ Cannot remove, throw some other
+ // user exception
+ return;
+ }
+ proxy->_decr_refcnt ();
+}
+
+template<class PROXY> void
+TAO_ESF_Proxy_List<PROXY>::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ Iterator end = this->impl_.end ();
+ for (Iterator i = this->impl_.begin (); i != end; ++i)
+ {
+ // Decrement reference count
+ (*i)->_decr_refcnt ();
+ }
+ this->impl_.reset ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ESF_PROXY_LIST_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.h
new file mode 100644
index 00000000000..f2697bd7dbf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.h
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+
+/**
+ * @file ESF_Proxy_List.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ESF_PROXY_LIST_H
+#define TAO_ESF_PROXY_LIST_H
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Unbounded_Set.h"
+#include "ace/Containers.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// A concrete proxy collection.
+/**
+ * Based on the ACE_Unbounded_Set<> collection, used a double
+ * linked list internally.
+ */
+template<class PROXY>
+class TAO_ESF_Proxy_List
+{
+public:
+ /// A typedef for the underlying implementaiton class
+ typedef ACE_Unbounded_Set<PROXY*> Implementation;
+
+ /// A typedef for the underlying iterator
+ typedef ACE_Unbounded_Set_Iterator<PROXY*> Iterator;
+
+ /// Constructor
+ TAO_ESF_Proxy_List (void);
+
+ /// Return the first element in the collection, or end() if there
+ /// are none
+ ACE_Unbounded_Set_Iterator<PROXY*> begin (void);
+
+ /// Return one past the last element in the collection
+ ACE_Unbounded_Set_Iterator<PROXY*> end (void);
+
+ /// Return the number of elements in the collection
+ size_t size (void) const;
+
+ /// Insert a new element to the collection
+ void connected (PROXY *
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Insert a new element that could be there already.
+ void reconnected (PROXY *
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Remove an element from the collection
+ void disconnected (PROXY *
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Shutdown the collection, i.e. remove all elements and release
+ /// resources
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+private:
+ /// The underlying implementation object
+ ACE_Unbounded_Set<PROXY*> impl_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Proxy_List.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_Proxy_List.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_Proxy_List.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_ESF_PROXY_LIST_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.i b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.i
new file mode 100644
index 00000000000..67d752fdc6c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.i
@@ -0,0 +1,25 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class PROXY> ACE_INLINE ACE_Unbounded_Set_Iterator<PROXY*>
+TAO_ESF_Proxy_List<PROXY>::begin (void)
+{
+ return this->impl_.begin ();
+}
+
+template<class PROXY> ACE_INLINE ACE_Unbounded_Set_Iterator<PROXY*>
+TAO_ESF_Proxy_List<PROXY>::end (void)
+{
+ return this->impl_.end ();
+}
+
+template<class PROXY> ACE_INLINE size_t
+TAO_ESF_Proxy_List<PROXY>::size (void) const
+{
+ return this->impl_.size ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RB_Tree.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RB_Tree.cpp
new file mode 100644
index 00000000000..000b91f27d9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RB_Tree.cpp
@@ -0,0 +1,91 @@
+// $Id$
+
+#ifndef TAO_ESF_PROXY_RB_TREE_CPP
+#define TAO_ESF_PROXY_RB_TREE_CPP
+
+#include "orbsvcs/ESF/ESF_Proxy_RB_Tree.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Proxy_RB_Tree.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class PROXY>
+TAO_ESF_Proxy_RB_Tree<PROXY>::TAO_ESF_Proxy_RB_Tree (void)
+{
+}
+
+template<class PROXY> void
+TAO_ESF_Proxy_RB_Tree<PROXY>::connected (PROXY *proxy
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ int r = this->impl_.bind (proxy, 1);
+ if (r == 0)
+ return;
+
+ if (r == 1)
+ {
+ // @@ Already there, throw some user exception..
+ proxy->_decr_refcnt ();
+ }
+ if (r == -1)
+ {
+ // @@ Cannot insert, running out of memory? throw some other
+ // user exception
+ proxy->_decr_refcnt ();
+ }
+}
+
+template<class PROXY> void
+TAO_ESF_Proxy_RB_Tree<PROXY>::reconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ int r = this->impl_.rebind (proxy, 1);
+ if (r == 0)
+ return;
+
+ if (r == 1)
+ {
+ // Reference count is incremented by the callers to [re]connected.
+ // @@ Find out if the protocol could be simplified, and decoupling
+ // increased.
+ proxy->_decr_refcnt ();
+ return;
+ }
+
+ if (r == -1)
+ {
+ proxy->_decr_refcnt ();
+ }
+}
+
+template<class PROXY> void
+TAO_ESF_Proxy_RB_Tree<PROXY>::disconnected (PROXY *proxy
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ int r = this->impl_.unbind (proxy);
+ if (r != 0)
+ {
+ // @@ Cannot remove, throw some other
+ // user exception
+ return;
+ }
+ proxy->_decr_refcnt ();
+}
+
+template<class PROXY> void
+TAO_ESF_Proxy_RB_Tree<PROXY>::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ Iterator end = this->impl_.end ();
+ for (Iterator i = this->impl_.begin (); i != end; ++i)
+ {
+ // Decrement reference count
+ (*i)->_decr_refcnt ();
+ }
+ this->impl_.clear ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ESF_PROXY_RB_TREE_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RB_Tree.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RB_Tree.h
new file mode 100644
index 00000000000..e4c6ce6f9a0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RB_Tree.h
@@ -0,0 +1,114 @@
+// -*- C++ -*-
+
+/**
+ * @file ESF_Proxy_RB_Tree.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ESF_PROXY_RB_TREE_H
+#define TAO_ESF_PROXY_RB_TREE_H
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/RB_Tree.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Iterator class for a ACE_ESF_RB_Tree
+template<class PROXY>
+class TAO_ESF_Proxy_RB_Tree_Iterator
+{
+public:
+ typedef ACE_RB_Tree_Iterator<PROXY *,
+ int,
+ ACE_Less_Than<PROXY*>,
+ ACE_Null_Mutex>
+ Implementation;
+
+ TAO_ESF_Proxy_RB_Tree_Iterator (const Implementation &i);
+
+ bool operator == (const TAO_ESF_Proxy_RB_Tree_Iterator<PROXY> &rhs) const;
+ bool operator != (const TAO_ESF_Proxy_RB_Tree_Iterator<PROXY> &rhs) const;
+ TAO_ESF_Proxy_RB_Tree_Iterator<PROXY>& operator++ (void);
+ TAO_ESF_Proxy_RB_Tree_Iterator<PROXY> operator++ (int);
+ PROXY *operator *(void);
+
+private:
+ Implementation impl_;
+};
+
+// ****************************************************************
+
+/// Concrete Proxy collection based on ACE_RB_Tree
+/**
+ * The Event Service Framework provides several alternatives for the
+ * underlying proxy collections.
+ * This version is based on Red-Black trees that offer good insertion,
+ * removal and lookup performance, but the iteration is slightly
+ * degraded.
+ */
+template<class PROXY>
+class TAO_ESF_Proxy_RB_Tree
+{
+public:
+ /// A typedef for the underlying implementaiton class
+ typedef ACE_RB_Tree<PROXY*,int,ACE_Less_Than<PROXY*>,ACE_Null_Mutex> Implementation;
+
+ /// A typedef for the underlying iterator
+ typedef TAO_ESF_Proxy_RB_Tree_Iterator<PROXY> Iterator;
+
+ /// Constructor
+ TAO_ESF_Proxy_RB_Tree (void);
+
+ /// Return the first element in the collection, or end() if there
+ /// are none
+ TAO_ESF_Proxy_RB_Tree_Iterator<PROXY> begin (void);
+
+ /// Return one past the last element in the collection
+ TAO_ESF_Proxy_RB_Tree_Iterator<PROXY> end (void);
+
+ /// Return the number of elements in the collection
+ size_t size (void) const;
+
+ /// Insert a new element to the collection
+ void connected (PROXY *
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Insert a new element that could be there already.
+ void reconnected (PROXY *
+ ACE_ENV_ARG_DECL_NOT_USED);
+ /// Remove an element from the collection
+ void disconnected (PROXY *
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Shutdown the collection, i.e. remove all elements and release
+ /// resources
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+private:
+ /// The underlying implementation object
+ Implementation impl_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Proxy_RB_Tree.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_Proxy_RB_Tree.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_Proxy_RB_Tree.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_ESF_PROXY_RB_TREE_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RB_Tree.i b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RB_Tree.i
new file mode 100644
index 00000000000..b67178bf7b5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RB_Tree.i
@@ -0,0 +1,69 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class PROXY> ACE_INLINE
+TAO_ESF_Proxy_RB_Tree_Iterator<PROXY>::
+ TAO_ESF_Proxy_RB_Tree_Iterator (const Implementation &i)
+ : impl_ (i)
+{
+}
+
+template<class PROXY> ACE_INLINE bool
+TAO_ESF_Proxy_RB_Tree_Iterator<PROXY>::operator == (
+ const TAO_ESF_Proxy_RB_Tree_Iterator<PROXY> &rhs) const
+{
+ return this->impl_ == rhs.impl_;
+}
+
+template<class PROXY> ACE_INLINE bool
+TAO_ESF_Proxy_RB_Tree_Iterator<PROXY>::operator != (
+ const TAO_ESF_Proxy_RB_Tree_Iterator<PROXY> &rhs) const
+{
+ return this->impl_ != rhs.impl_;
+}
+
+template<class PROXY> ACE_INLINE TAO_ESF_Proxy_RB_Tree_Iterator<PROXY>&
+TAO_ESF_Proxy_RB_Tree_Iterator<PROXY>::operator++ (void)
+{
+ ++this->impl_;
+ return *this;
+}
+
+template<class PROXY> ACE_INLINE TAO_ESF_Proxy_RB_Tree_Iterator<PROXY>
+TAO_ESF_Proxy_RB_Tree_Iterator<PROXY>::operator++ (int)
+{
+ TAO_ESF_Proxy_RB_Tree_Iterator<PROXY> tmp = *this;
+ ++this->impl_;
+ return tmp;
+}
+
+template<class PROXY> ACE_INLINE PROXY*
+TAO_ESF_Proxy_RB_Tree_Iterator<PROXY>::operator *(void)
+{
+ return (*this->impl_).key ();
+}
+
+// ****************************************************************
+
+template<class PROXY> ACE_INLINE TAO_ESF_Proxy_RB_Tree_Iterator<PROXY>
+TAO_ESF_Proxy_RB_Tree<PROXY>::begin (void)
+{
+ return Iterator (this->impl_.begin ());
+}
+
+template<class PROXY> ACE_INLINE TAO_ESF_Proxy_RB_Tree_Iterator<PROXY>
+TAO_ESF_Proxy_RB_Tree<PROXY>::end (void)
+{
+ return Iterator (this->impl_.end ());
+}
+
+template<class PROXY> ACE_INLINE size_t
+TAO_ESF_Proxy_RB_Tree<PROXY>::size (void) const
+{
+ return this->impl_.current_size ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RefCount_Guard.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RefCount_Guard.cpp
new file mode 100644
index 00000000000..5e236899e02
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RefCount_Guard.cpp
@@ -0,0 +1,29 @@
+// $Id$
+
+#ifndef TAO_ESF_PROXY_REFCOUNT_GUARD_CPP
+#define TAO_ESF_PROXY_REFCOUNT_GUARD_CPP
+
+#include "orbsvcs/ESF/ESF_Proxy_RefCount_Guard.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Proxy_RefCount_Guard.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class EC, class P>
+TAO_ESF_Proxy_RefCount_Guard<EC,P>::~TAO_ESF_Proxy_RefCount_Guard (void)
+{
+ // Checking for 0 is safe, once the variable reaches 0 the value
+ // will stay there.
+ // @@ But what if the thread is switched to another processor just
+ // after release the mutex?
+ if (this->refcount_ == 0)
+ {
+ this->event_channel_->destroy_proxy (this->proxy_);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ESF_PROXY_REFCOUNT_GUARD_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RefCount_Guard.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RefCount_Guard.h
new file mode 100644
index 00000000000..7e2f9e4c160
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RefCount_Guard.h
@@ -0,0 +1,79 @@
+// -*- C++ -*-
+
+/**
+ * @file ESF_Proxy_RefCount_Guard.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ESF_PROXY_REFCOUNT_GUARD_H
+#define TAO_ESF_PROXY_REFCOUNT_GUARD_H
+
+#include "tao/Basic_Types.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ESF_Proxy_RefCount_Guard
+ *
+ * @brief Reference count based guard.
+ *
+ * A common idiom used on event services is to increment a
+ * reference count before starting a long running operation.
+ * The system can then execute the operation without any risk of
+ * having the underlying object destroyed. The advantage of using
+ * a reference count is that no mutex or lock needs to be held
+ * while the operation is beign executed.
+ * This class implements that common idiom, but it also adds hooks
+ * to handle scenarios where more than one operation is performed
+ * while holding the reference count.
+ *
+ * @TODO: The type of lock could be parametric
+ */
+template<class EVENT_CHANNEL, class PROXY>
+class TAO_ESF_Proxy_RefCount_Guard
+{
+public:
+ /// Constructor
+ TAO_ESF_Proxy_RefCount_Guard (CORBA::ULong &refcount,
+ EVENT_CHANNEL *ec,
+ PROXY *proxy);
+
+ /// Destructor
+ ~TAO_ESF_Proxy_RefCount_Guard (void);
+
+protected:
+ /// The reference count, if it gets to zero then the object must be
+ /// destroyed
+ CORBA::ULong &refcount_;
+
+ /// The event channel used to destroy the proxy
+ EVENT_CHANNEL *event_channel_;
+
+ /// The proxy whose lifetime is controlled by the reference count
+ PROXY *proxy_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Proxy_RefCount_Guard.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_Proxy_RefCount_Guard.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_Proxy_RefCount_Guard.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_ESF_PROXY_REFCOUNT_GUARD_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RefCount_Guard.i b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RefCount_Guard.i
new file mode 100644
index 00000000000..d0d4fc80ac1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_RefCount_Guard.i
@@ -0,0 +1,18 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class EC, class P> ACE_INLINE
+TAO_ESF_Proxy_RefCount_Guard<EC,P>::
+ TAO_ESF_Proxy_RefCount_Guard (CORBA::ULong &refcount,
+ EC *ec,
+ P *proxy)
+ : refcount_ (refcount),
+ event_channel_ (ec),
+ proxy_ (proxy)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_RefCount_Guard.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_RefCount_Guard.cpp
new file mode 100644
index 00000000000..ae87b7f97f1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_RefCount_Guard.cpp
@@ -0,0 +1,14 @@
+// $Id$
+
+#ifndef TAO_ESF_REFCOUNT_GUARD_CPP
+#define TAO_ESF_REFCOUNT_GUARD_CPP
+
+#include "orbsvcs/ESF/ESF_RefCount_Guard.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_RefCount_Guard.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(ESF, ESF_RefCount_Guard, "$Id$")
+
+#endif /* TAO_ESF_REFCOUNT_GUARD_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_RefCount_Guard.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_RefCount_Guard.h
new file mode 100644
index 00000000000..84569c79bb6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_RefCount_Guard.h
@@ -0,0 +1,67 @@
+// -*- C++ -*-
+
+/**
+ * @file ESF_RefCount_Guard.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ESF_REFCOUNT_GUARD_H
+#define TAO_ESF_REFCOUNT_GUARD_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ESF_RefCount_Guard
+ *
+ * @brief Reference count based guard.
+ *
+ * A common idiom used on event services is to increment a
+ * reference count before starting a long running operation.
+ * The system can then execute the operation without any risk of
+ * having the underlying object destroyed. The advantage of using
+ * a reference count is that no mutex or lock needs to be held
+ * while the operation is beign executed.
+ */
+template<class T>
+class TAO_ESF_RefCount_Guard
+{
+public:
+ /// Constructor
+ TAO_ESF_RefCount_Guard (T &refcount);
+
+ /// Destructor
+ ~TAO_ESF_RefCount_Guard (void);
+
+protected:
+ /// The reference count
+ T &refcount_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_RefCount_Guard.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_RefCount_Guard.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_RefCount_Guard.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_ESF_REFCOUNT_GUARD_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_RefCount_Guard.i b/TAO/orbsvcs/orbsvcs/ESF/ESF_RefCount_Guard.i
new file mode 100644
index 00000000000..de454aaefe0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_RefCount_Guard.i
@@ -0,0 +1,22 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class T> ACE_INLINE
+TAO_ESF_RefCount_Guard<T>::
+ TAO_ESF_RefCount_Guard (T &refcount)
+ : refcount_ (refcount)
+{
+ this->refcount_++;
+}
+
+template<class T> ACE_INLINE
+TAO_ESF_RefCount_Guard<T>::
+ ~TAO_ESF_RefCount_Guard (void)
+{
+ this->refcount_--;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Shutdown_Proxy.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Shutdown_Proxy.cpp
new file mode 100644
index 00000000000..a0db9862e3f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Shutdown_Proxy.cpp
@@ -0,0 +1,33 @@
+// $Id$
+
+#ifndef TAO_ESF_SHUTDOWN_PROXY_CPP
+#define TAO_ESF_SHUTDOWN_PROXY_CPP
+
+#include "orbsvcs/ESF/ESF_Shutdown_Proxy.h"
+#include "ace/CORBA_macros.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Shutdown_Proxy.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class PROXY> void
+TAO_ESF_Shutdown_Proxy<PROXY>::work (PROXY *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ proxy->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Do not propagate any exceptions
+ }
+ ACE_ENDTRY;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ESF_SHUTDOWN_PROXY_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Shutdown_Proxy.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Shutdown_Proxy.h
new file mode 100644
index 00000000000..7263e4b2445
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Shutdown_Proxy.h
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+
+/**
+ * @file ESF_Shutdown_Proxy.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+
+#ifndef TAO_ESF_SHUTDOWN_PROXY_H
+#define TAO_ESF_SHUTDOWN_PROXY_H
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// A worker to invoke the shutdown method of each proxy.
+template<class PROXY>
+class TAO_ESF_Shutdown_Proxy : public TAO_ESF_Worker<PROXY>
+{
+public:
+ TAO_ESF_Shutdown_Proxy (void);
+
+ void work (PROXY *proxy
+ ACE_ENV_ARG_DECL);
+};
+
+// ****************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/ESF/ESF_Shutdown_Proxy.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_Shutdown_Proxy.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_Shutdown_Proxy.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_ESF_SHUTDOWN_PROXY_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Shutdown_Proxy.i b/TAO/orbsvcs/orbsvcs/ESF/ESF_Shutdown_Proxy.i
new file mode 100644
index 00000000000..51955993b3d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Shutdown_Proxy.i
@@ -0,0 +1,12 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class PROXY> ACE_INLINE
+TAO_ESF_Shutdown_Proxy<PROXY>::TAO_ESF_Shutdown_Proxy (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Worker.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Worker.cpp
new file mode 100644
index 00000000000..ef8c4ad0f37
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Worker.cpp
@@ -0,0 +1,22 @@
+// $Id$
+
+#ifndef TAO_ESF_WORKER_CPP
+#define TAO_ESF_WORKER_CPP
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class Object>
+TAO_ESF_Worker<Object>::~TAO_ESF_Worker (void)
+{
+}
+
+template<class Object>
+void TAO_ESF_Worker<Object>::set_size (size_t)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ESF_WORKER_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Worker.h b/TAO/orbsvcs/orbsvcs/ESF/ESF_Worker.h
new file mode 100644
index 00000000000..94041cc6555
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Worker.h
@@ -0,0 +1,67 @@
+// -*- C++ -*-
+
+/**
+ * @file ESF_Worker.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ESF_WORKER_H
+#define TAO_ESF_WORKER_H
+
+#include "ace/CORBA_macros.h"
+#include "ace/os_include/os_stddef.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class Object;
+
+namespace CORBA
+{
+ class Environment;
+}
+/// Define the interface for the Worker objects
+/**
+ * The Event Service Framework uses Worker classes to iterate over
+ * collections of proxies.
+ * The following class defines the worker interface, basically users of
+ * the framework implement a worker object and pass it to one
+ * collection. The collection invokes the worker for each element the
+ * colection contains.
+ */
+template<class Object>
+class TAO_ESF_Worker
+{
+public:
+ virtual ~TAO_ESF_Worker (void);
+
+ /// Used by the collection to inform the worker
+ /// the number of proxies in the collection.
+ virtual void set_size(size_t size);
+
+ /// Callback interface.
+ virtual void work (Object *object
+ ACE_ENV_ARG_DECL) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/ESF/ESF_Worker.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ESF_Worker.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_ESF_WORKER_H */
diff --git a/TAO/orbsvcs/orbsvcs/ESF/esf_export.h b/TAO/orbsvcs/orbsvcs/ESF/esf_export.h
new file mode 100644
index 00000000000..a9c7cd1fd3a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ESF/esf_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_ESF_EXPORT_H
+#define TAO_ESF_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_ESF_HAS_DLL)
+# define TAO_ESF_HAS_DLL 0
+# endif /* ! TAO_ESF_HAS_DLL */
+#else
+# if !defined (TAO_ESF_HAS_DLL)
+# define TAO_ESF_HAS_DLL 1
+# endif /* ! TAO_ESF_HAS_DLL */
+#endif
+
+#if defined (TAO_ESF_HAS_DLL) && (TAO_ESF_HAS_DLL == 1)
+# if defined (TAO_ESF_BUILD_DLL)
+# define TAO_ESF_Export ACE_Proper_Export_Flag
+# define TAO_ESF_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_ESF_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_ESF_BUILD_DLL */
+# define TAO_ESF_Export ACE_Proper_Import_Flag
+# define TAO_ESF_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_ESF_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_ESF_BUILD_DLL */
+#else /* TAO_ESF_HAS_DLL == 1 */
+# define TAO_ESF_Export
+# define TAO_ESF_SINGLETON_DECLARATION(T)
+# define TAO_ESF_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_ESF_HAS_DLL == 1 */
+
+#endif /* TAO_ESF_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/ETCL.mpc b/TAO/orbsvcs/orbsvcs/ETCL.mpc
new file mode 100644
index 00000000000..f7cfd1c9367
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL.mpc
@@ -0,0 +1,33 @@
+// -*- MPC -*-
+// $Id$
+
+project(ETCL) : orbsvcslib, core {
+ sharedname = TAO_ETCL
+ dynamicflags = TAO_ETCL_BUILD_DLL
+ tagchecks += Notify
+ pch_header =
+ pch_source =
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ ETCL
+ }
+
+ Header_Files {
+ ETCL
+ }
+
+ Inline_Files {
+ ETCL
+ }
+
+ Template_Files {
+ ETCL
+ }
+
+ Pkgconfig_Files {
+ TAO_ETCL.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/ETCL.rc b/TAO/orbsvcs/orbsvcs/ETCL.rc
new file mode 100644
index 00000000000..4a49921ad21
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "ETCL\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_ETCLDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_ETCL.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL.ll b/TAO/orbsvcs/orbsvcs/ETCL/ETCL.ll
new file mode 100644
index 00000000000..bfbe15ddd2a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL.ll
@@ -0,0 +1,161 @@
+%option noyywrap
+
+%{
+// ETCL.ll,v 1.5 2005/11/16 07:53:24 ossama Exp
+// ========================================================================
+//
+// = LIBRARY
+// orbsvcs/ECTL
+//
+// = FILENAME
+// ETCL.ll
+//
+// = AUTHOR
+// Carlos O'Ryan <coryan@uci.edu> based on previous work by
+// Seth Widoff <sbw1@cs.wustl.edu>
+//
+// ========================================================================
+
+#include "ace/OS.h"
+
+#include "ETCL_Constraint.h"
+#include "ETCL_y.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+static const char * extract_string(char*);
+
+#define TAO_YY_LEX_DEBUG
+
+#ifdef TAO_CONSTRAINT_DEBUG
+#define TAO_YY_LEX_DEBUG TAO_OS::fprintf(stderr, "%s\n", yytext)
+#endif /* TAO_CONSTRAINT_DEBUG */
+
+#define YY_DECL int TAO_ETCL_yylex (TAO_ETCL_YYSTYPE *lvalp, void* state)
+
+#define YY_BREAK
+#define YY_NO_UNPUT
+
+%}
+
+white_space [ \t]
+letter [a-zA-Z]
+digit [0-9]
+alpha_num ({letter}|{digit})
+integer {digit}+
+float ({digit}*\.{digit}+)([eE][-+]?{digit}+)?
+string '(([^'\\]*)|([^'\\]*\\')|([^'\\]*\\\\))*'
+base {letter}({alpha_num}|[_])*
+ident {base}|\\{base}
+newline \n
+
+%%
+
+min { TAO_YY_LEX_DEBUG; return TAO_ETCL_MIN; }
+max { TAO_YY_LEX_DEBUG; return TAO_ETCL_MAX; }
+first { TAO_YY_LEX_DEBUG; return TAO_ETCL_FIRST; }
+random { TAO_YY_LEX_DEBUG; return TAO_ETCL_RANDOM; }
+with { TAO_YY_LEX_DEBUG; return TAO_ETCL_WITH; }
+exist { TAO_YY_LEX_DEBUG; return TAO_ETCL_EXIST; }
+not { TAO_YY_LEX_DEBUG; return TAO_ETCL_NOT; }
+and { TAO_YY_LEX_DEBUG; return TAO_ETCL_AND; }
+or { TAO_YY_LEX_DEBUG; return TAO_ETCL_OR; }
+in { TAO_YY_LEX_DEBUG; return TAO_ETCL_IN; }
+"~" { TAO_YY_LEX_DEBUG; return TAO_ETCL_TWIDDLE; }
+"+" { TAO_YY_LEX_DEBUG; return TAO_ETCL_PLUS; }
+"-" { TAO_YY_LEX_DEBUG; return TAO_ETCL_MINUS; }
+"*" { TAO_YY_LEX_DEBUG; return TAO_ETCL_MULT; }
+"/" { TAO_YY_LEX_DEBUG; return TAO_ETCL_DIV; }
+"<" { TAO_YY_LEX_DEBUG; return TAO_ETCL_LT; }
+"<=" { TAO_YY_LEX_DEBUG; return TAO_ETCL_LE; }
+">" { TAO_YY_LEX_DEBUG; return TAO_ETCL_GT; }
+">=" { TAO_YY_LEX_DEBUG; return TAO_ETCL_GE; }
+"==" { TAO_YY_LEX_DEBUG; return TAO_ETCL_EQ; }
+"!=" { TAO_YY_LEX_DEBUG; return TAO_ETCL_NE; }
+"(" { TAO_YY_LEX_DEBUG; return TAO_ETCL_LPAREN; }
+")" { TAO_YY_LEX_DEBUG; return TAO_ETCL_RPAREN; }
+"$" { TAO_YY_LEX_DEBUG; return TAO_ETCL_DOLLAR; }
+"." { TAO_YY_LEX_DEBUG; return TAO_ETCL_DOT; }
+"default" { TAO_YY_LEX_DEBUG; return TAO_ETCL_DEFAULT; }
+"_d" { TAO_YY_LEX_DEBUG; return TAO_ETCL_DISCRIMINANT; }
+"_type_id" { TAO_YY_LEX_DEBUG; return TAO_ETCL_TYPE_ID; }
+"_repos_id" { TAO_YY_LEX_DEBUG; return TAO_ETCL_REPOS_ID; }
+"_length" { TAO_YY_LEX_DEBUG; return TAO_ETCL_LENGTH; }
+"[" { TAO_YY_LEX_DEBUG; return TAO_ETCL_LBRA; }
+"]" { TAO_YY_LEX_DEBUG; return TAO_ETCL_RBRA; }
+TRUE {
+ lvalp->constraint =
+ new TAO_ETCL_Literal_Constraint ((CORBA::Boolean) 1);
+ TAO_YY_LEX_DEBUG; return TAO_ETCL_BOOLEAN;
+ }
+FALSE {
+ lvalp->constraint =
+ new TAO_ETCL_Literal_Constraint ((CORBA::Boolean) 0);
+ TAO_YY_LEX_DEBUG; return TAO_ETCL_BOOLEAN;
+ }
+{integer} {
+ lvalp->constraint =
+ new TAO_ETCL_Literal_Constraint (ACE_OS::atoi (yytext));
+ TAO_YY_LEX_DEBUG; return TAO_ETCL_INTEGER;
+ }
+{float} {
+ double v;
+ sscanf (yytext, "%lf", &v);
+ lvalp->constraint =
+ new TAO_ETCL_Literal_Constraint (v);
+ TAO_YY_LEX_DEBUG; return TAO_ETCL_FLOAT;
+ }
+{string} {
+ lvalp->constraint =
+ new TAO_ETCL_Literal_Constraint (extract_string (yytext));
+ TAO_YY_LEX_DEBUG; return TAO_ETCL_STRING;
+ }
+{ident} {
+ lvalp->constraint =
+ new TAO_ETCL_Identifier (yytext);
+ TAO_YY_LEX_DEBUG; return TAO_ETCL_IDENT;
+ }
+{white_space} {
+ TAO_YY_LEX_DEBUG; break; // Ignore
+ }
+. {
+ TAO_YY_LEX_DEBUG; break; // @@ TODO
+ }
+%%
+
+const char*
+extract_string(char* str)
+{
+ char *t = str;
+ for (char * i = str + 1; *i != '\''; ++i, ++t)
+ {
+ if (*i == '\\')
+ {
+ ++i;
+ if (*i == 0)
+ return 0;
+ else if (*i == 't')
+ *t = '\t';
+ else if (*i == 'n')
+ *t = '\n';
+ else if (*i == '\\')
+ *t = '\\';
+ else
+ *t = *i;
+ continue;
+ }
+
+ *t = *i;
+ }
+
+ *t = '\0';
+ return str;
+}
+
+int
+yywrap (void)
+{
+ return 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL \ No newline at end of file
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL.rc b/TAO/orbsvcs/orbsvcs/ETCL/ETCL.rc
new file mode 100644
index 00000000000..c84d11c35db
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL.rc
@@ -0,0 +1,30 @@
+#include "..\..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "ETCL\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_ETCLDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_ETCL.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL.yy b/TAO/orbsvcs/orbsvcs/ETCL/ETCL.yy
new file mode 100644
index 00000000000..14c9eaad182
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL.yy
@@ -0,0 +1,261 @@
+%{
+// $Id$
+// ========================================================================
+//
+// = LIBRARY
+// orbsvcs / Extended Trader Constraint Language parser.
+//
+// = FILENAME
+// ETCL.yy
+//
+// = AUTHOR
+// Carlos O'Ryan <coryan@uci.edu> based on previous work by
+// Seth Widoff <sbw1@cs.wustl.edu>
+//
+// ========================================================================
+
+#include "ETCL_y.h"
+#include "ETCL_Constraint.h"
+#include "ETCL_Interpreter.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+extern int yylex (void);
+
+static void yyerror (const char *)
+{
+ // @@ TODO
+ // Ignore error messages
+}
+
+%}
+
+%token TAO_ETCL_GT
+%token TAO_ETCL_GE
+%token TAO_ETCL_LT
+%token TAO_ETCL_LE
+%token TAO_ETCL_EQ
+%token TAO_ETCL_NE
+%token TAO_ETCL_EXIST
+%token TAO_ETCL_DEFAULT
+%token TAO_ETCL_AND
+%token TAO_ETCL_OR
+%token TAO_ETCL_NOT
+%token TAO_ETCL_IN
+%token TAO_ETCL_TWIDDLE
+%token TAO_ETCL_BOOLEAN
+%token TAO_ETCL_PLUS
+%token TAO_ETCL_MINUS
+%token TAO_ETCL_MULT
+%token TAO_ETCL_DIV
+%token TAO_ETCL_UMINUS
+%token TAO_ETCL_INTEGER
+%token TAO_ETCL_FLOAT
+%token TAO_ETCL_STRING
+%token TAO_ETCL_RPAREN
+%token TAO_ETCL_LPAREN
+%token TAO_ETCL_RBRA
+%token TAO_ETCL_LBRA
+%token TAO_ETCL_IDENT
+%token TAO_ETCL_UNSIGNED
+%token TAO_ETCL_SIGNED
+%token TAO_ETCL_DOUBLE
+%token TAO_ETCL_CONSTRAINT
+%token TAO_ETCL_COMPONENT
+%token TAO_ETCL_WITH
+%token TAO_ETCL_MAX
+%token TAO_ETCL_MIN
+%token TAO_ETCL_FIRST
+%token TAO_ETCL_RANDOM
+%token TAO_ETCL_DOLLAR
+%token TAO_ETCL_DOT
+%token TAO_ETCL_DISCRIMINANT
+%token TAO_ETCL_LENGTH
+%token TAO_ETCL_TYPE_ID
+%token TAO_ETCL_REPOS_ID
+
+
+%type <constraint> TAO_ETCL_IDENT
+%type <constraint> TAO_ETCL_BOOLEAN
+%type <constraint> TAO_ETCL_STRING
+%type <constraint> TAO_ETCL_FLOAT
+%type <constraint> TAO_ETCL_INTEGER
+%type <constraint> expr_in
+%type <constraint> constraint preference bool_or bool_and bool_compare
+%type <constraint> expr_in expr_twiddle expr term factor_not factor
+%type <constraint> union_pos union_val component_array
+%type <constraint> component_array component_assoc component_pos
+%type <constraint> component_dot component_ext component
+
+%start constraint
+
+%%
+
+constraint: bool_or
+ | preference
+ ;
+
+preference: TAO_ETCL_MIN bool_or
+ { $$ = new TAO_ETCL_Preference (TAO_ETCL_MIN, $2); }
+ | TAO_ETCL_MAX bool_or
+ { $$ = new TAO_ETCL_Preference (TAO_ETCL_MAX, $2); }
+ | TAO_ETCL_WITH bool_or
+ { $$ = new TAO_ETCL_Preference (TAO_ETCL_WITH, $2); }
+ | TAO_ETCL_FIRST
+ { $$ = new TAO_ETCL_Preference (TAO_ETCL_FIRST); }
+ | TAO_ETCL_RANDOM
+ { $$ = new TAO_ETCL_Preference (TAO_ETCL_RANDOM); }
+ ;
+
+bool_or: bool_or TAO_ETCL_OR bool_and
+ { $$ = new TAO_ETCL_Binary_Expr (TAO_ETCL_OR, $1, $3); }
+ | bool_and
+ ;
+
+bool_and: bool_and TAO_ETCL_AND bool_compare
+ { $$ = new TAO_ETCL_Binary_Expr (TAO_ETCL_AND, $1, $3); }
+ | bool_compare
+ ;
+
+bool_compare: expr_in TAO_ETCL_EQ expr_in
+ { $$ = new TAO_ETCL_Binary_Expr (TAO_ETCL_EQ, $1, $3); }
+ | expr_in TAO_ETCL_NE expr_in
+ { $$ = new TAO_ETCL_Binary_Expr (TAO_ETCL_NE, $1, $3); }
+ | expr_in TAO_ETCL_GT expr_in
+ { $$ = new TAO_ETCL_Binary_Expr (TAO_ETCL_GT, $1, $3); }
+ | expr_in TAO_ETCL_GE expr_in
+ { $$ = new TAO_ETCL_Binary_Expr (TAO_ETCL_GE, $1, $3); }
+ | expr_in TAO_ETCL_LT expr_in
+ { $$ = new TAO_ETCL_Binary_Expr (TAO_ETCL_LT, $1, $3); }
+ | expr_in TAO_ETCL_LE expr_in
+ { $$ = new TAO_ETCL_Binary_Expr (TAO_ETCL_LE, $1, $3); }
+ | expr_in
+ ;
+
+expr_in: expr_twiddle TAO_ETCL_IN component
+ { $$ = new TAO_ETCL_Binary_Expr (TAO_ETCL_IN, $1, $3); }
+ | expr_twiddle TAO_ETCL_IN TAO_ETCL_DOLLAR component
+ { $$ = new TAO_ETCL_Binary_Expr (TAO_ETCL_IN, $1, $4); }
+ | expr_twiddle
+ ;
+
+expr_twiddle: expr TAO_ETCL_TWIDDLE expr
+ { $$ = new TAO_ETCL_Binary_Expr (TAO_ETCL_TWIDDLE, $1, $3); }
+ | expr
+ ;
+
+expr: expr TAO_ETCL_PLUS term
+ { $$ = new TAO_ETCL_Binary_Expr (TAO_ETCL_PLUS, $1, $3); }
+ | expr TAO_ETCL_MINUS term
+ { $$ = new TAO_ETCL_Binary_Expr (TAO_ETCL_MINUS, $1, $3); }
+ | term
+ ;
+
+term: term TAO_ETCL_MULT factor_not
+ { $$ = new TAO_ETCL_Binary_Expr (TAO_ETCL_MULT, $1, $3); }
+ | term TAO_ETCL_DIV factor_not
+ { $$ = new TAO_ETCL_Binary_Expr (TAO_ETCL_DIV, $1, $3); }
+ | factor_not
+ ;
+
+factor_not: TAO_ETCL_NOT factor
+ { $$ = new TAO_ETCL_Unary_Expr (TAO_ETCL_NOT, $2); }
+ | factor
+ ;
+
+factor: TAO_ETCL_LPAREN bool_or TAO_ETCL_RPAREN
+ { $$ = $2; }
+ | TAO_ETCL_INTEGER
+ { $$ = $1; }
+ | TAO_ETCL_PLUS TAO_ETCL_INTEGER
+ { $$ = new TAO_ETCL_Unary_Expr (TAO_ETCL_PLUS, $2); }
+ | TAO_ETCL_MINUS TAO_ETCL_INTEGER
+ { $$ = new TAO_ETCL_Unary_Expr (TAO_ETCL_MINUS, $2); }
+ | TAO_ETCL_FLOAT
+ { $$ = $1; }
+ | TAO_ETCL_PLUS TAO_ETCL_FLOAT
+ { $$ = new TAO_ETCL_Unary_Expr (TAO_ETCL_PLUS, $2); }
+ | TAO_ETCL_MINUS TAO_ETCL_FLOAT
+ { $$ = new TAO_ETCL_Unary_Expr (TAO_ETCL_MINUS, $2); }
+ | TAO_ETCL_STRING
+ { $$ = $1; }
+ | TAO_ETCL_BOOLEAN
+ { $$ = $1; }
+ | TAO_ETCL_EXIST TAO_ETCL_IDENT
+ { $$ = new TAO_ETCL_Exist ($2); }
+ | TAO_ETCL_EXIST TAO_ETCL_DOLLAR component
+ { $$ = new TAO_ETCL_Exist ($3); }
+ | TAO_ETCL_DEFAULT TAO_ETCL_DOLLAR component
+ { $$ = new TAO_ETCL_Default ($3); }
+ | TAO_ETCL_DOLLAR component
+ { $$ = new TAO_ETCL_Eval ($2); }
+ | TAO_ETCL_IDENT
+ { $$ = $1; }
+ ;
+
+component: /* empty */
+ { $$ = 0; }
+ | TAO_ETCL_DOT component_dot
+ { $$ = new TAO_ETCL_Dot ($2); }
+
+ | TAO_ETCL_IDENT component_ext
+ { $$ = new TAO_ETCL_Component ($1, $2); }
+
+ | component_array
+ | component_assoc
+ ;
+
+component_ext: /* empty */
+ { $$ = 0; }
+ | TAO_ETCL_DOT component_dot
+ { $$ = new TAO_ETCL_Dot ($2); }
+
+ | component_array
+ | component_assoc
+ ;
+
+component_dot: TAO_ETCL_IDENT component_ext
+ { $$ = new TAO_ETCL_Component ($1, $2); }
+ | TAO_ETCL_LENGTH
+ { $$ = new TAO_ETCL_Special (TAO_ETCL_LENGTH); }
+ | TAO_ETCL_DISCRIMINANT
+ { $$ = new TAO_ETCL_Special (TAO_ETCL_DISCRIMINANT); }
+ | TAO_ETCL_TYPE_ID
+ { $$ = new TAO_ETCL_Special (TAO_ETCL_TYPE_ID); }
+ | TAO_ETCL_REPOS_ID
+ { $$ = new TAO_ETCL_Special (TAO_ETCL_REPOS_ID); }
+ | component_pos
+ | union_pos
+ ;
+
+component_array: TAO_ETCL_LBRA TAO_ETCL_INTEGER TAO_ETCL_RBRA component_ext
+ { $$ = new TAO_ETCL_Component_Array ($2, $4); }
+ ;
+
+component_assoc: TAO_ETCL_LPAREN TAO_ETCL_IDENT TAO_ETCL_RPAREN component_ext
+ { $$ = new TAO_ETCL_Component_Assoc ($2, $4); }
+ ;
+
+component_pos: TAO_ETCL_INTEGER component_ext
+ { $$ = new TAO_ETCL_Component_Pos ($1, $2); }
+ ;
+
+union_pos: TAO_ETCL_LPAREN union_val TAO_ETCL_RPAREN component_ext
+ { $$ = new TAO_ETCL_Union_Pos ($2, $4); }
+ ;
+
+union_val: /* empty */
+ { $$ = 0; }
+ | TAO_ETCL_INTEGER
+ { $$ = new TAO_ETCL_Union_Value (+1, $1); }
+ | TAO_ETCL_PLUS TAO_ETCL_INTEGER
+ { $$ = new TAO_ETCL_Union_Value (+1, $2); }
+ | TAO_ETCL_MINUS TAO_ETCL_INTEGER
+ { $$ = new TAO_ETCL_Union_Value (-1, $2); }
+ | TAO_ETCL_STRING
+ { $$ = new TAO_ETCL_Union_Value ($1); }
+ ;
+
+%%
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.cpp b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.cpp
new file mode 100644
index 00000000000..092af3fa7f8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.cpp
@@ -0,0 +1,956 @@
+// -*- C++ -*-
+// $Id$
+
+#include "orbsvcs/ETCL/ETCL_Constraint.h"
+#include "orbsvcs/ETCL/ETCL_Constraint_Visitor.h"
+#include "orbsvcs/ETCL/ETCL_y.h"
+
+#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h"
+#include "tao/AnyTypeCode/TypeCode.h"
+#include "tao/AnyTypeCode/Any.h"
+#include "tao/Environment.h"
+#include "tao/CDR.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/ETCL/ETCL_Constraint.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (ETCL,
+ ETCL_Constraint,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ETCL_Constraint::TAO_ETCL_Constraint (void)
+{
+}
+
+TAO_ETCL_Constraint::~TAO_ETCL_Constraint (void)
+{
+}
+
+// ****************************************************************
+
+TAO_ETCL_Literal_Constraint::TAO_ETCL_Literal_Constraint (
+ const TAO_ETCL_Literal_Constraint & lit
+ )
+ : TAO_ETCL_Constraint ()
+{
+ this->copy (lit);
+}
+
+
+TAO_ETCL_Literal_Constraint::TAO_ETCL_Literal_Constraint (CORBA::Any * any)
+{
+ CORBA::Any& any_ref = *any;
+ CORBA::TypeCode_var type = any_ref.type ();
+ CORBA::TCKind corba_type = CORBA::tk_null;
+
+ ACE_TRY_NEW_ENV
+ {
+ corba_type = type->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // @@ Seth: Don't know what else to do. Make sure we can tell
+ // when this constructor fails.
+ return;
+ }
+ ACE_ENDTRY;
+
+ this->type_ =
+ TAO_ETCL_Literal_Constraint::comparable_type (type.in ());
+
+ switch (this->type_)
+ {
+ case TAO_ETCL_SIGNED:
+ this->op_.integer_ = 0;
+
+ if (corba_type == CORBA::tk_short)
+ {
+ CORBA::Short sh;
+ any_ref >>= sh;
+ this->op_.integer_ = (CORBA::Long) sh;
+ }
+ else
+ {
+ any_ref >>= this->op_.integer_;
+ }
+
+ break;
+ case TAO_ETCL_UNSIGNED:
+ this->op_.uinteger_ = 0;
+
+ if (corba_type == CORBA::tk_ushort)
+ {
+ CORBA::UShort sh;
+ any_ref >>= sh;
+ this->op_.uinteger_ = (CORBA::ULong) sh;
+ }
+ else if (corba_type == CORBA::tk_enum)
+ {
+ TAO::Any_Impl *impl = any->impl ();
+
+ if (impl->encoded ())
+ {
+ TAO::Unknown_IDL_Type *unk =
+ dynamic_cast<TAO::Unknown_IDL_Type *> (impl);
+
+ // We don't want unk's rd_ptr to move, in case we are shared by
+ // another Any, so we use this to copy the state, not the buffer.
+ TAO_InputCDR for_reading (unk->_tao_get_cdr ());
+ for_reading.read_ulong (this->op_.uinteger_);
+ }
+ else
+ {
+ TAO_OutputCDR out;
+ impl->marshal_value (out);
+ TAO_InputCDR in (out);
+ in.read_ulong (this->op_.uinteger_);
+ }
+ }
+ else
+ {
+ any_ref >>= this->op_.uinteger_;
+ }
+
+ break;
+ case TAO_ETCL_DOUBLE:
+ if (corba_type == CORBA::tk_float)
+ {
+ CORBA::Float fl;
+ (*any) >>= fl;
+ this->op_.double_ = (CORBA::Double) fl;
+ }
+ else
+ {
+ (*any) >>= this->op_.double_;
+ }
+
+ break;
+ case TAO_ETCL_BOOLEAN:
+ {
+ CORBA::Any::to_boolean tmp (this->op_.bool_);
+ (*any) >>= tmp;
+ }
+ break;
+ case TAO_ETCL_STRING:
+ {
+ const char* s;
+ any_ref >>= s;
+ this->op_.str_ = CORBA::string_dup (s);
+ }
+ break;
+ case TAO_ETCL_COMPONENT:
+ this->op_.any_ = any;
+ break;
+ }
+}
+
+TAO_ETCL_Literal_Constraint::TAO_ETCL_Literal_Constraint (
+ CORBA::ULong uinteger
+ )
+ : type_ (TAO_ETCL_UNSIGNED)
+{
+ this->op_.uinteger_ = uinteger;
+}
+
+TAO_ETCL_Literal_Constraint::TAO_ETCL_Literal_Constraint (
+ CORBA::Long integer
+ )
+ : type_ (TAO_ETCL_SIGNED)
+{
+ this->op_.integer_ = integer;
+}
+
+TAO_ETCL_Literal_Constraint::TAO_ETCL_Literal_Constraint (
+ CORBA::Boolean boolean
+ )
+ : type_ (TAO_ETCL_BOOLEAN)
+{
+ this->op_.bool_ = boolean;
+}
+
+TAO_ETCL_Literal_Constraint::TAO_ETCL_Literal_Constraint (
+ CORBA::Double doub
+ )
+ : type_ (TAO_ETCL_DOUBLE)
+{
+ this->op_.double_ = doub;
+}
+
+TAO_ETCL_Literal_Constraint::TAO_ETCL_Literal_Constraint (
+ const char* str
+ )
+ : type_ (TAO_ETCL_STRING)
+{
+ this->op_.str_ = CORBA::string_dup (str);
+}
+
+TAO_ETCL_Literal_Constraint::~TAO_ETCL_Literal_Constraint (void)
+{
+ if (this->type_ == TAO_ETCL_STRING)
+ {
+ CORBA::string_free (this->op_.str_);
+ }
+}
+
+int
+TAO_ETCL_Literal_Constraint::accept (TAO_ETCL_Constraint_Visitor* visitor)
+{
+ return visitor->visit_literal (this);
+}
+
+TAO_Literal_Type
+TAO_ETCL_Literal_Constraint::expr_type (void) const
+{
+ return this->type_;
+}
+
+void
+TAO_ETCL_Literal_Constraint::operator= (const TAO_ETCL_Literal_Constraint& co)
+{
+ this->copy (co);
+}
+
+TAO_ETCL_Literal_Constraint::operator CORBA::Boolean (void) const
+{
+ return (this->type_ == TAO_ETCL_BOOLEAN) ? this->op_.bool_ : 0;
+}
+
+TAO_ETCL_Literal_Constraint::operator CORBA::ULong (void) const
+{
+ switch (this->type_)
+ {
+ case TAO_ETCL_UNSIGNED:
+ return this->op_.uinteger_;
+ case TAO_ETCL_SIGNED:
+ case TAO_ETCL_INTEGER:
+ return
+ (this->op_.integer_ > 0) ? (CORBA::ULong) this->op_.integer_ : 0;
+ case TAO_ETCL_DOUBLE:
+ return
+ (this->op_.double_ > 0) ?
+ ((this->op_.double_ > ACE_UINT32_MAX) ?
+ ACE_UINT32_MAX :
+ (CORBA::ULong) this->op_.double_)
+ : 0;
+ case TAO_ETCL_COMPONENT:
+ {
+ CORBA::ULong retval = 0;
+ *this->op_.any_ >>= retval;
+ return retval;
+ }
+ default:
+ return 0;
+ }
+}
+
+TAO_ETCL_Literal_Constraint::operator CORBA::Long (void) const
+{
+ switch (this->type_)
+ {
+ case TAO_ETCL_SIGNED:
+ case TAO_ETCL_INTEGER:
+ return this->op_.integer_;
+ case TAO_ETCL_UNSIGNED:
+ return
+ (this->op_.uinteger_ > (CORBA::ULong) ACE_INT32_MAX) ?
+ ACE_INT32_MAX : (CORBA::Long) this->op_.uinteger_;
+ case TAO_ETCL_DOUBLE:
+ return
+ (this->op_.double_ > 0) ?
+ ((this->op_.double_ > ACE_INT32_MAX) ?
+ ACE_INT32_MAX :
+ (CORBA::Long) this->op_.double_) :
+ ((this->op_.double_ < ACE_INT32_MIN) ?
+ ACE_INT32_MIN :
+ (CORBA::Long) this->op_.double_);
+ case TAO_ETCL_COMPONENT:
+ {
+ CORBA::Long retval = 0;
+ *this->op_.any_ >>= retval;
+ return retval;
+ }
+ default:
+ return 0;
+ }
+}
+
+TAO_ETCL_Literal_Constraint::operator CORBA::Double (void) const
+{
+ switch (this->type_)
+ {
+ case TAO_ETCL_DOUBLE:
+ return this->op_.double_;
+ case TAO_ETCL_SIGNED:
+ case TAO_ETCL_INTEGER:
+ return (CORBA::Double) this->op_.integer_;
+ case TAO_ETCL_UNSIGNED:
+ return (CORBA::Double) this->op_.uinteger_;
+ case TAO_ETCL_COMPONENT:
+ {
+ CORBA::Double retval = 0.0;
+ *this->op_.any_ >>= retval;
+ return retval;
+ }
+ default:
+ return 0.0;
+ }
+}
+
+TAO_ETCL_Literal_Constraint::operator const char* (void) const
+{
+ switch (this->type_)
+ {
+ case TAO_ETCL_STRING:
+ return this->op_.str_;
+ case TAO_ETCL_COMPONENT:
+ {
+ const char *retval = 0;
+ *this->op_.any_ >>= retval;
+ return retval;
+ }
+ default:
+ return 0;
+ }
+}
+
+TAO_ETCL_Literal_Constraint::operator const CORBA::Any* (void) const
+{
+ return (this->type_ == TAO_ETCL_COMPONENT) ? this->op_.any_ : 0;
+}
+
+TAO_Literal_Type
+TAO_ETCL_Literal_Constraint::comparable_type (CORBA::TypeCode_ptr type)
+{
+ // Convert a CORBA::TCKind into a TAO_Literal_Type
+ TAO_Literal_Type return_value = TAO_UNKNOWN;
+ CORBA::TCKind kind = CORBA::tk_null;
+
+ ACE_TRY_NEW_ENV
+ {
+ kind = type->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::TypeCode_var tmp = CORBA::TypeCode::_duplicate (type);
+
+ while (kind == CORBA::tk_alias)
+ {
+ tmp = tmp->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ kind = tmp->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return return_value;
+ }
+ ACE_ENDTRY;
+ // Since this is a "top level try block, no need to check again.
+
+ switch (kind)
+ {
+ case CORBA::tk_ushort:
+ case CORBA::tk_ulong:
+ case CORBA::tk_enum:
+ case CORBA::tk_ulonglong:
+ return_value = TAO_ETCL_UNSIGNED;
+ break;
+ case CORBA::tk_short:
+ case CORBA::tk_long:
+ case CORBA::tk_longlong:
+ return_value = TAO_ETCL_SIGNED;
+ break;
+ case CORBA::tk_boolean:
+ return_value = TAO_ETCL_BOOLEAN;
+ break;
+ case CORBA::tk_float:
+ case CORBA::tk_double:
+ return_value = TAO_ETCL_DOUBLE;
+ break;
+ case CORBA::tk_string:
+ return_value = TAO_ETCL_STRING;
+ break;
+ default:
+ return_value = TAO_ETCL_COMPONENT;
+ break;
+ }
+
+ return return_value;
+}
+
+bool
+TAO_ETCL_Literal_Constraint::operator== (const TAO_ETCL_Literal_Constraint & rhs)
+{
+ bool return_value = false;
+ TAO_Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case TAO_ETCL_STRING:
+ return_value = (ACE_OS::strcmp ((const char*) *this, (const char*) rhs) == 0);
+ break;
+ case TAO_ETCL_DOUBLE:
+ return_value = (CORBA::Double) *this == (CORBA::Double) rhs;
+ break;
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ return_value = (CORBA::Long) *this == (CORBA::Long) rhs;
+ break;
+ case TAO_ETCL_UNSIGNED:
+ return_value = (CORBA::ULong) *this == (CORBA::ULong) rhs;
+ break;
+ case TAO_ETCL_BOOLEAN:
+ return_value = (CORBA::Boolean) *this == (CORBA::Boolean) rhs;
+ break;
+ default:
+ break;
+ }
+
+ return return_value;
+}
+
+
+bool
+TAO_ETCL_Literal_Constraint::operator!= (const TAO_ETCL_Literal_Constraint & rhs)
+{
+ bool return_value = false;
+ TAO_Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case TAO_ETCL_STRING:
+ return_value = (ACE_OS::strcmp ((const char*) *this, (const char*) rhs) != 0);
+ break;
+ case TAO_ETCL_DOUBLE:
+ return_value = (CORBA::Double) *this != (CORBA::Double) rhs;
+ break;
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ return_value = (CORBA::Long) *this != (CORBA::Long) rhs;
+ break;
+ case TAO_ETCL_UNSIGNED:
+ return_value = (CORBA::ULong) *this != (CORBA::ULong) rhs;
+ break;
+ case TAO_ETCL_BOOLEAN:
+ return_value = (CORBA::Boolean) *this != (CORBA::Boolean) rhs;
+ break;
+ default:
+ break;
+ }
+
+ return return_value;
+}
+
+bool
+TAO_ETCL_Literal_Constraint::operator< (const TAO_ETCL_Literal_Constraint & rhs)
+{
+ bool return_value = false;
+ TAO_Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case TAO_ETCL_STRING:
+ return_value = (ACE_OS::strcmp ((const char*) *this, (const char*) rhs) < 0);
+ break;
+ case TAO_ETCL_DOUBLE:
+ return_value = (CORBA::Double) *this < (CORBA::Double) rhs;
+ break;
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ return_value = (CORBA::Long) *this < (CORBA::Long) rhs;
+ break;
+ case TAO_ETCL_UNSIGNED:
+ return_value = (CORBA::ULong) *this < (CORBA::ULong) rhs;
+ break;
+ case TAO_ETCL_BOOLEAN:
+ return_value = (CORBA::Boolean) *this < (CORBA::Boolean) rhs;
+ break;
+ default:
+ break;
+ }
+
+ return return_value;
+}
+
+bool
+TAO_ETCL_Literal_Constraint::operator<= (const TAO_ETCL_Literal_Constraint & rhs)
+{
+ bool return_value = false;
+ TAO_Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case TAO_ETCL_STRING:
+ return_value = (ACE_OS::strcmp ((const char*) *this, (const char*) rhs) <= 0);
+ break;
+ case TAO_ETCL_DOUBLE:
+ return_value = (CORBA::Double) *this <= (CORBA::Double) rhs;
+ break;
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ return_value = (CORBA::Long) *this <= (CORBA::Long) rhs;
+ break;
+ case TAO_ETCL_UNSIGNED:
+ return_value = (CORBA::ULong) *this <= (CORBA::ULong) rhs;
+ break;
+ default:
+ break;
+ }
+
+ return return_value;
+}
+
+bool
+TAO_ETCL_Literal_Constraint::operator> (const TAO_ETCL_Literal_Constraint & rhs)
+{
+ bool return_value = false;
+ TAO_Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case TAO_ETCL_STRING:
+ return_value = (ACE_OS::strcmp ((const char*) *this, (const char*) rhs) > 0);
+ break;
+ case TAO_ETCL_DOUBLE:
+ return_value = (CORBA::Double) *this > (CORBA::Double) rhs;
+ break;
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ return_value = (CORBA::Long) *this > (CORBA::Long) rhs;
+ break;
+ case TAO_ETCL_UNSIGNED:
+ return_value = (CORBA::ULong) *this > (CORBA::ULong) rhs;
+ break;
+ default:
+ break;
+ }
+
+ return return_value;
+}
+
+bool
+TAO_ETCL_Literal_Constraint::operator>= (const TAO_ETCL_Literal_Constraint & rhs)
+{
+ bool return_value = false;
+ TAO_Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case TAO_ETCL_STRING:
+ return_value =
+ (ACE_OS::strcmp ((const char*) *this, (const char*) rhs) >= 0);
+ break;
+ case TAO_ETCL_DOUBLE:
+ return_value = (CORBA::Double) *this >= (CORBA::Double) rhs;
+ break;
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ return_value = (CORBA::Long) *this >= (CORBA::Long) rhs;
+ break;
+ case TAO_ETCL_UNSIGNED:
+ return_value = (CORBA::ULong) *this >= (CORBA::ULong) rhs;
+ break;
+ default:
+ break;
+ }
+
+ return return_value;
+}
+
+TAO_ETCL_Literal_Constraint
+TAO_ETCL_Literal_Constraint::operator+ (const TAO_ETCL_Literal_Constraint & rhs)
+{
+ TAO_Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case TAO_ETCL_DOUBLE:
+ {
+ CORBA::Double result = (CORBA::Double) *this + (CORBA::Double) rhs;
+ return TAO_ETCL_Literal_Constraint ((CORBA::Double) result);
+ }
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ {
+ CORBA::Long result = (CORBA::Long) *this + (CORBA::Long) rhs;
+ return TAO_ETCL_Literal_Constraint ((CORBA::Long) result);
+ }
+ case TAO_ETCL_UNSIGNED:
+ {
+ CORBA::ULong result = (CORBA::ULong) *this + (CORBA::ULong) rhs;
+ return TAO_ETCL_Literal_Constraint ((CORBA::ULong) result);
+ }
+ default:
+ return TAO_ETCL_Literal_Constraint ((CORBA::Long) 0);
+ }
+}
+
+TAO_ETCL_Literal_Constraint
+TAO_ETCL_Literal_Constraint::operator- (const TAO_ETCL_Literal_Constraint & rhs)
+{
+ TAO_Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case TAO_ETCL_DOUBLE:
+ {
+ CORBA::Double result = (CORBA::Double) *this - (CORBA::Double) rhs;
+ return TAO_ETCL_Literal_Constraint ((CORBA::Double) result);
+ }
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ {
+ CORBA::Long result = (CORBA::Long) *this - (CORBA::Long) rhs;
+ return TAO_ETCL_Literal_Constraint ((CORBA::Long) result);
+ }
+ case TAO_ETCL_UNSIGNED:
+ {
+ CORBA::ULong result = (CORBA::ULong) *this - (CORBA::ULong) rhs;
+ return TAO_ETCL_Literal_Constraint ((CORBA::ULong) result);
+ }
+ default:
+ return TAO_ETCL_Literal_Constraint ((CORBA::Long) 0);
+ }
+}
+
+TAO_ETCL_Literal_Constraint
+TAO_ETCL_Literal_Constraint::operator* (const TAO_ETCL_Literal_Constraint & rhs)
+{
+ TAO_Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case TAO_ETCL_DOUBLE:
+ {
+ CORBA::Double result = (CORBA::Double) *this * (CORBA::Double) rhs;
+ return TAO_ETCL_Literal_Constraint ((CORBA::Double) result);
+ }
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ {
+ CORBA::Long result = (CORBA::Long) *this * (CORBA::Long) rhs;
+ return TAO_ETCL_Literal_Constraint ((CORBA::Long) result);
+ }
+ case TAO_ETCL_UNSIGNED:
+ {
+ CORBA::ULong result = (CORBA::ULong) *this * (CORBA::ULong) rhs;
+ return TAO_ETCL_Literal_Constraint ((CORBA::ULong) result);
+ }
+ default:
+ return TAO_ETCL_Literal_Constraint ((CORBA::Long) 0);
+ }
+}
+
+TAO_ETCL_Literal_Constraint
+TAO_ETCL_Literal_Constraint::operator/ (const TAO_ETCL_Literal_Constraint & rhs)
+{
+ TAO_Literal_Type widest_type = this->widest_type (rhs);
+
+ switch (widest_type)
+ {
+ case TAO_ETCL_DOUBLE:
+ {
+ CORBA::Double result = (CORBA::Double) *this / (CORBA::Double) rhs;
+ return TAO_ETCL_Literal_Constraint ((CORBA::Double) result);
+ }
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ {
+ CORBA::Long result = (CORBA::Long) *this / (CORBA::Long) rhs;
+ return TAO_ETCL_Literal_Constraint ((CORBA::Long) result);
+ }
+ case TAO_ETCL_UNSIGNED:
+ {
+ CORBA::ULong result = (CORBA::ULong) *this / (CORBA::ULong) rhs;
+ return TAO_ETCL_Literal_Constraint ((CORBA::ULong) result);
+ }
+ default:
+ return TAO_ETCL_Literal_Constraint ((CORBA::Long) 0);
+ }
+}
+
+TAO_ETCL_Literal_Constraint
+TAO_ETCL_Literal_Constraint::operator- (void)
+{
+ switch (this->type_)
+ {
+ case TAO_ETCL_DOUBLE:
+ return TAO_ETCL_Literal_Constraint (- this->op_.double_);
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ return TAO_ETCL_Literal_Constraint (- this->op_.integer_);
+ case TAO_ETCL_UNSIGNED:
+ return TAO_ETCL_Literal_Constraint (- (CORBA::Long) this->op_.uinteger_);
+ default:
+ return TAO_ETCL_Literal_Constraint ((CORBA::Long) 0);
+ }
+}
+
+TAO_Literal_Type
+TAO_ETCL_Literal_Constraint::widest_type (
+ const TAO_ETCL_Literal_Constraint & rhs
+ )
+{
+ TAO_Literal_Type rhs_type = rhs.expr_type ();
+ TAO_Literal_Type return_value = rhs_type;
+
+ if (rhs_type == TAO_ETCL_COMPONENT)
+ {
+ CORBA::TypeCode_var tc = rhs.op_.any_->type ();
+ rhs_type = this->comparable_type (tc.in ());
+ }
+ else if (rhs_type != this->type_)
+ {
+ if (rhs_type > this->type_)
+ {
+ return_value = rhs_type;
+ }
+ else
+ {
+ return_value = this->type_;
+ }
+ }
+
+ return return_value;
+}
+
+void
+TAO_ETCL_Literal_Constraint::copy (const TAO_ETCL_Literal_Constraint &lit)
+{
+ this->type_ = lit.type_;
+
+ switch (this->type_)
+ {
+ case TAO_ETCL_STRING:
+ this->op_.str_ = CORBA::string_dup (lit.op_.str_);
+ break;
+ case TAO_ETCL_DOUBLE:
+ this->op_.double_ = lit.op_.double_;
+ break;
+ case TAO_ETCL_UNSIGNED:
+ this->op_.uinteger_ = lit.op_.uinteger_;
+ break;
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ this->op_.integer_ = lit.op_.integer_;
+ break;
+ case TAO_ETCL_BOOLEAN:
+ this->op_.bool_ = lit.op_.bool_;
+ break;
+ case TAO_ETCL_COMPONENT:
+ this->op_.any_ = lit.op_.any_;
+ break;
+ default:
+ this->type_ = TAO_UNKNOWN;
+ break;
+ }
+}
+
+// ****************************************************************
+
+int
+TAO_ETCL_Identifier::accept (TAO_ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_identifier (this);
+}
+
+// ****************************************************************
+
+TAO_ETCL_Union_Value::~TAO_ETCL_Union_Value (void)
+{
+ delete this->string_;
+ delete this->integer_;
+}
+
+int
+TAO_ETCL_Union_Value::accept (TAO_ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_union_value (this);
+}
+
+// ****************************************************************
+
+TAO_ETCL_Union_Pos::~TAO_ETCL_Union_Pos (void)
+{
+ delete this->component_;
+ delete this->union_value_;
+}
+
+int
+TAO_ETCL_Union_Pos::accept (TAO_ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_union_pos (this);
+}
+
+// ****************************************************************
+
+TAO_ETCL_Component_Pos::~TAO_ETCL_Component_Pos (void)
+{
+ delete this->component_;
+ delete this->integer_;
+}
+
+int
+TAO_ETCL_Component_Pos::accept (TAO_ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_component_pos (this);
+}
+
+// ****************************************************************
+
+TAO_ETCL_Component_Assoc::~TAO_ETCL_Component_Assoc (void)
+{
+ delete this->component_;
+ delete this->identifier_;
+}
+
+int
+TAO_ETCL_Component_Assoc::accept (TAO_ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_component_assoc (this);
+}
+
+// ****************************************************************
+
+TAO_ETCL_Component_Array::~TAO_ETCL_Component_Array (void)
+{
+ delete this->component_;
+ delete this->integer_;
+}
+
+int
+TAO_ETCL_Component_Array::accept (TAO_ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_component_array (this);
+}
+
+// ****************************************************************
+
+TAO_ETCL_Special::~TAO_ETCL_Special (void)
+{
+}
+
+int
+TAO_ETCL_Special::accept (TAO_ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_special (this);
+}
+
+// ****************************************************************
+
+TAO_ETCL_Component::~TAO_ETCL_Component (void)
+{
+ delete this->component_;
+ delete this->identifier_;
+}
+
+int
+TAO_ETCL_Component::accept (TAO_ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_component (this);
+}
+
+// ****************************************************************
+
+TAO_ETCL_Dot::~TAO_ETCL_Dot (void)
+{
+ delete this->component_;
+}
+
+int
+TAO_ETCL_Dot::accept (TAO_ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_dot (this);
+}
+
+// ****************************************************************
+
+TAO_ETCL_Eval::~TAO_ETCL_Eval (void)
+{
+ delete this->component_;
+}
+
+int
+TAO_ETCL_Eval::accept (TAO_ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_eval (this);
+}
+
+// ****************************************************************
+
+TAO_ETCL_Default::~TAO_ETCL_Default (void)
+{
+ delete this->component_;
+}
+
+int
+TAO_ETCL_Default::accept (TAO_ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_default (this);
+}
+
+// ****************************************************************
+
+TAO_ETCL_Exist::~TAO_ETCL_Exist (void)
+{
+ delete this->component_;
+}
+
+int
+TAO_ETCL_Exist::accept (TAO_ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_exist (this);
+}
+
+// ****************************************************************
+
+TAO_ETCL_Unary_Expr::~TAO_ETCL_Unary_Expr (void)
+{
+ delete this->subexpr_;
+}
+
+int
+TAO_ETCL_Unary_Expr::accept (TAO_ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_unary_expr (this);
+}
+
+// ****************************************************************
+
+TAO_ETCL_Binary_Expr::~TAO_ETCL_Binary_Expr (void)
+{
+ delete this->lhs_;
+ delete this->rhs_;
+}
+
+int
+TAO_ETCL_Binary_Expr::accept (TAO_ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_binary_expr (this);
+}
+
+// ****************************************************************
+
+TAO_ETCL_Preference::~TAO_ETCL_Preference (void)
+{
+ delete this->subexpr_;
+}
+
+int
+TAO_ETCL_Preference::accept (TAO_ETCL_Constraint_Visitor *visitor)
+{
+ return visitor->visit_preference (this);
+}
+
+// ****************************************************************
+
+TAO_ETCL_Constraint_Visitor::~TAO_ETCL_Constraint_Visitor (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.h b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.h
new file mode 100644
index 00000000000..688b2df872c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.h
@@ -0,0 +1,430 @@
+// -*- C++ -*-
+
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs/ETCL
+//
+// = FILENAME
+// ECTL_Constraint
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+// Jeff Parsons (parsons@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef TAO_ETCL_CONSTRAINT_H
+#define TAO_ETCL_CONSTRAINT_H
+
+#include "orbsvcs/ETCL/etcl_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/SString.h"
+
+#include "tao/Basic_Types.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef unsigned short TAO_Literal_Type;
+#define TAO_UNKNOWN 999
+
+class TAO_ETCL_Constraint_Visitor;
+
+namespace CORBA
+{
+ class Any;
+ typedef Any *Any_ptr;
+}
+
+class TAO_ETCL_Export TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Constraint (void);
+ virtual ~TAO_ETCL_Constraint (void);
+ // Constructor and destructor
+
+ virtual int accept (TAO_ETCL_Constraint_Visitor *visitor) = 0;
+};
+
+// ****************************************************************
+
+class TAO_ETCL_Export TAO_ETCL_Literal_Constraint
+ : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Literal_Constraint (void);
+
+ // = Constructors for each of the various types of literals.
+
+ explicit TAO_ETCL_Literal_Constraint (CORBA::Any* any);
+ explicit TAO_ETCL_Literal_Constraint (CORBA::ULong uinteger);
+ explicit TAO_ETCL_Literal_Constraint (CORBA::Long integer);
+ explicit TAO_ETCL_Literal_Constraint (CORBA::Boolean boolean);
+ explicit TAO_ETCL_Literal_Constraint (CORBA::Double doub);
+ explicit TAO_ETCL_Literal_Constraint (const char* str);
+
+ TAO_ETCL_Literal_Constraint (const TAO_ETCL_Literal_Constraint& lit);
+ // Copy constructor
+
+ ~TAO_ETCL_Literal_Constraint(void);
+ // Destructor.
+
+ int accept (TAO_ETCL_Constraint_Visitor* visitor);
+ // Visitor accept method.
+
+ TAO_Literal_Type expr_type (void) const;
+
+ void operator= (const TAO_ETCL_Literal_Constraint& co);
+ // Assignment operator.
+
+ // Conversion routines.
+ operator CORBA::Boolean (void) const;
+ operator CORBA::ULong (void) const;
+ operator CORBA::Long (void) const;
+ operator CORBA::Double (void) const;
+ operator const char* (void) const;
+ operator const CORBA::Any* (void) const;
+
+ // Return the type represented by this MysteryOperand.
+
+ // = Boolean operators.
+
+ bool
+ operator< (const TAO_ETCL_Literal_Constraint& rhs);
+
+ bool
+ operator<= (const TAO_ETCL_Literal_Constraint& rhs);
+
+ bool
+ operator> (const TAO_ETCL_Literal_Constraint& rhs);
+
+ bool
+ operator>= (const TAO_ETCL_Literal_Constraint& rhs);
+
+ bool
+ operator== (const TAO_ETCL_Literal_Constraint& rhs);
+
+ bool
+ operator!= (const TAO_ETCL_Literal_Constraint& rhs);
+
+ // = Arithmetic operators.
+
+ TAO_ETCL_Literal_Constraint
+ operator+ (const TAO_ETCL_Literal_Constraint& rhs);
+
+ TAO_ETCL_Literal_Constraint
+ operator- (const TAO_ETCL_Literal_Constraint& rhs);
+
+ TAO_ETCL_Literal_Constraint
+ operator* (const TAO_ETCL_Literal_Constraint& rhs);
+
+ TAO_ETCL_Literal_Constraint
+ operator/ (const TAO_ETCL_Literal_Constraint& rhs);
+
+ // Unary minus.
+ TAO_ETCL_Literal_Constraint
+ operator- (void);
+
+ TAO_Literal_Type
+ widest_type (const TAO_ETCL_Literal_Constraint& rhs);
+ // Ensure both operands are of the same simple numeric type.
+
+ static TAO_Literal_Type
+ comparable_type (CORBA::TypeCode_ptr type);
+ // Determine the comparable Expression Type from the CORBA type
+
+private:
+ void copy (const TAO_ETCL_Literal_Constraint& co);
+ // Private copy method.
+
+ union
+ {
+ char* str_;
+ CORBA::Any_ptr any_;
+ CORBA::ULong uinteger_;
+ CORBA::Long integer_;
+ CORBA::Boolean bool_;
+ CORBA::Double double_;
+ } op_;
+ // Union of the possible literal types.
+
+ unsigned short type_;
+ // The actual types of the TAO_ETCL_Literal_Constraint.
+};
+
+// ****************************************************************
+
+class TAO_ETCL_Export TAO_ETCL_Identifier : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Identifier (const char *value);
+
+ const char *value (void) const;
+ // Get the value
+
+ // = The Constraint methods.
+ int accept (TAO_ETCL_Constraint_Visitor *visitor);
+
+private:
+ ACE_CString string_;
+ // The value
+};
+
+// ****************************************************************
+
+class TAO_ETCL_Export TAO_ETCL_Union_Value : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Union_Value (int sign,
+ TAO_ETCL_Constraint *integer);
+ TAO_ETCL_Union_Value (TAO_ETCL_Constraint *string);
+ virtual ~TAO_ETCL_Union_Value (void);
+
+ int sign (void) const;
+ TAO_ETCL_Literal_Constraint *integer (void) const;
+ TAO_ETCL_Literal_Constraint *string (void) const;
+
+ // = The Constraint methods.
+ int accept (TAO_ETCL_Constraint_Visitor *visitor);
+
+private:
+ int sign_;
+ TAO_ETCL_Literal_Constraint *integer_;
+ TAO_ETCL_Literal_Constraint *string_;
+};
+
+class TAO_ETCL_Export TAO_ETCL_Union_Pos : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Union_Pos (TAO_ETCL_Constraint *union_value,
+ TAO_ETCL_Constraint *component);
+ virtual ~TAO_ETCL_Union_Pos (void);
+
+ TAO_ETCL_Union_Value *union_value (void) const;
+ TAO_ETCL_Constraint *component (void) const;
+
+ // = The Constraint methods.
+ int accept (TAO_ETCL_Constraint_Visitor *visitor);
+
+private:
+ TAO_ETCL_Union_Value *union_value_;
+ TAO_ETCL_Constraint *component_;
+};
+
+class TAO_ETCL_Export TAO_ETCL_Component_Pos : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Component_Pos (TAO_ETCL_Constraint *integer,
+ TAO_ETCL_Constraint *component);
+ virtual ~TAO_ETCL_Component_Pos (void);
+
+ TAO_ETCL_Literal_Constraint *integer (void) const;
+ TAO_ETCL_Constraint *component (void) const;
+
+ // = The Constraint methods.
+ int accept (TAO_ETCL_Constraint_Visitor *visitor);
+
+private:
+ TAO_ETCL_Literal_Constraint *integer_;
+ TAO_ETCL_Constraint *component_;
+};
+
+class TAO_ETCL_Export TAO_ETCL_Component_Assoc : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Component_Assoc (TAO_ETCL_Constraint *identifier,
+ TAO_ETCL_Constraint *component);
+ virtual ~TAO_ETCL_Component_Assoc (void);
+
+ TAO_ETCL_Identifier *identifier (void) const;
+ TAO_ETCL_Constraint *component (void) const;
+
+ // = The Constraint methods.
+ int accept (TAO_ETCL_Constraint_Visitor *visitor);
+
+private:
+ TAO_ETCL_Identifier *identifier_;
+ TAO_ETCL_Constraint *component_;
+};
+
+class TAO_ETCL_Export TAO_ETCL_Component_Array : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Component_Array (TAO_ETCL_Constraint *integer,
+ TAO_ETCL_Constraint *component);
+ virtual ~TAO_ETCL_Component_Array (void);
+
+ TAO_ETCL_Literal_Constraint *integer (void) const;
+ TAO_ETCL_Constraint *component (void) const;
+
+ // = The Constraint methods.
+ int accept (TAO_ETCL_Constraint_Visitor *visitor);
+
+private:
+ TAO_ETCL_Literal_Constraint *integer_;
+ TAO_ETCL_Constraint *component_;
+};
+
+class TAO_ETCL_Export TAO_ETCL_Special : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Special (int type);
+ virtual ~TAO_ETCL_Special (void);
+
+ int type (void) const;
+
+ // = The Constraint methods.
+ int accept (TAO_ETCL_Constraint_Visitor *visitor);
+
+private:
+ int type_;
+};
+
+class TAO_ETCL_Export TAO_ETCL_Component : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Component (TAO_ETCL_Constraint *identifier,
+ TAO_ETCL_Constraint *component);
+ virtual ~TAO_ETCL_Component (void);
+
+ TAO_ETCL_Identifier *identifier (void) const;
+ TAO_ETCL_Constraint *component (void) const;
+
+ // = The Constraint methods.
+ int accept (TAO_ETCL_Constraint_Visitor *visitor);
+
+private:
+ TAO_ETCL_Identifier *identifier_;
+ TAO_ETCL_Constraint *component_;
+};
+
+class TAO_ETCL_Export TAO_ETCL_Dot : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Dot (TAO_ETCL_Constraint *component);
+ virtual ~TAO_ETCL_Dot (void);
+
+ TAO_ETCL_Constraint *component (void) const;
+
+ // = The Constraint methods.
+ int accept (TAO_ETCL_Constraint_Visitor *visitor);
+
+private:
+ TAO_ETCL_Constraint *component_;
+};
+
+class TAO_ETCL_Export TAO_ETCL_Eval : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Eval (TAO_ETCL_Constraint *component);
+ virtual ~TAO_ETCL_Eval (void);
+
+ TAO_ETCL_Constraint *component (void) const;
+
+ // = The Constraint methods.
+ int accept (TAO_ETCL_Constraint_Visitor *visitor);
+
+private:
+ TAO_ETCL_Constraint *component_;
+};
+
+class TAO_ETCL_Export TAO_ETCL_Default : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Default (TAO_ETCL_Constraint *component);
+ virtual ~TAO_ETCL_Default (void);
+
+ TAO_ETCL_Constraint *component (void) const;
+
+ // = The Constraint methods.
+ int accept (TAO_ETCL_Constraint_Visitor *visitor);
+
+private:
+ TAO_ETCL_Constraint *component_;
+};
+
+class TAO_ETCL_Export TAO_ETCL_Exist : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Exist (TAO_ETCL_Constraint *component);
+ virtual ~TAO_ETCL_Exist (void);
+
+ TAO_ETCL_Constraint *component (void) const;
+
+ // = The Constraint methods.
+ int accept (TAO_ETCL_Constraint_Visitor *visitor);
+
+private:
+ TAO_ETCL_Constraint *component_;
+};
+
+class TAO_ETCL_Export TAO_ETCL_Unary_Expr : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Unary_Expr (int type,
+ TAO_ETCL_Constraint *subexpr);
+ virtual ~TAO_ETCL_Unary_Expr (void);
+
+ int type (void) const;
+ TAO_ETCL_Constraint *subexpr (void) const;
+
+ // = The Constraint methods.
+ int accept (TAO_ETCL_Constraint_Visitor *visitor);
+
+private:
+ int type_;
+ TAO_ETCL_Constraint *subexpr_;
+};
+
+class TAO_ETCL_Export TAO_ETCL_Binary_Expr : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Binary_Expr (int type,
+ TAO_ETCL_Constraint *lhs,
+ TAO_ETCL_Constraint *rhs);
+ virtual ~TAO_ETCL_Binary_Expr (void);
+
+ int type (void) const;
+ TAO_ETCL_Constraint *rhs (void) const;
+ TAO_ETCL_Constraint *lhs (void) const;
+
+ // = The Constraint methods.
+ int accept (TAO_ETCL_Constraint_Visitor *visitor);
+
+private:
+ int type_;
+ TAO_ETCL_Constraint *lhs_;
+ TAO_ETCL_Constraint *rhs_;
+};
+
+class TAO_ETCL_Export TAO_ETCL_Preference : public TAO_ETCL_Constraint
+{
+public:
+ TAO_ETCL_Preference (int type,
+ TAO_ETCL_Constraint *subexpr = 0);
+ virtual ~TAO_ETCL_Preference (void);
+
+ int type (void) const;
+ TAO_ETCL_Constraint *subexpr (void) const;
+
+ // = The Constraint methods.
+ int accept (TAO_ETCL_Constraint_Visitor *visitor);
+
+private:
+ int type_;
+ TAO_ETCL_Constraint *subexpr_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/ETCL/ETCL_Constraint.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_ETCL_CONSTRAINT_H */
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.inl b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.inl
new file mode 100644
index 00000000000..d6414ef5131
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint.inl
@@ -0,0 +1,330 @@
+// -*- C++ -*-
+// $Id$
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Literal_Constraint::TAO_ETCL_Literal_Constraint (void)
+ : type_ (TAO_UNKNOWN)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Identifier::TAO_ETCL_Identifier (const char *value)
+ : string_ (value)
+{
+}
+
+ACE_INLINE const char *
+TAO_ETCL_Identifier::value (void) const
+{
+ return this->string_.c_str ();
+}
+
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Union_Value::TAO_ETCL_Union_Value (int sign,
+ TAO_ETCL_Constraint *integer)
+ : sign_ (sign),
+ string_ (0)
+{
+ this->integer_ =
+ dynamic_cast<TAO_ETCL_Literal_Constraint*> (integer);
+}
+
+ACE_INLINE
+TAO_ETCL_Union_Value::TAO_ETCL_Union_Value (TAO_ETCL_Constraint *string)
+ : sign_ (0),
+ integer_ (0)
+{
+ this->string_ =
+ dynamic_cast<TAO_ETCL_Literal_Constraint*> (string);
+}
+
+ACE_INLINE int
+TAO_ETCL_Union_Value::sign (void) const
+{
+ return this->sign_;
+}
+
+ACE_INLINE TAO_ETCL_Literal_Constraint *
+TAO_ETCL_Union_Value::integer (void) const
+{
+ return this->integer_;
+}
+
+ACE_INLINE TAO_ETCL_Literal_Constraint *
+TAO_ETCL_Union_Value::string (void) const
+{
+ return this->string_;
+}
+
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Union_Pos::TAO_ETCL_Union_Pos (TAO_ETCL_Constraint *union_value,
+ TAO_ETCL_Constraint *component)
+ : component_ (component)
+{
+ this->union_value_ =
+ dynamic_cast<TAO_ETCL_Union_Value*> (union_value);
+}
+
+ACE_INLINE TAO_ETCL_Union_Value *
+TAO_ETCL_Union_Pos::union_value (void) const
+{
+ return this->union_value_;
+}
+
+ACE_INLINE TAO_ETCL_Constraint *
+TAO_ETCL_Union_Pos::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Component_Pos::TAO_ETCL_Component_Pos (
+ TAO_ETCL_Constraint *integer,
+ TAO_ETCL_Constraint *component
+ )
+ : component_ (component)
+{
+ this->integer_ =
+ dynamic_cast<TAO_ETCL_Literal_Constraint*> (integer);
+}
+
+ACE_INLINE TAO_ETCL_Literal_Constraint *
+TAO_ETCL_Component_Pos::integer (void) const
+{
+ return this->integer_;
+}
+
+ACE_INLINE TAO_ETCL_Constraint *
+TAO_ETCL_Component_Pos::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Component_Assoc::TAO_ETCL_Component_Assoc (
+ TAO_ETCL_Constraint *identifier,
+ TAO_ETCL_Constraint *component
+ )
+ : component_ (component)
+{
+ this->identifier_ =
+ dynamic_cast<TAO_ETCL_Identifier*> (identifier);
+}
+
+ACE_INLINE TAO_ETCL_Identifier *
+TAO_ETCL_Component_Assoc::identifier (void) const
+{
+ return this->identifier_;
+}
+
+ACE_INLINE TAO_ETCL_Constraint *
+TAO_ETCL_Component_Assoc::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Component_Array::TAO_ETCL_Component_Array (
+ TAO_ETCL_Constraint *integer,
+ TAO_ETCL_Constraint *component
+ )
+ : component_ (component)
+{
+ this->integer_ =
+ dynamic_cast<TAO_ETCL_Literal_Constraint*> (integer);
+}
+
+ACE_INLINE TAO_ETCL_Literal_Constraint *
+TAO_ETCL_Component_Array::integer (void) const
+{
+ return this->integer_;
+}
+
+ACE_INLINE TAO_ETCL_Constraint *
+TAO_ETCL_Component_Array::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Special::TAO_ETCL_Special (int type)
+ : type_ (type)
+{
+}
+
+ACE_INLINE int
+TAO_ETCL_Special::type (void) const
+{
+ return this->type_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Component::TAO_ETCL_Component (TAO_ETCL_Constraint *identifier,
+ TAO_ETCL_Constraint *component)
+ : component_ (component)
+{
+ this->identifier_ =
+ dynamic_cast<TAO_ETCL_Identifier*> (identifier);
+}
+
+ACE_INLINE TAO_ETCL_Identifier *
+TAO_ETCL_Component::identifier (void) const
+{
+ return this->identifier_;
+}
+
+ACE_INLINE TAO_ETCL_Constraint *
+TAO_ETCL_Component::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Dot::TAO_ETCL_Dot (TAO_ETCL_Constraint *component)
+ : component_ (component)
+{
+}
+
+ACE_INLINE TAO_ETCL_Constraint *
+TAO_ETCL_Dot::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Eval::TAO_ETCL_Eval (TAO_ETCL_Constraint *component)
+ : component_ (component)
+{
+}
+
+ACE_INLINE TAO_ETCL_Constraint *
+TAO_ETCL_Eval::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Default::TAO_ETCL_Default (TAO_ETCL_Constraint *component)
+ : component_ (component)
+{
+}
+
+ACE_INLINE TAO_ETCL_Constraint *
+TAO_ETCL_Default::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Exist::TAO_ETCL_Exist (TAO_ETCL_Constraint *component)
+ : component_ (component)
+{
+}
+
+ACE_INLINE TAO_ETCL_Constraint *
+TAO_ETCL_Exist::component (void) const
+{
+ return this->component_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Unary_Expr::TAO_ETCL_Unary_Expr (int type,
+ TAO_ETCL_Constraint *subexpr)
+ : type_ (type),
+ subexpr_ (subexpr)
+{
+}
+
+ACE_INLINE int
+TAO_ETCL_Unary_Expr::type (void) const
+{
+ return this->type_;
+}
+
+ACE_INLINE TAO_ETCL_Constraint *
+TAO_ETCL_Unary_Expr::subexpr (void) const
+{
+ return this->subexpr_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Binary_Expr::TAO_ETCL_Binary_Expr (int type,
+ TAO_ETCL_Constraint *lhs,
+ TAO_ETCL_Constraint *rhs)
+ : type_ (type),
+ lhs_ (lhs),
+ rhs_ (rhs)
+{
+}
+
+ACE_INLINE int
+TAO_ETCL_Binary_Expr::type (void) const
+{
+ return this->type_;
+}
+
+ACE_INLINE TAO_ETCL_Constraint *
+TAO_ETCL_Binary_Expr::rhs (void) const
+{
+ return this->rhs_;
+}
+
+ACE_INLINE TAO_ETCL_Constraint *
+TAO_ETCL_Binary_Expr::lhs (void) const
+{
+ return this->lhs_;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ETCL_Preference::TAO_ETCL_Preference (int type,
+ TAO_ETCL_Constraint *subexpr)
+ : type_ (type),
+ subexpr_ (subexpr)
+{
+}
+
+ACE_INLINE int
+TAO_ETCL_Preference::type (void) const
+{
+ return this->type_;
+}
+
+ACE_INLINE TAO_ETCL_Constraint *
+TAO_ETCL_Preference::subexpr (void) const
+{
+ return this->subexpr_;
+}
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint_Visitor.h b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint_Visitor.h
new file mode 100644
index 00000000000..0f23f7a02c0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Constraint_Visitor.h
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file ETCL_Constraint_Visitor.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@cs.wustl.edu>
+ * @author Jeff Parsons <parsons@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_ETCL_CONSTRAINT_VISITOR_H
+#define TAO_ETCL_CONSTRAINT_VISITOR_H
+
+#include "orbsvcs/ETCL/etcl_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ETCL_Literal_Constraint;
+class TAO_ETCL_Identifier;
+class TAO_ETCL_Union_Value;
+class TAO_ETCL_Union_Pos;
+class TAO_ETCL_Component_Pos;
+class TAO_ETCL_Component_Assoc;
+class TAO_ETCL_Component_Array;
+class TAO_ETCL_Special;
+class TAO_ETCL_Component;
+class TAO_ETCL_Dot;
+class TAO_ETCL_Eval;
+class TAO_ETCL_Default;
+class TAO_ETCL_Exist;
+class TAO_ETCL_Unary_Expr;
+class TAO_ETCL_Binary_Expr;
+class TAO_ETCL_Preference;
+
+class TAO_ETCL_Export TAO_ETCL_Constraint_Visitor
+{
+public:
+ /// Destructor
+ virtual ~TAO_ETCL_Constraint_Visitor (void);
+
+ virtual int visit_literal (TAO_ETCL_Literal_Constraint *) = 0;
+ virtual int visit_identifier (TAO_ETCL_Identifier *) = 0;
+ virtual int visit_union_value (TAO_ETCL_Union_Value *) = 0;
+ virtual int visit_union_pos (TAO_ETCL_Union_Pos *) = 0;
+ virtual int visit_component_pos (TAO_ETCL_Component_Pos *) = 0;
+ virtual int visit_component_assoc (TAO_ETCL_Component_Assoc *) = 0;
+ virtual int visit_component_array (TAO_ETCL_Component_Array *) = 0;
+ virtual int visit_special (TAO_ETCL_Special *) = 0;
+ virtual int visit_component (TAO_ETCL_Component *) = 0;
+ virtual int visit_dot (TAO_ETCL_Dot *) = 0;
+ virtual int visit_eval (TAO_ETCL_Eval *) = 0;
+ virtual int visit_default (TAO_ETCL_Default *) = 0;
+ virtual int visit_exist (TAO_ETCL_Exist *) = 0;
+ virtual int visit_unary_expr (TAO_ETCL_Unary_Expr *) = 0;
+ virtual int visit_binary_expr (TAO_ETCL_Binary_Expr *) = 0;
+ virtual int visit_preference (TAO_ETCL_Preference *) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_ETCL_CONSTRAINT_VISITOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Interpreter.cpp b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Interpreter.cpp
new file mode 100644
index 00000000000..2f083900155
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Interpreter.cpp
@@ -0,0 +1,112 @@
+// -*- C++ -*-
+// $Id$
+
+#include "orbsvcs/ETCL/ETCL_Interpreter.h"
+#include "orbsvcs/ETCL/ETCL_Constraint.h"
+#include "ace/Guard_T.h"
+#include "ace/Thread_Mutex.h"
+
+ACE_RCSID(ETCL, ETCL_Interpreter, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_SYNCH_MUTEX TAO_ETCL_Interpreter::parserMutex__;
+
+TAO_ETCL_Interpreter::TAO_ETCL_Interpreter (void)
+ : root_ (0)
+{
+}
+
+TAO_ETCL_Interpreter::~TAO_ETCL_Interpreter (void)
+{
+ delete this->root_;
+}
+
+int
+TAO_ETCL_Interpreter::build_tree (const char* constraints)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ TAO_ETCL_Interpreter::parserMutex__,
+ -1);
+
+ TAO_Lex_String_Input::reset ((char*)constraints);
+
+ yyval.constraint = 0;
+ int return_value = ::yyparse ();
+
+ if (return_value == 0 && yyval.constraint != 0)
+ {
+ this->root_ = yyval.constraint;
+ }
+ else
+ {
+ this->root_ = 0;
+ }
+
+ return return_value;
+}
+
+int
+TAO_ETCL_Interpreter::is_empty_string (const char* str)
+{
+ int return_value = 0;
+
+ if (str != 0)
+ {
+ int i = 0;
+
+ while (str[i] != '\0')
+ {
+ if (str[i] != ' ')
+ {
+ break;
+ }
+
+ i++;
+ }
+
+ if (str[i] == '\0')
+ {
+ return_value = 1;
+ }
+ }
+
+ return return_value;
+}
+
+char* TAO_Lex_String_Input::string_ = 0;
+char* TAO_Lex_String_Input::current_ = 0;
+char* TAO_Lex_String_Input::end_ = 0;
+
+// Routine to have Lex read its input from the constraint string.
+
+int
+TAO_Lex_String_Input::copy_into (char* buf,
+ int max_size)
+{
+ int chars_left = TAO_Lex_String_Input::end_ - TAO_Lex_String_Input::current_;
+ int n = max_size > chars_left ? chars_left : max_size;
+
+ if (n > 0)
+ {
+ ACE_OS:: memcpy (buf,
+ TAO_Lex_String_Input::current_,
+ n);
+ TAO_Lex_String_Input::current_ += n;
+ }
+
+ return n;
+}
+
+void
+TAO_Lex_String_Input::reset (char* input_string)
+{
+ TAO_Lex_String_Input::string_ = input_string;
+ TAO_Lex_String_Input::current_ = input_string;
+ TAO_Lex_String_Input::end_ =
+ input_string + ACE_OS::strlen (TAO_Lex_String_Input::string_);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Interpreter.h b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Interpreter.h
new file mode 100644
index 00000000000..81210143c38
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_Interpreter.h
@@ -0,0 +1,110 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file ETCL_Interpreter.h
+ *
+ * $Id$
+ *
+ * @author Jeff Parsons <parsons@cs.wustl.edu> based on previous work by
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_ETCL_INTERPRETER_H
+#define TAO_ETCL_INTERPRETER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/ETCL/etcl_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/orbconf.h"
+#include "ace/Thread_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ETCL_Constraint;
+
+/**
+ * @class TAO_ETCL_Interpreter
+ *
+ * @brief TAO_ETCL_Interpreter is the superclass for all ETCL interpreters.
+ * Its build tree method invokes the yacc parser to parse a constraint
+ * or preference string.
+ */
+class TAO_ETCL_Export TAO_ETCL_Interpreter
+{
+protected:
+ // = Initialization and termination methods.
+ /// Constructor.
+ TAO_ETCL_Interpreter (void);
+
+ /// Destructor.
+ ~TAO_ETCL_Interpreter (void);
+
+ /// Using the Yacc generated parser, construct an expression tree
+ /// representing <constraints> from the tokens returned by it.
+ int build_tree (const char* constraints);
+
+ static int is_empty_string (const char* str);
+
+ /// The root of the expression tree, not equal to null if build_tree
+ /// successfully builds a tree from the constraints.
+ TAO_ETCL_Constraint* root_;
+private:
+ /// This mutex protects the <build_tree> method from reentrance.
+ static TAO_SYNCH_MUTEX parserMutex__;
+};
+
+
+// Functions we need for parsing.
+extern int yyparse (void);
+extern void yyrestart (FILE*);
+extern int yylex (void);
+
+// Have yylex read from the constraint string, not from stdin.
+#undef YY_INPUT
+#define YY_INPUT(b, r, ms) (r = TAO_Lex_String_Input::copy_into(b, ms))
+
+/**
+ * @class TAO_Lex_String_Input
+ *
+ * @brief Have Lex read from a string and not from stdin. Essentially,
+ * the interpreter needs to call yylex() until EOF, and call
+ * TAO_Lex_String_Input::reset() with the new string, prior to
+ * calling yyparse.
+ */
+class TAO_Lex_String_Input
+{
+public:
+ /// Reset the lex input.
+ static void reset (char* input_string);
+
+ /// Method lex will call to read from the input string.
+ static int copy_into (char* buf, int max_size);
+
+private:
+
+ /// Pointers to keep track of the input string.
+ static char* string_;
+ static char* current_;
+ static char* end_;
+};
+
+/// The union used by lex and bison to build the Abstract Syntax Tree.
+typedef union
+{
+ TAO_ETCL_Constraint* constraint;
+} YYSTYPE;
+
+extern YYSTYPE yylval;
+extern YYSTYPE yyval;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_ETCL_INTERPRETER_H */
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL_l.cpp b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_l.cpp
new file mode 100644
index 00000000000..1d5fbb80ccb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_l.cpp
@@ -0,0 +1,1884 @@
+
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * $Id$
+ */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include "tao/orbconf.h"
+#include "ace/OS.h"
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define 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 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 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 YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+extern FILE *yyin, *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 )
+ * 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 yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ *yy_cp = yy_hold_char; \
+ YY_RESTORE_YY_MORE_OFFSET \
+ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, 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 yy_size_t;
+
+
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int 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 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 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 yy_at_bol;
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as 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 yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+ };
+
+static YY_BUFFER_STATE 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 YY_CURRENT_BUFFER yy_current_buffer
+
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin. A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_is_interactive = is_interactive; \
+ }
+
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_at_bol = at_bol; \
+ }
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+
+//#define yywrap() 1
+//#define YY_SKIP_YYWRAP
+typedef unsigned char YY_CHAR;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+typedef int yy_state_type;
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+ yytext_ptr = yy_bp; \
+ yyleng = (int) (yy_cp - yy_bp); \
+ yy_hold_char = *yy_cp; \
+ *yy_cp = '\0'; \
+ yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 41
+#define YY_END_OF_BUFFER 42
+static yyconst short int yy_accept[118] =
+ { 0,
+ 0, 0, 42, 40, 39, 41, 40, 24, 40, 22,
+ 23, 14, 12, 13, 25, 15, 35, 16, 40, 18,
+ 38, 38, 38, 31, 40, 32, 40, 38, 38, 38,
+ 38, 38, 38, 38, 38, 38, 38, 11, 21, 0,
+ 37, 0, 36, 0, 35, 17, 20, 19, 38, 38,
+ 38, 38, 27, 0, 0, 0, 38, 38, 38, 38,
+ 10, 38, 38, 38, 9, 38, 38, 0, 0, 38,
+ 38, 38, 0, 0, 0, 8, 38, 38, 38, 2,
+ 1, 7, 38, 38, 0, 36, 38, 33, 0, 0,
+ 0, 38, 38, 38, 38, 5, 34, 0, 0, 0,
+
+ 38, 6, 3, 38, 0, 0, 0, 38, 4, 30,
+ 0, 0, 26, 0, 28, 29, 0
+ } ;
+
+static yyconst int yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 4, 1, 1, 5, 1, 1, 6, 7,
+ 8, 9, 10, 1, 11, 12, 13, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 1, 1, 15,
+ 16, 17, 1, 1, 18, 19, 19, 19, 20, 21,
+ 19, 19, 19, 19, 19, 22, 19, 19, 19, 19,
+ 19, 23, 24, 25, 26, 19, 19, 19, 19, 19,
+ 27, 28, 29, 1, 30, 1, 31, 19, 19, 32,
+
+ 33, 34, 35, 36, 37, 19, 19, 38, 39, 40,
+ 41, 42, 19, 43, 44, 45, 46, 19, 47, 48,
+ 49, 19, 1, 1, 1, 50, 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 yyconst int yy_meta[51] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 2, 1, 1, 1, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 1, 1, 1, 2,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 1
+ } ;
+
+static yyconst short int yy_base[122] =
+ { 0,
+ 0, 0, 146, 147, 147, 147, 129, 147, 45, 147,
+ 147, 147, 147, 147, 130, 147, 40, 127, 126, 125,
+ 0, 122, 116, 147, 0, 147, 21, 98, 104, 88,
+ 98, 94, 24, 92, 89, 100, 93, 147, 147, 50,
+ 147, 51, 48, 115, 46, 147, 147, 147, 0, 106,
+ 101, 0, 147, 93, 92, 75, 91, 88, 84, 77,
+ 0, 71, 78, 72, 0, 76, 70, 57, 60, 90,
+ 93, 0, 72, 69, 68, 0, 78, 64, 63, 0,
+ 0, 0, 74, 69, 90, 89, 82, 0, 66, 59,
+ 66, 52, 52, 51, 54, 0, 0, 49, 49, 54,
+
+ 45, 0, 0, 43, 44, 47, 39, 30, 0, 147,
+ 35, 37, 0, 35, 147, 147, 147, 85, 87, 62,
+ 89
+ } ;
+
+static yyconst short int yy_def[122] =
+ { 0,
+ 117, 1, 117, 117, 117, 117, 117, 117, 118, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 119, 119, 119, 117, 120, 117, 117, 119, 119, 119,
+ 119, 119, 119, 119, 119, 119, 119, 117, 117, 118,
+ 117, 117, 117, 117, 117, 117, 117, 117, 119, 119,
+ 119, 121, 117, 117, 117, 117, 119, 119, 119, 119,
+ 119, 119, 119, 119, 119, 119, 119, 118, 117, 119,
+ 119, 121, 117, 117, 117, 119, 119, 119, 119, 119,
+ 119, 119, 119, 119, 117, 117, 119, 119, 117, 117,
+ 117, 119, 119, 119, 119, 119, 119, 117, 117, 117,
+
+ 119, 119, 119, 119, 117, 117, 117, 119, 119, 117,
+ 117, 117, 119, 117, 117, 117, 0, 117, 117, 117,
+ 117
+ } ;
+
+static yyconst short int yy_nxt[198] =
+ { 0,
+ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+ 14, 15, 16, 17, 18, 19, 20, 21, 21, 21,
+ 22, 21, 21, 21, 23, 21, 24, 25, 26, 27,
+ 28, 29, 30, 31, 21, 21, 32, 21, 33, 34,
+ 35, 21, 36, 21, 21, 21, 37, 21, 21, 38,
+ 41, 44, 53, 45, 62, 41, 68, 44, 54, 45,
+ 63, 43, 41, 55, 52, 56, 116, 69, 115, 85,
+ 85, 114, 42, 86, 113, 112, 111, 42, 68, 110,
+ 69, 109, 108, 107, 42, 40, 40, 40, 49, 49,
+ 72, 72, 106, 105, 104, 103, 102, 101, 100, 99,
+
+ 98, 97, 86, 86, 96, 95, 94, 93, 92, 91,
+ 90, 89, 88, 87, 84, 83, 82, 81, 80, 79,
+ 78, 77, 76, 75, 74, 73, 71, 70, 43, 67,
+ 66, 65, 64, 61, 60, 59, 58, 57, 51, 50,
+ 48, 47, 46, 43, 39, 117, 3, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117
+
+ } ;
+
+static yyconst short int yy_chk[198] =
+ { 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,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 9, 17, 27, 17, 33, 40, 42, 45, 27, 45,
+ 33, 43, 68, 27, 120, 27, 114, 43, 112, 69,
+ 69, 111, 9, 69, 108, 107, 106, 40, 42, 105,
+ 43, 104, 101, 100, 68, 118, 118, 118, 119, 119,
+ 121, 121, 99, 98, 95, 94, 93, 92, 91, 90,
+
+ 89, 87, 86, 85, 84, 83, 79, 78, 77, 75,
+ 74, 73, 71, 70, 67, 66, 64, 63, 62, 60,
+ 59, 58, 57, 56, 55, 54, 51, 50, 44, 37,
+ 36, 35, 34, 32, 31, 30, 29, 28, 23, 22,
+ 20, 19, 18, 15, 7, 3, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117
+
+ } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *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 yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+//#line 1 "ETCL/ETCL.ll"
+#define INITIAL 0
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+//#line 4 "ETCL/ETCL.ll"
+// $Id$
+// ========================================================================
+//
+// = LIBRARY
+// orbsvcs/ECTL
+//
+// = FILENAME
+// ETCL.ll
+//
+// = AUTHOR
+// Carlos O'Ryan <coryan@uci.edu> based on previous work by
+// Seth Widoff <sbw1@cs.wustl.edu>
+//
+// ========================================================================
+
+#include "orbsvcs/ETCL/ETCL_Interpreter.h"
+#include "orbsvcs/ETCL/ETCL_Constraint.h"
+#include "orbsvcs/ETCL/ETCL_y.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+static const char* extract_string(char*);
+//static const char * extract_string(char*);
+
+#define TAO_YY_LEX_DEBUG
+
+#ifdef TAO_CONSTRAINT_DEBUG
+#define TAO_YY_LEX_DEBUG ACE_OS::fprintf(stderr, "%s\n", yytext)
+#endif /* TAO_CONSTRAINT_DEBUG */
+
+//#define YY_DECL int TAO_ETCL_yylex (TAO_ETCL_YYSTYPE *lvalp, void* state)
+
+#define YY_BREAK
+#define YY_NO_UNPUT
+
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#ifdef YY_MALLOC_DECL
+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 YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef TAO_ETCL_ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define TAO_ETCL_ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ if ( yy_current_buffer->yy_is_interactive ) \
+ { \
+ int c = '*', n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
+ && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" );
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+ YY_USER_ACTION
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+YY_DECL
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp = 0;
+ register char *yy_bp = 0;
+ register int yy_act;
+
+//#line 50 "ETCL/ETCL.ll"
+
+ if ( yy_init )
+ {
+ yy_init = 0;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! yy_start )
+ yy_start = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+
+ if ( ! yyout )
+ yyout = stdout;
+
+ if ( ! yy_current_buffer )
+ yy_current_buffer =
+ yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_load_buffer_state();
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = yy_c_buf_p;
+
+ /* Support of yytext. */
+ *yy_cp = yy_hold_char;
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = yy_start;
+yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 118 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ ++yy_cp;
+ }
+ while ( yy_base[yy_current_state] != 147 );
+
+yy_find_action:
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+
+do_action: /* This label is used only to access EOF actions. */
+
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = yy_hold_char;
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
+ goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+//#line 52 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_MIN; }
+ YY_BREAK
+case 2:
+YY_RULE_SETUP
+//#line 53 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_MAX; }
+ YY_BREAK
+case 3:
+YY_RULE_SETUP
+//#line 54 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_FIRST; }
+ YY_BREAK
+case 4:
+YY_RULE_SETUP
+//#line 55 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_RANDOM; }
+ YY_BREAK
+case 5:
+YY_RULE_SETUP
+//#line 56 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_WITH; }
+ YY_BREAK
+case 6:
+YY_RULE_SETUP
+//#line 57 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_EXIST; }
+ YY_BREAK
+case 7:
+YY_RULE_SETUP
+//#line 58 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_NOT; }
+ YY_BREAK
+case 8:
+YY_RULE_SETUP
+//#line 59 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_AND; }
+ YY_BREAK
+case 9:
+YY_RULE_SETUP
+//#line 60 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_OR; }
+ YY_BREAK
+case 10:
+YY_RULE_SETUP
+//#line 61 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_IN; }
+ YY_BREAK
+case 11:
+YY_RULE_SETUP
+//#line 62 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_TWIDDLE; }
+ YY_BREAK
+case 12:
+YY_RULE_SETUP
+//#line 63 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_PLUS; }
+ YY_BREAK
+case 13:
+YY_RULE_SETUP
+//#line 64 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_MINUS; }
+ YY_BREAK
+case 14:
+YY_RULE_SETUP
+//#line 65 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_MULT; }
+ YY_BREAK
+case 15:
+YY_RULE_SETUP
+//#line 66 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_DIV; }
+ YY_BREAK
+case 16:
+YY_RULE_SETUP
+//#line 67 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_LT; }
+ YY_BREAK
+case 17:
+YY_RULE_SETUP
+//#line 68 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_LE; }
+ YY_BREAK
+case 18:
+YY_RULE_SETUP
+//#line 69 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_GT; }
+ YY_BREAK
+case 19:
+YY_RULE_SETUP
+//#line 70 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_GE; }
+ YY_BREAK
+case 20:
+YY_RULE_SETUP
+//#line 71 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_EQ; }
+ YY_BREAK
+case 21:
+YY_RULE_SETUP
+//#line 72 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_NE; }
+ YY_BREAK
+case 22:
+YY_RULE_SETUP
+//#line 73 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_LPAREN; }
+ YY_BREAK
+case 23:
+YY_RULE_SETUP
+//#line 74 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_RPAREN; }
+ YY_BREAK
+case 24:
+YY_RULE_SETUP
+//#line 75 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_DOLLAR; }
+ YY_BREAK
+case 25:
+YY_RULE_SETUP
+//#line 76 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_DOT; }
+ YY_BREAK
+case 26:
+YY_RULE_SETUP
+//#line 77 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_DEFAULT; }
+ YY_BREAK
+case 27:
+YY_RULE_SETUP
+//#line 78 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_DISCRIMINANT; }
+ YY_BREAK
+case 28:
+YY_RULE_SETUP
+//#line 79 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_TYPE_ID; }
+ YY_BREAK
+case 29:
+YY_RULE_SETUP
+//#line 80 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_REPOS_ID; }
+ YY_BREAK
+case 30:
+YY_RULE_SETUP
+//#line 81 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_LENGTH; }
+ YY_BREAK
+case 31:
+YY_RULE_SETUP
+//#line 82 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_LBRA; }
+ YY_BREAK
+case 32:
+YY_RULE_SETUP
+//#line 83 "ETCL/ETCL.ll"
+{ TAO_YY_LEX_DEBUG; return TAO_ETCL_RBRA; }
+ YY_BREAK
+case 33:
+YY_RULE_SETUP
+//#line 84 "ETCL/ETCL.ll"
+{
+ yylval.constraint =
+ new TAO_ETCL_Literal_Constraint ((CORBA::Boolean) 1);
+ TAO_YY_LEX_DEBUG; return TAO_ETCL_BOOLEAN;
+ }
+ YY_BREAK
+case 34:
+YY_RULE_SETUP
+//#line 89 "ETCL/ETCL.ll"
+{
+ yylval.constraint =
+ new TAO_ETCL_Literal_Constraint ((CORBA::Boolean) 0);
+ TAO_YY_LEX_DEBUG; return TAO_ETCL_BOOLEAN;
+ }
+ YY_BREAK
+case 35:
+YY_RULE_SETUP
+//#line 94 "ETCL/ETCL.ll"
+{
+ yylval.constraint =
+ new TAO_ETCL_Literal_Constraint (ACE_OS::atoi (yytext));
+ TAO_YY_LEX_DEBUG; return TAO_ETCL_INTEGER;
+ }
+ YY_BREAK
+case 36:
+YY_RULE_SETUP
+//#line 99 "ETCL/ETCL.ll"
+{
+ double v;
+ sscanf (yytext, "%lf", &v);
+ yylval.constraint =
+ new TAO_ETCL_Literal_Constraint (v);
+ TAO_YY_LEX_DEBUG; return TAO_ETCL_FLOAT;
+ }
+ YY_BREAK
+case 37:
+YY_RULE_SETUP
+//#line 106 "ETCL/ETCL.ll"
+{
+ yylval.constraint =
+ new TAO_ETCL_Literal_Constraint (extract_string(yytext));
+ TAO_YY_LEX_DEBUG; return TAO_ETCL_STRING;
+ }
+ YY_BREAK
+case 38:
+YY_RULE_SETUP
+//#line 111 "ETCL/ETCL.ll"
+{
+ yylval.constraint =
+ new TAO_ETCL_Identifier (yytext);
+ TAO_YY_LEX_DEBUG; return TAO_ETCL_IDENT;
+ }
+ YY_BREAK
+case 39:
+YY_RULE_SETUP
+//#line 116 "ETCL/ETCL.ll"
+{
+ TAO_YY_LEX_DEBUG; break; // Ignore
+ }
+ YY_BREAK
+case 40:
+YY_RULE_SETUP
+//#line 119 "ETCL/ETCL.ll"
+{
+ TAO_YY_LEX_DEBUG; break; // @@ TODO
+ }
+ YY_BREAK
+case 41:
+YY_RULE_SETUP
+//#line 122 "ETCL/ETCL.ll"
+TAO_ETCL_ECHO;
+ YY_BREAK
+case YY_STATE_EOF(INITIAL):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = yy_hold_char;
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
+ * consistency between 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.
+ */
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yy_current_buffer->yy_input_file = yyin;
+ yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since 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 ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * 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).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++yy_c_buf_p;
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = yy_c_buf_p;
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ yy_did_buffer_switch_on_eof = 0;
+
+ if ( yywrap() )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p =
+ yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ yy_c_buf_p =
+ &yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+ } /* end of yylex */
+
+
+/* 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 yy_get_next_buffer()
+ {
+ register char *dest = yy_current_buffer->yy_ch_buf;
+ register char *source = yytext_ptr;
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( yy_current_buffer->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( yy_c_buf_p - yytext_ptr - 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) (yy_c_buf_p - yytext_ptr) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+
+ else
+ {
+ int num_to_read =
+ yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+ YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = yy_current_buffer;
+
+ int yy_c_buf_p_offset =
+ (int) (yy_c_buf_p - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yy_flex_realloc( (void *) b->yy_ch_buf,
+ b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = yy_current_buffer->yy_buf_size -
+ number_to_move - 1;
+#endif
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+ yy_n_chars, num_to_read );
+
+ yy_current_buffer->yy_n_chars = yy_n_chars;
+ }
+
+ if ( yy_n_chars == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yyrestart( yyin );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ yy_current_buffer->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ yy_n_chars += number_to_move;
+ yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+ yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+ yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+ return ret_val;
+ }
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+static yy_state_type yy_get_previous_state()
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+
+ yy_current_state = yy_start;
+
+ for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 118 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
+ }
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+ {
+ register int yy_is_jam;
+ register char *yy_cp = yy_c_buf_p;
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 118 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 117);
+
+ return yy_is_jam ? 0 : yy_current_state;
+ }
+
+#if 0
+#ifndef YY_NO_UNPUT
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register char *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register char *yy_bp;
+#endif
+ {
+ register char *yy_cp = yy_c_buf_p;
+
+ /* undo effects of setting up yytext */
+ *yy_cp = yy_hold_char;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = yy_n_chars + 2;
+ register char *dest = &yy_current_buffer->yy_ch_buf[
+ yy_current_buffer->yy_buf_size + 2];
+ register char *source =
+ &yy_current_buffer->yy_ch_buf[number_to_move];
+
+ while ( source > yy_current_buffer->yy_ch_buf )
+ *--dest = *--source;
+
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ yy_current_buffer->yy_n_chars =
+ yy_n_chars = yy_current_buffer->yy_buf_size;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ *--yy_cp = (char) c;
+
+
+ yytext_ptr = yy_bp;
+ yy_hold_char = *yy_cp;
+ yy_c_buf_p = yy_cp;
+ }
+#endif /* ifndef YY_NO_UNPUT */
+#endif /* 0 */
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+ {
+ int c;
+
+ *yy_c_buf_p = yy_hold_char;
+
+ if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ {
+ /* 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 ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ /* This was really a NUL. */
+ *yy_c_buf_p = '\0';
+
+ else
+ { /* need more input */
+ int offset = yy_c_buf_p - yytext_ptr;
+ ++yy_c_buf_p;
+
+ switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because 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. */
+ yyrestart( yyin );
+
+ /* fall through */
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( yywrap() )
+ return EOF;
+
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput();
+#else
+ return input();
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p = yytext_ptr + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
+ *yy_c_buf_p = '\0'; /* preserve yytext */
+ yy_hold_char = *++yy_c_buf_p;
+
+
+ return c;
+ }
+
+void yyflush_current_buffer (void)
+{
+ YY_FLUSH_BUFFER;
+}
+
+
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+ {
+ if ( ! yy_current_buffer )
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_init_buffer( yy_current_buffer, input_file );
+ yy_load_buffer_state();
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+ {
+ if ( yy_current_buffer == new_buffer )
+ return;
+
+ if ( yy_current_buffer )
+ {
+ /* Flush out information for old buffer. */
+ *yy_c_buf_p = yy_hold_char;
+ yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+ yy_current_buffer->yy_n_chars = yy_n_chars;
+ }
+
+ yy_current_buffer = new_buffer;
+ yy_load_buffer_state();
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ yy_did_buffer_switch_on_eof = 1;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+ {
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+ yyin = yy_current_buffer->yy_input_file;
+ yy_hold_char = *yy_c_buf_p;
+ }
+
+
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+ {
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* 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->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ yy_init_buffer( b, file );
+
+ return b;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+ {
+ if ( ! b )
+ return;
+
+ if ( b == yy_current_buffer )
+ yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ yy_flex_free( (void *) b->yy_ch_buf );
+
+ yy_flex_free( (void *) b );
+ }
+
+
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+
+ {
+ yy_flush_buffer( b );
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+#if defined (ACE_HAS_WINCE)
+ // Mimic the behavior as WinCE does not have isatty().
+ if ((file != 0) && (file == fileno(file))) {
+ b->yy_is_interactive = 1;
+ }
+ else {
+ b->yy_is_interactive = 0;
+ }
+#else
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif // ACE_HAS_WINCE
+
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+ {
+ if ( ! b )
+ return;
+
+ b->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->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == yy_current_buffer )
+ yy_load_buffer_state();
+ }
+
+
+#ifndef YY_NO_SCAN_BUFFER
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+char *base;
+yy_size_t size;
+#endif
+ {
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ yy_switch_to_buffer( b );
+
+ return b;
+ }
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+#else
+YY_BUFFER_STATE yy_scan_string( yy_str )
+yyconst char *yy_str;
+#endif
+ {
+ int len;
+ for ( len = 0; yy_str[len]; ++len )
+ ;
+
+ return yy_scan_bytes( yy_str, len );
+ }
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+#else
+YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+yyconst char *bytes;
+int len;
+#endif
+ {
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = len + 2;
+ buf = (char *) yy_flex_alloc( n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+ for ( i = 0; i < len; ++i )
+ buf[i] = bytes[i];
+
+ buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = yy_scan_buffer( buf, n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+ }
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+ {
+ if ( yy_start_stack_ptr >= yy_start_stack_depth )
+ {
+ yy_size_t new_size;
+
+ yy_start_stack_depth += YY_START_STACK_INCR;
+ new_size = yy_start_stack_depth * sizeof( int );
+
+ if ( ! yy_start_stack )
+ yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+ else
+ yy_start_stack = (int *) yy_flex_realloc(
+ (void *) yy_start_stack, new_size );
+
+ if ( ! yy_start_stack )
+ YY_FATAL_ERROR(
+ "out of memory expanding start-condition stack" );
+ }
+
+ yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+ BEGIN(new_state);
+ }
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state()
+ {
+ if ( --yy_start_stack_ptr < 0 )
+ YY_FATAL_ERROR( "start-condition stack underflow" );
+
+ BEGIN(yy_start_stack[yy_start_stack_ptr]);
+ }
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state()
+ {
+ return yy_start_stack[yy_start_stack_ptr - 1];
+ }
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( yyconst char msg[] )
+#else
+static void yy_fatal_error( msg )
+char msg[];
+#endif
+ {
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+ }
+
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ yytext[yyleng] = yy_hold_char; \
+ yy_c_buf_p = yytext + n; \
+ yy_hold_char = *yy_c_buf_p; \
+ *yy_c_buf_p = '\0'; \
+ yyleng = n; \
+ } \
+ while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+yyconst char *s2;
+int n;
+#endif
+ {
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+ }
+#endif
+
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static int yy_flex_strlen( yyconst char *s )
+#else
+static int yy_flex_strlen( s )
+yyconst char *s;
+#endif
+ {
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+ }
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+ {
+ return (void *) malloc( size );
+ }
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+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 YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+ {
+ free( ptr );
+ }
+
+#if YY_MAIN
+int main()
+ {
+ yylex();
+ return 0;
+ }
+#endif
+//#line 122 "ETCL/ETCL.ll"
+
+
+const char*
+extract_string(char* str)
+{
+ char *t = str;
+ for (char * i = str + 1; *i != '\''; ++i, ++t)
+ {
+ if (*i == '\\')
+ {
+ ++i;
+ if (*i == 0)
+ return 0;
+ else if (*i == 't')
+ *t = '\t';
+ else if (*i == 'n')
+ *t = '\n';
+ else if (*i == '\\')
+ *t = '\\';
+ else
+ *t = *i;
+ continue;
+ }
+
+ *t = *i;
+ }
+
+ *t = '\0';
+ return str;
+}
+
+int
+yywrap (void)
+{
+ return 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL_l.cpp.diff b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_l.cpp.diff
new file mode 100644
index 00000000000..9709c130de2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_l.cpp.diff
@@ -0,0 +1,511 @@
+--- bison_gen\ETCL_l.cpp 2005-07-19 10:09:28.523824100 -0700
++++ ETCL_l.cpp 2005-07-19 09:47:22.138585300 -0700
+@@ -1,15 +1,14 @@
++
+ /* A lexical scanner generated by flex */
+
+ /* Scanner skeleton version:
+- * $Header$
++ * $Id$
+ */
+
+ #define FLEX_SCANNER
+ #define YY_FLEX_MAJOR_VERSION 2
+ #define YY_FLEX_MINOR_VERSION 5
+
+-#include <stdio.h>
+-
+
+ /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+ #ifdef c_plusplus
+@@ -21,8 +20,7 @@
+
+ #ifdef __cplusplus
+
+-#include <stdlib.h>
+-#include <unistd.h>
++#include "ace/OS.h"
+
+ /* Use prototypes in function declarations. */
+ #define YY_USE_PROTOS
+@@ -262,8 +260,8 @@
+ #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+
+-#define yywrap() 1
+-#define YY_SKIP_YYWRAP
++//#define yywrap() 1
++//#define YY_SKIP_YYWRAP
+ typedef unsigned char YY_CHAR;
+ FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+ typedef int yy_state_type;
+@@ -444,15 +442,15 @@
+ #define YY_MORE_ADJ 0
+ #define YY_RESTORE_YY_MORE_OFFSET
+ char *yytext;
+-#line 1 "ETCL.ll"
++//#line 1 "ETCL/ETCL.ll"
+ #define INITIAL 0
+-#line 4 "ETCL.ll"
++//#line 4 "ETCL/ETCL.ll"
+ // $Id$
+ // ========================================================================
+ //
+ // = LIBRARY
+ // orbsvcs/ECTL
+-//
++//
+ // = FILENAME
+ // ETCL.ll
+ //
+@@ -462,12 +460,12 @@
+ //
+ // ========================================================================
+
+-#include "ace/OS.h"
+-
++#include "ETCL_Interpreter.h"
+ #include "ETCL_Constraint.h"
+ #include "ETCL_y.h"
+
+-static const char * extract_string(char*);
++static const char* extract_string(char*);
++//static const char * extract_string(char*);
+
+ #define TAO_YY_LEX_DEBUG
+
+@@ -475,12 +473,11 @@
+ #define TAO_YY_LEX_DEBUG TAO_OS::fprintf(stderr, "%s\n", yytext)
+ #endif /* TAO_CONSTRAINT_DEBUG */
+
+-#define YY_DECL int TAO_ETCL_yylex (TAO_ETCL_YYSTYPE *lvalp, void* state)
++//#define YY_DECL int TAO_ETCL_yylex (TAO_ETCL_YYSTYPE *lvalp, void* state)
+
+ #define YY_BREAK
+ #define YY_NO_UNPUT
+
+-#line 484 "lex.yy.c"
+
+ /* Macros after this point can all be overridden by user definitions in
+ * section 1.
+@@ -494,10 +491,6 @@
+ #endif
+ #endif
+
+-#ifndef YY_NO_UNPUT
+-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+-#endif
+-
+ #ifndef yytext_ptr
+ static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+ #endif
+@@ -556,11 +549,11 @@
+
+ /* Copy whatever the last rule matched to the standard output. */
+
+-#ifndef ECHO
++#ifndef TAO_ETCL_ECHO
+ /* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
++#define TAO_ETCL_ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+ #endif
+
+ /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+@@ -628,13 +621,11 @@
+ YY_DECL
+ {
+ register yy_state_type yy_current_state;
+- register char *yy_cp, *yy_bp;
++ register char *yy_cp = 0;
++ register char *yy_bp = 0;
+ register int yy_act;
+
+-#line 50 "ETCL.ll"
+-
+-
+-#line 638 "lex.yy.c"
++//#line 50 "ETCL/ETCL.ll"
+
+ if ( yy_init )
+ {
+@@ -719,240 +710,239 @@
+
+ case 1:
+ YY_RULE_SETUP
+-#line 52 "ETCL.ll"
++//#line 52 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_MIN; }
+ YY_BREAK
+ case 2:
+ YY_RULE_SETUP
+-#line 53 "ETCL.ll"
++//#line 53 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_MAX; }
+ YY_BREAK
+ case 3:
+ YY_RULE_SETUP
+-#line 54 "ETCL.ll"
++//#line 54 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_FIRST; }
+ YY_BREAK
+ case 4:
+ YY_RULE_SETUP
+-#line 55 "ETCL.ll"
++//#line 55 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_RANDOM; }
+ YY_BREAK
+ case 5:
+ YY_RULE_SETUP
+-#line 56 "ETCL.ll"
++//#line 56 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_WITH; }
+ YY_BREAK
+ case 6:
+ YY_RULE_SETUP
+-#line 57 "ETCL.ll"
++//#line 57 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_EXIST; }
+ YY_BREAK
+ case 7:
+ YY_RULE_SETUP
+-#line 58 "ETCL.ll"
++//#line 58 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_NOT; }
+ YY_BREAK
+ case 8:
+ YY_RULE_SETUP
+-#line 59 "ETCL.ll"
++//#line 59 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_AND; }
+ YY_BREAK
+ case 9:
+ YY_RULE_SETUP
+-#line 60 "ETCL.ll"
++//#line 60 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_OR; }
+ YY_BREAK
+ case 10:
+ YY_RULE_SETUP
+-#line 61 "ETCL.ll"
++//#line 61 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_IN; }
+ YY_BREAK
+ case 11:
+ YY_RULE_SETUP
+-#line 62 "ETCL.ll"
++//#line 62 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_TWIDDLE; }
+ YY_BREAK
+ case 12:
+ YY_RULE_SETUP
+-#line 63 "ETCL.ll"
++//#line 63 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_PLUS; }
+ YY_BREAK
+ case 13:
+ YY_RULE_SETUP
+-#line 64 "ETCL.ll"
++//#line 64 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_MINUS; }
+ YY_BREAK
+ case 14:
+ YY_RULE_SETUP
+-#line 65 "ETCL.ll"
++//#line 65 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_MULT; }
+ YY_BREAK
+ case 15:
+ YY_RULE_SETUP
+-#line 66 "ETCL.ll"
++//#line 66 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_DIV; }
+ YY_BREAK
+ case 16:
+ YY_RULE_SETUP
+-#line 67 "ETCL.ll"
++//#line 67 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_LT; }
+ YY_BREAK
+ case 17:
+ YY_RULE_SETUP
+-#line 68 "ETCL.ll"
++//#line 68 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_LE; }
+ YY_BREAK
+ case 18:
+ YY_RULE_SETUP
+-#line 69 "ETCL.ll"
++//#line 69 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_GT; }
+ YY_BREAK
+ case 19:
+ YY_RULE_SETUP
+-#line 70 "ETCL.ll"
++//#line 70 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_GE; }
+ YY_BREAK
+ case 20:
+ YY_RULE_SETUP
+-#line 71 "ETCL.ll"
++//#line 71 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_EQ; }
+ YY_BREAK
+ case 21:
+ YY_RULE_SETUP
+-#line 72 "ETCL.ll"
++//#line 72 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_NE; }
+ YY_BREAK
+ case 22:
+ YY_RULE_SETUP
+-#line 73 "ETCL.ll"
++//#line 73 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_LPAREN; }
+ YY_BREAK
+ case 23:
+ YY_RULE_SETUP
+-#line 74 "ETCL.ll"
++//#line 74 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_RPAREN; }
+ YY_BREAK
+ case 24:
+ YY_RULE_SETUP
+-#line 75 "ETCL.ll"
++//#line 75 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_DOLLAR; }
+ YY_BREAK
+ case 25:
+ YY_RULE_SETUP
+-#line 76 "ETCL.ll"
++//#line 76 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_DOT; }
+ YY_BREAK
+ case 26:
+ YY_RULE_SETUP
+-#line 77 "ETCL.ll"
++//#line 77 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_DEFAULT; }
+ YY_BREAK
+ case 27:
+ YY_RULE_SETUP
+-#line 78 "ETCL.ll"
++//#line 78 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_DISCRIMINANT; }
+ YY_BREAK
+ case 28:
+ YY_RULE_SETUP
+-#line 79 "ETCL.ll"
++//#line 79 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_TYPE_ID; }
+ YY_BREAK
+ case 29:
+ YY_RULE_SETUP
+-#line 80 "ETCL.ll"
++//#line 80 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_REPOS_ID; }
+ YY_BREAK
+ case 30:
+ YY_RULE_SETUP
+-#line 81 "ETCL.ll"
++//#line 81 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_LENGTH; }
+ YY_BREAK
+ case 31:
+ YY_RULE_SETUP
+-#line 82 "ETCL.ll"
++//#line 82 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_LBRA; }
+ YY_BREAK
+ case 32:
+ YY_RULE_SETUP
+-#line 83 "ETCL.ll"
++//#line 83 "ETCL/ETCL.ll"
+ { TAO_YY_LEX_DEBUG; return TAO_ETCL_RBRA; }
+ YY_BREAK
+ case 33:
+ YY_RULE_SETUP
+-#line 84 "ETCL.ll"
+-{
+- lvalp->constraint =
++//#line 84 "ETCL/ETCL.ll"
++{
++ yylval.constraint =
+ new TAO_ETCL_Literal_Constraint ((CORBA::Boolean) 1);
+ TAO_YY_LEX_DEBUG; return TAO_ETCL_BOOLEAN;
+ }
+ YY_BREAK
+ case 34:
+ YY_RULE_SETUP
+-#line 89 "ETCL.ll"
+-{
+- lvalp->constraint =
++//#line 89 "ETCL/ETCL.ll"
++{
++ yylval.constraint =
+ new TAO_ETCL_Literal_Constraint ((CORBA::Boolean) 0);
+ TAO_YY_LEX_DEBUG; return TAO_ETCL_BOOLEAN;
+ }
+ YY_BREAK
+ case 35:
+ YY_RULE_SETUP
+-#line 94 "ETCL.ll"
+-{
+- lvalp->constraint =
++//#line 94 "ETCL/ETCL.ll"
++{
++ yylval.constraint =
+ new TAO_ETCL_Literal_Constraint (ACE_OS::atoi (yytext));
+- TAO_YY_LEX_DEBUG; return TAO_ETCL_INTEGER;
++ TAO_YY_LEX_DEBUG; return TAO_ETCL_INTEGER;
+ }
+ YY_BREAK
+ case 36:
+ YY_RULE_SETUP
+-#line 99 "ETCL.ll"
++//#line 99 "ETCL/ETCL.ll"
+ {
+ double v;
+- sscanf (yytext, "%lf", &v);
+- lvalp->constraint =
++ sscanf (yytext, "%lf", &v);
++ yylval.constraint =
+ new TAO_ETCL_Literal_Constraint (v);
+- TAO_YY_LEX_DEBUG; return TAO_ETCL_FLOAT;
++ TAO_YY_LEX_DEBUG; return TAO_ETCL_FLOAT;
+ }
+ YY_BREAK
+ case 37:
+ YY_RULE_SETUP
+-#line 106 "ETCL.ll"
+-{
+- lvalp->constraint =
+- new TAO_ETCL_Literal_Constraint (extract_string (yytext));
+- TAO_YY_LEX_DEBUG; return TAO_ETCL_STRING;
++//#line 106 "ETCL/ETCL.ll"
++{
++ yylval.constraint =
++ new TAO_ETCL_Literal_Constraint (extract_string(yytext));
++ TAO_YY_LEX_DEBUG; return TAO_ETCL_STRING;
+ }
+ YY_BREAK
+ case 38:
+ YY_RULE_SETUP
+-#line 111 "ETCL.ll"
+-{
+- lvalp->constraint =
++//#line 111 "ETCL/ETCL.ll"
++{
++ yylval.constraint =
+ new TAO_ETCL_Identifier (yytext);
+- TAO_YY_LEX_DEBUG; return TAO_ETCL_IDENT;
++ TAO_YY_LEX_DEBUG; return TAO_ETCL_IDENT;
+ }
+ YY_BREAK
+ case 39:
+ YY_RULE_SETUP
+-#line 116 "ETCL.ll"
+-{
++//#line 116 "ETCL/ETCL.ll"
++{
+ TAO_YY_LEX_DEBUG; break; // Ignore
+ }
+ YY_BREAK
+ case 40:
+ YY_RULE_SETUP
+-#line 119 "ETCL.ll"
+-{
++//#line 119 "ETCL/ETCL.ll"
++{
+ TAO_YY_LEX_DEBUG; break; // @@ TODO
+ }
+ YY_BREAK
+ case 41:
+ YY_RULE_SETUP
+-#line 122 "ETCL.ll"
+-ECHO;
++//#line 122 "ETCL/ETCL.ll"
++TAO_ETCL_ECHO;
+ YY_BREAK
+-#line 956 "lex.yy.c"
+ case YY_STATE_EOF(INITIAL):
+ yyterminate();
+
+@@ -1288,7 +1278,7 @@
+ return yy_is_jam ? 0 : yy_current_state;
+ }
+
+-
++#if 0
+ #ifndef YY_NO_UNPUT
+ #ifdef YY_USE_PROTOS
+ static void yyunput( int c, register char *yy_bp )
+@@ -1332,7 +1322,7 @@
+ yy_c_buf_p = yy_cp;
+ }
+ #endif /* ifndef YY_NO_UNPUT */
+-
++#endif /* 0 */
+
+ #ifdef __cplusplus
+ static int yyinput()
+@@ -1406,6 +1396,11 @@
+ return c;
+ }
+
++void yyflush_current_buffer (void)
++{
++ YY_FLUSH_BUFFER;
++}
++
+
+ #ifdef YY_USE_PROTOS
+ void yyrestart( FILE *input_file )
+@@ -1516,11 +1511,6 @@
+ }
+
+
+-#ifndef YY_ALWAYS_INTERACTIVE
+-#ifndef YY_NEVER_INTERACTIVE
+-extern int isatty YY_PROTO(( int ));
+-#endif
+-#endif
+
+ #ifdef YY_USE_PROTOS
+ void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+@@ -1537,15 +1527,18 @@
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+-#if YY_ALWAYS_INTERACTIVE
+- b->yy_is_interactive = 1;
+-#else
+-#if YY_NEVER_INTERACTIVE
+- b->yy_is_interactive = 0;
++#if defined (ACE_HAS_WINCE)
++ // Mimic the behavior as WinCE does not have isatty().
++ if ((file != 0) && (file == fileno(file))) {
++ b->yy_is_interactive = 1;
++ }
++ else {
++ b->yy_is_interactive = 0;
++ }
+ #else
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+-#endif
+-#endif
++#endif // ACE_HAS_WINCE
++
+ }
+
+
+@@ -1838,7 +1831,7 @@
+ return 0;
+ }
+ #endif
+-#line 122 "ETCL.ll"
++//#line 122 "ETCL/ETCL.ll"
+
+
+ const char*
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.cpp b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.cpp
new file mode 100644
index 00000000000..1c07ea5d3a7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.cpp
@@ -0,0 +1,1295 @@
+// $Id$
+
+/* A Bison parser, made from ETCL/ETCL.yy
+ by GNU Bison version 1.28 */
+
+#define YYBISON 1 /* Identify Bison output. */
+
+#define TAO_ETCL_GT 257
+#define TAO_ETCL_GE 258
+#define TAO_ETCL_LT 259
+#define TAO_ETCL_LE 260
+#define TAO_ETCL_EQ 261
+#define TAO_ETCL_NE 262
+#define TAO_ETCL_EXIST 263
+#define TAO_ETCL_DEFAULT 264
+#define TAO_ETCL_AND 265
+#define TAO_ETCL_OR 266
+#define TAO_ETCL_NOT 267
+#define TAO_ETCL_IN 268
+#define TAO_ETCL_TWIDDLE 269
+#define TAO_ETCL_BOOLEAN 270
+#define TAO_ETCL_PLUS 271
+#define TAO_ETCL_MINUS 272
+#define TAO_ETCL_MULT 273
+#define TAO_ETCL_DIV 274
+#define TAO_ETCL_UMINUS 275
+#define TAO_ETCL_INTEGER 276
+#define TAO_ETCL_FLOAT 277
+#define TAO_ETCL_STRING 278
+#define TAO_ETCL_RPAREN 279
+#define TAO_ETCL_LPAREN 280
+#define TAO_ETCL_RBRA 281
+#define TAO_ETCL_LBRA 282
+#define TAO_ETCL_IDENT 283
+#define TAO_ETCL_UNSIGNED 284
+#define TAO_ETCL_SIGNED 285
+#define TAO_ETCL_DOUBLE 286
+#define TAO_ETCL_CONSTRAINT 287
+#define TAO_ETCL_COMPONENT 288
+#define TAO_ETCL_WITH 289
+#define TAO_ETCL_MAX 290
+#define TAO_ETCL_MIN 291
+#define TAO_ETCL_FIRST 292
+#define TAO_ETCL_RANDOM 293
+#define TAO_ETCL_DOLLAR 294
+#define TAO_ETCL_DOT 295
+#define TAO_ETCL_DISCRIMINANT 296
+#define TAO_ETCL_LENGTH 297
+#define TAO_ETCL_TYPE_ID 298
+#define TAO_ETCL_REPOS_ID 299
+
+//#line 1 "ETCL/ETCL.yy"
+
+// $Id$
+// ========================================================================
+//
+// = LIBRARY
+// orbsvcs / Extended Trader Constraint Language parser.
+//
+// = FILENAME
+// ETCL.yy
+//
+// = AUTHOR
+// Carlos O'Ryan <coryan@uci.edu> based on previous work by
+// Seth Widoff <sbw1@cs.wustl.edu>
+//
+// ========================================================================
+
+#include "orbsvcs/ETCL/ETCL_y.h"
+#include "orbsvcs/ETCL/ETCL_Constraint.h"
+#include "orbsvcs/ETCL/ETCL_Interpreter.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+extern int yylex (void);
+extern void yyflush_current_buffer (void);
+
+static void yyerror (const char *)
+{
+ // @@ TODO
+ // Ignore error messages
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include <stdio.h>
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+#ifndef __cplusplus
+#ifndef __STDC__
+#define const
+#endif
+#endif
+
+
+
+#define YYFINAL 114
+#define YYFLAG -32768
+#define YYNTBASE 46
+
+#define YYTRANSLATE(x) ((unsigned)(x) <= 299 ? yytranslate[x] : 65)
+
+static const char 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, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40, 41, 42, 43, 44, 45
+};
+
+#if YYDEBUG != 0
+static const short yyprhs[] = { 0,
+ 0, 2, 4, 7, 10, 13, 15, 17, 21, 23,
+ 27, 29, 33, 37, 41, 45, 49, 53, 55, 59,
+ 64, 66, 70, 72, 76, 80, 82, 86, 90, 92,
+ 95, 97, 101, 103, 106, 109, 111, 114, 117, 119,
+ 121, 124, 128, 132, 135, 137, 138, 141, 144, 146,
+ 148, 149, 152, 154, 156, 159, 161, 163, 165, 167,
+ 169, 171, 176, 181, 184, 189, 190, 192, 195, 198
+};
+
+static const short yyrhs[] = { 48,
+ 0, 47, 0, 37, 48, 0, 36, 48, 0, 35,
+ 48, 0, 38, 0, 39, 0, 48, 12, 49, 0,
+ 49, 0, 49, 11, 50, 0, 50, 0, 51, 7,
+ 51, 0, 51, 8, 51, 0, 51, 3, 51, 0,
+ 51, 4, 51, 0, 51, 5, 51, 0, 51, 6,
+ 51, 0, 51, 0, 52, 14, 57, 0, 52, 14,
+ 40, 57, 0, 52, 0, 53, 15, 53, 0, 53,
+ 0, 53, 17, 54, 0, 53, 18, 54, 0, 54,
+ 0, 54, 19, 55, 0, 54, 20, 55, 0, 55,
+ 0, 13, 56, 0, 56, 0, 26, 48, 25, 0,
+ 22, 0, 17, 22, 0, 18, 22, 0, 23, 0,
+ 17, 23, 0, 18, 23, 0, 24, 0, 16, 0,
+ 9, 29, 0, 9, 40, 57, 0, 10, 40, 57,
+ 0, 40, 57, 0, 29, 0, 0, 41, 59, 0,
+ 29, 58, 0, 60, 0, 61, 0, 0, 41, 59,
+ 0, 60, 0, 61, 0, 29, 58, 0, 43, 0,
+ 42, 0, 44, 0, 45, 0, 62, 0, 63, 0,
+ 28, 22, 27, 58, 0, 26, 29, 25, 58, 0,
+ 22, 58, 0, 26, 64, 25, 58, 0, 0, 22,
+ 0, 17, 22, 0, 18, 22, 0, 24, 0
+};
+
+#endif
+
+#if YYDEBUG != 0
+static const short yyrline[] = { 0,
+ 92, 93, 96, 98, 100, 102, 104, 108, 110, 113,
+ 115, 118, 120, 122, 124, 126, 128, 130, 133, 135,
+ 137, 140, 142, 145, 147, 149, 152, 154, 156, 159,
+ 161, 164, 166, 168, 170, 172, 174, 176, 178, 180,
+ 182, 184, 186, 188, 190, 194, 196, 199, 202, 203,
+ 206, 208, 211, 212, 215, 217, 219, 221, 223, 225,
+ 226, 229, 233, 237, 241, 245, 247, 249, 251, 253
+};
+#endif
+
+
+#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
+
+static const char * const yytname[] = { "$","error","$undefined.","TAO_ETCL_GT",
+"TAO_ETCL_GE","TAO_ETCL_LT","TAO_ETCL_LE","TAO_ETCL_EQ","TAO_ETCL_NE","TAO_ETCL_EXIST",
+"TAO_ETCL_DEFAULT","TAO_ETCL_AND","TAO_ETCL_OR","TAO_ETCL_NOT","TAO_ETCL_IN",
+"TAO_ETCL_TWIDDLE","TAO_ETCL_BOOLEAN","TAO_ETCL_PLUS","TAO_ETCL_MINUS","TAO_ETCL_MULT",
+"TAO_ETCL_DIV","TAO_ETCL_UMINUS","TAO_ETCL_INTEGER","TAO_ETCL_FLOAT","TAO_ETCL_STRING",
+"TAO_ETCL_RPAREN","TAO_ETCL_LPAREN","TAO_ETCL_RBRA","TAO_ETCL_LBRA","TAO_ETCL_IDENT",
+"TAO_ETCL_UNSIGNED","TAO_ETCL_SIGNED","TAO_ETCL_DOUBLE","TAO_ETCL_CONSTRAINT",
+"TAO_ETCL_COMPONENT","TAO_ETCL_WITH","TAO_ETCL_MAX","TAO_ETCL_MIN","TAO_ETCL_FIRST",
+"TAO_ETCL_RANDOM","TAO_ETCL_DOLLAR","TAO_ETCL_DOT","TAO_ETCL_DISCRIMINANT","TAO_ETCL_LENGTH",
+"TAO_ETCL_TYPE_ID","TAO_ETCL_REPOS_ID","constraint","preference","bool_or","bool_and",
+"bool_compare","expr_in","expr_twiddle","expr","term","factor_not","factor",
+"component","component_ext","component_dot","component_array","component_assoc",
+"component_pos","union_pos","union_val", NULL
+};
+#endif
+
+static const short yyr1[] = { 0,
+ 46, 46, 47, 47, 47, 47, 47, 48, 48, 49,
+ 49, 50, 50, 50, 50, 50, 50, 50, 51, 51,
+ 51, 52, 52, 53, 53, 53, 54, 54, 54, 55,
+ 55, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 57, 57, 57, 57, 57,
+ 58, 58, 58, 58, 59, 59, 59, 59, 59, 59,
+ 59, 60, 61, 62, 63, 64, 64, 64, 64, 64
+};
+
+static const short yyr2[] = { 0,
+ 1, 1, 2, 2, 2, 1, 1, 3, 1, 3,
+ 1, 3, 3, 3, 3, 3, 3, 1, 3, 4,
+ 1, 3, 1, 3, 3, 1, 3, 3, 1, 2,
+ 1, 3, 1, 2, 2, 1, 2, 2, 1, 1,
+ 2, 3, 3, 2, 1, 0, 2, 2, 1, 1,
+ 0, 2, 1, 1, 2, 1, 1, 1, 1, 1,
+ 1, 4, 4, 2, 4, 0, 1, 2, 2, 1
+};
+
+static const short yydefact[] = { 0,
+ 0, 0, 0, 40, 0, 0, 33, 36, 39, 0,
+ 45, 0, 0, 0, 6, 7, 46, 2, 1, 9,
+ 11, 18, 21, 23, 26, 29, 31, 41, 46, 46,
+ 30, 34, 37, 35, 38, 0, 5, 4, 3, 0,
+ 0, 51, 0, 44, 49, 50, 0, 0, 0, 0,
+ 0, 0, 0, 0, 46, 0, 0, 0, 0, 0,
+ 42, 43, 32, 0, 0, 0, 48, 53, 54, 51,
+ 66, 51, 57, 56, 58, 59, 47, 60, 61, 8,
+ 10, 14, 15, 16, 17, 12, 13, 46, 19, 22,
+ 24, 25, 27, 28, 51, 51, 52, 64, 0, 0,
+ 67, 70, 0, 55, 20, 63, 62, 68, 69, 51,
+ 65, 0, 0, 0
+};
+
+static const short yydefgoto[] = { 112,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
+ 44, 67, 77, 68, 69, 78, 79, 103
+};
+
+static const short yypact[] = { 41,
+ -13, -39, 94,-32768, 38, 46,-32768,-32768,-32768, 73,
+-32768, 73, 73, 73,-32768,-32768, -9,-32768, -6, 7,
+-32768, 121, -5, 19, 55,-32768,-32768,-32768, -9, -9,
+-32768,-32768,-32768,-32768,-32768, 21, -6, -6, -6, 6,
+ 25, -2, -1,-32768,-32768,-32768, 73, 73, 73, 73,
+ 73, 73, 73, 73, -18, 73, 73, 73, 73, 73,
+-32768,-32768,-32768, 27, 29, -1,-32768,-32768,-32768, -2,
+ 31, -2,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 7,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768, -9,-32768, 67,
+ 55, 55,-32768,-32768, -2, -2,-32768,-32768, 44, 50,
+-32768,-32768, 69,-32768,-32768,-32768,-32768,-32768,-32768, -2,
+-32768, 98, 100,-32768
+};
+
+static const short yypgoto[] = {-32768,
+-32768, 95, 54, 58, 86,-32768, 59, 30, 33, 111,
+ -26, -65, 53, -17, -15,-32768,-32768,-32768
+};
+
+
+#define YYLAST 140
+
+
+static const short yytable[] = { 45,
+ 30, 46, 61, 62, 98, 47, 104, 40, 55, 41,
+ 42, 45, 45, 46, 46, 28, 40, 48, 41, 42,
+ 70, 88, 43, 40, 71, 41, 29, 72, 89, 106,
+ 107, 43, 47, 56, 64, 57, 58, 45, 66, 46,
+ 73, 74, 75, 76, 111, 63, 65, 99, 100, 1,
+ 2, 95, 101, 3, 102, 96, 4, 5, 6, 32,
+ 33, 105, 7, 8, 9, 108, 10, 34, 35, 11,
+ 45, 109, 46, 59, 60, 12, 13, 14, 15, 16,
+ 17, 1, 2, 57, 58, 3, 91, 92, 4, 5,
+ 6, 93, 94, 110, 7, 8, 9, 113, 10, 114,
+ 80, 11, 1, 2, 36, 81, 37, 38, 39, 4,
+ 5, 6, 17, 31, 90, 7, 8, 9, 97, 10,
+ 0, 0, 11, 49, 50, 51, 52, 53, 54, 0,
+ 0, 0, 0, 17, 82, 83, 84, 85, 86, 87
+};
+
+static const short yycheck[] = { 17,
+ 40, 17, 29, 30, 70, 12, 72, 26, 14, 28,
+ 29, 29, 30, 29, 30, 29, 26, 11, 28, 29,
+ 22, 40, 41, 26, 26, 28, 40, 29, 55, 95,
+ 96, 41, 12, 15, 29, 17, 18, 55, 41, 55,
+ 42, 43, 44, 45, 110, 25, 22, 17, 18, 9,
+ 10, 25, 22, 13, 24, 27, 16, 17, 18, 22,
+ 23, 88, 22, 23, 24, 22, 26, 22, 23, 29,
+ 88, 22, 88, 19, 20, 35, 36, 37, 38, 39,
+ 40, 9, 10, 17, 18, 13, 57, 58, 16, 17,
+ 18, 59, 60, 25, 22, 23, 24, 0, 26, 0,
+ 47, 29, 9, 10, 10, 48, 12, 13, 14, 16,
+ 17, 18, 40, 3, 56, 22, 23, 24, 66, 26,
+ -1, -1, 29, 3, 4, 5, 6, 7, 8, -1,
+ -1, -1, -1, 40, 49, 50, 51, 52, 53, 54
+};
+/* -*-C-*- Note some compilers choke on comments on `//#line' lines. */
+//#line 3 "/pkg/gnu/share/bison.simple"
+/* 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. */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#ifndef YYSTACK_USE_ALLOCA
+#ifdef alloca
+#define YYSTACK_USE_ALLOCA
+#else /* alloca not defined */
+#ifdef __GNUC__
+#define 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 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 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 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 /* YYSTACK_USE_ALLOCA not defined */
+
+#ifdef YYSTACK_USE_ALLOCA
+#define YYSTACK_ALLOC alloca
+#else
+#define 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 yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY -2
+#define YYEOF 0
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrlab1
+/* Like YYERROR except do call yyerror.
+ This remains here temporarily to ease the
+ transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
+#define YYFAIL goto yyerrlab
+#define YYRECOVERING() (!!yyerrstatus)
+#define YYBACKUP(token, value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { yychar = (token), yylval = (value); \
+ yychar1 = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+ { yyerror ("syntax error: cannot back up"); YYERROR; } \
+while (0)
+
+#define YYTERROR 1
+#define YYERRCODE 256
+
+#ifndef YYPURE
+#define YYLEX yylex()
+#endif
+
+#ifdef YYPURE
+#ifdef YYLSP_NEEDED
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
+#else
+#define YYLEX yylex(&yylval, &yylloc)
+#endif
+#else /* not YYLSP_NEEDED */
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, YYLEX_PARAM)
+#else
+#define YYLEX yylex(&yylval)
+#endif
+#endif /* not YYLSP_NEEDED */
+#endif
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/* If nonreentrant, generate the variables here */
+
+#ifndef YYPURE
+
+int yychar; /* the lookahead symbol */
+YYSTYPE yylval; /* the semantic value of the */
+ /* lookahead symbol */
+YYSTYPE yyval; /* the variable used to return */
+ /* semantic values from the action */
+ /* routines */
+
+
+#ifdef YYLSP_NEEDED
+YYLTYPE yylloc; /* location data for the lookahead */
+ /* symbol */
+#endif
+
+int yynerrs; /* number of parse errors so far */
+#endif /* not YYPURE */
+
+#if YYDEBUG != 0
+int yydebug; /* nonzero means print parse trace */
+/* Since this is uninitialized, it does not stop multiple parsers
+ from coexisting. */
+#endif
+
+/* YYINITDEPTH indicates the initial size of the parser's stacks */
+
+#ifndef YYINITDEPTH
+#define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH is the maximum size the stacks can grow to
+ (effective only if the built-in stack extension method is used). */
+
+#if YYMAXDEPTH == 0
+#undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+#define YYMAXDEPTH 10000
+#endif
+
+/* Define __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 __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
+__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
+__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
+
+//#line 217 "/pkg/gnu/share/bison.simple"
+
+/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+ into 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 YYPARSE_PARAM
+#ifdef __cplusplus
+#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL
+#else /* not __cplusplus */
+#define YYPARSE_PARAM_ARG YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+#endif /* not __cplusplus */
+#else /* not YYPARSE_PARAM */
+#define YYPARSE_PARAM_ARG
+#define YYPARSE_PARAM_DECL
+#endif /* not YYPARSE_PARAM */
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+#ifdef YYPARSE_PARAM
+int yyparse (void *);
+#else
+int yyparse (void);
+#endif
+#endif
+
+int
+yyparse(YYPARSE_PARAM_ARG)
+ YYPARSE_PARAM_DECL
+{
+ register int yystate;
+ register int yyn;
+ register short *yyssp;
+ register YYSTYPE *yyvsp;
+ int yyerrstatus; /* number of tokens to shift before error messages enabled */
+ int yychar1 = 0; /* lookahead token as an internal (translated) token number */
+
+ short yyssa[YYINITDEPTH]; /* the state stack */
+ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
+
+ short *yyss = yyssa; /* refer to the stacks thru separate pointers */
+ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
+
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
+ YYLTYPE *yyls = yylsa;
+ YYLTYPE *yylsp;
+
+#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+#else
+#define YYPOPSTACK (yyvsp--, yyssp--)
+#endif
+
+ int yystacksize = YYINITDEPTH;
+ int yyfree_stacks = 0;
+
+#ifdef YYPURE
+ int yychar;
+ YYSTYPE yylval;
+ int yynerrs;
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylloc;
+#endif
+#endif
+
+ int yylen;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Starting parse\n");
+#endif
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = 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. */
+
+ yyssp = yyss - 1;
+ yyvsp = yyvs;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls;
+#endif
+
+/* Push a new state, which is found in 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. */
+yynewstate:
+
+ *++yyssp = yystate;
+
+ if (yyssp >= yyss + 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. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+#ifdef YYLSP_NEEDED
+ YYLTYPE *yyls1 = yyls;
+#endif
+
+ /* Get the current used size of the three stacks, in elements. */
+ int size = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ /* Each stack pointer address is followed by the size of
+ the data in use in that stack, in bytes. */
+#ifdef YYLSP_NEEDED
+ /* This used to be a conditional around just the two extra args,
+ but that might be undefined if yyoverflow is a macro. */
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yyls1, size * sizeof (*yylsp),
+ &yystacksize);
+#else
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yystacksize);
+#endif
+
+ yyss = yyss1; yyvs = yyvs1;
+#ifdef YYLSP_NEEDED
+ yyls = yyls1;
+#endif
+#else /* no yyoverflow */
+ /* Extend the stack our own way. */
+ if (yystacksize >= YYMAXDEPTH)
+ {
+ yyerror("parser stack overflow");
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 2;
+ }
+ yystacksize *= 2;
+ if (yystacksize > YYMAXDEPTH)
+ yystacksize = YYMAXDEPTH;
+#ifndef YYSTACK_USE_ALLOCA
+ yyfree_stacks = 1;
+#endif
+ yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
+ __yy_memcpy ((char *)yyss, (char *)yyss1,
+ size * (unsigned int) sizeof (*yyssp));
+ yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
+ __yy_memcpy ((char *)yyvs, (char *)yyvs1,
+ size * (unsigned int) sizeof (*yyvsp));
+#ifdef YYLSP_NEEDED
+ yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
+ __yy_memcpy ((char *)yyls, (char *)yyls1,
+ size * (unsigned int) sizeof (*yylsp));
+#endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + size - 1;
+ yyvsp = yyvs + size - 1;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls + size - 1;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Stack size increased to %d\n", yystacksize);
+#endif
+
+ if (yyssp >= yyss + yystacksize - 1)
+ YYABORT;
+ }
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Entering state %d\n", yystate);
+#endif
+
+ goto yybackup;
+ yybackup:
+
+/* Do appropriate processing given the current state. */
+/* Read a lookahead token if we need one and don't already have one. */
+/* yyresume: */
+
+ /* First try to decide what to do without reference to lookahead token. */
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* yychar is either YYEMPTY or YYEOF
+ or a valid token in external form. */
+
+ if (yychar == YYEMPTY)
+ {
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Reading a token: ");
+#endif
+ yychar = YYLEX;
+ }
+
+ /* Convert token to internal form (in yychar1) for indexing tables with */
+
+ if (yychar <= 0) /* This means end of input. */
+ {
+ yychar1 = 0;
+ yychar = YYEOF; /* Don't call YYLEX any more */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Now at end of input.\n");
+#endif
+ }
+ else
+ {
+ yychar1 = YYTRANSLATE(yychar);
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+ /* Give the individual parser a way to print the precise meaning
+ of a token, for further debugging info. */
+#ifdef YYPRINT
+ YYPRINT (stderr, yychar, yylval);
+#endif
+ fprintf (stderr, ")\n");
+ }
+#endif
+ }
+
+ yyn += yychar1;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
+ goto yydefault;
+
+ yyn = yytable[yyn];
+
+ /* yyn is what to do for this token type in this state.
+ Negative => reduce, -yyn is rule number.
+ Positive => shift, yyn is new state.
+ New state is final state => don't bother to shift,
+ just return success.
+ 0, or most negative number => error. */
+
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrlab;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the lookahead token. */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
+#endif
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ /* count tokens shifted since error; after three, turn off error status. */
+ if (yyerrstatus) yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+/* Do the default action for the current state. */
+yydefault:
+
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+
+/* Do a reduction. yyn is the number of a rule to reduce with. */
+yyreduce:
+ yylen = yyr2[yyn];
+ if (yylen > 0)
+ yyval = yyvsp[1-yylen]; /* implement default value of the action */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ int i;
+
+ fprintf (stderr, "Reducing via rule %d (line %d), ",
+ yyn, yyrline[yyn]);
+
+ /* Print the symbols being reduced, and their result. */
+ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
+ fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+ fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+ }
+#endif
+
+
+ switch (yyn) {
+
+case 3:
+//#line 97 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Preference (TAO_ETCL_MIN, yyvsp[0].constraint); ;
+ break;}
+case 4:
+//#line 99 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Preference (TAO_ETCL_MAX, yyvsp[0].constraint); ;
+ break;}
+case 5:
+//#line 101 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Preference (TAO_ETCL_WITH, yyvsp[0].constraint); ;
+ break;}
+case 6:
+//#line 103 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Preference (TAO_ETCL_FIRST); ;
+ break;}
+case 7:
+//#line 105 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Preference (TAO_ETCL_RANDOM); ;
+ break;}
+case 8:
+//#line 109 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_OR, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 10:
+//#line 114 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_AND, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 12:
+//#line 119 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_EQ, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 13:
+//#line 121 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_NE, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 14:
+//#line 123 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_GT, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 15:
+//#line 125 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_GE, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 16:
+//#line 127 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_LT, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 17:
+//#line 129 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_LE, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 19:
+//#line 134 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_IN, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 20:
+//#line 136 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_IN, yyvsp[-3].constraint, yyvsp[0].constraint); ;
+ break;}
+case 22:
+//#line 141 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_TWIDDLE, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 24:
+//#line 146 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_PLUS, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 25:
+//#line 148 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_MINUS, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 27:
+//#line 153 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_MULT, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 28:
+//#line 155 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_DIV, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 30:
+//#line 160 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Unary_Expr (TAO_ETCL_NOT, yyvsp[0].constraint); ;
+ break;}
+case 32:
+//#line 165 "ETCL/ETCL.yy"
+{ yyval.constraint = yyvsp[-1].constraint; ;
+ break;}
+case 33:
+//#line 167 "ETCL/ETCL.yy"
+{ yyval.constraint = yyvsp[0].constraint; ;
+ break;}
+case 34:
+//#line 169 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Unary_Expr (TAO_ETCL_PLUS, yyvsp[0].constraint); ;
+ break;}
+case 35:
+//#line 171 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Unary_Expr (TAO_ETCL_MINUS, yyvsp[0].constraint); ;
+ break;}
+case 36:
+//#line 173 "ETCL/ETCL.yy"
+{ yyval.constraint = yyvsp[0].constraint; ;
+ break;}
+case 37:
+//#line 175 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Unary_Expr (TAO_ETCL_PLUS, yyvsp[0].constraint); ;
+ break;}
+case 38:
+//#line 177 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Unary_Expr (TAO_ETCL_MINUS, yyvsp[0].constraint); ;
+ break;}
+case 39:
+//#line 179 "ETCL/ETCL.yy"
+{ yyval.constraint = yyvsp[0].constraint; ;
+ break;}
+case 40:
+//#line 181 "ETCL/ETCL.yy"
+{ yyval.constraint = yyvsp[0].constraint; ;
+ break;}
+case 41:
+//#line 183 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Exist (yyvsp[0].constraint); ;
+ break;}
+case 42:
+//#line 185 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Exist (yyvsp[0].constraint); ;
+ break;}
+case 43:
+//#line 187 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Default (yyvsp[0].constraint); ;
+ break;}
+case 44:
+//#line 189 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Eval (yyvsp[0].constraint); ;
+ break;}
+case 45:
+//#line 191 "ETCL/ETCL.yy"
+{ yyval.constraint = yyvsp[0].constraint; ;
+ break;}
+case 46:
+//#line 195 "ETCL/ETCL.yy"
+{ yyval.constraint = 0; ;
+ break;}
+case 47:
+//#line 197 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Dot (yyvsp[0].constraint); ;
+ break;}
+case 48:
+//#line 200 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Component (yyvsp[-1].constraint, yyvsp[0].constraint); ;
+ break;}
+case 51:
+//#line 207 "ETCL/ETCL.yy"
+{ yyval.constraint = 0; ;
+ break;}
+case 52:
+//#line 209 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Dot (yyvsp[0].constraint); ;
+ break;}
+case 55:
+//#line 216 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Component (yyvsp[-1].constraint, yyvsp[0].constraint); ;
+ break;}
+case 56:
+//#line 218 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Special (TAO_ETCL_LENGTH); ;
+ break;}
+case 57:
+//#line 220 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Special (TAO_ETCL_DISCRIMINANT); ;
+ break;}
+case 58:
+//#line 222 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Special (TAO_ETCL_TYPE_ID); ;
+ break;}
+case 59:
+//#line 224 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Special (TAO_ETCL_REPOS_ID); ;
+ break;}
+case 62:
+//#line 230 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Component_Array (yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 63:
+//#line 234 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Component_Assoc (yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 64:
+//#line 238 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Component_Pos (yyvsp[-1].constraint, yyvsp[0].constraint); ;
+ break;}
+case 65:
+//#line 242 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Union_Pos (yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+case 66:
+//#line 246 "ETCL/ETCL.yy"
+{ yyval.constraint = 0; ;
+ break;}
+case 67:
+//#line 248 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Union_Value (+1, yyvsp[0].constraint); ;
+ break;}
+case 68:
+//#line 250 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Union_Value (+1, yyvsp[0].constraint); ;
+ break;}
+case 69:
+//#line 252 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Union_Value (-1, yyvsp[0].constraint); ;
+ break;}
+case 70:
+//#line 254 "ETCL/ETCL.yy"
+{ yyval.constraint = new TAO_ETCL_Union_Value (yyvsp[0].constraint); ;
+ break;}
+}
+ /* the action file gets copied in in place of this dollarsign */
+//#line 543 "/pkg/gnu/share/bison.simple"
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+#ifdef YYLSP_NEEDED
+ yylsp -= yylen;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
+
+ *++yyvsp = yyval;
+
+#ifdef YYLSP_NEEDED
+ yylsp++;
+ if (yylen == 0)
+ {
+ yylsp->first_line = yylloc.first_line;
+ yylsp->first_column = yylloc.first_column;
+ yylsp->last_line = (yylsp-1)->last_line;
+ yylsp->last_column = (yylsp-1)->last_column;
+ yylsp->text = 0;
+ }
+ else
+ {
+ yylsp->last_line = (yylsp+yylen-1)->last_line;
+ yylsp->last_column = (yylsp+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. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+ if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTBASE];
+
+ goto yynewstate;
+
+yyerrlab: /* here on detecting error */
+
+ if (! yyerrstatus)
+ /* If not already recovering from an error, report this error. */
+ {
+ ++yynerrs;
+
+#ifdef YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+ if (yyn > YYFLAG && yyn < YYLAST)
+ {
+ int size = 0;
+ char *msg;
+ int x, count;
+
+ count = 0;
+ /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ size += strlen(yytname[x]) + 15, count++;
+ msg = (char *) malloc(size + 15);
+ if (msg != 0)
+ {
+ strcpy(msg, "parse error");
+
+ if (count < 5)
+ {
+ count = 0;
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ {
+ strcat(msg, count == 0 ? ", expecting `" : " or `");
+ strcat(msg, yytname[x]);
+ strcat(msg, "'");
+ count++;
+ }
+ }
+ yyerror(msg);
+ free(msg);
+ }
+ else
+ yyerror ("parse error; also virtual memory exceeded");
+ }
+ else
+#endif /* YYERROR_VERBOSE */
+ yyerror("parse error");
+ }
+
+ goto yyerrlab1;
+yyerrlab1: /* here on error raised explicitly by an action */
+
+ if (yyerrstatus == 3)
+ {
+ /* if just tried and failed to reuse lookahead token after an error, discard it. */
+
+ /* return failure if at end of input */
+ if (yychar == YYEOF)
+ YYABORT;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
+#endif
+
+ yychar = YYEMPTY;
+ }
+
+ /* Else will try to reuse lookahead token
+ after shifting the error token. */
+
+ yyerrstatus = 3; /* Each real token shifted decrements this */
+
+ goto yyerrhandle;
+
+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. */
+ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
+ if (yyn) goto yydefault;
+#endif
+
+yyerrpop: /* pop the current state because it cannot handle the error token */
+
+ if (yyssp == yyss) YYABORT;
+ yyvsp--;
+ yystate = *--yyssp;
+#ifdef YYLSP_NEEDED
+ yylsp--;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "Error: state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
+
+yyerrhandle:
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yyerrdefault;
+
+ yyn += YYTERROR;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+ goto yyerrdefault;
+
+ yyn = yytable[yyn];
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrpop;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrpop;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting error token, ");
+#endif
+
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ yystate = yyn;
+ goto yynewstate;
+
+ yyacceptlab:
+ /* YYACCEPT comes here. */
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 0;
+
+ yyabortlab:
+ /* YYABORT comes here. */
+
+ /* Flush out yy_current_buffer before next parse. Since there is
+ no error recovery, the buffer could still contain tokens from this
+ parse. */
+ yyflush_current_buffer();
+
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 1;
+}
+//#line 257 "ETCL/ETCL.yy"
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.cpp.diff b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.cpp.diff
new file mode 100644
index 00000000000..fe123111232
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.cpp.diff
@@ -0,0 +1,607 @@
+--- bison_gen\ETCL_y.cpp 2005-07-19 09:56:06.368807400 -0700
++++ ETCL_y.cpp 2005-07-19 09:45:00.160274900 -0700
+@@ -1,5 +1,6 @@
++// $Id$
+
+-/* A Bison parser, made from ETCL.yy
++/* A Bison parser, made from ETCL/ETCL.yy
+ by GNU Bison version 1.28 */
+
+ #define YYBISON 1 /* Identify Bison output. */
+@@ -48,9 +49,9 @@
+ #define TAO_ETCL_TYPE_ID 298
+ #define TAO_ETCL_REPOS_ID 299
+
+-#line 1 "ETCL.yy"
++//#line 1 "ETCL/ETCL.yy"
+
+-// ETCL.yy,v 1.3 2002/01/14 19:52:28 parsons Exp
++// $Id$
+ // ========================================================================
+ //
+ // = LIBRARY
+@@ -70,6 +71,7 @@
+ #include "ETCL_Interpreter.h"
+
+ extern int yylex (void);
++extern void yyflush_current_buffer (void);
+
+ static void yyerror (const char *)
+ {
+@@ -77,9 +79,6 @@
+ // Ignore error messages
+ }
+
+-#ifndef YYSTYPE
+-#define YYSTYPE int
+-#endif
+ #include <stdio.h>
+
+ #ifndef __cplusplus
+@@ -293,8 +292,9 @@
+ -1, -1, 29, 3, 4, 5, 6, 7, 8, -1,
+ -1, -1, -1, 40, 49, 50, 51, 52, 53, 54
+ };
+-/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
+-#line 3 "/usr/local/share/bison.simple"
++/* -*-C-*- Note some compilers choke on comments on `//#line' lines. */
++//#line 3 "/pkg/gnu/share/bison.simple"
++/* This file comes from bison-1.28. */
+
+ /* Skeleton output parser for bison,
+ Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
+@@ -311,46 +311,66 @@
+
+ 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
++ 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. */
+
+-#ifndef alloca
++/* 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 YYSTACK_USE_ALLOCA
++#ifdef alloca
++#define YYSTACK_USE_ALLOCA
++#else /* alloca not defined */
+ #ifdef __GNUC__
++#define YYSTACK_USE_ALLOCA
+ #define alloca __builtin_alloca
+ #else /* not GNU C. */
+-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
++#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
++#define YYSTACK_USE_ALLOCA
+ #include <alloca.h>
+ #else /* not sparc */
+-#if defined (MSDOS) && !defined (__TURBOC__)
++/* 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)
+-#include <malloc.h>
++/* 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
+-#else /* not MSDOS, __TURBOC__, or _AIX */
+-#ifdef __hpux
+-#ifdef __cplusplus
+-extern "C" {
+-void *alloca (unsigned int);
+-};
+-#else /* not __cplusplus */
+-void *alloca ();
+-#endif /* not __cplusplus */
++#define 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 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 /* not sparc */
++#endif /* not GNU C */
++#endif /* alloca not defined */
++#endif /* YYSTACK_USE_ALLOCA not defined */
+
+-/* 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. */
++#ifdef YYSTACK_USE_ALLOCA
++#define YYSTACK_ALLOC alloca
++#else
++#define 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
+@@ -360,8 +380,8 @@
+ #define yyclearin (yychar = YYEMPTY)
+ #define YYEMPTY -2
+ #define YYEOF 0
+-#define YYACCEPT return(0)
+-#define YYABORT return(1)
++#define YYACCEPT goto yyacceptlab
++#define YYABORT goto yyabortlab
+ #define YYERROR goto yyerrlab1
+ /* Like YYERROR except do call yyerror.
+ This remains here temporarily to ease the
+@@ -411,6 +431,10 @@
+ int yychar; /* the lookahead symbol */
+ YYSTYPE yylval; /* the semantic value of the */
+ /* lookahead symbol */
++YYSTYPE yyval; /* the variable used to return */
++ /* semantic values from the action */
++ /* routines */
++
+
+ #ifdef YYLSP_NEEDED
+ YYLTYPE yylloc; /* location data for the lookahead */
+@@ -443,11 +467,11 @@
+ #define YYMAXDEPTH 10000
+ #endif
+
+-/* Prevent warning if -Wstrict-prototypes. */
+-#ifdef __GNUC__
+-int yyparse (void);
+-#endif
+-
++/* Define __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 __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
+ #else /* not GNU C or C++ */
+@@ -459,7 +483,7 @@
+ __yy_memcpy (to, from, count)
+ char *to;
+ char *from;
+- int count;
++ unsigned int count;
+ {
+ register char *f = from;
+ register char *t = to;
+@@ -474,10 +498,10 @@
+ /* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+ static void
+-__yy_memcpy (char *to, char *from, int count)
++__yy_memcpy (char *to, char *from, unsigned int count)
+ {
+- register char *f = from;
+ register char *t = to;
++ register char *f = from;
+ register int i = count;
+
+ while (i-- > 0)
+@@ -486,8 +510,8 @@
+
+ #endif
+ #endif
+-
+-#line 196 "/usr/local/share/bison.simple"
++
++//#line 217 "/pkg/gnu/share/bison.simple"
+
+ /* The user can define YYPARSE_PARAM as the name of an argument to be passed
+ into yyparse. The argument should have type void *.
+@@ -508,6 +532,15 @@
+ #define YYPARSE_PARAM_DECL
+ #endif /* not YYPARSE_PARAM */
+
++/* Prevent warning if -Wstrict-prototypes. */
++#ifdef __GNUC__
++#ifdef YYPARSE_PARAM
++int yyparse (void *);
++#else
++int yyparse (void);
++#endif
++#endif
++
+ int
+ yyparse(YYPARSE_PARAM_ARG)
+ YYPARSE_PARAM_DECL
+@@ -536,6 +569,7 @@
+ #endif
+
+ int yystacksize = YYINITDEPTH;
++ int yyfree_stacks = 0;
+
+ #ifdef YYPURE
+ int yychar;
+@@ -546,10 +580,6 @@
+ #endif
+ #endif
+
+- YYSTYPE yyval; /* the variable used to return */
+- /* semantic values from the action */
+- /* routines */
+-
+ int yylen;
+
+ #if YYDEBUG != 0
+@@ -620,18 +650,32 @@
+ if (yystacksize >= YYMAXDEPTH)
+ {
+ yyerror("parser stack overflow");
++ if (yyfree_stacks)
++ {
++ free (yyss);
++ free (yyvs);
++#ifdef YYLSP_NEEDED
++ free (yyls);
++#endif
++ }
+ return 2;
+ }
+ yystacksize *= 2;
+ if (yystacksize > YYMAXDEPTH)
+ yystacksize = YYMAXDEPTH;
+- yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
+- __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
+- yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
+- __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
++#ifndef YYSTACK_USE_ALLOCA
++ yyfree_stacks = 1;
++#endif
++ yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
++ __yy_memcpy ((char *)yyss, (char *)yyss1,
++ size * (unsigned int) sizeof (*yyssp));
++ yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
++ __yy_memcpy ((char *)yyvs, (char *)yyvs1,
++ size * (unsigned int) sizeof (*yyvsp));
+ #ifdef YYLSP_NEEDED
+- yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
+- __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
++ yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
++ __yy_memcpy ((char *)yyls, (char *)yyls1,
++ size * (unsigned int) sizeof (*yylsp));
+ #endif
+ #endif /* no yyoverflow */
+
+@@ -792,225 +836,225 @@
+ switch (yyn) {
+
+ case 3:
+-#line 97 "ETCL.yy"
++//#line 97 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Preference (TAO_ETCL_MIN, yyvsp[0].constraint); ;
+ break;}
+ case 4:
+-#line 99 "ETCL.yy"
++//#line 99 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Preference (TAO_ETCL_MAX, yyvsp[0].constraint); ;
+ break;}
+ case 5:
+-#line 101 "ETCL.yy"
++//#line 101 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Preference (TAO_ETCL_WITH, yyvsp[0].constraint); ;
+ break;}
+ case 6:
+-#line 103 "ETCL.yy"
++//#line 103 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Preference (TAO_ETCL_FIRST); ;
+ break;}
+ case 7:
+-#line 105 "ETCL.yy"
++//#line 105 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Preference (TAO_ETCL_RANDOM); ;
+ break;}
+ case 8:
+-#line 109 "ETCL.yy"
++//#line 109 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_OR, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 10:
+-#line 114 "ETCL.yy"
++//#line 114 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_AND, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 12:
+-#line 119 "ETCL.yy"
++//#line 119 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_EQ, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 13:
+-#line 121 "ETCL.yy"
++//#line 121 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_NE, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 14:
+-#line 123 "ETCL.yy"
++//#line 123 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_GT, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 15:
+-#line 125 "ETCL.yy"
++//#line 125 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_GE, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 16:
+-#line 127 "ETCL.yy"
++//#line 127 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_LT, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 17:
+-#line 129 "ETCL.yy"
++//#line 129 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_LE, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 19:
+-#line 134 "ETCL.yy"
++//#line 134 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_IN, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 20:
+-#line 136 "ETCL.yy"
++//#line 136 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_IN, yyvsp[-3].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 22:
+-#line 141 "ETCL.yy"
++//#line 141 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_TWIDDLE, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 24:
+-#line 146 "ETCL.yy"
++//#line 146 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_PLUS, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 25:
+-#line 148 "ETCL.yy"
++//#line 148 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_MINUS, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 27:
+-#line 153 "ETCL.yy"
++//#line 153 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_MULT, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 28:
+-#line 155 "ETCL.yy"
++//#line 155 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Binary_Expr (TAO_ETCL_DIV, yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 30:
+-#line 160 "ETCL.yy"
++//#line 160 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Unary_Expr (TAO_ETCL_NOT, yyvsp[0].constraint); ;
+ break;}
+ case 32:
+-#line 165 "ETCL.yy"
++//#line 165 "ETCL/ETCL.yy"
+ { yyval.constraint = yyvsp[-1].constraint; ;
+ break;}
+ case 33:
+-#line 167 "ETCL.yy"
++//#line 167 "ETCL/ETCL.yy"
+ { yyval.constraint = yyvsp[0].constraint; ;
+ break;}
+ case 34:
+-#line 169 "ETCL.yy"
++//#line 169 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Unary_Expr (TAO_ETCL_PLUS, yyvsp[0].constraint); ;
+ break;}
+ case 35:
+-#line 171 "ETCL.yy"
++//#line 171 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Unary_Expr (TAO_ETCL_MINUS, yyvsp[0].constraint); ;
+ break;}
+ case 36:
+-#line 173 "ETCL.yy"
++//#line 173 "ETCL/ETCL.yy"
+ { yyval.constraint = yyvsp[0].constraint; ;
+ break;}
+ case 37:
+-#line 175 "ETCL.yy"
++//#line 175 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Unary_Expr (TAO_ETCL_PLUS, yyvsp[0].constraint); ;
+ break;}
+ case 38:
+-#line 177 "ETCL.yy"
++//#line 177 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Unary_Expr (TAO_ETCL_MINUS, yyvsp[0].constraint); ;
+ break;}
+ case 39:
+-#line 179 "ETCL.yy"
++//#line 179 "ETCL/ETCL.yy"
+ { yyval.constraint = yyvsp[0].constraint; ;
+ break;}
+ case 40:
+-#line 181 "ETCL.yy"
++//#line 181 "ETCL/ETCL.yy"
+ { yyval.constraint = yyvsp[0].constraint; ;
+ break;}
+ case 41:
+-#line 183 "ETCL.yy"
++//#line 183 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Exist (yyvsp[0].constraint); ;
+ break;}
+ case 42:
+-#line 185 "ETCL.yy"
++//#line 185 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Exist (yyvsp[0].constraint); ;
+ break;}
+ case 43:
+-#line 187 "ETCL.yy"
++//#line 187 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Default (yyvsp[0].constraint); ;
+ break;}
+ case 44:
+-#line 189 "ETCL.yy"
++//#line 189 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Eval (yyvsp[0].constraint); ;
+ break;}
+ case 45:
+-#line 191 "ETCL.yy"
++//#line 191 "ETCL/ETCL.yy"
+ { yyval.constraint = yyvsp[0].constraint; ;
+ break;}
+ case 46:
+-#line 195 "ETCL.yy"
++//#line 195 "ETCL/ETCL.yy"
+ { yyval.constraint = 0; ;
+ break;}
+ case 47:
+-#line 197 "ETCL.yy"
++//#line 197 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Dot (yyvsp[0].constraint); ;
+ break;}
+ case 48:
+-#line 200 "ETCL.yy"
++//#line 200 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Component (yyvsp[-1].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 51:
+-#line 207 "ETCL.yy"
++//#line 207 "ETCL/ETCL.yy"
+ { yyval.constraint = 0; ;
+ break;}
+ case 52:
+-#line 209 "ETCL.yy"
++//#line 209 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Dot (yyvsp[0].constraint); ;
+ break;}
+ case 55:
+-#line 216 "ETCL.yy"
++//#line 216 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Component (yyvsp[-1].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 56:
+-#line 218 "ETCL.yy"
++//#line 218 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Special (TAO_ETCL_LENGTH); ;
+ break;}
+ case 57:
+-#line 220 "ETCL.yy"
++//#line 220 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Special (TAO_ETCL_DISCRIMINANT); ;
+ break;}
+ case 58:
+-#line 222 "ETCL.yy"
++//#line 222 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Special (TAO_ETCL_TYPE_ID); ;
+ break;}
+ case 59:
+-#line 224 "ETCL.yy"
++//#line 224 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Special (TAO_ETCL_REPOS_ID); ;
+ break;}
+ case 62:
+-#line 230 "ETCL.yy"
++//#line 230 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Component_Array (yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 63:
+-#line 234 "ETCL.yy"
++//#line 234 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Component_Assoc (yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 64:
+-#line 238 "ETCL.yy"
++//#line 238 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Component_Pos (yyvsp[-1].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 65:
+-#line 242 "ETCL.yy"
++//#line 242 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Union_Pos (yyvsp[-2].constraint, yyvsp[0].constraint); ;
+ break;}
+ case 66:
+-#line 246 "ETCL.yy"
++//#line 246 "ETCL/ETCL.yy"
+ { yyval.constraint = 0; ;
+ break;}
+ case 67:
+-#line 248 "ETCL.yy"
++//#line 248 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Union_Value (+1, yyvsp[0].constraint); ;
+ break;}
+ case 68:
+-#line 250 "ETCL.yy"
++//#line 250 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Union_Value (+1, yyvsp[0].constraint); ;
+ break;}
+ case 69:
+-#line 252 "ETCL.yy"
++//#line 252 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Union_Value (-1, yyvsp[0].constraint); ;
+ break;}
+ case 70:
+-#line 254 "ETCL.yy"
++//#line 254 "ETCL/ETCL.yy"
+ { yyval.constraint = new TAO_ETCL_Union_Value (yyvsp[0].constraint); ;
+ break;}
+ }
+ /* the action file gets copied in in place of this dollarsign */
+-#line 498 "/usr/local/share/bison.simple"
+-
++//#line 543 "/pkg/gnu/share/bison.simple"
++
+ yyvsp -= yylen;
+ yyssp -= yylen;
+ #ifdef YYLSP_NEEDED
+@@ -1204,7 +1248,37 @@
+
+ yystate = yyn;
+ goto yynewstate;
++
++ yyacceptlab:
++ /* YYACCEPT comes here. */
++ if (yyfree_stacks)
++ {
++ free (yyss);
++ free (yyvs);
++#ifdef YYLSP_NEEDED
++ free (yyls);
++#endif
++ }
++ return 0;
++
++ yyabortlab:
++ /* YYABORT comes here. */
++
++ /* Flush out yy_current_buffer before next parse. Since there is
++ no error recovery, the buffer could still contain tokens from this
++ parse. */
++ yyflush_current_buffer();
++
++ if (yyfree_stacks)
++ {
++ free (yyss);
++ free (yyvs);
++#ifdef YYLSP_NEEDED
++ free (yyls);
++#endif
++ }
++ return 1;
+ }
+-#line 257 "ETCL.yy"
++//#line 257 "ETCL/ETCL.yy"
+
+
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.h b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.h
new file mode 100644
index 00000000000..ce37c579583
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.h
@@ -0,0 +1,45 @@
+// $Id$
+#define TAO_ETCL_GT 257
+#define TAO_ETCL_GE 258
+#define TAO_ETCL_LT 259
+#define TAO_ETCL_LE 260
+#define TAO_ETCL_EQ 261
+#define TAO_ETCL_NE 262
+#define TAO_ETCL_EXIST 263
+#define TAO_ETCL_DEFAULT 264
+#define TAO_ETCL_AND 265
+#define TAO_ETCL_OR 266
+#define TAO_ETCL_NOT 267
+#define TAO_ETCL_IN 268
+#define TAO_ETCL_TWIDDLE 269
+#define TAO_ETCL_BOOLEAN 270
+#define TAO_ETCL_PLUS 271
+#define TAO_ETCL_MINUS 272
+#define TAO_ETCL_MULT 273
+#define TAO_ETCL_DIV 274
+#define TAO_ETCL_UMINUS 275
+#define TAO_ETCL_INTEGER 276
+#define TAO_ETCL_FLOAT 277
+#define TAO_ETCL_STRING 278
+#define TAO_ETCL_RPAREN 279
+#define TAO_ETCL_LPAREN 280
+#define TAO_ETCL_RBRA 281
+#define TAO_ETCL_LBRA 282
+#define TAO_ETCL_IDENT 283
+#define TAO_ETCL_UNSIGNED 284
+#define TAO_ETCL_SIGNED 285
+#define TAO_ETCL_DOUBLE 286
+#define TAO_ETCL_CONSTRAINT 287
+#define TAO_ETCL_COMPONENT 288
+#define TAO_ETCL_WITH 289
+#define TAO_ETCL_MAX 290
+#define TAO_ETCL_MIN 291
+#define TAO_ETCL_FIRST 292
+#define TAO_ETCL_RANDOM 293
+#define TAO_ETCL_DOLLAR 294
+#define TAO_ETCL_DOT 295
+#define TAO_ETCL_DISCRIMINANT 296
+#define TAO_ETCL_LENGTH 297
+#define TAO_ETCL_TYPE_ID 298
+#define TAO_ETCL_REPOS_ID 299
+
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.h.diff b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.h.diff
new file mode 100644
index 00000000000..85acf912763
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/ETCL_y.h.diff
@@ -0,0 +1,25 @@
+--- ETCL_y.h Mon Nov 12 16:07:25 2001
++++ ETCL_y.h.safe Thu Oct 11 20:53:13 2001
+@@ -1,7 +1,4 @@
+ // $Id$
+-#ifndef YYSTYPE
+-#define YYSTYPE int
+-#endif
+ #define TAO_ETCL_GT 257
+ #define TAO_ETCL_GE 258
+ #define TAO_ETCL_LT 259
+@@ -33,7 +30,7 @@
+ #define TAO_ETCL_SIGNED 285
+ #define TAO_ETCL_DOUBLE 286
+ #define TAO_ETCL_CONSTRAINT 287
+-#define TAO_ETCL_SEQUENCE 288
++#define TAO_ETCL_COMPONENT 288
+ #define TAO_ETCL_WITH 289
+ #define TAO_ETCL_MAX 290
+ #define TAO_ETCL_MIN 291
+@@ -46,5 +43,3 @@
+ #define TAO_ETCL_TYPE_ID 298
+ #define TAO_ETCL_REPOS_ID 299
+
+-
+-extern YYSTYPE yylval;
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/README b/TAO/orbsvcs/orbsvcs/ETCL/README
new file mode 100644
index 00000000000..dca67871f74
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/README
@@ -0,0 +1,12 @@
+# $Id$
+#
+# Implement an "Extended Trader Constraint Language" parser.
+# This language was defined as part of the Notification Service
+# [give URL] to define filtering constraints. It is in fact an
+# extension on the "Trader Constraint Language", using in the Trading
+# Service [URL] to constraint on user queries.
+#
+# Other services use the same language, including the Logging Service,
+# parts of the Fault Tolerance services and (in the future) TAO's
+# Real-time Event Service.
+#
diff --git a/TAO/orbsvcs/orbsvcs/ETCL/etcl_export.h b/TAO/orbsvcs/orbsvcs/ETCL/etcl_export.h
new file mode 100644
index 00000000000..5f78b57d789
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ETCL/etcl_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_ETCL_EXPORT_H
+#define TAO_ETCL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_ETCL_HAS_DLL)
+# define TAO_ETCL_HAS_DLL 0
+# endif /* ! TAO_ETCL_HAS_DLL */
+#else
+# if !defined (TAO_ETCL_HAS_DLL)
+# define TAO_ETCL_HAS_DLL 1
+# endif /* ! TAO_ETCL_HAS_DLL */
+#endif
+
+#if defined (TAO_ETCL_HAS_DLL) && (TAO_ETCL_HAS_DLL == 1)
+# if defined (TAO_ETCL_BUILD_DLL)
+# define TAO_ETCL_Export ACE_Proper_Export_Flag
+# define TAO_ETCL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_ETCL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_ETCL_BUILD_DLL */
+# define TAO_ETCL_Export ACE_Proper_Import_Flag
+# define TAO_ETCL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_ETCL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_ETCL_BUILD_DLL */
+#else /* TAO_ETCL_HAS_DLL == 1 */
+# define TAO_ETCL_Export
+# define TAO_ETCL_SINGLETON_DECLARATION(T)
+# define TAO_ETCL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_ETCL_HAS_DLL == 1 */
+
+#endif /* TAO_ETCL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Adapters.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_Adapters.cpp
new file mode 100644
index 00000000000..8813fee591c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Adapters.cpp
@@ -0,0 +1,19 @@
+// $Id$
+
+#include "orbsvcs/Event/ECG_Adapters.h"
+
+ACE_RCSID (Event,
+ ECG_Adapters,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ECG_Handler_Shutdown::~TAO_ECG_Handler_Shutdown (void)
+{
+}
+
+TAO_ECG_Dgram_Handler::~TAO_ECG_Dgram_Handler (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Adapters.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Adapters.h
new file mode 100644
index 00000000000..8c79e6415f6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Adapters.h
@@ -0,0 +1,79 @@
+// -*- C++ -*-
+
+/**
+ * @file ECG_Adapters.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@atdesk.com>
+ *
+ * Define interfaces ECG Receivers and Mcast and UDP handlers can use
+ * to communicate with each other.
+ * Use of these interfaces eliminates the coupling of specific
+ * Receivers on specific handlers, and vice versa.
+ *
+ */
+#ifndef TAO_ECG_ADAPTERS_H
+#define TAO_ECG_ADAPTERS_H
+#include /**/ "ace/pre.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+#include "orbsvcs/RtecUDPAdminC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Refcounted_Auto_Ptr.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_SOCK_Dgram;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ECG_Handler_Shutdown
+ *
+ * @brief Interface that should be implemented
+ * by multicast and udp handlers in EC gateways, so the
+ * handlers can be notified of shutdown (usually by Event Receivers).
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_Handler_Shutdown
+{
+public:
+
+ // Define virtual destructor to make sure we can delete derived
+ // objects through a pointer to TAO_ECG_Handler_Shutdown.
+ virtual ~TAO_ECG_Handler_Shutdown (void);
+ virtual int shutdown (void) = 0;
+};
+
+/**
+ * @class TAO_ECG_Dgram_Handler
+ *
+ * @brief Interface used by mcast/udp handlers to notify interested
+ * components (usually Event Receivers) that there is data
+ * available on the dgram for reading, and to query them about
+ * event type to mcast group mappings.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_Dgram_Handler
+{
+public:
+
+ virtual ~TAO_ECG_Dgram_Handler (void);
+
+ virtual int handle_input (ACE_SOCK_Dgram& dgram) = 0;
+
+ virtual void get_addr (const RtecEventComm::EventHeader& header,
+ RtecUDPAdmin::UDP_Addr_out addr
+ ACE_ENV_ARG_DECL) = 0;
+};
+
+typedef ACE_Refcounted_Auto_Ptr<TAO_ECG_Handler_Shutdown,
+ ACE_Null_Mutex> TAO_ECG_Refcounted_Handler;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_ECG_ADAPTERS_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Address_Server_Base.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Address_Server_Base.h
new file mode 100644
index 00000000000..2490b33d051
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Address_Server_Base.h
@@ -0,0 +1,42 @@
+// -*- C++ -*-
+/**
+ * @file ECG_Address_Server_Base.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak (marina@atdesk.com)
+ *
+ */
+
+#ifndef TAO_ECG_ADDRESS_SERVER_BASE_H
+#define TAO_ECG_ADDRESS_SERVER_BASE_H
+#include /**/ "ace/pre.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+#include "orbsvcs/RtecUDPAdminS.h"
+#include "orbsvcs/Event/EC_Lifetime_Utils.h"
+#include "ace/Auto_Ptr.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ECG_Address_Server_Base
+ *
+ * @brief All implementations of RtecUDPAdmin::AddrServer idl
+ * interface should inherit from this abstract base.
+ *
+ * Adds init () virtual method so that all AddrServer implementations can be
+ * initialized in the same fasion.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_Address_Server_Base
+ : public virtual POA_RtecUDPAdmin::AddrServer
+{
+public:
+
+ virtual int init (const char *arg) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_ECG_ADDRESS_SERVER_BASE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Receiver.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Receiver.cpp
new file mode 100644
index 00000000000..faf377fd386
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Receiver.cpp
@@ -0,0 +1,608 @@
+// $Id$
+
+#include "orbsvcs/Event/ECG_CDR_Message_Receiver.h"
+#include "orbsvcs/Event/ECG_CDR_Message_Sender.h"
+
+#include "tao/Exception.h"
+
+#include "ace/SOCK_Dgram.h"
+#include "ace/ACE.h"
+#include "ace/OS_NS_string.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_CDR_Message_Receiver.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Event,
+ ECG_CDR_Message_Receiver,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ECG_CDR_Processor::~TAO_ECG_CDR_Processor (void)
+{
+}
+// ****************************************************************
+
+TAO_ECG_UDP_Request_Entry::~TAO_ECG_UDP_Request_Entry (void)
+{
+ if (this->own_received_fragments_)
+ {
+ this->own_received_fragments_ = 0;
+ delete[] this->received_fragments_;
+ }
+}
+
+TAO_ECG_UDP_Request_Entry::
+TAO_ECG_UDP_Request_Entry (CORBA::Boolean byte_order,
+ CORBA::ULong request_id,
+ CORBA::ULong request_size,
+ CORBA::ULong fragment_count)
+ : byte_order_ (byte_order)
+ , request_id_ (request_id)
+ , request_size_ (request_size)
+ , fragment_count_ (fragment_count)
+{
+ ACE_CDR::grow (&this->payload_, this->request_size_);
+ this->payload_.wr_ptr (request_size_);
+
+ this->received_fragments_ = this->default_received_fragments_;
+ this->own_received_fragments_ = 0;
+ const int bits_per_ulong = sizeof(CORBA::ULong) * CHAR_BIT;
+ this->received_fragments_size_ =
+ this->fragment_count_ / bits_per_ulong + 1;
+ if (this->received_fragments_size_ > ECG_DEFAULT_FRAGMENT_BUFSIZ)
+ {
+ ACE_NEW (this->received_fragments_,
+ CORBA::ULong[this->received_fragments_size_]);
+ this->own_received_fragments_ = 1;
+ }
+
+ for (CORBA::ULong i = 0; i < this->received_fragments_size_; ++i)
+ this->received_fragments_[i] = 0;
+ CORBA::ULong idx = this->fragment_count_ / bits_per_ulong;
+ CORBA::ULong bit = this->fragment_count_ % bits_per_ulong;
+ this->received_fragments_[idx] = (0xFFFFFFFF << bit);
+}
+
+int
+TAO_ECG_UDP_Request_Entry::validate_fragment (CORBA::Boolean byte_order,
+ CORBA::ULong request_size,
+ CORBA::ULong fragment_size,
+ CORBA::ULong fragment_offset,
+ CORBA::ULong /* fragment_id */,
+ CORBA::ULong fragment_count) const
+{
+ if (byte_order != this->byte_order_
+ || request_size != this->request_size_
+ || fragment_count != this->fragment_count_)
+ return 0;
+
+ if (fragment_offset >= request_size
+ || fragment_offset + fragment_size > request_size)
+ return 0;
+
+ return 1;
+}
+
+int
+TAO_ECG_UDP_Request_Entry::test_received (CORBA::ULong fragment_id) const
+{
+ // Assume out-of-range fragments as received, so they are dropped...
+ if (fragment_id > this->fragment_count_)
+ return 1;
+
+ const int bits_per_ulong = sizeof(CORBA::ULong) * CHAR_BIT;
+ CORBA::ULong idx = fragment_id / bits_per_ulong;
+ CORBA::ULong bit = fragment_id % bits_per_ulong;
+ return ACE_BIT_ENABLED (this->received_fragments_[idx], 1<<bit);
+}
+
+void
+TAO_ECG_UDP_Request_Entry::mark_received (CORBA::ULong fragment_id)
+{
+ // Assume out-of-range fragments as received, so they are dropped...
+ if (fragment_id > this->fragment_count_)
+ return;
+
+ const int bits_per_ulong = sizeof(CORBA::ULong) * CHAR_BIT;
+ CORBA::ULong idx = fragment_id / bits_per_ulong;
+ CORBA::ULong bit = fragment_id % bits_per_ulong;
+ ACE_SET_BITS (this->received_fragments_[idx], 1<<bit);
+}
+
+int
+TAO_ECG_UDP_Request_Entry::complete (void) const
+{
+ for (CORBA::ULong i = 0;
+ i < this->received_fragments_size_;
+ ++i)
+ {
+ if (this->received_fragments_[i] != 0xFFFFFFFF)
+ return 0;
+ }
+ return 1;
+}
+
+char*
+TAO_ECG_UDP_Request_Entry::fragment_buffer (CORBA::ULong fragment_offset)
+{
+ return this->payload_.rd_ptr () + fragment_offset;
+}
+// ****************************************************************
+
+int
+TAO_ECG_CDR_Message_Receiver::Requests::init (size_t size,
+ size_t min_purge_count)
+{
+ // Already initialized.
+ if (this->fragmented_requests_)
+ return -1;
+
+ ACE_NEW_RETURN (this->fragmented_requests_,
+ TAO_ECG_UDP_Request_Entry*[size],
+ -1);
+
+ this->size_ = size;
+ this->id_range_low_ = 0;
+ this->id_range_high_ = size - 1;
+ this->min_purge_count_ = min_purge_count;
+
+ for (size_t i = 0; i < size; ++i)
+ {
+ this->fragmented_requests_[i] = 0;
+ }
+
+ return 0;
+}
+
+TAO_ECG_CDR_Message_Receiver::Requests::~Requests (void)
+{
+ for (size_t i = 0; i < this->size_; ++i)
+ {
+ TAO_ECG_UDP_Request_Entry* request =
+ this->fragmented_requests_[i];
+
+ if (request != &TAO_ECG_CDR_Message_Receiver::Request_Completed_)
+ delete request;
+ }
+
+ delete [] this->fragmented_requests_;
+
+ this->fragmented_requests_ = 0;
+ this->size_ = 0;
+ this->id_range_low_ = 0;
+ this->id_range_high_ = 0;
+}
+
+TAO_ECG_UDP_Request_Entry **
+TAO_ECG_CDR_Message_Receiver::Requests::get_request (CORBA::ULong request_id)
+{
+ if (request_id < this->id_range_low_)
+ // <request_id> is below the current range.
+ {
+ return 0;
+ }
+
+ if (request_id > this->id_range_high_)
+ // <request_id> is above the current range - need to shift the range
+ // to include it.
+ {
+ CORBA::ULong new_slots_needed = request_id - this->id_range_high_;
+
+ if (new_slots_needed < this->min_purge_count_)
+ new_slots_needed = this->min_purge_count_;
+
+ if (new_slots_needed > this->size_)
+ // Shifting the range by more than the size of array.
+ {
+ this->purge_requests (this->id_range_low_, this->id_range_high_);
+ this->id_range_high_ = request_id;
+ this->id_range_low_ = request_id - this->size_ + 1;
+ }
+ else
+ {
+ this->purge_requests (this->id_range_low_,
+ this->id_range_low_ + new_slots_needed - 1);
+ this->id_range_high_ += new_slots_needed;
+ this->id_range_low_ += new_slots_needed;
+ }
+ }
+
+ // Return array location for <request_id>.
+ int index = request_id % this->size_;
+ return this->fragmented_requests_ + index;
+}
+
+
+void
+TAO_ECG_CDR_Message_Receiver::Requests::purge_requests (
+ CORBA::ULong purge_first,
+ CORBA::ULong purge_last)
+{
+ for (CORBA::ULong i = purge_first; i <= purge_last; ++i)
+ {
+ size_t index = i % this->size_;
+ if (this->fragmented_requests_[index]
+ != &TAO_ECG_CDR_Message_Receiver::Request_Completed_)
+ {
+ delete this->fragmented_requests_[index];
+ }
+ this->fragmented_requests_[index] = 0;
+ }
+}
+
+// ****************************************************************
+
+TAO_ECG_UDP_Request_Entry
+TAO_ECG_CDR_Message_Receiver::Request_Completed_ (0, 0, 0, 0);
+
+int
+TAO_ECG_CDR_Message_Receiver::handle_input (
+ ACE_SOCK_Dgram& dgram,
+ TAO_ECG_CDR_Processor *cdr_processor)
+{
+ char nonaligned_header[TAO_ECG_CDR_Message_Sender::ECG_HEADER_SIZE
+ + ACE_CDR::MAX_ALIGNMENT];
+ char *header_buf = ACE_ptr_align_binary (nonaligned_header,
+ ACE_CDR::MAX_ALIGNMENT);
+
+ char nonaligned_data[ACE_MAX_DGRAM_SIZE + ACE_CDR::MAX_ALIGNMENT];
+ char *data_buf = ACE_ptr_align_binary (nonaligned_data,
+ ACE_CDR::MAX_ALIGNMENT);
+
+ // Read the message from dgram.
+
+ const int iovcnt = 2;
+ iovec iov[iovcnt];
+ iov[0].iov_base = header_buf;
+ iov[0].iov_len = TAO_ECG_CDR_Message_Sender::ECG_HEADER_SIZE;
+ iov[1].iov_base = data_buf;
+ iov[1].iov_len = ACE_MAX_DGRAM_SIZE;
+
+ ACE_INET_Addr from;
+ ssize_t n = dgram.recv (iov, iovcnt, from);
+
+ if (n == -1)
+ {
+ if (errno == EWOULDBLOCK)
+ return 0;
+
+ ACE_ERROR_RETURN ((LM_ERROR, "Error reading mcast fragment (%m).\n"),
+ -1);
+ }
+
+ if (n == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Trying to read mcast fragment: "
+ "read 0 bytes from socket.\n"),
+ 0);
+ }
+
+ if (n < TAO_ECG_CDR_Message_Sender::ECG_HEADER_SIZE)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Trying to read mcast fragment: "
+ "# of bytes read < mcast header size.\n"),
+ -1);
+ }
+
+ u_int crc = 0;
+
+ if (this->check_crc_)
+ {
+ iov[1].iov_len = n - iov[0].iov_len;
+ iov[0].iov_len -= 4; // don't include crc
+
+ crc = ACE::crc32 (iov, 2);
+ }
+ // Check whether the message is a loopback message.
+ if (this->ignore_from_.get () != 0
+ && this->ignore_from_->is_loopback (from))
+ {
+ return 0;
+ }
+
+ // Decode and validate mcast header.
+ Mcast_Header header;
+ if (header.read (header_buf, n, this->check_crc_) == -1)
+ return -1;
+
+ if ( this->check_crc_ && header.crc != crc)
+ {
+ static unsigned int err_count = 0;
+ ACE_ERROR ((LM_DEBUG,
+ "******************************\n"));
+
+ ACE_ERROR ((LM_DEBUG,
+ "ERROR DETECTED \n"));
+
+ if (crc == 0)
+ {
+ ACE_ERROR ((LM_DEBUG,
+ "Sending process may not have computed CRC \n"));
+ }
+ else
+ {
+ ACE_ERROR ((LM_DEBUG,
+ " NETWORK CRC CHECKSUM FAILED\n"));
+ }
+
+ ACE_ERROR ((LM_ERROR,
+ "Message was received from [%s:%s:%d] \n",
+ from.get_host_name (),
+ from.get_host_addr (),
+ from.get_port_number()));
+
+ ACE_ERROR ((LM_ERROR,
+ "Num errors = %d \n",
+ ++err_count));
+ ACE_ERROR ((LM_ERROR,
+ "This is a bad thing. Attempting to ignore ..\n"));
+
+ return 0;
+ }
+
+ // Process received data.
+ if (header.fragment_count == 1)
+ {
+ // Update <request_map_> to mark this request as completed. (Not
+ // needed if we don't care about duplicates.)
+ int result = this->mark_received (from, header.request_id);
+ if (result != 1)
+ return result;
+
+ TAO_InputCDR cdr (data_buf, header.request_size, header.byte_order);
+ if (cdr_processor->decode (cdr) == -1)
+ return -1;
+ else
+ return 1;
+ }
+
+ return this->process_fragment (from, header, data_buf, cdr_processor);
+}
+
+int
+TAO_ECG_CDR_Message_Receiver::mark_received (const ACE_INET_Addr &from,
+ CORBA::ULong request_id)
+{
+ // ACE_GUARD_RETURN (ACE_Lock, guard, *this->lock_, -1);
+
+ Request_Map::ENTRY * entry = this->get_source_entry (from);
+ if (!entry)
+ return -1;
+
+ TAO_ECG_UDP_Request_Entry ** request =
+ entry->int_id_->get_request (request_id);
+
+ if (request == 0)
+ {
+ ACE_DEBUG ((LM_WARNING, "Received mcast request with sequence"
+ "below currently expected range.\n"));
+ return 0;
+ }
+ if (*request == &Request_Completed_)
+ {
+ ACE_DEBUG ((LM_INFO, "Received duplicate mcast fragment. "
+ "(Request already complete).\n"));
+ return 0;
+ }
+ if (*request != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Inconsistent fragments for "
+ "mcast request.\n"),
+ -1);
+ }
+
+ *request = &Request_Completed_;
+ return 1;
+}
+
+int
+TAO_ECG_CDR_Message_Receiver::process_fragment (
+ const ACE_INET_Addr &from,
+ const Mcast_Header &header,
+ char * data_buf,
+ TAO_ECG_CDR_Processor *cdr_processor)
+{
+ // ACE_GUARD_RETURN (ACE_Lock, guard, *this->lock_, -1);
+
+ Request_Map::ENTRY * source_entry = this->get_source_entry (from);
+ if (!source_entry)
+ return -1;
+
+ TAO_ECG_UDP_Request_Entry ** request =
+ source_entry->int_id_->get_request (header.request_id);
+
+ if (request == 0)
+ {
+ ACE_DEBUG ((LM_WARNING, "Received mcast request with sequence "
+ "below currently expected range.\n"));
+ return 0;
+ }
+ if (*request == &Request_Completed_)
+ {
+ ACE_DEBUG ((LM_INFO, "Received duplicate mcast fragment. "
+ "(Request already complete).\n"));
+ return 0;
+ }
+ if (*request == 0)
+ // Entry for this request has not yet been allocated.
+ {
+ ACE_NEW_RETURN (*request,
+ TAO_ECG_UDP_Request_Entry (header.byte_order,
+ header.request_id,
+ header.request_size,
+ header.fragment_count),
+ -1);
+ }
+
+ // Validate the fragment.
+ if ((*request)->validate_fragment (header.byte_order,
+ header.request_size,
+ header.fragment_size,
+ header.fragment_offset,
+ header.fragment_id,
+ header.fragment_count) == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Received invalid mcast fragment.\n"),
+ -1);
+ }
+
+ // Check whether this fragment was already received.
+ if ((*request)->test_received (header.fragment_id) == 1)
+ {
+ ACE_DEBUG ((LM_INFO, "Received duplicate mcast fragment.\n"));
+ return 0;
+ }
+
+ // Add the fragment to the request entry.
+ (*request)->mark_received (header.fragment_id);
+ ACE_OS::memcpy ((*request)->fragment_buffer (header.fragment_offset),
+ data_buf,
+ header.fragment_size);
+
+ // The request is not yet complete.
+ if (!(*request)->complete ())
+ {
+ return 0;
+ }
+
+ // The request is complete - decode it.
+ TAO_InputCDR cdr ((*request)->fragment_buffer (0),
+ header.request_size,
+ header.byte_order);
+
+ if (cdr_processor->decode (cdr) == -1)
+ return -1;
+
+ delete *request;
+ *request = &Request_Completed_;
+ return 1;
+}
+
+TAO_ECG_CDR_Message_Receiver::Request_Map::ENTRY*
+TAO_ECG_CDR_Message_Receiver::get_source_entry (const ACE_INET_Addr &from)
+{
+ // Get the entry for <from> from the <request_map_>.
+ Request_Map::ENTRY * entry;
+
+ if (this->request_map_.find (from, entry) == -1)
+ {
+ // Create an entry if one doesn't exist.
+ Requests *requests = 0;
+ ACE_NEW_RETURN (requests,
+ Requests,
+ 0);
+ auto_ptr<Requests> requests_aptr (requests);
+
+ if (requests->init (this->max_requests_, this->min_purge_count_) == -1
+ || this->request_map_.bind (from, requests, entry) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Unable to create hash map "
+ "entry for a new request.\n"),
+ 0);
+ }
+ requests_aptr.release ();
+ }
+
+ return entry;
+}
+
+void
+TAO_ECG_CDR_Message_Receiver::shutdown (void)
+{
+ // ACE_GUARD (ACE_Lock, guard, *this->lock_);
+
+ Request_Map::iterator end = this->request_map_.end ();
+ for (Request_Map::iterator i = this->request_map_.begin ();
+ i != end;
+ ++i)
+ {
+ delete (*i).int_id_;
+ (*i).int_id_ = 0;
+ }
+
+ this->ignore_from_.reset ();
+}
+
+// ****************************************************************
+int
+TAO_ECG_CDR_Message_Receiver::Mcast_Header::read (char *header,
+ size_t bytes_received,
+ CORBA::Boolean checkcrc)
+{
+ // Decode.
+ this->byte_order = header[0];
+ if(this->byte_order != 0 && this->byte_order != 1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Reading mcast packet header: byte "
+ "order is neither 0 nor 1, it is %d.\n",
+ this->byte_order),
+ -1);
+ }
+
+ TAO_InputCDR header_cdr (header,
+ TAO_ECG_CDR_Message_Sender::ECG_HEADER_SIZE,
+ byte_order);
+ CORBA::Boolean unused;
+ CORBA::Octet a, b, c;
+ if (!header_cdr.read_boolean (unused)
+ || !header_cdr.read_octet (a)
+ || !header_cdr.read_octet (b)
+ || !header_cdr.read_octet (c)
+ || a != 'A' || b != 'B' || c != 'C')
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Error reading magic bytes "
+ "in mcast packet header.\n"),
+ -1);
+ }
+
+ if (!header_cdr.read_ulong (this->request_id)
+ || !header_cdr.read_ulong (this->request_size)
+ || !header_cdr.read_ulong (this->fragment_size)
+ || !header_cdr.read_ulong (this->fragment_offset)
+ || !header_cdr.read_ulong (this->fragment_id)
+ || !header_cdr.read_ulong (this->fragment_count))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error decoding mcast packet header.\n"),
+ -1);
+ }
+
+ if (checkcrc)
+ {
+ CORBA::Octet padding[4];
+ header_cdr.read_octet_array (padding, 4);
+
+ unsigned char *crcparts = (unsigned char *)(&this->crc);
+
+ for (int cnt=0; cnt != 4; ++cnt)
+ {
+ crcparts[cnt] = padding[cnt];
+ }
+
+ this->crc = ntohl (this->crc);
+ }
+
+ // Validate.
+ size_t data_bytes_received =
+ bytes_received - TAO_ECG_CDR_Message_Sender::ECG_HEADER_SIZE;
+
+ if (this->request_size < this->fragment_size
+ || this->fragment_offset >= this->request_size
+ || this->fragment_id >= this->fragment_count
+ || (this->fragment_count == 1
+ && (this->fragment_size != this->request_size
+ || this->request_size != data_bytes_received)))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Invalid mcast fragment: "
+ "inconsistent header fields.\n"),
+ -1);
+ }
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Receiver.h b/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Receiver.h
new file mode 100644
index 00000000000..8159a4e2f15
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Receiver.h
@@ -0,0 +1,318 @@
+// -*- C++ -*-
+/**
+ * @file ECG_CDR_Message_Receiver.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ * @author Marina Spivak (marina@atdesk.com)
+ */
+
+#ifndef TAO_ECG_CDR_MESSAGE_RECEIVER_H
+#define TAO_ECG_CDR_MESSAGE_RECEIVER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/ECG_UDP_Out_Endpoint.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/CDR.h"
+#include "tao/Environment.h"
+
+#include "ace/Hash_Map_Manager.h"
+#include "ace/INET_Addr.h"
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ECG_CDR_Processor
+ *
+ * @brief Interface for callback objects used by
+ * TAO_ECG_CDR_Message_Receiver to propagate received data to
+ * its callers.
+ */
+class TAO_ECG_CDR_Processor
+{
+public:
+ virtual ~TAO_ECG_CDR_Processor (void);
+
+ /// Extracts data from <cdr>. Returns 0 on success, -1 on error.
+ virtual int decode (TAO_InputCDR &cdr) = 0;
+};
+
+// ****************************************************************
+/**
+ * @class TAO_ECG_UDP_Request_Entry
+ *
+ * @brief Keeps information about an incomplete request.
+ *
+ * When a request arrives in fragments this object is used to
+ * keep track of the incoming data.
+ */
+class TAO_ECG_UDP_Request_Entry
+{
+public:
+ enum {
+ ECG_DEFAULT_FRAGMENT_BUFSIZ = 8
+ };
+
+ /// Initialize the fragment, allocating memory, etc.
+ TAO_ECG_UDP_Request_Entry (CORBA::Boolean byte_order,
+ CORBA::ULong request_id,
+ CORBA::ULong request_size,
+ CORBA::ULong fragment_count);
+
+ ~TAO_ECG_UDP_Request_Entry (void);
+
+ /// Validate a fragment, it should be rejected if it is invalid..
+ int validate_fragment (CORBA::Boolean byte_order,
+ CORBA::ULong request_size,
+ CORBA::ULong fragment_size,
+ CORBA::ULong fragment_offset,
+ CORBA::ULong fragment_id,
+ CORBA::ULong fragment_count) const;
+
+ /// Has @a fragment_id been received?
+ int test_received (CORBA::ULong fragment_id) const;
+
+ /// Mark @a fragment_id as received, reset timeout counter...
+ void mark_received (CORBA::ULong fragment_id);
+
+ /// Is the message complete?
+ int complete (void) const;
+
+ /// Return a buffer for the fragment at offset @a fragment_offset
+ char* fragment_buffer (CORBA::ULong fragment_offset);
+
+private:
+
+ TAO_ECG_UDP_Request_Entry (const TAO_ECG_UDP_Request_Entry & rhs);
+ TAO_ECG_UDP_Request_Entry& operator= (const TAO_ECG_UDP_Request_Entry & rhs);
+
+private:
+ /// This attributes should remain constant in all the fragments, used
+ /// for validation....
+ CORBA::Boolean byte_order_;
+ CORBA::ULong request_id_;
+ CORBA::ULong request_size_;
+ CORBA::ULong fragment_count_;
+
+ ACE_Message_Block payload_;
+
+ /// This is a bit vector, used to keep track of the received buffers.
+ CORBA::ULong* received_fragments_;
+ int own_received_fragments_;
+ CORBA::ULong received_fragments_size_;
+ CORBA::ULong default_received_fragments_[ECG_DEFAULT_FRAGMENT_BUFSIZ];
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_ECG_CDR_Message_Receiver
+ *
+ * @brief Receives UDP and Multicast messages.
+ *
+ * @todo Update class documentation below.
+ *
+ * 5) Make status array size and purge_count configurable.
+ *
+ * This class receives UDP and Multicast message fragments, assembles
+ * them (described in detail below), and passes complete messages
+ * in the form of cdr streams to the calling classes.
+ *
+ * This class is used by various Gateway classes (Senders/Receivers)
+ * responsible for federating Event Channels with UDP/Mcast.
+ *
+ * = REASSEMBLY
+ * Fragmentation is described in ECG_CDR_Message_Sender.h
+ * Whenever an incomplete fragment is received (one with
+ * fragment_count > 1) we allocate an entry for the message in an
+ * map indexed by (host,port,request_id). The entry contains the
+ * buffer, a bit vector to keep track of the fragments received
+ * so far, and a timeout counter. This timeout counter is set to
+ * 0 on each (new) fragment arrival, and incremented on a regular
+ * basis. If the counter reaches a maximum value the message is
+ * dropped.
+ * Once all the fragments have been received the message is sent
+ * up to the calling classes, and the memory reclaimed.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_CDR_Message_Receiver
+{
+public:
+ /// Initialization and termination methods.
+ //@{
+ TAO_ECG_CDR_Message_Receiver (CORBA::Boolean check_crc);
+ ~TAO_ECG_CDR_Message_Receiver (void);
+
+ /**
+ * @param ignore_from Endpoint used to remove events generated by
+ * the same process.
+ */
+ void init (TAO_ECG_Refcounted_Endpoint ignore_from
+ /* , ACE_Lock *lock = 0 */);
+
+ // Shutdown the component: close down the request map, etc.
+ void shutdown (void);
+ //@}
+
+ /// Main method: read the data from @a dgram and either pass ready data
+ /// to @a cdr_processor or update the <request_map_> if the request
+ /// is not yet complete.
+ /**
+ * Returns 1 if data was read successfully and accepted by
+ * <cdr_processor> without errors.
+ * Returns 0 if there were no errors, but no data has been passed to
+ * <cdr_processor>, either due to request being incomplete (not all
+ * fragments received), or it being a duplicate.
+ * Returns -1 if there were errors.
+ */
+ int handle_input (ACE_SOCK_Dgram& dgram,
+ TAO_ECG_CDR_Processor *cdr_processor);
+
+ /// Represents any request that has been fully received and
+ /// serviced, to simplify the internal logic.
+ static TAO_ECG_UDP_Request_Entry Request_Completed_;
+
+private:
+
+ enum {
+ ECG_DEFAULT_MAX_FRAGMENTED_REQUESTS = 1024,
+ ECG_DEFAULT_FRAGMENTED_REQUESTS_MIN_PURGE_COUNT = 32
+ };
+
+ struct Mcast_Header;
+ class Requests;
+
+ typedef ACE_Hash_Map_Manager<ACE_INET_Addr,
+ Requests*,
+ ACE_Null_Mutex> Request_Map;
+
+private:
+
+ /// Returns 1 on success, 0 if <request_id> has already been
+ /// received or is below current request range, and -1 on error.
+ int mark_received (const ACE_INET_Addr &from,
+ CORBA::ULong request_id);
+
+ /// Returns 1 if complete request is received and <event> is
+ /// populated, 0 if request has only partially been received or is a
+ /// duplicate, and -1 on error.
+ int process_fragment (const ACE_INET_Addr &from,
+ const Mcast_Header &header,
+ char * data_buf,
+ TAO_ECG_CDR_Processor *cdr_processor);
+
+
+ Request_Map::ENTRY* get_source_entry (const ACE_INET_Addr &from);
+
+private:
+
+ /// Ignore any events coming from this IP address.
+ TAO_ECG_Refcounted_Endpoint ignore_from_;
+
+ /// The map containing all the incoming requests which have been
+ /// partially received.
+ Request_Map request_map_;
+
+ /// Serializes use of <request_map_>.
+ // ACE_Lock* lock_;
+
+ /// Size of a fragmented requests array, i.e., max number of
+ /// partially received requests kept at any given time per source.
+ size_t max_requests_;
+
+ /// Minimum number of requests purged from a fragmented requests
+ /// array when the range of requests represented there needs to be
+ /// shifted.
+ size_t min_purge_count_;
+
+ /// Flag to indicate whether CRC should be computed and checked.
+ CORBA::Boolean check_crc_;
+};
+
+// ****************************************************************
+
+/// Helper for decoding, validating and storing mcast header.
+struct TAO_ECG_CDR_Message_Receiver::Mcast_Header
+{
+ int byte_order;
+ CORBA::ULong request_id;
+ CORBA::ULong request_size;
+ CORBA::ULong fragment_size;
+ CORBA::ULong fragment_offset;
+ CORBA::ULong fragment_id;
+ CORBA::ULong fragment_count;
+ CORBA::ULong crc;
+ int read (char * header,
+ size_t bytes_received,
+ CORBA::Boolean checkcrc = 0);
+};
+
+// ****************************************************************
+
+/// Once init() has been called:
+/// Invariant: id_range_high_- id_range_low_ == size_ - 1
+class TAO_ECG_CDR_Message_Receiver::Requests
+{
+public:
+
+ Requests (void);
+ ~Requests (void);
+
+ /// Allocates and initializes <fragmented_requests_>.
+ int init (size_t size, size_t min_purge_count);
+
+ /// Returns pointer to a <fragmented_requests_> element
+ /// representing <request_id>.
+ /**
+ * If <request_id> < <id_range_low> return 0.
+ * If <request_id> > <id_range_high>, shift the range so it
+ * includes <request_id>, purging incomplete requests as needed.
+ */
+ TAO_ECG_UDP_Request_Entry ** get_request (CORBA::ULong request_id);
+
+private:
+
+ /// Delete any outstanding requests with ids in the range
+ /// [<purge_first>, <purge_last>] from <fragmented_requests> and
+ /// and reset their slots.
+ void purge_requests (CORBA::ULong purge_first,
+ CORBA::ULong purge_last);
+
+ Requests & operator= (const Requests &rhs);
+ Requests (const Requests &rhs);
+
+private:
+ /// Array, used in a circular fashion, that stores partially received
+ /// requests (and info on which requests have been fully received
+ /// and processed) for a range of request ids.
+ TAO_ECG_UDP_Request_Entry** fragmented_requests_;
+
+ /// Size of <fragmented_requests_> array.
+ size_t size_;
+
+ /// The range of request ids, currently represented in
+ /// <fragmented_requests>.
+ //@{
+ CORBA::ULong id_range_low_;
+ CORBA::ULong id_range_high_;
+ //@}
+
+ /// Minimum range shifting amount.
+ size_t min_purge_count_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_CDR_Message_Receiver.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_ECG_CDR_MESSAGE_RECEIVER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Receiver.i b/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Receiver.i
new file mode 100644
index 00000000000..078166a6088
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Receiver.i
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_ECG_CDR_Message_Receiver::Requests::Requests (void)
+ : fragmented_requests_ (0)
+ , size_ (0)
+ , id_range_low_ (0)
+ , id_range_high_ (0)
+ , min_purge_count_ (0)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_ECG_CDR_Message_Receiver::TAO_ECG_CDR_Message_Receiver (CORBA::Boolean crc)
+ : ignore_from_ ()
+ , request_map_ ()
+ /* , lock_ (0) */
+ , max_requests_ (ECG_DEFAULT_MAX_FRAGMENTED_REQUESTS)
+ , min_purge_count_ (ECG_DEFAULT_FRAGMENTED_REQUESTS_MIN_PURGE_COUNT)
+ , check_crc_ (crc)
+{
+// ACE_NEW (this->lock_,
+// ACE_Lock_Adapter<ACE_Null_Mutex>);
+}
+
+ACE_INLINE
+TAO_ECG_CDR_Message_Receiver::~TAO_ECG_CDR_Message_Receiver (void)
+{
+ this->shutdown ();
+}
+
+ACE_INLINE void
+TAO_ECG_CDR_Message_Receiver::init (TAO_ECG_Refcounted_Endpoint ignore_from
+ /*, ACE_Lock *lock */)
+{
+ this->ignore_from_ = ignore_from;
+
+// if (lock)
+// {
+// delete this->lock_;
+// this->lock_ = lock;
+// }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Sender.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Sender.cpp
new file mode 100644
index 00000000000..be2af5fe269
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Sender.cpp
@@ -0,0 +1,340 @@
+// $Id$
+
+#include "orbsvcs/Event/ECG_CDR_Message_Sender.h"
+#include "tao/CDR.h"
+#include "ace/SOCK_Dgram.h"
+#include "ace/INET_Addr.h"
+#include "ace/ACE.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_CDR_Message_Sender.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, ECG_CDR_Message_Sender, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void
+TAO_ECG_CDR_Message_Sender::init (
+ TAO_ECG_Refcounted_Endpoint endpoint_rptr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (endpoint_rptr.get () == 0
+ || endpoint_rptr->dgram ().get_handle () == ACE_INVALID_HANDLE)
+ {
+ ACE_ERROR ((LM_ERROR, "TAO_ECG_CDR_Message_Sender::init(): "
+ "nil or unitialized endpoint argument.\n"));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ this->endpoint_rptr_ = endpoint_rptr;
+}
+
+void
+TAO_ECG_CDR_Message_Sender::send_message (const TAO_OutputCDR &cdr,
+ const ACE_INET_Addr &addr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (this->endpoint_rptr_.get () == 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Attempt to invoke send_message() "
+ "on non-initialized sender object.\n"));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ CORBA::ULong max_fragment_payload = this->mtu () -
+ TAO_ECG_CDR_Message_Sender::ECG_HEADER_SIZE;
+ // ACE_ASSERT (max_fragment_payload != 0);
+
+#if defined (ACE_HAS_BROKEN_DGRAM_SENDV)
+ const int TAO_WRITEV_MAX = ACE_IOV_MAX - 1;
+#else
+ const int TAO_WRITEV_MAX = ACE_IOV_MAX;
+#endif /* ACE_HAS_BROKEN_DGRAM_SENDV */
+ iovec iov[TAO_WRITEV_MAX];
+
+ CORBA::ULong total_length;
+ CORBA::ULong fragment_count =
+ this->compute_fragment_count (cdr.begin (),
+ cdr.end (),
+ TAO_WRITEV_MAX,
+ max_fragment_payload,
+ total_length);
+
+ CORBA::ULong request_id = this->endpoint_rptr_->next_request_id ();
+
+ // Reserve the first iovec for the header...
+ int iovcnt = 1;
+ CORBA::ULong fragment_id = 0;
+ CORBA::ULong fragment_offset = 0;
+ CORBA::ULong fragment_size = 0;
+ for (const ACE_Message_Block* b = cdr.begin ();
+ b != cdr.end ();
+ b = b->cont ())
+ {
+ CORBA::ULong l = b->length ();
+
+ char* rd_ptr = b->rd_ptr ();
+
+ iov[iovcnt].iov_base = rd_ptr;
+ iov[iovcnt].iov_len = l;
+ fragment_size += l;
+ ++iovcnt;
+ while (fragment_size > max_fragment_payload)
+ {
+ // This fragment is full, we have to send it...
+
+ // First adjust the last iov entry:
+ CORBA::ULong last_mb_length =
+ max_fragment_payload - (fragment_size - l);
+ iov[iovcnt - 1].iov_len = last_mb_length;
+
+ this->send_fragment (addr,
+ request_id,
+ total_length,
+ max_fragment_payload,
+ fragment_offset,
+ fragment_id,
+ fragment_count,
+ iov,
+ iovcnt
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ++fragment_id;
+ fragment_offset += max_fragment_payload;
+
+ // Reset, but don't forget that the last Message_Block
+ // may need to be sent in multiple fragments..
+ l -= last_mb_length;
+ rd_ptr += last_mb_length;
+ iov[1].iov_base = rd_ptr;
+ iov[1].iov_len = l;
+ fragment_size = l;
+ iovcnt = 2;
+ }
+ if (fragment_size == max_fragment_payload)
+ {
+ // We filled a fragment, but this time it was filled
+ // exactly, the treatment is a little different from the
+ // loop above...
+ this->send_fragment (addr,
+ request_id,
+ total_length,
+ max_fragment_payload,
+ fragment_offset,
+ fragment_id,
+ fragment_count,
+ iov,
+ iovcnt
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ++fragment_id;
+ fragment_offset += max_fragment_payload;
+
+ iovcnt = 1;
+ fragment_size = 0;
+ }
+ if (iovcnt == TAO_WRITEV_MAX)
+ {
+ // Now we ran out of space in the iovec, we must send a
+ // fragment to work around that....
+ this->send_fragment (addr,
+ request_id,
+ total_length,
+ fragment_size,
+ fragment_offset,
+ fragment_id,
+ fragment_count,
+ iov,
+ iovcnt
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ++fragment_id;
+ fragment_offset += fragment_size;
+
+ iovcnt = 1;
+ fragment_size = 0;
+ }
+ }
+ // There is something left in the iovvec that we must send
+ // also...
+ if (iovcnt != 1)
+ {
+ // Now we ran out of space in the iovec, we must send a
+ // fragment to work around that....
+ this->send_fragment (addr,
+ request_id,
+ total_length,
+ fragment_size,
+ fragment_offset,
+ fragment_id,
+ fragment_count,
+ iov,
+ iovcnt
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ++fragment_id;
+ fragment_offset += fragment_size;
+
+ // reset, not needed here...
+ // iovcnt = 1;
+ // fragment_size = 0;
+ }
+ // ACE_ASSERT (total_length == fragment_offset);
+ // ACE_ASSERT (fragment_id == fragment_count);
+
+}
+
+
+void
+TAO_ECG_CDR_Message_Sender::send_fragment (const ACE_INET_Addr &addr,
+ CORBA::ULong request_id,
+ CORBA::ULong request_size,
+ CORBA::ULong fragment_size,
+ CORBA::ULong fragment_offset,
+ CORBA::ULong fragment_id,
+ CORBA::ULong fragment_count,
+ iovec iov[],
+ int iovcnt
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::ULong header[TAO_ECG_CDR_Message_Sender::ECG_HEADER_SIZE
+ / sizeof(CORBA::ULong)
+ + ACE_CDR::MAX_ALIGNMENT];
+ char* buf = reinterpret_cast<char*> (header);
+ TAO_OutputCDR cdr (buf, sizeof(header));
+ cdr.write_boolean (TAO_ENCAP_BYTE_ORDER);
+ // Insert some known values in the padding bytes, so we can smoke
+ // test the message on the receiving end.
+ cdr.write_octet ('A'); cdr.write_octet ('B'); cdr.write_octet ('C');
+ cdr.write_ulong (request_id);
+ cdr.write_ulong (request_size);
+ cdr.write_ulong (fragment_size);
+ cdr.write_ulong (fragment_offset);
+ cdr.write_ulong (fragment_id);
+ cdr.write_ulong (fragment_count);
+ CORBA::Octet padding[4];
+
+
+ // MRH
+ if (checksum_)
+ {
+ // Compute CRC
+ iov[0].iov_base = cdr.begin ()->rd_ptr ();
+ iov[0].iov_len = cdr.begin ()->length ();
+ unsigned int crc = 0;
+ unsigned char *crc_parts = (unsigned char *)(&crc);
+ if (iovcnt > 1)
+ {
+ crc = ACE::crc32 (iov, iovcnt);
+ crc = htonl (crc);
+ }
+ for (int cnt=0; cnt<4; ++cnt)
+ {
+ padding[cnt] = crc_parts[cnt];
+ }
+ }
+ else
+ {
+ for (int cnt=0; cnt<4; ++cnt)
+ {
+ padding[cnt] = 0;
+ }
+ }
+ //End MRH
+ cdr.write_octet_array (padding, 4);
+
+ iov[0].iov_base = cdr.begin ()->rd_ptr ();
+ iov[0].iov_len = cdr.begin ()->length ();
+
+ ssize_t n = this->dgram ().send (iov,
+ iovcnt,
+ addr);
+ size_t expected_n = 0;
+ for (int i = 0; i < iovcnt; ++i)
+ expected_n += iov[i].iov_len;
+ if (n > 0 && size_t(n) != expected_n)
+ {
+ ACE_DEBUG ((LM_ERROR, ("Sent only %d out of %d bytes "
+ "for mcast fragment.\n"),
+ n,
+ expected_n));
+ }
+
+ if (n == -1)
+ {
+ if (errno == EWOULDBLOCK)
+ {
+ ACE_DEBUG ((LM_ERROR, "Send of mcast fragment failed (%m).\n"));
+ // @@ TODO Use a Event Channel specific exception
+ ACE_THROW (CORBA::COMM_FAILURE ());
+ }
+ else
+ {
+ ACE_DEBUG ((LM_WARNING, "Send of mcast fragment blocked (%m).\n"));
+ }
+ }
+ else if (n == 0)
+ {
+ ACE_DEBUG ((LM_WARNING, "EOF on send of mcast fragment (%m).\n"));
+ }
+}
+
+
+CORBA::ULong
+TAO_ECG_CDR_Message_Sender::compute_fragment_count (const ACE_Message_Block* begin,
+ const ACE_Message_Block* end,
+ int iov_size,
+ CORBA::ULong max_fragment_payload,
+ CORBA::ULong& total_length)
+{
+ CORBA::ULong fragment_count = 0;
+ total_length = 0;
+
+ CORBA::ULong fragment_size = 0;
+ // Reserve the first iovec for the header...
+ int iovcnt = 1;
+ for (const ACE_Message_Block* b = begin;
+ b != end;
+ b = b->cont ())
+ {
+ CORBA::ULong l = b->length ();
+ total_length += l;
+ fragment_size += l;
+ ++iovcnt;
+ while (fragment_size > max_fragment_payload)
+ {
+ // Ran out of space, must create a fragment...
+ ++fragment_count;
+
+ // The next iovector will contain what remains of this
+ // buffer, but also consider
+ iovcnt = 2;
+ l -= max_fragment_payload - (fragment_size - l);
+ fragment_size = l;
+ }
+ if (fragment_size == max_fragment_payload)
+ {
+ ++fragment_count;
+ iovcnt = 1;
+ fragment_size = 0;
+ }
+ if (iovcnt >= iov_size)
+ {
+ // Ran out of space in the iovector....
+ ++fragment_count;
+ iovcnt = 1;
+ fragment_size = 0;
+ }
+ }
+ if (iovcnt != 1)
+ {
+ // Send the remaining data in another fragment
+ ++fragment_count;
+ }
+ return fragment_count;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Sender.h b/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Sender.h
new file mode 100644
index 00000000000..0f7d8b723ba
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Sender.h
@@ -0,0 +1,190 @@
+// -*- C++ -*-
+
+/**
+ * @file ECG_CDR_Message_Sender.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ * @author Marina Spivak (marina@atdesk.com)
+ */
+
+#ifndef TAO_ECG_CDR_MESSAGE_SENDER_H
+#define TAO_ECG_CDR_MESSAGE_SENDER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/ECG_UDP_Out_Endpoint.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#include "tao/SystemException.h"
+#include "tao/Environment.h"
+
+#include "ace/INET_Addr.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ECG_CDR_Message_Sender
+ *
+ * @brief Sends CDR messages using UDP.
+ * NOT THREAD-SAFE.
+ *
+ * This class breaks up a CDR message into fragments and sends each
+ * fragment with a header (described below) using UDP.
+ * The UDP address can be a normal IP address or it can be a multicast
+ * group. The UDP address is obtained from a RtecUDPAdmin::AddrServer
+ * class.
+ *
+ * This class is used by various Gateway (Senders/Receivers) classes
+ * responsible for federating Event Channels with UDP/Mcast.
+ *
+ * <H2>MESSAGE FORMAT</H2>
+ * Message header are encapsulated using CDR, with the
+ * following format:
+ * struct Header {
+ * octet byte_order_flags;
+ * // bit 0 represents the byte order as in GIOP 1.1
+ * // bit 1 is set if this is the last fragment
+ * unsigned long request_id;
+ * // The request ID, senders must not send two requests with
+ * // the same ID, senders can be distinguished using recvfrom..
+ * unsigned long request_size;
+ * // The size of this request, this can be used to pre-allocate
+ * // the request buffer.
+ * unsgined long fragment_size;
+ * // The size of this fragment, excluding the header...
+ * unsigned long fragment_offset;
+ * // Where does this fragment fit in the complete message...
+ * unsigned long fragment_id;
+ * // The ID of this fragment...
+ * unsigned long fragment_count;
+ * // The total number of fragments to expect in this request
+ *
+ * // @todo This could be eliminated if efficient reassembly
+ * // could be implemented without it.
+ * octet padding[4];
+ *
+ * // Ensures the header ends at an 8-byte boundary.
+ * }; // size (in CDR stream) = 32
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_CDR_Message_Sender
+{
+public:
+
+ enum {
+ ECG_HEADER_SIZE = 32,
+ ECG_MIN_MTU = 32 + 8,
+ ECG_MAX_MTU = 65536, // Really optimistic...
+ ECG_DEFAULT_MTU = 1024
+ };
+
+ /// Initialization and termination methods.
+ //@{
+ TAO_ECG_CDR_Message_Sender (CORBA::Boolean crc = 0);
+
+ /// Set the endpoint for sending messages.
+ /**
+ * If init () is successful, shutdown () must be called when the
+ * sender is no longer needed. If shutdown () is not called by the
+ * user, cleanup activities will be performed by the destructor.
+ */
+ void init (TAO_ECG_Refcounted_Endpoint endpoint_rptr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // Shutdown this component. Frees up the endpoint.
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+ //@}
+
+ /// Setters/getters.
+ //@{
+ /// Get the local endpoint used to send the events.
+ int get_local_addr (ACE_INET_Addr& addr);
+
+ /**
+ * The sender may need to fragment the message, otherwise the
+ * network may drop the packets.
+ * Setting the MTU can fail if the value is too small (at least the
+ * header + 8 bytes must fit).
+ */
+ int mtu (CORBA::ULong mtu);
+ CORBA::ULong mtu (void) const;
+ //@}
+
+ /// The main method - send a CDR message.
+ /**
+ * @todo Under some platforms, notably Linux, the fragmentation code
+ * in this method is woefully naive. The fragments are sent it a
+ * big burst, unfortunately, that can fill up the local kernel
+ * buffer before all the data is sent. In those circumstances some
+ * of the fragments are silently (gulp!) dropped by the kernel,
+ * check the documentation for sendto(2) specially the ENOBUFS
+ * error condition.
+ * There is no easy solution that I know off, except "pacing" the
+ * fragments, i.e. never sending more than a prescribed number of
+ * bytes per-second, sleeping before sending more or queueing them
+ * to send later via the reactor.
+ */
+ void send_message (const TAO_OutputCDR &cdr,
+ const ACE_INET_Addr &addr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// Return the datagram...
+ ACE_SOCK_Dgram& dgram (void);
+
+ /**
+ * Send one fragment, the first entry in the iovec is used to send
+ * the header, the rest of the iovec array should contain pointers
+ * to the actual data.
+ */
+ void send_fragment (const ACE_INET_Addr &addr,
+ CORBA::ULong request_id,
+ CORBA::ULong request_size,
+ CORBA::ULong fragment_size,
+ CORBA::ULong fragment_offset,
+ CORBA::ULong fragment_id,
+ CORBA::ULong fragment_count,
+ iovec iov[],
+ int iovcnt
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Count the number of fragments that will be required to send the
+ * message blocks in the range [begin,end)
+ * The maximum fragment payload (i.e. the size without the header is
+ * also required); <total_length> returns the total message size.
+ */
+ CORBA::ULong compute_fragment_count (const ACE_Message_Block* begin,
+ const ACE_Message_Block* end,
+ int iov_size,
+ CORBA::ULong max_fragment_payload,
+ CORBA::ULong& total_length);
+
+private:
+ /// The datagram used for sendto ().
+ TAO_ECG_Refcounted_Endpoint endpoint_rptr_;
+
+ /// The MTU for this sender...
+ CORBA::ULong mtu_;
+
+ /// Should crc checksum be caluclated and sent?
+ CORBA::Boolean checksum_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_CDR_Message_Sender.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_ECG_CDR_MESSAGE_SENDER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Sender.i b/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Sender.i
new file mode 100644
index 00000000000..aa1242d07fe
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_CDR_Message_Sender.i
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_ECG_CDR_Message_Sender::TAO_ECG_CDR_Message_Sender (CORBA::Boolean crc)
+ : endpoint_rptr_ ()
+ , mtu_ (TAO_ECG_CDR_Message_Sender::ECG_DEFAULT_MTU)
+ , checksum_ (crc)
+{
+}
+
+ACE_INLINE void
+TAO_ECG_CDR_Message_Sender::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ // Release the endpoint.
+ TAO_ECG_Refcounted_Endpoint empty_endpoint_rptr;
+ this->endpoint_rptr_ = empty_endpoint_rptr;
+}
+
+ACE_INLINE ACE_SOCK_Dgram&
+TAO_ECG_CDR_Message_Sender::dgram (void)
+{
+ ACE_ASSERT (this->endpoint_rptr_.get ());
+ return this->endpoint_rptr_->dgram ();
+}
+
+ACE_INLINE int
+TAO_ECG_CDR_Message_Sender::get_local_addr (ACE_INET_Addr& addr)
+{
+ if (this->endpoint_rptr_.get () == 0)
+ return -1;
+ return this->dgram ().get_local_addr (addr);
+}
+
+ACE_INLINE CORBA::ULong
+TAO_ECG_CDR_Message_Sender::mtu (void) const
+{
+ return this->mtu_;
+}
+
+ACE_INLINE int
+TAO_ECG_CDR_Message_Sender::mtu (CORBA::ULong new_mtu)
+{
+ if (new_mtu < TAO_ECG_CDR_Message_Sender::ECG_MIN_MTU
+ || new_mtu >= TAO_ECG_CDR_Message_Sender::ECG_MAX_MTU)
+ return -1;
+ this->mtu_ = new_mtu;
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.cpp
new file mode 100644
index 00000000000..3091fb79acf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.cpp
@@ -0,0 +1,170 @@
+// $Id$
+
+#include "orbsvcs/Event/ECG_Complex_Address_Server.h"
+#include "ace/SString.h"
+#include "ace/streams.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_Complex_Address_Server.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ECG_Complex_Address_Server::TAO_ECG_Complex_Address_Server (
+ int is_source_mapping)
+ : is_source_mapping_ (is_source_mapping)
+{
+}
+
+TAO_ECG_Complex_Address_Server::~TAO_ECG_Complex_Address_Server (void)
+{
+}
+
+int
+TAO_ECG_Complex_Address_Server::init (const char *arg)
+{
+ ACE_CString key_string;
+ ACE_CString mcast_string;
+
+ // Our position in parsing initialization string.
+ const char * data = arg;
+
+ // Parse initialization string until we reach the end.
+ while (*data != '\0')
+ {
+ // Extract lookup value (it is followed by '@').
+ const char * location = 0;
+ location = ACE_OS::strchr (data, '@');
+ if (!location)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to initialize address "
+ "server: cannot find <@> separator "
+ "in initialization string "
+ "as expected\n"),
+ -1);
+ }
+ size_t len = location - data;
+ key_string.set (data, len, 1);
+ data += len + 1;
+
+ // Extract mcast address to be mapped to just extracted lookup
+ // value.
+ location = 0;
+ location = ACE_OS::strchr (data, ' ');
+ if (location)
+ {
+ len = location - data;
+ mcast_string.set (data, len, 1);
+ data += len + 1;
+ }
+ else
+ {
+ // This must be the last entry in the mapping.
+ len = ACE_OS::strlen (data);
+ mcast_string.set (data, len, 1);
+ data += len;
+ }
+
+ // Add new entry to the mapping.
+ if (this->add_entry (key_string.c_str (),
+ mcast_string.c_str ()) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+int
+TAO_ECG_Complex_Address_Server::add_entry (const char * key,
+ const char * mcast_addr)
+{
+ // Check whether this is the default mcast address.
+ if (ACE_OS::strlen (key) == 1
+ && *key == '*')
+ {
+ if (this->default_addr_.set (mcast_addr) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR, "Unable to initialize: invalid "
+ "mcast address specified: %s.\n",
+ mcast_addr),
+ -1);
+ return 0;
+ }
+
+ // Convert strings to values.
+ char * endptr = 0;
+ CORBA::Long header_value = ACE_OS::strtol (key, &endptr, 0);
+ if (*endptr != '\0')
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Unable to initialize: invalid "
+ "source/type specified: %s.\n",
+ key),
+ -1);
+ }
+
+ ACE_INET_Addr addr;
+ if (addr.set (mcast_addr) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Unable to initialize: invalid "
+ "mcast address specified: %s.\n",
+ mcast_addr),
+ -1);
+ }
+
+ if (this->mcast_mapping_.bind (header_value, addr) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Unable to initialize: error adding "
+ "new entry to the mapping.\n"),
+ -1);
+ }
+
+ return 0;
+}
+
+
+void
+TAO_ECG_Complex_Address_Server::get_addr (
+ const RtecEventComm::EventHeader& header,
+ RtecUDPAdmin::UDP_Addr_out addr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Long key;
+ if (this->is_source_mapping_)
+ key = header.source;
+ else
+ key = header.type;
+
+ MAP::ENTRY * mapping_entry = 0;
+ if (this->mcast_mapping_.find (key, mapping_entry) == -1)
+ {
+ // Key was not found in the mapping. Use default.
+ addr.ipaddr = this->default_addr_.get_ip_address ();
+ addr.port = this->default_addr_.get_port_number ();
+ }
+ else
+ {
+ addr.ipaddr = mapping_entry->int_id_.get_ip_address ();
+ addr.port = mapping_entry->int_id_.get_port_number ();
+ }
+}
+
+void
+TAO_ECG_Complex_Address_Server::dump_content (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "Default address: %s:%d\n",
+ this->default_addr_.get_host_addr (),
+ this->default_addr_.get_port_number ()));
+
+ for (MAP::iterator iter = this->mcast_mapping_.begin ();
+ iter != this->mcast_mapping_.end ();
+ iter++)
+ {
+ MAP::ENTRY & entry = *iter;
+ ACE_DEBUG ((LM_DEBUG, "%d --> %s:%d\n",
+ entry.ext_id_,
+ this->default_addr_.get_host_addr (),
+ this->default_addr_.get_port_number ()));
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.h
new file mode 100644
index 00000000000..bbe55390465
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.h
@@ -0,0 +1,118 @@
+// -*- C++ -*-
+
+/**
+ * @file ECG_Complex_Address_Server.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak (marina@atdesk.com)
+ *
+ */
+
+#ifndef TAO_ECG_COMPLEX_ADDRESS_SERVER_H
+#define TAO_ECG_COMPLEX_ADDRESS_SERVER_H
+
+#include /**/ "ace/pre.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#include "orbsvcs/RtecUDPAdminS.h"
+#include "ace/Hash_Map_Manager_T.h"
+#include "ace/INET_Addr.h"
+#include "ace/Null_Mutex.h"
+
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ECG_Complex_Address_Server
+ *
+ * @brief Implementation of RtecUDPAdmin idl interface, which returns
+ * a different multicast address based on event source (or event type
+ * - depending on how the server is configured).
+ *
+ * INITIALIZATION STRING FORMAT
+ *
+ * The string is a sequence of <key>@<value> pairs separated by
+ * a single space, where <key> is event source (or type)
+ * and <value> is the corresponding mcast address. Example:
+ * "34@230.100.0.2:2300 45@230.100.123.43:2300"
+ * The string above represents two key-value pairs.
+ *
+ * A special key "*" is used to specify the default mcast address,
+ * i.e., the one that will be returned for event sources that weren't
+ * explicitly specified in the initialization string. Example:
+ * "*@230.100.0.2:2300 45@230.100.123.43:2300"
+ *
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_Complex_Address_Server :
+ public virtual POA_RtecUDPAdmin::AddrServer
+{
+public:
+
+ /// Create a new TAO_ECG_Complex_Address_Server object.
+ /*
+ * (Constructor access is restricted to insure that all
+ * TAO_ECG_Complex_Address_Server objects are heap-allocated.)
+ * <is_source_mapping> flag indicates whether this
+ * server maps based on event header source or event header type.
+ */
+ static TAO_EC_Servant_Var<TAO_ECG_Complex_Address_Server>
+ create (int is_source_mapping = 1);
+
+ /// Destructor
+ virtual ~TAO_ECG_Complex_Address_Server (void);
+
+ /// Initializes the mapping from the <arg> string. See class notes
+ /// for the expected format.
+ int init (const char *arg);
+
+ // = The RtecUDPAdmin::AddrServer methods
+ virtual void get_addr (const RtecEventComm::EventHeader& header,
+ RtecUDPAdmin::UDP_Addr_out addr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Prints out complete content of the address server. Useful for
+ /// debugging.
+ void dump_content (void);
+
+protected:
+
+ /// Constructor (protected). Clients can create new
+ /// TAO_ECG_Complex_Address_Server objects using the static create()
+ /// method.
+ /// <is_source_mapping> flag indicates whether this
+ /// server maps based on event header source or event header type.
+ TAO_ECG_Complex_Address_Server (int is_source_mapping = 1);
+
+private:
+
+ /// Helper. Given key and mcast address in string form, add them to
+ /// the mapping.
+ int add_entry (const char * key, const char * mcast_addr);
+
+ /// Flag indicating whether this address server maps event source or
+ /// event type to mcast groups.
+ int is_source_mapping_;
+
+ typedef ACE_Hash_Map_Manager_Ex<CORBA::Long, ACE_INET_Addr,
+ ACE_Hash<CORBA::Long>, ACE_Equal_To<CORBA::Long>, ACE_Null_Mutex> MAP;
+
+ MAP mcast_mapping_;
+
+ /// Mcast group to be used for all sources (or types) not explicitly
+ /// mapped.
+ ACE_INET_Addr default_addr_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_Complex_Address_Server.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_ECG_COMPLEX_ADDRESS_SERVER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.i b/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.i
new file mode 100644
index 00000000000..b47e2db3e68
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.i
@@ -0,0 +1,17 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE TAO_EC_Servant_Var<TAO_ECG_Complex_Address_Server>
+TAO_ECG_Complex_Address_Server::create (int is_source_mapping)
+{
+ TAO_EC_Servant_Var<TAO_ECG_Complex_Address_Server> s;
+ ACE_NEW_RETURN (s,
+ TAO_ECG_Complex_Address_Server (is_source_mapping),
+ s);
+ return s;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_ConsumerEC_Control.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_ConsumerEC_Control.cpp
new file mode 100644
index 00000000000..b5b65cc294b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_ConsumerEC_Control.cpp
@@ -0,0 +1,42 @@
+// $Id$
+
+#include "orbsvcs/Event/ECG_ConsumerEC_Control.h"
+
+ACE_RCSID(Event, ECG_ConsumerEventChannelControl, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ECG_ConsumerEC_Control::TAO_ECG_ConsumerEC_Control (void)
+{
+}
+
+TAO_ECG_ConsumerEC_Control::~TAO_ECG_ConsumerEC_Control (void)
+{
+}
+
+int
+TAO_ECG_ConsumerEC_Control::activate (void)
+{
+ return 0;
+}
+
+int
+TAO_ECG_ConsumerEC_Control::shutdown (void)
+{
+ return 0;
+}
+
+void
+TAO_ECG_ConsumerEC_Control::event_channel_not_exist (TAO_EC_Gateway_IIOP *
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_ECG_ConsumerEC_Control::system_exception (TAO_EC_Gateway_IIOP *,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_ConsumerEC_Control.h b/TAO/orbsvcs/orbsvcs/Event/ECG_ConsumerEC_Control.h
new file mode 100644
index 00000000000..a8141829787
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_ConsumerEC_Control.h
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+
+/**
+ * @file ECG_ConsumerEC_Control.h
+ *
+ * $Id$
+ *
+ * @author Johnny Willemsen (jwillemsen@remedy.nl)
+ *
+ */
+
+#ifndef TAO_ECG_ConsumerEC_Control_H
+#define TAO_ECG_ConsumerEC_Control_H
+
+#include /**/ "ace/pre.h"
+#include "ace/CORBA_macros.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Basic_Types.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Gateway_IIOP;
+class TAO_EC_ProxyPushSupplier;
+
+namespace CORBA
+{
+ class Environment;
+ class SystemException;
+}
+
+/**
+ * @class TAO_ECG_ConsumerEC_Control
+ *
+ * @brief EventChannelControl
+ *
+ * Defines the interface for the consumer event channel control strategy.
+ * This strategy handles misbehaving or failing event channels that are consumer
+ * of a gateway.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_ConsumerEC_Control
+{
+public:
+ /// Constructor.
+ TAO_ECG_ConsumerEC_Control (void);
+
+ /// Destructor.
+ virtual ~TAO_ECG_ConsumerEC_Control (void);
+
+ /// Activate any internal threads or timers used to poll the state of
+ /// the event channel.
+ virtual int activate (void);
+
+ /// Shutdown any internal threads or timers used to poll the state of
+ /// the event channel.
+ virtual int shutdown (void);
+
+ /**
+ * When pushing an event to the event channel a CORBA::OBJECT_NOT_EXIST
+ * exception was raised. The only interpretation is that the object
+ * has been destroyed. The strategy has to (at the very least),
+ * reclaim all the resources attached to that object.
+ */
+ virtual void event_channel_not_exist (TAO_EC_Gateway_IIOP * gateway
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Some system exception was raised while trying to contact the
+ /// event channel
+ virtual void system_exception (TAO_EC_Gateway_IIOP * gateway,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL_NOT_USED);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_ECG_ConsumerEC_Control_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Defaults.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Defaults.h
new file mode 100644
index 00000000000..77dd5a28dae
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Defaults.h
@@ -0,0 +1,79 @@
+// -*- C++ -*-
+
+/**
+ * @file ECG_Defaults.h
+ *
+ * $Id$
+ *
+ * In this file we set the compile time defaults for the event
+ * channel multicast gateway.
+ *
+ * @author Marina Spivak (marina@atdesk.com)
+ */
+
+#ifndef TAO_ECG_DEFAULTS_H
+#define TAO_ECG_DEFAULTS_H
+#include /**/ "ace/pre.h"
+
+// Any of the definitions below can be overriden in the config.h file
+// or the compilation line.
+
+#ifndef TAO_ECG_DEFAULT_SERVICE
+# define TAO_ECG_DEFAULT_SERVICE ECG_MCAST_TWO_WAY
+#endif /* TAO_ECG_DEFAULT_SERVICE */
+
+#ifndef TAO_ECG_DEFAULT_HANDLER
+# define TAO_ECG_DEFAULT_HANDLER ECG_HANDLER_BASIC
+#endif /* TAO_ECG_DEFAULT_HANDLER */
+
+#ifndef TAO_ECG_DEFAULT_ADDRESS_SERVER
+# define TAO_ECG_DEFAULT_ADDRESS_SERVER ECG_ADDRESS_SERVER_BASIC
+#endif /* TAO_ECG_DEFAULT_ADDRESS_SERVER */
+
+/* must be provided by the user */
+#ifndef TAO_ECG_DEFAULT_ADDRESS_SERVER_ARG
+# define TAO_ECG_DEFAULT_ADDRESS_SERVER_ARG 0
+#endif /* TAO_ECG_DEFAULT_ADDRESS_SERVER_ARG */
+
+#ifndef TAO_ECG_DEFAULT_TTL
+# define TAO_ECG_DEFAULT_TTL 0 /* don't set, use default */
+#endif /* TAO_ECG_DEFAULT_TTL */
+
+#ifndef TAO_ECG_DEFAULT_NIC
+# define TAO_ECG_DEFAULT_NIC 0 /* use default */
+#endif /* TAO_ECG_DEFAULT_NIC */
+
+#ifndef TAO_ECG_DEFAULT_IP_MULTICAST_LOOP
+# define TAO_ECG_DEFAULT_IP_MULTICAST_LOOP 1 /* loopback mcast messages */
+#endif /* TAO_ECG_DEFAULT_IP_MULTICAST_LOOP */
+
+#ifndef TAO_ECG_DEFAULT_NON_BLOCKING
+# define TAO_ECG_DEFAULT_NON_BLOCKING 1 /* write sockets are non-blocking */
+#endif /* TAO_ECG_DEFAULT_NON_BLOCKING */
+
+#ifndef TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL
+# define TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL 0 /* null */
+#endif /* TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL */
+
+#ifndef TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL_PERIOD
+# define TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL_PERIOD 5000000 /* usecs */
+#endif /* TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL_PERIOD */
+
+#ifndef TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL_TIMEOUT
+# define TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL_TIMEOUT 10000 /* usecs */
+#endif /* TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL_TIMEOUT */
+
+#ifndef TAO_ECG_DEFAULT_IIOP_ORB_ID
+# define TAO_ECG_DEFAULT_IIOP_ORB_ID "" /* */
+#endif /* TAO_ECG_DEFAULT_IIOP_ORB_ID */
+
+#ifndef TAO_ECG_DEFAULT_IIOP_USE_TTL
+# define TAO_ECG_DEFAULT_IIOP_USE_TTL 1 /* use TTL */
+#endif /* TAO_ECG_DEFAULT_IIOP_USE_TTL */
+
+#ifndef TAO_ECG_DEFAULT_IIOP_USE_CONSUMER_PROXY_MAP
+# define TAO_ECG_DEFAULT_IIOP_USE_CONSUMER_PROXY_MAP 1 /* use consumer proxy map */
+#endif /* TAO_ECG_DEFAULT_IIOP_USE_CONSUMER_PROXY_MAP */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_ECG_DEFAULTS_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.cpp
new file mode 100644
index 00000000000..e72dafca760
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.cpp
@@ -0,0 +1,303 @@
+// $Id$
+
+#include "orbsvcs/Event/ECG_Mcast_EH.h"
+#include "orbsvcs/Event/ECG_UDP_Receiver.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.h"
+#include "ace/Unbounded_Set.h"
+#include "ace/OS_NS_string.h"
+#include "ace/Reactor.h"
+#include "ace/os_include/os_fcntl.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_Mcast_EH.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, ECG_Mcast_EH, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ECG_Mcast_EH::TAO_ECG_Mcast_EH (TAO_ECG_Dgram_Handler *recv,
+ const ACE_TCHAR *net_if,
+ CORBA::ULong sz)
+ : net_if_ (net_if ? ACE_OS::strdup (net_if) : 0)
+ , subscriptions_ ()
+ , receiver_ (recv)
+ , recvbuf_size_ (sz)
+ , observer_ ()
+ , auto_observer_disconnect_ ()
+{
+ ACE_ASSERT (this->receiver_);
+}
+
+TAO_ECG_Mcast_EH::~TAO_ECG_Mcast_EH (void)
+{
+ ACE_OS::free (this->net_if_);
+}
+
+void
+TAO_ECG_Mcast_EH::open (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ if (!this->receiver_)
+ {
+ // We are shut down.
+ ACE_THROW (CORBA::INTERNAL());
+ }
+
+ if (CORBA::is_nil (ec))
+ {
+ ACE_ERROR ((LM_ERROR, "TAO_ECG_Mcast_EH::open(): "
+ "nil ec argument"));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ // Create and activate Event Channel Observer.
+ ACE_NEW (this->observer_,
+ Observer (this));
+
+ if (!this->observer_.in ())
+ {
+ ACE_THROW (CORBA::NO_MEMORY ());
+ }
+
+ TAO_EC_Object_Deactivator observer_deactivator;
+ RtecEventChannelAdmin::Observer_var observer_ref;
+ PortableServer::POA_var poa =
+ this->observer_->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ activate (observer_ref,
+ poa.in (),
+ this->observer_.in (),
+ observer_deactivator
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::Observer_Handle handle =
+ ec->append_observer (observer_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->observer_->set_deactivator (observer_deactivator);
+ this->auto_observer_disconnect_.set_command
+ (Observer_Disconnect_Command (handle, ec));
+}
+
+int
+TAO_ECG_Mcast_EH::shutdown (void)
+{
+ // Already shut down.
+ if (!this->receiver_)
+ return -1;
+
+ // Disconnect Observer from EC.
+ this->auto_observer_disconnect_.execute ();
+
+ // Shutdown the observer.
+ if (this->observer_.in ())
+ {
+ this->observer_->shutdown ();
+ this->observer_ = 0;
+ }
+
+ // Indicates that we are in a shutdown state.
+ this->receiver_ = 0;
+
+ // Deregister from reactor, close and clean up sockets.
+ size_t subscriptions_size = this->subscriptions_.size ();
+ for (size_t i = 0; i != subscriptions_size; ++i)
+ {
+ (void) this->reactor ()->remove_handler (
+ this->subscriptions_[i].dgram->get_handle (),
+ ACE_Event_Handler::READ_MASK);
+ (void) this->subscriptions_[i].dgram->close();
+ delete this->subscriptions_[i].dgram;
+ }
+ this->subscriptions_.size (0);
+
+ return 0;
+}
+
+int
+TAO_ECG_Mcast_EH::handle_input (ACE_HANDLE fd)
+{
+ size_t subscriptions_size = this->subscriptions_.size ();
+ for (size_t i = 0; i != subscriptions_size; ++i)
+ {
+ ACE_SOCK_Dgram_Mcast *socket = this->subscriptions_[i].dgram;
+ if (socket->get_handle () == fd)
+ {
+ return this->receiver_->handle_input (*socket);
+ }
+ }
+ return -1;
+}
+
+void
+TAO_ECG_Mcast_EH::update_consumer (
+ const RtecEventChannelAdmin::ConsumerQOS& sub
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ Address_Set multicast_addresses;
+
+ this->compute_required_subscriptions (sub,
+ multicast_addresses
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->delete_unwanted_subscriptions (multicast_addresses);
+
+ this->add_new_subscriptions (multicast_addresses);
+}
+
+void
+TAO_ECG_Mcast_EH::compute_required_subscriptions (
+ const RtecEventChannelAdmin::ConsumerQOS& sub,
+ Address_Set& multicast_addresses
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong count = sub.dependencies.length ();
+ for (CORBA::ULong i = 0; i != count; ++i)
+ {
+ const RtecEventComm::EventHeader& header =
+ sub.dependencies[i].event.header;
+ if (0 < header.type && header.type < ACE_ES_EVENT_UNDEFINED)
+ {
+ continue;
+ }
+ RtecUDPAdmin::UDP_Addr addr;
+
+ this->receiver_->get_addr (header, addr ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_INET_Addr inet_addr (addr.port, addr.ipaddr);
+ // Ignore errors, if the element is in the set we simply ignore
+ // the problem...
+ (void) multicast_addresses.insert (inet_addr);
+ }
+}
+
+int
+TAO_ECG_Mcast_EH::delete_unwanted_subscriptions (
+ Address_Set& multicast_addresses)
+{
+ for (size_t i = 0; i < this->subscriptions_.size (); ++i)
+ {
+ ACE_INET_Addr multicast_group = this->subscriptions_[i].mcast_addr;
+ if (multicast_addresses.find (multicast_group))
+ {
+ // Remove from the list of subscriptions to be added,
+ // because we already subscribe to it...
+ (void) multicast_addresses.remove (multicast_group);
+ continue;
+ }
+
+ // This subscription is no longer needed - remove from reactor,
+ // close and delete the socket.
+ ACE_SOCK_Dgram_Mcast *socket = this->subscriptions_[i].dgram;
+ (void) this->reactor ()->remove_handler (socket->get_handle (),
+ ACE_Event_Handler::READ_MASK);
+ (void) socket->close();
+ delete socket;
+ // Move the deleted subscription out of the <subscriptions_>
+ // array by moving the last subscription in array into its place.
+ this->subscriptions_[i] =
+ this->subscriptions_[this->subscriptions_.size () - 1];
+ this->subscriptions_.size (this->subscriptions_.size () - 1);
+ --i;
+ }
+
+ return 0;
+}
+
+void
+TAO_ECG_Mcast_EH::add_new_subscriptions (Address_Set& multicast_addresses)
+{
+ typedef ACE_Unbounded_Set_Iterator<ACE_INET_Addr> Address_Iterator;
+ for (Address_Iterator k = multicast_addresses.begin ();
+ k != multicast_addresses.end ();
+ ++k)
+ {
+ Subscription new_subscription;
+ new_subscription.mcast_addr = *k;
+ ACE_NEW (new_subscription.dgram, ACE_SOCK_Dgram_Mcast);
+
+ size_t subscriptions_size = this->subscriptions_.size ();
+ this->subscriptions_.size (subscriptions_size + 1);
+ this->subscriptions_[subscriptions_size] = new_subscription;
+
+ ACE_SOCK_Dgram_Mcast *socket = new_subscription.dgram;
+
+ if (socket->open (new_subscription.mcast_addr, this->net_if_, 1) == -1) {
+ ACE_ERROR ((LM_ERROR,
+ "Error: %d - Unable to open multicast socket\n",
+ errno ));
+ }
+
+ if ( socket->enable (ACE_NONBLOCK) != 0 ) {
+ ACE_ERROR ((LM_ERROR,
+ "Error: %d - Unable to enable nonblocking on mcast_eh\n",
+ errno ));
+ }
+
+ if (socket->join (new_subscription.mcast_addr, 1, this->net_if_) == -1) {
+ ACE_ERROR ((LM_ERROR,
+ "Error: %d - Unable to join multicast group\n",
+ errno ));
+ }
+
+ if (this->recvbuf_size_ != 0
+ && (((ACE_SOCK_Dgram *)socket)->set_option(SOL_SOCKET,
+ SO_RCVBUF,
+ (void *) &this->recvbuf_size_,
+ sizeof (this->recvbuf_size_)) == -1)
+ && errno != ENOTSUP )
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Error: %d - Unable to set mcast_eh recvbuf_size:%d\n",
+ errno,
+ this->recvbuf_size_));
+ }
+ (void) this->reactor ()->register_handler (
+ socket->get_handle (),
+ this,
+ ACE_Event_Handler::READ_MASK);
+ }
+}
+
+// ****************************************************************
+
+TAO_ECG_Mcast_EH::Observer::Observer (TAO_ECG_Mcast_EH* eh)
+ : eh_ (eh)
+{
+}
+
+void
+TAO_ECG_Mcast_EH::Observer::update_consumer (
+ const RtecEventChannelAdmin::ConsumerQOS& sub
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (this->eh_)
+ this->eh_->update_consumer (sub ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ECG_Mcast_EH::Observer::update_supplier (
+ const RtecEventChannelAdmin::SupplierQOS&
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_ECG_Mcast_EH::Observer::shutdown (void)
+{
+ this->eh_ = 0;
+ this->deactivator_.deactivate ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.h
new file mode 100644
index 00000000000..6808a8bbd0d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.h
@@ -0,0 +1,294 @@
+// -*- C++ -*-
+
+/**
+ * @file ECG_Mcast_EH.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ * @author Jaiganesh Balasubramanian <jai@doc.ece.uci.edu>
+ * @author Marina Spivak <marina@atdesk.com>
+ * @author Don Hinton <dhinton@ieee.org>
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ *
+ */
+#ifndef TAO_ECG_MCAST_EH_H
+#define TAO_ECG_MCAST_EH_H
+
+#include /**/ "ace/pre.h"
+#include "ace/Event_Handler.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Unbounded_Set.h"
+#include "ace/Array_Base.h"
+#include "ace/SOCK_Dgram_Mcast.h"
+
+#include "orbsvcs/RtecEventChannelAdminS.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+#include "orbsvcs/Event/ECG_Adapters.h"
+#include "orbsvcs/Event/EC_Lifetime_Utils.h"
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ECG_Mcast_EH
+ *
+ * @brief Event Handler for Mcast messages.
+ * NOT THREAD-SAFE.
+ *
+ * This object acts as an Observer to Event Channel. It subscribes to
+ * multicast groups that carry events matching the EC's subscriptions.
+ * This object then receives callbacks from the Reactor when data is
+ * available on the mcast sockets and alerts TAO_ECG_Dgram_Handler,
+ * which reads the data, transforms it into event and pushes to the
+ * Event Channel.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_Mcast_EH :
+ public ACE_Event_Handler,
+ public TAO_ECG_Handler_Shutdown
+{
+public:
+
+ /// Initialization and termination methods.
+ //@{
+ /**
+ * Constructor. Messages received by this EH will be forwarded to
+ * the \a recv. \a net_if can be used to specify NIC where multicast
+ * messages are expected. \buf_sz would be used to alter the default
+ * buffer size.
+ *
+ * See comments for receiver_ data member on why raw pointer is
+ * used for the \a recv argument.
+ */
+ TAO_ECG_Mcast_EH (TAO_ECG_Dgram_Handler *recv,
+ const ACE_TCHAR *net_if = 0,
+ CORBA::ULong buf_sz = 0);
+
+ /// Destructor.
+ virtual ~TAO_ECG_Mcast_EH (void);
+
+ /**
+ * Register for changes in the EC subscription list.
+ * When the subscription list becomes non-empty we join the proper
+ * multicast groups (using Dgram_Handler to translate between event
+ * types and mcast groups) and the class registers itself with the
+ * reactor.
+ *
+ * To insure proper resource clean up, if open () is successful,
+ * the user MUST call shutdown () when handler is no longer needed
+ * (and its reactor still exists).
+ */
+ void open (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// TAO_ECG_Handler_Shutdown method.
+ /**
+ * Remove ourselves from the event channel, unsubscribe from the
+ * multicast groups, close the sockets and deregister from the
+ * reactor.
+ */
+ virtual int shutdown (void);
+ //@}
+
+ /// Reactor callback. Notify receiver_ that a dgram corresponding
+ /// to \a fd is ready for reading.
+ virtual int handle_input (ACE_HANDLE fd);
+
+private:
+
+ /**
+ * @class Observer
+ *
+ * @brief Observes changes in the EC consumer subscriptions and notifies
+ * TAO_ECG_Mcast_EH when there are changes.
+ */
+ class Observer :
+ public virtual POA_RtecEventChannelAdmin::Observer,
+ public TAO_EC_Deactivated_Object
+ {
+ public:
+ /// Constructor. Changes in the EC subscriptions will be reported
+ /// to the \a eh.
+ Observer (TAO_ECG_Mcast_EH* eh);
+
+ /// Shut down the observer: disconnect from EC and deactivate from
+ /// POA.
+ void shutdown (void);
+
+ /// Event Channel Observer methods
+ //@{
+ virtual void update_consumer (
+ const RtecEventChannelAdmin::ConsumerQOS& sub
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void update_supplier (
+ const RtecEventChannelAdmin::SupplierQOS& pub
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ private:
+ /// Handler we notify of subscriptions changes.
+ /*
+ * Observer can keep a raw pointer to mcast handler, because the handler
+ * guarantees to notify the observer (by calling shutdown ())
+ * before going away.
+ */
+ TAO_ECG_Mcast_EH *eh_;
+ };
+
+ /// Make update_consumer () accessible to Observer.
+ friend class Observer;
+
+ /// The Observer method. Subscribe/unsubscribe to multicast groups
+ /// according to changes in consumer subscriptions.
+ void update_consumer (const RtecEventChannelAdmin::ConsumerQOS& sub
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+ typedef ACE_Unbounded_Set<ACE_INET_Addr> Address_Set;
+
+ /// Helpers for updating multicast subscriptions based on changes in
+ /// consumer subscriptions.
+ //@{
+ /// Compute the list of multicast addresses that we need to be
+ /// subscribed to, in order to receive the events described in the
+ /// ConsumerQOS parameter.
+ /**
+ * @param sub The list of event types that our event channel
+ * consumers are interested in.
+ * @param multicast_addresses This method populates this list with
+ * multicast addresses that we need to be subscribed to in
+ * order to receive event types specified in /a sub.
+ *
+ * @throw CORBA::SystemException This method needs to perform
+ * several CORBA invocations, and it propagates any exceptions
+ * back to the caller.
+ */
+ void compute_required_subscriptions (
+ const RtecEventChannelAdmin::ConsumerQOS& sub,
+ Address_Set& multicast_addresses
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Unsubscribe from any multicast addresses we are currently
+ /// subscribed to that are not in the \a multicast_addresses list.
+ /// Also remove from /a multicast_addresses any addresses to which we are
+ /// already subscribed.
+ /**
+ * @param multicast_addresses List of multicast
+ * addresses we need to be subscribed to in order receive all
+ * event types in the current consumer subscriptions.
+ */
+ int delete_unwanted_subscriptions (
+ Address_Set& multicast_addresses);
+
+ /// Subscribe to all multicast addresses in /a multicast_addresses -
+ /// we are not subscribed to them yet, but need to be.
+ /**
+ * @param multicast_addresses List of multicast addresses to which
+ * we need to subscribe to in order to be receiving all event
+ * types in the current consumer subscriptions.
+ */
+ void add_new_subscriptions (
+ Address_Set& multicast_addresses);
+ //@}
+
+ /**
+ * @class Observer_Disconnect_Command
+ *
+ * @brief Disconnects Observer from the Event Channel
+ *
+ * Utility class for use as a template argument to TAO_EC_Auto_Command.
+ * TAO_EC_Auto_Command<Observer_Disconnect_Command> manages
+ * observer connection to the Event Channel, automatically
+ * disconnecting from ec in its destructor, if necessary.
+ */
+ class TAO_RTEvent_Serv_Export Observer_Disconnect_Command
+ {
+ public:
+ Observer_Disconnect_Command (void);
+ Observer_Disconnect_Command (RtecEventChannelAdmin::Observer_Handle handle,
+ RtecEventChannelAdmin::EventChannel_ptr ec);
+
+ Observer_Disconnect_Command (const Observer_Disconnect_Command &rhs);
+ Observer_Disconnect_Command & operator= (const Observer_Disconnect_Command & rhs);
+
+ void execute (ACE_ENV_SINGLE_ARG_DECL);
+
+ private:
+
+ RtecEventChannelAdmin::Observer_Handle handle_;
+ RtecEventChannelAdmin::EventChannel_var ec_;
+ };
+
+private:
+ /// The NIC used to subscribe for multicast traffic.
+ ACE_TCHAR *net_if_;
+
+ typedef struct {
+ ACE_INET_Addr mcast_addr;
+ ACE_SOCK_Dgram_Mcast* dgram;
+ } Subscription;
+ typedef ACE_Array_Base<Subscription> Subscriptions;
+
+ /// List of multicast addresses we subscribe to and dgrams we use.
+ /*
+ * We use a dedicated socket for each multicast subscription. The
+ * reason: we assume the underlying software, i.e., ACE, binds each
+ * socket used to receive multicast to the multicast group (mcast addr
+ * + port) to avoid receiving promiscuous traffic, in which case it is
+ * not possible to subscribe to more than one mcast address on the same
+ * socket.
+ *
+ * Performance. We use array to store subscriptions (mcast addr / dgram
+ * pairs). If performance is not adequate, we should look into
+ * using a hash map, keyed on file descriptors, instead. When there
+ * are many subscriptions, handle_input() is likely to be more
+ * efficient with a hash lookup than an array iteration for locating a
+ * target dgram. Difference in costs of subscripton changes between
+ * hash map and array would need to be looked at as well, although
+ * it is probably highly dependent on the pattern of changes.
+ */
+ Subscriptions subscriptions_;
+
+ /// We callback to this object when a message arrives.
+ /*
+ * We can keep a raw pointer to the receiver (even though it may
+ * be a refcounted object) because receiver guarantees
+ * to notify us (by calling shutdown ()) before going away.
+ *
+ * We have to use raw pointer instead of a refcounting mechanism
+ * here to avoid a circular refcounting dependency between
+ * receiver and handler.
+ */
+ TAO_ECG_Dgram_Handler * receiver_;
+
+ /// SOCKbuf size
+ CORBA::ULong recvbuf_size_;
+
+ /// Event Channel Observer. Detects changes in EC consumer subscriptions.
+ /// ORDER DEPENDENCY: this member should be declared before
+ /// <auto_observer_disconnect_>.
+ TAO_EC_Servant_Var<Observer> observer_;
+
+ /// Manages connection of our observer to the Event Channel.
+ /// ORDER DEPENDENCY: this member should be declared AFTER <observer_>.
+ TAO_EC_Auto_Command<Observer_Disconnect_Command> auto_observer_disconnect_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_Mcast_EH.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_ECG_Mcast_EH_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.i b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.i
new file mode 100644
index 00000000000..587c2721944
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.i
@@ -0,0 +1,63 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_ECG_Mcast_EH::
+Observer_Disconnect_Command::Observer_Disconnect_Command (void)
+ : handle_ ()
+ , ec_ ()
+{
+}
+
+ACE_INLINE
+TAO_ECG_Mcast_EH::
+Observer_Disconnect_Command::Observer_Disconnect_Command (
+ RtecEventChannelAdmin::Observer_Handle handle,
+ RtecEventChannelAdmin::EventChannel_ptr ec)
+ : handle_ (handle)
+ , ec_ (RtecEventChannelAdmin::EventChannel::_duplicate (ec))
+{
+}
+
+ACE_INLINE
+TAO_ECG_Mcast_EH::
+Observer_Disconnect_Command::Observer_Disconnect_Command (
+ const Observer_Disconnect_Command & rhs)
+ : handle_ (rhs.handle_)
+ , ec_ (RtecEventChannelAdmin::EventChannel::_duplicate (rhs.ec_.in()))
+{
+}
+
+ACE_INLINE
+TAO_ECG_Mcast_EH::Observer_Disconnect_Command &
+TAO_ECG_Mcast_EH::
+Observer_Disconnect_Command::operator= (
+ const Observer_Disconnect_Command & rhs)
+{
+ this->handle_ = rhs.handle_;
+ this->ec_ = RtecEventChannelAdmin::EventChannel::_duplicate (rhs.ec_.in());
+
+ return *this;
+}
+
+ACE_INLINE void
+TAO_ECG_Mcast_EH::
+Observer_Disconnect_Command::execute (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->ec_.in ()))
+ // We are not connected.
+ return;
+
+ RtecEventChannelAdmin::EventChannel_var release_ec =
+ this->ec_._retn ();
+
+ release_ec->remove_observer (this->handle_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+//***************************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.cpp
new file mode 100644
index 00000000000..723466ea888
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.cpp
@@ -0,0 +1,705 @@
+// $Id$
+
+#include "orbsvcs/Event/ECG_Mcast_Gateway.h"
+
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.h"
+#include "orbsvcs/Event/ECG_Simple_Address_Server.h"
+#include "orbsvcs/Event/ECG_Complex_Address_Server.h"
+#include "orbsvcs/Event/ECG_Simple_Mcast_EH.h"
+#include "orbsvcs/Event/ECG_Mcast_EH.h"
+#include "orbsvcs/Event/ECG_UDP_EH.h"
+
+#include "orbsvcs/Event_Utilities.h"
+
+#include "ace/Dynamic_Service.h"
+#include "ace/Arg_Shifter.h"
+#include "tao/ORB_Core.h"
+#include "ace/OS_NS_strings.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_Mcast_Gateway.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, ECG_Mcast_Gateway, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef TAO_EC_Shutdown_Command<TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> >
+UDP_Sender_Shutdown;
+
+typedef TAO_EC_Shutdown_Command<TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> >
+UDP_Receiver_Shutdown;
+
+
+int
+TAO_ECG_Mcast_Gateway::init_svcs (void)
+{
+ return ACE_Service_Config::static_svcs ()->
+ insert (&ace_svc_desc_TAO_ECG_Mcast_Gateway);
+}
+
+
+int
+TAO_ECG_Mcast_Gateway::fini (void)
+{
+ return 0;
+}
+
+int
+TAO_ECG_Mcast_Gateway::init (int argc, ACE_TCHAR* argv[])
+{
+ int result = 0;
+
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ while (arg_shifter.is_anything_left ())
+ {
+ const ACE_TCHAR *arg = arg_shifter.get_current ();
+
+ if (ACE_OS::strcasecmp (arg, ACE_TEXT ("-ECGService")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT ("receiver")) == 0)
+ this->service_type_ = ECG_MCAST_RECEIVER;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT ("sender")) == 0)
+ this->service_type_ = ECG_MCAST_SENDER;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT ("two_way")) == 0)
+ this->service_type_ = ECG_MCAST_TWO_WAY;
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Unsupported <-ECGService> option ")
+ ACE_TEXT ("value: <%s>. Ignoring this option ")
+ ACE_TEXT ("- using defaults instead.\n"),
+ opt));
+ result = -1;
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT ("-ECGAddressServer")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT ("basic")) == 0)
+ this->address_server_type_ = ECG_ADDRESS_SERVER_BASIC;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT ("source")) == 0)
+ this->address_server_type_ = ECG_ADDRESS_SERVER_SOURCE;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT ("type")) == 0)
+ this->address_server_type_ = ECG_ADDRESS_SERVER_TYPE;
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Unsupported <-ECGAddressServer> ")
+ ACE_TEXT ("option value: <%s>. Ignoring this ")
+ ACE_TEXT ("option - using defaults instead.\n"),
+ opt));
+ result = -1;
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT ("-ECGAddressServerArg")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->address_server_arg_.set (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT ("-ECGHandler")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT ("basic")) == 0)
+ this->handler_type_ = ECG_HANDLER_BASIC;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT ("complex")) == 0)
+ this->handler_type_ = ECG_HANDLER_COMPLEX;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT ("udp")) == 0)
+ this->handler_type_ = ECG_HANDLER_UDP;
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Unsupported <-ECGHandler> ")
+ ACE_TEXT ("option value: <%s>. Ignoring this ")
+ ACE_TEXT ("option - using defaults instead.\n"),
+ opt));
+ result = -1;
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT ("-ECGTTL")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ unsigned long tmp = ACE_OS::strtoul (opt, 0, 0) & 0xff;
+ this->ttl_value_ = static_cast<u_char> (tmp);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT ("-ECGNIC")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->nic_.set (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT ("-ECGIPMULTICASTLOOP")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->ip_multicast_loop_ =
+ (ACE_OS::atoi(arg_shifter.get_current()) != 0);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT ("-ECGNONBLOCKING")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->non_blocking_ =
+ (ACE_OS::atoi(arg_shifter.get_current()) != 0);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else
+ {
+ arg_shifter.ignore_arg ();
+ ACE_DEBUG ((LM_WARNING,
+ ACE_TEXT ("Ignoring <%s> option ")
+ ACE_TEXT ("during initialization.\n"),
+ arg));
+ result = -1;
+ }
+ }
+
+ if (this->validate_configuration () == -1)
+ return -1;
+ else
+ return result;
+}
+
+int
+TAO_ECG_Mcast_Gateway::init (const char * address_server_arg,
+ const Attributes & attr)
+{
+ this->address_server_arg_.set (address_server_arg);
+
+ this->address_server_type_ = attr.address_server_type;
+ this->handler_type_ = attr.handler_type;
+ this->service_type_ = attr.service_type;
+ this->ttl_value_ = attr.ttl_value;
+ this->nic_.set (attr.nic.c_str ());
+ this->ip_multicast_loop_ = attr.ip_multicast_loop;
+ this->non_blocking_ = attr.non_blocking;
+
+ return this->validate_configuration ();
+}
+
+int
+TAO_ECG_Mcast_Gateway::init (
+ const RtecEventChannelAdmin::ConsumerQOS & consumer_qos,
+ const char * address_server_arg,
+ const Attributes & attributes)
+{
+ this->consumer_qos_ = consumer_qos;
+ return this->init (address_server_arg,
+ attributes);
+}
+
+int
+TAO_ECG_Mcast_Gateway::validate_configuration (void)
+{
+ if ((this->handler_type_ == ECG_HANDLER_BASIC
+ || this->handler_type_ == ECG_HANDLER_UDP)
+ && this->service_type_ != ECG_MCAST_SENDER
+ && this->address_server_type_ != ECG_ADDRESS_SERVER_BASIC)
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "Configurations for mcast handler and "
+ "address server do not match.\n"));
+ return -1;
+ }
+
+ // Currently all Address Server implementations require an
+ // initialization string. If we ever add a new Address Server
+ // implementation, which does not, we'll have to remove this check.
+ if (this->address_server_arg_.length () == 0)
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "Address server initializaton "
+ "argument not specified.\n"));
+ return -1;
+ }
+
+ if (this->ip_multicast_loop_ != 0
+ && this->ip_multicast_loop_ != 1)
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "IP MULTICAST LOOP option must have a boolean value.\n"));
+ return -1;
+ }
+
+ if (this->non_blocking_ != 0
+ && this->non_blocking_ != 1)
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "NON BLOCKING flag must have a boolean value.\n"));
+ return -1;
+ }
+
+ return 0;
+}
+
+TAO_ECG_Refcounted_Endpoint
+TAO_ECG_Mcast_Gateway::init_endpoint (void)
+{
+ TAO_ECG_UDP_Out_Endpoint* endpoint = 0;
+ TAO_ECG_Refcounted_Endpoint refendpoint;
+
+ // Try to allocate a new endpoint from the heap
+ ACE_NEW_NORETURN (endpoint,
+ TAO_ECG_UDP_Out_Endpoint);
+
+ if (endpoint != 0)
+ {
+ refendpoint.reset (endpoint);
+ }
+ else
+ {
+ return TAO_ECG_Refcounted_Endpoint ();
+ }
+
+ ACE_SOCK_Dgram& dgram = refendpoint->dgram ();
+
+ if (dgram.open (ACE_Addr::sap_any) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Cannot open dgram "
+ "for sending mcast messages.\n"));
+ return TAO_ECG_Refcounted_Endpoint ();
+ }
+
+ if (this->nic_.length () != 0)
+ {
+ dgram.set_nic (this->nic_.c_str ());
+ }
+
+ if (this->ttl_value_ > 0)
+ {
+ if (dgram.ACE_SOCK::set_option (IPPROTO_IP,
+ IP_MULTICAST_TTL,
+ &this->ttl_value_,
+ sizeof (this->ttl_value_))
+ == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Error setting TTL option on dgram "
+ "for sending mcast messages.\n"));
+ return TAO_ECG_Refcounted_Endpoint ();
+ }
+ }
+
+ if (dgram.ACE_SOCK::set_option (IPPROTO_IP,
+ IP_MULTICAST_LOOP,
+ &this->ip_multicast_loop_,
+ sizeof (this->ip_multicast_loop_)) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Error setting MULTICAST_LOOP option "
+ "on dgram for sending mcast messages.\n"));
+ return TAO_ECG_Refcounted_Endpoint ();
+ }
+
+ if (this->non_blocking_
+ && dgram.enable(ACE_NONBLOCK) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Error setting NON BLOCKING option.\n"));
+ return TAO_ECG_Refcounted_Endpoint ();
+ }
+
+ return refendpoint;
+}
+
+PortableServer::ServantBase *
+TAO_ECG_Mcast_Gateway::init_address_server (void)
+{
+ const char * address_server_arg =
+ (this->address_server_arg_.length ())
+ ? this->address_server_arg_.c_str () : 0;
+
+ if (this->address_server_type_ == ECG_ADDRESS_SERVER_BASIC)
+ {
+ TAO_EC_Servant_Var<TAO_ECG_Simple_Address_Server> impl =
+ TAO_ECG_Simple_Address_Server::create ();
+ if (!impl.in ())
+ return 0;
+
+ if (impl->init (address_server_arg) == -1)
+ {
+ return 0;
+ }
+ return impl._retn ();
+ }
+
+ else if (this->address_server_type_ == ECG_ADDRESS_SERVER_SOURCE)
+ {
+ TAO_EC_Servant_Var<TAO_ECG_Complex_Address_Server> impl =
+ TAO_ECG_Complex_Address_Server::create (1);
+ if (!impl.in ())
+ return 0;
+
+ if (impl->init (address_server_arg) == -1)
+ {
+ return 0;
+ }
+ return impl._retn ();
+ }
+
+ else if (this->address_server_type_ == ECG_ADDRESS_SERVER_TYPE)
+ {
+ TAO_EC_Servant_Var<TAO_ECG_Complex_Address_Server> impl =
+ TAO_ECG_Complex_Address_Server::create (0);
+ if (!impl.in ())
+ return 0;
+
+ if (impl->init (address_server_arg) == -1)
+ {
+ return 0;
+ }
+ return impl._retn ();
+ }
+
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Cannot create address server: "
+ "unknown address server type specified.\n"));
+ return 0;
+ }
+}
+
+TAO_ECG_Refcounted_Handler
+TAO_ECG_Mcast_Gateway::init_handler (TAO_ECG_Dgram_Handler *receiver,
+ RtecEventChannelAdmin::EventChannel_ptr ec,
+ ACE_Reactor *reactor
+ ACE_ENV_ARG_DECL)
+{
+ TAO_ECG_Refcounted_Handler handler;
+
+ const char * nic =
+ (this->nic_.length ()) ? this->nic_.c_str () : 0;
+ const char * address_server_arg =
+ (this->address_server_arg_.length ())
+ ? this->address_server_arg_.c_str () : 0;
+
+ if (this->handler_type_ == ECG_HANDLER_BASIC)
+ {
+ TAO_ECG_Simple_Mcast_EH * h = 0;
+ ACE_NEW_RETURN (h,
+ TAO_ECG_Simple_Mcast_EH (receiver),
+ handler);
+ handler.reset (h);
+
+ h->reactor (reactor);
+ if (h->open (address_server_arg, nic) != 0)
+ return TAO_ECG_Refcounted_Handler ();
+ }
+
+ else if (this->handler_type_ == ECG_HANDLER_COMPLEX)
+ {
+ TAO_ECG_Mcast_EH * h = 0;
+ ACE_NEW_RETURN (h,
+ TAO_ECG_Mcast_EH (receiver, nic),
+ handler);
+ handler.reset (h);
+
+ h->reactor (reactor);
+
+ h->open (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (TAO_ECG_Refcounted_Handler ());
+ }
+
+ else if (this->handler_type_ == ECG_HANDLER_UDP)
+ {
+ TAO_ECG_UDP_EH * h = 0;
+ ACE_NEW_RETURN (h,
+ TAO_ECG_UDP_EH (receiver),
+ handler);
+ handler.reset (h);
+ h->reactor (reactor);
+
+ ACE_INET_Addr ipaddr;
+ if (ipaddr.set (address_server_arg) != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "ERROR using address server argument "
+ "in ACE_INET_Addr.set ().\n"));
+ return TAO_ECG_Refcounted_Handler ();
+ }
+ if (h->open (ipaddr) != 0)
+ return TAO_ECG_Refcounted_Handler ();
+ }
+
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Cannot create handler: unknown "
+ "handler type specified.\n"));
+ return handler;
+ }
+
+ return handler;
+}
+
+TAO_EC_Servant_Var<TAO_ECG_UDP_Sender>
+TAO_ECG_Mcast_Gateway::init_sender (
+ RtecEventChannelAdmin::EventChannel_ptr ec,
+ RtecUDPAdmin::AddrServer_ptr address_server,
+ TAO_ECG_Refcounted_Endpoint endpoint_rptr
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EC_Servant_Var<TAO_ECG_UDP_Sender>
+ sender (TAO_ECG_UDP_Sender::create ());
+ if (!sender.in ())
+ return sender;
+
+ sender->init (ec,
+ address_server,
+ endpoint_rptr
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> ());
+
+ TAO_EC_Auto_Command<UDP_Sender_Shutdown> sender_shutdown;
+ sender_shutdown.set_command (UDP_Sender_Shutdown (sender));
+
+ if (this->consumer_qos_.dependencies.length () > 0)
+ {
+ // Client supplied consumer qos. Use it.
+ this->consumer_qos_.is_gateway = 1;
+ sender->connect (this->consumer_qos_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> ());
+ }
+ else
+ {
+ // Client did not specify anything - subscribe to all events.
+ ACE_ConsumerQOS_Factory consumer_qos_factory;
+ consumer_qos_factory.start_disjunction_group (1);
+ consumer_qos_factory.insert (ACE_ES_EVENT_SOURCE_ANY,
+ ACE_ES_EVENT_ANY,
+ 0);
+ RtecEventChannelAdmin::ConsumerQOS & qos =
+ const_cast<RtecEventChannelAdmin::ConsumerQOS &> (consumer_qos_factory.get_ConsumerQOS ());
+ qos.is_gateway = 1;
+
+ sender->connect (qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> ());
+ }
+
+ sender_shutdown.disallow_command ();
+ return sender;
+}
+
+TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver>
+TAO_ECG_Mcast_Gateway::init_receiver (
+ RtecEventChannelAdmin::EventChannel_ptr ec,
+ RtecUDPAdmin::AddrServer_ptr address_server,
+ TAO_ECG_Refcounted_Endpoint endpoint_rptr
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver>
+ receiver (TAO_ECG_UDP_Receiver::create ());
+ if (!receiver.in ())
+ return receiver;
+
+ receiver->init (ec,
+ endpoint_rptr,
+ address_server
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> ());
+
+ TAO_EC_Auto_Command<UDP_Receiver_Shutdown> receiver_shutdown;
+ receiver_shutdown.set_command (UDP_Receiver_Shutdown (receiver));
+
+ ACE_SupplierQOS_Factory supplier_qos_factory;
+ supplier_qos_factory.insert (ACE_ES_EVENT_SOURCE_ANY,
+ ACE_ES_EVENT_ANY,
+ 0, 1);
+ RtecEventChannelAdmin::SupplierQOS & qos =
+ const_cast<RtecEventChannelAdmin::SupplierQOS &> (supplier_qos_factory.get_SupplierQOS ());
+ qos.is_gateway = 1;
+
+ receiver->connect (qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> ());
+
+ receiver_shutdown.disallow_command ();
+ return receiver;
+}
+
+void
+TAO_ECG_Mcast_Gateway::verify_args (CORBA::ORB_ptr orb,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ if (CORBA::is_nil (ec))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Nil event channel argument passed to "
+ "TAO_ECG_Mcast_Gateway::run().\n"));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+ if (CORBA::is_nil (orb))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Nil orb argument passed to "
+ "TAO_ECG_Mcast_Gateway::run().\n"));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+}
+
+void
+TAO_ECG_Mcast_Gateway::run (CORBA::ORB_ptr orb,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ // Verify args.
+ this->verify_args (orb, ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Auto-cleanup objects.
+ TAO_EC_Object_Deactivator address_server_deactivator;
+ TAO_EC_Auto_Command<UDP_Sender_Shutdown> sender_shutdown;
+ TAO_EC_Auto_Command<UDP_Receiver_Shutdown> receiver_shutdown;
+
+ // Set up address server.
+ PortableServer::ServantBase_var address_server_servant =
+ this->init_address_server ();
+ if (!address_server_servant.in ())
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "Unable to create address server.\n"));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ RtecUDPAdmin::AddrServer_var address_server;
+
+ PortableServer::POA_var poa =
+ address_server_servant->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ activate (address_server,
+ poa.in (),
+ address_server_servant.in (),
+ address_server_deactivator
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_ECG_Refcounted_Endpoint endpoint_rptr;
+ TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> sender;
+
+ // Set up event sender.
+ if (this->service_type_ == ECG_MCAST_SENDER
+ || this->service_type_ == ECG_MCAST_TWO_WAY)
+ {
+ endpoint_rptr = this->init_endpoint ();
+ if (endpoint_rptr.get () == 0)
+ {
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ sender = this->init_sender (ec,
+ address_server.in (),
+ endpoint_rptr
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ if (!sender.in ())
+ {
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ sender_shutdown.set_command (UDP_Sender_Shutdown (sender));
+ }
+
+ // Set up event receiver.
+ TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> receiver;
+ if (this->service_type_ == ECG_MCAST_RECEIVER
+ || this->service_type_ == ECG_MCAST_TWO_WAY)
+ {
+ ACE_Reactor *reactor = orb->orb_core ()->reactor ();
+
+ receiver = this->init_receiver (ec,
+ address_server.in (),
+ endpoint_rptr
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ if (!receiver.in ())
+ {
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ receiver_shutdown.set_command (UDP_Receiver_Shutdown (receiver));
+
+ TAO_ECG_Refcounted_Handler
+ handler_rptr (this->init_handler (receiver.in (),
+ ec,
+ reactor
+ ACE_ENV_ARG_PARAMETER));
+ ACE_CHECK;
+ if (handler_rptr.get () == 0)
+ {
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+ receiver->set_handler_shutdown (handler_rptr);
+ }
+
+ // Everything went ok - disable auto-cleanup.
+ address_server_deactivator.disallow_deactivation ();
+ receiver_shutdown.disallow_command ();
+ sender_shutdown.disallow_command ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+ACE_STATIC_SVC_DEFINE (TAO_ECG_Mcast_Gateway,
+ ACE_TEXT ("ECG_Mcast_Gateway"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_ECG_Mcast_Gateway),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
+ACE_FACTORY_DEFINE (TAO_RTEvent_Serv, TAO_ECG_Mcast_Gateway)
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.h
new file mode 100644
index 00000000000..827d6ae20ac
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.h
@@ -0,0 +1,290 @@
+// -*- C++ -*-
+
+/**
+ * @file ECG_Mcast_Gateway.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak (marina@atdesk.com)
+ */
+
+#ifndef TAO_ECG_MCAST_GATEWAY_H
+#define TAO_ECG_MCAST_GATEWAY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/ECG_UDP_Sender.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/ECG_Defaults.h"
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+#include "orbsvcs/Event/ECG_UDP_Receiver.h"
+#include "orbsvcs/Event/ECG_UDP_Out_Endpoint.h"
+#include "ace/Service_Object.h"
+#include "ace/Service_Config.h"
+#include "ace/SString.h"
+#include "ace/os_include/os_stdint.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Event_Handler;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ECG_Mcast_Gateway
+ *
+ * @brief Implement the builder for setting up Event Channel multicast
+ * gateway.
+ * NOT THREAD-SAFE.
+ *
+ * This class simplifies creation of federated Event Channels by
+ * presenting a simple unified interface for creating and configuring
+ * all components needed to federate an Event Channel.
+ * Configuration options are described below.
+ *
+ * NOTE: This class does not own any of the components it creates and
+ * its lifetime is independent of theirs. This class acts purely as a
+ * wrapper facade for creating and wiring appropriate components
+ * together.
+ *
+ * @todo This class is an ACE_Service_Object, but the only reason for
+ * it is the need for easy configuration using files. Since
+ * ACE_Service_Object provides much more than that, we should look
+ * into replacing it with a more lightweight utility that would serve
+ * our needs.
+ *
+ * CONFIGURATION OPTIONS
+ * There are two ways to use this class:
+ * 1) Use service config file to specify configuration options (which
+ * are described below), and use service configurator to obtain a
+ * an instance of configured TAO_ECG_Mcast_Gateway in your program. (See
+ * TAO/orbsvcs/tests/Event/Mcast/Common and
+ * TAO/orbsvcs/tests/Event/Mcast/Simple for an example.)
+ *
+ * Service config file options:
+ *
+ * -ECGService <service>
+ * Valid values: sender, receiver, two_way
+ * Specifies whether this gateway should act as a multicast sender of
+ * the events or multicast receiver, or both.
+ *
+ * -ECGAddressServer <server_type>
+ * Valid values: basic, source, type
+ * Specifies what implementation of the address server should be used
+ * by the gateway. basic - the same multicast address is returned for
+ * all event headers. source - multicast addresses are returned based
+ * on the event source, according to the mapping provided at
+ * initialization. type - multicast addresses are returned based
+ * on the event type, according to the mapping provided at
+ * initialization.
+ *
+ * -ECGAddressServerArg <arg>
+ * Valid value: arg is a string, whose format requirements are
+ * specific to the implementation of address server used.
+ * Arg is not interpreted by the gateway, but simply passed to the
+ * address server specified by -ECGAddressServer during initialization.
+ * THIS OPTION MUST ALWAYS BE SPECIFIED BY THE USER (there is no
+ * default value for it)
+ *
+ * -ECGHandler <handler_type>
+ * Valid values: basic, complex, udp
+ * Specifies what implementation of event handler should be used if
+ * gateway is acting as events receiver. basic - a simple event
+ * handler listening on a single mcast address. complex -
+ * event handler listening on multiple mcast addresses based on
+ * events of interest to consumers. udp - similar to basic handler,
+ * except listens on udp address as opposed to a multicast group.
+ *
+ * -ECGTTL <ttl>
+ * Valid values: a number > 0
+ * IP_Multicast time to live value that should be set on a sending socket.
+ * This option matters only if the gateway is acting as a sender of
+ * mcast messages.
+ *
+ * -ECGNIC <nic>
+ * Valid values: name of the network interface
+ * This interface is used for sending and/or receiving multicast messages.
+ *
+ * -ECGNonBlocking
+ * Boolean flag to configure if the socket is in blocking or
+ * non-blocking code. The default is non-blocking.
+ * NOTE: Certain device drivers block the process if the physical
+ * link fails.
+ *
+ *
+ * 2) Create an instance of TAO_ECG_Mcast_Gateway in your code, on the stack or
+ * dynamically, and use init () method to configure it. No
+ * configuration files involved. See service config options above for the
+ * description of configurable options, and init() method below for how
+ * to specify them.
+ *
+ *
+ * Default configuration values (for either use case) can be found in
+ * ECG_Defaults.h
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_Mcast_Gateway
+ : public ACE_Service_Object
+{
+public:
+
+ /// The Service_Object entry points.
+ //@{
+ virtual int init (int argc, ACE_TCHAR* argv[]);
+ virtual int fini (void);
+ //@}
+
+ /// Helper function to register the Gateway into the service
+ /// configurator.
+ static int init_svcs (void);
+
+ /// Constructor.
+ TAO_ECG_Mcast_Gateway (void);
+
+ /// Values for some configuration parameters to init ().
+ //@{
+ enum Service_Type {ECG_MCAST_SENDER,
+ ECG_MCAST_RECEIVER,
+ ECG_MCAST_TWO_WAY};
+
+ enum Address_Server_Type {ECG_ADDRESS_SERVER_BASIC,
+ ECG_ADDRESS_SERVER_SOURCE,
+ ECG_ADDRESS_SERVER_TYPE};
+
+ enum Handler_Type {ECG_HANDLER_BASIC,
+ ECG_HANDLER_COMPLEX,
+ ECG_HANDLER_UDP};
+ //@}
+
+ /**
+ * @struct Attributes
+ *
+ * @brief Helper class to initialize a TAO_ECG_Mcast_Gateway.
+ *
+ * The TAO_ECG_Mcast_Gateway class has several properties that can
+ * be configured at initialization time, with default values. The
+ * canonical trick of using a constructor or init() method with
+ * multiple arguments does not work because to change the last
+ * argument the application developer needs to know all the other
+ * defaults.
+ *
+ * Instead we define a helper class that initializes all the fields
+ * to reasonable defaults. The application only sets the fields
+ * that it is interested into, if new fields are added applications
+ * do not need to change.
+ *
+ * With a little trickery we can even eliminate named temporaries:
+ *
+ * TAO_ECG_Mcast_Gateway gw;<BR>
+ * gw.init(TAO_ECG_Mcast_Gateway::Attributes().set_foo(x).set_bar(y));
+ *
+ * but we are not implementing that one (detecting errors is too
+ * hard without exceptions and ACE+TAO are somewhat shy of
+ * exceptions at this point.)
+ */
+ struct TAO_RTEvent_Serv_Export Attributes
+ {
+ Attributes (void);
+
+ Address_Server_Type address_server_type;
+ Handler_Type handler_type;
+ Service_Type service_type;
+ u_char ttl_value;
+ ACE_CString nic;
+ int ip_multicast_loop;
+ int non_blocking;
+ };
+
+ /// Configure TAO_ECG_Mcast_Gateway programatically. This method should
+ /// be used when NOT using service configurator to obtain/configure
+ /// TAO_ECG_Mcast_Gateway. See class documentation above for more
+ /// info.
+ int init (const char * address_server_arg,
+ const Attributes & attributes = Attributes());
+
+ /// Same as the method above, but also gives the client an opportunity to
+ /// specify consumer qos, i.e., which EC traffic should get multicasted.
+ /*
+ * By default, multicast sender subscribes to all events in the
+ * Event Channel, i.e., all events pushed to the EC get multicasted
+ * (as long as their ttl is > 0). This method allows clients to
+ * specify a more restrictive qos, hence limiting which EC traffic
+ * gets multicasted.
+ */
+ int init (const RtecEventChannelAdmin::ConsumerQOS & consumer_qos,
+ const char * address_server_arg,
+ const Attributes & attributes = Attributes());
+
+ /// The main method - create, configure and run federation
+ /// components according to the specified configuration.
+ void run (CORBA::ORB_ptr orb,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+
+private:
+
+ /// Helpers.
+ //@{
+ /// Check that arguments to run() are not nil.
+ void verify_args (CORBA::ORB_ptr orb,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+
+ /// Verifies configuration values specified through init() make sense.
+ int validate_configuration (void);
+ //@}
+
+ /// Allocate and initialize appropriate objects.
+ //@{
+ PortableServer::ServantBase *
+ init_address_server (void);
+
+ TAO_EC_Servant_Var<TAO_ECG_UDP_Sender>
+ init_sender (RtecEventChannelAdmin::EventChannel_ptr ec,
+ RtecUDPAdmin::AddrServer_ptr address_server,
+ TAO_ECG_Refcounted_Endpoint endpoint_rptr
+ ACE_ENV_ARG_DECL);
+
+ TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver>
+ init_receiver (RtecEventChannelAdmin::EventChannel_ptr ec,
+ RtecUDPAdmin::AddrServer_ptr address_server,
+ TAO_ECG_Refcounted_Endpoint endpoint_rptr
+ ACE_ENV_ARG_DECL);
+
+ TAO_ECG_Refcounted_Endpoint init_endpoint (void);
+
+ TAO_ECG_Refcounted_Handler
+ init_handler (TAO_ECG_Dgram_Handler *recv,
+ RtecEventChannelAdmin::EventChannel_ptr ec,
+ ACE_Reactor * reactor
+ ACE_ENV_ARG_DECL);
+ //@}
+
+ /// Flags controlling configuration.
+ //@{
+ Service_Type service_type_;
+ Handler_Type handler_type_;
+ Address_Server_Type address_server_type_;
+ ACE_CString address_server_arg_;
+ u_char ttl_value_;
+ ACE_CString nic_;
+ int ip_multicast_loop_;
+ int non_blocking_;
+
+ RtecEventChannelAdmin::ConsumerQOS consumer_qos_;
+ //@}
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_Mcast_Gateway.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_STATIC_SVC_DECLARE (TAO_ECG_Mcast_Gateway)
+ACE_FACTORY_DECLARE (TAO_RTEvent_Serv, TAO_ECG_Mcast_Gateway)
+
+#include /**/ "ace/post.h"
+#endif /* TAO_ECG_MCAST_GATEWAY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.i b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.i
new file mode 100644
index 00000000000..8e126abb9b6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.i
@@ -0,0 +1,34 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_ECG_Mcast_Gateway::TAO_ECG_Mcast_Gateway (void)
+ : service_type_ (TAO_ECG_DEFAULT_SERVICE)
+ , handler_type_ (TAO_ECG_DEFAULT_HANDLER)
+ , address_server_type_ (TAO_ECG_DEFAULT_ADDRESS_SERVER)
+ , address_server_arg_ ((const char *) TAO_ECG_DEFAULT_ADDRESS_SERVER_ARG)
+ , ttl_value_ (TAO_ECG_DEFAULT_TTL)
+ , nic_ (static_cast<const char *> (TAO_ECG_DEFAULT_NIC))
+ , ip_multicast_loop_ (TAO_ECG_DEFAULT_IP_MULTICAST_LOOP)
+ , non_blocking_ (TAO_ECG_DEFAULT_NON_BLOCKING)
+ , consumer_qos_ ()
+{
+ this->consumer_qos_.dependencies.length (0);
+}
+
+ACE_INLINE
+TAO_ECG_Mcast_Gateway::Attributes::Attributes (void)
+ : address_server_type (TAO_ECG_DEFAULT_ADDRESS_SERVER)
+ , handler_type (TAO_ECG_DEFAULT_HANDLER)
+ , service_type (TAO_ECG_DEFAULT_SERVICE)
+ , ttl_value (TAO_ECG_DEFAULT_TTL)
+ , nic (static_cast<const char *> (TAO_ECG_DEFAULT_NIC))
+ , ip_multicast_loop (TAO_ECG_DEFAULT_IP_MULTICAST_LOOP)
+ , non_blocking (TAO_ECG_DEFAULT_NON_BLOCKING)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.cpp
new file mode 100644
index 00000000000..0906d59820f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.cpp
@@ -0,0 +1,253 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Gateway_IIOP.h"
+#include "orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.h"
+#include "tao/Messaging/Messaging.h"
+#include "tao/ORB_Core.h"
+
+#include "ace/Reactor.h"
+
+ACE_RCSID(Event, ECG_Reactive_ConsumerEventChannelControl, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ECG_Reactive_ConsumerEC_Control::
+ TAO_ECG_Reactive_ConsumerEC_Control (const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ TAO_EC_Gateway_IIOP* gateway,
+ CORBA::ORB_ptr orb)
+ : rate_ (rate),
+ timeout_ (timeout),
+ adapter_ (this),
+ gateway_ (gateway),
+ orb_ (CORBA::ORB::_duplicate (orb))
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ , timer_id_ (-1)
+#endif /* TAO_HAS_CORBA_MESSAGING != 0*/
+{
+ this->reactor_ =
+ this->orb_->orb_core ()->reactor ();
+}
+
+TAO_ECG_Reactive_ConsumerEC_Control::~TAO_ECG_Reactive_ConsumerEC_Control (void)
+{
+}
+
+void
+TAO_ECG_Reactive_ConsumerEC_Control::query_eventchannel (
+ ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CORBA::Boolean disconnected;
+ CORBA::Boolean non_existent =
+ gateway_->consumer_ec_non_existent (disconnected
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (non_existent && !disconnected)
+ {
+ this->event_channel_not_exist (gateway_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ this->event_channel_not_exist (gateway_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TRANSIENT, transient)
+ {
+ // This is TAO's minor code for a failed connection, we may
+ // want to be more lenient in the future..
+ // if (transient.minor () == 0x54410085)
+ this->event_channel_not_exist (gateway_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_ECG_Reactive_ConsumerEC_Control::handle_timeout (
+ const ACE_Time_Value &,
+ const void *)
+{
+ // NOTE, setting RELATIVE_RT_TIMEOUT_POLICY for the duration of
+ // query_eventchannel () below has greater impact than desired. For
+ // example, while we are pinging ec here, a nested upcall,
+ // which requires making remote calls may come into the ORB. Those
+ // remote calls will be carried out with with
+ // RELATIVE_RT_TIMEOUT_POLICY set here in effect.
+
+ // @@ TODO: should use Guard to set and reset policies.
+ ACE_TRY_NEW_ENV
+ {
+ // Query the state of the Current object *before* we initiate
+ // the iteration...
+ CORBA::PolicyTypeSeq types;
+ CORBA::PolicyList_var policies =
+ this->policy_current_->get_policy_overrides (types
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Change the timeout
+ this->policy_current_->set_policy_overrides (this->policy_list_,
+ CORBA::ADD_OVERRIDE
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Query the state of the consumers...
+ this->query_eventchannel (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->policy_current_->set_policy_overrides (policies.in (),
+ CORBA::SET_OVERRIDE
+ 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;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+int
+TAO_ECG_Reactive_ConsumerEC_Control::activate (void)
+{
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ ACE_TRY_NEW_ENV
+ {
+ // Get the PolicyCurrent object
+ CORBA::Object_var tmp =
+ this->orb_->resolve_initial_references ("PolicyCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->policy_current_ =
+ CORBA::PolicyCurrent::_narrow (tmp.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Timeout for polling state (default = 10 msec)
+ TimeBase::TimeT timeout = timeout_.usec() * 10;
+ CORBA::Any any;
+ any <<= timeout;
+
+ this->policy_list_.length (1);
+ this->policy_list_[0] =
+ this->orb_->create_policy (
+ Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
+ any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Only schedule the timer, when the rate is not zero
+ if (this->rate_ != ACE_Time_Value::zero)
+ {
+ // Schedule the timer after these policies has been set, because the
+ // handle_timeout uses these policies, if done in front, the channel
+ // can crash when the timeout expires before initiazation is ready.
+ timer_id_ = this->reactor_->schedule_timer (&this->adapter_,
+ 0,
+ this->rate_,
+ this->rate_);
+ if (timer_id_ == -1)
+ return -1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+#endif /* TAO_HAS_CORBA_MESSAGING */
+
+ return 0;
+}
+
+int
+TAO_ECG_Reactive_ConsumerEC_Control::shutdown (void)
+{
+ int r = 0;
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ r = this->reactor_->cancel_timer (timer_id_);
+#endif /* TAO_HAS_CORBA_MESSAGING */
+
+ this->adapter_.reactor (0);
+ return r;
+}
+
+void
+TAO_ECG_Reactive_ConsumerEC_Control::event_channel_not_exist (
+ TAO_EC_Gateway_IIOP* gateway
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "EC_Reactive_ConsumerControl(%P|%t) - "
+ "channel %x does not exists\n"));
+ gateway->cleanup_consumer_ec ();
+
+ gateway->cleanup_consumer_proxies (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_EC_Reactive_ConsumerControl::event_channel_not_exist");
+ // Ignore all exceptions..
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_ECG_Reactive_ConsumerEC_Control::system_exception (
+ TAO_EC_Gateway_IIOP* gateway,
+ CORBA::SystemException & /* exception */
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ gateway->cleanup_consumer_ec ();
+
+ gateway->cleanup_consumer_proxies (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions..
+ }
+ ACE_ENDTRY;
+}
+
+// ****************************************************************
+
+TAO_ECG_Reactive_ConsumerEC_Control_Adapter::TAO_ECG_Reactive_ConsumerEC_Control_Adapter (
+ TAO_ECG_Reactive_ConsumerEC_Control *adaptee)
+ : adaptee_ (adaptee)
+{
+}
+
+int
+TAO_ECG_Reactive_ConsumerEC_Control_Adapter::handle_timeout (
+ const ACE_Time_Value &tv,
+ const void *arg)
+{
+ this->adaptee_->handle_timeout (tv, arg);
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.h
new file mode 100644
index 00000000000..e7ccad73c2a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.h
@@ -0,0 +1,133 @@
+// -*- C++ -*-
+
+/**
+ * @file ECG_Reactive_ConsumerEC_Control.h
+ *
+ * $Id$
+ *
+ * @author Johnny Willemsen (jwillemsen@remedy.nl)
+ *
+ */
+
+#ifndef TAO_ECG_REACTIVE_CONSUMEREC_CONTROL_H
+#define TAO_ECG_REACTIVE_CONSUMEREC_CONTROL_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/ECG_ConsumerEC_Control.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/ORB.h"
+#include "tao/PolicyC.h"
+
+#include "ace/Event_Handler.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ECG_Reactive_ConsumerEC_Control;
+class TAO_EC_Gateway_IIOP;
+
+/**
+ * @class TAO_ECG_Reactive_ConsumerEC_Control_Adapter
+ *
+ * @brief Forwards timeout events to the Reactive ConsumerControl
+ *
+ * The Reactive ConsumerControl strategy uses the reactor to
+ * periodically wakeup and verify the state of the consumers
+ * registered with the Event Channel.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_Reactive_ConsumerEC_Control_Adapter
+ : public ACE_Event_Handler
+{
+public:
+ /// Constructor
+ TAO_ECG_Reactive_ConsumerEC_Control_Adapter (TAO_ECG_Reactive_ConsumerEC_Control *adaptee);
+
+ // = Documented in ACE_Event_Handler.
+ virtual int handle_timeout (const ACE_Time_Value &tv,
+ const void *arg = 0);
+
+private:
+ /// The adapted object
+ TAO_ECG_Reactive_ConsumerEC_Control *adaptee_;
+};
+
+/**
+ * @class TAO_ECG_Reactive_ConsumerEC_Control
+ *
+ * @brief Consumer event channel control
+ *
+ * Defines the interface for the consumer event channel control strategy.
+ * This strategy handles misbehaving or failing consumer event channels.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_Reactive_ConsumerEC_Control
+ : public TAO_ECG_ConsumerEC_Control
+{
+public:
+ /// Constructor. It does not assume ownership of the @a event_channel
+ /// parameter.
+ TAO_ECG_Reactive_ConsumerEC_Control (const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ TAO_EC_Gateway_IIOP* gateway,
+ CORBA::ORB_ptr orb);
+
+ /// Destructor.
+ virtual ~TAO_ECG_Reactive_ConsumerEC_Control (void);
+
+ /// Receive the timeout from the adapter
+ void handle_timeout (const ACE_Time_Value &tv,
+ const void* arg);
+
+ // = Documented in TAO_EC_ConsumerControl
+ virtual int activate (void);
+ virtual int shutdown (void);
+ virtual void event_channel_not_exist (TAO_EC_Gateway_IIOP *gateway
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void system_exception (TAO_EC_Gateway_IIOP *gateway,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+private:
+ /// Check if the consumers still exists. It is a helper method for
+ /// handle_timeout() to isolate the exceptions.
+ void query_eventchannel (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// The polling rate
+ ACE_Time_Value rate_;
+
+ /// The polling timeout
+ ACE_Time_Value timeout_;
+
+ /// The Adapter for the reactor events
+ TAO_ECG_Reactive_ConsumerEC_Control_Adapter adapter_;
+
+ /// The gateway
+ TAO_EC_Gateway_IIOP* gateway_;
+
+ /// The ORB
+ CORBA::ORB_var orb_;
+
+ /// To control the timeout policy in the thread
+ CORBA::PolicyCurrent_var policy_current_;
+
+ /// Precomputed policy list to the set timeout.
+ CORBA::PolicyList policy_list_;
+
+ /// The ORB reactor
+ ACE_Reactor *reactor_;
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ /// The timer id
+ long timer_id_;
+#endif /* TAO_HAS_CORBA_MESSAGING */
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_ECG_REACTIVE_CONSUMEREC_CONTROL_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.cpp
new file mode 100644
index 00000000000..2e14b4da681
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.cpp
@@ -0,0 +1,319 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Gateway_IIOP.h"
+#include "orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.h"
+#include "tao/Messaging/Messaging.h"
+#include "tao/ORB_Core.h"
+#include "ace/Reactor.h"
+
+ACE_RCSID(Event, ECG_Reconnect_ConsumerEventChannelControl, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ECG_Reconnect_ConsumerEC_Control::
+ TAO_ECG_Reconnect_ConsumerEC_Control (const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ TAO_EC_Gateway_IIOP* gateway,
+ CORBA::ORB_ptr orb)
+ : rate_ (rate),
+ timeout_ (timeout),
+ adapter_ (this),
+ gateway_ (gateway),
+ orb_ (CORBA::ORB::_duplicate (orb)),
+ is_consumer_ec_connected_ (1)
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ , timer_id_ (-1)
+#endif /* TAO_HAS_CORBA_MESSAGING != 0*/
+{
+ this->reactor_ =
+ this->orb_->orb_core ()->reactor ();
+}
+
+TAO_ECG_Reconnect_ConsumerEC_Control::~TAO_ECG_Reconnect_ConsumerEC_Control (void)
+{
+}
+
+void
+TAO_ECG_Reconnect_ConsumerEC_Control::try_reconnect (
+ ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CORBA::Boolean disconnected;
+ CORBA::Boolean non_existent =
+ gateway_->consumer_ec_non_existent (disconnected
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (!non_existent)
+ {
+ this->reconnect(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_ECG_Reconnect_ConsumerEC_Control::reconnect (
+ ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ is_consumer_ec_connected_ = 1;
+
+ gateway_->reconnect_consumer_ec(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_ECG_Reconnect_ConsumerEC_Control::query_eventchannel (
+ ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ if (is_consumer_ec_connected_ == 1)
+ {
+ CORBA::Boolean disconnected;
+ CORBA::Boolean non_existent =
+ gateway_->consumer_ec_non_existent (disconnected
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (non_existent && !disconnected)
+ {
+ this->event_channel_not_exist (gateway_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ else
+ {
+ this->try_reconnect(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ this->event_channel_not_exist (gateway_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TRANSIENT, transient)
+ {
+ // This is TAO's minor code for a failed connection, we may
+ // want to be more lenient in the future..
+ // if (transient.minor () == 0x54410085)
+ this->event_channel_not_exist (gateway_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_ECG_Reconnect_ConsumerEC_Control::handle_timeout (
+ const ACE_Time_Value &,
+ const void *)
+{
+ // NOTE, setting RELATIVE_RT_TIMEOUT_POLICY for the duration of
+ // query_eventchannel () below has greater impact than desired. For
+ // example, while we are pinging consumers here, a nested upcall,
+ // which requires making remote calls may come into the ORB. Those
+ // remote calls will be carried out with with
+ // RELATIVE_RT_TIMEOUT_POLICY set here in effect.
+ // @@ TODO: should use Guard to set and reset policies.
+ ACE_TRY_NEW_ENV
+ {
+ // Query the state of the Current object *before* we initiate
+ // the iteration...
+ CORBA::PolicyTypeSeq types;
+ CORBA::PolicyList_var policies =
+ this->policy_current_->get_policy_overrides (types
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Change the timeout
+ this->policy_current_->set_policy_overrides (this->policy_list_,
+ CORBA::ADD_OVERRIDE
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Query the state of the consumers...
+ this->query_eventchannel (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->policy_current_->set_policy_overrides (policies.in (),
+ CORBA::SET_OVERRIDE
+ 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;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+int
+TAO_ECG_Reconnect_ConsumerEC_Control::activate (void)
+{
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ ACE_TRY_NEW_ENV
+ {
+ // Get the PolicyCurrent object
+ CORBA::Object_var tmp =
+ this->orb_->resolve_initial_references ("PolicyCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->policy_current_ =
+ CORBA::PolicyCurrent::_narrow (tmp.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Timeout for polling state (default = 10 msec)
+ TimeBase::TimeT timeout = timeout_.usec() * 10;
+ CORBA::Any any;
+ any <<= timeout;
+
+ this->policy_list_.length (1);
+ this->policy_list_[0] =
+ this->orb_->create_policy (
+ Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
+ any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Only schedule the timer, when the rate is not zero
+ if (this->rate_ != ACE_Time_Value::zero)
+ {
+ // Schedule the timer after these policies has been set, because the
+ // handle_timeout uses these policies, if done in front, the channel
+ // can crash when the timeout expires before initiazation is ready.
+ timer_id_ = this->reactor_->schedule_timer (&this->adapter_,
+ 0,
+ this->rate_,
+ this->rate_);
+ if (timer_id_ == -1)
+ return -1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+#endif /* TAO_HAS_CORBA_MESSAGING */
+
+ return 0;
+}
+
+int
+TAO_ECG_Reconnect_ConsumerEC_Control::shutdown (void)
+{
+ int r = 0;
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ r = this->reactor_->cancel_timer (timer_id_);
+#endif /* TAO_HAS_CORBA_MESSAGING */
+
+ this->adapter_.reactor (0);
+ return r;
+}
+
+void
+TAO_ECG_Reconnect_ConsumerEC_Control::event_channel_not_exist (
+ TAO_EC_Gateway_IIOP* gateway
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ //ACE_DEBUG ((LM_DEBUG,
+ // "ECG_Reconnect_ConsumerControl(%P|%t) - "
+ // "channel %x does not exists\n"));
+ is_consumer_ec_connected_ = 0;
+
+ gateway->suspend_supplier_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ gateway->cleanup_consumer_proxies (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_EC_Reconnect_ConsumerControl::event_channel_not_exist");
+ // Ignore all exceptions..
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_ECG_Reconnect_ConsumerEC_Control::system_exception (
+ TAO_EC_Gateway_IIOP* gateway,
+ CORBA::SystemException & /* exception */
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ // The current implementation is very strict, and kicks out a
+ // client on the first system exception. We may
+ // want to be more lenient in the future, for example,
+ // this is TAO's minor code for a failed connection.
+ //
+ // if (CORBA::TRANSIENT::_narrow (&exception) != 0
+ // && exception->minor () == 0x54410085)
+ // return;
+
+ // Anything else is serious, including timeouts...
+ //ACE_DEBUG ((LM_DEBUG,
+ // "ECG_Reconnect_ConsumerControl(%P|%t) - "
+ // "channel %x does not exists system except\n"));
+ is_consumer_ec_connected_ = 0;
+
+ gateway->suspend_supplier_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ gateway->cleanup_consumer_proxies (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions..
+ }
+ ACE_ENDTRY;
+}
+
+// ****************************************************************
+
+TAO_ECG_Reconnect_ConsumerEC_Control_Adapter::TAO_ECG_Reconnect_ConsumerEC_Control_Adapter (
+ TAO_ECG_Reconnect_ConsumerEC_Control *adaptee)
+ : adaptee_ (adaptee)
+{
+}
+
+int
+TAO_ECG_Reconnect_ConsumerEC_Control_Adapter::handle_timeout (
+ const ACE_Time_Value &tv,
+ const void *arg)
+{
+ this->adaptee_->handle_timeout (tv, arg);
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.h
new file mode 100644
index 00000000000..b1f4a6c2987
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.h
@@ -0,0 +1,147 @@
+// -*- C++ -*-
+
+/**
+ * @file ECG_Reconnect_ConsumerEC_Control.h
+ *
+ * $Id$
+ *
+ * @author Johnny Willemsen (jwillemsen@remedy.nl)
+ *
+ */
+
+#ifndef TAO_ECG_RECONNECT_CONSUMEREC_CONTROL_H
+#define TAO_ECG_RECONNECT_CONSUMEREC_CONTROL_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/ECG_ConsumerEC_Control.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/ORB.h"
+#include "tao/PolicyC.h"
+
+#include "ace/Event_Handler.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ECG_Reconnect_ConsumerEC_Control;
+class TAO_EC_Gateway_IIOP;
+
+/**
+ * @class TAO_ECG_Reconnect_ConsumerEC_Control_Adapter
+ *
+ * @brief Forwards timeout events to the Reconnect ConsumerControl
+ *
+ * The Reconnect ConsumerControl strategy uses the reactor to
+ * periodically wakeup and verify the state of the consumers
+ * registered with the Event Channel.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_Reconnect_ConsumerEC_Control_Adapter
+ : public ACE_Event_Handler
+{
+public:
+ /// Constructor
+ TAO_ECG_Reconnect_ConsumerEC_Control_Adapter (TAO_ECG_Reconnect_ConsumerEC_Control *adaptee);
+
+ // = Documented in ACE_Event_Handler.
+ virtual int handle_timeout (const ACE_Time_Value &tv,
+ const void *arg = 0);
+
+private:
+ /// The adapted object
+ TAO_ECG_Reconnect_ConsumerEC_Control *adaptee_;
+};
+
+/**
+ * @class TAO_ECG_Reconnect_ConsumerEC_Control
+ *
+ * @brief Consumer event channel control
+ *
+ * Defines the interface for the consumer event channel control strategy.
+ * This strategy handles misbehaving or failing consumer event channels.
+ *
+ * This control tries to reconnect to the consumer ec incase of a connection
+ * loss and then does a reconnect when the connection is back again. When also
+ * a restart of the consumer ec must be handled correctly, then the consumer
+ * ec must use a persistent IOR.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_Reconnect_ConsumerEC_Control
+ : public TAO_ECG_ConsumerEC_Control
+{
+public:
+ /// Constructor. It does not assume ownership of the @a event_channel
+ /// parameter.
+ TAO_ECG_Reconnect_ConsumerEC_Control (const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ TAO_EC_Gateway_IIOP* gateway,
+ CORBA::ORB_ptr orb);
+
+ /// Destructor.
+ virtual ~TAO_ECG_Reconnect_ConsumerEC_Control (void);
+
+ /// Receive the timeout from the adapter
+ void handle_timeout (const ACE_Time_Value &tv,
+ const void* arg);
+
+ // = Documented in TAO_EC_ConsumerControl
+ virtual int activate (void);
+ virtual int shutdown (void);
+ virtual void event_channel_not_exist (TAO_EC_Gateway_IIOP *gateway
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void system_exception (TAO_EC_Gateway_IIOP *gateway,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+private:
+ /// Check if the consumers still exists. It is a helper method for
+ /// handle_timeout() to isolate the exceptions.
+ void query_eventchannel (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Look if we can reconnect again.
+ void try_reconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Reconnect to the consumer ec.
+ void reconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// The polling rate
+ ACE_Time_Value rate_;
+
+ /// The polling timeout
+ ACE_Time_Value timeout_;
+
+ /// The Adapter for the reactor events
+ TAO_ECG_Reconnect_ConsumerEC_Control_Adapter adapter_;
+
+ /// The gateway
+ TAO_EC_Gateway_IIOP* gateway_;
+
+ /// The ORB
+ CORBA::ORB_var orb_;
+
+ /// To control the timeout policy in the thread
+ CORBA::PolicyCurrent_var policy_current_;
+
+ /// Precomputed policy list to the set timeout.
+ CORBA::PolicyList policy_list_;
+
+ /// The ORB reactor
+ ACE_Reactor *reactor_;
+
+ /// Do we have a connection to the consumer ec
+ int is_consumer_ec_connected_;
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ /// The timer id
+ long timer_id_;
+#endif /* TAO_HAS_CORBA_MESSAGING */
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_ECG_RECONNECT_CONSUMEREC_CONTROL_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.cpp
new file mode 100644
index 00000000000..064d5c35183
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.cpp
@@ -0,0 +1,38 @@
+// $Id$
+
+#include "orbsvcs/Event/ECG_Simple_Address_Server.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_Simple_Address_Server.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ECG_Simple_Address_Server::TAO_ECG_Simple_Address_Server (void)
+{
+}
+
+TAO_ECG_Simple_Address_Server::~TAO_ECG_Simple_Address_Server (void)
+{
+}
+
+int
+TAO_ECG_Simple_Address_Server::init (const char *mcast_addr)
+{
+ return this->addr_.set (mcast_addr);
+}
+
+void
+TAO_ECG_Simple_Address_Server::get_addr (
+ const RtecEventComm::EventHeader& /*header*/,
+ RtecUDPAdmin::UDP_Addr_out addr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // unsigned long
+ addr.ipaddr = this->addr_.get_ip_address ();
+ // unsigned short
+ addr.port = this->addr_.get_port_number ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.h
new file mode 100644
index 00000000000..4c0cb219ccc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.h
@@ -0,0 +1,69 @@
+// -*- C++ -*-
+
+/**
+ * @file ECG_Simple_Address_Server.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak (marina@atdesk.com)
+ *
+ */
+
+#ifndef TAO_ECG_SIMPLE_ADDRESS_SERVER_H
+#define TAO_ECG_SIMPLE_ADDRESS_SERVER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecUDPAdminS.h"
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.h"
+#include "ace/INET_Addr.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ECG_Simple_Address_Server
+ *
+ * @brief Basic implementation of RtecUDPAdmin idl interface.
+ *
+ * This simple server always returns multicast address it was
+ * initialized with, regardless of the header.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_Simple_Address_Server :
+ public virtual POA_RtecUDPAdmin::AddrServer
+{
+public:
+
+ /// Create a new TAO_ECG_Simple_Address_Server object.
+ /// (Constructor access is restricted to insure that all
+ /// TAO_ECG_Simple_Address_Server objects are heap-allocated.)
+ static TAO_EC_Servant_Var<TAO_ECG_Simple_Address_Server> create (void);
+
+ /// Destructor
+ virtual ~TAO_ECG_Simple_Address_Server (void);
+
+ int init (const char *arg);
+
+ // = The RtecUDPAdmin::AddrServer methods
+ virtual void get_addr (const RtecEventComm::EventHeader& header,
+ RtecUDPAdmin::UDP_Addr_out addr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+
+ /// Constructor (protected). Clients can create new
+ /// TAO_ECG_Simple_Address_Server objects using the static create()
+ /// method.
+ TAO_ECG_Simple_Address_Server (void);
+
+private:
+ ACE_INET_Addr addr_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_Simple_Address_Server.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_ECG_SIMPLE_ADDRESS_SERVER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.i b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.i
new file mode 100644
index 00000000000..0aa18cada97
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.i
@@ -0,0 +1,17 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE TAO_EC_Servant_Var<TAO_ECG_Simple_Address_Server>
+TAO_ECG_Simple_Address_Server::create (void)
+{
+ TAO_EC_Servant_Var<TAO_ECG_Simple_Address_Server> s;
+ ACE_NEW_RETURN (s,
+ TAO_ECG_Simple_Address_Server,
+ s);
+ return s;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Mcast_EH.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Mcast_EH.cpp
new file mode 100644
index 00000000000..fa40043a50f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Mcast_EH.cpp
@@ -0,0 +1,98 @@
+// $Id$
+
+#include "orbsvcs/Event/ECG_Simple_Mcast_EH.h"
+#include "ace/Log_Msg.h"
+#include "ace/Reactor.h"
+#include "ace/os_include/os_fcntl.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ECG_Simple_Mcast_EH::TAO_ECG_Simple_Mcast_EH (TAO_ECG_Dgram_Handler *recv)
+ : receiver_ (recv)
+{
+ ACE_ASSERT (this->receiver_);
+}
+
+TAO_ECG_Simple_Mcast_EH::~TAO_ECG_Simple_Mcast_EH (void)
+{
+}
+
+int
+TAO_ECG_Simple_Mcast_EH::open (const char * mcast_addr,
+ const ACE_TCHAR *net_if)
+{
+ // Check that we haven't been closed already.
+ if (!this->receiver_)
+ return -1;
+
+ if (mcast_addr == 0)
+ return -1;
+
+ ACE_INET_Addr mcast_group;
+ if (mcast_group.set (mcast_addr) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to open mcast handler: "
+ "error using specified address %s "
+ "in ACE_INET.set ().\n",
+ mcast_addr),
+ -1);
+
+ if (this->dgram_.subscribe (mcast_group, 1, net_if) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to open mcast handler: error "
+ "subscribing to %s\n",
+ mcast_addr),
+ -1);
+
+ (void) dgram_.enable(ACE_NONBLOCK);
+
+ if (!this->reactor ()
+ || 0 != this->reactor ()->register_handler (this->dgram_.get_handle (),
+ this,
+ ACE_Event_Handler::READ_MASK))
+ {
+ this->dgram_.close ();
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot register handler with reactor.\n"),
+ -1);
+ }
+
+ return 0;
+}
+
+int
+TAO_ECG_Simple_Mcast_EH::shutdown (void)
+{
+ // Already shut down.
+ if (!this->receiver_)
+ return -1;
+
+ int result = 0;
+ if (this->reactor ())
+ {
+ result = this->reactor ()->remove_handler (this->dgram_.get_handle (),
+ ACE_Event_Handler::READ_MASK);
+ }
+ if (result != 0)
+ ACE_ERROR ((LM_ERROR,
+ "Unable to deregister handler from reactor "
+ "on shutdown.\n"));
+
+ result = this->dgram_.close ();
+ if (result != 0)
+ ACE_ERROR ((LM_ERROR,
+ "Unable to close mcast receiving dgram "
+ "on shutdown.\n"));
+
+ this->receiver_ = 0;
+
+ return result;
+}
+
+int
+TAO_ECG_Simple_Mcast_EH::handle_input (ACE_HANDLE /* fd */)
+{
+ return this->receiver_->handle_input (this->dgram_);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Mcast_EH.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Mcast_EH.h
new file mode 100644
index 00000000000..d15ff0c82c6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Mcast_EH.h
@@ -0,0 +1,96 @@
+// -*- C++ -*-
+
+/**
+ * @file ECG_Simple_Mcast_EH.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@atdesk.com>
+ *
+ */
+#ifndef TAO_ECG_SIMPLE_MCAST_EH_H
+#define TAO_ECG_SIMPLE_MCAST_EH_H
+#include /**/ "ace/pre.h"
+
+#include "ace/Event_Handler.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+#include "orbsvcs/Event/ECG_Adapters.h"
+#include "ace/SOCK_Dgram_Mcast.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ECG_Simple_Mcast_EH
+ *
+ * @brief Simple Event Handler for mcast messages. Listens for
+ * messages on a single mcast group. Useful in environments
+ * where event traffic is not separated into different groups.
+ * Calls handle_input (ACE_SOCK_Dgram_Mcast dgram) on a specified
+ * TAO_ECG_Dgram_Handler to inform it about message arrival.
+ *
+ * NOT THREAD-SAFE.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_Simple_Mcast_EH
+ : public ACE_Event_Handler
+ , public TAO_ECG_Handler_Shutdown
+{
+public:
+
+ /// Initialization and termination methods.
+ //@{
+ /// Constructor.
+ /// Messages received by this EH will be forwarded to the <recv>.
+ /*
+ * See comments for <receiver_> data member on why raw pointer is
+ * used for the <recv> argument.
+ */
+ TAO_ECG_Simple_Mcast_EH (TAO_ECG_Dgram_Handler *recv);
+
+ /// Destructor.
+ virtual ~TAO_ECG_Simple_Mcast_EH (void);
+
+ /// Join the specified multicast group and register itself with the
+ /// reactor.
+ /// To insure proper resource clean up, if open () is successful,
+ /// the user MUST call shutdown () when handler is no longer needed
+ /// (and its reactor still exists).
+ int open (const char * mcast_addr,
+ const ACE_TCHAR *net_if = 0);
+
+ /// TAO_ECG_Handler_Shutdown method.
+ /// Unsubscribe from the reactor and close the datagram.
+ virtual int shutdown (void);
+ //@}
+
+ /// Main method - reactor callback. Notify <receiver_> that
+ /// <dgram_> is ready for reading.
+ virtual int handle_input (ACE_HANDLE fd);
+
+private:
+
+ // Socket on which we listen for messages.
+ ACE_SOCK_Dgram_Mcast dgram_;
+
+ /// We callback to this object when a message arrives.
+ /*
+ * We can keep a raw pointer to the receiver (even though it may
+ * be a refcounted object) because receiver guarantees
+ * to notify us (by calling shutdown ()) before going away.
+ *
+ * We have to use raw pointer instead of a refcounting mechanism
+ * here to avoid a circular refcounting dependency between
+ * receiver and handler.
+ */
+ TAO_ECG_Dgram_Handler* receiver_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_ECG_SIMPLE_Mcast_EH_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_EH.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_EH.cpp
new file mode 100644
index 00000000000..257a8ff2c3b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_EH.cpp
@@ -0,0 +1,89 @@
+// $Id$
+
+#include "orbsvcs/Event/ECG_UDP_EH.h"
+#include "ace/Reactor.h"
+#include "ace/INET_Addr.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_UDP_EH.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, ECG_UDP_EH, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ECG_UDP_EH::TAO_ECG_UDP_EH (TAO_ECG_Dgram_Handler *recv)
+ : receiver_ (recv)
+{
+ ACE_ASSERT (this->receiver_);
+}
+
+TAO_ECG_UDP_EH::~TAO_ECG_UDP_EH (void)
+{
+}
+
+int
+TAO_ECG_UDP_EH::open (const ACE_INET_Addr& ipaddr,
+ int reuse_addr)
+{
+ // Check that we haven't been closed already.
+ if (!this->receiver_)
+ return -1;
+
+ if (this->dgram_.open (ipaddr, PF_INET, 0, reuse_addr) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to open udp handler: "
+ "error opening receiving dgram.\n"),
+ -1);
+
+ if (!this->reactor ()
+ || 0 != this->reactor ()->register_handler (this->dgram_.get_handle (),
+ this,
+ ACE_Event_Handler::READ_MASK))
+ {
+ this->dgram_.close ();
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot register handler with reactor.\n"),
+ -1);
+ }
+
+ return 0;
+}
+
+int
+TAO_ECG_UDP_EH::shutdown (void)
+{
+ // Already shut down.
+ if (!this->receiver_)
+ return -1;
+
+ int result = 0;
+ if (this->reactor ())
+ {
+ result = this->reactor ()->remove_handler (this->dgram_.get_handle (),
+ ACE_Event_Handler::READ_MASK);
+ }
+ if (result != 0)
+ ACE_ERROR ((LM_ERROR,
+ "Unable to deregister handler from reactor "
+ "on shutdown.\n"));
+
+ result = this->dgram_.close ();
+ if (result != 0)
+ ACE_ERROR ((LM_ERROR,
+ "Unable to close receiving dgram on shutdown.\n"));
+
+ this->receiver_ = 0;
+
+ return result;
+}
+
+int
+TAO_ECG_UDP_EH::handle_input (ACE_HANDLE)
+{
+ return this->receiver_->handle_input (this->dgram_);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_EH.h b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_EH.h
new file mode 100644
index 00000000000..b87d4d9c745
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_EH.h
@@ -0,0 +1,110 @@
+// -*- C++ -*-
+
+/**
+ * @file ECG_UDP_EH.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ * @author Marina Spivak (marina@atdesk.com)
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_ECG_UDP_EH_H
+#define TAO_ECG_UDP_EH_H
+#include /**/ "ace/pre.h"
+
+#include "ace/Event_Handler.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+#include "orbsvcs/Event/ECG_Adapters.h"
+#include "ace/SOCK_Dgram.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ECG_UDP_Receiver;
+
+/**
+ * @class TAO_ECG_UDP_EH
+ *
+ * @brief Event Handler for UDP messages.
+ *
+ * Listens for messages on a UDP socket. When there is a message,
+ * calls handle_input () on a specified TAO_ECG_Dgram_Handler to
+ * inform it about message arrival.
+ *
+ * NOT THREAD-SAFE.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_UDP_EH :
+ public ACE_Event_Handler
+, public TAO_ECG_Handler_Shutdown
+{
+public:
+
+ /// Initialization and termination methods.
+ //@{
+ /// Constructor.
+ /// Messages received by this EH will be forwarded to the <recv>.
+ /*
+ * See comments for <receiver_> data member on why raw pointer is
+ * used for the <recv> argument.
+ */
+ TAO_ECG_UDP_EH (TAO_ECG_Dgram_Handler *recv);
+
+ /// Destructor.
+ virtual ~TAO_ECG_UDP_EH (void);
+
+ /// Open the datagram and register itself with this->reactor().
+ /// To insure proper resource clean up, if open () is successful,
+ /// the user MUST call shutdown () when handler is no longer needed
+ /// (and its reactor still exists).
+ int open (const ACE_INET_Addr& ipaddr,
+ int reuse_addr = 0);
+
+ /// TAO_ECG_Handler_Shutdown method.
+ /// Unsubscribe from the reactor and close the datagram.
+ virtual int shutdown (void);
+ //@}
+
+ /// Main method - reactor callback. Notify <receiver_> that
+ /// <dgram_> is ready for reading.
+ virtual int handle_input (ACE_HANDLE fd);
+
+ /**
+ * Obtain the dgram, this is one of those "controlled violations of
+ * type safety", allowing the user to setup options and gain access
+ * to low-level features.
+ */
+ ACE_SOCK_Dgram &dgram (void);
+
+private:
+
+ /// The datagram used to receive the data.
+ ACE_SOCK_Dgram dgram_;
+
+ /// We callback to this object when a message arrives.
+ /*
+ * We can keep a raw pointer to the receiver (even though it may
+ * be a refcounted object) because receiver guarantees
+ * to notify us (by calling shutdown ()) before going away.
+ *
+ * We have to use raw pointer instead of a refcounting mechanism
+ * here to avoid a circular refcounting dependency between
+ * receiver and handler.
+ */
+ TAO_ECG_Dgram_Handler* receiver_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_UDP_EH.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_ECG_UDP_EH_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_EH.i b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_EH.i
new file mode 100644
index 00000000000..d84f70937b8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_EH.i
@@ -0,0 +1,13 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE ACE_SOCK_Dgram&
+TAO_ECG_UDP_EH::dgram (void)
+{
+ return this->dgram_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Out_Endpoint.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Out_Endpoint.cpp
new file mode 100644
index 00000000000..8b6fb71a6fe
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Out_Endpoint.cpp
@@ -0,0 +1,83 @@
+// $Id$
+
+#include "orbsvcs/Event/ECG_UDP_Out_Endpoint.h"
+#include "ace/INET_Addr.h"
+#include "ace/Sock_Connect.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_UDP_Out_Endpoint.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, ECG_UDP_Out_Endpoint, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ECG_UDP_Out_Endpoint::~TAO_ECG_UDP_Out_Endpoint (void)
+{
+ this->dgram_.close ();
+
+ delete [] this->ifs_;
+}
+
+CORBA::Boolean
+TAO_ECG_UDP_Out_Endpoint::is_loopback (const ACE_INET_Addr& from)
+{
+ if (this->port_number_ == 0)
+ {
+ // Cache the port number...
+ ACE_INET_Addr local_addr;
+ if (this->dgram ().get_local_addr (local_addr) == -1)
+ return false;
+ this->port_number_ = local_addr.get_port_number ();
+ }
+
+ // Most of the time the port number is enough to determine if the
+ // message is remote, only when the local port number and the remote
+ // port number match we have to look at the local ip addresses.
+ if (from.get_port_number () != this->port_number_)
+ return false;
+
+ if (this->ifs_ == 0)
+ {
+ ACE::get_ip_interfaces (this->if_count_, this->ifs_);
+ }
+
+ for (ACE_INET_Addr* i = this->ifs_;
+ i != this->ifs_ + this->if_count_;
+ ++i)
+ {
+ if ((*i).get_ip_address () == from.get_ip_address ())
+ return true;
+ }
+ return false;
+}
+
+TAO_ECG_UDP_Out_Endpoint&
+TAO_ECG_UDP_Out_Endpoint::operator= (const TAO_ECG_UDP_Out_Endpoint& rhs)
+{
+ if (this != &rhs)
+ {
+ this->request_id_generator_ = rhs.request_id_generator_;
+ this->dgram_ = rhs.dgram_;
+ this->port_number_ = rhs.port_number_;
+ this->if_count_ = rhs.if_count_;
+
+ delete [] this->ifs_;
+ this->ifs_ = 0;
+
+ if (this->if_count_ != 0)
+ {
+ ACE_NEW_RETURN (this->ifs_,
+ ACE_INET_Addr [this->if_count_],
+ *this);
+ for(size_t i = 0; i < this->if_count_; ++i)
+ {
+ this->ifs_[i] = rhs.ifs_[i];
+ }
+ }
+ }
+
+ return *this;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Out_Endpoint.h b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Out_Endpoint.h
new file mode 100644
index 00000000000..a967401e6e6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Out_Endpoint.h
@@ -0,0 +1,108 @@
+// -*- C++ -*-
+
+/**
+ * @file ECG_UDP_Out_Endpoint.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ * @author Marina Spivak (marina@atdesk.com)
+ */
+
+#ifndef TAO_ECG_UDP_OUT_ENDPOINT_H
+#define TAO_ECG_UDP_OUT_ENDPOINT_H
+
+#include /**/ "ace/pre.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Basic_Types.h"
+#include "tao/orbconf.h"
+
+#include "ace/Refcounted_Auto_Ptr.h"
+#include "ace/SOCK_Dgram.h"
+#include "ace/Atomic_Op.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_INET_Addr;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ECG_UDP_Out_Endpoint
+ *
+ * @brief Maintains information about an outgoing endpoint.
+ *
+ * UDP senders can share a single endpoint to send UDP packets,
+ * but there is more state associated with this endpoint than its
+ * datagram SAP; for instance we need to keep track of the request
+ * id.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_UDP_Out_Endpoint
+{
+public:
+ /// Constructor
+ TAO_ECG_UDP_Out_Endpoint (void);
+
+ /// Constructor
+ ~TAO_ECG_UDP_Out_Endpoint (void);
+
+ /// Copy Constructor
+ TAO_ECG_UDP_Out_Endpoint (const TAO_ECG_UDP_Out_Endpoint& rhs);
+
+ /// Assignment operator
+ TAO_ECG_UDP_Out_Endpoint& operator= (const TAO_ECG_UDP_Out_Endpoint& rhs);
+
+ /// Obtain the datagram associated with this endpoint. Clients of
+ /// this class must open, and register (if necessary) this datagram.
+ ACE_SOCK_Dgram& dgram (void);
+
+ /// Obtain the next request id.
+ CORBA::ULong next_request_id (void);
+
+ /// The endpoint can detect if a data-gram was sent by itself, this
+ /// is useful to ignore or remove messages sent by the same process.
+ CORBA::Boolean is_loopback (const ACE_INET_Addr& from);
+
+private:
+ /// The request id....
+ ACE_Atomic_Op<TAO_SYNCH_MUTEX,CORBA::ULong> request_id_generator_;
+
+ /// The datagram....
+ ACE_SOCK_Dgram dgram_;
+
+ /// Cache the port-number so we can quickly determine if an event is
+ /// coming from another endpoint.
+ u_short port_number_;
+
+ /// Keep the list of local interfaces, needed for the is_loopback
+ /// method.
+ size_t if_count_;
+ ACE_INET_Addr* ifs_;
+};
+
+/**
+ * @typedef TAO_ECG_Refcounted_Endpoint
+ *
+ * @brief Reference counted pointer to TAO_ECG_UDP_Out_Endpoint
+ *
+ * Instances of TAO_ECG_UDP_Out_Endpoint are used by multiple objects
+ * in the Event Channel gateways, the endpoints are reference counted
+ * to manage their lifetime automatically.
+ */
+typedef ACE_Refcounted_Auto_Ptr<TAO_ECG_UDP_Out_Endpoint,ACE_Null_Mutex> TAO_ECG_Refcounted_Endpoint;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_UDP_Out_Endpoint.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_ECG_UDP_OUT_ENDPOINT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Out_Endpoint.i b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Out_Endpoint.i
new file mode 100644
index 00000000000..9f8fd0df5f3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Out_Endpoint.i
@@ -0,0 +1,37 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_ECG_UDP_Out_Endpoint::TAO_ECG_UDP_Out_Endpoint (void)
+ : port_number_ (0),
+ if_count_ (0),
+ ifs_ (0)
+{
+}
+
+ACE_INLINE
+TAO_ECG_UDP_Out_Endpoint::TAO_ECG_UDP_Out_Endpoint (
+ const TAO_ECG_UDP_Out_Endpoint& rhs)
+ : port_number_ (0),
+ if_count_ (0),
+ ifs_ (0)
+{
+ *this = rhs;
+}
+
+ACE_INLINE ACE_SOCK_Dgram&
+TAO_ECG_UDP_Out_Endpoint::dgram (void)
+{
+ return this->dgram_;
+}
+
+ACE_INLINE CORBA::ULong
+TAO_ECG_UDP_Out_Endpoint::next_request_id (void)
+{
+ return this->request_id_generator_++;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.cpp
new file mode 100644
index 00000000000..1a492f72d66
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.cpp
@@ -0,0 +1,250 @@
+// $Id$
+
+#include "orbsvcs/Event/ECG_UDP_Receiver.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "ace/SString.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_UDP_Receiver.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Event,
+ ECG_UDP_Receiver,
+ "$Id$")
+
+
+// ****************************************************************
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ECG_UDP_Receiver::~TAO_ECG_UDP_Receiver (void)
+{
+ this->consumer_proxy_ =
+ RtecEventChannelAdmin::ProxyPushConsumer::_nil ();
+
+ if (this->handler_rptr_.get ())
+ this->handler_rptr_->shutdown ();
+}
+
+void
+TAO_ECG_UDP_Receiver::init (RtecEventChannelAdmin::EventChannel_ptr lcl_ec,
+ TAO_ECG_Refcounted_Endpoint ignore_from,
+ RtecUDPAdmin::AddrServer_ptr addr_server
+ ACE_ENV_ARG_DECL)
+{
+ // Verify arguments.
+ // <addr_server> is allowed to be nil. But then, if get_addr () method
+ // is invoked, it throws an exception.
+ if (CORBA::is_nil (lcl_ec))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "TAO_ECG_UDP_Receiver::init(): "
+ "<lcl_ec> argument is nil.\n"));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ this->cdr_receiver_.init (ignore_from);
+
+ this->lcl_ec_ =
+ RtecEventChannelAdmin::EventChannel::_duplicate (lcl_ec);
+
+ this->addr_server_ =
+ RtecUDPAdmin::AddrServer::_duplicate (addr_server);
+}
+
+void
+TAO_ECG_UDP_Receiver::connect (const RtecEventChannelAdmin::SupplierQOS& pub
+ ACE_ENV_ARG_DECL)
+{
+ if (CORBA::is_nil (this->lcl_ec_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Error initializing TAO_ECG_UDP_Receiver: "
+ "init() hasn't been called before connect().\n"));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ if (pub.publications.length () == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "TAO_ECG_UDP_Receiver::connect(): "
+ "0-length publications argument.\n"));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ {
+ this->new_connect (pub ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ this->reconnect (pub ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_ECG_UDP_Receiver::new_connect (const RtecEventChannelAdmin::SupplierQOS& pub
+ ACE_ENV_ARG_DECL)
+{
+ // Activate with poa.
+ RtecEventComm::PushSupplier_var supplier_ref;
+ PortableServer::POA_var poa = this->_default_POA ();
+
+ TAO_EC_Object_Deactivator deactivator;
+ activate (supplier_ref,
+ poa.in (),
+ this,
+ deactivator
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Connect as a supplier to the local EC.
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ this->lcl_ec_->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ ECG_Receiver_Auto_Proxy_Disconnect new_proxy_disconnect (proxy.in ());
+
+ proxy->connect_push_supplier (supplier_ref.in (),
+ pub
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Update resource managers.
+ this->consumer_proxy_ = proxy._retn ();
+ this->auto_proxy_disconnect_.set_command (new_proxy_disconnect);
+ this->set_deactivator (deactivator);
+}
+
+void
+TAO_ECG_UDP_Receiver::reconnect (const RtecEventChannelAdmin::SupplierQOS& pub
+ ACE_ENV_ARG_DECL)
+{
+ // Obtain our object reference from the POA.
+ RtecEventComm::PushSupplier_var supplier_ref;
+ PortableServer::POA_var poa = this->_default_POA ();
+
+ CORBA::Object_var obj = poa->servant_to_reference (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ supplier_ref =
+ RtecEventComm::PushSupplier::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (supplier_ref.in ()))
+ {
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ // Reconnect.
+ this->consumer_proxy_->connect_push_supplier (supplier_ref.in (),
+ pub
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_ECG_UDP_Receiver::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Prevent attempts to disconnect.
+ this->auto_proxy_disconnect_.disallow_command ();
+
+ this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_ECG_UDP_Receiver::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ if (this->handler_rptr_.get ())
+ this->handler_rptr_->shutdown ();
+ TAO_ECG_Refcounted_Handler empty_handler_rptr;
+ this->handler_rptr_ = empty_handler_rptr;
+
+ this->consumer_proxy_ =
+ RtecEventChannelAdmin::ProxyPushConsumer::_nil ();
+
+ this->auto_proxy_disconnect_.execute ();
+
+ this->deactivator_.deactivate ();
+
+ this->cdr_receiver_.shutdown ();
+}
+
+// Helper class for using <cdr_receiver_>.
+class TAO_ECG_Event_CDR_Decoder: public TAO_ECG_CDR_Processor
+{
+public:
+ virtual int decode (TAO_InputCDR &cdr);
+
+ RtecEventComm::EventSet events;
+};
+
+int
+TAO_ECG_Event_CDR_Decoder::decode (TAO_InputCDR &cdr)
+{
+ if (!(cdr >> this->events))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error decoding events cdr.\n"),
+ -1);
+ }
+ return 0;
+}
+
+int
+TAO_ECG_UDP_Receiver::handle_input (ACE_SOCK_Dgram& dgram)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Make sure we are connected to the Event Channel before proceeding
+ // any further.
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "TAO_ECG_UDP_Receiver::handle_input() "
+ "called but the Receiver is not connected "
+ "to an event channel. Shutting down the Receiver.\n"));
+ this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return 0;
+ }
+
+ // Receive data.
+ TAO_ECG_Event_CDR_Decoder cdr_decoder;
+ int result = this->cdr_receiver_.handle_input (dgram, &cdr_decoder);
+
+ if (result == 0)
+ // No data to act on.
+ {
+ return 0;
+ }
+ if (result == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error receiving multicasted events.\n"),
+ 0);
+ }
+
+ this->consumer_proxy_->push (cdr_decoder.events ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "Caught and swallowed EXCEPTION in "
+ "ECG_UDP_Receiver::handle_input: %s\n",
+ ACE_ANY_EXCEPTION._info ().c_str ()));
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.h b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.h
new file mode 100644
index 00000000000..3b5a4f686dc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.h
@@ -0,0 +1,239 @@
+// -*- C++ -*-
+
+/**
+ * @file ECG_UDP_Receiver.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ * @author Marina Spivak (marina@atdesk.com)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ *
+ * Define helper classes to propagate events between ECs using
+ * either UDP or multicast.
+ * The architecture is a bit complicated and deserves some
+ * explanation: sending the events over UDP (or mcast) is easy, a
+ * Consumer (TAO_ECG_UDP_Sender) subscribes for a certain set of
+ * events, its push() method marshalls the event set into a CDR
+ * stream that is sent using an ACE_SOCK_Dgram. The subscription
+ * set and IP address can be configured.
+ * Another helper class (TAO_ECG_UDP_Receiver) acts as a supplier of
+ * events; it receives a callback when an event is available on an
+ * ACE_SOCK_Dgram, it demarshalls the event and pushes it to the
+ * EC. Two ACE_Event_Handler classes are provided that can forward
+ * the events to this Supplier: TAO_ECG_Mcast_EH can receive events
+ * from a multicast group; TAO_ECG_UDP_EH can receive events from a
+ * regular UDP socket.
+ *
+ * @todo The class makes an extra copy of the events, we need to
+ * investigate if closer collaboration with its collocated EC could
+ * be used to remove that copy.
+ */
+
+#ifndef TAO_ECG_UDP_RECEIVER_H
+#define TAO_ECG_UDP_RECEIVER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecUDPAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RtecEventChannelAdminS.h"
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#include "orbsvcs/Event/ECG_Adapters.h"
+#include "orbsvcs/Event/EC_Lifetime_Utils.h"
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.h"
+#include "orbsvcs/Event/ECG_CDR_Message_Receiver.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Reactor;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ECG_UDP_Out_Endpoint;
+
+/**
+ * @class TAO_ECG_UDP_Receiver_Disconnect_Command
+ *
+ * @brief Disconnects supplier represented by @a proxy from the Event Channel.
+ *
+ * Utility class for use as a template argument to TAO_EC_Auto_Command.
+ * TAO_EC_Auto_Command<TAO_ECG_UDP_Receiver_Disconnect_Command> manages
+ * supplier connection to the Event Channel, automatically disconnecting from
+ * @a proxy in its destructor, if necessary.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_UDP_Receiver_Disconnect_Command
+{
+public:
+ TAO_ECG_UDP_Receiver_Disconnect_Command (void);
+ TAO_ECG_UDP_Receiver_Disconnect_Command (
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr proxy);
+
+ TAO_ECG_UDP_Receiver_Disconnect_Command (
+ const TAO_ECG_UDP_Receiver_Disconnect_Command & rhs);
+
+ TAO_ECG_UDP_Receiver_Disconnect_Command &
+ operator= (const TAO_ECG_UDP_Receiver_Disconnect_Command & rhs);
+
+ void execute (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy_;
+};
+
+/**
+ * @class TAO_ECG_UDP_Receiver
+ *
+ * @brief Receive events from UDP or Multicast and push them to a
+ * "local" EC.
+ * NOT THREAD-SAFE.
+ *
+ * This class connects as a supplier to an EventChannel, and supplies
+ * to it all events it receives via UDP or Multicast.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_UDP_Receiver :
+ public virtual POA_RtecEventComm::PushSupplier
+ , public virtual TAO_EC_Deactivated_Object
+ , public virtual TAO_ECG_Dgram_Handler
+{
+public:
+
+ /// Initialization and termination methods.
+ //@{
+
+ /// Create a new TAO_ECG_UDP_Receiver object.
+ /// (Constructor access is restricted to insure that all
+ /// TAO_ECG_UDP_Receiver objects are heap-allocated.)
+ static TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> create (CORBA::Boolean perform_crc = 0);
+
+ ~TAO_ECG_UDP_Receiver (void);
+
+ /**
+ * @param lcl_ec Event Channel to which we will act as a supplier of events.
+ * @param ignore_from Endpoint used to remove events generated by
+ * the same process.
+ * @param addr_server Address server used to obtain mapping of event type
+ * to multicast group.
+ * To insure proper resource clean up, if init () is successful,
+ * shutdown () must be called when the receiver is no longer needed.
+ * This is done by disconnect_push_supplier() method. If
+ * disconnect_push_supplier() will not be called, it is the
+ * responsibility of the user.
+ * Furthermore, if shutdown() is not explicitly called by
+ * either disconnect_push_supplier () or the user, the receiver
+ * will clean up the resources in its destructor, however, certain
+ * entities involved in cleanup must still exist at that point,
+ * e.g., POA.
+ */
+ void init (RtecEventChannelAdmin::EventChannel_ptr lcl_ec,
+ TAO_ECG_Refcounted_Endpoint ignore_from,
+ RtecUDPAdmin::AddrServer_ptr addr_server
+ ACE_ENV_ARG_DECL);
+
+ /// Connect or reconnect to the EC with the given publications.
+ /**
+ * @note If we are already connected to EC and a reconnection is
+ * necessary, the EC must have reconnects enabled in order for this
+ * method to succeed.
+ */
+ void connect (const RtecEventChannelAdmin::SupplierQOS& pub
+ ACE_ENV_ARG_DECL);
+
+ /// Set the handler we must notify when shutdown occurs. (This is
+ /// the handler that alerts us when data is available on udp/mcast socket.)
+ /// Shutdown notification gives the handler an opportunity to properly clean
+ /// up resources.
+ void set_handler_shutdown (TAO_ECG_Refcounted_Handler handler_shutdown_rptr);
+
+ /// Deactivate from POA and disconnect from EC, if necessary. Shut
+ /// down all receiver components.
+ /**
+ * If this class is used with refcounting, calling this method may
+ * result in decrementing of the reference count (due to
+ * deactivation) and deletion of the object.
+ */
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+ //@}
+
+ /// Accessor.
+ /// Call the RtecUDPAdmin::AddrServer::get_addr. Throws exception
+ /// if nill Address Server was specified in init ().
+ void get_addr (const RtecEventComm::EventHeader& header,
+ RtecUDPAdmin::UDP_Addr_out addr
+ ACE_ENV_ARG_DECL);
+
+ /// The PushSupplier idl method.
+ /// Invokes shutdown (), which may result in the object being deleted, if
+ /// refcounting is used to manage its lifetime.
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// TAO_ECG_Dgram_Handler method.
+ /**
+ * UDP/Multicast Event_Handlers call this method when data is
+ * available at the socket - the <dgram> is ready for reading.
+ * Data is read from the socket, and, if complete message is
+ * received, the event is pushed to the local Event Channel.
+ */
+ virtual int handle_input (ACE_SOCK_Dgram& dgram);
+
+protected:
+
+ /// Constructor (protected). Clients can create new
+ /// TAO_ECG_UDP_Receiver objects using the static create() method.
+ TAO_ECG_UDP_Receiver (CORBA::Boolean perform_crc = 0);
+
+private:
+
+ /// Helpers for the connect() method.
+ //@{
+ // Establishes connection to the Event Channel for the first time.
+ void new_connect (const RtecEventChannelAdmin::SupplierQOS& pub
+ ACE_ENV_ARG_DECL);
+
+ // Updates existing connection to the Event Channel.
+ void reconnect (const RtecEventChannelAdmin::SupplierQOS& pub
+ ACE_ENV_ARG_DECL);
+ //@}
+
+ /// Event Channel to which we act as a supplier.
+ RtecEventChannelAdmin::EventChannel_var lcl_ec_;
+
+ /// The server used to map event types to multicast groups.
+ RtecUDPAdmin::AddrServer_var addr_server_;
+
+ /// Proxy used to supply events to the Event Channel.
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer_proxy_;
+
+ /// Helper for reading incoming UDP/Multicast messages. It assembles
+ /// message fragments and provides access to a cdr stream once the
+ /// complete message has been received.
+ TAO_ECG_CDR_Message_Receiver cdr_receiver_;
+
+ /// Handler we must notify when shutdown occurs, so it has an
+ /// opportunity to clean up resources.
+ TAO_ECG_Refcounted_Handler handler_rptr_;
+
+ typedef TAO_EC_Auto_Command<TAO_ECG_UDP_Receiver_Disconnect_Command>
+ ECG_Receiver_Auto_Proxy_Disconnect;
+ /// Manages our connection to Consumer Proxy.
+ ECG_Receiver_Auto_Proxy_Disconnect auto_proxy_disconnect_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_UDP_Receiver.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_ECG_UDP_RECEIVER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.i b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.i
new file mode 100644
index 00000000000..47eb3d83958
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.i
@@ -0,0 +1,106 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_ECG_UDP_Receiver_Disconnect_Command::
+TAO_ECG_UDP_Receiver_Disconnect_Command (void)
+ : proxy_ ()
+{
+}
+
+ACE_INLINE
+TAO_ECG_UDP_Receiver_Disconnect_Command::
+TAO_ECG_UDP_Receiver_Disconnect_Command (
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr proxy)
+ : proxy_ (RtecEventChannelAdmin::ProxyPushConsumer::_duplicate (proxy))
+{
+}
+
+ACE_INLINE
+TAO_ECG_UDP_Receiver_Disconnect_Command::
+TAO_ECG_UDP_Receiver_Disconnect_Command (
+ const TAO_ECG_UDP_Receiver_Disconnect_Command & rhs)
+ : proxy_ (RtecEventChannelAdmin::ProxyPushConsumer::_duplicate
+ (rhs.proxy_.in ()))
+{
+}
+
+ACE_INLINE
+TAO_ECG_UDP_Receiver_Disconnect_Command &
+TAO_ECG_UDP_Receiver_Disconnect_Command::operator= (
+ const TAO_ECG_UDP_Receiver_Disconnect_Command & rhs)
+{
+ this->proxy_ =
+ RtecEventChannelAdmin::ProxyPushConsumer::_duplicate (rhs.proxy_.in ());
+
+ return *this;
+}
+
+ACE_INLINE void
+TAO_ECG_UDP_Receiver_Disconnect_Command::
+execute (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->proxy_.in ()))
+ // We are not connected.
+ return;
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var release_proxy =
+ this->proxy_._retn ();
+
+ release_proxy->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+//***************************************************************************
+
+ACE_INLINE
+TAO_ECG_UDP_Receiver::TAO_ECG_UDP_Receiver (CORBA::Boolean perform_crc)
+ : lcl_ec_ ()
+ , addr_server_ ()
+ , consumer_proxy_ ()
+ , cdr_receiver_ (perform_crc)
+ , handler_rptr_ ()
+ , auto_proxy_disconnect_ ()
+{
+}
+
+ACE_INLINE TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver>
+TAO_ECG_UDP_Receiver::create (CORBA::Boolean perform_crc)
+{
+ TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> r;
+ ACE_NEW_RETURN (r,
+ TAO_ECG_UDP_Receiver (perform_crc),
+ r);
+ return r;
+}
+
+ACE_INLINE void
+TAO_ECG_UDP_Receiver::set_handler_shutdown (
+ TAO_ECG_Refcounted_Handler handler_shutdown_rptr)
+{
+ this->handler_rptr_ = handler_shutdown_rptr;
+}
+
+ACE_INLINE void
+TAO_ECG_UDP_Receiver::get_addr (const RtecEventComm::EventHeader& header,
+ RtecUDPAdmin::UDP_Addr_out addr
+ ACE_ENV_ARG_DECL)
+{
+ if (CORBA::is_nil (this->addr_server_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "TAO_ECG_UDP_Receiver::get_addr() called but "
+ "nil Address Server was supplied during "
+ "initialization through init().\n"));
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ this->addr_server_->get_addr (header, addr
+ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.cpp
new file mode 100644
index 00000000000..2cfc4b5f35f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.cpp
@@ -0,0 +1,236 @@
+/**
+ * @file ECG_UDP_Sender.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ *
+ */
+
+#include "orbsvcs/Event/ECG_UDP_Sender.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "tao/CDR.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_UDP_Sender.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Event,
+ ECG_UDP_Sender,
+ "$Id$")
+
+// ****************************************************************
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ECG_UDP_Sender::~TAO_ECG_UDP_Sender (void)
+{
+}
+
+void
+TAO_ECG_UDP_Sender::init (RtecEventChannelAdmin::EventChannel_ptr lcl_ec,
+ RtecUDPAdmin::AddrServer_ptr addr_server,
+ TAO_ECG_Refcounted_Endpoint endpoint_rptr
+ ACE_ENV_ARG_DECL)
+{
+ if (CORBA::is_nil (lcl_ec))
+ {
+ ACE_ERROR ((LM_ERROR, "TAO_ECG_UDP_Sender::init(): "
+ "<lcl_ec> argument is nil."));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ if (CORBA::is_nil (addr_server))
+ {
+ ACE_ERROR ((LM_ERROR, "TAO_ECG_UDP_Sender::init(): "
+ "address server argument is nil."));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ this->cdr_sender_.init (endpoint_rptr ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->lcl_ec_ =
+ RtecEventChannelAdmin::EventChannel::_duplicate (lcl_ec);
+
+ this->addr_server_ =
+ RtecUDPAdmin::AddrServer::_duplicate (addr_server);
+}
+
+void
+TAO_ECG_UDP_Sender::connect (const RtecEventChannelAdmin::ConsumerQOS& sub
+ ACE_ENV_ARG_DECL)
+{
+ if (CORBA::is_nil (this->lcl_ec_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR, "Error initializing TAO_ECG_UDP_Sender: "
+ "init() has not been called before connect()."));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ if (sub.dependencies.length () == 0)
+ {
+ ACE_ERROR ((LM_ERROR, "TAO_ECG_UDP_Sender::connect(): "
+ "0-length subscriptions argument."));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ if (CORBA::is_nil (this->supplier_proxy_.in ()))
+ {
+ this->new_connect (sub ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ this->reconnect (sub ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_ECG_UDP_Sender::new_connect (const RtecEventChannelAdmin::ConsumerQOS& sub
+ ACE_ENV_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;
+
+ // Connect as a consumer to the local EC.
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ this->lcl_ec_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var proxy =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ ECG_Sender_Auto_Proxy_Disconnect new_proxy_disconnect (proxy.in ());
+
+ proxy->connect_push_consumer (consumer_ref.in (),
+ sub
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Update resource managers.
+ this->supplier_proxy_ = proxy._retn ();
+ this->auto_proxy_disconnect_.set_command (new_proxy_disconnect);
+ this->set_deactivator (deactivator);
+}
+
+void
+TAO_ECG_UDP_Sender::reconnect (const RtecEventChannelAdmin::ConsumerQOS& sub
+ ACE_ENV_ARG_DECL)
+{
+ // Obtain our object reference from the POA.
+ RtecEventComm::PushConsumer_var consumer_ref;
+ PortableServer::POA_var poa = this->_default_POA ();
+
+ CORBA::Object_var obj = poa->servant_to_reference (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_ref =
+ RtecEventComm::PushConsumer::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (consumer_ref.in ()))
+ {
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ // Reconnect.
+ this->supplier_proxy_->connect_push_consumer (consumer_ref.in (),
+ sub
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_ECG_UDP_Sender::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Prevent attempts to disconnect.
+ this->auto_proxy_disconnect_.disallow_command ();
+
+ this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_ECG_UDP_Sender::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->supplier_proxy_ =
+ RtecEventChannelAdmin::ProxyPushSupplier::_nil ();
+
+ this->auto_proxy_disconnect_.execute ();
+
+ this->addr_server_ = RtecUDPAdmin::AddrServer::_nil ();
+ this->lcl_ec_ = RtecEventChannelAdmin::EventChannel::_nil ();
+
+ this->deactivator_.deactivate ();
+ this->cdr_sender_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_ECG_UDP_Sender::push (const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (events.length () == 0)
+ {
+ // ACE_DEBUG ((EC_FORMAT (DEBUG,
+ // "Nothing to multicast: "
+ // "0-length EventSet.")));
+ return;
+ }
+
+ // Send each event in a separate message.
+ // @@ TODO It is interesting to group events destined to the
+ // same mcast group in a single message.
+ for (u_int i = 0; i < events.length (); ++i)
+ {
+ // To avoid loops we keep a TTL field on the events and skip the
+ // events with TTL <= 0
+ if (events[i].header.ttl <= 0)
+ continue;
+
+ const RtecEventComm::Event& e = events[i];
+
+ // We need to modify the TTL field, but copying the entire event
+ // would be wasteful; instead we create a new header and only
+ // modify the header portion.
+ RtecEventComm::EventHeader header = e.header;
+ header.ttl--;
+
+ // Start building the message
+ TAO_OutputCDR cdr;
+
+ // Marshal as if it was a sequence of one element, notice how we
+ // marshal a modified version of the header, but the payload is
+ // marshal without any extra copies.
+ cdr.write_ulong (1);
+ if (!(cdr << header)
+ || !(cdr << e.data))
+ ACE_THROW (CORBA::MARSHAL ());
+
+ // Grab the right mcast group for this event...
+ RtecUDPAdmin::UDP_Addr udp_addr;
+ this->addr_server_->get_addr (header, udp_addr ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_INET_Addr inet_addr (udp_addr.port,
+ udp_addr.ipaddr);
+
+ this->cdr_sender_.send_message (cdr, inet_addr ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.h b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.h
new file mode 100644
index 00000000000..6210db74d1d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.h
@@ -0,0 +1,230 @@
+// -*- C++ -*-
+
+/**
+ * @file ECG_UDP_Sender.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ * @author Marina Spivak (marina@atdesk.com)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ *
+ * Define helper classes to propagate events between ECs using
+ * either UDP or multicast.
+ * The architecture is a bit complicated and deserves some
+ * explanation: sending the events over UDP (or mcast) is easy, a
+ * Consumer (TAO_ECG_UDP_Sender) subscribes for a certain set of
+ * events, its push() method marshalls the event set into a CDR
+ * stream that is sent using an ACE_SOCK_Dgram. The subscription
+ * set and IP address can be configured.
+ * Another helper class (TAO_ECG_UDP_Receiver) acts as a supplier of
+ * events; it receives a callback when an event is available on an
+ * ACE_SOCK_Dgram, it demarshalls the event and pushes it to the
+ * EC. Two ACE_Event_Handler classes are provided that can forward
+ * the events to this Supplier: TAO_ECG_Mcast_EH can receive events
+ * from a multicast group; TAO_ECG_UDP_EH can receive events from a
+ * regular UDP socket.
+ *
+ * @todo The class makes an extra copy of the events, we need to
+ * investigate if closer collaboration with its collocated EC could
+ * be used to remove that copy.
+ *
+ */
+
+#ifndef TAO_ECG_UDP_SENDER_H
+#define TAO_ECG_UDP_SENDER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecUDPAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+#include "orbsvcs/RtecEventChannelAdminS.h"
+
+#include "orbsvcs/Event/EC_Lifetime_Utils.h"
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.h"
+#include "orbsvcs/Event/ECG_CDR_Message_Sender.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_SOCK_Dgram;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ECG_UDP_Out_Endpoint;
+
+/**
+ * @class TAO_ECG_UDP_Sender_Disconnect_Command
+ *
+ * @brief Disconnects consumer represented by @a proxy from the Event Channel.
+ *
+ * Utility class for use as a template argument to TAO_EC_Auto_Command.
+ * TAO_EC_Auto_Command<TAO_ECG_UDP_Sender_Disconnect_Command> manages
+ * consumer connection to the Event Channel, automatically disconnecting from
+ * @a proxy in its destructor, if necessary.
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_UDP_Sender_Disconnect_Command
+{
+public:
+ TAO_ECG_UDP_Sender_Disconnect_Command (void);
+ TAO_ECG_UDP_Sender_Disconnect_Command (
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr proxy);
+
+ TAO_ECG_UDP_Sender_Disconnect_Command (
+ const TAO_ECG_UDP_Sender_Disconnect_Command & rhs);
+
+ TAO_ECG_UDP_Sender_Disconnect_Command &
+ operator= (const TAO_ECG_UDP_Sender_Disconnect_Command & rhs);
+
+ void execute (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var proxy_;
+};
+
+
+/**
+ * @class TAO_ECG_UDP_Sender
+ *
+ * @brief Send events received from a "local" EC using UDP.
+ * NOT THREAD-SAFE.
+ * This class connect as a consumer to an EventChannel
+ * and forwards the events it receives from that EC using UDP.
+ *
+ */
+class TAO_RTEvent_Serv_Export TAO_ECG_UDP_Sender :
+ public virtual POA_RtecEventComm::PushConsumer,
+ public TAO_EC_Deactivated_Object
+{
+public:
+
+ /// Initialization and termination methods.
+ //@{
+
+ /// Create a new TAO_ECG_UDP_Sender object.
+ /// (Constructor access is restricted to insure that all
+ /// TAO_ECG_UDP_Sender objects are heap-allocated.)
+ static TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> create (CORBA::Boolean crc = 0);
+
+ ~TAO_ECG_UDP_Sender (void);
+
+ /**
+ * @param lcl_ec Event Channel to which we will act as a consumer of events.
+ * @param addr_server Address server used to obtain event type to
+ * multicast group mapping.
+ * @param endpoint_rptr Endpoint for sending udp/multicast messages.
+ * Endpoint's dgram must be open!
+ *
+ * To insure proper resource clean up, if init () is successful,
+ * shutdown () must be called when the sender is no longer needed.
+ * This is done by disconnect_push_consumer() method. If
+ * disconnect_push_consumer() will not be called, it is the
+ * responsibility of the user.
+ * Furthermore, if shutdown() is not explicitly called by
+ * either disconnect_push_consumer () or the user, the sender
+ * will clean up the resources in its destructor, however, certain
+ * entities involved in cleanup must still exist at that point,
+ * e.g., POA.
+ */
+ void init (RtecEventChannelAdmin::EventChannel_ptr lcl_ec,
+ RtecUDPAdmin::AddrServer_ptr addr_server,
+ TAO_ECG_Refcounted_Endpoint endpoint_rptr
+ ACE_ENV_ARG_DECL);
+
+ /// Connect or reconnect to the EC with the given subscriptions.
+ /**
+ * NOTE: if we are already connected to EC and a reconnection is
+ * necessary, the EC must have reconnects enabled in order for this
+ * method to succeed.
+ */
+ void connect (const RtecEventChannelAdmin::ConsumerQOS &sub
+ ACE_ENV_ARG_DECL);
+
+ /// Deactivate from POA and disconnect from EC, if necessary. Shut
+ /// down all sender components.
+ /**
+ * Calling this method may result in decrementing of the reference
+ * count (due to deactivation) and deletion of the object.
+ */
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+ //@}
+
+ /// Accessors.
+ //@{
+ /**
+ * The sender may need to fragment the message, otherwise the
+ * network may drop the packets.
+ * Setting the MTU can fail if the value is too small (at least the
+ * header + 8 bytes must fit).
+ */
+ int mtu (CORBA::ULong mtu);
+ CORBA::ULong mtu (void) const;
+
+ /// Get the local endpoint used to send the events.
+ int get_local_addr (ACE_INET_Addr& addr);
+ //@}
+
+ /// The PushConsumer methods.
+ //@{
+ /// Invokes shutdown (), which may result in the object being deleted, if
+ /// refcounting is used to manage its lifetime.
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void push (const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+protected:
+
+ /// Constructor (protected). Clients can create new
+ /// TAO_ECG_UDP_Sender objects using the static create() method.
+ TAO_ECG_UDP_Sender (CORBA::Boolean crc = 0);
+
+private:
+
+ /// Helpers for the connect() method.
+ //@{
+ // Establishes connection to the Event Channel for the first time.
+ void new_connect (const RtecEventChannelAdmin::ConsumerQOS& sub
+ ACE_ENV_ARG_DECL);
+
+ // Updates existing connection to the Event Channel.
+ void reconnect (const RtecEventChannelAdmin::ConsumerQOS& sub
+ ACE_ENV_ARG_DECL);
+ //@}
+
+ /// Proxy used to receive events from the Event Channel.
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+
+ /// Event Channel to which we act as a consumer.
+ RtecEventChannelAdmin::EventChannel_var lcl_ec_;
+
+ /// We query this object to determine where the events should be sent.
+ RtecUDPAdmin::AddrServer_var addr_server_;
+
+ /// Helper for fragmenting and sending cdr-encoded events using udp.
+ TAO_ECG_CDR_Message_Sender cdr_sender_;
+
+ typedef TAO_EC_Auto_Command<TAO_ECG_UDP_Sender_Disconnect_Command>
+ ECG_Sender_Auto_Proxy_Disconnect;
+ /// Manages our connection to Supplier Proxy.
+ ECG_Sender_Auto_Proxy_Disconnect auto_proxy_disconnect_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/Event/ECG_UDP_Sender.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_ECG_UDP_SENDER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.inl b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.inl
new file mode 100644
index 00000000000..c58a7a81ca8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.inl
@@ -0,0 +1,96 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE TAO_EC_Servant_Var<TAO_ECG_UDP_Sender>
+TAO_ECG_UDP_Sender::create (CORBA::Boolean crc)
+{
+ TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> s;
+ ACE_NEW_RETURN (s,
+ TAO_ECG_UDP_Sender (crc),
+ s);
+ return s;
+}
+
+ACE_INLINE
+TAO_ECG_UDP_Sender::TAO_ECG_UDP_Sender (CORBA::Boolean crc)
+ : supplier_proxy_ ()
+ , lcl_ec_ ()
+ , addr_server_ ()
+ , cdr_sender_ (crc)
+ , auto_proxy_disconnect_ ()
+{
+}
+
+ACE_INLINE CORBA::ULong
+TAO_ECG_UDP_Sender::mtu (void) const
+{
+ return this->cdr_sender_.mtu ();
+}
+
+ACE_INLINE int
+TAO_ECG_UDP_Sender::mtu (CORBA::ULong new_mtu)
+{
+ return this->cdr_sender_.mtu (new_mtu);
+}
+
+ACE_INLINE int
+TAO_ECG_UDP_Sender::get_local_addr (ACE_INET_Addr& addr)
+{
+ return this->cdr_sender_.get_local_addr (addr);
+}
+//***************************************************************************
+
+ACE_INLINE
+TAO_ECG_UDP_Sender_Disconnect_Command::
+TAO_ECG_UDP_Sender_Disconnect_Command (void)
+ : proxy_ ()
+{
+}
+
+ACE_INLINE
+TAO_ECG_UDP_Sender_Disconnect_Command::
+TAO_ECG_UDP_Sender_Disconnect_Command (
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr proxy)
+ : proxy_ (RtecEventChannelAdmin::ProxyPushSupplier::_duplicate (proxy))
+{
+}
+
+ACE_INLINE
+TAO_ECG_UDP_Sender_Disconnect_Command::
+TAO_ECG_UDP_Sender_Disconnect_Command (
+ const TAO_ECG_UDP_Sender_Disconnect_Command & rhs)
+ : proxy_ (RtecEventChannelAdmin::ProxyPushSupplier::_duplicate
+ (rhs.proxy_.in ()))
+{
+}
+
+ACE_INLINE TAO_ECG_UDP_Sender_Disconnect_Command &
+TAO_ECG_UDP_Sender_Disconnect_Command::operator= (
+ const TAO_ECG_UDP_Sender_Disconnect_Command & rhs)
+{
+ this->proxy_ =
+ RtecEventChannelAdmin::ProxyPushSupplier::_duplicate (rhs.proxy_.in ());
+
+ return *this;
+}
+
+ACE_INLINE void
+TAO_ECG_UDP_Sender_Disconnect_Command::execute (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->proxy_.in ()))
+ // We are not connected.
+ return;
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var release_proxy =
+ this->proxy_._retn ();
+
+ release_proxy->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_And_Filter.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_And_Filter.cpp
new file mode 100644
index 00000000000..715979d31a9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_And_Filter.cpp
@@ -0,0 +1,170 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_And_Filter.h"
+
+ACE_RCSID(Event, EC_And_Filter, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_And_Filter::TAO_EC_And_Filter (TAO_EC_Filter* children[],
+ size_t n)
+ : children_ (children),
+ n_ (n)
+{
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin ();
+ i != end;
+ ++i)
+ {
+ this->adopt_child (*i);
+ }
+}
+
+TAO_EC_And_Filter::~TAO_EC_And_Filter (void)
+{
+ TAO_EC_Filter** end = this->children_ + this->n_;
+ for (TAO_EC_Filter** i = this->children_;
+ i != end;
+ ++i)
+ {
+ delete *i;
+ *i = 0;
+ }
+ delete[] this->children_;
+ this->children_ = 0;
+ this->n_ = 0;
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_And_Filter::begin (void) const
+{
+ return this->children_;
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_And_Filter::end (void) const
+{
+ return this->children_ + this->n_;
+}
+
+int
+TAO_EC_And_Filter::size (void) const
+{
+ return static_cast<CORBA::ULong> (this->n_);
+}
+
+int
+TAO_EC_And_Filter::filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin (); i != end; ++i)
+ {
+ int n = (*i)->filter (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ if (n == 0)
+ return 0;
+ }
+
+ // All children accepted the event, push up...
+ if (this->parent () != 0)
+ {
+ this->parent ()->push (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return 1;
+}
+
+int
+TAO_EC_And_Filter::filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin (); i != end; ++i)
+ {
+ int n = (*i)->filter_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ if (n == 0)
+ return 0;
+ }
+
+ // All children accepted the event, push up...
+ if (this->parent () != 0)
+ {
+ this->parent ()->push (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return 1;
+}
+
+void
+TAO_EC_And_Filter::push (const RtecEventComm::EventSet&,
+ TAO_EC_QOS_Info&
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_And_Filter::push_nocopy (RtecEventComm::EventSet&,
+ TAO_EC_QOS_Info&
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_And_Filter::clear (void)
+{
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin ();
+ i != end;
+ ++i)
+ {
+ (*i)->clear ();
+ }
+}
+
+CORBA::ULong
+TAO_EC_And_Filter::max_event_size (void) const
+{
+ CORBA::ULong n = 0;
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin ();
+ i != end;
+ ++i)
+ {
+ CORBA::ULong c = (*i)->max_event_size ();
+ if (n < c)
+ n = c;
+ }
+ return n;
+}
+
+int
+TAO_EC_And_Filter::can_match (
+ const RtecEventComm::EventHeader& header) const
+{
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin ();
+ i != end;
+ ++i)
+ {
+ if ((*i)->can_match (header) == 0)
+ return 0;
+ }
+ return 1;
+}
+
+int
+TAO_EC_And_Filter::add_dependencies (
+ const RtecEventComm::EventHeader&,
+ const TAO_EC_QOS_Info&
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_And_Filter.h b/TAO/orbsvcs/orbsvcs/Event/EC_And_Filter.h
new file mode 100644
index 00000000000..67c9614af70
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_And_Filter.h
@@ -0,0 +1,89 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_And_Filter.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_AND_FILTER_H
+#define TAO_EC_AND_FILTER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Filter.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_And_Filter
+ *
+ * @brief The 'logical and' filter.
+ *
+ * This filter has a set of children (fixed at creation time),
+ * only if all the children accept an event it does so too.
+ *
+ * <H2>Memory Management</H2>
+ * It assumes ownership of the children.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_And_Filter : public TAO_EC_Filter
+{
+public:
+ /// Constructor. It assumes ownership of both the array and the
+ /// children.
+ TAO_EC_And_Filter (TAO_EC_Filter* children[],
+ size_t n);
+
+ /// Destructor
+ virtual ~TAO_EC_And_Filter (void);
+
+ // = The TAO_EC_Filter methods, please check the documentation in
+ // TAO_EC_Filter.
+ virtual ChildrenIterator begin (void) const;
+ virtual ChildrenIterator end (void) const;
+ virtual int size (void) const;
+ virtual int filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual int filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void clear (void);
+ virtual CORBA::ULong max_event_size (void) const;
+ virtual int can_match (const RtecEventComm::EventHeader& header) const;
+ virtual int add_dependencies (const RtecEventComm::EventHeader& header,
+ const TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_And_Filter (const TAO_EC_And_Filter&);
+ TAO_EC_And_Filter& operator= (const TAO_EC_And_Filter&);
+
+private:
+ /// The children
+ TAO_EC_Filter** children_;
+
+ /// The number of children.
+ size_t n_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_AND_FILTER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Factory.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Factory.cpp
new file mode 100644
index 00000000000..e9bc5dcb730
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Factory.cpp
@@ -0,0 +1,262 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Basic_Factory.h"
+#include "orbsvcs/Event/EC_Reactive_Dispatching.h"
+#include "orbsvcs/Event/EC_Basic_Filter_Builder.h"
+#include "orbsvcs/Event/EC_Trivial_Supplier_Filter.h"
+#include "orbsvcs/Event/EC_ConsumerAdmin.h"
+#include "orbsvcs/Event/EC_SupplierAdmin.h"
+#include "orbsvcs/Event/EC_Default_ProxyConsumer.h"
+#include "orbsvcs/Event/EC_Default_ProxySupplier.h"
+#include "orbsvcs/Event/EC_ObserverStrategy.h"
+#include "orbsvcs/Event/EC_Null_Scheduling.h"
+#include "orbsvcs/Event/EC_Reactive_Timeout_Generator.h"
+#include "orbsvcs/Event/EC_Reactive_ConsumerControl.h"
+#include "orbsvcs/Event/EC_Reactive_SupplierControl.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h" // @@ MSVC 6 bug
+
+#include "orbsvcs/ESF/ESF_Proxy_List.h"
+#include "orbsvcs/ESF/ESF_Delayed_Changes.h"
+
+#include "tao/ORB_Core.h"
+
+ACE_RCSID (Event,
+ EC_Basic_Factory,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Basic_Factory::TAO_EC_Basic_Factory (void)
+{
+}
+
+TAO_EC_Basic_Factory::~TAO_EC_Basic_Factory (void)
+{
+}
+
+TAO_EC_Dispatching*
+TAO_EC_Basic_Factory::create_dispatching (TAO_EC_Event_Channel_Base *)
+{
+ return new TAO_EC_Reactive_Dispatching ();
+}
+
+void
+TAO_EC_Basic_Factory::destroy_dispatching (TAO_EC_Dispatching *x)
+{
+ delete x;
+}
+
+TAO_EC_Filter_Builder*
+TAO_EC_Basic_Factory::create_filter_builder (TAO_EC_Event_Channel_Base *ec)
+{
+ return new TAO_EC_Basic_Filter_Builder (ec);
+}
+
+void
+TAO_EC_Basic_Factory::destroy_filter_builder (TAO_EC_Filter_Builder *x)
+{
+ delete x;
+}
+
+TAO_EC_Supplier_Filter_Builder*
+TAO_EC_Basic_Factory::create_supplier_filter_builder (TAO_EC_Event_Channel_Base *ec)
+{
+ return new TAO_EC_Trivial_Supplier_Filter_Builder (ec);
+}
+
+void
+TAO_EC_Basic_Factory::destroy_supplier_filter_builder (TAO_EC_Supplier_Filter_Builder *x)
+{
+ delete x;
+}
+
+TAO_EC_ConsumerAdmin*
+TAO_EC_Basic_Factory::create_consumer_admin (TAO_EC_Event_Channel_Base *ec)
+{
+ return new TAO_EC_ConsumerAdmin (ec);
+}
+
+void
+TAO_EC_Basic_Factory::destroy_consumer_admin (TAO_EC_ConsumerAdmin *x)
+{
+ delete x;
+}
+
+TAO_EC_SupplierAdmin*
+TAO_EC_Basic_Factory::create_supplier_admin (TAO_EC_Event_Channel_Base *ec)
+{
+ return new TAO_EC_SupplierAdmin (ec);
+}
+
+void
+TAO_EC_Basic_Factory::destroy_supplier_admin (TAO_EC_SupplierAdmin *x)
+{
+ delete x;
+}
+
+TAO_EC_ProxyPushSupplier*
+TAO_EC_Basic_Factory::create_proxy_push_supplier (TAO_EC_Event_Channel_Base *ec)
+{
+ return new TAO_EC_Default_ProxyPushSupplier (ec, TAO_EC_DEFAULT_CONSUMER_VALIDATE_CONNECTION);
+}
+
+void
+TAO_EC_Basic_Factory::destroy_proxy_push_supplier (TAO_EC_ProxyPushSupplier *x)
+{
+ delete x;
+}
+
+TAO_EC_ProxyPushConsumer*
+TAO_EC_Basic_Factory::create_proxy_push_consumer (TAO_EC_Event_Channel_Base *ec)
+{
+ return new TAO_EC_Default_ProxyPushConsumer (ec);
+}
+
+void
+TAO_EC_Basic_Factory::destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer *x)
+{
+ delete x;
+}
+
+TAO_EC_Timeout_Generator*
+TAO_EC_Basic_Factory::create_timeout_generator (TAO_EC_Event_Channel_Base *)
+{
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "");
+ ACE_Reactor *reactor = orb->orb_core ()->reactor ();
+ return new TAO_EC_Reactive_Timeout_Generator (reactor);
+}
+
+void
+TAO_EC_Basic_Factory::destroy_timeout_generator (TAO_EC_Timeout_Generator *x)
+{
+ delete x;
+}
+
+TAO_EC_ObserverStrategy*
+TAO_EC_Basic_Factory::create_observer_strategy (TAO_EC_Event_Channel_Base *ec)
+{
+ ACE_Lock* lock;
+ ACE_NEW_RETURN (lock, ACE_Lock_Adapter<TAO_SYNCH_MUTEX>, 0);
+ return new TAO_EC_Basic_ObserverStrategy (ec, lock);
+}
+
+void
+TAO_EC_Basic_Factory::destroy_observer_strategy (TAO_EC_ObserverStrategy *x)
+{
+ delete x;
+}
+
+TAO_EC_Scheduling_Strategy*
+TAO_EC_Basic_Factory::create_scheduling_strategy (TAO_EC_Event_Channel_Base*)
+{
+ return new TAO_EC_Null_Scheduling;
+}
+
+void
+TAO_EC_Basic_Factory::destroy_scheduling_strategy (TAO_EC_Scheduling_Strategy* x)
+{
+ delete x;
+}
+
+TAO_EC_ProxyPushConsumer_Collection*
+TAO_EC_Basic_Factory::create_proxy_push_consumer_collection (TAO_EC_Event_Channel_Base *)
+{
+ // This typedef is a workaround for a SunCC 4.2 bug
+ typedef TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>::Iterator TAO_EC_Consumer_List_Iterator;
+ return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>::Iterator,
+ ACE_SYNCH> ();
+}
+
+void
+TAO_EC_Basic_Factory::destroy_proxy_push_consumer_collection (TAO_EC_ProxyPushConsumer_Collection *x)
+{
+ delete x;
+}
+
+TAO_EC_ProxyPushSupplier_Collection*
+TAO_EC_Basic_Factory::create_proxy_push_supplier_collection (TAO_EC_Event_Channel_Base *)
+{
+ // This typedef is a workaround for a SunCC 4.2 bug
+ typedef TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>::Iterator TAO_EC_Supplier_List_Iterator;
+ return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>::Iterator,
+ ACE_SYNCH> ();
+}
+
+void
+TAO_EC_Basic_Factory::destroy_proxy_push_supplier_collection (TAO_EC_ProxyPushSupplier_Collection *x)
+{
+ delete x;
+}
+
+ACE_Lock*
+TAO_EC_Basic_Factory::create_consumer_lock (void)
+{
+ return new ACE_Lock_Adapter<TAO_SYNCH_MUTEX> ();
+}
+
+void
+TAO_EC_Basic_Factory::destroy_consumer_lock (ACE_Lock* x)
+{
+ delete x;
+}
+
+ACE_Lock*
+TAO_EC_Basic_Factory::create_supplier_lock (void)
+{
+ return new ACE_Lock_Adapter<TAO_SYNCH_RECURSIVE_MUTEX> ();
+}
+
+void
+TAO_EC_Basic_Factory::destroy_supplier_lock (ACE_Lock* x)
+{
+ delete x;
+}
+
+TAO_EC_ConsumerControl*
+TAO_EC_Basic_Factory::create_consumer_control (TAO_EC_Event_Channel_Base* ec)
+{
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "");
+ // Hard-coded rate to 10 times a second
+ ACE_Time_Value rate (0, 100000);
+ // Hard-coded polling-timeout to 10 msec
+ ACE_Time_Value timeout (0, TAO_EC_DEFAULT_CONSUMER_CONTROL_TIMEOUT);
+ return new TAO_EC_Reactive_ConsumerControl (rate, timeout, ec, orb.in ());
+}
+
+void
+TAO_EC_Basic_Factory::destroy_consumer_control (TAO_EC_ConsumerControl* x)
+{
+ delete x;
+}
+
+TAO_EC_SupplierControl*
+TAO_EC_Basic_Factory::create_supplier_control (TAO_EC_Event_Channel_Base* ec)
+{
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "");
+ // Hard-coded rate to 10 times a second
+ ACE_Time_Value rate (0, 100000);
+ // Hard-coded polling-timeout to 10 msec
+ ACE_Time_Value timeout (0, TAO_EC_DEFAULT_SUPPLIER_CONTROL_TIMEOUT);
+ return new TAO_EC_Reactive_SupplierControl (rate, timeout, ec, orb.in ());
+}
+
+void
+TAO_EC_Basic_Factory::destroy_supplier_control (TAO_EC_SupplierControl* x)
+{
+ delete x;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Factory.h b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Factory.h
new file mode 100644
index 00000000000..aa942b26492
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Factory.h
@@ -0,0 +1,120 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Basic_Factory.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_BASIC_FACTORY_H
+#define TAO_EC_BASIC_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Factory.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Basic_Factory
+ *
+ * @brief The factory for a simple event channel.
+ *
+ * An slightly more advanced configuration than the
+ * EC_Null_Factory, this class configure an event channel that can
+ * support filtering and correlation. Still dispatching is not
+ * prioritized and all the filtering is done at the consumer level.
+ * A fixed POA is used for servant activation.
+ * This object creates a single instance of the Supplier
+ *
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Basic_Factory : public TAO_EC_Factory
+{
+public:
+ /// Constructor
+ TAO_EC_Basic_Factory (void);
+
+ /// destructor...
+ virtual ~TAO_EC_Basic_Factory (void);
+
+ // = The EC_Factory methods
+ virtual TAO_EC_Dispatching*
+ create_dispatching (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_dispatching (TAO_EC_Dispatching*);
+ virtual TAO_EC_Filter_Builder*
+ create_filter_builder (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_filter_builder (TAO_EC_Filter_Builder*);
+ virtual TAO_EC_Supplier_Filter_Builder*
+ create_supplier_filter_builder (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_supplier_filter_builder (TAO_EC_Supplier_Filter_Builder*);
+ virtual TAO_EC_ConsumerAdmin*
+ create_consumer_admin (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_consumer_admin (TAO_EC_ConsumerAdmin*);
+ virtual TAO_EC_SupplierAdmin*
+ create_supplier_admin (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_supplier_admin (TAO_EC_SupplierAdmin*);
+ virtual TAO_EC_ProxyPushSupplier*
+ create_proxy_push_supplier (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_supplier (TAO_EC_ProxyPushSupplier*);
+ virtual TAO_EC_ProxyPushConsumer*
+ create_proxy_push_consumer (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer*);
+ virtual TAO_EC_Timeout_Generator*
+ create_timeout_generator (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_timeout_generator (TAO_EC_Timeout_Generator*);
+ virtual TAO_EC_ObserverStrategy*
+ create_observer_strategy (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_observer_strategy (TAO_EC_ObserverStrategy*);
+ virtual TAO_EC_Scheduling_Strategy*
+ create_scheduling_strategy (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_scheduling_strategy (TAO_EC_Scheduling_Strategy*);
+ virtual TAO_EC_ProxyPushConsumer_Collection*
+ create_proxy_push_consumer_collection (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_consumer_collection (TAO_EC_ProxyPushConsumer_Collection*);
+ virtual TAO_EC_ProxyPushSupplier_Collection*
+ create_proxy_push_supplier_collection (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_supplier_collection (TAO_EC_ProxyPushSupplier_Collection*);
+
+ virtual ACE_Lock* create_consumer_lock (void);
+ virtual void destroy_consumer_lock (ACE_Lock*);
+ virtual ACE_Lock* create_supplier_lock (void);
+ virtual void destroy_supplier_lock (ACE_Lock*);
+
+ virtual TAO_EC_ConsumerControl*
+ create_consumer_control (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_consumer_control (TAO_EC_ConsumerControl*);
+ virtual TAO_EC_SupplierControl*
+ create_supplier_control (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_supplier_control (TAO_EC_SupplierControl*);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_BASIC_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.cpp
new file mode 100644
index 00000000000..e8149330316
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.cpp
@@ -0,0 +1,203 @@
+// $Id$
+
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Event/EC_Basic_Filter_Builder.h"
+#include "orbsvcs/Event/EC_Type_Filter.h"
+#include "orbsvcs/Event/EC_Conjunction_Filter.h"
+#include "orbsvcs/Event/EC_Disjunction_Filter.h"
+#include "orbsvcs/Event/EC_And_Filter.h"
+#include "orbsvcs/Event/EC_Negation_Filter.h"
+#include "orbsvcs/Event/EC_Bitmask_Filter.h"
+#include "orbsvcs/Event/EC_Masked_Type_Filter.h"
+#include "orbsvcs/Event/EC_Timeout_Filter.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Basic_Filter_Builder.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_Basic_Filter_Builder, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Basic_Filter_Builder::~TAO_EC_Basic_Filter_Builder (void)
+{
+}
+
+TAO_EC_Filter*
+TAO_EC_Basic_Filter_Builder::build (
+ TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos
+ ACE_ENV_ARG_DECL_NOT_USED) const
+{
+ CORBA::ULong pos = 0;
+ return this->recursive_build (supplier, qos, pos);
+}
+
+TAO_EC_Filter*
+TAO_EC_Basic_Filter_Builder:: recursive_build (
+ TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong& pos) const
+{
+ CORBA::ULong l = qos.dependencies.length ();
+ if (pos == l)
+ return 0;
+
+ const RtecEventComm::Event& e = qos.dependencies[pos].event;
+ if (e.header.type == ACE_ES_CONJUNCTION_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+ CORBA::ULong n = this->count_children (qos, pos);
+
+ TAO_EC_Filter** children;
+ ACE_NEW_RETURN (children, TAO_EC_Filter*[n], 0);
+ CORBA::ULong i = 0;
+ for (; i != n; ++i)
+ {
+ children[i] = this->recursive_build (supplier, qos, pos);
+ }
+ return new TAO_EC_Conjunction_Filter (children, n);
+ }
+ else if (e.header.type == ACE_ES_DISJUNCTION_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+ CORBA::ULong n = this->count_children (qos, pos);
+
+ TAO_EC_Filter** children;
+ ACE_NEW_RETURN (children, TAO_EC_Filter*[n], 0);
+ CORBA::ULong i = 0;
+ for (; i != n; ++i)
+ {
+ children[i] = this->recursive_build (supplier, qos, pos);
+ }
+ return new TAO_EC_Disjunction_Filter (children, n);
+ }
+ else if (e.header.type == ACE_ES_LOGICAL_AND_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+ CORBA::ULong n = this->count_children (qos, pos);
+
+ TAO_EC_Filter** children;
+ ACE_NEW_RETURN (children, TAO_EC_Filter*[n], 0);
+ CORBA::ULong i = 0;
+ for (; i != n; ++i)
+ {
+ children[i] = this->recursive_build (supplier, qos, pos);
+ }
+ return new TAO_EC_And_Filter (children, n);
+ }
+ else if (e.header.type == ACE_ES_NEGATION_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+
+ TAO_EC_Filter *child =
+ this->recursive_build (supplier, qos, pos);
+ return new TAO_EC_Negation_Filter (child);
+ }
+ else if (e.header.type == ACE_ES_BITMASK_DESIGNATOR)
+ {
+ pos++; // COnsumer the designator
+
+ if (pos == qos.dependencies.length ())
+ return 0;
+ CORBA::ULong source_mask = qos.dependencies[pos].event.header.source;
+ CORBA::ULong type_mask = qos.dependencies[pos].event.header.type;
+ pos++;
+
+ TAO_EC_Filter *child =
+ this->recursive_build (supplier, qos, pos);
+ return new TAO_EC_Bitmask_Filter (source_mask,
+ type_mask,
+ child);
+ }
+ else if (e.header.type == ACE_ES_MASKED_TYPE_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+
+ if (pos == qos.dependencies.length ())
+ return 0;
+ CORBA::ULong source_mask = qos.dependencies[pos].event.header.source;
+ CORBA::ULong type_mask = qos.dependencies[pos].event.header.type;
+ pos++;
+
+ if (pos == qos.dependencies.length ())
+ return 0;
+ CORBA::ULong source_value = qos.dependencies[pos].event.header.source;
+ CORBA::ULong type_value = qos.dependencies[pos].event.header.type;
+ pos++;
+
+ return new TAO_EC_Masked_Type_Filter (source_mask,
+ type_mask,
+ source_value,
+ type_value);
+ }
+ else if (e.header.type == ACE_ES_NULL_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+
+ return new TAO_EC_Null_Filter ();
+ }
+ else if (e.header.type == ACE_ES_EVENT_TIMEOUT
+ || e.header.type == ACE_ES_EVENT_INTERVAL_TIMEOUT
+ || e.header.type == ACE_ES_EVENT_DEADLINE_TIMEOUT)
+ {
+ pos++; // Consume the designator
+ TAO_EC_QOS_Info qos_info;
+ return new TAO_EC_Timeout_Filter (this->event_channel_,
+ supplier,
+ qos_info,
+ e.header.type,
+ e.header.creation_time);
+ }
+ pos++; // Consume the event
+ return new TAO_EC_Type_Filter (e.header);
+}
+
+CORBA::ULong
+TAO_EC_Basic_Filter_Builder::
+ count_children (RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong pos) const
+{
+ CORBA::ULong l = qos.dependencies.length ();
+ CORBA::ULong i;
+ int count = 0;
+ for (i = pos; i != l; ++i)
+ {
+ const RtecEventComm::Event& e = qos.dependencies[i].event;
+ if (e.header.type == ACE_ES_CONJUNCTION_DESIGNATOR
+ || e.header.type == ACE_ES_DISJUNCTION_DESIGNATOR
+ || e.header.type == ACE_ES_LOGICAL_AND_DESIGNATOR)
+ // We won't let these be nested by the basic filter builder.
+ // Assume these are the end of the group
+ break;
+ else if (e.header.type == ACE_ES_BITMASK_DESIGNATOR)
+ // These take up an extra element
+ i++;
+ else if (e.header.type == ACE_ES_MASKED_TYPE_DESIGNATOR)
+ // These take up two extra elements
+ i += 2;
+ else if (e.header.type == ACE_ES_NEGATION_DESIGNATOR) {
+ // These enclose another filter.
+ // Lets try to figure out how many elements the enclosed
+ // filter takes up (but don't count it in the group).
+ // Only allow basic filter types and bitmasks within
+ // a negation (when it is nested within a group).
+ // This is isn't perfect, but its about the best we can
+ // do without prefixes.
+ i++;
+ switch (qos.dependencies[i].event.header.type) {
+ case ACE_ES_BITMASK_DESIGNATOR:
+ i++;
+ break;
+ case ACE_ES_MASKED_TYPE_DESIGNATOR:
+ i += 2;
+ break;
+ }
+ }
+ count++;
+ }
+ return count;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.h b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.h
new file mode 100644
index 00000000000..f6627fc35c5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.h
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Basic_Filter_Builder.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_BASIC_FILTER_BUILDER_H
+#define TAO_EC_BASIC_FILTER_BUILDER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Filter_Builder.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Filter;
+class TAO_EC_Event_Channel_Base;
+
+/**
+ * @class TAO_EC_Basic_Filter_Builder
+ *
+ * @brief Implement a builder for the fundamental filters.
+ *
+ * The basic filtering mechanisms in the Event channel
+ * (source/type based filtering + disjunctions, conjunctions, logical ands,
+ * negations, and bitmasks) are constructed using this class.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Basic_Filter_Builder : public TAO_EC_Filter_Builder
+{
+public:
+ /// constructor.
+ TAO_EC_Basic_Filter_Builder (TAO_EC_Event_Channel_Base* ec);
+
+ /// destructor...
+ virtual ~TAO_EC_Basic_Filter_Builder (void);
+
+ // = The TAO_EC_Filter_Builder methods...
+ TAO_EC_Filter* build (TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos
+ ACE_ENV_ARG_DECL) const;
+
+private:
+ /// Recursively build the filter tree.
+ TAO_EC_Filter* recursive_build (TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong& pos) const;
+
+ /// Count the number of children of the current node, i.e. until a
+ /// conjunction, disjunction, logical and, bitmask, or negation occurs.
+ CORBA::ULong count_children (RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong pos) const;
+
+private:
+ /// The event channel.
+ TAO_EC_Event_Channel_Base* event_channel_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Basic_Filter_Builder.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_BASIC_FILTER_BUILDER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.i b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.i
new file mode 100644
index 00000000000..ebf53c20045
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Basic_Filter_Builder.i
@@ -0,0 +1,14 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Basic_Filter_Builder::
+ TAO_EC_Basic_Filter_Builder (TAO_EC_Event_Channel_Base *ec)
+ : event_channel_ (ec)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Bitmask_Filter.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Bitmask_Filter.cpp
new file mode 100644
index 00000000000..7701ba4d1d1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Bitmask_Filter.cpp
@@ -0,0 +1,122 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Bitmask_Filter.h"
+
+ACE_RCSID(Event, EC_Bitmask_Filter, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Bitmask_Filter::TAO_EC_Bitmask_Filter (CORBA::ULong source_mask,
+ CORBA::ULong type_mask,
+ TAO_EC_Filter* child)
+ : source_mask_ (source_mask),
+ type_mask_ (type_mask),
+ child_ (child)
+{
+ this->adopt_child (this->child_);
+}
+
+TAO_EC_Bitmask_Filter::~TAO_EC_Bitmask_Filter (void)
+{
+ delete this->child_;
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Bitmask_Filter::begin (void) const
+{
+ return const_cast<TAO_EC_Filter**> (&this->child_);
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Bitmask_Filter::end (void) const
+{
+ return const_cast<TAO_EC_Filter**> (&this->child_) + 1;
+}
+
+int
+TAO_EC_Bitmask_Filter::size (void) const
+{
+ return 1;
+}
+
+int
+TAO_EC_Bitmask_Filter::filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (event.length () != 1)
+ return 0;
+
+ if ((event[0].header.type & this->type_mask_) == 0
+ || (event[0].header.source & this->source_mask_) == 0)
+ return 0;
+
+ return this->child_->filter (event, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+int
+TAO_EC_Bitmask_Filter::filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (event.length () != 1)
+ return 0;
+
+ if ((event[0].header.type & this->type_mask_) == 0
+ || (event[0].header.source & this->source_mask_) == 0)
+ return 0;
+
+ return this->child_->filter_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Bitmask_Filter::push (const RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (this->parent () != 0)
+ this->parent ()->push (event, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Bitmask_Filter::push_nocopy (RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (this->parent () != 0)
+ this->parent ()->push_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Bitmask_Filter::clear (void)
+{
+ this->child_->clear ();
+}
+
+CORBA::ULong
+TAO_EC_Bitmask_Filter::max_event_size (void) const
+{
+ return this->child_->max_event_size ();
+}
+
+int
+TAO_EC_Bitmask_Filter::can_match (
+ const RtecEventComm::EventHeader& header) const
+{
+ if ((header.type & this->type_mask_) == 0
+ || (header.source & this->source_mask_) == 0)
+ return 0;
+
+ return this->child_->can_match (header);
+}
+
+int
+TAO_EC_Bitmask_Filter::add_dependencies (
+ const RtecEventComm::EventHeader&,
+ const TAO_EC_QOS_Info &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Bitmask_Filter.h b/TAO/orbsvcs/orbsvcs/Event/EC_Bitmask_Filter.h
new file mode 100644
index 00000000000..bc2a3469d00
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Bitmask_Filter.h
@@ -0,0 +1,107 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Bitmask_Filter.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_BITMASK_FILTER_H
+#define TAO_EC_BITMASK_FILTER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Filter.h"
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Bitmask_Filter
+ *
+ * @brief The bitmask filter.
+ *
+ * This filter quickly rejects events that do not match a given
+ * bitmask.
+ * If the event is not rejected based on the mask then the child
+ * is consulted to finally accept or reject the event.
+ * When composed with the Null_Filter it accepts any events that
+ * satisfy:
+ * (event.header.type & type_mask) != 0
+ * && (event.header.type & source_mask) != 0
+ *
+ * <H2>Memory Management</H2>
+ * It assumes ownership of the child.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Bitmask_Filter : public TAO_EC_Filter
+{
+public:
+ /**
+ * Constructor.
+ * Events that do not satisfy:
+ *
+ * (e.header.source & source_mask) != 0 &&
+ * (e.header.type & type_mask) != 0
+ *
+ * are immediately rejected, other events are recursively tested
+ * using the child node.
+ * It assumes ownership of the child.
+ */
+ TAO_EC_Bitmask_Filter (CORBA::ULong source_mask,
+ CORBA::ULong type_mask,
+ TAO_EC_Filter* child);
+
+ /// Destructor
+ virtual ~TAO_EC_Bitmask_Filter (void);
+
+ // = The TAO_EC_Filter methods, please check the documentation in
+ // TAO_EC_Filter.
+ virtual ChildrenIterator begin (void) const;
+ virtual ChildrenIterator end (void) const;
+ virtual int size (void) const;
+ virtual int filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual int filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void clear (void);
+ virtual CORBA::ULong max_event_size (void) const;
+ virtual int can_match (const RtecEventComm::EventHeader& header) const;
+ virtual int add_dependencies (const RtecEventComm::EventHeader& header,
+ const TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_Bitmask_Filter (const TAO_EC_Bitmask_Filter&);
+ TAO_EC_Bitmask_Filter& operator= (const TAO_EC_Bitmask_Filter&);
+
+private:
+ /// The bitmasks
+ CORBA::ULong source_mask_;
+ CORBA::ULong type_mask_;
+
+ /// The children
+ TAO_EC_Filter* child_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_BITMASK_FILTER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Busy_Lock.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Busy_Lock.cpp
new file mode 100644
index 00000000000..f2cce60ee21
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Busy_Lock.cpp
@@ -0,0 +1,64 @@
+// $Id$
+
+#ifndef TAO_EC_BUSY_LOCK_CPP
+#define TAO_EC_BUSY_LOCK_CPP
+
+#include "orbsvcs/Event/EC_Busy_Lock.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Busy_Lock.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class T>
+int TAO_EC_Busy_Lock_Adapter<T>::remove (void)
+{
+ return 0;
+}
+
+template<class T>
+int TAO_EC_Busy_Lock_Adapter<T>::acquire (void)
+{
+ return this->adaptee_->busy ();
+}
+
+template<class T>
+int TAO_EC_Busy_Lock_Adapter<T>::tryacquire (void)
+{
+ return this->adaptee_->busy ();
+}
+
+template<class T>
+int TAO_EC_Busy_Lock_Adapter<T>::release (void)
+{
+ return this->adaptee_->idle ();
+}
+
+template<class T>
+int TAO_EC_Busy_Lock_Adapter<T>::acquire_read (void)
+{
+ return this->adaptee_->busy ();
+}
+
+template<class T>
+int TAO_EC_Busy_Lock_Adapter<T>::acquire_write (void)
+{
+ return this->adaptee_->busy ();
+}
+
+template<class T>
+int TAO_EC_Busy_Lock_Adapter<T>::tryacquire_read (void)
+{
+ return this->adaptee_->busy ();
+}
+
+template<class T>
+int TAO_EC_Busy_Lock_Adapter<T>::tryacquire_write (void)
+{
+ return this->adaptee_->busy ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_EC_BUSY_LOCK_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Busy_Lock.h b/TAO/orbsvcs/orbsvcs/Event/EC_Busy_Lock.h
new file mode 100644
index 00000000000..1640d5b8bf2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Busy_Lock.h
@@ -0,0 +1,66 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Busy_Lock.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_BUSY_LOCK_H
+#define TAO_EC_BUSY_LOCK_H
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class Adaptee>
+class TAO_EC_Busy_Lock_Adapter
+{
+public:
+ /// Constructor
+ TAO_EC_Busy_Lock_Adapter (Adaptee* adaptee);
+
+ // = The ACE_Lock methods, please check $ACE_ROOT/ace/Synch.h for
+ // details.
+
+ int remove (void);
+ int acquire (void);
+ int tryacquire (void);
+ int release (void);
+ int acquire_read (void);
+ int acquire_write (void);
+ int tryacquire_read (void);
+ int tryacquire_write (void);
+
+private:
+ Adaptee* adaptee_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Busy_Lock.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Event/EC_Busy_Lock.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("EC_Busy_Lock.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_BUSY_LOCK_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Busy_Lock.i b/TAO/orbsvcs/orbsvcs/Event/EC_Busy_Lock.i
new file mode 100644
index 00000000000..670ad09dd63
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Busy_Lock.i
@@ -0,0 +1,13 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class T> ACE_INLINE
+TAO_EC_Busy_Lock_Adapter<T>::TAO_EC_Busy_Lock_Adapter (T* adaptee)
+ : adaptee_ (adaptee)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Channel_Destroyer.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Channel_Destroyer.cpp
new file mode 100644
index 00000000000..3759342a5e9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Channel_Destroyer.cpp
@@ -0,0 +1,30 @@
+/**
+ * @file EC_Channel_Destroyer.cpp
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@atdesk.com>
+ */
+
+#include "orbsvcs/Event/EC_Channel_Destroyer.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void
+TAO_EC_Channel_Destroyer_Functor::operator() (
+ TAO_EC_Event_Channel_Base * event_channel)
+ ACE_THROW_SPEC (())
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Channel_Destroyer.h b/TAO/orbsvcs/orbsvcs/Event/EC_Channel_Destroyer.h
new file mode 100644
index 00000000000..4b18ad808fd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Channel_Destroyer.h
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Channel_Destroyer.h
+ *
+ * @author Marina Spivak <marina@atdesk.com>
+ *
+ * $Id$
+ */
+#ifndef EC_CHANNEL_DESTROYER__H_
+#define EC_CHANNEL_DESTROYER__H_
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "ace/Auto_Functor.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @struct TAO_EC_Channel_Destroyer_Functor
+ *
+ * @brief Implements a functor for the TAO_EC_Channel_Destroyer class.
+ */
+struct TAO_RTEvent_Serv_Export TAO_EC_Channel_Destroyer_Functor
+{
+ typedef TAO_EC_Event_Channel_Base * argument;
+
+ /// Destroy @c event_channel
+ void operator() (TAO_EC_Event_Channel_Base * event_channel)
+ ACE_THROW_SPEC (());
+};
+
+/**
+ * @class TAO_EC_Channel_Destroyer
+ *
+ * @brief Helper class to destroy event channel.
+ *
+ */
+typedef ACE_Utils::Auto_Functor<
+ TAO_EC_Event_Channel_Base,
+ TAO_EC_Channel_Destroyer_Functor>
+ TAO_EC_Channel_Destroyer;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif // EC_CHANNEL_DESTROYER__H_
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Conjunction_Filter.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Conjunction_Filter.cpp
new file mode 100644
index 00000000000..e8fae3ae659
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Conjunction_Filter.cpp
@@ -0,0 +1,209 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Conjunction_Filter.h"
+
+ACE_RCSID(Event, EC_Conjunction_Filter, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+const int bits_per_word = sizeof(TAO_EC_Conjunction_Filter::Word) * CHAR_BIT;
+
+TAO_EC_Conjunction_Filter::
+ TAO_EC_Conjunction_Filter (TAO_EC_Filter* children[],
+ size_t n)
+ : children_ (children),
+ n_ (n)
+{
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin ();
+ i != end;
+ ++i)
+ {
+ this->adopt_child (*i);
+ }
+
+ this->nwords_ = this->n_ / bits_per_word + 1;
+ ACE_NEW (this->bitvec_, Word[this->nwords_]);
+
+ this->clear ();
+}
+
+TAO_EC_Conjunction_Filter::~TAO_EC_Conjunction_Filter (void)
+{
+ TAO_EC_Filter** end = this->children_ + this->n_;
+ for (TAO_EC_Filter** i = this->children_;
+ i != end;
+ ++i)
+ {
+ delete *i;
+ *i = 0;
+ }
+ delete[] this->children_;
+ this->children_ = 0;
+ this->n_ = 0;
+
+ delete[] this->bitvec_;
+ this->bitvec_ = 0;
+}
+
+int
+TAO_EC_Conjunction_Filter::all_received (void) const
+{
+ Word* i = this->bitvec_;
+ for (;
+ i != this->bitvec_ + this->nwords_;
+ ++i)
+ {
+ if (*i != static_cast<Word> (~0))
+ return 0;
+ }
+ return 1;
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Conjunction_Filter::begin (void) const
+{
+ return this->children_;
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Conjunction_Filter::end (void) const
+{
+ return this->children_ + this->n_;
+}
+
+int
+TAO_EC_Conjunction_Filter::size (void) const
+{
+ return static_cast<int> (this->n_);
+}
+
+int
+TAO_EC_Conjunction_Filter::filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ ChildrenIterator end = this->end ();
+ for (this->current_child_ = this->begin ();
+ this->current_child_ != end;
+ ++this->current_child_)
+ {
+ int n = (*this->current_child_)->filter (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ if (n != 0)
+ return n;
+ }
+ return 0;
+}
+
+int
+TAO_EC_Conjunction_Filter::filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin ();
+ i != end;
+ ++i)
+ {
+ int n = (*i)->filter_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ if (n != 0)
+ return n;
+ }
+ return 0;
+}
+
+void
+TAO_EC_Conjunction_Filter::push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Long pos = this->current_child_ - this->begin ();
+ int w = pos / bits_per_word;
+ int b = pos % bits_per_word;
+ if (ACE_BIT_ENABLED (this->bitvec_[w], 1<<b))
+ return;
+ ACE_SET_BITS (this->bitvec_[w], 1<<b);
+ CORBA::ULong n = event.length ();
+ CORBA::ULong l = this->event_.length ();
+ this->event_.length (l + n);
+ for (CORBA::ULong i = 0; i != n; ++i)
+ {
+ this->event_[l + i] = event[i];
+ }
+ if (this->all_received () && this->parent () != 0)
+ this->parent ()->push_nocopy (this->event_, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Conjunction_Filter::push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ this->push (event, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Conjunction_Filter::clear (void)
+{
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin ();
+ i != end;
+ ++i)
+ {
+ (*i)->clear ();
+ }
+ Word* j = this->bitvec_;
+ for (;
+ j != this->bitvec_ + this->nwords_ - 1;
+ ++j)
+ {
+ *j = 0;
+ }
+ int b = static_cast<int> (this->n_ % bits_per_word);
+ Word last = ~0 << b;
+ *j = last;
+
+ this->event_.length (0);
+}
+
+CORBA::ULong
+TAO_EC_Conjunction_Filter::max_event_size (void) const
+{
+ CORBA::ULong n = 0;
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin ();
+ i != end;
+ ++i)
+ {
+ n += (*i)->max_event_size ();
+ }
+ return n;
+}
+
+int
+TAO_EC_Conjunction_Filter::can_match (
+ const RtecEventComm::EventHeader& header) const
+{
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin ();
+ i != end;
+ ++i)
+ {
+ if ((*i)->can_match (header) != 0)
+ return 1;
+ }
+ return 0;
+}
+
+int
+TAO_EC_Conjunction_Filter::add_dependencies (
+ const RtecEventComm::EventHeader&,
+ const TAO_EC_QOS_Info&
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Conjunction_Filter.h b/TAO/orbsvcs/orbsvcs/Event/EC_Conjunction_Filter.h
new file mode 100644
index 00000000000..e50d6b37867
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Conjunction_Filter.h
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Conjunction_Filter.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_CONJUNCTION_FILTER_H
+#define TAO_EC_CONJUNCTION_FILTER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Filter.h"
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Conjunction_Filter
+ *
+ * @brief The conjunction filter.
+ *
+ * This filter waits until each one of its children has accepted
+ * at least one event. Only in that case it accepts and publishes
+ * the sequence formed by all the children events.
+ *
+ * <H2>Memory Management</H2>
+ * It assumes ownership of the children.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Conjunction_Filter : public TAO_EC_Filter
+{
+public:
+ /// Constructor. It assumes ownership of both the array and the
+ /// children.
+ TAO_EC_Conjunction_Filter (TAO_EC_Filter* children[],
+ size_t n);
+
+ /// Destructor
+ virtual ~TAO_EC_Conjunction_Filter (void);
+
+ // = The TAO_EC_Filter methods, please check the documentation in
+ // TAO_EC_Filter.
+ virtual ChildrenIterator begin (void) const;
+ virtual ChildrenIterator end (void) const;
+ virtual int size (void) const;
+ virtual int filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual int filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void clear (void);
+ virtual CORBA::ULong max_event_size (void) const;
+ virtual int can_match (const RtecEventComm::EventHeader& header) const;
+ virtual int add_dependencies (const RtecEventComm::EventHeader& header,
+ const TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL);
+
+ typedef unsigned int Word;
+
+private:
+ /// Determine if all the children have received their events.
+ int all_received (void) const;
+
+ TAO_EC_Conjunction_Filter (const TAO_EC_Conjunction_Filter&);
+ TAO_EC_Conjunction_Filter& operator= (const TAO_EC_Conjunction_Filter&);
+
+private:
+ /// The children
+ TAO_EC_Filter** children_;
+
+ /// The number of children.
+ size_t n_;
+
+ /// The event we send up (once all the children have pushed theirs).
+ RtecEventComm::EventSet event_;
+
+ /**
+ * The number of words in the bit vector
+ */
+ size_t nwords_;
+
+ /**
+ * The bit vector to keep track of the children that have received
+ * their events.
+ */
+ Word* bitvec_;
+
+ /// The current child in the iteration, used in the push() method...
+ ChildrenIterator current_child_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_CONJUNCTION_FILTER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.cpp
new file mode 100644
index 00000000000..73bf25fff47
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.cpp
@@ -0,0 +1,41 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_ConsumerAdmin.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_ProxyConsumer.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/ESF/ESF_Peer_Workers.h"
+#include "orbsvcs/ESF/ESF_Peer_Admin.h"
+#include "orbsvcs/ESF/ESF_Shutdown_Proxy.h"
+
+ACE_RCSID (Event,
+ EC_ConsumerAdmin,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_ConsumerAdmin::TAO_EC_ConsumerAdmin (TAO_EC_Event_Channel_Base *ec)
+ : TAO_ESF_Peer_Admin<TAO_EC_Event_Channel_Base,TAO_EC_ProxyPushSupplier,RtecEventChannelAdmin::ProxyPushSupplier,TAO_EC_ProxyPushConsumer> (ec)
+{
+ this->default_POA_ =
+ this->event_channel_->consumer_poa ();
+}
+
+TAO_EC_ConsumerAdmin::~TAO_EC_ConsumerAdmin (void)
+{
+}
+
+RtecEventChannelAdmin::ProxyPushSupplier_ptr
+TAO_EC_ConsumerAdmin::obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->obtain (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+PortableServer::POA_ptr
+TAO_EC_ConsumerAdmin::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.h b/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.h
new file mode 100644
index 00000000000..60e45de355a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.h
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_ConsumerAdmin.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_CONSUMERADMIN_H
+#define TAO_EC_CONSUMERADMIN_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Peer_Admin.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Event_Channel_Base;
+class TAO_EC_ProxyPushConsumer;
+
+/**
+ * @class TAO_EC_ConsumerAdmin
+ *
+ * @brief Implements the ConsumerAdmin interface, i.e. the factory for
+ * TAO_EC_ProxyPushSupplier objects.
+ *
+ * <H2> Memory Management</H2>
+ * It does not assume ownership of the TAO_EC_Event_Channel_Base object;
+ * but it *does* assume ownership of the TAO_EC_ProxyPushSupplier_Set
+ * object.
+ *
+ * <H2>Locking</H2>
+ * No provisions for locking, access must be serialized externally.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_ConsumerAdmin
+ : public POA_RtecEventChannelAdmin::ConsumerAdmin
+ , public TAO_ESF_Peer_Admin<TAO_EC_Event_Channel_Base,TAO_EC_ProxyPushSupplier,RtecEventChannelAdmin::ProxyPushSupplier,TAO_EC_ProxyPushConsumer>
+{
+public:
+ /**
+ * Constructor. Builds one using the @a event_channel argument.
+ * In any case it assumes ownership.
+ */
+ TAO_EC_ConsumerAdmin (TAO_EC_Event_Channel_Base* event_channel);
+
+ /// Destructor...
+ virtual ~TAO_EC_ConsumerAdmin (void);
+
+ // = The RtecEventChannelAdmin::ConsumerAdmin methods...
+ virtual RtecEventChannelAdmin::ProxyPushSupplier_ptr
+ obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // = The PortableServer::ServantBase methods
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// Store the default POA.
+ PortableServer::POA_var default_POA_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_CONSUMERADMIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerControl.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerControl.cpp
new file mode 100644
index 00000000000..007d90bd404
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerControl.cpp
@@ -0,0 +1,42 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_ConsumerControl.h"
+
+ACE_RCSID(Event, EC_ConsumerControl, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_ConsumerControl::TAO_EC_ConsumerControl (void)
+{
+}
+
+TAO_EC_ConsumerControl::~TAO_EC_ConsumerControl (void)
+{
+}
+
+int
+TAO_EC_ConsumerControl::activate (void)
+{
+ return 0;
+}
+
+int
+TAO_EC_ConsumerControl::shutdown (void)
+{
+ return 0;
+}
+
+void
+TAO_EC_ConsumerControl::consumer_not_exist (TAO_EC_ProxyPushSupplier *
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_ConsumerControl::system_exception (TAO_EC_ProxyPushSupplier *,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerControl.h b/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerControl.h
new file mode 100644
index 00000000000..281fe09f0d3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerControl.h
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_ConsumerControl.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_CONSUMERCONTROL_H
+#define TAO_EC_CONSUMERCONTROL_H
+
+#include /**/ "ace/pre.h"
+#include "ace/CORBA_macros.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/orbconf.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Event_Channel_Base;
+class TAO_EC_ProxyPushSupplier;
+
+namespace CORBA
+{
+ class Environment;
+ class SystemException;
+}
+
+/**
+ * @class TAO_EC_ConsumerControl
+ *
+ * @brief ConsumerControl
+ *
+ * Defines the interface for the consumer control strategy.
+ * This strategy handles misbehaving or failing consumers.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_ConsumerControl
+{
+public:
+ /// Constructor.
+ TAO_EC_ConsumerControl (void);
+
+ /// Destructor.
+ virtual ~TAO_EC_ConsumerControl (void);
+
+ /// Activate any internal threads or timers used to poll the state of
+ /// the consumers
+ virtual int activate (void);
+ virtual int shutdown (void);
+
+ /**
+ * When pushing an event to the consumer a CORBA::OBJECT_NOT_EXIST
+ * exception was raised. The only interpretation is that the object
+ * has been destroyed. The strategy has to (at the very least),
+ * reclaim all the resources attached to that object.
+ */
+ virtual void consumer_not_exist (TAO_EC_ProxyPushSupplier *proxy
+ ACE_ENV_ARG_DECL);
+
+ /// Some system exception was raised while trying to contact the
+ /// consumer
+ virtual void system_exception (TAO_EC_ProxyPushSupplier *proxy,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_CONSUMERCONTROL_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.cpp
new file mode 100644
index 00000000000..c10cfbbb4cd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.cpp
@@ -0,0 +1,1003 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "orbsvcs/Event/EC_Reactive_Dispatching.h"
+#include "orbsvcs/Event/EC_MT_Dispatching.h"
+#include "orbsvcs/Event/EC_Basic_Filter_Builder.h"
+#include "orbsvcs/Event/EC_Prefix_Filter_Builder.h"
+#include "orbsvcs/Event/EC_ConsumerAdmin.h"
+#include "orbsvcs/Event/EC_SupplierAdmin.h"
+#include "orbsvcs/Event/EC_Default_ProxyConsumer.h"
+#include "orbsvcs/Event/EC_Default_ProxySupplier.h"
+#include "orbsvcs/Event/EC_Trivial_Supplier_Filter.h"
+#include "orbsvcs/Event/EC_Per_Supplier_Filter.h"
+#include "orbsvcs/Event/EC_ObserverStrategy.h"
+#include "orbsvcs/Event/EC_Null_Scheduling.h"
+#include "orbsvcs/Event/EC_Group_Scheduling.h"
+#include "orbsvcs/Event/EC_Reactive_Timeout_Generator.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_Reactive_ConsumerControl.h"
+#include "orbsvcs/Event/EC_Reactive_SupplierControl.h"
+
+#include "orbsvcs/ESF/ESF_Proxy_List.h"
+#include "orbsvcs/ESF/ESF_Proxy_RB_Tree.h"
+#include "orbsvcs/ESF/ESF_Immediate_Changes.h"
+#include "orbsvcs/ESF/ESF_Copy_On_Read.h"
+#include "orbsvcs/ESF/ESF_Copy_On_Write.h"
+#include "orbsvcs/ESF/ESF_Delayed_Changes.h"
+#include "orbsvcs/ESF/ESF_Delayed_Command.h"
+
+#include "tao/ORB_Core.h"
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/Dynamic_Service.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Default_Factory.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_Default_Factory, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Default_Factory::~TAO_EC_Default_Factory (void)
+{
+}
+
+int
+TAO_EC_Default_Factory::init_svcs (void)
+{
+ TAO_EC_Simple_Queue_Full_Action::init_svcs();
+ return ACE_Service_Config::static_svcs ()->
+ insert (&ace_svc_desc_TAO_EC_Default_Factory);
+}
+
+void
+TAO_EC_Default_Factory::unsupported_option_value (const char * option_name,
+ const char * option_value)
+{
+ ACE_ERROR ((LM_ERROR,
+ "EC_Default_Factory - "
+ "Unsupported <%s> option value: <%s>. "
+ "Ignoring this option - using defaults instead.\n",
+ option_name,
+ option_value));
+}
+
+int
+TAO_EC_Default_Factory::init (int argc, ACE_TCHAR* argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ int priority =
+ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO) +
+ ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2;
+ this->dispatching_threads_priority_ =
+ ACE_Sched_Params::next_priority (ACE_SCHED_FIFO, priority);
+
+ while (arg_shifter.is_anything_left ())
+ {
+ const ACE_TCHAR *arg = arg_shifter.get_current ();
+
+ if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECDispatching")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
+ this->dispatching_ = 0;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("mt")) == 0)
+ this->dispatching_ = 1;
+ else
+ this->unsupported_option_value ("-ECDispatching", opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECDispatchingThreads")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ this->dispatching_threads_ = ACE_OS::atoi (opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECFiltering")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ this->filtering_ = 0;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("basic")) == 0)
+ this->filtering_ = 1;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("prefix")) == 0)
+ this->filtering_ = 2;
+ else
+ this->unsupported_option_value ("-ECFiltering", opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECSupplierFilter")) == 0
+ // @@ TODO remove, only for backwards compatibility
+ || ACE_OS::strcasecmp (arg, ACE_TEXT("-ECSupplierFiltering")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ this->supplier_filtering_ = 0;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("per-supplier")) == 0)
+ this->supplier_filtering_ = 1;
+ else
+ this->unsupported_option_value ("-ECSupplierFilter", opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECTimeout")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
+ this->timeout_ = 0;
+ else
+ this->unsupported_option_value ("-ECTimeout", opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECObserver")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ this->observer_ = 0;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("basic")) == 0)
+ this->observer_ = 1;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
+ this->observer_ = 2;
+ else
+ this->unsupported_option_value ("-ECObserver", opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECScheduling")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ this->scheduling_ = 0;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("group")) == 0)
+ this->scheduling_ = 1;
+ else
+ this->unsupported_option_value ("-ECScheduling", opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECProxyPushConsumerCollection")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR *current_arg = arg_shifter.get_current ();
+ ACE_TCHAR *opt = ACE_OS::strdup (current_arg);
+ int collection_type = 0;
+ int synch_type = 0;
+ int iteration_type = 0;
+
+ ACE_TCHAR* aux;
+ for (ACE_TCHAR* arg = ACE_OS::strtok_r (opt, ACE_TEXT(":"), &aux);
+ arg != 0;
+ arg = ACE_OS::strtok_r (0, ACE_TEXT(":"), &aux))
+ {
+ if (ACE_OS::strcasecmp (arg, ACE_TEXT("mt")) == 0)
+ synch_type = 0;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("st")) == 0)
+ synch_type = 1;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("list")) == 0)
+ collection_type = 0;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("rb_tree")) == 0)
+ collection_type = 1;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("immediate")) == 0)
+ iteration_type = 0;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("copy_on_read")) == 0)
+ iteration_type = 1;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("copy_on_write")) == 0)
+ iteration_type = 2;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("delayed")) == 0)
+ iteration_type = 3;
+ else
+ ACE_ERROR ((LM_ERROR,
+ "EC_Default_Factory - "
+ "Unknown consumer collection modifier <%s>.\n", arg));
+ }
+ ACE_OS::free (opt);
+ this->consumer_collection_ =
+ (synch_type << 8) |(collection_type << 4) | iteration_type;
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECProxyPushSupplierCollection")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* current_arg = arg_shifter.get_current();
+ ACE_TCHAR* opt = ACE_OS::strdup(current_arg);
+ int collection_type = 0;
+ int synch_type = 0;
+ int iteration_type = 0;
+
+ ACE_TCHAR* aux;
+ for (ACE_TCHAR* arg = ACE_OS::strtok_r (opt, ACE_TEXT(":"), &aux);
+ arg != 0;
+ arg = ACE_OS::strtok_r (0, ACE_TEXT(":"), &aux))
+ {
+ if (ACE_OS::strcasecmp (arg, ACE_TEXT("mt")) == 0)
+ synch_type = 0;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("st")) == 0)
+ synch_type = 1;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("list")) == 0)
+ collection_type = 0;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("rb_tree")) == 0)
+ collection_type = 1;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("immediate")) == 0)
+ iteration_type = 0;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("copy_on_read")) == 0)
+ iteration_type = 1;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("copy_on_write")) == 0)
+ iteration_type = 2;
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("delayed")) == 0)
+ iteration_type = 3;
+ else
+ ACE_ERROR ((LM_ERROR,
+ "EC_Default_Factory - "
+ "Unknown supplier collection modifier <%s>.\n", arg));
+ }
+ ACE_OS::free(opt);
+ this->supplier_collection_ =
+ (synch_type << 8) | (collection_type << 4) | iteration_type;
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECProxyConsumerLock")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ this->consumer_lock_ = 0;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("thread")) == 0)
+ this->consumer_lock_ = 1;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("recursive")) == 0)
+ this->consumer_lock_ = 2;
+ else
+ this->unsupported_option_value ("-ECProxyConsumerLock", opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECProxySupplierLock")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ this->supplier_lock_ = 0;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("thread")) == 0)
+ this->supplier_lock_ = 1;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("recursive")) == 0)
+ this->supplier_lock_ = 2;
+ else
+ this->unsupported_option_value ("-ECProxySupplierLock", opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECUseORBId")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ // Save argument for later use
+ this->orbid_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECConsumerControl")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ this->consumer_control_ = 0;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
+ this->consumer_control_ = 1;
+ else
+ this->unsupported_option_value ("-ECConsumerControl", opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECSupplierControl")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ this->supplier_control_ = 0;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
+ this->supplier_control_ = 1;
+ else
+ this->unsupported_option_value ("-ECSupplierControl", opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECConsumerControlPeriod")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ this->consumer_control_period_ = ACE_OS::atoi (opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECSupplierControlPeriod")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ this->supplier_control_period_ = ACE_OS::atoi (opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECConsumerControlTimeout")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ unsigned long timeout = ACE_OS::strtoul(opt, 0, 10);
+ this->consumer_control_timeout_.usec(timeout);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECSupplierControlTimeout")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ unsigned long timeout = ACE_OS::strtoul(opt, 0, 10);
+ this->supplier_control_timeout_.usec(timeout);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECConsumerValidateConnection")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ this->consumer_validate_connection_ = ACE_OS::atoi (opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECPushSupplierSet")) == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "EC_Default_Factory - "
+ "obsolete option <%s>, ignored\n", arg));
+ arg_shifter.consume_arg ();
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECQueueFullServiceObject")) == 0)
+ {
+ arg_shifter.consume_arg ();
+ if (arg_shifter.is_parameter_next ())
+ {
+ const char* opt = arg_shifter.get_current ();
+ this->queue_full_service_object_name_.set(opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECConsumerAdminLock")) == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "EC_Default_Factory - "
+ "obsolete option <%s>, ignored\n", arg));
+ arg_shifter.consume_arg ();
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECSupplierAdminLock")) == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "EC_Default_Factory - "
+ "obsolete option <%s>, ignored\n", arg));
+ arg_shifter.consume_arg ();
+ }
+
+ else if (ACE_OS::strncmp (arg, ACE_TEXT("-EC"), 3) == 0)
+ {
+ arg_shifter.consume_arg ();
+ ACE_ERROR ((LM_ERROR,
+ "EC_Default_Factory - "
+ "unknown option <%s>\n",
+ arg));
+ }
+ else
+ {
+ arg_shifter.consume_arg ();
+ ACE_DEBUG ((LM_DEBUG,
+ "EC_Default_Factory - "
+ "ignoring option <%s>\n",
+ arg));
+ }
+ }
+ return 0;
+}
+
+int
+TAO_EC_Default_Factory::fini (void)
+{
+ return 0;
+}
+
+// ****************************************************************
+
+TAO_EC_Queue_Full_Service_Object*
+TAO_EC_Default_Factory::find_service_object (const char* wanted,
+ const char* fallback)
+{
+ TAO_EC_Queue_Full_Service_Object* so = 0;
+ so = ACE_Dynamic_Service<TAO_EC_Queue_Full_Service_Object>::instance (wanted);
+ if (so != 0)
+ return so;
+
+ ACE_ERROR ((LM_ERROR,
+ "EC (%P|%t) EC_Default_Factory::create_dispatching "
+ "unable to find queue full service object '%s'; "
+ "using '%s' instead\n",
+ wanted,
+ fallback));
+
+ so = ACE_Dynamic_Service<TAO_EC_Queue_Full_Service_Object>::instance (fallback);
+ if (so != 0)
+ return so;
+
+ ACE_ERROR ((LM_ERROR,
+ "EC (%P|%t) EC_Default_Factory::create_dispatching "
+ "unable find default queue full service object '%s'; "
+ "aborting.\n",
+ fallback));
+ ACE_OS::abort ();
+ return 0; // superfluous return to de-warn; we should never reach here
+}
+
+TAO_EC_Dispatching*
+TAO_EC_Default_Factory::create_dispatching (TAO_EC_Event_Channel_Base *)
+{
+ if (this->dispatching_ == 0)
+ return new TAO_EC_Reactive_Dispatching ();
+ else if (this->dispatching_ == 1)
+ {
+ TAO_EC_Queue_Full_Service_Object* so =
+ this->find_service_object (this->queue_full_service_object_name_.fast_rep(),
+ TAO_EC_DEFAULT_QUEUE_FULL_SERVICE_OBJECT_NAME);
+ return new TAO_EC_MT_Dispatching (this->dispatching_threads_,
+ this->dispatching_threads_flags_,
+ this->dispatching_threads_priority_,
+ this->dispatching_threads_force_active_,
+ so);
+ }
+ return 0;
+}
+
+void
+TAO_EC_Default_Factory::destroy_dispatching (TAO_EC_Dispatching *x)
+{
+ delete x;
+}
+
+TAO_EC_Filter_Builder*
+TAO_EC_Default_Factory::create_filter_builder (TAO_EC_Event_Channel_Base *ec)
+{
+ if (this->filtering_ == 0)
+ return new TAO_EC_Null_Filter_Builder ();
+ else if (this->filtering_ == 1)
+ return new TAO_EC_Basic_Filter_Builder (ec);
+ else if (this->filtering_ == 2)
+ return new TAO_EC_Prefix_Filter_Builder (ec);
+ return 0;
+}
+
+void
+TAO_EC_Default_Factory::destroy_filter_builder (TAO_EC_Filter_Builder *x)
+{
+ delete x;
+}
+
+TAO_EC_Supplier_Filter_Builder*
+TAO_EC_Default_Factory::create_supplier_filter_builder (TAO_EC_Event_Channel_Base *ec)
+{
+ if (this->supplier_filtering_ == 0)
+ return new TAO_EC_Trivial_Supplier_Filter_Builder (ec);
+ else if (this->supplier_filtering_ == 1)
+ return new TAO_EC_Per_Supplier_Filter_Builder (ec);
+ return 0;
+}
+
+void
+TAO_EC_Default_Factory::destroy_supplier_filter_builder (TAO_EC_Supplier_Filter_Builder *x)
+{
+ delete x;
+}
+
+TAO_EC_ConsumerAdmin*
+TAO_EC_Default_Factory::create_consumer_admin (TAO_EC_Event_Channel_Base *ec)
+{
+ return new TAO_EC_ConsumerAdmin (ec);
+}
+
+void
+TAO_EC_Default_Factory::destroy_consumer_admin (TAO_EC_ConsumerAdmin *x)
+{
+ delete x;
+}
+
+TAO_EC_SupplierAdmin*
+TAO_EC_Default_Factory::create_supplier_admin (TAO_EC_Event_Channel_Base *ec)
+{
+ return new TAO_EC_SupplierAdmin (ec);
+}
+
+void
+TAO_EC_Default_Factory::destroy_supplier_admin (TAO_EC_SupplierAdmin *x)
+{
+ delete x;
+}
+
+TAO_EC_ProxyPushSupplier*
+TAO_EC_Default_Factory::create_proxy_push_supplier (TAO_EC_Event_Channel_Base *ec)
+{
+ return new TAO_EC_Default_ProxyPushSupplier (ec, consumer_validate_connection_);
+}
+
+void
+TAO_EC_Default_Factory::destroy_proxy_push_supplier (TAO_EC_ProxyPushSupplier *x)
+{
+ delete x;
+}
+
+TAO_EC_ProxyPushConsumer*
+TAO_EC_Default_Factory::create_proxy_push_consumer (TAO_EC_Event_Channel_Base *ec)
+{
+ return new TAO_EC_Default_ProxyPushConsumer (ec);
+}
+
+void
+TAO_EC_Default_Factory::destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer *x)
+{
+ delete x;
+}
+
+TAO_EC_Timeout_Generator*
+TAO_EC_Default_Factory::create_timeout_generator (TAO_EC_Event_Channel_Base *)
+{
+ if (this->timeout_ == 0)
+ {
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, this->orbid_.c_str ());
+
+ ACE_Reactor *reactor = orb->orb_core ()->reactor ();
+ return new TAO_EC_Reactive_Timeout_Generator (reactor);
+ }
+#if 0
+ else if (this->timeout_ == 1)
+ {
+ }
+#endif
+ return 0;
+}
+
+void
+TAO_EC_Default_Factory::destroy_timeout_generator (TAO_EC_Timeout_Generator *x)
+{
+ delete x;
+}
+
+TAO_EC_ObserverStrategy*
+TAO_EC_Default_Factory::create_observer_strategy (TAO_EC_Event_Channel_Base *ec)
+{
+ if (this->observer_ == 0)
+ return new TAO_EC_Null_ObserverStrategy;
+ else if (this->observer_ == 1)
+ {
+ // @@ The lock should also be under control of the user...
+ ACE_Lock* lock = 0;
+ ACE_NEW_RETURN (lock, ACE_Lock_Adapter<TAO_SYNCH_MUTEX>, 0);
+ return new TAO_EC_Basic_ObserverStrategy (ec, lock);
+ }
+ else if (this->observer_ == 2)
+ {
+ // @@ The lock should also be under control of the user...
+ ACE_Lock* lock = 0;
+ ACE_NEW_RETURN (lock, ACE_Lock_Adapter<TAO_SYNCH_MUTEX>, 0);
+ return new TAO_EC_Reactive_ObserverStrategy (ec, lock);
+ }
+ return 0;
+}
+
+void
+TAO_EC_Default_Factory::destroy_observer_strategy (TAO_EC_ObserverStrategy *x)
+{
+ delete x;
+}
+
+TAO_EC_Scheduling_Strategy*
+TAO_EC_Default_Factory::create_scheduling_strategy (TAO_EC_Event_Channel_Base*)
+{
+ if (this->scheduling_ == 0)
+ return new TAO_EC_Null_Scheduling;
+ else if (this->scheduling_ == 1)
+ return new TAO_EC_Group_Scheduling;
+ return 0;
+}
+
+void
+TAO_EC_Default_Factory::destroy_scheduling_strategy (TAO_EC_Scheduling_Strategy* x)
+{
+ delete x;
+}
+
+// These typedefs workaround a SunCC 4.2 bug
+typedef
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>::Iterator
+ TAO_EC_Consumer_List_Iterator;
+typedef
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>::Iterator
+ TAO_EC_Consumer_RB_Tree_Iterator;
+typedef
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>::Iterator
+ TAO_EC_Supplier_List_Iterator;
+typedef
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>::Iterator
+ TAO_EC_Supplier_RB_Tree_Iterator;
+
+
+TAO_EC_ProxyPushConsumer_Collection*
+TAO_EC_Default_Factory::create_proxy_push_consumer_collection (TAO_EC_Event_Channel_Base *)
+{
+ if (this->consumer_collection_ == 0x000)
+ return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x001)
+ return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x002)
+ return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x003)
+ return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x010)
+ return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x011)
+ return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_collection_ == 0x012)
+ return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x013)
+ return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->consumer_collection_ == 0x100)
+ return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x101)
+ return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x102)
+ return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->consumer_collection_ == 0x103)
+ return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->consumer_collection_ == 0x110)
+ return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x111)
+ return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->consumer_collection_ == 0x112)
+ return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->consumer_collection_ == 0x113)
+ return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+
+ return 0;
+}
+
+void
+TAO_EC_Default_Factory::destroy_proxy_push_consumer_collection (TAO_EC_ProxyPushConsumer_Collection *x)
+{
+ delete x;
+}
+
+TAO_EC_ProxyPushSupplier_Collection*
+TAO_EC_Default_Factory::create_proxy_push_supplier_collection (TAO_EC_Event_Channel_Base *)
+{
+ if (this->supplier_collection_ == 0x000)
+ return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x001)
+ return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_List_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x002)
+ return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x003)
+ return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_List_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x010)
+ return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x011)
+ return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_RB_Tree_Iterator,
+ TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_collection_ == 0x012)
+ return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x013)
+ return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_RB_Tree_Iterator,
+ ACE_SYNCH> ();
+ else if (this->supplier_collection_ == 0x100)
+ return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x101)
+ return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_List_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x102)
+ return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->supplier_collection_ == 0x103)
+ return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_List_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->supplier_collection_ == 0x110)
+ return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x111)
+ return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_RB_Tree_Iterator,
+ ACE_Null_Mutex> ();
+ else if (this->supplier_collection_ == 0x112)
+ return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+ else if (this->supplier_collection_ == 0x113)
+ return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_RB_Tree_Iterator,
+ ACE_NULL_SYNCH> ();
+
+ return 0;
+}
+
+void
+TAO_EC_Default_Factory::destroy_proxy_push_supplier_collection (TAO_EC_ProxyPushSupplier_Collection *x)
+{
+ delete x;
+}
+
+ACE_Lock*
+TAO_EC_Default_Factory::create_consumer_lock (void)
+{
+ if (this->consumer_lock_ == 0)
+ return new ACE_Lock_Adapter<ACE_Null_Mutex>;
+ else if (this->consumer_lock_ == 1)
+ return new ACE_Lock_Adapter<TAO_SYNCH_MUTEX> ();
+ else if (this->consumer_lock_ == 2)
+ return new ACE_Lock_Adapter<TAO_SYNCH_RECURSIVE_MUTEX> ();
+ return 0;
+}
+
+void
+TAO_EC_Default_Factory::destroy_consumer_lock (ACE_Lock* x)
+{
+ delete x;
+}
+
+ACE_Lock*
+TAO_EC_Default_Factory::create_supplier_lock (void)
+{
+ if (this->supplier_lock_ == 0)
+ return new ACE_Lock_Adapter<ACE_Null_Mutex>;
+ else if (this->supplier_lock_ == 1)
+ return new ACE_Lock_Adapter<TAO_SYNCH_MUTEX> ();
+ else if (this->supplier_lock_ == 2)
+ return new ACE_Lock_Adapter<TAO_SYNCH_RECURSIVE_MUTEX> ();
+ return 0;
+}
+
+void
+TAO_EC_Default_Factory::destroy_supplier_lock (ACE_Lock* x)
+{
+ delete x;
+}
+
+TAO_EC_ConsumerControl*
+TAO_EC_Default_Factory::create_consumer_control (TAO_EC_Event_Channel_Base* ec)
+{
+ if (this->consumer_control_ == 0)
+ return new TAO_EC_ConsumerControl ();
+ else if (this->consumer_control_ == 1)
+ {
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, this->orbid_.c_str ());
+
+ ACE_Time_Value rate (0, this->consumer_control_period_);
+ return new TAO_EC_Reactive_ConsumerControl (rate, consumer_control_timeout_, ec, orb.in ());
+ }
+ return 0;
+}
+
+void
+TAO_EC_Default_Factory::destroy_consumer_control (TAO_EC_ConsumerControl* x)
+{
+ delete x;
+}
+
+TAO_EC_SupplierControl*
+TAO_EC_Default_Factory::create_supplier_control (TAO_EC_Event_Channel_Base* ec)
+{
+ if (this->supplier_control_ == 0)
+ return new TAO_EC_SupplierControl ();
+ else if (this->supplier_control_ == 1)
+ {
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, this->orbid_.c_str ());
+
+ ACE_Time_Value rate (0, this->supplier_control_period_);
+ return new TAO_EC_Reactive_SupplierControl (rate, supplier_control_timeout_, ec, orb.in ());
+ }
+ return 0;
+}
+
+void
+TAO_EC_Default_Factory::destroy_supplier_control (TAO_EC_SupplierControl* x)
+{
+ delete x;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+ACE_STATIC_SVC_DEFINE (TAO_EC_Default_Factory,
+ ACE_TEXT ("EC_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_EC_Default_Factory),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
+ACE_FACTORY_DEFINE (TAO_RTEvent_Serv, TAO_EC_Default_Factory)
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.h b/TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.h
new file mode 100644
index 00000000000..a5bce5d5df3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.h
@@ -0,0 +1,201 @@
+/* -*- C++ -*- */
+/**
+ * @file EC_Default_Factory.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_DEFAULT_FACTORY_H
+#define TAO_EC_DEFAULT_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Factory.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/EC_Defaults.h"
+
+#include "ace/Service_Config.h"
+#include "ace/SString.h"
+#include "ace/Time_Value.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Queue_Full_Service_Object;
+
+/**
+ * @class TAO_EC_Default_Factory
+ *
+ * @brief A generic factory for EC experimentation.
+ *
+ * This class allows the user to experiment with different EC
+ * configurations. Using a command-line like interface the user
+ * can specify which strategies will this factory generate.
+ * Since the class can be dynamically loaded the strategies can be
+ * set in the service configurator file.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Default_Factory : public TAO_EC_Factory
+{
+public:
+ /// Constructor
+ TAO_EC_Default_Factory (void);
+
+ /// destructor...
+ virtual ~TAO_EC_Default_Factory (void);
+
+ /// Helper function to register the default factory into the service
+ /// configurator.
+ static int init_svcs (void);
+
+ // = The Service_Object entry points
+ virtual int init (int argc, ACE_TCHAR* argv[]);
+ virtual int fini (void);
+
+ // = The EC_Factory methods
+ virtual TAO_EC_Dispatching*
+ create_dispatching (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_dispatching (TAO_EC_Dispatching*);
+ virtual TAO_EC_Filter_Builder*
+ create_filter_builder (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_filter_builder (TAO_EC_Filter_Builder*);
+ virtual TAO_EC_Supplier_Filter_Builder*
+ create_supplier_filter_builder (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_supplier_filter_builder (TAO_EC_Supplier_Filter_Builder*);
+ virtual TAO_EC_ConsumerAdmin*
+ create_consumer_admin (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_consumer_admin (TAO_EC_ConsumerAdmin*);
+ virtual TAO_EC_SupplierAdmin*
+ create_supplier_admin (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_supplier_admin (TAO_EC_SupplierAdmin*);
+ virtual TAO_EC_ProxyPushSupplier*
+ create_proxy_push_supplier (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_supplier (TAO_EC_ProxyPushSupplier*);
+ virtual TAO_EC_ProxyPushConsumer*
+ create_proxy_push_consumer (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer*);
+ virtual TAO_EC_Timeout_Generator*
+ create_timeout_generator (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_timeout_generator (TAO_EC_Timeout_Generator*);
+ virtual TAO_EC_ObserverStrategy*
+ create_observer_strategy (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_observer_strategy (TAO_EC_ObserverStrategy*);
+ virtual TAO_EC_Scheduling_Strategy*
+ create_scheduling_strategy (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_scheduling_strategy (TAO_EC_Scheduling_Strategy*);
+ virtual TAO_EC_ProxyPushConsumer_Collection*
+ create_proxy_push_consumer_collection (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_consumer_collection (TAO_EC_ProxyPushConsumer_Collection*);
+ virtual TAO_EC_ProxyPushSupplier_Collection*
+ create_proxy_push_supplier_collection (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_supplier_collection (TAO_EC_ProxyPushSupplier_Collection*);
+
+ virtual ACE_Lock* create_consumer_lock (void);
+ virtual void destroy_consumer_lock (ACE_Lock*);
+ virtual ACE_Lock* create_supplier_lock (void);
+ virtual void destroy_supplier_lock (ACE_Lock*);
+
+ virtual TAO_EC_ConsumerControl*
+ create_consumer_control (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_consumer_control (TAO_EC_ConsumerControl*);
+ virtual TAO_EC_SupplierControl*
+ create_supplier_control (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_supplier_control (TAO_EC_SupplierControl*);
+
+ /// Accessors to consumer collection flags
+ int consumer_collection (void) const;
+
+ /// Accessors to supplier collection flags
+ int supplier_collection (void) const;
+
+ /// Accessors to supplier filtering flags
+ int supplier_filtering (void) const;
+
+ /// Accessor to ORBid
+ const ACE_CString& orb_id (void) const;
+protected:
+
+ /// Helper for agrument parsing. Prints out an error message about
+ /// unsupported option value.
+ void unsupported_option_value (const char * option_name,
+ const char * option_value);
+
+protected:
+ /// Several flags to control the kind of object created.
+ int dispatching_;
+ int filtering_;
+ int supplier_filtering_;
+ int timeout_;
+ int observer_;
+ int scheduling_;
+ int consumer_collection_;
+ int supplier_collection_;
+ int consumer_lock_;
+ int supplier_lock_;
+
+ /// The MT dispatching priority has several arguments that could be
+ /// controlled here...
+ int dispatching_threads_;
+ int dispatching_threads_flags_;
+ int dispatching_threads_priority_;
+ int dispatching_threads_force_active_;
+ ACE_CString queue_full_service_object_name_;
+ TAO_EC_Queue_Full_Service_Object* find_service_object (const char* wanted,
+ const char* fallback);
+
+ /// Use this ORB to locate global resources.
+ ACE_CString orbid_;
+
+ /// The consumer and supplier control policies.
+ int consumer_control_;
+ int supplier_control_;
+
+ /// The consumer and supplier control periods in usecs
+ int consumer_control_period_;
+ int supplier_control_period_;
+
+ /// The consumer control timeout in usecs
+ ACE_Time_Value consumer_control_timeout_;
+
+ /// The supplier control timeout in usecs
+ ACE_Time_Value supplier_control_timeout_;
+
+ /// Validate the connection to consumer on connect
+ int consumer_validate_connection_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Default_Factory.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_STATIC_SVC_DECLARE (TAO_EC_Default_Factory)
+ACE_FACTORY_DECLARE (TAO_RTEvent_Serv, TAO_EC_Default_Factory)
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_DEFAULT_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.i b/TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.i
new file mode 100644
index 00000000000..2564cd3b0c5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Default_Factory.i
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Default_Factory::TAO_EC_Default_Factory (void)
+ : dispatching_ (TAO_EC_DEFAULT_DISPATCHING),
+ filtering_ (TAO_EC_DEFAULT_CONSUMER_FILTER),
+ supplier_filtering_ (TAO_EC_DEFAULT_SUPPLIER_FILTER),
+ timeout_ (TAO_EC_DEFAULT_TIMEOUT),
+ observer_ (TAO_EC_DEFAULT_OBSERVER),
+ scheduling_ (TAO_EC_DEFAULT_SCHEDULING),
+ consumer_collection_ (TAO_EC_DEFAULT_CONSUMER_COLLECTION),
+ supplier_collection_ (TAO_EC_DEFAULT_SUPPLIER_COLLECTION),
+ consumer_lock_ (TAO_EC_DEFAULT_CONSUMER_LOCK),
+ supplier_lock_ (TAO_EC_DEFAULT_SUPPLIER_LOCK),
+ dispatching_threads_ (TAO_EC_DEFAULT_DISPATCHING_THREADS),
+ dispatching_threads_flags_ (TAO_EC_DEFAULT_DISPATCHING_THREADS_FLAGS),
+ dispatching_threads_priority_ (TAO_EC_DEFAULT_DISPATCHING_THREADS_PRIORITY),
+ dispatching_threads_force_active_ (TAO_EC_DEFAULT_DISPATCHING_THREADS_FORCE_ACTIVE),
+ queue_full_service_object_name_ (TAO_EC_DEFAULT_QUEUE_FULL_SERVICE_OBJECT_NAME),
+ orbid_ (TAO_EC_DEFAULT_ORB_ID),
+ consumer_control_ (TAO_EC_DEFAULT_CONSUMER_CONTROL),
+ supplier_control_ (TAO_EC_DEFAULT_SUPPLIER_CONTROL),
+ consumer_control_period_ (TAO_EC_DEFAULT_CONSUMER_CONTROL_PERIOD),
+ supplier_control_period_ (TAO_EC_DEFAULT_SUPPLIER_CONTROL_PERIOD),
+ consumer_control_timeout_ (0, TAO_EC_DEFAULT_CONSUMER_CONTROL_TIMEOUT),
+ supplier_control_timeout_ (0, TAO_EC_DEFAULT_SUPPLIER_CONTROL_TIMEOUT),
+ consumer_validate_connection_ (TAO_EC_DEFAULT_CONSUMER_VALIDATE_CONNECTION)
+{
+}
+
+ACE_INLINE int
+TAO_EC_Default_Factory::consumer_collection (void) const
+{
+ return this->consumer_collection_;
+}
+
+ACE_INLINE int
+TAO_EC_Default_Factory::supplier_collection (void) const
+{
+ return this->supplier_collection_;
+}
+
+ACE_INLINE int
+TAO_EC_Default_Factory::supplier_filtering (void) const
+{
+ return this->supplier_filtering_;
+}
+
+ACE_INLINE const ACE_CString&
+TAO_EC_Default_Factory::orb_id (void) const
+{
+ return this->orbid_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxyConsumer.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxyConsumer.cpp
new file mode 100644
index 00000000000..e3bca47a2d0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxyConsumer.cpp
@@ -0,0 +1,192 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Default_ProxyConsumer.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_Supplier_Filter_Builder.h"
+#include "orbsvcs/Event/EC_Supplier_Filter.h"
+#include "ace/Synch_T.h"
+
+ACE_RCSID(Event, EC_Default_ProxyConsumer, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef ACE_Reverse_Lock<ACE_Lock> TAO_EC_Unlock;
+
+TAO_EC_Default_ProxyPushConsumer::
+ TAO_EC_Default_ProxyPushConsumer (TAO_EC_Event_Channel_Base* ec)
+ : TAO_EC_ProxyPushConsumer (ec)
+{
+}
+
+TAO_EC_Default_ProxyPushConsumer::~TAO_EC_Default_ProxyPushConsumer (void)
+{
+}
+
+void
+TAO_EC_Default_ProxyPushConsumer::connect_push_supplier (
+ RtecEventComm::PushSupplier_ptr push_supplier,
+ const RtecEventChannelAdmin::SupplierQOS& qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecEventChannelAdmin::AlreadyConnected))
+{
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i ())
+ {
+ if (this->event_channel_->supplier_reconnect () == 0)
+ ACE_THROW (RtecEventChannelAdmin::AlreadyConnected ());
+
+ // Re-connections are allowed, go ahead and disconnect the
+ // consumer...
+ this->cleanup_i ();
+
+ // @@ Please read the comments in EC_ProxySuppliers about
+ // possible race conditions in this area...
+ TAO_EC_Unlock reverse_lock (*this->lock_);
+
+ {
+ ACE_GUARD_THROW_EX (
+ TAO_EC_Unlock, ace_mon, reverse_lock,
+ CORBA::INTERNAL ());
+ // @@ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ this->event_channel_->reconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // A separate thread could have connected siomultaneously,
+ // this is probably an application error, handle it as
+ // gracefully as possible
+ if (this->is_connected_i ())
+ return; // @@ Should we throw
+ }
+
+ this->supplier_ =
+ RtecEventComm::PushSupplier::_duplicate (push_supplier);
+ this->connected_ = 1;
+ this->qos_ = qos;
+
+#if TAO_EC_ENABLE_DEBUG_MESSAGES
+ ACE_DEBUG ((LM_DEBUG,
+ "Building filter for supplier <%x>.\n",
+ this));
+#endif /* TAO_EC_ENABLED_DEBUG_MESSAGES */
+ this->filter_ =
+ this->event_channel_->supplier_filter_builder ()->create (this->qos_);
+ this->filter_->bind (this);
+ }
+
+ // Notify the event channel...
+ this->event_channel_->connected (this ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Default_ProxyPushConsumer::push (const RtecEventComm::EventSet& event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_EC_ProxyPushConsumer_Guard ace_mon (this->lock_,
+ this->refcount_,
+ this->event_channel_,
+ this);
+ if (!ace_mon.locked ())
+ return;
+
+ ace_mon.filter->push (event, this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Default_ProxyPushConsumer::disconnect_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ RtecEventComm::PushSupplier_var supplier;
+ int connected = 0;
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ connected = this->is_connected_i ();
+ supplier = this->supplier_._retn ();
+ this->connected_ = 0;
+
+ if (connected)
+ this->cleanup_i ();
+ }
+
+ // Notify the event channel...
+ this->event_channel_->disconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (supplier.in ()))
+ {
+ return;
+ }
+
+ if (this->event_channel_->disconnect_callbacks ())
+ {
+ ACE_TRY
+ {
+ supplier->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // failures on this one.
+ }
+ ACE_ENDTRY;
+ }
+}
+
+PortableServer::POA_ptr
+TAO_EC_Default_ProxyPushConsumer::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+void
+TAO_EC_Default_ProxyPushConsumer::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_incr_refcnt ();
+}
+
+void
+TAO_EC_Default_ProxyPushConsumer::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_decr_refcnt ();
+}
+
+void
+TAO_EC_Default_ProxyPushConsumer::activate (
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr &proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ proxy = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+PortableServer::ObjectId
+TAO_EC_Default_ProxyPushConsumer::object_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableServer::ObjectId_var result =
+ this->default_POA_->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ return result.in ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxyConsumer.h b/TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxyConsumer.h
new file mode 100644
index 00000000000..e08d7d4c092
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxyConsumer.h
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Default_ProxyConsumer.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ * @author Marina Spivak (marina@atdesk.com)
+ * @author Jason Smith (jason@atdesk.com)
+ *
+ */
+
+#ifndef TAO_EC_DEFAULT_PROXYCONSUMER_H
+#define TAO_EC_DEFAULT_PROXYCONSUMER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventChannelAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/EC_ProxyConsumer.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Event_Channel_Base;
+class TAO_EC_ProxyPushSupplier;
+class TAO_EC_Supplier_Filter;
+
+/**
+ * @class TAO_EC_Default_ProxyPushConsumer
+ *
+ * @brief implements RtecEventChannelAdmin::ProxyPushConsumer interface.
+ *
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Default_ProxyPushConsumer :
+ public POA_RtecEventChannelAdmin::ProxyPushConsumer,
+ public TAO_EC_ProxyPushConsumer
+{
+public:
+
+ /// Constructor...
+ TAO_EC_Default_ProxyPushConsumer (TAO_EC_Event_Channel_Base* event_channel);
+
+ /// Destructor...
+ virtual ~TAO_EC_Default_ProxyPushConsumer (void);
+
+ virtual void activate (
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr &proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // = The RtecEventChannelAdmin::ProxyPushConsumer methods...
+ virtual void connect_push_supplier (
+ RtecEventComm::PushSupplier_ptr push_supplier,
+ const RtecEventChannelAdmin::SupplierQOS& qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecEventChannelAdmin::AlreadyConnected));
+ virtual void push (const RtecEventComm::EventSet& event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // = The Servant methods
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+
+ virtual PortableServer::ObjectId
+ object_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_DEFAULT_PROXYCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxySupplier.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxySupplier.cpp
new file mode 100644
index 00000000000..a431afb219f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxySupplier.cpp
@@ -0,0 +1,228 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Default_ProxySupplier.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_Filter_Builder.h"
+
+#include "ace/Reverse_Lock_T.h"
+
+ACE_RCSID (Event,
+ EC_ProxySupplier,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef ACE_Reverse_Lock<ACE_Lock> TAO_EC_Unlock;
+
+TAO_EC_Default_ProxyPushSupplier::TAO_EC_Default_ProxyPushSupplier (
+ TAO_EC_Event_Channel_Base* ec,
+ int validate_connection)
+ : TAO_EC_ProxyPushSupplier (ec, validate_connection)
+{
+}
+
+TAO_EC_Default_ProxyPushSupplier::~TAO_EC_Default_ProxyPushSupplier (void)
+{
+}
+
+void
+TAO_EC_Default_ProxyPushSupplier::connect_push_consumer (
+ RtecEventComm::PushConsumer_ptr push_consumer,
+ const RtecEventChannelAdmin::ConsumerQOS& qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecEventChannelAdmin::AlreadyConnected,
+ RtecEventChannelAdmin::TypeError))
+{
+ // Nil PushConsumers are illegal
+ if (CORBA::is_nil (push_consumer))
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i ())
+ {
+ if (this->event_channel_->consumer_reconnect () == 0)
+ ACE_THROW (RtecEventChannelAdmin::AlreadyConnected ());
+
+ // Re-connections are allowed....
+ this->cleanup_i ();
+
+ this->consumer_ =
+ RtecEventComm::PushConsumer::_duplicate (push_consumer);
+ this->qos_ = qos;
+ this->child_ =
+ this->event_channel_->filter_builder ()->build (this,
+ this->qos_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->adopt_child (this->child_);
+
+ TAO_EC_Unlock reverse_lock (*this->lock_);
+
+ {
+ ACE_GUARD_THROW_EX (
+ TAO_EC_Unlock, ace_mon, reverse_lock,
+ CORBA::INTERNAL ());
+ // @@ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ this->event_channel_->reconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // A separate thread could have connected simultaneously,
+ // this is probably an application error, handle it as
+ // gracefully as possible
+ if (this->is_connected_i ())
+ return; // @@ Should we throw
+ }
+
+#if (TAO_HAS_CORBA_MESSAGING == 1)
+ if ( consumer_validate_connection_ == 1 )
+ {
+ // Validate connection during connect.
+ CORBA::PolicyList_var unused;
+ int status = push_consumer->_validate_connection (unused
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#if TAO_EC_ENABLE_DEBUG_MESSAGES
+ ACE_DEBUG ((LM_DEBUG, "Validated connection to PushConsumer on connect. Status[%d]\n", status));
+#else
+ ACE_UNUSED_ARG(status);
+#endif /* TAO_EC_ENABLED_DEBUG_MESSAGES */
+ }
+#endif /* TAO_HAS_CORBA_MESSAGING == 1 */
+
+ this->consumer_ =
+ RtecEventComm::PushConsumer::_duplicate (push_consumer);
+ this->qos_ = qos;
+
+#if TAO_EC_ENABLE_DEBUG_MESSAGES
+ ACE_DEBUG ((LM_DEBUG,
+ "Building filters for consumer <%x>.\n",
+ this));
+#endif /* TAO_EC_ENABLED_DEBUG_MESSAGES */
+ this->child_ =
+ this->event_channel_->filter_builder ()->build (this,
+ this->qos_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->adopt_child (this->child_);
+ }
+
+ // Notify the event channel...
+ this->event_channel_->connected (this ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Default_ProxyPushSupplier::disconnect_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ RtecEventComm::PushConsumer_var consumer;
+ int connected = 0;
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ connected = this->is_connected_i ();
+ consumer = this->consumer_._retn ();
+
+ if (connected)
+ this->cleanup_i ();
+ }
+
+ // Notify the event channel....
+ this->event_channel_->disconnected (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (!connected)
+ {
+ return;
+ }
+
+ if (this->event_channel_->disconnect_callbacks ())
+ {
+ ACE_TRY
+ {
+ consumer->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // problems on this one.
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ProxySupplier::disconnect_push_supplier");
+ }
+ ACE_ENDTRY;
+ }
+}
+
+void
+TAO_EC_Default_ProxyPushSupplier::suspend_connection (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->suspend_connection_locked (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Default_ProxyPushSupplier::resume_connection (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->resume_connection_locked (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+PortableServer::POA_ptr
+TAO_EC_Default_ProxyPushSupplier::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+void
+TAO_EC_Default_ProxyPushSupplier::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_incr_refcnt ();
+}
+
+void
+TAO_EC_Default_ProxyPushSupplier::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_decr_refcnt ();
+}
+
+void
+TAO_EC_Default_ProxyPushSupplier::activate (
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr &proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ proxy = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+PortableServer::ObjectId
+TAO_EC_Default_ProxyPushSupplier::object_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableServer::ObjectId_var result =
+ this->default_POA_->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+
+ return result.in ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxySupplier.h b/TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxySupplier.h
new file mode 100644
index 00000000000..ae59254ea93
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Default_ProxySupplier.h
@@ -0,0 +1,82 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Default_ProxySupplier.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ * @author Marina Spivak (marina@atdesk.com)
+ * @author Jason Smith (jason@atdesk.com)
+ */
+
+#ifndef TAO_DEFAULT_EC_PROXYSUPPLIER_H
+#define TAO_DEFAULT_EC_PROXYSUPPLIER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventChannelAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Default_ProxyPushSupplier
+ *
+ * @brief Implement the ReliableEventChannelAdmin::ProxyPushSupplier
+ * interface
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Default_ProxyPushSupplier
+ : public POA_RtecEventChannelAdmin::ProxyPushSupplier,
+ public TAO_EC_ProxyPushSupplier
+{
+public:
+
+ /// Constructor...
+ TAO_EC_Default_ProxyPushSupplier (TAO_EC_Event_Channel_Base* event_channel, int validate_connection);
+
+ /// Destructor...
+ virtual ~TAO_EC_Default_ProxyPushSupplier (void);
+
+ void activate (
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr &proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// IDL methods.
+ virtual void connect_push_consumer (
+ RtecEventComm::PushConsumer_ptr push_consumer,
+ const RtecEventChannelAdmin::ConsumerQOS &qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecEventChannelAdmin::AlreadyConnected,
+ RtecEventChannelAdmin::TypeError));
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void suspend_connection (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void resume_connection (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // = The Servant methods
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+
+ virtual PortableServer::ObjectId
+ object_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_DEFAULT_PROXYSUPPLIER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Defaults.h b/TAO/orbsvcs/orbsvcs/Event/EC_Defaults.h
new file mode 100644
index 00000000000..bcabf232a45
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Defaults.h
@@ -0,0 +1,144 @@
+/* -*- C++ -*- */
+/**
+ * @file EC_Defaults.h
+ *
+ * $Id$
+ *
+ * In this file we set the compile time defaults for the event
+ * channel.
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_DEFAULTS_H
+#define TAO_EC_DEFAULTS_H
+
+#include /**/ "ace/pre.h"
+
+#ifndef TAO_EC_ENABLE_DEBUG_MESSAGES
+#define TAO_EC_ENABLE_DEBUG_MESSAGES 0
+#endif /* TAO_EC_ENABLE_DEBUG_MESSAGES */
+
+// Any of the definitions below can be overriden in the config.h file
+// or the compilation line.
+
+// Control consumer and supplier reconnections
+#ifndef TAO_EC_DEFAULT_CONSUMER_RECONNECT
+# define TAO_EC_DEFAULT_CONSUMER_RECONNECT 0
+#endif /* TAO_EC_DEFAULT_CONSUMER_RECONNECT */
+
+#ifndef TAO_EC_DEFAULT_SUPPLIER_RECONNECT
+#define TAO_EC_DEFAULT_SUPPLIER_RECONNECT 0
+#endif /* TAO_EC_DEFAULT_SUPPLIER_RECONNECT */
+
+// Control callbacks when proxies are disconnected
+#ifndef TAO_EC_DEFAULT_DISCONNECT_CALLBACKS
+# define TAO_EC_DEFAULT_DISCONNECT_CALLBACKS 0
+#endif /* TAO_EC_DEFAULT_DISCONNECT_CALLBACKS */
+
+// The defaults for the default factory.
+// The TAO_EC_Default_Factory is a run-time configurable factory for
+// the event channel. Using the service configurator the user can
+// specify what strategies should the factory produce.
+// This macros control the default values for those strategies.
+//
+#ifndef TAO_EC_DEFAULT_DISPATCHING
+# define TAO_EC_DEFAULT_DISPATCHING 0 /* reactive */
+#endif /* TAO_EC_DEFAULT_DISPATCHING */
+
+#ifndef TAO_EC_DEFAULT_CONSUMER_FILTER
+# define TAO_EC_DEFAULT_CONSUMER_FILTER 1 /* type, disj. conj. timers */
+#endif /* TAO_EC_DEFAULT_CONSUMER_FILTER */
+
+#ifndef TAO_EC_DEFAULT_SUPPLIER_FILTER
+# define TAO_EC_DEFAULT_SUPPLIER_FILTER 1 /* per supplier */
+#endif /* TAO_EC_DEFAULT_SUPPLIER_FILTER */
+
+#ifndef TAO_EC_DEFAULT_TIMEOUT
+# define TAO_EC_DEFAULT_TIMEOUT 0 /* reactive */
+#endif /* TAO_EC_DEFAULT_TIMEOUT */
+
+#ifndef TAO_EC_DEFAULT_OBSERVER
+# define TAO_EC_DEFAULT_OBSERVER 0 /* null */
+#endif /* TAO_EC_DEFAULT_OBSERVER */
+
+#ifndef TAO_EC_DEFAULT_SCHEDULING
+# define TAO_EC_DEFAULT_SCHEDULING 0 /* null */
+#endif /* TAO_EC_DEFAULT_SCHEDULING */
+
+#ifndef TAO_EC_DEFAULT_CONSUMER_COLLECTION
+# define TAO_EC_DEFAULT_CONSUMER_COLLECTION 0x001 /* copy-on-read MT-safe */
+#endif /* TAO_EC_DEFAULT_CONSUMER_COLLECTION */
+
+#ifndef TAO_EC_DEFAULT_SUPPLIER_COLLECTION
+# define TAO_EC_DEFAULT_SUPPLIER_COLLECTION 0x001 /* copy-on-read MT-safe */
+#endif /* TAO_EC_DEFAULT_SUPPLIER_COLLECTION */
+
+#ifndef TAO_EC_DEFAULT_CONSUMER_LOCK
+# define TAO_EC_DEFAULT_CONSUMER_LOCK 1 /* thread */
+#endif /* TAO_EC_DEFAULT_CONSUMER_LOCK */
+
+#ifndef TAO_EC_DEFAULT_SUPPLIER_LOCK
+# define TAO_EC_DEFAULT_SUPPLIER_LOCK 1 /* thread */
+#endif /* TAO_EC_DEFAULT_SUPPLIER_LOCK */
+
+#ifndef TAO_EC_DEFAULT_DISPATCHING_THREADS
+# define TAO_EC_DEFAULT_DISPATCHING_THREADS 1 /* */
+#endif /* TAO_EC_DEFAULT_DISPATCHING_THREADS */
+
+#ifndef TAO_EC_DEFAULT_DISPATCHING_THREADS_FLAGS
+# define TAO_EC_DEFAULT_DISPATCHING_THREADS_FLAGS THR_NEW_LWP|THR_SCHED_FIFO
+#endif /* TAO_EC_DEFAULT_DISPATCHING_THREADS */
+
+#ifndef TAO_EC_DEFAULT_DISPATCHING_THREADS_PRIORITY
+# define TAO_EC_DEFAULT_DISPATCHING_THREADS_PRIORITY 0 /* */
+#endif /* TAO_EC_DEFAULT_DISPATCHING_THREADS_PRIORITY */
+
+#ifndef TAO_EC_DEFAULT_DISPATCHING_THREADS_FORCE_ACTIVE
+# define TAO_EC_DEFAULT_DISPATCHING_THREADS_FORCE_ACTIVE 1
+#endif /* TAO_EC_DEFAULT_DISPATCHING_THREADS_FORCE_ACTIVE */
+
+#ifndef TAO_EC_DEFAULT_ORB_ID
+# define TAO_EC_DEFAULT_ORB_ID "" /* */
+#endif /* TAO_EC_DEFAULT_ORB_ID */
+
+#ifndef TAO_EC_DEFAULT_CONSUMER_CONTROL
+# define TAO_EC_DEFAULT_CONSUMER_CONTROL 0 /* null */
+#endif /* TAO_EC_DEFAULT_CONSUMER_CONTROL */
+
+#ifndef TAO_EC_DEFAULT_SUPPLIER_CONTROL
+# define TAO_EC_DEFAULT_SUPPLIER_CONTROL 0 /* null */
+#endif /* TAO_EC_DEFAULT_SUPPLIER_CONTROL */
+
+#ifndef TAO_EC_DEFAULT_CONSUMER_CONTROL_PERIOD
+# define TAO_EC_DEFAULT_CONSUMER_CONTROL_PERIOD 5000000 /* usecs */
+#endif /* TAO_EC_DEFAULT_CONSUMER_CONTROL_PERIOD */
+
+#ifndef TAO_EC_DEFAULT_SUPPLIER_CONTROL_PERIOD
+# define TAO_EC_DEFAULT_SUPPLIER_CONTROL_PERIOD 5000000 /* usecs */
+#endif /* TAO_EC_DEFAULT_SUPPLIER_CONTROL_PERIOD */
+
+#ifndef TAO_EC_DEFAULT_QUEUE_FULL_SERVICE_OBJECT_NAME
+# define TAO_EC_DEFAULT_QUEUE_FULL_SERVICE_OBJECT_NAME "EC_QueueFullSimpleActions"
+#endif /* TAO_EC_DEFAULT_QUEUE_FULL_SERVICE_OBJECT_NAME */
+
+#ifndef TAO_EC_DEFAULT_CONSUMER_CONTROL_TIMEOUT
+# define TAO_EC_DEFAULT_CONSUMER_CONTROL_TIMEOUT 10000 /* usecs */
+#endif /* TAO_EC_DEFAULT_CONSUMER_CONTROL_TIMEOUT */
+
+#ifndef TAO_EC_DEFAULT_SUPPLIER_CONTROL_TIMEOUT
+# define TAO_EC_DEFAULT_SUPPLIER_CONTROL_TIMEOUT 10000 /* usecs */
+#endif /* TAO_EC_DEFAULT_SUPPLIER_CONTROL_TIMEOUT */
+
+#ifndef TAO_EC_DEFAULT_CONSUMER_VALIDATE_CONNECTION
+# define TAO_EC_DEFAULT_CONSUMER_VALIDATE_CONNECTION 0 /* no validation */
+#endif /* TAO_EC_DEFAULT_CONSUMER_VALIDATE_CONNECTION */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_DEFAULTS_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Disjunction_Filter.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Disjunction_Filter.cpp
new file mode 100644
index 00000000000..9016401e2f4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Disjunction_Filter.cpp
@@ -0,0 +1,163 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Disjunction_Filter.h"
+
+ACE_RCSID(Event, EC_Disjunction_Filter, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Disjunction_Filter::
+ TAO_EC_Disjunction_Filter (TAO_EC_Filter* children[],
+ size_t n)
+ : children_ (children),
+ n_ (n)
+{
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin ();
+ i != end;
+ ++i)
+ {
+ this->adopt_child (*i);
+ }
+}
+
+TAO_EC_Disjunction_Filter::~TAO_EC_Disjunction_Filter (void)
+{
+ TAO_EC_Filter** end = this->children_ + this->n_;
+ for (TAO_EC_Filter** i = this->children_;
+ i != end;
+ ++i)
+ {
+ delete *i;
+ *i = 0;
+ }
+ delete[] this->children_;
+ this->children_ = 0;
+ this->n_ = 0;
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Disjunction_Filter::begin (void) const
+{
+ return this->children_;
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Disjunction_Filter::end (void) const
+{
+ return this->children_ + this->n_;
+}
+
+int
+TAO_EC_Disjunction_Filter::size (void) const
+{
+ return static_cast<int> (this->n_);
+}
+
+int
+TAO_EC_Disjunction_Filter::filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin ();
+ i != end;
+ ++i)
+ {
+ int n = (*i)->filter (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ if (n != 0)
+ return n;
+ }
+ return 0;
+}
+
+int
+TAO_EC_Disjunction_Filter::filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin ();
+ i != end;
+ ++i)
+ {
+ int n = (*i)->filter (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ if (n != 0)
+ return n;
+ }
+ return 0;
+}
+
+void
+TAO_EC_Disjunction_Filter::push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (this->parent () != 0)
+ this->parent ()->push (event, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Disjunction_Filter::push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (this->parent () != 0)
+ this->parent ()->push_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Disjunction_Filter::clear (void)
+{
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin ();
+ i != end;
+ ++i)
+ {
+ (*i)->clear ();
+ }
+}
+
+CORBA::ULong
+TAO_EC_Disjunction_Filter::max_event_size (void) const
+{
+ CORBA::ULong n = 0;
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin ();
+ i != end;
+ ++i)
+ {
+ CORBA::ULong m = (*i)->max_event_size ();
+ if (n < m)
+ n = m;
+ }
+ return n;
+}
+
+int
+TAO_EC_Disjunction_Filter::can_match (
+ const RtecEventComm::EventHeader& header) const
+{
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin ();
+ i != end;
+ ++i)
+ {
+ if ((*i)->can_match (header) != 0)
+ return 1;
+ }
+ return 0;
+}
+
+int
+TAO_EC_Disjunction_Filter::add_dependencies (
+ const RtecEventComm::EventHeader&,
+ const TAO_EC_QOS_Info &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Disjunction_Filter.h b/TAO/orbsvcs/orbsvcs/Event/EC_Disjunction_Filter.h
new file mode 100644
index 00000000000..06585acb46d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Disjunction_Filter.h
@@ -0,0 +1,90 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Disjunction_Filter.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_DISJUNCTION_FILTER_H
+#define TAO_EC_DISJUNCTION_FILTER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Filter.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Disjunction_Filter
+ *
+ * @brief The disjunction filter.
+ *
+ * This filter has a set of children (fixed at creation time), if
+ * any of the children accepts an event then it also does.
+ *
+ * <H2>Memory Management</H2>
+ * It assumes ownership of the children.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Disjunction_Filter : public TAO_EC_Filter
+{
+public:
+ /// Constructor. It assumes ownership of both the array and the
+ /// children.
+ TAO_EC_Disjunction_Filter (TAO_EC_Filter* children[],
+ size_t n);
+
+ /// Destructor
+ virtual ~TAO_EC_Disjunction_Filter (void);
+
+
+ // = The TAO_EC_Filter methods, please check the documentation in
+ // TAO_EC_Filter.
+ virtual ChildrenIterator begin (void) const;
+ virtual ChildrenIterator end (void) const;
+ virtual int size (void) const;
+ virtual int filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual int filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void clear (void);
+ virtual CORBA::ULong max_event_size (void) const;
+ virtual int can_match (const RtecEventComm::EventHeader& header) const;
+ virtual int add_dependencies (const RtecEventComm::EventHeader& header,
+ const TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_Disjunction_Filter (const TAO_EC_Disjunction_Filter&);
+ TAO_EC_Disjunction_Filter& operator= (const TAO_EC_Disjunction_Filter&);
+
+private:
+ /// The children
+ TAO_EC_Filter** children_;
+
+ /// The number of children.
+ size_t n_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_DISJUNCTION_FILTER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Dispatching.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Dispatching.cpp
new file mode 100644
index 00000000000..4e2ead6d6e1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Dispatching.cpp
@@ -0,0 +1,14 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Dispatching.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+
+ACE_RCSID(Event, EC_Dispatching, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Dispatching::~TAO_EC_Dispatching (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Dispatching.h b/TAO/orbsvcs/orbsvcs/Event/EC_Dispatching.h
new file mode 100644
index 00000000000..14fc0cc7860
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Dispatching.h
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Dispatching.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_DISPATCHING_H
+#define TAO_EC_DISPATCHING_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventCommC.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_QOS_Info;
+class TAO_EC_ProxyPushSupplier;
+
+/**
+ * @class TAO_EC_Dispatching
+ *
+ * @brief Abstract base class for the dispatching strategies.
+ *
+ * The dispatching strategies.
+ * The EC may be configured with different dispatching strategies,
+ * for instance, it can use a pool of threads to dispatch the
+ * events, or a set of queues with threads at different priorities
+ * for each queue or can simply push the event to the consumer in
+ * FIFO order.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Dispatching
+{
+public:
+ /// Destructor...
+ virtual ~TAO_EC_Dispatching (void);
+
+ /// Initialize all the data structures, activate any internal threads,
+ /// etc.
+ virtual void activate (void) = 0;
+
+ /**
+ * Deactivate any internal threads and cleanup internal data
+ * structures, it should only return once the threads have finished
+ * their jobs.
+ */
+ virtual void shutdown (void) = 0;
+
+ /**
+ * The consumer represented by @a proxy should receive @a event.
+ * It can use the information in @a qos_info to determine the event
+ * priority (among other things).
+ */
+ virtual void push (TAO_EC_ProxyPushSupplier *proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS) = 0;
+ virtual void push_nocopy (TAO_EC_ProxyPushSupplier *proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_DISPATCHING_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Dispatching_Task.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Dispatching_Task.cpp
new file mode 100644
index 00000000000..93b6952aa8d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Dispatching_Task.cpp
@@ -0,0 +1,210 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Dispatching_Task.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_Defaults.h"
+
+#include "tao/ORB_Constants.h"
+#include "ace/OS_NS_errno.h"
+#include "ace/OS_NS_strings.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Dispatching_Task.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Event,
+ EC_Dispatching,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Simple_Queue_Full_Action::TAO_EC_Simple_Queue_Full_Action (void)
+ : queue_full_action_return_value_ (WAIT_TO_EMPTY)
+{
+}
+
+/// Helper function to register the default action into the service
+/// configurator.
+int
+TAO_EC_Simple_Queue_Full_Action::init_svcs (void)
+{
+ return ACE_Service_Config::static_svcs ()->
+ insert (&ace_svc_desc_TAO_EC_Simple_Queue_Full_Action);
+}
+
+int
+TAO_EC_Simple_Queue_Full_Action::init (int argc, char* argv[])
+{
+ // Here we look at the args and set an internal flag indicating whether
+ // the default action should be to wait for the queue to not be full
+ // or whether it should be to silently discard the event.
+
+ // @@ This should use the arg shifter stuff, but let's keep it simple to
+ // start.
+
+ do {
+ if (argc == 0)
+ break;
+
+ if (ACE_OS::strcasecmp ("wait", argv[0]) == 0)
+ this->queue_full_action_return_value_ = WAIT_TO_EMPTY;
+ else if (ACE_OS::strcasecmp ("discard", argv[0]) == 0)
+ this->queue_full_action_return_value_ = SILENTLY_DISCARD;
+#if 0
+ else
+ ;
+ // probably ought to print an error message here
+#endif
+ } while (0);
+
+ return 0;
+}
+
+int
+TAO_EC_Simple_Queue_Full_Action::fini (void)
+{
+ return 0;
+}
+
+int
+TAO_EC_Simple_Queue_Full_Action::queue_full_action (TAO_EC_Dispatching_Task * /*task*/,
+ TAO_EC_ProxyPushSupplier * /*proxy*/,
+ RtecEventComm::PushConsumer_ptr /*consumer*/,
+ RtecEventComm::EventSet& /*event*/
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return this->queue_full_action_return_value_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DEFINE (TAO_EC_Simple_Queue_Full_Action,
+ ACE_TEXT (TAO_EC_DEFAULT_QUEUE_FULL_SERVICE_OBJECT_NAME),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_EC_Simple_Queue_Full_Action),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
+ACE_FACTORY_DEFINE (TAO_RTEvent_Serv, TAO_EC_Simple_Queue_Full_Action)
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+int
+TAO_EC_Queue::is_full_i (void)
+{
+ return static_cast<size_t> (this->cur_count_) > this->high_water_mark_;
+}
+
+// ****************************************************************
+
+int
+TAO_EC_Dispatching_Task::svc (void)
+{
+ int done = 0;
+ while (!done)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ ACE_Message_Block *mb = 0;
+ if (this->getq (mb) == -1)
+ if (ACE_OS::last_error () == ESHUTDOWN)
+ return 0;
+ else
+ ACE_ERROR ((LM_ERROR,
+ "EC (%P|%t) getq error in Dispatching Queue\n"));
+
+ TAO_EC_Dispatch_Command *command =
+ dynamic_cast<TAO_EC_Dispatch_Command*> (mb);
+
+ if (command == 0)
+ {
+ ACE_Message_Block::release (mb);
+ continue;
+ }
+
+ int result = command->execute (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Message_Block::release (mb);
+
+ if (result == -1)
+ done = 1;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "EC (%P|%t) exception in dispatching queue");
+ }
+ ACE_ENDTRY;
+ }
+ return 0;
+}
+
+void
+TAO_EC_Dispatching_Task::push (TAO_EC_ProxyPushSupplier *proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event
+ ACE_ENV_ARG_DECL)
+{
+ if (this->msg_queue()->is_full ())
+ {
+ int action =
+ this->queue_full_service_object_->queue_full_action (this, proxy,
+ consumer, event
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (action == TAO_EC_Queue_Full_Service_Object::SILENTLY_DISCARD)
+ return;
+ // if action == WAIT_TO_EMPTY then we just go ahead and queue it
+ }
+
+ if (this->allocator_ == 0)
+ this->allocator_ = ACE_Allocator::instance ();
+
+ void* buf = this->allocator_->malloc (sizeof (TAO_EC_Push_Command));
+
+ if (buf == 0)
+ ACE_THROW (CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+
+ ACE_Message_Block *mb =
+ new (buf) TAO_EC_Push_Command (proxy,
+ consumer,
+ event,
+ this->data_block_.duplicate (),
+ this->allocator_);
+ this->putq (mb);
+}
+
+// ****************************************************************
+
+TAO_EC_Dispatch_Command::~TAO_EC_Dispatch_Command (void)
+{
+}
+
+// ****************************************************************
+
+int
+TAO_EC_Shutdown_Task_Command::execute (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return -1;
+}
+
+// ****************************************************************
+
+TAO_EC_Push_Command::~TAO_EC_Push_Command (void)
+{
+ this->proxy_->_decr_refcnt ();
+}
+
+int
+TAO_EC_Push_Command::execute (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->proxy_->push_to_consumer (this->consumer_.in (),
+ this->event_
+ ACE_ENV_ARG_PARAMETER);
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Dispatching_Task.h b/TAO/orbsvcs/orbsvcs/Event/EC_Dispatching_Task.h
new file mode 100644
index 00000000000..7aaedd68071
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Dispatching_Task.h
@@ -0,0 +1,199 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Dispatching_Task.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_DISPATCHING_TASK_H
+#define TAO_EC_DISPATCHING_TASK_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RtecEventCommC.h"
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+#include "ace/Task.h"
+#include "ace/Message_Block.h"
+#include "ace/Lock_Adapter_T.h"
+#include "ace/Service_Config.h"
+#include "ace/Global_Macros.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward decl
+class TAO_EC_Dispatching_Task;
+
+class TAO_RTEvent_Serv_Export TAO_EC_Queue_Full_Service_Object : public ACE_Service_Object
+{
+public:
+ enum QueueFullActionReturnValue
+ {
+ WAIT_TO_EMPTY = 0,
+ SILENTLY_DISCARD = -1
+ };
+
+ // Called when
+ virtual int queue_full_action (TAO_EC_Dispatching_Task *task,
+ TAO_EC_ProxyPushSupplier *proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event
+ ACE_ENV_ARG_DECL) = 0;
+};
+
+class TAO_RTEvent_Serv_Export TAO_EC_Simple_Queue_Full_Action :
+ public TAO_EC_Queue_Full_Service_Object
+{
+public:
+ TAO_EC_Simple_Queue_Full_Action ();
+
+ /// Helper function to register the default action into the service
+ /// configurator.
+ static int init_svcs (void);
+
+ // = The Service_Object entry points
+ virtual int init (int argc, char* argv[]);
+ virtual int fini (void);
+
+ virtual int queue_full_action (TAO_EC_Dispatching_Task *task,
+ TAO_EC_ProxyPushSupplier *proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event
+ ACE_ENV_ARG_DECL);
+
+protected:
+ int queue_full_action_return_value_;
+};
+
+class TAO_RTEvent_Serv_Export TAO_EC_Queue : public ACE_Message_Queue<ACE_SYNCH>
+{
+public:
+ TAO_EC_Queue (size_t high_water_mark = ACE_Message_Queue_Base::DEFAULT_HWM,
+ size_t low_water_mark = ACE_Message_Queue_Base::DEFAULT_LWM,
+ ACE_Notification_Strategy * = 0);
+
+protected:
+ // = Override the default definition in the Message_Queue, to count
+ // the number of messages (and not their size).
+ virtual int is_full_i (void);
+};
+
+/**
+ * @class TAO_EC_Dispatching_Task
+ *
+ * @brief Implement the dispatching queues for FIFO and Priority
+ * dispatching.
+ *
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Dispatching_Task : public ACE_Task<ACE_SYNCH>
+{
+public:
+ /// Constructor
+ TAO_EC_Dispatching_Task (ACE_Thread_Manager* thr_manager = 0, TAO_EC_Queue_Full_Service_Object* queue_full_service_object = 0);
+
+ /// Process the events in the queue.
+ virtual int svc (void);
+
+ virtual void push (TAO_EC_ProxyPushSupplier *proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event
+ ACE_ENV_ARG_DECL);
+
+private:
+ /// An per-task allocator
+ ACE_Allocator *allocator_;
+
+ /// Helper data structure to minimize memory allocations...
+ ACE_Locked_Data_Block<ACE_Lock_Adapter<TAO_SYNCH_MUTEX> > data_block_;
+
+ /// The queue
+ TAO_EC_Queue the_queue_;
+
+ TAO_EC_Queue_Full_Service_Object* queue_full_service_object_;
+};
+
+// ****************************************************************
+
+class TAO_RTEvent_Serv_Export TAO_EC_Dispatch_Command : public ACE_Message_Block
+{
+public:
+ /// Constructor, it will allocate its own data block
+ TAO_EC_Dispatch_Command (ACE_Allocator *mb_allocator = 0);
+
+ /// Constructor, it assumes ownership of the data block
+ TAO_EC_Dispatch_Command (ACE_Data_Block*,
+ ACE_Allocator *mb_allocator = 0);
+
+ /// Destructor
+ virtual ~TAO_EC_Dispatch_Command (void);
+
+ /// Command callback
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) = 0;
+};
+
+// ****************************************************************
+
+class TAO_RTEvent_Serv_Export TAO_EC_Shutdown_Task_Command : public TAO_EC_Dispatch_Command
+{
+public:
+ /// Constructor
+ TAO_EC_Shutdown_Task_Command (ACE_Allocator *mb_allocator = 0);
+
+ /// Command callback
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+};
+
+// ****************************************************************
+
+class TAO_RTEvent_Serv_Export TAO_EC_Push_Command : public TAO_EC_Dispatch_Command
+{
+public:
+ /// Constructor
+ TAO_EC_Push_Command (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event,
+ ACE_Data_Block* data_block,
+ ACE_Allocator *mb_allocator);
+
+ /// Destructor
+ virtual ~TAO_EC_Push_Command (void);
+
+ /// Command callback
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+private:
+ /// The proxy
+ TAO_EC_ProxyPushSupplier* proxy_;
+
+ /// The consumer connected to the proxy when the event was pushed.
+ RtecEventComm::PushConsumer_var consumer_;
+
+ /// The event
+ RtecEventComm::EventSet event_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Dispatching_Task.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_STATIC_SVC_DECLARE (TAO_EC_Simple_Queue_Full_Action)
+ACE_FACTORY_DECLARE (TAO_RTEvent_Serv, TAO_EC_Simple_Queue_Full_Action)
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_DISPATCHING_TASK_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Dispatching_Task.i b/TAO/orbsvcs/orbsvcs/Event/EC_Dispatching_Task.i
new file mode 100644
index 00000000000..37930e408fe
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Dispatching_Task.i
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Queue::
+ TAO_EC_Queue (size_t high_water_mark,
+ size_t low_water_mark,
+ ACE_Notification_Strategy *ns)
+ : ACE_Message_Queue<ACE_SYNCH> (high_water_mark,
+ low_water_mark,
+ ns)
+{
+}
+
+/// @todo The high water mark and low water mark shouldn't be
+/// hardcoded, check http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=565
+#ifndef TAO_EC_QUEUE_HWM
+#define TAO_EC_QUEUE_HWM 16384
+//#define TAO_EC_QUEUE_HWM 2
+#endif
+
+#ifndef TAO_EC_QUEUE_LWM
+#define TAO_EC_QUEUE_LWM 16
+//#define TAO_EC_QUEUE_LWM 1
+#endif
+
+ACE_INLINE
+TAO_EC_Dispatching_Task::
+TAO_EC_Dispatching_Task (ACE_Thread_Manager* thr_manager, TAO_EC_Queue_Full_Service_Object* so)
+ : ACE_Task<ACE_SYNCH> (thr_manager),
+ allocator_ (0),
+ the_queue_ (TAO_EC_QUEUE_HWM, TAO_EC_QUEUE_LWM),
+ queue_full_service_object_ (so)
+{
+ this->msg_queue (&this->the_queue_);
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_EC_Dispatch_Command::TAO_EC_Dispatch_Command (ACE_Allocator *mb_allocator)
+ : ACE_Message_Block (mb_allocator)
+{
+}
+
+ACE_INLINE
+TAO_EC_Dispatch_Command::TAO_EC_Dispatch_Command (ACE_Data_Block *data_block,
+ ACE_Allocator *mb_allocator)
+ : ACE_Message_Block (data_block,
+ 0,
+ mb_allocator)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_EC_Shutdown_Task_Command::
+ TAO_EC_Shutdown_Task_Command (ACE_Allocator *mb_allocator)
+ : TAO_EC_Dispatch_Command (mb_allocator)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_EC_Push_Command::TAO_EC_Push_Command (
+ TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event,
+ ACE_Data_Block* data_block,
+ ACE_Allocator *mb_allocator)
+ : TAO_EC_Dispatch_Command (data_block, mb_allocator),
+ proxy_ (proxy),
+ consumer_ (RtecEventComm::PushConsumer::_duplicate (consumer))
+
+{
+ //
+ // Efficient copy, steal the buffer from <event>
+ // We cannot do this on the initialization because get_buffer()
+ // could get called first, effectively setting maximum() and
+ // length() to 0!
+ //
+ CORBA::ULong maximum = event.maximum ();
+ CORBA::ULong length = event.length ();
+ RtecEventComm::Event* buffer = event.get_buffer (1);
+ event_.replace (maximum, length, buffer, 1);
+
+ this->proxy_->_incr_refcnt ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp
new file mode 100644
index 00000000000..b35602065d0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp
@@ -0,0 +1,37 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "ace/Dynamic_Service.h"
+
+ACE_RCSID(Event, EC_Event_Channel, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Event_Channel::
+TAO_EC_Event_Channel (const TAO_EC_Event_Channel_Attributes& attr,
+ TAO_EC_Factory* factory,
+ int own_factory)
+ : TAO_EC_Event_Channel_Base (attr, factory, own_factory)
+{
+ if (this->factory () == 0)
+ {
+ this->factory (
+ ACE_Dynamic_Service<TAO_EC_Factory>::instance ("EC_Factory"),
+ 0);
+
+ if (this->factory () == 0)
+ {
+ TAO_EC_Factory *f = 0;
+ ACE_NEW (f,
+ TAO_EC_Default_Factory);
+ this->factory (f, 1);
+ }
+ }
+ this->scheduler_ =
+ CORBA::Object::_duplicate (attr.scheduler);
+
+ this->create_strategies ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.h b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.h
new file mode 100644
index 00000000000..a2aa9b95643
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.h
@@ -0,0 +1,62 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Event_Channel.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ * @author Marina Spivak (marina@atdesk.com)
+ * @author Jason Smith (jason@atdesk.com)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_EVENT_CHANNEL_H
+#define TAO_EC_EVENT_CHANNEL_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Event_Channel
+ *
+ * @brief The RtecEventChannelAdmin::EventChannel implementation.
+ *
+ * This class is the Mediator between all the classes in the EC
+ * implementation, its main task is to redirect the messages to
+ * the right components, to hold and manage the lifetime of the
+ * long lived objects (Timer_Module, SupplierAdmin,
+ * ConsumerAdmin and Dispatching) and to provide a simpler
+ * interface to the EC_Factory.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Event_Channel :
+ public TAO_EC_Event_Channel_Base
+{
+public:
+ /**
+ * constructor
+ * If @a own_factory is not 0 it assumes ownership of the factory.
+ * If the @a factory is nil it uses the Service_Configurator to load
+ * the Factory, if not found it uses TAO_EC_Default_Factory
+ */
+ TAO_EC_Event_Channel (const TAO_EC_Event_Channel_Attributes& attributes,
+ TAO_EC_Factory* factory = 0,
+ int own_factory = 0);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_EVENT_CHANNEL_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel_Base.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel_Base.cpp
new file mode 100644
index 00000000000..cdb208fbb4a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel_Base.cpp
@@ -0,0 +1,353 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_Dispatching.h"
+#include "orbsvcs/Event/EC_ConsumerAdmin.h"
+#include "orbsvcs/Event/EC_SupplierAdmin.h"
+#include "orbsvcs/Event/EC_Timeout_Generator.h"
+#include "orbsvcs/Event/EC_ObserverStrategy.h"
+#include "orbsvcs/Event/EC_ConsumerControl.h"
+#include "orbsvcs/Event/EC_SupplierControl.h"
+#include "ace/Dynamic_Service.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Event_Channel_Base.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_Event_Channel_Base, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Event_Channel_Base::
+TAO_EC_Event_Channel_Base (const TAO_EC_Event_Channel_Attributes& attr,
+ TAO_EC_Factory* factory,
+ int own_factory)
+ : supplier_poa_ (PortableServer::POA::_duplicate (attr.supplier_poa)),
+ consumer_poa_ (PortableServer::POA::_duplicate (attr.consumer_poa)),
+ factory_ (factory),
+ own_factory_ (own_factory),
+ dispatching_ (0),
+ filter_builder_ (0),
+ supplier_filter_builder_ (0),
+ consumer_admin_ (0),
+ supplier_admin_ (0),
+ timeout_generator_ (0),
+ observer_strategy_ (0),
+ scheduling_strategy_(0),
+ consumer_reconnect_ (attr.consumer_reconnect),
+ supplier_reconnect_ (attr.supplier_reconnect),
+ disconnect_callbacks_ (attr.disconnect_callbacks),
+ consumer_control_ (0),
+ supplier_control_ (0),
+ status_ (EC_S_IDLE)
+{
+ this->scheduler_ =
+ CORBA::Object::_duplicate (attr.scheduler);
+}
+
+TAO_EC_Event_Channel_Base::~TAO_EC_Event_Channel_Base (void)
+{
+ // Destroy Strategies in the reverse order of creation, they
+ // refere to each other during destruction and thus need to be
+ // cleaned up properly.
+ this->factory_->destroy_supplier_control (this->supplier_control_);
+ this->supplier_control_ = 0;
+ this->factory_->destroy_consumer_control (this->consumer_control_);
+ this->consumer_control_ = 0;
+
+ this->factory_->destroy_scheduling_strategy (this->scheduling_strategy_);
+ this->scheduling_strategy_ = 0;
+
+ this->factory_->destroy_observer_strategy (this->observer_strategy_);
+ this->observer_strategy_ = 0;
+
+ this->factory_->destroy_timeout_generator (this->timeout_generator_);
+ this->timeout_generator_ = 0;
+
+ this->factory_->destroy_supplier_admin (this->supplier_admin_);
+ this->supplier_admin_ = 0;
+ this->factory_->destroy_consumer_admin (this->consumer_admin_);
+ this->consumer_admin_ = 0;
+
+ this->factory_->destroy_supplier_filter_builder (this->supplier_filter_builder_);
+ this->supplier_filter_builder_ = 0;
+
+ this->factory_->destroy_filter_builder (this->filter_builder_);
+ this->filter_builder_ = 0;
+
+ this->factory_->destroy_dispatching (this->dispatching_);
+ this->dispatching_ = 0;
+
+ this->factory (0, 0);
+}
+
+void
+TAO_EC_Event_Channel_Base::create_strategies (void)
+{
+ this->dispatching_ =
+ this->factory_->create_dispatching (this);
+ this->filter_builder_ =
+ this->factory_->create_filter_builder (this);
+ this->supplier_filter_builder_ =
+ this->factory_->create_supplier_filter_builder (this);
+ this->consumer_admin_ =
+ this->factory_->create_consumer_admin (this);
+ this->supplier_admin_ =
+ this->factory_->create_supplier_admin (this);
+ this->timeout_generator_ =
+ this->factory_->create_timeout_generator (this);
+ this->observer_strategy_ =
+ this->factory_->create_observer_strategy (this);
+
+ this->scheduling_strategy_ =
+ this->factory_->create_scheduling_strategy (this);
+
+ this->consumer_control_ =
+ this->factory_->create_consumer_control (this);
+ this->supplier_control_ =
+ this->factory_->create_supplier_control (this);
+}
+
+void
+TAO_EC_Event_Channel_Base::activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ {
+ // First check if the EC is idle, if it is not then we need to
+ // return right away...
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (this->status_ != EC_S_IDLE)
+ return;
+ this->status_ = EC_S_ACTIVATING;
+ }
+ this->dispatching_->activate ();
+ this->timeout_generator_->activate ();
+ this->consumer_control_->activate ();
+ this->supplier_control_->activate ();
+ {
+ // Only when all the operations complete successfully we can mark
+ // the EC as active...
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ ACE_ASSERT (this->status_ == EC_S_ACTIVATING);
+ this->status_ = EC_S_ACTIVE;
+ }
+}
+
+void
+TAO_EC_Event_Channel_Base::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ {
+ // First check if the EC is already active, if it is not then we
+ // need to return right away...
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (this->status_ != EC_S_ACTIVE)
+ return;
+ this->status_ = EC_S_DESTROYING;
+ }
+ this->dispatching_->shutdown ();
+ this->timeout_generator_->shutdown ();
+ this->supplier_control_->shutdown ();
+ this->consumer_control_->shutdown ();
+
+ this->deactivate_supplier_admin ();
+ this->deactivate_consumer_admin ();
+
+ this->supplier_admin_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_admin_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ {
+ // Wait until all the shutdown() operations return before marking
+ // the EC as destroyed...
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ ACE_ASSERT (this->status_ == EC_S_DESTROYING);
+ this->status_ = EC_S_DESTROYED;
+ }
+}
+
+void
+TAO_EC_Event_Channel_Base::deactivate_supplier_admin (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ PortableServer::POA_var supplier_poa =
+ this->supplier_admin_->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::ObjectId_var supplier_id =
+ supplier_poa->servant_to_id (this->supplier_admin_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_poa->deactivate_object (supplier_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // The deactivation can throw...
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_EC_Event_Channel_Base::deactivate_consumer_admin (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ PortableServer::POA_var consumer_poa =
+ this->consumer_admin_->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::ObjectId_var consumer_id =
+ consumer_poa->servant_to_id (this->consumer_admin_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer_poa->deactivate_object (consumer_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // The deactivation can throw...
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_EC_Event_Channel_Base::connected (TAO_EC_ProxyPushConsumer* consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->consumer_admin_->peer_connected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->supplier_admin_->connected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->observer_strategy_->connected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Event_Channel_Base::reconnected (TAO_EC_ProxyPushConsumer* consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->consumer_admin_->peer_reconnected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->supplier_admin_->reconnected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->observer_strategy_->connected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Event_Channel_Base::disconnected (TAO_EC_ProxyPushConsumer* consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->consumer_admin_->peer_disconnected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->supplier_admin_->disconnected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->observer_strategy_->disconnected (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Event_Channel_Base::connected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_admin_->peer_connected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->consumer_admin_->connected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->observer_strategy_->connected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Event_Channel_Base::reconnected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_admin_->peer_reconnected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->consumer_admin_->reconnected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->observer_strategy_->connected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Event_Channel_Base::disconnected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_admin_->peer_disconnected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->consumer_admin_->disconnected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->observer_strategy_->disconnected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+RtecEventChannelAdmin::ConsumerAdmin_ptr
+TAO_EC_Event_Channel_Base::for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->consumer_admin_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+RtecEventChannelAdmin::SupplierAdmin_ptr
+TAO_EC_Event_Channel_Base::for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->supplier_admin_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Event_Channel_Base::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+RtecEventChannelAdmin::Observer_Handle
+TAO_EC_Event_Channel_Base::append_observer (
+ RtecEventChannelAdmin::Observer_ptr observer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER))
+{
+ return this->observer_strategy_->append_observer (observer
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Event_Channel_Base::remove_observer (
+ RtecEventChannelAdmin::Observer_Handle handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_REMOVE_OBSERVER))
+{
+ this->observer_strategy_->remove_observer (handle
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Event_Channel_Base::for_each_consumer (
+ TAO_ESF_Worker<TAO_EC_ProxyPushSupplier> *worker
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->consumer_admin_->for_each (worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Event_Channel_Base::for_each_supplier (
+ TAO_ESF_Worker<TAO_EC_ProxyPushConsumer> *worker
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->supplier_admin_->for_each (worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel_Base.h b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel_Base.h
new file mode 100644
index 00000000000..b42632c4c43
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel_Base.h
@@ -0,0 +1,377 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Event_Channel_Base.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ * @author Marina Spivak (marina@atdesk.com)
+ * @author Jason Smith (jason@atdesk.com)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_EVENT_CHANNEL_BASE_H
+#define TAO_EC_EVENT_CHANNEL_BASE_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Factory.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/EC_Defaults.h"
+
+#include "orbsvcs/RtecEventChannelAdminS.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class> class TAO_ESF_Worker;
+
+/**
+ * @class TAO_EC_Event_Channel_Attributes
+ *
+ * @brief Defines the construction time attributes for the Event
+ * Channel.
+ *
+ * The event channel implementation is controlled by two
+ * mechanisms:
+ * The EC_Factory that provides the strategies for the EC
+ * implementation.
+ * The EC attributes that define constants and values required
+ * by the EC construction.
+ * This class encapsulates those constants and values, providing
+ * an easy mechanism to extend the attributes without requiring
+ * changes in the EC constructor.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Event_Channel_Attributes
+{
+public:
+ /**
+ * The basic constructor.
+ * The attributes listed as arguments are *required* by the EC, and
+ * no appropiate defaults are available for them.
+ */
+ TAO_EC_Event_Channel_Attributes (PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa);
+
+ // Most fields are public, there is no need to protect them, in fact
+ // the user should be able to set any values she wants.
+
+ /// Can consumers or suppliers invoke connect_push_* multiple times?
+ int consumer_reconnect;
+ int supplier_reconnect;
+
+ /**
+ * It not zero the event channel will send disconnect callbacks when
+ * a disconnect method is called on a Proxy. In other words, if a
+ * consumer calls disconnect_push_supplier() on its proxy the EC
+ * will invoke disconnect_push_consumer() on the consumer. A
+ * similar thing is done for suppliers.
+ * It is a matter of debate what the spec requires for the regular
+ * event service.
+ */
+ int disconnect_callbacks;
+
+ /**
+ * The scheduling service that we will use with this event channel.
+ * Notice that this is optional and will only take effect if the EC
+ * is configured with the right filtering strategies.
+ */
+ CORBA::Object_ptr scheduler;
+
+private:
+ /// Only the EC can read the private fields.
+ friend class TAO_EC_Event_Channel_Base;
+
+ /// The POAs
+ PortableServer::POA_ptr supplier_poa;
+ PortableServer::POA_ptr consumer_poa;
+};
+
+/**
+ * @class TAO_EC_Event_Channel_Base
+ *
+ * @brief The RtecEventChannelAdmin::EventChannel implementation.
+ *
+ * This class is the Mediator between all the classes in the EC
+ * implementation, its main task is to redirect the messages to
+ * the right components, to hold and manage the lifetime of the
+ * long lived objects (Timer_Module, SupplierAdmin,
+ * ConsumerAdmin and Dispatching) and to provide a simpler
+ * interface to the EC_Factory.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Event_Channel_Base
+ : public POA_RtecEventChannelAdmin::EventChannel
+{
+public:
+ /// destructor
+ virtual ~TAO_EC_Event_Channel_Base (void);
+
+ /// Start the internal threads (if any), etc.
+ /// After this call the EC can be used.
+ virtual void activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// Shutdown any internal threads, cleanup all the internal
+ /// structures, flush all the messages, etc.
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ virtual void for_each_consumer (
+ TAO_ESF_Worker<TAO_EC_ProxyPushSupplier> *worker
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void for_each_supplier (
+ TAO_ESF_Worker<TAO_EC_ProxyPushConsumer> *worker
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Access the dispatching module....
+ TAO_EC_Dispatching* dispatching (void) const;
+
+ /// Access the filter builder....
+ TAO_EC_Filter_Builder* filter_builder (void) const;
+
+ /// Access the filter builder....
+ TAO_EC_Supplier_Filter_Builder* supplier_filter_builder (void) const;
+
+ /// Access the consumer admin implementation, useful for controlling
+ /// the activation...
+ TAO_EC_ConsumerAdmin* consumer_admin (void) const;
+
+ /// Access the supplier admin implementation, useful for controlling
+ /// the activation...
+ TAO_EC_SupplierAdmin* supplier_admin (void) const;
+
+ /// Access the timer module...
+ TAO_EC_Timeout_Generator* timeout_generator (void) const;
+
+ /// Access the scheduling strategy
+ TAO_EC_Scheduling_Strategy* scheduling_strategy (void) const;
+
+ /// Access the client control strategies.
+ TAO_EC_ConsumerControl *consumer_control (void) const;
+ TAO_EC_SupplierControl *supplier_control (void) const;
+
+ // = The factory methods, they delegate on the EC_Factory.
+ /// Create and destroy a ProxyPushSupplier
+ void create_proxy (TAO_EC_ProxyPushSupplier*&);
+ void destroy_proxy (TAO_EC_ProxyPushSupplier*);
+
+ /// Create and destroy a ProxyPushConsumer
+ void create_proxy (TAO_EC_ProxyPushConsumer*&);
+ void destroy_proxy (TAO_EC_ProxyPushConsumer*);
+
+
+ /// Create and destroy a the collections used to store
+ /// ProxyPushSuppliers
+ void create_proxy_collection (TAO_EC_ProxyPushSupplier_Collection*&);
+ void destroy_proxy_collection (TAO_EC_ProxyPushSupplier_Collection*);
+
+
+ /// Create and destroy a the collections used to store
+ /// ProxyPushConsumers
+ void create_proxy_collection (TAO_EC_ProxyPushConsumer_Collection*&);
+ void destroy_proxy_collection (TAO_EC_ProxyPushConsumer_Collection*);
+
+ /// Access the supplier and consumer POAs from the factory.
+ PortableServer::POA_ptr supplier_poa (void);
+ PortableServer::POA_ptr consumer_poa (void);
+
+ /// Locking strategies for the ProxyPushConsumer and
+ /// ProxyPushSupplier objects
+ ACE_Lock* create_consumer_lock (void);
+ void destroy_consumer_lock (ACE_Lock*);
+ ACE_Lock* create_supplier_lock (void);
+ void destroy_supplier_lock (ACE_Lock*);
+
+ /// Used to inform the EC that a Consumer has connected or
+ /// disconnected from it.
+ virtual void connected (TAO_EC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void reconnected (TAO_EC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_EC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Used to inform the EC that a Supplier has connected or
+ /// disconnected from it.
+ virtual void connected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void reconnected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ // Simple flags to control the EC behavior, set by the application
+ // at construction time.
+
+ /// Can the consumers reconnect to the EC?
+ int consumer_reconnect (void) const;
+
+ /// Can the suppliers reconnect to the EC?
+ int supplier_reconnect (void) const;
+
+ /// Should we send callback disconnect messages when a proxy is
+ /// disconnected by the client
+ int disconnect_callbacks (void) const;
+
+ /// Obtain the scheduler, the user must release
+ CORBA::Object_ptr scheduler (void);
+
+ // = The RtecEventChannelAdmin::EventChannel methods...
+ /// The default implementation is:
+ /// this->consumer_admin ()->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ virtual RtecEventChannelAdmin::ConsumerAdmin_ptr
+ for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// The default implementation is:
+ /// this->supplier_admin ()->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ virtual RtecEventChannelAdmin::SupplierAdmin_ptr
+ for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Commit suicide.
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual RtecEventChannelAdmin::Observer_Handle
+ append_observer (RtecEventChannelAdmin::Observer_ptr
+ 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));
+
+ /// Return 1 if the event channel is already destroyed.
+ int destroyed (void);
+
+protected:
+ /**
+ * Constructor
+ * If @a own_factory is not 0 it assumes ownership of the factory.
+ * If the @a factory is nil it uses the Service_Configurator to load
+ * the Factory, if not found it uses TAO_EC_Default_Resource_Factory
+ */
+ TAO_EC_Event_Channel_Base (const TAO_EC_Event_Channel_Attributes& attributes,
+ TAO_EC_Factory* factory = 0,
+ int own_factory = 0);
+
+ /**
+ * Get the factory.
+ */
+ TAO_EC_Factory * factory (void) const;
+
+ /**
+ * Set the factory, if @a own_factory is not 0 it assumes ownership of the
+ * factory.
+ */
+ void factory (TAO_EC_Factory* factory,
+ int own_factory = 0);
+
+ /**
+ * Create all strategies
+ */
+ void create_strategies (void);
+
+ /// Helpers. Deactivate admins from their POAs, ignoring any CORBA
+ /// exceptions.
+ //@{
+ void deactivate_supplier_admin (void);
+ void deactivate_consumer_admin (void);
+ //@}
+
+ /// The POAs used to activate "supplier-side" and "consumer-side"
+ /// objects.
+ PortableServer::POA_var supplier_poa_;
+ PortableServer::POA_var consumer_poa_;
+
+ /**
+ * This is the abstract factory that creates all the objects that
+ * compose an event channel, the event channel simply acts as a
+ * Mediator among them.
+ */
+ TAO_EC_Factory *factory_;
+
+ /// Flag that indicates if we own the factory.
+ int own_factory_;
+
+ /// The dispatching "module"
+ TAO_EC_Dispatching *dispatching_;
+
+ /// The filter builder
+ TAO_EC_Filter_Builder *filter_builder_;
+
+ /// The filter builder for suppliers
+ TAO_EC_Supplier_Filter_Builder *supplier_filter_builder_;
+
+ /// The ConsumerAdmin implementation
+ TAO_EC_ConsumerAdmin *consumer_admin_;
+
+ /// The SupplierAdmin implementation
+ TAO_EC_SupplierAdmin *supplier_admin_;
+
+ /// The timeout generator
+ TAO_EC_Timeout_Generator *timeout_generator_;
+
+ /// The observer strategy
+ TAO_EC_ObserverStrategy *observer_strategy_;
+
+ /// The scheduler (may be nil)
+ CORBA::Object_var scheduler_;
+
+ /// The scheduling strategy
+ TAO_EC_Scheduling_Strategy *scheduling_strategy_;
+
+ /// Consumer reconnection flags
+ int consumer_reconnect_;
+
+ /// Supplier reconnection flags
+ int supplier_reconnect_;
+
+ /// If not zero we send callbacks when a proxy is disconnected
+ int disconnect_callbacks_;
+
+ /// Strategies to disconnect misbehaving or destroyed consumers
+ TAO_EC_ConsumerControl *consumer_control_;
+
+ /// Strategies to disconnect misbehaving or destroyed suppliers
+ TAO_EC_SupplierControl *supplier_control_;
+
+ /// Mutex to protect the internal state
+ TAO_SYNCH_MUTEX mutex_;
+
+ /// Flag to track the status of the event channel
+ enum {
+ EC_S_IDLE
+ , EC_S_ACTIVATING
+ , EC_S_ACTIVE
+ , EC_S_DESTROYING
+ , EC_S_DESTROYED
+ };
+ int status_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Event_Channel_Base.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_EVENT_CHANNEL_BASE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel_Base.i b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel_Base.i
new file mode 100644
index 00000000000..1883f84ef11
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel_Base.i
@@ -0,0 +1,206 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Event_Channel_Attributes::
+TAO_EC_Event_Channel_Attributes (PortableServer::POA_ptr s_poa,
+ PortableServer::POA_ptr c_poa)
+ : consumer_reconnect (TAO_EC_DEFAULT_CONSUMER_RECONNECT),
+ supplier_reconnect (TAO_EC_DEFAULT_SUPPLIER_RECONNECT),
+ disconnect_callbacks (TAO_EC_DEFAULT_DISCONNECT_CALLBACKS),
+ scheduler (CORBA::Object::_nil ()),
+ supplier_poa (s_poa),
+ consumer_poa (c_poa)
+{
+}
+
+ACE_INLINE TAO_EC_Factory*
+TAO_EC_Event_Channel_Base::factory (void) const
+{
+ return this->factory_;
+}
+
+ACE_INLINE void
+TAO_EC_Event_Channel_Base::factory (TAO_EC_Factory* factory,
+ int own_factory)
+{
+ if (this->own_factory_)
+ delete this->factory_;
+
+ this->factory_ = factory;
+ this->own_factory_ = own_factory;
+}
+
+ACE_INLINE TAO_EC_Dispatching*
+TAO_EC_Event_Channel_Base::dispatching (void) const
+{
+ return this->dispatching_;
+}
+
+ACE_INLINE TAO_EC_Filter_Builder*
+TAO_EC_Event_Channel_Base::filter_builder (void) const
+{
+ return this->filter_builder_;
+}
+
+ACE_INLINE TAO_EC_Supplier_Filter_Builder*
+TAO_EC_Event_Channel_Base::supplier_filter_builder (void) const
+{
+ return this->supplier_filter_builder_;
+}
+
+ACE_INLINE TAO_EC_ConsumerAdmin*
+TAO_EC_Event_Channel_Base::consumer_admin (void) const
+{
+ return this->consumer_admin_;
+}
+
+ACE_INLINE TAO_EC_SupplierAdmin*
+TAO_EC_Event_Channel_Base::supplier_admin (void) const
+{
+ return this->supplier_admin_;
+}
+
+ACE_INLINE TAO_EC_Timeout_Generator*
+TAO_EC_Event_Channel_Base::timeout_generator (void) const
+{
+ return this->timeout_generator_;
+}
+
+ACE_INLINE TAO_EC_Scheduling_Strategy*
+TAO_EC_Event_Channel_Base::scheduling_strategy (void) const
+{
+ return this->scheduling_strategy_;
+}
+
+ACE_INLINE TAO_EC_ConsumerControl*
+TAO_EC_Event_Channel_Base::consumer_control (void) const
+{
+ return this->consumer_control_;
+}
+
+ACE_INLINE TAO_EC_SupplierControl*
+TAO_EC_Event_Channel_Base::supplier_control (void) const
+{
+ return this->supplier_control_;
+}
+
+ACE_INLINE void
+TAO_EC_Event_Channel_Base::create_proxy (TAO_EC_ProxyPushSupplier*& x)
+{
+ x = this->factory_->create_proxy_push_supplier (this);
+}
+
+ACE_INLINE void
+TAO_EC_Event_Channel_Base::destroy_proxy (TAO_EC_ProxyPushSupplier* supplier)
+{
+ this->factory_->destroy_proxy_push_supplier (supplier);
+}
+
+ACE_INLINE void
+TAO_EC_Event_Channel_Base::create_proxy (TAO_EC_ProxyPushConsumer*& x)
+{
+ x = this->factory_->create_proxy_push_consumer (this);
+}
+
+ACE_INLINE void
+TAO_EC_Event_Channel_Base::destroy_proxy (TAO_EC_ProxyPushConsumer* consumer)
+{
+ this->factory_->destroy_proxy_push_consumer (consumer);
+}
+
+ACE_INLINE void
+TAO_EC_Event_Channel_Base::create_proxy_collection (TAO_EC_ProxyPushConsumer_Collection*& x)
+{
+ x = this->factory_->create_proxy_push_consumer_collection (this);
+}
+
+ACE_INLINE void
+TAO_EC_Event_Channel_Base::destroy_proxy_collection (TAO_EC_ProxyPushConsumer_Collection* x)
+{
+ this->factory_->destroy_proxy_push_consumer_collection (x);
+}
+
+ACE_INLINE void
+TAO_EC_Event_Channel_Base::create_proxy_collection (TAO_EC_ProxyPushSupplier_Collection*& x)
+{
+ x = this->factory_->create_proxy_push_supplier_collection (this);
+}
+
+ACE_INLINE void
+TAO_EC_Event_Channel_Base::destroy_proxy_collection (TAO_EC_ProxyPushSupplier_Collection* x)
+{
+ this->factory_->destroy_proxy_push_supplier_collection (x);
+}
+
+ACE_INLINE PortableServer::POA_ptr
+TAO_EC_Event_Channel_Base::supplier_poa (void)
+{
+ return PortableServer::POA::_duplicate (this->supplier_poa_.in ());
+}
+
+ACE_INLINE PortableServer::POA_ptr
+TAO_EC_Event_Channel_Base::consumer_poa (void)
+{
+ return PortableServer::POA::_duplicate (this->consumer_poa_.in ());
+}
+
+ACE_INLINE ACE_Lock*
+TAO_EC_Event_Channel_Base::create_consumer_lock (void)
+{
+ return this->factory_->create_consumer_lock ();
+}
+
+ACE_INLINE void
+TAO_EC_Event_Channel_Base::destroy_consumer_lock (ACE_Lock* x)
+{
+ this->factory_->destroy_consumer_lock (x);
+}
+
+ACE_INLINE ACE_Lock*
+TAO_EC_Event_Channel_Base::create_supplier_lock (void)
+{
+ return this->factory_->create_supplier_lock ();
+}
+
+ACE_INLINE void
+TAO_EC_Event_Channel_Base::destroy_supplier_lock (ACE_Lock* x)
+{
+ this->factory_->destroy_supplier_lock (x);
+}
+
+ACE_INLINE int
+TAO_EC_Event_Channel_Base::consumer_reconnect (void) const
+{
+ return this->consumer_reconnect_;
+}
+
+ACE_INLINE int
+TAO_EC_Event_Channel_Base::supplier_reconnect (void) const
+{
+ return this->supplier_reconnect_;
+}
+
+ACE_INLINE int
+TAO_EC_Event_Channel_Base::disconnect_callbacks (void) const
+{
+ return this->disconnect_callbacks_;
+}
+
+ACE_INLINE CORBA::Object_ptr
+TAO_EC_Event_Channel_Base::scheduler (void)
+{
+ return CORBA::Object::_duplicate (this->scheduler_.in ());
+}
+
+ACE_INLINE int
+TAO_EC_Event_Channel_Base::destroyed (void)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0);
+ return (this->status_ == EC_S_DESTROYED);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Factory.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Factory.cpp
new file mode 100644
index 00000000000..0612521f408
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Factory.cpp
@@ -0,0 +1,14 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Factory.h"
+#include "ace/Dynamic_Service.h"
+
+ACE_RCSID(Event, EC_Factory, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Factory::~TAO_EC_Factory (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Factory.h b/TAO/orbsvcs/orbsvcs/Event/EC_Factory.h
new file mode 100644
index 00000000000..a3cd903d4f4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Factory.h
@@ -0,0 +1,169 @@
+// -*- C++ -*-
+/**
+ * @file EC_Factory.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_FACTORY_H
+#define TAO_EC_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+#include "ace/Service_Object.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Lock;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Event_Channel_Base;
+
+class TAO_EC_Dispatching;
+class TAO_EC_Filter_Builder;
+class TAO_EC_Supplier_Filter_Builder;
+class TAO_EC_ConsumerAdmin;
+class TAO_EC_SupplierAdmin;
+class TAO_EC_ProxyPushConsumer;
+class TAO_EC_ProxyPushSupplier;
+class TAO_EC_ObserverStrategy;
+template<class PROXY> class TAO_ESF_Proxy_Collection;
+class TAO_EC_Timeout_Generator;
+class TAO_EC_Scheduling_Strategy;
+class TAO_EC_ConsumerControl;
+class TAO_EC_SupplierControl;
+
+typedef TAO_ESF_Proxy_Collection<TAO_EC_ProxyPushConsumer> TAO_EC_ProxyPushConsumer_Collection;
+typedef TAO_ESF_Proxy_Collection<TAO_EC_ProxyPushSupplier> TAO_EC_ProxyPushSupplier_Collection;
+
+/**
+ * @class TAO_EC_Factory
+ *
+ * @brief Abstract base class for the Event Channel components.
+ *
+ * Defines the EC_Factory interface.
+ *
+ * <H2>Memory Management</H2>
+ * The objects it creates are owned by this class, the client must
+ * invoke the corresponding destroy() method to release them.
+ * Some implementations may require a different instance for the
+ * EC_Factory for each instance of Event_Channel.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Factory : public ACE_Service_Object
+{
+public:
+ /// destructor...
+ virtual ~TAO_EC_Factory (void);
+
+ /// Create and destroy the dispatching module.
+ virtual TAO_EC_Dispatching*
+ create_dispatching (TAO_EC_Event_Channel_Base*) = 0;
+ virtual void
+ destroy_dispatching (TAO_EC_Dispatching*) = 0;
+
+ /// Create and destroy the filter builder.
+ virtual TAO_EC_Filter_Builder*
+ create_filter_builder (TAO_EC_Event_Channel_Base*) = 0;
+ virtual void
+ destroy_filter_builder (TAO_EC_Filter_Builder*) = 0;
+
+ /// Create and destroy the filter builder.
+ virtual TAO_EC_Supplier_Filter_Builder*
+ create_supplier_filter_builder (TAO_EC_Event_Channel_Base*) = 0;
+ virtual void
+ destroy_supplier_filter_builder (TAO_EC_Supplier_Filter_Builder*) = 0;
+
+ /// Create and destroy the consumer admin implementation.
+ virtual TAO_EC_ConsumerAdmin*
+ create_consumer_admin (TAO_EC_Event_Channel_Base*) = 0;
+ virtual void
+ destroy_consumer_admin (TAO_EC_ConsumerAdmin*) = 0;
+
+ /// Create and destroy the supplier admin implementation.
+ virtual TAO_EC_SupplierAdmin*
+ create_supplier_admin (TAO_EC_Event_Channel_Base*) = 0;
+ virtual void
+ destroy_supplier_admin (TAO_EC_SupplierAdmin*) = 0;
+
+ /// Create and destroy a ProxyPushSupplier
+ virtual TAO_EC_ProxyPushSupplier*
+ create_proxy_push_supplier (TAO_EC_Event_Channel_Base*) = 0;
+ virtual void
+ destroy_proxy_push_supplier (TAO_EC_ProxyPushSupplier*) = 0;
+
+ /// Create and destroy a ProxyPushConsumer
+ virtual TAO_EC_ProxyPushConsumer*
+ create_proxy_push_consumer (TAO_EC_Event_Channel_Base*) = 0;
+ virtual void
+ destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer*) = 0;
+
+ /// Create and destroy the timer module.
+ virtual TAO_EC_Timeout_Generator*
+ create_timeout_generator (TAO_EC_Event_Channel_Base*) = 0;
+ virtual void
+ destroy_timeout_generator (TAO_EC_Timeout_Generator*) = 0;
+
+ /// Create and destroy the observer strategy.
+ virtual TAO_EC_ObserverStrategy*
+ create_observer_strategy (TAO_EC_Event_Channel_Base*) = 0;
+ virtual void
+ destroy_observer_strategy (TAO_EC_ObserverStrategy*) = 0;
+
+ /// Create and destroy the observer strategy.
+ virtual TAO_EC_Scheduling_Strategy*
+ create_scheduling_strategy (TAO_EC_Event_Channel_Base*) = 0;
+ virtual void
+ destroy_scheduling_strategy (TAO_EC_Scheduling_Strategy*) = 0;
+
+ /// Create and destroy a collection of TAO_EC_ProxyPushConsumers
+ virtual TAO_EC_ProxyPushConsumer_Collection*
+ create_proxy_push_consumer_collection (TAO_EC_Event_Channel_Base*) = 0;
+ virtual void
+ destroy_proxy_push_consumer_collection (TAO_EC_ProxyPushConsumer_Collection*) = 0;
+
+ /// Create and destroy a collection of TAO_EC_ProxyPushSuppliers
+ virtual TAO_EC_ProxyPushSupplier_Collection*
+ create_proxy_push_supplier_collection (TAO_EC_Event_Channel_Base*) = 0;
+ virtual void
+ destroy_proxy_push_supplier_collection (TAO_EC_ProxyPushSupplier_Collection*) = 0;
+
+ /// Create and destroy the locking strategies for both
+ /// ProxyPushConsumers and ProxyPushSuppliers
+ virtual ACE_Lock* create_consumer_lock (void) = 0;
+ virtual void destroy_consumer_lock (ACE_Lock*) = 0;
+ virtual ACE_Lock* create_supplier_lock (void) = 0;
+ virtual void destroy_supplier_lock (ACE_Lock*) = 0;
+
+ /// The ConsumerControl and SupplierControl strategies are used to
+ /// discard non-existent consumers and suppliers
+ virtual TAO_EC_ConsumerControl*
+ create_consumer_control (TAO_EC_Event_Channel_Base*) = 0;
+ virtual void
+ destroy_consumer_control (TAO_EC_ConsumerControl*) = 0;
+ virtual TAO_EC_SupplierControl*
+ create_supplier_control (TAO_EC_Event_Channel_Base*) = 0;
+ virtual void
+ destroy_supplier_control (TAO_EC_SupplierControl*) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Filter.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Filter.cpp
new file mode 100644
index 00000000000..55f0de96038
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Filter.cpp
@@ -0,0 +1,130 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Filter.h"
+#include "orbsvcs/Event/EC_QOS_Info.h"
+
+#include "tao/ORB_Constants.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Filter.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Event,
+ EC_Filter,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Filter::~TAO_EC_Filter (void)
+{
+}
+
+void
+TAO_EC_Filter::adopt_child (TAO_EC_Filter* child)
+{
+ child->parent_ = this;
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Filter::begin (void) const
+{
+ return 0;
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Filter::end (void) const
+{
+ return 0;
+}
+
+int
+TAO_EC_Filter::size (void) const
+{
+ return 0;
+}
+
+void
+TAO_EC_Filter::get_qos_info (TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ ACE_UNUSED_ARG (qos_info);
+ ACE_THROW (CORBA::NO_IMPLEMENT (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+}
+
+// ****************************************************************
+
+int
+TAO_EC_Null_Filter::filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ // This is a leaf, no need to query any children, and we accept all
+ // events, so push it.
+ this->push (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ return 1;
+}
+
+int
+TAO_EC_Null_Filter::filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ // This is a leaf, no need to query any children, and we accept all
+ // events, so push it.
+ this->push_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ return 1;
+}
+
+void
+TAO_EC_Null_Filter::push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (this->parent () != 0)
+ this->parent ()->push (event, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Null_Filter::push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (this->parent () != 0)
+ this->parent ()->push_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Null_Filter::clear (void)
+{
+ // do nothing
+}
+
+CORBA::ULong
+TAO_EC_Null_Filter::max_event_size (void) const
+{
+ // @@ Is there a better way to express this?
+ return 0;
+}
+
+int
+TAO_EC_Null_Filter::can_match (const RtecEventComm::EventHeader&) const
+{
+ // @@ This method should be correctly so we can implement null
+ // filtering at the consumers but real filtering on the suppliers.
+ return 1;
+}
+
+int
+TAO_EC_Null_Filter::add_dependencies (
+ const RtecEventComm::EventHeader &,
+ const TAO_EC_QOS_Info &
+ ACE_ENV_ARG_DECL_NOT_USED)
+
+{
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Filter.h b/TAO/orbsvcs/orbsvcs/Event/EC_Filter.h
new file mode 100644
index 00000000000..d092917ab4e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Filter.h
@@ -0,0 +1,225 @@
+// -*- C++ -*-
+/**
+ * @file EC_Filter.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_FILTER_H
+#define TAO_EC_FILTER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventCommC.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_QOS_Info;
+
+/**
+ * @class TAO_EC_Filter
+ *
+ * @brief Abstract base class for the filter hierarchy.
+ *
+ * The per-consumer filtering mechanisms.
+ * The EC needs to filter data passed to the consumers, so it can
+ * correctly satisfy its subscription requirements.
+ * This filtering can include correlations, sequences, timeouts,
+ * etc. each consumer can request different filtering criteria.
+ * Different filtering objects are associated with each consumer,
+ * the filters are organized in a hierarchical structure,
+ * corresponding to the subscription "expression" that the events
+ * must satisfy.
+ * The hierarchy is constructed using the "Builder" pattern.
+ *
+ * <H2>Memory Management</H2>
+ * It does *not* assume ownership of its parent.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Filter
+{
+public:
+ /// constructor...
+ TAO_EC_Filter (void);
+
+ /// destructor...
+ virtual ~TAO_EC_Filter (void);
+
+ /// Obtain the parent of this filter.
+ TAO_EC_Filter* parent (void) const;
+
+ /// Become the parent of @a child.
+ void adopt_child (TAO_EC_Filter* child);
+
+ /// Matches two event headers.
+ /// @todo Should we strategize the algorithm used to match headers?
+ static int matches (const RtecEventComm::EventHeader& rhs,
+ const RtecEventComm::EventHeader& lhs);
+
+ typedef TAO_EC_Filter* value_type;
+ typedef TAO_EC_Filter* const const_value_type;
+ typedef const_value_type* ChildrenIterator;
+
+ /**
+ * STL-like iterators
+ * Filters follow the Composite pattern. All filters expose the same
+ * interface as if they all had children, but for simple filters the
+ * iterators return an empty range.
+ */
+ virtual ChildrenIterator begin (void) const;
+ virtual ChildrenIterator end (void) const;
+ virtual int size (void) const;
+
+ /**
+ * Filter this event, returns 1 if the event is accepted, 0
+ * otherwise.
+ * Notice that there are two versions of the method, if the event is
+ * not const then filter can take ownership of the event.
+ *
+ * @attention There seems to be a disparity in interfaces: Supplier
+ * always push event sets of size 1 to the EC_ProxyPushSupplier, and
+ * EC_Filters do not implement handling of sets of more than 1
+ * event. Then, why is this not enforced by the interface by having
+ * EC_ProxyPushSupplier take an event rather than a set?
+ */
+ virtual int filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL) = 0;
+ virtual int filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL) = 0;
+
+ /**
+ * This is called by the children when they accept an event and
+ * which to pass it up.
+ * Notice that there are two versions of the method, if the event is
+ * not const then filter can take ownership of the event.
+ */
+ virtual void push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL) = 0;
+ virtual void push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Clear any saved state, must reset and assume no events have been
+ /// received.
+ virtual void clear (void) = 0;
+
+ /// Returns the maximum size of the events pushed by this filter.
+ virtual CORBA::ULong max_event_size (void) const = 0;
+
+ /**
+ * Returns 0 if an event with that header could never be accepted.
+ * This can used by the suppliers to filter out consumers that
+ * couldn't possibly be interested in their events.
+ * The rt_info and
+ */
+ virtual int can_match (const RtecEventComm::EventHeader& header) const = 0;
+
+ /**
+ * This is used for computing the scheduling dependencies:
+ *
+ * Leaf filters check if the header could be matched, similar to the
+ * can_match() method; if it does they return 1, and 0 otherwise.
+ * Intermediate nodes always return 0.
+ *
+ * This is used to build precise dependencies between the suppliers
+ * and the leaf of the filters that accept that event. Notice that
+ * only the nodes doing scheduling recurse through the list, so in
+ * configurations that do no require scheduling the recursion stops
+ * fairly soon.
+ */
+ virtual int add_dependencies (const RtecEventComm::EventHeader& header,
+ const TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL) = 0;
+
+ /**
+ * Obtain the QOS information for this filter, the default
+ * implementation returns an invalid QOS. Only the filters that
+ * support scheduling information implement this method.
+ * @return Returns 0 on success and -1 on failure
+ */
+ virtual void get_qos_info (TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ /// The parent...
+ TAO_EC_Filter* parent_;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_EC_Null_Filter
+ *
+ * @brief A null filter
+ *
+ * This filter accepts any kind of event, it is useful for the
+ * implementation:
+ * a) Consumers that accept all events
+ * b) Consumers that trust the filtering done at the Supplier
+ * layer.
+ * c) Event Channels that don't do filtering (such as CosEC
+ * backends)
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Null_Filter : public TAO_EC_Filter
+{
+public:
+ /// Constructor.
+ TAO_EC_Null_Filter (void);
+
+ // = The TAO_EC_Filter methods, please check the documentation in
+ // TAO_EC_Filter.
+ virtual int filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual int filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void clear (void);
+ virtual CORBA::ULong max_event_size (void) const;
+ virtual int can_match (const RtecEventComm::EventHeader& header) const;
+ virtual int add_dependencies (const RtecEventComm::EventHeader& header,
+ const TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL);
+};
+
+// ****************************************************************
+
+// @@ Add more types of filters like:
+// - Events in a sequence.
+// - Events in a sequence with timeouts.
+// - Conjunction with timeout [as opposed to disjunction of
+// conjunction and a timeout]
+// - etc.
+
+// ****************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Filter.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_FILTER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Filter.i b/TAO/orbsvcs/orbsvcs/Event/EC_Filter.i
new file mode 100644
index 00000000000..a5b9e121522
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Filter.i
@@ -0,0 +1,45 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Filter::TAO_EC_Filter (void)
+ : parent_ (0)
+{
+}
+
+ACE_INLINE TAO_EC_Filter*
+TAO_EC_Filter::parent (void) const
+{
+ return this->parent_;
+}
+
+ACE_INLINE int
+TAO_EC_Filter::matches (const RtecEventComm::EventHeader& rhs,
+ const RtecEventComm::EventHeader& lhs)
+{
+ if ((rhs.source == 0 && rhs.type == 0)
+ || (lhs.source == 0 && lhs.type == 0))
+ return 1;
+
+ if (rhs.source == 0 || lhs.source == 0)
+ return rhs.type == lhs.type;
+
+ if (rhs.type == 0 || lhs.type == 0)
+ return rhs.source == lhs.source;
+
+ return (rhs.type == lhs.type && rhs.source == lhs.source);
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_EC_Null_Filter::TAO_EC_Null_Filter (void)
+{
+}
+
+// ****************************************************************
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Filter_Builder.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Filter_Builder.cpp
new file mode 100644
index 00000000000..07934456276
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Filter_Builder.cpp
@@ -0,0 +1,33 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Filter_Builder.h"
+#include "orbsvcs/Event/EC_Filter.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Filter_Builder.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_Filter_Builder, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Filter_Builder::~TAO_EC_Filter_Builder (void)
+{
+}
+
+// ****************************************************************
+
+TAO_EC_Null_Filter_Builder::~TAO_EC_Null_Filter_Builder (void)
+{
+}
+
+TAO_EC_Filter*
+TAO_EC_Null_Filter_Builder::build (
+ TAO_EC_ProxyPushSupplier *,
+ RtecEventChannelAdmin::ConsumerQOS&
+ ACE_ENV_ARG_DECL_NOT_USED) const
+{
+ return new TAO_EC_Null_Filter;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Filter_Builder.h b/TAO/orbsvcs/orbsvcs/Event/EC_Filter_Builder.h
new file mode 100644
index 00000000000..5d639e8d7e0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Filter_Builder.h
@@ -0,0 +1,92 @@
+// -*- C++ -*-
+/**
+ * @file EC_Filter_Builder.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_FILTER_BUILDER_H
+#define TAO_EC_FILTER_BUILDER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventChannelAdminC.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Filter;
+class TAO_EC_ProxyPushSupplier;
+
+/**
+ * @class TAO_EC_Filter_Builder
+ *
+ * @brief Abstract base class for the filter builders.
+ *
+ * The creation of a filter hierarchy is controlled by a
+ * Filter_Builder. The relationship between TAO_EC_Filter and
+ * TAO_EC_Filter_Builder follows the "Builder Pattern" (Gamma et
+ * al.)
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Filter_Builder
+{
+public:
+ /// destructor...
+ virtual ~TAO_EC_Filter_Builder (void);
+
+ /// Create the filter, the caller must assume ownership of the filter
+ /// returned.
+ virtual TAO_EC_Filter*
+ build (TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos
+ ACE_ENV_ARG_DECL) const = 0;
+
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_EC_Null_Filter_Builder
+ *
+ * @brief A simple implementation of the filter builder.
+ *
+ * Simply creates a Null_Filter in every case.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Null_Filter_Builder : public TAO_EC_Filter_Builder
+{
+public:
+ /// constructor.
+ TAO_EC_Null_Filter_Builder (void);
+
+ /// destructor...
+ virtual ~TAO_EC_Null_Filter_Builder (void);
+
+ // = The TAO_EC_Filter_Builder methods...
+ TAO_EC_Filter* build (TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos
+ ACE_ENV_ARG_DECL) const;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Filter_Builder.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_FILTER_BUILDER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Filter_Builder.i b/TAO/orbsvcs/orbsvcs/Event/EC_Filter_Builder.i
new file mode 100644
index 00000000000..89d32fe656e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Filter_Builder.i
@@ -0,0 +1,12 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Null_Filter_Builder::TAO_EC_Null_Filter_Builder (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway.cpp
new file mode 100644
index 00000000000..8addbb46165
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway.cpp
@@ -0,0 +1,32 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Gateway.h"
+
+ACE_RCSID (Event,
+ EC_Gateway,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Gateway::TAO_EC_Gateway (void)
+ : handle_ (0)
+{
+}
+
+TAO_EC_Gateway::~TAO_EC_Gateway (void)
+{
+}
+
+void
+TAO_EC_Gateway::observer_handle (RtecEventChannelAdmin::Observer_Handle h)
+{
+ this->handle_ = h;
+}
+
+RtecEventChannelAdmin::Observer_Handle
+TAO_EC_Gateway::observer_handle (void) const
+{
+ return this->handle_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway.h b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway.h
new file mode 100644
index 00000000000..965e6a9daf6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway.h
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Gateway.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_GATEWAY_H
+#define TAO_EC_GATEWAY_H
+
+#include /**/ "ace/pre.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#include "orbsvcs/RtecEventChannelAdminS.h"
+#include "orbsvcs/RtecEventCommS.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Gateway
+ *
+ * @brief Event Channel Gateway
+ *
+ * There are several ways to connect several EC together, for
+ * instance:
+ * + A single class can use normal IIOP and connect to one EC as
+ * a supplier and to another EC as a consumer.
+ * + A class connects as a consumer and transmit the events using
+ * multicast, another class receives the multicast messages and
+ * transform them back into a push() call.
+ * This is an abstract class to represent all the different
+ * strategies for EC distribution.
+ *
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Gateway
+ : public POA_RtecEventChannelAdmin::Observer
+{
+public:
+ /// Default constructor.
+ TAO_EC_Gateway (void);
+
+ /// Destructor
+ virtual ~TAO_EC_Gateway (void);
+
+ /// The gateway must disconnect from all the relevant event channels,
+ /// or any other communication media (such as multicast groups).
+ virtual void close (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) = 0;
+
+ /// Obtain and modify the observer handle.
+ void observer_handle (RtecEventChannelAdmin::Observer_Handle h);
+ RtecEventChannelAdmin::Observer_Handle observer_handle (void) const;
+
+private:
+ RtecEventChannelAdmin::Observer_Handle handle_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* ACE_EC_GATEWAY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.cpp
new file mode 100644
index 00000000000..cf58d8cbd06
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.cpp
@@ -0,0 +1,715 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Gateway_IIOP.h"
+#include "orbsvcs/Event/ECG_Defaults.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Time_Utilities.h"
+
+#include "orbsvcs/Event/EC_Gateway_IIOP_Factory.h"
+#include "orbsvcs/Event/ECG_ConsumerEC_Control.h"
+
+#include "ace/Dynamic_Service.h"
+
+ACE_RCSID (Event,
+ EC_Gateway_IIOP,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Gateway_IIOP::TAO_EC_Gateway_IIOP (void)
+ : busy_count_ (0),
+ update_posted_ (0),
+ cleanup_posted_ (0),
+ supplier_ec_suspended_ (0),
+ supplier_info_ (0),
+ consumer_info_ (0),
+ consumer_ (this),
+ consumer_is_active_ (0),
+ supplier_ (this),
+ supplier_is_active_ (0),
+ ec_control_ (0),
+ factory_ (0),
+ use_ttl_ (1),
+ use_consumer_proxy_map_ (1)
+{
+ if (this->factory_ == 0)
+ {
+ this->factory_ =
+ ACE_Dynamic_Service<TAO_EC_Gateway_IIOP_Factory>::instance ("EC_Gateway_IIOP_Factory");
+
+ if (this->factory_ == 0)
+ {
+ TAO_EC_Gateway_IIOP_Factory *f = 0;
+ ACE_NEW (f,
+ TAO_EC_Gateway_IIOP_Factory);
+ this->factory_ = f;
+ }
+ }
+
+ if (this->factory_ != 0)
+ {
+ this->use_ttl_ = this->factory_->use_ttl();
+ this->use_consumer_proxy_map_ = this->factory_->use_consumer_proxy_map();
+ }
+}
+
+TAO_EC_Gateway_IIOP::~TAO_EC_Gateway_IIOP (void)
+{
+ delete ec_control_;
+ ec_control_ = 0;
+}
+
+int
+TAO_EC_Gateway_IIOP::init (RtecEventChannelAdmin::EventChannel_ptr supplier_ec,
+ RtecEventChannelAdmin::EventChannel_ptr consumer_ec
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, -1);
+
+ return this->init_i (supplier_ec, consumer_ec ACE_ENV_ARG_PARAMETER);
+}
+
+int
+TAO_EC_Gateway_IIOP::init_i (RtecEventChannelAdmin::EventChannel_ptr supplier_ec,
+ RtecEventChannelAdmin::EventChannel_ptr consumer_ec
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ if (CORBA::is_nil (this->supplier_ec_.in ()) && CORBA::is_nil (this->consumer_ec_.in ()))
+ {
+ this->supplier_ec_ =
+ RtecEventChannelAdmin::EventChannel::_duplicate (supplier_ec);
+ this->consumer_ec_ =
+ RtecEventChannelAdmin::EventChannel::_duplicate (consumer_ec);
+
+ if (ec_control_ == 0)
+ {
+ ec_control_ = factory_->create_consumerec_control(this);
+ ec_control_->activate();
+ }
+
+ return 0;
+ }
+ else
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_EC_Gateway_IIOP - init_i "
+ "Supplier and consumer event channel reference "
+ "should be nil.\n"), -1);
+}
+
+void
+TAO_EC_Gateway_IIOP::close (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ this->close_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Gateway_IIOP::cleanup_consumer_proxies (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ // In case we are still pushing, don't cleanup the proxies
+ if (this->busy_count_ != 0)
+ {
+ this->cleanup_posted_ = 1;
+ return;
+ }
+
+ this->cleanup_consumer_proxies_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Gateway_IIOP::close_i (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // ACE_DEBUG ((LM_DEBUG, "ECG (%t) Closing gateway\n"));
+ this->disconnect_consumer_proxies_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->disconnect_supplier_proxy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Gateway_IIOP::disconnect_consumer_proxies_i (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->consumer_proxy_map_.current_size () > 0)
+ {
+ for (Consumer_Map_Iterator j = this->consumer_proxy_map_.begin ();
+ j != this->consumer_proxy_map_.end ();
+ ++j)
+ {
+ RtecEventComm::PushConsumer_ptr consumer = (*j).int_id_;
+ if (CORBA::is_nil (consumer))
+ continue;
+ ACE_TRY
+ {
+ consumer->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+ CORBA::release (consumer);
+ }
+ // Remove all the elements on the map. Calling close() does not
+ // work because the map is left in an inconsistent state.
+ this->consumer_proxy_map_.open ();
+ }
+
+ if (!CORBA::is_nil (this->default_consumer_proxy_.in ()))
+ {
+ this->default_consumer_proxy_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->default_consumer_proxy_ =
+ RtecEventChannelAdmin::ProxyPushConsumer::_nil ();
+ }
+}
+
+void
+TAO_EC_Gateway_IIOP::disconnect_supplier_proxy_i (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 ();
+ }
+}
+
+void
+TAO_EC_Gateway_IIOP::reconnect_consumer_ec(ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (this->busy_count_ != 0)
+ {
+ this->update_posted_ = 1;
+ return;
+ }
+
+ this->update_consumer_i (c_qos_ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Gateway_IIOP::update_consumer (
+ const RtecEventChannelAdmin::ConsumerQOS& c_qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (c_qos.dependencies.length () == 0)
+ return;
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ this->c_qos_ = c_qos;
+
+ if (this->busy_count_ != 0)
+ {
+ this->update_posted_ = 1;
+ return;
+ }
+
+ this->update_consumer_i (c_qos ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Gateway_IIOP::cleanup_consumer_proxies_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ if (this->consumer_proxy_map_.current_size () > 0)
+ {
+ for (Consumer_Map_Iterator j = this->consumer_proxy_map_.begin ();
+ j != this->consumer_proxy_map_.end ();
+ ++j)
+ {
+ RtecEventComm::PushConsumer_ptr consumer = (*j).int_id_;
+ if (CORBA::is_nil (consumer))
+ continue;
+
+ CORBA::release (consumer);
+ }
+ // Remove all the elements on the map. Calling close() does not
+ // work because the map is left in an inconsistent state.
+ this->consumer_proxy_map_.open ();
+ }
+
+ if (!CORBA::is_nil (this->default_consumer_proxy_.in ()))
+ {
+ this->default_consumer_proxy_ =
+ RtecEventChannelAdmin::ProxyPushConsumer::_nil ();
+ }
+}
+
+void
+TAO_EC_Gateway_IIOP::update_consumer_i (
+ const RtecEventChannelAdmin::ConsumerQOS& c_qos
+ ACE_ENV_ARG_DECL)
+{
+ this->close_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (this->consumer_ec_.in ())
+ || CORBA::is_nil (this->supplier_ec_.in ()))
+ return;
+
+ // ACE_DEBUG ((LM_DEBUG, "ECG (%t) update_consumer_i \n"));
+
+ this->open_i (c_qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Gateway_IIOP::open_i (
+ const RtecEventChannelAdmin::ConsumerQOS& c_qos
+ ACE_ENV_ARG_DECL)
+{
+ // = Connect as a supplier to the consumer EC
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ this->consumer_ec_->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::ConsumerQOS sub = c_qos;
+ sub.is_gateway = 1;
+
+ // Change the RT_Info in the consumer QoS.
+ // On the same loop we discover the subscriptions by event source,
+ // and fill the consumer proxy map if we have to use this map.
+ for (CORBA::ULong i = 0; i < sub.dependencies.length (); ++i)
+ {
+ sub.dependencies[i].rt_info = this->supplier_info_;
+
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr proxy = 0;
+ const RtecEventComm::EventHeader &h =
+ sub.dependencies[i].event.header;
+
+ RtecEventComm::EventSourceID sid = h.source;
+
+ //ACE_DEBUG ((LM_DEBUG,
+ // "ECG (%t) trying (%d,%d)\n",
+ // sid, h.type));
+
+ // Skip all subscriptions that do not require an specific source
+ // id or skip all subscriptions when we don't need to use the consumer
+ // proxy map.
+ if (sid == ACE_ES_EVENT_SOURCE_ANY || this->use_consumer_proxy_map_ == 0)
+ continue;
+
+ // Skip all the magic event types.
+ if (ACE_ES_EVENT_ANY < h.type && h.type < ACE_ES_EVENT_UNDEFINED)
+ continue;
+
+ if (this->consumer_proxy_map_.find (sid, proxy) == -1)
+ {
+ //ACE_DEBUG ((LM_DEBUG,
+ // "ECG (%t) binding source %d\n",
+ // sid));
+ proxy = supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->consumer_proxy_map_.bind (sid, proxy);
+ }
+ }
+ //ACE_DEBUG ((LM_DEBUG,
+ // "ECG (%t) consumer map computed (%d entries)\n",
+ // this->consumer_proxy_map_.current_size ()));
+
+ if (this->consumer_proxy_map_.current_size () > 0)
+ {
+ this->supplier_is_active_ = 1;
+
+ // Obtain a reference to our supplier personality...
+ RtecEventComm::PushSupplier_var supplier_ref =
+ this->supplier_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // For each subscription by source build the set of publications
+ // (they may several, by type, for instance) and connect to the
+ // consumer proxy.
+ for (Consumer_Map_Iterator j = this->consumer_proxy_map_.begin ();
+ j != this->consumer_proxy_map_.end ();
+ ++j)
+ {
+ RtecEventChannelAdmin::SupplierQOS pub;
+ pub.publications.length (sub.dependencies.length () + 1);
+ pub.is_gateway = 1;
+
+ int c = 0;
+
+ RtecEventComm::EventSourceID sid = (*j).ext_id_;
+ for (CORBA::ULong k = 0; k < sub.dependencies.length (); ++k)
+ {
+ const RtecEventComm::EventHeader& h =
+ sub.dependencies[k].event.header;
+ if (h.source != sid
+ || (ACE_ES_EVENT_ANY < h.type
+ && h.type < ACE_ES_EVENT_UNDEFINED))
+ continue;
+ pub.publications[c].event.header = h;
+ pub.publications[c].dependency_info.dependency_type =
+ RtecBase::TWO_WAY_CALL;
+ pub.publications[c].dependency_info.number_of_calls = 1;
+ pub.publications[c].dependency_info.rt_info = this->consumer_info_;
+ c++;
+ }
+ //ACE_DEBUG ((LM_DEBUG,
+ // "ECG (%t) supplier id %d has %d elements\n",
+ // sid, c));
+ if (c == 0)
+ continue;
+
+ pub.publications.length (c);
+
+ // ACE_DEBUG ((LM_DEBUG, "ECG (%P|%t) Gateway/Supplier "));
+ // ACE_SupplierQOS_Factory::debug (pub);
+ (*j).int_id_->connect_push_supplier (supplier_ref.in (),
+ pub
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+
+ // Also build the subscriptions that are *not* by source when we use the
+ // consumer proxy map, and all subscriptions when we don't use the map and
+ // then connect to the default consumer proxy.
+ RtecEventChannelAdmin::SupplierQOS pub;
+ pub.publications.length (sub.dependencies.length () + 1);
+ pub.is_gateway = 1;
+ int c = 0;
+ for (CORBA::ULong k = 0; k < sub.dependencies.length (); ++k)
+ {
+ const RtecEventComm::EventHeader& h =
+ sub.dependencies[k].event.header;
+ RtecEventComm::EventSourceID sid = h.source;
+
+ // Skip all subscriptions with a specific source when we use the map
+ if (sid != ACE_ES_EVENT_SOURCE_ANY && this->use_consumer_proxy_map_ == 1)
+ continue;
+
+ // Skip all the magic event types.
+ if (ACE_ES_EVENT_ANY < h.type && h.type < ACE_ES_EVENT_UNDEFINED)
+ continue;
+
+ pub.publications[c].event.header = h;
+ pub.publications[c].event.header.creation_time = ORBSVCS_Time::zero ();
+ pub.publications[c].dependency_info.dependency_type =
+ RtecBase::TWO_WAY_CALL;
+ pub.publications[c].dependency_info.number_of_calls = 1;
+ pub.publications[c].dependency_info.rt_info = this->consumer_info_;
+ c++;
+ }
+
+ if (c > 0)
+ {
+ this->supplier_is_active_ = 1;
+
+ // Obtain a reference to our supplier personality...
+ RtecEventComm::PushSupplier_var supplier_ref =
+ this->supplier_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Obtain the consumer....
+ this->default_consumer_proxy_ =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ pub.publications.length (c);
+ // ACE_DEBUG ((LM_DEBUG, "ECG (%t) Gateway/Supplier "));
+ // ACE_SupplierQOS_Factory::debug (pub);
+ this->default_consumer_proxy_->connect_push_supplier (supplier_ref.in (),
+ pub
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ this->supplier_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;
+
+ this->consumer_is_active_ = 1;
+ RtecEventComm::PushConsumer_var consumer_ref =
+ this->consumer_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // ACE_DEBUG ((LM_DEBUG, "ECG (%P|%t) Gateway/Consumer "));
+ // ACE_ConsumerQOS_Factory::debug (sub);
+
+ this->supplier_proxy_->connect_push_consumer (consumer_ref.in (),
+ sub
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Gateway_IIOP::update_supplier (
+ const RtecEventChannelAdmin::SupplierQOS&
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Do nothing...
+}
+
+void
+TAO_EC_Gateway_IIOP::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ // ACE_DEBUG ((LM_DEBUG,
+ // "ECG (%t): Supplier-consumer received "
+ // "disconnect from channel.\n"));
+}
+
+void
+TAO_EC_Gateway_IIOP::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ // ACE_DEBUG ((LM_DEBUG,
+ // "ECG (%t): Supplier received "
+ // "disconnect from channel.\n"));
+}
+
+void
+TAO_EC_Gateway_IIOP::push (const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL)
+{
+ // ACE_DEBUG ((LM_DEBUG, "TAO_EC_Gateway_IIOP::push (%P|%t) - \n"));
+
+ if (events.length () == 0)
+ {
+ // ACE_DEBUG ((LM_DEBUG, "no events\n"));
+ return;
+ }
+
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ this->busy_count_++;
+ }
+
+ // ACE_DEBUG ((LM_DEBUG, "ECG: %d event(s)\n", events.length ()));
+
+ // @@ TODO, there is an extra data copy here, we should do the event
+ // modification without it and only compact the necessary events.
+ RtecEventComm::EventSet out (1);
+ out.length (1);
+ for (CORBA::ULong i = 0; i < events.length (); ++i)
+ {
+ if (this->use_ttl_ == 1)
+ {
+ if (events[i].header.ttl == 0)
+ continue;
+ }
+
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr proxy = 0;
+ RtecEventComm::EventSourceID sid = events[i].header.source;
+ if (sid == ACE_ES_EVENT_SOURCE_ANY || this->use_consumer_proxy_map_ == 0
+ || this->consumer_proxy_map_.find (sid, proxy) == -1)
+ {
+ // If the source is not in our map or we should not use the map then
+ // use the default consumer proxy.
+ proxy = this->default_consumer_proxy_.in ();
+ }
+
+ if (CORBA::is_nil (proxy))
+ continue;
+
+ out[0] = events[i];
+
+ if (this->use_ttl_ == 1)
+ out[0].header.ttl--;
+
+ // ACE_DEBUG ((LM_DEBUG, "ECG: event sent to proxy\n"));
+ this->push_to_consumer(proxy, out ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ this->busy_count_--;
+
+ if (this->busy_count_ == 0 && this->cleanup_posted_ != 0)
+ {
+ this->cleanup_posted_ = 0;
+ this->cleanup_consumer_proxies_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (this->busy_count_ == 0 && this->update_posted_ != 0)
+ {
+ this->update_posted_ = 0;
+ this->update_consumer_i (this->c_qos_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+}
+
+void
+TAO_EC_Gateway_IIOP::push_to_consumer (
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer,
+ const RtecEventComm::EventSet& event
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ consumer->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, not_used)
+ {
+ ec_control_->event_channel_not_exist (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ec_control_->system_exception (this,
+ sysex
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Shouldn't happen.
+ }
+ ACE_ENDTRY;
+}
+
+int
+TAO_EC_Gateway_IIOP::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, -1);
+
+ ec_control_->shutdown();
+
+ this->close_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->supplier_is_active_)
+ {
+ PortableServer::POA_var poa =
+ this->supplier_._default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (&this->supplier_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ this->supplier_is_active_ = 0;
+ }
+
+ if (this->consumer_is_active_)
+ {
+ PortableServer::POA_var poa =
+ this->consumer_._default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (&this->consumer_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ this->consumer_is_active_ = 0;
+ }
+
+ this->cleanup_consumer_ec_i ();
+ this->cleanup_supplier_ec_i ();
+
+ return 0;
+}
+
+int
+TAO_EC_Gateway_IIOP::cleanup_consumer_ec (void)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, -1);
+
+ this->cleanup_consumer_ec_i ();
+
+ return 0;
+}
+
+int
+TAO_EC_Gateway_IIOP::cleanup_supplier_ec (void)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, -1);
+
+ this->cleanup_supplier_ec_i ();
+
+ return 0;
+}
+
+void
+TAO_EC_Gateway_IIOP::cleanup_consumer_ec_i (void)
+{
+ this->consumer_ec_ =
+ RtecEventChannelAdmin::EventChannel::_nil ();
+}
+
+void
+TAO_EC_Gateway_IIOP::cleanup_supplier_ec_i (void)
+{
+ this->supplier_ec_ =
+ RtecEventChannelAdmin::EventChannel::_nil ();
+}
+
+CORBA::Boolean
+TAO_EC_Gateway_IIOP::is_consumer_ec_connected_i (void) const
+{
+ return !CORBA::is_nil (this->consumer_ec_.in ());
+}
+
+CORBA::Boolean
+TAO_EC_Gateway_IIOP::consumer_ec_non_existent (
+ CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var consumer_ec;
+ {
+ ACE_GUARD_THROW_EX (
+ TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ disconnected = 0;
+ if (this->is_consumer_ec_connected_i () == 0)
+ {
+ disconnected = 1;
+ return 0;
+ }
+
+ consumer_ec = CORBA::Object::_duplicate (this->consumer_ec_.in ());
+ }
+
+#if (TAO_HAS_MINIMUM_CORBA == 0)
+ return consumer_ec->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER);
+#else
+ return 0;
+#endif /* TAO_HAS_MINIMUM_CORBA */
+}
+
+void
+TAO_EC_Gateway_IIOP::suspend_supplier_ec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (!CORBA::is_nil (this->supplier_proxy_.in ()) && supplier_ec_suspended_ == 0)
+ {
+ this->supplier_proxy_->suspend_connection (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_ec_suspended_ = 1;
+ }
+}
+
+void
+TAO_EC_Gateway_IIOP::resume_supplier_ec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (!CORBA::is_nil (this->supplier_proxy_.in ()) && supplier_ec_suspended_ == 1)
+ {
+ this->supplier_proxy_->resume_connection (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_ec_suspended_ = 0;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.h b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.h
new file mode 100644
index 00000000000..6f957042c3a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.h
@@ -0,0 +1,255 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Gateway_IIOP.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ * @author Johnny Willemsen (jwillemsen@remedy.nl)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_GATEWAY_IIOP_H
+#define TAO_EC_GATEWAY_IIOP_H
+
+#include /**/ "ace/pre.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+#include "orbsvcs/Event/EC_Gateway.h"
+
+#include "orbsvcs/RtecEventChannelAdminS.h"
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/Channel_Clients_T.h"
+
+#include "ace/Map_Manager.h"
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ECG_ConsumerEC_Control;
+class TAO_EC_Gateway_IIOP_Factory;
+
+/**
+ * @class TAO_EC_Gateway_IIOP
+ *
+ * @brief Event Channel Gateway using IIOP.
+ *
+ * This class mediates among two event channels, it connects as a consumer of
+ * events with a remote event channel, and as a supplier of events with the
+ * local EC. As a consumer it gives a QoS designed to only accept the events
+ * in which *local* consumers are interested. Eventually the local EC should
+ * create this object and compute its QoS in an automated manner; but this
+ * requires some way to filter out the peers registered as consumers,
+ * otherwise we will get loops in the QoS graph.
+ * It uses exactly the same set of events in the publications list
+ * when connected as a supplier.
+ *
+ * @note
+ * An alternative implementation would be to register with the
+ * remote EC as a supplier, and then filter on the remote EC, but
+ * one of the objectives is to minimize network traffic.
+ * On the other hand the events will be pushed to remote consumers,
+ * event though they will be dropped upon receipt (due to the TTL
+ * field); IMHO this is another suggestion that the EC needs to know
+ * (somehow) which consumers are truly its peers in disguise.
+ *
+ * @todo: The class makes an extra copy of the events, we need to
+ * investigate if closer collaboration with its collocated EC could
+ * be used to remove that copy.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Gateway_IIOP : public TAO_EC_Gateway
+{
+public:
+ TAO_EC_Gateway_IIOP (void);
+ virtual ~TAO_EC_Gateway_IIOP (void);
+
+ /**
+ * To do its job this class requires to know the local and remote ECs it will
+ * connect to.
+ * @return 0 in case of success, -1 in case of failure
+ */
+ int init (RtecEventChannelAdmin::EventChannel_ptr supplier_ec,
+ RtecEventChannelAdmin::EventChannel_ptr consumer_ec
+ ACE_ENV_ARG_DECL);
+
+ /// The channel is disconnecting.
+ void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// The channel is disconnecting.
+ void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// This is the consumer side behavior, it pushes the events to the
+ /// local event channel.
+ void push (const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Disconnect and shutdown the gateway
+ int shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ // The following methods are documented in the base class.
+ virtual void close (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ virtual void update_consumer (const RtecEventChannelAdmin::ConsumerQOS& sub
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void update_supplier (const RtecEventChannelAdmin::SupplierQOS& pub
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // Let the gateway reconnect itself to the consumer ec given exisiting QoS
+ void reconnect_consumer_ec(ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Check whether the consumer event channel is non existent or not
+ CORBA::Boolean consumer_ec_non_existent (CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Cleanup all consumer proxies we have without trying to tell the
+ * consumer that we are going to disconnect. This can be used to cleanup
+ * the consumer proxy administration in case we know that the consumers
+ * are all unreachable.
+ */
+ void cleanup_consumer_proxies (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Cleanup the connection to the consumer ec. Doesn't call anything on the
+ /// ec again, just set the object to nil
+ int cleanup_consumer_ec (void);
+
+ /// Cleanup the connection to the supplier ec. Doesn't call anything on the
+ /// ec again, just set the object to nil
+ int cleanup_supplier_ec (void);
+
+ /// Suspend the connection to the supplier ec
+ void suspend_supplier_ec (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Resume the connection to the supplier ec
+ void resume_supplier_ec (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ void close_i (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Disconnect the supplier proxy
+ void disconnect_supplier_proxy_i (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Disconnect all consumer proxies
+ void disconnect_consumer_proxies_i (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Remove all consumer proxies without calling disconnect on them
+ void cleanup_consumer_proxies_i (ACE_ENV_SINGLE_ARG_DECL);
+
+ void update_consumer_i (const RtecEventChannelAdmin::ConsumerQOS& sub
+ ACE_ENV_ARG_DECL);
+
+ /// Create all connections to consumer ec and to supplier ec.
+ void open_i (const RtecEventChannelAdmin::ConsumerQOS& sub
+ ACE_ENV_ARG_DECL);
+
+ /// Helper method to see if consumer ec is connected
+ CORBA::Boolean is_consumer_ec_connected_i (void) const;
+
+ /// Push the @a event to the @a consumer.
+ void push_to_consumer (RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer,
+ const RtecEventComm::EventSet& event ACE_ENV_ARG_DECL);
+
+ void cleanup_consumer_ec_i (void);
+
+ void cleanup_supplier_ec_i (void);
+
+protected:
+ /// Do the real work in init()
+ int init_i (RtecEventChannelAdmin::EventChannel_ptr supplier_ec,
+ RtecEventChannelAdmin::EventChannel_ptr consumer_ec
+ ACE_ENV_ARG_DECL);
+
+protected:
+ /// Lock to synchronize internal changes
+ TAO_SYNCH_MUTEX lock_;
+
+ /// How many threads are running push() we cannot make changes until
+ /// that reaches 0
+ CORBA::ULong busy_count_;
+
+ /**
+ * An update_consumer() message arrived *while* we were doing a
+ * push() the modification is stored, if multiple update_consumer messages
+ * arrive only the last one is executed.
+ */
+ int update_posted_;
+ RtecEventChannelAdmin::ConsumerQOS c_qos_;
+
+ /**
+ * We have a cleanup outstanding and must wait doing cleanup until all pushes
+ * are ready.
+ */
+ int cleanup_posted_;
+
+ /**
+ * Is the supplier ec suspended?
+ */
+ int supplier_ec_suspended_;
+
+ /// The event channel acting as supplier for this gateway so we can reconnect
+ /// when the list changes.
+ RtecEventChannelAdmin::EventChannel_var supplier_ec_;
+
+ /// The event channel acting as consumer of this gateway
+ RtecEventChannelAdmin::EventChannel_var consumer_ec_;
+
+ /// Our RT_Infos for the event channel that is the supplier.
+ RtecBase::handle_t supplier_info_;
+ /// Our RT_Infos for the event channel that is the consumer.
+ RtecBase::handle_t consumer_info_;
+
+ /// Our consumer personality....
+ ACE_PushConsumer_Adapter<TAO_EC_Gateway_IIOP> consumer_;
+
+ /// If it is not 0 then we must deactivate the consumer
+ int consumer_is_active_;
+
+ /// Our supplier personality....
+ ACE_PushSupplier_Adapter<TAO_EC_Gateway_IIOP> supplier_;
+
+ /// If it is not 0 then we must deactivate the supplier
+ int supplier_is_active_;
+
+ // We use a different Consumer_Proxy
+ typedef ACE_Map_Manager<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex> Consumer_Map;
+ typedef ACE_Map_Iterator<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex> Consumer_Map_Iterator;
+
+ /// We talk to the EC (as a supplier) using either an per-supplier
+ /// proxy or a generic proxy for the type only subscriptions. We push the
+ /// events to these proxies
+ Consumer_Map consumer_proxy_map_;
+ RtecEventChannelAdmin::ProxyPushConsumer_var default_consumer_proxy_;
+
+ /// We talk to the EC (as a consumer) using this proxy. We receive the events
+ /// from these proxy
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+
+ /// The consumer ec control which controls the behaviour in case of a
+ /// misbehaving consumer ec
+ TAO_ECG_ConsumerEC_Control* ec_control_;
+
+ /// The Gateway IIOP Factory for all the settings
+ TAO_EC_Gateway_IIOP_Factory* factory_;
+
+ /// If 1, we use the TTL flags, if 0, we just ignore TTL
+ int use_ttl_;
+
+ /// The flag for using the consumer proxy map. With 1 the consumer proxy map
+ /// is used, meaning that for each unique source id we use a different
+ /// proxy push consumer, if 0, we only use one proxy push consumer (the
+ /// default) for all source ids.
+ int use_consumer_proxy_map_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* ACE_EC_GATEWAY_IIOP_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP_Factory.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP_Factory.cpp
new file mode 100644
index 00000000000..ec6b0f935ca
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP_Factory.cpp
@@ -0,0 +1,212 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Gateway_IIOP_Factory.h"
+#include "orbsvcs/Event/ECG_Defaults.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Time_Utilities.h"
+
+#include "ace/Dynamic_Service.h"
+#include "ace/Arg_Shifter.h"
+
+#include "orbsvcs/Event/ECG_ConsumerEC_Control.h"
+#include "orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.h"
+#include "orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.h"
+#include "orbsvcs/Event/EC_Gateway_IIOP.h"
+#include "ace/OS_NS_strings.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Gateway_IIOP_Factory.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Event,
+ EC_Gateway_IIOP_Factory,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int
+TAO_EC_Gateway_IIOP_Factory::init_svcs (void)
+{
+ return ACE_Service_Config::static_svcs ()->
+ insert (&ace_svc_desc_TAO_EC_Gateway_IIOP_Factory);
+}
+
+TAO_EC_Gateway_IIOP_Factory::TAO_EC_Gateway_IIOP_Factory (void)
+ : orbid_ (TAO_ECG_DEFAULT_IIOP_ORB_ID),
+ consumer_ec_control_ (TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL),
+ consumer_ec_control_period_ (TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL_PERIOD),
+ consumer_ec_control_timeout_ (TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL_TIMEOUT),
+ use_ttl_ (TAO_ECG_DEFAULT_IIOP_USE_TTL),
+ use_consumer_proxy_map_ (TAO_ECG_DEFAULT_IIOP_USE_CONSUMER_PROXY_MAP)
+{
+}
+
+TAO_EC_Gateway_IIOP_Factory::~TAO_EC_Gateway_IIOP_Factory (void)
+{
+}
+
+int
+TAO_EC_Gateway_IIOP_Factory::fini (void)
+{
+ return 0;
+}
+
+int
+TAO_EC_Gateway_IIOP_Factory::init (int argc, char* argv[])
+{
+ int result = 0;
+
+ 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, ACE_TEXT("-ECGIIOPConsumerECControl")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ this->consumer_ec_control_ = 0;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
+ this->consumer_ec_control_ = 1;
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("reconnect")) == 0)
+ this->consumer_ec_control_ = 2;
+ else
+ this->unsupported_option_value ("-ECGIIOPConsumerECControl", opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECGIIOPConsumerECControlPeriod")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ this->consumer_ec_control_period_ = ACE_OS::atoi (opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECGIIOPConsumerECControlTimeout")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ unsigned long timeout = ACE_OS::strtoul(opt, 0, 10);
+ this->consumer_ec_control_timeout_.usec(timeout);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECGIIOPUseORBId")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ // Save argument for later use
+ this->orbid_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECGIIOPUseTTL")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ this->use_ttl_ = ACE_OS::atoi (opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECGIIOPUseConsumerProxyMap")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ this->use_consumer_proxy_map_ = ACE_OS::atoi (opt);
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else
+ {
+ arg_shifter.ignore_arg ();
+ ACE_DEBUG ((LM_WARNING,
+ "Ignoring <%s> option "
+ "during initialization.\n",
+ arg));
+ result = -1;
+ }
+ }
+
+ return result;
+}
+
+void
+TAO_EC_Gateway_IIOP_Factory::unsupported_option_value (const char * option_name,
+ const char * option_value)
+{
+ ACE_ERROR ((LM_ERROR,
+ "EC_Gateway_IIOP_Factory -"
+ "Unsupported <%s> option value: <%s>. "
+ "Ignoring this option - using defaults instead.\n",
+ option_name,
+ option_value));
+}
+
+TAO_ECG_ConsumerEC_Control*
+TAO_EC_Gateway_IIOP_Factory::create_consumerec_control (TAO_EC_Gateway_IIOP* gateway)
+{
+ if (this->consumer_ec_control_ == 0)
+ return new TAO_ECG_ConsumerEC_Control ();
+ else if (this->consumer_ec_control_ == 1)
+ {
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, this->orbid_.c_str ());
+ ACE_Time_Value rate (0, this->consumer_ec_control_period_);
+ return new TAO_ECG_Reactive_ConsumerEC_Control (rate, consumer_ec_control_timeout_, gateway, orb.in ());
+ }
+ else if (this->consumer_ec_control_ == 2)
+ {
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, this->orbid_.c_str ());
+ ACE_Time_Value rate (0, this->consumer_ec_control_period_);
+ return new TAO_ECG_Reconnect_ConsumerEC_Control (rate, consumer_ec_control_timeout_, gateway, orb.in ());
+ }
+ return 0;
+}
+
+void
+TAO_EC_Gateway_IIOP_Factory::destroy_consumerec_control (
+ TAO_ECG_ConsumerEC_Control* x)
+{
+ delete x;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DEFINE (TAO_EC_Gateway_IIOP_Factory,
+ ACE_TEXT ("EC_Gateway_IIOP_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_EC_Gateway_IIOP_Factory),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
+ACE_FACTORY_DEFINE (TAO_RTEvent_Serv, TAO_EC_Gateway_IIOP_Factory)
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP_Factory.h b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP_Factory.h
new file mode 100644
index 00000000000..2a1c30a10a0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP_Factory.h
@@ -0,0 +1,115 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Gateway_IIOP_Factory.h
+ *
+ * $Id$
+ *
+ * @author Johnny Willemsen (jwillemsen@remedy.nl)
+ *
+ */
+
+#ifndef TAO_EC_GATEWAY_IIOP_FACTORY_H
+#define TAO_EC_GATEWAY_IIOP_FACTORY_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/Time_Value.h"
+#include "ace/Service_Object.h"
+#include "ace/SString.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ECG_ConsumerEC_Control;
+class TAO_EC_Gateway_IIOP;
+
+/**
+ * @class TAO_EC_Gateway_IIOP_Factory
+ *
+ * @brief Factory for the EC_Gateway_IIOP settings
+ *
+ * Default configuration values can be found in ECG_Defaults.h
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Gateway_IIOP_Factory
+ : public ACE_Service_Object
+{
+public:
+ TAO_EC_Gateway_IIOP_Factory (void);
+ virtual ~TAO_EC_Gateway_IIOP_Factory (void);
+
+ /// The Service_Object entry points.
+ //@{
+ virtual int init (int argc, char* argv[]);
+ virtual int fini (void);
+ //@}
+
+ /// Helper function to register the Gateway into the service
+ /// configurator.
+ static int init_svcs (void);
+
+ /// Create the consumer event channel control.
+ TAO_ECG_ConsumerEC_Control *
+ create_consumerec_control (TAO_EC_Gateway_IIOP* gateway);
+
+ /// Destroy consumer event channel control.
+ void destroy_consumerec_control (TAO_ECG_ConsumerEC_Control* x);
+
+ /// Accessors to use_ttl flag
+ int use_ttl (void) const;
+
+ /// Accessors to use_consumer_proxy_map flag
+ int use_consumer_proxy_map (void) const;
+
+private:
+ /// Helper for agrument parsing. Prints out an error message about
+ /// unsupported option value.
+ void unsupported_option_value (const char * option_name,
+ const char * option_value);
+
+protected:
+ /// Use this ORB to locate global resources.
+ ACE_CString orbid_;
+
+ /// The control policy for the consumer event channel
+ int consumer_ec_control_;
+
+ /// The consumer event channel control periods in usecs
+ int consumer_ec_control_period_;
+
+ /// The control timeout in usecs for the consumer event channel
+ ACE_Time_Value consumer_ec_control_timeout_;
+
+ /// If 1, we use the TTL flags, if 0, we just ignore TTL.
+ /// @note When this flag is set to 0, make sure that no recursive structures
+ /// exists in the gateway setup for the same source/type combination, else
+ /// one event will flow continuosly through all gateways.
+ int use_ttl_;
+
+ /// The flag for using the consumer proxy map. With 1 the consumer proxy map
+ /// is used, meaning that for each unique source id we use a different
+ /// proxy push consumer, if 0, we only use one proxy push consumer for all
+ /// source ids.
+ int use_consumer_proxy_map_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (TAO_EC_Gateway_IIOP_Factory)
+ACE_FACTORY_DECLARE (TAO_RTEvent_Serv, TAO_EC_Gateway_IIOP_Factory)
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Gateway_IIOP_Factory.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_GATEWAY_IIOP_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP_Factory.i b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP_Factory.i
new file mode 100644
index 00000000000..45dbd3f9d3f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP_Factory.i
@@ -0,0 +1,19 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE int
+TAO_EC_Gateway_IIOP_Factory::use_ttl (void) const
+{
+ return this->use_ttl_;
+}
+
+ACE_INLINE int
+TAO_EC_Gateway_IIOP_Factory::use_consumer_proxy_map (void) const
+{
+ return this->use_consumer_proxy_map_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_Sched.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_Sched.cpp
new file mode 100644
index 00000000000..1b1a0d4479e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_Sched.cpp
@@ -0,0 +1,82 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Gateway_Sched.h"
+#include "orbsvcs/Time_Utilities.h"
+
+ACE_RCSID (Event,
+ EC_Gateway_sched,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Gateway_Sched::TAO_EC_Gateway_Sched (void)
+ : TAO_EC_Gateway_IIOP ()
+{
+}
+
+TAO_EC_Gateway_Sched::~TAO_EC_Gateway_Sched (void)
+{
+}
+
+void
+TAO_EC_Gateway_Sched::init (RtecEventChannelAdmin::EventChannel_ptr supplier_ec,
+ RtecEventChannelAdmin::EventChannel_ptr consumer_ec,
+ RtecScheduler::Scheduler_ptr supplier_sched,
+ RtecScheduler::Scheduler_ptr consumer_sched,
+ const char* consumer_name,
+ const char* supplier_name
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ this->init_i (supplier_ec, consumer_ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ Should we throw a system exception here?
+ if (CORBA::is_nil (supplier_sched)
+ || CORBA::is_nil (consumer_sched)
+ || consumer_name == 0
+ || supplier_name == 0)
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ this->supplier_info_ =
+ supplier_sched->create (supplier_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ TODO Many things are hard-coded in the RT_Info here.
+
+ // The worst case execution time is far less than 500 usecs, but
+ // that is a safe estimate....
+ ACE_Time_Value tv (0, 500);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+ supplier_sched->set (this->supplier_info_,
+ RtecScheduler::VERY_HIGH_CRITICALITY,
+ time, time, time,
+ 25000 * 10,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ time,
+ 0,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_info_ =
+ consumer_sched->create (consumer_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ tv = ACE_Time_Value (0, 500);
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+ consumer_sched->set (this->consumer_info_,
+ RtecScheduler::VERY_HIGH_CRITICALITY,
+ time, time, time,
+ 25000 * 10,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ time,
+ 1,
+ RtecScheduler::REMOTE_DEPENDANT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_Sched.h b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_Sched.h
new file mode 100644
index 00000000000..5267546de17
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_Sched.h
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+/**
+ * @file EC_Gateway_Sched.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ *
+ *
+ */
+
+#ifndef TAO_EC_GATEWAY_SCHED_H
+#define TAO_EC_GATEWAY_SCHED_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Gateway_IIOP.h"
+#include "orbsvcs/RtecSchedulerC.h"
+#include "orbsvcs/Event/sched_event_export.h"
+
+// ****************************************************************
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Gateway_Sched
+ *
+ * @brief Extend the EC_Gateway_IIOP interface to support scheduling.
+ */
+class TAO_RTSchedEvent_Export TAO_EC_Gateway_Sched : public TAO_EC_Gateway_IIOP
+{
+public:
+ TAO_EC_Gateway_Sched (void);
+ ~TAO_EC_Gateway_Sched (void);
+
+ /**
+ * To do its job this class requires to know the local and remote
+ * ECs it will connect to; furthermore it also requires to build
+ * RT_Infos for the local and remote schedulers.
+ * @todo part of the RT_Info is hardcoded, we need to make it
+ * parametric.
+ */
+ void init (RtecEventChannelAdmin::EventChannel_ptr supplier_ec,
+ RtecEventChannelAdmin::EventChannel_ptr consumer_ec,
+ RtecScheduler::Scheduler_ptr supplier_sched,
+ RtecScheduler::Scheduler_ptr consumer_sched,
+ const char* consumer_name,
+ const char* supplier_name
+ ACE_ENV_ARG_DECL);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* ACE_EC_GATEWAY_SCHED_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Group_Scheduling.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Group_Scheduling.cpp
new file mode 100644
index 00000000000..9e39ef1f631
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Group_Scheduling.cpp
@@ -0,0 +1,32 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Group_Scheduling.h"
+#include "orbsvcs/Event/EC_QOS_Info.h"
+#include "orbsvcs/Event/EC_Supplier_Filter.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Group_Scheduling.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_Group_Scheduling, "$Id$")
+
+void
+TAO_EC_Group_Scheduling::add_proxy_supplier_dependencies (
+ TAO_EC_ProxyPushSupplier *,
+ TAO_EC_ProxyPushConsumer *
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_Group_Scheduling::schedule_event (const RtecEventComm::EventSet &event,
+ TAO_EC_ProxyPushConsumer *,
+ TAO_EC_Supplier_Filter *filter
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EC_QOS_Info event_info;
+ // @@ yuck...
+ filter->push_scheduled_event (const_cast<RtecEventComm::EventSet&> (event),
+ event_info
+ ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Group_Scheduling.h b/TAO/orbsvcs/orbsvcs/Event/EC_Group_Scheduling.h
new file mode 100644
index 00000000000..1a9b35f07e2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Group_Scheduling.h
@@ -0,0 +1,56 @@
+/* -*- C++ -*- */
+/**
+ * @file EC_Group_Scheduling.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_GROUP_SCHEDULING_H
+#define TAO_EC_GROUP_SCHEDULING_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Scheduling_Strategy.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class TAO_EC_Group_Scheduling
+ *
+ * @brief A scheduling strategy that preserves event groups.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Group_Scheduling : public TAO_EC_Scheduling_Strategy
+{
+public:
+ /// Constructor.
+ TAO_EC_Group_Scheduling (void);
+
+ // Read EC_Scheduling_Strategy.h for more details
+ virtual void add_proxy_supplier_dependencies (
+ TAO_EC_ProxyPushSupplier *supplier,
+ TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL);
+ virtual void schedule_event (const RtecEventComm::EventSet &event,
+ TAO_EC_ProxyPushConsumer *consumer,
+ TAO_EC_Supplier_Filter *filter
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_Group_Scheduling (const TAO_EC_Group_Scheduling&);
+ TAO_EC_Group_Scheduling& operator= (const TAO_EC_Group_Scheduling&);
+};
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Group_Scheduling.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_GROUP_SCHEDULING_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Group_Scheduling.inl b/TAO/orbsvcs/orbsvcs/Event/EC_Group_Scheduling.inl
new file mode 100644
index 00000000000..e918d295929
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Group_Scheduling.inl
@@ -0,0 +1,7 @@
+// $Id$
+
+ACE_INLINE
+TAO_EC_Group_Scheduling::TAO_EC_Group_Scheduling (void)
+{
+}
+
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Dispatching.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Dispatching.cpp
new file mode 100644
index 00000000000..206d87f18a2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Dispatching.cpp
@@ -0,0 +1,210 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Kokyu_Dispatching.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_QOS_Info.h"
+
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/RtecSchedulerC.h"
+#include "tao/ORB_Constants.h"
+
+#include "ace/Sched_Params.h"
+#include "ace/Malloc_Allocator.h"
+
+#include "Kokyu/Kokyu.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Kokyu_Dispatching.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Event,
+ EC_Kokyu_Dispatching,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Kokyu_Dispatching::TAO_EC_Kokyu_Dispatching (TAO_EC_Event_Channel_Base *ec, int sched_policy, int sched_scope)
+ :allocator_ (0),
+ dispatcher_ (0),
+ lanes_setup_ (0),
+ disp_sched_policy_ (sched_policy),
+ disp_sched_scope_ (sched_scope)
+{
+ CORBA::Object_var tmp = ec->scheduler ();
+ this->scheduler_ = RtecScheduler::Scheduler::_narrow (tmp.in ());
+
+ //@@VS - need to revisit this - should be some other allocator
+ if (this->allocator_ == 0)
+ {
+ this->allocator_ = ACE_Allocator::instance ();
+ }
+}
+
+void
+TAO_EC_Kokyu_Dispatching::activate (void)
+{
+ if (!lanes_setup_)
+ setup_lanes ();
+
+ this->dispatcher_->activate ();
+
+ //ACE_DEBUG ((LM_DEBUG, "Kokyu dispatcher activated\n"));
+}
+
+void
+TAO_EC_Kokyu_Dispatching::setup_lanes (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ // Query the scheduler togetConfig_Infos
+ RtecScheduler::Config_Info_Set_var configs;
+ ACE_TRY
+ {
+ this->scheduler_->get_config_infos(configs.out());
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions..
+ }
+ ACE_ENDTRY;
+
+ //might be no Config_Infos in the set (if none passed to scheduler_)
+
+ // Convert RtecScheduler::Config_Info_Set to Kokyu::ConfigInfoSet
+ // OK to assume exact correspondence betwen Config_Info and ConfigInfo?
+ Kokyu::ConfigInfoSet kconfigs(configs->length());
+ for(CORBA::ULong i=0; i<configs->length(); ++i) {
+ kconfigs[i].preemption_priority_ = configs[i].preemption_priority;
+ kconfigs[i].thread_priority_ = configs[i].thread_priority;
+ switch (configs[i].dispatching_type) {
+ case RtecScheduler::STATIC_DISPATCHING:
+ kconfigs[i].dispatching_type_ = Kokyu::FIFO_DISPATCHING;
+ break;
+ case RtecScheduler::DEADLINE_DISPATCHING:
+ kconfigs[i].dispatching_type_ = Kokyu::DEADLINE_DISPATCHING;
+ break;
+ case RtecScheduler::LAXITY_DISPATCHING:
+ kconfigs[i].dispatching_type_ = Kokyu::LAXITY_DISPATCHING;
+ break;
+ }
+ }
+
+ Kokyu::Dispatcher_Attributes attrs;
+ attrs.config_info_set_ = kconfigs;
+ attrs.sched_policy (disp_sched_policy_);
+ attrs.sched_scope (disp_sched_scope_);
+
+ // Create Kokyu::Dispatcher using factory
+ Kokyu::Dispatcher_Auto_Ptr
+ tmp(Kokyu::Dispatcher_Factory::create_dispatcher(attrs));
+ this->dispatcher_ = tmp;
+ this->lanes_setup_ = 1;
+
+ //ACE_DEBUG ((LM_DEBUG, "Kokyu dispatcher setup\n"));
+}
+
+void
+TAO_EC_Kokyu_Dispatching::shutdown (void)
+{
+ this->dispatcher_->shutdown();
+}
+
+void
+TAO_EC_Kokyu_Dispatching::push (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventComm::EventSet event_copy = event;
+ this->push_nocopy (proxy, consumer, event_copy, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Kokyu_Dispatching::push_nocopy (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (this->dispatcher_.get () == 0)
+ this->setup_lanes ();
+
+ void* buf =
+ this->allocator_->malloc (sizeof (TAO_EC_Kokyu_Push_Command ));
+
+ if (buf == 0)
+ ACE_THROW (CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+
+ // Create Dispatch_Command
+ TAO_EC_Kokyu_Push_Command *cmd =
+ new (buf) TAO_EC_Kokyu_Push_Command (proxy,
+ consumer,
+ event, this->allocator_);
+
+ /*
+ TAO_EC_Kokyu_Push_Command *cmd =
+ new TAO_EC_Kokyu_Push_Command (proxy,
+ consumer,
+ event, 0);
+ */
+
+ // Convert TAO_EC_QOS_Info to QoSDescriptor
+ RtecScheduler::RT_Info *rt_info =
+ this->scheduler_->get(qos_info.rt_info);
+
+ Kokyu::QoSDescriptor qosd;
+ qosd.preemption_priority_ = rt_info->preemption_priority;
+ qosd.deadline_ = rt_info->period;
+ ORBSVCS_Time::TimeT_to_Time_Value (qosd.execution_time_,
+ rt_info->worst_case_execution_time);
+
+ this->dispatcher_->dispatch(cmd,qosd);
+}
+
+// ****************************************************************
+
+TAO_EC_Kokyu_Shutdown_Command::~TAO_EC_Kokyu_Shutdown_Command(void)
+{
+}
+
+int
+TAO_EC_Kokyu_Shutdown_Command::execute(void)
+{
+ return -1;
+}
+
+// ****************************************************************
+
+TAO_EC_Kokyu_Push_Command::~TAO_EC_Kokyu_Push_Command(void)
+{
+ this->proxy_->_decr_refcnt ();
+}
+
+int
+TAO_EC_Kokyu_Push_Command::execute ()
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ //ACE_DEBUG ((LM_DEBUG,
+ // "(%t) Command object executed.\n"));
+
+ this->proxy_->push_to_consumer (this->consumer_.in (),
+ this->event_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Dispatching.h b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Dispatching.h
new file mode 100644
index 00000000000..d9079a271ac
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Dispatching.h
@@ -0,0 +1,147 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Kokyu_Dispatching.h
+ *
+ * $Id$
+ *
+ * @author Bryan Thrall (thrall@cs.wustl.edu)
+ *
+ * Based on previous work by Carlos O'Ryan (coryan@cs.wustl.edu) and
+ * Tim Harrison (harrison@cs.wustl.edu) and other members of the DOC group.
+ * More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_KOKYU_DISPATCHING_H
+#define TAO_EC_KOKYU_DISPATCHING_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Dispatching.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RtecSchedulerC.h"
+#include "orbsvcs/Event/rtkokyu_event_export.h"
+
+#include "ace/Thread_Manager.h"
+
+#include "Kokyu/Kokyu.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Event_Channel_Base;
+
+/**
+ * @class TAO_EC_Kokyu_Dispatching
+ *
+ * @brief Dispatching strategy that minimizes priority inversion.
+ *
+ * This strategy uses multiple queues, each serviced by a thread
+ * at different priority. This minimizes priority inversion
+ * because the consumers at higher priority are serviced before
+ * consumers at lower priority.
+ * It is more flexible than using the supplier thread to dispatch
+ * because it allows high-priority suppliers to push events to
+ * low-priority consumers (and vice-versa).
+ * It also isolates the supplier threads from the time spent on
+ * upcalls to the consumer objects, making the system easier to
+ * analyze and schedule.
+ */
+class TAO_RTKokyuEvent_Export TAO_EC_Kokyu_Dispatching : public TAO_EC_Dispatching
+{
+public:
+ /// The scheduler is used to find the range of priorities and similar
+ /// info.
+ TAO_EC_Kokyu_Dispatching (TAO_EC_Event_Channel_Base* ec,
+ int sched_policy,
+ int sched_scope);
+
+ // = The EC_Dispatching methods.
+ virtual void activate (void);
+ virtual void shutdown (void);
+ virtual void push (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ ACE_Allocator *allocator_;
+
+ void setup_lanes (void);
+
+ /// The dispatcher
+ Kokyu::Dispatcher_Auto_Ptr dispatcher_;
+
+ /// The scheduler
+ RtecScheduler::Scheduler_var scheduler_;
+
+ int lanes_setup_;
+ int disp_sched_policy_;
+ int disp_sched_scope_;
+};
+
+// ****************************************************************
+
+class TAO_RTKokyuEvent_Export TAO_EC_Kokyu_Shutdown_Command : public Kokyu::Dispatch_Command
+{
+public:
+ /// Constructor
+ TAO_EC_Kokyu_Shutdown_Command (ACE_Allocator *allocator);
+
+ /// Command callback
+ virtual int execute (void);
+
+protected:
+ //Protected so can't be put on stack; must be dynamically allocated
+ virtual ~TAO_EC_Kokyu_Shutdown_Command (void);
+
+};
+
+// ****************************************************************
+
+class TAO_RTKokyuEvent_Export TAO_EC_Kokyu_Push_Command : public Kokyu::Dispatch_Command
+{
+public:
+ /// Constructor
+ TAO_EC_Kokyu_Push_Command (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event,
+ ACE_Allocator* allocator);
+
+ /// Command callback
+ virtual int execute (void);
+
+protected:
+ //Protected so can't be put on stack; must be dynamically allocated
+ virtual ~TAO_EC_Kokyu_Push_Command (void);
+
+private:
+ /// The proxy
+ TAO_EC_ProxyPushSupplier* proxy_;
+
+ /// The consumer connected to the proxy when the event was pushed.
+ RtecEventComm::PushConsumer_var consumer_;
+
+ /// The event
+ RtecEventComm::EventSet event_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Kokyu_Dispatching.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_KOKYU_DISPATCHING_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Dispatching.i b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Dispatching.i
new file mode 100644
index 00000000000..0c116874fad
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Dispatching.i
@@ -0,0 +1,42 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_EC_Kokyu_Shutdown_Command::
+TAO_EC_Kokyu_Shutdown_Command (ACE_Allocator*)
+ : Kokyu::Dispatch_Command ()
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_EC_Kokyu_Push_Command::TAO_EC_Kokyu_Push_Command (
+ TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event,
+ ACE_Allocator* allocator)
+ : Kokyu::Dispatch_Command (0,allocator),
+ proxy_ (proxy),
+ consumer_ (RtecEventComm::PushConsumer::_duplicate (consumer))
+{
+ //
+ // Efficient copy, steal the buffer from <event>
+ // We cannot do this on the initialization because get_buffer()
+ // could get called first, effectively setting maximum() and
+ // length() to 0!
+ //
+ CORBA::ULong maximum = event.maximum ();
+ CORBA::ULong length = event.length ();
+ RtecEventComm::Event* buffer = event.get_buffer (1);
+ event_.replace (maximum, length, buffer, 1);
+
+ this->proxy_->_incr_refcnt ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Factory.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Factory.cpp
new file mode 100644
index 00000000000..2df728b8920
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Factory.cpp
@@ -0,0 +1,272 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Kokyu_Factory.h"
+#include "orbsvcs/Event/EC_Kokyu_Dispatching.h"
+#include "orbsvcs/Event/EC_Kokyu_Scheduling.h"
+#include "orbsvcs/Event/EC_Kokyu_Filter_Builder.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/RtecSchedulerC.h"
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_strings.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Kokyu_Factory.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Event,
+ EC_Kokyu_Factory,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Kokyu_Factory::~TAO_EC_Kokyu_Factory (void)
+{
+}
+
+int
+TAO_EC_Kokyu_Factory::init_svcs (void)
+{
+ return ACE_Service_Config::static_svcs ()->
+ insert (&ace_svc_desc_TAO_EC_Kokyu_Factory);
+}
+
+int
+TAO_EC_Kokyu_Factory::init (int argc, ACE_TCHAR* argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ while (arg_shifter.is_anything_left ())
+ {
+ const ACE_TCHAR* arg = arg_shifter.get_current ();
+
+ if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECDispatching")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
+ {
+ this->dispatching_ = 0;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("mt")) == 0)
+ {
+ this->dispatching_ = 1;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("kokyu")) == 0)
+ {
+ this->dispatching_ = 2;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("EC_Kokyu_Factory - ")
+ ACE_TEXT("unsupported dispatching <%s>\n"),
+ opt));
+ }
+ arg_shifter.consume_arg ();
+ }
+ //if Kokyu dispatching - look for sched policy
+ if (this->dispatching_ == 2)
+ {
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("SCHED_FIFO")) == 0)
+ {
+ this->disp_sched_policy_ = ACE_SCHED_FIFO;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("SCHED_RR")) == 0)
+ {
+ this->disp_sched_policy_ = ACE_SCHED_RR;
+ }
+ else
+ {
+ this->disp_sched_policy_ = ACE_SCHED_OTHER;
+ }
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("SYSTEM")) == 0)
+ {
+ this->disp_sched_scope_ = ACE_SCOPE_THREAD;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("PROCESS")) == 0)
+ {
+ this->disp_sched_scope_ = ACE_SCOPE_PROCESS;
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECFiltering")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ {
+ this->filtering_ = 0;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("basic")) == 0)
+ {
+ this->filtering_ = 1;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("prefix")) == 0)
+ {
+ this->filtering_ = 2;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("kokyu")) == 0)
+ {
+ this->filtering_ = 3;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("EC_Kokyu_Factory - ")
+ ACE_TEXT("unsupported filtering <%s>\n"),
+ opt));
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECTimeout")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
+ {
+ this->timeout_ = 0;
+ }
+#if 0
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("kokyu")) == 0)
+ {
+ this->timeout_ = 1;
+ }
+#endif /* 0 */
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("EC_Kokyu_Factory - ")
+ ACE_TEXT("unsupported timeout <%s>\n"),
+ opt));
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECScheduling")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ {
+ this->scheduling_ = 0;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("group")) == 0)
+ {
+ this->scheduling_ = 1;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("kokyu")) == 0)
+ {
+ this->scheduling_ = 2;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("EC_Kokyu_Factory - ")
+ ACE_TEXT("unsupported scheduling <%s>\n"),
+ opt));
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+ return this->TAO_EC_Default_Factory::init (argc, argv);
+}
+
+int
+TAO_EC_Kokyu_Factory::fini (void)
+{
+ return 0;
+}
+
+// ****************************************************************
+
+TAO_EC_Dispatching*
+TAO_EC_Kokyu_Factory::create_dispatching (TAO_EC_Event_Channel_Base *ec)
+{
+ if (this->dispatching_ == 2)
+ return new TAO_EC_Kokyu_Dispatching (ec,
+ this->disp_sched_policy_,
+ this->disp_sched_scope_);
+ return this->TAO_EC_Default_Factory::create_dispatching (ec);
+}
+
+TAO_EC_Filter_Builder*
+TAO_EC_Kokyu_Factory::create_filter_builder (TAO_EC_Event_Channel_Base *ec)
+{
+ if (this->filtering_ == 3)
+ return new TAO_EC_Kokyu_Filter_Builder (ec);
+
+ return this->TAO_EC_Default_Factory::create_filter_builder (ec);
+}
+
+
+TAO_EC_Timeout_Generator*
+TAO_EC_Kokyu_Factory::create_timeout_generator (TAO_EC_Event_Channel_Base *ec)
+{
+#if 0
+ if (this->timeout_ == 1)
+ {
+ //Kokyu timeout generator?
+ }
+#endif
+ return this->TAO_EC_Default_Factory::create_timeout_generator (ec);
+}
+
+TAO_EC_Scheduling_Strategy*
+TAO_EC_Kokyu_Factory::create_scheduling_strategy (TAO_EC_Event_Channel_Base* ec)
+{
+ if (this->scheduling_ == 2)
+ {
+ CORBA::Object_var tmp = ec->scheduler ();
+ RtecScheduler::Scheduler_var scheduler =
+ RtecScheduler::Scheduler::_narrow (tmp.in ());
+ return new TAO_EC_Kokyu_Scheduling (scheduler.in ());
+ }
+ return this->TAO_EC_Default_Factory::create_scheduling_strategy (ec);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+ACE_STATIC_SVC_DEFINE (TAO_EC_Kokyu_Factory,
+ ACE_TEXT ("EC_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_EC_Kokyu_Factory),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
+ACE_FACTORY_DEFINE (TAO_RTKokyuEvent, TAO_EC_Kokyu_Factory)
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Factory.h b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Factory.h
new file mode 100644
index 00000000000..4e2f413ca42
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Factory.h
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+/**
+ * @file EC_Kokyu_Factory.h
+ *
+ * $Id$
+ *
+ * @author Bryan Thrall (thrall@cs.wustl.edu)
+ *
+ * Based on previous work by Carlos O'Ryan (coryan@cs.wustl.edu), Tim
+ * Harrison (harrison@cs.wustl.edu), Chris Gill (cdgill@cs.wustl.edu)
+ * and other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_KOKYU_FACTORY_H
+#define TAO_EC_KOKYU_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/rtkokyu_event_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Kokyu_Factory
+ *
+ * @brief Extend the default factory to support scheduling
+ *
+ */
+class TAO_RTKokyuEvent_Export TAO_EC_Kokyu_Factory : public TAO_EC_Default_Factory
+{
+public:
+ /// Constructor
+ TAO_EC_Kokyu_Factory (void);
+
+ /// Helper function to register the Kokyu factory into the service
+ /// configurator.
+ static int init_svcs (void);
+
+ /// destructor...
+ virtual ~TAO_EC_Kokyu_Factory (void);
+
+ // = The Service_Object entry points
+ virtual int init (int argc, ACE_TCHAR* argv[]);
+ virtual int fini (void);
+
+ // = The EC_Factory methods
+ virtual TAO_EC_Dispatching*
+ create_dispatching (TAO_EC_Event_Channel_Base*);
+ virtual TAO_EC_Filter_Builder*
+ create_filter_builder (TAO_EC_Event_Channel_Base*);
+ virtual TAO_EC_Timeout_Generator*
+ create_timeout_generator (TAO_EC_Event_Channel_Base*);
+ virtual TAO_EC_Scheduling_Strategy*
+ create_scheduling_strategy (TAO_EC_Event_Channel_Base*);
+
+private:
+ int disp_sched_policy_;
+ int disp_sched_scope_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Kokyu_Factory.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_STATIC_SVC_DECLARE (TAO_EC_Kokyu_Factory)
+ACE_FACTORY_DECLARE (TAO_RTKokyuEvent, TAO_EC_Kokyu_Factory)
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_KOKYU_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Factory.i b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Factory.i
new file mode 100644
index 00000000000..7119373733f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Factory.i
@@ -0,0 +1,15 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Kokyu_Factory::TAO_EC_Kokyu_Factory (void)
+ : TAO_EC_Default_Factory (),
+ disp_sched_policy_ (ACE_SCHED_FIFO),
+ disp_sched_scope_ (ACE_SCOPE_THREAD)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter.cpp
new file mode 100644
index 00000000000..ab2015ea52d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter.cpp
@@ -0,0 +1,313 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Kokyu_Filter.h"
+#include "orbsvcs/Event/EC_QOS_Info.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID(Event, EC_Kokyu_Filter, "$Id$")
+
+TAO_EC_Kokyu_Filter::
+ TAO_EC_Kokyu_Filter (const char* name,
+ RtecScheduler::handle_t rt_info,
+ RtecScheduler::Scheduler_ptr scheduler,
+ TAO_EC_Filter* body,
+ RtecScheduler::handle_t body_info,
+ RtecScheduler::handle_t parent_info,
+ RtecScheduler::Info_Type_t info_type)
+
+ : rt_info_ (rt_info),
+ rt_info_computed_ (0),
+ name_ (name),
+ scheduler_ (RtecScheduler::Scheduler::_duplicate (scheduler)),
+ body_ (body),
+ body_info_ (body_info),
+ parent_info_ (parent_info),
+ info_type_ (info_type)
+{
+ this->adopt_child (this->body_);
+
+#if 1 //by VS
+this->rt_info_computed_ = 1;
+#endif
+}
+
+TAO_EC_Kokyu_Filter::~TAO_EC_Kokyu_Filter (void)
+{
+ delete this->body_;
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Kokyu_Filter::begin (void) const
+{
+ return this->body_->begin ();
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Kokyu_Filter::end (void) const
+{
+ return this->body_->end ();
+}
+
+int
+TAO_EC_Kokyu_Filter::size (void) const
+{
+ return this->body_->size ();
+}
+
+int
+TAO_EC_Kokyu_Filter::filter (const RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ return this->body_->filter (event, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+int
+TAO_EC_Kokyu_Filter::filter_nocopy (RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ return this->body_->filter_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+// This is private, so we can make it inline in the .cpp file...
+void
+TAO_EC_Kokyu_Filter::compute_qos_info (TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ this->init_rt_info (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ qos_info.rt_info = this->rt_info_;
+ switch (this->info_type_)
+ {
+ default:
+ case RtecScheduler::DISJUNCTION:
+ break;
+
+ case RtecScheduler::CONJUNCTION:
+ case RtecScheduler::OPERATION:
+ {
+ RtecScheduler::OS_Priority os_priority;
+ RtecScheduler::Preemption_Subpriority_t p_subpriority;
+ RtecScheduler::Preemption_Priority_t p_priority;
+ this->scheduler_->priority (this->rt_info_,
+ os_priority,
+ p_subpriority,
+ p_priority
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ qos_info.preemption_priority = p_priority;
+ }
+ }
+}
+
+void
+TAO_EC_Kokyu_Filter::push (const RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (this->parent () != 0)
+ {
+ this->compute_qos_info (qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->parent ()->push (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_EC_Kokyu_Filter::push_nocopy (RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (this->parent () != 0)
+ {
+ this->compute_qos_info (qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->parent ()->push_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_EC_Kokyu_Filter::clear (void)
+{
+ this->body_->clear ();
+}
+
+CORBA::ULong
+TAO_EC_Kokyu_Filter::max_event_size (void) const
+{
+ return this->body_->max_event_size ();
+}
+
+int
+TAO_EC_Kokyu_Filter::can_match (const RtecEventComm::EventHeader& header) const
+{
+ return this->body_->can_match (header);
+}
+
+/*
+ Kokyu_Filter
+ |
+ |body
+ |
+ Con/DisjunctionFilter
+ |
+ |children
+ |*
+ Kokyu_Filter
+ |
+ |body
+ |
+ Type_Filter
+
+The entire hierarchy will have the same rt_info as the root. Only the root
+rt_info will be part of the dependency graph in the scheduler. The root
+rt_info will have a dependency on the consumer rt_info.
+
+<--- shows dependency (oneway)
+
+supplier1<-----|
+ con/disj_rt_info<-------consumer_rt_info
+supplier2<-----|
+*/
+
+int
+TAO_EC_Kokyu_Filter::add_dependencies (const RtecEventComm::EventHeader& header,
+ const TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL)
+{
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG, "Entering EC_Kokyu_Filter::add_dependencies\n"));
+#endif
+ this->init_rt_info (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG,
+ "this->rt_info_ = %d, header.type = %d, qos_info.rt_info = %d\n",
+ this->rt_info_, header.type, qos_info.rt_info));
+#endif
+
+ //this call the add_dependencies() on con/disjunction filter
+ int matches = this->body_->add_dependencies (header,
+ qos_info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (matches != 0)
+ {
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG, "Kokyu_Filter::matches != 0\n"));
+#endif
+ this->scheduler_->add_dependency (this->rt_info_, qos_info.rt_info, 1,
+ RtecBase::ONE_WAY_CALL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ RtecScheduler::RT_Info_var info =
+ this->scheduler_->get (qos_info.rt_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ ACE_DEBUG ((LM_DEBUG, "[%s][%d] ----> [%s][%d]\n",
+ this->name_.c_str (),
+ this->rt_info_,
+ info->entry_point.in (),
+ qos_info.rt_info));
+ }
+ else
+ {
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG, "Kokyu_Filter::matches == 0\n"));
+#endif
+ }
+
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG, "about to iterate thru children\n"));
+#endif
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin (); i != end; ++i)
+ {
+ (*i)->add_dependencies (header, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG, "Exiting EC_Kokyu_Filter: add_dependencies\n"));
+#endif
+ return 0;
+}
+
+void
+TAO_EC_Kokyu_Filter::get_qos_info (TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ this->init_rt_info (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ qos_info.rt_info = this->rt_info_;
+}
+
+void
+TAO_EC_Kokyu_Filter::init_rt_info (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->rt_info_computed_)
+ return;
+
+#if 1 //ifdef'ed from 1 to 0 by VS
+
+ // Provide dummy values the scheduler will compute them based on the
+ // dependencies and the fact that this is a DISJUNCTION.
+ this->scheduler_->set (this->rt_info_,
+ RtecScheduler::VERY_LOW_CRITICALITY,
+ 0, // worst_cast_execution_time
+ 0, // typical_cast_execution_time
+ 0, // cached_cast_execution_time
+ 0, // period
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ 0, // quantum
+ 0, // threads
+ this->info_type_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#endif //ifdef'ed by VS
+
+#if 0 //ifdef changed from 1 to 0 by VS
+ if (this->body_info_ != this->rt_info_)
+ {
+ this->scheduler_->add_dependency (this->rt_info_,
+ this->body_info_,
+ 1,
+ RtecBase::TWO_WAY_CALL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecScheduler::RT_Info_var info =
+ this->scheduler_->get (this->body_info_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "[%s] ----> [%s]\n",
+ info->entry_point.in (),
+ this->name_.c_str ()));
+ }
+#endif /* 0 */
+
+#if 0 //ifdef changed from 1 to 0 by VS
+ this->scheduler_->add_dependency (this->parent_info_,
+ this->rt_info_,
+ 1,
+ RtecBase::TWO_WAY_CALL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecScheduler::RT_Info_var info =
+ this->scheduler_->get (this->parent_info_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "[%s] ----> [%s]\n",
+ this->name_.c_str (),
+ info->entry_point.in ()));
+#endif /* 0 */
+
+ this->rt_info_computed_ = 1;
+}
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter.h b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter.h
new file mode 100644
index 00000000000..09f521997d4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter.h
@@ -0,0 +1,127 @@
+/* -*- C++ -*- */
+/**
+ * @file EC_Kokyu_Filter.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_KOKYU_FILTER_H
+#define TAO_EC_KOKYU_FILTER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Filter.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RtecSchedulerC.h"
+#include "orbsvcs/Event/rtkokyu_event_export.h"
+#include "ace/SString.h"
+
+//#define EC_KOKYU_LOGGING
+
+/**
+ * @class TAO_EC_Kokyu_Filter
+ *
+ * @brief Decorate a filter with scheduling information
+ *
+ * This filter decorates a regular filter with scheduling
+ * information. It creates a new RT_Info entry for the filter and
+ * it adds the dependencies between the filter and any childrens
+ * it may have.
+ *
+ * <H2>Memory Management</H2>
+ * It assumes ownership of the children.
+ */
+class TAO_RTKokyuEvent_Export TAO_EC_Kokyu_Filter : public TAO_EC_Filter
+{
+public:
+ /**
+ * Constructor.
+ * It assumes ownership of the @a body, makes a copy of the other
+ * parameters
+ */
+ TAO_EC_Kokyu_Filter (const char* name,
+ RtecScheduler::handle_t rt_info,
+ RtecScheduler::Scheduler_ptr scheduler,
+ TAO_EC_Filter* body,
+ RtecScheduler::handle_t body_info,
+ RtecScheduler::handle_t parent_info,
+ RtecScheduler::Info_Type_t info_type);
+
+ /// Destructor
+ virtual ~TAO_EC_Kokyu_Filter (void);
+
+ // = The TAO_EC_Filter methods, please check the documentation in
+ // TAO_EC_Filter.
+ virtual ChildrenIterator begin (void) const;
+ virtual ChildrenIterator end (void) const;
+ virtual int size (void) const;
+ virtual int filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual int filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void clear (void);
+ virtual CORBA::ULong max_event_size (void) const;
+ virtual int can_match (const RtecEventComm::EventHeader& header) const;
+ virtual int add_dependencies (const RtecEventComm::EventHeader& header,
+ const TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void get_qos_info (TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_Kokyu_Filter (const TAO_EC_Kokyu_Filter&);
+ TAO_EC_Kokyu_Filter& operator= (const TAO_EC_Kokyu_Filter&);
+
+ /// Initialize our RT_Info handle and dependencies
+ void init_rt_info (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Compute a new qos_info to push up.
+ void compute_qos_info (TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ /// The RT_Info handle for this object
+ RtecScheduler::handle_t rt_info_;
+
+ /// Has the Scheduler been updated?
+ int rt_info_computed_;
+
+ /// Our operation name
+ ACE_CString name_;
+
+ /// The scheduler we are going to use
+ RtecScheduler::Scheduler_var scheduler_;
+
+ /// The implementation
+ TAO_EC_Filter* body_;
+
+ /// The RT_Info handle for the body
+ RtecScheduler::handle_t body_info_;
+
+ /// The RT_Info handle for the parent
+ RtecScheduler::handle_t parent_info_;
+
+ /// Required for the scheduling service
+ RtecScheduler::Info_Type_t info_type_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_KOKYU_FILTER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter_Builder.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter_Builder.cpp
new file mode 100644
index 00000000000..a522ce4d5ac
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter_Builder.cpp
@@ -0,0 +1,513 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Kokyu_Filter.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Event/EC_Kokyu_Filter_Builder.h"
+#include "orbsvcs/Event/EC_Type_Filter.h"
+#include "orbsvcs/Event/EC_Conjunction_Filter.h"
+#include "orbsvcs/Event/EC_Disjunction_Filter.h"
+#include "orbsvcs/Event/EC_Timeout_Filter.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "ace/OS_NS_stdio.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Kokyu_Filter_Builder.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Event,
+ EC_Kokyu_Filter_Builder,
+ "$Id$")
+
+const char* designator (long dsgn)
+{
+ switch(dsgn)
+ {
+ case ACE_ES_GLOBAL_DESIGNATOR: return "GLOBAL";
+ case ACE_ES_CONJUNCTION_DESIGNATOR: return "CONJ";
+ case ACE_ES_DISJUNCTION_DESIGNATOR: return "DISJ";
+ case ACE_ES_NEGATION_DESIGNATOR: return "NEG";
+ case ACE_ES_LOGICAL_AND_DESIGNATOR: return "LOG_AND";
+ case ACE_ES_BITMASK_DESIGNATOR: return "BITMASK";
+ case ACE_ES_MASKED_TYPE_DESIGNATOR: return "MASKED_TYPE";
+ case ACE_ES_NULL_DESIGNATOR: return "NULL";
+ }
+
+ return "---";
+}
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Kokyu_Filter_Builder::~TAO_EC_Kokyu_Filter_Builder (void)
+{
+}
+
+TAO_EC_Filter*
+TAO_EC_Kokyu_Filter_Builder::build (
+ TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos
+ ACE_ENV_ARG_DECL) const
+{
+ CORBA::ULong i=0,found=0;
+ CORBA::ULong pos = 0;
+ CORBA::Long npos = -1;
+ int establish_final_consumer_dependency=0;
+
+ CORBA::Object_var tmp =
+ this->event_channel_->scheduler ();
+
+ RtecScheduler::Scheduler_var scheduler =
+ RtecScheduler::Scheduler::_narrow (tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+#ifdef EC_KOKYU_LOGGING
+ for (i=0; i<qos.dependencies.length (); ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "consumerqos[%d] event.header.type = %s,"
+ "rt_info = %d\n",
+ i,
+ designator (qos.dependencies[i].event.header.type),
+ qos.dependencies[i].rt_info));
+ }
+#endif
+
+ //find the first entry which is not a designator. We are going to
+ //assume that this entry will have the rt_info of the connecting
+ //consumer (ProxyPushSupplier), which is passed into this function.
+ for (i=0; !found && i<qos.dependencies.length (); ++i)
+ {
+ switch (qos.dependencies[i].event.header.type)
+ {
+ case ACE_ES_CONJUNCTION_DESIGNATOR:
+ case ACE_ES_DISJUNCTION_DESIGNATOR:
+ case ACE_ES_NEGATION_DESIGNATOR:
+ case ACE_ES_LOGICAL_AND_DESIGNATOR:
+ case ACE_ES_BITMASK_DESIGNATOR:
+ case ACE_ES_MASKED_TYPE_DESIGNATOR:
+ case ACE_ES_NULL_DESIGNATOR:
+ establish_final_consumer_dependency = 1;
+ continue;
+
+ case ACE_ES_GLOBAL_DESIGNATOR:
+ case ACE_ES_EVENT_TIMEOUT:
+ case ACE_ES_EVENT_INTERVAL_TIMEOUT:
+ case ACE_ES_EVENT_DEADLINE_TIMEOUT:
+ continue;
+
+ default:
+ npos = i;
+ found = 1;
+ break;
+ }
+ }
+
+ ACE_CString final_consumer_rep_name;
+ RtecScheduler::handle_t h_final_consumer_rt_info = 0;
+ RtecScheduler::handle_t h_final_consumer_rep_rt_info = 0;
+
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG, "consumer rt_info found in consumerqos[%d] \n", npos));
+#endif
+
+ if (npos >= 0 && establish_final_consumer_dependency == 1)
+ {
+ //Hopefully this will have the final consumer's rt_info
+ h_final_consumer_rt_info = qos.dependencies[npos].rt_info;
+
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG, "about to get rt_info = %d\n",
+ h_final_consumer_rep_rt_info));
+#endif
+
+ RtecScheduler::RT_Info_var final_consumer_rt_info =
+ scheduler->get ( h_final_consumer_rt_info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ final_consumer_rep_name = final_consumer_rt_info->entry_point.in ();
+ final_consumer_rep_name += "#rep";
+
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG, "about to create consumer rep %s\n",
+ final_consumer_rep_name.c_str ()));
+#endif
+
+ //create an rt_info corresponding to this rep.
+ h_final_consumer_rep_rt_info =
+ scheduler->create (final_consumer_rep_name.c_str ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG, "consumer rep created\n"));
+#endif
+
+ }
+
+ //We are passing the final consumer as the parent. The final
+ //consumer is the one which is connecting to the ProxyPushSupplier
+ //passed in to this function.
+
+ TAO_EC_Filter* filter =
+ this->recursive_build (supplier, qos, pos,
+ scheduler.in (),
+ h_final_consumer_rep_rt_info //parent_info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG,
+ "Filter_Builder::Verifying whether root filter"
+ " dependency can be established\n"));
+#endif
+
+ if (npos >= 0 && establish_final_consumer_dependency == 1)
+ {
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG,
+ "Filter_Builder::root filter dependency "
+ "can be established\n"));
+#endif
+ TAO_EC_Kokyu_Filter* kokyu_filter =
+ dynamic_cast<TAO_EC_Kokyu_Filter*> (filter);
+
+ //add the dependency between the root in the filter hierarchy and
+ //the final consumer
+ TAO_EC_QOS_Info qos_info;
+ kokyu_filter->get_qos_info (qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ scheduler->add_dependency (h_final_consumer_rt_info,
+ qos_info.rt_info,
+ 1,
+ RtecBase::ONE_WAY_CALL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ return filter;
+}
+
+TAO_EC_Filter*
+TAO_EC_Kokyu_Filter_Builder::recursive_build (
+ TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong& pos,
+ RtecScheduler::Scheduler_ptr scheduler,
+ RtecScheduler::handle_t parent_info
+ ACE_ENV_ARG_DECL) const
+{
+ const RtecEventComm::Event& e = qos.dependencies[pos].event;
+
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG, "Filter_Builder::In recursive build\n"));
+#endif
+
+ if (e.header.type == ACE_ES_CONJUNCTION_DESIGNATOR)
+ {
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG, "Filter_Builder::Conjuction designator\n"));
+#endif
+ CORBA::ULong npos = pos;
+ ACE_CString name;
+ this->recursive_name (qos, npos,
+ scheduler, name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ pos++; // Consume the designator
+
+ CORBA::ULong n = this->count_children (qos, pos);
+
+ RtecBase::handle_t conj_rt_info = parent_info;
+
+ TAO_EC_Filter** children;
+ ACE_NEW_RETURN (children, TAO_EC_Filter*[n], 0);
+ for (CORBA::ULong i = 0; i != n; ++i)
+ {
+ children[i] = this->recursive_build (supplier, qos, pos,
+ scheduler,
+ conj_rt_info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ TAO_EC_Kokyu_Filter *filter;
+ ACE_NEW_RETURN (filter,
+ TAO_EC_Kokyu_Filter (name.c_str (),
+ conj_rt_info,
+ scheduler,
+ new TAO_EC_Conjunction_Filter(children,
+ n),
+ conj_rt_info,
+ conj_rt_info,
+ RtecScheduler::CONJUNCTION),
+ 0);
+ TAO_EC_QOS_Info qos_info;
+ filter->get_qos_info (qos_info ACE_ENV_ARG_PARAMETER);
+ // @@
+ ACE_CHECK_RETURN (0);
+ return filter;
+ }
+
+ else if (e.header.type == ACE_ES_DISJUNCTION_DESIGNATOR)
+ {
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG, "Filter_Builder::Disjunction designator\n"));
+#endif
+ CORBA::ULong npos = pos;
+ ACE_CString name;
+ this->recursive_name (qos, npos,
+ scheduler, name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ pos++; // Consume the designator
+
+ RtecBase::handle_t disj_rt_info = parent_info;
+
+ CORBA::ULong n = this->count_children (qos, pos);
+
+ TAO_EC_Filter** children;
+ ACE_NEW_RETURN (children, TAO_EC_Filter*[n], 0);
+ for (CORBA::ULong i = 0; i != n; ++i)
+ {
+ children[i] = this->recursive_build (supplier, qos, pos,
+ scheduler,
+ disj_rt_info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ TAO_EC_Kokyu_Filter *filter;
+ ACE_NEW_RETURN (filter,
+ TAO_EC_Kokyu_Filter (name.c_str (),
+ disj_rt_info,
+ scheduler,
+ new TAO_EC_Disjunction_Filter (children,
+ n),
+ disj_rt_info,
+ disj_rt_info,
+ RtecScheduler::DISJUNCTION),
+ 0);
+
+ TAO_EC_QOS_Info qos_info;
+ filter->get_qos_info (qos_info ACE_ENV_ARG_PARAMETER);
+ // @@
+ ACE_CHECK_RETURN (0);
+ return filter;
+ }
+ else if (e.header.type == ACE_ES_EVENT_TIMEOUT
+ || e.header.type == ACE_ES_EVENT_INTERVAL_TIMEOUT
+ || e.header.type == ACE_ES_EVENT_DEADLINE_TIMEOUT)
+ {
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG, "Filter_Builder::Timeout designator\n"));
+#endif
+ // @@ We need a unique name for each timeout, assigned by the
+ // application?
+ char buf[64];
+
+ //get the rt_info for the timer consumer
+ RtecBase::handle_t h_consumer_rt_info = qos.dependencies[pos].rt_info;
+
+ //build a unique name using the cosumer_rt_info
+ ACE_OS::sprintf (buf, "TIMEOUT:%umsec:%d",
+ static_cast<u_int> ((e.header.creation_time / 10000)),
+ h_consumer_rt_info);
+ ACE_CString name = buf;
+
+ TAO_EC_QOS_Info qos_info;
+ qos_info.rt_info =
+ scheduler->create (name.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Convert the time to the proper units....
+ RtecScheduler::Period_t period =
+ static_cast<RtecScheduler::Period_t> (e.header.creation_time);
+
+#if 1 //by VS original code replaced with this
+ RtecScheduler::RT_Info* consumer_rt_info_ptr;
+
+ consumer_rt_info_ptr = scheduler->get (h_consumer_rt_info);
+ scheduler->set (qos_info.rt_info,
+ consumer_rt_info_ptr->criticality,
+ 0, // worst_cast_execution_time
+ 0, // typical_cast_execution_time
+ 0, // cached_cast_execution_time
+ period,
+ consumer_rt_info_ptr->importance,
+ 0, // quantum
+ 1, // threads
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ scheduler->add_dependency (qos_info.rt_info,
+ h_consumer_rt_info,
+ 1,
+ RtecBase::TWO_WAY_CALL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+#endif //by VS
+
+ pos++;
+ return new TAO_EC_Timeout_Filter (this->event_channel_,
+ supplier,
+ qos_info,
+ e.header.type,
+ e.header.creation_time);
+ }
+
+#if 1 //added by VS
+ else if (e.header.type == ACE_ES_GLOBAL_DESIGNATOR)
+ {
+ pos++;
+ return this->recursive_build (supplier, qos, pos,
+ scheduler,
+ parent_info
+ ACE_ENV_ARG_PARAMETER);
+ }
+ else
+ {
+#ifdef EC_KOKYU_LOGGING
+ ACE_DEBUG ((LM_DEBUG,
+ "Kokyu_Filter_Builder::No designator for this entry. "
+ "Must be a body\n"));
+#endif
+ }
+#endif
+
+ //probably because of a global designator, the parent_info could be 0.
+ if (parent_info == 0)
+ {
+ //In this case, the parent_info is the same as the one supplied
+ //in the consumer qos.
+ parent_info = qos.dependencies[pos].rt_info;
+ }
+
+ RtecScheduler::RT_Info_var info =
+ scheduler->get (parent_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ACE_CString name = info->entry_point.in ();
+
+ pos++;
+ TAO_EC_Kokyu_Filter *filter;
+ ACE_NEW_RETURN (filter,
+ TAO_EC_Kokyu_Filter (name.c_str (),
+ parent_info,
+ scheduler,
+ new TAO_EC_Type_Filter (e.header),
+ parent_info,
+ parent_info,
+ RtecScheduler::OPERATION),
+ 0);
+
+ TAO_EC_QOS_Info qos_info;
+ filter->get_qos_info (qos_info ACE_ENV_ARG_PARAMETER);
+ // @@
+ ACE_CHECK_RETURN (0);
+ return filter;
+}
+
+void
+TAO_EC_Kokyu_Filter_Builder:: recursive_name (
+ RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong& pos,
+ RtecScheduler::Scheduler_ptr scheduler,
+ ACE_CString& name
+ ACE_ENV_ARG_DECL) const
+{
+ const RtecEventComm::Event& e = qos.dependencies[pos].event;
+
+ if (e.header.type == ACE_ES_CONJUNCTION_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+ CORBA::ULong n = this->count_children (qos, pos);
+
+ for (CORBA::ULong i = 0; i != n; ++i)
+ {
+ ACE_CString child_name;
+ this->recursive_name (qos, pos,
+ scheduler,
+ child_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (i == 0)
+ name += "(";
+ else
+ name += "&&";
+ name += child_name;
+ }
+ name += ")";
+ return;
+ }
+
+ else if (e.header.type == ACE_ES_DISJUNCTION_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+ CORBA::ULong n = this->count_children (qos, pos);
+
+ for (CORBA::ULong i = 0; i != n; ++i)
+ {
+ ACE_CString child_name;
+
+ this->recursive_name (qos, pos,
+ scheduler,
+ child_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (i == 0)
+ name += "(";
+ else
+ name += "||";
+ name += child_name;
+ }
+ name += ")";
+ return;
+ }
+
+ else if (e.header.type == ACE_ES_EVENT_TIMEOUT
+ || e.header.type == ACE_ES_EVENT_INTERVAL_TIMEOUT
+ || e.header.type == ACE_ES_EVENT_DEADLINE_TIMEOUT)
+ {
+ pos++;
+
+ char buf[64];
+ ACE_OS::sprintf (buf, "TIMEOUT:%umsec",
+ static_cast<u_int> ((e.header.creation_time / 10000)));
+ name = buf;
+
+ return;
+ }
+
+ RtecScheduler::handle_t body_info = qos.dependencies[pos].rt_info;
+
+ RtecScheduler::RT_Info_var info =
+ scheduler->get (body_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ name = info->entry_point.in ();
+ name += "#rep";
+
+ pos++;
+}
+
+CORBA::ULong
+TAO_EC_Kokyu_Filter_Builder::
+ count_children (RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong pos) const
+{
+ CORBA::ULong l = qos.dependencies.length ();
+ CORBA::ULong i;
+ for (i = pos; i != l; ++i)
+ {
+ const RtecEventComm::Event& e = qos.dependencies[i].event;
+ if (e.header.type == ACE_ES_CONJUNCTION_DESIGNATOR
+ || e.header.type == ACE_ES_DISJUNCTION_DESIGNATOR)
+ break;
+ }
+ return i - 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter_Builder.h b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter_Builder.h
new file mode 100644
index 00000000000..83ac33a6456
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter_Builder.h
@@ -0,0 +1,89 @@
+// -*- C++ -*-
+/**
+ * @file EC_Kokyu_Filter_Builder.h
+ *
+ * $Id$
+ *
+ * @author Bryan Thrall (thrall@cs.wustl.edu)
+ *
+ * Based on previous work by Carlos O'Ryan (coryan@cs.wustl.edu) and
+ * Tim Harrison (harrison@cs.wustl.edu) and other members of the DOC group.
+ * More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_KOKYU_FILTER_BUILDER_H
+#define TAO_EC_KOKYU_FILTER_BUILDER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Filter_Builder.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/rtkokyu_event_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Filter;
+class TAO_EC_Event_Channel_Base;
+
+/**
+ * @class TAO_EC_Kokyu_Filter_Builder
+ *
+ * @brief Implement a builder for the fundamental filters.
+ *
+ * The sched filtering mechanisms in the Event channel
+ * (source/type based filtering + disjunctions and conjunctions)
+ * are constructed using this class.
+ */
+class TAO_RTKokyuEvent_Export TAO_EC_Kokyu_Filter_Builder : public TAO_EC_Filter_Builder
+{
+public:
+ /// constructor.
+ TAO_EC_Kokyu_Filter_Builder (TAO_EC_Event_Channel_Base* ec);
+
+ /// destructor...
+ virtual ~TAO_EC_Kokyu_Filter_Builder (void);
+
+ // = The TAO_EC_Filter_Builder methods...
+ TAO_EC_Filter* build (TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos
+ ACE_ENV_ARG_DECL) const;
+
+private:
+ /// Recursively build the filter tree.
+ TAO_EC_Filter* recursive_build (TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong& pos,
+ RtecScheduler::Scheduler_ptr scheduler,
+ RtecScheduler::handle_t parent_info
+ ACE_ENV_ARG_DECL) const;
+
+ /// Build the name recursively...
+ void recursive_name (RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong& pos,
+ RtecScheduler::Scheduler_ptr scheduler,
+ ACE_CString &name
+ ACE_ENV_ARG_DECL) const;
+
+ /// Count the number of children of the current node, i.e. until a
+ /// conjunction or disjunction starts.
+ CORBA::ULong count_children (RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong pos) const;
+
+private:
+ /// The event channel.
+ TAO_EC_Event_Channel_Base* event_channel_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Kokyu_Filter_Builder.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_KOKYU_FILTER_BUILDER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter_Builder.i b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter_Builder.i
new file mode 100644
index 00000000000..8e0cd624a7e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Filter_Builder.i
@@ -0,0 +1,15 @@
+// -*- C++ -*-
+//
+// $Id$
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Kokyu_Filter_Builder::
+ TAO_EC_Kokyu_Filter_Builder (TAO_EC_Event_Channel_Base *ec)
+ : event_channel_ (ec)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Scheduling.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Scheduling.cpp
new file mode 100644
index 00000000000..979cd0913fa
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Scheduling.cpp
@@ -0,0 +1,99 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Kokyu_Scheduling.h"
+#include "orbsvcs/Event/EC_QOS_Info.h"
+#include "orbsvcs/Event/EC_ProxyConsumer.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_Supplier_Filter.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Kokyu_Scheduling.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_Kokyu_Scheduling, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Kokyu_Scheduling::~TAO_EC_Kokyu_Scheduling (void)
+{
+}
+
+void
+TAO_EC_Kokyu_Scheduling::add_proxy_supplier_dependencies (
+ TAO_EC_ProxyPushSupplier *supplier,
+ TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ const RtecEventChannelAdmin::SupplierQOS& qos =
+ consumer->publications ();
+
+ for (CORBA::ULong i = 0; i < qos.publications.length (); ++i)
+ {
+ const RtecEventComm::EventHeader &header =
+ qos.publications[i].event.header;
+ TAO_EC_QOS_Info qos_info;
+ qos_info.rt_info = qos.publications[i].dependency_info.rt_info;
+
+ RtecScheduler::OS_Priority os_priority;
+ RtecScheduler::Preemption_Subpriority_t p_subpriority;
+ RtecScheduler::Preemption_Priority_t p_priority;
+ this->scheduler_->priority (qos_info.rt_info,
+ os_priority,
+ p_subpriority,
+ p_priority
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ qos_info.preemption_priority = p_priority;
+
+ supplier->add_dependencies (header, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_EC_Kokyu_Scheduling::schedule_event (const RtecEventComm::EventSet &event,
+ TAO_EC_ProxyPushConsumer *consumer,
+ TAO_EC_Supplier_Filter *filter
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventChannelAdmin::SupplierQOS qos =
+ consumer->publications ();
+
+ for (CORBA::ULong j = 0; j != event.length (); ++j)
+ {
+ const RtecEventComm::Event& e = event[j];
+ RtecEventComm::Event* buffer =
+ const_cast<RtecEventComm::Event*> (&e);
+ RtecEventComm::EventSet single_event (1, 1, buffer, 0);
+
+ TAO_EC_QOS_Info qos_info;
+
+ for (CORBA::ULong i = 0; i != qos.publications.length (); ++i)
+ {
+ const RtecEventComm::EventHeader &qos_header =
+ qos.publications[i].event.header;
+
+ if (TAO_EC_Filter::matches (e.header, qos_header) == 0)
+ continue;
+
+ qos_info.rt_info = qos.publications[i].dependency_info.rt_info;
+
+ RtecScheduler::OS_Priority os_priority;
+ RtecScheduler::Preemption_Subpriority_t p_subpriority;
+ RtecScheduler::Preemption_Priority_t p_priority;
+ this->scheduler_->priority (qos_info.rt_info,
+ os_priority,
+ p_subpriority,
+ p_priority
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ qos_info.preemption_priority = p_priority;
+ }
+
+ filter->push_scheduled_event (single_event, qos_info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Scheduling.h b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Scheduling.h
new file mode 100644
index 00000000000..105241d217a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Scheduling.h
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Kokyu_Scheduling.h
+ *
+ * $Id$
+ *
+ * @author Bryan Thrall (thrall@cs.wustl.edu)
+ *
+ * Based on previous work by Carlos O'Ryan (coryan@cs.wustl.edu) and
+ * Tim Harrison (harrison@cs.wustl.edu) and other members of the DOC group.
+ * More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_KOKYU_SCHEDULING_H
+#define TAO_EC_KOKYU_SCHEDULING_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Scheduling_Strategy.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RtecSchedulerC.h"
+#include "orbsvcs/Event/rtkokyu_event_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Kokyu_Scheduling
+ *
+ * @brief A scheduling strategy that uses TAO's real-time scheduler
+ *
+ * This implementation of the Scheduling_Strategy uses TAO's
+ * real-time scheduler.
+ */
+class TAO_RTKokyuEvent_Export TAO_EC_Kokyu_Scheduling : public TAO_EC_Scheduling_Strategy
+{
+public:
+ /// Constructor.
+ TAO_EC_Kokyu_Scheduling (RtecScheduler::Scheduler_ptr scheduler);
+
+ /// Destructor
+ virtual ~TAO_EC_Kokyu_Scheduling (void);
+
+ virtual void add_proxy_supplier_dependencies (
+ TAO_EC_ProxyPushSupplier *supplier,
+ TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL);
+ virtual void schedule_event (const RtecEventComm::EventSet &event,
+ TAO_EC_ProxyPushConsumer *consumer,
+ TAO_EC_Supplier_Filter *filter
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_Kokyu_Scheduling (const TAO_EC_Kokyu_Scheduling&);
+ TAO_EC_Kokyu_Scheduling& operator= (const TAO_EC_Kokyu_Scheduling&);
+
+ /// Initialize our RT_Info handle and dependencies
+ void init_rt_info (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// The scheduler we are going to use
+ RtecScheduler::Scheduler_var scheduler_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Kokyu_Scheduling.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_KOKYU_SCHEDULING_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Scheduling.i b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Scheduling.i
new file mode 100644
index 00000000000..1afeb35fa05
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Kokyu_Scheduling.i
@@ -0,0 +1,14 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Kokyu_Scheduling::TAO_EC_Kokyu_Scheduling (
+ RtecScheduler::Scheduler_ptr scheduler)
+ : scheduler_ (RtecScheduler::Scheduler::_duplicate (scheduler))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils.cpp
new file mode 100644
index 00000000000..9750da7a5d7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils.cpp
@@ -0,0 +1,7 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Lifetime_Utils.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Lifetime_Utils.i"
+#endif /* __ACE_INLINE__ */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils.h b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils.h
new file mode 100644
index 00000000000..d34ce3ab484
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils.h
@@ -0,0 +1,217 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Lifetime_Utils.h
+ *
+ * $Id$
+ *
+ * @author Jody Hagins (jody@atdesk.com)
+ * @author Marina Spivak (marina@atdesk.com)
+ *
+ * This file is a temporary place for general CORBA application
+ * utility classes. These classes will be moved out from the EC
+ * library and into TAO or will be replaced by other TAO classes with
+ * similar functionality.
+ */
+
+#ifndef TAO_EC_LIFETIME_UTILS_H
+#define TAO_EC_LIFETIME_UTILS_H
+#include /**/ "ace/pre.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/ORB.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Object_Deactivator
+ *
+ * @brief Utility for deactivating servants from POA.
+ *
+ * Maintains state necessary to deactivate a servant from POA.
+ * Can be told to deactivate a servant explicitly or can do so
+ * automagically, in its destructor.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Object_Deactivator
+{
+public:
+ /// Default constructor. Deactivation info can be supplied later
+ /// through set_values ().
+ TAO_EC_Object_Deactivator (void);
+
+ /// Constructor. Set @a id which will be deactivated from @ poa in
+ /// the deactivator's destructor, unless deactivate () or
+ /// disallow_deactivation () are invoked before the destruction.
+ TAO_EC_Object_Deactivator (PortableServer::POA_ptr poa,
+ PortableServer::ObjectId const & id);
+
+ /// Destructor. Deactivates id_ from poa_ if those values have
+ /// been set, and neither deactivate() nor disallow_deactivation()
+ /// have been invoked.
+ ~TAO_EC_Object_Deactivator (void);
+
+ /// Set <id> which will be deactivated from <poa> in
+ /// the deactivator's destructor, unless deactivate () or
+ /// disallow_deactivation () are invoked before the destruction.
+ void set_values (PortableServer::POA_ptr poa,
+ PortableServer::ObjectId const & id);
+
+ /// Take on the state of @a deactivator. @a deactivator loses its state.
+ void set_values (TAO_EC_Object_Deactivator & deactivator);
+
+ /// Explicitly enable deactivation to happen in destructor or when
+ /// deactivate() is called.
+ void allow_deactivation (void);
+
+ /// Explicitly disable deactivation from happening in destructor or
+ /// when deactivate() is called.
+ void disallow_deactivation (void);
+
+ /// Perform deactivation now if <poa_> and <id_> values have been set, and
+ /// deactivation hasn't happened yet nor has it been explicitly
+ /// disallowed. CORBA exceptions occurring during deactivation are
+ /// not propagated. Deactivation will NOT happen in the destructor.
+ void deactivate (void);
+
+ /// Accessor for the POA used in deactivation.
+ PortableServer::POA_var poa (void) const;
+
+private:
+
+ /// Disallow.
+ //@{
+ TAO_EC_Object_Deactivator (const TAO_EC_Object_Deactivator &rhs);
+ TAO_EC_Object_Deactivator& operator= (const TAO_EC_Object_Deactivator &rhs);
+ //@}
+
+ /// POA from which the object will be deactivated.
+ PortableServer::POA_var poa_;
+
+ /// ObjectId of the object to be deactivated.
+ PortableServer::ObjectId id_;
+
+ /// Flag indicating whether deactivation will be attempted.
+ /// The flag is set to false if <poa_> and <id_> haven't been set
+ /// yet, or if deactivation already happened, or if
+ /// disallow_deactivation () method is invoked.
+ int deactivate_;
+};
+
+//***************************************************************************
+
+/**
+ * @class TAO_EC_Deactivated_Object
+ *
+ * @brief Object deactivation utility (mix-in) class.
+ *
+ * Maintains state necessary to deactivate object inheriting from this
+ * class from POA. The state can be set using set_deactivator()
+ * method. Then, the object can deactivate itself by doing
+ * this->deactivator_.deactivate ()
+ *
+ * NOTE: deactivation does NOT happen automatically, and must be
+ * explicitly initiated as described above.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Deactivated_Object
+{
+public:
+
+ /// Set deactivation state to that specified by the @a deactivator
+ /// argument.
+ void set_deactivator (TAO_EC_Object_Deactivator & deactivator);
+
+protected:
+
+ TAO_EC_Deactivated_Object (void);
+ ~TAO_EC_Deactivated_Object (void);
+
+ /// Utility for deactivating ourselves from POA.
+ TAO_EC_Object_Deactivator deactivator_;
+};
+
+//***************************************************************************
+
+/**
+ * @class TAO_EC_ORB_Holder
+ *
+ * @brief Utility for automatically destroying the ORB.
+ *
+ * Holds a reference to an ORB, and calls destroy() on it in the
+ * destructor.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_ORB_Holder
+{
+public:
+ /// Constructor. No-op.
+ TAO_EC_ORB_Holder (void);
+
+ /// Destructor. If holding an ORB, destroy it.
+ ~TAO_EC_ORB_Holder (void);
+
+ /// Set the ORB to be destroyed in destructor to <orb_var>. If
+ /// TAO_EC_ORB_Holder already held an orb prior to invocation of
+ /// this method, that orb is NOT destroyed.
+ void init (CORBA::ORB_var orb_var);
+
+private:
+
+ /// Disallow.
+ //@{
+ TAO_EC_ORB_Holder & operator= (const TAO_EC_ORB_Holder &rhs);
+ TAO_EC_ORB_Holder(const TAO_EC_ORB_Holder &rhs);
+ //@}
+
+ /// ORB to be destroyed.
+ CORBA::ORB_var orb_;
+};
+
+//***************************************************************************
+
+/**
+ * @class TAO_EC_Event_Channel_Holder
+ *
+ * @brief Utility for automatically destroying the Event Channel.
+ *
+ * Holds a reference to an Event Channel, and calls destroy() on it in the
+ * destructor.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Event_Channel_Holder
+{
+public:
+ /// Constructor. No-op.
+ TAO_EC_Event_Channel_Holder (void);
+
+ /// Destructor. If holding an Event Channel, destroy it.
+ ~TAO_EC_Event_Channel_Holder (void);
+
+ /// Set the Event Channel to be destroyed in destructor to @a ec_var. If
+ /// TAO_EC_Event_Channel_Holder already held an Event Channel prior
+ /// to invocation of this method, that Event Channel is NOT destroyed.
+ void init (RtecEventChannelAdmin::EventChannel_var ec_var);
+
+private:
+
+ /// Disallow.
+ //@{
+ TAO_EC_Event_Channel_Holder & operator= (const TAO_EC_Event_Channel_Holder &rhs);
+ TAO_EC_Event_Channel_Holder(const TAO_EC_Event_Channel_Holder &rhs);
+ //@}
+
+ /// EC to be destroyed.
+ RtecEventChannelAdmin::EventChannel_var ec_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Lifetime_Utils.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_LIFETIME_UTILS_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils.i b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils.i
new file mode 100644
index 00000000000..2884f04108d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils.i
@@ -0,0 +1,179 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Object_Deactivator::TAO_EC_Object_Deactivator (void)
+ : poa_ ()
+ , id_ ()
+ , deactivate_ (0)
+{
+}
+
+ACE_INLINE
+TAO_EC_Object_Deactivator::TAO_EC_Object_Deactivator (
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId const & id)
+ : poa_ (PortableServer::POA::_duplicate (poa))
+ , id_ (id)
+ , deactivate_ (1)
+{
+}
+
+ACE_INLINE void
+TAO_EC_Object_Deactivator::deactivate (void)
+{
+ if (this->deactivate_ && !CORBA::is_nil (this->poa_.in ()))
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->deactivate_ = 0;
+ this->poa_->deactivate_object (id_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // The deactivation can throw...
+ }
+ ACE_ENDTRY;
+ }
+}
+
+ACE_INLINE
+TAO_EC_Object_Deactivator::~TAO_EC_Object_Deactivator (void)
+{
+ this->deactivate ();
+}
+
+ACE_INLINE PortableServer::POA_var
+TAO_EC_Object_Deactivator::poa (void) const
+{
+ return this->poa_;
+}
+
+ACE_INLINE void
+TAO_EC_Object_Deactivator::allow_deactivation (void)
+{
+ this->deactivate_ = 1;
+}
+
+ACE_INLINE void
+TAO_EC_Object_Deactivator::disallow_deactivation (void)
+{
+ this->deactivate_ = 0;
+}
+
+ACE_INLINE void
+TAO_EC_Object_Deactivator::set_values (PortableServer::POA_ptr poa,
+ PortableServer::ObjectId const & id)
+{
+ this->poa_ = PortableServer::POA::_duplicate (poa);
+ this->id_ = id;
+ this->deactivate_ = 1;
+}
+
+ACE_INLINE void
+TAO_EC_Object_Deactivator::set_values (TAO_EC_Object_Deactivator & deactivator)
+{
+ if (this == &deactivator)
+ return;
+
+ this->poa_ = deactivator.poa_._retn ();
+ this->id_ = deactivator.id_;
+ this->deactivate_ = deactivator.deactivate_;
+ deactivator.deactivate_ = 0;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_EC_Deactivated_Object::TAO_EC_Deactivated_Object (void)
+ : deactivator_ ()
+{
+}
+
+ACE_INLINE
+TAO_EC_Deactivated_Object::~TAO_EC_Deactivated_Object (void)
+{
+ // Prevent automatic deactivation in deactivator's destructor.
+ this->deactivator_.disallow_deactivation ();
+}
+
+ACE_INLINE void
+TAO_EC_Deactivated_Object::set_deactivator (
+ TAO_EC_Object_Deactivator & deactivator)
+{
+ this->deactivator_.set_values (deactivator);
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_EC_ORB_Holder::TAO_EC_ORB_Holder (void)
+ : orb_ ()
+{
+}
+
+ACE_INLINE
+TAO_EC_ORB_Holder::~TAO_EC_ORB_Holder (void)
+{
+ if (!CORBA::is_nil (this->orb_.in ()))
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore.
+ }
+ ACE_ENDTRY;
+ }
+}
+
+ACE_INLINE void
+TAO_EC_ORB_Holder::init (CORBA::ORB_var orb_var)
+{
+ this->orb_ = orb_var;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_EC_Event_Channel_Holder::TAO_EC_Event_Channel_Holder (void)
+ : ec_ ()
+{
+}
+
+ACE_INLINE
+TAO_EC_Event_Channel_Holder::~TAO_EC_Event_Channel_Holder (void)
+{
+ if (!CORBA::is_nil (this->ec_.in ()))
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore.
+ }
+ ACE_ENDTRY;
+ }
+}
+
+ACE_INLINE void
+TAO_EC_Event_Channel_Holder::init (
+ RtecEventChannelAdmin::EventChannel_var ec_var)
+{
+ this->ec_ = ec_var;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.cpp
new file mode 100644
index 00000000000..8a8d4934d40
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.cpp
@@ -0,0 +1,51 @@
+// $Id$
+
+#ifndef TAO_EC_LIFETIME_UTILS_T_CPP
+#define TAO_EC_LIFETIME_UTILS_T_CPP
+
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <typename T>
+void
+activate (T & obj_ref,
+ PortableServer::POA_ptr poa,
+ PortableServer::ServantBase * servant,
+ TAO_EC_Object_Deactivator & suggested_object_deactivator
+ ACE_ENV_ARG_DECL)
+{
+ // Activate the servant into the POA.
+ PortableServer::ObjectId_var obj_id =
+ poa->activate_object (servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ suggested_object_deactivator.set_values (poa, obj_id.in ());
+
+ // Get the object reference of the activated object.
+ CORBA::Object_var obj =
+ poa->id_to_reference (obj_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Don't try to use T::_obj_type::_narrow, some compilers don't like it so
+ // do this in two steps
+ typedef typename T::_obj_type my_object_type;
+
+ obj_ref =
+ my_object_type::_narrow (obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (obj_ref.in ()))
+ {
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_EC_LIFETIME_UTILS_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.h b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.h
new file mode 100644
index 00000000000..85b98439126
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.h
@@ -0,0 +1,203 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Lifetime_Utils_T.h
+ *
+ * $Id$
+ *
+ * @author Jody Hagins (jody@atdesk.com)
+ * @author Marina Spivak (marina@atdesk.com)
+ *
+ * This file is a temporary place for general CORBA application
+ * utility classes. These classes will be moved out from the EC
+ * library and into TAO or will be replaced by other TAO classes with
+ * similar functionality.
+ */
+
+#ifndef TAO_EC_LIFETIME_UTILS_T_H
+#define TAO_EC_LIFETIME_UTILS_T_H
+
+#include "orbsvcs/Event/EC_Lifetime_Utils.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @brief Helper for activating objects.
+ * Activates @a servant with @a poa and returns the object reference via
+ * @a obj_ref. If @a object_deactivator != 0, it is populated with info
+ * necessary to deactivate the @a servant from @a poa.
+ */
+template <typename T>
+void activate (T & obj_ref,
+ PortableServer::POA_ptr poa,
+ PortableServer::ServantBase * servant,
+ TAO_EC_Object_Deactivator & object_deactivator
+ ACE_ENV_ARG_DECL);
+
+
+//***************************************************************************
+
+/**
+ * @class TAO_EC_Auto_Command<COMMAND>
+ *
+ * @brief Utility class which executes COMMAND in its destructor.
+ *
+ * Template argument requirements:
+ *
+ * Has void execute (ACE_ENV_SINGLE_ARG_DECL); method which
+ * can throw ONLY CORBA exceptions.
+ * Has default and copy constructors.
+ *
+ */
+template <class T>
+class TAO_EC_Auto_Command
+{
+public:
+ TAO_EC_Auto_Command (void);
+ TAO_EC_Auto_Command (const T & command);
+ ~TAO_EC_Auto_Command (void);
+ void set_command (const T & command);
+ void set_command (TAO_EC_Auto_Command<T> & auto_command);
+ void execute (void);
+ void allow_command (void);
+ void disallow_command (void);
+
+private:
+
+ TAO_EC_Auto_Command (const TAO_EC_Auto_Command &);
+ TAO_EC_Auto_Command & operator= (const TAO_EC_Auto_Command &);
+
+ T command_;
+ int allow_command_;
+};
+
+
+//***************************************************************************
+
+template <class T>
+class TAO_EC_Shutdown_Command
+{
+public:
+ TAO_EC_Shutdown_Command (void);
+ TAO_EC_Shutdown_Command (T target);
+ void execute (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+
+ T target_;
+};
+
+//***************************************************************************
+
+/**
+ * @class Servant_Var
+ *
+ * @brief Provides a type safe counted reference to servants.
+ */
+template <class T>
+class TAO_EC_Servant_Var
+{
+public:
+ //! Constructor. Assumes ownership of \c p.
+ TAO_EC_Servant_Var(T * p = 0);
+
+ //! Copy constructor. Adds reference to \c rhs.
+ TAO_EC_Servant_Var(TAO_EC_Servant_Var<T> const & rhs);
+
+ //! Assignment operator. Adds reference to \c rhs.
+ TAO_EC_Servant_Var<T> & operator=(TAO_EC_Servant_Var<T> const & rhs);
+
+ //! Destructor. Removes a reference from the underlying object,
+ //! possibly destroying it.
+ ~TAO_EC_Servant_Var();
+
+ //! Assignment operator. Assumes ownership of \c p.
+ TAO_EC_Servant_Var<T> & operator=(T * p);
+
+# if !defined(ACE_LACKS_MEMBER_TEMPLATES)
+ //! Template member constructor from a pointer that will implicitly
+ //! cast to type T. Assumes ownership of \c p.
+ //! This constructor allows constructs such as:
+ //! Servant_Base<Base> p(new Derived);
+ template <class Y>
+ TAO_EC_Servant_Var(Y * p);
+
+ //! Template member copy constructor from a TAO_EC_Servant_Var<Y>, where
+ //! Y can be implicitly cast to type T.
+ template <class Y>
+ TAO_EC_Servant_Var(TAO_EC_Servant_Var<Y> const & rhs);
+
+ //! Template member assignment operator from a TAO_EC_Servant_Var<Y>, where
+ //! Y can be implicitly cast to type T.
+ template <class Y>
+ TAO_EC_Servant_Var<T> & operator=(TAO_EC_Servant_Var<Y> const & rhs);
+
+ //! Template member assignment operator from a pointer to Y, where Y
+ //! can be implicitly cast to type T.
+ template <class Y>
+ TAO_EC_Servant_Var<T> & operator=(Y * p);
+# endif /* ACE_LACKS_MEMBER_TEMPLATES */
+
+ //! Smart pointer operator-> provides access to the underlying object.
+ T const * operator->() const;
+
+ //! Smart pointer operator-> provides access to the underlying object.
+ T * operator->();
+
+ //! Dereference the underlying object.
+ T const & operator*() const;
+
+ //! Dereference the underlying object.
+ T & operator*();
+
+ //! Return a void pointer to the underlying object. This allows
+ //! it to be used in conditional code and tested against 0.
+ operator void const * () const;
+
+ //! As an IN parameter.
+ T * in() const;
+
+ //! As an INOUT parameter.
+ T *& inout();
+
+ //! As an OUT parameter.
+ T *& out();
+
+ // Return a pointer to the underlying object, and this counted
+ // reference will no longer own the object.
+ T * _retn();
+
+private:
+ T * ptr_;
+};
+
+//! Compare two TAO_EC_Servant_Vars for equivalence.
+template <class X, class Y>
+bool operator==(TAO_EC_Servant_Var<X> const & x,
+ TAO_EC_Servant_Var<Y> const & y);
+
+//! Compare two TAO_EC_Servant_Vars for non-equivalence.
+template <class X, class Y>
+bool operator!=(TAO_EC_Servant_Var<X> const & x,
+ TAO_EC_Servant_Var<Y> const & y);
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("EC_Lifetime_Utils_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* EC_LIFETIME_UTILS_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.i b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.i
new file mode 100644
index 00000000000..e93998fee0f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.i
@@ -0,0 +1,340 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class T>
+ACE_INLINE
+TAO_EC_Auto_Command<T>::TAO_EC_Auto_Command (void)
+ : command_ ()
+ , allow_command_ (0)
+{
+}
+
+template <class T>
+ACE_INLINE
+TAO_EC_Auto_Command<T>::TAO_EC_Auto_Command (const T & command)
+ : command_ (command)
+ , allow_command_ (1)
+{
+}
+
+template <class T>
+ACE_INLINE
+TAO_EC_Auto_Command<T>::~TAO_EC_Auto_Command (void)
+{
+ this->execute ();
+}
+
+template <class T>
+ACE_INLINE void
+TAO_EC_Auto_Command<T>::set_command (const T & command)
+{
+ this->command_ = command;
+ this->allow_command_ = 1;
+}
+
+template <class T>
+ACE_INLINE void
+TAO_EC_Auto_Command<T>::set_command (TAO_EC_Auto_Command<T> & auto_command)
+{
+ if (this == &auto_command)
+ return;
+
+ this->command_ = auto_command.command_;
+ this->allow_command_ = auto_command.allow_command_;
+ auto_command.allow_command_ = 0;
+}
+
+template <class T>
+ACE_INLINE void
+TAO_EC_Auto_Command<T>::execute (void)
+{
+ if (this->allow_command_)
+ {
+ this->allow_command_ = 0;
+
+ ACE_TRY_NEW_ENV
+ {
+ this->command_.execute (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // ignore.
+ }
+ ACE_ENDTRY;
+ }
+}
+
+template <class T>
+ACE_INLINE void
+TAO_EC_Auto_Command<T>::allow_command (void)
+{
+ this->allow_command_ = 1;
+}
+
+template <class T>
+ACE_INLINE void
+TAO_EC_Auto_Command<T>::disallow_command (void)
+{
+ this->allow_command_ = 0;
+}
+
+
+//***************************************************************************
+
+template <class T>
+ACE_INLINE
+TAO_EC_Shutdown_Command<T>::TAO_EC_Shutdown_Command (void)
+ : target_ ()
+{
+}
+
+template <class T>
+ACE_INLINE
+TAO_EC_Shutdown_Command<T>::TAO_EC_Shutdown_Command (T target)
+ : target_ (target)
+{
+}
+
+template <class T>
+ACE_INLINE void
+TAO_EC_Shutdown_Command<T>::execute (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->target_.in ())
+ {
+ this->target_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+//***************************************************************************
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// Life would be much easier if _add_ref() and _remove_ref()
+// had throw specs of "throw ()"
+
+#include <algorithm>
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class T>
+ACE_INLINE TAO_EC_Servant_Var<T>::
+TAO_EC_Servant_Var(T * p)
+ : ptr_(p)
+{
+}
+
+// If _add_ref throws, this object will not be completely constructed
+// so the destructor will not be called.
+template <class T>
+ACE_INLINE TAO_EC_Servant_Var<T>::
+TAO_EC_Servant_Var(TAO_EC_Servant_Var<T> const & rhs)
+ : ptr_(rhs.ptr_)
+{
+ if (ptr_)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ ptr_->_add_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL
+ {
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ }
+}
+
+template <class T>
+ACE_INLINE TAO_EC_Servant_Var<T> & TAO_EC_Servant_Var<T>::
+operator=(TAO_EC_Servant_Var<T> const & rhs)
+{
+ TAO_EC_Servant_Var<T> tmp(rhs);
+
+ // std::swap(tmp.ptr_, ptr_);
+ T * swap_temp = tmp.ptr_;
+ tmp.ptr_ = ptr_;
+ ptr_ = swap_temp;
+
+ return *this;
+}
+
+template <class T>
+ACE_INLINE TAO_EC_Servant_Var<T> & TAO_EC_Servant_Var<T>::
+operator=(T * p)
+{
+ TAO_EC_Servant_Var<T> tmp(p);
+
+ // std::swap(tmp.ptr_, ptr_);
+ T * swap_temp = tmp.ptr_;
+ tmp.ptr_ = ptr_;
+ ptr_ = swap_temp;
+
+ return *this;
+}
+
+template <class T>
+ACE_INLINE TAO_EC_Servant_Var<T>::
+~TAO_EC_Servant_Var()
+{
+ // Unfortunately, there is no throw spec on _remove_ref, so we
+ // can't assume that it will not throw. If it does, then we are in
+ // trouble. In any event, we can't let the exception escape our
+ // destructor.
+ if (ptr_ != 0)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ ptr_->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+ }
+}
+
+#if !defined(ACE_LACKS_MEMBER_TEMPLATES)
+template <class T> template <class Y>
+ACE_INLINE TAO_EC_Servant_Var<T>::
+TAO_EC_Servant_Var(Y * p)
+ : ptr_(p)
+{
+}
+
+template <class T> template <class Y>
+ACE_INLINE TAO_EC_Servant_Var<T>::
+TAO_EC_Servant_Var(TAO_EC_Servant_Var<Y> const & rhs)
+ : ptr_(rhs.in())
+{
+ if (ptr_)
+ {
+ ptr_->_add_ref();
+ }
+}
+
+template <class T> template <class Y>
+ACE_INLINE TAO_EC_Servant_Var<T> & TAO_EC_Servant_Var<T>::
+operator=(TAO_EC_Servant_Var<Y> const & rhs)
+{
+ TAO_EC_Servant_Var<T> tmp(rhs);
+
+ // std::swap(tmp.ptr_, ptr_);
+ T * swap_temp = tmp.ptr_;
+ tmp.ptr_ = ptr_;
+ ptr_ = swap_temp;
+
+ return *this;
+}
+
+template <class T> template <class Y>
+ACE_INLINE TAO_EC_Servant_Var<T> & TAO_EC_Servant_Var<T>::
+operator=(Y * p)
+{
+ TAO_EC_Servant_Var<T> tmp(p);
+
+ // std::swap(tmp.ptr_, ptr_);
+ T * swap_temp = tmp.ptr_;
+ tmp.ptr_ = ptr_;
+ ptr_ = swap_temp;
+
+ return *this;
+}
+#endif /* ACE_LACKS_MEMBER_TEMPLATES */
+
+template <class T>
+ACE_INLINE T const * TAO_EC_Servant_Var<T>::
+operator->() const
+{
+ return ptr_;
+}
+
+template <class T>
+ACE_INLINE T * TAO_EC_Servant_Var<T>::
+operator->()
+{
+ return ptr_;
+}
+
+template <class T>
+ACE_INLINE T const & TAO_EC_Servant_Var<T>::
+operator*() const
+{
+ return *ptr_;
+}
+
+template <class T>
+ACE_INLINE T & TAO_EC_Servant_Var<T>::
+operator*()
+{
+ return *ptr_;
+}
+
+template <class T>
+ACE_INLINE TAO_EC_Servant_Var<T>::
+operator void const * () const
+{
+ return ptr_;
+}
+
+template <class T>
+ACE_INLINE T * TAO_EC_Servant_Var<T>::
+in() const
+{
+ return ptr_;
+}
+
+template <class T>
+ACE_INLINE T *& TAO_EC_Servant_Var<T>::
+inout()
+{
+ return ptr_;
+}
+
+template <class T>
+ACE_INLINE T *& TAO_EC_Servant_Var<T>::
+out()
+{
+ TAO_EC_Servant_Var<T> tmp;
+
+ // std::swap(tmp.ptr_, ptr_);
+ T * swap_temp = tmp.ptr_;
+ tmp.ptr_ = ptr_;
+ ptr_ = swap_temp;
+
+ return ptr_;
+}
+
+template <class T>
+ACE_INLINE T * TAO_EC_Servant_Var<T>::
+_retn()
+{
+ T * rval = ptr_;
+ ptr_ = 0;
+ return rval;
+}
+
+template <class X, class Y>
+ACE_INLINE bool
+operator==(TAO_EC_Servant_Var<X> const & x,
+ TAO_EC_Servant_Var<Y> const & y)
+{
+ return x.in() == y.in();
+}
+
+template <class X, class Y>
+ACE_INLINE bool
+operator!=(TAO_EC_Servant_Var<X> const & x,
+ TAO_EC_Servant_Var<Y> const & y)
+{
+ return x.in() != y.in();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_MT_Dispatching.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_MT_Dispatching.cpp
new file mode 100644
index 00000000000..096ae4c3ba0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_MT_Dispatching.cpp
@@ -0,0 +1,92 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_MT_Dispatching.h"
+
+ACE_RCSID(Event, EC_MT_Dispatching, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_MT_Dispatching::TAO_EC_MT_Dispatching (int nthreads,
+ int thread_creation_flags,
+ int thread_priority,
+ int force_activate,
+ TAO_EC_Queue_Full_Service_Object* service_object)
+ : nthreads_ (nthreads),
+ thread_creation_flags_ (thread_creation_flags),
+ thread_priority_ (thread_priority),
+ force_activate_ (force_activate),
+ active_ (0),
+ queue_full_service_object_ (service_object)
+{
+ this->task_.open (&this->thread_manager_);
+}
+
+void
+TAO_EC_MT_Dispatching::activate (void)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (this->active_ != 0)
+ return;
+
+ this->active_ = 1;
+
+ if (this->task_.activate (this->thread_creation_flags_,
+ this->nthreads_,
+ 1,
+ this->thread_priority_) == -1)
+ {
+ if (this->force_activate_ != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "EC (%P|%t) activating dispatching queue at"
+ " default priority\n"));
+ if (this->task_.activate (THR_BOUND, this->nthreads_) == -1)
+ ACE_ERROR ((LM_ERROR,
+ "EC (%P|%t) cannot activate dispatching queue.\n"));
+ }
+ }
+}
+
+void
+TAO_EC_MT_Dispatching::shutdown (void)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (this->active_ == 0)
+ return;
+
+ for (int i = 0; i < this->nthreads_; ++i)
+ {
+ this->task_.putq (new TAO_EC_Shutdown_Task_Command);
+ }
+ this->thread_manager_.wait ();
+}
+
+void
+TAO_EC_MT_Dispatching::push (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventComm::EventSet event_copy = event;
+ this->push_nocopy (proxy, consumer, event_copy, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_MT_Dispatching::push_nocopy (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info&
+ ACE_ENV_ARG_DECL)
+{
+ // Double checked locking....
+ if (this->active_ == 0)
+ this->activate ();
+
+ this->task_.push (proxy, consumer, event ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_MT_Dispatching.h b/TAO/orbsvcs/orbsvcs/Event/EC_MT_Dispatching.h
new file mode 100644
index 00000000000..b38b5a160fd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_MT_Dispatching.h
@@ -0,0 +1,98 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_MT_Dispatching.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_MT_DISPATCHING_H
+#define TAO_EC_MT_DISPATCHING_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Dispatching.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/EC_Dispatching_Task.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_MT_Dispatching
+ *
+ * @brief Dispatching strategy that minimizes mt inversion.
+ *
+ * This strategy uses a single queue, serviced by one or more
+ * threads. It's main purpose is to decouple the suppliers from
+ * the client execution time, specially in the collocated case.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_MT_Dispatching : public TAO_EC_Dispatching
+{
+public:
+ /// Constructor
+ /// It will create @a nthreads servicing threads...
+ TAO_EC_MT_Dispatching (int nthreads,
+ int thread_creation_flags,
+ int thread_priority,
+ int force_activate,
+ TAO_EC_Queue_Full_Service_Object* queue_full_service_object_name);
+
+ // = The EC_Dispatching methods.
+ virtual void activate (void);
+ virtual void shutdown (void);
+ virtual void push (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ /// Use our own thread manager.
+ ACE_Thread_Manager thread_manager_;
+
+ /// The number of active tasks
+ int nthreads_;
+
+ /// The flags (THR_BOUND, THR_NEW_LWP, etc.) used to create the
+ /// dispatching threads.
+ int thread_creation_flags_;
+
+ /// The priority of the dispatching threads.
+ int thread_priority_;
+
+ /// If activation at the requested priority fails then we fallback on
+ /// the defaults for thread activation.
+ int force_activate_;
+
+ /// The dispatching task
+ TAO_EC_Dispatching_Task task_;
+
+ /// Synchronize access to internal data
+ TAO_SYNCH_MUTEX lock_;
+
+ /// Are the threads running?
+ int active_;
+
+ /// Service Object information
+ TAO_EC_Queue_Full_Service_Object* queue_full_service_object_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_MT_DISPATCHING_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Masked_Type_Filter.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Masked_Type_Filter.cpp
new file mode 100644
index 00000000000..0ab3197ef29
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Masked_Type_Filter.cpp
@@ -0,0 +1,128 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Masked_Type_Filter.h"
+
+ACE_RCSID(Event, EC_Masked_Type_Filter, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Masked_Type_Filter::
+ TAO_EC_Masked_Type_Filter (CORBA::ULong source_mask,
+ CORBA::ULong type_mask,
+ CORBA::ULong source_value,
+ CORBA::ULong type_value)
+ : source_mask_ (source_mask),
+ type_mask_ (type_mask),
+ source_value_ (source_value),
+ type_value_ (type_value)
+{
+}
+
+TAO_EC_Masked_Type_Filter::~TAO_EC_Masked_Type_Filter (void)
+{
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Masked_Type_Filter::begin (void) const
+{
+ return 0;
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Masked_Type_Filter::end (void) const
+{
+ return 0;
+}
+
+int
+TAO_EC_Masked_Type_Filter::size (void) const
+{
+ return 0;
+}
+
+int
+TAO_EC_Masked_Type_Filter::filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (event.length () != 1)
+ return 0;
+
+ if ((event[0].header.type & this->type_mask_) != this->type_value_
+ || (event[0].header.source & this->source_mask_) != this->source_value_)
+ return 0;
+
+ if (this->parent () != 0)
+ {
+ this->parent ()->push (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ return 1;
+}
+
+int
+TAO_EC_Masked_Type_Filter::filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (event.length () != 1)
+ return 0;
+
+ if ((event[0].header.type & this->type_mask_) != this->type_value_
+ || (event[0].header.source & this->source_mask_) != this->source_value_)
+ return 0;
+
+ if (this->parent () != 0)
+ {
+ this->parent ()->push_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ return 1;
+}
+
+void
+TAO_EC_Masked_Type_Filter::push (const RtecEventComm::EventSet &,
+ TAO_EC_QOS_Info &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_Masked_Type_Filter::push_nocopy (RtecEventComm::EventSet &,
+ TAO_EC_QOS_Info &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_Masked_Type_Filter::clear (void)
+{
+}
+
+CORBA::ULong
+TAO_EC_Masked_Type_Filter::max_event_size (void) const
+{
+ return 1;
+}
+
+int
+TAO_EC_Masked_Type_Filter::can_match (
+ const RtecEventComm::EventHeader& header) const
+{
+ if ((header.type & this->type_mask_) == this->type_value_
+ && (header.source & this->source_mask_) == this->source_value_)
+ return 1;
+
+ return 0;
+}
+
+int
+TAO_EC_Masked_Type_Filter::add_dependencies (
+ const RtecEventComm::EventHeader&,
+ const TAO_EC_QOS_Info &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Masked_Type_Filter.h b/TAO/orbsvcs/orbsvcs/Event/EC_Masked_Type_Filter.h
new file mode 100644
index 00000000000..97a83d622ea
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Masked_Type_Filter.h
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Masked_Type_Filter.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_MASKED_TYPE_FILTER_H
+#define TAO_EC_MASKED_TYPE_FILTER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Filter.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Masked_Type_Filter
+ *
+ * @brief A masked type filter.
+ *
+ * This filter only accepts events whose type and/or source have
+ * a given value when a bitmask is applied to them.
+ * In short the filter checks that:
+ * (event.header.type & type_mask) == type_value
+ * and that:
+ * (event.header.source & source_mask) == source_value
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Masked_Type_Filter : public TAO_EC_Filter
+{
+public:
+ /// Constructor.
+ TAO_EC_Masked_Type_Filter (CORBA::ULong source_mask,
+ CORBA::ULong type_mask,
+ CORBA::ULong source_value,
+ CORBA::ULong type_value);
+
+ /// Destructor
+ virtual ~TAO_EC_Masked_Type_Filter (void);
+
+ // = The TAO_EC_Filter methods, please check the documentation in
+ // TAO_EC_Filter.
+ virtual ChildrenIterator begin (void) const;
+ virtual ChildrenIterator end (void) const;
+ virtual int size (void) const;
+ virtual int filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual int filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void clear (void);
+ virtual CORBA::ULong max_event_size (void) const;
+ virtual int can_match (const RtecEventComm::EventHeader& header) const;
+ virtual int add_dependencies (const RtecEventComm::EventHeader& header,
+ const TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_Masked_Type_Filter (const TAO_EC_Masked_Type_Filter&);
+ TAO_EC_Masked_Type_Filter& operator= (const TAO_EC_Masked_Type_Filter&);
+
+private:
+ /// The bitmasks
+ CORBA::ULong source_mask_;
+ CORBA::ULong type_mask_;
+
+ /// The values
+ CORBA::ULong source_value_;
+ CORBA::ULong type_value_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_MASKED_TYPE_FILTER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Negation_Filter.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Negation_Filter.cpp
new file mode 100644
index 00000000000..204685379ac
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Negation_Filter.cpp
@@ -0,0 +1,114 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Negation_Filter.h"
+
+ACE_RCSID(Event, EC_Negation_Filter, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Negation_Filter::TAO_EC_Negation_Filter (TAO_EC_Filter* child)
+ : child_ (child)
+{
+ this->adopt_child (this->child_);
+}
+
+TAO_EC_Negation_Filter::~TAO_EC_Negation_Filter (void)
+{
+ delete this->child_;
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Negation_Filter::begin (void) const
+{
+ return const_cast<TAO_EC_Filter**> (&this->child_);
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Negation_Filter::end (void) const
+{
+ return const_cast<TAO_EC_Filter**> (&this->child_) + 1;
+}
+
+int
+TAO_EC_Negation_Filter::size (void) const
+{
+ return 1;
+}
+
+int
+TAO_EC_Negation_Filter::filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ int n =
+ this->child_->filter (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ if (this->parent () != 0 && n == 0)
+ {
+ this->parent ()->push (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ return 1;
+ }
+ return 0;
+}
+
+int
+TAO_EC_Negation_Filter::filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ int n =
+ this->child_->filter_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ if (this->parent () != 0 && n == 0)
+ {
+ this->parent ()->push_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ return 1;
+ }
+ return 0;
+}
+
+void
+TAO_EC_Negation_Filter::push (const RtecEventComm::EventSet&,
+ TAO_EC_QOS_Info&
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_Negation_Filter::push_nocopy (RtecEventComm::EventSet&,
+ TAO_EC_QOS_Info&
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_Negation_Filter::clear (void)
+{
+ this->child_->clear ();
+}
+
+CORBA::ULong
+TAO_EC_Negation_Filter::max_event_size (void) const
+{
+ return this->child_->max_event_size ();
+}
+
+int
+TAO_EC_Negation_Filter::can_match (
+ const RtecEventComm::EventHeader& header) const
+{
+ return !this->child_->can_match (header);
+}
+
+int
+TAO_EC_Negation_Filter::add_dependencies (
+ const RtecEventComm::EventHeader&,
+ const TAO_EC_QOS_Info &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Negation_Filter.h b/TAO/orbsvcs/orbsvcs/Event/EC_Negation_Filter.h
new file mode 100644
index 00000000000..f4f141f0e27
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Negation_Filter.h
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Negation_Filter.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_NEGATION_FILTER_H
+#define TAO_EC_NEGATION_FILTER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Filter.h"
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Negation_Filter
+ *
+ * @brief The negation filter.
+ *
+ * This filter accepts all the events rejected by its child, and
+ * rejects any events accepted by the child.
+ *
+ * <H2>Memory Management</H2>
+ * It assumes ownership of its child.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Negation_Filter : public TAO_EC_Filter
+{
+public:
+ /// Constructor. It assumes ownership of the child.
+ TAO_EC_Negation_Filter (TAO_EC_Filter* child);
+
+ /// Destructor
+ virtual ~TAO_EC_Negation_Filter (void);
+
+
+ // = The TAO_EC_Filter methods, please check the documentation in
+ // TAO_EC_Filter.
+ virtual ChildrenIterator begin (void) const;
+ virtual ChildrenIterator end (void) const;
+ virtual int size (void) const;
+ virtual int filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual int filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void clear (void);
+ virtual CORBA::ULong max_event_size (void) const;
+ virtual int can_match (const RtecEventComm::EventHeader& header) const;
+ virtual int add_dependencies (const RtecEventComm::EventHeader& header,
+ const TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_Negation_Filter (const TAO_EC_Negation_Filter&);
+ TAO_EC_Negation_Filter& operator= (const TAO_EC_Negation_Filter&);
+
+private:
+ /// The child
+ TAO_EC_Filter* child_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_NEGATION_FILTER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Null_Factory.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Null_Factory.cpp
new file mode 100644
index 00000000000..5b829d361c6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Null_Factory.cpp
@@ -0,0 +1,241 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Null_Factory.h"
+#include "orbsvcs/Event/EC_Reactive_Dispatching.h"
+#include "orbsvcs/Event/EC_Filter_Builder.h"
+#include "orbsvcs/Event/EC_Trivial_Supplier_Filter.h"
+#include "orbsvcs/Event/EC_ConsumerAdmin.h"
+#include "orbsvcs/Event/EC_SupplierAdmin.h"
+#include "orbsvcs/Event/EC_Default_ProxyConsumer.h"
+#include "orbsvcs/Event/EC_Default_ProxySupplier.h"
+#include "orbsvcs/Event/EC_ObserverStrategy.h"
+#include "orbsvcs/Event/EC_Null_Scheduling.h"
+#include "orbsvcs/Event/EC_Reactive_Timeout_Generator.h"
+#include "orbsvcs/Event/EC_ConsumerControl.h"
+#include "orbsvcs/Event/EC_SupplierControl.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h" // @@ MSVC 6 bug
+#include "orbsvcs/ESF/ESF_Proxy_List.h"
+#include "orbsvcs/ESF/ESF_Immediate_Changes.h"
+
+#include "tao/ORB_Core.h"
+
+ACE_RCSID(Event, EC_Null_Factory, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Null_Factory::TAO_EC_Null_Factory (void)
+{
+}
+
+TAO_EC_Null_Factory::~TAO_EC_Null_Factory (void)
+{
+}
+
+TAO_EC_Dispatching*
+TAO_EC_Null_Factory::create_dispatching (TAO_EC_Event_Channel_Base *)
+{
+ return new TAO_EC_Reactive_Dispatching ();
+}
+
+void
+TAO_EC_Null_Factory::destroy_dispatching (TAO_EC_Dispatching *x)
+{
+ delete x;
+}
+
+TAO_EC_Filter_Builder*
+TAO_EC_Null_Factory::create_filter_builder (TAO_EC_Event_Channel_Base *)
+{
+ return new TAO_EC_Null_Filter_Builder;
+}
+
+void
+TAO_EC_Null_Factory::destroy_filter_builder (TAO_EC_Filter_Builder *x)
+{
+ delete x;
+}
+
+TAO_EC_Supplier_Filter_Builder*
+TAO_EC_Null_Factory::create_supplier_filter_builder (TAO_EC_Event_Channel_Base *ec)
+{
+ return new TAO_EC_Trivial_Supplier_Filter_Builder (ec);
+}
+
+void
+TAO_EC_Null_Factory::destroy_supplier_filter_builder (TAO_EC_Supplier_Filter_Builder *x)
+{
+ delete x;
+}
+
+TAO_EC_ConsumerAdmin*
+TAO_EC_Null_Factory::create_consumer_admin (TAO_EC_Event_Channel_Base *ec)
+{
+ return new TAO_EC_ConsumerAdmin (ec);
+}
+
+void
+TAO_EC_Null_Factory::destroy_consumer_admin (TAO_EC_ConsumerAdmin *x)
+{
+ delete x;
+}
+
+TAO_EC_SupplierAdmin*
+TAO_EC_Null_Factory::create_supplier_admin (TAO_EC_Event_Channel_Base *ec)
+{
+ return new TAO_EC_SupplierAdmin (ec);
+}
+
+void
+TAO_EC_Null_Factory::destroy_supplier_admin (TAO_EC_SupplierAdmin *x)
+{
+ delete x;
+}
+
+TAO_EC_ProxyPushSupplier*
+TAO_EC_Null_Factory::create_proxy_push_supplier (TAO_EC_Event_Channel_Base *ec)
+{
+ return new TAO_EC_Default_ProxyPushSupplier (ec, TAO_EC_DEFAULT_CONSUMER_VALIDATE_CONNECTION);
+}
+
+void
+TAO_EC_Null_Factory::destroy_proxy_push_supplier (TAO_EC_ProxyPushSupplier *x)
+{
+ delete x;
+}
+
+TAO_EC_ProxyPushConsumer*
+TAO_EC_Null_Factory::create_proxy_push_consumer (TAO_EC_Event_Channel_Base *ec)
+{
+ return new TAO_EC_Default_ProxyPushConsumer (ec);
+}
+
+void
+TAO_EC_Null_Factory::destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer *x)
+{
+ delete x;
+}
+
+TAO_EC_Timeout_Generator*
+TAO_EC_Null_Factory::create_timeout_generator (TAO_EC_Event_Channel_Base *)
+{
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "");
+ ACE_Reactor *reactor = orb->orb_core ()->reactor ();
+ return new TAO_EC_Reactive_Timeout_Generator (reactor);
+}
+
+void
+TAO_EC_Null_Factory::destroy_timeout_generator (TAO_EC_Timeout_Generator *x)
+{
+ delete x;
+}
+
+TAO_EC_ObserverStrategy*
+TAO_EC_Null_Factory::create_observer_strategy (TAO_EC_Event_Channel_Base *)
+{
+ return new TAO_EC_Null_ObserverStrategy;
+}
+
+void
+TAO_EC_Null_Factory::destroy_observer_strategy (TAO_EC_ObserverStrategy *x)
+{
+ delete x;
+}
+
+TAO_EC_Scheduling_Strategy*
+TAO_EC_Null_Factory::create_scheduling_strategy (TAO_EC_Event_Channel_Base*)
+{
+ return new TAO_EC_Null_Scheduling;
+}
+
+void
+TAO_EC_Null_Factory::destroy_scheduling_strategy (TAO_EC_Scheduling_Strategy* x)
+{
+ delete x;
+}
+
+TAO_EC_ProxyPushConsumer_Collection*
+TAO_EC_Null_Factory::create_proxy_push_consumer_collection (TAO_EC_Event_Channel_Base *)
+{
+ // This typedef is a workaround for a SunCC 4.2 bug
+ typedef TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>::Iterator TAO_EC_Consumer_List_Iterator;
+ return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushConsumer,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
+ TAO_EC_Consumer_List_Iterator,
+ ACE_Null_Mutex> ();
+}
+
+void
+TAO_EC_Null_Factory::destroy_proxy_push_consumer_collection (TAO_EC_ProxyPushConsumer_Collection *x)
+{
+ delete x;
+}
+
+TAO_EC_ProxyPushSupplier_Collection*
+TAO_EC_Null_Factory::create_proxy_push_supplier_collection (TAO_EC_Event_Channel_Base *)
+{
+ // This typedef is a workaround for a SunCC 4.2 bug
+ typedef TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>::Iterator TAO_EC_Supplier_List_Iterator;
+ return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushSupplier,
+ TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
+ TAO_EC_Supplier_List_Iterator,
+ ACE_Null_Mutex> ();
+}
+
+void
+TAO_EC_Null_Factory::destroy_proxy_push_supplier_collection (TAO_EC_ProxyPushSupplier_Collection *x)
+{
+ delete x;
+}
+
+ACE_Lock*
+TAO_EC_Null_Factory::create_consumer_lock (void)
+{
+ return new ACE_Lock_Adapter<ACE_Null_Mutex> ();
+}
+
+void
+TAO_EC_Null_Factory::destroy_consumer_lock (ACE_Lock* x)
+{
+ delete x;
+}
+
+ACE_Lock*
+TAO_EC_Null_Factory::create_supplier_lock (void)
+{
+ return new ACE_Lock_Adapter<ACE_Null_Mutex> ();
+}
+
+void
+TAO_EC_Null_Factory::destroy_supplier_lock (ACE_Lock* x)
+{
+ delete x;
+}
+
+TAO_EC_ConsumerControl*
+TAO_EC_Null_Factory::create_consumer_control (TAO_EC_Event_Channel_Base*)
+{
+ return new TAO_EC_ConsumerControl ();
+}
+
+void
+TAO_EC_Null_Factory::destroy_consumer_control (TAO_EC_ConsumerControl* x)
+{
+ delete x;
+}
+
+TAO_EC_SupplierControl*
+TAO_EC_Null_Factory::create_supplier_control (TAO_EC_Event_Channel_Base*)
+{
+ return new TAO_EC_SupplierControl ();
+}
+
+void
+TAO_EC_Null_Factory::destroy_supplier_control (TAO_EC_SupplierControl* x)
+{
+ delete x;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Null_Factory.h b/TAO/orbsvcs/orbsvcs/Event/EC_Null_Factory.h
new file mode 100644
index 00000000000..ca583ca5d13
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Null_Factory.h
@@ -0,0 +1,116 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Null_Factory.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_NULL_FACTORY_H
+#define TAO_EC_NULL_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Factory.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Null_Factory
+ *
+ * @brief The factory for a simple event channel.
+ *
+ * The simplest configuration for an event channel does no
+ * filtering and uses reactive dispatching. This class is used to
+ * configure such an event channel.
+ * A fixed POA is used for servant activation.
+ * This object creates a single instance of the Supplier
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Null_Factory : public TAO_EC_Factory
+{
+public:
+ /// Constructor
+ TAO_EC_Null_Factory (void);
+
+ /// destructor...
+ virtual ~TAO_EC_Null_Factory (void);
+
+ // = The EC_Factory methods
+ virtual TAO_EC_Dispatching*
+ create_dispatching (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_dispatching (TAO_EC_Dispatching*);
+ virtual TAO_EC_Filter_Builder*
+ create_filter_builder (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_filter_builder (TAO_EC_Filter_Builder*);
+ virtual TAO_EC_Supplier_Filter_Builder*
+ create_supplier_filter_builder (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_supplier_filter_builder (TAO_EC_Supplier_Filter_Builder*);
+ virtual TAO_EC_ConsumerAdmin*
+ create_consumer_admin (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_consumer_admin (TAO_EC_ConsumerAdmin*);
+ virtual TAO_EC_SupplierAdmin*
+ create_supplier_admin (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_supplier_admin (TAO_EC_SupplierAdmin*);
+ virtual TAO_EC_ProxyPushSupplier*
+ create_proxy_push_supplier (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_supplier (TAO_EC_ProxyPushSupplier*);
+ virtual TAO_EC_ProxyPushConsumer*
+ create_proxy_push_consumer (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer*);
+ virtual TAO_EC_Timeout_Generator*
+ create_timeout_generator (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_timeout_generator (TAO_EC_Timeout_Generator*);
+ virtual TAO_EC_ObserverStrategy*
+ create_observer_strategy (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_observer_strategy (TAO_EC_ObserverStrategy*);
+ virtual TAO_EC_Scheduling_Strategy*
+ create_scheduling_strategy (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_scheduling_strategy (TAO_EC_Scheduling_Strategy*);
+ virtual TAO_EC_ProxyPushConsumer_Collection*
+ create_proxy_push_consumer_collection (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_consumer_collection (TAO_EC_ProxyPushConsumer_Collection*);
+ virtual TAO_EC_ProxyPushSupplier_Collection*
+ create_proxy_push_supplier_collection (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_supplier_collection (TAO_EC_ProxyPushSupplier_Collection*);
+
+ virtual ACE_Lock* create_consumer_lock (void);
+ virtual void destroy_consumer_lock (ACE_Lock*);
+ virtual ACE_Lock* create_supplier_lock (void);
+ virtual void destroy_supplier_lock (ACE_Lock*);
+
+ virtual TAO_EC_ConsumerControl*
+ create_consumer_control (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_consumer_control (TAO_EC_ConsumerControl*);
+ virtual TAO_EC_SupplierControl*
+ create_supplier_control (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_supplier_control (TAO_EC_SupplierControl*);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_NULL_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Null_Scheduling.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Null_Scheduling.cpp
new file mode 100644
index 00000000000..e17a6de3910
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Null_Scheduling.cpp
@@ -0,0 +1,39 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Null_Scheduling.h"
+#include "orbsvcs/Event/EC_QOS_Info.h"
+#include "orbsvcs/Event/EC_Supplier_Filter.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Null_Scheduling.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_Null_Scheduling, "$Id$")
+
+void
+TAO_EC_Null_Scheduling::add_proxy_supplier_dependencies (
+ TAO_EC_ProxyPushSupplier *,
+ TAO_EC_ProxyPushConsumer *
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_Null_Scheduling::schedule_event (const RtecEventComm::EventSet &event,
+ TAO_EC_ProxyPushConsumer *,
+ TAO_EC_Supplier_Filter *filter
+ ACE_ENV_ARG_DECL)
+{
+ for (CORBA::ULong j = 0; j < event.length (); ++j)
+ {
+ const RtecEventComm::Event& e = event[j];
+ RtecEventComm::Event* buffer =
+ const_cast<RtecEventComm::Event*> (&e);
+ RtecEventComm::EventSet single_event (1, 1, buffer, 0);
+
+ TAO_EC_QOS_Info event_info;
+ filter->push_scheduled_event (single_event, event_info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Null_Scheduling.h b/TAO/orbsvcs/orbsvcs/Event/EC_Null_Scheduling.h
new file mode 100644
index 00000000000..90857214aeb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Null_Scheduling.h
@@ -0,0 +1,60 @@
+/* -*- C++ -*- */
+/**
+ * @file EC_Null_Scheduling.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_NULL_SCHEDULING_H
+#define TAO_EC_NULL_SCHEDULING_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Scheduling_Strategy.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class TAO_EC_Null_Scheduling
+ *
+ * @brief A scheduling strategy that separates event groups and
+ * delivers one event at a time.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Null_Scheduling
+ : public TAO_EC_Scheduling_Strategy
+{
+public:
+ /// Constructor.
+ TAO_EC_Null_Scheduling (void);
+
+ // Read EC_Scheduling_Strategy.h for more details
+ virtual void add_proxy_supplier_dependencies (
+ TAO_EC_ProxyPushSupplier *supplier,
+ TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL);
+ virtual void schedule_event (const RtecEventComm::EventSet &event,
+ TAO_EC_ProxyPushConsumer *consumer,
+ TAO_EC_Supplier_Filter *filter
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_Null_Scheduling (const TAO_EC_Null_Scheduling&);
+ TAO_EC_Null_Scheduling& operator= (const TAO_EC_Null_Scheduling&);
+};
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Null_Scheduling.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_NULL_SCHEDULING_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Null_Scheduling.i b/TAO/orbsvcs/orbsvcs/Event/EC_Null_Scheduling.i
new file mode 100644
index 00000000000..60c72cb9e56
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Null_Scheduling.i
@@ -0,0 +1,7 @@
+// $Id$
+
+ACE_INLINE
+TAO_EC_Null_Scheduling::TAO_EC_Null_Scheduling (void)
+{
+}
+
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.cpp
new file mode 100644
index 00000000000..e5c5a9bc11d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.cpp
@@ -0,0 +1,516 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_ObserverStrategy.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_ProxyConsumer.h"
+#include "orbsvcs/Event/EC_ConsumerAdmin.h"
+#include "orbsvcs/Event/EC_SupplierAdmin.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "ace/Auto_Ptr.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_ObserverStrategy.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_ObserverStrategy, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_ObserverStrategy::~TAO_EC_ObserverStrategy (void)
+{
+}
+
+// ****************************************************************
+
+RtecEventChannelAdmin::Observer_Handle
+TAO_EC_Null_ObserverStrategy::append_observer (
+ RtecEventChannelAdmin::Observer_ptr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER))
+{
+ ACE_THROW_RETURN (
+ RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER(),
+ 0);
+}
+
+void
+TAO_EC_Null_ObserverStrategy::remove_observer (
+ RtecEventChannelAdmin::Observer_Handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_REMOVE_OBSERVER))
+{
+ ACE_THROW (RtecEventChannelAdmin::EventChannel::CANT_REMOVE_OBSERVER());
+}
+
+void
+TAO_EC_Null_ObserverStrategy::connected (TAO_EC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_Null_ObserverStrategy::disconnected (TAO_EC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_Null_ObserverStrategy::connected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_Null_ObserverStrategy::disconnected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+// ****************************************************************
+
+TAO_EC_Basic_ObserverStrategy::~TAO_EC_Basic_ObserverStrategy (void)
+{
+ delete this->lock_;
+ this->lock_ = 0;
+}
+
+RtecEventChannelAdmin::Observer_Handle
+TAO_EC_Basic_ObserverStrategy::append_observer (
+ RtecEventChannelAdmin::Observer_ptr obs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER))
+{
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR());
+ ACE_CHECK_RETURN (0);
+
+ this->handle_generator_++;
+ Observer_Entry entry (this->handle_generator_,
+ RtecEventChannelAdmin::Observer::_duplicate (obs));
+
+ if (this->observers_.bind (entry.handle, entry) == -1)
+ ACE_THROW_RETURN (
+ RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER(),
+ 0);
+ }
+
+ RtecEventChannelAdmin::ConsumerQOS c_qos;
+ this->fill_qos (c_qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ obs->update_consumer (c_qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ RtecEventChannelAdmin::SupplierQOS s_qos;
+ this->fill_qos (s_qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ obs->update_supplier (s_qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->handle_generator_;
+}
+
+
+void
+TAO_EC_Basic_ObserverStrategy::remove_observer (
+ RtecEventChannelAdmin::Observer_Handle handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_REMOVE_OBSERVER))
+{
+ ACE_GUARD_THROW_EX (ACE_Lock, ace_mon, *this->lock_,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR());
+ ACE_CHECK;
+
+ if (this->observers_.unbind (handle) == -1)
+ ACE_THROW (
+ RtecEventChannelAdmin::EventChannel::CANT_REMOVE_OBSERVER());
+}
+
+int
+TAO_EC_Basic_ObserverStrategy::create_observer_list (
+ RtecEventChannelAdmin::Observer_var *&lst
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (ACE_Lock, ace_mon, *this->lock_,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR());
+ ACE_CHECK_RETURN (0);
+
+ int size = static_cast<int> (this->observers_.current_size ());
+ RtecEventChannelAdmin::Observer_var *tmp;
+ ACE_NEW_RETURN (tmp,
+ RtecEventChannelAdmin::Observer_var[size],
+ 0);
+ ACE_Auto_Basic_Array_Ptr<RtecEventChannelAdmin::Observer_var> copy (tmp);
+
+ Observer_Map_Iterator end = this->observers_.end ();
+ int j = 0;
+ for (Observer_Map_Iterator i = this->observers_.begin ();
+ i != end;
+ ++i)
+ {
+ Observer_Entry& entry = (*i).int_id_;
+ copy[j++] =
+ RtecEventChannelAdmin::Observer::_duplicate (entry.observer.in ());
+ }
+
+ lst = copy.release ();
+ return size;
+}
+
+void
+TAO_EC_Basic_ObserverStrategy::connected (
+ TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_qos_update (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Basic_ObserverStrategy::disconnected (
+ TAO_EC_ProxyPushConsumer* consumer
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_qos_update (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Basic_ObserverStrategy::supplier_qos_update (
+ TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ if (consumer->publications ().is_gateway)
+ return;
+
+ RtecEventChannelAdmin::SupplierQOS s_qos;
+ this->fill_qos (s_qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::Observer_var *tmp = 0;
+ int size = this->create_observer_list (tmp ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_Auto_Basic_Array_Ptr<RtecEventChannelAdmin::Observer_var> copy (tmp);
+
+ for (int i = 0; i != size; ++i)
+ {
+ ACE_TRY
+ {
+ copy[i]->update_supplier (s_qos ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other observers from
+ // failures on this one.
+ }
+ ACE_ENDTRY;
+ }
+}
+
+void
+TAO_EC_Basic_ObserverStrategy::connected (
+ TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->consumer_qos_update (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Basic_ObserverStrategy::disconnected (
+ TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->consumer_qos_update (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Basic_ObserverStrategy::consumer_qos_update (
+ TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ if (supplier->subscriptions ().is_gateway)
+ return;
+
+ RtecEventChannelAdmin::ConsumerQOS c_qos;
+ this->fill_qos (c_qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::Observer_var *tmp = 0;
+ int size = this->create_observer_list (tmp ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_Auto_Basic_Array_Ptr<RtecEventChannelAdmin::Observer_var> copy (tmp);
+
+ for (int i = 0; i != size; ++i)
+ {
+ ACE_TRY
+ {
+ copy[i]->update_consumer (c_qos ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other observers from
+ // failures on this one.
+ }
+ ACE_ENDTRY;
+ }
+}
+
+void
+TAO_EC_Basic_ObserverStrategy::fill_qos (
+ RtecEventChannelAdmin::ConsumerQOS &qos
+ ACE_ENV_ARG_DECL)
+{
+ Headers headers;
+
+ TAO_EC_Accumulate_Supplier_Headers worker (headers);
+ this->event_channel_->for_each_consumer (&worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::DependencySet& dep = qos.dependencies;
+
+ dep.length (static_cast<CORBA::ULong> (headers.current_size () + 1));
+
+ dep[0].event.header.type = ACE_ES_DISJUNCTION_DESIGNATOR;
+ dep[0].event.header.source = static_cast<CORBA::ULong> (headers.current_size ());
+ dep[0].event.header.creation_time = ORBSVCS_Time::zero ();
+ dep[0].rt_info = 0;
+
+ CORBA::ULong count = 1;
+ for (HeadersIterator i = headers.begin (); i != headers.end (); ++i)
+ {
+ dep[count++].event.header = (*i).key ();
+ }
+}
+
+void
+TAO_EC_Basic_ObserverStrategy::fill_qos (
+ RtecEventChannelAdmin::SupplierQOS &qos
+ ACE_ENV_ARG_DECL)
+{
+ Headers headers;
+
+ TAO_EC_Accumulate_Consumer_Headers worker (headers);
+ this->event_channel_->for_each_supplier (&worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ qos.publications.length (static_cast<CORBA::ULong> (headers.current_size ()));
+
+ CORBA::ULong count = 0;
+ for (HeadersIterator i = headers.begin (); i != headers.end (); ++i)
+ {
+ qos.publications[count++].event.header = (*i).key ();
+ }
+}
+
+
+// ****************************************************************
+
+TAO_EC_Reactive_ObserverStrategy::~TAO_EC_Reactive_ObserverStrategy (void)
+{
+}
+
+void
+TAO_EC_Reactive_ObserverStrategy::supplier_qos_update (
+ TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ if (consumer->publications ().is_gateway)
+ return;
+
+ RtecEventChannelAdmin::SupplierQOS s_qos;
+ this->fill_qos (s_qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ Observer_Map copy;
+ this->create_observer_map (copy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ Observer_Map_Iterator end = copy.end ();
+ for (Observer_Map_Iterator i = copy.begin ();
+ i != end;
+ ++i)
+ {
+ Observer_Entry& entry = (*i).int_id_;
+ ACE_TRY
+ {
+ entry.observer->update_supplier (s_qos ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ // Exception occured while updating observer, so remove it from the
+ // observer list
+ this->observer_not_exists (entry ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TRANSIENT, transient)
+ {
+ // Exception occured while updating observer, so remove it from the
+ // observer list
+ this->observer_not_exists (entry ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+ }
+}
+
+void
+TAO_EC_Reactive_ObserverStrategy::consumer_qos_update (
+ TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ if (supplier->subscriptions ().is_gateway)
+ return;
+
+ RtecEventChannelAdmin::ConsumerQOS c_qos;
+ this->fill_qos (c_qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ Observer_Map copy;
+ this->create_observer_map (copy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ Observer_Map_Iterator end = copy.end ();
+ for (Observer_Map_Iterator i = copy.begin ();
+ i != end;
+ ++i)
+ {
+ Observer_Entry& entry = (*i).int_id_;
+ ACE_TRY
+ {
+ entry.observer->update_consumer (c_qos ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ // Exception occured while updating observer, so remove it from the
+ // observer list
+ this->observer_not_exists (entry ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TRANSIENT, transient)
+ {
+ // Exception occured while updating observer, so remove it from the
+ // observer list
+ this->observer_not_exists (entry ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+ }
+}
+
+int
+TAO_EC_Reactive_ObserverStrategy::create_observer_map (Observer_Map &map
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (ACE_Lock, ace_mon, *this->lock_,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR());
+ ACE_CHECK_RETURN (0);
+
+ Observer_Map_Iterator end = this->observers_.end ();
+ for (Observer_Map_Iterator i = this->observers_.begin ();
+ i != end;
+ ++i)
+ {
+ Observer_Entry& entry = (*i).int_id_;
+ Observer_Entry copy (entry.handle,
+ RtecEventChannelAdmin::Observer::_duplicate (entry.observer.in ()));
+ if (map.bind (copy.handle, copy) == -1)
+ {
+ map.unbind_all();
+ return 0;
+ }
+ }
+
+ return map.current_size();
+}
+
+void
+TAO_EC_Reactive_ObserverStrategy::observer_not_exists (Observer_Entry& observer
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ this->remove_observer(observer.handle ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions
+ }
+ ACE_ENDTRY;
+}
+
+// ****************************************************************
+
+void
+TAO_EC_Accumulate_Supplier_Headers::work (TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ const RtecEventChannelAdmin::ConsumerQOS& sub =
+ supplier->subscriptions ();
+ if (sub.is_gateway)
+ return;
+ for (CORBA::ULong j = 0; j < sub.dependencies.length (); ++j)
+ {
+ const RtecEventComm::Event& event =
+ sub.dependencies[j].event;
+ RtecEventComm::EventType type = event.header.type;
+
+ if (0 < type && type < ACE_ES_EVENT_UNDEFINED)
+ continue;
+ this->headers_.insert (event.header, 1);
+ }
+}
+
+// ****************************************************************
+
+void
+TAO_EC_Accumulate_Consumer_Headers::work (TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ const RtecEventChannelAdmin::SupplierQOS& pub =
+ consumer->publications ();
+ if (pub.is_gateway)
+ return;
+ for (CORBA::ULong j = 0; j < pub.publications.length (); ++j)
+ {
+ const RtecEventComm::Event& event =
+ pub.publications[j].event;
+ RtecEventComm::EventType type = event.header.type;
+
+ if (0 < type && type < ACE_ES_EVENT_UNDEFINED)
+ continue;
+ this->headers_.insert (event.header, 1);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.h b/TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.h
new file mode 100644
index 00000000000..55b8874db7c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.h
@@ -0,0 +1,362 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_ObserverStrategy.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ * @author Johnny Willemsen (jwillemsen@remedy.nl)
+ * @author Kees van Marle (kvmarle@remedy.nl)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_OBSERVERSTRATEGY_H
+#define TAO_EC_OBSERVERSTRATEGY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Null_Mutex.h"
+#include "ace/RB_Tree.h"
+#include "ace/Map_Manager.h"
+
+#include "orbsvcs/RtecEventChannelAdminC.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Lock;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Event_Channel_Base;
+class TAO_EC_ProxyPushConsumer;
+class TAO_EC_ProxyPushSupplier;
+
+/**
+ * @class TAO_EC_ObserverStrategy
+ *
+ * @brief The strategy to handle observers for the Event Channel subscriptions
+ * and publication.
+ *
+ * The Event Channel supports Observers for the set of subscriptions and
+ * publications. This is used to implement federations of event channels,
+ * either through UDP (multicast and unicast) and/or regular CORBA calls.
+ * This behavior of the EC is strategized to avoid overhead when no gateways
+ * are needed.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_ObserverStrategy
+{
+public:
+ /// Destructor
+ virtual ~TAO_EC_ObserverStrategy (void);
+
+ /// The basic methods to support the EC strategies.
+ virtual RtecEventChannelAdmin::Observer_Handle
+ append_observer (RtecEventChannelAdmin::Observer_ptr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER))
+ = 0;
+ 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))
+ = 0;
+
+ /// Used by the EC to inform the ObserverStrategy that a Consumer has
+ /// connected or disconnected from it.
+ virtual void connected (TAO_EC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED) = 0;
+ virtual void disconnected (TAO_EC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED) = 0;
+
+ /// Used by the EC to inform the ObserverStrategy that a Supplier has
+ /// connected or disconnected from it.
+ virtual void connected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED) = 0;
+ virtual void disconnected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED) = 0;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_EC_Null_ObserverStrategy
+ *
+ * @brief A null observer strategy.
+ *
+ * This class keeps no information and simply ignores the messages
+ * from the EC.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Null_ObserverStrategy : public TAO_EC_ObserverStrategy
+{
+public:
+ /// Constructor
+ TAO_EC_Null_ObserverStrategy (void);
+
+ // = The TAO_EC_ObserverStrategy methods.
+ virtual RtecEventChannelAdmin::Observer_Handle
+ append_observer (RtecEventChannelAdmin::Observer_ptr
+ 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));
+ virtual void connected (TAO_EC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_EC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void connected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_EC_Basic_ObserverStrategy
+ *
+ * @brief A simple observer strategy.
+ *
+ * This class simply keeps the information about the current list
+ * of observers, whenever the list of consumers and/or suppliers
+ * changes in queries the EC, computes the global subscription
+ * and/or publication list and sends the update message to all the
+ * observers.
+ *
+ * <H2>Memory Management</H2>
+ * It assumes ownership of the @a lock, but not of the
+ * Event_Channel.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Basic_ObserverStrategy :
+ public TAO_EC_ObserverStrategy
+{
+public:
+ /// Constructor
+ TAO_EC_Basic_ObserverStrategy (TAO_EC_Event_Channel_Base* ec,
+ ACE_Lock* lock);
+
+ /// Destructor
+ virtual ~TAO_EC_Basic_ObserverStrategy (void);
+
+ // = The TAO_EC_ObserverStrategy methods.
+ virtual RtecEventChannelAdmin::Observer_Handle
+ append_observer (RtecEventChannelAdmin::Observer_ptr
+ 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));
+ virtual void connected (TAO_EC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_EC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void connected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void disconnected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /**
+ * @struct Observer_Entry
+ *
+ * @brief The data kept for each observer.
+ *
+ * The observer and its handle are kept in a simple structure.
+ * In the future this structure could contain QoS information,
+ * such as:
+ * + how often do we update the observer?
+ * + When was the last update.
+ * + Does it want to receive all changes?
+ */
+ struct Observer_Entry
+ {
+ Observer_Entry (void);
+ Observer_Entry (RtecEventChannelAdmin::Observer_Handle h,
+ RtecEventChannelAdmin::Observer_ptr o);
+
+ /// The handle
+ RtecEventChannelAdmin::Observer_Handle handle;
+
+ /// The observer
+ RtecEventChannelAdmin::Observer_var observer;
+ };
+
+ struct Header_Compare
+ {
+ int operator () (const RtecEventComm::EventHeader& lhs,
+ const RtecEventComm::EventHeader& rhs) const;
+ };
+
+ typedef ACE_Map_Manager<RtecEventChannelAdmin::Observer_Handle,Observer_Entry,ACE_Null_Mutex> Observer_Map;
+ typedef ACE_Map_Iterator<RtecEventChannelAdmin::Observer_Handle,Observer_Entry,ACE_Null_Mutex> Observer_Map_Iterator;
+
+
+ typedef ACE_RB_Tree<RtecEventComm::EventHeader,int,Header_Compare,ACE_Null_Mutex> Headers;
+ typedef ACE_RB_Tree_Iterator<RtecEventComm::EventHeader,int,Header_Compare,ACE_Null_Mutex> HeadersIterator;
+
+protected:
+ /// Helpers.
+ //@{
+ /// Recompute EC consumer subscriptions and send them out to all observers.
+ virtual void consumer_qos_update (TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL);
+
+ /// Recompute EC supplier publications and send them out to all observers.
+ virtual void supplier_qos_update (TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL);
+
+ /// Compute consumer QOS.
+ void fill_qos (RtecEventChannelAdmin::ConsumerQOS &qos
+ ACE_ENV_ARG_DECL);
+ /// Compute supplier QOS.
+ void fill_qos (RtecEventChannelAdmin::SupplierQOS &qos
+ ACE_ENV_ARG_DECL);
+
+ /// Copies all current observers into an array and passes it
+ /// back to the caller through @a lst. Returns the size of the array.
+ int create_observer_list (RtecEventChannelAdmin::Observer_var *&lst
+ ACE_ENV_ARG_DECL);
+ //@}
+
+protected:
+ /// The event channel.
+ TAO_EC_Event_Channel_Base* event_channel_;
+
+ /// The lock
+ ACE_Lock* lock_;
+
+ /// The handles are generated in sequential order, but are opaque to
+ /// the client.
+ RtecEventChannelAdmin::Observer_Handle handle_generator_;
+
+ /// Keep the set of Observers
+ Observer_Map observers_;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_EC_Reactive_ObserverStrategy
+ *
+ * @brief A reactive observer strategy.
+ *
+ * This class simply keeps the information about the current list
+ * of observers, whenever the list of consumers and/or suppliers
+ * changes in queries the EC, computes the global subscription
+ * and/or publication list and sends the update message to all the
+ * observers. When an observer isn't reachable it is removed from
+ * the observer list.
+ *
+ * <H2>Memory Management</H2>
+ * It assumes ownership of the <lock>, but not of the
+ * Event_Channel.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Reactive_ObserverStrategy :
+ public TAO_EC_Basic_ObserverStrategy
+{
+public:
+ /// Constructor
+ TAO_EC_Reactive_ObserverStrategy (TAO_EC_Event_Channel_Base* ec,
+ ACE_Lock* lock);
+
+ /// Destructor
+ virtual ~TAO_EC_Reactive_ObserverStrategy (void);
+
+protected:
+ /// Helpers.
+ //@{
+ /// Recompute EC consumer subscriptions and send them out to all observers.
+ virtual void consumer_qos_update (TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL);
+
+ /// Recompute EC supplier publications and send them out to all observers.
+ virtual void supplier_qos_update (TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Copies all current observers into a map and passes it
+ * back to the caller through @a map.
+ * @return Returns the size of the map.
+ */
+ int create_observer_map (Observer_Map &map
+ ACE_ENV_ARG_DECL);
+
+ /// The observer doesn't exist anymore
+ void observer_not_exists (Observer_Entry& observer
+ ACE_ENV_ARG_DECL);
+ //@}
+};
+
+// ****************************************************************
+
+class TAO_EC_Accumulate_Supplier_Headers :
+ public TAO_ESF_Worker<TAO_EC_ProxyPushSupplier>
+{
+public:
+ /// Constructor
+ TAO_EC_Accumulate_Supplier_Headers (TAO_EC_Basic_ObserverStrategy::Headers &headers);
+
+ virtual void work (TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_Basic_ObserverStrategy::Headers &headers_;
+};
+
+// ****************************************************************
+
+class TAO_EC_Accumulate_Consumer_Headers :
+ public TAO_ESF_Worker<TAO_EC_ProxyPushConsumer>
+{
+public:
+ /// Constructor
+ TAO_EC_Accumulate_Consumer_Headers (TAO_EC_Basic_ObserverStrategy::Headers &headers);
+
+ virtual void work (TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_Basic_ObserverStrategy::Headers &headers_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_ObserverStrategy.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_OBSERVERSTRATEGY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.i b/TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.i
new file mode 100644
index 00000000000..231db3f9417
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.i
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Null_ObserverStrategy::TAO_EC_Null_ObserverStrategy (void)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_EC_Basic_ObserverStrategy::Observer_Entry::Observer_Entry (void)
+ : handle (0)
+{
+}
+
+ACE_INLINE
+TAO_EC_Basic_ObserverStrategy::Observer_Entry::
+ Observer_Entry (RtecEventChannelAdmin::Observer_Handle h,
+ RtecEventChannelAdmin::Observer_ptr o)
+ : handle (h),
+ observer (o)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE int
+TAO_EC_Basic_ObserverStrategy::Header_Compare::
+ operator () (const RtecEventComm::EventHeader& lhs,
+ const RtecEventComm::EventHeader& rhs) const
+{
+ if (lhs.source == rhs.source)
+ return lhs.type < rhs.type;
+ return lhs.source < rhs.source;
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_EC_Basic_ObserverStrategy::
+ TAO_EC_Basic_ObserverStrategy (TAO_EC_Event_Channel_Base* ec,
+ ACE_Lock* lock)
+ : event_channel_ (ec),
+ lock_ (lock),
+ handle_generator_ (1)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_EC_Reactive_ObserverStrategy::
+ TAO_EC_Reactive_ObserverStrategy (TAO_EC_Event_Channel_Base* ec,
+ ACE_Lock* lock)
+ : TAO_EC_Basic_ObserverStrategy (ec, lock)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_EC_Accumulate_Supplier_Headers::
+ TAO_EC_Accumulate_Supplier_Headers (TAO_EC_Basic_ObserverStrategy::Headers &h)
+ : headers_ (h)
+{
+}
+
+// ****************************************************************
+
+ACE_INLINE
+TAO_EC_Accumulate_Consumer_Headers::
+ TAO_EC_Accumulate_Consumer_Headers (TAO_EC_Basic_ObserverStrategy::Headers &h)
+ : headers_ (h)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Per_Supplier_Filter.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Per_Supplier_Filter.cpp
new file mode 100644
index 00000000000..fe0ed5c6cc8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Per_Supplier_Filter.cpp
@@ -0,0 +1,213 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Per_Supplier_Filter.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_ProxyConsumer.h"
+#include "orbsvcs/Event/EC_Scheduling_Strategy.h"
+#include "orbsvcs/Event/EC_QOS_Info.h"
+
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+
+#include "orbsvcs/Event_Service_Constants.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Per_Supplier_Filter.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_Per_Supplier_Filter, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Per_Supplier_Filter::
+ TAO_EC_Per_Supplier_Filter (TAO_EC_Event_Channel_Base* ec)
+ : event_channel_ (ec),
+ consumer_ (0),
+ refcnt_ (1)
+{
+ this->event_channel_->create_proxy_collection (this->collection_);
+}
+
+TAO_EC_Per_Supplier_Filter::~TAO_EC_Per_Supplier_Filter (void)
+{
+ this->event_channel_->destroy_proxy_collection (this->collection_);
+ this->collection_ = 0;
+}
+
+void
+TAO_EC_Per_Supplier_Filter::bind (TAO_EC_ProxyPushConsumer* consumer)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (this->consumer_ != 0)
+ return;
+
+ this->consumer_ = consumer;
+}
+
+void
+TAO_EC_Per_Supplier_Filter::unbind (TAO_EC_ProxyPushConsumer* consumer)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (this->consumer_ == 0 || this->consumer_ != consumer)
+ return;
+
+ this->consumer_ = 0;
+
+ ACE_TRY_NEW_ENV
+ {
+ this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // @@ Ignore exceptions
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_EC_Per_Supplier_Filter::connected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (this->consumer_ == 0)
+ return;
+
+ const RtecEventChannelAdmin::SupplierQOS& pub =
+ this->consumer_->publications_i ();
+
+ for (CORBA::ULong j = 0; j < pub.publications.length (); ++j)
+ {
+ const RtecEventComm::Event& event =
+ pub.publications[j].event;
+
+#if TAO_EC_ENABLE_DEBUG_MESSAGES
+ ACE_DEBUG ((LM_DEBUG, "Connecting consumer <%x> to <%x>, "
+ "trying event <%d:%d> ",
+ supplier, this,
+ event.header.source, event.header.type));
+#endif /* TAO_EC_ENABLED_DEBUG_MESSAGES */
+ if (supplier->can_match (event.header))
+ {
+#if TAO_EC_ENABLE_DEBUG_MESSAGES
+ ACE_DEBUG ((LM_DEBUG, " matched\n"));
+#endif /* TAO_EC_ENABLED_DEBUG_MESSAGES */
+ this->collection_->connected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ return;
+ }
+#if TAO_EC_ENABLE_DEBUG_MESSAGES
+ ACE_DEBUG ((LM_DEBUG, " not matched\n"));
+#endif /* TAO_EC_ENABLED_DEBUG_MESSAGES */
+ }
+}
+
+void
+TAO_EC_Per_Supplier_Filter::reconnected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (this->consumer_ == 0)
+ return;
+
+ const RtecEventChannelAdmin::SupplierQOS& pub =
+ this->consumer_->publications_i ();
+
+ for (CORBA::ULong j = 0; j < pub.publications.length (); ++j)
+ {
+ const RtecEventComm::Event& event =
+ pub.publications[j].event;
+
+ // ACE_DEBUG ((LM_DEBUG, "Trying %d:%d in %x\n",
+ // event.header.source, event.header.type,
+ // this));
+ if (supplier->can_match (event.header))
+ {
+ // ACE_DEBUG ((LM_DEBUG, " matched %x\n", supplier));
+ this->collection_->connected (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ return;
+ }
+ }
+ this->collection_->disconnected (supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Per_Supplier_Filter::disconnected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ this->collection_->disconnected (supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Per_Supplier_Filter::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->collection_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Per_Supplier_Filter::push (const RtecEventComm::EventSet& event,
+ TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EC_Scheduling_Strategy* scheduling_strategy =
+ this->event_channel_->scheduling_strategy ();
+ scheduling_strategy->schedule_event (event,
+ consumer,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Per_Supplier_Filter::push_scheduled_event (RtecEventComm::EventSet &event,
+ const TAO_EC_QOS_Info &event_info
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EC_Filter_Worker worker (event, event_info);
+ this->collection_->for_each (&worker ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ULong
+TAO_EC_Per_Supplier_Filter::_incr_refcnt (void)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+
+ this->refcnt_++;
+ return this->refcnt_;
+}
+
+CORBA::ULong
+TAO_EC_Per_Supplier_Filter::_decr_refcnt (void)
+{
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+
+ this->refcnt_--;
+ if (this->refcnt_ != 0)
+ return this->refcnt_;
+ }
+ this->event_channel_->supplier_filter_builder ()->destroy (this);
+ return 0;
+}
+
+// ****************************************************************
+
+TAO_EC_Supplier_Filter*
+TAO_EC_Per_Supplier_Filter_Builder::create (
+ RtecEventChannelAdmin::SupplierQOS&)
+{
+ return new TAO_EC_Per_Supplier_Filter (this->event_channel_);
+}
+
+void
+TAO_EC_Per_Supplier_Filter_Builder::destroy (
+ TAO_EC_Supplier_Filter* x)
+{
+ delete x;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Per_Supplier_Filter.h b/TAO/orbsvcs/orbsvcs/Event/EC_Per_Supplier_Filter.h
new file mode 100644
index 00000000000..868c15d4e00
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Per_Supplier_Filter.h
@@ -0,0 +1,122 @@
+// -*- C++ -*-
+/**
+ * @file EC_Per_Supplier_Filter.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_PER_SUPPLIER_FILTER_H
+#define TAO_EC_PER_SUPPLIER_FILTER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Supplier_Filter.h"
+#include "orbsvcs/Event/EC_Supplier_Filter_Builder.h"
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class PROXY> class TAO_ESF_Proxy_Collection;
+class TAO_EC_Event_Channel_Base;
+
+/**
+ * @class TAO_EC_Per_Supplier_Filter
+ *
+ * @brief Filter the events on each supplier.
+ *
+ * This is a filtering strategy for the suppliers. In this
+ * particular case we keep a collection of the consumers that
+ * could potentially be interested in any event generated by a
+ * particular supplier.
+ * This minimizes the amount of consumers touched by the EC when
+ * dispatching an event.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Per_Supplier_Filter : public TAO_EC_Supplier_Filter
+{
+public:
+ /// Constructor
+ TAO_EC_Per_Supplier_Filter (TAO_EC_Event_Channel_Base* ec);
+
+ /// Destructor
+ virtual ~TAO_EC_Per_Supplier_Filter (void);
+
+ // = The TAO_EC_Supplier_Filter methods.
+ virtual void bind (TAO_EC_ProxyPushConsumer* consumer);
+ virtual void unbind (TAO_EC_ProxyPushConsumer* consumer);
+ virtual void connected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL);
+ virtual void reconnected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL);
+ virtual void disconnected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL);
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void push (const RtecEventComm::EventSet& event,
+ TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void push_scheduled_event (RtecEventComm::EventSet &event,
+ const TAO_EC_QOS_Info &event_info
+ ACE_ENV_ARG_DECL);
+ virtual CORBA::ULong _decr_refcnt (void);
+ virtual CORBA::ULong _incr_refcnt (void);
+
+private:
+ /// The event channel, used to locate the set of consumers.
+ TAO_EC_Event_Channel_Base *event_channel_;
+
+ /// The proxy for the supplier we are bound to.
+ TAO_EC_ProxyPushConsumer* consumer_;
+
+ /// Keep the collection of proxies for the consumers that may be
+ /// interested in our events.
+ TAO_ESF_Proxy_Collection<TAO_EC_ProxyPushSupplier>* collection_;
+
+ /// Reference counting
+ CORBA::ULong refcnt_;
+
+ /// Locking
+ TAO_SYNCH_MUTEX lock_;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_EC_Per_Supplier_Filter_Builder
+ *
+ * @brief Create Per_Supplier_Filter objects
+ *
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Per_Supplier_Filter_Builder : public TAO_EC_Supplier_Filter_Builder
+{
+public:
+ /// constructor....
+ TAO_EC_Per_Supplier_Filter_Builder (TAO_EC_Event_Channel_Base* ec);
+
+ // = The TAO_EC_Supplier_Filter_Builder methods...
+ virtual TAO_EC_Supplier_Filter*
+ create (RtecEventChannelAdmin::SupplierQOS& qos);
+ virtual void
+ destroy (TAO_EC_Supplier_Filter *filter);
+
+private:
+ /// The event channel
+ TAO_EC_Event_Channel_Base* event_channel_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Per_Supplier_Filter.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_PER_SUPPLIER_FILTER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Per_Supplier_Filter.i b/TAO/orbsvcs/orbsvcs/Event/EC_Per_Supplier_Filter.i
new file mode 100644
index 00000000000..4c950811fcc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Per_Supplier_Filter.i
@@ -0,0 +1,14 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Per_Supplier_Filter_Builder::
+TAO_EC_Per_Supplier_Filter_Builder (TAO_EC_Event_Channel_Base* ec)
+ : event_channel_ (ec)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Prefix_Filter_Builder.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Prefix_Filter_Builder.cpp
new file mode 100644
index 00000000000..61b79c68726
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Prefix_Filter_Builder.cpp
@@ -0,0 +1,158 @@
+// $Id$
+
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Event/EC_Prefix_Filter_Builder.h"
+#include "orbsvcs/Event/EC_Type_Filter.h"
+#include "orbsvcs/Event/EC_Conjunction_Filter.h"
+#include "orbsvcs/Event/EC_Disjunction_Filter.h"
+#include "orbsvcs/Event/EC_And_Filter.h"
+#include "orbsvcs/Event/EC_Negation_Filter.h"
+#include "orbsvcs/Event/EC_Bitmask_Filter.h"
+#include "orbsvcs/Event/EC_Masked_Type_Filter.h"
+#include "orbsvcs/Event/EC_Timeout_Filter.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Prefix_Filter_Builder.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_Prefix_Filter_Builder, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Prefix_Filter_Builder::~TAO_EC_Prefix_Filter_Builder (void)
+{
+}
+
+TAO_EC_Filter*
+TAO_EC_Prefix_Filter_Builder::build (
+ TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos
+ ACE_ENV_ARG_DECL_NOT_USED) const
+{
+ CORBA::ULong pos = 0;
+ return this->recursive_build (supplier, qos, pos);
+}
+
+TAO_EC_Filter*
+TAO_EC_Prefix_Filter_Builder:: recursive_build (
+ TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong& pos) const
+{
+ CORBA::ULong l = qos.dependencies.length ();
+ if (pos == l)
+ return 0;
+
+ const RtecEventComm::Event& e = qos.dependencies[pos].event;
+ if (e.header.type == ACE_ES_CONJUNCTION_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+ CORBA::ULong n = e.header.source;
+
+ TAO_EC_Filter** children;
+ ACE_NEW_RETURN (children, TAO_EC_Filter*[n], 0);
+ CORBA::ULong i = 0;
+ for (; i != n; ++i)
+ {
+ children[i] = this->recursive_build (supplier, qos, pos);
+ }
+ return new TAO_EC_Conjunction_Filter (children, n);
+ }
+ else if (e.header.type == ACE_ES_DISJUNCTION_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+ CORBA::ULong n = e.header.source;
+
+ TAO_EC_Filter** children;
+ ACE_NEW_RETURN (children, TAO_EC_Filter*[n], 0);
+ CORBA::ULong i = 0;
+ for (; i != n; ++i)
+ {
+ children[i] = this->recursive_build (supplier, qos, pos);
+ }
+ return new TAO_EC_Disjunction_Filter (children, n);
+ }
+
+ else if (e.header.type == ACE_ES_LOGICAL_AND_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+ CORBA::ULong n = e.header.source;
+
+ TAO_EC_Filter** children;
+ ACE_NEW_RETURN (children, TAO_EC_Filter*[n], 0);
+ CORBA::ULong i = 0;
+ for (; i != n; ++i)
+ {
+ children[i] = this->recursive_build (supplier, qos, pos);
+ }
+ return new TAO_EC_And_Filter (children, n);
+ }
+
+ else if (e.header.type == ACE_ES_NEGATION_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+
+ TAO_EC_Filter *child =
+ this->recursive_build (supplier, qos, pos);
+ return new TAO_EC_Negation_Filter (child);
+ }
+ else if (e.header.type == ACE_ES_BITMASK_DESIGNATOR)
+ {
+ pos++; // COnsumer the designator
+
+ if (pos == qos.dependencies.length ())
+ return 0;
+ CORBA::ULong source_mask = qos.dependencies[pos].event.header.source;
+ CORBA::ULong type_mask = qos.dependencies[pos].event.header.type;
+ pos++;
+
+ TAO_EC_Filter *child =
+ this->recursive_build (supplier, qos, pos);
+ return new TAO_EC_Bitmask_Filter (source_mask,
+ type_mask,
+ child);
+ }
+ else if (e.header.type == ACE_ES_MASKED_TYPE_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+
+ if (pos == qos.dependencies.length ())
+ return 0;
+ CORBA::ULong source_mask = qos.dependencies[pos].event.header.source;
+ CORBA::ULong type_mask = qos.dependencies[pos].event.header.type;
+ pos++;
+
+ if (pos == qos.dependencies.length ())
+ return 0;
+ CORBA::ULong source_value = qos.dependencies[pos].event.header.source;
+ CORBA::ULong type_value = qos.dependencies[pos].event.header.type;
+ pos++;
+
+ return new TAO_EC_Masked_Type_Filter (source_mask,
+ type_mask,
+ source_value,
+ type_value);
+ }
+ else if (e.header.type == ACE_ES_NULL_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+
+ return new TAO_EC_Null_Filter ();
+ }
+ else if (e.header.type == ACE_ES_EVENT_TIMEOUT
+ || e.header.type == ACE_ES_EVENT_INTERVAL_TIMEOUT
+ || e.header.type == ACE_ES_EVENT_DEADLINE_TIMEOUT)
+ {
+ pos++; // Consume the designator
+ TAO_EC_QOS_Info qos_info;
+ return new TAO_EC_Timeout_Filter (this->event_channel_,
+ supplier,
+ qos_info,
+ e.header.type,
+ e.header.creation_time);
+ }
+ pos++; // Consume the event
+ return new TAO_EC_Type_Filter (e.header);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Prefix_Filter_Builder.h b/TAO/orbsvcs/orbsvcs/Event/EC_Prefix_Filter_Builder.h
new file mode 100644
index 00000000000..7938278e895
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Prefix_Filter_Builder.h
@@ -0,0 +1,72 @@
+/* -*- C++ -*- */
+/**
+ * @file EC_Prefix_Filter_Builder.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_PREFIX_FILTER_BUILDER_H
+#define TAO_EC_PREFIX_FILTER_BUILDER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Filter_Builder.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Filter;
+class TAO_EC_Event_Channel_Base;
+
+/**
+ * @class TAO_EC_Prefix_Filter_Builder
+ *
+ * @brief Implement a builder for the fundamental filters.
+ *
+ * The prefix filtering mechanisms in the Event channel
+ * (source/type based filtering + disjunctions and conjunctions)
+ * are constructed using this class.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Prefix_Filter_Builder : public TAO_EC_Filter_Builder
+{
+public:
+ /// constructor.
+ TAO_EC_Prefix_Filter_Builder (TAO_EC_Event_Channel_Base* ec);
+
+ /// destructor...
+ virtual ~TAO_EC_Prefix_Filter_Builder (void);
+
+ // = The TAO_EC_Filter_Builder methods...
+ TAO_EC_Filter* build (TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos
+ ACE_ENV_ARG_DECL) const;
+
+private:
+ /// Recursively build the filter tree.
+ TAO_EC_Filter* recursive_build (TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong& pos) const;
+
+private:
+ /// The event channel.
+ TAO_EC_Event_Channel_Base* event_channel_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Prefix_Filter_Builder.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_PREFIX_FILTER_BUILDER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Prefix_Filter_Builder.i b/TAO/orbsvcs/orbsvcs/Event/EC_Prefix_Filter_Builder.i
new file mode 100644
index 00000000000..c4ddf4074b0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Prefix_Filter_Builder.i
@@ -0,0 +1,14 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Prefix_Filter_Builder::
+ TAO_EC_Prefix_Filter_Builder (TAO_EC_Event_Channel_Base *ec)
+ : event_channel_ (ec)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Priority_Dispatching.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Priority_Dispatching.cpp
new file mode 100644
index 00000000000..1e41905c0ca
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Priority_Dispatching.cpp
@@ -0,0 +1,141 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Priority_Dispatching.h"
+#include "orbsvcs/Event/EC_Dispatching_Task.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_QOS_Info.h"
+
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/RtecSchedulerC.h"
+
+#include "ace/Sched_Params.h"
+
+ACE_RCSID(Event, EC_Priority_Dispatching, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Priority_Dispatching::TAO_EC_Priority_Dispatching (TAO_EC_Event_Channel_Base *ec)
+ : ntasks_ (0),
+ tasks_ (0)
+{
+ CORBA::Object_var tmp = ec->scheduler ();
+ this->scheduler_ = RtecScheduler::Scheduler::_narrow (tmp.in ());
+}
+
+void
+TAO_EC_Priority_Dispatching::activate (void)
+{
+ if (this->tasks_ != 0)
+ return;
+
+ // @@ Query the scheduler to obtain this....
+ this->ntasks_ = ACE_Scheduler_MAX_PRIORITIES;
+ ACE_NEW (this->tasks_, TAO_EC_Dispatching_Task*[this->ntasks_]);
+
+ // @@ Query the scheduler to obtain the priorities!
+ 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);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ for (int i = 0; i < this->ntasks_; ++i)
+ {
+ ACE_TRY
+ {
+ RtecScheduler::Period_t period =
+ ACE_CU64_TO_CU32 (ACE_Scheduler_Rates[i]);
+ char buf[128];
+ ACE_OS::sprintf (buf, "Dispatching_Task-%d.us", period);
+
+ RtecScheduler::handle_t rt_info =
+ this->scheduler_->create (buf ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->scheduler_->set (rt_info,
+ RtecScheduler::VERY_LOW_CRITICALITY,
+ 0, // worst_cast_execution_time
+ 0, // typical_cast_execution_time
+ 0, // cached_cast_execution_time
+ period,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ 0, // quantum
+ 1, // threads
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions..
+ }
+ ACE_ENDTRY;
+
+ ACE_NEW (this->tasks_[i],
+ TAO_EC_Dispatching_Task (&this->thread_manager_));
+
+ // @@ Query the scheduler to obtain the priority...
+ long flags = THR_BOUND | THR_SCHED_FIFO;
+ if (this->tasks_[i]->activate (flags, 1, 1, priority) == -1)
+ {
+ flags = THR_BOUND;
+ priority = ACE_Sched_Params::priority_min (ACE_SCHED_OTHER,
+ ACE_SCOPE_THREAD);
+ if (this->tasks_[i]->activate (flags, 1, 1, priority) == -1)
+ ACE_ERROR ((LM_ERROR,
+ "EC (%P|%t) cannot activate queue %d", i));
+ }
+ }
+}
+
+void
+TAO_EC_Priority_Dispatching::shutdown (void)
+{
+ if (this->tasks_ == 0)
+ return;
+
+ for (int i = 0; i < this->ntasks_; ++i)
+ this->tasks_[i]->putq (new TAO_EC_Shutdown_Task_Command);
+
+ this->thread_manager_.wait ();
+
+ for (int j = 0; j < this->ntasks_; ++j)
+ delete this->tasks_[j];
+
+ delete[] this->tasks_;
+ this->tasks_ = 0;
+}
+
+void
+TAO_EC_Priority_Dispatching::push (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventComm::EventSet event_copy = event;
+ this->push_nocopy (proxy, consumer, event_copy, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Priority_Dispatching::push_nocopy (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (this->tasks_ == 0)
+ this->activate ();
+
+ int i = qos_info.preemption_priority;
+ if (i < 0 || i >= this->ntasks_)
+ {
+ // @@ Throw something?
+ i = 0;
+ }
+
+
+ this->tasks_[i]->push (proxy, consumer, event ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Priority_Dispatching.h b/TAO/orbsvcs/orbsvcs/Event/EC_Priority_Dispatching.h
new file mode 100644
index 00000000000..ebbb6cd6085
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Priority_Dispatching.h
@@ -0,0 +1,90 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Priority_Dispatching.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_PRIORITY_DISPATCHING_H
+#define TAO_EC_PRIORITY_DISPATCHING_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Dispatching.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RtecSchedulerC.h"
+#include "orbsvcs/Event/sched_event_export.h"
+
+#include "ace/Thread_Manager.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Dispatching_Task;
+class TAO_EC_Event_Channel_Base;
+
+/**
+ * @class TAO_EC_Priority_Dispatching
+ *
+ * @brief Dispatching strategy that minimizes priority inversion.
+ *
+ * This strategy uses multiple queues, each serviced by a thread
+ * at different priority. This minimizes priority inversion
+ * because the consumers at higher priority are serviced before
+ * consumers at lower priority.
+ * It is more flexible than using the supplier thread to dispatch
+ * because it allows high-priority suppliers to push events to
+ * low-priority consumers (and vice-versa).
+ * It also isolates the supplier threads from the time spent on
+ * upcalls to the consumer objects, making the system easier to
+ * analyze and schedule.
+ */
+class TAO_RTSchedEvent_Export TAO_EC_Priority_Dispatching : public TAO_EC_Dispatching
+{
+public:
+ /// The scheduler is used to find the range of priorities and similar
+ /// info.
+ TAO_EC_Priority_Dispatching (TAO_EC_Event_Channel_Base* ec);
+
+ // = The EC_Dispatching methods.
+ virtual void activate (void);
+ virtual void shutdown (void);
+ virtual void push (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ /// Use our own thread manager.
+ ACE_Thread_Manager thread_manager_;
+
+ /// The number of active tasks
+ int ntasks_;
+
+ /// The tasks..
+ TAO_EC_Dispatching_Task** tasks_;
+
+ /// The scheduler
+ RtecScheduler::Scheduler_var scheduler_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_PRIORITY_DISPATCHING_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Priority_Scheduling.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Priority_Scheduling.cpp
new file mode 100644
index 00000000000..0bf92510d54
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Priority_Scheduling.cpp
@@ -0,0 +1,100 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Priority_Scheduling.h"
+#include "orbsvcs/Event/EC_QOS_Info.h"
+#include "orbsvcs/Event/EC_ProxyConsumer.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_Supplier_Filter.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Priority_Scheduling.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_Priority_Scheduling, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Priority_Scheduling::~TAO_EC_Priority_Scheduling (void)
+{
+}
+
+void
+TAO_EC_Priority_Scheduling::add_proxy_supplier_dependencies (
+ TAO_EC_ProxyPushSupplier *supplier,
+ TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG, "add_proxy_supplier_dependencies - %x %x\n",
+ supplier, consumer));
+ const RtecEventChannelAdmin::SupplierQOS& qos =
+ consumer->publications ();
+ for (CORBA::ULong i = 0; i < qos.publications.length (); ++i)
+ {
+ const RtecEventComm::EventHeader &header =
+ qos.publications[i].event.header;
+ TAO_EC_QOS_Info qos_info;
+ qos_info.rt_info = qos.publications[i].dependency_info.rt_info;
+
+ RtecScheduler::OS_Priority os_priority;
+ RtecScheduler::Preemption_Subpriority_t p_subpriority;
+ RtecScheduler::Preemption_Priority_t p_priority;
+ this->scheduler_->priority (qos_info.rt_info,
+ os_priority,
+ p_subpriority,
+ p_priority
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ qos_info.preemption_priority = p_priority;
+
+ supplier->add_dependencies (header, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_EC_Priority_Scheduling::schedule_event (const RtecEventComm::EventSet &event,
+ TAO_EC_ProxyPushConsumer *consumer,
+ TAO_EC_Supplier_Filter *filter
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventChannelAdmin::SupplierQOS qos =
+ consumer->publications ();
+
+ for (CORBA::ULong j = 0; j != event.length (); ++j)
+ {
+ const RtecEventComm::Event& e = event[j];
+ RtecEventComm::Event* buffer =
+ const_cast<RtecEventComm::Event*> (&e);
+ RtecEventComm::EventSet single_event (1, 1, buffer, 0);
+
+ TAO_EC_QOS_Info qos_info;
+
+ for (CORBA::ULong i = 0; i != qos.publications.length (); ++i)
+ {
+ const RtecEventComm::EventHeader &qos_header =
+ qos.publications[i].event.header;
+
+ if (TAO_EC_Filter::matches (e.header, qos_header) == 0)
+ continue;
+
+ qos_info.rt_info = qos.publications[i].dependency_info.rt_info;
+
+ RtecScheduler::OS_Priority os_priority;
+ RtecScheduler::Preemption_Subpriority_t p_subpriority;
+ RtecScheduler::Preemption_Priority_t p_priority;
+ this->scheduler_->priority (qos_info.rt_info,
+ os_priority,
+ p_subpriority,
+ p_priority
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ qos_info.preemption_priority = p_priority;
+ }
+
+ filter->push_scheduled_event (single_event, qos_info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Priority_Scheduling.h b/TAO/orbsvcs/orbsvcs/Event/EC_Priority_Scheduling.h
new file mode 100644
index 00000000000..ef5be319f06
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Priority_Scheduling.h
@@ -0,0 +1,76 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Priority_Scheduling.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_PRIORITY_SCHEDULING_H
+#define TAO_EC_PRIORITY_SCHEDULING_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Scheduling_Strategy.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RtecSchedulerC.h"
+#include "orbsvcs/Event/sched_event_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Priority_Scheduling
+ *
+ * @brief A scheduling strategy that uses TAO's real-time scheduler
+ *
+ * This implementation of the Scheduling_Strategy uses TAO's
+ * real-time scheduler.
+ */
+class TAO_RTSchedEvent_Export TAO_EC_Priority_Scheduling : public TAO_EC_Scheduling_Strategy
+{
+public:
+ /// Constructor.
+ TAO_EC_Priority_Scheduling (RtecScheduler::Scheduler_ptr scheduler);
+
+ /// Destructor
+ virtual ~TAO_EC_Priority_Scheduling (void);
+
+ virtual void add_proxy_supplier_dependencies (
+ TAO_EC_ProxyPushSupplier *supplier,
+ TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL);
+ virtual void schedule_event (const RtecEventComm::EventSet &event,
+ TAO_EC_ProxyPushConsumer *consumer,
+ TAO_EC_Supplier_Filter *filter
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_Priority_Scheduling (const TAO_EC_Priority_Scheduling&);
+ TAO_EC_Priority_Scheduling& operator= (const TAO_EC_Priority_Scheduling&);
+
+ /// Initialize our RT_Info handle and dependencies
+ void init_rt_info (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// The scheduler we are going to use
+ RtecScheduler::Scheduler_var scheduler_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Priority_Scheduling.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_PRIORITY_SCHEDULING_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Priority_Scheduling.i b/TAO/orbsvcs/orbsvcs/Event/EC_Priority_Scheduling.i
new file mode 100644
index 00000000000..2de353d965e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Priority_Scheduling.i
@@ -0,0 +1,14 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Priority_Scheduling::TAO_EC_Priority_Scheduling (
+ RtecScheduler::Scheduler_ptr scheduler)
+ : scheduler_ (RtecScheduler::Scheduler::_duplicate (scheduler))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.cpp
new file mode 100644
index 00000000000..f16960141c1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.cpp
@@ -0,0 +1,310 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_ProxyConsumer.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_Supplier_Filter.h"
+#include "orbsvcs/Event/EC_Supplier_Filter_Builder.h"
+
+#include "ace/Reverse_Lock_T.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_ProxyConsumer.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Event,
+ EC_ProxyConsumer,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef ACE_Reverse_Lock<ACE_Lock> TAO_EC_Unlock;
+
+TAO_EC_ProxyPushConsumer::
+ TAO_EC_ProxyPushConsumer (TAO_EC_Event_Channel_Base* ec)
+ : event_channel_ (ec),
+ refcount_ (1),
+ connected_ (0),
+ filter_ (0)
+{
+ this->lock_ =
+ this->event_channel_->create_consumer_lock ();
+
+ this->default_POA_ =
+ this->event_channel_->consumer_poa ();
+
+ this->qos_.is_gateway = 0;
+}
+
+TAO_EC_ProxyPushConsumer::~TAO_EC_ProxyPushConsumer (void)
+{
+ this->event_channel_->destroy_consumer_lock (this->lock_);
+ this->cleanup_i ();
+}
+
+
+CORBA::Boolean
+TAO_EC_ProxyPushConsumer::supplier_non_existent (
+ CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var supplier;
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ disconnected = 0;
+ if (this->is_connected_i () == 0)
+ {
+ disconnected = 1;
+ return 0;
+ }
+ if (CORBA::is_nil (this->supplier_.in ()))
+ {
+ return 0;
+ }
+ supplier = CORBA::Object::_duplicate (this->supplier_.in ());
+ }
+
+#if (TAO_HAS_MINIMUM_CORBA == 0)
+ return supplier->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER);
+#else
+ return 0;
+#endif /* TAO_HAS_MINIMUM_CORBA */
+}
+
+void
+TAO_EC_ProxyPushConsumer::connected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EC_ProxyPushConsumer_Guard ace_mon (this->lock_,
+ this->refcount_,
+ this->event_channel_,
+ this);
+ if (!ace_mon.locked ())
+ return;
+
+ ace_mon.filter->connected (supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_ProxyPushConsumer::reconnected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EC_ProxyPushConsumer_Guard ace_mon (this->lock_,
+ this->refcount_,
+ this->event_channel_,
+ this);
+ if (!ace_mon.locked ())
+ return;
+
+ ace_mon.filter->reconnected (supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_ProxyPushConsumer::disconnected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EC_ProxyPushConsumer_Guard ace_mon (this->lock_,
+ this->refcount_,
+ this->event_channel_,
+ this);
+ if (!ace_mon.locked ())
+ return;
+
+ ace_mon.filter->disconnected (supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_ProxyPushConsumer::connected (TAO_EC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_ProxyPushConsumer::reconnected (TAO_EC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_ProxyPushConsumer::disconnected (TAO_EC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_ProxyPushConsumer::shutdown_hook (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_ProxyPushConsumer::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RtecEventComm::PushSupplier_var supplier;
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ supplier = this->supplier_._retn ();
+ this->connected_ = 0;
+
+ this->shutdown_hook (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->filter_ != 0)
+ {
+ this->filter_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->cleanup_i ();
+ }
+ }
+
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (supplier.in ()))
+ return;
+
+ ACE_TRY
+ {
+ supplier->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // failures on this one.
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_EC_ProxyPushConsumer::cleanup_i (void)
+{
+ this->supplier_ =
+ RtecEventComm::PushSupplier::_nil ();
+ this->connected_ = 0;
+
+ if (this->filter_ != 0)
+ {
+ this->filter_->unbind (this);
+ this->filter_->_decr_refcnt ();
+ this->filter_ = 0;
+ }
+}
+
+void
+TAO_EC_ProxyPushConsumer::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ PortableServer::ObjectId id =
+ this->object_id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->default_POA_->deactivate_object (id ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Exceptions here should not be propagated. They usually
+ // indicate that an object is beign disconnected twice, or some
+ // race condition, but not a fault that the user needs to know
+ // about.
+ }
+ ACE_ENDTRY;
+}
+
+CORBA::ULong
+TAO_EC_ProxyPushConsumer::_incr_refcnt (void)
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ return this->refcount_++;
+}
+
+void
+TAO_EC_ProxyPushConsumer::refcount_zero_hook (void)
+{
+ // Use the event channel
+ this->event_channel_->destroy_proxy (this);
+}
+
+CORBA::ULong
+TAO_EC_ProxyPushConsumer::_decr_refcnt (void)
+{
+ {
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ this->refcount_--;
+ if (this->refcount_ != 0)
+ return this->refcount_;
+ }
+
+ this->refcount_zero_hook ();
+ return 0;
+}
+
+
+// ****************************************************************
+
+TAO_EC_ProxyPushConsumer_Guard::
+ TAO_EC_ProxyPushConsumer_Guard (ACE_Lock *lock,
+ CORBA::ULong &refcount,
+ TAO_EC_Event_Channel_Base *ec,
+ TAO_EC_ProxyPushConsumer *proxy)
+ : lock_ (lock),
+ refcount_ (refcount),
+ event_channel_ (ec),
+ proxy_ (proxy),
+ locked_ (0)
+{
+ ACE_Guard<ACE_Lock> ace_mon (*this->lock_);
+ // If the guard fails there is not much we can do, raising an
+ // exception is wrong, the client has *no* way to handle that kind
+ // of error. Even worse, there is no exception to raise in that
+ // case.
+ // @@ Returning something won't work either, the error should be
+ // logged though!
+
+ if (proxy->is_connected_i () == 0)
+ return;
+
+ this->filter = this->proxy_->filter_i ();
+ this->filter->_incr_refcnt ();
+
+ this->locked_ = 1;
+ this->refcount_++;
+}
+
+TAO_EC_ProxyPushConsumer_Guard::
+ ~TAO_EC_ProxyPushConsumer_Guard (void)
+{
+ // This access is safe because guard objects are created on the
+ // stack, only one thread has access to them
+ if (!this->locked_)
+ return;
+
+ {
+ ACE_Guard<ACE_Lock> ace_mon (*this->lock_);
+ // If the guard fails there is not much we can do, raising an
+ // exception is wrong, the client has *no* way to handle that kind
+ // of error. Even worse, there is no exception to raise in that
+ // case.
+ // @@ Returning something won't work either, the error should be
+ // logged though!
+
+ this->filter->_decr_refcnt ();
+
+ this->refcount_--;
+ if (this->refcount_ != 0)
+ return;
+ }
+
+ this->proxy_->refcount_zero_hook ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.h b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.h
new file mode 100644
index 00000000000..e70e0ee6ca2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.h
@@ -0,0 +1,238 @@
+// -*- C++ -*-
+/**
+ * @file EC_ProxyConsumer.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_PROXYCONSUMER_H
+#define TAO_EC_PROXYCONSUMER_H
+
+#include /**/ "ace/pre.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#include "orbsvcs/RtecEventChannelAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Event_Channel_Base;
+class TAO_EC_ProxyPushSupplier;
+class TAO_EC_Supplier_Filter;
+
+/**
+ * @class TAO_EC_ProxyPushConsumer
+ *
+ * @brief ProxyPushConsumer
+ *
+ * Implement the RtecEventChannelAdmin::ProxyPushConsumer interface,
+ * remember that this class is used to communicate with a
+ * PushSupplier, so, in effect, this is the ambassador for a
+ * supplier inside the event channel.
+ *
+ * <H2>Memory Management</H2>
+ * It makes a copy of the SupplierQOS and the supplier object
+ * reference.
+ * It uses bind/unbind to control the lifetime of the
+ * Supplier_Filter object.
+ * The object commits suicide when disconnect_push_consumer() is
+ * called.
+ *
+ * <H2>Locking</H2>
+ * No provisions for locking, access must be serialized
+ * externally.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_ProxyPushConsumer
+{
+public:
+ typedef RtecEventChannelAdmin::ProxyPushConsumer Interface;
+ typedef RtecEventChannelAdmin::ProxyPushConsumer_var _var_type;
+ typedef RtecEventChannelAdmin::ProxyPushConsumer_ptr _ptr_type;
+
+ /// constructor...
+ TAO_EC_ProxyPushConsumer (TAO_EC_Event_Channel_Base* event_channel);
+
+ /// destructor...
+ virtual ~TAO_EC_ProxyPushConsumer (void);
+
+ /// Activate in the POA
+ virtual void activate (
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr &proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+
+ /// Deactivate from the POA
+ virtual void deactivate (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Disconnect this from
+ virtual void disconnect_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ /// Return 0 if no supplier is connected...
+ CORBA::Boolean is_connected (void) const;
+
+ /// Return the consumer object reference. It returns nil() if it has
+ /// not connected yet.
+ RtecEventComm::PushSupplier_ptr supplier (void) const;
+
+ /// The QoS (subscription) used to connect to the EC.
+ const RtecEventChannelAdmin::SupplierQOS& publications (void) const;
+
+ /**
+ * Invoke the _non_existent() pseudo-operation on the supplier. If
+ * it is disconnected then it returns true and sets the
+ * <disconnected> flag.
+ */
+ CORBA::Boolean supplier_non_existent (CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL);
+
+ /// Concrete implementations can use this methods to keep track of
+ /// the consumers interested in this events.
+ virtual void connected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL);
+ virtual void reconnected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL);
+ virtual void disconnected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL);
+
+ /// Usually implemented as no-ops, but some configurations may
+ /// require this methods.
+ virtual void connected (TAO_EC_ProxyPushConsumer* consumer
+ ACE_ENV_ARG_DECL);
+ virtual void reconnected (TAO_EC_ProxyPushConsumer* consumer
+ ACE_ENV_ARG_DECL);
+ virtual void disconnected (TAO_EC_ProxyPushConsumer* consumer
+ ACE_ENV_ARG_DECL);
+
+ /// The event channel is shutting down
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+ /// The QoS (subscription) used to connect to the EC, assumes the
+ /// locks are held, use with care!
+ const RtecEventChannelAdmin::SupplierQOS& publications_i (void) const;
+
+ /// Increment and decrement the reference count.
+ CORBA::ULong _incr_refcnt (void);
+ CORBA::ULong _decr_refcnt (void);
+
+
+protected:
+ /// Set the supplier, used by some implementations to change the
+ /// policies used when invoking operations on the supplier.
+ void supplier (RtecEventComm::PushSupplier_ptr supplier);
+ void supplier_i (RtecEventComm::PushSupplier_ptr supplier);
+
+ friend class TAO_EC_ProxyPushConsumer_Guard;
+ // The guard needs access to the following protected methods.
+
+ /// The private version (without locking) of is_connected().
+ CORBA::Boolean is_connected_i (void) const;
+
+ /// Return the current filter, assumes the locks are held.
+ TAO_EC_Supplier_Filter *filter_i (void) const;
+
+ /// Release the filter and the supplier
+ void cleanup_i (void);
+
+ /// The supplier admin, used for activation and memory managment.
+ TAO_EC_Event_Channel_Base* event_channel_;
+
+ /// The locking strategy.
+ ACE_Lock* lock_;
+
+ /// The reference count.
+ CORBA::ULong refcount_;
+
+ /// The supplier....
+ RtecEventComm::PushSupplier_var supplier_;
+
+ /// If the flag is not zero then we are connected, notice that the
+ /// supplier can be nil.
+ int connected_;
+
+ /// The publication and QoS information...
+ RtecEventChannelAdmin::SupplierQOS qos_;
+
+ /// Store the default POA.
+ PortableServer::POA_var default_POA_;
+
+ /// The strategy to do filtering close to the supplier
+ TAO_EC_Supplier_Filter* filter_;
+
+private:
+ /// Template method hooks.
+ virtual void shutdown_hook (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void refcount_zero_hook (void);
+
+ virtual PortableServer::ObjectId
+ object_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_EC_ProxyPushConsumer_Guard
+ *
+ * @brief A Guard for the ProxyPushConsumer reference count
+ *
+ * This is a helper class used in the implementation of
+ * ProxyPushConumer. It provides a Guard mechanism to increment
+ * the reference count on the proxy and its filter, eliminating
+ * the need to hold mutexes during long operations.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_ProxyPushConsumer_Guard
+{
+public:
+ /// Constructor
+ TAO_EC_ProxyPushConsumer_Guard (ACE_Lock *lock,
+ CORBA::ULong &refcount,
+ TAO_EC_Event_Channel_Base *ec,
+ TAO_EC_ProxyPushConsumer *proxy);
+
+ /// Destructor
+ ~TAO_EC_ProxyPushConsumer_Guard (void);
+
+ /// Returns 1 if the reference count successfully acquired
+ int locked (void) const;
+
+ TAO_EC_Supplier_Filter *filter;
+
+private:
+ /// The lock used to protect the reference count
+ ACE_Lock *lock_;
+
+ /// The reference count
+ CORBA::ULong &refcount_;
+
+ /// The event channel used to destroy the proxy
+ TAO_EC_Event_Channel_Base *event_channel_;
+
+ /// The proxy whose lifetime is controlled by the reference count
+ TAO_EC_ProxyPushConsumer *proxy_;
+
+ /// This flag is set to 1 if the reference count was successfully
+ /// acquired.
+ int locked_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_ProxyConsumer.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_PROXYCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.i b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.i
new file mode 100644
index 00000000000..44ef91ef2e7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.i
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE CORBA::Boolean
+TAO_EC_ProxyPushConsumer::is_connected_i (void) const
+{
+ return this->connected_;
+}
+
+ACE_INLINE CORBA::Boolean
+TAO_EC_ProxyPushConsumer::is_connected (void) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+
+ return this->is_connected_i ();
+}
+
+ACE_INLINE RtecEventComm::PushSupplier_ptr
+TAO_EC_ProxyPushConsumer::supplier (void) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ return RtecEventComm::PushSupplier::_duplicate (this->supplier_.in ());
+}
+
+ACE_INLINE void
+TAO_EC_ProxyPushConsumer::supplier_i (RtecEventComm::PushSupplier_ptr supplier)
+{
+ this->supplier_ = supplier;
+}
+
+ACE_INLINE void
+TAO_EC_ProxyPushConsumer::supplier (RtecEventComm::PushSupplier_ptr supplier)
+{
+ ACE_GUARD (ACE_Lock, ace_mon, *this->lock_);
+
+ this->supplier_i (supplier);
+}
+
+ACE_INLINE const RtecEventChannelAdmin::SupplierQOS&
+TAO_EC_ProxyPushConsumer::publications (void) const
+{
+ // @@ TODO There should some way to signal errors here.
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, this->qos_);
+
+ return this->qos_;
+}
+
+ACE_INLINE const RtecEventChannelAdmin::SupplierQOS&
+TAO_EC_ProxyPushConsumer::publications_i (void) const
+{
+ return this->qos_;
+}
+
+ACE_INLINE TAO_EC_Supplier_Filter *
+TAO_EC_ProxyPushConsumer::filter_i (void) const
+{
+ return this->filter_;
+}
+
+// ****************************************************************
+
+ACE_INLINE int
+TAO_EC_ProxyPushConsumer_Guard::locked (void) const
+{
+ return this->locked_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.cpp
new file mode 100644
index 00000000000..37204dcf67b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.cpp
@@ -0,0 +1,535 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_Dispatching.h"
+#include "orbsvcs/Event/EC_Filter_Builder.h"
+#include "orbsvcs/Event/EC_QOS_Info.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_Scheduling_Strategy.h"
+#include "orbsvcs/Event/EC_ConsumerControl.h"
+#include "orbsvcs/Event/EC_SupplierAdmin.h"
+#include "orbsvcs/ESF/ESF_RefCount_Guard.h"
+#include "orbsvcs/ESF/ESF_Proxy_RefCount_Guard.h"
+
+#include "ace/Reverse_Lock_T.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_ProxySupplier.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Event,
+ EC_ProxySupplier,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef ACE_Reverse_Lock<ACE_Lock> TAO_EC_Unlock;
+
+TAO_EC_ProxyPushSupplier::TAO_EC_ProxyPushSupplier (TAO_EC_Event_Channel_Base* ec, int validate_connection)
+ : event_channel_ (ec),
+ refcount_ (1),
+ suspended_ (0),
+ child_ (0),
+ consumer_validate_connection_(validate_connection)
+{
+ this->lock_ =
+ this->event_channel_->create_supplier_lock ();
+
+ this->default_POA_ =
+ this->event_channel_->supplier_poa ();
+}
+
+TAO_EC_ProxyPushSupplier::~TAO_EC_ProxyPushSupplier (void)
+{
+ this->event_channel_->destroy_supplier_lock (this->lock_);
+ this->cleanup_i ();
+}
+
+void
+TAO_EC_ProxyPushSupplier::connected (TAO_EC_ProxyPushConsumer* consumer
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EC_Scheduling_Strategy *s =
+ this->event_channel_->scheduling_strategy ();
+
+ s->add_proxy_supplier_dependencies (this,
+ consumer
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_ProxyPushSupplier::reconnected (TAO_EC_ProxyPushConsumer* consumer
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EC_Scheduling_Strategy *s =
+ this->event_channel_->scheduling_strategy ();
+
+ s->add_proxy_supplier_dependencies (this,
+ consumer
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_ProxyPushSupplier::disconnected (TAO_EC_ProxyPushConsumer*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_ProxyPushSupplier::connected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_ProxyPushSupplier::reconnected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_ProxyPushSupplier::disconnected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_ProxyPushSupplier::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Save the consumer we where connected to, we need to send a
+ // disconnect message to it.
+ RtecEventComm::PushConsumer_var consumer;
+
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ int connected = this->is_connected_i ();
+
+ consumer = this->consumer_._retn ();
+
+ if (connected)
+ this->cleanup_i ();
+ }
+
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (consumer.in ()))
+ return;
+
+ ACE_TRY
+ {
+ consumer->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions, we must isolate other clients from
+ // problems on this one.
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_EC_ProxyPushSupplier::cleanup_i (void)
+{
+ this->consumer_ =
+ RtecEventComm::PushConsumer::_nil ();
+
+ // @@ Why don't we have a destroy() method in the
+ // filter_builder?
+ delete this->child_;
+ this->child_ = 0;
+}
+
+void
+TAO_EC_ProxyPushSupplier::deactivate (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC (())
+{
+ ACE_TRY
+ {
+ PortableServer::ObjectId id =
+ this->object_id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->default_POA_->deactivate_object (id ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Exceptions here should not be propagated. They usually
+ // indicate that an object is beign disconnected twice, or some
+ // race condition, but not a fault that the user needs to know
+ // about.
+ }
+ ACE_ENDTRY;
+}
+
+CORBA::ULong
+TAO_EC_ProxyPushSupplier::_incr_refcnt (void)
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ return this->refcount_++;
+}
+
+void
+TAO_EC_ProxyPushSupplier::refcount_zero_hook (void)
+{
+ // Use the event channel
+ this->event_channel_->destroy_proxy (this);
+}
+
+CORBA::ULong
+TAO_EC_ProxyPushSupplier::_decr_refcnt (void)
+{
+ {
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ this->refcount_--;
+ if (this->refcount_ != 0)
+ return this->refcount_;
+ }
+
+ this->refcount_zero_hook ();
+ return 0;
+}
+
+typedef TAO_ESF_Proxy_RefCount_Guard<TAO_EC_Event_Channel_Base,TAO_EC_ProxyPushSupplier> Destroy_Guard;
+
+int
+TAO_EC_ProxyPushSupplier::filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ Destroy_Guard auto_destroy (this->refcount_,
+ this->event_channel_,
+ this);
+
+ int result = 0;
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK_RETURN (0);
+
+ if (this->is_connected_i () == 0)
+ return 0;
+
+ result =
+ this->child_->filter (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ return result;
+}
+
+int
+TAO_EC_ProxyPushSupplier::filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ Destroy_Guard auto_destroy (this->refcount_,
+ this->event_channel_,
+ this);
+
+ int result = 0;
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK_RETURN (0);
+
+ if (this->is_connected_i () == 0)
+ return 0;
+
+ result =
+ this->child_->filter_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ return result;
+}
+
+void
+TAO_EC_ProxyPushSupplier::push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ // The mutex is already held by the caller (usually the filter()
+ // method)
+ if (this->is_connected_i () == 0)
+ return; // TAO_THROW (RtecEventComm::Disconnected ());????
+
+ if (this->suspended_ != 0)
+ return;
+
+ TAO_ESF_RefCount_Guard<CORBA::ULong> ace_mon (this->refcount_);
+ // The guard will decrement the reference count, notice that the
+ // reference count can become 0, but this is not the right spot to
+ // check for that and destroy the object.
+ // If we did so then we would destroy the object, and consequently
+ // the mutex, but the mutex is used later when the stack unwinds and
+ // the filter() method tries to destroy the mutex (that originally
+ // acquired the mutex in the first place).
+ // So the correct thing to do is to just decrement the reference
+ // count and let the filter() method do the destruction.
+
+ RtecEventComm::PushConsumer_var consumer =
+ RtecEventComm::PushConsumer::_duplicate (this->consumer_.in ());
+
+ this->pre_dispatch_hook (const_cast<RtecEventComm::EventSet&> (event)
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ {
+ // We have to release the lock to avoid dead-locks.
+ TAO_EC_Unlock reverse_lock (*this->lock_);
+
+ ACE_GUARD_THROW_EX (TAO_EC_Unlock, ace_mon, reverse_lock,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ this->event_channel_->dispatching ()->push (this,
+ consumer.in (),
+ event,
+ qos_info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (this->child_ != 0)
+ this->child_->clear ();
+}
+
+void
+TAO_EC_ProxyPushSupplier::pre_dispatch_hook (RtecEventComm::EventSet&
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_ProxyPushSupplier::push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ // The mutex is already held by the caller (usually the filter()
+ // method)
+ if (this->is_connected_i () == 0)
+ return; // TAO_THROW (RtecEventComm::Disconnected ());????
+
+ if (this->suspended_ != 0)
+ return;
+
+ TAO_ESF_RefCount_Guard<CORBA::ULong> ace_mon (this->refcount_);
+ // The guard will decrement the reference count, notice that the
+ // reference count can become 0, but this is not the right spot to
+ // check for that and destroy the object.
+ // If we did so then we would destroy the object, and consequently
+ // the mutex, but the mutex is used later when the stack unwinds and
+ // the filter() method tries to destroy the mutex (that originally
+ // acquired the mutex in the first place).
+ // So the correct thing to do is to just decrement the reference
+ // count and let the filter() method do the destruction.
+
+ RtecEventComm::PushConsumer_var consumer =
+ RtecEventComm::PushConsumer::_duplicate (this->consumer_.in ());
+
+ this->pre_dispatch_hook (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ {
+ TAO_EC_Unlock reverse_lock (*this->lock_);
+
+ ACE_GUARD_THROW_EX (TAO_EC_Unlock, ace_mon, reverse_lock,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ this->event_channel_->dispatching ()->push_nocopy (this,
+ consumer.in (),
+ event,
+ qos_info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (this->child_ != 0)
+ this->child_->clear ();
+}
+
+void
+TAO_EC_ProxyPushSupplier::push_to_consumer (
+ RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet& event
+ ACE_ENV_ARG_DECL)
+{
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i () == 0)
+ return; // ACE_THROW (RtecEventComm::Disconnected ());????
+
+ if (this->suspended_ != 0)
+ return;
+ }
+
+ ACE_TRY
+ {
+ consumer->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, not_used)
+ {
+ // Do not report errors for old consumers
+ // NOTE: The comparison below is not completely correct, it
+ // could be that the remote consumer and the local consumer are
+ // in fact the same object, but represented by different objects
+ // references. Unfortunately this is not a good spot to invoke
+ // _is_equivalent(), and that may not give us the desired answer
+ // anyway.
+ if (consumer == this->consumer_.in ())
+ {
+ TAO_EC_ConsumerControl *control =
+ this->event_channel_->consumer_control ();
+
+ control->consumer_not_exist (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ // Do not report errors for old consumers
+ // NOTE: The comparison below is not completely correct, it
+ // could be that the remote consumer and the local consumer are
+ // in fact the same object, but represented by different objects
+ // references. Unfortunately this is not a good spot to invoke
+ // _is_equivalent(), and that may not give us the desired answer
+ // anyway.
+ if (consumer == this->consumer_.in ())
+ {
+ TAO_EC_ConsumerControl *control =
+ this->event_channel_->consumer_control ();
+
+ control->system_exception (this,
+ sysex
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Shouldn't happen, but does not hurt
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_EC_ProxyPushSupplier::reactive_push_to_consumer (
+ RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet& event
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ consumer->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, not_used)
+ {
+ TAO_EC_ConsumerControl *control =
+ this->event_channel_->consumer_control ();
+
+ control->consumer_not_exist (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ TAO_EC_ConsumerControl *control =
+ this->event_channel_->consumer_control ();
+
+ control->system_exception (this,
+ sysex
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Shouldn't happen
+ }
+ ACE_ENDTRY;
+}
+
+CORBA::Boolean
+TAO_EC_ProxyPushSupplier::consumer_non_existent (
+ CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var consumer;
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ disconnected = 0;
+ if (this->is_connected_i () == 0)
+ {
+ disconnected = 1;
+ return 0;
+ }
+
+ consumer = CORBA::Object::_duplicate (this->consumer_.in ());
+ }
+
+#if (TAO_HAS_MINIMUM_CORBA == 0)
+ return consumer->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER);
+#else
+ return 0;
+#endif /* TAO_HAS_MINIMUM_CORBA */
+}
+
+void
+TAO_EC_ProxyPushSupplier::clear (void)
+{
+ ACE_GUARD (ACE_Lock, ace_mon, *this->lock_);
+
+ this->child_->clear ();
+}
+
+CORBA::ULong
+TAO_EC_ProxyPushSupplier::max_event_size (void) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+
+ return this->child_->max_event_size ();
+}
+
+int
+TAO_EC_ProxyPushSupplier::can_match (
+ const RtecEventComm::EventHeader &header) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+
+ if (this->is_connected_i () == 0)
+ return 0;
+
+ return this->child_->can_match (header);
+}
+
+int
+TAO_EC_ProxyPushSupplier::add_dependencies (
+ const RtecEventComm::EventHeader &header,
+ const TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK_RETURN (0);
+
+ return this->child_->add_dependencies (header,
+ qos_info
+ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h
new file mode 100644
index 00000000000..bb14e56895b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h
@@ -0,0 +1,231 @@
+// -*- C++ -*-
+/**
+ * @file EC_ProxySupplier.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_PROXYSUPPLIER_H
+#define TAO_EC_PROXYSUPPLIER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventChannelAdminS.h"
+
+#include "orbsvcs/Event/EC_Filter.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Event_Channel_Base;
+class TAO_EC_ProxyPushConsumer;
+
+/**
+ * @class TAO_EC_ProxyPushSupplier
+ *
+ * @brief ProxyPushSupplier
+ *
+ * Implement the RtecEventChannelAdmin::ProxyPushSupplier interface,
+ * remember that this class is used to communicate with a
+ * PushConsumer, so, in effect, this is the ambassador for a
+ * consumer inside the event channel.
+ *
+ * <H2>Memory Management</H2>
+ * It does not assume ownership of the TAO_EC_Dispatching object.
+ * It makes a copy of the ConsumerQOS and the consumer object
+ * reference.
+ *
+ * <H2>Locking</H2>
+ * Locking is strategized, the event channel acts as a factory for
+ * the locking strategies.
+ *
+ * @todo We don't need to provide a trivial filter, the object itself
+ * could short-circuit the filter() ---> push() cycle when the EC
+ * is properly configured, we need to explore this...
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_ProxyPushSupplier : public TAO_EC_Filter
+{
+public:
+ typedef RtecEventChannelAdmin::ProxyPushSupplier Interface;
+ typedef RtecEventChannelAdmin::ProxyPushSupplier_var _var_type;
+ typedef RtecEventChannelAdmin::ProxyPushSupplier_ptr _ptr_type;
+
+ /// Constructor...
+ TAO_EC_ProxyPushSupplier (TAO_EC_Event_Channel_Base* event_channel, int validate_connection);
+
+ /// Destructor...
+ virtual ~TAO_EC_ProxyPushSupplier (void);
+
+ /// Activate in the POA
+ virtual void activate (
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr &proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+
+ /// Deactivate from the POA
+ virtual void deactivate (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC (());
+
+ /// Disconnect this from
+ virtual void disconnect_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ /// Return 0 if no consumer is connected...
+ CORBA::Boolean is_connected (void) const;
+
+ /// Return 1 if it is suspended.
+ CORBA::Boolean is_suspended (void) const;
+
+ /**
+ * Return the consumer object reference. It returns nil() if it has
+ * not connected yet.
+ */
+ RtecEventComm::PushConsumer_ptr consumer (void) const;
+
+ /// The QoS (subscription) used to connect to the EC.
+ const RtecEventChannelAdmin::ConsumerQOS& subscriptions (void) const;
+
+ /// Concrete implementations can use this methods to keep track of
+ /// the suppliers that publish its events.
+ virtual void connected (TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL);
+ virtual void reconnected (TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL);
+ virtual void disconnected (TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL);
+
+ /// Usually implemented as no-ops, but some configurations may
+ /// require this methods.
+ virtual void connected (TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL);
+ virtual void reconnected (TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL);
+ virtual void disconnected (TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL);
+
+ /// The event channel is shutting down
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Pushes to the consumer, verifies that it is connected and that it
+ /// is not suspended.
+ /**
+ * These methods take @a consumer argument because during the time
+ * the filters have been processing the event, this proxy's consumer
+ * may have changed.
+ */
+ void push_to_consumer (RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet &event
+ ACE_ENV_ARG_DECL);
+ void reactive_push_to_consumer (RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet &event
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Invoke the _non_existent() pseudo-operation on the consumer. If
+ * it is disconnected then it returns true and sets the
+ * <disconnected> flag.
+ */
+ CORBA::Boolean consumer_non_existent (CORBA::Boolean_out disconnected
+ ACE_ENV_ARG_DECL);
+
+ /// Increment and decrement the reference count.
+ CORBA::ULong _incr_refcnt (void);
+ CORBA::ULong _decr_refcnt (void);
+
+ // = The TAO_EC_Filter methods, only push() is implemented...
+ virtual int filter (const RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual int filter_nocopy (RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push (const RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void clear (void);
+ virtual CORBA::ULong max_event_size (void) const;
+ virtual int can_match (const RtecEventComm::EventHeader &header) const;
+ virtual int add_dependencies (const RtecEventComm::EventHeader &header,
+ const TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL);
+
+protected:
+ /// Set the consumer, used by some implementations to change the
+ /// policies used when invoking operations on the consumer.
+ void consumer (RtecEventComm::PushConsumer_ptr consumer);
+ void consumer_i (RtecEventComm::PushConsumer_ptr consumer);
+
+ void suspend_connection_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ void resume_connection_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ void suspend_connection_locked (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ void resume_connection_locked (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// The private version (without locking) of is_connected().
+ CORBA::Boolean is_connected_i (void) const;
+
+ /// Release the child and the consumer
+ void cleanup_i (void);
+
+ /// The Event Channel that owns this object.
+ TAO_EC_Event_Channel_Base* event_channel_;
+
+ /// The locking strategy.
+ ACE_Lock* lock_;
+
+ /// The reference count.
+ CORBA::ULong refcount_;
+
+ /// The consumer....
+ RtecEventComm::PushConsumer_var consumer_;
+
+ /// Is this consumer suspended?
+ CORBA::Boolean suspended_;
+
+ /// The subscription and QoS information...
+ RtecEventChannelAdmin::ConsumerQOS qos_;
+
+ /// Store the default POA.
+ PortableServer::POA_var default_POA_;
+
+ /// The filter object
+ TAO_EC_Filter* child_;
+
+ /// Validate the connection to consumer on connect
+ int consumer_validate_connection_;
+private:
+
+ /// Template method hooks.
+ virtual void refcount_zero_hook (void);
+ virtual void pre_dispatch_hook (RtecEventComm::EventSet&
+ ACE_ENV_ARG_DECL);
+ virtual PortableServer::ObjectId
+ object_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_ProxySupplier.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_PROXYSUPPLIER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.i b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.i
new file mode 100644
index 00000000000..c64085ea2e1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.i
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE void
+TAO_EC_ProxyPushSupplier::suspend_connection_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->suspended_ = 1;
+}
+
+ACE_INLINE void
+TAO_EC_ProxyPushSupplier::suspend_connection_locked (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ this->suspend_connection_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+ACE_INLINE void
+TAO_EC_ProxyPushSupplier::resume_connection_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->suspended_ = 0;
+}
+
+ACE_INLINE void
+TAO_EC_ProxyPushSupplier::resume_connection_locked (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ CORBA::INTERNAL ());
+ // @@ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ this->resume_connection_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+ACE_INLINE CORBA::Boolean
+TAO_EC_ProxyPushSupplier::is_connected_i (void) const
+{
+ return !CORBA::is_nil (this->consumer_.in ());
+}
+
+ACE_INLINE CORBA::Boolean
+TAO_EC_ProxyPushSupplier::is_connected (void) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+
+ return this->is_connected_i ();
+}
+
+ACE_INLINE CORBA::Boolean
+TAO_EC_ProxyPushSupplier::is_suspended (void) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+
+ return this->suspended_;
+}
+
+ACE_INLINE RtecEventComm::PushConsumer_ptr
+TAO_EC_ProxyPushSupplier::consumer (void) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ return RtecEventComm::PushConsumer::_duplicate (this->consumer_.in ());
+}
+
+ACE_INLINE void
+TAO_EC_ProxyPushSupplier::consumer_i (RtecEventComm::PushConsumer_ptr consumer)
+{
+ this->consumer_ = consumer;
+}
+
+ACE_INLINE void
+TAO_EC_ProxyPushSupplier::consumer (RtecEventComm::PushConsumer_ptr consumer)
+{
+ ACE_GUARD (ACE_Lock, ace_mon, *this->lock_);
+
+ this->consumer_i (consumer);
+}
+
+ACE_INLINE const RtecEventChannelAdmin::ConsumerQOS&
+TAO_EC_ProxyPushSupplier::subscriptions (void) const
+{
+ // @@ TODO There should be a better way to signal errors here.
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, this->qos_);
+
+ return this->qos_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Proxy_Disconnector.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Proxy_Disconnector.cpp
new file mode 100644
index 00000000000..557a2b4f708
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Proxy_Disconnector.cpp
@@ -0,0 +1,47 @@
+/**
+ * @file EC_Proxy_Disconnector.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@atdesk.com>
+ */
+
+#include "orbsvcs/Event/EC_Proxy_Disconnector.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void
+TAO_EC_Supplier_Proxy_Disconnect_Functor::operator() (
+ RtecEventComm::PushSupplier_ptr supplier)
+ ACE_THROW_SPEC (())
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ supplier->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_EC_Consumer_Proxy_Disconnect_Functor::operator() (
+ RtecEventComm::PushConsumer_ptr consumer)
+ ACE_THROW_SPEC (())
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ consumer->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Proxy_Disconnector.h b/TAO/orbsvcs/orbsvcs/Event/EC_Proxy_Disconnector.h
new file mode 100644
index 00000000000..8aeda423586
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Proxy_Disconnector.h
@@ -0,0 +1,76 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Proxy_Disconnector.h
+ *
+ * @author Carlos O'Ryan <coryan@atdesk.com>
+ *
+ * $Id$
+ */
+#ifndef EC_PROXY_DISCONNECTOR__H_
+#define EC_PROXY_DISCONNECTOR__H_
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+#include "orbsvcs/RtecEventCommC.h"
+#include "ace/Auto_Functor.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @struct TAO_EC_Supplier_Proxy_Disconnect_Functor
+ *
+ * @brief Implements a functor for the TAO_EC_Supplier_Proxy_Disconnector class.
+ */
+struct TAO_RTEvent_Serv_Export TAO_EC_Supplier_Proxy_Disconnect_Functor
+{
+ typedef RtecEventComm::PushSupplier_ptr argument;
+
+ /// Disconnect from @c supplier
+ void operator() (RtecEventComm::PushSupplier_ptr supplier)
+ ACE_THROW_SPEC (());
+};
+
+/**
+ * @class TAO_EC_Supplier_Proxy_Disconnector
+ *
+ * @brief Helper class to disconnect a PushConsumer from the event
+ * channel.
+ *
+ */
+typedef ACE_Utils::Auto_Functor<
+ RtecEventComm::PushSupplier,
+ TAO_EC_Supplier_Proxy_Disconnect_Functor>
+ TAO_EC_Supplier_Proxy_Disconnector;
+
+
+
+/**
+ * @struct TAO_EC_Consumer_Proxy_Disconnect_Functor
+ *
+ * @brief Implements a functor for the TAO_EC_Consumer_Proxy_Disconnector class.
+ */
+struct TAO_RTEvent_Serv_Export TAO_EC_Consumer_Proxy_Disconnect_Functor
+{
+ typedef RtecEventComm::PushConsumer_ptr argument;
+
+ /// Disconnect from @c consumer
+ void operator() (RtecEventComm::PushConsumer_ptr consumer)
+ ACE_THROW_SPEC (());
+};
+
+/**
+ * @class TAO_EC_Consumer_Proxy_Disconnector
+ *
+ * @brief Helper class to disconnect a PushSupplier from the event
+ * channel.
+ *
+ */
+typedef ACE_Utils::Auto_Functor<
+ RtecEventComm::PushConsumer,
+ TAO_EC_Consumer_Proxy_Disconnect_Functor>
+ TAO_EC_Consumer_Proxy_Disconnector;
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif // EC_PROXY_DISCONNECTOR__H_
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_QOS_Info.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_QOS_Info.cpp
new file mode 100644
index 00000000000..4680bda962f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_QOS_Info.cpp
@@ -0,0 +1,9 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_QOS_Info.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_QOS_Info.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_QOS_Info, "$Id$")
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_QOS_Info.h b/TAO/orbsvcs/orbsvcs/Event/EC_QOS_Info.h
new file mode 100644
index 00000000000..88c9387e382
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_QOS_Info.h
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_QOS_Info.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_QOS_INFO_H
+#define TAO_EC_QOS_INFO_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecBaseC.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_QOS_Info
+ *
+ * @brief A representation of QoS information for the event channel
+ * filters.
+ *
+ * Filters compute QOS information for real-time dispatching, this
+ * class encapsulates that information.
+ * This first implementation is just a place-holder.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_QOS_Info
+{
+public:
+ /// Constructor
+ TAO_EC_QOS_Info (void);
+
+ /// Copy constructor, it does the obvious thing, but if it is not
+ /// here the HP/aCC compiler breaks.
+ TAO_EC_QOS_Info (const TAO_EC_QOS_Info &rhs);
+
+ RtecBase::handle_t rt_info;
+ RtecBase::Preemption_Priority_t preemption_priority;
+
+ /**
+ * Timer ids propagate their identity using this field, notice that
+ * they cannot use the event type because there could be multiple
+ * timeouts for the same consumer.
+ */
+ long timer_id_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_QOS_Info.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_EVENT_CHANNEL_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_QOS_Info.i b/TAO/orbsvcs/orbsvcs/Event/EC_QOS_Info.i
new file mode 100644
index 00000000000..eab42f031bc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_QOS_Info.i
@@ -0,0 +1,23 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_QOS_Info::TAO_EC_QOS_Info (void)
+ : rt_info (-1),
+ preemption_priority (0),
+ timer_id_ (-1)
+{
+}
+
+ACE_INLINE
+TAO_EC_QOS_Info::TAO_EC_QOS_Info (const TAO_EC_QOS_Info &rhs)
+ : rt_info (rhs.rt_info),
+ preemption_priority (rhs.preemption_priority),
+ timer_id_ (rhs.timer_id_)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Dispatching.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Dispatching.cpp
new file mode 100644
index 00000000000..f57b86ae813
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Dispatching.cpp
@@ -0,0 +1,106 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_RTCORBA_Dispatching.h"
+#include "tao/RTCORBA/Priority_Mapping.h"
+
+ACE_RCSID(Event, EC_RTCORBA_Dispatching, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_RTCORBA_Dispatching::
+ TAO_EC_RTCORBA_Dispatching (const RTCORBA::ThreadpoolLanes &lanes,
+ RTCORBA::PriorityMapping *mapping,
+ RTCORBA::Current_ptr current)
+ : lanes_ (lanes)
+ , priority_mapping_ (mapping)
+ , current_ (RTCORBA::Current::_duplicate (current))
+{
+ CORBA::ULong number_lanes = this->lanes_.length ();
+ ACE_NEW (this->tasks_, TAO_EC_Dispatching_Task[number_lanes]);
+ for (CORBA::ULong i = 0; i != this->lanes_.length (); ++i)
+ this->tasks_[i].thr_mgr (&this->thread_manager_);
+}
+
+TAO_EC_RTCORBA_Dispatching::~TAO_EC_RTCORBA_Dispatching (void)
+{
+ delete[] this->tasks_;
+}
+
+void
+TAO_EC_RTCORBA_Dispatching::activate (void)
+{
+ for (CORBA::ULong i = 0; i != this->lanes_.length (); ++i)
+ {
+ CORBA::ULong nthreads = this->lanes_[i].static_threads;
+ if (nthreads == 0)
+ {
+ nthreads = 1;
+ }
+ RTCORBA::Priority corba_priority = this->lanes_[i].lane_priority;
+ RTCORBA::NativePriority native_priority;
+ if (this->priority_mapping_->to_native (corba_priority,
+ native_priority) != 0)
+ {
+ this->tasks_[i].activate (
+ THR_SCHED_FIFO | THR_NEW_LWP | THR_JOINABLE,
+ nthreads, 0,
+ native_priority);
+ }
+ }
+}
+
+void
+TAO_EC_RTCORBA_Dispatching::shutdown (void)
+{
+ for (CORBA::ULong i = 0; i != this->lanes_.length (); ++i)
+ {
+ int nthreads =
+ this->thread_manager_.num_threads_in_task (&this->tasks_[i]);
+ if (nthreads <= 0)
+ continue;
+ for (int j = 0; j != nthreads; ++j)
+ {
+ this->tasks_[i].putq (new TAO_EC_Shutdown_Task_Command);
+ }
+ }
+ this->thread_manager_.wait ();
+}
+
+void
+TAO_EC_RTCORBA_Dispatching::push (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventComm::EventSet event_copy = event;
+ this->push_nocopy (proxy, consumer, event_copy, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_RTCORBA_Dispatching::push_nocopy (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info&
+ ACE_ENV_ARG_DECL)
+{
+ RTCORBA::Priority current_priority =
+ this->current_->the_priority (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ for (CORBA::ULong i = 0; i != this->lanes_.length (); ++i)
+ {
+ if (this->lanes_[i].lane_priority != current_priority)
+ continue;
+
+ // @@ If there were no threads available we may need to create
+ // some...
+
+ this->tasks_[i].push (proxy, consumer, event
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ break;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Dispatching.h b/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Dispatching.h
new file mode 100644
index 00000000000..cb6e87fdad2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Dispatching.h
@@ -0,0 +1,82 @@
+// -*- C++ -*-
+/**
+ * @file EC_RTCORBA_Dispatching.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_RTCORBA_DISPATCHING_H
+#define TAO_EC_RTCORBA_DISPATCHING_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/rtcorba_event_export.h"
+#include "orbsvcs/Event/EC_Dispatching.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/EC_Dispatching_Task.h"
+#include "tao/RTCORBA/RTCORBA.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_RTCORBA_Dispatching
+ *
+ * @brief RTCORBA-based dispatching strategy
+ *
+ */
+class TAO_RTCORBAEvent_Export TAO_EC_RTCORBA_Dispatching : public TAO_EC_Dispatching
+{
+public:
+ /// Constructor
+ TAO_EC_RTCORBA_Dispatching (const RTCORBA::ThreadpoolLanes &lanes,
+ RTCORBA::PriorityMapping *mapping,
+ RTCORBA::Current_ptr current);
+
+ /// Destructor
+ ~TAO_EC_RTCORBA_Dispatching (void);
+
+ // = The EC_Dispatching methods.
+ virtual void activate (void);
+ virtual void shutdown (void);
+ virtual void push (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ /// The thread pools...
+ RTCORBA::ThreadpoolLanes lanes_;
+
+ /// Used to map between CORBA and native priorities
+ RTCORBA::PriorityMapping *priority_mapping_;
+
+ /// Used to get the current RTCORBA priority
+ RTCORBA::Current_var current_;
+
+ /// Use our own thread manager.
+ ACE_Thread_Manager thread_manager_;
+
+ /// The dispatching task(s), one per lane
+ TAO_EC_Dispatching_Task *tasks_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_RTCORBA_DISPATCHING_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Factory.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Factory.cpp
new file mode 100644
index 00000000000..087ffc53b03
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Factory.cpp
@@ -0,0 +1,276 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_RTCORBA_Dispatching.h"
+#include "orbsvcs/Event/EC_RTCORBA_Factory.h"
+
+#include "tao/RTCORBA/Priority_Mapping_Manager.h"
+
+ACE_RCSID(Event, EC_RTCORBA_Factory, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_RTCORBA_Factory::
+ TAO_EC_RTCORBA_Factory (TAO_EC_Factory *body,
+ const RTCORBA::ThreadpoolLanes &lanes)
+ : body_ (body)
+ , lanes_ (lanes)
+{
+}
+
+TAO_EC_RTCORBA_Factory::~TAO_EC_RTCORBA_Factory (void)
+{
+}
+
+
+int
+TAO_EC_RTCORBA_Factory::init (int argc, char* argv[])
+{
+ return this->body_->init (argc, argv);
+}
+
+int
+TAO_EC_RTCORBA_Factory::fini (void)
+{
+ return this->body_->fini ();
+}
+
+// ****************************************************************
+
+TAO_EC_Dispatching*
+TAO_EC_RTCORBA_Factory::create_dispatching (TAO_EC_Event_Channel_Base *)
+{
+ TAO_EC_Dispatching *dispatching = 0;
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // @@ The ORBId could be important!!!
+ int argc = 0;
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, 0, ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("PriorityMappingManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RTCORBA::PriorityMappingManager_var priority_mapping_manager =
+ RTCORBA::PriorityMappingManager::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RTCORBA::PriorityMapping *priority_mapping =
+ priority_mapping_manager->mapping ();
+
+ 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;
+
+ ACE_NEW_RETURN (dispatching,
+ TAO_EC_RTCORBA_Dispatching (this->lanes_,
+ priority_mapping,
+ current.in ()),
+ 0);
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+
+ return dispatching;
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_dispatching (TAO_EC_Dispatching *x)
+{
+ this->body_->destroy_dispatching (x);
+}
+
+TAO_EC_Filter_Builder*
+TAO_EC_RTCORBA_Factory::create_filter_builder (TAO_EC_Event_Channel_Base *ec)
+{
+ return this->body_->create_filter_builder (ec);
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_filter_builder (TAO_EC_Filter_Builder *x)
+{
+ this->body_->destroy_filter_builder (x);
+}
+
+TAO_EC_Supplier_Filter_Builder*
+TAO_EC_RTCORBA_Factory::create_supplier_filter_builder (TAO_EC_Event_Channel_Base *ec)
+{
+ return this->body_->create_supplier_filter_builder (ec);
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_supplier_filter_builder (TAO_EC_Supplier_Filter_Builder *x)
+{
+ this->body_->destroy_supplier_filter_builder (x);
+}
+
+TAO_EC_ConsumerAdmin*
+TAO_EC_RTCORBA_Factory::create_consumer_admin (TAO_EC_Event_Channel_Base *ec)
+{
+ return this->body_->create_consumer_admin (ec);
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_consumer_admin (TAO_EC_ConsumerAdmin *x)
+{
+ this->body_->destroy_consumer_admin (x);
+}
+
+TAO_EC_SupplierAdmin*
+TAO_EC_RTCORBA_Factory::create_supplier_admin (TAO_EC_Event_Channel_Base *ec)
+{
+ return this->body_->create_supplier_admin (ec);
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_supplier_admin (TAO_EC_SupplierAdmin *x)
+{
+ this->body_->destroy_supplier_admin (x);
+}
+
+TAO_EC_ProxyPushSupplier*
+TAO_EC_RTCORBA_Factory::create_proxy_push_supplier (TAO_EC_Event_Channel_Base *ec)
+{
+ return this->body_->create_proxy_push_supplier (ec);
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_proxy_push_supplier (TAO_EC_ProxyPushSupplier *x)
+{
+ this->body_->destroy_proxy_push_supplier (x);
+}
+
+TAO_EC_ProxyPushConsumer*
+TAO_EC_RTCORBA_Factory::create_proxy_push_consumer (TAO_EC_Event_Channel_Base *ec)
+{
+ return this->body_->create_proxy_push_consumer (ec);
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer *x)
+{
+ this->body_->destroy_proxy_push_consumer (x);
+}
+
+TAO_EC_Timeout_Generator*
+TAO_EC_RTCORBA_Factory::create_timeout_generator (TAO_EC_Event_Channel_Base *ec)
+{
+ return this->body_->create_timeout_generator (ec);
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_timeout_generator (TAO_EC_Timeout_Generator *x)
+{
+ this->body_->destroy_timeout_generator (x);
+}
+
+TAO_EC_ObserverStrategy*
+TAO_EC_RTCORBA_Factory::create_observer_strategy (TAO_EC_Event_Channel_Base *ec)
+{
+ return this->body_->create_observer_strategy (ec);
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_observer_strategy (TAO_EC_ObserverStrategy *x)
+{
+ this->body_->destroy_observer_strategy (x);
+}
+
+TAO_EC_Scheduling_Strategy*
+TAO_EC_RTCORBA_Factory::create_scheduling_strategy (TAO_EC_Event_Channel_Base *ec)
+{
+ return this->body_->create_scheduling_strategy (ec);
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_scheduling_strategy (TAO_EC_Scheduling_Strategy* x)
+{
+ this->body_->destroy_scheduling_strategy (x);
+}
+
+TAO_EC_ProxyPushConsumer_Collection*
+TAO_EC_RTCORBA_Factory::create_proxy_push_consumer_collection (TAO_EC_Event_Channel_Base *ec)
+{
+ return this->body_->create_proxy_push_consumer_collection (ec);
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_proxy_push_consumer_collection (TAO_EC_ProxyPushConsumer_Collection *x)
+{
+ this->body_->destroy_proxy_push_consumer_collection (x);
+}
+
+TAO_EC_ProxyPushSupplier_Collection*
+TAO_EC_RTCORBA_Factory::create_proxy_push_supplier_collection (TAO_EC_Event_Channel_Base *ec)
+{
+ return this->body_->create_proxy_push_supplier_collection (ec);
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_proxy_push_supplier_collection (TAO_EC_ProxyPushSupplier_Collection *x)
+{
+ this->body_->destroy_proxy_push_supplier_collection (x);
+}
+
+ACE_Lock*
+TAO_EC_RTCORBA_Factory::create_consumer_lock (void)
+{
+ return this->body_->create_consumer_lock ();
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_consumer_lock (ACE_Lock* x)
+{
+ this->body_->destroy_consumer_lock (x);
+}
+
+ACE_Lock*
+TAO_EC_RTCORBA_Factory::create_supplier_lock (void)
+{
+ return this->body_->create_supplier_lock ();
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_supplier_lock (ACE_Lock* x)
+{
+ this->body_->destroy_supplier_lock (x);
+}
+
+TAO_EC_ConsumerControl*
+TAO_EC_RTCORBA_Factory::create_consumer_control (TAO_EC_Event_Channel_Base* ec)
+{
+ return this->body_->create_consumer_control (ec);
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_consumer_control (TAO_EC_ConsumerControl* x)
+{
+ this->body_->destroy_consumer_control (x);
+}
+
+TAO_EC_SupplierControl*
+TAO_EC_RTCORBA_Factory::create_supplier_control (TAO_EC_Event_Channel_Base* ec)
+{
+ return this->body_->create_supplier_control (ec);
+}
+
+void
+TAO_EC_RTCORBA_Factory::destroy_supplier_control (TAO_EC_SupplierControl* x)
+{
+ this->body_->destroy_supplier_control (x);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Factory.h b/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Factory.h
new file mode 100644
index 00000000000..a76bc59f73d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_RTCORBA_Factory.h
@@ -0,0 +1,123 @@
+// -*- C++ -*-
+/**
+ * @file EC_RTCORBA_Factory.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_RTCORBA_FACTORY_H
+#define TAO_EC_RTCORBA_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/rtcorba_event_export.h"
+#include "orbsvcs/Event/EC_Factory.h"
+#include "tao/RTCORBA/RTCORBA.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_RTCORBA_Factory
+ *
+ * @brief Decorate an EC_Factory to use the EC_RTCORBA_Dispatching
+ * module.
+ */
+class TAO_RTCORBAEvent_Export TAO_EC_RTCORBA_Factory : public TAO_EC_Factory
+{
+public:
+ /// Constructor
+ /**
+ * @param body The decorated factory.
+ */
+ TAO_EC_RTCORBA_Factory (TAO_EC_Factory *body,
+ const RTCORBA::ThreadpoolLanes &lanes);
+
+ /// destructor...
+ virtual ~TAO_EC_RTCORBA_Factory (void);
+
+ // Decorated methods...
+ virtual int init (int argc, char* argv[]);
+ virtual int fini (void);
+ virtual TAO_EC_Dispatching*
+ create_dispatching (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_dispatching (TAO_EC_Dispatching*) ;
+ virtual TAO_EC_Filter_Builder*
+ create_filter_builder (TAO_EC_Event_Channel_Base*) ;
+ virtual void
+ destroy_filter_builder (TAO_EC_Filter_Builder*);
+ virtual TAO_EC_Supplier_Filter_Builder*
+ create_supplier_filter_builder (TAO_EC_Event_Channel_Base*) ;
+ virtual void
+ destroy_supplier_filter_builder (TAO_EC_Supplier_Filter_Builder*);
+ virtual TAO_EC_ConsumerAdmin*
+ create_consumer_admin (TAO_EC_Event_Channel_Base*) ;
+ virtual void
+ destroy_consumer_admin (TAO_EC_ConsumerAdmin*);
+ virtual TAO_EC_SupplierAdmin*
+ create_supplier_admin (TAO_EC_Event_Channel_Base*) ;
+ virtual void
+ destroy_supplier_admin (TAO_EC_SupplierAdmin*);
+ virtual TAO_EC_ProxyPushSupplier*
+ create_proxy_push_supplier (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_supplier (TAO_EC_ProxyPushSupplier*);
+ virtual TAO_EC_ProxyPushConsumer*
+ create_proxy_push_consumer (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer*);
+ virtual TAO_EC_Timeout_Generator*
+ create_timeout_generator (TAO_EC_Event_Channel_Base*) ;
+ virtual void
+ destroy_timeout_generator (TAO_EC_Timeout_Generator*);
+ virtual TAO_EC_ObserverStrategy*
+ create_observer_strategy (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_observer_strategy (TAO_EC_ObserverStrategy*);
+ virtual TAO_EC_Scheduling_Strategy*
+ create_scheduling_strategy (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_scheduling_strategy (TAO_EC_Scheduling_Strategy*);
+ virtual TAO_EC_ProxyPushConsumer_Collection*
+ create_proxy_push_consumer_collection (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_consumer_collection (TAO_EC_ProxyPushConsumer_Collection*);
+ virtual TAO_EC_ProxyPushSupplier_Collection*
+ create_proxy_push_supplier_collection (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_supplier_collection (TAO_EC_ProxyPushSupplier_Collection*);
+ virtual ACE_Lock* create_consumer_lock (void);
+ virtual void destroy_consumer_lock (ACE_Lock*);
+ virtual ACE_Lock* create_supplier_lock (void);
+ virtual void destroy_supplier_lock (ACE_Lock*);
+ virtual TAO_EC_ConsumerControl*
+ create_consumer_control (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_consumer_control (TAO_EC_ConsumerControl*);
+ virtual TAO_EC_SupplierControl*
+ create_supplier_control (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_supplier_control (TAO_EC_SupplierControl*);
+
+protected:
+ /// The decorated factory
+ TAO_EC_Factory *body_;
+
+ /// Configure the thread pool lanes.
+ RTCORBA::ThreadpoolLanes lanes_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_RTCORBA_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.cpp
new file mode 100644
index 00000000000..a8aafe81f0b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.cpp
@@ -0,0 +1,276 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_ConsumerAdmin.h"
+#include "orbsvcs/Event/EC_Reactive_ConsumerControl.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_ProxyConsumer.h" // @@ MSVC 6 bug
+
+#include "tao/Messaging/Messaging.h"
+#include "tao/ORB_Core.h"
+
+#include "ace/Reactor.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Reactive_ConsumerControl.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_Reactive_ConsumerControl, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Reactive_ConsumerControl::
+ TAO_EC_Reactive_ConsumerControl (const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ TAO_EC_Event_Channel_Base *ec,
+ CORBA::ORB_ptr orb)
+ : rate_ (rate),
+ timeout_ (timeout),
+ adapter_ (this),
+ event_channel_ (ec),
+ orb_ (CORBA::ORB::_duplicate (orb))
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ , timer_id_ (-1)
+#endif /* TAO_HAS_CORBA_MESSAGING != 0*/
+{
+ this->reactor_ =
+ this->orb_->orb_core ()->reactor ();
+}
+
+TAO_EC_Reactive_ConsumerControl::~TAO_EC_Reactive_ConsumerControl (void)
+{
+}
+
+void
+TAO_EC_Reactive_ConsumerControl::query_consumers (
+ ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_EC_Ping_Consumer worker (this);
+ this->event_channel_->for_each_consumer (&worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Reactive_ConsumerControl::handle_timeout (
+ const ACE_Time_Value &,
+ const void *)
+{
+ // NOTE, setting RELATIVE_RT_TIMEOUT_POLICY for the duration of
+ // query_consumers () below has greater impact than desired. For
+ // example, while we are pinging consumers here, a nested upcall,
+ // which requires making remote calls may come into the ORB. Those
+ // remote calls will be carried out with with
+ // RELATIVE_RT_TIMEOUT_POLICY set here in effect.
+
+ // @@ TODO: should use Guard to set and reset policies.
+ ACE_TRY_NEW_ENV
+ {
+ // Query the state of the Current object *before* we initiate
+ // the iteration...
+ CORBA::PolicyTypeSeq types;
+ CORBA::PolicyList_var policies =
+ this->policy_current_->get_policy_overrides (types
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Change the timeout
+ this->policy_current_->set_policy_overrides (this->policy_list_,
+ CORBA::ADD_OVERRIDE
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Query the state of the consumers...
+ this->query_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->policy_current_->set_policy_overrides (policies.in (),
+ CORBA::SET_OVERRIDE
+ 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;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+int
+TAO_EC_Reactive_ConsumerControl::activate (void)
+{
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ ACE_TRY_NEW_ENV
+ {
+ // Get the PolicyCurrent object
+ CORBA::Object_var tmp =
+ this->orb_->resolve_initial_references ("PolicyCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->policy_current_ =
+ CORBA::PolicyCurrent::_narrow (tmp.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Timeout for polling state (default = 10 msec)
+ TimeBase::TimeT timeout = timeout_.usec() * 10;
+ CORBA::Any any;
+ any <<= timeout;
+
+ this->policy_list_.length (1);
+ this->policy_list_[0] =
+ this->orb_->create_policy (
+ Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
+ any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Only schedule the timer, when the rate is not zero
+ if (this->rate_ != ACE_Time_Value::zero)
+ {
+ // Schedule the timer after these policies has been set, because the
+ // handle_timeout uses these policies, if done in front, the channel
+ // can crash when the timeout expires before initiazation is ready.
+ timer_id_ = this->reactor_->schedule_timer (&this->adapter_,
+ 0,
+ this->rate_,
+ this->rate_);
+ if (timer_id_ == -1)
+ return -1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+#endif /* TAO_HAS_CORBA_MESSAGING */
+
+ return 0;
+}
+
+int
+TAO_EC_Reactive_ConsumerControl::shutdown (void)
+{
+ int r = 0;
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ r = this->reactor_->cancel_timer (timer_id_);
+#endif /* TAO_HAS_CORBA_MESSAGING */
+ this->adapter_.reactor (0);
+ return r;
+}
+
+void
+TAO_EC_Reactive_ConsumerControl::consumer_not_exist (
+ TAO_EC_ProxyPushSupplier *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ //ACE_DEBUG ((LM_DEBUG,
+ // "EC_Reactive_ConsumerControl(%P|%t) - "
+ // "Consumer %x does not exists\n", long(proxy)));
+ proxy->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Reactive_ConsumerControl::consumer_not_exist");
+ // Ignore all exceptions..
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_EC_Reactive_ConsumerControl::system_exception (
+ TAO_EC_ProxyPushSupplier *proxy,
+ CORBA::SystemException & /* exception */
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ // The current implementation is very strict, and kicks out a
+ // client on the first system exception. We may
+ // want to be more lenient in the future, for example,
+ // this is TAO's minor code for a failed connection.
+ //
+ // if (CORBA::TRANSIENT::_narrow (&exception) != 0
+ // && exception->minor () == 0x54410085)
+ // return;
+
+ // Anything else is serious, including timeouts...
+ proxy->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions..
+ }
+ ACE_ENDTRY;
+}
+
+// ****************************************************************
+
+TAO_EC_ConsumerControl_Adapter::TAO_EC_ConsumerControl_Adapter (
+ TAO_EC_Reactive_ConsumerControl *adaptee)
+ : adaptee_ (adaptee)
+{
+}
+
+int
+TAO_EC_ConsumerControl_Adapter::handle_timeout (
+ const ACE_Time_Value &tv,
+ const void *arg)
+{
+ this->adaptee_->handle_timeout (tv, arg);
+ return 0;
+}
+
+// ****************************************************************
+
+void
+TAO_EC_Ping_Consumer::work (TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CORBA::Boolean disconnected;
+ CORBA::Boolean non_existent =
+ supplier->consumer_non_existent (disconnected
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (non_existent && !disconnected)
+ {
+ this->control_->consumer_not_exist (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ this->control_->consumer_not_exist (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TRANSIENT, transient)
+ {
+ // This is TAO's minor code for a failed connection, we may
+ // want to be more lenient in the future..
+ // if (transient.minor () == 0x54410085)
+ this->control_->consumer_not_exist (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.h b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.h
new file mode 100644
index 00000000000..d6e8cf176d5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.h
@@ -0,0 +1,155 @@
+// -*- C++ -*-
+/**
+ * @file EC_Reactive_ConsumerControl.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_REACTIVE_CONSUMERCONTROL_H
+#define TAO_EC_REACTIVE_CONSUMERCONTROL_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_ConsumerControl.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+#include "tao/ORB.h"
+#include "tao/PolicyC.h"
+
+#include "ace/Event_Handler.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Event_Channel_Base;
+
+class TAO_EC_Reactive_ConsumerControl;
+
+/**
+ * @class TAO_EC_ConsumerControl_Adapter
+ *
+ * @brief Forwards timeout events to the Reactive ConsumerControl
+ *
+ * The Reactive ConsumerControl strategy uses the reactor to
+ * periodically wakeup and verify the state of the consumers
+ * registered with the Event Channel.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_ConsumerControl_Adapter : public ACE_Event_Handler
+{
+public:
+ /// Constructor
+ TAO_EC_ConsumerControl_Adapter (TAO_EC_Reactive_ConsumerControl *adaptee);
+
+ // = Documented in ACE_Event_Handler.
+ virtual int handle_timeout (const ACE_Time_Value &tv,
+ const void *arg = 0);
+
+private:
+ /// The adapted object
+ TAO_EC_Reactive_ConsumerControl *adaptee_;
+};
+
+/**
+ * @class TAO_EC_Reactive_ConsumerControl
+ *
+ * @brief ConsumerControl
+ *
+ * Defines the interface for the consumer control strategy.
+ * This strategy handles misbehaving or failing consumers.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Reactive_ConsumerControl : public TAO_EC_ConsumerControl
+{
+public:
+ /// Constructor. It does not assume ownership of the @a event_channel
+ /// parameter.
+ TAO_EC_Reactive_ConsumerControl (const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ TAO_EC_Event_Channel_Base *event_channel,
+ CORBA::ORB_ptr orb);
+
+ /// Destructor.
+ virtual ~TAO_EC_Reactive_ConsumerControl (void);
+
+ /// Receive the timeout from the adapter
+ void handle_timeout (const ACE_Time_Value &tv,
+ const void* arg);
+
+ // = Documented in TAO_EC_ConsumerControl
+ virtual int activate (void);
+ virtual int shutdown (void);
+ virtual void consumer_not_exist (TAO_EC_ProxyPushSupplier *proxy
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void system_exception (TAO_EC_ProxyPushSupplier *proxy,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+private:
+ /// Check if the consumers still exists. It is a helper method for
+ /// handle_timeout() to isolate the exceptions.
+ void query_consumers (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// The polling rate
+ ACE_Time_Value rate_;
+
+ /// The polling timeout
+ ACE_Time_Value timeout_;
+
+ /// The Adapter for the reactor events
+ TAO_EC_ConsumerControl_Adapter adapter_;
+
+ /// The event channel
+ TAO_EC_Event_Channel_Base *event_channel_;
+
+ /// The ORB
+ CORBA::ORB_var orb_;
+
+ /// To control the timeout policy in the thread
+ CORBA::PolicyCurrent_var policy_current_;
+
+ /// Precomputed policy list to the set timeout.
+ CORBA::PolicyList policy_list_;
+
+ /// The ORB reactor
+ ACE_Reactor *reactor_;
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ /// The timer id
+ long timer_id_;
+#endif /* TAO_HAS_CORBA_MESSAGING */
+};
+
+// ****************************************************************
+
+class TAO_EC_Ping_Consumer : public TAO_ESF_Worker<TAO_EC_ProxyPushSupplier>
+{
+public:
+ TAO_EC_Ping_Consumer (TAO_EC_ConsumerControl *control);
+
+ virtual void work (TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_ConsumerControl *control_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Reactive_ConsumerControl.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_CONSUMERCONTROL_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.i b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.i
new file mode 100644
index 00000000000..d365ca2ae4d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.i
@@ -0,0 +1,13 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Ping_Consumer::TAO_EC_Ping_Consumer (TAO_EC_ConsumerControl *control)
+ : control_ (control)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Dispatching.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Dispatching.cpp
new file mode 100644
index 00000000000..eb7b1bd5b7d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Dispatching.cpp
@@ -0,0 +1,45 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Reactive_Dispatching.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+
+ACE_RCSID(Event, EC_Reactive_Dispatching, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Reactive_Dispatching::TAO_EC_Reactive_Dispatching (void)
+ : TAO_EC_Dispatching ()
+{
+}
+
+void
+TAO_EC_Reactive_Dispatching::activate (void)
+{
+}
+
+void
+TAO_EC_Reactive_Dispatching::shutdown (void)
+{
+}
+
+void
+TAO_EC_Reactive_Dispatching::push (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info&
+ ACE_ENV_ARG_DECL)
+{
+ proxy->reactive_push_to_consumer (consumer, event ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Reactive_Dispatching::push_nocopy (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info&
+ ACE_ENV_ARG_DECL)
+{
+ proxy->reactive_push_to_consumer (consumer, event ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Dispatching.h b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Dispatching.h
new file mode 100644
index 00000000000..0ef3be3bedb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Dispatching.h
@@ -0,0 +1,65 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Reactive_Dispatching.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_REACTIVE_DISPATCHING_H
+#define TAO_EC_REACTIVE_DISPATCHING_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Dispatching.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Reactive_Dispatching
+ *
+ * @brief Dispatch using the caller thread.
+ *
+ * The events are dispatched in FIFO ordering, using the invoking
+ * thread to push the event to the consumer.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Reactive_Dispatching : public TAO_EC_Dispatching
+{
+public:
+ /// The scheduler is used to find the range of priorities and similar
+ /// info.
+ TAO_EC_Reactive_Dispatching (void);
+
+ // = The EC_Dispatching methods.
+ virtual void activate (void);
+ virtual void shutdown (void);
+ virtual void push (TAO_EC_ProxyPushSupplier *proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ virtual void push_nocopy (TAO_EC_ProxyPushSupplier *proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_REACTIVE_DISPATCHING_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.cpp
new file mode 100644
index 00000000000..10cdcd05bdb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.cpp
@@ -0,0 +1,266 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_SupplierAdmin.h"
+#include "orbsvcs/Event/EC_Reactive_SupplierControl.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_ProxyConsumer.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h" // @@ MSVC 6 bug
+
+#include "tao/Messaging/Messaging.h"
+#include "tao/ORB_Core.h"
+
+#include "ace/Reactor.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Reactive_SupplierControl.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_Reactive_SupplierControl, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Reactive_SupplierControl::
+ TAO_EC_Reactive_SupplierControl (const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ TAO_EC_Event_Channel_Base *ec,
+ CORBA::ORB_ptr orb)
+ : rate_ (rate),
+ timeout_ (timeout),
+ adapter_ (this),
+ event_channel_ (ec),
+ orb_ (CORBA::ORB::_duplicate (orb))
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ , timer_id_ (-1)
+#endif /* TAO_HAS_CORBA_MESSAGING != 0*/
+{
+ this->reactor_ =
+ this->orb_->orb_core ()->reactor ();
+}
+
+TAO_EC_Reactive_SupplierControl::~TAO_EC_Reactive_SupplierControl (void)
+{
+}
+
+void
+TAO_EC_Reactive_SupplierControl::query_suppliers (
+ ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_EC_Ping_Supplier worker (this);
+ this->event_channel_->for_each_supplier (&worker
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EC_Reactive_SupplierControl::handle_timeout (
+ const ACE_Time_Value &,
+ const void *)
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Query the state of the Current object *before* we initiate
+ // the iteration...
+ CORBA::PolicyTypeSeq types;
+ CORBA::PolicyList_var policies =
+ this->policy_current_->get_policy_overrides (types
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Change the timeout
+ this->policy_current_->set_policy_overrides (this->policy_list_,
+ CORBA::ADD_OVERRIDE
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Query the state of the suppliers...
+ this->query_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->policy_current_->set_policy_overrides (policies.in (),
+ CORBA::SET_OVERRIDE
+ 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;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+int
+TAO_EC_Reactive_SupplierControl::activate (void)
+{
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ ACE_TRY_NEW_ENV
+ {
+ // Get the PolicyCurrent object
+ CORBA::Object_var tmp =
+ this->orb_->resolve_initial_references ("PolicyCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->policy_current_ =
+ CORBA::PolicyCurrent::_narrow (tmp.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Timeout for polling state (default = 10 msec)
+ TimeBase::TimeT timeout = timeout_.usec() * 10;
+ CORBA::Any any;
+ any <<= timeout;
+
+ this->policy_list_.length (1);
+ this->policy_list_[0] =
+ this->orb_->create_policy (
+ Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
+ any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Only schedule the timer, when the rate is not zero
+ if (this->rate_ != ACE_Time_Value::zero)
+ {
+ // Schedule the timer after these policies has been set, because the
+ // handle_timeout uses these policies, if done in front, the channel
+ // can crash when the timeout expires before initiazation is ready.
+ timer_id_ = this->reactor_->schedule_timer (&this->adapter_,
+ 0,
+ this->rate_,
+ this->rate_);
+ if (timer_id_ == -1)
+ return -1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+#endif /* TAO_HAS_CORBA_MESSAGING */
+
+ return 0;
+}
+
+int
+TAO_EC_Reactive_SupplierControl::shutdown (void)
+{
+ int r = 0;
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ r = this->reactor_->cancel_timer (timer_id_);
+#endif /* TAO_HAS_CORBA_MESSAGING */
+ this->adapter_.reactor (0);
+ return r;
+}
+
+void
+TAO_EC_Reactive_SupplierControl::supplier_not_exist (
+ TAO_EC_ProxyPushConsumer *proxy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ //ACE_DEBUG ((LM_DEBUG,
+ // "EC_Reactive_SupplierControl(%P|%t) - "
+ // "Consumer %x does not exists\n", long(proxy)));
+ proxy->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions..
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_EC_Reactive_SupplierControl::system_exception (
+ TAO_EC_ProxyPushConsumer *proxy,
+ CORBA::SystemException & /* exception */
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ // The current implementation is very strict, and kicks out a
+ // client on the first system exception. We may
+ // want to be more lenient in the future, for example,
+ // this is TAO's minor code for a failed connection.
+ //
+ // if (CORBA::TRANSIENT::_narrow (&exception) != 0
+ // && exception->minor () == 0x54410085)
+ // return;
+
+ // Anything else is serious, including timeouts...
+ proxy->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions..
+ }
+ ACE_ENDTRY;
+}
+
+// ****************************************************************
+
+TAO_EC_SupplierControl_Adapter::TAO_EC_SupplierControl_Adapter (
+ TAO_EC_Reactive_SupplierControl *adaptee)
+ : adaptee_ (adaptee)
+{
+}
+
+int
+TAO_EC_SupplierControl_Adapter::handle_timeout (
+ const ACE_Time_Value &tv,
+ const void *arg)
+{
+ this->adaptee_->handle_timeout (tv, arg);
+ return 0;
+}
+
+// ****************************************************************
+
+void
+TAO_EC_Ping_Supplier::work (TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CORBA::Boolean disconnected;
+ CORBA::Boolean non_existent =
+ consumer->supplier_non_existent (disconnected
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (non_existent && !disconnected)
+ {
+ this->control_->supplier_not_exist (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ this->control_->supplier_not_exist (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TRANSIENT, transient)
+ {
+ // This is TAO's minor code for a failed connection, we may
+ // want to be more lenient in the future..
+ // if (transient.minor () == 0x54410085)
+ this->control_->supplier_not_exist (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions
+ }
+ ACE_ENDTRY;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.h b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.h
new file mode 100644
index 00000000000..141ddf9668c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.h
@@ -0,0 +1,166 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Reactive_SupplierControl.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_REACTIVE_SUPPLIERCONTROL_H
+#define TAO_EC_REACTIVE_SUPPLIERCONTROL_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_SupplierControl.h"
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/ORB.h"
+#include "tao/PolicyC.h"
+
+#include "ace/Event_Handler.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Event_Channel_Base;
+
+class TAO_EC_Reactive_SupplierControl;
+
+/**
+ * @class TAO_EC_SupplierControl_Adapter
+ *
+ * @brief Forwards timeout events to the Reactive SupplierControl
+ *
+ * The Reactive SupplierControl strategy uses the reactor to
+ * periodically wakeup and verify the state of the suppliers
+ * registered with the Event Channel.
+ *
+ * @todo Marina Spivak made the following observation: these classes
+ * and implementation seem nearly identical to those in
+ * EC_Reactive_ConsumerControl.* The only differences are using
+ * consumer_admin collection vs supplier_admin, and calling
+ * disconnect_push_consumer vs disconnect_push_supplier ... Seems
+ * like it may be a good idea to change some naming and templatize...
+ * @todo The same templates should be used for the Notification and
+ * COS Event services.
+ *
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_SupplierControl_Adapter : public ACE_Event_Handler
+{
+public:
+ /// Constructor
+ TAO_EC_SupplierControl_Adapter (TAO_EC_Reactive_SupplierControl *adaptee);
+
+ // = Documented in ACE_Event_Handler.
+ virtual int handle_timeout (const ACE_Time_Value &tv,
+ const void *arg = 0);
+
+private:
+ /// The adapted object
+ TAO_EC_Reactive_SupplierControl *adaptee_;
+};
+
+/**
+ * @class TAO_EC_Reactive_SupplierControl
+ *
+ * @brief SupplierControl
+ *
+ * Defines the interface for the supplier control strategy.
+ * This strategy handles misbehaving or failing suppliers.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Reactive_SupplierControl : public TAO_EC_SupplierControl
+{
+public:
+ /// Constructor. It does not assume ownership of the @a event_channel
+ /// parameter.
+ TAO_EC_Reactive_SupplierControl (const ACE_Time_Value &rate,
+ const ACE_Time_Value &timeout,
+ TAO_EC_Event_Channel_Base *event_channel,
+ CORBA::ORB_ptr orb);
+
+ /// Destructor.
+ virtual ~TAO_EC_Reactive_SupplierControl (void);
+
+ /// Receive the timeout from the adapter
+ void handle_timeout (const ACE_Time_Value &tv,
+ const void* arg);
+
+ // = Documented in TAO_EC_SupplierControl
+ virtual int activate (void);
+ virtual int shutdown (void);
+ virtual void supplier_not_exist (TAO_EC_ProxyPushConsumer *proxy
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void system_exception (TAO_EC_ProxyPushConsumer *proxy,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+private:
+ /// Check if the suppliers still exists. It is a helper method for
+ /// handle_timeout() to isolate the exceptions.
+ void query_suppliers (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// The polling rate
+ ACE_Time_Value rate_;
+
+ /// The polling timeout
+ ACE_Time_Value timeout_;
+
+ /// The Adapter for the reactor events
+ TAO_EC_SupplierControl_Adapter adapter_;
+
+ /// The event channel
+ TAO_EC_Event_Channel_Base *event_channel_;
+
+ /// The ORB
+ CORBA::ORB_var orb_;
+
+ /// To control the timeout policy in the thread
+ CORBA::PolicyCurrent_var policy_current_;
+
+ /// Precomputed policy list to the set timeout.
+ CORBA::PolicyList policy_list_;
+
+ /// The ORB reactor
+ ACE_Reactor *reactor_;
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ /// The timer id
+ long timer_id_;
+#endif /* TAO_HAS_CORBA_MESSAGING */
+};
+
+// ****************************************************************
+
+class TAO_EC_Ping_Supplier : public TAO_ESF_Worker<TAO_EC_ProxyPushConsumer>
+{
+public:
+ TAO_EC_Ping_Supplier (TAO_EC_SupplierControl *control);
+
+ virtual void work (TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_SupplierControl *control_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Reactive_SupplierControl.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_SUPPLIERCONTROL_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.i b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.i
new file mode 100644
index 00000000000..3ffaf226464
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.i
@@ -0,0 +1,13 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Ping_Supplier::TAO_EC_Ping_Supplier (TAO_EC_SupplierControl *control)
+ : control_ (control)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.cpp
new file mode 100644
index 00000000000..fbdfb022768
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.cpp
@@ -0,0 +1,56 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Reactive_Timeout_Generator.h"
+#include "ace/Reactor.h"
+
+ACE_RCSID (Event,
+ EC_Reactive_Timeout_Generator,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Reactive_Timeout_Generator::
+ TAO_EC_Reactive_Timeout_Generator (ACE_Reactor *reactor)
+ : reactor_ (reactor)
+{
+}
+
+TAO_EC_Reactive_Timeout_Generator::~TAO_EC_Reactive_Timeout_Generator (void)
+{
+}
+
+void
+TAO_EC_Reactive_Timeout_Generator::activate (void)
+{
+}
+
+void
+TAO_EC_Reactive_Timeout_Generator::shutdown (void)
+{
+ this->reactor_->cancel_timer (&this->event_handler_);
+ this->event_handler_.reactor (0);
+}
+
+int
+TAO_EC_Reactive_Timeout_Generator::schedule_timer (
+ TAO_EC_Timeout_Filter* filter,
+ const ACE_Time_Value& delta,
+ const ACE_Time_Value& interval)
+{
+ return this->reactor_->schedule_timer (&this->event_handler_,
+ static_cast<void*> (filter),
+ delta,
+ interval);
+}
+
+int
+TAO_EC_Reactive_Timeout_Generator::cancel_timer (
+ const TAO_EC_QOS_Info&,
+ int id)
+{
+ const void *vp;
+
+ return this->reactor_->cancel_timer (id, &vp);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.h b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.h
new file mode 100644
index 00000000000..8ab4d18da31
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_Timeout_Generator.h
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Reactive_Timeout_Generator.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_REACTIVE_TIMEOUT_GENERATOR_H
+#define TAO_EC_REACTIVE_TIMEOUT_GENERATOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Timeout_Generator.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Reactive_Timeout_Generator
+ *
+ * @brief A simple implementation of the Timeout_Generator based on the
+ * Reactor.
+ *
+ * Implements the Timeout_Generator using an ACE_Reactor. Usually
+ * the same reactor that is used by the ORB where the EC runs.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Reactive_Timeout_Generator
+ : public TAO_EC_Timeout_Generator
+{
+public:
+ /// Constructor.
+ /// If <reactor> is 0 then we use the reactor in the ORB singleton.
+ TAO_EC_Reactive_Timeout_Generator (ACE_Reactor *reactor = 0);
+
+ /// destructor
+ virtual ~TAO_EC_Reactive_Timeout_Generator (void);
+
+ // = The TAO_EC_Timeout_Generator methods.
+ virtual void activate (void);
+ virtual void shutdown (void);
+ virtual int schedule_timer (TAO_EC_Timeout_Filter* filter,
+ const ACE_Time_Value& delta,
+ const ACE_Time_Value& interval);
+ virtual int cancel_timer (const TAO_EC_QOS_Info& info,
+ int id);
+
+private:
+ /// The reactor
+ ACE_Reactor *reactor_;
+
+ /// An adapter to receive the timeout events.
+ TAO_EC_Timeout_Adapter event_handler_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_REACTIVE_TIMEOUT_GENERATOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Factory.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Factory.cpp
new file mode 100644
index 00000000000..66c4afcc9ac
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Factory.cpp
@@ -0,0 +1,225 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Sched_Factory.h"
+#include "orbsvcs/Event/EC_Priority_Dispatching.h"
+#include "orbsvcs/Event/EC_Priority_Scheduling.h"
+#include "orbsvcs/Event/EC_Sched_Filter_Builder.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/RtecSchedulerC.h"
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_strings.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Sched_Factory.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_Sched_Factory, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Sched_Factory::~TAO_EC_Sched_Factory (void)
+{
+}
+
+int
+TAO_EC_Sched_Factory::init (int argc, ACE_TCHAR* argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ while (arg_shifter.is_anything_left ())
+ {
+ const ACE_TCHAR* arg = arg_shifter.get_current ();
+
+ if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECDispatching")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
+ {
+ this->dispatching_ = 0;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("mt")) == 0)
+ {
+ this->dispatching_ = 1;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("priority")) == 0)
+ {
+ this->dispatching_ = 2;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("EC_Sched_Factory - ")
+ ACE_TEXT("unsupported dispatching <%s>\n"),
+ opt));
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECFiltering")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ {
+ this->filtering_ = 0;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("basic")) == 0)
+ {
+ this->filtering_ = 1;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("prefix")) == 0)
+ {
+ this->filtering_ = 2;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("priority")) == 0)
+ {
+ this->filtering_ = 3;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("EC_Sched_Factory - ")
+ ACE_TEXT("unsupported filtering <%s>\n"),
+ opt));
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECTimeout")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
+ {
+ this->timeout_ = 0;
+ }
+#if 0
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("priority")) == 0)
+ {
+ this->timeout_ = 1;
+ }
+#endif /* 0 */
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("EC_Sched_Factory - ")
+ ACE_TEXT("unsupported timeout <%s>\n"),
+ opt));
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECScheduling")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
+ {
+ this->scheduling_ = 0;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("group")) == 0)
+ {
+ this->scheduling_ = 1;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("priority")) == 0)
+ {
+ this->scheduling_ = 2;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("EC_Sched_Factory - ")
+ ACE_TEXT("unsupported scheduling <%s>\n"),
+ opt));
+ }
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+ return this->TAO_EC_Default_Factory::init (argc, argv);
+}
+
+int
+TAO_EC_Sched_Factory::fini (void)
+{
+ return 0;
+}
+
+// ****************************************************************
+
+TAO_EC_Dispatching*
+TAO_EC_Sched_Factory::create_dispatching (TAO_EC_Event_Channel_Base *ec)
+{
+ if (this->dispatching_ == 2)
+ return new TAO_EC_Priority_Dispatching (ec);
+ return this->TAO_EC_Default_Factory::create_dispatching (ec);
+}
+
+TAO_EC_Filter_Builder*
+TAO_EC_Sched_Factory::create_filter_builder (TAO_EC_Event_Channel_Base *ec)
+{
+ if (this->filtering_ == 3)
+ return new TAO_EC_Sched_Filter_Builder (ec);
+
+ return this->TAO_EC_Default_Factory::create_filter_builder (ec);
+}
+
+
+TAO_EC_Timeout_Generator*
+TAO_EC_Sched_Factory::create_timeout_generator (TAO_EC_Event_Channel_Base *ec)
+{
+#if 0
+ if (this->timeout_ == 1)
+ {
+ }
+#endif
+ return this->TAO_EC_Default_Factory::create_timeout_generator (ec);
+}
+
+TAO_EC_Scheduling_Strategy*
+TAO_EC_Sched_Factory::create_scheduling_strategy (TAO_EC_Event_Channel_Base* ec)
+{
+ if (this->scheduling_ == 2)
+ {
+ CORBA::Object_var tmp = ec->scheduler ();
+ RtecScheduler::Scheduler_var scheduler =
+ RtecScheduler::Scheduler::_narrow (tmp.in ());
+ return new TAO_EC_Priority_Scheduling (scheduler.in ());
+ }
+ return this->TAO_EC_Sched_Factory::create_scheduling_strategy (ec);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+ACE_STATIC_SVC_DEFINE (TAO_EC_Sched_Factory,
+ ACE_TEXT ("EC_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_EC_Sched_Factory),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
+ACE_FACTORY_DEFINE (TAO_RTSchedEvent, TAO_EC_Sched_Factory)
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Factory.h b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Factory.h
new file mode 100644
index 00000000000..b7b82d791fc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Factory.h
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+/**
+ * @file EC_Sched_Factory.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_SCHED_FACTORY_H
+#define TAO_EC_SCHED_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/sched_event_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Sched_Factory
+ *
+ * @brief Extend the default factory to support scheduling
+ *
+ */
+class TAO_RTSchedEvent_Export TAO_EC_Sched_Factory : public TAO_EC_Default_Factory
+{
+public:
+ /// Constructor
+ TAO_EC_Sched_Factory (void);
+
+ /// destructor...
+ virtual ~TAO_EC_Sched_Factory (void);
+
+ // = The Service_Object entry points
+ virtual int init (int argc, ACE_TCHAR* argv[]);
+ virtual int fini (void);
+
+ // = The EC_Factory methods
+ virtual TAO_EC_Dispatching*
+ create_dispatching (TAO_EC_Event_Channel_Base*);
+ virtual TAO_EC_Filter_Builder*
+ create_filter_builder (TAO_EC_Event_Channel_Base*);
+ virtual TAO_EC_Timeout_Generator*
+ create_timeout_generator (TAO_EC_Event_Channel_Base*);
+ virtual TAO_EC_Scheduling_Strategy*
+ create_scheduling_strategy (TAO_EC_Event_Channel_Base*);
+
+private:
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Sched_Factory.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_STATIC_SVC_DECLARE (TAO_EC_Sched_Factory)
+ACE_FACTORY_DECLARE (TAO_RTSchedEvent, TAO_EC_Sched_Factory)
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_SCHED_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Factory.i b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Factory.i
new file mode 100644
index 00000000000..84cbe2d4a4d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Factory.i
@@ -0,0 +1,13 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Sched_Factory::TAO_EC_Sched_Factory (void)
+ : TAO_EC_Default_Factory ()
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter.cpp
new file mode 100644
index 00000000000..3eb8e03e214
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter.cpp
@@ -0,0 +1,283 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Sched_Filter.h"
+#include "orbsvcs/Event/EC_QOS_Info.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID(Event, EC_Sched_Filter, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Sched_Filter::
+ TAO_EC_Sched_Filter (const char* name,
+ RtecScheduler::handle_t rt_info,
+ RtecScheduler::Scheduler_ptr scheduler,
+ TAO_EC_Filter* body,
+ RtecScheduler::handle_t body_info,
+ RtecScheduler::handle_t parent_info,
+ RtecScheduler::Info_Type_t info_type)
+
+ : rt_info_ (rt_info),
+ rt_info_computed_ (0),
+ name_ (name),
+ scheduler_ (RtecScheduler::Scheduler::_duplicate (scheduler)),
+ body_ (body),
+ body_info_ (body_info),
+ parent_info_ (parent_info),
+ info_type_ (info_type)
+{
+ this->adopt_child (this->body_);
+}
+
+TAO_EC_Sched_Filter::~TAO_EC_Sched_Filter (void)
+{
+ delete this->body_;
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Sched_Filter::begin (void) const
+{
+ return this->body_->begin ();
+}
+
+TAO_EC_Filter::ChildrenIterator
+TAO_EC_Sched_Filter::end (void) const
+{
+ return this->body_->end ();
+}
+
+int
+TAO_EC_Sched_Filter::size (void) const
+{
+ return this->body_->size ();
+}
+
+int
+TAO_EC_Sched_Filter::filter (const RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ return this->body_->filter (event, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+int
+TAO_EC_Sched_Filter::filter_nocopy (RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ return this->body_->filter_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+// This is private, so we can make it inline in the .cpp file...
+void
+TAO_EC_Sched_Filter::compute_qos_info (TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ this->init_rt_info (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ qos_info.rt_info = this->rt_info_;
+ switch (this->info_type_)
+ {
+ default:
+ case RtecScheduler::DISJUNCTION:
+ break;
+
+ case RtecScheduler::CONJUNCTION:
+ case RtecScheduler::OPERATION:
+ {
+ RtecScheduler::OS_Priority os_priority;
+ RtecScheduler::Preemption_Subpriority_t p_subpriority;
+ RtecScheduler::Preemption_Priority_t p_priority;
+ this->scheduler_->priority (this->rt_info_,
+ os_priority,
+ p_subpriority,
+ p_priority
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ qos_info.preemption_priority = p_priority;
+ }
+ }
+}
+
+void
+TAO_EC_Sched_Filter::push (const RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (this->parent () != 0)
+ {
+ this->compute_qos_info (qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->parent ()->push (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_EC_Sched_Filter::push_nocopy (RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (this->parent () != 0)
+ {
+ this->compute_qos_info (qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->parent ()->push_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_EC_Sched_Filter::clear (void)
+{
+ this->body_->clear ();
+}
+
+CORBA::ULong
+TAO_EC_Sched_Filter::max_event_size (void) const
+{
+ return this->body_->max_event_size ();
+}
+
+int
+TAO_EC_Sched_Filter::can_match (const RtecEventComm::EventHeader& header) const
+{
+ return this->body_->can_match (header);
+}
+
+int
+TAO_EC_Sched_Filter::add_dependencies (const RtecEventComm::EventHeader& header,
+ const TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL)
+{
+ this->init_rt_info (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ int matches = this->body_->add_dependencies (header,
+ qos_info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (matches != 0)
+ {
+ this->scheduler_->add_dependency (this->rt_info_, qos_info.rt_info, 1,
+ RtecBase::TWO_WAY_CALL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ RtecScheduler::RT_Info_var info =
+ this->scheduler_->get (qos_info.rt_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ ACE_DEBUG ((LM_DEBUG, "[%s] ----> [%s]\n",
+ this->name_.c_str (),
+ info->entry_point.in ()));
+ }
+
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin (); i != end; ++i)
+ {
+ (*i)->add_dependencies (header, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ return 0;
+}
+
+void
+TAO_EC_Sched_Filter::get_qos_info (TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ this->init_rt_info (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ qos_info.rt_info = this->rt_info_;
+}
+
+void
+TAO_EC_Sched_Filter::init_rt_info (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->rt_info_computed_)
+ return;
+
+ // Provide dummy values the scheduler will compute them based on the
+ // dependencies and the fact that this is a DISJUNCTION.
+ this->scheduler_->set (this->rt_info_,
+ RtecScheduler::VERY_LOW_CRITICALITY,
+ 0, // worst_cast_execution_time
+ 0, // typical_cast_execution_time
+ 0, // cached_cast_execution_time
+ 0, // period
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ 0, // quantum
+ 0, // threads
+ this->info_type_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+#if 0
+ ChildrenIterator end = this->end ();
+ for (ChildrenIterator i = this->begin (); i != end; ++i)
+ {
+ TAO_EC_Filter* filter = *i;
+
+ TAO_EC_QOS_Info child;
+ filter->get_qos_info (child ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->scheduler_->add_dependency (this->rt_info_,
+ child.rt_info, 1,
+ RtecBase::TWO_WAY_CALL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecScheduler::RT_Info_var info =
+ this->scheduler_->get (child.rt_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "[%s] ----> [%s]\n",
+ info->entry_point.in (),
+ this->name_.c_str ()));
+
+ }
+#endif /* 0 */
+
+#if 1
+ if (this->body_info_ != this->rt_info_)
+ {
+ this->scheduler_->add_dependency (this->rt_info_,
+ this->body_info_,
+ 1,
+ RtecBase::TWO_WAY_CALL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecScheduler::RT_Info_var info =
+ this->scheduler_->get (this->body_info_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "[%s] ----> [%s]\n",
+ info->entry_point.in (),
+ this->name_.c_str ()));
+ }
+#endif /* 0 */
+
+#if 1
+ this->scheduler_->add_dependency (this->parent_info_,
+ this->rt_info_,
+ 1,
+ RtecBase::TWO_WAY_CALL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecScheduler::RT_Info_var info =
+ this->scheduler_->get (this->parent_info_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "[%s] ----> [%s]\n",
+ this->name_.c_str (),
+ info->entry_point.in ()));
+#endif /* 0 */
+
+ this->rt_info_computed_ = 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter.h b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter.h
new file mode 100644
index 00000000000..5645a6eac92
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter.h
@@ -0,0 +1,129 @@
+// -*- C++ -*-
+/**
+ * @file EC_Sched_Filter.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_SCHED_FILTER_H
+#define TAO_EC_SCHED_FILTER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Filter.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RtecSchedulerC.h"
+#include "orbsvcs/Event/sched_event_export.h"
+#include "ace/SString.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Sched_Filter
+ *
+ * @brief Decorate a filter with scheduling information
+ *
+ * This filter decorates a regular filter with scheduling
+ * information. It creates a new RT_Info entry for the filter and
+ * it adds the dependencies between the filter and any childrens
+ * it may have.
+ *
+ * <H2>Memory Management</H2>
+ * It assumes ownership of the children.
+ */
+class TAO_RTSchedEvent_Export TAO_EC_Sched_Filter : public TAO_EC_Filter
+{
+public:
+ /**
+ * Constructor.
+ * It assumes ownership of the <body>, makes a copy of the other
+ * parameters
+ */
+ TAO_EC_Sched_Filter (const char* name,
+ RtecScheduler::handle_t rt_info,
+ RtecScheduler::Scheduler_ptr scheduler,
+ TAO_EC_Filter* body,
+ RtecScheduler::handle_t body_info,
+ RtecScheduler::handle_t parent_info,
+ RtecScheduler::Info_Type_t info_type);
+
+ /// Destructor
+ virtual ~TAO_EC_Sched_Filter (void);
+
+ // = The TAO_EC_Filter methods, please check the documentation in
+ // TAO_EC_Filter.
+ virtual ChildrenIterator begin (void) const;
+ virtual ChildrenIterator end (void) const;
+ virtual int size (void) const;
+ virtual int filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual int filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void clear (void);
+ virtual CORBA::ULong max_event_size (void) const;
+ virtual int can_match (const RtecEventComm::EventHeader& header) const;
+ virtual int add_dependencies (const RtecEventComm::EventHeader& header,
+ const TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void get_qos_info (TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_Sched_Filter (const TAO_EC_Sched_Filter&);
+ TAO_EC_Sched_Filter& operator= (const TAO_EC_Sched_Filter&);
+
+ /// Initialize our RT_Info handle and dependencies
+ void init_rt_info (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Compute a new qos_info to push up.
+ void compute_qos_info (TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ /// The RT_Info handle for this object
+ RtecScheduler::handle_t rt_info_;
+
+ /// Has the Scheduler been updated?
+ int rt_info_computed_;
+
+ /// Our operation name
+ ACE_CString name_;
+
+ /// The scheduler we are going to use
+ RtecScheduler::Scheduler_var scheduler_;
+
+ /// The implementation
+ TAO_EC_Filter* body_;
+
+ /// The RT_Info handle for the body
+ RtecScheduler::handle_t body_info_;
+
+ /// The RT_Info handle for the parent
+ RtecScheduler::handle_t parent_info_;
+
+ /// Required for the scheduling service
+ RtecScheduler::Info_Type_t info_type_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_SCHED_FILTER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter_Builder.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter_Builder.cpp
new file mode 100644
index 00000000000..95ef9e1886e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter_Builder.cpp
@@ -0,0 +1,335 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Sched_Filter.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Event/EC_Sched_Filter_Builder.h"
+#include "orbsvcs/Event/EC_Type_Filter.h"
+#include "orbsvcs/Event/EC_Conjunction_Filter.h"
+#include "orbsvcs/Event/EC_Disjunction_Filter.h"
+#include "orbsvcs/Event/EC_Timeout_Filter.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "ace/OS_NS_stdio.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Sched_Filter_Builder.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_Sched_Filter_Builder, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Sched_Filter_Builder::~TAO_EC_Sched_Filter_Builder (void)
+{
+}
+
+TAO_EC_Filter*
+TAO_EC_Sched_Filter_Builder::build (
+ TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos
+ ACE_ENV_ARG_DECL) const
+{
+ CORBA::ULong pos = 0;
+ CORBA::Object_var tmp =
+ this->event_channel_->scheduler ();
+
+ RtecScheduler::Scheduler_var scheduler =
+ RtecScheduler::Scheduler::_narrow (tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // @@ How do we figure out which parent???
+ RtecScheduler::handle_t parent_info =
+ scheduler->lookup ("Dispatching_Task-250000.us" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->recursive_build (supplier, qos, pos,
+ scheduler.in (),
+ parent_info
+ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_EC_Filter*
+TAO_EC_Sched_Filter_Builder::recursive_build (
+ TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong& pos,
+ RtecScheduler::Scheduler_ptr scheduler,
+ RtecScheduler::handle_t parent_info
+ ACE_ENV_ARG_DECL) const
+{
+ const RtecEventComm::Event& e = qos.dependencies[pos].event;
+
+ if (e.header.type == ACE_ES_CONJUNCTION_DESIGNATOR)
+ {
+ CORBA::ULong npos = pos;
+ ACE_CString name;
+ this->recursive_name (qos, npos,
+ scheduler, name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ RtecScheduler::handle_t rt_info =
+ scheduler->create (name.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ pos++; // Consume the designator
+ CORBA::ULong n = this->count_children (qos, pos);
+
+ TAO_EC_Filter** children;
+ ACE_NEW_RETURN (children, TAO_EC_Filter*[n], 0);
+ for (CORBA::ULong i = 0; i != n; ++i)
+ {
+ children[i] = this->recursive_build (supplier, qos, pos,
+ scheduler,
+ rt_info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ TAO_EC_Sched_Filter *filter;
+ ACE_NEW_RETURN (filter,
+ TAO_EC_Sched_Filter (name.c_str (),
+ rt_info,
+ scheduler,
+ new TAO_EC_Conjunction_Filter(children,
+ n),
+ rt_info,
+ parent_info,
+ RtecScheduler::CONJUNCTION),
+ 0);
+ TAO_EC_QOS_Info qos_info;
+ filter->get_qos_info (qos_info ACE_ENV_ARG_PARAMETER);
+ // @@
+ ACE_CHECK_RETURN (0);
+ return filter;
+ }
+
+ else if (e.header.type == ACE_ES_DISJUNCTION_DESIGNATOR)
+ {
+ CORBA::ULong npos = pos;
+ ACE_CString name;
+ this->recursive_name (qos, npos,
+ scheduler, name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ RtecScheduler::handle_t rt_info =
+ scheduler->create (name.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ pos++; // Consume the designator
+ CORBA::ULong n = this->count_children (qos, pos);
+
+ TAO_EC_Filter** children;
+ ACE_NEW_RETURN (children, TAO_EC_Filter*[n], 0);
+ for (CORBA::ULong i = 0; i != n; ++i)
+ {
+ children[i] = this->recursive_build (supplier, qos, pos,
+ scheduler,
+ rt_info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ TAO_EC_Sched_Filter *filter;
+ ACE_NEW_RETURN (filter,
+ TAO_EC_Sched_Filter (name.c_str (),
+ rt_info,
+ scheduler,
+ new TAO_EC_Disjunction_Filter (children,
+ n),
+ rt_info,
+ parent_info,
+ RtecScheduler::DISJUNCTION),
+ 0);
+
+ TAO_EC_QOS_Info qos_info;
+ filter->get_qos_info (qos_info ACE_ENV_ARG_PARAMETER);
+ // @@
+ ACE_CHECK_RETURN (0);
+ return filter;
+ }
+
+ else if (e.header.type == ACE_ES_EVENT_TIMEOUT
+ || e.header.type == ACE_ES_EVENT_INTERVAL_TIMEOUT
+ || e.header.type == ACE_ES_EVENT_DEADLINE_TIMEOUT)
+ {
+ pos++;
+
+ // @@ We need a unique name for each timeout, assigned by the
+ // application?
+ char buf[64];
+ ACE_OS::sprintf (buf, "TIMEOUT:%u",
+ static_cast<u_int> ((e.header.creation_time / 10000)));
+ ACE_CString name = buf;
+
+ TAO_EC_QOS_Info qos_info;
+ qos_info.rt_info =
+ scheduler->create (name.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Convert the time to the proper units....
+ RtecScheduler::Period_t period =
+ static_cast<RtecScheduler::Period_t> (e.header.creation_time / 10);
+
+ scheduler->set (qos_info.rt_info,
+ RtecScheduler::VERY_LOW_CRITICALITY,
+ 0, // worst_cast_execution_time
+ 0, // typical_cast_execution_time
+ 0, // cached_cast_execution_time
+ period,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ 0, // quantum
+ 1, // threads
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ scheduler->add_dependency (qos_info.rt_info,
+ parent_info,
+ 1,
+ RtecBase::TWO_WAY_CALL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return new TAO_EC_Timeout_Filter (this->event_channel_,
+ supplier,
+ qos_info,
+ e.header.type,
+ e.header.creation_time);
+ }
+
+ RtecScheduler::handle_t body_info = qos.dependencies[pos].rt_info;
+
+ RtecScheduler::RT_Info_var info =
+ scheduler->get (body_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ACE_CString name = info->entry_point.in ();
+ name += "#rep";
+
+ RtecScheduler::handle_t rt_info =
+ scheduler->create (name.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ pos++;
+ TAO_EC_Sched_Filter *filter;
+ ACE_NEW_RETURN (filter,
+ TAO_EC_Sched_Filter (name.c_str (),
+ rt_info,
+ scheduler,
+ new TAO_EC_Type_Filter (e.header),
+ body_info,
+ parent_info,
+ RtecScheduler::OPERATION),
+ 0);
+
+ TAO_EC_QOS_Info qos_info;
+ filter->get_qos_info (qos_info ACE_ENV_ARG_PARAMETER);
+ // @@
+ ACE_CHECK_RETURN (0);
+ return filter;
+}
+
+void
+TAO_EC_Sched_Filter_Builder:: recursive_name (
+ RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong& pos,
+ RtecScheduler::Scheduler_ptr scheduler,
+ ACE_CString& name
+ ACE_ENV_ARG_DECL) const
+{
+ const RtecEventComm::Event& e = qos.dependencies[pos].event;
+
+ if (e.header.type == ACE_ES_CONJUNCTION_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+ CORBA::ULong n = this->count_children (qos, pos);
+
+ for (CORBA::ULong i = 0; i != n; ++i)
+ {
+ ACE_CString child_name;
+ this->recursive_name (qos, pos,
+ scheduler,
+ child_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (i == 0)
+ name += "(";
+ else
+ name += "&&";
+ name += child_name;
+ }
+ name += ")";
+ return;
+ }
+
+ else if (e.header.type == ACE_ES_DISJUNCTION_DESIGNATOR)
+ {
+ pos++; // Consume the designator
+ CORBA::ULong n = this->count_children (qos, pos);
+
+ for (CORBA::ULong i = 0; i != n; ++i)
+ {
+ ACE_CString child_name;
+
+ this->recursive_name (qos, pos,
+ scheduler,
+ child_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (i == 0)
+ name += "(";
+ else
+ name += "||";
+ name += child_name;
+ }
+ name += ")";
+ return;
+ }
+
+ else if (e.header.type == ACE_ES_EVENT_TIMEOUT
+ || e.header.type == ACE_ES_EVENT_INTERVAL_TIMEOUT
+ || e.header.type == ACE_ES_EVENT_DEADLINE_TIMEOUT)
+ {
+ pos++;
+
+ char buf[64];
+ ACE_OS::sprintf (buf, "TIMEOUT:%u",
+ static_cast<u_int> ((e.header.creation_time / 10000)));
+ name = buf;
+
+ return;
+ }
+
+ RtecScheduler::handle_t body_info = qos.dependencies[pos].rt_info;
+
+ RtecScheduler::RT_Info_var info =
+ scheduler->get (body_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ name = info->entry_point.in ();
+ name += "#rep";
+
+ pos++;
+}
+
+CORBA::ULong
+TAO_EC_Sched_Filter_Builder::
+ count_children (RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong pos) const
+{
+ CORBA::ULong l = qos.dependencies.length ();
+ CORBA::ULong i;
+ for (i = pos; i != l; ++i)
+ {
+ const RtecEventComm::Event& e = qos.dependencies[i].event;
+ if (e.header.type == ACE_ES_CONJUNCTION_DESIGNATOR
+ || e.header.type == ACE_ES_DISJUNCTION_DESIGNATOR)
+ break;
+ }
+ return i - 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter_Builder.h b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter_Builder.h
new file mode 100644
index 00000000000..c649518ecbe
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter_Builder.h
@@ -0,0 +1,89 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Sched_Filter_Builder.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_SCHED_FILTER_BUILDER_H
+#define TAO_EC_SCHED_FILTER_BUILDER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Filter_Builder.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/sched_event_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Filter;
+class TAO_EC_Event_Channel_Base;
+
+/**
+ * @class TAO_EC_Sched_Filter_Builder
+ *
+ * @brief Implement a builder for the fundamental filters.
+ *
+ * The sched filtering mechanisms in the Event channel
+ * (source/type based filtering + disjunctions and conjunctions)
+ * are constructed using this class.
+ */
+class TAO_RTSchedEvent_Export TAO_EC_Sched_Filter_Builder : public TAO_EC_Filter_Builder
+{
+public:
+ /// constructor.
+ TAO_EC_Sched_Filter_Builder (TAO_EC_Event_Channel_Base* ec);
+
+ /// destructor...
+ virtual ~TAO_EC_Sched_Filter_Builder (void);
+
+ // = The TAO_EC_Filter_Builder methods...
+ TAO_EC_Filter* build (TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos
+ ACE_ENV_ARG_DECL) const;
+
+private:
+ /// Recursively build the filter tree.
+ TAO_EC_Filter* recursive_build (TAO_EC_ProxyPushSupplier *supplier,
+ RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong& pos,
+ RtecScheduler::Scheduler_ptr scheduler,
+ RtecScheduler::handle_t parent_info
+ ACE_ENV_ARG_DECL) const;
+
+ /// Build the name recursively...
+ void recursive_name (RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong& pos,
+ RtecScheduler::Scheduler_ptr scheduler,
+ ACE_CString &name
+ ACE_ENV_ARG_DECL) const;
+
+ /// Count the number of children of the current node, i.e. until a
+ /// conjunction or disjunction starts.
+ CORBA::ULong count_children (RtecEventChannelAdmin::ConsumerQOS& qos,
+ CORBA::ULong pos) const;
+
+private:
+ /// The event channel.
+ TAO_EC_Event_Channel_Base* event_channel_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Sched_Filter_Builder.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_SCHED_FILTER_BUILDER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter_Builder.i b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter_Builder.i
new file mode 100644
index 00000000000..a00dfd725c5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Sched_Filter_Builder.i
@@ -0,0 +1,14 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Sched_Filter_Builder::
+ TAO_EC_Sched_Filter_Builder (TAO_EC_Event_Channel_Base *ec)
+ : event_channel_ (ec)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Scheduling_Strategy.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Scheduling_Strategy.cpp
new file mode 100644
index 00000000000..76be60d02ec
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Scheduling_Strategy.cpp
@@ -0,0 +1,14 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Scheduling_Strategy.h"
+#include "orbsvcs/Event/EC_QOS_Info.h"
+
+ACE_RCSID(Event, EC_Scheduling_Strategy, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Scheduling_Strategy::~TAO_EC_Scheduling_Strategy (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Scheduling_Strategy.h b/TAO/orbsvcs/orbsvcs/Event/EC_Scheduling_Strategy.h
new file mode 100644
index 00000000000..08d3a6bf5c2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Scheduling_Strategy.h
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Scheduling_Strategy.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_SCHEDULING_STRATEGY_H
+#define TAO_EC_SCHEDULING_STRATEGY_H
+
+#include /**/ "ace/pre.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#include "orbsvcs/RtecBaseC.h"
+#include "orbsvcs/RtecEventCommC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_ProxyPushConsumer;
+class TAO_EC_ProxyPushSupplier;
+class TAO_EC_Supplier_Filter;
+class TAO_EC_QOS_Info;
+
+/**
+ * @class TAO_EC_Scheduling_Strategy
+ *
+ * @brief Define the interface for the scheduling strategy
+ *
+ * The scheduling strategy controls the actions that the event
+ * channel must take to update the dependency information in the
+ * scheduler and to query the scheduler for the priority of each
+ * event pushed by a supplier.
+ * The base
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Scheduling_Strategy
+{
+public:
+ /// Destructor
+ virtual ~TAO_EC_Scheduling_Strategy (void);
+
+ /// Add all the dependencies between @a supplier and @a consumer
+ virtual void add_proxy_supplier_dependencies (
+ TAO_EC_ProxyPushSupplier *supplier,
+ TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Schedule an event set and deliver them to the filter in the
+ /// desired order and grouping.
+ virtual void schedule_event (const RtecEventComm::EventSet &event,
+ TAO_EC_ProxyPushConsumer *consumer,
+ TAO_EC_Supplier_Filter *filter
+ ACE_ENV_ARG_DECL) = 0;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_SCHEDULING_STRATEGY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp
new file mode 100644
index 00000000000..fb555cf3e95
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp
@@ -0,0 +1,39 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_SupplierAdmin.h"
+#include "orbsvcs/Event/EC_ProxyConsumer.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/ESF/ESF_Peer_Workers.h"
+#include "orbsvcs/ESF/ESF_Peer_Admin.h"
+#include "orbsvcs/ESF/ESF_Shutdown_Proxy.h"
+
+ACE_RCSID(Event, EC_SupplierAdmin, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_SupplierAdmin::TAO_EC_SupplierAdmin (TAO_EC_Event_Channel_Base *ec)
+ : TAO_ESF_Peer_Admin<TAO_EC_Event_Channel_Base,TAO_EC_ProxyPushConsumer,RtecEventChannelAdmin::ProxyPushConsumer,TAO_EC_ProxyPushSupplier> (ec)
+{
+ this->default_POA_ =
+ this->event_channel_->supplier_poa ();
+}
+
+TAO_EC_SupplierAdmin::~TAO_EC_SupplierAdmin (void)
+{
+}
+
+RtecEventChannelAdmin::ProxyPushConsumer_ptr
+TAO_EC_SupplierAdmin::obtain_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->obtain (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+PortableServer::POA_ptr
+TAO_EC_SupplierAdmin::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.h b/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.h
new file mode 100644
index 00000000000..44e9edb8dc9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.h
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_SupplierAdmin.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_SUPPLIERADMIN_H
+#define TAO_EC_SUPPLIERADMIN_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_ProxyConsumer.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Peer_Admin.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Event_Channel_Base;
+class TAO_EC_ProxyPushSupplier;
+
+/**
+ * @class TAO_EC_SupplierAdmin
+ *
+ * @brief Implement the RtecEventChannelAdmin::SupplierAdmin interface.
+ *
+ *
+ * <H2>Memory Management</H2>
+ * It does not assume ownership of the TAO_EC_Event_Channel_Base object
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_SupplierAdmin
+ : public POA_RtecEventChannelAdmin::SupplierAdmin
+ , public TAO_ESF_Peer_Admin<TAO_EC_Event_Channel_Base,TAO_EC_ProxyPushConsumer,RtecEventChannelAdmin::ProxyPushConsumer,TAO_EC_ProxyPushSupplier>
+{
+public:
+ /// constructor...
+ TAO_EC_SupplierAdmin (TAO_EC_Event_Channel_Base* event_channel);
+
+ /// destructor...
+ virtual ~TAO_EC_SupplierAdmin (void);
+
+ // = The RtecEventChannelAdmin::SupplierAdmin methods...
+ virtual RtecEventChannelAdmin::ProxyPushConsumer_ptr
+ obtain_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // = The PortableServer::ServantBase methods
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// Store the default POA.
+ PortableServer::POA_var default_POA_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_SUPPLIERADMIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_SupplierControl.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_SupplierControl.cpp
new file mode 100644
index 00000000000..7d73bfbaf53
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_SupplierControl.cpp
@@ -0,0 +1,42 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_SupplierControl.h"
+
+ACE_RCSID(Event, EC_SupplierControl, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_SupplierControl::TAO_EC_SupplierControl (void)
+{
+}
+
+TAO_EC_SupplierControl::~TAO_EC_SupplierControl (void)
+{
+}
+
+int
+TAO_EC_SupplierControl::activate (void)
+{
+ return 0;
+}
+
+int
+TAO_EC_SupplierControl::shutdown (void)
+{
+ return 0;
+}
+
+void
+TAO_EC_SupplierControl::supplier_not_exist (TAO_EC_ProxyPushConsumer *
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_SupplierControl::system_exception (TAO_EC_ProxyPushConsumer *,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_SupplierControl.h b/TAO/orbsvcs/orbsvcs/Event/EC_SupplierControl.h
new file mode 100644
index 00000000000..e4247d13b5b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_SupplierControl.h
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_SupplierControl.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_SUPPLIERCONTROL_H
+#define TAO_EC_SUPPLIERCONTROL_H
+
+#include /**/ "ace/pre.h"
+#include "ace/CORBA_macros.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_ProxyPushConsumer;
+
+namespace CORBA
+{
+ class Environment;
+ class SystemException;
+}
+
+/**
+ * @class TAO_EC_SupplierControl
+ *
+ * @brief SupplierControl
+ *
+ * Defines the interface for the supplier control strategy.
+ * This strategy handles misbehaving or failing suppliers.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_SupplierControl
+{
+public:
+ /// Constructor.
+ TAO_EC_SupplierControl (void);
+
+ /// Destructor.
+ virtual ~TAO_EC_SupplierControl (void);
+
+ /// Activate any internal threads or timers used to poll the state of
+ /// the suppliers
+ virtual int activate (void);
+ virtual int shutdown (void);
+
+ /**
+ * Invoked by helper classes when they detect that a supplier does
+ * not exists (i.e. _non_existent() returns true and/or the
+ * CORBA::OBJECT_NOT_EXIST exception has been raised).
+ */
+ virtual void supplier_not_exist (TAO_EC_ProxyPushConsumer *proxy
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Some system exception was raised while trying to contact the
+ /// supplier
+ virtual void system_exception (TAO_EC_ProxyPushConsumer * proxy,
+ CORBA::SystemException &
+ ACE_ENV_ARG_DECL_NOT_USED);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_SUPPLIERCONTROL_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter.cpp
new file mode 100644
index 00000000000..1f424fd0575
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter.cpp
@@ -0,0 +1,29 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Supplier_Filter.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_QOS_Info.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Supplier_Filter.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_Supplier_Filter, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Supplier_Filter::~TAO_EC_Supplier_Filter (void)
+{
+}
+
+// ****************************************************************
+
+void
+TAO_EC_Filter_Worker::work (TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EC_QOS_Info qos_info = this->event_info_;
+ supplier->filter (this->event_, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter.h b/TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter.h
new file mode 100644
index 00000000000..898fdc45e02
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter.h
@@ -0,0 +1,151 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Supplier_Filter.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_SUPPLIER_FILTER_H
+#define TAO_EC_SUPPLIER_FILTER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventCommC.h"
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_ProxyPushSupplier;
+class TAO_EC_ProxyPushConsumer;
+class TAO_EC_QOS_Info;
+
+/**
+ * @class TAO_EC_Supplier_Filter
+ *
+ * @brief The strategy to filter close to the supplier.
+ *
+ * After an event is received by the a ProxyPushConsumer it must
+ * be dispatched to the right set of ProxyPushSuppliers;
+ * determining this set is the task of this class.
+ * Notice that this is in fact a filter, and enforces (in part)
+ * the subscriptions and publications of the Event Service
+ * clients.
+ * Several implementations are possible:
+ * - Each ProxyPushConsumer keeps a list of ProxyPushSuppliers,
+ * using the subscriptions and publications to find potential
+ * matches.
+ * - Each ProxyPushConsumer keeps several such lists, indexed by
+ * event type and/or source, this has the advantage of further
+ * minimizing the set of ProxyPushSuppliers invoked.
+ * - A single list of consumers is kept (global for the event
+ * channel), such a list results is faster updates and requires
+ * an smaller memory footprint.
+ * - Multiple global lists are kept, indexed by type and/or
+ * source, this is a tradeoff between the solutions above.
+ * - No list is kept, the events are sent to the consumers which
+ * must filter out what they want, this is good when no
+ * filtering is wanted or when the amount of filtering is coarse
+ * i.e. each event goes to a large subset of the
+ * ProxyPushSuppliers.
+ * Different applications will require to use different
+ * implementations of this class; as usual the EC_Factory will
+ * create the right instance.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Supplier_Filter
+{
+public:
+ /// Destructor
+ virtual ~TAO_EC_Supplier_Filter (void);
+
+ /**
+ * Whenever a ProxyPushConsumer is initialized it calls this method
+ * to inform the Supplier_Filter of its identity.
+ * Strategies that do not keep ProxyPushConsumer specific
+ * information, or that are shared between multiple
+ * ProxyPushConsumers can ignore this message.
+ */
+ virtual void bind (TAO_EC_ProxyPushConsumer* consumer) = 0;
+
+ /**
+ * Wheneve a ProxyPushConsumer is about to be destroyed it calls
+ * this method to inform the Supplier_Filter that it should
+ * release any resources related to it.
+ * Supplier_Filter strategies that are bound to a particular
+ * ProxyConsumer can use this opportunity to destroy themselves;
+ * filter strategies that do not keep ProxyPushConsumer specific
+ * information can simply ignore the message.
+ */
+ virtual void unbind (TAO_EC_ProxyPushConsumer* consumer) = 0;
+
+ /// Concrete implementations can use this methods to keep track of
+ /// the consumers interested in this events.
+ virtual void connected (TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL) = 0;
+ virtual void reconnected (TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL) = 0;
+ virtual void disconnected (TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// The event channel is shutting down.
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ /// The ProxyPushConsumer delegates on this class to actually send
+ /// the event.
+ virtual void push (const RtecEventComm::EventSet &event,
+ TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Events are first scheduled by the TAO_EC_Scheduling_Strategy,
+ /// and then pushed through this class again.
+ virtual void push_scheduled_event (RtecEventComm::EventSet &event,
+ const TAO_EC_QOS_Info &event_info
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Increment and decrement the reference count, locking must be
+ /// provided by the user.
+ virtual CORBA::ULong _incr_refcnt (void) = 0;
+ virtual CORBA::ULong _decr_refcnt (void) = 0;
+};
+
+// ****************************************************************
+
+class TAO_EC_Filter_Worker : public TAO_ESF_Worker<TAO_EC_ProxyPushSupplier>
+{
+public:
+ TAO_EC_Filter_Worker (RtecEventComm::EventSet &event,
+ const TAO_EC_QOS_Info &event_info);
+
+ virtual void work (TAO_EC_ProxyPushSupplier *supplier
+ ACE_ENV_ARG_DECL);
+
+private:
+ /// The event we push on each case, use a reference to avoid copies.
+ RtecEventComm::EventSet &event_;
+
+ /// The QoS info propagated on each event.
+ const TAO_EC_QOS_Info &event_info_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Supplier_Filter.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_SUPPLIER_FILTER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter.i b/TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter.i
new file mode 100644
index 00000000000..9b09afb3d74
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter.i
@@ -0,0 +1,15 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Filter_Worker::TAO_EC_Filter_Worker (RtecEventComm::EventSet &event,
+ const TAO_EC_QOS_Info &event_info)
+ : event_ (event),
+ event_info_ (event_info)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter_Builder.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter_Builder.cpp
new file mode 100644
index 00000000000..63203a004fa
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter_Builder.cpp
@@ -0,0 +1,13 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Supplier_Filter_Builder.h"
+
+ACE_RCSID(Event, EC_Supplier_Filter_Builder, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Supplier_Filter_Builder::~TAO_EC_Supplier_Filter_Builder (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter_Builder.h b/TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter_Builder.h
new file mode 100644
index 00000000000..d81cab67d94
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Supplier_Filter_Builder.h
@@ -0,0 +1,67 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Supplier_Filter_Builder.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_SUPPLIER_FILTER_BUILDER_H
+#define TAO_EC_SUPPLIER_FILTER_BUILDER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventChannelAdminC.h"
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Supplier_Filter;
+class TAO_EC_ProxyPushConsumer;
+
+/**
+ * @class TAO_EC_Supplier_Filter_Builder
+ *
+ * @brief Abstract base class for the supplier filter builders.
+ *
+ * The creation of the right filter for each supplier controlled
+ * by a Supplier_Filter_Builder.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Supplier_Filter_Builder
+{
+public:
+ /// Destructor...
+ virtual ~TAO_EC_Supplier_Filter_Builder (void);
+
+ /**
+ * Create the filter. The consumer is bound to the returned
+ * Supplier_Filter, it must be unbound upon destruction and/or
+ * disconnection.
+ */
+ virtual TAO_EC_Supplier_Filter*
+ create (RtecEventChannelAdmin::SupplierQOS& qos) = 0;
+
+ /// The user is returning the filter for destruction/recycling.
+ virtual void
+ destroy (TAO_EC_Supplier_Filter *filter) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_FILTER_BUILDER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.cpp
new file mode 100644
index 00000000000..1b06a04dca7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.cpp
@@ -0,0 +1,198 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_TPC_Dispatching.h"
+#include "orbsvcs/Event/EC_Defaults.h"
+
+#include <ace/Dynamic_Service.h>
+
+ACE_RCSID(Event, EC_TPC_Dispatching, "$Id$")
+
+#if !defined(TAO_EC_TPC_DISPATCHING_DEFAULT_MAP_SIZE)
+#define TAO_EC_TPC_DISPATCHING_DEFAULT_MAP_SIZE 32
+#endif
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+extern unsigned long EC_TPC_debug_level;
+
+TAO_EC_TPC_Dispatching::TAO_EC_TPC_Dispatching (TAO_EC_Queue_Full_Service_Object* so)
+ : consumer_task_map_(TAO_EC_TPC_DISPATCHING_DEFAULT_MAP_SIZE)
+ , queue_full_service_object_(so)
+{
+ ACE_ASSERT (this->queue_full_service_object_ != 0);
+}
+
+TAO_EC_TPC_Dispatching::~TAO_EC_TPC_Dispatching ()
+{
+ // No other dispatching strategy has a DTOR body. I can only
+ // assume that it's guaranteed that shutdown() is called before
+ // the DTOR, so the tear-down logic needs to go in the shutdown,
+ // and the DTOR need not call shutdown.
+}
+
+int
+TAO_EC_TPC_Dispatching::add_consumer (RtecEventComm::PushConsumer_ptr consumer
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1);
+
+ // Duplicate the pointer and hold it safely
+ RtecEventComm::PushConsumer_var pc =
+ RtecEventComm::PushConsumer::_duplicate(consumer);
+
+ if (EC_TPC_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "EC (%P|%t) TPC_Dispatching::add_consumer(%@)\n", pc.in()));
+
+ TAO_EC_Dispatching_Task* dtask =
+ new TAO_EC_TPC_Dispatching_Task (&this->thread_manager_,
+ this->queue_full_service_object_);
+
+ if (EC_TPC_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "EC (%P|%t) TPC_Dispatching::add_consumer(%@): new task %@\n", pc.in(), dtask));
+
+ if ((dtask->activate (TAO_EC_DEFAULT_DISPATCHING_THREADS_FLAGS,
+ 1, // we only want one thread to dispatch to a consumer
+ 1, // magic number??
+ TAO_EC_DEFAULT_DISPATCHING_THREADS_PRIORITY)) == -1)
+ {
+ ACE_DEBUG ((LM_WARNING,
+ "EC (%P|%t): TPC_Dispatching::add_consumer unable to activate"
+ " dispatching task for consumer (%@)\n",
+ consumer));
+ delete dtask;
+ return -1;
+ }
+
+ int bindresult =
+ this->consumer_task_map_.bind (RtecEventComm::PushConsumer::_duplicate(pc.in()),
+ dtask);
+ const char* explanation = 0;
+ if (bindresult == -1)
+ explanation = "general failure";
+ else if (bindresult == 1)
+ explanation = "entry already exists";
+
+ if (explanation != 0)
+ {
+ ACE_DEBUG ((LM_WARNING,
+ "EC (%P|%t): TPC_Dispatching::add_consumer failed to bind consumer (%@)"
+ " and dispatch task in map (%s): %p\n",
+ consumer, explanation));
+ dtask->putq (new TAO_EC_Shutdown_Task_Command);
+ dtask->wait ();
+ delete dtask;
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_EC_TPC_Dispatching::remove_consumer (RtecEventComm::PushConsumer_ptr consumer
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1);
+
+ TAO_EC_Dispatching_Task* dtask = 0;
+
+ if (this->consumer_task_map_.find (consumer, dtask) == -1)
+ {
+ ACE_DEBUG ((LM_WARNING,
+ "EC (%P|%t): TPC_Dispatching::remove_consumer failed to"
+ " find consumer (%@) in map\n", consumer));
+ return -1;
+ }
+
+ // Must have found it...first try to unbind
+ if (this->consumer_task_map_.unbind (consumer) == -1)
+ {
+ ACE_DEBUG ((LM_WARNING,
+ "EC (%P|%t): TPC_Dispatching::remove_consumer failed to"
+ " unbind consumer (%@) and task in map\n", consumer));
+ return -1;
+ }
+
+ dtask->putq (new TAO_EC_Shutdown_Task_Command);
+ CORBA::release (consumer); // This matches the _duplicate in add_consumer
+ return 0;
+}
+
+void
+TAO_EC_TPC_Dispatching::activate (void)
+{
+}
+
+void
+TAO_EC_TPC_Dispatching::shutdown (void)
+{
+ ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ // The MT_Dispatching strategy sends a TAO_EC_Shutdown_Task_Command
+ // to the dispatching task. Is that what we should do here?
+ MAPTYPE::ITERATOR iter = this->consumer_task_map_.begin ();
+ while (! iter.done())
+ {
+ MAPTYPE::ENTRY* entry = 0;
+ if (! iter.next(entry))
+ continue;
+
+ entry->int_id_->putq (new TAO_EC_Shutdown_Task_Command);
+ iter.advance ();
+ }
+
+ this->thread_manager_.wait (); // Wait for the threads to terminate
+
+ // Now iterate again and call CORBA::release on the ext_id;
+ // we don't have to delete int_id_ b/c that happens in its close() method.
+ iter = this->consumer_task_map_.begin ();
+ while (! iter.done())
+ {
+ MAPTYPE::ENTRY* entry = 0;
+ if (! iter.next(entry))
+ continue;
+
+ CORBA::release (entry->ext_id_);
+ iter.advance ();
+ }
+
+ this->consumer_task_map_.unbind_all ();
+}
+
+void
+TAO_EC_TPC_Dispatching::push (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventComm::EventSet event_copy = event;
+ this->push_nocopy (proxy, consumer, event_copy, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_TPC_Dispatching::push_nocopy (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info&
+ ACE_ENV_ARG_DECL)
+{
+ if (EC_TPC_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "EC (%P|%t) TPC_Dispatching::push_nocopy(supplier=%@,consumer=%@)\n", proxy, consumer));
+
+ ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->lock_);
+ TAO_EC_Dispatching_Task* dtask;
+
+ if (this->consumer_task_map_.find (consumer, dtask) == -1)
+ {
+ ACE_DEBUG ((LM_WARNING,
+ "EC (%P|%t): TPC_Dispatching::push_nocopy failed to"
+ " find consumer (%@) in map\n", consumer));
+ }
+ else
+ {
+ dtask->push (proxy, consumer, event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.h b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.h
new file mode 100644
index 00000000000..b8c7ea49cd3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching.h
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_TPC_Dispatching.h
+ *
+ * $Id$
+ *
+ * @author Chris Cleeland <cleeland at ociweb.com>
+ *
+ */
+
+#ifndef TAO_EC_TPC_DISPATCHING_H
+#define TAO_EC_TPC_DISPATCHING_H
+#include /**/ "ace/pre.h"
+
+#include "ace/Hash_Map_Manager_T.h"
+#include "ace/Null_Mutex.h"
+
+#include "orbsvcs/Event/EC_Dispatching.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/EC_TPC_Dispatching_Task.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Event_Channel_Base;
+
+/**
+ * @class TAO_EC_TPC_Dispatching
+ *
+ * @brief Dispatching strategy that isolates deliveries to a consumer from any other.
+ *
+ * This strategy uses a thread per consumer, and was specifically designed to
+ * isolate the effects of an ill-behaved consumer from affecting other consumers.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_TPC_Dispatching : public TAO_EC_Dispatching
+{
+public:
+ TAO_EC_TPC_Dispatching (TAO_EC_Queue_Full_Service_Object* so);
+ ~TAO_EC_TPC_Dispatching ();
+
+ // = The EC_Dispatching methods.
+ virtual void activate (void);
+ virtual void shutdown (void);
+ virtual void push (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (TAO_EC_ProxyPushSupplier* proxy,
+ RtecEventComm::PushConsumer_ptr consumer,
+ RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+
+ int add_consumer (RtecEventComm::PushConsumer_ptr consumer ACE_ENV_ARG_DECL);
+ int remove_consumer (RtecEventComm::PushConsumer_ptr consumer ACE_ENV_ARG_DECL);
+
+private:
+ // Use our own thread manager
+ ACE_Thread_Manager thread_manager_;
+
+ typedef ACE_Hash_Map_Manager_Ex<RtecEventComm::PushConsumer_ptr,TAO_EC_Dispatching_Task*,ACE_Pointer_Hash<RtecEventComm::PushConsumer_ptr>,ACE_Equal_To<RtecEventComm::PushConsumer_ptr>,ACE_Null_Mutex> MAPTYPE;
+
+ // Tweak the default size of this map by #defining
+ // TAO_EC_TPC_DISPATCHING_DEFAULT_MAP_SIZE
+ MAPTYPE consumer_task_map_;
+
+ // Lock for modifying the map. It's not enough to have a lock only
+ // on the map, because we have to hold the map constant while doing
+ // multiple distinct map manipulations, such as in remove_consumer().
+ ACE_SYNCH_MUTEX lock_;
+
+ // Service object information
+ TAO_EC_Queue_Full_Service_Object* queue_full_service_object_; // @@ who will release?
+ // @@ check to see how the factory gets released...
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_TPC_DISPATCHING_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching_Task.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching_Task.cpp
new file mode 100644
index 00000000000..f70fb6aeac9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching_Task.cpp
@@ -0,0 +1,22 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_TPC_Dispatching_Task.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_TPC_Dispatching_Task::TAO_EC_TPC_Dispatching_Task
+(ACE_Thread_Manager* thr_mgr,
+ TAO_EC_Queue_Full_Service_Object* so)
+ : TAO_EC_Dispatching_Task (thr_mgr, so)
+{
+}
+
+int
+TAO_EC_TPC_Dispatching_Task::close (u_long /* flags */)
+{
+ delete this;
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching_Task.h b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching_Task.h
new file mode 100644
index 00000000000..ff92abce00b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Dispatching_Task.h
@@ -0,0 +1,34 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_TPC_Dispatching_Task.h
+ *
+ * $Id$
+ *
+ * @author Chris Cleeland <cleeland at ociweb.com>
+ */
+
+#ifndef TAO_EC_TPC_DISPATCHING_TASK_H
+#define TAO_EC_TPC_DISPATCHING_TASK_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Dispatching_Task.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_RTEvent_Serv_Export TAO_EC_TPC_Dispatching_Task : public TAO_EC_Dispatching_Task
+{
+public:
+ /// Constructor
+ TAO_EC_TPC_Dispatching_Task (ACE_Thread_Manager* thr_mgr, TAO_EC_Queue_Full_Service_Object* so);
+ virtual int close (u_long flags = 0);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_TPC_DISPATCHING_TASK_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Factory.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Factory.cpp
new file mode 100644
index 00000000000..c8e822ed5b9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Factory.cpp
@@ -0,0 +1,124 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_TPC_Factory.h"
+
+#include "orbsvcs/Event/EC_TPC_Dispatching.h"
+#include "orbsvcs/Event/EC_TPC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_TPC_ProxyConsumer.h"
+
+#include "tao/ORB_Core.h"
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_strings.h"
+
+ACE_RCSID(Event, EC_TPC_Factory, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+unsigned long EC_TPC_debug_level;
+
+TAO_EC_TPC_Factory::TAO_EC_TPC_Factory (void)
+{
+ EC_TPC_debug_level = 0;
+}
+
+TAO_EC_TPC_Factory::~TAO_EC_TPC_Factory (void)
+{
+}
+
+int
+TAO_EC_TPC_Factory::init_svcs (void)
+{
+ TAO_EC_Simple_Queue_Full_Action::init_svcs();
+ return ACE_Service_Config::static_svcs ()->
+ insert (&ace_svc_desc_TAO_EC_TPC_Factory);
+}
+
+int
+TAO_EC_TPC_Factory::init (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::strcasecmp (arg, "-ECDispatching") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ // Here we print out a message indicating that this
+ // option isn't valid with this factory and that it's
+ // being ignored.
+
+ ACE_DEBUG ((LM_ERROR,
+ "EC_TPC_Factory - "
+ "-ECDispatching not supported with TPC_Factory; ignoring the option and using thread-per-consumer dispatch strategy\n"));
+ arg_shifter.consume_arg ();
+ }
+ }
+ if (ACE_OS::strcasecmp (arg, "-ECTPCDebug") == 0)
+ {
+ arg_shifter.consume_arg ();
+ ++EC_TPC_debug_level;
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+
+ }
+
+ return TAO_EC_Default_Factory::init (argc, argv);
+}
+
+// ****************************************************************
+
+TAO_EC_Dispatching*
+TAO_EC_TPC_Factory::create_dispatching (TAO_EC_Event_Channel_Base *)
+{
+ if (EC_TPC_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "EC (%P|%t) EC_TPC_Factory::create_dispatching\n"));
+
+ TAO_EC_Queue_Full_Service_Object* so =
+ this->find_service_object (this->queue_full_service_object_name_.fast_rep(),
+ TAO_EC_DEFAULT_QUEUE_FULL_SERVICE_OBJECT_NAME);
+
+ return new TAO_EC_TPC_Dispatching (so);
+}
+
+
+TAO_EC_ProxyPushSupplier*
+TAO_EC_TPC_Factory::create_proxy_push_supplier (TAO_EC_Event_Channel_Base *ec)
+{
+ if (EC_TPC_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "EC (%P|%t) EC_TPC_Factory::create_proxy_push_supplier\n"));
+ return new TAO_EC_TPC_ProxyPushSupplier (ec, this->consumer_validate_connection_);
+}
+
+
+TAO_EC_ProxyPushConsumer*
+TAO_EC_TPC_Factory::create_proxy_push_consumer (TAO_EC_Event_Channel_Base *ec)
+{
+ if (EC_TPC_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "EC (%P|%t) EC_TPC_Factory::create_proxy_push_consumer\n"));
+ return new TAO_EC_TPC_ProxyPushConsumer (ec);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+ACE_STATIC_SVC_DEFINE (TAO_EC_TPC_Factory,
+ ACE_TEXT ("EC_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_EC_TPC_Factory),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
+ACE_FACTORY_DEFINE (TAO_RTEvent_Serv, TAO_EC_TPC_Factory)
+
+// ****************************************************************
+
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Factory.h b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Factory.h
new file mode 100644
index 00000000000..c65e5be61cc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_Factory.h
@@ -0,0 +1,67 @@
+// -*- C++ -*-
+/**
+ * @file EC_TPC_Factory.h
+ *
+ * $Id$
+ *
+ */
+
+#ifndef TAO_EC_TPC_FACTORY_H
+#define TAO_EC_TPC_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_TPC_Factory
+ *
+ * @brief A generic factory for EC experimentation.
+ *
+ * This class allows the user to experiment with different EC
+ * configurations. Using a command-line like interface the user
+ * can specify which strategies will this factory generate.
+ * Since the class can be dynamically loaded the strategies can be
+ * set in the service configurator file.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_TPC_Factory : public TAO_EC_Default_Factory
+{
+public:
+ /// Constructor
+ TAO_EC_TPC_Factory (void);
+
+ /// destructor...
+ virtual ~TAO_EC_TPC_Factory (void);
+
+ /// Helper function to register the default factory into the service
+ /// configurator.
+ static int init_svcs (void);
+
+ // = The Service_Object entry points
+ virtual int init (int argc, char* argv[]);
+
+ // = The EC_Factory methods
+ virtual TAO_EC_Dispatching*
+ create_dispatching (TAO_EC_Event_Channel_Base*);
+
+ virtual TAO_EC_ProxyPushSupplier*
+ create_proxy_push_supplier (TAO_EC_Event_Channel_Base*);
+
+ virtual TAO_EC_ProxyPushConsumer*
+ create_proxy_push_consumer (TAO_EC_Event_Channel_Base*);
+};
+
+extern unsigned long EC_TPC_debug_level;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (TAO_EC_TPC_Factory)
+ACE_FACTORY_DECLARE (TAO_RTEvent_Serv, TAO_EC_TPC_Factory)
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_TPC_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxyConsumer.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxyConsumer.cpp
new file mode 100644
index 00000000000..6a7cc347cb1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxyConsumer.cpp
@@ -0,0 +1,55 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_TPC_ProxyConsumer.h"
+
+ACE_RCSID(Event, EC_TPC_ProxyConsumer, "$Id$")
+
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_TPC_Dispatching.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+extern unsigned long EC_TPC_debug_level;
+
+TAO_EC_TPC_ProxyPushConsumer::TAO_EC_TPC_ProxyPushConsumer (TAO_EC_Event_Channel_Base* ec)
+: TAO_EC_Default_ProxyPushConsumer (ec)
+{
+}
+
+TAO_EC_TPC_Dispatching*
+TAO_EC_TPC_ProxyPushConsumer::tpc_dispatching ()
+{
+ TAO_EC_Dispatching* dispatcher = this->event_channel_->dispatching ();
+ TAO_EC_TPC_Dispatching* tpcdispatcher =
+ dynamic_cast<TAO_EC_TPC_Dispatching*>(dispatcher);
+ return tpcdispatcher;
+}
+
+TAO_EC_TPC_ProxyPushConsumer::~TAO_EC_TPC_ProxyPushConsumer (void)
+{
+ // @@@ Do I need to call the logic to remove the consumer from the
+ // dispatch map in here? I'm not sure... But, if I do, then I need
+ // to fact that "remove" code out of just the
+ // disconnect_push_consumer.
+ if (EC_TPC_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "RTEC (%P|%t): inside ~TAO_EC_TPC_ProxyPushConsumer (%x)\n", this));
+}
+
+void
+TAO_EC_TPC_ProxyPushConsumer::disconnect_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ RtecEventComm::PushConsumer_var emulated_exceptions_suck =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->tpc_dispatching ()->remove_consumer (emulated_exceptions_suck.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ BASECLASS::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxyConsumer.h b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxyConsumer.h
new file mode 100644
index 00000000000..9fb7ff1dc0c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxyConsumer.h
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_TPC_ProxyConsumer.h
+ *
+ * $Id$
+ *
+ * @author Chris Cleeland <cleeland at ociweb.com >
+ *
+ */
+
+#ifndef TAO_EC_TPC_PROXYCONSUMER_H
+#define TAO_EC_TPC_PROXYCONSUMER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Default_ProxyConsumer.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Dispatching;
+class TAO_EC_TPC_Dispatching;
+
+/**
+ * @class TAO_EC_TPC_ProxyPushConsumer
+ *
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_TPC_ProxyPushConsumer :
+ public TAO_EC_Default_ProxyPushConsumer
+{
+public:
+ TAO_EC_TPC_ProxyPushConsumer (TAO_EC_Event_Channel_Base* ec);
+ virtual ~TAO_EC_TPC_ProxyPushConsumer (void);
+
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ typedef TAO_EC_Default_ProxyPushConsumer BASECLASS;
+ TAO_EC_TPC_Dispatching* tpc_dispatching ();
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxySupplier.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxySupplier.cpp
new file mode 100644
index 00000000000..6ead39a342e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxySupplier.cpp
@@ -0,0 +1,76 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_TPC_ProxySupplier.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_TPC_ProxySupplier.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Event, EC_TPC_ProxySupplier, "$Id$")
+
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_TPC_Dispatching.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+extern unsigned long EC_TPC_debug_level;
+
+TAO_EC_TPC_ProxyPushSupplier::~TAO_EC_TPC_ProxyPushSupplier (void)
+{
+
+}
+
+void
+TAO_EC_TPC_ProxyPushSupplier:: disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (EC_TPC_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "EC (%P|%t): enter EC_TPC_ProxySupplier::disconnect_push_supplier (%@): refcount=%u,consumer=%@\n",
+ this,
+ this->refcount_,
+ this->consumer_.in()));
+
+ if (this->is_connected_i ())
+ {
+ this->tpc_dispatching ()->remove_consumer (this->consumer_.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ BASECLASS::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (EC_TPC_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "EC (%P|%t): leave EC_TPC_ProxySupplier::disconnect_push_supplier (%@)\n", this));
+}
+
+TAO_EC_TPC_Dispatching*
+TAO_EC_TPC_ProxyPushSupplier::tpc_dispatching ()
+{
+ TAO_EC_Dispatching* dispatcher = this->event_channel_->dispatching ();
+
+ return dynamic_cast <TAO_EC_TPC_Dispatching*> (dispatcher);
+}
+
+void
+TAO_EC_TPC_ProxyPushSupplier::connect_push_consumer (
+ RtecEventComm::PushConsumer_ptr push_consumer,
+ const RtecEventChannelAdmin::ConsumerQOS& qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecEventChannelAdmin::AlreadyConnected,
+ RtecEventChannelAdmin::TypeError))
+{
+ BASECLASS::connect_push_consumer (push_consumer, qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (EC_TPC_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "EC (%P|%t): EC_ProxySupplier(%@): refcount=%u,consumer=%@\n",
+ this, this->refcount_, this->consumer_.in()));
+
+ TAO_EC_TPC_Dispatching* tpcdispatcher = this->tpc_dispatching ();
+
+ // the new dispatching task gets automatically created
+ tpcdispatcher->add_consumer (push_consumer ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxySupplier.h b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxySupplier.h
new file mode 100644
index 00000000000..345b17c0619
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxySupplier.h
@@ -0,0 +1,64 @@
+// -*- C++ -*-
+/**
+ * @file EC_TPC_ProxySupplier.h
+ *
+ * $Id$
+ *
+ * @author Chris Cleeland <cleeland at ociweb.com>
+ *
+ */
+
+#ifndef TAO_EC_TPC_PROXYSUPPLIER_H
+#define TAO_EC_TPC_PROXYSUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Default_ProxySupplier.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Dispatching;
+class TAO_EC_TPC_Dispatching;
+
+class TAO_RTEvent_Serv_Export TAO_EC_TPC_ProxyPushSupplier :
+ public TAO_EC_Default_ProxyPushSupplier
+{
+public:
+ /// Constructor
+ TAO_EC_TPC_ProxyPushSupplier (TAO_EC_Event_Channel_Base* event_channel, int validate_connection);
+
+ /// Dtor
+ virtual ~TAO_EC_TPC_ProxyPushSupplier (void);
+
+ /*! These are overriden from the base class in order to maintain the
+ map in the dispatcher class. */
+
+ // = The RtecEventChannelAdmin::ProxyPushSupplier methods...
+ virtual void connect_push_consumer (
+ RtecEventComm::PushConsumer_ptr push_consumer,
+ const RtecEventChannelAdmin::ConsumerQOS &qos
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecEventChannelAdmin::AlreadyConnected,
+ RtecEventChannelAdmin::TypeError));
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ typedef TAO_EC_Default_ProxyPushSupplier BASECLASS;
+ TAO_EC_TPC_Dispatching* tpc_dispatching ();
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_TPC_ProxySupplier.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxySupplier.i b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxySupplier.i
new file mode 100644
index 00000000000..6a31a5fc0d1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_TPC_ProxySupplier.i
@@ -0,0 +1,17 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+extern unsigned long EC_TPC_debug_level;
+
+ACE_INLINE
+TAO_EC_TPC_ProxyPushSupplier::TAO_EC_TPC_ProxyPushSupplier (TAO_EC_Event_Channel_Base* ec, int validate_connection)
+: TAO_EC_Default_ProxyPushSupplier (ec, validate_connection)
+{
+ if (EC_TPC_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) EC_TPC_ProxyPushSupplier::CTOR (%@)\n", this));
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Filter.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Filter.cpp
new file mode 100644
index 00000000000..3b479983a13
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Filter.cpp
@@ -0,0 +1,171 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Timeout_Filter.h"
+#include "orbsvcs/Event/EC_Timeout_Generator.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Event_Service_Constants.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Timeout_Filter.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Event,
+ EC_Timeout_Filter,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Timeout_Filter::TAO_EC_Timeout_Filter (
+ TAO_EC_Event_Channel_Base *event_channel,
+ TAO_EC_ProxyPushSupplier *supplier,
+ const TAO_EC_QOS_Info& qos_info,
+ RtecEventComm::EventType type,
+ RtecEventComm::Time period)
+ : event_channel_ (event_channel),
+ supplier_ (supplier),
+ qos_info_ (qos_info),
+ type_ (type),
+ period_ (period),
+ id_ (-1)
+{
+ ACE_Time_Value tv_delta;
+ ORBSVCS_Time::TimeT_to_Time_Value (tv_delta, period);
+
+ TAO_EC_Timeout_Generator *tg =
+ this->event_channel_->timeout_generator ();
+
+ if (this->type_ == ACE_ES_EVENT_INTERVAL_TIMEOUT
+ || this->type_ == ACE_ES_EVENT_DEADLINE_TIMEOUT)
+ {
+ ACE_Time_Value tv_interval;
+ ORBSVCS_Time::TimeT_to_Time_Value (tv_interval, this->period_);
+
+ this->id_ =
+ tg->schedule_timer (this,
+ tv_delta,
+ tv_interval);
+ }
+ else
+ {
+ this->id_ =
+ tg->schedule_timer (this,
+ tv_delta,
+ ACE_Time_Value::zero);
+ }
+
+ // ACE_DEBUG ((LM_DEBUG,
+ // "EC_Timeout_Filter - interval = %d:%d, ID = %d\n",
+ // tv_interval.sec (), tv_interval.usec (),
+ // this->id_));
+}
+
+TAO_EC_Timeout_Filter::~TAO_EC_Timeout_Filter (void)
+{
+ this->event_channel_->timeout_generator ()->cancel_timer (this->qos_info_,
+ this->id_);
+}
+
+void
+TAO_EC_Timeout_Filter::push_to_proxy (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ qos_info.timer_id_ = this->id_;
+
+ if (this->supplier_ != 0)
+ this->supplier_->filter (event,
+ qos_info
+ ACE_ENV_ARG_PARAMETER);
+}
+
+int
+TAO_EC_Timeout_Filter::filter (const RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (qos_info.timer_id_ == this->id_
+ && this->parent () != 0)
+ {
+ this->parent ()->push (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ return 1;
+ }
+ return 0;
+}
+
+int
+TAO_EC_Timeout_Filter::filter_nocopy (RtecEventComm::EventSet &event,
+ TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (qos_info.timer_id_ == this->id_
+ && this->parent () != 0)
+ {
+ this->parent ()->push_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ return 1;
+ }
+ return 0;
+}
+
+void
+TAO_EC_Timeout_Filter::push (const RtecEventComm::EventSet&,
+ TAO_EC_QOS_Info&
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_Timeout_Filter::push_nocopy (RtecEventComm::EventSet&,
+ TAO_EC_QOS_Info&
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_Timeout_Filter::clear (void)
+{
+ if (this->type_ == ACE_ES_EVENT_DEADLINE_TIMEOUT)
+ {
+ TAO_EC_Timeout_Generator *tg =
+ this->event_channel_->timeout_generator ();
+
+ tg->cancel_timer (this->qos_info_,
+ this->id_);
+
+ ACE_Time_Value tv_interval;
+ ORBSVCS_Time::TimeT_to_Time_Value (tv_interval, this->period_);
+ ACE_Time_Value tv_delta = tv_interval;
+
+ this->id_ =
+ tg->schedule_timer (this,
+ tv_delta,
+ tv_interval);
+ }
+}
+
+CORBA::ULong
+TAO_EC_Timeout_Filter::max_event_size (void) const
+{
+ return 1;
+}
+
+int
+TAO_EC_Timeout_Filter::can_match (
+ const RtecEventComm::EventHeader&) const
+{
+ return 0;
+}
+
+int
+TAO_EC_Timeout_Filter::add_dependencies (
+ const RtecEventComm::EventHeader&,
+ const TAO_EC_QOS_Info &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Filter.h b/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Filter.h
new file mode 100644
index 00000000000..0658f0b0b46
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Filter.h
@@ -0,0 +1,120 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Timeout_Filter.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_TIMEOUT_FILTER_H
+#define TAO_EC_TIMEOUT_FILTER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Filter.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/EC_QOS_Info.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_Event_Channel_Base;
+class TAO_EC_ProxyPushSupplier;
+
+/**
+ * @class TAO_EC_Timeout_Filter
+ *
+ * @brief A filter based on event type/source
+ *
+ * This filter only accept events with a predefined type/source,
+ * both the source and the type can be wildcards.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Timeout_Filter : public TAO_EC_Filter
+{
+public:
+ /// Constructor.
+ TAO_EC_Timeout_Filter (TAO_EC_Event_Channel_Base *event_channel,
+ TAO_EC_ProxyPushSupplier *supplier,
+ const TAO_EC_QOS_Info& qos_info,
+ RtecEventComm::EventType type,
+ RtecEventComm::Time period);
+
+ /// Destructor.
+ virtual ~TAO_EC_Timeout_Filter (void);
+
+ /// Return the QOS_Info for this Timeout filter.
+ const TAO_EC_QOS_Info& qos_info (void) const;
+
+ /// The type of timeout event that we generate.
+ RtecEventComm::EventType type (void) const;
+
+ /// Callback from the Timeout_Generator
+ void push_to_proxy (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+
+ // = The TAO_EC_Filter methods, please check the documentation in
+ // TAO_EC_Filter.
+ virtual int filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual int filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void clear (void);
+ virtual CORBA::ULong max_event_size (void) const;
+ virtual int can_match (const RtecEventComm::EventHeader& header) const;
+ virtual int add_dependencies (const RtecEventComm::EventHeader& header,
+ const TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_Timeout_Filter (const TAO_EC_Timeout_Filter&);
+ TAO_EC_Timeout_Filter& operator= (const TAO_EC_Timeout_Filter&);
+
+private:
+ /// The event channel.
+ TAO_EC_Event_Channel_Base* event_channel_;
+
+ /// The supplier that finally receives the timeout event.
+ TAO_EC_ProxyPushSupplier *supplier_;
+
+ /// Events "generated" by this filter use this QOS_Info.
+ TAO_EC_QOS_Info qos_info_;
+
+ /// The type of timeout event...
+ RtecEventComm::EventType type_;
+
+ /// The period for deadline timeouts...
+ RtecEventComm::Time period_;
+
+ /// The ID of the timeout in the Timeout_Generator, for
+ /// cancellation.
+ long id_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Timeout_Filter.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_TIMEOUT_FILTER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Filter.i b/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Filter.i
new file mode 100644
index 00000000000..a6e30773801
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Filter.i
@@ -0,0 +1,19 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE const TAO_EC_QOS_Info&
+TAO_EC_Timeout_Filter::qos_info (void) const
+{
+ return this->qos_info_;
+}
+
+ACE_INLINE RtecEventComm::EventType
+TAO_EC_Timeout_Filter::type (void) const
+{
+ return this->type_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Generator.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Generator.cpp
new file mode 100644
index 00000000000..23d098ceba6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Generator.cpp
@@ -0,0 +1,61 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Timeout_Generator.h"
+#include "orbsvcs/Event/EC_Timeout_Filter.h"
+#include "orbsvcs/Event_Service_Constants.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Timeout_Generator.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Event,
+ EC_Timeout_Generator,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Timeout_Generator::~TAO_EC_Timeout_Generator (void)
+{
+}
+
+// ****************************************************************
+
+int
+TAO_EC_Timeout_Adapter::handle_timeout (const ACE_Time_Value & /* tv */,
+ const void *vp)
+{
+ // ACE_DEBUG ((LM_DEBUG,
+ // "TAO_EC_Timeout_Adapter::handle_timeout -"
+ // " expire at %d:%d\n",
+ // tv.sec (), tv.usec ()));
+
+ TAO_EC_Timeout_Filter *filter =
+ static_cast<TAO_EC_Timeout_Filter*> (const_cast<void*> (vp));
+
+ if (filter == 0)
+ return 0;
+
+ ACE_TRY_NEW_ENV
+ {
+ RtecEventComm::Event e;
+ e.header.type = filter->type ();
+ e.header.source = 0;
+
+ RtecEventComm::EventSet single_event (1, 1, &e, 0);
+
+ TAO_EC_QOS_Info qos_info = filter->qos_info ();
+ filter->push_to_proxy (single_event,
+ qos_info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Generator.h b/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Generator.h
new file mode 100644
index 00000000000..44a6642de69
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Generator.h
@@ -0,0 +1,101 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Timeout_Generator.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_TIMEOUT_GENERATOR_H
+#define TAO_EC_TIMEOUT_GENERATOR_H
+
+#include /**/ "ace/pre.h"
+#include "ace/Event_Handler.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#include "orbsvcs/Event/EC_Timeout_Filter.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EC_QOS_Info;
+
+/**
+ * @class TAO_EC_Timeout_Generator
+ *
+ * @brief Define the interface for the generators of timeout events.
+ *
+ * The Event Channel can use several strategies to dispatch
+ * timers, for instance, it can use the ORB reactor or a pool of
+ * reactors running at different priorities or a pool of
+ * Thread_Timer_Queue_Adapters running at different priorities
+ * also.
+ * This class is the abstract base class to abstract this
+ * strategies.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Timeout_Generator
+{
+public:
+ /// destructor
+ virtual ~TAO_EC_Timeout_Generator (void);
+
+ /// Activate any internal threads.
+ virtual void activate (void) = 0;
+
+ /// Deactivate any internal threads, clients can destroy the object
+ /// after calling this method.
+ virtual void shutdown (void) = 0;
+
+ /// Add a timer at the given priority, returns the timer ID.
+ virtual int schedule_timer (TAO_EC_Timeout_Filter* filter,
+ const ACE_Time_Value& delta,
+ const ACE_Time_Value& interval) = 0;
+
+ /// Cancel a timer at the given priority.
+ virtual int cancel_timer (const TAO_EC_QOS_Info& info,
+ int id) = 0;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_EC_Timeout_Adapter
+ *
+ * @brief Adapt the EC_Filter interface as an Event_Handler.
+ *
+ * ACE timer queues (including the reactor) use Event_Handlers to
+ * dispatch events, but we want to receive them in EC_Filters,
+ * this class is and adaptor for that purpose.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Timeout_Adapter : public ACE_Event_Handler
+{
+public:
+ /// Default construction.
+ TAO_EC_Timeout_Adapter (void);
+
+private:
+ /// Casts <act> to EC_Filter and dispatches an event to it.
+ virtual int handle_timeout (const ACE_Time_Value &tv,
+ const void *act);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event/EC_Timeout_Generator.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_TIMEOUT_GENERATOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Generator.i b/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Generator.i
new file mode 100644
index 00000000000..aba1263d609
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Timeout_Generator.i
@@ -0,0 +1,12 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_EC_Timeout_Adapter::TAO_EC_Timeout_Adapter (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Trivial_Supplier_Filter.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Trivial_Supplier_Filter.cpp
new file mode 100644
index 00000000000..c5d3dc1b72c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Trivial_Supplier_Filter.cpp
@@ -0,0 +1,112 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Trivial_Supplier_Filter.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_ConsumerAdmin.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_QOS_Info.h"
+#include "orbsvcs/Event/EC_Scheduling_Strategy.h"
+#include "orbsvcs/Event/EC_ProxyConsumer.h" // @@ MSVC 6 bug
+
+ACE_RCSID(Event, EC_Trivial_Supplier_Filter, "$Id$")
+
+// ****************************************************************
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Trivial_Supplier_Filter::
+ TAO_EC_Trivial_Supplier_Filter (TAO_EC_Event_Channel_Base* ec)
+ : event_channel_ (ec)
+{
+}
+
+void
+TAO_EC_Trivial_Supplier_Filter::bind (TAO_EC_ProxyPushConsumer*)
+{
+}
+
+void
+TAO_EC_Trivial_Supplier_Filter::unbind (TAO_EC_ProxyPushConsumer*)
+{
+}
+
+void
+TAO_EC_Trivial_Supplier_Filter::connected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_Trivial_Supplier_Filter::reconnected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_Trivial_Supplier_Filter::disconnected (TAO_EC_ProxyPushSupplier*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_Trivial_Supplier_Filter::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_EC_Trivial_Supplier_Filter::push (const RtecEventComm::EventSet& event,
+ TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EC_Scheduling_Strategy* scheduling_strategy =
+ this->event_channel_->scheduling_strategy ();
+ scheduling_strategy->schedule_event (event,
+ consumer,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Trivial_Supplier_Filter::push_scheduled_event (RtecEventComm::EventSet &event,
+ const TAO_EC_QOS_Info &event_info
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EC_Filter_Worker worker (event, event_info);
+ this->event_channel_->for_each_consumer (&worker
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ULong
+TAO_EC_Trivial_Supplier_Filter::_incr_refcnt (void)
+{
+ return 1;
+}
+
+CORBA::ULong
+TAO_EC_Trivial_Supplier_Filter::_decr_refcnt (void)
+{
+ return 1;
+}
+
+// ****************************************************************
+
+TAO_EC_Trivial_Supplier_Filter_Builder::
+ TAO_EC_Trivial_Supplier_Filter_Builder (TAO_EC_Event_Channel_Base *ec)
+ : filter_ (ec)
+{
+}
+
+TAO_EC_Supplier_Filter*
+TAO_EC_Trivial_Supplier_Filter_Builder::create (
+ RtecEventChannelAdmin::SupplierQOS&)
+{
+ return &this->filter_;
+}
+
+void
+TAO_EC_Trivial_Supplier_Filter_Builder::destroy (
+ TAO_EC_Supplier_Filter*)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Trivial_Supplier_Filter.h b/TAO/orbsvcs/orbsvcs/Event/EC_Trivial_Supplier_Filter.h
new file mode 100644
index 00000000000..617bd87f6d7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Trivial_Supplier_Filter.h
@@ -0,0 +1,109 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Trivial_Supplier_Filter.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_TRIVIAL_SUPPLIER_FILTER_H
+#define TAO_EC_TRIVIAL_SUPPLIER_FILTER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Supplier_Filter.h"
+#include "orbsvcs/Event/EC_Supplier_Filter_Builder.h"
+
+#include /**/ "orbsvcs/Event/event_serv_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_Base;
+class TAO_EC_ProxyPushSupplier_Set;
+
+// ****************************************************************
+
+/**
+ * @class TAO_EC_Trivial_Supplier_Filter
+ *
+ * @brief A null filtering strategy.
+ *
+ * This strategy does no filtering, it is useful for backends of
+ * the CosEventChannel, testing and broadcasters; it uses the
+ * ConsumerAdmin to find all the consumers and pushes the event to
+ * all of them.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Trivial_Supplier_Filter : public TAO_EC_Supplier_Filter
+{
+public:
+ /// Constructor
+ TAO_EC_Trivial_Supplier_Filter (TAO_EC_Event_Channel_Base* ec);
+
+ // = The TAO_EC_Supplier_Filter methods.
+ virtual void bind (TAO_EC_ProxyPushConsumer* consumer);
+ virtual void unbind (TAO_EC_ProxyPushConsumer* consumer);
+ virtual void connected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL);
+ virtual void reconnected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL);
+ virtual void disconnected (TAO_EC_ProxyPushSupplier* supplier
+ ACE_ENV_ARG_DECL);
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void push (const RtecEventComm::EventSet& event,
+ TAO_EC_ProxyPushConsumer *consumer
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void push_scheduled_event (RtecEventComm::EventSet &event,
+ const TAO_EC_QOS_Info &event_info
+ ACE_ENV_ARG_DECL);
+ virtual CORBA::ULong _decr_refcnt (void);
+ virtual CORBA::ULong _incr_refcnt (void);
+
+private:
+ /// The event channel, used to locate the set of consumers.
+ TAO_EC_Event_Channel_Base *event_channel_;
+};
+
+// ****************************************************************
+
+/**
+ * @class TAO_EC_Trivial_Supplier_Filter_Builder
+ *
+ * @brief Create a single Trivial_Supplier_Filter.
+ *
+ * This Factory creates a single Trivial_Supplier_Filter that is
+ * used by all the suppliers (i.e. ProxyConsumers) of an event
+ * channel.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Trivial_Supplier_Filter_Builder : public TAO_EC_Supplier_Filter_Builder
+{
+public:
+ /// constructor....
+ TAO_EC_Trivial_Supplier_Filter_Builder (TAO_EC_Event_Channel_Base* ec);
+
+ // = The TAO_EC_Supplier_Filter_Builder methods...
+ virtual TAO_EC_Supplier_Filter*
+ create (RtecEventChannelAdmin::SupplierQOS& qos);
+ virtual void
+ destroy (TAO_EC_Supplier_Filter *filter);
+
+private:
+ /// The filter....
+ TAO_EC_Trivial_Supplier_Filter filter_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_EC_TRIVIAL_SUPPLIER_FILTER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Type_Filter.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Type_Filter.cpp
new file mode 100644
index 00000000000..d52f1d869aa
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Type_Filter.cpp
@@ -0,0 +1,150 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Type_Filter.h"
+
+ACE_RCSID(Event, EC_Type_Filter, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Type_Filter::TAO_EC_Type_Filter (const RtecEventComm::EventHeader& header)
+ : header_ (header)
+{
+}
+
+int
+TAO_EC_Type_Filter::filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (event.length () != 1)
+ return this->filter_set (event, qos_info ACE_ENV_ARG_PARAMETER);
+
+ if (this->can_match (event[0].header))
+ {
+ this->push (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ return 1;
+ }
+ return 0;
+}
+
+int
+TAO_EC_Type_Filter::filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (event.length () != 1)
+ return this->filter_set (event, qos_info ACE_ENV_ARG_PARAMETER);
+
+ if (this->can_match (event[0].header))
+ {
+ this->push_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ return 1;
+ }
+ return 0;
+}
+
+void
+TAO_EC_Type_Filter::push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (this->parent () != 0)
+ this->parent ()->push (event, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Type_Filter::push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ if (this->parent () != 0)
+ this->parent ()->push_nocopy (event, qos_info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EC_Type_Filter::clear (void)
+{
+}
+
+CORBA::ULong
+TAO_EC_Type_Filter::max_event_size (void) const
+{
+ return 1;
+}
+
+int
+TAO_EC_Type_Filter::can_match (
+ const RtecEventComm::EventHeader& header) const
+{
+ if (this->header_.source == 0)
+ {
+ if (this->header_.type == 0 || header.type == 0)
+ return 1;
+ else
+ return this->header_.type == header.type;
+ }
+
+ if (this->header_.type == 0)
+ {
+ if (header.source == 0)
+ return 1;
+ else
+ return this->header_.source == header.source;
+ }
+
+ if (header.source == 0)
+ {
+ if (header.type != 0)
+ return this->header_.type == header.type;
+ return 1;
+ }
+
+ if (header.type == 0)
+ {
+ return this->header_.source == header.source;
+ }
+
+ return (this->header_.type == header.type
+ && this->header_.source == header.source);
+}
+
+int
+TAO_EC_Type_Filter::add_dependencies (
+ const RtecEventComm::EventHeader& header,
+ const TAO_EC_QOS_Info &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return this->can_match (header);
+}
+
+int
+TAO_EC_Type_Filter::filter_set (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::ULong maximum = event.length ();
+ if (event.maximum () == 0)
+ return 0;
+
+ RtecEventComm::EventSet matched (maximum);
+ CORBA::ULong next_slot = 0;
+ for (CORBA::ULong i = 0; i != maximum; ++i)
+ {
+ if (!this->can_match (event[i].header))
+ continue;
+ matched.length (next_slot + 1);
+ matched[next_slot] = event[i];
+ next_slot++;
+ }
+ if (matched.length () == 0)
+ return 0;
+
+ this->push (matched, qos_info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Type_Filter.h b/TAO/orbsvcs/orbsvcs/Event/EC_Type_Filter.h
new file mode 100644
index 00000000000..12a0660bf72
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Type_Filter.h
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_Type_Filter.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_TYPE_FILTER_H
+#define TAO_EC_TYPE_FILTER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_Filter.h"
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Type_Filter
+ *
+ * @brief A filter based on event type/source
+ *
+ * This filter only accept events with a predefined type/source,
+ * both the source and the type can be wildcards.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Type_Filter : public TAO_EC_Filter
+{
+public:
+ /// Constructor.
+ TAO_EC_Type_Filter (const RtecEventComm::EventHeader& header);
+
+ // = The TAO_EC_Filter methods, please check the documentation in
+ // TAO_EC_Filter.
+ virtual int filter (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual int filter_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void push_nocopy (RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+ virtual void clear (void);
+ virtual CORBA::ULong max_event_size (void) const;
+ virtual int can_match (const RtecEventComm::EventHeader& header) const;
+ virtual int add_dependencies (const RtecEventComm::EventHeader& header,
+ const TAO_EC_QOS_Info &qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ TAO_EC_Type_Filter (const TAO_EC_Type_Filter&);
+ TAO_EC_Type_Filter& operator= (const TAO_EC_Type_Filter&);
+
+ /// Filter an EventSet that contains more than one event.
+ int filter_set (const RtecEventComm::EventSet& event,
+ TAO_EC_QOS_Info& qos_info
+ ACE_ENV_ARG_DECL);
+
+private:
+ /// Encapsulate the type/source that we must match.
+ RtecEventComm::EventHeader header_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_TYPE_FILTER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_UDP_Admin.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_UDP_Admin.cpp
new file mode 100644
index 00000000000..eba83581c8d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_UDP_Admin.cpp
@@ -0,0 +1,30 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_UDP_Admin.h"
+
+ACE_RCSID (Event,
+ EC_UDP_Admin,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EC_Simple_AddrServer::TAO_EC_Simple_AddrServer (CORBA::UShort port)
+ : port_ (port)
+{
+}
+
+TAO_EC_Simple_AddrServer::~TAO_EC_Simple_AddrServer (void)
+{
+}
+
+void
+TAO_EC_Simple_AddrServer::get_addr (const RtecEventComm::EventHeader& header,
+ RtecUDPAdmin::UDP_Addr_out addr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ addr.ipaddr = header.type;
+ addr.port = this->port_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_UDP_Admin.h b/TAO/orbsvcs/orbsvcs/Event/EC_UDP_Admin.h
new file mode 100644
index 00000000000..7e5ccff9920
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_UDP_Admin.h
@@ -0,0 +1,60 @@
+// -*- C++ -*-
+
+/**
+ * @file EC_UDP_Admin.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ *
+ * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and
+ * other members of the DOC group. More details can be found in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/index.html
+ */
+
+#ifndef TAO_EC_UDP_ADMIN_H
+#define TAO_EC_UDP_ADMIN_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecUDPAdminS.h"
+#include /**/ "orbsvcs/Event/event_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EC_Simple_AddrServer
+ *
+ * @brief TAO Real-time Event Service; a simple UDP address server.
+ *
+ * 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.
+ */
+class TAO_RTEvent_Serv_Export TAO_EC_Simple_AddrServer : public POA_RtecUDPAdmin::AddrServer
+{
+public:
+ /// Constructor
+ TAO_EC_Simple_AddrServer (CORBA::UShort port);
+
+ /// Destructor
+ virtual ~TAO_EC_Simple_AddrServer (void);
+
+ // = The RtecUDPAdmin::AddrServer methods
+ virtual void get_addr (const RtecEventComm::EventHeader& header,
+ RtecUDPAdmin::UDP_Addr_out addr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ CORBA::UShort port_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_UDP_ADMIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event/event_export.h b/TAO/orbsvcs/orbsvcs/Event/event_export.h
new file mode 100644
index 00000000000..87a6ddf5a12
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/event_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_RTEVENT_EXPORT_H
+#define TAO_RTEVENT_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_RTEVENT_HAS_DLL)
+# define TAO_RTEVENT_HAS_DLL 0
+# endif /* ! TAO_RTEVENT_HAS_DLL */
+#else
+# if !defined (TAO_RTEVENT_HAS_DLL)
+# define TAO_RTEVENT_HAS_DLL 1
+# endif /* ! TAO_RTEVENT_HAS_DLL */
+#endif
+
+#if defined (TAO_RTEVENT_HAS_DLL) && (TAO_RTEVENT_HAS_DLL == 1)
+# if defined (TAO_RTEVENT_BUILD_DLL)
+# define TAO_RTEvent_Export ACE_Proper_Export_Flag
+# define TAO_RTEVENT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RTEVENT_BUILD_DLL */
+# define TAO_RTEvent_Export ACE_Proper_Import_Flag
+# define TAO_RTEVENT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RTEVENT_BUILD_DLL */
+#else /* TAO_RTEVENT_HAS_DLL == 1 */
+# define TAO_RTEvent_Export
+# define TAO_RTEVENT_SINGLETON_DECLARATION(T)
+# define TAO_RTEVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RTEVENT_HAS_DLL == 1 */
+
+#endif /* TAO_RTEVENT_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Event/event_serv_export.h b/TAO/orbsvcs/orbsvcs/Event/event_serv_export.h
new file mode 100644
index 00000000000..a6f6ba465be
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/event_serv_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_RTEVENT_SERV_EXPORT_H
+#define TAO_RTEVENT_SERV_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_RTEVENT_SERV_HAS_DLL)
+# define TAO_RTEVENT_SERV_HAS_DLL 0
+# endif /* ! TAO_RTEVENT_SERV_HAS_DLL */
+#else
+# if !defined (TAO_RTEVENT_SERV_HAS_DLL)
+# define TAO_RTEVENT_SERV_HAS_DLL 1
+# endif /* ! TAO_RTEVENT_SERV_HAS_DLL */
+#endif
+
+#if defined (TAO_RTEVENT_SERV_HAS_DLL) && (TAO_RTEVENT_SERV_HAS_DLL == 1)
+# if defined (TAO_RTEVENT_SERV_BUILD_DLL)
+# define TAO_RTEvent_Serv_Export ACE_Proper_Export_Flag
+# define TAO_RTEVENT_SERV_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEVENT_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RTEVENT_BUILD_DLL */
+# define TAO_RTEvent_Serv_Export ACE_Proper_Import_Flag
+# define TAO_RTEVENT_SERV_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEVENT_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RTEVENT_SERV_BUILD_DLL */
+#else /* TAO_RTEVENT_SERV_HAS_DLL == 1 */
+# define TAO_RTEvent_Serv_Export
+# define TAO_RTEVENT_SERV_SINGLETON_DECLARATION(T)
+# define TAO_RTEVENT_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RTEVENT_SERV_HAS_DLL == 1 */
+
+#endif /* TAO_RTEVENT_SERV_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Event/event_skel_export.h b/TAO/orbsvcs/orbsvcs/Event/event_skel_export.h
new file mode 100644
index 00000000000..70c88d4289e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/event_skel_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_RTEVENT_SKEL_EXPORT_H
+#define TAO_RTEVENT_SKEL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_RTEVENT_SKEL_HAS_DLL)
+# define TAO_RTEVENT_SKEL_HAS_DLL 0
+# endif /* ! TAO_RTEVENT_SKEL_HAS_DLL */
+#else
+# if !defined (TAO_RTEVENT_SKEL_HAS_DLL)
+# define TAO_RTEVENT_SKEL_HAS_DLL 1
+# endif /* ! TAO_RTEVENT_SKEL_HAS_DLL */
+#endif
+
+#if defined (TAO_RTEVENT_SKEL_HAS_DLL) && (TAO_RTEVENT_SKEL_HAS_DLL == 1)
+# if defined (TAO_RTEVENT_SKEL_BUILD_DLL)
+# define TAO_RTEvent_Skel_Export ACE_Proper_Export_Flag
+# define TAO_RTEVENT_SKEL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEVENT_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RTEVENT_SKEL_BUILD_DLL */
+# define TAO_RTEvent_Skel_Export ACE_Proper_Import_Flag
+# define TAO_RTEVENT_SKEL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEVENT_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RTEVENT_SKEL_BUILD_DLL */
+#else /* TAO_RTEVENT_SKEL_HAS_DLL == 1 */
+# define TAO_RTEvent_Skel_Export
+# define TAO_RTEVENT_SKEL_SINGLETON_DECLARATION(T)
+# define TAO_RTEVENT_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RTEVENT_SKEL_HAS_DLL == 1 */
+
+#endif /* TAO_RTEVENT_SKEL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Event/rtcorba_event_export.h b/TAO/orbsvcs/orbsvcs/Event/rtcorba_event_export.h
new file mode 100644
index 00000000000..e2af98341c2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/rtcorba_event_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_RTCORBAEVENT_EXPORT_H
+#define TAO_RTCORBAEVENT_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_RTCORBAEVENT_HAS_DLL)
+# define TAO_RTCORBAEVENT_HAS_DLL 0
+# endif /* ! TAO_RTCORBAEVENT_HAS_DLL */
+#else
+# if !defined (TAO_RTCORBAEVENT_HAS_DLL)
+# define TAO_RTCORBAEVENT_HAS_DLL 1
+# endif /* ! TAO_RTCORBAEVENT_HAS_DLL */
+#endif
+
+#if defined (TAO_RTCORBAEVENT_HAS_DLL) && (TAO_RTCORBAEVENT_HAS_DLL == 1)
+# if defined (TAO_RTCORBAEVENT_BUILD_DLL)
+# define TAO_RTCORBAEvent_Export ACE_Proper_Export_Flag
+# define TAO_RTCORBAEVENT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTCORBAEVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RTCORBAEVENT_BUILD_DLL */
+# define TAO_RTCORBAEvent_Export ACE_Proper_Import_Flag
+# define TAO_RTCORBAEVENT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTCORBAEVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RTCORBAEVENT_BUILD_DLL */
+#else /* TAO_RTCORBAEVENT_HAS_DLL == 1 */
+# define TAO_RTCORBAEvent_Export
+# define TAO_RTCORBAEVENT_SINGLETON_DECLARATION(T)
+# define TAO_RTCORBAEVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RTCORBAEVENT_HAS_DLL == 1 */
+
+#endif /* TAO_RTCORBAEVENT_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Event/rtkokyu_event_export.h b/TAO/orbsvcs/orbsvcs/Event/rtkokyu_event_export.h
new file mode 100644
index 00000000000..9d56447dabd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/rtkokyu_event_export.h
@@ -0,0 +1,56 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TAO_RTKokyuEvent
+// ------------------------------
+#ifndef TAO_RTKOKYUEVENT_EXPORT_H
+#define TAO_RTKOKYUEVENT_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_RTKOKYUEVENT_HAS_DLL)
+# define TAO_RTKOKYUEVENT_HAS_DLL 0
+# endif /* ! TAO_RTEVENT_HAS_DLL */
+#else
+# if !defined (TAO_RTKOKYUEVENT_HAS_DLL)
+# define TAO_RTKOKYUEVENT_HAS_DLL 1
+# endif /* ! TAO_RTKOKYUEVENT_HAS_DLL */
+#endif
+
+#if defined (TAO_RTKOKYUEVENT_HAS_DLL) && (TAO_RTKOKYUEVENT_HAS_DLL == 1)
+# if defined (TAO_RTKOKYUEVENT_BUILD_DLL)
+# define TAO_RTKokyuEvent_Export ACE_Proper_Export_Flag
+# define TAO_RTKOKYUEVENT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTKOKYUEVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RTKOKYUEVENT_BUILD_DLL */
+# define TAO_RTKokyuEvent_Export ACE_Proper_Import_Flag
+# define TAO_RTKOKYUEVENT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTKOKYUEVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RTKOKYUEVENT_BUILD_DLL */
+#else /* TAO_RTKOKYUEVENT_HAS_DLL == 1 */
+# define TAO_RTKokyuEvent_Export
+# define TAO_RTKOKYUEVENT_SINGLETON_DECLARATION(T)
+# define TAO_RTKOKYUEVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RTKOKYUEVENT_HAS_DLL == 1 */
+
+// Set TAO_RTKOKYUEVENT_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TAO_RTKOKYUEVENT_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TAO_RTKOKYUEVENT_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TAO_RTKOKYUEVENT_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TAO_RTKOKYUEVENT_NTRACE */
+
+#if (TAO_RTKOKYUEVENT_NTRACE == 1)
+# define TAO_RTKOKYUEVENT_TRACE(X)
+#else /* (TAO_RTKOKYUEVENT_NTRACE == 1) */
+# define TAO_RTKOKYUEVENT_TRACE(X) ACE_TRACE_IMPL(X)
+#endif /* (TAO_RTKOKYUEVENT_NTRACE == 1) */
+
+#endif /* TAO_RTKOKYUEVENT_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Event/sched_event_export.h b/TAO/orbsvcs/orbsvcs/Event/sched_event_export.h
new file mode 100644
index 00000000000..b9697e05882
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event/sched_event_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_RTSCHEDEVENT_EXPORT_H
+#define TAO_RTSCHEDEVENT_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_RTSCHEDEVENT_HAS_DLL)
+# define TAO_RTSCHEDEVENT_HAS_DLL 0
+# endif /* ! TAO_RTSCHEDEVENT_HAS_DLL */
+#else
+# if !defined (TAO_RTSCHEDEVENT_HAS_DLL)
+# define TAO_RTSCHEDEVENT_HAS_DLL 1
+# endif /* ! TAO_RTSCHEDEVENT_HAS_DLL */
+#endif
+
+#if defined (TAO_RTSCHEDEVENT_HAS_DLL) && (TAO_RTSCHEDEVENT_HAS_DLL == 1)
+# if defined (TAO_RTSCHEDEVENT_BUILD_DLL)
+# define TAO_RTSchedEvent_Export ACE_Proper_Export_Flag
+# define TAO_RTSCHEDEVENT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTSCHEDEVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RTSCHEDEVENT_BUILD_DLL */
+# define TAO_RTSchedEvent_Export ACE_Proper_Import_Flag
+# define TAO_RTSCHEDEVENT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTSCHEDEVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RTSCHEDEVENT_BUILD_DLL */
+#else /* TAO_RTSCHEDEVENT_HAS_DLL == 1 */
+# define TAO_RTSchedEvent_Export
+# define TAO_RTSCHEDEVENT_SINGLETON_DECLARATION(T)
+# define TAO_RTSCHEDEVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RTSCHEDEVENT_HAS_DLL == 1 */
+
+#endif /* TAO_RTSCHEDEVENT_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Event_Forwarder.idl b/TAO/orbsvcs/orbsvcs/Event_Forwarder.idl
new file mode 100644
index 00000000000..bab9f7611c5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event_Forwarder.idl
@@ -0,0 +1,50 @@
+
+/**
+ * @file Event_Forwarder.idl
+ *
+ * @brief
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef _EVENT_FORWARDER_IDL_
+#define _EVENT_FORWARDER_IDL_
+
+#include "CosNotification.idl"
+#include "CosNotifyChannelAdmin.idl"
+
+#pragma prefix ""
+
+/**
+ * @namespace Event_Forwarder
+ *
+ * @brief
+ */
+module Event_Forwarder
+{
+ interface StructuredProxyPushSupplier : CosNotifyChannelAdmin::StructuredProxyPushSupplier
+ {
+ void forward_structured (in CosNotification::StructuredEvent event);
+
+ void forward_structured_no_filtering (in CosNotification::StructuredEvent event);
+
+ void forward_any (in any event);
+
+ void forward_any_no_filtering (in any event);
+ };
+
+ interface ProxyPushSupplier : CosNotifyChannelAdmin::ProxyPushSupplier
+ {
+ void forward_structured (in CosNotification::StructuredEvent event);
+
+ void forward_structured_no_filtering (in CosNotification::StructuredEvent event);
+
+ void forward_any (in any event);
+
+ void forward_any_no_filtering (in any event);
+ };
+};
+
+#endif /* _EVENT_FORWARDER_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/Event_Service_Constants.h b/TAO/orbsvcs/orbsvcs/Event_Service_Constants.h
new file mode 100644
index 00000000000..6a5e6836feb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event_Service_Constants.h
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+
+//==========================================================================
+/**
+ * @file Event_Service_Constants.h
+ *
+ * $Id$
+ *
+ * Keep constants required by both Event Service implementation and
+ * the Scheduling Service implementation.
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//==========================================================================
+
+#ifndef ACE_ES_CONSTANTS_H
+#define ACE_ES_CONSTANTS_H
+
+#include /**/ "ace/pre.h"
+#include "ace/Message_Block.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Time_Utilities.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// = Predefined event types. All application defined types should be
+// relative to ACE_ES_EVENT_UNDEFINED.
+const long ACE_ES_EVENT_ANY = 0;
+const long ACE_ES_EVENT_SHUTDOWN = 1;
+const long ACE_ES_EVENT_ACT = 2;
+const long ACE_ES_EVENT_NOTIFICATION = 3;
+const long ACE_ES_EVENT_TIMEOUT = 4;
+const long ACE_ES_EVENT_INTERVAL_TIMEOUT = 5;
+const long ACE_ES_EVENT_DEADLINE_TIMEOUT = 6;
+const long ACE_ES_GLOBAL_DESIGNATOR = 7;
+const long ACE_ES_CONJUNCTION_DESIGNATOR = 8;
+const long ACE_ES_DISJUNCTION_DESIGNATOR = 9;
+const long ACE_ES_NEGATION_DESIGNATOR = 10;
+const long ACE_ES_LOGICAL_AND_DESIGNATOR = 11;
+const long ACE_ES_BITMASK_DESIGNATOR = 12;
+const long ACE_ES_MASKED_TYPE_DESIGNATOR = 13;
+const long ACE_ES_NULL_DESIGNATOR = 14;
+const long ACE_ES_EVENT_UNDEFINED = 16;
+
+/// Predefined event sources.
+const long ACE_ES_EVENT_SOURCE_ANY = 0;
+
+/// The max number of priorities provided by the target platform.
+/// @todo This should be defined in ACE (somehow) and only mapped here
+/// to some variables (and even that is doubtful).
+const long ACE_Scheduler_MAX_PRIORITIES = 5;
+
+const TimeBase::TimeT ACE_Scheduler_Rates[ACE_Scheduler_MAX_PRIORITIES] = {
+ 250000, // 40 Hz
+ 500000, // 20 Hz
+ 1000000, // 10 Hz
+ 2000000, // 5 Hz
+ 10000000 // 1 Hz
+};
+
+/// The minimum preemption priority.
+const long ACE_Scheduler_MIN_PREEMPTION_PRIORITY =
+ ACE_Scheduler_MAX_PRIORITIES - 1;
+
+/// Max preemption priority.
+const long ACE_Scheduler_MAX_PREEMPTION_PRIORITY = 0;
+
+/// This is the maximum sub priority.
+const u_long ACE_Scheduler_MAX_SUB_PRIORITY =
+ ACE_Message_Block::MB_USER - 1;
+
+/// This is the minimum sub priority.
+const u_long ACE_Scheduler_MIN_SUB_PRIORITY =
+ ACE_Message_Block::MB_NORMAL;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* ACE_ES_CONSTANTS_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event_Utilities.cpp b/TAO/orbsvcs/orbsvcs/Event_Utilities.cpp
new file mode 100644
index 00000000000..4c66ec5087d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event_Utilities.cpp
@@ -0,0 +1,221 @@
+// $Id$
+
+#include "orbsvcs/Event_Utilities.h"
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/Event_Utilities.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (orbsvcs,
+ Event_Utilities,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_ConsumerQOS_Factory::
+ ACE_ConsumerQOS_Factory (TAO_EC_Event_Initializer initializer)
+ : designator_set_ (0),
+ event_initializer_ (initializer)
+{
+ qos_.is_gateway = 0;
+}
+
+ACE_ConsumerQOS_Factory::~ACE_ConsumerQOS_Factory (void)
+{
+}
+
+int
+ACE_ConsumerQOS_Factory::start_conjunction_group (int nchildren)
+{
+ int l = qos_.dependencies.length ();
+ qos_.dependencies.length (l + 1);
+ if (this->event_initializer_ != 0)
+ (*this->event_initializer_) (qos_.dependencies[l].event);
+ qos_.dependencies[l].event.header.type = ACE_ES_CONJUNCTION_DESIGNATOR;
+ qos_.dependencies[l].event.header.source = nchildren;
+ qos_.dependencies[l].rt_info = 0;
+ this->designator_set_ = 1;
+ return 0;
+}
+
+int
+ACE_ConsumerQOS_Factory::start_disjunction_group (int nchildren)
+{
+ int l = qos_.dependencies.length ();
+ qos_.dependencies.length (l + 1);
+ if (this->event_initializer_ != 0)
+ (*this->event_initializer_) (qos_.dependencies[l].event);
+ qos_.dependencies[l].event.header.type = ACE_ES_DISJUNCTION_DESIGNATOR;
+ qos_.dependencies[l].event.header.source = nchildren;
+ qos_.dependencies[l].rt_info = 0;
+ this->designator_set_ = 1;
+ return 0;
+}
+
+int
+ACE_ConsumerQOS_Factory::start_logical_and_group (int nchildren)
+{
+ int l = qos_.dependencies.length ();
+ qos_.dependencies.length (l + 1);
+ if (this->event_initializer_ != 0)
+ (*this->event_initializer_) (qos_.dependencies[l].event);
+ qos_.dependencies[l].event.header.type = ACE_ES_LOGICAL_AND_DESIGNATOR;
+ qos_.dependencies[l].event.header.source = nchildren;
+ qos_.dependencies[l].rt_info = 0;
+ this->designator_set_ = 1;
+ return 0;
+}
+
+int
+ACE_ConsumerQOS_Factory::start_negation (void)
+{
+ int l = qos_.dependencies.length ();
+ qos_.dependencies.length (l + 1);
+ if (this->event_initializer_ != 0)
+ (*this->event_initializer_) (qos_.dependencies[l].event);
+ qos_.dependencies[l].event.header.type = ACE_ES_NEGATION_DESIGNATOR;
+ qos_.dependencies[l].rt_info = 0;
+ this->designator_set_ = 1;
+ return 0;
+}
+
+int
+ACE_ConsumerQOS_Factory::start_bitmask (CORBA::ULong source_mask,
+ CORBA::ULong type_mask)
+{
+ int l = qos_.dependencies.length ();
+ qos_.dependencies.length (l + 2);
+ if (this->event_initializer_ != 0)
+ {
+ (*this->event_initializer_) (qos_.dependencies[l].event);
+ (*this->event_initializer_) (qos_.dependencies[l + 1].event);
+ }
+ qos_.dependencies[l].event.header.type = ACE_ES_BITMASK_DESIGNATOR;
+ qos_.dependencies[l].rt_info = 0;
+
+ qos_.dependencies[l+1].event.header.source = source_mask;
+ qos_.dependencies[l+1].event.header.type = type_mask;
+ qos_.dependencies[l+1].rt_info = 0;
+
+ this->designator_set_ = 1;
+ return 0;
+}
+
+int
+ACE_ConsumerQOS_Factory::insert (const RtecEventChannelAdmin::Dependency &subscribe)
+{
+ // Make sure that a designator is first.
+ if (designator_set_ == 0)
+ {
+ int l = qos_.dependencies.length ();
+ qos_.dependencies.length (l + 1);
+ if (this->event_initializer_ != 0)
+ (*this->event_initializer_) (qos_.dependencies[l].event);
+ qos_.dependencies[l].rt_info = 0;
+ qos_.dependencies[l].event.header.type = ACE_ES_GLOBAL_DESIGNATOR;
+
+ this->designator_set_ = 1;
+ }
+
+ int l = qos_.dependencies.length ();
+ qos_.dependencies.length (l + 1);
+ qos_.dependencies[l] = subscribe;
+ return 0;
+}
+
+void event_debug (const char* p,
+ const RtecEventComm::Event& event)
+{
+ size_t l = ACE_OS::strlen (p);
+ ACE_DEBUG ((LM_DEBUG,
+ "%*.*s - event.source: %d (0x%x)\n"
+ "%*.*s event.type: %d (0x%x)\n",
+ l, l, p, event.header.source, event.header.source,
+ l, l, p, event.header.type, event.header.type));
+}
+
+void
+ACE_ConsumerQOS_Factory::debug (const RtecEventChannelAdmin::ConsumerQOS& qos)
+{
+ ACE_DEBUG ((LM_DEBUG, "ConsumerQOS { \n"));
+ ACE_DEBUG ((LM_DEBUG, " is_gateway: %d\n", qos.is_gateway));
+
+ for (u_int i = 0; i < qos.dependencies.length (); ++i)
+ {
+ char buf[128];
+ ACE_OS::sprintf (buf, " dep[%d]", i);
+ event_debug (buf, qos.dependencies[i].event);
+ ACE_DEBUG ((LM_DEBUG, "%s rt_info: %d\n",
+ buf, qos.dependencies[i].rt_info));
+ }
+ ACE_DEBUG ((LM_DEBUG, "}\n"));
+}
+
+// ************************************************************
+ACE_SupplierQOS_Factory::
+ ACE_SupplierQOS_Factory (TAO_EC_Event_Initializer initializer,
+ int qos_max_len)
+ : event_initializer_ (initializer)
+{
+ qos_.is_gateway = 0;
+
+ // Allocate the space requested by the application....
+ qos_.publications.length (qos_max_len);
+
+ // ... now reset the length, we do not want to use any elements in
+ // the sequence that have not been initialized....
+ qos_.publications.length (0);
+}
+
+int
+ACE_SupplierQOS_Factory::insert (RtecEventComm::EventSourceID sid,
+ RtecEventComm::EventType type,
+ RtecBase::handle_t rt_info,
+ u_int ncalls)
+{
+ CORBA::ULong l = this->qos_.publications.length ();
+ if (l >= this->qos_.publications.maximum ())
+ {
+ // There is not enough space for the next element, grow the
+ // buffer.
+ this->qos_.publications.length (l + 1);
+
+ // @@ TODO We may want to consider more efficient growing
+ // strategies here, for example, duplicating the size of the
+ // buffer, or growing in fixed sized chunks...
+ }
+
+ if (this->event_initializer_ != 0)
+ (*this->event_initializer_) (qos_.publications[l].event);
+ this->qos_.publications[l].event.header.source = sid;
+ this->qos_.publications[l].event.header.type = type;
+ // TODO: IDL union this->qos_.publications[l].event.data_.lval (0);
+ this->qos_.publications[l].dependency_info.rt_info = rt_info;
+ this->qos_.publications[l].dependency_info.number_of_calls = ncalls;
+ return 0;
+}
+
+void ACE_SupplierQOS_Factory::debug (const RtecEventChannelAdmin::SupplierQOS& qos)
+{
+ ACE_DEBUG ((LM_DEBUG, "SupplierQOS { \n"));
+ ACE_DEBUG ((LM_DEBUG, " is_gateway: %d\n", qos.is_gateway));
+
+ for (u_int i = 0; i < qos.publications.length (); ++i)
+ {
+ char buf[128] = { 0 };
+ ACE_OS::sprintf (buf, " publications[%d]", i);
+ event_debug (buf, qos.publications[i].event);
+ ACE_DEBUG ((LM_DEBUG,
+ "%s dependency_info.rt_info: %d\n"
+ "%s dependency_info.number_of_calls: %d\n",
+ buf, qos.publications[i].dependency_info.rt_info,
+ buf, qos.publications[i].dependency_info.number_of_calls));
+ }
+ ACE_DEBUG ((LM_DEBUG, "}\n"));
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Event_Utilities.h b/TAO/orbsvcs/orbsvcs/Event_Utilities.h
new file mode 100644
index 00000000000..01be03b7517
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event_Utilities.h
@@ -0,0 +1,256 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Event_Utilities.h
+ *
+ * $Id$
+ *
+ * @author Tim Harrison (harrison@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef ACE_EVENT_UTILITIES_H
+#define ACE_EVENT_UTILITIES_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/Event_Service_Constants.h"
+
+#include "orbsvcs/Event/event_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+typedef void (*TAO_EC_Event_Initializer) (RtecEventComm::Event&);
+
+/**
+ * @class ACE_ConsumerQOS_Factory
+ *
+ * @brief Consumer QOS Factory.
+ *
+ * This class allows easy (free from CORBA IDL constraints)
+ * construction of RtecEventChannelAdmin::ConsumerQOS structures.
+ * = CORRELATIONS
+ * ACE_ConsumerQOS_Factory separates subscriptions into conjunction
+ * and disjunction groups. A group can be thought of as a set of
+ * events inside parenthesis: (A+B+C), where A,B, and C are
+ * events.
+ * The following code would be used to represent (A+B) | (B+C):
+ * ACE_ConsumerQOS_Factor factory;
+ * factory.start_conjunction_group ();
+ * factory.insert (A);
+ * factory.insert (B);
+ * factory.start_conjunction_group ();
+ * factory.insert (B);
+ * factory.insert (C);
+ * The following code would be used to represent (A|B) | (B|C):
+ * ACE_ConsumerQOS_Factor factory;
+ * factory.start_disjunction_group ();
+ * factory.insert (A);
+ * factory.insert (B);
+ * factory.start_disjunction_group ();
+ * factory.insert (B);
+ * factory.insert (C);
+ * First, this may not seem to be initially useful, as (A|B) |
+ * (B|C) seems the same as A|B|C. However, this form does have a
+ * significant use when deadline timers are specified (described
+ * below). Note that groups end with the next call to
+ * start_XX_group. Groups are always OR'd together. That is,
+ * there is no way to directly build (A|B|C) + (D|E|F). You can
+ * always expand the previous statement to the OR of multiple ANDs.
+ * = TIMEOUTS
+ * There are two types of timeout types defined in
+ * Event_Service_Constants.h.
+ * ACE_ES_EVENT_INTERVAL_TIMEOUT - the consumer wants to receive a
+ * timeout every N seconds.
+ * ACE_ES_EVENT_DEADLINE_TIMEOUT - the consumer wants the timeout
+ * if and only if some dependencies are not resolved first.
+ * Using these timeouts with the correlations discussed above, we
+ * can construct four different timer semantics: Interval Timer,
+ * Deadline Timer, Interval Correlation, Deadline Correlation:
+ * Interval Timer:
+ * (A+B+C) | (D+E+F) | (G+H+I) | IntervalTimeout
+ * This registers to receive an interval timeout regardless of
+ * other dependencies. Event if events occur, the interval
+ * timeout will still be sent.
+ * Deadline Timer:
+ * (A+B+C) | (D+E+F) | (G+H+I) | DeadlineTimeout
+ * This registers to receive the deadline timeout ONLY if no
+ * other events occur. If a single event is sent to the
+ * consumer, the timer is cancelled and rescheduled.
+ * Deadline Correlation:
+ * (A+B+C) | (D+E+F) | (G+H+DeadlineTimeout)
+ * If G and H do not occur within DeadlineTimeout time, a
+ * deadline timeout is sent. It is cancelled and rescheduled if G
+ * and H occur.
+ * Interval Correlation:
+ * (A+B+C) | (D+E+F) | (G+H+IntervalTimeout)
+ * G+H+IntervalTimeout are sent ONLY after all have occurred. If
+ * G+H occur, they are queued until IntervalTimeout occurs. If
+ * IntervalTimeout occurs, it is queued until G+H occur.
+ */
+class TAO_RTEvent_Export ACE_ConsumerQOS_Factory
+{
+public:
+ /// Default construction.
+ ACE_ConsumerQOS_Factory (TAO_EC_Event_Initializer initializer = 0);
+
+ /// Death and destruction.
+ ~ACE_ConsumerQOS_Factory (void);
+
+ /**
+ * The Event Channel waits until all the children have accepted at
+ * least one event, and then send them all as a single event to the
+ * consumer.
+ */
+ int start_conjunction_group (int nchildren = 0);
+
+ /// The consumer accepts any event that is accepted by at least one
+ /// child.
+ int start_disjunction_group (int nchildren = 0);
+
+ /// The consumer only accepts events that pass all the filter
+ /// expressions defined by the children.
+ int start_logical_and_group (int nchildren = 0);
+
+ /// The consumer wants all the events *except* the group that
+ /// follows.
+ int start_negation (void);
+
+ /// Insert a bitmask filter, this acts as a quick rejection mechanism
+ /// for the subsequent filters.
+ int start_bitmask (CORBA::ULong source_mask,
+ CORBA::ULong type_mask);
+
+ /**
+ * Inser a new filter that only accepts events with the following
+ * properties:
+ * (event.header.type & type_mask) == type_value
+ * (event.header.source & source_mask) == source_value
+ */
+ int insert_bitmasked_value (CORBA::ULong source_mask,
+ CORBA::ULong type_mask,
+ CORBA::ULong source_value,
+ CORBA::ULong type_value);
+
+ /// Insert a node that accepts any event, useful for bitmask filters.
+ int insert_null_terminator (void);
+
+ // = Insert operations add to the current conjunction or disjunction
+ // group. These return 0 on success, -1 on failure. Before insert
+ // is called, a start_XX_group method should be called. If a
+ // start_XX_group method is not called, start_conjunction_group is
+ // assumed.
+
+ /// Insert the @a subscribe structure describing the event and
+ /// receiving method into the current group.
+ int insert (const RtecEventChannelAdmin::Dependency &subscribe);
+
+ /**
+ * Insert source/type dependency. @a source of the event (may be
+ * zero), @a type of the event. @a rt_info describes the method that
+ * will handle the source/type events.
+ */
+ int insert (RtecEventComm::EventSourceID source,
+ RtecEventComm::EventType type,
+ RtecBase::handle_t rt_info);
+
+ /// Insert type-only dependency.
+ int insert_type (RtecEventComm::EventType type,
+ RtecBase::handle_t rt_info);
+
+ /// Insert source-only dependency.
+ int insert_source (RtecEventComm::EventSourceID source,
+ RtecBase::handle_t rt_info);
+
+ /// Register temporal dependency. @a type designates interval or
+ /// deadline timeout that will occur every @a interval.
+ int insert_time (RtecEventComm::EventType type,
+ RtecEventComm::Time interval,
+ RtecBase::handle_t rt_info);
+
+ /// This will be inserted as type ACE_ES_EVENT_ACT.
+ int insert_act (RtecEventComm::EventData act);
+
+ // = Conversion operators. The Event Channel takes ConsumerQOS
+ // objects.
+
+ /// Allows conversions to ConsumerQOS, which is expected by the
+ /// PushSupplierProxy::connect_push_consumer interface.
+ const RtecEventChannelAdmin::ConsumerQOS &get_ConsumerQOS (void);
+
+ /// Calls this->get_ConsumerQOS.
+ operator const RtecEventChannelAdmin::ConsumerQOS &(void);
+
+ static void debug (const RtecEventChannelAdmin::ConsumerQOS& qos);
+
+private:
+ /// The representation to be sent to the channel.
+ RtecEventChannelAdmin::ConsumerQOS qos_;
+
+ /// Whether a start_XX_group has been called yet. This is to make
+ /// sure that a designator is placed in the subscription list first.
+ int designator_set_;
+
+ /**
+ * If not zero this is a user-provided function used to initialize
+ * the events. When the event contains unions this is required to
+ * avoid marshaling and demarshaling of default initialized unions
+ * that (AFAIK) is not CORBA compliant.
+ */
+ TAO_EC_Event_Initializer event_initializer_;
+};
+
+// ************************************************************
+
+class TAO_RTEvent_Export ACE_SupplierQOS_Factory
+{
+public:
+ /// Default construction.
+ ACE_SupplierQOS_Factory (TAO_EC_Event_Initializer initializer = 0,
+ int qos_max_len = 0);
+
+ /**
+ * Publish @a sid and @a type that is generate by a method described by
+ * @a rtinfo. The method generates @a type @a ncalls number of times
+ * per "iteration."
+ */
+ int insert (RtecEventComm::EventSourceID sid,
+ RtecEventComm::EventType type,
+ RtecBase::handle_t rtinfo,
+ u_int ncalls);
+
+ /// Allows conversions to SupplierQOS, which is expected by the
+ /// PushSupplierProxy::connect_push_supplier interface.
+ const RtecEventChannelAdmin::SupplierQOS &get_SupplierQOS (void);
+
+ /// Calls this->get_SupplierQOS().
+ operator const RtecEventChannelAdmin::SupplierQOS &(void);
+
+ static void debug (const RtecEventChannelAdmin::SupplierQOS& qos);
+
+private:
+ /// Representation needed by channel.
+ RtecEventChannelAdmin::SupplierQOS qos_;
+
+ /**
+ * If not zero this is a user-provided function used to initialize
+ * the events. When the event contains unions this is required to
+ * avoid marshaling and demarshaling of default initialized unions
+ * that (AFAIK) is not CORBA compliant.
+ */
+ TAO_EC_Event_Initializer event_initializer_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Event_Utilities.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* ACE_EVENT_UTILITIES_H */
diff --git a/TAO/orbsvcs/orbsvcs/Event_Utilities.i b/TAO/orbsvcs/orbsvcs/Event_Utilities.i
new file mode 100644
index 00000000000..20c09b0a0fe
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Event_Utilities.i
@@ -0,0 +1,152 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE int
+ACE_ConsumerQOS_Factory::insert (RtecEventComm::EventSourceID source,
+ RtecEventComm::EventType type,
+ RtecBase::handle_t rt_info)
+{
+ RtecEventChannelAdmin::Dependency dependency;
+ if (this->event_initializer_ != 0)
+ (*this->event_initializer_) (dependency.event);
+ dependency.event.header.source = source;
+ dependency.event.header.type = type;
+ //dependency.event.header.creation_time = 0;
+ //dependency.event.header.ec_recv_time = 0;
+ //dependency.event.header.ec_send_time = 0;
+ dependency.rt_info = rt_info;
+ return this->insert (dependency);
+}
+
+ACE_INLINE int
+ACE_ConsumerQOS_Factory::insert_bitmasked_value (CORBA::ULong source_mask,
+ CORBA::ULong type_mask,
+ CORBA::ULong source_value,
+ CORBA::ULong type_value)
+
+{
+ RtecEventChannelAdmin::Dependency dependency;
+ if (this->event_initializer_ != 0)
+ (*this->event_initializer_) (dependency.event);
+ dependency.event.header.type = ACE_ES_MASKED_TYPE_DESIGNATOR;
+ dependency.event.header.source = 0;
+ //dependency.event.header.creation_time = 0;
+ //dependency.event.header.ec_recv_time = 0;
+ //dependency.event.header.ec_send_time = 0;
+ dependency.rt_info = 0;
+ this->insert (dependency);
+
+ dependency.event.header.source = source_mask;
+ dependency.event.header.type = type_mask;
+ this->insert (dependency);
+
+ dependency.event.header.source = source_value;
+ dependency.event.header.type = type_value;
+ return this->insert (dependency);
+}
+
+ACE_INLINE int
+ACE_ConsumerQOS_Factory::insert_null_terminator (void)
+{
+ RtecEventChannelAdmin::Dependency dependency;
+ if (this->event_initializer_ != 0)
+ (*this->event_initializer_) (dependency.event);
+ dependency.event.header.type = ACE_ES_NULL_DESIGNATOR;
+ dependency.event.header.source = 0;
+ return this->insert (dependency);
+}
+
+ACE_INLINE int
+ACE_ConsumerQOS_Factory::insert_type (RtecEventComm::EventType type,
+ RtecBase::handle_t rt_info)
+{
+ RtecEventChannelAdmin::Dependency dependency;
+ if (this->event_initializer_ != 0)
+ (*this->event_initializer_) (dependency.event);
+ dependency.event.header.source = ACE_ES_EVENT_SOURCE_ANY;
+ dependency.event.header.type = type;
+ //dependency.event.header.creation_time = 0;
+ //dependency.event.header.ec_recv_time = 0;
+ //dependency.event.header.ec_send_time = 0;
+ dependency.rt_info = rt_info;
+ return this->insert (dependency);
+}
+
+ACE_INLINE int
+ACE_ConsumerQOS_Factory::insert_source (RtecEventComm::EventSourceID source,
+ RtecBase::handle_t rt_info)
+{
+ RtecEventChannelAdmin::Dependency dependency;
+ if (this->event_initializer_ != 0)
+ (*this->event_initializer_) (dependency.event);
+ dependency.event.header.source = source;
+ dependency.event.header.type = ACE_ES_EVENT_ANY;
+ //dependency.event.header.creation_time = 0;
+ //dependency.event.header.ec_recv_time = 0;
+ //dependency.event.header.ec_send_time = 0;
+ dependency.rt_info = rt_info;
+ return this->insert (dependency);
+}
+
+ACE_INLINE int
+ACE_ConsumerQOS_Factory::insert_time (RtecEventComm::EventType type,
+ RtecEventComm::Time interval,
+ RtecBase::handle_t rt_info)
+{
+ RtecEventChannelAdmin::Dependency dependency;
+ if (this->event_initializer_ != 0)
+ (*this->event_initializer_) (dependency.event);
+ dependency.event.header.source = ACE_ES_EVENT_SOURCE_ANY;
+ dependency.event.header.type = type;
+ dependency.event.header.creation_time = interval;
+ //dependency.event.header.ec_recv_time = 0;
+ //dependency.event.header.ec_send_time = 0;
+ dependency.rt_info = rt_info;
+ return this->insert (dependency);
+}
+
+ACE_INLINE int
+ACE_ConsumerQOS_Factory::insert_act (RtecEventComm::EventData act)
+{
+ RtecEventChannelAdmin::Dependency dependency;
+ if (this->event_initializer_ != 0)
+ (*this->event_initializer_) (dependency.event);
+ dependency.event.header.source = 0;
+ dependency.event.header.type = ACE_ES_EVENT_ACT;
+ //dependency.event.header.creation_time = 0;
+ //dependency.event.header.ec_recv_time = 0;
+ //dependency.event.header.ec_send_time = 0;
+ dependency.event.data = act;
+ return this->insert (dependency);
+}
+
+ACE_INLINE const RtecEventChannelAdmin::ConsumerQOS&
+ACE_ConsumerQOS_Factory::get_ConsumerQOS (void)
+{
+ return qos_;
+}
+
+ACE_INLINE
+ACE_ConsumerQOS_Factory::operator const RtecEventChannelAdmin::ConsumerQOS& (void)
+{
+ return qos_;
+}
+
+// ************************************************************
+
+ACE_INLINE const RtecEventChannelAdmin::SupplierQOS&
+ACE_SupplierQOS_Factory::get_SupplierQOS (void)
+{
+ return qos_;
+}
+
+ACE_INLINE
+ACE_SupplierQOS_Factory::operator const RtecEventChannelAdmin::SupplierQOS& (void)
+{
+ return qos_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FTORB.mpc b/TAO/orbsvcs/orbsvcs/FTORB.mpc
new file mode 100644
index 00000000000..8254fb8f2de
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FTORB.mpc
@@ -0,0 +1,89 @@
+// -*- MPC -*-
+// $Id$
+
+project(FTORB_Utils) : orbsvcslib, core, iormanip, portableserver, portablegroup, minimum_corba, tao_versioning_idl_defaults {
+ sharedname = TAO_FTORB_Utils
+ idlflags += -Wb,skel_export_include=tao/PortableServer/PolicyS.h
+ dynamicflags = TAO_FT_ORB_UTILS_BUILD_DLL
+ tagchecks += FTORB_Utils
+
+ IDL_Files {
+ idlflags += -Wb,export_macro=TAO_FT_ORB_Utils_Export -Wb,export_include=orbsvcs/FaultTolerance/FT_ORB_Utils_export.h
+ FT_CORBA_ORB.idl
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ FTORB_Utils {
+ FT_CORBA_ORBC.cpp
+ FT_CORBA_ORBS.cpp
+ FaultTolerance/FT_IOGR_Property.cpp
+ }
+ }
+
+ Header_Files {
+ FaultTolerance/FT_ORB_Utils_export.h
+ }
+
+ Pkgconfig_Files {
+ TAO_FTORB_Utils.pc.in
+ }
+}
+
+project(FT_ClientORB) : orbsvcslib, ftorbutils, core, messaging, portablegroup, interceptors {
+ avoids += ace_for_tao // Requires ace/UUID
+ sharedname = TAO_FT_ClientORB
+ dynamicflags = TAO_FT_CLIENTORB_BUILD_DLL
+ tagchecks += FT_ClientORB
+ libs += TAO_FTORB_Utils
+ requires += ace_uuid
+
+ IDL_Files {
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ FT_ClientORB {
+ FaultTolerance/FT_ClientRequest_Interceptor.cpp
+ FaultTolerance/FT_ClientORBInitializer.cpp
+ FaultTolerance/FT_ClientPolicyFactory.cpp
+ FaultTolerance/FT_ClientPolicy_i.cpp
+ FaultTolerance/FT_ClientService_Activate.cpp
+ FaultTolerance/FT_Endpoint_Selector_Factory.cpp
+ FaultTolerance/FT_Invocation_Endpoint_Selectors.cpp
+ FaultTolerance/FT_Service_Callbacks.cpp
+ }
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_FT_ClientORB.pc.in
+ }
+}
+
+project(FT_ServerORB) : orbsvcslib, ftorbutils, core, messaging, portablegroup, pi_server, pi, interceptors {
+ sharedname = TAO_FT_ServerORB
+ dynamicflags = TAO_FT_SERVERORB_BUILD_DLL
+ tagchecks += FT_ServerORB
+ libs += TAO_FTORB_Utils
+
+ IDL_Files {
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ FT_ServerORB {
+ FaultTolerance/FT_ServerORBInitializer.cpp
+ FaultTolerance/FT_ServerPolicyFactory.cpp
+ FaultTolerance/FT_ServerPolicy_i.cpp
+ FaultTolerance/FT_ServerRequest_Interceptor.cpp
+ FaultTolerance/FT_ServerService_Activate.cpp
+ }
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_FT_ServerORB.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/FTRT.idl b/TAO/orbsvcs/orbsvcs/FTRT.idl
new file mode 100644
index 00000000000..4ae2530a225
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FTRT.idl
@@ -0,0 +1,82 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file FTRT.idl
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang
+ */
+//=============================================================================
+
+#ifndef FTRT_H
+#define FTRT_H
+
+#include "tao/IOP.pidl"
+
+module FTRT
+{
+
+ typedef long TransactionDepth;
+ typedef unsigned long SequenceNumber;
+
+ const IOP::ServiceId FT_TRANSACTION_DEPTH = 30;
+ const IOP::ServiceId FT_SEQUENCE_NUMBER = 31;
+ const IOP::ServiceId FT_FORWARD = 32;
+
+ /// this service context is used by FTRT client
+ /// to information the server the depth of replication
+ /// which has to be complete before the request returns.
+ struct FTTransactionDepthServiceContext {
+ TransactionDepth transaction_depth;
+ };
+
+ /// this service context is used by replicas for detecting
+ /// the loss of replication messages in soft-replication.
+ struct FTSequenceNumberServiceContext {
+ SequenceNumber sequence_number;
+ };
+
+ /// In the FTCORBA standard, if the server receive a request
+ /// from a client with an object_group_ref_version less than
+ /// the one known to the server. The server should reply a
+ /// LOCATION_FORARD_PERM exception. However, if the server is
+ /// also the primary, the server have to wait until the client
+ /// issue a new request with the new object_group_ref_version
+ /// before it can return the result. This will cause unnecessary
+ /// delay for processing the request. The service context is used
+ /// by the primary to inform the client the lastest version of
+ /// IOGR known to the primary in the reply. The client can thus
+ /// upates the object reference in the next method invocation without
+ /// extra round trip delay.
+ struct FTForwardServiceContext {
+ Object forward;
+ };
+
+ exception OutOfSequence
+ {
+ SequenceNumber current;
+ };
+
+ exception TransactionDepthTooHigh
+ {
+ };
+
+ typedef sequence<octet> State;
+
+ exception InvalidUpdate {};
+
+ interface Updateable
+ {
+ /// used for assured replication
+ void set_update(in State s)
+ raises(InvalidUpdate, OutOfSequence, TransactionDepthTooHigh);
+
+ /// used for soft replication
+ oneway void oneway_set_update(in State s);
+ };
+};
+
+#endif
+
diff --git a/TAO/orbsvcs/orbsvcs/FTRT_GroupManager.idl b/TAO/orbsvcs/orbsvcs/FTRT_GroupManager.idl
new file mode 100644
index 00000000000..950ee0e0b3a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FTRT_GroupManager.idl
@@ -0,0 +1,71 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file FTRT_GroupManager.idl
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang
+ */
+//=============================================================================
+
+#ifndef TAO_FTRT_GROUPMANAGER_IDL
+#define TAO_FTRT_GROUPMANAGER_IDL
+
+#include "orbsvcs/RtecEventChannelAdmin.idl"
+#include "orb.idl"
+#include "orbsvcs/CosNaming.idl"
+#include "FTRT.idl"
+
+module FTRT
+{
+ typedef CosNaming::Name Location;
+
+ interface FaultListener {
+ /// called by the replica which detect the loss of connection with its
+ /// predecessor to the primary
+ oneway void replica_crashed(in Location the_location);
+ };
+
+ interface ObjectGroupManager;
+
+ struct ManagerInfo {
+ Location the_location;
+ ObjectGroupManager ior;
+ };
+
+ exception PredecessorUnreachable {};
+
+ typedef sequence<ManagerInfo> ManagerInfoList;
+ exception InvalidState{};
+
+ interface ObjectGroupManager : FaultListener {
+ boolean start(in FaultListener listener,
+ out Location the_location);
+
+ void create_group(in ManagerInfoList info_list,
+ in unsigned long object_group_ref_version)
+ raises(PredecessorUnreachable);
+
+ /// called by a newly created replica to the primary
+ // for requesting for joining a object group
+ oneway void join_group(in ManagerInfo info);
+
+ /// called by primary to replicas
+ /// for adding a new member to the group
+ void add_member(in ManagerInfo info,
+ in unsigned long object_group_ref_version);
+
+ /// called by the primary to backups for deleting a member from
+ /// the group
+ oneway void remove_member(in Location crashed_location,
+ in unsigned long object_group_ref_version);
+
+ void set_state(in State stat)
+ raises (InvalidState);
+
+ };
+};
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FT_CORBA.idl b/TAO/orbsvcs/orbsvcs/FT_CORBA.idl
new file mode 100644
index 00000000000..144c2290bbe
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FT_CORBA.idl
@@ -0,0 +1,352 @@
+//$Id$
+// FT.idl
+#ifndef _FT_IDL_
+#define _FT_IDL_
+
+// The OMG file has been devided into several portions:
+// FT_CORBA.idl
+// FT_CORBA_ORB.idl
+// FT_Detector.idl
+// FT_Notifier.idl
+// FT_Replica.idl
+
+// The next include is TAO specific.
+#include "orbsvcs/FT_CORBA_ORB.idl"
+
+#define FT_USES_PORTABLE_GROUP
+
+#ifdef FT_USES_PORTABLE_GROUP
+# include "orbsvcs/PortableGroup.idl"
+#else // FT_USES_PORTABLE_GROUP
+#include "orbsvcs/CosNaming.idl" // 98-10-19.idl
+#endif // FT_USES_PORTABLE_GROUP
+
+#include "orbsvcs/CosNotification.idl" // from telecom/98-11-03.idl
+#include "orbsvcs/CosNotifyFilter.idl"
+
+#pragma prefix "omg.org"
+
+module FT
+{
+ /// Forward declarations
+ interface FaultNotifier;
+
+ typedef long ReplicationStyleValue;
+ const ReplicationStyleValue STATELESS = 0;
+ const ReplicationStyleValue COLD_PASSIVE = 1;
+ const ReplicationStyleValue WARM_PASSIVE = 2;
+ const ReplicationStyleValue ACTIVE = 3;
+ const ReplicationStyleValue ACTIVE_WITH_VOTING = 4;
+ const ReplicationStyleValue SEMI_ACTIVE = 5;
+
+ typedef long ConsistencyStyleValue;
+ const ConsistencyStyleValue CONS_APP_CTRL = 0;
+ const ConsistencyStyleValue CONS_INF_CTRL = 1;
+
+ typedef long FaultMonitoringStyleValue;
+ const FaultMonitoringStyleValue PULL = 0;
+ const FaultMonitoringStyleValue PUSH = 1;
+ const FaultMonitoringStyleValue NOT_MONITORED = 2;
+
+ typedef long FaultMonitoringGranularityValue;
+ const FaultMonitoringGranularityValue MEMB = 0;
+ const FaultMonitoringGranularityValue LOC = 1;
+ const FaultMonitoringGranularityValue LOC_AND_TYPE = 2;
+
+ struct FaultMonitoringIntervalAndTimeoutValue {
+ TimeBase::TimeT monitoring_interval;
+ TimeBase::TimeT timeout;
+ };
+
+ exception BadReplicationStyle {};
+ exception PrimaryNotSet {};
+
+#ifdef FT_USES_PORTABLE_GROUP
+ /////////////////////////////////////////
+ // The following typedefs "import"
+ // definitions from the PortableGroup module
+ // definitions into the FT module.
+ // This is an interim step during the process
+ // of having FT depend on the commmon
+ // of PortableGroup module rather than defining
+ // everything itself.
+
+ // this typedef trick doesn't work for exceptions, so they must
+ // use the PortableGroup:: prefix
+ typedef PortableGroup::_TypeId _TypeId;
+ typedef PortableGroup::ObjectGroup ObjectGroup;
+ typedef PortableGroup::Name Name;
+ typedef PortableGroup::Value Value;
+ typedef PortableGroup::Property Property;
+ typedef PortableGroup::Properties Properties;
+ typedef PortableGroup::Location Location;
+ typedef PortableGroup::Locations Locations;
+ typedef PortableGroup::Criteria Criteria;
+
+ typedef PortableGroup::FactoryInfo FactoryInfo;
+ typedef PortableGroup::FactoryInfos FactoryInfos;
+ typedef PortableGroup::MembershipStyleValue MembershipStyleValue;
+
+ typedef PortableGroup::FactoriesValue FactoriesValue;
+ typedef PortableGroup::InitialNumberMembersValue InitialNumberMembersValue;
+ typedef PortableGroup::MinimumNumberMembersValue MinimumNumberMembersValue;
+ typedef PortableGroup::PropertyManager PropertyManager;
+ typedef PortableGroup::ObjectGroupManager ObjectGroupManager;
+ typedef PortableGroup::GenericFactory GenericFactory;
+
+ // Specification of FTObjectGroupManager Interface
+ // which ReplicationManager Inherits
+ interface FTObjectGroupManager : PortableGroup::ObjectGroupManager {
+
+ ::PortableGroup::ObjectGroup set_primary_member(in ::PortableGroup::ObjectGroup object_group,
+ in ::PortableGroup::Location the_location)
+ raises(PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound,
+ PrimaryNotSet,
+ BadReplicationStyle);
+ };
+
+
+ ///////////////////////////////////////////////////
+ // names for properties used in Fault Tolerant CORBA
+
+ /// FT::ReplicationStyle
+ const string FT_REPLICATION_STYLE = "org.omg.ft.ReplicationStyle";
+
+ /// FT::ConsistencyStyle
+ const string FT_CONSISTENCY_STYLE = "org.omg.ft.ConsistencyStyle";
+
+ /// FT::MembershipStyle
+ const string FT_MEMBERSHIP_STYLE = PortableGroup::PG_MEMBERSHIP_STYLE;
+ const PortableGroup::MembershipStyleValue MEMB_APP_CTRL = PortableGroup::MEMB_APP_CTRL;
+ const PortableGroup::MembershipStyleValue MEMB_INF_CTRL = PortableGroup::MEMB_INF_CTRL;
+
+ /// FT::FaultMonitoringStyle
+ const string FT_FAULT_MONITORING_STYLE = "org.omg.ft.FaultMonitoringStyle";
+
+ /// FT::FaultMonitoringGranularity
+ const string FT_FAULT_MONITORING_GRANULARITY = "org.omg.ft.FaultMonitoringGranularity";
+
+ /// FT::InitialNumberMembers
+ const string FT_INITIAL_NUMBER_MEMBERS = PortableGroup::PG_INITIAL_NUMBER_MEMBERS;
+
+ /// FT::MinimumNumberMembers
+ const string FT_MINIMUM_NUMBER_MEMBERS = PortableGroup::PG_MINIMUM_NUMBER_MEMBERS;
+
+ /// Factories
+ const string FT_FACTORIES = PortableGroup::PG_FACTORIES;
+
+ /// FT::FaultMonitoringIntervalAndTimeou
+ const string FT_FAULT_MONITORING_INTERVAL_AND_TIMEOUT = "org.omg.ft.FaultMonitoringIntervalAndTimeout";
+
+ /// FT::CheckpointInterval
+ const string FT_CHECKPOINT_INTERVAL = "org.omg.ft.CheckpointInterval";
+
+ // end of property names from FT CORBA specification
+ ///////////////////////////////////////////////////
+
+
+#else // (not) FT_USES_PORTABLE_GROUP
+ interface GenericFactory;
+
+ /// Useful typedefs.
+ typedef CORBA::RepositoryId _TypeId;
+ typedef Object ObjectGroup;
+
+ typedef CosNaming::Name Name;
+ typedef any Value;
+
+ /**
+ * @struct Property
+ *
+ * @brief A property name and a value association.
+ */
+ struct Property {
+ Name nam;
+ Value val;
+ };
+
+ /// Some mor euseful typedefs.
+ typedef sequence<Property> Properties;
+ typedef Name Location;
+ typedef sequence<Location> Locations;
+ typedef Properties Criteria;
+
+
+ /**
+ * @struct FactoryInfo
+ *
+ * @brief <@todo>
+ *
+ */
+ struct FactoryInfo {
+ GenericFactory _factory;
+ Location the_location;
+ Criteria the_criteria;
+ };
+
+ typedef sequence<FactoryInfo> FactoryInfos;
+
+ typedef long ReplicationStyleValue;
+ const ReplicationStyleValue STATELESS = 0;
+ const ReplicationStyleValue COLD_PASSIVE = 1;
+ const ReplicationStyleValue WARM_PASSIVE = 2;
+ const ReplicationStyleValue ACTIVE = 3;
+ const ReplicationStyleValue ACTIVE_WITH_VOTING = 4;
+ typedef long MembershipStyleValue;
+ const MembershipStyleValue MEMB_APP_CTRL = 0;
+ const MembershipStyleValue MEMB_INF_CTRL = 1;
+ typedef long ConsistencyStyleValue;
+ const ConsistencyStyleValue CONS_APP_CTRL = 0;
+ const ConsistencyStyleValue CONS_INF_CTRL = 1;
+ typedef long FaultMonitoringStyleValue;
+ const FaultMonitoringStyleValue PULL = 0;
+ const FaultMonitoringStyleValue PUSH = 1;
+ const FaultMonitoringStyleValue NOT_MONITORED = 2;
+ typedef long FaultMonitoringGranularityValue;
+ const FaultMonitoringGranularityValue MEMB = 0;
+ const FaultMonitoringGranularityValue LOC = 1;
+ const FaultMonitoringGranularityValue LOC_AND_TYPE = 2;
+ typedef FactoryInfos FactoriesValue;
+ typedef unsigned short InitialNumberMembersValue;
+ typedef unsigned short MinimumNumberMembersValue;
+
+ struct FaultMonitoringIntervalAndTimeoutValue {
+ TimeBase::TimeT monitoring_interval;
+ TimeBase::TimeT timeout;
+ };
+
+ typedef TimeBase::TimeT CheckpointIntervalValue;
+ exception InterfaceNotFound {};
+ exception ObjectGroupNotFound {};
+ exception MemberNotFound {};
+ exception ObjectNotFound {};
+ exception MemberAlreadyPresent {};
+ exception BadReplicationStyle {};
+ exception ObjectNotCreated {};
+ exception ObjectNotAdded {};
+ exception PrimaryNotSet {};
+ exception UnsupportedProperty {
+ Name nam;
+ Value val;
+ };
+
+ exception InvalidProperty {
+ Name nam;
+ Value val; };
+
+ exception NoFactory {
+ Location the_location;
+ _TypeId type_id; };
+
+ exception InvalidCriteria {
+ Criteria invalid_criteria; };
+
+ exception CannotMeetCriteria {
+ Criteria unmet_criteria; };
+
+ // Specification of PropertyManager Interface
+ // which ReplicationManager Inherits
+
+ interface PropertyManager {
+
+ void set_default_properties(in Properties props)
+ raises (InvalidProperty, UnsupportedProperty);
+ Properties get_default_properties();
+
+ void remove_default_properties(in Properties props)
+ raises (InvalidProperty, UnsupportedProperty);
+
+ void set_type_properties(in _TypeId type_id,
+ in Properties overrides)
+ raises (InvalidProperty, UnsupportedProperty);
+
+ Properties get_type_properties(in _TypeId type_id);
+
+ void remove_type_properties(in _TypeId type_id,
+ in Properties props)
+ raises (InvalidProperty, UnsupportedProperty);
+
+ void set_properties_dynamically(in ObjectGroup object_group,
+ in Properties overrides)
+ raises(ObjectGroupNotFound, InvalidProperty, UnsupportedProperty);
+
+ Properties get_properties(in ObjectGroup object_group)
+ raises(ObjectGroupNotFound);
+ };
+
+ // Specification of ObjectGroupManager Interface
+ // which ReplicationManager Inherits
+ interface ObjectGroupManager {
+ ObjectGroup create_member(in ObjectGroup object_group,
+ in Location the_location,
+ in _TypeId type_id,
+ in Criteria the_criteria)
+ raises(ObjectGroupNotFound,
+ MemberAlreadyPresent,
+ NoFactory,
+ ObjectNotCreated,
+ InvalidCriteria,
+ CannotMeetCriteria);
+
+ ObjectGroup add_member(in ObjectGroup object_group,
+ in Location the_location,
+ in Object member)
+ raises(ObjectGroupNotFound,
+ MemberAlreadyPresent,
+ ObjectNotAdded);
+
+ ObjectGroup remove_member(in ObjectGroup object_group,
+ in Location the_location)
+ raises(ObjectGroupNotFound,
+ MemberNotFound);
+
+ ObjectGroup set_primary_member(in ObjectGroup object_group,
+ in Location the_location)
+ raises(ObjectGroupNotFound,
+ MemberNotFound,
+ PrimaryNotSet,
+ BadReplicationStyle);
+
+ Locations locations_of_members(in ObjectGroup object_group)
+ raises(ObjectGroupNotFound);
+
+ ObjectGroupId get_object_group_id(in ObjectGroup object_group)
+ raises(ObjectGroupNotFound);
+
+ ObjectGroup get_object_group_ref(in ObjectGroup object_group)
+ raises(ObjectGroupNotFound);
+
+ Object get_member_ref(in ObjectGroup object_group,
+ in Location loc)
+ raises(ObjectGroupNotFound, MemberNotFound);
+ };
+
+
+ // Specification of GenericFactory Interface
+ // which ReplicationManager Inherits and Application Objects Implement
+ interface GenericFactory {
+ typedef any FactoryCreationId;
+ Object create_object(in _TypeId type_id,
+ in Criteria the_criteria,
+ out FactoryCreationId factory_creation_id)
+ raises (NoFactory,
+ ObjectNotCreated,
+ InvalidCriteria,
+ InvalidProperty,
+ CannotMeetCriteria);
+
+ void delete_object(in FactoryCreationId factory_creation_id)
+ raises (ObjectNotFound);
+ };
+
+#endif // FT_USES_PORTABLE_GROUP
+
+ // Specifications for Fault Management moved to FT_Replica.idl
+ // Specification of FaultNotifier Interface: moved to FT_Notifier.idl
+ // Specifications for Logging and Recovery: moved to FT_Replica.idl
+ // Specifications for Replication Manager moved to FT_ReplicationManager.idl
+};
+
+
+#endif // for #ifndef _FT_IDL_
diff --git a/TAO/orbsvcs/orbsvcs/FT_CORBA_ORB.idl b/TAO/orbsvcs/orbsvcs/FT_CORBA_ORB.idl
new file mode 100644
index 00000000000..6503eb969a5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FT_CORBA_ORB.idl
@@ -0,0 +1,136 @@
+//$Id$
+#ifndef TAO_FT_CORBA_ORB_IDL
+#define TAO_FT_CORBA_ORB_IDL
+
+// Including the $TAO_ROOT/tao one so that we dont depend on the
+// Svc_Utils
+#include "tao/TimeBase.pidl" // 98-10.47.idl
+// Proprietary includes for TAO
+#include "tao/IOP.pidl" // from 98-03-01.idl
+#include "tao/GIOP.pidl" // from 98-03-01.idl
+#include "tao/Policy.pidl"
+
+#include "PortableGroup_Simple_DS.idl"
+
+
+#pragma prefix "omg.org"
+
+
+// These have been moved to the file IOP.pidl
+module FT
+{
+ /// FTDomainId's are denoted as strings
+ typedef PortableGroup::GroupDomainId FTDomainId;
+
+ /// The objectgroup id
+ typedef PortableGroup::ObjectGroupId ObjectGroupId;
+
+ /// The reference version of the object group
+ typedef PortableGroup::ObjectGroupRefVersion ObjectGroupRefVersion;
+
+ /**
+ * @struct TagFTGroupTaggedComponent
+ *
+ * @brief Contents of the Tagged_Component field with tag
+ * TAG_FT_GROUP
+ */
+ typedef PortableGroup::TagGroupTaggedComponent TagFTGroupTaggedComponent;
+
+ /**
+ * @struct TagFTPrinaryTaggedComponent
+ *
+ * @brief Contents of the Tagged_Component field with tag
+ * TAG_FT_PRIMARY
+ */
+ struct TagFTPrimaryTaggedComponent
+ {
+ boolean primary;
+ };
+
+ /**
+ * @struct FTGroupVersionServiceContext
+ *
+ * @brief Service Context list info for FT_GROUP_VERSION.
+ *
+ * It specifies the most recent Object Group Version
+ */
+ struct FTGroupVersionServiceContext
+ {
+ ObjectGroupRefVersion object_group_ref_version;
+ };
+
+ /**
+ * @struct FTRequestServiceContext
+ *
+ * @brief Service Context List information for FT_REQUEST
+ */
+
+ struct FTRequestServiceContext
+ {
+ string client_id;
+ long retention_id;
+ TimeBase::TimeT expiration_time;
+ };
+
+ /// Policy type for holding a request
+ const CORBA::PolicyType REQUEST_DURATION_POLICY = 47;
+
+ /**
+ * @interface RequestDurationPolicy
+ *
+ * @brief Policy specification for Request Duration policy
+ */
+ local interface RequestDurationPolicy : CORBA::Policy
+ {
+ readonly attribute TimeBase::TimeT request_duration_policy_value;
+ };
+
+ /// Policy types for HeartBeats
+ const CORBA::PolicyType HEARTBEAT_POLICY = 48;
+
+ /**
+ * @struct HeartbeatPolicyValue
+ *
+ * @brief HeartbeatPolicy's range for the client
+ */
+ struct HeartbeatPolicyValue {
+ boolean heartbeat;
+ TimeBase::TimeT heartbeat_interval;
+ TimeBase::TimeT heartbeat_timeout;
+ };
+
+ /**
+ * @interface HeartbeatPolicy
+ *
+ * @brief Policy specification for Heartbeats on the client side
+ */
+ local interface HeartbeatPolicy : CORBA::Policy {
+ readonly attribute HeartbeatPolicyValue heartbeat_policy_value;
+ };
+
+ /// Policy type to enable heartbeating
+ const CORBA::PolicyType HEARTBEAT_ENABLED_POLICY = 49;
+
+ /**
+ * @struct TagFTHeartbeatEnabledTaggedComponent
+ *
+ * @brief Tagged components for TAG_FT_HEARTBEAT_ENABLED
+ *
+ */
+ struct TagFTHeartbeatEnabledTaggedComponent
+ {
+ boolean heartbeat_enabled;
+ };
+
+ /**
+ * @interface HeartbeatEnabledPolicy
+ *
+ * @brief Policy values for heartbeatEnabledpolicy
+ *
+ */
+ local interface HeartbeatEnabledPolicy : CORBA::Policy {
+ readonly attribute boolean heartbeat_enabled_policy_value;
+ };
+
+};
+#endif /*TAO_FT_CORBA_ORB_IDL*/
diff --git a/TAO/orbsvcs/orbsvcs/FT_FaultDetectorFactory.idl b/TAO/orbsvcs/orbsvcs/FT_FaultDetectorFactory.idl
new file mode 100644
index 00000000000..b783eb46ace
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FT_FaultDetectorFactory.idl
@@ -0,0 +1,119 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file FT_FaultDetectorFactory.idl
+ *
+ * $Id$
+ *
+ * @author: Dale Wilson, OCI <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef _FT_DETECTOR_FACTORY_IDL_
+#define _FT_DETECTOR_FACTORY_IDL_
+
+// A TAO specific addition to FT_CORBA.
+// No interface was specified for the FaultDetector
+// in the FT CORBA specification, so we decided to
+// define a GenericFactory to create FaultDetectors and
+// control the FaultDetectors through the GenericFactory
+// interface (with extenstions.)
+
+#pragma prefix "omg.org"
+
+#include "orbsvcs/FT_CORBA.idl"
+#include "orbsvcs/FT_Replica.idl"
+#include "orbsvcs/PortableGroup.idl"
+
+module FT
+{
+ ///////////////////////////////////////////////////
+ // names for properties used in Fault Tolerant CORBA
+ /// TimeBase::TimeT how often to call is_alive();
+ const string FT_FAULT_MONITORING_INTERVAL = "MonitoringInterval";
+
+ /// FT::FaultNotifier where to send fault reports
+ const string FT_NOTIFIER = "Notifier";
+
+ /// FT::PullMonitorable the object to monitor
+ const string FT_MONITORABLE = "Monitorable";
+
+ ///////////////////////////////////////////
+ // Names specified in the FT CORBA specification
+
+ const string FT_EVENT_TYPE_DOMAIN = "FT_CORBA";
+ const string FT_EVENT_TYPE_NAME = "ObjectCrashFault";
+
+ /// FT::FTDomainId domain to report to notifier
+ const string FT_DOMAIN_ID = "FTDomainId";
+
+ /// FT::Location location to report to notifier
+ const string FT_LOCATION = "Location";
+
+ /// FT::TypeId type to report to notifier
+ const string FT_TYPE_ID = "TypeId";
+
+ /// FT::ObjectGroupId group to report to notifier
+ const string FT_GROUP_ID = "GroupId";
+
+ // end of names from FT CORBA specification
+ ///////////////////////////////////////////
+
+ /////////////////////////////
+ // RoleName FaultDetectorFactory uses to register
+ // with Factory Registery
+ const string FAULT_DETECTOR_ROLE_NAME = "FT_FaultDetector";
+
+ /**
+ * A FaultDetectorFactory creates and manages a set of FaultDetectors.
+ *
+ * A FaultDetectorFactory acts as an agent for a ReplicationManager
+ * which needs to create one or more FaultDetectors at a particular
+ * location.
+ *
+ * At present, FaultDetectors monitor via the is_alive() method of
+ * the PullMonitorable interface which must be implemented by the
+ * object-to-be-monitored. Other monitoring techniques may be
+ * supported in the future. In particular heartbeat/watchdog
+ * monitoring is anticipated.
+ *
+ * Notifications of failing objects are sent to a FaultNotifier
+ * which is responsible for distributing them to interested parties.
+ *
+ * The implementation of the GenericFactory::create_object method
+ * creates a FaultDetector object to monitor a single monitorable.
+ * The FaultDetector is *not* a first-class CORBA object. The
+ * Object reference returned by create_object will be nil. You
+ * cannot interact directly with a FaultDetector.
+ * The only interaction that a FaultDetector needs after it is
+ * started is to tell it to change it's monitoring parameters,
+ * or to shut down. The change_properties () and shutdown ()
+ * methods on the Factory provide the needed capabilities.
+ *
+ * The create_object requires the following criteria:
+ * FT::Notifier Notifier
+ * FT::PullMonitorable Monitorable
+ * PortableGroup::DomainId domain_id,
+ * PortableGroup::ObjectGroupId group_id,
+ * PortableGroup::Location object_location,
+ * PortableGroup::_TypeId object_type
+ */
+ interface FaultDetectorFactory : ::PortableGroup::GenericFactory, PullMonitorable
+ {
+ /**
+ * Adjust properties on-the-fly.
+ * Applies to all FaultDetectors created by this factory.
+ * @param property_set is a set of properties that (may) have new values.
+ */
+ void change_properties(in ::PortableGroup::Properties property_set)
+ raises (::PortableGroup::InvalidProperty);
+
+ /**
+ * Ask the Fault Detector Factory to come to an orderly end.
+ */
+ oneway void shutdown();
+ };
+};
+
+#endif // for #ifndef _FT_DETECTOR_FACTORY_IDL_
diff --git a/TAO/orbsvcs/orbsvcs/FT_Notifier.idl b/TAO/orbsvcs/orbsvcs/FT_Notifier.idl
new file mode 100644
index 00000000000..bb1d839f388
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FT_Notifier.idl
@@ -0,0 +1,62 @@
+/* -*- IDL -*- */
+//=============================================================================
+/**
+ * @file FT_Notifier.idl
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * This was original part of the OMG FT.idl file
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef _FT_NOTIFIER_IDL_
+#define _FT_NOTIFIER_IDL_
+
+///////////////////////////////
+// TAO specific includes
+#include "orbsvcs/FT_CORBA_ORB.idl"
+#include "orbsvcs/FT_Replica.idl"
+// end of TAO specific includes
+///////////////////////////////
+
+#include "orbsvcs/CosNaming.idl" // 98-10-19.idl
+#include "orbsvcs/CosNotification.idl" // from telecom/98-11-03.idl
+
+// added to OMG version:
+#include "orbsvcs/CosNotifyFilter.idl"
+
+#pragma prefix "omg.org"
+
+module FT
+{
+ // Specifications for Fault Management
+ // Specification of FaultNotifier Interface
+ // TAO SPECIFIC: added inheritence from PullMonitorable
+ interface FaultNotifier : ::FT::PullMonitorable
+ {
+ typedef unsigned long long ConsumerId;
+ void push_structured_fault( in CosNotification::StructuredEvent
+ event);
+ void push_sequence_fault( in CosNotification::EventBatch events);
+ CosNotifyFilter::Filter create_subscription_filter (in string
+ constraint_grammar)
+ raises (CosNotifyFilter::InvalidGrammar);
+ ConsumerId connect_structured_fault_consumer(in CosNotifyComm::StructuredPushConsumer push_consumer,
+ in CosNotifyFilter::Filter filter) ;
+
+ ConsumerId connect_sequence_fault_consumer(in
+ CosNotifyComm::SequencePushConsumer push_consumer,
+ in
+ CosNotifyFilter::Filter
+ filter);
+
+ void disconnect_consumer( in ConsumerId connection)
+ raises(CosEventComm::Disconnected);
+ };
+};
+
+
+#endif // for #ifndef _FT_NOTIFIER_IDL_
diff --git a/TAO/orbsvcs/orbsvcs/FT_Replica.idl b/TAO/orbsvcs/orbsvcs/FT_Replica.idl
new file mode 100644
index 00000000000..eb351729e6e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FT_Replica.idl
@@ -0,0 +1,51 @@
+//$Id$
+// FT_replica.idl
+#ifndef _FT_REPLICA_IDL_
+#define _FT_REPLICA_IDL_
+
+// The OMG FT file has been split into sevaral pieces. This is one of them.
+// It contains the interfaces that a typical FT Replica (replicated servant)
+// will need to implement.
+
+#include "FT_CORBA.idl" // common FT definitions
+
+#pragma prefix "omg.org"
+
+module FT
+{
+ // Specification of PullMonitorable Interface
+ // which Application Objects Inherit
+ interface PullMonitorable {
+ boolean is_alive();
+ };
+
+ // Specifications for Logging and Recovery
+ typedef sequence<octet> State;
+
+ exception NoStateAvailable {};
+ exception InvalidState {};
+
+ exception NoUpdateAvailable {};
+ exception InvalidUpdate {};
+
+ // Specification of Checkpointable Interface
+ // which Updateable and Application Objects Inherit
+ interface Checkpointable {
+ State get_state()
+ raises(NoStateAvailable);
+ void set_state(in State s)
+ raises(InvalidState);
+ };
+
+ // Specification of Updateable Interface
+ // which Application Objects Inherit
+ interface Updateable : Checkpointable
+ {
+ State get_update()
+ raises(NoUpdateAvailable);
+ void set_update(in State s)
+ raises(InvalidUpdate);
+ };
+};
+
+#endif // for #ifndef _FT_REPLICA_IDL_
diff --git a/TAO/orbsvcs/orbsvcs/FT_ReplicationManager.idl b/TAO/orbsvcs/orbsvcs/FT_ReplicationManager.idl
new file mode 100644
index 00000000000..8f36d6b135a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FT_ReplicationManager.idl
@@ -0,0 +1,75 @@
+/* -*- IDL -*- */
+//=============================================================================
+/**
+ * @file FT_ReplicationManager.idl
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * This was original part of the OMG FT.idl file
+ *
+ * @author Curt Hibbs <hibbs_c@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef _FT_REPLICATION_MANAGER_IDL_
+#define _FT_REPLICATION_MANAGER_IDL_
+
+#include "orbsvcs/PortableGroup.idl"
+#include "orbsvcs/FT_CORBA.idl"
+#include "orbsvcs/FT_Replica.idl"
+#include "orbsvcs/FT_Notifier.idl"
+
+#pragma prefix "omg.org"
+
+module FT
+{
+ exception InterfaceNotFound {};
+
+ // Specification of ReplicationManager Interface
+ interface ReplicationManager : ::PortableGroup::PropertyManager,
+ FTObjectGroupManager,
+ ::PortableGroup::GenericFactory
+ {
+
+ /**
+ * Registers the Fault Notifier with the Replication Manager.
+ * @param fault_notifier where to send the fault information.
+ */
+ void register_fault_notifier(in FaultNotifier fault_notifier);
+
+ /**
+ * Returns the reference of the Fault Notifier.
+ * @returns the reference of the Fault Notifier.
+ */
+ FaultNotifier get_fault_notifier()
+ raises (InterfaceNotFound);
+
+ /**
+ * Find a registry for factories that create fault tolerant replicas.
+ *
+ * TAO-specific operation
+ *
+ * Factories in this registry will be used by the
+ * ReplicationManager's implementation of
+ * GenericFactory::create_object when infrastructure controlled
+ * membership is specified.
+ *
+ * The factory registry may also be used by applications that
+ * control their own membership but don't wish to address the
+ * issue of finding factories for replicas.
+ *
+ * @param selection_criteria to be used to choose among alternate registries (future enhancement.)
+ * @returns an implementation of FactoryRegistry
+ */
+ ::PortableGroup::FactoryRegistry get_factory_registry (in ::PortableGroup::Criteria selection_criteria);
+
+ /**
+ * TAO-specific shutdown operation.
+ */
+ oneway void shutdown ();
+ };
+};
+
+
+#endif // _FT_REPLICATION_MANAGER_IDL_
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance.mpc b/TAO/orbsvcs/orbsvcs/FaultTolerance.mpc
new file mode 100644
index 00000000000..0b6911d2473
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance.mpc
@@ -0,0 +1,43 @@
+// -*- MPC -*-
+// $Id$
+
+project(FaultTolerance): orbsvcslib, core, pi, pi_server, notification, ftorb, portablegroup, minimum_corba, tao_versioning_idl_defaults {
+ sharedname = TAO_FaultTolerance
+ idlflags += -Wb,export_macro=TAO_FT_Export -Wb,export_include=orbsvcs/FaultTolerance/fault_tol_export.h -Wb,skel_export_include=tao/PortableServer/PolicyS.h
+ dynamicflags = TAO_FT_BUILD_DLL
+ tagchecks += FaultTolerance
+
+ IDL_Files {
+ FT_CORBA.idl
+ FT_Replica.idl
+ FT_Notifier.idl
+ FT_FaultDetectorFactory.idl
+ FT_ReplicationManager.idl
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ FaultTolerance {
+ FT_CORBAS.cpp
+ FT_CORBAC.cpp
+ FT_ReplicaS.cpp
+ FT_ReplicaC.cpp
+ FT_NotifierS.cpp
+ FT_NotifierC.cpp
+ FT_FaultDetectorFactoryS.cpp
+ FT_FaultDetectorFactoryC.cpp
+ FT_ReplicationManagerS.cpp
+ FT_ReplicationManagerC.cpp
+ }
+ }
+
+ Header_Files {
+ FaultTolerance/fault_tol_export.h
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_FaultTolerance.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance.rc b/TAO/orbsvcs/orbsvcs/FaultTolerance.rc
new file mode 100644
index 00000000000..afd9bd8826b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "FaultTolerance\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_FaultToleranceDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_FaultTolerance.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORBInitializer.cpp
new file mode 100644
index 00000000000..03d6f4a56b6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORBInitializer.cpp
@@ -0,0 +1,115 @@
+// $Id$
+
+#include "orbsvcs/FaultTolerance/FT_ClientORBInitializer.h"
+#include "orbsvcs/FaultTolerance/FT_ClientPolicyFactory.h"
+#include "orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "tao/Exception.h"
+#include "tao/ORB_Constants.h"
+
+ACE_RCSID (FaultTolerance,
+ FT_ClientORBInitializer,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void
+TAO_FT_ClientORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_FT_ClientORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->register_policy_factories (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+
+ this->register_client_request_interceptors (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+
+
+}
+
+void
+TAO_FT_ClientORBInitializer::register_policy_factories (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Register the FTCORBA policy factories.
+
+ PortableInterceptor::PolicyFactory_ptr temp_factory =
+ PortableInterceptor::PolicyFactory::_nil ();
+ PortableInterceptor::PolicyFactory_var policy_factory;
+
+ // This policy factory is used for all FTCORBA related policies.
+
+ ACE_NEW_THROW_EX (temp_factory,
+ TAO_FT_ClientPolicyFactory,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ policy_factory = temp_factory;
+
+ // Bind the same policy factory to all RTCORBA related policy
+ // types since a single policy factory is used to create each of
+ // the different types of RTCORBA policies.
+
+ CORBA::PolicyType type = FT::REQUEST_DURATION_POLICY;
+ info->register_policy_factory (type,
+ policy_factory.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ type = FT::HEARTBEAT_POLICY;
+ info->register_policy_factory (type,
+ policy_factory.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ /*
+ type = FT::HEARTBEAT_ENABLED_POLICY;
+ info->register_policy_factory (type,
+ policy_factory.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ */
+}
+
+
+void
+TAO_FT_ClientORBInitializer::register_client_request_interceptors (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableInterceptor::ClientRequestInterceptor_ptr cri =
+ PortableInterceptor::ClientRequestInterceptor::_nil ();
+
+ ACE_NEW_THROW_EX (cri,
+ TAO::FT_ClientRequest_Interceptor,
+ CORBA::NO_MEMORY ());
+
+ PortableInterceptor::ClientRequestInterceptor_var
+ client_interceptor = cri;
+
+ info->add_client_request_interceptor (client_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORBInitializer.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORBInitializer.h
new file mode 100755
index 00000000000..c0383c99cbc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORBInitializer.h
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_ClientORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+#ifndef TAO_FT_CLIENTORB_INITIALIZER_H
+#define TAO_FT_CLIENTORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/PI/PI.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+#include "orbsvcs/FaultTolerance/FT_ClientORB_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// FT ORB initializer.
+class TAO_FT_ClientORBInitializer
+ : 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 FTCORBA policy factories.
+ void register_policy_factories (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Register the necessary interceptors.
+ void register_client_request_interceptors (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_FT_ORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORB_export.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORB_export.h
new file mode 100644
index 00000000000..37769e226ad
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientORB_export.h
@@ -0,0 +1,60 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TAO_FT_ClientORB
+// ------------------------------
+#ifndef TAO_FT_CLIENTORB_EXPORT_H
+#define TAO_FT_CLIENTORB_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_FT_CLIENTORB_HAS_DLL)
+# define TAO_FT_CLIENTORB_HAS_DLL 0
+# endif /* ! TAO_FT_CLIENTORB_HAS_DLL */
+#else
+# if !defined (TAO_FT_CLIENTORB_HAS_DLL)
+# define TAO_FT_CLIENTORB_HAS_DLL 1
+# endif /* ! TAO_FT_CLIENTORB_HAS_DLL */
+#endif
+
+#if defined (TAO_FT_CLIENTORB_HAS_DLL) && (TAO_FT_CLIENTORB_HAS_DLL == 1)
+# if defined (TAO_FT_CLIENTORB_BUILD_DLL)
+# define TAO_FT_ClientORB_Export ACE_Proper_Export_Flag
+# define TAO_FT_CLIENTORB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_FT_CLIENTORB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_FT_CLIENTORB_BUILD_DLL */
+# define TAO_FT_ClientORB_Export ACE_Proper_Import_Flag
+# define TAO_FT_CLIENTORB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_FT_CLIENTORB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_FT_CLIENTORB_BUILD_DLL */
+#else /* TAO_FT_CLIENTORB_HAS_DLL == 1 */
+# define TAO_FT_ClientORB_Export
+# define TAO_FT_CLIENTORB_SINGLETON_DECLARATION(T)
+# define TAO_FT_CLIENTORB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_FT_CLIENTORB_HAS_DLL == 1 */
+
+// Set TAO_FT_CLIENTORB_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TAO_FT_CLIENTORB_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TAO_FT_CLIENTORB_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TAO_FT_CLIENTORB_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TAO_FT_CLIENTORB_NTRACE */
+
+#if (TAO_FT_CLIENTORB_NTRACE == 1)
+# define TAO_FT_CLIENTORB_TRACE(X)
+#else /* (TAO_FT_CLIENTORB_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define TAO_FT_CLIENTORB_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (TAO_FT_CLIENTORB_NTRACE == 1) */
+
+#endif /* TAO_FT_CLIENTORB_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicyFactory.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicyFactory.cpp
new file mode 100755
index 00000000000..852e1c2c97b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicyFactory.cpp
@@ -0,0 +1,34 @@
+// $Id$
+
+#include "orbsvcs/FaultTolerance/FT_ClientPolicyFactory.h"
+#include "orbsvcs/FaultTolerance/FT_ClientPolicy_i.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "tao/PolicyC.h"
+
+ACE_RCSID (FaultTolerance,
+ FT_ClientPolicyFactory,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+CORBA::Policy_ptr
+TAO_FT_ClientPolicyFactory::create_policy (
+ CORBA::PolicyType type,
+ const CORBA::Any &val
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CORBA::PolicyError))
+{
+
+ if (type == FT::REQUEST_DURATION_POLICY)
+ return TAO_FT_Request_Duration_Policy::create (val
+ ACE_ENV_ARG_PARAMETER);
+ else if (type == FT::HEARTBEAT_POLICY)
+ return TAO_FT_Heart_Beat_Policy::create (val
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicyFactory.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicyFactory.h
new file mode 100755
index 00000000000..7ee620338b9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicyFactory.h
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_ClientPolicyFactory.h
+ *
+ * $Id$
+ *
+ * @author Bala Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_FT_CLIENTPOLICY_FACTORY_H
+#define TAO_FT_CLIENTPOLICY_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/PI/PI.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.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 */
+
+#include "orbsvcs/FaultTolerance/FT_ClientORB_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Policy factory for all FTCORBA related policies.
+class TAO_FT_ClientPolicyFactory
+ : public PortableInterceptor::PolicyFactory
+ , public TAO_Local_RefCounted_Object
+{
+public:
+
+ virtual CORBA::Policy_ptr create_policy (CORBA::PolicyType type,
+ const CORBA::Any &value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CORBA::PolicyError));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_FT_CLIENTPOLICY_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicy_i.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicy_i.cpp
new file mode 100755
index 00000000000..b53265cbfa5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicy_i.cpp
@@ -0,0 +1,193 @@
+//$Id$
+#include "orbsvcs/FaultTolerance/FT_ClientPolicy_i.h"
+
+#include "tao/debug.h"
+#include "ace/Log_Msg.h"
+#include "tao/ORB_Constants.h"
+#include "tao/AnyTypeCode/Any.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/FaultTolerance/FT_ClientPolicy_i.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(FaultTolerance, FT_ClientPolicy_i, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TimeBase::TimeT
+TAO_FT_Request_Duration_Policy::request_duration_policy_value (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->request_duration_;
+}
+
+CORBA::PolicyType
+TAO_FT_Request_Duration_Policy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return FT::REQUEST_DURATION_POLICY;
+}
+
+CORBA::Policy_ptr
+TAO_FT_Request_Duration_Policy::create (const CORBA::Any& val
+ ACE_ENV_ARG_DECL)
+{
+ TimeBase::TimeT value;
+ if ((val >>= value) == 0)
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_VALUE),
+ CORBA::Policy::_nil ());
+
+ TAO_FT_Request_Duration_Policy *tmp = 0;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_FT_Request_Duration_Policy (value),
+ CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
+TAO_FT_Request_Duration_Policy *
+TAO_FT_Request_Duration_Policy::clone (void) const
+{
+ TAO_FT_Request_Duration_Policy *copy = 0;
+ ACE_NEW_RETURN (copy,
+ TAO_FT_Request_Duration_Policy (*this),
+ 0);
+ return copy;
+}
+
+CORBA::Policy_ptr
+TAO_FT_Request_Duration_Policy::copy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_FT_Request_Duration_Policy* tmp = 0;
+ ACE_NEW_THROW_EX (tmp, TAO_FT_Request_Duration_Policy (*this),
+ CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
+void
+TAO_FT_Request_Duration_Policy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_FT_Request_Duration_Policy::set_time_value (ACE_Time_Value &time_value)
+{
+ TimeBase::TimeT t = this->request_duration_;
+ TimeBase::TimeT seconds = t / 10000000u;
+ TimeBase::TimeT microseconds = (t % 10000000u) / 10;
+ time_value.set (ACE_U64_TO_U32 (seconds),
+ ACE_U64_TO_U32 (microseconds));
+
+ if (TAO_debug_level > 0)
+ {
+ CORBA::ULong msecs =
+ static_cast<CORBA::ULong> (microseconds / 1000);
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO_FT (%P|%t) - Timeout is <%u>\n"),
+ msecs));
+ }
+}
+
+
+/*****************************************************************/
+
+FT::HeartbeatPolicyValue
+TAO_FT_Heart_Beat_Policy::heartbeat_policy_value (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ FT::HeartbeatPolicyValue val;
+ val.heartbeat = this->heartbeat_;
+ val.heartbeat_interval = this->heartbeat_interval_;
+ val.heartbeat_timeout = this->heartbeat_timeout_;
+
+ return val;
+}
+
+
+CORBA::Policy_ptr
+TAO_FT_Heart_Beat_Policy::create (const CORBA::Any& val
+ ACE_ENV_ARG_DECL)
+{
+ FT::HeartbeatPolicyValue *value = 0;
+ if ((val >>= value) == 0)
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_VALUE),
+ CORBA::Policy::_nil ());
+
+ TAO_FT_Heart_Beat_Policy *tmp = 0;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_FT_Heart_Beat_Policy (value->heartbeat,
+ value->heartbeat_interval,
+ value->heartbeat_timeout),
+ CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
+
+CORBA::PolicyType
+TAO_FT_Heart_Beat_Policy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return FT::HEARTBEAT_POLICY;
+}
+
+
+CORBA::Policy_ptr
+TAO_FT_Heart_Beat_Policy::copy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_FT_Heart_Beat_Policy * tmp = 0;
+ ACE_NEW_THROW_EX (tmp, TAO_FT_Heart_Beat_Policy (*this),
+ CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
+TAO_FT_Heart_Beat_Policy *
+TAO_FT_Heart_Beat_Policy::clone (void) const
+{
+ TAO_FT_Heart_Beat_Policy *copy = 0;
+ ACE_NEW_RETURN (copy,
+ TAO_FT_Heart_Beat_Policy (*this),
+ 0);
+ return copy;
+}
+
+void
+TAO_FT_Heart_Beat_Policy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_FT_Heart_Beat_Policy::set_time_value (ACE_Time_Value &time_value,
+ const TimeBase::TimeT &timebase)
+{
+ TimeBase::TimeT t = timebase;
+ TimeBase::TimeT seconds = t / 10000000u;
+ TimeBase::TimeT microseconds = (t % 10000000u) / 10;
+ time_value.set (ACE_U64_TO_U32 (seconds),
+ ACE_U64_TO_U32 (microseconds));
+
+ if (TAO_debug_level > 0)
+ {
+ CORBA::ULong msecs =
+ static_cast<CORBA::ULong> (microseconds / 1000);
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO_FT (%P|%t) - Timeout is <%u>\n"),
+ msecs));
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicy_i.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicy_i.h
new file mode 100755
index 00000000000..a1bbf81174e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicy_i.h
@@ -0,0 +1,165 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_ClientPolicy_i.h
+ *
+ * $Id$
+ *
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_FT_CLIENTPOLICY_I_H
+#define TAO_FT_CLIENTPOLICY_I_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FT_CORBA_ORBC.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+#include "tao/LocalObject.h"
+#include "orbsvcs/FaultTolerance/FT_ClientORB_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_FT_Request_Duration_Policy
+ *
+ * @brief FT::RequestDurationPolicy implementation
+ *
+ * This policy controls the request duration in the ORB. The
+ * semantics are like this. On the server side, the server should
+ * retain the details of the request from the client (and the
+ * reply sent to it too) atleast for the time period specified by
+ * this policy value. On the client side, the client uses this
+ * value to calculate the expiration_id in the RequestService
+ * context. The expiration_id is a sort of timeout for the client
+ * to keep trying to connect to server object groups under certain
+ * conditions.
+ */
+class TAO_FT_Request_Duration_Policy
+ : public FT::RequestDurationPolicy,
+ public TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ TAO_FT_Request_Duration_Policy (const TimeBase::TimeT& relative_expiry);
+
+ /// Copy constructor.
+ TAO_FT_Request_Duration_Policy (const TAO_FT_Request_Duration_Policy &rhs);
+
+ /// Helper method for the implementation of
+ /// CORBA::ORB::create_policy.
+ static CORBA::Policy_ptr create (const CORBA::Any& val
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Returns a copy of <this>.
+ virtual TAO_FT_Request_Duration_Policy *clone (void) const;
+
+ // = The FT::RequestDurationPolicy methods
+ virtual TimeBase::TimeT request_duration_policy_value (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::PolicyType policy_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Policy_ptr copy (
+ 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));
+
+ /// Change the CORBA representation to the ACE representation.
+ void set_time_value (ACE_Time_Value &time_value);
+
+private:
+ /// The attribute
+ TimeBase::TimeT request_duration_;
+};
+
+
+/**
+ * @class TAO_FT_Heart_Beat_Policy
+ *
+ * @brief FT::HeartBeatPolicy
+ *
+ * If this policy is set, it enables the client ORB to send
+ * heartbeats to the server ORB over the open connections.
+ */
+class TAO_FT_Heart_Beat_Policy
+ : public FT::HeartbeatPolicy,
+ public TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ TAO_FT_Heart_Beat_Policy (const CORBA::Boolean boolean,
+ const TimeBase::TimeT &interval,
+ const TimeBase::TimeT &timeout);
+
+ /// Copy constructor.
+ TAO_FT_Heart_Beat_Policy (const TAO_FT_Heart_Beat_Policy &rhs);
+
+ /// Helper method for the implementation of
+ /// CORBA::ORB::create_policy.
+ static CORBA::Policy_ptr create (const CORBA::Any& val
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Returns a copy of <this>.
+ virtual TAO_FT_Heart_Beat_Policy *clone (void) const;
+
+ // = The FT::HeartBeatPolicy methods
+ virtual FT::HeartbeatPolicyValue heartbeat_policy_value (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::PolicyType policy_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Policy_ptr copy (
+ 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));
+
+ /// Change the CORBA representation to the ACE representation.
+ void set_time_value (ACE_Time_Value &time_value,
+ const TimeBase::TimeT &timebase);
+
+private:
+
+ // The attributes
+ /// <heartbeat_> indicates whether heartbeating is enabled or not.
+ CORBA::Boolean heartbeat_;
+
+ /// Intervals in which heartbeat messages need to be sent
+ TimeBase::TimeT heartbeat_interval_;
+
+ /// The timeouts for the heartbeats
+ TimeBase::TimeT heartbeat_timeout_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/FaultTolerance/FT_ClientPolicy_i.inl"
+#endif /* __ACE_INLINE__ */
+
+
+#include /**/ "ace/post.h"
+#endif /* TAO_FT_CLIENTPOLICY_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicy_i.inl b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicy_i.inl
new file mode 100755
index 00000000000..637356ff8ec
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientPolicy_i.inl
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+//
+//$Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_FT_Request_Duration_Policy::TAO_FT_Request_Duration_Policy (
+ const TimeBase::TimeT &duration
+ )
+ : request_duration_ (duration)
+{
+}
+
+ACE_INLINE
+TAO_FT_Request_Duration_Policy::TAO_FT_Request_Duration_Policy (
+ const TAO_FT_Request_Duration_Policy &rhs
+ )
+ : CORBA::Object (),
+ CORBA::Policy (),
+ CORBA::LocalObject (),
+ FT::RequestDurationPolicy (),
+ TAO_Local_RefCounted_Object (),
+ request_duration_ (rhs.request_duration_)
+{
+}
+
+ACE_INLINE
+TAO_FT_Heart_Beat_Policy::TAO_FT_Heart_Beat_Policy (
+ const CORBA::Boolean heartbeat,
+ const TimeBase::TimeT &interval,
+ const TimeBase::TimeT &timeout
+ )
+ : heartbeat_ (heartbeat),
+ heartbeat_interval_ (interval),
+ heartbeat_timeout_ (timeout)
+{
+}
+
+ACE_INLINE
+TAO_FT_Heart_Beat_Policy::TAO_FT_Heart_Beat_Policy (
+ const TAO_FT_Heart_Beat_Policy &rhs
+ )
+ : CORBA::Object (),
+ CORBA::Policy (),
+ CORBA::LocalObject (),
+ FT::HeartbeatPolicy (),
+ TAO_Local_RefCounted_Object (),
+ heartbeat_ (rhs.heartbeat_),
+ heartbeat_interval_ (rhs.heartbeat_interval_),
+ heartbeat_timeout_ (rhs.heartbeat_timeout_)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.cpp
new file mode 100644
index 00000000000..ad331580af6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.cpp
@@ -0,0 +1,441 @@
+// $Id$
+
+#include "orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.h"
+#include "orbsvcs/FaultTolerance/FT_Service_Callbacks.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+
+#include "tao/CORBA_String.h"
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+#include "tao/CDR.h"
+#include "tao/PI/ClientRequestInfo.h"
+
+#include "ace/UUID.h"
+#include "ace/Lock_Adapter_T.h"
+#include "ace/Lock.h"
+#include "ace/Synch_Traits.h"
+
+ACE_RCSID (FaultTolerance,
+ FT_ORBInitializer,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ FT_ClientRequest_Interceptor::FT_ClientRequest_Interceptor (void)
+ : name_ ("TAO_FT_ClientRequest_Interceptor")
+ , uuid_ (0)
+ , lock_ (0)
+ , retention_id_ (0)
+ {
+ ACE_Utils::UUID_GENERATOR::instance ()->init ();
+
+ this->uuid_ =
+ ACE_Utils::UUID_GENERATOR::instance ()->generateUUID ();
+
+ // Would be nice to have runtime option.
+ ACE_NEW (this->lock_,
+ ACE_Lock_Adapter<ACE_SYNCH_MUTEX>);
+
+ }
+
+ FT_ClientRequest_Interceptor::~FT_ClientRequest_Interceptor (void)
+ {
+ delete this->uuid_;
+ delete this->lock_;
+ }
+
+ char *
+ FT_ClientRequest_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ return CORBA::string_dup (this->name_);
+ }
+
+ void
+ FT_ClientRequest_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ }
+
+ void
+ FT_ClientRequest_Interceptor::send_poll (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ // Do Nothing
+ }
+
+ void
+ FT_ClientRequest_Interceptor::send_request (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+ {
+ if (TAO_debug_level > 3)
+ {
+ CORBA::String_var op =
+ ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO_FT (%P|%t) - %s called for %s\n"),
+ this->name_,
+ op.in ()));
+ }
+
+ this->group_version_context (ri
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->request_service_context (ri
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ void
+ FT_ClientRequest_Interceptor::receive_reply (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ }
+
+ void
+ FT_ClientRequest_Interceptor::receive_other (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+ {
+ TAO_ClientRequestInfo* tao_ri = dynamic_cast<TAO_ClientRequestInfo*> (ri);
+
+ if (!tao_ri)
+ {
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ TimeBase::TimeT expires = tao_ri->tao_ft_expiration_time ();
+
+ if (!expires)
+ {
+ // Not an FT request
+ return;
+ }
+
+ PortableInterceptor::ReplyStatus status = -1;
+
+ ACE_TRY
+ {
+ status = ri->reply_status(ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ ACE_CATCHANY
+ {
+ // No reply status => Not a location forward.
+ return;
+ }
+ ACE_ENDTRY;
+
+ if (status == PortableInterceptor::LOCATION_FORWARD)
+ {
+ // We are in an FT request and a location forward has been received.
+
+ if (expires < TAO_FT_Service_Callbacks::now ())
+ {
+ // The request has already expired...
+
+ if (TAO_debug_level > 3)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_FT (%P|%t): FT_ClientRequest_Interceptor::receive_other - LOCATION_FORWARD received after request expiration.\n"));
+ }
+
+ // The spec says throw a SYSTEM_EXCEPTION, but doesn't specify which one.
+ // I think a TRANSIENT is the most suitable.
+ ACE_THROW (CORBA::TRANSIENT (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_INVOCATION_LOCATION_FORWARD_MINOR_CODE,
+ errno),
+ CORBA::COMPLETED_NO));
+ }
+ }
+ }
+
+ void
+ FT_ClientRequest_Interceptor::receive_exception (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+ {
+#if 0
+ // @@ Will be used later.
+ // Do a check for policy in which this can be done..
+ PortableInterceptor::ReplyStatus rs =
+ ri->reply_status (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (rs != PortableInterceptor::SYSTEM_EXCEPTION)
+ {
+ return;
+ }
+
+ CORBA::Any_var ex =
+ ri->received_exception (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_OutputCDR cdr;
+
+ if (!ex->impl ()->marshal_value (cdr))
+ return;
+
+ // Place for optimization..
+ TAO_InputCDR icdr (cdr);
+
+ CORBA::String_var rep_id;
+
+ CORBA::ULong min, cs = 0;
+
+ if (!(icdr.read_string (rep_id.out ()) &&
+ icdr.read_ulong (min) &&
+ icdr.read_ulong (cs)))
+ ACE_THROW (CORBA::MARSHAL (TAO::VMCID,
+ CORBA::COMPLETED_MAYBE));
+
+ cs = CORBA::CompletionStatus (cs);
+
+ // ORB would take care of it
+ if (cs != CORBA::COMPLETED_MAYBE)
+ return;
+
+ // If it is COMPLETED_MAYBE, then we will throw a COMPLETED_NO,
+ // which the ORB should understand
+ if (ACE_OS_String::strcmp (rep_id.in (),
+ "IDL:omg.org/CORBA/TRANSIENT:1.0") == 0)
+ ACE_THROW (CORBA::TRANSIENT (min,
+ CORBA::COMPLETED_NO));
+ else if (ACE_OS_String::strcmp (rep_id.in (),
+ "IDL:omg.org/CORBA/COMM_FAILURE:1.0") == 0)
+ ACE_THROW (CORBA::COMM_FAILURE (min,
+ CORBA::COMPLETED_NO));
+ else if (ACE_OS_String::strcmp (rep_id.in (),
+ "IDL:omg.org/CORBA/NO_REPONSE:1.0") == 0)
+ ACE_THROW (CORBA::NO_RESPONSE (min,
+ CORBA::COMPLETED_NO));
+
+ else if (ACE_OS_String::strcmp (rep_id.in (),
+ "IDL:omg.org/CORBA/OBJ_ADAPTER:1.0") == 0)
+ ACE_THROW (CORBA::OBJ_ADAPTER (min,
+ CORBA::COMPLETED_NO));
+ cout << "Didnt throw exception " << endl;
+#endif /*if 0*/
+ return;
+ }
+
+
+ void
+ FT_ClientRequest_Interceptor::group_version_context (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_TRY
+ {
+ IOP::TaggedComponent_var tp =
+ ri->get_effective_component (IOP::TAG_FT_GROUP
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Grab the object group version
+ // @@ NOTE: This involves an allocation and a dellocation. This is
+ // really bad.
+ TAO_InputCDR cdr (reinterpret_cast<const char*> (tp->component_data.get_buffer ()),
+ tp->component_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 gtc;
+
+ if ((cdr >> gtc) == 0)
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28,
+ CORBA::COMPLETED_NO));
+
+ IOP::ServiceContext sc;
+ sc.context_id = IOP::FT_GROUP_VERSION;
+
+ TAO_OutputCDR ocdr;
+ if (!(ocdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)))
+ return;
+ //ACE_THROW (CORBA::MARSHAL ());
+
+ if (!(ocdr << gtc.object_group_ref_version))
+ return;
+ //ACE_THROW (CORBA::MARSHAL ());
+
+ CORBA::ULong length =
+ static_cast<CORBA::ULong> (ocdr.total_length ());
+ sc.context_data.length (length);
+ CORBA::Octet *buf = sc.context_data.get_buffer ();
+
+ for (const ACE_Message_Block *i = ocdr.begin ();
+ i != 0;
+ i = i->cont ())
+ {
+ ACE_OS::memcpy (buf, i->rd_ptr (), i->length ());
+ buf += i->length ();
+ }
+
+ // Add this context to the service context list.
+ ri->add_request_service_context (sc,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ // Not much can be done anyway. Just keep quiet
+ // ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ return;
+ }
+
+ void
+ FT_ClientRequest_Interceptor::request_service_context (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_TRY
+ {
+ IOP::ServiceContext sc;
+ sc.context_id = IOP::FT_REQUEST;
+
+ CORBA::Policy_var policy =
+ ri->get_request_policy (FT::REQUEST_DURATION_POLICY
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ FT::FTRequestServiceContext ftrsc;
+ ftrsc.client_id =
+ CORBA::string_dup (this->uuid_->to_string ()->c_str ());
+
+ TAO_ClientRequestInfo* tao_ri = dynamic_cast<TAO_ClientRequestInfo*> (ri);
+
+ if (!tao_ri)
+ {
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ if (tao_ri->tao_ft_expiration_time ())
+ {
+ ftrsc.retention_id = tao_ri->tao_ft_retention_id ();
+ ftrsc.expiration_time = tao_ri->tao_ft_expiration_time ();
+ }
+ else
+ {
+ ACE_GUARD (ACE_Lock,
+ guard,
+ *this->lock_);
+
+ ftrsc.retention_id = ++this->retention_id_;
+ ftrsc.expiration_time =
+ this->request_expiration_time (policy.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ tao_ri->tao_ft_retention_id (ftrsc.retention_id);
+ tao_ri->tao_ft_expiration_time (ftrsc.expiration_time);
+ }
+
+ TAO_OutputCDR ocdr;
+ if (!(ocdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)))
+ return;
+ //ACE_THROW (CORBA::MARSHAL ());
+
+ if (!(ocdr << ftrsc))
+ return;
+ // ACE_THROW (CORBA::MARSHAL ());
+
+ // Make a *copy* of the CDR stream...
+ CORBA::ULong length =
+ static_cast<CORBA::ULong> (ocdr.total_length ());
+ sc.context_data.length (length);
+ CORBA::Octet *buf = sc.context_data.get_buffer ();
+
+ for (const ACE_Message_Block *i = ocdr.begin ();
+ i != 0;
+ i = i->cont ())
+ {
+ ACE_OS::memcpy (buf, i->rd_ptr (), i->length ());
+ buf += i->length ();
+ }
+
+ // Add this context to the service context list.
+ ri->add_request_service_context (sc,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ return;
+ }
+
+ TimeBase::TimeT
+ FT_ClientRequest_Interceptor::request_expiration_time (
+ CORBA::Policy *policy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ FT::RequestDurationPolicy_var p;
+
+ if (policy != 0)
+ {
+ p = FT::RequestDurationPolicy::_narrow (policy
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ TimeBase::TimeT t = 0;
+
+ if (p.in ())
+ {
+ t =
+ p->request_duration_policy_value (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ else
+ {
+ if (TAO_debug_level > 3)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO_FT (%P|%t) - Using default value")
+ ACE_TEXT ("of 1.5 seconds\n")));
+ }
+ t = 15 * 1000000;
+ }
+
+ // Calculaton of the expiration time
+ t += TAO_FT_Service_Callbacks::now ();
+
+ return t;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.h
new file mode 100644
index 00000000000..c4115555085
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.h
@@ -0,0 +1,150 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_ClientRequest_Interceptor.h
+ *
+ * $Id$
+ *
+ * @author Balachandran Natarajan <bala@dre.vanderbilt.edu>
+ */
+//=============================================================================
+#ifndef TAO_FT_CLIENT_REQUEST_INTERCEPTOR_H
+#define TAO_FT_CLIENT_REQUEST_INTERCEPTOR_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FaultTolerance/FT_ClientORB_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PI/PI.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+#include "tao/TimeBaseC.h"
+#include "ace/Singleton.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 */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+namespace ACE_Utils
+{
+ class UUID;
+}
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ /**
+ * @class FT_TSS
+ *
+ * @brief Request service context generator class for the client.
+ *
+ * @@TODO Need to see whether we can have seperate resource factory
+ * and put this there. Let us get this going first
+ */
+ class FT_TSS
+ {
+ public:
+ CORBA::Long retention_id_;
+
+ bool clean_flag_;
+ };
+
+
+ /**
+ * @class FT_ClientRequest_Interceptor
+ *
+ * @brief Interceptors for the client
+ *
+ * @@TODO
+ */
+ class FT_ClientRequest_Interceptor
+ : public virtual PortableInterceptor::ClientRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+
+ FT_ClientRequest_Interceptor (void);
+
+ /// Canonical name of the interceptor.
+ 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 send_poll (PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ protected:
+
+ ~FT_ClientRequest_Interceptor (void);
+
+ private:
+
+ void group_version_context (PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void request_service_context (PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ TimeBase::TimeT request_expiration_time (CORBA::Policy *policy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ private:
+
+ /// Name of the interceptor
+ const char *name_;
+
+ /// UUID for this client
+ ACE_Utils::UUID *uuid_;
+
+ /// @@ Need a resource factory for this too
+ ACE_Lock *lock_;
+
+ /// Retention id generated by the client
+ CORBA::Long retention_id_;
+ };
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /*TAO_FT_CLIENT_REQUEST_INTERCEPTOR_H*/
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientService_Activate.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientService_Activate.cpp
new file mode 100755
index 00000000000..7adfd628330
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientService_Activate.cpp
@@ -0,0 +1,81 @@
+#include "orbsvcs/FaultTolerance/FT_ClientService_Activate.h"
+#include "orbsvcs/FaultTolerance/FT_Service_Callbacks.h"
+#include "orbsvcs/FaultTolerance/FT_ClientORBInitializer.h"
+#include "orbsvcs/FaultTolerance/FT_Endpoint_Selector_Factory.h"
+#include "tao/ORB_Core.h"
+#include "tao/Service_Callbacks.h"
+#include "tao/ORBInitializer_Registry.h"
+#include "ace/Dynamic_Service.h"
+
+ACE_RCSID(FaultTolerance, FT_ClientService_Activate, "$Id$")
+
+static bool initialized = false;
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_FT_ClientService_Activate::TAO_FT_ClientService_Activate (void)
+{
+}
+
+TAO_FT_ClientService_Activate::~TAO_FT_ClientService_Activate (void)
+{
+}
+
+
+TAO_Service_Callbacks *
+TAO_FT_ClientService_Activate::activate_services (TAO_ORB_Core *orb_core)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_FT_Service_Callbacks *ft_service_callback = 0;
+
+ // Construct service callback object
+ ACE_NEW_RETURN (ft_service_callback,
+ TAO_FT_Service_Callbacks (orb_core),
+ 0);
+
+
+ return ft_service_callback;
+}
+
+
+int
+TAO_FT_ClientService_Activate::Initializer (void)
+{
+ if (initialized == false)
+ {
+ ACE_Service_Config::static_svcs ()->
+ insert (&ace_svc_desc_TAO_FT_ClientService_Activate);
+
+ PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
+ PortableInterceptor::ORBInitializer::_nil ();
+ PortableInterceptor::ORBInitializer_var orb_initializer;
+
+ // Register the RTCORBA ORBInitializer.
+ ACE_NEW_RETURN (temp_orb_initializer,
+ TAO_FT_ClientORBInitializer,
+ -1);
+
+ orb_initializer = temp_orb_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+
+ // Set the name of the endpoint selector factory
+ TAO_ORB_Core::set_endpoint_selector_factory ("FT_Endpoint_Selector_Factory");
+ ACE_Service_Config::process_directive (ace_svc_desc_TAO_FT_Endpoint_Selector_Factory);
+
+ initialized = true;
+ }
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_FT_ClientORB,TAO_FT_ClientService_Activate)
+
+ACE_STATIC_SVC_DEFINE (TAO_FT_ClientService_Activate,
+ ACE_TEXT ("FT_ClientService_Activate"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_FT_ClientService_Activate),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientService_Activate.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientService_Activate.h
new file mode 100755
index 00000000000..c6b8c863e6f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientService_Activate.h
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_ClientService_Activate.h
+ *
+ * $Id$
+ *
+ * A concrete implementation of a service callback
+ *
+ * @author Bala Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_FT_CLIENTACTIVATE_H
+#define TAO_FT_CLIENTACTIVATE_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FaultTolerance/FT_ClientORB_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Services_Activate.h"
+#include "ace/Service_Config.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Service_Callbacks;
+
+// Forward declarations
+/**
+ * @class TAO_FT_ClientService_Activate
+ *
+ * @brief A class to dynamically load the FT callback implementations in
+ * to the ORB.
+ *
+ * An implementation of the service callbacks that allows the
+ * loading of the FT ORB level library in to the ORB
+ */
+class TAO_FT_ClientORB_Export TAO_FT_ClientService_Activate : public TAO_Services_Activate
+{
+
+public:
+ /// Constructor
+ TAO_FT_ClientService_Activate (void);
+
+ /// The destructor
+ virtual ~TAO_FT_ClientService_Activate (void);
+
+ /**
+ * Create and activate the service callbacks into the orb.
+ * This method cannot throw any exception, but it can return a nil
+ * object to indicate an error condition.
+ */
+ virtual TAO_Service_Callbacks *activate_services (TAO_ORB_Core *orb)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Used to force the initialization.
+ static int Initializer (void);
+};
+
+static int
+TAO_FT_Requires_ClientService_Activate = TAO_FT_ClientService_Activate::Initializer ();
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (TAO_FT_ClientService_Activate)
+ACE_FACTORY_DECLARE (TAO_FT_ClientORB, TAO_FT_ClientService_Activate)
+
+#include /**/ "ace/post.h"
+#endif /*TAO_FT_CLIENTACTIVATE_H*/
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Endpoint_Selector_Factory.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Endpoint_Selector_Factory.cpp
new file mode 100644
index 00000000000..280b95cab98
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Endpoint_Selector_Factory.cpp
@@ -0,0 +1,60 @@
+// $Id$
+
+#include "orbsvcs/FaultTolerance/FT_Endpoint_Selector_Factory.h"
+#include "orbsvcs/FaultTolerance/FT_Invocation_Endpoint_Selectors.h"
+#include "tao/SystemException.h"
+#include "tao/Environment.h"
+
+
+ACE_RCSID (FaultTolerance,
+ FT_Endpoint_Selector_Factory,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_FT_Endpoint_Selector_Factory::TAO_FT_Endpoint_Selector_Factory (void)
+ : ft_endpoint_selector_ (0)
+{
+}
+
+TAO_FT_Endpoint_Selector_Factory::~TAO_FT_Endpoint_Selector_Factory (void)
+{
+ delete this->ft_endpoint_selector_;
+}
+
+
+TAO_Invocation_Endpoint_Selector *
+TAO_FT_Endpoint_Selector_Factory::get_selector (
+ ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->ft_endpoint_selector_ == 0)
+ {
+ ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->mutex_,
+ 0));
+
+ // Double checked locking..
+ if (this->ft_endpoint_selector_ == 0)
+ {
+ ACE_NEW_THROW_EX (ft_endpoint_selector_,
+ TAO_FT_Invocation_Endpoint_Selector (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+ }
+ }
+
+ return this->ft_endpoint_selector_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+ACE_STATIC_SVC_DEFINE (TAO_FT_Endpoint_Selector_Factory,
+ ACE_TEXT ("FT_Endpoint_Selector_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_FT_Endpoint_Selector_Factory),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
+ACE_FACTORY_DEFINE (TAO_FT_ClientORB, TAO_FT_Endpoint_Selector_Factory)
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Endpoint_Selector_Factory.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Endpoint_Selector_Factory.h
new file mode 100644
index 00000000000..d2a6462b4e0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Endpoint_Selector_Factory.h
@@ -0,0 +1,76 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_Endpoint_Selector_Factory.h
+ *
+ * $Id$
+ *
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+#ifndef TAO_FT_ENDPOINT_SELECTOR_FACTORY_H
+#define TAO_FT_ENDPOINT_SELECTOR_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FaultTolerance/FT_ClientORB_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Endpoint_Selector_Factory.h"
+#include "tao/Basic_Types.h"
+#include "tao/orbconf.h"
+
+#include "ace/Service_Config.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FT_Invocation_Endpoint_Selector;
+/**
+ * @class TAO_FT_Endpoint_Selector_Factory
+ *
+ * @brief Factory for initializing <Endpoint_Selection_State> and
+ * obtaining appropriate <Invocation_Endpoint_Selector>.
+ *
+ * This class is specifically for the FT_Service in TAO to return the
+ * right factory
+ */
+
+class TAO_FT_ClientORB_Export TAO_FT_Endpoint_Selector_Factory
+ : public TAO_Endpoint_Selector_Factory
+{
+public:
+
+ /// Constructor.
+ TAO_FT_Endpoint_Selector_Factory (void);
+
+ /// Destructor.
+ virtual ~TAO_FT_Endpoint_Selector_Factory (void);
+
+ /// Get an Invocation's endpoint selection strategy and
+ /// initialize the endpoint selection state instance.
+ virtual TAO_Invocation_Endpoint_Selector *get_selector (
+ ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+
+ /// The possible endpoint selector strategies that can be
+ /// returned by this factory
+ TAO_FT_Invocation_Endpoint_Selector *ft_endpoint_selector_;
+
+ /// Mutex to prevent multiple initializations
+ TAO_SYNCH_MUTEX mutex_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+//extern TAO_FT_ClientORB_Export ACE_Static_Svc_Descriptor ace_svc_desc_TAO_FT_Endpoint_Selector_Factory;
+ACE_STATIC_SVC_DECLARE_EXPORT (TAO_FT_ClientORB, TAO_FT_Endpoint_Selector_Factory)
+ACE_FACTORY_DECLARE (TAO_FT_ClientORB, TAO_FT_Endpoint_Selector_Factory)
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_DEFAULT_ENDPOINT_SELECTOR_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.cpp
new file mode 100644
index 00000000000..413bce96aaf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.cpp
@@ -0,0 +1,428 @@
+#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h"
+
+#include "tao/MProfile.h"
+#include "tao/Profile.h"
+#include "tao/Stub.h"
+#include "tao/ORB_Core.h"
+#include "tao/Tagged_Components.h"
+#include "tao/CDR.h"
+
+#include "ace/Auto_Ptr.h"
+#include "tao/debug.h"
+
+
+ACE_RCSID (FaultTolerance,
+ TAO_FT_IOGR_Property,
+ "$Id$")
+
+#if !defined (__ACE_INLINE__)
+# include "orbsvcs/FaultTolerance/FT_IOGR_Property.inl"
+#endif /* ! __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+CORBA::Boolean
+TAO_FT_IOGR_Property::set_property (
+ CORBA::Object_ptr &ior
+ ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ TAO_IOP::Invalid_IOR))
+{
+ // We need to apply the property for every profile in the IOR
+
+ // Make profiles from the sent <ior>
+ TAO_MProfile &tmp_pfiles =
+ ior->_stubobj ()->base_profiles ();
+
+ // Get the profile count.
+ CORBA::ULong count =
+ ior->_stubobj ()->base_profiles ().profile_count ();
+
+ // Make the output CDR stream
+ TAO_OutputCDR cdr;
+ CORBA::Boolean retval = 0;
+ retval =
+ cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER);
+
+ IOP::TaggedComponent tagged_components;
+ tagged_components.tag = IOP::TAG_FT_GROUP;
+
+ // Encode the property in to the tagged_components
+ retval = retval &&
+ this->encode_properties (cdr,
+ tagged_components);
+
+ if (retval == 0)
+ return retval;
+
+ const IOP::TaggedComponent &tmp_tc = tagged_components;
+
+ // Go through every profile and set the TaggedComponent field
+ for (CORBA::ULong i = 0; i < count ; i++)
+ {
+ // Get the tagged components in the profile
+ TAO_Tagged_Components &tag_comp =
+ tmp_pfiles.get_profile (i)->tagged_components ();
+
+ // Finally set the <tagged_component> in the
+ // <TAO_Tagged_Component>
+ tag_comp.set_component (tmp_tc);
+ }
+
+ // Success
+ return 1;
+
+}
+
+
+CORBA::Boolean
+TAO_FT_IOGR_Property::is_primary_set (
+ CORBA::Object_ptr ior
+ ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ if (this->get_primary_profile (ior) != 0)
+ return 1;
+
+ return 0;
+}
+
+
+CORBA::Object_ptr
+TAO_FT_IOGR_Property::get_primary (
+ CORBA::Object_ptr ior
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ TAO_IOP::NotFound
+ ))
+{
+
+ TAO_Profile *pfile =
+ this->get_primary_profile (ior);
+
+ if (pfile == 0)
+ ACE_THROW_RETURN (TAO_IOP::NotFound (),
+ CORBA::Object::_nil ());
+
+ // Search for the IOP::TAG_FT_PRIMARY in the tagged component of
+ // the profile
+
+ // Get the repository id
+ CORBA::String_var id =
+ CORBA::string_dup (ior->_stubobj ()->type_id.in ());
+
+ TAO_ORB_Core *orb_core = TAO_ORB_Core_instance ();
+
+ // Make a stub Object
+ TAO_Stub *stub = 0;
+
+ // Make a MProfile object for the primary profile alone. So, the
+ // size is 1
+ CORBA::ULong sz = 1;
+ TAO_MProfile mpfile (sz);
+ if (mpfile.add_profile (pfile) != -1)
+ {
+ ACE_NEW_THROW_EX (stub,
+ TAO_Stub (id._retn (), // give the id string to stub
+ mpfile,
+ orb_core),
+ CORBA::NO_MEMORY ());
+ }
+
+ // Make the stub memory allocation exception safe for
+ // the duration of this method.
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+
+ // Create the CORBA level proxy
+ CORBA::Object_ptr temp_obj = CORBA::Object::_nil ();
+ ACE_NEW_THROW_EX (temp_obj,
+ CORBA::Object (safe_stub.get ()),
+ CORBA::NO_MEMORY ());
+
+ CORBA::Object_var new_obj = temp_obj;
+
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ // Clean up in case of errors.
+ if (CORBA::is_nil (new_obj.in ()))
+ {
+ ACE_THROW_RETURN (TAO_IOP::NotFound (), // ** Changed from Invalid_IOR () **
+ CORBA::Object::_nil ());
+ }
+
+ // Release ownership of the pointers protected by the auto_ptrs since they
+ // no longer need to be protected by this point.
+ stub = safe_stub.release ();
+
+ return new_obj._retn ();
+
+}
+
+
+CORBA::Boolean
+TAO_FT_IOGR_Property::set_primary (
+ CORBA::Object_ptr &ior1,
+ CORBA::Object_ptr ior2
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ TAO_IOP::NotFound,
+ TAO_IOP::Duplicate
+ ))
+{
+ // Check for primary in <ior2>
+ IOP::TaggedComponent tagged_components;
+ tagged_components.tag = IOP::TAG_FT_PRIMARY;
+
+ TAO_MProfile &mprofile =
+ ior2->_stubobj ()->base_profiles ();
+
+ for (CORBA::ULong i = 0;
+ i < mprofile.profile_count ();
+ i++)
+ {
+ TAO_Tagged_Components &tag_comp =
+ mprofile.get_profile (i)->tagged_components ();
+
+ if (tag_comp.get_component (tagged_components) == 1)
+ ACE_THROW_RETURN (TAO_IOP::Duplicate (),
+ 0);
+ }
+
+ // Check whether ior1 exists in ior2
+ CORBA::Long index = -1;
+
+ // Even if it is a multi-profile (in case of multi-homed hosts we
+ // could get a multiple IOR profile), we are going to make the first one
+ // in that a primary
+ TAO_Profile *prim_profile =
+ ior1->_stubobj ()->base_profiles ().get_profile (0);
+
+ CORBA::ULong count =
+ ior2->_stubobj ()->base_profiles ().profile_count ();
+
+
+ for (CORBA::ULong ctr = 0;
+ ctr < count;
+ ctr ++)
+ {
+ if (prim_profile->is_equivalent (
+ ior2->_stubobj ()->base_profiles ().get_profile (ctr)) == 1)
+ {
+ // We know that <ior1> exists in <io2>
+ // Take the index of that and break out of the loop
+ index = ctr;
+ break;
+ }
+ }
+
+ // At the end of the loop check whether we have seen <ior1> in
+ // <ior2>
+ if (index == -1)
+ ACE_THROW_RETURN (TAO_IOP::NotFound (),
+ 0);
+
+ CORBA::Boolean val = 1;
+
+ TAO_OutputCDR cdr;
+ cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER);
+ cdr << ACE_OutputCDR::from_boolean (val);
+
+ // Get the length of the CDR stream
+ CORBA::ULong length = static_cast<CORBA::ULong> (cdr.total_length ());
+
+ // Set the length
+ tagged_components.component_data.length (length);
+
+ // Get the pointer to the underlying buffer
+ CORBA::Octet *buf =
+ tagged_components.component_data.get_buffer ();
+
+ for (const ACE_Message_Block *mb = cdr.begin ();
+ mb != 0;
+ mb = mb->cont ())
+ {
+ ACE_OS::memcpy (buf, mb->rd_ptr (), mb->length ());
+ buf += mb->length ();
+ }
+
+ // Set the <tagged_component>
+ TAO_Tagged_Components &tagg =
+ ior2->_stubobj ()->base_profiles ().get_profile (index)->tagged_components ();
+
+ tagg.set_component (tagged_components);
+
+ return 1;
+}
+
+CORBA::Boolean
+TAO_FT_IOGR_Property::encode_properties (
+ TAO_OutputCDR &cdr,
+ IOP::TaggedComponent &tagged_components)
+{
+ if (this->ft_group_tagged_component_ == 0)
+ {
+ if (TAO_debug_level > 2)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO-FT (%P|%t) - The group tagged component ",
+ "is null \n"),
+ 0);
+ }
+
+ // the version info
+ CORBA::Boolean status =
+ cdr << this->ft_group_tagged_component_->component_version;
+
+ // the domain id
+ status = status &&
+ cdr << this->ft_group_tagged_component_->group_domain_id.in ();
+
+ // Object group id
+ status = status &&
+ cdr << this->ft_group_tagged_component_->object_group_id;
+
+ // Object group reference version
+ status = status &&
+ cdr << this->ft_group_tagged_component_->object_group_ref_version;
+
+ // Get the length of the CDR stream
+ CORBA::ULong length = static_cast<CORBA::ULong> (cdr.total_length ());
+
+ // Set the length
+ tagged_components.component_data.length (length);
+
+ // Get the pointer to the underlying buffer
+ CORBA::Octet *buf =
+ tagged_components.component_data.get_buffer ();
+
+ for (const ACE_Message_Block *i = cdr.begin ();
+ i != 0;
+ i = i->cont ())
+ {
+
+ ACE_OS::memcpy (buf, i->rd_ptr (), i->length ());
+ buf += i->length ();
+ }
+
+
+ return status;
+}
+
+
+TAO_Profile *
+TAO_FT_IOGR_Property::get_primary_profile (
+ CORBA::Object_ptr ior)
+{
+ // Get the MProfile
+ TAO_MProfile &mprofile =
+ ior->_stubobj ()->base_profiles ();
+
+ // Looking for a tagged component with a PRIMARY flag.
+ IOP::TaggedComponent tagged_components;
+ tagged_components.tag = IOP::TAG_FT_PRIMARY;
+
+ for (CORBA::ULong i = 0;
+ i < mprofile.profile_count ();
+ i++)
+ {
+ // Get the Tagged Components
+ const TAO_Tagged_Components &pfile_tagged =
+ mprofile.get_profile (i)->tagged_components ();
+
+ // Look for the primary
+ if (pfile_tagged.get_component (tagged_components) == 1)
+ {
+ // If there is one return the pfile
+ return mprofile.get_profile (i);
+ }
+ }
+ return 0;
+}
+
+
+CORBA::Boolean
+TAO_FT_IOGR_Property::get_tagged_component (
+ const CORBA::Object_ptr iogr,
+ FT::TagFTGroupTaggedComponent &fgtc
+ ACE_ENV_ARG_DECL) const
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Stub *stub =
+ iogr->_stubobj ();
+
+ if (stub == 0)
+ return 0;
+
+ // Get the MProfile
+ TAO_MProfile &mprofile =
+ iogr->_stubobj ()->base_profiles ();
+
+ // Looking for a tagged component with a TAG_FT_GROUP flag.
+ IOP::TaggedComponent tc;
+ tc.tag = IOP::TAG_FT_GROUP;
+
+ for (CORBA::ULong i = 0;
+ i < mprofile.profile_count ();
+ i++)
+ {
+
+ // Get the Tagged Components
+ const TAO_Tagged_Components &pfile_tagged =
+ mprofile.get_profile (i)->tagged_components ();
+
+ // Look for the primary
+ if (pfile_tagged.get_component (tc) == 1)
+ {
+ TAO_InputCDR cdr (reinterpret_cast<const char*> (tc.component_data.get_buffer ()),
+ tc.component_data.length ());
+ CORBA::Boolean byte_order;
+
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ ACE_THROW_RETURN (CORBA::MARSHAL (),
+ 0);
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ if ((cdr >> fgtc) == 1)
+ return 1;
+ else
+ ACE_THROW_RETURN (CORBA::MARSHAL (),
+ 0);
+ }
+ }
+
+ return 0;
+}
+
+CORBA::Boolean
+TAO_FT_IOGR_Property::remove_primary_tag (
+ CORBA::Object_ptr &iogr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Get the MProfile
+ TAO_MProfile &mprofile =
+ iogr->_stubobj ()->base_profiles ();
+
+ for (CORBA::ULong i = 0;
+ i < mprofile.profile_count ();
+ ++i)
+ {
+ TAO_Profile* profile = mprofile.get_profile (i);
+
+ // Get the Tagged Components
+ TAO_Tagged_Components &pfile_tagged =
+ profile->tagged_components ();
+
+ if (pfile_tagged.remove_component (IOP::TAG_FT_PRIMARY))
+ {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.h
new file mode 100644
index 00000000000..cc888e28e31
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.h
@@ -0,0 +1,147 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_IOGR_Property.h
+ *
+ * $Id$
+ *
+ * This class implements the IOGR properties for the FT service
+ *
+ *
+ * @author Bala Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_FT_IOGR_PROPERTY_H
+#define TAO_FT_IOGR_PROPERTY_H
+#include /**/ "ace/pre.h"
+
+#include "tao/LocalObject.h"
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/IORManipulation/IORManip_Loader.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "tao/IOPC.h"
+#include "orbsvcs/FaultTolerance/FT_ORB_Utils_export.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Profile;
+
+/**
+ * @class TAO_FT_IOGR_Property
+ *
+ * @brief TAO_FT_IOGR_Property
+ *
+ * This class serves as the callback class for setting the
+ * TaggedComponent properties in the profiles of the IOGR. The
+ * user can make an instance of this class with the right
+ * properties and use the helper methods in the IORManipulation
+ *
+ * NOTE: This class is NOT thread safe. The range of services that
+ * use this class (like the RM) should use them in a thread safe
+ * manner.
+ */
+class TAO_FT_ORB_Utils_Export TAO_FT_IOGR_Property
+ : public virtual TAO_IOP::TAO_IOR_Property,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Our Constructor
+ TAO_FT_IOGR_Property (FT::TagFTGroupTaggedComponent &ft_group);
+
+ TAO_FT_IOGR_Property (void);
+
+ /// Destructor
+ ~TAO_FT_IOGR_Property (void);
+
+ /// Set the property for the IOGR
+ virtual CORBA::Boolean set_property (
+ CORBA::Object_ptr &ior
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ TAO_IOP::Invalid_IOR
+ ));
+
+ /// Set <ior1> as primary which is a part of <ior2>
+ virtual CORBA::Boolean set_primary (
+ CORBA::Object_ptr &ior1,
+ CORBA::Object_ptr ior2
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ TAO_IOP::NotFound,
+ TAO_IOP::Duplicate
+ ));
+
+ /// Get the primary member from the IOGR <ior>
+ virtual CORBA::Object_ptr get_primary (
+ CORBA::Object_ptr ior
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ TAO_IOP::NotFound
+ ));
+
+ /// Is there a primary available for <ior>
+ virtual CORBA::Boolean is_primary_set (
+ CORBA::Object_ptr ior
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual CORBA::Boolean remove_primary_tag (
+ CORBA::Object_ptr &iogr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Reset the underlying tagged components held by the class
+ CORBA::Boolean reset_tagged_components (
+ FT::TagFTGroupTaggedComponent &ft_group);
+
+ /// Extract the TagFTGroupTaggedComponent inside the <ior>
+ CORBA::Boolean get_tagged_component (
+ const CORBA::Object_ptr iogr,
+ FT::TagFTGroupTaggedComponent &ft_group
+ ACE_ENV_ARG_DECL) const
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ /// An helper function that gets the primary profile from the <ior>
+ TAO_Profile *get_primary_profile (CORBA::Object_ptr ior);
+
+ /// An helper method for encoding the proeprties
+ CORBA::Boolean encode_properties (
+ TAO_OutputCDR &cdr,
+ IOP::TaggedComponent &tagged_components);
+
+private:
+ /// Hold the reference to the FT group tagged component
+ FT::TagFTGroupTaggedComponent *ft_group_tagged_component_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#if defined (__ACE_INLINE__)
+# include "orbsvcs/FaultTolerance/FT_IOGR_Property.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_FT_IOGR_PROPERTY_H */
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.inl b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.inl
new file mode 100644
index 00000000000..5e3a8417714
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.inl
@@ -0,0 +1,35 @@
+// -*- C++ -*-
+//
+//$Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_FT_IOGR_Property::TAO_FT_IOGR_Property (
+ FT::TagFTGroupTaggedComponent &ft_group)
+ :ft_group_tagged_component_ (&ft_group)
+{
+}
+
+ACE_INLINE
+TAO_FT_IOGR_Property::TAO_FT_IOGR_Property (void)
+ :ft_group_tagged_component_ (0)
+{
+}
+
+ACE_INLINE
+TAO_FT_IOGR_Property::~TAO_FT_IOGR_Property (void)
+{
+}
+
+ACE_INLINE CORBA::Boolean
+TAO_FT_IOGR_Property::reset_tagged_components (
+ FT::TagFTGroupTaggedComponent &ft_group)
+{
+ this->ft_group_tagged_component_ =
+ &ft_group;
+
+ return 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Invocation_Endpoint_Selectors.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Invocation_Endpoint_Selectors.cpp
new file mode 100644
index 00000000000..3243d7ea5fd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Invocation_Endpoint_Selectors.cpp
@@ -0,0 +1,235 @@
+// -*- C++ -*-
+
+#include "orbsvcs/FaultTolerance/FT_Invocation_Endpoint_Selectors.h"
+
+#include "tao/Profile_Transport_Resolver.h"
+#include "tao/Stub.h"
+#include "tao/Profile.h"
+#include "tao/Endpoint.h"
+#include "tao/Base_Transport_Property.h"
+#include "tao/Environment.h"
+#include "tao/debug.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID (FaultTolerance,
+ FT_Invocation_Endpoint_Selectors,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_FT_Invocation_Endpoint_Selector::TAO_FT_Invocation_Endpoint_Selector (void)
+ : TAO_Default_Endpoint_Selector ()
+{
+}
+
+TAO_FT_Invocation_Endpoint_Selector::~TAO_FT_Invocation_Endpoint_Selector (void)
+{
+}
+
+void
+TAO_FT_Invocation_Endpoint_Selector::select_endpoint (
+ TAO::Profile_Transport_Resolver *r,
+ ACE_Time_Value *val
+ ACE_ENV_ARG_DECL)
+{
+ bool retval =
+ this->select_primary (r,
+ val
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (retval)
+ return;
+
+ retval =
+ this->select_secondary (r,
+ val
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (retval == false)
+ {
+ // If we get here, we completely failed to find an endpoint selector
+ // that we know how to use, so throw an exception.
+ ACE_THROW (CORBA::TRANSIENT (CORBA::OMGVMCID | 2,
+ CORBA::COMPLETED_NO));
+ }
+
+ return;
+}
+
+bool
+TAO_FT_Invocation_Endpoint_Selector::select_primary (
+ TAO::Profile_Transport_Resolver *r,
+ ACE_Time_Value *max_wait_time
+ ACE_ENV_ARG_DECL)
+{
+ // Grab the forwarded list
+ TAO_MProfile *prof_list =
+ const_cast<TAO_MProfile *> (r->stub ()->forward_profiles ());
+
+ TAO_MProfile &basep = r->stub ()->base_profiles ();
+
+ if (prof_list ==0)
+ prof_list = &basep;
+
+ if (prof_list == 0)
+ return false;
+
+ // Did not succeed. Try to look for primaries all over the place
+ CORBA::ULong sz =
+ prof_list->size ();
+
+ // Iterate through the list in a circular fashion. Stop one before
+ // the list instead of trying the same thing again.
+ for (CORBA::ULong i = 0;
+ i != sz;
+ ++i)
+ {
+ TAO_Profile *tmp = prof_list->get_profile (i);
+
+ bool retval =
+ this->check_profile_for_primary (tmp
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (false);
+
+ // Choose a non-primary
+ if (retval == true && tmp != 0)
+ {
+ retval =
+ this->try_connect (r,
+ tmp,
+ max_wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (false);
+
+ if (retval == true)
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool
+TAO_FT_Invocation_Endpoint_Selector::select_secondary (
+ TAO::Profile_Transport_Resolver *r,
+ ACE_Time_Value *max_wait_time
+ ACE_ENV_ARG_DECL)
+{
+ // Grab the forwarded list
+ TAO_MProfile *prof_list =
+ const_cast<TAO_MProfile *> (r->stub ()->forward_profiles ());
+
+ TAO_MProfile &basep =
+ r->stub ()->base_profiles ();
+
+ if (prof_list ==0)
+ prof_list = &basep;
+
+ if (prof_list == 0)
+ return false;
+
+ CORBA::ULong sz =
+ prof_list->size ();
+
+ for (CORBA::ULong i = 0;
+ i != sz;
+ ++i)
+ {
+ TAO_Profile *tmp =
+ prof_list->get_profile (i);
+
+ bool retval =
+ this->check_profile_for_primary (tmp
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (false);
+
+ // Choose a non-primary
+ if (retval == false && tmp != 0)
+ {
+ retval =
+ this->try_connect (r,
+ tmp,
+ max_wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (false);
+
+ if (retval == true)
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool
+TAO_FT_Invocation_Endpoint_Selector::try_connect (
+ TAO::Profile_Transport_Resolver *r,
+ TAO_Profile *profile,
+ ACE_Time_Value *max_wait_time
+ ACE_ENV_ARG_DECL)
+{
+ r->profile (profile);
+
+ size_t endpoint_count =
+ r->profile ()->endpoint_count ();
+
+ TAO_Endpoint *ep =
+ r->profile ()->endpoint ();
+
+ for (size_t i = 0; i < endpoint_count; ++i)
+ {
+ TAO_Base_Transport_Property desc (ep);
+
+ bool retval =
+ r->try_connect (&desc,
+ max_wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (false);
+
+ // @@ Good place to handle timeouts.. We can omit timeouts and
+ // go ahead looking for other things... There are some small
+ // issues that needs ironed out first in the invocation
+ // classes.
+
+ // Check if the connect has completed.
+ if (retval)
+ return true;
+
+ // Go to the next endpoint in this profile.
+ ep = ep->next ();
+ }
+
+ return false;
+}
+
+bool
+TAO_FT_Invocation_Endpoint_Selector::check_profile_for_primary (
+ TAO_Profile *pfile
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ if (pfile == 0)
+ return false;
+
+ IOP::TaggedComponent tagged_component;
+ tagged_component.tag = IOP::TAG_FT_PRIMARY;
+
+ // Get the tagged component from the profile
+ TAO_Tagged_Components &pfile_tagged =
+ pfile->tagged_components ();
+
+ // Search for the TaggedComponent that we want
+ if (pfile_tagged.get_component (tagged_component) != 1)
+ return false;
+
+ if (TAO_debug_level > 2)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO_FT (%P|%t) - Got a primary component\n")));
+ }
+
+ return true;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Invocation_Endpoint_Selectors.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Invocation_Endpoint_Selectors.h
new file mode 100644
index 00000000000..ae3a473ea34
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Invocation_Endpoint_Selectors.h
@@ -0,0 +1,96 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_Invocation_Endpoint_Selectors.h
+ *
+ * $Id$
+ *
+ * Strategies for selecting profile/endpoint from an IOR for making an
+ * invocation.
+ *
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_FT_INVOCATION_ENDPOINT_SELECTOR_H
+#define TAO_FT_INVOCATION_ENDPOINT_SELECTOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FaultTolerance/FT_ClientORB_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Invocation_Endpoint_Selectors.h"
+#include "tao/Basic_Types.h"
+#include "tao/ORB_Constants.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Profile;
+
+/**
+ * @class TAO_FT_Invocation_Endpoint_Selector
+ *
+ * @brief Implementation specific for FT_Service.
+ *
+ * We inherit from the Default endpoint selector, as this would give
+ * us a chance to use the default endpoint selector options if
+ * needed.
+ *
+ */
+
+class TAO_FT_ClientORB_Export TAO_FT_Invocation_Endpoint_Selector :
+ public TAO_Default_Endpoint_Selector
+{
+
+public:
+ /// Constructor.
+ TAO_FT_Invocation_Endpoint_Selector (void);
+
+ /// Destructor.
+ virtual ~TAO_FT_Invocation_Endpoint_Selector (void);
+
+ /// Implementation for FT. Please refer to
+ /// $TAO_ROOT/tao/Invocation_Endpoint_Selectors.h for details of
+ /// documentation.
+ virtual void select_endpoint (TAO::Profile_Transport_Resolver *r,
+ ACE_Time_Value *val
+ ACE_ENV_ARG_DECL);
+
+protected:
+ /// Select the primary and try connecting to it.
+ bool select_primary (TAO::Profile_Transport_Resolver *r,
+ ACE_Time_Value *val
+ ACE_ENV_ARG_DECL);
+
+ /// Select the secondary and try connecting to it. Returns true if
+ /// successfull.
+ bool select_secondary (TAO::Profile_Transport_Resolver *r,
+ ACE_Time_Value *val
+ ACE_ENV_ARG_DECL);
+
+ /// Helper method that tries to establish connections with all the
+ /// endpoints in the profile.
+ bool try_connect (TAO::Profile_Transport_Resolver *r,
+ TAO_Profile *profile,
+ ACE_Time_Value *max_wait_time
+ ACE_ENV_ARG_DECL);
+
+ /// Helper method that checks whether the profile is a primary or
+ /// not.
+ bool check_profile_for_primary (TAO_Profile *
+ ACE_ENV_ARG_DECL);
+
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* FT_TAO_INVOCATION_ENDPOINT_SELECTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORBInitializer.cpp
new file mode 100644
index 00000000000..3e2a732dd62
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORBInitializer.cpp
@@ -0,0 +1,140 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "orbsvcs/FaultTolerance/FT_ORBInitializer.h"
+#include "orbsvcs/FaultTolerance/FT_PolicyFactory.h"
+#include "orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.h"
+#include "orbsvcs/FaultTolerance/FT_ServerRequest_Interceptor.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "tao/Exception.h"
+
+
+ACE_RCSID (FaultTolerance,
+ FT_ORBInitializer,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void
+TAO_FT_ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_FT_ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->register_policy_factories (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->register_server_request_interceptors (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->register_client_request_interceptors (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_FT_ORBInitializer::register_policy_factories (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Register the FTCORBA policy factories.
+
+ PortableInterceptor::PolicyFactory_ptr temp_factory =
+ PortableInterceptor::PolicyFactory::_nil ();
+ PortableInterceptor::PolicyFactory_var policy_factory;
+
+ // This policy factory is used for all FTCORBA related policies.
+
+ ACE_NEW_THROW_EX (temp_factory,
+ TAO_FT_PolicyFactory,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ policy_factory = temp_factory;
+
+ // Bind the same policy factory to all RTCORBA related policy
+ // types since a single policy factory is used to create each of
+ // the different types of RTCORBA policies.
+
+ CORBA::PolicyType type = FT::REQUEST_DURATION_POLICY;
+ info->register_policy_factory (type,
+ policy_factory.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ type = FT::HEARTBEAT_POLICY;
+ info->register_policy_factory (type,
+ policy_factory.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ type = FT::HEARTBEAT_ENABLED_POLICY;
+ info->register_policy_factory (type,
+ policy_factory.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Transfer ownership of the policy factory to the registry.
+ (void) policy_factory._retn ();
+}
+
+void
+TAO_FT_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,
+ TAO::FT_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;
+}
+
+
+void
+TAO_FT_ORBInitializer::register_client_request_interceptors (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableInterceptor::ClientRequestInterceptor_ptr cri =
+ PortableInterceptor::ClientRequestInterceptor::_nil ();
+
+ ACE_NEW_THROW_EX (cri,
+ TAO::FT_ClientRequest_Interceptor,
+ CORBA::NO_MEMORY ());
+
+ PortableInterceptor::ClientRequestInterceptor_var
+ client_interceptor = cri;
+
+ info->add_client_request_interceptor (client_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORBInitializer.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORBInitializer.h
new file mode 100644
index 00000000000..8493a77ddac
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORBInitializer.h
@@ -0,0 +1,79 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_ORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+#ifndef TAO_FT_ORB_INITIALIZER_H
+#define TAO_FT_ORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/corbafwd.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+#include "orbsvcs/FaultTolerance/fault_tol_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// RTCORBA ORB initializer.
+class TAO_FT_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 FTCORBA policy factories.
+ void register_policy_factories (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Register the necessary interceptors.
+ void register_server_request_interceptors (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void register_client_request_interceptors (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_FT_ORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORB_Utils_export.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORB_Utils_export.h
new file mode 100644
index 00000000000..f492009ae85
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ORB_Utils_export.h
@@ -0,0 +1,60 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TAO_FT_ORB_Utils
+// ------------------------------
+#ifndef TAO_FT_ORB_UTILS_EXPORT_H
+#define TAO_FT_ORB_UTILS_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_FT_ORB_UTILS_HAS_DLL)
+# define TAO_FT_ORB_UTILS_HAS_DLL 0
+# endif /* ! TAO_FT_ORB_UTILS_HAS_DLL */
+#else
+# if !defined (TAO_FT_ORB_UTILS_HAS_DLL)
+# define TAO_FT_ORB_UTILS_HAS_DLL 1
+# endif /* ! TAO_FT_ORB_UTILS_HAS_DLL */
+#endif
+
+#if defined (TAO_FT_ORB_UTILS_HAS_DLL) && (TAO_FT_ORB_UTILS_HAS_DLL == 1)
+# if defined (TAO_FT_ORB_UTILS_BUILD_DLL)
+# define TAO_FT_ORB_Utils_Export ACE_Proper_Export_Flag
+# define TAO_FT_ORB_UTILS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_FT_ORB_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_FT_ORB_UTILS_BUILD_DLL */
+# define TAO_FT_ORB_Utils_Export ACE_Proper_Import_Flag
+# define TAO_FT_ORB_UTILS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_FT_ORB_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_FT_ORB_UTILS_BUILD_DLL */
+#else /* TAO_FT_ORB_UTILS_HAS_DLL == 1 */
+# define TAO_FT_ORB_Utils_Export
+# define TAO_FT_ORB_UTILS_SINGLETON_DECLARATION(T)
+# define TAO_FT_ORB_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_FT_ORB_UTILS_HAS_DLL == 1 */
+
+// Set TAO_FT_ORB_UTILS_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TAO_FT_ORB_UTILS_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TAO_FT_ORB_UTILS_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TAO_FT_ORB_UTILS_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TAO_FT_ORB_UTILS_NTRACE */
+
+#if (TAO_FT_ORB_UTILS_NTRACE == 1)
+# define TAO_FT_ORB_UTILS_TRACE(X)
+#else /* (TAO_FT_ORB_UTILS_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define TAO_FT_ORB_UTILS_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (TAO_FT_ORB_UTILS_NTRACE == 1) */
+
+#endif /* TAO_FT_ORB_UTILS_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_PolicyFactory.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_PolicyFactory.cpp
new file mode 100644
index 00000000000..74758912067
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_PolicyFactory.cpp
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "orbsvcs/FaultTolerance/FT_PolicyFactory.h"
+#include "orbsvcs/FaultTolerance/FT_Policy_i.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "tao/PolicyC.h"
+
+
+ACE_RCSID (FaultTolerance, FT_PolicyFactory, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+CORBA::Policy_ptr
+TAO_FT_PolicyFactory::create_policy (
+ CORBA::PolicyType type,
+ const CORBA::Any &val
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CORBA::PolicyError))
+{
+
+ if (type == FT::REQUEST_DURATION_POLICY)
+ return TAO_FT_Request_Duration_Policy::create (val
+ ACE_ENV_ARG_PARAMETER);
+ else if (type == FT::HEARTBEAT_POLICY)
+ return TAO_FT_Heart_Beat_Policy::create (val
+ ACE_ENV_ARG_PARAMETER);
+ else if (type == FT::HEARTBEAT_ENABLED_POLICY)
+ return TAO_FT_Heart_Beat_Enabled_Policy::create (val
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_PolicyFactory.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_PolicyFactory.h
new file mode 100644
index 00000000000..bb71603c077
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_PolicyFactory.h
@@ -0,0 +1,63 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_PolicyFactory.h
+ *
+ * $Id$
+ *
+ * @author Bala Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_FT_POLICY_FACTORY_H
+#define TAO_FT_POLICY_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/corbafwd.h"
+
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.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 */
+
+#include "orbsvcs/FaultTolerance/fault_tol_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Policy factory for all FTCORBA related policies.
+class TAO_FT_PolicyFactory
+ : public PortableInterceptor::PolicyFactory
+ , public TAO_Local_RefCounted_Object
+{
+public:
+
+ virtual CORBA::Policy_ptr create_policy (CORBA::PolicyType type,
+ const CORBA::Any &value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CORBA::PolicyError));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_FT_POLICY_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Policy_i.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Policy_i.cpp
new file mode 100644
index 00000000000..c24aa921d17
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Policy_i.cpp
@@ -0,0 +1,259 @@
+//$Id$
+#include "orbsvcs/FaultTolerance/FT_Policy_i.h"
+
+#include "tao/debug.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/FaultTolerance/FT_Policy_i.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(FaultTolerance, FT_Policy_i, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TimeBase::TimeT
+TAO_FT_Request_Duration_Policy::request_duration_policy_value (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->request_duration_;
+}
+
+CORBA::PolicyType
+TAO_FT_Request_Duration_Policy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return FT::REQUEST_DURATION_POLICY;
+}
+
+CORBA::Policy_ptr
+TAO_FT_Request_Duration_Policy::create (const CORBA::Any& val
+ ACE_ENV_ARG_DECL)
+{
+ TimeBase::TimeT value;
+ if ((val >>= value) == 0)
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+
+ TAO_FT_Request_Duration_Policy *tmp;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_FT_Request_Duration_Policy (value),
+ CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
+TAO_FT_Request_Duration_Policy *
+TAO_FT_Request_Duration_Policy::clone (void) const
+{
+ TAO_FT_Request_Duration_Policy *copy = 0;
+ ACE_NEW_RETURN (copy,
+ TAO_FT_Request_Duration_Policy (*this),
+ 0);
+ return copy;
+}
+
+CORBA::Policy_ptr
+TAO_FT_Request_Duration_Policy::copy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_FT_Request_Duration_Policy* tmp;
+ ACE_NEW_THROW_EX (tmp, TAO_FT_Request_Duration_Policy (*this),
+ CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
+void
+TAO_FT_Request_Duration_Policy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_FT_Request_Duration_Policy::set_time_value (ACE_Time_Value &time_value)
+{
+ TimeBase::TimeT t = this->request_duration_;
+ TimeBase::TimeT seconds = t / 10000000u;
+ TimeBase::TimeT microseconds = (t % 10000000u) / 10;
+ time_value.set (ACE_U64_TO_U32 (seconds),
+ ACE_U64_TO_U32 (microseconds));
+
+ if (TAO_debug_level > 0)
+ {
+ CORBA::ULong msecs =
+ static_cast<CORBA::ULong> (microseconds / 1000);
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO_FT (%P|%t) - Timeout is <%u>\n"),
+ msecs));
+ }
+}
+
+
+/*****************************************************************/
+
+FT::HeartbeatPolicyValue
+TAO_FT_Heart_Beat_Policy::heartbeat_policy_value (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ FT::HeartbeatPolicyValue val;
+ val.heartbeat = this->heartbeat_;
+ val.heartbeat_interval = this->heartbeat_interval_;
+ val.heartbeat_timeout = this->heartbeat_timeout_;
+
+ return val;
+}
+
+
+CORBA::Policy_ptr
+TAO_FT_Heart_Beat_Policy::create (const CORBA::Any& val
+ ACE_ENV_ARG_DECL)
+{
+ FT::HeartbeatPolicyValue *value;
+ if ((val >>= value) == 0)
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+
+ TAO_FT_Heart_Beat_Policy *tmp;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_FT_Heart_Beat_Policy (value->heartbeat,
+ value->heartbeat_interval,
+ value->heartbeat_timeout),
+ CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
+
+CORBA::PolicyType
+TAO_FT_Heart_Beat_Policy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return FT::HEARTBEAT_POLICY;
+}
+
+
+CORBA::Policy_ptr
+TAO_FT_Heart_Beat_Policy::copy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_FT_Heart_Beat_Policy * tmp;
+ ACE_NEW_THROW_EX (tmp, TAO_FT_Heart_Beat_Policy (*this),
+ CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
+TAO_FT_Heart_Beat_Policy *
+TAO_FT_Heart_Beat_Policy::clone (void) const
+{
+ TAO_FT_Heart_Beat_Policy *copy = 0;
+ ACE_NEW_RETURN (copy,
+ TAO_FT_Heart_Beat_Policy (*this),
+ 0);
+ return copy;
+}
+
+void
+TAO_FT_Heart_Beat_Policy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_FT_Heart_Beat_Policy::set_time_value (ACE_Time_Value &time_value,
+ const TimeBase::TimeT &timebase)
+{
+ TimeBase::TimeT t = timebase;
+ TimeBase::TimeT seconds = t / 10000000u;
+ TimeBase::TimeT microseconds = (t % 10000000u) / 10;
+ time_value.set (ACE_U64_TO_U32 (seconds),
+ ACE_U64_TO_U32 (microseconds));
+
+ if (TAO_debug_level > 0)
+ {
+ CORBA::ULong msecs =
+ static_cast<CORBA::ULong> (microseconds / 1000);
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO_FT (%P|%t) - Timeout is <%u>\n"),
+ msecs));
+ }
+}
+
+/******************************************************************/
+
+CORBA::Boolean
+TAO_FT_Heart_Beat_Enabled_Policy::heartbeat_enabled_policy_value (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->heartbeat_enabled_value_;
+}
+
+
+CORBA::Policy_ptr
+TAO_FT_Heart_Beat_Enabled_Policy::create (const CORBA::Any& val
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Boolean value;
+
+ if ((val >>= CORBA::Any::to_boolean (value)) == 0)
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+
+ TAO_FT_Heart_Beat_Enabled_Policy *tmp;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_FT_Heart_Beat_Enabled_Policy (value),
+ CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
+CORBA::PolicyType
+TAO_FT_Heart_Beat_Enabled_Policy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return FT::HEARTBEAT_ENABLED_POLICY;
+}
+
+
+CORBA::Policy_ptr
+TAO_FT_Heart_Beat_Enabled_Policy::copy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_FT_Heart_Beat_Enabled_Policy * tmp;
+ ACE_NEW_THROW_EX (tmp, TAO_FT_Heart_Beat_Enabled_Policy (*this),
+ CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
+TAO_FT_Heart_Beat_Enabled_Policy *
+TAO_FT_Heart_Beat_Enabled_Policy::clone (void) const
+{
+ TAO_FT_Heart_Beat_Enabled_Policy *copy = 0;
+ ACE_NEW_RETURN (copy,
+ TAO_FT_Heart_Beat_Enabled_Policy (*this),
+ 0);
+ return copy;
+}
+
+
+void
+TAO_FT_Heart_Beat_Enabled_Policy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Policy_i.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Policy_i.h
new file mode 100644
index 00000000000..8fd5f3a1fc8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Policy_i.h
@@ -0,0 +1,217 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_Policy_i.h
+ *
+ * $Id$
+ *
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_FT_POLICY_I_H
+#define TAO_FT_POLICY_I_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FT_CORBA_ORBC.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_FT_Request_Duration_Policy
+ *
+ * @brief FT::RequestDurationPolicy implementation
+ *
+ * This policy controls the request duration in the ORB. The
+ * semantics are like this. On the server side, the server should
+ * retain the details of the request from the client (and the
+ * reply sent to it too) atleast for the time period specified by
+ * this policy value. On the client side, the client uses this
+ * value to calculate the expiration_id in the RequestService
+ * context. The expiration_id is a sort of timeout for the client
+ * to keep trying to connect to server object groups under certain
+ * conditions.
+ */
+class TAO_FT_Request_Duration_Policy
+ : public FT::RequestDurationPolicy,
+ public TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ TAO_FT_Request_Duration_Policy (const TimeBase::TimeT& relative_expiry);
+
+ /// Copy constructor.
+ TAO_FT_Request_Duration_Policy (const TAO_FT_Request_Duration_Policy &rhs);
+
+ /// Helper method for the implementation of
+ /// CORBA::ORB::create_policy.
+ static CORBA::Policy_ptr create (const CORBA::Any& val
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Returns a copy of <this>.
+ virtual TAO_FT_Request_Duration_Policy *clone (void) const;
+
+ // = The FT::RequestDurationPolicy methods
+ virtual TimeBase::TimeT request_duration_policy_value (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::PolicyType policy_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Policy_ptr copy (
+ 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));
+
+ /// Change the CORBA representation to the ACE representation.
+ void set_time_value (ACE_Time_Value &time_value);
+
+private:
+ /// The attribute
+ TimeBase::TimeT request_duration_;
+};
+
+
+/**
+ * @class TAO_FT_Heart_Beat_Policy
+ *
+ * @brief FT::HeartBeatPolicy
+ *
+ * If this policy is set, it enables the client ORB to send
+ * heartbeats to the server ORB over the open connections.
+ */
+class TAO_FT_Export TAO_FT_Heart_Beat_Policy
+ : public FT::HeartbeatPolicy,
+ public TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ TAO_FT_Heart_Beat_Policy (const CORBA::Boolean boolean,
+ const TimeBase::TimeT &interval,
+ const TimeBase::TimeT &timeout);
+
+ /// Copy constructor.
+ TAO_FT_Heart_Beat_Policy (const TAO_FT_Heart_Beat_Policy &rhs);
+
+ /// Helper method for the implementation of
+ /// CORBA::ORB::create_policy.
+ static CORBA::Policy_ptr create (const CORBA::Any& val
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Returns a copy of <this>.
+ virtual TAO_FT_Heart_Beat_Policy *clone (void) const;
+
+ // = The FT::HeartBeatPolicy methods
+ virtual FT::HeartbeatPolicyValue heartbeat_policy_value (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::PolicyType policy_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Policy_ptr copy (
+ 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));
+
+ /// Change the CORBA representation to the ACE representation.
+ void set_time_value (ACE_Time_Value &time_value,
+ const TimeBase::TimeT &timebase);
+
+private:
+
+ // The attributes
+ /// <heartbeat_> indicates whether heartbeating is enabled or not.
+ CORBA::Boolean heartbeat_;
+
+ /// Intervals in which heartbeat messages need to be sent
+ TimeBase::TimeT heartbeat_interval_;
+
+ /// The timeouts for the heartbeats
+ TimeBase::TimeT heartbeat_timeout_;
+};
+
+/**
+ * @class TAO_FT_Heart_Beat_Enabled_Policy
+ *
+ * @brief FT::HeartBeatEnabledPolicy
+ *
+ * If this policy is set, it enables the server ORB to set
+ * the TAG_FT_HEARTBEAT_ENABLED component in the IOP profile of
+ * the IOR that it exposes
+ */
+class TAO_FT_Export TAO_FT_Heart_Beat_Enabled_Policy
+ : public FT::HeartbeatEnabledPolicy,
+ public TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ TAO_FT_Heart_Beat_Enabled_Policy (const CORBA::Boolean boolean);
+
+ /// Copy constructor.
+ TAO_FT_Heart_Beat_Enabled_Policy (
+ const TAO_FT_Heart_Beat_Enabled_Policy &rhs);
+
+ static CORBA::Policy_ptr create (const CORBA::Any& val
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ // Helper method for the implementation of
+ // CORBA::ORB::create_policy.
+
+ /// Returns a copy of <this>.
+ virtual TAO_FT_Heart_Beat_Enabled_Policy *clone (void) const;
+
+ // = The FT::HeartBeatPolicy methods
+ virtual CORBA::Boolean heartbeat_enabled_policy_value (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::PolicyType policy_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Policy_ptr copy (
+ 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));
+
+private:
+
+ /// indicates whether heartbeating is enabled or not.
+ CORBA::Boolean heartbeat_enabled_value_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/FaultTolerance/FT_Policy_i.inl"
+#endif /* __ACE_INLINE__ */
+
+
+#include /**/ "ace/post.h"
+#endif /* TAO_FT_POLICY_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Policy_i.inl b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Policy_i.inl
new file mode 100644
index 00000000000..3aa80e1b0a1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Policy_i.inl
@@ -0,0 +1,80 @@
+// -*- C++ -*-
+//
+//$Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_FT_Request_Duration_Policy::TAO_FT_Request_Duration_Policy (const TimeBase::TimeT &duration)
+ :ACE_NESTED_CLASS (CORBA, Object) ()
+ , ACE_NESTED_CLASS (CORBA, Policy) ()
+ , ACE_NESTED_CLASS (CORBA, LocalObject) ()
+ , TAO_Local_RefCounted_Object ()
+ , request_duration_ (duration)
+{
+}
+
+ACE_INLINE
+TAO_FT_Request_Duration_Policy::TAO_FT_Request_Duration_Policy (const TAO_FT_Request_Duration_Policy &rhs)
+ :ACE_NESTED_CLASS (CORBA, Object) ()
+ , ACE_NESTED_CLASS (CORBA, Policy) ()
+ , ACE_NESTED_CLASS (CORBA, LocalObject) ()
+ , FT::RequestDurationPolicy ()
+ , TAO_Local_RefCounted_Object ()
+ , request_duration_ (rhs.request_duration_)
+{
+}
+
+ACE_INLINE
+TAO_FT_Heart_Beat_Policy::TAO_FT_Heart_Beat_Policy (
+ const CORBA::Boolean heartbeat,
+ const TimeBase::TimeT &interval,
+ const TimeBase::TimeT &timeout)
+ : ACE_NESTED_CLASS (CORBA, Object) ()
+ , ACE_NESTED_CLASS (CORBA, Policy) ()
+ , ACE_NESTED_CLASS (CORBA, LocalObject) ()
+ , TAO_Local_RefCounted_Object ()
+ , heartbeat_ (heartbeat)
+ , heartbeat_interval_ (interval)
+ , heartbeat_timeout_ (timeout)
+{
+}
+
+ACE_INLINE
+TAO_FT_Heart_Beat_Policy::TAO_FT_Heart_Beat_Policy (const TAO_FT_Heart_Beat_Policy &rhs)
+ : ACE_NESTED_CLASS (CORBA, Object) ()
+ , ACE_NESTED_CLASS (CORBA, Policy) ()
+ , ACE_NESTED_CLASS (CORBA, LocalObject) ()
+ , FT::HeartbeatPolicy ()
+ , TAO_Local_RefCounted_Object ()
+ , heartbeat_ (rhs.heartbeat_)
+ , heartbeat_interval_ (rhs.heartbeat_interval_)
+ , heartbeat_timeout_ (rhs.heartbeat_timeout_)
+{
+}
+
+
+ACE_INLINE
+TAO_FT_Heart_Beat_Enabled_Policy::TAO_FT_Heart_Beat_Enabled_Policy (
+ const CORBA::Boolean heartbeat)
+ : ACE_NESTED_CLASS (CORBA, Object) ()
+ , ACE_NESTED_CLASS (CORBA, Policy) ()
+ , ACE_NESTED_CLASS (CORBA, LocalObject) ()
+ , TAO_Local_RefCounted_Object ()
+ , heartbeat_enabled_value_ (heartbeat)
+{
+}
+
+ACE_INLINE
+TAO_FT_Heart_Beat_Enabled_Policy::TAO_FT_Heart_Beat_Enabled_Policy (
+ const TAO_FT_Heart_Beat_Enabled_Policy &rhs)
+ : ACE_NESTED_CLASS (CORBA, Object) ()
+ , ACE_NESTED_CLASS (CORBA, Policy) ()
+ , ACE_NESTED_CLASS (CORBA, LocalObject) ()
+ , FT::HeartbeatEnabledPolicy ()
+ , TAO_Local_RefCounted_Object ()
+ , heartbeat_enabled_value_ (rhs.heartbeat_enabled_value_)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerORBInitializer.cpp
new file mode 100755
index 00000000000..77b99f3035a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerORBInitializer.cpp
@@ -0,0 +1,100 @@
+// $Id$
+
+#include "orbsvcs/FaultTolerance/FT_ServerORBInitializer.h"
+#include "orbsvcs/FaultTolerance/FT_ServerPolicyFactory.h"
+#include "orbsvcs/FaultTolerance/FT_ServerRequest_Interceptor.h"
+#include "tao/ORB_Constants.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "tao/Exception.h"
+
+
+ACE_RCSID (FaultTolerance,
+ FT_ServerORBInitializer,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void
+TAO_FT_ServerORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_FT_ServerORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->register_policy_factories (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->register_server_request_interceptors (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_FT_ServerORBInitializer::register_policy_factories (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Register the FTCORBA policy factories.
+
+ PortableInterceptor::PolicyFactory_ptr temp_factory =
+ PortableInterceptor::PolicyFactory::_nil ();
+ PortableInterceptor::PolicyFactory_var policy_factory;
+
+ // This policy factory is used for all FTCORBA related policies.
+
+ ACE_NEW_THROW_EX (temp_factory,
+ TAO_FT_ServerPolicyFactory,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ policy_factory = temp_factory;
+
+ // Bind the same policy factory to all FTCORBA related policy
+ // types since a single policy factory is used to create each of
+ // the different types of FTCORBA policies.
+
+
+ CORBA::PolicyType type = FT::HEARTBEAT_ENABLED_POLICY;
+ info->register_policy_factory (type,
+ policy_factory.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void
+TAO_FT_ServerORBInitializer::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,
+ TAO::FT_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;
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerORBInitializer.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerORBInitializer.h
new file mode 100755
index 00000000000..0e2711ed429
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerORBInitializer.h
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_ServerORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+#ifndef TAO_FT_SERVERORB_INITIALIZER_H
+#define TAO_FT_SERVERORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/PI/PI.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+#include "orbsvcs/FaultTolerance/FT_ServerORB_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// RTCORBA ORB initializer.
+class TAO_FT_ServerORBInitializer
+ : 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 FTCORBA policy factories.
+ void register_policy_factories (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Register the necessary interceptors.
+ void register_server_request_interceptors (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_FT_SERVERORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerORB_export.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerORB_export.h
new file mode 100644
index 00000000000..565f0b73165
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerORB_export.h
@@ -0,0 +1,60 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TAO_FT_ServerORB
+// ------------------------------
+#ifndef TAO_FT_SERVERORB_EXPORT_H
+#define TAO_FT_SERVERORB_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_FT_SERVERORB_HAS_DLL)
+# define TAO_FT_SERVERORB_HAS_DLL 0
+# endif /* ! TAO_FT_SERVERORB_HAS_DLL */
+#else
+# if !defined (TAO_FT_SERVERORB_HAS_DLL)
+# define TAO_FT_SERVERORB_HAS_DLL 1
+# endif /* ! TAO_FT_SERVERORB_HAS_DLL */
+#endif
+
+#if defined (TAO_FT_SERVERORB_HAS_DLL) && (TAO_FT_SERVERORB_HAS_DLL == 1)
+# if defined (TAO_FT_SERVERORB_BUILD_DLL)
+# define TAO_FT_ServerORB_Export ACE_Proper_Export_Flag
+# define TAO_FT_SERVERORB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_FT_SERVERORB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_FT_SERVERORB_BUILD_DLL */
+# define TAO_FT_ServerORB_Export ACE_Proper_Import_Flag
+# define TAO_FT_SERVERORB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_FT_SERVERORB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_FT_SERVERORB_BUILD_DLL */
+#else /* TAO_FT_SERVERORB_HAS_DLL == 1 */
+# define TAO_FT_ServerORB_Export
+# define TAO_FT_SERVERORB_SINGLETON_DECLARATION(T)
+# define TAO_FT_SERVERORB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_FT_SERVERORB_HAS_DLL == 1 */
+
+// Set TAO_FT_SERVERORB_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TAO_FT_SERVERORB_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TAO_FT_SERVERORB_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TAO_FT_SERVERORB_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TAO_FT_SERVERORB_NTRACE */
+
+#if (TAO_FT_SERVERORB_NTRACE == 1)
+# define TAO_FT_SERVERORB_TRACE(X)
+#else /* (TAO_FT_SERVERORB_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define TAO_FT_SERVERORB_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (TAO_FT_SERVERORB_NTRACE == 1) */
+
+#endif /* TAO_FT_SERVERORB_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicyFactory.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicyFactory.cpp
new file mode 100755
index 00000000000..e1c8fcea33b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicyFactory.cpp
@@ -0,0 +1,34 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "orbsvcs/FaultTolerance/FT_ServerPolicyFactory.h"
+#include "orbsvcs/FaultTolerance/FT_ServerPolicy_i.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "tao/PolicyC.h"
+
+
+ACE_RCSID (FaultTolerance,
+ FT_ServerPolicyFactory,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+CORBA::Policy_ptr
+TAO_FT_ServerPolicyFactory::create_policy (
+ CORBA::PolicyType type,
+ const CORBA::Any &val
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CORBA::PolicyError))
+{
+
+ if (type == FT::HEARTBEAT_ENABLED_POLICY)
+ return TAO_FT_Heart_Beat_Enabled_Policy::create (val
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicyFactory.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicyFactory.h
new file mode 100755
index 00000000000..2ae22af9f48
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicyFactory.h
@@ -0,0 +1,60 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_ServerPolicyFactory.h
+ *
+ * $Id$
+ *
+ * @author Bala Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_FT_SERVERPOLICY_FACTORY_H
+#define TAO_FT_SERVERPOLICY_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/PI/PI.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.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 */
+
+#include "orbsvcs/FaultTolerance/FT_ServerORB_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Policy factory for all FTCORBA related policies.
+class TAO_FT_ServerPolicyFactory
+ : public PortableInterceptor::PolicyFactory
+ , public TAO_Local_RefCounted_Object
+{
+public:
+
+ virtual CORBA::Policy_ptr create_policy (CORBA::PolicyType type,
+ const CORBA::Any &value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CORBA::PolicyError));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_FT_POLICY_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicy_i.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicy_i.cpp
new file mode 100644
index 00000000000..25e079b7692
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicy_i.cpp
@@ -0,0 +1,82 @@
+//$Id$
+#include "orbsvcs/FaultTolerance/FT_ServerPolicy_i.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+#include "tao/AnyTypeCode/Any.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/FaultTolerance/FT_ServerPolicy_i.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(FaultTolerance, FT_ServerPolicy_i, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+CORBA::Boolean
+TAO_FT_Heart_Beat_Enabled_Policy::heartbeat_enabled_policy_value (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->heartbeat_enabled_value_;
+}
+
+
+CORBA::Policy_ptr
+TAO_FT_Heart_Beat_Enabled_Policy::create (const CORBA::Any& val
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Boolean value;
+
+ if ((val >>= CORBA::Any::to_boolean (value)) == 0)
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_VALUE),
+ CORBA::Policy::_nil ());
+
+ TAO_FT_Heart_Beat_Enabled_Policy *tmp;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_FT_Heart_Beat_Enabled_Policy (value),
+ CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
+CORBA::PolicyType
+TAO_FT_Heart_Beat_Enabled_Policy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return FT::HEARTBEAT_ENABLED_POLICY;
+}
+
+
+CORBA::Policy_ptr
+TAO_FT_Heart_Beat_Enabled_Policy::copy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_FT_Heart_Beat_Enabled_Policy * tmp;
+ ACE_NEW_THROW_EX (tmp, TAO_FT_Heart_Beat_Enabled_Policy (*this),
+ CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
+TAO_FT_Heart_Beat_Enabled_Policy *
+TAO_FT_Heart_Beat_Enabled_Policy::clone (void) const
+{
+ TAO_FT_Heart_Beat_Enabled_Policy *copy = 0;
+ ACE_NEW_RETURN (copy,
+ TAO_FT_Heart_Beat_Enabled_Policy (*this),
+ 0);
+ return copy;
+}
+
+void
+TAO_FT_Heart_Beat_Enabled_Policy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicy_i.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicy_i.h
new file mode 100755
index 00000000000..6019cdc8f70
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicy_i.h
@@ -0,0 +1,96 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_ServerPolicy_i.h
+ *
+ * $Id$
+ *
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_FT_SERVERPOLICY_I_H
+#define TAO_FT_SERVERPOLICY_I_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FT_CORBA_ORBC.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+#include "orbsvcs/FaultTolerance/FT_ServerORB_export.h"
+#include "tao/LocalObject.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_FT_Heart_Beat_Enabled_Policy
+ *
+ * @brief FT::HeartBeatEnabledPolicy
+ *
+ * If this policy is set, it enables the server ORB to set
+ * the TAG_FT_HEARTBEAT_ENABLED component in the IOP profile of
+ * the IOR that it exposes
+ */
+class TAO_FT_Heart_Beat_Enabled_Policy
+ : public FT::HeartbeatEnabledPolicy
+ , public TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ TAO_FT_Heart_Beat_Enabled_Policy (const CORBA::Boolean boolean);
+
+ /// Copy constructor.
+ TAO_FT_Heart_Beat_Enabled_Policy (
+ const TAO_FT_Heart_Beat_Enabled_Policy &rhs);
+
+ static CORBA::Policy_ptr create (const CORBA::Any& val
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ // Helper method for the implementation of
+ // CORBA::ORB::create_policy.
+
+ /// Returns a copy of <this>.
+ virtual TAO_FT_Heart_Beat_Enabled_Policy *clone (void) const;
+
+ // = The FT::HeartBeatPolicy methods
+ virtual CORBA::Boolean heartbeat_enabled_policy_value (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::PolicyType policy_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Policy_ptr copy (
+ 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));
+
+private:
+
+ /// indicates whether heartbeating is enabled or not.
+ CORBA::Boolean heartbeat_enabled_value_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/FaultTolerance/FT_ServerPolicy_i.inl"
+#endif /* __ACE_INLINE__ */
+
+
+#include /**/ "ace/post.h"
+#endif /* TAO_FT_SERVERPOLICY_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicy_i.inl b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicy_i.inl
new file mode 100755
index 00000000000..21dfaed4af7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerPolicy_i.inl
@@ -0,0 +1,28 @@
+// -*- C++ -*-
+//
+//$Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_FT_Heart_Beat_Enabled_Policy::TAO_FT_Heart_Beat_Enabled_Policy (
+ const CORBA::Boolean heartbeat
+ )
+ : heartbeat_enabled_value_ (heartbeat)
+{
+}
+
+ACE_INLINE
+TAO_FT_Heart_Beat_Enabled_Policy::TAO_FT_Heart_Beat_Enabled_Policy (
+ const TAO_FT_Heart_Beat_Enabled_Policy &rhs
+ )
+ : CORBA::Object (),
+ CORBA::Policy (),
+ CORBA::LocalObject (),
+ FT::HeartbeatEnabledPolicy (),
+ TAO_Local_RefCounted_Object (),
+ heartbeat_enabled_value_ (rhs.heartbeat_enabled_value_)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerRequest_Interceptor.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerRequest_Interceptor.cpp
new file mode 100644
index 00000000000..64866cc36ed
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerRequest_Interceptor.cpp
@@ -0,0 +1,237 @@
+#include "orbsvcs/FaultTolerance/FT_ServerRequest_Interceptor.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 "orbsvcs/FT_CORBA_ORBC.h"
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_string.h"
+
+ACE_RCSID (FaultTolerance,
+ FT_ServerRequest_Interceptor,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ FT_ServerRequest_Interceptor::FT_ServerRequest_Interceptor (void)
+ : object_group_ref_version_ (0)
+ , is_primary_ (false)
+ , iogr_ (0)
+ , orb_ (0)
+ {
+ }
+
+ FT_ServerRequest_Interceptor::~FT_ServerRequest_Interceptor (void)
+ {
+ }
+
+ char *
+ FT_ServerRequest_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ return CORBA::string_dup ("TAO_FT_ServerRequest_Interceptor");
+ }
+
+ void
+ FT_ServerRequest_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ }
+
+ void
+ FT_ServerRequest_Interceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+ {
+ // Check for the group version service context
+ ACE_TRY
+ {
+ IOP::ServiceContext_var sc =
+ ri->get_request_service_context (IOP::FT_GROUP_VERSION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->check_iogr_version (sc.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::BAD_PARAM, ex)
+ {
+ // No group version context, no problem just return.
+ return;
+ }
+ ACE_CATCHANY
+ {
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ }
+
+ void
+ FT_ServerRequest_Interceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+ {
+ // Check for the group version service context
+ CORBA::String_var op =
+ ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (ACE_OS::strcmp (op.in (),
+ "tao_update_object_group") == 0)
+ {
+ this->update_iogr (ri
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // Else the world is fine
+ }
+
+ void
+ FT_ServerRequest_Interceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ }
+
+ void
+ FT_ServerRequest_Interceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+ {
+ }
+
+ void
+ FT_ServerRequest_Interceptor::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+ {
+ }
+
+ void
+ FT_ServerRequest_Interceptor::check_iogr_version (
+ const IOP::ServiceContext &svc
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+ {
+ 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::FTGroupVersionServiceContext fgvsc;
+
+ if ((cdr >> fgvsc) == 0)
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28,
+ CORBA::COMPLETED_NO));
+
+
+ if (fgvsc.object_group_ref_version >
+ this->object_group_ref_version_)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO_FT (%P|%t) - Wrong version information ")
+ ACE_TEXT ("within the interceptor (%u > %u)\n"),
+ fgvsc.object_group_ref_version,
+ this->object_group_ref_version_));
+ }
+ else if (fgvsc.object_group_ref_version <
+ this->object_group_ref_version_)
+ {
+ // Notice that this is a permanent forward.
+ ACE_THROW (PortableInterceptor::ForwardRequest (
+ this->iogr_.in()));
+ }
+ else if ((fgvsc.object_group_ref_version ==
+ this->object_group_ref_version_) &&
+ !this->is_primary_)
+ {
+ ACE_THROW (CORBA::TRANSIENT (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+ else
+ {
+ // Everything is okay...
+ }
+ }
+
+ void
+ FT_ServerRequest_Interceptor::update_iogr (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ if (this->orb_.in () == 0)
+ {
+ CORBA::String_var orb_id =
+ ri->orb_id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ int argc = 0;
+ char **argv = 0;
+
+ this->orb_ =
+ CORBA::ORB_init (argc,
+ argv,
+ orb_id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ Dynamic::ParameterList_var param =
+ ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // this is only for checking the tao_update_object_group operation
+ // which accepts three parameters, i.e.,an iogr as a string,
+ // a version object and a boolean.
+ if (param->length () != 3 )
+ ACE_THROW (CORBA::TRANSIENT ());
+
+ const char *str = 0;
+
+ (*param)[0].argument >>= str;
+ (*param)[1].argument >>= this->object_group_ref_version_;
+ (*param)[2].argument >>= CORBA::Any::to_boolean(this->is_primary_);
+
+ CORBA::String_var obj (str);
+
+ this->iogr_ =
+ this->orb_->string_to_object (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK;
+
+ // @@ This exception is a hack to let the RM know that we have
+ // received and updated the IOGR. We will add a special minor code
+ // soon.
+ if (this->iogr_.in ())
+ ACE_THROW (CORBA::TRANSACTION_ROLLEDBACK ());
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerRequest_Interceptor.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerRequest_Interceptor.h
new file mode 100644
index 00000000000..78c188d597d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerRequest_Interceptor.h
@@ -0,0 +1,138 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_ServerRequest_Interceptor.h
+ *
+ * $Id$
+ *
+ * ServerRequest_Interceptor for the FTORB
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_FT_SERVER_REQUEST_INTERCEPTOR_H
+#define TAO_FT_SERVER_REQUEST_INTERCEPTOR_H
+
+#include "orbsvcs/FaultTolerance/FT_ServerORB_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PI_Server/PI_Server.h"
+
+#include "tao/LocalObject.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/ORB.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace IOP
+{
+ struct ServiceContext;
+}
+namespace TAO
+{
+ /**
+ * @class Server_Request_Interceptor
+ *
+ * @brief Simple concrete server request interceptor for FTORB
+ *
+ *
+ */
+ class FT_ServerRequest_Interceptor
+ : public virtual PortableInterceptor::ServerRequestInterceptor
+ , public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+
+ /// Constructor.
+ FT_ServerRequest_Interceptor (void);
+
+ /// Destructor.
+ ~FT_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:
+
+ void check_iogr_version (const IOP::ServiceContext &svc
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ void update_iogr (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ private:
+
+ CORBA::ULong object_group_ref_version_;
+
+ CORBA::Boolean is_primary_;
+
+ CORBA::Object_var iogr_;
+
+ CORBA::ORB_var orb_;
+ };
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_FT_SERVER_REQUEST_INTERCEPTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerService_Activate.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerService_Activate.cpp
new file mode 100755
index 00000000000..be4448486c8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerService_Activate.cpp
@@ -0,0 +1,55 @@
+#include "orbsvcs/FaultTolerance/FT_ServerService_Activate.h"
+#include "orbsvcs/FaultTolerance/FT_ServerORBInitializer.h"
+#include "tao/ORB_Core.h"
+#include "tao/Service_Callbacks.h"
+#include "tao/ORBInitializer_Registry.h"
+#include "ace/Dynamic_Service.h"
+
+ACE_RCSID(FaultTolerance, FT_ServerService_Activate, "$Id$")
+
+static bool initialized = false;
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_FT_ServerService_Activate::TAO_FT_ServerService_Activate (void)
+{
+}
+
+TAO_FT_ServerService_Activate::~TAO_FT_ServerService_Activate (void)
+{
+}
+
+int
+TAO_FT_ServerService_Activate::Initializer (void)
+{
+ if (initialized == false)
+ {
+ PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
+ PortableInterceptor::ORBInitializer::_nil ();
+ PortableInterceptor::ORBInitializer_var orb_initializer;
+
+ // Register the FTCORBA ServerORBInitializer.
+ ACE_NEW_RETURN (temp_orb_initializer,
+ TAO_FT_ServerORBInitializer,
+ -1);
+
+ orb_initializer = temp_orb_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+
+ initialized = true;
+ }
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_FT_ServerORB,TAO_FT_ServerService_Activate)
+
+ACE_STATIC_SVC_DEFINE (TAO_FT_ServerService_Activate,
+ ACE_TEXT ("FT_ServerService_Activate"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_FT_ServerService_Activate),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerService_Activate.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerService_Activate.h
new file mode 100755
index 00000000000..7c57a64a2c2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ServerService_Activate.h
@@ -0,0 +1,65 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_ServerService_Activate.h
+ *
+ * $Id$
+ *
+ * A concrete implementation of a service callback
+ *
+ * @author Bala Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_FT_SERVERACTIVATE_H
+#define TAO_FT_SERVERACTIVATE_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FaultTolerance/FT_ServerORB_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Services_Activate.h"
+#include "ace/Service_Config.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Service_Callbacks;
+
+// Forward declarations
+/**
+ * @class TAO_FT_ServerService_Activate
+ *
+ * @brief A class to dynamically load the FT callback implementations in
+ * to the ORB.
+ *
+ */
+class TAO_FT_ServerORB_Export TAO_FT_ServerService_Activate
+: public ACE_Service_Object
+{
+
+public:
+ /// Constructor
+ TAO_FT_ServerService_Activate (void);
+
+ /// The destructor
+ virtual ~TAO_FT_ServerService_Activate (void);
+
+ /// Used to force the initialization.
+ static int Initializer (void);
+
+};
+
+static int
+TAO_FT_Requires_ServerService_Activate = TAO_FT_ServerService_Activate::Initializer ();
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (TAO_FT_ServerService_Activate)
+ACE_FACTORY_DECLARE (TAO_FT_ServerORB, TAO_FT_ServerService_Activate)
+
+#include /**/ "ace/post.h"
+#endif /*TAO_FT_ACTIVATE_H*/
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Activate.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Activate.cpp
new file mode 100644
index 00000000000..9c0e8ed16a2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Activate.cpp
@@ -0,0 +1,79 @@
+#include "orbsvcs/FaultTolerance/FT_Service_Activate.h"
+#include "orbsvcs/FaultTolerance/FT_Service_Callbacks.h"
+#include "orbsvcs/FaultTolerance/FT_ORBInitializer.h"
+#include "orbsvcs/FaultTolerance/FT_Endpoint_Selector_Factory.h"
+#include "tao/ORB_Core.h"
+#include "tao/Service_Callbacks.h"
+#include "ace/Dynamic_Service.h"
+
+ACE_RCSID(FaultTolerance, FT_Service_Activate, "$Id$")
+
+static bool initialized = false;
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_FT_Service_Activate::TAO_FT_Service_Activate (void)
+{
+}
+
+TAO_FT_Service_Activate::~TAO_FT_Service_Activate (void)
+{
+}
+
+TAO_Service_Callbacks *
+TAO_FT_Service_Activate::activate_services (TAO_ORB_Core *orb_core)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_FT_Service_Callbacks *ft_service_callback = 0;
+
+ // Construct service callback object
+ ACE_NEW_RETURN (ft_service_callback,
+ TAO_FT_Service_Callbacks (orb_core),
+ 0);
+
+
+ return ft_service_callback;
+}
+
+
+int
+TAO_FT_Service_Activate::Initializer (void)
+{
+ if (initialized == false)
+ {
+ ACE_Service_Config::static_svcs ()->
+ insert (&ace_svc_desc_TAO_FT_Service_Activate);
+
+ PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
+ PortableInterceptor::ORBInitializer::_nil ();
+ PortableInterceptor::ORBInitializer_var orb_initializer;
+
+ // Register the RTCORBA ORBInitializer.
+ ACE_NEW_RETURN (temp_orb_initializer,
+ TAO_FT_ORBInitializer,
+ -1);
+
+ orb_initializer = temp_orb_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+
+ // Set the name of the endpoint selector factory
+ TAO_ORB_Core::set_endpoint_selector_factory ("FT_Endpoint_Selector_Factory");
+ ACE_Service_Config::process_directive (ace_svc_desc_TAO_FT_Endpoint_Selector_Factory);
+
+ initialized = true;
+ }
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_FT,TAO_FT_Service_Activate)
+
+ACE_STATIC_SVC_DEFINE (TAO_FT_Service_Activate,
+ ACE_TEXT ("FT_Service_Activate"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_FT_Service_Activate),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Activate.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Activate.h
new file mode 100644
index 00000000000..f6d261f2246
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Activate.h
@@ -0,0 +1,19 @@
+//=============================================================================
+/**
+ * @file FT_Service_Activate.h
+ *
+ * $Id$
+ *
+ * A concrete implementation of a service callback
+ *
+ * @author Bala Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_FT_ACTIVATE_H
+#define TAO_FT_ACTIVATE_H
+
+#include "orbsvcs/FaultTolerance/FT_ClientService_Activate.h"
+#include "orbsvcs/FaultTolerance/FT_ServerService_Activate.h"
+
+#endif /*TAO_FT_ACTIVATE_H*/
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp
new file mode 100644
index 00000000000..88dedebea60
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp
@@ -0,0 +1,325 @@
+// $Id$
+
+#include "orbsvcs/FaultTolerance/FT_Service_Callbacks.h"
+#include "orbsvcs/FaultTolerance/FT_ClientPolicy_i.h"
+
+#include "ace/OS_NS_sys_time.h"
+
+#include "tao/MProfile.h"
+#include "tao/Profile.h"
+#include "tao/Tagged_Components.h"
+#include "tao/Stub.h"
+#include "tao/Invocation_Utils.h"
+#include "tao/ORB_Core.h"
+#include "tao/Client_Strategy_Factory.h"
+#include "tao/CDR.h"
+
+ACE_RCSID (FaultTolerance,
+ FT_Service_Callbacks,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_FT_Service_Callbacks::TAO_FT_Service_Callbacks (
+ TAO_ORB_Core *orb_core)
+
+ : orb_core_ (orb_core),
+ profile_lock_ (0)
+{
+ this->profile_lock_ =
+ this->orb_core_->client_factory ()->create_profile_lock ();
+}
+
+TAO_FT_Service_Callbacks::~TAO_FT_Service_Callbacks (void)
+{
+ // Delete the memeory for the lock
+ delete this->profile_lock_;
+}
+
+CORBA::Boolean
+TAO_FT_Service_Callbacks::object_is_nil (CORBA::Object_ptr obj)
+{
+ // Get the count
+ CORBA::ULong count =
+ obj->_stubobj ()->base_profiles ().profile_count ();
+
+ // If the profile count is zero then return true
+ if (count == 0)
+ return 1;
+ else
+ {
+ // else if each of the profile is nil
+ for (CORBA::ULong cnt = 0;
+ cnt < count;
+ cnt++)
+ {
+ TAO_Profile *pfile =
+ obj->_stubobj ()->base_profiles ().get_profile (cnt);
+
+ if (pfile != 0)
+ return 0;
+ }
+ }
+
+ // If it reaches here then it should be nill
+ return 1;
+
+}
+
+TAO_Service_Callbacks::Profile_Equivalence
+TAO_FT_Service_Callbacks::is_profile_equivalent (const TAO_Profile *this_p,
+ const TAO_Profile *that_p)
+{
+ const TAO_Tagged_Components &this_comp =
+ this_p->tagged_components ();
+
+ const TAO_Tagged_Components &that_comp =
+ that_p->tagged_components ();
+
+ IOP::TaggedComponent this_tc, that_tc;
+ this_tc.tag = that_tc.tag = IOP::TAG_FT_GROUP;
+
+ if (this_comp.get_component (this_tc) == 1)
+ {
+ if (that_comp.get_component (that_tc) == 1)
+ {
+ TAO_InputCDR this_cdr (reinterpret_cast<const char*> (this_tc.component_data.get_buffer ()),
+ this_tc.component_data.length ());
+
+ TAO_InputCDR that_cdr (reinterpret_cast<const char*> (that_tc.component_data.get_buffer ()),
+ that_tc.component_data.length ());
+
+ CORBA::Boolean this_byte_order;
+ CORBA::Boolean that_byte_order;
+
+ if (this_cdr >> ACE_InputCDR::to_boolean (this_byte_order) == 0 ||
+ that_cdr >> ACE_InputCDR::to_boolean (that_byte_order) == 0)
+ {
+ // Have tags but full of garbage - not equivalent
+ return TAO_Service_Callbacks::NOT_EQUIVALENT;
+ }
+
+ this_cdr.reset_byte_order (static_cast<int> (this_byte_order));
+ that_cdr.reset_byte_order (static_cast<int> (that_byte_order));
+
+
+ FT::TagFTGroupTaggedComponent this_group_component;
+ FT::TagFTGroupTaggedComponent that_group_component;
+
+ this_cdr >> this_group_component;
+ that_cdr >> that_group_component;
+
+ // check if domain id and group id are the same
+ if ((ACE_OS::strcmp (this_group_component.group_domain_id,
+ that_group_component.group_domain_id) == 0) &&
+ (this_group_component.object_group_id ==
+ that_group_component.object_group_id))
+ {
+ // Both have matching tags - true
+ return TAO_Service_Callbacks::EQUIVALENT;
+ }
+ }
+
+ return TAO_Service_Callbacks::NOT_EQUIVALENT;
+ }
+ else
+ {
+ if (that_comp.get_component (that_tc) == 1)
+ {
+ return TAO_Service_Callbacks::NOT_EQUIVALENT;
+ }
+ }
+
+ return TAO_Service_Callbacks::DONT_KNOW;
+}
+
+CORBA::ULong
+TAO_FT_Service_Callbacks::hash_ft (TAO_Profile *p,
+ CORBA::ULong max)
+{
+ // At this point we assume that all the checks for other things
+ // within the profiles have been satisfied
+ TAO_Tagged_Components &this_comp =
+ p->tagged_components ();
+
+ IOP::TaggedComponent tc;
+ tc.tag = IOP::TAG_FT_GROUP;
+
+ if (this_comp.get_component (tc) == 0)
+ return 0;
+
+ // extract the group component
+ TAO_InputCDR cdr (reinterpret_cast<const char*> (tc.component_data.get_buffer ()),
+ tc.component_data.length ());
+
+ CORBA::Boolean byte_order;
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ {
+ return 0;
+ }
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ FT::TagFTGroupTaggedComponent group_component;
+
+ cdr >> group_component;
+
+ return (CORBA::ULong) group_component.object_group_id % max;
+}
+
+CORBA::Boolean
+TAO_FT_Service_Callbacks::is_permanent_forward_condition (const CORBA::Object_ptr obj,
+ const TAO_Service_Context &service_context) const
+{
+ // do as much as possible outside of lock
+ IOP::ServiceContext sc;
+ sc.context_id = IOP::FT_GROUP_VERSION;
+
+ if (service_context.get_context (sc) == 0)
+ return false; /* false */
+
+ IOP::TaggedComponent tc;
+ tc.tag = IOP::TAG_FT_GROUP;
+
+ const TAO_Stub * stub = obj->_stubobj ();
+ // check for forward_profiles, branching to speed up operation on base_profiles
+ if (stub->forward_profiles ())
+ {
+ // set lock, as forward_profiles might be deleted concurrently
+ ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
+ guard,
+ *stub->profile_lock (),
+ 0));
+
+ // even now, the forward profiles might have been deleted in the meanwhile
+ const TAO_MProfile &mprofile = stub->forward_profiles()
+ ? *(stub->forward_profiles())
+ : stub->base_profiles();
+
+ if (mprofile.profile_count() == 0)
+ // releasing lock
+ return false;
+
+ // assuming group-attributes are set for all profiles, check
+ // only the first profile
+ const TAO_Tagged_Components &tagged_components =
+ mprofile.get_profile (0)->tagged_components ();
+
+ if (tagged_components.get_component (tc) == 0)
+ // releasing lock
+ return false; /* false */
+
+ return true; /* true */
+
+ // releasing lock
+ }
+ else /* operate on constant basic_profiles */
+ {
+ const TAO_MProfile &mprofile = stub->base_profiles();
+
+ if (mprofile.profile_count() == 0)
+ return false;
+
+ // assuming group-attributes are set for all profiles, check only the first profile
+ const TAO_Tagged_Components &tagged_components =
+ mprofile.get_profile (0)->tagged_components ();
+
+ if (tagged_components.get_component (tc) == 0)
+ return false; /* false */
+
+ return true; /* true */
+ }
+}
+
+
+TAO::Invocation_Status
+TAO_FT_Service_Callbacks::raise_comm_failure (
+ IOP::ServiceContextList &context_list,
+ TAO_Profile *profile
+ ACE_ENV_ARG_DECL)
+{
+ if (this->restart_policy_check (context_list,
+ profile))
+ return TAO::TAO_INVOKE_RESTART;
+
+ // As the right tags are not found close the connection and throw an
+ // exception
+ ACE_THROW_RETURN (CORBA::COMM_FAILURE (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_INVOCATION_RECV_REQUEST_MINOR_CODE,
+ errno),
+ CORBA::COMPLETED_MAYBE),
+ TAO::TAO_INVOKE_SYSTEM_EXCEPTION);
+}
+
+TAO::Invocation_Status
+TAO_FT_Service_Callbacks::raise_transient_failure (
+ IOP::ServiceContextList &service,
+ TAO_Profile *profile
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ if (this->restart_policy_check (service,
+ profile))
+ return TAO::TAO_INVOKE_RESTART;
+
+ // Unlike COMM_FAILURE do not raise an exception since the
+ // completion status is not known and no assumption can be made.
+ return TAO::TAO_INVOKE_SYSTEM_EXCEPTION;
+}
+
+CORBA::Boolean
+TAO_FT_Service_Callbacks::restart_policy_check (
+ IOP::ServiceContextList &service_list,
+ const TAO_Profile *profile)
+{
+ // Check whether the IOP::FT_REQUEST exists within the service
+ // context list and FT::FT_GROUP exists within the profile that we
+ // have
+ IOP::TaggedComponent tagged_component;
+ tagged_component.tag = IOP::TAG_FT_GROUP;
+
+ if (profile->tagged_components ().get_component (tagged_component)
+ == 1)
+ {
+ // Look for the FT_REQUEST context id
+ for (CORBA::ULong i = 0;
+ i < service_list.length ();
+ i++)
+ {
+ if (service_list[i].context_id == IOP::FT_REQUEST)
+ {
+ // This would be a heck of a lot easier if we had the invocation
+ // here rather than just the contexts, but lemons -> lemonade I guess.
+ TAO_InputCDR cdr (reinterpret_cast <const char*> (service_list[i].context_data.get_buffer ()),
+ service_list[i].context_data.length ());
+ CORBA::Boolean byte_order;
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ return 0;
+ cdr.reset_byte_order (static_cast <int> (byte_order));
+ FT::FTRequestServiceContext ftsrc;
+ if ((cdr >> ftsrc) == 0)
+ return 0;
+
+ return (ftsrc.expiration_time > now ());
+ }
+ }
+ }
+
+ // Failure
+ return 0;
+}
+
+TimeBase::TimeT
+TAO_FT_Service_Callbacks::now (void)
+{
+ // Grab the localtime on the machine where this is running
+ ACE_Time_Value time_val = ACE_OS::gettimeofday ();
+ TimeBase::TimeT sec_part = ((TimeBase::TimeT)time_val.sec ()) * 10000000;
+ TimeBase::TimeT usec_part = ((TimeBase::TimeT)time_val.usec ()) * 10;
+
+ // Add the offset to convert from posix time.
+ return (sec_part + usec_part + ACE_UINT64_LITERAL (0x1B21DD213814000));
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h
new file mode 100644
index 00000000000..b8f0b2a4d1f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h
@@ -0,0 +1,107 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_Service_Callbacks.h
+ *
+ * $Id$
+ *
+ * A concrete FT service callback implementation
+ *
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_FT_CALLBACKS_H
+#define TAO_FT_CALLBACKS_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FaultTolerance/FT_ClientORB_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Service_Callbacks.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Profile;
+class TAO_MProfile;
+class TAO_ORB_Core;
+
+/**
+ * @class TAO_FT_Service_Callbacks
+ *
+ * @brief A class to dynamically load the FT callback implementations in
+ * to the ORB.
+ *
+ * An implementation of the service callbacks that allows the
+ * loading of the FT ORB level library in to the ORB
+ */
+class TAO_FT_ClientORB_Export TAO_FT_Service_Callbacks : public TAO_Service_Callbacks
+{
+public:
+ /// Constructor
+ TAO_FT_Service_Callbacks (TAO_ORB_Core *orb_core);
+
+ /// Dtor
+ virtual ~TAO_FT_Service_Callbacks (void);
+
+ /// Check whether <obj> is nil or not. FT spec suggests some
+ /// extensions for a CORBA::is_nil () operation.
+ virtual CORBA::Boolean object_is_nil (CORBA::Object_ptr obj);
+
+ /// Check for equivalency of the two profiles
+ virtual TAO_Service_Callbacks::Profile_Equivalence is_profile_equivalent (
+ const TAO_Profile *,
+ const TAO_Profile *);
+ /// Calculate the hash
+ virtual CORBA::ULong hash_ft (TAO_Profile *p,
+ CORBA::ULong m);
+
+
+ /// Verify condition for permanent forward is given,
+ /// both parameters must provide group attributes.
+ virtual CORBA::Boolean is_permanent_forward_condition
+ (const CORBA::Object_ptr obj,
+ const TAO_Service_Context &service_context) const;
+
+ /// Check whether we need to raise an exception or go for a
+ /// reinvocaton.
+ virtual TAO::Invocation_Status raise_comm_failure (
+ IOP::ServiceContextList &clist,
+ TAO_Profile *profile
+ ACE_ENV_ARG_DECL);
+
+ /// Check whether we need to raise an exception or go for a
+ /// reinvocaton.
+ virtual TAO::Invocation_Status raise_transient_failure (
+ IOP::ServiceContextList &clist,
+ TAO_Profile *profile
+ ACE_ENV_ARG_DECL);
+
+ static TimeBase::TimeT now (void);
+
+private:
+
+ /// Check whether the right flags are available so that we can issue a
+ /// restart.
+ CORBA::Boolean restart_policy_check (IOP::ServiceContextList &service_list,
+ const TAO_Profile *profile);
+
+private:
+ /// The ORB core in which we have been activated
+ TAO_ORB_Core *orb_core_;
+
+ /// Mutex to protect access to the profile that gets passed along
+ /// @@ Lock needs to be removed...
+ ACE_Lock* profile_lock_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /*TAO_FT_CALLBACKS_H*/
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/fault_tol_export.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/fault_tol_export.h
new file mode 100644
index 00000000000..2179965445a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/fault_tol_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_FT_EXPORT_H
+#define TAO_FT_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_FT_HAS_DLL)
+# define TAO_FT_HAS_DLL 0
+# endif /* ! TAO_FT_HAS_DLL */
+#else
+# if !defined (TAO_FT_HAS_DLL)
+# define TAO_FT_HAS_DLL 1
+# endif /* ! TAO_FT_HAS_DLL */
+#endif
+
+#if defined (TAO_FT_HAS_DLL) && (TAO_FT_HAS_DLL == 1)
+# if defined (TAO_FT_BUILD_DLL)
+# define TAO_FT_Export ACE_Proper_Export_Flag
+# define TAO_FT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_FT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_FT_BUILD_DLL */
+# define TAO_FT_Export ACE_Proper_Import_Flag
+# define TAO_FT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_FT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_FT_BUILD_DLL */
+#else /* TAO_FT_HAS_DLL == 1 */
+# define TAO_FT_Export
+# define TAO_FT_SINGLETON_DECLARATION(T)
+# define TAO_FT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_FT_HAS_DLL == 1 */
+
+#endif /* TAO_FT_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/ftconf.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/ftconf.h
new file mode 100644
index 00000000000..a1b6da98a8c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/ftconf.h
@@ -0,0 +1,42 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file ftconf.h
+ *
+ * $Id$
+ *
+ * Build configuration file.
+ *
+ * @author Copyright 1995 by Sun Microsystems, Inc.
+ * @author Chris Cleeland
+ * @author Douglas C. Schmidt
+ */
+//=============================================================================
+
+#ifndef TAO_FTCONF_H
+#define TAO_FTCONF_H
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+// This is the version of the FT_CORBA spec that TAO supports. The
+// exact use of this version has not been emphasised. But TAO would
+// get TaggedComponents for a group with version number. So, for the
+// present we will have this here and do a sanity check for our
+// supported version and the one we receive -- raise an error if
+// necessary.
+
+#if !defined (TAO_DEF_FT_CORBA_MAJOR)
+#define TAO_DEF_FT_CORBA_MAJOR 1
+#endif /* TAO_DEF_FT_CORBA_MAJOR */
+#if !defined (TAO_DEF_FT_CORBA_MINOR)
+#define TAO_DEF_FT_CORBA_MINOR 0
+#endif /* TAO_DEF_FT_CORBA_MINOR */
+
+#include /**/ "ace/post.h"
+#endif /*TAO_FTCONF_H*/
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent.mpc b/TAO/orbsvcs/orbsvcs/FtRtEvent.mpc
new file mode 100644
index 00000000000..b510974a944
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent.mpc
@@ -0,0 +1,83 @@
+// -*- MPC -*-
+// $Id$
+
+project (FtRtEvent) : orbsvcslib, core, ftorbutils, rtevent_serv, naming, minimum_corba, pi_server, tao_versioning_idl_defaults {
+ sharedname = TAO_FtRtEvent
+ idlflags += -Wb,export_macro=TAO_FtRtEvent_Export -Wb,export_include=orbsvcs/FtRtEvent/Utils/ftrtevent_export.h
+ dynamicflags = TAO_FTRTEVENT_BUILD_DLL
+ tagchecks += FtRtEvent
+
+ IDL_Files {
+ idlflags += -GC
+ FTRT.idl
+ FtRtecEventComm.idl
+ FTRT_GroupManager.idl
+ }
+
+ IDL_Files {
+ FtRtecEventChannelAdmin.idl
+ }
+
+ Source_Files (ORBSVCS_COMPONENTS) {
+ FtRtEvent {
+ FTRTC.cpp
+ FTRTS.cpp
+ FtRtecEventCommC.cpp
+ FtRtecEventCommS.cpp
+ FTRT_GroupManagerC.cpp
+ FTRT_GroupManagerS.cpp
+ FtRtecEventChannelAdminC.cpp
+ FtRtecEventChannelAdminS.cpp
+ FtRtEvent/Utils
+ }
+ }
+
+ Template_Files {
+ }
+}
+
+project (FTRT_ClientORB) : messaging, orbsvcslib, pi, core {
+ sharedname = TAO_FTRT_ClientORB
+ dynamicflags = TAO_FTRT_BUILD_DLL
+ tagchecks += FTRT_ClientORB
+
+ IDL_Files {
+ }
+
+ Source_Files (ORBSVCS_COMPONENTS) {
+ FTRT_ClientORB {
+ FtRtEvent/ClientORB
+ }
+ }
+
+ Inline_Files {
+ }
+
+ Template_Files {
+ }
+}
+
+project (FTRT_EventChannel) : orbsvcslib, core, ftrtevent, rtevent_serv, utils, pi_server, corba_messaging {
+ sharedname = TAO_FTRT_EventChannel
+ dynamicflags = TAO_FTRTEC_BUILD_DLL
+ tagchecks += FTRT_EventChannel
+ after += FTORB_Utils
+
+ IDL_Files {
+ }
+
+ Source_Files (ORBSVCS_COMPONENTS) {
+ FTRT_EventChannel {
+ FtRtEvent/EventChannel
+ }
+ }
+ Template_Files {
+ FtRtEvent/EventChannel/ConnectionHandler_T.cpp
+ FtRtEvent/EventChannel/Fault_Detector_T.cpp
+ FtRtEvent/EventChannel/FT_ProxyAdmin_T.cpp
+ }
+
+ Header_Files {
+ FtRtEvent/EventChannel/ftrtec_export.h
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Initializer.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Initializer.cpp
new file mode 100644
index 00000000000..e4ee1d43f28
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Initializer.cpp
@@ -0,0 +1,35 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Initializer.h"
+#include "orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Interceptor.h"
+
+ACE_RCSID (ClientORB,
+ FTRT_ClientORB_Initializer,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+FTRT_ClientORB_Initializer::FTRT_ClientORB_Initializer (int transaction_depth)
+ : client_interceptor_ ( new FTRT_ClientORB_Interceptor(transaction_depth) )
+{
+}
+
+void
+FTRT_ClientORB_Initializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+FTRT_ClientORB_Initializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ info->add_client_request_interceptor (client_interceptor_.in()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Initializer.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Initializer.h
new file mode 100644
index 00000000000..7bfd0791eb1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Initializer.h
@@ -0,0 +1,65 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FTRT_ClientORB_Initializer.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef FTRT_CLIENTORB_INITIALIZER_H
+#define FTRT_CLIENTORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/PI/PI.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// RTCORBA ORB initializer.
+class FTRT_ClientORB_Initializer
+ : public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+ /// Priority mapping types
+ FTRT_ClientORB_Initializer (int transaction_depth);
+
+ 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:
+ PortableInterceptor::ClientRequestInterceptor_var client_interceptor_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+
+#include /**/ "ace/post.h"
+
+#endif /* FTRT_CLIENTORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Interceptor.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Interceptor.cpp
new file mode 100644
index 00000000000..1cc5d2fd2de
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Interceptor.cpp
@@ -0,0 +1,161 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Interceptor.h"
+#include "tao/MProfile.h"
+#include "tao/Stub.h"
+#include "tao/CDR.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID (ClientORB,
+ FTRT_ClientORB_Interceptor,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace FTRT {
+ const unsigned FT_TRANSACTION_DEPTH = 30;
+ const unsigned FT_FORWARD = 32;
+}
+
+FTRT_ClientORB_Interceptor::
+FTRT_ClientORB_Interceptor (CORBA::Long transaction_depth)
+ : myname_ ("FTRT_ClientORB_Interceptor")
+ , transaction_depth_(transaction_depth)
+{
+}
+
+FTRT_ClientORB_Interceptor::~FTRT_ClientORB_Interceptor (void)
+{
+}
+
+char *
+FTRT_ClientORB_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup (this->myname_);
+}
+
+void
+FTRT_ClientORB_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+FTRT_ClientORB_Interceptor::send_poll (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+FTRT_ClientORB_Interceptor::send_request (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_TRACE("FTRT_ClientORB_Interceptor::send_request");
+ ACE_TRY
+ {
+ // Add FT_REQUEST context
+ IOP::ServiceContext sc;
+ TAO_OutputCDR cdr;
+
+ if ((cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)) ==0)
+ return;
+
+ // Add Transaction Depth Context
+ if ((cdr << transaction_depth_) == 0)
+ return;
+ sc.context_id = FTRT::FT_TRANSACTION_DEPTH;
+
+ ACE_Message_Block mb;
+ ACE_CDR::consolidate(&mb, cdr.begin());
+#if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
+ sc.context_data.replace(mb.length(), &mb);
+#else
+ // If the replace method is not available, we will need
+ // to do the copy manually. First, set the octet sequence length.
+ CORBA::ULong length = mb.length ();
+ sc.context_data.length (length);
+
+ // Now copy over each byte.
+ char* base = mb.data_block ()->base ();
+ for(CORBA::ULong i = 0; i < length; i++)
+ {
+ sc.context_data[i] = base[i];
+ }
+#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
+
+ ri->add_request_service_context (sc, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Not much can be done anyway. Just keep quiet
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+FTRT_ClientORB_Interceptor::receive_reply (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRACE("FTRT_ClientORB_Interceptor::receive_reply");
+
+
+ IOP::ServiceContext_var service_context;
+ ACE_TRY {
+ service_context =
+ ri->get_reply_service_context(FTRT::FT_FORWARD
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY {
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+
+ const char * buf =
+ reinterpret_cast<const char *> (service_context->context_data.get_buffer ());
+
+ TAO_InputCDR cdr (buf,
+ service_context->context_data.length ());
+
+
+ CORBA::Object_var obj;
+
+ if (cdr >> obj) {
+ // update the target
+ CORBA::Object_var target = ri->target(ACE_ENV_SINGLE_ARG_PARAMETER);
+ target->_stubobj ()->base_profiles ( obj->_stubobj()->base_profiles() );
+ ACE_DEBUG((LM_DEBUG, "target object updated\n"));
+ }
+}
+
+void
+FTRT_ClientORB_Interceptor::receive_other (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+FTRT_ClientORB_Interceptor::receive_exception (
+ PortableInterceptor::ClientRequestInfo_ptr /* ri */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Interceptor.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Interceptor.h
new file mode 100644
index 00000000000..81512859796
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Interceptor.h
@@ -0,0 +1,90 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FTRT_ClientORB_Interceptor.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_FTRT_CLIENTORB_INTERCEPTOR_H
+#define TAO_FTRT_CLIENTORB_INTERCEPTOR_H
+
+#include /**/ "ace/pre.h"
+
+
+#include "tao/PI/PI.h"
+#include "tao/PortableInterceptorC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class FTRT_ClientORB_Interceptor
+ : public virtual PortableInterceptor::ClientRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+ /// ctor.
+ FTRT_ClientORB_Interceptor (CORBA::Long transaction_depth);
+
+ /// dtor.
+ virtual ~FTRT_ClientORB_Interceptor ();
+
+ /// Canonical name of the interceptor.
+ 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 send_poll (PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+private:
+ const char *myname_;
+ CORBA::Long transaction_depth_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Loader.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Loader.cpp
new file mode 100644
index 00000000000..adac1b323a4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Loader.cpp
@@ -0,0 +1,107 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Loader.h"
+
+#include "orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Initializer.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+#include "tao/ORBInitializer_Registry.h"
+#include "ace/OS_NS_strings.h"
+
+ACE_RCSID (ClientORB,
+ FTRT_ClientORB_Loader,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_FTRT {
+ FTRT_ClientORB_Loader::FTRT_ClientORB_Loader (void)
+ {
+ }
+
+ FTRT_ClientORB_Loader::~FTRT_ClientORB_Loader (void)
+ {
+ }
+
+ int FTRT_ClientORB_Loader::init (int argc,
+ ACE_TCHAR* argv[])
+ {
+ static int initialized = 0;
+
+ // Only allow initialization once.
+ if (initialized)
+ return 0;
+
+ initialized = 1;
+
+ // Set defaults.
+ int transaction_depth = 1;
+ int curarg = 0;
+
+ // Parse any service configurator parameters.
+ for (curarg = 0; curarg < argc; curarg++)
+ if (ACE_OS::strcasecmp (argv[curarg],
+ ACE_TEXT("-ORBTransactionDepth")) == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ transaction_depth = atoi(argv[curarg]);
+ }
+
+
+ // Register the ORB initializer.
+ ACE_TRY_NEW_ENV
+ {
+ PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
+ PortableInterceptor::ORBInitializer::_nil ();
+ PortableInterceptor::ORBInitializer_var orb_initializer;
+
+ /// Register the RTCORBA ORBInitializer.
+ ACE_NEW_THROW_EX (temp_orb_initializer,
+ FTRT_ClientORB_Initializer(transaction_depth),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_TRY_CHECK;
+ orb_initializer = temp_orb_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Unexpected exception caught while "
+ "initializing the TransactionDepth");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ /////////////////////////////////////////////////////////////////////
+
+ACE_FACTORY_NAMESPACE_DEFINE (
+ TAO_FTRT,
+ FTRT_ClientORB_Loader,
+ TAO_FTRT::FTRT_ClientORB_Loader)
+
+ACE_STATIC_SVC_DEFINE (
+ FTRT_ClientORB_Loader,
+ ACE_TEXT ("FTRT_ClientORB_Service"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (FTRT_ClientORB_Loader),
+ ACE_Service_Type::DELETE_THIS
+ | ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Loader.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Loader.h
new file mode 100644
index 00000000000..e66f632a2e8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Loader.h
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FTRT_ClientORB_Loader.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef FTRT_CLIENTORB_LOADER_H
+#define FTRT_CLIENTORB_LOADER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FtRtEvent/ClientORB/ftrt_clientorb_export.h"
+
+#include "tao/orbconf.h"
+
+#include "ace/Service_Object.h"
+#include "ace/Service_Config.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ORB_Core;
+
+namespace TAO_FTRT {
+
+ class TAO_FTRT_Export FTRT_ClientORB_Loader : public ACE_Service_Object
+ {
+ public:
+ /// Constructor.
+ FTRT_ClientORB_Loader (void);
+
+ /// Destructor.
+ virtual ~FTRT_ClientORB_Loader (void);
+
+ /// Initialize the TransactionDepth loader hooks.
+ virtual int init (int argc,
+ ACE_TCHAR* []);
+ };
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE_EXPORT (TAO_FTRT, FTRT_ClientORB_Loader)
+ACE_STATIC_SVC_REQUIRE(FTRT_ClientORB_Loader)
+ACE_FACTORY_DECLARE (TAO_FTRT, FTRT_ClientORB_Loader)
+
+#include /**/ "ace/post.h"
+#endif //FTRT_CLIENTORB_LOADER_H
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/ftrt_clientorb_export.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/ftrt_clientorb_export.h
new file mode 100644
index 00000000000..9dad27d931a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/ClientORB/ftrt_clientorb_export.h
@@ -0,0 +1,60 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TAO_FTRT
+// ------------------------------
+#ifndef TAO_FTRT_EXPORT_H
+#define TAO_FTRT_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_FTRT_HAS_DLL)
+# define TAO_FTRT_HAS_DLL 0
+# endif /* ! TAO_FTRT_HAS_DLL */
+#else
+# if !defined (TAO_FTRT_HAS_DLL)
+# define TAO_FTRT_HAS_DLL 1
+# endif /* ! TAO_FTRT_HAS_DLL */
+#endif
+
+#if defined (TAO_FTRT_HAS_DLL) && (TAO_FTRT_HAS_DLL == 1)
+# if defined (TAO_FTRT_BUILD_DLL)
+# define TAO_FTRT_Export ACE_Proper_Export_Flag
+# define TAO_FTRT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_FTRT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_FTRT_BUILD_DLL */
+# define TAO_FTRT_Export ACE_Proper_Import_Flag
+# define TAO_FTRT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_FTRT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_FTRT_BUILD_DLL */
+#else /* TAO_FTRT_HAS_DLL == 1 */
+# define TAO_FTRT_Export
+# define TAO_FTRT_SINGLETON_DECLARATION(T)
+# define TAO_FTRT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_FTRT_HAS_DLL == 1 */
+
+// Set TAO_FTRT_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TAO_FTRT_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TAO_FTRT_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TAO_FTRT_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TAO_FTRT_NTRACE */
+
+#if (TAO_FTRT_NTRACE == 1)
+# define TAO_FTRT_TRACE(X)
+#else /* (TAO_FTRT_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define TAO_FTRT_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (TAO_FTRT_NTRACE == 1) */
+
+#endif /* TAO_FTRT_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Primary_Replication_Strategy.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Primary_Replication_Strategy.cpp
new file mode 100644
index 00000000000..0bae38d051d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Primary_Replication_Strategy.cpp
@@ -0,0 +1,222 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/AMI_Primary_Replication_Strategy.h"
+#include "ace/Synch_T.h"
+#include "orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h"
+#include "orbsvcs/FtRtEvent/EventChannel/create_persistent_poa.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Update_Manager.h"
+#include "tao/Utils/PolicyList_Destroyer.h"
+#include "orbsvcs/FtRtEvent/EventChannel/ObjectGroupManagerHandler.h"
+#include "tao/Utils/Implicit_Deactivator.h"
+#include "../Utils/resolve_init.h"
+#include "../Utils/ScopeGuard.h"
+#include "../Utils/Log.h"
+
+ACE_RCSID (EventChannel,
+ AMI_Primary_Replication_Strategy,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+AMI_Primary_Replication_Strategy::AMI_Primary_Replication_Strategy(bool mt)
+ : handler_(this),
+ mutex_ (mt ? new ACE_SYNCH_RW_MUTEX : 0)
+{
+}
+
+AMI_Primary_Replication_Strategy::~AMI_Primary_Replication_Strategy()
+{
+ running_= false;
+ this->wait();
+}
+
+int AMI_Primary_Replication_Strategy::acquire_read (void)
+{
+ return mutex_ ? mutex_->acquire_read() : 0;
+}
+
+int AMI_Primary_Replication_Strategy::acquire_write (void)
+{
+ return mutex_ ? mutex_->acquire_write() : 0;
+}
+
+int AMI_Primary_Replication_Strategy::release (void)
+{
+ return mutex_ ? mutex_->release() : 0;
+}
+
+int AMI_Primary_Replication_Strategy::svc()
+{
+ ACE_TRY_NEW_ENV {
+ int argc = 0;
+ char** argv = 0;
+ orb_ = CORBA::ORB_init (argc, argv);
+ ACE_TRY_CHECK;
+
+ root_poa_ = resolve_init<PortableServer::POA>(orb_.in(), "RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // create POAManager
+ mgr_ = root_poa_->the_POAManager(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ mgr_->activate(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::IdUniquenessPolicy_var id_uniqueness_policy =
+ root_poa_->create_id_uniqueness_policy(PortableServer::MULTIPLE_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK
+
+ TAO::Utils::PolicyList_Destroyer policy_list(3);
+ policy_list.length(1);
+ policy_list[0] = PortableServer::IdUniquenessPolicy::_duplicate(
+ id_uniqueness_policy.in()
+ );
+ poa_ = create_persistent_poa(root_poa_, mgr_, "AMI_Update", policy_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ id_uniqueness_policy->destroy();
+
+ running_ = true;
+ while (running_) {
+ if (orb_->work_pending())
+ orb_->perform_work();
+ }
+ orb_->destroy();
+ }
+ ACE_CATCHANY {
+ ACE_PRINT_EXCEPTION(ex, "AMI_Primary_Replication_Strategy::svc");
+ running_ = false;
+ return -1;
+ }
+ ACE_ENDTRY;
+ running_ = false;
+ return 0;
+}
+
+void
+AMI_Primary_Replication_Strategy::replicate_request(
+ const FTRT::State& state,
+ RollbackOperation rollback,
+ const FtRtecEventChannelAdmin::ObjectId& oid
+ ACE_ENV_ARG_DECL)
+{
+ ACE_Auto_Event event;
+ Update_Manager* manager = 0;
+ bool success = false;
+
+ FTRT::TransactionDepth transaction_depth =
+ Request_Context_Repository().get_transaction_depth(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const FtRtecEventChannelAdmin::EventChannelList& backups =
+ GroupInfoPublisher::instance()->backups();
+
+ size_t num_backups = backups.length();
+
+ if ((size_t)transaction_depth > num_backups) {
+ TAO_FTRTEC::Log(3, "Throwing FTRT::TransactionDepthTooHigh\n");
+ ACE_THROW(FTRT::TransactionDepthTooHigh());
+ }
+
+ ACE_NEW_THROW_EX(manager,
+ Update_Manager(event, backups.length(), transaction_depth-1, success),
+ CORBA::NO_MEMORY());
+
+
+ Request_Context_Repository().set_transaction_depth(0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ for (size_t i = 0; i < num_backups; ++i) {
+ PortableServer::ObjectId oid;
+ ACE_TRY_EX(block1) {
+ FTRT::AMI_UpdateableHandler_ptr handler = handler_.activate(manager, i, oid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK_EX(block1);
+ FtRtecEventChannelAdmin::EventChannel_ptr obj = backups[i];
+ // send set_update request to all the backup replicas
+
+ obj->sendc_set_update(handler, state
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block1);
+ }
+ ACE_CATCHANY {
+ ACE_PRINT_EXCEPTION(ex, "AMI_Primary_Replication_Strategy::replicate_request : ");
+ manager->handle_exception(i);
+ if (oid.length())
+ poa_->deactivate_object(oid);
+ }
+ ACE_ENDTRY;
+ }
+ // wait until the first transaction_depth replicas replied.
+ event.wait();
+
+ if (!success) { // replication failed, transaction depth too high
+ for (size_t i =0; i < num_backups; ++i) {
+ ACE_TRY_EX(block2) {
+ (backups[i]->*rollback)(oid ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block2);
+ }
+ ACE_CATCHALL {
+ }
+ ACE_ENDTRY;
+ }
+ TAO_FTRTEC::Log(3, "Throwing FTRT::TransactionDepthTooHigh\n");
+ ACE_THROW(FTRT::TransactionDepthTooHigh());
+ }
+
+}
+
+void
+AMI_Primary_Replication_Strategy::add_member(const FTRT::ManagerInfo & info,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL)
+{
+ ACE_Auto_Event event;
+ const FtRtecEventChannelAdmin::EventChannelList& backups =
+ GroupInfoPublisher::instance()->backups();
+
+ size_t num_backups = backups.length();
+ ObjectGroupManagerHandler add_member_handler(event, num_backups+1);
+ // The extra one is to prevent the event been signaled prematurely.
+
+ PortableServer::ObjectId_var oid =
+ root_poa_->activate_object(&add_member_handler ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO::Utils::Implicit_Deactivator deactivator(&add_member_handler);
+
+ CORBA::Object_var obj =
+ root_poa_->id_to_reference(oid.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ FTRT::AMI_ObjectGroupManagerHandler_var handler =
+ FTRT::AMI_ObjectGroupManagerHandler::_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+
+ for (unsigned i = 0; i < num_backups; ++i) {
+ ACE_TRY {
+ backups[i]->sendc_add_member(handler.in(),
+ info,
+ object_group_ref_version
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL {
+ add_member_handler.add_member_excep(0 ACE_ENV_ARG_PARAMETER);
+ }
+ ACE_ENDTRY;
+ }
+ // decrement the number of members so the event can be signaled once
+ // all replys have been received.
+ add_member_handler.add_member_excep(0 ACE_ENV_ARG_PARAMETER);
+
+ event.wait();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Primary_Replication_Strategy.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Primary_Replication_Strategy.h
new file mode 100644
index 00000000000..24d44799505
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Primary_Replication_Strategy.h
@@ -0,0 +1,67 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file AMI_Primary_Replication_Strategy.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef AMI_PRIMARY_REPLICATION_STRATEGY_H
+#define AMI_PRIMARY_REPLICATION_STRATEGY_H
+
+#include "orbsvcs/FtRtEvent/EventChannel/UpdateableHandler.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Replication_Strategy.h"
+#include "orbsvcs/FtRtecEventChannelAdminC.h"
+#include "ace/Task.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class AMI_Primary_Replication_Strategy.
+ *
+ * @brief Used by primary replicas when AMI calls are used for replicating requests.
+ */
+
+class AMI_Primary_Replication_Strategy : public Replication_Strategy
+ , public ACE_Task_Base
+{
+public:
+ /**
+ * @param mt Specifies whether multithreaded ORB is used.
+ */
+ AMI_Primary_Replication_Strategy(bool mt);
+ virtual ~AMI_Primary_Replication_Strategy();
+ virtual void replicate_request(const FTRT::State& state,
+ RollbackOperation rollback,
+ const FtRtecEventChannelAdmin::ObjectId& oid
+ ACE_ENV_ARG_DECL);
+ virtual void add_member(const FTRT::ManagerInfo & info,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL);
+ virtual int acquire_read (void);
+ virtual int acquire_write (void);
+ virtual int release (void);
+ PortableServer::POA_ptr poa() { return poa_.in(); }
+ CORBA::ORB_ptr orb() { return orb_.in();}
+private:
+ virtual int svc (void);
+ CORBA::ORB_var orb_;
+ PortableServer::POA_var root_poa_;
+ PortableServer::POA_var poa_;
+ PortableServer::POAManager_var mgr_;
+ bool running_;
+ UpdateableHandler handler_;
+ ACE_SYNCH_RW_MUTEX* mutex_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif // AMI_PRIMARY_REPLICATION_STRATEGY_H
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Replication_Strategy.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Replication_Strategy.cpp
new file mode 100644
index 00000000000..b4073479419
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Replication_Strategy.cpp
@@ -0,0 +1,71 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/AMI_Replication_Strategy.h"
+#include "orbsvcs/FtRtEvent/EventChannel/AMI_Primary_Replication_Strategy.h"
+
+#include "ace/Auto_Ptr.h"
+
+
+ACE_RCSID (EventChannel,
+ AMI_Replication_Strategy,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+AMI_Replication_Strategy::AMI_Replication_Strategy(bool mt)
+ : mt_(mt)
+{
+}
+
+AMI_Replication_Strategy::~AMI_Replication_Strategy()
+{
+}
+
+void
+AMI_Replication_Strategy::replicate_request(
+ const FTRT::State& state,
+ RollbackOperation rollback,
+ const FtRtecEventChannelAdmin::ObjectId& oid
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_UNUSED_ARG(state);
+ ACE_UNUSED_ARG(rollback);
+ ACE_UNUSED_ARG(oid);
+}
+
+void
+AMI_Replication_Strategy::add_member(const FTRT::ManagerInfo & info,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_UNUSED_ARG(info);
+ ACE_UNUSED_ARG(object_group_ref_version);
+}
+
+Replication_Strategy*
+AMI_Replication_Strategy::make_primary_strategy()
+{
+ AMI_Primary_Replication_Strategy* result;
+ ACE_NEW_RETURN(result, AMI_Primary_Replication_Strategy(mt_), 0);
+ auto_ptr<AMI_Primary_Replication_Strategy> holder(result);
+ if (result->activate() == 0)
+ return holder.release();
+ return 0;
+}
+
+int AMI_Replication_Strategy::acquire_read (void)
+{
+ return 0;
+}
+
+int AMI_Replication_Strategy::acquire_write (void)
+{
+ return 0;
+}
+
+int AMI_Replication_Strategy::release (void)
+{
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Replication_Strategy.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Replication_Strategy.h
new file mode 100644
index 00000000000..8c25f96305d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Replication_Strategy.h
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file AMI_Replication_Strategy.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef AMI_REPLICATION_STRATEGY_H
+#define AMI_REPLICATION_STRATEGY_H
+
+#include "orbsvcs/FtRtEvent/EventChannel/Replication_Strategy.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/FTRT_GroupManagerC.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "ace/Task.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class AMI_Replication_Strategy.
+ *
+ * @brief Used by backup replicas when AMI calls are used for replicating requests.
+ */
+class AMI_Replication_Strategy : public Replication_Strategy
+{
+public:
+ /**
+ * @param mt Specifies whether multithreaded ORB is used.
+ */
+ AMI_Replication_Strategy(bool mt);
+ ~AMI_Replication_Strategy();
+ virtual void replicate_request(const FTRT::State& state,
+ RollbackOperation rollback,
+ const FtRtecEventChannelAdmin::ObjectId& oid
+ ACE_ENV_ARG_DECL);
+ virtual void add_member(const FTRT::ManagerInfo & info,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL);
+ virtual Replication_Strategy* make_primary_strategy();
+
+ virtual int acquire_read (void);
+ virtual int acquire_write (void);
+ virtual int release (void);
+private:
+ bool mt_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Basic_Replication_Strategy.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Basic_Replication_Strategy.cpp
new file mode 100644
index 00000000000..50a4a5f4dff
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Basic_Replication_Strategy.cpp
@@ -0,0 +1,158 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/Basic_Replication_Strategy.h"
+#include "orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h"
+#include "../Utils/Log.h"
+
+ACE_RCSID (EventChannel,
+ Basic_Replication_Strategy,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// The mutex has to be recursive; otherwise, if the second replicate_request() is
+/// called while the first replicate_request() is waiting for reply, we will get
+/// a deadlock.
+Basic_Replication_Strategy::Basic_Replication_Strategy(bool mt)
+ : sequence_num_(0)
+ , mutex_(mt ? new ACE_SYNCH_RECURSIVE_MUTEX : 0)
+{
+}
+
+Basic_Replication_Strategy::~Basic_Replication_Strategy()
+{
+ delete mutex_;
+}
+
+void
+Basic_Replication_Strategy::check_validity(ACE_ENV_SINGLE_ARG_DECL)
+{
+ FTRT::SequenceNumber seq_no = Request_Context_Repository().get_sequence_number(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_FTRTEC::Log(1 , "check_validity : sequence no = %d\n", sequence_num_);
+
+ if (this->sequence_num_ == 0) {
+ // this is the first set_update received from the primary
+ // sync the sequence number with the primary
+ this->sequence_num_ = seq_no;
+ }
+ else if (seq_no != this->sequence_num_+1) {
+ // out of sync, we missed some set_update() request already
+ // throw exception
+ // client_interceptor_->sequence_num_--;
+ FTRT::OutOfSequence exception;
+ exception.current = this->sequence_num_;
+ TAO_FTRTEC::Log(3, "Throwing FTRT::OutOfSequence (old sequence_num_ = %d)\n", this->sequence_num_);
+ ACE_THROW(FTRT::OutOfSequence(exception));
+ }
+ else
+ this->sequence_num_++;
+}
+
+void twoway_set_update(FtRtecEventChannelAdmin::EventChannel_var successor,
+ const FTRT::State& state
+ ACE_ENV_ARG_DECL)
+{
+ bool finished = true;
+ do {
+ ACE_TRY {
+ successor->set_update(state ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH(CORBA::COMM_FAILURE, ex) {
+ if (ex.minor() == 6) finished = false;
+ else
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ } while(!finished);
+}
+
+void
+Basic_Replication_Strategy::replicate_request(
+ const FTRT::State& state,
+ RollbackOperation rollback,
+ const FtRtecEventChannelAdmin::ObjectId& oid
+ ACE_ENV_ARG_DECL)
+{
+ ACE_UNUSED_ARG(rollback);
+ ACE_UNUSED_ARG(oid);
+
+ FTRT::TransactionDepth transaction_depth =
+ Request_Context_Repository().get_transaction_depth(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ GroupInfoPublisherBase * info_publisher = GroupInfoPublisher::instance();
+ FtRtecEventChannelAdmin::EventChannel_var successor = info_publisher->successor();
+ if (!CORBA::is_nil(successor.in())) {
+ if (info_publisher->is_primary())
+ this->sequence_num_++;
+
+ TAO_FTRTEC::Log(1, "replicate_request : sequence no = %d\n", sequence_num_);
+ Request_Context_Repository().set_sequence_number(sequence_num_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ Request_Context_Repository().set_transaction_depth(transaction_depth-1 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (transaction_depth > 1) {
+ twoway_set_update(successor, state ACE_ENV_ARG_PARAMETER);
+ }
+ else {
+ ACE_TRY_EX(ONEWAY_SET_UPDATE) {
+ successor->oneway_set_update(state ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(ONEWAY_SET_UPDATE);
+ }
+ ACE_CATCHANY {
+ }
+ ACE_ENDTRY;
+ }
+ }
+ else if (transaction_depth > 1) {
+ TAO_FTRTEC::Log(3, "Throwing FTRT::TransactionDepthTooHigh\n");
+ ACE_THROW(FTRT::TransactionDepthTooHigh());
+ }
+}
+
+void
+Basic_Replication_Strategy::add_member(const FTRT::ManagerInfo & info,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL)
+{
+ FtRtecEventChannelAdmin::EventChannel_var successor = GroupInfoPublisher::instance()->successor();
+ bool finished = true;
+ do {
+ ACE_TRY {
+ successor->add_member(info, object_group_ref_version ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH(CORBA::COMM_FAILURE, ex) {
+ if (ex.minor() == 6) finished = false;
+ else ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ } while (!finished);
+}
+
+int Basic_Replication_Strategy::acquire_read (void)
+{
+ return mutex_ ? mutex_->acquire_read() : 0;
+}
+
+int Basic_Replication_Strategy::acquire_write (void)
+{
+ return mutex_ ? mutex_->acquire_write() : 0;
+}
+
+int Basic_Replication_Strategy::release (void)
+{
+ return mutex_ ? mutex_->release() : 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Basic_Replication_Strategy.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Basic_Replication_Strategy.h
new file mode 100644
index 00000000000..50b18dd95ee
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Basic_Replication_Strategy.h
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Basic_Replication_Strategy.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef BASIC_REPLICATION_STRATEGY_H
+#define BASIC_REPLICATION_STRATEGY_H
+#include "orbsvcs/FtRtEvent/EventChannel/Replication_Strategy.h"
+#include "ace/Synch.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class Basic_Replication_Strategy
+ *
+ * @brief Use two-way CORBA call to replicate the state to backup replicas.
+ */
+
+class Basic_Replication_Strategy : public Replication_Strategy
+{
+public:
+ /**
+ * @param mt Specifies whether multithreaded ORB is used.
+ */
+ Basic_Replication_Strategy(bool mt);
+ ~Basic_Replication_Strategy();
+
+ virtual void check_validity(ACE_ENV_SINGLE_ARG_DECL);
+
+ virtual void replicate_request(const FTRT::State& state,
+ RollbackOperation rollback,
+ const FtRtecEventChannelAdmin::ObjectId& oid
+ ACE_ENV_ARG_DECL);
+ virtual void add_member(const FTRT::ManagerInfo & info,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL);
+
+ virtual int acquire_read (void);
+ virtual int acquire_write (void);
+ virtual int release (void);
+
+private:
+ FTRT::SequenceNumber sequence_num_;
+ ACE_SYNCH_RECURSIVE_MUTEX* mutex_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ConnectionHandler_T.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ConnectionHandler_T.cpp
new file mode 100644
index 00000000000..a14d2c327eb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ConnectionHandler_T.cpp
@@ -0,0 +1,96 @@
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <ACE_PEER_STREAM_1>
+int ConnectionAcceptHandler<ACE_PEER_STREAM_2>::open (void * acceptor)
+{
+
+ ACE_TRACE("ConnectionAcceptHandler::open\n");
+ ACE_INET_Addr addr;
+
+ if (this->peer ().get_remote_addr (addr) == -1)
+ return -1;
+
+ reactor_ = static_cast<ACE_Service_Object*> (acceptor)->reactor();
+
+ if (reactor_->register_handler (this,
+ ACE_Event_Handler::READ_MASK) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) can't register with reactor\n"),
+ -1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) connected with %s\n",
+ addr.get_host_name ()));
+
+ return 0;
+}
+
+template <ACE_PEER_STREAM_1>
+void ConnectionAcceptHandler<ACE_PEER_STREAM_2>::destroy (void)
+{
+ // Remove ourselves from the reactor
+ reactor_->remove_handler
+ (this,
+ ACE_Event_Handler::READ_MASK | ACE_Event_Handler::DONT_CALL);
+
+ // Shut down the connection to the client.
+ this->peer ().close ();
+
+ // Free our memory.
+ delete this;
+}
+
+// If somebody doesn't like us, they will close() us. Actually, if
+// our open() method returns -1, the Acceptor<> will invoke close()
+// on us for cleanup.
+template <ACE_PEER_STREAM_1>
+int ConnectionAcceptHandler<ACE_PEER_STREAM_2>::close (u_long flags)
+{
+ ACE_UNUSED_ARG (flags);
+
+ this->destroy ();
+ return 0;
+}
+
+
+template <ACE_PEER_STREAM_1>
+int ConnectionAcceptHandler<ACE_PEER_STREAM_2>::handle_input (ACE_HANDLE)
+{
+ char buf[8];
+ if (this->peer().recv(buf, sizeof(buf)))
+ return -1;
+ return 0;
+}
+
+// Clean ourselves up when handle_input() (or handle_timer()) returns -1
+
+template <ACE_PEER_STREAM_1>
+int ConnectionAcceptHandler<ACE_PEER_STREAM_2>::handle_close (ACE_HANDLE,
+ ACE_Reactor_Mask)
+{
+ this->destroy ();
+ return 0;
+}
+
+
+template <ACE_PEER_STREAM_1>
+int ConnectionDetectHandler<ACE_PEER_STREAM_2>::handle_close (ACE_HANDLE,
+ ACE_Reactor_Mask)
+{
+ ACE_TRACE("ConnectionDetectHandler::handle_close\n");
+ close();
+ return 0;
+}
+
+template <ACE_PEER_STREAM_1>
+int ConnectionDetectHandler<ACE_PEER_STREAM_2>::close (u_long )
+{
+ if (listener_)
+ listener_->connection_closed();
+ delete this;
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ConnectionHandler_T.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ConnectionHandler_T.h
new file mode 100644
index 00000000000..37a7597914d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ConnectionHandler_T.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file ConnectionHandler_T.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef CONNECTIONACCEPTHANDLER_H
+#define CONNECTIONACCEPTHANDLER_H
+
+#include "ace/Event_Handler.h"
+#include "ace/Svc_Handler.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <ACE_PEER_STREAM_1>
+class ConnectionAcceptHandler : public ACE_Svc_Handler <ACE_PEER_STREAM_2, ACE_NULL_SYNCH>
+{
+public:
+ virtual int open (void *);
+ virtual void destroy (void);
+ virtual int close (u_long flags = 0);
+protected:
+
+ virtual int handle_input (ACE_HANDLE);
+ virtual int handle_close (ACE_HANDLE,
+ ACE_Reactor_Mask);
+ ~ConnectionAcceptHandler(){}
+private:
+ ACE_Reactor* reactor_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <ACE_PEER_STREAM_1>
+class ConnectionDetectHandler : public ACE_Svc_Handler <ACE_PEER_STREAM_2, ACE_NULL_SYNCH>
+{
+public:
+ ConnectionDetectHandler(TAO_FTEC_Fault_Listener* listener = NULL)
+ : listener_(listener){}
+
+ virtual int close (u_long flags = 0);
+
+ virtual int handle_close (ACE_HANDLE,
+ ACE_Reactor_Mask);
+private:
+ TAO_FTEC_Fault_Listener* listener_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/FtRtEvent/EventChannel/ConnectionHandler_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ConnectionHandler_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif
+
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.cpp
new file mode 100644
index 00000000000..264de9de473
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.cpp
@@ -0,0 +1,125 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.h"
+#include <assert.h>
+#include <algorithm>
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.inl"
+#endif /* __ACE_INLINE__ */
+
+inline unsigned ceil(unsigned numerator, unsigned denominator)
+{
+ return numerator/denominator+ (numerator%denominator ? 1 : 0);
+}
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+Dynamic_Bitset::Dynamic_Bitset(Dynamic_Bitset::size_type size)
+ : buffer_size_(ceil(size,BITS_PER_BLOCK))
+ , bit_size_(size)
+ , buffer_(new block[buffer_size_])
+{
+ memset(buffer_, 0, buffer_size_*BYTES_PER_BLOCK);
+}
+
+
+Dynamic_Bitset& Dynamic_Bitset::operator = (const Dynamic_Bitset& other)
+{
+ Dynamic_Bitset temp(other);
+ // swap buffer
+ block* tmp_blk = temp.buffer_;
+ temp.buffer_ = this->buffer_;
+ this->buffer_= tmp_blk;
+
+ this->buffer_size_ = other.buffer_size_;
+ this->bit_size_ = other.bit_size_;
+ return *this;
+}
+
+Dynamic_Bitset& Dynamic_Bitset::operator &=(const Dynamic_Bitset& other)
+{
+ assert(other.bit_size_ == this->bit_size_);
+ size_type len = ceil(bit_size_,BITS_PER_BLOCK);
+ for (size_type i = 0; i < len; ++i)
+ buffer_[i] &= other.buffer_[i];
+ return *this;
+}
+
+bool Dynamic_Bitset::test(Dynamic_Bitset::size_type bit) const
+{
+ size_type block_pos = bit/BITS_PER_BLOCK;
+ size_type bit_pos = bit%BITS_PER_BLOCK;
+ block mask = 1 << bit_pos;
+ return (buffer_[block_pos] & mask) !=0;
+}
+
+void Dynamic_Bitset::set(Dynamic_Bitset::size_type bit, bool val)
+{
+ size_type block_pos = bit/BITS_PER_BLOCK;
+ size_type bit_pos = bit%BITS_PER_BLOCK;
+ block mask = 1 << bit_pos;
+ if (val == false)
+ mask ^= static_cast<block> (-1);
+ buffer_[block_pos] |= mask;
+}
+
+void Dynamic_Bitset::flip()
+{
+ size_type len = ceil(bit_size_,BITS_PER_BLOCK);
+ block mask = static_cast<block> (-1);
+ for (size_type i = 0; i < len; ++i)
+ buffer_[i] ^= mask;
+}
+
+void Dynamic_Bitset::resize(Dynamic_Bitset::size_type num_bits, bool value)
+{
+ size_type len = ceil(num_bits, BITS_PER_BLOCK);
+ if (len > this->buffer_size_) {
+ Dynamic_Bitset tmp(num_bits);
+ memcpy(tmp.buffer_, this->buffer_, this->buffer_size_*BYTES_PER_BLOCK);
+ block mask = static_cast<block> (-1);
+
+ size_type block_pos = this->bit_size_/BITS_PER_BLOCK;
+ size_type bit_pos = this->bit_size_%BITS_PER_BLOCK;
+
+ if (value) {
+ mask <<= bit_pos;
+ tmp.buffer_[block_pos] |= mask;
+ }
+ else {
+ mask >>= (BITS_PER_BLOCK-bit_pos);
+ tmp.buffer_[block_pos] &= mask;
+ }
+
+
+ for (size_type i = block_pos +1; i < len; ++i) {
+ mask = value ? static_cast<block> (-1) : 0;
+ tmp.buffer_[i] = mask;
+ }
+
+ std::swap(tmp.buffer_, this->buffer_);
+ this->buffer_size_ = tmp.buffer_size_;
+ this->bit_size_ = tmp.bit_size_;
+ }
+ else
+ bit_size_ = num_bits;
+}
+
+bool operator == (const Dynamic_Bitset& lhs, const Dynamic_Bitset& rhs)
+{
+ Dynamic_Bitset::size_type bit_size = lhs.size();
+ if (bit_size != rhs.size())
+ return false;
+ Dynamic_Bitset::size_type block_pos = bit_size/Dynamic_Bitset::BITS_PER_BLOCK;
+ Dynamic_Bitset::size_type bit_pos = bit_size%Dynamic_Bitset::BITS_PER_BLOCK;
+ Dynamic_Bitset::size_type i;
+ for (i = 0; i < block_pos; ++i)
+ if (lhs.buffer_[i] != rhs.buffer_[i])
+ return false;
+ Dynamic_Bitset::block mask = static_cast<Dynamic_Bitset::block> (-1);
+ mask >>= (Dynamic_Bitset::BITS_PER_BLOCK-bit_pos);
+ return ((lhs.buffer_[i] ^ rhs.buffer_[i]) & mask ) == 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.h
new file mode 100644
index 00000000000..c4da90b00af
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.h
@@ -0,0 +1,76 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Dynamic_Bitset.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef DYNAMIC_BITSET_H
+#define DYNAMIC_BITSET_H
+
+#include "ace/config-all.h"
+
+#include "tao/Versioned_Namespace.h"
+#include "ace/OS_NS_string.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ *
+ */
+class Dynamic_Bitset
+{
+ typedef unsigned block;
+ typedef unsigned size_type;
+ enum {
+ BYTES_PER_BLOCK = sizeof(block),
+ BITS_PER_BLOCK = sizeof(block)*8
+ };
+public:
+ class reference {
+ public:
+ typedef unsigned size_type;
+ reference(Dynamic_Bitset* bitset, size_type bit);
+ reference operator = (bool val);
+ operator bool () const;
+ private:
+ Dynamic_Bitset* bitset_;
+ size_type bit_;
+ };
+
+ Dynamic_Bitset(size_type size=0);
+ ~Dynamic_Bitset();
+ Dynamic_Bitset(const Dynamic_Bitset& other);
+ Dynamic_Bitset& operator = (const Dynamic_Bitset& other);
+ Dynamic_Bitset& operator &=(const Dynamic_Bitset& other);
+
+ reference operator[](size_type bit);
+
+ size_type size() const;
+ bool test(size_type bit) const;
+
+ void set(size_type bit, bool val = true);
+ void flip();
+ void resize(size_type num_bits, bool value = false);
+
+ friend bool operator == (const Dynamic_Bitset& lhs, const Dynamic_Bitset& rhs);
+private:
+ size_type buffer_size_;
+ size_type bit_size_;
+ block* buffer_;
+};
+
+bool operator == (const Dynamic_Bitset& lhs, const Dynamic_Bitset& rhs);
+Dynamic_Bitset operator & (const Dynamic_Bitset& lhs, const Dynamic_Bitset& rhs);
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.inl b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.inl
new file mode 100644
index 00000000000..d9a1168d994
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.inl
@@ -0,0 +1,69 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Dynamic_Bitset.inl
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+Dynamic_Bitset::~Dynamic_Bitset()
+{
+ delete[] buffer_;
+}
+
+ACE_INLINE
+Dynamic_Bitset::Dynamic_Bitset(const Dynamic_Bitset& other)
+ : buffer_size_(other.buffer_size_)
+ , bit_size_(other.bit_size_)
+ , buffer_(new block[other.buffer_size_])
+{
+ ACE_OS::memcpy(buffer_, other.buffer_, buffer_size_*BYTES_PER_BLOCK);
+}
+
+ACE_INLINE
+Dynamic_Bitset operator & (const Dynamic_Bitset& lhs, const Dynamic_Bitset& rhs)
+{
+ Dynamic_Bitset tmp(lhs);
+ tmp &= rhs;
+ return tmp;
+}
+
+ACE_INLINE
+Dynamic_Bitset::reference::reference(Dynamic_Bitset* bitset, Dynamic_Bitset::reference::size_type bit)
+: bitset_(bitset), bit_(bit)
+{
+}
+
+ACE_INLINE
+Dynamic_Bitset::reference Dynamic_Bitset::reference::operator = (bool val)
+{
+ bitset_->set(bit_, val);
+ return *this;
+}
+
+ACE_INLINE
+Dynamic_Bitset::reference::operator bool () const
+{
+ return bitset_->test(bit_);
+}
+
+ACE_INLINE
+Dynamic_Bitset::size_type Dynamic_Bitset::size() const
+{
+ return bit_size_;
+}
+
+ACE_INLINE
+Dynamic_Bitset::reference Dynamic_Bitset::operator[](Dynamic_Bitset::size_type bit)
+{
+ return Dynamic_Bitset::reference(this, bit);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.cpp
new file mode 100644
index 00000000000..7f567ab80bb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.cpp
@@ -0,0 +1,11 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_FTEC_Become_Primary_Listener::~TAO_FTEC_Become_Primary_Listener()
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.h
new file mode 100644
index 00000000000..c2a056e29dc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.h
@@ -0,0 +1,31 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FTEC_Become_Primary_Listener.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_FTEC_BECOME_PRIMARY_LISTENER_H
+#define TAO_FTEC_BECOME_PRIMARY_LISTENER_H
+
+#include "orbsvcs/FtRtEvent/EventChannel/ftrtec_export.h"
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FTRTEC_Export TAO_FTEC_Become_Primary_Listener
+{
+public:
+ virtual ~TAO_FTEC_Become_Primary_Listener();
+ virtual void become_primary()=0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif // TAO_FTEC_BECOME_PRIMARY_LISTENER_H
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ConsumerAdmin.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ConsumerAdmin.cpp
new file mode 100644
index 00000000000..14ec7a5c533
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ConsumerAdmin.cpp
@@ -0,0 +1,51 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_ProxyConsumer.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ConsumerAdmin.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ProxySupplier.h"
+#include "orbsvcs/FtRtEvent/EventChannel/ProxySupplierStateWorker.h"
+
+ACE_RCSID (EventChannel,
+ TAO_FTEC_ConsumerAdmin,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+const FtRtecEventChannelAdmin::OperationType
+TAO_FTEC_ConsumerAdmin::OBTAIN_ID = FtRtecEventChannelAdmin::OBTAIN_PUSH_SUPPLIER;
+
+
+TAO_FTEC_ConsumerAdmin::TAO_FTEC_ConsumerAdmin (TAO_EC_Event_Channel_Base *ec)
+ : TAO_EC_ConsumerAdmin (ec)
+ , FT_Aspect(this, this->event_channel_->consumer_poa ())
+{
+}
+
+TAO_FTEC_ConsumerAdmin::~TAO_FTEC_ConsumerAdmin (void)
+{
+}
+
+
+
+RtecEventChannelAdmin::ProxyPushSupplier_ptr
+TAO_FTEC_ConsumerAdmin::obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG((LM_DEBUG,"obtain_push_supplier\n" ));
+ return obtain_proxy(ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_FTEC_ConsumerAdmin::disconnect(RtecEventChannelAdmin::ProxyPushSupplier_ptr obj)
+{
+ ACE_TRY_NEW_ENV {
+ obj->disconnect_push_supplier(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL {
+ }
+ ACE_ENDTRY;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ConsumerAdmin.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ConsumerAdmin.h
new file mode 100644
index 00000000000..042172fc555
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ConsumerAdmin.h
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FTEC_ConsumerAdmin.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef TAO_FTEC_CONSUMERADMIN_H
+#define TAO_FTEC_CONSUMERADMIN_H
+#include /**/ "ace/pre.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/EC_ConsumerAdmin.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.h"
+#include "orbsvcs/FtRtEvent/EventChannel/ProxySupplierStateWorker.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace FtRtecEventChannelAdmin {
+ struct ConsumerAdminState;
+}
+
+
+class TAO_FTEC_Event_Channel_Impl;
+class TAO_FTEC_ProxyPushSupplier;
+/**
+ * @class TAO_FTEC_ConsumerAdmin
+ *
+ * @brief Implements the ConsumerAdmin interface, i.e. the factory for
+ * TAO_FTEC_ProxyPushSupplier objects.
+ *
+ */
+class TAO_FTEC_ConsumerAdmin
+ : public TAO_EC_ConsumerAdmin
+ , public FT_ProxyAdmin<TAO_FTEC_ConsumerAdmin,
+ TAO_FTEC_ProxyPushSupplier,
+ RtecEventChannelAdmin::ProxyPushSupplier,
+ FtRtecEventChannelAdmin::ConsumerAdminState>
+{
+public:
+ static const FtRtecEventChannelAdmin::OperationType OBTAIN_ID ;
+
+ typedef FT_ProxyAdmin<TAO_FTEC_ConsumerAdmin,
+ TAO_FTEC_ProxyPushSupplier,
+ RtecEventChannelAdmin::ProxyPushSupplier,
+ FtRtecEventChannelAdmin::ConsumerAdminState>
+ FT_Aspect;
+
+ typedef ProxySupplierStateWorker StateWorker;
+ TAO_FTEC_ConsumerAdmin (TAO_EC_Event_Channel_Base* event_channel);
+
+ /// destructor...
+ virtual ~TAO_FTEC_ConsumerAdmin (void);
+
+ // = The RtecEventChannelAdmin::ConsumerAdmin methods...
+ virtual RtecEventChannelAdmin::ProxyPushSupplier_ptr
+ obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void disconnect(RtecEventChannelAdmin::ProxyPushSupplier_ptr obj);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_EC_CONSUMERADMIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel.cpp
new file mode 100644
index 00000000000..a2e2b7a29cd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel.cpp
@@ -0,0 +1,428 @@
+// $Id$
+
+#include "ace/Dynamic_Service.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.h"
+#include "../Utils/activate_with_id.h"
+#include "../Utils/resolve_init.h"
+#include "../Utils/UUID.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Fault_Detector.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Replication_Service.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Identification_Service.h"
+#include "orbsvcs/FtRtEvent/EventChannel/create_persistent_poa.h"
+#include "tao/Utils/PolicyList_Destroyer.h"
+#include "orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h"
+
+ACE_RCSID (EventChannel,
+ TAO_FTEC_Event_Channel,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_FTEC_Event_Channel::TAO_FTEC_Event_Channel(CORBA::ORB_var orb,
+ PortableServer::POA_var poa)
+ : orb_(orb)
+ , poa_(poa)
+ , ec_impl_(NULL)
+{
+}
+
+TAO_FTEC_Event_Channel::~TAO_FTEC_Event_Channel()
+{
+ delete ec_impl_;
+}
+
+
+void setup_object_group(TAO_FTEC_Event_Channel* es,
+ CosNaming::NamingContext_ptr naming_context,
+ TAO_FTEC_Event_Channel::MEMBERSHIP membership,
+ FtRtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ if (membership != TAO_FTEC_Event_Channel::UNSPECIFIED) {// register to naming service
+ FTRT::ManagerInfoList member_list;
+ member_list.length(1);
+ member_list[0].the_location = Fault_Detector::instance()->my_location();
+ member_list[0].ior = FTRT::ObjectGroupManager::_duplicate(ec);
+
+ if (membership == TAO_FTEC_Event_Channel::PRIMARY)
+ es->create_group(member_list, 0
+ ACE_ENV_ARG_PARAMETER);
+
+ else { // BACKUP
+ FtRtecEventChannelAdmin::EventChannel_var primary =
+ resolve<FtRtecEventChannelAdmin::EventChannel>(naming_context,
+ FTRTEC::Identification_Service::instance()->name()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "Got Primary address from Naming Service\n"));
+
+ primary->join_group(member_list[0] ACE_ENV_ARG_PARAMETER);
+ }
+ ACE_CHECK;
+ }
+}
+
+
+FtRtecEventChannelAdmin::EventChannel_ptr
+TAO_FTEC_Event_Channel::activate(TAO_FTEC_Event_Channel::MEMBERSHIP membership
+ ACE_ENV_ARG_DECL)
+{
+ FTRTEC::Fault_Detector_Loader* detector_loader =
+ ACE_Dynamic_Service<FTRTEC::Fault_Detector_Loader>::instance("FTRTEC_Fault_Detector");
+
+ detector_loader->init(0, 0);
+
+ if (FTRTEC::Identification_Service::instance() == 0)
+ ACE_ERROR_RETURN((LM_ERROR, "No Identification\n"), 0);
+
+ // initialize naming_contex
+ CosNaming::NamingContext_var naming_context
+ = resolve_init<CosNaming::NamingContext>(orb_.in(), "NameService"
+ ACE_ENV_ARG_PARAMETER);
+ // initialize group info publisher
+ GroupInfoPublisher::instance()->set_naming_context(naming_context);
+
+ if (FTRTEC::Replication_Service::instance()->init(0,0) == -1)
+ return 0;
+
+ GroupInfoPublisher::instance()->subscribe(FTRTEC::Replication_Service::instance());
+
+ Request_Context_Repository().init(orb_.in());
+
+ // get POAManager
+ PortableServer::POAManager_var mgr = poa_->the_POAManager(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ TAO::Utils::PolicyList_Destroyer policy_list(2);
+
+ persistent_poa_ =
+ create_persistent_poa(poa_, mgr, "FTEC_Persistant_POA", policy_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ // Activate the Event channel implementation
+
+ TAO_EC_Event_Channel_Attributes attr (persistent_poa_.in (),
+ persistent_poa_.in ());
+
+
+ TAO_FTEC_Event_Channel_Impl* ec;
+ ACE_NEW_THROW_EX (ec,
+ TAO_FTEC_Event_Channel_Impl (attr),
+ CORBA::NO_MEMORY());
+
+ this->ec_impl_ = ec;
+
+ const FtRtecEventComm::ObjectId& object_id
+ = FTRTEC::Identification_Service::instance()->object_id();
+
+ FtRtecEventComm::ObjectId consumer_admin_object_id(object_id);
+ consumer_admin_object_id[9]++;
+
+ FtRtecEventComm::ObjectId supplier_admin_object_id(consumer_admin_object_id);
+ supplier_admin_object_id[9]++;
+
+ ec->activate_object(orb_,
+ supplier_admin_object_id,
+ consumer_admin_object_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ FtRtecEventChannelAdmin::EventChannel_var result;
+ activate_object_with_id(result.out(), persistent_poa_.in(), this, object_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+
+ setup_object_group(this,
+ naming_context.in(),
+ membership,
+ result.in()
+ ACE_ENV_ARG_PARAMETER);
+ return result._retn();
+}
+
+
+void TAO_FTEC_Event_Channel::set_listener(TAO_FTEC_Become_Primary_Listener* listener)
+{
+ GroupInfoPublisher::instance()->subscribe(listener);
+}
+
+void TAO_FTEC_Event_Channel::set_update (
+ const FTRT::State & s
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , FTRT::InvalidUpdate
+ , FTRT::OutOfSequence
+ ))
+{
+ ec_impl_->set_update(s ACE_ENV_ARG_PARAMETER);
+}
+
+void TAO_FTEC_Event_Channel::oneway_set_update (
+ const FTRT::State & s
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ec_impl_->set_update(s ACE_ENV_ARG_PARAMETER);
+}
+
+
+RtecEventChannelAdmin::ConsumerAdmin_ptr
+TAO_FTEC_Event_Channel::for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return ec_impl_->for_consumers(ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+RtecEventChannelAdmin::SupplierAdmin_ptr
+TAO_FTEC_Event_Channel::for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return ec_impl_->for_suppliers(ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+
+void
+TAO_FTEC_Event_Channel::set_state (const FTRT::State & s ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FTRT::InvalidState))
+{
+ ACE_DEBUG((LM_DEBUG, "TAO_FTEC_Event_Channel::set_state\n"));
+ ec_impl_->set_state(s ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_FTEC_Event_Channel::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (Fault_Detector::instance())
+ Fault_Detector::instance()->stop();
+
+ ec_impl_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->orb_->shutdown ();
+}
+
+RtecEventChannelAdmin::Observer_Handle
+TAO_FTEC_Event_Channel::append_observer (RtecEventChannelAdmin::Observer_ptr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER))
+{
+ /// we have yet to implement the replication of observers
+ /// throw an exception for the moment
+ ACE_THROW_RETURN(RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER(), 0);
+
+ //return this->ec_impl_->append_observer (observer ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_FTEC_Event_Channel::remove_observer (RtecEventChannelAdmin::Observer_Handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_REMOVE_OBSERVER))
+{
+ /// we have yet to implement the replication of observers
+ /// throw an exception for the moment
+ ACE_THROW(RtecEventChannelAdmin::EventChannel::CANT_REMOVE_OBSERVER());
+
+ //ec_impl_->remove_observer (handle ACE_ENV_ARG_PARAMETER);
+}
+
+
+
+CORBA::Boolean
+TAO_FTEC_Event_Channel::start (
+ FTRT::FaultListener_ptr listener,
+ FTRT::Location_out location
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return ec_impl_->start(listener, location ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_FTEC_Event_Channel::create_group (
+ const FTRT::ManagerInfoList & info_list,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , FTRT::PredecessorUnreachable
+ ))
+{
+ ec_impl_->create_group(info_list, object_group_ref_version ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_FTEC_Event_Channel::join_group (
+ const FTRT::ManagerInfo & info
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ec_impl_->join_group(info ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_FTEC_Event_Channel::add_member (
+ const FTRT::ManagerInfo & info,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ec_impl_->add_member(info, object_group_ref_version ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_FTEC_Event_Channel::remove_member (
+ const FTRT::Location & crashed_location,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ec_impl_->remove_member(crashed_location,
+ object_group_ref_version
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_FTEC_Event_Channel::replica_crashed (
+ const FTRT::Location & location
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ec_impl_->replica_crashed(location ACE_ENV_ARG_PARAMETER);
+}
+
+
+ /// EventChannelFacade Interface
+
+::FtRtecEventChannelAdmin::ObjectId *
+TAO_FTEC_Event_Channel::connect_push_consumer (
+ RtecEventComm::PushConsumer_ptr push_consumer,
+ const RtecEventChannelAdmin::ConsumerQOS & qos
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , RtecEventChannelAdmin::TypeError
+ ))
+{
+ return ec_impl_->connect_push_consumer(push_consumer, qos
+ ACE_ENV_ARG_PARAMETER);
+}
+
+
+::FtRtecEventChannelAdmin::ObjectId *
+TAO_FTEC_Event_Channel::connect_push_supplier (
+ RtecEventComm::PushSupplier_ptr push_supplier,
+ const RtecEventChannelAdmin::SupplierQOS & qos
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return ec_impl_->connect_push_supplier(push_supplier, qos
+ ACE_ENV_ARG_PARAMETER);
+
+}
+
+void
+TAO_FTEC_Event_Channel::disconnect_push_supplier (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ec_impl_->disconnect_push_supplier(oid
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_FTEC_Event_Channel::disconnect_push_consumer (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ec_impl_->disconnect_push_consumer(oid
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_FTEC_Event_Channel::suspend_push_supplier (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , FtRtecEventComm::InvalidObjectID
+ ))
+{
+ ec_impl_->suspend_push_supplier(oid
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_FTEC_Event_Channel::resume_push_supplier (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , FtRtecEventComm::InvalidObjectID
+ ))
+{
+ ec_impl_->resume_push_supplier(oid
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_FTEC_Event_Channel::push (
+ const FtRtecEventChannelAdmin::ObjectId & oid,
+ const RtecEventComm::EventSet & data
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , FtRtecEventComm::InvalidObjectID
+ ))
+{
+ ec_impl_->push(oid,
+ data
+ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel.h
new file mode 100644
index 00000000000..397aa0af43e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel.h
@@ -0,0 +1,184 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FTEC_Event_Channel.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef FTEC_EVENT_CHANNEL_H
+#define FTEC_EVENT_CHANNEL_H
+
+#include "orbsvcs/FtRtEvent/EventChannel/ftrtec_export.h"
+#include "orbsvcs/FtRtecEventChannelAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FTEC_Event_Channel_Impl;
+class TAO_FTEC_Become_Primary_Listener;
+
+class TAO_FTRTEC_Export TAO_FTEC_Event_Channel
+ : public POA_FtRtecEventChannelAdmin::EventChannel
+{
+public:
+
+
+ TAO_FTEC_Event_Channel(CORBA::ORB_var orb,
+ PortableServer::POA_var poa);
+
+ ~TAO_FTEC_Event_Channel();
+
+ enum MEMBERSHIP {
+ UNSPECIFIED,
+ PRIMARY,
+ BACKUP
+ };
+
+ /**
+ * Activates the FT Event Channel.
+ *
+ * If the FT EC is activated as a primary, the EC will register itself to the NameService.
+ * If it is activated as a backup, it will try to look up the primary from the NameService
+ * and then join the object group.
+ *
+ * @param membership Specify the role the activated event channel in an object group.
+ *
+ */
+ FtRtecEventChannelAdmin::EventChannel_ptr
+ activate(MEMBERSHIP membership ACE_ENV_ARG_DECL);
+
+ /**
+ * Registers a listener to accept the notication when this object
+ * becomes the primary of the object group.
+ */
+ void set_listener(TAO_FTEC_Become_Primary_Listener* listener);
+
+
+ /// RtecEventChannelAdmin::EventChannel Interface
+
+ virtual RtecEventChannelAdmin::ConsumerAdmin_ptr
+ for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual RtecEventChannelAdmin::SupplierAdmin_ptr
+ for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ 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));
+
+ /// EventChannelFacade Interface, used by FTEC gateway
+
+ virtual ::FtRtecEventChannelAdmin::ObjectId * connect_push_consumer (
+ RtecEventComm::PushConsumer_ptr push_consumer,
+ const RtecEventChannelAdmin::ConsumerQOS & qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC (( CORBA::SystemException, RtecEventChannelAdmin::TypeError)) ;
+
+
+ virtual ::FtRtecEventChannelAdmin::ObjectId * connect_push_supplier (
+ RtecEventComm::PushSupplier_ptr push_supplier,
+ const RtecEventChannelAdmin::SupplierQOS & qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) ;
+
+ virtual void disconnect_push_supplier (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void disconnect_push_consumer (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) ;
+
+ virtual void suspend_push_supplier (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FtRtecEventComm::InvalidObjectID));
+
+ virtual void resume_push_supplier (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FtRtecEventComm::InvalidObjectID)) ;
+
+ virtual void push (
+ const FtRtecEventChannelAdmin::ObjectId & oid,
+ const RtecEventComm::EventSet & data
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FtRtecEventComm::InvalidObjectID));
+
+ /// FTRT::GroupManager Interfaces
+ /// These are used for inter-replica communications
+
+ void set_state (
+ const FTRT::State & s ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FTRT::InvalidState));
+
+ virtual void set_update (const FTRT::State & s ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FTRT::InvalidUpdate, FTRT::OutOfSequence));
+
+ virtual void oneway_set_update (const FTRT::State & s ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+ virtual CORBA::Boolean start (
+ FTRT::FaultListener_ptr listener,
+ FTRT::Location_out cur
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void create_group (
+ const FTRT::ManagerInfoList & info_list,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FTRT::PredecessorUnreachable)) ;
+
+ virtual void join_group (
+ const FTRT::ManagerInfo & info
+ ACE_ENV_ARG_DECL
+ )ACE_THROW_SPEC ((CORBA::SystemException)) ;
+
+ virtual void add_member (
+ const FTRT::ManagerInfo & info,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) ;
+
+ virtual void remove_member (
+ const FTRT::Location & crashed_location,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void replica_crashed (
+ const FTRT::Location & location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) ;
+
+
+private:
+ CORBA::ORB_var orb_;
+ PortableServer::POA_var poa_, persistent_poa_;
+ TAO_FTEC_Event_Channel_Impl* ec_impl_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.cpp
new file mode 100644
index 00000000000..0d85bbe8155
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.cpp
@@ -0,0 +1,582 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Factory.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_SupplierAdmin.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ConsumerAdmin.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ProxySupplier.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_Base.h"
+#include "orbsvcs/FtRtEvent/EventChannel/IOGR_Maker.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Replication_Service.h"
+#include "../Utils/Safe_InputCDR.h"
+#include "orbsvcs/FtRtecEventCommC.h"
+
+
+ACE_RCSID (EventChannel,
+ FTEC_Event_Channel_Impl,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void obtain_push_supplier(TAO_FTEC_Event_Channel_Impl* ec,
+ FtRtecEventChannelAdmin::Operation& op
+ ACE_ENV_ARG_DECL)
+{
+ ec->consumer_admin()->obtain_proxy(op ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void obtain_push_consumer(TAO_FTEC_Event_Channel_Impl* ec,
+ FtRtecEventChannelAdmin::Operation& op
+ ACE_ENV_ARG_DECL)
+{
+ ec->supplier_admin()->obtain_proxy(op ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void obtain_push_consumer_and_connect(TAO_FTEC_Event_Channel_Impl* ec,
+ const FtRtecEventChannelAdmin::ObjectId& oid,
+ RtecEventComm::PushSupplier_ptr push_supplier,
+ const RtecEventChannelAdmin::SupplierQOS & qos
+ ACE_ENV_ARG_DECL)
+{
+ Request_Context_Repository().set_object_id(oid ACE_ENV_ARG_PARAMETER);
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer =
+ ec->supplier_admin()->obtain(ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ ACE_CHECK;
+
+ ACE_TRY {
+ consumer->connect_push_supplier(push_supplier, qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL {
+ ec->supplier_admin()->disconnect(consumer.in());
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+
+void connect_push_supplier(TAO_FTEC_Event_Channel_Impl* ec,
+ FtRtecEventChannelAdmin::Operation& op
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::POA_var poa= ec->supplier_poa();
+ ACE_CHECK;
+ FtRtecEventChannelAdmin::Connect_push_supplier_param& param
+ = op.param.connect_supplier_param();
+
+ TAO_FTEC_ProxyPushConsumer* proxy
+ = ec->find_proxy_push_consumer(op.object_id);
+
+ if (proxy == NULL) {
+ obtain_push_consumer_and_connect(ec,
+ op.object_id,
+ param.push_supplier.in(),
+ param.qos
+ ACE_ENV_ARG_PARAMETER);
+ }
+ else {
+ proxy->connect_push_supplier(param.push_supplier.in(),
+ param.qos
+ ACE_ENV_ARG_PARAMETER);
+ }
+ ACE_CHECK;
+}
+
+void obtain_push_supplier_and_connect(TAO_FTEC_Event_Channel_Impl* ec,
+ const FtRtecEventChannelAdmin::ObjectId& oid,
+ RtecEventComm::PushConsumer_ptr push_consumer,
+ const RtecEventChannelAdmin::ConsumerQOS & qos
+ ACE_ENV_ARG_DECL)
+{
+ Request_Context_Repository().set_object_id(oid ACE_ENV_ARG_PARAMETER);
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier =
+ ec->consumer_admin()->obtain(ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ ACE_CHECK;
+
+ ACE_TRY {
+ supplier->connect_push_consumer(push_consumer, qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL {
+ ec->consumer_admin()->disconnect(supplier.in());
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+
+void connect_push_consumer(TAO_FTEC_Event_Channel_Impl* ec,
+ FtRtecEventChannelAdmin::Operation& op
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::POA_var poa= ec->consumer_poa();
+ ACE_CHECK;
+ FtRtecEventChannelAdmin::Connect_push_consumer_param& param
+ = op.param.connect_consumer_param();
+
+ TAO_FTEC_ProxyPushSupplier* proxy = ec->find_proxy_push_supplier(op.object_id);
+
+ if (proxy == NULL){
+ obtain_push_supplier_and_connect(ec,
+ op.object_id,
+ param.push_consumer.in(),
+ param.qos
+ ACE_ENV_ARG_PARAMETER);
+ }
+ else {
+ proxy->connect_push_consumer(param.push_consumer.in(),
+ param.qos
+ ACE_ENV_ARG_PARAMETER);
+ }
+ ACE_CHECK;
+}
+
+void disconnect_push_supplier(TAO_FTEC_Event_Channel_Impl* ec,
+ FtRtecEventChannelAdmin::Operation& op
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::POA_var poa= ec->consumer_poa();
+ ACE_CHECK;
+
+ TAO_FTEC_ProxyPushSupplier* proxy = ec->find_proxy_push_supplier(op.object_id);
+
+
+ if (proxy == NULL) // proxy not found
+ ACE_THROW(FTRT::InvalidUpdate());
+
+ ACE_CHECK;
+ proxy->disconnect_push_supplier(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void disconnect_push_consumer(TAO_FTEC_Event_Channel_Impl* ec,
+ FtRtecEventChannelAdmin::Operation& op
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::POA_var poa= ec->supplier_poa();
+ ACE_CHECK;
+
+ TAO_FTEC_ProxyPushConsumer* proxy = ec->find_proxy_push_consumer(op.object_id);
+
+ if (proxy == NULL) // proxy not found
+ ACE_THROW(FTRT::InvalidUpdate());
+
+ ACE_CHECK;
+ proxy->disconnect_push_consumer(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void suspend_connection (TAO_FTEC_Event_Channel_Impl* ec,
+ FtRtecEventChannelAdmin::Operation& op
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::POA_var poa= ec->consumer_poa();
+ ACE_CHECK;
+
+ TAO_FTEC_ProxyPushSupplier* proxy = ec->find_proxy_push_supplier(op.object_id);
+
+
+ if (proxy == NULL) // proxy not found
+ ACE_THROW(FTRT::InvalidUpdate());
+
+ ACE_CHECK;
+ proxy->suspend_connection(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void resume_connection(TAO_FTEC_Event_Channel_Impl* ec,
+ FtRtecEventChannelAdmin::Operation& op
+ ACE_ENV_ARG_DECL)
+{
+ TAO_FTEC_ProxyPushSupplier* proxy = ec->find_proxy_push_supplier(op.object_id);
+
+
+ if (proxy == NULL) // proxy not found
+ ACE_THROW(FTRT::InvalidUpdate());
+
+ ACE_CHECK;
+ proxy->resume_connection(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+typedef void (*Set_update_fun)(TAO_FTEC_Event_Channel_Impl* ec,
+ FtRtecEventChannelAdmin::Operation& op
+ ACE_ENV_ARG_DECL);
+
+Set_update_fun const update_table[] = {
+ &obtain_push_supplier,
+ &obtain_push_consumer,
+ &disconnect_push_supplier,
+ &disconnect_push_consumer,
+ &suspend_connection,
+ &resume_connection,
+ &connect_push_supplier,
+ &connect_push_consumer
+};
+
+TAO_FTEC_Event_Channel_Impl::TAO_FTEC_Event_Channel_Impl(
+ const TAO_EC_Event_Channel_Attributes& attributes)
+ : TAO_EC_Event_Channel_Base(attributes, new TAO_FTEC_Basic_Factory, false)
+{
+ this->scheduler_ =
+ CORBA::Object::_duplicate (attributes.scheduler);
+
+ this->create_strategies ();
+
+}
+
+TAO_FTEC_Event_Channel_Impl::~TAO_FTEC_Event_Channel_Impl()
+{
+}
+
+
+TAO_FTEC_Basic_Factory*
+TAO_FTEC_Event_Channel_Impl::factory()
+{
+ return static_cast<TAO_FTEC_Basic_Factory*> (TAO_EC_Event_Channel_Base::factory());
+}
+
+
+/// Start the internal threads (if any), etc.
+/// After this call the EC can be used.
+void
+TAO_FTEC_Event_Channel_Impl::activate_object (
+ CORBA::ORB_var orb,
+ const FtRtecEventComm::ObjectId& supplier_admin_oid,
+ const FtRtecEventComm::ObjectId& consumer_admin_oid
+ ACE_ENV_ARG_DECL)
+{
+
+ iogr_maker_.init(orb.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_EC_Event_Channel_Base::activate(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_admin()->activate(supplier_admin_oid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer_admin()->activate(consumer_admin_oid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+
+// = The RtecEventChannelAdmin::EventChannel methods...
+/// The default implementation is:
+/// this->consumer_admin ()->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+RtecEventChannelAdmin::ConsumerAdmin_ptr
+TAO_FTEC_Event_Channel_Impl::for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Object_var obj = consumer_admin()->reference(ACE_ENV_SINGLE_ARG_PARAMETER);
+ obj = IOGR_Maker::instance()->forge_iogr(obj.in()
+ ACE_ENV_ARG_PARAMETER);
+ return RtecEventChannelAdmin::ConsumerAdmin::_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+}
+
+
+/// The default implementation is:
+/// this->supplier_admin ()->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+RtecEventChannelAdmin::SupplierAdmin_ptr
+TAO_FTEC_Event_Channel_Impl::for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Object_var obj = supplier_admin()->reference(ACE_ENV_SINGLE_ARG_PARAMETER);
+ obj = IOGR_Maker::instance()->forge_iogr(obj.in()
+ ACE_ENV_ARG_PARAMETER);
+ return RtecEventChannelAdmin::SupplierAdmin::_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+}
+
+
+::FtRtecEventChannelAdmin::ObjectId *
+TAO_FTEC_Event_Channel_Impl::connect_push_consumer (
+ RtecEventComm::PushConsumer_ptr push_consumer,
+ const RtecEventChannelAdmin::ConsumerQOS & qos
+ ACE_ENV_ARG_DECL
+ )
+{
+ CORBA::Any_var any
+ = Request_Context_Repository().get_cached_result(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ FtRtecEventChannelAdmin::ObjectId *oid;
+
+ if (any.in() >>= oid) {
+ FtRtecEventChannelAdmin::ObjectId* result;
+ ACE_NEW_THROW_EX(result,
+ FtRtecEventChannelAdmin::ObjectId(*oid),
+ CORBA::NO_MEMORY());
+ return result;
+ }
+
+
+ ACE_NEW_THROW_EX(oid, FtRtecEventChannelAdmin::ObjectId, CORBA::NO_MEMORY());
+
+ FtRtecEventChannelAdmin::ObjectId_var object_id = oid;
+
+ Request_Context_Repository().generate_object_id(*oid ACE_ENV_ARG_PARAMETER);
+
+ obtain_push_supplier_and_connect(this,
+ object_id.in(),
+ push_consumer,
+ qos
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN(0);
+
+ return object_id._retn();
+}
+
+
+::FtRtecEventChannelAdmin::ObjectId *
+TAO_FTEC_Event_Channel_Impl::connect_push_supplier (
+ RtecEventComm::PushSupplier_ptr push_supplier,
+ const RtecEventChannelAdmin::SupplierQOS & qos
+ ACE_ENV_ARG_DECL
+ )
+{
+ CORBA::Any_var any
+ = Request_Context_Repository().get_cached_result(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ FtRtecEventChannelAdmin::ObjectId *oid;
+
+ if (any.in() >>= oid) {
+ FtRtecEventChannelAdmin::ObjectId* result;
+ ACE_NEW_THROW_EX(result,
+ FtRtecEventChannelAdmin::ObjectId(*oid),
+ CORBA::NO_MEMORY());
+ return result;
+ }
+
+
+ ACE_NEW_THROW_EX(oid, FtRtecEventChannelAdmin::ObjectId, CORBA::NO_MEMORY());
+ FtRtecEventChannelAdmin::ObjectId_var object_id = oid;
+
+ Request_Context_Repository().generate_object_id(*oid ACE_ENV_ARG_PARAMETER);
+
+ obtain_push_consumer_and_connect(this,
+ object_id.in(),
+ push_supplier,
+ qos
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN(0);
+
+ return object_id._retn();
+
+}
+
+void TAO_FTEC_Event_Channel_Impl::disconnect_push_supplier (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL
+ )
+{
+ if (Request_Context_Repository().is_executed_request())
+ return;
+
+ TAO_FTEC_ProxyPushSupplier* proxy = this->find_proxy_push_supplier(oid);
+
+ if (proxy == NULL) // proxy not found
+ return;
+
+ ACE_CHECK;
+ proxy->disconnect_push_supplier(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void TAO_FTEC_Event_Channel_Impl::disconnect_push_consumer (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL
+ )
+{
+ if (Request_Context_Repository().is_executed_request())
+ return;
+
+ TAO_FTEC_ProxyPushConsumer* proxy = this->find_proxy_push_consumer(oid);
+
+ if (proxy == NULL) // proxy not found
+ return;
+
+ ACE_CHECK;
+ proxy->disconnect_push_consumer(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void TAO_FTEC_Event_Channel_Impl::suspend_push_supplier (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL
+ )
+{
+ if (Request_Context_Repository().is_executed_request())
+ return;
+
+ TAO_FTEC_ProxyPushSupplier* proxy = this->find_proxy_push_supplier(oid);
+
+ if (proxy == NULL) // proxy not found
+ ACE_THROW(FtRtecEventComm::InvalidObjectID());
+
+ ACE_CHECK;
+ proxy->suspend_connection(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void TAO_FTEC_Event_Channel_Impl::resume_push_supplier (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL
+ )
+{
+ if (Request_Context_Repository().is_executed_request())
+ return;
+
+ TAO_FTEC_ProxyPushSupplier* proxy = this->find_proxy_push_supplier(oid);
+
+ if (proxy == NULL) // proxy not found
+ ACE_THROW(FtRtecEventComm::InvalidObjectID());
+
+ ACE_CHECK;
+ proxy->resume_connection(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void TAO_FTEC_Event_Channel_Impl::push (
+ const FtRtecEventChannelAdmin::ObjectId & oid,
+ const RtecEventComm::EventSet & data
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_FTEC_ProxyPushConsumer* proxy = this->find_proxy_push_consumer(oid);
+
+ if (proxy == NULL) // proxy not found
+ ACE_THROW(FtRtecEventComm::InvalidObjectID());
+
+ proxy->push(data ACE_ENV_ARG_PARAMETER);
+}
+
+
+
+
+void TAO_FTEC_Event_Channel_Impl::get_state (
+ FtRtecEventChannelAdmin::EventChannelState & state
+ ACE_ENV_ARG_DECL
+ )
+{
+ FtEventServiceInterceptor::instance()->get_state(state.cached_operation_results);
+ this->supplier_admin()->get_state(state.supplier_admin_state ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->consumer_admin()->get_state(state.consumer_admin_state ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+
+void TAO_FTEC_Event_Channel_Impl::set_state (const FTRT::State & stat
+ ACE_ENV_ARG_DECL)
+{
+ FtRtecEventChannelAdmin::EventChannelState state;
+
+ Safe_InputCDR cdr((const char*)stat.get_buffer(), stat.length());
+ cdr >> state;
+
+ FtEventServiceInterceptor::instance()->set_state(state.cached_operation_results);
+ this->supplier_admin()->set_state(state.supplier_admin_state ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->consumer_admin()->set_state(state.consumer_admin_state ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void TAO_FTEC_Event_Channel_Impl::set_update (const FTRT::State & s
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FTRT::InvalidUpdate))
+{
+ FTRTEC::Replication_Service::instance()->check_validity(ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ if (!Request_Context_Repository().is_executed_request()) {
+ Safe_InputCDR cdr((const char*)s.get_buffer(), s.length());
+
+ FtRtecEventChannelAdmin::Operation_var op(new FtRtecEventChannelAdmin::Operation);
+ if (!(cdr >> *op)) {
+ ACE_THROW(FTRT::InvalidUpdate() );
+ }
+
+ (update_table[op->param._d()])(this, *op ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ }
+}
+
+
+TAO_FTEC_ConsumerAdmin* TAO_FTEC_Event_Channel_Impl::consumer_admin (void) const
+{
+ return static_cast<TAO_FTEC_ConsumerAdmin*> (TAO_EC_Event_Channel_Base::consumer_admin());
+}
+
+/// Access the supplier admin implementation, useful for controlling
+/// the activation...
+TAO_FTEC_SupplierAdmin* TAO_FTEC_Event_Channel_Impl::supplier_admin (void) const
+{
+ return static_cast<TAO_FTEC_SupplierAdmin*> (TAO_EC_Event_Channel_Base::supplier_admin());
+}
+
+
+TAO_FTEC_ProxyPushSupplier*
+TAO_FTEC_Event_Channel_Impl::find_proxy_push_supplier(const FtRtecEventChannelAdmin::ObjectId& id)
+{
+ ACE_TRY_NEW_ENV {
+ PortableServer::POA_var poa = consumer_poa();
+
+ const PortableServer::Servant servant = poa->id_to_servant(
+ reinterpret_cast<const PortableServer::ObjectId&> (id)
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ POA_RtecEventChannelAdmin::ProxyPushSupplier_ptr obj =
+ dynamic_cast<POA_RtecEventChannelAdmin::ProxyPushSupplier_ptr> (servant);
+
+ return static_cast<TAO_FTEC_ProxyPushSupplier*> (obj);
+ }
+ ACE_CATCHALL {
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+TAO_FTEC_ProxyPushConsumer*
+TAO_FTEC_Event_Channel_Impl::find_proxy_push_consumer(const FtRtecEventChannelAdmin::ObjectId& id)
+{
+ ACE_TRY_NEW_ENV {
+ PortableServer::POA_var poa= supplier_poa();
+
+ const PortableServer::Servant servant = poa->id_to_servant(
+ reinterpret_cast<const PortableServer::ObjectId&> (id)
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ POA_RtecEventChannelAdmin::ProxyPushConsumer_ptr obj =
+ dynamic_cast<POA_RtecEventChannelAdmin::ProxyPushConsumer_ptr> (servant);
+
+ return static_cast<TAO_FTEC_ProxyPushConsumer*> (obj);
+ }
+ ACE_CATCHALL {
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.h
new file mode 100644
index 00000000000..ba6c2e1bc0d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.h
@@ -0,0 +1,135 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FTEC_Event_Channel_Impl.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef TAO_FTEC_EVENT_CHANNEL_H
+#define TAO_FTEC_EVENT_CHANNEL_H
+
+#include "ace/Synch_T.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/FtRtecEventChannelAdminC.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Factory.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.h"
+#include "orbsvcs/FtRtEvent/EventChannel/IOGR_Maker.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FTEC_ProxyPushSupplier;
+class TAO_FTEC_ProxyPushConsumer;
+class TAO_FTEC_SupplierAdmin;
+class TAO_FTEC_ConsumerAdmin;
+class FT_ProxyAdmin_Base;
+
+class TAO_FTEC_Event_Channel_Impl : public TAO_EC_Event_Channel_Base
+ , public TAO_FTEC_Group_Manager
+{
+public:
+ TAO_FTEC_Event_Channel_Impl(const TAO_EC_Event_Channel_Attributes& attributes);
+
+ ~TAO_FTEC_Event_Channel_Impl();
+
+ /// Start the internal threads (if any), etc.
+ /// After this call the EC can be used.
+ virtual void activate_object (
+ CORBA::ORB_var orb,
+ const FtRtecEventComm::ObjectId& supplier_admin_oid,
+ const FtRtecEventComm::ObjectId& consumer_admin_oid
+ ACE_ENV_ARG_DECL);
+
+
+ // = The RtecEventChannelAdmin::EventChannel methods...
+ virtual RtecEventChannelAdmin::ConsumerAdmin_ptr
+ for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+ virtual RtecEventChannelAdmin::SupplierAdmin_ptr
+ for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void get_state (FtRtecEventChannelAdmin::EventChannelState & s
+ ACE_ENV_ARG_DECL);
+
+ void set_state (const FTRT::State & stat ACE_ENV_ARG_DECL);
+
+ void set_update (const FTRT::State & s ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FTRT::InvalidUpdate));
+
+ /// EventChannelFacade Interface
+
+ virtual ::FtRtecEventChannelAdmin::ObjectId * connect_push_consumer (
+ RtecEventComm::PushConsumer_ptr push_consumer,
+ const RtecEventChannelAdmin::ConsumerQOS & qos
+ ACE_ENV_ARG_DECL
+ );
+
+
+ virtual ::FtRtecEventChannelAdmin::ObjectId * connect_push_supplier (
+ RtecEventComm::PushSupplier_ptr push_supplier,
+ const RtecEventChannelAdmin::SupplierQOS & qos
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void disconnect_push_supplier (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void disconnect_push_consumer (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void suspend_push_supplier (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void resume_push_supplier (
+ const FtRtecEventChannelAdmin::ObjectId & oid
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void push (
+ const FtRtecEventChannelAdmin::ObjectId & oid,
+ const RtecEventComm::EventSet & data
+ ACE_ENV_ARG_DECL
+ );
+
+ ////////////////////////////////////////////
+
+ /// Access the consumer admin implementation, useful for controlling
+ /// the activation...
+ TAO_FTEC_ConsumerAdmin* consumer_admin (void) const;
+
+ /// Access the supplier admin implementation, useful for controlling
+ /// the activation...
+ TAO_FTEC_SupplierAdmin* supplier_admin (void) const;
+
+ TAO_FTEC_ProxyPushSupplier* find_proxy_push_supplier(const FtRtecEventChannelAdmin::ObjectId& id);
+ TAO_FTEC_ProxyPushConsumer* find_proxy_push_consumer(const FtRtecEventChannelAdmin::ObjectId& id);
+
+
+ CORBA::Object_var make_iogr(CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL);
+
+protected:
+ TAO_FTEC_Basic_Factory* factory();
+private:
+ IOGR_Maker iogr_maker_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Factory.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Factory.cpp
new file mode 100644
index 00000000000..c0bb7566afa
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Factory.cpp
@@ -0,0 +1,56 @@
+// $Id$
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Factory.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ProxySupplier.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_SupplierAdmin.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ConsumerAdmin.h"
+
+ACE_RCSID (EventChannel,
+ FTEC_Factory,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_FTEC_Basic_Factory::TAO_FTEC_Basic_Factory (void)
+{
+}
+
+TAO_EC_ConsumerAdmin*
+TAO_FTEC_Basic_Factory::create_consumer_admin (TAO_EC_Event_Channel_Base* ec)
+{
+ return new TAO_FTEC_ConsumerAdmin(ec);
+}
+
+TAO_EC_SupplierAdmin*
+TAO_FTEC_Basic_Factory::create_supplier_admin (TAO_EC_Event_Channel_Base* ec)
+{
+ return new TAO_FTEC_SupplierAdmin(ec);
+}
+
+TAO_EC_ProxyPushSupplier*
+TAO_FTEC_Basic_Factory::create_proxy_push_supplier (TAO_EC_Event_Channel_Base* ec)
+{
+ return new TAO_FTEC_ProxyPushSupplier(ec, consumer_validate_connection_);
+}
+
+TAO_EC_ProxyPushConsumer*
+TAO_FTEC_Basic_Factory::create_proxy_push_consumer (TAO_EC_Event_Channel_Base* ec)
+{
+ return new TAO_FTEC_ProxyPushConsumer(ec);
+}
+
+void
+TAO_FTEC_Basic_Factory::destroy_proxy_push_supplier (TAO_EC_ProxyPushSupplier* proxy)
+{
+ delete proxy;
+}
+
+void
+TAO_FTEC_Basic_Factory::destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer* proxy)
+{
+ delete proxy;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Factory.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Factory.h
new file mode 100644
index 00000000000..5fd7cb8e131
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Factory.h
@@ -0,0 +1,49 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FTEC_Factory.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef FTEC_FACTORY_H
+#define FTEC_FACTORY_H
+
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FTEC_Basic_Factory : public TAO_EC_Default_Factory
+{
+public:
+ /// Constructor
+ TAO_FTEC_Basic_Factory (void);
+ virtual TAO_EC_ConsumerAdmin*
+ create_consumer_admin (TAO_EC_Event_Channel_Base*);
+ virtual TAO_EC_SupplierAdmin*
+ create_supplier_admin (TAO_EC_Event_Channel_Base*);
+
+ virtual TAO_EC_ProxyPushSupplier*
+ create_proxy_push_supplier (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_supplier (TAO_EC_ProxyPushSupplier*);
+
+ /// Create and destroy a ProxyPushConsumer
+ virtual TAO_EC_ProxyPushConsumer*
+ create_proxy_push_consumer (TAO_EC_Event_Channel_Base*);
+ virtual void
+ destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer*);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
+
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Fault_Listener.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Fault_Listener.h
new file mode 100644
index 00000000000..c2eb737544e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Fault_Listener.h
@@ -0,0 +1,29 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FTEC_Fault_Listener.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_FTEC_FAULT_LISTENER_H
+#define TAO_FTEC_FAULT_LISTENER_H
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FTEC_Fault_Listener
+{
+public:
+ virtual ~TAO_FTEC_Fault_Listener(){};
+ virtual void connection_closed()=0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.cpp
new file mode 100644
index 00000000000..80c7ba30a06
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.cpp
@@ -0,0 +1,378 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.h"
+#include "ace/Synch_T.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Replication_Service.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Fault_Detector.h"
+#include "orbsvcs/FtRtEvent/EventChannel/IOGR_Maker.h"
+#include "orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Replication_Service.h"
+#include "../Utils/Log.h"
+#include "tao/CDR.h"
+#include "orbsvcs/PortableGroup/PG_Operators.h"
+
+ACE_RCSID (EventChannel,
+ TAO_FTEC_Group_Manager,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int find_by_location(const FTRT::ManagerInfoList& list,
+ const FTRT::Location & location)
+{
+ unsigned i;
+ for (i = 0; i < list.length(); ++i) {
+ if (list[i].the_location == location) {
+ return i;
+ }
+ }
+ return i;
+}
+
+/*
+void print(const FTRT::Location& location)
+{
+ ACE_DEBUG((LM_DEBUG, "{"));
+ for (size_t i = 0; i < location.length(); ++i) {
+ ACE_DEBUG((LM_DEBUG, "<%s,%s>", location[i].id.in(), location[i].kind.in()));
+ }
+ ACE_DEBUG((LM_DEBUG, "}"));
+}
+*/
+
+struct TAO_FTEC_Group_Manager_Impl
+{
+ FTRT::ManagerInfoList info_list;
+ unsigned my_position;
+};
+
+TAO_FTEC_Group_Manager::TAO_FTEC_Group_Manager()
+: impl_(new TAO_FTEC_Group_Manager_Impl)
+{
+ Fault_Detector::instance()->set_listener(this);
+}
+
+TAO_FTEC_Group_Manager::~TAO_FTEC_Group_Manager()
+{
+ delete impl_;
+}
+
+CORBA::Boolean TAO_FTEC_Group_Manager::start (
+ FTRT::FaultListener_ptr listener,
+ FTRT::Location_out cur
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ listener_ = listener;
+ ACE_NEW_RETURN(cur , FTRT::Location(Fault_Detector::instance()->my_location()), false);
+ return true;
+}
+
+
+void TAO_FTEC_Group_Manager::create_group (
+ const FTRT::ManagerInfoList & info_list,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL)
+{
+ TAO_FTRTEC::Log(1, "create_group\n");
+
+ impl_->info_list = info_list;
+ impl_->my_position = find_by_location(info_list,
+ Fault_Detector::instance()->my_location());
+
+ GroupInfoPublisherBase* publisher = GroupInfoPublisher::instance();
+ GroupInfoPublisherBase::Info_ptr info (
+ publisher->setup_info(impl_->info_list,
+ impl_->my_position,
+ object_group_ref_version
+ ACE_ENV_ARG_PARAMETER));
+ ACE_CHECK;
+
+ publisher->update_info(info);
+
+ IOGR_Maker::instance()->set_ref_version( object_group_ref_version );
+
+ if (impl_->my_position > 0) {
+ Fault_Detector* detector = Fault_Detector::instance();
+ if ( detector->connect(impl_->info_list[impl_->my_position-1].the_location) == -1) {
+ ACE_DEBUG((LM_DEBUG, "Cannot connect to predecesor\n"));
+ ACE_THROW(FTRT::PredecessorUnreachable());
+ }
+ }
+
+ FtRtecEventChannelAdmin::EventChannel_var successor
+ = publisher->successor();
+
+ if (!CORBA::is_nil(successor.in())) {
+ successor->create_group(info_list, object_group_ref_version
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void TAO_FTEC_Group_Manager::join_group (
+ const FTRT::ManagerInfo & info
+ ACE_ENV_ARG_DECL)
+{
+ TAO_FTRTEC::Log(1, "join group\n");
+ if (impl_->my_position == 0) {
+ FTRTEC::Replication_Service* svc = FTRTEC::Replication_Service::instance();
+ ACE_Write_Guard<FTRTEC::Replication_Service> lock(*svc);
+ add_member(info, IOGR_Maker::instance()->get_ref_version()+1
+ ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+void TAO_FTEC_Group_Manager::add_member (
+ const FTRT::ManagerInfo & info,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL)
+{
+ TAO_FTRTEC::Log(1, "add_member location = <%s>\n",
+ (const char*)info.the_location[0].id);
+
+ auto_ptr<TAO_FTEC_Group_Manager_Impl> new_impl(new TAO_FTEC_Group_Manager_Impl);
+
+ new_impl->my_position = impl_->my_position;
+ size_t pos = impl_->info_list.length();
+ new_impl->info_list.length(pos+1);
+ for (size_t i = 0; i < pos; ++i) {
+ new_impl->info_list[i] = impl_->info_list[i];
+ }
+ new_impl->info_list[pos] = info;
+
+ GroupInfoPublisherBase* publisher = GroupInfoPublisher::instance();
+ GroupInfoPublisherBase::Info_ptr group_info (
+ publisher->setup_info(new_impl->info_list,
+ new_impl->my_position,
+ object_group_ref_version
+ ACE_ENV_ARG_PARAMETER));
+ ACE_CHECK;
+
+ int last_one = (impl_->my_position == impl_->info_list.length()-1);
+
+ if (!last_one)
+ {
+ // I am not the last of replica, tell my successor that
+ // a new member has joined in.
+ ACE_TRY_EX(block) {
+ FTRTEC::Replication_Service::instance()->add_member(info, object_group_ref_version
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block);
+ }
+ ACE_CATCHANY {
+ // Unable to send request to all the successors.
+ // Now this node become the last replica of the object group.
+ // update the info list again
+ new_impl->info_list.length(new_impl->my_position+2);
+ new_impl->info_list[new_impl->my_position+1] = info;
+
+ /// group_info = publisher->set_info(..) should be enough.
+ /// However, GCC 2.96 is not happy with that.
+
+ GroupInfoPublisherBase::Info_ptr group_info1 (
+ publisher->setup_info(new_impl->info_list,
+ new_impl->my_position,
+ object_group_ref_version
+ ACE_ENV_ARG_PARAMETER));
+ ACE_CHECK;
+ ACE_AUTO_PTR_RESET(group_info, group_info1.release(), GroupInfoPublisherBase::Info);
+
+ last_one = true;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+
+ if (last_one)
+ {
+ // this is the last replica in the list
+ // synchornize the state with the newly joined replica.
+ FtRtecEventChannelAdmin::EventChannelState state;
+ get_state(state ACE_ENV_ARG_PARAMETER);
+
+ TAO_OutputCDR cdr;
+ cdr << state;
+
+ FTRT::State s;
+ if (cdr.begin()->cont()) {
+ ACE_Message_Block* blk;
+ ACE_NEW_THROW_EX(blk, ACE_Message_Block, CORBA::NO_MEMORY());
+ ACE_CDR::consolidate(blk, cdr.begin());
+#if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
+ s.replace(blk->length(), blk);
+#else
+ // If the replace method is not available, we will need
+ // to do the copy manually. First, set the octet sequence length.
+ CORBA::ULong length = blk->length ();
+ s.length (length);
+
+ // Now copy over each byte.
+ char* base = blk->data_block ()->base ();
+ for(CORBA::ULong i = 0; i < length; i++)
+ {
+ s[i] = base[i];
+ }
+#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
+
+ blk->release();
+ }
+ else {
+#if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
+ s.replace(cdr.begin()->length(), cdr.begin());
+#else
+ // If the replace method is not available, we will need
+ // to do the copy manually. First, set the octet sequence length.
+ CORBA::ULong length = cdr.begin ()->length ();
+ s.length (length);
+
+ // Now copy over each byte.
+ char* base = cdr.begin()->data_block ()->base ();
+ for(CORBA::ULong i = 0; i < length; i++)
+ {
+ s[i] = base[i];
+ }
+#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
+ }
+
+ TAO_FTRTEC::Log(2, "Setting state\n");
+ info.ior->set_state(s ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ info.ior->create_group(new_impl->info_list,
+ object_group_ref_version
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ TAO_FTRTEC::Log(2, "After create_group\n");
+ }
+
+ // commit the changes
+ IOGR_Maker::instance()->set_ref_version( object_group_ref_version );
+ publisher->update_info(group_info);
+ delete impl_;
+ impl_ = new_impl.release();
+}
+
+template <class SEQ>
+void remove_item(SEQ & seq, int position)
+{
+ int i = position;
+ int len = seq.length()-1;
+ for (;i < len; ++i)
+ seq[i] = seq[i+1];
+ seq.length(len);
+}
+
+void TAO_FTEC_Group_Manager::replica_crashed (
+ const FTRT::Location & location
+ ACE_ENV_ARG_DECL)
+{
+ TAO_FTRTEC::Log(1, "TAO_FTEC_Group_Manager::replica_crashed\n");
+ FTRTEC::Replication_Service* svc = FTRTEC::Replication_Service::instance();
+ ACE_Write_Guard<FTRTEC::Replication_Service> lock(*svc);
+ remove_member(location, IOGR_Maker::instance()->get_ref_version()+1
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void TAO_FTEC_Group_Manager::remove_member (
+ const FTRT::Location & crashed_location,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL)
+{
+ // find my position of this EventChannel in the group
+ unsigned crashed_pos = find_by_location(impl_->info_list, crashed_location);
+ if (crashed_pos >= impl_->info_list.length()) {
+ return;
+ }
+
+ ACE_ASSERT(impl_->my_position != crashed_pos);
+ remove_item(impl_->info_list, crashed_pos);
+
+ if (impl_->my_position > crashed_pos)
+ --impl_->my_position;
+
+ GroupInfoPublisherBase* publisher = GroupInfoPublisher::instance();
+
+ GroupInfoPublisherBase::Info_ptr info (
+ publisher->setup_info(impl_->info_list,
+ impl_->my_position,
+ object_group_ref_version
+ ACE_ENV_ARG_PARAMETER));
+ ACE_CHECK;
+ publisher->update_info(info);
+
+ FtRtecEventChannelAdmin::EventChannel_var successor =
+ publisher->successor();
+
+ IOGR_Maker::instance()->set_ref_version(object_group_ref_version);
+ if (!CORBA::is_nil(successor.in())) {
+ ACE_TRY {
+ successor->remove_member(crashed_location,
+ object_group_ref_version
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL {
+ }
+ ACE_ENDTRY;
+ }
+
+ TAO_FTRTEC::Log(3, "my_position = %d, crashed_pos = %d\n", impl_->my_position, crashed_pos);
+ if (impl_->my_position == crashed_pos && impl_->my_position > 0)
+ Fault_Detector::instance()->connect(impl_->info_list[impl_->my_position-1].the_location);
+}
+
+void TAO_FTEC_Group_Manager::connection_closed()
+{
+ TAO_FTRTEC::Log(1, "TAO_FTEC_Group_Manager::connection_closed\n");
+ ACE_ASSERT(impl_->my_position > 0);
+
+ // do not use referere here, because the the value pointed by the pointer to
+ // crashed_location will be repliaced by its successor.
+ FTRT::Location crashed_location = impl_->info_list[impl_->my_position-1].the_location;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ if (impl_->my_position > 1) {
+ // if I am not the new primary, tell the new primary
+ ACE_TRY_EX(block1) {
+ TAO_IOP::TAO_IOR_Manipulation::IORList iors;
+ iors.length(impl_->my_position-1);
+ for (size_t i = 0; i < impl_->my_position-1; ++i)
+ iors[i] = CORBA::Object::_duplicate(impl_->info_list[i].ior.in());
+
+ CORBA::Object_var obj =
+ IOGR_Maker::instance()->merge_iors(iors
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block1);
+
+ FtRtecEventChannelAdmin::EventChannel_var primary =
+ FtRtecEventChannelAdmin::EventChannel::_narrow(obj.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block1);
+ primary->replica_crashed(crashed_location
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK_EX(block1);
+ return;
+ }
+ ACE_CATCHANY {
+ }
+ ACE_ENDTRY;
+ }
+
+ ACE_TRY_EX(block2) {
+ remove_member(crashed_location,
+ IOGR_Maker::instance()->increment_ref_version()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block2);
+ }
+ ACE_CATCHANY {
+ }
+ ACE_ENDTRY;
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.h
new file mode 100644
index 00000000000..0d06c156bf5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.h
@@ -0,0 +1,80 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FTEC_Group_Manager.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_FTEC_GROUP_MANAGER_H
+#define TAO_FTEC_GROUP_MANAGER_H
+
+#include "orbsvcs/FtRtecEventChannelAdminC.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Fault_Listener.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+struct TAO_FTEC_Group_Manager_Impl;
+
+class TAO_FTEC_Group_Manager : private TAO_FTEC_Fault_Listener
+{
+public:
+ TAO_FTEC_Group_Manager();
+ virtual ~TAO_FTEC_Group_Manager();
+
+ bool init(CORBA::ORB_ptr orb);
+
+ virtual CORBA::Boolean start (
+ FTRT::FaultListener_ptr listener,
+ FTRT::Location_out cur
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void create_group (
+ const FTRT::ManagerInfoList & info_list,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL);
+
+ void join_group (
+ const FTRT::ManagerInfo & info
+ ACE_ENV_ARG_DECL);
+
+ void add_member (
+ const FTRT::ManagerInfo & info,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL);
+
+ void remove_member (
+ const FTRT::Location & crashed_location,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL);
+
+ void replica_crashed (
+ const FTRT::Location & location
+ ACE_ENV_ARG_DECL);
+
+private:
+ virtual void get_state (
+ FtRtecEventChannelAdmin::EventChannelState & s
+ ACE_ENV_ARG_DECL
+ )=0;
+
+ virtual void connection_closed();
+
+protected:
+ FTRT::FaultListener_var listener_;
+ TAO_FTEC_Group_Manager_Impl* impl_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif // TAO_FTEC_GROUP_MANAGER_H
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ORBInitializer.cpp
new file mode 100644
index 00000000000..410377e8a80
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ORBInitializer.cpp
@@ -0,0 +1,68 @@
+// $Id$
+
+
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ORBInitializer.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Set_Update_Interceptor.h"
+#include "orbsvcs/FtRtEvent/EventChannel/ForwardCtrlServerInterceptor.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h"
+
+ACE_RCSID (EventChannel,
+ FTEC_ORBInitializer,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void
+FTEC_ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+FTEC_ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ Request_Context_Repository().allocate_slots(info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableInterceptor::ClientRequestInterceptor_var client_interceptor;
+ PortableInterceptor::ClientRequestInterceptor_ptr ctmp;
+
+ ACE_NEW_THROW_EX(ctmp,
+ TAO_Set_Update_Interceptor,
+ CORBA::NO_MEMORY());
+ ACE_CHECK;
+
+ client_interceptor = ctmp;
+
+ info->add_client_request_interceptor (client_interceptor.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableInterceptor::ServerRequestInterceptor_var server_interceptor;
+ PortableInterceptor::ServerRequestInterceptor_ptr stmp;
+
+ ACE_NEW_THROW_EX(stmp,
+ ForwardCtrlServerInterceptor,
+ CORBA::NO_MEMORY());
+ server_interceptor = stmp;
+
+ info->add_server_request_interceptor (server_interceptor.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_NEW_THROW_EX(stmp,
+ FtEventServiceInterceptor,
+ CORBA::NO_MEMORY());
+ server_interceptor = stmp;
+
+ info->add_server_request_interceptor (server_interceptor.in()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ORBInitializer.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ORBInitializer.h
new file mode 100644
index 00000000000..07377cd40e1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ORBInitializer.h
@@ -0,0 +1,42 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FTEC_ORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef FTEC_ORBINITIALIZER__H_
+#define FTEC_ORBINITIALIZER__H_
+#include /**/ "ace/pre.h"
+
+#include "tao/PI/PI.h"
+#include "tao/LocalObject.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class FTEC_ORBInitializer
+ : public virtual PortableInterceptor::ORBInitializer
+ , public virtual TAO_Local_RefCounted_Object
+{
+public:
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* FTEC_ORBINITIALIZER__H_ */
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.cpp
new file mode 100644
index 00000000000..3f489f9540f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.cpp
@@ -0,0 +1,134 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Replication_Service.h"
+#include "../Utils/activate_with_id.h"
+
+ACE_RCSID (EventChannel,
+ TAO_FTEC_ProxyPushConsumer,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+const TAO_FTEC_ProxyPushConsumer::RollbackOperation
+ TAO_FTEC_ProxyPushConsumer::rollback_obtain =
+ &FtRtecEventChannelAdmin::EventChannelFacade::disconnect_push_consumer;
+
+TAO_FTEC_ProxyPushConsumer::TAO_FTEC_ProxyPushConsumer (TAO_EC_Event_Channel_Base* event_channel)
+: Inherited(event_channel)
+{
+}
+
+
+const FtRtecEventChannelAdmin::ObjectId&
+TAO_FTEC_ProxyPushConsumer::id() const
+{
+ return object_id_.in();
+}
+
+
+ /// Activate in the POA
+void
+TAO_FTEC_ProxyPushConsumer::activate (
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr &result
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ result = RtecEventChannelAdmin::ProxyPushConsumer::_nil();
+ ACE_TRY {
+ object_id_ = Request_Context_Repository().get_object_id(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa = _default_POA(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ activate_object_with_id(result, poa.in(), this, id() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION, "");
+ // ignore exceptions
+ }
+ ACE_ENDTRY;
+}
+
+ // = The RtecEventChannelAdmin::ProxyPushConsumer methods...
+void TAO_FTEC_ProxyPushConsumer::connect_push_supplier (
+ RtecEventComm::PushSupplier_ptr push_supplier,
+ const RtecEventChannelAdmin::SupplierQOS& qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecEventChannelAdmin::AlreadyConnected))
+{
+ if (Request_Context_Repository().is_executed_request())
+ return;
+
+ FtRtecEventChannelAdmin::Operation update;
+ update.object_id = this->id();
+ FtRtecEventChannelAdmin::Connect_push_supplier_param param;
+ param.push_supplier = RtecEventComm::PushSupplier::_duplicate(push_supplier);
+ param.qos = qos;
+ update.param.connect_supplier_param(param);
+
+ Inherited::connect_push_supplier(push_supplier, qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TRY {
+ FTRTEC::Replication_Service* svc = FTRTEC::Replication_Service::instance();
+ ACE_Read_Guard<FTRTEC::Replication_Service> locker(*svc);
+
+ svc->replicate_request(update,
+ &FtRtecEventChannelAdmin::EventChannelFacade::disconnect_push_consumer
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL {
+ this->disconnect_push_consumer(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void TAO_FTEC_ProxyPushConsumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (Request_Context_Repository().is_executed_request())
+ return;
+ FtRtecEventChannelAdmin::Operation update;
+ update.object_id = id();
+ update.param._d(FtRtecEventChannelAdmin::DISCONNECT_PUSH_CONSUMER);
+
+ Inherited::disconnect_push_consumer(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ FTRTEC::Replication_Service* svc = FTRTEC::Replication_Service::instance();
+ ACE_Read_Guard<FTRTEC::Replication_Service> locker(*svc);
+
+ svc->replicate_request(update, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void TAO_FTEC_ProxyPushConsumer::get_state(FtRtecEventChannelAdmin::ProxyPushConsumerStat& state)
+{
+ state.object_id = this->object_id_.in ();
+ if (this->is_connected()) {
+ FtRtecEventChannelAdmin::ProxyPushConsumerConnectionInfo info;
+ info.push_supplier = this->supplier();
+ info.qos = this->publications();
+ state.parameter.info(info);
+ }
+}
+
+void TAO_FTEC_ProxyPushConsumer::set_state(const FtRtecEventChannelAdmin::ProxyPushConsumerStat& state
+ ACE_ENV_ARG_DECL)
+{
+ if (!CORBA::is_nil(state.parameter.info().push_supplier.in()) )
+ {
+ Inherited::connect_push_supplier(state.parameter.info().push_supplier.in(),
+ state.parameter.info().qos
+ ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.h
new file mode 100644
index 00000000000..518e4f73eb0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.h
@@ -0,0 +1,67 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FTEC_ProxyConsumer.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef TAO_FTEC_PROXYCONSUMER_H
+#define TAO_FTEC_PROXYCONSUMER_H
+
+#include "orbsvcs/Event/EC_Default_ProxyConsumer.h"
+#include "ace/SString.h"
+#include "orbsvcs/FtRtecEventChannelAdminC.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FTEC_ProxyPushConsumer : public TAO_EC_Default_ProxyPushConsumer
+{
+ typedef TAO_EC_Default_ProxyPushConsumer Inherited;
+public:
+ typedef RtecEventChannelAdmin::ProxyPushConsumer Interface;
+ typedef FtRtecEventChannelAdmin::ProxyPushConsumerStat State;
+ typedef POA_RtecEventChannelAdmin::ProxyPushConsumer_ptr Skeleton;
+
+ TAO_FTEC_ProxyPushConsumer (TAO_EC_Event_Channel_Base* event_channel);
+
+ virtual void activate (
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr &proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+ // = The RtecEventChannelAdmin::ProxyPushConsumer methods...
+ virtual void connect_push_supplier (
+ RtecEventComm::PushSupplier_ptr push_supplier,
+ const RtecEventChannelAdmin::SupplierQOS& qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecEventChannelAdmin::AlreadyConnected));
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ const FtRtecEventChannelAdmin::ObjectId& id() const;
+ void get_state(FtRtecEventChannelAdmin::ProxyPushConsumerStat& state);
+ void set_state(const FtRtecEventChannelAdmin::ProxyPushConsumerStat& state
+ ACE_ENV_ARG_DECL);
+
+ typedef void (FtRtecEventChannelAdmin::EventChannelFacade::*RollbackOperation)
+ (const FtRtecEventChannelAdmin::ObjectId& ACE_ENV_ARG_DECL);
+
+ static const RollbackOperation rollback_obtain;
+private:
+ FtRtecEventChannelAdmin::ObjectId_var object_id_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxySupplier.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxySupplier.cpp
new file mode 100644
index 00000000000..62fad4ef9d7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxySupplier.cpp
@@ -0,0 +1,202 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ProxySupplier.h"
+#include "../Utils/activate_with_id.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Replication_Service.h"
+
+ACE_RCSID (EventChannel,
+ TAO_FTEC_ProxyPushSupplier,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+const TAO_FTEC_ProxyPushSupplier::RollbackOperation
+ TAO_FTEC_ProxyPushSupplier::rollback_obtain =
+ &FtRtecEventChannelAdmin::EventChannelFacade::disconnect_push_supplier;
+
+TAO_FTEC_ProxyPushSupplier::TAO_FTEC_ProxyPushSupplier(TAO_EC_Event_Channel_Base* event_channel
+ ,int validate_connection)
+: Inherited(event_channel, validate_connection)
+{
+}
+
+const FtRtecEventChannelAdmin::ObjectId&
+TAO_FTEC_ProxyPushSupplier::id() const
+{
+ return object_id_.in();
+}
+
+ /// Activate in the POA
+void
+TAO_FTEC_ProxyPushSupplier::activate (
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr &result
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ result =
+ RtecEventChannelAdmin::ProxyPushSupplier::_nil();
+ ACE_TRY {
+ object_id_ = Request_Context_Repository().get_object_id(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa = _default_POA(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ activate_object_with_id(result, poa.in(), this, id() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // ignore exceptions
+ }
+ ACE_ENDTRY;
+}
+
+ // = The RtecEventChannelAdmin::ProxyPushSupplier methods...
+void TAO_FTEC_ProxyPushSupplier::connect_push_consumer (
+ RtecEventComm::PushConsumer_ptr push_consumer,
+ const RtecEventChannelAdmin::ConsumerQOS &qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecEventChannelAdmin::AlreadyConnected,
+ RtecEventChannelAdmin::TypeError))
+{
+ if (Request_Context_Repository().is_executed_request())
+ return;
+
+ FtRtecEventChannelAdmin::Operation update;
+ FtRtecEventChannelAdmin::Connect_push_consumer_param param;
+ update.object_id = this->id();
+ param.push_consumer = RtecEventComm::PushConsumer::_duplicate(push_consumer);
+ param.qos = qos;
+ update.param.connect_consumer_param(param);
+
+ Inherited::connect_push_consumer(push_consumer, qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TRY {
+ FTRTEC::Replication_Service* svc = FTRTEC::Replication_Service::instance();
+
+ ACE_Read_Guard<FTRTEC::Replication_Service> locker(*svc);
+
+ svc->replicate_request(update,
+ &FtRtecEventChannelAdmin::EventChannelFacade::disconnect_push_supplier
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL {
+ }
+ ACE_ENDTRY;
+}
+
+
+void TAO_FTEC_ProxyPushSupplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (Request_Context_Repository().is_executed_request())
+ return;
+
+ FtRtecEventChannelAdmin::Operation update;
+ update.object_id = id();
+ update.param._d(FtRtecEventChannelAdmin::DISCONNECT_PUSH_SUPPLIER);
+
+ Inherited::disconnect_push_supplier(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ FTRTEC::Replication_Service *svc = FTRTEC::Replication_Service::instance();
+
+ ACE_Read_Guard<FTRTEC::Replication_Service> locker(*svc);
+
+ svc->replicate_request(update, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void TAO_FTEC_ProxyPushSupplier::suspend_connection (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (Request_Context_Repository().is_executed_request())
+ return;
+
+ FtRtecEventChannelAdmin::Operation update;
+ update.object_id = id();
+ update.param._d(FtRtecEventChannelAdmin::SUSPEND_CONNECTION);
+
+ Inherited::suspend_connection(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TRY
+ {
+ FTRTEC::Replication_Service* svc = FTRTEC::Replication_Service::instance();
+ ACE_Read_Guard<FTRTEC::Replication_Service> locker(*svc);
+
+ svc->replicate_request(update,
+ &FtRtecEventChannelAdmin::EventChannelFacade::resume_push_supplier
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL {
+ this->resume_connection(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+}
+
+void TAO_FTEC_ProxyPushSupplier::resume_connection (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (Request_Context_Repository().is_executed_request())
+ return;
+
+ Request_Context_Repository().set_object_id(id() ACE_ENV_ARG_PARAMETER);
+ FtRtecEventChannelAdmin::Operation update;
+ update.object_id = id();
+ update.param._d(FtRtecEventChannelAdmin::RESUME_CONNECTION);
+
+ Inherited::resume_connection(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TRY {
+ FTRTEC::Replication_Service* svc = FTRTEC::Replication_Service::instance();
+
+ ACE_Read_Guard<FTRTEC::Replication_Service> locker(*svc);
+
+ svc->replicate_request(update,
+ &FtRtecEventChannelAdmin::EventChannelFacade::suspend_push_supplier
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL {
+ this->suspend_connection(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+}
+
+
+void TAO_FTEC_ProxyPushSupplier::get_state(FtRtecEventChannelAdmin::ProxyPushSupplierStat& state)
+{
+ state.object_id = this->object_id_.in ();
+ state.suspended = this->is_suspended();
+ if (this->is_connected()) {
+ FtRtecEventChannelAdmin::ProxyPushSupplierConnectionInfo info;
+ info.push_consumer = this->consumer();
+ info.qos = this->subscriptions();
+ state.parameter.info(info);
+ }
+}
+
+
+void TAO_FTEC_ProxyPushSupplier::set_state(const FtRtecEventChannelAdmin::ProxyPushSupplierStat& state
+ ACE_ENV_ARG_DECL)
+{
+ if (!CORBA::is_nil(state.parameter.info().push_consumer.in()))
+ {
+ Inherited::connect_push_consumer(state.parameter.info().push_consumer.in(),
+ state.parameter.info().qos
+ ACE_ENV_ARG_PARAMETER);
+ if (state.suspended)
+ Inherited::suspend_connection(ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxySupplier.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxySupplier.h
new file mode 100644
index 00000000000..34c38f96400
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxySupplier.h
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FTEC_ProxySupplier.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_FTEC_PROXYSUPPLIER_H
+#define TAO_FTEC_PROXYSUPPLIER_H
+#include "orbsvcs/Event/EC_Default_ProxySupplier.h"
+#include "ace/SString.h"
+#include "orbsvcs/FtRtecEventChannelAdminC.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FTEC_ProxyPushSupplier : public TAO_EC_Default_ProxyPushSupplier
+{
+ typedef TAO_EC_Default_ProxyPushSupplier Inherited;
+public:
+ typedef RtecEventChannelAdmin::ProxyPushSupplier Interface;
+ typedef FtRtecEventChannelAdmin::ProxyPushSupplierStat State;
+ typedef POA_RtecEventChannelAdmin::ProxyPushSupplier_ptr Skeleton;
+
+ TAO_FTEC_ProxyPushSupplier(TAO_EC_Event_Channel_Base* event_channel,
+ int validate_connection);
+ /// Activate in the POA
+ virtual void activate (
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr &proxy
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // = The RtecEventChannelAdmin::ProxyPushSupplier methods...
+ virtual void connect_push_consumer (
+ RtecEventComm::PushConsumer_ptr push_consumer,
+ const RtecEventChannelAdmin::ConsumerQOS &qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecEventChannelAdmin::AlreadyConnected,
+ RtecEventChannelAdmin::TypeError));
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void suspend_connection (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void resume_connection (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ const FtRtecEventChannelAdmin::ObjectId& id() const;
+
+ void get_state(FtRtecEventChannelAdmin::ProxyPushSupplierStat& state);
+ void set_state(const FtRtecEventChannelAdmin::ProxyPushSupplierStat& state
+ ACE_ENV_ARG_DECL);
+
+ typedef void (FtRtecEventChannelAdmin::EventChannelFacade::*RollbackOperation)
+ (const FtRtecEventChannelAdmin::ObjectId& ACE_ENV_ARG_DECL);
+
+ static const RollbackOperation rollback_obtain;
+private:
+ FtRtecEventChannelAdmin::ObjectId_var object_id_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_SupplierAdmin.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_SupplierAdmin.cpp
new file mode 100644
index 00000000000..74a666746cc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_SupplierAdmin.cpp
@@ -0,0 +1,49 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_SupplierAdmin.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.h"
+#include "tao/Stub.h"
+
+ACE_RCSID (EventChannel,
+ TAO_FTEC_SupplierAdmin,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+const FtRtecEventChannelAdmin::OperationType
+TAO_FTEC_SupplierAdmin::OBTAIN_ID = FtRtecEventChannelAdmin::OBTAIN_PUSH_CONSUMER;
+
+TAO_FTEC_SupplierAdmin::TAO_FTEC_SupplierAdmin (TAO_EC_Event_Channel_Base *ec)
+ : TAO_EC_SupplierAdmin (ec)
+ , FT_Aspect(this, this->event_channel_->supplier_poa ())
+{
+}
+
+TAO_FTEC_SupplierAdmin::~TAO_FTEC_SupplierAdmin()
+{
+}
+
+
+RtecEventChannelAdmin::ProxyPushConsumer_ptr
+TAO_FTEC_SupplierAdmin::obtain_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return obtain_proxy(ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_FTEC_SupplierAdmin::disconnect(RtecEventChannelAdmin::ProxyPushConsumer_ptr obj)
+{
+ ACE_TRY_NEW_ENV {
+ obj->disconnect_push_consumer(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_SupplierAdmin.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_SupplierAdmin.h
new file mode 100644
index 00000000000..814061c0263
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_SupplierAdmin.h
@@ -0,0 +1,79 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FTEC_SupplierAdmin.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_FTEC_SUPPLIERADMIN_H
+#define TAO_FTEC_SUPPLIERADMIN_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.h"
+#include "orbsvcs/FtRtEvent/EventChannel/ProxyConsumerStateWorker.h"
+
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/EC_SupplierAdmin.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FTEC_Event_Channel_Impl;
+
+namespace FtRtecEventChannelAdmin {
+ struct SupplierAdminState;
+}
+/**
+ * @class TAO_FTEC_SupplierAdmin
+ *
+ * @brief Implement the RtecEventChannelAdmin::SupplierAdmin interface.
+ *
+ *
+ */
+class TAO_FTEC_SupplierAdmin
+ : public TAO_EC_SupplierAdmin
+ , public FT_ProxyAdmin<TAO_FTEC_SupplierAdmin,
+ TAO_FTEC_ProxyPushConsumer,
+ RtecEventChannelAdmin::ProxyPushConsumer,
+ FtRtecEventChannelAdmin::SupplierAdminState>
+{
+public:
+
+ static const FtRtecEventChannelAdmin::OperationType OBTAIN_ID;
+
+ typedef FT_ProxyAdmin<TAO_FTEC_SupplierAdmin,
+ TAO_FTEC_ProxyPushConsumer,
+ RtecEventChannelAdmin::ProxyPushConsumer,
+ FtRtecEventChannelAdmin::SupplierAdminState>
+ FT_Aspect;
+
+ typedef ProxyConsumerStateWorker StateWorker;
+
+ /// constructor...
+ TAO_FTEC_SupplierAdmin (TAO_EC_Event_Channel_Base* event_channel);
+
+ /// destructor...
+ virtual ~TAO_FTEC_SupplierAdmin (void);
+
+
+ // = The RtecEventChannelAdmin::SupplierAdmin methods...
+ virtual RtecEventChannelAdmin::ProxyPushConsumer_ptr
+ obtain_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void disconnect(RtecEventChannelAdmin::ProxyPushConsumer_ptr obj);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_FTEC_SUPPLIERADMIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTRTEC_ServiceActivate.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTRTEC_ServiceActivate.h
new file mode 100644
index 00000000000..9666d6e5480
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTRTEC_ServiceActivate.h
@@ -0,0 +1,11 @@
+// $Id$
+
+#ifndef FTRTEC_SERVICE_ACTIVATE_H
+#define FTRTEC_SERVICE_ACTIVATE_H
+
+#include "orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Identification_Service.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Replication_Service.h"
+
+#endif
+
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_Base.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_Base.cpp
new file mode 100644
index 00000000000..5fb7d08ad06
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_Base.cpp
@@ -0,0 +1,52 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_Base.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/PortableServer/Servant_Base.h"
+#include "tao/PortableServer/PortableServer.h"
+
+
+ACE_RCSID (EventChannel,
+ FT_ProxyAdmin_Base,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+FT_ProxyAdmin_Base::FT_ProxyAdmin_Base(PortableServer::ServantBase* servant,
+ PortableServer::POA_var poa)
+ : servant_(servant), poa_(poa)
+{
+}
+
+FT_ProxyAdmin_Base::~FT_ProxyAdmin_Base()
+{
+}
+
+void
+FT_ProxyAdmin_Base::activate(const FtRtecEventComm::ObjectId& oid
+ ACE_ENV_ARG_DECL)
+{
+ poa_->activate_object_with_id(
+ reinterpret_cast<const PortableServer::ObjectId&> (oid),
+ servant_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ object_id_ = oid;
+}
+
+
+const FtRtecEventComm::ObjectId&
+FT_ProxyAdmin_Base::object_id(ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
+{
+ return object_id_;
+}
+
+
+CORBA::Object_var
+FT_ProxyAdmin_Base::reference(ACE_ENV_SINGLE_ARG_DECL) const
+{
+ return poa_->servant_to_reference(servant_
+ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_Base.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_Base.h
new file mode 100644
index 00000000000..2c639c0ce6f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_Base.h
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_ProxyAdmin_Base.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef FT_PROXYADMIN_BASE_H
+#define FT_PROXYADMIN_BASE_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FtRtecEventCommC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PortableServer/Servant_Base.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class FT_ProxyAdmin_Base
+{
+public:
+ FT_ProxyAdmin_Base(PortableServer::ServantBase* servant,
+ PortableServer::POA_var poa);
+ virtual ~FT_ProxyAdmin_Base();
+ void activate(const FtRtecEventComm::ObjectId& oid
+ ACE_ENV_ARG_DECL);
+
+ const FtRtecEventComm::ObjectId& object_id(ACE_ENV_SINGLE_ARG_DECL) const;
+
+ /// Returns an CORBA object reference when the servant is activated
+ CORBA::Object_var reference(ACE_ENV_SINGLE_ARG_DECL) const;
+
+protected:
+
+ PortableServer::ServantBase* servant_;
+ /// Store the default POA.
+ PortableServer::POA_var poa_;
+ /// store the object id
+ FtRtecEventComm::ObjectId object_id_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.cpp
new file mode 100644
index 00000000000..00c658cef95
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.cpp
@@ -0,0 +1,145 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/IOGR_Maker.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Replication_Service.h"
+#include "ace/Synch_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class EC_PROXY_ADMIN, class Proxy,
+ class ProxyInterface, class State>
+FT_ProxyAdmin<EC_PROXY_ADMIN, Proxy, ProxyInterface, State>::FT_ProxyAdmin(
+ EC_PROXY_ADMIN* admin, PortableServer::POA_var poa)
+ : FT_ProxyAdmin_Base(admin, poa), admin_(admin)
+{
+}
+
+
+template <class EC_PROXY_ADMIN, class Proxy,
+ class ProxyInterface, class State>
+void
+FT_ProxyAdmin<EC_PROXY_ADMIN, Proxy, ProxyInterface,State>::obtain_proxy (
+ const FtRtecEventChannelAdmin::Operation& op
+ ACE_ENV_ARG_DECL)
+{
+ Request_Context_Repository().set_object_id(op.object_id
+ ACE_ENV_ARG_PARAMETER);
+
+ ProxyInterface_var result
+ = admin_->obtain(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ FTRTEC::Replication_Service* svc = FTRTEC::Replication_Service::instance();
+ ACE_TRY {
+ ACE_Read_Guard<FTRTEC::Replication_Service> locker(*svc);
+
+ svc->replicate_request(op,
+ Proxy::rollback_obtain
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL {
+ admin_->disconnect(result.in());
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+template <class EC_PROXY_ADMIN, class Proxy,
+ class ProxyInterface, class State>
+typename FT_ProxyAdmin<EC_PROXY_ADMIN, Proxy, ProxyInterface, State>::ProxyInterface_ptr
+FT_ProxyAdmin<EC_PROXY_ADMIN, Proxy, ProxyInterface, State>::obtain_proxy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Any_var any = Request_Context_Repository().get_cached_result(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ CORBA::Object_var obj;
+ if (any >>= CORBA::Any::to_object(obj))
+ return ProxyInterface::_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+
+ FtRtecEventChannelAdmin::ObjectId oid;
+ Request_Context_Repository().generate_object_id(oid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ FtRtecEventChannelAdmin::Operation update;
+
+ update.object_id = oid;
+ update.param._d(EC_PROXY_ADMIN::OBTAIN_ID);
+
+ ProxyInterface_var result
+ = admin_->obtain(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ ACE_TRY {
+ FTRTEC::Replication_Service* svc = FTRTEC::Replication_Service::instance();
+ ACE_Read_Guard<FTRTEC::Replication_Service> locker(*svc);
+ obj = IOGR_Maker::instance()->forge_iogr(result.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ result = ProxyInterface::_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ svc->replicate_request(update,
+ Proxy::rollback_obtain
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL {
+ admin_->disconnect(result.in());
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+
+ return result._retn();
+}
+
+
+template <class EC_PROXY_ADMIN, class Proxy,
+ class ProxyInterface, class State>
+void FT_ProxyAdmin<EC_PROXY_ADMIN, Proxy, ProxyInterface, State>::get_state(
+ State& state
+ ACE_ENV_ARG_DECL)
+{
+ typename EC_PROXY_ADMIN::StateWorker worker(state.proxies);
+ admin_->for_each(&worker ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+template <class EC_PROXY_ADMIN, class Proxy,
+ class ProxyInterface, class State>
+void FT_ProxyAdmin<EC_PROXY_ADMIN, Proxy, ProxyInterface, State>::set_state(
+ const State& state
+ ACE_ENV_ARG_DECL)
+{
+ for (size_t i =0; i < state.proxies.length(); ++i)
+ {
+ const typename Proxy::State& proxy_state
+ = state.proxies[i];
+
+ Request_Context_Repository().set_object_id(proxy_state.object_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ProxyInterface_var
+ proxy_ior = admin_->obtain(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ typedef typename Proxy::Skeleton Skeleton;
+ const PortableServer::Servant servant = poa_->id_to_servant(
+ reinterpret_cast<const PortableServer::ObjectId&> (proxy_state.object_id)
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK;
+ Skeleton skeleton = dynamic_cast<Skeleton> (servant);
+ ACE_CHECK;
+
+ static_cast<Proxy*> (skeleton)->set_state(proxy_state
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.h
new file mode 100644
index 00000000000..92e2bf0ad6d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.h
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_ProxyAdmin_T.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef FT_PROXYADMIN_H
+#define FT_PROXYADMIN_H
+
+#include "orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_Base.h"
+#include "../Utils/ScopeGuard.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class EC_PROXY_ADMIN, class Proxy,
+ class ProxyInterface, class State>
+class FT_ProxyAdmin : public FT_ProxyAdmin_Base
+{
+public:
+ typedef typename ProxyInterface::_ptr_type ProxyInterface_ptr;
+ typedef typename ProxyInterface::_var_type ProxyInterface_var;
+
+ FT_ProxyAdmin(EC_PROXY_ADMIN* admin,
+ PortableServer::POA_var poa);
+
+ ProxyInterface_ptr obtain_proxy (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// this is used for updating the state
+ void obtain_proxy (const FtRtecEventChannelAdmin::Operation& op
+ ACE_ENV_ARG_DECL);
+
+ void get_state(State& state ACE_ENV_ARG_DECL);
+ void set_state(const State& state ACE_ENV_ARG_DECL);
+private:
+ EC_PROXY_ADMIN* admin_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("FT_ProxyAdmin_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector.cpp
new file mode 100644
index 00000000000..a7cc3c7a391
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector.cpp
@@ -0,0 +1,75 @@
+// $Id$
+
+#include "ace/Reactor.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Fault_Detector.h"
+#include "ace/Select_Reactor.h"
+
+ACE_RCSID (EventChannel,
+ Fault_Detector,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+Fault_Detector::ReactorTask::ReactorTask()
+ : reactor_(new ACE_Select_Reactor, 1)
+{
+}
+
+int
+Fault_Detector::ReactorTask::svc (void)
+{
+ this->reactor_.owner(ACE_OS::thr_self());
+ this->reactor_.run_reactor_event_loop();
+ return 0;
+}
+
+
+Fault_Detector::~Fault_Detector()
+{
+}
+
+const FTRT::Location& Fault_Detector::my_location() const
+{
+ return location_;
+}
+
+namespace {
+ Fault_Detector* detector;
+}
+
+Fault_Detector* Fault_Detector::instance()
+{
+ return detector;
+}
+
+int Fault_Detector::init(int argc, char** argv)
+{
+ detector = this;
+ if (this->parse_conf(argc, argv)==0 &&
+ this->init_acceptor() ==0)
+ {
+ 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;
+ }
+ return -1;
+}
+
+void Fault_Detector::stop()
+{
+ reactor_task_.reactor_.end_reactor_event_loop();
+}
+
+void Fault_Detector::set_listener(TAO_FTEC_Fault_Listener* listener)
+{
+ listener_ = listener;
+}
+
+int Fault_Detector::parse_conf(int , char** )
+{
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector.h
new file mode 100644
index 00000000000..a10fdf62f8f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector.h
@@ -0,0 +1,64 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Fault_Detector.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef FAULT_DETECTOR_H
+#define FAULT_DETECTOR_H
+
+#include "ace/Task.h"
+#include "ace/Reactor.h"
+
+#include "orbsvcs/FTRT_GroupManagerC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FTEC_Fault_Listener;
+
+class Fault_Detector
+{
+public:
+ virtual ~Fault_Detector();
+
+ static Fault_Detector* instance();
+
+ int init(int argc, ACE_TCHAR** argv);
+ void stop();
+ void set_listener(TAO_FTEC_Fault_Listener*);
+ const FTRT::Location& my_location() const;
+ virtual int connect(const FTRT::Location& location)=0;
+
+private:
+ virtual int init_acceptor()=0;
+ virtual int parse_conf(int argc, ACE_TCHAR** argv);
+
+protected:
+
+ class ReactorTask : public ACE_Task_Base
+ {
+ public:
+ // ctor
+ ReactorTask();
+ virtual int svc (void);
+ ACE_Reactor reactor_;
+ };
+
+ FTRT::Location location_;
+ ReactorTask reactor_task_;
+ TAO_FTEC_Fault_Listener* listener_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif //FAULT_DETECTOR_H
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.cpp
new file mode 100644
index 00000000000..56d8c25b846
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.cpp
@@ -0,0 +1,90 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Fault_Detector_T.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Fault_Listener.h"
+#include "orbsvcs/FtRtEvent/EventChannel/SCTP_Fault_Detector.h"
+#include "ace/SOCK_Acceptor.h"
+#include "ace/SOCK_Connector.h"
+#include "orbsvcs/FtRtEvent/EventChannel/ConnectionHandler_T.h"
+
+#include "ace/Acceptor.h"
+#include "ace/OS_NS_strings.h"
+
+ACE_RCSID (EventChannel,
+ Fault_Detector_Loader,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace FTRTEC {
+ typedef Fault_Detector_T<
+ ACE_Acceptor<ConnectionAcceptHandler<ACE_SOCK_STREAM> , ACE_SOCK_ACCEPTOR>,
+ ACE_SOCK_Connector, ConnectionDetectHandler<ACE_SOCK_STREAM> >
+ TCP_Fault_Detector;
+
+ Fault_Detector_Loader::Fault_Detector_Loader (void)
+ {
+ }
+
+ Fault_Detector_Loader::~Fault_Detector_Loader (void)
+ {
+ }
+
+ int
+ Fault_Detector_Loader::init (int argc,
+ ACE_TCHAR* argv[])
+ {
+ static int initialized = 0;
+
+ // Only allow initialization once.
+ if (initialized)
+ return 0;
+
+ initialized = 1;
+
+ Fault_Detector* detector = 0;
+
+ // Parse any service configurator parameters.
+ if (argc > 0 && ACE_OS::strcasecmp (argv[0], ACE_TEXT("sctp")) == 0)
+ {
+#if (TAO_HAS_SCIOP == 1)
+ ACE_AUTO_PTR_RESET(detector_, detector, Fault_Detector);
+#else
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) SCTP not enabled. ",
+ " Enable SCTP and rebuild ACE+TAO \n"));
+#endif /* TAO_HAS_SCIOP */
+ argc--; argv++;
+ }
+ else {
+ ACE_NEW_RETURN(detector, TCP_Fault_Detector, -1);
+ ACE_AUTO_PTR_RESET(detector_, detector, Fault_Detector);
+ }
+ return detector_->init(argc, argv);
+ }
+
+ Fault_Detector*
+ Fault_Detector_Loader::detector()
+ {
+ return detector_.get();
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ /////////////////////////////////////////////////////////////////////
+
+ACE_FACTORY_NAMESPACE_DEFINE (
+ TAO_FTRTEC,
+ Fault_Detector_Loader,
+ FTRTEC::Fault_Detector_Loader)
+
+ACE_STATIC_SVC_DEFINE (
+ Fault_Detector_Loader,
+ ACE_TEXT ("FTRTEC_Fault_Detector"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (Fault_Detector_Loader),
+ ACE_Service_Type::DELETE_THIS
+ | ACE_Service_Type::DELETE_OBJ,
+ 0)
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.h
new file mode 100644
index 00000000000..dbe29fe82da
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.h
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Fault_Detector_Loader.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef FAULT_DETECTOR_LOADER_H
+#define FAULT_DETECTOR_LOADER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FtRtEvent/EventChannel/ftrtec_export.h"
+
+#include "tao/orbconf.h"
+
+#include "ace/Service_Object.h"
+#include "ace/Service_Config.h"
+#include "ace/Auto_Ptr.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class Fault_Detector;
+
+namespace FTRTEC {
+ class TAO_FTRTEC_Export Fault_Detector_Loader : public ACE_Service_Object
+ {
+ public:
+ /// Constructor.
+ Fault_Detector_Loader (void);
+
+ /// Destructor.
+ virtual ~Fault_Detector_Loader (void);
+
+ virtual int init (int argc,
+ ACE_TCHAR* []);
+ Fault_Detector* detector();
+ private:
+ auto_ptr<Fault_Detector> detector_;
+ };
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE_EXPORT (TAO_FTRTEC, Fault_Detector_Loader)
+ACE_STATIC_SVC_REQUIRE(Fault_Detector_Loader)
+ACE_FACTORY_DECLARE (TAO_FTRTEC, Fault_Detector_Loader)
+
+#include /**/ "ace/post.h"
+#endif //FAULT_DETECTOR_LOADER_H
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_T.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_T.cpp
new file mode 100644
index 00000000000..bcf68ca9e98
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_T.cpp
@@ -0,0 +1,65 @@
+
+// $Id$
+
+#include "ace/INET_Addr.h"
+#include "ace/os_include/os_netdb.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class ACCEPTOR, class CONNECTOR, class DETECTION_HANDLER>
+Fault_Detector_T<ACCEPTOR, CONNECTOR, DETECTION_HANDLER>::Fault_Detector_T()
+{
+}
+
+template <class ACCEPTOR, class CONNECTOR, class DETECTION_HANDLER>
+Fault_Detector_T<ACCEPTOR, CONNECTOR, DETECTION_HANDLER>::~Fault_Detector_T()
+{
+}
+
+
+template <class ACCEPTOR, class CONNECTOR, class DETECTION_HANDLER>
+int
+Fault_Detector_T<ACCEPTOR, CONNECTOR, DETECTION_HANDLER>::init_acceptor()
+{
+ typename CONNECTOR::PEER_ADDR listen_addr;
+ if (acceptor_.open(listen_addr, &reactor_task_.reactor_) != 0)
+ ACE_ERROR_RETURN((LM_ERROR, "Connot open acceptor\n"), -1);
+
+ if (acceptor_.acceptor().get_local_addr(listen_addr) !=0)
+ ACE_ERROR_RETURN((LM_ERROR, "Connot get local addr\n"), -1);
+
+ ACE_DEBUG((LM_DEBUG, "listening at %s:%d\n", listen_addr.get_host_name(),
+ listen_addr.get_port_number()));
+ char* buf = CORBA::string_alloc(MAXHOSTNAMELEN);
+ listen_addr.addr_to_string(buf, MAXHOSTNAMELEN, 0);
+ location_.length(1);
+ location_[0].id = buf;
+ return 0;
+}
+
+template <class ACCEPTOR, class CONNECTOR, class DETECTION_HANDLER>
+int
+Fault_Detector_T<ACCEPTOR, CONNECTOR, DETECTION_HANDLER>::connect(const FTRT::Location& location)
+{
+ if (location.length() == 0)
+ return -1;
+
+ typename CONNECTOR::PEER_ADDR prev_addr(location[0].id);
+
+ DETECTION_HANDLER* handler;
+ ACE_NEW_RETURN(handler, DETECTION_HANDLER(listener_), 0) ;
+
+ handler->reactor(&reactor_task_.reactor_);
+ ACE_DEBUG((LM_DEBUG, "connecting to %s\n", location[0].id.in()));
+
+ int result = connector_.connect(handler->peer(), prev_addr);
+
+ if (result == 0)
+ handler->open(this);
+ else
+ handler->close();
+
+ return result ;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_T.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_T.h
new file mode 100644
index 00000000000..45be158a522
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_T.h
@@ -0,0 +1,48 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Fault_Detector_T.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef FAULT_DETECTOR_T_H
+#define FAULT_DETECTOR_T_H
+
+#include "orbsvcs/FtRtEvent/EventChannel/Fault_Detector.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class ACCEPTOR, class CONNECTOR, class DETECTION_HANDLER>
+class Fault_Detector_T : public Fault_Detector
+{
+public:
+ Fault_Detector_T();
+ ~Fault_Detector_T();
+ int connect(const FTRT::Location& addr);
+protected:
+ ACCEPTOR acceptor_;
+ CONNECTOR connector_;
+private:
+ virtual int init_acceptor();
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/FtRtEvent/EventChannel/Fault_Detector_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Fault_Detector_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Listener.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Listener.h
new file mode 100644
index 00000000000..e66914b0c29
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Listener.h
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Fault_Listener.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_FTEC_FAULT_LISTENER_H
+#define TAO_FTEC_FAULT_LISTENER_H
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FTEC_Fault_Listener
+{
+public:
+ virtual ~TAO_FTEC_Fault_Listener(){};
+ virtual void connection_closed()=0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ForwardCtrlServerInterceptor.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ForwardCtrlServerInterceptor.cpp
new file mode 100644
index 00000000000..ee750df8f22
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ForwardCtrlServerInterceptor.cpp
@@ -0,0 +1,260 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/ForwardCtrlServerInterceptor.h"
+#include "orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h"
+#include "orbsvcs/FtRtEvent/EventChannel/IOGR_Maker.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "../Utils/resolve_init.h"
+#include "../Utils/Safe_InputCDR.h"
+#include "../Utils/Log.h"
+
+#include "tao/Object_KeyC.h"
+#include "tao/ORB_Constants.h"
+
+#include "orbsvcs/FTRTC.h"
+
+ACE_RCSID (EventChannel,
+ ForwardCtrlServerInterceptor,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+CORBA::Object_ptr get_target(PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::String_var orb_id = ri->orb_id(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(CORBA::Object::_nil());
+
+ int argc =0;
+ char** argv =0;
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, orb_id.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(CORBA::Object::_nil());
+
+ PortableServer::POA_var poa =
+ resolve_init<PortableServer::POA>(orb.in(), "RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(CORBA::Object::_nil());
+
+ PortableInterceptor::AdapterName_var adaptor_name =
+ ri->adapter_name(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(CORBA::Object::_nil());
+
+ for (size_t i = 1; i < adaptor_name->length(); ++i) {
+ poa = poa->find_POA((*adaptor_name)[i] , false
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(CORBA::Object::_nil());
+ }
+
+ CORBA::OctetSeq_var oid =
+ ri->object_id(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(CORBA::Object::_nil());
+
+ CORBA::Object_var obj =
+ poa->id_to_reference(oid.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(CORBA::Object::_nil());
+
+ return obj._retn();
+}
+
+CORBA::Object_ptr get_forward(PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var target =
+ get_target(ri ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(CORBA::Object::_nil());
+
+ TAO::ObjectKey_var key =
+ target->_key(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(CORBA::Object::_nil());
+
+ CORBA::Object_var iogr =
+ GroupInfoPublisher::instance()->group_reference();
+
+ CORBA::Object_var forward =
+ IOGR_Maker::instance()->ior_replace_key(iogr.in(), key.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(CORBA::Object::_nil());
+
+ return forward._retn();
+}
+
+
+ForwardCtrlServerInterceptor::ForwardCtrlServerInterceptor()
+{
+}
+
+ForwardCtrlServerInterceptor::~ForwardCtrlServerInterceptor()
+{
+}
+
+char * ForwardCtrlServerInterceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup("ForwardCtrlServerInterceptor");
+}
+
+void ForwardCtrlServerInterceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void ForwardCtrlServerInterceptor::receive_request (PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_TRY {
+ IOP::ServiceContext_var service_context =
+ ri->get_request_service_context(IOP::FT_GROUP_VERSION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY {
+ // not an FT call , continue to process the request
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ GroupInfoPublisherBase* publisher = GroupInfoPublisher::instance();
+ if (!publisher->is_primary()) {
+ // I am not primary, forword the request to primary
+ CORBA::Object_var forward = get_forward(ri
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_THROW (PortableInterceptor::ForwardRequest (forward.in()));
+ }
+}
+
+void ForwardCtrlServerInterceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+FT::ObjectGroupRefVersion get_ft_group_version(IOP::ServiceContext_var service_context
+ ACE_ENV_ARG_DECL)
+{
+ Safe_InputCDR cdr (reinterpret_cast<const char*> (service_context->context_data.get_buffer ()),
+ service_context->context_data.length ());
+
+ CORBA::Boolean byte_order;
+
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28, CORBA::COMPLETED_NO), 0);
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ FT::FTGroupVersionServiceContext fgvsc;
+
+ if ((cdr >> fgvsc) == 0)
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28,
+ CORBA::COMPLETED_NO), 0);
+
+ return fgvsc.object_group_ref_version;
+}
+
+
+
+void ForwardCtrlServerInterceptor::send_reply (PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ IOP::ServiceContext_var service_context;
+ FT::ObjectGroupRefVersion version=0;
+
+ ACE_TRY_EX(block1)
+ {
+ if (!ri->response_expected(ACE_ENV_SINGLE_ARG_PARAMETER))
+ return;
+ ACE_TRY_CHECK_EX(block1);
+
+ service_context =
+ ri->get_request_service_context(IOP::FT_GROUP_VERSION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block1);
+ // get the ref version service context
+ version =
+ get_ft_group_version(service_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block1);
+ }
+ ACE_CATCHALL {
+ // not an FT call , continue to reply the request
+ return;
+ }
+ ACE_ENDTRY;
+
+ // pass a new IOGR if the client use an outdated version
+
+ IOGR_Maker* maker = IOGR_Maker::instance();
+ TAO_FTRTEC::Log(3, "Current GROUP Version = %d, received version = %d\n",
+ maker->get_ref_version(), version);
+
+ if (version < maker->get_ref_version()) {
+ ACE_DEBUG((LM_DEBUG, "Outdated IOGR version, passing new IOGR\n"));
+
+ ACE_TRY_EX(block2) {
+ CORBA::Object_var forward = get_forward(ri
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block2);
+
+ IOP::ServiceContext sc;
+ sc.context_id = FTRT::FT_FORWARD;
+ TAO_OutputCDR cdr;
+
+ //if (!(cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)))
+ //ACE_THROW (CORBA::MARSHAL ());
+
+ if ((cdr << forward.in() ) == 0 )
+ ACE_THROW (CORBA::MARSHAL ());
+
+ ACE_Message_Block mb;
+ ACE_CDR::consolidate(&mb, cdr.begin());
+#if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
+ sc.context_data.replace(mb.length(), &mb);
+#else
+ // If the replace method is not available, we will need
+ // to do the copy manually. First, set the octet sequence length.
+ CORBA::ULong length = mb.length ();
+ sc.context_data.length (length);
+
+ // Now copy over each byte.
+ char* base = mb.data_block ()->base ();
+ for(CORBA::ULong i = 0; i < length; i++)
+ {
+ sc.context_data[i] = base[i];
+ }
+#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
+
+ ri->add_reply_service_context (sc, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block2);
+
+ ACE_DEBUG((LM_DEBUG, "reply_service_context added\n"));
+ }
+ ACE_CATCHALL {
+ }
+ ACE_ENDTRY;
+ }
+
+}
+
+void ForwardCtrlServerInterceptor::send_exception (PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void ForwardCtrlServerInterceptor::send_other (PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ForwardCtrlServerInterceptor.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ForwardCtrlServerInterceptor.h
new file mode 100644
index 00000000000..d53dc682b0e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ForwardCtrlServerInterceptor.h
@@ -0,0 +1,65 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file ForwardCtrlServerInterceptor.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef FORWARDCTRLSERVERINTERCEPTOR_H
+#define FORWARDCTRLSERVERINTERCEPTOR_H
+
+#include "tao/PI_Server/PI_Server.h"
+#include "tao/PortableInterceptorC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class ForwardCtrlServerInterceptor
+ : public PortableInterceptor::ServerRequestInterceptor
+{
+public:
+ ForwardCtrlServerInterceptor();
+ ~ForwardCtrlServerInterceptor();
+
+ 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 (PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr
+ 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
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.cpp
new file mode 100644
index 00000000000..779396ce1ee
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.cpp
@@ -0,0 +1,340 @@
+// $Id$
+#include "ace/OS_NS_string.h"
+#include "ace/SString.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h"
+#include "../Utils/Safe_InputCDR.h"
+#include "../Utils/Log.h"
+
+ACE_RCSID (EventChannel,
+ FtEventServiceInterceptor,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+bool
+CachedRequestTable::is_new_request(const ACE_CString& client_id, CORBA::Long retention_id)
+{
+ TableImpl::ENTRY* entry = 0;
+ return table_.find(client_id, entry) !=0 || entry->int_id_.retention_id != retention_id;
+}
+
+int
+CachedRequestTable::update(const ACE_CString& client_id,
+ CORBA::Long retention_id,
+ const CORBA::Any& result)
+{
+ CachedRequestInfo info;
+ info.retention_id = retention_id;
+ TableImpl::ENTRY* entry=0;
+ if (table_.bind(client_id, info, entry))
+ {
+ entry->int_id_.result = result;
+ return 0;
+ }
+ return -1;
+}
+
+
+
+CORBA::Any
+CachedRequestTable::get_result(const ACE_CString& client_id)
+{
+ TableImpl::ENTRY* entry = 0;
+ if (table_.find(client_id, entry)) {
+ return entry->int_id_.result;
+ }
+ return CORBA::Any();
+}
+
+
+void
+CachedRequestTable::get_state(FtRtecEventChannelAdmin::CachedOptionResults& state)
+{
+ state.length(table_.current_size());
+ TableImpl::iterator last = table_.end();
+ int i = 0;
+
+ for (TableImpl::iterator first = table_.begin();
+ first != last;
+ ++first)
+ {
+ TableImpl::ENTRY& entry = *first;
+ state[i].client_id = ACE_OS::strdup(entry.ext_id_.c_str());
+ state[i].cached_result = entry.int_id_;
+ ++i;
+ }
+
+}
+
+void
+CachedRequestTable::set_state(const FtRtecEventChannelAdmin::CachedOptionResults& state)
+{
+ for (size_t i = 0; i < state.length(); ++i)
+ {
+ table_.bind(state[i].client_id.in(), state[i].cached_result);
+ }
+}
+
+void
+retrieve_ft_request_context(
+ PortableInterceptor::ServerRequestInfo_ptr ri,
+ IOP::ServiceContext_var& service_context,
+ FT::FTRequestServiceContext& ft_request_service_context
+ ACE_ENV_ARG_DECL)
+{
+ service_context = ri->get_request_service_context(IOP::FT_REQUEST ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const char * buf =
+ reinterpret_cast<const char *> (service_context->context_data.get_buffer ());
+
+ Safe_InputCDR cdr (buf,
+ service_context->context_data.length ());
+
+ CORBA::Boolean byte_order;
+
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+
+ if ((cdr >> ft_request_service_context) == 0)
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+}
+
+FTRT::TransactionDepth
+get_transaction_depth_context(
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+{
+ IOP::ServiceContext_var service_context;
+ ACE_TRY {
+ service_context = ri->get_request_service_context(FTRT::FT_TRANSACTION_DEPTH
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::BAD_PARAM, ex)
+ {
+ ACE_DEBUG((LM_DEBUG, "Received request without transaction depth context\n"));
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ const char * buf =
+ reinterpret_cast<const char *> (service_context->context_data.get_buffer ());
+ Safe_InputCDR cdr (buf,
+ service_context->context_data.length ());
+
+ CORBA::Boolean byte_order;
+
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), -1);
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ FTRT::TransactionDepth result;
+ if ((cdr >> result) == 0)
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), -1);
+
+ return result;
+}
+
+FTRT::SequenceNumber
+get_sequence_number_context(
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+{
+ FTRT::SequenceNumber result;
+ IOP::ServiceContext_var service_context;
+ service_context = ri->get_request_service_context(FTRT::FT_SEQUENCE_NUMBER
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ const char * buf =
+ reinterpret_cast<const char *> (service_context->context_data.get_buffer ());
+ Safe_InputCDR cdr (buf,
+ service_context->context_data.length ());
+
+ CORBA::Boolean byte_order;
+
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ if ((cdr >> result) == 0)
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);
+
+ return result;
+}
+
+
+namespace {
+FtEventServiceInterceptor* interceptor;
+}
+
+FtEventServiceInterceptor::FtEventServiceInterceptor ()
+{
+ interceptor = this;
+}
+
+FtEventServiceInterceptor::~FtEventServiceInterceptor ()
+{
+}
+
+FtEventServiceInterceptor*
+FtEventServiceInterceptor::instance()
+{
+ return interceptor;
+}
+
+char *
+FtEventServiceInterceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("FtEventServiceInterceptor");
+}
+
+void
+FtEventServiceInterceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+FtEventServiceInterceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+
+void
+FtEventServiceInterceptor::receive_request (PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ if (ACE_OS::strcmp(operation.in(), "push") == 0) {
+ TAO_FTRTEC::Log(3, "Received push command\n");
+ return;
+ }
+
+ ACE_TRY_EX(block1) {
+ FT::FTRequestServiceContext ft_request_service_context;
+ IOP::ServiceContext_var service_context;
+ retrieve_ft_request_context(ri,
+ service_context,
+ ft_request_service_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block1);
+
+ bool is_new_request = request_table_.is_new_request(
+ ft_request_service_context.client_id.in(),
+ ft_request_service_context.retention_id);
+
+ CORBA::Any cached_result;
+ if (!is_new_request) {
+ cached_result =
+ request_table_.get_result(ft_request_service_context.client_id.in());
+ }
+
+ Request_Context_Repository().set_cached_result(ri, cached_result
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block1);
+ Request_Context_Repository().set_ft_request_service_context(ri, service_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block1);
+
+ ACE_TRY_EX(block2) {
+
+ FTRT::TransactionDepth transaction_depth =
+ get_transaction_depth_context(ri
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block2);
+
+ Request_Context_Repository().set_transaction_depth(ri, transaction_depth
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block2);
+ }
+ ACE_CATCH (CORBA::BAD_PARAM, ex) {
+ }
+ ACE_ENDTRY;
+
+ FTRT::SequenceNumber sequence_no =
+ get_sequence_number_context(ri ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block1);
+
+ Request_Context_Repository().set_sequence_number(ri, sequence_no
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(block1);
+ }
+ ACE_CATCH (CORBA::BAD_PARAM, ex) {
+ }
+ ACE_ENDTRY;
+}
+
+void
+FtEventServiceInterceptor::send_reply (PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ FT::FTRequestServiceContext ft_request_service_context;
+ IOP::ServiceContext_var service_context;
+
+ ACE_TRY {
+ retrieve_ft_request_context(ri,
+ service_context,
+ ft_request_service_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::BAD_PARAM, ex) {
+ return;
+ }
+ ACE_ENDTRY;
+
+ request_table_.update(ft_request_service_context.client_id.in(),
+ ft_request_service_context.retention_id,
+ *(ri->result()) );
+}
+
+void
+FtEventServiceInterceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+FtEventServiceInterceptor::send_other (PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+
+void
+FtEventServiceInterceptor::get_state(FtRtecEventChannelAdmin::CachedOptionResults& state)
+{
+ request_table_.get_state(state);
+}
+
+void
+FtEventServiceInterceptor::set_state(const FtRtecEventChannelAdmin::CachedOptionResults& state)
+{
+ request_table_.set_state(state);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.h
new file mode 100644
index 00000000000..09a28a81257
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.h
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FtEventServiceInterceptor.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef FTEVENTSERVICEINTERCEPTOR_H
+#define FTEVENTSERVICEINTERCEPTOR_H
+#include "ace/Hash_Map_Manager_T.h"
+#include "ace/SString.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+#include "tao/ORB.h"
+#include "orbsvcs/FtRtecEventChannelAdminC.h"
+#include "tao/PI_Server/PI_Server.h"
+#include "tao/PI/PI.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FTEC_Event_Channel_Impl;
+typedef FtRtecEventChannelAdmin::CachedResult CachedRequestInfo;
+
+class CachedRequestTable
+{
+public:
+ bool is_new_request(const ACE_CString& client_id, CORBA::Long retention_id);
+ int update(const ACE_CString& client_id,
+ CORBA::Long retention_id,
+ const CORBA::Any&);
+ CORBA::Any get_result(const ACE_CString& client_id);
+ void get_state(FtRtecEventChannelAdmin::CachedOptionResults& state);
+ void set_state(const FtRtecEventChannelAdmin::CachedOptionResults& state);
+private:
+ typedef ACE_Hash_Map_Manager<ACE_CString, CachedRequestInfo, ACE_SYNCH_MUTEX> TableImpl;
+ TableImpl table_;
+};
+
+
+class FtEventServiceInterceptor :
+ public PortableInterceptor::ServerRequestInterceptor
+{
+public:
+ FtEventServiceInterceptor();
+ ~FtEventServiceInterceptor();
+
+ static FtEventServiceInterceptor* instance();
+ 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 (PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr
+ 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
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ void get_state(FtRtecEventChannelAdmin::CachedOptionResults& state);
+ void set_state(const FtRtecEventChannelAdmin::CachedOptionResults& state);
+private:
+ PortableInterceptor::Current_var pic(PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL);
+
+ CORBA::ORB_var orb_;
+ CachedRequestTable request_table_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.cpp
new file mode 100644
index 00000000000..63d7801689e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.cpp
@@ -0,0 +1,175 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h"
+#include "../Utils/resolve_init.h"
+#include "orbsvcs/FtRtEvent/EventChannel/IOGR_Maker.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Identification_Service.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.h"
+#include "../Utils/Log.h"
+
+//#include "../Utils/log_obj_endpoints.h"
+
+ACE_RCSID (EventChannel,
+ GroupInfoPublisher,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+GroupInfoPublisherBase::GroupInfoPublisherBase()
+ : info_(new Info)
+{
+ info_->primary = false;
+}
+
+
+
+void
+GroupInfoPublisherBase::subscribe(TAO_FTEC_Become_Primary_Listener* listener)
+{
+ subscribers_.push_back(listener);
+}
+
+void GroupInfoPublisherBase::set_naming_context(CosNaming::NamingContext_var naming_context)
+{
+ naming_context_ = naming_context;
+}
+
+bool
+GroupInfoPublisherBase::is_primary() const
+{
+ return info_->primary;
+}
+
+CORBA::Object_var
+GroupInfoPublisherBase::group_reference() const
+{
+ return info_->iogr;
+}
+
+FtRtecEventChannelAdmin::EventChannel_var
+GroupInfoPublisherBase::successor() const
+{
+ return info_->successor;
+}
+
+
+
+const GroupInfoPublisherBase::BackupList&
+GroupInfoPublisherBase::backups() const
+{
+ return info_->backups;
+}
+
+
+
+GroupInfoPublisherBase::Info*
+GroupInfoPublisherBase::setup_info(const FTRT::ManagerInfoList & info_list,
+ int my_position,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL)
+{
+ Info_ptr result(new Info);
+
+ result->primary = (my_position == 0);
+
+ /// create the object group
+ size_t len = info_list.length();
+
+ TAO_IOP::TAO_IOR_Manipulation::IORList iors;
+ iors.length(len);
+
+ size_t i;
+ for (i = 0; i < len; ++i) {
+ iors[i] = CORBA::Object::_duplicate(info_list[i].ior.in());
+ }
+
+ CORBA::Object_var obj =
+ IOGR_Maker::instance()->make_iogr(iors,object_group_ref_version
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ result->iogr =
+ ::FtRtecEventChannelAdmin::EventChannel::_narrow(obj.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ ACE_DEBUG((LM_DEBUG, "In setup_info\n"));
+ //log_obj_endpoints(result->iogr.in());
+
+ /// check if sucessor changed
+ size_t successors_length = info_list.length() - my_position -1;
+
+ if (successors_length /*!= info_->backups.length() */) {
+ // successor changed, update successor
+ iors.length(successors_length);
+ for (i = 0; i < successors_length; ++i) {
+ iors[i] = CORBA::Object::_duplicate(info_list[i+ my_position+1].ior.in());
+ }
+
+ obj = IOGR_Maker::instance()->merge_iors(iors
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ result->successor =
+ FtRtecEventChannelAdmin::EventChannel::_narrow(obj.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ }
+ /*
+ else {
+ result->successor = info_->successor;
+ }
+
+ if (!CORBA::is_nil(result->successor.in()))
+ {
+ CORBA::PolicyList_var pols;
+ result->successor->_validate_connection (pols.out ());
+ }
+ */
+
+ // update backups
+ result->backups.length(successors_length);
+ for (i = 0; i < successors_length; ++i) {
+ result->backups[i] =
+ FtRtecEventChannelAdmin::EventChannel::_narrow(
+ info_list[i+ my_position+1].ior.in()
+ ACE_ENV_ARG_PARAMETER);
+ //CORBA::PolicyList_var pols;
+ //result->backups[i]->_validate_connection (pols.out ());
+ ACE_CHECK_RETURN(0);
+ }
+ return result.release();
+}
+
+void
+GroupInfoPublisherBase::update_info(GroupInfoPublisherBase::Info_ptr& info)
+{
+ if (info->primary) {
+ if (!info_->primary) {
+ // now we become the primary, notify the subscribers
+ for (size_t i = 0; i < subscribers_.size(); ++i)
+ subscribers_[i]->become_primary();
+ }
+
+ if (!CORBA::is_nil(naming_context_.in())) {
+ TAO_FTRTEC::Log(1, "Registering to the Name Service\n");
+ ACE_TRY_NEW_ENV {
+ naming_context_->rebind(FTRTEC::Identification_Service::instance()->name(),
+ info->iogr.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL {
+ /// there's nothing we can do if the naming service is down
+ }
+ ACE_ENDTRY;
+ }
+ }
+ info_ = info;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Singleton<GroupInfoPublisherBase, ACE_Thread_Mutex> *ACE_Singleton<GroupInfoPublisherBase, ACE_Thread_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h
new file mode 100644
index 00000000000..8268bb2dd89
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file GroupInfoPublisher.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef GROUPINFOPUBLISHER_H
+#define GROUPINFOPUBLISHER_H
+
+#include "orbsvcs/FtRtecEventChannelAdminC.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "ace/Vector_T.h"
+#include "ace/Singleton.h"
+#include "ace/Synch.h"
+#include "ace/Auto_Ptr.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FTEC_Become_Primary_Listener;
+
+class GroupInfoPublisherBase
+{
+public:
+ typedef FtRtecEventChannelAdmin::EventChannelList BackupList;
+
+ struct Info {
+ bool primary;
+ CORBA::Object_var iogr;
+ FtRtecEventChannelAdmin::EventChannel_var successor;
+ BackupList backups;
+ };
+
+ typedef auto_ptr<Info> Info_ptr;
+ friend class ACE_Singleton<GroupInfoPublisherBase, ACE_SYNCH_MUTEX>;
+
+ void subscribe(TAO_FTEC_Become_Primary_Listener* listener);
+ void set_naming_context(CosNaming::NamingContext_var naming_context);
+ bool is_primary() const;
+ CORBA::Object_var group_reference() const;
+
+ FtRtecEventChannelAdmin::EventChannel_var successor() const;
+
+ const BackupList& backups() const;
+
+ Info* setup_info(const FTRT::ManagerInfoList & info_list,
+ int my_position,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL);
+
+ void update_info(Info_ptr& info);
+
+ const PortableServer::ObjectId& object_id() const;
+ const CosNaming::Name& name() const;
+
+ void object_id(const char* oid);
+ void name(const char* nam);
+
+private:
+ GroupInfoPublisherBase();
+
+ CosNaming::NamingContext_var naming_context_;
+ typedef ACE_Vector<TAO_FTEC_Become_Primary_Listener*, 2> Subscribers;
+ Subscribers subscribers_;
+ PortableServer::ObjectId object_id_;
+ CosNaming::Name name_;
+ Info_ptr info_;
+};
+
+typedef ACE_Singleton<GroupInfoPublisherBase, ACE_SYNCH_MUTEX> GroupInfoPublisher;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/IOGR_Maker.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/IOGR_Maker.cpp
new file mode 100644
index 00000000000..e64501e5e18
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/IOGR_Maker.cpp
@@ -0,0 +1,269 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/IOGR_Maker.h"
+#include "tao/MProfile.h"
+#include "tao/Profile.h"
+#include "tao/Stub.h"
+#include "tao/ORB_Core.h"
+#include "tao/Object_KeyC.h"
+#include "tao/Tagged_Components.h"
+#include "../Utils/resolve_init.h"
+#include "../Utils/Safe_InputCDR.h"
+#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h"
+#include "orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h"
+
+ACE_RCSID (EventChannel,
+ IOGR_Maker,
+ "$Id$")
+
+static IOGR_Maker* maker;
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+IOGR_Maker::IOGR_Maker()
+{
+}
+
+void
+IOGR_Maker::init(CORBA::ORB_ptr orb
+ ACE_ENV_ARG_DECL)
+{
+ iorm_ = resolve_init<TAO_IOP::TAO_IOR_Manipulation>(orb,
+ TAO_OBJID_IORMANIPULATION
+ ACE_ENV_ARG_PARAMETER);
+ ft_tag_component_.group_domain_id = "ft_eventchannel";
+ ft_tag_component_.object_group_id = 0;
+ ft_tag_component_.object_group_ref_version = 0;
+ maker = this;
+}
+
+
+IOGR_Maker*
+IOGR_Maker::instance()
+{
+ return maker;
+}
+
+CORBA::Object_ptr
+IOGR_Maker::merge_iors(const TAO_IOP::TAO_IOR_Manipulation::IORList& list
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var obj;
+ if (list.length() != 1)
+ obj = iorm_->merge_iors(list ACE_ENV_ARG_PARAMETER);
+ else
+ obj = CORBA::Object::_duplicate(list[0]);
+ return obj._retn();
+}
+
+
+CORBA::Object_ptr
+IOGR_Maker::make_iogr(const TAO_IOP::TAO_IOR_Manipulation::IORList& list,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL)
+{
+ /// generate a new IOGR if the object group changes.
+ CORBA::Object_var obj = merge_iors(list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(CORBA::Object::_nil());
+
+ FT::TagFTGroupTaggedComponent ft_tag_component(ft_tag_component_);
+ /// the generated IOGR should use a new object_group_ref_version
+ ft_tag_component.object_group_ref_version = object_group_ref_version;
+ set_tag_components(obj.in(), list[0], ft_tag_component
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN(CORBA::Object::_nil());
+ return obj._retn();
+}
+
+void replace_key(char* ior, char* end_ior,
+ const TAO::ObjectKey& oldkey,
+ const TAO::ObjectKey& newkey);
+/// the definition of replace_key() is moved
+/// to replace_key.cpp.
+
+
+CORBA::Object_ptr
+IOGR_Maker::forge_iogr(CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL)
+{
+ /// forge an IOGR whose object_key is the same with that of \a obj.
+ CORBA::Object_var merged;
+ // make a copy of the object
+ FtRtecEventChannelAdmin::EventChannel_var successor
+ = GroupInfoPublisher::instance()->successor();
+ if (! CORBA::is_nil(successor.in())) {
+ TAO::ObjectKey_var newkey = obj->_key(ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ CORBA::Object_var new_base = ior_replace_key(successor.in(), newkey.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(CORBA::Object::_nil());
+
+ if (CORBA::is_nil( new_base.in() ))
+ return CORBA::Object::_nil();
+
+ TAO_MProfile& base_profiles = new_base->_stubobj ()->base_profiles ();
+
+ TAO_ORB_Core *orb_core = TAO_ORB_Core_instance ();
+
+ TAO_Stub *stub = orb_core->create_stub (CORBA::string_dup(obj->_stubobj ()->type_id.in ()), // give the id string
+ base_profiles
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ // Make the stub memory allocation exception safe for the duration
+ // of this method.
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+
+ // Create the CORBA level proxy
+ CORBA::Object_ptr temp_obj = CORBA::Object::_nil ();
+ ACE_NEW_THROW_EX (temp_obj,
+ CORBA::Object (safe_stub.get ()),
+ CORBA::NO_MEMORY ());
+
+ // Release ownership of the pointers protected by the auto_ptrs since they
+ // no longer need to be protected by this point.
+ stub = safe_stub.release ();
+
+
+ merged =
+ iorm_->add_profiles(obj, temp_obj
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+ }
+ else
+ merged = CORBA::Object::_duplicate(obj);
+
+ set_tag_components(merged.in(), obj, ft_tag_component_
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN(CORBA::Object::_nil ());
+
+ return merged._retn();
+}
+
+CORBA::Object_ptr
+IOGR_Maker::ior_replace_key(CORBA::Object_ptr obj,
+ const TAO::ObjectKey& key
+ ACE_ENV_ARG_DECL)
+{
+ TAO_OutputCDR out_cdr;
+ if (!(out_cdr << obj))
+ return CORBA::Object::_nil();
+
+ ACE_Message_Block mb;
+
+ ACE_CDR::consolidate(&mb, out_cdr.begin());
+
+ TAO::ObjectKey_var old_key = obj->_key(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(CORBA::Object::_nil ());
+
+ replace_key(mb.base(), mb.end(),
+ old_key.in(), key);
+
+ CORBA::Object_var new_obj;
+ TAO_InputCDR in_cdr(&mb);
+ if (!(in_cdr >> new_obj))
+ return CORBA::Object::_nil();
+ return new_obj._retn();
+}
+
+bool
+IOGR_Maker::copy_ft_group_component(CORBA::Object_ptr ior)
+{
+ // Get the MProfile
+ TAO_MProfile &mprofile =
+ ior->_stubobj ()->base_profiles ();
+
+ // Looking for a tagged component with a GROUP flag.
+ IOP::TaggedComponent tagged_components;
+ tagged_components.tag = IOP::TAG_FT_GROUP;
+
+ if (mprofile.profile_count () > 0)
+ {
+ // Get the Tagged Components
+ const TAO_Tagged_Components &pfile_tagged =
+ mprofile.get_profile (0)->tagged_components ();
+
+ if (pfile_tagged.get_component (tagged_components) == 1)
+ {
+
+ // Grab the object group version
+ // @@ NOTE: This involves an allocation and a dellocation. This is
+ // really bad.
+ Safe_InputCDR cdr (
+ reinterpret_cast<const char*> (tagged_components.component_data.get_buffer ()),
+ tagged_components.component_data.length ());
+ CORBA::Boolean byte_order;
+
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ return false;
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ return (cdr >> ft_tag_component_) != 0;
+ }
+ }
+
+ return false;
+}
+
+void
+IOGR_Maker::set_ft_domain_id(const char* domain_id)
+{
+ ft_tag_component_.group_domain_id = domain_id;
+}
+
+void
+IOGR_Maker::set_group_id(CORBA::ULongLong id)
+{
+ ft_tag_component_.object_group_id = id;
+}
+
+void
+IOGR_Maker::set_ref_version(CORBA::ULong version)
+{
+ ft_tag_component_.object_group_ref_version = version;
+}
+
+CORBA::ULong
+IOGR_Maker::increment_ref_version()
+{
+ ACE_DEBUG((LM_DEBUG, "new object_group_ref_version = %d\n", ft_tag_component_. object_group_ref_version+1));
+ return ++ft_tag_component_.object_group_ref_version;
+}
+
+CORBA::ULong
+IOGR_Maker::get_ref_version() const
+{
+ return ft_tag_component_.object_group_ref_version;
+}
+
+
+void
+IOGR_Maker::set_tag_components(
+ CORBA::Object_ptr merged,
+ CORBA::Object_ptr primary,
+ FT::TagFTGroupTaggedComponent& ft_tag_component
+ ACE_ENV_ARG_DECL)
+{
+ // set the primary
+ TAO_FT_IOGR_Property prop (ft_tag_component);
+
+
+ prop.remove_primary_tag(merged
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ iorm_->set_primary (&prop, merged, primary
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ // Set the property
+ iorm_->set_property (&prop,
+ merged
+ ACE_ENV_ARG_PARAMETER);
+
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/IOGR_Maker.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/IOGR_Maker.h
new file mode 100644
index 00000000000..cbc933a61c8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/IOGR_Maker.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file IOGR_Maker.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef IOGR_MAKER_H
+#define IOGR_MAKER_H
+
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "tao/IORManipulation/IORManipulation.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class IOGR_Maker
+{
+public:
+ IOGR_Maker();
+
+ void init(CORBA::ORB_ptr orb
+ ACE_ENV_ARG_DECL);
+
+ /// instance() will only return a valid object after an
+ /// instance is explicitly created by client and init() is called.
+ static IOGR_Maker* instance();
+
+ /// Create a new object reference by merging the profiles lists in the
+ /// supplied list of one or more object references.
+ CORBA::Object_ptr merge_iors(const TAO_IOP::TAO_IOR_Manipulation::IORList&
+ ACE_ENV_ARG_DECL);
+
+ /// Create a new IOGR (with FT_PRIMARY and FT_GROUP components) by merging
+ /// the profiles lists in the supplied list of one or more object references.
+ CORBA::Object_ptr make_iogr(const TAO_IOP::TAO_IOR_Manipulation::IORList&,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL);
+
+ /// Make an new IOGR with obj as primary.
+ CORBA::Object_ptr forge_iogr(CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL);
+
+ CORBA::Object_ptr ior_replace_key(CORBA::Object_ptr obj,
+ const TAO::ObjectKey& key
+ ACE_ENV_ARG_DECL);
+
+ bool copy_ft_group_component(CORBA::Object_ptr obj);
+
+ void set_ft_domain_id(const char*);
+ void set_group_id(CORBA::ULongLong);
+ void set_ref_version(CORBA::ULong);
+ CORBA::ULong increment_ref_version();
+ CORBA::ULong get_ref_version() const;
+
+private:
+ void set_tag_components(CORBA::Object_ptr merged,
+ CORBA::Object_ptr primary,
+ FT::TagFTGroupTaggedComponent& ft_tag_component
+ ACE_ENV_ARG_DECL);
+ TAO_IOP::TAO_IOR_Manipulation_var iorm_;
+ FT::TagFTGroupTaggedComponent ft_tag_component_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Identification_Service.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Identification_Service.cpp
new file mode 100644
index 00000000000..7b356e36f4d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Identification_Service.cpp
@@ -0,0 +1,100 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/Identification_Service.h"
+#include "../Utils/UUID.h"
+
+ACE_RCSID (EventChannel,
+ Identification_Service,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace FTRTEC {
+
+ namespace {
+ Identification_Service* service;
+ const char oid[] = "\xF8\xB3\xB1\xFE\xAC\xC6\x07\x11\x02\x0C\x02\x50\xEB\x05\x77\xD0";
+ }
+
+ Identification_Service::Identification_Service()
+ {
+ }
+
+ Identification_Service::~Identification_Service()
+ {
+ }
+
+
+ Identification_Service* Identification_Service::instance()
+ {
+ return service;
+ }
+
+ int Identification_Service::init(int argc, ACE_TCHAR* argv[])
+ {
+ if (service != 0)
+ return 0;
+ name_.length(1);
+ name_[0].id = CORBA::string_dup("FT_EventService");
+
+ while (argc > 1) {
+ if ( ACE_OS::strcasecmp (argv[0], ACE_TEXT("-Object_ID")) == 0) {
+ --argc; ++argv;
+ if (argv[0][0] == '-') continue;
+ else if (argv[0][0] != '$') {
+ UUID uuid(argv[0]);
+ if (!uuid.is_valid())
+ ACE_ERROR_RETURN((LM_ERROR, "Invalid Object_ID\n"), -1);
+ object_id_.length(16);
+ uuid.to_binary(&object_id_[0]);
+ }
+ --argc; ++argv;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], ACE_TEXT("-Name")) ==0) {
+ --argc; ++argv;
+ if (argv[0][0] == '-') continue;
+ else if (argv[0][0] != '$') {
+ name_[0].id = CORBA::string_dup(argv[0]);
+ }
+ --argc; ++argv;
+ }
+ }
+
+ if (object_id_.length() == 0) {
+ // assign an default value for object id
+ object_id_.length(16);
+ memcpy(&object_id_[0], oid, 16);
+ }
+ service = this;
+ return 0;
+ }
+
+
+ const FtRtecEventComm::ObjectId& Identification_Service::object_id() const
+ {
+ return object_id_;
+ }
+
+
+ const CosNaming::Name& Identification_Service::name() const
+ {
+ return name_;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_NAMESPACE_DEFINE (
+ TAO_FTRTEC,
+ Identification_Service,
+ FTRTEC::Identification_Service)
+
+ACE_STATIC_SVC_DEFINE (
+ Identification_Service,
+ ACE_TEXT ("FTRTEC_Identification"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (Identification_Service),
+ ACE_Service_Type::DELETE_THIS
+ | ACE_Service_Type::DELETE_OBJ,
+ 0)
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Identification_Service.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Identification_Service.h
new file mode 100644
index 00000000000..a932c92b789
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Identification_Service.h
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Identification_Service.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef IDENTIFICATION_SERVICE_H
+#define IDENTIFICATION_SERVICE_H
+
+#include "ace/Service_Object.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/FTRTC.h"
+#include "orbsvcs/FtRtecEventCommC.h"
+#include "orbsvcs/FtRtEvent/EventChannel/ftrtec_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace FTRTEC
+{
+ class Identification_Service : public ACE_Service_Object
+ {
+ public:
+ Identification_Service();
+ ~Identification_Service();
+
+ /**
+ * This function returns 0 when init is not called yet.
+ */
+ static Identification_Service* instance();
+
+ int init(int argc, ACE_TCHAR* argv[]);
+
+ const FtRtecEventComm::ObjectId& object_id() const;
+ const CosNaming::Name& name() const;
+ private:
+ FtRtecEventComm::ObjectId object_id_;
+ CosNaming::Name name_;
+ };
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE_EXPORT (TAO_FTRTEC, Identification_Service)
+ACE_STATIC_SVC_REQUIRE(Identification_Service)
+ACE_FACTORY_DECLARE (TAO_FTRTEC, Identification_Service)
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ObjectGroupManagerHandler.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ObjectGroupManagerHandler.cpp
new file mode 100644
index 00000000000..fbb8c4166a4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ObjectGroupManagerHandler.cpp
@@ -0,0 +1,71 @@
+// $Id$
+#include "orbsvcs/FtRtEvent/EventChannel/ObjectGroupManagerHandler.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ObjectGroupManagerHandler::ObjectGroupManagerHandler(
+ ACE_Auto_Event& evt, int num_backups)
+: evt_(evt), num_backups_(num_backups)
+{
+}
+
+void
+ObjectGroupManagerHandler::start (CORBA::Boolean ami_return_val,
+ const FTRT::Location & the_location
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG(ami_return_val);
+ ACE_UNUSED_ARG(the_location);
+}
+
+void
+ObjectGroupManagerHandler::start_excep (::Messaging::ExceptionHolder *
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void ObjectGroupManagerHandler::create_group (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+
+void
+ObjectGroupManagerHandler::create_group_excep (::Messaging::ExceptionHolder *
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ObjectGroupManagerHandler::add_member (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (--num_backups_ ==0)
+ evt_.signal();
+}
+
+void
+ObjectGroupManagerHandler::add_member_excep (::Messaging::ExceptionHolder *
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->add_member(ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+ObjectGroupManagerHandler::set_state (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ObjectGroupManagerHandler::set_state_excep (::Messaging::ExceptionHolder *
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ObjectGroupManagerHandler.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ObjectGroupManagerHandler.h
new file mode 100644
index 00000000000..8a3938a6c65
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ObjectGroupManagerHandler.h
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file ObjectGroupManagerHandler.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef OBJECTGROUPMANAGERHANDLER_H
+#define OBJECTGROUPMANAGERHANDLER_H
+
+#include "orbsvcs/FTRT_GroupManagerS.h"
+#include "ace/Auto_Event.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class ObjectGroupManagerHandler
+ : public POA_FTRT::AMI_ObjectGroupManagerHandler
+{
+public:
+ ObjectGroupManagerHandler(ACE_Auto_Event& evt, int num_backups);
+ virtual void start (CORBA::Boolean ami_return_val,
+ const FTRT::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void start_excep (::Messaging::ExceptionHolder * excep_holder
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void create_group (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void create_group_excep (::Messaging::ExceptionHolder * excep_holder
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void add_member (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void add_member_excep (::Messaging::ExceptionHolder * excep_holder
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void set_state (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void set_state_excep (::Messaging::ExceptionHolder * excep_holder
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+private:
+ ACE_Auto_Event& evt_;
+ ACE_Atomic_Op< ACE_SYNCH_MUTEX, int > num_backups_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxyConsumerStateWorker.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxyConsumerStateWorker.cpp
new file mode 100644
index 00000000000..8708b6a33d7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxyConsumerStateWorker.cpp
@@ -0,0 +1,36 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/ProxyConsumerStateWorker.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+
+ACE_RCSID (EventChannel,
+ ProxyConsumerStateWorker,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ProxyConsumerStateWorker::ProxyConsumerStateWorker (
+ FtRtecEventChannelAdmin::ProxyConsumerStates& states)
+ : consumerStates_(states)
+{
+}
+
+ProxyConsumerStateWorker::~ProxyConsumerStateWorker()
+{
+}
+
+void ProxyConsumerStateWorker::set_size(size_t size)
+{
+ consumerStates_.length(size);
+ index_ = 0;
+}
+
+void ProxyConsumerStateWorker::work(TAO_EC_ProxyPushConsumer* object
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ TAO_FTEC_ProxyPushConsumer* proxy =
+ static_cast<TAO_FTEC_ProxyPushConsumer*> (object);
+ proxy->get_state(consumerStates_[index_++]);
+
+TAO_END_VERSIONED_NAMESPACE_DECL}
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxyConsumerStateWorker.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxyConsumerStateWorker.h
new file mode 100644
index 00000000000..1610cd90ef1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxyConsumerStateWorker.h
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file ProxyConsumerStateWorker.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef PROXYCONSUMERSTATEWORKER_H
+#define PROXYCONSUMERSTATEWORKER_H
+
+#include "orbsvcs/Event/EC_SupplierAdmin.h"
+#include "orbsvcs/ESF/ESF_Worker.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class ProxyConsumerStateWorker
+ : public TAO_ESF_Worker<TAO_EC_ProxyPushConsumer>
+{
+public:
+ ProxyConsumerStateWorker(FtRtecEventChannelAdmin::ProxyConsumerStates& states);
+ ~ProxyConsumerStateWorker();
+
+ virtual void set_size(size_t size);
+ virtual void work(TAO_EC_ProxyPushConsumer* object
+ ACE_ENV_ARG_DECL);
+private:
+ int index_;
+ FtRtecEventChannelAdmin::ProxyConsumerStates& consumerStates_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxySupplierStateWorker.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxySupplierStateWorker.cpp
new file mode 100644
index 00000000000..5618c2d373f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxySupplierStateWorker.cpp
@@ -0,0 +1,38 @@
+// $Id$
+
+#include "orbsvcs/FtRtecEventChannelAdminC.h"
+#include "orbsvcs/FtRtEvent/EventChannel/ProxySupplierStateWorker.h"
+#include "orbsvcs/Event/EC_Event_Channel_Base.h"
+#include "orbsvcs/Event/EC_ProxyConsumer.h"
+
+ACE_RCSID (EventChannel,
+ ProxySupplierStateWorker,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ProxySupplierStateWorker::ProxySupplierStateWorker (
+ FtRtecEventChannelAdmin::ProxySupplierStates& states)
+ : supplierStates_(states)
+{
+}
+
+ProxySupplierStateWorker::~ProxySupplierStateWorker()
+{
+}
+
+void ProxySupplierStateWorker::set_size(size_t size)
+{
+ supplierStates_.length(size);
+ index_ = 0;
+}
+
+void ProxySupplierStateWorker::work(TAO_EC_ProxyPushSupplier* object
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ TAO_FTEC_ProxyPushSupplier* proxy =
+ static_cast<TAO_FTEC_ProxyPushSupplier*> (object);
+ proxy->get_state(supplierStates_[index_++]);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxySupplierStateWorker.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxySupplierStateWorker.h
new file mode 100644
index 00000000000..cf9516d100d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ProxySupplierStateWorker.h
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file ProxySupplierStateWorker.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef PROXYSUPPLIERSTATEWORKER_H
+#define PROXYSUPPLIERSTATEWORKER_H
+
+#include "orbsvcs/Event/EC_ConsumerAdmin.h"
+#include "orbsvcs/ESF/ESF_Worker.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ProxySupplier.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class ProxySupplierStateWorker
+ : public TAO_ESF_Worker<TAO_EC_ProxyPushSupplier>
+{
+public:
+ ProxySupplierStateWorker(FtRtecEventChannelAdmin::ProxySupplierStates& states);
+ ~ProxySupplierStateWorker();
+
+ virtual void set_size(size_t size);
+ virtual void work(TAO_EC_ProxyPushSupplier* object
+ ACE_ENV_ARG_DECL);
+private:
+ int index_;
+ FtRtecEventChannelAdmin::ProxySupplierStates& supplierStates_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Service.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Service.cpp
new file mode 100644
index 00000000000..753cd359248
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Service.cpp
@@ -0,0 +1,210 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/Replication_Service.h"
+#include "orbsvcs/FtRtEvent/EventChannel/AMI_Replication_Strategy.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Basic_Replication_Strategy.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_ORBInitializer.h"
+#include "../Utils/Log.h"
+
+#include "tao/ORBInitializer_Registry.h"
+#include "tao/CDR.h"
+
+#include "ace/Auto_Ptr.h"
+#include "ace/OS_NS_strings.h"
+
+
+ACE_RCSID (EventChannel,
+ Replication_Service,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace FTRTEC
+{
+ namespace {
+ auto_ptr<Replication_Strategy> replication_strategy;
+ int threads = 1;
+ Replication_Service* service;
+ }
+
+ Replication_Service* Replication_Service::instance()
+ {
+ return service;
+ }
+
+ Replication_Service::Replication_Service()
+ {
+ service = this;
+ }
+
+ Replication_Service::~Replication_Service()
+ {
+ }
+
+ int Replication_Service::init (int argc, ACE_TCHAR* argv[])
+ {
+ static int initialized = 0;
+
+ // Only allow initialization once.
+ if (initialized)
+ return 0;
+
+ initialized = 1;
+ bool ami = false;
+
+ // Parse any service configurator parameters.
+ while (argc > 0) {
+ if (ACE_OS::strcasecmp (argv[0], ACE_TEXT("AMI")) ==0 )
+ ami = true;
+ if (ACE_OS::strcasecmp (argv[0], ACE_TEXT("-threads")) ==0 && argc > 1) {
+ FTRTEC::threads = ACE_OS::atoi(argv[1]);
+ if (FTRTEC::threads ==0 )
+ FTRTEC::threads = 1;
+ ++argv; --argc;
+ }
+ ++argv; --argc;
+ }
+
+ Replication_Strategy* strategy;
+ if (ami) {
+ ACE_NEW_RETURN (strategy, AMI_Replication_Strategy(threads() > 1), -1);
+ TAO_FTRTEC::Log(3, "AMI replication strategy\n");
+ }
+ else {
+ ACE_NEW_RETURN (strategy, Basic_Replication_Strategy(threads() > 1), -1);
+ TAO_FTRTEC::Log(3, "Basic replication strategy\n");
+ }
+
+ ACE_AUTO_PTR_RESET (replication_strategy, strategy, Replication_Strategy);
+
+ ACE_TRY_NEW_ENV
+ {
+ PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
+ PortableInterceptor::ORBInitializer::_nil ();
+ PortableInterceptor::ORBInitializer_var orb_initializer;
+
+ /// Register the RTCORBA ORBInitializer.
+ ACE_NEW_THROW_EX (temp_orb_initializer,
+ FTEC_ORBInitializer,
+ CORBA::NO_MEMORY ());
+ ACE_TRY_CHECK;
+ orb_initializer = temp_orb_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Unexpected exception caught while "
+ "initializing the TransactionDepth");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+ }
+
+
+ void Replication_Service::become_primary()
+ {
+ TAO_FTRTEC::Log(3, "become_primary\n");
+
+ Replication_Strategy* strategy =
+ replication_strategy->make_primary_strategy();
+
+ ACE_ASSERT(strategy);
+
+ if (replication_strategy.get() != strategy) {
+ ACE_AUTO_PTR_RESET(replication_strategy, strategy, Replication_Strategy);
+ }
+ }
+
+ void Replication_Service::check_validity(ACE_ENV_SINGLE_ARG_DECL)
+ {
+ replication_strategy->check_validity(ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
+
+ void Replication_Service::replicate_request(const FtRtecEventChannelAdmin::Operation& update,
+ RollbackOperation rollback
+ ACE_ENV_ARG_DECL)
+ {
+ TAO_OutputCDR cdr;
+ cdr << update;
+
+ ACE_Message_Block mb;
+ ACE_CDR::consolidate(&mb, cdr.begin());
+#if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
+ FTRT::State state(mb.length(), &mb);
+#else
+ // If the form of the constructor is not available, we will need
+ // to do the copy manually. First, set the octet sequence length.
+ FTRT::State state;
+ CORBA::ULong length = mb.length ();
+ state.length (length);
+
+ // Now copy over each byte.
+ char* base = mb.data_block ()->base ();
+ for(CORBA::ULong i = 0; i < length; i++)
+ {
+ state[i] = base[i];
+ }
+#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
+
+
+ replication_strategy->replicate_request(
+ state,
+ rollback,
+ update.object_id
+ ACE_ENV_ARG_PARAMETER);
+ }
+
+ void Replication_Service::add_member(const FTRT::ManagerInfo & info,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL)
+ {
+ replication_strategy->add_member(info, object_group_ref_version ACE_ENV_ARG_PARAMETER);
+ }
+
+ int Replication_Service::acquire_read (void)
+ {
+ int r = replication_strategy->acquire_read();
+ TAO_FTRTEC::Log(3, "Read Lock acquired %d\n", r);
+ return r;
+ }
+
+ int Replication_Service::acquire_write (void)
+ {
+ int r= replication_strategy->acquire_write();
+ TAO_FTRTEC::Log(3, "Write Lock acqured %d\n", r);
+ return r;
+ }
+
+ int Replication_Service::release (void)
+ {
+ int r= replication_strategy->release();
+ TAO_FTRTEC::Log(3, "Lock Released %d\n", r);
+ return r;
+ }
+
+ int Replication_Service::threads() const {
+ return FTRTEC::threads;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_NAMESPACE_DEFINE (
+ TAO_FTRTEC,
+ Replication_Service,
+ FTRTEC::Replication_Service)
+
+ACE_STATIC_SVC_DEFINE (
+ Replication_Service,
+ ACE_TEXT ("FTRTEC_Replication"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (Replication_Service),
+ ACE_Service_Type::DELETE_THIS
+ | ACE_Service_Type::DELETE_OBJ,
+ 0)
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Service.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Service.h
new file mode 100644
index 00000000000..e1deca2f103
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Service.h
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Replication_Service.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef REPLCATION_SERVICE_H
+#define REPLCATION_SERVICE_H
+
+#include "orbsvcs/FtRtecEventChannelAdminC.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.h"
+#include "tao/PortableInterceptorC.h"
+#include "ace/Service_Object.h"
+#include "orbsvcs/FtRtEvent/EventChannel/ftrtec_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace FTRTEC
+{
+ class TAO_FTRTEC_Export Replication_Service
+ : public TAO_FTEC_Become_Primary_Listener
+ , public ACE_Service_Object
+ {
+ public:
+ static Replication_Service* instance();
+
+ Replication_Service();
+ ~Replication_Service();
+
+ virtual int init (int argc,
+ ACE_TCHAR* []);
+
+ virtual void become_primary();
+
+ /**
+ * Used for checking if the incoming replication message is out of sequence.
+ */
+ void check_validity(ACE_ENV_SINGLE_ARG_DECL);
+
+ typedef void (FtRtecEventChannelAdmin::EventChannelFacade::*RollbackOperation)
+ (const FtRtecEventChannelAdmin::ObjectId& ACE_ENV_ARG_DECL);
+
+ /**
+ * Replicate a request.
+ *
+ * @param state The request to be replicated.
+ * @param rollback The rollback operation when the replication failed.
+ */
+ void replicate_request(const FtRtecEventChannelAdmin::Operation& update,
+ RollbackOperation rollback
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Inform the backup replicas that a new replica has joined the object
+ * group.
+ */
+ void add_member(const FTRT::ManagerInfo & info,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL);
+
+ int acquire_read (void);
+ int acquire_write (void);
+ int release (void);
+
+ int threads() const;
+ };
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE_EXPORT (TAO_FTRTEC, Replication_Service)
+ACE_STATIC_SVC_REQUIRE(Replication_Service)
+ACE_FACTORY_DECLARE (TAO_FTRTEC, Replication_Service)
+
+#endif //REPLCATION_SERVICE_H
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Strategy.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Strategy.cpp
new file mode 100644
index 00000000000..f7cc5f524f7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Strategy.cpp
@@ -0,0 +1,35 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/Replication_Strategy.h"
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel.h"
+
+ACE_RCSID (EventChannel,
+ Replication_Strategy,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+Replication_Strategy::Replication_Strategy()
+{
+}
+
+
+Replication_Strategy::~Replication_Strategy()
+{
+}
+
+
+void
+Replication_Strategy::check_validity(ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+}
+
+
+Replication_Strategy*
+Replication_Strategy::make_primary_strategy()
+{
+ return this;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Strategy.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Strategy.h
new file mode 100644
index 00000000000..8c661ee0ee8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Strategy.h
@@ -0,0 +1,76 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Replication_Strategy.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef REPLICATION_STRATEGY_H
+#define REPLICATION_STRATEGY_H
+#include "orbsvcs/FtRtecEventChannelAdminC.h"
+#include "tao/PortableInterceptorC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace FTEC {
+ struct ManagerInfo;
+}
+
+class TAO_FTEC_Event_Channel_Impl;
+class Replication_Strategy
+{
+public:
+ Replication_Strategy();
+ virtual ~Replication_Strategy();
+
+ /**
+ * Check if the incoming set_update() request is out of sequence. This is only
+ * used for basic replication strategy. It throws FTRT::OutOfSequence when the
+ * incoming request is not valid.
+ */
+ virtual void check_validity(ACE_ENV_SINGLE_ARG_DECL);
+
+ typedef void (FtRtecEventChannelAdmin::EventChannelFacade::*RollbackOperation)
+ (const FtRtecEventChannelAdmin::ObjectId& ACE_ENV_ARG_DECL);
+
+ /**
+ * Replicate a request.
+ *
+ * @param state The request to be replicated.
+ * @param rollback The rollback operation when the replication failed.
+ * @param oid The object id used for rollback operation.
+ */
+ virtual void replicate_request(const FTRT::State& state,
+ RollbackOperation rollback,
+ const FtRtecEventChannelAdmin::ObjectId& oid
+ ACE_ENV_ARG_DECL)=0;
+
+ /**
+ * Inform the backup replicas that a new replica has joined the object
+ * group.
+ */
+ virtual void add_member(const FTRT::ManagerInfo & info,
+ CORBA::ULong object_group_ref_version
+ ACE_ENV_ARG_DECL)=0;
+
+ virtual Replication_Strategy* make_primary_strategy();
+
+ virtual int acquire_read (void)=0;
+ virtual int acquire_write (void)=0;
+ virtual int release (void)=0;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
+
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.cpp
new file mode 100644
index 00000000000..f04af729152
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.cpp
@@ -0,0 +1,316 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h"
+#include "../Utils/resolve_init.h"
+#include "../Utils/UUID.h"
+
+#include "tao/AnyTypeCode/TypeCode.h"
+#include "tao/PI/PI.h"
+#include "tao/PI_Server/PI_Server.h"
+#include "tao/IOP_IORC.h"
+#include "ace/TSS_T.h"
+
+ACE_RCSID (EventChannel,
+ Request_Context_Repository,
+ "$Id$")
+
+namespace {
+PortableInterceptor::SlotId object_id_slot;
+PortableInterceptor::SlotId cached_result_slot;
+PortableInterceptor::SlotId seq_num_slot;
+PortableInterceptor::SlotId ft_request_service_context_slot;
+PortableInterceptor::SlotId transaction_depth_slot;
+CORBA::ORB_ptr orb;
+ACE_TSS<FtRtecEventChannelAdmin::ObjectId> oid;
+}
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void
+Request_Context_Repository::allocate_slots(PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+{
+ object_id_slot = info->allocate_slot_id(ACE_ENV_SINGLE_ARG_PARAMETER);
+ cached_result_slot = info->allocate_slot_id(ACE_ENV_SINGLE_ARG_PARAMETER);
+ seq_num_slot = info->allocate_slot_id(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ft_request_service_context_slot = info->allocate_slot_id(ACE_ENV_SINGLE_ARG_PARAMETER);
+ transaction_depth_slot = info->allocate_slot_id(ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+Request_Context_Repository::init(CORBA::ORB_ptr the_orb)
+{
+ orb = the_orb;
+}
+
+void Request_Context_Repository::generate_object_id(
+ FtRtecEventChannelAdmin::ObjectId& oid
+ ACE_ENV_ARG_DECL)
+{
+ oid.length(sizeof(UUID));
+ UUID::create(oid.get_buffer());
+ set_object_id(oid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Request_Context_Repository::set_object_id(
+ const FtRtecEventChannelAdmin::ObjectId& object_id
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ /*
+ PortableInterceptor::Current_var pic =
+ resolve_init<PortableInterceptor::Current>(orb, "PICurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Any a;
+ a <<= object_id;
+ pic->set_slot(object_id_slot, a
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK;
+ */
+ *oid = object_id;
+}
+
+FtRtecEventChannelAdmin::ObjectId_var
+get_object_id(CORBA::Any_var a
+ ACE_ENV_ARG_DECL)
+{
+ FtRtecEventChannelAdmin::ObjectId *object_id, *r;
+ FtRtecEventChannelAdmin::ObjectId_var result;
+
+ if ((a.in() >>= object_id) ==0)
+ ACE_THROW_RETURN(CORBA::NO_MEMORY(), result);
+
+ ACE_NEW_THROW_EX(r,
+ FtRtecEventChannelAdmin::ObjectId(*object_id),
+ CORBA::NO_MEMORY());
+
+ result = r;
+ return result;
+}
+
+
+FtRtecEventChannelAdmin::ObjectId_var
+Request_Context_Repository::get_object_id(ACE_ENV_SINGLE_ARG_DECL)
+{
+ /*
+ PortableInterceptor::Current_var pic =
+ resolve_init<PortableInterceptor::Current>(orb, "PICurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(FtRtecEventChannelAdmin::ObjectId_var());
+
+ CORBA::Any_var a = pic->get_slot(object_id_slot
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(FtRtecEventChannelAdmin::ObjectId_var());
+
+ return ::get_object_id(a
+ ACE_ENV_ARG_PARAMETER);
+ */
+ FtRtecEventChannelAdmin::ObjectId *object_id;
+ ACE_NEW_THROW_EX(object_id,
+ FtRtecEventChannelAdmin::ObjectId(*oid),
+ CORBA::NO_MEMORY());
+ return FtRtecEventChannelAdmin::ObjectId_var(*object_id);
+}
+
+FtRtecEventChannelAdmin::ObjectId_var
+Request_Context_Repository::get_object_id(
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Any_var a = ri->get_slot(object_id_slot
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(FtRtecEventChannelAdmin::ObjectId_var());
+
+ return ::get_object_id(a
+ ACE_ENV_ARG_PARAMETER);
+
+}
+
+void
+Request_Context_Repository::set_cached_result(
+ PortableInterceptor::ServerRequestInfo_ptr ri,
+ const CORBA::Any& result
+ ACE_ENV_ARG_DECL)
+{
+ ri->set_slot(cached_result_slot,
+ result ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Any_ptr
+Request_Context_Repository::get_cached_result(ACE_ENV_SINGLE_ARG_DECL)
+{
+ PortableInterceptor::Current_var pic =
+ resolve_init<PortableInterceptor::Current>(orb, "PICurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ CORBA::Any_var a = pic->get_slot(cached_result_slot
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ return a._retn();
+}
+
+bool Request_Context_Repository::is_executed_request()
+{
+ ACE_TRY_NEW_ENV {
+ CORBA::Any_var any = get_cached_result(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::TypeCode_var type = any->type();
+ CORBA::TCKind const kind = type->kind(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ return kind != CORBA::tk_null;
+ }
+ ACE_CATCHALL {
+ }
+ ACE_ENDTRY;
+ return false;
+}
+
+void
+Request_Context_Repository::set_sequence_number(
+ PortableInterceptor::ServerRequestInfo_ptr ri,
+ FTRT::SequenceNumber seq_num
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Any a;
+
+ a <<= seq_num;
+
+ ri->set_slot(seq_num_slot, a ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Request_Context_Repository::set_sequence_number(
+ FTRT::SequenceNumber seq_num
+ ACE_ENV_ARG_DECL)
+{
+ PortableInterceptor::Current_var pic =
+ resolve_init<PortableInterceptor::Current>(orb, "PICurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Any a;
+
+ a <<= seq_num;
+
+ pic->set_slot(seq_num_slot, a ACE_ENV_ARG_PARAMETER);
+}
+
+
+FTRT::SequenceNumber
+Request_Context_Repository::get_sequence_number(ACE_ENV_SINGLE_ARG_DECL)
+{
+ PortableInterceptor::Current_var pic =
+ resolve_init<PortableInterceptor::Current>(orb, "PICurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ CORBA::Any_var a = pic->get_slot(seq_num_slot ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ FTRT::SequenceNumber result = 0;
+ a >>= result;
+ return result;
+}
+
+FTRT::SequenceNumber
+Request_Context_Repository::get_sequence_number(
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Any_var a = ri->get_slot(seq_num_slot ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ FTRT::SequenceNumber result = 0;
+ a >>= result;
+ return result;
+}
+
+void
+Request_Context_Repository::set_ft_request_service_context(
+ PortableInterceptor::ServerRequestInfo_ptr ri,
+ IOP::ServiceContext_var service_context
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Any a;
+ a <<= service_context.in();
+ ri->set_slot(ft_request_service_context_slot,a
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Any_var
+Request_Context_Repository::get_ft_request_service_context(
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+{
+ return ri->get_slot(ft_request_service_context_slot
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Request_Context_Repository::set_transaction_depth(
+ PortableInterceptor::ServerRequestInfo_ptr ri,
+ FTRT::TransactionDepth depth
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Any a;
+ a <<= depth;
+ ri->set_slot(transaction_depth_slot,a
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Request_Context_Repository::set_transaction_depth(
+ FTRT::TransactionDepth depth
+ ACE_ENV_ARG_DECL)
+{
+ PortableInterceptor::Current_var pic =
+ resolve_init<PortableInterceptor::Current>(orb, "PICurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Any a;
+ a <<= depth;
+ pic->set_slot(transaction_depth_slot,a
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+FTRT::TransactionDepth
+Request_Context_Repository::get_transaction_depth(
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Any_var a = ri->get_slot(transaction_depth_slot
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ FTRT::TransactionDepth result=0;
+ a >>= result;
+ return result;
+
+}
+
+FTRT::TransactionDepth
+Request_Context_Repository::get_transaction_depth(
+ ACE_ENV_SINGLE_ARG_DECL)
+{
+ PortableInterceptor::Current_var pic =
+ resolve_init<PortableInterceptor::Current>(orb, "PICurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ CORBA::Any_var a = pic->get_slot(transaction_depth_slot
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ FTRT::TransactionDepth result=0;
+ a >>= result;
+ return result;
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h
new file mode 100644
index 00000000000..542f58937ea
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h
@@ -0,0 +1,116 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Request_Context_Repository.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef REQUEST_CONTEXT_REPOSITORY_H
+#define REQUEST_CONTEXT_REPOSITORY_H
+
+#include "orbsvcs/FtRtecEventChannelAdminC.h"
+#include "tao/PortableInterceptorC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FTEC_Event_Channel_Impl;
+
+namespace PortableInterceptor
+{
+ class ORBInitInfo;
+ typedef ORBInitInfo *ORBInitInfo_ptr;
+
+ class ServerRequestInfo;
+ typedef ServerRequestInfo *ServerRequestInfo_ptr;
+
+ class ClientRequestInfo;
+ typedef ClientRequestInfo *ClientRequestInfo_ptr;
+}
+
+/**
+ * @class Request_Context_Repository
+ *
+ * @brief This class is used to transfer the information between thread context
+ * information and the request context in the portable interceptors. It
+ * encapulates the PICurrent to provide a type safe way for the transfer of
+ * FTEC specific information inside and outside protable interceptors.
+ */
+class Request_Context_Repository
+{
+public:
+
+ void init(CORBA::ORB_ptr orb);
+
+ /**
+ * Used by ORBInitializer to allocate required slots for
+ * FTEC.
+ */
+ void allocate_slots(PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL);
+
+
+ void generate_object_id(FtRtecEventChannelAdmin::ObjectId& object_id
+ ACE_ENV_ARG_DECL);
+ void set_object_id(const FtRtecEventChannelAdmin::ObjectId& object_id
+ ACE_ENV_ARG_DECL);
+ FtRtecEventChannelAdmin::ObjectId_var get_object_id(ACE_ENV_SINGLE_ARG_DECL);
+ FtRtecEventChannelAdmin::ObjectId_var
+ get_object_id(PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL);
+
+ void set_cached_result(PortableInterceptor::ServerRequestInfo_ptr ri,
+ const CORBA::Any& result
+ ACE_ENV_ARG_DECL);
+
+ CORBA::Any_ptr get_cached_result(ACE_ENV_SINGLE_ARG_DECL);
+ bool is_executed_request();
+
+ void set_sequence_number(PortableInterceptor::ServerRequestInfo_ptr ri,
+ FTRT::SequenceNumber
+ ACE_ENV_ARG_DECL);
+
+ void set_sequence_number(FTRT::SequenceNumber
+ ACE_ENV_ARG_DECL);
+ FTRT::SequenceNumber get_sequence_number(PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL);
+
+ FTRT::SequenceNumber get_sequence_number(ACE_ENV_SINGLE_ARG_DECL);
+
+ void set_ft_request_service_context(
+ PortableInterceptor::ServerRequestInfo_ptr ri,
+ IOP::ServiceContext_var service_context
+ ACE_ENV_ARG_DECL);
+
+ CORBA::Any_var get_ft_request_service_context(
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL);
+
+ void set_transaction_depth(
+ PortableInterceptor::ServerRequestInfo_ptr ri,
+ FTRT::TransactionDepth depth
+ ACE_ENV_ARG_DECL);
+
+ void set_transaction_depth(
+ FTRT::TransactionDepth depth
+ ACE_ENV_ARG_DECL);
+
+ FTRT::TransactionDepth get_transaction_depth(
+ ACE_ENV_SINGLE_ARG_DECL);
+
+ FTRT::TransactionDepth get_transaction_depth(
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /// REQUEST_CONTEXT_REPOSITORY_H
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/SCTP_Fault_Detector.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/SCTP_Fault_Detector.cpp
new file mode 100644
index 00000000000..222d5daa3fb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/SCTP_Fault_Detector.cpp
@@ -0,0 +1,96 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/SCTP_Fault_Detector.h"
+
+#if (TAO_HAS_SCIOP == 1)
+
+#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Fault_Listener.h"
+
+#include "ace/OS_NS_strings.h"
+#include "ace/OS_NS_sys_socket.h"
+
+ACE_RCSID (EventChannel,
+ SCTP_Fault_Detector,
+ "$Id$")
+
+#ifndef SCTP_HEARTBEAT_ITVL
+#define SCTP_HEARTBEAT_ITVL 19
+#endif
+#ifndef SOL_SCTP
+#define SOL_SCTP 132
+#endif
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+SCTP_Connector::SCTP_Connector()
+: heart_beat_(0)
+{
+}
+
+int
+SCTP_Connector::connect (ACE_SOCK_SEQPACK_Association &new_association,
+ const ACE_Addr &remote_sap,
+ const ACE_Time_Value *timeout,
+ const ACE_Addr &local_sap,
+ int reuse_addr,
+ int /* flags */,
+ int /* perms */,
+ int protocol)
+{
+ ACE_TRACE ("SCTP_Connector::connect");
+
+ if (this->shared_open (new_association,
+ remote_sap.get_type (),
+ protocol,
+ reuse_addr) == -1)
+ return -1;
+ else if (this->shared_connect_start (new_association,
+ timeout,
+ local_sap) == -1)
+ return -1;
+
+ if (new_association.set_option(SOL_SCTP,
+ SCTP_HEARTBEAT_ITVL,
+ &heart_beat_,
+ sizeof(heart_beat_)) == -1)
+ return -1;
+
+ int result = ACE_OS::connect (new_association.get_handle (),
+ reinterpret_cast<sockaddr *> (remote_sap.get_addr ()),
+ remote_sap.get_size ());
+
+ return this->shared_connect_finish (new_association,
+ timeout,
+ result);
+}
+
+
+inline void SCTP_Connector::set_heart_beat(int hb)
+{
+ heart_beat_ = hb;
+}
+
+
+SCTP_Fault_Detector::~SCTP_Fault_Detector()
+{
+}
+
+
+int SCTP_Fault_Detector::parse_conf(int argc, char** argv)
+{
+ ACE_TRACE ("SCTP_Fault_Detector::parse_conf");
+
+ for (int curarg = 0; curarg < argc; curarg++)
+ if (ACE_OS::strcasecmp (argv[curarg],
+ ACE_TEXT("-HeartBeat")) == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ connector_.set_heart_beat(atoi(argv[curarg]));
+ }
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_SCTP == 1 */
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/SCTP_Fault_Detector.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/SCTP_Fault_Detector.h
new file mode 100644
index 00000000000..4e9978afa7f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/SCTP_Fault_Detector.h
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SCTP_Fault_Detector.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef SCTP_FAULT_DETECTOR_H
+#define SCTP_FAULT_DETECTOR_H
+
+#include "tao/orbconf.h"
+
+// make sure that the code compiles cleanly even if SCTP is not
+// available. If SCTP is not installed, program will exit early in
+// main() with an error message
+#if (TAO_HAS_SCIOP == 1)
+
+#include "ace/Acceptor.h"
+#include "ace/Connector.h"
+#include "ace/SOCK_SEQPACK_Association.h"
+#include "ace/SOCK_SEQPACK_Acceptor.h"
+#include "ace/SOCK_SEQPACK_Connector.h"
+#include "ace/Multihomed_INET_Addr.h"
+#include "orbsvcs/FtRtEvent/EventChannel/ConnectionHandler_T.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Fault_Detector_T.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+extern "C" {
+#include <netinet/sctp.h>
+};
+
+#ifndef IPPROTO_SCTP
+#define IPPROTO_SCTP 132
+#endif // !IPPROTO_SCTP
+#ifndef SCTP_NODELAY
+#define SCTP_NODELAY 1
+#endif // SCTP_NODELAY
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef ACE_Acceptor<ConnectionAcceptHandler<ACE_SOCK_SEQPACK_ASSOCIATION>, ACE_SOCK_SEQPACK_ACCEPTOR>
+ SCTP_ConnectionAcceptHandler;
+typedef ConnectionDetectHandler<ACE_SOCK_SEQPACK_ASSOCIATION> SCTP_ConnectionDetectHandler;
+
+class SCTP_Connector : public ACE_SOCK_SEQPACK_Connector
+{
+public:
+ SCTP_Connector();
+ int connect (ACE_SOCK_SEQPACK_Association &new_association,
+ const ACE_Addr &remote_sap,
+ const ACE_Time_Value *timeout = 0,
+ const ACE_Addr &local_sap = ACE_Addr::sap_any,
+ int reuse_addr = 0,
+ int flags = 0,
+ int perms = 0,
+ int protocol = 132);
+ void set_heart_beat(int hb);
+private:
+ int heart_beat_;
+};
+
+class SCTP_Fault_Detector : public Fault_Detector_T<
+ SCTP_ConnectionAcceptHandler,
+ SCTP_Connector,
+ SCTP_ConnectionDetectHandler >
+{
+public:
+ virtual ~SCTP_Fault_Detector();
+private:
+ virtual int parse_conf(int argc, char** argv);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_HAS_SCIOP */
+
+#endif /* SCTP_FAULT_DETECTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Set_Update_Interceptor.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Set_Update_Interceptor.cpp
new file mode 100644
index 00000000000..58e96befd06
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Set_Update_Interceptor.cpp
@@ -0,0 +1,168 @@
+// $Id$
+
+#include "tao/CDR.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Set_Update_Interceptor.h"
+#include "orbsvcs/FTRTC.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Request_Context_Repository.h"
+
+ACE_RCSID (EventChannel,
+ Set_Update_Intercetpor,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Set_Update_Interceptor::TAO_Set_Update_Interceptor ()
+: myname_ ("TAO_Set_Update_Interceptor")
+{
+}
+
+TAO_Set_Update_Interceptor::~TAO_Set_Update_Interceptor (void)
+{
+}
+
+char *
+TAO_Set_Update_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup (this->myname_);
+}
+
+void
+TAO_Set_Update_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_Set_Update_Interceptor::send_poll (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Do Nothing
+}
+
+void
+TAO_Set_Update_Interceptor::send_request (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (strcmp(operation.in(), "set_update")==0 ||
+ strcmp(operation.in(), "oneway_set_update") ==0) {
+ CORBA::Any_var a = Request_Context_Repository().get_ft_request_service_context(ri
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ IOP::ServiceContext* sc;
+
+ if ((a.in() >>= sc) ==0)
+ return;
+
+ ri->add_request_service_context (*sc, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ FTRT::TransactionDepth transaction_depth =
+ Request_Context_Repository().get_transaction_depth(ri ACE_ENV_ARG_PARAMETER);
+ TAO_OutputCDR cdr;
+ ACE_Message_Block mb;
+
+ if (transaction_depth) {
+ if (!(cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)))
+ ACE_THROW (CORBA::MARSHAL ());
+
+ // Add Transaction Depth Context
+ if ((cdr << transaction_depth) == 0)
+ ACE_THROW (CORBA::MARSHAL ());
+ sc->context_id = FTRT::FT_TRANSACTION_DEPTH;
+
+ ACE_CDR::consolidate(&mb, cdr.begin());
+#if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
+ sc->context_data.replace(mb.length(), &mb);
+#else
+ // If the replace method is not available, we will need
+ // to do the copy manually. First, set the octet sequence length.
+ CORBA::ULong length = mb.length ();
+ sc->context_data.length (length);
+
+ // Now copy over each byte.
+ char* base = mb.data_block ()->base ();
+ for(CORBA::ULong i = 0; i < length; i++)
+ {
+ sc->context_data[i] = base[i];
+ }
+#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
+
+ ri->add_request_service_context (*sc, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ cdr.reset();
+ }
+
+ // Add Sequence Number Context
+
+ FTRT::SequenceNumber sequence_number =
+ Request_Context_Repository().get_sequence_number(ri ACE_ENV_ARG_PARAMETER);
+
+ ACE_DEBUG((LM_DEBUG, "send_request : sequence_number = %d\n", sequence_number));
+ if (sequence_number != 0) {
+ if (!(cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)))
+ ACE_THROW (CORBA::MARSHAL ());
+ if ((cdr << sequence_number) == 0)
+ ACE_THROW (CORBA::MARSHAL ());
+ sc->context_id = FTRT::FT_SEQUENCE_NUMBER;
+
+ ACE_CDR::consolidate(&mb, cdr.begin());
+#if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
+ sc->context_data.replace(mb.length(), &mb);
+#else
+ // If the replace method is not available, we will need
+ // to do the copy manually. First, set the octet sequence length.
+ CORBA::ULong length = mb.length ();
+ sc->context_data.length (length);
+
+ // Now copy over each byte.
+ char* base = mb.data_block ()->base ();
+ for(CORBA::ULong i = 0; i < length; i++)
+ {
+ sc->context_data[i] = base[i];
+ }
+#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
+
+ ri->add_request_service_context (*sc, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+}
+
+void
+TAO_Set_Update_Interceptor::receive_reply (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_Set_Update_Interceptor::receive_other (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+TAO_Set_Update_Interceptor::receive_exception (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Set_Update_Interceptor.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Set_Update_Interceptor.h
new file mode 100644
index 00000000000..c164c238281
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Set_Update_Interceptor.h
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Set_Update_Interceptor.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_SET_UPDATE_INTERCEPTOR_H
+#define TAO_SET_UPDATE_INTERCEPTOR_H
+
+#include "tao/PI/PI.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+#include "ace/Atomic_Op.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+// This is to remove "inherits via dominance" warnings from MSVC.
+#if defined (_MSC_VER)
+# pragma warning (disable : 4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Set_Update_Interceptor
+ *
+ * @brief Interceptors for adding service context to set_update() and
+ * oneway_set_update() methods.
+ *
+ */
+class TAO_Set_Update_Interceptor
+ : public virtual PortableInterceptor::ClientRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+ TAO_Set_Update_Interceptor ();
+ // ctor.
+
+ virtual ~TAO_Set_Update_Interceptor ();
+ // dtor.
+
+ virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Canonical name of the interceptor.
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_poll (PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_request (PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_other (PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+private:
+ const char *myname_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif // TAO_SET_UPDATE_INTERCEPTOR_H
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.cpp
new file mode 100644
index 00000000000..c207baefd16
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.cpp
@@ -0,0 +1,61 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/Update_Manager.h"
+
+ACE_RCSID (EventChannel,
+ Update_Manager,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+Update_Manager::Update_Manager(ACE_Auto_Event& evt,
+ int num_backups,
+ int transaction_depth,
+ bool& success)
+ : evt_(evt)
+ , replied_(num_backups)
+ , suicide_condition_(num_backups)
+ , num_backups_(num_backups)
+ , transaction_level_(transaction_depth)
+ , success_(success)
+{
+ suicide_condition_.flip();
+ signal_condition_.resize(transaction_depth, true);
+ signal_condition_.resize(num_backups);
+}
+
+Update_Manager::~Update_Manager()
+{
+}
+
+void Update_Manager::handle_reply(int id)
+{
+ ACE_Guard<ACE_SYNCH_MUTEX> guard(mutex_);
+ replied_[id] = true;
+
+ if ((replied_ & signal_condition_) == signal_condition_) {
+ success_ = true;
+ evt_.signal();
+ }
+ if (replied_ == suicide_condition_)
+ delete this;
+}
+
+void Update_Manager::handle_exception(int id)
+{
+ ACE_Guard<ACE_SYNCH_MUTEX> guard(mutex_);
+ replied_[id] = true;
+ ++transaction_level_;
+
+ if (num_backups_ > transaction_level_) {
+ signal_condition_[transaction_level_]=true;
+ }
+ else {
+ success_ = false;
+ evt_.signal();
+ }
+ if (replied_ == suicide_condition_)
+ delete this;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.h
new file mode 100644
index 00000000000..caacd63fffe
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Update_Manager.h
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Update_Manager.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef UPDATE_MANAGER_H
+#define UPDATE_MANAGER_H
+
+#include "ace/Synch_T.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Dynamic_Bitset.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef Dynamic_Bitset bit_vector;
+
+class Update_Manager
+{
+public:
+ Update_Manager(ACE_Auto_Event& evt,
+ int num_backups,
+ int transaction_depth,
+ bool& success);
+ ~Update_Manager();
+
+ void handle_reply(int id);
+ void handle_exception(int id);
+
+private:
+ ACE_Auto_Event& evt_;
+ bit_vector replied_;
+ bit_vector signal_condition_;
+ bit_vector suicide_condition_;
+ int num_backups_;
+ int transaction_level_;
+ bool& success_;
+ ACE_SYNCH_MUTEX mutex_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/UpdateableHandler.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/UpdateableHandler.cpp
new file mode 100644
index 00000000000..fadeb16f0e0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/UpdateableHandler.cpp
@@ -0,0 +1,100 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/UpdateableHandler.h"
+#include "orbsvcs/FtRtEvent/EventChannel/Update_Manager.h"
+#include "orbsvcs/FtRtEvent/EventChannel/AMI_Primary_Replication_Strategy.h"
+#include "../Utils/resolve_init.h"
+
+ACE_RCSID (EventChannel,
+ UpdateableHandler,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+UpdateableHandler::UpdateableHandler(AMI_Primary_Replication_Strategy* strategy)
+ : strategy_(strategy)
+{
+}
+
+UpdateableHandler::~UpdateableHandler()
+{
+}
+
+FTRT::AMI_UpdateableHandler_ptr UpdateableHandler::activate(
+ Update_Manager* mgr, int id,
+ PortableServer::ObjectId& object_id
+ ACE_ENV_ARG_DECL)
+{
+ object_id.length(sizeof(mgr) + sizeof(id));
+ memcpy(object_id.get_buffer(), &mgr, sizeof(mgr));
+ memcpy(object_id.get_buffer() + sizeof(mgr), &id, sizeof(id));
+ strategy_->poa()->activate_object_with_id(object_id,
+ this
+ ACE_ENV_ARG_PARAMETER);
+ CORBA::Object_var object = strategy_->poa()->id_to_reference(
+ object_id
+ ACE_ENV_ARG_PARAMETER);
+
+ return FTRT::AMI_UpdateableHandler::_narrow(object.in() ACE_ENV_ARG_PARAMETER);
+}
+
+
+
+void UpdateableHandler::dispatch(UpdateableHandler::Handler handler ACE_ENV_ARG_DECL)
+{
+ PortableServer::Current_var current =
+ resolve_init<PortableServer::Current>(strategy_->orb(),
+ "POACurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::ObjectId_var object_id =
+ current->get_object_id(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ Update_Manager* mgr;
+ int id;
+
+ memcpy(&mgr, object_id->get_buffer(), sizeof(mgr));
+ memcpy(&id, object_id->get_buffer()+sizeof(mgr), sizeof(id));
+
+ ACE_DEBUG((LM_DEBUG, "%d\n", id));
+
+ (mgr->*handler)(id);
+
+ strategy_->poa()->deactivate_object(object_id.in());
+}
+
+void UpdateableHandler::set_update (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_DEBUG((LM_DEBUG,"Received reply from "));
+ dispatch(&Update_Manager::handle_reply ACE_ENV_ARG_PARAMETER);
+}
+void UpdateableHandler::set_update_excep (
+ ::Messaging::ExceptionHolder * excep_holder
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_DEBUG((LM_DEBUG, "Received Exception from"));
+ ACE_TRY {
+ excep_holder->raise_exception();
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION, "A corba exception\n");
+ }
+ ACE_ENDTRY;
+
+ dispatch(&Update_Manager::handle_exception ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/UpdateableHandler.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/UpdateableHandler.h
new file mode 100644
index 00000000000..48f621bc1ef
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/UpdateableHandler.h
@@ -0,0 +1,60 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file UpdateableHandler.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef UPDATEABLEHANDLER_H
+#define UPDATEABLEHANDLER_H
+#include "orbsvcs/FTRTS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class AMI_Primary_Replication_Strategy;
+class Update_Manager;
+
+class UpdateableHandler : public POA_FTRT::AMI_UpdateableHandler
+{
+public:
+ UpdateableHandler(AMI_Primary_Replication_Strategy* strategy);
+ ~UpdateableHandler();
+
+ FTRT::AMI_UpdateableHandler_ptr activate(
+ Update_Manager* mgr, int id,
+ PortableServer::ObjectId& oid
+ ACE_ENV_ARG_DECL);
+ typedef void (Update_Manager::*Handler)(int);
+
+ void dispatch(Handler handler ACE_ENV_ARG_DECL) ;
+
+ virtual void set_update (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+ virtual void set_update_excep (
+ ::Messaging::ExceptionHolder * excep_holder
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+private:
+ AMI_Primary_Replication_Strategy* strategy_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/create_persistent_poa.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/create_persistent_poa.cpp
new file mode 100644
index 00000000000..fe5cd5dbe41
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/create_persistent_poa.cpp
@@ -0,0 +1,49 @@
+// $Id$
+
+#include "orbsvcs/FtRtEvent/EventChannel/create_persistent_poa.h"
+
+ACE_RCSID (EventChannel,
+ create_persistent_poa,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+PortableServer::POA_var create_persistent_poa(PortableServer::POA_var root_poa,
+ PortableServer::POAManager_var mgr,
+ const char* name,
+ CORBA::PolicyList& policy_list
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::POA_var result;
+ PortableServer::LifespanPolicy_var lifespan =
+ root_poa->create_lifespan_policy(PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(result);
+
+ // create a USER_ID IdAssignmentPolicy object
+ PortableServer::IdAssignmentPolicy_var assign =
+ root_poa->create_id_assignment_policy(PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(result);
+
+ // create PolicyList.
+ size_t orig_len = policy_list.length();
+ policy_list.length(orig_len+2);
+ ACE_CHECK_RETURN(result);
+ policy_list[orig_len+0]=
+ PortableServer::LifespanPolicy::_duplicate(lifespan.in());
+ ACE_CHECK_RETURN(result);
+ policy_list[orig_len+1]=
+ PortableServer::IdAssignmentPolicy::_duplicate(assign.in());
+ ACE_CHECK_RETURN(result);
+
+ // create the child POA
+ result = root_poa->create_POA(name, mgr.in(), policy_list
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN(result);
+
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/create_persistent_poa.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/create_persistent_poa.h
new file mode 100644
index 00000000000..cd41683ea61
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/create_persistent_poa.h
@@ -0,0 +1,30 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file create_persistent_poa.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef CREATE_PERSISTENT_POA_H
+#define CREATE_PERSISTENT_POA_H
+#include "tao/PortableServer/PortableServer.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+PortableServer::POA_var create_persistent_poa(PortableServer::POA_var root_poa,
+ PortableServer::POAManager_var mgr,
+ const char* name,
+ CORBA::PolicyList& policy_list
+ ACE_ENV_ARG_DECL);
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ftrtec_export.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ftrtec_export.h
new file mode 100644
index 00000000000..2c404b4a134
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/ftrtec_export.h
@@ -0,0 +1,60 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TAO_FTRTEC
+// ------------------------------
+#ifndef TAO_FTRTEC_EXPORT_H
+#define TAO_FTRTEC_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_FTRTEC_HAS_DLL)
+# define TAO_FTRTEC_HAS_DLL 0
+# endif /* ! TAO_FTRTEC_HAS_DLL */
+#else
+# if !defined (TAO_FTRTEC_HAS_DLL)
+# define TAO_FTRTEC_HAS_DLL 1
+# endif /* ! TAO_FTRTEC_HAS_DLL */
+#endif
+
+#if defined (TAO_FTRTEC_HAS_DLL) && (TAO_FTRTEC_HAS_DLL == 1)
+# if defined (TAO_FTRTEC_BUILD_DLL)
+# define TAO_FTRTEC_Export ACE_Proper_Export_Flag
+# define TAO_FTRTEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_FTRTEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_FTRTEC_BUILD_DLL */
+# define TAO_FTRTEC_Export ACE_Proper_Import_Flag
+# define TAO_FTRTEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_FTRTEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_FTRTEC_BUILD_DLL */
+#else /* TAO_FTRTEC_HAS_DLL == 1 */
+# define TAO_FTRTEC_Export
+# define TAO_FTRTEC_SINGLETON_DECLARATION(T)
+# define TAO_FTRTEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_FTRTEC_HAS_DLL == 1 */
+
+// Set TAO_FTRTEC_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TAO_FTRTEC_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TAO_FTRTEC_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TAO_FTRTEC_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TAO_FTRTEC_NTRACE */
+
+#if (TAO_FTRTEC_NTRACE == 1)
+# define TAO_FTRTEC_TRACE(X)
+#else /* (TAO_FTRTEC_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define TAO_FTRTEC_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (TAO_FTRTEC_NTRACE == 1) */
+
+#endif /* TAO_FTRTEC_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/replace_key.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/replace_key.cpp
new file mode 100644
index 00000000000..8b902ac91bc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/replace_key.cpp
@@ -0,0 +1,35 @@
+#include "ace/OS_NS_string.h"
+#include "ace/Log_Msg.h"
+#include "tao/Object_KeyC.h"
+#include <algorithm>
+
+ACE_RCSID (EventChannel,
+ replace_key,
+ "$Id$")
+
+
+/// This function was defined in IOGR_Maker.cpp. It is moved
+/// here because the use of <algorithm> header
+/// file conflicts with the use of auto_ptr in the
+/// VxWorks5.5.1_PPC85XX_DIAB platform.
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void replace_key(char* ior, char* end_ior,
+ const TAO::ObjectKey& oldkey,
+ const TAO::ObjectKey& newkey)
+{
+ size_t keylen = oldkey.length();
+ ACE_ASSERT(keylen == newkey.length());
+
+ char* pos = ior;
+ const char* oldkey_begin = (const char*)oldkey.get_buffer();
+ const char* oldkey_end = oldkey_begin + keylen;
+
+ while ((pos = std::search(pos, end_ior,oldkey_begin, oldkey_end)) != end_ior) {
+ ACE_OS::memcpy(pos, newkey.get_buffer(), keylen);
+ pos+= keylen;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp
new file mode 100644
index 00000000000..afbbaf3d051
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp
@@ -0,0 +1,523 @@
+#include "orbsvcs/FtRtEvent/Utils/FTEC_Gateway.h"
+#include "orbsvcs/FtRtEvent/Utils/activate_with_id.h"
+#include "orbsvcs/FtRtEvent/Utils/UUID.h"
+#include "orbsvcs/FtRtEvent/Utils/resolve_init.h"
+#include "orbsvcs/FtRtecEventCommS.h"
+#include "tao/ORB_Core.h"
+
+ACE_RCSID (Utils,
+ FTEC_Gateway,
+ "$Id$")
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/FtRtEvent/Utils/FTEC_Gateway.inl"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_FTRTEC {
+class FTEC_Gateway_ConsumerAdmin
+ : public POA_RtecEventChannelAdmin::ConsumerAdmin
+{
+public:
+ FTEC_Gateway_ConsumerAdmin(FTEC_Gateway_Impl* impl);
+ ~FTEC_Gateway_ConsumerAdmin();
+ // = The RtecEventChannelAdmin::ConsumerAdmin methods...
+ virtual RtecEventChannelAdmin::ProxyPushSupplier_ptr
+ obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ FTEC_Gateway_Impl* impl_;
+};
+
+class FTEC_Gateway_SupplierAdmin
+ : public POA_RtecEventChannelAdmin::SupplierAdmin
+{
+public:
+ FTEC_Gateway_SupplierAdmin(FTEC_Gateway_Impl* impl);
+ ~FTEC_Gateway_SupplierAdmin();
+ // = The RtecEventChannelAdmin::SupplierAdmin methods...
+ virtual RtecEventChannelAdmin::ProxyPushConsumer_ptr
+ obtain_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ FTEC_Gateway_Impl* impl_;
+};
+
+class FTEC_Gateway_ProxyPushSupplier
+ : public POA_RtecEventChannelAdmin::ProxyPushSupplier
+{
+public:
+ FTEC_Gateway_ProxyPushSupplier(FTEC_Gateway_Impl* impl);
+ ~FTEC_Gateway_ProxyPushSupplier();
+ // = The RtecEventChannelAdmin::ProxyPushSupplier methods...
+ virtual void connect_push_consumer (
+ RtecEventComm::PushConsumer_ptr push_consumer,
+ const RtecEventChannelAdmin::ConsumerQOS &qos
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecEventChannelAdmin::AlreadyConnected,
+ RtecEventChannelAdmin::TypeError));
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void suspend_connection (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void resume_connection (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ FTEC_Gateway_Impl* impl_;
+};
+
+class FTEC_Gateway_ProxyPushConsumer
+ : public POA_RtecEventChannelAdmin::ProxyPushConsumer
+{
+public:
+ FTEC_Gateway_ProxyPushConsumer(FTEC_Gateway_Impl* impl);
+ ~FTEC_Gateway_ProxyPushConsumer();
+
+ virtual void push (const RtecEventComm::EventSet & data
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // = The RtecEventChannelAdmin::ProxyPushConsumer methods...
+ virtual void connect_push_supplier (
+ RtecEventComm::PushSupplier_ptr push_supplier,
+ const RtecEventChannelAdmin::SupplierQOS& qos
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecEventChannelAdmin::AlreadyConnected));
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ FTEC_Gateway_Impl* impl_;
+};
+
+class PushConsumerHandler : public POA_FtRtecEventComm::AMI_PushConsumerHandler
+{
+public:
+ PushConsumerHandler();
+ ~PushConsumerHandler();
+ virtual void push (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void push_excep (::Messaging::ExceptionHolder * excep_holder ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+/**
+ * This is used for remove the interceptors registered in the ORB.
+ */
+class Interceptor_Destoryer : public TAO_ORB_Core
+{
+public:
+ inline static void execute(CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) {
+ static_cast<Interceptor_Destoryer*> (orb->orb_core())->do_it(ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+private:
+ Interceptor_Destoryer();
+ inline void do_it(ACE_ENV_SINGLE_ARG_DECL) {
+ destroy_interceptors(ACE_ENV_SINGLE_ARG_PARAMETER);
+ };
+};
+
+struct FTEC_Gateway_Impl
+{
+ CORBA::ORB_var orb;
+ PortableServer::POA_var poa;
+ FtRtecEventChannelAdmin::EventChannel_var ftec;
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin;
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin;
+ FTEC_Gateway_ConsumerAdmin consumer_admin_servant;
+ FTEC_Gateway_SupplierAdmin supplier_admin_servant;
+ FTEC_Gateway_ProxyPushSupplier proxy_supplier_servant;
+ FTEC_Gateway_ProxyPushConsumer proxy_consumer_servant;
+ PushConsumerHandler push_handler_servant;
+ FtRtecEventComm::AMI_PushConsumerHandler_var push_handler;
+ bool local_orb;
+ FTEC_Gateway_Impl();
+};
+
+FTEC_Gateway_Impl::FTEC_Gateway_Impl()
+: consumer_admin_servant(this),
+ supplier_admin_servant(this),
+ proxy_supplier_servant(this),
+ proxy_consumer_servant(this)
+{
+}
+
+FTEC_Gateway::FTEC_Gateway(CORBA::ORB_ptr orb, FtRtecEventChannelAdmin::EventChannel_ptr ftec)
+: impl_(new FTEC_Gateway_Impl)
+{
+ impl_->local_orb = CORBA::is_nil(orb);
+ if (!impl_->local_orb)
+ impl_->orb = CORBA::ORB::_duplicate(orb);
+ impl_->ftec = FtRtecEventChannelAdmin::EventChannel::_duplicate(ftec);
+}
+
+FTEC_Gateway::~FTEC_Gateway()
+{
+ if (impl_->local_orb)
+ impl_->orb->shutdown();
+ delete impl_;
+}
+
+RtecEventChannelAdmin::EventChannel_ptr
+FTEC_Gateway::activate(PortableServer::POA_ptr root_poa ACE_ENV_ARG_DECL)
+{
+ PortableServer::POA_var poa;
+ PortableServer::POAManager_var mgr;
+
+ if (impl_->local_orb) {
+ int argc = 0;
+ char** argv = 0;
+ impl_->orb = CORBA::ORB_init(argc, argv, "FTEC_GatewayORB"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ Interceptor_Destoryer::execute(impl_->orb.in() ACE_ENV_ARG_PARAMETER);
+
+ poa = resolve_init<PortableServer::POA>(impl_->orb.in(), "RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ mgr = poa->the_POAManager(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ mgr->activate(ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ else {
+ poa = PortableServer::POA::_duplicate(root_poa);
+ mgr = poa->the_POAManager(ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ ACE_CHECK_RETURN(0);
+
+ PortableServer::IdUniquenessPolicy_var id_uniqueness_policy =
+ poa->create_id_uniqueness_policy(PortableServer::MULTIPLE_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ PortableServer::LifespanPolicy_var lifespan =
+ poa->create_lifespan_policy(PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ // create a USER_ID IdAssignmentPolicy object
+ PortableServer::IdAssignmentPolicy_var assign =
+ poa->create_id_assignment_policy(PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ CORBA::PolicyList policy_list;
+ policy_list.length(3);
+
+ policy_list[0] = PortableServer::IdUniquenessPolicy::_duplicate(
+ id_uniqueness_policy.in());
+ policy_list[1]=
+ PortableServer::LifespanPolicy::_duplicate(lifespan.in());
+ policy_list[2]=
+ PortableServer::IdAssignmentPolicy::_duplicate(assign.in());
+
+ impl_->poa = poa->create_POA("gateway_poa", mgr.in(), policy_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ id_uniqueness_policy->destroy();
+ lifespan->destroy();
+ assign->destroy();
+
+ FtRtecEventComm::ObjectId oid;
+ oid.length(16);
+ UUID::create(oid.get_buffer());
+
+ RtecEventChannelAdmin::EventChannel_var gateway;
+
+ activate_object_with_id(gateway.out(), impl_->poa.in(), this, oid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ ++oid[9];
+ activate_object_with_id(impl_->consumer_admin.out(),
+ impl_->poa.in(),
+ &impl_->consumer_admin_servant,
+ oid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ ++oid[9];
+ activate_object_with_id(impl_->supplier_admin.out(),
+ impl_->poa.in(),
+ &impl_->supplier_admin_servant,
+ oid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ return gateway._retn();
+}
+
+//= The RtecEventChannelAdmin::EventChannel methods
+RtecEventChannelAdmin::ConsumerAdmin_ptr
+FTEC_Gateway::for_consumers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return RtecEventChannelAdmin::ConsumerAdmin::_duplicate(impl_->consumer_admin.in());
+}
+
+RtecEventChannelAdmin::SupplierAdmin_ptr
+FTEC_Gateway::for_suppliers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG((LM_DEBUG, "FTEC_Gateway::for_suppliers\n"));
+ return RtecEventChannelAdmin::SupplierAdmin::_duplicate(impl_->supplier_admin.in());
+}
+
+void FTEC_Gateway::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ impl_->ftec->destroy();
+}
+
+RtecEventChannelAdmin::Observer_Handle
+FTEC_Gateway::append_observer (RtecEventChannelAdmin::Observer_ptr observer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER))
+{
+ return impl_->ftec->append_observer(observer ACE_ENV_ARG_PARAMETER);
+}
+
+void FTEC_Gateway::remove_observer (RtecEventChannelAdmin::Observer_Handle handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_REMOVE_OBSERVER))
+{
+ impl_->ftec->remove_observer(handle ACE_ENV_ARG_PARAMETER);
+}
+
+void FTEC_Gateway::push(RtecEventChannelAdmin::ProxyPushConsumer_ptr proxy_consumer,
+ const RtecEventComm::EventSet & data
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::ObjectId_var object_id =
+ impl_->poa->reference_to_id(proxy_consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ FtRtecEventComm::ObjectId** result;
+ memcpy(&result, &object_id[0], sizeof(FtRtecEventComm::ObjectId**));
+
+ impl_->ftec->push(**result, data ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+/// FTEC_Gateway_ConsumerAdmin
+
+FTEC_Gateway_ConsumerAdmin::FTEC_Gateway_ConsumerAdmin(FTEC_Gateway_Impl* impl)
+: impl_(impl)
+{
+}
+
+FTEC_Gateway_ConsumerAdmin::~FTEC_Gateway_ConsumerAdmin()
+{
+}
+
+RtecEventChannelAdmin::ProxyPushSupplier_ptr
+FTEC_Gateway_ConsumerAdmin::obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ FtRtecEventComm::ObjectId** remote_proxy_oid_ptr;
+ ACE_NEW_THROW_EX(remote_proxy_oid_ptr, FtRtecEventComm::ObjectId*, CORBA::NO_MEMORY());
+
+ FtRtecEventComm::ObjectId local_oid;
+ local_oid.length(sizeof(remote_proxy_oid_ptr));
+ memcpy(&local_oid[0], &remote_proxy_oid_ptr, sizeof(remote_proxy_oid_ptr));
+
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr result;
+ activate_object_with_id(result, impl_->poa.in(),
+ &impl_->proxy_supplier_servant,
+ local_oid ACE_ENV_ARG_PARAMETER);
+ return result;
+}
+
+/// FTEC_Gateway_SupplierAdmin
+
+FTEC_Gateway_SupplierAdmin::FTEC_Gateway_SupplierAdmin(FTEC_Gateway_Impl* impl)
+: impl_(impl)
+{
+}
+
+FTEC_Gateway_SupplierAdmin::~FTEC_Gateway_SupplierAdmin()
+{
+}
+
+// = The RtecEventChannelAdmin::SupplierAdmin methods...
+RtecEventChannelAdmin::ProxyPushConsumer_ptr
+FTEC_Gateway_SupplierAdmin::obtain_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ FtRtecEventComm::ObjectId** remote_proxy_oid_ptr;
+ ACE_NEW_THROW_EX(remote_proxy_oid_ptr, FtRtecEventComm::ObjectId*, CORBA::NO_MEMORY());
+
+ FtRtecEventComm::ObjectId local_oid;
+ local_oid.length(sizeof(remote_proxy_oid_ptr));
+ memcpy(&local_oid[0], &remote_proxy_oid_ptr, sizeof(remote_proxy_oid_ptr));
+
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr result;
+ activate_object_with_id(result, impl_->poa.in(),
+ &impl_->proxy_consumer_servant,
+ local_oid ACE_ENV_ARG_PARAMETER);
+ return result;
+}
+
+
+FtRtecEventComm::ObjectId**
+get_remote_oid_ptr(CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
+{
+ PortableServer::Current_var current =
+ resolve_init<PortableServer::Current>(orb,
+ "POACurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ PortableServer::ObjectId_var object_id =
+ current->get_object_id(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ FtRtecEventComm::ObjectId** result;
+ memcpy(&result, &object_id[0], sizeof(FtRtecEventComm::ObjectId**));
+ return result;
+}
+
+/// FTEC_Gateway_ProxyPushSupplier
+
+FTEC_Gateway_ProxyPushSupplier::FTEC_Gateway_ProxyPushSupplier(FTEC_Gateway_Impl* impl)
+: impl_(impl)
+{
+}
+
+FTEC_Gateway_ProxyPushSupplier::~FTEC_Gateway_ProxyPushSupplier()
+{
+}
+
+
+// = The RtecEventChannelAdmin::ProxyPushSupplier methods...
+void FTEC_Gateway_ProxyPushSupplier::connect_push_consumer (
+ RtecEventComm::PushConsumer_ptr push_consumer,
+ const RtecEventChannelAdmin::ConsumerQOS &qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecEventChannelAdmin::AlreadyConnected,
+ RtecEventChannelAdmin::TypeError))
+{
+
+ FtRtecEventComm::ObjectId** oid_ptr = get_remote_oid_ptr(impl_->orb.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ *oid_ptr = impl_->ftec->connect_push_consumer(push_consumer, qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void FTEC_Gateway_ProxyPushSupplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ FtRtecEventComm::ObjectId** oid_ptr = get_remote_oid_ptr(impl_->orb.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ impl_->ftec->disconnect_push_supplier(**oid_ptr ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ delete *oid_ptr;
+ delete oid_ptr;
+}
+
+void FTEC_Gateway_ProxyPushSupplier::suspend_connection (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ FtRtecEventComm::ObjectId** oid_ptr = get_remote_oid_ptr(impl_->orb.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ impl_->ftec->suspend_push_supplier(**oid_ptr ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void FTEC_Gateway_ProxyPushSupplier::resume_connection (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ FtRtecEventComm::ObjectId** oid_ptr = get_remote_oid_ptr(impl_->orb.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ impl_->ftec->resume_push_supplier(**oid_ptr ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+/// FTEC_Gateway_ProxyPushConsumer
+
+FTEC_Gateway_ProxyPushConsumer::FTEC_Gateway_ProxyPushConsumer(FTEC_Gateway_Impl* impl)
+: impl_(impl)
+{
+}
+
+FTEC_Gateway_ProxyPushConsumer::~FTEC_Gateway_ProxyPushConsumer()
+{
+}
+
+
+// = The RtecEventChannelAdmin::ProxyPushConsumer methods...
+
+void FTEC_Gateway_ProxyPushConsumer::push (const RtecEventComm::EventSet & data
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ FtRtecEventComm::ObjectId** oid_ptr = get_remote_oid_ptr(impl_->orb.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ /*
+ if (CORBA::is_nil(impl_->push_handler.in())) {
+ impl_->push_handler = impl_->push_handler_servant._this(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ impl_->ftec->sendc_push (impl_->push_handler.in(),
+ **oid_ptr,
+ data ACE_ENV_ARG_PARAMETER);
+ */
+ impl_->ftec->push(**oid_ptr, data ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void FTEC_Gateway_ProxyPushConsumer::connect_push_supplier (
+ RtecEventComm::PushSupplier_ptr push_supplier,
+ const RtecEventChannelAdmin::SupplierQOS& qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecEventChannelAdmin::AlreadyConnected))
+{
+ FtRtecEventComm::ObjectId** oid_ptr = get_remote_oid_ptr(impl_->orb.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ *oid_ptr = impl_->ftec->connect_push_supplier(push_supplier, qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void FTEC_Gateway_ProxyPushConsumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ FtRtecEventComm::ObjectId** oid_ptr = get_remote_oid_ptr(impl_->orb.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ impl_->ftec->disconnect_push_consumer(**oid_ptr ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ delete *oid_ptr;
+ delete oid_ptr;
+}
+
+PushConsumerHandler::PushConsumerHandler()
+{
+}
+
+PushConsumerHandler::~PushConsumerHandler()
+{
+}
+
+void PushConsumerHandler::push (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void PushConsumerHandler::push_excep (::Messaging::ExceptionHolder *
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+} // TAO_FTRTEC
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.h
new file mode 100644
index 00000000000..3db7660c7ad
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.h
@@ -0,0 +1,82 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FTEC_Gateway.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef FTEC_GATEWAY_H
+#define FTEC_GATEWAY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FtRtecEventChannelAdminC.h"
+#include "orbsvcs/RtecEventChannelAdminS.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_FTRTEC
+{
+ struct FTEC_Gateway_Impl;
+ class TAO_FtRtEvent_Export FTEC_Gateway :
+ public POA_RtecEventChannelAdmin::EventChannel
+ {
+ public:
+ FTEC_Gateway(CORBA::ORB_ptr orb,
+ FtRtecEventChannelAdmin::EventChannel_ptr ftec);
+ ~FTEC_Gateway();
+
+ RtecEventChannelAdmin::EventChannel_ptr activate
+ (PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL);
+
+ RtecEventChannelAdmin::EventChannel_ptr
+ _this(ACE_ENV_SINGLE_ARG_DECL);
+
+ //= The RtecEventChannelAdmin::EventChannel methods
+ virtual RtecEventChannelAdmin::ConsumerAdmin_ptr
+ for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC((CORBA::SystemException));
+
+ virtual RtecEventChannelAdmin::SupplierAdmin_ptr
+ for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC((CORBA::SystemException));
+
+ 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));
+
+ void push(RtecEventChannelAdmin::ProxyPushConsumer_ptr proxy_consumer,
+ const RtecEventComm::EventSet & data
+ ACE_ENV_ARG_DECL);
+ private:
+ struct FTEC_Gateway_Impl *impl_;
+ };
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/FtRtEvent/Utils/FTEC_Gateway.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.inl b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.inl
new file mode 100644
index 00000000000..4a4869aece4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.inl
@@ -0,0 +1,16 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_FTRTEC {
+ ACE_INLINE RtecEventChannelAdmin::EventChannel_ptr
+ FTEC_Gateway::_this(ACE_ENV_SINGLE_ARG_DECL)
+ {
+ PortableServer::POA_var poa = _default_POA();
+ return activate(poa.in() ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp
new file mode 100644
index 00000000000..6319f696946
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp
@@ -0,0 +1,29 @@
+//$Id$
+#include "orbsvcs/FtRtEvent/Utils/Log.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/FtRtEvent/Utils/Log.inl"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_FTRTEC {
+
+unsigned int Log::log_level_;
+
+#ifndef NDEBUG
+ Log::Log (unsigned int log_level, const ACE_TCHAR* format, ...)
+ {
+ if (log_level_ >= log_level) {
+ va_list p;
+ va_start(p, format);
+ char str[1024];
+ ACE_OS::vsprintf(str, format, p);
+ ACE_DEBUG((LM_DEBUG, str));
+ va_end(p);
+ }
+ }
+#endif
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h
new file mode 100644
index 00000000000..71b95a8a28e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h
@@ -0,0 +1,48 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Log.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef FTRTEC_LOG_H
+#define FTRTEC_LOG_H
+
+#include /**/ "ace/pre.h"
+#include "orbsvcs/FtRtEvent/Utils/ftrtevent_export.h"
+#include "tao/Versioned_Namespace.h"
+#include "ace/OS.h"
+#include "ace/Log_Msg.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_FTRTEC {
+
+ /**
+ * A utility class for logging messages.
+ */
+ class TAO_FtRtEvent_Export Log
+ {
+ public:
+ Log (unsigned int log_level, const ACE_TCHAR* format, ...);
+ static void level(unsigned int log_level);
+ static unsigned int level();
+ static void hexdump(unsigned int log_level, const char* buf, size_t len, const char* msg);
+ private:
+ friend class Trace;
+ static unsigned log_level_;
+ };
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/FtRtEvent/Utils/Log.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.inl b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.inl
new file mode 100644
index 00000000000..120a88f6557
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.inl
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_FTRTEC {
+#ifndef NDEBUG
+ ACE_INLINE
+ void Log::level(unsigned int log_level)
+ {
+ log_level_ = log_level;
+ }
+
+ ACE_INLINE
+ unsigned int Log::level()
+ {
+ return log_level_;
+ }
+
+ ACE_INLINE
+ void Log::hexdump(unsigned int level, const char* buf, size_t len, const char* msg)
+ {
+ if (Log::log_level_ >= level)
+ ACE_HEX_DUMP((LM_DEBUG, buf, len, msg));
+ }
+#else // NDEBUG
+ ACE_INLINE
+ Log::Log (unsigned int, const ACE_TCHAR*, ...)
+ {
+ }
+
+ ACE_INLINE
+ void Log::level(unsigned int )
+ {
+ }
+
+ ACE_INLINE
+ unsigned int Log::level()
+ {
+ return 0;
+ }
+
+ ACE_INLINE
+ void Log::hexdump(unsigned int, const char*, size_t, const char*)
+ {
+ }
+#endif
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.cpp
new file mode 100644
index 00000000000..96f0abfbad5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.cpp
@@ -0,0 +1,9 @@
+#include "orbsvcs/FtRtEvent/Utils/Safe_InputCDR.h"
+
+ACE_RCSID (Utils,
+ Safe_InputCDR,
+ "$Id$")
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/FtRtEvent/Utils/Safe_InputCDR.inl"
+#endif /* __ACE_INLINE__ */
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.h
new file mode 100644
index 00000000000..b4aede7f570
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.h
@@ -0,0 +1,40 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file Safe_InputCDR.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef SAFE_INPUTCDR_H
+#define SAFE_INPUTCDR_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FtRtEvent/Utils/ftrtevent_export.h"
+#include "tao/CDR.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FtRtEvent_Export Safe_InputCDR : public TAO_InputCDR
+{
+public:
+ /**
+ * Create an input stream from an arbitrary buffer.
+ *
+ * This contructor will work no matter the buffer is aligned properly
+ * or not. If the buffer is not properly aligned, it will make a copy
+ * of the buffer.
+ */
+ Safe_InputCDR(const char* buf, int size);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/FtRtEvent/Utils/Safe_InputCDR.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.inl b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.inl
new file mode 100644
index 00000000000..a4712c153f5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Safe_InputCDR.inl
@@ -0,0 +1,23 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "ace/OS_Memory.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+Safe_InputCDR::Safe_InputCDR(const char* buf, int size)
+: TAO_InputCDR((ACE_Message_Block*)0)
+{
+ if (ACE_ptr_align_binary(buf, ACE_CDR::MAX_ALIGNMENT) != buf) {
+ ACE_CDR::grow(&start_,size);
+ this->start_.copy(buf, size);
+ }
+ else {
+ this->start_.init(buf,size);
+ this->start_.wr_ptr(size);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ScopeGuard.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ScopeGuard.h
new file mode 100644
index 00000000000..1b0dc0bc02d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ScopeGuard.h
@@ -0,0 +1,300 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file ScopeGuard.h
+ *
+ * $Id$
+ *
+ * @brief This is the code published at
+ * http://www.cuj.com/documents/s=8000/cujcexp1812alexandr/alexandr.htm
+ */
+//=============================================================================
+
+#ifndef SCOPEGUARD_H_
+#define SCOPEGUARD_H_
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class T>
+class RefHolder
+{
+ T& ref_;
+public:
+ RefHolder(T& ref) : ref_(ref) {}
+ operator T& () const
+ {
+ return ref_;
+ }
+private:
+ // Disable assignment - not implemented
+ RefHolder& operator=(const RefHolder&);
+};
+
+template <class T>
+inline RefHolder<T> ByRef(T& t)
+{
+ return RefHolder<T>(t);
+}
+
+class ScopeGuardImplBase
+{
+ ScopeGuardImplBase& operator =(const ScopeGuardImplBase&);
+protected:
+ ~ScopeGuardImplBase()
+ {
+ }
+ ScopeGuardImplBase(const ScopeGuardImplBase& other) throw()
+ : dismissed_(other.dismissed_)
+ {
+ other.Dismiss();
+ }
+ template <typename J>
+ static void SafeExecute(J& j) throw()
+ {
+ if (!j.dismissed_)
+ try
+ {
+ j.Execute();
+ }
+ catch(...)
+ {
+ }
+ }
+
+ mutable bool dismissed_;
+public:
+ ScopeGuardImplBase() throw() : dismissed_(false)
+ {
+ }
+ void Dismiss() const throw()
+ {
+ dismissed_ = true;
+ }
+};
+
+typedef const ScopeGuardImplBase& ScopeGuard;
+
+template <typename F>
+class ScopeGuardImpl0 : public ScopeGuardImplBase
+{
+public:
+ static ScopeGuardImpl0<F> MakeGuard(F fun)
+ {
+ return ScopeGuardImpl0<F>(fun);
+ }
+ ~ScopeGuardImpl0() throw()
+ {
+ SafeExecute(*this);
+ }
+ void Execute()
+ {
+ fun_();
+ }
+protected:
+ ScopeGuardImpl0(F fun) : fun_(fun)
+ {
+ }
+ F fun_;
+};
+
+template <typename F>
+inline ScopeGuardImpl0<F> MakeGuard(F fun)
+{
+ return ScopeGuardImpl0<F>::MakeGuard(fun);
+}
+
+template <typename F, typename P1>
+class ScopeGuardImpl1 : public ScopeGuardImplBase
+{
+public:
+ static ScopeGuardImpl1<F, P1> MakeGuard(F fun, P1 p1)
+ {
+ return ScopeGuardImpl1<F, P1>(fun, p1);
+ }
+ ~ScopeGuardImpl1() throw()
+ {
+ SafeExecute(*this);
+ }
+ void Execute()
+ {
+ fun_(p1_);
+ }
+protected:
+ ScopeGuardImpl1(F fun, P1 p1) : fun_(fun), p1_(p1)
+ {
+ }
+ F fun_;
+ const P1 p1_;
+};
+
+template <typename F, typename P1>
+inline ScopeGuardImpl1<F, P1> MakeGuard(F fun, P1 p1)
+{
+ return ScopeGuardImpl1<F, P1>::MakeGuard(fun, p1);
+}
+
+template <typename F, typename P1, typename P2>
+class ScopeGuardImpl2: public ScopeGuardImplBase
+{
+public:
+ static ScopeGuardImpl2<F, P1, P2> MakeGuard(F fun, P1 p1, P2 p2)
+ {
+ return ScopeGuardImpl2<F, P1, P2>(fun, p1, p2);
+ }
+ ~ScopeGuardImpl2() throw()
+ {
+ SafeExecute(*this);
+ }
+ void Execute()
+ {
+ fun_(p1_, p2_);
+ }
+protected:
+ ScopeGuardImpl2(F fun, P1 p1, P2 p2) : fun_(fun), p1_(p1), p2_(p2)
+ {
+ }
+ F fun_;
+ const P1 p1_;
+ const P2 p2_;
+};
+
+template <typename F, typename P1, typename P2>
+inline ScopeGuardImpl2<F, P1, P2> MakeGuard(F fun, P1 p1, P2 p2)
+{
+ return ScopeGuardImpl2<F, P1, P2>::MakeGuard(fun, p1, p2);
+}
+
+template <typename F, typename P1, typename P2, typename P3>
+class ScopeGuardImpl3 : public ScopeGuardImplBase
+{
+public:
+ static ScopeGuardImpl3<F, P1, P2, P3> MakeGuard(F fun, P1 p1, P2 p2, P3 p3)
+ {
+ return ScopeGuardImpl3<F, P1, P2, P3>(fun, p1, p2, p3);
+ }
+ ~ScopeGuardImpl3() throw()
+ {
+ SafeExecute(*this);
+ }
+ void Execute()
+ {
+ fun_(p1_, p2_, p3_);
+ }
+protected:
+ ScopeGuardImpl3(F fun, P1 p1, P2 p2, P3 p3) : fun_(fun), p1_(p1), p2_(p2), p3_(p3)
+ {
+ }
+ F fun_;
+ const P1 p1_;
+ const P2 p2_;
+ const P3 p3_;
+};
+
+template <typename F, typename P1, typename P2, typename P3>
+inline ScopeGuardImpl3<F, P1, P2, P3> MakeGuard(F fun, P1 p1, P2 p2, P3 p3)
+{
+ return ScopeGuardImpl3<F, P1, P2, P3>::MakeGuard(fun, p1, p2, p3);
+}
+
+//************************************************************
+
+template <class Obj, typename MemFun>
+class ObjScopeGuardImpl0 : public ScopeGuardImplBase
+{
+public:
+ static ObjScopeGuardImpl0<Obj, MemFun> MakeObjGuard(Obj& obj, MemFun memFun)
+ {
+ return ObjScopeGuardImpl0<Obj, MemFun>(obj, memFun);
+ }
+ ~ObjScopeGuardImpl0() throw()
+ {
+ SafeExecute(*this);
+ }
+ void Execute()
+ {
+ (obj_.*memFun_)();
+ }
+protected:
+ ObjScopeGuardImpl0(Obj& obj, MemFun memFun)
+ : obj_(obj), memFun_(memFun) {}
+ Obj& obj_;
+ MemFun memFun_;
+};
+
+template <class Obj, typename MemFun>
+inline ObjScopeGuardImpl0<Obj, MemFun> MakeObjGuard(Obj& obj, MemFun memFun)
+{
+ return ObjScopeGuardImpl0<Obj, MemFun>::MakeObjGuard(obj, memFun);
+}
+
+template <class Obj, typename MemFun, typename P1>
+class ObjScopeGuardImpl1 : public ScopeGuardImplBase
+{
+public:
+ static ObjScopeGuardImpl1<Obj, MemFun, P1> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1)
+ {
+ return ObjScopeGuardImpl1<Obj, MemFun, P1>(obj, memFun, p1);
+ }
+ ~ObjScopeGuardImpl1() throw()
+ {
+ SafeExecute(*this);
+ }
+ void Execute()
+ {
+ (obj_.*memFun_)(p1_);
+ }
+protected:
+ ObjScopeGuardImpl1(Obj& obj, MemFun memFun, P1 p1)
+ : obj_(obj), memFun_(memFun), p1_(p1) {}
+ Obj& obj_;
+ MemFun memFun_;
+ const P1 p1_;
+};
+
+template <class Obj, typename MemFun, typename P1>
+inline ObjScopeGuardImpl1<Obj, MemFun, P1> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1)
+{
+ return ObjScopeGuardImpl1<Obj, MemFun, P1>::MakeObjGuard(obj, memFun, p1);
+}
+
+template <class Obj, typename MemFun, typename P1, typename P2>
+class ObjScopeGuardImpl2 : public ScopeGuardImplBase
+{
+public:
+ static ObjScopeGuardImpl2<Obj, MemFun, P1, P2> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2)
+ {
+ return ObjScopeGuardImpl2<Obj, MemFun, P1, P2>(obj, memFun, p1, p2);
+ }
+ ~ObjScopeGuardImpl2() throw()
+ {
+ SafeExecute(*this);
+ }
+ void Execute()
+ {
+ (obj_.*memFun_)(p1_, p2_);
+ }
+protected:
+ ObjScopeGuardImpl2(Obj& obj, MemFun memFun, P1 p1, P2 p2)
+ : obj_(obj), memFun_(memFun), p1_(p1), p2_(p2) {}
+ Obj& obj_;
+ MemFun memFun_;
+ const P1 p1_;
+ const P2 p2_;
+};
+
+template <class Obj, typename MemFun, typename P1, typename P2>
+inline ObjScopeGuardImpl2<Obj, MemFun, P1, P2> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2)
+{
+ return ObjScopeGuardImpl2<Obj, MemFun, P1, P2>::MakeObjGuard(obj, memFun, p1, p2);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#define CONCATENATE_DIRECT(s1, s2) s1##s2
+#define CONCATENATE(s1, s2) CONCATENATE_DIRECT(s1, s2)
+#define ANONYMOUS_VARIABLE(str) CONCATENATE(str, __LINE__)
+
+#define ON_BLOCK_EXIT ScopeGuard ANONYMOUS_VARIABLE(scopeGuard) = MakeGuard
+#define ON_BLOCK_EXIT_OBJ ScopeGuard ANONYMOUS_VARIABLE(scopeGuard) = MakeObjGuard
+
+#endif //SCOPEGUARD_H_
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.cpp
new file mode 100644
index 00000000000..6a34e95164b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.cpp
@@ -0,0 +1,167 @@
+//$Id$
+#include "orbsvcs/FtRtEvent/Utils/UUID.h"
+
+ACE_RCSID (Utils,
+ UUID,
+ "$Id$")
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/FtRtEvent/Utils/UUID.inl"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+static union
+{
+ struct
+ {
+ ACE_UINT32 rand1;
+ ACE_UINT16 rand2;
+ } rand_node;
+ ACE_OS::macaddr_node_t mac_address;
+} node;
+
+int
+hex_to_byte (char h)
+{
+ if (h >= '0' && h <= '9') return h - '0';
+ if (h >= 'A' && h <= 'F') return h - 'A' + 10;
+ if (h >= 'a' && h <= 'f') return h - 'a' + 10;
+ return -1;
+}
+
+int
+hexbyte_to_byte (const char *hexbyte)
+{
+ int hi = hex_to_byte(*hexbyte);
+ if (hi == -1) return -1;
+ ++hexbyte;
+
+ int low = hex_to_byte(*hexbyte);
+ if (low == -1) return -1;
+ return (hi << 4) | low;
+}
+
+static const int counts[] = { 4, 2, 2, 2, 6 };
+static const char *seperators = "----";
+
+/**
+ * construct an UUID from the string representation
+ */
+UUID::UUID (const char *string_rep)
+{
+ if (this->from_string(string_rep) == false)
+ rep_.timestamp.hi = 0;
+}
+
+bool
+UUID::from_string (const char *string_rep)
+{
+ int offset = 0;
+
+ for (int i = 0; i < 5; ++i)
+ {
+ for (int j = 0; j < counts[i]; ++j)
+ {
+ int r = hexbyte_to_byte(string_rep);
+ if (r == -1)
+ {
+ return false;
+ }
+
+ rep_.uuid[offset++] = static_cast<unsigned char> (r);
+ string_rep += 2;
+ }
+
+ if (*string_rep++ != seperators[i])
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+static const char *table = "0123456789abcdef";
+
+inline char *
+bytes_to_hex (const unsigned char *bytes,
+ char *dest,
+ int len)
+{
+ for (int i = 0; i < len; ++i)
+ {
+ *dest++ = table[bytes[i] >> 4];
+ *dest++ = table[bytes[i] & 0x0f];
+ }
+
+ return dest;
+}
+
+/**
+ * convert to a string representation
+ */
+void
+UUID::to_string (char *string_rep) const
+{
+ for (int i = 0; i < 5; ++i)
+ {
+ string_rep = bytes_to_hex(rep_.uuid,
+ string_rep,
+ counts[i]);
+ *string_rep++ = seperators[i];
+ }
+}
+
+void
+UUID::create (unsigned char *buffer)
+{
+ static ACE_RANDR_TYPE seed;
+
+ if (seed == 0) seed = ACE_OS::getpid();
+
+ // test if node is properly initialized
+ if (node.rand_node.rand1 == 0)
+ {
+ // initialize the node
+ if (ACE_OS::getmacaddress(&node.mac_address) == -1)
+ {
+ node.rand_node.rand1 = ACE_OS::rand_r(seed);
+ node.rand_node.rand2 = (unsigned short) ACE_OS::rand_r(seed);
+ }
+ }
+
+ // Days in years
+ static ACE_UINT64 SecondsToJan1970 =
+ (static_cast<ACE_UINT64> (365)*(1970-1583) // Days in years
+ + (1970-1583)/4 // Leap days
+ - 3 // Allow for 1700, 1800, 1900 not leap years
+ + 31 // Days in December 1583
+ + 30 // Days in November 1583
+ + 16)*60*60*24; // Days from 15th October
+
+
+ ACE_Time_Value now = ACE_OS::gettimeofday();
+ ACE_UINT64 timestamp = (SecondsToJan1970 + now.sec()) * 10000000 + now.usec() * 10;
+
+ buffer[0] = (unsigned char) (timestamp & 0xff);
+ buffer[1] = (unsigned char) ((timestamp >> 8) & 0xff);
+ buffer[2] = (unsigned char) ((timestamp >> 16) & 0xff);
+ buffer[3] = (unsigned char) ((timestamp >> 24) & 0xff);
+ buffer[4] = (unsigned char) ((timestamp >> 32) & 0xff);
+ buffer[5] = (unsigned char) ((timestamp >> 40) & 0xff);
+
+ // multiplex timestamp with thread id to ensure the uniqueness between thread
+ buffer[6] = (unsigned char) ((timestamp >> 48) & 0xff);
+ // Version number is 1
+ buffer[7] = (unsigned char) (((timestamp >> 56) & 0x0f) + 0x10);
+
+ ACE_UINT16 clockSequence = static_cast<
+ ACE_UINT16> (ACE_OS::rand_r(seed) & 0x2ff);
+
+ buffer[8] = (unsigned char) ((clockSequence >> 8) & 0x1f);
+ buffer[9] = (unsigned char) (clockSequence & 0x1f);
+
+ memcpy(buffer + 10, &node, 6);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.h
new file mode 100644
index 00000000000..19b81c44354
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.h
@@ -0,0 +1,123 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file UUID.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef UUID_H
+#define UUID_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/FtRtEvent/Utils/ftrtevent_export.h"
+#include "tao/Versioned_Namespace.h"
+#include "ace/OS.h"
+#include "ace/SString.h"
+
+#if defined(TAO_EXPORT_MACRO)
+#undef TAO_EXPORT_MACRO
+#endif
+#define TAO_EXPORT_MACRO FtRtEvent_Export
+
+#if defined(TAO_EXPORT_NESTED_CLASSES)
+#if defined(TAO_EXPORT_NESTED_MACRO)
+#undef TAO_EXPORT_NESTED_MACRO
+#endif /* defined (TAO_EXPORT_NESTED_MACRO) */
+#define TAO_EXPORT_NESTED_MACRO FtRtEvent_Export
+#endif /* TAO_EXPORT_NESTED_CLASSES */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * This is an implementation of Global Unique Identifier
+ * which follows the document draft-leach-uuids-guids-01.txt. The
+ * class layout is compatible with the binary representation of
+ * UUID specified by that document. The default constructor
+ * is used to create an new global unique id, not a NULL UUID.
+ * This class does not use dynamic memory allocation and does
+ * not throw any exception except to_string(ACE_CString&).
+ */
+class TAO_FtRtEvent_Export UUID
+{
+ public:
+ enum
+ {
+ BINRARY_LENGTH= 16,
+
+ // the required length for the string representation including the termination '\0'
+ STRING_LENGTH = 37
+ };
+
+ /* Construct an Global Unique Identifier. */
+ UUID(void);
+
+ /* This is used to create an uninitialized UUID. */
+ UUID(int);
+
+ /*
+ * Construct an UUID from the binary represetation. If you want to avoid a memory
+ * copy operation for this constructor. You can safely reinterpret_cast the 16
+ * bytes buffer into the UUID object and use all the member functions provided in
+ * this class except is_valid() which is only useful if a UUID object is
+ * constructed from the string representation.
+ */
+ UUID(const unsigned char *buffer);
+
+ /*
+ * Construct an UUID from the string representation. Use is_valid() to test if the
+ * construction is successful or not.
+ */
+ UUID(const char *);
+
+ /* Construct an uuid from the string representation. */
+ bool from_string(const char *string_rep);
+
+ bool operator==(const UUID &other) const;
+ bool operator!=(const UUID &other) const;
+
+ /*
+ * Test if the UUID is valid. Used after constructing an UUID from an string
+ * representation. This is done by testing whether the time_hi and time_mid fields
+ * of the timestamp are 0. By current time, those two field shouldn't be 0 at all.
+ */
+ bool is_valid(void) const;
+
+ /*
+ * convert to a string representation the buffer size provided must be at least
+ * STRING_LENGTH
+ */
+ void to_string(char *string_rep) const;
+
+ void to_string(ACE_CString &string) const;
+
+ /*
+ * convert to a string representation the buffer size provided must be at least
+ * BINRARY_LENGTH
+ */
+ void to_binary(unsigned char *binary_rep) const;
+
+ /* create an UUID in the specified buffer */
+ static void create(unsigned char *buffer);
+ private:
+ union
+ {
+ struct
+ {
+ ACE_UINT32 low;
+ ACE_UINT32 hi;
+ } timestamp;
+ unsigned char uuid[BINRARY_LENGTH];
+ } rep_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/FtRtEvent/Utils/UUID.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.inl b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.inl
new file mode 100644
index 00000000000..e1238a12ff1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/UUID.inl
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+UUID::UUID()
+{
+ create(rep_.uuid);
+}
+
+ACE_INLINE
+UUID::UUID(int)
+{
+}
+
+/// construct an UUID from the binary represetation
+ACE_INLINE
+UUID::UUID(const unsigned char* id)
+{
+ memcpy(rep_.uuid, id, 16);
+}
+
+ACE_INLINE
+bool UUID::operator == (const UUID& other) const
+{
+ return memcmp(this->rep_.uuid, other.rep_.uuid, BINRARY_LENGTH) == 0;
+}
+
+ACE_INLINE
+bool UUID::operator != (const UUID& other) const
+{
+ return !(*this == other);
+}
+
+
+ACE_INLINE
+bool UUID::is_valid() const
+{
+ return !this->rep_.timestamp.hi;
+}
+
+
+ACE_INLINE
+void UUID::to_binary(unsigned char* binary_rep) const
+{
+ memcpy(binary_rep, rep_.uuid, 16);
+}
+
+ACE_INLINE
+void UUID::to_string(ACE_CString& string) const
+{
+ string.resize(STRING_LENGTH-1);
+ this->to_string(&string[0]);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/activate_with_id.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/activate_with_id.h
new file mode 100644
index 00000000000..9913cc8c8c9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/activate_with_id.h
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file activate_with_id.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef ACTIVATE_WITH_ID_H
+#define ACTIVATE_WITH_ID_H
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class T>
+void
+activate_object_with_id (T * &result,
+ PortableServer::POA_ptr poa,
+ PortableServer::ServantBase *servant,
+ const FtRtecEventComm::ObjectId &oid
+ ACE_ENV_ARG_DECL)
+{
+ const PortableServer::ObjectId& id =
+ reinterpret_cast<const PortableServer::ObjectId&> (oid);
+ poa->activate_object_with_id(id,
+ servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var object =
+ poa->id_to_reference(id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ result = T::_narrow(object.in() ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ftrtevent_export.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ftrtevent_export.h
new file mode 100644
index 00000000000..f3133e01cbe
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/ftrtevent_export.h
@@ -0,0 +1,73 @@
+
+ // -*- C++ -*-
+
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TAO_FtRtEvent
+// ------------------------------
+#ifndef TAO_FTRTEVENT_EXPORT_H
+#define TAO_FTRTEVENT_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_FTRTEVENT_HAS_DLL)
+# define TAO_FTRTEVENT_HAS_DLL 0
+# endif /* ! TAO_FTRTEVENT_HAS_DLL */
+#else
+# if !defined (TAO_FTRTEVENT_HAS_DLL)
+# define TAO_FTRTEVENT_HAS_DLL 1
+# endif /* ! TAO_FTRTEVENT_HAS_DLL */
+#endif
+
+#if defined(TAO_FTRTEVENT_HAS_DLL) \
+&& (TAO_FTRTEVENT_HAS_DLL == 1)
+#if defined(TAO_FTRTEVENT_BUILD_DLL)
+#define TAO_FtRtEvent_Export \
+ ACE_Proper_Export_Flag
+#define TAO_FTRTEVENT_SINGLETON_DECLARATION (T) ACE_EXPORT_SINGLETON_DECLARATION(T)
+#define TAO_FTRTEVENT_SINGLETON_DECLARE (SINGLETON_TYPE, \
+ CLASS, \
+ LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, \
+ CLASS, \
+ LOCK)
+#else /* TAO_FTRTEVENT_BUILD_DLL */
+#define TAO_FtRtEvent_Export \
+ ACE_Proper_Import_Flag
+#define TAO_FTRTEVENT_SINGLETON_DECLARATION (T) ACE_IMPORT_SINGLETON_DECLARATION(T)
+#define TAO_FTRTEVENT_SINGLETON_DECLARE (SINGLETON_TYPE, \
+ CLASS, \
+ LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, \
+ CLASS, \
+ LOCK)
+#endif /* TAO_FTRTEVENT_BUILD_DLL */
+#else /* TAO_FTRTEVENT_HAS_DLL == 1 */
+#define TAO_FtRtEvent_Export
+#define TAO_FTRTEVENT_SINGLETON_DECLARATION(T)
+#define TAO_FTRTEVENT_SINGLETON_DECLARE (SINGLETON_TYPE, \
+ CLASS, \
+ LOCK)
+#endif /* TAO_FTRTEVENT_HAS_DLL == 1 */
+
+// Set TAO_FTRTEVENT_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined(TAO_FTRTEVENT_NTRACE)
+#if (ACE_NTRACE == 1)
+#define TAO_FTRTEVENT_NTRACE 1
+#else /* (ACE_NTRACE == 1) */
+#define TAO_FTRTEVENT_NTRACE 0
+#endif /* (ACE_NTRACE == 1) */
+#endif /* !TAO_FTRTEVENT_NTRACE */
+
+#if (TAO_FTRTEVENT_NTRACE == 1)
+#define TAO_FTRTEVENT_TRACE(X)
+#else /* (TAO_FTRTEVENT_NTRACE == 1) */
+#if !defined(ACE_HAS_TRACE)
+#define ACE_HAS_TRACE
+#endif /* ACE_HAS_TRACE */
+#define TAO_FTRTEVENT_TRACE(X) ACE_TRACE_IMPL(X)
+#include "ace/Trace.h"
+#endif /* (TAO_FTRTEVENT_NTRACE == 1) */
+#endif /* TAO_FTRTEVENT_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/resolve_init.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/resolve_init.h
new file mode 100644
index 00000000000..c489912d527
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/resolve_init.h
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file resolve_init.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+#ifndef RESOVLE_INIT_H
+#define RESOVLE_INIT_H
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class T>
+typename T::_ptr_type
+resolve_init (CORBA::ORB_ptr orb,
+ const char *id ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+{
+ typename T::_var_type ref;
+ CORBA::Object_var obj;
+ ACE_TRY
+ {
+ CORBA::Object_var obj;
+ obj = orb->resolve_initial_references(id ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ref = T::_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+ }
+
+ ACE_CATCHANY
+ {
+ ACE_ERROR((
+ LM_ERROR,
+ " (%P|%t) Unable to initialize %s.\n",
+ id
+ ));
+ if (!CORBA::is_nil(obj.in()))
+ ACE_ERROR((
+ LM_ERROR,
+ " due to narrowing problem\n"
+ ));
+ ACE_RE_THROW;
+ }
+
+ ACE_ENDTRY;
+ return ref._retn();
+}
+
+#ifdef TAO_Naming_Export
+template<class T>
+typename T::_ptr_type
+resolve (CosNaming::NamingContext_ptr context,
+ const CosNaming::Name &id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+{
+ CORBA::Object_var obj;
+ obj = context->resolve(id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(T::_nil());
+
+ ACE_ASSERT(!CORBA::is_nil(obj.in()));
+
+ typename T::_var_type ref = T::_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+ return ref._retn();
+}
+#endif
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/FtRtecEventChannelAdmin.idl b/TAO/orbsvcs/orbsvcs/FtRtecEventChannelAdmin.idl
new file mode 100644
index 00000000000..866640ef114
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtecEventChannelAdmin.idl
@@ -0,0 +1,194 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file FtRtecEventChannelAdmin.idl
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang
+ */
+//=============================================================================
+
+#ifndef TAO_FTRTEC_EVENTCHANNELADMIN_IDL
+#define TAO_FTRTEC_EVENTCHANNELADMIN_IDL
+
+#include "orbsvcs/RtecEventChannelAdmin.idl"
+#include "FTRT.idl"
+#include "FTRT_GroupManager.idl"
+#include "FtRtecEventComm.idl"
+
+module FtRtecEventChannelAdmin
+{
+ typedef FtRtecEventComm::ObjectId ObjectId;
+
+ struct ProxyPushConsumerConnectionInfo
+ {
+ RtecEventComm::PushSupplier push_supplier;
+ RtecEventChannelAdmin::SupplierQOS qos;
+ };
+
+ union ProxyPushConsumerConnectionParamter switch (boolean)
+ {
+ case FALSE:
+ case TRUE:
+ ProxyPushConsumerConnectionInfo info;
+ };
+
+ struct ProxyPushConsumerStat
+ {
+ ObjectId object_id;
+ ProxyPushConsumerConnectionParamter parameter;
+ };
+
+
+ struct ProxyPushSupplierConnectionInfo
+ {
+ RtecEventComm::PushConsumer push_consumer;
+ RtecEventChannelAdmin::ConsumerQOS qos;
+ };
+
+ union ProxyPushSupplierConnectionParamter switch (boolean)
+ {
+ case FALSE:
+ case TRUE:
+ ProxyPushSupplierConnectionInfo info;
+ };
+
+ struct ProxyPushSupplierStat
+ {
+ ObjectId object_id;
+ boolean suspended;
+ ProxyPushSupplierConnectionParamter parameter;
+ };
+
+ typedef sequence<ProxyPushConsumerStat> ProxyConsumerStates;
+ typedef sequence<ProxyPushSupplierStat> ProxySupplierStates;
+
+ struct ConsumerAdminState
+ {
+ ProxySupplierStates proxies;
+ };
+
+ struct SupplierAdminState
+ {
+ ProxyConsumerStates proxies;
+ };
+
+ struct CachedResult
+ {
+ long retention_id;
+ any result;
+ };
+
+
+ struct CacheEntry
+ {
+ string client_id;
+ CachedResult cached_result;
+ };
+
+ typedef sequence<CacheEntry> CachedOptionResults;
+
+ struct EventChannelState
+ {
+ CachedOptionResults cached_operation_results;
+ SupplierAdminState supplier_admin_state;
+ ConsumerAdminState consumer_admin_state;
+ };
+
+ struct Connect_push_consumer_param
+ {
+ RtecEventComm::PushConsumer push_consumer;
+ RtecEventChannelAdmin::ConsumerQOS qos;
+ };
+
+ struct Connect_push_supplier_param
+ {
+ RtecEventComm::PushSupplier push_supplier;
+ RtecEventChannelAdmin::SupplierQOS qos;
+ };
+
+ enum OperationType {
+ OBTAIN_PUSH_SUPPLIER,
+ OBTAIN_PUSH_CONSUMER,
+ DISCONNECT_PUSH_SUPPLIER,
+ DISCONNECT_PUSH_CONSUMER,
+ SUSPEND_CONNECTION,
+ RESUME_CONNECTION,
+ CONNECT_PUSH_SUPPLIER,
+ CONNECT_PUSH_CONSUMER
+ };
+
+ union OperationParam switch(OperationType) {
+ case CONNECT_PUSH_SUPPLIER:
+ Connect_push_supplier_param connect_supplier_param;
+ case CONNECT_PUSH_CONSUMER:
+ Connect_push_consumer_param connect_consumer_param;
+ };
+
+
+ struct Operation {
+ ObjectId object_id;
+ OperationParam param;
+ };
+
+ interface EventChannelFacade : FtRtecEventComm::PushConsumer {
+ /**
+ * Directly connect to push consumer. This method is
+ * equivalent to the effect of executing the following
+ * 3 methods.
+ *
+ * consumer_admin = ec->for_consumers();
+ * proxy_supplier = consumer_admin->obtain_push_supplier();
+ * proxy_supplier->connect_push_consumer(push_consumer,
+ * qos);
+ *
+ * @returns the ObjectId of proxy_push_supplier
+ */
+ ObjectId connect_push_consumer(
+ in RtecEventComm::PushConsumer push_consumer,
+ in RtecEventChannelAdmin::ConsumerQOS qos)
+ raises(RtecEventChannelAdmin::TypeError);
+
+ /**
+ * Directly connect to push supplier. This method is
+ * equivalent to the effect of executing the following
+ * 3 methods.
+ *
+ * supplier_admin = ec->for_suppliers();
+ * push_consumer = supplier_admin->obtain_push_supplier();
+ * push_consumer->connect_push_consumer(proxy_supplier,
+ * qos);
+ *
+ * @returns the ObjectId of proxy_push_consumer
+ */
+ ObjectId connect_push_supplier(
+ in RtecEventComm::PushSupplier push_supplier,
+ in RtecEventChannelAdmin::SupplierQOS qos);
+
+ void disconnect_push_supplier(in ObjectId oid)
+ raises(FtRtecEventComm::InvalidObjectID);
+ void disconnect_push_consumer(in ObjectId oid)
+ raises(FtRtecEventComm::InvalidObjectID);
+ void suspend_push_supplier(in ObjectId oid)
+ raises(FtRtecEventComm::InvalidObjectID);
+ void resume_push_supplier(in ObjectId oid)
+ raises(FtRtecEventComm::InvalidObjectID);
+ };
+
+ exception InvalidState{};
+
+ interface EventChannel : RtecEventChannelAdmin::EventChannel
+ , EventChannelFacade
+ , FTRT::Updateable
+ , FTRT::ObjectGroupManager
+ {
+ };
+
+ typedef sequence<EventChannel> EventChannelList;
+
+};
+
+#endif
+
diff --git a/TAO/orbsvcs/orbsvcs/FtRtecEventComm.idl b/TAO/orbsvcs/orbsvcs/FtRtecEventComm.idl
new file mode 100644
index 00000000000..a1406158952
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtRtecEventComm.idl
@@ -0,0 +1,32 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file FtRtecEventComm.idl
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang
+ */
+//=============================================================================
+
+#ifndef FTRTECEVNETCOMM_H
+#define FTRTECEVNETCOMM_H
+
+#include "orbsvcs/RtecEventComm.idl"
+
+module FtRtecEventComm {
+
+ typedef sequence<octet> ObjectId;
+
+ exception InvalidObjectID {
+ };
+
+ interface PushConsumer {
+ void push(in ObjectId oid, in RtecEventComm::EventSet data)
+ raises(InvalidObjectID);
+ };
+
+};
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/GSSUP.idl b/TAO/orbsvcs/orbsvcs/GSSUP.idl
new file mode 100644
index 00000000000..4bb8ed232bc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/GSSUP.idl
@@ -0,0 +1,63 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file GSSUP.idl
+ *
+ * $Id$
+ *
+ * @author Object Management Group
+ */
+//=============================================================================
+
+#ifndef _GSSUP_IDL_
+#define _GSSUP_IDL_
+
+#include <CSI.idl>
+//import ::CSI;
+
+module GSSUP {
+ typeprefix GSSUP "omg.org";
+ // The GSS Object Identifier allocated for the
+ // username/password mechanism is defined below.
+ //
+ // { iso-itu-t (2) international-organization (23) omg (130)
+ // security (1) authentication (1) gssup-mechanism (1) }
+ const CSI::StringOID GSSUPMechOID = "oid:2.23.130.1.1.1";
+
+ // The following structure defines the inner contents of the
+ // username password initial context token. This structure is
+ // CDR encapsulated and appended at the end of the
+ // username/password GSS (initial context) Token.
+ struct InitialContextToken {
+ CSI::UTF8String username;
+ CSI::UTF8String password;
+ CSI::GSS_NT_ExportedName target_name;
+ };
+
+ typedef unsigned long ErrorCode;
+
+ // GSSUP Mechanism-Specific Error Token
+ struct ErrorToken {
+ ErrorCode error_code;
+ };
+
+ // The context validator has chosen not to reveal the GSSUP
+ // specific cause of the failure.
+ const ErrorCode GSS_UP_S_G_UNSPECIFIED = 1;
+
+ // The user identified in the username field of the
+ // GSSUP::InitialContextToken is unknown to the target.
+ const ErrorCode GSS_UP_S_G_NOUSER = 2;
+
+ // The password supplied in the GSSUP::InitialContextToken was
+ // incorrect.
+ const ErrorCode GSS_UP_S_G_BAD_PASSWORD = 3;
+
+ // The target_name supplied in the GSSUP::InitialContextToken does
+ // not match a target_name in a mechanism definition of the target.
+ const ErrorCode GSS_UP_S_G_BAD_TARGET = 4;
+
+}; // GSSUP
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP.idl b/TAO/orbsvcs/orbsvcs/HTIOP.idl
new file mode 100644
index 00000000000..5dc61ec8cbf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP.idl
@@ -0,0 +1,30 @@
+// -*- IDL -*-
+//
+// $Id$
+
+#ifndef HTIOP_IDL
+#define HTIOP_IDL
+
+// This is a OMG specified IDL. When HTIOP modules start getting
+// complicated we may want to have them here.
+#pragma prefix "omg.org"
+
+
+module HTIOP
+{
+ struct ListenPoint
+ {
+ string host;
+ unsigned short port;
+ string htid;
+ };
+
+ typedef sequence<ListenPoint> ListenPointList;
+
+ struct BiDirHTIOPServiceContext
+ {
+ ListenPointList listen_points;
+ };
+};
+
+#endif /* TAO_IIOP_PIDL */
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP.mpc b/TAO/orbsvcs/orbsvcs/HTIOP.mpc
new file mode 100644
index 00000000000..5494d71ef4f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP.mpc
@@ -0,0 +1,29 @@
+// -*- MPC -*-
+//
+// $Id$
+
+project : htbp, orbsvcslib, core, tao_versioning_idl_defaults {
+ sharedname = TAO_HTIOP
+ idlflags += -Wb,export_macro=HTIOP_Export -Wb,export_include=orbsvcs/HTIOP/HTIOP_Export.h -SS
+ dynamicflags = HTIOP_BUILD_DLL
+ tagchecks += HTIOP
+ pch_header =
+ pch_source =
+
+ IDL_FILES {
+ HTIOP.idl
+ }
+
+ IDL_Files {
+ idlflags += -Sci -Gp -Gd -Ge 1 -Sc -Sa -Sorb \
+ -o HTIOP
+ idlflags -= -St
+ HTIOP/htiop_endpoints.pidl
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ HTIOP {
+ HTIOP
+ }
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.cpp b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.cpp
new file mode 100644
index 00000000000..4d0bed9f1f8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.cpp
@@ -0,0 +1,889 @@
+// This may look like C, but it's really -*- C++ -*-
+// $Id$
+
+#include "orbsvcs/HTIOP/HTIOP_Acceptor.h"
+#include "orbsvcs/HTIOP/HTIOP_Profile.h"
+#include "ace/HTBP/HTBP_Environment.h"
+#include "ace/HTBP/HTBP_ID_Requestor.h"
+
+#include "tao/MProfile.h"
+#include "tao/ORB_Core.h"
+#include "tao/Server_Strategy_Factory.h"
+#include "tao/debug.h"
+#include "tao/CDR.h"
+#include "tao/Codeset_Manager.h"
+
+#include "ace/Auto_Ptr.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/HTIOP/HTIOP_Acceptor.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(HTIOP,
+ TAO_HTIOP_Acceptor,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::HTIOP::Acceptor::Acceptor (ACE::HTBP::Environment *ht_env,
+ int is_inside)
+ : TAO_Acceptor (OCI_TAG_HTIOP_PROFILE),
+ addrs_ (0),
+ hosts_ (0),
+ endpoint_count_ (0),
+ hostname_in_ior_ (0),
+ version_ (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR),
+ orb_core_ (0),
+ base_acceptor_ (),
+ creation_strategy_ (0),
+ concurrency_strategy_ (0),
+ accept_strategy_ (0),
+ ht_env_ (ht_env),
+ inside_ (is_inside)
+{
+}
+
+TAO::HTIOP::Acceptor::~Acceptor (void)
+{
+ // Make sure we are closed before we start destroying the
+ // strategies.
+ this->close ();
+
+ delete this->creation_strategy_;
+ delete this->concurrency_strategy_;
+ delete this->accept_strategy_;
+
+ delete [] this->addrs_;
+
+ for (CORBA::ULong i = 0; i < this->endpoint_count_; ++i)
+ CORBA::string_free (this->hosts_[i]);
+
+ delete [] this->hosts_;
+}
+
+// TODO =
+// 2) For V1.[1,2] there are tagged components
+int
+TAO::HTIOP::Acceptor::create_profile (const TAO::ObjectKey &object_key,
+ TAO_MProfile &mprofile,
+ CORBA::Short priority)
+{
+ // Sanity check.
+ if (this->endpoint_count_ == 0)
+ return -1;
+
+ // Check if multiple endpoints should be put in one profile or
+ // if they should be spread across multiple profiles.
+
+ if (priority == TAO_INVALID_PRIORITY
+ /* && this->orb_core_->orb_params()->shared_profile () == 0 */)
+
+ return this->create_new_profile (object_key,
+ mprofile,
+ priority);
+ else
+ return this->create_shared_profile (object_key,
+ mprofile,
+ priority);
+}
+
+int
+TAO::HTIOP::Acceptor::create_new_profile (const TAO::ObjectKey &object_key,
+ TAO_MProfile &mprofile,
+ CORBA::Short priority)
+{
+ // Adding this->endpoint_count_ to the TAO_MProfile.
+ int count = mprofile.profile_count ();
+ if ((mprofile.size () - count) < this->endpoint_count_
+ && mprofile.grow (count + this->endpoint_count_) == -1)
+ return -1;
+
+ // Create a profile for each acceptor endpoint.
+ for (CORBA::ULong i = 0; i < this->endpoint_count_; ++i)
+ {
+ TAO::HTIOP::Profile *pfile = 0;
+ ACE_NEW_RETURN (pfile,
+ TAO::HTIOP::Profile (this->hosts_[i],
+ this->addrs_[i].get_port_number (),
+ this->addrs_[i].get_htid(),
+ object_key,
+ this->addrs_[i],
+ this->version_,
+ this->orb_core_),
+ -1);
+ pfile->endpoint ()->priority (priority);
+
+ if (mprofile.give_profile (pfile) == -1)
+ {
+ pfile->_decr_refcnt ();
+ pfile = 0;
+ return -1;
+ }
+
+ // Do not add any tagged components to the profile if configured
+ // by the user not to do so, or if an TAO_HTIOP 1.0 endpoint is being
+ // created (TAO_HTIOP 1.0 did not support tagged components).
+ if (this->orb_core_->orb_params ()->std_profile_components () == 0
+ || (this->version_.major == 1 && this->version_.minor == 0))
+ continue;
+
+ pfile->tagged_components ().set_orb_type (TAO_ORB_TYPE);
+
+ TAO_Codeset_Manager *csm = this->orb_core_->codeset_manager();
+ if (csm)
+ csm->set_codeset(pfile->tagged_components());
+ }
+
+ return 0;
+}
+
+int
+TAO::HTIOP::Acceptor::create_shared_profile (const TAO::ObjectKey &object_key,
+ TAO_MProfile &mprofile,
+ CORBA::Short priority)
+{
+ CORBA::ULong index = 0;
+ TAO_Profile *pfile = 0;
+ TAO::HTIOP::Profile *htiop_profile = 0;
+
+ // First see if <mprofile> already contains a TAO_HTIOP profile.
+ for (TAO_PHandle i = 0; i != mprofile.profile_count (); ++i)
+ {
+ pfile = mprofile.get_profile (i);
+ if (pfile->tag () == OCI_TAG_HTIOP_PROFILE)
+ {
+ htiop_profile = dynamic_cast<TAO::HTIOP::Profile *> (pfile);
+ break;
+ }
+ }
+
+ // If <mprofile> doesn't contain a TAO::HTIOP::Profile, we need to create
+ // one.
+ if (htiop_profile == 0)
+ {
+ ACE_NEW_RETURN (htiop_profile,
+ TAO::HTIOP::Profile (this->hosts_[0],
+ this->addrs_[0].get_port_number (),
+ this->addrs_[0].get_htid(),
+ object_key,
+ this->addrs_[0],
+ this->version_,
+ this->orb_core_),
+ -1);
+ htiop_profile->endpoint ()->priority (priority);
+
+ if (mprofile.give_profile (htiop_profile) == -1)
+ {
+ htiop_profile->_decr_refcnt ();
+ htiop_profile = 0;
+ return -1;
+ }
+
+ // Do not add any tagged components to the profile if configured
+ // by the user not to do so, or if an HTIOP 1.0 endpoint is being
+ // created (HTIOP 1.0 did not support tagged components).
+ if (this->orb_core_->orb_params ()->std_profile_components () != 0
+ && (this->version_.major >= 1 && this->version_.minor >= 1))
+ {
+ htiop_profile->tagged_components ().set_orb_type (TAO_ORB_TYPE);
+ TAO_Codeset_Manager *csm = this->orb_core_->codeset_manager();
+ if (csm)
+ csm->set_codeset(htiop_profile->tagged_components());
+ }
+
+ index = 1;
+ }
+
+ // Add any remaining acceptor endpoints to the TAO::HTIOP::Profile.
+ for (;
+ index < this->endpoint_count_;
+ ++index)
+ {
+ TAO::HTIOP::Endpoint *endpoint = 0;
+ ACE_NEW_RETURN (endpoint,
+ TAO::HTIOP::Endpoint (this->hosts_[index],
+ this->addrs_[index].get_port_number (),
+ this->addrs_[index].get_htid(),
+ this->addrs_[index]),
+ -1);
+ endpoint->priority (priority);
+ htiop_profile->add_endpoint (endpoint);
+ }
+
+ return 0;
+}
+
+int
+TAO::HTIOP::Acceptor::is_collocated (const TAO_Endpoint *endpoint)
+{
+ const TAO::HTIOP::Endpoint *endp =
+ dynamic_cast<const TAO::HTIOP::Endpoint *> (endpoint);
+
+ // Make sure the dynamically cast pointer is valid.
+ if (endp == 0)
+ return 0;
+
+ for (CORBA::ULong i = 0; i < this->endpoint_count_; ++i)
+ {
+ // compare the port and host name. Please do *NOT* optimize
+ // this code by comparing the IP address instead. That would
+ // trigger the following bug:
+ //
+ // http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=1220
+ //
+ if (endp->port() == this->addrs_[i].get_port_number())
+ if (endp->port() == 0)
+ return (ACE_OS::strcmp (endp->htid(),
+ this->addrs_[i].get_htid()) == 0);
+ else
+ return (ACE_OS::strcmp(endp->host(), this->hosts_[i]) == 0);
+ // return 1;
+ }
+
+ return 0;
+}
+
+int
+TAO::HTIOP::Acceptor::close (void)
+{
+ return this->base_acceptor_.close ();
+}
+
+int
+TAO::HTIOP::Acceptor::open (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
+ int major,
+ int minor,
+ const char *address,
+ const char *options)
+{
+ this->orb_core_ = orb_core;
+
+ if (this->hosts_ != 0)
+ {
+ // The hostname cache has already been set!
+ // This is bad mojo, i.e. an internal TAO error.
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) ")
+ ACE_TEXT ("TAO::HTIOP::Acceptor::open - ")
+ ACE_TEXT ("hostname already set\n\n")),
+ -1);
+ }
+
+ ACE_CString proxy_host;
+ unsigned proxy_port = 0;
+
+ int rp = this->ht_env_->get_proxy_port(proxy_port);
+ if (rp == 0 && proxy_port != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) ")
+ ACE_TEXT ("TAO::HTIOP::Acceptor::open - ")
+ ACE_TEXT ("explicit endpoint inside proxy, port %d\n"),
+ proxy_port),
+ -1);
+
+ if (address == 0)
+ return -1;
+
+ if (major >=0 && minor >= 0)
+ this->version_.set_version (static_cast<CORBA::Octet> (major),
+ static_cast<CORBA::Octet> (minor));
+ // Parse options
+ if (this->parse_options (options) == -1)
+ return -1;
+
+ ACE::HTBP::Addr addr;
+
+ // @ Mostly the address is just a host:port but in case it is
+ // host:port#token, remove the #token before this is processed
+ // - priyanka
+ address = ACE_OS::strtok (const_cast<char *> (address), "#");
+
+ // In the common scenario, Acceptor is in the server that is
+ // outside the firewall. It means the address that is sent to
+ // us can be a ACE::HTBP::Outside_Addr which is of the form
+ // host:port:token. The last :token has to be taken into
+ // consideration.
+ const char *port_separator_loc = ACE_OS::strchr (address, ':');
+
+ const char *specified_hostname = 0;
+ char tmp_host[MAXHOSTNAMELEN + 1];
+
+ if (port_separator_loc == address)
+ {
+ // The address is a port number or port name. No hostname was
+ // specified. The hostname for each network interface and the
+ // fully qualified domain name must be obtained.
+
+ // ie. the address can be :port:token or just :port:
+
+ // Check for multiple network interfaces.
+ if (this->probe_interfaces (orb_core) == -1)
+ return -1;
+
+ // First convert the port into a usable form.
+ if (addr.ACE_INET_Addr::set (address + sizeof (':')) != 0)
+ return -1;
+
+ // Now reset the port and set the host.
+ if (addr.ACE_INET_Addr::set (addr.get_port_number (),
+ static_cast<ACE_UINT32> (INADDR_ANY),
+ 1) != 0)
+ return -1;
+ else
+ {
+ return this->open_i (addr,
+ reactor);
+ }
+ }
+ else if (port_separator_loc == 0)
+ {
+ // The address is a hostname. No port was specified, so assume
+ // port zero (port will be chosen for us).
+ if (addr.ACE_INET_Addr::set ((unsigned short) 0, address) != 0)
+ return -1;
+
+ specified_hostname = address;
+ }
+ else
+ {
+ // Host and port were specified.
+ if (addr.ACE_INET_Addr::set (address) != 0)
+ return -1;
+
+ // Extract out just the host part of the address.
+ size_t len = port_separator_loc - address;
+ ACE_OS::memcpy (tmp_host, address, len);
+ tmp_host[len] = '\0';
+
+ specified_hostname = tmp_host;
+ }
+
+ this->endpoint_count_ = 1; // Only one hostname to store
+
+ ACE_NEW_RETURN (this->addrs_,
+ ACE::HTBP::Addr[this->endpoint_count_],
+ -1);
+
+ ACE_NEW_RETURN (this->hosts_,
+ char *[this->endpoint_count_],
+ -1);
+
+ this->hosts_[0] = 0;
+
+ if (this->hostname_in_ior_ != 0)
+ {
+ if (TAO_debug_level > 2)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Overriding address in IOR with %s\n"),
+ this->hostname_in_ior_));
+ }
+
+ if (this->hostname (orb_core,
+ addr,
+ this->hosts_[0],
+ this->hostname_in_ior_) != 0)
+ return -1;
+ }
+ else
+ {
+ if (this->hostname (orb_core,
+ addr,
+ this->hosts_[0],
+ specified_hostname) != 0)
+ return -1;
+ }
+
+ // Copy the addr. The port is (re)set in
+ // TAO::HTIOP::Acceptor::open_i().
+ if (this->addrs_[0].ACE_INET_Addr::set (addr) != 0)
+ return -1;
+
+ return this->open_i (addr,
+ reactor);
+}
+
+int
+TAO::HTIOP::Acceptor::open_default (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
+ int major,
+ int minor,
+ const char *options)
+{
+ this->orb_core_ = orb_core;
+
+ if (this->hosts_ != 0)
+ {
+ // The hostname cache has already been set!
+ // This is bad mojo, i.e. an internal TAO error.
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) ")
+ ACE_TEXT ("TAO::HTIOP::Acceptor::open_default - ")
+ ACE_TEXT ("hostname already set\n\n")),
+ -1);
+ }
+
+ if (major >=0 && minor >= 0)
+ this->version_.set_version (static_cast<CORBA::Octet> (major),
+ static_cast<CORBA::Octet> (minor));
+
+ // Parse options
+ if (this->parse_options (options) == -1)
+ return -1;
+
+
+ unsigned proxy_port = 0;
+ if (this->inside_ == 1 ||
+ (this->inside_ == -1 &&
+ this->ht_env_->get_proxy_port(proxy_port) == 0 &&
+ proxy_port != 0))
+ {
+ this->endpoint_count_ = 1;
+ ACE_NEW_RETURN (this->addrs_,
+ ACE::HTBP::Addr[this->endpoint_count_],
+ -1);
+
+ ACE_NEW_RETURN (this->hosts_,
+ char *[this->endpoint_count_],
+ -1);
+
+ ACE_OS::memset (this->hosts_, 0,
+ sizeof (char*) * this->endpoint_count_);
+
+ ACE::HTBP::ID_Requestor req(ht_env_);
+ this->addrs_[0] = req.get_HTID();
+ return 0;
+
+ }
+
+ // Check for multiple network interfaces.
+ if (this->probe_interfaces (orb_core) == -1)
+ return -1;
+
+ // Now that each network interface's hostname has been cached, open
+ // an endpoint on each network interface using the INADDR_ANY
+ // address.
+ ACE::HTBP::Addr addr;
+
+ if (addr.ACE_INET_Addr::set (static_cast<u_short> (0),
+ static_cast<ACE_UINT32> (INADDR_ANY),
+ 1) != 0)
+ return -1;
+
+ return this->open_i (addr,
+ reactor);
+}
+
+int
+TAO::HTIOP::Acceptor::open_i (const ACE::HTBP::Addr& addr,
+ ACE_Reactor *reactor)
+{
+ ACE_NEW_RETURN (this->creation_strategy_,
+ CREATION_STRATEGY (this->orb_core_,0),
+ -1);
+
+ ACE_NEW_RETURN (this->concurrency_strategy_,
+ CONCURRENCY_STRATEGY (),
+ -1);
+
+ ACE_NEW_RETURN (this->accept_strategy_,
+ ACCEPT_STRATEGY (this->orb_core_),
+ -1);
+
+ if (this->base_acceptor_.open (addr,
+ reactor,
+ this->creation_strategy_,
+ this->accept_strategy_,
+ this->concurrency_strategy_) == -1)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) TAO::HTIOP::Acceptor::open_i ")
+ ACE_TEXT ("- %p"),
+ ACE_TEXT ("cannot open acceptor")));
+ return -1;
+ }
+
+ ACE::HTBP::Addr address;
+
+ // We do this make sure the port number the endpoint is listening on
+ // gets set in the addr.
+ if (this->accept_strategy_->acceptor ().get_local_addr (address) != 0)
+ {
+ // @@ Should this be a catastrophic error???
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) TAO::HTIOP::Acceptor::open_i ")
+ ACE_TEXT ("- %p\n\n"),
+ ACE_TEXT ("cannot get local addr")));
+ return -1;
+ }
+
+ // Set the port for each addr. If there is more than one network
+ // interface then the endpoint created on each interface will be on
+ // the same port. This is how a wildcard socket bind() is supposed
+ // to work.
+ u_short port = address.get_port_number ();
+
+ for (CORBA::ULong j = 0; j < this->endpoint_count_; ++j)
+ this->addrs_[j].set_port_number (port, 1);
+
+ (void) this->accept_strategy_->acceptor().enable (ACE_CLOEXEC);
+
+ // This avoids having child processes acquire the listen socket thereby
+ // denying the server the opportunity to restart on a well-known endpoint.
+ // This does not affect the aberrent behavior on Win32 platforms.
+
+ if (TAO_debug_level > 5)
+ {
+ for (CORBA::ULong i = 0; i < this->endpoint_count_; ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) TAO::HTIOP::Acceptor::open_i - ")
+ ACE_TEXT ("listening on: <%s:%u>\n"),
+ ACE_TEXT_CHAR_TO_TCHAR(this->hosts_[i]),
+ this->addrs_[i].get_port_number ()));
+ }
+ }
+
+ return 0;
+}
+
+int
+TAO::HTIOP::Acceptor::hostname (TAO_ORB_Core *orb_core,
+ ACE_INET_Addr &addr,
+ char *&host,
+ const char *specified_hostname)
+{
+ if (orb_core->orb_params ()->use_dotted_decimal_addresses ())
+ {
+ // If dotted decimal addresses are enabled,
+ // just return ours.
+ return this->dotted_decimal_address (addr, host);
+ }
+ else if (specified_hostname != 0)
+ {
+ // If the user specified a hostname, pass it back
+ // blindly as it overrides our choice of hostname.
+ host = CORBA::string_dup (specified_hostname);
+ }
+ else
+ {
+ char tmp_host[MAXHOSTNAMELEN + 1];
+
+ // Get the hostname associated with our address
+ if (addr.get_host_name (tmp_host, sizeof (tmp_host)) != 0)
+ {
+ // On failure, just return the decimal address.
+ return this->dotted_decimal_address (addr, host);
+ }
+ else
+ {
+ host = CORBA::string_dup (tmp_host);
+ }
+ }
+
+ return 0;
+}
+
+int
+TAO::HTIOP::Acceptor::dotted_decimal_address (ACE_INET_Addr &addr,
+ char *&host)
+{
+ int result = 0;
+ const char *tmp = 0;
+
+ // If the IP address in the INET_Addr is the INADDR_ANY address,
+ // then force the actual IP address to be used by initializing a new
+ // INET_Addr with the hostname from the original one. If that fails
+ // then something is seriously wrong with the systems networking
+ // setup.
+ if (addr.get_ip_address () == INADDR_ANY)
+ {
+ ACE::HTBP::Addr new_addr;
+ result = new_addr.ACE_INET_Addr::set (addr.get_port_number (),
+ addr.get_host_name ());
+ tmp = new_addr.get_host_addr ();
+ }
+ else
+ tmp = addr.get_host_addr ();
+
+ if (tmp == 0 || result != 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\n\nTAO (%P|%t) ")
+ ACE_TEXT ("TAO::HTIOP::Acceptor::dotted_decimal_address ")
+ ACE_TEXT ("- %p\n\n"),
+ ACE_TEXT ("cannot determine hostname")));
+ return -1;
+ }
+
+ host = CORBA::string_dup (tmp);
+ return 0;
+}
+
+
+int
+TAO::HTIOP::Acceptor::probe_interfaces (TAO_ORB_Core *orb_core)
+{
+ // Extract the hostname for each network interface, and then cache
+ // it. The hostnames will then be used when creating a
+ // TAO::HTIOP::Profile for each endpoint setup on the probed
+ // network interfaces.
+ size_t if_cnt = 0;
+
+ ACE_INET_Addr *inet_addrs = 0;
+
+ if (ACE::get_ip_interfaces (if_cnt,
+ inet_addrs) != 0
+ && errno != ENOTSUP)
+ {
+ // In the case where errno == ENOTSUP, if_cnt and if_addrs will
+ // not be modified, and will each remain equal to zero. This
+ // causes the default interface to be used.
+ return -1;
+ }
+
+ if (if_cnt == 0 || inet_addrs == 0)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_WARNING,
+ ACE_TEXT ("TAO (%P|%t) Unable to probe network ")
+ ACE_TEXT ("interfaces. Using default.\n")));
+ }
+
+ if_cnt = 1; // Force the network interface count to be one.
+ delete [] inet_addrs;
+ ACE_NEW_RETURN (inet_addrs,
+ ACE_INET_Addr[if_cnt],
+ -1);
+ }
+
+ // Scan for the loopback interface since it shouldn't be included in
+ // the list of cached hostnames unless it is the only interface.
+ size_t lo_cnt = 0; // Loopback interface count
+ for (size_t j = 0; j < if_cnt; ++j)
+ if (inet_addrs[j].get_ip_address () == INADDR_LOOPBACK)
+ lo_cnt++;
+
+ // The instantiation for this template is in
+ // HTIOP/HTIOP_Connector.cpp.
+ ACE_Auto_Basic_Array_Ptr<ACE_INET_Addr> safe_if_addrs (inet_addrs);
+
+ // If the loopback interface is the only interface then include it
+ // in the list of interfaces to query for a hostname, otherwise
+ // exclude it from the list.
+ if (if_cnt == lo_cnt)
+ this->endpoint_count_ = static_cast<CORBA::ULong> (if_cnt);
+ else
+ this->endpoint_count_ = static_cast<CORBA::ULong> (if_cnt - lo_cnt);
+
+ ACE_NEW_RETURN (this->addrs_,
+ ACE::HTBP::Addr[this->endpoint_count_],
+ -1);
+
+ ACE_NEW_RETURN (this->hosts_,
+ char *[this->endpoint_count_],
+ -1);
+
+ ACE_OS::memset (this->hosts_, 0, sizeof (char*) * this->endpoint_count_);
+
+ // The number of hosts/interfaces we want to cache may not be the
+ // same as the number of detected interfaces so keep a separate
+ // count.
+ size_t host_cnt = 0;
+
+ for (size_t i = 0; i < if_cnt; ++i)
+ {
+ // Ignore any loopback interface if there are other
+ // non-loopback interfaces.
+ if (if_cnt != lo_cnt &&
+ inet_addrs[i].get_ip_address() == INADDR_LOOPBACK)
+ continue;
+
+ if (this->hostname_in_ior_ != 0)
+ {
+ if (TAO_debug_level > 2)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Overriding address in IOR with %s\n"),
+ this->hostname_in_ior_));
+ }
+ if (this->hostname (orb_core,
+ inet_addrs[i],
+ this->hosts_[host_cnt],
+ this->hostname_in_ior_) != 0)
+ return -1;
+ }
+ else
+ {
+ if (this->hostname (orb_core,
+ inet_addrs[i],
+ this->hosts_[host_cnt]) != 0)
+ return -1;
+ }
+
+ // Copy the addr. The port is (re)set in
+ // HTIOP_Acceptor::open_i().
+ if (this->addrs_[host_cnt].ACE_INET_Addr::set (inet_addrs[i]) != 0)
+ return -1;
+
+ host_cnt++;
+ }
+
+ return 0;
+}
+
+CORBA::ULong
+TAO::HTIOP::Acceptor::endpoint_count (void)
+{
+ return this->endpoint_count_;
+}
+
+int
+TAO::HTIOP::Acceptor::object_key (IOP::TaggedProfile &profile,
+ TAO::ObjectKey &object_key)
+{
+ // Create the decoding stream from the encapsulation in the buffer,
+#if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
+ TAO_InputCDR cdr (profile.profile_data.mb ());
+#else
+ TAO_InputCDR cdr (reinterpret_cast<char*> (profile.profile_data.get_buffer ()),
+ profile.profile_data.length ());
+#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
+
+ CORBA::Octet major;
+ CORBA::Octet minor = CORBA::Octet();
+
+ // Read the version. We just read it here. We don't*do any*
+ // processing.
+ if (!(cdr.read_octet (major)
+ && cdr.read_octet (minor)))
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) TAO::HTIOP::Acceptor::object_key")
+ ACE_TEXT (" - v%d.%d\n"),
+ major,
+ minor));
+ }
+ return -1;
+ }
+
+ CORBA::String_var host;
+ CORBA::UShort port = 0;
+
+ // Get host and port. No processing here too..
+ if (cdr.read_string (host.out ()) == 0
+ || cdr.read_ushort (port) == 0)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) TAO::HTIOP::Acceptor::object_key - ")
+ ACE_TEXT ("error while decoding host/port")));
+ }
+ return -1;
+ }
+
+ // ... and object key.
+ if ((cdr >> object_key) == 0)
+ return -1;
+
+ // We are NOT bothered about the rest.
+
+ return 1;
+}
+
+
+int
+TAO::HTIOP::Acceptor::parse_options (const char *str)
+{
+ if (str == 0)
+ return 0; // No options to parse. Not a problem.
+
+ // Use an option format similar to the one used for CGI scripts in
+ // HTTP URLs.
+ // e.g.: option1=foo&option2=bar
+
+ ACE_CString options (str);
+ size_t len = options.length ();
+ const char option_delimiter = '&';
+
+ // Count the number of options.
+ CORBA::ULong option_count = 1;
+ // Number of endpoints in the string (initialized to 1).
+
+ // Only check for endpoints after the protocol specification and
+ // before the object key.
+ for (size_t i = 0; i < len; ++i)
+ if (options[i] == option_delimiter)
+ option_count++;
+
+ // The idea behind the following loop is to split the options into
+ // (option, name) pairs.
+ // For example,
+ // `option1=foo&option2=bar'
+ // will be parsed into:
+ // `option1=foo'
+ // `option2=bar'
+
+ ACE_CString::size_type begin = 0;
+ ACE_CString::size_type end = 0;
+
+ for (CORBA::ULong j = 0; j < option_count; ++j)
+ {
+ if (j < option_count - 1)
+ end = options.find (option_delimiter, begin);
+ else
+ end = len;
+
+ if (end == begin)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Zero length HTIOP option.\n")),
+ -1);
+ else if (end != ACE_CString::npos)
+ {
+ ACE_CString opt = options.substring (begin, end);
+
+ ACE_CString::size_type const slot = opt.find ("=");
+
+ if (slot == len - 1
+ || slot == ACE_CString::npos)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) HTIOP option <%s> is ")
+ ACE_TEXT ("missing a value.\n"),
+ opt.c_str ()),
+ -1);
+
+ ACE_CString name = opt.substring (0, slot);
+ ACE_CString value = opt.substring (slot + 1);
+
+ if (name.length () == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Zero length HTIOP ")
+ ACE_TEXT ("option name.\n")),
+ -1);
+ else if (name == "hostname_in_ior")
+ {
+ this->hostname_in_ior_ = value.rep ();
+ }
+ else
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Invalid HTIOP option: <%s>\n"),
+ name.c_str ()),
+ -1);
+
+ begin = end + 1;
+ }
+ else
+ break; // No other options.
+ }
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.h b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.h
new file mode 100644
index 00000000000..6abbb6f23e9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.h
@@ -0,0 +1,239 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file HTIOP_Acceptor.h
+ *
+ * $Id$
+ *
+ * HTIOP specific acceptor processing
+ *
+ *
+ * @author Priyanka Gontla <gontla_p@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef HTIOP_ACCEPTOR_H
+#define HTIOP_ACCEPTOR_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/HTIOP/HTIOP_Completion_Handler.h"
+#include "orbsvcs/HTIOP/HTIOP_Connection_Handler.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/HTBP/HTBP_Addr.h"
+
+#include "tao/Acceptor_Impl.h"
+#include "tao/Transport_Acceptor.h"
+#include "tao/GIOP_Message_Version.h"
+#include "tao/Object_KeyC.h"
+
+#include "ace/SOCK_Acceptor.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+namespace ACE
+{
+ namespace HTBP
+ {
+ class Environment;
+ }
+}
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace HTIOP
+ {
+
+ // TAO HTIOP_Acceptor concrete call definition
+
+ /**
+ * @class HTIOP_Acceptor
+ *
+ * @brief HTIOP_Acceptor
+ *
+ * The HTIOP-specific bridge class for the concrete acceptor.
+ * Based on IIOP_Acceptor
+ */
+ class HTIOP_Export Acceptor : public TAO_Acceptor
+ {
+ public:
+ /// Constructor.
+ Acceptor (ACE::HTBP::Environment *ht_env,
+ int is_inside);
+
+ /// Destructor.
+ ~Acceptor (void);
+
+ /// @@ Helper method for the implementation repository, should go
+ /// away
+ const ACE::HTBP::Addr& address (void) const;
+
+ /// Returns the array of endpoints in this acceptor
+ const ACE::HTBP::Addr *endpoints (void);
+
+ typedef ACE_Strategy_Acceptor<Completion_Handler, ACE_SOCK_ACCEPTOR> BASE_ACCEPTOR;
+ typedef TAO_Creation_Strategy<Completion_Handler> CREATION_STRATEGY;
+ typedef ACE_Concurrency_Strategy<Completion_Handler> CONCURRENCY_STRATEGY;
+ typedef TAO_Accept_Strategy<Completion_Handler, ACE_SOCK_ACCEPTOR> ACCEPT_STRATEGY;
+
+ /**
+ * The TAO::Acceptor methods, check the documentation in
+ * Transport_Acceptor.h for details.
+ */
+ virtual int open (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
+ int version_major,
+ int version_minor,
+ const char *address,
+ const char *options = 0);
+
+ virtual int open_default (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
+ int version_major,
+ int version_minor,
+ const char *options = 0);
+
+ virtual int close (void);
+
+ virtual int create_profile (const TAO::ObjectKey &object_key,
+ TAO_MProfile &mprofile,
+ CORBA::Short priority);
+
+ virtual int is_collocated (const TAO_Endpoint *endpoint);
+
+ virtual CORBA::ULong endpoint_count (void);
+
+ virtual int object_key (IOP::TaggedProfile &profile,
+ TAO::ObjectKey &key);
+
+ /**
+ * Set the host name for the given addr.
+ * A hostname may be forced by using specified_hostname. This
+ * is useful if the given address corresponds to more than one
+ * hostname and the desired one cannot be determined in any
+ * other way.
+ */
+ int hostname (TAO_ORB_Core *orb_core,
+ ACE_INET_Addr &addr,
+ char *&host,
+ const char *specified_hostname = 0);
+
+ /**
+ * Set the host name for the given address using the dotted decimal
+ * format.
+ */
+ int dotted_decimal_address (ACE_INET_Addr &addr,
+ char *&host);
+
+ protected:
+
+ /**
+ * Implement the common part of the open*() methods. This method is
+ * virtual to allow a derived class implementation to be invoked
+ * instead.
+ */
+ virtual int open_i (const ACE::HTBP::Addr &addr,
+ ACE_Reactor *reactor);
+
+ /**
+ * Probe the system for available network interfaces, and initialize
+ * the <addrs_> array with an ACE::HTBP::Addr for each network
+ * interface. The port for each initialized ACE::HTBP::Addr will be
+ * set in the open_i() method. This method only gets invoked when
+ * no explicit hostname is provided in the specified endpoint.
+ */
+ int probe_interfaces (TAO_ORB_Core *orb_core);
+
+ /**
+ * Parse protocol specific options.
+ *
+ * Currently supported: hostname_in_ior -- Provides the means to add
+ * in an alternative hostname in the object reference, such as that
+ * of the outside of a firewall.
+ */
+ virtual int parse_options (const char *options);
+
+ /// Helper method to add a new profile to the mprofile for
+ /// each endpoint.
+ int create_new_profile (const TAO::ObjectKey &object_key,
+ TAO_MProfile &mprofile,
+ CORBA::Short priority);
+
+ /// Helper method to create a profile that contains all of
+ /// our endpoints.
+ int create_shared_profile (const TAO::ObjectKey &object_key,
+ TAO_MProfile &mprofile,
+ CORBA::Short priority);
+
+
+ protected:
+
+ /// Array of ACE::HTBP::Addr instances, each one corresponding to a
+ /// given network interface.
+ ACE::HTBP::Addr *addrs_;
+
+ /**
+ * Cache the information about the endpoints serviced by this
+ * acceptor.
+ * There may in fact be multiple hostnames for this endpoint. For
+ * example, if the IP address is INADDR_ANY (0.0.0.0) then there
+ * will be possibly a different hostname for each interface.
+ */
+ char **hosts_;
+
+ /// The number of host names cached in the hosts_ array (equivalent
+ /// to the number of endpoints opened by this Acceptor).
+ CORBA::ULong endpoint_count_;
+
+ /**
+ * Override the hostname used in the ORBEndPoint.
+ */
+ char *hostname_in_ior_;
+
+ /**
+ * The GIOP version for this endpoint
+ * @@ Theoretically they shouldn't be here!! We need to look at a
+ * way to move this out
+ */
+ TAO_GIOP_Message_Version version_;
+
+ /// ORB Core.
+ TAO_ORB_Core *orb_core_;
+
+ private:
+
+ /// the concrete acceptor, as a pointer to it's base class.
+ BASE_ACCEPTOR base_acceptor_;
+
+ /// Acceptor strategies.
+ CREATION_STRATEGY *creation_strategy_;
+ CONCURRENCY_STRATEGY *concurrency_strategy_;
+ ACCEPT_STRATEGY *accept_strategy_;
+
+ ACE::HTBP::Environment *ht_env_;
+
+ /// Flag used to determine if an acceptor should use an "inside"
+ /// local address, or try to compose an "outside" address.
+ /// If the value is 1, then always use an HTID for local addr,
+ /// otherwise use host:port if 0, or guess based on proxy config
+ /// if -1.
+ int inside_;
+ };
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/HTIOP/HTIOP_Acceptor.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* HTIOP_ACCEPTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.i b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.i
new file mode 100644
index 00000000000..6b3279c0c04
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.i
@@ -0,0 +1,28 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE const ACE::HTBP::Addr&
+TAO::HTIOP::Acceptor::address (void) const
+{
+ ACE_ASSERT (this->addrs_ != 0);
+
+ // @@ This is busted.
+ // The Implementation Repository will have to start supporting
+ // IORs with multiple profiles. For now, we just return the
+ // first addr.
+ // -Ossama
+ return this->addrs_[0];
+}
+
+ACE_INLINE const ACE::HTBP::Addr *
+TAO::HTIOP::Acceptor::endpoints (void)
+{
+ ACE_ASSERT (this->addrs_ != 0);
+
+ return this->addrs_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor_Impl.cpp b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor_Impl.cpp
new file mode 100644
index 00000000000..f990f16ce1b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor_Impl.cpp
@@ -0,0 +1,322 @@
+// $Id$
+
+#ifndef HTIOP_ACCEPTOR_IMPL_CPP
+#define HTIOP_ACCEPTOR_IMPL_CPP
+
+#include "orbsvcs/HTIOP/HTIOP_Acceptor_Impl.h"
+#include "orbsvcs/HTIOP/HTIOP_Completion_Handler.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/HTBP/HTBP_Stream.h"
+#include "ace/HTBP/HTBP_Session.h"
+
+#include "tao/ORB_Core.h"
+#include "tao/ORB_Table.h"
+#include "tao/Server_Strategy_Factory.h"
+#include "tao/Connector_Registry.h"
+#include "tao/Transport_Cache_Manager.h"
+#include "tao/Thread_Lane_Resources.h"
+
+#include "ace/Object_Manager.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+////////////////////////////////////////////////////////////////////////////////
+
+template <class SVC_HANDLER>
+TAO::HTIOP::Creation_Strategy<SVC_HANDLER>::Creation_Strategy (TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag)
+ : orb_core_ (orb_core),
+ lite_flag_ (flag)
+{
+}
+
+template <class SVC_HANDLER> int
+TAO::HTIOP::Creation_Strategy<SVC_HANDLER>::make_svc_handler (SVC_HANDLER *&sh)
+{
+ if (sh == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Make Svc Handler\n"));
+ ACE_NEW_RETURN (sh,
+ SVC_HANDLER (this->orb_core_),
+ -1);
+ }
+
+ return 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
+TAO::HTIOP::Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::Accept_Strategy (TAO_ORB_Core *orb_core)
+ : orb_core_ (orb_core)
+{
+}
+
+template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
+TAO::HTIOP::Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open (
+ const ACE_PEER_ACCEPTOR_ADDR &local_addr,
+ int restart)
+{
+ if (this->peer_acceptor_.open (local_addr, restart) == -1)
+ return -1;
+
+ this->peer_acceptor_.enable (ACE_NONBLOCK);
+
+ return 0;
+}
+
+
+/// Returns the underlying PEER_ACCEPTOR object
+template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ACE_PEER_ACCEPTOR &
+TAO::HTIOP::Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::acceptor (void) const
+{
+ return (ACE_PEER_ACCEPTOR &) this->peer_acceptor_;
+}
+
+/// Returns the underlying PEER_ACCEPTOR object
+template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ACE_HANDLE
+TAO::HTIOP::Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::get_handle (void) const
+{
+ return this->peer_acceptor_.get_handle ();
+}
+
+template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
+TAO::HTIOP::Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::accept_svc_handler (SVC_HANDLER *svc_handler)
+{
+ ACE_DEBUG ((LM_DEBUG, "accept_svc_handler\n"));
+ if (this->peer_acceptor_.accept (svc_handler->peer (),
+ 0,
+ 0,
+ 1,
+ 0 /* reset_new_handle */) == -1)
+ {
+ svc_handler->close (0);
+
+ return -1;
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "Accept_svc_handler, skipping first_recv\n"));
+ return 0;
+}
+
+template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
+TAO::HTIOP::Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::
+Strategy_Acceptor (const ACE_TCHAR service_name[],
+ const ACE_TCHAR service_description[],
+ int use_select,
+ int reuse_addr)
+
+{
+ ACE_UNUSED_ARG (service_name);
+ ACE_UNUSED_ARG (service_description);
+ ACE_UNUSED_ARG (use_select);
+ ACE_UNUSED_ARG (reuse_addr);
+}
+
+template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
+TAO::HTIOP::Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::shared_open (
+ const ACE_PEER_ACCEPTOR_ADDR &local_addr,
+ int protocol_family,
+ int backlog)
+{
+ int error = 0;
+#if defined (ACE_HAS_IPV6)
+ ACE_ASSERT (protocol_family == PF_INET || protocol_family == PF_INET6);
+
+ if (protocol_family == PF_INET6)
+ {
+ sockaddr_in6 local_inet6_addr;
+ ACE_OS::memset (reinterpret_cast<void *> (&local_inet6_addr),
+ 0,
+ sizeof local_inet6_addr);
+
+ if (local_addr == ACE_Addr::sap_any)
+ {
+ local_inet6_addr.sin6_family = AF_INET6;
+ local_inet6_addr.sin6_port = 0;
+ local_inet6_addr.sin6_addr = in6addr_any;
+ }
+ else
+ local_inet6_addr = *reinterpret_cast<sockaddr_in6 *> (local_addr.get_addr ());
+
+ // We probably don't need a bind_port written here.
+ // There are currently no supported OS's that define
+ // ACE_LACKS_WILDCARD_BIND.
+ if (ACE_OS::bind (this->get_handle (),
+ reinterpret_cast<sockaddr *> (&local_inet6_addr),
+ sizeof local_inet6_addr) == -1)
+ error = 1;
+ }
+ else
+#endif
+ if (protocol_family == PF_INET)
+ {
+ sockaddr_in local_inet_addr;
+ ACE_OS::memset (reinterpret_cast<void *> (&local_inet_addr),
+ 0,
+ sizeof local_inet_addr);
+
+ if (local_addr == ACE_Addr::sap_any)
+ {
+ local_inet_addr.sin_port = 0;
+ }
+ else
+ local_inet_addr = *reinterpret_cast<sockaddr_in *> (local_addr.get_addr ());
+ if (local_inet_addr.sin_port == 0)
+ {
+ if (ACE::bind_port (this->get_handle ()) == -1)
+ error = 1;
+ }
+ else if (ACE_OS::bind (this->get_handle (),
+ reinterpret_cast<sockaddr *> (&local_inet_addr),
+ sizeof local_inet_addr) == -1)
+ error = 1;
+ }
+ else if (ACE_OS::bind (this->get_handle (),
+ (sockaddr *) local_addr.get_addr (),
+ local_addr.get_size ()) == -1)
+ error = 1;
+
+ if (error != 0
+ || ACE_OS::listen (this->get_handle (),
+ backlog) == -1)
+ {
+ error = 1;
+ this->close ();
+ }
+
+ return error ? -1 : 0;
+}
+
+template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
+TAO::HTIOP::Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open(
+ const ACE_PEER_ACCEPTOR_ADDR &local_addr,
+ ACE_Reactor *reactor,
+ TAO::HTIOP::Creation_Strategy<SVC_HANDLER> * cre_s,
+ TAO::HTIOP::Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2> *acc_s,
+ ACE_Concurrency_Strategy<SVC_HANDLER> *con_s,
+ int reuse_addr)
+{
+ this->reactor (reactor);
+
+ this->accept_strategy_ = acc_s;
+ this->concurrency_strategy_ = con_s;
+ this->creation_strategy_ = cre_s;
+
+ if (this->accept_strategy_->open (local_addr, reuse_addr) == -1)
+ return -1;
+
+ if (this->accept_strategy_->acceptor ().enable (ACE_NONBLOCK) != 0)
+ return -1;
+
+ int result =
+ reactor->register_handler (this,
+ ACE_Event_Handler::ACCEPT_MASK);
+
+
+ return result;
+}
+
+template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
+TAO::HTIOP::Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::close ()
+{
+ ACE_TRACE ("TAO::HTIOP::Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::close");
+
+ // Guard against multiple closes.
+ if (this->reactor () != 0)
+ {
+ ACE_HANDLE handle = this->get_handle ();
+
+ this->reactor ()->remove_handler
+ (handle,
+ // We must pass the DONT_CALL flag here to avoid infinite
+ // recursion.
+ ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL);
+
+ // Shut down the listen socket to recycle the handles.
+ if (this->accept_strategy_->acceptor ().close () == -1)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("close\n")));
+ // Set the Reactor to 0 so that we don't try to close down
+ // again.
+ this->reactor (0);
+ }
+ return 0;
+}
+
+template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ACE_HANDLE
+TAO::HTIOP::Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::get_handle () const
+{
+ return this->accept_strategy_->get_handle ();
+}
+
+template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
+TAO::HTIOP::Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_input (ACE_HANDLE listener)
+{
+ ACE_Handle_Set conn_handle;
+
+ ACE_Time_Value timeout;
+
+ # if defined (ACE_WIN64)
+ // This arg is ignored on Windows and causes pointer truncation
+ // warnings on 64-bit compiles.
+ int select_width = 0;
+# else
+ int select_width = int (listener) + 1;
+# endif /* ACE_WIN64 */
+
+ // TAO_HTIOP connections cannot be attached to sessions or anything else until
+ // after the HTTP request header is read. So the acceptor here just creates
+ // completion handler that gets the header data and then creates the
+ // association between the connection handler and the session, or
+ // re-establishes an existing session.
+ do
+ {
+ TAO::HTIOP::Completion_Handler *sh = 0;
+ if (this->make_svc_handler(sh) == -1 ||
+ this->accept_svc_handler (sh) == -1 ||
+ this->activate_svc_handler (sh) == -1)
+ return -1;
+ }
+
+ // Now, check to see if there is another connection pending and
+ // break out of the loop if there is none.
+
+ //int use_select = 1;
+ while (1
+ && ACE_OS::select (select_width,
+ conn_handle,
+ 0,
+ 0,
+ &timeout) == 1);
+ return 0;
+}
+
+
+template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
+TAO::HTIOP::Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::activate_svc_handler (SVC_HANDLER *svc_handler)
+{
+ return this->concurrency_strategy_->activate_svc_handler (svc_handler,
+ (void *) this);
+}
+
+
+template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
+TAO::HTIOP::Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::accept_svc_handler (SVC_HANDLER *svc_handler)
+{
+ return this->accept_strategy_->accept_svc_handler (svc_handler);
+}
+
+template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
+TAO::HTIOP::Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::make_svc_handler (SVC_HANDLER *&sh)
+{
+ return this->creation_strategy_->make_svc_handler (sh);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* HTIOP_ACCEPTOR_IMPL_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor_Impl.h b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor_Impl.h
new file mode 100644
index 00000000000..9bfc69280c4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor_Impl.h
@@ -0,0 +1,156 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file HTIOP_Acceptor_Impl.h
+ *
+ * $Id$
+ *
+ * @author Priyanka Gontla <gontla_p@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef HTIOP_ACCEPTOR_IMPL_H
+#define HTIOP_ACCEPTOR_IMPL_H
+#include /**/ "ace/pre.h"
+
+#include "ace/Acceptor.h"
+#include "ace/SOCK_Acceptor.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/corbafwd.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward declarations.
+class TAO_ORB_Core;
+
+namespace TAO
+{
+ namespace HTIOP
+ {
+ /**
+ * @class Creation_Strategy
+ *
+ * @brief Creates a Svc_Handler and set the ORB_Core pointer on it.
+ */
+ template <class SVC_HANDLER>
+ class Creation_Strategy : public ACE_Creation_Strategy<SVC_HANDLER>
+ {
+ public:
+ /**
+ * Constructor. <arg> parameter is used to pass any special
+ * state/info to the service handler upon creation.
+
+ */
+ Creation_Strategy (TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag = 0);
+
+ /// Create a SVC_HANDLER and set the ORB_Core pointer on it.
+ int make_svc_handler (SVC_HANDLER *&sh);
+
+ protected:
+ /// Pointer to the ORB Core.
+ TAO_ORB_Core *orb_core_;
+
+ /// Should we use the Lite version for any protocol?
+ CORBA::Boolean lite_flag_;
+ };
+
+ template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
+ class Accept_Strategy
+ {
+ public:
+
+ /// Constructor.
+ Accept_Strategy (TAO_ORB_Core *orb_core);
+
+ /// Initialize the <peer_acceptor_> with <local_addr>. If the
+ /// process runs out of handles, purge some "old" connections.
+ int open (const ACE_PEER_ACCEPTOR_ADDR &local_addr,
+ int restart = 0);
+
+ /// Returns the underlying PEER_ACCEPTOR object
+ ACE_PEER_ACCEPTOR &acceptor (void) const;
+
+ /// Delegates to the <accept> method of the PEER_ACCEPTOR. If the
+ /// process runs out of handles, purge some "old" connections.
+ int accept_svc_handler (SVC_HANDLER *svc_handler);
+
+ ACE_HANDLE get_handle (void) const;
+
+ protected:
+
+ /// Pointer to the ORB Core.
+ TAO_ORB_Core *orb_core_;
+
+ private:
+
+ /// Factory that establishes connections passively
+ ACE_PEER_ACCEPTOR peer_acceptor_;
+ };
+
+
+ template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
+ class Strategy_Acceptor : public ACE_Service_Object
+ {
+ public:
+
+ /// Default constructor.
+ Strategy_Acceptor (const ACE_TCHAR service_name[] = 0,
+ const ACE_TCHAR service_description[] = 0,
+ int use_select = 1,
+ int reuse_addr = 1);
+
+ int open (const ACE_PEER_ACCEPTOR_ADDR &,
+ ACE_Reactor * = ACE_Reactor::instance (),
+ Creation_Strategy<SVC_HANDLER> * = 0,
+ Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2> * =0,
+ ACE_Concurrency_Strategy<SVC_HANDLER> * = 0,
+ int reuse_addr = 1);
+
+ int close ();
+
+ virtual ACE_HANDLE get_handle (void) const;
+
+
+ private:
+
+ int handle_input (ACE_HANDLE);
+
+ int activate_svc_handler (SVC_HANDLER *svc_handler);
+
+ int accept_svc_handler (SVC_HANDLER *svc_handler);
+
+ int make_svc_handler (SVC_HANDLER *&sh);
+
+ int shared_open (const ACE_PEER_ACCEPTOR_ADDR &,
+ int protocol_family,
+ int backlog);
+
+ Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2> *accept_strategy_;
+
+ Creation_Strategy<SVC_HANDLER> * creation_strategy_;
+
+ ACE_Concurrency_Strategy<SVC_HANDLER> * concurrency_strategy_;
+ };
+
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/HTIOP/HTIOP_Acceptor_Impl.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("HTIOP_Acceptor_Impl.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* HTIOP_AccePTOR_IMPL_H */
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Completion_Handler.cpp b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Completion_Handler.cpp
new file mode 100644
index 00000000000..de9b6a14cd2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Completion_Handler.cpp
@@ -0,0 +1,181 @@
+// $Id$
+
+#include "orbsvcs/HTIOP/HTIOP_Completion_Handler.h"
+
+#include "orbsvcs/HTIOP/HTIOP_Transport.h"
+#include "orbsvcs/HTIOP/HTIOP_Endpoint.h"
+
+#include "ace/HTBP/HTBP_Stream.h"
+#include "ace/HTBP/HTBP_Session.h"
+
+#include "tao/Timeprobe.h"
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+#include "tao/Server_Strategy_Factory.h"
+#include "tao/Transport_Cache_Manager.h"
+#include "tao/Thread_Lane_Resources.h"
+#include "tao/Acceptor_Impl.h"
+
+ACE_RCSID (HTIOP,
+ TAO_HTIOP_Completion_Handler,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::HTIOP::Completion_Handler::Completion_Handler (ACE_Thread_Manager *t)
+ : COMPLETION_BASE(t,0,0),
+ orb_core_ (0),
+ channel_(0),
+ concurrency_strategy_ (0)
+{
+ // This constructor should *never* get called, it is just here to
+ // make the compiler happy: the default implementation of the
+ // Creation_Strategy requires a constructor with that signature, we
+ // don't use that implementation, but some (most?) compilers
+ // instantiate it anyway.
+ ACE_ASSERT (this->orb_core_ != 0);
+}
+
+TAO::HTIOP::Completion_Handler::Completion_Handler (TAO_ORB_Core *orb_core,
+ CORBA::Boolean )
+ : COMPLETION_BASE(orb_core->thr_mgr(),0,0),
+ orb_core_ (orb_core),
+ channel_(0),
+ concurrency_strategy_ (0)
+{
+}
+
+
+TAO::HTIOP::Completion_Handler::~Completion_Handler (void)
+{
+}
+
+int
+TAO::HTIOP::Completion_Handler::open (void*)
+{
+ this->orb_core_->reactor()->register_handler(this,
+ ACE_Event_Handler::READ_MASK);
+
+ ACE_NEW_RETURN (concurrency_strategy_,
+ TAO::HTIOP::CONCURRENCY_STRATEGY2 (this->orb_core_),
+ -1);
+ return 0;
+}
+
+int
+TAO::HTIOP::Completion_Handler::resume_handler (void)
+{
+ return ACE_Event_Handler::ACE_APPLICATION_RESUMES_HANDLER;
+}
+
+int
+TAO::HTIOP::Completion_Handler::handle_input (ACE_HANDLE h)
+{
+ // Create a service handler, using the appropriate creation
+ // strategy.
+ if (this->channel_ == 0)
+ ACE_NEW_RETURN (this->channel_,
+ ACE::HTBP::Channel (h),
+ -1);
+
+ if (this->channel_->pre_recv() != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO::HTIOP::Completion_Handler: pre_recv not done, "
+ "channel state = %d\n",
+ this->channel_->state()),
+ 0);
+
+ this->reactor()->remove_handler (this,
+ ACE_Event_Handler::READ_MASK |
+ ACE_Event_Handler::DONT_CALL);
+
+ this->channel_->register_notifier(this->reactor());
+
+ // look up session related to the channel.
+ // Do we already have a handler for it?
+ // If so, get the connection handler, otherwise create it new.
+
+ ACE::HTBP::Session *session = this->channel_->session();
+ ACE_Event_Handler *handler = session->handler();
+
+ if (handler == 0)
+ {
+ TAO::HTIOP::Connection_Handler *svc_handler = 0;
+ if (this->make_svc_handler (svc_handler) == -1)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO::HTIOP::Completion_Handler %p\n"),
+ ACE_TEXT ("make_svc_handler")));
+ return -1;
+ }
+
+ svc_handler->peer().session(session);
+ session->handler (svc_handler);
+
+ svc_handler->transport()->register_handler();
+ svc_handler->open(0);
+#if 0
+ // *** I am not yet sure how to reconsile the notification strategy
+ // with TPC concurrency.
+
+ // Activate the <svc_handler> using the designated concurrency
+ // strategy (note that this method becomes responsible for
+ // handling errors and freeing up the memory if things go
+ // awry...).
+ if (this->concurrency_strategy_->
+ activate_svc_handler (svc_handler,this->arg_) == -1)
+ {
+ // Note that <activate_svc_handler> closes the <svc_handler>
+ // on failure.
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("%p\n"),
+ ACE_TEXT ("activate_svc_handler")));
+ return -1;
+ }
+#endif /* 0 */
+ }
+
+ if (this->channel_->state() == ACE::HTBP::Channel::Data_Queued)
+ {
+ this->reactor()->notify (session->handler(),
+ ACE_Event_Handler::READ_MASK);
+ }
+ return 0;
+}
+
+int
+TAO::HTIOP::Completion_Handler::make_svc_handler (TAO::HTIOP::Connection_Handler *&sh)
+{
+ if (sh == 0)
+ {
+ // Purge connections (if necessary)
+ this->orb_core_->lane_resources ().transport_cache ().purge ();
+ ACE_NEW_RETURN (sh,
+ TAO::HTIOP::Connection_Handler (this->orb_core_,
+ 0),
+ -1);
+ }
+
+ return 0;
+}
+
+int
+TAO::HTIOP::Completion_Handler::add_transport_to_cache (void)
+{
+ return 0;
+}
+
+int
+TAO::HTIOP::Completion_Handler::handle_close (ACE_HANDLE,
+ ACE_Reactor_Mask)
+{
+ //commit suicide
+ delete this;
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Completion_Handler.h b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Completion_Handler.h
new file mode 100644
index 00000000000..63ba0a96b34
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Completion_Handler.h
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+
+// ===================================================================
+/**
+ * @file HTIOP_Completion_Handler.h
+ *
+ * $Id$
+ *
+ * @author Priyanka Gontla <gontla_p@ociweb.com>
+ */
+// ===================================================================
+
+#ifndef HTIOP_COMPLETION_HANDLER_H
+#define HTIOP_COMPLETION_HANDLER_H
+#include /**/ "ace/pre.h"
+
+#include "ace/Acceptor.h"
+#include "ace/Reactor.h"
+#include "ace/Svc_Handler.h"
+#include "ace/SOCK_Stream.h"
+#include "tao/Acceptor_Impl.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/HTIOP/HTIOP_Export.h"
+#include "orbsvcs/HTIOP/HTIOP_Connection_Handler.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ORB_Core;
+// ****************************************************************
+
+namespace TAO
+{
+ namespace HTIOP
+ {
+
+ /**
+ * @class Completion_Handler
+ *
+ * @brief Helps the HTIOP Acceptor complete a connection.
+ *
+ * The Completion Handler owns a newly accepted connection until the
+ * first data read. At that point, the session and data flow direction
+ * are known so the stream may be handed off to either an existing
+ * session, or to a newly created one.
+ */
+
+ typedef TAO_Concurrency_Strategy<Connection_Handler> CONCURRENCY_STRATEGY2;
+
+ typedef ACE_Svc_Handler<ACE_SOCK_STREAM,ACE_NULL_SYNCH> COMPLETION_BASE;
+
+ class HTIOP_Export Completion_Handler : public COMPLETION_BASE
+ {
+
+ public:
+ Completion_Handler (ACE_Thread_Manager* t = 0);
+ /// Constructor. <arg> parameter is used by the Acceptor to pass the
+ /// protocol configuration properties for this connection.
+ Completion_Handler (TAO_ORB_Core *orb_core,
+ CORBA::Boolean = 0 );
+
+ /// Destructor.
+ ~Completion_Handler (void);
+
+ /// Called by the <Strategy_Acceptor> when the handler is completely
+ /// connected. Argument is unused.
+ virtual int open (void *);
+
+ //@{
+ /** @name Event Handler overloads
+ */
+ virtual int handle_input (ACE_HANDLE);
+
+ virtual int resume_handler (void);
+ virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask);
+ //@}
+
+ // this does nothing, but satisfies a requirement for the TAO_Accept_stratgy.
+ int add_transport_to_cache (void);
+
+ private:
+ int make_svc_handler (Connection_Handler *&sh);
+ int activate_svc_handler (Connection_Handler *sh);
+
+ TAO_ORB_Core *orb_core_;
+ ACE::HTBP::Channel *channel_;
+
+ CONCURRENCY_STRATEGY2 *concurrency_strategy_;
+ };
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* HTIOP_COMPLETION_HANDLER_H */
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connection_Handler.cpp
new file mode 100644
index 00000000000..00a99a84351
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connection_Handler.cpp
@@ -0,0 +1,289 @@
+// $Id$
+
+#include "orbsvcs/HTIOP/HTIOP_Connection_Handler.h"
+
+#include "orbsvcs/HTIOP/HTIOP_Transport.h"
+#include "orbsvcs/HTIOP/HTIOP_Endpoint.h"
+
+#include "ace/HTBP/HTBP_Stream.h"
+#include "ace/HTBP/HTBP_Session.h"
+
+#include "tao/Timeprobe.h"
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+#include "tao/ORB.h"
+#include "tao/CDR.h"
+#include "tao/Server_Strategy_Factory.h"
+
+#include "tao/Transport_Cache_Manager.h"
+#include "tao/Thread_Lane_Resources.h"
+#include "tao/Base_Transport_Property.h"
+#include "tao/Resume_Handle.h"
+#include "tao/Protocols_Hooks.h"
+
+ACE_RCSID (HTIOP,
+ TAO_HTIOP_Connection_Handler,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::HTIOP::Connection_Handler::Connection_Handler (ACE_Thread_Manager *t)
+ : SVC_HANDLER (t,0,0),
+ TAO_Connection_Handler (0)
+{
+ // This constructor should *never* get called, it is just here to
+ // make the compiler happy: the default implementation of the
+ // Creation_Strategy requires a constructor with that signature, we
+ // don't use that implementation, but some (most?) compilers
+ // instantiate it anyway.
+ ACE_ASSERT (this->orb_core () != 0);
+}
+
+TAO::HTIOP::Connection_Handler::Connection_Handler (TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag)
+ : SVC_HANDLER (orb_core->thr_mgr (), 0, 0),
+ TAO_Connection_Handler (orb_core)
+{
+ TAO::HTIOP::Transport* specific_transport = 0;
+ ACE_NEW(specific_transport,
+ TAO::HTIOP::Transport (this, orb_core, flag));
+
+ this->transport (specific_transport);
+}
+
+TAO::HTIOP::Connection_Handler::~Connection_Handler (void)
+{
+}
+
+int
+TAO::HTIOP::Connection_Handler::open_handler (void *v)
+{
+ return this->open (v);
+}
+
+int
+TAO::HTIOP::Connection_Handler::open (void*)
+{
+ if (this->transport ()->wait_strategy ()->non_blocking ())
+ {
+ if (this->peer ().enable (ACE_NONBLOCK) == -1)
+ return -1;
+ }
+
+ // Called by the <Strategy_Acceptor> when the handler is
+ // completely connected.
+
+ ACE::HTBP::Addr remote_addr;
+ if (this->peer ().get_remote_addr (remote_addr) == -1)
+ return -1;
+
+ ACE::HTBP::Addr local_addr;
+ if (this->peer ().get_local_addr (local_addr) == -1)
+ return -1;
+
+ if (local_addr.get_ip_address () == remote_addr.get_ip_address ()
+ && local_addr.get_port_number () == remote_addr.get_port_number ())
+ {
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_TCHAR remote_as_string[MAXHOSTNAMELEN + 16];
+ ACE_TCHAR local_as_string[MAXHOSTNAMELEN + 16];
+
+ (void) remote_addr.addr_to_string (remote_as_string,
+ sizeof(remote_as_string),
+ 0);
+ (void) local_addr.addr_to_string (local_as_string,
+ sizeof(local_as_string),
+ 0);
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("TAO(%P|%t) - TAO::HTIOP::Connection_Handler::open, ")
+ ACE_TEXT("Holy Cow! The remote addr and ")
+ ACE_TEXT("local addr are identical (%s == %s)\n"),
+ remote_as_string, local_as_string));
+ }
+ return -1;
+ }
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_TCHAR client[MAXHOSTNAMELEN + 16];
+
+ // Verify that we can resolve the peer hostname.
+ if (remote_addr.addr_to_string (client, sizeof (client), 0) == -1)
+ return -1;
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) TAO_HTIOP connection to peer ")
+ ACE_TEXT ("<%s> on %d\n"),
+ client, this->peer ().get_handle ()));
+ }
+
+ // Set the id in the transport now that we're active.
+ // Use C-style cast b/c otherwise we get warnings on lots of compilers
+ if (!this->transport ()->post_open ((size_t) this->get_handle ()))
+ return -1;
+
+ this->state_changed (TAO_LF_Event::LFS_SUCCESS,
+ this->orb_core ()->leader_follower ());
+
+ return 0;
+}
+
+int
+TAO::HTIOP::Connection_Handler::resume_handler (void)
+{
+ return ACE_Event_Handler::ACE_APPLICATION_RESUMES_HANDLER;
+}
+
+int
+TAO::HTIOP::Connection_Handler::close_connection (void)
+{
+ return this->close_connection_eh (this);
+}
+
+int
+TAO::HTIOP::Connection_Handler::handle_input (ACE_HANDLE h)
+{
+ // Figure out if the peer is associated with an identified session.
+ // If not, do whatever is necessary to complete the linkage.
+ ACE::HTBP::Session *session = peer().session();
+ if (session == 0)
+ {
+ int result = this->handle_input_eh (h,this);
+
+ if (result != -1 && peer().session())
+ {
+ if (TAO_debug_level > 2)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("TAO::HTIOP::Connection_Handler::handle_input: ")
+ ACE_TEXT("now binding to %d\n"),
+ peer().get_handle()));
+ }
+ return result;
+ }
+ return this->handle_input_eh (h, this);
+}
+
+int
+TAO::HTIOP::Connection_Handler::handle_output (ACE_HANDLE handle)
+{
+ int result =
+ this->handle_output_eh (handle, this);
+
+ if (result == -1)
+ {
+ this->close_connection ();
+ return 0;
+ }
+
+ return result;
+}
+
+int
+TAO::HTIOP::Connection_Handler::handle_close (ACE_HANDLE ,
+ ACE_Reactor_Mask )
+{
+ ACE_ASSERT (0);
+ return 0;
+}
+
+int
+TAO::HTIOP::Connection_Handler::close (u_long)
+{
+ this->state_changed (TAO_LF_Event::LFS_CONNECTION_CLOSED,
+ this->orb_core ()->leader_follower ());
+ this->transport ()->remove_reference ();
+ return 0;
+}
+
+int
+TAO::HTIOP::Connection_Handler::release_os_resources (void)
+{
+ int result = this->peer().close ();
+ return result;
+}
+
+int
+TAO::HTIOP::Connection_Handler::add_transport_to_cache (void)
+{
+ ACE::HTBP::Addr addr;
+
+ // Get the peername.
+ if (this->peer ().get_remote_addr (addr) == -1)
+ return -1;
+
+ // Construct an TAO::HTIOP::Endpoint object
+ TAO::HTIOP::Endpoint endpoint (addr,
+ this->orb_core()->
+ orb_params()->use_dotted_decimal_addresses ());
+
+ // Construct a property object
+ TAO_Base_Transport_Property prop (&endpoint);
+
+ TAO::Transport_Cache_Manager &cache =
+ this->orb_core ()->lane_resources ().transport_cache ();
+
+ // Idle the transport..
+ return cache.cache_idle_transport (&prop,
+ this->transport ());
+}
+
+int
+TAO::HTIOP::Connection_Handler::process_listen_point_list
+(::HTIOP::ListenPointList &listen_list)
+{
+ // Get the size of the list
+ CORBA::ULong len = listen_list.length ();
+
+ for (CORBA::ULong i = 0; i < len; ++ i)
+ {
+ ::HTIOP::ListenPoint listen_point = listen_list[i];
+ ACE::HTBP::Addr addr;
+ if (listen_point.port)
+ addr.ACE_INET_Addr::set (listen_point.port,
+ listen_point.host.in ());
+ else
+ addr.set_htid (listen_point.htid);
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("(%P|%t) Listening port [%d] on [%s],[%s]\n"),
+ listen_point.port,
+ ACE_TEXT_CHAR_TO_TCHAR(listen_point.host.in ()),
+ ACE_TEXT_CHAR_TO_TCHAR(listen_point.htid.in())));
+ }
+
+ // Construct an TAO::HTIOP::Endpoint object
+ TAO::HTIOP::Endpoint endpoint (addr,
+ this->orb_core()->orb_params()->use_dotted_decimal_addresses ());
+
+ // Construct a property object
+ TAO_Base_Transport_Property prop (&endpoint);
+
+ // Mark the connection as bidirectional
+ prop.set_bidir_flag (1);
+
+ // The property for this handler has changed. Recache the
+ // handler with this property
+ int retval = this->transport ()->recache_transport (&prop);
+ if (retval == -1)
+ return retval;
+
+ // Make the handler idle and ready for use
+ this->transport ()->make_idle ();
+ }
+
+ return 0;
+}
+
+int
+TAO::HTIOP::Connection_Handler::set_dscp_codepoint (
+ CORBA::Boolean /*enable_network_priority*/)
+{
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connection_Handler.h b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connection_Handler.h
new file mode 100644
index 00000000000..2651dafebd0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connection_Handler.h
@@ -0,0 +1,135 @@
+// -*- C++ -*-
+
+// ===================================================================
+/**
+ * @file HTIOP_Connection_Handler.h
+ *
+ * $Id$
+ *
+ * @author Priyanka Gontla <gontla_p@ociweb.com>
+ */
+// ===================================================================
+
+#ifndef HTIOP_CONNECTION_HANDLER_H
+#define HTIOP_CONNECTION_HANDLER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/HTIOP/HTIOP_Transport.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+#include "tao/corbafwd.h"
+#include "tao/Wait_Strategy.h"
+#include "tao/Connection_Handler.h"
+
+#include "ace/Acceptor.h"
+#include "ace/Reactor.h"
+#include "ace/Svc_Handler.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward Decls
+class TAO_Pluggable_Messaging;
+
+// ****************************************************************
+
+namespace TAO
+{
+ namespace HTIOP
+ {
+
+ /**
+ * @class HTIOP_Connection_Handler
+ *
+ * @brief Handles requests on a single connection.
+ *
+ * The Connection handler which is common for the Acceptor and
+ * the Connector
+ */
+
+
+ class HTIOP_Export Connection_Handler : public SVC_HANDLER,
+ public TAO_Connection_Handler
+ {
+
+ public:
+
+ Connection_Handler (ACE_Thread_Manager* t = 0);
+
+ /// Constructor. <arg> parameter is used by the Acceptor to pass the
+ /// protocol configuration properties for this connection.
+ Connection_Handler (TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag);
+
+ /// Destructor.
+ ~Connection_Handler (void);
+
+ /// Called by the <Strategy_Acceptor> when the handler is completely
+ /// connected. Argument is unused.
+ virtual int open (void *);
+
+ virtual int open_handler (void *);
+
+#if 0 // for now, an active version of HTIOP is not defined, but the
+ // methods are kept here as a place-holder.
+
+ /// = Active object activation method.
+ virtual int activate (long flags = THR_NEW_LWP,
+ int n_threads = 1,
+ int force_active = 0,
+ long priority = ACE_DEFAULT_THREAD_PRIORITY,
+ int grp_id = -1,
+ ACE_Task_Base *task = 0,
+ ACE_hthread_t thread_handles[] = 0,
+ void *stack[] = 0,
+ size_t stack_size[] = 0,
+ ACE_thread_t thread_names[] = 0);
+
+
+ /// Only used when the handler is turned into an active object by
+ /// calling <activate>. This serves as the event loop in such cases.
+ virtual int svc (void);
+#endif /* 0 */
+
+ //@{
+ /** @name Event Handler overloads
+ */
+ virtual int resume_handler (void);
+ virtual int close_connection (void);
+ virtual int handle_input (ACE_HANDLE);
+ virtual int handle_output (ACE_HANDLE);
+ virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask);
+ virtual int close (u_long = 0);
+ //@}
+
+ /// Add ourselves to Cache.
+ int add_transport_to_cache (void);
+
+ /// Process the <listen_list>
+ int process_listen_point_list (::HTIOP::ListenPointList &listen_list);
+
+ ///Set the Diff-Serv codepoint if the Policy dicates the setting of
+ ///Network Priority This method is a no-op, but implemented to
+ ///satisfy the base class interface.
+ int set_dscp_codepoint (CORBA::Boolean set_network_priority);
+
+
+ //@{
+ /**
+ * @name TAO_Connection Handler overloads
+ */
+ virtual int release_os_resources (void);
+ //@}
+
+ private:
+ };
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* HTIOP_CONNECTION_HANDLER_H */
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector.cpp b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector.cpp
new file mode 100644
index 00000000000..c2a2dde9735
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector.cpp
@@ -0,0 +1,420 @@
+// $Id$
+
+#include "orbsvcs/HTIOP/HTIOP_Connector.h"
+#include "orbsvcs/HTIOP/HTIOP_Profile.h"
+
+#include "ace/HTBP/HTBP_Session.h"
+#include "ace/HTBP/HTBP_ID_Requestor.h"
+#include "ace/HTBP/HTBP_Environment.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+#include "tao/Client_Strategy_Factory.h"
+#include "tao/Environment.h"
+#include "tao/Base_Transport_Property.h"
+#include "tao/Transport_Cache_Manager.h"
+#include "tao/Connect_Strategy.h"
+#include "tao/Thread_Lane_Resources.h"
+#include "tao/Profile_Transport_Resolver.h"
+#include "ace/Strategies_T.h"
+
+ACE_RCSID (HTIOP,
+ TAO_HTIOP_Connector,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::HTIOP::Connector::Connector (ACE::HTBP::Environment *ht_env)
+ : TAO_Connector (OCI_TAG_HTIOP_PROFILE),
+ connect_creation_strategy_ (),
+ concurrency_strategy_ (),
+ ht_env_ (ht_env)
+{
+}
+
+TAO::HTIOP::Connector::~Connector (void)
+{
+}
+
+int
+TAO::HTIOP::Connector::open (TAO_ORB_Core *orb_core)
+{
+ // Set the ORB Core
+ this->orb_core (orb_core);
+
+ // Create our connect strategy
+ if (this->create_connect_strategy () == -1)
+ return -1;
+
+ /// Our connect creation strategy
+ ACE_NEW_RETURN (this->connect_creation_strategy_,
+ CONNECT_CREATION_STRATEGY
+ (orb_core->thr_mgr (),
+ orb_core,
+ 0),
+ -1);
+
+
+ ACE_NEW_RETURN (this->concurrency_strategy_,
+ CONNECT_CONCURRENCY_STRATEGY (orb_core),
+ -1);
+
+ return 0;
+}
+
+int
+TAO::HTIOP::Connector::close (void)
+{
+ delete this->concurrency_strategy_;
+ delete this->connect_creation_strategy_;
+
+ return 0;
+}
+
+int
+TAO::HTIOP::Connector::set_validate_endpoint (TAO_Endpoint *endpoint)
+{
+ // Set and validate endpoint. We need to do this to initialize our
+ // remote *_Addr's which have not been done during IOR decode.
+
+ /**
+ * @note The above comments talk about initialization. But, based on
+ * code reading, this is more of a validation of the endpoint rather
+ * than setting anything. So, nothing here needs to be modified for
+ * TAO_HTIOP case.
+ */
+ TAO::HTIOP::Endpoint *htiop_endpoint =
+ this->remote_endpoint (endpoint);
+
+ if (htiop_endpoint == 0)
+ return -1;
+
+ const ACE::HTBP::Addr &remote_address =
+ htiop_endpoint->object_addr ();
+
+ // Verify that the remote ACE::HTBP::Addr was initialized properly.
+ // Failure can occur if hostname lookup failed when initializing the
+ // remote ACE::HTBP::Addr.
+ if (remote_address.get_type () != AF_INET &&
+ (remote_address.get_htid() == 0 ||
+ ACE_OS::strlen(remote_address.get_htid()) == 0))
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) TAO_HTIOP connection failed.\n")
+ ACE_TEXT ("TAO (%P|%t) This is most likely ")
+ ACE_TEXT ("due to a hostname lookup ")
+ ACE_TEXT ("failure.\n")));
+ }
+
+ return -1;
+ }
+
+ return 0;
+}
+
+TAO_Transport *
+TAO::HTIOP::Connector::make_connection (TAO::Profile_Transport_Resolver *r,
+ TAO_Transport_Descriptor_Interface &desc,
+ ACE_Time_Value *timeout)
+{
+
+ /**
+ * \par
+ * Connector is used only in the processes inside the firewall
+ * This can connect to the remote address as it does always.
+ * If it is needed that the client first connect to the firewall
+ * and the firewall connects to the remote address, the code here
+ * should be modified to accomodate the requirement. And this would
+ * mean that we need to know the firewall address as well in this
+ * method.
+ * Probable checks would be
+ * 1. Check if the endpoint is outside the firewall
+ * 2. If so, connect to the firewall
+ * 3. Make the firewall connect to the outside server.
+ *
+ * \par Dated Oct 15:
+ */
+
+ TAO::HTIOP::Endpoint *htiop_endpoint =
+ this->remote_endpoint (desc.endpoint ());
+
+ if (htiop_endpoint == 0)
+ return 0;
+
+
+ ACE::HTBP::Session_Id_t session_id;
+ ACE_INET_Addr *proxy;
+ ACE_CString proxy_host;
+ unsigned proxy_port;
+
+ int port_set = this->ht_env_->get_proxy_port(proxy_port);
+ int host_set = this->ht_env_->get_proxy_host(proxy_host);
+ if (port_set != 0 ||
+ host_set != 0)
+ {
+ proxy_port = htiop_endpoint->port();
+ proxy_host = htiop_endpoint->host();
+ }
+ else
+ {
+ ACE::HTBP::ID_Requestor req(ht_env_);
+ session_id.local_ = req.get_HTID();
+ }
+
+ if (proxy_port == 0)
+ return 0;
+
+ ACE_NEW_RETURN (proxy,
+ ACE_INET_Addr(static_cast<u_short> (proxy_port),proxy_host.c_str()),
+ 0);
+
+ session_id.peer_ = htiop_endpoint->object_addr ();
+ session_id.id_ = ACE::HTBP::Session::next_session_id();
+
+ if (TAO_debug_level > 2)
+ {
+ char buffer[BUFSIZ];
+ htiop_endpoint->addr_to_string(buffer,BUFSIZ);
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - TAO::HTIOP::Connector::make_connection, "
+ "to <%s>\n",
+ buffer));
+ }
+
+ // Get the right synch options
+ ACE_Synch_Options synch_options;
+
+ this->active_connect_strategy_->synch_options (timeout,
+ synch_options);
+
+ // If we don't need to block for a transport just set the timeout to
+ // be zero.
+ ACE_Time_Value tmp_zero (ACE_Time_Value::zero);
+ if (!r->blocked_connect ())
+ {
+ synch_options.timeout (ACE_Time_Value::zero);
+ timeout = &tmp_zero;
+ }
+
+ // This is where we need to set the ACE::HTBP::Stream to the connection
+ // handler.
+ TAO::HTIOP::Connection_Handler *svc_handler = 0;
+
+ // In more traditional connectors, the following code would be part of a
+ // strategized connector's connect() method. This include making the
+ // handler, attaching the session, and activating the handler.
+
+ // Instantiate a ACE::HTBP::Session
+ ACE::HTBP::Session *session = 0;
+ if (ACE::HTBP::Session::find_session (session_id, session) == -1)
+ {
+ ACE_NEW_RETURN (session, ACE::HTBP::Session (session_id,proxy, 1), 0);
+ if (ACE::HTBP::Session::add_session (session) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ACE::HTBP::Initial_Filter::recv_data_header %p",
+ "add_session"),
+ 0);
+ }
+
+ // Make the svc_handler
+ this->connect_creation_strategy_->make_svc_handler (svc_handler);
+ // we now have a connection handler that has an unconnected stream
+
+ svc_handler->peer().session(session);
+ session->handler(svc_handler);
+ ACE::HTBP::Channel *outbound = session->outbound();
+ ACE_UNUSED_ARG (outbound);
+
+ // Activate immediately if we are connected.
+ this->concurrency_strategy_->activate_svc_handler (svc_handler,0);
+
+ // The above code is a rendering of connect() that allows the session to
+ // reacquire a stream rather than opening a new one.
+
+ int closed = svc_handler->is_closed();
+ // At this point, the IIOP Connector has a result from an asynch connect
+ // strategy, which does not apply here. Therefore the whole bit of logic
+ // of dealing with a failed wait but an unclosed svc_handler is skipped.
+
+
+ // Regardless of success or failure, remove the extra #REFCOUNT#.
+ svc_handler->remove_reference ();
+
+ if (closed) // would be result == -1 in IIOP_Connector
+ {
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("(%P|%t) - TAO::HTIOP::Connector::make_connection, ")
+ ACE_TEXT("connection to <%s:%d> failed (%p)\n"),
+ htiop_endpoint->host (), htiop_endpoint->port (),
+ "errno"));
+ }
+ return 0;
+ }
+
+ if (TAO_debug_level > 2)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("(%P|%t) - TAO::HTIOP::Connector::make_connection, ")
+ ACE_TEXT("new connection to <%s:%d> on Transport[%d]\n"),
+ htiop_endpoint->host (), htiop_endpoint->port (),
+ svc_handler->peer ().get_handle ()));
+
+ TAO_Transport *transport = svc_handler->transport ();
+
+ // Add the handler to Cache
+ // @todo several other things need to be done regarding the following
+ // code.
+ // @note The cache_transport would probably need to cache the session id
+ // with the local and remote addresses.
+ int retval =
+ this->orb_core ()->lane_resources ().
+ transport_cache ().cache_transport (&desc, transport);
+
+ if (retval != 0)
+ {
+ svc_handler->close();
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("(%P|%t) - TAO::HTIOP::Connector::make_connection, ")
+ ACE_TEXT("could not add the new")
+ ACE_TEXT(" connection to cache\n")));
+ }
+ return 0;
+ }
+
+ // If the wait strategy wants us to be registered with the reactor
+ // then we do so.
+ retval = transport->wait_strategy ()->register_handler ();
+ if (retval != 0)
+ {
+ transport->purge_entry ();
+ transport->close_connection();
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("(%P|%t) - TAO::HTIOP::Connector::make_connection, ")
+ ACE_TEXT("could not register the new connection")
+ ACE_TEXT(" in the reactor\n")));
+ }
+ return 0;
+ }
+
+ return transport;
+}
+
+
+int
+TAO::HTIOP::Connector::cancel_svc_handler (
+ TAO_Connection_Handler * svc_handler)
+{
+ TAO::HTIOP::Connection_Handler* handler=
+ dynamic_cast<TAO::HTIOP::Connection_Handler*> (svc_handler);
+
+ if (handler)
+ // Cancel from the connector
+ // this->base_connector_.cancel (handler);
+ return 0;
+
+ return -1;
+
+}
+
+
+/**
+ * @brief Create a profile and initialize it based on the
+ * encapsulation in <cdr>
+ */
+TAO_Profile *
+TAO::HTIOP::Connector::create_profile (TAO_InputCDR& cdr)
+{
+ TAO_Profile *pfile;
+ ACE_NEW_RETURN (pfile,
+ TAO::HTIOP::Profile (this->orb_core ()),
+ 0);
+
+ int r = pfile->decode (cdr);
+ if (r == -1)
+ {
+ pfile->_decr_refcnt ();
+ pfile = 0;
+ }
+
+ return pfile;
+}
+
+/**
+ * @brief Create a profile with a given endpoint.
+ */
+TAO_Profile *
+TAO::HTIOP::Connector::make_profile (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // The endpoint should be of the form:
+ // N.n@host:port/object_key
+ // or:
+ // host:port/object_key
+
+ TAO_Profile *profile = 0;
+ ACE_NEW_THROW_EX (profile,
+ TAO::HTIOP::Profile (this->orb_core ()),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ return profile;
+}
+
+int
+TAO::HTIOP::Connector::check_prefix (const char *endpoint)
+{
+ // Check for a valid string
+ if (!endpoint || !*endpoint)
+ return -1; // Failure
+
+ const char *protocol[] = { "htiop" };
+
+ size_t slot = ACE_OS::strchr (endpoint, ':') - endpoint;
+
+ size_t len0 = ACE_OS::strlen (protocol[0]);
+
+ // Check for the proper prefix in the IOR. If the proper prefix
+ // isn't in the IOR then it is not an IOR we can use.
+ if (slot == len0
+ && ACE_OS::strncasecmp (endpoint, protocol[0], len0) == 0)
+ return 0;
+
+ return -1;
+ // Failure: not an TAO_HTIOP IOR
+ // DO NOT throw an exception here.
+}
+
+char
+TAO::HTIOP::Connector::object_key_delimiter (void) const
+{
+ return TAO::HTIOP::Profile::object_key_delimiter_;
+}
+
+TAO::HTIOP::Endpoint *
+TAO::HTIOP::Connector::remote_endpoint (TAO_Endpoint *endpoint)
+{
+ if (endpoint->tag () != OCI_TAG_HTIOP_PROFILE)
+ return 0;
+
+ TAO::HTIOP::Endpoint *htiop_endpoint =
+ dynamic_cast<TAO::HTIOP::Endpoint *> (endpoint );
+
+ if (htiop_endpoint == 0)
+ return 0;
+
+ return htiop_endpoint;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector.h b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector.h
new file mode 100644
index 00000000000..62e06d6a988
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector.h
@@ -0,0 +1,137 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file HTIOP_Connector.h
+ *
+ * $Id$
+ *
+ * HTIOP specific connector processing
+ *
+ *
+ * @author Priyanka Gontla <gontla_p@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef HTIOP_CONNECTOR_H
+#define HTIOP_CONNECTOR_H
+#include /**/ "ace/pre.h"
+
+#include "tao/Connector_Impl.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/HTIOP/HTIOP_Connection_Handler.h"
+
+#include "tao/Transport_Connector.h"
+
+#include "ace/SOCK_Connector.h"
+#include "ace/Connector.h"
+#include "ace/OS.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+namespace ACE
+{
+ namespace HTBP
+ {
+ class Environment;
+ }
+}
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace HTIOP
+ {
+ class Endpoint;
+
+ /**
+ * @class HTIOP_Connector
+ *
+ * @brief HTIOP-specific Connector bridge for pluggable protocols.
+ *
+ * Concrete instance of the TAO_Connector class. Responsible
+ * for establishing a connection with a server and is called from the
+ * Connector_Registory.
+ */
+ class HTIOP_Export Connector : public TAO_Connector
+ {
+ public:
+ typedef TAO_Connect_Concurrency_Strategy<Connection_Handler>
+ CONNECT_CONCURRENCY_STRATEGY;
+
+ typedef TAO_Connect_Creation_Strategy<Connection_Handler>
+ CONNECT_CREATION_STRATEGY;
+
+ /// Initialization and termination methods.
+ /// Constructor.
+ /// {@
+ Connector (ACE::HTBP::Environment *ht_env);
+
+ /// Destructor.
+ ~Connector (void);
+
+ /// @}
+
+
+ /// The TAO_Connector methods, please check the documentation on
+ /// Transport_Connector.h
+ /// {@
+ int open (TAO_ORB_Core *orb_core);
+ int close (void);
+
+ TAO_Profile *create_profile (TAO_InputCDR& cdr);
+
+ virtual int check_prefix (const char *endpoint);
+
+ virtual char object_key_delimiter (void) const;
+ /// @}
+
+ protected:
+
+ // = The TAO_Connector methods, please check the documentation on
+ // Transport_Connector.h
+ int set_validate_endpoint (TAO_Endpoint *ep);
+
+ TAO_Transport *make_connection (TAO::Profile_Transport_Resolver *r,
+ TAO_Transport_Descriptor_Interface &desc,
+ ACE_Time_Value *timeout = 0);
+
+
+ /// More TAO_Connector methods, please check the documentation on
+ /// Transport_Connector.h
+ virtual TAO_Profile *make_profile (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Cancel the passed cvs handler from the connector
+ /// Its not clear what it means to cancel in HTIOP, since there's no
+ /// base connector.
+ virtual int cancel_svc_handler (TAO_Connection_Handler * svc_handler);
+
+ private:
+
+ /// Return the remote endpoint, a helper function
+ Endpoint *remote_endpoint (TAO_Endpoint *ep);
+
+ /// Our creation strategy
+ CONNECT_CREATION_STRATEGY *connect_creation_strategy_;
+
+ /// Our activation strategy
+ CONNECT_CONCURRENCY_STRATEGY *concurrency_strategy_;
+
+ /// reference to the configuration parameters
+ ACE::HTBP::Environment *ht_env_;
+ };
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* HTIOP_CONNECTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector_Impl.cpp b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector_Impl.cpp
new file mode 100644
index 00000000000..8c891ddaf38
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector_Impl.cpp
@@ -0,0 +1,62 @@
+// $Id$
+
+#ifndef HTIOP_CONNECTOR_IMPL_CPP
+#define HTIOP_CONNECTOR_IMPL_CPP
+
+#include "orbsvcs/HTIOP/HTIOP_Connector_Impl.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class SVC_HANDLER>
+TAO::HTIOP::Connect_Creation_Strategy<SVC_HANDLER>::
+Connect_Creation_Strategy (ACE_Thread_Manager* t,
+ TAO_ORB_Core *orb_core,
+ void *arg,
+ CORBA::Boolean flag)
+ : ACE_Creation_Strategy <SVC_HANDLER> (t),
+ orb_core_ (orb_core),
+ arg_ (arg),
+ lite_flag_ (flag)
+{
+
+}
+
+template <class SVC_HANDLER> int
+TAO::HTIOP::Connect_Creation_Strategy<SVC_HANDLER>::make_svc_handler (SVC_HANDLER *&sh)
+{
+ if (sh == 0)
+ ACE_NEW_RETURN (sh,
+ SVC_HANDLER (this->orb_core_,
+ this->lite_flag_,
+ this->arg_),
+ -1);
+
+ // We add to the #REFCOUNT# since the Connector needs this. See
+ // Connector::make_connection() for details.
+ sh->add_reference ();
+
+ return 0;
+}
+
+
+////////////////////////////////////////////////////////////////
+
+template <class SVC_HANDLER>
+TAO::HTIOP::Connect_Concurrency_Strategy<SVC_HANDLER>::
+Connect_Concurrency_Strategy (TAO_ORB_Core *orb_core)
+ : orb_core_ (orb_core)
+{
+}
+
+template <class SVC_HANDLER> int
+TAO::HTIOP::Connect_Concurrency_Strategy<SVC_HANDLER>::
+activate_svc_handler (SVC_HANDLER *sh,
+ void *arg)
+{
+ return ACE_Concurrency_Strategy<SVC_HANDLER>::activate_svc_handler (sh,
+ arg);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* HTIOP_CONNECTOR_IMPL_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector_Impl.h b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector_Impl.h
new file mode 100644
index 00000000000..5658b346919
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector_Impl.h
@@ -0,0 +1,128 @@
+// -*- C++ -*-
+
+// ===================================================================
+/**
+ * @file HTIOP_Connector_Impl.h
+ *
+ * $Id$
+ *
+ * @author Priyanka Gontla <gontla_p@ociweb.com>
+ */
+// ===================================================================
+
+#ifndef HTIOP_CONNECTOR_IMPL_H
+#define HTIOP_CONNECTOR_IMPL_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/HTIOP/HTIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/corbafwd.h"
+#include "ace/Strategies_T.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Thread_Manager;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ORB_Core;
+
+namespace TAO
+{
+ namespace HTIOP
+ {
+
+ /**
+ * @class HTIOP_Connect_Creation_Strategy
+ *
+ * @brief Creation strategy helper
+ *
+ * Creates the HTIOP_*_Connection_Handler object for the HTIOP_Connector
+ * objects. This template class can now be used by all the Connector
+ * objects instead of having to duplicate code. This class can be used
+ * to set any required properties on the connection handlers at
+ * creation time.
+ *
+ */
+
+ template <class SVC_HANDLER>
+ class Connect_Creation_Strategy : public ACE_Creation_Strategy<SVC_HANDLER>
+ {
+ public:
+
+ /// Constructor. <arg> parameter is used to pass any special
+ /// state/info to the service handler upon creation. Currently used
+ /// by HTIOP to pass protocol configuration properties.
+ Connect_Creation_Strategy (ACE_Thread_Manager * = 0,
+ TAO_ORB_Core* orb_core = 0,
+ void *arg = 0,
+ CORBA::Boolean flag = 0);
+
+ /// Makes HTIOP_Client_Connection_Handlers
+ virtual int make_svc_handler (SVC_HANDLER *&sh);
+
+
+ private:
+
+ /// Pointer to the ORB_Core on which we are activated
+ TAO_ORB_Core* orb_core_;
+
+ /// Some info/state to be passed to the service handler we create.
+ void *arg_;
+
+ /// Are we using GIOP lite?
+ CORBA::Boolean lite_flag_;
+ };
+
+
+
+ /**
+ * @class HTIOP_Connect_Concurrency_Strategy
+ *
+ * @brief Concurrency strategy helper
+ *
+ * Activates the Svc_Handler, and then if the correct wait strategy is
+ * in use registers the handler with the reactor.
+ *
+ */
+
+ template <class SVC_HANDLER>
+ class Connect_Concurrency_Strategy :
+ public ACE_Concurrency_Strategy<SVC_HANDLER>
+ {
+ public:
+
+ /// Constructor.
+ Connect_Concurrency_Strategy (TAO_ORB_Core *orb_core);
+
+
+ /// Activates the Svc_Handler, and if the right wait strategy is in
+ /// use, registers the handle with the reactor.
+ int activate_svc_handler (SVC_HANDLER *svc_handler,
+ void *arg);
+
+ private:
+
+ /// Pointer to the ORB Core.
+ TAO_ORB_Core *orb_core_;
+
+ };
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/HTIOP/HTIOP_Connector_Impl.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("HTIOP_Connector_Impl.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /*HTIOP_CONNECTOR_IMPL_H*/
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Endpoint.cpp b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Endpoint.cpp
new file mode 100644
index 00000000000..2d3e6da6299
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Endpoint.cpp
@@ -0,0 +1,225 @@
+// $Id$
+
+#include "orbsvcs/HTIOP/HTIOP_Endpoint.h"
+#include "orbsvcs/HTIOP/HTIOP_Profile.h"
+
+#include "ace/os_include/os_netdb.h"
+#include "ace/Log_Msg.h"
+
+#include "tao/IOPC.h"
+#include "tao/debug.h"
+
+
+ACE_RCSID (HTIOP,
+ TAO_HTIOP_Endpoint,
+ "$Id$")
+
+#if !defined (__ACE_INLINE__)
+# include "orbsvcs/HTIOP/HTIOP_Endpoint.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::HTIOP::Endpoint::Endpoint (const ACE::HTBP::Addr &addr,
+ int use_dotted_decimal_addresses)
+ : TAO_Endpoint (OCI_TAG_HTIOP_PROFILE),
+ host_ (),
+ port_ (0),
+ htid_ (),
+ object_addr_ (addr),
+ object_addr_set_ (0),
+ next_ (0)
+{
+ this->set (addr, use_dotted_decimal_addresses);
+}
+
+TAO::HTIOP::Endpoint::Endpoint (const char *host,
+ CORBA::UShort port,
+ const char *htid,
+ const ACE::HTBP::Addr &addr)
+ : TAO_Endpoint (OCI_TAG_HTIOP_PROFILE),
+ host_ (),
+ port_ (port),
+ htid_ (),
+ object_addr_ (addr),
+ object_addr_set_ (0),
+ next_ (0)
+{
+ if (host != 0)
+ this->host_ = host;
+ if (htid != 0)
+ this->htid_ = htid;
+}
+
+TAO::HTIOP::Endpoint::Endpoint (void)
+ : TAO_Endpoint (OCI_TAG_HTIOP_PROFILE),
+ host_ (),
+ port_ (0),
+ htid_ (),
+ object_addr_ (),
+ object_addr_set_ (0),
+ next_ (0)
+{
+}
+
+TAO::HTIOP::Endpoint::Endpoint (const char *host,
+ CORBA::UShort port,
+ const char *htid)
+ : TAO_Endpoint (OCI_TAG_HTIOP_PROFILE),
+ host_ (),
+ port_ (port),
+ htid_ (),
+ object_addr_ (),
+ object_addr_set_ (0),
+ next_ (0)
+{
+ if (host != 0)
+ this->host_ = host;
+ if (htid != 0)
+ this->htid_ = htid;
+}
+
+TAO::HTIOP::Endpoint::~Endpoint (void)
+{
+}
+
+int
+TAO::HTIOP::Endpoint::set (const ACE::HTBP::Addr &addr,
+ int use_dotted_decimal_addresses)
+{
+ char tmp_host[MAXHOSTNAMELEN + 1];
+
+ if (use_dotted_decimal_addresses
+ || addr.get_host_name (tmp_host, sizeof (tmp_host)) != 0)
+ {
+ const char *tmp = addr.get_host_addr ();
+ if (tmp == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\n\nTAO (%P|%t) ")
+ ACE_TEXT ("TAO::HTIOP::Endpoint::set ")
+ ACE_TEXT ("- %p\n\n"),
+ ACE_TEXT ("cannot determine hostname")));
+ return -1;
+ }
+ else
+ this->host_ = tmp;
+ }
+ else
+ this->host_ = CORBA::string_dup (tmp_host);
+
+ this->port_ = addr.get_port_number();
+ this->htid_ = addr.get_htid();
+ return 0;
+}
+
+int
+TAO::HTIOP::Endpoint::addr_to_string (char *buffer, size_t length)
+{
+ if (this->port_ != 0)
+ {
+ size_t actual_len =
+ ACE_OS::strlen (this->host_.in ()) // chars in host name
+ + sizeof (':') // delimiter
+ + ACE_OS::strlen ("65536") // max port
+ + sizeof ('\0');
+
+ if (length < actual_len)
+ return -1;
+
+ ACE_OS::sprintf (buffer, "%s:%d",
+ this->host_.in (), this->port_);
+ }
+ else
+ {
+ if (length < ACE_OS::strlen (this->htid_.in())+1)
+ return -1;
+ ACE_OS::strcpy (buffer,this->htid_.in());
+ }
+ return 0;
+}
+
+const char *
+TAO::HTIOP::Endpoint::host (const char *h)
+{
+ this->host_ = h;
+
+ return this->host_.in ();
+}
+
+const char *
+TAO::HTIOP::Endpoint::htid (const char *h)
+{
+ this->htid_ = h;
+
+ return this->htid_.in ();
+}
+
+void
+TAO::HTIOP::Endpoint::reset_hint (void)
+{
+ // Commented out for the time being....
+ /* if (this->hint_)
+ this->hint_->cleanup_hint ((void **) &this->hint_); */
+}
+
+TAO_Endpoint *
+TAO::HTIOP::Endpoint::next (void)
+{
+ return this->next_;
+}
+
+TAO_Endpoint *
+TAO::HTIOP::Endpoint::duplicate (void)
+{
+ // @@ Bala, we probably need to make sure that the duplicate has the
+ // same priority as the original. Although it does not matter in
+ // the context this method is currently used, if somebody ends up
+ // using this method for some other purpose later, this will be a
+ // seed for bugs.
+
+ TAO::HTIOP::Endpoint *endpoint = 0;
+
+ ACE_NEW_RETURN (endpoint,
+ TAO::HTIOP::Endpoint (this->host_.in (),
+ this->port_,
+ this->htid_.in(),
+ this->object_addr_),
+ 0);
+
+ return endpoint;
+}
+
+CORBA::Boolean
+TAO::HTIOP::Endpoint::is_equivalent (const TAO_Endpoint *other_endpoint)
+{
+ TAO_Endpoint *endpt =
+ const_cast<TAO_Endpoint *> (other_endpoint);
+
+ TAO::HTIOP::Endpoint *endpoint =
+ dynamic_cast<TAO::HTIOP::Endpoint *> (endpt);
+ if (endpoint == 0)
+ return 0;
+
+ if (this->htid_.in() && ACE_OS::strlen (this->htid_.in()))
+ return (endpoint->htid() &&
+ ACE_OS::strcmp (this->htid_.in(),endpoint->htid()) == 0);
+
+ return (this->port_ == endpoint->port_
+ && (ACE_OS::strcmp(this->host(), endpoint->host()) == 0));
+}
+
+CORBA::ULong
+TAO::HTIOP::Endpoint::hash (void)
+{
+ // We could call ACE::HTBP::Addr::hash() since it does much the same
+ // thing except that it converts the port from network byte order to
+ // host byte order. As such, this implementation is actually less
+ // costly.
+ if (this->htid_.in() && ACE_OS::strlen (this->htid_.in()))
+ return ACE::hash_pjw(this->htid_.in());
+ return this->object_addr ().get_ip_address () + this->port ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Endpoint.h b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Endpoint.h
new file mode 100644
index 00000000000..2fa800fd7a4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Endpoint.h
@@ -0,0 +1,162 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file HTIOP_Endpoint.h
+ *
+ * $Id$
+ *
+ * HTIOP implementation of PP Framework Endpoint interface.
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef HTIOP_ENDPOINT_H
+#define HTIOP_ENDPOINT_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/HTIOP/HTIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/HTBP/HTBP_Addr.h"
+
+#include "tao/Endpoint.h"
+#include "tao/ORB.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace HTIOP
+ {
+
+ class Connection_Handler;
+
+ /**
+ * @class Endpoint
+ *
+ * @brief Endpoint
+ *
+ * HTIOP-specific implementation of PP Framework Endpoint interface.
+ */
+ class HTIOP_Export Endpoint : public TAO_Endpoint
+ {
+ public:
+
+ friend class Profile;
+ friend class TAO_SSLIOP_Profile;
+
+ // = Initialization and termination methods.
+
+ /// Default constructor.
+ Endpoint (void);
+
+ /// Constructor. This is the most efficient constructor since it
+ /// does not require any address resolution processing.
+ Endpoint (const char *host,
+ CORBA::UShort port,
+ const char *htid,
+ const ACE::HTBP::Addr &addr);
+
+ /// Constructor.
+ Endpoint (const ACE::HTBP::Addr &addr,
+ int use_dotted_decimal_addresses);
+
+ /// Constructor. This constructor is used when decoding endpoints.
+ Endpoint (const char *host,
+ CORBA::UShort port,
+ const char *htid);
+
+ /// Destructor.
+ ~Endpoint (void);
+
+ // = Implementation of abstract TAO_Endpoint methods. See
+ // Endpoint.h for their documentation.
+
+ virtual TAO_Endpoint *next (void);
+ virtual int addr_to_string (char *buffer, size_t length);
+ virtual void reset_hint (void);
+
+ /// Makes a copy of <this>
+ virtual TAO_Endpoint *duplicate (void);
+
+ /// Return true if this endpoint is equivalent to <other_endpoint>. Two
+ /// endpoints are equivalent iff their port and host are the same.
+ CORBA::Boolean is_equivalent (const TAO_Endpoint *other_endpoint);
+
+ /// Return a hash value for this object.
+ CORBA::ULong hash (void);
+
+ // Allocates memory and returns a copy of <this>
+
+ // = HTIOP_Endpoint-specific methods.
+
+ /// Return a reference to the <object_addr>.
+ const ACE::HTBP::Addr &object_addr (void) const;
+
+ /// Return a pointer to the host string. This object maintains
+ /// ownership of this string.
+ const char *host (void) const;
+
+ /// Copy the string <h> into <host_> and return the resulting pointer.
+ /// This object maintains ownership of this string.
+ const char *host (const char *h);
+
+ /// Return the port number.
+ CORBA::UShort port (void) const;
+
+ /// Set the port number.
+ CORBA::UShort port (CORBA::UShort p);
+
+ /// Return a pointer to the host string. This object maintains
+ /// ownership of this string.
+ const char *htid (void) const;
+
+ /// Copy the string <h> into <host_> and return the resulting pointer.
+ /// This object maintains ownership of this string.
+ const char *htid (const char *h);
+
+ //Connection_Handler *&hint (void);
+ // Access to our <hint_>.
+
+ private:
+
+ /// Helper method for setting INET_Addr.
+ int set (const ACE::HTBP::Addr &addr,
+ int use_dotted_decimal_addresses);
+
+ /// String representing the host name.
+ CORBA::String_var host_;
+
+ /// TCP port number.
+ CORBA::UShort port_;
+
+ CORBA::String_var htid_;
+
+ /// Cached instance of <ACE::HTBP::Addr> for use in making
+ /// invocations, etc.
+ ACE::HTBP::Addr object_addr_;
+
+ /// Flag to indicate if the address has been resolved and set.
+ int object_addr_set_;
+
+ /// HTIOP Endpoints can be stringed into a list. Return the next
+ /// endpoint in the list, if any.
+ Endpoint *next_;
+ };
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+# include "orbsvcs/HTIOP/HTIOP_Endpoint.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* HTIOP_PROFILE_H */
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Endpoint.i b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Endpoint.i
new file mode 100644
index 00000000000..dffd4f6705b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Endpoint.i
@@ -0,0 +1,79 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE const ACE::HTBP::Addr &
+TAO::HTIOP::Endpoint::object_addr (void) const
+{
+ // The object_addr_ is initialized here, rather than at IOR decode
+ // time for several reasons:
+ // 1. A request on the object may never be invoked.
+ // 2. The DNS setup may have changed dynamically.
+ // ...etc..
+
+ // Double checked locking optimization.
+ if (!this->object_addr_set_)
+ {
+ // We need to modify the object_addr_ in this method. Do so
+ // using a non-const copy of the <this> pointer.
+ TAO::HTIOP::Endpoint *endpoint =
+ const_cast<TAO::HTIOP::Endpoint *> (this);
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ endpoint->addr_lookup_lock_,
+ this->object_addr_ );
+
+ if (!this->object_addr_set_)
+ {
+ if (endpoint->object_addr_.set (this->port_,
+ this->host_.in (),
+ this->htid_.in ()) == -1)
+ {
+ // If this call fails, it most likely due a hostname
+ // lookup failure caused by a DNS misconfiguration. If
+ // a request is made to the object at the given host and
+ // port, then a CORBA::TRANSIENT() exception should be
+ // thrown.
+
+ // Invalidate the ACE::HTBP::Addr. This is used as a flag
+ // to denote that ACE::HTBP::Addr initialization failed.
+ endpoint->object_addr_.set_type (-1);
+ }
+ else
+ {
+ endpoint->object_addr_set_ = 1;
+ }
+ }
+ }
+
+ return this->object_addr_;
+}
+
+ACE_INLINE const char *
+TAO::HTIOP::Endpoint::host (void) const
+{
+ return this->host_.in ();
+}
+
+ACE_INLINE const char *
+TAO::HTIOP::Endpoint::htid (void) const
+{
+ return this->htid_.in ();
+}
+
+ACE_INLINE CORBA::UShort
+TAO::HTIOP::Endpoint::port (void) const
+{
+ return this->port_;
+}
+
+ACE_INLINE CORBA::UShort
+TAO::HTIOP::Endpoint::port (CORBA::UShort p)
+{
+ return this->port_ = p;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Export.h b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Export.h
new file mode 100644
index 00000000000..858abf88a1a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Export.h
@@ -0,0 +1,54 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl -s HTIOP
+// ------------------------------
+#ifndef HTIOP_EXPORT_H
+#define HTIOP_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (HTIOP_HAS_DLL)
+# define HTIOP_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && HTIOP_HAS_DLL */
+
+#if !defined (HTIOP_HAS_DLL)
+# define HTIOP_HAS_DLL 1
+#endif /* ! HTIOP_HAS_DLL */
+
+#if defined (HTIOP_HAS_DLL) && (HTIOP_HAS_DLL == 1)
+# if defined (HTIOP_BUILD_DLL)
+# define HTIOP_Export ACE_Proper_Export_Flag
+# define HTIOP_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define HTIOP_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* HTIOP_BUILD_DLL */
+# define HTIOP_Export ACE_Proper_Import_Flag
+# define HTIOP_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define HTIOP_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* HTIOP_BUILD_DLL */
+#else /* HTIOP_HAS_DLL == 1 */
+# define HTIOP_Export
+# define HTIOP_SINGLETON_DECLARATION(T)
+# define HTIOP_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* HTIOP_HAS_DLL == 1 */
+
+// Set HTIOP_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (HTIOP_NTRACE)
+# if (ACE_NTRACE == 1)
+# define HTIOP_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define HTIOP_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !HTIOP_NTRACE */
+
+#if (HTIOP_NTRACE == 1)
+# define HTIOP_TRACE(X)
+#else /* (HTIOP_NTRACE == 1) */
+# define HTIOP_TRACE(X) ACE_TRACE_IMPL(X)
+#endif /* (HTIOP_NTRACE == 1) */
+
+#endif /* HTIOP_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Factory.cpp b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Factory.cpp
new file mode 100644
index 00000000000..8542907269b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Factory.cpp
@@ -0,0 +1,146 @@
+// $Id$
+
+#include "orbsvcs/HTIOP/HTIOP_Factory.h"
+#include "orbsvcs/HTIOP/HTIOP_Acceptor.h"
+#include "orbsvcs/HTIOP/HTIOP_Connector.h"
+#include "orbsvcs/HTIOP/HTIOP_Profile.h"
+
+#include "ace/HTBP/HTBP_Environment.h"
+#include "tao/IOPC.h"
+
+ACE_RCSID (HTIOP,
+ TAOHTIOP_Factory,
+ "$Id$")
+
+static const char the_prefix[] = "htiop";
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::HTIOP::Protocol_Factory::Protocol_Factory (void)
+ : TAO_Protocol_Factory (OCI_TAG_HTIOP_PROFILE),
+ major_ (TAO_DEF_GIOP_MAJOR),
+ minor_ (TAO_DEF_GIOP_MINOR),
+ ht_env_ (0),
+ inside_ (-1)
+{
+}
+
+TAO::HTIOP::Protocol_Factory::~Protocol_Factory (void)
+{
+ delete this->ht_env_;
+}
+
+int
+TAO::HTIOP::Protocol_Factory::match_prefix (const ACE_CString &prefix)
+{
+ // Check for the proper prefix for this protocol.
+ return (ACE_OS::strcasecmp (prefix.c_str (), ::the_prefix) == 0);
+}
+
+const char *
+TAO::HTIOP::Protocol_Factory::prefix (void) const
+{
+ return ::the_prefix;
+}
+
+char
+TAO::HTIOP::Protocol_Factory::options_delimiter (void) const
+{
+ return '/';
+}
+
+int
+TAO::HTIOP::Protocol_Factory::init (int argc,
+ ACE_TCHAR* argv[])
+{
+ const ACE_TCHAR * config_file = 0;
+ const ACE_TCHAR * persist_file = 0;
+
+ ACE_stat statbuf;
+ int use_registry = 0;
+
+ for (int i = 0; i < argc; i++)
+ {
+ if (ACE_OS::strcasecmp(argv[i], ACE_TEXT("-config")) == 0)
+ {
+ if (++i < argc)
+ if (ACE_OS::stat (argv[i],&statbuf) != -1)
+ config_file = argv[i];
+ }
+ else if (ACE_OS::strcasecmp(argv[i], ACE_TEXT("-env_persist")) == 0)
+ {
+ if (++i < argc)
+ if (ACE_OS::stat (argv[i],&statbuf) != -1)
+ persist_file = argv[i];
+ }
+ else if (ACE_OS::strcasecmp(argv[i], ACE_TEXT("-win32_reg")) == 0)
+ {
+ use_registry = 1;
+ }
+ else if (ACE_OS::strcasecmp(argv[i], ACE_TEXT("-inside")) == 0)
+ {
+ if (++i < argc)
+ this->inside_ = ::atoi (ACE_TEXT_ALWAYS_CHAR(argv[i]));
+ }
+ }
+
+ ACE_NEW_RETURN (this->ht_env_,
+ ACE::HTBP::Environment(0,
+ use_registry,
+ persist_file),
+ -1);
+
+ if (config_file != 0)
+ this->ht_env_->import_config (config_file);
+
+ return 0;
+}
+
+TAO_Acceptor *
+TAO::HTIOP::Protocol_Factory::make_acceptor (void)
+{
+ TAO_Acceptor *acceptor = 0;
+
+ ACE_NEW_RETURN (acceptor,
+ TAO::HTIOP::Acceptor (this->ht_env_,
+ this->inside_),
+ 0);
+ return acceptor;
+}
+
+TAO_Connector *
+TAO::HTIOP::Protocol_Factory::make_connector (void)
+{
+ TAO_Connector *connector = 0;
+ ACE_NEW_RETURN (connector,
+ TAO::HTIOP::Connector (this->ht_env_),
+ 0);
+ return connector;
+}
+
+int
+TAO::HTIOP::Protocol_Factory::requires_explicit_endpoint (void) const
+{
+ return 0;
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DEFINE (TAO_HTIOP_Protocol_Factory,
+ ACE_TEXT ("HTIOP_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_HTIOP_Protocol_Factory),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+
+// Since the actual class instantiated by the factory is scoped inside a
+// namespace, this macro is used in place of ACE_FACTORY_DEFINE, athough
+// the declaration macro is the same. Note that the second argument must
+// match the name class name used in the ACE_FACTORY_DECLARE, and the
+// third argument is the fully scoped class to be instantiated.
+ACE_FACTORY_NAMESPACE_DEFINE (HTIOP,
+ TAO_HTIOP_Protocol_Factory,
+ TAO::HTIOP::Protocol_Factory)
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Factory.h b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Factory.h
new file mode 100644
index 00000000000..276d0f1199e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Factory.h
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file HTIOP_Factory.h
+ *
+ * $Id$
+ *
+ * @author Fred Kuhns <fredk@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef HTIOP_FACTORY_H
+#define HTIOP_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/HTIOP/HTIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Protocol_Factory.h"
+#include "ace/Service_Config.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+namespace ACE
+{
+ namespace HTBP
+ {
+ class Environment;
+ }
+}
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace HTIOP
+ {
+
+ class HTIOP_Export Protocol_Factory : public TAO_Protocol_Factory
+ {
+ public:
+ Protocol_Factory (void);
+ virtual ~Protocol_Factory (void);
+
+ // = Service Configurator hooks.
+ /// Dynamic linking hook
+ virtual int init (int argc, ACE_TCHAR* argv[]);
+
+ /// Verify prefix is a match
+ virtual int match_prefix (const ACE_CString &prefix);
+
+ /// Returns the prefix used by the protocol.
+ virtual const char *prefix (void) const;
+
+ /// Return the character used to mark where an endpoint ends and
+ /// where its options begin.
+ virtual char options_delimiter (void) const;
+
+ // = Check Protocol_Factory.h for a description of these methods.
+ virtual TAO_Acceptor *make_acceptor (void);
+ virtual TAO_Connector *make_connector (void);
+ virtual int requires_explicit_endpoint (void) const;
+
+ private:
+ /// Changing the version number can be used to provide backwards
+ /// compatibility with old clients.
+ int major_;
+ int minor_;
+
+ /// Configuration reference
+ ACE::HTBP::Environment *ht_env_;
+
+ /// Flag used to determine if an acceptor should use an "inside"
+ /// local address, or try to compose an "outside" address.
+ /// If the value is 1, then always use an HTID for local addr,
+ /// otherwise use host:port if 0, or guess based on proxy config
+ /// if -1. The default is -1.
+ int inside_;
+ };
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// Note that these declarations are placed outside of the scope of the
+// namespace. The generated functions use a C style signature which does
+// not accomodate namespaces, so assuming namespace concatination is an
+// error. The service class name should be composed of a flattened class
+// name, with the namespaces preceeding the class name with '_'.
+ACE_STATIC_SVC_DECLARE_EXPORT (HTIOP, TAO_HTIOP_Protocol_Factory)
+ACE_FACTORY_DECLARE (HTIOP, TAO_HTIOP_Protocol_Factory)
+
+#include /**/ "ace/post.h"
+#endif /* HTIOP_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Profile.cpp b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Profile.cpp
new file mode 100644
index 00000000000..63d4a82db22
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Profile.cpp
@@ -0,0 +1,473 @@
+// This may look like C, but it's really -*- C++ -*-
+// $Id$
+
+#include "orbsvcs/HTIOP/HTIOP_Profile.h"
+#include "orbsvcs/HTIOP/htiop_endpointsC.h"
+
+#include "ace/os_include/os_netdb.h"
+
+#include "tao/CDR.h"
+#include "tao/Environment.h"
+#include "tao/ORB.h"
+#include "tao/ORB_Core.h"
+#include "tao/debug.h"
+
+ACE_RCSID(HTIOP,
+ TAO_HTIOP_Profile,
+ "$Id$")
+
+static const char the_prefix[] = "htiop";
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+const char TAO::HTIOP::Profile::object_key_delimiter_ = '/';
+
+char
+TAO::HTIOP::Profile::object_key_delimiter (void) const
+{
+ return TAO::HTIOP::Profile::object_key_delimiter_;
+}
+
+TAO::HTIOP::Profile::Profile (const ACE::HTBP::Addr &addr,
+ const TAO::ObjectKey &object_key,
+ const TAO_GIOP_Message_Version &version,
+ TAO_ORB_Core *orb_core)
+ : TAO_Profile (OCI_TAG_HTIOP_PROFILE,
+ orb_core,
+ object_key,
+ version),
+ endpoint_ (addr,
+ orb_core->orb_params ()->use_dotted_decimal_addresses ()),
+ count_ (1)
+{
+}
+
+TAO::HTIOP::Profile::Profile (const char* host,
+ CORBA::UShort port,
+ const char* htid,
+ const TAO::ObjectKey &object_key,
+ const ACE::HTBP::Addr &addr,
+ const TAO_GIOP_Message_Version &version,
+ TAO_ORB_Core *orb_core)
+ : TAO_Profile (OCI_TAG_HTIOP_PROFILE,
+ orb_core,
+ object_key,
+ version),
+ endpoint_ (host, port, htid, addr),
+ count_ (1)
+{
+}
+
+TAO::HTIOP::Profile::Profile (TAO_ORB_Core *orb_core)
+ : TAO_Profile (OCI_TAG_HTIOP_PROFILE,
+ orb_core,
+ TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)),
+ endpoint_ (),
+ count_ (1)
+{
+}
+
+TAO::HTIOP::Profile::~Profile (void)
+{
+ // Clean up the list of endpoints since we own it.
+ // Skip the head, since it is not dynamically allocated.
+ TAO_Endpoint *tmp = 0;
+
+ for (TAO_Endpoint *next = this->endpoint ()->next ();
+ next != 0;
+ next = tmp)
+ {
+ tmp = next->next ();
+ delete next;
+ }
+}
+
+// return codes:
+// -1 -> error
+// 0 -> can't understand this version
+// 1 -> success.
+
+int
+TAO::HTIOP::Profile::decode_profile (TAO_InputCDR& cdr)
+{
+
+ // Decode host and port into the <endpoint_>.
+ if (cdr.read_string (this->endpoint_.host_.out ()) == 0
+ || cdr.read_ushort (this->endpoint_.port_) == 0
+ || cdr.read_string (this->endpoint_.htid_.out()) == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) TAO::HTIOP::Profile::decode - ")
+ ACE_TEXT ("error while decoding host/port")));
+ return -1;
+ }
+
+ if (cdr.good_bit ())
+ {
+ // Invalidate the object_addr_ until first access.
+ this->endpoint_.object_addr_.set_type (-1);
+
+ return 1;
+ }
+ return -1;
+}
+
+void
+TAO::HTIOP::Profile::parse_string_i (const char *ior
+ ACE_ENV_ARG_DECL)
+{
+ // Pull off the "hostname:port#token/" part of the objref
+ // Copy the string because we are going to modify it...
+
+ const char *okd = ACE_OS::strchr (ior, this->object_key_delimiter_);
+
+ if (okd == 0 || okd == ior)
+ {
+ // No object key delimiter or no hostname specified.
+ ACE_THROW (CORBA::INV_OBJREF
+ (CORBA::SystemException::_tao_minor_code
+ (TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+
+ // Length of host string.
+ CORBA::ULong length_host = 0;
+
+ const char *cp_pos = ACE_OS::strchr (ior, ':'); // Look for a port
+
+ if (cp_pos == ior)
+ {
+ // No hostname specified! It is required by the spec.
+ ACE_THROW (CORBA::INV_OBJREF
+ (CORBA::SystemException::_tao_minor_code
+ (TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+ else if (cp_pos != 0)
+ {
+ // A port number or port name was specified.
+ CORBA::ULong length_port = okd - cp_pos - 1;
+
+ CORBA::String_var tmp = CORBA::string_alloc (length_port);
+
+ ACE_OS::strncpy (tmp.inout (), cp_pos + 1, length_port);
+ tmp[length_port] = '\0';
+
+ this->endpoint_.port_ =
+ static_cast<CORBA::UShort> (ACE_OS::atoi (tmp.in ()));
+
+ length_host = cp_pos - ior;
+ }
+ else
+ length_host = okd - ior;
+
+ CORBA::String_var tmp = CORBA::string_alloc (length_host);
+
+ // Skip the trailing '/'
+ ACE_OS::strncpy (tmp.inout (), ior, length_host);
+ tmp[length_host] = '\0';
+
+ this->endpoint_.host_ = tmp._retn ();
+
+ if (ACE_OS::strcmp (this->endpoint_.host_.in (), "") == 0)
+ {
+ ACE::HTBP::Addr host_addr;
+
+ char tmp_host [MAXHOSTNAMELEN + 1];
+
+ // If no host is specified: assign the default host, i.e. the
+ // local host.
+ if (host_addr.get_host_name (tmp_host,
+ sizeof (tmp_host)) != 0)
+ {
+ // Can't get the IP address since the INET_Addr wasn't
+ // initialized. Just throw an exception.
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\n\nTAO (%P|%t) ")
+ ACE_TEXT ("TAO::HTIOP::Profile::parse_string ")
+ ACE_TEXT ("- %p\n\n"),
+ ACE_TEXT ("cannot determine hostname")));
+
+ // @@ What's the right exception to throw here?
+ ACE_THROW (CORBA::INV_OBJREF
+ (CORBA::SystemException::_tao_minor_code
+ (TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+ else
+ this->endpoint_.host_ = CORBA::string_dup (tmp_host);
+ }
+
+ TAO::ObjectKey ok;
+ TAO::ObjectKey::decode_string_to_sequence (ok, okd + 1);
+
+ (void) this->orb_core ()->object_key_table ().bind (ok,
+ this->ref_object_key_);
+}
+
+CORBA::Boolean
+TAO::HTIOP::Profile::do_is_equivalent (const TAO_Profile *other_profile)
+{
+ const TAO::HTIOP::Profile *op =
+ dynamic_cast<const TAO::HTIOP::Profile *> (other_profile);
+
+ if (op == 0)
+ return 0;
+
+ // Check endpoints equivalence.
+ const TAO::HTIOP::Endpoint *other_endp = &op->endpoint_;
+ for (TAO::HTIOP::Endpoint *endp = &this->endpoint_;
+ endp != 0;
+ endp = endp->next_)
+ {
+ if (endp->is_equivalent (other_endp))
+ other_endp = other_endp->next_;
+ else
+ return 0;
+ }
+
+ return 1;
+}
+
+CORBA::ULong
+TAO::HTIOP::Profile::hash (CORBA::ULong max
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ // Get the hashvalue for all endpoints.
+ CORBA::ULong hashval = 0;
+ for (TAO::HTIOP::Endpoint *endp = &this->endpoint_;
+ endp != 0;
+ endp = endp->next_)
+ {
+ hashval += endp->hash ();
+ }
+
+ hashval += this->version_.minor;
+ hashval += this->tag ();
+
+ const TAO::ObjectKey &ok =
+ this->ref_object_key_->object_key ();
+
+ if (ok.length () >= 4)
+ {
+ hashval += ok[1];
+ hashval += ok[3];
+ }
+
+ return hashval % max;
+}
+
+TAO_Endpoint*
+TAO::HTIOP::Profile::endpoint (void)
+{
+ return &this->endpoint_;
+}
+
+CORBA::ULong
+TAO::HTIOP::Profile::endpoint_count (void) const
+{
+ return this->count_;
+}
+
+void
+TAO::HTIOP::Profile::add_endpoint (TAO::HTIOP::Endpoint *endp)
+{
+ endp->next_ = this->endpoint_.next_;
+ this->endpoint_.next_ = endp;
+
+ this->count_++;
+}
+
+char *
+TAO::HTIOP::Profile::to_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ CORBA::String_var key;
+ TAO::ObjectKey::encode_sequence_to_string (key.inout(),
+ this->ref_object_key_->object_key ());
+
+ size_t buflen = (8 /* "corbaloc" */ +
+ 1 /* colon separator */ +
+ ACE_OS::strlen (::the_prefix) +
+ 1 /* colon separator */ +
+ 1 /* major version */ +
+ 1 /* decimal point */ +
+ 1 /* minor version */ +
+ 1 /* `@' character */ +
+ ACE_OS::strlen (this->endpoint_.host ()) +
+ 1 /* colon separator */ +
+ 5 /* port number */ +
+ 1 /* object key separator */ +
+ ACE_OS::strlen (key.in ()));
+
+ char * buf = CORBA::string_alloc (static_cast<CORBA::ULong> (buflen));
+
+ static const char digits [] = "0123456789";
+
+ ACE_OS::sprintf (buf,
+ "corbaloc:%s:%c.%c@%s:%d%c%s",
+ ::the_prefix,
+ digits [this->version_.major],
+ digits [this->version_.minor],
+ this->endpoint_.host (),
+ this->endpoint_.port (),
+ this->object_key_delimiter_,
+ key.in ());
+
+ return buf;
+}
+
+
+
+const char *
+TAO::HTIOP::Profile::prefix (void)
+{
+ return ::the_prefix;
+}
+
+void
+TAO::HTIOP::Profile::create_profile_body (TAO_OutputCDR &encap) const
+{
+ encap.write_octet (TAO_ENCAP_BYTE_ORDER);
+
+ // The GIOP version
+ encap.write_octet (this->version_.major);
+ encap.write_octet (this->version_.minor);
+
+ // STRING hostname from profile
+ encap.write_string (this->endpoint_.host ());
+
+ // UNSIGNED SHORT port number
+ encap.write_ushort (this->endpoint_.port ());
+
+ // STRING htid
+ encap.write_string (this->endpoint_.htid ());
+
+ // OCTET SEQUENCE for object key
+ if (this->ref_object_key_)
+ encap << this->ref_object_key_->object_key ();
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) TAO - IIOP_Profile::create_profile_body "
+ "no object key marshalled \n"));
+ }
+
+ if (this->version_.major > 1
+ || this->version_.minor > 0)
+ this->tagged_components ().encode (encap);
+}
+
+int
+TAO::HTIOP::Profile::encode_endpoints ()
+{
+ // Create a data structure and fill it with endpoint info for wire
+ // transfer.
+ // We include information for the head of the list
+ // together with other endpoints because even though its addressing
+ // info is transmitted using standard ProfileBody components, its
+ // priority is not!
+
+ HTIOPEndpointSequence endpoints;
+ endpoints.length (this->count_);
+
+ const TAO::HTIOP::Endpoint *endpoint = &this->endpoint_;
+ for (CORBA::ULong i = 0;
+ i < this->count_;
+ ++i)
+ {
+ endpoints[i].host = endpoint->host ();
+ endpoints[i].port = endpoint->port ();
+ endpoints[i].htid = endpoint->htid ();
+
+ endpoint = endpoint->next_;
+ }
+
+ // Encode the data structure.
+ TAO_OutputCDR out_cdr;
+ if ((out_cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)
+ == 0)
+ || (out_cdr << endpoints) == 0)
+ return -1;
+ size_t length = out_cdr.total_length ();
+
+ IOP::TaggedComponent tagged_component;
+ tagged_component.tag = TAO_TAG_ENDPOINTS;
+ tagged_component.component_data.length (static_cast<CORBA::ULong> (length));
+ CORBA::Octet *buf =
+ tagged_component.component_data.get_buffer ();
+
+ for (const ACE_Message_Block *iterator = out_cdr.begin ();
+ iterator != 0;
+ iterator = iterator->cont ())
+ {
+ size_t i_length = iterator->length ();
+ ACE_OS::memcpy (buf, iterator->rd_ptr (), i_length);
+
+ buf += i_length;
+ }
+
+ // Add component with encoded endpoint data to this profile's
+ // TaggedComponents.
+ tagged_components_.set_component (tagged_component);
+
+ return 0;
+}
+
+int
+TAO::HTIOP::Profile::decode_endpoints (void)
+{
+ IOP::TaggedComponent tagged_component;
+ tagged_component.tag = TAO_TAG_ENDPOINTS;
+
+ if (this->tagged_components_.get_component (tagged_component))
+ {
+ const CORBA::Octet *buf =
+ tagged_component.component_data.get_buffer ();
+
+ TAO_InputCDR in_cdr (reinterpret_cast<const char*> (buf),
+ tagged_component.component_data.length ());
+
+ // Extract the Byte Order.
+ CORBA::Boolean byte_order;
+ if ((in_cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"boolean byte_order extraction failed\n"),
+ -1);
+ in_cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ // Extract endpoints sequence.
+ HTIOPEndpointSequence endpoints;
+
+ if ((in_cdr >> endpoints) == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"endpoint sequence extraction failed\n"),
+ -1);
+
+ // Use information extracted from the tagged component to
+ // populate the profile. Skip the first endpoint, since it is
+ // always extracted through standard profile body. Also, begin
+ // from the end of the sequence to preserve endpoint order,
+ // since <add_endpoint> method reverses the order of endpoints
+ // in the list.
+ for (CORBA::ULong i = endpoints.length() -1;
+ i > 0;
+ --i)
+ {
+ TAO::HTIOP::Endpoint *endpoint = 0;
+ ACE_NEW_RETURN (endpoint,
+ TAO::HTIOP::Endpoint (endpoints[i].host,
+ endpoints[i].port,
+ endpoints[i].htid),
+ -1);
+ this->add_endpoint (endpoint);
+ }
+ }
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Profile.h b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Profile.h
new file mode 100644
index 00000000000..938666a6bfc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Profile.h
@@ -0,0 +1,151 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file HTIOP_Profile.h
+ *
+ * $Id$
+ *
+ * HTIOP profile specific processing
+ *
+ *
+ * @author Fred Kuhns <fredk@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef HTIOP_PROFILE_H
+#define HTIOP_PROFILE_H
+#include /**/ "ace/pre.h"
+
+#include "tao/Profile.h"
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Object_KeyC.h"
+#include "orbsvcs/HTIOP/HTIOP_Endpoint.h"
+
+#include "ace/Synch.h"
+
+#if !defined (OCI_TAG_HTIOP_PROFILE)
+# define OCI_TAG_HTIOP_PROFILE 0x4f434902U
+#endif
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace HTIOP
+ {
+
+ // TAO HTIOP_Profile concrete Profile definitions
+ /**
+ * @class HTIOP_Profile
+ *
+ * @brief This class defines the protocol specific attributes required
+ * for locating ORBs over a TCP/IP network.
+ *
+ * This class defines the HTIOP profile as specified in the CORBA
+ * specification.
+ */
+ class HTIOP_Export Profile : public TAO_Profile
+ {
+ public:
+ /// The object key delimiter that HTIOP uses or expects.
+ static const char object_key_delimiter_;
+ virtual char object_key_delimiter (void) const;
+
+ /// Return the char string prefix.
+ static const char *prefix (void);
+
+ /// Profile constructor, same as above except the object_key has
+ /// already been marshaled.
+ Profile (const ACE::HTBP::Addr &addr,
+ const TAO::ObjectKey &object_key,
+ const TAO_GIOP_Message_Version &version,
+ TAO_ORB_Core *orb_core);
+
+ /// Profile constructor, this is the most efficient since it
+ /// doesn't require any address resolution processing.
+ Profile (const char *host,
+ CORBA::UShort port,
+ const char *htid,
+ const TAO::ObjectKey &object_key,
+ const ACE::HTBP::Addr &addr,
+ const TAO_GIOP_Message_Version &version,
+ TAO_ORB_Core *orb_core);
+
+ /// Profile constructor, default.
+ Profile (TAO_ORB_Core *orb_core);
+
+ /// Destructor is to be called only through <_decr_refcnt>.
+ ~Profile (void);
+
+ /**
+ * Return a string representation for this profile.
+ * client must deallocate memory.
+ * This is used to create url-style reference. Only one
+ * endpoint is included into the string.
+ */
+ virtual char * to_string (ACE_ENV_SINGLE_ARG_DECL);
+
+ /**
+ * Endpoints are transmitted using TAO-proprietory tagged component.
+ * Component tag is TAO_TAG_ENDPOINTS and component data is an
+ * encapsulation of a sequence of structs, each representing a
+ * single endpoint. Data format is specified in iiop_endpoins.pidl.
+ */
+ virtual int encode_endpoints (void);
+
+ /// Return pointer to the head of this profile's endpoints list.
+ virtual TAO_Endpoint *endpoint (void);
+
+ /// Return how many endpoints this profile contains.
+ virtual CORBA::ULong endpoint_count (void) const;
+
+ /**
+ * Add <endp> to this profile's list of endpoints (it is inserted
+ * next to the head of the list). This profiles takes ownership of
+ * <endp>.
+ */
+ void add_endpoint (Endpoint *endp);
+
+ /// Return a hash value for this object.
+ virtual CORBA::ULong hash (CORBA::ULong max
+ ACE_ENV_ARG_DECL);
+
+ protected:
+
+ /// Template methods. Please see Profile.h for the documentation.
+ virtual int decode_profile (TAO_InputCDR &cdr);
+ virtual int decode_endpoints (void);
+ virtual void parse_string_i (const char *string
+ ACE_ENV_ARG_DECL);
+ virtual void create_profile_body (TAO_OutputCDR &cdr) const;
+ virtual CORBA::Boolean do_is_equivalent (const TAO_Profile *other_profile);
+
+ protected:
+
+ /**
+ * Head of this profile's list of endpoints. This endpoint is not
+ * dynamically allocated because a profile always contains at least
+ * one endpoint.
+ *
+ * Addressing info of the default endpoint, i.e., head of the list,
+ * is transmitted using standard HTIOP ProfileBody components. See
+ * <encode_endpoints> method documentation above for how the rest of
+ * the endpoint list is transmitted.
+ */
+ Endpoint endpoint_;
+
+ /// Number of endpoints in the list headed by <endpoint_>.
+ CORBA::ULong count_;
+ };
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* HTIOP_PROFILE_H */
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.cpp b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.cpp
new file mode 100644
index 00000000000..6325f6920dd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.cpp
@@ -0,0 +1,456 @@
+// $Id$
+
+#include "orbsvcs/HTIOP/HTIOP_Transport.h"
+
+#include "orbsvcs/HTIOP/HTIOP_Connection_Handler.h"
+#include "orbsvcs/HTIOP/HTIOP_Acceptor.h"
+#include "orbsvcs/HTIOP/HTIOP_Profile.h"
+#include "ace/HTBP/HTBP_Session.h"
+
+#include "tao/Acceptor_Registry.h"
+#include "tao/Thread_Lane_Resources.h"
+#include "tao/operation_details.h"
+#include "tao/Timeprobe.h"
+#include "tao/CDR.h"
+#include "tao/Transport_Mux_Strategy.h"
+#include "tao/Wait_Strategy.h"
+#include "tao/Stub.h"
+#include "tao/ORB_Core.h"
+#include "tao/debug.h"
+#include "tao/GIOP_Message_Base.h"
+#include "tao/GIOP_Message_Lite.h"
+#include "tao/Protocols_Hooks.h"
+#include "tao/Adapter.h"
+
+ACE_RCSID (HTIOP,
+ TAO_HTIOP_Transport,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::HTIOP::Transport::Transport (TAO::HTIOP::Connection_Handler *h,
+ TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag)
+ : TAO_Transport (OCI_TAG_HTIOP_PROFILE, orb_core),
+ connection_handler_ (h),
+ messaging_object_ (0)
+{
+ if (flag)
+ {
+ // Use the lite version of the protocol
+ ACE_NEW (this->messaging_object_,
+ TAO_GIOP_Message_Lite (orb_core));
+ }
+ else
+ {
+ // Use the normal GIOP object
+ ACE_NEW (this->messaging_object_,
+ TAO_GIOP_Message_Base (orb_core, this));
+ }
+}
+
+TAO::HTIOP::Transport::~Transport (void)
+{
+ delete this->messaging_object_;
+}
+
+ACE_Event_Handler *
+TAO::HTIOP::Transport::event_handler_i (void)
+{
+ return this->connection_handler_;
+}
+
+TAO_Connection_Handler *
+TAO::HTIOP::Transport::connection_handler_i (void)
+{
+ return this->connection_handler_;
+}
+
+TAO_Pluggable_Messaging *
+TAO::HTIOP::Transport::messaging_object (void)
+{
+ return this->messaging_object_;
+}
+
+ssize_t
+TAO::HTIOP::Transport::send (iovec *iov, int iovcnt,
+ size_t &bytes_transferred,
+ const ACE_Time_Value *max_wait_time)
+{
+ ACE_UNUSED_ARG (max_wait_time);
+ ssize_t retval = this->connection_handler_->peer ().sendv (iov, iovcnt,
+ max_wait_time);
+ if (retval > 0)
+ {
+ bytes_transferred = retval;
+ }
+
+ return retval;
+}
+
+ssize_t
+TAO::HTIOP::Transport::recv (char *buf,
+ size_t len,
+ const ACE_Time_Value *max_wait_time)
+{
+ ssize_t n = this->connection_handler_->peer ().recv (buf,
+ len,
+ max_wait_time);
+
+ // Do not print the error message if it is a timeout, which could
+ // occur in thread-per-connection.
+ if (n == -1 &&
+ TAO_debug_level > 4 &&
+ errno != ETIME)
+ {
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - TAO::HTIOP::Transport[%d]::recv_i, ")
+ ACE_TEXT ("read failure - %m"),
+ this->id ()));
+ }
+
+ // Error handling
+ if (n == -1)
+ {
+ if (errno == EWOULDBLOCK)
+ return 0;
+
+
+ return -1;
+ }
+
+ // Most of the errors handling is common for
+ // Now the message has been read
+
+ // @@ What are the other error handling here??
+ else if (n == 0)
+ {
+ return -1;
+ }
+
+ return n;
+}
+
+int
+TAO::HTIOP::Transport::register_handler (void)
+{
+ if (TAO_debug_level > 4)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("TAO (%P|%t) - TAO::HTIOP::Transport[%d]::register_handler\n"),
+ this->id ()));
+ }
+
+ ACE_Reactor *r = this->orb_core_->reactor ();
+ if (r == this->connection_handler_->reactor ())
+ return 0;
+
+ // Set the flag in the Connection Handler and in the Wait Strategy
+ // @@Maybe we should set these flags after registering with the
+ // reactor. What if the registration fails???
+ this->ws_->is_registered (1);
+
+ ACE::HTBP::Session *s = this->connection_handler_->peer().session();
+ if (s)
+ s->reactor(r);
+ ACE::HTBP::Channel *ch = s->inbound();
+ return r->register_handler (ch->notifier(),
+ ACE_Event_Handler::READ_MASK);
+}
+
+
+int
+TAO::HTIOP::Transport::send_request (TAO_Stub *stub,
+ TAO_ORB_Core *orb_core,
+ TAO_OutputCDR &stream,
+ int message_semantics,
+ ACE_Time_Value *max_wait_time)
+{
+ if (this->ws_->sending_request (orb_core,
+ message_semantics) == -1)
+
+ return -1;
+
+ if (this->send_message (stream,
+ stub,
+ message_semantics,
+ max_wait_time) == -1)
+ return -1;
+
+ this->first_request_sent();
+
+ return this->idle_after_send ();
+}
+
+int
+TAO::HTIOP::Transport::send_message (TAO_OutputCDR &stream,
+ TAO_Stub *stub,
+ int message_semantics,
+ ACE_Time_Value *max_wait_time)
+{
+ // Format the message in the stream first
+ if (this->messaging_object_->format_message (stream) != 0)
+ return -1;
+
+ // This guarantees to send all data (bytes) or return an error.
+ ssize_t n = this->send_message_shared (stub,
+ message_semantics,
+ stream.begin (),
+ max_wait_time);
+
+ if (n == -1)
+ {
+ // Dont try to be smart and request for %p in the debug
+ // statement. If the event handler is destroyed the transport
+ // would return -1 with errno set to ENOENT. %p then would dump
+ // a core. %m would then be softer on this.
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - TAO::HTIOP::Transport[%d]::send_message, ")
+ ACE_TEXT (" write failure - %m\n"),
+ this->id ()));
+ return -1;
+ }
+
+ return 1;
+}
+
+int
+TAO::HTIOP::Transport::send_message_shared (TAO_Stub *stub,
+ int message_semantics,
+ const ACE_Message_Block *message_block,
+ ACE_Time_Value *max_wait_time)
+{
+ int r;
+ {
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->handler_lock_, -1);
+
+ r = this->send_message_shared_i (stub, message_semantics,
+ message_block, max_wait_time);
+ }
+
+ if (r == -1)
+ {
+ this->close_connection ();
+ }
+
+ return r;
+}
+
+int
+TAO::HTIOP::Transport::generate_request_header (TAO_Operation_Details &opdetails,
+ TAO_Target_Specification &spec,
+ TAO_OutputCDR &msg)
+{
+ // Check whether we have a Bi Dir HTIOP policy set, whether the
+ // messaging objects are ready to handle bidirectional connections
+ // and also make sure that we have not recd. or sent any information
+ // regarding this before...
+ if (this->orb_core ()->bidir_giop_policy () &&
+ this->messaging_object_->is_ready_for_bidirectional (msg) &&
+ this->bidirectional_flag () < 0)
+ {
+ this->set_bidir_context_info (opdetails);
+
+ // Set the flag to 1 (i.e., originating side)
+ this->bidirectional_flag (1);
+
+ // At the moment we enable BiDIR giop we have to get a new
+ // request id to make sure that we follow the even/odd rule
+ // for request id's. We only need to do this when enabled
+ // it, after that the Transport Mux Strategy will make sure
+ // that the rule is followed
+ opdetails.request_id (this->tms ()->request_id ());
+ }
+
+ return TAO_Transport::generate_request_header (opdetails,
+ spec,
+ msg);
+}
+
+
+int
+TAO::HTIOP::Transport::messaging_init (CORBA::Octet major,
+ CORBA::Octet minor)
+{
+ this->messaging_object_->init (major,
+ minor);
+ return 1;
+}
+
+int
+TAO::HTIOP::Transport::tear_listen_point_list (TAO_InputCDR &cdr)
+{
+ CORBA::Boolean byte_order;
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ return -1;
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ ::HTIOP::ListenPointList listen_list;
+ if ((cdr >> listen_list) == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"tear_listen_point_list: no list\n"),-1);
+ //return -1;
+
+ // As we have received a bidirectional information, set the flag to
+ // 1 (i.e., non-originating side)
+ this->bidirectional_flag (0);
+
+ // Just make sure that the connection handler is sane before we go
+ // head and do anything with it.
+ ACE_GUARD_RETURN (ACE_Lock,
+ ace_mon,
+ *this->handler_lock_,
+ -1);
+
+ return this->connection_handler_->process_listen_point_list (listen_list);
+}
+
+void
+TAO::HTIOP::Transport::set_bidir_context_info (TAO_Operation_Details &opdetails)
+{
+ ACE_UNUSED_ARG (opdetails);
+
+ // Get a handle to the acceptor registry
+ TAO_Acceptor_Registry &ar =
+ this->orb_core ()->lane_resources ().acceptor_registry ();
+
+ // Get the first acceptor in the registry
+ TAO_AcceptorSetIterator acceptor = ar.begin ();
+
+ ::HTIOP::ListenPointList listen_point_list;
+
+ for (;
+ acceptor != ar.end ();
+ acceptor++)
+ {
+ // Check whether it is a HTIOP acceptor
+ if ((*acceptor)->tag () == OCI_TAG_HTIOP_PROFILE)
+ {
+ if (this->get_listen_point (listen_point_list,
+ *acceptor) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("TAO (%P|%t) - TAO::HTIOP::Transport::set_bidir_info, "),
+ ACE_TEXT("error getting listen_point \n")));
+
+ return;
+ }
+ }
+ }
+
+ // We have the ListenPointList at this point. Create a output CDR
+ // stream at this point
+ TAO_OutputCDR cdr;
+
+ // Marshall the information into the stream
+ if ((cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER) == 0)
+ || (cdr << listen_point_list) == 0)
+ return;
+
+ // Add this info in to the svc_list
+ opdetails.request_service_context ().set_context (IOP::BI_DIR_IIOP,
+ cdr);
+
+ return;
+}
+
+int
+TAO::HTIOP::Transport::get_listen_point (::HTIOP::ListenPointList &lp_list,
+ TAO_Acceptor *acceptor)
+{
+ TAO::HTIOP::Acceptor *htiop_acceptor =
+ dynamic_cast<TAO::HTIOP::Acceptor *> (acceptor );
+
+ // Get the array of endpoints serviced by TAO::HTIOP::Acceptor
+ const ACE::HTBP::Addr *endpoint_addr =
+ htiop_acceptor->endpoints ();
+
+ // Get the endpoint count
+ size_t count =
+ htiop_acceptor->endpoint_count ();
+
+ // Get the local address of the connection
+ ACE::HTBP::Addr local_addr;
+ {
+ // Just make sure that the connection handler is sane before we go
+ // head and do anything with it.
+ ACE_GUARD_RETURN (ACE_Lock,
+ ace_mon,
+ *this->handler_lock_,
+ -1);
+
+ if (this->connection_handler_->peer ().get_local_addr (local_addr)
+ == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Could not resolve local ")
+ ACE_TEXT ("host address in ")
+ ACE_TEXT ("get_listen_point()\n")),
+ -1);
+ }
+ }
+
+ if (local_addr.get_port_number() != 0)
+ {
+
+ // Note: Looks like there is no point in sending the list of
+ // endpoints on interfaces on which this connection has not
+ // been established. If this is wrong, please correct me.
+ CORBA::String_var local_interface;
+
+ // Get the hostname for the local address
+ if (htiop_acceptor->hostname (this->orb_core_,
+ local_addr,
+ local_interface.out ()) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Could not resolve local host")
+ ACE_TEXT (" name \n")),
+ -1);
+ }
+
+ for (size_t index = 0;
+ index != count;
+ index++)
+ {
+ if (local_addr.get_ip_address()
+ == endpoint_addr[index].get_ip_address())
+ {
+ // Get the count of the number of elements
+ CORBA::ULong len = lp_list.length ();
+
+ // Increase the length by 1
+ lp_list.length (len + 1);
+
+ // We have the connection and the acceptor endpoint on the
+ // same interface
+ ::HTIOP::ListenPoint &point = lp_list[len];
+ point.host = CORBA::string_dup (local_interface.in ());
+ point.port = endpoint_addr[index].get_port_number ();
+ }
+ }
+ }
+ else
+ {
+ // Only add a single listen point based on the htid in the addr
+ lp_list.length (1);
+ ::HTIOP::ListenPoint &point = lp_list[0];
+ point.host = CORBA::string_dup ("");
+ point.port = 0;
+ point.htid = endpoint_addr[0].get_htid();
+ }
+ return 1;
+}
+
+
+TAO_Connection_Handler *
+TAO::HTIOP::Transport::invalidate_event_handler_i (void)
+{
+ TAO_Connection_Handler * eh = this->connection_handler_;
+ this->connection_handler_ = 0;
+ return eh;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.h b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.h
new file mode 100644
index 00000000000..6db9ca8dcfc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Transport.h
@@ -0,0 +1,168 @@
+// -*- C++ -*-
+
+// ===================================================================
+/**
+ * @file HTIOP_Transport.h
+ *
+ * $Id$
+ *
+ * @author Originally by Fred Kuhns <fredk@cs.wustl.edu>
+ * @author Modified by Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+// ===================================================================
+
+#ifndef TAO_HTIOP_TRANSPORT_H
+#define TAO_HTIOP_TRANSPORT_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/HTIOP/HTIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/HTIOPC.h"
+
+#include "ace/HTBP/HTBP_Stream.h"
+
+#include "tao/Transport.h"
+
+#include "ace/Synch.h"
+#include "ace/Svc_Handler.h"
+//#include "HTIOP/HTIOPC.h"
+
+# if defined (ACE_HAS_TEMPLATE_TYPEDEFS)
+# define ACE_HTBP_STREAM ACE::HTBP::Stream
+# else /* If TEMPLATES are broken in some form or another */
+# define ACE_HTBP_STREAM ACE::HTBP::Stream, ACE::HTBP::Addr
+#endif /* ACE_HAS_TEMPLATE_TYPEDEFS */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward decls.
+class TAO_ORB_Core;
+class TAO_Operation_Details;
+class TAO_Pluggable_Messaging;
+class TAO_Acceptor;
+class TAO_Adapter;
+
+namespace TAO
+{
+ namespace HTIOP
+ {
+ class Connection_Handler;
+
+ // Service Handler for this transport
+ typedef ACE_Svc_Handler<ACE_HTBP_STREAM, ACE_NULL_SYNCH>
+ SVC_HANDLER;
+
+ /**
+ * @class Transport
+ *
+ * @brief Specialization of the base Transport class to handle the
+ * HTIOP protocol.
+ *
+ *
+ *
+ */
+
+ class HTIOP_Export Transport : public TAO_Transport
+ {
+ public:
+
+ /// Constructor.
+ Transport (Connection_Handler *handler,
+ TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag);
+
+ /// Default destructor.
+ ~Transport (void);
+
+ protected:
+
+ /** @name Overridden Template Methods
+ *
+ * Please check the documentation in "tao/Transport.h" for more
+ * details.
+ */
+ //@{
+
+ virtual ACE_Event_Handler * event_handler_i (void);
+ virtual TAO_Connection_Handler * invalidate_event_handler_i (void);
+
+ /// Access the underlying messaging object
+ virtual TAO_Pluggable_Messaging *messaging_object (void);
+
+ virtual ssize_t send (iovec *iov, int iovcnt,
+ size_t &bytes_transferred,
+ const ACE_Time_Value *timeout = 0);
+
+ virtual ssize_t recv (char *buf,
+ size_t len,
+ const ACE_Time_Value *s = 0);
+
+ virtual int register_handler (void);
+
+ virtual int send_message_shared (TAO_Stub *stub,
+ int message_semantics,
+ const ACE_Message_Block *message_block,
+ ACE_Time_Value *max_wait_time);
+
+
+ public:
+ /// @@TODO: These methods IMHO should have more meaningful
+ /// names. The names seem to indicate nothing.
+ virtual int send_request (TAO_Stub *stub,
+ TAO_ORB_Core *orb_core,
+ TAO_OutputCDR &stream,
+ int message_semantics,
+ ACE_Time_Value *max_wait_time);
+
+ virtual int send_message (TAO_OutputCDR &stream,
+ TAO_Stub *stub = 0,
+ int message_semantics =
+ Transport::TAO_TWOWAY_REQUEST,
+ ACE_Time_Value *max_time_wait = 0);
+
+ // @@ This is probably not needed - Priyanka
+ // This is needed because we want to send additional information
+ // such as session id etc. in the header.
+ virtual int generate_request_header (TAO_Operation_Details &opdetails,
+ TAO_Target_Specification &spec,
+ TAO_OutputCDR &msg);
+
+
+ virtual int messaging_init (CORBA::Octet major,
+ CORBA::Octet minor);
+
+ virtual int tear_listen_point_list (TAO_InputCDR &cdr);
+
+ virtual TAO_Connection_Handler * connection_handler_i (void);
+
+ //@}
+
+ private:
+
+ /// Set the Bidirectional context info in the service context list
+ void set_bidir_context_info (TAO_Operation_Details &opdetails);
+
+ /// Add the listen points in <acceptor> to the <listen_point_list>
+ /// if this connection is in the same interface as that of the
+ /// endpoints in the <acceptor>
+ int get_listen_point (::HTIOP::ListenPointList &listen_point_list,
+ TAO_Acceptor *acceptor);
+
+ /// The connection service handler used for accessing lower layer
+ /// communication protocols.
+ Connection_Handler *connection_handler_;
+
+ /// Our messaging object.
+ TAO_Pluggable_Messaging *messaging_object_;
+ };
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TRANSPORT_H */
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/README.txt b/TAO/orbsvcs/orbsvcs/HTIOP/README.txt
new file mode 100644
index 00000000000..567e302009e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/README.txt
@@ -0,0 +1,154 @@
+ HTTP Tunneling Inter-ORB Protocol
+
+Introduction
+Components
+HTTP Tunneling Protocol
+HTTP Tunneling Inter-ORB Protocol
+
+Introduction
+
+
+
+1.Terminology
+
+Inside - This refers to any peer that is inside a firewall protected
+enclave, and must forward requests to services through a proxy. It is
+assumed with this protocol that the proxy restricts traffic to HTTP
+requests/replies.
+
+Outside - This refers to any peer is outside of the firewall
+protecting inside peers. The outside peer advertises an endpoint that
+is reachable from the inside peer's proxy.
+
+Proxy - The gateway through which HTTP requests may flow. It is
+assumed that no configuration changes to the proxy are permitted. For
+now, Squid is the only HTTP proxy that is supported by HTIOP, although
+others may also work.
+
+HTID - A unique identifier for peers inside the firewall. This may be
+a self-generated UUID, or it may be an externally generated
+domain-specific identity. This identity is important to allow outside
+peers to identify many different clients, which may reside on locally
+similar or non-routable networks, such as 10.*.*.* or 192.168.*.*.
+
+HTIOP_Factory - This is the service configuration class used to load
+the pluggable protocol via the ACE Service Configuratior. The
+HTIOP_Factory takes the following initialization arguments:
+
+-config <filename> Specifies the text file containing HTBP specific
+ configuration. This value is optional.
+-env_persist <filename> Specifies the name of a flat file containing
+ a previously persisted configuration, or to which
+ new configuration will be persisted. If both
+ -config and -env_persist are specified, the memory
+ mapped file will be loaded first, then the text
+ file interpreted. The new configuration will then
+ be persisted in the flat file.
+-win32_reg If set, then the windows' registry will be used
+ rather than the memory mapped file. This feature
+ is available only on windows.
+-inside [-1|0|1] Explicitly declare that the endpoint is inside or
+ outside the firewall. When set to the default -1,
+ the HTIOP_Factory uses the ACE_HTBP_Environment
+ proxy_host setting to determine if it is inside or
+ outside the firewall. It is only important to be
+ explicit about inside/outside definition when
+ testing without a real proxy. HTIOP is an
+ asymmetric protocol, peers outside the firewall
+ cannot initiate connections to inside peers, and
+ only an inside peer can talk to an outside peer.
+
+2. Components
+
+The HTTP tunneling protocol support consists of two libraries.
+
+. libACE_HTBP is the library that implements the low level HTBP
+Protocol. This allows the the communication between the inside and the
+outside peers through a firewall proxy. It supports direct connections
+as well though the default is the use of a proxy. This library should
+be linked into code that wishes to support such communication.
+
+. libTAO_HTIOP implements an Inter-ORB Protocol, HTIOP, that allows
+TAO to utilize the HTBP Protocol.
+
+3. Directory Structure
+
+. $ACE_ROOT/ace/HTBP
+ Files used for implementing the low level HTBP Protocol.
+
+. $TAO_ROOT/orbsvcs/orbsvcs/HTIOP
+ Files that implements HTIOP protocol.
+
+. $ACE_ROOT/tests/HTBP
+ Tests for the low level HTBP Protocol.
+
+. $TAO_ROOT/orbsvcs/tests/HTIOP
+ Tests for the HTIOP protocol.
+
+4. Requirements for using HTBP Protocol
+ Refer to ace/HTBP/README for details on configuring HTBP clients
+
+5. Using HTIOP in applications
+
+ HTIOP is an Asymmetric protocol. This means that applications inside
+ the firewall must be configured differently than applications on the
+ outside. Inside peers are the only ones which may initiate
+ connections. If a peer to peer relationship is desired, where CORBA
+ invocations flow in either direction, then Bidirectional GIOP must
+ be used.
+
+ One of the challenges imposed by the use of a proxy is that if a
+ connection is idle for long enough the connection may be
+ closed. This means the inside peer must reopen it by sending another
+ request. Since the outside peer cannot reopen the connection, it
+ will queue messages until the inside peer re-establishes a
+ connection, at which time all queued messages are sent.
+
+ A second challenge is that while a proxy will open multiple TCP/IP
+ connections to a server (the outside peer), when faced with multiple
+ simultanious HTTP requests, it will reuse those connections at will
+ to forward any subsequent requests. This means that a socket is
+ associated with a particular HTIOP session for only one HTTP
+ request/reply.
+
+ Apart from loading the protocol, and declaring an endpoint, no
+ modifications to application code are required in order to use
+ HTIOP.
+
+5a. Loading the protocol.
+
+ HTIOP is loaded via svc.conf. See the list of initialization options
+ shown above for details. Here is a sample svc.conf file for loading
+ HTIOP, as it would be used in a server.
+
+dynamic HTIOP_Factory Service_Object *
+ TAO_HTIOP:_make_TAO_HTIOP_Protocol_Factory () ""
+
+static Resource_Factory "-ORBProtocolFactory HTIOP_Factory"
+
+ This example is specifically for a server since no configuration
+ file is specified meaning no proxy host value is set. The following
+ examples could be used to configure a client.
+
+#used on the inside, but no proxy configured
+dynamic HTIOP_Factory Service_Object *
+ TAO_HTIOP:_make_TAO_HTIOP_Protocol_Factory ()
+ "-inside 1"
+
+#used on the inside, with proxy configuration supplied
+dynamic HTIOP_Factory Service_Object *
+ TAO_HTIOP:_make_TAO_HTIOP_Protocol_Factory ()
+ "-config HTBP_Config.txt"
+
+static Resource_Factory "-ORBProtocolFactory HTIOP_Factory"
+
+5b. Declaring an endpoint.
+
+ Since most HTTP proxies restrict outgoing connections only to port
+ 80, it is a requirement that an explicit endpoint be set for
+ HTIOP. The signature is very similar to that of IIOP:
+
+ -ORBEndpoint HTIOP://hostname:80[/hostname_in_ior=www.mybiz.com]
+
+ The optional hostname_in_ior allows HTIOP to be used behind a NAT
+ firewall.
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/htiop_endpoints.pidl b/TAO/orbsvcs/orbsvcs/HTIOP/htiop_endpoints.pidl
new file mode 100644
index 00000000000..91ec7acef3a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/htiop_endpoints.pidl
@@ -0,0 +1,42 @@
+// -*- IDL -*-
+//
+// $Id$
+
+/*
+ * This file contains idl definition for data structures used to
+ * encapsulate data in TAO_TAG_ENDPOINTS tagged component. This
+ * TAO-specific component is used for transmission of multiple
+ * endpoints per single profile. Data structures defined here are
+ * used for transmission of htiop Endpoints. See HTIOP_Profile.*
+ * for more details.
+ *
+ * This file was used to generate the code in
+ * htiop_endpoints.* The command used to generate code
+ * is:
+ *
+ * tao_idl
+ * -Gp -Gd -Ge 1 -Sc -Sa -DCORBA3 -Sci \
+ * -Wb,export_macro=HTIOP_Export \
+ * -Wb,export_include="HTIOP_Export.h" \
+ * -Wb,pre_include="ace/pre.h" \
+ * -Wb,post_include="ace/post.h" \
+ * htiop_endpoints.pidl
+ */
+
+#ifndef _HTIOP_ENDPOINTS_IDL_
+#define _HTIOP_ENDPOINTS_IDL_
+
+// Stores information for a single HTIOP endpoint.
+struct HTIOP_Endpoint_Info
+{
+ string host;
+ short port;
+ string htid;
+};
+
+// Stores information for a collection of HTIOP endpoints.
+typedef sequence <HTIOP_Endpoint_Info> HTIOPEndpointSequence;
+
+#pragma prefix ""
+
+#endif /* _HTIOP_ENDPOINTS_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/htiop_endpointsC.cpp b/TAO/orbsvcs/orbsvcs/HTIOP/htiop_endpointsC.cpp
new file mode 100644
index 00000000000..e0db9e121f9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/htiop_endpointsC.cpp
@@ -0,0 +1,222 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:291
+
+
+#include "tao/AnyTypeCode/Null_RefCount_Policy.h"
+#include "tao/AnyTypeCode/TypeCode_Constants.h"
+#include "tao/AnyTypeCode/Alias_TypeCode_Static.h"
+#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h"
+#include "tao/AnyTypeCode/String_TypeCode_Static.h"
+#include "tao/AnyTypeCode/Struct_TypeCode_Static.h"
+#include "tao/AnyTypeCode/TypeCode_Struct_Field.h"
+#include "orbsvcs/HTIOP/htiop_endpointsC.h"
+#include "tao/CDR.h"
+
+#if defined (__BORLANDC__)
+#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig
+#endif /* __BORLANDC__ */
+
+// TAO_IDL - Generated from
+// be\be_visitor_arg_traits.cpp:69
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Arg traits specializations.
+namespace TAO
+{
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_typecode/struct_typecode.cpp:74
+
+static TAO::TypeCode::Struct_Field<char const *, CORBA::TypeCode_ptr const *> const _tao_fields_HTIOP_Endpoint_Info[] =
+ {
+ { "host", &CORBA::_tc_string },
+ { "port", &CORBA::_tc_short },
+ { "htid", &CORBA::_tc_string }
+
+ };
+static TAO::TypeCode::Struct<char const *,
+ CORBA::TypeCode_ptr const *,
+ TAO::TypeCode::Struct_Field<char const *,
+ CORBA::TypeCode_ptr const *> const *,
+ TAO::Null_RefCount_Policy>
+ _tao_tc_HTIOP_Endpoint_Info (
+ CORBA::tk_struct,
+ "IDL:HTIOP_Endpoint_Info:1.0",
+ "HTIOP_Endpoint_Info",
+ _tao_fields_HTIOP_Endpoint_Info,
+ 3);
+
+::CORBA::TypeCode_ptr const _tc_HTIOP_Endpoint_Info =
+ &_tao_tc_HTIOP_Endpoint_Info;
+
+// TAO_IDL - Generated from
+// be\be_visitor_structure/structure_cs.cpp:66
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_sequence/sequence_cs.cpp:65
+
+#if !defined (_HTIOPENDPOINTSEQUENCE_CS_)
+#define _HTIOPENDPOINTSEQUENCE_CS_
+
+HTIOPEndpointSequence::HTIOPEndpointSequence (void)
+{}
+
+HTIOPEndpointSequence::HTIOPEndpointSequence (
+ CORBA::ULong max
+ )
+ : TAO::unbounded_value_sequence<
+ HTIOP_Endpoint_Info
+ >
+ (max)
+{}
+
+HTIOPEndpointSequence::HTIOPEndpointSequence (
+ CORBA::ULong max,
+ CORBA::ULong length,
+ HTIOP_Endpoint_Info * buffer,
+ CORBA::Boolean release
+ )
+ : TAO::unbounded_value_sequence<
+ HTIOP_Endpoint_Info
+ >
+ (max, length, buffer, release)
+{}
+
+HTIOPEndpointSequence::HTIOPEndpointSequence (
+ const HTIOPEndpointSequence &seq
+ )
+ : TAO::unbounded_value_sequence<
+ HTIOP_Endpoint_Info
+ >
+ (seq)
+{}
+
+HTIOPEndpointSequence::~HTIOPEndpointSequence (void)
+{}
+
+#endif /* end #if !defined */
+
+// TAO_IDL - Generated from
+// be\be_visitor_typecode/alias_typecode.cpp:31
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_typecode/typecode_defn.cpp:925
+
+
+#ifndef _TAO_TYPECODE_HTIOPEndpointSequence_GUARD
+#define _TAO_TYPECODE_HTIOPEndpointSequence_GUARD
+namespace TAO
+{
+ namespace TypeCode
+ {
+ TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *,
+ TAO::Null_RefCount_Policy>
+ HTIOPEndpointSequence_0 (
+ CORBA::tk_sequence,
+ &_tc_HTIOP_Endpoint_Info,
+ 0U);
+
+ ::CORBA::TypeCode_ptr const tc_HTIOPEndpointSequence_0 =
+ &HTIOPEndpointSequence_0;
+
+ }
+}
+
+
+#endif /* _TAO_TYPECODE_HTIOPEndpointSequence_GUARD */
+static TAO::TypeCode::Alias<char const *,
+ CORBA::TypeCode_ptr const *,
+ TAO::Null_RefCount_Policy>
+ _tao_tc_HTIOPEndpointSequence (
+ CORBA::tk_alias,
+ "IDL:HTIOPEndpointSequence:1.0",
+ "HTIOPEndpointSequence",
+ &TAO::TypeCode::tc_HTIOPEndpointSequence_0);
+
+::CORBA::TypeCode_ptr const _tc_HTIOPEndpointSequence =
+ &_tao_tc_HTIOPEndpointSequence;
+
+// TAO_IDL - Generated from
+// be\be_visitor_structure/cdr_op_cs.cpp:61
+
+CORBA::Boolean operator<< (
+ TAO_OutputCDR &strm,
+ const HTIOP_Endpoint_Info &_tao_aggregate
+ )
+{
+ return
+ (strm << _tao_aggregate.host.in ()) &&
+ (strm << _tao_aggregate.port) &&
+ (strm << _tao_aggregate.htid.in ());
+}
+
+CORBA::Boolean operator>> (
+ TAO_InputCDR &strm,
+ HTIOP_Endpoint_Info &_tao_aggregate
+ )
+{
+ return
+ (strm >> _tao_aggregate.host.out ()) &&
+ (strm >> _tao_aggregate.port) &&
+ (strm >> _tao_aggregate.htid.out ());
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_sequence/cdr_op_cs.cpp:96
+
+#if !defined _TAO_CDR_OP_HTIOPEndpointSequence_CPP_
+#define _TAO_CDR_OP_HTIOPEndpointSequence_CPP_
+
+CORBA::Boolean operator<< (
+ TAO_OutputCDR &strm,
+ const HTIOPEndpointSequence &_tao_sequence
+ )
+{
+ return TAO::marshal_sequence(strm, _tao_sequence);
+}
+
+CORBA::Boolean operator>> (
+ TAO_InputCDR &strm,
+ HTIOPEndpointSequence &_tao_sequence
+ )
+{
+ return TAO::demarshal_sequence(strm, _tao_sequence);
+}
+
+#endif /* _TAO_CDR_OP_HTIOPEndpointSequence_CPP_ */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/htiop_endpointsC.h b/TAO/orbsvcs/orbsvcs/HTIOP/htiop_endpointsC.h
new file mode 100644
index 00000000000..e8a22b50479
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/HTIOP/htiop_endpointsC.h
@@ -0,0 +1,199 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:153
+
+#ifndef _TAO_IDL_ORIG_HTIOP_ENDPOINTSC_H_
+#define _TAO_IDL_ORIG_HTIOP_ENDPOINTSC_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/HTIOP/HTIOP_Export.h"
+#include "tao/ORB.h"
+#include "tao/Environment.h"
+#include "tao/Sequence_T.h"
+#include "tao/Seq_Var_T.h"
+#include "tao/Seq_Out_T.h"
+#include "tao/VarOut_T.h"
+#include "tao/String_Manager_T.h"
+
+#if defined (TAO_EXPORT_MACRO)
+#undef TAO_EXPORT_MACRO
+#endif
+#define TAO_EXPORT_MACRO HTIOP_Export
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+#if defined (__BORLANDC__)
+#pragma option push -w-rvl -w-rch -w-ccc -w-inl
+#endif /* __BORLANDC__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// TAO_IDL - Generated from
+// be\be_type.cpp:258
+
+struct HTIOP_Endpoint_Info;
+
+typedef
+ TAO_Var_Var_T<
+ HTIOP_Endpoint_Info
+ >
+ HTIOP_Endpoint_Info_var;
+
+typedef
+ TAO_Out_T<
+ HTIOP_Endpoint_Info
+ >
+ HTIOP_Endpoint_Info_out;
+
+// TAO_IDL - Generated from
+// be\be_visitor_structure/structure_ch.cpp:52
+
+struct HTIOP_Export HTIOP_Endpoint_Info
+{
+ typedef HTIOP_Endpoint_Info_var _var_type;
+
+
+ TAO::String_Manager host;
+ CORBA::Short port;
+ TAO::String_Manager htid;
+};
+
+// TAO_IDL - Generated from
+// be\be_visitor_typecode/typecode_decl.cpp:44
+
+extern HTIOP_Export ::CORBA::TypeCode_ptr const _tc_HTIOP_Endpoint_Info;
+
+// TAO_IDL - Generated from
+// be\be_visitor_sequence/sequence_ch.cpp:101
+
+#if !defined (_HTIOPENDPOINTSEQUENCE_CH_)
+#define _HTIOPENDPOINTSEQUENCE_CH_
+
+class HTIOPEndpointSequence;
+
+typedef
+ TAO_VarSeq_Var_T<
+ HTIOPEndpointSequence
+ >
+ HTIOPEndpointSequence_var;
+
+typedef
+ TAO_Seq_Out_T<
+ HTIOPEndpointSequence
+ >
+ HTIOPEndpointSequence_out;
+
+class HTIOP_Export HTIOPEndpointSequence
+ : public
+ TAO::unbounded_value_sequence<
+ HTIOP_Endpoint_Info
+ >
+{
+public:
+ HTIOPEndpointSequence (void);
+ HTIOPEndpointSequence (CORBA::ULong max);
+ HTIOPEndpointSequence (
+ CORBA::ULong max,
+ CORBA::ULong length,
+ HTIOP_Endpoint_Info* buffer,
+ CORBA::Boolean release = false
+ );
+ HTIOPEndpointSequence (const HTIOPEndpointSequence &);
+ ~HTIOPEndpointSequence (void);
+
+ typedef HTIOPEndpointSequence_var _var_type;
+};
+
+#endif /* end #if !defined */
+
+// TAO_IDL - Generated from
+// be\be_visitor_typecode/typecode_decl.cpp:44
+
+extern HTIOP_Export ::CORBA::TypeCode_ptr const _tc_HTIOPEndpointSequence;
+
+// TAO_IDL - Generated from
+// be\be_visitor_traits.cpp:61
+
+// Traits specializations.
+namespace TAO
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_structure/cdr_op_ch.cpp:54
+
+HTIOP_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const HTIOP_Endpoint_Info &);
+HTIOP_Export CORBA::Boolean operator>> (TAO_InputCDR &, HTIOP_Endpoint_Info &);
+
+// TAO_IDL - Generated from
+// be\be_visitor_sequence/cdr_op_ch.cpp:71
+
+#if !defined _TAO_CDR_OP_HTIOPEndpointSequence_H_
+#define _TAO_CDR_OP_HTIOPEndpointSequence_H_
+
+HTIOP_Export CORBA::Boolean operator<< (
+ TAO_OutputCDR &,
+ const HTIOPEndpointSequence &
+ );
+HTIOP_Export CORBA::Boolean operator>> (
+ TAO_InputCDR &,
+ HTIOPEndpointSequence &
+ );
+
+#endif /* _TAO_CDR_OP_HTIOPEndpointSequence_H_ */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:955
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#if defined (__BORLANDC__)
+#pragma option pop
+#endif /* __BORLANDC__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* ifndef */
+
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService.mpc b/TAO/orbsvcs/orbsvcs/IFRService.mpc
new file mode 100644
index 00000000000..e0c158052da
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService.mpc
@@ -0,0 +1,21 @@
+// -*- MPC -*-
+// $Id$
+
+project(IFRService) : orbsvcslib, core, typecodefactory, svc_utils, iortable, minimum_corba {
+ avoids += ace_for_tao // Requires ace/Configuration
+ sharedname = TAO_IFRService
+ dynamicflags = TAO_IFRSERVICE_BUILD_DLL
+ tagchecks += IFRService
+
+ IDL_Files {
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ IFRService {
+ IFRService
+ }
+ }
+
+ Template_Files {
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/IFRService.rc b/TAO/orbsvcs/orbsvcs/IFRService.rc
new file mode 100644
index 00000000000..fd74244fa4f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "IFRService\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "IFRServiceDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "IFRService.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/AbstractInterfaceDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/AbstractInterfaceDef_i.cpp
new file mode 100644
index 00000000000..9c7831e7387
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/AbstractInterfaceDef_i.cpp
@@ -0,0 +1,62 @@
+// $Id$
+
+#include "orbsvcs/IFRService/AbstractInterfaceDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+
+ACE_RCSID (IFRService,
+ AbstractInterfaceDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_AbstractInterfaceDef_i::TAO_AbstractInterfaceDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Container_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo),
+ TAO_InterfaceDef_i (repo)
+{
+}
+
+TAO_AbstractInterfaceDef_i::~TAO_AbstractInterfaceDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_AbstractInterfaceDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_AbstractInterface;
+}
+
+CORBA::Boolean
+TAO_AbstractInterfaceDef_i::is_a (const char *interface_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->is_a_i (interface_id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_AbstractInterfaceDef_i::is_a_i (const char *interface_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (ACE_OS::strcmp (interface_id, "IDL:omg.org/CORBA/AbstractBase:1.0") == 0)
+ {
+ return 1;
+ }
+
+ return this->TAO_InterfaceDef_i::is_a_i (interface_id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/AbstractInterfaceDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/AbstractInterfaceDef_i.h
new file mode 100644
index 00000000000..b753a1afa16
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/AbstractInterfaceDef_i.h
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// AbstractInterfaceDef_i.h
+//
+// = DESCRIPTION
+// AbstractInterfaceDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_ABSTRACTINTERFACEDEF_I_H
+#define TAO_ABSTRACTINTERFACEDEF_I_H
+
+#include "orbsvcs/IFRService/InterfaceDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_AbstractInterfaceDef_i
+ : public virtual TAO_InterfaceDef_i
+{
+ // = TITLE
+ // TAO_AbstractInterfaceDef_i
+ //
+ // = DESCRIPTION
+ // Represents an abstract interface definition.
+ //
+public:
+ TAO_AbstractInterfaceDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_AbstractInterfaceDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual CORBA::Boolean is_a (
+ const char *interface_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Boolean is_a_i (
+ const char *interface_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_ABSTRACTINTERFACEDEF_I_H */
+
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/AliasDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/AliasDef_i.cpp
new file mode 100644
index 00000000000..308a637d9ac
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/AliasDef_i.cpp
@@ -0,0 +1,141 @@
+// $Id$
+
+#include "orbsvcs/IFRService/AliasDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ AliasDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_AliasDef_i::TAO_AliasDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo),
+ TAO_TypedefDef_i (repo)
+{
+}
+
+TAO_AliasDef_i::~TAO_AliasDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_AliasDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Alias;
+}
+
+CORBA::TypeCode_ptr
+TAO_AliasDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_AliasDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ id);
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ name);
+
+ ACE_TString original_type;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "original_type",
+ original_type);
+
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (original_type,
+ this->repo_);
+ if (0 == impl)
+ {
+ ACE_THROW_RETURN ( CORBA::OBJECT_NOT_EXIST(), CORBA::TypeCode::_nil () );
+ }
+
+ CORBA::TypeCode_var tc = impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->repo_->tc_factory ()->create_alias_tc (id.c_str (),
+ name.c_str (),
+ tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_AliasDef_i::original_type_def (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::IDLType::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return this->original_type_def_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_AliasDef_i::original_type_def_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString original_type;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "original_type",
+ original_type);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (original_type,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_AliasDef_i::original_type_def (CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->original_type_def_i (original_type_def
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_AliasDef_i::original_type_def_i (CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ char *original_type =
+ TAO_IFR_Service_Utils::reference_to_path (original_type_def);
+
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "original_type",
+ original_type);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/AliasDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/AliasDef_i.h
new file mode 100644
index 00000000000..7cc9c8826ca
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/AliasDef_i.h
@@ -0,0 +1,101 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// AliasDef_i.h
+//
+// = DESCRIPTION
+// AliasDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_ALIASDEF_I_H
+#define TAO_ALIASDEF_I_H
+
+#include "orbsvcs/IFRService/TypedefDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_AliasDef_i : public virtual TAO_TypedefDef_i
+{
+public:
+ // = TITLE
+ // TAO_AliasDef_i
+ //
+ // = DESCRIPTION
+ // Represents an OMG IDL typedef that aliases another definition.
+ //
+public:
+ TAO_AliasDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_AliasDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::IDLType_ptr original_type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::IDLType_ptr original_type_def_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void original_type_def (
+ CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void original_type_def_i (
+ CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_ALIASDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ArrayDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ArrayDef_i.cpp
new file mode 100644
index 00000000000..70022598977
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ArrayDef_i.cpp
@@ -0,0 +1,279 @@
+// $Id$
+
+#include "orbsvcs/IFRService/ArrayDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ ArrayDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ArrayDef_i::TAO_ArrayDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_IDLType_i (repo)
+{
+}
+
+TAO_ArrayDef_i::~TAO_ArrayDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_ArrayDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Array;
+}
+
+void
+TAO_ArrayDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_ArrayDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Only if it is (w)string, fixed, array or sequence.
+ this->destroy_element_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ name);
+
+ this->repo_->config ()->remove_section (this->repo_->arrays_key (),
+ name.c_str (),
+ 0);
+}
+
+CORBA::TypeCode_ptr
+TAO_ArrayDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_ArrayDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::TypeCode_var element_typecode =
+ this->element_type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ CORBA::ULong length = this->length_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->repo_->tc_factory ()->create_array_tc (
+ length,
+ element_typecode.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+CORBA::ULong
+TAO_ArrayDef_i::length (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->length_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ULong
+TAO_ArrayDef_i::length_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ u_int length = 0;
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "length",
+ length);
+
+ return static_cast<CORBA::ULong> (length);
+}
+
+void
+TAO_ArrayDef_i::length (CORBA::ULong length
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->length_i (length
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ArrayDef_i::length_i (CORBA::ULong length
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->set_integer_value (this->section_key_,
+ "length",
+ length);
+}
+
+CORBA::TypeCode_ptr
+TAO_ArrayDef_i::element_type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->element_type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_ArrayDef_i::element_type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString element_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "element_path",
+ element_path);
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (element_path,
+ this->repo_);
+
+ return impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_ArrayDef_i::element_type_def (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::IDLType::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return this->element_type_def_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_ArrayDef_i::element_type_def_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString element_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "element_path",
+ element_path);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (element_path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ArrayDef_i::element_type_def (CORBA::IDLType_ptr element_type_def
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->element_type_def_i (element_type_def
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ArrayDef_i::element_type_def_i (CORBA::IDLType_ptr element_type_def
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->destroy_element_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ char *new_element_path =
+ TAO_IFR_Service_Utils::reference_to_path (element_type_def);
+
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "element_path",
+ new_element_path);
+}
+
+void
+TAO_ArrayDef_i::destroy_element_type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString element_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "element_path",
+ element_path);
+
+ ACE_Configuration_Section_Key element_key;
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ element_path,
+ element_key,
+ 0);
+
+ u_int kind = 0;
+ this->repo_->config ()->get_integer_value (element_key,
+ "def_kind",
+ kind);
+
+ CORBA::DefinitionKind def_kind =
+ TAO_IFR_Service_Utils::path_to_def_kind (element_path,
+ this->repo_);
+
+ switch (def_kind)
+ {
+ // These exist only as our elements, so the type should
+ // be destroyed when we are destroyed, or when our element type
+ // is mutated.
+ case CORBA::dk_String:
+ case CORBA::dk_Wstring:
+ case CORBA::dk_Fixed:
+ case CORBA::dk_Array:
+ case CORBA::dk_Sequence:
+ {
+ TAO_IDLType_i *impl = this->repo_->select_idltype (def_kind);
+ impl->section_key (element_key);
+
+ impl->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ArrayDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ArrayDef_i.h
new file mode 100644
index 00000000000..ec0d6966f8d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ArrayDef_i.h
@@ -0,0 +1,148 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ArrayDef_i.h
+//
+// = DESCRIPTION
+// ArrayDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_ARRAYDEF_I_H
+#define TAO_ARRAYDEF_I_H
+
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ArrayDef_i : public virtual TAO_IDLType_i
+{
+ // = TITLE
+ // TAO_ArrayDef_i
+ //
+ // = DESCRIPTION
+ // Represents an IDL array type.
+ //
+public:
+ TAO_ArrayDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_ArrayDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ULong length (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ULong length_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void length (
+ CORBA::ULong length
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void length_i (
+ CORBA::ULong length
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::TypeCode_ptr element_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::TypeCode_ptr element_type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::IDLType_ptr element_type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::IDLType_ptr element_type_def_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void element_type_def (
+ CORBA::IDLType_ptr element_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void element_type_def_i (
+ CORBA::IDLType_ptr element_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ void destroy_element_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Destroys an anonymous non-primitive element type.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_ARRAYDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/AttributeDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/AttributeDef_i.cpp
new file mode 100644
index 00000000000..0d9ce3b6a42
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/AttributeDef_i.cpp
@@ -0,0 +1,397 @@
+// $Id$
+
+#include "orbsvcs/IFRService/AttributeDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/ExceptionDef_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ AttributeDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_AttributeDef_i::TAO_AttributeDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo)
+{
+}
+
+TAO_AttributeDef_i::~TAO_AttributeDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_AttributeDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Attribute;
+}
+
+CORBA::Contained::Description *
+TAO_AttributeDef_i::describe (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_AttributeDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Contained::Description *desc_ptr = 0;
+ ACE_NEW_THROW_EX (desc_ptr,
+ CORBA::Contained::Description,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Contained::Description_var retval = desc_ptr;
+
+ retval->kind = CORBA::dk_Attribute;
+
+ CORBA::AttributeDescription *ad = 0;
+ ACE_NEW_RETURN (ad,
+ CORBA::AttributeDescription,
+ 0);
+
+ this->make_description (*ad
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval->value <<= ad;
+ return retval._retn ();
+}
+
+CORBA::TypeCode_ptr
+TAO_AttributeDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_AttributeDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString type_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "type_path",
+ type_path);
+
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (type_path,
+ this->repo_);
+
+ return impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_AttributeDef_i::type_def (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::IDLType::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return this->type_def_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_AttributeDef_i::type_def_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString type_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "type_path",
+ type_path);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (type_path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ CORBA::IDLType_var retval = CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return retval._retn ();
+}
+
+void
+TAO_AttributeDef_i::type_def (CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->type_def_i (type_def
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_AttributeDef_i::type_def_i (CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ char *type_path =
+ TAO_IFR_Service_Utils::reference_to_path (type_def);
+
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "type_path",
+ type_path);
+}
+
+CORBA::AttributeMode
+TAO_AttributeDef_i::mode (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::ATTR_NORMAL);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ATTR_NORMAL);
+
+ return this->mode_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::AttributeMode
+TAO_AttributeDef_i::mode_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ u_int mode = 0;
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "mode",
+ mode);
+
+ return static_cast<CORBA::AttributeMode> (mode);
+}
+
+void
+TAO_AttributeDef_i::mode (CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->mode_i (mode
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_AttributeDef_i::mode_i (CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->set_integer_value (this->section_key_,
+ "mode",
+ mode);
+}
+
+void
+TAO_AttributeDef_i::make_description (
+ CORBA::AttributeDescription &ad
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ad.name = this->name_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ad.id = this->id_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TString container_id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ container_id);
+
+ ad.defined_in = container_id.c_str ();
+
+ ad.version = this->version_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ad.type = this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ad.mode = this->mode_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CORBA::ExceptionDefSeq *
+TAO_AttributeDef_i::get_exceptions (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Unbounded_Queue<ACE_TString> path_queue;
+ int index = 0;
+ ACE_Configuration::VALUETYPE type;
+ ACE_TString field_name;
+
+ ACE_Configuration_Section_Key get_excepts_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "get_excepts",
+ 0,
+ get_excepts_key);
+
+ // This section may not have been created.
+ if (status == 0)
+ {
+ ACE_TString get_except_path;
+ ACE_Configuration_Section_Key dummy;
+
+ while (this->repo_->config ()->enumerate_values (get_excepts_key,
+ index++,
+ field_name,
+ type)
+ == 0)
+ {
+ this->repo_->config ()->get_string_value (get_excepts_key,
+ field_name.c_str (),
+ get_except_path);
+
+ // This exception may have been destroyed
+ status =
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ get_except_path,
+ dummy,
+ 0);
+
+ if (status == 0)
+ {
+ path_queue.enqueue_tail (get_except_path);
+ }
+ }
+ }
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (path_queue.size ());
+
+ CORBA::ExceptionDefSeq *get_ed_seq = 0;
+ ACE_NEW_THROW_EX (get_ed_seq,
+ CORBA::ExceptionDefSeq (size),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ get_ed_seq->length (size);
+ CORBA::ExceptionDefSeq_var retval = get_ed_seq;
+
+ for (CORBA::ULong i = 0; i < size; ++i)
+ {
+ ACE_TString path;
+ path_queue.dequeue_head (path);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Exception,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[i] = CORBA::ExceptionDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return retval._retn ();
+}
+
+CORBA::ExceptionDefSeq *
+TAO_AttributeDef_i::put_exceptions (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Unbounded_Queue<ACE_TString> path_queue;
+ int index = 0;
+ ACE_Configuration::VALUETYPE type;
+ ACE_TString field_name;
+
+ ACE_Configuration_Section_Key put_excepts_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "put_excepts",
+ 0,
+ put_excepts_key);
+
+ // This section may not have been created.
+ if (status == 0)
+ {
+ ACE_TString put_except_path;
+ ACE_Configuration_Section_Key dummy;
+
+ while (this->repo_->config ()->enumerate_values (put_excepts_key,
+ index++,
+ field_name,
+ type)
+ == 0)
+ {
+ this->repo_->config ()->get_string_value (put_excepts_key,
+ field_name.c_str (),
+ put_except_path);
+
+ // This exception may have been destroyed
+ status =
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ put_except_path,
+ dummy,
+ 0);
+
+ if (status == 0)
+ {
+ path_queue.enqueue_tail (put_except_path);
+ }
+ }
+ }
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (path_queue.size ());
+
+ CORBA::ExceptionDefSeq *put_ed_seq = 0;
+ ACE_NEW_THROW_EX (put_ed_seq,
+ CORBA::ExceptionDefSeq (size),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ put_ed_seq->length (size);
+ CORBA::ExceptionDefSeq_var retval = put_ed_seq;
+
+ for (CORBA::ULong i = 0; i < size; ++i)
+ {
+ ACE_TString path;
+ path_queue.dequeue_head (path);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Exception,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[i] = CORBA::ExceptionDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return retval._retn ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/AttributeDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/AttributeDef_i.h
new file mode 100644
index 00000000000..d08b3dfa119
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/AttributeDef_i.h
@@ -0,0 +1,152 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// AttributeDef_i.h
+//
+// = DESCRIPTION
+// AttributeDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_ATTRIBUTEDEF_I_H
+#define TAO_ATTRIBUTEDEF_I_H
+
+#include "orbsvcs/IFRService/Contained_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_AttributeDef_i : public virtual TAO_Contained_i
+{
+ // = TITLE
+ // TAO_AttributeDef_i
+ //
+ // = DESCRIPTION
+ // Represents the information that describes an attribute
+ // of an interface.
+ //
+public:
+ TAO_AttributeDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_AttributeDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::IDLType_ptr type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::IDLType_ptr type_def_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void type_def (
+ CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void type_def_i (
+ CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::AttributeMode mode (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::AttributeMode mode_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void mode (
+ CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void mode_i (
+ CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void make_description (
+ CORBA::AttributeDescription &ad
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Common code for InterfaceDef to call in
+ // making its own description.
+
+ // These two are called by Contained::move().
+ CORBA::ExceptionDefSeq *get_exceptions (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ExceptionDefSeq *put_exceptions (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_ATTRIBUTEDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.cpp
new file mode 100644
index 00000000000..43e5f4b3ffa
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.cpp
@@ -0,0 +1,569 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "orbsvcs/IFRService/ComponentContainer_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/InterfaceDef_i.h"
+#include "orbsvcs/IFRService/ComponentDef_i.h"
+#include "orbsvcs/IFRService/ValueDef_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+#include "ace/SString.h"
+
+ACE_RCSID (IFRService,
+ ComponentContainer_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+const char *TAO_ComponentContainer_i::tmp_name_holder_ = 0;
+
+TAO_ComponentContainer_i::TAO_ComponentContainer_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Container_i (repo)
+{
+}
+
+TAO_ComponentContainer_i::~TAO_ComponentContainer_i (void)
+{
+}
+
+CORBA::ComponentIR::ComponentDef_ptr
+TAO_ComponentContainer_i::create_component (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ComponentIR::ComponentDef_ptr base_component,
+ const CORBA::InterfaceDefSeq &supports_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ComponentIR::ComponentDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::ComponentDef::_nil ());
+
+ return this->create_component_i (id,
+ name,
+ version,
+ base_component,
+ supports_interfaces
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::ComponentDef_ptr
+TAO_ComponentContainer_i::create_component_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ComponentIR::ComponentDef_ptr base_component,
+ const CORBA::InterfaceDefSeq &supports_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_ComponentContainer_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (
+ this->def_kind (),
+ CORBA::dk_Component,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_ComponentContainer_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (CORBA::ComponentIR::ComponentDef::_nil ());
+
+ if (! CORBA::is_nil (base_component))
+ {
+ const char *base_path =
+ TAO_IFR_Service_Utils::reference_to_path (base_component);
+
+ // Get the servant's key into the temporary key holder, because
+ // the name clash checker for base valuetypes is static, and has
+ // no other way to know about a specific key.
+ this->repo_->config ()->expand_path (
+ this->repo_->root_key (),
+ base_path,
+ TAO_IFR_Service_Utils::tmp_key_,
+ 0
+ );
+ TAO_IFR_Service_Utils::name_exists (&TAO_ComponentDef_i::name_clash,
+ new_key,
+ this->repo_,
+ CORBA::dk_Component
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::ComponentDef::_nil ());
+
+ // Store the id for this - that's what ComponentDescription takes.
+ ACE_TString base_id;
+ this->repo_->config ()->get_string_value (TAO_IFR_Service_Utils::tmp_key_,
+ "id",
+ base_id);
+ this->repo_->config ()->set_string_value (new_key,
+ "base_component",
+ base_id);
+ }
+
+ CORBA::ULong count = supports_interfaces.length ();
+ CORBA::ULong i = 0;
+
+ if (count > 0)
+ {
+ ACE_Configuration_Section_Key supports_key;
+ this->repo_->config ()->open_section (new_key,
+ "supported",
+ 1,
+ supports_key);
+
+ this->repo_->config ()->set_integer_value (supports_key,
+ "count",
+ count);
+
+ const char *supported_path = 0;
+ char *stringified = 0;
+
+ for (i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ supported_path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ supports_interfaces[i]
+ );
+ this->repo_->config ()->set_string_value (supports_key,
+ stringified,
+ supported_path);
+ }
+ }
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Component,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::ComponentDef::_nil ());
+
+ return CORBA::ComponentIR::ComponentDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::HomeDef_ptr
+TAO_ComponentContainer_i::create_home (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ComponentIR::HomeDef_ptr base_home,
+ CORBA::ComponentIR::ComponentDef_ptr managed_component,
+ const CORBA::InterfaceDefSeq &supports_interfaces,
+ CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ComponentIR::HomeDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::HomeDef::_nil ());
+
+ return this->create_home_i (id,
+ name,
+ version,
+ base_home,
+ managed_component,
+ supports_interfaces,
+ primary_key
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::HomeDef_ptr
+TAO_ComponentContainer_i::create_home_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ComponentIR::HomeDef_ptr base_home,
+ CORBA::ComponentIR::ComponentDef_ptr managed_component,
+ const CORBA::InterfaceDefSeq &supports_interfaces,
+ CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_ComponentContainer_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (
+ this->def_kind (),
+ CORBA::dk_Home,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_ComponentContainer_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (CORBA::ComponentIR::HomeDef::_nil ());
+
+ char *base_path = 0;
+
+ if (! CORBA::is_nil (base_home))
+ {
+ base_path = TAO_IFR_Service_Utils::reference_to_path (base_home);
+ this->repo_->config ()->set_string_value (new_key,
+ "base_home",
+ base_path);
+ }
+
+ if (! CORBA::is_nil (managed_component))
+ {
+ base_path =
+ TAO_IFR_Service_Utils::reference_to_path (managed_component);
+ this->repo_->config ()->set_string_value (new_key,
+ "managed",
+ base_path);
+ }
+
+ CORBA::ULong length = supports_interfaces.length ();
+ CORBA::ULong i = 0;
+
+ if (length > 0)
+ {
+ ACE_Configuration_Section_Key supports_key;
+ this->repo_->config ()->open_section (new_key,
+ "supported",
+ 1,
+ supports_key);
+ this->repo_->config ()->set_integer_value (supports_key,
+ "count",
+ length);
+
+ char *supported_path = 0;
+ char *stringified = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ supported_path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ supports_interfaces[i]
+ );
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (supports_key,
+ stringified,
+ supported_path);
+ }
+ }
+
+ if (! CORBA::is_nil (primary_key))
+ {
+ char *primary_key_path =
+ TAO_IFR_Service_Utils::reference_to_path (primary_key);
+ this->repo_->config ()->set_string_value (new_key,
+ "primary_key",
+ primary_key_path);
+ }
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Home,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::HomeDef::_nil ());
+
+ return CORBA::ComponentIR::HomeDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::EventDef_ptr
+TAO_ComponentContainer_i::create_event (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::Boolean is_custom,
+ CORBA::Boolean is_abstract,
+ CORBA::ValueDef_ptr base_value,
+ CORBA::Boolean is_truncatable,
+ const CORBA::ValueDefSeq &abstract_base_values,
+ const CORBA::InterfaceDefSeq &supported_interfaces,
+ const CORBA::ExtInitializerSeq &initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ComponentIR::EventDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::EventDef::_nil ());
+
+ return this->create_event_i (id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::EventDef_ptr
+TAO_ComponentContainer_i::create_event_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::Boolean is_custom,
+ CORBA::Boolean is_abstract,
+ CORBA::ValueDef_ptr base_value,
+ CORBA::Boolean is_truncatable,
+ const CORBA::ValueDefSeq &abstract_base_values,
+ const CORBA::InterfaceDefSeq &supported_interfaces,
+ const CORBA::ExtInitializerSeq &initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_ComponentContainer_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (
+ this->def_kind (),
+ CORBA::dk_Event,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_ComponentContainer_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (CORBA::ComponentIR::EventDef::_nil ());
+
+ this->repo_->config ()->set_integer_value (new_key,
+ "is_custom",
+ (CORBA::ULong) is_custom);
+
+ this->repo_->config ()->set_integer_value (new_key,
+ "is_abstract",
+ (CORBA::ULong) is_abstract);
+
+ this->repo_->config ()->set_integer_value (new_key,
+ "is_truncatable",
+ (CORBA::ULong) is_truncatable);
+
+ if (!CORBA::is_nil (base_value))
+ {
+ const char *base_path =
+ TAO_IFR_Service_Utils::reference_to_path (base_value);
+
+ // Get the servant's key into the temporary key holder, because
+ // the name clash checker for base valuetypes is static, and has
+ // no other way to know about a specific key.
+ this->repo_->config ()->expand_path (
+ this->repo_->root_key (),
+ base_path,
+ TAO_IFR_Service_Utils::tmp_key_,
+ 0
+ );
+ TAO_IFR_Service_Utils::name_exists (&TAO_ValueDef_i::name_clash,
+ new_key,
+ this->repo_,
+ CORBA::dk_Value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::EventDef::_nil ());
+
+ ACE_TString base_value_id;
+ this->repo_->config ()->get_string_value (TAO_IFR_Service_Utils::tmp_key_,
+ "id",
+ base_value_id);
+
+ this->repo_->config ()->set_string_value (new_key,
+ "base_value",
+ base_value_id);
+ }
+
+ CORBA::ULong length = abstract_base_values.length ();
+ CORBA::ULong i = 0;
+
+ if (length > 0)
+ {
+ ACE_Configuration_Section_Key bases_key;
+ this->repo_->config ()->open_section (new_key,
+ "abstract_bases",
+ 1,
+ bases_key);
+
+ char *base_path = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ base_path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ abstract_base_values[i]
+ );
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (bases_key,
+ stringified,
+ base_path);
+ }
+ }
+
+ length = supported_interfaces.length ();
+
+ if (length > 0)
+ {
+ ACE_Configuration_Section_Key supported_key;
+ this->repo_->config ()->open_section (new_key,
+ "supported",
+ 1,
+ supported_key);
+
+ this->repo_->config ()->set_integer_value (supported_key,
+ "count",
+ length);
+ char *supported_path = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ supported_path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ supported_interfaces[i]
+ );
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (supported_key,
+ stringified,
+ supported_path);
+ }
+ }
+
+ length = initializers.length ();
+
+ if (length > 0)
+ {
+ ACE_Configuration_Section_Key initializers_key;
+ this->repo_->config ()->open_section (new_key,
+ "initializers",
+ 1,
+ initializers_key);
+
+ CORBA::ULong count = 0;
+ char *path = 0;
+ char *stringified = 0;
+ ACE_Configuration_Section_Key initializer_key;
+ ACE_Configuration_Section_Key outer_key;
+ ACE_Configuration_Section_Key inner_key;
+ ACE_TString excep_path;
+
+ for (i = 0; i < length; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (initializers_key,
+ stringified,
+ 1,
+ initializer_key);
+ this->repo_->config ()->set_string_value (
+ initializer_key,
+ "name",
+ initializers[i].name.in ()
+ );
+
+ count = initializers[i].members.length ();
+
+ if (count > 0)
+ {
+ this->repo_->config ()->open_section (initializer_key,
+ "params",
+ 1,
+ outer_key);
+
+ this->repo_->config ()->set_integer_value (outer_key,
+ "count",
+ count);
+
+ for (CORBA::ULong j = 0; j < count; ++j)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (j);
+ this->repo_->config ()->open_section (outer_key,
+ stringified,
+ 1,
+ inner_key);
+
+ this->repo_->config ()->set_string_value (
+ inner_key,
+ "arg_name",
+ initializers[i].members[j].name.in ()
+ );
+
+ path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ initializers[i].members[j].type_def.in ()
+ );
+
+ this->repo_->config ()->set_string_value (inner_key,
+ "arg_path",
+ path);
+ }
+ }
+
+ count = initializers[i].exceptions.length ();
+
+ if (count > 0)
+ {
+ this->repo_->config ()->open_section (initializer_key,
+ "excepts",
+ 1,
+ outer_key);
+
+ this->repo_->config ()->set_integer_value (outer_key,
+ "count",
+ count);
+
+ for (CORBA::ULong k = 0; k < count; ++k)
+ {
+ this->repo_->config ()->get_string_value (
+ this->repo_->repo_ids_key (),
+ initializers[i].exceptions[k].id.in (),
+ excep_path
+ );
+
+ stringified = TAO_IFR_Service_Utils::int_to_string (k);
+ this->repo_->config ()->set_string_value (outer_key,
+ stringified,
+ excep_path);
+ }
+ }
+ }
+ }
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Event,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::EventDef::_nil ());
+
+ return CORBA::ComponentIR::EventDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+int
+TAO_ComponentContainer_i::same_as_tmp_name (const char *name)
+{
+ return
+ ACE_OS::strcmp (TAO_ComponentContainer_i::tmp_name_holder_, name) == 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.h
new file mode 100644
index 00000000000..bc1c9e9fec6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.h
@@ -0,0 +1,144 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ComponentContainer_i.h
+//
+// = DESCRIPTION
+// ComponentContainer_i servant class.
+//
+// = AUTHOR
+// Jeff Parsons <j.parsons@vanderbilt.edu>
+//
+// ============================================================================
+
+#ifndef TAO_COMPONENTCONTAINER_I_H
+#define TAO_COMPONENTCONTAINER_I_H
+
+#include "orbsvcs/IFRService/Container_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/IFRService/IFR_ComponentsS.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ComponentContainer_i
+ : public virtual TAO_Container_i
+{
+ // = TITLE
+ // TAO_ComponentContainer_i
+ //
+ // = DESCRIPTION
+ // Base class used to form a containment hierarchy
+ // for component-related types in the Interface Repository.
+ // Defines the relevant create_* methods.
+ //
+public:
+ TAO_ComponentContainer_i (TAO_Repository_i *repo);
+
+ virtual ~TAO_ComponentContainer_i (void);
+
+ virtual CORBA::ComponentIR::ComponentDef_ptr create_component (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ComponentIR::ComponentDef_ptr base_component,
+ const CORBA::InterfaceDefSeq &supports_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ComponentIR::ComponentDef_ptr create_component_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ComponentIR::ComponentDef_ptr base_component,
+ const CORBA::InterfaceDefSeq &supports_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ComponentIR::HomeDef_ptr create_home (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ComponentIR::HomeDef_ptr base_home,
+ CORBA::ComponentIR::ComponentDef_ptr managed_component,
+ const CORBA::InterfaceDefSeq &supports_interfaces,
+ CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ComponentIR::HomeDef_ptr create_home_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ComponentIR::HomeDef_ptr base_home,
+ CORBA::ComponentIR::ComponentDef_ptr managed_component,
+ const CORBA::InterfaceDefSeq &supports_interfaces,
+ CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ComponentIR::EventDef_ptr create_event (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::Boolean is_custom,
+ CORBA::Boolean is_abstract,
+ CORBA::ValueDef_ptr base_value,
+ CORBA::Boolean is_truncatable,
+ const CORBA::ValueDefSeq &abstract_base_values,
+ const CORBA::InterfaceDefSeq &supported_interfaces,
+ const CORBA::ExtInitializerSeq &initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ComponentIR::EventDef_ptr create_event_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::Boolean is_custom,
+ CORBA::Boolean is_abstract,
+ CORBA::ValueDef_ptr base_value,
+ CORBA::Boolean is_truncatable,
+ const CORBA::ValueDefSeq &abstract_base_values,
+ const CORBA::InterfaceDefSeq &supported_interfaces,
+ const CORBA::ExtInitializerSeq &initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ static int same_as_tmp_name (const char *name);
+ // Called from TAO_IFR_Service_Utils::name_exisits.
+
+protected:
+ static const char *tmp_name_holder_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_COMPONENTCONTAINER_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ComponentDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ComponentDef_i.cpp
new file mode 100644
index 00000000000..eb42f8bb52b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ComponentDef_i.cpp
@@ -0,0 +1,794 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/ComponentDef_i.h"
+#include "orbsvcs/IFRService/ProvidesDef_i.h"
+#include "orbsvcs/IFRService/UsesDef_i.h"
+#include "orbsvcs/IFRService/EmitsDef_i.h"
+#include "orbsvcs/IFRService/PublishesDef_i.h"
+#include "orbsvcs/IFRService/ConsumesDef_i.h"
+#include "orbsvcs/IFRService/ExtAttributeDef_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ ComponentDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Specialization.
+template<>
+void
+TAO_Port_Desc_Seq_Utils<CORBA::ComponentIR::UsesDescriptionSeq>::get_is_multiple (
+ CORBA::ComponentIR::UsesDescriptionSeq &desc_seq,
+ ACE_Configuration *config,
+ ACE_Configuration_Section_Key &key,
+ CORBA::ULong index
+ )
+{
+ CORBA::ULong is_multiple = 0;
+ config->get_integer_value (key,
+ "is_multiple",
+ is_multiple);
+ desc_seq[index].is_multiple =
+ static_cast<CORBA::Boolean> (is_multiple);
+}
+
+// Specialization.
+template<>
+void
+TAO_Port_Desc_Seq_Utils<CORBA::ComponentIR::EventPortDescriptionSeq>::port_base_type (
+ CORBA::ComponentIR::EventPortDescriptionSeq &desc_seq,
+ ACE_TString &holder,
+ CORBA::ULong index
+ )
+{
+ desc_seq[index].event = holder.fast_rep ();
+}
+
+/// Specialization.
+template<>
+void
+TAO_Port_Utils<CORBA::ComponentIR::UsesDef>::set_is_multiple (
+ CORBA::Boolean is_multiple,
+ ACE_Configuration *config,
+ ACE_Configuration_Section_Key &key
+ )
+{
+ config->set_integer_value (key,
+ "is_multiple",
+ is_multiple);
+}
+
+// ==============================================================
+
+TAO_ComponentDef_i::TAO_ComponentDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Container_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo),
+ TAO_InterfaceDef_i (repo),
+ TAO_InterfaceAttrExtension_i (repo),
+ TAO_ExtInterfaceDef_i (repo)
+{
+}
+
+TAO_ComponentDef_i::~TAO_ComponentDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_ComponentDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Component;
+}
+
+void
+TAO_ComponentDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_ComponentDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Destroy our special subsections first, then call destroy_i
+ // on our base class.
+
+ TAO_IFR_Generic_Utils<TAO_ProvidesDef_i>::destroy_special (
+ "provides",
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ TAO_IFR_Generic_Utils<TAO_UsesDef_i>::destroy_special (
+ "uses",
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ TAO_IFR_Generic_Utils<TAO_EmitsDef_i>::destroy_special (
+ "emits",
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ TAO_IFR_Generic_Utils<TAO_PublishesDef_i>::destroy_special (
+ "publishes",
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ TAO_IFR_Generic_Utils<TAO_ConsumesDef_i>::destroy_special (
+ "consumes",
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ this->TAO_ExtInterfaceDef_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_ComponentDef_i::describe (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_ComponentDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ComponentIR::ComponentDescription cd;
+ TAO_IFR_Desc_Utils<CORBA::ComponentIR::ComponentDescription,
+ TAO_ComponentDef_i>::fill_desc_begin (
+ cd,
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (0);
+
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_component",
+ holder);
+ cd.base_component = holder.fast_rep ();
+
+ CORBA::ULong count = 0;
+ ACE_Configuration_Section_Key supports_key;
+ int status = this->repo_->config ()->open_section (this->section_key_,
+ "supported",
+ 0,
+ supports_key);
+
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (supports_key,
+ "count",
+ count);
+ }
+
+ cd.supported_interfaces.length (count);
+ char *stringified = 0;
+ CORBA::ULong i = 0;
+
+ for (i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->get_string_value (supports_key,
+ stringified,
+ holder);
+
+ cd.supported_interfaces[i] = holder.c_str ();
+ }
+
+ TAO_Port_Desc_Seq_Utils<
+ CORBA::ComponentIR::ProvidesDescriptionSeq
+ >::port_descriptions (cd.provided_interfaces,
+ this->repo_->config (),
+ this->section_key_,
+ "provides");
+
+ TAO_Port_Desc_Seq_Utils<
+ CORBA::ComponentIR::UsesDescriptionSeq
+ >::port_descriptions (cd.used_interfaces,
+ this->repo_->config (),
+ this->section_key_,
+ "uses");
+
+ TAO_Port_Desc_Seq_Utils<
+ CORBA::ComponentIR::EventPortDescriptionSeq
+ >::port_descriptions (cd.emits_events,
+ this->repo_->config (),
+ this->section_key_,
+ "emits");
+
+ TAO_Port_Desc_Seq_Utils<
+ CORBA::ComponentIR::EventPortDescriptionSeq
+ >::port_descriptions (cd.publishes_events,
+ this->repo_->config (),
+ this->section_key_,
+ "publishes");
+
+ TAO_Port_Desc_Seq_Utils<
+ CORBA::ComponentIR::EventPortDescriptionSeq
+ >::port_descriptions (cd.consumes_events,
+ this->repo_->config (),
+ this->section_key_,
+ "consumes");
+
+ count = 0;
+ ACE_Configuration_Section_Key attrs_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "attrs",
+ 0,
+ attrs_key);
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (attrs_key,
+ "count",
+ count);
+ }
+
+ cd.attributes.length (count);
+ ACE_Configuration_Section_Key attr_key;
+
+ for (i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (attrs_key,
+ stringified,
+ 0,
+ attr_key);
+
+ TAO_ExtAttributeDef_i impl (this->repo_);
+ impl.section_key (attr_key);
+ impl.fill_description (cd.attributes[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ cd.type = this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Contained::Description *cont_desc_ptr = 0;
+ ACE_NEW_THROW_EX (cont_desc_ptr,
+ CORBA::Contained::Description,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+ CORBA::Contained::Description_var retval = cont_desc_ptr;
+
+ cont_desc_ptr->kind = CORBA::dk_Component;
+
+ cont_desc_ptr->value <<= cd;
+ return retval._retn ();
+}
+
+CORBA::TypeCode_ptr
+TAO_ComponentDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_ComponentDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ id);
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ name);
+
+ return this->repo_->tc_factory ()->create_component_tc (
+ id.c_str (),
+ name.c_str ()
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+CORBA::InterfaceDefSeq *
+TAO_ComponentDef_i::supported_interfaces (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->supported_interfaces_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::InterfaceDefSeq *
+TAO_ComponentDef_i::supported_interfaces_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::InterfaceDefSeq *seq = 0;
+ ACE_NEW_RETURN (seq,
+ CORBA::InterfaceDefSeq (0),
+ 0);
+ CORBA::InterfaceDefSeq_var retval = seq;
+ retval->length (0);
+
+ CORBA::ULong count = 0;
+ ACE_Configuration_Section_Key supported_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "supported",
+ 0,
+ supported_key);
+
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (supported_key,
+ "count",
+ count);
+ retval->length (count);
+ char *stringified = 0;
+ ACE_TString path;
+ CORBA::Object_var tmp;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->get_string_value (supported_key,
+ stringified,
+ path);
+ tmp =
+ TAO_IFR_Service_Utils::path_to_ir_object (path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[i] = CORBA::InterfaceDef::_narrow (tmp.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ }
+
+ return retval._retn ();
+}
+
+void
+TAO_ComponentDef_i::supported_interfaces (
+ const CORBA::InterfaceDefSeq &supported_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supported_interfaces_i (supported_interfaces
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ComponentDef_i::supported_interfaces_i (
+ const CORBA::InterfaceDefSeq &supported_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Remove the old supported interfaces.
+ this->repo_->config ()->remove_section (this->section_key_,
+ "supported",
+ 0);
+
+ CORBA::ULong length = supported_interfaces.length ();
+ ACE_Configuration_Section_Key inherited_key;
+ this->repo_->config ()->open_section (this->section_key_,
+ "supported",
+ 1,
+ inherited_key);
+
+ CORBA::String_var name;
+ char *supported_path = 0;
+ ACE_Configuration_Section_Key supported_key;
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ supported_path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ supported_interfaces[i]
+ );
+
+ // Get the servant's key into the temporary key holder, because
+ // the name clash checker for base interfaces is static, and has
+ // no other way to know about a specific key.
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ supported_path,
+ TAO_IFR_Service_Utils::tmp_key_,
+ 0);
+ TAO_IFR_Service_Utils::name_exists (&TAO_InterfaceDef_i::name_clash,
+ this->section_key_,
+ this->repo_,
+ this->def_kind ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (supported_key,
+ stringified,
+ supported_path);
+ }
+}
+
+CORBA::ComponentIR::ComponentDef_ptr
+TAO_ComponentDef_i::base_component (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::ComponentIR::ComponentDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::ComponentDef::_nil ());
+
+ return this->base_component_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::ComponentDef_ptr
+TAO_ComponentDef_i::base_component_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString base_id;
+ int status =
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_component",
+ base_id);
+
+ if (status != 0)
+ {
+ return CORBA::ComponentIR::ComponentDef::_nil ();
+ }
+
+ CORBA::Contained_var obj = this->repo_->lookup_id (base_id.fast_rep ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::ComponentDef::_nil ());
+
+ return CORBA::ComponentIR::ComponentDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ComponentDef_i::base_component (
+ CORBA::ComponentIR::ComponentDef_ptr base_component
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->base_component_i (base_component
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ComponentDef_i::base_component_i (
+ CORBA::ComponentIR::ComponentDef_ptr base_component
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (CORBA::is_nil (base_component))
+ {
+ this->repo_->config ()->remove_value (this->section_key_,
+ "base_component");
+ return;
+ }
+
+ const char *base_path =
+ TAO_IFR_Service_Utils::reference_to_path (base_component);
+
+ // Get the servant's key into the temporary key holder, because
+ // the name clash checker for base valuetypes is static, and has
+ // no other way to know about a specific key.
+ this->repo_->config ()->expand_path (
+ this->repo_->root_key (),
+ base_path,
+ TAO_IFR_Service_Utils::tmp_key_,
+ 0
+ );
+ TAO_IFR_Service_Utils::name_exists (&TAO_ComponentDef_i::name_clash,
+ this->section_key_,
+ this->repo_,
+ CORBA::dk_Component
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->repo_->config ()->set_string_value (
+ this->section_key_,
+ "base_component",
+ base_component->_interface_repository_id ()
+ );
+}
+
+CORBA::ComponentIR::ProvidesDef_ptr
+TAO_ComponentDef_i::create_provides (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ComponentIR::ProvidesDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::ProvidesDef::_nil ());
+
+ return this->create_provides_i (id,
+ name,
+ version,
+ interface_type
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::ProvidesDef_ptr
+TAO_ComponentDef_i::create_provides_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return
+ TAO_Port_Utils<
+ CORBA::ComponentIR::ProvidesDef
+ >::create_entry (id,
+ name,
+ version,
+ "provides",
+ interface_type,
+ 0,
+ this->repo_,
+ CORBA::dk_Provides,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::UsesDef_ptr
+TAO_ComponentDef_i::create_uses (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::InterfaceDef_ptr interface_type,
+ CORBA::Boolean is_multiple
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ComponentIR::UsesDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::UsesDef::_nil ());
+
+ return this->create_uses_i (id,
+ name,
+ version,
+ interface_type,
+ is_multiple
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::UsesDef_ptr
+TAO_ComponentDef_i::create_uses_i (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::InterfaceDef_ptr interface_type,
+ CORBA::Boolean is_multiple
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return
+ TAO_Port_Utils<
+ CORBA::ComponentIR::UsesDef
+ >::create_entry (id,
+ name,
+ version,
+ "uses",
+ interface_type,
+ is_multiple,
+ this->repo_,
+ CORBA::dk_Uses,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::EmitsDef_ptr
+TAO_ComponentDef_i::create_emits (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ValueDef_ptr value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ComponentIR::EmitsDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::EmitsDef::_nil ());
+
+ return this->create_emits_i (id,
+ name,
+ version,
+ value
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::EmitsDef_ptr
+TAO_ComponentDef_i::create_emits_i (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ValueDef_ptr value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return
+ TAO_Port_Utils<
+ CORBA::ComponentIR::EmitsDef
+ >::create_entry (id,
+ name,
+ version,
+ "emits",
+ value,
+ 0,
+ this->repo_,
+ CORBA::dk_Emits,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::PublishesDef_ptr
+TAO_ComponentDef_i::create_publishes (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ValueDef_ptr value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ComponentIR::PublishesDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::PublishesDef::_nil ());
+
+ return this->create_publishes_i (id,
+ name,
+ version,
+ value
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::PublishesDef_ptr
+TAO_ComponentDef_i::create_publishes_i (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ValueDef_ptr value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return
+ TAO_Port_Utils<
+ CORBA::ComponentIR::PublishesDef
+ >::create_entry (id,
+ name,
+ version,
+ "publishes",
+ value,
+ 0,
+ this->repo_,
+ CORBA::dk_Publishes,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::ConsumesDef_ptr
+TAO_ComponentDef_i::create_consumes (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ValueDef_ptr value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ComponentIR::ConsumesDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::ConsumesDef::_nil ());
+
+ return this->create_consumes_i (id,
+ name,
+ version,
+ value
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::ConsumesDef_ptr
+TAO_ComponentDef_i::create_consumes_i (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ValueDef_ptr value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return
+ TAO_Port_Utils<
+ CORBA::ComponentIR::ConsumesDef
+ >::create_entry (id,
+ name,
+ version,
+ "consumes",
+ value,
+ 0,
+ this->repo_,
+ CORBA::dk_Consumes,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER);
+}
+
+int
+TAO_ComponentDef_i::name_clash (const char *name)
+{
+ ACE_TRY_NEW_ENV
+ {
+ TAO_Container_i::tmp_name_holder_ = name;
+ TAO_IFR_Service_Utils::name_exists (&TAO_Container_i::same_as_tmp_name,
+ TAO_IFR_Service_Utils::tmp_key_,
+ TAO_IFR_Service_Utils::repo_,
+ CORBA::dk_Component
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ComponentDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ComponentDef_i.h
new file mode 100644
index 00000000000..0c05918d563
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ComponentDef_i.h
@@ -0,0 +1,249 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ComponentDef_i.h
+//
+// = DESCRIPTION
+// ComponentDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_COMPONENTDEF_I_H
+#define TAO_COMPONENTDEF_I_H
+
+#include "orbsvcs/IFRService/ExtInterfaceDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/IFRService/IFR_ComponentsS.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils_T.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ComponentDef_i
+ : public virtual TAO_ExtInterfaceDef_i
+{
+ // = TITLE
+ // TAO_ComponentDef_i
+ //
+ // = DESCRIPTION
+ // Represents a component definition.
+ //
+public:
+ TAO_ComponentDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_ComponentDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry.
+
+ void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry.
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::InterfaceDefSeq *supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::InterfaceDefSeq *supported_interfaces_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void supported_interfaces (
+ const CORBA::InterfaceDefSeq &supported_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void supported_interfaces_i (
+ const CORBA::InterfaceDefSeq &supported_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ComponentIR::ComponentDef_ptr base_component (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ComponentIR::ComponentDef_ptr base_component_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void base_component (
+ CORBA::ComponentIR::ComponentDef_ptr base_component
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void base_component_i (
+ CORBA::ComponentIR::ComponentDef_ptr base_component
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ComponentIR::ProvidesDef_ptr create_provides (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ComponentIR::ProvidesDef_ptr create_provides_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ComponentIR::UsesDef_ptr create_uses (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::InterfaceDef_ptr interface_type,
+ CORBA::Boolean is_multiple
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ComponentIR::UsesDef_ptr create_uses_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::InterfaceDef_ptr interface_type,
+ CORBA::Boolean is_multiple
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ComponentIR::EmitsDef_ptr create_emits (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ValueDef_ptr value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ComponentIR::EmitsDef_ptr create_emits_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ValueDef_ptr value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ComponentIR::PublishesDef_ptr create_publishes (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ValueDef_ptr value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ComponentIR::PublishesDef_ptr create_publishes_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ValueDef_ptr value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ComponentIR::ConsumesDef_ptr create_consumes (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ValueDef_ptr value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ComponentIR::ConsumesDef_ptr create_consumes_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::ValueDef_ptr value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ static int name_clash (const char *name);
+ // Called from TAO_IFR_Service_Utils::name_exists() when we
+ // are a base component.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_COMPONENTDEF_I_H */
+
+
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ComponentModuleDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ComponentModuleDef_i.cpp
new file mode 100644
index 00000000000..474f85baf57
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ComponentModuleDef_i.cpp
@@ -0,0 +1,23 @@
+// $Id$
+
+#include "orbsvcs/IFRService/ComponentModuleDef_i.h"
+
+ACE_RCSID (IFRService,
+ ComponentModuleDef_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ComponentModuleDef_i::TAO_ComponentModuleDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Container_i (repo),
+ TAO_ComponentContainer_i (repo)
+{
+}
+
+TAO_ComponentModuleDef_i::~TAO_ComponentModuleDef_i (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ComponentModuleDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ComponentModuleDef_i.h
new file mode 100644
index 00000000000..6556910861c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ComponentModuleDef_i.h
@@ -0,0 +1,63 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ComponentModuleDef_i.h
+//
+// = DESCRIPTION
+// ComponentModuleDef_i servant class.
+//
+// = AUTHOR
+// Jeff Parsons <j.parsons@vanderbilt.edu>
+//
+// ============================================================================
+
+#ifndef TAO_COMPONENTMODULEDEF_I_H
+#define TAO_COMPONENTMODULEDEF_I_H
+
+#include "orbsvcs/IFRService/ComponentContainer_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ComponentModuleDef_i
+ : public virtual TAO_ComponentContainer_i
+{
+ // = TITLE
+ // TAO_ComponentModuleDef_i
+ //
+ // = DESCRIPTION
+ // Represents a module definition that may contain Component-related
+ // types.
+ //
+public:
+ TAO_ComponentModuleDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_ComponentModuleDef_i (void);
+ // Destructor
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_MODULEDEF_I_H */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ComponentRepository_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ComponentRepository_i.cpp
new file mode 100644
index 00000000000..f0efb71adb1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ComponentRepository_i.cpp
@@ -0,0 +1,245 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "orbsvcs/IFRService/ComponentRepository_i.h"
+#include "orbsvcs/IFRService/ModuleDef_i.h"
+#include "orbsvcs/IFRService/ComponentDef_i.h"
+#include "orbsvcs/IFRService/HomeDef_i.h"
+#include "orbsvcs/IFRService/EventDef_i.h"
+#include "orbsvcs/IFRService/FinderDef_i.h"
+#include "orbsvcs/IFRService/FactoryDef_i.h"
+#include "orbsvcs/IFRService/EmitsDef_i.h"
+#include "orbsvcs/IFRService/PublishesDef_i.h"
+#include "orbsvcs/IFRService/ConsumesDef_i.h"
+#include "orbsvcs/IFRService/ProvidesDef_i.h"
+#include "orbsvcs/IFRService/UsesDef_i.h"
+
+ACE_RCSID (IFRService,
+ ComponentRepository_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ComponentRepository_i::TAO_ComponentRepository_i (
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ ACE_Configuration *config
+ )
+ : TAO_IRObject_i (0),
+ TAO_Container_i (0),
+ TAO_Repository_i (orb,
+ poa,
+ config),
+ TAO_ComponentContainer_i (0)
+{
+}
+
+TAO_ComponentRepository_i::~TAO_ComponentRepository_i (void)
+{
+}
+
+int
+TAO_ComponentRepository_i::create_servants_and_poas (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+{
+ int status =
+ this->TAO_Repository_i::create_servants_and_poas (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ CORBA::PolicyList policies (5);
+ policies.length (5);
+
+ // ID Assignment Policy.
+ policies[0] =
+ this->root_poa_->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Lifespan Policy.
+ policies[1] =
+ this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Request Processing Policy.
+ policies[2] =
+ this->root_poa_->create_request_processing_policy (
+ PortableServer::USE_DEFAULT_SERVANT
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (-1);
+
+ // Servant Retention Policy.
+ policies[3] =
+ this->root_poa_->create_servant_retention_policy (
+ PortableServer::NON_RETAIN
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (-1);
+
+ // Id Uniqueness Policy.
+ policies[4] =
+ this->root_poa_->create_id_uniqueness_policy (
+ PortableServer::MULTIPLE_ID
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (-1);
+
+ PortableServer::POAManager_var poa_manager =
+ this->root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+#define GEN_IR_OBJECT(name) \
+ this-> name ## _poa_ = \
+ this->root_poa_->create_POA (#name "_poa", \
+ poa_manager.in (), \
+ policies \
+ ACE_ENV_ARG_PARAMETER); \
+ ACE_CHECK_RETURN (-1); \
+ TAO_ ## name ## _i * name ## _impl = 0; \
+ ACE_NEW_RETURN (name ## _impl, \
+ TAO_ ## name ## _i (this), \
+ -1); \
+ ACE_NEW_RETURN (this-> name ## _servant_, \
+ POA_CORBA::ComponentIR:: name ## _tie<TAO_ ## name ## _i> ( \
+ name ## _impl, \
+ this-> name ## _poa_.in (), \
+ 1 \
+ ), \
+ -1); \
+ PortableServer::ServantBase_var name ## _safety ( \
+ this-> name ## _servant_ \
+ ); \
+ this-> name ## _poa_->set_servant (this-> name ## _servant_ \
+ ACE_ENV_ARG_PARAMETER); \
+ ACE_CHECK_RETURN (-1);
+
+ CONCRETE_IR_OBJECT_TYPES
+
+#undef GEN_IR_OBJECT
+#undef CONCRETE_IR_OBJECT_TYPES
+
+ CORBA::ULong length = policies.length ();
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ CORBA::Policy_ptr policy = policies[i];
+ policy->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ return 0;
+}
+
+TAO_IDLType_i *
+TAO_ComponentRepository_i::select_idltype (
+ CORBA::DefinitionKind def_kind
+ ) const
+{
+ switch (def_kind)
+ {
+ case CORBA::dk_Component:
+ return this->ComponentDef_servant_->_tied_object ();
+ case CORBA::dk_Home:
+ return this->HomeDef_servant_->_tied_object ();
+ default:
+ return this->TAO_Repository_i::select_idltype (def_kind);
+ }
+}
+
+TAO_Container_i *
+TAO_ComponentRepository_i::select_container (
+ CORBA::DefinitionKind def_kind
+ ) const
+{
+ switch (def_kind)
+ {
+ case CORBA::dk_Module:
+ return this->ModuleDef_servant_->_tied_object ();
+ case CORBA::dk_Component:
+ return this->ComponentDef_servant_->_tied_object ();
+ case CORBA::dk_Home:
+ return this->HomeDef_servant_->_tied_object ();
+ default:
+ return this->TAO_Repository_i::select_container (def_kind);
+ }
+}
+
+TAO_Contained_i *
+TAO_ComponentRepository_i::select_contained (
+ CORBA::DefinitionKind def_kind
+ ) const
+{
+ switch (def_kind)
+ {
+ case CORBA::dk_Module:
+ return this->ModuleDef_servant_->_tied_object ();
+ case CORBA::dk_Component:
+ return this->ComponentDef_servant_->_tied_object ();
+ case CORBA::dk_Home:
+ return this->HomeDef_servant_->_tied_object ();
+ case CORBA::dk_Finder:
+ return this->FinderDef_servant_->_tied_object ();
+ case CORBA::dk_Factory:
+ return this->FactoryDef_servant_->_tied_object ();
+ case CORBA::dk_Event:
+ return this->EventDef_servant_->_tied_object ();
+ case CORBA::dk_Emits:
+ return this->EmitsDef_servant_->_tied_object ();
+ case CORBA::dk_Publishes:
+ return this->PublishesDef_servant_->_tied_object ();
+ case CORBA::dk_Consumes:
+ return this->ConsumesDef_servant_->_tied_object ();
+ case CORBA::dk_Provides:
+ return this->ProvidesDef_servant_->_tied_object ();
+ case CORBA::dk_Uses:
+ return this->UsesDef_servant_->_tied_object ();
+ default:
+ return this->TAO_Repository_i::select_contained (def_kind);
+ }
+}
+
+PortableServer::POA_ptr
+TAO_ComponentRepository_i::select_poa (
+ CORBA::DefinitionKind def_kind
+ ) const
+{
+ switch (def_kind)
+ {
+ case CORBA::dk_Module:
+ return this->ModuleDef_poa_.in ();
+ case CORBA::dk_Component:
+ return this->ComponentDef_poa_.in ();
+ case CORBA::dk_Home:
+ return this->HomeDef_poa_.in ();
+ case CORBA::dk_Finder:
+ return this->FinderDef_poa_.in ();
+ case CORBA::dk_Factory:
+ return this->FactoryDef_poa_.in ();
+ case CORBA::dk_Event:
+ return this->EventDef_poa_.in ();
+ case CORBA::dk_Emits:
+ return this->EmitsDef_poa_.in ();
+ case CORBA::dk_Publishes:
+ return this->PublishesDef_poa_.in ();
+ case CORBA::dk_Consumes:
+ return this->ConsumesDef_poa_.in ();
+ case CORBA::dk_Provides:
+ return this->ProvidesDef_poa_.in ();
+ case CORBA::dk_Uses:
+ return this->UsesDef_poa_.in ();
+ default:
+ return this->TAO_Repository_i::select_poa (def_kind);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ComponentRepository_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ComponentRepository_i.h
new file mode 100644
index 00000000000..7690ee20edc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ComponentRepository_i.h
@@ -0,0 +1,129 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ComponentRepository_i.h
+//
+// = DESCRIPTION
+// ComponentRepository servant class.
+//
+// = AUTHOR
+// Jeff Parsons <j.parsons@vanderbiltl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_COMPONENTREPOSITORY_I_H
+#define TAO_COMPONENTREPOSITORY_I_H
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/IFRService/ComponentContainer_i.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ModuleDef_i;
+class TAO_ComponentDef_i;
+class TAO_HomeDef_i;
+class TAO_FinderDef_i;
+class TAO_FactoryDef_i;
+class TAO_EventDef_i;
+class TAO_EmitsDef_i;
+class TAO_PublishesDef_i;
+class TAO_ConsumesDef_i;
+class TAO_ProvidesDef_i;
+class TAO_UsesDef_i;
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class TAO_IFRService_Export TAO_ComponentRepository_i
+ : public virtual TAO_Repository_i,
+ public virtual TAO_ComponentContainer_i
+{
+ // = TITLE
+ // TAO_ComponentRepository_i
+ //
+ // = DESCRIPTION
+ // Provides global access to the Interface Repository,
+ // including access to information related to
+ // CORBA Components.
+ //
+public:
+ TAO_ComponentRepository_i (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ ACE_Configuration *config);
+ // Constructor.
+
+ virtual ~TAO_ComponentRepository_i (void);
+ // Destructor.
+
+ virtual int create_servants_and_poas (ACE_ENV_SINGLE_ARG_DECL);
+ // We create a default servant servant for each IR Object
+ // type and its corresponding POA.
+
+ virtual TAO_IDLType_i *select_idltype (
+ CORBA::DefinitionKind def_kind
+ ) const;
+ virtual TAO_Container_i *select_container (
+ CORBA::DefinitionKind def_kind
+ ) const;
+ virtual TAO_Contained_i *select_contained (
+ CORBA::DefinitionKind def_kind
+ ) const;
+ // Return one of our servants for internal use.
+
+ virtual PortableServer::POA_ptr select_poa (
+ CORBA::DefinitionKind def_kind
+ ) const;
+ // Select the right POA for object creation.
+
+protected:
+
+#ifdef CONCRETE_IR_OBJECT_TYPES
+#undef CONCRETE_IR_OBJECT_TYPES
+#endif
+
+#define CONCRETE_IR_OBJECT_TYPES \
+ GEN_IR_OBJECT (ModuleDef) \
+ GEN_IR_OBJECT (ComponentDef) \
+ GEN_IR_OBJECT (HomeDef) \
+ GEN_IR_OBJECT (FinderDef) \
+ GEN_IR_OBJECT (FactoryDef) \
+ GEN_IR_OBJECT (EventDef) \
+ GEN_IR_OBJECT (EmitsDef) \
+ GEN_IR_OBJECT (PublishesDef) \
+ GEN_IR_OBJECT (ConsumesDef) \
+ GEN_IR_OBJECT (ProvidesDef) \
+ GEN_IR_OBJECT (UsesDef)
+
+#define GEN_IR_OBJECT(name) \
+ POA_CORBA::ComponentIR:: name ## _tie<TAO_ ## name ## _i> * name ## _servant_; \
+ PortableServer::POA_var name ## _poa_;
+
+ CONCRETE_IR_OBJECT_TYPES
+
+#undef GEN_IR_OBJECT
+ // Servants for each IR Object type, created at startup.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_COMPONENTREPOSITORY_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ConstantDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ConstantDef_i.cpp
new file mode 100644
index 00000000000..3ca04650d04
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ConstantDef_i.cpp
@@ -0,0 +1,313 @@
+// $Id$
+
+#include "orbsvcs/IFRService/ConstantDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+#include "orbsvcs/IFRService/IDLType_i.h"
+
+#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h"
+
+#include "ace/Auto_Ptr.h"
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ ConstantDef_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ConstantDef_i::TAO_ConstantDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo)
+{
+}
+
+TAO_ConstantDef_i::~TAO_ConstantDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_ConstantDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Constant;
+}
+
+CORBA::Contained::Description *
+TAO_ConstantDef_i::describe (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_ConstantDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Contained::Description *desc_ptr = 0;
+ ACE_NEW_THROW_EX (desc_ptr,
+ CORBA::Contained::Description,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Contained::Description_var retval = desc_ptr;
+
+ retval->kind = this->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ConstantDescription cd;
+
+ cd.name = this->name_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ cd.id = this->id_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ACE_TString container_id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ container_id);
+ cd.defined_in = container_id.c_str ();
+
+ cd.version = this->version_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ cd.type = this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Any_var val = this->value_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ cd.value = val.in ();
+
+ retval->value <<= cd;
+ return retval._retn ();
+}
+
+CORBA::TypeCode_ptr
+TAO_ConstantDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_ConstantDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString type_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "type_path",
+ type_path);
+
+ TAO_IDLType_i *impl = TAO_IFR_Service_Utils::path_to_idltype (type_path,
+ this->repo_);
+
+ return impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_ConstantDef_i::type_def (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::IDLType::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return this->type_def_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_ConstantDef_i::type_def_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString type_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "type_path",
+ type_path);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (type_path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ConstantDef_i::type_def (CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->type_def_i (type_def
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ConstantDef_i::type_def_i (CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ char *type_path = TAO_IFR_Service_Utils::reference_to_path (type_def);
+
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "type_path",
+ type_path);
+}
+
+CORBA::Any *
+TAO_ConstantDef_i::value (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->value_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Any *
+TAO_ConstantDef_i::value_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::TypeCode_var tc = this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ void *ref = 0;
+ size_t length = 0;
+
+ this->repo_->config ()->get_binary_value (
+ this->section_key_,
+ "value",
+ ref,
+ length
+ );
+
+ char *data = static_cast<char *> (ref);
+ ACE_Auto_Basic_Array_Ptr<char> safety (data);
+
+ ACE_Message_Block mb (data,
+ length);
+ mb.length (length);
+ TAO_InputCDR in_cdr (&mb);
+
+ CORBA::Any *retval = 0;
+ ACE_NEW_THROW_EX (retval,
+ CORBA::Any,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ TAO::Unknown_IDL_Type *impl = 0;
+ ACE_NEW_THROW_EX (impl,
+ TAO::Unknown_IDL_Type (tc.in (),
+ in_cdr),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ retval->replace (impl);
+ safety.release ();
+ return retval;
+}
+
+void
+TAO_ConstantDef_i::value (const CORBA::Any &value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->value_i (value
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ConstantDef_i::value_i (const CORBA::Any &value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::TypeCode_var my_tc =
+ this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::TypeCode_var val_tc = value.type ();
+
+ CORBA::Boolean const equal_tc =
+ my_tc.in ()->equal (val_tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (!equal_tc)
+ {
+ return;
+ }
+
+ ACE_Message_Block *mb = 0;
+ TAO::Any_Impl *impl = value.impl ();
+
+ if (impl->encoded ())
+ {
+ TAO::Unknown_IDL_Type *unk =
+ dynamic_cast<TAO::Unknown_IDL_Type *> (impl);
+
+ mb = unk->_tao_get_cdr ().steal_contents ();
+ }
+ else
+ {
+ TAO_OutputCDR out;
+ impl->marshal_value (out);
+ TAO_InputCDR in (out);
+ mb = in.steal_contents ();
+ }
+
+ CORBA::TCKind kind = val_tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ switch (kind)
+ {
+ // The data for these types will be aligned to an 8-byte
+ // boundary, while the rd_ptr may not.
+ case CORBA::tk_double:
+ case CORBA::tk_ulonglong:
+ case CORBA::tk_longlong:
+ case CORBA::tk_longdouble:
+ mb->rd_ptr (ACE_ptr_align_binary (mb->rd_ptr (),
+ ACE_CDR::MAX_ALIGNMENT));
+ break;
+ default:
+ break;
+ }
+
+ mb->crunch ();
+ this->repo_->config ()->set_binary_value (this->section_key_,
+ "value",
+ mb->base (),
+ mb->length ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ConstantDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ConstantDef_i.h
new file mode 100644
index 00000000000..f9243f6d58c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ConstantDef_i.h
@@ -0,0 +1,132 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ConstantDef_i.h
+//
+// = DESCRIPTION
+// ConstantDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_CONSTANTDEF_I_H
+#define TAO_CONSTANTDEF_I_H
+
+#include "orbsvcs/IFRService/Contained_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ConstantDef_i : public virtual TAO_Contained_i
+{
+ // = TITLE
+ // TAO_ConstantDef_i
+ //
+ // = DESCRIPTION
+ // Represents a named constant.
+ //
+public:
+ TAO_ConstantDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_ConstantDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::IDLType_ptr type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::IDLType_ptr type_def_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void type_def (
+ CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void type_def_i (
+ CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Any *value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Any *value_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void value (
+ const CORBA::Any &value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void value_i (
+ const CORBA::Any &value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_CONSTANTDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ConsumesDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ConsumesDef_i.cpp
new file mode 100644
index 00000000000..0b6b8311b7e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ConsumesDef_i.cpp
@@ -0,0 +1,34 @@
+// -*- C++ -*-
+
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/ConsumesDef_i.h"
+
+ACE_RCSID (IFRService,
+ ConsumesDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ConsumesDef_i::TAO_ConsumesDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo),
+ TAO_EventPortDef_i (repo)
+{
+}
+
+TAO_ConsumesDef_i::~TAO_ConsumesDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_ConsumesDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Consumes;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ConsumesDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ConsumesDef_i.h
new file mode 100644
index 00000000000..2bbbef43916
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ConsumesDef_i.h
@@ -0,0 +1,68 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ConsumesDef_i.h
+//
+// = DESCRIPTION
+// ConsumesDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_CONSUMESDEF_I_H
+#define TAO_CONSUMESDEF_I_H
+
+#include "orbsvcs/IFRService/EventPortDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ConsumesDef_i
+ : public virtual TAO_EventPortDef_i
+{
+ // = TITLE
+ // TAO_ConsumesDef_i
+ //
+ // = DESCRIPTION
+ // Represents the definition of an event that is consumed
+ // by a component.
+ //
+public:
+ TAO_ConsumesDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_ConsumesDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_CONSUMESDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/Contained_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/Contained_i.cpp
new file mode 100644
index 00000000000..b61b34ea4a1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/Contained_i.cpp
@@ -0,0 +1,1259 @@
+// $Id$
+
+#include "orbsvcs/IFRService/concrete_classes.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ Contained_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+const char *TAO_Contained_i::tmp_name_holder_ = 0;
+
+TAO_Contained_i::TAO_Contained_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo)
+{
+}
+
+TAO_Contained_i::~TAO_Contained_i (void)
+{
+}
+
+void
+TAO_Contained_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Contained_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ id);
+
+ // We'll get the last segment of this below.
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ id.c_str (),
+ path);
+
+ // Remove the repo id.
+ this->repo_->config ()->remove_value (this->repo_->repo_ids_key (),
+ id.c_str ());
+
+ // Remove the database entry.
+ ACE_TString container_id;
+ ACE_Configuration_Section_Key parent_key;
+
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ container_id);
+
+ if (container_id == "")
+ {
+ parent_key = this->repo_->root_key ();
+ }
+ else
+ {
+ ACE_TString parent_path;
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ container_id.c_str (),
+ parent_path);
+
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ parent_path,
+ parent_key,
+ 0);
+ }
+
+ ACE_Configuration_Section_Key defns_key;
+ this->repo_->config ()->open_section (parent_key,
+ "defns",
+ 0,
+ defns_key);
+
+ ACE_TString last_seg = path.substr (path.rfind ('\\') + 1);
+ this->repo_->config ()->remove_section (defns_key,
+ last_seg.c_str (),
+ 1);
+}
+
+char *
+TAO_Contained_i::id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->id_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+char *
+TAO_Contained_i::id_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString retval;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ retval);
+
+ return CORBA::string_dup (retval.c_str ());
+}
+
+void
+TAO_Contained_i::id (const char *id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->id_i (id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Contained_i::id_i (const char *id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString tmp;
+ if (this->repo_->config ()->get_string_value (
+ this->repo_->repo_ids_key (),
+ id,
+ tmp
+ )
+ == 0)
+ {
+ // Repository id already exists.
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 2,
+ CORBA::COMPLETED_NO));
+ }
+
+ // Get the old id.
+ ACE_TString old_id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ old_id);
+
+ ACE_TString path;
+
+ // Fetch our path.
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ old_id.c_str (),
+ path);
+
+ // Remove the old id.
+ this->repo_->config ()->remove_value (this->repo_->repo_ids_key (),
+ old_id.c_str ());
+
+ // Save our path under the new id.
+ this->repo_->config ()->set_string_value (this->repo_->repo_ids_key (),
+ id,
+ path);
+
+ // Store the new id locally as well.
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "id",
+ id);
+}
+
+char *
+TAO_Contained_i::name (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->name_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+char *
+TAO_Contained_i::name_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString retval;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ retval);
+
+ return CORBA::string_dup (retval.c_str ());
+}
+
+char *
+TAO_Contained_i::version (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->version_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+char *
+TAO_Contained_i::version_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString retval;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "version",
+ retval);
+
+ return CORBA::string_dup (retval.c_str ());
+}
+
+void
+TAO_Contained_i::name (const char *name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->name_i (name
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Contained_i::name_i (const char *name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Check if name already exists in this container.
+ CORBA::Boolean exists = this->name_exists (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (exists)
+ {
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 3,
+ CORBA::COMPLETED_NO));
+ }
+
+ // Reset the local name.
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "name",
+ name);
+
+ // Update the absolute name.
+ ACE_TString absolute_name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "absolute_name",
+ absolute_name);
+
+ absolute_name = absolute_name.substr (0, absolute_name.rfind (':') + 1);
+ absolute_name += name;
+
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "absolute_name",
+ absolute_name);
+
+ this->contents_name_update (absolute_name,
+ this->section_key_);
+}
+
+void
+TAO_Contained_i::version (const char *version
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->version_i (version
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Contained_i::version_i (const char *version
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "version",
+ version);
+}
+
+CORBA::Container_ptr
+TAO_Contained_i::defined_in (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::Container::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Container::_nil ());
+
+ return this->defined_in_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Container_ptr
+TAO_Contained_i::defined_in_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString container_id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ container_id);
+
+ if (container_id == "")
+ {
+ // The repository itself is our container.
+ return this->repo_->repo_objref ();
+ }
+
+ ACE_TString container_path;
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ container_id.c_str (),
+ container_path);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (container_path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Container::_nil ());
+
+ CORBA::Container_var retval = CORBA::Container::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Container::_nil ());
+
+ return retval._retn ();
+}
+
+char *
+TAO_Contained_i::absolute_name (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->absolute_name_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+char *
+TAO_Contained_i::absolute_name_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString absolute_name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "absolute_name",
+ absolute_name);
+
+ return CORBA::string_dup (absolute_name.c_str ());
+}
+
+CORBA::Repository_ptr
+TAO_Contained_i::containing_repository (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->repo_->repo_objref ();
+}
+
+CORBA::Contained::Description *
+TAO_Contained_i::describe (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // This will always be overridden by derived classes.
+ return 0;
+}
+
+CORBA::Contained::Description *
+TAO_Contained_i::describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // This will always be overridden by derived classes.
+ return 0;
+}
+
+void
+TAO_Contained_i::move (CORBA::Container_ptr new_container,
+ const char *new_name,
+ const char *new_version
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->move_i (new_container,
+ new_name,
+ new_version,
+ 1
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_Contained_i::name_exists (const char *name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString container_id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ container_id);
+
+ if (container_id == "")
+ {
+ TAO_Contained_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key root_key = this->repo_->root_key ();
+ TAO_IFR_Service_Utils::name_exists (&TAO_Contained_i::same_as_tmp_name,
+ root_key,
+ this->repo_,
+ CORBA::dk_Repository
+ ACE_ENV_ARG_PARAMETER);
+ return 0;
+ }
+
+ ACE_TString container_path;
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ container_id.c_str (),
+ container_path);
+
+ ACE_Configuration_Section_Key container_key;
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ container_path,
+ container_key,
+ 0);
+
+ ACE_Configuration_Section_Key defns_key;
+ this->repo_->config ()->open_section (container_key,
+ "defns",
+ 0,
+ defns_key);
+
+ ACE_TString section_name;
+ int index = 0;
+
+ while (this->repo_->config ()->enumerate_sections (defns_key,
+ index++,
+ section_name)
+ == 0)
+ {
+ ACE_Configuration_Section_Key defn_key;
+ this->repo_->config ()->open_section (defns_key,
+ section_name.c_str (),
+ 0,
+ defn_key);
+
+ ACE_TString defn_name;
+ this->repo_->config ()->get_string_value (defn_key,
+ "name",
+ defn_name);
+
+ if (defn_name == name)
+ {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+void
+TAO_Contained_i::contents_name_update (ACE_TString stem,
+ ACE_Configuration_Section_Key key)
+{
+ ACE_Configuration_Section_Key defns_key;
+ if (this->repo_->config ()->open_section (key,
+ "defns",
+ 0,
+ defns_key)
+ != 0)
+ {
+ return;
+ }
+
+ int index = 0;
+ ACE_TString sub_section;
+ while (this->repo_->config ()->enumerate_sections (defns_key,
+ index++,
+ sub_section)
+ == 0)
+ {
+ ACE_Configuration_Section_Key defn_key;
+
+ this->repo_->config ()->open_section (defns_key,
+ sub_section.c_str (),
+ 0,
+ defn_key);
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (defn_key,
+ "name",
+ name);
+
+ ACE_TString absolute_name = stem + "::" + name;
+ this->repo_->config ()->set_string_value (defn_key,
+ "absolute_name",
+ absolute_name);
+
+ this->contents_name_update (absolute_name,
+ defn_key);
+ }
+}
+
+int
+TAO_Contained_i::same_as_tmp_name (const char *name)
+{
+ return ACE_OS::strcmp (TAO_Contained_i::tmp_name_holder_, name) == 0;
+}
+
+void
+TAO_Contained_i::move_i (CORBA::Container_ptr new_container,
+ const char *new_name,
+ const char *new_version,
+ CORBA::Boolean cleanup
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Repository_var my_repo = this->repo_->repo_objref ();
+
+ CORBA::DefinitionKind container_dk =
+ TAO_IFR_Service_Utils::reference_to_def_kind (new_container,
+ this->repo_);
+
+ ACE_Configuration_Section_Key container_key;
+
+ // Check that we're not trying to move to a different repository,
+ // and set the container impl, used in each switch case below.
+ if (container_dk == CORBA::dk_Repository)
+ {
+ container_key = this->repo_->root_key ();
+ }
+ else
+ {
+ ACE_TString container_path (
+ TAO_IFR_Service_Utils::reference_to_path (new_container)
+ );
+
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ container_path,
+ container_key,
+ 0);
+ }
+
+ CORBA::DefinitionKind my_dk =
+ this->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::String_var id = this->id_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // If an exception is thrown, this must be restored.
+ ACE_TString my_path;
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ id.in (),
+ my_path);
+
+ // Remove the repo id, because the create_* function call will add it
+ // again with a different path value.
+ this->repo_->config ()->remove_value (this->repo_->repo_ids_key (),
+ id.in ());
+
+ // Used for cleanup at the end of this function.
+ ACE_Configuration_Section_Key old_section_key = this->section_key_;
+
+ TAO_Contained_i as_contained (this->repo_);
+ as_contained.section_key (container_key);
+
+ CORBA::String_var container_id =
+ as_contained.id_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TString new_id (container_id.in ());
+ new_id =
+ new_id.substr (0, new_id.rfind (':')) + "/" + new_name + ":" + new_version;
+
+ TAO_Container_i container_impl (this->repo_);
+ container_impl.section_key (container_key);
+
+ ACE_TRY
+ {
+ // Call the appropriate create function.
+ switch (my_dk)
+ {
+ case CORBA::dk_Enum:
+ {
+ TAO_EnumDef_i impl (this->repo_);
+ impl.section_key (this->section_key_);
+
+ CORBA::EnumMemberSeq_var members =
+ impl.members_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (container_dk == CORBA::dk_Struct
+ || container_dk == CORBA::dk_Union
+ || container_dk == CORBA::dk_Exception)
+ {
+ this->move_pre_process (new_container,
+ my_path.c_str (),
+ new_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ CORBA::EnumDef_var new_defn =
+ container_impl.create_enum_i (new_id.c_str (),
+ new_name,
+ new_version,
+ members.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TString new_path =
+ TAO_IFR_Service_Utils::reference_to_path (new_defn.in ());
+ container_impl.update_refs (new_path.c_str ());
+
+ break;
+ }
+ case CORBA::dk_Alias:
+ {
+ TAO_AliasDef_i impl (this->repo_);
+ impl.section_key (this->section_key_);
+
+ CORBA::IDLType_var otype =
+ impl.original_type_def_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::AliasDef_var new_defn =
+ container_impl.create_alias_i (new_id.c_str (),
+ new_name,
+ new_version,
+ otype.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TString new_path =
+ TAO_IFR_Service_Utils::reference_to_path (new_defn.in ());
+ container_impl.update_refs (new_path.c_str ());
+
+ break;
+ }
+ case CORBA::dk_Native:
+ {
+ container_impl.create_native_i (new_id.c_str (),
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ break;
+ }
+ case CORBA::dk_ValueBox:
+ {
+ TAO_ValueBoxDef_i impl (this->repo_);
+ impl.section_key (this->section_key_);
+
+ CORBA::IDLType_var otype =
+ impl.original_type_def_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ValueBoxDef_var new_defn =
+ container_impl.create_value_box_i (new_id.c_str (),
+ new_name,
+ new_version,
+ otype.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TString new_path =
+ TAO_IFR_Service_Utils::reference_to_path (new_defn.in ());
+ container_impl.update_refs (new_path.c_str ());
+
+ break;
+ }
+ case CORBA::dk_Struct:
+ {
+ TAO_StructDef_i impl (this->repo_);
+ impl.section_key (this->section_key_);
+
+ CORBA::StructMemberSeq_var members =
+ impl.members_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (container_dk == CORBA::dk_Struct
+ || container_dk == CORBA::dk_Union
+ || container_dk == CORBA::dk_Exception)
+ {
+ this->move_pre_process (new_container,
+ my_path.c_str (),
+ new_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ CORBA::StructDef_var new_defn =
+ container_impl.create_struct_i (new_id.c_str (),
+ new_name,
+ new_version,
+ members.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TString new_path =
+ TAO_IFR_Service_Utils::reference_to_path (new_defn.in ());
+ container_impl.update_refs (new_path.c_str ());
+
+ this->move_contents (new_defn.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ break;
+ }
+ case CORBA::dk_Union:
+ {
+ TAO_UnionDef_i impl (this->repo_);
+ impl.section_key (this->section_key_);
+
+ CORBA::IDLType_var disc_type =
+ impl.discriminator_type_def_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::UnionMemberSeq_var members =
+ impl.members_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (container_dk == CORBA::dk_Struct
+ || container_dk == CORBA::dk_Union
+ || container_dk == CORBA::dk_Exception)
+ {
+ this->move_pre_process (new_container,
+ my_path.c_str (),
+ new_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ CORBA::UnionDef_var new_defn =
+ container_impl.create_union_i (new_id.c_str (),
+ new_name,
+ new_version,
+ disc_type.in (),
+ members.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TString new_path =
+ TAO_IFR_Service_Utils::reference_to_path (new_defn.in ());
+ container_impl.update_refs (new_path.c_str ());
+
+ this->move_contents (new_defn.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ break;
+ }
+ case CORBA::dk_Module:
+ {
+ CORBA::ModuleDef_var new_defn =
+ container_impl.create_module_i (new_id.c_str (),
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->move_contents (new_defn.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ break;
+ }
+ case CORBA::dk_Exception:
+ {
+ TAO_ExceptionDef_i impl (this->repo_);
+ impl.section_key (this->section_key_);
+
+ CORBA::StructMemberSeq_var members =
+ impl.members_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ExceptionDef_var new_defn =
+ container_impl.create_exception_i (new_id.c_str (),
+ new_name,
+ new_version,
+ members.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->move_contents (new_defn.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ break;
+ }
+ case CORBA::dk_Interface:
+ {
+ TAO_InterfaceDef_i impl (this->repo_);
+ impl.section_key (this->section_key_);
+
+ CORBA::InterfaceDefSeq_var bases =
+ impl.base_interfaces_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::InterfaceDef_var new_defn =
+ container_impl.create_interface_i (new_id.c_str (),
+ new_name,
+ new_version,
+ bases.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TString new_path =
+ TAO_IFR_Service_Utils::reference_to_path (new_defn.in ());
+ container_impl.update_refs (new_path.c_str ());
+
+ this->move_contents (new_defn.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ break;
+ }
+ case CORBA::dk_Constant:
+ {
+ TAO_ConstantDef_i impl (this->repo_);
+ impl.section_key (this->section_key_);
+
+ CORBA::IDLType_var type_def =
+ impl.type_def_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any_var value = impl.value_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ container_impl.create_constant_i (new_id.c_str (),
+ new_name,
+ new_version,
+ type_def.in (),
+ value.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ break;
+ }
+ case CORBA::dk_Attribute:
+ {
+ TAO_AttributeDef_i impl (this->repo_);
+ impl.section_key (this->section_key_);
+
+ CORBA::IDLType_var type_def =
+ impl.type_def_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::AttributeMode mode =
+ impl.mode_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (container_dk == CORBA::dk_Interface)
+ {
+ TAO_InterfaceDef_i idef (this->repo_);
+ idef.section_key (container_key);
+
+ idef.create_attribute_i (new_id.c_str (),
+ new_name,
+ new_version,
+ type_def.in (),
+ mode
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ break;
+ }
+ else if (container_dk == CORBA::dk_Value)
+ {
+ TAO_ValueDef_i vdef (this->repo_);
+ vdef.section_key (container_key);
+
+ vdef.create_attribute_i (new_id.c_str (),
+ new_name,
+ new_version,
+ type_def.in (),
+ mode
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ break;
+ }
+ else
+ {
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 4,
+ CORBA::COMPLETED_NO));
+ }
+ }
+ case CORBA::dk_Operation:
+ {
+ TAO_OperationDef_i impl (this->repo_);
+ impl.section_key (this->section_key_);
+
+ CORBA::IDLType_var result =
+ impl.result_def_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::OperationMode mode =
+ impl.mode_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ParDescriptionSeq_var params =
+ impl.params_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ExceptionDefSeq_var exceptions =
+ impl.exceptions_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ContextIdSeq_var contexts =
+ impl.contexts_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (container_dk == CORBA::dk_Interface)
+ {
+ TAO_InterfaceDef_i idef (this->repo_);
+ idef.section_key (container_key);
+
+ idef.create_operation_i (new_id.c_str (),
+ new_name,
+ new_version,
+ result.in (),
+ mode,
+ params.in (),
+ exceptions.in (),
+ contexts.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ break;
+ }
+ else if (container_dk == CORBA::dk_Value)
+ {
+ TAO_ValueDef_i vdef (this->repo_);
+ impl.section_key (container_key);
+
+ vdef.create_operation_i (new_id.c_str (),
+ new_name,
+ new_version,
+ result.in (),
+ mode,
+ params.in (),
+ exceptions.in (),
+ contexts.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ break;
+ }
+ else
+ {
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 4,
+ CORBA::COMPLETED_NO));
+ }
+ }
+ case CORBA::dk_Value:
+ case CORBA::dk_Home:
+ case CORBA::dk_Component:
+ case CORBA::dk_Factory:
+ case CORBA::dk_Finder:
+ case CORBA::dk_Provides:
+ case CORBA::dk_Uses:
+ case CORBA::dk_Emits:
+ case CORBA::dk_Publishes:
+ case CORBA::dk_Consumes:
+ case CORBA::dk_ValueMember:
+ case CORBA::dk_Event:
+ // TODO
+ default:
+ break;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // If the move was not successful, we must restore this.
+ this->repo_->config ()->set_string_value (
+ this->repo_->repo_ids_key (),
+ id.in (),
+ my_path
+ );
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ if (cleanup)
+ {
+ // Remove the old database entry.
+ ACE_TString container_id;
+ ACE_Configuration_Section_Key parent_key;
+
+ this->repo_->config ()->get_string_value (old_section_key,
+ "container_id",
+ container_id);
+
+ if (container_id == "")
+ {
+ parent_key = this->repo_->root_key ();
+ }
+ else
+ {
+ ACE_TString parent_path;
+ this->repo_->config ()->get_string_value (
+ this->repo_->repo_ids_key (),
+ container_id.c_str (),
+ parent_path
+ );
+
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ parent_path,
+ parent_key,
+ 0);
+ }
+
+ ACE_Configuration_Section_Key defns_key;
+ this->repo_->config ()->open_section (parent_key,
+ "defns",
+ 0,
+ defns_key);
+
+ ACE_TString last_seg = my_path.substr (my_path.rfind ('\\') + 1);
+ this->repo_->config ()->remove_section (defns_key,
+ last_seg.c_str (),
+ 1);
+ }
+}
+
+void
+TAO_Contained_i::move_pre_process (CORBA::Container_ptr container,
+ const char *contained_path,
+ const char *name
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ char *container_path =
+ TAO_IFR_Service_Utils::reference_to_path (container);
+
+ ACE_Configuration_Section_Key container_key;
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ container_path,
+ container_key,
+ 0);
+
+ ACE_Configuration_Section_Key refs_key;
+ this->repo_->config ()->open_section (container_key,
+ "refs",
+ 0,
+ refs_key);
+
+ int index = 0;
+ ACE_TString section_name;
+ while (this->repo_->config ()->enumerate_sections (refs_key,
+ index++,
+ section_name)
+ == 0)
+ {
+ ACE_Configuration_Section_Key ref_key;
+ this->repo_->config ()->open_section (refs_key,
+ section_name.c_str (),
+ 0,
+ ref_key);
+
+ ACE_TString ref_name;
+ this->repo_->config ()->get_string_value (ref_key,
+ "name",
+ ref_name);
+
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (ref_key,
+ "path",
+ path);
+
+ if (ref_name == name && path == contained_path)
+ {
+ ref_name += this->repo_->extension ();
+ this->repo_->config ()->set_string_value (ref_key,
+ "name",
+ ref_name);
+
+ break;
+ }
+ }
+}
+
+void
+TAO_Contained_i::move_contents (CORBA::Container_ptr new_container
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString name;
+ ACE_TString version;
+
+ ACE_Configuration_Section_Key defns_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "defns",
+ 0,
+ defns_key);
+
+ if (status == 0)
+ {
+ u_int count = 0;
+ this->repo_->config ()->get_integer_value (defns_key,
+ "count",
+ count);
+
+ for (u_int i = 0; i < count; ++i)
+ {
+ ACE_Configuration_Section_Key defn_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ status =
+ this->repo_->config ()->open_section (defns_key,
+ stringified,
+ 0,
+ defn_key);
+
+ if (status == 0)
+ {
+ this->repo_->config ()->get_string_value (defn_key,
+ "name",
+ name);
+
+ this->repo_->config ()->get_string_value (defn_key,
+ "version",
+ version);
+ u_int kind = 0;
+ this->repo_->config ()->get_integer_value (defn_key,
+ "def_kind",
+ kind);
+ CORBA::DefinitionKind def_kind =
+ static_cast<CORBA::DefinitionKind> (kind);
+
+ TAO_Contained_i *impl = this->repo_->select_contained (def_kind);
+ impl->section_key (defn_key);
+
+ impl->move_i (new_container,
+ name.c_str (),
+ version.c_str (),
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ }
+
+ CORBA::DefinitionKind kind = this->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Specific to InterfaceDef_i and ValueDef_i
+ if (kind == CORBA::dk_Interface || kind == CORBA::dk_Value)
+ {
+ int index = 0;
+ ACE_TString section_name;
+
+ // Attributes
+ ACE_Configuration_Section_Key attrs_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "attrs",
+ 0,
+ attrs_key);
+
+ if (status == 0)
+ {
+ while (this->repo_->config ()->enumerate_sections (attrs_key,
+ index++,
+ section_name)
+ == 0)
+ {
+ ACE_Configuration_Section_Key attr_key;
+ this->repo_->config ()->open_section (attrs_key,
+ section_name.c_str (),
+ 0,
+ attr_key);
+
+ this->repo_->config ()->get_string_value (attr_key,
+ "name",
+ name);
+
+ this->repo_->config ()->get_string_value (attr_key,
+ "version",
+ version);
+
+ TAO_AttributeDef_i impl (this->repo_);
+ impl.section_key (attr_key);
+
+ impl.move_i (new_container,
+ name.c_str (),
+ version.c_str (),
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+
+ index = 0;
+
+ // Operations
+ ACE_Configuration_Section_Key ops_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "ops",
+ 0,
+ ops_key);
+
+ if (status == 0)
+ {
+ while (this->repo_->config ()->enumerate_sections (ops_key,
+ index++,
+ section_name)
+ == 0)
+ {
+ ACE_Configuration_Section_Key op_key;
+ this->repo_->config ()->open_section (ops_key,
+ section_name.c_str (),
+ 0,
+ op_key);
+
+ this->repo_->config ()->get_string_value (op_key,
+ "name",
+ name);
+
+ this->repo_->config ()->get_string_value (op_key,
+ "version",
+ version);
+
+ TAO_OperationDef_i impl (this->repo_);
+ impl.section_key (op_key);
+
+ impl.move_i (new_container,
+ name.c_str (),
+ version.c_str (),
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/Contained_i.h b/TAO/orbsvcs/orbsvcs/IFRService/Contained_i.h
new file mode 100644
index 00000000000..5729837ce3b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/Contained_i.h
@@ -0,0 +1,236 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// Contained_i.h
+//
+// = DESCRIPTION
+// Contained servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_CONTAINED_I_H
+#define TAO_CONTAINED_I_H
+
+#include "orbsvcs/IFRService/IRObject_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_Contained_i : public virtual TAO_IRObject_i
+{
+ // = TITLE
+ // TAO_Contained_i
+ //
+ // = DESCRIPTION
+ // Abstract base class for all IR objects that are contained
+ // by other IR objects.
+ //
+public:
+ TAO_Contained_i (TAO_Repository_i *repo);
+ // Constructor.
+
+ virtual ~TAO_Contained_i (void);
+ // Destructor.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual char *id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ char *id_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void id (
+ const char *id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void id_i (
+ const char *id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual char *name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ char *name_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void name (
+ const char *name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void name_i (
+ const char *name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual char *version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ char *version_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void version (
+ const char *version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void version_i (
+ const char *version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Container_ptr defined_in_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual char *absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ char *absolute_name_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void move (
+ CORBA::Container_ptr new_container,
+ const char *new_name,
+ const char *new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ static int same_as_tmp_name (const char *name);
+ // Called from TAO_IFR_Service_Utils::name_exists.
+
+protected:
+ void move_i (
+ CORBA::Container_ptr new_container,
+ const char *new_name,
+ const char *new_version,
+ CORBA::Boolean cleanup
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Engine for move() with an extra 'cleanup'
+ // parameter. Since a section removal can be
+ // recursive, this need be done only at the top
+ // level.
+
+private:
+ CORBA::Boolean name_exists (
+ const char *name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Check if <name> already exists in our container
+
+ void contents_name_update (
+ ACE_TString stem,
+ ACE_Configuration_Section_Key key
+ );
+ // Recursively update the scoped name of our contents.
+
+ void move_pre_process (
+ CORBA::Container_ptr container,
+ const char *contained_path,
+ const char *name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Mangle the names of references that are also
+ // defined in the scope, so a name clash will
+ // not occur when create_* is called. Create_*
+ // unmangles the names.
+
+ void move_contents (
+ CORBA::Container_ptr new_container
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Recursively calls move_i for definitions,
+ // as well as operations and attributes if
+ // applicable.
+
+private:
+ static const char *tmp_name_holder_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_CONTAINED_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/Container_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/Container_i.cpp
new file mode 100644
index 00000000000..b729699e35e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/Container_i.cpp
@@ -0,0 +1,2684 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/InterfaceDef_i.h"
+#include "orbsvcs/IFRService/ValueDef_i.h"
+#include "orbsvcs/IFRService/ExtValueDef_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils_T.h"
+
+#include "tao/IFR_Client/IFR_ComponentsC.h"
+
+#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h"
+
+#include "ace/Auto_Ptr.h"
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ Container_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+const char *TAO_Container_i::tmp_name_holder_ = 0;
+
+TAO_Container_i::TAO_Container_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo)
+{
+}
+
+TAO_Container_i::~TAO_Container_i (void)
+{
+}
+
+void
+TAO_Container_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Container_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ int index = 0;
+ int status;
+ ACE_TString section_name;
+
+ // Destroy and/or remove references.
+
+ ACE_Configuration_Section_Key refs_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "refs",
+ 0,
+ refs_key);
+ // This section may not have been created.
+ if (status == 0)
+ {
+ while (this->repo_->config ()->enumerate_sections (refs_key,
+ index++,
+ section_name)
+ == 0)
+ {
+ ACE_Configuration_Section_Key member_key;
+ this->repo_->config ()->open_section (refs_key,
+ section_name.c_str (),
+ 0,
+ member_key);
+
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (member_key,
+ "path",
+ path);
+
+ ACE_Configuration_Section_Key entry_key;
+ status =
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ path,
+ entry_key,
+ 0);
+
+ // This entry may already have been destroyed.
+ if (status == 0)
+ {
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (path,
+ this->repo_);
+
+ CORBA::DefinitionKind def_kind =
+ impl->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ switch (def_kind)
+ {
+ // These anonymous types were defined in IDL inside this
+ // struct and have no 'contained-in' info of their own,
+ // so they must be destroyed here.
+ case CORBA::dk_String:
+ case CORBA::dk_Wstring:
+ case CORBA::dk_Fixed:
+ case CORBA::dk_Array:
+ case CORBA::dk_Sequence:
+ impl->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ break;
+ default:
+ // No other types can be defined in this section of the struct.
+ break;
+ }
+ }
+ }
+
+ this->repo_->config ()->remove_section (this->section_key_,
+ "refs",
+ 1);
+ }
+
+ // Destroy definitions.
+
+ ACE_Configuration_Section_Key defns_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "defns",
+ 0,
+ defns_key);
+
+ // Store our section key for later in case this method is
+ // called recursively
+ ACE_Configuration_Section_Key holder = this->section_key_;
+
+ // This section may not have been created.
+ if (status == 0)
+ {
+ index = 0;
+
+ while (this->repo_->config ()->enumerate_sections (defns_key,
+ index++,
+ section_name)
+ == 0)
+ {
+ ACE_Configuration_Section_Key defn_key;
+ this->repo_->config ()->open_section (defns_key,
+ section_name.c_str (),
+ 0,
+ defn_key);
+ u_int kind = 0;
+ this->repo_->config ()->get_integer_value (defn_key,
+ "def_kind",
+ kind);
+ CORBA::DefinitionKind def_kind =
+ static_cast<CORBA::DefinitionKind> (kind);
+
+ TAO_Contained_i *impl = this->repo_->select_contained (def_kind);
+ impl->section_key (defn_key);
+
+ impl->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // Restore our original section key, in case this method was
+ // called recursively.
+ this->section_key (holder);
+
+ this->repo_->config ()->remove_section (this->section_key_,
+ "defns",
+ 1);
+ }
+}
+
+CORBA::Contained_ptr
+TAO_Container_i::lookup (const char *search_name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Contained::_nil ());
+
+ return this->lookup_i (search_name
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Contained_ptr
+TAO_Container_i::lookup_i (const char *search_name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Configuration_Section_Key iter_key;
+ ACE_Configuration_Section_Key work_key;
+ ACE_TString work_string;
+ ACE_TString section_name;
+ int status = 0;
+ int index = 0;
+ ACE_TString::size_type pos = 0;
+ int so_far_so_good = 0;
+ u_int kind = 0;
+ CORBA::DefinitionKind def_kind = CORBA::dk_none;
+
+
+ if (ACE_OS::strncmp (search_name, "::", 2) == 0)
+ {
+ // We were given an absolute scoped name.
+ work_string = search_name + 2;
+ iter_key = this->repo_->root_key ();
+ }
+ else
+ {
+ // We were given a relative scoped name.
+ work_string = search_name;
+ iter_key = this->section_key_;
+ }
+
+ while (1)
+ {
+ pos = work_string.find ("::");
+ so_far_so_good = 0;
+
+ ACE_Configuration_Section_Key defns_key;
+ status =
+ this->repo_->config ()->open_section (iter_key,
+ "defns",
+ 0,
+ defns_key);
+ if (status == 0)
+ {
+ index = 0;
+
+ while (this->repo_->config ()->enumerate_sections (defns_key,
+ index++,
+ section_name)
+ == 0)
+ {
+ this->repo_->config ()->open_section (defns_key,
+ section_name.c_str (),
+ 0,
+ work_key);
+
+ ACE_TString defn_name;
+ this->repo_->config ()->get_string_value (work_key,
+ "name",
+ defn_name);
+
+ if (defn_name == work_string.substr (0, pos))
+ {
+ iter_key = work_key;
+ so_far_so_good = 1;
+ break;
+ }
+ }
+ }
+
+ if (so_far_so_good)
+ {
+ if (pos != ACE_TString::npos)
+ {
+ work_string = work_string.substr (pos + 2);
+ continue;
+ }
+ else
+ {
+ break;
+ }
+ }
+ else
+ {
+ // Check for attributes and operations, but only if we
+ // are on the last segment of the scoped name.
+ if (pos == ACE_TString::npos)
+ {
+ this->repo_->config ()->get_integer_value (iter_key,
+ "def_kind",
+ kind);
+
+ def_kind = static_cast<CORBA::DefinitionKind> (kind);
+
+ if (def_kind == CORBA::dk_Interface
+ || def_kind == CORBA::dk_Value)
+ {
+ ACE_Configuration_Section_Key attrs_key;
+ status =
+ this->repo_->config ()->open_section (iter_key,
+ "attrs",
+ 0,
+ attrs_key);
+
+ if (status == 0)
+ {
+ index = 0;
+ while (this->repo_->config ()->enumerate_sections (
+ attrs_key,
+ index++,
+ section_name
+ )
+ == 0)
+ {
+ this->repo_->config ()->open_section (
+ attrs_key,
+ section_name.c_str (),
+ 0,
+ work_key
+ );
+
+ ACE_TString attr_name;
+ this->repo_->config ()->get_string_value (
+ work_key,
+ "name",
+ attr_name
+ );
+
+ // If we're here, working name has only one segment.
+ if (attr_name == work_string)
+ {
+ so_far_so_good = 1;
+ break;
+ }
+ }
+ }
+
+ if (so_far_so_good)
+ {
+ break;
+ }
+ else
+ {
+ ACE_Configuration_Section_Key ops_key;
+ status =
+ this->repo_->config ()->open_section (iter_key,
+ "ops",
+ 0,
+ ops_key);
+
+ if (status == 0)
+ {
+ index = 0;
+
+ while (this->repo_->config ()->enumerate_sections (
+ ops_key,
+ index++,
+ section_name
+ )
+ == 0)
+ {
+ this->repo_->config ()->open_section (
+ ops_key,
+ section_name.c_str (),
+ 0,
+ work_key
+ );
+
+ ACE_TString op_name;
+ this->repo_->config ()->get_string_value (
+ work_key,
+ "name",
+ op_name
+ );
+
+ // If we're here, name has only one segment.
+ if (op_name == work_string)
+ {
+ so_far_so_good = 1;
+ break;
+ }
+ }
+
+ if (so_far_so_good)
+ {
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return CORBA::Contained::_nil ();
+ }
+
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (work_key,
+ "id",
+ id);
+
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ id.c_str (),
+ path);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Contained::_nil ());
+
+ return CORBA::Contained::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ContainedSeq *
+TAO_Container_i::contents (CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->contents_i (limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ContainedSeq *
+TAO_Container_i::contents_i (CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ContainedSeq *contents = 0;
+ ACE_NEW_THROW_EX (contents,
+ CORBA::ContainedSeq,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ContainedSeq_var retval = contents;
+ retval->length (0);
+
+ if (limit_type == CORBA::dk_none)
+ {
+ return retval._retn ();
+ }
+
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> kind_queue;
+ ACE_Unbounded_Queue<ACE_TString> path_queue;
+
+ // Definitions
+
+ ACE_Configuration_Section_Key defns_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "defns",
+ 0,
+ defns_key);
+
+ // If there are no contents (other than possible attributes or
+ // operations), skip this part.
+ if (status == 0)
+ {
+ u_int count = 0;
+ this->repo_->config ()->get_integer_value (defns_key,
+ "count",
+ count);
+
+ for (u_int i = 0; i < count; ++i)
+ {
+ ACE_Configuration_Section_Key defn_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ status =
+ this->repo_->config ()->open_section (defns_key,
+ stringified,
+ 0,
+ defn_key);
+
+ if (status == 0)
+ {
+ u_int kind = 0;
+ this->repo_->config ()->get_integer_value (defn_key,
+ "def_kind",
+ kind);
+
+ CORBA::DefinitionKind def_kind =
+ static_cast<CORBA::DefinitionKind> (kind);
+
+ if (limit_type == CORBA::dk_all
+ || limit_type == def_kind)
+ {
+ kind_queue.enqueue_tail (def_kind);
+
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (defn_key,
+ "id",
+ id);
+
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (
+ this->repo_->repo_ids_key (),
+ id.c_str (),
+ path
+ );
+
+ path_queue.enqueue_tail (path);
+ }
+ }
+ }
+ }
+
+ // Base interfaces
+
+ CORBA::DefinitionKind def_kind = this->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (def_kind == CORBA::dk_Interface)
+ {
+ if (limit_type == CORBA::dk_Operation
+ || limit_type == CORBA::dk_Attribute
+ || limit_type == CORBA::dk_all)
+ {
+ TAO_InterfaceDef_i iface (this->repo_);
+ iface.section_key (this->section_key_);
+
+ iface.interface_contents (kind_queue,
+ path_queue,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ }
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (kind_queue.size ());
+ retval->length (size);
+
+ for (CORBA::ULong j = 0; j < size; ++j)
+ {
+ CORBA::DefinitionKind next_kind = CORBA::dk_none;
+ kind_queue.dequeue_head (next_kind);
+
+ ACE_TString next_path;
+ path_queue.dequeue_head (next_path);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (next_kind,
+ next_path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Contained_var next_cont =
+ CORBA::Contained::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[j] = next_cont._retn ();
+ }
+
+ return retval._retn ();
+}
+
+CORBA::ContainedSeq *
+TAO_Container_i::lookup_name (const char *search_name,
+ CORBA::Long levels_to_search,
+ CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->lookup_name_i (search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ContainedSeq *
+TAO_Container_i::lookup_name_i (const char *search_name,
+ CORBA::Long levels_to_search,
+ CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> kind_queue;
+ ACE_Unbounded_Queue<ACE_TString> path_queue;
+
+ this->lookup_name_recursive (kind_queue,
+ path_queue,
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER);
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (kind_queue.size ());
+
+ CORBA::ContainedSeq *holder;
+ ACE_NEW_THROW_EX (holder,
+ CORBA::ContainedSeq (size),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ContainedSeq_var retval = holder;
+ retval->length (size);
+
+ for (CORBA::ULong i = 0; i < size; ++i)
+ {
+ CORBA::DefinitionKind next_kind = CORBA::dk_none;
+ kind_queue.dequeue_head (next_kind);
+
+ ACE_TString next_path;
+ path_queue.dequeue_head (next_path);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (next_kind,
+ next_path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Contained_var next_cont =
+ CORBA::Contained::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[i] = next_cont._retn ();
+ }
+
+ return retval._retn ();
+}
+
+CORBA::Container::DescriptionSeq *
+TAO_Container_i::describe_contents (CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited,
+ CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_contents_i (limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Container::DescriptionSeq *
+TAO_Container_i::describe_contents_i (CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited,
+ CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ContainedSeq_var contents = this->contents_i (limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ULong length = contents->length ();
+ CORBA::ULong ret_len = 0;
+
+ if (max_returned_objs == -1)
+ {
+ ret_len = length;
+ }
+ else
+ {
+ ret_len = length < static_cast<CORBA::ULong> (max_returned_objs)
+ ? length
+ : max_returned_objs;
+ }
+
+ CORBA::Container::DescriptionSeq *desc_seq;
+ ACE_NEW_THROW_EX (desc_seq,
+ CORBA::Container::DescriptionSeq (ret_len),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ desc_seq->length (ret_len);
+ CORBA::Container::DescriptionSeq_var retval = desc_seq;
+ CORBA::Contained::Description_var desc;
+
+ ACE_Configuration_Section_Key contained_key;
+ PortableServer::ObjectId_var oid;
+ CORBA::String_var tmp;
+ TAO_Contained_i *impl = 0;
+
+ for (CORBA::ULong i = 0; i < ret_len; ++i)
+ {
+ ACE_TString contained_path (
+ TAO_IFR_Service_Utils::reference_to_path (contents[i])
+ );
+ impl = TAO_IFR_Service_Utils::path_to_contained (contained_path,
+ this->repo_);
+
+ desc = impl->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[i].contained_object = CORBA::Contained::_duplicate (contents[i]);
+
+ retval[i].kind = desc->kind;
+ retval[i].value = desc->value;
+ }
+
+ return retval._retn ();
+}
+
+CORBA::ModuleDef_ptr
+TAO_Container_i::create_module (const char *id,
+ const char *name,
+ const char *version
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ModuleDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ModuleDef::_nil ());
+
+ return this->create_module_i (id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ModuleDef_ptr
+TAO_Container_i::create_module_i (const char *id,
+ const char *name,
+ const char *version
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // new_key is not needed when creating a module, but it is needed
+ // by most of the other creation methods, so a blank one gets passed in.
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (this->def_kind (),
+ CORBA::dk_Module,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ModuleDef::_nil ());
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Module,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ModuleDef::_nil ());
+
+ return CORBA::ComponentIR::ModuleDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ConstantDef_ptr
+TAO_Container_i::create_constant (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ const CORBA::Any &value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ConstantDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ConstantDef::_nil ());
+
+ return this->create_constant_i (id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ConstantDef_ptr
+TAO_Container_i::create_constant_i (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ const CORBA::Any &value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (this->def_kind (),
+ CORBA::dk_Constant,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ConstantDef::_nil ());
+
+ // Get the path to our type and store it.
+ char *type_path = TAO_IFR_Service_Utils::reference_to_path (type);
+
+ this->repo_->config ()->set_string_value (new_key,
+ "type_path",
+ type_path);
+
+ // Store the value.
+ ACE_Message_Block *mb = 0;
+ TAO::Any_Impl *impl = value.impl ();
+
+ if (impl->encoded ())
+ {
+ TAO::Unknown_IDL_Type *unk =
+ dynamic_cast<TAO::Unknown_IDL_Type *> (impl);
+
+ mb = unk->_tao_get_cdr ().steal_contents ();
+ }
+ else
+ {
+ TAO_OutputCDR out;
+ impl->marshal_value (out);
+ TAO_InputCDR in (out);
+ mb = in.steal_contents ();
+ }
+
+ CORBA::TypeCode_var val_tc = value.type ();
+
+ CORBA::TCKind kind = val_tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ConstantDef::_nil ());
+
+ switch (kind)
+ {
+ // The data for these types requires alignment to an 8-byte
+ // boundary - the default for TAO CDR streams is 4.
+ case CORBA::tk_double:
+ case CORBA::tk_ulonglong:
+ case CORBA::tk_longlong:
+ case CORBA::tk_longdouble:
+ mb->rd_ptr (ACE_ptr_align_binary (mb->rd_ptr (),
+ ACE_CDR::MAX_ALIGNMENT));
+ break;
+ default:
+ break;
+ }
+
+ // Align the read pointer with the base, so mb->length()
+ // will be meaningful.
+ mb->crunch ();
+
+ this->repo_->config ()->set_binary_value (new_key,
+ "value",
+ mb->base (),
+ mb->length ());
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Constant,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ConstantDef::_nil ());
+
+ return CORBA::ConstantDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::StructDef_ptr
+TAO_Container_i::create_struct (const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::StructMemberSeq &members
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::StructDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::StructDef::_nil ());
+
+ return this->create_struct_i (id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::StructDef_ptr
+TAO_Container_i::create_struct_i (const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::StructMemberSeq &members
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (this->def_kind (),
+ CORBA::dk_Struct,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::StructDef::_nil ());
+
+ // Open a section for the struct's members.
+ ACE_Configuration_Section_Key refs_key;
+ this->repo_->config ()->open_section (new_key,
+ "refs",
+ 1,
+ refs_key);
+
+ CORBA::ULong count = members.length ();
+ this->repo_->config ()->set_integer_value (refs_key,
+ "count",
+ count);
+ char *member_path = 0;
+
+ // Create a section for each member. We just store the
+ // member name and the path to its database entry.
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ ACE_Configuration_Section_Key member_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (refs_key,
+ stringified,
+ 1,
+ member_key);
+
+ this->repo_->config ()->set_string_value (member_key,
+ "name",
+ members[i].name.in ());
+
+ member_path =
+ TAO_IFR_Service_Utils::reference_to_path (members[i].type_def.in ());
+
+ this->repo_->config ()->set_string_value (member_key,
+ "path",
+ member_path);
+ }
+
+ CORBA::DefinitionKind def_kind =
+ this->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::StructDef::_nil ());
+
+ if (def_kind == CORBA::dk_Struct
+ || def_kind == CORBA::dk_Union
+ || def_kind == CORBA::dk_Exception)
+ {
+ this->update_refs (path.c_str (),
+ name);
+ }
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Struct,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::StructDef::_nil ());
+
+ return CORBA::StructDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::UnionDef_ptr
+TAO_Container_i::create_union (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr discriminator_type,
+ const CORBA::UnionMemberSeq &members
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::UnionDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::UnionDef::_nil ());
+
+ return this->create_union_i (id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::UnionDef_ptr
+TAO_Container_i::create_union_i (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr discriminator_type,
+ const CORBA::UnionMemberSeq &members
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (this->def_kind (),
+ CORBA::dk_Union,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::UnionDef::_nil ());
+
+ // Add a field to hold the path to the discriminator type.
+ char *disc_path =
+ TAO_IFR_Service_Utils::reference_to_path (discriminator_type);
+
+ this->repo_->config ()->set_string_value (new_key,
+ "disc_path",
+ disc_path);
+
+ ACE_Configuration_Section_Key refs_key;
+
+ // For the union's members.
+ this->repo_->config ()->open_section (new_key,
+ "refs",
+ 1,
+ refs_key);
+
+ CORBA::ULong count = members.length ();
+ this->repo_->config ()->set_integer_value (refs_key,
+ "count",
+ count);
+ char *member_path = 0;
+
+ // Create a section for each member. We store the member
+ // name, its label value, and the path to its database entry.
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ ACE_Configuration_Section_Key member_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (refs_key,
+ stringified,
+ 1,
+ member_key);
+
+ this->repo_->config ()->set_string_value (member_key,
+ "name",
+ members[i].name.in ());
+
+ member_path =
+ TAO_IFR_Service_Utils::reference_to_path (members[i].type_def.in ());
+
+ this->repo_->config ()->set_string_value (member_key,
+ "path",
+ member_path);
+
+ this->store_label (member_key,
+ members[i].label
+ ACE_ENV_ARG_PARAMETER);
+ }
+
+ CORBA::DefinitionKind def_kind =
+ this->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::UnionDef::_nil ());
+
+ if (def_kind == CORBA::dk_Struct
+ || def_kind == CORBA::dk_Union
+ || def_kind == CORBA::dk_Exception)
+ {
+ this->update_refs (path.c_str (),
+ name);
+ }
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Union,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::UnionDef::_nil ());
+
+ return CORBA::UnionDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::EnumDef_ptr
+TAO_Container_i::create_enum (const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::EnumMemberSeq &members
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::EnumDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::EnumDef::_nil ());
+
+ return this->create_enum_i (id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::EnumDef_ptr
+TAO_Container_i::create_enum_i (const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::EnumMemberSeq &members
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (this->def_kind (),
+ CORBA::dk_Enum,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::EnumDef::_nil ());
+
+ // Store the member count of the enum.
+ CORBA::ULong count = members.length ();
+ this->repo_->config ()->set_integer_value (new_key,
+ "count",
+ count);
+
+ // Create a section for each member, named for
+ // its ordinal position in the enum,
+ for (CORBA::ULong i = 0; i < count; i++)
+ {
+ ACE_Configuration_Section_Key member_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (new_key,
+ stringified,
+ 1,
+ member_key);
+
+ this->repo_->config ()->set_string_value (member_key,
+ "name",
+ members[i]);
+ }
+
+ CORBA::DefinitionKind def_kind =
+ this->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::EnumDef::_nil ());
+
+ if (def_kind == CORBA::dk_Struct
+ || def_kind == CORBA::dk_Union
+ || def_kind == CORBA::dk_Exception)
+ {
+ this->update_refs (path.c_str (),
+ name);
+ }
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Enum,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::EnumDef::_nil ());
+
+ return CORBA::EnumDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::AliasDef_ptr
+TAO_Container_i::create_alias (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::AliasDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::AliasDef::_nil ());
+
+ return this->create_alias_i (id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::AliasDef_ptr
+TAO_Container_i::create_alias_i (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (this->def_kind (),
+ CORBA::dk_Alias,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::AliasDef::_nil ());
+
+ // Get the path to our original type and store it.
+ char *unalias_path =
+ TAO_IFR_Service_Utils::reference_to_path (original_type);
+
+ this->repo_->config ()->set_string_value (new_key,
+ "original_type",
+ unalias_path);
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Alias,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::AliasDef::_nil ());
+
+ return CORBA::AliasDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::InterfaceDef_ptr
+TAO_Container_i::create_interface (const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::InterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::InterfaceDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::InterfaceDef::_nil ());
+
+ return this->create_interface_i (id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::InterfaceDef_ptr
+TAO_Container_i::create_interface_i (const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::InterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (this->def_kind (),
+ CORBA::dk_Interface,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::InterfaceDef::_nil ());
+
+ CORBA::ULong length = base_interfaces.length ();
+
+ if (length > 0)
+ {
+ // Open a section for the base interfaces.
+ ACE_Configuration_Section_Key inherited_key;
+ this->repo_->config ()->open_section (new_key,
+ "inherited",
+ 1,
+ inherited_key);
+ char *inherited_path = 0;
+
+ // Store the path to each base interface.
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ inherited_path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ base_interfaces[i]
+ );
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (inherited_key,
+ stringified,
+ inherited_path);
+ }
+ }
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Interface,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::InterfaceDef::_nil ());
+
+ return CORBA::InterfaceDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ValueDef_ptr
+TAO_Container_i::create_value (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::Boolean is_custom,
+ CORBA::Boolean is_abstract,
+ CORBA::ValueDef_ptr base_value,
+ CORBA::Boolean is_truncatable,
+ const CORBA::ValueDefSeq &abstract_base_values,
+ const CORBA::InterfaceDefSeq &supported_interfaces,
+ const CORBA::InitializerSeq &initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ValueDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ValueDef::_nil ());
+
+ return this->create_value_i (id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ValueDef_ptr
+TAO_Container_i::create_value_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::Boolean is_custom,
+ CORBA::Boolean is_abstract,
+ CORBA::ValueDef_ptr base_value,
+ CORBA::Boolean is_truncatable,
+ const CORBA::ValueDefSeq &abstract_base_values,
+ const CORBA::InterfaceDefSeq &supported_interfaces,
+ const CORBA::InitializerSeq &initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ this->create_value_common (this->def_kind (),
+ this->section_key_,
+ new_key,
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ValueDef::_nil ());
+
+ TAO_IFR_Generic_Utils<CORBA::InitializerSeq>::set_initializers (
+ initializers,
+ this->repo_->config (),
+ new_key
+ );
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Value,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ValueDef::_nil ());
+
+ return CORBA::ValueDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ValueBoxDef_ptr
+TAO_Container_i::create_value_box (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ValueBoxDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ValueBoxDef::_nil ());
+
+ return this->create_value_box_i (id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ValueBoxDef_ptr
+TAO_Container_i::create_value_box_i (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (this->def_kind (),
+ CORBA::dk_ValueBox,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ValueBoxDef::_nil ());
+
+ // Get the path to our original type and store it.
+ char *boxed_path =
+ TAO_IFR_Service_Utils::reference_to_path (original_type_def);
+
+ this->repo_->config ()->set_string_value (new_key,
+ "boxed_type",
+ boxed_path);
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_ValueBox,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ValueBoxDef::_nil ());
+
+ return CORBA::ValueBoxDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ExceptionDef_ptr
+TAO_Container_i::create_exception (const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::StructMemberSeq &members
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ExceptionDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ExceptionDef::_nil ());
+
+ return this->create_exception_i (id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ExceptionDef_ptr
+TAO_Container_i::create_exception_i (const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::StructMemberSeq &members
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (this->def_kind (),
+ CORBA::dk_Exception,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ExceptionDef::_nil ());
+
+ ACE_Configuration_Section_Key refs_key;
+ this->repo_->config ()->open_section (new_key,
+ "refs",
+ 1,
+ refs_key);
+
+ CORBA::ULong count = members.length ();
+ this->repo_->config ()->set_integer_value (refs_key,
+ "count",
+ count);
+ char *member_path = 0;
+
+ // Create a section for each member. We just store the
+ // member name and the path to its database entry.
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ ACE_Configuration_Section_Key member_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (refs_key,
+ stringified,
+ 1,
+ member_key);
+
+ this->repo_->config ()->set_string_value (member_key,
+ "name",
+ members[i].name.in ());
+
+ member_path =
+ TAO_IFR_Service_Utils::reference_to_path (members[i].type_def.in ());
+
+ this->repo_->config ()->set_string_value (member_key,
+ "path",
+ member_path);
+ }
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Exception,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ExceptionDef::_nil ());
+
+ return CORBA::ExceptionDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::NativeDef_ptr
+TAO_Container_i::create_native (const char *id,
+ const char *name,
+ const char *version
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::NativeDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::NativeDef::_nil ());
+
+ return this->create_native_i (id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::NativeDef_ptr
+TAO_Container_i::create_native_i (const char *id,
+ const char *name,
+ const char *version
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (this->def_kind (),
+ CORBA::dk_Native,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::NativeDef::_nil ());
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Native,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::NativeDef::_nil ());
+
+ return CORBA::NativeDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::AbstractInterfaceDef_ptr
+TAO_Container_i::create_abstract_interface (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::AbstractInterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::AbstractInterfaceDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::AbstractInterfaceDef::_nil ());
+
+ return this->create_abstract_interface_i (id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::AbstractInterfaceDef_ptr
+TAO_Container_i::create_abstract_interface_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::AbstractInterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (this->def_kind (),
+ CORBA::dk_AbstractInterface,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::AbstractInterfaceDef::_nil ());
+
+ CORBA::ULong length = base_interfaces.length ();
+
+ if (length > 0)
+ {
+ // Open a section for the base interfaces.
+ ACE_Configuration_Section_Key inherited_key;
+
+ this->repo_->config ()->open_section (new_key,
+ "inherited",
+ 1,
+ inherited_key);
+ char *inherited_path = 0;
+
+ // Store the path to each base interface.
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ inherited_path =
+ TAO_IFR_Service_Utils::reference_to_path (base_interfaces[i]);
+
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (inherited_key,
+ stringified,
+ inherited_path);
+ }
+ }
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_AbstractInterface,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::AbstractInterfaceDef::_nil ());
+
+ return CORBA::AbstractInterfaceDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::LocalInterfaceDef_ptr
+TAO_Container_i::create_local_interface (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::InterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::LocalInterfaceDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::LocalInterfaceDef::_nil ());
+
+ return this->create_local_interface_i (id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::LocalInterfaceDef_ptr
+TAO_Container_i::create_local_interface_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::InterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (this->def_kind (),
+ CORBA::dk_LocalInterface,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::LocalInterfaceDef::_nil ());
+
+ CORBA::ULong length = base_interfaces.length ();
+
+ if (length > 0)
+ {
+ // Open a section for the base interfaces.
+ ACE_Configuration_Section_Key inherited_key;
+
+ this->repo_->config ()->open_section (new_key,
+ "inherited",
+ 1,
+ inherited_key);
+ char *inherited_path = 0;
+
+ // Store the path to each base interface.
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ inherited_path =
+ TAO_IFR_Service_Utils::reference_to_path (base_interfaces[i]);
+
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (inherited_key,
+ stringified,
+ inherited_path);
+ }
+ }
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_LocalInterface,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::LocalInterfaceDef::_nil ());
+
+ return CORBA::LocalInterfaceDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ExtValueDef_ptr
+TAO_Container_i::create_ext_value (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::Boolean is_custom,
+ CORBA::Boolean is_abstract,
+ CORBA::ValueDef_ptr base_value,
+ CORBA::Boolean is_truncatable,
+ const CORBA::ValueDefSeq &abstract_base_values,
+ const CORBA::InterfaceDefSeq &supported_interfaces,
+ const CORBA::ExtInitializerSeq &initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ExtValueDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ExtValueDef::_nil ());
+
+ return this->create_ext_value_i (id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ExtValueDef_ptr
+TAO_Container_i::create_ext_value_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::Boolean is_custom,
+ CORBA::Boolean is_abstract,
+ CORBA::ValueDef_ptr base_value,
+ CORBA::Boolean is_truncatable,
+ const CORBA::ValueDefSeq &abstract_base_values,
+ const CORBA::InterfaceDefSeq &supported_interfaces,
+ const CORBA::ExtInitializerSeq &initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ this->create_value_common (this->def_kind (),
+ this->section_key_,
+ new_key,
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ExtValueDef::_nil ());
+
+ /// This does not handle the initializer exceptions, so we do that below.
+ TAO_IFR_Generic_Utils<CORBA::ExtInitializerSeq>::set_initializers (
+ initializers,
+ this->repo_->config (),
+ new_key
+ );
+
+ CORBA::ULong length = initializers.length ();
+
+ if (length > 0)
+ {
+ ACE_Configuration_Section_Key initializers_key, initializer_key;
+ char *stringified = 0;
+
+ this->repo_->config ()->open_section (new_key,
+ "initializers",
+ 0,
+ initializers_key);
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (initializers_key,
+ stringified,
+ 0,
+ initializer_key);
+
+ TAO_ExtValueDef_i impl (this->repo_);
+ impl.section_key (new_key);
+ impl.exceptions (initializer_key,
+ "excepts",
+ initializers[i].exceptions);
+ }
+ }
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Value,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ExtValueDef::_nil ());
+
+ return CORBA::ExtValueDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+int
+TAO_Container_i::same_as_tmp_name (const char *name)
+{
+ return ACE_OS::strcmp (TAO_Container_i::tmp_name_holder_, name) == 0;
+}
+
+void
+TAO_Container_i::tmp_name_holder (const char *name)
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+}
+
+void
+TAO_Container_i::lookup_name_recursive (
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> &kind_queue,
+ ACE_Unbounded_Queue<ACE_TString> &path_queue,
+ const char *search_name,
+ CORBA::Long levels_to_search,
+ CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+{
+ ACE_Configuration_Section_Key defns_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "defns",
+ 0,
+ defns_key);
+
+ if (status == 0)
+ {
+ int index = 0;
+ ACE_TString section_name;
+ while (this->repo_->config ()->enumerate_sections (defns_key,
+ index++,
+ section_name)
+ == 0)
+ {
+ ACE_Configuration_Section_Key defn_key;
+ this->repo_->config ()->open_section (defns_key,
+ section_name.c_str (),
+ 0,
+ defn_key);
+
+ u_int kind = 0;
+ this->repo_->config ()->get_integer_value (defn_key,
+ "def_kind",
+ kind);
+
+ CORBA::DefinitionKind def_kind =
+ static_cast<CORBA::DefinitionKind> (kind);
+
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (defn_key,
+ "id",
+ id);
+
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (
+ this->repo_->repo_ids_key (),
+ id.c_str (),
+ path
+ );
+
+ if (limit_type == CORBA::dk_all || limit_type == def_kind)
+ {
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (defn_key,
+ "name",
+ name);
+
+ if (ACE_OS::strcmp (name.c_str (), search_name) == 0)
+ {
+ kind_queue.enqueue_tail (def_kind);
+
+ path_queue.enqueue_tail (path);
+ }
+ }
+
+ if (levels_to_search == -1 || levels_to_search > 1)
+ {
+ TAO_Container_i *impl =
+ TAO_IFR_Service_Utils::path_to_container (path,
+ this->repo_);
+
+ // This member may not be a container.
+ if (impl == 0)
+ {
+ continue;
+ }
+
+ impl->lookup_name_recursive (kind_queue,
+ path_queue,
+ search_name,
+ levels_to_search == -1
+ ? -1
+ : levels_to_search - 1,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ }
+
+ CORBA::DefinitionKind kind = this->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (kind == CORBA::dk_Interface || kind == CORBA::dk_Value)
+ {
+ if (limit_type == CORBA::dk_all || limit_type == CORBA::dk_Attribute)
+ {
+ this->lookup_attr (kind_queue,
+ path_queue,
+ search_name,
+ exclude_inherited);
+ }
+
+ if (limit_type == CORBA::dk_all || limit_type == CORBA::dk_Operation)
+ {
+ this->lookup_op (kind_queue,
+ path_queue,
+ search_name,
+ exclude_inherited);
+ }
+ }
+}
+
+void
+TAO_Container_i:: lookup_attr (
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> &kind_queue,
+ ACE_Unbounded_Queue<ACE_TString> &path_queue,
+ const char *search_name,
+ CORBA::Boolean exclude_inherited
+ )
+{
+ int index = 0;
+ ACE_TString section_name;
+
+ ACE_Configuration_Section_Key sub_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "attrs",
+ 0,
+ sub_key);
+
+ if (status == 0)
+ {
+ while (this->repo_->config ()->enumerate_sections (sub_key,
+ index++,
+ section_name)
+ == 0)
+ {
+ ACE_Configuration_Section_Key member_key;
+ this->repo_->config ()->open_section (sub_key,
+ section_name.c_str (),
+ 0,
+ member_key);
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (member_key,
+ "name",
+ name);
+
+ if (name == search_name)
+ {
+ kind_queue.enqueue_tail (CORBA::dk_Attribute);
+
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (member_key,
+ "id",
+ id);
+
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (
+ this->repo_->repo_ids_key (),
+ id.c_str (),
+ path
+ );
+
+ path_queue.enqueue_tail (path);
+ }
+ }
+ }
+
+ if (exclude_inherited == 0)
+ {
+ ACE_Configuration_Section_Key bases_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "inherited",
+ 0,
+ bases_key);
+
+ if (status == 0)
+ {
+ ACE_Configuration::VALUETYPE type;
+ index = 0;
+ while (this->repo_->config ()->enumerate_values (
+ bases_key,
+ index++,
+ section_name,
+ type
+ )
+ == 0)
+ {
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (
+ bases_key,
+ section_name.c_str (),
+ path);
+
+ ACE_Configuration_Section_Key base_key;
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ path,
+ base_key,
+ 0);
+
+ TAO_InterfaceDef_i impl (this->repo_);
+ impl.section_key (base_key);
+
+ impl.lookup_attr (kind_queue,
+ path_queue,
+ search_name,
+ exclude_inherited);
+ }
+ }
+ }
+}
+
+void
+TAO_Container_i::lookup_op (
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> &kind_queue,
+ ACE_Unbounded_Queue<ACE_TString> &path_queue,
+ const char *search_name,
+ CORBA::Boolean exclude_inherited
+ )
+{
+ int index = 0;
+ ACE_TString section_name;
+
+ ACE_Configuration_Section_Key sub_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "ops",
+ 0,
+ sub_key);
+
+ if (status == 0)
+ {
+ while (this->repo_->config ()->enumerate_sections (sub_key,
+ index++,
+ section_name)
+ == 0)
+ {
+ ACE_Configuration_Section_Key member_key;
+ this->repo_->config ()->open_section (sub_key,
+ section_name.c_str (),
+ 0,
+ member_key);
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (member_key,
+ "name",
+ name);
+
+ if (name == search_name)
+ {
+ kind_queue.enqueue_tail (CORBA::dk_Operation);
+
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (member_key,
+ "id",
+ id);
+
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (
+ this->repo_->repo_ids_key (),
+ id.c_str (),
+ path
+ );
+
+ path_queue.enqueue_tail (path);
+ }
+ }
+ }
+
+ if (exclude_inherited == 0)
+ {
+ ACE_Configuration_Section_Key bases_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "inherited",
+ 0,
+ bases_key);
+
+ if (status == 0)
+ {
+ ACE_Configuration::VALUETYPE type;
+ index = 0;
+
+ while (this->repo_->config ()->enumerate_values (
+ bases_key,
+ index++,
+ section_name,
+ type
+ )
+ == 0)
+ {
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (
+ bases_key,
+ section_name.c_str (),
+ path);
+
+ ACE_Configuration_Section_Key base_key;
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ path,
+ base_key,
+ 0);
+
+ TAO_InterfaceDef_i impl (this->repo_);
+ impl.section_key (base_key);
+
+ impl.lookup_op (kind_queue,
+ path_queue,
+ search_name,
+ exclude_inherited);
+ }
+ }
+ }
+}
+
+void
+TAO_Container_i::store_label (ACE_Configuration_Section_Key key,
+ const CORBA::Any &value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::TypeCode_var tc = value.type ();
+
+ CORBA::TCKind kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ u_int result = 0;
+ int default_label = 0;
+
+ switch (kind)
+ {
+ case CORBA::tk_octet:
+ default_label = 1;
+ break;
+ case CORBA::tk_char:
+ {
+ CORBA::Char x;
+ value >>= CORBA::Any::to_char (x);
+ result = static_cast<u_int> (x);
+ break;
+ }
+ case CORBA::tk_wchar:
+ {
+ CORBA::WChar x;
+ value >>= CORBA::Any::to_wchar (x);
+ result = static_cast<u_int> (x);
+ break;
+ }
+ case CORBA::tk_boolean:
+ {
+ CORBA::Boolean x;
+ value >>= CORBA::Any::to_boolean (x);
+ result = static_cast<u_int> (x);
+ break;
+ }
+ case CORBA::tk_short:
+ {
+ CORBA::Short x;
+ value >>= x;
+ result = static_cast<u_int> (x);
+ break;
+ }
+ case CORBA::tk_ushort:
+ {
+ CORBA::UShort x;
+ value >>= x;
+ result = static_cast<u_int> (x);
+ break;
+ }
+ case CORBA::tk_long:
+ {
+ CORBA::Long x;
+ value >>= x;
+ result = static_cast<u_int> (x);
+ break;
+ }
+ case CORBA::tk_ulong:
+ {
+ CORBA::ULong x;
+ value >>= x;
+ result = static_cast<u_int> (x);
+ break;
+ }
+#if !defined (ACE_LACKS_LONGLONG_T)
+ case CORBA::tk_longlong:
+ {
+ CORBA::LongLong x;
+ value >>= x;
+ // We could lose data here.
+ result = static_cast<u_int> (x);
+ break;
+ }
+#endif /* ACE_LACKS_LONGLONG_T */
+#if !(defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T))
+ case CORBA::tk_ulonglong:
+ {
+ CORBA::ULongLong x;
+ value >>= x;
+ // We could lose data here.
+ result = static_cast<u_int> (x);
+ break;
+ }
+#endif
+ case CORBA::tk_enum:
+ {
+ CORBA::ULong x;
+ TAO::Any_Impl *impl = value.impl ();
+ TAO_InputCDR in (static_cast<ACE_Message_Block *> (0));
+
+ if (impl->encoded ())
+ {
+ TAO::Unknown_IDL_Type *unk =
+ dynamic_cast<TAO::Unknown_IDL_Type *> (impl);
+
+ in = unk->_tao_get_cdr ();
+ }
+ else
+ {
+ TAO_OutputCDR out;
+ impl->marshal_value (out);
+ TAO_InputCDR tmp (out);
+ in = tmp;
+ }
+
+ in.read_ulong (x);
+ result = static_cast<u_int> (x);
+ break;
+ }
+ default:
+ break;
+ }
+
+ if (default_label == 1)
+ {
+ this->repo_->config ()->set_string_value (key,
+ "label",
+ "default");
+ }
+ else
+ {
+ this->repo_->config ()->set_integer_value (key,
+ "label",
+ result);
+ }
+}
+
+void
+TAO_Container_i::update_refs (const char *path,
+ const char *name)
+{
+ ACE_Configuration_Section_Key refs_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "refs",
+ 0,
+ refs_key);
+
+ // If this container has no "refs" section, there is nothing to do.
+ if (status != 0)
+ {
+ return;
+ }
+
+ u_int count = 0;
+ this->repo_->config ()->get_integer_value (refs_key,
+ "count",
+ count);
+
+ int index = 0;
+ ACE_TString section_name;
+ while (this->repo_->config ()->enumerate_sections (refs_key,
+ index++,
+ section_name)
+ == 0)
+ {
+ ACE_Configuration_Section_Key ref_key;
+ this->repo_->config ()->open_section (refs_key,
+ section_name.c_str (),
+ 0,
+ ref_key);
+
+ ACE_TString ref_name;
+ this->repo_->config ()->get_string_value (ref_key,
+ "name",
+ ref_name);
+
+ ACE_TString::size_type pos = ref_name.find (this->repo_->extension ());
+
+ // If one of the names has been mangled by move(), fix it.
+ if (pos != ACE_TString::npos)
+ {
+ // If we're just changing the path after doing a 'move',
+ // we don't want to change the name, so we've passed in 0.
+ if (name != 0)
+ {
+ this->repo_->config ()->set_string_value (ref_key,
+ "name",
+ name);
+ }
+ else
+ {
+ this->repo_->config ()->set_string_value (ref_key,
+ "name",
+ ref_name.substr (0, pos));
+ }
+
+ this->repo_->config ()->set_string_value (ref_key,
+ "path",
+ path);
+
+ return;
+ }
+ }
+
+ // If we're just changing the path after doing a 'move', we're done.
+ if (name == 0)
+ {
+ return;
+ }
+
+ // Add a new reference.
+ ACE_Configuration_Section_Key new_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (count);
+ this->repo_->config ()->open_section (refs_key,
+ stringified,
+ 1,
+ new_key);
+
+ this->repo_->config ()->set_string_value (new_key,
+ "name",
+ name);
+
+ this->repo_->config ()->set_string_value (new_key,
+ "path",
+ path);
+
+ this->repo_->config ()->set_integer_value (refs_key,
+ "count",
+ count + 1);
+}
+
+ACE_TString
+TAO_Container_i::create_value_common (
+ CORBA::DefinitionKind container_kind,
+ ACE_Configuration_Section_Key &container_key,
+ ACE_Configuration_Section_Key &new_key,
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::Boolean is_custom,
+ CORBA::Boolean is_abstract,
+ CORBA::ValueDef_ptr base_value,
+ CORBA::Boolean is_truncatable,
+ const CORBA::ValueDefSeq &abstract_base_values,
+ const CORBA::InterfaceDefSeq &supported_interfaces
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_TString path;
+ path =
+ TAO_IFR_Service_Utils::create_common (container_kind,
+ CORBA::dk_Value,
+ container_key,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "defns"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (path);
+
+ this->repo_->config ()->set_integer_value (new_key,
+ "is_custom",
+ (CORBA::ULong) is_custom);
+
+ this->repo_->config ()->set_integer_value (new_key,
+ "is_abstract",
+ (CORBA::ULong) is_abstract);
+
+ this->repo_->config ()->set_integer_value (new_key,
+ "is_truncatable",
+ (CORBA::ULong) is_truncatable);
+ if (!CORBA::is_nil (base_value))
+ {
+ const char *base_path =
+ TAO_IFR_Service_Utils::reference_to_path (base_value);
+
+ // Get the servant's key into the temporary key holder, because
+ // the name clash checker for base valuetypes is static, and has
+ // no other way to know about a specific key.
+ this->repo_->config ()->expand_path (
+ this->repo_->root_key (),
+ base_path,
+ TAO_IFR_Service_Utils::tmp_key_,
+ 0
+ );
+ TAO_IFR_Service_Utils::name_exists (&TAO_ValueDef_i::name_clash,
+ new_key,
+ this->repo_,
+ CORBA::dk_Value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (path);
+
+ ACE_TString base_value_id;
+ this->repo_->config ()->get_string_value (TAO_IFR_Service_Utils::tmp_key_,
+ "id",
+ base_value_id);
+
+ this->repo_->config ()->set_string_value (new_key,
+ "base_value",
+ base_value_id);
+ }
+
+ CORBA::ULong length = abstract_base_values.length ();
+
+ if (length > 0)
+ {
+ ACE_Configuration_Section_Key bases_key;
+ this->repo_->config ()->open_section (this->section_key_,
+ "abstract_bases",
+ 1,
+ bases_key);
+ this->repo_->config ()->set_integer_value (bases_key,
+ "count",
+ length);
+
+ ACE_TString base_id;
+ const char *base_path = 0;
+ char *stringified = 0;
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ base_path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ abstract_base_values[i]
+ );
+
+ // Get the servant's key into the temporary key holder, because
+ // the name clash checker for base interfaces is static, and has
+ // no other way to know about a specific key.
+ this->repo_->config ()->expand_path (
+ this->repo_->root_key (),
+ base_path,
+ TAO_IFR_Service_Utils::tmp_key_,
+ 0
+ );
+ TAO_IFR_Service_Utils::name_exists (&TAO_ValueDef_i::name_clash,
+ new_key,
+ this->repo_,
+ CORBA::dk_Value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (path);
+
+ this->repo_->config ()->get_string_value (
+ TAO_IFR_Service_Utils::tmp_key_,
+ "id",
+ base_id
+ );
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (bases_key,
+ stringified,
+ base_id);
+ }
+ }
+
+ length = supported_interfaces.length ();
+
+ if (length > 0)
+ {
+ ACE_Configuration_Section_Key supported_key;
+ this->repo_->config ()->open_section (new_key,
+ "supported",
+ 1,
+ supported_key);
+ this->repo_->config ()->set_integer_value (supported_key,
+ "count",
+ length);
+ ACE_TString supported_id;
+ const char *supported_path = 0;
+ CORBA::ULong kind = 0;
+ CORBA::Boolean concrete_seen = 0;
+ CORBA::DefinitionKind def_kind;
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ supported_path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ supported_interfaces[i]
+ );
+
+ // Get the servant's key into the temporary key holder, because
+ // the name clash checker for base interfaces is static, and has
+ // no other way to know about a specific key.
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ supported_path,
+ TAO_IFR_Service_Utils::tmp_key_,
+ 0);
+ this->repo_->config ()->get_integer_value (
+ TAO_IFR_Service_Utils::tmp_key_,
+ "def_kind",
+ kind);
+ def_kind = static_cast<CORBA::DefinitionKind> (kind);
+
+ if (def_kind == CORBA::dk_Interface)
+ {
+ if (concrete_seen == 0)
+ {
+ concrete_seen = 1;
+ }
+ else
+ {
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 12,
+ CORBA::COMPLETED_NO),
+ path);
+ }
+ }
+
+ TAO_IFR_Service_Utils::name_exists (&TAO_ValueDef_i::name_clash,
+ new_key,
+ this->repo_,
+ CORBA::dk_Value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (path);
+
+ this->repo_->config ()->get_string_value (
+ TAO_IFR_Service_Utils::tmp_key_,
+ "id",
+ supported_id
+ );
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (supported_key,
+ stringified,
+ supported_id);
+ }
+ }
+
+ return path;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/Container_i.h b/TAO/orbsvcs/orbsvcs/IFRService/Container_i.h
new file mode 100644
index 00000000000..ab8e833579b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/Container_i.h
@@ -0,0 +1,479 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// Container_i.h
+//
+// = DESCRIPTION
+// Container servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_CONTAINER_I_H
+#define TAO_CONTAINER_I_H
+
+#include "orbsvcs/IFRService/IRObject_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Repository_i;
+
+class TAO_IFRService_Export TAO_Container_i : public virtual TAO_IRObject_i
+{
+ // = TITLE
+ // TAO_Container_i
+ //
+ // = DESCRIPTION
+ // Abstract base class used to form a containment hierarchy
+ // in the Interface Repository, by containing objects
+ // derived from the Contained interface.
+ //
+public:
+// template<typename T>
+// friend class TAO_Port_Utils;
+
+ TAO_Container_i (TAO_Repository_i *repo);
+ // Constructor.
+
+ virtual ~TAO_Container_i (void);
+ // Destructor.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove our contents.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Contained_ptr lookup (
+ const char *search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Contained_ptr lookup_i (
+ const char *search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ContainedSeq *contents (
+ CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ContainedSeq *contents_i (
+ CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ContainedSeq *lookup_name (
+ const char *search_name,
+ CORBA::Long levels_to_search,
+ CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ContainedSeq *lookup_name_i (
+ const char *search_name,
+ CORBA::Long levels_to_search,
+ CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Container::DescriptionSeq *describe_contents (
+ CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited,
+ CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Container::DescriptionSeq *describe_contents_i (
+ CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited,
+ CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ModuleDef_ptr create_module (
+ const char *id,
+ const char *name,
+ const char *version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ModuleDef_ptr create_module_i (
+ const char *id,
+ const char *name,
+ const char *version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ConstantDef_ptr create_constant (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ const CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ConstantDef_ptr create_constant_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ const CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::StructDef_ptr create_struct (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::StructMemberSeq &members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::StructDef_ptr create_struct_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::StructMemberSeq &members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::UnionDef_ptr create_union (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr discriminator_type,
+ const CORBA::UnionMemberSeq &members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::UnionDef_ptr create_union_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr discriminator_type,
+ const CORBA::UnionMemberSeq &members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::EnumDef_ptr create_enum (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::EnumMemberSeq &members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::EnumDef_ptr create_enum_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::EnumMemberSeq &members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::AliasDef_ptr create_alias (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::AliasDef_ptr create_alias_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::InterfaceDef_ptr create_interface (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::InterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::InterfaceDef_ptr create_interface_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::InterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ValueDef_ptr create_value (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::Boolean is_custom,
+ CORBA::Boolean is_abstract,
+ CORBA::ValueDef_ptr base_value,
+ CORBA::Boolean is_truncatable,
+ const CORBA::ValueDefSeq &abstract_base_values,
+ const CORBA::InterfaceDefSeq & supported_interfaces,
+ const CORBA::InitializerSeq &initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ValueDef_ptr create_value_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::Boolean is_custom,
+ CORBA::Boolean is_abstract,
+ CORBA::ValueDef_ptr base_value,
+ CORBA::Boolean is_truncatable,
+ const CORBA::ValueDefSeq &abstract_base_values,
+ const CORBA::InterfaceDefSeq & supported_interfaces,
+ const CORBA::InitializerSeq &initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ValueBoxDef_ptr create_value_box (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ValueBoxDef_ptr create_value_box_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ExceptionDef_ptr create_exception (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::StructMemberSeq &members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ExceptionDef_ptr create_exception_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::StructMemberSeq &members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::NativeDef_ptr create_native (
+ const char *id,
+ const char *name,
+ const char *version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::NativeDef_ptr create_native_i (
+ const char *id,
+ const char *name,
+ const char *version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::AbstractInterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::AbstractInterfaceDef_ptr create_abstract_interface_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::AbstractInterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::InterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::LocalInterfaceDef_ptr create_local_interface_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::InterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::Boolean is_custom,
+ CORBA::Boolean is_abstract,
+ CORBA::ValueDef_ptr base_value,
+ CORBA::Boolean is_truncatable,
+ const CORBA::ValueDefSeq &abstract_base_values,
+ const CORBA::InterfaceDefSeq &supported_interfaces,
+ const CORBA::ExtInitializerSeq &initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ExtValueDef_ptr create_ext_value_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::Boolean is_custom,
+ CORBA::Boolean is_abstract,
+ CORBA::ValueDef_ptr base_value,
+ CORBA::Boolean is_truncatable,
+ const CORBA::ValueDefSeq &abstract_base_values,
+ const CORBA::InterfaceDefSeq &supported_interfaces,
+ const CORBA::ExtInitializerSeq &initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ static int same_as_tmp_name (const char *name);
+ // Called from TAO_IFR_Service_Utils::name_exisits.
+
+ static void tmp_name_holder (const char *name);
+ // Accesses the static member.
+
+ void update_refs (
+ const char *path,
+ const char *name = 0
+ );
+ // Used with structs, unions and exceptions.
+
+protected:
+ void store_label (
+ ACE_Configuration_Section_Key key,
+ const CORBA::Any &value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Store a union member's label value.
+
+ void lookup_attr (
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> &kind_queue,
+ ACE_Unbounded_Queue<ACE_TString> &path_queue,
+ const char *search_name,
+ CORBA::Boolean exclude_inherited
+ );
+
+ void lookup_op (
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> &kind_queue,
+ ACE_Unbounded_Queue<ACE_TString> &path_queue,
+ const char *search_name,
+ CORBA::Boolean exclude_inherited
+ );
+
+private:
+ void lookup_name_recursive (
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> &kind_queue,
+ ACE_Unbounded_Queue<ACE_TString> &path_queue,
+ const char *search_name,
+ CORBA::Long levels_to_search,
+ CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ ACE_TString create_value_common (
+ CORBA::DefinitionKind container_kind,
+ ACE_Configuration_Section_Key &container_key,
+ ACE_Configuration_Section_Key &new_key,
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::Boolean is_custom,
+ CORBA::Boolean is_abstract,
+ CORBA::ValueDef_ptr base_value,
+ CORBA::Boolean is_truncatable,
+ const CORBA::ValueDefSeq &abstract_base_values,
+ const CORBA::InterfaceDefSeq &supported_interfaces
+ ACE_ENV_ARG_DECL
+ );
+ // Common code for create_value_i and create_ext_value_i.
+
+protected:
+ static const char *tmp_name_holder_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_CONTAINER_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/EmitsDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/EmitsDef_i.cpp
new file mode 100644
index 00000000000..0cbe4a4093d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/EmitsDef_i.cpp
@@ -0,0 +1,32 @@
+// $Id$
+
+#include "orbsvcs/IFRService/EmitsDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+
+ACE_RCSID (IFRService,
+ EmitsDef_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EmitsDef_i::TAO_EmitsDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo),
+ TAO_EventPortDef_i (repo)
+{
+}
+
+TAO_EmitsDef_i::~TAO_EmitsDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_EmitsDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Emits;
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/EmitsDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/EmitsDef_i.h
new file mode 100644
index 00000000000..5d8e93fdeba
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/EmitsDef_i.h
@@ -0,0 +1,68 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// EmitsDef_i.h
+//
+// = DESCRIPTION
+// EmitsDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_EMITSDEF_I_H
+#define TAO_EMITSDEF_I_H
+
+#include "orbsvcs/IFRService/EventPortDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_EmitsDef_i
+ : public virtual TAO_EventPortDef_i
+{
+ // = TITLE
+ // TAO_EmitsDef_i
+ //
+ // = DESCRIPTION
+ // Represents the definition of an event that is emitted
+ // by a component.
+ //
+public:
+ TAO_EmitsDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_EmitsDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_EMITSDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/EnumDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/EnumDef_i.cpp
new file mode 100644
index 00000000000..5273788b6de
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/EnumDef_i.cpp
@@ -0,0 +1,163 @@
+// $Id$
+
+#include "orbsvcs/IFRService/EnumDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ EnumDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EnumDef_i::TAO_EnumDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo),
+ TAO_TypedefDef_i (repo)
+{
+}
+
+TAO_EnumDef_i::~TAO_EnumDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_EnumDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Enum;
+}
+
+CORBA::TypeCode_ptr
+TAO_EnumDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_EnumDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ id);
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ name);
+
+ CORBA::EnumMemberSeq_var members = this->members_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->repo_->tc_factory ()->create_enum_tc (id.c_str (),
+ name.c_str (),
+ members.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::EnumMemberSeq *
+TAO_EnumDef_i::members (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->members_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::EnumMemberSeq *
+TAO_EnumDef_i::members_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ u_int count = 0;
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "count",
+ count);
+
+ CORBA::EnumMemberSeq *retval = 0;
+ ACE_NEW_THROW_EX (retval,
+ CORBA::EnumMemberSeq (count),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ retval->length (count);
+
+ for (u_int i = 0; i < count; ++i)
+ {
+ ACE_Configuration_Section_Key member_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (this->section_key_,
+ stringified,
+ 0,
+ member_key);
+
+ ACE_TString member_name;
+ this->repo_->config ()->get_string_value (member_key,
+ "name",
+ member_name);
+
+ (*retval)[i] = member_name.c_str ();
+ }
+
+ return retval;
+}
+
+void
+TAO_EnumDef_i::members (const CORBA::EnumMemberSeq &members
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->members_i (members
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EnumDef_i::members_i (const CORBA::EnumMemberSeq &members
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->remove_section (this->section_key_,
+ "members",
+ 1);
+
+ CORBA::ULong count = members.length ();
+ this->repo_->config ()->set_integer_value (this->section_key_,
+ "count",
+ count);
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ ACE_Configuration_Section_Key member_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (this->section_key_,
+ stringified,
+ 1,
+ member_key);
+
+ ACE_TString member_name (members[i]);
+ this->repo_->config ()->set_string_value (member_key,
+ "name",
+ member_name);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/EnumDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/EnumDef_i.h
new file mode 100644
index 00000000000..0bd5b265451
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/EnumDef_i.h
@@ -0,0 +1,101 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// EnumDef_i.h
+//
+// = DESCRIPTION
+// EnumDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_ENUMDEF_I_H
+#define TAO_ENUMDEF_I_H
+
+#include "orbsvcs/IFRService/TypedefDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_EnumDef_i : public virtual TAO_TypedefDef_i
+{
+public:
+ // = TITLE
+ // TAO_EnumDef_i
+ //
+ // = DESCRIPTION
+ // Represents an OMG IDL enumeration definition.
+ //
+public:
+ TAO_EnumDef_i (TAO_Repository_i *repoy);
+ // Constructor
+
+ virtual ~TAO_EnumDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::EnumMemberSeq *members (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::EnumMemberSeq *members_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void members (
+ const CORBA::EnumMemberSeq &members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void members_i (
+ const CORBA::EnumMemberSeq &members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_ENUMDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/EventDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/EventDef_i.cpp
new file mode 100644
index 00000000000..cd62666f25d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/EventDef_i.cpp
@@ -0,0 +1,101 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/EventDef_i.h"
+
+ACE_RCSID (IFRService,
+ EventDef_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EventDef_i::TAO_EventDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Container_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo),
+ TAO_ValueDef_i (repo),
+ TAO_ExtValueDef_i (repo)
+{
+}
+
+TAO_EventDef_i::~TAO_EventDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_EventDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Event;
+}
+
+void
+TAO_EventDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_EventDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // An event type is a restriction of a value type, not an extension.
+ this->TAO_ExtValueDef_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_EventDef_i::describe (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_EventDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->TAO_ValueDef_i::describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_EventDef_i::is_a (const char *event_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->is_a_i (event_id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_EventDef_i::is_a_i (const char *event_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (ACE_OS::strcmp (event_id, "IDL:omg.org/CORBA/EventBase:1.0") == 0)
+ {
+ return 1;
+ }
+
+ return this->TAO_ValueDef_i::is_a_i (event_id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/EventDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/EventDef_i.h
new file mode 100644
index 00000000000..a1e280a2882
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/EventDef_i.h
@@ -0,0 +1,102 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// EventDef_i.h
+//
+// = DESCRIPTION
+// EventDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_EVENTDEF_I_H
+#define TAO_EVENTDEF_I_H
+
+#include "orbsvcs/IFRService/ExtValueDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_EventDef_i : public virtual TAO_ExtValueDef_i
+{
+ // = TITLE
+ // TAO_EventDef_i
+ //
+ // = DESCRIPTION
+ // Represents an event definition. It refers to a ValueDef
+ // object that contains information about the event.
+ //
+public:
+ TAO_EventDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_EventDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::Boolean is_a (
+ const char *event_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Boolean is_a_i (
+ const char *event_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_EVENTDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/EventPortDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/EventPortDef_i.cpp
new file mode 100644
index 00000000000..f3d1a44a8f4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/EventPortDef_i.cpp
@@ -0,0 +1,200 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/EventPortDef_i.h"
+#include "orbsvcs/IFRService/EventDef_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils_T.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ EventPortDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EventPortDef_i::TAO_EventPortDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo)
+{
+}
+
+TAO_EventPortDef_i::~TAO_EventPortDef_i (void)
+{
+}
+
+CORBA::ComponentIR::EventDef_ptr
+TAO_EventPortDef_i::event (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::ComponentIR::EventDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::EventDef::_nil ());
+
+ return this->event_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::EventDef_ptr
+TAO_EventPortDef_i::event_i (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_type",
+ holder);
+ CORBA::Contained_var obj = this->repo_->lookup_id (holder.fast_rep ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::EventDef::_nil ());
+
+ return CORBA::ComponentIR::EventDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EventPortDef_i::event (
+ CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->event_i (event
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_EventPortDef_i::event_i (
+ CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->remove_value (this->section_key_,
+ "base_type");
+
+ if (CORBA::is_nil (event))
+ {
+ return;
+ }
+
+ const char *tmp =
+ TAO_IFR_Service_Utils::reference_to_path (event);
+
+ ACE_Configuration_Section_Key new_key;
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ tmp,
+ new_key,
+ 0);
+
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (new_key,
+ "id",
+ holder);
+
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "base_type",
+ holder);
+}
+
+CORBA::Boolean
+TAO_EventPortDef_i::is_a (
+ const char *event_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->is_a_i (event_id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_EventPortDef_i::is_a_i (
+ const char *event_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_type",
+ holder);
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ holder.fast_rep (),
+ holder);
+ ACE_Configuration_Section_Key key;
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ holder,
+ key,
+ 0);
+ TAO_EventDef_i impl (this->repo_);
+ impl.section_key (key);
+ return impl.is_a_i (event_id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_EventPortDef_i::describe (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_EventPortDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ComponentIR::EventPortDescription epd;
+ TAO_IFR_Desc_Utils<CORBA::ComponentIR::EventPortDescription,
+ TAO_EventPortDef_i>::fill_desc_begin (
+ epd,
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (0);
+
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_type",
+ holder);
+ epd.event = holder.fast_rep ();
+
+ CORBA::Contained::Description *retval = 0;
+ ACE_NEW_RETURN (retval,
+ CORBA::Contained::Description,
+ 0);
+
+ retval->kind = this->def_kind ();
+ retval->value <<= epd;
+ return retval;
+}
+
+CORBA::DefinitionKind
+TAO_EventPortDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_none;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/EventPortDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/EventPortDef_i.h
new file mode 100644
index 00000000000..dc84527d41f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/EventPortDef_i.h
@@ -0,0 +1,123 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// EventPortDef_i.h
+//
+// = DESCRIPTION
+// EventPortDef_i servant class.
+//
+// = AUTHOR
+// Jeff Parsons <j.parsons@vanderbilt.edu>
+//
+// ============================================================================
+
+#ifndef TAO_EVENTPORTDEF_I_H
+#define TAO_EVENTPORTDEF_I_H
+
+#include "orbsvcs/IFRService/Contained_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/IFRService/IFR_ComponentsS.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_EventPortDef_i
+ : public virtual TAO_Contained_i
+{
+ // = TITLE
+ // TAO_EventPortDef_i
+ //
+ // = DESCRIPTION
+ // Represents an event port definition. EmitsDef_i, PublishesDef_i,
+ // and ConsumesDef_i inherit from this.
+ //
+public:
+ TAO_EventPortDef_i (TAO_Repository_i *repo);
+ /// Constructor
+
+ virtual ~TAO_EventPortDef_i (void);
+ /// Destructor
+
+ virtual CORBA::ComponentIR::EventDef_ptr event (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ComponentIR::EventDef_ptr event_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void event (
+ CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void event_i (
+ CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean is_a (
+ const char *event_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Boolean is_a_i (
+ const char *event_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// This can be the same for the three derived classes, so it is
+ /// implemented here.
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+private:
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Dummy method so we can consolidate derived class methods
+ // in this 'abstract' base class.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_EVENTPORTDEF_I_H */
+
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ExceptionDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ExceptionDef_i.cpp
new file mode 100644
index 00000000000..33b7c9eee99
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ExceptionDef_i.cpp
@@ -0,0 +1,351 @@
+// $Id$
+
+#include "orbsvcs/IFRService/ExceptionDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/SString.h"
+
+ACE_RCSID (IFRService,
+ ExceptionDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ExceptionDef_i::TAO_ExceptionDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo),
+ TAO_Container_i (repo)
+{
+}
+
+TAO_ExceptionDef_i::~TAO_ExceptionDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_ExceptionDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Exception;
+}
+
+void
+TAO_ExceptionDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_ExceptionDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Destroy our members.
+ TAO_Container_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Destroy ourself.
+ TAO_Contained_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CORBA::Contained::Description *
+TAO_ExceptionDef_i::describe (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_ExceptionDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Contained::Description *desc_ptr = 0;
+ ACE_NEW_THROW_EX (desc_ptr,
+ CORBA::Contained::Description,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Contained::Description_var retval = desc_ptr;
+
+ retval->kind = this->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ExceptionDescription ed;
+
+ ed.name = this->name_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ed.id = this->id_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ACE_TString container_id;
+
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ container_id);
+
+ ed.defined_in = container_id.c_str ();
+
+ ed.version = this->version_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ed.type = this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval->value <<= ed;
+
+ return retval._retn ();
+}
+
+CORBA::TypeCode_ptr
+TAO_ExceptionDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_ExceptionDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ id);
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ name);
+
+ CORBA::StructMemberSeq_var members =
+ this->members_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->repo_->tc_factory ()->create_exception_tc (
+ id.c_str (),
+ name.c_str (),
+ members.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+CORBA::StructMemberSeq *
+TAO_ExceptionDef_i::members (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->members_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::StructMemberSeq *
+TAO_ExceptionDef_i::members_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> kind_queue;
+ ACE_Unbounded_Queue<ACE_TString> path_queue;
+ ACE_Unbounded_Queue<ACE_TString> name_queue;
+
+ ACE_Configuration_Section_Key refs_key;
+ this->repo_->config ()->open_section (this->section_key_,
+ "refs",
+ 0,
+ refs_key);
+
+ u_int count = 0;
+ this->repo_->config ()->get_integer_value (refs_key,
+ "count",
+ count);
+
+ for (u_int i = 0; i < count; ++i)
+ {
+ ACE_Configuration_Section_Key member_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (refs_key,
+ stringified,
+ 0,
+ member_key);
+
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (member_key,
+ "path",
+ path);
+
+ ACE_Configuration_Section_Key entry_key;
+ int status =
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ path,
+ entry_key,
+ 0);
+
+ // This entry may have been removed.
+ if (status == 0)
+ {
+ path_queue.enqueue_tail (path);
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (member_key,
+ "name",
+ name);
+
+ name_queue.enqueue_tail (name);
+
+ u_int kind = 0;
+ this->repo_->config ()->get_integer_value (entry_key,
+ "def_kind",
+ kind);
+
+ CORBA::DefinitionKind def_kind =
+ static_cast<CORBA::DefinitionKind> (kind);
+
+ kind_queue.enqueue_tail (def_kind);
+ }
+ }
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (kind_queue.size ());
+
+ CORBA::StructMemberSeq *members = 0;
+ ACE_NEW_THROW_EX (members,
+ CORBA::StructMemberSeq (size),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ members->length (size);
+
+ CORBA::StructMemberSeq_var retval = members;
+
+ ACE_TString name;
+ ACE_TString path;
+ CORBA::DefinitionKind kind = CORBA::dk_none;
+ CORBA::Object_var obj;
+ ACE_Configuration_Section_Key member_key;
+ TAO_IDLType_i *impl = 0;
+
+ for (CORBA::ULong k = 0; k < size; ++k)
+ {
+ name_queue.dequeue_head (name);
+ retval[k].name = name.c_str ();
+
+ kind_queue.dequeue_head (kind);
+ path_queue.dequeue_head (path);
+
+ obj =
+ TAO_IFR_Service_Utils::create_objref (kind,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[k].type_def = CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ path,
+ member_key,
+ 0);
+
+ impl = TAO_IFR_Service_Utils::path_to_idltype (path,
+ this->repo_);
+
+ retval[k].type = impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return retval._retn ();
+}
+
+void
+TAO_ExceptionDef_i::members (const CORBA::StructMemberSeq &members
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->members_i (members
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ExceptionDef_i::members_i (const CORBA::StructMemberSeq &members
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Destroy our old members, both refs and defns.
+ TAO_Container_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong count = members.length ();
+
+ // Exceptions can be empty.
+ if (count > 0)
+ {
+ ACE_TString section_name;
+ ACE_Configuration_Section_Key refs_key;
+
+ this->repo_->config ()->open_section (this->section_key_,
+ "refs",
+ 1,
+ refs_key);
+ char *path = 0;
+
+ // Create a section for each new member. We just store the
+ // member name and the path to its database entry.
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ ACE_Configuration_Section_Key member_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (refs_key,
+ stringified,
+ 1,
+ member_key);
+
+ ACE_TString name (members[i].name);
+ this->repo_->config ()->set_string_value (member_key,
+ "name",
+ name);
+
+ path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ members[i].type_def.in ()
+ );
+
+ this->repo_->config ()->set_string_value (member_key,
+ "path",
+ path);
+ }
+
+ this->repo_->config ()->set_integer_value (refs_key,
+ "count",
+ count);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ExceptionDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ExceptionDef_i.h
new file mode 100644
index 00000000000..88dd3e8bbd5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ExceptionDef_i.h
@@ -0,0 +1,124 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ExceptionDef_i.h
+//
+// = DESCRIPTION
+// ExceptionDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_EXCEPTIONDEF_I_H
+#define TAO_EXCEPTIONDEF_I_H
+
+#include "orbsvcs/IFRService/Contained_i.h"
+#include "orbsvcs/IFRService/Container_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ExceptionDef_i : public virtual TAO_Contained_i,
+ public virtual TAO_Container_i
+{
+ // = TITLE
+ // TAO_ExceptionDef_i
+ //
+ // = DESCRIPTION
+ // Represents an exception definition.
+ //
+public:
+ TAO_ExceptionDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_ExceptionDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry.
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::StructMemberSeq *members (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::StructMemberSeq *members_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void members (
+ const CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void members_i (
+ const CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_EXCEPTIONDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ExtAbstractInterfaceDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ExtAbstractInterfaceDef_i.cpp
new file mode 100644
index 00000000000..82ffce83d05
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ExtAbstractInterfaceDef_i.cpp
@@ -0,0 +1,43 @@
+// $Id$
+
+#include "orbsvcs/IFRService/ExtAbstractInterfaceDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+
+ACE_RCSID (IFRService,
+ ExtAbstractInterfaceDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ExtAbstractInterfaceDef_i::TAO_ExtAbstractInterfaceDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Container_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo),
+ TAO_InterfaceDef_i (repo),
+ TAO_AbstractInterfaceDef_i (repo),
+ TAO_InterfaceAttrExtension_i (repo)
+{
+}
+
+TAO_ExtAbstractInterfaceDef_i::~TAO_ExtAbstractInterfaceDef_i (void)
+{
+}
+
+// Just call the base class version, this is here only to
+// disambiguate multiple inheritance.
+void
+TAO_ExtAbstractInterfaceDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_AbstractInterfaceDef_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ExtAbstractInterfaceDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ExtAbstractInterfaceDef_i.h
new file mode 100644
index 00000000000..e79471d8e11
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ExtAbstractInterfaceDef_i.h
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ExtAbstractInterfaceDef_i.h
+//
+// = DESCRIPTION
+// ExtAbstractInterfaceDef_i servant class.
+//
+// = AUTHOR
+// Jeff Parsons <j.parsons@vanderbilt.edu>
+//
+// ============================================================================
+
+#ifndef TAO_EXTABSTRACTINTERFACEDEF_I_H
+#define TAO_EXTABSTRACTINTERFACEDEF_I_H
+
+#include "orbsvcs/IFRService/AbstractInterfaceDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/IFRService/InterfaceAttrExtension_i.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ExtAbstractInterfaceDef_i
+ : public virtual TAO_AbstractInterfaceDef_i,
+ public virtual TAO_InterfaceAttrExtension_i
+{
+ // = TITLE
+ // TAO_ExtAbstractInterfaceDef_i
+ //
+ // = DESCRIPTION
+ // Mixes in IDL3 attribute exceptions.
+ //
+public:
+ TAO_ExtAbstractInterfaceDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_ExtAbstractInterfaceDef_i (void);
+ // Destructor
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_EXTABSTRACTINTERFACEDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ExtAttributeDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ExtAttributeDef_i.cpp
new file mode 100644
index 00000000000..62405fe8393
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ExtAttributeDef_i.cpp
@@ -0,0 +1,315 @@
+// $Id$
+
+#include "orbsvcs/IFRService/ExtAttributeDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/ExceptionDef_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ ExtAttributeDef_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ExtAttributeDef_i::TAO_ExtAttributeDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo),
+ TAO_AttributeDef_i (repo)
+{
+}
+
+TAO_ExtAttributeDef_i::~TAO_ExtAttributeDef_i (void)
+{
+}
+
+CORBA::ExcDescriptionSeq *
+TAO_ExtAttributeDef_i::get_exceptions (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->get_exceptions_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ExcDescriptionSeq *
+TAO_ExtAttributeDef_i::get_exceptions_i (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ExcDescriptionSeq *retval = 0;
+ ACE_NEW_RETURN (retval,
+ CORBA::ExcDescriptionSeq,
+ 0);
+ CORBA::ExcDescriptionSeq_var safe_retval = retval;
+
+ this->fill_exceptions (*retval,
+ "get_excepts"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return safe_retval._retn ();
+}
+
+void
+TAO_ExtAttributeDef_i::get_exceptions (
+ const CORBA::ExcDescriptionSeq &get_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->get_exceptions_i (get_exceptions
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ExtAttributeDef_i::get_exceptions_i (
+ const CORBA::ExcDescriptionSeq &get_exceptions
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->exceptions ("get_excepts",
+ get_exceptions);
+}
+
+CORBA::ExcDescriptionSeq *
+TAO_ExtAttributeDef_i::set_exceptions (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->set_exceptions_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ExcDescriptionSeq *
+TAO_ExtAttributeDef_i::set_exceptions_i (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ExcDescriptionSeq *retval = 0;
+ ACE_NEW_RETURN (retval,
+ CORBA::ExcDescriptionSeq,
+ 0);
+ CORBA::ExcDescriptionSeq_var safe_retval = retval;
+
+ this->fill_exceptions (*retval,
+ "put_excepts"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return safe_retval._retn ();
+}
+
+void
+TAO_ExtAttributeDef_i::set_exceptions (
+ const CORBA::ExcDescriptionSeq &set_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->set_exceptions_i (set_exceptions
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ExtAttributeDef_i::set_exceptions_i (
+ const CORBA::ExcDescriptionSeq &set_exceptions
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->exceptions ("put_excepts",
+ set_exceptions);
+}
+
+CORBA::ExtAttributeDescription *
+TAO_ExtAttributeDef_i::describe_attribute (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_attribute_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ExtAttributeDescription *
+TAO_ExtAttributeDef_i::describe_attribute_i (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ExtAttributeDescription *retval = 0;
+ ACE_NEW_RETURN (retval,
+ CORBA::ExtAttributeDescription,
+ 0);
+ CORBA::ExtAttributeDescription_var safe_retval = retval;
+
+ this->fill_description (*retval
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return safe_retval._retn ();
+}
+
+void
+TAO_ExtAttributeDef_i::fill_description (
+ CORBA::ExtAttributeDescription &desc
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ desc.name = this->name_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ desc.id = this->id_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ holder);
+ desc.defined_in = holder.fast_rep ();
+
+ desc.id = this->id_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ desc.type = this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ desc.mode = this->mode_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->fill_exceptions (desc.get_exceptions,
+ "get_excepts"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->fill_exceptions (desc.put_exceptions,
+ "put_excepts"
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ExtAttributeDef_i::fill_exceptions (CORBA::ExcDescriptionSeq &exceptions,
+ const char *sub_section
+ ACE_ENV_ARG_DECL)
+{
+ ACE_Configuration_Section_Key excepts_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ sub_section,
+ 0,
+ excepts_key);
+
+ if (status != 0)
+ {
+ exceptions.length (0);
+ return;
+ }
+
+ CORBA::ULong count = 0;
+ this->repo_->config ()->get_integer_value (excepts_key,
+ "count",
+ count);
+ exceptions.length (count);
+ char *stringified = 0;
+ ACE_TString holder;
+ ACE_Configuration_Section_Key except_key;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->get_string_value (excepts_key,
+ stringified,
+ holder);
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ holder,
+ except_key,
+ 0);
+ this->repo_->config ()->get_string_value (except_key,
+ "name",
+ holder);
+ exceptions[i].name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (except_key,
+ "id",
+ holder);
+ exceptions[i].id = holder.fast_rep ();
+
+ TAO_ExceptionDef_i impl (this->repo_);
+ impl.section_key (except_key);
+ exceptions[i].type = impl.type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->repo_->config ()->get_string_value (except_key,
+ "container_id",
+ holder);
+ exceptions[i].defined_in = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (except_key,
+ "version",
+ holder);
+ exceptions[i].version = holder.fast_rep ();
+ }
+}
+
+void
+TAO_ExtAttributeDef_i::exceptions (const char *sub_section,
+ const CORBA::ExcDescriptionSeq &exceptions)
+{
+ this->repo_->config ()->remove_section (this->section_key_,
+ sub_section,
+ 0);
+ ACE_Configuration_Section_Key new_key;
+ this->repo_->config ()->open_section (this->section_key_,
+ sub_section,
+ 1,
+ new_key);
+ CORBA::ULong count = exceptions.length ();
+ this->repo_->config ()->set_integer_value (new_key,
+ "count",
+ count);
+ char *stringified = 0;
+ ACE_TString path;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ exceptions[i].id.in (),
+ path);
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (new_key,
+ stringified,
+ path);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ExtAttributeDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ExtAttributeDef_i.h
new file mode 100644
index 00000000000..f4d9e54b665
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ExtAttributeDef_i.h
@@ -0,0 +1,133 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ExtAttributeDef_i.h
+//
+// = DESCRIPTION
+// ExtAttributeDef_i servant class.
+//
+// = AUTHOR
+// Jeff Parsons <j.parsons@vanderbilt.edu>
+//
+// ============================================================================
+
+#ifndef TAO_EXTATTRIBUTEDEF_I_H
+#define TAO_EXTATTRIBUTEDEF_I_H
+
+#include "orbsvcs/IFRService/AttributeDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ExtAttributeDef_i
+ : public virtual TAO_AttributeDef_i
+{
+ // = TITLE
+ // TAO_ExtAttributeDef_i
+ //
+ // = DESCRIPTION
+ // Adds IDL3 extensions to AttributeDef.
+ //
+public:
+ TAO_ExtAttributeDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_ExtAttributeDef_i (void);
+ // Destructor
+
+ virtual CORBA::ExcDescriptionSeq *get_exceptions (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ExcDescriptionSeq *get_exceptions_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void get_exceptions (
+ const CORBA::ExcDescriptionSeq &get_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void get_exceptions_i (
+ const CORBA::ExcDescriptionSeq &get_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ExcDescriptionSeq *set_exceptions (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ExcDescriptionSeq *set_exceptions_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void set_exceptions (
+ const CORBA::ExcDescriptionSeq &set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void set_exceptions_i (
+ const CORBA::ExcDescriptionSeq &set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ExtAttributeDescription *describe_attribute (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ExtAttributeDescription *describe_attribute_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // Utility function that fills sequence elements for a
+ // ComponentDescription.
+ void fill_description (
+ CORBA::ExtAttributeDescription &desc
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// Common code for the set and get varieties.
+
+ void fill_exceptions (CORBA::ExcDescriptionSeq &exceptions,
+ const char *sub_section
+ ACE_ENV_ARG_DECL);
+
+ void exceptions (const char *sub_section,
+ const CORBA::ExcDescriptionSeq &exceptions);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_EXTATTRIBUTEDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ExtInterfaceDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ExtInterfaceDef_i.cpp
new file mode 100644
index 00000000000..30f003136b2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ExtInterfaceDef_i.cpp
@@ -0,0 +1,29 @@
+// $Id$
+
+#include "orbsvcs/IFRService/ExtInterfaceDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+
+ACE_RCSID (IFRService,
+ ExtInterfaceDef_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ExtInterfaceDef_i::TAO_ExtInterfaceDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Container_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo),
+ TAO_InterfaceDef_i (repo),
+ TAO_InterfaceAttrExtension_i (repo)
+{
+}
+
+TAO_ExtInterfaceDef_i::~TAO_ExtInterfaceDef_i (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ExtInterfaceDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ExtInterfaceDef_i.h
new file mode 100644
index 00000000000..11fecc1e6a5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ExtInterfaceDef_i.h
@@ -0,0 +1,65 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ExtInterfaceDef_i.h
+//
+// = DESCRIPTION
+// ExtInterfaceDef_i servant class.
+//
+// = AUTHOR
+// Jeff Parsons <j.parsons@vanderbilt.edu>
+//
+// ============================================================================
+
+#ifndef TAO_EXTINTERFACEDEF_I_H
+#define TAO_EXTINTERFACEDEF_I_H
+
+#include "orbsvcs/IFRService/InterfaceDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/IFRService/InterfaceAttrExtension_i.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ExtInterfaceDef_i
+ : public virtual TAO_InterfaceDef_i,
+ public virtual TAO_InterfaceAttrExtension_i
+{
+ // = TITLE
+ // TAO_ExtInterfaceDef_i
+ //
+ // = DESCRIPTION
+ // Mixes in TAO_InterfaceAttrExtension_i to get attribute exceptions.
+ //
+public:
+ TAO_ExtInterfaceDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_ExtInterfaceDef_i (void);
+ // Destructor
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_EXTINTERFACEDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ExtLocalInterfaceDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ExtLocalInterfaceDef_i.cpp
new file mode 100644
index 00000000000..3b802bcb762
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ExtLocalInterfaceDef_i.cpp
@@ -0,0 +1,43 @@
+// $Id$
+
+#include "orbsvcs/IFRService/ExtLocalInterfaceDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+
+ACE_RCSID (IFRService,
+ ExtLocalInterfaceDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ExtLocalInterfaceDef_i::TAO_ExtLocalInterfaceDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Container_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo),
+ TAO_InterfaceDef_i (repo),
+ TAO_LocalInterfaceDef_i (repo),
+ TAO_InterfaceAttrExtension_i (repo)
+{
+}
+
+TAO_ExtLocalInterfaceDef_i::~TAO_ExtLocalInterfaceDef_i (void)
+{
+}
+
+// Just call the base class version, this is here only to
+// disambiguate multiple inheritance.
+void
+TAO_ExtLocalInterfaceDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_LocalInterfaceDef_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ExtLocalInterfaceDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ExtLocalInterfaceDef_i.h
new file mode 100644
index 00000000000..1e5eec3bcf2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ExtLocalInterfaceDef_i.h
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ExtLocalInterfaceDef_i.h
+//
+// = DESCRIPTION
+// ExtLocalInterfaceDef_i servant class.
+//
+// = AUTHOR
+// Jeff Parsons <j.parsons@vanderbilt.edu>
+//
+// ============================================================================
+
+#ifndef TAO_EXTLOCALINTERFACEDEF_I_H
+#define TAO_EXTLOCALINTERFACEDEF_I_H
+
+#include "orbsvcs/IFRService/LocalInterfaceDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/IFRService/InterfaceAttrExtension_i.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ExtLocalInterfaceDef_i
+ : public virtual TAO_LocalInterfaceDef_i,
+ public virtual TAO_InterfaceAttrExtension_i
+{
+ // = TITLE
+ // TAO_ExtLocaltInterfaceDef_i
+ //
+ // = DESCRIPTION
+ // Mixes in IDL3 attribute exceptions.
+ //
+public:
+ TAO_ExtLocalInterfaceDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_ExtLocalInterfaceDef_i (void);
+ // Destructor
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_EXTLOCALINTERFACEDEF_I_H */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp
new file mode 100644
index 00000000000..410fd91c7d9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp
@@ -0,0 +1,975 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/ExtValueDef_i.h"
+#include "orbsvcs/IFRService/ExceptionDef_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils_T.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ ExtValueDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ExtValueDef_i::TAO_ExtValueDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Container_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo),
+ TAO_ValueDef_i (repo)
+{
+}
+
+TAO_ExtValueDef_i::~TAO_ExtValueDef_i (void)
+{
+}
+
+CORBA::ExtInitializerSeq *
+TAO_ExtValueDef_i::ext_initializers (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->ext_initializers_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ExtInitializerSeq *
+TAO_ExtValueDef_i::ext_initializers_i (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ExtInitializerSeq *iseq = 0;
+ ACE_NEW_RETURN (iseq,
+ CORBA::ExtInitializerSeq,
+ 0);
+ CORBA::ExtInitializerSeq_var retval = iseq;
+
+ ACE_Configuration_Section_Key initializers_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "initializers",
+ 0,
+ initializers_key);
+
+ if (status != 0)
+ {
+ iseq->length (0);
+ return retval._retn ();
+ }
+
+ CORBA::ULong count = 0;
+ this->repo_->config ()->get_integer_value (initializers_key,
+ "count",
+ count);
+ iseq->length (count);
+ char *stringified = 0;
+ ACE_Configuration_Section_Key initializer_key, params_key, arg_key;
+ ACE_TString holder;
+ CORBA::ULong arg_count = 0;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (initializers_key,
+ stringified,
+ 0,
+ initializer_key);
+ this->repo_->config ()->get_string_value (initializer_key,
+ "name",
+ holder);
+ retval[i].name = holder.fast_rep ();
+ status =
+ this->repo_->config ()->open_section (initializer_key,
+ "params",
+ 0,
+ params_key);
+
+ if (status != 0)
+ {
+ retval[i].members.length (0);
+ continue;
+ }
+
+ this->repo_->config ()->get_integer_value (params_key,
+ "count",
+ arg_count);
+ retval[i].members.length (arg_count);
+ CORBA::Object_var obj;
+
+ for (CORBA::ULong j = 0; j < arg_count; ++j)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (j);
+ this->repo_->config ()->open_section (params_key,
+ stringified,
+ 0,
+ arg_key);
+ this->repo_->config ()->get_string_value (arg_key,
+ "arg_name",
+ holder);
+ retval[i].members[j].name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (arg_key,
+ "arg_path",
+ holder);
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (holder,
+ this->repo_);
+ retval[i].members[j].type =
+ impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[i].members[j].type_def =
+ CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ this->fill_exceptions (retval[i].exceptions,
+ initializer_key,
+ "excepts"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return retval._retn ();
+}
+
+void
+TAO_ExtValueDef_i::ext_initializers (
+ const CORBA::ExtInitializerSeq &ext_initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->ext_initializers_i (ext_initializers
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ExtValueDef_i::ext_initializers_i (
+ const CORBA::ExtInitializerSeq &ext_initializers
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Configuration *config = this->repo_->config ();
+ config->remove_section (this->section_key_,
+ "initializers",
+ 1);
+
+ /// This does not handle the initializer exceptions, so we do that below.
+ TAO_IFR_Generic_Utils<CORBA::ExtInitializerSeq>::set_initializers (
+ ext_initializers,
+ this->repo_->config (),
+ this->section_key_
+ );
+
+ CORBA::ULong length = ext_initializers.length ();
+
+ if (length > 0)
+ {
+ ACE_Configuration_Section_Key initializers_key, initializer_key;
+ char *stringified = 0;
+
+ this->repo_->config ()->open_section (this->section_key_,
+ "initializers",
+ 0,
+ initializers_key);
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (initializers_key,
+ stringified,
+ 0,
+ initializer_key);
+
+ this->exceptions (initializer_key,
+ "excepts",
+ ext_initializers[i].exceptions);
+ }
+ }
+}
+
+CORBA::ExtValueDef::ExtFullValueDescription *
+TAO_ExtValueDef_i::describe_ext_value (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_ext_value_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ExtValueDef::ExtFullValueDescription *
+TAO_ExtValueDef_i::describe_ext_value_i (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ExtValueDef::ExtFullValueDescription *fv_desc = 0;
+ ACE_NEW_RETURN (fv_desc,
+ CORBA::ExtValueDef::ExtFullValueDescription,
+ 0);
+ CORBA::ExtValueDef::ExtFullValueDescription_var retval = fv_desc;
+
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ holder);
+ fv_desc->name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ holder);
+ fv_desc->id = holder.fast_rep ();
+
+ CORBA::ULong val = 0;
+
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "is_abstract",
+ val);
+ fv_desc->is_abstract = static_cast<CORBA::Boolean> (val);
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "is_custom",
+ val);
+ fv_desc->is_custom = static_cast<CORBA::Boolean> (val);
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ holder);
+ fv_desc->defined_in = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "version",
+ holder);
+ fv_desc->version = holder.fast_rep ();
+
+ // Operations.
+
+ fv_desc->operations.length (0);
+
+ ACE_Configuration_Section_Key ops_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "ops",
+ 0,
+ ops_key);
+ CORBA::ULong count = 0;
+ CORBA::ULong param_count = 0;
+ char *stringified = 0;
+ CORBA::ULong i = 0;
+ CORBA::ULong j = 0;
+ TAO_IDLType_i *idl_type = 0;
+ CORBA::Object_var obj;
+ ACE_Configuration_Section_Key params_key, excepts_key, except_def_key;
+
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (ops_key,
+ "count",
+ count);
+ fv_desc->operations.length (count);
+ ACE_Configuration_Section_Key op_key, result_key, contexts_key;
+
+ for (i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (ops_key,
+ stringified,
+ 0,
+ op_key);
+ this->repo_->config ()->get_string_value (op_key,
+ "name",
+ holder);
+ fv_desc->operations[i].name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (op_key,
+ "id",
+ holder);
+ fv_desc->operations[i].id = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ holder);
+ fv_desc->operations[i].defined_in = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (op_key,
+ "result",
+ holder);
+ idl_type =
+ TAO_IFR_Service_Utils::path_to_idltype (holder,
+ this->repo_);
+ fv_desc->operations[i].result =
+ idl_type->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->repo_->config ()->get_integer_value (op_key,
+ "mode",
+ val);
+ fv_desc->operations[i].mode = static_cast<CORBA::OperationMode> (val);
+ CORBA::TCKind kind =
+ fv_desc->operations[i].result->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (fv_desc->operations[i].mode == CORBA::OP_ONEWAY
+ && kind != CORBA::tk_void)
+ {
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 31,
+ CORBA::COMPLETED_NO),
+ 0);
+ }
+
+ // Operation contexts.
+
+ TAO_IFR_Strseq_Utils<CORBA::ContextIdSeq>::fill_string_seq (
+ "contexts",
+ this->repo_->config (),
+ op_key,
+ fv_desc->operations[i].contexts
+ );
+
+ // Operation parameters.
+
+ fv_desc->operations[i].parameters.length (0);
+ status =
+ this->repo_->config ()->open_section (op_key,
+ "params",
+ 0,
+ params_key);
+ if (status == 0)
+ {
+ ACE_Configuration_Section_Key param_key;
+ this->repo_->config ()->get_integer_value (params_key,
+ "count",
+ param_count);
+ fv_desc->operations[i].parameters.length (param_count);
+
+ for (j = 0; j < param_count; ++j)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (j);
+ this->repo_->config ()->open_section (params_key,
+ stringified,
+ 0,
+ param_key);
+ this->repo_->config ()->get_string_value (param_key,
+ "name",
+ holder);
+ fv_desc->operations[i].parameters[j].name =
+ holder.fast_rep ();
+ this->repo_->config ()->get_string_value (param_key,
+ "type_path",
+ holder);
+ idl_type =
+ TAO_IFR_Service_Utils::path_to_idltype (holder,
+ this->repo_);
+ fv_desc->operations[i].parameters[j].type =
+ idl_type->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (
+ holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (0);
+
+ fv_desc->operations[i].parameters[j].type_def =
+ CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->repo_->config ()->get_integer_value (param_key,
+ "mode",
+ val);
+ fv_desc->operations[i].parameters[j].mode =
+ static_cast<CORBA::ParameterMode> (val);
+ }
+ }
+
+ // Operation exceptions.
+
+ status =
+ this->repo_->config ()->open_section (op_key,
+ "excepts",
+ 0,
+ excepts_key);
+ fv_desc->operations[i].exceptions.length (0);
+
+ if (status == 0)
+ {
+ CORBA::ULong excep_count = 0;
+ this->repo_->config ()->get_integer_value (excepts_key,
+ "count",
+ excep_count);
+ fv_desc->operations[i].exceptions.length (excep_count);
+ ACE_Configuration_Section_Key except_def_key;
+
+ for (j = 0; j < excep_count; ++j)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (j);
+ this->repo_->config ()->get_string_value (excepts_key,
+ stringified,
+ holder);
+
+ this->repo_->config ()->expand_path (
+ this->repo_->root_key (),
+ holder,
+ except_def_key,
+ 0
+ );
+ this->repo_->config ()->get_string_value (except_def_key,
+ "name",
+ holder);
+ fv_desc->operations[i].exceptions[j].name =
+ holder.fast_rep ();
+ this->repo_->config ()->get_string_value (except_def_key,
+ "id",
+ holder);
+ fv_desc->operations[i].exceptions[j].id =
+ holder.fast_rep ();
+ this->repo_->config ()->get_string_value (except_def_key,
+ "container_id",
+ holder);
+ fv_desc->operations[i].exceptions[j].defined_in =
+ holder.fast_rep ();
+ this->repo_->config ()->get_string_value (except_def_key,
+ "version",
+ holder);
+ fv_desc->operations[i].exceptions[j].version =
+ holder.fast_rep ();
+
+ TAO_ExceptionDef_i impl (this->repo_);
+ impl.section_key (except_def_key);
+ fv_desc->operations[i].exceptions[j].type =
+ impl.type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ }
+ }
+ }
+
+ // Attributes..
+
+ fv_desc->attributes.length (0);
+
+ ACE_Configuration_Section_Key attrs_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "attrs",
+ 0,
+ attrs_key);
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (attrs_key,
+ "count",
+ count);
+ fv_desc->attributes.length (count);
+ ACE_Configuration_Section_Key attr_key, attr_def_key;
+
+ for (i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (attrs_key,
+ stringified,
+ 0,
+ attr_key);
+ this->repo_->config ()->get_string_value (attr_key,
+ "name",
+ holder);
+ fv_desc->attributes[i].name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (attr_key,
+ "id",
+ holder);
+ fv_desc->attributes[i].id = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (attr_key,
+ "version",
+ holder);
+ fv_desc->attributes[i].version = holder.fast_rep ();
+ this->repo_->config ()->get_integer_value (attr_key,
+ "mode",
+ val);
+ fv_desc->attributes[i].mode =
+ static_cast<CORBA::AttributeMode> (val);
+ this->repo_->config ()->get_string_value (attr_key,
+ "type_path",
+ holder);
+
+ // Use the type path for 'defined_in' and 'type'.
+
+ idl_type =
+ TAO_IFR_Service_Utils::path_to_idltype (holder,
+ this->repo_);
+ fv_desc->attributes[i].type =
+ idl_type->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ holder,
+ attr_def_key,
+ 0);
+ this->repo_->config ()->get_string_value (attr_def_key,
+ "container_id",
+ holder);
+ fv_desc->attributes[i].defined_in = holder.fast_rep ();
+
+
+ this->fill_exceptions (fv_desc->attributes[i].get_exceptions,
+ attr_key,
+ "get_excepts"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+
+ this->fill_exceptions (fv_desc->attributes[i].put_exceptions,
+ attr_key,
+ "put_excepts"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ }
+
+ // Members..
+
+ fv_desc->members.length (0);
+
+ ACE_Configuration_Section_Key members_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "members",
+ 0,
+ members_key);
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (members_key,
+ "count",
+ count);
+ fv_desc->members.length (count);
+ ACE_Configuration_Section_Key member_key, member_def_key;
+
+ for (i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (members_key,
+ stringified,
+ 0,
+ member_key);
+ this->repo_->config ()->get_string_value (member_key,
+ "name",
+ holder);
+ fv_desc->members[i].name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (member_key,
+ "id",
+ holder);
+ fv_desc->members[i].id = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (member_key,
+ "container_id",
+ holder);
+ fv_desc->members[i].defined_in = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (member_key,
+ "version",
+ holder);
+ fv_desc->members[i].version = holder.fast_rep ();
+
+ this->repo_->config ()->get_integer_value (member_key,
+ "access",
+ val);
+ fv_desc->members[i].access =
+ static_cast<CORBA::Visibility> (val);
+
+ // Use type path for 'type' and 'type_def',
+
+ this->repo_->config ()->get_string_value (member_key,
+ "type_path",
+ holder);
+ idl_type =
+ TAO_IFR_Service_Utils::path_to_idltype (holder,
+ this->repo_);
+ fv_desc->members[i].type =
+ idl_type->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ fv_desc->members[i].type_def =
+ CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ }
+
+ // Initializers
+
+ fv_desc->initializers.length (0);
+
+ ACE_Configuration_Section_Key initializers_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "initializers",
+ 0,
+ initializers_key);
+
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (initializers_key,
+ "count",
+ count);
+ fv_desc->initializers.length (count);
+ ACE_Configuration_Section_Key initializer_key,
+ params_key,
+ arg_key,
+ excepts_key;
+
+ for (i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (initializers_key,
+ stringified,
+ 0,
+ initializer_key);
+ this->repo_->config ()->get_string_value (initializer_key,
+ "name",
+ holder);
+ fv_desc->initializers[i].name = holder.fast_rep ();
+
+ fv_desc->initializers[i].members.length (0);
+
+ status =
+ this->repo_->config ()->open_section (initializer_key,
+ "params",
+ 0,
+ params_key);
+
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (params_key,
+ "count",
+ param_count);
+ fv_desc->initializers[i].members.length (param_count);
+
+ for (j = 0; j < param_count; ++j)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (j);
+ this->repo_->config ()->open_section (params_key,
+ stringified,
+ 0,
+ arg_key);
+ this->repo_->config ()->get_string_value (arg_key,
+ "arg_name",
+ holder);
+ fv_desc->initializers[i].members[j].name =
+ holder.fast_rep ();
+ this->repo_->config ()->get_string_value (arg_key,
+ "arg_path",
+ holder);
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (holder,
+ this->repo_);
+ fv_desc->initializers[i].members[j].type =
+ impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (
+ holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (0);
+
+ fv_desc->initializers[i].members[j].type_def =
+ CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ }
+
+ this->fill_exceptions (fv_desc->initializers[i].exceptions,
+ initializer_key,
+ "excepts"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ }
+
+ TAO_IFR_Strseq_Utils<CORBA::RepositoryIdSeq>::fill_string_seq (
+ "supported",
+ this->repo_->config (),
+ this->section_key_,
+ fv_desc->supported_interfaces
+ );
+
+ TAO_IFR_Strseq_Utils<CORBA::RepositoryIdSeq>::fill_string_seq (
+ "abstract_bases",
+ this->repo_->config (),
+ this->section_key_,
+ fv_desc->abstract_base_values
+ );
+
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "is_truncatable",
+ val);
+ fv_desc->is_truncatable = static_cast<CORBA::Boolean> (val);
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_value",
+ holder);
+ fv_desc->base_value = holder.fast_rep ();
+ fv_desc->type = this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return retval._retn ();
+}
+
+CORBA::ExtAttributeDef_ptr
+TAO_ExtValueDef_i::create_ext_attribute (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode,
+ const CORBA::ExceptionDefSeq &get_exceptions,
+ const CORBA::ExceptionDefSeq &set_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ExtAttributeDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ExtAttributeDef::_nil ());
+
+ return this->create_ext_attribute_i (id,
+ name,
+ version,
+ type,
+ mode,
+ get_exceptions,
+ set_exceptions
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ExtAttributeDef_ptr
+TAO_ExtValueDef_i::create_ext_attribute_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode,
+ const CORBA::ExceptionDefSeq &get_exceptions,
+ const CORBA::ExceptionDefSeq &set_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+
+ // Common to all IR objects created in CORBA::Container.
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (CORBA::dk_Value,
+ CORBA::dk_Attribute,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "attrs"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ExtAttributeDef::_nil ());
+
+ // Store the path to the attribute's type definition.
+ char *type_path = TAO_IFR_Service_Utils::reference_to_path (type);
+
+ this->repo_->config ()->set_string_value (new_key,
+ "type_path",
+ type_path);
+
+ // Store the attribute's mode.
+ this->repo_->config ()->set_integer_value (new_key,
+ "mode",
+ mode);
+
+ this->exceptions (new_key,
+ "get_excepts",
+ get_exceptions);
+
+ this->exceptions (new_key,
+ "put_excepts",
+ set_exceptions);
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Attribute,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ExtAttributeDef::_nil ());
+
+ CORBA::ExtAttributeDef_var retval =
+ CORBA::ExtAttributeDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ExtAttributeDef::_nil ());
+
+ return retval._retn ();
+}
+
+void
+TAO_ExtValueDef_i::fill_exceptions (CORBA::ExcDescriptionSeq &exceptions,
+ ACE_Configuration_Section_Key &key,
+ const char *sub_section
+ ACE_ENV_ARG_DECL)
+{
+ ACE_Configuration_Section_Key excepts_key;
+ int status =
+ this->repo_->config ()->open_section (key,
+ sub_section,
+ 0,
+ excepts_key);
+
+ if (status != 0)
+ {
+ exceptions.length (0);
+ return;
+ }
+
+ CORBA::ULong count = 0;
+ this->repo_->config ()->get_integer_value (excepts_key,
+ "count",
+ count);
+ exceptions.length (count);
+ char *stringified = 0;
+ ACE_TString holder;
+ ACE_Configuration_Section_Key except_key;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->get_string_value (excepts_key,
+ stringified,
+ holder);
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ holder,
+ except_key,
+ 0);
+ this->repo_->config ()->get_string_value (except_key,
+ "name",
+ holder);
+ exceptions[i].name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (except_key,
+ "id",
+ holder);
+ exceptions[i].id = holder.fast_rep ();
+
+ TAO_ExceptionDef_i impl (this->repo_);
+ impl.section_key (except_key);
+ exceptions[i].type = impl.type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->repo_->config ()->get_string_value (except_key,
+ "container_id",
+ holder);
+ exceptions[i].defined_in = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (except_key,
+ "version",
+ holder);
+ exceptions[i].version = holder.fast_rep ();
+ }
+}
+
+void
+TAO_ExtValueDef_i::exceptions (ACE_Configuration_Section_Key &key,
+ const char *sub_section,
+ const CORBA::ExcDescriptionSeq &exceptions)
+{
+ CORBA::ULong length = exceptions.length ();
+
+ if (length == 0)
+ {
+ return;
+ }
+
+ ACE_Configuration_Section_Key new_key;
+ this->repo_->config ()->open_section (key,
+ sub_section,
+ 1,
+ new_key);
+ this->repo_->config ()->set_integer_value (new_key,
+ "count",
+ length);
+ char *stringified = 0;
+ ACE_TString path;
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ exceptions[i].id.in (),
+ path);
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (new_key,
+ stringified,
+ path);
+ }
+}
+
+void
+TAO_ExtValueDef_i::exceptions (ACE_Configuration_Section_Key &key,
+ const char *sub_section,
+ const CORBA::ExceptionDefSeq &exceptions)
+{
+ CORBA::ULong length = exceptions.length ();
+
+ if (length == 0)
+ {
+ return;
+ }
+
+ ACE_Configuration_Section_Key excepts_key;
+ this->repo_->config ()->open_section (key,
+ sub_section,
+ 1,
+ excepts_key);
+
+ this->repo_->config ()->set_integer_value (excepts_key,
+ "count",
+ length);
+ char *stringified = 0;
+ char *type_path = 0;
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ type_path =
+ TAO_IFR_Service_Utils::reference_to_path (exceptions[i]);
+
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (excepts_key,
+ stringified,
+ type_path);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.h
new file mode 100644
index 00000000000..d2390a47c4a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.h
@@ -0,0 +1,135 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ExtValueDef_i.h
+//
+// = DESCRIPTION
+// ExtValueDef_i servant class.
+//
+// = AUTHOR
+// Jeff Parsons <j.parsons@vanderbilt.edu>
+//
+// ============================================================================
+
+#ifndef TAO_EXTVALUEDEF_I_H
+#define TAO_EXTVALUEDEF_I_H
+
+#include "orbsvcs/IFRService/ValueDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ExtValueDef_i : public virtual TAO_ValueDef_i
+{
+ // = TITLE
+ // TAO_ExtValueDef_i
+ //
+ // = DESCRIPTION
+ // Adds member and methods to TAO_ValueDef_i to get IDL3
+ // attribute exceptions.
+ //
+public:
+ TAO_ExtValueDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_ExtValueDef_i (void);
+ // Destructor
+
+ virtual CORBA::ExtInitializerSeq *ext_initializers (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ExtInitializerSeq *ext_initializers_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void ext_initializers (
+ const CORBA::ExtInitializerSeq &ext_initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void ext_initializers_i (
+ const CORBA::ExtInitializerSeq &ext_initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ExtValueDef::ExtFullValueDescription *describe_ext_value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ExtValueDef::ExtFullValueDescription *describe_ext_value_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ExtAttributeDef_ptr create_ext_attribute (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode,
+ const CORBA::ExceptionDefSeq &get_exceptions,
+ const CORBA::ExceptionDefSeq &set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ExtAttributeDef_ptr create_ext_attribute_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode,
+ const CORBA::ExceptionDefSeq &get_exceptions,
+ const CORBA::ExceptionDefSeq &set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void exceptions (ACE_Configuration_Section_Key &key,
+ const char *sub_section,
+ const CORBA::ExcDescriptionSeq &exceptions);
+ /// Public because it's also called from
+ /// TAO_Container_i::create_ext_value_i.
+
+private:
+ /// Common code for the set/get operations with attributes and initializers.
+
+ void fill_exceptions (CORBA::ExcDescriptionSeq &exceptions,
+ ACE_Configuration_Section_Key &key,
+ const char *sub_section
+ ACE_ENV_ARG_DECL);
+
+ void exceptions (ACE_Configuration_Section_Key &key,
+ const char *sub_section,
+ const CORBA::ExceptionDefSeq &exceptions);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_EXTVALUEDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/FactoryDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/FactoryDef_i.cpp
new file mode 100644
index 00000000000..f1fd5ae8157
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/FactoryDef_i.cpp
@@ -0,0 +1,32 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/FactoryDef_i.h"
+
+ACE_RCSID (IFRService,
+ FactoryDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_FactoryDef_i::TAO_FactoryDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo),
+ TAO_OperationDef_i (repo)
+{
+}
+
+TAO_FactoryDef_i::~TAO_FactoryDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_FactoryDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Factory;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/FactoryDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/FactoryDef_i.h
new file mode 100644
index 00000000000..38a366914ec
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/FactoryDef_i.h
@@ -0,0 +1,66 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// FactoryDef_i.h
+//
+// = DESCRIPTION
+// FactoryDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_FACTORYDEF_I_H
+#define TAO_FACTORYDEF_I_H
+
+#include "orbsvcs/IFRService/OperationDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_FactoryDef_i : public virtual TAO_OperationDef_i
+{
+ // = TITLE
+ // TAO_FactoryDef_i
+ //
+ // = DESCRIPTION
+ // Represents the definition of a factory operation in a home.
+ //
+public:
+ TAO_FactoryDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_FactoryDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_FACTORYDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/FinderDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/FinderDef_i.cpp
new file mode 100644
index 00000000000..6fffd784ad3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/FinderDef_i.cpp
@@ -0,0 +1,31 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/FinderDef_i.h"
+
+ACE_RCSID (IFRService,
+ FinderDef_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_FinderDef_i::TAO_FinderDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo),
+ TAO_OperationDef_i (repo)
+{
+}
+
+TAO_FinderDef_i::~TAO_FinderDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_FinderDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Finder;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/FinderDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/FinderDef_i.h
new file mode 100644
index 00000000000..e8ad0a283d7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/FinderDef_i.h
@@ -0,0 +1,67 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// FinderDef_i.h
+//
+// = DESCRIPTION
+// FinderDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_FINDERDEF_I_H
+#define TAO_FINDERDEF_I_H
+
+#include "orbsvcs/IFRService/OperationDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_FinderDef_i : public virtual TAO_OperationDef_i
+{
+ // = TITLE
+ // TAO_FinderDef_i
+ //
+ // = DESCRIPTION
+ // Represents the definition of a finder operation in a home.
+ //
+public:
+ TAO_FinderDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_FinderDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_FINDERDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/FixedDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/FixedDef_i.cpp
new file mode 100644
index 00000000000..f8fdc472f04
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/FixedDef_i.cpp
@@ -0,0 +1,152 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/FixedDef_i.h"
+
+ACE_RCSID (IFRService,
+ FixedDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_FixedDef_i::TAO_FixedDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_IDLType_i (repo)
+{
+}
+
+TAO_FixedDef_i::~TAO_FixedDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_FixedDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Fixed;
+}
+
+void
+TAO_FixedDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_FixedDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // TODO
+}
+
+CORBA::TypeCode_ptr
+TAO_FixedDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_FixedDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // TODO
+ return CORBA::TypeCode::_nil ();
+}
+
+CORBA::UShort
+TAO_FixedDef_i::digits (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->digits_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::UShort
+TAO_FixedDef_i::digits_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /* ACE_ENV_SINGLE_ARG_PARAMETER */)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // TODO
+ return 0;
+}
+
+void
+TAO_FixedDef_i::digits (CORBA::UShort digits
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->digits_i (digits
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_FixedDef_i::digits_i (CORBA::UShort /* digits */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // TODO
+}
+
+CORBA::Short
+TAO_FixedDef_i::scale (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->scale_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Short
+TAO_FixedDef_i::scale_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // TODO
+ return 0;
+}
+
+void
+TAO_FixedDef_i::scale (CORBA::Short scale
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->scale_i (scale
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_FixedDef_i::scale_i (CORBA::Short /* scale */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // TODO
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/FixedDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/FixedDef_i.h
new file mode 100644
index 00000000000..326bc90185b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/FixedDef_i.h
@@ -0,0 +1,133 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// FixedDef_i.h
+//
+// = DESCRIPTION
+// FixedDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_FIXEDDEF_I_H
+#define TAO_FIXEDDEF_I_H
+
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_FixedDef_i : public virtual TAO_IDLType_i
+{
+ // = TITLE
+ // TAO_FixedDef_i
+ //
+ // = DESCRIPTION
+ // Represents an IDL fixed type.
+ //
+public:
+ TAO_FixedDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_FixedDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::UShort digits (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::UShort digits_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void digits (
+ CORBA::UShort digits
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void digits_i (
+ CORBA::UShort digits
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Short scale (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Short scale_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void scale (
+ CORBA::Short scale
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void scale_i (
+ CORBA::Short scale
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_FIXEDDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/HomeDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/HomeDef_i.cpp
new file mode 100644
index 00000000000..4e8a1741f56
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/HomeDef_i.cpp
@@ -0,0 +1,1058 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/HomeDef_i.h"
+#include "orbsvcs/IFRService/FactoryDef_i.h"
+#include "orbsvcs/IFRService/FinderDef_i.h"
+#include "orbsvcs/IFRService/ValueDef_i.h"
+#include "orbsvcs/IFRService/ExceptionDef_i.h"
+#include "orbsvcs/IFRService/AttributeDef_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils_T.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ HomeDef_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_HomeDef_i::TAO_HomeDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Container_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo),
+ TAO_InterfaceDef_i (repo),
+ TAO_InterfaceAttrExtension_i (repo),
+ TAO_ExtInterfaceDef_i (repo)
+{
+}
+
+TAO_HomeDef_i::~TAO_HomeDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_HomeDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Home;
+}
+
+void
+TAO_HomeDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_HomeDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Destroy our special subsections first, then call destroy_i
+ // on our base class.
+
+ TAO_IFR_Generic_Utils<TAO_FactoryDef_i>::destroy_special (
+ "factories",
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ TAO_IFR_Generic_Utils<TAO_FinderDef_i>::destroy_special (
+ "finders",
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ this->TAO_ExtInterfaceDef_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_HomeDef_i::describe (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_HomeDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ComponentIR::HomeDescription home_desc;
+
+ TAO_IFR_Desc_Utils<CORBA::ComponentIR::HomeDescription,
+ TAO_HomeDef_i>::fill_desc_begin (home_desc,
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ACE_TString holder;
+ int status =
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_home",
+ holder);
+
+ ACE_Configuration_Section_Key tmp_key;
+
+ if (status == 0)
+ {
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ holder,
+ tmp_key,
+ 0);
+ this->repo_->config ()->get_string_value (tmp_key,
+ "id",
+ holder);
+ home_desc.base_home = holder.fast_rep ();
+ }
+
+ // No need to check the status - this one is required.
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "managed",
+ holder);
+ home_desc.managed_component = holder.fast_rep ();
+ status =
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "primary_key",
+ holder);
+
+ if (status == 0)
+ {
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ holder,
+ tmp_key,
+ 0);
+ TAO_ValueDef_i impl (this->repo_);
+ impl.section_key (tmp_key);
+ impl.fill_value_description (home_desc.primary_key
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ this->fill_op_desc_seq (this->section_key_,
+ home_desc.factories,
+ "factories"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->fill_op_desc_seq (this->section_key_,
+ home_desc.finders,
+ "finders"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->fill_op_desc_seq (this->section_key_,
+ home_desc.operations,
+ "ops"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ home_desc.type = this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Contained::Description *retval = 0;
+ ACE_NEW_RETURN (retval,
+ CORBA::Contained::Description,
+ 0);
+
+ retval->kind = CORBA::dk_Home;
+ retval->value <<= home_desc;
+ return retval;
+}
+
+CORBA::TypeCode_ptr
+TAO_HomeDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_HomeDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ id);
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ name);
+
+ return this->repo_->tc_factory ()->create_home_tc (id.fast_rep (),
+ name.fast_rep ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::HomeDef_ptr
+TAO_HomeDef_i::base_home (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::ComponentIR::HomeDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::HomeDef::_nil ());
+
+ return this->base_home_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::HomeDef_ptr
+TAO_HomeDef_i::base_home_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString path;
+ int status =
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_home",
+ path);
+
+ if (status != 0)
+ {
+ return CORBA::ComponentIR::HomeDef::_nil ();
+ }
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::HomeDef::_nil ());
+
+ return CORBA::ComponentIR::HomeDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_HomeDef_i::base_home (
+ CORBA::ComponentIR::HomeDef_ptr base_home
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->base_home_i (base_home
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_HomeDef_i::base_home_i (
+ CORBA::ComponentIR::HomeDef_ptr base_home
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ char *path = TAO_IFR_Service_Utils::reference_to_path (base_home);
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "base_home",
+ path);
+}
+
+CORBA::InterfaceDefSeq *
+TAO_HomeDef_i::supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->supported_interfaces_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::InterfaceDefSeq *
+TAO_HomeDef_i::supported_interfaces_i (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::InterfaceDefSeq *retval = 0;
+ ACE_NEW_RETURN (retval,
+ CORBA::InterfaceDefSeq,
+ 0);
+ CORBA::InterfaceDefSeq_var safe_retval = retval;
+ retval->length (0);
+ ACE_Configuration_Section_Key supported_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "supported",
+ 0,
+ supported_key);
+
+ if (status != 0)
+ {
+ return retval;
+ }
+
+ CORBA::ULong count = 0;
+ this->repo_->config ()->get_integer_value (supported_key,
+ "count",
+ count);
+ retval->length (count);
+ char *stringified = 0;
+ ACE_TString holder;
+ CORBA::Object_var obj;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->get_string_value (supported_key,
+ stringified,
+ holder);
+ obj = TAO_IFR_Service_Utils::path_to_ir_object (holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ safe_retval[i] = CORBA::InterfaceDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return safe_retval._retn ();
+}
+
+void
+TAO_HomeDef_i::supported_interfaces (
+ const CORBA::InterfaceDefSeq &supported_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supported_interfaces_i (supported_interfaces
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_HomeDef_i::supported_interfaces_i (
+ const CORBA::InterfaceDefSeq &supported_interfaces
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->remove_section (this->section_key_,
+ "supported",
+ 1);
+ CORBA::ULong length = supported_interfaces.length ();
+
+ if (length == 0)
+ {
+ return;
+ }
+
+ ACE_Configuration_Section_Key supported_key;
+ this->repo_->config ()->open_section (this->section_key_,
+ "supported",
+ 1,
+ supported_key);
+ char *stringified = 0;
+ char *path = 0;
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ supported_interfaces[i]
+ );
+ this->repo_->config ()->set_string_value (supported_key,
+ stringified,
+ path);
+ }
+}
+
+CORBA::ComponentIR::ComponentDef_ptr
+TAO_HomeDef_i::managed_component (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::ComponentIR::ComponentDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::ComponentDef::_nil ());
+
+ return this->managed_component_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::ComponentDef_ptr
+TAO_HomeDef_i::managed_component_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "managed",
+ path);
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::ComponentDef::_nil ());
+
+ return CORBA::ComponentIR::ComponentDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_HomeDef_i::managed_component (
+ CORBA::ComponentIR::ComponentDef_ptr managed_component
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->managed_component_i (managed_component
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_HomeDef_i::managed_component_i (
+ CORBA::ComponentIR::ComponentDef_ptr managed_component
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ char *path = TAO_IFR_Service_Utils::reference_to_path (managed_component);
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "managed",
+ path);
+}
+
+CORBA::ValueDef_ptr
+TAO_HomeDef_i::primary_key (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::ValueDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ValueDef::_nil ());
+
+ return this->primary_key_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ValueDef_ptr
+TAO_HomeDef_i::primary_key_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString path;
+ int status =
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "primary_key",
+ path);
+
+ if (status != 0)
+ {
+ return CORBA::ValueDef::_nil ();
+ }
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ValueDef::_nil ());
+
+ return CORBA::ValueDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_HomeDef_i::primary_key (
+ CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->primary_key_i (primary_key
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_HomeDef_i::primary_key_i (
+ CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (CORBA::is_nil (primary_key))
+ {
+ this->repo_->config ()->remove_value (this->section_key_,
+ "primary_key");
+ return;
+ }
+
+ char *path = TAO_IFR_Service_Utils::reference_to_path (primary_key);
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "primary_key",
+ path);
+}
+
+CORBA::ComponentIR::FactoryDef_ptr
+TAO_HomeDef_i::create_factory (const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ComponentIR::FactoryDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::FactoryDef::_nil ());
+
+ return this->create_factory_i (id,
+ name,
+ version,
+ params,
+ exceptions
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::FactoryDef_ptr
+TAO_HomeDef_i::create_factory_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Object_var obj = this->create_common (CORBA::dk_Factory,
+ id,
+ name,
+ version,
+ "factories",
+ params,
+ exceptions
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::FactoryDef::_nil ());
+
+ return CORBA::ComponentIR::FactoryDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::FinderDef_ptr
+TAO_HomeDef_i::create_finder (const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ComponentIR::FinderDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::FinderDef::_nil ());
+
+ return this->create_finder_i (id,
+ name,
+ version,
+ params,
+ exceptions
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ComponentIR::FinderDef_ptr
+TAO_HomeDef_i::create_finder_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Object_var obj = this->create_common (CORBA::dk_Finder,
+ id,
+ name,
+ version,
+ "finders",
+ params,
+ exceptions
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ComponentIR::FinderDef::_nil ());
+
+ return CORBA::ComponentIR::FinderDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Object_ptr
+TAO_HomeDef_i::create_common (CORBA::DefinitionKind created_kind,
+ const char *id,
+ const char *name,
+ const char *version,
+ const char *sub_section,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions
+ ACE_ENV_ARG_DECL)
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+
+ // Common to all IR objects created in CORBA::Container.
+ ACE_TString result_path =
+ TAO_IFR_Service_Utils::create_common (CORBA::dk_Home,
+ created_kind,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ sub_section
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ // Set the 'result' field with the path of our managed component.
+ ACE_TString managed_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "managed",
+ managed_path);
+ this->repo_->config ()->set_string_value (new_key,
+ "result",
+ managed_path);
+
+ // Always OP_NORMAL for factories.
+ this->repo_->config ()->set_integer_value (new_key,
+ "mode",
+ CORBA::OP_NORMAL);
+
+ CORBA::ULong i = 0;
+
+ // Store the operation's parameter info.
+ CORBA::ULong length = params.length ();
+
+ if (length > 0)
+ {
+ ACE_Configuration_Section_Key params_key;
+ this->repo_->config ()->open_section (new_key,
+ "params",
+ 1,
+ params_key);
+
+ this->repo_->config ()->set_integer_value (params_key,
+ "count",
+ length);
+ char *type_path = 0;
+ char *stringified = 0;
+ ACE_Configuration_Section_Key param_key;
+
+ for (i = 0; i < length; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (params_key,
+ stringified,
+ 1,
+ param_key);
+
+ this->repo_->config ()->set_string_value (param_key,
+ "name",
+ params[i].name.in ());
+ type_path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ params[i].type_def.in ()
+ );
+
+ this->repo_->config ()->set_string_value (param_key,
+ "type_path",
+ type_path);
+
+ if (params[i].mode != CORBA::PARAM_IN)
+ {
+ // @@@ (JP) No OMG-defined exception for this, but maybe there
+ // will be.
+ }
+
+ this->repo_->config ()->set_integer_value (param_key,
+ "mode",
+ CORBA::PARAM_IN);
+ }
+ }
+
+ // Store the operation's exception info.
+ length = exceptions.length ();
+
+ if (length > 0)
+ {
+ ACE_Configuration_Section_Key excepts_key;
+ this->repo_->config ()->open_section (new_key,
+ "excepts",
+ 1,
+ excepts_key);
+
+ this->repo_->config ()->set_integer_value (excepts_key,
+ "count",
+ length);
+ char *type_path = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ type_path =
+ TAO_IFR_Service_Utils::reference_to_path (exceptions[i]);
+
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (excepts_key,
+ stringified,
+ type_path);
+ }
+ }
+
+ // Create the object reference.
+ return
+ TAO_IFR_Service_Utils::create_objref (created_kind,
+ result_path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_HomeDef_i::fill_op_desc_seq (ACE_Configuration_Section_Key &key,
+ CORBA::OpDescriptionSeq &ods,
+ const char *sub_section
+ ACE_ENV_ARG_DECL)
+{
+ ods.length (0);
+ ACE_Configuration_Section_Key sub_key;
+ int status =
+ this->repo_->config ()->open_section (key,
+ sub_section,
+ 0,
+ sub_key);
+
+ if (status != 0)
+ {
+ return;
+ }
+
+ CORBA::ULong count = 0;
+ this->repo_->config ()->get_integer_value (sub_key,
+ "count",
+ count);
+ ods.length (count);
+ char *stringified = 0;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->fill_op_desc (sub_key,
+ ods[i],
+ stringified
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_HomeDef_i::fill_op_desc (ACE_Configuration_Section_Key &key,
+ CORBA::OperationDescription &od,
+ const char *sub_section
+ ACE_ENV_ARG_DECL)
+{
+ ACE_Configuration_Section_Key op_key;
+ this->repo_->config ()->open_section (key,
+ sub_section,
+ 0,
+ op_key);
+ TAO_IFR_Desc_Utils<CORBA::OperationDescription,
+ TAO_OperationDef_i>::fill_desc_begin (
+ od,
+ this->repo_,
+ op_key
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ ACE_TString result_path;
+ this->repo_->config ()->get_string_value (key,
+ "result",
+ result_path);
+ TAO_IDLType_i *result =
+ TAO_IFR_Service_Utils::path_to_idltype (result_path,
+ this->repo_);
+ od.result = result->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_OperationDef_i impl (this->repo_);
+ impl.section_key (op_key);
+ od.mode = impl.mode_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_IFR_Strseq_Utils<CORBA::ContextIdSeq>::fill_string_seq (
+ "contexts",
+ this->repo_->config (),
+ op_key,
+ od.contexts
+ );
+
+ this->fill_param_desc_seq (op_key,
+ od.parameters,
+ "params"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->fill_exc_desc_seq (op_key,
+ od.exceptions,
+ "excepts"
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_HomeDef_i::fill_param_desc_seq (ACE_Configuration_Section_Key &key,
+ CORBA::ParDescriptionSeq &pds,
+ const char *sub_section
+ ACE_ENV_ARG_DECL)
+{
+ pds.length (0);
+ ACE_Configuration_Section_Key params_key;
+ int status =
+ this->repo_->config ()->open_section (key,
+ sub_section,
+ 0,
+ params_key);
+
+ if (status != 0)
+ {
+ return;
+ }
+
+ CORBA::ULong count = 0;
+ this->repo_->config ()->get_integer_value (params_key,
+ "count",
+ count);
+ pds.length (count);
+ char *stringified = 0;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->fill_param_desc (params_key,
+ pds[i],
+ stringified
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_HomeDef_i::fill_param_desc (ACE_Configuration_Section_Key &key,
+ CORBA::ParameterDescription &pd,
+ const char *sub_section
+ ACE_ENV_ARG_DECL)
+{
+ ACE_Configuration_Section_Key param_key;
+ this->repo_->config ()->open_section (key,
+ sub_section,
+ 0,
+ param_key);
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (param_key,
+ "name",
+ holder);
+ pd.name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (param_key,
+ "type_path",
+ holder);
+ TAO_IDLType_i *impl = TAO_IFR_Service_Utils::path_to_idltype (holder,
+ this->repo_);
+ pd.type = impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ pd.type_def = CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong val;
+ this->repo_->config ()->get_integer_value (param_key,
+ "mode",
+ val);
+ pd.mode = static_cast<CORBA::ParameterMode> (val);
+}
+
+void
+TAO_HomeDef_i::fill_exc_desc_seq (ACE_Configuration_Section_Key &key,
+ CORBA::ExcDescriptionSeq &eds,
+ const char *sub_section
+ ACE_ENV_ARG_DECL)
+{
+ eds.length (0);
+ ACE_Configuration_Section_Key excepts_key;
+ int status =
+ this->repo_->config ()->open_section (key,
+ sub_section,
+ 0,
+ excepts_key);
+
+ if (status != 0)
+ {
+ return;
+ }
+
+ CORBA::ULong count = 0;
+ this->repo_->config ()->get_integer_value (excepts_key,
+ "count",
+ count);
+ eds.length (count);
+ char *stringified = 0;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->fill_exc_desc (excepts_key,
+ eds[i],
+ stringified
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_HomeDef_i::fill_exc_desc (ACE_Configuration_Section_Key &key,
+ CORBA::ExceptionDescription &ed,
+ const char *sub_section
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (key,
+ sub_section,
+ path);
+
+ // Description information for exceptions refers to the definition, not
+ // the reference, so we need the extra step to get
+ // the key of the exception's definition.
+ ACE_Configuration_Section_Key except_def_key;
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ path,
+ except_def_key,
+ 0);
+ TAO_IFR_Desc_Utils<CORBA::ExceptionDescription,
+ TAO_ExceptionDef_i>::fill_desc_begin (
+ ed,
+ this->repo_,
+ except_def_key
+ ACE_ENV_ARG_PARAMETER
+ );
+
+ TAO_ExceptionDef_i impl (this->repo_);
+ impl.section_key (except_def_key);
+ ed.type = impl.type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_HomeDef_i::fill_attr_desc_seq (ACE_Configuration_Section_Key &key,
+ CORBA::ExtAttrDescriptionSeq &eads,
+ const char *sub_section
+ ACE_ENV_ARG_DECL)
+{
+ eads.length (0);
+ ACE_Configuration_Section_Key attrs_key;
+ int status =
+ this->repo_->config ()->open_section (key,
+ sub_section,
+ 0,
+ attrs_key);
+
+ if (status != 0)
+ {
+ return;
+ }
+
+ CORBA::ULong count = 0;
+ this->repo_->config ()->get_integer_value (attrs_key,
+ "count",
+ count);
+ eads.length (count);
+ char *stringified = 0;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->fill_attr_desc (attrs_key,
+ eads[i],
+ stringified
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_HomeDef_i::fill_attr_desc (ACE_Configuration_Section_Key &key,
+ CORBA::ExtAttributeDescription &ead,
+ const char *sub_section
+ ACE_ENV_ARG_DECL)
+{
+ ACE_Configuration_Section_Key attr_key;
+ this->repo_->config ()->open_section (key,
+ sub_section,
+ 0,
+ attr_key);
+ TAO_IFR_Desc_Utils<CORBA::ExtAttributeDescription,
+ TAO_AttributeDef_i>::fill_desc_begin (
+ ead,
+ this->repo_,
+ attr_key
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ TAO_AttributeDef_i impl (this->repo_);
+ impl.section_key (attr_key);
+ ead.type = impl.type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ead.mode = impl.mode_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/HomeDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/HomeDef_i.h
new file mode 100644
index 00000000000..7436829cb68
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/HomeDef_i.h
@@ -0,0 +1,286 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// HomeDef_i.h
+//
+// = DESCRIPTION
+// HomeDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_HOMEDEF_I_H
+#define TAO_HOMEDEF_I_H
+
+#include "orbsvcs/IFRService/ExtInterfaceDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/IFRService/IFR_ComponentsS.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_HomeDef_i
+ : public virtual TAO_ExtInterfaceDef_i
+{
+ // = TITLE
+ // HomTAO_HomeDef_ieDef_i
+ //
+ // = DESCRIPTION
+ // Represents a home definition, containing factory and finder.
+ //
+public:
+ TAO_HomeDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_HomeDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::ComponentIR::HomeDef_ptr base_home (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ComponentIR::HomeDef_ptr base_home_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void base_home (
+ CORBA::ComponentIR::HomeDef_ptr base_home
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void base_home_i (
+ CORBA::ComponentIR::HomeDef_ptr base_home
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::InterfaceDefSeq *supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::InterfaceDefSeq *supported_interfaces_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void supported_interfaces (
+ const CORBA::InterfaceDefSeq &supported_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void supported_interfaces_i (
+ const CORBA::InterfaceDefSeq &supported_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ComponentIR::ComponentDef_ptr managed_component (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ComponentIR::ComponentDef_ptr managed_component_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void managed_component (
+ CORBA::ComponentIR::ComponentDef_ptr managed_component
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void managed_component_i (
+ CORBA::ComponentIR::ComponentDef_ptr managed_component
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ValueDef_ptr primary_key (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ValueDef_ptr primary_key_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void primary_key (
+ CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void primary_key_i (
+ CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ComponentIR::FactoryDef_ptr create_factory (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ComponentIR::FactoryDef_ptr create_factory_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ComponentIR::FinderDef_ptr create_finder (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ComponentIR::FinderDef_ptr create_finder_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ // Common code for create_factory_i and create_finder_i.
+ CORBA::Object_ptr create_common (
+ CORBA::DefinitionKind created_kind,
+ const char *id,
+ const char *name,
+ const char *version,
+ const char *sub_section,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions
+ ACE_ENV_ARG_DECL
+ );
+
+ void fill_op_desc_seq (ACE_Configuration_Section_Key &key,
+ CORBA::OpDescriptionSeq &ods,
+ const char *sub_section
+ ACE_ENV_ARG_DECL);
+
+ void fill_op_desc (ACE_Configuration_Section_Key &key,
+ CORBA::OperationDescription &od,
+ const char *sub_section
+ ACE_ENV_ARG_DECL);
+
+ void fill_param_desc_seq (ACE_Configuration_Section_Key &key,
+ CORBA::ParDescriptionSeq &pds,
+ const char *sub_section
+ ACE_ENV_ARG_DECL);
+
+ void fill_param_desc (ACE_Configuration_Section_Key &key,
+ CORBA::ParameterDescription &pd,
+ const char *sub_section
+ ACE_ENV_ARG_DECL);
+
+ void fill_exc_desc_seq (ACE_Configuration_Section_Key &key,
+ CORBA::ExcDescriptionSeq &eds,
+ const char *sub_section
+ ACE_ENV_ARG_DECL);
+
+ void fill_exc_desc (ACE_Configuration_Section_Key &key,
+ CORBA::ExceptionDescription &ed,
+ const char *sub_section
+ ACE_ENV_ARG_DECL);
+
+ void fill_attr_desc_seq (ACE_Configuration_Section_Key &key,
+ CORBA::ExtAttrDescriptionSeq &eads,
+ const char *sub_section
+ ACE_ENV_ARG_DECL);
+
+ void fill_attr_desc (ACE_Configuration_Section_Key &key,
+ CORBA::ExtAttributeDescription &ead,
+ const char *sub_section
+ ACE_ENV_ARG_DECL);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_HOMEDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IDLType_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IDLType_i.cpp
new file mode 100644
index 00000000000..83c64aff90e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IDLType_i.cpp
@@ -0,0 +1,21 @@
+// $Id$
+
+#include "orbsvcs/IFRService/IDLType_i.h"
+
+ACE_RCSID (IFRService,
+ IDLType_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_IDLType_i::TAO_IDLType_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo)
+{
+}
+
+TAO_IDLType_i::~TAO_IDLType_i (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IDLType_i.h b/TAO/orbsvcs/orbsvcs/IFRService/IDLType_i.h
new file mode 100644
index 00000000000..8935d63aae6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IDLType_i.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// IDLType_i.h
+//
+// = DESCRIPTION
+// IDLType servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_IDLTYPE_I_H
+#define TAO_IDLTYPE_I_H
+
+#include "orbsvcs/IFRService/IRObject_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Repository_i;
+
+class TAO_IFRService_Export TAO_IDLType_i : public virtual TAO_IRObject_i
+{
+ // = TITLE
+ // TAO_IDLType_i
+ //
+ // = DESCRIPTION
+ // Abstract base class for all IR objects that represent
+ // OMG IDL types. Provides access to the TypeCode describing
+ // the type.
+ //
+public:
+ TAO_IDLType_i (TAO_Repository_i *repo);
+ // Constructor.
+
+ virtual ~TAO_IDLType_i (void);
+ // Destructor.
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+ // Defined in concrete classes.
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+ // Defined in concrete classes.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_IDLTYPE_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS.cpp
new file mode 100644
index 00000000000..3395db49bd8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS.cpp
@@ -0,0 +1,7987 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:603
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASES_CPP_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASES_CPP_
+
+
+#include "IFR_BaseS.h"
+#include "tao/PortableServer/Operation_Table_Perfect_Hash.h"
+#include "tao/PortableServer/Upcall_Command.h"
+#include "tao/PortableServer/Upcall_Wrapper.h"
+#include "tao/TAO_Server_Request.h"
+#include "tao/ORB_Core.h"
+#include "tao/Profile.h"
+#include "tao/Stub.h"
+#include "tao/IFR_Client_Adapter.h"
+#include "tao/Object_T.h"
+#include "tao/AnyTypeCode/TypeCode.h"
+#include "tao/AnyTypeCode/DynamicC.h"
+#include "tao/CDR.h"
+#include "tao/operation_details.h"
+#include "tao/PortableInterceptor.h"
+#include "tao/PortableServer/Basic_SArguments.h"
+#include "tao/PortableServer/Object_SArgument_T.h"
+#include "tao/PortableServer/Special_Basic_SArguments.h"
+#include "tao/PortableServer/UB_String_SArguments.h"
+#include "tao/PortableServer/Var_Size_SArgument_T.h"
+#include "tao/PortableServer/Any_SArg_Traits.h"
+#include "tao/PortableServer/TypeCode_SArg_Traits.h"
+#include "tao/PortableServer/Object_SArg_Traits.h"
+#include "tao/PortableServer/get_arg.h"
+#include "tao/Special_Basic_Arguments.h"
+#include "tao/UB_String_Arguments.h"
+#include "tao/Basic_Arguments.h"
+#include "tao/Object_Argument_T.h"
+#include "tao/Special_Basic_Arguments.h"
+#include "tao/UB_String_Arguments.h"
+#include "tao/Var_Size_Argument_T.h"
+#include "tao/AnyTypeCode/Any_Arg_Traits.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/Malloc_Allocator.h"
+
+#if !defined (__ACE_INLINE__)
+#include "IFR_BaseS.inl"
+#endif /* !defined INLINE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_arg_traits.cpp:72
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+// Arg traits specializations.
+namespace TAO
+{
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_DEFINITIONKIND__SARG_TRAITS_)
+#define _CORBA_DEFINITIONKIND__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::DefinitionKind>
+ : public
+ Basic_SArg_Traits_T<
+ CORBA::DefinitionKind,
+ TAO::Any_Insert_Policy_Stream <CORBA::DefinitionKind>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_CONTAINED__SARG_TRAITS_)
+#define _CORBA_CONTAINED__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::Contained>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::Contained_ptr,
+ CORBA::Contained_var,
+ CORBA::Contained_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::Contained_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:859
+
+#if !defined (_CORBA_CONTAINED_DESCRIPTION__SARG_TRAITS_)
+#define _CORBA_CONTAINED_DESCRIPTION__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::Contained::Description>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::Contained::Description,
+ TAO::Any_Insert_Policy_Stream <CORBA::Contained::Description>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_REPOSITORY__SARG_TRAITS_)
+#define _CORBA_REPOSITORY__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::Repository>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::Repository_ptr,
+ CORBA::Repository_var,
+ CORBA::Repository_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::Repository_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_CONTAINER__SARG_TRAITS_)
+#define _CORBA_CONTAINER__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::Container>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::Container_ptr,
+ CORBA::Container_var,
+ CORBA::Container_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::Container_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_CONTAINER_DESCRIPTIONSEQ__SARG_TRAITS_)
+#define _CORBA_CONTAINER_DESCRIPTIONSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::Container::DescriptionSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::Container::DescriptionSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::Container::DescriptionSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_MODULEDEF__SARG_TRAITS_)
+#define _CORBA_MODULEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ModuleDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ModuleDef_ptr,
+ CORBA::ModuleDef_var,
+ CORBA::ModuleDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ModuleDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_CONSTANTDEF__SARG_TRAITS_)
+#define _CORBA_CONSTANTDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ConstantDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ConstantDef_ptr,
+ CORBA::ConstantDef_var,
+ CORBA::ConstantDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ConstantDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_IDLTYPE__SARG_TRAITS_)
+#define _CORBA_IDLTYPE__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::IDLType>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::IDLType_ptr,
+ CORBA::IDLType_var,
+ CORBA::IDLType_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::IDLType_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_STRUCTDEF__SARG_TRAITS_)
+#define _CORBA_STRUCTDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::StructDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::StructDef_ptr,
+ CORBA::StructDef_var,
+ CORBA::StructDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::StructDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_UNIONDEF__SARG_TRAITS_)
+#define _CORBA_UNIONDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::UnionDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::UnionDef_ptr,
+ CORBA::UnionDef_var,
+ CORBA::UnionDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::UnionDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_ENUMDEF__SARG_TRAITS_)
+#define _CORBA_ENUMDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::EnumDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::EnumDef_ptr,
+ CORBA::EnumDef_var,
+ CORBA::EnumDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::EnumDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_ALIASDEF__SARG_TRAITS_)
+#define _CORBA_ALIASDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::AliasDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::AliasDef_ptr,
+ CORBA::AliasDef_var,
+ CORBA::AliasDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::AliasDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_INTERFACEDEF__SARG_TRAITS_)
+#define _CORBA_INTERFACEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::InterfaceDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::InterfaceDef_ptr,
+ CORBA::InterfaceDef_var,
+ CORBA::InterfaceDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_INTERFACEDEFSEQ__SARG_TRAITS_)
+#define _CORBA_INTERFACEDEFSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::InterfaceDefSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::InterfaceDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_EXCEPTIONDEF__SARG_TRAITS_)
+#define _CORBA_EXCEPTIONDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ExceptionDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ExceptionDef_ptr,
+ CORBA::ExceptionDef_var,
+ CORBA::ExceptionDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExceptionDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_NATIVEDEF__SARG_TRAITS_)
+#define _CORBA_NATIVEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::NativeDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::NativeDef_ptr,
+ CORBA::NativeDef_var,
+ CORBA::NativeDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::NativeDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_VALUEDEF__SARG_TRAITS_)
+#define _CORBA_VALUEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ValueDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ValueDef_ptr,
+ CORBA::ValueDef_var,
+ CORBA::ValueDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_VALUEDEFSEQ__SARG_TRAITS_)
+#define _CORBA_VALUEDEFSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ValueDefSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ValueDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_VALUEBOXDEF__SARG_TRAITS_)
+#define _CORBA_VALUEBOXDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ValueBoxDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ValueBoxDef_ptr,
+ CORBA::ValueBoxDef_var,
+ CORBA::ValueBoxDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueBoxDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_ABSTRACTINTERFACEDEF__SARG_TRAITS_)
+#define _CORBA_ABSTRACTINTERFACEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::AbstractInterfaceDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::AbstractInterfaceDef_ptr,
+ CORBA::AbstractInterfaceDef_var,
+ CORBA::AbstractInterfaceDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::AbstractInterfaceDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_ABSTRACTINTERFACEDEFSEQ__SARG_TRAITS_)
+#define _CORBA_ABSTRACTINTERFACEDEFSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::AbstractInterfaceDefSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::AbstractInterfaceDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::AbstractInterfaceDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_LOCALINTERFACEDEF__SARG_TRAITS_)
+#define _CORBA_LOCALINTERFACEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::LocalInterfaceDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::LocalInterfaceDef_ptr,
+ CORBA::LocalInterfaceDef_var,
+ CORBA::LocalInterfaceDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::LocalInterfaceDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_EXTVALUEDEF__SARG_TRAITS_)
+#define _CORBA_EXTVALUEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ExtValueDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ExtValueDef_ptr,
+ CORBA::ExtValueDef_var,
+ CORBA::ExtValueDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtValueDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_CONTAINEDSEQ__SARG_TRAITS_)
+#define _CORBA_CONTAINEDSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ContainedSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ContainedSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ContainedSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_STRUCTMEMBERSEQ__SARG_TRAITS_)
+#define _CORBA_STRUCTMEMBERSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::StructMemberSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::StructMemberSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::StructMemberSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_INITIALIZERSEQ__SARG_TRAITS_)
+#define _CORBA_INITIALIZERSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::InitializerSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::InitializerSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::InitializerSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_EXTINITIALIZERSEQ__SARG_TRAITS_)
+#define _CORBA_EXTINITIALIZERSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ExtInitializerSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ExtInitializerSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtInitializerSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_UNIONMEMBERSEQ__SARG_TRAITS_)
+#define _CORBA_UNIONMEMBERSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::UnionMemberSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::UnionMemberSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::UnionMemberSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_ENUMMEMBERSEQ__SARG_TRAITS_)
+#define _CORBA_ENUMMEMBERSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::EnumMemberSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::EnumMemberSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::EnumMemberSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_arg_traits.cpp:72
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+// Arg traits specializations.
+namespace TAO
+{
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_DEFINITIONKIND__ARG_TRAITS_)
+#define _CORBA_DEFINITIONKIND__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::DefinitionKind>
+ : public
+ Basic_Arg_Traits_T<
+ CORBA::DefinitionKind,
+ TAO::Any_Insert_Policy_Stream <CORBA::DefinitionKind>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_CONTAINED__ARG_TRAITS_)
+#define _CORBA_CONTAINED__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::Contained>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::Contained_ptr,
+ CORBA::Contained_var,
+ CORBA::Contained_out,
+ TAO::Objref_Traits<CORBA::Contained>,
+ TAO::Any_Insert_Policy_Stream <CORBA::Contained_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:859
+
+#if !defined (_CORBA_CONTAINED_DESCRIPTION__ARG_TRAITS_)
+#define _CORBA_CONTAINED_DESCRIPTION__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::Contained::Description>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::Contained::Description,
+ TAO::Any_Insert_Policy_Stream <CORBA::Contained::Description>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_REPOSITORY__ARG_TRAITS_)
+#define _CORBA_REPOSITORY__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::Repository>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::Repository_ptr,
+ CORBA::Repository_var,
+ CORBA::Repository_out,
+ TAO::Objref_Traits<CORBA::Repository>,
+ TAO::Any_Insert_Policy_Stream <CORBA::Repository_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_CONTAINER__ARG_TRAITS_)
+#define _CORBA_CONTAINER__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::Container>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::Container_ptr,
+ CORBA::Container_var,
+ CORBA::Container_out,
+ TAO::Objref_Traits<CORBA::Container>,
+ TAO::Any_Insert_Policy_Stream <CORBA::Container_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_CONTAINER_DESCRIPTIONSEQ__ARG_TRAITS_)
+#define _CORBA_CONTAINER_DESCRIPTIONSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::Container::DescriptionSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::Container::DescriptionSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::Container::DescriptionSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_MODULEDEF__ARG_TRAITS_)
+#define _CORBA_MODULEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ModuleDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ModuleDef_ptr,
+ CORBA::ModuleDef_var,
+ CORBA::ModuleDef_out,
+ TAO::Objref_Traits<CORBA::ModuleDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ModuleDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_CONSTANTDEF__ARG_TRAITS_)
+#define _CORBA_CONSTANTDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ConstantDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ConstantDef_ptr,
+ CORBA::ConstantDef_var,
+ CORBA::ConstantDef_out,
+ TAO::Objref_Traits<CORBA::ConstantDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ConstantDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_IDLTYPE__ARG_TRAITS_)
+#define _CORBA_IDLTYPE__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::IDLType>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::IDLType_ptr,
+ CORBA::IDLType_var,
+ CORBA::IDLType_out,
+ TAO::Objref_Traits<CORBA::IDLType>,
+ TAO::Any_Insert_Policy_Stream <CORBA::IDLType_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_STRUCTDEF__ARG_TRAITS_)
+#define _CORBA_STRUCTDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::StructDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::StructDef_ptr,
+ CORBA::StructDef_var,
+ CORBA::StructDef_out,
+ TAO::Objref_Traits<CORBA::StructDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::StructDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_UNIONDEF__ARG_TRAITS_)
+#define _CORBA_UNIONDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::UnionDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::UnionDef_ptr,
+ CORBA::UnionDef_var,
+ CORBA::UnionDef_out,
+ TAO::Objref_Traits<CORBA::UnionDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::UnionDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_ENUMDEF__ARG_TRAITS_)
+#define _CORBA_ENUMDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::EnumDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::EnumDef_ptr,
+ CORBA::EnumDef_var,
+ CORBA::EnumDef_out,
+ TAO::Objref_Traits<CORBA::EnumDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::EnumDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_ALIASDEF__ARG_TRAITS_)
+#define _CORBA_ALIASDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::AliasDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::AliasDef_ptr,
+ CORBA::AliasDef_var,
+ CORBA::AliasDef_out,
+ TAO::Objref_Traits<CORBA::AliasDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::AliasDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_INTERFACEDEF__ARG_TRAITS_)
+#define _CORBA_INTERFACEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::InterfaceDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::InterfaceDef_ptr,
+ CORBA::InterfaceDef_var,
+ CORBA::InterfaceDef_out,
+ TAO::Objref_Traits<CORBA::InterfaceDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_INTERFACEDEFSEQ__ARG_TRAITS_)
+#define _CORBA_INTERFACEDEFSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::InterfaceDefSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::InterfaceDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_EXCEPTIONDEF__ARG_TRAITS_)
+#define _CORBA_EXCEPTIONDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ExceptionDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ExceptionDef_ptr,
+ CORBA::ExceptionDef_var,
+ CORBA::ExceptionDef_out,
+ TAO::Objref_Traits<CORBA::ExceptionDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExceptionDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_NATIVEDEF__ARG_TRAITS_)
+#define _CORBA_NATIVEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::NativeDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::NativeDef_ptr,
+ CORBA::NativeDef_var,
+ CORBA::NativeDef_out,
+ TAO::Objref_Traits<CORBA::NativeDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::NativeDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_VALUEDEF__ARG_TRAITS_)
+#define _CORBA_VALUEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ValueDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ValueDef_ptr,
+ CORBA::ValueDef_var,
+ CORBA::ValueDef_out,
+ TAO::Objref_Traits<CORBA::ValueDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_VALUEDEFSEQ__ARG_TRAITS_)
+#define _CORBA_VALUEDEFSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ValueDefSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ValueDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_VALUEBOXDEF__ARG_TRAITS_)
+#define _CORBA_VALUEBOXDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ValueBoxDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ValueBoxDef_ptr,
+ CORBA::ValueBoxDef_var,
+ CORBA::ValueBoxDef_out,
+ TAO::Objref_Traits<CORBA::ValueBoxDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueBoxDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_ABSTRACTINTERFACEDEF__ARG_TRAITS_)
+#define _CORBA_ABSTRACTINTERFACEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::AbstractInterfaceDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::AbstractInterfaceDef_ptr,
+ CORBA::AbstractInterfaceDef_var,
+ CORBA::AbstractInterfaceDef_out,
+ TAO::Objref_Traits<CORBA::AbstractInterfaceDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::AbstractInterfaceDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_ABSTRACTINTERFACEDEFSEQ__ARG_TRAITS_)
+#define _CORBA_ABSTRACTINTERFACEDEFSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::AbstractInterfaceDefSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::AbstractInterfaceDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::AbstractInterfaceDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_LOCALINTERFACEDEF__ARG_TRAITS_)
+#define _CORBA_LOCALINTERFACEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::LocalInterfaceDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::LocalInterfaceDef_ptr,
+ CORBA::LocalInterfaceDef_var,
+ CORBA::LocalInterfaceDef_out,
+ TAO::Objref_Traits<CORBA::LocalInterfaceDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::LocalInterfaceDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_EXTVALUEDEF__ARG_TRAITS_)
+#define _CORBA_EXTVALUEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ExtValueDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ExtValueDef_ptr,
+ CORBA::ExtValueDef_var,
+ CORBA::ExtValueDef_out,
+ TAO::Objref_Traits<CORBA::ExtValueDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtValueDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_CONTAINEDSEQ__ARG_TRAITS_)
+#define _CORBA_CONTAINEDSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ContainedSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ContainedSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ContainedSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_STRUCTMEMBERSEQ__ARG_TRAITS_)
+#define _CORBA_STRUCTMEMBERSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::StructMemberSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::StructMemberSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::StructMemberSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_INITIALIZERSEQ__ARG_TRAITS_)
+#define _CORBA_INITIALIZERSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::InitializerSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::InitializerSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::InitializerSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_EXTINITIALIZERSEQ__ARG_TRAITS_)
+#define _CORBA_EXTINITIALIZERSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ExtInitializerSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ExtInitializerSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtInitializerSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_UNIONMEMBERSEQ__ARG_TRAITS_)
+#define _CORBA_UNIONMEMBERSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::UnionMemberSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::UnionMemberSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::UnionMemberSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_ENUMMEMBERSEQ__ARG_TRAITS_)
+#define _CORBA_ENUMMEMBERSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::EnumMemberSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::EnumMemberSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::EnumMemberSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_IRObject_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_IRObject_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_IRObject_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 0,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 0,
+ 19, 19, 0, 0, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 5, 19, 19, 19, 19, 0, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19,
+#else
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 0, 19, 0, 19, 19,
+ 0, 0, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 5, 19, 19, 19,
+ 19, 0, 19, 19, 19, 19, 19, 19,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_IRObject_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 7,
+ MIN_WORD_LENGTH = 5,
+ MAX_WORD_LENGTH = 14,
+ MIN_HASH_VALUE = 5,
+ MAX_HASH_VALUE = 18,
+ HASH_VALUE_RANGE = 14,
+ DUPLICATES = 0,
+ WORDLIST_SIZE = 12
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"_is_a", &POA_CORBA::IRObject::_is_a_skel, 0},
+ {"",0,0},
+ {"destroy", &POA_CORBA::IRObject::destroy_skel, 0},
+ {"",0,0},{"",0,0},
+ {"_interface", &POA_CORBA::IRObject::_interface_skel, 0},
+ {"",0,0},{"",0,0},
+ {"_get_def_kind", &POA_CORBA::IRObject::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::IRObject::_repository_id_skel, 0},
+ {"_component", &POA_CORBA::IRObject::_component_skel, 0},
+ {"",0,0},{"",0,0},
+ {"_non_existent", &POA_CORBA::IRObject::_non_existent_skel, 0},
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ const char *s = wordlist[key].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[key];
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_IRObject_Perfect_Hash_OpTable tao_CORBA_IRObject_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_IRObject_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_IRObject_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_IRObject_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_IRObject_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_IRObject_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_IRObject_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_IRObject_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::IRObject::IRObject (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_IRObject_optable;
+}
+
+POA_CORBA::IRObject::IRObject (const IRObject& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs)
+{
+}
+
+POA_CORBA::IRObject::~IRObject (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_def_kind_IRObject
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_def_kind_IRObject (
+ POA_CORBA::IRObject * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::DefinitionKind>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::DefinitionKind> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::IRObject * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::IRObject::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::DefinitionKind>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::IRObject * const impl =
+ static_cast<POA_CORBA::IRObject *> (servant);
+
+ _get_def_kind_IRObject command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class destroy_IRObject
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline destroy_IRObject (
+ POA_CORBA::IRObject * servant)
+ : servant_ (servant)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ this->servant_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::IRObject * const servant_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::IRObject::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::IRObject * const impl =
+ static_cast<POA_CORBA::IRObject *> (servant);
+
+ destroy_IRObject command (
+ impl);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_IRObject_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_IRObject_Upcall_Command (
+ POA_CORBA::IRObject * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::IRObject * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::IRObject::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::IRObject * const impl =
+ static_cast<POA_CORBA::IRObject *> (servant);
+
+ _is_a_IRObject_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_IRObject_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_IRObject_Upcall_Command (
+ POA_CORBA::IRObject * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::IRObject * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::IRObject::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::IRObject * const impl =
+ static_cast<POA_CORBA::IRObject *> (servant);
+
+ _non_existent_IRObject_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_IRObject_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_IRObject_Upcall_Command (
+ POA_CORBA::IRObject * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::IRObject * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::IRObject::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::IRObject * const impl =
+ static_cast<POA_CORBA::IRObject *> (servant);
+
+ _repository_id_IRObject_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::IRObject::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::IRObject * const impl =
+ static_cast<POA_CORBA::IRObject *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_IRObject_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_IRObject_Upcall_Command (
+ POA_CORBA::IRObject * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::IRObject * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::IRObject::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::IRObject * const impl =
+ static_cast<POA_CORBA::IRObject *> (servant);
+
+ _get_component_IRObject_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::IRObject::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::IRObject::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/IRObject:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::IRObject::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::IRObject *
+POA_CORBA::IRObject::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::IRObject STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_IRObject_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_Contained_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_Contained_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_Contained_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 0, 0, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 10, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 0, 0, 37, 37, 37, 37, 37, 37, 37, 0,
+ 0, 37, 37, 37, 37, 37, 10, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_Contained_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 18,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 4,
+ WORDLIST_SIZE = 22
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::Contained::move_skel, 0},
+ {"_is_a", &POA_CORBA::Contained::_is_a_skel, 0},
+ {"_get_id", &POA_CORBA::Contained::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::Contained::_set_id_skel, 0},
+ {"describe", &POA_CORBA::Contained::describe_skel, 0},
+ {"_get_name", &POA_CORBA::Contained::_get_name_skel, 0},
+ {"_set_name", &POA_CORBA::Contained::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::Contained::_interface_skel, 0},
+ {"_get_version", &POA_CORBA::Contained::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::Contained::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::Contained::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::Contained::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::Contained::_get_defined_in_skel, 0},
+ {"destroy", &POA_CORBA::Contained::destroy_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::Contained::_get_absolute_name_skel, 0},
+ {"_component", &POA_CORBA::Contained::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::Contained::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::Contained::_get_containing_repository_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -9, -2, -12, -2, 4, 5, -1, 50, 8, -45, 11, -1, -46, 14,
+ 15, 16, -1, 17, 18, -1, 19, -6, -2, 20, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 21,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_Contained_Perfect_Hash_OpTable tao_CORBA_Contained_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_Contained_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_Contained_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_Contained_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_Contained_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_Contained_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_Contained_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_Contained_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::Contained::Contained (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_Contained_optable;
+}
+
+POA_CORBA::Contained::Contained (const Contained& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs)
+{
+}
+
+POA_CORBA::Contained::~Contained (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_id_Contained
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_id_Contained (
+ POA_CORBA::Contained * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Contained * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Contained::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+
+ _get_id_Contained command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_id_Contained
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_id_Contained (
+ POA_CORBA::Contained * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->id (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Contained * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Contained::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+
+ _set_id_Contained command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_name_Contained
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_name_Contained (
+ POA_CORBA::Contained * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Identifier>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Contained * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Contained::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+
+ _get_name_Contained command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_name_Contained
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_name_Contained (
+ POA_CORBA::Contained * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->name (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Contained * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Contained::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_name
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+
+ _set_name_Contained command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_version_Contained
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_version_Contained (
+ POA_CORBA::Contained * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Contained * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Contained::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+
+ _get_version_Contained command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_version_Contained
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_version_Contained (
+ POA_CORBA::Contained * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->version (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Contained * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Contained::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_version
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+
+ _set_version_Contained command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_defined_in_Contained
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_defined_in_Contained (
+ POA_CORBA::Contained * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Container>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Container> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Contained * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Contained::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Container>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+
+ _get_defined_in_Contained command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_absolute_name_Contained
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_absolute_name_Contained (
+ POA_CORBA::Contained * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ScopedName>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ScopedName> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Contained * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Contained::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ScopedName>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+
+ _get_absolute_name_Contained command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_containing_repository_Contained
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_containing_repository_Contained (
+ POA_CORBA::Contained * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Repository>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Repository> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Contained * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Contained::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Repository>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+
+ _get_containing_repository_Contained command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class describe_Contained
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline describe_Contained (
+ POA_CORBA::Contained * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Contained::Description>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Contained::Description> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Contained * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Contained::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Contained::Description>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+
+ describe_Contained command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class move_Contained
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline move_Contained (
+ POA_CORBA::Contained * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Container>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Container> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ this->servant_->move (
+ arg_1
+ , arg_2
+ , arg_3
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Contained * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Contained::move_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Container>::in_arg_val _tao_new_container;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_new_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_new_version;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_new_container,
+ &_tao_new_name,
+ &_tao_new_version
+ };
+
+ static size_t const nargs = 4;
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+
+ move_Contained command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_Contained_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_Contained_Upcall_Command (
+ POA_CORBA::Contained * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Contained * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::Contained::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+
+ _is_a_Contained_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_Contained_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_Contained_Upcall_Command (
+ POA_CORBA::Contained * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Contained * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::Contained::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+
+ _non_existent_Contained_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_Contained_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_Contained_Upcall_Command (
+ POA_CORBA::Contained * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Contained * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::Contained::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+
+ _repository_id_Contained_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::Contained::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_Contained_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_Contained_Upcall_Command (
+ POA_CORBA::Contained * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Contained * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::Contained::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Contained * const impl =
+ static_cast<POA_CORBA::Contained *> (servant);
+
+ _get_component_Contained_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::Contained::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::Contained::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/Contained:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::Contained::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::Contained *
+POA_CORBA::Contained::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::Contained STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_Contained_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_Container_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_Container_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_Container_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 20,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 15,
+ 41, 0, 0, 0, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 0, 20, 5,
+ 41, 0, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 15, 5, 41, 41, 41, 10, 0, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41,
+#else
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 20, 41, 15, 41, 0,
+ 0, 0, 41, 41, 41, 41, 41, 41, 0, 20,
+ 5, 41, 0, 41, 41, 15, 5, 41, 41, 41,
+ 10, 0, 41, 41, 41, 41, 41, 41,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_Container_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 25,
+ MIN_WORD_LENGTH = 5,
+ MAX_WORD_LENGTH = 25,
+ MIN_HASH_VALUE = 6,
+ MAX_HASH_VALUE = 40,
+ HASH_VALUE_RANGE = 35,
+ DUPLICATES = 3,
+ WORDLIST_SIZE = 31
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"lookup", &POA_CORBA::Container::lookup_skel, 0},
+ {"destroy", &POA_CORBA::Container::destroy_skel, 0},
+ {"lookup_name", &POA_CORBA::Container::lookup_name_skel, 0},
+ {"create_value", &POA_CORBA::Container::create_value_skel, 0},
+ {"create_module", &POA_CORBA::Container::create_module_skel, 0},
+ {"create_native", &POA_CORBA::Container::create_native_skel, 0},
+ {"create_interface", &POA_CORBA::Container::create_interface_skel, 0},
+ {"create_ext_value", &POA_CORBA::Container::create_ext_value_skel, 0},
+ {"create_union", &POA_CORBA::Container::create_union_skel, 0},
+ {"create_struct", &POA_CORBA::Container::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::Container::create_constant_skel, 0},
+ {"create_exception", &POA_CORBA::Container::create_exception_skel, 0},
+ {"create_local_interface", &POA_CORBA::Container::create_local_interface_skel, 0},
+ {"contents", &POA_CORBA::Container::contents_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::Container::create_abstract_interface_skel, 0},
+ {"create_value_box", &POA_CORBA::Container::create_value_box_skel, 0},
+ {"create_alias", &POA_CORBA::Container::create_alias_skel, 0},
+ {"_interface", &POA_CORBA::Container::_interface_skel, 0},
+ {"create_enum", &POA_CORBA::Container::create_enum_skel, 0},
+ {"describe_contents", &POA_CORBA::Container::describe_contents_skel, 0},
+ {"_get_def_kind", &POA_CORBA::Container::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::Container::_repository_id_skel, 0},
+ {"_component", &POA_CORBA::Container::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::Container::_non_existent_skel, 0},
+ {"_is_a", &POA_CORBA::Container::_is_a_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, -1, -1, 6, 7, -1, -10, -2, 8, 9, -44,
+ -12, -2, -42, 14, 15, -1, 16, 17, 18, 19, -1, 20, 21, 22,
+ -1, -1, 23, 24, 25, 26, 27, 28, -1, -1, 29, -1, 30,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_Container_Perfect_Hash_OpTable tao_CORBA_Container_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_Container_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_Container_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_Container_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_Container_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_Container_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_Container_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_Container_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::Container::Container (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_Container_optable;
+}
+
+POA_CORBA::Container::Container (const Container& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs)
+{
+}
+
+POA_CORBA::Container::~Container (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class lookup_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline lookup_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Contained>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Contained> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::ScopedName>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ScopedName> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_->lookup (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Contained>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ScopedName>::in_arg_val _tao_search_name;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_search_name
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ lookup_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class contents_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline contents_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ContainedSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ContainedSeq> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::DefinitionKind>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::DefinitionKind> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ retval =
+ this->servant_->contents (
+ arg_1
+ , arg_2
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ContainedSeq>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::DefinitionKind>::in_arg_val _tao_limit_type;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_exclude_inherited;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_limit_type,
+ &_tao_exclude_inherited
+ };
+
+ static size_t const nargs = 3;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ contents_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class lookup_name_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline lookup_name_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ContainedSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ContainedSeq> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Long>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Long> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::DefinitionKind>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::DefinitionKind> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ retval =
+ this->servant_->lookup_name (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ContainedSeq>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_search_name;
+ TAO::SArg_Traits< ::CORBA::Long>::in_arg_val _tao_levels_to_search;
+ TAO::SArg_Traits< ::CORBA::DefinitionKind>::in_arg_val _tao_limit_type;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_exclude_inherited;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_search_name,
+ &_tao_levels_to_search,
+ &_tao_limit_type,
+ &_tao_exclude_inherited
+ };
+
+ static size_t const nargs = 5;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ lookup_name_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class describe_contents_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline describe_contents_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Container::DescriptionSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Container::DescriptionSeq> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::DefinitionKind>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::DefinitionKind> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::Long>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Long> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ retval =
+ this->servant_->describe_contents (
+ arg_1
+ , arg_2
+ , arg_3
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Container::DescriptionSeq>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::DefinitionKind>::in_arg_val _tao_limit_type;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_exclude_inherited;
+ TAO::SArg_Traits< ::CORBA::Long>::in_arg_val _tao_max_returned_objs;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_limit_type,
+ &_tao_exclude_inherited,
+ &_tao_max_returned_objs
+ };
+
+ static size_t const nargs = 4;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ describe_contents_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_module_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_module_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ModuleDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ModuleDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ retval =
+ this->servant_->create_module (
+ arg_1
+ , arg_2
+ , arg_3
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ModuleDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version
+ };
+
+ static size_t const nargs = 4;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ create_module_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_constant_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_constant_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ConstantDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ConstantDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::CORBA::Any>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Any> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ retval =
+ this->servant_->create_constant (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ConstantDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_type;
+ TAO::SArg_Traits< ::CORBA::Any>::in_arg_val _tao_value;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_type,
+ &_tao_value
+ };
+
+ static size_t const nargs = 6;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ create_constant_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_struct_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_struct_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::StructDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::StructDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::StructMemberSeq>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::StructMemberSeq> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ retval =
+ this->servant_->create_struct (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::StructDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::StructMemberSeq>::in_arg_val _tao_members;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_members
+ };
+
+ static size_t const nargs = 5;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ create_struct_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_union_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_union_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::UnionDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::UnionDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::CORBA::UnionMemberSeq>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::UnionMemberSeq> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ retval =
+ this->servant_->create_union (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::UnionDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_discriminator_type;
+ TAO::SArg_Traits< ::CORBA::UnionMemberSeq>::in_arg_val _tao_members;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_discriminator_type,
+ &_tao_members
+ };
+
+ static size_t const nargs = 6;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ create_union_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_enum_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_enum_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::EnumDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::EnumDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::EnumMemberSeq>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::EnumMemberSeq> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ retval =
+ this->servant_->create_enum (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::EnumDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::EnumMemberSeq>::in_arg_val _tao_members;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_members
+ };
+
+ static size_t const nargs = 5;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ create_enum_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_alias_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_alias_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::AliasDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::AliasDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ retval =
+ this->servant_->create_alias (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::AliasDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_original_type;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_original_type
+ };
+
+ static size_t const nargs = 5;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ create_alias_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_interface_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_interface_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InterfaceDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::InterfaceDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InterfaceDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ retval =
+ this->servant_->create_interface (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_val _tao_base_interfaces;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_base_interfaces
+ };
+
+ static size_t const nargs = 5;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ create_interface_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_value_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_value_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ValueDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ValueDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ TAO::SArg_Traits< ::CORBA::ValueDef>::in_arg_type arg_6 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ValueDef> (
+ this->operation_details_,
+ this->args_,
+ 6);
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_7 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 7);
+
+ TAO::SArg_Traits< ::CORBA::ValueDefSeq>::in_arg_type arg_8 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ValueDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 8);
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_type arg_9 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InterfaceDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 9);
+
+ TAO::SArg_Traits< ::CORBA::InitializerSeq>::in_arg_type arg_10 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InitializerSeq> (
+ this->operation_details_,
+ this->args_,
+ 10);
+
+ retval =
+ this->servant_->create_value (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ , arg_6
+ , arg_7
+ , arg_8
+ , arg_9
+ , arg_10
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ValueDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_is_custom;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_is_abstract;
+ TAO::SArg_Traits< ::CORBA::ValueDef>::in_arg_val _tao_base_value;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_is_truncatable;
+ TAO::SArg_Traits< ::CORBA::ValueDefSeq>::in_arg_val _tao_abstract_base_values;
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_val _tao_supported_interfaces;
+ TAO::SArg_Traits< ::CORBA::InitializerSeq>::in_arg_val _tao_initializers;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_is_custom,
+ &_tao_is_abstract,
+ &_tao_base_value,
+ &_tao_is_truncatable,
+ &_tao_abstract_base_values,
+ &_tao_supported_interfaces,
+ &_tao_initializers
+ };
+
+ static size_t const nargs = 11;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ create_value_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_value_box_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_value_box_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ValueBoxDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ValueBoxDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ retval =
+ this->servant_->create_value_box (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ValueBoxDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_original_type_def;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_original_type_def
+ };
+
+ static size_t const nargs = 5;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ create_value_box_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_exception_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_exception_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ExceptionDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ExceptionDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::StructMemberSeq>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::StructMemberSeq> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ retval =
+ this->servant_->create_exception (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ExceptionDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::StructMemberSeq>::in_arg_val _tao_members;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_members
+ };
+
+ static size_t const nargs = 5;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ create_exception_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_native_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_native_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::NativeDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::NativeDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ retval =
+ this->servant_->create_native (
+ arg_1
+ , arg_2
+ , arg_3
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::NativeDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version
+ };
+
+ static size_t const nargs = 4;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ create_native_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_abstract_interface_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_abstract_interface_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::AbstractInterfaceDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::AbstractInterfaceDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::AbstractInterfaceDefSeq>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::AbstractInterfaceDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ retval =
+ this->servant_->create_abstract_interface (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::AbstractInterfaceDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::AbstractInterfaceDefSeq>::in_arg_val _tao_base_interfaces;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_base_interfaces
+ };
+
+ static size_t const nargs = 5;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ create_abstract_interface_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_local_interface_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_local_interface_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::LocalInterfaceDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::LocalInterfaceDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InterfaceDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ retval =
+ this->servant_->create_local_interface (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::LocalInterfaceDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_val _tao_base_interfaces;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_base_interfaces
+ };
+
+ static size_t const nargs = 5;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ create_local_interface_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_ext_value_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_ext_value_Container (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ExtValueDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ExtValueDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ TAO::SArg_Traits< ::CORBA::ValueDef>::in_arg_type arg_6 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ValueDef> (
+ this->operation_details_,
+ this->args_,
+ 6);
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_7 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 7);
+
+ TAO::SArg_Traits< ::CORBA::ValueDefSeq>::in_arg_type arg_8 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ValueDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 8);
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_type arg_9 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InterfaceDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 9);
+
+ TAO::SArg_Traits< ::CORBA::ExtInitializerSeq>::in_arg_type arg_10 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ExtInitializerSeq> (
+ this->operation_details_,
+ this->args_,
+ 10);
+
+ retval =
+ this->servant_->create_ext_value (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ , arg_6
+ , arg_7
+ , arg_8
+ , arg_9
+ , arg_10
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Container::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ExtValueDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_is_custom;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_is_abstract;
+ TAO::SArg_Traits< ::CORBA::ValueDef>::in_arg_val _tao_base_value;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_is_truncatable;
+ TAO::SArg_Traits< ::CORBA::ValueDefSeq>::in_arg_val _tao_abstract_base_values;
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_val _tao_supported_interfaces;
+ TAO::SArg_Traits< ::CORBA::ExtInitializerSeq>::in_arg_val _tao_initializers;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_is_custom,
+ &_tao_is_abstract,
+ &_tao_base_value,
+ &_tao_is_truncatable,
+ &_tao_abstract_base_values,
+ &_tao_supported_interfaces,
+ &_tao_initializers
+ };
+
+ static size_t const nargs = 11;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ create_ext_value_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_Container_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_Container_Upcall_Command (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::Container::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ _is_a_Container_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_Container_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_Container_Upcall_Command (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::Container::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ _non_existent_Container_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_Container_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_Container_Upcall_Command (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::Container::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ _repository_id_Container_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::Container::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_Container_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_Container_Upcall_Command (
+ POA_CORBA::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::Container::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Container * const impl =
+ static_cast<POA_CORBA::Container *> (servant);
+
+ _get_component_Container_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::Container::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::Container::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/Container:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::Container::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::Container *
+POA_CORBA::Container::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::Container STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_Container_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_IDLType_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_IDLType_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_IDLType_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 0,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 0,
+ 19, 19, 0, 0, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 5, 19, 19, 19, 19, 0, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19,
+#else
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 0, 19, 0, 19, 19,
+ 0, 0, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 5, 19, 19, 19,
+ 19, 0, 19, 19, 19, 19, 19, 19,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_IDLType_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 8,
+ MIN_WORD_LENGTH = 5,
+ MAX_WORD_LENGTH = 14,
+ MIN_HASH_VALUE = 5,
+ MAX_HASH_VALUE = 18,
+ HASH_VALUE_RANGE = 14,
+ DUPLICATES = 0,
+ WORDLIST_SIZE = 13
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"_is_a", &POA_CORBA::IDLType::_is_a_skel, 0},
+ {"",0,0},
+ {"destroy", &POA_CORBA::IDLType::destroy_skel, 0},
+ {"",0,0},
+ {"_get_type", &POA_CORBA::IDLType::_get_type_skel, 0},
+ {"_interface", &POA_CORBA::IDLType::_interface_skel, 0},
+ {"",0,0},{"",0,0},
+ {"_get_def_kind", &POA_CORBA::IDLType::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::IDLType::_repository_id_skel, 0},
+ {"_component", &POA_CORBA::IDLType::_component_skel, 0},
+ {"",0,0},{"",0,0},
+ {"_non_existent", &POA_CORBA::IDLType::_non_existent_skel, 0},
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ const char *s = wordlist[key].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[key];
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_IDLType_Perfect_Hash_OpTable tao_CORBA_IDLType_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_IDLType_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_IDLType_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_IDLType_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_IDLType_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_IDLType_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_IDLType_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_IDLType_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::IDLType::IDLType (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_IDLType_optable;
+}
+
+POA_CORBA::IDLType::IDLType (const IDLType& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs)
+{
+}
+
+POA_CORBA::IDLType::~IDLType (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_type_IDLType
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_type_IDLType (
+ POA_CORBA::IDLType * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::TypeCode> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::IDLType * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::IDLType::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::IDLType * const impl =
+ static_cast<POA_CORBA::IDLType *> (servant);
+
+ _get_type_IDLType command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_IDLType_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_IDLType_Upcall_Command (
+ POA_CORBA::IDLType * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::IDLType * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::IDLType::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::IDLType * const impl =
+ static_cast<POA_CORBA::IDLType *> (servant);
+
+ _is_a_IDLType_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_IDLType_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_IDLType_Upcall_Command (
+ POA_CORBA::IDLType * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::IDLType * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::IDLType::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::IDLType * const impl =
+ static_cast<POA_CORBA::IDLType *> (servant);
+
+ _non_existent_IDLType_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_IDLType_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_IDLType_Upcall_Command (
+ POA_CORBA::IDLType * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::IDLType * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::IDLType::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::IDLType * const impl =
+ static_cast<POA_CORBA::IDLType *> (servant);
+
+ _repository_id_IDLType_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::IDLType::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::IDLType * const impl =
+ static_cast<POA_CORBA::IDLType *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_IDLType_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_IDLType_Upcall_Command (
+ POA_CORBA::IDLType * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::IDLType * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::IDLType::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::IDLType * const impl =
+ static_cast<POA_CORBA::IDLType *> (servant);
+
+ _get_component_IDLType_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::IDLType::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::IDLType::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/IDLType:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::IDLType::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::IDLType *
+POA_CORBA::IDLType::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::IDLType STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_IDLType_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_TypedefDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_TypedefDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_TypedefDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 0, 0, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 10, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 0, 0, 37, 37, 37, 37, 37, 37, 37, 0,
+ 0, 37, 37, 37, 37, 37, 10, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_TypedefDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 19,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 5,
+ WORDLIST_SIZE = 23
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::TypedefDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::TypedefDef::_is_a_skel, 0},
+ {"_get_id", &POA_CORBA::TypedefDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::TypedefDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::TypedefDef::describe_skel, 0},
+ {"_get_name", &POA_CORBA::TypedefDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::TypedefDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::TypedefDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::TypedefDef::_interface_skel, 0},
+ {"_get_version", &POA_CORBA::TypedefDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::TypedefDef::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::TypedefDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::TypedefDef::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::TypedefDef::_get_defined_in_skel, 0},
+ {"destroy", &POA_CORBA::TypedefDef::destroy_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::TypedefDef::_get_absolute_name_skel, 0},
+ {"_component", &POA_CORBA::TypedefDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::TypedefDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::TypedefDef::_get_containing_repository_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -9, -3, -13, -2, 4, 5, -1, 50, 8, -45, 12, -1, -46, 15,
+ 16, 17, -1, 18, 19, -1, 20, -6, -2, 21, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 22,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_TypedefDef_Perfect_Hash_OpTable tao_CORBA_TypedefDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_TypedefDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_TypedefDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_TypedefDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_TypedefDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_TypedefDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_TypedefDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_TypedefDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::TypedefDef::TypedefDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_TypedefDef_optable;
+}
+
+POA_CORBA::TypedefDef::TypedefDef (const TypedefDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs)
+{
+}
+
+POA_CORBA::TypedefDef::~TypedefDef (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_TypedefDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_TypedefDef_Upcall_Command (
+ POA_CORBA::TypedefDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::TypedefDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::TypedefDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::TypedefDef * const impl =
+ static_cast<POA_CORBA::TypedefDef *> (servant);
+
+ _is_a_TypedefDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_TypedefDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_TypedefDef_Upcall_Command (
+ POA_CORBA::TypedefDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::TypedefDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::TypedefDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::TypedefDef * const impl =
+ static_cast<POA_CORBA::TypedefDef *> (servant);
+
+ _non_existent_TypedefDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_TypedefDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_TypedefDef_Upcall_Command (
+ POA_CORBA::TypedefDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::TypedefDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::TypedefDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::TypedefDef * const impl =
+ static_cast<POA_CORBA::TypedefDef *> (servant);
+
+ _repository_id_TypedefDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::TypedefDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::TypedefDef * const impl =
+ static_cast<POA_CORBA::TypedefDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_TypedefDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_TypedefDef_Upcall_Command (
+ POA_CORBA::TypedefDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::TypedefDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::TypedefDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::TypedefDef * const impl =
+ static_cast<POA_CORBA::TypedefDef *> (servant);
+
+ _get_component_TypedefDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::TypedefDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/TypedefDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::TypedefDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/TypedefDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::TypedefDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::TypedefDef *
+POA_CORBA::TypedefDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::TypedefDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_TypedefDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+
+#endif /* ifndef */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS.h b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS.h
new file mode 100644
index 00000000000..21a0ef54637
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS.h
@@ -0,0 +1,1261 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:409
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASES_H_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASES_H_
+
+#include /**/ "ace/pre.h"
+
+#include "tao/IFR_Client/IFR_BaseC.h"
+#include "tao/orb_typesS.h"
+#include "tao/Typecode_typesS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Collocation_Proxy_Broker.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/PortableServer/Servant_Base.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_module/module_sh.cpp:49
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class IRObject;
+ typedef IRObject *IRObject_ptr;
+
+ class IRObject
+ : public virtual PortableServer::ServantBase
+ {
+ protected:
+ IRObject (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::IRObject _stub_type;
+ typedef ::CORBA::IRObject_ptr _stub_ptr_type;
+ typedef ::CORBA::IRObject_var _stub_var_type;
+
+ IRObject (const IRObject& rhs);
+ virtual ~IRObject (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::IRObject *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class Contained;
+ typedef Contained *Contained_ptr;
+
+ class Contained
+ : public virtual POA_CORBA::IRObject
+ {
+ protected:
+ Contained (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::Contained _stub_type;
+ typedef ::CORBA::Contained_ptr _stub_ptr_type;
+ typedef ::CORBA::Contained_var _stub_var_type;
+
+ Contained (const Contained& rhs);
+ virtual ~Contained (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::Contained *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class Container;
+ typedef Container *Container_ptr;
+
+ class Container
+ : public virtual POA_CORBA::IRObject
+ {
+ protected:
+ Container (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::Container _stub_type;
+ typedef ::CORBA::Container_ptr _stub_ptr_type;
+ typedef ::CORBA::Container_var _stub_var_type;
+
+ Container (const Container& rhs);
+ virtual ~Container (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::Container *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class IDLType;
+ typedef IDLType *IDLType_ptr;
+
+ class IDLType
+ : public virtual POA_CORBA::IRObject
+ {
+ protected:
+ IDLType (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::IDLType _stub_type;
+ typedef ::CORBA::IDLType_ptr _stub_ptr_type;
+ typedef ::CORBA::IDLType_var _stub_var_type;
+
+ IDLType (const IDLType& rhs);
+ virtual ~IDLType (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::IDLType *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class TypedefDef;
+ typedef TypedefDef *TypedefDef_ptr;
+
+ class TypedefDef
+ : public virtual POA_CORBA::Contained,
+ public virtual POA_CORBA::IDLType
+ {
+ protected:
+ TypedefDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::TypedefDef _stub_type;
+ typedef ::CORBA::TypedefDef_ptr _stub_ptr_type;
+ typedef ::CORBA::TypedefDef_var _stub_var_type;
+
+ TypedefDef (const TypedefDef& rhs);
+ virtual ~TypedefDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::TypedefDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+// TAO_IDL - Generated from
+// be\be_visitor_module/module_sh.cpp:80
+
+} // module CORBA
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:1219
+
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include "IFR_BaseS_T.h"
+
+#if defined (__ACE_INLINE__)
+#include "IFR_BaseS.inl"
+#endif /* defined INLINE */
+
+#include /**/ "ace/post.h"
+#endif /* ifndef */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS.inl b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS.inl
new file mode 100644
index 00000000000..b1c86bdf5b9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS.inl
@@ -0,0 +1,414 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+ACE_INLINE
+void
+POA_CORBA::Contained::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::Contained *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Contained::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::Contained *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::Container::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::Container *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Container::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::Container *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::IDLType::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::IDLType *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::IDLType::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::IDLType *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::TypedefDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::TypedefDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::TypedefDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::TypedefDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::TypedefDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::TypedefDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::TypedefDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::TypedefDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::TypedefDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::TypedefDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::TypedefDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::TypedefDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::TypedefDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::TypedefDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::TypedefDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::TypedefDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::TypedefDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::TypedefDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::TypedefDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::TypedefDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::TypedefDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::TypedefDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::TypedefDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::TypedefDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::TypedefDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::TypedefDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::TypedefDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::TypedefDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS_T.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS_T.cpp
new file mode 100644
index 00000000000..eb850447fe4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS_T.cpp
@@ -0,0 +1,49 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:683
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASES_T_CPP_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASES_T_CPP_
+
+#include "IFR_BaseS_T.h"
+
+#if !defined (__ACE_INLINE__)
+#include "IFR_BaseS_T.inl"
+#endif /* !defined INLINE */
+
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#endif /* ifndef */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS_T.h b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS_T.h
new file mode 100644
index 00000000000..cf226a5d3c5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS_T.h
@@ -0,0 +1,927 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:545
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASES_T_H_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASES_T_H_
+
+#include /**/ "ace/pre.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_root/root_sth.cpp:116
+
+namespace POA_CORBA
+{
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class IRObject_tie : public IRObject
+ {
+ public:
+ /// the T& ctor
+ IRObject_tie (T &t);
+ /// ctor taking a POA
+ IRObject_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ IRObject_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ IRObject_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~IRObject_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ IRObject_tie (const IRObject_tie &);
+ void operator= (const IRObject_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class Contained_tie : public Contained
+ {
+ public:
+ /// the T& ctor
+ Contained_tie (T &t);
+ /// ctor taking a POA
+ Contained_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ Contained_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ Contained_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~Contained_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ Contained_tie (const Contained_tie &);
+ void operator= (const Contained_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class Container_tie : public Container
+ {
+ public:
+ /// the T& ctor
+ Container_tie (T &t);
+ /// ctor taking a POA
+ Container_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ Container_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ Container_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~Container_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ Container_tie (const Container_tie &);
+ void operator= (const Container_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class IDLType_tie : public IDLType
+ {
+ public:
+ /// the T& ctor
+ IDLType_tie (T &t);
+ /// ctor taking a POA
+ IDLType_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ IDLType_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ IDLType_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~IDLType_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ IDLType_tie (const IDLType_tie &);
+ void operator= (const IDLType_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class TypedefDef_tie : public TypedefDef
+ {
+ public:
+ /// the T& ctor
+ TypedefDef_tie (T &t);
+ /// ctor taking a POA
+ TypedefDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ TypedefDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ TypedefDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~TypedefDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ TypedefDef_tie (const TypedefDef_tie &);
+ void operator= (const TypedefDef_tie &);
+ };
+} // module CORBA
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:1322
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "IFR_BaseS_T.inl"
+#endif /* defined INLINE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "IFR_BaseS_T.cpp"
+#endif /* defined REQUIRED SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("IFR_BaseS_T.cpp")
+#endif /* defined REQUIRED PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* ifndef */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS_T.inl b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS_T.inl
new file mode 100644
index 00000000000..9a0772db14d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BaseS_T.inl
@@ -0,0 +1,1512 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::IRObject_tie<T>::IRObject_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::IRObject_tie<T>::IRObject_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::IRObject_tie<T>::IRObject_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::IRObject_tie<T>::IRObject_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::IRObject_tie<T>::~IRObject_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::IRObject_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::IRObject_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::IRObject_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::IRObject_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::IRObject_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::IRObject_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->IRObject::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::IRObject_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::IRObject_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::Contained_tie<T>::Contained_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::Contained_tie<T>::Contained_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::Contained_tie<T>::Contained_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::Contained_tie<T>::Contained_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::Contained_tie<T>::~Contained_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::Contained_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::Contained_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::Contained_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::Contained_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::Contained_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::Contained_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->Contained::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::Contained_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::Contained_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::Contained_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::Contained_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::Contained_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::Contained_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::Contained_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::Contained_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::Contained_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::Contained_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::Contained_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::Contained_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::Contained_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::Container_tie<T>::Container_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::Container_tie<T>::Container_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::Container_tie<T>::Container_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::Container_tie<T>::Container_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::Container_tie<T>::~Container_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::Container_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::Container_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::Container_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::Container_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::Container_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::Container_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->Container::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::Container_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::Container_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::Container_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::Container_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::Container_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::Container_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::Container_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::Container_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::Container_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::Container_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::Container_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::Container_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::Container_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::Container_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::Container_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::Container_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::Container_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::Container_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::Container_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::Container_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::IDLType_tie<T>::IDLType_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::IDLType_tie<T>::IDLType_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::IDLType_tie<T>::IDLType_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::IDLType_tie<T>::IDLType_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::IDLType_tie<T>::~IDLType_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::IDLType_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::IDLType_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::IDLType_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::IDLType_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::IDLType_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::IDLType_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->IDLType::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::IDLType_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::IDLType_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::IDLType_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::TypedefDef_tie<T>::TypedefDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::TypedefDef_tie<T>::TypedefDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::TypedefDef_tie<T>::TypedefDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::TypedefDef_tie<T>::TypedefDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::TypedefDef_tie<T>::~TypedefDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::TypedefDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::TypedefDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::TypedefDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::TypedefDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::TypedefDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::TypedefDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->TypedefDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::TypedefDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::TypedefDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::TypedefDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::TypedefDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::TypedefDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::TypedefDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::TypedefDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::TypedefDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::TypedefDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::TypedefDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::TypedefDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::TypedefDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::TypedefDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::TypedefDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS.cpp
new file mode 100644
index 00000000000..119645a9727
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS.cpp
@@ -0,0 +1,23928 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:603
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASICS_CPP_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASICS_CPP_
+
+
+#include "IFR_BasicS.h"
+#include "tao/PortableServer/Operation_Table_Perfect_Hash.h"
+#include "tao/PortableServer/Upcall_Command.h"
+#include "tao/PortableServer/Upcall_Wrapper.h"
+#include "tao/TAO_Server_Request.h"
+#include "tao/ORB_Core.h"
+#include "tao/Profile.h"
+#include "tao/Stub.h"
+#include "tao/IFR_Client_Adapter.h"
+#include "tao/Object_T.h"
+#include "tao/AnyTypeCode/TypeCode.h"
+#include "tao/AnyTypeCode/DynamicC.h"
+#include "tao/CDR.h"
+#include "tao/operation_details.h"
+#include "tao/PortableInterceptor.h"
+#include "tao/PortableServer/Basic_SArguments.h"
+#include "tao/PortableServer/Object_SArgument_T.h"
+#include "tao/PortableServer/Special_Basic_SArguments.h"
+#include "tao/PortableServer/UB_String_SArguments.h"
+#include "tao/PortableServer/Var_Size_SArgument_T.h"
+#include "tao/PortableServer/Any_SArg_Traits.h"
+#include "tao/PortableServer/TypeCode_SArg_Traits.h"
+#include "tao/PortableServer/Object_SArg_Traits.h"
+#include "tao/PortableServer/get_arg.h"
+#include "tao/Special_Basic_Arguments.h"
+#include "tao/UB_String_Arguments.h"
+#include "tao/Basic_Arguments.h"
+#include "tao/Object_Argument_T.h"
+#include "tao/Special_Basic_Arguments.h"
+#include "tao/UB_String_Arguments.h"
+#include "tao/Var_Size_Argument_T.h"
+#include "tao/AnyTypeCode/Any_Arg_Traits.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/Malloc_Allocator.h"
+
+#if !defined (__ACE_INLINE__)
+#include "IFR_BasicS.inl"
+#endif /* !defined INLINE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_arg_traits.cpp:72
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+// Arg traits specializations.
+namespace TAO
+{
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_DEFINITIONKIND__SARG_TRAITS_)
+#define _CORBA_DEFINITIONKIND__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::DefinitionKind>
+ : public
+ Basic_SArg_Traits_T<
+ CORBA::DefinitionKind,
+ TAO::Any_Insert_Policy_Stream <CORBA::DefinitionKind>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_CONTAINED__SARG_TRAITS_)
+#define _CORBA_CONTAINED__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::Contained>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::Contained_ptr,
+ CORBA::Contained_var,
+ CORBA::Contained_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::Contained_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_REPOSITORY__SARG_TRAITS_)
+#define _CORBA_REPOSITORY__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::Repository>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::Repository_ptr,
+ CORBA::Repository_var,
+ CORBA::Repository_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::Repository_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_CONTAINER__SARG_TRAITS_)
+#define _CORBA_CONTAINER__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::Container>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::Container_ptr,
+ CORBA::Container_var,
+ CORBA::Container_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::Container_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_IDLTYPE__SARG_TRAITS_)
+#define _CORBA_IDLTYPE__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::IDLType>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::IDLType_ptr,
+ CORBA::IDLType_var,
+ CORBA::IDLType_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::IDLType_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_INTERFACEDEFSEQ__SARG_TRAITS_)
+#define _CORBA_INTERFACEDEFSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::InterfaceDefSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::InterfaceDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_STRUCTMEMBERSEQ__SARG_TRAITS_)
+#define _CORBA_STRUCTMEMBERSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::StructMemberSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::StructMemberSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::StructMemberSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_EXCDESCRIPTIONSEQ__SARG_TRAITS_)
+#define _CORBA_EXCDESCRIPTIONSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ExcDescriptionSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ExcDescriptionSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExcDescriptionSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_UNIONMEMBERSEQ__SARG_TRAITS_)
+#define _CORBA_UNIONMEMBERSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::UnionMemberSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::UnionMemberSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::UnionMemberSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_ENUMMEMBERSEQ__SARG_TRAITS_)
+#define _CORBA_ENUMMEMBERSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::EnumMemberSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::EnumMemberSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::EnumMemberSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_PRIMITIVEDEF__SARG_TRAITS_)
+#define _CORBA_PRIMITIVEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::PrimitiveDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::PrimitiveDef_ptr,
+ CORBA::PrimitiveDef_var,
+ CORBA::PrimitiveDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::PrimitiveDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_STRINGDEF__SARG_TRAITS_)
+#define _CORBA_STRINGDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::StringDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::StringDef_ptr,
+ CORBA::StringDef_var,
+ CORBA::StringDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::StringDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_SEQUENCEDEF__SARG_TRAITS_)
+#define _CORBA_SEQUENCEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::SequenceDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::SequenceDef_ptr,
+ CORBA::SequenceDef_var,
+ CORBA::SequenceDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::SequenceDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_ARRAYDEF__SARG_TRAITS_)
+#define _CORBA_ARRAYDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ArrayDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ArrayDef_ptr,
+ CORBA::ArrayDef_var,
+ CORBA::ArrayDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ArrayDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_WSTRINGDEF__SARG_TRAITS_)
+#define _CORBA_WSTRINGDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::WstringDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::WstringDef_ptr,
+ CORBA::WstringDef_var,
+ CORBA::WstringDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::WstringDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_FIXEDDEF__SARG_TRAITS_)
+#define _CORBA_FIXEDDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::FixedDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::FixedDef_ptr,
+ CORBA::FixedDef_var,
+ CORBA::FixedDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::FixedDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_PRIMITIVEKIND__SARG_TRAITS_)
+#define _CORBA_PRIMITIVEKIND__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::PrimitiveKind>
+ : public
+ Basic_SArg_Traits_T<
+ CORBA::PrimitiveKind,
+ TAO::Any_Insert_Policy_Stream <CORBA::PrimitiveKind>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_EXCEPTIONDEFSEQ__SARG_TRAITS_)
+#define _CORBA_EXCEPTIONDEFSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ExceptionDefSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ExceptionDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExceptionDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_ATTRIBUTEMODE__SARG_TRAITS_)
+#define _CORBA_ATTRIBUTEMODE__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::AttributeMode>
+ : public
+ Basic_SArg_Traits_T<
+ CORBA::AttributeMode,
+ TAO::Any_Insert_Policy_Stream <CORBA::AttributeMode>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_ATTRIBUTEDEF__SARG_TRAITS_)
+#define _CORBA_ATTRIBUTEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::AttributeDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::AttributeDef_ptr,
+ CORBA::AttributeDef_var,
+ CORBA::AttributeDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::AttributeDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:859
+
+#if !defined (_CORBA_EXTATTRIBUTEDESCRIPTION__SARG_TRAITS_)
+#define _CORBA_EXTATTRIBUTEDESCRIPTION__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ExtAttributeDescription>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ExtAttributeDescription,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtAttributeDescription>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_EXTATTRIBUTEDEF__SARG_TRAITS_)
+#define _CORBA_EXTATTRIBUTEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ExtAttributeDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ExtAttributeDef_ptr,
+ CORBA::ExtAttributeDef_var,
+ CORBA::ExtAttributeDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtAttributeDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_OPERATIONMODE__SARG_TRAITS_)
+#define _CORBA_OPERATIONMODE__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::OperationMode>
+ : public
+ Basic_SArg_Traits_T<
+ CORBA::OperationMode,
+ TAO::Any_Insert_Policy_Stream <CORBA::OperationMode>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_PARDESCRIPTIONSEQ__SARG_TRAITS_)
+#define _CORBA_PARDESCRIPTIONSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ParDescriptionSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ParDescriptionSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ParDescriptionSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_CONTEXTIDSEQ__SARG_TRAITS_)
+#define _CORBA_CONTEXTIDSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ContextIdSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ContextIdSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ContextIdSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_OPERATIONDEF__SARG_TRAITS_)
+#define _CORBA_OPERATIONDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::OperationDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::OperationDef_ptr,
+ CORBA::OperationDef_var,
+ CORBA::OperationDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::OperationDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:859
+
+#if !defined (_CORBA_INTERFACEDEF_FULLINTERFACEDESCRIPTION__SARG_TRAITS_)
+#define _CORBA_INTERFACEDEF_FULLINTERFACEDESCRIPTION__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::InterfaceDef::FullInterfaceDescription>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::InterfaceDef::FullInterfaceDescription,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceDef::FullInterfaceDescription>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:859
+
+#if !defined (_CORBA_INTERFACEATTREXTENSION_EXTFULLINTERFACEDESCRIPTION__SARG_TRAITS_)
+#define _CORBA_INTERFACEATTREXTENSION_EXTFULLINTERFACEDESCRIPTION__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_arg_traits.cpp:72
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+// Arg traits specializations.
+namespace TAO
+{
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_DEFINITIONKIND__ARG_TRAITS_)
+#define _CORBA_DEFINITIONKIND__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::DefinitionKind>
+ : public
+ Basic_Arg_Traits_T<
+ CORBA::DefinitionKind,
+ TAO::Any_Insert_Policy_Stream <CORBA::DefinitionKind>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_CONTAINED__ARG_TRAITS_)
+#define _CORBA_CONTAINED__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::Contained>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::Contained_ptr,
+ CORBA::Contained_var,
+ CORBA::Contained_out,
+ TAO::Objref_Traits<CORBA::Contained>,
+ TAO::Any_Insert_Policy_Stream <CORBA::Contained_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_REPOSITORY__ARG_TRAITS_)
+#define _CORBA_REPOSITORY__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::Repository>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::Repository_ptr,
+ CORBA::Repository_var,
+ CORBA::Repository_out,
+ TAO::Objref_Traits<CORBA::Repository>,
+ TAO::Any_Insert_Policy_Stream <CORBA::Repository_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_CONTAINER__ARG_TRAITS_)
+#define _CORBA_CONTAINER__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::Container>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::Container_ptr,
+ CORBA::Container_var,
+ CORBA::Container_out,
+ TAO::Objref_Traits<CORBA::Container>,
+ TAO::Any_Insert_Policy_Stream <CORBA::Container_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_IDLTYPE__ARG_TRAITS_)
+#define _CORBA_IDLTYPE__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::IDLType>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::IDLType_ptr,
+ CORBA::IDLType_var,
+ CORBA::IDLType_out,
+ TAO::Objref_Traits<CORBA::IDLType>,
+ TAO::Any_Insert_Policy_Stream <CORBA::IDLType_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_INTERFACEDEFSEQ__ARG_TRAITS_)
+#define _CORBA_INTERFACEDEFSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::InterfaceDefSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::InterfaceDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_STRUCTMEMBERSEQ__ARG_TRAITS_)
+#define _CORBA_STRUCTMEMBERSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::StructMemberSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::StructMemberSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::StructMemberSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_EXCDESCRIPTIONSEQ__ARG_TRAITS_)
+#define _CORBA_EXCDESCRIPTIONSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ExcDescriptionSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ExcDescriptionSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExcDescriptionSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_UNIONMEMBERSEQ__ARG_TRAITS_)
+#define _CORBA_UNIONMEMBERSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::UnionMemberSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::UnionMemberSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::UnionMemberSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_ENUMMEMBERSEQ__ARG_TRAITS_)
+#define _CORBA_ENUMMEMBERSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::EnumMemberSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::EnumMemberSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::EnumMemberSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_PRIMITIVEDEF__ARG_TRAITS_)
+#define _CORBA_PRIMITIVEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::PrimitiveDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::PrimitiveDef_ptr,
+ CORBA::PrimitiveDef_var,
+ CORBA::PrimitiveDef_out,
+ TAO::Objref_Traits<CORBA::PrimitiveDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::PrimitiveDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_STRINGDEF__ARG_TRAITS_)
+#define _CORBA_STRINGDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::StringDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::StringDef_ptr,
+ CORBA::StringDef_var,
+ CORBA::StringDef_out,
+ TAO::Objref_Traits<CORBA::StringDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::StringDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_SEQUENCEDEF__ARG_TRAITS_)
+#define _CORBA_SEQUENCEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::SequenceDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::SequenceDef_ptr,
+ CORBA::SequenceDef_var,
+ CORBA::SequenceDef_out,
+ TAO::Objref_Traits<CORBA::SequenceDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::SequenceDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_ARRAYDEF__ARG_TRAITS_)
+#define _CORBA_ARRAYDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ArrayDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ArrayDef_ptr,
+ CORBA::ArrayDef_var,
+ CORBA::ArrayDef_out,
+ TAO::Objref_Traits<CORBA::ArrayDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ArrayDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_WSTRINGDEF__ARG_TRAITS_)
+#define _CORBA_WSTRINGDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::WstringDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::WstringDef_ptr,
+ CORBA::WstringDef_var,
+ CORBA::WstringDef_out,
+ TAO::Objref_Traits<CORBA::WstringDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::WstringDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_FIXEDDEF__ARG_TRAITS_)
+#define _CORBA_FIXEDDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::FixedDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::FixedDef_ptr,
+ CORBA::FixedDef_var,
+ CORBA::FixedDef_out,
+ TAO::Objref_Traits<CORBA::FixedDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::FixedDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_PRIMITIVEKIND__ARG_TRAITS_)
+#define _CORBA_PRIMITIVEKIND__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::PrimitiveKind>
+ : public
+ Basic_Arg_Traits_T<
+ CORBA::PrimitiveKind,
+ TAO::Any_Insert_Policy_Stream <CORBA::PrimitiveKind>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_EXCEPTIONDEFSEQ__ARG_TRAITS_)
+#define _CORBA_EXCEPTIONDEFSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ExceptionDefSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ExceptionDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExceptionDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_ATTRIBUTEMODE__ARG_TRAITS_)
+#define _CORBA_ATTRIBUTEMODE__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::AttributeMode>
+ : public
+ Basic_Arg_Traits_T<
+ CORBA::AttributeMode,
+ TAO::Any_Insert_Policy_Stream <CORBA::AttributeMode>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_ATTRIBUTEDEF__ARG_TRAITS_)
+#define _CORBA_ATTRIBUTEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::AttributeDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::AttributeDef_ptr,
+ CORBA::AttributeDef_var,
+ CORBA::AttributeDef_out,
+ TAO::Objref_Traits<CORBA::AttributeDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::AttributeDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:859
+
+#if !defined (_CORBA_EXTATTRIBUTEDESCRIPTION__ARG_TRAITS_)
+#define _CORBA_EXTATTRIBUTEDESCRIPTION__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ExtAttributeDescription>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ExtAttributeDescription,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtAttributeDescription>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_EXTATTRIBUTEDEF__ARG_TRAITS_)
+#define _CORBA_EXTATTRIBUTEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ExtAttributeDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ExtAttributeDef_ptr,
+ CORBA::ExtAttributeDef_var,
+ CORBA::ExtAttributeDef_out,
+ TAO::Objref_Traits<CORBA::ExtAttributeDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtAttributeDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_OPERATIONMODE__ARG_TRAITS_)
+#define _CORBA_OPERATIONMODE__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::OperationMode>
+ : public
+ Basic_Arg_Traits_T<
+ CORBA::OperationMode,
+ TAO::Any_Insert_Policy_Stream <CORBA::OperationMode>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_PARDESCRIPTIONSEQ__ARG_TRAITS_)
+#define _CORBA_PARDESCRIPTIONSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ParDescriptionSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ParDescriptionSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ParDescriptionSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_CONTEXTIDSEQ__ARG_TRAITS_)
+#define _CORBA_CONTEXTIDSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ContextIdSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ContextIdSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ContextIdSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_OPERATIONDEF__ARG_TRAITS_)
+#define _CORBA_OPERATIONDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::OperationDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::OperationDef_ptr,
+ CORBA::OperationDef_var,
+ CORBA::OperationDef_out,
+ TAO::Objref_Traits<CORBA::OperationDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::OperationDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:859
+
+#if !defined (_CORBA_INTERFACEDEF_FULLINTERFACEDESCRIPTION__ARG_TRAITS_)
+#define _CORBA_INTERFACEDEF_FULLINTERFACEDESCRIPTION__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::InterfaceDef::FullInterfaceDescription>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::InterfaceDef::FullInterfaceDescription,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceDef::FullInterfaceDescription>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:859
+
+#if !defined (_CORBA_INTERFACEATTREXTENSION_EXTFULLINTERFACEDESCRIPTION__ARG_TRAITS_)
+#define _CORBA_INTERFACEATTREXTENSION_EXTFULLINTERFACEDESCRIPTION__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_Repository_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_Repository_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_Repository_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 27,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 25,
+ 58, 0, 4, 10, 58, 20, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 8, 25, 15,
+ 58, 0, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 30, 0, 58, 58, 58, 25, 0, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58,
+#else
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 27, 58, 25, 58, 0,
+ 4, 10, 58, 20, 58, 58, 58, 58, 8, 25,
+ 15, 58, 0, 58, 58, 30, 0, 58, 58, 58,
+ 25, 0, 58, 58, 58, 58, 58, 58,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_Repository_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 33,
+ MIN_WORD_LENGTH = 5,
+ MAX_WORD_LENGTH = 25,
+ MIN_HASH_VALUE = 11,
+ MAX_HASH_VALUE = 57,
+ HASH_VALUE_RANGE = 47,
+ DUPLICATES = 3,
+ WORDLIST_SIZE = 44
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"",0,0},{"",0,0},
+ {"destroy", &POA_CORBA::Repository::destroy_skel, 0},
+ {"create_array", &POA_CORBA::Repository::create_array_skel, 0},
+ {"create_struct", &POA_CORBA::Repository::create_struct_skel, 0},
+ {"lookup", &POA_CORBA::Repository::lookup_skel, 0},
+ {"create_constant", &POA_CORBA::Repository::create_constant_skel, 0},
+ {"create_fixed", &POA_CORBA::Repository::create_fixed_skel, 0},
+ {"lookup_id", &POA_CORBA::Repository::lookup_id_skel, 0},
+ {"create_value", &POA_CORBA::Repository::create_value_skel, 0},
+ {"create_module", &POA_CORBA::Repository::create_module_skel, 0},
+ {"create_native", &POA_CORBA::Repository::create_native_skel, 0},
+ {"create_sequence", &POA_CORBA::Repository::create_sequence_skel, 0},
+ {"create_interface", &POA_CORBA::Repository::create_interface_skel, 0},
+ {"create_ext_value", &POA_CORBA::Repository::create_ext_value_skel, 0},
+ {"create_union", &POA_CORBA::Repository::create_union_skel, 0},
+ {"lookup_name", &POA_CORBA::Repository::lookup_name_skel, 0},
+ {"create_exception", &POA_CORBA::Repository::create_exception_skel, 0},
+ {"create_local_interface", &POA_CORBA::Repository::create_local_interface_skel, 0},
+ {"create_string", &POA_CORBA::Repository::create_string_skel, 0},
+ {"create_wstring", &POA_CORBA::Repository::create_wstring_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::Repository::create_abstract_interface_skel, 0},
+ {"create_enum", &POA_CORBA::Repository::create_enum_skel, 0},
+ {"_component", &POA_CORBA::Repository::_component_skel, 0},
+ {"contents", &POA_CORBA::Repository::contents_skel, 0},
+ {"_non_existent", &POA_CORBA::Repository::_non_existent_skel, 0},
+ {"create_value_box", &POA_CORBA::Repository::create_value_box_skel, 0},
+ {"create_alias", &POA_CORBA::Repository::create_alias_skel, 0},
+ {"get_primitive", &POA_CORBA::Repository::get_primitive_skel, 0},
+ {"_get_def_kind", &POA_CORBA::Repository::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::Repository::_repository_id_skel, 0},
+ {"_interface", &POA_CORBA::Repository::_interface_skel, 0},
+ {"describe_contents", &POA_CORBA::Repository::describe_contents_skel, 0},
+ {"get_canonical_typecode", &POA_CORBA::Repository::get_canonical_typecode_skel, 0},
+ {"_is_a", &POA_CORBA::Repository::_is_a_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, 12, 13,
+ 14, 15, 16, -19, -2, -22, -2, 17, 18, -63, -1, 21, -64, 24,
+ -1, 25, -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, 34, 35,
+ 36, 37, 38, 39, -1, 40, -1, -1, -1, 41, 42, -1, -1, -1,
+ -1, 43,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_Repository_Perfect_Hash_OpTable tao_CORBA_Repository_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_Repository_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_Repository_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_Repository_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_Repository_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_Repository_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_Repository_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_Repository_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::Repository::Repository (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_Repository_optable;
+}
+
+POA_CORBA::Repository::Repository (const Repository& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs)
+{
+}
+
+POA_CORBA::Repository::~Repository (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class lookup_id_Repository
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline lookup_id_Repository (
+ POA_CORBA::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Contained>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Contained> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_->lookup_id (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Repository::lookup_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Contained>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_search_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_search_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::Repository * const impl =
+ static_cast<POA_CORBA::Repository *> (servant);
+
+ lookup_id_Repository command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class get_canonical_typecode_Repository
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline get_canonical_typecode_Repository (
+ POA_CORBA::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::TypeCode> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::TypeCode>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::TypeCode> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_->get_canonical_typecode (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Repository::get_canonical_typecode_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::TypeCode>::in_arg_val _tao_tc;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_tc
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::Repository * const impl =
+ static_cast<POA_CORBA::Repository *> (servant);
+
+ get_canonical_typecode_Repository command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class get_primitive_Repository
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline get_primitive_Repository (
+ POA_CORBA::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::PrimitiveDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::PrimitiveDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::PrimitiveKind>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::PrimitiveKind> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_->get_primitive (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Repository::get_primitive_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::PrimitiveDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::PrimitiveKind>::in_arg_val _tao_kind;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_kind
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::Repository * const impl =
+ static_cast<POA_CORBA::Repository *> (servant);
+
+ get_primitive_Repository command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_string_Repository
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_string_Repository (
+ POA_CORBA::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::StringDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::StringDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ULong> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_->create_string (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Repository::create_string_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::StringDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_val _tao_bound;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_bound
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::Repository * const impl =
+ static_cast<POA_CORBA::Repository *> (servant);
+
+ create_string_Repository command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_wstring_Repository
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_wstring_Repository (
+ POA_CORBA::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::WstringDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::WstringDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ULong> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_->create_wstring (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Repository::create_wstring_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::WstringDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_val _tao_bound;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_bound
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::Repository * const impl =
+ static_cast<POA_CORBA::Repository *> (servant);
+
+ create_wstring_Repository command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_sequence_Repository
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_sequence_Repository (
+ POA_CORBA::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::SequenceDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::SequenceDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ULong> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ retval =
+ this->servant_->create_sequence (
+ arg_1
+ , arg_2
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Repository::create_sequence_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::SequenceDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_val _tao_bound;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_element_type;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_bound,
+ &_tao_element_type
+ };
+
+ static size_t const nargs = 3;
+
+ POA_CORBA::Repository * const impl =
+ static_cast<POA_CORBA::Repository *> (servant);
+
+ create_sequence_Repository command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_array_Repository
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_array_Repository (
+ POA_CORBA::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ArrayDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ArrayDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ULong> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ retval =
+ this->servant_->create_array (
+ arg_1
+ , arg_2
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Repository::create_array_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ArrayDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_val _tao_length;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_element_type;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_length,
+ &_tao_element_type
+ };
+
+ static size_t const nargs = 3;
+
+ POA_CORBA::Repository * const impl =
+ static_cast<POA_CORBA::Repository *> (servant);
+
+ create_array_Repository command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_fixed_Repository
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_fixed_Repository (
+ POA_CORBA::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::FixedDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::FixedDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::UShort>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::UShort> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Short>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Short> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ retval =
+ this->servant_->create_fixed (
+ arg_1
+ , arg_2
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::Repository::create_fixed_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::FixedDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::UShort>::in_arg_val _tao_digits;
+ TAO::SArg_Traits< ::CORBA::Short>::in_arg_val _tao_scale;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_digits,
+ &_tao_scale
+ };
+
+ static size_t const nargs = 3;
+
+ POA_CORBA::Repository * const impl =
+ static_cast<POA_CORBA::Repository *> (servant);
+
+ create_fixed_Repository command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_Repository_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_Repository_Upcall_Command (
+ POA_CORBA::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::Repository::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::Repository * const impl =
+ static_cast<POA_CORBA::Repository *> (servant);
+
+ _is_a_Repository_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_Repository_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_Repository_Upcall_Command (
+ POA_CORBA::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::Repository::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Repository * const impl =
+ static_cast<POA_CORBA::Repository *> (servant);
+
+ _non_existent_Repository_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_Repository_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_Repository_Upcall_Command (
+ POA_CORBA::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::Repository::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Repository * const impl =
+ static_cast<POA_CORBA::Repository *> (servant);
+
+ _repository_id_Repository_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::Repository::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::Repository * const impl =
+ static_cast<POA_CORBA::Repository *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_Repository_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_Repository_Upcall_Command (
+ POA_CORBA::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::Repository::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::Repository * const impl =
+ static_cast<POA_CORBA::Repository *> (servant);
+
+ _get_component_Repository_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::Repository::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Repository:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::Repository::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/Repository:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::Repository::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::Repository *
+POA_CORBA::Repository::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::Repository STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_Repository_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ModuleDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ModuleDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ModuleDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 20,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 10,
+ 64, 0, 20, 0, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 20, 0, 5,
+ 64, 10, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 15, 30, 64, 64, 64, 10, 5, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64,
+#else
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 20, 64, 10, 64, 0,
+ 20, 0, 64, 64, 64, 64, 64, 64, 20, 0,
+ 5, 64, 10, 64, 64, 15, 30, 64, 64, 64,
+ 10, 5, 64, 64, 64, 64, 64, 64,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ModuleDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 36,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 63,
+ HASH_VALUE_RANGE = 60,
+ DUPLICATES = 6,
+ WORDLIST_SIZE = 40
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ModuleDef::move_skel, 0},
+ {"create_enum", &POA_CORBA::ModuleDef::create_enum_skel, 0},
+ {"create_value", &POA_CORBA::ModuleDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::ModuleDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::ModuleDef::create_native_skel, 0},
+ {"create_interface", &POA_CORBA::ModuleDef::create_interface_skel, 0},
+ {"create_ext_value", &POA_CORBA::ModuleDef::create_ext_value_skel, 0},
+ {"create_union", &POA_CORBA::ModuleDef::create_union_skel, 0},
+ {"create_exception", &POA_CORBA::ModuleDef::create_exception_skel, 0},
+ {"create_local_interface", &POA_CORBA::ModuleDef::create_local_interface_skel, 0},
+ {"contents", &POA_CORBA::ModuleDef::contents_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::ModuleDef::create_abstract_interface_skel, 0},
+ {"create_value_box", &POA_CORBA::ModuleDef::create_value_box_skel, 0},
+ {"create_alias", &POA_CORBA::ModuleDef::create_alias_skel, 0},
+ {"describe", &POA_CORBA::ModuleDef::describe_skel, 0},
+ {"_get_name", &POA_CORBA::ModuleDef::_get_name_skel, 0},
+ {"_set_name", &POA_CORBA::ModuleDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ModuleDef::_interface_skel, 0},
+ {"lookup_name", &POA_CORBA::ModuleDef::lookup_name_skel, 0},
+ {"destroy", &POA_CORBA::ModuleDef::destroy_skel, 0},
+ {"_is_a", &POA_CORBA::ModuleDef::_is_a_skel, 0},
+ {"lookup", &POA_CORBA::ModuleDef::lookup_skel, 0},
+ {"_get_version", &POA_CORBA::ModuleDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ModuleDef::_set_version_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ModuleDef::_get_absolute_name_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ModuleDef::_get_defined_in_skel, 0},
+ {"create_struct", &POA_CORBA::ModuleDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::ModuleDef::create_constant_skel, 0},
+ {"_get_id", &POA_CORBA::ModuleDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ModuleDef::_set_id_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ModuleDef::_get_containing_repository_skel, 0},
+ {"describe_contents", &POA_CORBA::ModuleDef::describe_contents_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ModuleDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ModuleDef::_repository_id_skel, 0},
+ {"_component", &POA_CORBA::ModuleDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::ModuleDef::_non_existent_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, 4, -1, -1, -1, -1, -7, -2, 5, 6, -67,
+ -9, -2, -65, 11, -1, -19, -2, 12, 13, 14, -1, 15, 16, 17,
+ 18, -73, 21, 22, 23, -26, -2, 24, 25, -67, 28, -1, 29, -32,
+ -2, 30, -1, 31, -1, -69, -1, -1, -1, 34, 35, 36, 37, -1,
+ -1, -1, -1, -1, 38, -1, -1, 39,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ModuleDef_Perfect_Hash_OpTable tao_CORBA_ModuleDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_ModuleDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_ModuleDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_ModuleDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_ModuleDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_ModuleDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_ModuleDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_ModuleDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ModuleDef::ModuleDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ModuleDef_optable;
+}
+
+POA_CORBA::ModuleDef::ModuleDef (const ModuleDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs),
+ POA_CORBA::Contained (rhs)
+{
+}
+
+POA_CORBA::ModuleDef::~ModuleDef (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ModuleDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ModuleDef_Upcall_Command (
+ POA_CORBA::ModuleDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ModuleDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ModuleDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ModuleDef * const impl =
+ static_cast<POA_CORBA::ModuleDef *> (servant);
+
+ _is_a_ModuleDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ModuleDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ModuleDef_Upcall_Command (
+ POA_CORBA::ModuleDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ModuleDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ModuleDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ModuleDef * const impl =
+ static_cast<POA_CORBA::ModuleDef *> (servant);
+
+ _non_existent_ModuleDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ModuleDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ModuleDef_Upcall_Command (
+ POA_CORBA::ModuleDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ModuleDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ModuleDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ModuleDef * const impl =
+ static_cast<POA_CORBA::ModuleDef *> (servant);
+
+ _repository_id_ModuleDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ModuleDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ModuleDef * const impl =
+ static_cast<POA_CORBA::ModuleDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ModuleDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ModuleDef_Upcall_Command (
+ POA_CORBA::ModuleDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ModuleDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ModuleDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ModuleDef * const impl =
+ static_cast<POA_CORBA::ModuleDef *> (servant);
+
+ _get_component_ModuleDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ModuleDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ModuleDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ModuleDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ModuleDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ModuleDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ModuleDef *
+POA_CORBA::ModuleDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ModuleDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_ModuleDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ConstantDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ConstantDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ConstantDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 0, 0, 15, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 10, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 0, 0, 15, 37, 37, 37, 37, 37, 37, 0,
+ 0, 37, 37, 37, 37, 37, 10, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ConstantDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 23,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 8,
+ WORDLIST_SIZE = 27
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ConstantDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::ConstantDef::_is_a_skel, 0},
+ {"_get_id", &POA_CORBA::ConstantDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ConstantDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::ConstantDef::describe_skel, 0},
+ {"_get_name", &POA_CORBA::ConstantDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::ConstantDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::ConstantDef::_set_name_skel, 0},
+ {"_get_value", &POA_CORBA::ConstantDef::_get_value_skel, 0},
+ {"_interface", &POA_CORBA::ConstantDef::_interface_skel, 0},
+ {"_set_value", &POA_CORBA::ConstantDef::_set_value_skel, 0},
+ {"_get_version", &POA_CORBA::ConstantDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ConstantDef::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ConstantDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ConstantDef::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ConstantDef::_get_defined_in_skel, 0},
+ {"destroy", &POA_CORBA::ConstantDef::destroy_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ConstantDef::_get_absolute_name_skel, 0},
+ {"_component", &POA_CORBA::ConstantDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::ConstantDef::_non_existent_skel, 0},
+ {"_get_type_def", &POA_CORBA::ConstantDef::_get_type_def_skel, 0},
+ {"_set_type_def", &POA_CORBA::ConstantDef::_set_type_def_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ConstantDef::_get_containing_repository_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -12, -3, -15, -2, 4, 5, -1, 53, 8, 48, -46, -1, -46, 17,
+ 18, 19, -1, 20, 21, -1, 22, -9, -3, 23, -6, -2, -24, -2,
+ -38, -1, -1, -1, -1, -1, -1, -1, 26,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ConstantDef_Perfect_Hash_OpTable tao_CORBA_ConstantDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_ConstantDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_ConstantDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_ConstantDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_ConstantDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_ConstantDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_ConstantDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_ConstantDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ConstantDef::ConstantDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ConstantDef_optable;
+}
+
+POA_CORBA::ConstantDef::ConstantDef (const ConstantDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs)
+{
+}
+
+POA_CORBA::ConstantDef::~ConstantDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_type_ConstantDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_type_ConstantDef (
+ POA_CORBA::ConstantDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::TypeCode> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ConstantDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ConstantDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ConstantDef * const impl =
+ static_cast<POA_CORBA::ConstantDef *> (servant);
+
+ _get_type_ConstantDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_type_def_ConstantDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_type_def_ConstantDef (
+ POA_CORBA::ConstantDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ConstantDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ConstantDef::_get_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ConstantDef * const impl =
+ static_cast<POA_CORBA::ConstantDef *> (servant);
+
+ _get_type_def_ConstantDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_type_def_ConstantDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_type_def_ConstantDef (
+ POA_CORBA::ConstantDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->type_def (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ConstantDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ConstantDef::_set_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_type_def;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_type_def
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ConstantDef * const impl =
+ static_cast<POA_CORBA::ConstantDef *> (servant);
+
+ _set_type_def_ConstantDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_value_ConstantDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_value_ConstantDef (
+ POA_CORBA::ConstantDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Any>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Any> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->value (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ConstantDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ConstantDef::_get_value_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Any>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ConstantDef * const impl =
+ static_cast<POA_CORBA::ConstantDef *> (servant);
+
+ _get_value_ConstantDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_value_ConstantDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_value_ConstantDef (
+ POA_CORBA::ConstantDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Any>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Any> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->value (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ConstantDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ConstantDef::_set_value_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Any>::in_arg_val _tao_value;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_value
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ConstantDef * const impl =
+ static_cast<POA_CORBA::ConstantDef *> (servant);
+
+ _set_value_ConstantDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ConstantDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ConstantDef_Upcall_Command (
+ POA_CORBA::ConstantDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ConstantDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ConstantDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ConstantDef * const impl =
+ static_cast<POA_CORBA::ConstantDef *> (servant);
+
+ _is_a_ConstantDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ConstantDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ConstantDef_Upcall_Command (
+ POA_CORBA::ConstantDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ConstantDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ConstantDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ConstantDef * const impl =
+ static_cast<POA_CORBA::ConstantDef *> (servant);
+
+ _non_existent_ConstantDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ConstantDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ConstantDef_Upcall_Command (
+ POA_CORBA::ConstantDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ConstantDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ConstantDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ConstantDef * const impl =
+ static_cast<POA_CORBA::ConstantDef *> (servant);
+
+ _repository_id_ConstantDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ConstantDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ConstantDef * const impl =
+ static_cast<POA_CORBA::ConstantDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ConstantDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ConstantDef_Upcall_Command (
+ POA_CORBA::ConstantDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ConstantDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ConstantDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ConstantDef * const impl =
+ static_cast<POA_CORBA::ConstantDef *> (servant);
+
+ _get_component_ConstantDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ConstantDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ConstantDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ConstantDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ConstantDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ConstantDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ConstantDef *
+POA_CORBA::ConstantDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ConstantDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_ConstantDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_StructDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_StructDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_StructDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 0,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 0,
+ 61, 25, 8, 0, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 0, 15, 5,
+ 61, 0, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 20, 20, 61, 61, 61, 15, 10, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61,
+#else
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 0, 61, 0, 61, 25,
+ 8, 0, 61, 61, 61, 61, 61, 61, 0, 15,
+ 5, 61, 0, 61, 61, 20, 20, 61, 61, 61,
+ 15, 10, 61, 61, 61, 61, 61, 61,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_StructDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 39,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 5,
+ MAX_HASH_VALUE = 60,
+ HASH_VALUE_RANGE = 56,
+ DUPLICATES = 8,
+ WORDLIST_SIZE = 44
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"_is_a", &POA_CORBA::StructDef::_is_a_skel, 0},
+ {"lookup", &POA_CORBA::StructDef::lookup_skel, 0},
+ {"_get_name", &POA_CORBA::StructDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::StructDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::StructDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::StructDef::_interface_skel, 0},
+ {"lookup_name", &POA_CORBA::StructDef::lookup_name_skel, 0},
+ {"_get_id", &POA_CORBA::StructDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::StructDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::StructDef::describe_skel, 0},
+ {"_get_version", &POA_CORBA::StructDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::StructDef::_set_version_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::StructDef::_get_absolute_name_skel, 0},
+ {"move", &POA_CORBA::StructDef::move_skel, 0},
+ {"_get_defined_in", &POA_CORBA::StructDef::_get_defined_in_skel, 0},
+ {"_get_def_kind", &POA_CORBA::StructDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::StructDef::_repository_id_skel, 0},
+ {"destroy", &POA_CORBA::StructDef::destroy_skel, 0},
+ {"_component", &POA_CORBA::StructDef::_component_skel, 0},
+ {"_get_members", &POA_CORBA::StructDef::_get_members_skel, 0},
+ {"_set_members", &POA_CORBA::StructDef::_set_members_skel, 0},
+ {"_non_existent", &POA_CORBA::StructDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::StructDef::_get_containing_repository_skel, 0},
+ {"create_value", &POA_CORBA::StructDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::StructDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::StructDef::create_native_skel, 0},
+ {"create_interface", &POA_CORBA::StructDef::create_interface_skel, 0},
+ {"create_ext_value", &POA_CORBA::StructDef::create_ext_value_skel, 0},
+ {"create_union", &POA_CORBA::StructDef::create_union_skel, 0},
+ {"describe_contents", &POA_CORBA::StructDef::describe_contents_skel, 0},
+ {"create_exception", &POA_CORBA::StructDef::create_exception_skel, 0},
+ {"create_local_interface", &POA_CORBA::StructDef::create_local_interface_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::StructDef::create_abstract_interface_skel, 0},
+ {"create_enum", &POA_CORBA::StructDef::create_enum_skel, 0},
+ {"contents", &POA_CORBA::StructDef::contents_skel, 0},
+ {"create_value_box", &POA_CORBA::StructDef::create_value_box_skel, 0},
+ {"create_alias", &POA_CORBA::StructDef::create_alias_skel, 0},
+ {"create_struct", &POA_CORBA::StructDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::StructDef::create_constant_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -7, -3, 5, 6, -12, -2, -66, 10, 11, -1, -15,
+ -2, -68, 14, -64, 17, 18, 19, 20, 21, -1, -1, 22, -1, -1,
+ -24, -2, 23, -1, -64, 26, -29, -2, 27, 28, -64, -31, -2, -62,
+ 33, -1, -1, 34, 35, 36, -1, -1, 37, 38, -1, 39, -1, -1,
+ 40, 41, 42, -1, 43,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_StructDef_Perfect_Hash_OpTable tao_CORBA_StructDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_StructDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_StructDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_StructDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_StructDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_StructDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_StructDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_StructDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::StructDef::StructDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_StructDef_optable;
+}
+
+POA_CORBA::StructDef::StructDef (const StructDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs),
+ POA_CORBA::TypedefDef (rhs),
+ POA_CORBA::Container (rhs)
+{
+}
+
+POA_CORBA::StructDef::~StructDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_members_StructDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_members_StructDef (
+ POA_CORBA::StructDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::StructMemberSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::StructMemberSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->members (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::StructDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::StructDef::_get_members_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::StructMemberSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::StructDef * const impl =
+ static_cast<POA_CORBA::StructDef *> (servant);
+
+ _get_members_StructDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_members_StructDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_members_StructDef (
+ POA_CORBA::StructDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::StructMemberSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::StructMemberSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->members (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::StructDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::StructDef::_set_members_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::StructMemberSeq>::in_arg_val _tao_members;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_members
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::StructDef * const impl =
+ static_cast<POA_CORBA::StructDef *> (servant);
+
+ _set_members_StructDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_StructDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_StructDef_Upcall_Command (
+ POA_CORBA::StructDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::StructDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::StructDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::StructDef * const impl =
+ static_cast<POA_CORBA::StructDef *> (servant);
+
+ _is_a_StructDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_StructDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_StructDef_Upcall_Command (
+ POA_CORBA::StructDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::StructDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::StructDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::StructDef * const impl =
+ static_cast<POA_CORBA::StructDef *> (servant);
+
+ _non_existent_StructDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_StructDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_StructDef_Upcall_Command (
+ POA_CORBA::StructDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::StructDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::StructDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::StructDef * const impl =
+ static_cast<POA_CORBA::StructDef *> (servant);
+
+ _repository_id_StructDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::StructDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::StructDef * const impl =
+ static_cast<POA_CORBA::StructDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_StructDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_StructDef_Upcall_Command (
+ POA_CORBA::StructDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::StructDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::StructDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::StructDef * const impl =
+ static_cast<POA_CORBA::StructDef *> (servant);
+
+ _get_component_StructDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::StructDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/TypedefDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/StructDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::StructDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/StructDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::StructDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::StructDef *
+POA_CORBA::StructDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::StructDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_StructDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_UnionDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_UnionDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_UnionDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 0,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 0,
+ 86, 25, 35, 0, 35, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 0, 0, 15,
+ 86, 0, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 20, 45, 86, 86, 86, 5, 25, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86,
+#else
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
+ 86, 86, 86, 86, 86, 0, 86, 0, 86, 25,
+ 35, 0, 35, 86, 86, 86, 86, 86, 0, 0,
+ 15, 86, 0, 86, 86, 20, 45, 86, 86, 86,
+ 5, 25, 86, 86, 86, 86, 86, 86,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_UnionDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 42,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 27,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 85,
+ HASH_VALUE_RANGE = 82,
+ DUPLICATES = 9,
+ WORDLIST_SIZE = 46
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::UnionDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::UnionDef::_is_a_skel, 0},
+ {"lookup", &POA_CORBA::UnionDef::lookup_skel, 0},
+ {"_get_name", &POA_CORBA::UnionDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::UnionDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::UnionDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::UnionDef::_interface_skel, 0},
+ {"lookup_name", &POA_CORBA::UnionDef::lookup_name_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::UnionDef::_get_absolute_name_skel, 0},
+ {"_get_discriminator_type", &POA_CORBA::UnionDef::_get_discriminator_type_skel, 0},
+ {"_get_version", &POA_CORBA::UnionDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::UnionDef::_set_version_skel, 0},
+ {"_get_defined_in", &POA_CORBA::UnionDef::_get_defined_in_skel, 0},
+ {"_get_members", &POA_CORBA::UnionDef::_get_members_skel, 0},
+ {"_set_members", &POA_CORBA::UnionDef::_set_members_skel, 0},
+ {"create_enum", &POA_CORBA::UnionDef::create_enum_skel, 0},
+ {"create_value", &POA_CORBA::UnionDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::UnionDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::UnionDef::create_native_skel, 0},
+ {"create_interface", &POA_CORBA::UnionDef::create_interface_skel, 0},
+ {"create_ext_value", &POA_CORBA::UnionDef::create_ext_value_skel, 0},
+ {"_get_id", &POA_CORBA::UnionDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::UnionDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::UnionDef::describe_skel, 0},
+ {"create_value_box", &POA_CORBA::UnionDef::create_value_box_skel, 0},
+ {"create_local_interface", &POA_CORBA::UnionDef::create_local_interface_skel, 0},
+ {"_get_def_kind", &POA_CORBA::UnionDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::UnionDef::_repository_id_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::UnionDef::create_abstract_interface_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::UnionDef::_get_containing_repository_skel, 0},
+ {"create_union", &POA_CORBA::UnionDef::create_union_skel, 0},
+ {"contents", &POA_CORBA::UnionDef::contents_skel, 0},
+ {"_component", &POA_CORBA::UnionDef::_component_skel, 0},
+ {"create_exception", &POA_CORBA::UnionDef::create_exception_skel, 0},
+ {"create_alias", &POA_CORBA::UnionDef::create_alias_skel, 0},
+ {"_non_existent", &POA_CORBA::UnionDef::_non_existent_skel, 0},
+ {"_get_discriminator_type_def", &POA_CORBA::UnionDef::_get_discriminator_type_def_skel, 0},
+ {"_set_discriminator_type_def", &POA_CORBA::UnionDef::_set_discriminator_type_def_skel, 0},
+ {"destroy", &POA_CORBA::UnionDef::destroy_skel, 0},
+ {"describe_contents", &POA_CORBA::UnionDef::describe_contents_skel, 0},
+ {"create_struct", &POA_CORBA::UnionDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::UnionDef::create_constant_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, 4, 5, 6, -7, -3, -87, 10, 11, -1, -1,
+ -1, -1, -1, -1, 12, -1, -1, -14, -2, 13, -1, -17, -2, -91,
+ -21, -2, 16, -1, -92, -1, -23, -2, 19, 20, -95, -25, -2, -92,
+ -88, 27, -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, -1, 36,
+ 37, 38, 39, -1, -40, -2, -87, -1, -1, -1, -1, 42, -1, -1,
+ -1, -1, 43, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44,
+ -1, 45,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_UnionDef_Perfect_Hash_OpTable tao_CORBA_UnionDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_UnionDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_UnionDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_UnionDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_UnionDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_UnionDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_UnionDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_UnionDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::UnionDef::UnionDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_UnionDef_optable;
+}
+
+POA_CORBA::UnionDef::UnionDef (const UnionDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs),
+ POA_CORBA::TypedefDef (rhs),
+ POA_CORBA::Container (rhs)
+{
+}
+
+POA_CORBA::UnionDef::~UnionDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_discriminator_type_UnionDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_discriminator_type_UnionDef (
+ POA_CORBA::UnionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::TypeCode> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->discriminator_type (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::UnionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::UnionDef::_get_discriminator_type_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::UnionDef * const impl =
+ static_cast<POA_CORBA::UnionDef *> (servant);
+
+ _get_discriminator_type_UnionDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_discriminator_type_def_UnionDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_discriminator_type_def_UnionDef (
+ POA_CORBA::UnionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->discriminator_type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::UnionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::UnionDef::_get_discriminator_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::UnionDef * const impl =
+ static_cast<POA_CORBA::UnionDef *> (servant);
+
+ _get_discriminator_type_def_UnionDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_discriminator_type_def_UnionDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_discriminator_type_def_UnionDef (
+ POA_CORBA::UnionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->discriminator_type_def (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::UnionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::UnionDef::_set_discriminator_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_discriminator_type_def;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_discriminator_type_def
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::UnionDef * const impl =
+ static_cast<POA_CORBA::UnionDef *> (servant);
+
+ _set_discriminator_type_def_UnionDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_members_UnionDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_members_UnionDef (
+ POA_CORBA::UnionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::UnionMemberSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::UnionMemberSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->members (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::UnionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::UnionDef::_get_members_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::UnionMemberSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::UnionDef * const impl =
+ static_cast<POA_CORBA::UnionDef *> (servant);
+
+ _get_members_UnionDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_members_UnionDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_members_UnionDef (
+ POA_CORBA::UnionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::UnionMemberSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::UnionMemberSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->members (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::UnionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::UnionDef::_set_members_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::UnionMemberSeq>::in_arg_val _tao_members;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_members
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::UnionDef * const impl =
+ static_cast<POA_CORBA::UnionDef *> (servant);
+
+ _set_members_UnionDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_UnionDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_UnionDef_Upcall_Command (
+ POA_CORBA::UnionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::UnionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::UnionDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::UnionDef * const impl =
+ static_cast<POA_CORBA::UnionDef *> (servant);
+
+ _is_a_UnionDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_UnionDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_UnionDef_Upcall_Command (
+ POA_CORBA::UnionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::UnionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::UnionDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::UnionDef * const impl =
+ static_cast<POA_CORBA::UnionDef *> (servant);
+
+ _non_existent_UnionDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_UnionDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_UnionDef_Upcall_Command (
+ POA_CORBA::UnionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::UnionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::UnionDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::UnionDef * const impl =
+ static_cast<POA_CORBA::UnionDef *> (servant);
+
+ _repository_id_UnionDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::UnionDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::UnionDef * const impl =
+ static_cast<POA_CORBA::UnionDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_UnionDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_UnionDef_Upcall_Command (
+ POA_CORBA::UnionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::UnionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::UnionDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::UnionDef * const impl =
+ static_cast<POA_CORBA::UnionDef *> (servant);
+
+ _get_component_UnionDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::UnionDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/TypedefDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/UnionDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::UnionDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/UnionDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::UnionDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::UnionDef *
+POA_CORBA::UnionDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::UnionDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_UnionDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_EnumDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_EnumDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_EnumDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 0, 0, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 10, 10, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 0, 0, 37, 37, 37, 37, 37, 37, 37, 0,
+ 0, 37, 37, 37, 37, 10, 10, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_EnumDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 21,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 6,
+ WORDLIST_SIZE = 25
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::EnumDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::EnumDef::_is_a_skel, 0},
+ {"_get_id", &POA_CORBA::EnumDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::EnumDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::EnumDef::describe_skel, 0},
+ {"_get_name", &POA_CORBA::EnumDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::EnumDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::EnumDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::EnumDef::_interface_skel, 0},
+ {"_get_version", &POA_CORBA::EnumDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::EnumDef::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::EnumDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::EnumDef::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::EnumDef::_get_defined_in_skel, 0},
+ {"destroy", &POA_CORBA::EnumDef::destroy_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::EnumDef::_get_absolute_name_skel, 0},
+ {"_component", &POA_CORBA::EnumDef::_component_skel, 0},
+ {"_get_members", &POA_CORBA::EnumDef::_get_members_skel, 0},
+ {"_set_members", &POA_CORBA::EnumDef::_set_members_skel, 0},
+ {"_non_existent", &POA_CORBA::EnumDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::EnumDef::_get_containing_repository_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -13, -2, -21, -2, 4, 5, -1, 55, 8, 51, 12, -1, -48, 15,
+ 16, 17, -1, 18, 19, -1, 20, -1, -56, 23, -9, -3, -6, -2,
+ -1, -1, -1, -1, -1, -1, -1, -1, 24,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_EnumDef_Perfect_Hash_OpTable tao_CORBA_EnumDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_EnumDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_EnumDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_EnumDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_EnumDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_EnumDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_EnumDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_EnumDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::EnumDef::EnumDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_EnumDef_optable;
+}
+
+POA_CORBA::EnumDef::EnumDef (const EnumDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs),
+ POA_CORBA::TypedefDef (rhs)
+{
+}
+
+POA_CORBA::EnumDef::~EnumDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_members_EnumDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_members_EnumDef (
+ POA_CORBA::EnumDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::EnumMemberSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::EnumMemberSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->members (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::EnumDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::EnumDef::_get_members_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::EnumMemberSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::EnumDef * const impl =
+ static_cast<POA_CORBA::EnumDef *> (servant);
+
+ _get_members_EnumDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_members_EnumDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_members_EnumDef (
+ POA_CORBA::EnumDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::EnumMemberSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::EnumMemberSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->members (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::EnumDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::EnumDef::_set_members_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::EnumMemberSeq>::in_arg_val _tao_members;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_members
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::EnumDef * const impl =
+ static_cast<POA_CORBA::EnumDef *> (servant);
+
+ _set_members_EnumDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_EnumDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_EnumDef_Upcall_Command (
+ POA_CORBA::EnumDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::EnumDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::EnumDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::EnumDef * const impl =
+ static_cast<POA_CORBA::EnumDef *> (servant);
+
+ _is_a_EnumDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_EnumDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_EnumDef_Upcall_Command (
+ POA_CORBA::EnumDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::EnumDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::EnumDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::EnumDef * const impl =
+ static_cast<POA_CORBA::EnumDef *> (servant);
+
+ _non_existent_EnumDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_EnumDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_EnumDef_Upcall_Command (
+ POA_CORBA::EnumDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::EnumDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::EnumDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::EnumDef * const impl =
+ static_cast<POA_CORBA::EnumDef *> (servant);
+
+ _repository_id_EnumDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::EnumDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::EnumDef * const impl =
+ static_cast<POA_CORBA::EnumDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_EnumDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_EnumDef_Upcall_Command (
+ POA_CORBA::EnumDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::EnumDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::EnumDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::EnumDef * const impl =
+ static_cast<POA_CORBA::EnumDef *> (servant);
+
+ _get_component_EnumDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::EnumDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/TypedefDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/EnumDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::EnumDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/EnumDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::EnumDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::EnumDef *
+POA_CORBA::EnumDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::EnumDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_EnumDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_AliasDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_AliasDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_AliasDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 0, 0, 0, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 10, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 0, 0, 0, 37, 37, 37, 37, 37, 37, 0,
+ 0, 37, 37, 37, 37, 37, 10, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_AliasDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 21,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 6,
+ WORDLIST_SIZE = 25
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::AliasDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::AliasDef::_is_a_skel, 0},
+ {"_get_id", &POA_CORBA::AliasDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::AliasDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::AliasDef::describe_skel, 0},
+ {"_get_name", &POA_CORBA::AliasDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::AliasDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::AliasDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::AliasDef::_interface_skel, 0},
+ {"_get_version", &POA_CORBA::AliasDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::AliasDef::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::AliasDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::AliasDef::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::AliasDef::_get_defined_in_skel, 0},
+ {"destroy", &POA_CORBA::AliasDef::destroy_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::AliasDef::_get_absolute_name_skel, 0},
+ {"_component", &POA_CORBA::AliasDef::_component_skel, 0},
+ {"_get_original_type_def", &POA_CORBA::AliasDef::_get_original_type_def_skel, 0},
+ {"_set_original_type_def", &POA_CORBA::AliasDef::_set_original_type_def_skel, 0},
+ {"_non_existent", &POA_CORBA::AliasDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::AliasDef::_get_containing_repository_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -13, -2, -21, -2, 4, 5, -1, 55, 8, 51, 12, -1, -48, 15,
+ 16, 17, -1, 18, 19, -1, 20, -1, -56, 23, -9, -3, -6, -2,
+ -1, -1, -1, -1, -1, -1, -1, -1, 24,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_AliasDef_Perfect_Hash_OpTable tao_CORBA_AliasDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_AliasDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_AliasDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_AliasDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_AliasDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_AliasDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_AliasDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_AliasDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::AliasDef::AliasDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_AliasDef_optable;
+}
+
+POA_CORBA::AliasDef::AliasDef (const AliasDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs),
+ POA_CORBA::TypedefDef (rhs)
+{
+}
+
+POA_CORBA::AliasDef::~AliasDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_original_type_def_AliasDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_original_type_def_AliasDef (
+ POA_CORBA::AliasDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->original_type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AliasDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::AliasDef::_get_original_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::AliasDef * const impl =
+ static_cast<POA_CORBA::AliasDef *> (servant);
+
+ _get_original_type_def_AliasDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_original_type_def_AliasDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_original_type_def_AliasDef (
+ POA_CORBA::AliasDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->original_type_def (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AliasDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::AliasDef::_set_original_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_original_type_def;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_original_type_def
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::AliasDef * const impl =
+ static_cast<POA_CORBA::AliasDef *> (servant);
+
+ _set_original_type_def_AliasDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_AliasDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_AliasDef_Upcall_Command (
+ POA_CORBA::AliasDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AliasDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::AliasDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::AliasDef * const impl =
+ static_cast<POA_CORBA::AliasDef *> (servant);
+
+ _is_a_AliasDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_AliasDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_AliasDef_Upcall_Command (
+ POA_CORBA::AliasDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AliasDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::AliasDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::AliasDef * const impl =
+ static_cast<POA_CORBA::AliasDef *> (servant);
+
+ _non_existent_AliasDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_AliasDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_AliasDef_Upcall_Command (
+ POA_CORBA::AliasDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AliasDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::AliasDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::AliasDef * const impl =
+ static_cast<POA_CORBA::AliasDef *> (servant);
+
+ _repository_id_AliasDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::AliasDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::AliasDef * const impl =
+ static_cast<POA_CORBA::AliasDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_AliasDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_AliasDef_Upcall_Command (
+ POA_CORBA::AliasDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AliasDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::AliasDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::AliasDef * const impl =
+ static_cast<POA_CORBA::AliasDef *> (servant);
+
+ _get_component_AliasDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::AliasDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/TypedefDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/AliasDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::AliasDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/AliasDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::AliasDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::AliasDef *
+POA_CORBA::AliasDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::AliasDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_AliasDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_NativeDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_NativeDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_NativeDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 0, 0, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 10, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 0, 0, 37, 37, 37, 37, 37, 37, 37, 0,
+ 0, 37, 37, 37, 37, 37, 10, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_NativeDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 19,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 5,
+ WORDLIST_SIZE = 23
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::NativeDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::NativeDef::_is_a_skel, 0},
+ {"_get_id", &POA_CORBA::NativeDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::NativeDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::NativeDef::describe_skel, 0},
+ {"_get_name", &POA_CORBA::NativeDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::NativeDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::NativeDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::NativeDef::_interface_skel, 0},
+ {"_get_version", &POA_CORBA::NativeDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::NativeDef::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::NativeDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::NativeDef::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::NativeDef::_get_defined_in_skel, 0},
+ {"destroy", &POA_CORBA::NativeDef::destroy_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::NativeDef::_get_absolute_name_skel, 0},
+ {"_component", &POA_CORBA::NativeDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::NativeDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::NativeDef::_get_containing_repository_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -9, -3, -13, -2, 4, 5, -1, 50, 8, -45, 12, -1, -46, 15,
+ 16, 17, -1, 18, 19, -1, 20, -6, -2, 21, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 22,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_NativeDef_Perfect_Hash_OpTable tao_CORBA_NativeDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_NativeDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_NativeDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_NativeDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_NativeDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_NativeDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_NativeDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_NativeDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::NativeDef::NativeDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_NativeDef_optable;
+}
+
+POA_CORBA::NativeDef::NativeDef (const NativeDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs),
+ POA_CORBA::TypedefDef (rhs)
+{
+}
+
+POA_CORBA::NativeDef::~NativeDef (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_NativeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_NativeDef_Upcall_Command (
+ POA_CORBA::NativeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::NativeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::NativeDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::NativeDef * const impl =
+ static_cast<POA_CORBA::NativeDef *> (servant);
+
+ _is_a_NativeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_NativeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_NativeDef_Upcall_Command (
+ POA_CORBA::NativeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::NativeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::NativeDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::NativeDef * const impl =
+ static_cast<POA_CORBA::NativeDef *> (servant);
+
+ _non_existent_NativeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_NativeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_NativeDef_Upcall_Command (
+ POA_CORBA::NativeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::NativeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::NativeDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::NativeDef * const impl =
+ static_cast<POA_CORBA::NativeDef *> (servant);
+
+ _repository_id_NativeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::NativeDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::NativeDef * const impl =
+ static_cast<POA_CORBA::NativeDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_NativeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_NativeDef_Upcall_Command (
+ POA_CORBA::NativeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::NativeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::NativeDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::NativeDef * const impl =
+ static_cast<POA_CORBA::NativeDef *> (servant);
+
+ _get_component_NativeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::NativeDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/TypedefDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/NativeDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::NativeDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/NativeDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::NativeDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::NativeDef *
+POA_CORBA::NativeDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::NativeDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_NativeDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_PrimitiveDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_PrimitiveDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_PrimitiveDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 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, 21, 21, 21, 0,
+ 21, 21, 0, 10, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 5, 21, 21, 21, 21, 0, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21,
+#else
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 0, 21, 0, 21, 21,
+ 0, 10, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 5, 21, 21, 21,
+ 21, 0, 21, 21, 21, 21, 21, 21,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_PrimitiveDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 9,
+ MIN_WORD_LENGTH = 5,
+ MAX_WORD_LENGTH = 14,
+ MIN_HASH_VALUE = 5,
+ MAX_HASH_VALUE = 20,
+ HASH_VALUE_RANGE = 16,
+ DUPLICATES = 0,
+ WORDLIST_SIZE = 14
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"_is_a", &POA_CORBA::PrimitiveDef::_is_a_skel, 0},
+ {"",0,0},
+ {"destroy", &POA_CORBA::PrimitiveDef::destroy_skel, 0},
+ {"",0,0},
+ {"_get_kind", &POA_CORBA::PrimitiveDef::_get_kind_skel, 0},
+ {"",0,0},{"",0,0},{"",0,0},
+ {"_get_def_kind", &POA_CORBA::PrimitiveDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::PrimitiveDef::_repository_id_skel, 0},
+ {"_component", &POA_CORBA::PrimitiveDef::_component_skel, 0},
+ {"",0,0},{"",0,0},
+ {"_non_existent", &POA_CORBA::PrimitiveDef::_non_existent_skel, 0},
+ {"_get_type", &POA_CORBA::PrimitiveDef::_get_type_skel, 0},
+ {"_interface", &POA_CORBA::PrimitiveDef::_interface_skel, 0},
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ const char *s = wordlist[key].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[key];
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_PrimitiveDef_Perfect_Hash_OpTable tao_CORBA_PrimitiveDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_PrimitiveDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_PrimitiveDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_PrimitiveDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_PrimitiveDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_PrimitiveDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_PrimitiveDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_PrimitiveDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::PrimitiveDef::PrimitiveDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_PrimitiveDef_optable;
+}
+
+POA_CORBA::PrimitiveDef::PrimitiveDef (const PrimitiveDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::IDLType (rhs)
+{
+}
+
+POA_CORBA::PrimitiveDef::~PrimitiveDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_kind_PrimitiveDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_kind_PrimitiveDef (
+ POA_CORBA::PrimitiveDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::PrimitiveKind>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::PrimitiveKind> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::PrimitiveDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::PrimitiveDef::_get_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::PrimitiveKind>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::PrimitiveDef * const impl =
+ static_cast<POA_CORBA::PrimitiveDef *> (servant);
+
+ _get_kind_PrimitiveDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_PrimitiveDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_PrimitiveDef_Upcall_Command (
+ POA_CORBA::PrimitiveDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::PrimitiveDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::PrimitiveDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::PrimitiveDef * const impl =
+ static_cast<POA_CORBA::PrimitiveDef *> (servant);
+
+ _is_a_PrimitiveDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_PrimitiveDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_PrimitiveDef_Upcall_Command (
+ POA_CORBA::PrimitiveDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::PrimitiveDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::PrimitiveDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::PrimitiveDef * const impl =
+ static_cast<POA_CORBA::PrimitiveDef *> (servant);
+
+ _non_existent_PrimitiveDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_PrimitiveDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_PrimitiveDef_Upcall_Command (
+ POA_CORBA::PrimitiveDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::PrimitiveDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::PrimitiveDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::PrimitiveDef * const impl =
+ static_cast<POA_CORBA::PrimitiveDef *> (servant);
+
+ _repository_id_PrimitiveDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::PrimitiveDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::PrimitiveDef * const impl =
+ static_cast<POA_CORBA::PrimitiveDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_PrimitiveDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_PrimitiveDef_Upcall_Command (
+ POA_CORBA::PrimitiveDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::PrimitiveDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::PrimitiveDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::PrimitiveDef * const impl =
+ static_cast<POA_CORBA::PrimitiveDef *> (servant);
+
+ _get_component_PrimitiveDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::PrimitiveDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/PrimitiveDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::PrimitiveDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/PrimitiveDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::PrimitiveDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::PrimitiveDef *
+POA_CORBA::PrimitiveDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::PrimitiveDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_PrimitiveDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_StringDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_StringDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_StringDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 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, 21, 21, 21, 0,
+ 21, 21, 0, 10, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 5, 21, 21, 21, 21, 0, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21,
+#else
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 0, 21, 0, 21, 21,
+ 0, 10, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 5, 21, 21, 21,
+ 21, 0, 21, 21, 21, 21, 21, 21,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_StringDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 10,
+ MIN_WORD_LENGTH = 5,
+ MAX_WORD_LENGTH = 14,
+ MIN_HASH_VALUE = 5,
+ MAX_HASH_VALUE = 20,
+ HASH_VALUE_RANGE = 16,
+ DUPLICATES = 2,
+ WORDLIST_SIZE = 15
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"_is_a", &POA_CORBA::StringDef::_is_a_skel, 0},
+ {"destroy", &POA_CORBA::StringDef::destroy_skel, 0},
+ {"_get_bound", &POA_CORBA::StringDef::_get_bound_skel, 0},
+ {"_set_bound", &POA_CORBA::StringDef::_set_bound_skel, 0},
+ {"_get_def_kind", &POA_CORBA::StringDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::StringDef::_repository_id_skel, 0},
+ {"_component", &POA_CORBA::StringDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::StringDef::_non_existent_skel, 0},
+ {"_get_type", &POA_CORBA::StringDef::_get_type_skel, 0},
+ {"_interface", &POA_CORBA::StringDef::_interface_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, -1, 5, -1, 6, -7, -2, -22, -1, -1, 9,
+ 10, 11, -1, -1, 12, 13, 14,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_StringDef_Perfect_Hash_OpTable tao_CORBA_StringDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_StringDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_StringDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_StringDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_StringDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_StringDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_StringDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_StringDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::StringDef::StringDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_StringDef_optable;
+}
+
+POA_CORBA::StringDef::StringDef (const StringDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::IDLType (rhs)
+{
+}
+
+POA_CORBA::StringDef::~StringDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_bound_StringDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_bound_StringDef (
+ POA_CORBA::StringDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ULong>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ULong> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->bound (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::StringDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::StringDef::_get_bound_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ULong>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::StringDef * const impl =
+ static_cast<POA_CORBA::StringDef *> (servant);
+
+ _get_bound_StringDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_bound_StringDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_bound_StringDef (
+ POA_CORBA::StringDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ULong> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->bound (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::StringDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::StringDef::_set_bound_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_val _tao_bound;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_bound
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::StringDef * const impl =
+ static_cast<POA_CORBA::StringDef *> (servant);
+
+ _set_bound_StringDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_StringDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_StringDef_Upcall_Command (
+ POA_CORBA::StringDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::StringDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::StringDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::StringDef * const impl =
+ static_cast<POA_CORBA::StringDef *> (servant);
+
+ _is_a_StringDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_StringDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_StringDef_Upcall_Command (
+ POA_CORBA::StringDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::StringDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::StringDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::StringDef * const impl =
+ static_cast<POA_CORBA::StringDef *> (servant);
+
+ _non_existent_StringDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_StringDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_StringDef_Upcall_Command (
+ POA_CORBA::StringDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::StringDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::StringDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::StringDef * const impl =
+ static_cast<POA_CORBA::StringDef *> (servant);
+
+ _repository_id_StringDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::StringDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::StringDef * const impl =
+ static_cast<POA_CORBA::StringDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_StringDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_StringDef_Upcall_Command (
+ POA_CORBA::StringDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::StringDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::StringDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::StringDef * const impl =
+ static_cast<POA_CORBA::StringDef *> (servant);
+
+ _get_component_StringDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::StringDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/StringDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::StringDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/StringDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::StringDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::StringDef *
+POA_CORBA::StringDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::StringDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_StringDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_WstringDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_WstringDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_WstringDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 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, 21, 21, 21, 0,
+ 21, 21, 0, 10, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 5, 21, 21, 21, 21, 0, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21,
+#else
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 0, 21, 0, 21, 21,
+ 0, 10, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 5, 21, 21, 21,
+ 21, 0, 21, 21, 21, 21, 21, 21,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_WstringDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 10,
+ MIN_WORD_LENGTH = 5,
+ MAX_WORD_LENGTH = 14,
+ MIN_HASH_VALUE = 5,
+ MAX_HASH_VALUE = 20,
+ HASH_VALUE_RANGE = 16,
+ DUPLICATES = 2,
+ WORDLIST_SIZE = 15
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"_is_a", &POA_CORBA::WstringDef::_is_a_skel, 0},
+ {"destroy", &POA_CORBA::WstringDef::destroy_skel, 0},
+ {"_get_bound", &POA_CORBA::WstringDef::_get_bound_skel, 0},
+ {"_set_bound", &POA_CORBA::WstringDef::_set_bound_skel, 0},
+ {"_get_def_kind", &POA_CORBA::WstringDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::WstringDef::_repository_id_skel, 0},
+ {"_component", &POA_CORBA::WstringDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::WstringDef::_non_existent_skel, 0},
+ {"_get_type", &POA_CORBA::WstringDef::_get_type_skel, 0},
+ {"_interface", &POA_CORBA::WstringDef::_interface_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, -1, 5, -1, 6, -7, -2, -22, -1, -1, 9,
+ 10, 11, -1, -1, 12, 13, 14,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_WstringDef_Perfect_Hash_OpTable tao_CORBA_WstringDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_WstringDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_WstringDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_WstringDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_WstringDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_WstringDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_WstringDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_WstringDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::WstringDef::WstringDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_WstringDef_optable;
+}
+
+POA_CORBA::WstringDef::WstringDef (const WstringDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::IDLType (rhs)
+{
+}
+
+POA_CORBA::WstringDef::~WstringDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_bound_WstringDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_bound_WstringDef (
+ POA_CORBA::WstringDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ULong>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ULong> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->bound (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::WstringDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::WstringDef::_get_bound_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ULong>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::WstringDef * const impl =
+ static_cast<POA_CORBA::WstringDef *> (servant);
+
+ _get_bound_WstringDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_bound_WstringDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_bound_WstringDef (
+ POA_CORBA::WstringDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ULong> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->bound (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::WstringDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::WstringDef::_set_bound_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_val _tao_bound;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_bound
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::WstringDef * const impl =
+ static_cast<POA_CORBA::WstringDef *> (servant);
+
+ _set_bound_WstringDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_WstringDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_WstringDef_Upcall_Command (
+ POA_CORBA::WstringDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::WstringDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::WstringDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::WstringDef * const impl =
+ static_cast<POA_CORBA::WstringDef *> (servant);
+
+ _is_a_WstringDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_WstringDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_WstringDef_Upcall_Command (
+ POA_CORBA::WstringDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::WstringDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::WstringDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::WstringDef * const impl =
+ static_cast<POA_CORBA::WstringDef *> (servant);
+
+ _non_existent_WstringDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_WstringDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_WstringDef_Upcall_Command (
+ POA_CORBA::WstringDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::WstringDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::WstringDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::WstringDef * const impl =
+ static_cast<POA_CORBA::WstringDef *> (servant);
+
+ _repository_id_WstringDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::WstringDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::WstringDef * const impl =
+ static_cast<POA_CORBA::WstringDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_WstringDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_WstringDef_Upcall_Command (
+ POA_CORBA::WstringDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::WstringDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::WstringDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::WstringDef * const impl =
+ static_cast<POA_CORBA::WstringDef *> (servant);
+
+ _get_component_WstringDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::WstringDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/WstringDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::WstringDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/WstringDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::WstringDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::WstringDef *
+POA_CORBA::WstringDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::WstringDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_WstringDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_SequenceDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_SequenceDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_SequenceDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 0,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 0,
+ 28, 28, 0, 10, 0, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 5, 28, 28, 28, 28, 0, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28,
+#else
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 0, 28, 0, 28, 28,
+ 0, 10, 0, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 5, 28, 28, 28,
+ 28, 0, 28, 28, 28, 28, 28, 28,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_SequenceDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 13,
+ MIN_WORD_LENGTH = 5,
+ MAX_WORD_LENGTH = 21,
+ MIN_HASH_VALUE = 5,
+ MAX_HASH_VALUE = 27,
+ HASH_VALUE_RANGE = 23,
+ DUPLICATES = 3,
+ WORDLIST_SIZE = 18
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"_is_a", &POA_CORBA::SequenceDef::_is_a_skel, 0},
+ {"destroy", &POA_CORBA::SequenceDef::destroy_skel, 0},
+ {"_get_bound", &POA_CORBA::SequenceDef::_get_bound_skel, 0},
+ {"_set_bound", &POA_CORBA::SequenceDef::_set_bound_skel, 0},
+ {"_get_def_kind", &POA_CORBA::SequenceDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::SequenceDef::_repository_id_skel, 0},
+ {"_component", &POA_CORBA::SequenceDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::SequenceDef::_non_existent_skel, 0},
+ {"_get_type", &POA_CORBA::SequenceDef::_get_type_skel, 0},
+ {"_interface", &POA_CORBA::SequenceDef::_interface_skel, 0},
+ {"_get_element_type_def", &POA_CORBA::SequenceDef::_get_element_type_def_skel, 0},
+ {"_set_element_type_def", &POA_CORBA::SequenceDef::_set_element_type_def_skel, 0},
+ {"_get_element_type", &POA_CORBA::SequenceDef::_get_element_type_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, -1, 5, -1, 6, -7, -2, -29, -1, -1, 9,
+ 10, 11, -15, -2, 12, 13, 14, -32, -1, -1, -1, -1, -1, 17,
+
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_SequenceDef_Perfect_Hash_OpTable tao_CORBA_SequenceDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_SequenceDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_SequenceDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_SequenceDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_SequenceDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_SequenceDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_SequenceDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_SequenceDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::SequenceDef::SequenceDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_SequenceDef_optable;
+}
+
+POA_CORBA::SequenceDef::SequenceDef (const SequenceDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::IDLType (rhs)
+{
+}
+
+POA_CORBA::SequenceDef::~SequenceDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_bound_SequenceDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_bound_SequenceDef (
+ POA_CORBA::SequenceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ULong>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ULong> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->bound (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::SequenceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::SequenceDef::_get_bound_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ULong>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::SequenceDef * const impl =
+ static_cast<POA_CORBA::SequenceDef *> (servant);
+
+ _get_bound_SequenceDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_bound_SequenceDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_bound_SequenceDef (
+ POA_CORBA::SequenceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ULong> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->bound (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::SequenceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::SequenceDef::_set_bound_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_val _tao_bound;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_bound
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::SequenceDef * const impl =
+ static_cast<POA_CORBA::SequenceDef *> (servant);
+
+ _set_bound_SequenceDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_element_type_SequenceDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_element_type_SequenceDef (
+ POA_CORBA::SequenceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::TypeCode> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->element_type (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::SequenceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::SequenceDef::_get_element_type_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::SequenceDef * const impl =
+ static_cast<POA_CORBA::SequenceDef *> (servant);
+
+ _get_element_type_SequenceDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_element_type_def_SequenceDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_element_type_def_SequenceDef (
+ POA_CORBA::SequenceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->element_type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::SequenceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::SequenceDef::_get_element_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::SequenceDef * const impl =
+ static_cast<POA_CORBA::SequenceDef *> (servant);
+
+ _get_element_type_def_SequenceDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_element_type_def_SequenceDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_element_type_def_SequenceDef (
+ POA_CORBA::SequenceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->element_type_def (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::SequenceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::SequenceDef::_set_element_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_element_type_def;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_element_type_def
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::SequenceDef * const impl =
+ static_cast<POA_CORBA::SequenceDef *> (servant);
+
+ _set_element_type_def_SequenceDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_SequenceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_SequenceDef_Upcall_Command (
+ POA_CORBA::SequenceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::SequenceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::SequenceDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::SequenceDef * const impl =
+ static_cast<POA_CORBA::SequenceDef *> (servant);
+
+ _is_a_SequenceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_SequenceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_SequenceDef_Upcall_Command (
+ POA_CORBA::SequenceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::SequenceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::SequenceDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::SequenceDef * const impl =
+ static_cast<POA_CORBA::SequenceDef *> (servant);
+
+ _non_existent_SequenceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_SequenceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_SequenceDef_Upcall_Command (
+ POA_CORBA::SequenceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::SequenceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::SequenceDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::SequenceDef * const impl =
+ static_cast<POA_CORBA::SequenceDef *> (servant);
+
+ _repository_id_SequenceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::SequenceDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::SequenceDef * const impl =
+ static_cast<POA_CORBA::SequenceDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_SequenceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_SequenceDef_Upcall_Command (
+ POA_CORBA::SequenceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::SequenceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::SequenceDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::SequenceDef * const impl =
+ static_cast<POA_CORBA::SequenceDef *> (servant);
+
+ _get_component_SequenceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::SequenceDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/SequenceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::SequenceDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/SequenceDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::SequenceDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::SequenceDef *
+POA_CORBA::SequenceDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::SequenceDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_SequenceDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ArrayDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ArrayDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ArrayDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 0,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 0,
+ 22, 22, 0, 0, 0, 22, 0, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 5, 22, 22, 22, 22, 0, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22,
+#else
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 0, 22, 0, 22, 22,
+ 0, 0, 0, 22, 0, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 5, 22, 22, 22,
+ 22, 0, 22, 22, 22, 22, 22, 22,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ArrayDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 13,
+ MIN_WORD_LENGTH = 5,
+ MAX_WORD_LENGTH = 21,
+ MIN_HASH_VALUE = 5,
+ MAX_HASH_VALUE = 21,
+ HASH_VALUE_RANGE = 17,
+ DUPLICATES = 3,
+ WORDLIST_SIZE = 18
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"_is_a", &POA_CORBA::ArrayDef::_is_a_skel, 0},
+ {"destroy", &POA_CORBA::ArrayDef::destroy_skel, 0},
+ {"_get_type", &POA_CORBA::ArrayDef::_get_type_skel, 0},
+ {"_interface", &POA_CORBA::ArrayDef::_interface_skel, 0},
+ {"_get_length", &POA_CORBA::ArrayDef::_get_length_skel, 0},
+ {"_set_length", &POA_CORBA::ArrayDef::_set_length_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ArrayDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ArrayDef::_repository_id_skel, 0},
+ {"_component", &POA_CORBA::ArrayDef::_component_skel, 0},
+ {"_get_element_type", &POA_CORBA::ArrayDef::_get_element_type_skel, 0},
+ {"_non_existent", &POA_CORBA::ArrayDef::_non_existent_skel, 0},
+ {"_get_element_type_def", &POA_CORBA::ArrayDef::_get_element_type_def_skel, 0},
+ {"_set_element_type_def", &POA_CORBA::ArrayDef::_set_element_type_def_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -9, -2, 5, -1, 6, -1, 7, 8, -29, -1, 11,
+ 12, 13, -1, 14, 15, -16, -2, -23,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ArrayDef_Perfect_Hash_OpTable tao_CORBA_ArrayDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_ArrayDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_ArrayDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_ArrayDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_ArrayDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_ArrayDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_ArrayDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_ArrayDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ArrayDef::ArrayDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ArrayDef_optable;
+}
+
+POA_CORBA::ArrayDef::ArrayDef (const ArrayDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::IDLType (rhs)
+{
+}
+
+POA_CORBA::ArrayDef::~ArrayDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_length_ArrayDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_length_ArrayDef (
+ POA_CORBA::ArrayDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ULong>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ULong> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->length (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ArrayDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ArrayDef::_get_length_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ULong>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ArrayDef * const impl =
+ static_cast<POA_CORBA::ArrayDef *> (servant);
+
+ _get_length_ArrayDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_length_ArrayDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_length_ArrayDef (
+ POA_CORBA::ArrayDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ULong> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->length (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ArrayDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ArrayDef::_set_length_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ULong>::in_arg_val _tao_length;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_length
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ArrayDef * const impl =
+ static_cast<POA_CORBA::ArrayDef *> (servant);
+
+ _set_length_ArrayDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_element_type_ArrayDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_element_type_ArrayDef (
+ POA_CORBA::ArrayDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::TypeCode> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->element_type (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ArrayDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ArrayDef::_get_element_type_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ArrayDef * const impl =
+ static_cast<POA_CORBA::ArrayDef *> (servant);
+
+ _get_element_type_ArrayDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_element_type_def_ArrayDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_element_type_def_ArrayDef (
+ POA_CORBA::ArrayDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->element_type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ArrayDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ArrayDef::_get_element_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ArrayDef * const impl =
+ static_cast<POA_CORBA::ArrayDef *> (servant);
+
+ _get_element_type_def_ArrayDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_element_type_def_ArrayDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_element_type_def_ArrayDef (
+ POA_CORBA::ArrayDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->element_type_def (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ArrayDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ArrayDef::_set_element_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_element_type_def;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_element_type_def
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ArrayDef * const impl =
+ static_cast<POA_CORBA::ArrayDef *> (servant);
+
+ _set_element_type_def_ArrayDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ArrayDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ArrayDef_Upcall_Command (
+ POA_CORBA::ArrayDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ArrayDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ArrayDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ArrayDef * const impl =
+ static_cast<POA_CORBA::ArrayDef *> (servant);
+
+ _is_a_ArrayDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ArrayDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ArrayDef_Upcall_Command (
+ POA_CORBA::ArrayDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ArrayDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ArrayDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ArrayDef * const impl =
+ static_cast<POA_CORBA::ArrayDef *> (servant);
+
+ _non_existent_ArrayDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ArrayDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ArrayDef_Upcall_Command (
+ POA_CORBA::ArrayDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ArrayDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ArrayDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ArrayDef * const impl =
+ static_cast<POA_CORBA::ArrayDef *> (servant);
+
+ _repository_id_ArrayDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ArrayDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ArrayDef * const impl =
+ static_cast<POA_CORBA::ArrayDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ArrayDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ArrayDef_Upcall_Command (
+ POA_CORBA::ArrayDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ArrayDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ArrayDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ArrayDef * const impl =
+ static_cast<POA_CORBA::ArrayDef *> (servant);
+
+ _get_component_ArrayDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ArrayDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ArrayDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ArrayDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ArrayDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ArrayDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ArrayDef *
+POA_CORBA::ArrayDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ArrayDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_ArrayDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ExceptionDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ExceptionDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ExceptionDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 0,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 0,
+ 61, 25, 8, 0, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 0, 15, 5,
+ 61, 0, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 20, 20, 61, 61, 61, 15, 10, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61,
+#else
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 0, 61, 0, 61, 25,
+ 8, 0, 61, 61, 61, 61, 61, 61, 0, 15,
+ 5, 61, 0, 61, 61, 20, 20, 61, 61, 61,
+ 15, 10, 61, 61, 61, 61, 61, 61,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ExceptionDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 39,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 5,
+ MAX_HASH_VALUE = 60,
+ HASH_VALUE_RANGE = 56,
+ DUPLICATES = 8,
+ WORDLIST_SIZE = 44
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"_is_a", &POA_CORBA::ExceptionDef::_is_a_skel, 0},
+ {"lookup", &POA_CORBA::ExceptionDef::lookup_skel, 0},
+ {"_get_name", &POA_CORBA::ExceptionDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::ExceptionDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::ExceptionDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ExceptionDef::_interface_skel, 0},
+ {"lookup_name", &POA_CORBA::ExceptionDef::lookup_name_skel, 0},
+ {"_get_id", &POA_CORBA::ExceptionDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ExceptionDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::ExceptionDef::describe_skel, 0},
+ {"_get_version", &POA_CORBA::ExceptionDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ExceptionDef::_set_version_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ExceptionDef::_get_absolute_name_skel, 0},
+ {"move", &POA_CORBA::ExceptionDef::move_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ExceptionDef::_get_defined_in_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ExceptionDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ExceptionDef::_repository_id_skel, 0},
+ {"destroy", &POA_CORBA::ExceptionDef::destroy_skel, 0},
+ {"_component", &POA_CORBA::ExceptionDef::_component_skel, 0},
+ {"_get_members", &POA_CORBA::ExceptionDef::_get_members_skel, 0},
+ {"_set_members", &POA_CORBA::ExceptionDef::_set_members_skel, 0},
+ {"_non_existent", &POA_CORBA::ExceptionDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ExceptionDef::_get_containing_repository_skel, 0},
+ {"create_value", &POA_CORBA::ExceptionDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::ExceptionDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::ExceptionDef::create_native_skel, 0},
+ {"create_interface", &POA_CORBA::ExceptionDef::create_interface_skel, 0},
+ {"create_ext_value", &POA_CORBA::ExceptionDef::create_ext_value_skel, 0},
+ {"create_union", &POA_CORBA::ExceptionDef::create_union_skel, 0},
+ {"describe_contents", &POA_CORBA::ExceptionDef::describe_contents_skel, 0},
+ {"create_exception", &POA_CORBA::ExceptionDef::create_exception_skel, 0},
+ {"create_local_interface", &POA_CORBA::ExceptionDef::create_local_interface_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::ExceptionDef::create_abstract_interface_skel, 0},
+ {"create_enum", &POA_CORBA::ExceptionDef::create_enum_skel, 0},
+ {"contents", &POA_CORBA::ExceptionDef::contents_skel, 0},
+ {"create_value_box", &POA_CORBA::ExceptionDef::create_value_box_skel, 0},
+ {"create_alias", &POA_CORBA::ExceptionDef::create_alias_skel, 0},
+ {"create_struct", &POA_CORBA::ExceptionDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::ExceptionDef::create_constant_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -7, -3, 5, 6, -12, -2, -66, 10, 11, -1, -15,
+ -2, -68, 14, -64, 17, 18, 19, 20, 21, -1, -1, 22, -1, -1,
+ -24, -2, 23, -1, -64, 26, -29, -2, 27, 28, -64, -31, -2, -62,
+ 33, -1, -1, 34, 35, 36, -1, -1, 37, 38, -1, 39, -1, -1,
+ 40, 41, 42, -1, 43,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ExceptionDef_Perfect_Hash_OpTable tao_CORBA_ExceptionDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_ExceptionDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_ExceptionDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_ExceptionDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_ExceptionDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_ExceptionDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_ExceptionDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_ExceptionDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ExceptionDef::ExceptionDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ExceptionDef_optable;
+}
+
+POA_CORBA::ExceptionDef::ExceptionDef (const ExceptionDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::Container (rhs)
+{
+}
+
+POA_CORBA::ExceptionDef::~ExceptionDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_type_ExceptionDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_type_ExceptionDef (
+ POA_CORBA::ExceptionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::TypeCode> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExceptionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ExceptionDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExceptionDef * const impl =
+ static_cast<POA_CORBA::ExceptionDef *> (servant);
+
+ _get_type_ExceptionDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_members_ExceptionDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_members_ExceptionDef (
+ POA_CORBA::ExceptionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::StructMemberSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::StructMemberSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->members (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExceptionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ExceptionDef::_get_members_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::StructMemberSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExceptionDef * const impl =
+ static_cast<POA_CORBA::ExceptionDef *> (servant);
+
+ _get_members_ExceptionDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_members_ExceptionDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_members_ExceptionDef (
+ POA_CORBA::ExceptionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::StructMemberSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::StructMemberSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->members (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExceptionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ExceptionDef::_set_members_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::StructMemberSeq>::in_arg_val _tao_members;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_members
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ExceptionDef * const impl =
+ static_cast<POA_CORBA::ExceptionDef *> (servant);
+
+ _set_members_ExceptionDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ExceptionDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ExceptionDef_Upcall_Command (
+ POA_CORBA::ExceptionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExceptionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExceptionDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ExceptionDef * const impl =
+ static_cast<POA_CORBA::ExceptionDef *> (servant);
+
+ _is_a_ExceptionDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ExceptionDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ExceptionDef_Upcall_Command (
+ POA_CORBA::ExceptionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExceptionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExceptionDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExceptionDef * const impl =
+ static_cast<POA_CORBA::ExceptionDef *> (servant);
+
+ _non_existent_ExceptionDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ExceptionDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ExceptionDef_Upcall_Command (
+ POA_CORBA::ExceptionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExceptionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExceptionDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExceptionDef * const impl =
+ static_cast<POA_CORBA::ExceptionDef *> (servant);
+
+ _repository_id_ExceptionDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ExceptionDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ExceptionDef * const impl =
+ static_cast<POA_CORBA::ExceptionDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ExceptionDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ExceptionDef_Upcall_Command (
+ POA_CORBA::ExceptionDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExceptionDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExceptionDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExceptionDef * const impl =
+ static_cast<POA_CORBA::ExceptionDef *> (servant);
+
+ _get_component_ExceptionDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ExceptionDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ExceptionDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ExceptionDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ExceptionDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ExceptionDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ExceptionDef *
+POA_CORBA::ExceptionDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ExceptionDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_ExceptionDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_AttributeDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_AttributeDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_AttributeDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 0, 0, 15, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 10, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 0, 0, 15, 37, 37, 37, 37, 37, 37, 0,
+ 0, 37, 37, 37, 37, 37, 10, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_AttributeDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 23,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 8,
+ WORDLIST_SIZE = 27
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::AttributeDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::AttributeDef::_is_a_skel, 0},
+ {"_get_id", &POA_CORBA::AttributeDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::AttributeDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::AttributeDef::describe_skel, 0},
+ {"_get_name", &POA_CORBA::AttributeDef::_get_name_skel, 0},
+ {"_set_mode", &POA_CORBA::AttributeDef::_set_mode_skel, 0},
+ {"_get_mode", &POA_CORBA::AttributeDef::_get_mode_skel, 0},
+ {"_get_type", &POA_CORBA::AttributeDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::AttributeDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::AttributeDef::_interface_skel, 0},
+ {"_get_version", &POA_CORBA::AttributeDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::AttributeDef::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::AttributeDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::AttributeDef::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::AttributeDef::_get_defined_in_skel, 0},
+ {"destroy", &POA_CORBA::AttributeDef::destroy_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::AttributeDef::_get_absolute_name_skel, 0},
+ {"_component", &POA_CORBA::AttributeDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::AttributeDef::_non_existent_skel, 0},
+ {"_get_type_def", &POA_CORBA::AttributeDef::_get_type_def_skel, 0},
+ {"_set_type_def", &POA_CORBA::AttributeDef::_set_type_def_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::AttributeDef::_get_containing_repository_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -9, -5, -15, -2, 4, 5, -1, 50, 8, -45, 14, -1, -46, 17,
+ 18, 19, -1, 20, 21, -1, 22, -6, -2, 23, -1, -1, -24, -2,
+ -38, -1, -1, -1, -1, -1, -1, -1, 26,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_AttributeDef_Perfect_Hash_OpTable tao_CORBA_AttributeDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_AttributeDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_AttributeDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_AttributeDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_AttributeDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_AttributeDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_AttributeDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_AttributeDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::AttributeDef::AttributeDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_AttributeDef_optable;
+}
+
+POA_CORBA::AttributeDef::AttributeDef (const AttributeDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs)
+{
+}
+
+POA_CORBA::AttributeDef::~AttributeDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_type_AttributeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_type_AttributeDef (
+ POA_CORBA::AttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::TypeCode> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::AttributeDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::AttributeDef * const impl =
+ static_cast<POA_CORBA::AttributeDef *> (servant);
+
+ _get_type_AttributeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_type_def_AttributeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_type_def_AttributeDef (
+ POA_CORBA::AttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::AttributeDef::_get_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::AttributeDef * const impl =
+ static_cast<POA_CORBA::AttributeDef *> (servant);
+
+ _get_type_def_AttributeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_type_def_AttributeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_type_def_AttributeDef (
+ POA_CORBA::AttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->type_def (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::AttributeDef::_set_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_type_def;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_type_def
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::AttributeDef * const impl =
+ static_cast<POA_CORBA::AttributeDef *> (servant);
+
+ _set_type_def_AttributeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_mode_AttributeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_mode_AttributeDef (
+ POA_CORBA::AttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::AttributeMode>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::AttributeMode> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->mode (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::AttributeDef::_get_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::AttributeMode>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::AttributeDef * const impl =
+ static_cast<POA_CORBA::AttributeDef *> (servant);
+
+ _get_mode_AttributeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_mode_AttributeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_mode_AttributeDef (
+ POA_CORBA::AttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::AttributeMode>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::AttributeMode> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->mode (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::AttributeDef::_set_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::AttributeMode>::in_arg_val _tao_mode;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_mode
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::AttributeDef * const impl =
+ static_cast<POA_CORBA::AttributeDef *> (servant);
+
+ _set_mode_AttributeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_AttributeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_AttributeDef_Upcall_Command (
+ POA_CORBA::AttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::AttributeDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::AttributeDef * const impl =
+ static_cast<POA_CORBA::AttributeDef *> (servant);
+
+ _is_a_AttributeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_AttributeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_AttributeDef_Upcall_Command (
+ POA_CORBA::AttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::AttributeDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::AttributeDef * const impl =
+ static_cast<POA_CORBA::AttributeDef *> (servant);
+
+ _non_existent_AttributeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_AttributeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_AttributeDef_Upcall_Command (
+ POA_CORBA::AttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::AttributeDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::AttributeDef * const impl =
+ static_cast<POA_CORBA::AttributeDef *> (servant);
+
+ _repository_id_AttributeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::AttributeDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::AttributeDef * const impl =
+ static_cast<POA_CORBA::AttributeDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_AttributeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_AttributeDef_Upcall_Command (
+ POA_CORBA::AttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::AttributeDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::AttributeDef * const impl =
+ static_cast<POA_CORBA::AttributeDef *> (servant);
+
+ _get_component_AttributeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::AttributeDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/AttributeDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::AttributeDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/AttributeDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::AttributeDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::AttributeDef *
+POA_CORBA::AttributeDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::AttributeDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_AttributeDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ExtAttributeDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ExtAttributeDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ExtAttributeDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 0,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 0,
+ 44, 44, 15, 0, 25, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 0, 0,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 0, 30, 44, 44, 44, 44, 5, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44,
+#else
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 0, 44, 0, 44, 44,
+ 15, 0, 25, 44, 44, 44, 44, 44, 44, 0,
+ 0, 44, 44, 44, 44, 0, 30, 44, 44, 44,
+ 44, 5, 44, 44, 44, 44, 44, 44,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ExtAttributeDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 28,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 43,
+ HASH_VALUE_RANGE = 40,
+ DUPLICATES = 11,
+ WORDLIST_SIZE = 32
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ExtAttributeDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::ExtAttributeDef::_is_a_skel, 0},
+ {"_get_name", &POA_CORBA::ExtAttributeDef::_get_name_skel, 0},
+ {"_set_mode", &POA_CORBA::ExtAttributeDef::_set_mode_skel, 0},
+ {"_get_mode", &POA_CORBA::ExtAttributeDef::_get_mode_skel, 0},
+ {"_get_type", &POA_CORBA::ExtAttributeDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::ExtAttributeDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ExtAttributeDef::_interface_skel, 0},
+ {"_get_version", &POA_CORBA::ExtAttributeDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ExtAttributeDef::_set_version_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ExtAttributeDef::_get_defined_in_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ExtAttributeDef::_get_absolute_name_skel, 0},
+ {"_get_get_exceptions", &POA_CORBA::ExtAttributeDef::_get_get_exceptions_skel, 0},
+ {"_set_set_exceptions", &POA_CORBA::ExtAttributeDef::_set_set_exceptions_skel, 0},
+ {"_get_set_exceptions", &POA_CORBA::ExtAttributeDef::_get_set_exceptions_skel, 0},
+ {"_set_get_exceptions", &POA_CORBA::ExtAttributeDef::_set_get_exceptions_skel, 0},
+ {"_get_id", &POA_CORBA::ExtAttributeDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ExtAttributeDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::ExtAttributeDef::describe_skel, 0},
+ {"destroy", &POA_CORBA::ExtAttributeDef::destroy_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ExtAttributeDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ExtAttributeDef::_repository_id_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ExtAttributeDef::_get_containing_repository_skel, 0},
+ {"describe_attribute", &POA_CORBA::ExtAttributeDef::describe_attribute_skel, 0},
+ {"_get_type_def", &POA_CORBA::ExtAttributeDef::_get_type_def_skel, 0},
+ {"_set_type_def", &POA_CORBA::ExtAttributeDef::_set_type_def_skel, 0},
+ {"_component", &POA_CORBA::ExtAttributeDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::ExtAttributeDef::_non_existent_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -6, -5, 4, 5, -1, -12, -2, -50, 11, -1, -48, -1,
+ -1, 14, -16, -4, 15, -46, -20, -2, -45, 22, -1, -1, -1, 23,
+ 24, 25, -1, 26, -1, 27, -1, -1, -28, -2, -45, -1, 30, -1,
+ -1, 31,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ExtAttributeDef_Perfect_Hash_OpTable tao_CORBA_ExtAttributeDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_ExtAttributeDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_ExtAttributeDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_ExtAttributeDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_ExtAttributeDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_ExtAttributeDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_ExtAttributeDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_ExtAttributeDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ExtAttributeDef::ExtAttributeDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ExtAttributeDef_optable;
+}
+
+POA_CORBA::ExtAttributeDef::ExtAttributeDef (const ExtAttributeDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::AttributeDef (rhs)
+{
+}
+
+POA_CORBA::ExtAttributeDef::~ExtAttributeDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_get_exceptions_ExtAttributeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_get_exceptions_ExtAttributeDef (
+ POA_CORBA::ExtAttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ExcDescriptionSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ExcDescriptionSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->get_exceptions (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtAttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ExtAttributeDef::_get_get_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ExcDescriptionSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtAttributeDef * const impl =
+ static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+
+ _get_get_exceptions_ExtAttributeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_get_exceptions_ExtAttributeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_get_exceptions_ExtAttributeDef (
+ POA_CORBA::ExtAttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ExcDescriptionSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ExcDescriptionSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->get_exceptions (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtAttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ExtAttributeDef::_set_get_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ExcDescriptionSeq>::in_arg_val _tao_get_exceptions;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_get_exceptions
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ExtAttributeDef * const impl =
+ static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+
+ _set_get_exceptions_ExtAttributeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_set_exceptions_ExtAttributeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_set_exceptions_ExtAttributeDef (
+ POA_CORBA::ExtAttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ExcDescriptionSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ExcDescriptionSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->set_exceptions (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtAttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ExtAttributeDef::_get_set_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ExcDescriptionSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtAttributeDef * const impl =
+ static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+
+ _get_set_exceptions_ExtAttributeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_set_exceptions_ExtAttributeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_set_exceptions_ExtAttributeDef (
+ POA_CORBA::ExtAttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ExcDescriptionSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ExcDescriptionSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->set_exceptions (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtAttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ExtAttributeDef::_set_set_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ExcDescriptionSeq>::in_arg_val _tao_set_exceptions;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_set_exceptions
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ExtAttributeDef * const impl =
+ static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+
+ _set_set_exceptions_ExtAttributeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class describe_attribute_ExtAttributeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline describe_attribute_ExtAttributeDef (
+ POA_CORBA::ExtAttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ExtAttributeDescription>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ExtAttributeDescription> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->describe_attribute (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtAttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ExtAttributeDef::describe_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ExtAttributeDescription>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtAttributeDef * const impl =
+ static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+
+ describe_attribute_ExtAttributeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ExtAttributeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ExtAttributeDef_Upcall_Command (
+ POA_CORBA::ExtAttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtAttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtAttributeDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ExtAttributeDef * const impl =
+ static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+
+ _is_a_ExtAttributeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ExtAttributeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ExtAttributeDef_Upcall_Command (
+ POA_CORBA::ExtAttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtAttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtAttributeDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtAttributeDef * const impl =
+ static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+
+ _non_existent_ExtAttributeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ExtAttributeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ExtAttributeDef_Upcall_Command (
+ POA_CORBA::ExtAttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtAttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtAttributeDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtAttributeDef * const impl =
+ static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+
+ _repository_id_ExtAttributeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ExtAttributeDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ExtAttributeDef * const impl =
+ static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ExtAttributeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ExtAttributeDef_Upcall_Command (
+ POA_CORBA::ExtAttributeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtAttributeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtAttributeDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtAttributeDef * const impl =
+ static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+
+ _get_component_ExtAttributeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ExtAttributeDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/AttributeDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ExtAttributeDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ExtAttributeDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ExtAttributeDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ExtAttributeDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ExtAttributeDef *
+POA_CORBA::ExtAttributeDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ExtAttributeDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_ExtAttributeDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_OperationDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_OperationDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_OperationDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 15, 0, 10, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 5,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 0, 20, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 15, 0, 10, 37, 37, 37, 37, 37, 37, 0,
+ 5, 37, 37, 37, 37, 0, 20, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_OperationDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 29,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 10,
+ WORDLIST_SIZE = 33
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::OperationDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::OperationDef::_is_a_skel, 0},
+ {"_get_name", &POA_CORBA::OperationDef::_get_name_skel, 0},
+ {"_set_mode", &POA_CORBA::OperationDef::_set_mode_skel, 0},
+ {"_get_mode", &POA_CORBA::OperationDef::_get_mode_skel, 0},
+ {"_set_name", &POA_CORBA::OperationDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::OperationDef::_interface_skel, 0},
+ {"_get_params", &POA_CORBA::OperationDef::_get_params_skel, 0},
+ {"_set_params", &POA_CORBA::OperationDef::_set_params_skel, 0},
+ {"_get_contexts", &POA_CORBA::OperationDef::_get_contexts_skel, 0},
+ {"_set_contexts", &POA_CORBA::OperationDef::_set_contexts_skel, 0},
+ {"_get_exceptions", &POA_CORBA::OperationDef::_get_exceptions_skel, 0},
+ {"_set_exceptions", &POA_CORBA::OperationDef::_set_exceptions_skel, 0},
+ {"_get_version", &POA_CORBA::OperationDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::OperationDef::_set_version_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::OperationDef::_get_absolute_name_skel, 0},
+ {"_get_defined_in", &POA_CORBA::OperationDef::_get_defined_in_skel, 0},
+ {"_get_id", &POA_CORBA::OperationDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::OperationDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::OperationDef::describe_skel, 0},
+ {"_get_result_def", &POA_CORBA::OperationDef::_get_result_def_skel, 0},
+ {"_set_result_def", &POA_CORBA::OperationDef::_set_result_def_skel, 0},
+ {"_get_def_kind", &POA_CORBA::OperationDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::OperationDef::_repository_id_skel, 0},
+ {"_component", &POA_CORBA::OperationDef::_component_skel, 0},
+ {"_get_result", &POA_CORBA::OperationDef::_get_result_skel, 0},
+ {"destroy", &POA_CORBA::OperationDef::destroy_skel, 0},
+ {"_non_existent", &POA_CORBA::OperationDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::OperationDef::_get_containing_repository_skel, 0},
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ {
+ const TAO_operation_db_entry *resword;
+
+ switch (key)
+ {
+ case 4:
+ resword = &wordlist[4]; break;
+ case 5:
+ resword = &wordlist[5]; break;
+ case 9:
+ resword = &wordlist[6];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[7];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[8];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[9];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 10:
+ resword = &wordlist[10]; break;
+ case 11:
+ resword = &wordlist[11];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[12];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 13:
+ resword = &wordlist[13];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[14];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 15:
+ resword = &wordlist[15];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[16];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 17:
+ resword = &wordlist[17];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[18];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 18:
+ resword = &wordlist[19]; break;
+ case 20:
+ resword = &wordlist[20]; break;
+ case 22:
+ resword = &wordlist[21];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[22];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 23:
+ resword = &wordlist[23]; break;
+ case 25:
+ resword = &wordlist[24];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[25];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 28:
+ resword = &wordlist[26]; break;
+ case 29:
+ resword = &wordlist[27]; break;
+ case 30:
+ resword = &wordlist[28]; break;
+ case 31:
+ resword = &wordlist[29]; break;
+ case 32:
+ resword = &wordlist[30]; break;
+ case 33:
+ resword = &wordlist[31]; break;
+ case 36:
+ resword = &wordlist[32]; break;
+ default: return 0;
+ }
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1))
+ return resword;
+ return 0;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_OperationDef_Perfect_Hash_OpTable tao_CORBA_OperationDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_OperationDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_OperationDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_OperationDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_OperationDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_OperationDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_OperationDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_OperationDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::OperationDef::OperationDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_OperationDef_optable;
+}
+
+POA_CORBA::OperationDef::OperationDef (const OperationDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs)
+{
+}
+
+POA_CORBA::OperationDef::~OperationDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_result_OperationDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_result_OperationDef (
+ POA_CORBA::OperationDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::TypeCode> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->result (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::OperationDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::OperationDef::_get_result_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+
+ _get_result_OperationDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_result_def_OperationDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_result_def_OperationDef (
+ POA_CORBA::OperationDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->result_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::OperationDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::OperationDef::_get_result_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+
+ _get_result_def_OperationDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_result_def_OperationDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_result_def_OperationDef (
+ POA_CORBA::OperationDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->result_def (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::OperationDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::OperationDef::_set_result_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_result_def;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_result_def
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+
+ _set_result_def_OperationDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_params_OperationDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_params_OperationDef (
+ POA_CORBA::OperationDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ParDescriptionSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ParDescriptionSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->params (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::OperationDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::OperationDef::_get_params_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ParDescriptionSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+
+ _get_params_OperationDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_params_OperationDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_params_OperationDef (
+ POA_CORBA::OperationDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ParDescriptionSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ParDescriptionSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->params (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::OperationDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::OperationDef::_set_params_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ParDescriptionSeq>::in_arg_val _tao_params;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_params
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+
+ _set_params_OperationDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_mode_OperationDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_mode_OperationDef (
+ POA_CORBA::OperationDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::OperationMode>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::OperationMode> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->mode (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::OperationDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::OperationDef::_get_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::OperationMode>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+
+ _get_mode_OperationDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_mode_OperationDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_mode_OperationDef (
+ POA_CORBA::OperationDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::OperationMode>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::OperationMode> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->mode (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::OperationDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::OperationDef::_set_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::OperationMode>::in_arg_val _tao_mode;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_mode
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+
+ _set_mode_OperationDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_contexts_OperationDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_contexts_OperationDef (
+ POA_CORBA::OperationDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ContextIdSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ContextIdSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->contexts (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::OperationDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::OperationDef::_get_contexts_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ContextIdSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+
+ _get_contexts_OperationDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_contexts_OperationDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_contexts_OperationDef (
+ POA_CORBA::OperationDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ContextIdSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ContextIdSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->contexts (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::OperationDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::OperationDef::_set_contexts_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ContextIdSeq>::in_arg_val _tao_contexts;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_contexts
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+
+ _set_contexts_OperationDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_exceptions_OperationDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_exceptions_OperationDef (
+ POA_CORBA::OperationDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ExceptionDefSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->exceptions (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::OperationDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::OperationDef::_get_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+
+ _get_exceptions_OperationDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_exceptions_OperationDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_exceptions_OperationDef (
+ POA_CORBA::OperationDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ExceptionDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->exceptions (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::OperationDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::OperationDef::_set_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_val _tao_exceptions;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_exceptions
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+
+ _set_exceptions_OperationDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_OperationDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_OperationDef_Upcall_Command (
+ POA_CORBA::OperationDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::OperationDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::OperationDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+
+ _is_a_OperationDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_OperationDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_OperationDef_Upcall_Command (
+ POA_CORBA::OperationDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::OperationDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::OperationDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+
+ _non_existent_OperationDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_OperationDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_OperationDef_Upcall_Command (
+ POA_CORBA::OperationDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::OperationDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::OperationDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+
+ _repository_id_OperationDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::OperationDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_OperationDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_OperationDef_Upcall_Command (
+ POA_CORBA::OperationDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::OperationDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::OperationDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::OperationDef * const impl =
+ static_cast<POA_CORBA::OperationDef *> (servant);
+
+ _get_component_OperationDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::OperationDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/OperationDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::OperationDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/OperationDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::OperationDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::OperationDef *
+POA_CORBA::OperationDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::OperationDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_OperationDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_InterfaceDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_InterfaceDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_InterfaceDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 0,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 0,
+ 81, 30, 20, 0, 81, 81, 81, 10, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 0, 0, 5,
+ 81, 0, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 20, 35, 81, 81, 81, 10, 5, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81,
+#else
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 0, 81, 0, 81, 30,
+ 20, 0, 81, 81, 81, 10, 81, 81, 0, 0,
+ 5, 81, 0, 81, 81, 20, 35, 81, 81, 81,
+ 10, 5, 81, 81, 81, 81, 81, 81,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_InterfaceDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 43,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 80,
+ HASH_VALUE_RANGE = 77,
+ DUPLICATES = 10,
+ WORDLIST_SIZE = 47
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::InterfaceDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::InterfaceDef::_is_a_skel, 0},
+ {"lookup", &POA_CORBA::InterfaceDef::lookup_skel, 0},
+ {"_get_name", &POA_CORBA::InterfaceDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::InterfaceDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::InterfaceDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::InterfaceDef::_interface_skel, 0},
+ {"lookup_name", &POA_CORBA::InterfaceDef::lookup_name_skel, 0},
+ {"is_a", &POA_CORBA::InterfaceDef::is_a_skel, 0},
+ {"_get_version", &POA_CORBA::InterfaceDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::InterfaceDef::_set_version_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::InterfaceDef::_get_absolute_name_skel, 0},
+ {"_get_defined_in", &POA_CORBA::InterfaceDef::_get_defined_in_skel, 0},
+ {"_get_id", &POA_CORBA::InterfaceDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::InterfaceDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::InterfaceDef::describe_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::InterfaceDef::_get_containing_repository_skel, 0},
+ {"destroy", &POA_CORBA::InterfaceDef::destroy_skel, 0},
+ {"_get_def_kind", &POA_CORBA::InterfaceDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::InterfaceDef::_repository_id_skel, 0},
+ {"describe_interface", &POA_CORBA::InterfaceDef::describe_interface_skel, 0},
+ {"_get_base_interfaces", &POA_CORBA::InterfaceDef::_get_base_interfaces_skel, 0},
+ {"_set_base_interfaces", &POA_CORBA::InterfaceDef::_set_base_interfaces_skel, 0},
+ {"create_enum", &POA_CORBA::InterfaceDef::create_enum_skel, 0},
+ {"create_value", &POA_CORBA::InterfaceDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::InterfaceDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::InterfaceDef::create_native_skel, 0},
+ {"_component", &POA_CORBA::InterfaceDef::_component_skel, 0},
+ {"create_interface", &POA_CORBA::InterfaceDef::create_interface_skel, 0},
+ {"create_attribute", &POA_CORBA::InterfaceDef::create_attribute_skel, 0},
+ {"create_ext_value", &POA_CORBA::InterfaceDef::create_ext_value_skel, 0},
+ {"create_union", &POA_CORBA::InterfaceDef::create_union_skel, 0},
+ {"_non_existent", &POA_CORBA::InterfaceDef::_non_existent_skel, 0},
+ {"create_exception", &POA_CORBA::InterfaceDef::create_exception_skel, 0},
+ {"create_operation", &POA_CORBA::InterfaceDef::create_operation_skel, 0},
+ {"create_local_interface", &POA_CORBA::InterfaceDef::create_local_interface_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::InterfaceDef::create_abstract_interface_skel, 0},
+ {"create_value_box", &POA_CORBA::InterfaceDef::create_value_box_skel, 0},
+ {"describe_contents", &POA_CORBA::InterfaceDef::describe_contents_skel, 0},
+ {"contents", &POA_CORBA::InterfaceDef::contents_skel, 0},
+ {"create_alias", &POA_CORBA::InterfaceDef::create_alias_skel, 0},
+ {"create_struct", &POA_CORBA::InterfaceDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::InterfaceDef::create_constant_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, 4, 5, 6, -7, -3, -82, 10, 11, -1, -1,
+ 12, -13, -2, -82, 15, -1, 16, -1, -1, -17, -2, -25, -2, -84,
+ 19, -29, -2, 20, 21, 22, 23, -1, -32, -3, 24, -1, -95, 27,
+ 28, -94, -1, 31, -90, 35, 36, -37, -2, -82, 39, -1, -1, 40,
+ 41, 42, 43, -1, -1, -1, 44, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 46,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_InterfaceDef_Perfect_Hash_OpTable tao_CORBA_InterfaceDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_InterfaceDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_InterfaceDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_InterfaceDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_InterfaceDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_InterfaceDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_InterfaceDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_InterfaceDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::InterfaceDef::InterfaceDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_InterfaceDef_optable;
+}
+
+POA_CORBA::InterfaceDef::InterfaceDef (const InterfaceDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs)
+{
+}
+
+POA_CORBA::InterfaceDef::~InterfaceDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_base_interfaces_InterfaceDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_base_interfaces_InterfaceDef (
+ POA_CORBA::InterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::InterfaceDefSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->base_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::InterfaceDef::_get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::InterfaceDef * const impl =
+ static_cast<POA_CORBA::InterfaceDef *> (servant);
+
+ _get_base_interfaces_InterfaceDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_base_interfaces_InterfaceDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_base_interfaces_InterfaceDef (
+ POA_CORBA::InterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InterfaceDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->base_interfaces (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::InterfaceDef::_set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_val _tao_base_interfaces;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_base_interfaces
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::InterfaceDef * const impl =
+ static_cast<POA_CORBA::InterfaceDef *> (servant);
+
+ _set_base_interfaces_InterfaceDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class is_a_InterfaceDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline is_a_InterfaceDef (
+ POA_CORBA::InterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_->is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::InterfaceDef::is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_interface_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_interface_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::InterfaceDef * const impl =
+ static_cast<POA_CORBA::InterfaceDef *> (servant);
+
+ is_a_InterfaceDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class describe_interface_InterfaceDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline describe_interface_InterfaceDef (
+ POA_CORBA::InterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InterfaceDef::FullInterfaceDescription>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::InterfaceDef::FullInterfaceDescription> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->describe_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::InterfaceDef::describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDef::FullInterfaceDescription>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::InterfaceDef * const impl =
+ static_cast<POA_CORBA::InterfaceDef *> (servant);
+
+ describe_interface_InterfaceDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_attribute_InterfaceDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_attribute_InterfaceDef (
+ POA_CORBA::InterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::AttributeDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::AttributeDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::CORBA::AttributeMode>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::AttributeMode> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ retval =
+ this->servant_->create_attribute (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::InterfaceDef::create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::AttributeDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_type;
+ TAO::SArg_Traits< ::CORBA::AttributeMode>::in_arg_val _tao_mode;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_type,
+ &_tao_mode
+ };
+
+ static size_t const nargs = 6;
+
+ POA_CORBA::InterfaceDef * const impl =
+ static_cast<POA_CORBA::InterfaceDef *> (servant);
+
+ create_attribute_InterfaceDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_operation_InterfaceDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_operation_InterfaceDef (
+ POA_CORBA::InterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::OperationDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::OperationDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::CORBA::OperationMode>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::OperationMode> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ TAO::SArg_Traits< ::CORBA::ParDescriptionSeq>::in_arg_type arg_6 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ParDescriptionSeq> (
+ this->operation_details_,
+ this->args_,
+ 6);
+
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_type arg_7 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ExceptionDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 7);
+
+ TAO::SArg_Traits< ::CORBA::ContextIdSeq>::in_arg_type arg_8 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ContextIdSeq> (
+ this->operation_details_,
+ this->args_,
+ 8);
+
+ retval =
+ this->servant_->create_operation (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ , arg_6
+ , arg_7
+ , arg_8
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::InterfaceDef::create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::OperationDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_result;
+ TAO::SArg_Traits< ::CORBA::OperationMode>::in_arg_val _tao_mode;
+ TAO::SArg_Traits< ::CORBA::ParDescriptionSeq>::in_arg_val _tao_params;
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_val _tao_exceptions;
+ TAO::SArg_Traits< ::CORBA::ContextIdSeq>::in_arg_val _tao_contexts;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_result,
+ &_tao_mode,
+ &_tao_params,
+ &_tao_exceptions,
+ &_tao_contexts
+ };
+
+ static size_t const nargs = 9;
+
+ POA_CORBA::InterfaceDef * const impl =
+ static_cast<POA_CORBA::InterfaceDef *> (servant);
+
+ create_operation_InterfaceDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_InterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_InterfaceDef_Upcall_Command (
+ POA_CORBA::InterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::InterfaceDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::InterfaceDef * const impl =
+ static_cast<POA_CORBA::InterfaceDef *> (servant);
+
+ _is_a_InterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_InterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_InterfaceDef_Upcall_Command (
+ POA_CORBA::InterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::InterfaceDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::InterfaceDef * const impl =
+ static_cast<POA_CORBA::InterfaceDef *> (servant);
+
+ _non_existent_InterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_InterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_InterfaceDef_Upcall_Command (
+ POA_CORBA::InterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::InterfaceDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::InterfaceDef * const impl =
+ static_cast<POA_CORBA::InterfaceDef *> (servant);
+
+ _repository_id_InterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::InterfaceDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::InterfaceDef * const impl =
+ static_cast<POA_CORBA::InterfaceDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_InterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_InterfaceDef_Upcall_Command (
+ POA_CORBA::InterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::InterfaceDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::InterfaceDef * const impl =
+ static_cast<POA_CORBA::InterfaceDef *> (servant);
+
+ _get_component_InterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::InterfaceDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/InterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::InterfaceDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/InterfaceDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::InterfaceDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::InterfaceDef *
+POA_CORBA::InterfaceDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::InterfaceDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_InterfaceDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_InterfaceAttrExtension_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_InterfaceAttrExtension_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_InterfaceAttrExtension_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 0,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 0,
+ 23, 0, 0, 0, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 5, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23,
+#else
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 0, 23, 0, 23, 0,
+ 0, 0, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 5, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_InterfaceAttrExtension_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 7,
+ MIN_WORD_LENGTH = 5,
+ MAX_WORD_LENGTH = 22,
+ MIN_HASH_VALUE = 5,
+ MAX_HASH_VALUE = 22,
+ HASH_VALUE_RANGE = 18,
+ DUPLICATES = 0,
+ WORDLIST_SIZE = 12
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"_is_a", &POA_CORBA::InterfaceAttrExtension::_is_a_skel, 0},
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"_interface", &POA_CORBA::InterfaceAttrExtension::_interface_skel, 0},
+ {"",0,0},{"",0,0},{"",0,0},
+ {"_repository_id", &POA_CORBA::InterfaceAttrExtension::_repository_id_skel, 0},
+ {"_component", &POA_CORBA::InterfaceAttrExtension::_component_skel, 0},
+ {"",0,0},{"",0,0},
+ {"_non_existent", &POA_CORBA::InterfaceAttrExtension::_non_existent_skel, 0},
+ {"",0,0},
+ {"create_ext_attribute", &POA_CORBA::InterfaceAttrExtension::create_ext_attribute_skel, 0},
+ {"",0,0},
+ {"describe_ext_interface", &POA_CORBA::InterfaceAttrExtension::describe_ext_interface_skel, 0},
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ const char *s = wordlist[key].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[key];
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_InterfaceAttrExtension_Perfect_Hash_OpTable tao_CORBA_InterfaceAttrExtension_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_InterfaceAttrExtension_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_InterfaceAttrExtension_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_InterfaceAttrExtension_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_InterfaceAttrExtension_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_InterfaceAttrExtension_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_InterfaceAttrExtension_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_InterfaceAttrExtension_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::InterfaceAttrExtension::InterfaceAttrExtension (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_InterfaceAttrExtension_optable;
+}
+
+POA_CORBA::InterfaceAttrExtension::InterfaceAttrExtension (const InterfaceAttrExtension& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs)
+{
+}
+
+POA_CORBA::InterfaceAttrExtension::~InterfaceAttrExtension (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class describe_ext_interface_InterfaceAttrExtension
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline describe_ext_interface_InterfaceAttrExtension (
+ POA_CORBA::InterfaceAttrExtension * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceAttrExtension * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::InterfaceAttrExtension::describe_ext_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::InterfaceAttrExtension * const impl =
+ static_cast<POA_CORBA::InterfaceAttrExtension *> (servant);
+
+ describe_ext_interface_InterfaceAttrExtension command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_ext_attribute_InterfaceAttrExtension
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_ext_attribute_InterfaceAttrExtension (
+ POA_CORBA::InterfaceAttrExtension * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ExtAttributeDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ExtAttributeDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::CORBA::AttributeMode>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::AttributeMode> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_type arg_6 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ExceptionDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 6);
+
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_type arg_7 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ExceptionDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 7);
+
+ retval =
+ this->servant_->create_ext_attribute (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ , arg_6
+ , arg_7
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceAttrExtension * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::InterfaceAttrExtension::create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ExtAttributeDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_type;
+ TAO::SArg_Traits< ::CORBA::AttributeMode>::in_arg_val _tao_mode;
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_val _tao_get_exceptions;
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_val _tao_set_exceptions;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_type,
+ &_tao_mode,
+ &_tao_get_exceptions,
+ &_tao_set_exceptions
+ };
+
+ static size_t const nargs = 8;
+
+ POA_CORBA::InterfaceAttrExtension * const impl =
+ static_cast<POA_CORBA::InterfaceAttrExtension *> (servant);
+
+ create_ext_attribute_InterfaceAttrExtension command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_InterfaceAttrExtension_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_InterfaceAttrExtension_Upcall_Command (
+ POA_CORBA::InterfaceAttrExtension * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceAttrExtension * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::InterfaceAttrExtension::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::InterfaceAttrExtension * const impl =
+ static_cast<POA_CORBA::InterfaceAttrExtension *> (servant);
+
+ _is_a_InterfaceAttrExtension_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_InterfaceAttrExtension_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_InterfaceAttrExtension_Upcall_Command (
+ POA_CORBA::InterfaceAttrExtension * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceAttrExtension * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::InterfaceAttrExtension::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::InterfaceAttrExtension * const impl =
+ static_cast<POA_CORBA::InterfaceAttrExtension *> (servant);
+
+ _non_existent_InterfaceAttrExtension_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_InterfaceAttrExtension_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_InterfaceAttrExtension_Upcall_Command (
+ POA_CORBA::InterfaceAttrExtension * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceAttrExtension * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::InterfaceAttrExtension::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::InterfaceAttrExtension * const impl =
+ static_cast<POA_CORBA::InterfaceAttrExtension *> (servant);
+
+ _repository_id_InterfaceAttrExtension_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::InterfaceAttrExtension::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::InterfaceAttrExtension * const impl =
+ static_cast<POA_CORBA::InterfaceAttrExtension *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_InterfaceAttrExtension_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_InterfaceAttrExtension_Upcall_Command (
+ POA_CORBA::InterfaceAttrExtension * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::InterfaceAttrExtension * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::InterfaceAttrExtension::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::InterfaceAttrExtension * const impl =
+ static_cast<POA_CORBA::InterfaceAttrExtension *> (servant);
+
+ _get_component_InterfaceAttrExtension_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::InterfaceAttrExtension::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/InterfaceAttrExtension:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::InterfaceAttrExtension::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/InterfaceAttrExtension:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::InterfaceAttrExtension::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::InterfaceAttrExtension *
+POA_CORBA::InterfaceAttrExtension::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::InterfaceAttrExtension STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_InterfaceAttrExtension_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ExtInterfaceDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ExtInterfaceDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ExtInterfaceDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 30,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 0,
+ 74, 0, 20, 0, 74, 74, 74, 5, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 15, 0, 5,
+ 74, 15, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 15, 30, 74, 74, 74, 15, 5, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74,
+#else
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 30, 74, 0, 74, 0,
+ 20, 0, 74, 74, 74, 5, 74, 74, 15, 0,
+ 5, 74, 15, 74, 74, 15, 30, 74, 74, 74,
+ 15, 5, 74, 74, 74, 74, 74, 74,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ExtInterfaceDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 45,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 73,
+ HASH_VALUE_RANGE = 70,
+ DUPLICATES = 10,
+ WORDLIST_SIZE = 49
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ExtInterfaceDef::move_skel, 0},
+ {"is_a", &POA_CORBA::ExtInterfaceDef::is_a_skel, 0},
+ {"create_enum", &POA_CORBA::ExtInterfaceDef::create_enum_skel, 0},
+ {"create_value", &POA_CORBA::ExtInterfaceDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::ExtInterfaceDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::ExtInterfaceDef::create_native_skel, 0},
+ {"create_interface", &POA_CORBA::ExtInterfaceDef::create_interface_skel, 0},
+ {"create_attribute", &POA_CORBA::ExtInterfaceDef::create_attribute_skel, 0},
+ {"create_ext_value", &POA_CORBA::ExtInterfaceDef::create_ext_value_skel, 0},
+ {"create_union", &POA_CORBA::ExtInterfaceDef::create_union_skel, 0},
+ {"create_ext_attribute", &POA_CORBA::ExtInterfaceDef::create_ext_attribute_skel, 0},
+ {"create_exception", &POA_CORBA::ExtInterfaceDef::create_exception_skel, 0},
+ {"create_operation", &POA_CORBA::ExtInterfaceDef::create_operation_skel, 0},
+ {"create_local_interface", &POA_CORBA::ExtInterfaceDef::create_local_interface_skel, 0},
+ {"contents", &POA_CORBA::ExtInterfaceDef::contents_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::ExtInterfaceDef::create_abstract_interface_skel, 0},
+ {"lookup_name", &POA_CORBA::ExtInterfaceDef::lookup_name_skel, 0},
+ {"create_alias", &POA_CORBA::ExtInterfaceDef::create_alias_skel, 0},
+ {"describe", &POA_CORBA::ExtInterfaceDef::describe_skel, 0},
+ {"create_value_box", &POA_CORBA::ExtInterfaceDef::create_value_box_skel, 0},
+ {"destroy", &POA_CORBA::ExtInterfaceDef::destroy_skel, 0},
+ {"_is_a", &POA_CORBA::ExtInterfaceDef::_is_a_skel, 0},
+ {"lookup", &POA_CORBA::ExtInterfaceDef::lookup_skel, 0},
+ {"describe_interface", &POA_CORBA::ExtInterfaceDef::describe_interface_skel, 0},
+ {"_get_name", &POA_CORBA::ExtInterfaceDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::ExtInterfaceDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::ExtInterfaceDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ExtInterfaceDef::_interface_skel, 0},
+ {"describe_ext_interface", &POA_CORBA::ExtInterfaceDef::describe_ext_interface_skel, 0},
+ {"create_struct", &POA_CORBA::ExtInterfaceDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::ExtInterfaceDef::create_constant_skel, 0},
+ {"_get_version", &POA_CORBA::ExtInterfaceDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ExtInterfaceDef::_set_version_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ExtInterfaceDef::_get_absolute_name_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ExtInterfaceDef::_get_defined_in_skel, 0},
+ {"describe_contents", &POA_CORBA::ExtInterfaceDef::describe_contents_skel, 0},
+ {"_get_id", &POA_CORBA::ExtInterfaceDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ExtInterfaceDef::_set_id_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ExtInterfaceDef::_get_containing_repository_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ExtInterfaceDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ExtInterfaceDef::_repository_id_skel, 0},
+ {"_get_base_interfaces", &POA_CORBA::ExtInterfaceDef::_get_base_interfaces_skel, 0},
+ {"_set_base_interfaces", &POA_CORBA::ExtInterfaceDef::_set_base_interfaces_skel, 0},
+ {"_component", &POA_CORBA::ExtInterfaceDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::ExtInterfaceDef::_non_existent_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, 4, -1, -1, -8, -2, 5, -1, 6, 7, -79,
+ -10, -3, -75, 13, -15, -2, 14, -76, 17, 18, -1, 19, 20, 21,
+ 22, -28, -3, 23, 24, -35, -2, 25, 26, -1, 27, -83, 31, -1,
+ 32, 33, -1, 34, -1, -87, 37, -1, 38, -1, 39, -1, -1, -40,
+ -2, -75, -1, -45, -2, 42, -1, 43, 44, -79, -1, -1, -1, -1,
+ 47, -1, -1, 48,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ExtInterfaceDef_Perfect_Hash_OpTable tao_CORBA_ExtInterfaceDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_ExtInterfaceDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_ExtInterfaceDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_ExtInterfaceDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_ExtInterfaceDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_ExtInterfaceDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_ExtInterfaceDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_ExtInterfaceDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ExtInterfaceDef::ExtInterfaceDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ExtInterfaceDef_optable;
+}
+
+POA_CORBA::ExtInterfaceDef::ExtInterfaceDef (const ExtInterfaceDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs),
+ POA_CORBA::InterfaceDef (rhs),
+ POA_CORBA::InterfaceAttrExtension (rhs)
+{
+}
+
+POA_CORBA::ExtInterfaceDef::~ExtInterfaceDef (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ExtInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ExtInterfaceDef_Upcall_Command (
+ POA_CORBA::ExtInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtInterfaceDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ExtInterfaceDef * const impl =
+ static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+
+ _is_a_ExtInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ExtInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ExtInterfaceDef_Upcall_Command (
+ POA_CORBA::ExtInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtInterfaceDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtInterfaceDef * const impl =
+ static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+
+ _non_existent_ExtInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ExtInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ExtInterfaceDef_Upcall_Command (
+ POA_CORBA::ExtInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtInterfaceDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtInterfaceDef * const impl =
+ static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+
+ _repository_id_ExtInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ExtInterfaceDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ExtInterfaceDef * const impl =
+ static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ExtInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ExtInterfaceDef_Upcall_Command (
+ POA_CORBA::ExtInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtInterfaceDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtInterfaceDef * const impl =
+ static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+
+ _get_component_ExtInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ExtInterfaceDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/InterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/InterfaceAttrExtension:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ExtInterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ExtInterfaceDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ExtInterfaceDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ExtInterfaceDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ExtInterfaceDef *
+POA_CORBA::ExtInterfaceDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ExtInterfaceDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_ExtInterfaceDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_AbstractInterfaceDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_AbstractInterfaceDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_AbstractInterfaceDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 0,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 0,
+ 81, 30, 20, 0, 81, 81, 81, 10, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 0, 0, 5,
+ 81, 0, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 20, 35, 81, 81, 81, 10, 5, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81,
+#else
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 0, 81, 0, 81, 30,
+ 20, 0, 81, 81, 81, 10, 81, 81, 0, 0,
+ 5, 81, 0, 81, 81, 20, 35, 81, 81, 81,
+ 10, 5, 81, 81, 81, 81, 81, 81,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_AbstractInterfaceDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 43,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 80,
+ HASH_VALUE_RANGE = 77,
+ DUPLICATES = 10,
+ WORDLIST_SIZE = 47
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::AbstractInterfaceDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::AbstractInterfaceDef::_is_a_skel, 0},
+ {"lookup", &POA_CORBA::AbstractInterfaceDef::lookup_skel, 0},
+ {"_get_name", &POA_CORBA::AbstractInterfaceDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::AbstractInterfaceDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::AbstractInterfaceDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::AbstractInterfaceDef::_interface_skel, 0},
+ {"lookup_name", &POA_CORBA::AbstractInterfaceDef::lookup_name_skel, 0},
+ {"is_a", &POA_CORBA::AbstractInterfaceDef::is_a_skel, 0},
+ {"_get_version", &POA_CORBA::AbstractInterfaceDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::AbstractInterfaceDef::_set_version_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::AbstractInterfaceDef::_get_absolute_name_skel, 0},
+ {"_get_defined_in", &POA_CORBA::AbstractInterfaceDef::_get_defined_in_skel, 0},
+ {"_get_id", &POA_CORBA::AbstractInterfaceDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::AbstractInterfaceDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::AbstractInterfaceDef::describe_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::AbstractInterfaceDef::_get_containing_repository_skel, 0},
+ {"destroy", &POA_CORBA::AbstractInterfaceDef::destroy_skel, 0},
+ {"_get_def_kind", &POA_CORBA::AbstractInterfaceDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::AbstractInterfaceDef::_repository_id_skel, 0},
+ {"describe_interface", &POA_CORBA::AbstractInterfaceDef::describe_interface_skel, 0},
+ {"_get_base_interfaces", &POA_CORBA::AbstractInterfaceDef::_get_base_interfaces_skel, 0},
+ {"_set_base_interfaces", &POA_CORBA::AbstractInterfaceDef::_set_base_interfaces_skel, 0},
+ {"create_enum", &POA_CORBA::AbstractInterfaceDef::create_enum_skel, 0},
+ {"create_value", &POA_CORBA::AbstractInterfaceDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::AbstractInterfaceDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::AbstractInterfaceDef::create_native_skel, 0},
+ {"_component", &POA_CORBA::AbstractInterfaceDef::_component_skel, 0},
+ {"create_interface", &POA_CORBA::AbstractInterfaceDef::create_interface_skel, 0},
+ {"create_attribute", &POA_CORBA::AbstractInterfaceDef::create_attribute_skel, 0},
+ {"create_ext_value", &POA_CORBA::AbstractInterfaceDef::create_ext_value_skel, 0},
+ {"create_union", &POA_CORBA::AbstractInterfaceDef::create_union_skel, 0},
+ {"_non_existent", &POA_CORBA::AbstractInterfaceDef::_non_existent_skel, 0},
+ {"create_exception", &POA_CORBA::AbstractInterfaceDef::create_exception_skel, 0},
+ {"create_operation", &POA_CORBA::AbstractInterfaceDef::create_operation_skel, 0},
+ {"create_local_interface", &POA_CORBA::AbstractInterfaceDef::create_local_interface_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::AbstractInterfaceDef::create_abstract_interface_skel, 0},
+ {"create_value_box", &POA_CORBA::AbstractInterfaceDef::create_value_box_skel, 0},
+ {"describe_contents", &POA_CORBA::AbstractInterfaceDef::describe_contents_skel, 0},
+ {"contents", &POA_CORBA::AbstractInterfaceDef::contents_skel, 0},
+ {"create_alias", &POA_CORBA::AbstractInterfaceDef::create_alias_skel, 0},
+ {"create_struct", &POA_CORBA::AbstractInterfaceDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::AbstractInterfaceDef::create_constant_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, 4, 5, 6, -7, -3, -82, 10, 11, -1, -1,
+ 12, -13, -2, -82, 15, -1, 16, -1, -1, -17, -2, -25, -2, -84,
+ 19, -29, -2, 20, 21, 22, 23, -1, -32, -3, 24, -1, -95, 27,
+ 28, -94, -1, 31, -90, 35, 36, -37, -2, -82, 39, -1, -1, 40,
+ 41, 42, 43, -1, -1, -1, 44, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 46,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_AbstractInterfaceDef_Perfect_Hash_OpTable tao_CORBA_AbstractInterfaceDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_AbstractInterfaceDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_AbstractInterfaceDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_AbstractInterfaceDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_AbstractInterfaceDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_AbstractInterfaceDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_AbstractInterfaceDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_AbstractInterfaceDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::AbstractInterfaceDef::AbstractInterfaceDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_AbstractInterfaceDef_optable;
+}
+
+POA_CORBA::AbstractInterfaceDef::AbstractInterfaceDef (const AbstractInterfaceDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs),
+ POA_CORBA::InterfaceDef (rhs)
+{
+}
+
+POA_CORBA::AbstractInterfaceDef::~AbstractInterfaceDef (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_AbstractInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_AbstractInterfaceDef_Upcall_Command (
+ POA_CORBA::AbstractInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AbstractInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::AbstractInterfaceDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::AbstractInterfaceDef * const impl =
+ static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+
+ _is_a_AbstractInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_AbstractInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_AbstractInterfaceDef_Upcall_Command (
+ POA_CORBA::AbstractInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AbstractInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::AbstractInterfaceDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::AbstractInterfaceDef * const impl =
+ static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+
+ _non_existent_AbstractInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_AbstractInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_AbstractInterfaceDef_Upcall_Command (
+ POA_CORBA::AbstractInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AbstractInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::AbstractInterfaceDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::AbstractInterfaceDef * const impl =
+ static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+
+ _repository_id_AbstractInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::AbstractInterfaceDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::AbstractInterfaceDef * const impl =
+ static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_AbstractInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_AbstractInterfaceDef_Upcall_Command (
+ POA_CORBA::AbstractInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::AbstractInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::AbstractInterfaceDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::AbstractInterfaceDef * const impl =
+ static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+
+ _get_component_AbstractInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::AbstractInterfaceDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/InterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/AbstractInterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::AbstractInterfaceDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/AbstractInterfaceDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::AbstractInterfaceDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::AbstractInterfaceDef *
+POA_CORBA::AbstractInterfaceDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::AbstractInterfaceDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_AbstractInterfaceDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ExtAbstractInterfaceDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ExtAbstractInterfaceDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ExtAbstractInterfaceDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 30,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 0,
+ 74, 0, 20, 0, 74, 74, 74, 5, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 15, 0, 5,
+ 74, 15, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 15, 30, 74, 74, 74, 15, 5, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74,
+#else
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 30, 74, 0, 74, 0,
+ 20, 0, 74, 74, 74, 5, 74, 74, 15, 0,
+ 5, 74, 15, 74, 74, 15, 30, 74, 74, 74,
+ 15, 5, 74, 74, 74, 74, 74, 74,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ExtAbstractInterfaceDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 45,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 73,
+ HASH_VALUE_RANGE = 70,
+ DUPLICATES = 10,
+ WORDLIST_SIZE = 49
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ExtAbstractInterfaceDef::move_skel, 0},
+ {"is_a", &POA_CORBA::ExtAbstractInterfaceDef::is_a_skel, 0},
+ {"create_enum", &POA_CORBA::ExtAbstractInterfaceDef::create_enum_skel, 0},
+ {"create_value", &POA_CORBA::ExtAbstractInterfaceDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::ExtAbstractInterfaceDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::ExtAbstractInterfaceDef::create_native_skel, 0},
+ {"create_interface", &POA_CORBA::ExtAbstractInterfaceDef::create_interface_skel, 0},
+ {"create_attribute", &POA_CORBA::ExtAbstractInterfaceDef::create_attribute_skel, 0},
+ {"create_ext_value", &POA_CORBA::ExtAbstractInterfaceDef::create_ext_value_skel, 0},
+ {"create_union", &POA_CORBA::ExtAbstractInterfaceDef::create_union_skel, 0},
+ {"create_ext_attribute", &POA_CORBA::ExtAbstractInterfaceDef::create_ext_attribute_skel, 0},
+ {"create_exception", &POA_CORBA::ExtAbstractInterfaceDef::create_exception_skel, 0},
+ {"create_operation", &POA_CORBA::ExtAbstractInterfaceDef::create_operation_skel, 0},
+ {"create_local_interface", &POA_CORBA::ExtAbstractInterfaceDef::create_local_interface_skel, 0},
+ {"contents", &POA_CORBA::ExtAbstractInterfaceDef::contents_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::ExtAbstractInterfaceDef::create_abstract_interface_skel, 0},
+ {"lookup_name", &POA_CORBA::ExtAbstractInterfaceDef::lookup_name_skel, 0},
+ {"create_alias", &POA_CORBA::ExtAbstractInterfaceDef::create_alias_skel, 0},
+ {"describe", &POA_CORBA::ExtAbstractInterfaceDef::describe_skel, 0},
+ {"create_value_box", &POA_CORBA::ExtAbstractInterfaceDef::create_value_box_skel, 0},
+ {"destroy", &POA_CORBA::ExtAbstractInterfaceDef::destroy_skel, 0},
+ {"_is_a", &POA_CORBA::ExtAbstractInterfaceDef::_is_a_skel, 0},
+ {"lookup", &POA_CORBA::ExtAbstractInterfaceDef::lookup_skel, 0},
+ {"describe_interface", &POA_CORBA::ExtAbstractInterfaceDef::describe_interface_skel, 0},
+ {"_get_name", &POA_CORBA::ExtAbstractInterfaceDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::ExtAbstractInterfaceDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::ExtAbstractInterfaceDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ExtAbstractInterfaceDef::_interface_skel, 0},
+ {"describe_ext_interface", &POA_CORBA::ExtAbstractInterfaceDef::describe_ext_interface_skel, 0},
+ {"create_struct", &POA_CORBA::ExtAbstractInterfaceDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::ExtAbstractInterfaceDef::create_constant_skel, 0},
+ {"_get_version", &POA_CORBA::ExtAbstractInterfaceDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ExtAbstractInterfaceDef::_set_version_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ExtAbstractInterfaceDef::_get_absolute_name_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ExtAbstractInterfaceDef::_get_defined_in_skel, 0},
+ {"describe_contents", &POA_CORBA::ExtAbstractInterfaceDef::describe_contents_skel, 0},
+ {"_get_id", &POA_CORBA::ExtAbstractInterfaceDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ExtAbstractInterfaceDef::_set_id_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ExtAbstractInterfaceDef::_get_containing_repository_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ExtAbstractInterfaceDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ExtAbstractInterfaceDef::_repository_id_skel, 0},
+ {"_get_base_interfaces", &POA_CORBA::ExtAbstractInterfaceDef::_get_base_interfaces_skel, 0},
+ {"_set_base_interfaces", &POA_CORBA::ExtAbstractInterfaceDef::_set_base_interfaces_skel, 0},
+ {"_component", &POA_CORBA::ExtAbstractInterfaceDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::ExtAbstractInterfaceDef::_non_existent_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, 4, -1, -1, -8, -2, 5, -1, 6, 7, -79,
+ -10, -3, -75, 13, -15, -2, 14, -76, 17, 18, -1, 19, 20, 21,
+ 22, -28, -3, 23, 24, -35, -2, 25, 26, -1, 27, -83, 31, -1,
+ 32, 33, -1, 34, -1, -87, 37, -1, 38, -1, 39, -1, -1, -40,
+ -2, -75, -1, -45, -2, 42, -1, 43, 44, -79, -1, -1, -1, -1,
+ 47, -1, -1, 48,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ExtAbstractInterfaceDef_Perfect_Hash_OpTable tao_CORBA_ExtAbstractInterfaceDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_ExtAbstractInterfaceDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_ExtAbstractInterfaceDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_ExtAbstractInterfaceDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_ExtAbstractInterfaceDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_ExtAbstractInterfaceDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_ExtAbstractInterfaceDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_ExtAbstractInterfaceDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ExtAbstractInterfaceDef::ExtAbstractInterfaceDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ExtAbstractInterfaceDef_optable;
+}
+
+POA_CORBA::ExtAbstractInterfaceDef::ExtAbstractInterfaceDef (const ExtAbstractInterfaceDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs),
+ POA_CORBA::InterfaceDef (rhs),
+ POA_CORBA::AbstractInterfaceDef (rhs),
+ POA_CORBA::InterfaceAttrExtension (rhs)
+{
+}
+
+POA_CORBA::ExtAbstractInterfaceDef::~ExtAbstractInterfaceDef (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ExtAbstractInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ExtAbstractInterfaceDef_Upcall_Command (
+ POA_CORBA::ExtAbstractInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtAbstractInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtAbstractInterfaceDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ExtAbstractInterfaceDef * const impl =
+ static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+
+ _is_a_ExtAbstractInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ExtAbstractInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ExtAbstractInterfaceDef_Upcall_Command (
+ POA_CORBA::ExtAbstractInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtAbstractInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtAbstractInterfaceDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtAbstractInterfaceDef * const impl =
+ static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+
+ _non_existent_ExtAbstractInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ExtAbstractInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ExtAbstractInterfaceDef_Upcall_Command (
+ POA_CORBA::ExtAbstractInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtAbstractInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtAbstractInterfaceDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtAbstractInterfaceDef * const impl =
+ static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+
+ _repository_id_ExtAbstractInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ExtAbstractInterfaceDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ExtAbstractInterfaceDef * const impl =
+ static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ExtAbstractInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ExtAbstractInterfaceDef_Upcall_Command (
+ POA_CORBA::ExtAbstractInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtAbstractInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtAbstractInterfaceDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtAbstractInterfaceDef * const impl =
+ static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+
+ _get_component_ExtAbstractInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ExtAbstractInterfaceDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/InterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/AbstractInterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/InterfaceAttrExtension:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ExtAbstractInterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ExtAbstractInterfaceDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ExtAbstractInterfaceDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ExtAbstractInterfaceDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ExtAbstractInterfaceDef *
+POA_CORBA::ExtAbstractInterfaceDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ExtAbstractInterfaceDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_ExtAbstractInterfaceDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_LocalInterfaceDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_LocalInterfaceDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_LocalInterfaceDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 0,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 0,
+ 81, 30, 20, 0, 81, 81, 81, 10, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 0, 0, 5,
+ 81, 0, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 20, 35, 81, 81, 81, 10, 5, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81,
+#else
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 0, 81, 0, 81, 30,
+ 20, 0, 81, 81, 81, 10, 81, 81, 0, 0,
+ 5, 81, 0, 81, 81, 20, 35, 81, 81, 81,
+ 10, 5, 81, 81, 81, 81, 81, 81,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_LocalInterfaceDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 43,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 80,
+ HASH_VALUE_RANGE = 77,
+ DUPLICATES = 10,
+ WORDLIST_SIZE = 47
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::LocalInterfaceDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::LocalInterfaceDef::_is_a_skel, 0},
+ {"lookup", &POA_CORBA::LocalInterfaceDef::lookup_skel, 0},
+ {"_get_name", &POA_CORBA::LocalInterfaceDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::LocalInterfaceDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::LocalInterfaceDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::LocalInterfaceDef::_interface_skel, 0},
+ {"lookup_name", &POA_CORBA::LocalInterfaceDef::lookup_name_skel, 0},
+ {"is_a", &POA_CORBA::LocalInterfaceDef::is_a_skel, 0},
+ {"_get_version", &POA_CORBA::LocalInterfaceDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::LocalInterfaceDef::_set_version_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::LocalInterfaceDef::_get_absolute_name_skel, 0},
+ {"_get_defined_in", &POA_CORBA::LocalInterfaceDef::_get_defined_in_skel, 0},
+ {"_get_id", &POA_CORBA::LocalInterfaceDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::LocalInterfaceDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::LocalInterfaceDef::describe_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::LocalInterfaceDef::_get_containing_repository_skel, 0},
+ {"destroy", &POA_CORBA::LocalInterfaceDef::destroy_skel, 0},
+ {"_get_def_kind", &POA_CORBA::LocalInterfaceDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::LocalInterfaceDef::_repository_id_skel, 0},
+ {"describe_interface", &POA_CORBA::LocalInterfaceDef::describe_interface_skel, 0},
+ {"_get_base_interfaces", &POA_CORBA::LocalInterfaceDef::_get_base_interfaces_skel, 0},
+ {"_set_base_interfaces", &POA_CORBA::LocalInterfaceDef::_set_base_interfaces_skel, 0},
+ {"create_enum", &POA_CORBA::LocalInterfaceDef::create_enum_skel, 0},
+ {"create_value", &POA_CORBA::LocalInterfaceDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::LocalInterfaceDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::LocalInterfaceDef::create_native_skel, 0},
+ {"_component", &POA_CORBA::LocalInterfaceDef::_component_skel, 0},
+ {"create_interface", &POA_CORBA::LocalInterfaceDef::create_interface_skel, 0},
+ {"create_attribute", &POA_CORBA::LocalInterfaceDef::create_attribute_skel, 0},
+ {"create_ext_value", &POA_CORBA::LocalInterfaceDef::create_ext_value_skel, 0},
+ {"create_union", &POA_CORBA::LocalInterfaceDef::create_union_skel, 0},
+ {"_non_existent", &POA_CORBA::LocalInterfaceDef::_non_existent_skel, 0},
+ {"create_exception", &POA_CORBA::LocalInterfaceDef::create_exception_skel, 0},
+ {"create_operation", &POA_CORBA::LocalInterfaceDef::create_operation_skel, 0},
+ {"create_local_interface", &POA_CORBA::LocalInterfaceDef::create_local_interface_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::LocalInterfaceDef::create_abstract_interface_skel, 0},
+ {"create_value_box", &POA_CORBA::LocalInterfaceDef::create_value_box_skel, 0},
+ {"describe_contents", &POA_CORBA::LocalInterfaceDef::describe_contents_skel, 0},
+ {"contents", &POA_CORBA::LocalInterfaceDef::contents_skel, 0},
+ {"create_alias", &POA_CORBA::LocalInterfaceDef::create_alias_skel, 0},
+ {"create_struct", &POA_CORBA::LocalInterfaceDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::LocalInterfaceDef::create_constant_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, 4, 5, 6, -7, -3, -82, 10, 11, -1, -1,
+ 12, -13, -2, -82, 15, -1, 16, -1, -1, -17, -2, -25, -2, -84,
+ 19, -29, -2, 20, 21, 22, 23, -1, -32, -3, 24, -1, -95, 27,
+ 28, -94, -1, 31, -90, 35, 36, -37, -2, -82, 39, -1, -1, 40,
+ 41, 42, 43, -1, -1, -1, 44, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 45, -1, 46,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_LocalInterfaceDef_Perfect_Hash_OpTable tao_CORBA_LocalInterfaceDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_LocalInterfaceDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_LocalInterfaceDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_LocalInterfaceDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_LocalInterfaceDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_LocalInterfaceDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_LocalInterfaceDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_LocalInterfaceDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::LocalInterfaceDef::LocalInterfaceDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_LocalInterfaceDef_optable;
+}
+
+POA_CORBA::LocalInterfaceDef::LocalInterfaceDef (const LocalInterfaceDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs),
+ POA_CORBA::InterfaceDef (rhs)
+{
+}
+
+POA_CORBA::LocalInterfaceDef::~LocalInterfaceDef (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_LocalInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_LocalInterfaceDef_Upcall_Command (
+ POA_CORBA::LocalInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::LocalInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::LocalInterfaceDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::LocalInterfaceDef * const impl =
+ static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+
+ _is_a_LocalInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_LocalInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_LocalInterfaceDef_Upcall_Command (
+ POA_CORBA::LocalInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::LocalInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::LocalInterfaceDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::LocalInterfaceDef * const impl =
+ static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+
+ _non_existent_LocalInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_LocalInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_LocalInterfaceDef_Upcall_Command (
+ POA_CORBA::LocalInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::LocalInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::LocalInterfaceDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::LocalInterfaceDef * const impl =
+ static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+
+ _repository_id_LocalInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::LocalInterfaceDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::LocalInterfaceDef * const impl =
+ static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_LocalInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_LocalInterfaceDef_Upcall_Command (
+ POA_CORBA::LocalInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::LocalInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::LocalInterfaceDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::LocalInterfaceDef * const impl =
+ static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+
+ _get_component_LocalInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::LocalInterfaceDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/InterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/LocalInterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::LocalInterfaceDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/LocalInterfaceDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::LocalInterfaceDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::LocalInterfaceDef *
+POA_CORBA::LocalInterfaceDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::LocalInterfaceDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_LocalInterfaceDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ExtLocalInterfaceDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ExtLocalInterfaceDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ExtLocalInterfaceDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 30,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 0,
+ 74, 0, 20, 0, 74, 74, 74, 5, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 15, 0, 5,
+ 74, 15, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 15, 30, 74, 74, 74, 15, 5, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74,
+#else
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
+ 74, 74, 74, 74, 74, 30, 74, 0, 74, 0,
+ 20, 0, 74, 74, 74, 5, 74, 74, 15, 0,
+ 5, 74, 15, 74, 74, 15, 30, 74, 74, 74,
+ 15, 5, 74, 74, 74, 74, 74, 74,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ExtLocalInterfaceDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 45,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 73,
+ HASH_VALUE_RANGE = 70,
+ DUPLICATES = 10,
+ WORDLIST_SIZE = 49
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ExtLocalInterfaceDef::move_skel, 0},
+ {"is_a", &POA_CORBA::ExtLocalInterfaceDef::is_a_skel, 0},
+ {"create_enum", &POA_CORBA::ExtLocalInterfaceDef::create_enum_skel, 0},
+ {"create_value", &POA_CORBA::ExtLocalInterfaceDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::ExtLocalInterfaceDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::ExtLocalInterfaceDef::create_native_skel, 0},
+ {"create_interface", &POA_CORBA::ExtLocalInterfaceDef::create_interface_skel, 0},
+ {"create_attribute", &POA_CORBA::ExtLocalInterfaceDef::create_attribute_skel, 0},
+ {"create_ext_value", &POA_CORBA::ExtLocalInterfaceDef::create_ext_value_skel, 0},
+ {"create_union", &POA_CORBA::ExtLocalInterfaceDef::create_union_skel, 0},
+ {"create_ext_attribute", &POA_CORBA::ExtLocalInterfaceDef::create_ext_attribute_skel, 0},
+ {"create_exception", &POA_CORBA::ExtLocalInterfaceDef::create_exception_skel, 0},
+ {"create_operation", &POA_CORBA::ExtLocalInterfaceDef::create_operation_skel, 0},
+ {"create_local_interface", &POA_CORBA::ExtLocalInterfaceDef::create_local_interface_skel, 0},
+ {"contents", &POA_CORBA::ExtLocalInterfaceDef::contents_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::ExtLocalInterfaceDef::create_abstract_interface_skel, 0},
+ {"lookup_name", &POA_CORBA::ExtLocalInterfaceDef::lookup_name_skel, 0},
+ {"create_alias", &POA_CORBA::ExtLocalInterfaceDef::create_alias_skel, 0},
+ {"describe", &POA_CORBA::ExtLocalInterfaceDef::describe_skel, 0},
+ {"create_value_box", &POA_CORBA::ExtLocalInterfaceDef::create_value_box_skel, 0},
+ {"destroy", &POA_CORBA::ExtLocalInterfaceDef::destroy_skel, 0},
+ {"_is_a", &POA_CORBA::ExtLocalInterfaceDef::_is_a_skel, 0},
+ {"lookup", &POA_CORBA::ExtLocalInterfaceDef::lookup_skel, 0},
+ {"describe_interface", &POA_CORBA::ExtLocalInterfaceDef::describe_interface_skel, 0},
+ {"_get_name", &POA_CORBA::ExtLocalInterfaceDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::ExtLocalInterfaceDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::ExtLocalInterfaceDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ExtLocalInterfaceDef::_interface_skel, 0},
+ {"describe_ext_interface", &POA_CORBA::ExtLocalInterfaceDef::describe_ext_interface_skel, 0},
+ {"create_struct", &POA_CORBA::ExtLocalInterfaceDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::ExtLocalInterfaceDef::create_constant_skel, 0},
+ {"_get_version", &POA_CORBA::ExtLocalInterfaceDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ExtLocalInterfaceDef::_set_version_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ExtLocalInterfaceDef::_get_absolute_name_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ExtLocalInterfaceDef::_get_defined_in_skel, 0},
+ {"describe_contents", &POA_CORBA::ExtLocalInterfaceDef::describe_contents_skel, 0},
+ {"_get_id", &POA_CORBA::ExtLocalInterfaceDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ExtLocalInterfaceDef::_set_id_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ExtLocalInterfaceDef::_get_containing_repository_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ExtLocalInterfaceDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ExtLocalInterfaceDef::_repository_id_skel, 0},
+ {"_get_base_interfaces", &POA_CORBA::ExtLocalInterfaceDef::_get_base_interfaces_skel, 0},
+ {"_set_base_interfaces", &POA_CORBA::ExtLocalInterfaceDef::_set_base_interfaces_skel, 0},
+ {"_component", &POA_CORBA::ExtLocalInterfaceDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::ExtLocalInterfaceDef::_non_existent_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, 4, -1, -1, -8, -2, 5, -1, 6, 7, -79,
+ -10, -3, -75, 13, -15, -2, 14, -76, 17, 18, -1, 19, 20, 21,
+ 22, -28, -3, 23, 24, -35, -2, 25, 26, -1, 27, -83, 31, -1,
+ 32, 33, -1, 34, -1, -87, 37, -1, 38, -1, 39, -1, -1, -40,
+ -2, -75, -1, -45, -2, 42, -1, 43, 44, -79, -1, -1, -1, -1,
+ 47, -1, -1, 48,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ExtLocalInterfaceDef_Perfect_Hash_OpTable tao_CORBA_ExtLocalInterfaceDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_ExtLocalInterfaceDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_ExtLocalInterfaceDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_ExtLocalInterfaceDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_ExtLocalInterfaceDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_ExtLocalInterfaceDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_ExtLocalInterfaceDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_ExtLocalInterfaceDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ExtLocalInterfaceDef::ExtLocalInterfaceDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ExtLocalInterfaceDef_optable;
+}
+
+POA_CORBA::ExtLocalInterfaceDef::ExtLocalInterfaceDef (const ExtLocalInterfaceDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs),
+ POA_CORBA::InterfaceDef (rhs),
+ POA_CORBA::LocalInterfaceDef (rhs),
+ POA_CORBA::InterfaceAttrExtension (rhs)
+{
+}
+
+POA_CORBA::ExtLocalInterfaceDef::~ExtLocalInterfaceDef (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ExtLocalInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ExtLocalInterfaceDef_Upcall_Command (
+ POA_CORBA::ExtLocalInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtLocalInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtLocalInterfaceDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ExtLocalInterfaceDef * const impl =
+ static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+
+ _is_a_ExtLocalInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ExtLocalInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ExtLocalInterfaceDef_Upcall_Command (
+ POA_CORBA::ExtLocalInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtLocalInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtLocalInterfaceDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtLocalInterfaceDef * const impl =
+ static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+
+ _non_existent_ExtLocalInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ExtLocalInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ExtLocalInterfaceDef_Upcall_Command (
+ POA_CORBA::ExtLocalInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtLocalInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtLocalInterfaceDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtLocalInterfaceDef * const impl =
+ static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+
+ _repository_id_ExtLocalInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ExtLocalInterfaceDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ExtLocalInterfaceDef * const impl =
+ static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ExtLocalInterfaceDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ExtLocalInterfaceDef_Upcall_Command (
+ POA_CORBA::ExtLocalInterfaceDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtLocalInterfaceDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtLocalInterfaceDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtLocalInterfaceDef * const impl =
+ static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+
+ _get_component_ExtLocalInterfaceDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ExtLocalInterfaceDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/InterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/LocalInterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/InterfaceAttrExtension:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ExtLocalInterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ExtLocalInterfaceDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ExtLocalInterfaceDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ExtLocalInterfaceDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ExtLocalInterfaceDef *
+POA_CORBA::ExtLocalInterfaceDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ExtLocalInterfaceDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_ExtLocalInterfaceDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+
+#endif /* ifndef */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS.h b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS.h
new file mode 100644
index 00000000000..4082020639a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS.h
@@ -0,0 +1,7898 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:409
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASICS_H_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASICS_H_
+
+#include /**/ "ace/pre.h"
+
+#include "tao/IFR_Client/IFR_BasicC.h"
+#include "orbsvcs/IFRService/IFR_BaseS.h"
+#include "tao/ParameterModeS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Collocation_Proxy_Broker.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/PortableServer/Servant_Base.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_module/module_sh.cpp:49
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class Repository;
+ typedef Repository *Repository_ptr;
+
+ class Repository
+ : public virtual POA_CORBA::Container
+ {
+ protected:
+ Repository (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::Repository _stub_type;
+ typedef ::CORBA::Repository_ptr _stub_ptr_type;
+ typedef ::CORBA::Repository_var _stub_var_type;
+
+ Repository (const Repository& rhs);
+ virtual ~Repository (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::Repository *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Contained_ptr lookup_id (
+ const char * search_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void lookup_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::TypeCode_ptr get_canonical_typecode (
+ ::CORBA::TypeCode_ptr tc
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void get_canonical_typecode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::PrimitiveDef_ptr get_primitive (
+ ::CORBA::PrimitiveKind kind
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void get_primitive_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::StringDef_ptr create_string (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_string_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::WstringDef_ptr create_wstring (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_wstring_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::SequenceDef_ptr create_sequence (
+ ::CORBA::ULong bound,
+ ::CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_sequence_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ArrayDef_ptr create_array (
+ ::CORBA::ULong length,
+ ::CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_array_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::FixedDef_ptr create_fixed (
+ ::CORBA::UShort digits,
+ ::CORBA::Short scale
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_fixed_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ModuleDef;
+ typedef ModuleDef *ModuleDef_ptr;
+
+ class ModuleDef
+ : public virtual POA_CORBA::Container,
+ public virtual POA_CORBA::Contained
+ {
+ protected:
+ ModuleDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ModuleDef _stub_type;
+ typedef ::CORBA::ModuleDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ModuleDef_var _stub_var_type;
+
+ ModuleDef (const ModuleDef& rhs);
+ virtual ~ModuleDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ModuleDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ConstantDef;
+ typedef ConstantDef *ConstantDef_ptr;
+
+ class ConstantDef
+ : public virtual POA_CORBA::Contained
+ {
+ protected:
+ ConstantDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ConstantDef _stub_type;
+ typedef ::CORBA::ConstantDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ConstantDef_var _stub_var_type;
+
+ ConstantDef (const ConstantDef& rhs);
+ virtual ~ConstantDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ConstantDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::IDLType_ptr type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void type_def (
+ ::CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Any * value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void value (
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class StructDef;
+ typedef StructDef *StructDef_ptr;
+
+ class StructDef
+ : public virtual POA_CORBA::TypedefDef,
+ public virtual POA_CORBA::Container
+ {
+ protected:
+ StructDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::StructDef _stub_type;
+ typedef ::CORBA::StructDef_ptr _stub_ptr_type;
+ typedef ::CORBA::StructDef_var _stub_var_type;
+
+ StructDef (const StructDef& rhs);
+ virtual ~StructDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::StructDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::StructMemberSeq * members (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_members_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void members (
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_members_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class UnionDef;
+ typedef UnionDef *UnionDef_ptr;
+
+ class UnionDef
+ : public virtual POA_CORBA::TypedefDef,
+ public virtual POA_CORBA::Container
+ {
+ protected:
+ UnionDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::UnionDef _stub_type;
+ typedef ::CORBA::UnionDef_ptr _stub_ptr_type;
+ typedef ::CORBA::UnionDef_var _stub_var_type;
+
+ UnionDef (const UnionDef& rhs);
+ virtual ~UnionDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::UnionDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::TypeCode_ptr discriminator_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_discriminator_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::IDLType_ptr discriminator_type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_discriminator_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void discriminator_type_def (
+ ::CORBA::IDLType_ptr discriminator_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_discriminator_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::UnionMemberSeq * members (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_members_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void members (
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_members_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class EnumDef;
+ typedef EnumDef *EnumDef_ptr;
+
+ class EnumDef
+ : public virtual POA_CORBA::TypedefDef
+ {
+ protected:
+ EnumDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::EnumDef _stub_type;
+ typedef ::CORBA::EnumDef_ptr _stub_ptr_type;
+ typedef ::CORBA::EnumDef_var _stub_var_type;
+
+ EnumDef (const EnumDef& rhs);
+ virtual ~EnumDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::EnumDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::EnumMemberSeq * members (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_members_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void members (
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_members_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class AliasDef;
+ typedef AliasDef *AliasDef_ptr;
+
+ class AliasDef
+ : public virtual POA_CORBA::TypedefDef
+ {
+ protected:
+ AliasDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::AliasDef _stub_type;
+ typedef ::CORBA::AliasDef_ptr _stub_ptr_type;
+ typedef ::CORBA::AliasDef_var _stub_var_type;
+
+ AliasDef (const AliasDef& rhs);
+ virtual ~AliasDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::AliasDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::IDLType_ptr original_type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_original_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void original_type_def (
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_original_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class NativeDef;
+ typedef NativeDef *NativeDef_ptr;
+
+ class NativeDef
+ : public virtual POA_CORBA::TypedefDef
+ {
+ protected:
+ NativeDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::NativeDef _stub_type;
+ typedef ::CORBA::NativeDef_ptr _stub_ptr_type;
+ typedef ::CORBA::NativeDef_var _stub_var_type;
+
+ NativeDef (const NativeDef& rhs);
+ virtual ~NativeDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::NativeDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class PrimitiveDef;
+ typedef PrimitiveDef *PrimitiveDef_ptr;
+
+ class PrimitiveDef
+ : public virtual POA_CORBA::IDLType
+ {
+ protected:
+ PrimitiveDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::PrimitiveDef _stub_type;
+ typedef ::CORBA::PrimitiveDef_ptr _stub_ptr_type;
+ typedef ::CORBA::PrimitiveDef_var _stub_var_type;
+
+ PrimitiveDef (const PrimitiveDef& rhs);
+ virtual ~PrimitiveDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::PrimitiveDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::PrimitiveKind kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class StringDef;
+ typedef StringDef *StringDef_ptr;
+
+ class StringDef
+ : public virtual POA_CORBA::IDLType
+ {
+ protected:
+ StringDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::StringDef _stub_type;
+ typedef ::CORBA::StringDef_ptr _stub_ptr_type;
+ typedef ::CORBA::StringDef_var _stub_var_type;
+
+ StringDef (const StringDef& rhs);
+ virtual ~StringDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::StringDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ULong bound (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_bound_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void bound (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_bound_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class WstringDef;
+ typedef WstringDef *WstringDef_ptr;
+
+ class WstringDef
+ : public virtual POA_CORBA::IDLType
+ {
+ protected:
+ WstringDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::WstringDef _stub_type;
+ typedef ::CORBA::WstringDef_ptr _stub_ptr_type;
+ typedef ::CORBA::WstringDef_var _stub_var_type;
+
+ WstringDef (const WstringDef& rhs);
+ virtual ~WstringDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::WstringDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ULong bound (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_bound_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void bound (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_bound_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class SequenceDef;
+ typedef SequenceDef *SequenceDef_ptr;
+
+ class SequenceDef
+ : public virtual POA_CORBA::IDLType
+ {
+ protected:
+ SequenceDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::SequenceDef _stub_type;
+ typedef ::CORBA::SequenceDef_ptr _stub_ptr_type;
+ typedef ::CORBA::SequenceDef_var _stub_var_type;
+
+ SequenceDef (const SequenceDef& rhs);
+ virtual ~SequenceDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::SequenceDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ULong bound (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_bound_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void bound (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_bound_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::TypeCode_ptr element_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_element_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::IDLType_ptr element_type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_element_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void element_type_def (
+ ::CORBA::IDLType_ptr element_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_element_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ArrayDef;
+ typedef ArrayDef *ArrayDef_ptr;
+
+ class ArrayDef
+ : public virtual POA_CORBA::IDLType
+ {
+ protected:
+ ArrayDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ArrayDef _stub_type;
+ typedef ::CORBA::ArrayDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ArrayDef_var _stub_var_type;
+
+ ArrayDef (const ArrayDef& rhs);
+ virtual ~ArrayDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ArrayDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ULong length (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_length_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void length (
+ ::CORBA::ULong length
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_length_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::TypeCode_ptr element_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_element_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::IDLType_ptr element_type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_element_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void element_type_def (
+ ::CORBA::IDLType_ptr element_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_element_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ExceptionDef;
+ typedef ExceptionDef *ExceptionDef_ptr;
+
+ class ExceptionDef
+ : public virtual POA_CORBA::Contained,
+ public virtual POA_CORBA::Container
+ {
+ protected:
+ ExceptionDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ExceptionDef _stub_type;
+ typedef ::CORBA::ExceptionDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ExceptionDef_var _stub_var_type;
+
+ ExceptionDef (const ExceptionDef& rhs);
+ virtual ~ExceptionDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ExceptionDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::StructMemberSeq * members (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_members_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void members (
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_members_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class AttributeDef;
+ typedef AttributeDef *AttributeDef_ptr;
+
+ class AttributeDef
+ : public virtual POA_CORBA::Contained
+ {
+ protected:
+ AttributeDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::AttributeDef _stub_type;
+ typedef ::CORBA::AttributeDef_ptr _stub_ptr_type;
+ typedef ::CORBA::AttributeDef_var _stub_var_type;
+
+ AttributeDef (const AttributeDef& rhs);
+ virtual ~AttributeDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::AttributeDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::IDLType_ptr type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void type_def (
+ ::CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::AttributeMode mode (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void mode (
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ExtAttributeDef;
+ typedef ExtAttributeDef *ExtAttributeDef_ptr;
+
+ class ExtAttributeDef
+ : public virtual POA_CORBA::AttributeDef
+ {
+ protected:
+ ExtAttributeDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ExtAttributeDef _stub_type;
+ typedef ::CORBA::ExtAttributeDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ExtAttributeDef_var _stub_var_type;
+
+ ExtAttributeDef (const ExtAttributeDef& rhs);
+ virtual ~ExtAttributeDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ExtAttributeDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ExcDescriptionSeq * get_exceptions (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_get_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void get_exceptions (
+ const ::CORBA::ExcDescriptionSeq & get_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_get_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ExcDescriptionSeq * set_exceptions (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_set_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void set_exceptions (
+ const ::CORBA::ExcDescriptionSeq & set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_set_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ExtAttributeDescription * describe_attribute (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void describe_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class OperationDef;
+ typedef OperationDef *OperationDef_ptr;
+
+ class OperationDef
+ : public virtual POA_CORBA::Contained
+ {
+ protected:
+ OperationDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::OperationDef _stub_type;
+ typedef ::CORBA::OperationDef_ptr _stub_ptr_type;
+ typedef ::CORBA::OperationDef_var _stub_var_type;
+
+ OperationDef (const OperationDef& rhs);
+ virtual ~OperationDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::OperationDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::TypeCode_ptr result (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_result_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::IDLType_ptr result_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_result_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void result_def (
+ ::CORBA::IDLType_ptr result_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_result_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ParDescriptionSeq * params (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_params_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void params (
+ const ::CORBA::ParDescriptionSeq & params
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_params_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::OperationMode mode (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void mode (
+ ::CORBA::OperationMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ContextIdSeq * contexts (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_contexts_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void contexts (
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_contexts_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ExceptionDefSeq * exceptions (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void exceptions (
+ const ::CORBA::ExceptionDefSeq & exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class InterfaceDef;
+ typedef InterfaceDef *InterfaceDef_ptr;
+
+ class InterfaceDef
+ : public virtual POA_CORBA::Container,
+ public virtual POA_CORBA::Contained,
+ public virtual POA_CORBA::IDLType
+ {
+ protected:
+ InterfaceDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::InterfaceDef _stub_type;
+ typedef ::CORBA::InterfaceDef_ptr _stub_ptr_type;
+ typedef ::CORBA::InterfaceDef_var _stub_var_type;
+
+ InterfaceDef (const InterfaceDef& rhs);
+ virtual ~InterfaceDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::InterfaceDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::InterfaceDefSeq * base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Boolean is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::InterfaceDef::FullInterfaceDescription * describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::AttributeDef_ptr create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::OperationDef_ptr create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class InterfaceAttrExtension;
+ typedef InterfaceAttrExtension *InterfaceAttrExtension_ptr;
+
+ class InterfaceAttrExtension
+ : public virtual PortableServer::ServantBase
+ {
+ protected:
+ InterfaceAttrExtension (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::InterfaceAttrExtension _stub_type;
+ typedef ::CORBA::InterfaceAttrExtension_ptr _stub_ptr_type;
+ typedef ::CORBA::InterfaceAttrExtension_var _stub_var_type;
+
+ InterfaceAttrExtension (const InterfaceAttrExtension& rhs);
+ virtual ~InterfaceAttrExtension (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::InterfaceAttrExtension *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription * describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void describe_ext_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ExtAttributeDef_ptr create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ExtInterfaceDef;
+ typedef ExtInterfaceDef *ExtInterfaceDef_ptr;
+
+ class ExtInterfaceDef
+ : public virtual POA_CORBA::InterfaceDef,
+ public virtual POA_CORBA::InterfaceAttrExtension
+ {
+ protected:
+ ExtInterfaceDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ExtInterfaceDef _stub_type;
+ typedef ::CORBA::ExtInterfaceDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ExtInterfaceDef_var _stub_var_type;
+
+ ExtInterfaceDef (const ExtInterfaceDef& rhs);
+ virtual ~ExtInterfaceDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ExtInterfaceDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_ext_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class AbstractInterfaceDef;
+ typedef AbstractInterfaceDef *AbstractInterfaceDef_ptr;
+
+ class AbstractInterfaceDef
+ : public virtual POA_CORBA::InterfaceDef
+ {
+ protected:
+ AbstractInterfaceDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::AbstractInterfaceDef _stub_type;
+ typedef ::CORBA::AbstractInterfaceDef_ptr _stub_ptr_type;
+ typedef ::CORBA::AbstractInterfaceDef_var _stub_var_type;
+
+ AbstractInterfaceDef (const AbstractInterfaceDef& rhs);
+ virtual ~AbstractInterfaceDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::AbstractInterfaceDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ExtAbstractInterfaceDef;
+ typedef ExtAbstractInterfaceDef *ExtAbstractInterfaceDef_ptr;
+
+ class ExtAbstractInterfaceDef
+ : public virtual POA_CORBA::AbstractInterfaceDef,
+ public virtual POA_CORBA::InterfaceAttrExtension
+ {
+ protected:
+ ExtAbstractInterfaceDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ExtAbstractInterfaceDef _stub_type;
+ typedef ::CORBA::ExtAbstractInterfaceDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ExtAbstractInterfaceDef_var _stub_var_type;
+
+ ExtAbstractInterfaceDef (const ExtAbstractInterfaceDef& rhs);
+ virtual ~ExtAbstractInterfaceDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ExtAbstractInterfaceDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_ext_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class LocalInterfaceDef;
+ typedef LocalInterfaceDef *LocalInterfaceDef_ptr;
+
+ class LocalInterfaceDef
+ : public virtual POA_CORBA::InterfaceDef
+ {
+ protected:
+ LocalInterfaceDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::LocalInterfaceDef _stub_type;
+ typedef ::CORBA::LocalInterfaceDef_ptr _stub_ptr_type;
+ typedef ::CORBA::LocalInterfaceDef_var _stub_var_type;
+
+ LocalInterfaceDef (const LocalInterfaceDef& rhs);
+ virtual ~LocalInterfaceDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::LocalInterfaceDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ExtLocalInterfaceDef;
+ typedef ExtLocalInterfaceDef *ExtLocalInterfaceDef_ptr;
+
+ class ExtLocalInterfaceDef
+ : public virtual POA_CORBA::LocalInterfaceDef,
+ public virtual POA_CORBA::InterfaceAttrExtension
+ {
+ protected:
+ ExtLocalInterfaceDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ExtLocalInterfaceDef _stub_type;
+ typedef ::CORBA::ExtLocalInterfaceDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ExtLocalInterfaceDef_var _stub_var_type;
+
+ ExtLocalInterfaceDef (const ExtLocalInterfaceDef& rhs);
+ virtual ~ExtLocalInterfaceDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ExtLocalInterfaceDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_ext_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+// TAO_IDL - Generated from
+// be\be_visitor_module/module_sh.cpp:80
+
+} // module CORBA
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:1219
+
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include "IFR_BasicS_T.h"
+
+#if defined (__ACE_INLINE__)
+#include "IFR_BasicS.inl"
+#endif /* defined INLINE */
+
+#include /**/ "ace/post.h"
+#endif /* ifndef */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS.inl b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS.inl
new file mode 100644
index 00000000000..302ffa66e28
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS.inl
@@ -0,0 +1,9663 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+ACE_INLINE
+void
+POA_CORBA::Repository::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::Repository::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::Repository *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ModuleDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ModuleDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ConstantDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ConstantDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ConstantDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ConstantDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ConstantDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ConstantDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ConstantDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ConstantDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ConstantDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ConstantDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ConstantDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ConstantDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ConstantDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ConstantDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ConstantDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ConstantDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ConstantDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ConstantDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ConstantDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ConstantDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ConstantDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ConstantDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ConstantDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ConstantDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ConstantDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ConstantDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StructDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::StructDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::UnionDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::UnionDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::EnumDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::EnumDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::EnumDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::EnumDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::EnumDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::EnumDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::EnumDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::EnumDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::EnumDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::EnumDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::EnumDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::EnumDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::EnumDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::EnumDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::EnumDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::EnumDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::EnumDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::EnumDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::EnumDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::EnumDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::EnumDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::EnumDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::EnumDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::EnumDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::EnumDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::EnumDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::EnumDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::EnumDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AliasDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::AliasDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AliasDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::AliasDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AliasDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AliasDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AliasDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AliasDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AliasDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AliasDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AliasDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AliasDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AliasDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AliasDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AliasDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AliasDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AliasDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AliasDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AliasDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AliasDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AliasDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AliasDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AliasDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AliasDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AliasDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AliasDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AliasDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::AliasDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::NativeDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::NativeDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::NativeDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::NativeDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::NativeDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::NativeDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::NativeDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::NativeDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::NativeDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::NativeDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::NativeDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::NativeDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::NativeDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::NativeDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::NativeDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::NativeDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::NativeDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::NativeDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::NativeDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::NativeDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::NativeDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::NativeDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::NativeDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::NativeDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::NativeDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::NativeDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::NativeDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::NativeDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::PrimitiveDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::PrimitiveDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::PrimitiveDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::PrimitiveDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::PrimitiveDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::PrimitiveDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::StringDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::StringDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::StringDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::StringDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::StringDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::StringDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::WstringDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::WstringDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::WstringDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::WstringDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::WstringDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::WstringDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::SequenceDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::SequenceDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::SequenceDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::SequenceDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::SequenceDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::SequenceDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ArrayDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ArrayDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ArrayDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ArrayDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ArrayDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::ArrayDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExceptionDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExceptionDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AttributeDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::AttributeDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AttributeDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::AttributeDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AttributeDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AttributeDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AttributeDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AttributeDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AttributeDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AttributeDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AttributeDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AttributeDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AttributeDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AttributeDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AttributeDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AttributeDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AttributeDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AttributeDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AttributeDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AttributeDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AttributeDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AttributeDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AttributeDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AttributeDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AttributeDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AttributeDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::AttributeDef * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::AttributeDef::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::_get_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::AttributeDef * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::AttributeDef::_get_type_def_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::_set_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::AttributeDef * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::AttributeDef::_set_type_def_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::_get_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::AttributeDef * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::AttributeDef::_get_mode_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAttributeDef::_set_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::AttributeDef * const impl = static_cast<POA_CORBA::ExtAttributeDef *> (servant);
+ POA_CORBA::AttributeDef::_set_mode_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::OperationDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::OperationDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::OperationDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::OperationDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::OperationDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::OperationDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::OperationDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::OperationDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::OperationDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::OperationDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::OperationDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::OperationDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::OperationDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::OperationDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::OperationDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::OperationDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::OperationDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::OperationDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::OperationDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::OperationDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::OperationDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::OperationDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::OperationDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::OperationDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::OperationDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::OperationDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::InterfaceDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::InterfaceDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::_get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::_get_base_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::_set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::_set_base_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::is_a_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::describe_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::create_attribute_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::create_operation_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::describe_ext_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceAttrExtension * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::InterfaceAttrExtension::describe_ext_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtInterfaceDef::create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceAttrExtension * const impl = static_cast<POA_CORBA::ExtInterfaceDef *> (servant);
+ POA_CORBA::InterfaceAttrExtension::create_ext_attribute_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::_get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::_get_base_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::_set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::_set_base_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::is_a_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::describe_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::create_attribute_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::AbstractInterfaceDef::create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::AbstractInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::create_operation_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::_get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::_get_base_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::_set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::_set_base_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::is_a_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::describe_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::create_attribute_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::create_operation_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::describe_ext_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceAttrExtension * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::InterfaceAttrExtension::describe_ext_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtAbstractInterfaceDef::create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceAttrExtension * const impl = static_cast<POA_CORBA::ExtAbstractInterfaceDef *> (servant);
+ POA_CORBA::InterfaceAttrExtension::create_ext_attribute_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::_get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::_get_base_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::_set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::_set_base_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::is_a_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::describe_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::create_attribute_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::LocalInterfaceDef::create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::LocalInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::create_operation_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::_get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::_get_base_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::_set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::_set_base_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::is_a_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::describe_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::create_attribute_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::InterfaceDef::create_operation_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::describe_ext_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceAttrExtension * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::InterfaceAttrExtension::describe_ext_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtLocalInterfaceDef::create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceAttrExtension * const impl = static_cast<POA_CORBA::ExtLocalInterfaceDef *> (servant);
+ POA_CORBA::InterfaceAttrExtension::create_ext_attribute_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS_T.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS_T.cpp
new file mode 100644
index 00000000000..d95b6d48dac
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS_T.cpp
@@ -0,0 +1,49 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:683
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASICS_T_CPP_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASICS_T_CPP_
+
+#include "IFR_BasicS_T.h"
+
+#if !defined (__ACE_INLINE__)
+#include "IFR_BasicS_T.inl"
+#endif /* !defined INLINE */
+
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#endif /* ifndef */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS_T.h b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS_T.h
new file mode 100644
index 00000000000..e316d990dc1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS_T.h
@@ -0,0 +1,7971 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:545
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASICS_T_H_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_BASICS_T_H_
+
+#include /**/ "ace/pre.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_root/root_sth.cpp:116
+
+namespace POA_CORBA
+{
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class Repository_tie : public Repository
+ {
+ public:
+ /// the T& ctor
+ Repository_tie (T &t);
+ /// ctor taking a POA
+ Repository_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ Repository_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ Repository_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~Repository_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup_id (
+ const char * search_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr get_canonical_typecode (
+ ::CORBA::TypeCode_ptr tc
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::PrimitiveDef_ptr get_primitive (
+ ::CORBA::PrimitiveKind kind
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StringDef_ptr create_string (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::WstringDef_ptr create_wstring (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::SequenceDef_ptr create_sequence (
+ ::CORBA::ULong bound,
+ ::CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ArrayDef_ptr create_array (
+ ::CORBA::ULong length,
+ ::CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::FixedDef_ptr create_fixed (
+ ::CORBA::UShort digits,
+ ::CORBA::Short scale
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ Repository_tie (const Repository_tie &);
+ void operator= (const Repository_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ModuleDef_tie : public ModuleDef
+ {
+ public:
+ /// the T& ctor
+ ModuleDef_tie (T &t);
+ /// ctor taking a POA
+ ModuleDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ModuleDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ModuleDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ModuleDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ModuleDef_tie (const ModuleDef_tie &);
+ void operator= (const ModuleDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ConstantDef_tie : public ConstantDef
+ {
+ public:
+ /// the T& ctor
+ ConstantDef_tie (T &t);
+ /// ctor taking a POA
+ ConstantDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ConstantDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ConstantDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ConstantDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::IDLType_ptr type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void type_def (
+ ::CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Any * value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void value (
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ConstantDef_tie (const ConstantDef_tie &);
+ void operator= (const ConstantDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class StructDef_tie : public StructDef
+ {
+ public:
+ /// the T& ctor
+ StructDef_tie (T &t);
+ /// ctor taking a POA
+ StructDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ StructDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ StructDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~StructDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructMemberSeq * members (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void members (
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ StructDef_tie (const StructDef_tie &);
+ void operator= (const StructDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class UnionDef_tie : public UnionDef
+ {
+ public:
+ /// the T& ctor
+ UnionDef_tie (T &t);
+ /// ctor taking a POA
+ UnionDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ UnionDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ UnionDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~UnionDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr discriminator_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::IDLType_ptr discriminator_type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void discriminator_type_def (
+ ::CORBA::IDLType_ptr discriminator_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionMemberSeq * members (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void members (
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ UnionDef_tie (const UnionDef_tie &);
+ void operator= (const UnionDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class EnumDef_tie : public EnumDef
+ {
+ public:
+ /// the T& ctor
+ EnumDef_tie (T &t);
+ /// ctor taking a POA
+ EnumDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ EnumDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ EnumDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~EnumDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumMemberSeq * members (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void members (
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ EnumDef_tie (const EnumDef_tie &);
+ void operator= (const EnumDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class AliasDef_tie : public AliasDef
+ {
+ public:
+ /// the T& ctor
+ AliasDef_tie (T &t);
+ /// ctor taking a POA
+ AliasDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ AliasDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ AliasDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~AliasDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::IDLType_ptr original_type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void original_type_def (
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ AliasDef_tie (const AliasDef_tie &);
+ void operator= (const AliasDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class NativeDef_tie : public NativeDef
+ {
+ public:
+ /// the T& ctor
+ NativeDef_tie (T &t);
+ /// ctor taking a POA
+ NativeDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ NativeDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ NativeDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~NativeDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ NativeDef_tie (const NativeDef_tie &);
+ void operator= (const NativeDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class PrimitiveDef_tie : public PrimitiveDef
+ {
+ public:
+ /// the T& ctor
+ PrimitiveDef_tie (T &t);
+ /// ctor taking a POA
+ PrimitiveDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ PrimitiveDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ PrimitiveDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~PrimitiveDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::PrimitiveKind kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ PrimitiveDef_tie (const PrimitiveDef_tie &);
+ void operator= (const PrimitiveDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class StringDef_tie : public StringDef
+ {
+ public:
+ /// the T& ctor
+ StringDef_tie (T &t);
+ /// ctor taking a POA
+ StringDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ StringDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ StringDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~StringDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ULong bound (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void bound (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ StringDef_tie (const StringDef_tie &);
+ void operator= (const StringDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class WstringDef_tie : public WstringDef
+ {
+ public:
+ /// the T& ctor
+ WstringDef_tie (T &t);
+ /// ctor taking a POA
+ WstringDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ WstringDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ WstringDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~WstringDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ULong bound (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void bound (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ WstringDef_tie (const WstringDef_tie &);
+ void operator= (const WstringDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class SequenceDef_tie : public SequenceDef
+ {
+ public:
+ /// the T& ctor
+ SequenceDef_tie (T &t);
+ /// ctor taking a POA
+ SequenceDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ SequenceDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ SequenceDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~SequenceDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ULong bound (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void bound (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr element_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::IDLType_ptr element_type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void element_type_def (
+ ::CORBA::IDLType_ptr element_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ SequenceDef_tie (const SequenceDef_tie &);
+ void operator= (const SequenceDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ArrayDef_tie : public ArrayDef
+ {
+ public:
+ /// the T& ctor
+ ArrayDef_tie (T &t);
+ /// ctor taking a POA
+ ArrayDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ArrayDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ArrayDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ArrayDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ULong length (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void length (
+ ::CORBA::ULong length
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr element_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::IDLType_ptr element_type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void element_type_def (
+ ::CORBA::IDLType_ptr element_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ArrayDef_tie (const ArrayDef_tie &);
+ void operator= (const ArrayDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ExceptionDef_tie : public ExceptionDef
+ {
+ public:
+ /// the T& ctor
+ ExceptionDef_tie (T &t);
+ /// ctor taking a POA
+ ExceptionDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ExceptionDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ExceptionDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ExceptionDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructMemberSeq * members (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void members (
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ExceptionDef_tie (const ExceptionDef_tie &);
+ void operator= (const ExceptionDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class AttributeDef_tie : public AttributeDef
+ {
+ public:
+ /// the T& ctor
+ AttributeDef_tie (T &t);
+ /// ctor taking a POA
+ AttributeDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ AttributeDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ AttributeDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~AttributeDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::IDLType_ptr type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void type_def (
+ ::CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AttributeMode mode (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void mode (
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ AttributeDef_tie (const AttributeDef_tie &);
+ void operator= (const AttributeDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ExtAttributeDef_tie : public ExtAttributeDef
+ {
+ public:
+ /// the T& ctor
+ ExtAttributeDef_tie (T &t);
+ /// ctor taking a POA
+ ExtAttributeDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ExtAttributeDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ExtAttributeDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ExtAttributeDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::IDLType_ptr type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void type_def (
+ ::CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AttributeMode mode (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void mode (
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExcDescriptionSeq * get_exceptions (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void get_exceptions (
+ const ::CORBA::ExcDescriptionSeq & get_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExcDescriptionSeq * set_exceptions (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void set_exceptions (
+ const ::CORBA::ExcDescriptionSeq & set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtAttributeDescription * describe_attribute (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ExtAttributeDef_tie (const ExtAttributeDef_tie &);
+ void operator= (const ExtAttributeDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class OperationDef_tie : public OperationDef
+ {
+ public:
+ /// the T& ctor
+ OperationDef_tie (T &t);
+ /// ctor taking a POA
+ OperationDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ OperationDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ OperationDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~OperationDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr result (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::IDLType_ptr result_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void result_def (
+ ::CORBA::IDLType_ptr result_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ParDescriptionSeq * params (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void params (
+ const ::CORBA::ParDescriptionSeq & params
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::OperationMode mode (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void mode (
+ ::CORBA::OperationMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContextIdSeq * contexts (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void contexts (
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDefSeq * exceptions (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void exceptions (
+ const ::CORBA::ExceptionDefSeq & exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ OperationDef_tie (const OperationDef_tie &);
+ void operator= (const OperationDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class InterfaceDef_tie : public InterfaceDef
+ {
+ public:
+ /// the T& ctor
+ InterfaceDef_tie (T &t);
+ /// ctor taking a POA
+ InterfaceDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ InterfaceDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ InterfaceDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~InterfaceDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDefSeq * base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef::FullInterfaceDescription * describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AttributeDef_ptr create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::OperationDef_ptr create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ InterfaceDef_tie (const InterfaceDef_tie &);
+ void operator= (const InterfaceDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class InterfaceAttrExtension_tie : public InterfaceAttrExtension
+ {
+ public:
+ /// the T& ctor
+ InterfaceAttrExtension_tie (T &t);
+ /// ctor taking a POA
+ InterfaceAttrExtension_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ InterfaceAttrExtension_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ InterfaceAttrExtension_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~InterfaceAttrExtension_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription * describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtAttributeDef_ptr create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ InterfaceAttrExtension_tie (const InterfaceAttrExtension_tie &);
+ void operator= (const InterfaceAttrExtension_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ExtInterfaceDef_tie : public ExtInterfaceDef
+ {
+ public:
+ /// the T& ctor
+ ExtInterfaceDef_tie (T &t);
+ /// ctor taking a POA
+ ExtInterfaceDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ExtInterfaceDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ExtInterfaceDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ExtInterfaceDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDefSeq * base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef::FullInterfaceDescription * describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AttributeDef_ptr create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::OperationDef_ptr create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription * describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtAttributeDef_ptr create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ExtInterfaceDef_tie (const ExtInterfaceDef_tie &);
+ void operator= (const ExtInterfaceDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class AbstractInterfaceDef_tie : public AbstractInterfaceDef
+ {
+ public:
+ /// the T& ctor
+ AbstractInterfaceDef_tie (T &t);
+ /// ctor taking a POA
+ AbstractInterfaceDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ AbstractInterfaceDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ AbstractInterfaceDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~AbstractInterfaceDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDefSeq * base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef::FullInterfaceDescription * describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AttributeDef_ptr create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::OperationDef_ptr create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ AbstractInterfaceDef_tie (const AbstractInterfaceDef_tie &);
+ void operator= (const AbstractInterfaceDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ExtAbstractInterfaceDef_tie : public ExtAbstractInterfaceDef
+ {
+ public:
+ /// the T& ctor
+ ExtAbstractInterfaceDef_tie (T &t);
+ /// ctor taking a POA
+ ExtAbstractInterfaceDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ExtAbstractInterfaceDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ExtAbstractInterfaceDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ExtAbstractInterfaceDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDefSeq * base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef::FullInterfaceDescription * describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AttributeDef_ptr create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::OperationDef_ptr create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription * describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtAttributeDef_ptr create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ExtAbstractInterfaceDef_tie (const ExtAbstractInterfaceDef_tie &);
+ void operator= (const ExtAbstractInterfaceDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class LocalInterfaceDef_tie : public LocalInterfaceDef
+ {
+ public:
+ /// the T& ctor
+ LocalInterfaceDef_tie (T &t);
+ /// ctor taking a POA
+ LocalInterfaceDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ LocalInterfaceDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ LocalInterfaceDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~LocalInterfaceDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDefSeq * base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef::FullInterfaceDescription * describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AttributeDef_ptr create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::OperationDef_ptr create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ LocalInterfaceDef_tie (const LocalInterfaceDef_tie &);
+ void operator= (const LocalInterfaceDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ExtLocalInterfaceDef_tie : public ExtLocalInterfaceDef
+ {
+ public:
+ /// the T& ctor
+ ExtLocalInterfaceDef_tie (T &t);
+ /// ctor taking a POA
+ ExtLocalInterfaceDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ExtLocalInterfaceDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ExtLocalInterfaceDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ExtLocalInterfaceDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDefSeq * base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef::FullInterfaceDescription * describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AttributeDef_ptr create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::OperationDef_ptr create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription * describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtAttributeDef_ptr create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ExtLocalInterfaceDef_tie (const ExtLocalInterfaceDef_tie &);
+ void operator= (const ExtLocalInterfaceDef_tie &);
+ };
+} // module CORBA
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:1322
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "IFR_BasicS_T.inl"
+#endif /* defined INLINE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "IFR_BasicS_T.cpp"
+#endif /* defined REQUIRED SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("IFR_BasicS_T.cpp")
+#endif /* defined REQUIRED PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* ifndef */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS_T.inl b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS_T.inl
new file mode 100644
index 00000000000..dcc845194d3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_BasicS_T.inl
@@ -0,0 +1,13439 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::Repository_tie<T>::Repository_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::Repository_tie<T>::Repository_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::Repository_tie<T>::Repository_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::Repository_tie<T>::Repository_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::Repository_tie<T>::~Repository_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::Repository_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::Repository_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::Repository_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::Repository_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::Repository_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::Repository_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->Repository::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::Repository_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::Repository_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::Repository_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::Repository_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::Repository_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::Repository_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::Repository_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::Repository_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::Repository_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::Repository_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::Repository_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::Repository_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::Repository_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::Repository_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::Repository_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::Repository_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::Repository_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::Repository_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::Repository_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::Repository_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::Repository_tie<T>::lookup_id (
+ const char * search_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_id (
+ search_id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::Repository_tie<T>::get_canonical_typecode (
+ ::CORBA::TypeCode_ptr tc
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->get_canonical_typecode (
+ tc
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::PrimitiveDef_ptr POA_CORBA::Repository_tie<T>::get_primitive (
+ ::CORBA::PrimitiveKind kind
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->get_primitive (
+ kind
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StringDef_ptr POA_CORBA::Repository_tie<T>::create_string (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_string (
+ bound
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::WstringDef_ptr POA_CORBA::Repository_tie<T>::create_wstring (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_wstring (
+ bound
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::SequenceDef_ptr POA_CORBA::Repository_tie<T>::create_sequence (
+ ::CORBA::ULong bound,
+ ::CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_sequence (
+ bound,
+ element_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ArrayDef_ptr POA_CORBA::Repository_tie<T>::create_array (
+ ::CORBA::ULong length,
+ ::CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_array (
+ length,
+ element_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::FixedDef_ptr POA_CORBA::Repository_tie<T>::create_fixed (
+ ::CORBA::UShort digits,
+ ::CORBA::Short scale
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_fixed (
+ digits,
+ scale
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ModuleDef_tie<T>::ModuleDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ModuleDef_tie<T>::ModuleDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ModuleDef_tie<T>::ModuleDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ModuleDef_tie<T>::ModuleDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ModuleDef_tie<T>::~ModuleDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ModuleDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ModuleDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ModuleDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ModuleDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ModuleDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ModuleDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ModuleDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ModuleDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ModuleDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::ModuleDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ModuleDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ModuleDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::ModuleDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::ModuleDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::ModuleDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::ModuleDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::ModuleDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::ModuleDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::ModuleDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::ModuleDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ModuleDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::ModuleDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::ModuleDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::ModuleDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::ModuleDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::ModuleDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::ModuleDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ModuleDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ModuleDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ModuleDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ModuleDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ModuleDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ModuleDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ModuleDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ModuleDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ModuleDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ModuleDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ModuleDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ConstantDef_tie<T>::ConstantDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ConstantDef_tie<T>::ConstantDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ConstantDef_tie<T>::ConstantDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ConstantDef_tie<T>::ConstantDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ConstantDef_tie<T>::~ConstantDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ConstantDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ConstantDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ConstantDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ConstantDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ConstantDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ConstantDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ConstantDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ConstantDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ConstantDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ConstantDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ConstantDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ConstantDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ConstantDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ConstantDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ConstantDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ConstantDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ConstantDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ConstantDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ConstantDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ConstantDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ConstantDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::IDLType_ptr POA_CORBA::ConstantDef_tie<T>::type_def (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ConstantDef_tie<T>::type_def (
+ ::CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->type_def (
+ type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Any * POA_CORBA::ConstantDef_tie<T>::value (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->value (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ConstantDef_tie<T>::value (
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->value (
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::StructDef_tie<T>::StructDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::StructDef_tie<T>::StructDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::StructDef_tie<T>::StructDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::StructDef_tie<T>::StructDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::StructDef_tie<T>::~StructDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::StructDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::StructDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::StructDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::StructDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::StructDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::StructDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->StructDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::StructDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::StructDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::StructDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::StructDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::StructDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::StructDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::StructDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::StructDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::StructDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::StructDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::StructDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::StructDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::StructDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::StructDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::StructDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::StructDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::StructDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::StructDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::StructDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::StructDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::StructDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::StructDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::StructDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::StructDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::StructDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::StructDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::StructDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::StructDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::StructDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::StructDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::StructDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::StructDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructMemberSeq * POA_CORBA::StructDef_tie<T>::members (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->members (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::StructDef_tie<T>::members (
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->members (
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::UnionDef_tie<T>::UnionDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::UnionDef_tie<T>::UnionDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::UnionDef_tie<T>::UnionDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::UnionDef_tie<T>::UnionDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::UnionDef_tie<T>::~UnionDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::UnionDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::UnionDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::UnionDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::UnionDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::UnionDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::UnionDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->UnionDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::UnionDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::UnionDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::UnionDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::UnionDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::UnionDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::UnionDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::UnionDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::UnionDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::UnionDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::UnionDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::UnionDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::UnionDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::UnionDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::UnionDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::UnionDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::UnionDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::UnionDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::UnionDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::UnionDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::UnionDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::UnionDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::UnionDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::UnionDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::UnionDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::UnionDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::UnionDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::UnionDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::UnionDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::UnionDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::UnionDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::UnionDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::UnionDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::UnionDef_tie<T>::discriminator_type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->discriminator_type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::IDLType_ptr POA_CORBA::UnionDef_tie<T>::discriminator_type_def (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->discriminator_type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::UnionDef_tie<T>::discriminator_type_def (
+ ::CORBA::IDLType_ptr discriminator_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->discriminator_type_def (
+ discriminator_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionMemberSeq * POA_CORBA::UnionDef_tie<T>::members (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->members (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::UnionDef_tie<T>::members (
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->members (
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::EnumDef_tie<T>::EnumDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::EnumDef_tie<T>::EnumDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::EnumDef_tie<T>::EnumDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::EnumDef_tie<T>::EnumDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::EnumDef_tie<T>::~EnumDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::EnumDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::EnumDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::EnumDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::EnumDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::EnumDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::EnumDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->EnumDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::EnumDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::EnumDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::EnumDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::EnumDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::EnumDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::EnumDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::EnumDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::EnumDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::EnumDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::EnumDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::EnumDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::EnumDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::EnumDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::EnumDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumMemberSeq * POA_CORBA::EnumDef_tie<T>::members (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->members (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::EnumDef_tie<T>::members (
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->members (
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::AliasDef_tie<T>::AliasDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::AliasDef_tie<T>::AliasDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::AliasDef_tie<T>::AliasDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::AliasDef_tie<T>::AliasDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::AliasDef_tie<T>::~AliasDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::AliasDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::AliasDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::AliasDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::AliasDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::AliasDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::AliasDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->AliasDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::AliasDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AliasDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::AliasDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AliasDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::AliasDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AliasDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::AliasDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AliasDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::AliasDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::AliasDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::AliasDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::AliasDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AliasDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::AliasDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::IDLType_ptr POA_CORBA::AliasDef_tie<T>::original_type_def (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->original_type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AliasDef_tie<T>::original_type_def (
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->original_type_def (
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::NativeDef_tie<T>::NativeDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::NativeDef_tie<T>::NativeDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::NativeDef_tie<T>::NativeDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::NativeDef_tie<T>::NativeDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::NativeDef_tie<T>::~NativeDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::NativeDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::NativeDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::NativeDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::NativeDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::NativeDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::NativeDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->NativeDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::NativeDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::NativeDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::NativeDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::NativeDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::NativeDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::NativeDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::NativeDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::NativeDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::NativeDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::NativeDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::NativeDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::NativeDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::NativeDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::NativeDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::PrimitiveDef_tie<T>::PrimitiveDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::PrimitiveDef_tie<T>::PrimitiveDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::PrimitiveDef_tie<T>::PrimitiveDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::PrimitiveDef_tie<T>::PrimitiveDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::PrimitiveDef_tie<T>::~PrimitiveDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::PrimitiveDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::PrimitiveDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::PrimitiveDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::PrimitiveDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::PrimitiveDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::PrimitiveDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->PrimitiveDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::PrimitiveDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::PrimitiveDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::PrimitiveDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::PrimitiveKind POA_CORBA::PrimitiveDef_tie<T>::kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::StringDef_tie<T>::StringDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::StringDef_tie<T>::StringDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::StringDef_tie<T>::StringDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::StringDef_tie<T>::StringDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::StringDef_tie<T>::~StringDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::StringDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::StringDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::StringDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::StringDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::StringDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::StringDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->StringDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::StringDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::StringDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::StringDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ULong POA_CORBA::StringDef_tie<T>::bound (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->bound (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::StringDef_tie<T>::bound (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->bound (
+ bound
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::WstringDef_tie<T>::WstringDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::WstringDef_tie<T>::WstringDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::WstringDef_tie<T>::WstringDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::WstringDef_tie<T>::WstringDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::WstringDef_tie<T>::~WstringDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::WstringDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::WstringDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::WstringDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::WstringDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::WstringDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::WstringDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->WstringDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::WstringDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::WstringDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::WstringDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ULong POA_CORBA::WstringDef_tie<T>::bound (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->bound (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::WstringDef_tie<T>::bound (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->bound (
+ bound
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::SequenceDef_tie<T>::SequenceDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::SequenceDef_tie<T>::SequenceDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::SequenceDef_tie<T>::SequenceDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::SequenceDef_tie<T>::SequenceDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::SequenceDef_tie<T>::~SequenceDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::SequenceDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::SequenceDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::SequenceDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::SequenceDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::SequenceDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::SequenceDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->SequenceDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::SequenceDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::SequenceDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::SequenceDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ULong POA_CORBA::SequenceDef_tie<T>::bound (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->bound (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::SequenceDef_tie<T>::bound (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->bound (
+ bound
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::SequenceDef_tie<T>::element_type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->element_type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::IDLType_ptr POA_CORBA::SequenceDef_tie<T>::element_type_def (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->element_type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::SequenceDef_tie<T>::element_type_def (
+ ::CORBA::IDLType_ptr element_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->element_type_def (
+ element_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ArrayDef_tie<T>::ArrayDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ArrayDef_tie<T>::ArrayDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ArrayDef_tie<T>::ArrayDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ArrayDef_tie<T>::ArrayDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ArrayDef_tie<T>::~ArrayDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ArrayDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ArrayDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ArrayDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ArrayDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ArrayDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ArrayDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ArrayDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ArrayDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ArrayDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ArrayDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ULong POA_CORBA::ArrayDef_tie<T>::length (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->length (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ArrayDef_tie<T>::length (
+ ::CORBA::ULong length
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->length (
+ length
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ArrayDef_tie<T>::element_type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->element_type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::IDLType_ptr POA_CORBA::ArrayDef_tie<T>::element_type_def (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->element_type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ArrayDef_tie<T>::element_type_def (
+ ::CORBA::IDLType_ptr element_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->element_type_def (
+ element_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ExceptionDef_tie<T>::ExceptionDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExceptionDef_tie<T>::ExceptionDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExceptionDef_tie<T>::ExceptionDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExceptionDef_tie<T>::ExceptionDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExceptionDef_tie<T>::~ExceptionDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ExceptionDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExceptionDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExceptionDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ExceptionDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExceptionDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ExceptionDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ExceptionDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ExceptionDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExceptionDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExceptionDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExceptionDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExceptionDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExceptionDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExceptionDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExceptionDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ExceptionDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExceptionDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ExceptionDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ExceptionDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExceptionDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::ExceptionDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ExceptionDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ExceptionDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::ExceptionDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::ExceptionDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::ExceptionDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::ExceptionDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::ExceptionDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::ExceptionDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::ExceptionDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::ExceptionDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ExceptionDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::ExceptionDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::ExceptionDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::ExceptionDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::ExceptionDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::ExceptionDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::ExceptionDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ExceptionDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructMemberSeq * POA_CORBA::ExceptionDef_tie<T>::members (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->members (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExceptionDef_tie<T>::members (
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->members (
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::AttributeDef_tie<T>::AttributeDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::AttributeDef_tie<T>::AttributeDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::AttributeDef_tie<T>::AttributeDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::AttributeDef_tie<T>::AttributeDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::AttributeDef_tie<T>::~AttributeDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::AttributeDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::AttributeDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::AttributeDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::AttributeDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::AttributeDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::AttributeDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->AttributeDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::AttributeDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AttributeDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::AttributeDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AttributeDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::AttributeDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AttributeDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::AttributeDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AttributeDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::AttributeDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::AttributeDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::AttributeDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::AttributeDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AttributeDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::AttributeDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::IDLType_ptr POA_CORBA::AttributeDef_tie<T>::type_def (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AttributeDef_tie<T>::type_def (
+ ::CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->type_def (
+ type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AttributeMode POA_CORBA::AttributeDef_tie<T>::mode (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->mode (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AttributeDef_tie<T>::mode (
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->mode (
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtAttributeDef_tie<T>::ExtAttributeDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtAttributeDef_tie<T>::ExtAttributeDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtAttributeDef_tie<T>::ExtAttributeDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtAttributeDef_tie<T>::ExtAttributeDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtAttributeDef_tie<T>::~ExtAttributeDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ExtAttributeDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExtAttributeDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExtAttributeDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ExtAttributeDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExtAttributeDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ExtAttributeDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ExtAttributeDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ExtAttributeDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtAttributeDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtAttributeDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtAttributeDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtAttributeDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtAttributeDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtAttributeDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtAttributeDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ExtAttributeDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtAttributeDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ExtAttributeDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ExtAttributeDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtAttributeDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ExtAttributeDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::IDLType_ptr POA_CORBA::ExtAttributeDef_tie<T>::type_def (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtAttributeDef_tie<T>::type_def (
+ ::CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->type_def (
+ type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AttributeMode POA_CORBA::ExtAttributeDef_tie<T>::mode (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->mode (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtAttributeDef_tie<T>::mode (
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->mode (
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExcDescriptionSeq * POA_CORBA::ExtAttributeDef_tie<T>::get_exceptions (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->get_exceptions (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtAttributeDef_tie<T>::get_exceptions (
+ const ::CORBA::ExcDescriptionSeq & get_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->get_exceptions (
+ get_exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExcDescriptionSeq * POA_CORBA::ExtAttributeDef_tie<T>::set_exceptions (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->set_exceptions (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtAttributeDef_tie<T>::set_exceptions (
+ const ::CORBA::ExcDescriptionSeq & set_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->set_exceptions (
+ set_exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtAttributeDescription * POA_CORBA::ExtAttributeDef_tie<T>::describe_attribute (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_attribute (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::OperationDef_tie<T>::OperationDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::OperationDef_tie<T>::OperationDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::OperationDef_tie<T>::OperationDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::OperationDef_tie<T>::OperationDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::OperationDef_tie<T>::~OperationDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::OperationDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::OperationDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::OperationDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::OperationDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::OperationDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::OperationDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->OperationDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::OperationDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::OperationDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::OperationDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::OperationDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::OperationDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::OperationDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::OperationDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::OperationDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::OperationDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::OperationDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::OperationDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::OperationDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::OperationDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::OperationDef_tie<T>::result (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->result (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::IDLType_ptr POA_CORBA::OperationDef_tie<T>::result_def (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->result_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::OperationDef_tie<T>::result_def (
+ ::CORBA::IDLType_ptr result_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->result_def (
+ result_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ParDescriptionSeq * POA_CORBA::OperationDef_tie<T>::params (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->params (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::OperationDef_tie<T>::params (
+ const ::CORBA::ParDescriptionSeq & params
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->params (
+ params
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::OperationMode POA_CORBA::OperationDef_tie<T>::mode (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->mode (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::OperationDef_tie<T>::mode (
+ ::CORBA::OperationMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->mode (
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContextIdSeq * POA_CORBA::OperationDef_tie<T>::contexts (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contexts (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::OperationDef_tie<T>::contexts (
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->contexts (
+ contexts
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDefSeq * POA_CORBA::OperationDef_tie<T>::exceptions (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->exceptions (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::OperationDef_tie<T>::exceptions (
+ const ::CORBA::ExceptionDefSeq & exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->exceptions (
+ exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::InterfaceDef_tie<T>::InterfaceDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::InterfaceDef_tie<T>::InterfaceDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::InterfaceDef_tie<T>::InterfaceDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::InterfaceDef_tie<T>::InterfaceDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::InterfaceDef_tie<T>::~InterfaceDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::InterfaceDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::InterfaceDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::InterfaceDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::InterfaceDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::InterfaceDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::InterfaceDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->InterfaceDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::InterfaceDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::InterfaceDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::InterfaceDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::InterfaceDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::InterfaceDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::InterfaceDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::InterfaceDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::InterfaceDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::InterfaceDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::InterfaceDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::InterfaceDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::InterfaceDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::InterfaceDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::InterfaceDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::InterfaceDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::InterfaceDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::InterfaceDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::InterfaceDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDefSeq * POA_CORBA::InterfaceDef_tie<T>::base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->base_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::InterfaceDef_tie<T>::base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->base_interfaces (
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::InterfaceDef_tie<T>::is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_a (
+ interface_id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef::FullInterfaceDescription * POA_CORBA::InterfaceDef_tie<T>::describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AttributeDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::OperationDef_ptr POA_CORBA::InterfaceDef_tie<T>::create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_operation (
+ id,
+ name,
+ version,
+ result,
+ mode,
+ params,
+ exceptions,
+ contexts
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::InterfaceAttrExtension_tie<T>::InterfaceAttrExtension_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::InterfaceAttrExtension_tie<T>::InterfaceAttrExtension_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::InterfaceAttrExtension_tie<T>::InterfaceAttrExtension_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::InterfaceAttrExtension_tie<T>::InterfaceAttrExtension_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::InterfaceAttrExtension_tie<T>::~InterfaceAttrExtension_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::InterfaceAttrExtension_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::InterfaceAttrExtension_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::InterfaceAttrExtension_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::InterfaceAttrExtension_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::InterfaceAttrExtension_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::InterfaceAttrExtension_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->InterfaceAttrExtension::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription * POA_CORBA::InterfaceAttrExtension_tie<T>::describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtAttributeDef_ptr POA_CORBA::InterfaceAttrExtension_tie<T>::create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode,
+ get_exceptions,
+ set_exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtInterfaceDef_tie<T>::ExtInterfaceDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtInterfaceDef_tie<T>::ExtInterfaceDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtInterfaceDef_tie<T>::ExtInterfaceDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtInterfaceDef_tie<T>::ExtInterfaceDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtInterfaceDef_tie<T>::~ExtInterfaceDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ExtInterfaceDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExtInterfaceDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExtInterfaceDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ExtInterfaceDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExtInterfaceDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ExtInterfaceDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ExtInterfaceDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ExtInterfaceDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtInterfaceDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::ExtInterfaceDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ExtInterfaceDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ExtInterfaceDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::ExtInterfaceDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtInterfaceDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtInterfaceDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtInterfaceDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtInterfaceDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtInterfaceDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtInterfaceDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ExtInterfaceDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtInterfaceDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ExtInterfaceDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ExtInterfaceDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtInterfaceDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ExtInterfaceDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDefSeq * POA_CORBA::ExtInterfaceDef_tie<T>::base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->base_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtInterfaceDef_tie<T>::base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->base_interfaces (
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ExtInterfaceDef_tie<T>::is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_a (
+ interface_id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef::FullInterfaceDescription * POA_CORBA::ExtInterfaceDef_tie<T>::describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AttributeDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::OperationDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_operation (
+ id,
+ name,
+ version,
+ result,
+ mode,
+ params,
+ exceptions,
+ contexts
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription * POA_CORBA::ExtInterfaceDef_tie<T>::describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtAttributeDef_ptr POA_CORBA::ExtInterfaceDef_tie<T>::create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode,
+ get_exceptions,
+ set_exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::AbstractInterfaceDef_tie<T>::AbstractInterfaceDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::AbstractInterfaceDef_tie<T>::AbstractInterfaceDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::AbstractInterfaceDef_tie<T>::AbstractInterfaceDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::AbstractInterfaceDef_tie<T>::AbstractInterfaceDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::AbstractInterfaceDef_tie<T>::~AbstractInterfaceDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::AbstractInterfaceDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::AbstractInterfaceDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::AbstractInterfaceDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::AbstractInterfaceDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::AbstractInterfaceDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::AbstractInterfaceDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->AbstractInterfaceDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::AbstractInterfaceDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AbstractInterfaceDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::AbstractInterfaceDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::AbstractInterfaceDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::AbstractInterfaceDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::AbstractInterfaceDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AbstractInterfaceDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::AbstractInterfaceDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AbstractInterfaceDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::AbstractInterfaceDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AbstractInterfaceDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::AbstractInterfaceDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::AbstractInterfaceDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AbstractInterfaceDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDefSeq * POA_CORBA::AbstractInterfaceDef_tie<T>::base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->base_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::AbstractInterfaceDef_tie<T>::base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->base_interfaces (
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::AbstractInterfaceDef_tie<T>::is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_a (
+ interface_id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef::FullInterfaceDescription * POA_CORBA::AbstractInterfaceDef_tie<T>::describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AttributeDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::OperationDef_ptr POA_CORBA::AbstractInterfaceDef_tie<T>::create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_operation (
+ id,
+ name,
+ version,
+ result,
+ mode,
+ params,
+ exceptions,
+ contexts
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtAbstractInterfaceDef_tie<T>::ExtAbstractInterfaceDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtAbstractInterfaceDef_tie<T>::ExtAbstractInterfaceDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtAbstractInterfaceDef_tie<T>::ExtAbstractInterfaceDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtAbstractInterfaceDef_tie<T>::ExtAbstractInterfaceDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtAbstractInterfaceDef_tie<T>::~ExtAbstractInterfaceDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ExtAbstractInterfaceDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExtAbstractInterfaceDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExtAbstractInterfaceDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ExtAbstractInterfaceDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExtAbstractInterfaceDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ExtAbstractInterfaceDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ExtAbstractInterfaceDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ExtAbstractInterfaceDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtAbstractInterfaceDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ExtAbstractInterfaceDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ExtAbstractInterfaceDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::ExtAbstractInterfaceDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtAbstractInterfaceDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtAbstractInterfaceDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtAbstractInterfaceDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtAbstractInterfaceDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtAbstractInterfaceDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtAbstractInterfaceDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtAbstractInterfaceDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ExtAbstractInterfaceDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtAbstractInterfaceDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDefSeq * POA_CORBA::ExtAbstractInterfaceDef_tie<T>::base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->base_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtAbstractInterfaceDef_tie<T>::base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->base_interfaces (
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ExtAbstractInterfaceDef_tie<T>::is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_a (
+ interface_id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef::FullInterfaceDescription * POA_CORBA::ExtAbstractInterfaceDef_tie<T>::describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AttributeDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::OperationDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_operation (
+ id,
+ name,
+ version,
+ result,
+ mode,
+ params,
+ exceptions,
+ contexts
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription * POA_CORBA::ExtAbstractInterfaceDef_tie<T>::describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtAttributeDef_ptr POA_CORBA::ExtAbstractInterfaceDef_tie<T>::create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode,
+ get_exceptions,
+ set_exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::LocalInterfaceDef_tie<T>::LocalInterfaceDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::LocalInterfaceDef_tie<T>::LocalInterfaceDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::LocalInterfaceDef_tie<T>::LocalInterfaceDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::LocalInterfaceDef_tie<T>::LocalInterfaceDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::LocalInterfaceDef_tie<T>::~LocalInterfaceDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::LocalInterfaceDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::LocalInterfaceDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::LocalInterfaceDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::LocalInterfaceDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::LocalInterfaceDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::LocalInterfaceDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->LocalInterfaceDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::LocalInterfaceDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::LocalInterfaceDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::LocalInterfaceDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::LocalInterfaceDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::LocalInterfaceDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::LocalInterfaceDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::LocalInterfaceDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::LocalInterfaceDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::LocalInterfaceDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::LocalInterfaceDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::LocalInterfaceDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::LocalInterfaceDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::LocalInterfaceDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::LocalInterfaceDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::LocalInterfaceDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::LocalInterfaceDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::LocalInterfaceDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::LocalInterfaceDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDefSeq * POA_CORBA::LocalInterfaceDef_tie<T>::base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->base_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::LocalInterfaceDef_tie<T>::base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->base_interfaces (
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::LocalInterfaceDef_tie<T>::is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_a (
+ interface_id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef::FullInterfaceDescription * POA_CORBA::LocalInterfaceDef_tie<T>::describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AttributeDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::OperationDef_ptr POA_CORBA::LocalInterfaceDef_tie<T>::create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_operation (
+ id,
+ name,
+ version,
+ result,
+ mode,
+ params,
+ exceptions,
+ contexts
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtLocalInterfaceDef_tie<T>::ExtLocalInterfaceDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtLocalInterfaceDef_tie<T>::ExtLocalInterfaceDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtLocalInterfaceDef_tie<T>::ExtLocalInterfaceDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtLocalInterfaceDef_tie<T>::ExtLocalInterfaceDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtLocalInterfaceDef_tie<T>::~ExtLocalInterfaceDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ExtLocalInterfaceDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExtLocalInterfaceDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExtLocalInterfaceDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ExtLocalInterfaceDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExtLocalInterfaceDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ExtLocalInterfaceDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ExtLocalInterfaceDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ExtLocalInterfaceDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtLocalInterfaceDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ExtLocalInterfaceDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ExtLocalInterfaceDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::ExtLocalInterfaceDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtLocalInterfaceDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtLocalInterfaceDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtLocalInterfaceDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtLocalInterfaceDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtLocalInterfaceDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtLocalInterfaceDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtLocalInterfaceDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ExtLocalInterfaceDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtLocalInterfaceDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDefSeq * POA_CORBA::ExtLocalInterfaceDef_tie<T>::base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->base_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtLocalInterfaceDef_tie<T>::base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->base_interfaces (
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ExtLocalInterfaceDef_tie<T>::is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_a (
+ interface_id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef::FullInterfaceDescription * POA_CORBA::ExtLocalInterfaceDef_tie<T>::describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AttributeDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::OperationDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_operation (
+ id,
+ name,
+ version,
+ result,
+ mode,
+ params,
+ exceptions,
+ contexts
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription * POA_CORBA::ExtLocalInterfaceDef_tie<T>::describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtAttributeDef_ptr POA_CORBA::ExtLocalInterfaceDef_tie<T>::create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode,
+ get_exceptions,
+ set_exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS.cpp
new file mode 100644
index 00000000000..1e7fe4beb0c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS.cpp
@@ -0,0 +1,14264 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:603
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_COMPONENTSS_CPP_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_COMPONENTSS_CPP_
+
+
+#include "IFR_ComponentsS.h"
+#include "tao/PortableServer/Operation_Table_Perfect_Hash.h"
+#include "tao/PortableServer/Upcall_Command.h"
+#include "tao/PortableServer/Upcall_Wrapper.h"
+#include "tao/TAO_Server_Request.h"
+#include "tao/ORB_Core.h"
+#include "tao/Profile.h"
+#include "tao/Stub.h"
+#include "tao/IFR_Client_Adapter.h"
+#include "tao/Object_T.h"
+#include "tao/AnyTypeCode/TypeCode.h"
+#include "tao/AnyTypeCode/DynamicC.h"
+#include "tao/CDR.h"
+#include "tao/operation_details.h"
+#include "tao/PortableInterceptor.h"
+#include "tao/PortableServer/Basic_SArguments.h"
+#include "tao/PortableServer/Object_SArgument_T.h"
+#include "tao/PortableServer/Special_Basic_SArguments.h"
+#include "tao/PortableServer/UB_String_SArguments.h"
+#include "tao/PortableServer/Var_Size_SArgument_T.h"
+#include "tao/PortableServer/TypeCode_SArg_Traits.h"
+#include "tao/PortableServer/Object_SArg_Traits.h"
+#include "tao/PortableServer/get_arg.h"
+#include "tao/Special_Basic_Arguments.h"
+#include "tao/UB_String_Arguments.h"
+#include "tao/Basic_Arguments.h"
+#include "tao/Object_Argument_T.h"
+#include "tao/Special_Basic_Arguments.h"
+#include "tao/UB_String_Arguments.h"
+#include "tao/Var_Size_Argument_T.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/Malloc_Allocator.h"
+
+#if !defined (__ACE_INLINE__)
+#include "IFR_ComponentsS.inl"
+#endif /* !defined INLINE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_arg_traits.cpp:72
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+// Arg traits specializations.
+namespace TAO
+{
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_DEFINITIONKIND__SARG_TRAITS_)
+#define _CORBA_DEFINITIONKIND__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::DefinitionKind>
+ : public
+ Basic_SArg_Traits_T<
+ CORBA::DefinitionKind,
+ TAO::Any_Insert_Policy_Stream <CORBA::DefinitionKind>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_REPOSITORY__SARG_TRAITS_)
+#define _CORBA_REPOSITORY__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::Repository>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::Repository_ptr,
+ CORBA::Repository_var,
+ CORBA::Repository_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::Repository_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_CONTAINER__SARG_TRAITS_)
+#define _CORBA_CONTAINER__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::Container>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::Container_ptr,
+ CORBA::Container_var,
+ CORBA::Container_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::Container_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_IDLTYPE__SARG_TRAITS_)
+#define _CORBA_IDLTYPE__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::IDLType>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::IDLType_ptr,
+ CORBA::IDLType_var,
+ CORBA::IDLType_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::IDLType_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_INTERFACEDEFSEQ__SARG_TRAITS_)
+#define _CORBA_INTERFACEDEFSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::InterfaceDefSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::InterfaceDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_VALUEDEFSEQ__SARG_TRAITS_)
+#define _CORBA_VALUEDEFSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ValueDefSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ValueDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_INITIALIZERSEQ__SARG_TRAITS_)
+#define _CORBA_INITIALIZERSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::InitializerSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::InitializerSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::InitializerSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_EXTINITIALIZERSEQ__SARG_TRAITS_)
+#define _CORBA_EXTINITIALIZERSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ExtInitializerSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ExtInitializerSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtInitializerSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_EXCEPTIONDEFSEQ__SARG_TRAITS_)
+#define _CORBA_EXCEPTIONDEFSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ExceptionDefSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ExceptionDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExceptionDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_OPERATIONMODE__SARG_TRAITS_)
+#define _CORBA_OPERATIONMODE__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::OperationMode>
+ : public
+ Basic_SArg_Traits_T<
+ CORBA::OperationMode,
+ TAO::Any_Insert_Policy_Stream <CORBA::OperationMode>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_PARDESCRIPTIONSEQ__SARG_TRAITS_)
+#define _CORBA_PARDESCRIPTIONSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ParDescriptionSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ParDescriptionSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ParDescriptionSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_CONTEXTIDSEQ__SARG_TRAITS_)
+#define _CORBA_CONTEXTIDSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ContextIdSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ContextIdSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ContextIdSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_INTERFACEDEF__SARG_TRAITS_)
+#define _CORBA_INTERFACEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::InterfaceDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::InterfaceDef_ptr,
+ CORBA::InterfaceDef_var,
+ CORBA::InterfaceDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_VALUEDEF__SARG_TRAITS_)
+#define _CORBA_VALUEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ValueDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ValueDef_ptr,
+ CORBA::ValueDef_var,
+ CORBA::ValueDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_COMPONENTDEF__SARG_TRAITS_)
+#define _CORBA_COMPONENTIR_COMPONENTDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ComponentIR::ComponentDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ComponentIR::ComponentDef_ptr,
+ CORBA::ComponentIR::ComponentDef_var,
+ CORBA::ComponentIR::ComponentDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::ComponentDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_HOMEDEF__SARG_TRAITS_)
+#define _CORBA_COMPONENTIR_HOMEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ComponentIR::HomeDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ComponentIR::HomeDef_ptr,
+ CORBA::ComponentIR::HomeDef_var,
+ CORBA::ComponentIR::HomeDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::HomeDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_EVENTDEF__SARG_TRAITS_)
+#define _CORBA_COMPONENTIR_EVENTDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ComponentIR::EventDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ComponentIR::EventDef_ptr,
+ CORBA::ComponentIR::EventDef_var,
+ CORBA::ComponentIR::EventDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::EventDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_PROVIDESDEF__SARG_TRAITS_)
+#define _CORBA_COMPONENTIR_PROVIDESDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ComponentIR::ProvidesDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ComponentIR::ProvidesDef_ptr,
+ CORBA::ComponentIR::ProvidesDef_var,
+ CORBA::ComponentIR::ProvidesDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::ProvidesDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_USESDEF__SARG_TRAITS_)
+#define _CORBA_COMPONENTIR_USESDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ComponentIR::UsesDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ComponentIR::UsesDef_ptr,
+ CORBA::ComponentIR::UsesDef_var,
+ CORBA::ComponentIR::UsesDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::UsesDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_EMITSDEF__SARG_TRAITS_)
+#define _CORBA_COMPONENTIR_EMITSDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ComponentIR::EmitsDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ComponentIR::EmitsDef_ptr,
+ CORBA::ComponentIR::EmitsDef_var,
+ CORBA::ComponentIR::EmitsDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::EmitsDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_PUBLISHESDEF__SARG_TRAITS_)
+#define _CORBA_COMPONENTIR_PUBLISHESDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ComponentIR::PublishesDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ComponentIR::PublishesDef_ptr,
+ CORBA::ComponentIR::PublishesDef_var,
+ CORBA::ComponentIR::PublishesDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::PublishesDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_CONSUMESDEF__SARG_TRAITS_)
+#define _CORBA_COMPONENTIR_CONSUMESDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ComponentIR::ConsumesDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ComponentIR::ConsumesDef_ptr,
+ CORBA::ComponentIR::ConsumesDef_var,
+ CORBA::ComponentIR::ConsumesDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::ConsumesDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_FACTORYDEF__SARG_TRAITS_)
+#define _CORBA_COMPONENTIR_FACTORYDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ComponentIR::FactoryDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ComponentIR::FactoryDef_ptr,
+ CORBA::ComponentIR::FactoryDef_var,
+ CORBA::ComponentIR::FactoryDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::FactoryDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_FINDERDEF__SARG_TRAITS_)
+#define _CORBA_COMPONENTIR_FINDERDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ComponentIR::FinderDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ComponentIR::FinderDef_ptr,
+ CORBA::ComponentIR::FinderDef_var,
+ CORBA::ComponentIR::FinderDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::FinderDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_arg_traits.cpp:72
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+// Arg traits specializations.
+namespace TAO
+{
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_DEFINITIONKIND__ARG_TRAITS_)
+#define _CORBA_DEFINITIONKIND__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::DefinitionKind>
+ : public
+ Basic_Arg_Traits_T<
+ CORBA::DefinitionKind,
+ TAO::Any_Insert_Policy_Stream <CORBA::DefinitionKind>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_REPOSITORY__ARG_TRAITS_)
+#define _CORBA_REPOSITORY__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::Repository>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::Repository_ptr,
+ CORBA::Repository_var,
+ CORBA::Repository_out,
+ TAO::Objref_Traits<CORBA::Repository>,
+ TAO::Any_Insert_Policy_Stream <CORBA::Repository_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_CONTAINER__ARG_TRAITS_)
+#define _CORBA_CONTAINER__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::Container>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::Container_ptr,
+ CORBA::Container_var,
+ CORBA::Container_out,
+ TAO::Objref_Traits<CORBA::Container>,
+ TAO::Any_Insert_Policy_Stream <CORBA::Container_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_IDLTYPE__ARG_TRAITS_)
+#define _CORBA_IDLTYPE__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::IDLType>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::IDLType_ptr,
+ CORBA::IDLType_var,
+ CORBA::IDLType_out,
+ TAO::Objref_Traits<CORBA::IDLType>,
+ TAO::Any_Insert_Policy_Stream <CORBA::IDLType_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_INTERFACEDEFSEQ__ARG_TRAITS_)
+#define _CORBA_INTERFACEDEFSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::InterfaceDefSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::InterfaceDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_VALUEDEFSEQ__ARG_TRAITS_)
+#define _CORBA_VALUEDEFSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ValueDefSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ValueDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_INITIALIZERSEQ__ARG_TRAITS_)
+#define _CORBA_INITIALIZERSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::InitializerSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::InitializerSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::InitializerSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_EXTINITIALIZERSEQ__ARG_TRAITS_)
+#define _CORBA_EXTINITIALIZERSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ExtInitializerSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ExtInitializerSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtInitializerSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_EXCEPTIONDEFSEQ__ARG_TRAITS_)
+#define _CORBA_EXCEPTIONDEFSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ExceptionDefSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ExceptionDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExceptionDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_OPERATIONMODE__ARG_TRAITS_)
+#define _CORBA_OPERATIONMODE__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::OperationMode>
+ : public
+ Basic_Arg_Traits_T<
+ CORBA::OperationMode,
+ TAO::Any_Insert_Policy_Stream <CORBA::OperationMode>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_PARDESCRIPTIONSEQ__ARG_TRAITS_)
+#define _CORBA_PARDESCRIPTIONSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ParDescriptionSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ParDescriptionSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ParDescriptionSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_CONTEXTIDSEQ__ARG_TRAITS_)
+#define _CORBA_CONTEXTIDSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ContextIdSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ContextIdSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ContextIdSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_INTERFACEDEF__ARG_TRAITS_)
+#define _CORBA_INTERFACEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::InterfaceDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::InterfaceDef_ptr,
+ CORBA::InterfaceDef_var,
+ CORBA::InterfaceDef_out,
+ TAO::Objref_Traits<CORBA::InterfaceDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_VALUEDEF__ARG_TRAITS_)
+#define _CORBA_VALUEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ValueDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ValueDef_ptr,
+ CORBA::ValueDef_var,
+ CORBA::ValueDef_out,
+ TAO::Objref_Traits<CORBA::ValueDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_COMPONENTDEF__ARG_TRAITS_)
+#define _CORBA_COMPONENTIR_COMPONENTDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ComponentIR::ComponentDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ComponentIR::ComponentDef_ptr,
+ CORBA::ComponentIR::ComponentDef_var,
+ CORBA::ComponentIR::ComponentDef_out,
+ TAO::Objref_Traits<CORBA::ComponentIR::ComponentDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::ComponentDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_HOMEDEF__ARG_TRAITS_)
+#define _CORBA_COMPONENTIR_HOMEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ComponentIR::HomeDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ComponentIR::HomeDef_ptr,
+ CORBA::ComponentIR::HomeDef_var,
+ CORBA::ComponentIR::HomeDef_out,
+ TAO::Objref_Traits<CORBA::ComponentIR::HomeDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::HomeDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_EVENTDEF__ARG_TRAITS_)
+#define _CORBA_COMPONENTIR_EVENTDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ComponentIR::EventDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ComponentIR::EventDef_ptr,
+ CORBA::ComponentIR::EventDef_var,
+ CORBA::ComponentIR::EventDef_out,
+ TAO::Objref_Traits<CORBA::ComponentIR::EventDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::EventDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_PROVIDESDEF__ARG_TRAITS_)
+#define _CORBA_COMPONENTIR_PROVIDESDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ComponentIR::ProvidesDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ComponentIR::ProvidesDef_ptr,
+ CORBA::ComponentIR::ProvidesDef_var,
+ CORBA::ComponentIR::ProvidesDef_out,
+ TAO::Objref_Traits<CORBA::ComponentIR::ProvidesDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::ProvidesDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_USESDEF__ARG_TRAITS_)
+#define _CORBA_COMPONENTIR_USESDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ComponentIR::UsesDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ComponentIR::UsesDef_ptr,
+ CORBA::ComponentIR::UsesDef_var,
+ CORBA::ComponentIR::UsesDef_out,
+ TAO::Objref_Traits<CORBA::ComponentIR::UsesDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::UsesDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_EMITSDEF__ARG_TRAITS_)
+#define _CORBA_COMPONENTIR_EMITSDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ComponentIR::EmitsDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ComponentIR::EmitsDef_ptr,
+ CORBA::ComponentIR::EmitsDef_var,
+ CORBA::ComponentIR::EmitsDef_out,
+ TAO::Objref_Traits<CORBA::ComponentIR::EmitsDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::EmitsDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_PUBLISHESDEF__ARG_TRAITS_)
+#define _CORBA_COMPONENTIR_PUBLISHESDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ComponentIR::PublishesDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ComponentIR::PublishesDef_ptr,
+ CORBA::ComponentIR::PublishesDef_var,
+ CORBA::ComponentIR::PublishesDef_out,
+ TAO::Objref_Traits<CORBA::ComponentIR::PublishesDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::PublishesDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_CONSUMESDEF__ARG_TRAITS_)
+#define _CORBA_COMPONENTIR_CONSUMESDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ComponentIR::ConsumesDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ComponentIR::ConsumesDef_ptr,
+ CORBA::ComponentIR::ConsumesDef_var,
+ CORBA::ComponentIR::ConsumesDef_out,
+ TAO::Objref_Traits<CORBA::ComponentIR::ConsumesDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::ConsumesDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_FACTORYDEF__ARG_TRAITS_)
+#define _CORBA_COMPONENTIR_FACTORYDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ComponentIR::FactoryDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ComponentIR::FactoryDef_ptr,
+ CORBA::ComponentIR::FactoryDef_var,
+ CORBA::ComponentIR::FactoryDef_out,
+ TAO::Objref_Traits<CORBA::ComponentIR::FactoryDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::FactoryDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_COMPONENTIR_FINDERDEF__ARG_TRAITS_)
+#define _CORBA_COMPONENTIR_FINDERDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ComponentIR::FinderDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ComponentIR::FinderDef_ptr,
+ CORBA::ComponentIR::FinderDef_var,
+ CORBA::ComponentIR::FinderDef_out,
+ TAO::Objref_Traits<CORBA::ComponentIR::FinderDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ComponentIR::FinderDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ComponentIR_EventDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ComponentIR_EventDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ComponentIR_EventDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 0,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 0,
+ 109, 15, 50, 40, 109, 109, 109, 0, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 0, 0, 0,
+ 109, 0, 109, 0, 109, 109, 109, 109, 109, 109,
+ 109, 109, 15, 0, 109, 109, 109, 15, 15, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109,
+#else
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 0, 109, 0, 109, 15,
+ 50, 40, 109, 109, 109, 0, 109, 109, 0, 0,
+ 0, 109, 0, 109, 0, 15, 0, 109, 109, 109,
+ 15, 15, 109, 109, 109, 109, 109, 109,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ComponentIR_EventDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 60,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 108,
+ HASH_VALUE_RANGE = 105,
+ DUPLICATES = 18,
+ WORDLIST_SIZE = 64
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"is_a", &POA_CORBA::ComponentIR::EventDef::is_a_skel, 0},
+ {"_is_a", &POA_CORBA::ComponentIR::EventDef::_is_a_skel, 0},
+ {"lookup", &POA_CORBA::ComponentIR::EventDef::lookup_skel, 0},
+ {"_component", &POA_CORBA::ComponentIR::EventDef::_component_skel, 0},
+ {"_get_version", &POA_CORBA::ComponentIR::EventDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ComponentIR::EventDef::_set_version_skel, 0},
+ {"_non_existent", &POA_CORBA::ComponentIR::EventDef::_non_existent_skel, 0},
+ {"_get_is_custom", &POA_CORBA::ComponentIR::EventDef::_get_is_custom_skel, 0},
+ {"_set_is_custom", &POA_CORBA::ComponentIR::EventDef::_set_is_custom_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ComponentIR::EventDef::_get_defined_in_skel, 0},
+ {"_get_is_abstract", &POA_CORBA::ComponentIR::EventDef::_get_is_abstract_skel, 0},
+ {"_set_is_abstract", &POA_CORBA::ComponentIR::EventDef::_set_is_abstract_skel, 0},
+ {"create_enum", &POA_CORBA::ComponentIR::EventDef::create_enum_skel, 0},
+ {"create_union", &POA_CORBA::ComponentIR::EventDef::create_union_skel, 0},
+ {"create_struct", &POA_CORBA::ComponentIR::EventDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::ComponentIR::EventDef::create_constant_skel, 0},
+ {"create_exception", &POA_CORBA::ComponentIR::EventDef::create_exception_skel, 0},
+ {"create_operation", &POA_CORBA::ComponentIR::EventDef::create_operation_skel, 0},
+ {"_get_initializers", &POA_CORBA::ComponentIR::EventDef::_get_initializers_skel, 0},
+ {"_set_initializers", &POA_CORBA::ComponentIR::EventDef::_set_initializers_skel, 0},
+ {"create_value_member", &POA_CORBA::ComponentIR::EventDef::create_value_member_skel, 0},
+ {"_get_ext_initializers", &POA_CORBA::ComponentIR::EventDef::_get_ext_initializers_skel, 0},
+ {"_set_ext_initializers", &POA_CORBA::ComponentIR::EventDef::_set_ext_initializers_skel, 0},
+ {"contents", &POA_CORBA::ComponentIR::EventDef::contents_skel, 0},
+ {"_get_supported_interfaces", &POA_CORBA::ComponentIR::EventDef::_get_supported_interfaces_skel, 0},
+ {"_set_abstract_base_values", &POA_CORBA::ComponentIR::EventDef::_set_abstract_base_values_skel, 0},
+ {"_get_abstract_base_values", &POA_CORBA::ComponentIR::EventDef::_get_abstract_base_values_skel, 0},
+ {"_set_supported_interfaces", &POA_CORBA::ComponentIR::EventDef::_set_supported_interfaces_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ComponentIR::EventDef::_get_containing_repository_skel, 0},
+ {"create_alias", &POA_CORBA::ComponentIR::EventDef::create_alias_skel, 0},
+ {"move", &POA_CORBA::ComponentIR::EventDef::move_skel, 0},
+ {"create_value_box", &POA_CORBA::ComponentIR::EventDef::create_value_box_skel, 0},
+ {"_get_name", &POA_CORBA::ComponentIR::EventDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::ComponentIR::EventDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::ComponentIR::EventDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ComponentIR::EventDef::_interface_skel, 0},
+ {"lookup_name", &POA_CORBA::ComponentIR::EventDef::lookup_name_skel, 0},
+ {"_get_base_value", &POA_CORBA::ComponentIR::EventDef::_get_base_value_skel, 0},
+ {"_set_base_value", &POA_CORBA::ComponentIR::EventDef::_set_base_value_skel, 0},
+ {"_get_id", &POA_CORBA::ComponentIR::EventDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ComponentIR::EventDef::_set_id_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ComponentIR::EventDef::_get_absolute_name_skel, 0},
+ {"_get_is_truncatable", &POA_CORBA::ComponentIR::EventDef::_get_is_truncatable_skel, 0},
+ {"_set_is_truncatable", &POA_CORBA::ComponentIR::EventDef::_set_is_truncatable_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ComponentIR::EventDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ComponentIR::EventDef::_repository_id_skel, 0},
+ {"create_value", &POA_CORBA::ComponentIR::EventDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::ComponentIR::EventDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::ComponentIR::EventDef::create_native_skel, 0},
+ {"create_interface", &POA_CORBA::ComponentIR::EventDef::create_interface_skel, 0},
+ {"create_attribute", &POA_CORBA::ComponentIR::EventDef::create_attribute_skel, 0},
+ {"create_ext_value", &POA_CORBA::ComponentIR::EventDef::create_ext_value_skel, 0},
+ {"destroy", &POA_CORBA::ComponentIR::EventDef::destroy_skel, 0},
+ {"create_ext_attribute", &POA_CORBA::ComponentIR::EventDef::create_ext_attribute_skel, 0},
+ {"create_local_interface", &POA_CORBA::ComponentIR::EventDef::create_local_interface_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::ComponentIR::EventDef::create_abstract_interface_skel, 0},
+ {"describe_contents", &POA_CORBA::ComponentIR::EventDef::describe_contents_skel, 0},
+ {"describe", &POA_CORBA::ComponentIR::EventDef::describe_skel, 0},
+ {"describe_value", &POA_CORBA::ComponentIR::EventDef::describe_value_skel, 0},
+ {"describe_ext_value", &POA_CORBA::ComponentIR::EventDef::describe_ext_value_skel, 0},
+ };
+
+ static const signed short lookup[] =
+ {
+ -14, -2, -20, -2, 4, 5, 6, -1, -22, -2, 7, -1, 169, 10,
+ 154, 13, -124, -1, -25, -2, -28, -4, -36, -3, -41, -2, 16, 17,
+ 18, -1, 19, -137, -132, -1, 24, -1, -126, -1, 27, -1, -128, 32,
+ 33, -1, 34, -1, 35, -43, -2, -135, 39, 40, -1, -46, -2, -139,
+ -1, -118, 45, -114, -11, -2, -1, 48, 49, -51, -2, 50, -111, -53,
+ -3, -110, 56, -8, -2, 57, -1, 58, -1, -1, 59, -1, 60, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 61, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ComponentIR_EventDef_Perfect_Hash_OpTable tao_CORBA_ComponentIR_EventDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA_ComponentIR__TAO_EventDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA_ComponentIR__TAO_EventDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA_ComponentIR__TAO_EventDef_Proxy_Broker_Factory_function_pointer =
+ CORBA_ComponentIR__TAO_EventDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA_ComponentIR__TAO_EventDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA_ComponentIR__TAO_EventDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA_ComponentIR__TAO_EventDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ComponentIR::EventDef::EventDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ComponentIR_EventDef_optable;
+}
+
+POA_CORBA::ComponentIR::EventDef::EventDef (const EventDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs),
+ POA_CORBA::ValueDef (rhs),
+ POA_CORBA::ExtValueDef (rhs)
+{
+}
+
+POA_CORBA::ComponentIR::EventDef::~EventDef (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_EventDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_EventDef_Upcall_Command (
+ POA_CORBA::ComponentIR::EventDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::EventDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::EventDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::EventDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+
+ _is_a_EventDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_EventDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_EventDef_Upcall_Command (
+ POA_CORBA::ComponentIR::EventDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::EventDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::EventDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::EventDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+
+ _non_existent_EventDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_EventDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_EventDef_Upcall_Command (
+ POA_CORBA::ComponentIR::EventDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::EventDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::EventDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::EventDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+
+ _repository_id_EventDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ComponentIR::EventDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ComponentIR::EventDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_EventDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_EventDef_Upcall_Command (
+ POA_CORBA::ComponentIR::EventDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::EventDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::EventDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::EventDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+
+ _get_component_EventDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ComponentIR::EventDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ValueDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ExtValueDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/EventDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ComponentIR::EventDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ComponentIR/EventDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ComponentIR::EventDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ComponentIR::EventDef *
+POA_CORBA::ComponentIR::EventDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ComponentIR::EventDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA_ComponentIR__TAO_EventDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ComponentIR_Container_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ComponentIR_Container_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ComponentIR_Container_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 20,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 15,
+ 47, 0, 0, 0, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 30, 20, 30,
+ 47, 0, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 15, 5, 47, 47, 47, 10, 0, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47,
+#else
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 20, 47, 15, 47, 0,
+ 0, 0, 47, 47, 47, 47, 47, 47, 30, 20,
+ 30, 47, 0, 47, 47, 15, 5, 47, 47, 47,
+ 10, 0, 47, 47, 47, 47, 47, 47,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ComponentIR_Container_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 28,
+ MIN_WORD_LENGTH = 5,
+ MAX_WORD_LENGTH = 25,
+ MIN_HASH_VALUE = 7,
+ MAX_HASH_VALUE = 46,
+ HASH_VALUE_RANGE = 40,
+ DUPLICATES = 3,
+ WORDLIST_SIZE = 35
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"destroy", &POA_CORBA::ComponentIR::Container::destroy_skel, 0},
+ {"create_home", &POA_CORBA::ComponentIR::Container::create_home_skel, 0},
+ {"create_value", &POA_CORBA::ComponentIR::Container::create_value_skel, 0},
+ {"create_module", &POA_CORBA::ComponentIR::Container::create_module_skel, 0},
+ {"create_native", &POA_CORBA::ComponentIR::Container::create_native_skel, 0},
+ {"create_interface", &POA_CORBA::ComponentIR::Container::create_interface_skel, 0},
+ {"create_ext_value", &POA_CORBA::ComponentIR::Container::create_ext_value_skel, 0},
+ {"create_event", &POA_CORBA::ComponentIR::Container::create_event_skel, 0},
+ {"create_struct", &POA_CORBA::ComponentIR::Container::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::ComponentIR::Container::create_constant_skel, 0},
+ {"create_component", &POA_CORBA::ComponentIR::Container::create_component_skel, 0},
+ {"create_local_interface", &POA_CORBA::ComponentIR::Container::create_local_interface_skel, 0},
+ {"contents", &POA_CORBA::ComponentIR::Container::contents_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::ComponentIR::Container::create_abstract_interface_skel, 0},
+ {"create_value_box", &POA_CORBA::ComponentIR::Container::create_value_box_skel, 0},
+ {"create_alias", &POA_CORBA::ComponentIR::Container::create_alias_skel, 0},
+ {"_interface", &POA_CORBA::ComponentIR::Container::_interface_skel, 0},
+ {"create_enum", &POA_CORBA::ComponentIR::Container::create_enum_skel, 0},
+ {"describe_contents", &POA_CORBA::ComponentIR::Container::describe_contents_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ComponentIR::Container::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ComponentIR::Container::_repository_id_skel, 0},
+ {"_component", &POA_CORBA::ComponentIR::Container::_component_skel, 0},
+ {"lookup", &POA_CORBA::ComponentIR::Container::lookup_skel, 0},
+ {"_non_existent", &POA_CORBA::ComponentIR::Container::_non_existent_skel, 0},
+ {"_is_a", &POA_CORBA::ComponentIR::Container::_is_a_skel, 0},
+ {"lookup_name", &POA_CORBA::ComponentIR::Container::lookup_name_skel, 0},
+ {"create_union", &POA_CORBA::ComponentIR::Container::create_union_skel, 0},
+ {"create_exception", &POA_CORBA::ComponentIR::Container::create_exception_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, -1, -1, -1, 7, -1, -10, -2, 8, 9, -50,
+ -12, -2, -48, 14, 15, -1, 16, 17, 18, 19, -1, 20, 21, 22,
+ -1, -1, 23, 24, 25, 26, 27, 28, 29, -1, 30, -1, 31, 32,
+ 33, -1, -1, -1, 34,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ComponentIR_Container_Perfect_Hash_OpTable tao_CORBA_ComponentIR_Container_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA_ComponentIR__TAO_Container_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA_ComponentIR__TAO_Container_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA_ComponentIR__TAO_Container_Proxy_Broker_Factory_function_pointer =
+ CORBA_ComponentIR__TAO_Container_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA_ComponentIR__TAO_Container_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA_ComponentIR__TAO_Container_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA_ComponentIR__TAO_Container_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ComponentIR::Container::Container (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ComponentIR_Container_optable;
+}
+
+POA_CORBA::ComponentIR::Container::Container (const Container& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs)
+{
+}
+
+POA_CORBA::ComponentIR::Container::~Container (void)
+{
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_component_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_component_Container (
+ POA_CORBA::ComponentIR::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ComponentDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ComponentIR::ComponentDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ComponentDef>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ComponentIR::ComponentDef> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InterfaceDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ retval =
+ this->servant_->create_component (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::Container::create_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ComponentDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ComponentDef>::in_arg_val _tao_base_component;
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_val _tao_supports_interfaces;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_base_component,
+ &_tao_supports_interfaces
+ };
+
+ static size_t const nargs = 6;
+
+ POA_CORBA::ComponentIR::Container * const impl =
+ static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+
+ create_component_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_home_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_home_Container (
+ POA_CORBA::ComponentIR::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::HomeDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ComponentIR::HomeDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::HomeDef>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ComponentIR::HomeDef> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ComponentDef>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ComponentIR::ComponentDef> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_type arg_6 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InterfaceDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 6);
+
+ TAO::SArg_Traits< ::CORBA::ValueDef>::in_arg_type arg_7 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ValueDef> (
+ this->operation_details_,
+ this->args_,
+ 7);
+
+ retval =
+ this->servant_->create_home (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ , arg_6
+ , arg_7
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::Container::create_home_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::HomeDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::ComponentIR::HomeDef>::in_arg_val _tao_base_home;
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ComponentDef>::in_arg_val _tao_managed_component;
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_val _tao_supports_interfaces;
+ TAO::SArg_Traits< ::CORBA::ValueDef>::in_arg_val _tao_primary_key;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_base_home,
+ &_tao_managed_component,
+ &_tao_supports_interfaces,
+ &_tao_primary_key
+ };
+
+ static size_t const nargs = 8;
+
+ POA_CORBA::ComponentIR::Container * const impl =
+ static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+
+ create_home_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_event_Container
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_event_Container (
+ POA_CORBA::ComponentIR::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::EventDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ComponentIR::EventDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ TAO::SArg_Traits< ::CORBA::ValueDef>::in_arg_type arg_6 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ValueDef> (
+ this->operation_details_,
+ this->args_,
+ 6);
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_7 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 7);
+
+ TAO::SArg_Traits< ::CORBA::ValueDefSeq>::in_arg_type arg_8 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ValueDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 8);
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_type arg_9 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InterfaceDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 9);
+
+ TAO::SArg_Traits< ::CORBA::ExtInitializerSeq>::in_arg_type arg_10 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ExtInitializerSeq> (
+ this->operation_details_,
+ this->args_,
+ 10);
+
+ retval =
+ this->servant_->create_event (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ , arg_6
+ , arg_7
+ , arg_8
+ , arg_9
+ , arg_10
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::Container::create_event_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::EventDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_is_custom;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_is_abstract;
+ TAO::SArg_Traits< ::CORBA::ValueDef>::in_arg_val _tao_base_value;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_is_truncatable;
+ TAO::SArg_Traits< ::CORBA::ValueDefSeq>::in_arg_val _tao_abstract_base_values;
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_val _tao_supported_interfaces;
+ TAO::SArg_Traits< ::CORBA::ExtInitializerSeq>::in_arg_val _tao_initializers;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_is_custom,
+ &_tao_is_abstract,
+ &_tao_base_value,
+ &_tao_is_truncatable,
+ &_tao_abstract_base_values,
+ &_tao_supported_interfaces,
+ &_tao_initializers
+ };
+
+ static size_t const nargs = 11;
+
+ POA_CORBA::ComponentIR::Container * const impl =
+ static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+
+ create_event_Container command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_Container_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_Container_Upcall_Command (
+ POA_CORBA::ComponentIR::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::Container::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::Container * const impl =
+ static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+
+ _is_a_Container_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_Container_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_Container_Upcall_Command (
+ POA_CORBA::ComponentIR::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::Container::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::Container * const impl =
+ static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+
+ _non_existent_Container_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_Container_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_Container_Upcall_Command (
+ POA_CORBA::ComponentIR::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::Container::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::Container * const impl =
+ static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+
+ _repository_id_Container_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ComponentIR::Container::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ComponentIR::Container * const impl =
+ static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_Container_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_Container_Upcall_Command (
+ POA_CORBA::ComponentIR::Container * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::Container * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::Container::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::Container * const impl =
+ static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+
+ _get_component_Container_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ComponentIR::Container::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ComponentIR::Container::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ComponentIR/Container:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ComponentIR::Container::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ComponentIR::Container *
+POA_CORBA::ComponentIR::Container::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ComponentIR::Container STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA_ComponentIR__TAO_Container_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ComponentIR_ModuleDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ComponentIR_ModuleDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ComponentIR_ModuleDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 25,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 10,
+ 58, 0, 0, 0, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 30, 15, 5,
+ 58, 10, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 40, 15, 58, 58, 58, 20, 0, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58,
+#else
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 25, 58, 10, 58, 0,
+ 0, 0, 58, 58, 58, 58, 58, 58, 30, 15,
+ 5, 58, 10, 58, 58, 40, 15, 58, 58, 58,
+ 20, 0, 58, 58, 58, 58, 58, 58,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ComponentIR_ModuleDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 39,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 7,
+ MAX_HASH_VALUE = 57,
+ HASH_VALUE_RANGE = 51,
+ DUPLICATES = 6,
+ WORDLIST_SIZE = 46
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"destroy", &POA_CORBA::ComponentIR::ModuleDef::destroy_skel, 0},
+ {"describe", &POA_CORBA::ComponentIR::ModuleDef::describe_skel, 0},
+ {"create_home", &POA_CORBA::ComponentIR::ModuleDef::create_home_skel, 0},
+ {"create_value", &POA_CORBA::ComponentIR::ModuleDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::ComponentIR::ModuleDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::ComponentIR::ModuleDef::create_native_skel, 0},
+ {"create_interface", &POA_CORBA::ComponentIR::ModuleDef::create_interface_skel, 0},
+ {"create_ext_value", &POA_CORBA::ComponentIR::ModuleDef::create_ext_value_skel, 0},
+ {"create_union", &POA_CORBA::ComponentIR::ModuleDef::create_union_skel, 0},
+ {"move", &POA_CORBA::ComponentIR::ModuleDef::move_skel, 0},
+ {"create_exception", &POA_CORBA::ComponentIR::ModuleDef::create_exception_skel, 0},
+ {"create_local_interface", &POA_CORBA::ComponentIR::ModuleDef::create_local_interface_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::ComponentIR::ModuleDef::create_abstract_interface_skel, 0},
+ {"create_enum", &POA_CORBA::ComponentIR::ModuleDef::create_enum_skel, 0},
+ {"create_event", &POA_CORBA::ComponentIR::ModuleDef::create_event_skel, 0},
+ {"create_struct", &POA_CORBA::ComponentIR::ModuleDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::ComponentIR::ModuleDef::create_constant_skel, 0},
+ {"create_component", &POA_CORBA::ComponentIR::ModuleDef::create_component_skel, 0},
+ {"_get_id", &POA_CORBA::ComponentIR::ModuleDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ComponentIR::ModuleDef::_set_id_skel, 0},
+ {"_get_name", &POA_CORBA::ComponentIR::ModuleDef::_get_name_skel, 0},
+ {"_set_name", &POA_CORBA::ComponentIR::ModuleDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ComponentIR::ModuleDef::_interface_skel, 0},
+ {"create_value_box", &POA_CORBA::ComponentIR::ModuleDef::create_value_box_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ComponentIR::ModuleDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ComponentIR::ModuleDef::_repository_id_skel, 0},
+ {"_is_a", &POA_CORBA::ComponentIR::ModuleDef::_is_a_skel, 0},
+ {"lookup_name", &POA_CORBA::ComponentIR::ModuleDef::lookup_name_skel, 0},
+ {"_get_version", &POA_CORBA::ComponentIR::ModuleDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ComponentIR::ModuleDef::_set_version_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ComponentIR::ModuleDef::_get_absolute_name_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ComponentIR::ModuleDef::_get_defined_in_skel, 0},
+ {"lookup", &POA_CORBA::ComponentIR::ModuleDef::lookup_skel, 0},
+ {"contents", &POA_CORBA::ComponentIR::ModuleDef::contents_skel, 0},
+ {"_component", &POA_CORBA::ComponentIR::ModuleDef::_component_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ComponentIR::ModuleDef::_get_containing_repository_skel, 0},
+ {"create_alias", &POA_CORBA::ComponentIR::ModuleDef::create_alias_skel, 0},
+ {"_non_existent", &POA_CORBA::ComponentIR::ModuleDef::_non_existent_skel, 0},
+ {"describe_contents", &POA_CORBA::ComponentIR::ModuleDef::describe_contents_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -11, -2, -13, -2, 7, 8, -25, -2, 9, 10, -67,
+ -27, -2, -68, 15, -1, 16, -1, 17, 18, -35, -2, 19, 20, 21,
+ 22, -1, 23, 24, -80, -1, -77, 29, 30, -1, 31, 32, 33, 34,
+ -76, 37, -1, 38, 39, -1, 40, -1, 41, 42, 43, 44, -1, -1,
+ -1, 45,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ComponentIR_ModuleDef_Perfect_Hash_OpTable tao_CORBA_ComponentIR_ModuleDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA_ComponentIR__TAO_ModuleDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA_ComponentIR__TAO_ModuleDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA_ComponentIR__TAO_ModuleDef_Proxy_Broker_Factory_function_pointer =
+ CORBA_ComponentIR__TAO_ModuleDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA_ComponentIR__TAO_ModuleDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA_ComponentIR__TAO_ModuleDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA_ComponentIR__TAO_ModuleDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ComponentIR::ModuleDef::ModuleDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ComponentIR_ModuleDef_optable;
+}
+
+POA_CORBA::ComponentIR::ModuleDef::ModuleDef (const ModuleDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::ModuleDef (rhs),
+ POA_CORBA::ComponentIR::Container (rhs)
+{
+}
+
+POA_CORBA::ComponentIR::ModuleDef::~ModuleDef (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ModuleDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ModuleDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ModuleDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ModuleDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ModuleDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::ModuleDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+
+ _is_a_ModuleDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ModuleDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ModuleDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ModuleDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ModuleDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ModuleDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::ModuleDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+
+ _non_existent_ModuleDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ModuleDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ModuleDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ModuleDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ModuleDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ModuleDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::ModuleDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+
+ _repository_id_ModuleDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ComponentIR::ModuleDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ComponentIR::ModuleDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ModuleDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ModuleDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ModuleDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ModuleDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ModuleDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::ModuleDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+
+ _get_component_ModuleDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ComponentIR::ModuleDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ModuleDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/ModuleDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ComponentIR::ModuleDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ComponentIR/ModuleDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ComponentIR::ModuleDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ComponentIR::ModuleDef *
+POA_CORBA::ComponentIR::ModuleDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ComponentIR::ModuleDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA_ComponentIR__TAO_ModuleDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ComponentIR_Repository_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ComponentIR_Repository_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ComponentIR_Repository_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 10,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 0,
+ 78, 0, 15, 20, 78, 10, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 20, 0, 25,
+ 78, 0, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 45, 5, 78, 78, 78, 0, 0, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78,
+#else
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 10, 78, 0, 78, 0,
+ 15, 20, 78, 10, 78, 78, 78, 78, 20, 0,
+ 25, 78, 0, 78, 78, 45, 5, 78, 78, 78,
+ 0, 0, 78, 78, 78, 78, 78, 78,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ComponentIR_Repository_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 36,
+ MIN_WORD_LENGTH = 5,
+ MAX_WORD_LENGTH = 25,
+ MIN_HASH_VALUE = 11,
+ MAX_HASH_VALUE = 77,
+ HASH_VALUE_RANGE = 67,
+ DUPLICATES = 3,
+ WORDLIST_SIZE = 47
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"",0,0},{"",0,0},
+ {"create_enum", &POA_CORBA::ComponentIR::Repository::create_enum_skel, 0},
+ {"create_array", &POA_CORBA::ComponentIR::Repository::create_array_skel, 0},
+ {"_is_a", &POA_CORBA::ComponentIR::Repository::_is_a_skel, 0},
+ {"create_value_box", &POA_CORBA::ComponentIR::Repository::create_value_box_skel, 0},
+ {"create_event", &POA_CORBA::ComponentIR::Repository::create_event_skel, 0},
+ {"create_struct", &POA_CORBA::ComponentIR::Repository::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::ComponentIR::Repository::create_constant_skel, 0},
+ {"create_component", &POA_CORBA::ComponentIR::Repository::create_component_skel, 0},
+ {"destroy", &POA_CORBA::ComponentIR::Repository::destroy_skel, 0},
+ {"create_string", &POA_CORBA::ComponentIR::Repository::create_string_skel, 0},
+ {"create_wstring", &POA_CORBA::ComponentIR::Repository::create_wstring_skel, 0},
+ {"_component", &POA_CORBA::ComponentIR::Repository::_component_skel, 0},
+ {"lookup", &POA_CORBA::ComponentIR::Repository::lookup_skel, 0},
+ {"create_fixed", &POA_CORBA::ComponentIR::Repository::create_fixed_skel, 0},
+ {"_non_existent", &POA_CORBA::ComponentIR::Repository::_non_existent_skel, 0},
+ {"create_home", &POA_CORBA::ComponentIR::Repository::create_home_skel, 0},
+ {"create_value", &POA_CORBA::ComponentIR::Repository::create_value_skel, 0},
+ {"create_module", &POA_CORBA::ComponentIR::Repository::create_module_skel, 0},
+ {"create_native", &POA_CORBA::ComponentIR::Repository::create_native_skel, 0},
+ {"create_sequence", &POA_CORBA::ComponentIR::Repository::create_sequence_skel, 0},
+ {"create_interface", &POA_CORBA::ComponentIR::Repository::create_interface_skel, 0},
+ {"create_ext_value", &POA_CORBA::ComponentIR::Repository::create_ext_value_skel, 0},
+ {"create_union", &POA_CORBA::ComponentIR::Repository::create_union_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ComponentIR::Repository::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ComponentIR::Repository::_repository_id_skel, 0},
+ {"_interface", &POA_CORBA::ComponentIR::Repository::_interface_skel, 0},
+ {"create_exception", &POA_CORBA::ComponentIR::Repository::create_exception_skel, 0},
+ {"create_local_interface", &POA_CORBA::ComponentIR::Repository::create_local_interface_skel, 0},
+ {"get_primitive", &POA_CORBA::ComponentIR::Repository::get_primitive_skel, 0},
+ {"lookup_id", &POA_CORBA::ComponentIR::Repository::lookup_id_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::ComponentIR::Repository::create_abstract_interface_skel, 0},
+ {"lookup_name", &POA_CORBA::ComponentIR::Repository::lookup_name_skel, 0},
+ {"get_canonical_typecode", &POA_CORBA::ComponentIR::Repository::get_canonical_typecode_skel, 0},
+ {"contents", &POA_CORBA::ComponentIR::Repository::contents_skel, 0},
+ {"create_alias", &POA_CORBA::ComponentIR::Repository::create_alias_skel, 0},
+ {"describe_contents", &POA_CORBA::ComponentIR::Repository::describe_contents_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, 12, -28,
+ -2, 13, 14, 15, 16, -1, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, -31, -2, 26, 27, -97, -1, 30, -84, 33, 34, 35, 36, 37,
+ 38, 39, 40, 41, -1, -1, -1, -1, -1, 42, 43, 44, -1, -1,
+ -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 46,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ComponentIR_Repository_Perfect_Hash_OpTable tao_CORBA_ComponentIR_Repository_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA_ComponentIR__TAO_Repository_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA_ComponentIR__TAO_Repository_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA_ComponentIR__TAO_Repository_Proxy_Broker_Factory_function_pointer =
+ CORBA_ComponentIR__TAO_Repository_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA_ComponentIR__TAO_Repository_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA_ComponentIR__TAO_Repository_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA_ComponentIR__TAO_Repository_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ComponentIR::Repository::Repository (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ComponentIR_Repository_optable;
+}
+
+POA_CORBA::ComponentIR::Repository::Repository (const Repository& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs),
+ POA_CORBA::Repository (rhs),
+ POA_CORBA::ComponentIR::Container (rhs)
+{
+}
+
+POA_CORBA::ComponentIR::Repository::~Repository (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_Repository_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_Repository_Upcall_Command (
+ POA_CORBA::ComponentIR::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::Repository::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::Repository * const impl =
+ static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+
+ _is_a_Repository_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_Repository_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_Repository_Upcall_Command (
+ POA_CORBA::ComponentIR::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::Repository::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::Repository * const impl =
+ static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+
+ _non_existent_Repository_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_Repository_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_Repository_Upcall_Command (
+ POA_CORBA::ComponentIR::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::Repository::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::Repository * const impl =
+ static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+
+ _repository_id_Repository_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ComponentIR::Repository::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ComponentIR::Repository * const impl =
+ static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_Repository_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_Repository_Upcall_Command (
+ POA_CORBA::ComponentIR::Repository * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::Repository * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::Repository::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::Repository * const impl =
+ static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+
+ _get_component_Repository_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ComponentIR::Repository::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Repository:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/Repository:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ComponentIR::Repository::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ComponentIR/Repository:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ComponentIR::Repository::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ComponentIR::Repository *
+POA_CORBA::ComponentIR::Repository::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ComponentIR::Repository STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA_ComponentIR__TAO_Repository_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ComponentIR_ProvidesDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ComponentIR_ProvidesDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ComponentIR_ProvidesDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 0, 0, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 10, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 0, 0, 37, 37, 37, 37, 37, 37, 37, 0,
+ 0, 37, 37, 37, 37, 37, 10, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ComponentIR_ProvidesDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 20,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 5,
+ WORDLIST_SIZE = 24
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ComponentIR::ProvidesDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::ComponentIR::ProvidesDef::_is_a_skel, 0},
+ {"_get_id", &POA_CORBA::ComponentIR::ProvidesDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ComponentIR::ProvidesDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::ComponentIR::ProvidesDef::describe_skel, 0},
+ {"_get_name", &POA_CORBA::ComponentIR::ProvidesDef::_get_name_skel, 0},
+ {"_set_name", &POA_CORBA::ComponentIR::ProvidesDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ComponentIR::ProvidesDef::_interface_skel, 0},
+ {"_get_version", &POA_CORBA::ComponentIR::ProvidesDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ComponentIR::ProvidesDef::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ComponentIR::ProvidesDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ComponentIR::ProvidesDef::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ComponentIR::ProvidesDef::_get_defined_in_skel, 0},
+ {"destroy", &POA_CORBA::ComponentIR::ProvidesDef::destroy_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ComponentIR::ProvidesDef::_get_absolute_name_skel, 0},
+ {"_get_interface_type", &POA_CORBA::ComponentIR::ProvidesDef::_get_interface_type_skel, 0},
+ {"_set_interface_type", &POA_CORBA::ComponentIR::ProvidesDef::_set_interface_type_skel, 0},
+ {"_component", &POA_CORBA::ComponentIR::ProvidesDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::ComponentIR::ProvidesDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ComponentIR::ProvidesDef::_get_containing_repository_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -12, -2, -19, -2, 4, 5, -1, 53, 8, 48, 11, -1, -48, 14,
+ 15, 16, -1, 17, 18, -53, 21, -9, -2, 22, -6, -2, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 23,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ComponentIR_ProvidesDef_Perfect_Hash_OpTable tao_CORBA_ComponentIR_ProvidesDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA_ComponentIR__TAO_ProvidesDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA_ComponentIR__TAO_ProvidesDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA_ComponentIR__TAO_ProvidesDef_Proxy_Broker_Factory_function_pointer =
+ CORBA_ComponentIR__TAO_ProvidesDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA_ComponentIR__TAO_ProvidesDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA_ComponentIR__TAO_ProvidesDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA_ComponentIR__TAO_ProvidesDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ComponentIR::ProvidesDef::ProvidesDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ComponentIR_ProvidesDef_optable;
+}
+
+POA_CORBA::ComponentIR::ProvidesDef::ProvidesDef (const ProvidesDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs)
+{
+}
+
+POA_CORBA::ComponentIR::ProvidesDef::~ProvidesDef (void)
+{
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_interface_type_ProvidesDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_interface_type_ProvidesDef (
+ POA_CORBA::ComponentIR::ProvidesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InterfaceDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::InterfaceDef> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->interface_type (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ProvidesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::ProvidesDef::_get_interface_type_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDef>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::ProvidesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+
+ _get_interface_type_ProvidesDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_interface_type_ProvidesDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_interface_type_ProvidesDef (
+ POA_CORBA::ComponentIR::ProvidesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InterfaceDef>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InterfaceDef> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->interface_type (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ProvidesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::ProvidesDef::_set_interface_type_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::InterfaceDef>::in_arg_val _tao_interface_type;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_interface_type
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::ProvidesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+
+ _set_interface_type_ProvidesDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ProvidesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ProvidesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ProvidesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ProvidesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ProvidesDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::ProvidesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+
+ _is_a_ProvidesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ProvidesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ProvidesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ProvidesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ProvidesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ProvidesDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::ProvidesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+
+ _non_existent_ProvidesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ProvidesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ProvidesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ProvidesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ProvidesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ProvidesDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::ProvidesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+
+ _repository_id_ProvidesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ComponentIR::ProvidesDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ComponentIR::ProvidesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ProvidesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ProvidesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ProvidesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ProvidesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ProvidesDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::ProvidesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+
+ _get_component_ProvidesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ComponentIR::ProvidesDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/ProvidesDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ComponentIR::ProvidesDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ComponentIR/ProvidesDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ComponentIR::ProvidesDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ComponentIR::ProvidesDef *
+POA_CORBA::ComponentIR::ProvidesDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ComponentIR::ProvidesDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA_ComponentIR__TAO_ProvidesDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ComponentIR_UsesDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ComponentIR_UsesDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ComponentIR_UsesDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 0, 0, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 10, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 0, 0, 37, 37, 37, 37, 37, 37, 37, 0,
+ 0, 37, 37, 37, 37, 37, 10, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ComponentIR_UsesDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 22,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 6,
+ WORDLIST_SIZE = 26
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ComponentIR::UsesDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::ComponentIR::UsesDef::_is_a_skel, 0},
+ {"_get_id", &POA_CORBA::ComponentIR::UsesDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ComponentIR::UsesDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::ComponentIR::UsesDef::describe_skel, 0},
+ {"_get_name", &POA_CORBA::ComponentIR::UsesDef::_get_name_skel, 0},
+ {"_set_name", &POA_CORBA::ComponentIR::UsesDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ComponentIR::UsesDef::_interface_skel, 0},
+ {"_get_version", &POA_CORBA::ComponentIR::UsesDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ComponentIR::UsesDef::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ComponentIR::UsesDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ComponentIR::UsesDef::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ComponentIR::UsesDef::_get_defined_in_skel, 0},
+ {"_get_is_multiple", &POA_CORBA::ComponentIR::UsesDef::_get_is_multiple_skel, 0},
+ {"_set_is_multiple", &POA_CORBA::ComponentIR::UsesDef::_set_is_multiple_skel, 0},
+ {"destroy", &POA_CORBA::ComponentIR::UsesDef::destroy_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ComponentIR::UsesDef::_get_absolute_name_skel, 0},
+ {"_get_interface_type", &POA_CORBA::ComponentIR::UsesDef::_get_interface_type_skel, 0},
+ {"_set_interface_type", &POA_CORBA::ComponentIR::UsesDef::_set_interface_type_skel, 0},
+ {"_component", &POA_CORBA::ComponentIR::UsesDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::ComponentIR::UsesDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ComponentIR::UsesDef::_get_containing_repository_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -17, -2, -21, -2, 4, 5, -1, 55, 8, 51, 11, -1, 45, 14,
+ 15, 16, -52, 19, 20, -53, 23, -12, -2, 24, -9, -2, -6, -2,
+ -1, -1, -1, -1, -1, -1, -1, -1, 25,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ComponentIR_UsesDef_Perfect_Hash_OpTable tao_CORBA_ComponentIR_UsesDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA_ComponentIR__TAO_UsesDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA_ComponentIR__TAO_UsesDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA_ComponentIR__TAO_UsesDef_Proxy_Broker_Factory_function_pointer =
+ CORBA_ComponentIR__TAO_UsesDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA_ComponentIR__TAO_UsesDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA_ComponentIR__TAO_UsesDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA_ComponentIR__TAO_UsesDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ComponentIR::UsesDef::UsesDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ComponentIR_UsesDef_optable;
+}
+
+POA_CORBA::ComponentIR::UsesDef::UsesDef (const UsesDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs)
+{
+}
+
+POA_CORBA::ComponentIR::UsesDef::~UsesDef (void)
+{
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_interface_type_UsesDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_interface_type_UsesDef (
+ POA_CORBA::ComponentIR::UsesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InterfaceDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::InterfaceDef> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->interface_type (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::UsesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::UsesDef::_get_interface_type_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDef>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::UsesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+
+ _get_interface_type_UsesDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_interface_type_UsesDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_interface_type_UsesDef (
+ POA_CORBA::ComponentIR::UsesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InterfaceDef>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InterfaceDef> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->interface_type (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::UsesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::UsesDef::_set_interface_type_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::InterfaceDef>::in_arg_val _tao_interface_type;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_interface_type
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::UsesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+
+ _set_interface_type_UsesDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_is_multiple_UsesDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_is_multiple_UsesDef (
+ POA_CORBA::ComponentIR::UsesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->is_multiple (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::UsesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::UsesDef::_get_is_multiple_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::UsesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+
+ _get_is_multiple_UsesDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_is_multiple_UsesDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_is_multiple_UsesDef (
+ POA_CORBA::ComponentIR::UsesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->is_multiple (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::UsesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::UsesDef::_set_is_multiple_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_is_multiple;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_is_multiple
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::UsesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+
+ _set_is_multiple_UsesDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_UsesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_UsesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::UsesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::UsesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::UsesDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::UsesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+
+ _is_a_UsesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_UsesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_UsesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::UsesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::UsesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::UsesDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::UsesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+
+ _non_existent_UsesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_UsesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_UsesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::UsesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::UsesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::UsesDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::UsesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+
+ _repository_id_UsesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ComponentIR::UsesDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ComponentIR::UsesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_UsesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_UsesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::UsesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::UsesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::UsesDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::UsesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+
+ _get_component_UsesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ComponentIR::UsesDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/UsesDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ComponentIR::UsesDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ComponentIR/UsesDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ComponentIR::UsesDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ComponentIR::UsesDef *
+POA_CORBA::ComponentIR::UsesDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ComponentIR::UsesDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA_ComponentIR__TAO_UsesDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ComponentIR_EventPortDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ComponentIR_EventPortDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ComponentIR_EventPortDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 0, 0, 37, 37, 37, 15, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 10, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 0, 0, 37, 37, 37, 15, 37, 37, 37, 0,
+ 0, 37, 37, 37, 37, 37, 10, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ComponentIR_EventPortDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 21,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 6,
+ WORDLIST_SIZE = 25
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ComponentIR::EventPortDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::ComponentIR::EventPortDef::_is_a_skel, 0},
+ {"_get_id", &POA_CORBA::ComponentIR::EventPortDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ComponentIR::EventPortDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::ComponentIR::EventPortDef::describe_skel, 0},
+ {"_get_name", &POA_CORBA::ComponentIR::EventPortDef::_get_name_skel, 0},
+ {"_set_name", &POA_CORBA::ComponentIR::EventPortDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ComponentIR::EventPortDef::_interface_skel, 0},
+ {"_get_version", &POA_CORBA::ComponentIR::EventPortDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ComponentIR::EventPortDef::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ComponentIR::EventPortDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ComponentIR::EventPortDef::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ComponentIR::EventPortDef::_get_defined_in_skel, 0},
+ {"destroy", &POA_CORBA::ComponentIR::EventPortDef::destroy_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ComponentIR::EventPortDef::_get_absolute_name_skel, 0},
+ {"is_a", &POA_CORBA::ComponentIR::EventPortDef::is_a_skel, 0},
+ {"_get_event", &POA_CORBA::ComponentIR::EventPortDef::_get_event_skel, 0},
+ {"_component", &POA_CORBA::ComponentIR::EventPortDef::_component_skel, 0},
+ {"_set_event", &POA_CORBA::ComponentIR::EventPortDef::_set_event_skel, 0},
+ {"_non_existent", &POA_CORBA::ComponentIR::EventPortDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ComponentIR::EventPortDef::_get_containing_repository_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -12, -2, -20, -3, 4, 5, -1, 53, 8, 48, 11, -1, -48, 14,
+ 15, 16, -1, 17, 18, 19, -54, -9, -2, 23, -6, -2, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 24,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ComponentIR_EventPortDef_Perfect_Hash_OpTable tao_CORBA_ComponentIR_EventPortDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA_ComponentIR__TAO_EventPortDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA_ComponentIR__TAO_EventPortDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA_ComponentIR__TAO_EventPortDef_Proxy_Broker_Factory_function_pointer =
+ CORBA_ComponentIR__TAO_EventPortDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA_ComponentIR__TAO_EventPortDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA_ComponentIR__TAO_EventPortDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA_ComponentIR__TAO_EventPortDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ComponentIR::EventPortDef::EventPortDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ComponentIR_EventPortDef_optable;
+}
+
+POA_CORBA::ComponentIR::EventPortDef::EventPortDef (const EventPortDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs)
+{
+}
+
+POA_CORBA::ComponentIR::EventPortDef::~EventPortDef (void)
+{
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_event_EventPortDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_event_EventPortDef (
+ POA_CORBA::ComponentIR::EventPortDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::EventDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ComponentIR::EventDef> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->event (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::EventPortDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::EventPortDef::_get_event_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::EventDef>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::EventPortDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+
+ _get_event_EventPortDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_event_EventPortDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_event_EventPortDef (
+ POA_CORBA::ComponentIR::EventPortDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::EventDef>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ComponentIR::EventDef> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->event (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::EventPortDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::EventPortDef::_set_event_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ComponentIR::EventDef>::in_arg_val _tao_event;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_event
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::EventPortDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+
+ _set_event_EventPortDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class is_a_EventPortDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline is_a_EventPortDef (
+ POA_CORBA::ComponentIR::EventPortDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_->is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::EventPortDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::EventPortDef::is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_event_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_event_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::EventPortDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+
+ is_a_EventPortDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_EventPortDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_EventPortDef_Upcall_Command (
+ POA_CORBA::ComponentIR::EventPortDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::EventPortDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::EventPortDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::EventPortDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+
+ _is_a_EventPortDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_EventPortDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_EventPortDef_Upcall_Command (
+ POA_CORBA::ComponentIR::EventPortDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::EventPortDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::EventPortDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::EventPortDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+
+ _non_existent_EventPortDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_EventPortDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_EventPortDef_Upcall_Command (
+ POA_CORBA::ComponentIR::EventPortDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::EventPortDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::EventPortDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::EventPortDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+
+ _repository_id_EventPortDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ComponentIR::EventPortDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ComponentIR::EventPortDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_EventPortDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_EventPortDef_Upcall_Command (
+ POA_CORBA::ComponentIR::EventPortDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::EventPortDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::EventPortDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::EventPortDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+
+ _get_component_EventPortDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ComponentIR::EventPortDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/EventPortDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ComponentIR::EventPortDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ComponentIR/EventPortDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ComponentIR::EventPortDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ComponentIR::EventPortDef *
+POA_CORBA::ComponentIR::EventPortDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ComponentIR::EventPortDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA_ComponentIR__TAO_EventPortDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ComponentIR_EmitsDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ComponentIR_EmitsDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ComponentIR_EmitsDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 0, 0, 37, 37, 37, 15, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 10, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 0, 0, 37, 37, 37, 15, 37, 37, 37, 0,
+ 0, 37, 37, 37, 37, 37, 10, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ComponentIR_EmitsDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 21,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 6,
+ WORDLIST_SIZE = 25
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ComponentIR::EmitsDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::ComponentIR::EmitsDef::_is_a_skel, 0},
+ {"_get_id", &POA_CORBA::ComponentIR::EmitsDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ComponentIR::EmitsDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::ComponentIR::EmitsDef::describe_skel, 0},
+ {"_get_name", &POA_CORBA::ComponentIR::EmitsDef::_get_name_skel, 0},
+ {"_set_name", &POA_CORBA::ComponentIR::EmitsDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ComponentIR::EmitsDef::_interface_skel, 0},
+ {"_get_version", &POA_CORBA::ComponentIR::EmitsDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ComponentIR::EmitsDef::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ComponentIR::EmitsDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ComponentIR::EmitsDef::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ComponentIR::EmitsDef::_get_defined_in_skel, 0},
+ {"destroy", &POA_CORBA::ComponentIR::EmitsDef::destroy_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ComponentIR::EmitsDef::_get_absolute_name_skel, 0},
+ {"is_a", &POA_CORBA::ComponentIR::EmitsDef::is_a_skel, 0},
+ {"_get_event", &POA_CORBA::ComponentIR::EmitsDef::_get_event_skel, 0},
+ {"_component", &POA_CORBA::ComponentIR::EmitsDef::_component_skel, 0},
+ {"_set_event", &POA_CORBA::ComponentIR::EmitsDef::_set_event_skel, 0},
+ {"_non_existent", &POA_CORBA::ComponentIR::EmitsDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ComponentIR::EmitsDef::_get_containing_repository_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -12, -2, -20, -3, 4, 5, -1, 53, 8, 48, 11, -1, -48, 14,
+ 15, 16, -1, 17, 18, 19, -54, -9, -2, 23, -6, -2, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 24,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ComponentIR_EmitsDef_Perfect_Hash_OpTable tao_CORBA_ComponentIR_EmitsDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA_ComponentIR__TAO_EmitsDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA_ComponentIR__TAO_EmitsDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA_ComponentIR__TAO_EmitsDef_Proxy_Broker_Factory_function_pointer =
+ CORBA_ComponentIR__TAO_EmitsDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA_ComponentIR__TAO_EmitsDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA_ComponentIR__TAO_EmitsDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA_ComponentIR__TAO_EmitsDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ComponentIR::EmitsDef::EmitsDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ComponentIR_EmitsDef_optable;
+}
+
+POA_CORBA::ComponentIR::EmitsDef::EmitsDef (const EmitsDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::ComponentIR::EventPortDef (rhs)
+{
+}
+
+POA_CORBA::ComponentIR::EmitsDef::~EmitsDef (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_EmitsDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_EmitsDef_Upcall_Command (
+ POA_CORBA::ComponentIR::EmitsDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::EmitsDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::EmitsDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::EmitsDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+
+ _is_a_EmitsDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_EmitsDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_EmitsDef_Upcall_Command (
+ POA_CORBA::ComponentIR::EmitsDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::EmitsDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::EmitsDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::EmitsDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+
+ _non_existent_EmitsDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_EmitsDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_EmitsDef_Upcall_Command (
+ POA_CORBA::ComponentIR::EmitsDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::EmitsDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::EmitsDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::EmitsDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+
+ _repository_id_EmitsDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ComponentIR::EmitsDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ComponentIR::EmitsDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_EmitsDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_EmitsDef_Upcall_Command (
+ POA_CORBA::ComponentIR::EmitsDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::EmitsDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::EmitsDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::EmitsDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+
+ _get_component_EmitsDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ComponentIR::EmitsDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/EventPortDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/EmitsDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ComponentIR::EmitsDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ComponentIR/EmitsDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ComponentIR::EmitsDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ComponentIR::EmitsDef *
+POA_CORBA::ComponentIR::EmitsDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ComponentIR::EmitsDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA_ComponentIR__TAO_EmitsDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ComponentIR_PublishesDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ComponentIR_PublishesDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ComponentIR_PublishesDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 0, 0, 37, 37, 37, 15, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 10, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 0, 0, 37, 37, 37, 15, 37, 37, 37, 0,
+ 0, 37, 37, 37, 37, 37, 10, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ComponentIR_PublishesDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 21,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 6,
+ WORDLIST_SIZE = 25
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ComponentIR::PublishesDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::ComponentIR::PublishesDef::_is_a_skel, 0},
+ {"_get_id", &POA_CORBA::ComponentIR::PublishesDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ComponentIR::PublishesDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::ComponentIR::PublishesDef::describe_skel, 0},
+ {"_get_name", &POA_CORBA::ComponentIR::PublishesDef::_get_name_skel, 0},
+ {"_set_name", &POA_CORBA::ComponentIR::PublishesDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ComponentIR::PublishesDef::_interface_skel, 0},
+ {"_get_version", &POA_CORBA::ComponentIR::PublishesDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ComponentIR::PublishesDef::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ComponentIR::PublishesDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ComponentIR::PublishesDef::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ComponentIR::PublishesDef::_get_defined_in_skel, 0},
+ {"destroy", &POA_CORBA::ComponentIR::PublishesDef::destroy_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ComponentIR::PublishesDef::_get_absolute_name_skel, 0},
+ {"is_a", &POA_CORBA::ComponentIR::PublishesDef::is_a_skel, 0},
+ {"_get_event", &POA_CORBA::ComponentIR::PublishesDef::_get_event_skel, 0},
+ {"_component", &POA_CORBA::ComponentIR::PublishesDef::_component_skel, 0},
+ {"_set_event", &POA_CORBA::ComponentIR::PublishesDef::_set_event_skel, 0},
+ {"_non_existent", &POA_CORBA::ComponentIR::PublishesDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ComponentIR::PublishesDef::_get_containing_repository_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -12, -2, -20, -3, 4, 5, -1, 53, 8, 48, 11, -1, -48, 14,
+ 15, 16, -1, 17, 18, 19, -54, -9, -2, 23, -6, -2, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 24,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ComponentIR_PublishesDef_Perfect_Hash_OpTable tao_CORBA_ComponentIR_PublishesDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA_ComponentIR__TAO_PublishesDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA_ComponentIR__TAO_PublishesDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA_ComponentIR__TAO_PublishesDef_Proxy_Broker_Factory_function_pointer =
+ CORBA_ComponentIR__TAO_PublishesDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA_ComponentIR__TAO_PublishesDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA_ComponentIR__TAO_PublishesDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA_ComponentIR__TAO_PublishesDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ComponentIR::PublishesDef::PublishesDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ComponentIR_PublishesDef_optable;
+}
+
+POA_CORBA::ComponentIR::PublishesDef::PublishesDef (const PublishesDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::ComponentIR::EventPortDef (rhs)
+{
+}
+
+POA_CORBA::ComponentIR::PublishesDef::~PublishesDef (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_PublishesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_PublishesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::PublishesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::PublishesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::PublishesDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::PublishesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+
+ _is_a_PublishesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_PublishesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_PublishesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::PublishesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::PublishesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::PublishesDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::PublishesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+
+ _non_existent_PublishesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_PublishesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_PublishesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::PublishesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::PublishesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::PublishesDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::PublishesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+
+ _repository_id_PublishesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ComponentIR::PublishesDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ComponentIR::PublishesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_PublishesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_PublishesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::PublishesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::PublishesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::PublishesDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::PublishesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+
+ _get_component_PublishesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ComponentIR::PublishesDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/EventPortDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/PublishesDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ComponentIR::PublishesDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ComponentIR/PublishesDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ComponentIR::PublishesDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ComponentIR::PublishesDef *
+POA_CORBA::ComponentIR::PublishesDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ComponentIR::PublishesDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA_ComponentIR__TAO_PublishesDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ComponentIR_ConsumesDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ComponentIR_ConsumesDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ComponentIR_ConsumesDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 0, 0, 37, 37, 37, 15, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 10, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 0, 0, 37, 37, 37, 15, 37, 37, 37, 0,
+ 0, 37, 37, 37, 37, 37, 10, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ComponentIR_ConsumesDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 21,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 6,
+ WORDLIST_SIZE = 25
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ComponentIR::ConsumesDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::ComponentIR::ConsumesDef::_is_a_skel, 0},
+ {"_get_id", &POA_CORBA::ComponentIR::ConsumesDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ComponentIR::ConsumesDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::ComponentIR::ConsumesDef::describe_skel, 0},
+ {"_get_name", &POA_CORBA::ComponentIR::ConsumesDef::_get_name_skel, 0},
+ {"_set_name", &POA_CORBA::ComponentIR::ConsumesDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ComponentIR::ConsumesDef::_interface_skel, 0},
+ {"_get_version", &POA_CORBA::ComponentIR::ConsumesDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ComponentIR::ConsumesDef::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ComponentIR::ConsumesDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ComponentIR::ConsumesDef::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ComponentIR::ConsumesDef::_get_defined_in_skel, 0},
+ {"destroy", &POA_CORBA::ComponentIR::ConsumesDef::destroy_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ComponentIR::ConsumesDef::_get_absolute_name_skel, 0},
+ {"is_a", &POA_CORBA::ComponentIR::ConsumesDef::is_a_skel, 0},
+ {"_get_event", &POA_CORBA::ComponentIR::ConsumesDef::_get_event_skel, 0},
+ {"_component", &POA_CORBA::ComponentIR::ConsumesDef::_component_skel, 0},
+ {"_set_event", &POA_CORBA::ComponentIR::ConsumesDef::_set_event_skel, 0},
+ {"_non_existent", &POA_CORBA::ComponentIR::ConsumesDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ComponentIR::ConsumesDef::_get_containing_repository_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -12, -2, -20, -3, 4, 5, -1, 53, 8, 48, 11, -1, -48, 14,
+ 15, 16, -1, 17, 18, 19, -54, -9, -2, 23, -6, -2, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 24,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ComponentIR_ConsumesDef_Perfect_Hash_OpTable tao_CORBA_ComponentIR_ConsumesDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA_ComponentIR__TAO_ConsumesDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA_ComponentIR__TAO_ConsumesDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA_ComponentIR__TAO_ConsumesDef_Proxy_Broker_Factory_function_pointer =
+ CORBA_ComponentIR__TAO_ConsumesDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA_ComponentIR__TAO_ConsumesDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA_ComponentIR__TAO_ConsumesDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA_ComponentIR__TAO_ConsumesDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ComponentIR::ConsumesDef::ConsumesDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ComponentIR_ConsumesDef_optable;
+}
+
+POA_CORBA::ComponentIR::ConsumesDef::ConsumesDef (const ConsumesDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::ComponentIR::EventPortDef (rhs)
+{
+}
+
+POA_CORBA::ComponentIR::ConsumesDef::~ConsumesDef (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ConsumesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ConsumesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ConsumesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ConsumesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ConsumesDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::ConsumesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+
+ _is_a_ConsumesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ConsumesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ConsumesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ConsumesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ConsumesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ConsumesDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::ConsumesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+
+ _non_existent_ConsumesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ConsumesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ConsumesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ConsumesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ConsumesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ConsumesDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::ConsumesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+
+ _repository_id_ConsumesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ComponentIR::ConsumesDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ComponentIR::ConsumesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ConsumesDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ConsumesDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ConsumesDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ConsumesDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ConsumesDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::ConsumesDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+
+ _get_component_ConsumesDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ComponentIR::ConsumesDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/EventPortDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/ConsumesDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ComponentIR::ConsumesDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ComponentIR/ConsumesDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ComponentIR::ConsumesDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ComponentIR::ConsumesDef *
+POA_CORBA::ComponentIR::ConsumesDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ComponentIR::ConsumesDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA_ComponentIR__TAO_ConsumesDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ComponentIR_ComponentDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ComponentIR_ComponentDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ComponentIR_ComponentDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 35,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 0,
+ 90, 0, 25, 0, 90, 90, 90, 5, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 30, 0, 5,
+ 90, 10, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 15, 35, 90, 90, 90, 20, 0, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90,
+#else
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 35, 90, 0, 90, 0,
+ 25, 0, 90, 90, 90, 5, 90, 90, 30, 0,
+ 5, 90, 10, 90, 90, 15, 35, 90, 90, 90,
+ 20, 0, 90, 90, 90, 90, 90, 90,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ComponentIR_ComponentDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 54,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 89,
+ HASH_VALUE_RANGE = 86,
+ DUPLICATES = 14,
+ WORDLIST_SIZE = 58
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ComponentIR::ComponentDef::move_skel, 0},
+ {"is_a", &POA_CORBA::ComponentIR::ComponentDef::is_a_skel, 0},
+ {"create_enum", &POA_CORBA::ComponentIR::ComponentDef::create_enum_skel, 0},
+ {"create_value", &POA_CORBA::ComponentIR::ComponentDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::ComponentIR::ComponentDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::ComponentIR::ComponentDef::create_native_skel, 0},
+ {"create_interface", &POA_CORBA::ComponentIR::ComponentDef::create_interface_skel, 0},
+ {"create_attribute", &POA_CORBA::ComponentIR::ComponentDef::create_attribute_skel, 0},
+ {"create_ext_value", &POA_CORBA::ComponentIR::ComponentDef::create_ext_value_skel, 0},
+ {"create_union", &POA_CORBA::ComponentIR::ComponentDef::create_union_skel, 0},
+ {"create_ext_attribute", &POA_CORBA::ComponentIR::ComponentDef::create_ext_attribute_skel, 0},
+ {"create_exception", &POA_CORBA::ComponentIR::ComponentDef::create_exception_skel, 0},
+ {"create_operation", &POA_CORBA::ComponentIR::ComponentDef::create_operation_skel, 0},
+ {"create_local_interface", &POA_CORBA::ComponentIR::ComponentDef::create_local_interface_skel, 0},
+ {"contents", &POA_CORBA::ComponentIR::ComponentDef::contents_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::ComponentIR::ComponentDef::create_abstract_interface_skel, 0},
+ {"create_uses", &POA_CORBA::ComponentIR::ComponentDef::create_uses_skel, 0},
+ {"create_alias", &POA_CORBA::ComponentIR::ComponentDef::create_alias_skel, 0},
+ {"create_emits", &POA_CORBA::ComponentIR::ComponentDef::create_emits_skel, 0},
+ {"create_provides", &POA_CORBA::ComponentIR::ComponentDef::create_provides_skel, 0},
+ {"create_consumes", &POA_CORBA::ComponentIR::ComponentDef::create_consumes_skel, 0},
+ {"create_publishes", &POA_CORBA::ComponentIR::ComponentDef::create_publishes_skel, 0},
+ {"destroy", &POA_CORBA::ComponentIR::ComponentDef::destroy_skel, 0},
+ {"describe", &POA_CORBA::ComponentIR::ComponentDef::describe_skel, 0},
+ {"create_value_box", &POA_CORBA::ComponentIR::ComponentDef::create_value_box_skel, 0},
+ {"_is_a", &POA_CORBA::ComponentIR::ComponentDef::_is_a_skel, 0},
+ {"lookup_name", &POA_CORBA::ComponentIR::ComponentDef::lookup_name_skel, 0},
+ {"describe_interface", &POA_CORBA::ComponentIR::ComponentDef::describe_interface_skel, 0},
+ {"_get_name", &POA_CORBA::ComponentIR::ComponentDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::ComponentIR::ComponentDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::ComponentIR::ComponentDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ComponentIR::ComponentDef::_interface_skel, 0},
+ {"lookup", &POA_CORBA::ComponentIR::ComponentDef::lookup_skel, 0},
+ {"describe_ext_interface", &POA_CORBA::ComponentIR::ComponentDef::describe_ext_interface_skel, 0},
+ {"create_struct", &POA_CORBA::ComponentIR::ComponentDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::ComponentIR::ComponentDef::create_constant_skel, 0},
+ {"_get_version", &POA_CORBA::ComponentIR::ComponentDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ComponentIR::ComponentDef::_set_version_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ComponentIR::ComponentDef::_get_absolute_name_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ComponentIR::ComponentDef::_get_defined_in_skel, 0},
+ {"describe_contents", &POA_CORBA::ComponentIR::ComponentDef::describe_contents_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ComponentIR::ComponentDef::_get_containing_repository_skel, 0},
+ {"_get_id", &POA_CORBA::ComponentIR::ComponentDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ComponentIR::ComponentDef::_set_id_skel, 0},
+ {"_get_base_interfaces", &POA_CORBA::ComponentIR::ComponentDef::_get_base_interfaces_skel, 0},
+ {"_set_base_interfaces", &POA_CORBA::ComponentIR::ComponentDef::_set_base_interfaces_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ComponentIR::ComponentDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ComponentIR::ComponentDef::_repository_id_skel, 0},
+ {"_get_supported_interfaces", &POA_CORBA::ComponentIR::ComponentDef::_get_supported_interfaces_skel, 0},
+ {"_set_supported_interfaces", &POA_CORBA::ComponentIR::ComponentDef::_set_supported_interfaces_skel, 0},
+ {"_component", &POA_CORBA::ComponentIR::ComponentDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::ComponentIR::ComponentDef::_non_existent_skel, 0},
+ {"_get_base_component", &POA_CORBA::ComponentIR::ComponentDef::_get_base_component_skel, 0},
+ {"_set_base_component", &POA_CORBA::ComponentIR::ComponentDef::_set_base_component_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, 4, -8, -2, -10, -3, 5, -1, 6, 7, -97,
+ -15, -2, -98, 13, -21, -2, 14, -96, 17, 18, -1, 19, 20, -98,
+ -23, -2, -91, 25, 26, 27, -32, -3, 28, -1, -40, -2, 29, 30,
+ -1, 31, -99, 35, 36, 37, 38, -1, 39, -1, -103, 42, -1, 43,
+ -1, 44, -1, -1, -1, 45, -1, -1, -1, -46, -2, -91, -48, -2,
+ -91, -52, -2, 50, 51, -93, -1, -1, -1, -1, 54, -1, -1, 55,
+ -1, -1, -1, -56, -2, -91,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ComponentIR_ComponentDef_Perfect_Hash_OpTable tao_CORBA_ComponentIR_ComponentDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA_ComponentIR__TAO_ComponentDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA_ComponentIR__TAO_ComponentDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA_ComponentIR__TAO_ComponentDef_Proxy_Broker_Factory_function_pointer =
+ CORBA_ComponentIR__TAO_ComponentDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA_ComponentIR__TAO_ComponentDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA_ComponentIR__TAO_ComponentDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA_ComponentIR__TAO_ComponentDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ComponentIR::ComponentDef::ComponentDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ComponentIR_ComponentDef_optable;
+}
+
+POA_CORBA::ComponentIR::ComponentDef::ComponentDef (const ComponentDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs),
+ POA_CORBA::InterfaceDef (rhs),
+ POA_CORBA::InterfaceAttrExtension (rhs),
+ POA_CORBA::ExtInterfaceDef (rhs)
+{
+}
+
+POA_CORBA::ComponentIR::ComponentDef::~ComponentDef (void)
+{
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_base_component_ComponentDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_base_component_ComponentDef (
+ POA_CORBA::ComponentIR::ComponentDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ComponentDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ComponentIR::ComponentDef> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->base_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ComponentDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::ComponentDef::_get_base_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ComponentDef>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::ComponentDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+
+ _get_base_component_ComponentDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_base_component_ComponentDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_base_component_ComponentDef (
+ POA_CORBA::ComponentIR::ComponentDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ComponentDef>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ComponentIR::ComponentDef> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->base_component (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ComponentDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::ComponentDef::_set_base_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ComponentDef>::in_arg_val _tao_base_component;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_base_component
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::ComponentDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+
+ _set_base_component_ComponentDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_supported_interfaces_ComponentDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_supported_interfaces_ComponentDef (
+ POA_CORBA::ComponentIR::ComponentDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::InterfaceDefSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->supported_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ComponentDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::ComponentDef::_get_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::ComponentDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+
+ _get_supported_interfaces_ComponentDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_supported_interfaces_ComponentDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_supported_interfaces_ComponentDef (
+ POA_CORBA::ComponentIR::ComponentDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InterfaceDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->supported_interfaces (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ComponentDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::ComponentDef::_set_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_val _tao_supported_interfaces;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_supported_interfaces
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::ComponentDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+
+ _set_supported_interfaces_ComponentDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_provides_ComponentDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_provides_ComponentDef (
+ POA_CORBA::ComponentIR::ComponentDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ProvidesDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ComponentIR::ProvidesDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDef>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InterfaceDef> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ retval =
+ this->servant_->create_provides (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ComponentDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::ComponentDef::create_provides_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ProvidesDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::InterfaceDef>::in_arg_val _tao_interface_type;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_interface_type
+ };
+
+ static size_t const nargs = 5;
+
+ POA_CORBA::ComponentIR::ComponentDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+
+ create_provides_ComponentDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_uses_ComponentDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_uses_ComponentDef (
+ POA_CORBA::ComponentIR::ComponentDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::UsesDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ComponentIR::UsesDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDef>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InterfaceDef> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ retval =
+ this->servant_->create_uses (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ComponentDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::ComponentDef::create_uses_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::UsesDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::InterfaceDef>::in_arg_val _tao_interface_type;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_is_multiple;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_interface_type,
+ &_tao_is_multiple
+ };
+
+ static size_t const nargs = 6;
+
+ POA_CORBA::ComponentIR::ComponentDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+
+ create_uses_ComponentDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_emits_ComponentDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_emits_ComponentDef (
+ POA_CORBA::ComponentIR::ComponentDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::EmitsDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ComponentIR::EmitsDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::EventDef>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ComponentIR::EventDef> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ retval =
+ this->servant_->create_emits (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ComponentDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::ComponentDef::create_emits_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::EmitsDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::ComponentIR::EventDef>::in_arg_val _tao_event;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_event
+ };
+
+ static size_t const nargs = 5;
+
+ POA_CORBA::ComponentIR::ComponentDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+
+ create_emits_ComponentDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_publishes_ComponentDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_publishes_ComponentDef (
+ POA_CORBA::ComponentIR::ComponentDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::PublishesDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ComponentIR::PublishesDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::EventDef>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ComponentIR::EventDef> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ retval =
+ this->servant_->create_publishes (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ComponentDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::ComponentDef::create_publishes_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::PublishesDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::ComponentIR::EventDef>::in_arg_val _tao_event;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_event
+ };
+
+ static size_t const nargs = 5;
+
+ POA_CORBA::ComponentIR::ComponentDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+
+ create_publishes_ComponentDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_consumes_ComponentDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_consumes_ComponentDef (
+ POA_CORBA::ComponentIR::ComponentDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ConsumesDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ComponentIR::ConsumesDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::EventDef>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ComponentIR::EventDef> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ retval =
+ this->servant_->create_consumes (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ComponentDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::ComponentDef::create_consumes_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ConsumesDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::ComponentIR::EventDef>::in_arg_val _tao_event;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_event
+ };
+
+ static size_t const nargs = 5;
+
+ POA_CORBA::ComponentIR::ComponentDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+
+ create_consumes_ComponentDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ComponentDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ComponentDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ComponentDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ComponentDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ComponentDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::ComponentDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+
+ _is_a_ComponentDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ComponentDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ComponentDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ComponentDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ComponentDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ComponentDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::ComponentDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+
+ _non_existent_ComponentDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ComponentDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ComponentDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ComponentDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ComponentDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ComponentDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::ComponentDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+
+ _repository_id_ComponentDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ComponentIR::ComponentDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ComponentIR::ComponentDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ComponentDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ComponentDef_Upcall_Command (
+ POA_CORBA::ComponentIR::ComponentDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::ComponentDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::ComponentDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::ComponentDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+
+ _get_component_ComponentDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ComponentIR::ComponentDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/InterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/InterfaceAttrExtension:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ExtInterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/ComponentDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ComponentIR::ComponentDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ComponentIR/ComponentDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ComponentIR::ComponentDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ComponentIR::ComponentDef *
+POA_CORBA::ComponentIR::ComponentDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ComponentIR::ComponentDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA_ComponentIR__TAO_ComponentDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ComponentIR_FactoryDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ComponentIR_FactoryDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ComponentIR_FactoryDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 15, 0, 10, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 5,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 0, 20, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 15, 0, 10, 37, 37, 37, 37, 37, 37, 0,
+ 5, 37, 37, 37, 37, 0, 20, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ComponentIR_FactoryDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 29,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 10,
+ WORDLIST_SIZE = 33
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ComponentIR::FactoryDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::ComponentIR::FactoryDef::_is_a_skel, 0},
+ {"_get_name", &POA_CORBA::ComponentIR::FactoryDef::_get_name_skel, 0},
+ {"_set_mode", &POA_CORBA::ComponentIR::FactoryDef::_set_mode_skel, 0},
+ {"_get_mode", &POA_CORBA::ComponentIR::FactoryDef::_get_mode_skel, 0},
+ {"_set_name", &POA_CORBA::ComponentIR::FactoryDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ComponentIR::FactoryDef::_interface_skel, 0},
+ {"_get_params", &POA_CORBA::ComponentIR::FactoryDef::_get_params_skel, 0},
+ {"_set_params", &POA_CORBA::ComponentIR::FactoryDef::_set_params_skel, 0},
+ {"_get_contexts", &POA_CORBA::ComponentIR::FactoryDef::_get_contexts_skel, 0},
+ {"_set_contexts", &POA_CORBA::ComponentIR::FactoryDef::_set_contexts_skel, 0},
+ {"_get_exceptions", &POA_CORBA::ComponentIR::FactoryDef::_get_exceptions_skel, 0},
+ {"_set_exceptions", &POA_CORBA::ComponentIR::FactoryDef::_set_exceptions_skel, 0},
+ {"_get_version", &POA_CORBA::ComponentIR::FactoryDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ComponentIR::FactoryDef::_set_version_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ComponentIR::FactoryDef::_get_absolute_name_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ComponentIR::FactoryDef::_get_defined_in_skel, 0},
+ {"_get_id", &POA_CORBA::ComponentIR::FactoryDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ComponentIR::FactoryDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::ComponentIR::FactoryDef::describe_skel, 0},
+ {"_get_result_def", &POA_CORBA::ComponentIR::FactoryDef::_get_result_def_skel, 0},
+ {"_set_result_def", &POA_CORBA::ComponentIR::FactoryDef::_set_result_def_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ComponentIR::FactoryDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ComponentIR::FactoryDef::_repository_id_skel, 0},
+ {"_component", &POA_CORBA::ComponentIR::FactoryDef::_component_skel, 0},
+ {"_get_result", &POA_CORBA::ComponentIR::FactoryDef::_get_result_skel, 0},
+ {"destroy", &POA_CORBA::ComponentIR::FactoryDef::destroy_skel, 0},
+ {"_non_existent", &POA_CORBA::ComponentIR::FactoryDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ComponentIR::FactoryDef::_get_containing_repository_skel, 0},
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ {
+ const TAO_operation_db_entry *resword;
+
+ switch (key)
+ {
+ case 4:
+ resword = &wordlist[4]; break;
+ case 5:
+ resword = &wordlist[5]; break;
+ case 9:
+ resword = &wordlist[6];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[7];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[8];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[9];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 10:
+ resword = &wordlist[10]; break;
+ case 11:
+ resword = &wordlist[11];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[12];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 13:
+ resword = &wordlist[13];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[14];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 15:
+ resword = &wordlist[15];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[16];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 17:
+ resword = &wordlist[17];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[18];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 18:
+ resword = &wordlist[19]; break;
+ case 20:
+ resword = &wordlist[20]; break;
+ case 22:
+ resword = &wordlist[21];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[22];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 23:
+ resword = &wordlist[23]; break;
+ case 25:
+ resword = &wordlist[24];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[25];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 28:
+ resword = &wordlist[26]; break;
+ case 29:
+ resword = &wordlist[27]; break;
+ case 30:
+ resword = &wordlist[28]; break;
+ case 31:
+ resword = &wordlist[29]; break;
+ case 32:
+ resword = &wordlist[30]; break;
+ case 33:
+ resword = &wordlist[31]; break;
+ case 36:
+ resword = &wordlist[32]; break;
+ default: return 0;
+ }
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1))
+ return resword;
+ return 0;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ComponentIR_FactoryDef_Perfect_Hash_OpTable tao_CORBA_ComponentIR_FactoryDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA_ComponentIR__TAO_FactoryDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA_ComponentIR__TAO_FactoryDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA_ComponentIR__TAO_FactoryDef_Proxy_Broker_Factory_function_pointer =
+ CORBA_ComponentIR__TAO_FactoryDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA_ComponentIR__TAO_FactoryDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA_ComponentIR__TAO_FactoryDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA_ComponentIR__TAO_FactoryDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ComponentIR::FactoryDef::FactoryDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ComponentIR_FactoryDef_optable;
+}
+
+POA_CORBA::ComponentIR::FactoryDef::FactoryDef (const FactoryDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::OperationDef (rhs)
+{
+}
+
+POA_CORBA::ComponentIR::FactoryDef::~FactoryDef (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_FactoryDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_FactoryDef_Upcall_Command (
+ POA_CORBA::ComponentIR::FactoryDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::FactoryDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::FactoryDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::FactoryDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+
+ _is_a_FactoryDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_FactoryDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_FactoryDef_Upcall_Command (
+ POA_CORBA::ComponentIR::FactoryDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::FactoryDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::FactoryDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::FactoryDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+
+ _non_existent_FactoryDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_FactoryDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_FactoryDef_Upcall_Command (
+ POA_CORBA::ComponentIR::FactoryDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::FactoryDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::FactoryDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::FactoryDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+
+ _repository_id_FactoryDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ComponentIR::FactoryDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ComponentIR::FactoryDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_FactoryDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_FactoryDef_Upcall_Command (
+ POA_CORBA::ComponentIR::FactoryDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::FactoryDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::FactoryDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::FactoryDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+
+ _get_component_FactoryDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ComponentIR::FactoryDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/OperationDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/FactoryDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ComponentIR::FactoryDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ComponentIR/FactoryDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ComponentIR::FactoryDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ComponentIR::FactoryDef *
+POA_CORBA::ComponentIR::FactoryDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ComponentIR::FactoryDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA_ComponentIR__TAO_FactoryDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ComponentIR_FinderDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ComponentIR_FinderDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ComponentIR_FinderDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 15, 0, 10, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 5,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 0, 20, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 15, 0, 10, 37, 37, 37, 37, 37, 37, 0,
+ 5, 37, 37, 37, 37, 0, 20, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ComponentIR_FinderDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 29,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 10,
+ WORDLIST_SIZE = 33
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ComponentIR::FinderDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::ComponentIR::FinderDef::_is_a_skel, 0},
+ {"_get_name", &POA_CORBA::ComponentIR::FinderDef::_get_name_skel, 0},
+ {"_set_mode", &POA_CORBA::ComponentIR::FinderDef::_set_mode_skel, 0},
+ {"_get_mode", &POA_CORBA::ComponentIR::FinderDef::_get_mode_skel, 0},
+ {"_set_name", &POA_CORBA::ComponentIR::FinderDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ComponentIR::FinderDef::_interface_skel, 0},
+ {"_get_params", &POA_CORBA::ComponentIR::FinderDef::_get_params_skel, 0},
+ {"_set_params", &POA_CORBA::ComponentIR::FinderDef::_set_params_skel, 0},
+ {"_get_contexts", &POA_CORBA::ComponentIR::FinderDef::_get_contexts_skel, 0},
+ {"_set_contexts", &POA_CORBA::ComponentIR::FinderDef::_set_contexts_skel, 0},
+ {"_get_exceptions", &POA_CORBA::ComponentIR::FinderDef::_get_exceptions_skel, 0},
+ {"_set_exceptions", &POA_CORBA::ComponentIR::FinderDef::_set_exceptions_skel, 0},
+ {"_get_version", &POA_CORBA::ComponentIR::FinderDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ComponentIR::FinderDef::_set_version_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ComponentIR::FinderDef::_get_absolute_name_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ComponentIR::FinderDef::_get_defined_in_skel, 0},
+ {"_get_id", &POA_CORBA::ComponentIR::FinderDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ComponentIR::FinderDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::ComponentIR::FinderDef::describe_skel, 0},
+ {"_get_result_def", &POA_CORBA::ComponentIR::FinderDef::_get_result_def_skel, 0},
+ {"_set_result_def", &POA_CORBA::ComponentIR::FinderDef::_set_result_def_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ComponentIR::FinderDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ComponentIR::FinderDef::_repository_id_skel, 0},
+ {"_component", &POA_CORBA::ComponentIR::FinderDef::_component_skel, 0},
+ {"_get_result", &POA_CORBA::ComponentIR::FinderDef::_get_result_skel, 0},
+ {"destroy", &POA_CORBA::ComponentIR::FinderDef::destroy_skel, 0},
+ {"_non_existent", &POA_CORBA::ComponentIR::FinderDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ComponentIR::FinderDef::_get_containing_repository_skel, 0},
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ {
+ const TAO_operation_db_entry *resword;
+
+ switch (key)
+ {
+ case 4:
+ resword = &wordlist[4]; break;
+ case 5:
+ resword = &wordlist[5]; break;
+ case 9:
+ resword = &wordlist[6];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[7];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[8];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[9];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 10:
+ resword = &wordlist[10]; break;
+ case 11:
+ resword = &wordlist[11];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[12];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 13:
+ resword = &wordlist[13];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[14];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 15:
+ resword = &wordlist[15];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[16];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 17:
+ resword = &wordlist[17];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[18];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 18:
+ resword = &wordlist[19]; break;
+ case 20:
+ resword = &wordlist[20]; break;
+ case 22:
+ resword = &wordlist[21];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[22];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 23:
+ resword = &wordlist[23]; break;
+ case 25:
+ resword = &wordlist[24];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ resword = &wordlist[25];
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1)) return resword;
+ return 0;
+ case 28:
+ resword = &wordlist[26]; break;
+ case 29:
+ resword = &wordlist[27]; break;
+ case 30:
+ resword = &wordlist[28]; break;
+ case 31:
+ resword = &wordlist[29]; break;
+ case 32:
+ resword = &wordlist[30]; break;
+ case 33:
+ resword = &wordlist[31]; break;
+ case 36:
+ resword = &wordlist[32]; break;
+ default: return 0;
+ }
+ if (*str == *resword->opname && !strncmp (str + 1, resword->opname + 1, len - 1))
+ return resword;
+ return 0;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ComponentIR_FinderDef_Perfect_Hash_OpTable tao_CORBA_ComponentIR_FinderDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA_ComponentIR__TAO_FinderDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA_ComponentIR__TAO_FinderDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA_ComponentIR__TAO_FinderDef_Proxy_Broker_Factory_function_pointer =
+ CORBA_ComponentIR__TAO_FinderDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA_ComponentIR__TAO_FinderDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA_ComponentIR__TAO_FinderDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA_ComponentIR__TAO_FinderDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ComponentIR::FinderDef::FinderDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ComponentIR_FinderDef_optable;
+}
+
+POA_CORBA::ComponentIR::FinderDef::FinderDef (const FinderDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::OperationDef (rhs)
+{
+}
+
+POA_CORBA::ComponentIR::FinderDef::~FinderDef (void)
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_FinderDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_FinderDef_Upcall_Command (
+ POA_CORBA::ComponentIR::FinderDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::FinderDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::FinderDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::FinderDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+
+ _is_a_FinderDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_FinderDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_FinderDef_Upcall_Command (
+ POA_CORBA::ComponentIR::FinderDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::FinderDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::FinderDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::FinderDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+
+ _non_existent_FinderDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_FinderDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_FinderDef_Upcall_Command (
+ POA_CORBA::ComponentIR::FinderDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::FinderDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::FinderDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::FinderDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+
+ _repository_id_FinderDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ComponentIR::FinderDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ComponentIR::FinderDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_FinderDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_FinderDef_Upcall_Command (
+ POA_CORBA::ComponentIR::FinderDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::FinderDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::FinderDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::FinderDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+
+ _get_component_FinderDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ComponentIR::FinderDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/OperationDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/FinderDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ComponentIR::FinderDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ComponentIR/FinderDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ComponentIR::FinderDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ComponentIR::FinderDef *
+POA_CORBA::ComponentIR::FinderDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ComponentIR::FinderDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA_ComponentIR__TAO_FinderDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ComponentIR_HomeDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ComponentIR_HomeDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ComponentIR_HomeDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 0,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 0,
+ 101, 45, 20, 0, 101, 101, 101, 15, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 0, 0, 20,
+ 101, 0, 101, 5, 101, 101, 101, 101, 101, 101,
+ 101, 101, 35, 40, 101, 101, 101, 5, 10, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101,
+#else
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 0, 101, 0, 101, 45,
+ 20, 0, 101, 101, 101, 15, 101, 101, 0, 0,
+ 20, 101, 0, 101, 5, 35, 40, 101, 101, 101,
+ 5, 10, 101, 101, 101, 101, 101, 101,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ComponentIR_HomeDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 55,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 100,
+ HASH_VALUE_RANGE = 97,
+ DUPLICATES = 14,
+ WORDLIST_SIZE = 59
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ComponentIR::HomeDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::ComponentIR::HomeDef::_is_a_skel, 0},
+ {"lookup", &POA_CORBA::ComponentIR::HomeDef::lookup_skel, 0},
+ {"_get_name", &POA_CORBA::ComponentIR::HomeDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::ComponentIR::HomeDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::ComponentIR::HomeDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ComponentIR::HomeDef::_interface_skel, 0},
+ {"lookup_name", &POA_CORBA::ComponentIR::HomeDef::lookup_name_skel, 0},
+ {"_get_base_home", &POA_CORBA::ComponentIR::HomeDef::_get_base_home_skel, 0},
+ {"_set_base_home", &POA_CORBA::ComponentIR::HomeDef::_set_base_home_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ComponentIR::HomeDef::_get_absolute_name_skel, 0},
+ {"is_a", &POA_CORBA::ComponentIR::HomeDef::is_a_skel, 0},
+ {"_get_primary_key", &POA_CORBA::ComponentIR::HomeDef::_get_primary_key_skel, 0},
+ {"_set_primary_key", &POA_CORBA::ComponentIR::HomeDef::_set_primary_key_skel, 0},
+ {"_get_id", &POA_CORBA::ComponentIR::HomeDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ComponentIR::HomeDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::ComponentIR::HomeDef::describe_skel, 0},
+ {"_get_version", &POA_CORBA::ComponentIR::HomeDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ComponentIR::HomeDef::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ComponentIR::HomeDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ComponentIR::HomeDef::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ComponentIR::HomeDef::_get_defined_in_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ComponentIR::HomeDef::_get_containing_repository_skel, 0},
+ {"destroy", &POA_CORBA::ComponentIR::HomeDef::destroy_skel, 0},
+ {"describe_interface", &POA_CORBA::ComponentIR::HomeDef::describe_interface_skel, 0},
+ {"describe_ext_interface", &POA_CORBA::ComponentIR::HomeDef::describe_ext_interface_skel, 0},
+ {"_component", &POA_CORBA::ComponentIR::HomeDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::ComponentIR::HomeDef::_non_existent_skel, 0},
+ {"_get_base_interfaces", &POA_CORBA::ComponentIR::HomeDef::_get_base_interfaces_skel, 0},
+ {"_set_base_interfaces", &POA_CORBA::ComponentIR::HomeDef::_set_base_interfaces_skel, 0},
+ {"create_enum", &POA_CORBA::ComponentIR::HomeDef::create_enum_skel, 0},
+ {"create_value", &POA_CORBA::ComponentIR::HomeDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::ComponentIR::HomeDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::ComponentIR::HomeDef::create_native_skel, 0},
+ {"_get_supported_interfaces", &POA_CORBA::ComponentIR::HomeDef::_get_supported_interfaces_skel, 0},
+ {"_set_supported_interfaces", &POA_CORBA::ComponentIR::HomeDef::_set_supported_interfaces_skel, 0},
+ {"create_interface", &POA_CORBA::ComponentIR::HomeDef::create_interface_skel, 0},
+ {"create_attribute", &POA_CORBA::ComponentIR::HomeDef::create_attribute_skel, 0},
+ {"create_ext_value", &POA_CORBA::ComponentIR::HomeDef::create_ext_value_skel, 0},
+ {"_get_managed_component", &POA_CORBA::ComponentIR::HomeDef::_get_managed_component_skel, 0},
+ {"_set_managed_component", &POA_CORBA::ComponentIR::HomeDef::_set_managed_component_skel, 0},
+ {"create_finder", &POA_CORBA::ComponentIR::HomeDef::create_finder_skel, 0},
+ {"create_ext_attribute", &POA_CORBA::ComponentIR::HomeDef::create_ext_attribute_skel, 0},
+ {"create_value_box", &POA_CORBA::ComponentIR::HomeDef::create_value_box_skel, 0},
+ {"create_local_interface", &POA_CORBA::ComponentIR::HomeDef::create_local_interface_skel, 0},
+ {"create_factory", &POA_CORBA::ComponentIR::HomeDef::create_factory_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::ComponentIR::HomeDef::create_abstract_interface_skel, 0},
+ {"describe_contents", &POA_CORBA::ComponentIR::HomeDef::describe_contents_skel, 0},
+ {"create_union", &POA_CORBA::ComponentIR::HomeDef::create_union_skel, 0},
+ {"create_exception", &POA_CORBA::ComponentIR::HomeDef::create_exception_skel, 0},
+ {"create_operation", &POA_CORBA::ComponentIR::HomeDef::create_operation_skel, 0},
+ {"contents", &POA_CORBA::ComponentIR::HomeDef::contents_skel, 0},
+ {"create_alias", &POA_CORBA::ComponentIR::HomeDef::create_alias_skel, 0},
+ {"create_struct", &POA_CORBA::ComponentIR::HomeDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::ComponentIR::HomeDef::create_constant_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -1, -1, -1, 4, 5, 6, -7, -3, -102, 10, 11, -12, -2,
+ -102, -1, -1, -1, 14, 15, -1, -1, -16, -2, -18, -2, -104, -103,
+ 20, -1, -21, -2, -102, 23, 24, 25, 26, 27, 28, -1, -32, -2,
+ 29, -1, -36, -2, -38, -2, -40, -3, 30, -43, -2, 31, -1, -115,
+ 34, 35, -114, -1, -114, -113, -111, 45, -1, 46, 47, 48, -1, 49,
+ 50, -1, 51, -1, -1, -1, -1, 52, -1, -53, -2, -102, -1, -1,
+ -1, -1, -1, -1, 55, -1, -1, -1, 56, -1, -1, -1, -1, -1,
+ 57, -1, 58,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ComponentIR_HomeDef_Perfect_Hash_OpTable tao_CORBA_ComponentIR_HomeDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA_ComponentIR__TAO_HomeDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA_ComponentIR__TAO_HomeDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA_ComponentIR__TAO_HomeDef_Proxy_Broker_Factory_function_pointer =
+ CORBA_ComponentIR__TAO_HomeDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA_ComponentIR__TAO_HomeDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA_ComponentIR__TAO_HomeDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA_ComponentIR__TAO_HomeDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ComponentIR::HomeDef::HomeDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ComponentIR_HomeDef_optable;
+}
+
+POA_CORBA::ComponentIR::HomeDef::HomeDef (const HomeDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs),
+ POA_CORBA::InterfaceDef (rhs),
+ POA_CORBA::InterfaceAttrExtension (rhs),
+ POA_CORBA::ExtInterfaceDef (rhs)
+{
+}
+
+POA_CORBA::ComponentIR::HomeDef::~HomeDef (void)
+{
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_base_home_HomeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_base_home_HomeDef (
+ POA_CORBA::ComponentIR::HomeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::HomeDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ComponentIR::HomeDef> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->base_home (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::HomeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::HomeDef::_get_base_home_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::HomeDef>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::HomeDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+
+ _get_base_home_HomeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_base_home_HomeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_base_home_HomeDef (
+ POA_CORBA::ComponentIR::HomeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::HomeDef>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ComponentIR::HomeDef> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->base_home (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::HomeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::HomeDef::_set_base_home_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ComponentIR::HomeDef>::in_arg_val _tao_base_home;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_base_home
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::HomeDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+
+ _set_base_home_HomeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_supported_interfaces_HomeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_supported_interfaces_HomeDef (
+ POA_CORBA::ComponentIR::HomeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::InterfaceDefSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->supported_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::HomeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::HomeDef::_get_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::HomeDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+
+ _get_supported_interfaces_HomeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_supported_interfaces_HomeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_supported_interfaces_HomeDef (
+ POA_CORBA::ComponentIR::HomeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InterfaceDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->supported_interfaces (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::HomeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::HomeDef::_set_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_val _tao_supported_interfaces;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_supported_interfaces
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::HomeDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+
+ _set_supported_interfaces_HomeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_managed_component_HomeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_managed_component_HomeDef (
+ POA_CORBA::ComponentIR::HomeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ComponentDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ComponentIR::ComponentDef> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->managed_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::HomeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::HomeDef::_get_managed_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ComponentDef>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::HomeDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+
+ _get_managed_component_HomeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_managed_component_HomeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_managed_component_HomeDef (
+ POA_CORBA::ComponentIR::HomeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ComponentDef>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ComponentIR::ComponentDef> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->managed_component (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::HomeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::HomeDef::_set_managed_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ComponentIR::ComponentDef>::in_arg_val _tao_managed_component;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_managed_component
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::HomeDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+
+ _set_managed_component_HomeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_primary_key_HomeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_primary_key_HomeDef (
+ POA_CORBA::ComponentIR::HomeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ValueDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ValueDef> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->primary_key (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::HomeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::HomeDef::_get_primary_key_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ValueDef>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::HomeDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+
+ _get_primary_key_HomeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_primary_key_HomeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_primary_key_HomeDef (
+ POA_CORBA::ComponentIR::HomeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ValueDef>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ValueDef> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->primary_key (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::HomeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::HomeDef::_set_primary_key_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ValueDef>::in_arg_val _tao_primary_key;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_primary_key
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::HomeDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+
+ _set_primary_key_HomeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_factory_HomeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_factory_HomeDef (
+ POA_CORBA::ComponentIR::HomeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::FactoryDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ComponentIR::FactoryDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::ParDescriptionSeq>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ParDescriptionSeq> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ExceptionDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ retval =
+ this->servant_->create_factory (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::HomeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::HomeDef::create_factory_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::FactoryDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::ParDescriptionSeq>::in_arg_val _tao_params;
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_val _tao_exceptions;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_params,
+ &_tao_exceptions
+ };
+
+ static size_t const nargs = 6;
+
+ POA_CORBA::ComponentIR::HomeDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+
+ create_factory_HomeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_finder_HomeDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_finder_HomeDef (
+ POA_CORBA::ComponentIR::HomeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ComponentIR::FinderDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ComponentIR::FinderDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::ParDescriptionSeq>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ParDescriptionSeq> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ExceptionDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ retval =
+ this->servant_->create_finder (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::HomeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ComponentIR::HomeDef::create_finder_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ComponentIR::FinderDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::ParDescriptionSeq>::in_arg_val _tao_params;
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_val _tao_exceptions;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_params,
+ &_tao_exceptions
+ };
+
+ static size_t const nargs = 6;
+
+ POA_CORBA::ComponentIR::HomeDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+
+ create_finder_HomeDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_HomeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_HomeDef_Upcall_Command (
+ POA_CORBA::ComponentIR::HomeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::HomeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::HomeDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ComponentIR::HomeDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+
+ _is_a_HomeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_HomeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_HomeDef_Upcall_Command (
+ POA_CORBA::ComponentIR::HomeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::HomeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::HomeDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::HomeDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+
+ _non_existent_HomeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_HomeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_HomeDef_Upcall_Command (
+ POA_CORBA::ComponentIR::HomeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::HomeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::HomeDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::HomeDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+
+ _repository_id_HomeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ComponentIR::HomeDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ComponentIR::HomeDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_HomeDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_HomeDef_Upcall_Command (
+ POA_CORBA::ComponentIR::HomeDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ComponentIR::HomeDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+ }
+
+}
+
+
+void POA_CORBA::ComponentIR::HomeDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ComponentIR::HomeDef * const impl =
+ static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+
+ _get_component_HomeDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ComponentIR::HomeDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/InterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/InterfaceAttrExtension:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ExtInterfaceDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ComponentIR/HomeDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ComponentIR::HomeDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ComponentIR/HomeDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ComponentIR::HomeDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ComponentIR::HomeDef *
+POA_CORBA::ComponentIR::HomeDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ComponentIR::HomeDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA_ComponentIR__TAO_HomeDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+
+#endif /* ifndef */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS.h b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS.h
new file mode 100644
index 00000000000..096de121f5f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS.h
@@ -0,0 +1,5119 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:409
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_COMPONENTSS_H_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_COMPONENTSS_H_
+
+#include /**/ "ace/pre.h"
+
+#include "tao/IFR_Client/IFR_ComponentsC.h"
+#include "orbsvcs/IFRService/IFR_ExtendedS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Collocation_Proxy_Broker.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/PortableServer/Servant_Base.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_module/module_sh.cpp:49
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_module/module_sh.cpp:49
+
+ namespace ComponentIR
+ {
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class EventDef;
+ typedef EventDef *EventDef_ptr;
+
+ class EventDef
+ : public virtual POA_CORBA::ExtValueDef
+ {
+ protected:
+ EventDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ComponentIR::EventDef _stub_type;
+ typedef ::CORBA::ComponentIR::EventDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ComponentIR::EventDef_var _stub_var_type;
+
+ EventDef (const EventDef& rhs);
+ virtual ~EventDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ComponentIR::EventDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_base_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_base_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_abstract_base_values_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_abstract_base_values_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_is_abstract_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_is_abstract_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_is_custom_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_is_custom_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_is_truncatable_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_is_truncatable_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_member_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_ext_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_ext_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class Container;
+ typedef Container *Container_ptr;
+
+ class Container
+ : public virtual POA_CORBA::Container
+ {
+ protected:
+ Container (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ComponentIR::Container _stub_type;
+ typedef ::CORBA::ComponentIR::Container_ptr _stub_ptr_type;
+ typedef ::CORBA::ComponentIR::Container_var _stub_var_type;
+
+ Container (const Container& rhs);
+ virtual ~Container (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ComponentIR::Container *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ComponentIR::ComponentDef_ptr create_component (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::ComponentDef_ptr base_component,
+ const ::CORBA::InterfaceDefSeq & supports_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_component_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ComponentIR::HomeDef_ptr create_home (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::HomeDef_ptr base_home,
+ ::CORBA::ComponentIR::ComponentDef_ptr managed_component,
+ const ::CORBA::InterfaceDefSeq & supports_interfaces,
+ ::CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_home_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ComponentIR::EventDef_ptr create_event (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ModuleDef;
+ typedef ModuleDef *ModuleDef_ptr;
+
+ class ModuleDef
+ : public virtual POA_CORBA::ModuleDef,
+ public virtual POA_CORBA::ComponentIR::Container
+ {
+ protected:
+ ModuleDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ComponentIR::ModuleDef _stub_type;
+ typedef ::CORBA::ComponentIR::ModuleDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ComponentIR::ModuleDef_var _stub_var_type;
+
+ ModuleDef (const ModuleDef& rhs);
+ virtual ~ModuleDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ComponentIR::ModuleDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_component_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_home_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class Repository;
+ typedef Repository *Repository_ptr;
+
+ class Repository
+ : public virtual POA_CORBA::Repository,
+ public virtual POA_CORBA::ComponentIR::Container
+ {
+ protected:
+ Repository (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ComponentIR::Repository _stub_type;
+ typedef ::CORBA::ComponentIR::Repository_ptr _stub_ptr_type;
+ typedef ::CORBA::ComponentIR::Repository_var _stub_var_type;
+
+ Repository (const Repository& rhs);
+ virtual ~Repository (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ComponentIR::Repository *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ get_canonical_typecode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ get_primitive_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_string_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_wstring_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_sequence_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_array_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_fixed_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_component_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_home_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ProvidesDef;
+ typedef ProvidesDef *ProvidesDef_ptr;
+
+ class ProvidesDef
+ : public virtual POA_CORBA::Contained
+ {
+ protected:
+ ProvidesDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ComponentIR::ProvidesDef _stub_type;
+ typedef ::CORBA::ComponentIR::ProvidesDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ComponentIR::ProvidesDef_var _stub_var_type;
+
+ ProvidesDef (const ProvidesDef& rhs);
+ virtual ~ProvidesDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ComponentIR::ProvidesDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::InterfaceDef_ptr interface_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_interface_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void interface_type (
+ ::CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_interface_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class UsesDef;
+ typedef UsesDef *UsesDef_ptr;
+
+ class UsesDef
+ : public virtual POA_CORBA::Contained
+ {
+ protected:
+ UsesDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ComponentIR::UsesDef _stub_type;
+ typedef ::CORBA::ComponentIR::UsesDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ComponentIR::UsesDef_var _stub_var_type;
+
+ UsesDef (const UsesDef& rhs);
+ virtual ~UsesDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ComponentIR::UsesDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::InterfaceDef_ptr interface_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_interface_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void interface_type (
+ ::CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_interface_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Boolean is_multiple (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_is_multiple_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void is_multiple (
+ ::CORBA::Boolean is_multiple
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_is_multiple_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class EventPortDef;
+ typedef EventPortDef *EventPortDef_ptr;
+
+ class EventPortDef
+ : public virtual POA_CORBA::Contained
+ {
+ protected:
+ EventPortDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ComponentIR::EventPortDef _stub_type;
+ typedef ::CORBA::ComponentIR::EventPortDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ComponentIR::EventPortDef_var _stub_var_type;
+
+ EventPortDef (const EventPortDef& rhs);
+ virtual ~EventPortDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ComponentIR::EventPortDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ComponentIR::EventDef_ptr event (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void event (
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Boolean is_a (
+ const char * event_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class EmitsDef;
+ typedef EmitsDef *EmitsDef_ptr;
+
+ class EmitsDef
+ : public virtual POA_CORBA::ComponentIR::EventPortDef
+ {
+ protected:
+ EmitsDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ComponentIR::EmitsDef _stub_type;
+ typedef ::CORBA::ComponentIR::EmitsDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ComponentIR::EmitsDef_var _stub_var_type;
+
+ EmitsDef (const EmitsDef& rhs);
+ virtual ~EmitsDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ComponentIR::EmitsDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class PublishesDef;
+ typedef PublishesDef *PublishesDef_ptr;
+
+ class PublishesDef
+ : public virtual POA_CORBA::ComponentIR::EventPortDef
+ {
+ protected:
+ PublishesDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ComponentIR::PublishesDef _stub_type;
+ typedef ::CORBA::ComponentIR::PublishesDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ComponentIR::PublishesDef_var _stub_var_type;
+
+ PublishesDef (const PublishesDef& rhs);
+ virtual ~PublishesDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ComponentIR::PublishesDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ConsumesDef;
+ typedef ConsumesDef *ConsumesDef_ptr;
+
+ class ConsumesDef
+ : public virtual POA_CORBA::ComponentIR::EventPortDef
+ {
+ protected:
+ ConsumesDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ComponentIR::ConsumesDef _stub_type;
+ typedef ::CORBA::ComponentIR::ConsumesDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ComponentIR::ConsumesDef_var _stub_var_type;
+
+ ConsumesDef (const ConsumesDef& rhs);
+ virtual ~ConsumesDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ComponentIR::ConsumesDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ComponentDef;
+ typedef ComponentDef *ComponentDef_ptr;
+
+ class ComponentDef
+ : public virtual POA_CORBA::ExtInterfaceDef
+ {
+ protected:
+ ComponentDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ComponentIR::ComponentDef _stub_type;
+ typedef ::CORBA::ComponentIR::ComponentDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ComponentIR::ComponentDef_var _stub_var_type;
+
+ ComponentDef (const ComponentDef& rhs);
+ virtual ~ComponentDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ComponentIR::ComponentDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ComponentIR::ComponentDef_ptr base_component (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_base_component_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void base_component (
+ ::CORBA::ComponentIR::ComponentDef_ptr base_component
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_base_component_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::InterfaceDefSeq * supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void supported_interfaces (
+ const ::CORBA::InterfaceDefSeq & supported_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ComponentIR::ProvidesDef_ptr create_provides (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_provides_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ComponentIR::UsesDef_ptr create_uses (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::InterfaceDef_ptr interface_type,
+ ::CORBA::Boolean is_multiple
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_uses_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ComponentIR::EmitsDef_ptr create_emits (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_emits_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ComponentIR::PublishesDef_ptr create_publishes (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_publishes_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ComponentIR::ConsumesDef_ptr create_consumes (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_consumes_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_ext_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class FactoryDef;
+ typedef FactoryDef *FactoryDef_ptr;
+
+ class FactoryDef
+ : public virtual POA_CORBA::OperationDef
+ {
+ protected:
+ FactoryDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ComponentIR::FactoryDef _stub_type;
+ typedef ::CORBA::ComponentIR::FactoryDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ComponentIR::FactoryDef_var _stub_var_type;
+
+ FactoryDef (const FactoryDef& rhs);
+ virtual ~FactoryDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ComponentIR::FactoryDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_result_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_result_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_result_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_params_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_params_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_contexts_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_contexts_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class FinderDef;
+ typedef FinderDef *FinderDef_ptr;
+
+ class FinderDef
+ : public virtual POA_CORBA::OperationDef
+ {
+ protected:
+ FinderDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ComponentIR::FinderDef _stub_type;
+ typedef ::CORBA::ComponentIR::FinderDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ComponentIR::FinderDef_var _stub_var_type;
+
+ FinderDef (const FinderDef& rhs);
+ virtual ~FinderDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ComponentIR::FinderDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_result_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_result_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_result_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_params_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_params_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_contexts_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_contexts_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class HomeDef;
+ typedef HomeDef *HomeDef_ptr;
+
+ class HomeDef
+ : public virtual POA_CORBA::ExtInterfaceDef
+ {
+ protected:
+ HomeDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ComponentIR::HomeDef _stub_type;
+ typedef ::CORBA::ComponentIR::HomeDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ComponentIR::HomeDef_var _stub_var_type;
+
+ HomeDef (const HomeDef& rhs);
+ virtual ~HomeDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ComponentIR::HomeDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ComponentIR::HomeDef_ptr base_home (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_base_home_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void base_home (
+ ::CORBA::ComponentIR::HomeDef_ptr base_home
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_base_home_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::InterfaceDefSeq * supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void supported_interfaces (
+ const ::CORBA::InterfaceDefSeq & supported_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ComponentIR::ComponentDef_ptr managed_component (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_managed_component_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void managed_component (
+ ::CORBA::ComponentIR::ComponentDef_ptr managed_component
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_managed_component_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ValueDef_ptr primary_key (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_primary_key_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void primary_key (
+ ::CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_primary_key_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ComponentIR::FactoryDef_ptr create_factory (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_factory_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ComponentIR::FinderDef_ptr create_finder (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_finder_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_ext_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_module/module_sh.cpp:80
+
+ } // module CORBA::ComponentIR
+
+// TAO_IDL - Generated from
+// be\be_visitor_module/module_sh.cpp:80
+
+} // module CORBA
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:1219
+
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include "IFR_ComponentsS_T.h"
+
+#if defined (__ACE_INLINE__)
+#include "IFR_ComponentsS.inl"
+#endif /* defined INLINE */
+
+#include /**/ "ace/post.h"
+#endif /* ifndef */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS.inl b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS.inl
new file mode 100644
index 00000000000..86e5fd82676
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS.inl
@@ -0,0 +1,6972 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::_get_supported_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_set_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::_set_supported_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::_get_initializers_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_set_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::_set_initializers_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_base_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::_get_base_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_set_base_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::_set_base_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_abstract_base_values_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::_get_abstract_base_values_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_set_abstract_base_values_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::_set_abstract_base_values_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_is_abstract_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::_get_is_abstract_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_set_is_abstract_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::_set_is_abstract_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_is_custom_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::_get_is_custom_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_set_is_custom_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::_set_is_custom_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_is_truncatable_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::_get_is_truncatable_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_set_is_truncatable_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::_set_is_truncatable_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::is_a_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::describe_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::describe_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_value_member_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::create_value_member_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::create_attribute_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ValueDef::create_operation_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_get_ext_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ExtValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ExtValueDef::_get_ext_initializers_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::_set_ext_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ExtValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ExtValueDef::_set_ext_initializers_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::describe_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ExtValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ExtValueDef::describe_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventDef::create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ExtValueDef * const impl = static_cast<POA_CORBA::ComponentIR::EventDef *> (servant);
+ POA_CORBA::ExtValueDef::create_ext_attribute_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Container::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Container *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_component_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ComponentIR::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::ComponentIR::Container::create_component_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_home_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ComponentIR::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::ComponentIR::Container::create_home_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ModuleDef::create_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ComponentIR::Container * const impl = static_cast<POA_CORBA::ComponentIR::ModuleDef *> (servant);
+ POA_CORBA::ComponentIR::Container::create_event_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::lookup_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Repository * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Repository::lookup_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::get_canonical_typecode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Repository * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Repository::get_canonical_typecode_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::get_primitive_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Repository * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Repository::get_primitive_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_string_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Repository * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Repository::create_string_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_wstring_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Repository * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Repository::create_wstring_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_sequence_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Repository * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Repository::create_sequence_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_array_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Repository * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Repository::create_array_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_fixed_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Repository * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::Repository::create_fixed_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_component_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ComponentIR::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::ComponentIR::Container::create_component_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_home_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ComponentIR::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::ComponentIR::Container::create_home_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::Repository::create_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ComponentIR::Container * const impl = static_cast<POA_CORBA::ComponentIR::Repository *> (servant);
+ POA_CORBA::ComponentIR::Container::create_event_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ProvidesDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ProvidesDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ProvidesDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ProvidesDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ProvidesDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ProvidesDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ProvidesDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ProvidesDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ProvidesDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ProvidesDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ProvidesDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ProvidesDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ProvidesDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ProvidesDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::UsesDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::UsesDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::UsesDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::UsesDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::UsesDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::UsesDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::UsesDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::UsesDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::UsesDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::UsesDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::UsesDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::UsesDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::UsesDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::UsesDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventPortDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventPortDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventPortDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventPortDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventPortDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventPortDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventPortDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventPortDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventPortDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventPortDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventPortDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventPortDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EventPortDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EventPortDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::_get_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ComponentIR::EventPortDef * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::ComponentIR::EventPortDef::_get_event_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::_set_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ComponentIR::EventPortDef * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::ComponentIR::EventPortDef::_set_event_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::EmitsDef::is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ComponentIR::EventPortDef * const impl = static_cast<POA_CORBA::ComponentIR::EmitsDef *> (servant);
+ POA_CORBA::ComponentIR::EventPortDef::is_a_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::_get_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ComponentIR::EventPortDef * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::ComponentIR::EventPortDef::_get_event_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::_set_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ComponentIR::EventPortDef * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::ComponentIR::EventPortDef::_set_event_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::PublishesDef::is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ComponentIR::EventPortDef * const impl = static_cast<POA_CORBA::ComponentIR::PublishesDef *> (servant);
+ POA_CORBA::ComponentIR::EventPortDef::is_a_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::_get_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ComponentIR::EventPortDef * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::ComponentIR::EventPortDef::_get_event_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::_set_event_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ComponentIR::EventPortDef * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::ComponentIR::EventPortDef::_set_event_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ConsumesDef::is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ComponentIR::EventPortDef * const impl = static_cast<POA_CORBA::ComponentIR::ConsumesDef *> (servant);
+ POA_CORBA::ComponentIR::EventPortDef::is_a_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::_get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::InterfaceDef::_get_base_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::_set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::InterfaceDef::_set_base_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::InterfaceDef::is_a_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::InterfaceDef::describe_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::InterfaceDef::create_attribute_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::InterfaceDef::create_operation_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::describe_ext_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceAttrExtension * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::InterfaceAttrExtension::describe_ext_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::ComponentDef::create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceAttrExtension * const impl = static_cast<POA_CORBA::ComponentIR::ComponentDef *> (servant);
+ POA_CORBA::InterfaceAttrExtension::create_ext_attribute_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_get_result_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::OperationDef::_get_result_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_get_result_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::OperationDef::_get_result_def_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_set_result_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::OperationDef::_set_result_def_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_get_params_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::OperationDef::_get_params_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_set_params_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::OperationDef::_set_params_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_get_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::OperationDef::_get_mode_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_set_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::OperationDef::_set_mode_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_get_contexts_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::OperationDef::_get_contexts_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_set_contexts_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::OperationDef::_set_contexts_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_get_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::OperationDef::_get_exceptions_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FactoryDef::_set_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FactoryDef *> (servant);
+ POA_CORBA::OperationDef::_set_exceptions_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_get_result_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::OperationDef::_get_result_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_get_result_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::OperationDef::_get_result_def_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_set_result_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::OperationDef::_set_result_def_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_get_params_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::OperationDef::_get_params_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_set_params_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::OperationDef::_set_params_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_get_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::OperationDef::_get_mode_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_set_mode_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::OperationDef::_set_mode_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_get_contexts_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::OperationDef::_get_contexts_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_set_contexts_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::OperationDef::_set_contexts_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_get_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::OperationDef::_get_exceptions_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::FinderDef::_set_exceptions_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::OperationDef * const impl = static_cast<POA_CORBA::ComponentIR::FinderDef *> (servant);
+ POA_CORBA::OperationDef::_set_exceptions_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::_get_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::InterfaceDef::_get_base_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::_set_base_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::InterfaceDef::_set_base_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::InterfaceDef::is_a_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::describe_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::InterfaceDef::describe_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::InterfaceDef::create_attribute_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceDef * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::InterfaceDef::create_operation_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::describe_ext_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceAttrExtension * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::InterfaceAttrExtension::describe_ext_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ComponentIR::HomeDef::create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::InterfaceAttrExtension * const impl = static_cast<POA_CORBA::ComponentIR::HomeDef *> (servant);
+ POA_CORBA::InterfaceAttrExtension::create_ext_attribute_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS_T.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS_T.cpp
new file mode 100644
index 00000000000..1944c42347d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS_T.cpp
@@ -0,0 +1,49 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:683
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_COMPONENTSS_T_CPP_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_COMPONENTSS_T_CPP_
+
+#include "IFR_ComponentsS_T.h"
+
+#if !defined (__ACE_INLINE__)
+#include "IFR_ComponentsS_T.inl"
+#endif /* !defined INLINE */
+
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#endif /* ifndef */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS_T.h b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS_T.h
new file mode 100644
index 00000000000..0ab0e5470dc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS_T.h
@@ -0,0 +1,5387 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:545
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_COMPONENTSS_T_H_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_COMPONENTSS_T_H_
+
+#include /**/ "ace/pre.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_root/root_sth.cpp:116
+
+namespace POA_CORBA
+{
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_root/root_sth.cpp:116
+
+ namespace ComponentIR
+ {
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class EventDef_tie : public EventDef
+ {
+ public:
+ /// the T& ctor
+ EventDef_tie (T &t);
+ /// ctor taking a POA
+ EventDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ EventDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ EventDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~EventDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDefSeq * supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void supported_interfaces (
+ const ::CORBA::InterfaceDefSeq & supported_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InitializerSeq * initializers (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void initializers (
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr base_value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void base_value (
+ ::CORBA::ValueDef_ptr base_value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDefSeq * abstract_base_values (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void abstract_base_values (
+ const ::CORBA::ValueDefSeq & abstract_base_values
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_abstract (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void is_abstract (
+ ::CORBA::Boolean is_abstract
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_custom (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void is_custom (
+ ::CORBA::Boolean is_custom
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_truncatable (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void is_truncatable (
+ ::CORBA::Boolean is_truncatable
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_a (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef::FullValueDescription * describe_value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueMemberDef_ptr create_value_member (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::Visibility access
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AttributeDef_ptr create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::OperationDef_ptr create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtInitializerSeq * ext_initializers (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void ext_initializers (
+ const ::CORBA::ExtInitializerSeq & ext_initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef::ExtFullValueDescription * describe_ext_value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtAttributeDef_ptr create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ EventDef_tie (const EventDef_tie &);
+ void operator= (const EventDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class Container_tie : public Container
+ {
+ public:
+ /// the T& ctor
+ Container_tie (T &t);
+ /// ctor taking a POA
+ Container_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ Container_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ Container_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~Container_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::ComponentDef_ptr create_component (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::ComponentDef_ptr base_component,
+ const ::CORBA::InterfaceDefSeq & supports_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::HomeDef_ptr create_home (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::HomeDef_ptr base_home,
+ ::CORBA::ComponentIR::ComponentDef_ptr managed_component,
+ const ::CORBA::InterfaceDefSeq & supports_interfaces,
+ ::CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::EventDef_ptr create_event (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ Container_tie (const Container_tie &);
+ void operator= (const Container_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ModuleDef_tie : public ModuleDef
+ {
+ public:
+ /// the T& ctor
+ ModuleDef_tie (T &t);
+ /// ctor taking a POA
+ ModuleDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ModuleDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ModuleDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ModuleDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::ComponentDef_ptr create_component (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::ComponentDef_ptr base_component,
+ const ::CORBA::InterfaceDefSeq & supports_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::HomeDef_ptr create_home (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::HomeDef_ptr base_home,
+ ::CORBA::ComponentIR::ComponentDef_ptr managed_component,
+ const ::CORBA::InterfaceDefSeq & supports_interfaces,
+ ::CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::EventDef_ptr create_event (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ModuleDef_tie (const ModuleDef_tie &);
+ void operator= (const ModuleDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class Repository_tie : public Repository
+ {
+ public:
+ /// the T& ctor
+ Repository_tie (T &t);
+ /// ctor taking a POA
+ Repository_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ Repository_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ Repository_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~Repository_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup_id (
+ const char * search_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr get_canonical_typecode (
+ ::CORBA::TypeCode_ptr tc
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::PrimitiveDef_ptr get_primitive (
+ ::CORBA::PrimitiveKind kind
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StringDef_ptr create_string (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::WstringDef_ptr create_wstring (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::SequenceDef_ptr create_sequence (
+ ::CORBA::ULong bound,
+ ::CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ArrayDef_ptr create_array (
+ ::CORBA::ULong length,
+ ::CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::FixedDef_ptr create_fixed (
+ ::CORBA::UShort digits,
+ ::CORBA::Short scale
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::ComponentDef_ptr create_component (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::ComponentDef_ptr base_component,
+ const ::CORBA::InterfaceDefSeq & supports_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::HomeDef_ptr create_home (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::HomeDef_ptr base_home,
+ ::CORBA::ComponentIR::ComponentDef_ptr managed_component,
+ const ::CORBA::InterfaceDefSeq & supports_interfaces,
+ ::CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::EventDef_ptr create_event (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ Repository_tie (const Repository_tie &);
+ void operator= (const Repository_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ProvidesDef_tie : public ProvidesDef
+ {
+ public:
+ /// the T& ctor
+ ProvidesDef_tie (T &t);
+ /// ctor taking a POA
+ ProvidesDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ProvidesDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ProvidesDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ProvidesDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr interface_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void interface_type (
+ ::CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ProvidesDef_tie (const ProvidesDef_tie &);
+ void operator= (const ProvidesDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class UsesDef_tie : public UsesDef
+ {
+ public:
+ /// the T& ctor
+ UsesDef_tie (T &t);
+ /// ctor taking a POA
+ UsesDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ UsesDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ UsesDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~UsesDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr interface_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void interface_type (
+ ::CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_multiple (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void is_multiple (
+ ::CORBA::Boolean is_multiple
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ UsesDef_tie (const UsesDef_tie &);
+ void operator= (const UsesDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class EventPortDef_tie : public EventPortDef
+ {
+ public:
+ /// the T& ctor
+ EventPortDef_tie (T &t);
+ /// ctor taking a POA
+ EventPortDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ EventPortDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ EventPortDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~EventPortDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::EventDef_ptr event (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void event (
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_a (
+ const char * event_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ EventPortDef_tie (const EventPortDef_tie &);
+ void operator= (const EventPortDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class EmitsDef_tie : public EmitsDef
+ {
+ public:
+ /// the T& ctor
+ EmitsDef_tie (T &t);
+ /// ctor taking a POA
+ EmitsDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ EmitsDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ EmitsDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~EmitsDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::EventDef_ptr event (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void event (
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_a (
+ const char * event_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ EmitsDef_tie (const EmitsDef_tie &);
+ void operator= (const EmitsDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class PublishesDef_tie : public PublishesDef
+ {
+ public:
+ /// the T& ctor
+ PublishesDef_tie (T &t);
+ /// ctor taking a POA
+ PublishesDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ PublishesDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ PublishesDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~PublishesDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::EventDef_ptr event (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void event (
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_a (
+ const char * event_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ PublishesDef_tie (const PublishesDef_tie &);
+ void operator= (const PublishesDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ConsumesDef_tie : public ConsumesDef
+ {
+ public:
+ /// the T& ctor
+ ConsumesDef_tie (T &t);
+ /// ctor taking a POA
+ ConsumesDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ConsumesDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ConsumesDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ConsumesDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::EventDef_ptr event (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void event (
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_a (
+ const char * event_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ConsumesDef_tie (const ConsumesDef_tie &);
+ void operator= (const ConsumesDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ComponentDef_tie : public ComponentDef
+ {
+ public:
+ /// the T& ctor
+ ComponentDef_tie (T &t);
+ /// ctor taking a POA
+ ComponentDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ComponentDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ComponentDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ComponentDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDefSeq * base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef::FullInterfaceDescription * describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AttributeDef_ptr create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::OperationDef_ptr create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription * describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtAttributeDef_ptr create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::ComponentDef_ptr base_component (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void base_component (
+ ::CORBA::ComponentIR::ComponentDef_ptr base_component
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDefSeq * supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void supported_interfaces (
+ const ::CORBA::InterfaceDefSeq & supported_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::ProvidesDef_ptr create_provides (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::UsesDef_ptr create_uses (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::InterfaceDef_ptr interface_type,
+ ::CORBA::Boolean is_multiple
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::EmitsDef_ptr create_emits (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::PublishesDef_ptr create_publishes (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::ConsumesDef_ptr create_consumes (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ComponentDef_tie (const ComponentDef_tie &);
+ void operator= (const ComponentDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class FactoryDef_tie : public FactoryDef
+ {
+ public:
+ /// the T& ctor
+ FactoryDef_tie (T &t);
+ /// ctor taking a POA
+ FactoryDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ FactoryDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ FactoryDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~FactoryDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr result (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::IDLType_ptr result_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void result_def (
+ ::CORBA::IDLType_ptr result_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ParDescriptionSeq * params (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void params (
+ const ::CORBA::ParDescriptionSeq & params
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::OperationMode mode (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void mode (
+ ::CORBA::OperationMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContextIdSeq * contexts (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void contexts (
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDefSeq * exceptions (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void exceptions (
+ const ::CORBA::ExceptionDefSeq & exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ FactoryDef_tie (const FactoryDef_tie &);
+ void operator= (const FactoryDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class FinderDef_tie : public FinderDef
+ {
+ public:
+ /// the T& ctor
+ FinderDef_tie (T &t);
+ /// ctor taking a POA
+ FinderDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ FinderDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ FinderDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~FinderDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr result (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::IDLType_ptr result_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void result_def (
+ ::CORBA::IDLType_ptr result_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ParDescriptionSeq * params (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void params (
+ const ::CORBA::ParDescriptionSeq & params
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::OperationMode mode (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void mode (
+ ::CORBA::OperationMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContextIdSeq * contexts (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void contexts (
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDefSeq * exceptions (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void exceptions (
+ const ::CORBA::ExceptionDefSeq & exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ FinderDef_tie (const FinderDef_tie &);
+ void operator= (const FinderDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class HomeDef_tie : public HomeDef
+ {
+ public:
+ /// the T& ctor
+ HomeDef_tie (T &t);
+ /// ctor taking a POA
+ HomeDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ HomeDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ HomeDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~HomeDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDefSeq * base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef::FullInterfaceDescription * describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AttributeDef_ptr create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::OperationDef_ptr create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription * describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtAttributeDef_ptr create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::HomeDef_ptr base_home (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void base_home (
+ ::CORBA::ComponentIR::HomeDef_ptr base_home
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDefSeq * supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void supported_interfaces (
+ const ::CORBA::InterfaceDefSeq & supported_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::ComponentDef_ptr managed_component (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void managed_component (
+ ::CORBA::ComponentIR::ComponentDef_ptr managed_component
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr primary_key (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void primary_key (
+ ::CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::FactoryDef_ptr create_factory (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ComponentIR::FinderDef_ptr create_finder (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ HomeDef_tie (const HomeDef_tie &);
+ void operator= (const HomeDef_tie &);
+ };
+ } // module CORBA::ComponentIR
+} // module CORBA
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:1322
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "IFR_ComponentsS_T.inl"
+#endif /* defined INLINE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "IFR_ComponentsS_T.cpp"
+#endif /* defined REQUIRED SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("IFR_ComponentsS_T.cpp")
+#endif /* defined REQUIRED PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* ifndef */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS_T.inl b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS_T.inl
new file mode 100644
index 00000000000..eae67ae179d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ComponentsS_T.inl
@@ -0,0 +1,9019 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::EventDef_tie<T>::EventDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::EventDef_tie<T>::EventDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::EventDef_tie<T>::EventDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::EventDef_tie<T>::EventDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::EventDef_tie<T>::~EventDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ComponentIR::EventDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::EventDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::EventDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ComponentIR::EventDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::EventDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ComponentIR::EventDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->EventDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ComponentIR::EventDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ComponentIR::EventDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ComponentIR::EventDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::ComponentIR::EventDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::EventDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::EventDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::EventDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::EventDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ComponentIR::EventDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDefSeq * POA_CORBA::ComponentIR::EventDef_tie<T>::supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->supported_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventDef_tie<T>::supported_interfaces (
+ const ::CORBA::InterfaceDefSeq & supported_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->supported_interfaces (
+ supported_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InitializerSeq * POA_CORBA::ComponentIR::EventDef_tie<T>::initializers (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->initializers (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventDef_tie<T>::initializers (
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->initializers (
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::base_value (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->base_value (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventDef_tie<T>::base_value (
+ ::CORBA::ValueDef_ptr base_value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->base_value (
+ base_value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDefSeq * POA_CORBA::ComponentIR::EventDef_tie<T>::abstract_base_values (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->abstract_base_values (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventDef_tie<T>::abstract_base_values (
+ const ::CORBA::ValueDefSeq & abstract_base_values
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->abstract_base_values (
+ abstract_base_values
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ComponentIR::EventDef_tie<T>::is_abstract (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_abstract (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventDef_tie<T>::is_abstract (
+ ::CORBA::Boolean is_abstract
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->is_abstract (
+ is_abstract
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ComponentIR::EventDef_tie<T>::is_custom (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_custom (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventDef_tie<T>::is_custom (
+ ::CORBA::Boolean is_custom
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->is_custom (
+ is_custom
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ComponentIR::EventDef_tie<T>::is_truncatable (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_truncatable (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventDef_tie<T>::is_truncatable (
+ ::CORBA::Boolean is_truncatable
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->is_truncatable (
+ is_truncatable
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ComponentIR::EventDef_tie<T>::is_a (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_a (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef::FullValueDescription * POA_CORBA::ComponentIR::EventDef_tie<T>::describe_value (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_value (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueMemberDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_value_member (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::Visibility access
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_member (
+ id,
+ name,
+ version,
+ type,
+ access
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AttributeDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::OperationDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_operation (
+ id,
+ name,
+ version,
+ result,
+ mode,
+ params,
+ exceptions,
+ contexts
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtInitializerSeq * POA_CORBA::ComponentIR::EventDef_tie<T>::ext_initializers (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->ext_initializers (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventDef_tie<T>::ext_initializers (
+ const ::CORBA::ExtInitializerSeq & ext_initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->ext_initializers (
+ ext_initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef::ExtFullValueDescription * POA_CORBA::ComponentIR::EventDef_tie<T>::describe_ext_value (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_ext_value (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtAttributeDef_ptr POA_CORBA::ComponentIR::EventDef_tie<T>::create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode,
+ get_exceptions,
+ set_exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::Container_tie<T>::Container_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::Container_tie<T>::Container_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::Container_tie<T>::Container_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::Container_tie<T>::Container_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::Container_tie<T>::~Container_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ComponentIR::Container_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::Container_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::Container_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ComponentIR::Container_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::Container_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ComponentIR::Container_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->Container::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ComponentIR::Container_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::Container_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::ComponentIR::Container_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ComponentIR::Container_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ComponentIR::Container_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::ComponentIR::Container_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::ComponentDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_component (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::ComponentDef_ptr base_component,
+ const ::CORBA::InterfaceDefSeq & supports_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_component (
+ id,
+ name,
+ version,
+ base_component,
+ supports_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::HomeDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_home (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::HomeDef_ptr base_home,
+ ::CORBA::ComponentIR::ComponentDef_ptr managed_component,
+ const ::CORBA::InterfaceDefSeq & supports_interfaces,
+ ::CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_home (
+ id,
+ name,
+ version,
+ base_home,
+ managed_component,
+ supports_interfaces,
+ primary_key
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::EventDef_ptr POA_CORBA::ComponentIR::Container_tie<T>::create_event (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_event (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ModuleDef_tie<T>::ModuleDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ModuleDef_tie<T>::ModuleDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ModuleDef_tie<T>::ModuleDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ModuleDef_tie<T>::ModuleDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ModuleDef_tie<T>::~ModuleDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ComponentIR::ModuleDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::ModuleDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::ModuleDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ComponentIR::ModuleDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::ModuleDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ComponentIR::ModuleDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ModuleDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ComponentIR::ModuleDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ModuleDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ComponentIR::ModuleDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ComponentIR::ModuleDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::ComponentIR::ModuleDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ModuleDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ModuleDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ModuleDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ModuleDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ModuleDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ModuleDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ModuleDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ComponentIR::ModuleDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ModuleDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::ComponentDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_component (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::ComponentDef_ptr base_component,
+ const ::CORBA::InterfaceDefSeq & supports_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_component (
+ id,
+ name,
+ version,
+ base_component,
+ supports_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::HomeDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_home (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::HomeDef_ptr base_home,
+ ::CORBA::ComponentIR::ComponentDef_ptr managed_component,
+ const ::CORBA::InterfaceDefSeq & supports_interfaces,
+ ::CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_home (
+ id,
+ name,
+ version,
+ base_home,
+ managed_component,
+ supports_interfaces,
+ primary_key
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::EventDef_ptr POA_CORBA::ComponentIR::ModuleDef_tie<T>::create_event (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_event (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::Repository_tie<T>::Repository_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::Repository_tie<T>::Repository_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::Repository_tie<T>::Repository_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::Repository_tie<T>::Repository_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::Repository_tie<T>::~Repository_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ComponentIR::Repository_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::Repository_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::Repository_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ComponentIR::Repository_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::Repository_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ComponentIR::Repository_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->Repository::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ComponentIR::Repository_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::Repository_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::ComponentIR::Repository_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ComponentIR::Repository_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ComponentIR::Repository_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::ComponentIR::Repository_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::ComponentIR::Repository_tie<T>::lookup_id (
+ const char * search_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_id (
+ search_id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ComponentIR::Repository_tie<T>::get_canonical_typecode (
+ ::CORBA::TypeCode_ptr tc
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->get_canonical_typecode (
+ tc
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::PrimitiveDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::get_primitive (
+ ::CORBA::PrimitiveKind kind
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->get_primitive (
+ kind
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StringDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_string (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_string (
+ bound
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::WstringDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_wstring (
+ ::CORBA::ULong bound
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_wstring (
+ bound
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::SequenceDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_sequence (
+ ::CORBA::ULong bound,
+ ::CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_sequence (
+ bound,
+ element_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ArrayDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_array (
+ ::CORBA::ULong length,
+ ::CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_array (
+ length,
+ element_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::FixedDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_fixed (
+ ::CORBA::UShort digits,
+ ::CORBA::Short scale
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_fixed (
+ digits,
+ scale
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::ComponentDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_component (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::ComponentDef_ptr base_component,
+ const ::CORBA::InterfaceDefSeq & supports_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_component (
+ id,
+ name,
+ version,
+ base_component,
+ supports_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::HomeDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_home (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::HomeDef_ptr base_home,
+ ::CORBA::ComponentIR::ComponentDef_ptr managed_component,
+ const ::CORBA::InterfaceDefSeq & supports_interfaces,
+ ::CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_home (
+ id,
+ name,
+ version,
+ base_home,
+ managed_component,
+ supports_interfaces,
+ primary_key
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::EventDef_ptr POA_CORBA::ComponentIR::Repository_tie<T>::create_event (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_event (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ProvidesDef_tie<T>::ProvidesDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ProvidesDef_tie<T>::ProvidesDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ProvidesDef_tie<T>::ProvidesDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ProvidesDef_tie<T>::ProvidesDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ProvidesDef_tie<T>::~ProvidesDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ComponentIR::ProvidesDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::ProvidesDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::ProvidesDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ComponentIR::ProvidesDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::ProvidesDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ComponentIR::ProvidesDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ProvidesDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ComponentIR::ProvidesDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ProvidesDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ProvidesDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ProvidesDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ProvidesDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ProvidesDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ProvidesDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ProvidesDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ComponentIR::ProvidesDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ProvidesDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ComponentIR::ProvidesDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ComponentIR::ProvidesDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ProvidesDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::ComponentIR::ProvidesDef_tie<T>::interface_type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->interface_type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ProvidesDef_tie<T>::interface_type (
+ ::CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->interface_type (
+ interface_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::UsesDef_tie<T>::UsesDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::UsesDef_tie<T>::UsesDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::UsesDef_tie<T>::UsesDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::UsesDef_tie<T>::UsesDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::UsesDef_tie<T>::~UsesDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ComponentIR::UsesDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::UsesDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::UsesDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ComponentIR::UsesDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::UsesDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ComponentIR::UsesDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->UsesDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ComponentIR::UsesDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::UsesDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::UsesDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::UsesDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::UsesDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::UsesDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::UsesDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::UsesDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ComponentIR::UsesDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::UsesDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ComponentIR::UsesDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ComponentIR::UsesDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::UsesDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::ComponentIR::UsesDef_tie<T>::interface_type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->interface_type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::UsesDef_tie<T>::interface_type (
+ ::CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->interface_type (
+ interface_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ComponentIR::UsesDef_tie<T>::is_multiple (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_multiple (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::UsesDef_tie<T>::is_multiple (
+ ::CORBA::Boolean is_multiple
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->is_multiple (
+ is_multiple
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::EventPortDef_tie<T>::EventPortDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::EventPortDef_tie<T>::EventPortDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::EventPortDef_tie<T>::EventPortDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::EventPortDef_tie<T>::EventPortDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::EventPortDef_tie<T>::~EventPortDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ComponentIR::EventPortDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::EventPortDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::EventPortDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ComponentIR::EventPortDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::EventPortDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ComponentIR::EventPortDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->EventPortDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ComponentIR::EventPortDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventPortDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::EventPortDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventPortDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::EventPortDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventPortDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::EventPortDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventPortDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ComponentIR::EventPortDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::EventPortDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ComponentIR::EventPortDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ComponentIR::EventPortDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventPortDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::EventDef_ptr POA_CORBA::ComponentIR::EventPortDef_tie<T>::event (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->event (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EventPortDef_tie<T>::event (
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->event (
+ event
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ComponentIR::EventPortDef_tie<T>::is_a (
+ const char * event_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_a (
+ event_id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::EmitsDef_tie<T>::EmitsDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::EmitsDef_tie<T>::EmitsDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::EmitsDef_tie<T>::EmitsDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::EmitsDef_tie<T>::EmitsDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::EmitsDef_tie<T>::~EmitsDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ComponentIR::EmitsDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::EmitsDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::EmitsDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ComponentIR::EmitsDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::EmitsDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ComponentIR::EmitsDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->EmitsDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ComponentIR::EmitsDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EmitsDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::EmitsDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EmitsDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::EmitsDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EmitsDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::EmitsDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EmitsDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ComponentIR::EmitsDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::EmitsDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ComponentIR::EmitsDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ComponentIR::EmitsDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EmitsDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::EventDef_ptr POA_CORBA::ComponentIR::EmitsDef_tie<T>::event (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->event (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::EmitsDef_tie<T>::event (
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->event (
+ event
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ComponentIR::EmitsDef_tie<T>::is_a (
+ const char * event_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_a (
+ event_id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::PublishesDef_tie<T>::PublishesDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::PublishesDef_tie<T>::PublishesDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::PublishesDef_tie<T>::PublishesDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::PublishesDef_tie<T>::PublishesDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::PublishesDef_tie<T>::~PublishesDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ComponentIR::PublishesDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::PublishesDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::PublishesDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ComponentIR::PublishesDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::PublishesDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ComponentIR::PublishesDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->PublishesDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ComponentIR::PublishesDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::PublishesDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::PublishesDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::PublishesDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::PublishesDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::PublishesDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::PublishesDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::PublishesDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ComponentIR::PublishesDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::PublishesDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ComponentIR::PublishesDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ComponentIR::PublishesDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::PublishesDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::EventDef_ptr POA_CORBA::ComponentIR::PublishesDef_tie<T>::event (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->event (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::PublishesDef_tie<T>::event (
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->event (
+ event
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ComponentIR::PublishesDef_tie<T>::is_a (
+ const char * event_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_a (
+ event_id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ConsumesDef_tie<T>::ConsumesDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ConsumesDef_tie<T>::ConsumesDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ConsumesDef_tie<T>::ConsumesDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ConsumesDef_tie<T>::ConsumesDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ConsumesDef_tie<T>::~ConsumesDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ComponentIR::ConsumesDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::ConsumesDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::ConsumesDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ComponentIR::ConsumesDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::ConsumesDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ComponentIR::ConsumesDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ConsumesDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ComponentIR::ConsumesDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ConsumesDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ConsumesDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ConsumesDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ConsumesDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ConsumesDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ConsumesDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ConsumesDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ComponentIR::ConsumesDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ConsumesDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ComponentIR::ConsumesDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ComponentIR::ConsumesDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ConsumesDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::EventDef_ptr POA_CORBA::ComponentIR::ConsumesDef_tie<T>::event (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->event (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ConsumesDef_tie<T>::event (
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->event (
+ event
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ComponentIR::ConsumesDef_tie<T>::is_a (
+ const char * event_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_a (
+ event_id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ComponentDef_tie<T>::ComponentDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ComponentDef_tie<T>::ComponentDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ComponentDef_tie<T>::ComponentDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ComponentDef_tie<T>::ComponentDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::ComponentDef_tie<T>::~ComponentDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ComponentIR::ComponentDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::ComponentDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::ComponentDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ComponentIR::ComponentDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::ComponentDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ComponentIR::ComponentDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ComponentDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ComponentIR::ComponentDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ComponentDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ComponentIR::ComponentDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ComponentIR::ComponentDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::ComponentIR::ComponentDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ComponentDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ComponentDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ComponentDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ComponentDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ComponentDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ComponentDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::ComponentDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ComponentIR::ComponentDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ComponentDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDefSeq * POA_CORBA::ComponentIR::ComponentDef_tie<T>::base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->base_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ComponentDef_tie<T>::base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->base_interfaces (
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ComponentIR::ComponentDef_tie<T>::is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_a (
+ interface_id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef::FullInterfaceDescription * POA_CORBA::ComponentIR::ComponentDef_tie<T>::describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AttributeDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::OperationDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_operation (
+ id,
+ name,
+ version,
+ result,
+ mode,
+ params,
+ exceptions,
+ contexts
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription * POA_CORBA::ComponentIR::ComponentDef_tie<T>::describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtAttributeDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode,
+ get_exceptions,
+ set_exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::ComponentDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::base_component (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->base_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ComponentDef_tie<T>::base_component (
+ ::CORBA::ComponentIR::ComponentDef_ptr base_component
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->base_component (
+ base_component
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDefSeq * POA_CORBA::ComponentIR::ComponentDef_tie<T>::supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->supported_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::ComponentDef_tie<T>::supported_interfaces (
+ const ::CORBA::InterfaceDefSeq & supported_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->supported_interfaces (
+ supported_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::ProvidesDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_provides (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_provides (
+ id,
+ name,
+ version,
+ interface_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::UsesDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_uses (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::InterfaceDef_ptr interface_type,
+ ::CORBA::Boolean is_multiple
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_uses (
+ id,
+ name,
+ version,
+ interface_type,
+ is_multiple
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::EmitsDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_emits (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_emits (
+ id,
+ name,
+ version,
+ event
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::PublishesDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_publishes (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_publishes (
+ id,
+ name,
+ version,
+ event
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::ConsumesDef_ptr POA_CORBA::ComponentIR::ComponentDef_tie<T>::create_consumes (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::ComponentIR::EventDef_ptr event
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_consumes (
+ id,
+ name,
+ version,
+ event
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::FactoryDef_tie<T>::FactoryDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::FactoryDef_tie<T>::FactoryDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::FactoryDef_tie<T>::FactoryDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::FactoryDef_tie<T>::FactoryDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::FactoryDef_tie<T>::~FactoryDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ComponentIR::FactoryDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::FactoryDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::FactoryDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ComponentIR::FactoryDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::FactoryDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ComponentIR::FactoryDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->FactoryDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ComponentIR::FactoryDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FactoryDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::FactoryDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FactoryDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::FactoryDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FactoryDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::FactoryDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FactoryDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ComponentIR::FactoryDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::FactoryDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ComponentIR::FactoryDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ComponentIR::FactoryDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FactoryDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ComponentIR::FactoryDef_tie<T>::result (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->result (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::IDLType_ptr POA_CORBA::ComponentIR::FactoryDef_tie<T>::result_def (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->result_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FactoryDef_tie<T>::result_def (
+ ::CORBA::IDLType_ptr result_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->result_def (
+ result_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ParDescriptionSeq * POA_CORBA::ComponentIR::FactoryDef_tie<T>::params (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->params (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FactoryDef_tie<T>::params (
+ const ::CORBA::ParDescriptionSeq & params
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->params (
+ params
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::OperationMode POA_CORBA::ComponentIR::FactoryDef_tie<T>::mode (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->mode (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FactoryDef_tie<T>::mode (
+ ::CORBA::OperationMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->mode (
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContextIdSeq * POA_CORBA::ComponentIR::FactoryDef_tie<T>::contexts (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contexts (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FactoryDef_tie<T>::contexts (
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->contexts (
+ contexts
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDefSeq * POA_CORBA::ComponentIR::FactoryDef_tie<T>::exceptions (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->exceptions (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FactoryDef_tie<T>::exceptions (
+ const ::CORBA::ExceptionDefSeq & exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->exceptions (
+ exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::FinderDef_tie<T>::FinderDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::FinderDef_tie<T>::FinderDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::FinderDef_tie<T>::FinderDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::FinderDef_tie<T>::FinderDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::FinderDef_tie<T>::~FinderDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ComponentIR::FinderDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::FinderDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::FinderDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ComponentIR::FinderDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::FinderDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ComponentIR::FinderDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->FinderDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ComponentIR::FinderDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FinderDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::FinderDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FinderDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::FinderDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FinderDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::FinderDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FinderDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ComponentIR::FinderDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::FinderDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ComponentIR::FinderDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ComponentIR::FinderDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FinderDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ComponentIR::FinderDef_tie<T>::result (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->result (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::IDLType_ptr POA_CORBA::ComponentIR::FinderDef_tie<T>::result_def (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->result_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FinderDef_tie<T>::result_def (
+ ::CORBA::IDLType_ptr result_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->result_def (
+ result_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ParDescriptionSeq * POA_CORBA::ComponentIR::FinderDef_tie<T>::params (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->params (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FinderDef_tie<T>::params (
+ const ::CORBA::ParDescriptionSeq & params
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->params (
+ params
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::OperationMode POA_CORBA::ComponentIR::FinderDef_tie<T>::mode (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->mode (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FinderDef_tie<T>::mode (
+ ::CORBA::OperationMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->mode (
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContextIdSeq * POA_CORBA::ComponentIR::FinderDef_tie<T>::contexts (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contexts (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FinderDef_tie<T>::contexts (
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->contexts (
+ contexts
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDefSeq * POA_CORBA::ComponentIR::FinderDef_tie<T>::exceptions (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->exceptions (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::FinderDef_tie<T>::exceptions (
+ const ::CORBA::ExceptionDefSeq & exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->exceptions (
+ exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::HomeDef_tie<T>::HomeDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::HomeDef_tie<T>::HomeDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::HomeDef_tie<T>::HomeDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::HomeDef_tie<T>::HomeDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ComponentIR::HomeDef_tie<T>::~HomeDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ComponentIR::HomeDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::HomeDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::HomeDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ComponentIR::HomeDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ComponentIR::HomeDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ComponentIR::HomeDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->HomeDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ComponentIR::HomeDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::HomeDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ComponentIR::HomeDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ComponentIR::HomeDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::ComponentIR::HomeDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::HomeDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::HomeDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::HomeDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::HomeDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::HomeDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::HomeDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ComponentIR::HomeDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ComponentIR::HomeDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::HomeDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDefSeq * POA_CORBA::ComponentIR::HomeDef_tie<T>::base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->base_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::HomeDef_tie<T>::base_interfaces (
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->base_interfaces (
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ComponentIR::HomeDef_tie<T>::is_a (
+ const char * interface_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_a (
+ interface_id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef::FullInterfaceDescription * POA_CORBA::ComponentIR::HomeDef_tie<T>::describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AttributeDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::OperationDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_operation (
+ id,
+ name,
+ version,
+ result,
+ mode,
+ params,
+ exceptions,
+ contexts
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription * POA_CORBA::ComponentIR::HomeDef_tie<T>::describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtAttributeDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode,
+ get_exceptions,
+ set_exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::HomeDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::base_home (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->base_home (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::HomeDef_tie<T>::base_home (
+ ::CORBA::ComponentIR::HomeDef_ptr base_home
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->base_home (
+ base_home
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDefSeq * POA_CORBA::ComponentIR::HomeDef_tie<T>::supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->supported_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::HomeDef_tie<T>::supported_interfaces (
+ const ::CORBA::InterfaceDefSeq & supported_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->supported_interfaces (
+ supported_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::ComponentDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::managed_component (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->managed_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::HomeDef_tie<T>::managed_component (
+ ::CORBA::ComponentIR::ComponentDef_ptr managed_component
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->managed_component (
+ managed_component
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::primary_key (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->primary_key (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ComponentIR::HomeDef_tie<T>::primary_key (
+ ::CORBA::ValueDef_ptr primary_key
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->primary_key (
+ primary_key
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::FactoryDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_factory (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_factory (
+ id,
+ name,
+ version,
+ params,
+ exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ComponentIR::FinderDef_ptr POA_CORBA::ComponentIR::HomeDef_tie<T>::create_finder (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_finder (
+ id,
+ name,
+ version,
+ params,
+ exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS.cpp
new file mode 100644
index 00000000000..f41363829d3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS.cpp
@@ -0,0 +1,7501 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:603
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_EXTENDEDS_CPP_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_EXTENDEDS_CPP_
+
+
+#include "IFR_ExtendedS.h"
+#include "tao/PortableServer/Operation_Table_Perfect_Hash.h"
+#include "tao/PortableServer/Upcall_Command.h"
+#include "tao/PortableServer/Upcall_Wrapper.h"
+#include "tao/TAO_Server_Request.h"
+#include "tao/ORB_Core.h"
+#include "tao/Profile.h"
+#include "tao/Stub.h"
+#include "tao/IFR_Client_Adapter.h"
+#include "tao/Object_T.h"
+#include "tao/AnyTypeCode/TypeCode.h"
+#include "tao/AnyTypeCode/DynamicC.h"
+#include "tao/CDR.h"
+#include "tao/operation_details.h"
+#include "tao/PortableInterceptor.h"
+#include "tao/PortableServer/Basic_SArguments.h"
+#include "tao/PortableServer/Object_SArgument_T.h"
+#include "tao/PortableServer/Special_Basic_SArguments.h"
+#include "tao/PortableServer/UB_String_SArguments.h"
+#include "tao/PortableServer/Var_Size_SArgument_T.h"
+#include "tao/PortableServer/TypeCode_SArg_Traits.h"
+#include "tao/PortableServer/Object_SArg_Traits.h"
+#include "tao/PortableServer/get_arg.h"
+#include "tao/Special_Basic_Arguments.h"
+#include "tao/UB_String_Arguments.h"
+#include "tao/Basic_Arguments.h"
+#include "tao/Object_Argument_T.h"
+#include "tao/Special_Basic_Arguments.h"
+#include "tao/UB_String_Arguments.h"
+#include "tao/Var_Size_Argument_T.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/Malloc_Allocator.h"
+
+#if !defined (__ACE_INLINE__)
+#include "IFR_ExtendedS.inl"
+#endif /* !defined INLINE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_arg_traits.cpp:72
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+// Arg traits specializations.
+namespace TAO
+{
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_DEFINITIONKIND__SARG_TRAITS_)
+#define _CORBA_DEFINITIONKIND__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::DefinitionKind>
+ : public
+ Basic_SArg_Traits_T<
+ CORBA::DefinitionKind,
+ TAO::Any_Insert_Policy_Stream <CORBA::DefinitionKind>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_REPOSITORY__SARG_TRAITS_)
+#define _CORBA_REPOSITORY__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::Repository>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::Repository_ptr,
+ CORBA::Repository_var,
+ CORBA::Repository_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::Repository_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_CONTAINER__SARG_TRAITS_)
+#define _CORBA_CONTAINER__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::Container>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::Container_ptr,
+ CORBA::Container_var,
+ CORBA::Container_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::Container_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_IDLTYPE__SARG_TRAITS_)
+#define _CORBA_IDLTYPE__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::IDLType>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::IDLType_ptr,
+ CORBA::IDLType_var,
+ CORBA::IDLType_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::IDLType_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_INTERFACEDEFSEQ__SARG_TRAITS_)
+#define _CORBA_INTERFACEDEFSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::InterfaceDefSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::InterfaceDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_VALUEDEFSEQ__SARG_TRAITS_)
+#define _CORBA_VALUEDEFSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ValueDefSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ValueDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_INITIALIZERSEQ__SARG_TRAITS_)
+#define _CORBA_INITIALIZERSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::InitializerSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::InitializerSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::InitializerSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_EXTINITIALIZERSEQ__SARG_TRAITS_)
+#define _CORBA_EXTINITIALIZERSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ExtInitializerSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ExtInitializerSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtInitializerSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_EXCEPTIONDEFSEQ__SARG_TRAITS_)
+#define _CORBA_EXCEPTIONDEFSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ExceptionDefSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ExceptionDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExceptionDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_ATTRIBUTEMODE__SARG_TRAITS_)
+#define _CORBA_ATTRIBUTEMODE__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::AttributeMode>
+ : public
+ Basic_SArg_Traits_T<
+ CORBA::AttributeMode,
+ TAO::Any_Insert_Policy_Stream <CORBA::AttributeMode>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_ATTRIBUTEDEF__SARG_TRAITS_)
+#define _CORBA_ATTRIBUTEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::AttributeDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::AttributeDef_ptr,
+ CORBA::AttributeDef_var,
+ CORBA::AttributeDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::AttributeDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_EXTATTRIBUTEDEF__SARG_TRAITS_)
+#define _CORBA_EXTATTRIBUTEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ExtAttributeDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ExtAttributeDef_ptr,
+ CORBA::ExtAttributeDef_var,
+ CORBA::ExtAttributeDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtAttributeDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_OPERATIONMODE__SARG_TRAITS_)
+#define _CORBA_OPERATIONMODE__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::OperationMode>
+ : public
+ Basic_SArg_Traits_T<
+ CORBA::OperationMode,
+ TAO::Any_Insert_Policy_Stream <CORBA::OperationMode>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_PARDESCRIPTIONSEQ__SARG_TRAITS_)
+#define _CORBA_PARDESCRIPTIONSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ParDescriptionSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ParDescriptionSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ParDescriptionSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_CONTEXTIDSEQ__SARG_TRAITS_)
+#define _CORBA_CONTEXTIDSEQ__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ContextIdSeq>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ContextIdSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ContextIdSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_OPERATIONDEF__SARG_TRAITS_)
+#define _CORBA_OPERATIONDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::OperationDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::OperationDef_ptr,
+ CORBA::OperationDef_var,
+ CORBA::OperationDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::OperationDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_VALUEMEMBERDEF__SARG_TRAITS_)
+#define _CORBA_VALUEMEMBERDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ValueMemberDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ValueMemberDef_ptr,
+ CORBA::ValueMemberDef_var,
+ CORBA::ValueMemberDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueMemberDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_VALUEDEF__SARG_TRAITS_)
+#define _CORBA_VALUEDEF__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ValueDef>
+ : public
+ Object_SArg_Traits_T<
+ CORBA::ValueDef_ptr,
+ CORBA::ValueDef_var,
+ CORBA::ValueDef_out,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:859
+
+#if !defined (_CORBA_VALUEDEF_FULLVALUEDESCRIPTION__SARG_TRAITS_)
+#define _CORBA_VALUEDEF_FULLVALUEDESCRIPTION__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ValueDef::FullValueDescription>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ValueDef::FullValueDescription,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueDef::FullValueDescription>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:859
+
+#if !defined (_CORBA_EXTVALUEDEF_EXTFULLVALUEDESCRIPTION__SARG_TRAITS_)
+#define _CORBA_EXTVALUEDEF_EXTFULLVALUEDESCRIPTION__SARG_TRAITS_
+
+ template<>
+ class SArg_Traits<CORBA::ExtValueDef::ExtFullValueDescription>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::ExtValueDef::ExtFullValueDescription,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtValueDef::ExtFullValueDescription>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_arg_traits.cpp:72
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+// Arg traits specializations.
+namespace TAO
+{
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_DEFINITIONKIND__ARG_TRAITS_)
+#define _CORBA_DEFINITIONKIND__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::DefinitionKind>
+ : public
+ Basic_Arg_Traits_T<
+ CORBA::DefinitionKind,
+ TAO::Any_Insert_Policy_Stream <CORBA::DefinitionKind>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_REPOSITORY__ARG_TRAITS_)
+#define _CORBA_REPOSITORY__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::Repository>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::Repository_ptr,
+ CORBA::Repository_var,
+ CORBA::Repository_out,
+ TAO::Objref_Traits<CORBA::Repository>,
+ TAO::Any_Insert_Policy_Stream <CORBA::Repository_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_CONTAINER__ARG_TRAITS_)
+#define _CORBA_CONTAINER__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::Container>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::Container_ptr,
+ CORBA::Container_var,
+ CORBA::Container_out,
+ TAO::Objref_Traits<CORBA::Container>,
+ TAO::Any_Insert_Policy_Stream <CORBA::Container_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_IDLTYPE__ARG_TRAITS_)
+#define _CORBA_IDLTYPE__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::IDLType>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::IDLType_ptr,
+ CORBA::IDLType_var,
+ CORBA::IDLType_out,
+ TAO::Objref_Traits<CORBA::IDLType>,
+ TAO::Any_Insert_Policy_Stream <CORBA::IDLType_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_INTERFACEDEFSEQ__ARG_TRAITS_)
+#define _CORBA_INTERFACEDEFSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::InterfaceDefSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::InterfaceDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::InterfaceDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_VALUEDEFSEQ__ARG_TRAITS_)
+#define _CORBA_VALUEDEFSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ValueDefSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ValueDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_INITIALIZERSEQ__ARG_TRAITS_)
+#define _CORBA_INITIALIZERSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::InitializerSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::InitializerSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::InitializerSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_EXTINITIALIZERSEQ__ARG_TRAITS_)
+#define _CORBA_EXTINITIALIZERSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ExtInitializerSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ExtInitializerSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtInitializerSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_EXCEPTIONDEFSEQ__ARG_TRAITS_)
+#define _CORBA_EXCEPTIONDEFSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ExceptionDefSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ExceptionDefSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExceptionDefSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_ATTRIBUTEMODE__ARG_TRAITS_)
+#define _CORBA_ATTRIBUTEMODE__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::AttributeMode>
+ : public
+ Basic_Arg_Traits_T<
+ CORBA::AttributeMode,
+ TAO::Any_Insert_Policy_Stream <CORBA::AttributeMode>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_ATTRIBUTEDEF__ARG_TRAITS_)
+#define _CORBA_ATTRIBUTEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::AttributeDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::AttributeDef_ptr,
+ CORBA::AttributeDef_var,
+ CORBA::AttributeDef_out,
+ TAO::Objref_Traits<CORBA::AttributeDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::AttributeDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_EXTATTRIBUTEDEF__ARG_TRAITS_)
+#define _CORBA_EXTATTRIBUTEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ExtAttributeDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ExtAttributeDef_ptr,
+ CORBA::ExtAttributeDef_var,
+ CORBA::ExtAttributeDef_out,
+ TAO::Objref_Traits<CORBA::ExtAttributeDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtAttributeDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:817
+
+#if !defined (_CORBA_OPERATIONMODE__ARG_TRAITS_)
+#define _CORBA_OPERATIONMODE__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::OperationMode>
+ : public
+ Basic_Arg_Traits_T<
+ CORBA::OperationMode,
+ TAO::Any_Insert_Policy_Stream <CORBA::OperationMode>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_PARDESCRIPTIONSEQ__ARG_TRAITS_)
+#define _CORBA_PARDESCRIPTIONSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ParDescriptionSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ParDescriptionSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ParDescriptionSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:611
+
+#if !defined (_CORBA_CONTEXTIDSEQ__ARG_TRAITS_)
+#define _CORBA_CONTEXTIDSEQ__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ContextIdSeq>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ContextIdSeq,
+ TAO::Any_Insert_Policy_Stream <CORBA::ContextIdSeq>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_OPERATIONDEF__ARG_TRAITS_)
+#define _CORBA_OPERATIONDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::OperationDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::OperationDef_ptr,
+ CORBA::OperationDef_var,
+ CORBA::OperationDef_out,
+ TAO::Objref_Traits<CORBA::OperationDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::OperationDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_VALUEMEMBERDEF__ARG_TRAITS_)
+#define _CORBA_VALUEMEMBERDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ValueMemberDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ValueMemberDef_ptr,
+ CORBA::ValueMemberDef_var,
+ CORBA::ValueMemberDef_out,
+ TAO::Objref_Traits<CORBA::ValueMemberDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueMemberDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:140
+
+#if !defined (_CORBA_VALUEDEF__ARG_TRAITS_)
+#define _CORBA_VALUEDEF__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ValueDef>
+ : public
+ Object_Arg_Traits_T<
+ CORBA::ValueDef_ptr,
+ CORBA::ValueDef_var,
+ CORBA::ValueDef_out,
+ TAO::Objref_Traits<CORBA::ValueDef>,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueDef_ptr>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:859
+
+#if !defined (_CORBA_VALUEDEF_FULLVALUEDESCRIPTION__ARG_TRAITS_)
+#define _CORBA_VALUEDEF_FULLVALUEDESCRIPTION__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ValueDef::FullValueDescription>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ValueDef::FullValueDescription,
+ TAO::Any_Insert_Policy_Stream <CORBA::ValueDef::FullValueDescription>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_arg_traits.cpp:859
+
+#if !defined (_CORBA_EXTVALUEDEF_EXTFULLVALUEDESCRIPTION__ARG_TRAITS_)
+#define _CORBA_EXTVALUEDEF_EXTFULLVALUEDESCRIPTION__ARG_TRAITS_
+
+ template<>
+ class Arg_Traits<CORBA::ExtValueDef::ExtFullValueDescription>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::ExtValueDef::ExtFullValueDescription,
+ TAO::Any_Insert_Policy_Stream <CORBA::ExtValueDef::ExtFullValueDescription>
+ >
+ {
+ };
+
+#endif /* end #if !defined */
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_FixedDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_FixedDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_FixedDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 0,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 0,
+ 19, 19, 0, 0, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 0, 5, 19, 19, 19, 19, 0, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19,
+#else
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 0, 19, 0, 19, 19,
+ 0, 0, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 0, 5, 19, 19, 19,
+ 19, 0, 19, 19, 19, 19, 19, 19,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_FixedDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 12,
+ MIN_WORD_LENGTH = 5,
+ MAX_WORD_LENGTH = 14,
+ MIN_HASH_VALUE = 5,
+ MAX_HASH_VALUE = 18,
+ HASH_VALUE_RANGE = 14,
+ DUPLICATES = 4,
+ WORDLIST_SIZE = 17
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"_is_a", &POA_CORBA::FixedDef::_is_a_skel, 0},
+ {"destroy", &POA_CORBA::FixedDef::destroy_skel, 0},
+ {"_get_type", &POA_CORBA::FixedDef::_get_type_skel, 0},
+ {"_get_scale", &POA_CORBA::FixedDef::_get_scale_skel, 0},
+ {"_interface", &POA_CORBA::FixedDef::_interface_skel, 0},
+ {"_set_scale", &POA_CORBA::FixedDef::_set_scale_skel, 0},
+ {"_get_digits", &POA_CORBA::FixedDef::_get_digits_skel, 0},
+ {"_set_digits", &POA_CORBA::FixedDef::_set_digits_skel, 0},
+ {"_get_def_kind", &POA_CORBA::FixedDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::FixedDef::_repository_id_skel, 0},
+ {"_component", &POA_CORBA::FixedDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::FixedDef::_non_existent_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -1, -8, -3, -11, -2, 5, -1, 6, -1, 7, -27, -26, -1, 13,
+ 14, 15, -1, -1, 16,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_FixedDef_Perfect_Hash_OpTable tao_CORBA_FixedDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_FixedDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_FixedDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_FixedDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_FixedDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_FixedDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_FixedDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_FixedDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::FixedDef::FixedDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_FixedDef_optable;
+}
+
+POA_CORBA::FixedDef::FixedDef (const FixedDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::IDLType (rhs)
+{
+}
+
+POA_CORBA::FixedDef::~FixedDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_digits_FixedDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_digits_FixedDef (
+ POA_CORBA::FixedDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::UShort>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::UShort> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->digits (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::FixedDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::FixedDef::_get_digits_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::UShort>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::FixedDef * const impl =
+ static_cast<POA_CORBA::FixedDef *> (servant);
+
+ _get_digits_FixedDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_digits_FixedDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_digits_FixedDef (
+ POA_CORBA::FixedDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::UShort>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::UShort> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->digits (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::FixedDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::FixedDef::_set_digits_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::UShort>::in_arg_val _tao_digits;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_digits
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::FixedDef * const impl =
+ static_cast<POA_CORBA::FixedDef *> (servant);
+
+ _set_digits_FixedDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_scale_FixedDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_scale_FixedDef (
+ POA_CORBA::FixedDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Short>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Short> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->scale (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::FixedDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::FixedDef::_get_scale_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Short>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::FixedDef * const impl =
+ static_cast<POA_CORBA::FixedDef *> (servant);
+
+ _get_scale_FixedDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_scale_FixedDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_scale_FixedDef (
+ POA_CORBA::FixedDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Short>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Short> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->scale (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::FixedDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::FixedDef::_set_scale_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Short>::in_arg_val _tao_scale;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_scale
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::FixedDef * const impl =
+ static_cast<POA_CORBA::FixedDef *> (servant);
+
+ _set_scale_FixedDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_FixedDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_FixedDef_Upcall_Command (
+ POA_CORBA::FixedDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::FixedDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::FixedDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::FixedDef * const impl =
+ static_cast<POA_CORBA::FixedDef *> (servant);
+
+ _is_a_FixedDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_FixedDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_FixedDef_Upcall_Command (
+ POA_CORBA::FixedDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::FixedDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::FixedDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::FixedDef * const impl =
+ static_cast<POA_CORBA::FixedDef *> (servant);
+
+ _non_existent_FixedDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_FixedDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_FixedDef_Upcall_Command (
+ POA_CORBA::FixedDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::FixedDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::FixedDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::FixedDef * const impl =
+ static_cast<POA_CORBA::FixedDef *> (servant);
+
+ _repository_id_FixedDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::FixedDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::FixedDef * const impl =
+ static_cast<POA_CORBA::FixedDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_FixedDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_FixedDef_Upcall_Command (
+ POA_CORBA::FixedDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::FixedDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::FixedDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::FixedDef * const impl =
+ static_cast<POA_CORBA::FixedDef *> (servant);
+
+ _get_component_FixedDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::FixedDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/FixedDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::FixedDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/FixedDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::FixedDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::FixedDef *
+POA_CORBA::FixedDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::FixedDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_FixedDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ValueMemberDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ValueMemberDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ValueMemberDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 0, 0, 15, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 0, 10, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 0, 0, 15, 37, 37, 37, 37, 37, 37, 0,
+ 0, 37, 37, 37, 37, 0, 10, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ValueMemberDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 23,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 7,
+ WORDLIST_SIZE = 27
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ValueMemberDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::ValueMemberDef::_is_a_skel, 0},
+ {"_get_id", &POA_CORBA::ValueMemberDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ValueMemberDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::ValueMemberDef::describe_skel, 0},
+ {"_get_name", &POA_CORBA::ValueMemberDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::ValueMemberDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::ValueMemberDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ValueMemberDef::_interface_skel, 0},
+ {"_get_access", &POA_CORBA::ValueMemberDef::_get_access_skel, 0},
+ {"_set_access", &POA_CORBA::ValueMemberDef::_set_access_skel, 0},
+ {"_get_version", &POA_CORBA::ValueMemberDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ValueMemberDef::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ValueMemberDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ValueMemberDef::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ValueMemberDef::_get_defined_in_skel, 0},
+ {"destroy", &POA_CORBA::ValueMemberDef::destroy_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ValueMemberDef::_get_absolute_name_skel, 0},
+ {"_component", &POA_CORBA::ValueMemberDef::_component_skel, 0},
+ {"_non_existent", &POA_CORBA::ValueMemberDef::_non_existent_skel, 0},
+ {"_get_type_def", &POA_CORBA::ValueMemberDef::_get_type_def_skel, 0},
+ {"_set_type_def", &POA_CORBA::ValueMemberDef::_set_type_def_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ValueMemberDef::_get_containing_repository_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -13, -2, -15, -2, 4, 5, -1, 53, 8, 48, 12, -47, -46, 17,
+ 18, 19, -1, 20, 21, -1, 22, -9, -3, 23, -6, -2, -24, -2,
+ -38, -1, -1, -1, -1, -1, -1, -1, 26,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ValueMemberDef_Perfect_Hash_OpTable tao_CORBA_ValueMemberDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_ValueMemberDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_ValueMemberDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_ValueMemberDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_ValueMemberDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_ValueMemberDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_ValueMemberDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_ValueMemberDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ValueMemberDef::ValueMemberDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ValueMemberDef_optable;
+}
+
+POA_CORBA::ValueMemberDef::ValueMemberDef (const ValueMemberDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs)
+{
+}
+
+POA_CORBA::ValueMemberDef::~ValueMemberDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_type_ValueMemberDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_type_ValueMemberDef (
+ POA_CORBA::ValueMemberDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::TypeCode> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueMemberDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueMemberDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::TypeCode>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueMemberDef * const impl =
+ static_cast<POA_CORBA::ValueMemberDef *> (servant);
+
+ _get_type_ValueMemberDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_type_def_ValueMemberDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_type_def_ValueMemberDef (
+ POA_CORBA::ValueMemberDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueMemberDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueMemberDef::_get_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueMemberDef * const impl =
+ static_cast<POA_CORBA::ValueMemberDef *> (servant);
+
+ _get_type_def_ValueMemberDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_type_def_ValueMemberDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_type_def_ValueMemberDef (
+ POA_CORBA::ValueMemberDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->type_def (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueMemberDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueMemberDef::_set_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_type_def;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_type_def
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ValueMemberDef * const impl =
+ static_cast<POA_CORBA::ValueMemberDef *> (servant);
+
+ _set_type_def_ValueMemberDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_access_ValueMemberDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_access_ValueMemberDef (
+ POA_CORBA::ValueMemberDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Visibility>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Visibility> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->access (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueMemberDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueMemberDef::_get_access_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Visibility>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueMemberDef * const impl =
+ static_cast<POA_CORBA::ValueMemberDef *> (servant);
+
+ _get_access_ValueMemberDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_access_ValueMemberDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_access_ValueMemberDef (
+ POA_CORBA::ValueMemberDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Visibility>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Visibility> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->access (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueMemberDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueMemberDef::_set_access_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Visibility>::in_arg_val _tao_access;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_access
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ValueMemberDef * const impl =
+ static_cast<POA_CORBA::ValueMemberDef *> (servant);
+
+ _set_access_ValueMemberDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ValueMemberDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ValueMemberDef_Upcall_Command (
+ POA_CORBA::ValueMemberDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueMemberDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ValueMemberDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ValueMemberDef * const impl =
+ static_cast<POA_CORBA::ValueMemberDef *> (servant);
+
+ _is_a_ValueMemberDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ValueMemberDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ValueMemberDef_Upcall_Command (
+ POA_CORBA::ValueMemberDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueMemberDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ValueMemberDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueMemberDef * const impl =
+ static_cast<POA_CORBA::ValueMemberDef *> (servant);
+
+ _non_existent_ValueMemberDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ValueMemberDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ValueMemberDef_Upcall_Command (
+ POA_CORBA::ValueMemberDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueMemberDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ValueMemberDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueMemberDef * const impl =
+ static_cast<POA_CORBA::ValueMemberDef *> (servant);
+
+ _repository_id_ValueMemberDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ValueMemberDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ValueMemberDef * const impl =
+ static_cast<POA_CORBA::ValueMemberDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ValueMemberDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ValueMemberDef_Upcall_Command (
+ POA_CORBA::ValueMemberDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueMemberDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ValueMemberDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueMemberDef * const impl =
+ static_cast<POA_CORBA::ValueMemberDef *> (servant);
+
+ _get_component_ValueMemberDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ValueMemberDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ValueMemberDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ValueMemberDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ValueMemberDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ValueMemberDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ValueMemberDef *
+POA_CORBA::ValueMemberDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ValueMemberDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_ValueMemberDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ValueDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ValueDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ValueDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 0,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 0,
+ 105, 15, 50, 40, 105, 105, 105, 0, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 0, 0, 0,
+ 105, 0, 105, 0, 105, 105, 105, 105, 105, 105,
+ 105, 105, 15, 0, 105, 105, 105, 5, 15, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105,
+#else
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+ 105, 105, 105, 105, 105, 0, 105, 0, 105, 15,
+ 50, 40, 105, 105, 105, 0, 105, 105, 0, 0,
+ 0, 105, 0, 105, 0, 15, 0, 105, 105, 105,
+ 5, 15, 105, 105, 105, 105, 105, 105,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ValueDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 56,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 104,
+ HASH_VALUE_RANGE = 101,
+ DUPLICATES = 17,
+ WORDLIST_SIZE = 60
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"is_a", &POA_CORBA::ValueDef::is_a_skel, 0},
+ {"_is_a", &POA_CORBA::ValueDef::_is_a_skel, 0},
+ {"lookup", &POA_CORBA::ValueDef::lookup_skel, 0},
+ {"_component", &POA_CORBA::ValueDef::_component_skel, 0},
+ {"_get_version", &POA_CORBA::ValueDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ValueDef::_set_version_skel, 0},
+ {"_non_existent", &POA_CORBA::ValueDef::_non_existent_skel, 0},
+ {"_get_is_custom", &POA_CORBA::ValueDef::_get_is_custom_skel, 0},
+ {"_set_is_custom", &POA_CORBA::ValueDef::_set_is_custom_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ValueDef::_get_defined_in_skel, 0},
+ {"_get_is_abstract", &POA_CORBA::ValueDef::_get_is_abstract_skel, 0},
+ {"_set_is_abstract", &POA_CORBA::ValueDef::_set_is_abstract_skel, 0},
+ {"create_enum", &POA_CORBA::ValueDef::create_enum_skel, 0},
+ {"create_union", &POA_CORBA::ValueDef::create_union_skel, 0},
+ {"create_struct", &POA_CORBA::ValueDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::ValueDef::create_constant_skel, 0},
+ {"create_exception", &POA_CORBA::ValueDef::create_exception_skel, 0},
+ {"create_operation", &POA_CORBA::ValueDef::create_operation_skel, 0},
+ {"_get_initializers", &POA_CORBA::ValueDef::_get_initializers_skel, 0},
+ {"_set_initializers", &POA_CORBA::ValueDef::_set_initializers_skel, 0},
+ {"create_value_member", &POA_CORBA::ValueDef::create_value_member_skel, 0},
+ {"create_value_box", &POA_CORBA::ValueDef::create_value_box_skel, 0},
+ {"contents", &POA_CORBA::ValueDef::contents_skel, 0},
+ {"_get_supported_interfaces", &POA_CORBA::ValueDef::_get_supported_interfaces_skel, 0},
+ {"_set_abstract_base_values", &POA_CORBA::ValueDef::_set_abstract_base_values_skel, 0},
+ {"_get_abstract_base_values", &POA_CORBA::ValueDef::_get_abstract_base_values_skel, 0},
+ {"_set_supported_interfaces", &POA_CORBA::ValueDef::_set_supported_interfaces_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ValueDef::_get_containing_repository_skel, 0},
+ {"create_alias", &POA_CORBA::ValueDef::create_alias_skel, 0},
+ {"move", &POA_CORBA::ValueDef::move_skel, 0},
+ {"_get_name", &POA_CORBA::ValueDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::ValueDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::ValueDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ValueDef::_interface_skel, 0},
+ {"lookup_name", &POA_CORBA::ValueDef::lookup_name_skel, 0},
+ {"_get_base_value", &POA_CORBA::ValueDef::_get_base_value_skel, 0},
+ {"_set_base_value", &POA_CORBA::ValueDef::_set_base_value_skel, 0},
+ {"_get_id", &POA_CORBA::ValueDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ValueDef::_set_id_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ValueDef::_get_absolute_name_skel, 0},
+ {"_get_is_truncatable", &POA_CORBA::ValueDef::_get_is_truncatable_skel, 0},
+ {"_set_is_truncatable", &POA_CORBA::ValueDef::_set_is_truncatable_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ValueDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ValueDef::_repository_id_skel, 0},
+ {"create_value", &POA_CORBA::ValueDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::ValueDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::ValueDef::create_native_skel, 0},
+ {"create_interface", &POA_CORBA::ValueDef::create_interface_skel, 0},
+ {"create_attribute", &POA_CORBA::ValueDef::create_attribute_skel, 0},
+ {"create_ext_value", &POA_CORBA::ValueDef::create_ext_value_skel, 0},
+ {"destroy", &POA_CORBA::ValueDef::destroy_skel, 0},
+ {"create_local_interface", &POA_CORBA::ValueDef::create_local_interface_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::ValueDef::create_abstract_interface_skel, 0},
+ {"describe_contents", &POA_CORBA::ValueDef::describe_contents_skel, 0},
+ {"describe", &POA_CORBA::ValueDef::describe_skel, 0},
+ {"describe_value", &POA_CORBA::ValueDef::describe_value_skel, 0},
+ };
+
+ static const signed short lookup[] =
+ {
+ -8, -2, -11, -2, 4, 5, 6, -1, -14, -2, 7, -1, -116, 10,
+ -116, 13, -112, -1, -20, -2, -22, -2, -27, -4, -34, -3, 16, 17,
+ 18, -1, 19, -117, -116, -1, 24, -1, 25, -1, 26, -1, -122, 31,
+ 32, -1, 33, -39, -2, -41, -2, -129, 37, 38, -1, -44, -2, -114,
+ -1, -114, 43, -110, -1, -1, -1, 46, 47, -49, -2, 48, -107, -51,
+ -3, -106, 54, -1, -1, -1, -1, 55, -1, -1, 56, -1, 57, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 58, -1, -1, -1, -1, -1, 59,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ValueDef_Perfect_Hash_OpTable tao_CORBA_ValueDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_ValueDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_ValueDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_ValueDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_ValueDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_ValueDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_ValueDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_ValueDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ValueDef::ValueDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ValueDef_optable;
+}
+
+POA_CORBA::ValueDef::ValueDef (const ValueDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs)
+{
+}
+
+POA_CORBA::ValueDef::~ValueDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_supported_interfaces_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_supported_interfaces_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::InterfaceDefSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->supported_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::_get_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _get_supported_interfaces_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_supported_interfaces_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_supported_interfaces_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InterfaceDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->supported_interfaces (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::_set_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::InterfaceDefSeq>::in_arg_val _tao_supported_interfaces;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_supported_interfaces
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _set_supported_interfaces_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_initializers_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_initializers_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InitializerSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::InitializerSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->initializers (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::_get_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::InitializerSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _get_initializers_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_initializers_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_initializers_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::InitializerSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::InitializerSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->initializers (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::_set_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::InitializerSeq>::in_arg_val _tao_initializers;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_initializers
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _set_initializers_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_base_value_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_base_value_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ValueDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ValueDef> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->base_value (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::_get_base_value_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ValueDef>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _get_base_value_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_base_value_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_base_value_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ValueDef>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ValueDef> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->base_value (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::_set_base_value_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ValueDef>::in_arg_val _tao_base_value;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_base_value
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _set_base_value_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_abstract_base_values_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_abstract_base_values_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ValueDefSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ValueDefSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->abstract_base_values (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::_get_abstract_base_values_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ValueDefSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _get_abstract_base_values_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_abstract_base_values_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_abstract_base_values_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ValueDefSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ValueDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->abstract_base_values (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::_set_abstract_base_values_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ValueDefSeq>::in_arg_val _tao_abstract_base_values;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_abstract_base_values
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _set_abstract_base_values_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_is_abstract_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_is_abstract_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->is_abstract (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::_get_is_abstract_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _get_is_abstract_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_is_abstract_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_is_abstract_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->is_abstract (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::_set_is_abstract_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_is_abstract;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_is_abstract
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _set_is_abstract_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_is_custom_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_is_custom_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->is_custom (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::_get_is_custom_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _get_is_custom_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_is_custom_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_is_custom_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->is_custom (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::_set_is_custom_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_is_custom;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_is_custom
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _set_is_custom_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_is_truncatable_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_is_truncatable_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->is_truncatable (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::_get_is_truncatable_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _get_is_truncatable_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_is_truncatable_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_is_truncatable_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->is_truncatable (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::_set_is_truncatable_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::in_arg_val _tao_is_truncatable;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_is_truncatable
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _set_is_truncatable_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class is_a_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline is_a_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_->is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ is_a_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class describe_value_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline describe_value_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ValueDef::FullValueDescription>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ValueDef::FullValueDescription> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->describe_value (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::describe_value_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ValueDef::FullValueDescription>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ describe_value_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_value_member_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_value_member_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ValueMemberDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ValueMemberDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::CORBA::Visibility>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Visibility> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ retval =
+ this->servant_->create_value_member (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::create_value_member_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ValueMemberDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_type;
+ TAO::SArg_Traits< ::CORBA::Visibility>::in_arg_val _tao_access;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_type,
+ &_tao_access
+ };
+
+ static size_t const nargs = 6;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ create_value_member_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_attribute_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_attribute_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::AttributeDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::AttributeDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::CORBA::AttributeMode>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::AttributeMode> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ retval =
+ this->servant_->create_attribute (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::AttributeDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_type;
+ TAO::SArg_Traits< ::CORBA::AttributeMode>::in_arg_val _tao_mode;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_type,
+ &_tao_mode
+ };
+
+ static size_t const nargs = 6;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ create_attribute_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_operation_ValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_operation_ValueDef (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::OperationDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::OperationDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::CORBA::OperationMode>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::OperationMode> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ TAO::SArg_Traits< ::CORBA::ParDescriptionSeq>::in_arg_type arg_6 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ParDescriptionSeq> (
+ this->operation_details_,
+ this->args_,
+ 6);
+
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_type arg_7 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ExceptionDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 7);
+
+ TAO::SArg_Traits< ::CORBA::ContextIdSeq>::in_arg_type arg_8 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ContextIdSeq> (
+ this->operation_details_,
+ this->args_,
+ 8);
+
+ retval =
+ this->servant_->create_operation (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ , arg_6
+ , arg_7
+ , arg_8
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueDef::create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::OperationDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_result;
+ TAO::SArg_Traits< ::CORBA::OperationMode>::in_arg_val _tao_mode;
+ TAO::SArg_Traits< ::CORBA::ParDescriptionSeq>::in_arg_val _tao_params;
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_val _tao_exceptions;
+ TAO::SArg_Traits< ::CORBA::ContextIdSeq>::in_arg_val _tao_contexts;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_result,
+ &_tao_mode,
+ &_tao_params,
+ &_tao_exceptions,
+ &_tao_contexts
+ };
+
+ static size_t const nargs = 9;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ create_operation_ValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ValueDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ValueDef_Upcall_Command (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ValueDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _is_a_ValueDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ValueDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ValueDef_Upcall_Command (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ValueDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _non_existent_ValueDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ValueDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ValueDef_Upcall_Command (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ValueDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _repository_id_ValueDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ValueDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ValueDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ValueDef_Upcall_Command (
+ POA_CORBA::ValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ValueDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueDef * const impl =
+ static_cast<POA_CORBA::ValueDef *> (servant);
+
+ _get_component_ValueDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ValueDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ValueDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ValueDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ValueDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ValueDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ValueDef *
+POA_CORBA::ValueDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ValueDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_ValueDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ExtValueDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ExtValueDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ExtValueDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 0,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 0,
+ 109, 15, 50, 40, 109, 109, 109, 0, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 0, 0, 0,
+ 109, 0, 109, 0, 109, 109, 109, 109, 109, 109,
+ 109, 109, 15, 0, 109, 109, 109, 15, 15, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109,
+#else
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 0, 109, 0, 109, 15,
+ 50, 40, 109, 109, 109, 0, 109, 109, 0, 0,
+ 0, 109, 0, 109, 0, 15, 0, 109, 109, 109,
+ 15, 15, 109, 109, 109, 109, 109, 109,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ExtValueDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 60,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 108,
+ HASH_VALUE_RANGE = 105,
+ DUPLICATES = 18,
+ WORDLIST_SIZE = 64
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"is_a", &POA_CORBA::ExtValueDef::is_a_skel, 0},
+ {"_is_a", &POA_CORBA::ExtValueDef::_is_a_skel, 0},
+ {"lookup", &POA_CORBA::ExtValueDef::lookup_skel, 0},
+ {"_component", &POA_CORBA::ExtValueDef::_component_skel, 0},
+ {"_get_version", &POA_CORBA::ExtValueDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ExtValueDef::_set_version_skel, 0},
+ {"_non_existent", &POA_CORBA::ExtValueDef::_non_existent_skel, 0},
+ {"_get_is_custom", &POA_CORBA::ExtValueDef::_get_is_custom_skel, 0},
+ {"_set_is_custom", &POA_CORBA::ExtValueDef::_set_is_custom_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ExtValueDef::_get_defined_in_skel, 0},
+ {"_get_is_abstract", &POA_CORBA::ExtValueDef::_get_is_abstract_skel, 0},
+ {"_set_is_abstract", &POA_CORBA::ExtValueDef::_set_is_abstract_skel, 0},
+ {"create_enum", &POA_CORBA::ExtValueDef::create_enum_skel, 0},
+ {"create_union", &POA_CORBA::ExtValueDef::create_union_skel, 0},
+ {"create_struct", &POA_CORBA::ExtValueDef::create_struct_skel, 0},
+ {"create_constant", &POA_CORBA::ExtValueDef::create_constant_skel, 0},
+ {"create_exception", &POA_CORBA::ExtValueDef::create_exception_skel, 0},
+ {"create_operation", &POA_CORBA::ExtValueDef::create_operation_skel, 0},
+ {"_get_initializers", &POA_CORBA::ExtValueDef::_get_initializers_skel, 0},
+ {"_set_initializers", &POA_CORBA::ExtValueDef::_set_initializers_skel, 0},
+ {"create_value_member", &POA_CORBA::ExtValueDef::create_value_member_skel, 0},
+ {"_get_ext_initializers", &POA_CORBA::ExtValueDef::_get_ext_initializers_skel, 0},
+ {"_set_ext_initializers", &POA_CORBA::ExtValueDef::_set_ext_initializers_skel, 0},
+ {"contents", &POA_CORBA::ExtValueDef::contents_skel, 0},
+ {"_get_supported_interfaces", &POA_CORBA::ExtValueDef::_get_supported_interfaces_skel, 0},
+ {"_set_abstract_base_values", &POA_CORBA::ExtValueDef::_set_abstract_base_values_skel, 0},
+ {"_get_abstract_base_values", &POA_CORBA::ExtValueDef::_get_abstract_base_values_skel, 0},
+ {"_set_supported_interfaces", &POA_CORBA::ExtValueDef::_set_supported_interfaces_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ExtValueDef::_get_containing_repository_skel, 0},
+ {"create_alias", &POA_CORBA::ExtValueDef::create_alias_skel, 0},
+ {"move", &POA_CORBA::ExtValueDef::move_skel, 0},
+ {"create_value_box", &POA_CORBA::ExtValueDef::create_value_box_skel, 0},
+ {"_get_name", &POA_CORBA::ExtValueDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::ExtValueDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::ExtValueDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ExtValueDef::_interface_skel, 0},
+ {"lookup_name", &POA_CORBA::ExtValueDef::lookup_name_skel, 0},
+ {"_get_base_value", &POA_CORBA::ExtValueDef::_get_base_value_skel, 0},
+ {"_set_base_value", &POA_CORBA::ExtValueDef::_set_base_value_skel, 0},
+ {"_get_id", &POA_CORBA::ExtValueDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ExtValueDef::_set_id_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ExtValueDef::_get_absolute_name_skel, 0},
+ {"_get_is_truncatable", &POA_CORBA::ExtValueDef::_get_is_truncatable_skel, 0},
+ {"_set_is_truncatable", &POA_CORBA::ExtValueDef::_set_is_truncatable_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ExtValueDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ExtValueDef::_repository_id_skel, 0},
+ {"create_value", &POA_CORBA::ExtValueDef::create_value_skel, 0},
+ {"create_module", &POA_CORBA::ExtValueDef::create_module_skel, 0},
+ {"create_native", &POA_CORBA::ExtValueDef::create_native_skel, 0},
+ {"create_interface", &POA_CORBA::ExtValueDef::create_interface_skel, 0},
+ {"create_attribute", &POA_CORBA::ExtValueDef::create_attribute_skel, 0},
+ {"create_ext_value", &POA_CORBA::ExtValueDef::create_ext_value_skel, 0},
+ {"destroy", &POA_CORBA::ExtValueDef::destroy_skel, 0},
+ {"create_ext_attribute", &POA_CORBA::ExtValueDef::create_ext_attribute_skel, 0},
+ {"create_local_interface", &POA_CORBA::ExtValueDef::create_local_interface_skel, 0},
+ {"create_abstract_interface", &POA_CORBA::ExtValueDef::create_abstract_interface_skel, 0},
+ {"describe_contents", &POA_CORBA::ExtValueDef::describe_contents_skel, 0},
+ {"describe", &POA_CORBA::ExtValueDef::describe_skel, 0},
+ {"describe_value", &POA_CORBA::ExtValueDef::describe_value_skel, 0},
+ {"describe_ext_value", &POA_CORBA::ExtValueDef::describe_ext_value_skel, 0},
+ };
+
+ static const signed short lookup[] =
+ {
+ -14, -2, -20, -2, 4, 5, 6, -1, -22, -2, 7, -1, 169, 10,
+ 154, 13, -124, -1, -25, -2, -28, -4, -36, -3, -41, -2, 16, 17,
+ 18, -1, 19, -137, -132, -1, 24, -1, -126, -1, 27, -1, -128, 32,
+ 33, -1, 34, -1, 35, -43, -2, -135, 39, 40, -1, -46, -2, -139,
+ -1, -118, 45, -114, -11, -2, -1, 48, 49, -51, -2, 50, -111, -53,
+ -3, -110, 56, -8, -2, 57, -1, 58, -1, -1, 59, -1, 60, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 61, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ExtValueDef_Perfect_Hash_OpTable tao_CORBA_ExtValueDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_ExtValueDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_ExtValueDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_ExtValueDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_ExtValueDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_ExtValueDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_ExtValueDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_ExtValueDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ExtValueDef::ExtValueDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ExtValueDef_optable;
+}
+
+POA_CORBA::ExtValueDef::ExtValueDef (const ExtValueDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Container (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs),
+ POA_CORBA::ValueDef (rhs)
+{
+}
+
+POA_CORBA::ExtValueDef::~ExtValueDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_ext_initializers_ExtValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_ext_initializers_ExtValueDef (
+ POA_CORBA::ExtValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ExtInitializerSeq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ExtInitializerSeq> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->ext_initializers (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ExtValueDef::_get_ext_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ExtInitializerSeq>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtValueDef * const impl =
+ static_cast<POA_CORBA::ExtValueDef *> (servant);
+
+ _get_ext_initializers_ExtValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_ext_initializers_ExtValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_ext_initializers_ExtValueDef (
+ POA_CORBA::ExtValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ExtInitializerSeq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ExtInitializerSeq> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->ext_initializers (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ExtValueDef::_set_ext_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::ExtInitializerSeq>::in_arg_val _tao_ext_initializers;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_ext_initializers
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ExtValueDef * const impl =
+ static_cast<POA_CORBA::ExtValueDef *> (servant);
+
+ _set_ext_initializers_ExtValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class describe_ext_value_ExtValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline describe_ext_value_ExtValueDef (
+ POA_CORBA::ExtValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ExtValueDef::ExtFullValueDescription>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ExtValueDef::ExtFullValueDescription> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->describe_ext_value (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ExtValueDef::describe_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ExtValueDef::ExtFullValueDescription>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtValueDef * const impl =
+ static_cast<POA_CORBA::ExtValueDef *> (servant);
+
+ describe_ext_value_ExtValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class create_ext_attribute_ExtValueDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline create_ext_attribute_ExtValueDef (
+ POA_CORBA::ExtValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::ExtAttributeDef>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::ExtAttributeDef> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::RepositoryId> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_type arg_2 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Identifier> (
+ this->operation_details_,
+ this->args_,
+ 2);
+
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_type arg_3 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::VersionSpec> (
+ this->operation_details_,
+ this->args_,
+ 3);
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_4 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 4);
+
+ TAO::SArg_Traits< ::CORBA::AttributeMode>::in_arg_type arg_5 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::AttributeMode> (
+ this->operation_details_,
+ this->args_,
+ 5);
+
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_type arg_6 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ExceptionDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 6);
+
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_type arg_7 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::ExceptionDefSeq> (
+ this->operation_details_,
+ this->args_,
+ 7);
+
+ retval =
+ this->servant_->create_ext_attribute (
+ arg_1
+ , arg_2
+ , arg_3
+ , arg_4
+ , arg_5
+ , arg_6
+ , arg_7
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ExtValueDef::create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::ExtAttributeDef>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::RepositoryId>::in_arg_val _tao_id;
+ TAO::SArg_Traits< ::CORBA::Identifier>::in_arg_val _tao_name;
+ TAO::SArg_Traits< ::CORBA::VersionSpec>::in_arg_val _tao_version;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_type;
+ TAO::SArg_Traits< ::CORBA::AttributeMode>::in_arg_val _tao_mode;
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_val _tao_get_exceptions;
+ TAO::SArg_Traits< ::CORBA::ExceptionDefSeq>::in_arg_val _tao_set_exceptions;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_id,
+ &_tao_name,
+ &_tao_version,
+ &_tao_type,
+ &_tao_mode,
+ &_tao_get_exceptions,
+ &_tao_set_exceptions
+ };
+
+ static size_t const nargs = 8;
+
+ POA_CORBA::ExtValueDef * const impl =
+ static_cast<POA_CORBA::ExtValueDef *> (servant);
+
+ create_ext_attribute_ExtValueDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ExtValueDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ExtValueDef_Upcall_Command (
+ POA_CORBA::ExtValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtValueDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ExtValueDef * const impl =
+ static_cast<POA_CORBA::ExtValueDef *> (servant);
+
+ _is_a_ExtValueDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ExtValueDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ExtValueDef_Upcall_Command (
+ POA_CORBA::ExtValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtValueDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtValueDef * const impl =
+ static_cast<POA_CORBA::ExtValueDef *> (servant);
+
+ _non_existent_ExtValueDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ExtValueDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ExtValueDef_Upcall_Command (
+ POA_CORBA::ExtValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtValueDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtValueDef * const impl =
+ static_cast<POA_CORBA::ExtValueDef *> (servant);
+
+ _repository_id_ExtValueDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ExtValueDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ExtValueDef * const impl =
+ static_cast<POA_CORBA::ExtValueDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ExtValueDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ExtValueDef_Upcall_Command (
+ POA_CORBA::ExtValueDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ExtValueDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ExtValueDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ExtValueDef * const impl =
+ static_cast<POA_CORBA::ExtValueDef *> (servant);
+
+ _get_component_ExtValueDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ExtValueDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Container:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ValueDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ExtValueDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ExtValueDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ExtValueDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ExtValueDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ExtValueDef *
+POA_CORBA::ExtValueDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ExtValueDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_ExtValueDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1499
+
+class TAO_CORBA_ValueBoxDef_Perfect_Hash_OpTable
+ : public TAO_Perfect_Hash_OpTable
+{
+private:
+ unsigned int hash (const char *str, unsigned int len);
+
+public:
+ const TAO_operation_db_entry * lookup (const char *str, unsigned int len);
+};
+
+/* C++ code produced by gperf version 2.8 (ACE version) */
+/* Command-line: C:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_ValueBoxDef_Perfect_Hash_OpTable -N lookup */
+unsigned int
+TAO_CORBA_ValueBoxDef_Perfect_Hash_OpTable::hash (const char *str, unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+#if defined (ACE_MVS)
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 0,
+ 37, 37, 0, 0, 0, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 0, 0,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 10, 37, 37, 37, 37, 10, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37,
+#else
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 0, 37, 0, 37, 37,
+ 0, 0, 0, 37, 37, 37, 37, 37, 37, 0,
+ 0, 37, 37, 37, 37, 37, 10, 37, 37, 37,
+ 37, 10, 37, 37, 37, 37, 37, 37,
+#endif /* ACE_MVS */
+ };
+ return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
+}
+
+const TAO_operation_db_entry *
+TAO_CORBA_ValueBoxDef_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 21,
+ MIN_WORD_LENGTH = 4,
+ MAX_WORD_LENGTH = 26,
+ MIN_HASH_VALUE = 4,
+ MAX_HASH_VALUE = 36,
+ HASH_VALUE_RANGE = 33,
+ DUPLICATES = 6,
+ WORDLIST_SIZE = 25
+ };
+
+ static const TAO_operation_db_entry wordlist[] =
+ {
+ {"",0,0},{"",0,0},{"",0,0},{"",0,0},
+ {"move", &POA_CORBA::ValueBoxDef::move_skel, 0},
+ {"_is_a", &POA_CORBA::ValueBoxDef::_is_a_skel, 0},
+ {"_get_id", &POA_CORBA::ValueBoxDef::_get_id_skel, 0},
+ {"_set_id", &POA_CORBA::ValueBoxDef::_set_id_skel, 0},
+ {"describe", &POA_CORBA::ValueBoxDef::describe_skel, 0},
+ {"_get_name", &POA_CORBA::ValueBoxDef::_get_name_skel, 0},
+ {"_get_type", &POA_CORBA::ValueBoxDef::_get_type_skel, 0},
+ {"_set_name", &POA_CORBA::ValueBoxDef::_set_name_skel, 0},
+ {"_interface", &POA_CORBA::ValueBoxDef::_interface_skel, 0},
+ {"_get_version", &POA_CORBA::ValueBoxDef::_get_version_skel, 0},
+ {"_set_version", &POA_CORBA::ValueBoxDef::_set_version_skel, 0},
+ {"_get_def_kind", &POA_CORBA::ValueBoxDef::_get_def_kind_skel, 0},
+ {"_repository_id", &POA_CORBA::ValueBoxDef::_repository_id_skel, 0},
+ {"_get_defined_in", &POA_CORBA::ValueBoxDef::_get_defined_in_skel, 0},
+ {"destroy", &POA_CORBA::ValueBoxDef::destroy_skel, 0},
+ {"_get_absolute_name", &POA_CORBA::ValueBoxDef::_get_absolute_name_skel, 0},
+ {"_component", &POA_CORBA::ValueBoxDef::_component_skel, 0},
+ {"_get_original_type_def", &POA_CORBA::ValueBoxDef::_get_original_type_def_skel, 0},
+ {"_set_original_type_def", &POA_CORBA::ValueBoxDef::_set_original_type_def_skel, 0},
+ {"_non_existent", &POA_CORBA::ValueBoxDef::_non_existent_skel, 0},
+ {"_get_containing_repository", &POA_CORBA::ValueBoxDef::_get_containing_repository_skel, 0},
+ };
+
+ static const signed char lookup[] =
+ {
+ -13, -2, -21, -2, 4, 5, -1, 55, 8, 51, 12, -1, -48, 15,
+ 16, 17, -1, 18, 19, -1, 20, -1, -56, 23, -9, -3, -6, -2,
+ -1, -1, -1, -1, -1, -1, -1, -1, 24,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ unsigned int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int slot = lookup[key];
+
+ if (slot >= 0 && slot < WORDLIST_SIZE)
+ {
+ const char *s = wordlist[slot].opname;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[slot];
+ }
+ else if (slot < 0 && slot >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const TAO_operation_db_entry *base = &wordlist[-lookup[offset]];
+ const TAO_operation_db_entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->opname && !strncmp (str + 1, ptr->opname + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+
+static TAO_CORBA_ValueBoxDef_Perfect_Hash_OpTable tao_CORBA_ValueBoxDef_optable;
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:966
+
+TAO::Collocation_Proxy_Broker *
+CORBA__TAO_ValueBoxDef_Proxy_Broker_Factory_function ( ::CORBA::Object_ptr)
+{
+ return reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead); // Dummy
+}
+
+int
+CORBA__TAO_ValueBoxDef_Proxy_Broker_Factory_Initializer (size_t)
+{
+ CORBA__TAO_ValueBoxDef_Proxy_Broker_Factory_function_pointer =
+ CORBA__TAO_ValueBoxDef_Proxy_Broker_Factory_function;
+
+ return 0;
+}
+
+static int
+CORBA__TAO_ValueBoxDef_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
+ CORBA__TAO_ValueBoxDef_Proxy_Broker_Factory_Initializer (
+ reinterpret_cast<size_t> (CORBA__TAO_ValueBoxDef_Proxy_Broker_Factory_Initializer)
+ );
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:103
+
+POA_CORBA::ValueBoxDef::ValueBoxDef (void)
+ : TAO_ServantBase ()
+{
+ this->optable_ = &tao_CORBA_ValueBoxDef_optable;
+}
+
+POA_CORBA::ValueBoxDef::ValueBoxDef (const ValueBoxDef& rhs)
+ : TAO_Abstract_ServantBase (rhs),
+ TAO_ServantBase (rhs),
+ POA_CORBA::IRObject (rhs),
+ POA_CORBA::Contained (rhs),
+ POA_CORBA::IDLType (rhs),
+ POA_CORBA::TypedefDef (rhs)
+{
+}
+
+POA_CORBA::ValueBoxDef::~ValueBoxDef (void)
+{
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_original_type_def_ValueBoxDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_original_type_def_ValueBoxDef (
+ POA_CORBA::ValueBoxDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_->original_type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueBoxDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueBoxDef::_get_original_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::IDLType>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueBoxDef * const impl =
+ static_cast<POA_CORBA::ValueBoxDef *> (servant);
+
+ _get_original_type_def_ValueBoxDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _set_original_type_def_ValueBoxDef
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _set_original_type_def_ValueBoxDef (
+ POA_CORBA::ValueBoxDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::IDLType> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ this->servant_->original_type_def (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueBoxDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/operation_ss.cpp:190
+
+void POA_CORBA::ValueBoxDef::_set_original_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< void>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::IDLType>::in_arg_val _tao_original_type_def;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_original_type_def
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ValueBoxDef * const impl =
+ static_cast<POA_CORBA::ValueBoxDef *> (servant);
+
+ _set_original_type_def_ValueBoxDef command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:169
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _is_a_ValueBoxDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _is_a_ValueBoxDef_Upcall_Command (
+ POA_CORBA::ValueBoxDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_,
+ 1);
+
+ retval =
+ this->servant_-> _is_a (
+ arg_1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueBoxDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ValueBoxDef::_is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+ TAO::SArg_Traits< ::CORBA::Char *>::in_arg_val _tao_repository_id;
+
+ TAO::Argument * const args[] =
+ {
+ &retval,
+ &_tao_repository_id
+ };
+
+ static size_t const nargs = 2;
+
+ POA_CORBA::ValueBoxDef * const impl =
+ static_cast<POA_CORBA::ValueBoxDef *> (servant);
+
+ _is_a_ValueBoxDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _non_existent_ValueBoxDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _non_existent_ValueBoxDef_Upcall_Command (
+ POA_CORBA::ValueBoxDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _non_existent (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueBoxDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ValueBoxDef::_non_existent_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueBoxDef * const impl =
+ static_cast<POA_CORBA::ValueBoxDef *> (servant);
+
+ _non_existent_ValueBoxDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _repository_id_ValueBoxDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _repository_id_ValueBoxDef_Upcall_Command (
+ POA_CORBA::ValueBoxDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Char *> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _repository_id (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueBoxDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ValueBoxDef::_repository_id_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Char *>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueBoxDef * const impl =
+ static_cast<POA_CORBA::ValueBoxDef *> (servant);
+
+ _repository_id_ValueBoxDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:513
+
+void POA_CORBA::ValueBoxDef::_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * /* servant_upcall */,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Client_Adapter *_tao_adapter =
+ ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
+ TAO_ORB_Core::ifr_client_adapter_name ()
+ );
+
+ if (_tao_adapter == 0)
+ {
+ ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,
+ ::CORBA::COMPLETED_NO));
+ }
+
+ POA_CORBA::ValueBoxDef * const impl =
+ static_cast<POA_CORBA::ValueBoxDef *> (servant);
+ ::CORBA::InterfaceDef_ptr _tao_retval =
+ impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server_request.init_reply ();
+ TAO_OutputCDR &_tao_out = *server_request.outgoing ();
+
+ ::CORBA::Boolean const _tao_result =
+ _tao_adapter->interfacedef_cdr_insert (
+ _tao_out,
+ _tao_retval
+ );
+
+ _tao_adapter->dispose (_tao_retval);
+
+ if (_tao_result == false)
+ {
+ ACE_THROW ( ::CORBA::MARSHAL ());
+ }
+}namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/upcall_command_ss.cpp:127
+
+ class _get_component_ValueBoxDef_Upcall_Command
+ : public TAO::Upcall_Command
+ {
+ public:
+ inline _get_component_ValueBoxDef_Upcall_Command (
+ POA_CORBA::ValueBoxDef * servant,
+ TAO_Operation_Details const * operation_details,
+ TAO::Argument * const args[])
+ : servant_ (servant)
+ , operation_details_ (operation_details)
+ , args_ (args)
+ {
+ }
+
+ virtual void execute (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg< ::CORBA::Object> (
+ this->operation_details_,
+ this->args_);
+
+ retval =
+ this->servant_-> _get_component (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ private:
+ POA_CORBA::ValueBoxDef * const servant_;
+ TAO_Operation_Details const * const operation_details_;
+ TAO::Argument * const * const args_;
+ };
+}
+
+
+void POA_CORBA::ValueBoxDef::_component_skel (
+ TAO_ServerRequest & server_request,
+ void * TAO_INTERCEPTOR (servant_upcall),
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+#if TAO_HAS_INTERCEPTORS == 1
+ static ::CORBA::TypeCode_ptr const * const exceptions = 0;
+ static ::CORBA::ULong const nexceptions = 0;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ TAO::SArg_Traits< ::CORBA::Object>::ret_val retval;
+
+ TAO::Argument * const args[] =
+ {
+ &retval
+ };
+
+ static size_t const nargs = 1;
+
+ POA_CORBA::ValueBoxDef * const impl =
+ static_cast<POA_CORBA::ValueBoxDef *> (servant);
+
+ _get_component_ValueBoxDef_Upcall_Command command (
+ impl,
+ server_request.operation_details (),
+ args);
+
+ TAO::Upcall_Wrapper upcall_wrapper;
+ upcall_wrapper.upcall (server_request
+ , args
+ , nargs
+ , command
+#if TAO_HAS_INTERCEPTORS == 1
+ , servant_upcall
+ , exceptions
+ , nexceptions
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+::CORBA::Boolean POA_CORBA::ValueBoxDef::_is_a (
+ const char* value
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ return
+ (
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IRObject:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Contained:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/IDLType:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/TypedefDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/ValueBoxDef:1.0"
+ ) ||
+ !ACE_OS::strcmp (
+ value,
+ "IDL:omg.org/CORBA/Object:1.0"
+ )
+ );
+}
+
+const char* POA_CORBA::ValueBoxDef::_interface_repository_id (void) const
+{
+ return "IDL:omg.org/CORBA/ValueBoxDef:1.0";
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:903
+
+void POA_CORBA::ValueBoxDef::_dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->synchronous_upcall_dispatch (req,
+ servant_upcall,
+ this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/interface_ss.cpp:851
+
+CORBA::ValueBoxDef *
+POA_CORBA::ValueBoxDef::_this (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Stub_Auto_Ptr safe_stub (stub);
+ ::CORBA::Object_ptr tmp = CORBA::Object::_nil ();
+
+ ::CORBA::Boolean const _tao_opt_colloc =
+ stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ();
+
+ ACE_NEW_RETURN (
+ tmp,
+ ::CORBA::Object (stub, _tao_opt_colloc, this),
+ 0
+ );
+
+ ::CORBA::Object_var obj = tmp;
+ (void) safe_stub.release ();
+
+ typedef ::CORBA::ValueBoxDef STUB_SCOPED_NAME;
+ return
+ TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
+ obj.in (),
+ CORBA__TAO_ValueBoxDef_Proxy_Broker_Factory_function_pointer
+ );
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+
+#endif /* ifndef */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS.h b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS.h
new file mode 100644
index 00000000000..3cb3af272e8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS.h
@@ -0,0 +1,2140 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:409
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_EXTENDEDS_H_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_EXTENDEDS_H_
+
+#include /**/ "ace/pre.h"
+
+#include "tao/IFR_Client/IFR_ExtendedC.h"
+#include "orbsvcs/IFRService/IFR_BasicS.h"
+#include "tao/AnyTypeCode/VisibilityS.h"
+#include "tao/AnyTypeCode/ValueModifierS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Collocation_Proxy_Broker.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/PortableServer/Servant_Base.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_module/module_sh.cpp:49
+
+namespace POA_CORBA
+{
+
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class FixedDef;
+ typedef FixedDef *FixedDef_ptr;
+
+ class FixedDef
+ : public virtual POA_CORBA::IDLType
+ {
+ protected:
+ FixedDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::FixedDef _stub_type;
+ typedef ::CORBA::FixedDef_ptr _stub_ptr_type;
+ typedef ::CORBA::FixedDef_var _stub_var_type;
+
+ FixedDef (const FixedDef& rhs);
+ virtual ~FixedDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::FixedDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::UShort digits (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_digits_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void digits (
+ ::CORBA::UShort digits
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_digits_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Short scale (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_scale_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void scale (
+ ::CORBA::Short scale
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_scale_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ValueMemberDef;
+ typedef ValueMemberDef *ValueMemberDef_ptr;
+
+ class ValueMemberDef
+ : public virtual POA_CORBA::Contained
+ {
+ protected:
+ ValueMemberDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ValueMemberDef _stub_type;
+ typedef ::CORBA::ValueMemberDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ValueMemberDef_var _stub_var_type;
+
+ ValueMemberDef (const ValueMemberDef& rhs);
+ virtual ~ValueMemberDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ValueMemberDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::IDLType_ptr type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void type_def (
+ ::CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Visibility access (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_access_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void access (
+ ::CORBA::Visibility access
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_access_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ValueDef;
+ typedef ValueDef *ValueDef_ptr;
+
+ class ValueDef
+ : public virtual POA_CORBA::Container,
+ public virtual POA_CORBA::Contained,
+ public virtual POA_CORBA::IDLType
+ {
+ protected:
+ ValueDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ValueDef _stub_type;
+ typedef ::CORBA::ValueDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ValueDef_var _stub_var_type;
+
+ ValueDef (const ValueDef& rhs);
+ virtual ~ValueDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ValueDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::InterfaceDefSeq * supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void supported_interfaces (
+ const ::CORBA::InterfaceDefSeq & supported_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::InitializerSeq * initializers (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void initializers (
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ValueDef_ptr base_value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_base_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void base_value (
+ ::CORBA::ValueDef_ptr base_value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_base_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ValueDefSeq * abstract_base_values (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_abstract_base_values_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void abstract_base_values (
+ const ::CORBA::ValueDefSeq & abstract_base_values
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_abstract_base_values_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Boolean is_abstract (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_is_abstract_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void is_abstract (
+ ::CORBA::Boolean is_abstract
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_is_abstract_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Boolean is_custom (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_is_custom_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void is_custom (
+ ::CORBA::Boolean is_custom
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_is_custom_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Boolean is_truncatable (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_is_truncatable_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void is_truncatable (
+ ::CORBA::Boolean is_truncatable
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_is_truncatable_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::Boolean is_a (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ValueDef::FullValueDescription * describe_value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void describe_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ValueMemberDef_ptr create_value_member (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::Visibility access
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_value_member_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::AttributeDef_ptr create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::OperationDef_ptr create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ExtValueDef;
+ typedef ExtValueDef *ExtValueDef_ptr;
+
+ class ExtValueDef
+ : public virtual POA_CORBA::ValueDef
+ {
+ protected:
+ ExtValueDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ExtValueDef _stub_type;
+ typedef ::CORBA::ExtValueDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ExtValueDef_var _stub_var_type;
+
+ ExtValueDef (const ExtValueDef& rhs);
+ virtual ~ExtValueDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ExtValueDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ExtInitializerSeq * ext_initializers (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_ext_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void ext_initializers (
+ const ::CORBA::ExtInitializerSeq & ext_initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_ext_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ExtValueDef::ExtFullValueDescription * describe_ext_value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void describe_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::ExtAttributeDef_ptr create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void create_ext_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_base_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_base_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_abstract_base_values_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_abstract_base_values_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_is_abstract_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_is_abstract_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_is_custom_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_is_custom_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_is_truncatable_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_is_truncatable_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_value_member_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/interface_sh.cpp:87
+
+ class ValueBoxDef;
+ typedef ValueBoxDef *ValueBoxDef_ptr;
+
+ class ValueBoxDef
+ : public virtual POA_CORBA::TypedefDef
+ {
+ protected:
+ ValueBoxDef (void);
+
+ public:
+ // Useful for template programming.
+ typedef ::CORBA::ValueBoxDef _stub_type;
+ typedef ::CORBA::ValueBoxDef_ptr _stub_ptr_type;
+ typedef ::CORBA::ValueBoxDef_var _stub_var_type;
+
+ ValueBoxDef (const ValueBoxDef& rhs);
+ virtual ~ValueBoxDef (void);
+
+ virtual ::CORBA::Boolean _is_a (
+ const char* logical_type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void _is_a_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _non_existent_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _interface_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _component_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void _repository_id_skel (
+ TAO_ServerRequest & req,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ virtual void _dispatch (
+ TAO_ServerRequest & req,
+ void * servant_upcall
+ ACE_ENV_ARG_DECL
+ );
+
+ ::CORBA::ValueBoxDef *_this (
+
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ virtual const char* _interface_repository_id (void) const;
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual ::CORBA::IDLType_ptr original_type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _get_original_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/operation_sh.cpp:45
+
+ virtual void original_type_def (
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ )) = 0;
+
+ static void _set_original_type_def_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ );
+
+ static void
+ _get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_interface.cpp:1955
+
+ static void
+ move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+
+ static void
+ _get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
+ };
+
+// TAO_IDL - Generated from
+// be\be_visitor_module/module_sh.cpp:80
+
+} // module CORBA
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:1219
+
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include "IFR_ExtendedS_T.h"
+
+#if defined (__ACE_INLINE__)
+#include "IFR_ExtendedS.inl"
+#endif /* defined INLINE */
+
+#include /**/ "ace/post.h"
+#endif /* ifndef */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS.inl b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS.inl
new file mode 100644
index 00000000000..78a4a8dcb9d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS.inl
@@ -0,0 +1,2232 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+ACE_INLINE
+void
+POA_CORBA::FixedDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::FixedDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::FixedDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::FixedDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::FixedDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::FixedDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueMemberDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ValueMemberDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueMemberDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ValueMemberDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueMemberDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueMemberDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueMemberDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueMemberDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueMemberDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueMemberDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueMemberDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueMemberDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueMemberDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueMemberDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueMemberDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueMemberDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueMemberDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueMemberDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueMemberDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueMemberDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueMemberDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueMemberDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueMemberDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueMemberDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueMemberDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueMemberDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::ValueDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::lookup_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::lookup_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::lookup_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::lookup_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::describe_contents_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::describe_contents_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_module_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::create_module_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_constant_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::create_constant_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_struct_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::create_struct_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_union_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::create_union_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_enum_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::create_enum_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_alias_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::create_alias_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::create_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::create_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_value_box_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::create_value_box_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_exception_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::create_exception_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_native_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::create_native_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_abstract_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::create_abstract_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_local_interface_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::create_local_interface_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_ext_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Container * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Container::create_ext_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_get_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::_get_supported_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_set_supported_interfaces_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::_set_supported_interfaces_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_get_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::_get_initializers_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_set_initializers_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::_set_initializers_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_get_base_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::_get_base_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_set_base_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::_set_base_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_get_abstract_base_values_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::_get_abstract_base_values_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_set_abstract_base_values_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::_set_abstract_base_values_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_get_is_abstract_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::_get_is_abstract_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_set_is_abstract_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::_set_is_abstract_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_get_is_custom_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::_get_is_custom_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_set_is_custom_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::_set_is_custom_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_get_is_truncatable_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::_get_is_truncatable_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::_set_is_truncatable_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::_set_is_truncatable_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::is_a_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::is_a_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::describe_value_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::describe_value_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_value_member_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::create_value_member_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_attribute_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::create_attribute_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ExtValueDef::create_operation_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::ValueDef * const impl = static_cast<POA_CORBA::ExtValueDef *> (servant);
+ POA_CORBA::ValueDef::create_operation_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueBoxDef::_get_def_kind_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ValueBoxDef *> (servant);
+ POA_CORBA::IRObject::_get_def_kind_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueBoxDef::destroy_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IRObject * const impl = static_cast<POA_CORBA::ValueBoxDef *> (servant);
+ POA_CORBA::IRObject::destroy_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueBoxDef::_get_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueBoxDef *> (servant);
+ POA_CORBA::Contained::_get_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueBoxDef::_set_id_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueBoxDef *> (servant);
+ POA_CORBA::Contained::_set_id_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueBoxDef::_get_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueBoxDef *> (servant);
+ POA_CORBA::Contained::_get_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueBoxDef::_set_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueBoxDef *> (servant);
+ POA_CORBA::Contained::_set_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueBoxDef::_get_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueBoxDef *> (servant);
+ POA_CORBA::Contained::_get_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueBoxDef::_set_version_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueBoxDef *> (servant);
+ POA_CORBA::Contained::_set_version_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueBoxDef::_get_defined_in_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueBoxDef *> (servant);
+ POA_CORBA::Contained::_get_defined_in_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueBoxDef::_get_absolute_name_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueBoxDef *> (servant);
+ POA_CORBA::Contained::_get_absolute_name_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueBoxDef::_get_containing_repository_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueBoxDef *> (servant);
+ POA_CORBA::Contained::_get_containing_repository_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueBoxDef::describe_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueBoxDef *> (servant);
+ POA_CORBA::Contained::describe_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_interface.cpp:1955
+
+ACE_INLINE
+void
+POA_CORBA::ValueBoxDef::move_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::Contained * const impl = static_cast<POA_CORBA::ValueBoxDef *> (servant);
+ POA_CORBA::Contained::move_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+ACE_INLINE
+void
+POA_CORBA::ValueBoxDef::_get_type_skel (
+ TAO_ServerRequest & server_request,
+ void * servant_upcall,
+ void * servant
+ ACE_ENV_ARG_DECL
+ )
+{
+ POA_CORBA::IDLType * const impl = static_cast<POA_CORBA::ValueBoxDef *> (servant);
+ POA_CORBA::IDLType::_get_type_skel (
+ server_request,
+ servant_upcall,
+ impl
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS_T.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS_T.cpp
new file mode 100644
index 00000000000..9bd6f99cb35
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS_T.cpp
@@ -0,0 +1,49 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:683
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_EXTENDEDS_T_CPP_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_EXTENDEDS_T_CPP_
+
+#include "IFR_ExtendedS_T.h"
+
+#if !defined (__ACE_INLINE__)
+#include "IFR_ExtendedS_T.inl"
+#endif /* !defined INLINE */
+
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#endif /* ifndef */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS_T.h b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS_T.h
new file mode 100644
index 00000000000..a66c2726183
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS_T.h
@@ -0,0 +1,2032 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:545
+
+#ifndef _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_EXTENDEDS_T_H_
+#define _TAO_IDL____ORBSVCS_ORBSVCS_IFRSERVICE_IFR_EXTENDEDS_T_H_
+
+#include /**/ "ace/pre.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_root/root_sth.cpp:116
+
+namespace POA_CORBA
+{
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class FixedDef_tie : public FixedDef
+ {
+ public:
+ /// the T& ctor
+ FixedDef_tie (T &t);
+ /// ctor taking a POA
+ FixedDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ FixedDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ FixedDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~FixedDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UShort digits (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void digits (
+ ::CORBA::UShort digits
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Short scale (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void scale (
+ ::CORBA::Short scale
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ FixedDef_tie (const FixedDef_tie &);
+ void operator= (const FixedDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ValueMemberDef_tie : public ValueMemberDef
+ {
+ public:
+ /// the T& ctor
+ ValueMemberDef_tie (T &t);
+ /// ctor taking a POA
+ ValueMemberDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ValueMemberDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ValueMemberDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ValueMemberDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::IDLType_ptr type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void type_def (
+ ::CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Visibility access (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void access (
+ ::CORBA::Visibility access
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ValueMemberDef_tie (const ValueMemberDef_tie &);
+ void operator= (const ValueMemberDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ValueDef_tie : public ValueDef
+ {
+ public:
+ /// the T& ctor
+ ValueDef_tie (T &t);
+ /// ctor taking a POA
+ ValueDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ValueDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ValueDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ValueDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDefSeq * supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void supported_interfaces (
+ const ::CORBA::InterfaceDefSeq & supported_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InitializerSeq * initializers (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void initializers (
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr base_value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void base_value (
+ ::CORBA::ValueDef_ptr base_value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDefSeq * abstract_base_values (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void abstract_base_values (
+ const ::CORBA::ValueDefSeq & abstract_base_values
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_abstract (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void is_abstract (
+ ::CORBA::Boolean is_abstract
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_custom (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void is_custom (
+ ::CORBA::Boolean is_custom
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_truncatable (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void is_truncatable (
+ ::CORBA::Boolean is_truncatable
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_a (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef::FullValueDescription * describe_value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueMemberDef_ptr create_value_member (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::Visibility access
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AttributeDef_ptr create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::OperationDef_ptr create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ValueDef_tie (const ValueDef_tie &);
+ void operator= (const ValueDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ExtValueDef_tie : public ExtValueDef
+ {
+ public:
+ /// the T& ctor
+ ExtValueDef_tie (T &t);
+ /// ctor taking a POA
+ ExtValueDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ExtValueDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ExtValueDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ExtValueDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained_ptr lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ContainedSeq * lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container::DescriptionSeq * describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ModuleDef_ptr create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ConstantDef_ptr create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::StructDef_ptr create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::UnionDef_ptr create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::EnumDef_ptr create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AliasDef_ptr create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDef_ptr create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueBoxDef_ptr create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExceptionDef_ptr create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::NativeDef_ptr create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AbstractInterfaceDef_ptr create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::LocalInterfaceDef_ptr create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef_ptr create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InterfaceDefSeq * supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void supported_interfaces (
+ const ::CORBA::InterfaceDefSeq & supported_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::InitializerSeq * initializers (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void initializers (
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef_ptr base_value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void base_value (
+ ::CORBA::ValueDef_ptr base_value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDefSeq * abstract_base_values (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void abstract_base_values (
+ const ::CORBA::ValueDefSeq & abstract_base_values
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_abstract (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void is_abstract (
+ ::CORBA::Boolean is_abstract
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_custom (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void is_custom (
+ ::CORBA::Boolean is_custom
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_truncatable (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void is_truncatable (
+ ::CORBA::Boolean is_truncatable
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Boolean is_a (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueDef::FullValueDescription * describe_value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ValueMemberDef_ptr create_value_member (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::Visibility access
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::AttributeDef_ptr create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::OperationDef_ptr create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtInitializerSeq * ext_initializers (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void ext_initializers (
+ const ::CORBA::ExtInitializerSeq & ext_initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtValueDef::ExtFullValueDescription * describe_ext_value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::ExtAttributeDef_ptr create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ExtValueDef_tie (const ExtValueDef_tie &);
+ void operator= (const ExtValueDef_tie &);
+ };
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_interface/tie_sh.cpp:87
+
+ // TIE class: Refer to CORBA v2.2, Section 20.34.4
+ template <class T>
+ class ValueBoxDef_tie : public ValueBoxDef
+ {
+ public:
+ /// the T& ctor
+ ValueBoxDef_tie (T &t);
+ /// ctor taking a POA
+ ValueBoxDef_tie (T &t, PortableServer::POA_ptr poa);
+ /// ctor taking pointer and an ownership flag
+ ValueBoxDef_tie (T *tp, ::CORBA::Boolean release = true);
+ /// ctor with T*, ownership flag and a POA
+ ValueBoxDef_tie (
+ T *tp,
+ PortableServer::POA_ptr poa,
+ ::CORBA::Boolean release = true
+ );
+ /// dtor
+
+ ~ValueBoxDef_tie (void);
+ // TIE specific functions
+ /// return the underlying object
+ T *_tied_object (void);
+ /// set the underlying object
+ void _tied_object (T &obj);
+ /// set the underlying object and the ownership flag
+ void _tied_object (T *obj, ::CORBA::Boolean release = true);
+ /// do we own it
+ ::CORBA::Boolean _is_owner (void);
+ /// set the ownership
+
+ void _is_owner ( ::CORBA::Boolean b);
+ // overridden ServantBase operations
+ PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * id (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void id (
+ const char * id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void name (
+ const char * name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * version (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void version (
+ const char * version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Container_ptr defined_in (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ char * absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Repository_ptr containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::Contained::Description * describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ ::CORBA::IDLType_ptr original_type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ // TAO_IDL - Generated from
+ // be\be_visitor_operation/tie_sh.cpp:60
+
+ void original_type_def (
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ));
+
+ private:
+ T *ptr_;
+ PortableServer::POA_var poa_;
+ ::CORBA::Boolean rel_;
+
+ // copy and assignment are not allowed
+ ValueBoxDef_tie (const ValueBoxDef_tie &);
+ void operator= (const ValueBoxDef_tie &);
+ };
+} // module CORBA
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:1322
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "IFR_ExtendedS_T.inl"
+#endif /* defined INLINE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "IFR_ExtendedS_T.cpp"
+#endif /* defined REQUIRED SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("IFR_ExtendedS_T.cpp")
+#endif /* defined REQUIRED PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* ifndef */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS_T.inl b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS_T.inl
new file mode 100644
index 00000000000..d50df786b6b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_ExtendedS_T.inl
@@ -0,0 +1,3342 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::FixedDef_tie<T>::FixedDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::FixedDef_tie<T>::FixedDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::FixedDef_tie<T>::FixedDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::FixedDef_tie<T>::FixedDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::FixedDef_tie<T>::~FixedDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::FixedDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::FixedDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::FixedDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::FixedDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::FixedDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::FixedDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->FixedDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::FixedDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::FixedDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::FixedDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UShort POA_CORBA::FixedDef_tie<T>::digits (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->digits (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::FixedDef_tie<T>::digits (
+ ::CORBA::UShort digits
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->digits (
+ digits
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Short POA_CORBA::FixedDef_tie<T>::scale (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->scale (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::FixedDef_tie<T>::scale (
+ ::CORBA::Short scale
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->scale (
+ scale
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ValueMemberDef_tie<T>::ValueMemberDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ValueMemberDef_tie<T>::ValueMemberDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ValueMemberDef_tie<T>::ValueMemberDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ValueMemberDef_tie<T>::ValueMemberDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ValueMemberDef_tie<T>::~ValueMemberDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ValueMemberDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ValueMemberDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ValueMemberDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ValueMemberDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ValueMemberDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ValueMemberDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ValueMemberDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ValueMemberDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueMemberDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ValueMemberDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueMemberDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ValueMemberDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueMemberDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ValueMemberDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueMemberDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ValueMemberDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ValueMemberDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ValueMemberDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ValueMemberDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueMemberDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ValueMemberDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::IDLType_ptr POA_CORBA::ValueMemberDef_tie<T>::type_def (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueMemberDef_tie<T>::type_def (
+ ::CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->type_def (
+ type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Visibility POA_CORBA::ValueMemberDef_tie<T>::access (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->access (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueMemberDef_tie<T>::access (
+ ::CORBA::Visibility access
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->access (
+ access
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ValueDef_tie<T>::ValueDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ValueDef_tie<T>::ValueDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ValueDef_tie<T>::ValueDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ValueDef_tie<T>::ValueDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ValueDef_tie<T>::~ValueDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ValueDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ValueDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ValueDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ValueDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ValueDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ValueDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ValueDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ValueDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::ValueDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ValueDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ValueDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::ValueDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::ValueDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::ValueDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::ValueDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::ValueDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::ValueDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::ValueDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::ValueDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ValueDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::ValueDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::ValueDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::ValueDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::ValueDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::ValueDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::ValueDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ValueDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ValueDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ValueDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ValueDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ValueDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ValueDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ValueDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ValueDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDefSeq * POA_CORBA::ValueDef_tie<T>::supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->supported_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueDef_tie<T>::supported_interfaces (
+ const ::CORBA::InterfaceDefSeq & supported_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->supported_interfaces (
+ supported_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InitializerSeq * POA_CORBA::ValueDef_tie<T>::initializers (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->initializers (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueDef_tie<T>::initializers (
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->initializers (
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ValueDef_tie<T>::base_value (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->base_value (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueDef_tie<T>::base_value (
+ ::CORBA::ValueDef_ptr base_value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->base_value (
+ base_value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDefSeq * POA_CORBA::ValueDef_tie<T>::abstract_base_values (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->abstract_base_values (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueDef_tie<T>::abstract_base_values (
+ const ::CORBA::ValueDefSeq & abstract_base_values
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->abstract_base_values (
+ abstract_base_values
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ValueDef_tie<T>::is_abstract (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_abstract (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueDef_tie<T>::is_abstract (
+ ::CORBA::Boolean is_abstract
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->is_abstract (
+ is_abstract
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ValueDef_tie<T>::is_custom (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_custom (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueDef_tie<T>::is_custom (
+ ::CORBA::Boolean is_custom
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->is_custom (
+ is_custom
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ValueDef_tie<T>::is_truncatable (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_truncatable (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueDef_tie<T>::is_truncatable (
+ ::CORBA::Boolean is_truncatable
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->is_truncatable (
+ is_truncatable
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ValueDef_tie<T>::is_a (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_a (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef::FullValueDescription * POA_CORBA::ValueDef_tie<T>::describe_value (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_value (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueMemberDef_ptr POA_CORBA::ValueDef_tie<T>::create_value_member (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::Visibility access
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_member (
+ id,
+ name,
+ version,
+ type,
+ access
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AttributeDef_ptr POA_CORBA::ValueDef_tie<T>::create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::OperationDef_ptr POA_CORBA::ValueDef_tie<T>::create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_operation (
+ id,
+ name,
+ version,
+ result,
+ mode,
+ params,
+ exceptions,
+ contexts
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtValueDef_tie<T>::ExtValueDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtValueDef_tie<T>::ExtValueDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtValueDef_tie<T>::ExtValueDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtValueDef_tie<T>::ExtValueDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ExtValueDef_tie<T>::~ExtValueDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ExtValueDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExtValueDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExtValueDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ExtValueDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ExtValueDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ExtValueDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ExtValueDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ExtValueDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtValueDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained_ptr POA_CORBA::ExtValueDef_tie<T>::lookup (
+ const char * search_name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup (
+ search_name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ExtValueDef_tie<T>::contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->contents (
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ContainedSeq * POA_CORBA::ExtValueDef_tie<T>::lookup_name (
+ const char * search_name,
+ ::CORBA::Long levels_to_search,
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->lookup_name (
+ search_name,
+ levels_to_search,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container::DescriptionSeq * POA_CORBA::ExtValueDef_tie<T>::describe_contents (
+ ::CORBA::DefinitionKind limit_type,
+ ::CORBA::Boolean exclude_inherited,
+ ::CORBA::Long max_returned_objs
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_contents (
+ limit_type,
+ exclude_inherited,
+ max_returned_objs
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ModuleDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_module (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_module (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ConstantDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_constant (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ const ::CORBA::Any & value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_constant (
+ id,
+ name,
+ version,
+ type,
+ value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::StructDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_struct (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_struct (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::UnionDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_union (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr discriminator_type,
+ const ::CORBA::UnionMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_union (
+ id,
+ name,
+ version,
+ discriminator_type,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::EnumDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_enum (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::EnumMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_enum (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AliasDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_alias (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_alias (
+ id,
+ name,
+ version,
+ original_type
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueBoxDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_value_box (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_box (
+ id,
+ name,
+ version,
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExceptionDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_exception (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::StructMemberSeq & members
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_exception (
+ id,
+ name,
+ version,
+ members
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::NativeDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_native (
+ const char * id,
+ const char * name,
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_native (
+ id,
+ name,
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AbstractInterfaceDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_abstract_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::AbstractInterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_abstract_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::LocalInterfaceDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_local_interface (
+ const char * id,
+ const char * name,
+ const char * version,
+ const ::CORBA::InterfaceDefSeq & base_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_local_interface (
+ id,
+ name,
+ version,
+ base_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_ext_value (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::Boolean is_custom,
+ ::CORBA::Boolean is_abstract,
+ ::CORBA::ValueDef_ptr base_value,
+ ::CORBA::Boolean is_truncatable,
+ const ::CORBA::ValueDefSeq & abstract_base_values,
+ const ::CORBA::InterfaceDefSeq & supported_interfaces,
+ const ::CORBA::ExtInitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_value (
+ id,
+ name,
+ version,
+ is_custom,
+ is_abstract,
+ base_value,
+ is_truncatable,
+ abstract_base_values,
+ supported_interfaces,
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtValueDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtValueDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtValueDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtValueDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtValueDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtValueDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ExtValueDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ExtValueDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ExtValueDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ExtValueDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtValueDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ExtValueDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InterfaceDefSeq * POA_CORBA::ExtValueDef_tie<T>::supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->supported_interfaces (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtValueDef_tie<T>::supported_interfaces (
+ const ::CORBA::InterfaceDefSeq & supported_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->supported_interfaces (
+ supported_interfaces
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::InitializerSeq * POA_CORBA::ExtValueDef_tie<T>::initializers (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->initializers (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtValueDef_tie<T>::initializers (
+ const ::CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->initializers (
+ initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef_ptr POA_CORBA::ExtValueDef_tie<T>::base_value (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->base_value (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtValueDef_tie<T>::base_value (
+ ::CORBA::ValueDef_ptr base_value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->base_value (
+ base_value
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDefSeq * POA_CORBA::ExtValueDef_tie<T>::abstract_base_values (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->abstract_base_values (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtValueDef_tie<T>::abstract_base_values (
+ const ::CORBA::ValueDefSeq & abstract_base_values
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->abstract_base_values (
+ abstract_base_values
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ExtValueDef_tie<T>::is_abstract (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_abstract (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtValueDef_tie<T>::is_abstract (
+ ::CORBA::Boolean is_abstract
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->is_abstract (
+ is_abstract
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ExtValueDef_tie<T>::is_custom (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_custom (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtValueDef_tie<T>::is_custom (
+ ::CORBA::Boolean is_custom
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->is_custom (
+ is_custom
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ExtValueDef_tie<T>::is_truncatable (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_truncatable (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtValueDef_tie<T>::is_truncatable (
+ ::CORBA::Boolean is_truncatable
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->is_truncatable (
+ is_truncatable
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Boolean POA_CORBA::ExtValueDef_tie<T>::is_a (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->is_a (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueDef::FullValueDescription * POA_CORBA::ExtValueDef_tie<T>::describe_value (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_value (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ValueMemberDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_value_member (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::Visibility access
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_value_member (
+ id,
+ name,
+ version,
+ type,
+ access
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::AttributeDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::OperationDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_operation (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr result,
+ ::CORBA::OperationMode mode,
+ const ::CORBA::ParDescriptionSeq & params,
+ const ::CORBA::ExceptionDefSeq & exceptions,
+ const ::CORBA::ContextIdSeq & contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_operation (
+ id,
+ name,
+ version,
+ result,
+ mode,
+ params,
+ exceptions,
+ contexts
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtInitializerSeq * POA_CORBA::ExtValueDef_tie<T>::ext_initializers (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->ext_initializers (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ExtValueDef_tie<T>::ext_initializers (
+ const ::CORBA::ExtInitializerSeq & ext_initializers
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->ext_initializers (
+ ext_initializers
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtValueDef::ExtFullValueDescription * POA_CORBA::ExtValueDef_tie<T>::describe_ext_value (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe_ext_value (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::ExtAttributeDef_ptr POA_CORBA::ExtValueDef_tie<T>::create_ext_attribute (
+ const char * id,
+ const char * name,
+ const char * version,
+ ::CORBA::IDLType_ptr type,
+ ::CORBA::AttributeMode mode,
+ const ::CORBA::ExceptionDefSeq & get_exceptions,
+ const ::CORBA::ExceptionDefSeq & set_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->create_ext_attribute (
+ id,
+ name,
+ version,
+ type,
+ mode,
+ get_exceptions,
+ set_exceptions
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_interface/tie_si.cpp:96
+
+template <class T> ACE_INLINE
+POA_CORBA::ValueBoxDef_tie<T>::ValueBoxDef_tie (T &t)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ValueBoxDef_tie<T>::ValueBoxDef_tie (T &t, PortableServer::POA_ptr poa)
+ : ptr_ (&t),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (0)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ValueBoxDef_tie<T>::ValueBoxDef_tie (T *tp, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_nil ()),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ValueBoxDef_tie<T>::ValueBoxDef_tie (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)
+ : ptr_ (tp),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ rel_ (release)
+{}
+
+template <class T> ACE_INLINE
+POA_CORBA::ValueBoxDef_tie<T>::~ValueBoxDef_tie (void)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+}
+
+template <class T> ACE_INLINE T *
+POA_CORBA::ValueBoxDef_tie<T>::_tied_object (void)
+{
+ return this->ptr_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ValueBoxDef_tie<T>::_tied_object (T &obj)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = &obj;
+ this->rel_ = 0;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ValueBoxDef_tie<T>::_tied_object (T *obj, ::CORBA::Boolean release)
+{
+ if (this->rel_)
+ {
+ delete this->ptr_;
+ }
+
+ this->ptr_ = obj;
+ this->rel_ = release;
+}
+
+template <class T> ACE_INLINE ::CORBA::Boolean
+POA_CORBA::ValueBoxDef_tie<T>::_is_owner (void)
+{
+ return this->rel_;
+}
+
+template <class T> ACE_INLINE void
+POA_CORBA::ValueBoxDef_tie<T>::_is_owner ( ::CORBA::Boolean b)
+{
+ this->rel_ = b;
+}
+
+template <class T> ACE_INLINE PortableServer::POA_ptr
+POA_CORBA::ValueBoxDef_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (! ::CORBA::is_nil (this->poa_.in ()))
+ {
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+ }
+
+ return this->ValueBoxDef::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::DefinitionKind POA_CORBA::ValueBoxDef_tie<T>::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->def_kind (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueBoxDef_tie<T>::destroy (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->destroy (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ValueBoxDef_tie<T>::id (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->id (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueBoxDef_tie<T>::id (
+ const char * id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->id (
+ id
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ValueBoxDef_tie<T>::name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueBoxDef_tie<T>::name (
+ const char * name
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->name (
+ name
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ValueBoxDef_tie<T>::version (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->version (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueBoxDef_tie<T>::version (
+ const char * version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->version (
+ version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Container_ptr POA_CORBA::ValueBoxDef_tie<T>::defined_in (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->defined_in (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+char * POA_CORBA::ValueBoxDef_tie<T>::absolute_name (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->absolute_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Repository_ptr POA_CORBA::ValueBoxDef_tie<T>::containing_repository (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->containing_repository (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::Contained::Description * POA_CORBA::ValueBoxDef_tie<T>::describe (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->describe (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueBoxDef_tie<T>::move (
+ ::CORBA::Container_ptr new_container,
+ const char * new_name,
+ const char * new_version
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->move (
+ new_container,
+ new_name,
+ new_version
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::TypeCode_ptr POA_CORBA::ValueBoxDef_tie<T>::type (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->type (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+::CORBA::IDLType_ptr POA_CORBA::ValueBoxDef_tie<T>::original_type_def (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ return this->ptr_->original_type_def (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_operation/tie_si.cpp:101
+
+template <class T> ACE_INLINE
+void POA_CORBA::ValueBoxDef_tie<T>::original_type_def (
+ ::CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ ::CORBA::SystemException
+ ))
+{
+ this->ptr_->original_type_def (
+ original_type_def
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Loader.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Loader.cpp
new file mode 100644
index 00000000000..a5e914dcf87
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Loader.cpp
@@ -0,0 +1,100 @@
+// $Id$
+
+// ================================================================
+// DESCRIPTION
+// This class allows for dynamically loading
+// the IFR Service.
+//
+// AUTHORS
+// Jaiganesh Balasubramanian <jai@doc.ece.uci.edu>
+// Priyanka Gontla <pgontla@ece.uci.edu>
+// ================================================================
+
+#include "orbsvcs/IFRService/IFR_Service_Loader.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/Argv_Type_Converter.h"
+
+ACE_RCSID (IFR_Service,
+ IFR_Service_Loader,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_IFR_Service_Loader::TAO_IFR_Service_Loader (void)
+{
+ // Constructor
+}
+
+TAO_IFR_Service_Loader::~TAO_IFR_Service_Loader (void)
+{
+ // Destructor
+}
+
+int
+TAO_IFR_Service_Loader::init (int argc,
+ ACE_TCHAR *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Copy command line parameter.
+ ACE_Argv_Type_Converter command_line (argc,
+ argv);
+
+ // Initialize the ORB
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (command_line.get_argc (),
+ command_line.get_ASCII_argv (),
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This function call initializes the IFR_Service Service
+ CORBA::Object_var object =
+ this->create_object (orb.in (),
+ command_line.get_argc (),
+ command_line.get_TCHAR_argv ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // @@ Should we log this???
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+TAO_IFR_Service_Loader::fini (void)
+{
+ // Remove the IFR_Service Service.
+ return this->ifr_server_.fini ();
+}
+
+CORBA::Object_ptr
+TAO_IFR_Service_Loader::create_object (CORBA::ORB_ptr orb,
+ int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ int result;
+
+ // Initializes the IFR_Service Service. Returns -1
+ // on an error.
+ result = this->ifr_server_.init_with_orb (argc,
+ argv,
+ orb);
+ if (result == -1)
+ {
+ return CORBA::Object::_nil ();
+ }
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_IFRService, TAO_IFR_Service_Loader)
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Loader.h b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Loader.h
new file mode 100644
index 00000000000..4ed289fb58b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Loader.h
@@ -0,0 +1,76 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ===========================================================================
+// FILENAME
+// IFR_Service_Loader.h
+//
+// DESCRIPTION
+// This class loads the IFR Service dynamically
+// either from svc.conf file or <string_to_object> call.
+//
+// AUTHORS
+// Jaiganesh Balasubramanian <jai@doc.ece.uci.edu>
+// Priyanka Gontla <pgontla@ece.uci.edu>
+//
+// ===========================================================================
+
+#ifndef TAO_IFR_SERVICE_LOADER_H
+#define TAO_IFR_SERVICE_LOADER_H
+
+#include "tao/Object_Loader.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_IFR_Service_Loader : public TAO_Object_Loader
+{
+public:
+
+ // Constructor
+ TAO_IFR_Service_Loader (void);
+
+ // Destructor
+ ~TAO_IFR_Service_Loader (void);
+
+ // Called by the Service Configurator framework to initialize the
+ // Event Service. Defined in <ace/Service_Config.h>
+ virtual int init (int argc, ACE_TCHAR *argv[]);
+
+ // Called by the Service Configurator framework to remove the
+ // Event Service. Defined in <ace/Service_Config.h>
+ virtual int fini (void);
+
+ // This function call initializes the IFR Service given a reference to the
+ // ORB and the command line parameters.
+ virtual CORBA::Object_ptr create_object (CORBA::ORB_ptr orb,
+ int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+protected:
+ TAO_IFR_Server ifr_server_;
+ // Instance of the TAO_IFR_Server
+
+private:
+
+ // Disallowing copying/assignment.
+ TAO_IFR_Service_Loader (const TAO_IFR_Service_Loader &);
+ TAO_IFR_Service_Loader & operator= (const TAO_IFR_Service_Loader &);
+
+};
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DECLARE (TAO_IFRService, TAO_IFR_Service_Loader)
+
+#endif /* TAO_IFR_SERVICE_LOADER_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp
new file mode 100644
index 00000000000..492f0aaad44
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp
@@ -0,0 +1,1445 @@
+// $Id$
+
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/Container_i.h"
+#include "orbsvcs/IFRService/Contained_i.h"
+#include "orbsvcs/IFRService/ComponentRepository_i.h"
+#include "orbsvcs/IFRService/Options.h"
+#include "orbsvcs/IFRService/IFR_ComponentsS.h"
+#include "orbsvcs/IOR_Multicast.h"
+#include "tao/IORTable/IORTable.h"
+#include "tao/ORB_Core.h"
+#include "tao/default_ports.h"
+#include "tao/PortableServer/Root_POA.h"
+#include "tao/Stub.h"
+#include "tao/Profile.h"
+#include "tao/AnyTypeCode/ValueModifierC.h"
+#include "ace/Auto_Ptr.h"
+
+ACE_RCSID (IFR_Service,
+ IFR_Service,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Repository_i *TAO_IFR_Service_Utils::repo_ = 0;
+
+TAO_IFR_Server::TAO_IFR_Server (void)
+ : //servant_locator_impl_ (0),
+ ior_multicast_ (0),
+ config_ (0)
+{
+}
+
+TAO_IFR_Server::~TAO_IFR_Server (void)
+{
+ // Get reactor instance from TAO.
+ ACE_Reactor *reactor = this->orb_->orb_core ()->reactor ();
+
+ if ( this->ior_multicast_ )
+ {
+ // Remove event handler for the ior multicast.
+ if (reactor->remove_handler (this->ior_multicast_,
+ ACE_Event_Handler::READ_MASK)
+ == -1)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("Interface Repository: cannot remove handler\n")
+ ));
+ }
+ }
+
+ delete this->config_;
+ delete this->ior_multicast_;
+}
+
+int
+TAO_IFR_Server::init_with_orb (int argc,
+ ACE_TCHAR *argv [],
+ CORBA::ORB_ptr orb,
+ int use_multicast_server)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Duplicate the ORB.
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+
+ // Get the POA from the ORB.
+ 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,
+ ACE_TEXT ("(%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;
+
+ int retval = OPTIONS::instance ()->parse_args (argc,
+ argv);
+
+ if (retval != 0)
+ {
+ return retval;
+ }
+
+ retval = this->create_poa (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (retval != 0)
+ {
+ return retval;
+ }
+
+ retval = this->open_config (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (retval != 0)
+ {
+ return retval;
+ }
+
+ retval = this->create_repository (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (retval != 0)
+ {
+ return retval;
+ }
+
+ if (use_multicast_server
+ || OPTIONS::instance()->support_multicast_discovery ())
+ {
+ retval =
+ this->init_multicast_server (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (retval != 0)
+ {
+ return retval;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "IFR_Service::init");
+
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+TAO_IFR_Server::fini (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->root_poa_->destroy (1,
+ 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_IFR_Server::fini");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+TAO_IFR_Server::create_poa (ACE_ENV_SINGLE_ARG_DECL)
+{
+ PortableServer::POAManager_var poa_manager =
+ this->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);
+
+ CORBA::PolicyList policies (5);
+ policies.length (5);
+
+ // ID Assignment Policy.
+ policies[0] =
+ this->root_poa_->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Lifespan Policy.
+ policies[1] =
+ this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Request Processing Policy.
+ policies[2] =
+ this->root_poa_->create_request_processing_policy (
+ PortableServer::USE_DEFAULT_SERVANT
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (-1);
+
+ // Servant Retention Policy.
+ policies[3] =
+ this->root_poa_->create_servant_retention_policy (
+ PortableServer::NON_RETAIN
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (-1);
+
+ // Id Uniqueness Policy.
+ policies[4] =
+ this->root_poa_->create_id_uniqueness_policy (
+ PortableServer::MULTIPLE_ID
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (-1);
+
+ this->repo_poa_ =
+ this->root_poa_->create_POA ("repoPOA",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ policies[0]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+TAO_IFR_Server::open_config (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (OPTIONS::instance ()->using_registry ())
+ {
+#if defined (ACE_WIN32)
+ HKEY root =
+ ACE_Configuration_Win32Registry::resolve_key (
+ HKEY_LOCAL_MACHINE,
+ "Software\\TAO\\IFR"
+ );
+
+ ACE_NEW_THROW_EX (this->config_,
+ ACE_Configuration_Win32Registry (root),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (-1);
+#endif /* ACE_WIN32 */
+
+ return 0;
+ }
+ else
+ {
+ ACE_Configuration_Heap *heap = 0;
+ ACE_NEW_THROW_EX (heap,
+ ACE_Configuration_Heap,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (-1);
+
+ if (OPTIONS::instance ()->persistent ())
+ {
+ const char *filename = OPTIONS::instance ()->persistent_file ();
+
+ if (heap->open (filename))
+ {
+ delete heap;
+ heap = 0;
+
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("Error:: Opening persistent heap file '%s'\n"),
+ filename
+ ),
+ -1
+ );
+ }
+ }
+ else
+ {
+ heap->open ();
+ }
+
+ this->config_ = heap;
+
+ return 0;
+ }
+}
+
+int
+TAO_IFR_Server::create_repository (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_ComponentRepository_i *impl = 0;
+ ACE_NEW_THROW_EX (
+ impl,
+ TAO_ComponentRepository_i (
+ this->orb_.in (),
+ this->root_poa_,
+ this->config_
+ ),
+ CORBA::NO_MEMORY ()
+ );
+ ACE_CHECK_RETURN (-1);
+
+ auto_ptr<TAO_ComponentRepository_i> safety (impl);
+ TAO_IFR_Service_Utils::repo_ = impl;
+
+ POA_CORBA::ComponentIR::Repository_tie<TAO_ComponentRepository_i> *impl_tie
+ = 0;
+
+ ACE_NEW_THROW_EX (
+ impl_tie,
+ POA_CORBA::ComponentIR::Repository_tie<TAO_ComponentRepository_i> (
+ impl,
+ this->repo_poa_,
+ 1
+ ),
+ CORBA::NO_MEMORY ()
+ );
+ ACE_CHECK_RETURN (-1);
+
+ PortableServer::ServantBase_var tie_safety (impl_tie);
+ safety.release ();
+
+ this->repo_poa_->set_servant (impl_tie
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ PortableServer::ObjectId_var oid =
+ PortableServer::string_to_ObjectId ("");
+
+ CORBA::Object_var obj =
+ this->repo_poa_->create_reference_with_id (
+ oid.in (),
+ "IDL:omg.org/CORBA/ComponentIR/ComponentRepository:1.0"
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::Repository_ptr repo_ref =
+ CORBA::Repository::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Initialize the repository.
+ int status = impl->repo_init (repo_ref,
+ this->repo_poa_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ // Save and output the IOR string.
+ this->ifr_ior_ =
+ this->orb_->object_to_string (repo_ref
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::Object_var table_object =
+ this->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_RETURN ((LM_ERROR, "Nil IORTable\n"), -1);
+ }
+ else
+ {
+ adapter->bind ("InterfaceRepository",
+ this->ifr_ior_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ // Add the repository to the ORB's table of initialized object references.
+ this->orb_->register_initial_reference ("InterfaceRepository",
+ repo_ref
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ FILE *output_file_ =
+ ACE_OS::fopen (OPTIONS::instance()->ior_output_file (),
+ "w");
+
+ ACE_OS::fprintf (output_file_,
+ "%s",
+ this->ifr_ior_.in ());
+
+ ACE_OS::fclose (output_file_);
+
+ return 0;
+}
+
+// Install ior multicast handler.
+int
+TAO_IFR_Server::init_multicast_server (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Get reactor instance from TAO.
+ ACE_Reactor *reactor = this->orb_->orb_core ()->reactor ();
+
+#if defined (ACE_HAS_IP_MULTICAST)
+
+ // See if the -ORBMulticastDiscoveryEndpoint option was specified.
+ ACE_CString mde (
+ TAO_ORB_Core_instance ()->orb_params ()->mcast_discovery_endpoint ()
+ );
+
+ // First, see if the user has given us a multicast port number
+ // on the command-line;
+ u_short port =
+ TAO_ORB_Core_instance ()->orb_params ()->service_port (
+ TAO::MCAST_INTERFACEREPOSERVICE
+ );
+
+ if (port == 0)
+ {
+ // Check environment var. for multicast port.
+ const char *port_number =
+ ACE_OS::getenv ("InterfaceRepoServicePort");
+
+ if (port_number != 0)
+ port = static_cast<u_short> (ACE_OS::atoi (port_number));
+ }
+
+ // Port wasn't specified on the command-line or in environment -
+ // use the default.
+ if (port == 0)
+ port = TAO_DEFAULT_INTERFACEREPO_SERVER_REQUEST_PORT;
+
+ // Instantiate a handler which will handle client requests for
+ // the IFR ior, received on the multicast port.
+ ACE_NEW_THROW_EX (this->ior_multicast_,
+ TAO_IOR_Multicast (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (-1);
+
+ if (mde.length () != 0)
+ {
+ if (this->ior_multicast_->init (this->ifr_ior_.in (),
+ mde.c_str (),
+ TAO_SERVICEID_INTERFACEREPOSERVICE)
+ == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("Interface Repository: cannot initialize ")
+ ACE_TEXT ("multicast event handler\n")
+ ),
+ -1
+ );
+ }
+ }
+ else
+ {
+ if (this->ior_multicast_->init (this->ifr_ior_.in (),
+ port,
+ ACE_DEFAULT_MULTICAST_ADDR,
+ TAO_SERVICEID_INTERFACEREPOSERVICE)
+ == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("Interface Repository: cannot initialize ")
+ ACE_TEXT ("multicast event handler\n")
+ ),
+ -1
+ );
+ }
+ }
+
+ // Register event handler for the ior multicast.
+ if (reactor->register_handler (this->ior_multicast_,
+ ACE_Event_Handler::READ_MASK)
+ == -1)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("Interface Repository: cannot register ")
+ ACE_TEXT ("multicast event handler\n")
+ ),
+ -1
+ );
+ }
+
+#endif /* ACE_HAS_IP_MULTICAST */
+
+ return 0;
+}
+
+TAO_IFR_Service_Utils::TAO_IFR_Service_Utils (void)
+{
+}
+
+TAO_IFR_Service_Utils::~TAO_IFR_Service_Utils (void)
+{
+}
+
+ACE_Configuration_Section_Key
+TAO_IFR_Service_Utils::tmp_key_;
+
+char *
+TAO_IFR_Service_Utils::int_to_string (CORBA::ULong number)
+{
+ static char hex_string[9];
+ ACE_OS::sprintf (hex_string,
+ "%8.8X",
+ number);
+ hex_string[8] = '\0';
+ return hex_string;
+}
+
+void
+TAO_IFR_Service_Utils::valid_container (
+ CORBA::DefinitionKind container_kind,
+ CORBA::DefinitionKind contained_kind
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ int error_flag = 0;
+
+ switch (container_kind)
+ {
+ case CORBA::dk_Repository:
+ case CORBA::dk_Module:
+ break;
+ case CORBA::dk_Exception:
+ case CORBA::dk_Struct:
+ case CORBA::dk_Union:
+ switch (contained_kind)
+ {
+ case CORBA::dk_Struct:
+ case CORBA::dk_Union:
+ case CORBA::dk_Enum:
+ break;
+ default:
+ error_flag = 1;
+ break;
+ }
+ break;
+ case CORBA::dk_Value:
+ case CORBA::dk_Interface:
+ case CORBA::dk_AbstractInterface:
+ case CORBA::dk_LocalInterface:
+ case CORBA::dk_Home:
+ switch (contained_kind)
+ {
+ case CORBA::dk_Module:
+ case CORBA::dk_Interface:
+ case CORBA::dk_Value:
+ error_flag = 1;
+ break;
+ default:
+ break;
+ }
+ break;
+ case CORBA::dk_Component:
+ switch (contained_kind)
+ {
+ case CORBA::dk_Provides:
+ case CORBA::dk_Uses:
+ case CORBA::dk_Emits:
+ case CORBA::dk_Publishes:
+ case CORBA::dk_Consumes:
+ case CORBA::dk_Attribute:
+ break;
+ default:
+ error_flag = 1;
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (error_flag == 1)
+ {
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 4,
+ CORBA::COMPLETED_NO));
+ }
+}
+
+void
+TAO_IFR_Service_Utils::pre_exist (
+ const char *id,
+ name_clash_checker checker,
+ ACE_Configuration_Section_Key &key,
+ TAO_Repository_i *repo,
+ CORBA::DefinitionKind kind
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Service_Utils::id_exists (id,
+ repo
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_IFR_Service_Utils::name_exists (checker,
+ key,
+ repo,
+ kind
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_IFR_Service_Utils::id_exists (const char *id,
+ TAO_Repository_i *repo
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // The repo id must not already exist.
+ ACE_TString holder;
+ if (repo->config ()->get_string_value (repo->repo_ids_key (),
+ id,
+ holder)
+ == 0)
+ {
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 2,
+ CORBA::COMPLETED_NO));
+ }
+}
+
+void
+TAO_IFR_Service_Utils::name_exists (
+ name_clash_checker checker,
+ ACE_Configuration_Section_Key &key,
+ TAO_Repository_i *repo,
+ CORBA::DefinitionKind kind
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ int status = 0;
+ ACE_TString section_name;
+ u_int count = 0;
+ char *stringified = 0;
+
+ // Check the members defined elsewhere, if any.
+ ACE_Configuration_Section_Key refs_key;
+ status =
+ repo->config ()->open_section (key,
+ "refs",
+ 0,
+ refs_key);
+
+ if (status == 0)
+ {
+ repo->config ()->get_integer_value (refs_key,
+ "count",
+ count);
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ ACE_Configuration_Section_Key member_key;
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+
+ repo->config ()->open_section (refs_key,
+ stringified,
+ 0,
+ member_key);
+
+ ACE_TString member_name;
+ repo->config ()->get_string_value (member_key,
+ "name",
+ member_name);
+
+ if ((*checker) (member_name.fast_rep ()) != 0)
+ {
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 3,
+ CORBA::COMPLETED_NO));
+ }
+ }
+ }
+
+ // Check the members defined in this scope, if any.
+ ACE_Configuration_Section_Key defns_key;
+ status =
+ repo->config ()->open_section (key,
+ "defns",
+ 0,
+ defns_key);
+ if (status == 0)
+ {
+ repo->config ()->get_integer_value (defns_key,
+ "count",
+ count);
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ ACE_Configuration_Section_Key defn_key;
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+
+ repo->config ()->open_section (defns_key,
+ stringified,
+ 0,
+ defn_key);
+
+ ACE_TString defn_name;
+ repo->config ()->get_string_value (defn_key,
+ "name",
+ defn_name);
+
+ if ((*checker) (defn_name.fast_rep ()) != 0)
+ {
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 3,
+ CORBA::COMPLETED_NO));
+ }
+ }
+ }
+
+ if (kind == CORBA::dk_Interface
+ || kind == CORBA::dk_Component)
+ {
+ TAO_IFR_Service_Utils::check_subsection (checker,
+ "attrs",
+ repo->config (),
+ key
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (kind == CORBA::dk_Interface)
+ {
+ TAO_IFR_Service_Utils::check_subsection (checker,
+ "ops",
+ repo->config (),
+ key
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (kind == CORBA::dk_Component)
+ {
+ TAO_IFR_Service_Utils::check_subsection (checker,
+ "provides",
+ repo->config (),
+ key
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_IFR_Service_Utils::check_subsection (checker,
+ "uses",
+ repo->config (),
+ key
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_IFR_Service_Utils::check_subsection (checker,
+ "emits",
+ repo->config (),
+ key
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_IFR_Service_Utils::check_subsection (checker,
+ "publishes",
+ repo->config (),
+ key
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_IFR_Service_Utils::check_subsection (checker,
+ "consumes",
+ repo->config (),
+ key
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_IFR_Service_Utils::check_subsection (
+ TAO_IFR_Service_Utils::name_clash_checker checker,
+ const char *sub_section,
+ ACE_Configuration *config,
+ ACE_Configuration_Section_Key &key
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Configuration_Section_Key sub_key;
+ int status =
+ config->open_section (key,
+ sub_section,
+ 0,
+ sub_key);
+
+ if (status != 0)
+ {
+ return;
+ }
+
+ CORBA::ULong count = 0;
+ config->get_integer_value (sub_key,
+ "count",
+ count);
+
+ ACE_Configuration_Section_Key entry_key;
+ ACE_TString entry_name;
+ char *stringified = 0;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ config->open_section (sub_key,
+ stringified,
+ 0,
+ entry_key);
+ config->get_string_value (entry_key,
+ "name",
+ entry_name);
+
+ if ((*checker) (entry_name.fast_rep ()) != 0)
+ {
+ ACE_THROW (CORBA::BAD_PARAM (3,
+ CORBA::COMPLETED_NO));
+ return;
+ }
+ }
+}
+
+void
+TAO_IFR_Service_Utils::valid_creation (
+ CORBA::DefinitionKind container_kind,
+ CORBA::DefinitionKind contained_kind,
+ const char *id,
+ name_clash_checker checker,
+ ACE_Configuration_Section_Key &key,
+ TAO_Repository_i *repo
+ ACE_ENV_ARG_DECL
+ )
+{
+ TAO_IFR_Service_Utils::valid_container (container_kind,
+ contained_kind
+ ACE_ENV_ARG_PARAMETER);
+
+ TAO_IFR_Service_Utils::pre_exist (id,
+ checker,
+ key,
+ repo,
+ container_kind
+ ACE_ENV_ARG_PARAMETER);
+}
+
+ACE_TString
+TAO_IFR_Service_Utils::create_common (
+ CORBA::DefinitionKind container_kind,
+ CORBA::DefinitionKind contained_kind,
+ ACE_Configuration_Section_Key container_key,
+ ACE_Configuration_Section_Key &new_key,
+ TAO_Repository_i *repo,
+ const char *id,
+ const char *name,
+ TAO_IFR_Service_Utils::name_clash_checker checker,
+ const char *version,
+ const char *sub_section_name
+ ACE_ENV_ARG_DECL
+ )
+{
+ ACE_TString path;
+
+ // No need for a return value, every error we check for will throw
+ // one of the BAD_PARAM versions if it is discovered.
+ TAO_IFR_Service_Utils::valid_creation (container_kind,
+ contained_kind,
+ id,
+ checker,
+ container_key,
+ repo
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (path);
+
+ ACE_Configuration *config = repo->config ();
+
+ // Create new section, or open if it already exists.
+ ACE_Configuration_Section_Key sub_key;
+ config->open_section (container_key,
+ sub_section_name,
+ 1,
+ sub_key);
+
+ u_int defn_count = 0;
+
+ // If we have a count, it gets set, if not, it stays 0.
+ config->get_integer_value (sub_key,
+ "count",
+ defn_count);
+
+ char *section_name =
+ TAO_IFR_Service_Utils::int_to_string (defn_count);
+ config->open_section (sub_key,
+ section_name,
+ 1,
+ new_key);
+
+ // Increment the count.
+ config->set_integer_value (sub_key,
+ "count",
+ defn_count + 1);
+
+ config->get_integer_value (sub_key,
+ "count",
+ defn_count);
+
+ // Set the name attribute.
+ config->set_string_value (new_key,
+ "name",
+ name);
+
+ // Set the id attribute.
+ config->set_string_value (new_key,
+ "id",
+ id);
+
+ // Set the version attribute.
+ config->set_string_value (new_key,
+ "version",
+ version);
+
+ // Set the definition kind.
+ config->set_integer_value (new_key,
+ "def_kind",
+ contained_kind);
+
+ // Get the container's absolute name, append the new name,
+ // and set it in the new section.
+ ACE_TString absolute_name;
+ config->get_string_value (container_key,
+ "absolute_name",
+ absolute_name);
+
+ absolute_name += "::";
+ absolute_name += name;
+
+ config->set_string_value (new_key,
+ "absolute_name",
+ absolute_name);
+
+ // Get the container's path.
+ ACE_TString container_id;
+ config->get_string_value (container_key,
+ "id",
+ container_id);
+
+ config->set_string_value (new_key,
+ "container_id",
+ container_id);
+
+ if (container_id == "") // This Container is the Repository.
+ {
+ path = "";
+ }
+ else
+ {
+ config->get_string_value (repo->repo_ids_key (),
+ container_id.c_str (),
+ path);
+
+ path += '\\';
+ }
+
+ path += sub_section_name;
+ path += '\\';
+ path += section_name;
+
+ // Store our path under our global repo id for fast lookup.
+ config->set_string_value (repo->repo_ids_key (),
+ id,
+ path);
+
+ return path;
+}
+
+void
+TAO_IFR_Service_Utils::set_exceptions (
+ ACE_Configuration *config,
+ ACE_Configuration_Section_Key &key,
+ const char *sub_section,
+ const CORBA::ExceptionDefSeq &exceptions
+ )
+{
+ CORBA::ULong length = exceptions.length ();
+
+ if (length == 0)
+ {
+ return;
+ }
+
+ // Create new subsection because we are either creating a new entry
+ // or are calling from a mutator which has already removed the old one.
+ ACE_Configuration_Section_Key excepts_key;
+ config->open_section (key,
+ sub_section,
+ 1,
+ excepts_key);
+
+ config->set_integer_value (excepts_key,
+ "count",
+ length);
+
+ char *type_path = 0;
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ type_path =
+ TAO_IFR_Service_Utils::reference_to_path (exceptions[i]);
+
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ config->set_string_value (excepts_key,
+ stringified,
+ type_path);
+ }
+}
+
+CORBA::TypeCode_ptr
+TAO_IFR_Service_Utils::gen_valuetype_tc_r (
+ ACE_Configuration_Section_Key &key,
+ TAO_Repository_i *repo
+ ACE_ENV_ARG_DECL
+ )
+{
+ ACE_TString name;
+ repo->config ()->get_string_value (key,
+ "name",
+ name);
+ ACE_TString id;
+ repo->config ()->get_string_value (key,
+ "id",
+ id);
+ CORBA::ValueModifier tm = CORBA::VM_NONE;
+ CORBA::ULong is_it = 0;
+
+ repo->config ()->get_integer_value (key,
+ "is_abstract",
+ is_it);
+
+ if (is_it)
+ {
+ tm = CORBA::VM_ABSTRACT;
+ }
+ else
+ {
+ repo->config ()->get_integer_value (key,
+ "is_custom",
+ is_it);
+
+ if (is_it)
+ {
+ tm = CORBA::VM_CUSTOM;
+ }
+ else
+ {
+ repo->config ()->get_integer_value (key,
+ "is_truncatable",
+ is_it);
+
+ if (is_it)
+ {
+ tm = CORBA::VM_TRUNCATABLE;
+ }
+ }
+ }
+
+ ACE_TString base_id;
+ int status =
+ repo->config ()->get_string_value (key,
+ "base_value",
+ base_id);
+ CORBA::TypeCode_var base_tc = CORBA::TypeCode::_nil ();
+
+ if (status == 0)
+ {
+ ACE_TString base_path;
+ repo->config ()->get_string_value (repo->repo_ids_key (),
+ base_id.fast_rep (),
+ base_path);
+ ACE_Configuration_Section_Key base_key;
+ repo->config ()->expand_path (repo->root_key (),
+ base_path,
+ base_key,
+ 0);
+ base_tc =
+ TAO_IFR_Service_Utils::gen_valuetype_tc_r (base_key,
+ repo
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+ }
+
+ CORBA::ValueMemberSeq vm_seq;
+ vm_seq.length (0);
+ TAO_IFR_Service_Utils::fill_valuemember_seq (vm_seq,
+ key,
+ repo
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return
+ repo->tc_factory ()->create_value_tc (id.c_str (),
+ name.c_str (),
+ tm,
+ base_tc.in (),
+ vm_seq
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_IFR_Service_Utils::fill_valuemember_seq (
+ CORBA::ValueMemberSeq &vm_seq,
+ ACE_Configuration_Section_Key &key,
+ TAO_Repository_i *repo
+ ACE_ENV_ARG_DECL
+ )
+{
+ ACE_Configuration_Section_Key members_key;
+ int status =
+ repo->config ()->open_section (key,
+ "members",
+ 0,
+ members_key);
+
+ if (status != 0)
+ {
+ vm_seq.length (0);
+ return;
+ }
+
+ CORBA::ULong count = 0;
+ repo->config ()->get_integer_value (members_key,
+ "count",
+ count);
+ vm_seq.length (count);
+ char *stringified = 0;
+ ACE_Configuration_Section_Key member_key, type_key;
+ ACE_TString holder;
+ CORBA::ULong access = 0;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ repo->config ()->open_section (members_key,
+ stringified,
+ 0,
+ member_key);
+ repo->config ()->get_string_value (member_key,
+ "name",
+ holder);
+ vm_seq[i].name = holder.fast_rep ();
+ repo->config ()->get_string_value (member_key,
+ "id",
+ holder);
+ vm_seq[i].id = holder.fast_rep ();
+ repo->config ()->get_string_value (key,
+ "id",
+ holder);
+ vm_seq[i].defined_in = holder.fast_rep ();
+ repo->config ()->get_string_value (member_key,
+ "version",
+ holder);
+ vm_seq[i].version = holder.fast_rep ();
+ repo->config ()->get_string_value (member_key,
+ "type_path",
+ holder);
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (holder,
+ repo);
+ vm_seq[i].type = impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ repo->config ()->get_integer_value (member_key,
+ "access",
+ access);
+ vm_seq[i].access = static_cast<CORBA::Visibility> (access);
+ }
+}
+
+char *
+TAO_IFR_Service_Utils::reference_to_path (CORBA::IRObject_ptr obj)
+{
+ PortableServer::ObjectId object_id;
+ TAO::ObjectKey object_key =
+ obj->_stubobj ()->profile_in_use ()->object_key ();
+ int status = TAO_Root_POA::parse_ir_object_key (object_key,
+ object_id);
+ if (status != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "reference_to_path - parse_ir_object_key failed\n"));
+ return 0;
+ }
+
+ return TAO_IFR_Service_Utils::oid_to_string (object_id);
+}
+
+CORBA::DefinitionKind
+TAO_IFR_Service_Utils::path_to_def_kind (ACE_TString &path,
+ TAO_Repository_i *repo)
+{
+ int status =
+ repo->config ()->expand_path (repo->root_key (),
+ path,
+ TAO_IFR_Service_Utils::tmp_key_,
+ 0);
+
+ if (status != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "path_to_def_kind - bad path: '%s'\n",
+ path.c_str ()));
+ return CORBA::dk_none;
+ }
+
+ u_int kind = 0;
+ repo->config ()->get_integer_value (TAO_IFR_Service_Utils::tmp_key_,
+ "def_kind",
+ kind);
+ return static_cast<CORBA::DefinitionKind> (kind);
+}
+
+CORBA::DefinitionKind
+TAO_IFR_Service_Utils::reference_to_def_kind (CORBA::IRObject_ptr obj,
+ TAO_Repository_i *repo)
+{
+ ACE_TString path (TAO_IFR_Service_Utils::reference_to_path (obj));
+ return TAO_IFR_Service_Utils::path_to_def_kind (path, repo);
+}
+
+TAO_IDLType_i *
+TAO_IFR_Service_Utils::path_to_idltype (ACE_TString &path,
+ TAO_Repository_i *repo)
+{
+ CORBA::DefinitionKind def_kind =
+ TAO_IFR_Service_Utils::path_to_def_kind (path, repo);
+ TAO_IDLType_i *retval = repo->select_idltype (def_kind);
+
+ if (retval == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "path_to_idltype - not an IDLType: '%s'\n",
+ path.c_str ()));
+ return 0;
+ }
+
+ retval->section_key (TAO_IFR_Service_Utils::tmp_key_);
+ return retval;
+}
+
+TAO_Contained_i *
+TAO_IFR_Service_Utils::path_to_contained (ACE_TString &path,
+ TAO_Repository_i *repo)
+{
+ CORBA::DefinitionKind def_kind =
+ TAO_IFR_Service_Utils::path_to_def_kind (path, repo);
+ TAO_Contained_i *retval = repo->select_contained (def_kind);
+
+ if (retval == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "path_to_contained - not a contained type: '%s'\n",
+ path.c_str ()));
+ return 0;
+ }
+
+ retval->section_key (TAO_IFR_Service_Utils::tmp_key_);
+ return retval;
+}
+
+TAO_Container_i *
+TAO_IFR_Service_Utils::path_to_container (ACE_TString &path,
+ TAO_Repository_i *repo)
+{
+ CORBA::DefinitionKind def_kind =
+ TAO_IFR_Service_Utils::path_to_def_kind (path, repo);
+ TAO_Container_i *retval = repo->select_container (def_kind);
+
+ if (retval != 0)
+ {
+ retval->section_key (TAO_IFR_Service_Utils::tmp_key_);
+ }
+
+ return retval;
+}
+
+CORBA::Object_ptr
+TAO_IFR_Service_Utils::path_to_ir_object (ACE_TString &path,
+ TAO_Repository_i *repo
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::DefinitionKind def_kind =
+ TAO_IFR_Service_Utils::path_to_def_kind (path, repo);
+
+ return TAO_IFR_Service_Utils::create_objref (def_kind,
+ path.c_str (),
+ repo
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Object_ptr
+TAO_IFR_Service_Utils::create_objref (CORBA::DefinitionKind def_kind,
+ const char *obj_id,
+ TAO_Repository_i *repo
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TString repo_id ("IDL:omg.org/");
+
+ switch (def_kind)
+ {
+ case CORBA::dk_Attribute:
+ repo_id += "CORBA/ExtAttributeDef:";
+ break;
+ case CORBA::dk_Constant:
+ repo_id += "CORBA/ConstantDef:";
+ break;
+ case CORBA::dk_Exception:
+ repo_id += "CORBA/ExceptionDef:";
+ break;
+ case CORBA::dk_Interface:
+ repo_id += "CORBA/ExtInterfaceDef:";
+ break;
+ case CORBA::dk_AbstractInterface:
+ repo_id += "CORBA/ExtAbstractInterfaceDef:";
+ break;
+ case CORBA::dk_LocalInterface:
+ repo_id += "CORBA/ExtLocalInterfaceDef:";
+ break;
+ case CORBA::dk_Module:
+ repo_id += "CORBA/ComponentIR/ModuleDef:";
+ break;
+ case CORBA::dk_Operation:
+ repo_id += "CORBA/OperationDef:";
+ break;
+ case CORBA::dk_Typedef:
+ repo_id += "CORBA/TypedefDef:";
+ break;
+ case CORBA::dk_Alias:
+ repo_id += "CORBA/AliasDef:";
+ break;
+ case CORBA::dk_Struct:
+ repo_id += "CORBA/StructDef:";
+ break;
+ case CORBA::dk_Union:
+ repo_id += "CORBA/UnionDef:";
+ break;
+ case CORBA::dk_Enum:
+ repo_id += "CORBA/EnumDef:";
+ break;
+ case CORBA::dk_Primitive:
+ repo_id += "CORBA/PrimitiveDef:";
+ break;
+ case CORBA::dk_String:
+ repo_id += "CORBA/StringDef:";
+ break;
+ case CORBA::dk_Sequence:
+ repo_id += "CORBA/SequenceDef:";
+ break;
+ case CORBA::dk_Array:
+ repo_id += "CORBA/ArrayDef:";
+ break;
+ case CORBA::dk_Wstring:
+ repo_id += "CORBA/WstringDef:";
+ break;
+ case CORBA::dk_Fixed:
+ repo_id += "CORBA/FixedDef:";
+ break;
+ case CORBA::dk_Value:
+ repo_id += "CORBA/ExtValueDef:";
+ break;
+ case CORBA::dk_ValueBox:
+ repo_id += "CORBA/ValueBoxDef:";
+ break;
+ case CORBA::dk_ValueMember:
+ repo_id += "CORBA/ValueMemberDef:";
+ break;
+ case CORBA::dk_Native:
+ repo_id += "CORBA/NativeDef:";
+ break;
+ case CORBA::dk_Component:
+ repo_id += "CORBA/ComponentIR/ComponentDef:";
+ break;
+ case CORBA::dk_Home:
+ repo_id += "CORBA/ComponentIR/HomeDef:";
+ break;
+ case CORBA::dk_Factory:
+ repo_id += "CORBA/ComponentIR/FactoryDef:";
+ break;
+ case CORBA::dk_Finder:
+ repo_id += "CORBA/ComponentIR/FinderDef:";
+ break;
+ case CORBA::dk_Event:
+ repo_id += "CORBA/ComponentIR/EventDef:";
+ break;
+ case CORBA::dk_Emits:
+ repo_id += "CORBA/ComponentIR/EmitsDef:";
+ break;
+ case CORBA::dk_Publishes:
+ repo_id += "CORBA/ComponentIR/PublishesDef:";
+ break;
+ case CORBA::dk_Consumes:
+ repo_id += "CORBA/ComponentIR/ConsumesDef:";
+ break;
+ case CORBA::dk_Provides:
+ repo_id += "CORBA/ComponentIR/ProvidesDef:";
+ break;
+ case CORBA::dk_Uses:
+ repo_id += "CORBA/ComponentIR/UsesDef:";
+ break;
+ default:
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (),
+ CORBA::Object::_nil ());
+ }
+
+ repo_id += "1.0";
+
+ PortableServer::ObjectId_var oid =
+ PortableServer::string_to_ObjectId (obj_id);
+
+ PortableServer::POA_ptr poa = repo->select_poa (def_kind);
+
+ return poa->create_reference_with_id (oid.in (),
+ repo_id.c_str ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+char *
+TAO_IFR_Service_Utils::oid_to_string (PortableServer::ObjectId &oid)
+{
+ static char oid_string[2 * 1024];
+ CORBA::ULong length = oid.length ();
+
+ // Copy the data.
+ ACE_OS::memcpy (oid_string,
+ oid.get_buffer (),
+ length);
+
+ // Null terminate the string.
+ oid_string[length] = '\0';
+ return oid_string;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.h b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.h
new file mode 100644
index 00000000000..2b91098a1ee
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.h
@@ -0,0 +1,258 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// IFR_Service_Utils.h
+//
+// = DESCRIPTION
+// Implement wrappers useful to IFR Service clients and servers.
+//
+// = AUTHORS
+// Jeff Parsons <j.parsons@vanderbilt.edu>
+// Jaiganesh Balasubramanian <jai@doc.ece.uci.edu>
+// Priyanka Gontla <pgontla@doc.ece.uci.edu>
+//
+// ============================================================================
+
+#ifndef TAO_IFR_SERVICE_UTILS_H
+#define TAO_IFR_SERVICE_UTILS_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/IFRService/ifr_service_export.h"
+#include "tao/IFR_Client/IFR_BasicC.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/ORB.h"
+
+#include "ace/Configuration.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Configuration;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IOR_Multicast;
+class TAO_Repository_i;
+class TAO_IDLType_i;
+class TAO_Container_i;
+class TAO_Contained_i;
+
+class TAO_IFRService_Export TAO_IFR_Server
+{
+public:
+ TAO_IFR_Server (void);
+
+ int init_with_orb (int argc,
+ ACE_TCHAR *argv [],
+ CORBA::ORB_ptr orb,
+ int use_multicast_server = 0);
+ /// Initialize the IFR Service with the command line arguments and
+ /// the ORB.
+
+ int fini (void);
+ /// Destroy the child POA created in <init_with_orb>.
+
+ ~TAO_IFR_Server (void);
+ /// Destructor.
+
+protected:
+
+ /// Two persistent POAs, one using a servant locator.
+ int create_poa (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// Open an ACE_Configuration of the appropriate type.
+ int open_config (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// Create and initialize the repository.
+ int create_repository (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// Enable the Interface Repository to answer multicast requests
+ /// for its IOR.
+ int init_multicast_server (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// Reference to our ORB.
+ CORBA::ORB_var orb_;
+
+ /// Root POA reference.
+ PortableServer::POA_ptr root_poa_;
+
+ /// The Repository's POA reference.
+ PortableServer::POA_ptr repo_poa_;
+
+ /// Event handler that responds to multicast requests.
+ TAO_IOR_Multicast *ior_multicast_;
+
+ /// Database for the IFR.
+ ACE_Configuration *config_;
+
+ /// Interface Repository's IOR.
+ CORBA::String_var ifr_ior_;
+};
+
+class TAO_IFR_Service_Utils
+{
+public:
+ TAO_IFR_Service_Utils (void);
+
+ ~TAO_IFR_Service_Utils (void);
+
+ typedef int (*name_clash_checker)(const char *);
+
+ /// Convert the hex form of an 4-byte unsigned int to a string.
+ static char *int_to_string (CORBA::ULong number);
+
+ /// The error-checking methods below all return void because
+ /// they throw a spec-defined exception for every error case
+ /// (specifically one of the BAD_PARAM minor versions).
+
+ /// Checks for illegal member type in given container type.
+ static void valid_container (CORBA::DefinitionKind container_kind,
+ CORBA::DefinitionKind contained_kind
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Wrapper for id_exists() and name_exists().
+ static void pre_exist (const char *id,
+ name_clash_checker checker,
+ ACE_Configuration_Section_Key &key,
+ TAO_Repository_i *repo,
+ CORBA::DefinitionKind kind
+ ACE_ENV_ARG_DECL);
+
+ /// Checks for a global repository id clash.
+ static void id_exists (const char *id,
+ TAO_Repository_i *repo
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Checks for a local name clash.
+ static void name_exists (name_clash_checker checker,
+ ACE_Configuration_Section_Key &key,
+ TAO_Repository_i *repo,
+ CORBA::DefinitionKind kind
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Used by interfaces and components to check for name clashes
+ /// in the attributes, operations, or component ports subsections.
+ static void check_subsection (name_clash_checker checker,
+ const char *sub_section,
+ ACE_Configuration *config,
+ ACE_Configuration_Section_Key &key
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Top-level method which calls all the above error-checking methods.
+ static void valid_creation (CORBA::DefinitionKind container_kind,
+ CORBA::DefinitionKind contained_kind,
+ const char *id,
+ name_clash_checker checker,
+ ACE_Configuration_Section_Key &key,
+ TAO_Repository_i *repo
+ ACE_ENV_ARG_DECL);
+
+ /// Code common to the creation of an entry for any non-anonymous type.
+ static ACE_TString create_common (
+ CORBA::DefinitionKind container_kind,
+ CORBA::DefinitionKind contained_kind,
+ ACE_Configuration_Section_Key container_key,
+ ACE_Configuration_Section_Key &new_key,
+ TAO_Repository_i *repo,
+ const char *id,
+ const char *name,
+ name_clash_checker checker,
+ const char *version,
+ const char *sub_section_name
+ ACE_ENV_ARG_DECL
+ );
+
+ /// Common to Container::create_value() and ValueDef::supported_interfaces(),
+ /// Container::create_component() and Component::supported_interfaces().
+ static void set_supported_interfaces (
+ const CORBA::InterfaceDefSeq &supported_interfaces,
+ ACE_Configuration *config,
+ ACE_Configuration_Section_Key &key
+ );
+
+ /// Common code for operations, attributes, and valuetype initializers.
+ static void set_exceptions (ACE_Configuration *config,
+ ACE_Configuration_Section_Key &key,
+ const char *sub_section,
+ const CORBA::ExceptionDefSeq &exceptions);
+
+ /// Implemented here to avoid recursion in the servant classes.
+ static CORBA::TypeCode_ptr gen_valuetype_tc_r (
+ ACE_Configuration_Section_Key &,
+ TAO_Repository_i *
+ ACE_ENV_ARG_DECL
+ );
+
+ /// Called from the above function.
+ static void fill_valuemember_seq (CORBA::ValueMemberSeq &,
+ ACE_Configuration_Section_Key &,
+ TAO_Repository_i *
+ ACE_ENV_ARG_DECL);
+
+ /// Converison from IR Object reference to key location path.
+ static char *reference_to_path (CORBA::IRObject_ptr obj);
+
+ /// Conversion from key location path to CORBA::DefinitionKind.
+ static CORBA::DefinitionKind path_to_def_kind (ACE_TString &path,
+ TAO_Repository_i *repo);
+
+ /// Conversion from IR Object reference to CORBA::DefinitionKind.
+ static CORBA::DefinitionKind reference_to_def_kind (
+ CORBA::IRObject_ptr obj,
+ TAO_Repository_i *repo
+ );
+
+ /// Converion from key location path to IDLType.
+ static TAO_IDLType_i *path_to_idltype (ACE_TString &path,
+ TAO_Repository_i *repo);
+
+ /// Converion from key location path to IDLType.
+ static TAO_Contained_i *path_to_contained (ACE_TString &path,
+ TAO_Repository_i *repo);
+
+ /// Converion from key location path to IDLType.
+ static TAO_Container_i *path_to_container (ACE_TString &path,
+ TAO_Repository_i *repo);
+
+ /// Conversion from key location path to IR Object reference.
+ static CORBA::Object_ptr path_to_ir_object (ACE_TString &path,
+ TAO_Repository_i *repo
+ ACE_ENV_ARG_DECL);
+
+ /// Can be called from the above method or directly from a derived class.
+ static CORBA::Object_ptr create_objref (CORBA::DefinitionKind def_kind,
+ const char *obj_id,
+ TAO_Repository_i *repo
+ ACE_ENV_ARG_DECL);
+
+ /// Copy and octet sequence to a string..
+ static char *oid_to_string (PortableServer::ObjectId &oid);
+
+public:
+ /// To hold a key created by one method for another method to use.
+ /// Calls to this class will be made after an IFR lock (if any)
+ /// has been acquired, so thread safety is not an issue with this
+ /// static variable.
+ static ACE_Configuration_Section_Key tmp_key_;
+
+ /// Needed by TAO_InterfaceDef_i::name_clash, probably can be used
+ /// all over the place now that it's here.
+ static TAO_Repository_i *repo_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_IFR_SERVICE_UTILS_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils_T.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils_T.cpp
new file mode 100644
index 00000000000..848677edd13
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils_T.cpp
@@ -0,0 +1,389 @@
+// $Id$
+
+#ifndef TAO_IFR_SERVICE_UTILS_T_CPP
+#define TAO_IFR_SERVICE_UTILS_T_CPP
+
+#include "orbsvcs/IFRService/IFR_Service_Utils_T.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+
+#include "ace/SString.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<typename T>
+void
+TAO_IFR_Generic_Utils<T>::destroy_special (const char *section_name,
+ TAO_Repository_i *repo,
+ ACE_Configuration_Section_Key &key
+ ACE_ENV_ARG_DECL)
+{
+ ACE_Configuration_Section_Key sub_key;
+ int status =
+ repo->config ()->open_section (key,
+ section_name,
+ 0,
+ sub_key);
+
+ if (status != 0)
+ {
+ /// Nothing to destroy.
+ return;
+ }
+
+ CORBA::ULong count = 0;
+ repo->config ()->get_integer_value (sub_key,
+ "count",
+ count);
+
+ char *stringified = 0;
+ ACE_Configuration_Section_Key special_key;
+ ACE_TString holder;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ repo->config ()->open_section (sub_key,
+ stringified,
+ 0,
+ special_key);
+ T impl (repo);
+ impl.section_key (special_key);
+ impl.destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+template<typename T>
+void
+TAO_IFR_Generic_Utils<T>::set_initializers (
+ const T &initializers,
+ ACE_Configuration *config,
+ ACE_Configuration_Section_Key &key
+ )
+{
+ CORBA::ULong length = initializers.length ();
+
+ if (length == 0)
+ {
+ return;
+ }
+
+ ACE_Configuration_Section_Key initializers_key;
+ config->open_section (key,
+ "initializers",
+ 1,
+ initializers_key);
+ config->set_integer_value (initializers_key,
+ "count",
+ length);
+
+ CORBA::ULong arg_count = 0;
+ char *arg_path = 0;
+ ACE_Configuration_Section_Key initializer_key;
+ ACE_Configuration_Section_Key params_key;
+ ACE_Configuration_Section_Key arg_key;
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ config->open_section (initializers_key,
+ stringified,
+ 1,
+ initializer_key);
+ config->set_string_value (initializer_key,
+ "name",
+ initializers[i].name.in ());
+
+ arg_count = initializers[i].members.length ();
+
+ if (arg_count > 0)
+ {
+ config->open_section (initializer_key,
+ "params",
+ 1,
+ params_key);
+ config->set_integer_value (params_key,
+ "count",
+ arg_count);
+
+ for (CORBA::ULong j = 0; j < arg_count; ++j)
+ {
+ char *stringified =
+ TAO_IFR_Service_Utils::int_to_string (j);
+ config->open_section (params_key,
+ stringified,
+ 1,
+ arg_key);
+ config->set_string_value (
+ arg_key,
+ "arg_name",
+ initializers[i].members[j].name.in ()
+ );
+ arg_path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ initializers[i].members[j].type_def.in ()
+ );
+ config->set_string_value (arg_key,
+ "arg_path",
+ arg_path);
+ }
+ }
+ }
+}
+
+template<typename T_desc, typename T_impl>
+void
+TAO_IFR_Desc_Utils<T_desc,T_impl>::fill_desc_begin (
+ T_desc &desc,
+ TAO_Repository_i *repo,
+ ACE_Configuration_Section_Key &key
+ ACE_ENV_ARG_DECL
+ )
+{
+ T_impl impl (repo);
+ impl.section_key (key);
+
+ desc.name = impl.name_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ desc.id = impl.id_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TString holder;
+ repo->config ()->get_string_value (key,
+ "container_id",
+ holder);
+ desc.defined_in = holder.fast_rep ();
+
+ desc.version = impl.version_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+template<typename T_strseq>
+void
+TAO_IFR_Strseq_Utils<T_strseq> ::fill_string_seq (
+ const char *section_name,
+ ACE_Configuration *config,
+ ACE_Configuration_Section_Key &key,
+ T_strseq &seq
+ )
+{
+ ACE_Configuration_Section_Key section_key;
+ int status = config->open_section (key,
+ section_name,
+ 0,
+ section_key);
+
+ if (status != 0)
+ {
+ seq.length (0);
+ return;
+ }
+
+ CORBA::ULong count = 0;
+ config->get_integer_value (section_key,
+ "count",
+ count);
+ seq.length (count);
+ char *stringified = 0;
+ ACE_TString holder;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ config->get_string_value (section_key,
+ stringified,
+ holder);
+ seq[i] = holder.fast_rep ();
+ }
+}
+
+template<typename T_desc_seq>
+void
+TAO_Port_Desc_Seq_Utils<T_desc_seq>::port_descriptions (
+ T_desc_seq &desc_seq,
+ ACE_Configuration *config,
+ ACE_Configuration_Section_Key &key,
+ const char *sub_section
+ )
+{
+ ACE_Configuration_Section_Key sub_key;
+ int status = config->open_section (key,
+ sub_section,
+ 0,
+ sub_key);
+
+ if (status != 0)
+ {
+ desc_seq.length (0);
+ return;
+ }
+
+ CORBA::ULong count = 0;
+ config->get_integer_value (sub_key,
+ "count",
+ count);
+ desc_seq.length (count);
+ ACE_Configuration_Section_Key desc_key;
+ char *stringified = 0;
+ ACE_TString holder;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ config->open_section (sub_key,
+ stringified,
+ 0,
+ desc_key);
+
+ config->get_string_value (desc_key,
+ "name",
+ holder);
+ desc_seq[i].name = holder.c_str ();
+
+ config->get_string_value (desc_key,
+ "id",
+ holder);
+ desc_seq[i].id = holder.c_str ();
+
+ /// Seems to me that this field should refer to the component
+ /// where the port is defined - NOT where the base type is defined.
+ config->get_string_value (key,
+ "id",
+ holder);
+ desc_seq[i].defined_in = holder.c_str ();
+
+ config->get_string_value (desc_key,
+ "version",
+ holder);
+ desc_seq[i].version = holder.c_str ();
+
+ config->get_string_value (desc_key,
+ "base_type",
+ holder);
+ TAO_Port_Desc_Seq_Utils<T_desc_seq>::port_base_type (desc_seq,
+ holder,
+ i);
+
+ TAO_Port_Desc_Seq_Utils<T_desc_seq>::get_is_multiple (desc_seq,
+ config,
+ desc_key,
+ i);
+ }
+}
+
+template<typename T_desc_seq>
+void
+TAO_Port_Desc_Seq_Utils<T_desc_seq>::get_is_multiple (
+ T_desc_seq & /* desc_seq */,
+ ACE_Configuration * /* config */,
+ ACE_Configuration_Section_Key & /* key */,
+ CORBA::ULong /* index */
+ )
+{
+ // All types except UsesDescription have no is_multiple member.
+}
+
+template<typename T_desc_seq>
+void
+TAO_Port_Desc_Seq_Utils<T_desc_seq>::port_base_type (T_desc_seq &desc_seq,
+ ACE_TString &holder,
+ CORBA::ULong index)
+{
+ desc_seq[index].interface_type = holder.fast_rep ();
+}
+
+template<typename T>
+T *
+TAO_Port_Utils<T>::create_entry (const char *id,
+ const char *name,
+ const char *version,
+ const char *sub_section,
+ CORBA::Container_ptr port_base_type,
+ CORBA::Boolean is_multiple,
+ TAO_Repository_i *repo,
+ CORBA::DefinitionKind port_kind,
+ ACE_Configuration_Section_Key &key
+ ACE_ENV_ARG_DECL)
+{
+ TAO_Container_i::tmp_name_holder (name);
+ ACE_Configuration_Section_Key new_key;
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (CORBA::dk_Component,
+ port_kind,
+ key,
+ new_key,
+ repo,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ sub_section
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (T::_nil ());
+
+ const char *tmp =
+ TAO_IFR_Service_Utils::reference_to_path (port_base_type);
+
+ ACE_Configuration_Section_Key base_type_key;
+ repo->config ()->expand_path (repo->root_key (),
+ tmp,
+ base_type_key,
+ 0);
+
+ ACE_TString holder;
+ repo->config ()->get_string_value (base_type_key,
+ "id",
+ holder);
+
+ repo->config ()->set_string_value (
+ new_key,
+ "base_type",
+ holder
+ );
+
+ TAO_Port_Utils<T>::set_is_multiple (is_multiple,
+ repo->config (),
+ new_key);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (path,
+ repo
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (T::_nil ());
+
+ return T::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x582)
+// Borland gives warnings about argument not used on the construct as used
+// for the other compilers. This has been reported to Borland, adding
+// a workaround to suppress these warnings so that the real important ones
+// are not missed.
+template<typename T>
+void
+TAO_Port_Utils<T>::set_is_multiple (CORBA::Boolean is_multiple,
+ ACE_Configuration * config,
+ ACE_Configuration_Section_Key &key)
+{
+ ACE_UNUSED_ARG (is_multiple);
+ ACE_UNUSED_ARG (config);
+ ACE_UNUSED_ARG (key);
+ // Do nothing for everything except UsesDef.
+}
+#else
+template<typename T>
+void
+TAO_Port_Utils<T>::set_is_multiple (CORBA::Boolean /* is_multiple */,
+ ACE_Configuration * /* config */,
+ ACE_Configuration_Section_Key & /* key */)
+{
+ // Do nothing for everything except UsesDef.
+}
+#endif
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_IFR_SERVICE_UTILS_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils_T.h b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils_T.h
new file mode 100644
index 00000000000..056582e494a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils_T.h
@@ -0,0 +1,125 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file IFR_Service_Utils_T.h
+ *
+ * $Id$
+ *
+ * Template methods useful to IFR Service.
+ *
+ * @author Jeff Parsons <j.parsons@vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_IFR_SERVICE_UTILS_T_H
+#define TAO_IFR_SERVICE_UTILS_T_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Configuration.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/IFR_Client/IFR_ComponentsC.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Repository_i;
+
+template<typename T>
+class TAO_IFR_Generic_Utils
+{
+public:
+ static void destroy_special (const char *section_name,
+ TAO_Repository_i *repo,
+ ACE_Configuration_Section_Key &key
+ ACE_ENV_ARG_DECL);
+
+ static void set_initializers (const T &initializers,
+ ACE_Configuration *config,
+ ACE_Configuration_Section_Key &key);
+ /// Common to Container::create_value(), create_ext_value
+ /// and ValueDef::initializers().
+};
+
+template<typename T_desc, typename T_impl>
+class TAO_IFR_Desc_Utils
+{
+public:
+ static void fill_desc_begin (T_desc &desc,
+ TAO_Repository_i *repo,
+ ACE_Configuration_Section_Key &key
+ ACE_ENV_ARG_DECL);
+};
+
+template<typename T_strseq>
+class TAO_IFR_Strseq_Utils
+{
+public:
+ static void fill_string_seq (const char *section_name,
+ ACE_Configuration *config,
+ ACE_Configuration_Section_Key &key,
+ T_strseq &seq);
+};
+
+template <typename T_desc_seq>
+class TAO_Port_Desc_Seq_Utils
+{
+public:
+ static void port_descriptions (T_desc_seq &desc_seq,
+ ACE_Configuration *config,
+ ACE_Configuration_Section_Key &key,
+ const char *sub_section);
+
+ static void get_is_multiple (T_desc_seq &desc_seq,
+ ACE_Configuration *config,
+ ACE_Configuration_Section_Key &key,
+ CORBA::ULong index);
+
+ static void port_base_type (T_desc_seq &desc_seq,
+ ACE_TString &holder,
+ CORBA::ULong index);
+};
+
+template<typename T>
+class TAO_Port_Utils
+{
+public:
+ static T *create_entry (const char *id,
+ const char *name,
+ const char *version,
+ const char *sub_section,
+ CORBA::Container_ptr port_base_type,
+ CORBA::Boolean is_multiple,
+ TAO_Repository_i *repo,
+ CORBA::DefinitionKind port_kind,
+ ACE_Configuration_Section_Key &key
+ ACE_ENV_ARG_DECL);
+
+ static void set_is_multiple (CORBA::Boolean is_multiple,
+ ACE_Configuration *config,
+ ACE_Configuration_Section_Key &key);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/IFRService/IFR_Service_Utils_T.cpp"
+#endif /* defined REQUIRED SOURCE */
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_IFR_SERVICE_UTILS_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_macro.h b/TAO/orbsvcs/orbsvcs/IFRService/IFR_macro.h
new file mode 100644
index 00000000000..e48f4668015
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_macro.h
@@ -0,0 +1,51 @@
+/* -*- C++ -*- */
+// $Id$
+
+#ifndef TAO_IFR_MACROS_H
+#define TAO_IFR_MACROS_H
+
+#include /**/ "ace/pre.h"
+#include "ace/CORBA_macros.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/ORB_Constants.h"
+
+#define TAO_IFR_WRITE_GUARD \
+ ACE_WRITE_GUARD_THROW_EX (ACE_Lock, \
+ monitor, \
+ this->repo_->lock (), \
+ CORBA::INTERNAL ( \
+ CORBA::SystemException::_tao_minor_code ( \
+ TAO_GUARD_FAILURE, \
+ 0), \
+ CORBA::COMPLETED_NO)); \
+ ACE_CHECK
+
+#define TAO_IFR_WRITE_GUARD_RETURN(RETURN) \
+ ACE_WRITE_GUARD_THROW_EX (ACE_Lock, \
+ monitor, \
+ this->repo_->lock (), \
+ CORBA::INTERNAL ( \
+ CORBA::SystemException::_tao_minor_code ( \
+ TAO_GUARD_FAILURE, \
+ 0), \
+ CORBA::COMPLETED_NO)); \
+ ACE_CHECK_RETURN (RETURN)
+
+#define TAO_IFR_READ_GUARD_RETURN(RETURN) \
+ ACE_READ_GUARD_THROW_EX (ACE_Lock, \
+ monitor, \
+ this->repo_->lock (), \
+ CORBA::INTERNAL ( \
+ CORBA::SystemException::_tao_minor_code ( \
+ TAO_GUARD_FAILURE, \
+ 0), \
+ CORBA::COMPLETED_NO)); \
+ ACE_CHECK_RETURN (RETURN)
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_IFR_MACROS_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IRObject_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IRObject_i.cpp
new file mode 100644
index 00000000000..9846d186808
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IRObject_i.cpp
@@ -0,0 +1,89 @@
+// $Id$
+
+#include "orbsvcs/IFRService/IRObject_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/Contained_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "tao/PortableServer/Root_POA.h"
+#include "tao/PortableServer/POA_Current_Impl.h"
+#include "tao/TSS_Resources.h"
+
+
+ACE_RCSID (IFR_Service,
+ IRObject_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_IRObject_i::TAO_IRObject_i (TAO_Repository_i *repo)
+ : repo_ (repo)
+{
+}
+
+TAO_IRObject_i::~TAO_IRObject_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_IRObject_i::def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Will always be overridden by concrete classes.
+ return CORBA::dk_none;
+}
+
+void
+TAO_IRObject_i::section_key (ACE_Configuration_Section_Key &key)
+{
+ this->section_key_ = key;
+}
+
+void
+TAO_IRObject_i::update_key (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO::Portable_Server::POA_Current_Impl *pc_impl =
+ static_cast <TAO::Portable_Server::POA_Current_Impl *>
+ (TAO_TSS_Resources::instance ()->poa_current_impl_);
+
+ PortableServer::ObjectId object_id;
+ int status = TAO_Root_POA::parse_ir_object_key (pc_impl->object_key (),
+ object_id);
+ if (status != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "update_key - parse_ir_object_key failed\n"));
+ return;
+ }
+
+ char *oid_string = TAO_IFR_Service_Utils::oid_to_string (object_id);
+
+ if (oid_string[0U] == '\0')
+ {
+ this->section_key_ = this->repo_->root_key ();
+ return;
+ }
+
+ ACE_TString path (oid_string,
+ 0,
+ 0);
+
+ status =
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ path,
+ this->section_key_,
+ 0);
+
+ if (status != 0)
+ {
+ // If we're here, destroy() has been called on us.
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IRObject_i.h b/TAO/orbsvcs/orbsvcs/IFRService/IRObject_i.h
new file mode 100644
index 00000000000..a6bbdc4adfa
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/IRObject_i.h
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// IRObject_i.h
+//
+// = DESCRIPTION
+// IRObject servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_IROBJECT_I_H
+#define TAO_IROBJECT_I_H
+
+#include "ace/Configuration.h"
+#include "orbsvcs/IFRService/ifr_service_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/IFRService/IFR_ExtendedS.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Repository_i;
+class TAO_IDLType_i;
+class TAO_Contained_i;
+class TAO_Container_i;
+
+class TAO_IFRService_Export TAO_IRObject_i : public POA_CORBA::IRObject
+{
+ // = TITLE
+ // TAO_IRObject_i
+ //
+ // = DESCRIPTION
+ // Abstract base class for all IR object types.
+ //
+public:
+ TAO_IRObject_i (TAO_Repository_i *repo);
+ // Constructor.
+
+ virtual ~TAO_IRObject_i (void);
+ // Destructor.
+
+ virtual CORBA::DefinitionKind def_kind (
+ 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)) = 0;
+ // Pure virtual.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+ // Pure virtual - the unlocked version called by the destroy() wrapper.
+
+ void section_key (ACE_Configuration_Section_Key &key);
+ // Plug in the section key.
+
+protected:
+ void update_key (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Set our key from the object ID via POACurrent.
+
+protected:
+ TAO_Repository_i *repo_;
+ // Pointer to the repository we were constructed from.
+
+ ACE_Configuration_Section_Key section_key_;
+ // Our ACE_Configuration section key.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_IROBJECT_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/InterfaceAttrExtension_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/InterfaceAttrExtension_i.cpp
new file mode 100644
index 00000000000..943a6082e1f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/InterfaceAttrExtension_i.cpp
@@ -0,0 +1,343 @@
+// $Id$
+
+#include "orbsvcs/IFRService/InterfaceAttrExtension_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/InterfaceDef_i.h"
+#include "orbsvcs/IFRService/OperationDef_i.h"
+#include "orbsvcs/IFRService/AttributeDef_i.h"
+#include "orbsvcs/IFRService/ExtAttributeDef_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ InterfaceAttrExtension_i,
+ "$Id$")
+
+// =====================================================================
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_InterfaceAttrExtension_i::TAO_InterfaceAttrExtension_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo)
+{
+}
+
+TAO_InterfaceAttrExtension_i::~TAO_InterfaceAttrExtension_i (void)
+{
+}
+
+
+CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription *
+TAO_InterfaceAttrExtension_i::describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_ext_interface_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription *
+TAO_InterfaceAttrExtension_i::describe_ext_interface_i (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription *fifd = 0;
+ ACE_NEW_RETURN (fifd,
+ CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription,
+ 0);
+
+ CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription_var retval =
+ fifd;
+
+ ACE_TString holder;
+
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ holder);
+ fifd->name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ holder);
+ fifd->id = holder.fast_rep ();
+
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ holder);
+
+ fifd->defined_in = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "version",
+ holder);
+ fifd->version = holder.fast_rep ();
+
+ CORBA::ULong i = 0;
+ CORBA::ULong j = 0;
+ ACE_Unbounded_Queue<ACE_Configuration_Section_Key> key_queue;
+
+ // Store our section key for later restoration after we have
+ // traversed entries for inherited interfaces.
+ ACE_Configuration_Section_Key key_holder = this->section_key_;
+
+ // Operations
+ TAO_InterfaceDef_i iface (this->repo_);
+ iface.section_key (this->section_key_);
+ iface.inherited_operations (key_queue);
+
+ // Restore our original section key.
+ // I am not sure this is needed but it will not hurt.
+ this->section_key (key_holder);
+
+ ACE_Configuration_Section_Key ops_key, op_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "ops",
+ 0,
+ ops_key);
+
+ CORBA::ULong count = 0;
+
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (ops_key,
+ "count",
+ count);
+
+ for (j = 0; j < count; ++j)
+ {
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (j);
+ status =
+ this->repo_->config ()->open_section (ops_key,
+ stringified,
+ 0,
+ op_key);
+
+ if (status == 0)
+ {
+ key_queue.enqueue_tail (op_key);
+ }
+ }
+ }
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (key_queue.size ());
+ fifd->operations.length (size);
+
+ for (i = 0; i < size; ++i)
+ {
+ ACE_Configuration_Section_Key key;
+ key_queue.dequeue_head (key);
+
+ TAO_OperationDef_i op (this->repo_);
+ op.section_key (key);
+
+ op.make_description (fifd->operations[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ // Restore our original section key.
+ // It may have been overwritten by a superclass key as part of the
+ // make_description() call.
+ this->section_key (key_holder);
+
+ // Attributes.
+ iface.inherited_attributes (key_queue);
+
+ // Restore our original section key.
+ // I am not sure this is needed but it will not hurt.
+ this->section_key (key_holder);
+
+ ACE_Configuration_Section_Key attrs_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "attrs",
+ 0,
+ attrs_key);
+
+ count = 0;
+
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (attrs_key,
+ "count",
+ count);
+
+ for (j = 0; j < count; ++j)
+ {
+ ACE_Configuration_Section_Key attr_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (j);
+ status =
+ this->repo_->config ()->open_section (attrs_key,
+ stringified,
+ 0,
+ attr_key);
+
+ if (status == 0)
+ {
+ key_queue.enqueue_tail (attr_key);
+ }
+ }
+ }
+
+ size = static_cast<CORBA::ULong> (key_queue.size ());
+ fifd->attributes.length (size);
+
+ for (i = 0; i < size; ++i)
+ {
+ ACE_Configuration_Section_Key key;
+ key_queue.dequeue_head (key);
+
+ TAO_ExtAttributeDef_i attr (this->repo_);
+ attr.section_key (key);
+
+ attr.fill_description (fifd->attributes[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ // Restore our original section key.
+ // It may have been overwritten by a superclass key as part of the
+ // fill_description() call.
+ this->section_key (key_holder);
+
+ CORBA::InterfaceDefSeq_var bases =
+ iface.base_interfaces_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ULong length = bases->length ();
+ CORBA::RepositoryIdSeq repo_ids (length);
+ repo_ids.length (length);
+
+ PortableServer::ObjectId_var oid;
+ char *base_path = 0;
+ ACE_Configuration_Section_Key base_key;
+
+ for (i = 0; i < length; ++i)
+ {
+ base_path = TAO_IFR_Service_Utils::reference_to_path (bases[i]);
+
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ base_path,
+ base_key,
+ 0);
+ this->repo_->config ()->get_string_value (base_key,
+ "id",
+ holder);
+ repo_ids[i] = holder.fast_rep ();
+ }
+
+ fifd->base_interfaces = repo_ids;
+
+ fifd->type = iface.type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return retval._retn ();
+}
+
+CORBA::ExtAttributeDef_ptr
+TAO_InterfaceAttrExtension_i::create_ext_attribute (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode,
+ const CORBA::ExceptionDefSeq &get_exceptions,
+ const CORBA::ExceptionDefSeq &set_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ExtAttributeDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ExtAttributeDef::_nil ());
+
+ return this->create_ext_attribute_i (id,
+ name,
+ version,
+ type,
+ mode,
+ get_exceptions,
+ set_exceptions
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ExtAttributeDef_ptr
+TAO_InterfaceAttrExtension_i::create_ext_attribute_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode,
+ const CORBA::ExceptionDefSeq &get_exceptions,
+ const CORBA::ExceptionDefSeq &set_exceptions
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder (name);
+ ACE_Configuration_Section_Key new_key;
+
+ // Common to all IR objects created in CORBA::Container.
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (CORBA::dk_Interface,
+ CORBA::dk_Attribute,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "attrs"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ExtAttributeDef::_nil ());
+
+ // Store the path to the attribute's type definition.
+ char *type_path = TAO_IFR_Service_Utils::reference_to_path (type);
+
+ this->repo_->config ()->set_string_value (new_key,
+ "type_path",
+ type_path);
+
+ // Store the attribute's mode.
+ this->repo_->config ()->set_integer_value (new_key,
+ "mode",
+ mode);
+
+ TAO_IFR_Service_Utils::set_exceptions (this->repo_->config (),
+ new_key,
+ "get_excepts",
+ get_exceptions);
+
+ TAO_IFR_Service_Utils::set_exceptions (this->repo_->config (),
+ new_key,
+ "put_excepts",
+ set_exceptions);
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Attribute,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ExtAttributeDef::_nil ());
+
+ CORBA::ExtAttributeDef_var retval =
+ CORBA::ExtAttributeDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ExtAttributeDef::_nil ());
+
+ return retval._retn ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/InterfaceAttrExtension_i.h b/TAO/orbsvcs/orbsvcs/IFRService/InterfaceAttrExtension_i.h
new file mode 100644
index 00000000000..f330fe3dec6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/InterfaceAttrExtension_i.h
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// InterfaceAttrExtension_i.h
+//
+// = DESCRIPTION
+// InterfaceAttrExtension_i servant class.
+//
+// = AUTHOR
+// Jeff Parsons <j.parsons@vanderbilt.edu>
+//
+// ============================================================================
+
+#ifndef TAO_INTERFACEATTREXTENSION_I_H
+#define TAO_INTERFACEATTREXTENSION_I_H
+
+#include "orbsvcs/IFRService/IRObject_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_InterfaceAttrExtension_i
+ : public virtual TAO_IRObject_i
+{
+ // = TITLE
+ // TAO_InterfaceAttrExtension_i
+ //
+ // = DESCRIPTION
+ // IDL3 attribute extension mixin class.
+ //
+public:
+ TAO_InterfaceAttrExtension_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_InterfaceAttrExtension_i (void);
+ // Destructor
+
+ virtual
+ CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription *
+ describe_ext_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription *
+ describe_ext_interface_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ExtAttributeDef_ptr create_ext_attribute (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode,
+ const CORBA::ExceptionDefSeq &get_exceptions,
+ const CORBA::ExceptionDefSeq &set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ExtAttributeDef_ptr create_ext_attribute_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode,
+ const CORBA::ExceptionDefSeq &get_exceptions,
+ const CORBA::ExceptionDefSeq &set_exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_INTERFACEATTREXTENSION_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/InterfaceDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/InterfaceDef_i.cpp
new file mode 100644
index 00000000000..9fd69d6cb63
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/InterfaceDef_i.cpp
@@ -0,0 +1,1285 @@
+// $Id$
+
+#include "orbsvcs/IFRService/InterfaceDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/AttributeDef_i.h"
+#include "orbsvcs/IFRService/OperationDef_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils_T.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ InterfaceDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_InterfaceDef_i::TAO_InterfaceDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Container_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo)
+{
+}
+
+TAO_InterfaceDef_i::~TAO_InterfaceDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_InterfaceDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Interface;
+}
+
+void
+TAO_InterfaceDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_InterfaceDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Destroy our members.
+ this->TAO_Container_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // These will get rid of the repo ids, which Contained_i::destroy()'s
+ // call to remove_section (recursive = 1) will not get, and also
+ // destroy the attribute's anonymous type, if any.
+
+ TAO_IFR_Generic_Utils<TAO_AttributeDef_i>::destroy_special (
+ "attrs",
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ TAO_IFR_Generic_Utils<TAO_OperationDef_i>::destroy_special (
+ "ops",
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ // Destroy ourself.
+ this->TAO_Contained_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CORBA::Contained::Description *
+TAO_InterfaceDef_i::describe (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_InterfaceDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Contained::Description *desc_ptr = 0;
+ ACE_NEW_THROW_EX (desc_ptr,
+ CORBA::Contained::Description,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Contained::Description_var retval = desc_ptr;
+
+ retval->kind = this->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::InterfaceDescription ifd;
+ ACE_TString holder;
+
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ holder);
+ ifd.name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ holder);
+ ifd.id = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ holder);
+ ifd.defined_in = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "version",
+ holder);
+ ifd.version = holder.fast_rep ();
+
+ CORBA::ULong i = 0;
+ CORBA::InterfaceDefSeq_var bases =
+ this->base_interfaces_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ULong length = bases->length ();
+ CORBA::RepositoryIdSeq repo_ids (length);
+ repo_ids.length (length);
+
+ char *base_path = 0;
+ ACE_Configuration_Section_Key base_key;
+
+ for (i = 0; i < length; ++i)
+ {
+ base_path = TAO_IFR_Service_Utils::reference_to_path (bases[i]);
+
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ base_path,
+ base_key,
+ 0);
+
+ TAO_InterfaceDef_i impl (this->repo_);
+ impl.section_key (base_key);
+
+ repo_ids[i] = impl.id_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ ifd.base_interfaces = repo_ids;
+ retval->value <<= ifd;
+ return retval._retn ();
+}
+
+CORBA::TypeCode_ptr
+TAO_InterfaceDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_InterfaceDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ id);
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ name);
+
+ return this->repo_->tc_factory ()->create_interface_tc (
+ id.c_str (),
+ name.c_str ()
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+CORBA::InterfaceDefSeq *
+TAO_InterfaceDef_i::base_interfaces (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->base_interfaces_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::InterfaceDefSeq *
+TAO_InterfaceDef_i::base_interfaces_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> kind_queue;
+ ACE_Unbounded_Queue<ACE_TString> path_queue;
+
+ this->base_interfaces_recursive (kind_queue,
+ path_queue);
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (kind_queue.size ());
+
+ CORBA::InterfaceDefSeq *seq = 0;
+ ACE_NEW_THROW_EX (seq,
+ CORBA::InterfaceDefSeq (size),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ seq->length (size);
+ CORBA::InterfaceDefSeq_var retval = seq;
+
+ for (CORBA::ULong i = 0; i < size; ++i)
+ {
+ CORBA::DefinitionKind def_kind;
+ kind_queue.dequeue_head (def_kind);
+
+ ACE_TString path;
+ path_queue.dequeue_head (path);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[i] = CORBA::InterfaceDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return retval._retn ();
+}
+
+void
+TAO_InterfaceDef_i::base_interfaces (const CORBA::InterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->base_interfaces_i (base_interfaces
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_InterfaceDef_i::base_interfaces_i (const CORBA::InterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // If we are an abstract interface, all our base interfaces must be
+ // abstract as well.
+ CORBA::DefinitionKind def_kind = this->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (def_kind == CORBA::dk_AbstractInterface)
+ {
+ CORBA::ULong length = base_interfaces.length ();
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ def_kind = base_interfaces[i]->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (def_kind != CORBA::dk_AbstractInterface)
+ {
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 11,
+ CORBA::COMPLETED_NO));
+ }
+ }
+ }
+
+ // Remove the old base interfaces.
+ this->repo_->config ()->remove_section (this->section_key_,
+ "inherited",
+ 0);
+
+ CORBA::ULong length = base_interfaces.length ();
+ ACE_Configuration_Section_Key inherited_key;
+ this->repo_->config ()->open_section (this->section_key_,
+ "inherited",
+ 1,
+ inherited_key);
+
+ CORBA::String_var name;
+ char *inherited_path = 0;
+ PortableServer::ObjectId_var oid;
+ ACE_Configuration_Section_Key base_key;
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ inherited_path =
+ TAO_IFR_Service_Utils::reference_to_path (base_interfaces[i]);
+
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ inherited_path,
+ base_key,
+ 0);
+
+ TAO_InterfaceDef_i impl (this->repo_);
+ impl.section_key (base_key);
+
+ name = impl.name_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // None of these names can clash with any we may already have.
+ TAO_Container_i::tmp_name_holder_ = name.in ();
+ TAO_IFR_Service_Utils::name_exists (&TAO_Container_i::same_as_tmp_name,
+ this->section_key_,
+ this->repo_,
+ this->def_kind ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (inherited_key,
+ stringified,
+ inherited_path);
+ }
+}
+
+CORBA::Boolean
+TAO_InterfaceDef_i::is_a (const char *interface_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->is_a_i (interface_id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_InterfaceDef_i::is_a_i (const char *interface_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (ACE_OS::strcmp (interface_id, "IDL:omg.org/CORBA/Object:1.0") == 0)
+ {
+ return 1;
+ }
+
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ id);
+
+ // Is it our type?
+ if (ACE_OS::strcmp (id.fast_rep (), interface_id) == 0)
+ {
+ return 1;
+ }
+
+ // Is it one of our ancestors' types?
+ CORBA::InterfaceDefSeq_var bases =
+ this->base_interfaces_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ULong length = bases->length ();
+
+ PortableServer::ObjectId_var oid;
+ char *base_path = 0;
+ ACE_Configuration_Section_Key base_key;
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ base_path = TAO_IFR_Service_Utils::reference_to_path (bases[i]);
+
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ base_path,
+ base_key,
+ 0);
+
+ TAO_InterfaceDef_i impl (this->repo_);
+ impl.section_key (base_key);
+
+ CORBA::Boolean success = impl.is_a_i (interface_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (success == 1)
+ {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+CORBA::InterfaceDef::FullInterfaceDescription *
+TAO_InterfaceDef_i::describe_interface (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_interface_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::InterfaceDef::FullInterfaceDescription *
+TAO_InterfaceDef_i::describe_interface_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::InterfaceDef::FullInterfaceDescription *fifd = 0;
+ ACE_NEW_RETURN (fifd,
+ CORBA::InterfaceDef::FullInterfaceDescription,
+ 0);
+
+ CORBA::InterfaceDef::FullInterfaceDescription_var retval = fifd;
+
+ ACE_TString holder;
+
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ holder);
+ fifd->name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ holder);
+ fifd->id = holder.fast_rep ();
+
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ holder);
+
+ fifd->defined_in = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "version",
+ holder);
+ fifd->version = holder.fast_rep ();
+
+ CORBA::ULong i = 0;
+ CORBA::ULong j = 0;
+ ACE_Unbounded_Queue<ACE_Configuration_Section_Key> key_queue;
+
+ // Store our section key for later restoration after we have
+ // traversed entries for inherited interfaces.
+ ACE_Configuration_Section_Key key_holder = this->section_key_;
+
+ // Operations
+ this->inherited_operations (key_queue);
+
+ // Restore our original section key.
+ // I am not sure this is needed but it will not hurt.
+ this->section_key (key_holder);
+
+ ACE_Configuration_Section_Key ops_key, op_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "ops",
+ 0,
+ ops_key);
+
+ CORBA::ULong count = 0;
+
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (ops_key,
+ "count",
+ count);
+
+ for (j = 0; j < count; ++j)
+ {
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (j);
+ status =
+ this->repo_->config ()->open_section (ops_key,
+ stringified,
+ 0,
+ op_key);
+
+ if (status == 0)
+ {
+ key_queue.enqueue_tail (op_key);
+ }
+ }
+ }
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (key_queue.size ());
+ fifd->operations.length (size);
+
+ for (i = 0; i < size; ++i)
+ {
+ ACE_Configuration_Section_Key key;
+ key_queue.dequeue_head (key);
+
+ TAO_OperationDef_i op (this->repo_);
+ op.section_key (key);
+
+ op.make_description (fifd->operations[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ // Restore our original section key.
+ // It may have been overwritten by a superclass key as part of the
+ // make_description() call.
+ this->section_key (key_holder);
+
+ // Attributes
+ this->inherited_attributes (key_queue);
+
+ // Restore our original section key.
+ // I am not sure this is needed but it will not hurt.
+ this->section_key (key_holder);
+
+ ACE_Configuration_Section_Key attrs_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "attrs",
+ 0,
+ attrs_key);
+
+ count = 0;
+
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (attrs_key,
+ "count",
+ count);
+
+ for (j = 0; j < count; ++j)
+ {
+ ACE_Configuration_Section_Key attr_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (j);
+ status =
+ this->repo_->config ()->open_section (attrs_key,
+ stringified,
+ 0,
+ attr_key);
+
+ if (status == 0)
+ {
+ key_queue.enqueue_tail (attr_key);
+ }
+ }
+ }
+
+ size = static_cast<CORBA::ULong> (key_queue.size ());
+ fifd->attributes.length (size);
+
+ for (i = 0; i < size; ++i)
+ {
+ ACE_Configuration_Section_Key key;
+ key_queue.dequeue_head (key);
+
+ TAO_AttributeDef_i attr (this->repo_);
+ attr.section_key (key);
+
+ attr.make_description (fifd->attributes[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ // Restore our original section key.
+ // It may have been overwritten by a superclass key as part of the
+ // make_description() call.
+ this->section_key (key_holder);
+
+ CORBA::InterfaceDefSeq_var bases =
+ this->base_interfaces_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ULong length = bases->length ();
+
+ CORBA::RepositoryIdSeq repo_ids (length);
+
+ repo_ids.length (length);
+
+ PortableServer::ObjectId_var oid;
+ char *base_path = 0;
+ ACE_Configuration_Section_Key base_key;
+
+ for (i = 0; i < length; ++i)
+ {
+ base_path = TAO_IFR_Service_Utils::reference_to_path (bases[i]);
+
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ base_path,
+ base_key,
+ 0);
+
+ TAO_InterfaceDef_i impl (this->repo_);
+ impl.section_key (base_key);
+
+ repo_ids[i] = impl.id_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ fifd->base_interfaces = repo_ids;
+
+ fifd->type = this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return retval._retn ();
+}
+
+CORBA::AttributeDef_ptr
+TAO_InterfaceDef_i::create_attribute (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::AttributeDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::AttributeDef::_nil ());
+
+ return this->create_attribute_i (id,
+ name,
+ version,
+ type,
+ mode
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::AttributeDef_ptr
+TAO_InterfaceDef_i::create_attribute_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // This will throw an exception if a name clash is found.
+ // create_common() will check for all other errors.
+ this->check_inherited (name,
+ CORBA::dk_Attribute
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::AttributeDef::_nil ());
+
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+
+ // Common to all IR objects created in CORBA::Container.
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (CORBA::dk_Interface,
+ CORBA::dk_Attribute,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "attrs"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::AttributeDef::_nil ());
+
+ // Store the path to the attribute's type definition.
+ char *type_path = TAO_IFR_Service_Utils::reference_to_path (type);
+
+ this->repo_->config ()->set_string_value (new_key,
+ "type_path",
+ type_path);
+
+ // Store the attribute's mode.
+ this->repo_->config ()->set_integer_value (new_key,
+ "mode",
+ mode);
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Attribute,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::AttributeDef::_nil ());
+
+ CORBA::AttributeDef_var retval =
+ CORBA::AttributeDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::AttributeDef::_nil ());
+
+ return retval._retn ();
+}
+
+CORBA::OperationDef_ptr
+TAO_InterfaceDef_i::create_operation (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr result,
+ CORBA::OperationMode mode,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions,
+ const CORBA::ContextIdSeq &contexts
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::OperationDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::OperationDef::_nil ());
+
+ return this->create_operation_i (id,
+ name,
+ version,
+ result,
+ mode,
+ params,
+ exceptions,
+ contexts
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::OperationDef_ptr
+TAO_InterfaceDef_i::create_operation_i (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr result,
+ CORBA::OperationMode mode,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions,
+ const CORBA::ContextIdSeq &contexts
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // This will throw an exception if a name clash is found.
+ // create_common() will check for all other errors.
+ this->check_inherited (name,
+ CORBA::dk_Operation
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::OperationDef::_nil ());
+
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+
+ // Common to all IR objects created in CORBA::Container.
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (CORBA::dk_Interface,
+ CORBA::dk_Operation,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "ops"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::OperationDef::_nil ());
+
+ // Get the TypeCode for the return type.
+ ACE_TString result_path (TAO_IFR_Service_Utils::reference_to_path (result));
+ TAO_IDLType_i *result_impl =
+ TAO_IFR_Service_Utils::path_to_idltype (result_path,
+ this->repo_);
+
+ CORBA::TypeCode_var rettype =
+ result_impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::OperationDef::_nil ());
+
+ CORBA::TCKind kind = rettype->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::OperationDef::_nil ());
+
+ // Oneway operations cannot have a non-void return type.
+ if (mode == CORBA::OP_ONEWAY && kind != CORBA::tk_void)
+ {
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 31,
+ CORBA::COMPLETED_NO),
+ CORBA::OperationDef::_nil ());
+ }
+
+ this->repo_->config ()->set_string_value (new_key,
+ "result",
+ result_path);
+
+ // Store the operation mode.
+ this->repo_->config ()->set_integer_value (new_key,
+ "mode",
+ mode);
+
+ CORBA::ULong i = 0;
+
+ // Store the operation's parameter info.
+ CORBA::ULong length = params.length ();
+
+ if (length > 0)
+ {
+ ACE_Configuration_Section_Key params_key;
+ this->repo_->config ()->open_section (new_key,
+ "params",
+ 1,
+ params_key);
+
+ this->repo_->config ()->set_integer_value (params_key,
+ "count",
+ length);
+ char *type_path = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ // Oneway operations cannot have INOUT or OUT parameters.
+ if (mode == CORBA::OP_ONEWAY && params[i].mode != CORBA::PARAM_IN)
+ {
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (31,
+ CORBA::COMPLETED_NO),
+ CORBA::OperationDef::_nil ());
+ }
+
+ ACE_Configuration_Section_Key param_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (params_key,
+ stringified,
+ 1,
+ param_key);
+
+ this->repo_->config ()->set_string_value (param_key,
+ "name",
+ params[i].name.in ());
+ type_path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ params[i].type_def.in ()
+ );
+
+ this->repo_->config ()->set_string_value (param_key,
+ "type_path",
+ type_path);
+
+ this->repo_->config ()->set_integer_value (param_key,
+ "mode",
+ params[i].mode);
+ }
+ }
+
+ // Store the operation's exception info.
+ length = exceptions.length ();
+
+ if (length > 0)
+ {
+ // Oneway operations cannot throw any user exceptions.
+ if (mode == CORBA::OP_ONEWAY)
+ {
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 31,
+ CORBA::COMPLETED_NO),
+ CORBA::OperationDef::_nil ());
+ }
+
+ ACE_Configuration_Section_Key excepts_key;
+ this->repo_->config ()->open_section (new_key,
+ "excepts",
+ 1,
+ excepts_key);
+ char *type_path = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ type_path =
+ TAO_IFR_Service_Utils::reference_to_path (exceptions[i]);
+
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (excepts_key,
+ stringified,
+ type_path);
+ }
+ }
+
+ // Store the operation's context info.
+ length = contexts.length ();
+
+ if (length > 0)
+ {
+ ACE_Configuration_Section_Key contexts_key;
+
+ this->repo_->config ()->open_section (new_key,
+ "contexts",
+ 1,
+ contexts_key);
+
+ for (i = 0; i < length; ++i)
+ {
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (contexts_key,
+ stringified,
+ contexts[i]);
+ }
+ }
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Operation,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::OperationDef::_nil ());
+
+ CORBA::OperationDef_var retval =
+ CORBA::OperationDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::OperationDef::_nil ());
+
+ return retval._retn ();
+}
+
+void
+TAO_InterfaceDef_i::interface_contents (
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> &kind_queue,
+ ACE_Unbounded_Queue<ACE_TString> &path_queue,
+ CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ id);
+
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ id.c_str (),
+ path);
+
+ ACE_TString section_name;
+ int index = 0;
+ int status = 0;
+
+ // Attributes
+ if (limit_type == CORBA::dk_Attribute
+ || limit_type == CORBA::dk_all)
+ {
+ ACE_Configuration_Section_Key attrs_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "attrs",
+ 0,
+ attrs_key);
+
+ // Only if we have any.
+ if (status == 0)
+ {
+ while (this->repo_->config ()->enumerate_sections (attrs_key,
+ index++,
+ section_name)
+ == 0)
+ {
+ kind_queue.enqueue_tail (CORBA::dk_Attribute);
+
+ path_queue.enqueue_tail (
+ path + "\\attrs\\" + section_name.c_str ()
+ );
+ }
+ }
+ }
+
+ // Operations
+ if (limit_type == CORBA::dk_Operation
+ || limit_type == CORBA::dk_all)
+ {
+ index = 0;
+
+ ACE_Configuration_Section_Key ops_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "ops",
+ 0,
+ ops_key);
+
+ // Only if we have any.
+ if (status == 0)
+ {
+ while (this->repo_->config ()->enumerate_sections (ops_key,
+ index++,
+ section_name)
+ == 0)
+ {
+ kind_queue.enqueue_tail (CORBA::dk_Operation);
+
+ path_queue.enqueue_tail (
+ path + "\\ops\\" + section_name.c_str ()
+ );
+ }
+ }
+ }
+
+ if (exclude_inherited == 0)
+ {
+ // Must recurse through the base interfaces.
+ ACE_Configuration_Section_Key inherited_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "inherited",
+ 0,
+ inherited_key);
+
+ if (status == 0)
+ {
+ ACE_TString base_path;
+ ACE_Configuration_Section_Key base_key;
+ ACE_Configuration::VALUETYPE type;
+ index = 0;
+
+ while (this->repo_->config ()->enumerate_values (inherited_key,
+ index++,
+ section_name,
+ type)
+ == 0)
+ {
+ this->repo_->config ()->get_string_value (inherited_key,
+ section_name.c_str (),
+ base_path);
+
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ base_path,
+ base_key,
+ 0);
+
+ TAO_InterfaceDef_i base_iface (this->repo_);
+ base_iface.section_key (base_key);
+
+ base_iface.interface_contents (kind_queue,
+ path_queue,
+ limit_type,
+ exclude_inherited
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ }
+}
+
+int
+TAO_InterfaceDef_i::name_clash (const char *name)
+{
+ ACE_TRY_NEW_ENV
+ {
+ TAO_Container_i::tmp_name_holder_ = name;
+ TAO_IFR_Service_Utils::name_exists (&TAO_Container_i::same_as_tmp_name,
+ TAO_IFR_Service_Utils::tmp_key_,
+ TAO_IFR_Service_Utils::repo_,
+ CORBA::dk_Interface
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+void
+TAO_InterfaceDef_i::base_interfaces_recursive (
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> &kind_queue,
+ ACE_Unbounded_Queue<ACE_TString> &path_queue
+ )
+{
+ ACE_Configuration_Section_Key inherited_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "inherited",
+ 0,
+ inherited_key);
+
+ // No base interfaces.
+ if (status != 0)
+ {
+ return;
+ }
+
+ int index = 0;
+ u_int kind = 0;
+ ACE_Configuration::VALUETYPE type;
+ ACE_TString section_name, inherited_path;
+ CORBA::DefinitionKind def_kind = CORBA::dk_none;
+ ACE_Configuration_Section_Key base_key;
+
+ while (this->repo_->config ()->enumerate_values (inherited_key,
+ index++,
+ section_name,
+ type)
+ == 0)
+ {
+ this->repo_->config ()->get_string_value (inherited_key,
+ section_name.c_str (),
+ inherited_path);
+
+ status =
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ inherited_path,
+ base_key,
+ 0);
+
+ if (status == 0)
+ {
+ TAO_InterfaceDef_i tmp (this->repo_);
+ tmp.section_key (base_key);
+
+ tmp.base_interfaces_recursive (kind_queue,
+ path_queue);
+
+ path_queue.enqueue_tail (inherited_path);
+
+ this->repo_->config ()->get_integer_value (base_key,
+ "def_kind",
+ kind);
+
+ def_kind = static_cast<CORBA::DefinitionKind> (kind);
+
+ kind_queue.enqueue_tail (def_kind);
+ }
+ }
+}
+
+void
+TAO_InterfaceDef_i::inherited_attributes (
+ ACE_Unbounded_Queue<ACE_Configuration_Section_Key> &key_queue
+ )
+{
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> kind_queue;
+ ACE_Unbounded_Queue<ACE_TString> path_queue;
+
+ this->base_interfaces_recursive (kind_queue,
+ path_queue);
+
+ size_t size = path_queue.size ();
+ ACE_Configuration_Section_Key base_key, attrs_key, attr_key;
+ int status = 0;
+ ACE_TString path_name;
+ u_int count = 0;
+
+ for (size_t i = 0; i < size; ++i)
+ {
+ path_queue.dequeue_head (path_name);
+
+ status =
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ path_name,
+ base_key,
+ 0);
+
+ if (status == 0)
+ {
+ this->repo_->config ()->open_section (base_key,
+ "attrs",
+ 0,
+ attrs_key);
+
+ this->repo_->config ()->get_integer_value (attrs_key,
+ "count",
+ count);
+
+ for (u_int j = 0; j < count; ++j)
+ {
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (j);
+ this->repo_->config ()->open_section (attrs_key,
+ stringified,
+ 0,
+ attr_key);
+
+ key_queue.enqueue_tail (attr_key);
+ }
+ }
+ }
+}
+
+void
+TAO_InterfaceDef_i::inherited_operations (
+ ACE_Unbounded_Queue<ACE_Configuration_Section_Key> &key_queue
+ )
+{
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> kind_queue;
+ ACE_Unbounded_Queue<ACE_TString> path_queue;
+
+ this->base_interfaces_recursive (kind_queue,
+ path_queue);
+
+ size_t size = path_queue.size ();
+ ACE_Configuration_Section_Key base_key, ops_key, op_key;
+ int status = 0;
+ ACE_TString path_name;
+ u_int count = 0;
+
+ for (size_t i = 0; i < size; ++i)
+ {
+ path_queue.dequeue_head (path_name);
+
+ status =
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ path_name,
+ base_key,
+ 0);
+
+ if (status == 0)
+ {
+ this->repo_->config ()->open_section (base_key,
+ "ops",
+ 0,
+ ops_key);
+
+ this->repo_->config ()->get_integer_value (ops_key,
+ "count",
+ count);
+
+ for (u_int j = 0; j < count; ++j)
+ {
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (j);
+ this->repo_->config ()->open_section (ops_key,
+ stringified,
+ 0,
+ op_key);
+
+ key_queue.enqueue_tail (op_key);
+ }
+ }
+ }
+}
+
+void
+TAO_InterfaceDef_i::check_inherited (const char *name,
+ CORBA::DefinitionKind kind
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Unbounded_Queue<ACE_Configuration_Section_Key> key_queue;
+
+ switch (kind)
+ {
+ case CORBA::dk_Attribute:
+ this->inherited_attributes (key_queue);
+ break;
+ case CORBA::dk_Operation:
+ this->inherited_operations (key_queue);
+ break;
+ default:
+ break;
+ }
+
+ size_t size = key_queue.size ();
+ ACE_Configuration_Section_Key inherited_key;
+ ACE_TString inherited_name;
+
+ for (u_int i = 0; i < size; ++i)
+ {
+ key_queue.dequeue_head (inherited_key);
+
+ this->repo_->config ()->get_string_value (inherited_key,
+ "name",
+ inherited_name);
+
+ if (inherited_name == name)
+ {
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 5,
+ CORBA::COMPLETED_NO));
+ }
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/InterfaceDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/InterfaceDef_i.h
new file mode 100644
index 00000000000..4d010fa0d48
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/InterfaceDef_i.h
@@ -0,0 +1,236 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// InterfaceDef_i.h
+//
+// = DESCRIPTION
+// InterfaceDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_INTERFACEDEF_I_H
+#define TAO_INTERFACEDEF_I_H
+
+#include "orbsvcs/IFRService/Container_i.h"
+#include "orbsvcs/IFRService/Contained_i.h"
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_InterfaceDef_i
+ : public virtual TAO_Container_i,
+ public virtual TAO_Contained_i,
+ public virtual TAO_IDLType_i
+{
+ // = TITLE
+ // TAO_InterfaceDef_i
+ //
+ // = DESCRIPTION
+ // Represents an interface definition.
+ //
+public:
+ TAO_InterfaceDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_InterfaceDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::InterfaceDefSeq *base_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::InterfaceDefSeq *base_interfaces_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void base_interfaces (
+ const CORBA::InterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void base_interfaces_i (
+ const CORBA::InterfaceDefSeq &base_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean is_a (
+ const char *interface_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Boolean is_a_i (
+ const char *interface_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::InterfaceDef::FullInterfaceDescription *describe_interface (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::InterfaceDef::FullInterfaceDescription *describe_interface_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::AttributeDef_ptr create_attribute (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::AttributeDef_ptr create_attribute_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::OperationDef_ptr create_operation (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr result,
+ CORBA::OperationMode mode,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions,
+ const CORBA::ContextIdSeq &contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::OperationDef_ptr create_operation_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr result,
+ CORBA::OperationMode mode,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions,
+ const CORBA::ContextIdSeq &contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void interface_contents (
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> &kind_queue,
+ ACE_Unbounded_Queue<ACE_TString> &path_queue,
+ CORBA::DefinitionKind limit_type,
+ CORBA::Boolean exclude_inherited
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Gathers the attributes and operations of all the ancestors.
+
+ static int name_clash (const char *name);
+ // Called from TAO_IFR_Service_Utils::name_exists() when we
+ // are in a list of supported interfaces.
+
+ void inherited_attributes (
+ ACE_Unbounded_Queue<ACE_Configuration_Section_Key> &key_queue
+ );
+ // Depth-first traversal of the inheritance tree to get all the
+ // attributes.
+
+ void inherited_operations (
+ ACE_Unbounded_Queue<ACE_Configuration_Section_Key> &key_queue
+ );
+ // Depth-first traversal of the inheritance tree to get all the
+ // operations.
+
+private:
+ void base_interfaces_recursive (
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> &kind_queue,
+ ACE_Unbounded_Queue<ACE_TString> &path_queue
+ );
+ // Depth-first traversal of the inheritance tree to get all
+ // the base interfaces.
+
+ void check_inherited (const char *name,
+ CORBA::DefinitionKind kind
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // When creating a new attribute, check for a clash with an inherited
+ // attribute name.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_INTERFACEDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/LocalInterfaceDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/LocalInterfaceDef_i.cpp
new file mode 100644
index 00000000000..dab11360086
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/LocalInterfaceDef_i.cpp
@@ -0,0 +1,62 @@
+// $Id$
+
+#include "orbsvcs/IFRService/LocalInterfaceDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+
+ACE_RCSID (IFRService,
+ LocalInterfaceDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LocalInterfaceDef_i::TAO_LocalInterfaceDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Container_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo),
+ TAO_InterfaceDef_i (repo)
+{
+}
+
+TAO_LocalInterfaceDef_i::~TAO_LocalInterfaceDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_LocalInterfaceDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_LocalInterface;
+}
+
+CORBA::Boolean
+TAO_LocalInterfaceDef_i::is_a (const char *interface_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->is_a_i (interface_id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_LocalInterfaceDef_i::is_a_i (const char *interface_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (ACE_OS::strcmp (interface_id, "IDL:omg.org/CORBA/LocalBase:1.0") == 0)
+ {
+ return 1;
+ }
+
+ return this->TAO_InterfaceDef_i::is_a_i (interface_id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/LocalInterfaceDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/LocalInterfaceDef_i.h
new file mode 100644
index 00000000000..92bfd1be945
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/LocalInterfaceDef_i.h
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// LocalInterfaceDef_i.h
+//
+// = DESCRIPTION
+// LocalInterfaceDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_LOCALINTERFACEDEF_I_H
+#define TAO_LOCALINTERFACEDEF_I_H
+
+#include "orbsvcs/IFRService/InterfaceDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_LocalInterfaceDef_i : public virtual TAO_InterfaceDef_i
+{
+ // = TITLE
+ // TAO_LocalInterfaceDef_i
+ //
+ // = DESCRIPTION
+ // Represents an local interface definition.
+ //
+public:
+ TAO_LocalInterfaceDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_LocalInterfaceDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual CORBA::Boolean is_a (
+ const char *interface_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Boolean is_a_i (
+ const char *interface_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_LOCALINTERFACEDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ModuleDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ModuleDef_i.cpp
new file mode 100644
index 00000000000..731d9aaf511
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ModuleDef_i.cpp
@@ -0,0 +1,111 @@
+// $Id$
+
+#include "orbsvcs/IFRService/ModuleDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ ModuleDef_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ModuleDef_i::TAO_ModuleDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo),
+ TAO_Container_i (repo),
+ TAO_ComponentContainer_i (repo),
+ TAO_ComponentModuleDef_i (repo)
+{
+}
+
+TAO_ModuleDef_i::~TAO_ModuleDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_ModuleDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Module;
+}
+
+void
+TAO_ModuleDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_ModuleDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Destroy our members.
+ TAO_Container_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Destroy ourself.
+ TAO_Contained_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CORBA::Contained::Description *
+TAO_ModuleDef_i::describe (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_ModuleDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Contained::Description *desc_ptr = 0;
+ ACE_NEW_THROW_EX (desc_ptr,
+ CORBA::Contained::Description,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Contained::Description_var retval = desc_ptr;
+
+ retval->kind = this->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ModuleDescription md;
+
+ md.name = this->name_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ md.id = this->id_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ACE_TString container_id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ container_id);
+
+ md.defined_in = container_id.c_str ();
+
+ md.version = this->version_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval->value <<= md;
+
+ return retval._retn ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ModuleDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ModuleDef_i.h
new file mode 100644
index 00000000000..8c178c7cf50
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ModuleDef_i.h
@@ -0,0 +1,94 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ModuleDef_i.h
+//
+// = DESCRIPTION
+// ModuleDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_MODULEDEF_I_H
+#define TAO_MODULEDEF_I_H
+
+//#include "Container_i.h"
+#include "orbsvcs/IFRService/Contained_i.h"
+#include "orbsvcs/IFRService/ComponentModuleDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ModuleDef_i
+ : public virtual TAO_Contained_i,
+ public virtual TAO_ComponentModuleDef_i
+{
+ // = TITLE
+ // TAO_ModuleDef_i
+ //
+ // = DESCRIPTION
+ // Represents a module definition.
+ //
+public:
+ TAO_ModuleDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_ModuleDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry.
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_MODULEDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/NativeDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/NativeDef_i.cpp
new file mode 100644
index 00000000000..e207ffe8823
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/NativeDef_i.cpp
@@ -0,0 +1,66 @@
+// $Id$
+
+#include "orbsvcs/IFRService/NativeDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ NativeDef_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_NativeDef_i::TAO_NativeDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo),
+ TAO_TypedefDef_i (repo)
+{
+}
+
+TAO_NativeDef_i::~TAO_NativeDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_NativeDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Native;
+}
+
+CORBA::TypeCode_ptr
+TAO_NativeDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_NativeDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ id);
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ name);
+
+ return this->repo_->tc_factory ()->create_native_tc (id.c_str (),
+ name.c_str ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/NativeDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/NativeDef_i.h
new file mode 100644
index 00000000000..d6960a185e9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/NativeDef_i.h
@@ -0,0 +1,79 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// NativeDef_i.h
+//
+// = DESCRIPTION
+// NativeDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_NATIVEDEF_I_H
+#define TAO_NATIVEDEF_I_H
+
+#include "orbsvcs/IFRService/TypedefDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_NativeDef_i : public virtual TAO_TypedefDef_i
+{
+public:
+ // = TITLE
+ // TAO_NativeDef_i
+ //
+ // = DESCRIPTION
+ // Represents an OMG IDL native definition.
+ //
+public:
+ TAO_NativeDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_NativeDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_NATIVEDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/OperationDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/OperationDef_i.cpp
new file mode 100644
index 00000000000..ee94729fa59
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/OperationDef_i.cpp
@@ -0,0 +1,750 @@
+// $Id$
+
+#include "orbsvcs/IFRService/OperationDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/ExceptionDef_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "ace/Auto_Ptr.h"
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ OperationDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_OperationDef_i::TAO_OperationDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo)
+{
+}
+
+TAO_OperationDef_i::~TAO_OperationDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_OperationDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Operation;
+}
+
+CORBA::Contained::Description *
+TAO_OperationDef_i::describe (ACE_ENV_SINGLE_ARG_DECL )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_OperationDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Contained::Description *desc_ptr = 0;
+ ACE_NEW_THROW_EX (desc_ptr,
+ CORBA::Contained::Description,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Contained::Description_var retval = desc_ptr;
+
+ retval->kind = this->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::OperationDescription od;
+ this->make_description (od
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval->value <<= od;
+ ACE_CHECK_RETURN (0);
+
+ return retval._retn ();
+}
+
+CORBA::TypeCode_ptr
+TAO_OperationDef_i::result (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->result_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_OperationDef_i::result_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString result_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "result",
+ result_path);
+
+
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (result_path,
+ this->repo_);
+
+ return impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_OperationDef_i::result_def (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::IDLType::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return this->result_def_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_OperationDef_i::result_def_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString result_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "result",
+ result_path);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (result_path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_OperationDef_i::result_def (CORBA::IDLType_ptr result_def
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->result_def_i (result_def
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_OperationDef_i::result_def_i (CORBA::IDLType_ptr result_def
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ char *result_path =
+ TAO_IFR_Service_Utils::reference_to_path (result_def);
+
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "result",
+ result_path);
+}
+
+CORBA::ParDescriptionSeq *
+TAO_OperationDef_i::params (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->params_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ParDescriptionSeq *
+TAO_OperationDef_i::params_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong i = 0;
+ ACE_Configuration_Section_Key params_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "params",
+ 0,
+ params_key);
+
+ ACE_Unbounded_Queue<ACE_Configuration_Section_Key> key_queue;
+
+ // This section may not have been created.
+ if (status == 0)
+ {
+ u_int count = 0;
+ this->repo_->config ()->get_integer_value (params_key,
+ "count",
+ count);
+
+ for (i = 0; i < count; ++i)
+ {
+ ACE_Configuration_Section_Key param_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ status =
+ this->repo_->config ()->open_section (params_key,
+ stringified,
+ 0,
+ param_key);
+
+ if (status == 0)
+ {
+ key_queue.enqueue_tail (param_key);
+ }
+ }
+ }
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (key_queue.size ());
+
+ CORBA::ParDescriptionSeq *pd_seq = 0;
+ ACE_NEW_THROW_EX (pd_seq,
+ CORBA::ParDescriptionSeq (size),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ pd_seq->length (size);
+
+ if (size == 0)
+ {
+ return pd_seq;
+ }
+
+ CORBA::ParDescriptionSeq_var retval = pd_seq;
+
+ for (i = 0; i < size; ++i)
+ {
+ ACE_Configuration_Section_Key key;
+ key_queue.dequeue_head (key);
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (key,
+ "name",
+ name);
+
+ retval[i].name = name.c_str ();
+
+ u_int mode = 0;
+ this->repo_->config ()->get_integer_value (key,
+ "mode",
+ mode);
+
+ retval[i].mode = static_cast<CORBA::ParameterMode> (mode);
+
+ ACE_TString type_path;
+ this->repo_->config ()->get_string_value (key,
+ "type_path",
+ type_path);
+
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (type_path,
+ this->repo_);
+
+ retval[i].type = impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (type_path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[i].type_def = CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return retval._retn ();
+}
+
+void
+TAO_OperationDef_i::params (const CORBA::ParDescriptionSeq &params
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->params_i (params
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_OperationDef_i::params_i (const CORBA::ParDescriptionSeq &params
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->remove_section (this->section_key_,
+ "params",
+ 1);
+
+ CORBA::ULong length = params.length ();
+
+ if (length == 0)
+ {
+ return;
+ }
+
+ ACE_Configuration_Section_Key params_key;
+ this->repo_->config ()->open_section (this->section_key_,
+ "params",
+ 1,
+ params_key);
+
+ this->repo_->config ()->set_integer_value (params_key,
+ "count",
+ length);
+ char *type_path = 0;
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ ACE_Configuration_Section_Key param_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (params_key,
+ stringified,
+ 1,
+ param_key);
+
+ this->repo_->config ()->set_string_value (param_key,
+ "name",
+ params[i].name.in ());
+ type_path =
+ TAO_IFR_Service_Utils::reference_to_path (params[i].type_def.in ());
+
+ this->repo_->config ()->set_string_value (param_key,
+ "type_path",
+ type_path);
+
+ this->repo_->config ()->set_integer_value (param_key,
+ "mode",
+ params[i].mode);
+ }
+}
+
+CORBA::OperationMode
+TAO_OperationDef_i::mode (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::OP_NORMAL);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::OP_NORMAL);
+
+ return this->mode_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::OperationMode
+TAO_OperationDef_i::mode_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ u_int mode;
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "mode",
+ mode);
+
+ return static_cast<CORBA::OperationMode> (mode);
+}
+
+void
+TAO_OperationDef_i::mode (CORBA::OperationMode mode
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->mode_i (mode
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_OperationDef_i::mode_i (CORBA::OperationMode mode
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->set_integer_value (this->section_key_,
+ "mode",
+ mode);
+}
+
+CORBA::ContextIdSeq *
+TAO_OperationDef_i::contexts (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->contexts_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ContextIdSeq *
+TAO_OperationDef_i::contexts_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Configuration_Section_Key contexts_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "contexts",
+ 0,
+ contexts_key);
+
+ ACE_Unbounded_Queue<ACE_TString> context_queue;
+
+ // This section may not have been created.
+ if (status == 0)
+ {
+ int index = 0;
+ ACE_TString context;
+
+ // Don't have to worry about gaps here - contexts are not
+ // IR objects so they can't be destroyed one at a time. To
+ // make a change one has to call the mutator version of this
+ // function and make a completely new list.
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (index);
+ while (this->repo_->config ()->get_string_value (contexts_key,
+ stringified,
+ context)
+ == 0)
+ {
+ context_queue.enqueue_tail (context);
+ ++index;
+ stringified =
+ TAO_IFR_Service_Utils::int_to_string (index);
+ }
+ }
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (context_queue.size ());
+
+ CORBA::ContextIdSeq *ci_seq = 0;
+ ACE_NEW_THROW_EX (ci_seq,
+ CORBA::ContextIdSeq (size),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ ci_seq->length (size);
+
+ for (CORBA::ULong i = 0; i < size; ++i)
+ {
+ ACE_TString context_string;
+ context_queue.dequeue_head (context_string);
+
+ (*ci_seq)[i] = context_string.c_str ();
+ }
+
+ return ci_seq;
+}
+
+void
+TAO_OperationDef_i::contexts (const CORBA::ContextIdSeq &contexts
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->contexts_i (contexts
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_OperationDef_i::contexts_i (const CORBA::ContextIdSeq &contexts
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->remove_section (this->section_key_,
+ "contexts",
+ 0);
+
+ CORBA::ULong length = contexts.length ();
+
+ if (length == 0)
+ return;
+
+ ACE_Configuration_Section_Key contexts_key;
+ this->repo_->config ()->open_section (this->section_key_,
+ "contexts",
+ 1,
+ contexts_key);
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (contexts_key,
+ stringified,
+ contexts[i]);
+ }
+}
+
+CORBA::ExceptionDefSeq *
+TAO_OperationDef_i::exceptions (ACE_ENV_SINGLE_ARG_DECL )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->exceptions_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ExceptionDefSeq *
+TAO_OperationDef_i::exceptions_i (ACE_ENV_SINGLE_ARG_DECL )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Configuration_Section_Key excepts_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "excepts",
+ 0,
+ excepts_key);
+
+ int index = 0;
+ ACE_Unbounded_Queue<ACE_TString> path_queue;
+
+ // This section may not have been created.
+ if (status == 0)
+ {
+ ACE_TString field_name, type_path;
+ ACE_Configuration::VALUETYPE type;
+
+ while (this->repo_->config ()->enumerate_values (excepts_key,
+ index++,
+ field_name,
+ type)
+ == 0)
+ {
+ this->repo_->config ()->get_string_value (excepts_key,
+ field_name.c_str (),
+ type_path);
+
+ path_queue.enqueue_tail (type_path);
+ }
+ }
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (path_queue.size ());
+
+ CORBA::ExceptionDefSeq *ed_seq = 0;
+ ACE_NEW_THROW_EX (ed_seq,
+ CORBA::ExceptionDefSeq (size),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ ed_seq->length (size);
+
+ if (index == 0)
+ {
+ return ed_seq;
+ }
+
+ CORBA::ExceptionDefSeq_var retval = ed_seq;
+
+ for (CORBA::ULong i = 0; i < size; ++i)
+ {
+ ACE_TString path;
+ path_queue.dequeue_head (path);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Exception,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[i] = CORBA::ExceptionDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return retval._retn ();
+}
+
+void
+TAO_OperationDef_i::exceptions (const CORBA::ExceptionDefSeq &exceptions
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->exceptions_i (exceptions
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_OperationDef_i::exceptions_i (const CORBA::ExceptionDefSeq &exceptions
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->remove_section (this->section_key_,
+ "excepts",
+ 0);
+
+ TAO_IFR_Service_Utils::set_exceptions (this->repo_->config (),
+ this->section_key_,
+ "excepts",
+ exceptions);
+}
+
+void
+TAO_OperationDef_i::make_description (
+ CORBA::OperationDescription &od
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ od.name = this->name_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ od.id = this->id_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TString container_id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ container_id);
+
+ od.defined_in = container_id.c_str ();
+
+ od.version = this->version_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ od.result = this->result_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ od.mode = this->mode_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ContextIdSeq_var cid_seq =
+ this->contexts_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ od.contexts = cid_seq.in ();
+
+ CORBA::ParDescriptionSeq_var pd_seq =
+ this->params_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ od.parameters = pd_seq.in ();
+
+ ACE_Configuration_Section_Key excepts_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "excepts",
+ 0,
+ excepts_key);
+
+ // This section may not have been created.
+ if (status == 0)
+ {
+ int index = 0;
+ int status = 0;
+ ACE_TString field_name, type_path;
+ ACE_Configuration::VALUETYPE type;
+ ACE_Unbounded_Queue<ACE_TString> path_queue;
+
+ while (this->repo_->config ()->enumerate_values (excepts_key,
+ index++,
+ field_name,
+ type)
+ == 0)
+ {
+ status =
+ this->repo_->config ()->get_string_value (excepts_key,
+ field_name.c_str (),
+ type_path);
+
+ if (status == 0)
+ {
+ path_queue.enqueue_tail (type_path);
+ }
+ }
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (path_queue.size ());
+
+ od.exceptions.length (size);
+
+ for (CORBA::ULong i = 0; i < size; ++i)
+ {
+ ACE_TString type_path;
+ path_queue.dequeue_head (type_path);
+
+ ACE_Configuration_Section_Key type_key;
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ type_path,
+ type_key,
+ 0);
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (type_key,
+ "name",
+ name);
+
+ od.exceptions[i].name = name.c_str ();
+
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (type_key,
+ "id",
+ id);
+
+ od.exceptions[i].id = id.c_str ();
+
+ ACE_TString container_id;
+ this->repo_->config ()->get_string_value (type_key,
+ "container_id",
+ container_id);
+
+ od.exceptions[i].defined_in = container_id.c_str ();
+
+ ACE_TString version;
+ this->repo_->config ()->get_string_value (type_key,
+ "version",
+ version);
+
+ od.exceptions[i].version = version.c_str ();
+
+ TAO_ExceptionDef_i impl (this->repo_);
+ impl.section_key (type_key);
+
+ od.exceptions[i].type = impl.type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ else
+ {
+ od.exceptions.length (0);
+ }
+}
+
+CORBA::TypeCode_ptr
+TAO_OperationDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->result_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/OperationDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/OperationDef_i.h
new file mode 100644
index 00000000000..f11a2850319
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/OperationDef_i.h
@@ -0,0 +1,184 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// OperationDef_i.h
+//
+// = DESCRIPTION
+// OperationDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_OPERATIONDEF_I_H
+#define TAO_OPERATIONDEF_I_H
+
+#include "orbsvcs/IFRService/Contained_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_OperationDef_i : public virtual TAO_Contained_i
+{
+ // = TITLE
+ // TAO_OperationDef_i
+ //
+ // = DESCRIPTION
+ // Represents the information needed to describe an operation
+ // of an interface.
+ //
+public:
+ TAO_OperationDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_OperationDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr result (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::TypeCode_ptr result_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::IDLType_ptr result_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::IDLType_ptr result_def_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void result_def (
+ CORBA::IDLType_ptr result_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void result_def_i (
+ CORBA::IDLType_ptr result_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ParDescriptionSeq *params (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ParDescriptionSeq *params_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void params (
+ const CORBA::ParDescriptionSeq &params
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void params_i (
+ const CORBA::ParDescriptionSeq &params
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::OperationMode mode (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::OperationMode mode_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void mode (
+ CORBA::OperationMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void mode_i (
+ CORBA::OperationMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ContextIdSeq *contexts (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ContextIdSeq *contexts_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void contexts (
+ const CORBA::ContextIdSeq &contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void contexts_i (
+ const CORBA::ContextIdSeq &contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ExceptionDefSeq *exceptions (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ExceptionDefSeq *exceptions_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void exceptions (
+ const CORBA::ExceptionDefSeq &exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void exceptions_i (
+ const CORBA::ExceptionDefSeq &exceptions
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // Common code for containers to call in
+ // making descriptions.
+
+ void make_description (CORBA::OperationDescription &desc
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::TypeCode_ptr type_i (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_OPERATIONDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/Options.cpp b/TAO/orbsvcs/orbsvcs/IFRService/Options.cpp
new file mode 100644
index 00000000000..26f71866bfd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/Options.cpp
@@ -0,0 +1,122 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Options.h"
+#include "ace/Get_Opt.h"
+#include "ace/Log_Msg.h"
+#include "ace/Null_Mutex.h"
+#include "ace/OS_NS_string.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+Options::Options ()
+ : ior_output_file_ (ACE_OS::strdup ("if_repo.ior")),
+ persistent_ (0),
+ persistent_file_ (ACE_OS::strdup ("ifr_default_backing_store")),
+ using_registry_ (0),
+ enable_locking_ (0),
+ support_multicast_(0)
+{
+}
+
+Options::~Options ()
+{
+ ACE_OS::free (this->ior_output_file_);
+ ACE_OS::free (this->persistent_file_);
+}
+
+int
+Options::parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:pb:lm:r");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o': // Set the IOR output filename.
+ this->ior_output_file_ = get_opts.opt_arg ();
+ break;
+ case 'p': // Make the IFR persistent
+ this->persistent_ = 1;
+ this->using_registry_ = 0;
+ break;
+ case 'b':
+ this->persistent_file_ = get_opts.opt_arg ();
+ break;
+ case 'l':
+#if defined (ACE_HAS_THREADS)
+ this->enable_locking_ = 1;
+#endif /* ACE_HAS_THREADS */
+ break;
+ case 'r': // win32 registry implementation
+#if defined (ACE_WIN32)
+ if (this->persistent_ == 0)
+ this->using_registry_ = 1;
+ break;
+#else /* ACE_WIN32 */
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("parse_args: not a win32 platform\n")
+ ),
+ 1
+ );
+#endif /* ACE_WIN32 */
+ case 'm':
+ this->support_multicast_ = ACE_OS::atoi(get_opts.opt_arg ());
+ break;
+ case '?': // display help for use of the server.
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s"
+ " [-o] <ior_output_file>"
+ " [-r]"
+ " [-l]"
+ " [-m] <0|1>"
+ " [-p]"
+ " [-b] <persistence_file>"
+ "\n",
+ argv [0]),
+ 1);
+ }
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+const char *
+Options::ior_output_file (void) const
+{
+ return this->ior_output_file_;
+}
+
+int
+Options::persistent (void) const
+{
+ return this->persistent_;
+}
+
+const char *
+Options::persistent_file (void) const
+{
+ return this->persistent_file_;
+}
+
+int
+Options::using_registry (void) const
+{
+ return this->using_registry_;
+}
+
+int
+Options::enable_locking (void) const
+{
+ return this->enable_locking_;
+}
+
+int
+Options::support_multicast_discovery (void) const
+{
+ return this->support_multicast_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/Options.h b/TAO/orbsvcs/orbsvcs/IFRService/Options.h
new file mode 100644
index 00000000000..f1453559b03
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/Options.h
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// Options.h
+//
+// = DESCRIPTION
+// This class implements the Options container for the Interface
+// Repository.
+//
+// = AUTHOR
+// Jeff Parsons
+//
+// ============================================================================
+
+#ifndef OPTIONS_H
+#define OPTIONS_H
+
+#include "ace/Singleton.h"
+#include "ace/Null_Mutex.h"
+#include "orbsvcs/IFRService/ifr_service_export.h"
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export Options
+{
+ // = TITLE
+ // Maintains the global options.
+ //
+ // = DESCRIPTION
+ // This class is converted into a Singleton by the
+ // <ACE_Singleton> template.
+public:
+ Options ();
+ // Default Constructor
+
+ ~Options();
+ // dtor
+
+ int parse_args (int argc,
+ ACE_TCHAR *argv[]);
+ // Parse the command-line arguments and initialize the options.
+
+ const char *ior_output_file (void) const;
+ // Return the file where the IOR of the server object is stored.
+
+ int persistent (void) const;
+ // Is the Interface Repository persistent?
+
+ const char *persistent_file (void) const;
+ // Return the default filename for persistent IFR.
+
+ int using_registry (void) const;
+ // Are we using a WIN32 registry as the backing store?
+
+ int enable_locking (void) const;
+ // Should the repository have a real mutex or a null mutex?
+
+ int support_multicast_discovery (void) const;
+ // should the service support discovery via multicast?
+
+private:
+ char *ior_output_file_;
+ // File where the IOR of the server object is stored.
+
+ int persistent_;
+ // Is the Interface Repository persistent?
+
+ char *persistent_file_;
+ // Default filename for persistent IFR.
+
+ int using_registry_;
+ // Are we using a WIN32 registry as the backing store?
+
+ int enable_locking_;
+ // Should the repository have a real mutex or a null mutex?
+
+ int support_multicast_;
+ // If not zero multicast is enabled.
+};
+
+// Typedef an Options Singleton.
+typedef ACE_Singleton <Options, ACE_Null_Mutex> OPTIONS;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* OPTIONS_H */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/PrimitiveDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/PrimitiveDef_i.cpp
new file mode 100644
index 00000000000..f9789c4282b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/PrimitiveDef_i.cpp
@@ -0,0 +1,142 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/PrimitiveDef_i.h"
+
+ACE_RCSID (IFRService,
+ PrimitiveDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_PrimitiveDef_i::TAO_PrimitiveDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_IDLType_i (repo)
+{
+}
+
+TAO_PrimitiveDef_i::~TAO_PrimitiveDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_PrimitiveDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Primitive;
+}
+
+void
+TAO_PrimitiveDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_PrimitiveDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 2,
+ CORBA::COMPLETED_NO));
+}
+
+CORBA::TypeCode_ptr
+TAO_PrimitiveDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_PrimitiveDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ u_int pkind = 0;
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "pkind",
+ pkind);
+
+ switch (static_cast<CORBA::PrimitiveKind> (pkind))
+ {
+ case CORBA::pk_null:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_null);
+ case CORBA::pk_void:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+ case CORBA::pk_short:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_short);
+ case CORBA::pk_long:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_long);
+ case CORBA::pk_ushort:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_ushort);
+ case CORBA::pk_ulong:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_ulong);
+ case CORBA::pk_float:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_float);
+ case CORBA::pk_double:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_double);
+ case CORBA::pk_boolean:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_boolean);
+ case CORBA::pk_char:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_char);
+ case CORBA::pk_octet:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_octet);
+ case CORBA::pk_any:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_any);
+ case CORBA::pk_TypeCode:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_TypeCode);
+ case CORBA::pk_Principal:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_Principal);
+ case CORBA::pk_string:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_string);
+ case CORBA::pk_objref:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_Object);
+ case CORBA::pk_longlong:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_longlong);
+ case CORBA::pk_ulonglong:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_ulonglong);
+ case CORBA::pk_longdouble:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_longdouble);
+ case CORBA::pk_wchar:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_wchar);
+ case CORBA::pk_wstring:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_wstring);
+ case CORBA::pk_value_base:
+ // TODO - we haven't added this typecode constant yet.
+ default:
+ return CORBA::TypeCode::_duplicate (CORBA::_tc_null);
+ }
+}
+
+CORBA::PrimitiveKind
+TAO_PrimitiveDef_i::kind (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::pk_null);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::pk_null);
+
+ return this->kind_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::PrimitiveKind
+TAO_PrimitiveDef_i::kind_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ u_int pkind = 0;
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "pkind",
+ pkind);
+
+ return static_cast<CORBA::PrimitiveKind> (pkind);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/PrimitiveDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/PrimitiveDef_i.h
new file mode 100644
index 00000000000..05103c5c7ed
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/PrimitiveDef_i.h
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// PrimitiveDef_i.h
+//
+// = DESCRIPTION
+// PrimitiveDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_PRIMITIVEDEF_I_H
+#define TAO_PRIMITIVEDEF_I_H
+
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_PrimitiveDef_i : public virtual TAO_IDLType_i
+{
+ // = TITLE
+ // TAO_PrimitiveDef_i
+ //
+ // = DESCRIPTION
+ // Represents any of the OMG IDL primitive types
+ //
+public:
+ TAO_PrimitiveDef_i (TAO_Repository_i *repo);
+ // Constructor.
+
+ virtual ~TAO_PrimitiveDef_i (void);
+ // Destructor.
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // May not be called on a primitive kind - raises BAD_INV_ORDER.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Must implement this here because it's pure virtual in the
+ // base class.
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::PrimitiveKind kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::PrimitiveKind kind_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_PRIMITIVEDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ProvidesDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ProvidesDef_i.cpp
new file mode 100644
index 00000000000..f9bf6490763
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ProvidesDef_i.cpp
@@ -0,0 +1,161 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/ProvidesDef_i.h"
+#include "orbsvcs/IFRService/IFR_ComponentsS.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils_T.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ ProvidesDef_i,
+ "$Id$")
+
+
+TAO_ProvidesDef_i::TAO_ProvidesDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo)
+{
+}
+
+TAO_ProvidesDef_i::~TAO_ProvidesDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_ProvidesDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Provides;
+}
+
+CORBA::Contained::Description *
+TAO_ProvidesDef_i::describe (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_ProvidesDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ComponentIR::ProvidesDescription pd;
+ TAO_IFR_Desc_Utils<CORBA::ComponentIR::ProvidesDescription,
+ TAO_ProvidesDef_i>::fill_desc_begin (
+ pd,
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (0);
+
+ ACE_TString base_type_id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_type",
+ base_type_id);
+ pd.interface_type = base_type_id.fast_rep ();
+
+ CORBA::Contained::Description *retval = 0;
+ ACE_NEW_RETURN (retval,
+ CORBA::Contained::Description,
+ 0);
+
+ retval->kind = CORBA::dk_Provides;
+ retval->value <<= pd;
+ return retval;
+}
+
+CORBA::InterfaceDef_ptr
+TAO_ProvidesDef_i::interface_type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::InterfaceDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::InterfaceDef::_nil ());
+
+ return this->interface_type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::InterfaceDef_ptr
+TAO_ProvidesDef_i::interface_type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_type",
+ holder);
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ holder.fast_rep (),
+ holder);
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::InterfaceDef::_nil ());
+
+ return CORBA::InterfaceDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ProvidesDef_i::interface_type (
+ CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->interface_type_i (interface_type
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ProvidesDef_i::interface_type_i (
+ CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->remove_value (this->section_key_,
+ "base_type");
+
+ if (CORBA::is_nil (interface_type))
+ {
+ return;
+ }
+
+ const char *tmp =
+ TAO_IFR_Service_Utils::reference_to_path (interface_type);
+
+ ACE_Configuration_Section_Key new_key;
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ tmp,
+ new_key,
+ 0);
+
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (new_key,
+ "id",
+ holder);
+
+ this->repo_->config ()->set_string_value (
+ this->section_key_,
+ "base_type",
+ holder
+ );
+}
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ProvidesDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ProvidesDef_i.h
new file mode 100644
index 00000000000..e07923a3fee
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ProvidesDef_i.h
@@ -0,0 +1,101 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ProvidesDef_i.h
+//
+// = DESCRIPTION
+// ProvidesDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_PROVIDESDEF_I_H
+#define TAO_PROVIDESDEF_I_H
+
+#include "orbsvcs/IFRService/Contained_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ProvidesDef_i : public virtual TAO_Contained_i
+{
+ // = TITLE
+ // TAO_ProvidesDef_i
+ //
+ // = DESCRIPTION
+ // Represents an interface that is provided by a component.
+ //
+public:
+ TAO_ProvidesDef_i (TAO_Repository_i *repoy);
+ // Constructor
+
+ virtual ~TAO_ProvidesDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::InterfaceDef_ptr interface_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::InterfaceDef_ptr interface_type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void interface_type (
+ CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void interface_type_i (
+ CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_PROVIDESDEF_I_H */
+
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/PublishesDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/PublishesDef_i.cpp
new file mode 100644
index 00000000000..1a06feb5687
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/PublishesDef_i.cpp
@@ -0,0 +1,30 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "orbsvcs/IFRService/PublishesDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+
+ACE_RCSID (IFRService,
+ PublishesDef_i,
+ "$Id$")
+
+TAO_PublishesDef_i::TAO_PublishesDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo),
+ TAO_EventPortDef_i (repo)
+{
+}
+
+TAO_PublishesDef_i::~TAO_PublishesDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_PublishesDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Publishes;
+}
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/PublishesDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/PublishesDef_i.h
new file mode 100644
index 00000000000..613bc9010e1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/PublishesDef_i.h
@@ -0,0 +1,67 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// PublishesDef_i.h
+//
+// = DESCRIPTION
+// PublishesDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_PUBLISHESDEF_I_H
+#define TAO_PUBLISHESDEF_I_H
+
+#include "orbsvcs/IFRService/EventPortDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_PublishesDef_i
+ : public virtual TAO_EventPortDef_i
+{
+ // = TITLE
+ // TAO_PublishesDef_i
+ //
+ // = DESCRIPTION
+ // Represents the definition of an event that is published
+ // by a component.
+ //
+public:
+ TAO_PublishesDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_PublishesDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_PUBLISHESDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/RecursDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/RecursDef_i.cpp
new file mode 100644
index 00000000000..a6e4c6a6051
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/RecursDef_i.cpp
@@ -0,0 +1,47 @@
+// $Id$
+
+#include "orbsvcs/IFRService/RecursDef_i.h"
+
+
+ACE_RCSID (IFRService,
+ RecursDef_i,
+ "RecursDef_i.cpp,v 1.1 2004/10/18 09:00:00 SMA Exp")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//-----------------------------------------------------------------------------
+// Class TAO_RecursiveDef_OuterScopes is a support class for StructDef_i.h and
+// UnionDef_i.h files. It creates a stack of outer structure definitions, used
+// by TAO_StructDef_i::type_i(), and TAO_UnionDef_i::type_i() during nested
+// structure processing.
+//-----------------------------------------------------------------------------
+
+TAO_RecursiveDef_OuterScopes::TAO_RecursiveDef_OuterScopes( const ACE_TString &id )
+ : id_( id ), pNextOuterID_( pIDsSeenAlready )
+{
+ pIDsSeenAlready= this; // "Push" this scope
+}
+
+TAO_RecursiveDef_OuterScopes::~TAO_RecursiveDef_OuterScopes()
+{
+ pIDsSeenAlready= pNextOuterID_; // "Pop" this scope
+}
+
+bool TAO_RecursiveDef_OuterScopes::SeenBefore( const ACE_TString &id )
+{
+ for ( const TAO_RecursiveDef_OuterScopes *pOuterScope= pIDsSeenAlready;
+ pOuterScope;
+ pOuterScope= pOuterScope->pNextOuterID_ )
+ {
+ if (pOuterScope->id_ == id)
+ return true;
+ }
+
+ return false;
+}
+
+const TAO_RecursiveDef_OuterScopes
+ *TAO_RecursiveDef_OuterScopes::pIDsSeenAlready= 0;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/RecursDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/RecursDef_i.h
new file mode 100644
index 00000000000..5fdf5b7e7a0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/RecursDef_i.h
@@ -0,0 +1,68 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// RecursDef_i.h
+//
+// = DESCRIPTION
+// StructDef & UnionDef support class.
+//
+// = AUTHOR
+// Simon Massey <sma@prismtech.com>
+//
+// ============================================================================
+
+#ifndef TAO_RECURSDEF_I_H
+#define TAO_RECURSDEF_I_H
+
+#include "orbsvcs/IFRService/TypedefDef_i.h"
+#include "ace/SString.h"
+#include "ace/OS_NS_stdlib.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 */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//-----------------------------------------------------------------------------
+// Class TAO_RecursiveDef_OuterScopes is a support class for StructDef_i.h and
+// UnionDef_i.h files. It creates a stack of outer structure definitions, used
+// by TAO_StructDef_i::type_i(), and TAO_UnionDef_i::type_i() during nested
+// structure processing.
+//-----------------------------------------------------------------------------
+
+class TAO_RecursiveDef_OuterScopes
+{
+public:
+ TAO_RecursiveDef_OuterScopes( const ACE_TString &id ); // "Push" scope's ID
+ ~TAO_RecursiveDef_OuterScopes(); // "Pop" this scope
+
+ static bool SeenBefore( const ACE_TString &id ); // Check for outer ID
+
+private: // Data
+ const ACE_TString id_;
+ const TAO_RecursiveDef_OuterScopes *const pNextOuterID_;
+
+ static const TAO_RecursiveDef_OuterScopes *pIDsSeenAlready;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_RECURSDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/Repository_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/Repository_i.cpp
new file mode 100644
index 00000000000..028f07f18cc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/Repository_i.cpp
@@ -0,0 +1,1150 @@
+// $Id$
+
+#include "orbsvcs/IFRService/concrete_classes.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/Options.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "tao/ORB.h"
+#include "tao/Object_KeyC.h"
+
+#include "ace/Auto_Ptr.h"
+#include "ace/Lock_Adapter_T.h"
+#include "ace/SString.h"
+
+ACE_RCSID (IFR_Service,
+ Repository_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Repository_i::TAO_Repository_i (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ ACE_Configuration *config)
+ : TAO_IRObject_i (0),
+ TAO_Container_i (0),
+ orb_ (orb),
+ root_poa_ (poa),
+ config_ (config),
+ extension_ (CORBA::string_dup ("TAO_IFR_name_extension")),
+ lock_ (0)
+{
+}
+
+TAO_Repository_i::~TAO_Repository_i (void)
+{
+ delete this->lock_;
+}
+
+CORBA::DefinitionKind
+TAO_Repository_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Repository;
+}
+
+void
+TAO_Repository_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 2,
+ CORBA::COMPLETED_NO));
+}
+
+CORBA::Contained_ptr
+TAO_Repository_i::lookup_id (const char *search_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::Contained::_nil ());
+
+ return this->lookup_id_i (search_id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Contained_ptr
+TAO_Repository_i::lookup_id_i (const char *search_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (ACE_OS::strcmp (search_id, "IDL:omg.org/CORBA/Object:1.0") == 0
+ || ACE_OS::strcmp (search_id, "IDL:omg.org/CORBA/ValueBase:1.0") == 0)
+ {
+ return CORBA::Contained::_nil ();
+ }
+
+ ACE_TString path;
+ if (this->config_->get_string_value (this->repo_ids_key_,
+ search_id,
+ path)
+ != 0)
+ {
+ return CORBA::Contained::_nil ();
+ }
+
+ ACE_Configuration_Section_Key key;
+ this->config_->expand_path (this->root_key_,
+ path,
+ key);
+
+ u_int kind = 0;
+ this->config_->get_integer_value (key,
+ "def_kind",
+ kind);
+
+ CORBA::DefinitionKind def_kind =
+ static_cast<CORBA::DefinitionKind> (kind);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (def_kind,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Contained::_nil ());
+
+ return CORBA::Contained::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_Repository_i::get_canonical_typecode (CORBA::TypeCode_ptr tc
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->get_canonical_typecode_i (tc
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_Repository_i::get_canonical_typecode_i (CORBA::TypeCode_ptr tc
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::TCKind kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ switch (kind)
+ {
+ // For all the TCKinds not covered below, no change is needed.
+ default:
+ return CORBA::TypeCode::_duplicate (tc);
+ case CORBA::tk_fixed:
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CORBA::TypeCode::_nil ());
+ case CORBA::tk_array:
+ {
+ CORBA::ULong length = tc->length (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ CORBA::TypeCode_var ctype = tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ CORBA::TypeCode_var canon_ctype =
+ this->get_canonical_typecode_i (ctype.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->tc_factory ()->create_array_tc (length,
+ canon_ctype.in ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+ case CORBA::tk_sequence:
+ {
+ CORBA::ULong length = tc->length (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ CORBA::TypeCode_var ctype = tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ CORBA::TypeCode_var canon_ctype =
+ this->get_canonical_typecode_i (ctype.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->tc_factory ()->create_sequence_tc (length,
+ canon_ctype.in ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+ case CORBA::tk_alias:
+ case CORBA::tk_objref:
+ case CORBA::tk_struct:
+ case CORBA::tk_union:
+ case CORBA::tk_enum:
+ case CORBA::tk_except:
+ case CORBA::tk_value:
+ case CORBA::tk_value_box:
+ case CORBA::tk_native:
+ case CORBA::tk_abstract_interface:
+ case CORBA::tk_component:
+ case CORBA::tk_home:
+ {
+ CORBA::String_var id = tc->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ ACE_TString path;
+ int status =
+ this->config ()->get_string_value (this->repo_ids_key (),
+ id.in (),
+ path);
+
+ // TODO - something in case the repo id is an empty string,
+ // or if it is not found in this repository
+ if (status != 0)
+ {
+ return CORBA::TypeCode::_nil ();
+ }
+
+ ACE_Configuration_Section_Key key;
+ this->config ()->expand_path (this->root_key (),
+ path,
+ key,
+ 0);
+
+ // An ExceptionDef is not an IDLType.
+ if (kind == CORBA::tk_except)
+ {
+ TAO_ExceptionDef_i impl (this->repo_);
+ impl.section_key (key);
+ return impl.type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ else
+ {
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (path,
+ this);
+ impl->section_key (key);
+ return impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ }
+ }
+}
+
+CORBA::PrimitiveDef_ptr
+TAO_Repository_i::get_primitive (CORBA::PrimitiveKind kind
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString obj_id ("pkinds\\");
+
+ obj_id += this->pkind_to_string (kind);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Primitive,
+ obj_id.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::PrimitiveDef::_nil ());
+
+ return CORBA::PrimitiveDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::StringDef_ptr
+TAO_Repository_i::create_string (CORBA::ULong bound
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::StringDef::_nil ());
+
+ return this->create_string_i (bound
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::StringDef_ptr
+TAO_Repository_i::create_string_i (CORBA::ULong bound
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ u_int count = 0;
+ this->config_->get_integer_value (this->strings_key_,
+ "count",
+ count);
+
+ char *name = TAO_IFR_Service_Utils::int_to_string (count++);
+ this->config_->set_integer_value (this->strings_key_,
+ "count",
+ count);
+
+ // Make new database entry.
+ ACE_Configuration_Section_Key new_key;
+ this->config_->open_section (this->strings_key_,
+ name,
+ 1,
+ new_key);
+
+ this->config_->set_integer_value (new_key,
+ "bound",
+ bound);
+
+ this->config_->set_integer_value (new_key,
+ "def_kind",
+ CORBA::dk_String);
+
+ this->config_->set_string_value (new_key,
+ "name",
+ name);
+
+ // Create the object reference.
+ ACE_TString obj_id ("strings\\");
+ obj_id += name;
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_String,
+ obj_id.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::StringDef::_nil ());
+
+ return CORBA::StringDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::WstringDef_ptr
+TAO_Repository_i::create_wstring (CORBA::ULong bound
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::WstringDef::_nil ());
+
+ return this->create_wstring_i (bound
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::WstringDef_ptr
+TAO_Repository_i::create_wstring_i (CORBA::ULong bound
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ u_int count = 0;
+ this->config_->get_integer_value (this->wstrings_key_,
+ "count",
+ count);
+
+ char *name = TAO_IFR_Service_Utils::int_to_string (count++);
+ this->config_->set_integer_value (this->wstrings_key_,
+ "count",
+ count);
+
+ // Make new database entry.
+ ACE_Configuration_Section_Key new_key;
+ this->config_->open_section (this->wstrings_key_,
+ name,
+ 1,
+ new_key);
+
+ this->config_->set_integer_value (new_key,
+ "bound",
+ bound);
+
+ this->config_->set_integer_value (new_key,
+ "def_kind",
+ CORBA::dk_Wstring);
+
+ this->config_->set_string_value (new_key,
+ "name",
+ name);
+
+ // Create the object reference.
+ ACE_TString obj_id ("wstrings\\");
+ obj_id += name;
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Wstring,
+ obj_id.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::WstringDef::_nil ());
+
+ return CORBA::WstringDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::SequenceDef_ptr
+TAO_Repository_i::create_sequence (CORBA::ULong bound,
+ CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::SequenceDef::_nil ());
+
+ return this->create_sequence_i (bound,
+ element_type
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::SequenceDef_ptr
+TAO_Repository_i::create_sequence_i (CORBA::ULong bound,
+ CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ u_int count = 0;
+ this->config_->get_integer_value (this->sequences_key_,
+ "count",
+ count);
+
+ char *name = TAO_IFR_Service_Utils::int_to_string (count++);
+ this->config_->set_integer_value (this->sequences_key_,
+ "count",
+ count);
+
+ // Make new database entry.
+ ACE_Configuration_Section_Key new_key;
+ this->config_->open_section (this->sequences_key_,
+ name,
+ 1,
+ new_key);
+
+ // Set the bound attribute.
+ this->config_->set_integer_value (new_key,
+ "bound",
+ bound);
+
+ // Set the def_kind attribute.
+ this->config_->set_integer_value (new_key,
+ "def_kind",
+ CORBA::dk_Sequence);
+
+ // Set the "name" for destroy to use.
+ this->config_->set_string_value (new_key,
+ "name",
+ name);
+
+ char *element_path =
+ TAO_IFR_Service_Utils::reference_to_path (element_type);
+
+ // To get key to element type.
+ this->config_->set_string_value (new_key,
+ "element_path",
+ element_path);
+
+ // Create the object reference.
+ ACE_TString obj_id ("sequences\\");
+ obj_id += name;
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Sequence,
+ obj_id.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::SequenceDef::_nil ());
+
+ return CORBA::SequenceDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ArrayDef_ptr
+TAO_Repository_i::create_array (CORBA::ULong length,
+ CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ArrayDef::_nil ());
+
+ return this->create_array_i (length,
+ element_type
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ArrayDef_ptr
+TAO_Repository_i::create_array_i (CORBA::ULong length,
+ CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ u_int count = 0;
+ this->config_->get_integer_value (this->arrays_key_,
+ "count",
+ count);
+
+ char *name = TAO_IFR_Service_Utils::int_to_string (count++);
+ this->config_->set_integer_value (this->arrays_key_,
+ "count",
+ count);
+
+ // Make new database entry.
+ ACE_Configuration_Section_Key new_key;
+ this->config_->open_section (this->arrays_key_,
+ name,
+ 1,
+ new_key);
+
+ // Set the length attribute.
+ this->config_->set_integer_value (new_key,
+ "length",
+ length);
+
+ // Set the def_kind attribute.
+ this->config_->set_integer_value (new_key,
+ "def_kind",
+ CORBA::dk_Array);
+
+ // Set the "name" for destroy to use.
+ this->config_->set_string_value (new_key,
+ "name",
+ name);
+
+ char *element_path =
+ TAO_IFR_Service_Utils::reference_to_path (element_type);
+
+ // To get key to element type.
+ this->config_->set_string_value (new_key,
+ "element_path",
+ element_path);
+
+ // Create the object reference.
+ ACE_TString obj_id ("arrays\\");
+ obj_id += name;
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Array,
+ obj_id.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ArrayDef::_nil ());
+
+ return CORBA::ArrayDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::FixedDef_ptr
+TAO_Repository_i::create_fixed (CORBA::UShort digits,
+ CORBA::Short scale
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::FixedDef::_nil ());
+
+ return this->create_fixed_i (digits,
+ scale
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::FixedDef_ptr
+TAO_Repository_i::create_fixed_i (CORBA::UShort /* digits */,
+ CORBA::Short /* scale */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CORBA::FixedDef::_nil ());
+}
+
+int
+TAO_Repository_i::repo_init (CORBA::Repository_ptr repo_ref,
+ PortableServer::POA_ptr repo_poa
+ ACE_ENV_ARG_DECL)
+{
+ this->repo_objref_ = repo_ref;
+ this->repo_poa_ = repo_poa;
+
+ // Create the appropriate lock.
+ if (OPTIONS::instance ()->enable_locking ())
+ {
+ ACE_NEW_THROW_EX (this->lock_,
+ ACE_Lock_Adapter<TAO_SYNCH_MUTEX> (),
+ CORBA::NO_MEMORY ());
+ }
+ else
+ {
+ ACE_NEW_THROW_EX (this->lock_,
+ ACE_Lock_Adapter<ACE_SYNCH_NULL_MUTEX> (),
+ CORBA::NO_MEMORY ());
+ }
+ ACE_CHECK_RETURN (-1);
+
+ // Resolve and narrow the TypeCodeFactory.
+ CORBA::Object_var object =
+ this->orb_->resolve_initial_references ("TypeCodeFactory"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (!CORBA::is_nil (object.in ()))
+ {
+ this->tc_factory_ =
+ CORBA::TypeCodeFactory::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (this->tc_factory_.in ()))
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("Repository: TypeCodeFactory narrow failed\n")
+ ),
+ -1
+ );
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("Repository: TypeCodeFactory resolve failed\n")
+ ),
+ -1
+ );
+ }
+
+ // Resolve and narrow the POACurrent object.
+ object =
+ this->orb_->resolve_initial_references ("POACurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (!CORBA::is_nil (object.in ()))
+ {
+ this->poa_current_ =
+ PortableServer::Current::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (this->poa_current_.in ()))
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("Repository: POACurrent narrow failed\n")
+ ),
+ -1
+ );
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("Repository: POACurrent resolve failed\n")
+ ),
+ -1
+ );
+ }
+
+ if (this->create_sections () != 0)
+ {
+ return -1;
+ }
+
+ int status = this->create_servants_and_poas (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_Repository_i::create_sections (void)
+{
+ this->config_->open_section (config_->root_section (),
+ "root",
+ 1, // Will create if IFR is not persistent.
+ this->root_key_);
+
+ this->config_->open_section (this->root_key_,
+ "repo_ids",
+ 1, // Will create if IFR is not persistent.
+ this->repo_ids_key_);
+
+ int status =
+ this->config_->open_section (this->root_key_,
+ "pkinds",
+ 0, // Don't create
+ this->pkinds_key_);
+
+ if (status != 0)
+ // IFR is non-persistent or is being run for the first time.
+ // Must add entries for primitive kinds.
+ {
+ this->config_->open_section (this->root_key_,
+ "pkinds",
+ 1, // It doesn't exist so create it.
+ this->pkinds_key_);
+
+ u_int num_pkinds = this->num_pkinds ();
+
+ for (u_int i = 0; i < num_pkinds; ++i)
+ {
+ ACE_Configuration_Section_Key key;
+ CORBA::PrimitiveKind pkind = static_cast<CORBA::PrimitiveKind> (i);
+
+ this->config_->open_section (this->pkinds_key_,
+ this->pkind_to_string (pkind),
+ 1,
+ key);
+
+ this->config_->set_integer_value (key,
+ "def_kind",
+ CORBA::dk_Primitive);
+
+ this->config_->set_integer_value (key,
+ "pkind",
+ i);
+
+ }
+ }
+
+ this->config_->open_section (this->root_key_,
+ "strings",
+ 1,
+ this->strings_key_);
+
+ this->config_->open_section (this->root_key_,
+ "wstrings",
+ 1,
+ this->wstrings_key_);
+
+ this->config_->open_section (this->root_key_,
+ "fixeds",
+ 1,
+ this->fixeds_key_);
+
+ this->config_->open_section (this->root_key_,
+ "arrays",
+ 1,
+ this->arrays_key_);
+
+ this->config_->open_section (this->root_key_,
+ "sequences",
+ 1,
+ this->sequences_key_);
+
+ u_int count = 0;
+
+ // If repository is not persistent, we need to set all
+ // the "count" fields to 0. We test just one for existence.
+ status =
+ this->config_->get_integer_value (this->strings_key_,
+ "count",
+ count);
+
+ if (status == -1) // Field "count" does not exist.
+ {
+ this->config_->set_integer_value (this->strings_key_,
+ "count",
+ 0);
+
+ this->config_->set_integer_value (this->wstrings_key_,
+ "count",
+ 0);
+
+ this->config_->set_integer_value (this->fixeds_key_,
+ "count",
+ 0);
+
+ this->config_->set_integer_value (this->arrays_key_,
+ "count",
+ 0);
+
+ this->config_->set_integer_value (this->sequences_key_,
+ "count",
+ 0);
+ }
+
+ // The following are done because we are also a Container.
+ this->repo_ = this;
+ this->section_key_ = this->root_key_;
+
+ this->config_->set_string_value (this->section_key_,
+ "absolute_name",
+ "");
+
+ this->config_->set_string_value (this->section_key_,
+ "id",
+ ""); // required by spec
+
+ this->config_->set_string_value (this->section_key_,
+ "name",
+ "");
+
+ this->config_->set_integer_value (this->section_key_,
+ "def_kind",
+ CORBA::dk_Repository);
+
+ return 0;
+}
+
+int
+TAO_Repository_i::create_servants_and_poas (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::PolicyList policies (5);
+ policies.length (5);
+
+ // ID Assignment Policy.
+ policies[0] =
+ this->root_poa_->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Lifespan Policy.
+ policies[1] =
+ this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Request Processing Policy.
+ policies[2] =
+ this->root_poa_->create_request_processing_policy (
+ PortableServer::USE_DEFAULT_SERVANT
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (-1);
+
+ // Servant Retention Policy.
+ policies[3] =
+ this->root_poa_->create_servant_retention_policy (
+ PortableServer::NON_RETAIN
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (-1);
+
+ // Id Uniqueness Policy.
+ policies[4] =
+ this->root_poa_->create_id_uniqueness_policy (
+ PortableServer::MULTIPLE_ID
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (-1);
+
+ PortableServer::POAManager_var poa_manager =
+ this->root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+#define GEN_IR_OBJECT(name) \
+ this-> name ## _poa_ = \
+ this->root_poa_->create_POA (#name "_poa", \
+ poa_manager.in (), \
+ policies \
+ ACE_ENV_ARG_PARAMETER); \
+ ACE_CHECK_RETURN (-1); \
+ TAO_ ## name ## _i * name ## _impl = 0; \
+ ACE_NEW_RETURN (name ## _impl, \
+ TAO_ ## name ## _i (this), \
+ -1); \
+ ACE_NEW_RETURN (this-> name ## _servant_, \
+ POA_CORBA:: name ## _tie<TAO_ ## name ## _i> ( \
+ name ## _impl, \
+ this-> name ## _poa_.in (), \
+ 1 \
+ ), \
+ -1); \
+ PortableServer::ServantBase_var name ## _safety ( \
+ this-> name ## _servant_ \
+ ); \
+ this-> name ## _poa_->set_servant (this-> name ## _servant_ \
+ ACE_ENV_ARG_PARAMETER); \
+ ACE_CHECK_RETURN (-1);
+
+ CONCRETE_IR_OBJECT_TYPES
+
+#undef GEN_IR_OBJECT
+#undef CONCRETE_IR_OBJECT_TYPES
+
+ CORBA::ULong length = policies.length ();
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ CORBA::Policy_ptr policy = policies[i];
+ policy->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ return 0;
+}
+
+TAO_IDLType_i *
+TAO_Repository_i::select_idltype (CORBA::DefinitionKind def_kind) const
+{
+ switch (def_kind)
+ {
+ case CORBA::dk_AbstractInterface:
+ return this->ExtAbstractInterfaceDef_servant_->_tied_object ();
+ case CORBA::dk_Alias:
+ return this->AliasDef_servant_->_tied_object ();
+ case CORBA::dk_Array:
+ return this->ArrayDef_servant_->_tied_object ();
+ case CORBA::dk_Enum:
+ return this->EnumDef_servant_->_tied_object ();
+ case CORBA::dk_Fixed:
+ return this->FixedDef_servant_->_tied_object ();
+ case CORBA::dk_Interface:
+ return this->ExtInterfaceDef_servant_->_tied_object ();
+ case CORBA::dk_LocalInterface:
+ return this->ExtLocalInterfaceDef_servant_->_tied_object ();
+ case CORBA::dk_Native:
+ return this->NativeDef_servant_->_tied_object ();
+ case CORBA::dk_Primitive:
+ return this->PrimitiveDef_servant_->_tied_object ();
+ case CORBA::dk_Sequence:
+ return this->SequenceDef_servant_->_tied_object ();
+ case CORBA::dk_String:
+ return this->StringDef_servant_->_tied_object ();
+ case CORBA::dk_Struct:
+ return this->StructDef_servant_->_tied_object ();
+ case CORBA::dk_Union:
+ return this->UnionDef_servant_->_tied_object ();
+ case CORBA::dk_ValueBox:
+ return this->ValueBoxDef_servant_->_tied_object ();
+ case CORBA::dk_Value:
+ return this->ExtValueDef_servant_->_tied_object ();
+ case CORBA::dk_Wstring:
+ return this->WstringDef_servant_->_tied_object ();
+ default:
+ return 0;
+ }
+}
+
+TAO_Container_i *
+TAO_Repository_i::select_container (CORBA::DefinitionKind def_kind) const
+{
+ switch (def_kind)
+ {
+ case CORBA::dk_AbstractInterface:
+ return this->ExtAbstractInterfaceDef_servant_->_tied_object ();
+ case CORBA::dk_Exception:
+ return this->ExceptionDef_servant_->_tied_object ();
+ case CORBA::dk_Interface:
+ return this->ExtInterfaceDef_servant_->_tied_object ();
+ case CORBA::dk_LocalInterface:
+ return this->ExtLocalInterfaceDef_servant_->_tied_object ();
+ case CORBA::dk_Repository:
+ return const_cast<TAO_Repository_i *> (this);
+ case CORBA::dk_Struct:
+ return this->StructDef_servant_->_tied_object ();
+ case CORBA::dk_Union:
+ return this->UnionDef_servant_->_tied_object ();
+ case CORBA::dk_Value:
+ return this->ExtValueDef_servant_->_tied_object ();
+ default:
+ return 0;
+ }
+}
+
+TAO_Contained_i *
+TAO_Repository_i::select_contained (CORBA::DefinitionKind def_kind) const
+{
+ switch (def_kind)
+ {
+ case CORBA::dk_AbstractInterface:
+ return this->ExtAbstractInterfaceDef_servant_->_tied_object ();
+ case CORBA::dk_Alias:
+ return this->AliasDef_servant_->_tied_object ();
+ case CORBA::dk_Attribute:
+ return this->AttributeDef_servant_->_tied_object ();
+ case CORBA::dk_Constant:
+ return this->ConstantDef_servant_->_tied_object ();
+ case CORBA::dk_Enum:
+ return this->EnumDef_servant_->_tied_object ();
+ case CORBA::dk_Exception:
+ return this->ExceptionDef_servant_->_tied_object ();
+ case CORBA::dk_Interface:
+ return this->ExtInterfaceDef_servant_->_tied_object ();
+ case CORBA::dk_LocalInterface:
+ return this->ExtLocalInterfaceDef_servant_->_tied_object ();
+ case CORBA::dk_Native:
+ return this->NativeDef_servant_->_tied_object ();
+ case CORBA::dk_Operation:
+ return this->OperationDef_servant_->_tied_object ();
+ case CORBA::dk_Struct:
+ return this->StructDef_servant_->_tied_object ();
+ case CORBA::dk_Union:
+ return this->UnionDef_servant_->_tied_object ();
+ case CORBA::dk_ValueBox:
+ return this->ValueBoxDef_servant_->_tied_object ();
+ case CORBA::dk_Value:
+ return this->ExtValueDef_servant_->_tied_object ();
+ case CORBA::dk_ValueMember:
+ return this->ValueMemberDef_servant_->_tied_object ();
+ default:
+ return 0;
+ }
+}
+
+PortableServer::POA_ptr
+TAO_Repository_i::select_poa (CORBA::DefinitionKind def_kind) const
+{
+ switch (def_kind)
+ {
+ case CORBA::dk_AbstractInterface:
+ return this->ExtAbstractInterfaceDef_poa_.in ();
+ case CORBA::dk_Alias:
+ return this->AliasDef_poa_.in ();
+ case CORBA::dk_Array:
+ return this->ArrayDef_poa_.in ();
+ case CORBA::dk_Attribute:
+ return this->AttributeDef_poa_.in ();
+ case CORBA::dk_Constant:
+ return this->ConstantDef_poa_.in ();
+ case CORBA::dk_Enum:
+ return this->EnumDef_poa_.in ();
+ case CORBA::dk_Exception:
+ return this->ExceptionDef_poa_.in ();
+ case CORBA::dk_Fixed:
+ return this->FixedDef_poa_.in ();
+ case CORBA::dk_Interface:
+ return this->ExtInterfaceDef_poa_.in ();
+ case CORBA::dk_LocalInterface:
+ return this->ExtLocalInterfaceDef_poa_.in ();
+ case CORBA::dk_Native:
+ return this->NativeDef_poa_.in ();
+ case CORBA::dk_Operation:
+ return this->OperationDef_poa_.in ();
+ case CORBA::dk_Primitive:
+ return this->PrimitiveDef_poa_.in ();
+ case CORBA::dk_Sequence:
+ return this->SequenceDef_poa_.in ();
+ case CORBA::dk_String:
+ return this->StringDef_poa_.in ();
+ case CORBA::dk_Struct:
+ return this->StructDef_poa_.in ();
+ case CORBA::dk_Union:
+ return this->UnionDef_poa_.in ();
+ case CORBA::dk_ValueBox:
+ return this->ValueBoxDef_poa_.in ();
+ case CORBA::dk_Value:
+ return this->ExtValueDef_poa_.in ();
+ case CORBA::dk_ValueMember:
+ return this->ValueMemberDef_poa_.in ();
+ case CORBA::dk_Wstring:
+ return this->WstringDef_poa_.in ();
+ default:
+ return PortableServer::POA::_nil ();
+ }
+}
+
+PortableServer::Current_ptr
+TAO_Repository_i::poa_current (void) const
+{
+ return this->poa_current_.in ();
+}
+
+ACE_Configuration *
+TAO_Repository_i::config (void) const
+{
+ return this->config_;
+}
+
+CORBA::TypeCodeFactory_ptr
+TAO_Repository_i::tc_factory (void) const
+{
+ return this->tc_factory_.in ();
+}
+
+CORBA::Repository_ptr
+TAO_Repository_i::repo_objref (void) const
+{
+ return CORBA::Repository::_duplicate (this->repo_objref_.in ());
+}
+
+void
+TAO_Repository_i::repo_objref (CORBA::Repository_ptr objref)
+{
+ this->repo_objref_ = objref;
+}
+
+ACE_Configuration_Section_Key
+TAO_Repository_i::root_key (void) const
+{
+ return this->root_key_;
+}
+
+ACE_Configuration_Section_Key
+TAO_Repository_i::repo_ids_key (void) const
+{
+ return this->repo_ids_key_;
+}
+
+ACE_Configuration_Section_Key
+TAO_Repository_i::pkinds_key (void) const
+{
+ return this->pkinds_key_;
+}
+
+ACE_Configuration_Section_Key
+TAO_Repository_i::strings_key (void) const
+{
+ return this->strings_key_;
+}
+
+ACE_Configuration_Section_Key
+TAO_Repository_i::wstrings_key (void) const
+{
+ return this->wstrings_key_;
+}
+
+ACE_Configuration_Section_Key
+TAO_Repository_i::fixeds_key (void) const
+{
+ return this->fixeds_key_;
+}
+
+ACE_Configuration_Section_Key
+TAO_Repository_i::arrays_key (void) const
+{
+ return this->arrays_key_;
+}
+
+ACE_Configuration_Section_Key
+TAO_Repository_i::sequences_key (void) const
+{
+ return this->sequences_key_;
+}
+
+const char *
+TAO_Repository_i::extension (void) const
+{
+ return this->extension_.in ();
+}
+
+ACE_Lock &
+TAO_Repository_i::lock (void) const
+{
+ return *this->lock_;
+}
+
+const char * TAO_Repository_i::TAO_IFR_primitive_kinds[] =
+ {
+ "pk_null",
+ "pk_void",
+ "pk_short",
+ "pk_long",
+ "pk_ushort",
+ "pk_ulong",
+ "pk_float",
+ "pk_double",
+ "pk_boolean",
+ "pk_char",
+ "pk_octet",
+ "pk_any",
+ "pk_TypeCode",
+ "pk_Principal",
+ "pk_string",
+ "pk_objref",
+ "pk_longlong",
+ "pk_ulonglong",
+ "pk_longdouble",
+ "pk_wchar",
+ "pk_wstring",
+ "pk_value_base"
+ };
+
+const char *
+TAO_Repository_i::pkind_to_string (CORBA::PrimitiveKind pkind) const
+{
+ return TAO_Repository_i::TAO_IFR_primitive_kinds[pkind];
+}
+
+u_int
+TAO_Repository_i::num_pkinds (void) const
+{
+ return sizeof (TAO_Repository_i::TAO_IFR_primitive_kinds) / sizeof (char*);
+}
+
+// For debugging use only.
+void
+TAO_Repository_i::shutdown (void)
+{
+ this->orb_->shutdown (0);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/Repository_i.h b/TAO/orbsvcs/orbsvcs/IFRService/Repository_i.h
new file mode 100644
index 00000000000..06cbfdc2360
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/Repository_i.h
@@ -0,0 +1,386 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// Repository_i.h
+//
+// = DESCRIPTION
+// Repository servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef REPOSITORY_I_H
+#define REPOSITORY_I_H
+
+#include "orbsvcs/IFRService/Container_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+#include "orbsvcs/IFRService/IFR_macro.h"
+#include "tao/TypeCodeFactory/TypeCodeFactory_Loader.h"
+#include "tao/CORBA_String.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class IFR_Servant_Factory;
+
+class TAO_IDLType_i;
+class TAO_Container_i;
+class TAO_Contained_i;
+class TAO_ExtAbstractInterfaceDef_i;
+class TAO_AliasDef_i;
+class TAO_ArrayDef_i;
+class TAO_AttributeDef_i;
+class TAO_ConstantDef_i;
+class TAO_EnumDef_i;
+class TAO_ExceptionDef_i;
+class TAO_FixedDef_i;
+class TAO_ExtInterfaceDef_i;
+class TAO_ExtLocalInterfaceDef_i;
+class TAO_NativeDef_i;
+class TAO_OperationDef_i;
+class TAO_PrimitiveDef_i;
+class TAO_SequenceDef_i;
+class TAO_StringDef_i;
+class TAO_StructDef_i;
+class TAO_UnionDef_i;
+class TAO_ValueBoxDef_i;
+class TAO_ExtValueDef_i;
+class TAO_ValueMemberDef_i;
+class TAO_WstringDef_i;
+
+class TAO_IFRService_Export TAO_Repository_i : public virtual TAO_Container_i
+{
+ // = TITLE
+ // TAO_Repository_i
+ //
+ // = DESCRIPTION
+ // Provides global access to the Interface Repository, but
+ // does not support access to information related to
+ // CORBA Components.
+ //
+public:
+ TAO_Repository_i (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ ACE_Configuration *config);
+
+ virtual ~TAO_Repository_i (void);
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Accessor for the readonly attribute.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // May not be called on a repository - raises BAD_INV_ORDER.
+
+ virtual CORBA::Contained_ptr lookup_id (
+ const char *search_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Contained_ptr lookup_id_i (
+ const char *search_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::TypeCode_ptr get_canonical_typecode (
+ CORBA::TypeCode_ptr tc
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::TypeCode_ptr get_canonical_typecode_i (
+ CORBA::TypeCode_ptr tc
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::PrimitiveDef_ptr get_primitive (
+ CORBA::PrimitiveKind kind
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // No locking necessary because the database is not
+ // accessed.
+
+ virtual CORBA::StringDef_ptr create_string (
+ CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::StringDef_ptr create_string_i (
+ CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::WstringDef_ptr create_wstring (
+ CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::WstringDef_ptr create_wstring_i (
+ CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::SequenceDef_ptr create_sequence (
+ CORBA::ULong bound,
+ CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC (( CORBA::SystemException));
+
+ CORBA::SequenceDef_ptr create_sequence_i (
+ CORBA::ULong bound,
+ CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC (( CORBA::SystemException));
+
+ virtual CORBA::ArrayDef_ptr create_array (
+ CORBA::ULong length,
+ CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ArrayDef_ptr create_array_i (
+ CORBA::ULong length,
+ CORBA::IDLType_ptr element_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::FixedDef_ptr create_fixed (
+ CORBA::UShort digits,
+ CORBA::Short scale
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::FixedDef_ptr create_fixed_i (
+ CORBA::UShort digits,
+ CORBA::Short scale
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ int repo_init (CORBA::Repository_ptr repo_ref,
+ PortableServer::POA_ptr repo_poa
+ ACE_ENV_ARG_DECL);
+ // Called at startup to get everything initialized.
+
+ virtual int create_servants_and_poas (ACE_ENV_SINGLE_ARG_DECL);
+ // We create a default servant servant for each IR Object
+ // type and its corresponding POA.
+
+ int create_sections (void);
+ // Create the top-level ACE_Configuration sections.
+
+ virtual TAO_IDLType_i *select_idltype (
+ CORBA::DefinitionKind def_kind
+ ) const;
+ virtual TAO_Container_i *select_container (
+ CORBA::DefinitionKind def_kind
+ ) const;
+ virtual TAO_Contained_i *select_contained (
+ CORBA::DefinitionKind def_kind
+ ) const;
+ // Return one of our servants for internal use.
+
+ virtual PortableServer::POA_ptr select_poa (
+ CORBA::DefinitionKind def_kind
+ ) const;
+ // Select the right POA for object creation.
+
+ PortableServer::Current_ptr poa_current (void) const;
+ // Accessor for the POA that is dispatching the current call.
+
+ ACE_Configuration *config (void) const;
+ // Accessor for the ACE_Configuration database.
+
+ CORBA::TypeCodeFactory_ptr tc_factory (void) const;
+ // Accessor for the Typecode factory.
+
+ CORBA::Repository_ptr repo_objref (void) const;
+ void repo_objref (CORBA::Repository_ptr objref);
+ // Accessor/mutator for our object reference.
+
+ ACE_Configuration_Section_Key root_key (void) const;
+ // Accessor for the root key for all IR objects.
+
+ ACE_Configuration_Section_Key repo_ids_key (void) const;
+ // Accessor for the repository ids root key.
+
+ ACE_Configuration_Section_Key pkinds_key (void) const;
+ // Accessor for the primitive kinds section.
+
+ ACE_Configuration_Section_Key strings_key (void) const;
+ // Accessor for the bounded strings section.
+
+ ACE_Configuration_Section_Key wstrings_key (void) const;
+ // Accessor for the bounded wstrings section.
+
+ ACE_Configuration_Section_Key fixeds_key (void) const;
+ // Accessor for the fixed types section.
+
+ ACE_Configuration_Section_Key arrays_key (void) const;
+ // Accessor for the anonymous arrays section.
+
+ ACE_Configuration_Section_Key sequences_key (void) const;
+ // Accessor for the anonymous sequences section.
+
+ const char *extension (void) const;
+ // Accessor for the name extension string.
+
+ ACE_Lock &lock (void) const;
+ // Repo lock.
+
+ void shutdown (void);
+ // Used ONLY with Purify, for memory leak checking.
+ // A call to this can be temporariily appended to the
+ // destroy() method of the last thing to be destroyed
+ // by the test code.
+
+protected:
+ CORBA::ORB_ptr orb_;
+ // Reference to our ORB.
+
+ PortableServer::POA_var root_poa_;
+ // Reference to the root POA.
+
+ PortableServer::POA_var repo_poa_;
+ // Reference to the POA handling calls to this servant.
+
+ PortableServer::Current_var poa_current_;
+ // Reference to the PortableServer::Current object
+
+ ACE_Configuration *config_;
+ // Our ACE_Configuration database.
+
+ CORBA::TypeCodeFactory_var tc_factory_;
+ // Our Typecode factory.
+
+ CORBA::Repository_var repo_objref_;
+ // The object reference of this servant.
+
+ ACE_Configuration_Section_Key root_key_;
+ // Root of all IR objects.
+
+ ACE_Configuration_Section_Key repo_ids_key_;
+ // Flat section of Interface Repository ids.
+
+ ACE_Configuration_Section_Key pkinds_key_;
+ // Section holding the primitive kinds.
+
+ ACE_Configuration_Section_Key strings_key_;
+ // Section holding the bounded strings.
+
+ ACE_Configuration_Section_Key wstrings_key_;
+ // Section holding the bounded wstrings.
+
+ ACE_Configuration_Section_Key fixeds_key_;
+ // Section holding the fixed types.
+
+ ACE_Configuration_Section_Key arrays_key_;
+ // Section holding the anonymous arrays.
+
+ ACE_Configuration_Section_Key sequences_key_;
+ // Section holding the anonymous sequences.
+
+ CORBA::String_var extension_;
+ // Added to names temporarily to avoid name clashes.
+
+ ACE_Lock *lock_;
+ // Lock.
+
+ // Define a POA for each IR Object type, and a corresponding
+ // default servant.
+
+#ifdef CONCRETE_IR_OBJECT_TYPES
+#undef CONCRETE_IR_OBJECT_TYPES
+#endif
+
+#ifdef GEN_IR_OBJECT
+#undef GEN_IR_OBJECT
+#endif
+
+#define CONCRETE_IR_OBJECT_TYPES \
+ GEN_IR_OBJECT (ExtAbstractInterfaceDef) \
+ GEN_IR_OBJECT (AliasDef) \
+ GEN_IR_OBJECT (ArrayDef) \
+ GEN_IR_OBJECT (AttributeDef) \
+ GEN_IR_OBJECT (ConstantDef) \
+ GEN_IR_OBJECT (EnumDef) \
+ GEN_IR_OBJECT (ExceptionDef) \
+ GEN_IR_OBJECT (FixedDef) \
+ GEN_IR_OBJECT (ExtInterfaceDef) \
+ GEN_IR_OBJECT (ExtLocalInterfaceDef) \
+ GEN_IR_OBJECT (NativeDef) \
+ GEN_IR_OBJECT (OperationDef) \
+ GEN_IR_OBJECT (PrimitiveDef) \
+ GEN_IR_OBJECT (SequenceDef) \
+ GEN_IR_OBJECT (StringDef) \
+ GEN_IR_OBJECT (StructDef) \
+ GEN_IR_OBJECT (UnionDef) \
+ GEN_IR_OBJECT (ValueBoxDef) \
+ GEN_IR_OBJECT (ExtValueDef) \
+ GEN_IR_OBJECT (ValueMemberDef) \
+ GEN_IR_OBJECT (WstringDef)
+
+#define GEN_IR_OBJECT(name) \
+ POA_CORBA:: name ## _tie<TAO_ ## name ## _i> * name ## _servant_; \
+ PortableServer::POA_var name ## _poa_;
+
+ CONCRETE_IR_OBJECT_TYPES
+
+#undef GEN_IR_OBJECT
+
+private:
+ static const char * TAO_IFR_primitive_kinds[];
+ // Set of strings corresponding to the CORBA::PrimitiveKind
+ // enum values.
+
+ const char *pkind_to_string (CORBA::PrimitiveKind pkind) const;
+ // Convert the enum value to the equivalent string.
+
+ u_int num_pkinds (void) const;
+ // Return the number of entries in the CORBA::PrimitiveKind enum.
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_REPOSITORY_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/SequenceDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/SequenceDef_i.cpp
new file mode 100644
index 00000000000..5f7465b47fe
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/SequenceDef_i.cpp
@@ -0,0 +1,269 @@
+// $Id$
+
+#include "orbsvcs/IFRService/SequenceDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "ace/Auto_Ptr.h"
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ SequenceDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_SequenceDef_i::TAO_SequenceDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_IDLType_i (repo)
+{
+}
+
+TAO_SequenceDef_i::~TAO_SequenceDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_SequenceDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Sequence;
+}
+
+void
+TAO_SequenceDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_SequenceDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Only if it is (w)string, fixed, array or sequence.
+ this->destroy_element_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ name);
+
+ this->repo_->config ()->remove_section (this->repo_->sequences_key (),
+ name.c_str (),
+ 0);
+}
+
+CORBA::TypeCode_ptr
+TAO_SequenceDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_SequenceDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::TypeCode_var element_typecode =
+ this->element_type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ CORBA::ULong bound = this->bound_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->repo_->tc_factory ()->create_sequence_tc (
+ bound,
+ element_typecode.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+CORBA::ULong
+TAO_SequenceDef_i::bound (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->bound_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ULong
+TAO_SequenceDef_i::bound_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ u_int bound = 0;
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "bound",
+ bound);
+
+ return static_cast<CORBA::ULong> (bound);
+}
+
+void
+TAO_SequenceDef_i::bound (CORBA::ULong bound
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->bound_i (bound
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_SequenceDef_i::bound_i (CORBA::ULong bound
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->set_integer_value (this->section_key_,
+ "bound",
+ bound);
+}
+
+CORBA::TypeCode_ptr
+TAO_SequenceDef_i::element_type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->element_type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_SequenceDef_i::element_type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString element_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "element_path",
+ element_path);
+
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (element_path,
+ this->repo_);
+
+ return impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_SequenceDef_i::element_type_def (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::IDLType::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return this->element_type_def_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_SequenceDef_i::element_type_def_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString element_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "element_path",
+ element_path);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (element_path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_SequenceDef_i::element_type_def (CORBA::IDLType_ptr element_type_def
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->element_type_def_i (element_type_def
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_SequenceDef_i::element_type_def_i (CORBA::IDLType_ptr element_type_def
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->destroy_element_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ char *element_path =
+ TAO_IFR_Service_Utils::reference_to_path (element_type_def);
+
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "element_path",
+ element_path);
+}
+
+void
+TAO_SequenceDef_i::destroy_element_type (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString element_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "element_path",
+ element_path);
+
+ CORBA::DefinitionKind def_kind =
+ TAO_IFR_Service_Utils::path_to_def_kind (element_path,
+ this->repo_);
+
+ switch (def_kind)
+ {
+ // These exist only as our elements, so the type should
+ // be destroyed when we are destroyed or our element type
+ // is mutated.
+ case CORBA::dk_String:
+ case CORBA::dk_Wstring:
+ case CORBA::dk_Fixed:
+ case CORBA::dk_Array:
+ case CORBA::dk_Sequence:
+ {
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (element_path,
+ this->repo_);
+
+ impl->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/SequenceDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/SequenceDef_i.h
new file mode 100644
index 00000000000..cbed0039d88
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/SequenceDef_i.h
@@ -0,0 +1,150 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// SequenceDef_i.h
+//
+// = DESCRIPTION
+// SequenceDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef SEQUENCEDEF_I_H
+#define SEQUENCEDEF_I_H
+
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_SequenceDef_i : public virtual TAO_IDLType_i
+{
+ // = TITLE
+ // TAO_SequenceDef_i
+ //
+ // = DESCRIPTION
+ // Represents an IDL sequence type.
+ //
+public:
+ TAO_SequenceDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_SequenceDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::ULong bound (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ULong bound_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void bound (
+ CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void bound_i (
+ CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::TypeCode_ptr element_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::TypeCode_ptr element_type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::IDLType_ptr element_type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::IDLType_ptr element_type_def_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void element_type_def (
+ CORBA::IDLType_ptr element_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void element_type_def_i (
+ CORBA::IDLType_ptr element_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ void destroy_element_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Destroys an anonymous non-primitive element type.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_SEQUENCEDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/StringDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/StringDef_i.cpp
new file mode 100644
index 00000000000..b8068cdb642
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/StringDef_i.cpp
@@ -0,0 +1,131 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/StringDef_i.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ StringDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_StringDef_i::TAO_StringDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_IDLType_i (repo)
+{
+}
+
+TAO_StringDef_i::~TAO_StringDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_StringDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_String;
+}
+
+void
+TAO_StringDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_StringDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ name);
+
+ this->repo_->config ()->remove_section (this->repo_->strings_key (),
+ name.c_str (),
+ 0);
+}
+
+CORBA::TypeCode_ptr
+TAO_StringDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_StringDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong bound = this->bound_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->repo_->tc_factory ()->create_string_tc (
+ bound
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+CORBA::ULong
+TAO_StringDef_i::bound (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->bound_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ULong
+TAO_StringDef_i::bound_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ u_int retval = 0;
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "bound",
+ retval);
+
+ return static_cast<CORBA::ULong> (retval);
+}
+
+void
+TAO_StringDef_i::bound (CORBA::ULong bound
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->bound_i (bound
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_StringDef_i::bound_i (CORBA::ULong bound
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->set_integer_value (this->section_key_,
+ "bound",
+ bound);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/StringDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/StringDef_i.h
new file mode 100644
index 00000000000..5f1e402b8ce
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/StringDef_i.h
@@ -0,0 +1,112 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// StringDef_i.h
+//
+// = DESCRIPTION
+// StringDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_STRINGDEF_I_H
+#define TAO_STRINGDEF_I_H
+
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_StringDef_i : public virtual TAO_IDLType_i
+{
+ // = TITLE
+ // TAO_StringDef_i
+ //
+ // = DESCRIPTION
+ // Represents a bounded string (unbounded strings
+ // are included in PrimitiveDef).
+ //
+public:
+ TAO_StringDef_i (TAO_Repository_i *repoy);
+ // Constructor.
+
+ virtual ~TAO_StringDef_i (void);
+ // Destructor.
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::ULong bound (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ULong bound_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void bound (
+ CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void bound_i (
+ CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_STRINGDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/StructDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/StructDef_i.cpp
new file mode 100644
index 00000000000..e4cef6229e6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/StructDef_i.cpp
@@ -0,0 +1,317 @@
+// $Id$
+
+#include "orbsvcs/IFRService/StructDef_i.h"
+#include "orbsvcs/IFRService/RecursDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "ace/Auto_Ptr.h"
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ StructDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_StructDef_i::TAO_StructDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo),
+ TAO_TypedefDef_i (repo),
+ TAO_Container_i (repo)
+{
+}
+
+TAO_StructDef_i::~TAO_StructDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_StructDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Struct;
+}
+
+void
+TAO_StructDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_StructDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Destroy our members.
+ TAO_Container_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Destroy ourself.
+ TAO_Contained_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CORBA::TypeCode_ptr
+TAO_StructDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_StructDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ id);
+
+ //---------------------------------------------------------------------------
+ // Have we already seen this structure definition at an outer scope?
+ // If yes, return a recursive type code to signal the nesting.
+ // If not, record this new structure id in our stack (it will automatically
+ // be removed when NowSeenThis goes out of scope).
+ //---------------------------------------------------------------------------
+
+ if (TAO_RecursiveDef_OuterScopes::SeenBefore( id ))
+ return this->repo_->tc_factory ()->
+ create_recursive_tc ( id.c_str () ACE_ENV_ARG_PARAMETER);
+
+ TAO_RecursiveDef_OuterScopes NowSeenThis( id );
+
+ //---------------------------------------------------------------------------
+ // Create a new type code for this structure; the create_struct_tc() call
+ // that follows may recursivly call this method again if one of its children
+ // refers to a structure (which is the point of the above NowSeenThis stack).
+ //---------------------------------------------------------------------------
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ name);
+
+ CORBA::StructMemberSeq_var members = this->members_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->repo_->tc_factory ()->create_struct_tc (id.c_str (),
+ name.c_str (),
+ members.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::StructMemberSeq *
+TAO_StructDef_i::members (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->members_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::StructMemberSeq *
+TAO_StructDef_i::members_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Unbounded_Queue<CORBA::DefinitionKind> kind_queue;
+ ACE_Unbounded_Queue<ACE_TString> path_queue;
+ ACE_Unbounded_Queue<ACE_TString> name_queue;
+
+ ACE_Configuration_Section_Key refs_key;
+ this->repo_->config ()->open_section (this->section_key_,
+ "refs",
+ 0,
+ refs_key);
+
+ u_int count = 0;
+ this->repo_->config ()->get_integer_value (refs_key,
+ "count",
+ count);
+
+ for (u_int i = 0; i < count; ++i)
+ {
+ ACE_Configuration_Section_Key member_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (refs_key,
+ stringified,
+ 0,
+ member_key);
+
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (member_key,
+ "path",
+ path);
+
+ ACE_Configuration_Section_Key entry_key;
+ int status =
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ path,
+ entry_key,
+ 0);
+
+ // This entry may have been removed.
+ if (status == 0)
+ {
+ path_queue.enqueue_tail (path);
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (member_key,
+ "name",
+ name);
+
+ name_queue.enqueue_tail (name);
+
+ u_int kind = 0;
+ this->repo_->config ()->get_integer_value (entry_key,
+ "def_kind",
+ kind);
+
+ CORBA::DefinitionKind def_kind =
+ static_cast<CORBA::DefinitionKind> (kind);
+
+ kind_queue.enqueue_tail (def_kind);
+ }
+ }
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (kind_queue.size ());
+
+ CORBA::StructMemberSeq *members = 0;
+ ACE_NEW_THROW_EX (members,
+ CORBA::StructMemberSeq (size),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ members->length (size);
+
+ CORBA::StructMemberSeq_var retval = members;
+
+ ACE_TString name, path;
+ CORBA::DefinitionKind kind = CORBA::dk_none;
+ CORBA::Object_var obj;
+ ACE_Configuration_Section_Key member_key;
+ TAO_IDLType_i *impl = 0;
+
+ // Store to replace below.
+ ACE_Configuration_Section_Key key_holder = this->section_key_;
+
+ for (CORBA::ULong k = 0; k < size; ++k)
+ {
+ name_queue.dequeue_head (name);
+ retval[k].name = name.c_str ();
+ kind_queue.dequeue_head (kind);
+ path_queue.dequeue_head (path);
+
+ obj = TAO_IFR_Service_Utils::create_objref (kind,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[k].type_def = CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ path,
+ member_key,
+ 0);
+
+ impl = TAO_IFR_Service_Utils::path_to_idltype (path,
+ this->repo_);
+ if (0 == impl)
+ {
+ ACE_THROW_RETURN ( CORBA::OBJECT_NOT_EXIST(), 0);
+ }
+
+ retval[k].type = impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // If this struct contains a nested struct (of another type) at
+ // some level, the above code will have changed the section key
+ // so we have to replace it with the value we stored above.
+ this->section_key (key_holder);
+ }
+
+ return retval._retn ();
+}
+
+void
+TAO_StructDef_i::members (const CORBA::StructMemberSeq &members
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->members_i (members
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_StructDef_i::members_i (const CORBA::StructMemberSeq &members
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Destroy our old members, both refs and defns.
+ TAO_Container_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong count = members.length ();
+
+ ACE_TString section_name;
+ ACE_Configuration_Section_Key refs_key;
+
+ this->repo_->config ()->open_section (this->section_key_,
+ "refs",
+ 1,
+ refs_key);
+ char *path = 0;
+
+ // Create a section for each new member. We just store the
+ // member name and the path to its database entry.
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ ACE_Configuration_Section_Key member_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (refs_key,
+ stringified,
+ 1,
+ member_key);
+
+ this->repo_->config ()->set_string_value (member_key,
+ "name",
+ members[i].name.in ());
+
+ path =
+ TAO_IFR_Service_Utils::reference_to_path (members[i].type_def.in ());
+
+ this->repo_->config ()->set_string_value (member_key,
+ "path",
+ path);
+ }
+
+ this->repo_->config ()->set_integer_value (refs_key,
+ "count",
+ count);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/StructDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/StructDef_i.h
new file mode 100644
index 00000000000..a679e5ff3dd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/StructDef_i.h
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// StructDef_i.h
+//
+// = DESCRIPTION
+// StructDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_STRUCTDEF_I_H
+#define TAO_STRUCTDEF_I_H
+
+#include "orbsvcs/IFRService/TypedefDef_i.h"
+#include "orbsvcs/IFRService/Container_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_StructDef_i : public virtual TAO_TypedefDef_i,
+ public virtual TAO_Container_i
+{
+ // = TITLE
+ // TAO_StructDef_i
+ //
+ // = DESCRIPTION
+ // Represents an OMG IDL structure definition.
+ //
+public:
+ TAO_StructDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_StructDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry and its contents.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::StructMemberSeq *members (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::StructMemberSeq *members_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void members (
+ const CORBA::StructMemberSeq &members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void members_i (
+ const CORBA::StructMemberSeq &members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_STRUCTDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/TypedefDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/TypedefDef_i.cpp
new file mode 100644
index 00000000000..3261a380750
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/TypedefDef_i.cpp
@@ -0,0 +1,82 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/TypedefDef_i.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ TypedefDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_TypedefDef_i::TAO_TypedefDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo)
+{
+}
+
+TAO_TypedefDef_i::~TAO_TypedefDef_i (void)
+{
+}
+
+CORBA::Contained::Description *
+TAO_TypedefDef_i::describe (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_TypedefDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Contained::Description *desc_ptr = 0;
+ ACE_NEW_THROW_EX (desc_ptr,
+ CORBA::Contained::Description,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Contained::Description_var retval = desc_ptr;
+
+ retval->kind = this->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::TypeDescription td;
+
+ ACE_CHECK_RETURN (0);
+ td.name = this->name_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ td.id = this->id_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ACE_TString container_id;
+
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ container_id);
+
+ td.defined_in = container_id.c_str ();
+
+ td.version = this->version_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ td.type = this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval->value <<= td;
+
+ return retval._retn ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/TypedefDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/TypedefDef_i.h
new file mode 100644
index 00000000000..1d836a105d2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/TypedefDef_i.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// TypedefDef_i.h
+//
+// = DESCRIPTION
+// TypedefDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_TYPEDEFDEF_I_H
+#define TAO_TYPEDEFDEF_I_H
+
+#include "orbsvcs/IFRService/Contained_i.h"
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_TypedefDef_i : public virtual TAO_Contained_i,
+ public virtual TAO_IDLType_i
+{
+ // = TITLE
+ // TAO_TypedefDef_i
+ //
+ // = DESCRIPTION
+ // Base interface inherited by all named non-object types:
+ // struct, union, enum, alias, native, and valuebox.
+ //
+public:
+ TAO_TypedefDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_TypedefDef_i (void);
+ // Destructor
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_TYPEDEFDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/UnionDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/UnionDef_i.cpp
new file mode 100644
index 00000000000..efc0446c718
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/UnionDef_i.cpp
@@ -0,0 +1,486 @@
+// $Id$
+
+#include "orbsvcs/IFRService/UnionDef_i.h"
+#include "orbsvcs/IFRService/RecursDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h"
+#include "tao/CDR.h"
+
+#include "ace/Auto_Ptr.h"
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ UnionDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_UnionDef_i::TAO_UnionDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo),
+ TAO_TypedefDef_i (repo),
+ TAO_Container_i (repo)
+{
+}
+
+TAO_UnionDef_i::~TAO_UnionDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_UnionDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Union;
+}
+
+void
+TAO_UnionDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_UnionDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Destroy our members.
+ TAO_Container_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Destroy ourself.
+ TAO_Contained_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CORBA::TypeCode_ptr
+TAO_UnionDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_UnionDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ id);
+
+ //---------------------------------------------------------------------------
+ // Have we already seen this union definition at an outer scope?
+ // If yes, return a recursive type code to signal the nesting.
+ // If not, record this new union id in our stack (it will automatically be
+ // removed when NowSeenThis goes out of scope).
+ //---------------------------------------------------------------------------
+
+ if (TAO_RecursiveDef_OuterScopes::SeenBefore( id ))
+ return this->repo_->tc_factory ()->
+ create_recursive_tc ( id.c_str () ACE_ENV_ARG_PARAMETER);
+
+ TAO_RecursiveDef_OuterScopes NowSeenThis( id );
+
+ //---------------------------------------------------------------------------
+ // Create a new type code for this structure; the create_union_tc() call
+ // that follows may recursivly call this method again if one of its children
+ // refers to a union (which is the point of the above NowSeenThis stack).
+ //---------------------------------------------------------------------------
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ name);
+
+ CORBA::TypeCode_var tc = this->discriminator_type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ CORBA::UnionMemberSeq_var members = this->members_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->repo_->tc_factory ()->create_union_tc (id.c_str (),
+ name.c_str (),
+ tc.in (),
+ members.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_UnionDef_i::discriminator_type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->discriminator_type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_UnionDef_i::discriminator_type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString disc_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "disc_path",
+ disc_path);
+
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (disc_path,
+ this->repo_);
+ if (0 == impl)
+ {
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST(), CORBA::TypeCode::_nil () );
+ }
+
+ return impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_UnionDef_i::discriminator_type_def (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::IDLType::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return this->discriminator_type_def_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_UnionDef_i::discriminator_type_def_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString disc_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "disc_path",
+ disc_path);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (disc_path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_UnionDef_i::discriminator_type_def (
+ CORBA::IDLType_ptr discriminator_type_def
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->discriminator_type_def_i (discriminator_type_def
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_UnionDef_i::discriminator_type_def_i (
+ CORBA::IDLType_ptr discriminator_type_def
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ char *disc_path =
+ TAO_IFR_Service_Utils::reference_to_path (discriminator_type_def);
+
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "disc_path",
+ disc_path);
+}
+
+CORBA::UnionMemberSeq *
+TAO_UnionDef_i::members (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->members_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::UnionMemberSeq *
+TAO_UnionDef_i::members_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Unbounded_Queue<ACE_Configuration_Section_Key> key_queue;
+
+ ACE_Configuration_Section_Key refs_key;
+ this->repo_->config ()->open_section (this->section_key_,
+ "refs",
+ 0,
+ refs_key);
+
+ u_int count;
+ this->repo_->config ()->get_integer_value (refs_key,
+ "count",
+ count);
+
+ for (u_int i = 0; i < count; ++i)
+ {
+ ACE_Configuration_Section_Key member_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ if (this->repo_->config ()->open_section (refs_key,
+ stringified,
+ 0,
+ member_key)
+ == 0)
+ {
+ ACE_TString path;
+ this->repo_->config ()->get_string_value (member_key,
+ "path",
+ path);
+
+ ACE_Configuration_Section_Key entry_key;
+
+ // This entry may have been removed.
+ if (this->repo_->config ()->expand_path (this->repo_->root_key (),
+ path,
+ entry_key,
+ 0)
+ == 0)
+ {
+ key_queue.enqueue_tail (member_key);
+ }
+ }
+ }
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (key_queue.size ());
+
+ CORBA::UnionMemberSeq *members = 0;
+ ACE_NEW_THROW_EX (members,
+ CORBA::UnionMemberSeq (size),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ members->length (size);
+ CORBA::UnionMemberSeq_var retval = members;
+
+ ACE_TString name, path;
+ ACE_Configuration_Section_Key next_key, entry_key;
+ CORBA::Object_var obj;
+ TAO_IDLType_i *impl = 0;
+
+ // Store to replace below.
+ ACE_Configuration_Section_Key key_holder = this->section_key_;
+
+ for (CORBA::ULong k = 0; k < size; ++k)
+ {
+ key_queue.dequeue_head (next_key);
+
+ this->repo_->config ()->get_string_value (next_key,
+ "name",
+ name);
+
+ retval[k].name = name.c_str ();
+
+ this->fetch_label (next_key,
+ retval[k]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->repo_->config ()->get_string_value (next_key,
+ "path",
+ path);
+
+ obj = TAO_IFR_Service_Utils::path_to_ir_object (path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[k].type_def = CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ impl = TAO_IFR_Service_Utils::path_to_idltype (path,
+ this->repo_);
+ if (0 == impl)
+ {
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST(), 0 );
+ }
+
+ retval[k].type = impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // If this union contains a nested union (of another type) at
+ // some level, the above code will have changed the section key
+ // so we have to replace it with the value we stored above.
+ this->section_key (key_holder);
+ }
+
+ return retval._retn ();
+}
+
+void
+TAO_UnionDef_i::members (const CORBA::UnionMemberSeq &members
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->members_i (members
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_UnionDef_i::members_i (const CORBA::UnionMemberSeq &members
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Destroy our old members, both refs and defns.
+ TAO_Container_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TString section_name;
+ ACE_Configuration_Section_Key refs_key;
+
+ this->repo_->config ()->open_section (this->section_key_,
+ "refs",
+ 1,
+ refs_key);
+
+ // Store the new member count of the union.
+ CORBA::ULong count = members.length ();
+ this->repo_->config ()->set_integer_value (refs_key,
+ "count",
+ count);
+ char *member_path = 0;
+
+ // Create a section for each member. We store the member
+ // name, its label value, and the path to its database entry.
+ for (CORBA::ULong i = 0; i < count; i++)
+ {
+ ACE_Configuration_Section_Key member_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (refs_key,
+ stringified,
+ 1,
+ member_key);
+
+ this->repo_->config ()->set_string_value (member_key,
+ "name",
+ members[i].name.in ());
+
+ member_path =
+ TAO_IFR_Service_Utils::reference_to_path (members[i].type_def.in ());
+
+ this->repo_->config ()->set_string_value (member_key,
+ "path",
+ member_path);
+
+ this->store_label (member_key,
+ members[i].label
+ ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+void
+TAO_UnionDef_i::fetch_label (const ACE_Configuration_Section_Key member_key,
+ CORBA::UnionMember &member
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_Configuration::VALUETYPE vt;
+ this->repo_->config ()->find_value (member_key,
+ "label",
+ vt);
+
+ if (vt == ACE_Configuration::STRING)
+ {
+ member.label <<= CORBA::Any::from_octet (0);
+
+ return;
+ }
+
+ u_int value = 0;
+ this->repo_->config ()->get_integer_value (member_key,
+ "label",
+ value);
+
+ CORBA::TypeCode_var tc =
+ this->discriminator_type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::TCKind kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ switch (kind)
+ {
+ case CORBA::tk_char:
+ member.label <<= CORBA::Any::from_char (static_cast<CORBA::Char> (value));
+ break;
+ case CORBA::tk_wchar:
+ member.label <<= CORBA::Any::from_wchar (static_cast<CORBA::WChar> (value));
+ break;
+ case CORBA::tk_boolean:
+ member.label <<= CORBA::Any::from_boolean (static_cast<CORBA::Boolean> (value));
+ break;
+ case CORBA::tk_short:
+ member.label <<= static_cast<CORBA::Short> (value);
+ break;
+ case CORBA::tk_ushort:
+ member.label <<= static_cast<CORBA::UShort> (value);
+ break;
+ case CORBA::tk_long:
+ member.label <<= static_cast<CORBA::Long> (value);
+ break;
+ case CORBA::tk_ulong:
+ member.label <<= static_cast<CORBA::ULong> (value);
+ break;
+#if !defined (ACE_LACKS_LONGLONG_T)
+ case CORBA::tk_longlong:
+ member.label <<= static_cast<CORBA::LongLong> (value);
+ break;
+#endif /* ACE_LACKS_LONGLONG_T */
+ case CORBA::tk_ulonglong:
+ member.label <<= static_cast<CORBA::ULongLong> (value);
+ break;
+ case CORBA::tk_enum:
+ {
+ TAO_OutputCDR cdr;
+ cdr.write_ulong (static_cast<CORBA::ULong> (value));
+ TAO_InputCDR in_cdr (cdr);
+ TAO::Unknown_IDL_Type *impl = 0;
+ ACE_NEW (impl,
+ TAO::Unknown_IDL_Type (tc.in (),
+ in_cdr));
+ member.label.replace (impl);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/UnionDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/UnionDef_i.h
new file mode 100644
index 00000000000..feace1c2ec5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/UnionDef_i.h
@@ -0,0 +1,153 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// UnionDef_i.h
+//
+// = DESCRIPTION
+// UnionDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_UNIONDEF_I_H
+#define TAO_UNIONDEF_I_H
+
+#include "orbsvcs/IFRService/TypedefDef_i.h"
+#include "orbsvcs/IFRService/Container_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_UnionDef_i : public virtual TAO_TypedefDef_i,
+ public virtual TAO_Container_i
+{
+ // = TITLE
+ // TAO_UnionDef_i
+ //
+ // = DESCRIPTION
+ // Represents an OMG IDL union definition.
+ //
+public:
+ TAO_UnionDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_UnionDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry and its contents.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr discriminator_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::TypeCode_ptr discriminator_type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::IDLType_ptr discriminator_type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::IDLType_ptr discriminator_type_def_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void discriminator_type_def (
+ CORBA::IDLType_ptr discriminator_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void discriminator_type_def_i (
+ CORBA::IDLType_ptr discriminator_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::UnionMemberSeq *members (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::UnionMemberSeq *members_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void members (
+ const CORBA::UnionMemberSeq &members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void members_i (
+ const CORBA::UnionMemberSeq &members
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ void fetch_label (
+ const ACE_Configuration_Section_Key member_key,
+ CORBA::UnionMember &member
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Used by members() to get each member's label value.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_UNIONDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/UsesDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/UsesDef_i.cpp
new file mode 100644
index 00000000000..833a7fd0c6a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/UsesDef_i.cpp
@@ -0,0 +1,214 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/UsesDef_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils_T.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ UsesDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_UsesDef_i::TAO_UsesDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo)
+{
+}
+
+TAO_UsesDef_i::~TAO_UsesDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_UsesDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Uses;
+}
+
+CORBA::Contained::Description *
+TAO_UsesDef_i::describe (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_UsesDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ComponentIR::UsesDescription ud;
+ TAO_IFR_Desc_Utils<CORBA::ComponentIR::UsesDescription,
+ TAO_UsesDef_i>::fill_desc_begin (
+ ud,
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (0);
+
+ ACE_TString base_type_id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_type",
+ base_type_id);
+ ud.interface_type = base_type_id.fast_rep ();
+ ud.is_multiple = this->is_multiple_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Contained::Description *retval = 0;
+ ACE_NEW_RETURN (retval,
+ CORBA::Contained::Description,
+ 0);
+
+ retval->kind = CORBA::dk_Uses;
+ retval->value <<= ud;
+ return retval;
+}
+
+CORBA::InterfaceDef_ptr
+TAO_UsesDef_i::interface_type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::InterfaceDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::InterfaceDef::_nil ());
+
+ return this->interface_type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::InterfaceDef_ptr
+TAO_UsesDef_i::interface_type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_type",
+ holder);
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ holder.fast_rep (),
+ holder);
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::InterfaceDef::_nil ());
+
+ return CORBA::InterfaceDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_UsesDef_i::interface_type (
+ CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->interface_type_i (interface_type
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_UsesDef_i::interface_type_i (
+ CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->remove_value (this->section_key_,
+ "base_type");
+
+ if (CORBA::is_nil (interface_type))
+ {
+ return;
+ }
+
+ const char *tmp =
+ TAO_IFR_Service_Utils::reference_to_path (interface_type);
+
+ ACE_Configuration_Section_Key new_key;
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ tmp,
+ new_key,
+ 0);
+
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (new_key,
+ "id",
+ holder);
+
+ this->repo_->config ()->set_string_value (
+ this->section_key_,
+ "base_type",
+ holder
+ );
+}
+
+CORBA::Boolean
+TAO_UsesDef_i::is_multiple (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->is_multiple_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_UsesDef_i::is_multiple_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong val = 0;
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "is_multiple",
+ val);
+ return static_cast<CORBA::Boolean> (val);
+}
+
+void
+TAO_UsesDef_i::is_multiple (
+ CORBA::Boolean is_multiple
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->is_multiple_i (is_multiple
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_UsesDef_i::is_multiple_i (
+ CORBA::Boolean is_multiple
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->set_integer_value (this->section_key_,
+ "is_multiple",
+ is_multiple);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/UsesDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/UsesDef_i.h
new file mode 100644
index 00000000000..c0daa00be10
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/UsesDef_i.h
@@ -0,0 +1,122 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// UsesDef_i.h
+//
+// = DESCRIPTION
+// UsesDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_USESDEF_I_H
+#define TAO_USESDEF_I_H
+
+#include "orbsvcs/IFRService/Contained_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_UsesDef_i : public virtual TAO_Contained_i
+{
+ // = TITLE
+ // TAO_UsesDef_i
+ //
+ // = DESCRIPTION
+ // Represents an interface that is used by a component.
+ //
+public:
+ TAO_UsesDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_UsesDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::InterfaceDef_ptr interface_type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void interface_type (
+ CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void interface_type_i (
+ CORBA::InterfaceDef_ptr interface_type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::InterfaceDef_ptr interface_type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean is_multiple (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Boolean is_multiple_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void is_multiple (
+ CORBA::Boolean is_multiple
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void is_multiple_i (
+ CORBA::Boolean is_multiple
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_USESDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ValueBoxDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ValueBoxDef_i.cpp
new file mode 100644
index 00000000000..c8a710dcc23
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ValueBoxDef_i.cpp
@@ -0,0 +1,140 @@
+// $Id$
+
+#include "orbsvcs/IFRService/ValueBoxDef_i.h"
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "ace/Auto_Ptr.h"
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ ValueBoxDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ValueBoxDef_i::TAO_ValueBoxDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo),
+ TAO_TypedefDef_i (repo)
+{
+}
+
+TAO_ValueBoxDef_i::~TAO_ValueBoxDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_ValueBoxDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_ValueBox;
+}
+
+CORBA::TypeCode_ptr
+TAO_ValueBoxDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_ValueBoxDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString id;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ id);
+
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ name);
+
+ ACE_TString boxed_type_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "boxed_type",
+ boxed_type_path);
+
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (boxed_type_path,
+ this->repo_);
+
+ CORBA::TypeCode_var tc = impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->repo_->tc_factory ()->create_value_box_tc (id.c_str (),
+ name.c_str (),
+ tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_ValueBoxDef_i::original_type_def (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::IDLType::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return this->original_type_def_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_ValueBoxDef_i::original_type_def_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString boxed_type_path;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "boxed_type",
+ boxed_type_path);
+
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (boxed_type_path,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ValueBoxDef_i::original_type_def (CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->original_type_def_i (original_type_def
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ValueBoxDef_i::original_type_def_i (CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ char *boxed_type =
+ TAO_IFR_Service_Utils::reference_to_path (original_type_def);
+
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "boxed_type",
+ boxed_type);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ValueBoxDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ValueBoxDef_i.h
new file mode 100644
index 00000000000..9fd68ca1cc8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ValueBoxDef_i.h
@@ -0,0 +1,101 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ValueBoxDef_i.h
+//
+// = DESCRIPTION
+// ValueBoxDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_VALUEBOXDEF_I_H
+#define TAO_VALUEBOXDEF_I_H
+
+#include "orbsvcs/IFRService/TypedefDef_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ValueBoxDef_i : public virtual TAO_TypedefDef_i
+{
+public:
+ // = TITLE
+ // TAO_ValueBoxDef_i
+ //
+ // = DESCRIPTION
+ // Represents an value box definition.
+ //
+public:
+ TAO_ValueBoxDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_ValueBoxDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::IDLType_ptr original_type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::IDLType_ptr original_type_def_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void original_type_def (
+ CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void original_type_def_i (
+ CORBA::IDLType_ptr original_type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_VALUEBOXDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp
new file mode 100644
index 00000000000..d4ff826a40b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp
@@ -0,0 +1,1857 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/ValueDef_i.h"
+#include "orbsvcs/IFRService/AttributeDef_i.h"
+#include "orbsvcs/IFRService/OperationDef_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils_T.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ ValueDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ValueDef_i::TAO_ValueDef_i (TAO_Repository_i *repo)
+ : TAO_IRObject_i (repo),
+ TAO_Container_i (repo),
+ TAO_Contained_i (repo),
+ TAO_IDLType_i (repo)
+{
+}
+
+TAO_ValueDef_i::~TAO_ValueDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_ValueDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Value;
+}
+
+void
+TAO_ValueDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_ValueDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->TAO_Container_i::destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // These will get rid of the repo ids, which Contained_i::destroy()'s
+ // call to remove_section (recursive = 1) will not get, and also
+ // destroy the attribute's anonymous type, if any.
+
+ TAO_IFR_Generic_Utils<TAO_AttributeDef_i>::destroy_special (
+ "attrs",
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ TAO_IFR_Generic_Utils<TAO_OperationDef_i>::destroy_special (
+ "ops",
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+}
+
+CORBA::Contained::Description *
+TAO_ValueDef_i::describe (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_ValueDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ValueDescription *vd = 0;
+ ACE_NEW_RETURN (vd,
+ CORBA::ValueDescription,
+ 0);
+ CORBA::ValueDescription_var safe_vd = vd;
+
+ this->fill_value_description (safe_vd.inout ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Contained::Description *cd = 0;
+ ACE_NEW_RETURN (cd,
+ CORBA::Contained::Description,
+ 0);
+
+ cd->kind = CORBA::dk_Value;
+ cd->value <<= safe_vd._retn ();
+ return cd;
+}
+
+CORBA::TypeCode_ptr
+TAO_ValueDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_ValueDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ /// Since valuetype type codes may encapsultate the type code of a
+ /// base class, this call could be recursive, with the
+ /// ACE_Configuration_Section_Key replaced for each recursion. To
+ /// avoid this problem, the recursion is moved to a static utility
+ /// function.
+ return TAO_IFR_Service_Utils::gen_valuetype_tc_r (this->section_key_,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::InterfaceDefSeq *
+TAO_ValueDef_i::supported_interfaces (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->supported_interfaces_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::InterfaceDefSeq *
+TAO_ValueDef_i::supported_interfaces_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::InterfaceDefSeq *seq = 0;
+ ACE_NEW_RETURN (seq,
+ CORBA::InterfaceDefSeq,
+ 0);
+ CORBA::InterfaceDefSeq_var retval = seq;
+
+ ACE_Configuration_Section_Key supported_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "supported",
+ 0,
+ supported_key);
+
+ if (status != 0)
+ {
+ seq->length (0);
+ return retval._retn ();
+ }
+
+ CORBA::ULong count = 0;
+ this->repo_->config ()->get_integer_value (supported_key,
+ "count",
+ count);
+ seq->length (count);
+ char *stringified = 0;
+ ACE_TString holder;
+ CORBA::Object_var obj;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->get_string_value (supported_key,
+ stringified,
+ holder);
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ holder.fast_rep (),
+ holder);
+ obj = TAO_IFR_Service_Utils::path_to_ir_object (holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[i] = CORBA::InterfaceDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return retval._retn ();
+}
+
+void
+TAO_ValueDef_i::supported_interfaces (
+ const CORBA::InterfaceDefSeq &supported_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supported_interfaces_i (supported_interfaces
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ValueDef_i::supported_interfaces_i (
+ const CORBA::InterfaceDefSeq &supported_interfaces
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->remove_section (this->section_key_,
+ "supported",
+ 0);
+ ACE_Configuration_Section_Key supported_key;
+ this->repo_->config ()->open_section (this->section_key_,
+ "supported",
+ 1,
+ supported_key);
+ CORBA::ULong count = supported_interfaces.length ();
+ this->repo_->config ()->set_integer_value (supported_key,
+ "count",
+ count);
+ char *stringified = 0;
+ const char *supported_id = 0;
+ const char *supported_path = 0;
+ CORBA::ULong kind = 0;
+ CORBA::Boolean concrete_seen = 0;
+ CORBA::DefinitionKind def_kind;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ supported_path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ supported_interfaces[i]
+ );
+
+ // Get the servant's key into the temporary key holder, because
+ // the name clash checker for base interfaces is static, and has
+ // no other way to know about a specific key.
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ supported_path,
+ TAO_IFR_Service_Utils::tmp_key_,
+ 0);
+ this->repo_->config ()->get_integer_value (
+ TAO_IFR_Service_Utils::tmp_key_,
+ "def_kind",
+ kind
+ );
+ def_kind = static_cast<CORBA::DefinitionKind> (kind);
+
+ if (def_kind == CORBA::dk_Interface)
+ {
+ if (concrete_seen == 0)
+ {
+ concrete_seen = 1;
+ }
+ else
+ {
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 12,
+ CORBA::COMPLETED_NO));
+ return;
+ }
+ }
+
+ TAO_IFR_Service_Utils::name_exists (&TAO_ValueDef_i::name_clash,
+ this->section_key_,
+ this->repo_,
+ CORBA::dk_Value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ supported_id = supported_interfaces[i]->_interface_repository_id ();
+ this->repo_->config ()->set_string_value (supported_key,
+ stringified,
+ supported_id);
+ }
+}
+
+CORBA::InitializerSeq *
+TAO_ValueDef_i::initializers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->initializers_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::InitializerSeq *
+TAO_ValueDef_i::initializers_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::InitializerSeq *iseq = 0;
+ ACE_NEW_RETURN (iseq,
+ CORBA::InitializerSeq,
+ 0);
+ CORBA::InitializerSeq_var retval = iseq;
+
+ ACE_Configuration_Section_Key initializers_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "initializers",
+ 0,
+ initializers_key);
+
+ if (status != 0)
+ {
+ iseq->length (0);
+ return retval._retn ();
+ }
+
+ CORBA::ULong count = 0;
+ this->repo_->config ()->get_integer_value (initializers_key,
+ "count",
+ count);
+ iseq->length (count);
+ char *stringified = 0;
+ ACE_Configuration_Section_Key initializer_key, params_key, arg_key;
+ ACE_TString holder;
+ CORBA::ULong arg_count = 0;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (initializers_key,
+ stringified,
+ 0,
+ initializer_key);
+ this->repo_->config ()->get_string_value (initializer_key,
+ "name",
+ holder);
+ retval[i].name = holder.fast_rep ();
+ status =
+ this->repo_->config ()->open_section (initializer_key,
+ "params",
+ 0,
+ params_key);
+
+ if (status != 0)
+ {
+ retval[i].members.length (0);
+ continue;
+ }
+
+ this->repo_->config ()->get_integer_value (params_key,
+ "count",
+ arg_count);
+ retval[i].members.length (arg_count);
+ CORBA::Object_var obj;
+
+ for (CORBA::ULong j = 0; j < arg_count; ++j)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (j);
+ this->repo_->config ()->open_section (params_key,
+ stringified,
+ 0,
+ arg_key);
+ this->repo_->config ()->get_string_value (arg_key,
+ "arg_name",
+ holder);
+ retval[i].members[j].name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (arg_key,
+ "arg_path",
+ holder);
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (holder,
+ this->repo_);
+ retval[i].members[j].type =
+ impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[i].members[j].type_def =
+ CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ }
+
+ return retval._retn ();
+}
+
+void
+TAO_ValueDef_i::initializers (const CORBA::InitializerSeq &initializers
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->initializers_i (initializers
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ValueDef_i::initializers_i (const CORBA::InitializerSeq &initializers
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->remove_section (this->section_key_,
+ "initializers",
+ 1);
+ TAO_IFR_Generic_Utils<CORBA::InitializerSeq>::set_initializers (
+ initializers,
+ this->repo_->config (),
+ this->section_key_
+ );
+}
+
+CORBA::ValueDef_ptr
+TAO_ValueDef_i::base_value (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::ValueDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ValueDef::_nil ());
+
+ return this->base_value_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ValueDef_ptr
+TAO_ValueDef_i::base_value_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString holder;
+ int status =
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_value",
+ holder);
+
+ if (status != 0)
+ {
+ return CORBA::ValueDef::_nil ();
+ }
+
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ holder.fast_rep (),
+ holder);
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ValueDef::_nil ());
+
+ return CORBA::ValueDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ValueDef_i::base_value (CORBA::ValueDef_ptr base_value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->base_value_i (base_value
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ValueDef_i::base_value_i (CORBA::ValueDef_ptr base_value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (CORBA::is_nil (base_value))
+ {
+ this->repo_->config ()->remove_value (this->section_key_,
+ "base_value");
+ return;
+ }
+
+ const char *base_path =
+ TAO_IFR_Service_Utils::reference_to_path (base_value);
+
+ // Get the servant's key into the temporary key holder, because
+ // the name clash checker for base valuetypes is static, and has
+ // no other way to know about a specific key.
+ this->repo_->config ()->expand_path (
+ this->repo_->root_key (),
+ base_path,
+ TAO_IFR_Service_Utils::tmp_key_,
+ 0
+ );
+ TAO_IFR_Service_Utils::name_exists (&TAO_ValueDef_i::name_clash,
+ this->section_key_,
+ this->repo_,
+ CORBA::dk_Value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->repo_->config ()->set_string_value (
+ this->section_key_,
+ "base_value",
+ base_value->_interface_repository_id ()
+ );
+}
+
+CORBA::ValueDefSeq *
+TAO_ValueDef_i::abstract_base_values (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->abstract_base_values_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ValueDefSeq *
+TAO_ValueDef_i::abstract_base_values_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ValueDefSeq *vd_seq = 0;
+ ACE_NEW_RETURN (vd_seq,
+ CORBA::ValueDefSeq,
+ 0);
+ CORBA::ValueDefSeq_var retval = vd_seq;
+
+ ACE_Configuration_Section_Key bases_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "abstract_bases",
+ 0,
+ bases_key);
+
+ if (status != 0)
+ {
+ vd_seq->length (0);
+ return retval._retn ();
+ }
+
+ CORBA::ULong count = 0;
+ this->repo_->config ()->get_integer_value (bases_key,
+ "count",
+ count);
+ vd_seq->length (count);
+ char *stringified = 0;
+ ACE_TString holder;
+ CORBA::Object_var obj;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->get_string_value (bases_key,
+ stringified,
+ holder);
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ holder.fast_rep (),
+ holder);
+ obj = TAO_IFR_Service_Utils::path_to_ir_object (holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ retval[i] = CORBA::ValueDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return retval._retn ();
+}
+
+void
+TAO_ValueDef_i::abstract_base_values (
+ const CORBA::ValueDefSeq &abstract_base_values
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->abstract_base_values_i (abstract_base_values
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ValueDef_i::abstract_base_values_i (
+ const CORBA::ValueDefSeq &abstract_base_values
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->remove_section (this->section_key_,
+ "abstract_bases",
+ 0);
+ CORBA::ULong count = abstract_base_values.length ();
+
+ if (count == 0)
+ {
+ return;
+ }
+
+ ACE_Configuration_Section_Key bases_key;
+ this->repo_->config ()->open_section (this->section_key_,
+ "abstract_bases",
+ 0,
+ bases_key);
+ this->repo_->config ()->set_integer_value (bases_key,
+ "count",
+ count);
+ const char *base_id = 0;
+ const char *base_path = 0;
+ char *stringified = 0;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ base_path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ abstract_base_values[i]
+ );
+
+ // Get the servant's key into the temporary key holder, because
+ // the name clash checker for base interfaces is static, and has
+ // no other way to know about a specific key.
+ this->repo_->config ()->expand_path (
+ this->repo_->root_key (),
+ base_path,
+ TAO_IFR_Service_Utils::tmp_key_,
+ 0
+ );
+ TAO_IFR_Service_Utils::name_exists (&TAO_ValueDef_i::name_clash,
+ this->section_key_,
+ this->repo_,
+ CORBA::dk_Value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ base_id = abstract_base_values[i]->_interface_repository_id ();
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (bases_key,
+ stringified,
+ base_id);
+ }
+}
+
+CORBA::Boolean
+TAO_ValueDef_i::is_abstract (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->is_abstract_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_ValueDef_i::is_abstract_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong is_it = 0;
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "is_abstract",
+ is_it);
+ return static_cast<CORBA::Boolean> (is_it);
+}
+
+void
+TAO_ValueDef_i::is_abstract (CORBA::Boolean is_abstract
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->is_abstract (is_abstract
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ValueDef_i::is_abstract_i (CORBA::Boolean is_abstract
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->set_integer_value (
+ this->section_key_,
+ "is_abstract",
+ static_cast<CORBA::ULong> (is_abstract));
+}
+
+CORBA::Boolean
+TAO_ValueDef_i::is_custom (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->is_custom_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_ValueDef_i::is_custom_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong is_it = 0;
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "is_custom",
+ is_it);
+ return static_cast<CORBA::Boolean> (is_it);
+}
+
+void
+TAO_ValueDef_i::is_custom (CORBA::Boolean is_custom
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->is_custom_i (is_custom
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ValueDef_i::is_custom_i (CORBA::Boolean is_custom
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->set_integer_value (
+ this->section_key_,
+ "is_custom",
+ static_cast<CORBA::ULong> (is_custom));
+}
+
+CORBA::Boolean
+TAO_ValueDef_i::is_truncatable (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->is_truncatable_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_ValueDef_i::is_truncatable_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong is_it = 0;
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "is_truncatable",
+ is_it);
+ return static_cast<CORBA::Boolean> (is_it);
+}
+
+void
+TAO_ValueDef_i::is_truncatable (CORBA::Boolean is_truncatable
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->is_truncatable_i (is_truncatable
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ValueDef_i::is_truncatable_i (CORBA::Boolean is_truncatable
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->set_integer_value (
+ this->section_key_,
+ "is_truncatable",
+ static_cast<CORBA::ULong> (is_truncatable));
+}
+
+CORBA::Boolean
+TAO_ValueDef_i::is_a (const char *id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->is_a_i (id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_ValueDef_i::is_a_i (const char *id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (ACE_OS::strcmp (id, "IDL:omg.org/CORBA/ValueBase:1.0") == 0)
+ {
+ return 1;
+ }
+
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ holder);
+
+ // Is it our type?
+ if (ACE_OS::strcmp (holder.fast_rep (), id) == 0)
+ {
+ return 1;
+ }
+
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_value",
+ holder);
+
+ // Is it our concrete base type?
+ if (ACE_OS::strcmp (holder.fast_rep (), id) == 0)
+ {
+ return 1;
+ }
+
+ ACE_Configuration_Section_Key bases_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "abstract_bases",
+ 0,
+ bases_key);
+
+ if (status != 0)
+ {
+ return 0;
+ }
+
+ CORBA::ULong count = 0;
+ this->repo_->config ()->get_integer_value (bases_key,
+ "count",
+ count);
+ char *stringified = 0;
+ ACE_Configuration_Section_Key base_key;
+ CORBA::Boolean success = 0;
+
+ for (CORBA::ULong i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->get_string_value (bases_key,
+ stringified,
+ holder);
+ this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
+ holder.fast_rep (),
+ holder);
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ holder,
+ base_key,
+ 0);
+ TAO_ValueDef_i impl (this->repo_);
+ impl.section_key (base_key);
+ success = impl.is_a_i (id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (success)
+ {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+CORBA::ValueDef::FullValueDescription *
+TAO_ValueDef_i::describe_value (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_value_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ValueDef::FullValueDescription *
+TAO_ValueDef_i::describe_value_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ValueDef::FullValueDescription *fv_desc = 0;
+ ACE_NEW_RETURN (fv_desc,
+ CORBA::ValueDef::FullValueDescription,
+ 0);
+ CORBA::ValueDef::FullValueDescription_var retval = fv_desc;
+
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ holder);
+ fv_desc->name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ holder);
+ fv_desc->id = holder.fast_rep ();
+
+ CORBA::ULong val = 0;
+
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "is_abstract",
+ val);
+ fv_desc->is_abstract = static_cast<CORBA::Boolean> (val);
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "is_custom",
+ val);
+ fv_desc->is_custom = static_cast<CORBA::Boolean> (val);
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ holder);
+ fv_desc->defined_in = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "version",
+ holder);
+ fv_desc->version = holder.fast_rep ();
+
+ // Operations.
+
+ fv_desc->operations.length (0);
+
+ ACE_Configuration_Section_Key ops_key;
+ int status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "ops",
+ 0,
+ ops_key);
+ CORBA::ULong count = 0;
+ CORBA::ULong param_count = 0;
+ char *stringified = 0;
+ CORBA::ULong i = 0;
+ CORBA::ULong j = 0;
+ TAO_IDLType_i *idl_type = 0;
+ CORBA::Object_var obj;
+
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (ops_key,
+ "count",
+ count);
+ fv_desc->operations.length (count);
+ ACE_Configuration_Section_Key op_key, result_key, contexts_key;
+ ACE_Configuration_Section_Key params_key, excepts_key;
+
+ for (i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (ops_key,
+ stringified,
+ 0,
+ op_key);
+ this->repo_->config ()->get_string_value (op_key,
+ "name",
+ holder);
+ fv_desc->operations[i].name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (op_key,
+ "id",
+ holder);
+ fv_desc->operations[i].id = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "id",
+ holder);
+ fv_desc->operations[i].defined_in = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (op_key,
+ "result",
+ holder);
+ idl_type =
+ TAO_IFR_Service_Utils::path_to_idltype (holder,
+ this->repo_);
+ fv_desc->operations[i].result =
+ idl_type->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->repo_->config ()->get_integer_value (op_key,
+ "mode",
+ val);
+ fv_desc->operations[i].mode = static_cast<CORBA::OperationMode> (val);
+ CORBA::TCKind kind =
+ fv_desc->operations[i].result->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (fv_desc->operations[i].mode == CORBA::OP_ONEWAY
+ && kind != CORBA::tk_void)
+ {
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 31,
+ CORBA::COMPLETED_NO),
+ 0);
+ }
+
+ // Operation contexts.
+
+ TAO_IFR_Strseq_Utils<CORBA::ContextIdSeq>::fill_string_seq (
+ "contexts",
+ this->repo_->config (),
+ op_key,
+ fv_desc->operations[i].contexts
+ );
+
+ // Operation parameters.
+
+ fv_desc->operations[i].parameters.length (0);
+ status =
+ this->repo_->config ()->open_section (op_key,
+ "params",
+ 0,
+ params_key);
+ if (status == 0)
+ {
+ ACE_Configuration_Section_Key param_key;
+ this->repo_->config ()->get_integer_value (params_key,
+ "count",
+ param_count);
+ fv_desc->operations[i].parameters.length (param_count);
+
+ for (j = 0; j < param_count; ++j)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (j);
+ this->repo_->config ()->open_section (params_key,
+ stringified,
+ 0,
+ param_key);
+ this->repo_->config ()->get_string_value (param_key,
+ "name",
+ holder);
+ fv_desc->operations[i].parameters[j].name =
+ holder.fast_rep ();
+ this->repo_->config ()->get_string_value (param_key,
+ "type_path",
+ holder);
+ idl_type =
+ TAO_IFR_Service_Utils::path_to_idltype (holder,
+ this->repo_);
+ fv_desc->operations[i].parameters[j].type =
+ idl_type->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (
+ holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (0);
+
+ fv_desc->operations[i].parameters[j].type_def =
+ CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->repo_->config ()->get_integer_value (param_key,
+ "mode",
+ val);
+ fv_desc->operations[i].parameters[j].mode =
+ static_cast<CORBA::ParameterMode> (val);
+ }
+ }
+
+ // Operation exceptions.
+
+ status =
+ this->repo_->config ()->open_section (op_key,
+ "excepts",
+ 0,
+ excepts_key);
+ fv_desc->operations[i].exceptions.length (0);
+
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (excepts_key,
+ "count",
+ count);
+ fv_desc->operations[i].exceptions.length (count);
+ ACE_Configuration_Section_Key except_def_key;
+
+ for (j = 0; j < count; ++j)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (j);
+ this->repo_->config ()->get_string_value (excepts_key,
+ stringified,
+ holder);
+
+ // Get the TAO_IDLType_i before 'holder' is clobbered.
+ idl_type =
+ TAO_IFR_Service_Utils::path_to_idltype (holder,
+ this->repo_);
+ this->repo_->config ()->expand_path (
+ this->repo_->root_key (),
+ holder,
+ except_def_key,
+ 0
+ );
+ this->repo_->config ()->get_string_value (except_def_key,
+ "name",
+ holder);
+ fv_desc->operations[i].exceptions[j].name =
+ holder.fast_rep ();
+ this->repo_->config ()->get_string_value (except_def_key,
+ "id",
+ holder);
+ fv_desc->operations[i].exceptions[j].id =
+ holder.fast_rep ();
+ this->repo_->config ()->get_string_value (except_def_key,
+ "container_id",
+ holder);
+ fv_desc->operations[i].exceptions[j].defined_in =
+ holder.fast_rep ();
+ this->repo_->config ()->get_string_value (except_def_key,
+ "version",
+ holder);
+ fv_desc->operations[i].exceptions[j].version =
+ holder.fast_rep ();
+
+ // Use the TAO_IDLType_i fetched above.
+ fv_desc->operations[i].exceptions[j].type =
+ idl_type->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ }
+ }
+ }
+
+ // Attributes..
+
+ fv_desc->attributes.length (0);
+
+ ACE_Configuration_Section_Key attrs_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "attrs",
+ 0,
+ attrs_key);
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (attrs_key,
+ "count",
+ count);
+ fv_desc->attributes.length (count);
+ ACE_Configuration_Section_Key attr_key, attr_def_key;
+
+ for (i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (attrs_key,
+ stringified,
+ 0,
+ attr_key);
+ this->repo_->config ()->get_string_value (attr_key,
+ "name",
+ holder);
+ fv_desc->attributes[i].name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (attr_key,
+ "id",
+ holder);
+ fv_desc->attributes[i].id = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (attr_key,
+ "version",
+ holder);
+ fv_desc->attributes[i].version = holder.fast_rep ();
+ this->repo_->config ()->get_integer_value (attr_key,
+ "mode",
+ val);
+ fv_desc->attributes[i].mode =
+ static_cast<CORBA::AttributeMode> (val);
+ this->repo_->config ()->get_string_value (attr_key,
+ "type_path",
+ holder);
+
+ // Use the type path for 'defined_in' and 'type'.
+
+ idl_type =
+ TAO_IFR_Service_Utils::path_to_idltype (holder,
+ this->repo_);
+ fv_desc->attributes[i].type =
+ idl_type->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ holder,
+ attr_def_key,
+ 0);
+ this->repo_->config ()->get_string_value (attr_def_key,
+ "container_id",
+ holder);
+ fv_desc->attributes[i].defined_in = holder.fast_rep ();
+ }
+ }
+
+ // Members..
+
+ fv_desc->members.length (0);
+
+ ACE_Configuration_Section_Key members_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "members",
+ 0,
+ members_key);
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (members_key,
+ "count",
+ count);
+ fv_desc->members.length (count);
+ ACE_Configuration_Section_Key member_key, member_def_key;
+
+ for (i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (members_key,
+ stringified,
+ 0,
+ member_key);
+ this->repo_->config ()->get_string_value (member_key,
+ "name",
+ holder);
+ fv_desc->members[i].name = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (member_key,
+ "id",
+ holder);
+ fv_desc->members[i].id = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (member_key,
+ "container_id",
+ holder);
+ fv_desc->members[i].defined_in = holder.fast_rep ();
+ this->repo_->config ()->get_string_value (member_key,
+ "version",
+ holder);
+ fv_desc->members[i].version = holder.fast_rep ();
+
+ this->repo_->config ()->get_integer_value (member_key,
+ "access",
+ val);
+ fv_desc->members[i].access =
+ static_cast<CORBA::Visibility> (val);
+
+ // Use type path for 'type' and 'type_def',
+
+ this->repo_->config ()->get_string_value (member_key,
+ "type_path",
+ holder);
+ idl_type =
+ TAO_IFR_Service_Utils::path_to_idltype (holder,
+ this->repo_);
+ fv_desc->members[i].type =
+ idl_type->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ fv_desc->members[i].type_def =
+ CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ }
+
+ // Initializers
+
+ fv_desc->initializers.length (0);
+
+ ACE_Configuration_Section_Key initializers_key;
+ status =
+ this->repo_->config ()->open_section (this->section_key_,
+ "initializers",
+ 0,
+ initializers_key);
+
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (initializers_key,
+ "count",
+ count);
+ fv_desc->initializers.length (count);
+ ACE_Configuration_Section_Key initializer_key, params_key, arg_key;
+
+ for (i = 0; i < count; ++i)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (initializers_key,
+ stringified,
+ 0,
+ initializer_key);
+ this->repo_->config ()->get_string_value (initializer_key,
+ "name",
+ holder);
+ fv_desc->initializers[i].name = holder.fast_rep ();
+
+ fv_desc->initializers[i].members.length (0);
+ status =
+ this->repo_->config ()->open_section (initializer_key,
+ stringified,
+ 0,
+ params_key);
+
+ if (status == 0)
+ {
+ this->repo_->config ()->get_integer_value (params_key,
+ "count",
+ param_count);
+ fv_desc->initializers[i].members.length (param_count);
+
+ for (j = 0; j < param_count; ++j)
+ {
+ stringified = TAO_IFR_Service_Utils::int_to_string (j);
+ this->repo_->config ()->open_section (params_key,
+ stringified,
+ 0,
+ arg_key);
+ this->repo_->config ()->get_string_value (arg_key,
+ "arg_name",
+ holder);
+ fv_desc->initializers[i].members[j].name =
+ holder.fast_rep ();
+ this->repo_->config ()->get_string_value (arg_key,
+ "arg_path",
+ holder);
+ obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (
+ holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ fv_desc->initializers[i].members[j].type_def =
+ CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ }
+ }
+ }
+
+ TAO_IFR_Strseq_Utils<CORBA::RepositoryIdSeq>::fill_string_seq (
+ "supported",
+ this->repo_->config (),
+ this->section_key_,
+ fv_desc->supported_interfaces
+ );
+
+ TAO_IFR_Strseq_Utils<CORBA::RepositoryIdSeq>::fill_string_seq (
+ "abstract_bases",
+ this->repo_->config (),
+ this->section_key_,
+ fv_desc->abstract_base_values
+ );
+
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "is_truncatable",
+ val);
+ fv_desc->is_truncatable = static_cast<CORBA::Boolean> (val);
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_value",
+ holder);
+ fv_desc->base_value = holder.fast_rep ();
+ fv_desc->type = this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return retval._retn ();
+}
+
+CORBA::ValueMemberDef_ptr
+TAO_ValueDef_i::create_value_member (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::Visibility access
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::ValueMemberDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ValueMemberDef::_nil ());
+
+ return this->create_value_member_i (id,
+ name,
+ version,
+ type,
+ access
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ValueMemberDef_ptr
+TAO_ValueDef_i::create_value_member_i (const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::Visibility access
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+
+ // Common to all IR objects created in CORBA::Container.
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (CORBA::dk_Value,
+ CORBA::dk_ValueMember,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "members"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ValueMemberDef::_nil ());
+
+ // Store the path to the attribute's type definition.
+ char *type_path = TAO_IFR_Service_Utils::reference_to_path (type);
+
+ this->repo_->config ()->set_string_value (new_key,
+ "type_path",
+ type_path);
+
+ // Store the attribute's mode.
+ this->repo_->config ()->set_integer_value (new_key,
+ "access",
+ access);
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_ValueMember,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ValueMemberDef::_nil ());
+
+ CORBA::ValueMemberDef_var retval =
+ CORBA::ValueMemberDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::ValueMemberDef::_nil ());
+
+ return retval._retn ();
+}
+
+CORBA::AttributeDef_ptr
+TAO_ValueDef_i::create_attribute (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::AttributeDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::AttributeDef::_nil ());
+
+ return this->create_attribute_i (id,
+ name,
+ version,
+ type,
+ mode
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::AttributeDef_ptr
+TAO_ValueDef_i::create_attribute_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+
+ // Common to all IR objects created in CORBA::Container.
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (CORBA::dk_Value,
+ CORBA::dk_Attribute,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "attrs"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::AttributeDef::_nil ());
+
+ // Store the path to the attribute's type definition.
+ char *type_path = TAO_IFR_Service_Utils::reference_to_path (type);
+
+ this->repo_->config ()->set_string_value (new_key,
+ "type_path",
+ type_path);
+
+ // Store the attribute's mode.
+ this->repo_->config ()->set_integer_value (new_key,
+ "mode",
+ mode);
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Attribute,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::AttributeDef::_nil ());
+
+ CORBA::AttributeDef_var retval =
+ CORBA::AttributeDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::AttributeDef::_nil ());
+
+ return retval._retn ();
+}
+
+CORBA::OperationDef_ptr
+TAO_ValueDef_i::create_operation (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr result,
+ CORBA::OperationMode mode,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions,
+ const CORBA::ContextIdSeq &contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD_RETURN (CORBA::OperationDef::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::OperationDef::_nil ());
+
+ return this->create_operation_i (id,
+ name,
+ version,
+ result,
+ mode,
+ params,
+ exceptions,
+ contexts
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::OperationDef_ptr
+TAO_ValueDef_i::create_operation_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr result,
+ CORBA::OperationMode mode,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions,
+ const CORBA::ContextIdSeq &contexts
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_Container_i::tmp_name_holder_ = name;
+ ACE_Configuration_Section_Key new_key;
+
+ // Common to all IR objects created in CORBA::Container.
+ ACE_TString path =
+ TAO_IFR_Service_Utils::create_common (CORBA::dk_Value,
+ CORBA::dk_Operation,
+ this->section_key_,
+ new_key,
+ this->repo_,
+ id,
+ name,
+ &TAO_Container_i::same_as_tmp_name,
+ version,
+ "ops"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::OperationDef::_nil ());
+
+ // Get the TypeCode for the return type.
+ ACE_TString result_path (TAO_IFR_Service_Utils::reference_to_path (result));
+ TAO_IDLType_i *result_impl =
+ TAO_IFR_Service_Utils::path_to_idltype (result_path,
+ this->repo_);
+
+ CORBA::TypeCode_var rettype =
+ result_impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::OperationDef::_nil ());
+
+ CORBA::TCKind kind = rettype->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::OperationDef::_nil ());
+
+ // Oneway operations cannot have a non-void return type.
+ if (mode == CORBA::OP_ONEWAY && kind != CORBA::tk_void)
+ {
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 31,
+ CORBA::COMPLETED_NO),
+ CORBA::OperationDef::_nil ());
+ }
+
+ this->repo_->config ()->set_string_value (new_key,
+ "result",
+ result_path);
+
+ // Store the operation mode.
+ this->repo_->config ()->set_integer_value (new_key,
+ "mode",
+ mode);
+
+ CORBA::ULong i = 0;
+
+ // Store the operation's parameter info.
+ CORBA::ULong length = params.length ();
+
+ if (length > 0)
+ {
+ ACE_Configuration_Section_Key params_key;
+ this->repo_->config ()->open_section (new_key,
+ "params",
+ 1,
+ params_key);
+
+ this->repo_->config ()->set_integer_value (params_key,
+ "count",
+ length);
+ char *type_path = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ // Oneway operations cannot have INOUT or OUT parameters.
+ if (mode == CORBA::OP_ONEWAY && params[i].mode != CORBA::PARAM_IN)
+ {
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 31,
+ CORBA::COMPLETED_NO),
+ CORBA::OperationDef::_nil ());
+ }
+
+ ACE_Configuration_Section_Key param_key;
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->open_section (params_key,
+ stringified,
+ 1,
+ param_key);
+
+ this->repo_->config ()->set_string_value (param_key,
+ "name",
+ params[i].name.in ());
+ type_path =
+ TAO_IFR_Service_Utils::reference_to_path (
+ params[i].type_def.in ()
+ );
+
+ this->repo_->config ()->set_string_value (param_key,
+ "type_path",
+ type_path);
+
+ this->repo_->config ()->set_integer_value (param_key,
+ "mode",
+ params[i].mode);
+ }
+ }
+
+ // Store the operation's exception info.
+ length = exceptions.length ();
+
+ if (length > 0)
+ {
+ // Oneway operations cannot throw any user exceptions.
+ if (mode == CORBA::OP_ONEWAY)
+ {
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 31,
+ CORBA::COMPLETED_NO),
+ CORBA::OperationDef::_nil ());
+ }
+
+ ACE_Configuration_Section_Key excepts_key;
+
+ this->repo_->config ()->open_section (new_key,
+ "excepts",
+ 1,
+ excepts_key);
+
+ this->repo_->config ()->set_integer_value (excepts_key,
+ "count",
+ length);
+ char *type_path = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ type_path =
+ TAO_IFR_Service_Utils::reference_to_path (exceptions[i]);
+
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (excepts_key,
+ stringified,
+ type_path);
+ }
+ }
+
+ // Store the operation's context info.
+ length = contexts.length ();
+
+ if (length > 0)
+ {
+ ACE_Configuration_Section_Key contexts_key;
+
+ this->repo_->config ()->open_section (new_key,
+ "contexts",
+ 1,
+ contexts_key);
+
+ for (i = 0; i < length; ++i)
+ {
+ char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
+ this->repo_->config ()->set_string_value (contexts_key,
+ stringified,
+ contexts[i]);
+ }
+ }
+
+ // Create the object reference.
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::create_objref (CORBA::dk_Operation,
+ path.c_str (),
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::OperationDef::_nil ());
+
+ CORBA::OperationDef_var retval =
+ CORBA::OperationDef::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::OperationDef::_nil ());
+
+ return retval._retn ();
+}
+
+int
+TAO_ValueDef_i::name_clash (const char *name)
+{
+ ACE_TRY_NEW_ENV
+ {
+ TAO_Container_i::tmp_name_holder_ = name;
+ TAO_IFR_Service_Utils::name_exists (&TAO_Container_i::same_as_tmp_name,
+ TAO_IFR_Service_Utils::tmp_key_,
+ TAO_IFR_Service_Utils::repo_,
+ CORBA::dk_Value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+void
+TAO_ValueDef_i::fill_value_description (CORBA::ValueDescription &desc
+ ACE_ENV_ARG_DECL)
+{
+ desc.name = this->name_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ desc.id = this->id_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong tmp = this->is_abstract_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ desc.is_abstract = static_cast<CORBA::Boolean> (tmp);
+
+ tmp = this->is_custom_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ desc.is_custom = static_cast<CORBA::Boolean> (tmp);
+
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "container_id",
+ holder);
+ desc.defined_in = holder.fast_rep ();
+
+ desc.version = this->version_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_IFR_Strseq_Utils<CORBA::RepositoryIdSeq>::fill_string_seq (
+ "supported",
+ this->repo_->config (),
+ this->section_key_,
+ desc.supported_interfaces
+ );
+
+ TAO_IFR_Strseq_Utils<CORBA::RepositoryIdSeq>::fill_string_seq (
+ "abstract_bases",
+ this->repo_->config (),
+ this->section_key_,
+ desc.abstract_base_values
+ );
+
+ tmp = this->is_truncatable_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ desc.is_truncatable = static_cast<CORBA::Boolean> (tmp);
+
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_value",
+ holder);
+ desc.base_value = holder.fast_rep ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.h
new file mode 100644
index 00000000000..0d5dd9d7f9f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.h
@@ -0,0 +1,353 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ValueDef_i.h
+//
+// = DESCRIPTION
+// ValueDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_VALUEDEF_I_H
+#define TAO_VALUEDEF_I_H
+
+#include "orbsvcs/IFRService/Contained_i.h"
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ValueDef_i : public virtual TAO_Container_i,
+ public virtual TAO_Contained_i,
+ public virtual TAO_IDLType_i
+{
+ // = TITLE
+ // TAO_ValueDef_i
+ //
+ // = DESCRIPTION
+ // Represents a valuetype definition.
+ //
+public:
+ TAO_ValueDef_i (TAO_Repository_i *repo);
+ // Constructor
+
+ virtual ~TAO_ValueDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's pure virtual function.
+
+ virtual CORBA::InterfaceDefSeq *supported_interfaces (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::InterfaceDefSeq *supported_interfaces_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void supported_interfaces (
+ const CORBA::InterfaceDefSeq & supported_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void supported_interfaces_i (
+ const CORBA::InterfaceDefSeq & supported_interfaces
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::InitializerSeq *initializers (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::InitializerSeq *initializers_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void initializers (
+ const CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void initializers_i (
+ const CORBA::InitializerSeq & initializers
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ValueDef_ptr base_value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ValueDef_ptr base_value_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void base_value (
+ CORBA::ValueDef_ptr base_value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void base_value_i (
+ CORBA::ValueDef_ptr base_value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ValueDefSeq *abstract_base_values (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ValueDefSeq *abstract_base_values_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void abstract_base_values (
+ const CORBA::ValueDefSeq & abstract_base_values
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void abstract_base_values_i (
+ const CORBA::ValueDefSeq & abstract_base_values
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean is_abstract (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Boolean is_abstract_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void is_abstract (
+ CORBA::Boolean is_abstract
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void is_abstract_i (
+ CORBA::Boolean is_abstract
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean is_custom (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Boolean is_custom_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void is_custom (
+ CORBA::Boolean is_custom
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void is_custom_i (
+ CORBA::Boolean is_custom
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean is_truncatable (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Boolean is_truncatable_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void is_truncatable (
+ CORBA::Boolean is_truncatable
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void is_truncatable_i (
+ CORBA::Boolean is_truncatable
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean is_a (
+ const char *id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Boolean is_a_i (
+ const char *id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ValueDef::FullValueDescription *describe_value (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ValueDef::FullValueDescription *describe_value_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ValueMemberDef_ptr create_value_member (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::Visibility access
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ValueMemberDef_ptr create_value_member_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::Visibility access
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::AttributeDef_ptr create_attribute (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::AttributeDef_ptr create_attribute_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr type,
+ CORBA::AttributeMode mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::OperationDef_ptr create_operation (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr result,
+ CORBA::OperationMode mode,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions,
+ const CORBA::ContextIdSeq &contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::OperationDef_ptr create_operation_i (
+ const char *id,
+ const char *name,
+ const char *version,
+ CORBA::IDLType_ptr result,
+ CORBA::OperationMode mode,
+ const CORBA::ParDescriptionSeq &params,
+ const CORBA::ExceptionDefSeq &exceptions,
+ const CORBA::ContextIdSeq &contexts
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ static int name_clash (const char *name);
+ // Called from TAO_IFR_Service_Utils::name_exists() when we
+ // are a base valuetype.
+
+ void fill_value_description (CORBA::ValueDescription &desc
+ ACE_ENV_ARG_DECL);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_VALUEDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ValueMemberDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ValueMemberDef_i.cpp
new file mode 100644
index 00000000000..bb6b101ddd0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ValueMemberDef_i.cpp
@@ -0,0 +1,224 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/ValueMemberDef_i.h"
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils_T.h"
+#include "orbsvcs/IFRService/IFR_Service_Utils.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ ValueMemberDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_ValueMemberDef_i::TAO_ValueMemberDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_Contained_i (repo)
+{
+}
+
+TAO_ValueMemberDef_i::~TAO_ValueMemberDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_ValueMemberDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_ValueMember;
+}
+
+CORBA::Contained::Description *
+TAO_ValueMemberDef_i::describe (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->describe_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Contained::Description *
+TAO_ValueMemberDef_i::describe_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ValueMember vm;
+ TAO_IFR_Desc_Utils<CORBA::ValueMember,
+ TAO_ValueMemberDef_i>::fill_desc_begin (
+ vm,
+ this->repo_,
+ this->section_key_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (0);
+
+ vm.type = this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "type_path",
+ holder);
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ vm.type_def = CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ULong val = 0;
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "access",
+ val);
+ vm.access = static_cast<CORBA::Visibility> (val);
+
+ CORBA::Contained::Description *retval = 0;
+ ACE_NEW_RETURN (retval,
+ CORBA::Contained::Description,
+ 0);
+
+ retval->kind = CORBA::dk_ValueMember;
+ retval->value <<= vm;
+ return retval;
+}
+
+CORBA::TypeCode_ptr
+TAO_ValueMemberDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_ValueMemberDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "type_path",
+ holder);
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (holder,
+ this->repo_);
+ return impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_ValueMemberDef_i::type_def (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::IDLType::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return this->type_def_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::IDLType_ptr
+TAO_ValueMemberDef_i::type_def_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString holder;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "type_path",
+ holder);
+ CORBA::Object_var obj =
+ TAO_IFR_Service_Utils::path_to_ir_object (holder,
+ this->repo_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::IDLType::_nil ());
+
+ return CORBA::IDLType::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ValueMemberDef_i::type_def (CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->type_def_i (type_def
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ValueMemberDef_i::type_def_i (CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ const char *path = TAO_IFR_Service_Utils::reference_to_path (type_def);
+ this->repo_->config ()->set_string_value (this->section_key_,
+ "type_path",
+ path);
+}
+
+CORBA::Visibility
+TAO_ValueMemberDef_i::access (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->access_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Visibility
+TAO_ValueMemberDef_i::access_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong val = 0;
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "access",
+ val);
+ return static_cast<CORBA::Visibility> (val);
+}
+
+void
+TAO_ValueMemberDef_i::access (CORBA::Visibility access
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->access_i (access
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_ValueMemberDef_i::access_i (CORBA::Visibility access
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->set_integer_value (this->section_key_,
+ "access",
+ access);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ValueMemberDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/ValueMemberDef_i.h
new file mode 100644
index 00000000000..1da19410d15
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ValueMemberDef_i.h
@@ -0,0 +1,132 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// ValueMemberDef_i.h
+//
+// = DESCRIPTION
+// ValueMemberDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_VALUEMEMBERDEF_I_H
+#define TAO_VALUEMEMBERDEF_I_H
+
+#include "orbsvcs/IFRService/Contained_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_ValueMemberDef_i : public virtual TAO_Contained_i
+{
+ // = TITLE
+ // TAO_ValeMemberDef_i
+ //
+ // = DESCRIPTION
+ // Represents the definition of a valuemember structure.
+ //
+public:
+ TAO_ValueMemberDef_i (TAO_Repository_i *repoy);
+ // Constructor
+
+ virtual ~TAO_ValueMemberDef_i (void);
+ // Destructor
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual CORBA::Contained::Description *describe (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::Contained::Description *describe_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From Contained_i's pure virtual function.
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::IDLType_ptr type_def (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::IDLType_ptr type_def_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void type_def (
+ CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void type_def_i (
+ CORBA::IDLType_ptr type_def
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Visibility access (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Visibility access_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void access (
+ CORBA::Visibility access
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void access_i (
+ CORBA::Visibility access
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_VALUEMEMBERDEF_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/WstringDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/WstringDef_i.cpp
new file mode 100644
index 00000000000..252050a2855
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/WstringDef_i.cpp
@@ -0,0 +1,131 @@
+// $Id$
+
+#include "orbsvcs/IFRService/Repository_i.h"
+#include "orbsvcs/IFRService/WstringDef_i.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (IFRService,
+ WstringDef_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_WstringDef_i::TAO_WstringDef_i (
+ TAO_Repository_i *repo
+ )
+ : TAO_IRObject_i (repo),
+ TAO_IDLType_i (repo)
+{
+}
+
+TAO_WstringDef_i::~TAO_WstringDef_i (void)
+{
+}
+
+CORBA::DefinitionKind
+TAO_WstringDef_i::def_kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::dk_Wstring;
+}
+
+void
+TAO_WstringDef_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_WstringDef_i::destroy_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TString name;
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "name",
+ name);
+
+ this->repo_->config ()->remove_section (this->repo_->wstrings_key (),
+ name.c_str (),
+ 0);
+}
+
+CORBA::TypeCode_ptr
+TAO_WstringDef_i::type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (CORBA::TypeCode::_nil ());
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::TypeCode_ptr
+TAO_WstringDef_i::type_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong bound = this->bound_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
+
+ return this->repo_->tc_factory ()->create_wstring_tc (bound
+ ACE_ENV_ARG_PARAMETER);
+}
+CORBA::ULong
+TAO_WstringDef_i::bound (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_READ_GUARD_RETURN (0);
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->bound_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+
+CORBA::ULong
+TAO_WstringDef_i::bound_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ u_int retval = 0;
+ this->repo_->config ()->get_integer_value (this->section_key_,
+ "bound",
+ retval);
+
+ return static_cast<CORBA::ULong> (retval);
+}
+
+void
+TAO_WstringDef_i::bound (CORBA::ULong bound
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_IFR_WRITE_GUARD;
+
+ this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->bound_i (bound
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_WstringDef_i::bound_i (CORBA::ULong bound
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->repo_->config ()->set_integer_value (this->section_key_,
+ "bound",
+ bound);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/WstringDef_i.h b/TAO/orbsvcs/orbsvcs/IFRService/WstringDef_i.h
new file mode 100644
index 00000000000..c1317c0a888
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/WstringDef_i.h
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs/IFRService
+//
+// = FILENAME
+// WstringDef_i.h
+//
+// = DESCRIPTION
+// WstringDef servant class.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_WSTRINGDEF_I_H
+#define TAO_WSTRINGDEF_I_H
+
+#include "orbsvcs/IFRService/IDLType_i.h"
+#include "orbsvcs/IFRService/ifr_service_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IFRService_Export TAO_WstringDef_i : public virtual TAO_IDLType_i
+{
+ // = TITLE
+ // TAO_WstringDef_i
+ //
+ // = DESCRIPTION
+ // Represents a bounded wstring (unbounded wstrings
+ // are included in PrimitiveDef).
+ //
+public:
+ TAO_WstringDef_i (TAO_Repository_i *repo);
+ // Constructor.
+
+ virtual ~TAO_WstringDef_i (void);
+ // Destructor.
+
+ virtual CORBA::DefinitionKind def_kind (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return our definition kind.
+
+ virtual void destroy (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Remove the repository entry.
+
+ virtual void destroy_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::TypeCode_ptr type (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's virtual function.
+
+ virtual CORBA::TypeCode_ptr type_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // From IDLType_i's virtual function.
+
+ virtual CORBA::ULong bound (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ULong bound_i (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void bound (
+ CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void bound_i (
+ CORBA::ULong bound
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_WSTRINGDEF_I_H */
+
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/concrete_classes.h b/TAO/orbsvcs/orbsvcs/IFRService/concrete_classes.h
new file mode 100644
index 00000000000..27407fa581c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/concrete_classes.h
@@ -0,0 +1,54 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/Param_Test
+//
+// = FILENAME
+// concrete_classes.h
+//
+// = DESCRIPTION
+// All the concrete class header files needed by the servant locator.
+//
+// = AUTHORS
+// Jeff Parsons
+//
+// ============================================================================
+
+#ifndef CONCRETE_CLASSES_H
+#define CONCRETE_CLASSES_H
+
+#include "orbsvcs/IFRService/PrimitiveDef_i.h"
+#include "orbsvcs/IFRService/StringDef_i.h"
+#include "orbsvcs/IFRService/WstringDef_i.h"
+#include "orbsvcs/IFRService/SequenceDef_i.h"
+#include "orbsvcs/IFRService/ArrayDef_i.h"
+#include "orbsvcs/IFRService/FixedDef_i.h"
+#include "orbsvcs/IFRService/EnumDef_i.h"
+#include "orbsvcs/IFRService/AliasDef_i.h"
+#include "orbsvcs/IFRService/NativeDef_i.h"
+#include "orbsvcs/IFRService/ValueBoxDef_i.h"
+#include "orbsvcs/IFRService/UnionDef_i.h"
+#include "orbsvcs/IFRService/StructDef_i.h"
+#include "orbsvcs/IFRService/ValueMemberDef_i.h"
+#include "orbsvcs/IFRService/FactoryDef_i.h"
+#include "orbsvcs/IFRService/AttributeDef_i.h"
+#include "orbsvcs/IFRService/ConstantDef_i.h"
+#include "orbsvcs/IFRService/ValueDef_i.h"
+#include "orbsvcs/IFRService/ExceptionDef_i.h"
+#include "orbsvcs/IFRService/ModuleDef_i.h"
+#include "orbsvcs/IFRService/ExtAbstractInterfaceDef_i.h"
+#include "orbsvcs/IFRService/ExtLocalInterfaceDef_i.h"
+
+#include "orbsvcs/IFRService/ComponentDef_i.h"
+#include "orbsvcs/IFRService/HomeDef_i.h"
+#include "orbsvcs/IFRService/FinderDef_i.h"
+#include "orbsvcs/IFRService/ConsumesDef_i.h"
+#include "orbsvcs/IFRService/PublishesDef_i.h"
+#include "orbsvcs/IFRService/EmitsDef_i.h"
+#include "orbsvcs/IFRService/EventDef_i.h"
+#include "orbsvcs/IFRService/ProvidesDef_i.h"
+#include "orbsvcs/IFRService/UsesDef_i.h"
+
+#endif /* CONCRETE_CLASSES_H */
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ifr_service_export.h b/TAO/orbsvcs/orbsvcs/IFRService/ifr_service_export.h
new file mode 100644
index 00000000000..4e1aed48095
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ifr_service_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_IFRSERVICE_EXPORT_H
+#define TAO_IFRSERVICE_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_IFRSERVICE_HAS_DLL)
+# define TAO_IFRSERVICE_HAS_DLL 0
+# endif /* ! TAO_IFRSERVICE_HAS_DLL */
+#else
+# if !defined (TAO_IFRSERVICE_HAS_DLL)
+# define TAO_IFRSERVICE_HAS_DLL 1
+# endif /* ! TAO_IFRSERVICE_HAS_DLL */
+#endif
+
+#if defined (TAO_IFRSERVICE_HAS_DLL) && (TAO_IFRSERVICE_HAS_DLL == 1)
+# if defined (TAO_IFRSERVICE_BUILD_DLL)
+# define TAO_IFRService_Export ACE_Proper_Export_Flag
+# define TAO_IFRSERVICE_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_IFRSERVICE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_IFRSERVICE_BUILD_DLL */
+# define TAO_IFRService_Export ACE_Proper_Import_Flag
+# define TAO_IFRSERVICE_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_IFRSERVICE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_IFRSERVICE_BUILD_DLL */
+#else /* TAO_IFRSERVICE_HAS_DLL == 1 */
+# define TAO_IFRService_Export
+# define TAO_IFRSERVICE_SINGLETON_DECLARATION(T)
+# define TAO_IFRSERVICE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_IFRSERVICE_HAS_DLL == 1 */
+
+#endif /* TAO_IFRSERVICE_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp b/TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp
new file mode 100644
index 00000000000..73a947638cf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp
@@ -0,0 +1,321 @@
+// $Id$
+
+#include "orbsvcs/IOR_Multicast.h"
+
+#include "tao/debug.h"
+
+#include "ace/SOCK_Connector.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID (orbsvcs,
+ IOR_Multicast,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_HANDLE
+TAO_IOR_Multicast::get_handle (void) const
+{
+ return this->mcast_dgram_.get_handle ();
+}
+
+TAO_IOR_Multicast::TAO_IOR_Multicast (void)
+ : service_id_ ((TAO_Service_ID) 0)
+{
+}
+
+TAO_IOR_Multicast::TAO_IOR_Multicast (const char *ior,
+ u_short port,
+ const char *mcast_addr,
+ TAO_Service_ID service_id)
+{
+ if (this->init (ior,
+ port,
+ mcast_addr,
+ service_id) == -1)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("%p\n"),
+ ACE_TEXT ("TAO_IOR_Multicast")));
+}
+
+TAO_IOR_Multicast::~TAO_IOR_Multicast (void)
+{
+ if (ior_.length() > 0 && this->mcast_dgram_.leave (this->mcast_addr_) == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "%p\n", "~TAO_IOR_Multicast()"));
+ }
+}
+
+int
+TAO_IOR_Multicast::init (const char *ior,
+ u_short port,
+ const char *mcast_addr,
+ TAO_Service_ID service_id)
+{
+ if (this->mcast_addr_.set (port, mcast_addr) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR, "TAO_IOR_Multicast::init() %p\n", "set"), -1);
+ return common_init (ior, service_id);
+}
+
+int
+TAO_IOR_Multicast::init (const char *ior,
+ const char *mcast_addr,
+ TAO_Service_ID service_id)
+{
+ // Look for a '@' incase a nic is specified.
+ const char* tmpnic = ACE_OS::strchr (mcast_addr, '@');
+
+ CORBA::String_var actual_mcast_addr;
+ CORBA::ULong length_addr;
+
+ if (tmpnic != 0)
+ {
+ // i.e. a nic name has been specified
+ length_addr = tmpnic - mcast_addr + 1;
+ actual_mcast_addr = CORBA::string_alloc (length_addr);
+
+ ACE_OS::strncpy (actual_mcast_addr.inout (),
+ mcast_addr,
+ length_addr - 1);
+
+ actual_mcast_addr[length_addr - 1] = '\0';
+
+ /// Save for use later.
+ this->mcast_nic_ = tmpnic + 1;
+ }
+ else
+ {
+ actual_mcast_addr =
+ CORBA::string_alloc (static_cast<CORBA::ULong> (ACE_OS::strlen (mcast_addr)));
+
+ actual_mcast_addr = mcast_addr;
+ }
+
+ if (this->mcast_addr_.set (actual_mcast_addr.in ()) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "set"),
+ -1);
+
+ return common_init (ior, service_id);
+}
+
+int
+TAO_IOR_Multicast::common_init (const char *ior,
+ TAO_Service_ID service_id)
+{
+ this->service_id_ = service_id;
+ this->ior_ = ior;
+
+ if (this->response_addr_.set ((u_short) 0) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_IOR_Multicast::common_init() %p\n",
+ "set"),
+ -1);
+ else if (this->response_.open (this->response_addr_) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "set"),
+ -1);
+ }
+
+ // Use ACE_SOCK_Dgram_Mcast factory to subscribe to multicast group.
+ if (this->mcast_nic_.length() != 0)
+ {
+ if (this->mcast_dgram_.subscribe (this->mcast_addr_,
+ 1,
+ ACE_TEXT_CHAR_TO_TCHAR(this->mcast_nic_.c_str())) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR, "TAO_IOR_Multicast::common_init() %p\n", "subscribe"),-1);
+ }
+ else
+ {
+ if (this->mcast_dgram_.subscribe (this->mcast_addr_) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_IOR_Multicast::common_init() %p\n",
+ "subscribe"),
+ -1);
+ }
+ return 0;
+}
+
+int
+TAO_IOR_Multicast::handle_timeout (const ACE_Time_Value &,
+ const void *)
+{
+ return 0;
+}
+
+int
+TAO_IOR_Multicast::handle_input (ACE_HANDLE)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Entered TAO_IOR_Multicast::handle_input\n"));
+
+ // The length of the service name string that follows.
+ CORBA::Short header;
+ // Port to which to reply.
+ ACE_UINT16 remote_port;
+ // Name of the service for which the client is looking.
+ char service_name[BUFSIZ];
+
+ ACE_INET_Addr remote_addr;
+
+ // Take a peek at the header to find out how long is the service
+ // name string we should receive.
+ ssize_t n = this->mcast_dgram_.recv (&header,
+ sizeof (header),
+ remote_addr,
+ MSG_PEEK);
+ if (n <= 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_IOR_Multicast::handle_input - peek %d\n",
+ n),
+ 0);
+ else if (ACE_NTOHS (header) <= 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_IOR_Multicast::handle_input() Header value < 1\n"),
+ 0);
+
+ // Receive full client multicast request.
+ const int iovcnt = 3;
+ iovec iov[iovcnt];
+
+ iov[0].iov_base = (char *) &header;
+ iov[0].iov_len = sizeof (header);
+ iov[1].iov_base = (char *) &remote_port;
+ iov[1].iov_len = sizeof (ACE_UINT16);
+ iov[2].iov_base = (char *) service_name;
+ iov[2].iov_len = ACE_NTOHS (header);
+
+ // Read the iovec.
+ n = this->mcast_dgram_.recv (iov,
+ iovcnt,
+ remote_addr);
+ if (n <= 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_IOR_Multicast::handle_input recv = %d\n",
+ n),
+ 0);
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_TCHAR addr[64];
+ remote_addr.addr_to_string (addr, sizeof(addr));
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Received multicast from %s.\n"
+ "Service Name received : %s\n"
+ "Port received : %u\n",
+ addr,
+ service_name,
+ ACE_NTOHS (remote_port)));
+ }
+
+ if (ACE_OS::strcmp (service_name,
+ "NameService") != 0
+ && ACE_OS::strcmp (service_name,
+ "TradingService") != 0
+ && ACE_OS::strcmp (service_name,
+ "ImplRepoService") != 0
+ && ACE_OS::strcmp (service_name,
+ "InterfaceRepository") != 0
+ && ACE_OS::strcmp (service_name,
+ "MCASTServer") != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "IOR_Multicast::connect() Unknown service requested.\n"),0);
+ }
+
+ // Reply to the multicast message.
+ ACE_SOCK_Connector connector;
+ ACE_INET_Addr peer_addr;
+ ACE_SOCK_Stream stream;
+
+ peer_addr.set (remote_addr);
+ peer_addr.set_port_number (ACE_NTOHS (remote_port));
+
+#if defined (ACE_HAS_IPV6)
+ if (peer_addr.is_linklocal ())
+ {
+ // If this is one of our local linklocal interfaces this is not going
+ // to work.
+ // Creating a connection using such interface to the client listening
+ // at the IPv6 ANY address is not going to work (I'm not quite sure why
+ // but it probably has to do with the rather restrictive routing rules
+ // for linklocal interfaces).
+ // So we see if this is one of our local interfaces and if so create the
+ // connection using the IPv6 loopback address instead.
+ ACE_INET_Addr peer_tmp(peer_addr);
+ peer_tmp.set_port_number (static_cast<u_short> (0));
+ ACE_INET_Addr* tmp = 0;
+ size_t cnt = 0;
+ int err = ACE::get_ip_interfaces (cnt, tmp);
+ if (err == 0)
+ {
+ for (size_t i = 0; i < cnt; ++i)
+ {
+ if (peer_tmp == tmp[i])
+ {
+ peer_addr.set (ACE_NTOHS (remote_port),
+ ACE_IPV6_LOCALHOST);
+ break;
+ }
+ }
+
+ delete[] tmp;
+ }
+ }
+#endif /* ACE_HAS_IPV6 */
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_TCHAR addr[64];
+ peer_addr.addr_to_string (addr, sizeof(addr));
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Replying to peer %s.\n",
+ addr));
+ }
+
+ // Connect.
+ if (connector.connect (stream, peer_addr) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR, "IOR_Multicast::connect failed\n"), 0);
+ // Send the IOR back to the client. (Send iovec, which contains ior
+ // length as the first element, and ior itself as the second.)
+
+ // Length of ior to be sent.
+ CORBA::Short data_len =
+ static_cast<CORBA::Short> (ACE_HTONS (this->ior_.length () + 1));
+
+ // Vector to be sent.
+ const int cnt = 2;
+ iovec iovp[cnt];
+
+ // The length of ior to be sent.
+ iovp[0].iov_base = (char *) &data_len;
+ iovp[0].iov_len = sizeof (CORBA::Short);
+
+ // The ior.
+ iovp[1].iov_base = const_cast<char*> (this->ior_.c_str ());
+ iovp[1].iov_len = static_cast<u_long> (this->ior_.length () + 1);
+
+ ssize_t result = stream.sendv_n (iovp, cnt);
+ // Close the stream.
+ stream.close ();
+
+ // Check for error.
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR, "IOR_Multicast::send failed\n"), 0);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) TAO_IOR_Multicast::handle_input() ior_: <%s>\n"
+ "sent to %s:%u.\n"
+ "result from send = %d\n",
+ this->ior_.c_str (),
+ peer_addr.get_host_name (),
+ peer_addr.get_port_number (),
+ result));
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/IOR_Multicast.h b/TAO/orbsvcs/orbsvcs/IOR_Multicast.h
new file mode 100644
index 00000000000..9963e2fa222
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/IOR_Multicast.h
@@ -0,0 +1,114 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/orbsvcs
+//
+// = FILENAME
+// IOR_Multicast.h
+//
+// = DESCRIPTION
+// Defines a class that listens to a multicast address for client requests
+// for ior of a bootstrappable service.
+//
+// = AUTHORS
+// Sergio Flores-Gaitan
+//
+// ============================================================================
+
+#ifndef TAO_IOR_MULTICAST_H
+#define TAO_IOR_MULTICAST_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/svc_utils_export.h"
+#include "tao/ORB.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/INET_Addr.h"
+#include "ace/SOCK_Dgram_Mcast.h"
+#include "ace/Reactor.h"
+#include "ace/SString.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Svc_Utils_Export TAO_IOR_Multicast : public ACE_Event_Handler
+{
+ // = TITLE
+ // Event Handler that services multicast requests for IOR of a
+ // bootstrappable service.
+ //
+ // = DESCRIPTION
+ // This class uses the ACE_SOCK_Dgram_Mcast class and should be
+ // registered with a reactor and should be initialized with the
+ // ior of the service to be multicasted.
+public:
+ TAO_IOR_Multicast (void);
+ // Constructor.
+
+ TAO_IOR_Multicast (const char *ior,
+ u_short port,
+ const char *mcast_addr,
+ TAO_Service_ID service_id);
+ // Constructor taking the ior of the service.
+
+ int init (const char *ior,
+ u_short port,
+ const char *mcast_addr,
+ TAO_Service_ID service_id);
+ // Initialization method.
+
+ int init (const char *ior,
+ const char *mcast_addr,
+ TAO_Service_ID service_id);
+ // Initialization method. Takes in "address:port" string as a
+ // parameter.
+
+ virtual ~TAO_IOR_Multicast (void);
+ // Destructor.
+
+ virtual int handle_input (ACE_HANDLE n);
+ // Callback when input is received on the handle.
+
+ virtual int handle_timeout (const ACE_Time_Value &tv,
+ const void *arg);
+ // Callback when a timeout has occurred.
+
+ virtual ACE_HANDLE get_handle (void) const;
+ // Returns the internal handle used to receive multicast.
+
+private:
+ int common_init (const char *ior,
+ TAO_Service_ID service_id);
+ // Factor common functionality from the two init functions.
+
+ TAO_Service_ID service_id_;
+ // Service id that we're waiting for.
+
+ ACE_SOCK_Dgram_Mcast mcast_dgram_;
+ // multicast endpoint of communication
+
+ ACE_INET_Addr mcast_addr_;
+ // multicast address
+
+ ACE_CString ior_;
+ // object reference to send in response to the multicast
+
+ ACE_INET_Addr response_addr_;
+ // address of response.
+
+ ACE_SOCK_Dgram response_;
+ // socket for response to the multicast
+
+ ACE_CString mcast_nic_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_IOR_MULTICAST_H */
diff --git a/TAO/orbsvcs/orbsvcs/LB_ORT.idl b/TAO/orbsvcs/orbsvcs/LB_ORT.idl
new file mode 100644
index 00000000000..0134ff0cc96
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LB_ORT.idl
@@ -0,0 +1,28 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file LB_ORT.idl
+ *
+ * $Id$
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_ORT_IDL
+#define TAO_LB_ORT_IDL
+
+#include "tao/ObjRefTemplate/ObjectReferenceTemplate_include.pidl"
+
+
+module TAO_LB
+{
+ typeprefix TAO_LB "tao.lb";
+
+ valuetype ObjectReferenceFactory
+ : PortableInterceptor::ObjectReferenceFactory {};
+
+};
+
+
+#endif /* TAO_LB_ORT_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/LifeCycle/lifecycle_export.h b/TAO/orbsvcs/orbsvcs/LifeCycle/lifecycle_export.h
new file mode 100644
index 00000000000..3ceb2c30777
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LifeCycle/lifecycle_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_LIFECYCLE_EXPORT_H
+#define TAO_LIFECYCLE_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_LIFECYCLE_HAS_DLL)
+# define TAO_LIFECYCLE_HAS_DLL 0
+# endif /* ! TAO_LIFECYCLE_HAS_DLL */
+#else
+# if !defined (TAO_LIFECYCLE_HAS_DLL)
+# define TAO_LIFECYCLE_HAS_DLL 1
+# endif /* ! TAO_LIFECYCLE_HAS_DLL */
+#endif
+
+#if defined (TAO_LIFECYCLE_HAS_DLL) && (TAO_LIFECYCLE_HAS_DLL == 1)
+# if defined (TAO_LIFECYCLE_BUILD_DLL)
+# define TAO_LifeCycle_Export ACE_Proper_Export_Flag
+# define TAO_LIFECYCLE_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_LIFECYCLE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_LIFECYCLE_BUILD_DLL */
+# define TAO_LifeCycle_Export ACE_Proper_Import_Flag
+# define TAO_LIFECYCLE_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_LIFECYCLE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_LIFECYCLE_BUILD_DLL */
+#else /* TAO_LIFECYCLE_HAS_DLL == 1 */
+# define TAO_LifeCycle_Export
+# define TAO_LIFECYCLE_SINGLETON_DECLARATION(T)
+# define TAO_LIFECYCLE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_LIFECYCLE_HAS_DLL == 1 */
+
+#endif /* TAO_LIFECYCLE_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/LifeCycleService.idl b/TAO/orbsvcs/orbsvcs/LifeCycleService.idl
new file mode 100644
index 00000000000..8322d49137e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LifeCycleService.idl
@@ -0,0 +1,83 @@
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// LifeCycleService.idl
+//
+// = DESCRIPTION
+// A generic creation service named lifecycle service using
+// the GenericFactory interface of the LifeCycle Service specification.
+//
+// = AUTHOR
+// Michael Kircher (mk1@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef TAO_LIFECYCLESERVICE_IDL
+#define TAO_LIFECYCLESERVICE_IDL
+
+#include "CosLifeCycle.idl"
+
+module LifeCycleService
+{
+ interface Life_Cycle_Service : CosLifeCycle::GenericFactory
+ {
+ // = TITLE
+ // Wrapper for the CosLifeCycle GenericFactory
+ //
+ // = inherits:
+ // boolean supports(in Key k);
+ // Object create_object(in Key k, in Criteria the_criteria)
+ // raises (NoFactory, InvalidCriteria, CannotMeetCriteria);
+
+ void register_factory (in string name,
+ in string location,
+ in string description,
+ in Object _object);
+ // provide an method for registering factories with their properties
+ };
+
+ interface Criteria_Evaluator
+ {
+ // = TITLE
+ // Criteria Evaluator
+ //
+ // = DESCRIPTION
+ // Interface description for an evaluator of CosLifeCycle
+ // Criterias. It is mainly a wrapper, which should make
+ // access easier.
+ //
+ // @@ NOTE: The definition should be this. But see note below!
+ // typedef sequence <CosLifeCycle::NameValuePair> SeqNamedValuePair;
+
+ // @@ NOTE: This is just a workaround for a problem seen with
+ // explicit template builds. This file and CosLifeCycle.idl
+ // define a sequence of the same data structure which creates
+ // multiply defined symbols in the above configuration. We need
+ // to fix the IDL compile at some point of time. Till then this
+ // should be okay...
+ typedef CosLifeCycle::Criteria SeqNamedValuePair;
+ typedef CosLifeCycle::Criteria Criteria;
+
+ exception NotAvailable { string reason; };
+ // raised if the questioned configuration is not available
+
+ SeqNamedValuePair getInitialization ();
+ // get the initialization
+
+ string getFilter ();
+ // get a filter string
+
+ SeqNamedValuePair getLogicalLocation ();
+ // get the logical location
+
+ string getPreferences ();
+ // get the preferences, not implemented
+
+ void setCriteria (in Criteria criteria_);
+ // set the Criteria which is searched for keywords
+ };
+};
+
+#endif /* TAO_LIFECYCLESERVICE_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Load_Average_Monitor.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Load_Average_Monitor.cpp
new file mode 100644
index 00000000000..5ea2a76ec77
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Load_Average_Monitor.cpp
@@ -0,0 +1,244 @@
+#include "orbsvcs/LoadBalancing/LB_CPU_Load_Average_Monitor.h"
+#include "tao/ORB_Constants.h"
+#include "ace/OS_NS_time.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/os_include/os_netdb.h"
+#include "ace/os_include/sys/os_pstat.h"
+#include "ace/os_include/sys/os_loadavg.h"
+#if defined(__NetBSD__) || defined (__APPLE__)
+#include <sys/sysctl.h>
+#endif
+
+ACE_RCSID (LoadBalancing,
+ LB_CPU_Load_Average_Monitor,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LB_CPU_Load_Average_Monitor::TAO_LB_CPU_Load_Average_Monitor (
+ const char * location_id,
+ const char * location_kind)
+ : location_ (1)
+{
+ this->location_.length (1);
+
+ if (location_id == 0)
+ {
+ char host[MAXHOSTNAMELEN + 1];
+ if (ACE_OS::hostname (host, sizeof (host)) != 0)
+ {
+ // Couldn't determine hostname. Use the current time
+ // instead.
+ CORBA::ULong t = static_cast<CORBA::ULong> (ACE_OS::time ());
+
+ // A 64 byte buffer is more than enough to contain the
+ // string representation of a 32 bit unsigned integer.
+ char buf[64] = { '\0' };
+ ACE_OS::sprintf (buf, "%u", t);
+
+ this->location_[0].id = CORBA::string_dup (buf);
+ this->location_[0].kind = CORBA::string_dup ("Creation Time");
+ }
+ else
+ {
+ this->location_[0].id = CORBA::string_dup (host);
+ this->location_[0].kind = CORBA::string_dup ("Hostname");
+ }
+ }
+ else
+ {
+ this->location_[0].id = CORBA::string_dup (location_id);
+
+ if (location_kind != 0)
+ this->location_[0].kind = CORBA::string_dup (location_kind);
+ }
+}
+
+TAO_LB_CPU_Load_Average_Monitor::~TAO_LB_CPU_Load_Average_Monitor (void)
+{
+}
+
+CosLoadBalancing::Location *
+TAO_LB_CPU_Load_Average_Monitor::the_location (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosLoadBalancing::Location * location;
+ ACE_NEW_THROW_EX (location,
+ CosLoadBalancing::Location (this->location_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ return location;
+}
+
+CosLoadBalancing::LoadList *
+TAO_LB_CPU_Load_Average_Monitor::loads (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Float load = 0;
+
+ // Obtain the number of processors each time a load is computed.
+ // The idea is to take into account the processor failures that can
+ // occur on platforms that continue running with the remaining
+ // processors.
+ //
+ // @@ Is this a realistic scenario? Perhaps we should just cache
+ // the number of processors and assume that any processor failure
+ // is a catastrophic one.
+
+#if 0
+
+ SYSTEM_INFO sys_info;
+ ::GetSystemInfo (&sys_info);
+
+ ACE_ASSERT (sys_info.dwNumberOfProcessors > 0);
+
+ load = ::GetLoadAvg () / sys_info.dwNumberOfProcessors;
+
+#elif defined (linux) || defined (sun)
+
+ // Only bother getting the load average over the last minute.
+ //
+ // @todo Make this configurable so that the load average over the
+ // last 5 and 15 minutes can be used instead.
+ double loadavg[1];
+
+# if defined (linux) \
+ && ((defined (__GLIBC__) && defined (__GLIBC_MINOR__) \
+ && __GLIBC__ == 2 && __GLIBC_MINOR__ < 2) \
+ || (!defined (_BSD_SOURCE) && !defined (_GNU_SOURCE)))
+
+ // GLibc < 2.2 does not implement getloadavg(). Furthermore,
+ // getloadavg() is only "visible" if _BSD_SOURCE or _GNU_SOURCE is
+ // defined.
+
+ // Obtain the load average directly from the `/proc' filesystem.
+ FILE * s = ::fopen ("/proc/loadavg", "r");
+
+ if (s == 0)
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ errno),
+ CORBA::COMPLETED_NO),
+ 0);
+
+ fscanf (s, "%f", &loadavg[0]);
+
+ (void) fclose (s);
+
+ const int samples = 1;
+
+# else
+
+# if defined (ACE_LACKS_GETLOADAVG)
+
+ const int samples = 0;
+
+# else
+
+ const int samples = ::getloadavg (loadavg, 1);
+
+# endif /* ACE_LACKS_GETLOADAVG */
+
+# endif /* linux
+ && ((__GLIBC__ == 2 && __GLIBC_MINOR__ < 2)
+ || (!_BSD_SOURCE && !_GNU_SOURCE)) */
+
+ if (samples == 1)
+ {
+ const long num_processors = ::sysconf (_SC_NPROCESSORS_ONLN);
+
+ ACE_ASSERT (num_processors > 0);
+
+ if (num_processors > 0)
+ load = loadavg[0] / num_processors;
+ else
+ ACE_THROW_RETURN (CORBA::TRANSIENT (), 0); // Correct exception?
+ }
+ else
+ ACE_THROW_RETURN (CORBA::TRANSIENT (), 0); // Correct exception?
+
+#elif defined (__NetBSD__) || defined (__APPLE__)
+
+ double loadavg[1];
+
+ const int samples = ::getloadavg (loadavg, 1);
+
+ if (samples == 1)
+ {
+ int mib[2], num_processors;
+ size_t len;
+
+ mib[0] = CTL_HW;
+ mib[1] = HW_NCPU;
+ len = sizeof(num_processors);
+
+ sysctl(mib, 2, &num_processors, &len, NULL, 0);
+
+ ACE_ASSERT (num_processors > 0);
+
+ if (num_processors > 0)
+ load = loadavg[0] / num_processors;
+ else
+ ACE_THROW_RETURN (CORBA::TRANSIENT (), 0); // Correct exception?
+ }
+ else
+ ACE_THROW_RETURN (CORBA::TRANSIENT (), 0); // Correct exception?
+
+#elif defined (__hpux)
+
+ struct pst_dynamic psd;
+
+ if (::pstat_getdynamic (&psd, sizeof (psd), (size_t) 1, 0) != -1)
+ {
+ const long & num_processors = psd.psd_proc_cnt;
+
+ ACE_ASSERT (num_processors > 0);
+
+ if (num_processors > 0)
+ load = psd.psd_avg_1_min / num_processors;
+ else
+ ACE_THROW_RETURN (CORBA::TRANSIENT (), 0); // Correct exception?
+ }
+ else
+ ACE_THROW_RETURN (CORBA::TRANSIENT (), 0); // Correct exception?
+
+#endif
+
+#if defined (linux) || defined (sun) || defined (__hpux) || defined(__NetBSD__) || defined (__APPLE__)
+
+ CosLoadBalancing::LoadList * tmp;
+ ACE_NEW_THROW_EX (tmp,
+ CosLoadBalancing::LoadList (1),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ CosLoadBalancing::LoadList_var load_list = tmp;
+
+ load_list->length (1);
+
+ load_list[0].id = CosLoadBalancing::LoadAverage;
+ load_list[0].value = load;
+
+ return load_list._retn ();
+
+#else
+
+ ACE_UNUSED_ARG (load);
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+
+#endif /* linux || sun || __hpux || __NetBSD__ || __APPLE__ */
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Load_Average_Monitor.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Load_Average_Monitor.h
new file mode 100644
index 00000000000..12bb7c1df80
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Load_Average_Monitor.h
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_CPU_Load_Average_Monitor.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_CPU_LOAD_AVERAGE_MONITOR_H
+#define TAO_LB_CPU_LOAD_AVERAGE_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/LoadBalancing/LoadBalancing_export.h"
+
+# if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+# endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosLoadBalancingS.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_LB_CPU_Load_Average_Monitor
+ *
+ * @brief LoadMonitor implementation that monitors the overall CPU
+ * load on a given host.
+ *
+ * Loads returned from this load monitor are the average number of
+ * processes in the "run" queue over a ***FIXME*** seconds averaged
+ * over the number of processors. For example, a load of 2 on a dual
+ * CPU host is returned as an average load of 1 by this CPU load
+ * monitor, a load of 5 on a quad CPU host will be reported as a load
+ * of 1.25 (i.e. 5/4), and so on and so forth.
+ */
+class TAO_LoadBalancing_Export TAO_LB_CPU_Load_Average_Monitor
+ : public virtual POA_CosLoadBalancing::LoadMonitor
+{
+public:
+
+ /// Constructor
+ /**
+ * If no location is supplied the hostname or IP address is used by
+ * default.
+ */
+ TAO_LB_CPU_Load_Average_Monitor (const char * location_id = 0,
+ const char * location_kind = 0);
+
+ /**
+ * @name CosLoadBalancing::LoadMonitor Methods
+ *
+ * Methods required by the CosLoadBalancing::LoadMonitor interface.
+ */
+ //@{
+
+ /// Return the location at which the LoadMonitor resides.
+ /**
+ * The returned "Location" is a sequence of length 1.
+ */
+ virtual CosLoadBalancing::Location * the_location (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the average CPU load at the location which this
+ /// LoadMonitor resides.
+ /**
+ * @return A "Load" sequence of length 1 that contains a LoadId
+ * equal to CosLoadBalancing::LoadAverage, and the average CPU
+ * load.
+ */
+ virtual CosLoadBalancing::LoadList * loads (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ //@}
+
+protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management through
+ * reference counting.
+ */
+ ~TAO_LB_CPU_Load_Average_Monitor (void);
+
+private:
+
+ /// The name of the location at which this LoadMonitor resides.
+ CosLoadBalancing::Location location_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_CPU_LOAD_AVERAGE_MONITOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Utilization_Monitor.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Utilization_Monitor.cpp
new file mode 100644
index 00000000000..48a8267e189
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Utilization_Monitor.cpp
@@ -0,0 +1,170 @@
+#include "orbsvcs/LoadBalancing/LB_CPU_Utilization_Monitor.h"
+#include "tao/ORB_Constants.h"
+#include "ace/OS_NS_time.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/os_include/os_netdb.h"
+#include "ace/os_include/sys/os_loadavg.h"
+
+ACE_RCSID (LoadBalancing,
+ LB_CPU_Utilization_Monitor,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+double calc_cpu_loading (void)
+{
+ static char buf[1024];
+ static unsigned long prev_idle = 0;
+ static double prev_total = 0.0;
+
+ FILE *file_ptr = 0;
+ char *item = 0;
+ char *arg = 0;
+ unsigned long delta_idle = 0;
+ unsigned long user = 0;
+ unsigned long nice = 0;
+ unsigned long idle = 0;
+ unsigned long sys = 0;
+
+ double percent_cpu_load = 0.0;
+
+ if ((file_ptr = fopen("/proc/stat", "r")) == 0)
+ return percent_cpu_load;
+
+ while ((fgets (buf, sizeof (buf), file_ptr)) != 0)
+ {
+ item = ACE_OS::strtok (buf, " \t\n");
+ arg = ACE_OS::strtok (0, "\n");
+
+ if (item == 0 || arg == 0)
+ continue;
+ if (item[0] == 'c' && strlen (item) == 3)
+ {
+ sscanf (arg, "%lu %lu %lu %lu", &user, &nice, &sys, &idle);
+ break;
+ }
+
+
+ }
+
+ fclose (file_ptr);
+
+ delta_idle = idle - prev_idle;
+ double total;
+ double time_passed;
+ total = (double) (user + nice + sys + idle);
+ time_passed = total - prev_total;
+
+ percent_cpu_load = 100.0 - (delta_idle / time_passed * 100.0);
+
+ prev_idle = idle;
+ prev_total = total;
+
+ return percent_cpu_load;
+
+}
+
+
+TAO_LB_CPU_Utilization_Monitor::TAO_LB_CPU_Utilization_Monitor (const char * location_id,
+ const char * location_kind)
+ : location_ (1)
+{
+ this->location_.length (1);
+
+ if (location_id == 0)
+ {
+ char host[MAXHOSTNAMELEN + 1];
+ if (ACE_OS::hostname (host, sizeof (host)) != 0)
+ {
+ // Couldn't determine hostname. Use the current time
+ // instead.
+ CORBA::ULong t = static_cast<CORBA::ULong> (ACE_OS::time ());
+
+ // A 64 byte buffer is more than enough to contain the
+ // string representation of a 32 bit unsigned integer.
+ char buf[64] = { '\0' };
+ ACE_OS::sprintf (buf, "%u", t);
+
+ this->location_[0].id = CORBA::string_dup (buf);
+ this->location_[0].kind = CORBA::string_dup ("Creation Time");
+ }
+ else
+ {
+ this->location_[0].id = CORBA::string_dup (host);
+ this->location_[0].kind = CORBA::string_dup ("Hostname");
+ }
+ }
+ else
+ {
+ this->location_[0].id = CORBA::string_dup (location_id);
+
+ if (location_kind != 0)
+ this->location_[0].kind = CORBA::string_dup (location_kind);
+ }
+}
+
+TAO_LB_CPU_Utilization_Monitor::~TAO_LB_CPU_Utilization_Monitor (void)
+{
+}
+
+CosLoadBalancing::Location *
+TAO_LB_CPU_Utilization_Monitor::the_location (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosLoadBalancing::Location * location;
+ ACE_NEW_THROW_EX (location,
+ CosLoadBalancing::Location (this->location_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ return location;
+}
+
+CosLoadBalancing::LoadList *
+TAO_LB_CPU_Utilization_Monitor::loads (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Float load = 0;
+
+#if defined (linux) || defined (sun)
+
+ double load_double = calc_cpu_loading ();
+ load = load_double;
+
+ CosLoadBalancing::LoadList * tmp;
+ ACE_NEW_THROW_EX (tmp,
+ CosLoadBalancing::LoadList (1),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ CosLoadBalancing::LoadList_var load_list = tmp;
+
+ load_list->length (1);
+
+ load_list[0].id = CosLoadBalancing::LoadAverage;
+ load_list[0].value = load;
+
+ ACE_DEBUG ((LM_DEBUG, "%2f\n", load_list[0].value));
+
+ return load_list._retn ();
+
+#else
+
+ ACE_UNUSED_ARG (load);
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+
+#endif /* linux || sun */
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Utilization_Monitor.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Utilization_Monitor.h
new file mode 100644
index 00000000000..c369ce8e2c0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Utilization_Monitor.h
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_CPU_Utilization_Monitor.h
+ *
+ * $Id$
+ *
+ * @author Jaiganesh Balasubramanian <jai@dre.vanderbilt.edu>
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_CPU_UTILIZATION_MONITOR_H
+#define TAO_LB_CPU_UTILIZATION_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/LoadBalancing/LoadBalancing_export.h"
+
+# if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+# endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosLoadBalancingS.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_LB_CPU_Utilization_Monitor
+ *
+ * @brief LoadMonitor implementation that monitors the overall CPU
+ * load on a given host.
+ *
+ * Loads returned from this load monitor is the utilization of
+ * CPU in the "form" of percentage.
+ */
+class TAO_LoadBalancing_Export TAO_LB_CPU_Utilization_Monitor
+ : public virtual POA_CosLoadBalancing::LoadMonitor
+{
+public:
+
+ /// Constructor
+ /**
+ * If no location is supplied the hostname or IP address is used by
+ * default.
+ */
+ TAO_LB_CPU_Utilization_Monitor (const char * location_id = 0,
+ const char * location_kind = 0);
+
+ /**
+ * @name CosLoadBalancing::LoadMonitor Methods
+ *
+ * Methods required by the CosLoadBalancing::LoadMonitor interface.
+ */
+ //@{
+
+ /// Return the location at which the LoadMonitor resides.
+ /**
+ * The returned "Location" is a sequence of length 1.
+ */
+ virtual CosLoadBalancing::Location * the_location (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the average CPU load at the location which this
+ /// LoadMonitor resides.
+ /**
+ * @return A "Load" sequence of length 1 that contains a LoadId
+ * equal to CosLoadBalancing::LoadAverage, and the average CPU
+ * load.
+ */
+ virtual CosLoadBalancing::LoadList * loads (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ //@}
+
+protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management through
+ * reference counting.
+ */
+ ~TAO_LB_CPU_Utilization_Monitor (void);
+
+private:
+
+ /// The name of the location at which this LoadMonitor resides.
+ CosLoadBalancing::Location location_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_CPU_UTILIZATION_MONITOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientComponent.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientComponent.cpp
new file mode 100644
index 00000000000..abfe60c3f23
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientComponent.cpp
@@ -0,0 +1,70 @@
+#include "orbsvcs/LoadBalancing/LB_ClientComponent.h"
+#include "orbsvcs/LoadBalancing/LB_ClientORBInitializer.h"
+
+#include "tao/ORB_Constants.h"
+#include "tao/ORBInitializer_Registry.h"
+
+ACE_RCSID (LoadBalancing,
+ LB_ClientComponent,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int
+TAO_LB_ClientComponent::init (int /* argc */, ACE_TCHAR * /* argv */[])
+{
+ return this->register_orb_initializer ();
+}
+
+int
+TAO_LB_ClientComponent::fini (void)
+{
+ return 0;
+}
+
+int
+TAO_LB_ClientComponent::register_orb_initializer (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Register the LB_ClientComponent ORB initializer.
+ PortableInterceptor::ORBInitializer_ptr tmp;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_LB_ClientORBInitializer,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_TRY_CHECK;
+
+ PortableInterceptor::ORBInitializer_var initializer = tmp;
+
+ PortableInterceptor::register_orb_initializer (initializer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Unable to register LB_ClientComponent ORB "
+ "initializer.");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DEFINE (TAO_LB_ClientComponent,
+ ACE_TEXT ("LB_ClientComponent"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_LB_ClientComponent),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+ACE_FACTORY_DEFINE (TAO_LoadBalancing, TAO_LB_ClientComponent)
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientComponent.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientComponent.h
new file mode 100644
index 00000000000..8431950aff4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientComponent.h
@@ -0,0 +1,68 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_ClientComponent.h
+ *
+ * $Id$
+
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_LB_CLIENTCOMPONENT_H
+#define TAO_LB_CLIENTCOMPONENT_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/LoadBalancing/LoadBalancing_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/LB_ORTC.h"
+
+#include "ace/Service_Object.h"
+#include "ace/Service_Config.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_LB_ClientComponent
+ *
+ * @brief Service_Object that can be used to add load balancer support
+ * to a CORBA-based client.
+ *
+ * CORBA applications wishing to transparently add load shedding support
+ * can load this object via the ACE_Service_Configurator (e.g. by
+ * listing it in a `svc.conf' file).
+ */
+class TAO_LoadBalancing_Export TAO_LB_ClientComponent
+ : public ACE_Service_Object
+{
+public:
+
+ /// Initializes object when dynamic linking occurs.
+ virtual int init (int argc, ACE_TCHAR *argv[]);
+
+ /// Terminates object when dynamic unlinking occurs.
+ virtual int fini (void);
+
+protected:
+
+ /// Register the LB_ClientComponent's ORBInitializer.
+ int register_orb_initializer (void);
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE_EXPORT (TAO_LoadBalancing, TAO_LB_ClientComponent)
+ACE_STATIC_SVC_REQUIRE (TAO_LB_ClientComponent)
+ACE_FACTORY_DECLARE (TAO_LoadBalancing, TAO_LB_ClientComponent)
+
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_CLIENTCOMPONENT_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientORBInitializer.cpp
new file mode 100644
index 00000000000..10ef40d2a54
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientORBInitializer.cpp
@@ -0,0 +1,43 @@
+#include "orbsvcs/LoadBalancing/LB_ClientORBInitializer.h"
+#include "orbsvcs/LoadBalancing/LB_ClientRequestInterceptor.h"
+
+#include "tao/ORB_Constants.h"
+
+ACE_RCSID (LoadBalancing,
+ LB_ClientORBInitializer,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void
+TAO_LB_ClientORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_LB_ClientORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableInterceptor::ClientRequestInterceptor_ptr tmp;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_LB_ClientRequestInterceptor,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableInterceptor::ClientRequestInterceptor_var client_interceptor = tmp;
+
+ info->add_client_request_interceptor (client_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientORBInitializer.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientORBInitializer.h
new file mode 100644
index 00000000000..595c7198ea0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientORBInitializer.h
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_ClientORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_CLIENT_ORB_INITIALIZER_H
+#define TAO_LB_CLIENT_ORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/PI/PI.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_LB_ORBInitializer
+ *
+ * @brief ORBInitializer for the LB_ClientComponent Service_Object.
+ *
+ * This ORBInitializer simply creates and registers with the ORB the
+ * ClientRequestInterceptor that handles injection of the
+ * CosLoadBalancing::LOAD_MANAGED ServiceContext into each request's
+ * ServiceContextList.
+ */
+class TAO_LB_ClientORBInitializer
+ : public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /**
+ * @name PortableInterceptor::ORBInitializer Methods
+ *
+ * Methods required by the PortableInterceptor::ORBInitializer
+ * interface.
+ */
+ //@{
+ 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));
+ //@}
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_CLIENT_ORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientRequestInterceptor.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientRequestInterceptor.cpp
new file mode 100644
index 00000000000..870a88577d2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientRequestInterceptor.cpp
@@ -0,0 +1,114 @@
+#include "orbsvcs/LoadBalancing/LB_ClientRequestInterceptor.h"
+
+#include "orbsvcs/CosLoadBalancingC.h"
+
+
+ACE_RCSID (LoadBalancing,
+ TAO_LB_ClientRequestInterceptor,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+char *
+TAO_LB_ClientRequestInterceptor::name (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("TAO_LB_ClientRequestInterceptor");
+}
+
+void
+TAO_LB_ClientRequestInterceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_LB_ClientRequestInterceptor::send_request (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ /*
+ CORBA::Object_var t = ri->target (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ */
+
+ // A ServiceContext with an empty payload (i.e. zero length
+ // context_data) will be embedded into the request.
+ IOP::ServiceContext service_context;
+ service_context.context_id = CosLoadBalancing::LOAD_MANAGED;
+
+
+ /*
+ // A CDR encapsulation IOP::Codec could be used here, but it uses
+ // interpreted marshaling, which is slower than the compiled
+ // marshaling used below.
+
+ TAO_OutputCDR cdr;
+ cdr << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER);
+
+ // Marshal the target object, i.e. the object reference that points
+ // back to the object group into the ServiceContextList.
+ cdr << t.in ();
+
+ // TAO extension, replace the contents of the octet sequence with
+ // the CDR stream.
+ const CORBA::ULong tl = cdr.total_length ();
+ service_context.context_data.length (tl);
+ CORBA::Octet * buf = service_context.context_data.get_buffer ();
+ for (const ACE_Message_Block * i = cdr.begin ();
+ i != 0;
+ i = i->cont ())
+ {
+ const size_t len = i->length ();
+
+ // @todo It would be nice to avoid this copy.
+ ACE_OS::memcpy (buf, i->rd_ptr (), len);
+ buf += len;
+ }
+ */
+
+ const CORBA::Boolean replace = 0;
+ ri->add_request_service_context (service_context,
+ replace
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LB_ClientRequestInterceptor::send_poll (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_LB_ClientRequestInterceptor::receive_reply (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_LB_ClientRequestInterceptor::receive_exception (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+TAO_LB_ClientRequestInterceptor::receive_other (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientRequestInterceptor.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientRequestInterceptor.h
new file mode 100644
index 00000000000..124a845a989
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ClientRequestInterceptor.h
@@ -0,0 +1,114 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_ClientRequestInterceptor.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_CLIENT_REQUEST_INTERCEPTOR_H
+#define TAO_LB_CLIENT_REQUEST_INTERCEPTOR_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PI/PI.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_LB_ClientRequestInterceptor
+ *
+ * @brief Load balancer client request interceptor that injects an
+ * IOP::ServiceContext into a request's
+ * IOP::ServiceContextList.
+ *
+ * Load shedding requires that a specific ServiceContext exists
+ * in the request's ServiceContextList. The server side will attempt
+ * to detect if that ServiceContext exists, and shed load if it does.
+ *
+ * @note This model introduces a Denial-of-Service vulnerability.
+ * Malicious or incorrectly configured clients can spoof the
+ * server into thinking that it is invoking requests on a
+ * non-load balanced object. At that point, the server will let
+ * the request through, completely bypassing the load shedding
+ * mechanism! A server side-only mechanism can correct this
+ * vulnerability, but at the potential cost of additional
+ * resource overhead.
+ */
+class TAO_LB_ClientRequestInterceptor
+ : public virtual PortableInterceptor::ClientRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /**
+ * @name Methods Required by the Client 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 client request interceptors.
+ */
+ //@{
+ /// Return the name of this ClientRequestInterceptor.
+ 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 send_request (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_poll (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_reply (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_exception (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_other (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+ //@}
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_LB_CLIENT_REQUEST_INTERCEPTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Component.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Component.cpp
new file mode 100644
index 00000000000..3e6d76a10aa
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Component.cpp
@@ -0,0 +1,146 @@
+#include "orbsvcs/LoadBalancing/LB_Component.h"
+#include "orbsvcs/LoadBalancing/LB_ORBInitializer.h"
+
+#include "tao/ORB_Constants.h"
+#include "tao/ORBInitializer_Registry.h"
+#include "ace/OS_NS_strings.h"
+
+ACE_RCSID (LoadBalancing,
+ LB_Component,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int
+TAO_LB_Component::init (int argc, ACE_TCHAR * argv[])
+{
+ // There must be at least six arguments.
+ if (argc < 6)
+ return -1;
+
+ // Try to optimize sequence growth by growing it once.
+ const CORBA::ULong initial_len = argc / 6; // -LBGroup group
+ // -LBTypeId type_id
+ // -LBLocation location
+
+ CORBA::StringSeq object_groups (initial_len);
+ object_groups.length (initial_len);
+
+ CORBA::StringSeq repository_ids (initial_len);
+ repository_ids.length (initial_len);
+
+ CORBA::String_var location;
+
+ CORBA::ULong len = 0;
+
+ for (int i = 0; i < argc; ++i)
+ {
+ if (ACE_OS::strcasecmp (argv[i], "-LBGroup") == 0)
+ {
+ const CORBA::ULong j = len;
+ ++len;
+
+ ++i; // 1
+
+ object_groups.length (len);
+ object_groups[j] = CORBA::string_dup (argv[i]);
+
+ ++i; // 2
+
+ if (ACE_OS::strcasecmp (argv[i], "-LBTypeId") != 0)
+ return -1;
+
+ ++i; // 3
+
+ repository_ids.length (len);
+ repository_ids[j] = CORBA::string_dup (argv[i]);
+ }
+ else if (ACE_OS::strcasecmp (argv[i], "-LBTypeId") == 0)
+ {
+ const CORBA::ULong j = len;
+ ++len;
+
+ ++i; // 1
+
+ repository_ids.length (len);
+ repository_ids[j] = CORBA::string_dup (argv[i]);
+
+ ++i; // 2
+
+ if (ACE_OS::strcasecmp (argv[i], "-LBGroup") != 0)
+ return -1;
+
+ ++i; // 3
+
+ object_groups.length (len);
+ object_groups[j] = CORBA::string_dup (argv[i]);
+ }
+ else if (ACE_OS::strcasecmp (argv[i], "-LBLocation") == 0)
+ {
+ ++i;
+ location = CORBA::string_dup (argv[i]);
+ }
+ }
+
+ return this->register_orb_initializer (object_groups,
+ repository_ids,
+ location.in ());
+}
+
+int
+TAO_LB_Component::fini (void)
+{
+ return 0;
+}
+
+int
+TAO_LB_Component::register_orb_initializer (
+ const CORBA::StringSeq & object_groups,
+ const CORBA::StringSeq & repository_ids,
+ const char * location)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Register the LB_Component ORB initializer.
+ PortableInterceptor::ORBInitializer_ptr tmp;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_LB_ORBInitializer (object_groups,
+ repository_ids,
+ location),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_TRY_CHECK;
+
+ PortableInterceptor::ORBInitializer_var initializer = tmp;
+
+ PortableInterceptor::register_orb_initializer (initializer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Unable to register LB_Component ORB "
+ "initializer.");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DEFINE (TAO_LB_Component,
+ ACE_TEXT ("LB_Component"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_LB_Component),
+ ACE_Service_Type::DELETE_THIS
+ | ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+ACE_FACTORY_DEFINE (TAO_LoadBalancing, TAO_LB_Component)
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Component.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Component.h
new file mode 100644
index 00000000000..26273daab93
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Component.h
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_Component.h
+ *
+ * $Id$
+
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_LB_COMPONENT_H
+#define TAO_LB_COMPONENT_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/LoadBalancing/LoadBalancing_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/LB_ORTC.h"
+
+#include "ace/Service_Object.h"
+#include "ace/Service_Config.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_LB_Component
+ *
+ * @brief Service_Object that can be used to add load balancer support
+ * to a CORBA-based server.
+ *
+ * Servers wishing to transparently add load balancing/management
+ * support load this object via the ACE_Service_Configurator (e.g. by
+ * listing it in a `svc.conf' file).
+ */
+class TAO_LoadBalancing_Export TAO_LB_Component
+ : public ACE_Service_Object
+{
+public:
+
+ /// Initializes object when dynamic linking occurs.
+ virtual int init (int argc, ACE_TCHAR *argv[]);
+
+ /// Terminates object when dynamic unlinking occurs.
+ virtual int fini (void);
+
+protected:
+
+ /// Register the LB_Component's ORBInitializer.
+ int register_orb_initializer (const CORBA::StringSeq & object_groups,
+ const CORBA::StringSeq & repository_ids,
+ const char * location);
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE_EXPORT (TAO_LoadBalancing, TAO_LB_Component)
+ACE_STATIC_SVC_REQUIRE (TAO_LB_Component)
+ACE_FACTORY_DECLARE (TAO_LoadBalancing, TAO_LB_Component)
+
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_COMPONENT_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_IORInterceptor.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_IORInterceptor.cpp
new file mode 100644
index 00000000000..3f555d17a5c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_IORInterceptor.cpp
@@ -0,0 +1,189 @@
+#include "orbsvcs/LoadBalancing/LB_IORInterceptor.h"
+#include "orbsvcs/LoadBalancing/LB_ObjectReferenceFactory.h"
+#include "orbsvcs/LoadBalancing/LB_LoadAlert.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+
+ACE_RCSID (LoadBalancing,
+ LB_IORInterceptor,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LB_IORInterceptor::TAO_LB_IORInterceptor (
+ const CORBA::StringSeq & object_groups,
+ const CORBA::StringSeq & repository_ids,
+ const char * location,
+ CosLoadBalancing::LoadManager_ptr lm,
+ const char * orb_id,
+ TAO_LB_LoadAlert & load_alert)
+ : object_groups_ (object_groups),
+ repository_ids_ (repository_ids),
+ location_ (location),
+ lm_ (CosLoadBalancing::LoadManager::_duplicate (lm)),
+ orb_id_ (CORBA::string_dup (orb_id)),
+ load_alert_ (load_alert),
+ la_ref_ (),
+ lock_ ()
+{
+}
+
+char *
+TAO_LB_IORInterceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("TAO_LB_IORInterceptor");
+}
+
+void
+TAO_LB_IORInterceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Force the LoadManager reference to be released since the ORB's
+ // lifetime is tied to object reference lifetimes.
+ (void) this->lm_.out ();
+}
+
+void
+TAO_LB_IORInterceptor::establish_components (
+ PortableInterceptor::IORInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_LB_IORInterceptor::components_established (
+ PortableInterceptor::IORInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ int argc = 0;
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ 0,
+ this->orb_id_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Save a copy of the current ObjectReferenceFactory.
+ PortableInterceptor::ObjectReferenceFactory_var old_orf =
+ info->current_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableInterceptor::ObjectReferenceFactory * tmp;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_LB_ObjectReferenceFactory (old_orf.in (),
+ this->object_groups_,
+ this->repository_ids_,
+ this->location_.in (),
+ orb.in (),
+ this->lm_.in ()),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableInterceptor::ObjectReferenceFactory_var orf = tmp;
+
+ info->current_factory (orf.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LB_IORInterceptor::adapter_manager_state_changed (
+ const char *,
+ PortableInterceptor::AdapterState state
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (state == PortableInterceptor::ACTIVE)
+ {
+ this->register_load_alert (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_LB_IORInterceptor::adapter_state_changed (
+ const PortableInterceptor::ObjectReferenceTemplateSeq &,
+ PortableInterceptor::AdapterState state
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (state == PortableInterceptor::ACTIVE)
+ {
+ this->register_load_alert (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_LB_IORInterceptor::register_load_alert (ACE_ENV_SINGLE_ARG_DECL)
+{
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_);
+
+ if (!CORBA::is_nil (this->la_ref_.in ()))
+ return;
+ }
+
+ ACE_TRY_EX (foo)
+ {
+ // By now, the RootPOA has been fully initialized, so it is safe
+ // to activate the LoadAlert object.
+ CosLoadBalancing::LoadAlert_var la =
+ this->load_alert_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (foo);
+
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_);
+
+ this->la_ref_ = la;
+ }
+
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "LoadAlert::_this()");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ ACE_TRY
+ {
+ PortableGroup::Location location (1);
+ location.length (1);
+ location[0].id = CORBA::string_dup (this->location_.in ());
+
+ this->lm_->register_load_alert (location,
+ this->la_ref_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosLoadBalancing::LoadAlertAlreadyPresent, ex)
+ {
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ex,
+ "LoadManager::register_load_alert");
+
+ ACE_TRY_THROW (CORBA::BAD_INV_ORDER ());
+ }
+ ACE_CATCH (CosLoadBalancing::LoadAlertNotAdded, ex)
+ {
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ex,
+ "LoadManager::register_load_alert");
+
+ ACE_TRY_THROW (CORBA::INTERNAL ());
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_IORInterceptor.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_IORInterceptor.h
new file mode 100644
index 00000000000..6b93c951912
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_IORInterceptor.h
@@ -0,0 +1,152 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_IORInterceptor.h
+ *
+ * $Id$
+
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_LB_IOR_INTERCEPTOR_H
+#define TAO_LB_IOR_INTERCEPTOR_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosLoadBalancingC.h"
+#include "tao/LocalObject.h"
+#include "tao/IORInterceptor/IORInterceptor.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Forward declarations.
+class TAO_LB_LoadAlert;
+
+
+/**
+ * @class TAO_LB_IORInterceptor
+ *
+ * @brief TAO Load Balancer IOR interceptor.
+ *
+ * This IORInterceptor is registered in object group member ORBs.
+ * During creation of the object group member reference, this
+ * IORInterceptor will change the "current_factory" attribute of the
+ * PortableInterceptor::IORInfo object to the Load Balancer's
+ * ObjectReferenceFactory.
+ *
+ * @see LB_ObjectReferenceFactory.h for details.
+ */
+class TAO_LB_IORInterceptor
+ : public virtual PortableInterceptor::IORInterceptor_3_0,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ TAO_LB_IORInterceptor (const CORBA::StringSeq & object_groups,
+ const CORBA::StringSeq & repository_ids,
+ const char * location,
+ CosLoadBalancing::LoadManager_ptr lm,
+ const char * orb_id,
+ TAO_LB_LoadAlert & load_alert);
+
+ /**
+ * @name Methods Required by the IOR 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 IOR interceptors.
+ */
+ //@{
+ /// Return the name of this IORInterceptor.
+ virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Cleanup resources acquired by this IORInterceptor.
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Add the tagged components to the IOR.
+ virtual void establish_components (
+ PortableInterceptor::IORInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void components_established (
+ PortableInterceptor::IORInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void adapter_manager_state_changed (
+ const char * id,
+ PortableInterceptor::AdapterState state
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void adapter_state_changed (
+ const PortableInterceptor::ObjectReferenceTemplateSeq & templates,
+ PortableInterceptor::AdapterState state
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ //@}
+
+private:
+
+ /// Create and register the LoadAlert object with the LoadManager.
+ void register_load_alert (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+
+ /// List of stringified object group references.
+ const CORBA::StringSeq object_groups_;
+
+ /// List of RepositoryIds for object that will be load
+ /// managed/balanced.
+ const CORBA::StringSeq repository_ids_;
+
+ /// Location at which the LoadBalancing component resides.
+ CORBA::String_var location_;
+
+ /// Reference to the LoadManager.
+ CosLoadBalancing::LoadManager_var lm_;
+
+ /// ORBid of the ORB this IORInterceptor is registered with.
+ CORBA::String_var orb_id_;
+
+ /// Reference to the LoadAlert servant.
+ TAO_LB_LoadAlert & load_alert_;
+
+ /// Reference to the LoadAlert object.
+ CosLoadBalancing::LoadAlert_var la_ref_;
+
+ /// Synchronize access to the class state.
+ TAO_SYNCH_MUTEX lock_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_LB_IOR_INTERCEPTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp
new file mode 100644
index 00000000000..00c4fa6203d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp
@@ -0,0 +1,641 @@
+#include "orbsvcs/LoadBalancing/LB_LeastLoaded.h"
+#include "orbsvcs/LoadBalancing/LB_LoadMap.h"
+#include "orbsvcs/LoadBalancing/LB_Random.h"
+
+#include "orbsvcs/PortableGroup/PG_conf.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+
+#include "ace/Null_Mutex.h"
+#include "ace/OS_NS_string.h"
+
+
+ACE_RCSID (LoadBalancing,
+ LB_LeastLoaded,
+ "$Id$")
+
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/LoadBalancing/LB_LeastLoaded.inl"
+#endif /* defined INLINE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LB_LeastLoaded::TAO_LB_LeastLoaded (PortableServer::POA_ptr poa)
+ : poa_ (PortableServer::POA::_duplicate (poa)),
+ load_map_ (0),
+ lock_ (0),
+ properties_ (),
+ critical_threshold_ (TAO_LB::LL_DEFAULT_CRITICAL_THRESHOLD),
+ reject_threshold_ (TAO_LB::LL_DEFAULT_REJECT_THRESHOLD),
+ tolerance_ (TAO_LB::LL_DEFAULT_TOLERANCE),
+ dampening_ (TAO_LB::LL_DEFAULT_DAMPENING),
+ per_balance_load_ (TAO_LB::LL_DEFAULT_DAMPENING)
+{
+ // A load map that retains previous load values at a given location
+ // and lock are only needed if dampening is enabled, i.e. non-zero.
+ if (this->dampening_ != 0)
+ {
+ ACE_NEW (this->load_map_, TAO_LB_LoadMap (TAO_PG_MAX_LOCATIONS));
+
+ ACE_NEW (this->lock_, TAO_SYNCH_MUTEX);
+ }
+
+ // Initialize the random load balancing strategy.
+ TAO_LB_Random::init ();
+}
+
+TAO_LB_LeastLoaded::~TAO_LB_LeastLoaded (void)
+{
+ delete this->load_map_;
+ delete this->lock_;
+}
+
+char *
+TAO_LB_LeastLoaded::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("LeastLoaded");
+}
+
+CosLoadBalancing::Properties *
+TAO_LB_LeastLoaded::get_properties (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosLoadBalancing::Properties * props = 0;
+ ACE_NEW_THROW_EX (props,
+ CosLoadBalancing::Properties (this->properties_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ return props;
+}
+
+void
+TAO_LB_LeastLoaded::push_loads (
+ const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Only the first load is used by this load balancing strategy.
+ if (loads.length () == 0)
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ CosLoadBalancing::Load load; // Unused
+
+ this->push_loads (the_location,
+ loads,
+ load
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_LB_LeastLoaded::push_loads (
+ const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads,
+ CosLoadBalancing::Load & load
+ ACE_ENV_ARG_DECL)
+{
+ if (loads.length () == 0)
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ // Only the first load is used by this load balancing strategy.
+ const CosLoadBalancing::Load & new_load = loads[0];
+
+ if (this->load_map_ != 0)
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, *this->lock_);
+
+ TAO_LB_LoadMap::ENTRY * entry;
+ if (this->load_map_->find (the_location, entry) == 0)
+ {
+ CosLoadBalancing::Load & previous_load = entry->int_id_;
+
+ if (previous_load.id != new_load.id)
+ ACE_THROW (CORBA::BAD_PARAM ()); // Somebody switched
+ // LoadIds on us!
+
+ previous_load.value =
+ this->effective_load (previous_load.value, new_load.value);
+
+ load = previous_load;
+ }
+ else
+ {
+ const CosLoadBalancing::Load eff_load =
+ {
+ new_load.id,
+ this->effective_load (0, new_load.value)
+ };
+
+ if (this->load_map_->bind (the_location, eff_load) != 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: TAO_LB_LeastLoaded - "
+ "Unable to push loads\n"));
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ load = eff_load;
+ }
+ }
+ else
+ {
+ load.id = new_load.id;
+ load.value = this->effective_load (0, new_load.value);
+ }
+}
+
+CosLoadBalancing::LoadList *
+TAO_LB_LeastLoaded::get_loads (CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound))
+{
+ if (CORBA::is_nil (load_manager))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);
+
+ CosLoadBalancing::LoadList_var loads =
+ load_manager->get_loads (the_location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->push_loads (the_location,
+ loads.in (),
+ loads[0]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return loads._retn ();
+}
+
+
+CORBA::Object_ptr
+TAO_LB_LeastLoaded::next_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound))
+{
+ if (CORBA::is_nil (load_manager))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ CORBA::Object::_nil ());
+
+ PortableGroup::Locations_var locations =
+ load_manager->locations_of_members (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ if (locations->length () == 0)
+ ACE_THROW_RETURN (CORBA::TRANSIENT (),
+ CORBA::Object::_nil ());
+
+ // @@ RACE CONDITION. OBJECT GROUP MEMBERSHIP MAY CHANGE AFTER
+ // RETRIEVING LOCATIONS! HOW DO WE HANDLE THAT?
+
+ PortableGroup::Location location;
+ CORBA::Boolean found_location =
+ this->get_location (load_manager,
+ locations.in (),
+ location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ if (found_location)
+ {
+// ACE_DEBUG ((LM_DEBUG,
+// "RETURNING REFERENCE FOR LOCATION \"%s\"\n",
+// location[0].id.in ()));
+
+ return load_manager->get_member_ref (object_group,
+ location
+ ACE_ENV_ARG_PARAMETER);
+ }
+ else
+ {
+ // No loads have been reported for any of the locations the
+ // object group members reside at. If no loads have been
+ // reported to the LoadManager, adaptive load balancing
+ // decisions cannot be made. Fall back on a non-adaptive
+ // strategy, such as the Random load balancing strategy,
+ // instead.
+ //
+ // @note The Random load balancing strategy is used since it is
+ // very lightweight and stateless.
+
+ return TAO_LB_Random::_tao_next_member (object_group,
+ load_manager,
+ locations.in ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+void
+TAO_LB_LeastLoaded::analyze_loads (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (CORBA::is_nil (load_manager))
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ PortableGroup::Locations_var locations =
+ load_manager->locations_of_members (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (locations->length () == 0)
+ ACE_THROW (CORBA::TRANSIENT ());
+
+ const CORBA::ULong len = locations->length ();
+
+ // Iterate through the entire location list to determine which
+ // locations require load to be shed.
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ ACE_TRY
+ {
+ const PortableGroup::Location & loc = locations[i];
+
+ // Retrieve the load list for the location from the
+ // LoadManager and push it to this Strategy's load
+ // processor.
+ CosLoadBalancing::LoadList_var current_loads =
+ load_manager->get_loads (loc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosLoadBalancing::Load load;
+ this->push_loads (loc,
+ current_loads.in (),
+ load
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+/*
+ ACE_DEBUG ((LM_DEBUG,
+ "EFFECTIVE_LOAD == %f\n"
+ "CRITICAL == %f\n"
+ "REJECT == %f\n"
+ "DAMPENING == %f\n",
+ load.value,
+ this->critical_threshold_,
+ this->reject_threshold_,
+ this->dampening_));
+*/
+ // Perform load rebalancing only if the critical threshold
+ // was set.
+ if (this->critical_threshold_ != 0)
+ {
+ if (load.value > this->critical_threshold_)
+ {
+/*
+ ACE_DEBUG ((LM_DEBUG,
+ "%P --- ALERTING LOCATION %u\n",
+ i));
+*/
+
+ // The location is overloaded. Perform load
+ // shedding by informing the LoadAlert object
+ // associated with the member at that location it
+ // should redirect client requests back to the
+ // LoadManager.
+ load_manager->enable_alert (loc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ // The location is not overloaded. Disable load
+ // shedding at given location.
+ load_manager->disable_alert (loc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCH (CosLoadBalancing::LocationNotFound, ex)
+ {
+ // No load available for the requested location. Try the
+ // next location.
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+}
+
+PortableServer::POA_ptr
+TAO_LB_LeastLoaded::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
+
+CORBA::Boolean
+TAO_LB_LeastLoaded::get_location (
+ CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Locations & locations,
+ PortableGroup::Location & location
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Float min_load = FLT_MAX; // Start out with the largest
+ // positive value.
+
+ CORBA::ULong location_index = 0;
+ CORBA::Boolean found_location = 0;
+ CORBA::Boolean found_load = 0;
+
+ const CORBA::ULong len = locations.length ();
+
+ // Iterate through the entire location list to find the least loaded
+ // of them.
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ ACE_TRY
+ {
+ const PortableGroup::Location & loc = locations[i];
+
+ // Retrieve the load list for the location from the LoadManager
+ // and push it to this Strategy's load processor.
+ CosLoadBalancing::LoadList_var current_loads =
+ load_manager->get_loads (loc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ found_load = 1;
+
+ CosLoadBalancing::Load load;
+ this->push_loads (loc,
+ current_loads.in (),
+ load
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+/*
+ ACE_DEBUG ((LM_DEBUG,
+ "LOC = %u"
+ "\tC = %d"
+ "\treject = %f"
+ "\tload = %f\n"
+ "\tmin_load = %f\n",
+ i,
+ (this->reject_threshold_ == 0
+ || load.value < this->reject_threshold_),
+ this->reject_threshold_,
+ load.value,
+ min_load));
+*/
+ if ((this->reject_threshold_ == 0
+ || load.value < this->reject_threshold_)
+ && load.value < min_load)
+ {
+// ACE_DEBUG ((LM_DEBUG,
+// "**** LOAD == %f\n",
+// load.value));
+
+ if (i > 0 && load.value != 0)
+ {
+ /*
+ percent difference =
+ (min_load - load.value) / load.value
+ == (min_load / load.value) - 1
+
+ The latter form is used to avoid a potential
+ arithmetic overflow problem, such as when
+ (min_load - load.value) > FLT_MAX, assuming that
+ either load.value is negative and min_load is
+ positive, or vice versa.
+ */
+ const CORBA::Float percent_diff =
+ (min_load / load.value) - 1;
+
+ /*
+ A "thundering herd" phenomenon may occur when
+ location loads are basically the same (e.g. only
+ differ by a very small amount), where one object
+ group member ends up receiving the majority of
+ requests from different clients. In order to
+ prevent a single object group member from
+ receiving such request bursts, one of two equally
+ loaded locations is chosen at random. Thanks to
+ Carlos, Marina and Jody at ATD for coming up with
+ this solution to this form of the thundering herd
+ problem.
+
+ See the documentation for
+ TAO_LB::LL_DEFAULT_LOAD_PERCENT_DIFF_CUTOFF in
+ LB_LeastLoaded.h for additional information.
+ */
+ if (percent_diff <= TAO_LB::LL_DEFAULT_LOAD_PERCENT_DIFF_CUTOFF)
+ {
+ // Prevent integer arithmetic overflow.
+ const CORBA::Float NUM_MEMBERS = 2;
+
+ // n == 0: Use previously selected location.
+ // n == 1: Use current location.
+ const CORBA::ULong n =
+ static_cast<CORBA::ULong> (NUM_MEMBERS * ACE_OS::rand ()
+ / (RAND_MAX + 1.0));
+
+ ACE_ASSERT (n == 0 || n == 1);
+
+ if (n == 1)
+ {
+ min_load = load.value;
+ location_index = i;
+ found_location = 1;
+
+// ACE_DEBUG ((LM_DEBUG,
+// "** NEW MIN_LOAD == %f\n",
+// min_load));
+ }
+
+// if (n == 0)
+// ACE_DEBUG ((LM_DEBUG, "^^^^^ PREVIOUS LOCATION\n"));
+// else
+// ACE_DEBUG ((LM_DEBUG, "^^^^^ CURRENT LOCATION\n"));
+
+ }
+ else
+ {
+ min_load = load.value;
+ location_index = i;
+ found_location = 1;
+
+// ACE_DEBUG ((LM_DEBUG,
+// "***** NEW MIN_LOAD == %f\n",
+// min_load));
+ }
+ }
+ else
+ {
+ min_load = load.value;
+ location_index = i;
+ found_location = 1;
+
+// ACE_DEBUG ((LM_DEBUG,
+// "NEW MIN_LOAD == %f\n",
+// min_load));
+ }
+ }
+
+ // ACE_DEBUG ((LM_DEBUG, "NEW MIN_LOAD == %f\n", min_load));
+ }
+ ACE_CATCH (CosLoadBalancing::LocationNotFound, ex)
+ {
+ // No load available for the requested location. Try the
+ // next location.
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ }
+
+// ACE_DEBUG ((LM_DEBUG,
+// "FOUND_LOAD == %u\n"
+// "FOUND_LOCATION == %u\n",
+// found_load,
+// found_location));
+
+ // If no loads were found, return without an exception to allow this
+ // strategy to select a member using an alternative method
+ // (e.g. random selection).
+ if (found_load)
+ {
+ if (found_location)
+ {
+ //ACE_DEBUG ((LM_DEBUG, "LOCATED = %u\n", location_index));
+ location = locations[location_index];
+ }
+ else if (this->reject_threshold_ != 0)
+ ACE_THROW_RETURN (CORBA::TRANSIENT (), 0);
+
+// ACE_DEBUG ((LM_DEBUG, "LOCATION ID == %s\n", location[0].id.in ()));
+ }
+
+ return found_location;
+}
+
+void
+TAO_LB_LeastLoaded::init (const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Float critical_threshold =
+ TAO_LB::LL_DEFAULT_CRITICAL_THRESHOLD;
+ CORBA::Float reject_threshold = TAO_LB::LL_DEFAULT_REJECT_THRESHOLD;
+ CORBA::Float tolerance = TAO_LB::LL_DEFAULT_TOLERANCE;
+ CORBA::Float dampening = TAO_LB::LL_DEFAULT_DAMPENING;
+ CORBA::Float per_balance_load = TAO_LB::LL_DEFAULT_PER_BALANCE_LOAD;
+
+ const PortableGroup::Property * ct = 0; // critical threshold property
+
+ const CORBA::ULong len = props.length ();
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ const PortableGroup::Property & property = props[i];
+ if (ACE_OS::strcmp (property.nam[0].id.in (),
+ "org.omg.CosLoadBalancing.Strategy.LeastLoaded.CriticalThreshold") == 0)
+ {
+ this->extract_float_property (property,
+ critical_threshold
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ct = &property;
+ }
+
+ else if (ACE_OS::strcmp (property.nam[0].id.in (),
+ "org.omg.CosLoadBalancing.Strategy.LeastLoaded.RejectThreshold") == 0)
+ {
+ this->extract_float_property (property,
+ reject_threshold
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ else if (ACE_OS::strcmp (property.nam[0].id.in (),
+ "org.omg.CosLoadBalancing.Strategy.LeastLoaded.Tolerance") == 0)
+ {
+ this->extract_float_property (property,
+ tolerance
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Valid tolerance values are greater than or equal to one.
+ if (tolerance < 1)
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+
+ else if (ACE_OS::strcmp (property.nam[0].id.in (),
+ "org.omg.CosLoadBalancing.Strategy.LeastLoaded.Dampening") == 0)
+ {
+ this->extract_float_property (property,
+ dampening
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Dampening range is [0,1).
+ if (dampening < 0 || dampening >= 1)
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+
+ else if (ACE_OS::strcmp (property.nam[0].id.in (),
+ "org.omg.CosLoadBalancing.Strategy.LeastLoaded.PerBalanceLoad") == 0)
+ {
+ this->extract_float_property (property,
+ per_balance_load
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+
+ if (critical_threshold != 0 && reject_threshold != 0
+ && critical_threshold <= reject_threshold)
+ ACE_THROW (PortableGroup::InvalidProperty (ct->nam, ct->val));
+
+ this->properties_ = props;
+
+ this->critical_threshold_ = critical_threshold;
+ this->reject_threshold_ = reject_threshold;
+ this->tolerance_ = tolerance;
+ this->dampening_ = dampening;
+ this->per_balance_load_ = per_balance_load;
+/*
+ ACE_DEBUG ((LM_DEBUG,
+ "--------------------------------\n"
+ "critical_threshold = %f\n"
+ "reject_threshold = %f\n"
+ "tolerance = %f\n"
+ "dampening = %f\n"
+ "per_balance_load = %f\n"
+ "--------------------------------\n",
+ critical_threshold,
+ reject_threshold,
+ tolerance,
+ dampening,
+ per_balance_load));
+*/
+}
+
+void
+TAO_LB_LeastLoaded::extract_float_property (
+ const PortableGroup::Property & property,
+ CORBA::Float & value
+ ACE_ENV_ARG_DECL)
+{
+ if (!(property.val >>= value))
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.h
new file mode 100644
index 00000000000..a7843028c66
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.h
@@ -0,0 +1,229 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_LeastLoaded.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef LB_LEAST_LOADED_H
+#define LB_LEAST_LOADED_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/LoadBalancing/LB_LoadMap.h"
+
+# if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+# endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosLoadBalancingS.h"
+
+#include "ace/Synch_Traits.h"
+#include "ace/Thread_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_LB
+{
+ /**
+ * @name Default LeastLoaded strategy parameters.
+ *
+ * Defaults defined by the Load Balancing specification.
+ */
+ //@{
+ const CORBA::Float LL_DEFAULT_CRITICAL_THRESHOLD = 0;
+ const CORBA::Float LL_DEFAULT_REJECT_THRESHOLD = 0;
+ const CORBA::Float LL_DEFAULT_TOLERANCE = 1;
+ const CORBA::Float LL_DEFAULT_DAMPENING = 0;
+ const CORBA::Float LL_DEFAULT_PER_BALANCE_LOAD = 0;
+ //@}
+
+ /**
+ * @name TAO-specific LeastLoaded strategy parameters.
+ *
+ * Parameters internal to TAO's LeastLoaded strategy
+ * implementation.
+ */
+ //@{
+ /// Percentage difference between two load values that determines
+ /// whether the loads are considered equivalent.
+ /**
+ * If the percent difference between two loads, i.e.:
+ * (Old Load - New Load) / New Load
+ * is less than or equal to this value, the two loads will be
+ * considered equivalent. In such a case, an object group member
+ * residing at the location corresponding to one of the two loads
+ * will be selected at random.
+ */
+ const CORBA::Float LL_DEFAULT_LOAD_PERCENT_DIFF_CUTOFF = 0.01f; // 1%
+ //@}
+}
+
+/**
+ * @class TAO_LB_LeastLoaded
+ *
+ * @brief "Least loaded" load balancing strategy
+ *
+ * This load balancing strategy is designed to select an object group
+ * member residing at a location with the smallest load.
+ */
+class TAO_LB_LeastLoaded
+ : public virtual POA_CosLoadBalancing::Strategy
+{
+public:
+
+ /// Constructor.
+ TAO_LB_LeastLoaded (PortableServer::POA_ptr poa);
+
+ /**
+ * @name CosLoadBalancing::Strategy methods
+ *
+ * Methods required by the CosLoadBalancing::Strategy interface.
+ */
+ //@{
+ virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosLoadBalancing::Properties * get_properties (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void push_loads (
+ const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosLoadBalancing::LoadList * get_loads (
+ CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound));
+
+ virtual CORBA::Object_ptr next_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound));
+
+ virtual void analyze_loads (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ /// Returns the default POA for this servant.
+ virtual PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ /// Initialize the LeastLoaded instance with the given properties.
+ void init (const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL);
+
+protected:
+
+ /// Destructor.
+ ~TAO_LB_LeastLoaded (void);
+
+ /// Retrieve the least loaded location from the given list of
+ /// locations.
+ CORBA::Boolean get_location (CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Locations & locations,
+ PortableGroup::Location & location
+ ACE_ENV_ARG_DECL);
+
+ /// Return the effective load.
+ CORBA::Float effective_load (CORBA::Float previous_load,
+ CORBA::Float new_load);
+
+ /// Push the new load into this Strategy's load processor, and
+ /// return the corresponding effective load.
+ void push_loads (
+ const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads,
+ CosLoadBalancing::Load & effective_load
+ ACE_ENV_ARG_DECL);
+
+ /// Utility method to extract a CORBA::Float value from the given
+ /// property.
+ void extract_float_property (const PortableGroup::Property & property,
+ CORBA::Float & value
+ ACE_ENV_ARG_DECL);
+
+private:
+
+ /// This servant's default POA.
+ PortableServer::POA_var poa_;
+
+ /// Table that maps location to load list.
+ TAO_LB_LoadMap * load_map_;
+
+ /// Lock used to ensure atomic access to state retained by this
+ /// class.
+ TAO_SYNCH_MUTEX * lock_;
+
+ /// Cached set of properties used when initializing this strategy.
+ CosLoadBalancing::Properties properties_;
+
+ /**
+ * @name LeastLoaded Property Values
+ *
+ * Cached LeastLoaded load balancing strategy property values.
+ */
+ //@{
+
+ /// The critical load threshold.
+ /**
+ * Load rebalancing/shedding will occur if loads at a given location
+ * are greater than this value. The default value is zero, which
+ * indicates that no load rebalancing/shedding will occur.
+ */
+ CORBA::Float critical_threshold_;
+
+ /// The request rejection threshold.
+ /**
+ * If the load at a given location is greater than this value, the
+ * member at that location will not be considered when choosing a
+ * member to the request will be forwarded. If all locations have
+ * loads greater than this value, a @c CORBA::TRANSIENT exception
+ * will be thrown unless the reject threshold is zero, which is the
+ * default. If the request rejection threshold is zero, a @c
+ * CORBA::TRANSIENT will not be thrown by this load balancing
+ * strategy, unless no object group members have been added yet.
+ */
+ CORBA::Float reject_threshold_;
+
+ ///
+ CORBA::Float tolerance_;
+
+ ///
+ CORBA::Float dampening_;
+
+ ///
+ CORBA::Float per_balance_load_;
+
+ //@}
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/LoadBalancing/LB_LeastLoaded.inl"
+#endif /* defined INLINE */
+
+#include /**/ "ace/post.h"
+
+#endif /* LB_LEAST_LOADED_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.inl b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.inl
new file mode 100644
index 00000000000..e59193f3c6f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.inl
@@ -0,0 +1,27 @@
+// -*- C++ -*-
+//
+// $Id$
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE CORBA::Float
+TAO_LB_LeastLoaded::effective_load (CORBA::Float previous_load,
+ CORBA::Float new_load)
+{
+ // Apply per-balance load. (Recompute raw load)
+ previous_load += this->per_balance_load_;
+
+ // Apply dampening. (Recompute new raw load)
+ CORBA::Float result =
+ this->dampening_ * previous_load + (1 - this->dampening_) * new_load;
+
+ ACE_ASSERT (this->tolerance_ != 0);
+
+ // Compute the effective load.
+ result /= this->tolerance_;
+
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.cpp
new file mode 100644
index 00000000000..a57212dbce6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.cpp
@@ -0,0 +1,42 @@
+#include "orbsvcs/LoadBalancing/LB_LoadAlert.h"
+
+
+ACE_RCSID (LoadBalancer,
+ LB_LoadAlert,
+ "$Id$")
+
+#if !defined (__ACE_INLINE__)
+# include "orbsvcs/LoadBalancing/LB_LoadAlert.inl"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LB_LoadAlert::TAO_LB_LoadAlert (void)
+ : alerted_ (0),
+ lock_ ()
+{
+}
+
+TAO_LB_LoadAlert::~TAO_LB_LoadAlert (void)
+{
+}
+
+void
+TAO_LB_LoadAlert::enable_alert (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, monitor, this->lock_);
+
+ this->alerted_ = 1;
+}
+
+void
+TAO_LB_LoadAlert::disable_alert (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, monitor, this->lock_);
+
+ this->alerted_ = 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.h
new file mode 100644
index 00000000000..f5345ef7f07
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.h
@@ -0,0 +1,87 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_LoadAlert.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_LOAD_ALERT_H
+#define TAO_LB_LOAD_ALERT_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosLoadBalancingS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroupC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_LoadBalancing_Export TAO_LB_LoadAlert
+ : public virtual POA_CosLoadBalancing::LoadAlert
+{
+public:
+
+ /// Constructor.
+ TAO_LB_LoadAlert (void);
+
+ /**
+ * @name CosLoadBalancing::LoadAlert Methods
+ *
+ * Methods required by the CosLoadBalancing::LoadAlert interface.
+ */
+ //@{
+
+ /// Forward requests back to the load manager via the object group
+ /// reference.
+ virtual void enable_alert (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Stop forwarding requests, and begin accepting them again.
+ virtual void disable_alert (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ //@}
+
+ /// Has this LoadAlert servant been alerted of a high load condition
+ /// by the LoadManager.
+ CORBA::Boolean alerted (void) const;
+
+// protected:
+
+ /// Destructor.
+ /**
+ * Protected destructor to enforce correct memory management via
+ * reference counting.
+ */
+ virtual ~TAO_LB_LoadAlert (void);
+
+private:
+
+ /// Has this LoadAlert servant been alerted of a high load condition
+ /// by the LoadManager?
+ CORBA::Boolean alerted_;
+
+ /// Lock used to synchronized access to the LoadAlert state.
+ mutable TAO_SYNCH_MUTEX lock_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+# include "orbsvcs/LoadBalancing/LB_LoadAlert.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_LOAD_ALERT_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.inl b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.inl
new file mode 100644
index 00000000000..abff1d3087e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.inl
@@ -0,0 +1,16 @@
+// -*- C++ -*-
+//
+// $Id$
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE CORBA::Boolean
+TAO_LB_LoadAlert::alerted (void) const
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, monitor, this->lock_, 0);
+
+ return this->alerted_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlertInfo.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlertInfo.cpp
new file mode 100644
index 00000000000..0378e9f584e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlertInfo.cpp
@@ -0,0 +1,16 @@
+#include "orbsvcs/LoadBalancing/LB_LoadAlertInfo.h"
+#include "orbsvcs/PortableGroup/PG_Operators.h"
+
+ACE_RCSID (LoadBalancing,
+ LB_LoadAlertInfo,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LB_LoadAlertInfo::TAO_LB_LoadAlertInfo (void)
+ : load_alert (),
+ alerted (0)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlertInfo.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlertInfo.h
new file mode 100644
index 00000000000..47c3f7b384c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlertInfo.h
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+
+//=======================================================================
+/**
+ * @file LB_LoadAlertInfo.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=======================================================================
+
+
+#ifndef TAO_LB_LOAD_ALERT_INFO_H
+#define TAO_LB_LOAD_ALERT_INFO_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/CosLoadBalancingC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_LB_LoadAlertInfo
+ *
+ * @brief Structure that contains all LoadAlert-specific information.
+ *
+ * Structure that contains all LoadAlert-specific information.
+ */
+struct TAO_LB_LoadAlertInfo
+{
+ /// Constructor.
+ TAO_LB_LoadAlertInfo (void);
+
+ /// Reference to the LoadAlert object.
+ CosLoadBalancing::LoadAlert_var load_alert;
+
+ /// True if the LoadAlert object has been alerted about a given load
+ /// condition. False otherwise.
+ CORBA::Boolean alerted;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_LOAD_ALERT_INFO_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlertMap.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlertMap.h
new file mode 100644
index 00000000000..5451acafddb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlertMap.h
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+
+//=======================================================================
+/**
+ * @file LB_LoadAlertMap.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=======================================================================
+
+
+#ifndef TAO_LB_LOAD_ALERT_MAP_H
+#define TAO_LB_LOAD_ALERT_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 "orbsvcs/LoadBalancing/LB_LoadAlertInfo.h"
+
+#include "orbsvcs/PortableGroup/PG_Location_Hash.h"
+#include "orbsvcs/PortableGroup/PG_Location_Equal_To.h"
+
+#include "ace/Hash_Map_Manager_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// LoadAlertInfo hash map typedef.
+typedef ACE_Hash_Map_Manager_Ex<
+ PortableGroup::Location,
+ TAO_LB_LoadAlertInfo,
+ TAO_PG_Location_Hash,
+ TAO_PG_Location_Equal_To,
+ ACE_Null_Mutex> TAO_LB_LoadAlertMap;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_LOAD_ALERT_MAP_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.cpp
new file mode 100644
index 00000000000..ca2bf1b5116
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.cpp
@@ -0,0 +1,52 @@
+#include "orbsvcs/LoadBalancing/LB_LoadAlert_Handler.h"
+
+#include "tao/debug.h"
+
+
+ACE_RCSID (LoadBalancing,
+ LB_LoadAlert_Handler,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LB_LoadAlert_Handler::~TAO_LB_LoadAlert_Handler (void)
+{
+}
+
+void
+TAO_LB_LoadAlert_Handler::enable_alert (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_LB_LoadAlert_Handler::enable_alert_excep (
+ ::Messaging::ExceptionHolder *
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Exception caught when invoking ")
+ ACE_TEXT ("LoadAlert::enable_alert()\n")));
+}
+
+void
+TAO_LB_LoadAlert_Handler::disable_alert (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_LB_LoadAlert_Handler::disable_alert_excep (
+ ::Messaging::ExceptionHolder *
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Exception caught when invoking ")
+ ACE_TEXT ("LoadAlert::disable_alert()\n")));
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.h
new file mode 100644
index 00000000000..d19518ce96d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.h
@@ -0,0 +1,76 @@
+// -*- C++ -*-
+
+// ============================================================================
+/**
+ * @file LB_LoadAlert_Handler.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+// ============================================================================
+
+#ifndef TAO_LB_LOAD_ALERT_REPLY_HANDLER_H
+#define TAO_LB_LOAD_ALERT_REPLY_HANDLER_H
+
+#include "orbsvcs/CosLoadBalancingS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+// 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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_LB_LoadAlert_Handler
+ *
+ * @brief The AMI reply handler for replies from all LoadAlert
+ * objects.
+ *
+ * This class handles all asynchronously received replies from all
+ * registered LoadAlert objects. It only exists to receive
+ * asynchronously sent exceptions.
+ */
+class TAO_LB_LoadAlert_Handler
+ : public virtual POA_CosLoadBalancing::AMI_LoadAlertHandler
+{
+public:
+
+ virtual void enable_alert (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void enable_alert_excep (
+ ::Messaging::ExceptionHolder *
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void disable_alert (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void disable_alert_excep (
+ ::Messaging::ExceptionHolder *
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+
+ /// Protected destructor to enforce propery memory management
+ /// through reference counting.
+ ~TAO_LB_LoadAlert_Handler (void);
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_LB_LOAD_ALERT_REPLY_HANDLER_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.cpp
new file mode 100644
index 00000000000..c6a0d0c3fa3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.cpp
@@ -0,0 +1,454 @@
+#include "orbsvcs/LoadBalancing/LB_LoadAverage.h"
+#include "orbsvcs/LoadBalancing/LB_LoadMap.h"
+#include "orbsvcs/LoadBalancing/LB_Random.h"
+
+#include "orbsvcs/PortableGroup/PG_conf.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+
+#include "ace/Null_Mutex.h"
+#include "ace/OS_NS_string.h"
+
+
+ACE_RCSID (LoadBalancing,
+ LB_LoadAverage,
+ "$Id$")
+
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/LoadBalancing/LB_LoadAverage.inl"
+#endif /* defined INLINE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LB_LoadAverage::TAO_LB_LoadAverage (PortableServer::POA_ptr poa)
+ : poa_ (PortableServer::POA::_duplicate (poa)),
+ load_map_ (0),
+ lock_ (0),
+ properties_ (),
+ tolerance_ (TAO_LB::LA_DEFAULT_TOLERANCE),
+ dampening_ (TAO_LB::LA_DEFAULT_DAMPENING),
+ per_balance_load_ (TAO_LB::LA_DEFAULT_DAMPENING)
+{
+ // A load map that retains previous load values at a given location
+ // and lock are only needed if dampening is enabled, i.e. non-zero.
+ if (this->dampening_ != 0)
+ {
+ ACE_NEW (this->load_map_, TAO_LB_LoadMap (TAO_PG_MAX_LOCATIONS));
+
+ ACE_NEW (this->lock_, TAO_SYNCH_MUTEX);
+ }
+
+ // Initialize the random load balancing strategy.
+ TAO_LB_Random::init ();
+}
+
+TAO_LB_LoadAverage::~TAO_LB_LoadAverage (void)
+{
+ delete this->load_map_;
+ delete this->lock_;
+}
+
+char *
+TAO_LB_LoadAverage::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("LoadAverage");
+}
+
+CosLoadBalancing::Properties *
+TAO_LB_LoadAverage::get_properties (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosLoadBalancing::Properties * props = 0;
+ ACE_NEW_THROW_EX (props,
+ CosLoadBalancing::Properties (this->properties_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ return props;
+}
+
+void
+TAO_LB_LoadAverage::push_loads (
+ const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Only the first load is used by this load balancing strategy.
+ if (loads.length () == 0)
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ CosLoadBalancing::Load load; // Unused
+
+ this->push_loads (the_location,
+ loads,
+ load
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_LB_LoadAverage::push_loads (
+ const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads,
+ CosLoadBalancing::Load & load
+ ACE_ENV_ARG_DECL)
+{
+ if (loads.length () == 0)
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ // Only the first load is used by this load balancing strategy.
+ const CosLoadBalancing::Load & new_load = loads[0];
+
+ if (this->load_map_ != 0)
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, *this->lock_);
+
+ TAO_LB_LoadMap::ENTRY * entry;
+ if (this->load_map_->find (the_location, entry) == 0)
+ {
+ CosLoadBalancing::Load & previous_load = entry->int_id_;
+
+ if (previous_load.id != new_load.id)
+ ACE_THROW (CORBA::BAD_PARAM ()); // Somebody switched
+ // LoadIds on us!
+
+ previous_load.value =
+ this->effective_load (previous_load.value, new_load.value);
+
+ load = previous_load;
+ }
+ else
+ {
+ const CosLoadBalancing::Load eff_load =
+ {
+ new_load.id,
+ this->effective_load (0, new_load.value)
+ };
+
+ if (this->load_map_->bind (the_location, eff_load) != 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: TAO_LB_LoadAverage - "
+ "Unable to push loads\n"));
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ load = eff_load;
+ }
+ }
+ else
+ {
+ load.id = new_load.id;
+ load.value = this->effective_load (0, new_load.value);
+ }
+}
+
+CosLoadBalancing::LoadList *
+TAO_LB_LoadAverage::get_loads (CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound))
+{
+ if (CORBA::is_nil (load_manager))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);
+
+ CosLoadBalancing::LoadList_var loads =
+ load_manager->get_loads (the_location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->push_loads (the_location,
+ loads.in (),
+ loads[0]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return loads._retn ();
+}
+
+
+CORBA::Object_ptr
+TAO_LB_LoadAverage::next_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound))
+{
+ if (CORBA::is_nil (load_manager))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ CORBA::Object::_nil ());
+
+ PortableGroup::Locations_var locations =
+ load_manager->locations_of_members (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ if (locations->length () == 0)
+ ACE_THROW_RETURN (CORBA::TRANSIENT (),
+ CORBA::Object::_nil ());
+
+ // @note The Random load balancing strategy is used since it is
+ // very lightweight and stateless.
+
+ return TAO_LB_Random::_tao_next_member (object_group,
+ load_manager,
+ locations.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_LB_LoadAverage::analyze_loads (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (CORBA::is_nil (load_manager))
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ PortableGroup::Locations_var locations =
+ load_manager->locations_of_members (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (locations->length () == 0)
+ ACE_THROW (CORBA::TRANSIENT ());
+
+ const CORBA::ULong len = locations->length ();
+
+ CosLoadBalancing::Load total_load = { 0, 0 };
+ CosLoadBalancing::Load avg_load = { 0, 0 };
+
+ CosLoadBalancing::LoadList tmp (len);
+ tmp.length (1);
+
+ // Iterate through the entire location list to determine
+ // the average load of all the locations
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ ACE_TRY
+ {
+ const PortableGroup::Location & loc = locations[i];
+
+ // Retrieve the load list for the location from the
+ // LoadManager and push it to this Strategy's load
+ // processor.
+ CosLoadBalancing::LoadList_var current_loads =
+ load_manager->get_loads (loc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosLoadBalancing::Load load;
+ this->push_loads (loc,
+ current_loads.in (),
+ load
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // @@ Jai, please use the compound "+=" operator here. It
+ // is more efficient in this case.
+ total_load.value = total_load.value + load.value;
+
+ tmp[i] = load;
+
+ /*
+ ACE_DEBUG ((LM_DEBUG,
+ "TOTAL == %f\n",
+ total_load.value));
+ */
+ }
+ ACE_CATCH (CosLoadBalancing::LocationNotFound, ex)
+ {
+ // no location found
+ //
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+
+ avg_load.value = total_load.value / len;
+/*
+ ACE_DEBUG ((LM_DEBUG,
+ "AVERAGE LOAD == %f\n",
+ avg_load.value));
+*/
+
+ // Iterate through the entire location list to determine
+ // the location where the load has to be shed.
+ for (CORBA::ULong j = 0; j < len; ++j)
+ {
+ ACE_TRY_EX (SECOND)
+ {
+ const PortableGroup::Location & loc = locations[j];
+
+ /*
+ ACE_DEBUG ((LM_DEBUG,
+ "EFFECTIVE_LOAD == %f\n"
+ "AVERAGE == %f\n",
+ tmp[i].value,
+ avg_load.value));
+ */
+
+ if (tmp[j].value <= avg_load.value)
+ {
+ load_manager->disable_alert (loc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (SECOND);
+ }
+ else
+ {
+ CORBA::Float percent_diff =
+ (tmp[j].value / avg_load.value) - 1;
+
+ if (tmp[j].value == avg_load.value)
+ {
+ percent_diff = 0;
+ }
+/*
+ ACE_DEBUG ((LM_DEBUG,
+ "ALERT LOC == %u"
+ "\tAVG LOAD == %f\n"
+ "\tLOAD == %f\n"
+ "\tPERCENT == %f\n",
+ i,
+ avg_load.value,
+ tmp[i].value,
+ percent_diff));
+*/
+
+ // @@ Jai, please correct the indentation on the below
+ // conditional blocks so that they conform to the ACE
+ // coding style.
+ if (percent_diff <= TAO_LB::LA_DEFAULT_DIFF_AVERAGE_CUTOFF)
+ {
+ load_manager->disable_alert (loc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (SECOND);
+ }
+ else if ((percent_diff > TAO_LB::LA_DEFAULT_DIFF_AVERAGE_CUTOFF)
+ && (percent_diff < 1))
+ {
+/*
+ ACE_DEBUG ((LM_DEBUG,
+ "%P --- ALERTING LOCATION %u\n",
+ i));
+*/
+
+ load_manager->enable_alert (loc
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK_EX (SECOND);
+ }
+
+ }
+ }
+ ACE_CATCH (CosLoadBalancing::LocationNotFound, ex)
+ {
+ // no location found
+ //
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+
+}
+
+PortableServer::POA_ptr
+TAO_LB_LoadAverage::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
+
+void
+TAO_LB_LoadAverage::init (const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Float tolerance = TAO_LB::LA_DEFAULT_TOLERANCE;
+ CORBA::Float dampening = TAO_LB::LA_DEFAULT_DAMPENING;
+ CORBA::Float per_balance_load = TAO_LB::LA_DEFAULT_PER_BALANCE_LOAD;
+
+ const CORBA::ULong len = props.length ();
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ const PortableGroup::Property & property = props[i];
+ if (ACE_OS::strcmp (property.nam[0].id.in (),
+ "org.omg.CosLoadBalancing.Strategy.LoadAverage.Tolerance") == 0)
+ {
+ this->extract_float_property (property,
+ tolerance
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Valid tolerance values are greater than or equal to one.
+ if (tolerance < 1)
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+
+ else if (ACE_OS::strcmp (property.nam[0].id.in (),
+ "org.omg.CosLoadBalancing.Strategy.LoadAverage.Dampening") == 0)
+ {
+ this->extract_float_property (property,
+ dampening
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Dampening range is [0,1).
+ if (dampening < 0 || dampening >= 1)
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+
+ else if (ACE_OS::strcmp (property.nam[0].id.in (),
+ "org.omg.CosLoadBalancing.Strategy.LoadAverage.PerBalanceLoad") == 0)
+ {
+ this->extract_float_property (property,
+ per_balance_load
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+
+ this->properties_ = props;
+
+ this->tolerance_ = tolerance;
+ this->dampening_ = dampening;
+ this->per_balance_load_ = per_balance_load;
+
+ /*
+ ACE_DEBUG ((LM_DEBUG,
+ "--------------------------------\n"
+ "tolerance = %f\n"
+ "dampening = %f\n"
+ "per_balance_load = %f\n"
+ "--------------------------------\n",
+ tolerance,
+ dampening,
+ per_balance_load));
+ */
+}
+
+void
+TAO_LB_LoadAverage::extract_float_property (
+ const PortableGroup::Property & property,
+ CORBA::Float & value
+ ACE_ENV_ARG_DECL)
+{
+ if (!(property.val >>= value))
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.h
new file mode 100644
index 00000000000..4af286ee527
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.h
@@ -0,0 +1,184 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_LoadAverage.h
+ *
+ * $Id$
+ *
+ * @author Jaiganesh Balasubramanian <jai@dre.vanderbilt.edu>
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef LB_LOAD_AVERAGE_H
+#define LB_LOAD_AVERAGE_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/LoadBalancing/LB_LoadMap.h"
+
+# if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+# endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosLoadBalancingS.h"
+
+#include "ace/Synch_Traits.h"
+#include "ace/Thread_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_LB
+{
+ /**
+ * @name Default LoadAverage strategy parameters.
+ *
+ * Defaults defined by the Load Balancing specification.
+ */
+ //@{
+ const CORBA::Float LA_DEFAULT_TOLERANCE = 1;
+ const CORBA::Float LA_DEFAULT_DAMPENING = 0;
+ const CORBA::Float LA_DEFAULT_PER_BALANCE_LOAD = 0;
+
+ const CORBA::Float LA_DEFAULT_DIFF_AVERAGE_CUTOFF = 0.8f;
+ //@}
+
+}
+
+/**
+ * @class TAO_LB_LoadAverage
+ *
+ * @brief "Least loaded" load balancing strategy
+ *
+ * This load balancing strategy is designed to select an object group
+ * member residing at a location with the smallest load.
+ */
+class TAO_LB_LoadAverage
+ : public virtual POA_CosLoadBalancing::Strategy
+{
+public:
+
+ /// Constructor.
+ TAO_LB_LoadAverage (PortableServer::POA_ptr poa);
+
+ /**
+ * @name CosLoadBalancing::Strategy methods
+ *
+ * Methods required by the CosLoadBalancing::Strategy interface.
+ */
+ //@{
+ virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosLoadBalancing::Properties * get_properties (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void push_loads (
+ const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosLoadBalancing::LoadList * get_loads (
+ CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound));
+
+ virtual CORBA::Object_ptr next_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound));
+
+ virtual void analyze_loads (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ /// Returns the default POA for this servant.
+ virtual PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ /// Initialize the LoadAverage instance with the given properties.
+ void init (const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL);
+
+protected:
+
+ /// Destructor.
+ ~TAO_LB_LoadAverage (void);
+
+ /// Return the effective load.
+ CORBA::Float effective_load (CORBA::Float previous_load,
+ CORBA::Float new_load);
+
+ /// Push the new load into this Strategy's load processor, and
+ /// return the corresponding effective load.
+ void push_loads (
+ const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads,
+ CosLoadBalancing::Load & effective_load
+ ACE_ENV_ARG_DECL);
+
+ /// Utility method to extract a CORBA::Float value from the given
+ /// property.
+ void extract_float_property (const PortableGroup::Property & property,
+ CORBA::Float & value
+ ACE_ENV_ARG_DECL);
+
+private:
+
+ /// This servant's default POA.
+ PortableServer::POA_var poa_;
+
+ /// Table that maps location to load list.
+ TAO_LB_LoadMap * load_map_;
+
+ /// Lock used to ensure atomic access to state retained by this
+ /// class.
+ TAO_SYNCH_MUTEX * lock_;
+
+ /// Cached set of properties used when initializing this strategy.
+ CosLoadBalancing::Properties properties_;
+
+ /**
+ * @name LoadAverage Property Values
+ *
+ * Cached LoadAverage load balancing strategy property values.
+ */
+ //@{
+
+ ///
+ CORBA::Float tolerance_;
+
+ ///
+ CORBA::Float dampening_;
+
+ ///
+ CORBA::Float per_balance_load_;
+
+ //@}
+
+ CosLoadBalancing::LoadList current_loads_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/LoadBalancing/LB_LoadAverage.inl"
+#endif /* defined INLINE */
+
+#include /**/ "ace/post.h"
+
+#endif /* LB_LOAD_AVERAGE_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.inl b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.inl
new file mode 100644
index 00000000000..347374c1a7c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.inl
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE CORBA::Float
+TAO_LB_LoadAverage::effective_load (CORBA::Float previous_load,
+ CORBA::Float new_load)
+{
+ // Apply per-balance load. (Recompute raw load)
+ previous_load += this->per_balance_load_;
+
+ // Apply dampening. (Recompute new raw load)
+ CORBA::Float result =
+ this->dampening_ * previous_load + (1 - this->dampening_) * new_load;
+
+ ACE_ASSERT (this->tolerance_ != 0);
+
+ // Compute the effective load.
+ result /= this->tolerance_;
+
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadListMap.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadListMap.h
new file mode 100644
index 00000000000..4dd83f2e2b9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadListMap.h
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+
+//=======================================================================
+/**
+ * @file LB_LoadListMap.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=======================================================================
+
+
+#ifndef TAO_LB_LOAD_LIST_MAP_H
+#define TAO_LB_LOAD_LIST_MAP_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosLoadBalancingC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroupC.h"
+
+#include "orbsvcs/PortableGroup/PG_Location_Hash.h"
+#include "orbsvcs/PortableGroup/PG_Location_Equal_To.h"
+
+#include "ace/Hash_Map_Manager_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// LoadList hash map.
+typedef ACE_Hash_Map_Manager_Ex<
+ PortableGroup::Location,
+ CosLoadBalancing::LoadList,
+ TAO_PG_Location_Hash,
+ TAO_PG_Location_Equal_To,
+ ACE_Null_Mutex> TAO_LB_LoadListMap;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_LOAD_LIST_MAP_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadManager.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadManager.cpp
new file mode 100644
index 00000000000..10b42090791
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadManager.cpp
@@ -0,0 +1,1295 @@
+#include "orbsvcs/LoadBalancing/LB_LoadManager.h"
+#include "orbsvcs/LoadBalancing/LB_MemberLocator.h"
+#include "orbsvcs/LoadBalancing/LB_LoadAlert_Handler.h"
+#include "orbsvcs/LoadBalancing/LB_RoundRobin.h"
+#include "orbsvcs/LoadBalancing/LB_Random.h"
+#include "orbsvcs/LoadBalancing/LB_LoadMinimum.h"
+#include "orbsvcs/LoadBalancing/LB_LoadAverage.h"
+#include "orbsvcs/LoadBalancing/LB_LeastLoaded.h"
+#include "orbsvcs/LoadBalancing/LB_conf.h"
+
+#include "orbsvcs/PortableGroup/PG_Property_Utils.h"
+#include "orbsvcs/PortableGroup/PG_conf.h"
+
+#include "tao/Messaging/Messaging.h"
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+
+#include "ace/Reactor.h"
+#include "ace/Reverse_Lock_T.h"
+#include "ace/SString.h"
+#include "ace/OS_NS_sys_time.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+
+
+ACE_RCSID (LoadBalancing,
+ LB_LoadManager,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LB_LoadManager::TAO_LB_LoadManager (void)
+ : reactor_ (0),
+ poa_ (),
+ root_poa_ (),
+ monitor_lock_ (),
+ load_lock_ (),
+ load_alert_lock_ (),
+ lock_ (),
+ monitor_map_ (TAO_PG_MAX_LOCATIONS),
+ load_map_ (TAO_PG_MAX_LOCATIONS),
+ load_alert_map_ (TAO_PG_MAX_LOCATIONS),
+ object_group_manager_ (),
+ property_manager_ (object_group_manager_),
+ generic_factory_ (object_group_manager_, property_manager_),
+ pull_handler_ (),
+ timer_id_ (-1),
+ lm_ref_ (),
+ round_robin_ (),
+ random_ (),
+ least_loaded_ (),
+ load_minimum_ (),
+ load_average_ (),
+ built_in_balancing_strategy_info_name_ (1),
+ built_in_balancing_strategy_name_ (1),
+ custom_balancing_strategy_name_ (1)
+{
+ this->pull_handler_.initialize (&this->monitor_map_, this);
+
+ // @note "this->init()" is not called here (in the constructor)
+ // since it may thrown an exception. Throwing an exception in
+ // a constructor in an emulated exception environment is
+ // problematic since native exception semantics cannot be
+ // reproduced in such a case. As such, init() must be called
+ // by whatever code instantiates this LoadManager.
+}
+
+TAO_LB_LoadManager::~TAO_LB_LoadManager (void)
+{
+}
+
+void
+TAO_LB_LoadManager::push_loads (
+ const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (loads.length () == 0)
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX,
+ guard,
+ this->load_lock_);
+
+ if (this->load_map_.rebind (the_location, loads) == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ // Analyze loads for object groups that have members residing at the
+ // given location.
+ PortableGroup::ObjectGroups_var groups =
+ this->object_group_manager_.groups_at_location (the_location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const CORBA::ULong len = groups->length ();
+
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ PortableGroup::ObjectGroup_ptr object_group =
+ groups[i];
+
+ ACE_TRY
+ {
+ PortableGroup::Properties_var properties =
+ this->get_properties (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableGroup::Value value;
+ CosLoadBalancing::Strategy_ptr strategy;
+
+ if ((TAO_PG::get_property_value (
+ this->built_in_balancing_strategy_name_,
+ properties.in (),
+ value)
+ || TAO_PG::get_property_value (
+ this->custom_balancing_strategy_name_,
+ properties.in (),
+ value))
+ && (value >>= strategy)
+ && !CORBA::is_nil (strategy))
+ {
+ strategy->analyze_loads (object_group,
+ this->lm_ref_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions.
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+}
+
+CosLoadBalancing::LoadList *
+TAO_LB_LoadManager::get_loads (const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound))
+{
+ CosLoadBalancing::LoadList * tmp;
+ ACE_NEW_THROW_EX (tmp,
+ CosLoadBalancing::LoadList,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ CosLoadBalancing::LoadList_var loads = tmp;
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->load_lock_,
+ 0);
+
+ if (this->load_map_.find (the_location, *tmp) == 0)
+ return loads._retn ();
+ else
+ ACE_THROW_RETURN (CosLoadBalancing::LocationNotFound (), 0);
+}
+
+void
+TAO_LB_LoadManager::enable_alert (const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosLoadBalancing::LoadAlertNotFound))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->load_alert_lock_);
+
+ TAO_LB_LoadAlertMap::ENTRY * entry;
+ if (this->load_alert_map_.find (the_location, entry) == 0)
+ {
+ TAO_LB_LoadAlertInfo & info = entry->int_id_;
+
+ // @note This could be problematic if the LoadAlert object is
+ // registered with more than LoadManager.
+
+ if (info.alerted == 1)
+ return; // No need to set the alert status. It has already
+ // been set.
+
+ // Duplicate before releasing the LoadAlertMap lock to prevent a
+ // race condition from occuring. The LoadAlertInfo map may be
+ // altered prior to invoking an operation on the LoadAlert
+ // object.
+ CosLoadBalancing::LoadAlert_var load_alert =
+ CosLoadBalancing::LoadAlert::_duplicate (info.load_alert.in ());
+
+ // The alert condition will be enabled.
+ // @@ What happens if the below call fails? This variable
+ // should be reset to zero!
+ info.alerted = 1;
+
+ {
+ // Release the lock prior to making the below remote
+ // invocation.
+ ACE_Reverse_Lock<TAO_SYNCH_MUTEX> reverse_lock (
+ this->load_alert_lock_);
+ ACE_GUARD (ACE_Reverse_Lock<TAO_SYNCH_MUTEX>,
+ reverse_guard,
+ reverse_lock);
+
+ // Use AMI to make the following operation "non-blocking,"
+ // allowing the caller to continue without being forced to
+ // wait for a response.
+ //
+ // AMI is used to improve member selection times and overall
+ // throughput since the LoadAlert object need not be alerted
+ // synchronously. In particular, the load alert can and
+ // should be performed in parallel to other tasks, such as
+ // member selection.
+ load_alert->sendc_enable_alert (this->load_alert_handler_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ else
+ ACE_THROW (CosLoadBalancing::LoadAlertNotFound ());
+}
+
+void
+TAO_LB_LoadManager::disable_alert (const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosLoadBalancing::LoadAlertNotFound))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->load_alert_lock_);
+
+ TAO_LB_LoadAlertMap::ENTRY * entry;
+ if (this->load_alert_map_.find (the_location, entry) == 0)
+ {
+ TAO_LB_LoadAlertInfo & info = entry->int_id_;
+
+ // @note This could be problematic if the LoadAlert object is
+ // registered with more than LoadManager.
+ if (info.alerted == 0)
+ return; // No need to set the alert status. It has already
+ // been set.
+
+ // Duplicate before releasing the LoadAlertMap lock to prevent a
+ // race condition from occuring. The LoadAlertInfo map may be
+ // altered prior to invoking an operation on the LoadAlert
+ // object.
+ CosLoadBalancing::LoadAlert_var load_alert =
+ CosLoadBalancing::LoadAlert::_duplicate (info.load_alert.in ());
+
+ // The alert condition will be disabled.
+ // @@ What happens if the below call fails? This variable
+ // should be reset to one!
+ info.alerted = 0;
+
+ {
+ // Release the lock prior to making the below remote
+ // invocation.
+ ACE_Reverse_Lock<TAO_SYNCH_MUTEX> reverse_lock (
+ this->load_alert_lock_);
+ ACE_GUARD (ACE_Reverse_Lock<TAO_SYNCH_MUTEX>,
+ reverse_guard,
+ reverse_lock);
+
+ // Use AMI to make the following operation "non-blocking,"
+ // allowing the caller to continue without being forced to
+ // wait for a response.
+ //
+ // AMI is used to improve member selection times and overall
+ // throughput since the LoadAlert object need not be alerted
+ // synchronously. In particular, the load alert can and
+ // should be performed in parallel to other tasks, such as
+ // member selection.
+ load_alert->sendc_disable_alert (this->load_alert_handler_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ else
+ ACE_THROW (CosLoadBalancing::LoadAlertNotFound ());
+}
+
+void
+TAO_LB_LoadManager::register_load_alert (
+ const PortableGroup::Location & the_location,
+ CosLoadBalancing::LoadAlert_ptr load_alert
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LoadAlertAlreadyPresent,
+ CosLoadBalancing::LoadAlertNotAdded))
+{
+ if (CORBA::is_nil (load_alert))
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->load_alert_lock_);
+
+ TAO_LB_LoadAlertInfo info;
+ info.load_alert = CosLoadBalancing::LoadAlert::_duplicate (load_alert);
+
+ int result = this->load_alert_map_.bind (the_location, info);
+
+ if (result == 1)
+ {
+ ACE_THROW (CosLoadBalancing::LoadAlertAlreadyPresent ());
+ }
+ else if (result == -1)
+ {
+ // Problems dude!
+ ACE_THROW (CosLoadBalancing::LoadAlertNotAdded ());
+ }
+}
+
+CosLoadBalancing::LoadAlert_ptr
+TAO_LB_LoadManager::get_load_alert (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LoadAlertNotFound))
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->load_alert_lock_,
+ CosLoadBalancing::LoadAlert::_nil ());
+
+ TAO_LB_LoadAlertMap::ENTRY * entry;
+ if (this->load_alert_map_.find (the_location, entry) == 0)
+ {
+ TAO_LB_LoadAlertInfo & info = entry->int_id_;
+
+ return
+ CosLoadBalancing::LoadAlert::_duplicate (info.load_alert.in ());
+ }
+ else
+ {
+ ACE_THROW_RETURN (CosLoadBalancing::LoadAlertNotFound (),
+ CosLoadBalancing::LoadAlert::_nil ());
+ }
+}
+
+void
+TAO_LB_LoadManager::remove_load_alert (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LoadAlertNotFound))
+{
+ // Disable the "alert" status on the LoadAlert object since it will
+ // no longer be associated with the LoadManager. In particular,
+ // requests should be allowed through once again since there will be
+ // no way to control the load shedding mechanism once the LoadAlert
+ // object is no longer under the control of the LoadManager.
+ this->disable_alert (the_location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->load_alert_lock_);
+
+ if (this->load_alert_map_.unbind (the_location) != 0)
+ {
+ ACE_THROW (CosLoadBalancing::LoadAlertNotFound ());
+ }
+}
+
+void
+TAO_LB_LoadManager::register_load_monitor (
+ const PortableGroup::Location & the_location,
+ CosLoadBalancing::LoadMonitor_ptr load_monitor
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::MonitorAlreadyPresent))
+{
+ if (CORBA::is_nil (load_monitor))
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ const CosLoadBalancing::LoadMonitor_var the_monitor =
+ CosLoadBalancing::LoadMonitor::_duplicate (load_monitor);
+
+ ACE_GUARD (TAO_SYNCH_MUTEX,
+ guard,
+ this->monitor_lock_);
+
+ int result = this->monitor_map_.bind (the_location, the_monitor);
+
+ if (result == 0
+ && this->monitor_map_.current_size () == 1)
+ {
+ // Register the "pull monitoring" event handler only after the
+ // first load monitor is registered. This is an optimization to
+ // prevent unnecessary invocation of the "pull monitoring" event
+ // handler.
+ ACE_Time_Value interval (TAO_LB_PULL_HANDLER_INTERVAL, 0);
+ ACE_Time_Value restart (TAO_LB_PULL_HANDLER_RESTART, 0);
+ this->timer_id_ = this->reactor_->schedule_timer (&this->pull_handler_,
+ 0,
+ interval,
+ restart);
+
+ if (this->timer_id_ == -1)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "TAO_LB_LoadManager::register_load_monitor: "
+ "Unable to schedule timer.\n"));
+
+ (void) this->monitor_map_.unbind (the_location);
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+ }
+ else if (result == 1)
+ {
+ ACE_THROW (CosLoadBalancing::MonitorAlreadyPresent ());
+ }
+ else if (result != 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "TAO_LB_LoadManager::register_load_monitor: "
+ "Unable to register load monitor.\n"));
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+}
+
+CosLoadBalancing::LoadMonitor_ptr
+TAO_LB_LoadManager::get_load_monitor (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound))
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->monitor_lock_,
+ CosLoadBalancing::LoadMonitor::_nil ());
+
+ TAO_LB_MonitorMap::ENTRY * entry;
+ if (this->monitor_map_.find (the_location, entry) == 0)
+ {
+ return
+ CosLoadBalancing::LoadMonitor::_duplicate (entry->int_id_.in ());
+ }
+
+ ACE_THROW_RETURN (CosLoadBalancing::LocationNotFound (),
+ CosLoadBalancing::LoadMonitor::_nil ());
+}
+
+void
+TAO_LB_LoadManager::remove_load_monitor (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX,
+ guard,
+ this->monitor_lock_);
+
+ if (this->monitor_map_.unbind (the_location) != 0)
+ ACE_THROW (CosLoadBalancing::LocationNotFound ());
+
+ // If no load monitors are registered with the load balancer than
+ // shutdown the "pull monitoring."
+ if (this->timer_id_ != -1
+ && this->monitor_map_.current_size () == 0)
+ {
+ if (this->reactor_->cancel_timer (this->timer_id_) == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "TAO_LB_LoadManager::remove_load_monitor: "
+ "Unable to cancel timer.\n"));
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ this->timer_id_ = -1;
+ }
+}
+
+void
+TAO_LB_LoadManager::set_default_properties (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ PortableGroup::Properties new_props (props);
+ this->preprocess_properties (new_props
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->property_manager_.set_default_properties (new_props
+ ACE_ENV_ARG_PARAMETER);
+}
+
+PortableGroup::Properties *
+TAO_LB_LoadManager::get_default_properties (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return
+ this->property_manager_.get_default_properties (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_LB_LoadManager::remove_default_properties (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ this->property_manager_.remove_default_properties (props
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_LB_LoadManager::set_type_properties (
+ const char *type_id,
+ const PortableGroup::Properties & overrides
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ PortableGroup::Properties new_overrides (overrides);
+ this->preprocess_properties (new_overrides
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->property_manager_.set_type_properties (type_id,
+ new_overrides
+ ACE_ENV_ARG_PARAMETER);
+}
+
+PortableGroup::Properties *
+TAO_LB_LoadManager::get_type_properties (
+ const char *type_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return
+ this->property_manager_.get_type_properties (type_id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_LB_LoadManager::remove_type_properties (
+ const char *type_id,
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ this->property_manager_.remove_type_properties (type_id,
+ props
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_LB_LoadManager::set_properties_dynamically (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Properties & overrides
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ PortableGroup::Properties new_overrides (overrides);
+ this->preprocess_properties (new_overrides
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->property_manager_.set_properties_dynamically (object_group,
+ new_overrides
+ ACE_ENV_ARG_PARAMETER);
+}
+
+PortableGroup::Properties *
+TAO_LB_LoadManager::get_properties (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+ return
+ this->property_manager_.get_properties (object_group
+ ACE_ENV_ARG_PARAMETER);
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_LB_LoadManager::create_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::NoFactory,
+ PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::CannotMeetCriteria))
+{
+ return
+ this->object_group_manager_.create_member (object_group,
+ the_location,
+ type_id,
+ the_criteria
+ ACE_ENV_ARG_PARAMETER);
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_LB_LoadManager::add_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ CORBA::Object_ptr member
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::ObjectNotAdded))
+{
+ return
+ this->object_group_manager_.add_member (object_group,
+ the_location,
+ member
+ ACE_ENV_ARG_PARAMETER);
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_LB_LoadManager::remove_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound))
+{
+ return
+ this->object_group_manager_.remove_member (object_group,
+ the_location
+ ACE_ENV_ARG_PARAMETER);
+}
+
+PortableGroup::Locations *
+TAO_LB_LoadManager::locations_of_members (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+ return
+ this->object_group_manager_.locations_of_members (object_group
+ ACE_ENV_ARG_PARAMETER);
+}
+
+PortableGroup::ObjectGroups *
+TAO_LB_LoadManager::groups_at_location (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return
+ this->object_group_manager_.groups_at_location (the_location
+ ACE_ENV_ARG_PARAMETER);
+}
+
+PortableGroup::ObjectGroupId
+TAO_LB_LoadManager::get_object_group_id (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+ return
+ this->object_group_manager_.get_object_group_id (object_group
+ ACE_ENV_ARG_PARAMETER);
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_LB_LoadManager::get_object_group_ref (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+ return
+ this->object_group_manager_.get_object_group_ref (object_group
+ ACE_ENV_ARG_PARAMETER);
+}
+
+PortableGroup::ObjectGroup_ptr TAO_LB_LoadManager::get_object_group_ref_from_id (
+ PortableGroup::ObjectGroupId group_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC((
+ CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+ return this->object_group_manager_.get_object_group_ref_from_id (
+ group_id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Object_ptr
+TAO_LB_LoadManager::get_member_ref (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound))
+{
+ return
+ this->object_group_manager_.get_member_ref (object_group,
+ the_location
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Object_ptr
+TAO_LB_LoadManager::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))
+{
+// this->init (ACE_ENV_SINGLE_ARG_PARAMETER);
+// ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+
+ PortableGroup::Criteria new_criteria (the_criteria);
+ this->preprocess_properties (new_criteria
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ CORBA::Object_ptr obj =
+ this->generic_factory_.create_object (type_id,
+ new_criteria,
+ factory_creation_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+
+ return obj;
+}
+
+#if 0
+void
+TAO_LB_LoadManager::process_criteria (
+ const PortableGroup::Criteria & the_criteria
+ ACE_ENV_ARG_DECL)
+{
+ // List of invalid criteria. If this list has a length greater than
+ // zero, then the PortableGroup::InvalidCriteria exception will
+ // be thrown.
+ PortableGroup::Criteria invalid_criteria;
+
+ int found_factory = 0; // If factory was found in the_criteria, then
+ // set to 1.
+
+ // Parse the criteria.
+ CORBA::ULong criteria_count = the_criteria.length ();
+ for (CORBA::ULong i = 0; i < criteria_size; ++i)
+ {
+ CORBA::UShort initial_number_replicas = 0;
+ PortableGroup::FactoryInfos factory_infos;
+
+ // Obtain the InitialNumberMembers from the_criteria.
+ if (this->get_initial_number_replicas (type_id,
+ the_criteria[i],
+ initial_number_replicas) != 0)
+ {
+ CORBA::ULong len = invalid_criteria.length ();
+ invalid_criteria.length (len + 1);
+ invalid_criteria[len] = the_criteria[i];
+ }
+
+ // Obtain the FactoryInfos from the_criteria. This method also
+ // ensures that GenericFactories at different locations are used.
+ else if (this->get_factory_infos (type_id,
+ the_criteria[i],
+ factory_infos) == 0)
+ found_factory = 1;
+
+ // Unknown property
+ else
+ ACE_THROW (PortableGroup::InvalidProperty (the_criteria[i].nam,
+ the_criteria[i].val));
+ }
+
+ if (invalid_criteria.length () != 0)
+ ACE_THROW (PortableGroup::InvalidCriteria (invalid_criteria));
+
+ if (found_factory == 0)
+ ACE_THROW (PortableGroup::NoFactory ());
+}
+#endif /* 0 */
+
+void
+TAO_LB_LoadManager::delete_object (
+ const PortableGroup::GenericFactory::FactoryCreationId &
+ factory_creation_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectNotFound))
+{
+ this->generic_factory_.delete_object (factory_creation_id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Object_ptr
+TAO_LB_LoadManager::next_member (const PortableServer::ObjectId & oid
+ ACE_ENV_ARG_DECL)
+{
+ PortableGroup::ObjectGroup_var object_group =
+ this->object_group_manager_.object_group (oid);
+
+ if (CORBA::is_nil (object_group.in ()))
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (),
+ CORBA::Object::_nil ());
+
+ PortableGroup::Properties_var properties =
+ this->get_properties (object_group.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ // Prefer custom load balancing strategies over built-in ones.
+ PortableGroup::Value value;
+ CosLoadBalancing::Strategy_ptr strategy;
+
+ if ((TAO_PG::get_property_value (this->built_in_balancing_strategy_name_,
+ properties.in (),
+ value)
+ || TAO_PG::get_property_value (this->custom_balancing_strategy_name_,
+ properties.in (),
+ value))
+ && (value >>= strategy)
+ && !CORBA::is_nil (strategy))
+ {
+ return strategy->next_member (object_group.in (),
+ this->lm_ref_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (),
+ CORBA::Object::_nil ());
+}
+
+void
+TAO_LB_LoadManager::init (ACE_Reactor * reactor,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr root_poa
+ ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (orb));
+ ACE_ASSERT (!CORBA::is_nil (root_poa));
+
+ ACE_GUARD (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_);
+
+ if (CORBA::is_nil (this->poa_.in ()))
+ {
+ // Create a new transient servant manager object in the child
+ // POA.
+ PortableServer::ServantManager_ptr tmp;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_LB_MemberLocator (this),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableServer::ServantManager_var member_locator = tmp;
+
+ // Create the appropriate RequestProcessingPolicy
+ // (USE_SERVANT_MANAGER) and ServantRetentionPolicy (NON_RETAIN)
+ // for a ServantLocator.
+ PortableServer::RequestProcessingPolicy_var request =
+ root_poa->create_request_processing_policy (
+ PortableServer::USE_SERVANT_MANAGER
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::ServantRetentionPolicy_var retention =
+ root_poa->create_servant_retention_policy (
+ PortableServer::NON_RETAIN
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Create the PolicyList containing the policies necessary for
+ // the POA to support ServantLocators.
+ CORBA::PolicyList policy_list;
+ policy_list.length (2);
+ policy_list[0] =
+ PortableServer::RequestProcessingPolicy::_duplicate (
+ request.in ());
+ policy_list[1] =
+ PortableServer::ServantRetentionPolicy::_duplicate (
+ retention.in ());
+
+ // Create the child POA with the above ServantManager policies.
+ // The ServantManager will be the MemberLocator.
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // The child POA's name will consist of a string that includes
+ // the current time in milliseconds in hexidecimal format (only
+ // four bytes will be used). This is an attempt to prevent
+ // different load manager servants within the same ORB from
+ // using the same POA.
+ const ACE_Time_Value tv = ACE_OS::gettimeofday ();
+ const CORBA::Long time =
+ static_cast<CORBA::Long> (tv.msec ()); // Time in milliseconds.
+
+ char poa_name[] = "TAO_LB_LoadManager_POA - 0xZZZZZZZZ";
+ char * astr =
+ poa_name
+ + sizeof (poa_name)
+ - 9 /* 8 + 1 */;
+
+ // Overwrite the last 8 characters in the POA name with the
+ // hexadecimal representation of the time in milliseconds.
+ ACE_OS::sprintf (astr, "%x", time);
+
+ this->poa_ = root_poa->create_POA (poa_name,
+ poa_manager.in (),
+ policy_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ request->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ retention->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Now set the MemberLocator as the child POA's Servant
+ // Manager.
+ this->poa_->set_servant_manager (member_locator.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->object_group_manager_.poa (this->poa_.in ());
+ this->generic_factory_.poa (this->poa_.in ());
+
+ // Activate the child POA.
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->reactor_ = reactor;
+ this->root_poa_ = PortableServer::POA::_duplicate (root_poa);
+ }
+
+ if (CORBA::is_nil (this->lm_ref_.in ()))
+ {
+ this->lm_ref_ = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ orb->register_initial_reference ("LoadManager",
+ this->lm_ref_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (CORBA::is_nil (this->load_alert_handler_.in ()))
+ {
+ TAO_LB_LoadAlert_Handler * handler;
+ ACE_NEW_THROW_EX (handler,
+ TAO_LB_LoadAlert_Handler,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableServer::ServantBase_var safe_handler = handler;
+
+ this->load_alert_handler_ =
+ handler->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ this->built_in_balancing_strategy_info_name_.length (1);
+ this->built_in_balancing_strategy_info_name_[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.StrategyInfo");
+
+ this->built_in_balancing_strategy_name_.length (1);
+ this->built_in_balancing_strategy_name_[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.Strategy");
+
+ this->custom_balancing_strategy_name_.length (1);
+ this->custom_balancing_strategy_name_[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.CustomStrategy");
+}
+
+void
+TAO_LB_LoadManager::preprocess_properties (PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+{
+ // @@ This is slow. Optimize this code.
+
+ const CORBA::ULong len = props.length ();
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ PortableGroup::Property & property = props[i];
+ if (property.nam == this->custom_balancing_strategy_name_)
+ {
+ CosLoadBalancing::CustomStrategy_ptr strategy;
+ if (!(property.val >>= strategy)
+ || CORBA::is_nil (strategy))
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+
+ else if (property.nam == this->built_in_balancing_strategy_info_name_)
+ {
+ CosLoadBalancing::StrategyInfo * info;
+
+ if (property.val >>= info)
+ {
+ // Convert the property from a "StrategyInfo" property
+ // to a "Strategy" property.
+
+ CosLoadBalancing::Strategy_var strategy =
+ this->make_strategy (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (!CORBA::is_nil (strategy.in ()))
+ {
+ property.nam = this->built_in_balancing_strategy_name_;
+
+ property.val <<= strategy.in ();
+ }
+ else
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+ else
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+ else if (property.nam == this->built_in_balancing_strategy_name_)
+ {
+ // It is illegal to set the Strategy property externally.
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+ }
+}
+
+CosLoadBalancing::Strategy_ptr
+TAO_LB_LoadManager::make_strategy (CosLoadBalancing::StrategyInfo * info
+ ACE_ENV_ARG_DECL)
+{
+ /**
+ * @todo We need a strategy factory. This is just too messy.
+ */
+
+ if (ACE_OS::strcmp (info->name.in (), "RoundRobin") == 0)
+ {
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ monitor,
+ this->lock_,
+ CosLoadBalancing::Strategy::_nil ());
+
+ if (CORBA::is_nil (this->round_robin_.in ()))
+ {
+ TAO_LB_RoundRobin * rr_servant;
+ ACE_NEW_THROW_EX (rr_servant,
+ TAO_LB_RoundRobin (this->root_poa_.in ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+
+ PortableServer::ServantBase_var s = rr_servant;
+
+ this->round_robin_ =
+ rr_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+ }
+ }
+
+ return CosLoadBalancing::Strategy::_duplicate (this->round_robin_.in ());
+ }
+
+ else if (ACE_OS::strcmp (info->name.in (), "Random") == 0)
+ {
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ monitor,
+ this->lock_,
+ CosLoadBalancing::Strategy::_nil ());
+
+ if (CORBA::is_nil (this->random_.in ()))
+ {
+ TAO_LB_Random * rnd_servant;
+ ACE_NEW_THROW_EX (rnd_servant,
+ TAO_LB_Random (this->root_poa_.in ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+
+ PortableServer::ServantBase_var s = rnd_servant;
+
+ this->random_ =
+ rnd_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+ }
+ }
+
+ return CosLoadBalancing::Strategy::_duplicate (this->random_.in ());
+ }
+
+ else if (ACE_OS::strcmp (info->name.in (), "LeastLoaded") == 0)
+ {
+ // If no LeastLoaded properties have been set, just use the
+ // default/cached LeastLoaded instance. Otherwise create and
+ // return a new LeastLoaded instance with the appropriate
+ // properties.
+
+ if (info->props.length () == 0)
+ {
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ monitor,
+ this->lock_,
+ CosLoadBalancing::Strategy::_nil ());
+
+ if (CORBA::is_nil (this->least_loaded_.in ()))
+ {
+ TAO_LB_LeastLoaded * ll_servant;
+ ACE_NEW_THROW_EX (ll_servant,
+ TAO_LB_LeastLoaded (this->root_poa_.in ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+
+ PortableServer::ServantBase_var s = ll_servant;
+
+ this->least_loaded_ =
+ ll_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+ }
+ }
+
+ return
+ CosLoadBalancing::Strategy::_duplicate (this->least_loaded_.in ());
+ }
+ else
+ {
+ TAO_LB_LeastLoaded * ll_servant;
+ ACE_NEW_THROW_EX (ll_servant,
+ TAO_LB_LeastLoaded (this->root_poa_.in ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+
+ PortableServer::ServantBase_var s = ll_servant;
+
+ ll_servant->init (info->props
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+
+ return ll_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ }
+ else if (ACE_OS::strcmp (info->name.in (), "LoadMinimum") == 0)
+ {
+
+ if (info->props.length () == 0)
+ {
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ monitor,
+ this->lock_,
+ CosLoadBalancing::Strategy::_nil ());
+
+ if (CORBA::is_nil (this->load_minimum_.in ()))
+ {
+ TAO_LB_LoadMinimum * lm_servant;
+ ACE_NEW_THROW_EX (lm_servant,
+ TAO_LB_LoadMinimum (this->root_poa_.in ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+
+ PortableServer::ServantBase_var s = lm_servant;
+
+ this->load_minimum_ =
+ lm_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+ }
+ }
+
+ return
+ CosLoadBalancing::Strategy::_duplicate (this->load_minimum_.in ());
+ }
+ else
+ {
+ TAO_LB_LoadMinimum * lm_servant;
+ ACE_NEW_THROW_EX (lm_servant,
+ TAO_LB_LoadMinimum (this->root_poa_.in ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+
+ PortableServer::ServantBase_var s = lm_servant;
+
+ lm_servant->init (info->props
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+
+ return lm_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ }
+ else if (ACE_OS::strcmp (info->name.in (), "LoadAverage") == 0)
+ {
+
+ if (info->props.length () == 0)
+ {
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ monitor,
+ this->lock_,
+ CosLoadBalancing::Strategy::_nil ());
+
+ if (CORBA::is_nil (this->load_average_.in ()))
+ {
+ TAO_LB_LoadAverage * la_servant;
+ ACE_NEW_THROW_EX (la_servant,
+ TAO_LB_LoadAverage (this->root_poa_.in ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+
+ PortableServer::ServantBase_var s = la_servant;
+
+ this->load_average_ =
+ la_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+ }
+ }
+
+ return
+ CosLoadBalancing::Strategy::_duplicate (this->load_average_.in ());
+ }
+ else
+ {
+ TAO_LB_LoadAverage * la_servant;
+ ACE_NEW_THROW_EX (la_servant,
+ TAO_LB_LoadAverage (this->root_poa_.in ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+
+ PortableServer::ServantBase_var s = la_servant;
+
+ la_servant->init (info->props
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosLoadBalancing::Strategy::_nil ());
+
+ return la_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ }
+ return CosLoadBalancing::Strategy::_nil ();
+}
+
+// void
+// TAO_LB_LoadManager::update_strategy ()
+// {
+// }
+
+// void
+// TAO_LB_LoadManager::deactivate_strategy (ACE_ENV_ARG_DECL)
+// {
+// PortableServer::ObjectId_var oid =
+// this->poa_->reference_to_id (
+// this->poa_->deactivate_object ();
+// }
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadManager.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadManager.h
new file mode 100644
index 00000000000..42ce6c006c4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadManager.h
@@ -0,0 +1,519 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_LoadManager.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_LOAD_MANAGER_H
+#define TAO_LB_LOAD_MANAGER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosLoadBalancingS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+#include "orbsvcs/LoadBalancing/LB_LoadAlertMap.h"
+#include "orbsvcs/LoadBalancing/LB_MonitorMap.h"
+#include "orbsvcs/LoadBalancing/LB_LoadListMap.h"
+#include "orbsvcs/LoadBalancing/LB_Pull_Handler.h"
+
+#include "orbsvcs/PortableGroupC.h"
+
+#include "orbsvcs/PortableGroup/PG_PropertyManager.h"
+#include "orbsvcs/PortableGroup/PG_GenericFactory.h"
+#include "orbsvcs/PortableGroup/PG_ObjectGroupManager.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_LoadBalancing_Export TAO_LB_LoadManager
+ : public virtual POA_CosLoadBalancing::LoadManager
+{
+public:
+
+ /// Constructor.
+ TAO_LB_LoadManager (void);
+
+ /**
+ * @name CosLoadBalancing::LoadManager Methods
+ *
+ * Methods required by the CosLoadBalancing::LoadManager interface.
+ */
+ //@{
+
+ /// For the PUSH load monitoring style.
+ virtual void push_loads (const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the raw loads at the given location.
+ virtual CosLoadBalancing::LoadList * get_loads (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound));
+
+ /// Inform member at given location of load alert condition.
+ virtual void enable_alert (const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CosLoadBalancing::LoadAlertNotFound));
+
+ /// Inform member at given location that load alert condition has
+ /// passed.
+ virtual void disable_alert (const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CosLoadBalancing::LoadAlertNotFound));
+
+ /// Register a LoadAlert object for the member at the given
+ /// location.
+ virtual void register_load_alert (
+ const PortableGroup::Location & the_location,
+ CosLoadBalancing::LoadAlert_ptr load_alert
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LoadAlertAlreadyPresent,
+ CosLoadBalancing::LoadAlertNotAdded));
+
+ /// Retrieve the LoadAlert object for the member at the given
+ /// location.
+ virtual CosLoadBalancing::LoadAlert_ptr get_load_alert (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LoadAlertNotFound));
+
+ /// Remove (de-register) the LoadAlert object for the member at the
+ /// given location.
+ virtual void remove_load_alert (const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LoadAlertNotFound));
+
+ /// Register a load monitor with the load balancer.
+ virtual void register_load_monitor (
+ const PortableGroup::Location & the_location,
+ CosLoadBalancing::LoadMonitor_ptr load_monitor
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::MonitorAlreadyPresent));
+
+ /// Return a reference to the load monitor at the given location.
+ virtual CosLoadBalancing::LoadMonitor_ptr get_load_monitor (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound));
+
+ /// Remove a load monitor at the given location from the load
+ /// balancer.
+ virtual void remove_load_monitor (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound));
+
+ //@}
+
+ /**
+ * @name PortableGroup::PropertyManager Methods
+ *
+ * Methods required by the PortableGroup::PropertyManager interface.
+ */
+ //@{
+
+ /// Set the default properties to be used by all object groups.
+ virtual void set_default_properties (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /// Get the default properties used by all object groups.
+ virtual PortableGroup::Properties * get_default_properties (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Remove default properties.
+ virtual void remove_default_properties (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /// Set properties associated with a given Replica type. These
+ /// properties override the default properties.
+ virtual void set_type_properties (
+ const char * type_id,
+ const PortableGroup::Properties & overrides
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /**
+ * Return the properties associated with a give Replica type. These
+ * properties include the type-specific properties in use, in
+ * addition to the default properties that were not overridden.
+ */
+ virtual PortableGroup::Properties * get_type_properties (
+ const char * type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Remove the given properties associated with the Replica type ID.
+ virtual void remove_type_properties (
+ const char * type_id,
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /**
+ * Dynamically set the properties associated with a given object
+ * group as the load balancer and replicas are being executed.
+ * These properties override the type-specific and default
+ * properties.
+ */
+ virtual void set_properties_dynamically (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Properties & overrides
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /**
+ * Return the properties currently in use by the given object
+ * group. These properties include those that were set dynamically,
+ * type-specific properties that weren't overridden, properties that
+ * were used when the Replica was created, and default properties
+ * that weren't overridden.
+ */
+ virtual PortableGroup::Properties * get_properties (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+ //@}
+
+ /**
+ * @name PortableGroup::ObjectGroupManager methods
+ *
+ * Methods required by the PortableGroup::ObjectGroupManager
+ * interface.
+ */
+ //@{
+
+ /// Create a member using the load balancer ObjectGroupManager, and
+ /// add the created object to the ObjectGroup.
+ virtual PortableGroup::ObjectGroup_ptr create_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::NoFactory,
+ PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::CannotMeetCriteria));
+
+ /// Add an existing object to the ObjectGroup.
+ virtual PortableGroup::ObjectGroup_ptr add_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ CORBA::Object_ptr member
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::ObjectNotAdded));
+
+ /**
+ * Remove an object at a specific location from the given
+ * ObjectGroup. Deletion of application created objects must be
+ * deleted by the application. Objects created by the
+ * infrastructure (load balancer) will be deleted by the
+ * infrastructure.
+ */
+ virtual PortableGroup::ObjectGroup_ptr remove_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound));
+
+ /// Return the locations of the members in the given ObjectGroup.
+ virtual PortableGroup::Locations * locations_of_members (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+ /// Return the locations of the members in the given ObjectGroup.
+ virtual PortableGroup::ObjectGroups * groups_at_location (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the ObjectGroupId for the given ObjectGroup.
+ virtual PortableGroup::ObjectGroupId get_object_group_id (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+ /// @note Does this method make sense for load balanced objects?
+ virtual PortableGroup::ObjectGroup_ptr get_object_group_ref (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+ /// TAO specific method
+ virtual PortableGroup::ObjectGroup_ptr get_object_group_ref_from_id (
+ PortableGroup::ObjectGroupId group_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC((
+ CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+ /// Return the reference corresponding to the Replica of a given
+ /// ObjectGroup at the given location.
+ virtual CORBA::Object_ptr get_member_ref (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & loc
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound));
+
+ //@}
+
+ /**
+ * @name PortableGroup::GenericFactory methods
+ *
+ * Methods required by the PortableGroup::GenericFactory interface.
+ */
+ //@{
+
+ /**
+ * Create an object of the specified type that adheres to the
+ * restrictions defined by the provided Criteria. The out
+ * FactoryCreationId parameter may be passed to the delete_object()
+ * method to delete the object.
+ */
+ 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));
+
+ /**
+ * Delete the object corresponding to the provided
+ * FactoryCreationId. If the object is actually an ObjectGroup,
+ * then all members within the ObjectGroup will be deleted.
+ * Afterward, the ObjectGroup itself will be deleted.
+ */
+ virtual void delete_object (
+ const PortableGroup::GenericFactory::FactoryCreationId &
+ factory_creation_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectNotFound));
+
+ //@}
+
+ /// Return the next member to which client requests will be
+ /// forwarded.
+ /**
+ * Select the next member of the object group corresponding to the
+ * given ObjectId. The object group's load balancing strategy
+ * will be queried for that member.
+ */
+ CORBA::Object_ptr next_member (const PortableServer::ObjectId & oid
+ ACE_ENV_ARG_DECL);
+
+public:
+
+ /// Initialize the load balancer. This will cause a child POA to be
+ /// created with the appropriate policies to support ServantLocators
+ /// (i.e. for the MemberLocator).
+ void init (ACE_Reactor * reactor,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr root_poa
+ ACE_ENV_ARG_DECL);
+
+protected:
+
+ /// Destructor.
+ /**
+ * Destructor is protected to enforce correct memory management
+ * through reference counting.
+ */
+ ~TAO_LB_LoadManager (void);
+
+private:
+
+ /// Extract the value of the InitialNumberReplicas property from
+ /// the_criteria.
+ int get_initial_number_replicas (
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria,
+ CORBA::UShort & initial_number_replicas) const;
+
+ /// Extract the value of the Factories property from the_criteria.
+ /**
+ * This method ensures that the locations in the returned
+ * FactoryInfos are unique. This is necessary to ensure that only
+ * one replica of a given type is created by the load balancer at a
+ * given location.
+ */
+ int get_factory_infos (
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria,
+ PortableGroup::FactoryInfos & factory_infos) const;
+
+ /// Preprocess Strategy or CustomStrategy properties.
+ /**
+ * This method takes care of converting StrategyInfo properties to
+ * Strategy properties, and verifying that CustomStrategy references
+ * are not nil.
+ */
+ void preprocess_properties (PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL);
+
+ /// Create a built-in load balancing strategy and return a reference
+ /// to it.
+ CosLoadBalancing::Strategy_ptr make_strategy (
+ CosLoadBalancing::StrategyInfo * info
+ ACE_ENV_ARG_DECL);
+
+private:
+
+ /// Reactor used when pulling loads from registered load monitors.
+ ACE_Reactor * reactor_;
+
+ /// The POA that dispatches requests to the MemberLocator.
+ PortableServer::POA_var poa_;
+
+ /// The Root POA.
+ PortableServer::POA_var root_poa_;
+
+ /// Mutex that provides synchronization for the LoadMonitor map.
+ TAO_SYNCH_MUTEX monitor_lock_;
+
+ /// Mutex that provides synchronization for the LoadMap table.
+ TAO_SYNCH_MUTEX load_lock_;
+
+ /// Mutex that provides synchronization for the LoadAlert table.
+ TAO_SYNCH_MUTEX load_alert_lock_;
+
+ /// Mutex that provides synchronization for the LoadManager's
+ /// state.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// Table that maps PortableGroup::Location to load monitor at that
+ /// location.
+ TAO_LB_MonitorMap monitor_map_;
+
+ /// Table that maps location to load list.
+ TAO_LB_LoadListMap load_map_;
+
+ /// Table that maps object group and location to LoadAlert object.
+ TAO_LB_LoadAlertMap load_alert_map_;
+
+ /// The ObjectGroupManager that implements the functionality
+ /// necessary for application-controlled object group membership.
+ TAO_PG_ObjectGroupManager object_group_manager_;
+
+ /// The PropertyManager that is reponsible for parsing all criteria,
+ /// and keeping track of property-type_id associations.
+ TAO_PG_PropertyManager property_manager_;
+
+ /// The GenericFactory responsible for creating all object groups.
+ TAO_PG_GenericFactory generic_factory_;
+
+ /// The event handler that performs "pull monitoring" on all
+ /// registered load monitors.
+ TAO_LB_Pull_Handler pull_handler_;
+
+ /// Timer ID corresponding to the timer that fires off the "pull
+ /// monitoring" event handler.
+ long timer_id_;
+
+ /// Cached object reference that points to this servant.
+ CosLoadBalancing::LoadManager_var lm_ref_;
+
+ /// Cached object reference that points to the AMI handler for all
+ /// LoadAlert objects.
+ CosLoadBalancing::AMI_LoadAlertHandler_var load_alert_handler_;
+
+ /**
+ * @name Built-in load balancing strategy implementations
+ *
+ * "Built-in" load balancing strategies defined by the load
+ * balancing specification.
+ */
+ //@{
+ /// The "RoundRobin" load balancing strategy.
+ CosLoadBalancing::Strategy_var round_robin_;
+
+ /// The "Random" load balancing strategy.
+ CosLoadBalancing::Strategy_var random_;
+
+ /// The "LeastLoaded" load balancing strategy.
+ CosLoadBalancing::Strategy_var least_loaded_;
+
+ /// The "LoadMinimum" load balancing strategy.
+ CosLoadBalancing::Strategy_var load_minimum_;
+
+ /// The "LoadAverage" load balancing strategy.
+ CosLoadBalancing::Strategy_var load_average_;
+ //@}
+
+ /// Cached instance of the Property name
+ /// "org.omg.CosLoadBalancing.StrategyInfo".
+ PortableGroup::Name built_in_balancing_strategy_info_name_;
+
+ /// Cached instance of the Property name
+ /// "org.omg.CosLoadBalancing.Strategy".
+ PortableGroup::Name built_in_balancing_strategy_name_;
+
+ /// Cached instance of the Property name
+ /// "org.omg.CosLoadBalancing.CustomStrategy".
+ PortableGroup::Name custom_balancing_strategy_name_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_LOAD_MANAGER_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMap.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMap.h
new file mode 100644
index 00000000000..2e75bbba1f3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMap.h
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+
+//=======================================================================
+/**
+ * @file LB_LoadMap.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=======================================================================
+
+
+#ifndef TAO_LB_LOAD_MAP_H
+#define TAO_LB_LOAD_MAP_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosLoadBalancingC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroupC.h"
+
+#include "orbsvcs/PortableGroup/PG_Location_Hash.h"
+#include "orbsvcs/PortableGroup/PG_Location_Equal_To.h"
+
+#include "ace/Hash_Map_Manager_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Load hash map.
+typedef ACE_Hash_Map_Manager_Ex<
+ PortableGroup::Location,
+ CosLoadBalancing::Load,
+ TAO_PG_Location_Hash,
+ TAO_PG_Location_Equal_To,
+ ACE_Null_Mutex> TAO_LB_LoadMap;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_LOAD_MAP_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.cpp
new file mode 100644
index 00000000000..b271606a0fb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.cpp
@@ -0,0 +1,664 @@
+#include "orbsvcs/LoadBalancing/LB_LoadMinimum.h"
+#include "ace/OS_NS_sys_time.h"
+#include "orbsvcs/LoadBalancing/LB_LoadMap.h"
+#include "orbsvcs/LoadBalancing/LB_Random.h"
+
+#include "orbsvcs/PortableGroup/PG_conf.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+
+#include "ace/Null_Mutex.h"
+#include "ace/OS_NS_string.h"
+
+
+ACE_RCSID (LoadBalancing,
+ LB_LoadMinimum,
+ "$Id$")
+
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/LoadBalancing/LB_LoadMinimum.inl"
+#endif /* defined INLINE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LB_LoadMinimum::TAO_LB_LoadMinimum (PortableServer::POA_ptr poa)
+ : poa_ (PortableServer::POA::_duplicate (poa)),
+ load_map_ (0),
+ lock_ (0),
+ properties_ (),
+ tolerance_ (TAO_LB::LM_DEFAULT_TOLERANCE),
+ dampening_ (TAO_LB::LM_DEFAULT_DAMPENING),
+ per_balance_load_ (TAO_LB::LM_DEFAULT_DAMPENING)
+{
+ // A load map that retains previous load values at a given location
+ // and lock are only needed if dampening is enabled, i.e. non-zero.
+ if (this->dampening_ != 0)
+ {
+ ACE_NEW (this->load_map_, TAO_LB_LoadMap (TAO_PG_MAX_LOCATIONS));
+
+ ACE_NEW (this->lock_, TAO_SYNCH_MUTEX);
+ }
+
+ // Initialize the random load balancing strategy.
+ TAO_LB_Random::init ();
+}
+
+TAO_LB_LoadMinimum::~TAO_LB_LoadMinimum (void)
+{
+ delete this->load_map_;
+ delete this->lock_;
+}
+
+char *
+TAO_LB_LoadMinimum::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("LoadMinimum");
+}
+
+CosLoadBalancing::Properties *
+TAO_LB_LoadMinimum::get_properties (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosLoadBalancing::Properties * props = 0;
+ ACE_NEW_THROW_EX (props,
+ CosLoadBalancing::Properties (this->properties_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ return props;
+}
+
+void
+TAO_LB_LoadMinimum::push_loads (
+ const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Only the first load is used by this load balancing strategy.
+ if (loads.length () == 0)
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ CosLoadBalancing::Load load; // Unused
+
+ this->push_loads (the_location,
+ loads,
+ load
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_LB_LoadMinimum::push_loads (
+ const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads,
+ CosLoadBalancing::Load & load
+ ACE_ENV_ARG_DECL)
+{
+ if (loads.length () == 0)
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ // Only the first load is used by this load balancing strategy.
+ const CosLoadBalancing::Load & new_load = loads[0];
+
+ if (this->load_map_ != 0)
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, *this->lock_);
+
+ TAO_LB_LoadMap::ENTRY * entry;
+ if (this->load_map_->find (the_location, entry) == 0)
+ {
+ CosLoadBalancing::Load & previous_load = entry->int_id_;
+
+ if (previous_load.id != new_load.id)
+ ACE_THROW (CORBA::BAD_PARAM ()); // Somebody switched
+ // LoadIds on us!
+
+ previous_load.value =
+ this->effective_load (previous_load.value, new_load.value);
+
+ load = previous_load;
+ }
+ else
+ {
+ const CosLoadBalancing::Load eff_load =
+ {
+ new_load.id,
+ this->effective_load (0, new_load.value)
+ };
+
+ if (this->load_map_->bind (the_location, eff_load) != 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: TAO_LB_LoadMinimum - "
+ "Unable to push loads\n"));
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ load = eff_load;
+ }
+ }
+ else
+ {
+ load.id = new_load.id;
+ load.value = this->effective_load (0, new_load.value);
+ }
+}
+
+CosLoadBalancing::LoadList *
+TAO_LB_LoadMinimum::get_loads (CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound))
+{
+ if (CORBA::is_nil (load_manager))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);
+
+ CosLoadBalancing::LoadList_var loads =
+ load_manager->get_loads (the_location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->push_loads (the_location,
+ loads.in (),
+ loads[0]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return loads._retn ();
+}
+
+
+CORBA::Object_ptr
+TAO_LB_LoadMinimum::next_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound))
+{
+ if (CORBA::is_nil (load_manager))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ CORBA::Object::_nil ());
+
+ PortableGroup::Locations_var locations =
+ load_manager->locations_of_members (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ if (locations->length () == 0)
+ ACE_THROW_RETURN (CORBA::TRANSIENT (),
+ CORBA::Object::_nil ());
+
+ // @@ RACE CONDITION. OBJECT GROUP MEMBERSHIP MAY CHANGE AFTER
+ // RETRIEVING LOCATIONS! HOW DO WE HANDLE THAT?
+
+ PortableGroup::Location location;
+ CORBA::Boolean found_location =
+ this->get_location (load_manager,
+ locations.in (),
+ location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ if (found_location)
+ {
+/*
+ ACE_DEBUG ((LM_DEBUG,
+ "RETURNING REFERENCE FOR LOCATION \"%s\"\n",
+ location[0].id.in ()));
+*/
+
+ return load_manager->get_member_ref (object_group,
+ location
+ ACE_ENV_ARG_PARAMETER);
+ }
+ else
+ {
+ // No loads have been reported for any of the locations the
+ // object group members reside at. If no loads have been
+ // reported to the LoadManager, adaptive load balancing
+ // decisions cannot be made. Fall back on a non-adaptive
+ // strategy, such as the Random load balancing strategy,
+ // instead.
+ //
+ // @note The Random load balancing strategy is used since it is
+ // very lightweight and stateless.
+/*
+ ACE_DEBUG ((LM_DEBUG,
+ "CALLING RANDOM REFERENCE FOR LOCATION \n"));
+*/
+
+ return TAO_LB_Random::_tao_next_member (object_group,
+ load_manager,
+ locations.in ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+void
+TAO_LB_LoadMinimum::analyze_loads (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (CORBA::is_nil (load_manager))
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ PortableGroup::Locations_var locations =
+ load_manager->locations_of_members (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (locations->length () == 0)
+ ACE_THROW (CORBA::TRANSIENT ());
+
+ const CORBA::ULong len = locations->length ();
+
+ CosLoadBalancing::Load total_load = { 0, 0 };
+ CosLoadBalancing::Load avg_load = { 0, 0 };
+
+ CORBA::Float min_load = FLT_MAX;
+
+ CosLoadBalancing::LoadList tmp (len);
+ tmp.length (1);
+
+ // Iterate through the entire location list to determine
+ // the average load of all the locations
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ ACE_TRY
+ {
+ const PortableGroup::Location & loc = locations[i];
+
+ // Retrieve the load list for the location from the
+ // LoadManager and push it to this Strategy's load
+ // processor.
+ CosLoadBalancing::LoadList_var current_loads =
+ load_manager->get_loads (loc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosLoadBalancing::Load load;
+ this->push_loads (loc,
+ current_loads.in (),
+ load
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ total_load.value = total_load.value + load.value;
+ tmp[i] = load;
+
+ if ((load.value < min_load) && (load.value != 0))
+ {
+ min_load = load.value;
+ }
+
+ /*
+ ACE_DEBUG ((LM_DEBUG,
+ "TOTAL == %f\n",
+ total_load.value));
+ */
+
+ }
+ ACE_CATCH (CosLoadBalancing::LocationNotFound, ex)
+ {
+ // no location found
+ //
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+
+ avg_load.value = total_load.value / len;
+/*
+ ACE_DEBUG ((LM_DEBUG,
+ "AVERAGE LOAD == %f"
+ "\tMIN LOAD == %f\n",
+ avg_load.value,
+ min_load));
+*/
+
+ // Iterate through the entire location list to determine
+ // the location where the load has to be shed.
+ for (CORBA::ULong j = 0; j < len; ++j)
+ {
+ ACE_TRY_EX (SECOND)
+ {
+ const PortableGroup::Location & loc = locations[j];
+
+ /*
+ ACE_DEBUG ((LM_DEBUG,
+ "EFFECTIVE_LOAD == %f\n"
+ "AVERAGE == %f\n",
+ tmp[i].value,
+ avg_load.value));
+ */
+
+ if (tmp[j].value <= avg_load.value)
+ {
+ load_manager->disable_alert (loc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (SECOND);
+ }
+ else
+ {
+
+ CORBA::Float percent_diff =
+ (tmp[j].value / min_load) - 1;
+
+ if (tmp[j].value == min_load)
+ {
+ percent_diff = 0;
+ }
+/*
+ ACE_DEBUG ((LM_DEBUG,
+ "ALERT LOC == %u"
+ "\tMIN LOAD == %f\n"
+ "\tLOAD == %f\n"
+ "\tPERCENT == %f\n",
+ i,
+ min_load,
+ tmp[i].value,
+ percent_diff));
+*/
+
+ if (percent_diff <= TAO_LB::LM_DEFAULT_DIFF_AVERAGE_CUTOFF)
+ {
+ load_manager->disable_alert (loc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (SECOND);
+ }
+ else if ((percent_diff > TAO_LB::LM_DEFAULT_DIFF_AVERAGE_CUTOFF)
+ && (percent_diff < 1))
+ {
+/*
+ ACE_DEBUG ((LM_DEBUG,
+ "%P --- ALERTING LOCATION %u\n",
+ i));
+*/
+ load_manager->enable_alert (loc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (SECOND);
+ }
+ }
+ }
+ ACE_CATCH (CosLoadBalancing::LocationNotFound, ex)
+ {
+ // no location found
+ //
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+
+}
+
+PortableServer::POA_ptr
+TAO_LB_LoadMinimum::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
+
+CORBA::Boolean
+TAO_LB_LoadMinimum::get_location (
+ CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Locations & locations,
+ PortableGroup::Location & location
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Float min_load = FLT_MAX; // Start out with the largest
+ // positive value.
+
+ CORBA::ULong location_index = 0;
+ CORBA::Boolean found_location = 0;
+ CORBA::Boolean found_load = 0;
+
+ const CORBA::ULong len = locations.length ();
+
+ // Iterate through the entire location list to find the least loaded
+ // of them.
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ ACE_TRY
+ {
+ const PortableGroup::Location & loc = locations[i];
+
+ // Retrieve the load list for the location from the LoadManager
+ // and push it to this Strategy's load processor.
+ CosLoadBalancing::LoadList_var current_loads =
+ load_manager->get_loads (loc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ found_load = 1;
+
+ CosLoadBalancing::Load load;
+ this->push_loads (loc,
+ current_loads.in (),
+ load
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+/*
+ ACE_DEBUG ((LM_DEBUG,
+ "LOC == %u"
+ "\tMIN LOAD == %f\n"
+ "\tLOAD == %f\n",
+ i,
+ min_load,
+ load.value));
+*/
+ if (load.value < min_load)
+ {
+
+ if (i > 0 && load.value != 0)
+ {
+ /*
+ percent difference =
+ (min_load - load.value) / load.value
+ == (min_load / load.value) - 1
+
+ The latter form is used to avoid a potential
+ arithmetic overflow problem, such as when
+ (min_load - load.value) > FLT_MAX, assuming that
+ either load.value is negative and min_load is
+ positive, or vice versa.
+ */
+ const CORBA::Float percent_diff =
+ (min_load / load.value) - 1;
+ /*
+ A "thundering herd" phenomenon may occur when
+ location loads are basically the same (e.g. only
+ differ by a very small amount), where one object
+ group member ends up receiving the majority of
+ requests from different clients. In order to
+ prevent a single object group member from
+ receiving such request bursts, one of two equally
+ loaded locations is chosen at random. Thanks to
+ Carlos, Marina and Jody at ATD for coming up with
+ this solution to this form of the thundering herd
+ problem.
+
+ See the documentation for
+ TAO_LB::LL_DEFAULT_LOAD_PERCENT_DIFF_CUTOFF in
+ LB_LoadMinimum.h for additional information.
+ */
+ if (percent_diff <= TAO_LB::LM_DEFAULT_LOAD_PERCENT_DIFF_CUTOFF)
+ {
+ // Prevent integer arithmetic overflow.
+ const CORBA::Float NUM_MEMBERS = 2;
+
+ // n == 0: Use previously selected location.
+ // n == 1: Use current location.
+ const CORBA::ULong n =
+ static_cast<CORBA::ULong> (NUM_MEMBERS * ACE_OS::rand ()
+ / (RAND_MAX + 1.0));
+
+ ACE_ASSERT (n == 0 || n == 1);
+
+ if (n == 1)
+ {
+ min_load = load.value;
+ location_index = i;
+ found_location = 1;
+
+// ACE_DEBUG ((LM_DEBUG,
+// "** NEW MIN_LOAD == %f\n",
+// min_load));
+ }
+
+// if (n == 0)
+// ACE_DEBUG ((LM_DEBUG, "^^^^^ PREVIOUS LOCATION\n"));
+// else
+// ACE_DEBUG ((LM_DEBUG, "^^^^^ CURRENT LOCATION\n"));
+
+ }
+ else
+ {
+ min_load = load.value;
+ location_index = i;
+ found_location = 1;
+
+// ACE_DEBUG ((LM_DEBUG,
+// "***** NEW MIN_LOAD == %f\n",
+// min_load));
+ }
+ }
+ else
+ {
+ min_load = load.value;
+ location_index = i;
+ found_location = 1;
+
+// ACE_DEBUG ((LM_DEBUG,
+// "NEW MIN_LOAD == %f\n",
+// min_load));
+ }
+ }
+
+ // ACE_DEBUG ((LM_DEBUG, "NEW MIN_LOAD == %f\n", min_load));
+ }
+ ACE_CATCH (CosLoadBalancing::LocationNotFound, ex)
+ {
+ // No load available for the requested location. Try the
+ // next location.
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ }
+
+// ACE_DEBUG ((LM_DEBUG,
+// "FOUND_LOAD == %u\n"
+// "FOUND_LOCATION == %u\n",
+// found_load,
+// found_location));
+
+ // If no loads were found, return without an exception to allow this
+ // strategy to select a member using an alternative method
+ // (e.g. random selection).
+ if (found_load)
+ {
+ if (found_location)
+ {
+ location = locations[location_index];
+ //ACE_DEBUG ((LM_DEBUG, "LOCATED = %u\n", location_index));
+ }
+ }
+
+ //ACE_DEBUG ((LM_DEBUG, "LOCATED = %u\n", location_index));
+
+ return found_location;
+}
+
+void
+TAO_LB_LoadMinimum::init (const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Float tolerance = TAO_LB::LM_DEFAULT_TOLERANCE;
+ CORBA::Float dampening = TAO_LB::LM_DEFAULT_DAMPENING;
+ CORBA::Float per_balance_load = TAO_LB::LM_DEFAULT_PER_BALANCE_LOAD;
+
+ const CORBA::ULong len = props.length ();
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ const PortableGroup::Property & property = props[i];
+ if (ACE_OS::strcmp (property.nam[0].id.in (),
+ "org.omg.CosLoadBalancing.Strategy.LoadMinimum.Tolerance") == 0)
+ {
+ this->extract_float_property (property,
+ tolerance
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Valid tolerance values are greater than or equal to one.
+ if (tolerance < 1)
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+
+ else if (ACE_OS::strcmp (property.nam[0].id.in (),
+ "org.omg.CosLoadBalancing.Strategy.LoadMinimum.Dampening") == 0)
+ {
+ this->extract_float_property (property,
+ dampening
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Dampening range is [0,1).
+ if (dampening < 0 || dampening >= 1)
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+
+ else if (ACE_OS::strcmp (property.nam[0].id.in (),
+ "org.omg.CosLoadBalancing.Strategy.LoadMinimum.PerBalanceLoad") == 0)
+ {
+ this->extract_float_property (property,
+ per_balance_load
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+
+ this->properties_ = props;
+
+ this->tolerance_ = tolerance;
+ this->dampening_ = dampening;
+ this->per_balance_load_ = per_balance_load;
+
+ /*
+ ACE_DEBUG ((LM_DEBUG,
+ "--------------------------------\n"
+ "tolerance = %f\n"
+ "dampening = %f\n"
+ "per_balance_load = %f\n"
+ "--------------------------------\n",
+ tolerance,
+ dampening,
+ per_balance_load));
+ */
+}
+
+void
+TAO_LB_LoadMinimum::extract_float_property (
+ const PortableGroup::Property & property,
+ CORBA::Float & value
+ ACE_ENV_ARG_DECL)
+{
+ if (!(property.val >>= value))
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.h
new file mode 100644
index 00000000000..c979845aa0c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.h
@@ -0,0 +1,208 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_LoadMinimum.h
+ *
+ * $Id$
+ *
+ * @author Jaiganesh Balasubramanian <jai@dre.vanderbilt.edu>
+ * Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef LB_LOAD_MINIMUM_H
+#define LB_LOAD_MINIMUM_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/LoadBalancing/LB_LoadMap.h"
+
+# if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+# endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosLoadBalancingS.h"
+
+#include "ace/Synch_Traits.h"
+#include "ace/Thread_Mutex.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_LB
+{
+ /**
+ * @name Default LoadMinimum strategy parameters.
+ *
+ * Defaults defined by the Load Balancing specification.
+ */
+ //@{
+ const CORBA::Float LM_DEFAULT_TOLERANCE = 1;
+ const CORBA::Float LM_DEFAULT_DAMPENING = 0;
+ const CORBA::Float LM_DEFAULT_PER_BALANCE_LOAD = 0;
+ //@}
+
+ /**
+ * @name TAO-specific LoadMinimum strategy parameters.
+ *
+ * Parameters internal to TAO's LoadMinimum strategy
+ * implementation.
+ */
+ //@{
+ /// Percentage difference between two load values that determines
+ /// whether the loads are considered equivalent.
+ /**
+ * If the percent difference between two loads, i.e.:
+ * (Old Load - New Load) / New Load
+ * is less than or equal to this value, the two loads will be
+ * considered equivalent. In such a case, an object group member
+ * residing at the location corresponding to one of the two loads
+ * will be selected at random.
+ */
+ const CORBA::Float LM_DEFAULT_LOAD_PERCENT_DIFF_CUTOFF = 0.05f; // 1%
+ const CORBA::Float LM_DEFAULT_DIFF_AVERAGE_CUTOFF = 0.4f; // 80%
+ //@}
+}
+
+/**
+ * @class TAO_LB_LoadMinimum
+ *
+ * @brief "Least loaded" load balancing strategy
+ *
+ * This load balancing strategy is designed to select an object group
+ * member residing at a location with the smallest load.
+ */
+class TAO_LB_LoadMinimum
+ : public virtual POA_CosLoadBalancing::Strategy
+{
+public:
+
+ /// Constructor.
+ TAO_LB_LoadMinimum (PortableServer::POA_ptr poa);
+
+ /**
+ * @name CosLoadBalancing::Strategy methods
+ *
+ * Methods required by the CosLoadBalancing::Strategy interface.
+ */
+ //@{
+ virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosLoadBalancing::Properties * get_properties (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void push_loads (
+ const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosLoadBalancing::LoadList * get_loads (
+ CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound));
+
+ virtual CORBA::Object_ptr next_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound));
+
+ virtual void analyze_loads (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ /// Returns the default POA for this servant.
+ virtual PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ /// Initialize the LoadMinimum instance with the given properties.
+ void init (const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL);
+
+protected:
+
+ /// Destructor.
+ ~TAO_LB_LoadMinimum (void);
+
+ /// Retrieve the least loaded location from the given list of
+ /// locations.
+ CORBA::Boolean get_location (CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Locations & locations,
+ PortableGroup::Location & location
+ ACE_ENV_ARG_DECL);
+
+ /// Return the effective load.
+ CORBA::Float effective_load (CORBA::Float previous_load,
+ CORBA::Float new_load);
+
+ /// Push the new load into this Strategy's load processor, and
+ /// return the corresponding effective load.
+ void push_loads (
+ const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads,
+ CosLoadBalancing::Load & effective_load
+ ACE_ENV_ARG_DECL);
+
+ /// Utility method to extract a CORBA::Float value from the given
+ /// property.
+ void extract_float_property (const PortableGroup::Property & property,
+ CORBA::Float & value
+ ACE_ENV_ARG_DECL);
+
+private:
+
+ /// This servant's default POA.
+ PortableServer::POA_var poa_;
+
+ /// Table that maps location to load list.
+ TAO_LB_LoadMap * load_map_;
+
+ /// Lock used to ensure atomic access to state retained by this
+ /// class.
+ TAO_SYNCH_MUTEX * lock_;
+
+ /// Cached set of properties used when initializing this strategy.
+ CosLoadBalancing::Properties properties_;
+
+ /**
+ * @name LoadMinimum Property Values
+ *
+ * Cached LoadMinimum load balancing strategy property values.
+ */
+ //@{
+
+ ///
+ CORBA::Float tolerance_;
+
+ ///
+ CORBA::Float dampening_;
+
+ ///
+ CORBA::Float per_balance_load_;
+
+ //@}
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/LoadBalancing/LB_LoadMinimum.inl"
+#endif /* defined INLINE */
+
+#include /**/ "ace/post.h"
+
+#endif /* LB_LOAD_MINIMUM_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.inl b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.inl
new file mode 100644
index 00000000000..dc120b38783
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.inl
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE CORBA::Float
+TAO_LB_LoadMinimum::effective_load (CORBA::Float previous_load,
+ CORBA::Float new_load)
+{
+ // Apply per-balance load. (Recompute raw load)
+ previous_load += this->per_balance_load_;
+
+ // Apply dampening. (Recompute new raw load)
+ CORBA::Float result =
+ this->dampening_ * previous_load + (1 - this->dampening_) * new_load;
+
+ ACE_ASSERT (this->tolerance_ != 0);
+
+ // Compute the effective load.
+ result /= this->tolerance_;
+
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Location_Index_Map.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Location_Index_Map.h
new file mode 100644
index 00000000000..a08694dd2d0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Location_Index_Map.h
@@ -0,0 +1,44 @@
+// -*- C++ -*-
+
+//=======================================================================
+/**
+ * @file LB_Location_Index_Map.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=======================================================================
+
+
+#ifndef TAO_LB_LOCATION_INDEX_MAP_H
+#define TAO_LB_LOCATION_INDEX_MAP_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosLoadBalancingC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroupC.h"
+
+#include "ace/Functor.h"
+#include "ace/Hash_Map_Manager_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Location index map.
+typedef ACE_Hash_Map_Manager_Ex<
+ PortableGroup::ObjectGroupId,
+ CORBA::ULong,
+ ACE_Hash<ACE_UINT64>,
+ ACE_Equal_To<ACE_UINT64>,
+ ACE_Null_Mutex> TAO_LB_Location_Index_Map;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_LOCATION_INDEX_MAP_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_MemberLocator.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_MemberLocator.cpp
new file mode 100644
index 00000000000..31c4e10977e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_MemberLocator.cpp
@@ -0,0 +1,76 @@
+#include "orbsvcs/LoadBalancing/LB_LoadManager.h"
+#include "orbsvcs/LoadBalancing/LB_MemberLocator.h"
+
+#include "tao/debug.h"
+
+
+ACE_RCSID (LoadBalancing,
+ LB_MemberLocator,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LB_MemberLocator::TAO_LB_MemberLocator (
+ TAO_LB_LoadManager * lm)
+ : load_manager_ (lm)
+{
+ ACE_ASSERT (lm != 0);
+}
+
+PortableServer::Servant
+TAO_LB_MemberLocator::preinvoke (
+ const PortableServer::ObjectId & oid,
+ PortableServer::POA_ptr /* adapter */,
+ const char * /* operation */,
+ PortableServer::ServantLocator::Cookie & /* the_cookie */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::ForwardRequest))
+{
+ ACE_TRY
+ {
+ CORBA::Object_var member =
+ this->load_manager_->next_member (oid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+// ACE_DEBUG ((LM_DEBUG, "%N:%l\n"));
+// ACE_DEBUG ((LM_DEBUG,
+// "FORWARDED\n"));
+
+ ACE_ASSERT (!CORBA::is_nil (member.in ()));
+ // Throw a forward exception to force the client to redirect its
+ // requests to the member chosen by the LoadBalancer.
+ ACE_TRY_THROW (PortableServer::ForwardRequest (member.in ()));
+ }
+ ACE_CATCH (PortableGroup::ObjectGroupNotFound, ex)
+ {
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ex,
+ "LoadManager::next_member()");
+ }
+ ACE_CATCH (PortableGroup::MemberNotFound, ex)
+ {
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ex,
+ "LoadManager::next_member()");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (), 0);
+}
+
+void
+TAO_LB_MemberLocator::postinvoke (
+ const PortableServer::ObjectId & /* oid */,
+ PortableServer::POA_ptr /* adapter */,
+ const char * /* operation */,
+ PortableServer::ServantLocator::Cookie /* the_cookie */,
+ PortableServer::Servant /* the_servant */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_MemberLocator.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_MemberLocator.h
new file mode 100644
index 00000000000..e376937f0a5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_MemberLocator.h
@@ -0,0 +1,92 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_MemberLocator.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_MEMBER_LOCATOR_H
+#define TAO_LB_MEMBER_LOCATOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+
+# if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+# endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PortableServer/ServantLocatorC.h"
+#include "tao/LocalObject.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward declarations.
+class TAO_LB_LoadManager;
+
+/**
+ * @class TAO_LB_MemberLocator
+ *
+ * @brief ServantLocator implementation for the Load Balancer.
+ *
+ * This is a Servant Locator implementation that forwards requests to
+ * a member returned by the Load Balancer.
+ */
+class TAO_LB_MemberLocator
+ : public virtual PortableServer::ServantLocator,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor
+ TAO_LB_MemberLocator (TAO_LB_LoadManager * load_balancer);
+
+ /**
+ * @name The PortableServer::ServantLocator methods.
+ *
+ * Methods required by the PortableServer::ServantLocator
+ * interface.
+ */
+ //@{
+
+ /// Clients requests are forwarded via the
+ /// PortableServer::ForwardRequest exception thrown in this method.
+ virtual PortableServer::Servant preinvoke (
+ const PortableServer::ObjectId & oid,
+ PortableServer::POA_ptr adapter,
+ const char * operation,
+ PortableServer::ServantLocator::Cookie & the_cookie
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::ForwardRequest));
+
+ /// This method is no-op in this ServantLocator implementation.
+ virtual void postinvoke (
+ const PortableServer::ObjectId &oid,
+ PortableServer::POA_ptr adapter,
+ const char * operation,
+ PortableServer::ServantLocator::Cookie the_cookie,
+ PortableServer::Servant the_servant
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ //@}
+
+private:
+
+ /// The load balancer/manager implementation.
+ TAO_LB_LoadManager * load_manager_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_MEMBER_LOCATOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_MonitorMap.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_MonitorMap.h
new file mode 100644
index 00000000000..02b8f12adeb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_MonitorMap.h
@@ -0,0 +1,42 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_MonitorMap.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_MONITOR_MAP_H
+#define TAO_LB_MONITOR_MAP_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosLoadBalancingC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroup/PG_Location_Hash.h"
+#include "orbsvcs/PortableGroup/PG_Location_Equal_To.h"
+
+#include "ace/Hash_Map_Manager_T.h"
+
+
+/// Load monitor hash map.
+typedef ACE_Hash_Map_Manager_Ex<
+ PortableGroup::Location,
+ CosLoadBalancing::LoadMonitor_var,
+ TAO_PG_Location_Hash,
+ TAO_PG_Location_Equal_To,
+ ACE_Null_Mutex> TAO_LB_MonitorMap;
+
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_MONITOR_MAP_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.cpp
new file mode 100644
index 00000000000..e7e7eeb4443
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.cpp
@@ -0,0 +1,94 @@
+#include "orbsvcs/LoadBalancing/LB_ORBInitializer.h"
+#include "orbsvcs/LoadBalancing/LB_IORInterceptor.h"
+#include "orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.h"
+
+#include "orbsvcs/CosLoadBalancingC.h"
+
+#include "tao/ORB_Constants.h"
+
+ACE_RCSID (LoadBalancing,
+ LB_ORBInitializer,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LB_ORBInitializer::TAO_LB_ORBInitializer (
+ const CORBA::StringSeq & object_groups,
+ const CORBA::StringSeq & repository_ids,
+ const char * location)
+ : object_groups_ (object_groups),
+ repository_ids_ (repository_ids),
+ location_ (location),
+ load_alert_ ()
+{
+}
+
+void
+TAO_LB_ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_LB_ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Object_var obj =
+ info->resolve_initial_references ("LoadManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosLoadBalancing::LoadManager_var lm =
+ CosLoadBalancing::LoadManager::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::String_var orbid = info->orb_id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableInterceptor::IORInterceptor_ptr tmp;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_LB_IORInterceptor (this->object_groups_,
+ this->repository_ids_,
+ this->location_.in (),
+ lm.in (),
+ orbid.in (),
+ this->load_alert_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableInterceptor::IORInterceptor_var ior_interceptor = tmp;
+
+ info->add_ior_interceptor (ior_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // ----------------
+
+ PortableInterceptor::ServerRequestInterceptor_ptr sri;
+ ACE_NEW_THROW_EX (sri,
+ TAO_LB_ServerRequestInterceptor (this->load_alert_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableInterceptor::ServerRequestInterceptor_var sr_interceptor = sri;
+
+ info->add_server_request_interceptor (sr_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.h
new file mode 100644
index 00000000000..292e36558ab
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.h
@@ -0,0 +1,110 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_ORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_ORB_INITIALIZER_H
+#define TAO_LB_ORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/LoadBalancing/LB_LoadAlert.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PI/PI.h"
+#include "tao/LocalObject.h"
+#include "tao/Versioned_Namespace.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_LB_ORBInitializer
+ *
+ * @brief ORBInitializer for the LB_Component Service_Object.
+ *
+ * This ORBInitializer simply creates and registers with the ORB the
+ * IORInterceptor that handles transparent object group member
+ * registration with the LoadManager, and registration of the
+ * LoadAlert object necessary for load shedding.
+ *
+ * @par
+ *
+ * It also creates and registers the ServerRequestInterceptor that
+ * facilitates load shedding.
+ */
+class TAO_LB_ORBInitializer
+ : public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ TAO_LB_ORBInitializer (const CORBA::StringSeq & object_groups,
+ const CORBA::StringSeq & repository_ids,
+ const char * location);
+
+ /**
+ * @name PortableInterceptor::ORBInitializer Methods
+ *
+ * Methods required by the PortableInterceptor::ORBInitializer
+ * interface.
+ */
+ //@{
+ 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:
+
+ /// List of stringified object group references.
+ const CORBA::StringSeq object_groups_;
+
+ /// List of RepositoryIds for object that will be load
+ /// managed/balanced.
+ const CORBA::StringSeq repository_ids_;
+
+ /// Location at which the LoadBalancing component resides.
+ CORBA::String_var location_;
+
+ /// The CosLoadBalancing::LoadAlert servant to be used at this
+ /// location.
+ /**
+ * This is the servant supplied by TAO's Load Balancer. It is
+ * used out of convencience.
+ */
+ TAO_LB_LoadAlert load_alert_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_ORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectReferenceFactory.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectReferenceFactory.cpp
new file mode 100644
index 00000000000..d70b23fa4f1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectReferenceFactory.cpp
@@ -0,0 +1,258 @@
+#include "orbsvcs/LoadBalancing/LB_ObjectReferenceFactory.h"
+
+ACE_RCSID (LoadBalancing,
+ LB_ObjectReferenceFactory,
+ "$Id$")
+
+#include "tao/debug.h"
+
+#include "ace/SString.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/OS_NS_string.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// The number of different object groups to support.
+#ifndef TAO_LB_ORF_GROUP_TABLE_SIZE
+const size_t TAO_LB_ORF_GROUP_TABLE_SIZE = 16;
+#endif /* TAO_LB_ORF_GROUP_TABLE_SIZE */
+
+TAO_LB_ObjectReferenceFactory::TAO_LB_ObjectReferenceFactory (
+ PortableInterceptor::ObjectReferenceFactory * old_orf,
+ const CORBA::StringSeq & object_groups,
+ const CORBA::StringSeq & repository_ids,
+ const char * location,
+ CORBA::ORB_ptr orb,
+ CosLoadBalancing::LoadManager_ptr lm)
+ : old_orf_ (old_orf),
+ object_groups_ (object_groups),
+ repository_ids_ (repository_ids),
+ location_ (1),
+ table_ (TAO_LB_ORF_GROUP_TABLE_SIZE),
+ fcids_ (),
+ orb_ (CORBA::ORB::_duplicate (orb)),
+ lm_ (CosLoadBalancing::LoadManager::_duplicate (lm)),
+ registered_members_ (0)
+{
+ // Claim ownership of the old ObjectReferenceFactory.
+ CORBA::add_ref (old_orf);
+
+ this->location_.length (1);
+ this->location_[0].id = CORBA::string_dup (location);
+
+ const CORBA::ULong len = repository_ids.length ();
+ ACE_NEW (this->registered_members_,
+ CORBA::Boolean[len]);
+
+ ACE_ASSERT (this->registered_members_ != 0);
+ ACE_OS::memset (this->registered_members_,
+ 0,
+ len * sizeof (CORBA::Boolean));
+}
+
+TAO_LB_ObjectReferenceFactory::~TAO_LB_ObjectReferenceFactory (void)
+{
+ // No need to call CORBA::remove_ref() on this->old_orf_. It is a
+ // "_var" object, meaning that will be done automatically.
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ if (!CORBA::is_nil (this->lm_.in ()))
+ {
+ const CORBA::ULong len = this->fcids_.size ();
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ ACE_TRY
+ {
+ // Clean up all object groups we created.
+ this->lm_->delete_object (this->fcids_[i].in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions.
+ }
+ ACE_ENDTRY;
+ }
+ }
+
+ // @todo De-register LoadAlert objects.
+ // @todo De-register object group members.
+
+ delete [] this->registered_members_;
+}
+
+CORBA::Object_ptr
+TAO_LB_ObjectReferenceFactory::make_object (
+ const char * repository_id,
+ const PortableInterceptor::ObjectId & id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (repository_id == 0)
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), CORBA::Object::_nil ());
+
+ CORBA::Object_var obj =
+ this->old_orf_->make_object (repository_id,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ PortableGroup::ObjectGroup_var object_group;
+
+ CORBA::ULong index = 0;
+
+ const CORBA::Boolean found_group =
+ this->find_object_group (repository_id,
+ index,
+ object_group.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ if (found_group)
+ {
+ // Be careful not to attempt duplicate registrations on
+ // subsequent object reference creation calls.
+ if (!this->registered_members_[index])
+ {
+ ACE_TRY
+ {
+ object_group =
+ this->lm_->add_member (object_group.in (),
+ this->location_,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (PortableGroup::ObjectGroupNotFound, ex)
+ {
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ex,
+ "TAO_LB_ObjectReferenceFactory::"
+ "make_object");
+
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ CORBA::Object::_nil ());
+ }
+ ACE_CATCH (PortableGroup::MemberAlreadyPresent, ex)
+ {
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ex,
+ "TAO_LB_ObjectReferenceFactory::"
+ "make_object");
+
+ ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (),
+ CORBA::Object::_nil ());
+
+ }
+ ACE_CATCH (PortableGroup::ObjectNotAdded, ex)
+ {
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ex,
+ "TAO_LB_ObjectReferenceFactory::"
+ "make_object");
+
+ ACE_THROW_RETURN (CORBA::UNKNOWN (),
+ CORBA::Object::_nil ());
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ this->registered_members_[index] = 1;
+ }
+
+ // Return the object group reference instead.
+ return object_group._retn ();
+ }
+
+ // Not a load managed object. Simply return the object's actual
+ // object reference.
+ return obj._retn ();
+}
+
+CORBA::Boolean
+TAO_LB_ObjectReferenceFactory::find_object_group (
+ const char * repository_id,
+ CORBA::ULong & index,
+ PortableGroup::ObjectGroup_out object_group
+ ACE_ENV_ARG_DECL)
+{
+ if (!this->load_managed_object (repository_id, index))
+ return 0;
+
+ PortableGroup::ObjectGroup_var group;
+ if (this->table_.find (repository_id, group) != 0)
+ {
+ if (ACE_OS::strcasecmp (this->object_groups_[index],
+ "CREATE") == 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");
+
+ // Configure for application-controlled membership.
+ PortableGroup::MembershipStyleValue msv =
+ PortableGroup::MEMB_APP_CTRL;
+ property.val <<= msv;
+
+ PortableGroup::GenericFactory::FactoryCreationId_var fcid;
+
+ group =
+ this->lm_->create_object (repository_id,
+ criteria,
+ fcid.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ const CORBA::ULong len = this->fcids_.size ();
+ this->fcids_.size (len + 1); // Incremental growth. Yuck!
+ this->fcids_[len] = fcid;
+ }
+ else
+ {
+ group =
+ this->orb_->string_to_object (this->object_groups_[index]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ if (this->table_.bind (repository_id, group) != 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "TAO_LB_ObjectReferenceFactory::"
+ "find_object_group - "
+ "Couldn't bind object group reference.\n"));
+
+ ACE_THROW_RETURN (CORBA::INTERNAL (), 0);
+ }
+
+ object_group = group._retn ();
+ }
+
+ return 1;
+}
+
+CORBA::Boolean
+TAO_LB_ObjectReferenceFactory::load_managed_object (const char * repository_id,
+ CORBA::ULong & i)
+{
+ // @todo Make this more efficient.
+
+ const CORBA::ULong len = this->repository_ids_.length ();
+ for (i = 0; i < len; ++i)
+ if (ACE_OS::strcmp (this->repository_ids_[i], repository_id) == 0)
+ return 1;
+
+ return 0;
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectReferenceFactory.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectReferenceFactory.h
new file mode 100644
index 00000000000..81fddbe05bf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ObjectReferenceFactory.h
@@ -0,0 +1,179 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_ObjectReferenceFactory.h
+ *
+ * $Id$
+
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_LB_OBJECT_REFERENCE_FACTORY_H
+#define TAO_LB_OBJECT_REFERENCE_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/LB_ORTC.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 */
+
+#include "orbsvcs/CosLoadBalancingC.h"
+
+#include "ace/Array_Base.h"
+#include "ace/Hash_Map_Manager_T.h"
+#include "ace/Null_Mutex.h"
+#include "ace/SString.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_LB_ObjectReferenceFactory
+ *
+ * @brief Implementation of the PortableInterceptor::ObjectReferenceFactory
+ * interface.
+ *
+ * This ObjectReferenceFactory creates an object group for a member of
+ * the given repository ID (if instructed to do so), creates an
+ * "unpublished" reference for that member, and adds it to the object
+ * group via the LoadManager.
+ */
+class TAO_LB_ObjectReferenceFactory
+ : public virtual CORBA::DefaultValueRefCountBase
+ , public virtual OBV_TAO_LB::ObjectReferenceFactory
+{
+ public:
+
+ /// Constructor
+ TAO_LB_ObjectReferenceFactory (
+ PortableInterceptor::ObjectReferenceFactory * old_orf,
+ const CORBA::StringSeq & object_groups,
+ const CORBA::StringSeq & repository_ids,
+ const char * location,
+ CORBA::ORB_ptr orb,
+ CosLoadBalancing::LoadManager_ptr lm);
+
+ /**
+ * @name PortableInterceptor::ObjectReferenceFactory Methods
+ *
+ * Methods required by the
+ * PortableInterceptor::ObjectReferenceFactory interface.
+ */
+ //@{
+ virtual CORBA::Object_ptr make_object (
+ const char * repository_id,
+ const PortableInterceptor::ObjectId & id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+
+ typedef ACE_Hash_Map_Manager_Ex<
+ ACE_CString,
+ PortableGroup::ObjectGroup_var,
+ ACE_Hash<ACE_CString>,
+ ACE_Equal_To<ACE_CString>,
+ ACE_Null_Mutex> Table;
+
+ typedef ACE_Array_Base<
+ PortableGroup::GenericFactory::FactoryCreationId_var> fcid_list;
+
+protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management via
+ * reference counting.
+ */
+ ~TAO_LB_ObjectReferenceFactory (void);
+
+ /// Retrieve the object group reference for objects with the given
+ /// RepositoryId.
+ CORBA::Boolean find_object_group (const char * repository_id,
+ CORBA::ULong & index,
+ PortableGroup::ObjectGroup_out object_group
+ ACE_ENV_ARG_DECL);
+
+ /// Determine if object with given RepositoryId is load managed.
+ CORBA::Boolean load_managed_object (const char * repository_id,
+ CORBA::ULong & i);
+
+private:
+
+ /// The old ObjectReferenceFactory used to create object references.
+ /**
+ * This ObjectReferenceFactory will be used when creating object
+ * references for non-load balanced objects.
+ */
+ PortableInterceptor::ObjectReferenceFactory_var old_orf_;
+
+
+ /// List of stringified object group references.
+ /**
+ * All stringified object groups in this sequence have a one-to-one
+ * correspondence to the repository IDs found in the repository_ids_
+ * member below.
+ *
+ * @par
+ *
+ * The special string "CREATE" denotes that creation of a new object
+ * group should be performed.
+ */
+ const CORBA::StringSeq object_groups_;
+
+ /// List of RepositoryIds for object that will be load
+ /// managed/balanced.
+ /**
+ * All RepositoryIds in this sequence have a one-to-one
+ * correspondence to the stringified object references found in the
+ * object_groups_ member above.
+ */
+ const CORBA::StringSeq repository_ids_;
+
+ /// The configured location for the server within which this
+ /// ObjectReferenceFactory resides.
+ PortableGroup::Location location_;
+
+ /// Table that maps repository ID to (non-stringified) object group
+ /// reference.
+ Table table_;
+
+ /// List of FactoryCreationIds that will later be used to destroy
+ /// object groups.
+ fcid_list fcids_;
+
+ /// Pseudo-reference to the ORB.
+ CORBA::ORB_var orb_;
+
+ /// Reference to the LoadManager object.
+ CosLoadBalancing::LoadManager_var lm_;
+
+ /// Array of flags that denotes whether or not an object group
+ /// member of a given RepositoryId has been registered with the
+ /// LoadManager.
+ /**
+ * The values are cached here to avoid querying the LoadManager,
+ * which can be costly.
+ */
+ CORBA::Boolean * registered_members_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#if defined (_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_OBJECT_REFERENCE_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Pull_Handler.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Pull_Handler.cpp
new file mode 100644
index 00000000000..5e8cdf226ec
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Pull_Handler.cpp
@@ -0,0 +1,84 @@
+#include "orbsvcs/LoadBalancing/LB_Pull_Handler.h"
+#include "orbsvcs/LoadBalancing/LB_LoadManager.h"
+
+#include "tao/debug.h"
+
+
+ACE_RCSID (LoadBalancing,
+ LB_Pull_Handler,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LB_Pull_Handler::TAO_LB_Pull_Handler (void)
+ : monitor_map_ (0),
+ load_manager_ (0)
+{
+}
+
+void
+TAO_LB_Pull_Handler::initialize (TAO_LB_MonitorMap * monitor_map,
+ TAO_LB_LoadManager * load_manager)
+{
+ this->monitor_map_ = monitor_map;
+ this->load_manager_ = load_manager;
+}
+
+int
+TAO_LB_Pull_Handler::handle_timeout (
+ const ACE_Time_Value & /* current_time */,
+ const void * /* arg */)
+{
+ // @todo Fix the race condtions in this method.
+
+ TAO_LB_MonitorMap::iterator begin = this->monitor_map_->begin ();
+ TAO_LB_MonitorMap::iterator end = this->monitor_map_->end ();
+
+ if (begin == end)
+ return 0; // No work to be done.
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Iterate over all registered load monitors.
+ //
+ // @todo This could be potentially very slow. Improve concurrent
+ // operation at some point in the near future.
+ for (TAO_LB_MonitorMap::iterator i = begin; i != end; ++i)
+ {
+ const PortableGroup::Location & location = (*i).ext_id_;
+ CosLoadBalancing::LoadMonitor_var & monitor = (*i).int_id_;
+
+ // The load monitor reference should never be nil since the
+ // LoadManager prevents nil load monitor references from
+ // being registered.
+ CosLoadBalancing::LoadList_var load_list =
+ monitor->loads (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->load_manager_->push_loads (location,
+ load_list.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+// ACE_DEBUG ((LM_DEBUG,
+// "LOCATION = %s\tLOAD = %f\n",
+// location[0].id.in (),
+// load_list[0].value));
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Catch the exception and ignore it.
+
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "(%P|%t) PullHandler::handle_timeout()\n");
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Pull_Handler.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Pull_Handler.h
new file mode 100644
index 00000000000..a18efd9d961
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Pull_Handler.h
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+//=======================================================================
+/**
+ * @file LB_Pull_Handler.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=======================================================================
+
+
+#ifndef TAO_LB_PULL_HANDLER_H
+#define TAO_LB_PULL_HANDLER_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/LoadBalancing/LB_MonitorMap.h"
+
+#include "ace/Event_Handler.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Forward declarations.
+class TAO_LB_LoadManager;
+
+/**
+ * @class TAO_LB_Pull_Handler
+ *
+ * @brief Event handler used when the "pull" monitoring style is
+ * configured.
+ *
+ * An event handler designed to pull loads from all load monitors
+ * registered with the load balancer.
+ */
+class TAO_LB_Pull_Handler : public ACE_Event_Handler
+{
+public:
+
+ /// Constructor
+ TAO_LB_Pull_Handler (void);
+
+ /// Receive the timeout event.
+ virtual int handle_timeout (const ACE_Time_Value &current_time,
+ const void *arg);
+
+ /// Initialize this event handler.
+ void initialize (TAO_LB_MonitorMap * monitor_map,
+ TAO_LB_LoadManager * load_manager);
+
+private:
+
+ /// The table that contains all load monitors registered with the
+ /// load balancer.
+ TAO_LB_MonitorMap * monitor_map_;
+
+ /// Pointer to the LoadManager servant.
+ TAO_LB_LoadManager * load_manager_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_PULL_HANDLER_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Random.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Random.cpp
new file mode 100644
index 00000000000..56c39655f2d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Random.cpp
@@ -0,0 +1,180 @@
+// -*- C++ -*-
+
+#include "orbsvcs/LoadBalancing/LB_Random.h"
+
+#include "tao/ORB_Constants.h"
+#include "ace/OS_NS_time.h"
+#include "ace/os_include/os_netdb.h"
+
+ACE_RCSID (LoadBalancing,
+ LB_Random,
+ "$Id$")
+
+#ifdef ACE_HAS_PTHREADS_STD
+static pthread_once_t tao_lb_once_control = PTHREAD_ONCE_INIT;
+#endif /* ACE_HAS_PTHREADS_STD */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+extern "C" void tao_lb_random_init_routine (void)
+{
+ ACE_OS::srand (static_cast<unsigned int> (ACE_OS::time ()));
+}
+
+TAO_LB_Random::TAO_LB_Random (PortableServer::POA_ptr poa)
+ : poa_ (PortableServer::POA::_duplicate (poa))
+{
+ TAO_LB_Random::init ();
+}
+
+char *
+TAO_LB_Random::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("Random");
+}
+
+CosLoadBalancing::Properties *
+TAO_LB_Random::get_properties (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosLoadBalancing::Properties * props = 0;
+ ACE_NEW_THROW_EX (props,
+ CosLoadBalancing::Properties,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (props);
+
+ return props;
+}
+
+void
+TAO_LB_Random::push_loads (
+ const PortableGroup::Location & /* the_location */,
+ const CosLoadBalancing::LoadList & /* loads */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::StrategyNotAdaptive))
+{
+ ACE_THROW (CosLoadBalancing::StrategyNotAdaptive ());
+}
+
+CosLoadBalancing::LoadList *
+TAO_LB_Random::get_loads (CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound))
+{
+ if (CORBA::is_nil (load_manager))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);
+
+ return load_manager->get_loads (the_location
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Object_ptr
+TAO_LB_Random::next_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound))
+{
+ if (CORBA::is_nil (load_manager))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), CORBA::Object::_nil ());
+
+ PortableGroup::Locations_var locations =
+ load_manager->locations_of_members (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ return TAO_LB_Random::_tao_next_member (object_group,
+ load_manager,
+ locations.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_LB_Random::analyze_loads (
+ PortableGroup::ObjectGroup_ptr /* object_group */,
+ CosLoadBalancing::LoadManager_ptr /* load_manager */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+PortableServer::POA_ptr
+TAO_LB_Random::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
+
+CORBA::Object_ptr
+TAO_LB_Random::_tao_next_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Locations & locations
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound))
+{
+ const CORBA::ULong len = locations.length ();
+ if (len == 0)
+ ACE_THROW_RETURN (CORBA::TRANSIENT (),
+ CORBA::Object::_nil ());
+
+ // Pick a random location in the sequence using the higher order
+ // bits (zero based indexing).
+ //
+ // See Numerical Recipes in C: The Art of Scientific Computing
+ // (William H. Press, Brian P. Flannery, Saul A. Teukolsky,
+ // William T. Vetterling; New York: Cambridge University Press,
+ // 1992 (2nd ed., p. 277)) for details on why using the lower order
+ // bits, as in (rand() % 10), is bad. In particular, the lower
+ // order bits in older rand() implementations may not be as random
+ // as the higher order bits.
+ //
+ // @todo It would be better to use the random() function since it
+ // is supposed to have a larger period than rand(), in
+ // addition to the fact that the lower order bits should be as
+ // random as the higher order bits.
+
+ // Prevent integer arithmetic overflow.
+ const CORBA::Float flen = static_cast<CORBA::Float> (len);
+
+ const CORBA::ULong i =
+ static_cast<CORBA::ULong> (flen * ACE_OS::rand () / (RAND_MAX + 1.0));
+
+ ACE_ASSERT (i < len);
+
+// ACE_DEBUG ((LM_DEBUG,
+// "** Len = %u\t"
+// "Location # %u\t"
+// "Loc Name = \"%s\"\n",
+// len,
+// i,
+// locations[i][0].id.in ()));
+
+ return load_manager->get_member_ref (object_group,
+ locations[i]
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_LB_Random::init (void)
+{
+#ifdef ACE_HAS_PTHREADS_STD
+ (void) ::pthread_once (&::tao_lb_once_control,
+ ::tao_lb_random_init_routine);
+#else
+ ::tao_lb_random_init_routine ();
+#endif /* ACE_HAS_PTHREADS_STD */
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Random.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Random.h
new file mode 100644
index 00000000000..af5bea2b038
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_Random.h
@@ -0,0 +1,124 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_Random.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef LB_RANDOM_H
+#define LB_RANDOM_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosLoadBalancingS.h"
+
+# if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+# endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_LB_Random
+ *
+ * @brief "Random" load balancing strategy
+ *
+ * This load balancing strategy is designed to select an object group
+ * member residing at a random location.
+ */
+class TAO_LB_Random
+ : public virtual POA_CosLoadBalancing::Strategy
+{
+public:
+
+ /// Constructor.
+ /**
+ * Seeds the OS' random number generator.
+ */
+ TAO_LB_Random (PortableServer::POA_ptr poa);
+
+ /**
+ * @name CosLoadBalancing::Strategy methods
+ *
+ * Methods required by the CosLoadBalancing::Strategy interface.
+ */
+ //@{
+ virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosLoadBalancing::Properties * get_properties (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void push_loads (
+ const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::StrategyNotAdaptive));
+
+ virtual CosLoadBalancing::LoadList * get_loads (
+ CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound));
+
+ virtual CORBA::Object_ptr next_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound));
+
+ virtual void analyze_loads (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ /// Returns the default POA for this servant.
+ virtual PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+ /// TAO-specific underlying implementation of this Random load
+ /// balancing strategy's next_member() method.
+ static CORBA::Object_ptr _tao_next_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Locations & locations
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound));
+
+ /// Initialize the random load balancing strategy.
+ /**
+ * If supported by the platform, initialization code will only run
+ * once for a given process.
+ */
+ static void init (void);
+
+private:
+
+ /// This servant's default POA.
+ PortableServer::POA_var poa_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#include /**/ "ace/post.h"
+
+#endif /* LB_RANDOM_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_RoundRobin.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_RoundRobin.cpp
new file mode 100644
index 00000000000..ab865f8020e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_RoundRobin.cpp
@@ -0,0 +1,171 @@
+// -*- C++ -*-
+
+#include "orbsvcs/LoadBalancing/LB_RoundRobin.h"
+
+#include "orbsvcs/PortableGroup/PG_conf.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+
+ACE_RCSID (LoadBalancing,
+ LB_RoundRobin,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LB_RoundRobin::TAO_LB_RoundRobin (PortableServer::POA_ptr poa)
+ : poa_ (PortableServer::POA::_duplicate (poa)),
+ lock_ (),
+ location_index_map_ (TAO_PG_MAX_OBJECT_GROUPS)
+{
+}
+
+TAO_LB_RoundRobin::~TAO_LB_RoundRobin (void)
+{
+}
+
+char *
+TAO_LB_RoundRobin::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("RoundRobin");
+}
+
+CosLoadBalancing::Properties *
+TAO_LB_RoundRobin::get_properties (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // There are no RoundRobin properties. Return an empty property
+ // list.
+
+ CosLoadBalancing::Properties * props = 0;
+ ACE_NEW_THROW_EX (props,
+ CosLoadBalancing::Properties,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (props);
+
+ return props;
+}
+
+void
+TAO_LB_RoundRobin::push_loads (
+ const PortableGroup::Location & /* the_location */,
+ const CosLoadBalancing::LoadList & /* loads */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::StrategyNotAdaptive))
+{
+ ACE_THROW (CosLoadBalancing::StrategyNotAdaptive ());
+}
+
+CosLoadBalancing::LoadList *
+TAO_LB_RoundRobin::get_loads (CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound))
+{
+ if (CORBA::is_nil (load_manager))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);
+
+ return load_manager->get_loads (the_location
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Object_ptr
+TAO_LB_RoundRobin::next_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound))
+{
+ if (CORBA::is_nil (load_manager))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), CORBA::Object::_nil ());
+
+ const PortableGroup::ObjectGroupId id =
+ load_manager->get_object_group_id (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ monitor,
+ this->lock_,
+ CORBA::Object::_nil ());
+
+ // Since this is "built-in" strategy, the LoadManager is collocated.
+ // There is no need to release the lock during the following
+ // invocation.
+ //
+ // There is a race condition here. The
+ PortableGroup::Locations_var locations =
+ load_manager->locations_of_members (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ const CORBA::ULong len = locations->length ();
+
+ if (len == 0)
+ ACE_THROW_RETURN (CORBA::TRANSIENT (),
+ CORBA::Object::_nil ());
+
+ TAO_LB_Location_Index_Map::ENTRY * entry;
+ if (this->location_index_map_.find (id, entry) == 0)
+ {
+ CORBA::ULong & i = entry->int_id_;
+
+ if (len <= i)
+ i = 0; // Reset, i.e. wrap around
+
+ // No need to release the lock since the LoadManager is
+ // collocated.
+ CORBA::Object_var member =
+ load_manager->get_member_ref (object_group,
+ locations[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ // Increment index to point to next location.
+ i++;
+
+ return member._retn ();
+ }
+
+ // The first time through this method. Set up for the next time
+ // around, and return the object reference residing at the first
+ // location in the "locations of members" sequence.
+
+ // Note that it is safe to set the next_index below to 1 even if the
+ // length of the sequence is 1 since the above code handles the
+ // boundary case correctly by wrapping around.
+
+ const CORBA::ULong index = 0;
+ if (this->location_index_map_.bind (id, index + 1) != 0)
+ ACE_THROW_RETURN (CORBA::INTERNAL (), CORBA::Object::_nil ());
+
+ return load_manager->get_member_ref (object_group,
+ locations[index]
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_LB_RoundRobin::analyze_loads (
+ PortableGroup::ObjectGroup_ptr /* object_group */,
+ CosLoadBalancing::LoadManager_ptr /* load_manager */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+PortableServer::POA_ptr
+TAO_LB_RoundRobin::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_RoundRobin.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_RoundRobin.h
new file mode 100644
index 00000000000..a96a1120223
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_RoundRobin.h
@@ -0,0 +1,127 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_RoundRobin.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef LB_ROUND_ROBIN_H
+#define LB_ROUND_ROBIN_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Null_Mutex.h"
+
+# if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+# endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/LoadBalancing/LB_Location_Index_Map.h"
+
+#include "orbsvcs/CosLoadBalancingS.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_LB_RoundRobin_Strategy
+ *
+ * @brief "Round Robin" load balancing strategy
+ *
+ * This load balancing strategy is designed to select an object group
+ * member residing at the next location.
+ */
+class TAO_LB_RoundRobin
+ : public virtual POA_CosLoadBalancing::Strategy
+{
+public:
+
+ /// Constructor.
+ TAO_LB_RoundRobin (PortableServer::POA_ptr poa);
+
+ /**
+ * @name CosLoadBalancing::Strategy methods
+ *
+ * Methods required by the CosLoadBalancing::Strategy interface.
+ */
+ //@{
+ virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosLoadBalancing::Properties * get_properties (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void push_loads (
+ const PortableGroup::Location & the_location,
+ const CosLoadBalancing::LoadList & loads
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::StrategyNotAdaptive));
+
+ virtual CosLoadBalancing::LoadList * get_loads (
+ CosLoadBalancing::LoadManager_ptr load_manager,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosLoadBalancing::LocationNotFound));
+
+ virtual CORBA::Object_ptr next_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound));
+
+ virtual void analyze_loads (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr load_manager
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ /// Returns the default POA for this servant.
+ virtual PortableServer::POA_ptr _default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
+
+protected:
+
+ /// Destructor
+ ~TAO_LB_RoundRobin (void);
+
+private:
+
+ /// This servant's default POA.
+ PortableServer::POA_var poa_;
+
+ /// Lock used to ensure atomic access to state retained by this
+ /// class.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// Table that maps PortableGroup::ObjectGroupId to location
+ /// sequence index specific to a given object group.
+ /**
+ * The location sequence corresponds to the sequence containing the
+ * locations of the members of a given object group. The value
+ * stored in this map corresponds to the index of the next element
+ * in that sequence. For example, if the index stored in the map is
+ * 2, location[2] will be used when retrieving the object reference
+ * to be returned from the Strategy::next_member() method.
+ */
+ TAO_LB_Location_Index_Map location_index_map_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* LB_ROUND_ROBIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.cpp
new file mode 100644
index 00000000000..10bb3303a39
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.cpp
@@ -0,0 +1,182 @@
+#include "orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.h"
+#include "orbsvcs/LoadBalancing/LB_LoadAlert.h"
+
+#include "tao/debug.h"
+
+#include "ace/OS_NS_string.h"
+
+
+ACE_RCSID (LoadBalancing,
+ LB_ServerRequestInterceptor,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LB_ServerRequestInterceptor::TAO_LB_ServerRequestInterceptor (
+ TAO_LB_LoadAlert & load_alert)
+ : load_alert_ (load_alert)
+{
+}
+
+TAO_LB_ServerRequestInterceptor::~TAO_LB_ServerRequestInterceptor (void)
+{
+}
+
+char *
+TAO_LB_ServerRequestInterceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("TAO_LB_ServerRequestInterceptor");
+}
+
+void
+TAO_LB_ServerRequestInterceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_LB_ServerRequestInterceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ if (this->load_alert_.alerted ())
+ {
+ CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (ACE_OS::strcmp (op.in (), "_get_loads") == 0 // LoadMonitor
+ || ACE_OS::strcmp (op.in (), "disable_alert") == 0 // LoadAlert
+ || ACE_OS::strcmp (op.in (), "enable_alert") == 0) // LoadAlert
+ return; // Do not redirect.
+
+#if 0
+ ACE_TRY
+ {
+ IOP::ServiceContext_var service_context =
+ ri->get_request_service_context (CosLoadBalancing::LOAD_MANAGED
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /*
+ // Use TAO-specific "compiled marshaling" instead of
+ // standard interpretive marshaling via a CDR encapsulation
+ // Codec for efficiency reasons.
+ const char * buf =
+ reinterpret_cast<const char *> (service_context->context_data.get_buffer ());
+ TAO_InputCDR cdr (buf,
+ service_context->context_data.length ());
+
+ CORBA::Boolean byte_order;
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ ACE_TRY_THROW (CORBA::BAD_PARAM ());
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ CORBA::Object_var object_group;
+ if (cdr >> object_group.out ())
+ ACE_TRY_THROW (PortableInterceptor::ForwardRequest (object_group.in (),
+ 0));
+ else
+ ACE_TRY_THROW (CORBA::BAD_PARAM ());
+ */
+
+ // A ServiceContext of the given ServiceId exists. This
+ // means that the target is load balanced. Force the client
+ // to try another profile since this location is currently
+ // overloaded.
+ ACE_TRY_THROW (CORBA::TRANSIENT ());
+ }
+ ACE_CATCH (CORBA::BAD_PARAM, ex)
+ {
+ // No CosLoadBalancing::LB_GROUP_REF ServiceContext. This
+ // probably means that the target object is not
+ // LoadBalanced.
+
+ // There is a huge DoS attack vulnerability with this load
+ // shedding model. The model relies on the client behaving
+ // correctly. In particular, it relies on the client to
+ // send the forward object group reference in the
+ // ServiceContextList. Any "misbehaving" client can avoid
+ // that, in which case no load will ever be shed!
+
+
+ // Make sure we get a CORBA::BAD_PARAM for the right
+ // reason.
+ if (ex.minor () != (CORBA::OMGVMCID | 26))
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+#else
+ // Force the client to try another profile since this location
+ // is currently overloaded.
+ //
+ // NOTE: This applies to both load balanced and non-load
+ // balanced targets.
+ ACE_THROW (CORBA::TRANSIENT ());
+#endif /* 0 */
+ }
+}
+
+void
+TAO_LB_ServerRequestInterceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+TAO_LB_ServerRequestInterceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr /* ri */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_LB_ServerRequestInterceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ if (TAO_debug_level > 0)
+ {
+ // A CORBA::TRANSIENT is thrown when the LoadManager informs the
+ // LoadAlert object that its member is overloaded, for example.
+
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT ("TAO_LB_ServerRequestInterceptor -- ")
+ ACE_TEXT ("Exception thrown.\n")));
+ }
+}
+
+void
+TAO_LB_ServerRequestInterceptor::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ if (TAO_debug_level > 0)
+ {
+ // A location forward occurs when the LoadManager informs the
+ // LoadAlert object that its member is overloaded, for example.
+
+ const PortableInterceptor::ReplyStatus status =
+ ri->reply_status (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (status == PortableInterceptor::LOCATION_FORWARD)
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT ("TAO_LB_ServerRequestInterceptor -- ")
+ ACE_TEXT ("LOCATION FORWARDED\n")));
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.h
new file mode 100644
index 00000000000..a3a94008a27
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.h
@@ -0,0 +1,125 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_ServerRequestInterceptor.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_SERVER_REQUEST_INTERCEPTOR_H
+#define TAO_LB_SERVER_REQUEST_INTERCEPTOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+
+#include "orbsvcs/LoadBalancing/LoadBalancing_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PI_Server/PI_Server.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_LB_LoadAlert;
+
+/**
+ * @class TAO_LB_ServerRequestInterceptor
+ *
+ * @brief ServerRequestInterceptor that interacts with the TAO-shipped
+ * LoadAlert implementation.
+ *
+ * This ServerRequestInterceptor is responsible for redirecting
+ * requests back to the LoadManager.
+ */
+class TAO_LoadBalancing_Export TAO_LB_ServerRequestInterceptor
+ : public virtual PortableInterceptor::ServerRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ TAO_LB_ServerRequestInterceptor (TAO_LB_LoadAlert & load_alert);
+
+ /**
+ * @name Methods Required by the ServerRequestInterceptor
+ * Interface
+ *
+ * These are the canonical methods required for all
+ * ServerRequestInterceptors.
+ */
+ //@{
+ 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));
+ //@}
+
+protected:
+
+ /// Destructor.
+ /**
+ * Protected destructor to enforce correct memory management via
+ * reference counting.
+ */
+ ~TAO_LB_ServerRequestInterceptor (void);
+
+private:
+
+ TAO_LB_LoadAlert & load_alert_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_SERVER_REQUEST_INTERCEPTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_conf.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_conf.h
new file mode 100644
index 00000000000..9c65aba972c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_conf.h
@@ -0,0 +1,45 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_conf.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_CONF_H
+#define TAO_LB_CONF_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+#ifndef TAO_LB_PULL_HANDLER_INTERVAL
+/// The interval in seconds the load balancer queries registered load
+/// monitors for loads.
+const long TAO_LB_PULL_HANDLER_INTERVAL = 5;
+#endif /* TAO_LB_PULL_HANDLER_INTERVAL */
+
+#ifndef TAO_LB_PULL_HANDLER_RESTART
+/// The time in seconds the load balancer's "pull handler" is
+/// restarted after being fired.
+const long TAO_LB_PULL_HANDLER_RESTART = 5;
+#endif /* TAO_LB_PULL_HANDLER_RESTART */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LB_CONF_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LoadBalancing_export.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LoadBalancing_export.h
new file mode 100644
index 00000000000..10ec8a56fe1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LoadBalancing_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_LOADBALANCING_EXPORT_H
+#define TAO_LOADBALANCING_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_LOADBALANCING_HAS_DLL)
+# define TAO_LOADBALANCING_HAS_DLL 0
+# endif /* ! TAO_LOADBALANCING_HAS_DLL */
+#else
+# if !defined (TAO_LOADBALANCING_HAS_DLL)
+# define TAO_LOADBALANCING_HAS_DLL 1
+# endif /* ! TAO_LOADBALANCING_HAS_DLL */
+#endif
+
+#if defined (TAO_LOADBALANCING_HAS_DLL) && (TAO_LOADBALANCING_HAS_DLL == 1)
+# if defined (TAO_LOADBALANCING_BUILD_DLL)
+# define TAO_LoadBalancing_Export ACE_Proper_Export_Flag
+# define TAO_LOADBALANCING_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_LOADBALANCING_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_LOADBALANCING_BUILD_DLL */
+# define TAO_LoadBalancing_Export ACE_Proper_Import_Flag
+# define TAO_LOADBALANCING_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_LOADBALANCING_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_LOADBALANCING_BUILD_DLL */
+#else /* TAO_LOADBALANCING_HAS_DLL == 1 */
+# define TAO_LoadBalancing_Export
+# define TAO_LOADBALANCING_SINGLETON_DECLARATION(T)
+# define TAO_LOADBALANCING_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_LOADBALANCING_HAS_DLL == 1 */
+
+#endif /* TAO_LOADBALANCING_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/README b/TAO/orbsvcs/orbsvcs/LoadBalancing/README
new file mode 100644
index 00000000000..175e8e074fd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/README
@@ -0,0 +1,35 @@
+This directory contains the implementations of the TAO Load Balancing
+service, which is called as Cygnus.
+
+Cygnus currently implements the latest revision of the OMG Load Balancing
+and Monitoring proposed specification. The features and advantages of
+Cygnus include:
+1. Multiple object group support.
+2. Extensible load balancing strategies through IDL interface.
+3. Extensible load monitoring.
+4. Support for push and pull style monitoring.
+5. Support for infrastructure and application controlled memberships.
+6. Efficient server side transparency.
+7. Default implementations of well known load balancing strategies.
+
+Future Work targeted:
+1. Implement a distributed load balancing service.
+2. Implement stateful load balancing service.
+3. Implement self adaptive load balancing strategies using control
+theoretical techniques.
+
+Papers about Cygnus:
+1. Ossama Othman, Carlos O'Ryan, and Douglas C. Schmidt, The Design of an
+Adaptive CORBA Load Balancing Service, IEEE Distributed Systems Online, Volume
+2, Number 4, April, 2001.
+2. Ossama Othman, Carlos O'Ryan, and Douglas C. Schmidt, An Efficient
+Adaptive Load Balancing Service for CORBA, IEEE Distributed Systems Online,
+Volume 2, Number 3, March, 2001.
+3. Jaiganesh Balasubramanian, Douglas C. Schmidt, Lawrence Dowdy, and Ossama
+Othman, Evaluating the Performance of Middleware Load Balancing Strategies,
+Proceedings of the 8th International IEEE Enterprise Distributed Object
+Computing Conference, Monterey, CA, September 2004
+4. Ossama Othman, Jaigaesh Balasubramanian, and Douglas C. Schmidt, The
+Design of an Adaptive Middleware Load Balancing and Monitoring Service, Third
+International Workshop on Self-Adaptive Software, Arlington, VA, USA, June
+9-11, 2003
diff --git a/TAO/orbsvcs/orbsvcs/Log/BasicLogFactory_i.cpp b/TAO/orbsvcs/orbsvcs/Log/BasicLogFactory_i.cpp
new file mode 100644
index 00000000000..b8704fe0988
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/BasicLogFactory_i.cpp
@@ -0,0 +1,147 @@
+#include "orbsvcs/Log/BasicLogFactory_i.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID (Log,
+ BasicLogFactory_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_BasicLogFactory_i::TAO_BasicLogFactory_i (void)
+{
+}
+
+TAO_BasicLogFactory_i::~TAO_BasicLogFactory_i (void)
+{
+}
+
+DsLogAdmin::BasicLogFactory_ptr
+TAO_BasicLogFactory_i::activate (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ TAO_LogMgr_i::init (orb, poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::BasicLogFactory::_nil ());
+
+
+ PortableServer::ObjectId_var oid =
+ this->factory_poa_->activate_object (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::BasicLogFactory::_nil ());
+
+ CORBA::Object_var obj =
+ this->factory_poa_->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::BasicLogFactory::_nil ());
+
+ // narrow and store the result..
+ this->log_mgr_ =
+ DsLogAdmin::LogMgr::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::BasicLogFactory::_nil ());
+
+ DsLogAdmin::BasicLogFactory_var v_return =
+ DsLogAdmin::BasicLogFactory::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::BasicLogFactory::_nil ());
+
+ return v_return._retn ();
+}
+
+DsLogAdmin::BasicLog_ptr
+TAO_BasicLogFactory_i::create (DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ DsLogAdmin::LogId_out id_out
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidLogFullAction
+ ))
+{
+ this->create_i (full_action,
+ max_size,
+ 0,
+ id_out
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::BasicLog::_nil ());
+ DsLogAdmin::LogId id = id_out;
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+ DsLogAdmin::Log_var log =
+ this->create_log_reference (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::BasicLog::_nil ());
+#else
+ DsLogAdmin::Log_var log =
+ this->create_log_object (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::BasicLog::_nil ());
+#endif
+
+ // narrow to BasicLog
+ DsLogAdmin::BasicLog_var basic_log =
+ DsLogAdmin::BasicLog::_narrow (log.in ());
+
+ return basic_log._retn ();
+}
+
+DsLogAdmin::BasicLog_ptr
+TAO_BasicLogFactory_i::create_with_id (DsLogAdmin::LogId id,
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ DsLogAdmin::LogIdAlreadyExists,
+ DsLogAdmin::InvalidLogFullAction
+ ))
+{
+ this->create_with_id_i (id,
+ full_action,
+ max_size,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::BasicLog::_nil ());
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+ DsLogAdmin::Log_var log =
+ this->create_log_reference (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::BasicLog::_nil ());
+#else
+ DsLogAdmin::Log_var log =
+ this->create_log_object (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::BasicLog::_nil ());
+#endif
+
+ // narrow to BasicLog
+ DsLogAdmin::BasicLog_var basic_log =
+ DsLogAdmin::BasicLog::_narrow (log.in ());
+
+ return basic_log._retn ();
+}
+
+CORBA::RepositoryId
+TAO_BasicLogFactory_i::create_repositoryid ()
+{
+ return CORBA::string_dup ("IDL:omg.org/DsLogAdmin:BasicLog:1.0");
+}
+
+PortableServer::ServantBase*
+TAO_BasicLogFactory_i::create_log_servant (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+{
+ TAO_BasicLog_i* basic_log_i;
+
+ ACE_NEW_THROW_EX (basic_log_i,
+ TAO_BasicLog_i (this->orb_.in (),
+ this->log_poa_.in (),
+ *this,
+ this->log_mgr_.in (),
+ id),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ basic_log_i->init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return basic_log_i;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/BasicLogFactory_i.h b/TAO/orbsvcs/orbsvcs/Log/BasicLogFactory_i.h
new file mode 100644
index 00000000000..f6cc8f4113a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/BasicLogFactory_i.h
@@ -0,0 +1,109 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file BasicLogFactory_i.h
+ *
+ * $Id$
+ *
+ * Implementation of the DsLogAdmin::BasicLogFactory interface.
+ *
+ *
+ * @author Matthew Braun <mjb2@cs.wustl.edu>
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_BASICLOGFACTORY_I_H
+#define TAO_TLS_BASICLOGFACTORY_I_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/DsLogAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Log/LogMgr_i.h"
+#include "orbsvcs/Log/BasicLog_i.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_BasicLogActivator;
+
+/**
+ * @class TAO_BasicLogFactory_i
+ *
+ * @brief The BasicLogFactory is a factory that is used to create event-unaware Logs.
+ */
+class TAO_Log_Serv_Export TAO_BasicLogFactory_i :
+ public POA_DsLogAdmin::BasicLogFactory,
+ public TAO_LogMgr_i
+{
+public:
+
+ //= Initialization and termination code.
+
+ /// Constructor.
+ TAO_BasicLogFactory_i ();
+
+ /// Destructor.
+ ~TAO_BasicLogFactory_i ();
+
+ /// Activate this servant with the ORB and POA passed in.
+ DsLogAdmin::BasicLogFactory_ptr
+ activate (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL);
+
+ /// Allows clients to create new BasicLog objects.
+ /// Raises DsLogAdmin::InvalidThreshold.
+ DsLogAdmin::BasicLog_ptr
+ create (DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ DsLogAdmin::LogId_out id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidLogFullAction
+ ));
+
+ /// Same as create (), but allows clients to specify the id.
+ DsLogAdmin::BasicLog_ptr
+ create_with_id (DsLogAdmin::LogId id,
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ DsLogAdmin::LogIdAlreadyExists,
+ DsLogAdmin::InvalidLogFullAction
+ ));
+
+protected:
+ virtual CORBA::RepositoryId
+ create_repositoryid ();
+
+ virtual PortableServer::ServantBase*
+ create_log_servant (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL);
+
+ /// Our object ref. after <active>ation.
+ DsLogAdmin::LogMgr_var log_mgr_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TLS_BASICLOGFACTORY_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/BasicLog_i.cpp b/TAO/orbsvcs/orbsvcs/Log/BasicLog_i.cpp
new file mode 100644
index 00000000000..fa4c1f0af22
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/BasicLog_i.cpp
@@ -0,0 +1,93 @@
+#include "orbsvcs/Log/BasicLog_i.h"
+
+#include "orbsvcs/Log/LogMgr_i.h"
+
+ACE_RCSID (Log,
+ BasicLog_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_BasicLog_i::TAO_BasicLog_i (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ TAO_LogMgr_i &logmgr_i,
+ DsLogAdmin::LogMgr_ptr factory,
+ DsLogAdmin::LogId id)
+ : TAO_Log_i (orb, logmgr_i, factory, id, 0),
+ poa_(PortableServer::POA::_duplicate(poa))
+{
+ // No-Op.
+}
+
+TAO_BasicLog_i::~TAO_BasicLog_i (void)
+{
+ // No-Op.
+}
+
+DsLogAdmin::Log_ptr
+TAO_BasicLog_i::copy (DsLogAdmin::LogId &id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ DsLogAdmin::BasicLogFactory_var basicLogFactory =
+ DsLogAdmin::BasicLogFactory::_narrow (factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ DsLogAdmin::BasicLog_var log =
+ basicLogFactory->create (DsLogAdmin::halt, 0, id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+
+ // Copy the attributes from the log.
+ this->copy_attributes (log.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ return log._retn ();
+
+}
+
+DsLogAdmin::Log_ptr
+TAO_BasicLog_i::copy_with_id (DsLogAdmin::LogId id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ DsLogAdmin::BasicLogFactory_var basicLogFactory =
+ DsLogAdmin::BasicLogFactory::_narrow (factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ DsLogAdmin::BasicLog_var log =
+ basicLogFactory->create_with_id (id, DsLogAdmin::halt, 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ // Copy the attributes from the log.
+ this->copy_attributes (log.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ return log._retn ();
+
+}
+
+void
+TAO_BasicLog_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Remove ourselves from the list of logs.
+ this->logmgr_i_.remove (this->logid_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Deregister with POA.
+ PortableServer::ObjectId_var id =
+ this->poa_->servant_to_id (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->poa_->deactivate_object (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/BasicLog_i.h b/TAO/orbsvcs/orbsvcs/Log/BasicLog_i.h
new file mode 100644
index 00000000000..e1a51484192
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/BasicLog_i.h
@@ -0,0 +1,101 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file BasicLog_i.h
+ *
+ * $Id$
+ *
+ * Implementation of the DsLogAdmin::BasicLog interface.
+ *
+ *
+ * @author Matthew Braun <mjb2@cs.wustl.edu>
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ * @David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+
+#ifndef TAO_TLS_BASICLOG_I_H
+#define TAO_TLS_BASICLOG_I_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/DsLogAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Log/Log_i.h"
+#include "orbsvcs/Log/log_serv_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_LogMgr_i;
+
+/**
+ * @class TAO_BasicLog_i
+ *
+ * @brief It allows clients to write, query and delete records from the log.
+ *
+ * The class supports the @c destroy> method to destroy the Log.
+ */
+class TAO_Log_Serv_Export TAO_BasicLog_i :
+ public TAO_Log_i,
+ public POA_DsLogAdmin::BasicLog
+{
+public:
+
+ /// Constructor.
+ TAO_BasicLog_i (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ TAO_LogMgr_i &logmgr_i,
+ DsLogAdmin::LogMgr_ptr factory,
+ DsLogAdmin::LogId id);
+
+ /// Duplicate the log.
+ virtual DsLogAdmin::Log_ptr copy (DsLogAdmin::LogId &id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Duplicate the log specifying an id.
+ virtual DsLogAdmin::Log_ptr copy_with_id (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Destroy the log object and all contained records.
+ void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+
+ /// Destructor.
+ /**
+ * Protected destructor to enforce proper memory management through
+ * reference counting.
+ */
+ ~TAO_BasicLog_i (void);
+
+private:
+
+ /// POA.
+ PortableServer::POA_var poa_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_TLS_BASICLOG_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/EventLogConsumer.cpp b/TAO/orbsvcs/orbsvcs/Log/EventLogConsumer.cpp
new file mode 100644
index 00000000000..5e005ee70c6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/EventLogConsumer.cpp
@@ -0,0 +1,100 @@
+#include "orbsvcs/Log/EventLog_i.h"
+#include "orbsvcs/Log/LogMgr_i.h"
+#include "orbsvcs/Log/LogNotification.h"
+
+ACE_RCSID (Log,
+ EventLogConsumer,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Event_LogConsumer::TAO_Event_LogConsumer (TAO_EventLog_i *log)
+: log_ (log)
+{
+}
+
+TAO_Event_LogConsumer::~TAO_Event_LogConsumer (void)
+{
+}
+
+void
+TAO_Event_LogConsumer::connect (CosEventChannelAdmin::ConsumerAdmin_ptr consumer_admin)
+{
+ // Connect to the event channel.
+ CosEventComm::PushConsumer_var myself = this->_this ();
+ this->supplier_proxy_ = consumer_admin->obtain_push_supplier ();
+ this->supplier_proxy_->connect_push_consumer (myself.in());
+}
+
+void
+TAO_Event_LogConsumer::push (const CORBA::Any& data ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ // create a record list...
+ DsLogAdmin::RecordList recList (1);
+ recList.length (1);
+
+ recList [0].info = data;
+
+ // @@ The current revision of the specification (formal/03-07-01)
+ // states:
+ //
+ // * When a push operation is invoked and a log is full, then a
+ // NO_RESOURCE (sic) SystemException is raised with a LOGFULL
+ // minor code.
+ //
+ // * When a push operation is invoked on a log that is off-duty,
+ // then a NO_RESOURCE (sic) SystemException is raised with a
+ // LOGOFFDUTY minor code.
+ //
+ // * When a push operation is invoked on a log that is locked, then
+ // a NO_PERMISSIONS (sic) SystemException is raised with a LOGLOCKED
+ // minor code.
+ //
+ // * When a push operation is invoked on a log that is disabled,
+ // then a TRANSIENT SystemException is raised with a LOGDISABLED
+ // minor code.
+ //
+ // But neither the Telecom Logging or the CORBA specification define
+ // the values for these minor codes.
+ //
+ // I have submitted a defect report to the OMG for clarification.
+ // --jtc
+ ACE_TRY
+ {
+ // log the RecordList.
+ this->log_->write_recordlist (recList ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (DsLogAdmin::LogFull, ex)
+ {
+ ACE_THROW (CORBA::NO_RESOURCES ());
+ }
+ ACE_CATCH (DsLogAdmin::LogOffDuty, ex)
+ {
+ ACE_THROW (CORBA::NO_RESOURCES ());
+ }
+ ACE_CATCH (DsLogAdmin::LogLocked, ex)
+ {
+ ACE_THROW (CORBA::NO_PERMISSION ());
+ }
+ ACE_CATCH (DsLogAdmin::LogDisabled, ex)
+ {
+ ACE_THROW (CORBA::TRANSIENT ());
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_Event_LogConsumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ this->supplier_proxy_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/EventLogConsumer.h b/TAO/orbsvcs/orbsvcs/Log/EventLogConsumer.h
new file mode 100644
index 00000000000..fac7eb9bbb9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/EventLogConsumer.h
@@ -0,0 +1,102 @@
+/* -*- C++ -*- */
+
+// ============================================================================
+/**
+ * @file EventLogConsumer.h
+ *
+ * $Id$
+ *
+ * The EventLogConsumer connects to the EventLog and logs the events
+ * that are pushed to the EventLog.
+ *
+ * @author Rob Ruff <rruff@scires.com>
+ * @D A Hanvey <d.hanvey@qub.ac.uk>
+ */
+// ============================================================================
+
+#ifndef TAO_TLS_EVENTLOGCONSUMER_H
+#define TAO_TLS_EVENTLOGCONSUMER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/DsLogAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+#include "orbsvcs/DsEventLogAdminS.h"
+#include "orbsvcs/Log/Log_i.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+
+#include "orbsvcs/Log/eventlog_serv_export.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_LogMgr_i;
+class TAO_EventLog_i;
+class TAO_EventLogFactory_i;
+
+/**
+ * @class TAO_Event_LogConsumer
+ *
+ * @brief An implementation of the PushConsumer interface.
+ *
+ * Connects to the EventLog and writes LogRecords to the
+ * Log when events are 'pushed' to the EventLog which is an
+ * EventChannel.
+ */
+class TAO_Event_LogConsumer : public virtual POA_CosEventComm::PushConsumer
+{
+public:
+
+ // = Initialization and Termination methods.
+
+ /// Constructor.
+ TAO_Event_LogConsumer (TAO_EventLog_i *log);
+
+ /// Destructor.
+ ~TAO_Event_LogConsumer (void);
+
+ /// Connect to EventLog.
+ void
+ connect (CosEventChannelAdmin::ConsumerAdmin_ptr consumer_admin);
+
+private:
+
+ /// Disconnect from EventLog.
+ void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// This method will call TAO_Log_i::log() to write
+ /// the event to the Log.
+ void push (const CORBA::Any& data ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+
+ /// ProxyPushSupplier used to connect to EventLog.
+ CosEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+
+ /// The EventLog that this consumer connects to
+ /// and whose events are to be logged.
+ TAO_EventLog_i *log_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TLS_EVENTLOGCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.cpp b/TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.cpp
new file mode 100644
index 00000000000..901af607cc1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.cpp
@@ -0,0 +1,253 @@
+#include "orbsvcs/Log/EventLogFactory_i.h"
+#include "orbsvcs/Log/LogNotification.h"
+#include "orbsvcs/Log/EventLogNotification.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID (Log,
+ EventLogFactory_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EventLogFactory_i::TAO_EventLogFactory_i (void)
+{
+ TAO_CEC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ PortableServer::POA_var defPOA =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_CEC_EventChannel_Attributes attr (defPOA.in (), defPOA.in ());
+
+ ACE_NEW_THROW_EX (impl,
+ TAO_CEC_EventChannel (attr),
+ CORBA::NO_MEMORY ());
+ ACE_TRY_CHECK;
+
+ impl->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception in "
+ "EventLogFactory_i constructor.");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+TAO_EventLogFactory_i::~TAO_EventLogFactory_i (void)
+{
+ // No-Op.
+}
+
+CosEventChannelAdmin::EventChannel_ptr
+TAO_EventLogFactory_i::init (PortableServer::POA_ptr /* poa */
+ ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (this->poa_.in ()));
+
+ CosEventChannelAdmin::EventChannel_var ec_return;
+
+ auto_ptr <TAO_CEC_EventChannel> ec (impl);
+
+ PortableServer::ObjectId_var oid =
+ this->poa_->activate_object (ec.get ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosEventChannelAdmin::EventChannel::_nil ());
+
+ ec.release ();
+
+ CORBA::Object_var obj =
+ this->poa_->id_to_reference (oid.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosEventChannelAdmin::EventChannel::_nil ());
+
+ ec_return =
+ CosEventChannelAdmin::EventChannel::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosEventChannelAdmin::EventChannel::_nil ());
+
+ return ec_return._retn ();
+}
+
+DsEventLogAdmin::EventLogFactory_ptr
+TAO_EventLogFactory_i::activate (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ TAO_LogMgr_i::init (orb, poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLogFactory::_nil ());
+
+
+ this->event_channel_ = init (this->poa_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLogFactory::_nil ());
+
+ this->consumer_admin_ =
+ this->event_channel_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLogFactory::_nil ());
+
+ ACE_NEW_THROW_EX (this->notifier_,
+ TAO_EventLogNotification(this->event_channel_.in ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLogFactory::_nil ());
+
+ PortableServer::ObjectId_var oid =
+ this->factory_poa_->activate_object (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLogFactory::_nil ());
+
+ CORBA::Object_var obj =
+ this->factory_poa_->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLogFactory::_nil ());
+
+ // narrow and store the result..
+ this->log_mgr_ =
+ DsLogAdmin::LogMgr::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLogFactory::_nil ());
+
+ DsEventLogAdmin::EventLogFactory_var v_return =
+ DsEventLogAdmin::EventLogFactory::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLogFactory::_nil ());
+
+ return v_return._retn ();
+}
+
+DsEventLogAdmin::EventLog_ptr
+TAO_EventLogFactory_i::create (
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList & thresholds,
+ DsLogAdmin::LogId_out id_out
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold))
+{
+ this->create_i (full_action,
+ max_size,
+ & thresholds,
+ id_out
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLog::_nil ());
+ DsLogAdmin::LogId id = id_out;
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+ DsLogAdmin::Log_var log =
+ this->create_log_reference (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLog::_nil ());
+#else
+ DsLogAdmin::Log_var log =
+ this->create_log_object (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLog::_nil ());
+#endif
+
+ // narrow to EventLog
+ DsEventLogAdmin::EventLog_var event_log =
+ DsEventLogAdmin::EventLog::_narrow (log.in ());
+
+ // @@ JTC - squelch exception?
+ notifier_->object_creation (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLog::_nil ());
+
+ return event_log._retn();
+}
+
+DsEventLogAdmin::EventLog_ptr
+TAO_EventLogFactory_i::create_with_id (
+ DsLogAdmin::LogId id,
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList & thresholds
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::LogIdAlreadyExists,
+ DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold))
+{
+ this->create_with_id_i (id,
+ full_action,
+ max_size,
+ & thresholds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLog::_nil ());
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+ DsLogAdmin::Log_var log =
+ this->create_log_reference (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLog::_nil ());
+#else
+ DsLogAdmin::Log_var log =
+ this->create_log_object (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLog::_nil ());
+#endif
+
+ // narrow to EventLog
+ DsEventLogAdmin::EventLog_var event_log =
+ DsEventLogAdmin::EventLog::_narrow (log.in ());
+
+ // @@ JTC - squelch exception?
+ notifier_->object_creation (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsEventLogAdmin::EventLog::_nil ());
+
+ return event_log._retn ();
+}
+
+CORBA::RepositoryId
+TAO_EventLogFactory_i::create_repositoryid ()
+{
+ return CORBA::string_dup("IDL:omg.org/DsEventLogAdmin:EventLog:1.0");
+}
+
+PortableServer::ServantBase*
+TAO_EventLogFactory_i::create_log_servant (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EventLog_i* event_log_i;
+
+ ACE_NEW_THROW_EX (event_log_i,
+ TAO_EventLog_i (this->orb_.in (),
+ this->poa_.in (),
+ this->log_poa_.in (),
+ *this,
+ this->log_mgr_.in (),
+ this->notifier_,
+ id
+ ),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ event_log_i->init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ //dhanvey
+ //initialise the LogConsumer object
+ event_log_i->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return event_log_i;
+}
+
+CosEventChannelAdmin::ProxyPushSupplier_ptr
+TAO_EventLogFactory_i::obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return consumer_admin_->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosEventChannelAdmin::ProxyPullSupplier_ptr
+TAO_EventLogFactory_i::obtain_pull_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+
+{
+ return consumer_admin_->obtain_pull_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.h b/TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.h
new file mode 100644
index 00000000000..ea8e6e5c63f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.h
@@ -0,0 +1,152 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file EventLogFactory_i.h
+ *
+ * $Id$
+ *
+ * Implementation of the DsEventLogAdmin::EventLogFactory interface.
+ *
+ *
+ * @author Rob Ruff <rruff@scires.com>
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_EVENTLOGFACTORY_I_H
+#define TAO_TLS_EVENTLOGFACTORY_I_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/DsEventLogAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/DsLogAdminS.h"
+#include "orbsvcs/Log/LogMgr_i.h"
+#include "orbsvcs/CosEvent/CEC_ConsumerAdmin.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_Default_Factory.h"
+#include "orbsvcs/Log/EventLog_i.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_EventLog_i;
+class TAO_EventLogNotification;
+
+/**
+ * @class TAO_EventLogFactory_i
+ *
+ * @brief The EventLogFactory is a factory that is used to create EventLogs which are event-aware.
+ */
+class TAO_EventLog_Serv_Export TAO_EventLogFactory_i :
+ public POA_DsEventLogAdmin::EventLogFactory,
+ public TAO_LogMgr_i
+
+{
+public:
+
+ //= Initialization and termination code.
+
+ /// Constructor.
+ TAO_EventLogFactory_i (void);
+
+ /// Destructor.
+ ~TAO_EventLogFactory_i ();
+
+ /// Initialise the EventChannel and obtain a
+ /// pointer to it.
+ CosEventChannelAdmin::EventChannel_ptr
+ init (PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL);
+
+ /// Activate this servant with the ORB and POA passed in.
+ DsEventLogAdmin::EventLogFactory_ptr
+ activate (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL);
+
+ /// Used to create an EventLog.
+ DsEventLogAdmin::EventLog_ptr create (
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList & thresholds,
+ DsLogAdmin::LogId_out id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold
+ ));
+
+ /// Same as create (), but allows clients to specify the id.
+ DsEventLogAdmin::EventLog_ptr create_with_id (
+ DsLogAdmin::LogId id,
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList & thresholds
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ DsLogAdmin::LogIdAlreadyExists,
+ DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold
+ ));
+
+ // = Implementation of the CosEventChannelAdmin::ConsumerAdmin methods.
+ CosEventChannelAdmin::ProxyPushSupplier_ptr obtain_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosEventChannelAdmin::ProxyPullSupplier_ptr obtain_pull_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+protected:
+ virtual CORBA::RepositoryId
+ create_repositoryid ();
+
+ virtual PortableServer::ServantBase*
+ create_log_servant (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL);
+
+ /// Our object ref. after <active>ation.
+ DsLogAdmin::LogMgr_var log_mgr_;
+
+ /// The event channel used for log generated events.
+ TAO_CEC_EventChannel *impl;
+
+ /// The object used for log generated events.
+ TAO_EventLogNotification* notifier_;
+
+ /// EventChannel used to obtain the ConsumerAdmin.
+ CosEventChannelAdmin::EventChannel_var event_channel_;
+
+ /// The ConsumerAdmin that the EventLogFactory supports.
+ CosEventChannelAdmin::ConsumerAdmin_var consumer_admin_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TLS_EVENTLOGFACTORY_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/EventLogNotification.cpp b/TAO/orbsvcs/orbsvcs/Log/EventLogNotification.cpp
new file mode 100644
index 00000000000..130274497d7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/EventLogNotification.cpp
@@ -0,0 +1,52 @@
+#include "orbsvcs/Log/LogNotification.h"
+#include "orbsvcs/Log/EventLogNotification.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "tao/debug.h"
+
+ACE_RCSID (Log,
+ EventLogNotification,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EventLogNotification::TAO_EventLogNotification (CosEventChannelAdmin::EventChannel_ptr ec)
+: TAO_LogNotification (), event_channel_ (CosEventChannelAdmin::EventChannel::_duplicate (ec))
+{
+ obtain_proxy_consumer ();
+}
+
+TAO_EventLogNotification::~TAO_EventLogNotification (void)
+{
+ // No-Op.
+}
+
+void
+TAO_EventLogNotification::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->consumer_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_EventLogNotification::obtain_proxy_consumer()
+{
+ CosEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel_->for_suppliers ();
+
+ consumer_ = supplier_admin->obtain_push_consumer ();
+
+ CosEventComm::PushSupplier_var supplier =
+ this->_this ();
+
+ consumer_->connect_push_supplier (supplier.in());
+}
+
+void
+TAO_EventLogNotification::send_notification (const CORBA::Any& any
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ consumer_->push (any ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/EventLogNotification.h b/TAO/orbsvcs/orbsvcs/Log/EventLogNotification.h
new file mode 100644
index 00000000000..88306c2eac7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/EventLogNotification.h
@@ -0,0 +1,92 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file EventLogNotification.h
+ *
+ * $Id$
+ *
+ * Methods to enable log-generated events.
+ *
+ * @author D A Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_EVENT_LOG_NOTIFICATION_H
+#define TAO_TLS_EVENT_LOG_NOTIFICATION_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosEvent/CEC_ConsumerAdmin.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/DsEventLogAdminS.h"
+#include "orbsvcs/CosEvent/CEC_Default_Factory.h"
+#include "orbsvcs/CosEventCommS.h"
+#include "orbsvcs/Log/eventlog_serv_export.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_EventLogNotification
+ *
+ * @brief Used to forward log generated events to a logging server.
+ */
+class TAO_EventLog_Serv_Export TAO_EventLogNotification :
+ public TAO_LogNotification,
+ public POA_CosEventComm::PushSupplier
+{
+public:
+
+ // = Initialization and Termination methods.
+
+ /// Constructor.
+ TAO_EventLogNotification (CosEventChannelAdmin::EventChannel_ptr);
+
+ /// Destructor.
+ ~TAO_EventLogNotification (void);
+
+ /// The skeleton methods.
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+ // = Helper methods
+
+ /// Used to connect this PushSupplier to the EventChannel
+ /// that will log these events.
+ void obtain_proxy_consumer ();
+
+ /// Send the event on the event channel.
+ virtual void send_notification (const CORBA::Any& any ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+private:
+ /// The ORB reference.
+ CORBA::ORB_var orb_;
+
+ /// The event channel we connect to.
+ CosEventChannelAdmin::EventChannel_var event_channel_;
+
+ /// The ProxyPushConsumer used to connect to the event channel.
+ CosEventChannelAdmin::ProxyPushConsumer_var consumer_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TLS_EVENT_LOG_NOTIFICATION_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/EventLog_i.cpp b/TAO/orbsvcs/orbsvcs/Log/EventLog_i.cpp
new file mode 100644
index 00000000000..6c6853cf891
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/EventLog_i.cpp
@@ -0,0 +1,139 @@
+#include "orbsvcs/Log/EventLog_i.h"
+#include "orbsvcs/Log/LogMgr_i.h"
+#include "orbsvcs/Log/LogNotification.h"
+
+ACE_RCSID (Log,
+ EventLog_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_EventLog_i::TAO_EventLog_i (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::POA_ptr log_poa,
+ TAO_LogMgr_i &logmgr_i,
+ DsLogAdmin::LogMgr_ptr factory,
+ TAO_LogNotification *log_notifier,
+ DsLogAdmin::LogId id)
+ : TAO_Log_i (orb, logmgr_i, factory, id, log_notifier),
+ poa_(PortableServer::POA::_duplicate(poa)),
+ log_poa_(PortableServer::POA::_duplicate(log_poa))
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ // Create an instance of the event channel.
+ TAO_CEC_EventChannel_Attributes attr (this->poa_.in(),
+ this->poa_.in());
+
+ ACE_NEW_THROW_EX (this->event_channel_,
+ TAO_CEC_EventChannel(attr),
+ CORBA::NO_MEMORY ());
+}
+
+TAO_EventLog_i::~TAO_EventLog_i ()
+{
+ this->event_channel_->destroy ();
+
+ delete this->event_channel_;
+}
+
+
+DsLogAdmin::Log_ptr
+TAO_EventLog_i::copy (DsLogAdmin::LogId &id ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Duplicate the log.
+ DsEventLogAdmin::EventLogFactory_var eventLogFactory =
+ DsEventLogAdmin::EventLogFactory::_narrow (factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ DsEventLogAdmin::EventLog_var log =
+ eventLogFactory->create (DsLogAdmin::halt, 0, thresholds_, id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ this->copy_attributes (log.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ return log._retn ();
+
+}
+
+DsLogAdmin::Log_ptr
+TAO_EventLog_i::copy_with_id (DsLogAdmin::LogId id ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Duplicate the log supplying the log id.
+ DsEventLogAdmin::EventLogFactory_var eventLogFactory =
+ DsEventLogAdmin::EventLogFactory::_narrow (factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ DsEventLogAdmin::EventLog_var log =
+ eventLogFactory->create_with_id (id, DsLogAdmin::halt, 0, thresholds_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ this->copy_attributes (log.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ return log._retn ();
+
+}
+
+
+void
+TAO_EventLog_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Send event to indicate the log has been deleted.
+ notifier_->object_deletion (logid_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Remove ourselves from the list of logs.
+ this->logmgr_i_.remove (this->logid_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Deregister with POA.
+ PortableServer::ObjectId_var id =
+ this->log_poa_->servant_to_id (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->log_poa_->deactivate_object (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_EventLog_i::activate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ this->event_channel_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Create the PushConsumer that will log the events.
+ this->my_log_consumer_ = new TAO_Event_LogConsumer (this);
+ ACE_CHECK;
+ this->my_log_consumer_->connect (consumer_admin.in ());
+}
+
+
+CosEventChannelAdmin::ConsumerAdmin_ptr
+TAO_EventLog_i::for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->event_channel_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosEventChannelAdmin::SupplierAdmin_ptr
+TAO_EventLog_i::for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->event_channel_->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/EventLog_i.h b/TAO/orbsvcs/orbsvcs/Log/EventLog_i.h
new file mode 100644
index 00000000000..545591ad31a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/EventLog_i.h
@@ -0,0 +1,135 @@
+// -*- C++ -*-
+
+// ============================================================================
+/**
+ * @file EventLog_i.h
+ *
+ * $Id$
+ *
+ * Implementation of the DsLogAdmin::EventLog interface.
+ * File also conatins TAO_Event_LogConsumer which is used
+ * to write events to the Log.
+ *
+ * @author Rob Ruff <rruff@scires.com>
+ * @author D A Hanvey <d.hanvey@qub.ac.uk>
+ */
+// ============================================================================
+
+#ifndef TAO_TLS_EVENTLOG_I_H
+#define TAO_TLS_EVENTLOG_I_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/DsLogAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+#include "orbsvcs/DsEventLogAdminS.h"
+#include "orbsvcs/Log/Log_i.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/Log/EventLogConsumer.h"
+
+#include "orbsvcs/Log/eventlog_serv_export.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_LogMgr_i;
+class TAO_EventLog_i;
+class TAO_EventLogFactory_i;
+
+/**
+ * @class TAO_EventLog_i
+ *
+ * @brief The EventLog is an EventChannel and a Log.
+ *
+ * It is used to log events that pass through the EventChannel.
+ * The class supports the @c destroy> method to destroy the Log.
+ */
+class TAO_EventLog_i :
+ public TAO_Log_i,
+ public POA_DsEventLogAdmin::EventLog
+{
+public:
+
+ // = Initialization and Termination.
+
+ /// Constructor.
+ TAO_EventLog_i (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::POA_ptr log_poa,
+ TAO_LogMgr_i &logmgr_i,
+ DsLogAdmin::LogMgr_ptr factory,
+ TAO_LogNotification *log_notifier,
+ DsLogAdmin::LogId id);
+
+ /// Duplicate the log.
+ virtual DsLogAdmin::Log_ptr copy (DsLogAdmin::LogId &id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Duplicate the log specifying an id.
+ virtual DsLogAdmin::Log_ptr copy_with_id (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Destroy the log object and all contained records.
+ void
+ destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Activate the EventLog.
+ void
+ activate (ACE_ENV_SINGLE_ARG_DECL);
+
+ // = The CosEventChannelAdmin::EventChannel interface methods.
+ CosEventChannelAdmin::ConsumerAdmin_ptr
+ for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosEventChannelAdmin::SupplierAdmin_ptr
+ for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management through
+ * reference counting.
+ */
+ ~TAO_EventLog_i ();
+
+private:
+
+ /// The Event Channel that the log uses.
+ TAO_CEC_EventChannel *event_channel_;
+
+ /// The PushConsumer that consumes the events and stores them
+ /// in the log.
+ TAO_Event_LogConsumer *my_log_consumer_;
+
+ PortableServer::POA_var poa_;
+
+ PortableServer::POA_var log_poa_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TLS_EVENTLOG_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/Hash_Iterator_i.cpp b/TAO/orbsvcs/orbsvcs/Log/Hash_Iterator_i.cpp
new file mode 100644
index 00000000000..233143bb12f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Hash_Iterator_i.cpp
@@ -0,0 +1,110 @@
+#include "orbsvcs/Log/Hash_Iterator_i.h"
+#include "orbsvcs/Log/Log_Constraint_Interpreter.h"
+#include "orbsvcs/Log/Log_Constraint_Visitors.h"
+#include "orbsvcs/DsLogAdminC.h"
+
+ACE_RCSID (Log,
+ Hash_Iterator_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Hash_Iterator_i::TAO_Hash_Iterator_i (
+ ACE_Reactor* reactor,
+ TAO_Hash_LogRecordStore* recordstore,
+ TAO_Hash_LogRecordStore::LOG_RECORD_STORE_ITER iter,
+ TAO_Hash_LogRecordStore::LOG_RECORD_STORE_ITER iter_end,
+ CORBA::ULong start,
+ const char *constraint,
+ CORBA::ULong max_rec_list_len)
+ : TAO_Iterator_i(reactor),
+ recordstore_ (recordstore),
+ iter_ (iter),
+ iter_end_ (iter_end),
+ current_position_(start),
+ constraint_ (constraint),
+ max_rec_list_len_ (max_rec_list_len)
+{
+}
+
+
+TAO_Hash_Iterator_i::~TAO_Hash_Iterator_i (void)
+{
+}
+
+
+DsLogAdmin::RecordList*
+TAO_Hash_Iterator_i::get (CORBA::ULong position,
+ CORBA::ULong how_many
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidParam))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ if (position < current_position_)
+ {
+ ACE_THROW_RETURN (DsLogAdmin::InvalidParam (), 0);
+ }
+
+ if (how_many == 0)
+ {
+ how_many = this->max_rec_list_len_;
+ }
+
+ // Use an Interpreter to build an expression tree.
+ TAO_Log_Constraint_Interpreter interpreter (constraint_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Sequentially iterate over all the records and pick the ones that
+ // meet the constraints.
+
+ // Allocate the list of <how_many> length.
+ DsLogAdmin::RecordList* rec_list;
+ ACE_NEW_THROW_EX (rec_list,
+ DsLogAdmin::RecordList (how_many),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+ rec_list->length (how_many);
+
+ CORBA::ULong count = 0;
+ CORBA::ULong current_position = this->current_position_;
+
+ for ( ;
+ ((this->iter_ != this->iter_end_) && (count < how_many));
+ ++this->iter_)
+ {
+ // Use an evaluator.
+ TAO_Log_Constraint_Visitor visitor (this->iter_->item ());
+
+ // Does it match the constraint?
+ if (interpreter.evaluate (visitor) == 1)
+ {
+ if (++current_position >= position)
+ {
+ (*rec_list)[count] = this->iter_->item ();
+ // copy the log record.
+ count++;
+ }
+ }
+ }
+
+ rec_list->length (count);
+ this->current_position_ = current_position;
+
+ if (count == 0 && this->iter_ == this->iter_end_)
+ {
+ // destroy this object..
+ this->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (rec_list);
+ }
+
+ return rec_list;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/Hash_Iterator_i.h b/TAO/orbsvcs/orbsvcs/Log/Hash_Iterator_i.h
new file mode 100644
index 00000000000..375735a43ce
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Hash_Iterator_i.h
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Hash_Iterator_i.h
+ *
+ * $Id$
+ *
+ * Implementation of the DsLogAdmin::Iterator interface.
+ *
+ * @author Matthew Braun <mjb2@cs.wustl.edu>
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_HASH_ITERATOR_H
+#define TAO_TLS_HASH_ITERATOR_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/Log/Iterator_i.h"
+#include "orbsvcs/Log/Hash_LogRecordStore.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Hash_Iterator_i
+ *
+ * @brief Iterator to get LogRecords for the log via a query.
+ */
+class TAO_Log_Serv_Export TAO_Hash_Iterator_i
+ : public TAO_Iterator_i
+{
+public:
+
+ // = Initialization and Termination methods.
+
+ /// Constructor.
+ TAO_Hash_Iterator_i (ACE_Reactor* reactor,
+ TAO_Hash_LogRecordStore* recordstore,
+ TAO_Hash_LogRecordStore::LOG_RECORD_STORE_ITER iter,
+ TAO_Hash_LogRecordStore::LOG_RECORD_STORE_ITER iter_end,
+ CORBA::ULong start,
+ const char *constraint,
+ CORBA::ULong max_rec_list_len);
+
+ /// Destructor.
+ virtual ~TAO_Hash_Iterator_i (void);
+
+ /// Gets a list of LogRecords.
+ virtual DsLogAdmin::RecordList* get (CORBA::ULong position,
+ CORBA::ULong how_many
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidParam));
+
+private:
+ /// Pointer to record store
+ TAO_Hash_LogRecordStore* recordstore_;
+
+ /// Current Iterator.
+ TAO_Hash_LogRecordStore::LOG_RECORD_STORE_ITER iter_;
+
+ /// End Iterator.
+ TAO_Hash_LogRecordStore::LOG_RECORD_STORE_ITER iter_end_;
+
+ /// Position.
+ CORBA::ULong current_position_;
+
+ /// Constraint.
+ CORBA::String_var constraint_;
+
+ /// Max rec list length.
+ CORBA::ULong max_rec_list_len_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TLS_HASH_ITERATOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/Hash_LogRecordStore.cpp b/TAO/orbsvcs/orbsvcs/Log/Hash_LogRecordStore.cpp
new file mode 100644
index 00000000000..3ae2885472f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Hash_LogRecordStore.cpp
@@ -0,0 +1,832 @@
+#include "orbsvcs/Log/LogMgr_i.h"
+#include "orbsvcs/Log/Hash_LogRecordStore.h"
+#include "orbsvcs/Log/Hash_Iterator_i.h"
+#include "orbsvcs/Log/Log_Constraint_Interpreter.h"
+#include "orbsvcs/Log/Log_Constraint_Visitors.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "tao/Utils/PolicyList_Destroyer.h"
+#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h"
+#include "tao/ORB_Core.h"
+#include "tao/debug.h"
+#include "ace/OS_NS_sys_time.h"
+
+ACE_RCSID (Log,
+ Hash_LogRecordStore,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Hash_LogRecordStore::TAO_Hash_LogRecordStore (
+ TAO_LogMgr_i* logmgr_i,
+ DsLogAdmin::LogId logid,
+ DsLogAdmin::LogFullActionType log_full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList* thresholds)
+ : logmgr_i_ (logmgr_i),
+ maxid_ (0),
+ max_size_ (max_size),
+ id_ (logid),
+ current_size_ (0),
+ num_records_ (0),
+ gauge_ (0),
+ max_rec_list_len_ (LOG_DEFAULT_MAX_REC_LIST_LEN),
+ admin_state_ (DsLogAdmin::unlocked),
+ forward_state_ (DsLogAdmin::on),
+ log_full_action_ (log_full_action),
+ max_record_life_ (0),
+ reactor_ (logmgr_i_->orb()->orb_core ()->reactor ())
+{
+ interval_.start = 0;
+ interval_.stop = 0;
+
+ if (thresholds)
+ {
+ this->thresholds_ = *thresholds;
+ }
+ else
+ {
+ this->thresholds_.length(1);
+ this->thresholds_[0] = 100;
+ }
+
+ this->log_qos_.length(1);
+ this->log_qos_[0] = DsLogAdmin::QoSNone;
+
+ PortableServer::POA_ptr log_poa =
+ logmgr_i_->log_poa();
+
+ // Create POA for iterators
+ TAO::Utils::PolicyList_Destroyer policies (2);
+ policies.length (2);
+
+ policies[0] =
+ log_poa->create_lifespan_policy (PortableServer::TRANSIENT);
+ policies[1] =
+ log_poa->create_id_assignment_policy (PortableServer::SYSTEM_ID);
+
+ char buf[32];
+ ACE_OS::snprintf (buf, sizeof (buf), "Log%d", (int) id_);
+
+ PortableServer::POAManager_var poa_manager =
+ log_poa->the_POAManager ();
+
+ this->iterator_poa_ =
+ log_poa->create_POA(buf, PortableServer::POAManager::_nil(), policies);
+}
+
+TAO_Hash_LogRecordStore::~TAO_Hash_LogRecordStore (void)
+{
+ ACE_DEBUG((LM_DEBUG, "TAO_Hash_LogRecordStore::~TAO_Hash_LogRecordStore ()\n"));
+ this->iterator_poa_->destroy (1, 0);
+ ACE_DEBUG((LM_DEBUG, "TAO_Hash_LogRecordStore::~TAO_Hash_LogRecordStore ()\n"));
+}
+
+int
+TAO_Hash_LogRecordStore::open (void)
+{
+ return rec_map_.open ();
+}
+
+int
+TAO_Hash_LogRecordStore::close (void)
+{
+ // Close the hash
+ return rec_map_.close ();
+}
+
+CORBA::ULongLong
+TAO_Hash_LogRecordStore::get_current_size (ACE_ENV_SINGLE_ARG_DECL)
+{
+ return this->current_size_;
+}
+
+CORBA::ULongLong
+TAO_Hash_LogRecordStore::get_n_records (ACE_ENV_SINGLE_ARG_DECL)
+{
+ return this->num_records_;
+}
+
+CORBA::ULongLong
+TAO_Hash_LogRecordStore::get_gauge (ACE_ENV_SINGLE_ARG_DECL)
+{
+ return this->gauge_;
+}
+
+void
+TAO_Hash_LogRecordStore::reset_gauge (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->gauge_ = 0;
+}
+
+int
+TAO_Hash_LogRecordStore::log (const DsLogAdmin::LogRecord &const_rec
+ ACE_ENV_ARG_DECL)
+{
+ // Get log record size...
+ size_t record_size = log_record_size (const_rec);
+
+ // Check if we are allowed to write...
+ if (max_size_ !=0 && ((current_size_ + record_size) >= max_size_))
+ return 1; // return code for log rec. full
+
+ // Copy record...
+ DsLogAdmin::LogRecord rec = const_rec;
+
+ // Initialize a couple of fields first...
+ // ACE emulation of U Long Long (for platforms that don't have one)
+ // does not define postfix operators
+ rec.id = ++maxid_;
+
+ ORBSVCS_Time::Time_Value_to_TimeT(rec.time,ACE_OS::gettimeofday());
+
+ // First, bind the id to the LogRecord in the hash_map
+ if (this->rec_map_.bind (rec.id, rec) != 0)
+ {
+#if defined (ACE_LACKS_LONGLONG_T)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "LogRecordStore (%P|%t):Failed to bind %d in the hash map\n",
+ ACE_U64_TO_U32(rec.id)),
+ -1);
+#else
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "LogRecordStore (%P|%t):Failed to bind %Q in the hash map\n",
+ rec.id),
+ -1);
+#endif
+ }
+
+ // Increment the number of records in the log
+ ++this->num_records_;
+ this->current_size_ += record_size;
+ this->gauge_ += record_size;
+
+ return 0;
+}
+
+int
+TAO_Hash_LogRecordStore::retrieve_i (DsLogAdmin::RecordId id,
+ DsLogAdmin::LogRecord &rec
+ ACE_ENV_ARG_DECL)
+{
+ int retval = rec_map_.find (id, rec);
+ return retval;
+}
+
+int
+TAO_Hash_LogRecordStore::update_i (DsLogAdmin::LogRecord &rec
+ ACE_ENV_ARG_DECL)
+{
+ DsLogAdmin::LogRecord oldrec;
+
+ if (rec_map_.unbind (rec.id, oldrec) != 0)
+ {
+ return -1;
+ }
+
+ --this->num_records_;
+ this->current_size_ -= log_record_size(oldrec);
+
+ if (rec_map_.bind (rec.id, rec) != 0)
+ {
+ return -1;
+ }
+
+ ++this->num_records_;
+ this->current_size_ += log_record_size(rec);
+
+ return 0;
+}
+
+int
+TAO_Hash_LogRecordStore::remove_i (DsLogAdmin::RecordId id
+ ACE_ENV_ARG_DECL)
+{
+ DsLogAdmin::LogRecord rec;
+ if (rec_map_.unbind (id, rec) != 0)
+ {
+ return -1;
+ }
+
+ --this->num_records_;
+ this->current_size_ -= log_record_size(rec);
+
+ return 0;
+}
+
+void
+TAO_Hash_LogRecordStore::remove_i (LOG_RECORD_STORE_ITER iter
+ ACE_ENV_ARG_DECL)
+{
+ size_t size = log_record_size(iter->item ());
+
+ rec_map_.unbind(&*iter);
+
+ --this->num_records_;
+ this->current_size_ -= size;
+}
+
+int
+TAO_Hash_LogRecordStore::purge_old_records (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::ULongLong num_records_to_purge = this->num_records_ * 5U / 100U;
+
+ if (num_records_to_purge < 1)
+ num_records_to_purge = 1;
+
+ CORBA::ULong count = 0; // count of matches found.
+
+ if (num_records_to_purge > 0 )
+ {
+ // Create iterators
+ LOG_RECORD_STORE_ITER iter (rec_map_.begin ());
+ LOG_RECORD_STORE_ITER iter_end (rec_map_.end ());
+
+ for (CORBA::ULongLong i = 0;
+ iter != iter_end && i < num_records_to_purge;
+ ++i)
+ {
+ this->remove_i (iter++);
+ count++;
+ }
+ }
+
+ return count;
+}
+
+void
+TAO_Hash_LogRecordStore::set_record_attribute (DsLogAdmin::RecordId id,
+ const DsLogAdmin::NVList
+ &attr_list
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidRecordId,
+ DsLogAdmin::InvalidAttribute))
+{
+ // TODO: validate attributes here.
+
+ DsLogAdmin::LogRecord rec;
+ if (this->retrieve_i (id, rec ACE_ENV_ARG_PARAMETER) == -1)
+ {
+ ACE_THROW (DsLogAdmin::InvalidRecordId ());
+ }
+
+ rec.attr_list = attr_list;
+
+ if (this->update_i (rec ACE_ENV_ARG_PARAMETER) == -1)
+ {
+ ACE_THROW (CORBA::PERSIST_STORE ());
+ }
+}
+
+CORBA::ULong
+TAO_Hash_LogRecordStore::set_records_attribute (
+ const char *grammar,
+ const char *constraint,
+ const DsLogAdmin::NVList
+ &attr_list ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint,
+ DsLogAdmin::InvalidAttribute))
+{
+ this->check_grammar (grammar ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // TODO: validate attributes here.
+
+ // Use an Interpreter to build an expression tree.
+ TAO_Log_Constraint_Interpreter interpreter (constraint
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Create iterators
+ LOG_RECORD_STORE_ITER iter (rec_map_.begin ());
+ LOG_RECORD_STORE_ITER iter_end (rec_map_.end ());
+
+ CORBA::ULong count = 0; // count of matches found.
+
+ for ( ; iter != iter_end; ++iter)
+ {
+ // Use an evaluator.
+ TAO_Log_Constraint_Visitor evaluator (iter->item ());
+
+ // Does it match the constraint?
+ if (interpreter.evaluate (evaluator) == 1)
+ {
+ set_record_attribute (iter->item ().id, attr_list);
+ ++count;
+ }
+ }
+
+ return count;
+}
+
+DsLogAdmin::NVList*
+TAO_Hash_LogRecordStore::get_record_attribute (DsLogAdmin::RecordId id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidRecordId))
+{
+ DsLogAdmin::LogRecord rec;
+
+ int retval = this->retrieve_i (id, rec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (retval == -1)
+ {
+ ACE_THROW_RETURN (DsLogAdmin::InvalidRecordId (),
+ 0);
+ }
+
+ DsLogAdmin::NVList* nvlist = 0;
+ ACE_NEW_THROW_EX (nvlist,
+ DsLogAdmin::NVList (rec.attr_list),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ return nvlist;
+}
+
+
+int
+TAO_Hash_LogRecordStore::flush (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return 0;
+}
+
+size_t
+TAO_Hash_LogRecordStore::log_record_size (const DsLogAdmin::LogRecord &rec)
+{
+ size_t mb_size = 0;
+ TAO::Any_Impl *impl = rec.info.impl ();
+
+ if (impl->encoded ())
+ {
+ TAO::Unknown_IDL_Type *unk =
+ dynamic_cast<TAO::Unknown_IDL_Type *> (impl);
+
+ mb_size = unk->_tao_get_cdr ().start ()->length ();
+ }
+ else
+ {
+ // If the Any is not encoded, it just has a stored value
+ // instead of a CDR stream, not sure what info would be
+ // useful here.
+ }
+
+ return sizeof (rec) + mb_size;
+}
+
+DsLogAdmin::RecordList*
+TAO_Hash_LogRecordStore::query_i (const char *constraint,
+ DsLogAdmin::Iterator_out &iter_out,
+ CORBA::ULong how_many
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidConstraint))
+{
+ // Use an Interpreter to build an expression tree.
+ TAO_Log_Constraint_Interpreter interpreter (constraint
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Sequentially iterate over all the records and pick the ones that
+ // meet the constraints.
+
+ // Allocate the list of <how_many> length.
+ DsLogAdmin::RecordList* rec_list;
+ ACE_NEW_THROW_EX (rec_list,
+ DsLogAdmin::RecordList (how_many),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+ rec_list->length(how_many);
+
+ // Create iterators
+ LOG_RECORD_STORE_ITER iter (rec_map_.begin ());
+ LOG_RECORD_STORE_ITER iter_end (rec_map_.end ());
+
+ CORBA::ULong count = 0; // count of matches found.
+
+ for ( ; ((iter != iter_end) && (count < how_many)); ++iter)
+ {
+ // Use an evaluator.
+ TAO_Log_Constraint_Visitor evaluator (iter->item ());
+
+ // Does it match the constraint?
+ if (interpreter.evaluate (evaluator) == 1)
+ {
+ if (TAO_debug_level > 0)
+ {
+#if defined (ACE_LACKS_LONGLONG_T)
+ ACE_DEBUG ((LM_DEBUG,"Matched constraint! d = %d, Time = %d\n",
+ ACE_U64_TO_U32 (iter->item ().id),
+ ACE_U64_TO_U32 (iter->item ().time)));
+
+#else
+ ACE_DEBUG ((LM_DEBUG,"Matched constraint! d = %Q, Time = %Q\n",
+ iter->item ().id,
+ iter->item ().time));
+#endif
+ }
+
+ (*rec_list)[count] = iter->item ();
+ // copy the log record.
+ count++;
+ }
+ }
+
+ rec_list->length (count);
+
+ if (iter != iter_end) // There are more records to process.
+ {
+ // Create an iterator to pass out.
+ TAO_Hash_Iterator_i *iter_query = 0;
+ ACE_NEW_THROW_EX (iter_query,
+ TAO_Hash_Iterator_i (this->reactor_,
+ this,
+ iter,
+ iter_end,
+ count,
+ constraint,
+ this->max_rec_list_len_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (rec_list);
+
+ // Transfer ownership to the POA.
+ PortableServer::ServantBase_var safe_iter_query = iter_query;
+
+ // Activate it.
+ PortableServer::ObjectId_var oid =
+ this->iterator_poa_->activate_object (iter_query);
+ CORBA::Object_var obj =
+ this->iterator_poa_->id_to_reference (oid);
+
+ // Narrow it
+ iter_out = DsLogAdmin::Iterator::_narrow (obj.in ());
+ }
+
+ return rec_list;
+}
+
+DsLogAdmin::RecordList*
+TAO_Hash_LogRecordStore::query (const char *grammar,
+ const char *constraint,
+ DsLogAdmin::Iterator_out iter_out
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint))
+{
+ this->check_grammar (grammar ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->query_i (constraint,
+ iter_out,
+ this->max_rec_list_len_
+ ACE_ENV_ARG_PARAMETER);
+}
+
+DsLogAdmin::RecordList*
+TAO_Hash_LogRecordStore::retrieve (DsLogAdmin::TimeT from_time,
+ CORBA::Long how_many,
+ DsLogAdmin::Iterator_out iter_out
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Decide between forward vs backward retrieval.
+ char constraint[32];
+ char uint64_formating[32];
+
+#if defined (ACE_LACKS_LONGLONG_T)
+ ACE_OS::sprintf (uint64_formating,
+ "%u",
+ ACE_U64_TO_U32 (from_time));
+#else
+ ACE_OS::sprintf (uint64_formating,
+ ACE_UINT64_FORMAT_SPECIFIER,
+ from_time);
+#endif
+
+ if (how_many >= 0)
+ ACE_OS::sprintf (constraint, "time >= %s", uint64_formating);
+ else
+ {
+ ACE_OS::sprintf (constraint, "time < %s", uint64_formating);
+ how_many = -(how_many);
+ }
+
+ return this->query_i (constraint,
+ iter_out,
+ how_many
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ULong
+TAO_Hash_LogRecordStore::match (const char* grammar,
+ const char *constraint
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint))
+{
+ this->check_grammar (grammar ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Use an Interpreter to build an expression tree.
+ TAO_Log_Constraint_Interpreter interpreter (constraint
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Create iterators
+ LOG_RECORD_STORE_ITER iter (rec_map_.begin ());
+ LOG_RECORD_STORE_ITER iter_end (rec_map_.end ());
+
+ CORBA::ULong count = 0; // count of matches found.
+
+ for ( ; iter != iter_end; ++iter)
+ {
+ // Use an evaluator.
+ TAO_Log_Constraint_Visitor evaluator (iter->item ());
+
+ // Does it match the constraint?
+ if (interpreter.evaluate (evaluator) == 1)
+ {
+ count++;
+ }
+ }
+
+ return count;
+}
+
+CORBA::ULong
+TAO_Hash_LogRecordStore::delete_records (const char *grammar,
+ const char *constraint
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint))
+{
+ this->check_grammar (grammar ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Use an Interpreter to build an expression tree.
+ TAO_Log_Constraint_Interpreter interpreter (constraint
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Create iterators
+ LOG_RECORD_STORE_ITER iter (rec_map_.begin ());
+ LOG_RECORD_STORE_ITER iter_end (rec_map_.end ());
+
+ CORBA::ULong count = 0; // count of matches found.
+
+ while (iter != iter_end)
+ {
+ // Use an evaluator.
+ TAO_Log_Constraint_Visitor evaluator (iter->item ());
+
+ // Does it match the constraint?
+ if (interpreter.evaluate (evaluator) == 1)
+ {
+ this->remove_i (iter++);
+ count++;
+ }
+ else
+ {
+ ++iter;
+ }
+ }
+
+ return count;
+}
+
+CORBA::ULong
+TAO_Hash_LogRecordStore::delete_records_by_id (const DsLogAdmin::RecordIdList &ids
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong count (0);
+
+ for (CORBA::ULong i = 0; i < ids.length (); i++)
+ {
+ if (this->remove_i (ids [i]) == 0)
+ {
+ count++;
+ }
+ }
+
+ return count;
+}
+
+CORBA::ULong
+TAO_Hash_LogRecordStore::remove_old_records (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->max_record_life_ == 0) {
+ return 0;
+ }
+
+ TimeBase::TimeT purge_time;
+ ORBSVCS_Time::Time_Value_to_TimeT (purge_time,
+ (ACE_OS::gettimeofday() - ACE_Time_Value(this->max_record_life_)));
+
+ CORBA::ULongLong p_time = (CORBA::ULongLong) purge_time;
+
+ static char out[256] = "";
+
+ double temp1 =
+ static_cast<double> (ACE_UINT64_DBLCAST_ADAPTER (p_time));
+
+ ACE_OS::sprintf (out, "time < %.0f", temp1);
+
+ // Use an Interpreter to build an expression tree.
+ TAO_Log_Constraint_Interpreter interpreter (out
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Create iterators
+ LOG_RECORD_STORE_ITER iter (rec_map_.begin ());
+ LOG_RECORD_STORE_ITER iter_end (rec_map_.end ());
+
+ CORBA::ULong count = 0; // count of matches found.
+
+ while (iter != iter_end)
+ {
+ // Use an evaluator.
+ TAO_Log_Constraint_Visitor evaluator (iter->item ());
+
+ // Does it match the constraint?
+ if (interpreter.evaluate (evaluator) == 1)
+ {
+ this->remove_i (iter++);
+ count++;
+ }
+ else
+ {
+ ++iter;
+ }
+ }
+
+ return count;
+}
+
+ACE_SYNCH_RW_MUTEX&
+TAO_Hash_LogRecordStore::lock()
+{
+ return lock_;
+}
+
+
+void
+TAO_Hash_LogRecordStore::check_grammar (const char* grammar
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar))
+{
+ // Verify grammar
+ if (ACE_OS::strcmp (grammar, "TCL") != 0 &&
+ ACE_OS::strcmp (grammar, "ETCL") != 0 &&
+ ACE_OS::strcmp (grammar, "EXTENDED_TCL") != 0)
+ ACE_THROW (DsLogAdmin::InvalidGrammar ());
+}
+
+
+DsLogAdmin::AdministrativeState
+TAO_Hash_LogRecordStore::get_administrative_state (ACE_ENV_SINGLE_ARG_DECL) const
+{
+ return this->admin_state_;
+}
+
+void
+TAO_Hash_LogRecordStore::set_administrative_state (DsLogAdmin::AdministrativeState state
+ ACE_ENV_ARG_DECL)
+{
+ this->admin_state_ = state;
+}
+
+
+DsLogAdmin::CapacityAlarmThresholdList*
+TAO_Hash_LogRecordStore::get_capacity_alarm_thresholds (ACE_ENV_SINGLE_ARG_DECL) const
+{
+ DsLogAdmin::CapacityAlarmThresholdList* ret_val;
+ ACE_NEW_THROW_EX (ret_val,
+ DsLogAdmin::CapacityAlarmThresholdList (this->thresholds_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ return ret_val;
+}
+
+void
+TAO_Hash_LogRecordStore::set_capacity_alarm_thresholds (const DsLogAdmin::CapacityAlarmThresholdList& thresholds
+ ACE_ENV_ARG_DECL)
+{
+ this->thresholds_ = thresholds;
+}
+
+
+
+DsLogAdmin::ForwardingState
+TAO_Hash_LogRecordStore::get_forwarding_state (ACE_ENV_SINGLE_ARG_DECL) const
+{
+ return this->forward_state_;
+}
+
+void
+TAO_Hash_LogRecordStore::set_forwarding_state (DsLogAdmin::ForwardingState state
+ ACE_ENV_ARG_DECL)
+{
+ this->forward_state_ = state;
+}
+
+DsLogAdmin::TimeInterval
+TAO_Hash_LogRecordStore::get_interval (ACE_ENV_SINGLE_ARG_DECL) const
+{
+ return this->interval_;
+}
+
+void
+TAO_Hash_LogRecordStore::set_interval (const DsLogAdmin::TimeInterval &interval
+ ACE_ENV_ARG_DECL)
+{
+ this->interval_ = interval;
+}
+
+
+DsLogAdmin::LogFullActionType
+TAO_Hash_LogRecordStore::get_log_full_action (ACE_ENV_SINGLE_ARG_DECL) const
+{
+ return this->log_full_action_;
+}
+
+void
+TAO_Hash_LogRecordStore::set_log_full_action (DsLogAdmin::LogFullActionType action
+ ACE_ENV_ARG_DECL)
+{
+ this->log_full_action_ = action;
+}
+
+DsLogAdmin::QoSList *
+TAO_Hash_LogRecordStore::get_log_qos (ACE_ENV_SINGLE_ARG_DECL) const
+{
+ DsLogAdmin::QoSList* ret_val;
+ ACE_NEW_THROW_EX (ret_val,
+ DsLogAdmin::QoSList (this->log_qos_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ return ret_val;
+}
+
+void
+TAO_Hash_LogRecordStore::set_log_qos (const DsLogAdmin::QoSList& qos
+ ACE_ENV_ARG_DECL)
+{
+ this->log_qos_ = qos;
+}
+
+CORBA::ULong
+TAO_Hash_LogRecordStore::get_max_record_life (ACE_ENV_SINGLE_ARG_DECL) const
+{
+ return this->max_record_life_;
+}
+
+void
+TAO_Hash_LogRecordStore::set_max_record_life (CORBA::ULong max_record_life
+ ACE_ENV_ARG_DECL)
+{
+ this->max_record_life_ = max_record_life;
+}
+
+CORBA::ULongLong
+TAO_Hash_LogRecordStore::get_max_size (ACE_ENV_SINGLE_ARG_DECL) const
+{
+ return this->max_size_;
+}
+
+void
+TAO_Hash_LogRecordStore::set_max_size (CORBA::ULongLong size
+ ACE_ENV_ARG_DECL)
+{
+ this->max_size_ = size;
+}
+
+DsLogAdmin::WeekMask*
+TAO_Hash_LogRecordStore::get_week_mask (ACE_ENV_SINGLE_ARG_DECL)
+{
+ DsLogAdmin::WeekMask* ret_val;
+ ACE_NEW_THROW_EX (ret_val,
+ DsLogAdmin::WeekMask (this->weekmask_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ return ret_val;
+}
+
+void
+TAO_Hash_LogRecordStore::set_week_mask (const DsLogAdmin::WeekMask &masks
+ ACE_ENV_ARG_DECL)
+{
+ this->weekmask_ = masks;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/Hash_LogRecordStore.h b/TAO/orbsvcs/orbsvcs/Log/Hash_LogRecordStore.h
new file mode 100644
index 00000000000..d4518fd3825
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Hash_LogRecordStore.h
@@ -0,0 +1,399 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Hash_LogRecordStore.h
+ *
+ * $Id$
+ *
+ * @author Matthew Braun <mjb2@cs.wustl.edu>
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_HASH_LOG_RECORD_STORE_H
+#define TAO_HASH_LOG_RECORD_STORE_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/Log/LogRecordStore.h"
+#include "ace/Containers.h"
+#include "ace/RB_Tree.h"
+#include "ace/Synch_Traits.h"
+#include "ace/Null_Mutex.h"
+#include "ace/RW_Thread_Mutex.h"
+#include "ace/Reactor.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "orbsvcs/Log/log_serv_export.h"
+
+#define LOG_DEFAULT_MAX_REC_LIST_LEN 100
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_LogMgr_i;
+
+/**
+ * @class TAO_Hash_LogRecordStore
+ *
+ * @brief A concrete container class for storing DsLogAdmin::LogRecords
+ *
+ * This implementation uses an ACE_RB_Tree to store LogRecords.
+ * Permits fast searches by id and iteration, while allowing for
+ * ring-buffer like wrapping of entries.
+ *
+ * @note The name of this class is somewhat misleading, as it no
+ * longer uses a ACE_Hash_Map.
+ *
+ * @note LogRecords should be indexed by both id and timestamp.
+ * However, timestamps are not unique keys and there are no ACE
+ * multimap containers.
+ *
+ * @todo If ACE_RB_Tree supported an insertion "hint" like std::map,
+ * log insertion would be O(1) instead of O(lgN). This could be an
+ * issue for large log channels.
+ */
+class TAO_Log_Serv_Export TAO_Hash_LogRecordStore
+ : public TAO_LogRecordStore
+{
+ public:
+
+ // = Initialization and termination methods
+
+ /// Constructor.
+ TAO_Hash_LogRecordStore (TAO_LogMgr_i* logmgr,
+ DsLogAdmin::LogId id,
+ DsLogAdmin::LogFullActionType log_full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList* thresholds
+ );
+
+ /// Destructor.
+ virtual ~TAO_Hash_LogRecordStore (void);
+
+ /// Initialization.
+ virtual int open (void);
+
+ /// Close the record store.
+ virtual int close (void);
+
+
+ // = Log Parameters
+
+ /// Gets the administrative state of the log
+ virtual DsLogAdmin::AdministrativeState
+ get_administrative_state (ACE_ENV_SINGLE_ARG_DECL) const;
+
+ /// Sets the administrative state of the log
+ virtual void
+ set_administrative_state (DsLogAdmin::AdministrativeState
+ ACE_ENV_ARG_DECL);
+
+ /// Get the capacity alarm thresholds
+ virtual DsLogAdmin::CapacityAlarmThresholdList*
+ get_capacity_alarm_thresholds (ACE_ENV_SINGLE_ARG_DECL) const;
+
+ /// Set the capacity alarm thresholds
+ virtual void
+ set_capacity_alarm_thresholds (const DsLogAdmin::CapacityAlarmThresholdList& thresholds
+ ACE_ENV_ARG_DECL);
+
+ /// Gets the forwarding state
+ virtual DsLogAdmin::ForwardingState
+ get_forwarding_state (ACE_ENV_SINGLE_ARG_DECL) const;
+
+ /// Sets the forwarding state
+ virtual void
+ set_forwarding_state (DsLogAdmin::ForwardingState state
+ ACE_ENV_ARG_DECL);
+
+ /// Get the log duration
+ virtual DsLogAdmin::TimeInterval
+ get_interval (ACE_ENV_SINGLE_ARG_DECL) const;
+
+ /// Set the log duration.
+ virtual void
+ set_interval (const DsLogAdmin::TimeInterval & interval
+ ACE_ENV_ARG_DECL);
+
+ /// Gets the log full action
+ virtual DsLogAdmin::LogFullActionType
+ get_log_full_action (ACE_ENV_SINGLE_ARG_DECL) const;
+
+ /// Sets the log full action
+ virtual void
+ set_log_full_action(DsLogAdmin::LogFullActionType action
+ ACE_ENV_ARG_DECL);
+
+ /// Get the list of the QoS properties supported by the log.
+ virtual DsLogAdmin::QoSList*
+ get_log_qos (ACE_ENV_SINGLE_ARG_DECL) const;
+
+ /// Set the list of the QoS properties supported by the log.
+ virtual void
+ set_log_qos (const DsLogAdmin::QoSList& qos
+ ACE_ENV_ARG_DECL);
+
+ /// Gets the max record life
+ virtual CORBA::ULong
+ get_max_record_life (ACE_ENV_SINGLE_ARG_DECL) const;
+
+ /// Sets the max record life
+ virtual void
+ set_max_record_life (CORBA::ULong life
+ ACE_ENV_ARG_DECL);
+
+ /// Get the current set value of the max size of the log data.
+ virtual CORBA::ULongLong
+ get_max_size (ACE_ENV_SINGLE_ARG_DECL) const;
+
+ /// Set the max size of log data. size == 0, => infinite.
+ virtual void
+ set_max_size (CORBA::ULongLong size
+ ACE_ENV_ARG_DECL);
+
+ /// Get the weekly scheduling parameters
+ virtual DsLogAdmin::WeekMask*
+ get_week_mask (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Set the weekly scheduling parameters.
+ virtual void
+ set_week_mask (const DsLogAdmin::WeekMask & masks
+ ACE_ENV_ARG_DECL);
+
+
+ // = LogRecordStore status methods
+
+ /// Gets the current size of the log data.
+ virtual CORBA::ULongLong
+ get_current_size (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Get the number of records in the log right now.
+ virtual CORBA::ULongLong
+ get_n_records (ACE_ENV_SINGLE_ARG_DECL);
+
+
+ // = LogRecordStore gauge
+
+ /// Gets the current value of the "gauge" that measures the total
+ /// size of the records written to the log.
+ virtual CORBA::ULongLong
+ get_gauge(ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Resets the "gauge" to 0
+ virtual void
+ reset_gauge(ACE_ENV_SINGLE_ARG_DECL);
+
+
+ // = Record logging, retrieval, update and removal methods.
+
+ /// Insert rec into storage. Returns 0 on success -1 on failure and 1
+ /// if the log is full.
+ virtual int
+ log (const DsLogAdmin::LogRecord &rec ACE_ENV_ARG_DECL);
+
+ /// Deletes "old" records from the store.
+ virtual int
+ purge_old_records (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Set single record attributes.
+ virtual void
+ set_record_attribute (DsLogAdmin::RecordId id,
+ const DsLogAdmin::NVList & attr_list
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidRecordId,
+ DsLogAdmin::InvalidAttribute));
+
+ /// Set the attributes of all records that matches the
+ /// constraints with same attr_list.
+ virtual CORBA::ULong
+ set_records_attribute (const char * grammar,
+ const char * c,
+ const DsLogAdmin::NVList & attr_list
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint,
+ DsLogAdmin::InvalidAttribute));
+
+ /// Get the attributes of the record with id <id>. Raises
+ /// DsLogAdmin::InvalidRecordId
+ virtual DsLogAdmin::NVList*
+ get_record_attribute (DsLogAdmin::RecordId id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidRecordId));
+
+ /// Ensure changes have been flushed to persistent media
+ /// Returns 0 on success, -1 on failure.
+ virtual int
+ flush (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Returns all records in the log that match the given constraint
+ /// <c>.
+ virtual DsLogAdmin::RecordList*
+ query (const char * grammar,
+ const char * c,
+ DsLogAdmin::Iterator_out i
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint));
+
+ /// Retrieve <how_many> records from time <from_time> using iterator
+ /// <i>.
+ virtual DsLogAdmin::RecordList*
+ retrieve (DsLogAdmin::TimeT from_time,
+ CORBA::Long how_many,
+ DsLogAdmin::Iterator_out i
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Returns the number of records matching constraint <c>.
+ virtual CORBA::ULong
+ match (const char * grammar,
+ const char * c
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint));
+
+ /// Delete records matching constraint <c>.
+ virtual CORBA::ULong
+ delete_records (const char * grammar,
+ const char * c
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint));
+
+ /// Delete records matching ids in <ids>
+ virtual CORBA::ULong
+ delete_records_by_id (const DsLogAdmin::RecordIdList & ids
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ULong
+ remove_old_records (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Read-Write Lock
+ virtual ACE_SYNCH_RW_MUTEX& lock();
+
+/* protected: */
+ /// Defines types to represent the container that maps RecordIds to
+ /// LogRecords.
+ typedef ACE_RB_Tree <DsLogAdmin::RecordId,
+ DsLogAdmin::LogRecord,
+ ACE_Less_Than<DsLogAdmin::RecordId>,
+ ACE_Null_Mutex> LOG_RECORD_STORE;
+ typedef LOG_RECORD_STORE::ITERATOR LOG_RECORD_STORE_ITER;
+ typedef LOG_RECORD_STORE::ENTRY LOG_RECORD_STORE_ENTRY;
+
+protected:
+ /// Set rec to the pointer to the LogRecord with the given
+ /// id. Returns 0 on success, -1 on failure.
+ int retrieve_i (DsLogAdmin::RecordId id,
+ DsLogAdmin::LogRecord &rec
+ ACE_ENV_ARG_DECL);
+
+ /// Update into storage. Returns 0 on success -1 on failure.
+ int update_i (DsLogAdmin::LogRecord &rec
+ ACE_ENV_ARG_DECL);
+
+ /// Remove the record with id <id> from the LogRecordStore.
+ /// Returns 0 on success, -1 on failure.
+ int remove_i (DsLogAdmin::RecordId id
+ ACE_ENV_ARG_DECL);
+
+ /// Remove the record from the LogRecordStore.
+ void remove_i (LOG_RECORD_STORE_ITER iter
+ ACE_ENV_ARG_DECL);
+
+ DsLogAdmin::RecordList* query_i (const char *constraint,
+ DsLogAdmin::Iterator_out &iter_out,
+ CORBA::ULong how_many
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidConstraint));
+
+ /// Throws DsLogAdmin::InvalidGrammar if we don't support this grammar.
+ void check_grammar (const char* grammar ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar));
+
+
+ /// The size of a LogRecord
+ size_t log_record_size(const DsLogAdmin::LogRecord &rec);
+
+ TAO_LogMgr_i* logmgr_i_;
+
+ /// Assigned to a new RecordId and then incremented
+ /// @@ Should I have a list of reclaimed id's for when records are
+ /// deleted?
+ DsLogAdmin::RecordId maxid_;
+
+ /// The maximum size of the log.
+ CORBA::ULongLong max_size_;
+
+ /// The log id to which this LogRecordStore relates.
+ DsLogAdmin::LogId id_;
+
+ /// The current size (in bytes) of the log.
+ CORBA::ULongLong current_size_;
+
+ /// The current number of records in the log.
+ CORBA::ULongLong num_records_;
+
+ /// The current value of the "gauge" that measures the total size of
+ /// the records written to the log.
+ CORBA::ULongLong gauge_;
+
+ /// The max size of the record list returned in a query.
+ CORBA::ULong max_rec_list_len_;
+
+ /// The map of RecordId's to LogRecord's
+ LOG_RECORD_STORE rec_map_;
+
+
+ /// The administrative state of the log
+ DsLogAdmin::AdministrativeState admin_state_;
+
+ DsLogAdmin::CapacityAlarmThresholdList
+ thresholds_;
+
+ /// The forwarding state of the log
+ DsLogAdmin::ForwardingState forward_state_;
+
+ /// The interval during which the log should be in operation
+ DsLogAdmin::TimeInterval interval_;
+
+ /// The action to take if the log reaches max capacity
+ DsLogAdmin::LogFullActionType log_full_action_;
+
+ /// The list of the QoS properties supported by the log.
+ DsLogAdmin::QoSList log_qos_;
+
+ /// The maximum record lifetime
+ CORBA::ULong max_record_life_;
+
+ /// The days of the week that the log should be operational
+ DsLogAdmin::WeekMask weekmask_;
+
+
+ ACE_Reactor* reactor_;
+
+ PortableServer::POA_var iterator_poa_;
+
+ mutable ACE_SYNCH_RW_MUTEX lock_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /*TAO_HASH_LOG_RECORD_STORE_H*/
diff --git a/TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.cpp b/TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.cpp
new file mode 100644
index 00000000000..458cfca4155
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.cpp
@@ -0,0 +1,269 @@
+#include "orbsvcs/Log/Hash_LogStore.h"
+#include "orbsvcs/Log/Hash_LogRecordStore.h"
+#include "orbsvcs/Log/LogMgr_i.h"
+#include "ace/Auto_Ptr.h"
+
+ACE_RCSID (Log,
+ Hash_LogStore,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Hash_LogStore::TAO_Hash_LogStore(TAO_LogMgr_i* logmgr_i)
+ : next_id_ (0),
+ logmgr_i_ (logmgr_i)
+{
+}
+
+
+TAO_Hash_LogStore::~TAO_Hash_LogStore()
+{
+}
+
+
+DsLogAdmin::LogList*
+TAO_Hash_LogStore::list_logs (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ DsLogAdmin::LogList* list;
+
+ // Figure out the length of the list.
+ CORBA::ULong len = static_cast<CORBA::ULong> (hash_map_.current_size ());
+
+ // Allocate the list of <len> length.
+ ACE_NEW_THROW_EX (list,
+ DsLogAdmin::LogList (len),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ list->length (len);
+
+ // Create an iterator
+ HASHMAP::ITERATOR iter (hash_map_);
+
+ // Iterate over and populate the list.
+ HASHMAP::ENTRY *hash_entry = 0;
+
+ for (CORBA::ULong i = 0; i < len; i++)
+ {
+ iter.next (hash_entry);
+ iter.advance ();
+ (*list)[i] = logmgr_i_->create_log_reference (static_cast<DsLogAdmin::LogId> (hash_entry->ext_id_)
+ ACE_ENV_ARG_PARAMETER);
+ }
+
+ return list;
+}
+
+DsLogAdmin::LogIdList*
+TAO_Hash_LogStore::list_logs_by_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ DsLogAdmin::LogIdList* list;
+
+ // Figure out the length of the list.
+ CORBA::ULong len = static_cast<CORBA::ULong> (hash_map_.current_size ());
+
+ // Allocate the list of <len> length.
+ ACE_NEW_THROW_EX (list,
+ DsLogAdmin::LogIdList (len),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ list->length (len);
+
+ // Create an iterator
+ HASHMAP::ITERATOR iter (hash_map_);
+
+ // Iterate over and populate the list.
+ HASHMAP::ENTRY *hash_entry = 0;
+
+ for (CORBA::ULong i = 0; i < len; i++)
+ {
+ iter.next (hash_entry);
+ iter.advance ();
+ (*list)[i] = hash_entry->ext_id_;
+ }
+
+ return list;
+}
+
+
+DsLogAdmin::Log_ptr
+TAO_Hash_LogStore::find_log (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK (DsLogAdmin::Log::_nil ());
+
+ if (hash_map_.find (id) != 0)
+ {
+ return DsLogAdmin::Log::_nil ();
+ }
+ else
+ {
+ return logmgr_i_->create_log_reference (id ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+
+bool
+TAO_Hash_LogStore::exists (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (false);
+
+ return (this->hash_map_.find (id) == 0);
+}
+
+
+int
+TAO_Hash_LogStore::remove (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (-1);
+
+ TAO_Hash_LogRecordStore* recordstore;
+
+ int retval = this->hash_map_.unbind (id, recordstore);
+ if (retval == 0)
+ {
+ delete recordstore;
+ }
+
+ return retval;
+}
+
+
+void
+TAO_Hash_LogStore::create(DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList* thresholds,
+ DsLogAdmin::LogId_out id_out
+ ACE_ENV_ARG_DECL)
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ DsLogAdmin::LogId id;
+
+ while (this->hash_map_.find((id = this->next_id_++)) == 0)
+ ;
+ id_out = id;
+
+ TAO_Hash_LogRecordStore* impl = 0;
+ ACE_NEW_THROW_EX (impl,
+ TAO_Hash_LogRecordStore (this->logmgr_i_,
+ id,
+ full_action,
+ max_size,
+ thresholds
+ ),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ auto_ptr<TAO_Hash_LogRecordStore> recordstore (impl);
+
+ if (this->hash_map_.bind (id, recordstore.get ()) != 0)
+ {
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ recordstore.release ();
+}
+
+
+void
+TAO_Hash_LogStore::create_with_id (DsLogAdmin::LogId id,
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList* thresholds
+ ACE_ENV_ARG_DECL)
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ if (this->hash_map_.find (id) == 0)
+ {
+ ACE_THROW (DsLogAdmin::LogIdAlreadyExists ());
+ }
+
+ TAO_Hash_LogRecordStore* impl = 0;
+ ACE_NEW_THROW_EX (impl,
+ TAO_Hash_LogRecordStore (this->logmgr_i_,
+ id,
+ full_action,
+ max_size,
+ thresholds
+ ),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ auto_ptr<TAO_Hash_LogRecordStore> recordstore (impl);
+
+ if (this->hash_map_.bind (id, recordstore.get ()) != 0)
+ {
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ recordstore.release ();
+}
+
+
+TAO_LogRecordStore*
+TAO_Hash_LogStore::get_log_record_store (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ TAO_Hash_LogRecordStore* recordstore = 0;
+
+ if (hash_map_.find (id, recordstore) != 0)
+ {
+ return 0;
+ }
+
+ return recordstore;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.h b/TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.h
new file mode 100644
index 00000000000..7c43c34a8a7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.h
@@ -0,0 +1,130 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Hash_LogStore.h
+ *
+ * $Id$
+ *
+ * @author Matthew Braun <mjb2@cs.wustl.edu>
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_HASH_LOGSTORE_H
+#define TAO_TLS_HASH_LOGSTORE_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/Log/LogStore.h"
+#include "ace/Hash_Map_Manager.h"
+#include "ace/Synch_Traits.h"
+#include "ace/Null_Mutex.h"
+#include "ace/RW_Thread_Mutex.h"
+#include "orbsvcs/Log/log_serv_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Reactor;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_LogMgr_i;
+class TAO_Hash_LogRecordStore;
+
+class TAO_Log_Serv_Export TAO_Hash_LogStore
+ : public TAO_LogStore
+{
+public:
+ // = Initialization and Termination Methods
+
+ /// Constructor.
+ TAO_Hash_LogStore (TAO_LogMgr_i* mgr);
+
+ /// Destructor.
+ virtual ~TAO_Hash_LogStore ();
+
+
+ /// Lists all logs created by the log factory.
+ virtual DsLogAdmin::LogList *
+ list_logs (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// Lists all log ids.
+ virtual DsLogAdmin::LogIdList *
+ list_logs_by_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// Returns a reference to the log with the supplied id.
+ virtual DsLogAdmin::Log_ptr
+ find_log (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// Returns true if log exists, otherwise false
+ virtual bool exists (DsLogAdmin::LogId id ACE_ENV_ARG_DECL);
+
+ /// Remove the given entry from the hash table.
+ virtual int remove (DsLogAdmin::LogId id ACE_ENV_ARG_DECL);
+
+ /// @brief Create log
+ virtual void
+ create (DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList* thresholds,
+ DsLogAdmin::LogId_out id_out
+ ACE_ENV_ARG_DECL);
+
+ /// @brief Create log
+ virtual void
+ create_with_id (DsLogAdmin::LogId id,
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList* thresholds
+ ACE_ENV_ARG_DECL);
+
+ /// @brief Get log record store
+ ///
+ /// Get/Create a log record store for log channel @a id.
+ ///
+ /// @param id log id
+ ///
+ virtual TAO_LogRecordStore*
+ get_log_record_store (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL);
+
+private:
+ ACE_SYNCH_RW_MUTEX lock_;
+
+ /// Define the HASHMAP.
+ typedef ACE_Hash_Map_Manager <DsLogAdmin::LogId,
+ TAO_Hash_LogRecordStore*,
+ ACE_Null_Mutex> HASHMAP;
+
+ /// The map of Logs created.
+ HASHMAP hash_map_;
+
+ /// The next log id to be assigned (if it hasn't already been
+ /// taken by create_with_id().
+ DsLogAdmin::LogId next_id_;
+
+ TAO_LogMgr_i* logmgr_i_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_TLS_HASH_LOGSTORE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/Hash_Persistence_Strategy.cpp b/TAO/orbsvcs/orbsvcs/Log/Hash_Persistence_Strategy.cpp
new file mode 100644
index 00000000000..3d8882352c6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Hash_Persistence_Strategy.cpp
@@ -0,0 +1,25 @@
+#include "orbsvcs/Log/Hash_Persistence_Strategy.h"
+#include "orbsvcs/Log/Hash_LogStore.h"
+
+ACE_RCSID (Log,
+ Hash_Persistence_Strategy,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Hash_Persistence_Strategy::TAO_Hash_Persistence_Strategy()
+{
+}
+
+
+TAO_Hash_Persistence_Strategy::~TAO_Hash_Persistence_Strategy()
+{
+}
+
+TAO_LogStore *
+TAO_Hash_Persistence_Strategy::create_log_store(TAO_LogMgr_i *logmgr_i)
+{
+ return new TAO_Hash_LogStore (logmgr_i);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/Hash_Persistence_Strategy.h b/TAO/orbsvcs/orbsvcs/Log/Hash_Persistence_Strategy.h
new file mode 100644
index 00000000000..43f5e4a6ae5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Hash_Persistence_Strategy.h
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Hash_Persistence_Strategy.h
+ *
+ * $Id$
+ *
+ * @author Matthew Braun <mjb2@cs.wustl.edu>
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_HASH_PERSISTENCE_STRATEGY_H
+#define TAO_TLS_HASH_PERSISTENCE_STRATEGY_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/Log/Log_Persistence_Strategy.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Hash_Persistence_Strategy
+ *
+ * @brief Concrete Strategy for Log / Log Record Storage
+ *
+ * Stores log parameters and log records in hash maps
+ */
+class TAO_Log_Serv_Export TAO_Hash_Persistence_Strategy
+ : public TAO_Log_Persistence_Strategy
+{
+public:
+ // = Initialization and Termination Methods
+
+ /// Constructor.
+ TAO_Hash_Persistence_Strategy ();
+
+ /// Destructor.
+ virtual ~TAO_Hash_Persistence_Strategy ();
+
+ /// @brief Log Store Factory
+ virtual TAO_LogStore*
+ create_log_store (TAO_LogMgr_i* mgr);
+
+private:
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_TLS_HASH_PERSISTENCE_STRATEGY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/Iterator_i.cpp b/TAO/orbsvcs/orbsvcs/Log/Iterator_i.cpp
new file mode 100644
index 00000000000..d26dc48d882
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Iterator_i.cpp
@@ -0,0 +1,73 @@
+#include "orbsvcs/Log/Iterator_i.h"
+
+ACE_RCSID (Log,
+ Iterator_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// iterator inactivity timeout
+ACE_Time_Value
+TAO_Iterator_i::timeout_(60 * 60);
+
+TAO_Iterator_i::TAO_Iterator_i (ACE_Reactor* reactor)
+ : reactor_ (reactor)
+{
+ if (this->timeout_ != ACE_Time_Value::zero)
+ {
+ this->timer_id_ =
+ this->reactor_->schedule_timer (this, 0, this->timeout_);
+ }
+}
+
+
+TAO_Iterator_i::~TAO_Iterator_i (void)
+{
+ // cancel timer
+ if (this->timer_id_ != -1)
+ {
+ this->reactor_->cancel_timer (this->timer_id_);
+ }
+}
+
+
+void
+TAO_Iterator_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableServer::POA_ptr poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::ObjectId_var oid =
+ poa->servant_to_id (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Goodbye cruel world...
+ // deactivate from the poa.
+ poa->deactivate_object (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ return;
+}
+
+
+int
+TAO_Iterator_i::handle_timeout(const ACE_Time_Value&, const void*)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/Iterator_i.h b/TAO/orbsvcs/orbsvcs/Log/Iterator_i.h
new file mode 100644
index 00000000000..acfa7b89f63
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Iterator_i.h
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Iterator_i.h
+ *
+ * $Id$
+ *
+ * Implementation of the DsLogAdmin::Iterator interface.
+ *
+ *
+ * @author Matthew Braun <mjb2@cs.wustl.edu>
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ *
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_ITERATOR_H
+#define TAO_TLS_ITERATOR_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/DsLogAdminS.h"
+#include "ace/Event_Handler.h"
+#include "ace/Reactor.h"
+#include "orbsvcs/Log/log_serv_export.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Iterator_i
+ *
+ * @brief Iterator to get LogRecords for the log via a query.
+ */
+class TAO_Log_Serv_Export TAO_Iterator_i
+ : public virtual POA_DsLogAdmin::Iterator,
+ public ACE_Event_Handler
+{
+public:
+
+ // = Initialization and Termination methods.
+
+ /// Constructor.
+ TAO_Iterator_i (ACE_Reactor* reactor);
+
+ /// Destructor.
+ virtual ~TAO_Iterator_i (void);
+
+ /// Gets a list of LogRecords.
+ virtual DsLogAdmin::RecordList* get (CORBA::ULong position,
+ CORBA::ULong how_many
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidParam)) = 0;
+
+ /// This destroys the iterator.
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+ /// Reactor
+ ACE_Reactor* reactor_;
+
+ /// Timeout
+ static ACE_Time_Value timeout_;
+
+ /// Timer ID
+ long timer_id_;
+
+ virtual int handle_timeout (const ACE_Time_Value&, const void *);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TLS_ITERATOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/LogActivator.cpp b/TAO/orbsvcs/orbsvcs/Log/LogActivator.cpp
new file mode 100644
index 00000000000..5f7c64cd724
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/LogActivator.cpp
@@ -0,0 +1,58 @@
+#include "orbsvcs/Log/LogActivator.h"
+
+ACE_RCSID (Log,
+ LogActivator,
+ "$Id$")
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+#include "orbsvcs/Log/LogMgr_i.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LogActivator::TAO_LogActivator (TAO_LogMgr_i &logmgr_i)
+ : logmgr_i_ (logmgr_i)
+{
+}
+
+TAO_LogActivator::~TAO_LogActivator ()
+{
+}
+
+PortableServer::Servant
+TAO_LogActivator::incarnate (const PortableServer::ObjectId& oid,
+ PortableServer::POA_ptr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::ForwardRequest
+ ))
+{
+ CORBA::String_var poa_id = PortableServer::ObjectId_to_string (oid);
+
+ DsLogAdmin::LogId id = ACE_OS::strtoul(poa_id.in (), 0, 0);
+
+ if (!logmgr_i_.exists(id ACE_ENV_ARG_PARAMETER))
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (), 0);
+ ACE_CHECK_RETURN(0);
+
+ return logmgr_i_.create_log_servant (id ACE_ENV_ARG_PARAMETER);
+}
+
+
+void
+TAO_LogActivator::etherealize (const PortableServer::ObjectId&,
+ PortableServer::POA_ptr,
+ PortableServer::Servant servant,
+ CORBA::Boolean,
+ CORBA::Boolean remaining_activations
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (!remaining_activations)
+ {
+ delete servant;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/Log/LogActivator.h b/TAO/orbsvcs/orbsvcs/Log/LogActivator.h
new file mode 100644
index 00000000000..c25f466b0ed
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/LogActivator.h
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LogActivator.h
+ *
+ * $Id$
+ *
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_LOGACTIVATOR_H
+#define TAO_TLS_LOGACTIVATOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/DsLogAdminC.h"
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+
+#include "orbsvcs/Log/log_serv_export.h"
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/PortableServer/ServantActivatorC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// forward declarations
+class TAO_LogMgr_i;
+
+/// @class TAO_LogActivator
+/// @brief Log Servant Activator
+///
+/// A servant activator to create Log servants. Permits servants to
+/// be "lazily" created on demand. This allows persistent logging
+/// strategies to avoid creating servants for each log when the
+/// service is started.
+///
+class TAO_Log_Serv_Export TAO_LogActivator
+ : public virtual PortableServer::ServantActivator
+{
+public:
+ /// @brief Constructor
+ ///
+ TAO_LogActivator(TAO_LogMgr_i& logmgr_i);
+
+ /// @brief Destructor
+ ///
+ virtual ~TAO_LogActivator();
+
+ virtual PortableServer::Servant incarnate (const PortableServer::ObjectId& oid,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ PortableServer::ForwardRequest
+ ));
+
+ virtual void etherealize (const PortableServer::ObjectId& oid,
+ PortableServer::POA_ptr poa,
+ PortableServer::Servant servant,
+ CORBA::Boolean cleanup_in_progress,
+ CORBA::Boolean remaining_activations
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+private:
+ TAO_LogMgr_i& logmgr_i_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_HAS_MINIMUM_POA */
+
+#include /**/ "ace/post.h"
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/Log/LogMgr_i.cpp b/TAO/orbsvcs/orbsvcs/Log/LogMgr_i.cpp
new file mode 100644
index 00000000000..23bb04d2ea1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/LogMgr_i.cpp
@@ -0,0 +1,296 @@
+#include "orbsvcs/Log/LogMgr_i.h"
+#include "orbsvcs/Log/LogActivator.h"
+#include "ace/Dynamic_Service.h"
+#include "tao/Utils/PolicyList_Destroyer.h"
+#include "orbsvcs/Log/Hash_Persistence_Strategy.h"
+#include "orbsvcs/Log/LogStore.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID (Log,
+ LogMgr_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LogMgr_i::TAO_LogMgr_i ()
+ : logstore_ (0)
+{
+}
+
+
+TAO_LogMgr_i::~TAO_LogMgr_i ()
+{
+ delete logstore_;
+}
+
+
+void
+TAO_LogMgr_i::init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+ this->poa_ = PortableServer::POA::_duplicate (poa);
+
+ PortableServer::POAManager_var poa_manager =
+ this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ {
+ TAO::Utils::PolicyList_Destroyer policies(1);
+
+ // Create Factory POA
+ policies.length (1);
+ policies[0] =
+ this->poa_->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->factory_poa_ = this->poa_->create_POA ("factory_POA",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+
+ {
+ TAO::Utils::PolicyList_Destroyer policies(2);
+
+ // Create Log POA
+ policies.length (2);
+ policies[0] =
+ this->poa_->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ policies[1] =
+ this->poa_->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+ policies.length(4);
+ policies[2] =
+ this->poa_->create_servant_retention_policy (PortableServer::RETAIN
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ policies[3] =
+ this->poa_->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#endif
+
+ this->log_poa_ = this->factory_poa_->create_POA ("log_POA",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+ PortableServer::ServantActivator* servant_activator = 0;
+
+ ACE_NEW_THROW_EX (servant_activator,
+ TAO_LogActivator (*this),
+ CORBA::NO_MEMORY ());
+
+ this->log_poa_->set_servant_manager(servant_activator
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#endif
+
+ // Load Log Strategy
+ TAO_Log_Persistence_Strategy* strategy_ = 0;
+
+ strategy_ =
+ ACE_Dynamic_Service<TAO_Log_Persistence_Strategy>::instance ("Log_Persistence");
+ if (strategy_ == 0)
+ {
+ strategy_ = new TAO_Hash_Persistence_Strategy;
+ }
+
+ logstore_ = strategy_->create_log_store (this);
+}
+
+PortableServer::ObjectId*
+TAO_LogMgr_i::create_objectid (DsLogAdmin::LogId id)
+{
+ char buf[32];
+ ACE_OS::sprintf(buf, "%lu", static_cast<unsigned long>(id));
+
+ PortableServer::ObjectId_var oid =
+ PortableServer::string_to_ObjectId(buf);
+
+ return oid._retn ();
+}
+
+DsLogAdmin::Log_ptr
+TAO_LogMgr_i::create_log_reference (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::ObjectId_var oid =
+ this->create_objectid (id);
+ CORBA::RepositoryId_var intf =
+ this->create_repositoryid ();
+
+ CORBA::Object_var obj =
+ this->log_poa_->create_reference_with_id (oid.in (),
+ intf.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ DsLogAdmin::Log_var log =
+ DsLogAdmin::Log::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ return log._retn();
+}
+
+DsLogAdmin::Log_ptr
+TAO_LogMgr_i::create_log_object (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::ServantBase* servant = 0;
+
+ servant = create_log_servant (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ PortableServer::ServantBase_var safe_servant = servant;
+ // Transfer ownership to the POA.
+
+ // Obtain ObjectId
+ PortableServer::ObjectId_var oid = this->create_objectid (id);
+
+ // Register with the poa
+ this->log_poa_->activate_object_with_id (oid.in (),
+ servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ return create_log_reference (id ACE_ENV_ARG_PARAMETER);
+}
+
+DsLogAdmin::LogList*
+TAO_LogMgr_i::list_logs (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->logstore_->list_logs (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+
+DsLogAdmin::LogIdList*
+TAO_LogMgr_i::list_logs_by_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->logstore_->list_logs_by_id (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+
+DsLogAdmin::Log_ptr
+TAO_LogMgr_i::find_log (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->logstore_->find_log (id ACE_ENV_ARG_PARAMETER);
+}
+
+
+TAO_LogRecordStore*
+TAO_LogMgr_i::get_log_record_store (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+{
+ return this->logstore_->get_log_record_store (id ACE_ENV_ARG_PARAMETER);
+}
+
+
+bool
+TAO_LogMgr_i::exists (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+{
+ return this->logstore_->exists (id ACE_ENV_ARG_PARAMETER);
+}
+
+
+int
+TAO_LogMgr_i::remove (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+{
+ return this->logstore_->remove (id ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_LogMgr_i::create_i (DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList* thresholds,
+ DsLogAdmin::LogId_out id_out
+ ACE_ENV_ARG_DECL)
+{
+ // Validate log_full_action before creating log
+ if (full_action != DsLogAdmin::wrap && full_action != DsLogAdmin::halt)
+ ACE_THROW (DsLogAdmin::InvalidLogFullAction ());
+
+ if (thresholds)
+ {
+ // @@ JTC - validate thresholds here
+ }
+
+ this->logstore_->create (full_action,
+ max_size,
+ thresholds,
+ id_out
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogMgr_i::create_with_id_i (DsLogAdmin::LogId id,
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList* thresholds
+ ACE_ENV_ARG_DECL)
+{
+ // Validate log_full_action before creating log
+ if (full_action != DsLogAdmin::wrap && full_action != DsLogAdmin::halt)
+ ACE_THROW (DsLogAdmin::InvalidLogFullAction ());
+
+ if (thresholds)
+ {
+ // @@ JTC - validate thresholds here
+ }
+
+ this->logstore_->create_with_id (id,
+ full_action,
+ max_size,
+ thresholds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CORBA::ORB_ptr
+TAO_LogMgr_i::orb ()
+{
+ return this->orb_.in ();
+}
+
+PortableServer::POA_ptr
+TAO_LogMgr_i::factory_poa ()
+{
+ return this->factory_poa_.in ();
+}
+
+PortableServer::POA_ptr
+TAO_LogMgr_i::log_poa ()
+{
+ return this->log_poa_.in ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/LogMgr_i.h b/TAO/orbsvcs/orbsvcs/Log/LogMgr_i.h
new file mode 100644
index 00000000000..a75417898c8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/LogMgr_i.h
@@ -0,0 +1,202 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LogMgr_i.h
+ *
+ * $Id$
+ *
+ * Implementation of the DsLogAdmin::LogMgr interface.
+ *
+ * @author Matthew Braun <mjb2@cs.wustl.edu>
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_LOGMGR_I_H
+#define TAO_TLS_LOGMGR_I_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/DsLogAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Log/Log_i.h"
+#include "orbsvcs/Log/Log_Persistence_Strategy.h"
+#include "orbsvcs/Log/log_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_LogMgr_i
+ * @brief Log Factory
+ *
+ * The implementation delegates operations to a dynamically loaded
+ * Strategy class.
+ */
+class TAO_Log_Serv_Export TAO_LogMgr_i
+ : public virtual POA_DsLogAdmin::LogMgr
+{
+public:
+
+ // = Initialization and Termination Methods
+
+ /// Constructor.
+ TAO_LogMgr_i ();
+
+ /// Destructor.
+ virtual ~TAO_LogMgr_i ();
+
+ /// Lists all log object references.
+ DsLogAdmin::LogList *
+ list_logs (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// Lists all log ids.
+ DsLogAdmin::LogIdList *
+ list_logs_by_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// Returns a reference to the log with the supplied id.
+ DsLogAdmin::Log_ptr
+ find_log (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// Returns true if log exists, otherwise false
+ bool exists (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL);
+
+ /// Remove the given entry from the container.
+ int remove (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL);
+
+ /// @brief Create ObjectId
+ ///
+ /// Create object id for log channel @ id.
+ ///
+ /// @param id log id
+ ///
+ /// @return object id
+ ///
+ virtual PortableServer::ObjectId*
+ create_objectid (DsLogAdmin::LogId id);
+
+ /// @brief Create log reference
+ ///
+ /// Create object reference for log channel @a id.
+ ///
+ /// @param id log id
+ ///
+ /// @return object reference
+ ///
+ virtual DsLogAdmin::Log_ptr
+ create_log_reference (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL);
+
+ /// @brief Create log object
+ ///
+ /// Create Log object for log channel @a id.
+ ///
+ /// @param id log id
+ ///
+ /// @return object reference
+ ///
+ virtual DsLogAdmin::Log_ptr
+ create_log_object (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL);
+
+ /// @brief Create log repository id
+ ///
+ /// Return repository id for log
+ ///
+ /// @return repository id
+ ///
+ virtual CORBA::RepositoryId
+ create_repositoryid () = 0;
+
+ /// @brief Create log servant
+ ///
+ /// Create Log servant for log channel @a id.
+ ///
+ /// @param id log id
+ ///
+ /// @return pointer to servant
+ virtual PortableServer::ServantBase*
+ create_log_servant (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// @brief Get log record store
+ ///
+ /// Get/Create a log record store for log channel @a id.
+ ///
+ /// @param id log id
+ ///
+ TAO_LogRecordStore*
+ get_log_record_store (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL);
+
+ CORBA::ORB_ptr orb();
+
+ PortableServer::POA_ptr factory_poa();
+
+ PortableServer::POA_ptr log_poa();
+
+protected:
+ /// @brief Initialize
+ ///
+ /// Creates factory and log channel POAs, and obtains the LogStore
+ /// from a dynamically loaded Log_Persistence_Strategy (if one was
+ /// specified in the service config file, otherwise the default
+ /// Hash_Persistence_Strategy is used.)
+ ///
+ /// @param orb ORB
+ /// @param poa Parent POA
+ ///
+ void init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL);
+
+ /// @brief Create log
+ void create_i (DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList* thresholds,
+ DsLogAdmin::LogId_out id_out
+ ACE_ENV_ARG_DECL);
+
+ /// @brief Create log
+ void create_with_id_i (DsLogAdmin::LogId id,
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList* thresholds
+ ACE_ENV_ARG_DECL);
+
+ /// ORB.
+ CORBA::ORB_var orb_;
+
+ /// POA.
+ PortableServer::POA_var poa_;
+
+ /// Factory POA.
+ PortableServer::POA_var factory_poa_;
+
+ /// Log POA.
+ PortableServer::POA_var log_poa_;
+
+private:
+ TAO_LogStore* logstore_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TLS_LOGMGR_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/LogNotification.cpp b/TAO/orbsvcs/orbsvcs/Log/LogNotification.cpp
new file mode 100644
index 00000000000..e7f422dd36b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/LogNotification.cpp
@@ -0,0 +1,418 @@
+#include "orbsvcs/Log/LogNotification.h"
+
+#include "orbsvcs/Time_Utilities.h"
+#include "tao/debug.h"
+#include "ace/OS_NS_sys_time.h"
+
+ACE_RCSID (Log,
+ LogNotification,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LogNotification::TAO_LogNotification (void)
+{
+}
+
+TAO_LogNotification::~TAO_LogNotification (void)
+{
+}
+
+void
+TAO_LogNotification::object_creation (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ CORBA::Any any;
+ DsLogNotification::ObjectCreation event;
+
+ // The log id.
+ event.id = id;
+
+ TimeBase::TimeT current_time;
+ ACE_Time_Value now = ACE_OS::gettimeofday ();
+ ORBSVCS_Time::Time_Value_to_TimeT(current_time, now);
+
+ event.time = current_time;
+
+ any <<= event;
+
+ this->send_notification (any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::object_deletion (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any any;
+ DsLogNotification::ObjectDeletion event;
+
+ event.id = id;
+
+ TimeBase::TimeT current_time;
+ ACE_Time_Value now = ACE_OS::gettimeofday ();
+ ORBSVCS_Time::Time_Value_to_TimeT(current_time, now);
+
+ // Time object deleted.
+ event.time = current_time;
+
+ any <<= event;
+
+ this->send_notification (any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::processing_error_alarm (CORBA::ULong error_num,
+ const char* error_string
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any any;
+ DsLogNotification::ProcessingErrorAlarm event;
+
+ event.error_num = error_num;
+ event.error_string = CORBA::string_dup (error_string);
+
+ any <<= event;
+
+ this->send_notification (any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::attribute_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogNotification::AttributeType type,
+ CORBA::Any oldValue,
+ CORBA::Any newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any any;
+ DsLogNotification::AttributeValueChange event;
+
+ event.logref = DsLogAdmin::Log::_duplicate (log);
+ event.id = id;
+
+ TimeBase::TimeT current_time;
+ ACE_Time_Value now = ACE_OS::gettimeofday ();
+ ORBSVCS_Time::Time_Value_to_TimeT (current_time, now);
+
+ event.time = current_time;
+
+ // The attribute type e.g. logFullAction, maxLogSize etc.
+ event.type = type;
+ event.old_value = oldValue;
+ event.new_value = newValue;
+
+ any <<= event;
+
+ this->send_notification (any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::capacity_alarm_threshold_value_change (
+ DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ const DsLogAdmin::CapacityAlarmThresholdList& oldValue,
+ const DsLogAdmin::CapacityAlarmThresholdList& newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any oldV, newV;
+ oldV <<= oldValue;
+ newV <<= newValue;
+
+ this->attribute_value_change (log,
+ id,
+ DsLogNotification::capacityAlarmThreshold,
+ oldV,
+ newV
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::log_full_action_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ CORBA::ULong oldValue,
+ CORBA::ULong newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any oldV, newV;
+ oldV <<= oldValue;
+ newV <<= newValue;
+
+ this->attribute_value_change (log,
+ id,
+ DsLogNotification::logFullAction,
+ oldV,
+ newV
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::max_log_size_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ CORBA::ULongLong oldValue,
+ CORBA::ULongLong newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any oldV, newV;
+ oldV <<= oldValue;
+ newV <<= newValue;
+
+ this->attribute_value_change (log,
+ id,
+ DsLogNotification::maxLogSize,
+ oldV,
+ newV
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::start_time_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogAdmin::TimeT oldValue,
+ DsLogAdmin::TimeT newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any oldV, newV;
+ oldV <<= oldValue;
+ newV <<= newValue;
+
+ this->attribute_value_change (log,
+ id,
+ DsLogNotification::startTime,
+ oldV,
+ newV
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::stop_time_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogAdmin::TimeT oldValue,
+ DsLogAdmin::TimeT newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any oldV, newV;
+ oldV <<= oldValue;
+ newV <<= newValue;
+
+ this->attribute_value_change (log,
+ id,
+ DsLogNotification::stopTime,
+ oldV,
+ newV
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::week_mask_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ const DsLogAdmin::WeekMask& oldValue,
+ const DsLogAdmin::WeekMask& newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any oldV, newV;
+ oldV <<= oldValue;
+ newV <<= newValue;
+
+ this->attribute_value_change (log,
+ id,
+ DsLogNotification::weekMask,
+ oldV,
+ newV
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::max_record_life_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ CORBA::ULong oldValue,
+ CORBA::ULong newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any oldV, newV;
+ oldV <<= oldValue;
+ newV <<= newValue;
+
+ this->attribute_value_change (log,
+ id,
+ DsLogNotification::maxRecordLife,
+ oldV,
+ newV
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::quality_of_service_value_change (
+ DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ const DsLogAdmin::QoSList& oldValue,
+ const DsLogAdmin::QoSList& newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any oldV, newV;
+ oldV <<= oldValue;
+ newV <<= newValue;
+
+ this->attribute_value_change (log,
+ id,
+ DsLogNotification::qualityOfService,
+ oldV,
+ newV
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::state_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogNotification::StateType type,
+ CORBA::Any newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any any;
+ DsLogNotification::StateChange event;
+
+ event.logref = DsLogAdmin::Log::_duplicate (log);
+ event.id = id;
+
+ TimeBase::TimeT current_time;
+ ACE_Time_Value now = ACE_OS::gettimeofday ();
+ ORBSVCS_Time::Time_Value_to_TimeT (current_time, now);
+ event.time = current_time;
+
+ // Administrative, Operational or Forwarding state.
+ event.type = type;
+
+ event.new_value = newValue;
+
+ any <<= event;
+
+ this->send_notification (any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::administrative_state_change (
+ DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogAdmin::AdministrativeState newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any newV;
+ newV <<= newValue;
+
+ this->state_change (log,
+ id,
+ DsLogNotification::administrativeState,
+ newV
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::operational_state_change (
+ DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogAdmin::OperationalState newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any newV;
+ newV <<= newValue;
+
+ this->state_change (log,
+ id,
+ DsLogNotification::operationalState,
+ newV
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::forwarding_state_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogAdmin::ForwardingState newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any newV;
+ newV <<= newValue;
+
+ this->state_change (log,
+ id,
+ DsLogNotification::forwardingState,
+ newV
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::threshold_alarm (
+ DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogAdmin::Threshold crossedValue,
+ DsLogAdmin::Threshold observedValue,
+ DsLogNotification::PerceivedSeverityType severity
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Any any;
+ DsLogNotification::ThresholdAlarm event;
+
+ event.logref = DsLogAdmin::Log::_duplicate (log);
+ event.id = id;
+
+ TimeBase::TimeT current_time;
+ ACE_Time_Value now = ACE_OS::gettimeofday ();
+ ORBSVCS_Time::Time_Value_to_TimeT(current_time, now);
+ event.time = current_time;
+
+ event.crossed_value = crossedValue;
+ event.observed_value = observedValue;
+ event.perceived_severity = severity;
+
+ any <<= event;
+
+ this->send_notification (any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LogNotification::send_notification (const CORBA::Any & /* any */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/LogNotification.h b/TAO/orbsvcs/orbsvcs/Log/LogNotification.h
new file mode 100644
index 00000000000..32b68ecae1f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/LogNotification.h
@@ -0,0 +1,185 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LogNotification.h
+ *
+ * $Id$
+ *
+ * Implementation of the DsLogAdmin::LogNotification interface.
+ *
+ * @author D A Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+
+#ifndef TAO_TLS_LOG_NOTIFICATION_H
+#define TAO_TLS_LOG_NOTIFICATION_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/DsLogAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/DsLogNotificationS.h"
+#include "orbsvcs/Log/log_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_LogNotification
+ *
+ * @brief Used to forward log generated events to a logging server
+ *
+ * This implementation attempts to conform to the telecom
+ * logging specification.
+ */
+class TAO_Log_Serv_Export TAO_LogNotification
+{
+
+public:
+
+ /// Constructor.
+ TAO_LogNotification (void);
+
+ /// Destructor.
+ virtual ~TAO_LogNotification (void);
+
+ /// Event generated when a new log is created.
+ void object_creation (DsLogAdmin::LogId id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Event generated when a new log is deleted.
+ void object_deletion (DsLogAdmin::LogId id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Event generated.
+ void processing_error_alarm (CORBA::ULong error_num, const char* error_string
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// AttributeValueChange event generation method.
+ void attribute_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogNotification::AttributeType type,
+ CORBA::Any oldValue,
+ CORBA::Any newValue ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// AttributeValueChange event generation method.
+ void capacity_alarm_threshold_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ const DsLogAdmin::CapacityAlarmThresholdList& oldValue,
+ const DsLogAdmin::CapacityAlarmThresholdList& newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// AttributeValueChange event generation method.
+ void log_full_action_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ CORBA::ULong oldValue,
+ CORBA::ULong newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// AttributeValueChange event generation method.
+ void max_log_size_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ CORBA::ULongLong oldValue,
+ CORBA::ULongLong newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// AttributeValueChange event generation method.
+ void start_time_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogAdmin::TimeT oldValue,
+ DsLogAdmin::TimeT newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// AttributeValueChange event generation method.
+ void stop_time_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogAdmin::TimeT oldValue,
+ DsLogAdmin::TimeT newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// AttributeValueChange event generation method.
+ void week_mask_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ const DsLogAdmin::WeekMask& oldValue,
+ const DsLogAdmin::WeekMask& newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// AttributeValueChange event generation method.
+ void max_record_life_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ CORBA::ULong oldValue,
+ CORBA::ULong newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// AttributeValueChange event generation method.
+ void quality_of_service_value_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ const DsLogAdmin::QoSList& oldValue,
+ const DsLogAdmin::QoSList& newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// StateChange event generation method.
+ void state_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogNotification::StateType type,
+ CORBA::Any newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// StateChange event generation method.
+ void administrative_state_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogAdmin::AdministrativeState newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// StateChange event generation method.
+ void operational_state_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogAdmin::OperationalState newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// StateChange event generation method.
+ void forwarding_state_change (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogAdmin::ForwardingState newValue
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// StateChange event generation method.
+ void threshold_alarm (DsLogAdmin::Log_ptr log,
+ DsLogAdmin::LogId id,
+ DsLogAdmin::Threshold crossedValue,
+ DsLogAdmin::Threshold observedValue,
+ DsLogNotification::PerceivedSeverityType severity
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Method overriden by by event-aware logging services to cause
+ /// a notification event to be sent.
+ virtual void send_notification (const CORBA::Any &
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_TLS_LOG_NOTIFICATION_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/LogRecordStore.cpp b/TAO/orbsvcs/orbsvcs/Log/LogRecordStore.cpp
new file mode 100644
index 00000000000..278039ac40e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/LogRecordStore.cpp
@@ -0,0 +1,17 @@
+#include "orbsvcs/Log/LogRecordStore.h"
+
+ACE_RCSID (Log,
+ LogRecordStore,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_LogRecordStore::TAO_LogRecordStore (void)
+{
+}
+
+TAO_LogRecordStore::~TAO_LogRecordStore (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/LogRecordStore.h b/TAO/orbsvcs/orbsvcs/Log/LogRecordStore.h
new file mode 100644
index 00000000000..4e630b0ea46
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/LogRecordStore.h
@@ -0,0 +1,269 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LogRecordStore.h
+ *
+ * $Id$
+ *
+ * @author Matthew Braun <mjb2@cs.wustl.edu>
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_LOG_RECORD_STORE_H
+#define TAO_LOG_RECORD_STORE_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/DsLogAdminC.h"
+#include "orbsvcs/Log/log_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_LogRecordStore
+ *
+ * @brief Abstract base class for storing DsLogAdmin::LogRecord's
+ *
+ * Implements a Table Data Gateway(144) for log records, and a Row
+ * Data Gateway(152) for log channel parameters.
+ */
+class TAO_Log_Serv_Export TAO_LogRecordStore
+{
+ public:
+
+ // = Initialization and termination methods
+
+ /// Destructor.
+ virtual ~TAO_LogRecordStore (void);
+
+ /// Initialization.
+ virtual int open (void) = 0;
+
+ /// Close the record store.
+ virtual int close (void) = 0;
+
+
+ // = Log Parameters
+
+ /// Gets the administrative state of the log
+ virtual DsLogAdmin::AdministrativeState
+ get_administrative_state (ACE_ENV_SINGLE_ARG_DECL) const = 0;
+
+ /// Sets the administrative state of the log
+ virtual void
+ set_administrative_state (DsLogAdmin::AdministrativeState state
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Get the capacity alarm thresholds
+ virtual DsLogAdmin::CapacityAlarmThresholdList*
+ get_capacity_alarm_thresholds (ACE_ENV_SINGLE_ARG_DECL) const = 0;
+
+ /// Set the capacity alarm thresholds
+ virtual void
+ set_capacity_alarm_thresholds (const DsLogAdmin::CapacityAlarmThresholdList& thresholds
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Gets the forwarding state
+ virtual DsLogAdmin::ForwardingState
+ get_forwarding_state (ACE_ENV_SINGLE_ARG_DECL) const = 0;
+
+ /// Sets the forwarding state
+ virtual void
+ set_forwarding_state (DsLogAdmin::ForwardingState state
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Get the log duration
+ virtual DsLogAdmin::TimeInterval
+ get_interval (ACE_ENV_SINGLE_ARG_DECL) const = 0;
+
+ /// Set the log duration.
+ virtual void
+ set_interval (const DsLogAdmin::TimeInterval& interval
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Get the log full action
+ virtual DsLogAdmin::LogFullActionType
+ get_log_full_action (ACE_ENV_SINGLE_ARG_DECL) const = 0;
+
+ /// Set the log full action
+ virtual void
+ set_log_full_action(DsLogAdmin::LogFullActionType action
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Get the list of the QoS properties supported by the log.
+ virtual DsLogAdmin::QoSList*
+ get_log_qos (ACE_ENV_SINGLE_ARG_DECL) const = 0;
+
+ /// Set the list of the QoS properties supported by the log.
+ virtual void
+ set_log_qos (const DsLogAdmin::QoSList& qos
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Gets the max record life
+ virtual CORBA::ULong
+ get_max_record_life (ACE_ENV_SINGLE_ARG_DECL) const = 0;
+
+ /// Sets the max record life
+ virtual void
+ set_max_record_life (CORBA::ULong life
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Get the current set value of the max size of the log data.
+ virtual CORBA::ULongLong
+ get_max_size (ACE_ENV_SINGLE_ARG_DECL) const = 0;
+
+ /// Set the max size of log data. size == 0, => infinite.
+ virtual void
+ set_max_size (CORBA::ULongLong size
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Get the weekly scheduling parameters
+ virtual DsLogAdmin::WeekMask*
+ get_week_mask (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ /// Set the weekly scheduling parameters.
+ virtual void
+ set_week_mask (const DsLogAdmin::WeekMask& masks
+ ACE_ENV_ARG_DECL) = 0;
+
+
+ // = LogRecordStore status methods
+
+ /// Gets the current size of the log data.
+ virtual CORBA::ULongLong
+ get_current_size (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ /// Get the number of records in the log right now.
+ virtual CORBA::ULongLong
+ get_n_records (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+
+ // = LogRecordStore gauge
+
+ /// Gets the current value of the "gauge" that measures the total
+ /// size of the records written to the log.
+ virtual CORBA::ULongLong
+ get_gauge(ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ /// Resets the "gauge" to 0
+ virtual void
+ reset_gauge(ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+
+ // = Record logging, retrieval, update and removal methods.
+
+ /// Insert rec into storage.
+ /// Returns 0 on success -1 on failure and 1 if the log is full.
+ virtual int
+ log (const DsLogAdmin::LogRecord &rec ACE_ENV_ARG_DECL) = 0;
+
+ /// Deletes "old" records from the store.
+ virtual int
+ purge_old_records (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ /// Set single record attributes.
+ virtual void
+ set_record_attribute (DsLogAdmin::RecordId id,
+ const DsLogAdmin::NVList & attr_list
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidRecordId,
+ DsLogAdmin::InvalidAttribute)) = 0;
+
+ /// Set the attributes of all records that matches the
+ /// constraints with same attr_list.
+ virtual CORBA::ULong
+ set_records_attribute (const char * grammar,
+ const char * c,
+ const DsLogAdmin::NVList & attr_list
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint,
+ DsLogAdmin::InvalidAttribute)) = 0;
+
+ /// Get the attributes of the record with id <id>. Raises
+ /// DsLogAdmin::InvalidRecordId
+ virtual DsLogAdmin::NVList*
+ get_record_attribute (DsLogAdmin::RecordId id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidRecordId)) = 0;
+
+ /// Ensure changes have been flushed to persistent media
+ /// Returns 0 on success, -1 on failure
+ virtual int
+ flush (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+
+ /// Returns all records in the log that match the given constraint
+ /// <c>.
+ virtual DsLogAdmin::RecordList*
+ query (const char * grammar,
+ const char * c,
+ DsLogAdmin::Iterator_out i
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint)) = 0;
+
+ /// Retrieve <how_many> records from time <from_time> using iterator
+ /// <i>.
+ virtual DsLogAdmin::RecordList*
+ retrieve (DsLogAdmin::TimeT from_time,
+ CORBA::Long how_many,
+ DsLogAdmin::Iterator_out i
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+
+ /// Returns the number of records matching constraint <c>.
+ virtual CORBA::ULong
+ match (const char * grammar,
+ const char * c
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint)) = 0;
+
+ /// Delete records matching constraint <c>.
+ virtual CORBA::ULong
+ delete_records (const char * grammar,
+ const char * c
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint)) = 0;
+
+ /// Delete records matching ids in <ids>
+ virtual CORBA::ULong
+ delete_records_by_id (const DsLogAdmin::RecordIdList & ids
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+
+
+ virtual CORBA::ULong
+ remove_old_records (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ /// Read-Write Lock
+ virtual ACE_SYNCH_RW_MUTEX& lock() = 0;
+
+protected:
+ /// Constructor.
+ TAO_LogRecordStore (void);
+
+
+private:
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /*TAO_LOG_RECORD_STORE_H*/
diff --git a/TAO/orbsvcs/orbsvcs/Log/LogStore.h b/TAO/orbsvcs/orbsvcs/Log/LogStore.h
new file mode 100644
index 00000000000..78773abffb9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/LogStore.h
@@ -0,0 +1,108 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LogStore.h
+ *
+ * $Id$
+ *
+ * @author Matthew Braun <mjb2@cs.wustl.edu>
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_LOGSTORE_H
+#define TAO_TLS_LOGSTORE_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/DsLogAdminC.h"
+#include "orbsvcs/Log/log_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_LogRecordStore;
+
+class TAO_Log_Serv_Export TAO_LogStore
+{
+public:
+ // Destructor
+ virtual ~TAO_LogStore() {}
+
+ /// Lists all logs created by the log factory.
+ virtual DsLogAdmin::LogList *
+ list_logs (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ )) = 0;
+
+ /// Lists all log ids.
+ virtual DsLogAdmin::LogIdList *
+ list_logs_by_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ )) = 0;
+
+ /// Returns a reference to the log with the supplied id.
+ virtual DsLogAdmin::Log_ptr
+ find_log (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ )) = 0;
+
+ /// Returns true if log exists, otherwise false
+ virtual bool
+ exists (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Remove the given entry from the hash table.
+ virtual int
+ remove (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// @brief Create log
+ virtual void
+ create (DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList* thresholds,
+ DsLogAdmin::LogId_out id_out
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// @brief Create log
+ virtual void
+ create_with_id (DsLogAdmin::LogId id,
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList* thresholds
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// @brief Get log record store
+ ///
+ /// Get/Create a log record store for log channel @a id.
+ ///
+ /// @param id log id
+ ///
+ virtual TAO_LogRecordStore*
+ get_log_record_store (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL) = 0;
+
+protected:
+ // Constructor
+ TAO_LogStore() {}
+
+
+private:
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_TLS_LOGSTORE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/Log_Compaction_Handler.cpp b/TAO/orbsvcs/orbsvcs/Log/Log_Compaction_Handler.cpp
new file mode 100644
index 00000000000..d153bbe2714
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Log_Compaction_Handler.cpp
@@ -0,0 +1,66 @@
+#include "orbsvcs/Log/Log_Compaction_Handler.h"
+#include "orbsvcs/Log/Log_i.h"
+#include "ace/Reactor.h"
+
+ACE_RCSID (Log,
+ Log_Compaction_Handler,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Log_Compaction_Handler::TAO_Log_Compaction_Handler (ACE_Reactor* reactor,
+ TAO_Log_i* log,
+ const ACE_Time_Value& interval)
+ : timer_id_(-1),
+ reactor_(reactor),
+ log_(log),
+ interval_(interval)
+{
+}
+
+
+TAO_Log_Compaction_Handler::~TAO_Log_Compaction_Handler ()
+{
+ this->cancel ();
+}
+
+
+void
+TAO_Log_Compaction_Handler::schedule ()
+{
+ this->cancel ();
+ this->timer_id_ =
+ this->reactor_->schedule_timer (this, 0, this->interval_, this->interval_);
+}
+
+
+void
+TAO_Log_Compaction_Handler::cancel ()
+{
+ if (this->timer_id_ != -1)
+ {
+ this->reactor_->cancel_timer (timer_id_);
+ this->timer_id_ = -1;
+ }
+}
+
+
+int
+TAO_Log_Compaction_Handler::handle_timeout (const ACE_Time_Value&,
+ const void *)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->log_->remove_old_records(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/Log_Compaction_Handler.h b/TAO/orbsvcs/orbsvcs/Log/Log_Compaction_Handler.h
new file mode 100644
index 00000000000..3e51de61602
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Log_Compaction_Handler.h
@@ -0,0 +1,66 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Log_Compaction_Handler.h
+ *
+ * $Id$
+ *
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_COMPACTION_HANDLER_H
+#define TAO_TLS_COMPACTION_HANDLER_H
+
+#include "orbsvcs/Log/log_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+#include "ace/Event_Handler.h"
+#include "ace/Time_Value.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Reactor;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Log_i;
+
+/// @class TAO_Log_Compaction_Handler
+/// @brief Periodically invoke remove_old_records() on Log
+///
+class TAO_Log_Serv_Export TAO_Log_Compaction_Handler
+ : public ACE_Event_Handler
+{
+public:
+ /// Constructor.
+ TAO_Log_Compaction_Handler (ACE_Reactor* reactor,
+ TAO_Log_i* log,
+ const ACE_Time_Value& interval);
+
+ /// Destructor.
+ ~TAO_Log_Compaction_Handler ();
+
+ /// Schedule Timer.
+ void schedule ();
+
+ /// Cancel Timer.
+ void cancel ();
+
+ virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg);
+
+private:
+ long timer_id_;
+ ACE_Reactor* reactor_;
+ TAO_Log_i* log_;
+ const ACE_Time_Value interval_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_LOG_COMPACTION_HANDLER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Interpreter.cpp b/TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Interpreter.cpp
new file mode 100644
index 00000000000..e741de09004
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Interpreter.cpp
@@ -0,0 +1,49 @@
+#include "orbsvcs/Log/Log_Constraint_Interpreter.h"
+
+#include "orbsvcs/Log/Log_Constraint_Visitors.h"
+
+ACE_RCSID (Log,
+ Log_Constraint_Interpreter,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Log_Constraint_Interpreter::TAO_Log_Constraint_Interpreter (
+ const char *constraints
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((DsLogAdmin::InvalidConstraint,
+ CORBA::NO_MEMORY))
+{
+ if (TAO_ETCL_Interpreter::is_empty_string (constraints))
+ {
+ // Root is deleted in the TAO_Interpreter's destructor.
+ ACE_NEW_THROW_EX (this->root_,
+ TAO_ETCL_Literal_Constraint ((CORBA::Boolean) 1),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ }
+ else
+ {
+ // root_ is set in this base class call.
+ if (TAO_ETCL_Interpreter::build_tree (constraints) != 0)
+ ACE_THROW (DsLogAdmin::InvalidConstraint ());
+ }
+}
+
+TAO_Log_Constraint_Interpreter::~TAO_Log_Constraint_Interpreter (void)
+{
+}
+
+CORBA::Boolean
+TAO_Log_Constraint_Interpreter::evaluate (
+ TAO_Log_Constraint_Visitor &evaluator
+ )
+{
+ CORBA::Boolean retval =
+ evaluator.evaluate_constraint (this->root_);
+
+ return retval;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Interpreter.h b/TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Interpreter.h
new file mode 100644
index 00000000000..18f754d8c79
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Interpreter.h
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Log_Constraint_Interpreter.h
+ *
+ * $Id$
+ *
+ *
+ *
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ * @author D A Hanvey <d.hanvey@qub.ac.uk>
+ *
+ */
+//=============================================================================
+
+#ifndef TAO_LOG_CONSTRAINT_INTERPRETER_H
+#define TAO_LOG_CONSTRAINT_INTERPRETER_H
+
+#include /**/ "ace/pre.h"
+#include "orbsvcs/ETCL/ETCL_Interpreter.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ETCL/ETCL_Constraint.h"
+#include "orbsvcs/DsLogAdminC.h"
+#include "orbsvcs/Log/log_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Log_Constraint_Visitor;
+
+/**
+ * @class TAO_Log_Constraint_Interpreter
+ *
+ * @brief "ETCL" Interpreter for the Log queries.
+ */
+class TAO_Log_Serv_Export TAO_Log_Constraint_Interpreter :
+ public TAO_ETCL_Interpreter
+{
+public:
+
+ // = Initialization and termination methods.
+
+ /**
+ * This constructor builds an expression tree representing the
+ * constraint specified in <constraints>, and throws an Illegal
+ * Constraint exception if the constraint given has syntax errors or
+ * semantic errors, such as mismatched types.
+ */
+ TAO_Log_Constraint_Interpreter (const char* constraints
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((DsLogAdmin::InvalidConstraint,
+ CORBA::NO_MEMORY));
+
+ /// Destructor.
+ ~TAO_Log_Constraint_Interpreter (void);
+
+ /// Returns true if the constraint is evaluated successfully by
+ /// the evaluator.
+ CORBA::Boolean evaluate (TAO_Log_Constraint_Visitor &evaluator);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_LOG_CONSTRAINT_INTERPRETER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Visitors.cpp b/TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Visitors.cpp
new file mode 100644
index 00000000000..9d8fe567d40
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Visitors.cpp
@@ -0,0 +1,1347 @@
+#include "orbsvcs/Log/Log_Constraint_Visitors.h"
+
+#include "orbsvcs/ETCL/ETCL_Constraint.h"
+#include "orbsvcs/ETCL/ETCL_y.h"
+
+#include "tao/DynamicAny/DynArray_i.h"
+#include "tao/DynamicAny/DynSequence_i.h"
+#include "tao/DynamicAny/DynStruct_i.h"
+#include "tao/DynamicAny/DynUnion_i.h"
+#include "tao/DynamicAny/DynEnum_i.h"
+#include "tao/DynamicAny/DynAnyFactory.h"
+
+#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h"
+#include "tao/CDR.h"
+
+ACE_RCSID (Log,
+ Log_Constraint_Visitors,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Log_Constraint_Visitor::TAO_Log_Constraint_Visitor (const DsLogAdmin::LogRecord &rec)
+ : property_lookup_ (property_lookup_size_)
+{
+ CORBA::Any val_id;
+#if defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
+ val_id <<= ACE_U64_TO_U32 (rec.id);
+#else
+ val_id <<= static_cast<ACE_UINT32> (rec.id);
+#endif
+ this->property_lookup_.bind (ACE_CString("id", 0, 0), val_id);
+
+
+ CORBA::Any val_time;
+#if defined (ACE_LACKS_LONGLONG_T) || defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
+ val_time <<= ACE_U64_TO_U32 (rec.time);
+#else
+ val_time <<= static_cast<ACE_UINT32> (rec.time);
+#endif
+ this->property_lookup_.bind (ACE_CString("time", 0, 0), val_time);
+
+ this->property_lookup_.bind (ACE_CString("info", 0, 0), rec.info);
+
+ // Bind an entry for each item in the record's attribute list.
+ CORBA::Long len = rec.attr_list.length();
+ for (CORBA::Long i = 0; i < len; ++i)
+ {
+ this->property_lookup_.bind (ACE_CString(rec.attr_list[i].name,
+ 0,
+ 0),
+ rec.attr_list[i].value);
+ }
+}
+
+CORBA::Boolean
+TAO_Log_Constraint_Visitor::evaluate_constraint (TAO_ETCL_Constraint* root)
+{
+ CORBA::Boolean result = 0;
+ this->queue_.reset ();
+
+ // Evaluate the constraint in root_;
+ if (root != 0)
+ {
+ if ((root->accept (this) == 0) &&
+ (! this->queue_.is_empty ()))
+ {
+ TAO_ETCL_Literal_Constraint top;
+ this->queue_.dequeue_head (top);
+ result = (CORBA::Boolean) top;
+ }
+ }
+
+ // If a property couldn't be evaluated we must return 0.
+ return result;
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_literal (
+ TAO_ETCL_Literal_Constraint *literal
+ )
+{
+ this->queue_.enqueue_head (*literal);
+ return 0;
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_identifier (TAO_ETCL_Identifier *ident)
+{
+ int return_value = -1;
+ const char *name = ident->value ();
+ ACE_CString key (name, 0, 0);
+
+ CORBA::Any any;
+
+ if (this->property_lookup_.find (key, any) == 0)
+ {
+ if (any.impl() != 0)
+ {
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (&any));
+ return_value = 0;
+ }
+ }
+
+ return return_value;
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_union_value (
+ TAO_ETCL_Union_Value *union_value
+ )
+{
+ switch (union_value->sign ())
+ {
+ case 0:
+ this->queue_.enqueue_head (*union_value->string ());
+ break;
+ case -1:
+ this->queue_.enqueue_head (-(*union_value->integer ()));
+ break;
+ case 1:
+ this->queue_.enqueue_head (*union_value->integer ());
+ break;
+ default:
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_union_pos (
+ TAO_ETCL_Union_Pos *union_pos
+ )
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ if (union_pos->union_value ()->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint disc_val;
+ this->queue_.dequeue_head (disc_val);
+
+ TAO_DynUnion_i dyn_union;
+ dyn_union.init (this->current_member_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::TypeCode_var tc = this->current_member_->type ();
+
+ switch (disc_val.expr_type ())
+ {
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ case TAO_ETCL_UNSIGNED:
+ {
+ CORBA::Any disc_any;
+ CORBA::TypeCode_var disc_tc =
+ tc->discriminator_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::TCKind disc_kind =
+ TAO_DynAnyFactory::unalias (disc_tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ switch (disc_kind)
+ {
+ case CORBA::tk_boolean:
+ disc_any <<= CORBA::Any::from_boolean ((CORBA::Boolean) disc_val);
+ break;
+ case CORBA::tk_short:
+ disc_any <<= (CORBA::Short) ((CORBA::Long) disc_val);
+ break;
+ case CORBA::tk_ushort:
+ disc_any <<= (CORBA::UShort) ((CORBA::ULong) disc_val);
+ break;
+ case CORBA::tk_long:
+ disc_any <<= (CORBA::Long) disc_val;
+ break;
+ case CORBA::tk_ulong:
+ disc_any <<= (CORBA::ULong) disc_val;
+ break;
+ case CORBA::tk_enum:
+ {
+ TAO_OutputCDR cdr;
+ cdr.write_ulong ((CORBA::ULong) disc_val);
+ TAO_InputCDR in_cdr (cdr);
+ TAO::Unknown_IDL_Type *unk = 0;
+ ACE_NEW_RETURN (unk,
+ TAO::Unknown_IDL_Type (
+ disc_tc.in (),
+ in_cdr
+ ),
+ -1);
+
+ disc_any.replace (unk);
+ break;
+ }
+ // @@@ (JP) I don't think ETCL handles 64-bit
+ // integers at this point, and I also think that
+ // chars and/or wchars will just come out in the
+ // constraint as (w)strings of length 1.
+ case CORBA::tk_longlong:
+ case CORBA::tk_ulonglong:
+ case CORBA::tk_char:
+ case CORBA::tk_wchar:
+ default:
+ return -1;
+ }
+
+ DynamicAny::DynAny_var dyn_any =
+ TAO_DynAnyFactory::make_dyn_any (disc_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ dyn_union.set_discriminator (dyn_any.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ DynamicAny::DynAny_var u_member =
+ dyn_union.member (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->current_member_ =
+ u_member->to_any (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ break;
+ }
+ case TAO_ETCL_STRING:
+ {
+ const char *name = (const char *) disc_val;
+ CORBA::ULong count =
+ tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ const char *member_name = 0;
+ CORBA::ULong i = 0;
+
+ for (i = 0; i < count; ++i)
+ {
+ member_name = tc->member_name (i
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ACE_OS::strcmp (name, member_name) == 0)
+ {
+ break;
+ }
+ }
+
+ // If there's no match, member_label will throw
+ // CORBA::TypeCode::Bounds and the catch block will
+ // return -1;
+ this->current_member_ = tc->member_label (i
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ break;
+ }
+ // The TAO_ETCL_Union_Value that was put on the queue
+ // shouldn't have any other type.
+ default:
+ return -1;
+ }
+
+ TAO_ETCL_Constraint *nested = union_pos->component ();
+
+ // If there's no nested component, then we just want the
+ // union member value on the queue. Otherwise, we want
+ // the member value in current_member_ while we visit
+ // the nested component.
+ if (nested == 0)
+ {
+ TAO_ETCL_Literal_Constraint lit (this->current_member_.ptr ());
+ this->queue_.enqueue_head (lit);
+ return 0;
+ }
+ else
+ {
+ return nested->accept (this);
+ }
+ }
+ else
+ {
+ return -1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_component_pos (TAO_ETCL_Component_Pos *pos)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // If we are here (from visit_component) the Any containing the
+ // component as found in property_lookup_ will be in current_member_.
+ CORBA::TypeCode_var tc = this->current_member_->type ();
+ CORBA::TCKind kind = TAO_DynAnyFactory::unalias (tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DynamicAny::DynAny_var member;
+ CORBA::Boolean success = 0;
+ CORBA::ULong slot = (CORBA::ULong) *pos->integer ();
+
+ switch (kind)
+ {
+ case CORBA::tk_enum:
+ {
+ TAO_DynEnum_i dyn_enum;
+ dyn_enum.init (this->current_member_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ success = dyn_enum.seek (slot
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (success == 0)
+ {
+ return -1;
+ }
+
+ member =
+ dyn_enum.current_component (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ break;
+ }
+ case CORBA::tk_struct:
+ {
+ TAO_DynStruct_i dyn_struct;
+ dyn_struct.init (this->current_member_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ success = dyn_struct.seek (slot
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (success == 0)
+ {
+ return -1;
+ }
+
+ member = dyn_struct.current_component (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ break;
+ }
+ // @@@ (JP) I think enums and structs are the only two cases handled
+ // by Component_Pos, since arrays and sequences are handled by
+ // Component_Array, and unions are handled by Union_Pos.
+ default:
+ return -1;
+ }
+
+ CORBA::Any_var value = member->to_any (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_ETCL_Constraint *comp = pos->component ();
+
+ if (comp == 0)
+ {
+ TAO_ETCL_Literal_Constraint result (value.ptr ());
+ this->queue_.enqueue_head (result);
+ return 0;
+ }
+ else
+ {
+ this->current_member_ = value._retn ();
+ return comp->accept (this);
+ }
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_component_assoc (
+ TAO_ETCL_Component_Assoc *assoc)
+{
+ // @@@ (JP) The spec reserves this type of constraint for NVLists.
+ // Since NVLists don't have type codes or Any operators, there's
+ // no way that TAO can put one into the event's filterable data.
+ // However, from the looks of the ETCL grammar, I believe that a
+ // contruct like 'exist $(foo)' is legal, and is in effect using
+ // the event's filterable data as one big NVList. It is
+ // equivalent to '$.foo'. I've implemented this method on that
+ // basis, while keeping in mind that a clearer interpretation of
+ // the spec may come along someday.
+
+ CORBA::Any any;
+ ACE_CString key (assoc->identifier ()->value (),
+ 0,
+ 0);
+
+ if (this->property_lookup_.find (key, any) != 0
+ || any.impl () == 0)
+ {
+ return -1;
+ }
+
+ TAO_ETCL_Constraint *comp = assoc->component ();
+ CORBA::Any *any_ptr = 0;
+
+ if (comp == 0)
+ {
+ TAO_ETCL_Literal_Constraint result (&any);
+ this->queue_.enqueue_head (result);
+ return 0;
+ }
+
+ ACE_NEW_RETURN (any_ptr,
+ CORBA::Any (any),
+ -1);
+ this->current_member_ = any_ptr;
+ return comp->accept (this);
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_component_array (
+ TAO_ETCL_Component_Array *array
+ )
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // If we are here (from visit_component) the Any containing the
+ // component as found in property_lookup_ will be in current_member_.
+ CORBA::TypeCode_var tc = this->current_member_->type ();
+ CORBA::TCKind kind = TAO_DynAnyFactory::unalias (tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DynamicAny::DynAny_var member;
+ CORBA::Boolean success = 0;
+ CORBA::ULong slot = (CORBA::ULong) *array->integer ();
+
+ switch (kind)
+ {
+ case CORBA::tk_array:
+ {
+ TAO_DynEnum_i dyn_array;
+ dyn_array.init (this->current_member_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ success = dyn_array.seek (slot
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (success == 0)
+ {
+ return -1;
+ }
+
+ member = dyn_array.current_component (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ break;
+ }
+ case CORBA::tk_sequence:
+ {
+ TAO_DynStruct_i dyn_sequence;
+ dyn_sequence.init (this->current_member_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ success = dyn_sequence.seek (slot
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (success == 0)
+ {
+ return -1;
+ }
+
+ member =
+ dyn_sequence.current_component (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ break;
+ }
+ // Enums and sequences are the only two cases handled
+ // by Component_Array.
+ default:
+ return -1;
+ }
+
+ CORBA::Any_var value = member->to_any (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_ETCL_Constraint *comp = array->component ();
+
+ if (comp == 0)
+ {
+ TAO_ETCL_Literal_Constraint result (value.ptr ());
+ this->queue_.enqueue_head (result);
+ return 0;
+ }
+ else
+ {
+ this->current_member_ = value._retn ();
+ return comp->accept (this);
+ }
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_special (TAO_ETCL_Special *special)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::TypeCode_var tc = this->current_member_->type ();
+
+ switch (special->type ())
+ {
+ case TAO_ETCL_LENGTH:
+ {
+ // If the TCKind is not a sequence or an array, the
+ // call to length() will raise an exception, and the
+ // catch block will return -1;
+ CORBA::ULong length = tc->length (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_ETCL_Literal_Constraint lit (length);
+ this->queue_.enqueue_head (lit);
+ return 0;
+ }
+ case TAO_ETCL_DISCRIMINANT:
+ {
+ // If the TCKind is not a union, the
+ // call to init() will raise an exception, and the
+ // catch block will return -1;
+ TAO_DynUnion_i dyn_union;
+ dyn_union.init (this->current_member_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DynamicAny::DynAny_var disc =
+ dyn_union.get_discriminator (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any_var disc_any = disc->to_any (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_ETCL_Literal_Constraint lit (disc_any.ptr ());
+ this->queue_.enqueue_head (lit);
+ return 0;
+ }
+ case TAO_ETCL_TYPE_ID:
+ {
+ const char *name = tc->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_ETCL_Literal_Constraint lit (name);
+ this->queue_.enqueue_head (lit);
+ return 0;
+ }
+ case TAO_ETCL_REPOS_ID:
+ {
+ const char *id = tc->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_ETCL_Literal_Constraint lit (id);
+ this->queue_.enqueue_head (lit);
+ return 0;
+ }
+ default:
+ return -1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_component (
+ TAO_ETCL_Component *component
+ )
+{
+ // If this component has no sub-component, only an identifier,
+ // then we just visit the identifier, which puts a literal on
+ // the queue to be handled upon returning from this method call.
+ // If there is a sub-component, we store the literal's value
+ // in our member _var for possible examination at a more
+ // nested level, and visit the sub-component.
+
+ TAO_ETCL_Constraint *nested = component->component ();
+ int result = component->identifier ()->accept (this);
+
+ if (nested == 0 || result != 0)
+ {
+ return result;
+ }
+ else
+ {
+ TAO_ETCL_Literal_Constraint id;
+ this->queue_.dequeue_head (id);
+ CORBA::Any *any_ptr = 0;
+ ACE_NEW_RETURN (any_ptr,
+ CORBA::Any (*(const CORBA::Any *) id),
+ -1);
+ this->current_member_ = any_ptr;
+ return nested->accept (this);
+ }
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_dot (TAO_ETCL_Dot *dot)
+{
+ // If we are here, we know we're headed for a more nested
+ // level, so we just visit it, there's nothing else in this
+ // constraint.
+ return dot->component ()->accept (this);
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_eval (TAO_ETCL_Eval *eval)
+{
+ // Nothing to do but visit the contained component.
+ return eval->component ()->accept (this);
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_default (TAO_ETCL_Default *def)
+{
+ TAO_ETCL_Constraint *comp = def->component ();
+
+ if (comp == 0)
+ {
+ return -1;
+ }
+
+ if (comp->accept (this) != 0)
+ {
+ return -1;
+ }
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::TypeCode_var tc = this->current_member_->type ();
+
+ // If the current member is not a union, this call will
+ // throw BadKind and the catch block will return -1.
+ CORBA::Long default_index = tc->default_index (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // No default index.
+ if (default_index == -1)
+ {
+ TAO_ETCL_Literal_Constraint result ((CORBA::Boolean) 0);
+ this->queue_.enqueue_head (result);
+ return 0;
+ }
+
+ // Okay, there's a default index, but is it active?
+
+ TAO_ETCL_Literal_Constraint disc;
+ this->queue_.dequeue_head (disc);
+ TAO_ETCL_Literal_Constraint default_index_value (default_index);
+ return (disc == default_index_value);
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_exist (TAO_ETCL_Exist *exist)
+{
+ TAO_ETCL_Constraint *component = exist->component ();
+
+ if (component->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint top;
+
+ this->queue_.dequeue_head (top);
+
+ const char *value = (const char *) top;
+ ACE_CString key (value, 0, 0);
+
+ CORBA::Boolean result = (this->property_lookup_.find (key) == 0);
+
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+
+ return 0;
+ }
+
+ return -1;
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_unary_expr (
+ TAO_ETCL_Unary_Expr *unary_expr
+ )
+{
+ TAO_ETCL_Constraint *subexpr = unary_expr->subexpr ();
+
+ if (subexpr->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint subexpr_result;
+ CORBA::Boolean result = 0;
+ int op_type = unary_expr->type ();
+
+ switch (op_type)
+ {
+ case TAO_ETCL_NOT:
+ this->queue_.dequeue_head (subexpr_result);
+ result = ! (CORBA::Boolean) subexpr_result;
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ return 0;
+ case TAO_ETCL_MINUS:
+ // The leading '-' was parsed separately, so we have to pull
+ // the literal constraint off the queue, apply the class' own
+ // unary minus operator, and put it back.
+ this->queue_.dequeue_head (subexpr_result);
+ this->queue_.enqueue_head (-subexpr_result);
+ return 0;
+ case TAO_ETCL_PLUS:
+ // Leave the literal constraint on the queue. The leading
+ // '+' was just syntactic sugar - no action is necessary.
+ return 0;
+ default:
+ // The parser should never construct a TAO_ETCL_Unary_Constraint
+ // behind any operators except the above three.
+ return -1;
+ }
+ }
+
+ return -1;
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_binary_expr (
+ TAO_ETCL_Binary_Expr *binary_expr
+ )
+{
+
+ // Evaluate the constraint
+ int bin_op_type = binary_expr->type ();
+
+ switch (bin_op_type)
+ {
+ case TAO_ETCL_OR:
+ return this->visit_or (binary_expr);
+ case TAO_ETCL_AND:
+ return this->visit_and (binary_expr);
+ case TAO_ETCL_LT:
+ case TAO_ETCL_LE:
+ case TAO_ETCL_GT:
+ case TAO_ETCL_GE:
+ case TAO_ETCL_EQ:
+ case TAO_ETCL_NE:
+ case TAO_ETCL_PLUS:
+ case TAO_ETCL_MINUS:
+ case TAO_ETCL_MULT:
+ case TAO_ETCL_DIV:
+ return this->visit_binary_op (binary_expr,
+ bin_op_type);
+ case TAO_ETCL_TWIDDLE:
+ return this->visit_twiddle (binary_expr);
+ case TAO_ETCL_IN:
+ return this->visit_in (binary_expr);
+ default:
+ return -1;
+ }
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_or (
+ TAO_ETCL_Binary_Expr *binary
+ )
+{
+ int return_value = -1;
+ CORBA::Boolean result = 0;
+ TAO_ETCL_Constraint *lhs = binary->lhs ();
+
+ if (lhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint lhs_result;
+ this->queue_.dequeue_head (lhs_result);
+ result = (CORBA::Boolean) lhs_result;
+
+ // Short-circuiting OR.
+ if (result == 0)
+ {
+ TAO_ETCL_Constraint *rhs = binary->rhs ();
+
+ if (rhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint rhs_result;
+ this->queue_.dequeue_head (rhs_result);
+ result = (CORBA::Boolean) rhs_result;
+ return_value = 0;
+ }
+ }
+ else
+ {
+ return_value = 0;
+ }
+ }
+
+ if (return_value == 0)
+ {
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ }
+
+ return return_value;
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_and (
+ TAO_ETCL_Binary_Expr *binary
+ )
+{
+ int return_value = -1;
+ CORBA::Boolean result = 0;
+ TAO_ETCL_Constraint *lhs = binary->lhs ();
+
+ if (lhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint lhs_result;
+ this->queue_.dequeue_head (lhs_result);
+ result = (CORBA::Boolean) lhs_result;
+
+ // Short-circuiting AND.
+ if (result == 1)
+ {
+ TAO_ETCL_Constraint *rhs = binary->rhs ();
+
+ if (rhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint rhs_result;
+ this->queue_.dequeue_head (rhs_result);
+ result = (CORBA::Boolean) rhs_result;
+ return_value = 0;
+ }
+ }
+ else
+ {
+ return_value = 0;
+ }
+ }
+
+ if (return_value == 0)
+ {
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ }
+
+ return return_value;
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_binary_op (
+ TAO_ETCL_Binary_Expr *binary,
+ int op_type
+ )
+{
+ int return_value = -1;
+ TAO_ETCL_Constraint *lhs = binary->lhs ();
+ CORBA::Boolean result = 0;
+
+ // Evaluate the constraint
+ // Perform an operation on the results of evaluating the left and
+ // right branches of this subtree.
+ if (lhs->accept (this) == 0)
+ {
+
+ // Evaluate the constraint
+ TAO_ETCL_Literal_Constraint left_operand;
+ this->queue_.dequeue_head (left_operand);
+ TAO_ETCL_Constraint *rhs = binary->rhs ();
+
+ if (rhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint right_operand;
+ this->queue_.dequeue_head (right_operand);
+ return_value = 0;
+
+ switch (op_type)
+ {
+ case TAO_ETCL_LT:
+ result = left_operand < right_operand;
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ break;
+ case TAO_ETCL_LE:
+ result = left_operand <= right_operand;
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ break;
+ case TAO_ETCL_GT:
+ result = left_operand > right_operand;
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ break;
+ case TAO_ETCL_GE:
+ result = left_operand >= right_operand;
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ break;
+ case TAO_ETCL_EQ:
+ result = left_operand == right_operand;
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ break;
+ case TAO_ETCL_NE:
+ result = left_operand != right_operand;
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ break;
+ case TAO_ETCL_PLUS:
+ this->queue_.enqueue_head (left_operand + right_operand);
+ break;
+ case TAO_ETCL_MINUS:
+ this->queue_.enqueue_head (left_operand - right_operand);
+ break;
+ case TAO_ETCL_MULT:
+ this->queue_.enqueue_head (left_operand * right_operand);
+ break;
+ case TAO_ETCL_DIV:
+ this->queue_.enqueue_head (left_operand / right_operand);
+ break;
+ default:
+ return_value = -1;
+ }
+ }
+ }
+
+ return return_value;
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_twiddle (
+ TAO_ETCL_Binary_Expr *binary
+ )
+{
+ int return_value = -1;
+ TAO_ETCL_Constraint *lhs = binary->lhs ();
+
+ // Determine if the left operand is a substring of the right.
+ if (lhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint left;
+ this->queue_.dequeue_head (left);
+ TAO_ETCL_Constraint *rhs = binary->rhs ();
+
+ if (rhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint right;
+ this->queue_.dequeue_head (right);
+ CORBA::Boolean result =
+ (ACE_OS::strstr ((const char *) left,
+ (const char *) right) != 0);
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ return_value = 0;
+ }
+ }
+
+ return return_value;
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_in (
+ TAO_ETCL_Binary_Expr *binary
+ )
+{
+ int return_value = -1;
+ TAO_ETCL_Constraint *lhs = binary->lhs ();
+
+ // Determine if the left operand is contained in the right.
+
+ if (lhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint left;
+ this->queue_.dequeue_head (left);
+
+ TAO_ETCL_Constraint *rhs = binary->rhs ();
+
+ if (rhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint bag;
+ this->queue_.dequeue_head (bag);
+
+ if (bag.expr_type () == TAO_ETCL_COMPONENT)
+ {
+ const CORBA::Any *component = (const CORBA::Any *) bag;
+ CORBA::TCKind kind = CORBA::tk_null;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::TypeCode_var tc = component->type ();
+ kind = TAO_DynAnyFactory::unalias (tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return return_value;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (return_value);
+
+ CORBA::Boolean result = 0;
+
+ switch (kind)
+ {
+ case CORBA::tk_sequence:
+ result = this->sequence_does_contain (component,
+ left);
+ break;
+ case CORBA::tk_array:
+ result = this->array_does_contain (component,
+ left);
+ break;
+ case CORBA::tk_struct:
+ result = this->struct_does_contain (component,
+ left);
+ break;
+ case CORBA::tk_union:
+ result = this->union_does_contain (component,
+ left);
+ break;
+ case CORBA::tk_any:
+ result = this->any_does_contain (component,
+ left);
+ break;
+ default:
+ return return_value;
+ }
+
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ return_value = 0;
+ }
+ }
+ }
+
+ return return_value;
+}
+
+int
+TAO_Log_Constraint_Visitor::visit_preference (
+ TAO_ETCL_Preference *
+ )
+{
+ // According to OMG 00-06-20 section 2.4.1, the Notification Service
+ // does not use the preference operators. The method must be here
+ // because it is called by the ETCL node, which may be used by other
+ // CORBA services that do use the preference operators.
+ return -1;
+}
+
+CORBA::Boolean
+TAO_Log_Constraint_Visitor::sequence_does_contain (
+ const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item
+ )
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::TypeCode_var type = any->type ();
+ CORBA::TCKind kind = TAO_DynAnyFactory::unalias (type.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The literal and the array elements must be
+ // of the same simple type.
+ CORBA::Boolean match = this->simple_type_match (item.expr_type (),
+ kind);
+
+ if (match == 0)
+ {
+ return 0;
+ }
+
+ TAO_DynSequence_i dyn_seq;
+ dyn_seq.init (*any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DynamicAny::AnySeq_var any_seq =
+ dyn_seq.get_elements (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ULong length = any_seq->length ();
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ TAO_ETCL_Literal_Constraint element (&any_seq[i]);
+
+ if (item == element)
+ {
+ return 1;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ return 0;
+}
+
+CORBA::Boolean
+TAO_Log_Constraint_Visitor::array_does_contain (
+ const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item
+ )
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::TypeCode_var type = any->type ();
+ CORBA::TCKind kind = TAO_DynAnyFactory::unalias (type.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The literal and the array elements must be
+ // of the same simple type.
+ CORBA::Boolean match = this->simple_type_match (item.expr_type (),
+ kind);
+
+ if (match == 0)
+ {
+ return 0;
+ }
+
+ TAO_DynArray_i dyn_array;
+ dyn_array.init (*any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DynamicAny::AnySeq_var any_seq =
+ dyn_array.get_elements (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ULong length = any_seq->length ();
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ TAO_ETCL_Literal_Constraint element (&any_seq[i]);
+
+ if (item == element)
+ {
+ return 1;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ return 0;
+}
+
+CORBA::Boolean
+TAO_Log_Constraint_Visitor::struct_does_contain (
+ const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item
+ )
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ TAO_DynStruct_i dyn_struct;
+ dyn_struct.init (*any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DynamicAny::NameValuePairSeq_var members =
+ dyn_struct.get_members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ULong length = members->length ();
+ CORBA::TypeCode_var tc;
+ CORBA::TCKind kind;
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ tc = members[i].value.type ();
+ kind = TAO_DynAnyFactory::unalias (tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The literal and the struct member must be
+ // of the same simple type.
+ CORBA::Boolean match = this->simple_type_match (item.expr_type (),
+ kind);
+
+ if (match == 0)
+ {
+ continue;
+ }
+
+ TAO_ETCL_Literal_Constraint element (&members[i].value);
+
+ if (item == element)
+ {
+ return 1;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ return 0;
+}
+
+CORBA::Boolean
+TAO_Log_Constraint_Visitor::union_does_contain (
+ const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item
+ )
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ TAO_DynUnion_i dyn_union;
+ dyn_union.init (*any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DynamicAny::DynAny_var cc =
+ dyn_union.current_component (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any_var member = cc->to_any (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::TypeCode_var tc = member->type ();
+ CORBA::TCKind kind = TAO_DynAnyFactory::unalias (tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The literal and the union member must be
+ // of the same simple type.
+ CORBA::Boolean match = this->simple_type_match (item.expr_type (),
+ kind);
+
+ if (match == 0)
+ {
+ return 0;
+ }
+
+ TAO_ETCL_Literal_Constraint element (&member.inout ());
+
+ return (item == element);
+ }
+ ACE_CATCHANY
+ {
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+}
+
+CORBA::Boolean
+TAO_Log_Constraint_Visitor::any_does_contain (
+ const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item
+ )
+{
+ const CORBA::Any *result = 0;
+
+ *any >>= result;
+
+ TAO_ETCL_Literal_Constraint element (const_cast<CORBA::Any *> (result));
+
+ return (item == element);
+}
+
+CORBA::Boolean
+TAO_Log_Constraint_Visitor::simple_type_match (int expr_type,
+ CORBA::TCKind tc_kind)
+{
+ switch (expr_type)
+ {
+ case TAO_ETCL_STRING:
+ if (tc_kind != CORBA::tk_string)
+ {
+ return 0;
+ }
+ case TAO_ETCL_DOUBLE:
+ if (tc_kind != CORBA::tk_double
+ && tc_kind != CORBA::tk_float)
+ {
+ return 0;
+ }
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ if (tc_kind != CORBA::tk_short
+ && tc_kind != CORBA::tk_long
+ && tc_kind != CORBA::tk_longlong)
+ {
+ return 0;
+ }
+ case TAO_ETCL_UNSIGNED:
+ if (tc_kind != CORBA::tk_ushort
+ && tc_kind != CORBA::tk_ulong
+ && tc_kind != CORBA::tk_ulonglong)
+ {
+ return 0;
+ }
+ case TAO_ETCL_BOOLEAN:
+ if (tc_kind != CORBA::tk_boolean)
+ {
+ return 0;
+ }
+ default:
+ return 0;
+ }
+}
+
+const size_t TAO_Log_Constraint_Visitor::property_lookup_size_ = 31;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Visitors.h b/TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Visitors.h
new file mode 100644
index 00000000000..f9067132c3b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Log_Constraint_Visitors.h
@@ -0,0 +1,130 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Log_Constraint_Visitors.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ * @author Jeff Parsons <parsons@cs.wustl.edu>
+ * @author D A Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LOG_CONSTRAINT_VISITORS_H
+#define TAO_LOG_CONSTRAINT_VISITORS_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Hash_Map_Manager.h"
+#include "ace/Unbounded_Queue.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ETCL/ETCL_Constraint_Visitor.h"
+#include "orbsvcs/DsLogAdminC.h"
+#include "ace/Null_Mutex.h"
+
+#include "orbsvcs/Log/log_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ETCL_Constraint;
+class TAO_ETCL_Literal_Constraint;
+class TAO_Log_Property_Constraint;
+
+/**
+ * @class TAO_Log_Constraint_Visitor
+ *
+ * @brief "ETCL" Visitor for the Log queries.
+ */
+class TAO_Log_Serv_Export TAO_Log_Constraint_Visitor :
+ public TAO_ETCL_Constraint_Visitor
+{
+public:
+
+ /// Constructor.
+ TAO_Log_Constraint_Visitor (const DsLogAdmin::LogRecord &rec);
+
+ /**
+ * Returns 1 if the offer satisfies the constraint
+ * represented by the the expression tree rooted at <root>, 0 if it
+ * doesn't. If an error occurs during process, the traversal
+ * automatically fails.
+ */
+ CORBA::Boolean evaluate_constraint (TAO_ETCL_Constraint *root);
+
+ // = The overridden methods.
+ int visit_literal (TAO_ETCL_Literal_Constraint *);
+ int visit_identifier (TAO_ETCL_Identifier *);
+ int visit_union_value (TAO_ETCL_Union_Value *);
+ int visit_union_pos (TAO_ETCL_Union_Pos *);
+ int visit_component_pos (TAO_ETCL_Component_Pos *);
+ int visit_component_assoc (TAO_ETCL_Component_Assoc *);
+ int visit_component_array (TAO_ETCL_Component_Array *);
+ int visit_special (TAO_ETCL_Special *);
+ int visit_component (TAO_ETCL_Component *);
+ int visit_dot (TAO_ETCL_Dot *);
+ int visit_eval (TAO_ETCL_Eval *);
+ int visit_default (TAO_ETCL_Default *);
+ int visit_exist (TAO_ETCL_Exist *);
+ int visit_unary_expr (TAO_ETCL_Unary_Expr *);
+ int visit_binary_expr (TAO_ETCL_Binary_Expr *);
+ int visit_preference (TAO_ETCL_Preference *);
+
+private:
+ // = Sub-methods for visit_binary_expr().
+ int visit_or (TAO_ETCL_Binary_Expr *);
+ int visit_and (TAO_ETCL_Binary_Expr *);
+ int visit_twiddle (TAO_ETCL_Binary_Expr *);
+ int visit_in (TAO_ETCL_Binary_Expr *);
+ int visit_binary_op (TAO_ETCL_Binary_Expr *binary_expr,
+ int op_type);
+
+ // = These use dynamic anys look inside the ETCL component.
+ CORBA::Boolean sequence_does_contain (const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item);
+ CORBA::Boolean array_does_contain (const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item);
+ CORBA::Boolean struct_does_contain (const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item);
+ CORBA::Boolean union_does_contain (const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item);
+ CORBA::Boolean any_does_contain (const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item);
+
+ /// Utility function to compare a TAO_ETCL_Literal_Constraint type
+ /// and a type code.
+ CORBA::Boolean simple_type_match (int expr_type,
+ CORBA::TCKind tc_kind);
+
+private:
+ /// Size of property_lookup_ hash map.
+ /// TODO: define inline once VC6 support is deprecated.
+ static const size_t property_lookup_size_;
+
+ typedef ACE_Hash_Map_Manager <ACE_CString,
+ CORBA::Any,
+ ACE_Null_Mutex> HASH_MAP;
+
+ typedef HASH_MAP::ENTRY HASH_ENTRY;
+
+ /// Used to lookup property name and values.
+ HASH_MAP property_lookup_;
+
+ /// The result of a non_boolean operation.
+ ACE_Unbounded_Queue<TAO_ETCL_Literal_Constraint> queue_;
+
+ /// Holder for a value found in property_lookup_ or for a
+ /// nested type within that value.
+ CORBA::Any_var current_member_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_LOG_CONSTRAINT_VISITORS_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/Log_Flush_Handler.cpp b/TAO/orbsvcs/orbsvcs/Log/Log_Flush_Handler.cpp
new file mode 100644
index 00000000000..122d35c486c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Log_Flush_Handler.cpp
@@ -0,0 +1,59 @@
+#include "orbsvcs/Log/Log_Flush_Handler.h"
+#include "orbsvcs/Log/Log_i.h"
+
+ACE_RCSID (Log,
+ Log_Flush_Handler,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Log_Flush_Handler::TAO_Log_Flush_Handler (ACE_Reactor* reactor,
+ TAO_Log_i* log,
+ const ACE_Time_Value& interval)
+ : timer_id_(-1),
+ reactor_(reactor),
+ log_(log),
+ interval_(interval)
+{
+}
+
+TAO_Log_Flush_Handler::~TAO_Log_Flush_Handler ()
+{
+ this->cancel ();
+}
+
+void
+TAO_Log_Flush_Handler::schedule ()
+{
+ this->cancel ();
+ this->timer_id_ =
+ this->reactor_->schedule_timer (this, 0, this->interval_, this->interval_);
+}
+
+void
+TAO_Log_Flush_Handler::cancel ()
+{
+ if (this->timer_id_ != -1)
+ {
+ this->reactor_->cancel_timer (timer_id_);
+ this->timer_id_ = -1;
+ }
+}
+
+int
+TAO_Log_Flush_Handler::handle_timeout (const ACE_Time_Value&, const void *)
+{
+ ACE_TRY_NEW_ENV
+ {
+ log_->flush (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/Log_Flush_Handler.h b/TAO/orbsvcs/orbsvcs/Log/Log_Flush_Handler.h
new file mode 100644
index 00000000000..f61d40ad999
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Log_Flush_Handler.h
@@ -0,0 +1,66 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Log_Flush_Handler.h
+ *
+ * $Id$
+ *
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_FLUSH_HANDLER_H
+#define TAO_TLS_FLUSH_HANDLER_H
+
+#include "orbsvcs/Log/log_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+#include "ace/Event_Handler.h"
+#include "ace/Time_Value.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Reactor;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Log_i;
+
+/// @class TAO_Log_Flush_Handler
+/// @brief Periodically flush log records to persistent store
+///
+class TAO_Log_Serv_Export TAO_Log_Flush_Handler
+ : public ACE_Event_Handler
+{
+public:
+ /// Constructor.
+ TAO_Log_Flush_Handler (ACE_Reactor* reactor,
+ TAO_Log_i* log,
+ const ACE_Time_Value& interval);
+
+ /// Destructor.
+ ~TAO_Log_Flush_Handler ();
+
+ /// Schedule Timer.
+ void schedule ();
+
+ /// Cancel Timer.
+ void cancel ();
+
+ virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg);
+
+private:
+ long timer_id_;
+ ACE_Reactor* reactor_;
+ TAO_Log_i* log_;
+ ACE_Time_Value interval_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_LOG_FLUSH_HANDLER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/Log_Persistence_Strategy.h b/TAO/orbsvcs/orbsvcs/Log/Log_Persistence_Strategy.h
new file mode 100644
index 00000000000..5e8832c5dee
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Log_Persistence_Strategy.h
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Log_Persistence_Strategy.h
+ *
+ * $Id$
+ *
+ * @author Matthew Braun <mjb2@cs.wustl.edu>
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_PERSISTENCE_STRATEGY_H
+#define TAO_TLS_PERSISTENCE_STRATEGY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Log/log_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+#include "ace/Service_Object.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_LogStore;
+class TAO_LogMgr_i;
+
+namespace CORBA
+{
+ class ORB;
+ typedef ORB* ORB_ptr;
+}
+
+/**
+ * @class TAO_Log_Persistence_Strategy
+ *
+ * @brief Base Strategy for Log / Log Record Storage
+ *
+ */
+class TAO_Log_Serv_Export TAO_Log_Persistence_Strategy
+ : public ACE_Service_Object
+{
+public:
+ /// @brief Log Store Factory
+ virtual TAO_LogStore*
+ create_log_store (TAO_LogMgr_i* logmgr_i) = 0;
+
+private:
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_TLS_PERSISTENCE_STRATEGY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/Log_i.cpp b/TAO/orbsvcs/orbsvcs/Log/Log_i.cpp
new file mode 100644
index 00000000000..263ef5d7ebc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Log_i.cpp
@@ -0,0 +1,1859 @@
+#include "orbsvcs/Log/Log_i.h"
+#include "orbsvcs/Log/LogMgr_i.h"
+#include "orbsvcs/Time_Utilities.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_sys_time.h"
+
+ACE_RCSID (Log,
+ Log_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Log Compaction Interval
+const ACE_Time_Value
+TAO_Log_i::log_compaction_interval_ = ACE_Time_Value(60);
+
+// Log Flush Interval
+const ACE_Time_Value
+TAO_Log_i::log_flush_interval_ = ACE_Time_Value(5 * 60);
+
+
+TAO_Log_i::TAO_Log_i (CORBA::ORB_ptr orb,
+ TAO_LogMgr_i &logmgr_i,
+ DsLogAdmin::LogMgr_ptr factory,
+ DsLogAdmin::LogId logid,
+ TAO_LogNotification *log_notifier)
+ : logmgr_i_(logmgr_i),
+ factory_ (DsLogAdmin::LogMgr::_duplicate (factory)),
+ logid_ (logid),
+ op_state_ (DsLogAdmin::disabled),
+ reactor_ (orb->orb_core()->reactor()),
+ notifier_ (log_notifier),
+ log_compaction_handler_ (reactor_, this, log_compaction_interval_),
+ log_flush_handler_ (reactor_, this, log_flush_interval_)
+{
+ // TODO: get log parameters from (persistent?) store.
+ avail_status_.off_duty = 0;
+ avail_status_.log_full = 0;
+}
+
+void
+TAO_Log_i::init (ACE_ENV_SINGLE_ARG_DECL)
+{
+#if 0
+ // @@ Calling create_log_reference () here leads to an infinate loop.
+ // When this is fixed, this can be enabled.
+ this->log_ =
+ logmgr_i_.create_log_reference (this->logid_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#endif
+
+ this->recordstore_ =
+ logmgr_i_.get_log_record_store (this->logid_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->recordstore_->open () ==-1)
+ ACE_THROW (CORBA::UNKNOWN ());
+
+ // fetch the capacity alarm thresholds from the log record store
+ DsLogAdmin::CapacityAlarmThresholdList_var thresholds =
+ this->recordstore_->get_capacity_alarm_thresholds (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // initialize the internal representation
+ this->thresholds_ = thresholds.in ();
+ this->reset_capacity_alarm_threshold (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+
+ // fetch the log QoS from the log record store
+ DsLogAdmin::QoSList_var qos =
+ this->recordstore_->get_log_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // initialize the internal representation.
+ this->reset_log_qos (qos.in ());
+
+
+ // fetch the week mask from the log record store
+ DsLogAdmin::WeekMask_var week_mask =
+ this->recordstore_->get_week_mask (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // initialize the internal representation
+ this->reset_week_mask (week_mask.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+
+ // fetch the maximum record life from the log record store
+ CORBA::ULong max_record_life =
+ this->recordstore_->get_max_record_life (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // if set, activate the compaction handler
+ if (max_record_life != 0)
+ {
+ this->log_compaction_handler_.schedule ();
+ }
+
+ this->op_state_ = DsLogAdmin::enabled;
+}
+
+TAO_Log_i::~TAO_Log_i (void)
+{
+}
+
+DsLogAdmin::LogMgr_ptr
+TAO_Log_i::my_factory (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return DsLogAdmin::LogMgr::_duplicate (this->factory_.in ());
+}
+
+DsLogAdmin::LogId
+TAO_Log_i::id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return logid_;
+}
+
+DsLogAdmin::QoSList*
+TAO_Log_i::get_log_qos (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ // @@ The current revision of the specification (formal/03-07-01)
+ // states that get_log_qos() returns a list of the QoS properties
+ // supported by the log, not the current value. However, because
+ // that is inconsistent with both the Log Service's other get
+ // methods and the Notification Service's QoS get_qos methods, I
+ // have submitted a defect report to the OMG for clarification.
+ // --jtc
+
+ return this->recordstore_->get_log_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Log_i::set_log_qos (const DsLogAdmin::QoSList &qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::UnsupportedQoS))
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // @@ The current revision of the specification (formal/03-07-01)
+ // does not clearly define the semantics to follow when the QoSList
+ // contains mutually exclusive, unsupported, or unknown properties.
+ // I have submitted a defect report to the OMG for clarification.
+ //
+ // In the mean time, the last known/supported property found in the
+ // QoSList takes presidence. If any unknown/unsupported properties
+ // were found, an UnsupportedQoS exception is thrown.
+ // --jtc
+
+ validate_log_qos (qos);
+
+ DsLogAdmin::QoSList_var old_qos =
+ this->recordstore_->get_log_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ The current revision of the specification (formal/03-07-01) is
+ // unclear whether an AttributeValueChange event should be sent if a
+ // log attribute was changed (to a new value), or whether the events
+ // should be sent unconditionally. I have submitted a defect report
+ // to the OMG for clarification.
+ //
+ // In the mean time, we're interepreting it to mean that events are
+ // only sent when the value has changed.
+ if (qos == old_qos.in ())
+ return;
+
+ this->recordstore_->set_log_qos (qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ reset_log_qos (qos);
+
+ if (notifier_)
+ {
+ // @@ Calling create_log_reference () in the ctor or in ::init()
+ // leads to an infinate loop. This should be removed when that
+ // is fixed.
+ if (CORBA::is_nil (this->log_.in ()))
+ {
+ this->log_ = logmgr_i_.create_log_reference (this->logid_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ notifier_->quality_of_service_value_change (this->log_.in (),
+ this->logid_,
+ old_qos.in (),
+ qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+CORBA::ULong
+TAO_Log_i::get_max_record_life (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ return
+ this->recordstore_->get_max_record_life(ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Log_i::set_max_record_life (CORBA::ULong life
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ CORBA::ULong old_life =
+ this->recordstore_->get_max_record_life (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ The current revision of the specification (formal/03-07-01) is
+ // unclear whether an AttributeValueChange event should be sent if a
+ // log attribute was changed (to a new value), or whether the events
+ // should be sent unconditionally. I have submitted a defect report
+ // to the OMG for clarification.
+ //
+ // In the mean time, we're interepreting it to mean that events are
+ // only sent when the value has changed.
+ if (life == old_life)
+ return;
+
+ this->recordstore_->set_max_record_life (life ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (life != 0)
+ this->log_compaction_handler_.schedule();
+ else
+ this->log_compaction_handler_.cancel();
+
+ if (notifier_)
+ {
+ // @@ Calling create_log_reference () in the ctor or in ::init()
+ // leads to an infinate loop. This should be removed when that
+ // is fixed.
+ if (CORBA::is_nil (this->log_.in ()))
+ {
+ this->log_ = logmgr_i_.create_log_reference (this->logid_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ notifier_->max_record_life_value_change (this->log_.in (),
+ this->logid_,
+ old_life,
+ life
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+CORBA::ULongLong
+TAO_Log_i::get_max_size (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ return recordstore_->get_max_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Log_i::set_max_size (CORBA::ULongLong size
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidParam))
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ CORBA::ULongLong old_size =
+ this->recordstore_->get_max_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ The current revision of the specification (formal/03-07-01) is
+ // unclear whether an AttributeValueChange event should be sent if a
+ // log attribute was changed (to a new value), or whether the events
+ // should be sent unconditionally. I have submitted a defect report
+ // to the OMG for clarification.
+ //
+ // In the mean time, we're interepreting it to mean that events are
+ // only sent when the value has changed.
+ if (size == old_size)
+ return;
+
+ // size == 0 => infinite size.
+ if (size != 0)
+ {
+ CORBA::ULongLong current_size =
+ this->recordstore_->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (size < current_size)
+ ACE_THROW (DsLogAdmin::InvalidParam ());
+ }
+
+ this->recordstore_->set_max_size (size ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (notifier_)
+ {
+ // @@ Calling create_log_reference () in the ctor or in ::init()
+ // leads to an infinate loop. This should be removed when that
+ // is fixed.
+ if (CORBA::is_nil (this->log_.in ()))
+ {
+ this->log_ = logmgr_i_.create_log_reference (this->logid_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ notifier_->max_log_size_value_change (this->log_.in (),
+ this->logid_,
+ old_size,
+ size
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // @@ The current revision of the specification (formal/03-07-01)
+ // doesn't specify the interaction between set_max_size() and the
+ // capacity alarm thresholds list. Publicly available documentation
+ // I've read for other log service implementations doesn't offer any
+ // guidance either. I have submitted a defect report to the OMG for
+ // clarification.
+ //
+ // In the mean time, we will call reset_capacity_alarm_threshold()
+ // to reset the "current_threshold_" index. This will result in
+ // ThresholdAlarm being sent when the next threshold is crossed. An
+ // argument could be made that an event should be be sent for each
+ // threshold that has already been crossed. Hopefully, this will be
+ // clarified when/if the OMG charters a RTF for the log service.
+ // --jtc
+ //
+ this->reset_capacity_alarm_threshold (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CORBA::ULongLong
+TAO_Log_i::get_current_size (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ return this->recordstore_->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ULongLong
+TAO_Log_i::get_n_records (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ return this->recordstore_->get_n_records (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+DsLogAdmin::LogFullActionType
+TAO_Log_i::get_log_full_action (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ return this->recordstore_->get_log_full_action(ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Log_i::set_log_full_action (DsLogAdmin::LogFullActionType action
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidLogFullAction))
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ if (action != DsLogAdmin::wrap && action != DsLogAdmin::halt)
+ ACE_THROW (DsLogAdmin::InvalidLogFullAction ());
+
+ DsLogAdmin::LogFullActionType old_action =
+ this->recordstore_->get_log_full_action (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ The current revision of the specification (formal/03-07-01) is
+ // unclear whether an AttributeValueChange event should be sent if a
+ // log attribute was changed (to a new value), or whether the events
+ // should be sent unconditionally. I have submitted a defect report
+ // to the OMG for clarification.
+ //
+ // In the mean time, we're interepreting it to mean that events are
+ // only sent when the value has changed.
+ if (action == old_action)
+ return;
+
+ this->recordstore_->set_log_full_action (action ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (notifier_)
+ {
+ // @@ Calling create_log_reference () in the ctor or in ::init()
+ // leads to an infinate loop. This should be removed when that
+ // is fixed.
+ if (CORBA::is_nil (this->log_.in ()))
+ {
+ this->log_ = logmgr_i_.create_log_reference (this->logid_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ notifier_->log_full_action_value_change (this->log_.in (),
+ this->logid_,
+ old_action,
+ action
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // @@ The current revision of the specification (formal/03-07-01)
+ // doesn't specify the interaction between set_log_full_action() and the
+ // capacity alarm thresholds list. Publicly available documentation
+ // I've read for other log service implementations doesn't offer any
+ // guidance either. I have submitted a defect report to the OMG for
+ // clarification.
+ //
+ // In the mean time, we will call reset_capacity_alarm_threshold()
+ // to reset the "current_threshold_" index. This will result in
+ // ThresholdAlarm being sent when the next threshold is crossed. An
+ // argument could be made that an event should be be sent for each
+ // threshold that has already been crossed. Hopefully, this will be
+ // clarified when/if the OMG charters a RTF for the log service.
+ // --jtc
+ //
+ this->reset_capacity_alarm_threshold (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+DsLogAdmin::AdministrativeState
+TAO_Log_i::get_administrative_state (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ return this->recordstore_->get_administrative_state (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Log_i::set_administrative_state (DsLogAdmin::AdministrativeState state
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ DsLogAdmin::AdministrativeState old_state =
+ this->recordstore_->get_administrative_state (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ The current revision of the specification (formal/03-07-01) is
+ // unclear whether an AttributeValueChange event should be sent if a
+ // log attribute was changed (to a new value), or whether the events
+ // should be sent unconditionally. I have submitted a defect report
+ // to the OMG for clarification.
+ //
+ // In the mean time, we're interepreting it to mean that events are
+ // only sent when the value has changed.
+ if (state == old_state)
+ return;
+
+ this->recordstore_->set_administrative_state (state ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (notifier_)
+ {
+ // @@ Calling create_log_reference () in the ctor or in ::init()
+ // leads to an infinate loop. This should be removed when that
+ // is fixed.
+ if (CORBA::is_nil (this->log_.in ()))
+ {
+ this->log_ = logmgr_i_.create_log_reference (this->logid_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ notifier_->administrative_state_change (this->log_.in (),
+ this->logid_,
+ state
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+DsLogAdmin::ForwardingState
+TAO_Log_i::get_forwarding_state (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ return
+ this->recordstore_->get_forwarding_state (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Log_i::set_forwarding_state (DsLogAdmin::ForwardingState state
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ DsLogAdmin::ForwardingState old_state =
+ this->recordstore_->get_forwarding_state (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ The current revision of the specification (formal/03-07-01) is
+ // unclear whether an AttributeValueChange event should be sent if a
+ // log attribute was changed (to a new value), or whether the events
+ // should be sent unconditionally. I have submitted a defect report
+ // to the OMG for clarification.
+ //
+ // In the mean time, we're interepreting it to mean that events are
+ // only sent when the value has changed.
+ if (state == old_state)
+ return;
+
+ this->recordstore_->set_forwarding_state (state ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (notifier_)
+ {
+ // @@ Calling create_log_reference () in the ctor or in ::init()
+ // leads to an infinate loop. This should be removed when that
+ // is fixed.
+ if (CORBA::is_nil (this->log_.in ()))
+ {
+ this->log_ = logmgr_i_.create_log_reference (this->logid_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ notifier_->forwarding_state_change (this->log_.in (),
+ this->logid_,
+ state
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+DsLogAdmin::OperationalState
+TAO_Log_i::get_operational_state (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // No locks are necessary, since op_state_ is set in ::init() and
+ // never changed.
+ return this->op_state_;
+}
+
+DsLogAdmin::TimeInterval
+TAO_Log_i::get_interval (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ return this->recordstore_->get_interval (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Log_i::set_interval (const DsLogAdmin::TimeInterval &interval
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidTime,
+ DsLogAdmin::InvalidTimeInterval))
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // validate interval
+ if (interval.start != 0)
+ {
+ if (interval.start >= interval.stop)
+ ACE_THROW (DsLogAdmin::InvalidTimeInterval ());
+ }
+
+ DsLogAdmin::TimeInterval old_interval =
+ this->recordstore_->get_interval (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ The current revision of the specification (formal/03-07-01) is
+ // unclear whether an AttributeValueChange event should be sent if a
+ // log attribute was changed (to a new value), or whether the events
+ // should be sent unconditionally. I have submitted a defect report
+ // to the OMG for clarification.
+ //
+ // In the mean time, we're interepreting it to mean that events are
+ // only sent when the value has changed.
+ if (interval == old_interval)
+ return;
+
+ this->recordstore_->set_interval (interval ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (notifier_)
+ {
+ // @@ Calling create_log_reference () in the ctor or in ::init()
+ // leads to an infinate loop. This should be removed when that
+ // is fixed.
+ if (CORBA::is_nil (this->log_.in ()))
+ {
+ this->log_ = logmgr_i_.create_log_reference (this->logid_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (interval.start != old_interval.start)
+ {
+ notifier_->start_time_value_change (this->log_.in (),
+ this->logid_,
+ old_interval.start,
+ interval.start
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (interval.stop != old_interval.stop)
+ {
+ notifier_->stop_time_value_change (this->log_.in (),
+ this->logid_,
+ old_interval.stop,
+ interval.stop
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+}
+
+DsLogAdmin::AvailabilityStatus
+TAO_Log_i::get_availability_status (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ return this->get_availability_status_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+DsLogAdmin::AvailabilityStatus
+TAO_Log_i::get_availability_status_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // The log is considered "on duty" if all the following are true:
+ // * operational state is enabled
+ // * adminstrative state is unlocked
+ // * current time falls within the log duration time.
+ // * current time falls within one (or more) of the log
+ // scheduling times.
+
+ const CORBA::Boolean s = this->scheduled (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (this->avail_status_);
+
+ DsLogAdmin::AdministrativeState admin_state =
+ this->recordstore_->get_administrative_state (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (this->avail_status_);
+
+ if (this->op_state_ == DsLogAdmin::enabled
+ && admin_state == DsLogAdmin::unlocked
+ && s == 1)
+ {
+ this->avail_status_.off_duty = 0; // "on duty"
+
+ }
+ else
+ this->avail_status_.off_duty = 1;
+ // The log_full flag is set by the write operations.
+ return this->avail_status_;
+}
+
+DsLogAdmin::CapacityAlarmThresholdList*
+TAO_Log_i::get_capacity_alarm_thresholds (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ return this->recordstore_->get_capacity_alarm_thresholds (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Log_i::set_capacity_alarm_thresholds (const
+ DsLogAdmin::CapacityAlarmThresholdList
+ &threshs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidThreshold))
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ const CORBA::Boolean validated =
+ TAO_Log_i::validate_capacity_alarm_thresholds (threshs
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (!validated)
+ ACE_THROW (DsLogAdmin::InvalidThreshold ());
+
+ DsLogAdmin::CapacityAlarmThresholdList_var old_threshs =
+ this->recordstore_->get_capacity_alarm_thresholds (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ The current revision of the specification (formal/03-07-01) is
+ // unclear whether an AttributeValueChange event should be sent if a
+ // log attribute was changed (to a new value), or whether the events
+ // should be sent unconditionally. I have submitted a defect report
+ // to the OMG for clarification.
+ //
+ // In the mean time, we're interepreting it to mean that events are
+ // only sent when the value has changed.
+ if (threshs == old_threshs.in ())
+ return;
+
+ this->recordstore_->set_capacity_alarm_thresholds (threshs
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (notifier_)
+ {
+ // @@ Calling create_log_reference () in the ctor or in ::init()
+ // leads to an infinate loop. This should be removed when that
+ // is fixed.
+ if (CORBA::is_nil (this->log_.in ()))
+ {
+ this->log_ = logmgr_i_.create_log_reference (this->logid_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ notifier_->capacity_alarm_threshold_value_change (this->log_.in (),
+ this->logid_,
+ old_threshs.in (),
+ threshs
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // @@ The current revision of the specification (formal/03-07-01)
+ // doesn't completly describe the behavior of changing the capacity
+ // alarm threshold list. Publicly available documentation I've read
+ // for other log service implementations doesn't offer much guidance
+ // either. I have submitted a defect report to the OMG for
+ // clarification.
+ //
+ // In the mean time, we will call reset_capacity_alarm_threshold()
+ // to reset the "current_threshold_" index. This will result in
+ // ThresholdAlarm being sent when the next threshold is crossed. An
+ // argument could be made that an event should be be sent for each
+ // threshold that has already been crossed. Hopefully, this will be
+ // clarified when/if the OMG charters a RTF for the log service.
+ // --jtc
+ //
+ this->thresholds_ = threshs;
+ this->reset_capacity_alarm_threshold (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+DsLogAdmin::WeekMask*
+TAO_Log_i::get_week_mask (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ return this->recordstore_->get_week_mask (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Log_i::set_week_mask (const DsLogAdmin::WeekMask &masks
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidTime,
+ DsLogAdmin::InvalidTimeInterval,
+ DsLogAdmin::InvalidMask))
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ validate_week_mask (masks ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ DsLogAdmin::WeekMask_var old_masks =
+ this->recordstore_->get_week_mask (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ The current revision of the specification (formal/03-07-01) is
+ // unclear whether an AttributeValueChange event should be sent if a
+ // log attribute was changed (to a new value), or whether the events
+ // should be sent unconditionally. I have submitted a defect report
+ // to the OMG for clarification.
+ //
+ // In the mean time, we're interepreting it to mean that events are
+ // only sent when the value has changed.
+ if (masks == old_masks.in ())
+ return;
+
+ this->recordstore_->set_week_mask (masks ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->reset_week_mask (masks ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (notifier_)
+ {
+ // @@ Calling create_log_reference () in the ctor or in ::init()
+ // leads to an infinate loop. This should be removed when that
+ // is fixed.
+ if (CORBA::is_nil (this->log_.in ()))
+ {
+ this->log_ = logmgr_i_.create_log_reference (this->logid_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ notifier_->week_mask_value_change (this->log_.in (),
+ this->logid_,
+ old_masks.in (),
+ masks
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+DsLogAdmin::RecordList*
+TAO_Log_i::query (const char *grammar,
+ const char *constraint,
+ DsLogAdmin::Iterator_out iter_out
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ return this->recordstore_->query (grammar,
+ constraint,
+ iter_out
+ ACE_ENV_ARG_PARAMETER);
+}
+
+DsLogAdmin::RecordList*
+TAO_Log_i::retrieve (DsLogAdmin::TimeT from_time,
+ CORBA::Long how_many,
+ DsLogAdmin::Iterator_out iter_out
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ return this->recordstore_->retrieve (from_time,
+ how_many,
+ iter_out
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ULong
+TAO_Log_i::match (const char* grammar,
+ const char *constraint
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ const CORBA::ULong count =
+ this->recordstore_->match (grammar,
+ constraint
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return count;
+}
+
+CORBA::ULong
+TAO_Log_i::delete_records (const char *grammar,
+ const char *constraint
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint))
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ const CORBA::ULong count =
+ this->recordstore_->delete_records (grammar,
+ constraint
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (count > 0)
+ {
+ if (avail_status_.log_full)
+ {
+ const CORBA::ULongLong current_size =
+ this->recordstore_->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ const CORBA::ULongLong max_size =
+ this->recordstore_->get_max_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (current_size < max_size)
+ {
+ avail_status_.log_full = 0;
+ }
+ }
+
+ this->reset_capacity_alarm_threshold (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return count;
+}
+
+CORBA::ULong
+TAO_Log_i::delete_records_by_id (const DsLogAdmin::RecordIdList &ids
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ const CORBA::ULong count =
+ this->recordstore_->delete_records_by_id (ids ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (count > 0)
+ {
+ if (avail_status_.log_full)
+ {
+ const CORBA::ULongLong current_size =
+ this->recordstore_->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ const CORBA::ULongLong max_size =
+ this->recordstore_->get_max_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (current_size < max_size)
+ {
+ avail_status_.log_full = 0;
+ }
+ }
+
+ this->reset_capacity_alarm_threshold (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return count;
+}
+
+void
+TAO_Log_i::write_records (const DsLogAdmin::Anys &records
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::LogFull,
+ DsLogAdmin::LogOffDuty,
+ DsLogAdmin::LogLocked,
+ DsLogAdmin::LogDisabled))
+{
+ // create a record list..
+ DsLogAdmin::RecordList reclist (records.length ());
+ reclist.length (records.length ());
+
+ for (CORBA::ULong i = 0; i < records.length (); ++i)
+ {
+ reclist [i].info = records[i];
+ }
+
+ this->write_recordlist (reclist ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Log_i::write_recordlist (const DsLogAdmin::RecordList &reclist
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::LogFull,
+ DsLogAdmin::LogOffDuty,
+ DsLogAdmin::LogLocked,
+ DsLogAdmin::LogDisabled))
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ DsLogAdmin::LogFullActionType log_full_action =
+ this->recordstore_->get_log_full_action (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ DsLogAdmin::AdministrativeState admin_state =
+ this->recordstore_->get_administrative_state (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ The current revision of the specification (formal/03-07-01)
+ // does not explicitly specify the preference of exceptions to be
+ // thrown when multiple error conditions are present.
+ //
+ // However, the because log is considered off duty if the log's
+ // operational state is disabled or its administrative state is
+ // locked, we handle the LogOffDuty exception last so the more
+ // specific LogLocked and LogDisabled exceptions will be thrown.
+
+ DsLogAdmin::AvailabilityStatus avail_stat =
+ this->get_availability_status_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (admin_state == DsLogAdmin::locked)
+ {
+ ACE_THROW (DsLogAdmin::LogLocked ());
+ }
+ else if (this->op_state_ == DsLogAdmin::disabled)
+ {
+ ACE_THROW (DsLogAdmin::LogDisabled ());
+ }
+ else if (avail_stat.off_duty == 1)
+ {
+ ACE_THROW (DsLogAdmin::LogOffDuty ());
+ }
+
+ CORBA::Short num_written (0);
+
+ for (CORBA::ULong i = 0; i < reclist.length (); i++)
+ {
+ // retval == 1 => log store reached max size.
+
+ int retval = this->recordstore_->log (reclist[i] ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (retval == 1)
+ {
+ // The Log is full . check what the policy is and take
+ // appropriate action.
+ if (log_full_action == DsLogAdmin::halt)
+ {
+ avail_status_.log_full = 1;
+ ACE_THROW (DsLogAdmin::LogFull (num_written));
+ }
+
+ // the policy is to wrap. for this we need to delete a few
+ // records. let the record store decide how many.
+
+ if (this->recordstore_->purge_old_records (ACE_ENV_SINGLE_ARG_PARAMETER) == -1)
+ ACE_THROW (CORBA::PERSIST_STORE ());
+
+ // Now, we want to attempt to write the same record again
+ // so decrement the index to balance the inc. in the for loop.
+ --i;
+ }
+ else if (retval == 0)
+ {
+ num_written++;
+
+ this->check_capacity_alarm_threshold (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ ACE_THROW (CORBA::PERSIST_STORE ());
+ }
+ } // for
+}
+
+void
+TAO_Log_i::set_record_attribute (DsLogAdmin::RecordId id,
+ const DsLogAdmin::NVList &attr_list
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidRecordId,
+ DsLogAdmin::InvalidAttribute))
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ this->recordstore_->set_record_attribute (id, attr_list
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ULong
+TAO_Log_i::set_records_attribute (const char *grammar,
+ const char *constraint,
+ const DsLogAdmin::NVList
+ &attr_list ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint,
+ DsLogAdmin::InvalidAttribute))
+{
+ ACE_WRITE_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ return this->recordstore_->set_records_attribute (grammar,
+ constraint,
+ attr_list
+ ACE_ENV_ARG_PARAMETER);
+}
+
+DsLogAdmin::NVList*
+TAO_Log_i::get_record_attribute (DsLogAdmin::RecordId id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidRecordId))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_SYNCH_RW_MUTEX,
+ guard,
+ this->recordstore_->lock (),
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+
+ return this->recordstore_->get_record_attribute (id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Log_i::flush (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::UnsupportedQoS))
+{
+ /// XXX locks?
+ this->recordstore_->flush (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_Log_i::scheduled (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ DsLogAdmin::TimeInterval interval =
+ this->recordstore_->get_interval (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TimeBase::TimeT current_time;
+ ACE_Time_Value now = ACE_OS::gettimeofday ();
+ ORBSVCS_Time::Time_Value_to_TimeT (current_time, now);
+
+ if ((current_time >= interval.start) &&
+ ((current_time <= interval.stop) || (interval.stop == 0)) )
+ {
+ if (weekly_intervals_.length () > 0)
+ {
+ // work out when sunday is in nanoseconds.
+ timeval t;
+ t = (timeval) now;
+ struct tm *sunday;
+
+ time_t clock = (time_t) t.tv_sec;
+ sunday = ACE_OS::localtime (&clock);
+
+ sunday->tm_sec = 0;
+ sunday->tm_min = 0;
+ sunday->tm_hour = 0;
+ sunday->tm_mday -= sunday->tm_wday;
+
+ t.tv_sec = ACE_OS::mktime (sunday) ;
+ t.tv_usec = 0;
+
+ TimeBase::TimeT nano_sunday =
+ (CORBA::ULongLong) t.tv_sec * 10000000;
+
+ for (CORBA::ULong i = 0; i < weekly_intervals_.length (); ++i)
+ {
+ if (current_time >= (weekly_intervals_[i].start + nano_sunday) &&
+ current_time <= (weekly_intervals_[i].stop + nano_sunday))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ else
+ return true;
+ }
+ else
+ return false;
+}
+
+void
+TAO_Log_i::copy_attributes (DsLogAdmin::Log_ptr log
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ const DsLogAdmin::LogFullActionType log_full_action =
+ this->get_log_full_action (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ log->set_log_full_action (log_full_action
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const CORBA::ULongLong max_size =
+ this->get_max_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ log->set_max_size (max_size
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ DsLogAdmin::QoSList_var log_qos =
+ this->get_log_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ log->set_log_qos (log_qos.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const CORBA::ULong max_record_life =
+ this->get_max_record_life (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ log->set_max_record_life (max_record_life
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const DsLogAdmin::AdministrativeState adminstrative_state =
+ this->get_administrative_state (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ log->set_administrative_state (adminstrative_state
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const DsLogAdmin::ForwardingState forwarding_state =
+ this->get_forwarding_state (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ log->set_forwarding_state (forwarding_state
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const DsLogAdmin::TimeInterval interval =
+ this->get_interval (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ log->set_interval (interval
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ DsLogAdmin::CapacityAlarmThresholdList_var capacity_list =
+ this->get_capacity_alarm_thresholds (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ log->set_capacity_alarm_thresholds (capacity_list.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ DsLogAdmin::WeekMask_var week_mask =
+ this->get_week_mask (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ log->set_week_mask (week_mask.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Log_i::remove_old_records (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ const CORBA::ULong count =
+ this->recordstore_->remove_old_records (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (count > 0)
+ {
+ if (avail_status_.log_full)
+ {
+ const CORBA::ULongLong current_size =
+ this->recordstore_->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const CORBA::ULongLong max_size =
+ this->recordstore_->get_max_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (current_size < max_size)
+ {
+ avail_status_.log_full = 0;
+ }
+ }
+
+ this->reset_capacity_alarm_threshold (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_Log_i::check_capacity_alarm_threshold (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ const CORBA::ULongLong max_size =
+ this->recordstore_->get_max_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (max_size != 0 && this->thresholds_.length () > 0)
+ {
+ const DsLogAdmin::LogFullActionType log_full_action =
+ this->recordstore_->get_log_full_action (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULongLong current_size =
+ ((log_full_action == DsLogAdmin::wrap)
+ ? this->recordstore_->get_gauge (ACE_ENV_SINGLE_ARG_PARAMETER)
+ : this->recordstore_->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+
+ const CORBA::UShort percent =
+ static_cast<CORBA::UShort> (((double) ACE_UINT64_DBLCAST_ADAPTER (current_size * 100U) /
+ (double) ACE_UINT64_DBLCAST_ADAPTER (max_size)));
+
+ while (current_threshold_ < this->thresholds_.length ()
+ && this->thresholds_[this->current_threshold_] <= percent)
+ {
+ if (notifier_)
+ {
+ const DsLogNotification::PerceivedSeverityType severity =
+ ((percent == 100)
+ ? DsLogNotification::critical
+ : DsLogNotification::minor);
+
+ // @@ Calling create_log_reference () in the ctor or in ::init()
+ // leads to an infinate loop. This should be removed when that
+ // is fixed.
+ if (CORBA::is_nil (this->log_.in ()))
+ {
+ this->log_ = logmgr_i_.create_log_reference (this->logid_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ notifier_->threshold_alarm (
+ this->log_.in (),
+ logid_,
+ this->thresholds_[this->current_threshold_],
+ percent,
+ severity
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "threshold of %d breached\n",
+ this->thresholds_[this->current_threshold_]));
+ }
+
+ ++this->current_threshold_;
+ }
+
+ // "When a log object is created with the wrap option, the
+ // capacity threshold alarms are triggered as if coupled to a
+ // gauge that counts from zero to the highest capacity threshold
+ // value defined and then resets to zero."
+ if (log_full_action == DsLogAdmin::wrap
+ && this->current_threshold_ == this->thresholds_.length ())
+ {
+ this->recordstore_->reset_gauge ();
+ this->current_threshold_ = 0;
+ }
+ }
+}
+
+void
+TAO_Log_i::reset_capacity_alarm_threshold (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ const CORBA::ULongLong max_size =
+ this->recordstore_->get_max_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (max_size != 0 && this->thresholds_.length() > 0)
+ {
+ const DsLogAdmin::LogFullActionType log_full_action =
+ this->recordstore_->get_log_full_action (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (log_full_action == DsLogAdmin::halt)
+ {
+ const CORBA::ULongLong current_size =
+ this->recordstore_->get_current_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const CORBA::UShort percent =
+ static_cast<CORBA::UShort> ((((double) ACE_UINT64_DBLCAST_ADAPTER (current_size * 100U)) /
+ (double) ACE_UINT64_DBLCAST_ADAPTER (max_size)));
+
+ this->current_threshold_ = 0;
+
+ while (this->current_threshold_ < this->thresholds_.length ()
+ && this->thresholds_[this->current_threshold_] <= percent)
+ ++this->current_threshold_;
+ }
+ }
+}
+
+CORBA::Boolean
+TAO_Log_i::validate_capacity_alarm_thresholds (
+ const DsLogAdmin::CapacityAlarmThresholdList & threshs
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ for (CORBA::ULong i = 0; i < threshs.length (); i++)
+ if (threshs[i] > 100)
+ return false;
+
+ // @@ The current revision of the specification (formal/03-07-01)
+ // does not require theshold values be in order or unique. This
+ // appears to be an TAO TLS implementation artifact for efficent
+ // threshold checks. We could eliminate this restriction by
+ // normalizing the sequence.
+
+ if (threshs.length () > 1)
+ for (CORBA::ULong i = 0; i < threshs.length () - 1; i++)
+ if (threshs[i] >= threshs[i + 1])
+ return false;
+
+ return true;
+}
+
+void
+TAO_Log_i::reset_log_qos (const DsLogAdmin::QoSList& qos
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ // @@ The current revision of the specification (formal/03-07-01)
+ // does not clearly define the semantics to follow when the QoSList
+ // contains mutually exclusive, unsupported, or unknown properties.
+ // I have submitted a defect report to the OMG for clarification.
+ //
+ // In the mean time, the last property found in the QoSList takes
+ // presidence.
+ // --jtc
+
+ DsLogAdmin::QoSType qostype = DsLogAdmin::QoSNone;
+
+ for (CORBA::ULong i = 0; i < qos.length (); ++i)
+ {
+ qostype = qos[i];
+ }
+
+ this->qostype_ = qostype;
+
+ if (this->qostype_ == DsLogAdmin::QoSFlush)
+ this->log_flush_handler_.schedule ();
+ else
+ this->log_flush_handler_.cancel ();
+}
+
+void
+TAO_Log_i::validate_log_qos (const DsLogAdmin::QoSList& qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((DsLogAdmin::UnsupportedQoS))
+{
+ DsLogAdmin::QoSList denied;
+
+ // validate properties..
+ for (CORBA::ULong i = 0; i < qos.length (); ++i)
+ {
+ DsLogAdmin::QoSType qostype = qos[i];
+ if (qostype != DsLogAdmin::QoSNone &&
+ qostype != DsLogAdmin::QoSFlush &&
+ qostype != DsLogAdmin::QoSReliability)
+ {
+ CORBA::ULong len = denied.length();
+ denied.length(len + 1);
+ denied[len] = qostype;
+ }
+ }
+
+ // if there were any unknown/unsupported properties, thrown an
+ // exception.
+ if (denied.length() != 0)
+ {
+ ACE_THROW (DsLogAdmin::UnsupportedQoS (denied));
+ }
+}
+
+void
+TAO_Log_i::reset_week_mask (const DsLogAdmin::WeekMask& masks
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ CORBA::ULong count = 0;
+ weekly_intervals_.length (100);
+
+ // convert the weekmask into a sequence of time intervals.
+ for (CORBA::ULong k = 0; k < masks.length (); ++k)
+ {
+ for (CORBA::ULong j = 0; j < masks[k].intervals.length (); ++j)
+ {
+ for (int d = 0; d < 7; ++d)
+ {
+ if ( (1 << d) & masks[k].days)
+ {
+ DsLogAdmin::TimeInterval temp_interval;
+
+ temp_interval.start =
+ CORBA::ULongLong (
+ (d * 3600* 24) +
+ (masks[k].intervals[j].start.hour * 3600) +
+ (masks[k].intervals[j].start.minute * 60)) * 10000000;
+
+ temp_interval.stop =
+ CORBA::ULongLong (
+ (d * 3600* 24) +
+ (masks[k].intervals[j].stop.hour * 3600) +
+ (masks[k].intervals[j].stop.minute * 60)) * 10000000;
+
+ weekly_intervals_[count] = temp_interval;
+ ++count;
+ }
+ }
+ }
+ }
+ weekly_intervals_.length (count);
+
+ //TODO: SORT AND CLEAN
+}
+
+void
+TAO_Log_i::validate_week_mask (const DsLogAdmin::WeekMask& masks
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((DsLogAdmin::InvalidTime,
+ DsLogAdmin::InvalidTimeInterval,
+ DsLogAdmin::InvalidMask))
+{
+ for (CORBA::ULong i = 0; i < masks.length (); ++i)
+ {
+ if (masks[i].days > (DsLogAdmin::Sunday +
+ DsLogAdmin::Monday +
+ DsLogAdmin::Tuesday +
+ DsLogAdmin::Wednesday +
+ DsLogAdmin::Thursday +
+ DsLogAdmin::Friday +
+ DsLogAdmin::Saturday)
+ )
+ ACE_THROW (DsLogAdmin::InvalidMask ());
+
+ for (CORBA::ULong j = 0; j < masks[i].intervals.length (); ++j)
+ {
+ if (masks[i].intervals[j].start.hour > 23 ||
+ masks[i].intervals[j].start.minute > 59 ||
+ masks[i].intervals[j].stop.hour > 23 ||
+ masks[i].intervals[j].stop.minute > 59)
+ ACE_THROW (DsLogAdmin::InvalidTime ());
+
+ if (masks[i].intervals[j].stop.hour <
+ masks[i].intervals[j].start.hour)
+ ACE_THROW (DsLogAdmin::InvalidTimeInterval ());
+
+ if (masks[i].intervals[j].stop.hour ==
+ masks[i].intervals[j].start.hour &&
+ masks[i].intervals[j].stop.minute <=
+ masks[i].intervals[j].start.minute)
+ ACE_THROW (DsLogAdmin::InvalidTimeInterval ());
+ }
+ }
+}
+
+
+bool
+operator==(const DsLogAdmin::CapacityAlarmThresholdList& rhs,
+ const DsLogAdmin::CapacityAlarmThresholdList& lhs)
+{
+ const CORBA::ULong length = rhs.length ();
+
+ if (length != lhs.length ())
+ {
+ return false;
+ }
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ if (rhs[i] != lhs[i])
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool
+operator!=(const DsLogAdmin::CapacityAlarmThresholdList& rhs,
+ const DsLogAdmin::CapacityAlarmThresholdList& lhs)
+{
+ return !(lhs == rhs);
+}
+
+
+bool
+operator==(const DsLogAdmin::IntervalsOfDay& rhs,
+ const DsLogAdmin::IntervalsOfDay& lhs)
+{
+ const CORBA::ULong length = rhs.length ();
+
+ if (length != lhs.length ())
+ {
+ return false;
+ }
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ if (rhs[i] != lhs[i])
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool
+operator!=(const DsLogAdmin::IntervalsOfDay& rhs,
+ const DsLogAdmin::IntervalsOfDay& lhs)
+{
+ return !(lhs == rhs);
+}
+
+
+bool
+operator==(const DsLogAdmin::QoSList& rhs,
+ const DsLogAdmin::QoSList& lhs)
+{
+ const CORBA::ULong length = rhs.length ();
+
+ if (length != lhs.length ())
+ {
+ return false;
+ }
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ if (rhs[i] != lhs[i])
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool
+operator!=(const DsLogAdmin::QoSList& rhs,
+ const DsLogAdmin::QoSList& lhs)
+{
+ return !(lhs == rhs);
+}
+
+
+bool
+operator==(const DsLogAdmin::Time24& rhs,
+ const DsLogAdmin::Time24& lhs)
+{
+ return (rhs.hour == lhs.hour &&
+ rhs.minute == lhs.minute);
+}
+
+bool
+operator!=(const DsLogAdmin::Time24& rhs,
+ const DsLogAdmin::Time24& lhs)
+{
+ return !(lhs == rhs);
+}
+
+
+bool
+operator==(const DsLogAdmin::Time24Interval& rhs,
+ const DsLogAdmin::Time24Interval& lhs)
+{
+ return (rhs.start == lhs.start &&
+ rhs.stop == lhs.stop);
+}
+
+bool
+operator!=(const DsLogAdmin::Time24Interval& rhs,
+ const DsLogAdmin::Time24Interval& lhs)
+{
+ return !(lhs == rhs);
+}
+
+
+bool
+operator==(const DsLogAdmin::TimeInterval& rhs,
+ const DsLogAdmin::TimeInterval& lhs)
+{
+ return (rhs.start == lhs.start &&
+ rhs.stop == lhs.stop);
+}
+
+bool
+operator!=(const DsLogAdmin::TimeInterval& rhs,
+ const DsLogAdmin::TimeInterval& lhs)
+{
+ return !(lhs == rhs);
+}
+
+
+bool
+operator==(const DsLogAdmin::WeekMaskItem& rhs,
+ const DsLogAdmin::WeekMaskItem& lhs)
+{
+ return (rhs.days == lhs.days &&
+ rhs.intervals == lhs.intervals);
+}
+
+bool
+operator!=(const DsLogAdmin::WeekMaskItem& rhs,
+ const DsLogAdmin::WeekMaskItem& lhs)
+{
+ return !(lhs == rhs);
+}
+
+
+bool
+operator==(const DsLogAdmin::WeekMask& rhs,
+ const DsLogAdmin::WeekMask& lhs)
+{
+ const CORBA::ULong length = rhs.length ();
+
+ if (length != lhs.length ())
+ {
+ return false;
+ }
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ if (rhs[i] != lhs[i])
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool
+operator!=(const DsLogAdmin::WeekMask& rhs,
+ const DsLogAdmin::WeekMask& lhs)
+{
+ return !(lhs == rhs);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/Log_i.h b/TAO/orbsvcs/orbsvcs/Log/Log_i.h
new file mode 100644
index 00000000000..38d0ffa0e54
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/Log_i.h
@@ -0,0 +1,509 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Log_i.h
+ *
+ * $Id$
+ *
+ * Implementation of the DsLogAdmin::Log interface.
+ *
+ * @author Matthew Braun <mjb2@cs.wustl.edu>
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+
+#ifndef TAO_TLS_LOG_I_H
+#define TAO_TLS_LOG_I_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Log/LogRecordStore.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Log/Log_Compaction_Handler.h"
+#include "orbsvcs/Log/Log_Flush_Handler.h"
+#include "orbsvcs/Log/LogNotification.h"
+#include "orbsvcs/Log/LogRecordStore.h"
+#include "orbsvcs/DsLogAdminS.h"
+#include "ace/Reactor.h"
+#include "orbsvcs/Log/log_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_LogMgr_i;
+
+/**
+ * @class TAO_Log_i
+ *
+ * @brief Used to log events to a logging server
+ *
+ * This implementation attempts to conform to the telecom
+ * logging specification.
+ */
+class TAO_Log_Serv_Export TAO_Log_i : public virtual POA_DsLogAdmin::Log
+{
+
+public:
+
+ /// Constructor.
+ TAO_Log_i (CORBA::ORB_ptr orb,
+ TAO_LogMgr_i& logmgr_i,
+ DsLogAdmin::LogMgr_ptr factory,
+ DsLogAdmin::LogId id,
+ TAO_LogNotification *log_notifier);
+
+ /// Destructor.
+ ~TAO_Log_i ();
+
+ /// Initlialize the Log.
+ void init (ACE_ENV_SINGLE_ARG_DECL);
+
+ /**
+ * @name DsLogAdmin::Log Methods
+ *
+ * DsLogAdmin::Log methods.
+ */
+ //@{
+ /// Return the factory of the log.
+ DsLogAdmin::LogMgr_ptr my_factory (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the id of the log.
+ DsLogAdmin::LogId id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Get the list of the QoS properties supported by the log.
+ DsLogAdmin::QoSList*
+ get_log_qos (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Set the list of the QoS properties supported by the log.
+ void set_log_qos (const DsLogAdmin::QoSList & qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::UnsupportedQoS));
+
+ /// Get the record life in seconds (0 infinite).
+ CORBA::ULong
+ get_max_record_life (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Set the record life in seconds (0 infinite).
+ void
+ set_max_record_life (CORBA::ULong life
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Get the maximum size in octets.
+ CORBA::ULongLong
+ get_max_size (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Set the maximum size in octets.
+ void
+ set_max_size (CORBA::ULongLong size
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidParam));
+
+ /// Get the current size of the log in octets.
+ CORBA::ULongLong
+ get_current_size (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the number of records in the log.
+ CORBA::ULongLong
+ get_n_records (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Get the action to be taken when the log reaches its maximum size.
+ DsLogAdmin::LogFullActionType
+ get_log_full_action (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Set the action to be taken when the log reaches its maximum size.
+ void
+ set_log_full_action (DsLogAdmin::LogFullActionType action
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidLogFullAction));
+
+ /// Get the administrative state of the log.
+ DsLogAdmin::AdministrativeState
+ get_administrative_state (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Set the administrative state of the log.
+ void
+ set_administrative_state (DsLogAdmin::AdministrativeState state
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Get the forwarding state of the log.
+ /// @@ Note: is it ok to make this method virtual?
+ /// @@@ Of course! get_forwarding_state() is virtual in the base
+ /// class dictated by the IDL! -Ossama
+ virtual DsLogAdmin::ForwardingState
+ get_forwarding_state (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Set the forwarding state of the log.
+ /// @@ Note: is it ok to make this method virtual?
+ void
+ set_forwarding_state (DsLogAdmin::ForwardingState state
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Get the operational state of the log.
+ DsLogAdmin::OperationalState
+ get_operational_state (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Get the log duration
+ DsLogAdmin::TimeInterval
+ get_interval (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Set the log duration.
+ void
+ set_interval (const DsLogAdmin::TimeInterval & interval
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidTime,
+ DsLogAdmin::InvalidTimeInterval));
+
+ /// Get the availability status
+ DsLogAdmin::AvailabilityStatus
+ get_availability_status (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Get the capacity alarm threshold
+ DsLogAdmin::CapacityAlarmThresholdList*
+ get_capacity_alarm_thresholds (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * Set the capacity alarm threshold. Threshold values represent
+ * percentage levels at which the log should emit events to signal
+ * that a log full or log wrap condition is approaching. If the log
+ * is set to wrap, the thresholds are relative to the log size
+ * between wraps (after a wrap, the percentage full resets to
+ * 0).
+ */
+ void
+ set_capacity_alarm_thresholds
+ (const DsLogAdmin::CapacityAlarmThresholdList & threshs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidThreshold));
+
+ /// Get the weekly scheduling parameters
+ DsLogAdmin::WeekMask*
+ get_week_mask (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Set the weekly scheduling parameters.
+ void
+ set_week_mask (const DsLogAdmin::WeekMask & masks
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidTime,
+ DsLogAdmin::InvalidTimeInterval,
+ DsLogAdmin::InvalidMask));
+
+ /// Returns all records in the log that match the given constraint
+ /// <c>.
+ DsLogAdmin::RecordList*
+ query (const char * grammar,
+ const char * c,
+ DsLogAdmin::Iterator_out i
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint));
+
+ /// Retrieve <how_many> records from time <from_time> using iterator
+ /// <i>.
+ DsLogAdmin::RecordList*
+ retrieve (DsLogAdmin::TimeT from_time,
+ CORBA::Long how_many,
+ DsLogAdmin::Iterator_out i
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Returns the number of records matching constraint <c>.
+ CORBA::ULong
+ match (const char * grammar,
+ const char * c
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint));
+
+ /// Delete records matching constraint <c>.
+ CORBA::ULong
+ delete_records (const char * grammar,
+ const char * c
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint));
+
+ /// Delete records matching ids in <ids>
+ CORBA::ULong
+ delete_records_by_id (const DsLogAdmin::RecordIdList & ids
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+ /// Write records to the log storage.
+ void
+ write_records (const DsLogAdmin::Anys & records
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::LogFull,
+ DsLogAdmin::LogOffDuty,
+ DsLogAdmin::LogLocked,
+ DsLogAdmin::LogDisabled));
+
+ /// Write a list of record ids to storage. Raises DsLogAdmin::LogFull
+ /// and DsLogAdmin::LogLocked
+ void
+ write_recordlist (const DsLogAdmin::RecordList & list
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::LogFull,
+ DsLogAdmin::LogOffDuty,
+ DsLogAdmin::LogLocked,
+ DsLogAdmin::LogDisabled));
+
+ /// Set single record attributes.
+ void
+ set_record_attribute (DsLogAdmin::RecordId id,
+ const DsLogAdmin::NVList & attr_list
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidRecordId,
+ DsLogAdmin::InvalidAttribute));
+
+ /// Set the attributes of all records that matches the
+ /// constraints with same attr_list.
+ CORBA::ULong
+ set_records_attribute (const char * grammar,
+ const char * c,
+ const DsLogAdmin::NVList & attr_list
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidGrammar,
+ DsLogAdmin::InvalidConstraint,
+ DsLogAdmin::InvalidAttribute));
+
+ /// Get the attributes of the record with id <id>. Raises
+ /// DsLogAdmin::InvalidRecordId
+ DsLogAdmin::NVList*
+ get_record_attribute (DsLogAdmin::RecordId id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::InvalidRecordId));
+
+ /// Causes all pending events to be written to storage. Raises
+ /// DsLogAdmin::UnsupportedQos
+ void
+ flush (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ DsLogAdmin::UnsupportedQoS));
+ //@}
+
+ /// Remove records that have exceeded max_record_life_.
+ void remove_old_records (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+ /// Get the availability status
+ /// @note must be called with locks held
+ DsLogAdmin::AvailabilityStatus
+ get_availability_status_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Tells if the Log is scheduled to run now.
+ /// @note must be called with locks held
+ CORBA::Boolean scheduled (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Copy the attributes of the log being passed.
+ void copy_attributes (DsLogAdmin::Log_ptr log
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Check if threshold reached.
+ void check_capacity_alarm_threshold (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Reset capacity alarm threshold.
+ void reset_capacity_alarm_threshold (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Check that valid threshold values have been given.
+ static CORBA::Boolean validate_capacity_alarm_thresholds (
+ const DsLogAdmin::CapacityAlarmThresholdList & threshs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Reset Log QoS
+ void reset_log_qos (const DsLogAdmin::QoSList& qos
+ ACE_ENV_ARG_DECL);
+
+ /// Validate log QoS
+ void validate_log_qos (const DsLogAdmin::QoSList& qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((DsLogAdmin::UnsupportedQoS));
+
+ /// Reset Week Mask
+ ///
+ /// Used to initialize internal data structures that represent the
+ /// week mask list when the log service starts, and to reinitialize
+ /// them when they are changed.
+ ///
+ void reset_week_mask (const DsLogAdmin::WeekMask& masks
+ ACE_ENV_ARG_DECL);
+
+ /// Validate Week Mask
+ ///
+ /// Used to check whether week mask is valid. If not, throws an
+ /// InvalidTime, InvalidTimeInterval, or InvalidMask exception.
+ ///
+ void validate_week_mask (const DsLogAdmin::WeekMask& masks
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((DsLogAdmin::InvalidTime,
+ DsLogAdmin::InvalidTimeInterval,
+ DsLogAdmin::InvalidMask));
+
+protected:
+ /// Reference to the LogMgr servant
+ TAO_LogMgr_i& logmgr_i_;
+
+ /// The log's object reference
+ DsLogAdmin::Log_var log_;
+
+ /// The log's factory's object reference
+ DsLogAdmin::LogMgr_var factory_;
+
+ /// The log's id
+ DsLogAdmin::LogId logid_;
+
+ /// The log's operational state
+ DsLogAdmin::OperationalState op_state_;
+
+ /// The log's availability status
+ DsLogAdmin::AvailabilityStatus avail_status_;
+
+ /// The list of points at which the log should generate events
+ /// indicating approaching full capacity
+ DsLogAdmin::CapacityAlarmThresholdList thresholds_;
+
+ /// The next capacity alarm threshold.
+ CORBA::ULong current_threshold_;
+
+ /// A Sequence of the weekly intervals when the log is in operation.
+ DsLogAdmin::TimeIntervalSeq weekly_intervals_;
+
+ /// The QoS type of the log
+ DsLogAdmin::QoSType qostype_;
+
+ /// The reactor used for timing (startup and shutdown), etc
+ ACE_Reactor *reactor_;
+
+ /// The storage for all the records
+ TAO_LogRecordStore* recordstore_;
+
+ /// For sending Log Generated events.
+ TAO_LogNotification* notifier_;
+
+ /// Log Compaction Handler
+ TAO_Log_Compaction_Handler log_compaction_handler_;
+
+ /// Log Compaction Interval
+ static const ACE_Time_Value log_compaction_interval_;
+
+ /// Log Flush Handler
+ TAO_Log_Flush_Handler log_flush_handler_;
+
+ /// Log Flush Interval
+ static const ACE_Time_Value log_flush_interval_;
+};
+
+bool TAO_Log_Serv_Export
+operator==(const DsLogAdmin::CapacityAlarmThresholdList& rhs,
+ const DsLogAdmin::CapacityAlarmThresholdList& lhs);
+
+bool TAO_Log_Serv_Export
+operator!=(const DsLogAdmin::CapacityAlarmThresholdList& rhs,
+ const DsLogAdmin::CapacityAlarmThresholdList& lhs);
+
+bool TAO_Log_Serv_Export
+operator==(const DsLogAdmin::IntervalsOfDay& rhs,
+ const DsLogAdmin::IntervalsOfDay& lhs);
+
+bool TAO_Log_Serv_Export
+operator!=(const DsLogAdmin::IntervalsOfDay& rhs,
+ const DsLogAdmin::IntervalsOfDay& lhs);
+
+bool TAO_Log_Serv_Export
+operator==(const DsLogAdmin::QoSList& rhs,
+ const DsLogAdmin::QoSList& lhs);
+
+bool TAO_Log_Serv_Export
+operator!=(const DsLogAdmin::QoSList& rhs,
+ const DsLogAdmin::QoSList& lhs);
+
+bool TAO_Log_Serv_Export
+operator==(const DsLogAdmin::Time24& rhs,
+ const DsLogAdmin::Time24& lhs);
+
+bool TAO_Log_Serv_Export
+operator!=(const DsLogAdmin::Time24& rhs,
+ const DsLogAdmin::Time24& lhs);
+
+bool TAO_Log_Serv_Export
+operator==(const DsLogAdmin::Time24Interval& rhs,
+ const DsLogAdmin::Time24Interval& lhs);
+
+bool TAO_Log_Serv_Export
+operator!=(const DsLogAdmin::Time24Interval& rhs,
+ const DsLogAdmin::Time24Interval& lhs);
+
+bool TAO_Log_Serv_Export
+operator==(const DsLogAdmin::TimeInterval& rhs,
+ const DsLogAdmin::TimeInterval& lhs);
+
+bool TAO_Log_Serv_Export
+operator!=(const DsLogAdmin::TimeInterval& rhs,
+ const DsLogAdmin::TimeInterval& lhs);
+
+bool TAO_Log_Serv_Export
+operator==(const DsLogAdmin::WeekMaskItem& rhs,
+ const DsLogAdmin::WeekMaskItem& lhs);
+
+bool TAO_Log_Serv_Export
+operator!=(const DsLogAdmin::WeekMaskItem& rhs,
+ const DsLogAdmin::WeekMaskItem& lhs);
+
+bool TAO_Log_Serv_Export
+operator==(const DsLogAdmin::WeekMask& rhs,
+ const DsLogAdmin::WeekMask& lhs);
+
+bool TAO_Log_Serv_Export
+operator!=(const DsLogAdmin::WeekMask& rhs,
+ const DsLogAdmin::WeekMask& lhs);
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_TLS_LOG_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/NotifyLogConsumer.cpp b/TAO/orbsvcs/orbsvcs/Log/NotifyLogConsumer.cpp
new file mode 100644
index 00000000000..97f1a9803f1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/NotifyLogConsumer.cpp
@@ -0,0 +1,144 @@
+#include "orbsvcs/Log/NotifyLog_i.h"
+#include "orbsvcs/Log/LogMgr_i.h"
+#include "orbsvcs/Log/LogNotification.h"
+
+ACE_RCSID (Log,
+ NotifyLogConsumer,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_LogConsumer::TAO_Notify_LogConsumer (TAO_NotifyLog_i *log)
+: log_ (log)
+{
+}
+
+TAO_Notify_LogConsumer::~TAO_Notify_LogConsumer (void)
+{
+}
+
+void
+TAO_Notify_LogConsumer::connect (
+ CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+{
+ // Activate the consumer with the default_POA_
+ CosNotifyComm::PushConsumer_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier =
+ consumer_admin->obtain_notification_push_supplier (CosNotifyChannelAdmin::ANY_EVENT, proxy_supplier_id_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (proxysupplier.in ()));
+
+ // narrow
+ this->proxy_supplier_ =
+ CosNotifyChannelAdmin::ProxyPushSupplier::
+ _narrow (proxysupplier.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (proxy_supplier_.in ()));
+
+ proxy_supplier_->connect_any_push_consumer (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+}
+
+void
+TAO_Notify_LogConsumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->proxy_supplier_->
+ disconnect_push_supplier(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_LogConsumer::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
+TAO_Notify_LogConsumer::push
+ (const CORBA::Any& event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ // create a record list...
+ DsLogAdmin::RecordList recList (1);
+ recList.length (1);
+
+ recList [0].info = event;
+
+ // @@ The current revision of the specification (formal/03-07-01)
+ // states:
+ //
+ // * When a push operation is invoked and a log is full, then a
+ // NO_RESOURCE (sic) SystemException is raised with a LOGFULL
+ // minor code.
+ //
+ // * When a push operation is invoked on a log that is off-duty,
+ // then a NO_RESOURCE (sic) SystemException is raised with a
+ // LOGOFFDUTY minor code.
+ //
+ // * When a push operation is invoked on a log that is locked, then
+ // a NO_PERMISSIONS (sic) SystemException is raised with a LOGLOCKED
+ // minor code.
+ //
+ // * When a push operation is invoked on a log that is disabled,
+ // then a TRANSIENT SystemException is raised with a LOGDISABLED
+ // minor code.
+ //
+ // But neither the Telecom Logging or the CORBA specification define
+ // the values for these minor codes.
+ //
+ // I have submitted a defect report to the OMG for clarification.
+ // --jtc
+ ACE_TRY
+ {
+ // log the RecordList.
+ this->log_->write_recordlist (recList ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (DsLogAdmin::LogFull, ex)
+ {
+ ACE_THROW (CORBA::NO_RESOURCES ());
+ }
+ ACE_CATCH (DsLogAdmin::LogOffDuty, ex)
+ {
+ ACE_THROW (CORBA::NO_RESOURCES ());
+ }
+ ACE_CATCH (DsLogAdmin::LogLocked, ex)
+ {
+ ACE_THROW (CORBA::NO_PERMISSION ());
+ }
+ ACE_CATCH (DsLogAdmin::LogDisabled, ex)
+ {
+ ACE_THROW (CORBA::TRANSIENT ());
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_Notify_LogConsumer::disconnect_push_consumer
+ (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/NotifyLogConsumer.h b/TAO/orbsvcs/orbsvcs/Log/NotifyLogConsumer.h
new file mode 100644
index 00000000000..c464e91f8d4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/NotifyLogConsumer.h
@@ -0,0 +1,117 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file NotifyLogConsumer.h
+ *
+ * $Id$
+ *
+ * The NotifyLogConsumer connects to the NotifyLog and logs the events
+ * that are pushed to the NotifyLog.
+ *
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_NOTIFYLOGCONSUMER_H
+#define TAO_TLS_NOTIFYLOGCONSUMER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/DsLogAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/DsNotifyLogAdminS.h"
+#include "orbsvcs/Log/Log_i.h"
+
+#include "orbsvcs/Log/notifylog_serv_export.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_LogMgr_i;
+class TAO_NotifyLog_i;
+class TAO_NotifyLogFactory_i;
+
+/**
+ * @class TAO_Notify_LogConsumer
+ *
+ * @brief An implementation of the PushConsumer interface.
+ *
+ * Connects to the NotifyLog and writes LogRecords to the
+ * Log when events are 'pushed' to the NotifyLog which is an
+ * EventChannel.
+ */
+class TAO_Notify_LogConsumer :
+ public virtual POA_CosNotifyComm::PushConsumer
+{
+public:
+ // = Initialization and Termination methods.
+
+ /// Constructor.
+ TAO_Notify_LogConsumer (TAO_NotifyLog_i *log);
+
+ /// Connect to NotifyLog.
+ void connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin ACE_ENV_ARG_DECL);
+
+ /// Disconnect from NotifyLog.
+ virtual void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+protected:
+ /// Destructor.
+ virtual ~TAO_Notify_LogConsumer (void);
+
+ // = 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
+ ));
+
+ // = PushSupplier methods
+ virtual void push (
+ const CORBA::Any & event
+ 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
+ ));
+
+ /// ProxyPushSupplier used to connect to NotifyLog.
+ CosNotifyChannelAdmin::ProxyPushSupplier_var proxy_supplier_;
+
+ /// The ID of the proxySupplier.
+ CosNotifyChannelAdmin::ProxyID proxy_supplier_id_;
+
+ /// The NotifyLog that this consumer connects to
+ /// and whose events are to be logged.
+ TAO_NotifyLog_i *log_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TLS_NOTIFYLOGCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/NotifyLogFactory_i.cpp b/TAO/orbsvcs/orbsvcs/Log/NotifyLogFactory_i.cpp
new file mode 100644
index 00000000000..32af058cd1c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/NotifyLogFactory_i.cpp
@@ -0,0 +1,462 @@
+#include "orbsvcs/Log/NotifyLogFactory_i.h"
+#include "orbsvcs/Log/LogNotification.h"
+#include "orbsvcs/Log/NotifyLogNotification.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID (Log,
+ NotifyLogFactory_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_NotifyLogFactory_i::TAO_NotifyLogFactory_i (void)
+{
+}
+
+TAO_NotifyLogFactory_i::TAO_NotifyLogFactory_i (CosNotifyChannelAdmin::EventChannelFactory_ptr ecf)
+: notify_factory_ (ecf)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ CosNotifyChannelAdmin::ChannelID id;
+ CosNotifyChannelAdmin::AdminID adminID = 0;
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+
+ this->event_channel_ =
+ this->notify_factory_->create_channel (initial_qos,
+ initial_admin,
+ id
+ ACE_ENV_ARG_PARAMETER);
+
+ this->consumer_admin_ = this->event_channel_->new_for_consumers(CosNotifyChannelAdmin::OR_OP, adminID);
+
+ CosNotification::EventTypeSeq added(1);
+ CosNotification::EventTypeSeq removed (0);
+ added.length (1);
+ removed.length (0);
+
+ added[0].domain_name = CORBA::string_dup ("*");
+ added[0].type_name = CORBA::string_dup ("*");
+
+ this->consumer_admin_->subscription_change (added, removed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_NEW_THROW_EX (this->notifier_,
+ TAO_NotifyLogNotification(this->event_channel_.in ()),
+ CORBA::NO_MEMORY ());
+}
+
+TAO_NotifyLogFactory_i::~TAO_NotifyLogFactory_i()
+{
+ // No-Op.
+}
+
+DsNotifyLogAdmin::NotifyLogFactory_ptr
+TAO_NotifyLogFactory_i::activate (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ TAO_LogMgr_i::init (orb, poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsNotifyLogAdmin::NotifyLogFactory::_nil ());
+
+
+ PortableServer::ObjectId_var oid =
+ this->factory_poa_->activate_object (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsNotifyLogAdmin::NotifyLogFactory::_nil ());
+
+ CORBA::Object_var obj =
+ this->factory_poa_->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsNotifyLogAdmin::NotifyLogFactory::_nil ());
+
+ // narrow and store the result..
+ this->log_mgr_ =
+ DsLogAdmin::LogMgr::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsNotifyLogAdmin::NotifyLogFactory::_nil ());
+
+ DsNotifyLogAdmin::NotifyLogFactory_var v_return =
+ DsNotifyLogAdmin::NotifyLogFactory::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsNotifyLogAdmin::NotifyLogFactory::_nil ());
+
+ return v_return._retn ();
+}
+
+DsNotifyLogAdmin::NotifyLog_ptr
+TAO_NotifyLogFactory_i::create (
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList & thresholds,
+ const CosNotification::QoSProperties & initial_qos,
+ const CosNotification::AdminProperties & initial_admin,
+ DsLogAdmin::LogId_out id_out
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold,
+ CosNotification::UnsupportedQoS,
+ CosNotification::UnsupportedAdmin
+ ))
+{
+ ACE_UNUSED_ARG (initial_qos);
+ ACE_UNUSED_ARG (initial_admin);
+
+ this->create_i (full_action,
+ max_size,
+ & thresholds,
+ id_out
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsNotifyLogAdmin::NotifyLog::_nil ());
+ DsLogAdmin::LogId id = id_out;
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+ DsLogAdmin::Log_var log =
+ this->create_log_reference (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsNotifyLogAdmin::NotifyLog::_nil ());
+#else
+ DsLogAdmin::Log_var log =
+ this->create_log_object (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsNotifyLogAdmin::NotifyLog::_nil ());
+#endif
+
+ // narrow to NotifyLog
+ DsNotifyLogAdmin::NotifyLog_var notify_log =
+ DsNotifyLogAdmin::NotifyLog::_narrow (log.in ());
+
+ // @@ JTC - squelch exception?
+ notifier_->object_creation (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsNotifyLogAdmin::NotifyLog::_nil ());
+
+ return notify_log._retn ();
+}
+
+DsNotifyLogAdmin::NotifyLog_ptr
+TAO_NotifyLogFactory_i::create_with_id (
+ DsLogAdmin::LogId id,
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList & thresholds,
+ const CosNotification::QoSProperties & initial_qos,
+ const CosNotification::AdminProperties & initial_admin
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ DsLogAdmin::LogIdAlreadyExists,
+ DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold,
+ CosNotification::UnsupportedQoS,
+ CosNotification::UnsupportedAdmin
+ ))
+{
+ ACE_UNUSED_ARG (initial_qos);
+ ACE_UNUSED_ARG (initial_admin);
+
+ this->create_with_id_i (id,
+ full_action,
+ max_size,
+ & thresholds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsNotifyLogAdmin::NotifyLog::_nil ());
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+ DsLogAdmin::Log_var log =
+ this->create_log_reference (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsNotifyLogAdmin::NotifyLog::_nil ());
+#else
+ DsLogAdmin::Log_var log =
+ this->create_log_object (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsNotifyLogAdmin::NotifyLog::_nil ());
+#endif
+
+ // narrow to NotifyLog
+ DsNotifyLogAdmin::NotifyLog_var notify_log =
+ DsNotifyLogAdmin::NotifyLog::_narrow (log.in ());
+
+ // @@ JTC - squelch exception?
+ notifier_->object_creation (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsNotifyLogAdmin::NotifyLog::_nil ());
+
+ return notify_log._retn();
+}
+
+CORBA::RepositoryId
+TAO_NotifyLogFactory_i::create_repositoryid ()
+{
+ return CORBA::string_dup("IDL:omg.org/DsNotifyLogAdmin:NotifyLog:1.0");
+}
+
+PortableServer::ServantBase*
+TAO_NotifyLogFactory_i::create_log_servant (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+{
+ TAO_NotifyLog_i* notify_log_i;
+
+ ACE_NEW_THROW_EX (notify_log_i,
+ TAO_NotifyLog_i (this->orb_.in (),
+ this->log_poa_.in (),
+ *this,
+ this->log_mgr_.in (),
+ this->notify_factory_.in (),
+ this->notifier_,
+ id
+ ),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ notify_log_i->init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ //initialise the LogConsumer object
+ notify_log_i->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return notify_log_i;
+}
+
+CosNotifyChannelAdmin::AdminID
+TAO_NotifyLogFactory_i::MyID (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return consumer_admin_->MyID (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::EventChannel_ptr
+TAO_NotifyLogFactory_i::MyChannel (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT(), 0);
+}
+
+CosNotifyChannelAdmin::InterFilterGroupOperator
+TAO_NotifyLogFactory_i::MyOperator (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return consumer_admin_->MyOperator (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNotifyFilter::MappingFilter_ptr
+TAO_NotifyLogFactory_i::priority_filter (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return consumer_admin_->priority_filter (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_NotifyLogFactory_i::priority_filter (CosNotifyFilter::MappingFilter_ptr filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ consumer_admin_->priority_filter(filter ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyFilter::MappingFilter_ptr
+TAO_NotifyLogFactory_i::lifetime_filter (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return consumer_admin_->lifetime_filter (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_NotifyLogFactory_i::lifetime_filter (CosNotifyFilter::MappingFilter_ptr filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ consumer_admin_->lifetime_filter (filter ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::ProxyIDSeq*
+TAO_NotifyLogFactory_i::pull_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return consumer_admin_->pull_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::ProxyIDSeq*
+TAO_NotifyLogFactory_i::push_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return consumer_admin_->push_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::ProxySupplier_ptr
+TAO_NotifyLogFactory_i::get_proxy_supplier (
+ CosNotifyChannelAdmin::ProxyID proxy_id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotifyChannelAdmin::ProxyNotFound,
+ CORBA::SystemException
+ ))
+{
+ return consumer_admin_->get_proxy_supplier (proxy_id ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::ProxySupplier_ptr
+TAO_NotifyLogFactory_i::obtain_notification_pull_supplier (
+ CosNotifyChannelAdmin::ClientType ctype,
+ CosNotifyChannelAdmin::ProxyID& proxy_id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotifyChannelAdmin::AdminLimitExceeded,
+ CORBA::SystemException
+ ))
+{
+ return consumer_admin_->obtain_notification_pull_supplier (ctype, proxy_id ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::ProxySupplier_ptr
+TAO_NotifyLogFactory_i::obtain_notification_push_supplier (
+ CosNotifyChannelAdmin::ClientType ctype,
+ CosNotifyChannelAdmin::ProxyID& proxy_id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotifyChannelAdmin::AdminLimitExceeded,
+ CORBA::SystemException
+ ))
+{
+ return consumer_admin_->obtain_notification_push_supplier (ctype, proxy_id ACE_ENV_ARG_PARAMETER);
+}
+
+CosEventChannelAdmin::ProxyPushSupplier_ptr
+TAO_NotifyLogFactory_i::obtain_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return consumer_admin_->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+
+
+CosEventChannelAdmin::ProxyPullSupplier_ptr
+TAO_NotifyLogFactory_i::obtain_pull_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+
+{
+ return consumer_admin_->obtain_pull_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_NotifyLogFactory_i::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ // No-Op.
+}
+
+//CosNotifyComm::NotifySubscribe
+void
+TAO_NotifyLogFactory_i::subscription_change (const CosNotification::EventTypeSeq& added,
+ const CosNotification::EventTypeSeq& removed
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotifyComm::InvalidEventType,
+ CORBA::SystemException
+ ))
+{
+ consumer_admin_->subscription_change (added, removed ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotification::QoSProperties*
+TAO_NotifyLogFactory_i::get_qos (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return consumer_admin_->get_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_NotifyLogFactory_i::set_qos (const CosNotification::QoSProperties& qos ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotification::UnsupportedQoS,
+ CORBA::SystemException
+ ))
+{
+ consumer_admin_->set_qos (qos ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_NotifyLogFactory_i::validate_qos (const CosNotification::QoSProperties& required_qos,
+ CosNotification::NamedPropertyRangeSeq_out available_qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotification::UnsupportedQoS,
+ CORBA::SystemException
+ ))
+{
+ consumer_admin_->validate_qos (required_qos, available_qos ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyFilter::FilterID
+TAO_NotifyLogFactory_i::add_filter (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return consumer_admin_->add_filter (filter ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_NotifyLogFactory_i::remove_filter (CosNotifyFilter::FilterID id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ consumer_admin_->remove_filter (id ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyFilter::Filter_ptr
+TAO_NotifyLogFactory_i::get_filter (CosNotifyFilter::FilterID id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotifyFilter::FilterNotFound,
+ CORBA::SystemException
+ ))
+{
+ return consumer_admin_->get_filter (id ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyFilter::FilterIDSeq*
+TAO_NotifyLogFactory_i::get_all_filters (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return consumer_admin_->get_all_filters (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_NotifyLogFactory_i::remove_all_filters (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ consumer_admin_->remove_all_filters (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/NotifyLogFactory_i.h b/TAO/orbsvcs/orbsvcs/Log/NotifyLogFactory_i.h
new file mode 100644
index 00000000000..bbe8127c077
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/NotifyLogFactory_i.h
@@ -0,0 +1,281 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file NotifyLogFactory_i.h
+ *
+ * $Id$
+ *
+ * Implements the Factory for NotifyLog Objects.
+ *
+ *
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_NOTIFYLOGFACTORY_I_H
+#define TAO_TLS_NOTIFYLOGFACTORY_I_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/DsNotifyLogAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/DsLogAdminS.h"
+#include "orbsvcs/Log/LogMgr_i.h"
+#include "orbsvcs/Log/NotifyLog_i.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_NotifyLog_i;
+class TAO_NotifyLogNotification;
+
+/**
+ * @class TAO_NotifyLogFactory_i
+ *
+ * @brief The NotifyLogFactory is a factory that is used to create NotifyLogs which are event-aware.
+ */
+class TAO_NotifyLog_Serv_Export TAO_NotifyLogFactory_i :
+ public POA_DsNotifyLogAdmin::NotifyLogFactory,
+ public TAO_LogMgr_i
+{
+public:
+ //= Initialization and termination code.
+
+ /// Constructor - default.
+ TAO_NotifyLogFactory_i (void);
+
+ /// Constructor.
+ TAO_NotifyLogFactory_i (CosNotifyChannelAdmin::EventChannelFactory_ptr ecf);
+
+ /// Destructor.
+ ~TAO_NotifyLogFactory_i ();
+
+ /// Activate this servant with the ORB and POA passed in.
+ DsNotifyLogAdmin::NotifyLogFactory_ptr
+ activate (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL);
+
+ /// Used to create an NotifyLog.
+ DsNotifyLogAdmin::NotifyLog_ptr create (
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList & thresholds,
+ const CosNotification::QoSProperties & initial_qos,
+ const CosNotification::AdminProperties & initial_admin,
+ DsLogAdmin::LogId_out id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold,
+ CosNotification::UnsupportedQoS,
+ CosNotification::UnsupportedAdmin
+ ));
+
+ /// Same as create (), but allows clients to specify the id.
+ DsNotifyLogAdmin::NotifyLog_ptr create_with_id (
+ DsLogAdmin::LogId id,
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList & thresholds,
+ const CosNotification::QoSProperties & initial_qos,
+ const CosNotification::AdminProperties & initial_admin
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ DsLogAdmin::LogIdAlreadyExists,
+ DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold,
+ CosNotification::UnsupportedQoS,
+ CosNotification::UnsupportedAdmin
+ ));
+
+
+ // = Methods from CosNotifyChannelAdmin::ConsumerAdmin.
+ CosNotifyChannelAdmin::AdminID MyID (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosNotifyChannelAdmin::EventChannel_ptr MyChannel (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosNotifyChannelAdmin::InterFilterGroupOperator MyOperator (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosNotifyFilter::MappingFilter_ptr priority_filter (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+ void priority_filter (CosNotifyFilter::MappingFilter_ptr ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosNotifyFilter::MappingFilter_ptr lifetime_filter (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+ void lifetime_filter (CosNotifyFilter::MappingFilter_ptr ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosNotifyChannelAdmin::ProxyIDSeq* pull_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+ CosNotifyChannelAdmin::ProxyIDSeq* push_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosNotifyChannelAdmin::ProxySupplier_ptr get_proxy_supplier (
+ CosNotifyChannelAdmin::ProxyID proxy_id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotifyChannelAdmin::ProxyNotFound,
+ CORBA::SystemException
+ ));
+
+ CosNotifyChannelAdmin::ProxySupplier_ptr obtain_notification_pull_supplier (
+ CosNotifyChannelAdmin::ClientType ctype,
+ CosNotifyChannelAdmin::ProxyID& proxy_id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotifyChannelAdmin::AdminLimitExceeded,
+ CORBA::SystemException
+ ));
+
+ CosNotifyChannelAdmin::ProxySupplier_ptr obtain_notification_push_supplier (
+ CosNotifyChannelAdmin::ClientType ctype,
+ CosNotifyChannelAdmin::ProxyID& id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotifyChannelAdmin::AdminLimitExceeded,
+ CORBA::SystemException
+ ));
+
+ CosEventChannelAdmin::ProxyPushSupplier_ptr obtain_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosEventChannelAdmin::ProxyPullSupplier_ptr obtain_pull_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// CosNotifyComm::NotifySubscribe.
+ void subscription_change (const CosNotification::EventTypeSeq& added,
+ const CosNotification::EventTypeSeq& removed
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotifyComm::InvalidEventType,
+ CORBA::SystemException
+ ));
+
+ /// CosNotification::QoSAdmin.
+ CosNotification::QoSProperties* get_qos (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+ void set_qos (const CosNotification::QoSProperties& ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotification::UnsupportedQoS,
+ CORBA::SystemException
+ ));
+ void validate_qos (const CosNotification::QoSProperties&,
+ CosNotification::NamedPropertyRangeSeq_out
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotification::UnsupportedQoS,
+ CORBA::SystemException
+ ));
+
+ /// CosNotifyFilter::FilterAdmin.
+ CosNotifyFilter::FilterID add_filter (CosNotifyFilter::Filter_ptr ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+ void remove_filter (CosNotifyFilter::FilterID ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+ CosNotifyFilter::Filter_ptr get_filter (CosNotifyFilter::FilterID ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotifyFilter::FilterNotFound,
+ CORBA::SystemException
+ ));
+ CosNotifyFilter::FilterIDSeq* get_all_filters (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+ void remove_all_filters (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+protected:
+ virtual CORBA::RepositoryId
+ create_repositoryid ();
+
+ virtual PortableServer::ServantBase*
+ create_log_servant (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL);
+
+ /// Our object ref. after <active>ation.
+ DsLogAdmin::LogMgr_var log_mgr_;
+
+ /// The Channel ID.
+ CosNotifyChannelAdmin::ChannelID channel_id_;
+
+ /// The EventChannel the factory uses to enable the
+ /// NotifyLogNotification object to connect to and send
+ /// log-generated events.
+ CosNotifyChannelAdmin::EventChannel_var event_channel_;
+
+ /// The ConsumerAdmin that the NotifyLogFactory supports.
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
+
+ //CosEventChannelAdmin::EventChannel_var es_event_channel_;
+
+ //CosEventChannelAdmin::ConsumerAdmin_var es_consumer_admin_;
+
+ /// Used for log-generated events.
+ TAO_NotifyLogNotification* notifier_;
+
+ /// The EventChannelFactory used to create an EventChannel.
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TLS_NOTIFYLOGFACTORY_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/NotifyLogNotification.cpp b/TAO/orbsvcs/orbsvcs/Log/NotifyLogNotification.cpp
new file mode 100644
index 00000000000..1a3762a4d51
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/NotifyLogNotification.cpp
@@ -0,0 +1,88 @@
+#include "orbsvcs/Log/LogNotification.h"
+#include "orbsvcs/Log/NotifyLogNotification.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "tao/debug.h"
+
+ACE_RCSID (Log,
+ NotifyLogNotification,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_NotifyLogNotification::TAO_NotifyLogNotification (
+ CosNotifyChannelAdmin::EventChannel_ptr ec)
+ : TAO_LogNotification (),
+ event_channel_ (CosNotifyChannelAdmin::EventChannel::_duplicate (ec))
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ CosNotifyComm::PushSupplier_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_ASSERT (!CORBA::is_nil (objref.in ()));
+
+ CosNotifyChannelAdmin::AdminID adminID;
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin =
+ this->event_channel_->new_for_suppliers (CosNotifyChannelAdmin::OR_OP, adminID);
+
+ ACE_ASSERT (!CORBA::is_nil (supplier_admin.in ()));
+
+ CosNotifyChannelAdmin::ProxyConsumer_var proxyconsumer =
+ supplier_admin->obtain_notification_push_consumer (CosNotifyChannelAdmin::ANY_EVENT, proxy_consumer_id_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (proxyconsumer.in ()));
+
+ // narrow
+ this->proxy_consumer_ =
+ CosNotifyChannelAdmin::ProxyPushConsumer::_narrow (proxyconsumer.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (this->proxy_consumer_.in ()));
+
+ proxy_consumer_->connect_any_push_supplier (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_NotifyLogNotification::~TAO_NotifyLogNotification (void)
+{
+ // No-Op.
+}
+
+void
+TAO_NotifyLogNotification::send_notification (const CORBA::Any& any)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ this->proxy_consumer_->push (any);
+}
+
+void
+TAO_NotifyLogNotification::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
+TAO_NotifyLogNotification::disconnect_push_supplier
+ (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_ASSERT (!CORBA::is_nil (this->proxy_consumer_.in ()));
+
+ this->proxy_consumer_->disconnect_push_consumer(ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/NotifyLogNotification.h b/TAO/orbsvcs/orbsvcs/Log/NotifyLogNotification.h
new file mode 100644
index 00000000000..00e86066473
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/NotifyLogNotification.h
@@ -0,0 +1,108 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file NotifyLogNotification.h
+ *
+ * $Id$
+ *
+ * Methods to enable log-generated events.
+ *
+ * @author D A Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_NOTIFY_LOG_NOTIFICATION_H
+#define TAO_TLS_NOTIFY_LOG_NOTIFICATION_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/DsNotifyLogAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosEventCommS.h"
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+
+#include "orbsvcs/Log/notifylog_serv_export.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_NotifyLogNotification
+ *
+ * @brief Used to forward log generated events to a logging server.
+ */
+class TAO_NotifyLog_Serv_Export TAO_NotifyLogNotification :
+ public TAO_LogNotification,
+ public POA_CosNotifyComm::PushSupplier
+{
+public:
+ // = Initialization and Termination methods.
+
+ /// Constructor.
+ TAO_NotifyLogNotification (CosNotifyChannelAdmin::EventChannel_ptr);
+
+ /// Destructor.
+ ~TAO_NotifyLogNotification (void);
+
+protected:
+ // = Helper methods
+ // = Data members
+
+ /// The proxy that we are connected to.
+ CosNotifyChannelAdmin::ProxyPushConsumer_var proxy_consumer_;
+
+ /// This supplier's id.
+ CosNotifyChannelAdmin::ProxyID proxy_consumer_id_;
+
+ // = NotifySubscribe
+ 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_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// Send the event on the event channel.
+ virtual void send_notification (const CORBA::Any& any)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+private:
+ /// A reference to the ORB.
+ CORBA::ORB_var orb_;
+
+ /// A pointer to the EventChannel that events are to be sent to.
+ /// This channel is contained in the NotifyLogFactory.
+ CosNotifyChannelAdmin::EventChannel_var event_channel_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TLS_NOTIFY_LOG_NOTIFICATION_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/NotifyLog_i.cpp b/TAO/orbsvcs/orbsvcs/Log/NotifyLog_i.cpp
new file mode 100644
index 00000000000..db13c800447
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/NotifyLog_i.cpp
@@ -0,0 +1,371 @@
+#include "orbsvcs/Log/NotifyLog_i.h"
+#include "orbsvcs/Log/LogMgr_i.h"
+#include "orbsvcs/Log/LogNotification.h"
+
+ACE_RCSID (Log,
+ NotifyLog_i,
+ "$Id$")
+
+#define CA_FILTER "threshold > 10"
+#define TCL_GRAMMAR "TCL"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_NotifyLog_i::TAO_NotifyLog_i (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ TAO_LogMgr_i &logmgr_i,
+ DsLogAdmin::LogMgr_ptr factory,
+ CosNotifyChannelAdmin::EventChannelFactory_ptr ecf,
+ TAO_LogNotification *log_notifier,
+ DsLogAdmin::LogId id)
+ : TAO_Log_i (orb, logmgr_i, factory, id, log_notifier),
+ notify_factory_ (CosNotifyChannelAdmin::EventChannelFactory::_duplicate (ecf)),
+ poa_ (PortableServer::POA::_duplicate (poa))
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ CosNotifyChannelAdmin::ChannelID channel_id;
+
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+
+
+ ACE_ASSERT (!CORBA::is_nil (this->notify_factory_.in ()));
+
+ this->event_channel_ =
+ this->notify_factory_->create_channel (initial_qos,
+ initial_admin,
+ channel_id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_NotifyLog_i::~TAO_NotifyLog_i ()
+{
+ this->event_channel_->destroy ();
+}
+
+DsLogAdmin::Log_ptr
+TAO_NotifyLog_i::copy (DsLogAdmin::LogId &id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ DsNotifyLogAdmin::NotifyLogFactory_var notifyLogFactory =
+ DsNotifyLogAdmin::NotifyLogFactory::_narrow (factory_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ CosNotification::QoSProperties* qos = get_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ CosNotification::AdminProperties* admin = get_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ DsNotifyLogAdmin::NotifyLog_var log =
+ notifyLogFactory->create (DsLogAdmin::halt, 0, thresholds_, static_cast<const CosNotification::QoSProperties> (*qos),
+ static_cast<const CosNotification::AdminProperties> (*admin), id);
+
+ this->copy_attributes (log.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ return log._retn ();
+}
+
+DsLogAdmin::Log_ptr
+TAO_NotifyLog_i::copy_with_id (DsLogAdmin::LogId id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ DsNotifyLogAdmin::NotifyLogFactory_var notifyLogFactory =
+ DsNotifyLogAdmin::NotifyLogFactory::_narrow (factory_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ CosNotification::QoSProperties* qos = get_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ CosNotification::AdminProperties* admin = get_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ DsNotifyLogAdmin::NotifyLog_var log =
+ notifyLogFactory->create_with_id (id, DsLogAdmin::halt, 0, thresholds_, static_cast<const CosNotification::QoSProperties> (*qos),
+ static_cast<const CosNotification::AdminProperties> (*admin));
+
+ this->copy_attributes (log.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ return log._retn ();
+}
+
+
+void
+TAO_NotifyLog_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ notifier_->object_deletion (logid_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Remove ourselves from the list of logs.
+ this->logmgr_i_.remove (this->logid_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Deregister with POA.
+ PortableServer::ObjectId_var id =
+ this->poa_->servant_to_id (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->poa_->deactivate_object (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_NotifyLog_i::activate (ACE_ENV_SINGLE_ARG_DECL)
+{
+
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+
+ this->consumer_admin_ =
+ this->event_channel_->new_for_consumers (ifgop, adminid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (consumer_admin_.in ()));
+
+ CosNotifyFilter::FilterFactory_var ffact =
+ this->event_channel_->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // setup a filter at the consumer admin
+ CosNotifyFilter::Filter_var ca_filter =
+ ffact->create_filter (TCL_GRAMMAR ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (ca_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 (CA_FILTER);
+
+ ca_filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer_admin_->add_filter (ca_filter.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Setup the CA to receive all type of events
+ CosNotification::EventTypeSeq added(1);
+ CosNotification::EventTypeSeq removed (0);
+ added.length (1);
+ removed.length (0);
+
+ added[0].domain_name = CORBA::string_dup ("*");
+ added[0].type_name = CORBA::string_dup ("*");
+
+ this->consumer_admin_->subscription_change (added, removed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_NEW_THROW_EX (this->my_log_consumer_,
+ TAO_Notify_LogConsumer (this),
+ CORBA::NO_MEMORY ());
+
+ this->my_log_consumer_->connect (this->consumer_admin_.in () ACE_ENV_ARG_PARAMETER);
+}
+
+//IDL to C++
+CosNotifyFilter::Filter_ptr
+TAO_NotifyLog_i::get_filter (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ //TODO: need to add impl
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+void
+TAO_NotifyLog_i::set_filter (CosNotifyFilter::Filter_ptr /* filter */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+
+ //TODO: need to add impl
+}
+
+CosNotifyChannelAdmin::EventChannelFactory_ptr
+TAO_NotifyLog_i::MyFactory (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ //TODO: need to add impl
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+CosNotifyChannelAdmin::ConsumerAdmin_ptr
+TAO_NotifyLog_i::default_consumer_admin (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->event_channel_->default_consumer_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::SupplierAdmin_ptr
+TAO_NotifyLog_i::default_supplier_admin (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->event_channel_->default_supplier_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNotifyFilter::FilterFactory_ptr
+TAO_NotifyLog_i::default_filter_factory (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->event_channel_->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::ConsumerAdmin_ptr
+TAO_NotifyLog_i::new_for_consumers (CosNotifyChannelAdmin::InterFilterGroupOperator op,
+ CosNotifyChannelAdmin::AdminID& id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->event_channel_->new_for_consumers (op,id ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::SupplierAdmin_ptr
+TAO_NotifyLog_i::new_for_suppliers (CosNotifyChannelAdmin::InterFilterGroupOperator op,
+ CosNotifyChannelAdmin::AdminID& id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->event_channel_->new_for_suppliers (op,id ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::ConsumerAdmin_ptr
+TAO_NotifyLog_i::get_consumeradmin (CosNotifyChannelAdmin::AdminID id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotifyChannelAdmin::AdminNotFound,
+ CORBA::SystemException
+ ))
+{
+ return this->event_channel_->get_consumeradmin (id ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::SupplierAdmin_ptr
+TAO_NotifyLog_i::get_supplieradmin (CosNotifyChannelAdmin::AdminID id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotifyChannelAdmin::AdminNotFound,
+ CORBA::SystemException
+ ))
+{
+ return this->event_channel_->get_supplieradmin (id ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::AdminIDSeq*
+TAO_NotifyLog_i::get_all_consumeradmins (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->event_channel_->get_all_consumeradmins (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::AdminIDSeq*
+TAO_NotifyLog_i::get_all_supplieradmins (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->event_channel_->get_all_supplieradmins (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNotification::AdminProperties*
+TAO_NotifyLog_i::get_admin (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->event_channel_->get_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_NotifyLog_i::set_admin (const CosNotification::AdminProperties& admin ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotification::UnsupportedAdmin,
+ CORBA::SystemException
+ ))
+{
+ this->event_channel_->set_admin (admin ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotification::QoSProperties*
+TAO_NotifyLog_i::get_qos (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ //need to add merging of QoS from Log_i and EventChannel_i
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+void
+TAO_NotifyLog_i::set_qos (const CosNotification::QoSProperties& /* qos */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotification::UnsupportedQoS,
+ CORBA::SystemException
+ ))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+ //TODO: need to add later
+}
+
+void
+TAO_NotifyLog_i::validate_qos (
+ const CosNotification::QoSProperties& /* required_qos */,
+ CosNotification::NamedPropertyRangeSeq_out /* available_qos */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosNotification::UnsupportedQoS,
+ CORBA::SystemException))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+
+ //TODO: need to add later
+}
+
+CosEventChannelAdmin::ConsumerAdmin_ptr
+TAO_NotifyLog_i::for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->event_channel_->for_consumers(ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosEventChannelAdmin::SupplierAdmin_ptr
+TAO_NotifyLog_i::for_suppliers (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->event_channel_->for_suppliers(ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/NotifyLog_i.h b/TAO/orbsvcs/orbsvcs/Log/NotifyLog_i.h
new file mode 100644
index 00000000000..81218cf3962
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/NotifyLog_i.h
@@ -0,0 +1,240 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file NotifyLog_i.h
+ *
+ * $Id$
+ *
+ * Implementation of the DsNotifyLogAdmin::NotifyLog interface.
+ * File also conatins TAO_Notify_LogConsumer which is used
+ * to write events to the Log.
+ *
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_NOTIFYLOG_I_H
+#define TAO_TLS_NOTIFYLOG_I_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/DsLogAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/DsNotifyLogAdminS.h"
+#include "orbsvcs/Log/Log_i.h"
+#include "orbsvcs/Log/NotifyLogConsumer.h"
+
+#include "orbsvcs/Log/notifylog_serv_export.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_LogMgr_i;
+class TAO_NotifyLog_i;
+class TAO_NotifyLogFactory_i;
+
+/**
+ * @class TAO_NotifyLog_i
+ *
+ * @brief The NotifyLog is an EventChannel and a Log.
+ *
+ * It is used to log events that pass through the EventChannel.
+ * The class supports the @c destroy> method to destroy the Log.
+ */
+class TAO_NotifyLog_Serv_Export TAO_NotifyLog_i :
+ public TAO_Log_i,
+ public POA_DsNotifyLogAdmin::NotifyLog
+{
+public:
+ // = Initialization and Termination.
+
+ /// Constructor.
+ TAO_NotifyLog_i (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ TAO_LogMgr_i &logmgr_i,
+ DsLogAdmin::LogMgr_ptr factory,
+ CosNotifyChannelAdmin::EventChannelFactory_ptr ecf,
+ TAO_LogNotification *log_notifier,
+ DsLogAdmin::LogId id);
+
+ /// Destructor.
+ ~TAO_NotifyLog_i ();
+
+ /// Duplicate the log.
+ virtual DsLogAdmin::Log_ptr copy (DsLogAdmin::LogId &id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// Duplicate the log specifying an id.
+ virtual DsLogAdmin::Log_ptr copy_with_id (DsLogAdmin::LogId id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// Destroy the log object and all contained records.
+ void
+ destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Activate the NotifyLog.
+ void
+ activate (ACE_ENV_SINGLE_ARG_DECL);
+
+ // = Methods from CosNotifyChannelAdmin::EventChannel.
+ CosNotifyFilter::Filter_ptr
+ get_filter (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ void set_filter (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosNotifyChannelAdmin::EventChannelFactory_ptr
+ MyFactory (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosNotifyChannelAdmin::ConsumerAdmin_ptr
+ default_consumer_admin (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosNotifyChannelAdmin::SupplierAdmin_ptr
+ default_supplier_admin (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosNotifyFilter::FilterFactory_ptr
+ default_filter_factory (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosNotifyChannelAdmin::ConsumerAdmin_ptr
+ new_for_consumers (CosNotifyChannelAdmin::InterFilterGroupOperator op,
+ CosNotifyChannelAdmin::AdminID& id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosNotifyChannelAdmin::SupplierAdmin_ptr
+ new_for_suppliers (CosNotifyChannelAdmin::InterFilterGroupOperator op,
+ CosNotifyChannelAdmin::AdminID& id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosNotifyChannelAdmin::ConsumerAdmin_ptr
+ get_consumeradmin (CosNotifyChannelAdmin::AdminID id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotifyChannelAdmin::AdminNotFound,
+ CORBA::SystemException
+ ));
+
+ CosNotifyChannelAdmin::SupplierAdmin_ptr
+ get_supplieradmin (CosNotifyChannelAdmin::AdminID id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotifyChannelAdmin::AdminNotFound,
+ CORBA::SystemException
+ ));
+
+ CosNotifyChannelAdmin::AdminIDSeq*
+ get_all_consumeradmins (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosNotifyChannelAdmin::AdminIDSeq*
+ get_all_supplieradmins (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosNotification::AdminProperties*
+ get_admin (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ void set_admin (const CosNotification::AdminProperties& admin ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotification::UnsupportedAdmin,
+ CORBA::SystemException
+ ));
+
+ CosNotification::QoSProperties*
+ get_qos (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ void set_qos (const CosNotification::QoSProperties& ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotification::UnsupportedQoS,
+ CORBA::SystemException
+ ));
+
+ void validate_qos (const CosNotification::QoSProperties&,
+ CosNotification::NamedPropertyRangeSeq_out ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CosNotification::UnsupportedQoS,
+ CORBA::SystemException
+ ));
+
+ // = Methods from DsEventLogAdmin::EventLog.
+ CosEventChannelAdmin::ConsumerAdmin_ptr
+ for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ CosEventChannelAdmin::SupplierAdmin_ptr
+ for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+private:
+ /// The PushConsumer that consumes the events and stores them
+ /// in the log.
+ TAO_Notify_LogConsumer *my_log_consumer_;
+
+ /// The Event Channel that the log uses.
+ CosNotifyChannelAdmin::EventChannel_var event_channel_;
+
+ /// The Event Channel ID that the log uses.
+ CosNotifyChannelAdmin::ChannelID channelID_;
+
+ /// The EventChannelFactory used to create the EventChannel above.
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory_;
+
+ /// The ConsumerAdmin that the log uses.
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
+
+ PortableServer::POA_var poa_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TLS_NOTIFYLOG_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/RTEventLogConsumer.cpp b/TAO/orbsvcs/orbsvcs/Log/RTEventLogConsumer.cpp
new file mode 100644
index 00000000000..08a2cfd036e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/RTEventLogConsumer.cpp
@@ -0,0 +1,68 @@
+#include "orbsvcs/Log/RTEventLog_i.h"
+#include "orbsvcs/Log/LogMgr_i.h"
+#include "orbsvcs/Log/LogNotification.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "orbsvcs/Event/EC_Dispatching.h"
+#include "orbsvcs/Event/EC_ConsumerAdmin.h"
+#include "orbsvcs/Event/EC_SupplierAdmin.h"
+#include "orbsvcs/Event/EC_Timeout_Generator.h"
+#include "orbsvcs/Event/EC_ObserverStrategy.h"
+#include "orbsvcs/Event/EC_ConsumerControl.h"
+#include "orbsvcs/Event/EC_SupplierControl.h"
+#include "ace/Dynamic_Service.h"
+
+ACE_RCSID (Log,
+ RTEventLogConsumer,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Rtec_LogConsumer::TAO_Rtec_LogConsumer (TAO_RTEventLog_i *log)
+ : log_ (log)
+{
+}
+
+TAO_Rtec_LogConsumer::~TAO_Rtec_LogConsumer (void)
+{
+}
+
+void
+TAO_Rtec_LogConsumer::connect (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin)
+{
+ RtecEventComm::PushConsumer_var myself = this->_this ();
+ this->supplier_proxy_ = consumer_admin->obtain_push_supplier ();
+
+ ACE_ConsumerQOS_Factory qos;
+ qos.start_disjunction_group (1);
+ qos.insert_type (ACE_ES_EVENT_ANY,
+ 0);
+ this->supplier_proxy_->connect_push_consumer (myself.in(), qos.get_ConsumerQOS ());
+}
+
+void
+TAO_Rtec_LogConsumer::push (const RtecEventComm::EventSet& events ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // create a record list...
+ DsLogAdmin::RecordList recList (1);
+ recList.length (1);
+
+ recList [0].info <<= events;
+
+ this->log_->write_recordlist (recList ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK;
+
+}
+
+void
+TAO_Rtec_LogConsumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->supplier_proxy_->disconnect_push_supplier (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/RTEventLogConsumer.h b/TAO/orbsvcs/orbsvcs/Log/RTEventLogConsumer.h
new file mode 100644
index 00000000000..05fdb9d65f4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/RTEventLogConsumer.h
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file RTEventLogConsumer.h
+ *
+ * $Id$
+ *
+ * The RTEventLogConsumer connects to the RTEventLog and logs the events
+ * that are pushed to the RTEventLog.
+ *
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_RTEVENTLOGCONSUMER_H
+#define TAO_TLS_RTEVENTLOGCONSUMER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/DsLogAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RTEventLogAdminS.h"
+#include "orbsvcs/Log/Log_i.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Factory.h"
+#include "orbsvcs/Event/EC_Defaults.h"
+
+#include "orbsvcs/Log/rteventlog_serv_export.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_LogMgr_i;
+class TAO_RTEventLog_i;
+class TAO_RTEventLogFactory_i;
+
+/**
+ * @class TAO_Rtec_LogConsumer
+ *
+ * @brief An implementation of the PushConsumer interface.
+ *
+ * Connects to the RTEventLog and writes LogRecords to the
+ * Log when events are 'pushed' to the RTEventLog which is an
+ * EventChannel.
+ */
+class TAO_RTEventLog_Serv_Export TAO_Rtec_LogConsumer :public virtual POA_RtecEventComm::PushConsumer
+{
+public:
+ // = Initialization and Termination methods.
+
+ /// Constructor.
+ TAO_Rtec_LogConsumer (TAO_RTEventLog_i *log);
+
+ /// Destructor.
+ ~TAO_Rtec_LogConsumer (void);
+
+ /// Connect to RTEventLog.
+ void connect (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin);
+
+private:
+ /// Disconnect from EventLog.
+ void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// This method will call TAO_Log_i::log() to write
+ /// the event to the Log.
+ void push (const RtecEventComm::EventSet& events ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// ProxyPushSupplier used to connect to RTEventLog.
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+
+ /// The RTEventLog that this consumer connects to
+ /// and whose events are to be logged.
+ TAO_RTEventLog_i *log_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TLS_RTEVENTLOGCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.cpp b/TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.cpp
new file mode 100644
index 00000000000..bffeb96ecf4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.cpp
@@ -0,0 +1,242 @@
+#include "orbsvcs/Log/RTEventLogFactory_i.h"
+#include "orbsvcs/Log/LogNotification.h"
+#include "orbsvcs/Log/RTEventLogNotification.h"
+#include "orbsvcs/Event/EC_ConsumerAdmin.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_ProxyConsumer.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/ESF/ESF_Peer_Workers.h"
+#include "orbsvcs/ESF/ESF_Peer_Admin.h"
+#include "orbsvcs/ESF/ESF_Shutdown_Proxy.h"
+#include "orbsvcs/Event/EC_ConsumerAdmin.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Sched/Config_Scheduler.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "ace/OS_NS_stdio.h"
+
+#include "ace/Auto_Ptr.h"
+
+ACE_RCSID (Log,
+ RTEventLogFactory_i,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_RTEventLogFactory_i::TAO_RTEventLogFactory_i (void)
+{
+}
+
+TAO_RTEventLogFactory_i::~TAO_RTEventLogFactory_i()
+{
+}
+
+int
+TAO_RTEventLogFactory_i::init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ TAO_LogMgr_i::init (orb, poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+
+ PortableServer::POA_var defPOA =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ TAO_EC_Event_Channel_Attributes attr (defPOA.in (), defPOA.in ());
+
+ this->impl = 0;
+ ACE_NEW_THROW_EX (impl,
+ TAO_EC_Event_Channel (attr),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (-1);
+
+ auto_ptr <TAO_EC_Event_Channel> ec (impl);
+
+ impl->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ PortableServer::ObjectId_var oidec = poa_->activate_object (ec.get ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ec.release ();
+
+ CORBA::Object_var objec =
+ poa_->id_to_reference (oidec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->event_channel_ = RtecEventChannelAdmin::EventChannel::_narrow (objec.in ());
+
+
+ this->consumer_admin_ = this->event_channel_->for_consumers(ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ ACE_NEW_THROW_EX (this->notifier_,
+ TAO_RTEventLogNotification(this->event_channel_.in ()),
+ CORBA::NO_MEMORY ());
+ return 0;
+}
+
+RTEventLogAdmin::EventLogFactory_ptr
+TAO_RTEventLogFactory_i::activate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RTEventLogAdmin::EventLogFactory_var v_return;
+
+ PortableServer::ObjectId_var oid =
+ this->factory_poa_->activate_object (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (v_return._retn ());
+
+ CORBA::Object_var obj =
+ this->factory_poa_->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (v_return._retn ());
+
+ // narrow and store the result..
+ this->log_mgr_ =
+ DsLogAdmin::LogMgr::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (v_return._retn ());
+
+ v_return =
+ RTEventLogAdmin::EventLogFactory::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (RTEventLogAdmin::EventLogFactory::_nil ());
+
+ return v_return._retn ();
+}
+
+RTEventLogAdmin::EventLog_ptr
+TAO_RTEventLogFactory_i::create (
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList & thresholds,
+ DsLogAdmin::LogId_out id_out
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold
+ ))
+{
+ this->create_i (full_action,
+ max_size,
+ & thresholds,
+ id_out
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (RTEventLogAdmin::EventLog::_nil ());
+ DsLogAdmin::LogId id = id_out;
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+ DsLogAdmin::Log_var log =
+ this->create_log_reference (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (RTEventLogAdmin::EventLog::_nil ());
+#else
+ DsLogAdmin::Log_var log =
+ this->create_log_object (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (RTEventLogAdmin::EventLog::_nil ());
+#endif
+
+ // narrow to EventLog
+ RTEventLogAdmin::EventLog_var event_log =
+ RTEventLogAdmin::EventLog::_narrow (log.in ());
+
+ // @@ JTC - squelch exception?
+ notifier_->object_creation (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (RTEventLogAdmin::EventLog::_nil ());
+
+ return event_log._retn();
+}
+
+RTEventLogAdmin::EventLog_ptr
+TAO_RTEventLogFactory_i::create_with_id (
+ DsLogAdmin::LogId id,
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList & thresholds
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ DsLogAdmin::LogIdAlreadyExists,
+ DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold
+ ))
+{
+ this->create_with_id_i (id,
+ full_action,
+ max_size,
+ & thresholds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (RTEventLogAdmin::EventLog::_nil ());
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+ DsLogAdmin::Log_var log =
+ this->create_log_reference (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (RTEventLogAdmin::EventLog::_nil ());
+#else
+ DsLogAdmin::Log_var log =
+ this->create_log_object (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (RTEventLogAdmin::EventLog::_nil ());
+#endif
+
+ // narrow to EventLog
+ RTEventLogAdmin::EventLog_var event_log =
+ RTEventLogAdmin::EventLog::_narrow (log.in ());
+
+ // @@ JTC - squelch exception?
+ notifier_->object_creation (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (RTEventLogAdmin::EventLog::_nil ());
+
+ return event_log._retn ();
+}
+
+CORBA::RepositoryId
+TAO_RTEventLogFactory_i::create_repositoryid ()
+{
+ return CORBA::string_dup("IDL:omg.org/RTEventLogAdmin:EventLog:1.0");
+}
+
+PortableServer::ServantBase*
+TAO_RTEventLogFactory_i::create_log_servant (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL)
+{
+ TAO_RTEventLog_i* event_log_i;
+
+ ACE_NEW_THROW_EX (event_log_i,
+ TAO_RTEventLog_i (this->orb_.in (),
+ this->poa_.in (),
+ this->log_poa_.in (),
+ *this,
+ this->log_mgr_.in (),
+ this->notifier_,
+ id
+ ),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ event_log_i->init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ //initialise the LogConsumer object
+ event_log_i->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return event_log_i;
+}
+
+RtecEventChannelAdmin::ProxyPushSupplier_ptr
+TAO_RTEventLogFactory_i::obtain_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return consumer_admin_->obtain_push_supplier();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.h b/TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.h
new file mode 100644
index 00000000000..d416bd028ec
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.h
@@ -0,0 +1,141 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file RTEventLogFactory_i.h
+ *
+ * $Id$
+ *
+ * Implements the Factory for NotifyLog Objects.
+ *
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TLS_RTEVENTLOGFACTORY_I_H
+#define TLS_RTEVENTLOGFACTORY_I_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RTEventLogAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/DsLogAdminS.h"
+#include "orbsvcs/Log/LogMgr_i.h"
+#include "orbsvcs/RtecEventChannelAdminS.h"
+#include "orbsvcs/RtecSchedulerS.h"
+
+#include "orbsvcs/Log/RTEventLog_i.h"
+#include "orbsvcs/Log/rteventlog_serv_export.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_RTEventLog_i;
+class TAO_RTEventLogNotification;
+
+/**
+ * @class TAO_RTEventLogFactory_i
+ *
+ * @brief The TAO_RTEventLogFactory is a factory that is used to create RTEventLogs which are event-aware.
+ */
+class TAO_RTEventLog_Serv_Export TAO_RTEventLogFactory_i :
+ public POA_RTEventLogAdmin::EventLogFactory,
+ public TAO_LogMgr_i
+{
+public:
+ //= Initialization and termination code.
+
+ /// Constructor.
+ TAO_RTEventLogFactory_i (void);
+
+ /// Destructor.
+ ~TAO_RTEventLogFactory_i ();
+
+ /// Initialise the EventChannel and obtain a
+ /// pointer to it.
+ int
+ init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL);
+
+ /// Activate this servant
+ RTEventLogAdmin::EventLogFactory_ptr
+ activate (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Used to create a RTEventLog.
+ RTEventLogAdmin::EventLog_ptr create (
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList & thresholds,
+ DsLogAdmin::LogId_out id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold
+ ));
+
+ /// Same as create (), but allows clients to specify the id.
+ RTEventLogAdmin::EventLog_ptr create_with_id (
+ DsLogAdmin::LogId id,
+ DsLogAdmin::LogFullActionType full_action,
+ CORBA::ULongLong max_size,
+ const DsLogAdmin::CapacityAlarmThresholdList & thresholds
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ DsLogAdmin::LogIdAlreadyExists,
+ DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold
+ ));
+
+ // = Implementation of the RtecEventChannelAdmin::ConsumerAdmin methods.
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr obtain_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+protected:
+ virtual CORBA::RepositoryId
+ create_repositoryid ();
+
+ virtual PortableServer::ServantBase*
+ create_log_servant (DsLogAdmin::LogId id
+ ACE_ENV_ARG_DECL);
+
+ /// Our object ref. after <active>ation.
+ DsLogAdmin::LogMgr_var log_mgr_;
+
+ /// The event channel used for log generated events.
+ TAO_EC_Event_Channel *impl;
+
+ /// The object used for log generated events.
+ TAO_RTEventLogNotification* notifier_;
+
+ /// EventChannel used to obtain the ConsumerAdmin.
+ RtecEventChannelAdmin::EventChannel_var event_channel_;
+
+ /// The ConsumerAdmin that the EventLogFactory supports.
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TLS_RTEVENTLOGFACTORY_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/RTEventLogNotification.cpp b/TAO/orbsvcs/orbsvcs/Log/RTEventLogNotification.cpp
new file mode 100644
index 00000000000..d3ceeb987e8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/RTEventLogNotification.cpp
@@ -0,0 +1,90 @@
+#include "orbsvcs/Log/LogNotification.h"
+#include "orbsvcs/Log/RTEventLogNotification.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "tao/debug.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/ESF/ESF_Peer_Workers.h"
+#include "orbsvcs/ESF/ESF_Peer_Admin.h"
+#include "orbsvcs/ESF/ESF_Shutdown_Proxy.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_Dispatching.h"
+#include "orbsvcs/Event/EC_Filter_Builder.h"
+#include "orbsvcs/Event/EC_QOS_Info.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Scheduling_Strategy.h"
+#include "orbsvcs/Event/EC_ConsumerControl.h"
+#include "orbsvcs/ESF/ESF_RefCount_Guard.h"
+#include "orbsvcs/ESF/ESF_Proxy_RefCount_Guard.h"
+
+ACE_RCSID (Log,
+ RTEventLogNotification,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_RTEventLogNotification::TAO_RTEventLogNotification (
+ RtecEventChannelAdmin::EventChannel_ptr ec)
+ : TAO_LogNotification (),
+ event_channel_ (RtecEventChannelAdmin::EventChannel::_duplicate (ec))
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ obtainProxyConsumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_RTEventLogNotification::~TAO_RTEventLogNotification (void)
+{
+ // No-Op.
+}
+
+void
+TAO_RTEventLogNotification::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // No-Op.
+}
+
+void
+TAO_RTEventLogNotification::obtainProxyConsumer (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel_->for_suppliers();
+
+ consumer_ = supplier_admin->obtain_push_consumer();
+
+ RtecEventComm::PushSupplier_var supplier =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ // 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.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
+
+ consumer_->connect_push_supplier (supplier.in(), qos);
+}
+
+void
+TAO_RTEventLogNotification::send_notification (const CORBA::Any& any)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ 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;
+#ifndef TAO_LACKS_EVENT_CHANNEL_ANY
+ event[0].data.any_value <<= any;
+#else
+ ACE_UNUSED_ARG (any);
+#endif
+
+ consumer_->push(event);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/RTEventLogNotification.h b/TAO/orbsvcs/orbsvcs/Log/RTEventLogNotification.h
new file mode 100644
index 00000000000..785efe87c79
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/RTEventLogNotification.h
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file RTEventLogNotification.h
+ *
+ * $Id$
+ *
+ * Methods to enable log-generated events.
+ *
+ * @author D A Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_RTEVENT_LOG_NOTIFICATION_H
+#define TAO_TLS_RTEVENT_LOG_NOTIFICATION_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Event/EC_ConsumerAdmin.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/RTEventLogAdminS.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/Event/EC_ProxySupplier.h"
+#include "orbsvcs/Event/EC_ProxyConsumer.h"
+
+#include "orbsvcs/Log/rteventlog_serv_export.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_RTEventLogNotification
+ *
+ * @brief Used to forward log generated events to a logging server.
+ */
+class TAO_RTEventLog_Serv_Export TAO_RTEventLogNotification :
+ public TAO_LogNotification,
+ public POA_RtecEventComm::PushSupplier
+{
+public:
+ // = Initialization and Termination methods.
+
+ /// Constructor.
+ TAO_RTEventLogNotification (RtecEventChannelAdmin::EventChannel_ptr);
+
+ /// Destructor.
+ ~TAO_RTEventLogNotification (void);
+
+ /// The skeleton methods.
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+ // = Helper methods
+
+ /// Used to connect this PushSupplier to the EventChannel
+ /// that will log these events.
+ void obtainProxyConsumer (ACE_ENV_SINGLE_ARG_DECL);
+
+ // Send the event on the event channel.
+ virtual void send_notification (const CORBA::Any& any)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// The ORB reference.
+ CORBA::ORB_var orb_;
+
+ /// The event channel we connect to.
+ RtecEventChannelAdmin::EventChannel_var event_channel_;
+
+ /// The ProxyPushConsumer used to connect to the event channel.
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TLS_RTEVENT_LOG_NOTIFICATION_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/RTEventLog_i.cpp b/TAO/orbsvcs/orbsvcs/Log/RTEventLog_i.cpp
new file mode 100644
index 00000000000..3aacac1ff86
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/RTEventLog_i.cpp
@@ -0,0 +1,166 @@
+#include "orbsvcs/Log/RTEventLog_i.h"
+#include "orbsvcs/Log/LogMgr_i.h"
+#include "orbsvcs/Log/LogNotification.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "orbsvcs/Event/EC_Dispatching.h"
+#include "orbsvcs/Event/EC_ConsumerAdmin.h"
+#include "orbsvcs/Event/EC_SupplierAdmin.h"
+#include "orbsvcs/Event/EC_Timeout_Generator.h"
+#include "orbsvcs/Event/EC_ObserverStrategy.h"
+#include "orbsvcs/Event/EC_ConsumerControl.h"
+#include "orbsvcs/Event/EC_SupplierControl.h"
+#include "ace/Dynamic_Service.h"
+
+ACE_RCSID (Log,
+ RTEventLog_i,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_RTEventLog_i::TAO_RTEventLog_i (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::POA_ptr log_poa,
+ TAO_LogMgr_i &logmgr_i,
+ DsLogAdmin::LogMgr_ptr factory,
+ TAO_LogNotification *log_notifier,
+ DsLogAdmin::LogId id
+ )
+ : TAO_Log_i (orb, logmgr_i, factory, id, log_notifier),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ log_poa_ (PortableServer::POA::_duplicate (log_poa))
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ TAO_EC_Event_Channel_Attributes attr (poa_.in(), poa_.in());
+
+ ACE_NEW_THROW_EX (this->event_channel_,
+ TAO_EC_Event_Channel(attr),
+ CORBA::NO_MEMORY ());
+}
+
+TAO_RTEventLog_i::~TAO_RTEventLog_i ()
+{
+ this->event_channel_->destroy ();
+
+ delete this->event_channel_;
+}
+
+
+DsLogAdmin::Log_ptr
+TAO_RTEventLog_i::copy (DsLogAdmin::LogId &id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ RTEventLogAdmin::EventLogFactory_var eventLogFactory =
+ RTEventLogAdmin::EventLogFactory::_narrow (factory_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ RTEventLogAdmin::EventLog_var log =
+ eventLogFactory->create (DsLogAdmin::halt, 0, thresholds_,
+ id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ copy_attributes (log.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ return log._retn ();
+}
+
+DsLogAdmin::Log_ptr
+TAO_RTEventLog_i::copy_with_id (DsLogAdmin::LogId id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((DsLogAdmin::LogIdAlreadyExists, CORBA::SystemException))
+{
+ RTEventLogAdmin::EventLogFactory_var eventLogFactory =
+ RTEventLogAdmin::EventLogFactory::_narrow (factory_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ RTEventLogAdmin::EventLog_var log =
+ eventLogFactory->create_with_id (id, DsLogAdmin::halt, 0,
+ thresholds_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ copy_attributes (log.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (DsLogAdmin::Log::_nil ());
+
+ return log._retn ();
+}
+
+void
+TAO_RTEventLog_i::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ notifier_->object_deletion (logid_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Remove ourselves from the list of logs.
+ this->logmgr_i_.remove (this->logid_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Deregister with POA.
+ PortableServer::ObjectId_var id =
+ this->log_poa_->servant_to_id (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->log_poa_->deactivate_object (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_RTEventLog_i::activate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ this->event_channel_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->my_log_consumer_ = new TAO_Rtec_LogConsumer (this);
+ this->my_log_consumer_->connect (consumer_admin.in ());
+}
+
+RtecEventChannelAdmin::ConsumerAdmin_ptr
+TAO_RTEventLog_i::for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->event_channel_->for_consumers(ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+RtecEventChannelAdmin::SupplierAdmin_ptr
+TAO_RTEventLog_i::for_suppliers (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->event_channel_->for_suppliers(ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+RtecEventChannelAdmin::Observer_Handle
+TAO_RTEventLog_i::append_observer (
+ RtecEventChannelAdmin::Observer_ptr observer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER))
+{
+ return this->observer_strategy_->append_observer (observer
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_RTEventLog_i::remove_observer (
+ RtecEventChannelAdmin::Observer_Handle handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_REMOVE_OBSERVER))
+{
+ this->observer_strategy_->remove_observer (handle ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Log/RTEventLog_i.h b/TAO/orbsvcs/orbsvcs/Log/RTEventLog_i.h
new file mode 100644
index 00000000000..6dc0b4975b3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/RTEventLog_i.h
@@ -0,0 +1,138 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file RTEventLog_i.h
+ *
+ * $Id$
+ *
+ * Implementation of the RTEventLogAdmin::NotifyLog interface.
+ *
+ *
+ * @author David A. Hanvey <d.hanvey@qub.ac.uk>
+ */
+//=============================================================================
+
+#ifndef TAO_TLS_RTEVENTLOG_I_H
+#define TAO_TLS_RTEVENTLOG_I_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/DsLogAdminS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RTEventLogAdminS.h"
+#include "orbsvcs/Log/Log_i.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Factory.h"
+#include "orbsvcs/Event/EC_Defaults.h"
+#include "orbsvcs/Log/RTEventLogConsumer.h"
+
+#include "orbsvcs/Log/rteventlog_serv_export.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_LogMgr_i;
+class TAO_RTEventLog_i;
+class TAO_RTEventLogFactory_i;
+
+/**
+ * @class TAO_RTEventLog_i
+ *
+ * @brief The RTEventLog is an EventChannel and a Log.
+ *
+ * It is used to log events that pass through the EventChannel.
+ * The class supports the @c destroy> method to destroy the Log.
+ */
+class TAO_RTEventLog_Serv_Export TAO_RTEventLog_i :
+ public TAO_Log_i,
+ public POA_RTEventLogAdmin::EventLog
+{
+public:
+ // = Initialization and Termination methods.
+
+ /// Constructor.
+ TAO_RTEventLog_i (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::POA_ptr log_poa,
+ TAO_LogMgr_i &logmgr_i,
+ DsLogAdmin::LogMgr_ptr factory,
+ TAO_LogNotification *log_notifier,
+ DsLogAdmin::LogId id);
+
+ /// Destructor.
+ ~TAO_RTEventLog_i ();
+
+ /// Duplicate the log.
+ virtual DsLogAdmin::Log_ptr copy (DsLogAdmin::LogId &id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Duplicate the log specifying an id.
+ virtual DsLogAdmin::Log_ptr copy_with_id (DsLogAdmin::LogId id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((DsLogAdmin::LogIdAlreadyExists, CORBA::SystemException));
+
+ /// Destroy the log object and all contained records.
+ void
+ destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Activate the RTEventLog.
+ void
+ activate (ACE_ENV_SINGLE_ARG_DECL);
+
+ // = The RtecEventChannelAdmin::EventChannel interface methods.
+ RtecEventChannelAdmin::ConsumerAdmin_ptr
+ for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ RtecEventChannelAdmin::SupplierAdmin_ptr
+ for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual RtecEventChannelAdmin::Observer_Handle
+ append_observer (RtecEventChannelAdmin::Observer_ptr
+ 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));
+
+ private:
+ /// The EventChannel used.
+ TAO_EC_Event_Channel *event_channel_;
+
+ /// The LogConsumer which logs the events the EventChannel above
+ /// receives.
+ TAO_Rtec_LogConsumer *my_log_consumer_;
+
+ /// The observer strategy
+ TAO_EC_ObserverStrategy *observer_strategy_;
+
+ PortableServer::POA_var poa_;
+
+ PortableServer::POA_var log_poa_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TLS_RTEVENTLOG_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/Log/eventlog_export.h b/TAO/orbsvcs/orbsvcs/Log/eventlog_export.h
new file mode 100644
index 00000000000..2b21d1f4463
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/eventlog_export.h
@@ -0,0 +1,37 @@
+/* -*- C++ -*- $Id$ */
+// generate_export_file.pl,v 1.8 2001/03/04 09:16:29 nanbor Exp
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_EVENTLOG_EXPORT_H
+#define TAO_EVENTLOG_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (TAO_EVENTLOG_HAS_DLL)
+# define TAO_EVENTLOG_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && TAO_EVENTLOG_HAS_DLL */
+
+#if !defined (TAO_EVENTLOG_HAS_DLL)
+# define TAO_EVENTLOG_HAS_DLL 1
+#endif /* ! TAO_EVENTLOG_HAS_DLL */
+
+#if defined (TAO_EVENTLOG_HAS_DLL) && (TAO_EVENTLOG_HAS_DLL == 1)
+# if defined (TAO_EVENTLOG_BUILD_DLL)
+# define TAO_EventLog_Export ACE_Proper_Export_Flag
+# define TAO_EVENTLOG_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_EVENTLOG_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_EVENTLOG_BUILD_DLL */
+# define TAO_EventLog_Export ACE_Proper_Import_Flag
+# define TAO_EVENTLOG_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_EVENTLOG_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_EVENTLOG_BUILD_DLL */
+#else /* TAO_EVENTLOG_HAS_DLL == 1 */
+# define TAO_EventLog_Export
+# define TAO_EVENTLOG_SINGLETON_DECLARATION(T)
+# define TAO_EVENTLOG_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_EVENTLOG_HAS_DLL == 1 */
+
+#endif /* TAO_EVENTLOG_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Log/eventlog_serv_export.h b/TAO/orbsvcs/orbsvcs/Log/eventlog_serv_export.h
new file mode 100644
index 00000000000..f3537333c31
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/eventlog_serv_export.h
@@ -0,0 +1,37 @@
+/* -*- C++ -*- $Id$ */
+// generate_export_file.pl,v 1.8 2001/03/04 09:16:29 nanbor Exp
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_EVENTLOG_SERV_EXPORT_H
+#define TAO_EVENTLOG_SERV_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (TAO_EVENTLOG_SERV_HAS_DLL)
+# define TAO_EVENTLOG_SERV_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && TAO_EVENTLOG_SERV_HAS_DLL */
+
+#if !defined (TAO_EVENTLOG_SERV_HAS_DLL)
+# define TAO_EVENTLOG_SERV_HAS_DLL 1
+#endif /* ! TAO_EVENTLOG_SERV_HAS_DLL */
+
+#if defined (TAO_EVENTLOG_SERV_HAS_DLL) && (TAO_EVENTLOG_SERV_HAS_DLL == 1)
+# if defined (TAO_EVENTLOG_SERV_BUILD_DLL)
+# define TAO_EventLog_Serv_Export ACE_Proper_Export_Flag
+# define TAO_EVENTLOG_SERV_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_EVENTLOG_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_EVENTLOG_SERV_BUILD_DLL */
+# define TAO_EventLog_Serv_Export ACE_Proper_Import_Flag
+# define TAO_EVENTLOG_SERV_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_EVENTLOG_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_EVENTLOG_SERV_BUILD_DLL */
+#else /* TAO_EVENTLOG_SERV_HAS_DLL == 1 */
+# define TAO_EventLog_Serv_Export
+# define TAO_EVENTLOG_SERV_SINGLETON_DECLARATION(T)
+# define TAO_EVENTLOG_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_EVENTLOG_SERV_HAS_DLL == 1 */
+
+#endif /* TAO_EVENTLOG_SERV_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Log/eventlog_skel_export.h b/TAO/orbsvcs/orbsvcs/Log/eventlog_skel_export.h
new file mode 100644
index 00000000000..f0d5cb23cf2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/eventlog_skel_export.h
@@ -0,0 +1,37 @@
+/* -*- C++ -*- $Id$ */
+// generate_export_file.pl,v 1.8 2001/03/04 09:16:29 nanbor Exp
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_EVENTLOG_SKEL_EXPORT_H
+#define TAO_EVENTLOG_SKEL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (TAO_EVENTLOG_SKEL_HAS_DLL)
+# define TAO_EVENTLOG_SKEL_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && TAO_EVENTLOG_SKEL_HAS_DLL */
+
+#if !defined (TAO_EVENTLOG_SKEL_HAS_DLL)
+# define TAO_EVENTLOG_SKEL_HAS_DLL 1
+#endif /* ! TAO_EVENTLOG_SKEL_HAS_DLL */
+
+#if defined (TAO_EVENTLOG_SKEL_HAS_DLL) && (TAO_EVENTLOG_SKEL_HAS_DLL == 1)
+# if defined (TAO_EVENTLOG_SKEL_BUILD_DLL)
+# define TAO_EventLog_Skel_Export ACE_Proper_Export_Flag
+# define TAO_EVENTLOG_SKEL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_EVENTLOG_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_EVENTLOG_SKEL_BUILD_DLL */
+# define TAO_EventLog_Skel_Export ACE_Proper_Import_Flag
+# define TAO_EVENTLOG_SKEL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_EVENTLOG_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_EVENTLOG_SKEL_BUILD_DLL */
+#else /* TAO_EVENTLOG_SKEL_HAS_DLL == 1 */
+# define TAO_EventLog_Skel_Export
+# define TAO_EVENTLOG_SKEL_SINGLETON_DECLARATION(T)
+# define TAO_EVENTLOG_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_EVENTLOG_SKEL_HAS_DLL == 1 */
+
+#endif /* TAO_EVENTLOG_SKEL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Log/log_export.h b/TAO/orbsvcs/orbsvcs/Log/log_export.h
new file mode 100644
index 00000000000..97ea3366e3e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/log_export.h
@@ -0,0 +1,39 @@
+/* -*- C++ -*- $Id$ */
+// log_export.h,v 1.2 2000/10/10 22:16:02 nanbor Exp
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_LOG_EXPORT_H
+#define TAO_LOG_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_LOG_HAS_DLL)
+# define TAO_LOG_HAS_DLL 0
+# endif /* ! TAO_LOG_HAS_DLL */
+#else
+# if !defined (TAO_LOG_HAS_DLL)
+# define TAO_LOG_HAS_DLL 1
+# endif /* ! TAO_LOG_HAS_DLL */
+#endif
+
+#if defined (TAO_LOG_HAS_DLL) && (TAO_LOG_HAS_DLL == 1)
+# if defined (TAO_LOG_BUILD_DLL)
+# define TAO_Log_Export ACE_Proper_Export_Flag
+# define TAO_LOG_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_LOG_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_LOG_BUILD_DLL */
+# define TAO_Log_Export ACE_Proper_Import_Flag
+# define TAO_LOG_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_LOG_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_LOG_BUILD_DLL */
+#else /* TAO_LOG_HAS_DLL == 1 */
+# define TAO_Log_Export
+# define TAO_LOG_SINGLETON_DECLARATION(T)
+# define TAO_LOG_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_LOG_HAS_DLL == 1 */
+
+#endif /* TAO_LOG_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Log/log_serv_export.h b/TAO/orbsvcs/orbsvcs/Log/log_serv_export.h
new file mode 100644
index 00000000000..000f75e5922
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/log_serv_export.h
@@ -0,0 +1,39 @@
+/* -*- C++ -*- $Id$ */
+// log_serv_export.h,v 1.2 2000/10/10 22:16:02 nanbor Exp
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_LOG_SERV_EXPORT_H
+#define TAO_LOG_SERV_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_LOG_SERV_HAS_DLL)
+# define TAO_LOG_SERV_HAS_DLL 0
+# endif /* ! TAO_LOG_SERV_HAS_DLL */
+#else
+# if !defined (TAO_LOG_SERV_HAS_DLL)
+# define TAO_LOG_SERV_HAS_DLL 1
+# endif /* ! TAO_LOG_SERV_HAS_DLL */
+#endif
+
+#if defined (TAO_LOG_SERV_HAS_DLL) && (TAO_LOG_SERV_HAS_DLL == 1)
+# if defined (TAO_LOG_SERV_BUILD_DLL)
+# define TAO_Log_Serv_Export ACE_Proper_Export_Flag
+# define TAO_LOG_SERV_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_LOG_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_LOG_SERV_BUILD_DLL */
+# define TAO_Log_Serv_Export ACE_Proper_Import_Flag
+# define TAO_LOG_SERV_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_LOG_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_LOG_SERV_BUILD_DLL */
+#else /* TAO_LOG_SERV_HAS_DLL == 1 */
+# define TAO_Log_Serv_Export
+# define TAO_LOG_SERV_SINGLETON_DECLARATION(T)
+# define TAO_LOG_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_LOG_SERV_HAS_DLL == 1 */
+
+#endif /* TAO_LOG_SERV_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Log/log_skel_export.h b/TAO/orbsvcs/orbsvcs/Log/log_skel_export.h
new file mode 100644
index 00000000000..db1ff0231fc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/log_skel_export.h
@@ -0,0 +1,41 @@
+
+
+/* -*- C++ -*- $Id$ */
+// log_skel_export.h,v 1.2 2000/10/10 22:16:02 nanbor Exp
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_LOG_SKEL_EXPORT_H
+#define TAO_LOG_SKEL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_LOG_SKEL_HAS_DLL)
+# define TAO_LOG_SKEL_HAS_DLL 0
+# endif /* ! TAO_LOG_SKEL_HAS_DLL */
+#else
+# if !defined (TAO_LOG_SKEL_HAS_DLL)
+# define TAO_LOG_SKEL_HAS_DLL 1
+# endif /* ! TAO_LOG_SKEL_HAS_DLL */
+#endif
+
+#if defined (TAO_LOG_SKEL_HAS_DLL) && (TAO_LOG_SKEL_HAS_DLL == 1)
+# if defined (TAO_LOG_SKEL_BUILD_DLL)
+# define TAO_Log_Skel_Export ACE_Proper_Export_Flag
+# define TAO_LOG_SKEL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_LOG_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_LOG_SKEL_BUILD_DLL */
+# define TAO_Log_Skel_Export ACE_Proper_Import_Flag
+# define TAO_LOG_SKEL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_LOG_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_LOG_SKEL_BUILD_DLL */
+#else /* TAO_LOG_SKEL_HAS_DLL == 1 */
+# define TAO_Log_Skel_Export
+# define TAO_LOG_SKEL_SINGLETON_DECLARATION(T)
+# define TAO_LOG_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_LOG_SKEL_HAS_DLL == 1 */
+
+#endif /* TAO_LOG_SKEL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Log/notifylog_export.h b/TAO/orbsvcs/orbsvcs/Log/notifylog_export.h
new file mode 100644
index 00000000000..c9f1d99ef4e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/notifylog_export.h
@@ -0,0 +1,37 @@
+/* -*- C++ -*- $Id$ */
+// generate_export_file.pl,v 1.8 2001/03/04 09:16:29 nanbor Exp
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_NOTIFYLOG_EXPORT_H
+#define TAO_NOTIFYLOG_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (TAO_NOTIFYLOG_HAS_DLL)
+# define TAO_NOTIFYLOG_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && TAO_NOTIFYLOG_HAS_DLL */
+
+#if !defined (TAO_NOTIFYLOG_HAS_DLL)
+# define TAO_NOTIFYLOG_HAS_DLL 1
+#endif /* ! TAO_NOTIFYLOG_HAS_DLL */
+
+#if defined (TAO_NOTIFYLOG_HAS_DLL) && (TAO_NOTIFYLOG_HAS_DLL == 1)
+# if defined (TAO_NOTIFYLOG_BUILD_DLL)
+# define TAO_NotifyLog_Export ACE_Proper_Export_Flag
+# define TAO_NOTIFYLOG_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFYLOG_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_NOTIFYLOG_BUILD_DLL */
+# define TAO_NotifyLog_Export ACE_Proper_Import_Flag
+# define TAO_NOTIFYLOG_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFYLOG_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_NOTIFYLOG_BUILD_DLL */
+#else /* TAO_NOTIFYLOG_HAS_DLL == 1 */
+# define TAO_NotifyLog_Export
+# define TAO_NOTIFYLOG_SINGLETON_DECLARATION(T)
+# define TAO_NOTIFYLOG_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_NOTIFYLOG_HAS_DLL == 1 */
+
+#endif /* TAO_NOTIFYLOG_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Log/notifylog_serv_export.h b/TAO/orbsvcs/orbsvcs/Log/notifylog_serv_export.h
new file mode 100644
index 00000000000..b9a3c655dc8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/notifylog_serv_export.h
@@ -0,0 +1,37 @@
+/* -*- C++ -*- $Id$ */
+// generate_export_file.pl,v 1.8 2001/03/04 09:16:29 nanbor Exp
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_NOTIFYLOG_SERV_EXPORT_H
+#define TAO_NOTIFYLOG_SERV_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (TAO_NOTIFYLOG_SERV_HAS_DLL)
+# define TAO_NOTIFYLOG_SERV_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && TAO_NOTIFYLOG_SERV_HAS_DLL */
+
+#if !defined (TAO_NOTIFYLOG_SERV_HAS_DLL)
+# define TAO_NOTIFYLOG_SERV_HAS_DLL 1
+#endif /* ! TAO_NOTIFYLOG_SERV_HAS_DLL */
+
+#if defined (TAO_NOTIFYLOG_SERV_HAS_DLL) && (TAO_NOTIFYLOG_SERV_HAS_DLL == 1)
+# if defined (TAO_NOTIFYLOG_SERV_BUILD_DLL)
+# define TAO_NotifyLog_Serv_Export ACE_Proper_Export_Flag
+# define TAO_NOTIFYLOG_SERV_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFYLOG_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_NOTIFYLOG_SERV_BUILD_DLL */
+# define TAO_NotifyLog_Serv_Export ACE_Proper_Import_Flag
+# define TAO_NOTIFYLOG_SERV_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFYLOG_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_NOTIFYLOG_SERV_BUILD_DLL */
+#else /* TAO_NOTIFYLOG_SERV_HAS_DLL == 1 */
+# define TAO_NotifyLog_Serv_Export
+# define TAO_NOTIFYLOG_SERV_SINGLETON_DECLARATION(T)
+# define TAO_NOTIFYLOG_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_NOTIFYLOG_SERV_HAS_DLL == 1 */
+
+#endif /* TAO_NOTIFYLOG_SERV_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Log/notifylog_skel_export.h b/TAO/orbsvcs/orbsvcs/Log/notifylog_skel_export.h
new file mode 100644
index 00000000000..b810fa8bb69
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/notifylog_skel_export.h
@@ -0,0 +1,37 @@
+/* -*- C++ -*- $Id$ */
+// generate_export_file.pl,v 1.8 2001/03/04 09:16:29 nanbor Exp
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_NOTIFYLOG_SKEL_EXPORT_H
+#define TAO_NOTIFYLOG_SKEL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (TAO_NOTIFYLOG_SKEL_HAS_DLL)
+# define TAO_NOTIFYLOG_SKEL_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && TAO_NOTIFYLOG_SKEL_HAS_DLL */
+
+#if !defined (TAO_NOTIFYLOG_SKEL_HAS_DLL)
+# define TAO_NOTIFYLOG_SKEL_HAS_DLL 1
+#endif /* ! TAO_NOTIFYLOG_SKEL_HAS_DLL */
+
+#if defined (TAO_NOTIFYLOG_SKEL_HAS_DLL) && (TAO_NOTIFYLOG_SKEL_HAS_DLL == 1)
+# if defined (TAO_NOTIFYLOG_SKEL_BUILD_DLL)
+# define TAO_NotifyLog_Skel_Export ACE_Proper_Export_Flag
+# define TAO_NOTIFYLOG_SKEL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFYLOG_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_NOTIFYLOG_SKEL_BUILD_DLL */
+# define TAO_NotifyLog_Skel_Export ACE_Proper_Import_Flag
+# define TAO_NOTIFYLOG_SKEL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFYLOG_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_NOTIFYLOG_SKEL_BUILD_DLL */
+#else /* TAO_NOTIFYLOG_SKEL_HAS_DLL == 1 */
+# define TAO_NotifyLog_Skel_Export
+# define TAO_NOTIFYLOG_SKEL_SINGLETON_DECLARATION(T)
+# define TAO_NOTIFYLOG_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_NOTIFYLOG_SKEL_HAS_DLL == 1 */
+
+#endif /* TAO_NOTIFYLOG_SKEL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Log/rteventlog_export.h b/TAO/orbsvcs/orbsvcs/Log/rteventlog_export.h
new file mode 100644
index 00000000000..9ad106e8d33
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/rteventlog_export.h
@@ -0,0 +1,37 @@
+/* -*- C++ -*- $Id$ */
+// generate_export_file.pl,v 1.8 2001/03/04 09:16:29 nanbor Exp
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_RTEVENTLOG_EXPORT_H
+#define TAO_RTEVENTLOG_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (TAO_RTEVENTLOG_HAS_DLL)
+# define TAO_RTEVENTLOG_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && TAO_RTEVENTLOG_HAS_DLL */
+
+#if !defined (TAO_RTEVENTLOG_HAS_DLL)
+# define TAO_RTEVENTLOG_HAS_DLL 1
+#endif /* ! TAO_RTEVENTLOG_HAS_DLL */
+
+#if defined (TAO_RTEVENTLOG_HAS_DLL) && (TAO_RTEVENTLOG_HAS_DLL == 1)
+# if defined (TAO_RTEVENTLOG_BUILD_DLL)
+# define TAO_RTEventLog_Export ACE_Proper_Export_Flag
+# define TAO_RTEVENTLOG_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEVENTLOG_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RTEVENTLOG_BUILD_DLL */
+# define TAO_RTEventLog_Export ACE_Proper_Import_Flag
+# define TAO_RTEVENTLOG_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEVENTLOG_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RTEVENTLOG_BUILD_DLL */
+#else /* TAO_RTEVENTLOG_HAS_DLL == 1 */
+# define TAO_RTEventLog_Export
+# define TAO_RTEVENTLOG_SINGLETON_DECLARATION(T)
+# define TAO_RTEVENTLOG_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RTEVENTLOG_HAS_DLL == 1 */
+
+#endif /* TAO_RTEVENTLOG_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Log/rteventlog_serv_export.h b/TAO/orbsvcs/orbsvcs/Log/rteventlog_serv_export.h
new file mode 100644
index 00000000000..c3791cd48ae
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/rteventlog_serv_export.h
@@ -0,0 +1,37 @@
+/* -*- C++ -*- $Id$ */
+// generate_export_file.pl,v 1.8 2001/03/04 09:16:29 nanbor Exp
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_RTEVENTLOG_SERV_EXPORT_H
+#define TAO_RTEVENTLOG_SERV_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (TAO_RTEVENTLOG_SERV_HAS_DLL)
+# define TAO_RTEVENTLOG_SERV_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && TAO_RTEVENTLOG_SERV_HAS_DLL */
+
+#if !defined (TAO_RTEVENTLOG_SERV_HAS_DLL)
+# define TAO_RTEVENTLOG_SERV_HAS_DLL 1
+#endif /* ! TAO_RTEVENTLOG_SERV_HAS_DLL */
+
+#if defined (TAO_RTEVENTLOG_SERV_HAS_DLL) && (TAO_RTEVENTLOG_SERV_HAS_DLL == 1)
+# if defined (TAO_RTEVENTLOG_SERV_BUILD_DLL)
+# define TAO_RTEventLog_Serv_Export ACE_Proper_Export_Flag
+# define TAO_RTEVENTLOG_SERV_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEVENTLOG_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RTEVENTLOG_SERV_BUILD_DLL */
+# define TAO_RTEventLog_Serv_Export ACE_Proper_Import_Flag
+# define TAO_RTEVENTLOG_SERV_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEVENTLOG_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RTEVENTLOG_SERV_BUILD_DLL */
+#else /* TAO_RTEVENTLOG_SERV_HAS_DLL == 1 */
+# define TAO_RTEventLog_Serv_Export
+# define TAO_RTEVENTLOG_SERV_SINGLETON_DECLARATION(T)
+# define TAO_RTEVENTLOG_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RTEVENTLOG_SERV_HAS_DLL == 1 */
+
+#endif /* TAO_RTEVENTLOG_SERV_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Log/rteventlog_skel_export.h b/TAO/orbsvcs/orbsvcs/Log/rteventlog_skel_export.h
new file mode 100644
index 00000000000..bd0276592f9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Log/rteventlog_skel_export.h
@@ -0,0 +1,37 @@
+/* -*- C++ -*- $Id$ */
+// generate_export_file.pl,v 1.8 2001/03/04 09:16:29 nanbor Exp
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_RTEVENTLOG_SKEL_EXPORT_H
+#define TAO_RTEVENTLOG_SKEL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (TAO_RTEVENTLOG_SKEL_HAS_DLL)
+# define TAO_RTEVENTLOG_SKEL_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && TAO_RTEVENTLOG_SKEL_HAS_DLL */
+
+#if !defined (TAO_RTEVENTLOG_SKEL_HAS_DLL)
+# define TAO_RTEVENTLOG_SKEL_HAS_DLL 1
+#endif /* ! TAO_RTEVENTLOG_SKEL_HAS_DLL */
+
+#if defined (TAO_RTEVENTLOG_SKEL_HAS_DLL) && (TAO_RTEVENTLOG_SKEL_HAS_DLL == 1)
+# if defined (TAO_RTEVENTLOG_SKEL_BUILD_DLL)
+# define TAO_RTEventLog_Skel_Export ACE_Proper_Export_Flag
+# define TAO_RTEVENTLOG_SKEL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEVENTLOG_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RTEVENTLOG_SKEL_BUILD_DLL */
+# define TAO_RTEventLog_Skel_Export ACE_Proper_Import_Flag
+# define TAO_RTEVENTLOG_SKEL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEVENTLOG_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RTEVENTLOG_SKEL_BUILD_DLL */
+#else /* TAO_RTEVENTLOG_SKEL_HAS_DLL == 1 */
+# define TAO_RTEventLog_Skel_Export
+# define TAO_RTEVENTLOG_SKEL_SINGLETON_DECLARATION(T)
+# define TAO_RTEVENTLOG_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RTEVENTLOG_SKEL_HAS_DLL == 1 */
+
+#endif /* TAO_RTEVENTLOG_SKEL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Makefile.am b/TAO/orbsvcs/orbsvcs/Makefile.am
new file mode 100644
index 00000000000..9ba84c529a9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Makefile.am
@@ -0,0 +1,6166 @@
+## 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
+
+includedir = @includedir@/orbsvcs
+pkgconfigdir = @libdir@/pkgconfig
+
+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.CosNaming_IDL.am
+
+BUILT_SOURCES = \
+ CosNamingC.cpp \
+ CosNamingC.h \
+ CosNamingC.inl \
+ CosNamingS.cpp \
+ CosNamingS.h \
+ CosNamingS.inl \
+ CosNamingS_T.cpp \
+ CosNamingS_T.h \
+ CosNamingS_T.inl
+
+CLEANFILES = \
+ CosNaming-stamp \
+ CosNamingC.cpp \
+ CosNamingC.h \
+ CosNamingC.inl \
+ CosNamingS.cpp \
+ CosNamingS.h \
+ CosNamingS.inl \
+ CosNamingS_T.cpp \
+ CosNamingS_T.h \
+ CosNamingS_T.inl
+
+CosNamingC.cpp CosNamingC.h CosNamingC.inl CosNamingS.cpp CosNamingS.h CosNamingS.inl CosNamingS_T.cpp CosNamingS_T.h CosNamingS_T.inl: CosNaming-stamp
+
+CosNaming-stamp: $(srcdir)/CosNaming.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Naming_Export -Wb,stub_export_include=orbsvcs/Naming/naming_export.h -Wb,skel_export_macro=TAO_Naming_Skel_Export -Wb,skel_export_include=orbsvcs/Naming/naming_skel_export.h $(srcdir)/CosNaming.idl
+ @touch $@
+
+
+nobase_include_HEADERS = \
+ CosNaming.idl
+
+## Makefile.CosNaming.am
+
+lib_LTLIBRARIES = libTAO_CosNaming.la
+
+libTAO_CosNaming_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_NAMING_BUILD_DLL
+
+libTAO_CosNaming_la_SOURCES = \
+ CosNamingC.cpp \
+ Naming/Naming_Client.cpp
+
+libTAO_CosNaming_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosNaming_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ CosNamingC.h \
+ CosNamingC.inl \
+ Naming/Naming_Client.h \
+ Naming/naming_export.h
+
+pkgconfig_DATA = \
+ TAO_CosNaming.pc
+
+CLEANFILES += \
+ TAO_CosNaming.pc
+
+TAO_CosNaming.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosNaming.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosNaming.pc.in
+
+EXTRA_DIST = \
+ CosNaming.rc \
+ TAO_CosNaming.pc.in
+
+
+## Makefile.CosProperty_IDL.am
+
+BUILT_SOURCES += \
+ CosPropertyC.cpp \
+ CosPropertyC.h \
+ CosPropertyC.inl \
+ CosPropertyS.cpp \
+ CosPropertyS.h \
+ CosPropertyS.inl \
+ CosPropertyS_T.cpp \
+ CosPropertyS_T.h \
+ CosPropertyS_T.inl
+
+CLEANFILES += \
+ CosProperty-stamp \
+ CosPropertyC.cpp \
+ CosPropertyC.h \
+ CosPropertyC.inl \
+ CosPropertyS.cpp \
+ CosPropertyS.h \
+ CosPropertyS.inl \
+ CosPropertyS_T.cpp \
+ CosPropertyS_T.h \
+ CosPropertyS_T.inl
+
+CosPropertyC.cpp CosPropertyC.h CosPropertyC.inl CosPropertyS.cpp CosPropertyS.h CosPropertyS.inl CosPropertyS_T.cpp CosPropertyS_T.h CosPropertyS_T.inl: CosProperty-stamp
+
+CosProperty-stamp: $(srcdir)/CosProperty.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Property_Export -Wb,stub_export_include=orbsvcs/Property/property_export.h -Wb,skel_export_macro=TAO_Property_Skel_Export -Wb,skel_export_include=orbsvcs/Property/property_skel_export.h $(srcdir)/CosProperty.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ CosPropertyServiceC.cpp \
+ CosPropertyServiceC.h \
+ CosPropertyServiceC.inl \
+ CosPropertyServiceS.cpp \
+ CosPropertyServiceS.h \
+ CosPropertyServiceS.inl \
+ CosPropertyServiceS_T.cpp \
+ CosPropertyServiceS_T.h \
+ CosPropertyServiceS_T.inl
+
+CLEANFILES += \
+ CosPropertyService-stamp \
+ CosPropertyServiceC.cpp \
+ CosPropertyServiceC.h \
+ CosPropertyServiceC.inl \
+ CosPropertyServiceS.cpp \
+ CosPropertyServiceS.h \
+ CosPropertyServiceS.inl \
+ CosPropertyServiceS_T.cpp \
+ CosPropertyServiceS_T.h \
+ CosPropertyServiceS_T.inl
+
+CosPropertyServiceC.cpp CosPropertyServiceC.h CosPropertyServiceC.inl CosPropertyServiceS.cpp CosPropertyServiceS.h CosPropertyServiceS.inl CosPropertyServiceS_T.cpp CosPropertyServiceS_T.h CosPropertyServiceS_T.inl: CosPropertyService-stamp
+
+CosPropertyService-stamp: $(srcdir)/CosPropertyService.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Property_Export -Wb,stub_export_include=orbsvcs/Property/property_export.h -Wb,skel_export_macro=TAO_Property_Skel_Export -Wb,skel_export_include=orbsvcs/Property/property_skel_export.h $(srcdir)/CosPropertyService.idl
+ @touch $@
+
+
+nobase_include_HEADERS += \
+ CosProperty.idl \
+ CosPropertyService.idl
+
+## Makefile.CosProperty.am
+
+lib_LTLIBRARIES += libTAO_CosProperty.la
+
+libTAO_CosProperty_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_PROPERTY_BUILD_DLL
+
+libTAO_CosProperty_la_SOURCES = \
+ CosPropertyC.cpp \
+ CosPropertyServiceC.cpp
+
+libTAO_CosProperty_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosProperty_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ CosPropertyC.h \
+ CosPropertyC.inl \
+ CosPropertyServiceC.h \
+ CosPropertyServiceC.inl \
+ Property/property_export.h
+
+pkgconfig_DATA += \
+ TAO_CosProperty.pc
+
+CLEANFILES += \
+ TAO_CosProperty.pc
+
+TAO_CosProperty.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosProperty.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosProperty.pc.in
+
+EXTRA_DIST += \
+ TAO_CosProperty.pc.in
+
+
+## Makefile.CosProperty_Skel.am
+
+lib_LTLIBRARIES += libTAO_CosProperty_Skel.la
+
+libTAO_CosProperty_Skel_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_PROPERTY_SKEL_BUILD_DLL
+
+libTAO_CosProperty_Skel_la_SOURCES = \
+ CosPropertyS.cpp \
+ CosPropertyServiceS.cpp
+
+libTAO_CosProperty_Skel_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosProperty_Skel_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ CosPropertyS.h \
+ CosPropertyS.inl \
+ CosPropertyS_T.cpp \
+ CosPropertyS_T.h \
+ CosPropertyS_T.inl \
+ CosPropertyServiceS.h \
+ CosPropertyServiceS.inl \
+ CosPropertyServiceS_T.cpp \
+ CosPropertyServiceS_T.h \
+ CosPropertyServiceS_T.inl \
+ Property/property_skel_export.h
+
+pkgconfig_DATA += \
+ TAO_CosProperty_Skel.pc
+
+CLEANFILES += \
+ TAO_CosProperty_Skel.pc
+
+TAO_CosProperty_Skel.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosProperty_Skel.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosProperty_Skel.pc.in
+
+EXTRA_DIST += \
+ TAO_CosProperty_Skel.pc.in
+
+
+## Makefile.CosProperty_Serv.am
+
+lib_LTLIBRARIES += libTAO_CosProperty_Serv.la
+
+libTAO_CosProperty_Serv_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_PROPERTY_SERV_BUILD_DLL
+
+libTAO_CosProperty_Serv_la_SOURCES = \
+ Property/CosPropertyService_i.cpp
+
+libTAO_CosProperty_Serv_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosProperty_Serv_la_LIBADD = \
+ libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Property/CosPropertyService_i.h \
+ Property/property_serv_export.h
+
+pkgconfig_DATA += \
+ TAO_CosProperty_Serv.pc
+
+CLEANFILES += \
+ TAO_CosProperty_Serv.pc
+
+TAO_CosProperty_Serv.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosProperty_Serv.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosProperty_Serv.pc.in
+
+EXTRA_DIST += \
+ TAO_CosProperty_Serv.pc.in
+
+
+## Makefile.AV.am
+
+if !BUILD_ACE_FOR_TAO
+
+BUILT_SOURCES += \
+ AVStreamsC.cpp \
+ AVStreamsC.h \
+ AVStreamsC.inl \
+ AVStreamsS.cpp \
+ AVStreamsS.h \
+ AVStreamsS.inl \
+ AVStreamsS_T.cpp \
+ AVStreamsS_T.inl
+
+CLEANFILES += \
+ AVStreams-stamp \
+ AVStreamsC.cpp \
+ AVStreamsC.h \
+ AVStreamsC.inl \
+ AVStreamsS.cpp \
+ AVStreamsS.h \
+ AVStreamsS.inl \
+ AVStreamsS_T.cpp \
+ AVStreamsS_T.inl
+
+AVStreamsC.cpp AVStreamsC.h AVStreamsC.inl AVStreamsS.cpp AVStreamsS.h AVStreamsS.inl AVStreamsS_T.cpp AVStreamsS_T.inl: AVStreams-stamp
+
+AVStreams-stamp: $(srcdir)/AVStreams.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_AV_Export -Wb,export_include=orbsvcs/AV/AV_export.h $(srcdir)/AVStreams.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ Null_MediaCtrlC.cpp \
+ Null_MediaCtrlC.h \
+ Null_MediaCtrlC.inl \
+ Null_MediaCtrlS.cpp \
+ Null_MediaCtrlS.h \
+ Null_MediaCtrlS.inl \
+ Null_MediaCtrlS_T.cpp \
+ Null_MediaCtrlS_T.inl
+
+CLEANFILES += \
+ Null_MediaCtrl-stamp \
+ Null_MediaCtrlC.cpp \
+ Null_MediaCtrlC.h \
+ Null_MediaCtrlC.inl \
+ Null_MediaCtrlS.cpp \
+ Null_MediaCtrlS.h \
+ Null_MediaCtrlS.inl \
+ Null_MediaCtrlS_T.cpp \
+ Null_MediaCtrlS_T.inl
+
+Null_MediaCtrlC.cpp Null_MediaCtrlC.h Null_MediaCtrlC.inl Null_MediaCtrlS.cpp Null_MediaCtrlS.h Null_MediaCtrlS.inl Null_MediaCtrlS_T.cpp Null_MediaCtrlS_T.inl: Null_MediaCtrl-stamp
+
+Null_MediaCtrl-stamp: $(srcdir)/Null_MediaCtrl.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_AV_Export -Wb,export_include=orbsvcs/AV/AV_export.h $(srcdir)/Null_MediaCtrl.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ sfpC.cpp \
+ sfpC.h \
+ sfpC.inl \
+ sfpS.cpp \
+ sfpS.h \
+ sfpS.inl \
+ sfpS_T.cpp \
+ sfpS_T.inl
+
+CLEANFILES += \
+ sfp-stamp \
+ sfpC.cpp \
+ sfpC.h \
+ sfpC.inl \
+ sfpS.cpp \
+ sfpS.h \
+ sfpS.inl \
+ sfpS_T.cpp \
+ sfpS_T.inl
+
+sfpC.cpp sfpC.h sfpC.inl sfpS.cpp sfpS.h sfpS.inl sfpS_T.cpp sfpS_T.inl: sfp-stamp
+
+sfp-stamp: $(srcdir)/sfp.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_AV_Export -Wb,export_include=orbsvcs/AV/AV_export.h $(srcdir)/sfp.idl
+ @touch $@
+
+lib_LTLIBRARIES += libTAO_AV.la
+
+libTAO_AV_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_AV_BUILD_DLL
+
+libTAO_AV_la_SOURCES = \
+ AV/AVStreams_i.cpp \
+ AV/AV_Core.cpp \
+ AV/Endpoint_Strategy.cpp \
+ AV/Fill_ACE_QoS.cpp \
+ AV/FlowSpec_Entry.cpp \
+ AV/MCast.cpp \
+ AV/Policy.cpp \
+ AV/Protocol_Factory.cpp \
+ AV/QoS_UDP.cpp \
+ AV/RTCP.cpp \
+ AV/RTCP_Channel.cpp \
+ AV/RTCP_Packet.cpp \
+ AV/RTP.cpp \
+ AV/SCTP_SEQ.cpp \
+ AV/TCP.cpp \
+ AV/Transport.cpp \
+ AV/UDP.cpp \
+ AV/default_resource.cpp \
+ AV/md5c.cpp \
+ AV/media_timer.cpp \
+ AV/sfp.cpp \
+ AVStreamsC.cpp \
+ AVStreamsS.cpp \
+ Null_MediaCtrlC.cpp \
+ Null_MediaCtrlS.cpp \
+ sfpC.cpp \
+ sfpS.cpp
+
+libTAO_AV_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_AV_la_LIBADD = \
+ libTAO_CosNaming.la \
+ libTAO_CosProperty_Serv.la \
+ libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ AV/AVStreams_i.h \
+ AV/AVStreams_i.i \
+ AV/AV_Core.h \
+ AV/AV_export.h \
+ AV/Endpoint_Strategy.h \
+ AV/Endpoint_Strategy_T.cpp \
+ AV/Endpoint_Strategy_T.h \
+ AV/Fill_ACE_QoS.h \
+ AV/FlowSpec_Entry.h \
+ AV/FlowSpec_Entry.i \
+ AV/Flows_T.cpp \
+ AV/Flows_T.h \
+ AV/MCast.h \
+ AV/MCast.i \
+ AV/Policy.h \
+ AV/Policy.i \
+ AV/Protocol_Factory.h \
+ AV/QoS_UDP.h \
+ AV/QoS_UDP.i \
+ AV/RTCP.h \
+ AV/RTCP_Channel.h \
+ AV/RTCP_Packet.h \
+ AV/RTP.h \
+ AV/Resource_Factory.h \
+ AV/SCTP_SEQ.h \
+ AV/TCP.h \
+ AV/Transport.h \
+ AV/Transport.i \
+ AV/UDP.h \
+ AV/UDP.i \
+ AV/default_resource.h \
+ AV/global.h \
+ AV/md5.h \
+ AV/media_timer.h \
+ AV/ntp-time.h \
+ AV/sfp.h \
+ AVStreams.idl \
+ AVStreamsC.h \
+ AVStreamsC.inl \
+ AVStreamsS.h \
+ AVStreamsS.inl \
+ AVStreamsS_T.cpp \
+ AVStreamsS_T.inl \
+ Null_MediaCtrl.idl \
+ Null_MediaCtrlC.h \
+ Null_MediaCtrlC.inl \
+ Null_MediaCtrlS.h \
+ Null_MediaCtrlS.inl \
+ Null_MediaCtrlS_T.cpp \
+ Null_MediaCtrlS_T.inl \
+ sfp.idl \
+ sfpC.h \
+ sfpC.inl \
+ sfpS.h \
+ sfpS.inl \
+ sfpS_T.cpp \
+ sfpS_T.inl
+
+endif !BUILD_ACE_FOR_TAO
+
+EXTRA_DIST += \
+ AV.rc
+
+
+## Makefile.CosConcurrency_IDL.am
+
+BUILT_SOURCES += \
+ CosConcurrencyControlC.cpp \
+ CosConcurrencyControlC.h \
+ CosConcurrencyControlC.inl \
+ CosConcurrencyControlS.cpp \
+ CosConcurrencyControlS.h \
+ CosConcurrencyControlS.inl \
+ CosConcurrencyControlS_T.cpp \
+ CosConcurrencyControlS_T.h \
+ CosConcurrencyControlS_T.inl
+
+CLEANFILES += \
+ CosConcurrencyControl-stamp \
+ CosConcurrencyControlC.cpp \
+ CosConcurrencyControlC.h \
+ CosConcurrencyControlC.inl \
+ CosConcurrencyControlS.cpp \
+ CosConcurrencyControlS.h \
+ CosConcurrencyControlS.inl \
+ CosConcurrencyControlS_T.cpp \
+ CosConcurrencyControlS_T.h \
+ CosConcurrencyControlS_T.inl
+
+CosConcurrencyControlC.cpp CosConcurrencyControlC.h CosConcurrencyControlC.inl CosConcurrencyControlS.cpp CosConcurrencyControlS.h CosConcurrencyControlS.inl CosConcurrencyControlS_T.cpp CosConcurrencyControlS_T.h CosConcurrencyControlS_T.inl: CosConcurrencyControl-stamp
+
+CosConcurrencyControl-stamp: $(srcdir)/CosConcurrencyControl.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Concurrency_Export -Wb,stub_export_include=orbsvcs/Concurrency/concurrency_export.h -Wb,skel_export_macro=TAO_Concurrency_Skel_Export -Wb,skel_export_include=orbsvcs/Concurrency/concurrency_skel_export.h $(srcdir)/CosConcurrencyControl.idl
+ @touch $@
+
+
+nobase_include_HEADERS += \
+ CosConcurrencyControl.idl
+
+## Makefile.CosConcurrency.am
+
+lib_LTLIBRARIES += libTAO_CosConcurrency.la
+
+libTAO_CosConcurrency_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_CONCURRENCY_BUILD_DLL
+
+libTAO_CosConcurrency_la_SOURCES = \
+ CosConcurrencyControlC.cpp
+
+libTAO_CosConcurrency_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosConcurrency_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Concurrency/concurrency_export.h \
+ CosConcurrencyControlC.h \
+ CosConcurrencyControlC.inl
+
+pkgconfig_DATA += \
+ TAO_CosConcurrency.pc
+
+CLEANFILES += \
+ TAO_CosConcurrency.pc
+
+TAO_CosConcurrency.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosConcurrency.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosConcurrency.pc.in
+
+EXTRA_DIST += \
+ TAO_CosConcurrency.pc.in
+
+
+## Makefile.CosConcurrency_Skel.am
+
+lib_LTLIBRARIES += libTAO_CosConcurrency_Skel.la
+
+libTAO_CosConcurrency_Skel_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_CONCURRENCY_SKEL_BUILD_DLL
+
+libTAO_CosConcurrency_Skel_la_SOURCES = \
+ CosConcurrencyControlS.cpp
+
+libTAO_CosConcurrency_Skel_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosConcurrency_Skel_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_CosConcurrency.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Concurrency/concurrency_skel_export.h \
+ CosConcurrencyControlS.h \
+ CosConcurrencyControlS.inl
+
+pkgconfig_DATA += \
+ TAO_CosConcurrency_Skel.pc
+
+CLEANFILES += \
+ TAO_CosConcurrency_Skel.pc
+
+TAO_CosConcurrency_Skel.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosConcurrency_Skel.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosConcurrency_Skel.pc.in
+
+EXTRA_DIST += \
+ TAO_CosConcurrency_Skel.pc.in
+
+
+## Makefile.CosConcurrency_Serv.am
+
+lib_LTLIBRARIES += libTAO_CosConcurrency_Serv.la
+
+libTAO_CosConcurrency_Serv_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_CONCURRENCY_SERV_BUILD_DLL
+
+libTAO_CosConcurrency_Serv_la_SOURCES = \
+ Concurrency/CC_Lock.cpp \
+ Concurrency/CC_LockSet.cpp \
+ Concurrency/CC_LockSetFactory.cpp \
+ Concurrency/Concurrency_Loader.cpp \
+ Concurrency/Concurrency_Utils.cpp
+
+libTAO_CosConcurrency_Serv_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosConcurrency_Serv_la_LIBADD = \
+ libTAO_CosConcurrency_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_CosConcurrency.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Concurrency/CC_Lock.h \
+ Concurrency/CC_LockSet.h \
+ Concurrency/CC_LockSetFactory.h \
+ Concurrency/Concurrency_Loader.h \
+ Concurrency/Concurrency_Utils.h \
+ Concurrency/concurrency_serv_export.h
+
+pkgconfig_DATA += \
+ TAO_CosConcurrency_Serv.pc
+
+CLEANFILES += \
+ TAO_CosConcurrency_Serv.pc
+
+TAO_CosConcurrency_Serv.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosConcurrency_Serv.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosConcurrency_Serv.pc.in
+
+EXTRA_DIST += \
+ TAO_CosConcurrency_Serv.pc.in
+
+
+## Makefile.CosEvent_IDL.am
+
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES += \
+ CosTypedEventCommC.cpp \
+ CosTypedEventCommC.h \
+ CosTypedEventCommC.inl \
+ CosTypedEventCommS.cpp \
+ CosTypedEventCommS.h \
+ CosTypedEventCommS.inl \
+ CosTypedEventCommS_T.cpp \
+ CosTypedEventCommS_T.h \
+ CosTypedEventCommS_T.inl
+
+CLEANFILES += \
+ CosTypedEventComm-stamp \
+ CosTypedEventCommC.cpp \
+ CosTypedEventCommC.h \
+ CosTypedEventCommC.inl \
+ CosTypedEventCommS.cpp \
+ CosTypedEventCommS.h \
+ CosTypedEventCommS.inl \
+ CosTypedEventCommS_T.cpp \
+ CosTypedEventCommS_T.h \
+ CosTypedEventCommS_T.inl
+
+CosTypedEventCommC.cpp CosTypedEventCommC.h CosTypedEventCommC.inl CosTypedEventCommS.cpp CosTypedEventCommS.h CosTypedEventCommS.inl CosTypedEventCommS_T.cpp CosTypedEventCommS_T.h CosTypedEventCommS_T.inl: CosTypedEventComm-stamp
+
+CosTypedEventComm-stamp: $(srcdir)/CosTypedEventComm.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,stub_export_macro=TAO_Event_Export -Wb,stub_export_include=orbsvcs/CosEvent/event_export.h -Wb,skel_export_macro=TAO_Event_Skel_Export -Wb,skel_export_include=orbsvcs/CosEvent/event_skel_export.h $(srcdir)/CosTypedEventComm.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ CosTypedEventChannelAdminC.cpp \
+ CosTypedEventChannelAdminC.h \
+ CosTypedEventChannelAdminC.inl \
+ CosTypedEventChannelAdminS.cpp \
+ CosTypedEventChannelAdminS.h \
+ CosTypedEventChannelAdminS.inl \
+ CosTypedEventChannelAdminS_T.cpp \
+ CosTypedEventChannelAdminS_T.h \
+ CosTypedEventChannelAdminS_T.inl
+
+CLEANFILES += \
+ CosTypedEventChannelAdmin-stamp \
+ CosTypedEventChannelAdminC.cpp \
+ CosTypedEventChannelAdminC.h \
+ CosTypedEventChannelAdminC.inl \
+ CosTypedEventChannelAdminS.cpp \
+ CosTypedEventChannelAdminS.h \
+ CosTypedEventChannelAdminS.inl \
+ CosTypedEventChannelAdminS_T.cpp \
+ CosTypedEventChannelAdminS_T.h \
+ CosTypedEventChannelAdminS_T.inl
+
+CosTypedEventChannelAdminC.cpp CosTypedEventChannelAdminC.h CosTypedEventChannelAdminC.inl CosTypedEventChannelAdminS.cpp CosTypedEventChannelAdminS.h CosTypedEventChannelAdminS.inl CosTypedEventChannelAdminS_T.cpp CosTypedEventChannelAdminS_T.h CosTypedEventChannelAdminS_T.inl: CosTypedEventChannelAdmin-stamp
+
+CosTypedEventChannelAdmin-stamp: $(srcdir)/CosTypedEventChannelAdmin.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,stub_export_macro=TAO_Event_Export -Wb,stub_export_include=orbsvcs/CosEvent/event_export.h -Wb,skel_export_macro=TAO_Event_Skel_Export -Wb,skel_export_include=orbsvcs/CosEvent/event_skel_export.h $(srcdir)/CosTypedEventChannelAdmin.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ CosEventCommC.cpp \
+ CosEventCommC.h \
+ CosEventCommC.inl \
+ CosEventCommS.cpp \
+ CosEventCommS.h \
+ CosEventCommS.inl \
+ CosEventCommS_T.cpp \
+ CosEventCommS_T.h \
+ CosEventCommS_T.inl
+
+CLEANFILES += \
+ CosEventComm-stamp \
+ CosEventCommC.cpp \
+ CosEventCommC.h \
+ CosEventCommC.inl \
+ CosEventCommS.cpp \
+ CosEventCommS.h \
+ CosEventCommS.inl \
+ CosEventCommS_T.cpp \
+ CosEventCommS_T.h \
+ CosEventCommS_T.inl
+
+CosEventCommC.cpp CosEventCommC.h CosEventCommC.inl CosEventCommS.cpp CosEventCommS.h CosEventCommS.inl CosEventCommS_T.cpp CosEventCommS_T.h CosEventCommS_T.inl: CosEventComm-stamp
+
+CosEventComm-stamp: $(srcdir)/CosEventComm.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Event_Export -Wb,stub_export_include=orbsvcs/CosEvent/event_export.h -Wb,skel_export_macro=TAO_Event_Skel_Export -Wb,skel_export_include=orbsvcs/CosEvent/event_skel_export.h $(srcdir)/CosEventComm.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ CosEventChannelAdminC.cpp \
+ CosEventChannelAdminC.h \
+ CosEventChannelAdminC.inl \
+ CosEventChannelAdminS.cpp \
+ CosEventChannelAdminS.h \
+ CosEventChannelAdminS.inl \
+ CosEventChannelAdminS_T.cpp \
+ CosEventChannelAdminS_T.h \
+ CosEventChannelAdminS_T.inl
+
+CLEANFILES += \
+ CosEventChannelAdmin-stamp \
+ CosEventChannelAdminC.cpp \
+ CosEventChannelAdminC.h \
+ CosEventChannelAdminC.inl \
+ CosEventChannelAdminS.cpp \
+ CosEventChannelAdminS.h \
+ CosEventChannelAdminS.inl \
+ CosEventChannelAdminS_T.cpp \
+ CosEventChannelAdminS_T.h \
+ CosEventChannelAdminS_T.inl
+
+CosEventChannelAdminC.cpp CosEventChannelAdminC.h CosEventChannelAdminC.inl CosEventChannelAdminS.cpp CosEventChannelAdminS.h CosEventChannelAdminS.inl CosEventChannelAdminS_T.cpp CosEventChannelAdminS_T.h CosEventChannelAdminS_T.inl: CosEventChannelAdmin-stamp
+
+CosEventChannelAdmin-stamp: $(srcdir)/CosEventChannelAdmin.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Event_Export -Wb,stub_export_include=orbsvcs/CosEvent/event_export.h -Wb,skel_export_macro=TAO_Event_Skel_Export -Wb,skel_export_include=orbsvcs/CosEvent/event_skel_export.h $(srcdir)/CosEventChannelAdmin.idl
+ @touch $@
+
+
+nobase_include_HEADERS += \
+ CosEventChannelAdmin.idl \
+ CosEventComm.idl \
+ CosTypedEventChannelAdmin.idl \
+ CosTypedEventComm.idl
+
+endif !BUILD_MINIMUM_CORBA
+
+## Makefile.CosEvent.am
+
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_CosEvent.la
+
+libTAO_CosEvent_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_EVENT_BUILD_DLL
+
+libTAO_CosEvent_la_SOURCES = \
+ CosEventChannelAdminC.cpp \
+ CosEventCommC.cpp \
+ CosTypedEventChannelAdminC.cpp \
+ CosTypedEventCommC.cpp
+
+libTAO_CosEvent_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosEvent_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ CosEvent/event_export.h \
+ CosEventChannelAdminC.h \
+ CosEventChannelAdminC.inl \
+ CosEventCommC.h \
+ CosEventCommC.inl \
+ CosTypedEventChannelAdminC.h \
+ CosTypedEventChannelAdminC.inl \
+ CosTypedEventCommC.h \
+ CosTypedEventCommC.inl
+
+pkgconfig_DATA += \
+ TAO_CosEvent.pc
+
+CLEANFILES += \
+ TAO_CosEvent.pc
+
+TAO_CosEvent.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosEvent.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosEvent.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+
+EXTRA_DIST += \
+ CosEvent.rc \
+ TAO_CosEvent.pc.in
+
+
+## Makefile.Svc_Utils.am
+
+BUILT_SOURCES += \
+ TimeBaseC.cpp \
+ TimeBaseC.h \
+ TimeBaseC.inl \
+ TimeBaseS.cpp \
+ TimeBaseS.h \
+ TimeBaseS.inl \
+ TimeBaseS_T.cpp \
+ TimeBaseS_T.inl
+
+CLEANFILES += \
+ TimeBase-stamp \
+ TimeBaseC.cpp \
+ TimeBaseC.h \
+ TimeBaseC.inl \
+ TimeBaseS.cpp \
+ TimeBaseS.h \
+ TimeBaseS.inl \
+ TimeBaseS_T.cpp \
+ TimeBaseS_T.inl
+
+TimeBaseC.cpp TimeBaseC.h TimeBaseC.inl TimeBaseS.cpp TimeBaseS.h TimeBaseS.inl TimeBaseS_T.cpp TimeBaseS_T.inl: TimeBase-stamp
+
+TimeBase-stamp: $(srcdir)/TimeBase.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_Svc_Utils_Export -Wb,export_include=orbsvcs/svc_utils_export.h $(srcdir)/TimeBase.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ RtecBaseC.cpp \
+ RtecBaseC.h \
+ RtecBaseC.inl \
+ RtecBaseS.cpp \
+ RtecBaseS.h \
+ RtecBaseS.inl \
+ RtecBaseS_T.cpp \
+ RtecBaseS_T.inl
+
+CLEANFILES += \
+ RtecBase-stamp \
+ RtecBaseC.cpp \
+ RtecBaseC.h \
+ RtecBaseC.inl \
+ RtecBaseS.cpp \
+ RtecBaseS.h \
+ RtecBaseS.inl \
+ RtecBaseS_T.cpp \
+ RtecBaseS_T.inl
+
+RtecBaseC.cpp RtecBaseC.h RtecBaseC.inl RtecBaseS.cpp RtecBaseS.h RtecBaseS.inl RtecBaseS_T.cpp RtecBaseS_T.inl: RtecBase-stamp
+
+RtecBase-stamp: $(srcdir)/RtecBase.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_Svc_Utils_Export -Wb,export_include=orbsvcs/svc_utils_export.h $(srcdir)/RtecBase.idl
+ @touch $@
+
+lib_LTLIBRARIES += libTAO_Svc_Utils.la
+
+libTAO_Svc_Utils_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_SVC_UTILS_BUILD_DLL
+
+libTAO_Svc_Utils_la_SOURCES = \
+ IOR_Multicast.cpp \
+ RtecBaseC.cpp \
+ RtecBaseS.cpp \
+ Shutdown_Utilities.cpp \
+ TimeBaseC.cpp \
+ TimeBaseS.cpp \
+ Time_Utilities.cpp
+
+libTAO_Svc_Utils_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_Svc_Utils_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ IOR_Multicast.h \
+ RtecBase.idl \
+ RtecBaseC.h \
+ RtecBaseC.inl \
+ RtecBaseS.h \
+ RtecBaseS.inl \
+ RtecBaseS_T.cpp \
+ RtecBaseS_T.inl \
+ Shutdown_Utilities.h \
+ TimeBase.idl \
+ TimeBaseC.h \
+ TimeBaseC.inl \
+ TimeBaseS.h \
+ TimeBaseS.inl \
+ TimeBaseS_T.cpp \
+ TimeBaseS_T.inl \
+ Time_Utilities.h \
+ Time_Utilities.i \
+ svc_utils_export.h
+
+pkgconfig_DATA += \
+ TAO_Svc_Utils.pc
+
+CLEANFILES += \
+ TAO_Svc_Utils.pc
+
+TAO_Svc_Utils.pc: ${top_builddir}/config.status ${srcdir}/TAO_Svc_Utils.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_Svc_Utils.pc.in
+
+EXTRA_DIST += \
+ Svc_Utils.rc \
+ TAO_Svc_Utils.pc.in
+
+
+## Makefile.CosEvent_Skel.am
+
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_CosEvent_Skel.la
+
+libTAO_CosEvent_Skel_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_EVENT_SKEL_BUILD_DLL
+
+libTAO_CosEvent_Skel_la_SOURCES = \
+ CosEventChannelAdminS.cpp \
+ CosEventCommS.cpp \
+ CosTypedEventChannelAdminS.cpp \
+ CosTypedEventCommS.cpp
+
+libTAO_CosEvent_Skel_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosEvent_Skel_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ CosEvent/event_skel_export.h \
+ CosEventChannelAdminS.h \
+ CosEventChannelAdminS.inl \
+ CosEventChannelAdminS_T.cpp \
+ CosEventChannelAdminS_T.h \
+ CosEventChannelAdminS_T.inl \
+ CosEventCommS.h \
+ CosEventCommS.inl \
+ CosEventCommS_T.cpp \
+ CosEventCommS_T.h \
+ CosEventCommS_T.inl \
+ CosTypedEventChannelAdminS.h \
+ CosTypedEventChannelAdminS.inl \
+ CosTypedEventChannelAdminS_T.cpp \
+ CosTypedEventChannelAdminS_T.h \
+ CosTypedEventChannelAdminS_T.inl \
+ CosTypedEventCommS.h \
+ CosTypedEventCommS.inl \
+ CosTypedEventCommS_T.cpp \
+ CosTypedEventCommS_T.h \
+ CosTypedEventCommS_T.inl
+
+pkgconfig_DATA += \
+ TAO_CosEvent_Skel.pc
+
+CLEANFILES += \
+ TAO_CosEvent_Skel.pc
+
+TAO_CosEvent_Skel.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosEvent_Skel.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosEvent_Skel.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+
+EXTRA_DIST += \
+ CosEvent_Skel.rc \
+ TAO_CosEvent_Skel.pc.in
+
+
+## Makefile.CosEvent_Serv.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_CosEvent_Serv.la
+
+libTAO_CosEvent_Serv_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_EVENT_SERV_BUILD_DLL
+
+libTAO_CosEvent_Serv_la_SOURCES = \
+ CosEvent/CEC_ConsumerAdmin.cpp \
+ CosEvent/CEC_ConsumerControl.cpp \
+ CosEvent/CEC_Default_Factory.cpp \
+ CosEvent/CEC_Dispatching.cpp \
+ CosEvent/CEC_Dispatching_Task.cpp \
+ CosEvent/CEC_DynamicImplementation.cpp \
+ CosEvent/CEC_EventChannel.cpp \
+ CosEvent/CEC_Event_Loader.cpp \
+ CosEvent/CEC_Factory.cpp \
+ CosEvent/CEC_MT_Dispatching.cpp \
+ CosEvent/CEC_ProxyPullConsumer.cpp \
+ CosEvent/CEC_ProxyPullSupplier.cpp \
+ CosEvent/CEC_ProxyPushConsumer.cpp \
+ CosEvent/CEC_ProxyPushSupplier.cpp \
+ CosEvent/CEC_Pulling_Strategy.cpp \
+ CosEvent/CEC_Reactive_ConsumerControl.cpp \
+ CosEvent/CEC_Reactive_Pulling_Strategy.cpp \
+ CosEvent/CEC_Reactive_SupplierControl.cpp \
+ CosEvent/CEC_SupplierAdmin.cpp \
+ CosEvent/CEC_SupplierControl.cpp \
+ CosEvent/CEC_TypedConsumerAdmin.cpp \
+ CosEvent/CEC_TypedEvent.cpp \
+ CosEvent/CEC_TypedEventChannel.cpp \
+ CosEvent/CEC_TypedProxyPushConsumer.cpp \
+ CosEvent/CEC_TypedSupplierAdmin.cpp
+
+libTAO_CosEvent_Serv_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosEvent_Serv_la_LIBADD = \
+ libTAO_Svc_Utils.la \
+ 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 \
+ libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ CosEvent/CEC_ConsumerAdmin.h \
+ CosEvent/CEC_ConsumerAdmin.i \
+ CosEvent/CEC_ConsumerControl.h \
+ CosEvent/CEC_Default_Factory.h \
+ CosEvent/CEC_Default_Factory.i \
+ CosEvent/CEC_Defaults.h \
+ CosEvent/CEC_Dispatching.h \
+ CosEvent/CEC_Dispatching_Task.h \
+ CosEvent/CEC_Dispatching_Task.i \
+ CosEvent/CEC_DynamicImplementation.h \
+ CosEvent/CEC_DynamicImplementation.i \
+ CosEvent/CEC_EventChannel.h \
+ CosEvent/CEC_EventChannel.i \
+ CosEvent/CEC_Event_Loader.h \
+ CosEvent/CEC_Factory.h \
+ CosEvent/CEC_MT_Dispatching.h \
+ CosEvent/CEC_ProxyPullConsumer.h \
+ CosEvent/CEC_ProxyPullConsumer.i \
+ CosEvent/CEC_ProxyPullSupplier.h \
+ CosEvent/CEC_ProxyPullSupplier.i \
+ CosEvent/CEC_ProxyPushConsumer.h \
+ CosEvent/CEC_ProxyPushConsumer.i \
+ CosEvent/CEC_ProxyPushSupplier.h \
+ CosEvent/CEC_ProxyPushSupplier.i \
+ CosEvent/CEC_Pulling_Strategy.h \
+ CosEvent/CEC_Reactive_ConsumerControl.h \
+ CosEvent/CEC_Reactive_ConsumerControl.i \
+ CosEvent/CEC_Reactive_Pulling_Strategy.h \
+ CosEvent/CEC_Reactive_Pulling_Strategy.i \
+ CosEvent/CEC_Reactive_SupplierControl.h \
+ CosEvent/CEC_Reactive_SupplierControl.i \
+ CosEvent/CEC_SupplierAdmin.h \
+ CosEvent/CEC_SupplierAdmin.i \
+ CosEvent/CEC_SupplierControl.h \
+ CosEvent/CEC_TypedConsumerAdmin.h \
+ CosEvent/CEC_TypedConsumerAdmin.i \
+ CosEvent/CEC_TypedEvent.h \
+ CosEvent/CEC_TypedEvent.i \
+ CosEvent/CEC_TypedEventChannel.h \
+ CosEvent/CEC_TypedEventChannel.i \
+ CosEvent/CEC_TypedProxyPushConsumer.h \
+ CosEvent/CEC_TypedProxyPushConsumer.i \
+ CosEvent/CEC_TypedSupplierAdmin.h \
+ CosEvent/CEC_TypedSupplierAdmin.i \
+ CosEvent/event_serv_export.h
+
+pkgconfig_DATA += \
+ TAO_CosEvent_Serv.pc
+
+CLEANFILES += \
+ TAO_CosEvent_Serv.pc
+
+TAO_CosEvent_Serv.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosEvent_Serv.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosEvent_Serv.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+EXTRA_DIST += \
+ CosEvent_Serv.rc \
+ TAO_CosEvent_Serv.pc.in
+
+
+## Makefile.CosLifeCycle.am
+
+BUILT_SOURCES += \
+ CosLifeCycleC.cpp \
+ CosLifeCycleC.h \
+ CosLifeCycleC.inl \
+ CosLifeCycleS.cpp \
+ CosLifeCycleS.h \
+ CosLifeCycleS.inl \
+ CosLifeCycleS_T.cpp \
+ CosLifeCycleS_T.h \
+ CosLifeCycleS_T.inl
+
+CLEANFILES += \
+ CosLifeCycle-stamp \
+ CosLifeCycleC.cpp \
+ CosLifeCycleC.h \
+ CosLifeCycleC.inl \
+ CosLifeCycleS.cpp \
+ CosLifeCycleS.h \
+ CosLifeCycleS.inl \
+ CosLifeCycleS_T.cpp \
+ CosLifeCycleS_T.h \
+ CosLifeCycleS_T.inl
+
+CosLifeCycleC.cpp CosLifeCycleC.h CosLifeCycleC.inl CosLifeCycleS.cpp CosLifeCycleS.h CosLifeCycleS.inl CosLifeCycleS_T.cpp CosLifeCycleS_T.h CosLifeCycleS_T.inl: CosLifeCycle-stamp
+
+CosLifeCycle-stamp: $(srcdir)/CosLifeCycle.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_LifeCycle_Export -Wb,export_include=orbsvcs/LifeCycle/lifecycle_export.h $(srcdir)/CosLifeCycle.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ LifeCycleServiceC.cpp \
+ LifeCycleServiceC.h \
+ LifeCycleServiceC.inl \
+ LifeCycleServiceS.cpp \
+ LifeCycleServiceS.h \
+ LifeCycleServiceS.inl \
+ LifeCycleServiceS_T.cpp \
+ LifeCycleServiceS_T.h \
+ LifeCycleServiceS_T.inl
+
+CLEANFILES += \
+ LifeCycleService-stamp \
+ LifeCycleServiceC.cpp \
+ LifeCycleServiceC.h \
+ LifeCycleServiceC.inl \
+ LifeCycleServiceS.cpp \
+ LifeCycleServiceS.h \
+ LifeCycleServiceS.inl \
+ LifeCycleServiceS_T.cpp \
+ LifeCycleServiceS_T.h \
+ LifeCycleServiceS_T.inl
+
+LifeCycleServiceC.cpp LifeCycleServiceC.h LifeCycleServiceC.inl LifeCycleServiceS.cpp LifeCycleServiceS.h LifeCycleServiceS.inl LifeCycleServiceS_T.cpp LifeCycleServiceS_T.h LifeCycleServiceS_T.inl: LifeCycleService-stamp
+
+LifeCycleService-stamp: $(srcdir)/LifeCycleService.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_LifeCycle_Export -Wb,export_include=orbsvcs/LifeCycle/lifecycle_export.h $(srcdir)/LifeCycleService.idl
+ @touch $@
+
+lib_LTLIBRARIES += libTAO_CosLifeCycle.la
+
+libTAO_CosLifeCycle_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_LIFECYCLE_BUILD_DLL
+
+libTAO_CosLifeCycle_la_SOURCES = \
+ CosLifeCycleC.cpp \
+ CosLifeCycleS.cpp \
+ LifeCycleServiceC.cpp \
+ LifeCycleServiceS.cpp
+
+libTAO_CosLifeCycle_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosLifeCycle_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ CosLifeCycle.idl \
+ CosLifeCycleC.h \
+ CosLifeCycleC.inl \
+ CosLifeCycleS.h \
+ CosLifeCycleS.inl \
+ CosLifeCycleS_T.cpp \
+ CosLifeCycleS_T.h \
+ CosLifeCycleS_T.inl \
+ LifeCycleService.idl \
+ LifeCycleServiceC.h \
+ LifeCycleServiceC.inl \
+ LifeCycleServiceS.h \
+ LifeCycleServiceS.inl \
+ LifeCycleServiceS_T.cpp \
+ LifeCycleServiceS_T.h \
+ LifeCycleServiceS_T.inl
+
+pkgconfig_DATA += \
+ TAO_CosLifeCycle.pc
+
+CLEANFILES += \
+ TAO_CosLifeCycle.pc
+
+TAO_CosLifeCycle.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosLifeCycle.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosLifeCycle.pc.in
+
+EXTRA_DIST += \
+ CosLifeCycle.rc \
+ TAO_CosLifeCycle.pc.in
+
+
+## Makefile.PortableGroup.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES += \
+ miopC.cpp \
+ miopC.h \
+ miopC.inl \
+ miopS.cpp \
+ miopS.h \
+ miopS.inl \
+ miopS_T.cpp \
+ miopS_T.inl
+
+CLEANFILES += \
+ miop-stamp \
+ miopC.cpp \
+ miopC.h \
+ miopC.inl \
+ miopS.cpp \
+ miopS.h \
+ miopS.inl \
+ miopS_T.cpp \
+ miopS_T.inl
+
+miopC.cpp miopC.h miopC.inl miopS.cpp miopS.h miopS.inl miopS_T.cpp miopS_T.inl: miop-stamp
+
+miop-stamp: $(srcdir)/miop.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_PortableGroup_Export -Wb,export_include=orbsvcs/PortableGroup/portablegroup_export.h $(srcdir)/miop.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ PortableGroup_Simple_DSC.cpp \
+ PortableGroup_Simple_DSC.h \
+ PortableGroup_Simple_DSC.inl \
+ PortableGroup_Simple_DSS.inl \
+ PortableGroup_Simple_DSS_T.inl
+
+CLEANFILES += \
+ PortableGroup_Simple_DS-stamp \
+ PortableGroup_Simple_DSC.cpp \
+ PortableGroup_Simple_DSC.h \
+ PortableGroup_Simple_DSC.inl \
+ PortableGroup_Simple_DSS.inl \
+ PortableGroup_Simple_DSS_T.inl
+
+PortableGroup_Simple_DSC.cpp PortableGroup_Simple_DSC.h PortableGroup_Simple_DSC.inl PortableGroup_Simple_DSS.inl PortableGroup_Simple_DSS_T.inl: PortableGroup_Simple_DS-stamp
+
+PortableGroup_Simple_DS-stamp: $(srcdir)/PortableGroup_Simple_DS.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_PortableGroup_Export -Wb,export_include=orbsvcs/PortableGroup/portablegroup_export.h $(srcdir)/PortableGroup_Simple_DS.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ PortableGroupC.cpp \
+ PortableGroupC.h \
+ PortableGroupC.inl \
+ PortableGroupS.cpp \
+ PortableGroupS.h \
+ PortableGroupS.inl \
+ PortableGroupS_T.cpp \
+ PortableGroupS_T.inl
+
+CLEANFILES += \
+ PortableGroup-stamp \
+ PortableGroupC.cpp \
+ PortableGroupC.h \
+ PortableGroupC.inl \
+ PortableGroupS.cpp \
+ PortableGroupS.h \
+ PortableGroupS.inl \
+ PortableGroupS_T.cpp \
+ PortableGroupS_T.inl
+
+PortableGroupC.cpp PortableGroupC.h PortableGroupC.inl PortableGroupS.cpp PortableGroupS.h PortableGroupS.inl PortableGroupS_T.cpp PortableGroupS_T.inl: PortableGroup-stamp
+
+PortableGroup-stamp: $(srcdir)/PortableGroup.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_PortableGroup_Export -Wb,export_include=orbsvcs/PortableGroup/portablegroup_export.h -GC $(srcdir)/PortableGroup.idl
+ @touch $@
+
+lib_LTLIBRARIES += libTAO_PortableGroup.la
+
+libTAO_PortableGroup_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_PORTABLEGROUP_BUILD_DLL
+
+libTAO_PortableGroup_la_SOURCES = \
+ PortableGroup/GOA.cpp \
+ PortableGroup/MIOP.cpp \
+ PortableGroup/PG_Default_Property_Validator.cpp \
+ PortableGroup/PG_FactoryRegistry.cpp \
+ PortableGroup/PG_GenericFactory.cpp \
+ PortableGroup/PG_Group_Factory.cpp \
+ PortableGroup/PG_Group_Guard.cpp \
+ PortableGroup/PG_Location_Equal_To.cpp \
+ PortableGroup/PG_Location_Hash.cpp \
+ PortableGroup/PG_MemberInfo.cpp \
+ PortableGroup/PG_Null_Property_Validator.cpp \
+ PortableGroup/PG_ObjectGroupManager.cpp \
+ PortableGroup/PG_Object_Adapter_Factory.cpp \
+ PortableGroup/PG_Object_Group.cpp \
+ PortableGroup/PG_Object_Group_Manipulator.cpp \
+ PortableGroup/PG_Operators.cpp \
+ PortableGroup/PG_Properties_Encoder.cpp \
+ PortableGroup/PG_Properties_Support.cpp \
+ PortableGroup/PG_PropertyManager.cpp \
+ PortableGroup/PG_Property_Set.cpp \
+ PortableGroup/PG_Property_Utils.cpp \
+ PortableGroup/PG_Servant_Dispatcher.cpp \
+ PortableGroup/PG_Utils.cpp \
+ PortableGroup/PortableGroup_Acceptor_Registry.cpp \
+ PortableGroup/PortableGroup_Loader.cpp \
+ PortableGroup/PortableGroup_ORBInitializer.cpp \
+ PortableGroup/PortableGroup_Request_Dispatcher.cpp \
+ PortableGroup/Portable_Group_Map.cpp \
+ PortableGroup/UIPMC_Acceptor.cpp \
+ PortableGroup/UIPMC_Connection_Handler.cpp \
+ PortableGroup/UIPMC_Connector.cpp \
+ PortableGroup/UIPMC_Endpoint.cpp \
+ PortableGroup/UIPMC_Factory.cpp \
+ PortableGroup/UIPMC_Message_Block_Data_Iterator.cpp \
+ PortableGroup/UIPMC_Profile.cpp \
+ PortableGroup/UIPMC_Transport.cpp \
+ PortableGroup/UIPMC_Wait_Never.cpp \
+ PortableGroupC.cpp \
+ PortableGroupS.cpp \
+ PortableGroup_Simple_DSC.cpp \
+ miopC.cpp \
+ miopS.cpp
+
+libTAO_PortableGroup_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_PortableGroup_la_LIBADD = \
+ $(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_IORManip.la \
+ libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ PortableGroup.idl \
+ PortableGroup/GOA.h \
+ PortableGroup/MIOP.h \
+ PortableGroup/PG_Default_Property_Validator.h \
+ PortableGroup/PG_FactoryRegistry.h \
+ PortableGroup/PG_GenericFactory.h \
+ PortableGroup/PG_Group_Factory.h \
+ PortableGroup/PG_Group_Guard.h \
+ PortableGroup/PG_Location_Equal_To.h \
+ PortableGroup/PG_Location_Equal_To.inl \
+ PortableGroup/PG_Location_Hash.h \
+ PortableGroup/PG_Location_Hash.inl \
+ PortableGroup/PG_MemberInfo.h \
+ PortableGroup/PG_Null_Property_Validator.h \
+ PortableGroup/PG_ObjectGroupManager.h \
+ PortableGroup/PG_Object_Adapter_Factory.h \
+ PortableGroup/PG_Object_Group.h \
+ PortableGroup/PG_Object_Group_Manipulator.h \
+ PortableGroup/PG_Operators.h \
+ PortableGroup/PG_Properties_Encoder.h \
+ PortableGroup/PG_Properties_Encoder.inl \
+ PortableGroup/PG_Properties_Support.h \
+ PortableGroup/PG_PropertyManager.h \
+ PortableGroup/PG_Property_Set.h \
+ PortableGroup/PG_Property_Utils.h \
+ PortableGroup/PG_Servant_Dispatcher.h \
+ PortableGroup/PG_Utils.h \
+ PortableGroup/PortableGroup_Acceptor_Registry.h \
+ PortableGroup/PortableGroup_Loader.h \
+ PortableGroup/PortableGroup_ORBInitializer.h \
+ PortableGroup/PortableGroup_Request_Dispatcher.h \
+ PortableGroup/Portable_Group_Map.h \
+ PortableGroup/UIPMC_Acceptor.h \
+ PortableGroup/UIPMC_Acceptor.i \
+ PortableGroup/UIPMC_Connection_Handler.h \
+ PortableGroup/UIPMC_Connector.h \
+ PortableGroup/UIPMC_Endpoint.h \
+ PortableGroup/UIPMC_Endpoint.i \
+ PortableGroup/UIPMC_Factory.h \
+ PortableGroup/UIPMC_Message_Block_Data_Iterator.h \
+ PortableGroup/UIPMC_Profile.h \
+ PortableGroup/UIPMC_Transport.h \
+ PortableGroup/UIPMC_Wait_Never.h \
+ PortableGroup/portablegroup_export.h \
+ PortableGroupC.h \
+ PortableGroupC.inl \
+ PortableGroupS.h \
+ PortableGroupS.inl \
+ PortableGroupS_T.cpp \
+ PortableGroupS_T.inl \
+ PortableGroup_Simple_DS.idl \
+ PortableGroup_Simple_DSC.h \
+ PortableGroup_Simple_DSC.inl \
+ PortableGroup_Simple_DSS.inl \
+ PortableGroup_Simple_DSS_T.inl \
+ miop.idl \
+ miopC.h \
+ miopC.inl \
+ miopS.h \
+ miopS.inl \
+ miopS_T.cpp \
+ miopS_T.inl
+
+pkgconfig_DATA += \
+ TAO_PortableGroup.pc
+
+CLEANFILES += \
+ TAO_PortableGroup.pc
+
+TAO_PortableGroup.pc: ${top_builddir}/config.status ${srcdir}/TAO_PortableGroup.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_PortableGroup.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+EXTRA_DIST += \
+ PortableGroup.rc \
+ TAO_PortableGroup.pc.in
+
+
+## Makefile.CosLoadBalancing.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES += \
+ CosLoadBalancingC.cpp \
+ CosLoadBalancingC.h \
+ CosLoadBalancingC.inl \
+ CosLoadBalancingS.cpp \
+ CosLoadBalancingS.h \
+ CosLoadBalancingS.inl \
+ CosLoadBalancingS_T.cpp \
+ CosLoadBalancingS_T.h \
+ CosLoadBalancingS_T.inl
+
+CLEANFILES += \
+ CosLoadBalancing-stamp \
+ CosLoadBalancingC.cpp \
+ CosLoadBalancingC.h \
+ CosLoadBalancingC.inl \
+ CosLoadBalancingS.cpp \
+ CosLoadBalancingS.h \
+ CosLoadBalancingS.inl \
+ CosLoadBalancingS_T.cpp \
+ CosLoadBalancingS_T.h \
+ CosLoadBalancingS_T.inl
+
+CosLoadBalancingC.cpp CosLoadBalancingC.h CosLoadBalancingC.inl CosLoadBalancingS.cpp CosLoadBalancingS.h CosLoadBalancingS.inl CosLoadBalancingS_T.cpp CosLoadBalancingS_T.h CosLoadBalancingS_T.inl: CosLoadBalancing-stamp
+
+CosLoadBalancing-stamp: $(srcdir)/CosLoadBalancing.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -GC -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_LoadBalancing_Export -Wb,export_include=orbsvcs/LoadBalancing/LoadBalancing_export.h $(srcdir)/CosLoadBalancing.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ LB_ORTC.cpp \
+ LB_ORTC.h \
+ LB_ORTC.inl \
+ LB_ORTS.h \
+ LB_ORTS.inl \
+ LB_ORTS_T.h \
+ LB_ORTS_T.inl
+
+CLEANFILES += \
+ LB_ORT-stamp \
+ LB_ORTC.cpp \
+ LB_ORTC.h \
+ LB_ORTC.inl \
+ LB_ORTS.h \
+ LB_ORTS.inl \
+ LB_ORTS_T.h \
+ LB_ORTS_T.inl
+
+LB_ORTC.cpp LB_ORTC.h LB_ORTC.inl LB_ORTS.h LB_ORTS.inl LB_ORTS_T.h LB_ORTS_T.inl: LB_ORT-stamp
+
+LB_ORT-stamp: $(srcdir)/LB_ORT.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -GC -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_LoadBalancing_Export -Wb,export_include=orbsvcs/LoadBalancing/LoadBalancing_export.h $(srcdir)/LB_ORT.idl
+ @touch $@
+
+lib_LTLIBRARIES += libTAO_CosLoadBalancing.la
+
+libTAO_CosLoadBalancing_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_LOADBALANCING_BUILD_DLL
+
+libTAO_CosLoadBalancing_la_SOURCES = \
+ CosLoadBalancingC.cpp \
+ CosLoadBalancingS.cpp \
+ LB_ORTC.cpp \
+ LoadBalancing/LB_CPU_Load_Average_Monitor.cpp \
+ LoadBalancing/LB_CPU_Utilization_Monitor.cpp \
+ LoadBalancing/LB_ClientComponent.cpp \
+ LoadBalancing/LB_ClientORBInitializer.cpp \
+ LoadBalancing/LB_ClientRequestInterceptor.cpp \
+ LoadBalancing/LB_Component.cpp \
+ LoadBalancing/LB_IORInterceptor.cpp \
+ LoadBalancing/LB_LeastLoaded.cpp \
+ LoadBalancing/LB_LoadAlert.cpp \
+ LoadBalancing/LB_LoadAlertInfo.cpp \
+ LoadBalancing/LB_LoadAlert_Handler.cpp \
+ LoadBalancing/LB_LoadAverage.cpp \
+ LoadBalancing/LB_LoadManager.cpp \
+ LoadBalancing/LB_LoadMinimum.cpp \
+ LoadBalancing/LB_MemberLocator.cpp \
+ LoadBalancing/LB_ORBInitializer.cpp \
+ LoadBalancing/LB_ObjectReferenceFactory.cpp \
+ LoadBalancing/LB_Pull_Handler.cpp \
+ LoadBalancing/LB_Random.cpp \
+ LoadBalancing/LB_RoundRobin.cpp \
+ LoadBalancing/LB_ServerRequestInterceptor.cpp
+
+libTAO_CosLoadBalancing_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosLoadBalancing_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORInterceptor.la \
+ $(TAO_BUILDDIR)/tao/libTAO_ObjRefTemplate.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ 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_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ CosLoadBalancing.idl \
+ CosLoadBalancingC.h \
+ CosLoadBalancingC.inl \
+ CosLoadBalancingS.h \
+ CosLoadBalancingS.inl \
+ CosLoadBalancingS_T.cpp \
+ CosLoadBalancingS_T.h \
+ CosLoadBalancingS_T.inl \
+ LB_ORT.idl \
+ LB_ORTC.h \
+ LB_ORTC.inl \
+ LB_ORTS.h \
+ LB_ORTS.inl \
+ LB_ORTS_T.h \
+ LB_ORTS_T.inl \
+ LoadBalancing/LB_CPU_Load_Average_Monitor.h \
+ LoadBalancing/LB_CPU_Utilization_Monitor.h \
+ LoadBalancing/LB_ClientComponent.h \
+ LoadBalancing/LB_ClientORBInitializer.h \
+ LoadBalancing/LB_ClientRequestInterceptor.h \
+ LoadBalancing/LB_Component.h \
+ LoadBalancing/LB_IORInterceptor.h \
+ LoadBalancing/LB_LeastLoaded.h \
+ LoadBalancing/LB_LeastLoaded.inl \
+ LoadBalancing/LB_LoadAlert.h \
+ LoadBalancing/LB_LoadAlert.inl \
+ LoadBalancing/LB_LoadAlertInfo.h \
+ LoadBalancing/LB_LoadAlert_Handler.h \
+ LoadBalancing/LB_LoadAverage.h \
+ LoadBalancing/LB_LoadAverage.inl \
+ LoadBalancing/LB_LoadManager.h \
+ LoadBalancing/LB_LoadMinimum.h \
+ LoadBalancing/LB_LoadMinimum.inl \
+ LoadBalancing/LB_MemberLocator.h \
+ LoadBalancing/LB_ORBInitializer.h \
+ LoadBalancing/LB_ObjectReferenceFactory.h \
+ LoadBalancing/LB_Pull_Handler.h \
+ LoadBalancing/LB_Random.h \
+ LoadBalancing/LB_RoundRobin.h \
+ LoadBalancing/LB_ServerRequestInterceptor.h
+
+pkgconfig_DATA += \
+ TAO_CosLoadBalancing.pc
+
+CLEANFILES += \
+ TAO_CosLoadBalancing.pc
+
+TAO_CosLoadBalancing.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosLoadBalancing.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosLoadBalancing.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+endif BUILD_AMI
+
+EXTRA_DIST += \
+ CosLoadBalancing.rc \
+ TAO_CosLoadBalancing.pc.in
+
+
+## Makefile.CosNaming_Skel.am
+
+lib_LTLIBRARIES += libTAO_CosNaming_Skel.la
+
+libTAO_CosNaming_Skel_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_NAMING_SKEL_BUILD_DLL
+
+libTAO_CosNaming_Skel_la_SOURCES = \
+ CosNamingS.cpp
+
+libTAO_CosNaming_Skel_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosNaming_Skel_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ CosNamingS.h \
+ CosNamingS.inl \
+ CosNamingS_T.cpp \
+ CosNamingS_T.h \
+ CosNamingS_T.inl \
+ Naming/naming_skel_export.h
+
+pkgconfig_DATA += \
+ TAO_CosNaming_Skel.pc
+
+CLEANFILES += \
+ TAO_CosNaming_Skel.pc
+
+TAO_CosNaming_Skel.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosNaming_Skel.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosNaming_Skel.pc.in
+
+EXTRA_DIST += \
+ CosNaming_Skel.rc \
+ TAO_CosNaming_Skel.pc.in
+
+
+## Makefile.CosNaming_Serv.am
+
+if !BUILD_ACE_FOR_TAO
+
+lib_LTLIBRARIES += libTAO_CosNaming_Serv.la
+
+libTAO_CosNaming_Serv_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_NAMING_SERV_BUILD_DLL
+
+libTAO_CosNaming_Serv_la_SOURCES = \
+ Naming/Entries.cpp \
+ Naming/Flat_File_Persistence.cpp \
+ Naming/Hash_Naming_Context.cpp \
+ Naming/Naming_Context_Interface.cpp \
+ Naming/Naming_Loader.cpp \
+ Naming/Naming_Server.cpp \
+ Naming/Persistent_Context_Index.cpp \
+ Naming/Persistent_Entries.cpp \
+ Naming/Persistent_Naming_Context.cpp \
+ Naming/Storable.cpp \
+ Naming/Storable_Naming_Context.cpp \
+ Naming/Storable_Naming_Context_Activator.cpp \
+ Naming/Transient_Naming_Context.cpp
+
+libTAO_CosNaming_Serv_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosNaming_Serv_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ 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_Valuetype.la \
+ libTAO_CosNaming_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Naming/Entries.h \
+ Naming/Flat_File_Persistence.h \
+ Naming/Hash_Naming_Context.h \
+ Naming/Naming_Context_Interface.h \
+ Naming/Naming_Loader.h \
+ Naming/Naming_Server.h \
+ Naming/Persistent_Context_Index.h \
+ Naming/Persistent_Entries.h \
+ Naming/Persistent_Naming_Context.h \
+ Naming/Storable.h \
+ Naming/Storable.inl \
+ Naming/Storable_Naming_Context.h \
+ Naming/Storable_Naming_Context_Activator.h \
+ Naming/Transient_Naming_Context.h \
+ Naming/naming_serv_export.h \
+ Naming/nsconf.h
+
+pkgconfig_DATA += \
+ TAO_CosNaming_Serv.pc
+
+CLEANFILES += \
+ TAO_CosNaming_Serv.pc
+
+TAO_CosNaming_Serv.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosNaming_Serv.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosNaming_Serv.pc.in
+
+endif !BUILD_ACE_FOR_TAO
+
+EXTRA_DIST += \
+ CosNaming_Serv.rc \
+ TAO_CosNaming_Serv.pc.in
+
+
+## Makefile.CosNotification_IDL.am
+
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES += \
+ CosNotificationC.cpp \
+ CosNotificationC.h \
+ CosNotificationC.inl \
+ CosNotificationS.cpp \
+ CosNotificationS.h \
+ CosNotificationS.inl \
+ CosNotificationS_T.cpp \
+ CosNotificationS_T.h \
+ CosNotificationS_T.inl
+
+CLEANFILES += \
+ CosNotification-stamp \
+ CosNotificationC.cpp \
+ CosNotificationC.h \
+ CosNotificationC.inl \
+ CosNotificationS.cpp \
+ CosNotificationS.h \
+ CosNotificationS.inl \
+ CosNotificationS_T.cpp \
+ CosNotificationS_T.h \
+ CosNotificationS_T.inl
+
+CosNotificationC.cpp CosNotificationC.h CosNotificationC.inl CosNotificationS.cpp CosNotificationS.h CosNotificationS.inl CosNotificationS_T.cpp CosNotificationS_T.h CosNotificationS_T.inl: CosNotification-stamp
+
+CosNotification-stamp: $(srcdir)/CosNotification.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Notify_Export -Wb,stub_export_include=orbsvcs/Notify/notify_export.h -Wb,skel_export_macro=TAO_Notify_Skel_Export -Wb,skel_export_include=orbsvcs/Notify/notify_skel_export.h $(srcdir)/CosNotification.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ CosNotifyCommC.cpp \
+ CosNotifyCommC.h \
+ CosNotifyCommC.inl \
+ CosNotifyCommS.cpp \
+ CosNotifyCommS.h \
+ CosNotifyCommS.inl \
+ CosNotifyCommS_T.cpp \
+ CosNotifyCommS_T.h \
+ CosNotifyCommS_T.inl
+
+CLEANFILES += \
+ CosNotifyComm-stamp \
+ CosNotifyCommC.cpp \
+ CosNotifyCommC.h \
+ CosNotifyCommC.inl \
+ CosNotifyCommS.cpp \
+ CosNotifyCommS.h \
+ CosNotifyCommS.inl \
+ CosNotifyCommS_T.cpp \
+ CosNotifyCommS_T.h \
+ CosNotifyCommS_T.inl
+
+CosNotifyCommC.cpp CosNotifyCommC.h CosNotifyCommC.inl CosNotifyCommS.cpp CosNotifyCommS.h CosNotifyCommS.inl CosNotifyCommS_T.cpp CosNotifyCommS_T.h CosNotifyCommS_T.inl: CosNotifyComm-stamp
+
+CosNotifyComm-stamp: $(srcdir)/CosNotifyComm.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Notify_Export -Wb,stub_export_include=orbsvcs/Notify/notify_export.h -Wb,skel_export_macro=TAO_Notify_Skel_Export -Wb,skel_export_include=orbsvcs/Notify/notify_skel_export.h $(srcdir)/CosNotifyComm.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ CosNotifyFilterC.cpp \
+ CosNotifyFilterC.h \
+ CosNotifyFilterC.inl \
+ CosNotifyFilterS.cpp \
+ CosNotifyFilterS.h \
+ CosNotifyFilterS.inl \
+ CosNotifyFilterS_T.cpp \
+ CosNotifyFilterS_T.h \
+ CosNotifyFilterS_T.inl
+
+CLEANFILES += \
+ CosNotifyFilter-stamp \
+ CosNotifyFilterC.cpp \
+ CosNotifyFilterC.h \
+ CosNotifyFilterC.inl \
+ CosNotifyFilterS.cpp \
+ CosNotifyFilterS.h \
+ CosNotifyFilterS.inl \
+ CosNotifyFilterS_T.cpp \
+ CosNotifyFilterS_T.h \
+ CosNotifyFilterS_T.inl
+
+CosNotifyFilterC.cpp CosNotifyFilterC.h CosNotifyFilterC.inl CosNotifyFilterS.cpp CosNotifyFilterS.h CosNotifyFilterS.inl CosNotifyFilterS_T.cpp CosNotifyFilterS_T.h CosNotifyFilterS_T.inl: CosNotifyFilter-stamp
+
+CosNotifyFilter-stamp: $(srcdir)/CosNotifyFilter.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Notify_Export -Wb,stub_export_include=orbsvcs/Notify/notify_export.h -Wb,skel_export_macro=TAO_Notify_Skel_Export -Wb,skel_export_include=orbsvcs/Notify/notify_skel_export.h $(srcdir)/CosNotifyFilter.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ CosNotifyChannelAdminC.cpp \
+ CosNotifyChannelAdminC.h \
+ CosNotifyChannelAdminC.inl \
+ CosNotifyChannelAdminS.cpp \
+ CosNotifyChannelAdminS.h \
+ CosNotifyChannelAdminS.inl \
+ CosNotifyChannelAdminS_T.cpp \
+ CosNotifyChannelAdminS_T.h \
+ CosNotifyChannelAdminS_T.inl
+
+CLEANFILES += \
+ CosNotifyChannelAdmin-stamp \
+ CosNotifyChannelAdminC.cpp \
+ CosNotifyChannelAdminC.h \
+ CosNotifyChannelAdminC.inl \
+ CosNotifyChannelAdminS.cpp \
+ CosNotifyChannelAdminS.h \
+ CosNotifyChannelAdminS.inl \
+ CosNotifyChannelAdminS_T.cpp \
+ CosNotifyChannelAdminS_T.h \
+ CosNotifyChannelAdminS_T.inl
+
+CosNotifyChannelAdminC.cpp CosNotifyChannelAdminC.h CosNotifyChannelAdminC.inl CosNotifyChannelAdminS.cpp CosNotifyChannelAdminS.h CosNotifyChannelAdminS.inl CosNotifyChannelAdminS_T.cpp CosNotifyChannelAdminS_T.h CosNotifyChannelAdminS_T.inl: CosNotifyChannelAdmin-stamp
+
+CosNotifyChannelAdmin-stamp: $(srcdir)/CosNotifyChannelAdmin.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Notify_Export -Wb,stub_export_include=orbsvcs/Notify/notify_export.h -Wb,skel_export_macro=TAO_Notify_Skel_Export -Wb,skel_export_include=orbsvcs/Notify/notify_skel_export.h $(srcdir)/CosNotifyChannelAdmin.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ NotifyExtC.cpp \
+ NotifyExtC.h \
+ NotifyExtC.inl \
+ NotifyExtS.cpp \
+ NotifyExtS.h \
+ NotifyExtS.inl \
+ NotifyExtS_T.cpp \
+ NotifyExtS_T.h \
+ NotifyExtS_T.inl
+
+CLEANFILES += \
+ NotifyExt-stamp \
+ NotifyExtC.cpp \
+ NotifyExtC.h \
+ NotifyExtC.inl \
+ NotifyExtS.cpp \
+ NotifyExtS.h \
+ NotifyExtS.inl \
+ NotifyExtS_T.cpp \
+ NotifyExtS_T.h \
+ NotifyExtS_T.inl
+
+NotifyExtC.cpp NotifyExtC.h NotifyExtC.inl NotifyExtS.cpp NotifyExtS.h NotifyExtS.inl NotifyExtS_T.cpp NotifyExtS_T.h NotifyExtS_T.inl: NotifyExt-stamp
+
+NotifyExt-stamp: $(srcdir)/NotifyExt.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Notify_Export -Wb,stub_export_include=orbsvcs/Notify/notify_export.h -Wb,skel_export_macro=TAO_Notify_Skel_Export -Wb,skel_export_include=orbsvcs/Notify/notify_skel_export.h $(srcdir)/NotifyExt.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ Event_ForwarderC.cpp \
+ Event_ForwarderC.h \
+ Event_ForwarderC.inl \
+ Event_ForwarderS.cpp \
+ Event_ForwarderS.h \
+ Event_ForwarderS.inl \
+ Event_ForwarderS_T.cpp \
+ Event_ForwarderS_T.h \
+ Event_ForwarderS_T.inl
+
+CLEANFILES += \
+ Event_Forwarder-stamp \
+ Event_ForwarderC.cpp \
+ Event_ForwarderC.h \
+ Event_ForwarderC.inl \
+ Event_ForwarderS.cpp \
+ Event_ForwarderS.h \
+ Event_ForwarderS.inl \
+ Event_ForwarderS_T.cpp \
+ Event_ForwarderS_T.h \
+ Event_ForwarderS_T.inl
+
+Event_ForwarderC.cpp Event_ForwarderC.h Event_ForwarderC.inl Event_ForwarderS.cpp Event_ForwarderS.h Event_ForwarderS.inl Event_ForwarderS_T.cpp Event_ForwarderS_T.h Event_ForwarderS_T.inl: Event_Forwarder-stamp
+
+Event_Forwarder-stamp: $(srcdir)/Event_Forwarder.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Notify_Export -Wb,stub_export_include=orbsvcs/Notify/notify_export.h -Wb,skel_export_macro=TAO_Notify_Skel_Export -Wb,skel_export_include=orbsvcs/Notify/notify_skel_export.h $(srcdir)/Event_Forwarder.idl
+ @touch $@
+
+
+nobase_include_HEADERS += \
+ CosNotification.idl \
+ CosNotifyChannelAdmin.idl \
+ CosNotifyComm.idl \
+ CosNotifyFilter.idl \
+ Event_Forwarder.idl \
+ NotifyExt.idl
+
+endif !BUILD_MINIMUM_CORBA
+
+## Makefile.CosNotification.am
+
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_CosNotification.la
+
+libTAO_CosNotification_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_BUILD_DLL
+
+libTAO_CosNotification_la_SOURCES = \
+ CosNotificationC.cpp \
+ CosNotifyChannelAdminC.cpp \
+ CosNotifyCommC.cpp \
+ CosNotifyFilterC.cpp \
+ Event_ForwarderC.cpp \
+ Notify/Notify_Extensions.cpp \
+ NotifyExtC.cpp
+
+libTAO_CosNotification_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosNotification_la_LIBADD = \
+ libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ CosNotificationC.h \
+ CosNotificationC.inl \
+ CosNotifyChannelAdminC.h \
+ CosNotifyChannelAdminC.inl \
+ CosNotifyCommC.h \
+ CosNotifyCommC.inl \
+ CosNotifyFilterC.h \
+ CosNotifyFilterC.inl \
+ Event_ForwarderC.h \
+ Event_ForwarderC.inl \
+ Notify/Notify_Extensions.h \
+ Notify/notify_export.h \
+ NotifyExtC.h \
+ NotifyExtC.inl
+
+pkgconfig_DATA += \
+ TAO_CosNotification.pc
+
+CLEANFILES += \
+ TAO_CosNotification.pc
+
+TAO_CosNotification.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosNotification.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosNotification.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+
+EXTRA_DIST += \
+ CosNotification.rc \
+ TAO_CosNotification.pc.in
+
+
+## Makefile.ETCL.am
+
+lib_LTLIBRARIES += libTAO_ETCL.la
+
+libTAO_ETCL_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_ETCL_BUILD_DLL
+
+libTAO_ETCL_la_SOURCES = \
+ ETCL/ETCL_Constraint.cpp \
+ ETCL/ETCL_Interpreter.cpp \
+ ETCL/ETCL_l.cpp \
+ ETCL/ETCL_y.cpp
+
+libTAO_ETCL_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_ETCL_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ ETCL/ETCL_Constraint.h \
+ ETCL/ETCL_Constraint.inl \
+ ETCL/ETCL_Constraint_Visitor.h \
+ ETCL/ETCL_Interpreter.h \
+ ETCL/ETCL_y.h \
+ ETCL/etcl_export.h
+
+pkgconfig_DATA += \
+ TAO_ETCL.pc
+
+CLEANFILES += \
+ TAO_ETCL.pc
+
+TAO_ETCL.pc: ${top_builddir}/config.status ${srcdir}/TAO_ETCL.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_ETCL.pc.in
+
+EXTRA_DIST += \
+ ETCL.rc \
+ TAO_ETCL.pc.in
+
+
+## Makefile.CosNotification_Skel.am
+
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_CosNotification_Skel.la
+
+libTAO_CosNotification_Skel_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_SKEL_BUILD_DLL
+
+libTAO_CosNotification_Skel_la_SOURCES = \
+ CosNotificationS.cpp \
+ CosNotifyChannelAdminS.cpp \
+ CosNotifyCommS.cpp \
+ CosNotifyFilterS.cpp \
+ Event_ForwarderS.cpp \
+ NotifyExtS.cpp
+
+libTAO_CosNotification_Skel_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosNotification_Skel_la_LIBADD = \
+ libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_CosNotification.la \
+ libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ CosNotificationS.h \
+ CosNotificationS.inl \
+ CosNotificationS_T.cpp \
+ CosNotificationS_T.h \
+ CosNotificationS_T.inl \
+ CosNotifyChannelAdminS.h \
+ CosNotifyChannelAdminS.inl \
+ CosNotifyChannelAdminS_T.cpp \
+ CosNotifyChannelAdminS_T.h \
+ CosNotifyChannelAdminS_T.inl \
+ CosNotifyCommS.h \
+ CosNotifyCommS.inl \
+ CosNotifyCommS_T.cpp \
+ CosNotifyCommS_T.h \
+ CosNotifyCommS_T.inl \
+ CosNotifyFilterS.h \
+ CosNotifyFilterS.inl \
+ CosNotifyFilterS_T.cpp \
+ CosNotifyFilterS_T.h \
+ CosNotifyFilterS_T.inl \
+ Event_ForwarderS.h \
+ Event_ForwarderS.inl \
+ Event_ForwarderS_T.cpp \
+ Event_ForwarderS_T.h \
+ Event_ForwarderS_T.inl \
+ Notify/notify_skel_export.h \
+ NotifyExtS.h \
+ NotifyExtS.inl \
+ NotifyExtS_T.cpp \
+ NotifyExtS_T.h \
+ NotifyExtS_T.inl
+
+pkgconfig_DATA += \
+ TAO_CosNotification_Skel.pc
+
+CLEANFILES += \
+ TAO_CosNotification_Skel.pc
+
+TAO_CosNotification_Skel.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosNotification_Skel.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosNotification_Skel.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+
+EXTRA_DIST += \
+ CosNotification_Skel.rc \
+ TAO_CosNotification_Skel.pc.in
+
+
+## Makefile.CosNotification_Serv.am
+
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_CosNotification_Serv.la
+
+libTAO_CosNotification_Serv_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_SERV_BUILD_DLL
+
+libTAO_CosNotification_Serv_la_SOURCES = \
+ Notify/Admin.cpp \
+ Notify/AdminProperties.cpp \
+ Notify/Any/AnyEvent.cpp \
+ Notify/Any/CosEC_ProxyPushConsumer.cpp \
+ Notify/Any/CosEC_ProxyPushSupplier.cpp \
+ Notify/Any/ProxyPushConsumer.cpp \
+ Notify/Any/ProxyPushSupplier.cpp \
+ Notify/Any/PushConsumer.cpp \
+ Notify/Any/PushSupplier.cpp \
+ Notify/Bit_Vector.cpp \
+ Notify/Buffering_Strategy.cpp \
+ Notify/Builder.cpp \
+ Notify/Consumer.cpp \
+ Notify/ConsumerAdmin.cpp \
+ Notify/CosNotify_Initializer.cpp \
+ Notify/CosNotify_Service.cpp \
+ Notify/Default_Factory.cpp \
+ Notify/Delivery_Request.cpp \
+ Notify/ETCL_Filter.cpp \
+ Notify/ETCL_FilterFactory.cpp \
+ Notify/Event.cpp \
+ Notify/EventChannel.cpp \
+ Notify/EventChannelFactory.cpp \
+ Notify/EventType.cpp \
+ Notify/EventTypeSeq.cpp \
+ Notify/Event_Manager.cpp \
+ Notify/Event_Persistence_Factory.cpp \
+ Notify/FilterAdmin.cpp \
+ Notify/ID_Factory.cpp \
+ Notify/Method_Request.cpp \
+ Notify/Method_Request_Dispatch.cpp \
+ Notify/Method_Request_Event.cpp \
+ Notify/Method_Request_Lookup.cpp \
+ Notify/Method_Request_Shutdown.cpp \
+ Notify/Method_Request_Updates.cpp \
+ Notify/Name_Value_Pair.cpp \
+ Notify/Notify_Constraint_Interpreter.cpp \
+ Notify/Notify_Constraint_Visitors.cpp \
+ Notify/Notify_Default_CO_Factory.cpp \
+ Notify/Notify_Default_Collection_Factory.cpp \
+ Notify/Notify_Default_EMO_Factory.cpp \
+ Notify/Notify_Default_POA_Factory.cpp \
+ Notify/Notify_EventChannelFactory_i.cpp \
+ Notify/Object.cpp \
+ Notify/POA_Helper.cpp \
+ Notify/Peer.cpp \
+ Notify/Persistent_File_Allocator.cpp \
+ Notify/Properties.cpp \
+ Notify/PropertySeq.cpp \
+ Notify/Property_Boolean.cpp \
+ Notify/Proxy.cpp \
+ Notify/ProxyConsumer.cpp \
+ Notify/ProxySupplier.cpp \
+ Notify/QoSProperties.cpp \
+ Notify/Random_File.cpp \
+ Notify/Reactive_Task.cpp \
+ Notify/Reconnection_Registry.cpp \
+ Notify/Refcountable.cpp \
+ Notify/Routing_Slip.cpp \
+ Notify/Routing_Slip_Persistence_Manager.cpp \
+ Notify/Routing_Slip_Queue.cpp \
+ Notify/Sequence/SequenceProxyPushConsumer.cpp \
+ Notify/Sequence/SequenceProxyPushSupplier.cpp \
+ Notify/Sequence/SequencePushConsumer.cpp \
+ Notify/Sequence/SequencePushSupplier.cpp \
+ Notify/Service.cpp \
+ Notify/Standard_Event_Persistence.cpp \
+ Notify/Structured/StructuredEvent.cpp \
+ Notify/Structured/StructuredProxyPushConsumer.cpp \
+ Notify/Structured/StructuredProxyPushSupplier.cpp \
+ Notify/Structured/StructuredPushConsumer.cpp \
+ Notify/Structured/StructuredPushSupplier.cpp \
+ Notify/Subscription_Change_Worker.cpp \
+ Notify/Supplier.cpp \
+ Notify/SupplierAdmin.cpp \
+ Notify/ThreadPool_Task.cpp \
+ Notify/Timer_Queue.cpp \
+ Notify/Timer_Reactor.cpp \
+ Notify/Topology_Loader.cpp \
+ Notify/Topology_Object.cpp \
+ Notify/Topology_Saver.cpp \
+ Notify/Worker_Task.cpp
+
+libTAO_CosNotification_Serv_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosNotification_Serv_la_LIBADD = \
+ libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ libTAO_CosNotification_Skel.la \
+ libTAO_CosEvent_Skel.la \
+ libTAO_CosNotification.la \
+ libTAO_CosEvent.la \
+ libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Notify/Admin.h \
+ Notify/Admin.inl \
+ Notify/AdminProperties.h \
+ Notify/AdminProperties.inl \
+ Notify/Any/AnyEvent.h \
+ Notify/Any/CosEC_ProxyPushConsumer.h \
+ Notify/Any/CosEC_ProxyPushSupplier.h \
+ Notify/Any/ProxyPushConsumer.h \
+ Notify/Any/ProxyPushSupplier.h \
+ Notify/Any/PushConsumer.h \
+ Notify/Any/PushSupplier.h \
+ Notify/Bit_Vector.h \
+ Notify/Buffering_Strategy.h \
+ Notify/Builder.h \
+ Notify/Consumer.h \
+ Notify/Consumer.inl \
+ Notify/ConsumerAdmin.h \
+ Notify/CosNotify_Initializer.h \
+ Notify/CosNotify_Service.h \
+ Notify/Default_Factory.h \
+ Notify/Delivery_Request.h \
+ Notify/Delivery_Request.inl \
+ Notify/ETCL_Filter.h \
+ Notify/ETCL_FilterFactory.h \
+ Notify/Event.h \
+ Notify/Event.inl \
+ Notify/EventChannel.h \
+ Notify/EventChannelFactory.h \
+ Notify/EventType.h \
+ Notify/EventType.inl \
+ Notify/EventTypeSeq.h \
+ Notify/Event_Manager.h \
+ Notify/Event_Persistence_Factory.h \
+ Notify/FilterAdmin.h \
+ Notify/FilterAdmin.inl \
+ Notify/ID_Factory.h \
+ Notify/ID_Factory.inl \
+ Notify/Method_Request.h \
+ Notify/Method_Request_Dispatch.h \
+ Notify/Method_Request_Event.h \
+ Notify/Method_Request_Lookup.h \
+ Notify/Method_Request_Shutdown.h \
+ Notify/Method_Request_Updates.h \
+ Notify/Method_Request_Updates_T.cpp \
+ Notify/Name_Value_Pair.h \
+ Notify/Notify_Constraint_Interpreter.h \
+ Notify/Notify_Constraint_Visitors.h \
+ Notify/Notify_Default_CO_Factory.h \
+ Notify/Notify_Default_Collection_Factory.h \
+ Notify/Notify_Default_EMO_Factory.h \
+ Notify/Notify_Default_POA_Factory.h \
+ Notify/Notify_EventChannelFactory_i.h \
+ Notify/Object.h \
+ Notify/Object.inl \
+ Notify/POA_Helper.h \
+ Notify/POA_Helper.inl \
+ Notify/Peer.h \
+ Notify/Persistent_File_Allocator.h \
+ Notify/Properties.h \
+ Notify/Properties.inl \
+ Notify/PropertySeq.h \
+ Notify/PropertySeq.inl \
+ Notify/Property_Boolean.h \
+ Notify/Property_Boolean.inl \
+ Notify/Proxy.h \
+ Notify/Proxy.inl \
+ Notify/ProxyConsumer.h \
+ Notify/ProxyConsumer.inl \
+ Notify/ProxyConsumer_T.cpp \
+ Notify/ProxySupplier.h \
+ Notify/ProxySupplier.inl \
+ Notify/ProxySupplier_T.cpp \
+ Notify/Proxy_T.cpp \
+ Notify/QoSProperties.h \
+ Notify/QoSProperties.inl \
+ Notify/Random_File.h \
+ Notify/Reactive_Task.h \
+ Notify/Reactive_Task.inl \
+ Notify/Reconnection_Registry.h \
+ Notify/Refcountable.h \
+ Notify/Routing_Slip.h \
+ Notify/Routing_Slip_Persistence_Manager.h \
+ Notify/Routing_Slip_Queue.h \
+ Notify/Sequence/SequenceProxyPushConsumer.h \
+ Notify/Sequence/SequenceProxyPushSupplier.h \
+ Notify/Sequence/SequencePushConsumer.h \
+ Notify/Sequence/SequencePushSupplier.h \
+ Notify/Service.h \
+ Notify/Standard_Event_Persistence.h \
+ Notify/Structured/StructuredEvent.h \
+ Notify/Structured/StructuredProxyPushConsumer.h \
+ Notify/Structured/StructuredProxyPushSupplier.h \
+ Notify/Structured/StructuredPushConsumer.h \
+ Notify/Structured/StructuredPushSupplier.h \
+ Notify/Subscription_Change_Worker.h \
+ Notify/Supplier.h \
+ Notify/Supplier.inl \
+ Notify/SupplierAdmin.h \
+ Notify/ThreadPool_Task.h \
+ Notify/Timer_Queue.h \
+ Notify/Timer_Reactor.h \
+ Notify/Topology_Loader.h \
+ Notify/Topology_Object.h \
+ Notify/Topology_Object.inl \
+ Notify/Topology_Saver.h \
+ Notify/Worker_Task.h \
+ Notify/notify_serv_export.h
+
+pkgconfig_DATA += \
+ TAO_CosNotification_Serv.pc
+
+CLEANFILES += \
+ TAO_CosNotification_Serv.pc
+
+TAO_CosNotification_Serv.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosNotification_Serv.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosNotification_Serv.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+
+EXTRA_DIST += \
+ CosNotification_Serv.rc \
+ TAO_CosNotification_Serv.pc.in
+
+
+## Makefile.CosNotification_Persist.am
+
+if BUILD_ACEXML
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_CosNotification_Persist.la
+
+libTAO_CosNotification_Persist_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(ACE_ROOT)/ACEXML/common \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL \
+ -DTAO_NOTIFY_PERSIST_BUILD_DLL
+
+libTAO_CosNotification_Persist_la_SOURCES = \
+ Notify/XML_Loader.cpp \
+ Notify/XML_Saver.cpp \
+ Notify/XML_Topology_Factory.cpp
+
+libTAO_CosNotification_Persist_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosNotification_Persist_la_LIBADD = \
+ $(ACE_BUILDDIR)/ACEXML/parser/parser/libACEXML_Parser.la \
+ $(ACE_BUILDDIR)/ACEXML/common/libACEXML.la \
+ libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ libTAO_ETCL.la \
+ libTAO_CosNotification_Skel.la \
+ libTAO_CosEvent_Skel.la \
+ libTAO_CosNotification.la \
+ libTAO_CosEvent.la \
+ libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Notify/XML_Loader.h \
+ Notify/XML_Saver.h \
+ Notify/XML_Topology_Factory.h \
+ Notify/notify_persist_export.h
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_ACEXML
+
+## Makefile.CosTime.am
+
+BUILT_SOURCES += \
+ TimeServiceC.cpp \
+ TimeServiceC.h \
+ TimeServiceC.inl \
+ TimeServiceS.cpp \
+ TimeServiceS.h \
+ TimeServiceS.inl \
+ TimeServiceS_T.cpp
+
+CLEANFILES += \
+ TimeService-stamp \
+ TimeServiceC.cpp \
+ TimeServiceC.h \
+ TimeServiceC.inl \
+ TimeServiceS.cpp \
+ TimeServiceS.h \
+ TimeServiceS.inl \
+ TimeServiceS_T.cpp
+
+TimeServiceC.cpp TimeServiceC.h TimeServiceC.inl TimeServiceS.cpp TimeServiceS.h TimeServiceS.inl TimeServiceS_T.cpp: TimeService-stamp
+
+TimeService-stamp: $(srcdir)/TimeService.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_Time_Export -Wb,export_include=orbsvcs/Time/time_export.h $(srcdir)/TimeService.idl
+ @touch $@
+
+lib_LTLIBRARIES += libTAO_CosTime.la
+
+libTAO_CosTime_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_TIME_BUILD_DLL
+
+libTAO_CosTime_la_SOURCES = \
+ Time/TAO_TIO.cpp \
+ Time/TAO_Time_Service_Clerk.cpp \
+ Time/TAO_Time_Service_Server.cpp \
+ Time/TAO_UTO.cpp \
+ Time/Timer_Helper.cpp \
+ TimeServiceC.cpp \
+ TimeServiceS.cpp
+
+libTAO_CosTime_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosTime_la_LIBADD = \
+ libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Time/TAO_TIO.h \
+ Time/TAO_Time_Service_Clerk.h \
+ Time/TAO_Time_Service_Server.h \
+ Time/TAO_UTO.h \
+ Time/Timer_Helper.h \
+ Time/time_export.h \
+ TimeService.idl \
+ TimeServiceC.h \
+ TimeServiceC.inl \
+ TimeServiceS.h \
+ TimeServiceS.inl \
+ TimeServiceS_T.cpp
+
+pkgconfig_DATA += \
+ TAO_CosTime.pc
+
+CLEANFILES += \
+ TAO_CosTime.pc
+
+TAO_CosTime.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosTime.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosTime.pc.in
+
+EXTRA_DIST += \
+ CosTime.rc \
+ TAO_CosTime.pc.in
+
+
+## Makefile.CosTrading_IDL.am
+
+BUILT_SOURCES += \
+ CosTradingC.cpp \
+ CosTradingC.h \
+ CosTradingC.inl \
+ CosTradingS.cpp \
+ CosTradingS.h \
+ CosTradingS.inl \
+ CosTradingS_T.cpp \
+ CosTradingS_T.h \
+ CosTradingS_T.inl
+
+CLEANFILES += \
+ CosTrading-stamp \
+ CosTradingC.cpp \
+ CosTradingC.h \
+ CosTradingC.inl \
+ CosTradingS.cpp \
+ CosTradingS.h \
+ CosTradingS.inl \
+ CosTradingS_T.cpp \
+ CosTradingS_T.h \
+ CosTradingS_T.inl
+
+CosTradingC.cpp CosTradingC.h CosTradingC.inl CosTradingS.cpp CosTradingS.h CosTradingS.inl CosTradingS_T.cpp CosTradingS_T.h CosTradingS_T.inl: CosTrading-stamp
+
+CosTrading-stamp: $(srcdir)/CosTrading.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Trading_Export -Wb,stub_export_include=orbsvcs/Trader/trading_export.h -Wb,skel_export_macro=TAO_Trading_Skel_Export -Wb,skel_export_include=orbsvcs/Trader/trading_skel_export.h $(srcdir)/CosTrading.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ CosTradingReposC.cpp \
+ CosTradingReposC.h \
+ CosTradingReposC.inl \
+ CosTradingReposS.cpp \
+ CosTradingReposS.h \
+ CosTradingReposS.inl \
+ CosTradingReposS_T.cpp \
+ CosTradingReposS_T.h \
+ CosTradingReposS_T.inl
+
+CLEANFILES += \
+ CosTradingRepos-stamp \
+ CosTradingReposC.cpp \
+ CosTradingReposC.h \
+ CosTradingReposC.inl \
+ CosTradingReposS.cpp \
+ CosTradingReposS.h \
+ CosTradingReposS.inl \
+ CosTradingReposS_T.cpp \
+ CosTradingReposS_T.h \
+ CosTradingReposS_T.inl
+
+CosTradingReposC.cpp CosTradingReposC.h CosTradingReposC.inl CosTradingReposS.cpp CosTradingReposS.h CosTradingReposS.inl CosTradingReposS_T.cpp CosTradingReposS_T.h CosTradingReposS_T.inl: CosTradingRepos-stamp
+
+CosTradingRepos-stamp: $(srcdir)/CosTradingRepos.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Trading_Export -Wb,stub_export_include=orbsvcs/Trader/trading_export.h -Wb,skel_export_macro=TAO_Trading_Skel_Export -Wb,skel_export_include=orbsvcs/Trader/trading_skel_export.h $(srcdir)/CosTradingRepos.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ CosTradingDynamicC.cpp \
+ CosTradingDynamicC.h \
+ CosTradingDynamicC.inl \
+ CosTradingDynamicS.cpp \
+ CosTradingDynamicS.h \
+ CosTradingDynamicS.inl \
+ CosTradingDynamicS_T.cpp \
+ CosTradingDynamicS_T.h \
+ CosTradingDynamicS_T.inl
+
+CLEANFILES += \
+ CosTradingDynamic-stamp \
+ CosTradingDynamicC.cpp \
+ CosTradingDynamicC.h \
+ CosTradingDynamicC.inl \
+ CosTradingDynamicS.cpp \
+ CosTradingDynamicS.h \
+ CosTradingDynamicS.inl \
+ CosTradingDynamicS_T.cpp \
+ CosTradingDynamicS_T.h \
+ CosTradingDynamicS_T.inl
+
+CosTradingDynamicC.cpp CosTradingDynamicC.h CosTradingDynamicC.inl CosTradingDynamicS.cpp CosTradingDynamicS.h CosTradingDynamicS.inl CosTradingDynamicS_T.cpp CosTradingDynamicS_T.h CosTradingDynamicS_T.inl: CosTradingDynamic-stamp
+
+CosTradingDynamic-stamp: $(srcdir)/CosTradingDynamic.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Trading_Export -Wb,stub_export_include=orbsvcs/Trader/trading_export.h -Wb,skel_export_macro=TAO_Trading_Skel_Export -Wb,skel_export_include=orbsvcs/Trader/trading_skel_export.h $(srcdir)/CosTradingDynamic.idl
+ @touch $@
+
+
+nobase_include_HEADERS += \
+ CosTrading.idl \
+ CosTradingDynamic.idl \
+ CosTradingRepos.idl
+
+## Makefile.CosTrading.am
+
+lib_LTLIBRARIES += libTAO_CosTrading.la
+
+libTAO_CosTrading_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_TRADING_BUILD_DLL
+
+libTAO_CosTrading_la_SOURCES = \
+ CosTradingC.cpp \
+ CosTradingDynamicC.cpp \
+ CosTradingReposC.cpp
+
+libTAO_CosTrading_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosTrading_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ CosTradingC.h \
+ CosTradingC.inl \
+ CosTradingDynamicC.h \
+ CosTradingDynamicC.inl \
+ CosTradingReposC.h \
+ CosTradingReposC.inl \
+ Trader/trading_export.h
+
+pkgconfig_DATA += \
+ TAO_CosTrading.pc
+
+CLEANFILES += \
+ TAO_CosTrading.pc
+
+TAO_CosTrading.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosTrading.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosTrading.pc.in
+
+EXTRA_DIST += \
+ CosTrading.rc \
+ TAO_CosTrading.pc.in
+
+
+## Makefile.CosTrading_Skel.am
+
+lib_LTLIBRARIES += libTAO_CosTrading_Skel.la
+
+libTAO_CosTrading_Skel_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_TRADING_SKEL_BUILD_DLL
+
+libTAO_CosTrading_Skel_la_SOURCES = \
+ CosTradingDynamicS.cpp \
+ CosTradingReposS.cpp \
+ CosTradingS.cpp
+
+libTAO_CosTrading_Skel_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosTrading_Skel_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_CosTrading.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ CosTradingDynamicS.h \
+ CosTradingDynamicS.inl \
+ CosTradingDynamicS_T.cpp \
+ CosTradingDynamicS_T.h \
+ CosTradingDynamicS_T.inl \
+ CosTradingReposS.h \
+ CosTradingReposS.inl \
+ CosTradingReposS_T.cpp \
+ CosTradingReposS_T.h \
+ CosTradingReposS_T.inl \
+ CosTradingS.h \
+ CosTradingS.inl \
+ CosTradingS_T.cpp \
+ CosTradingS_T.h \
+ CosTradingS_T.inl \
+ Trader/trading_skel_export.h
+
+pkgconfig_DATA += \
+ TAO_CosTrading_Skel.pc
+
+CLEANFILES += \
+ TAO_CosTrading_Skel.pc
+
+TAO_CosTrading_Skel.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosTrading_Skel.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosTrading_Skel.pc.in
+
+EXTRA_DIST += \
+ CosTrading_Skel.rc \
+ TAO_CosTrading_Skel.pc.in
+
+
+## Makefile.CosTrading_Serv.am
+
+lib_LTLIBRARIES += libTAO_CosTrading_Serv.la
+
+libTAO_CosTrading_Serv_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_TRADING_SERV_BUILD_DLL
+
+libTAO_CosTrading_Serv_la_SOURCES = \
+ Trader/Constraint_Interpreter.cpp \
+ Trader/Constraint_Nodes.cpp \
+ Trader/Constraint_Visitors.cpp \
+ Trader/Constraint_l.cpp \
+ Trader/Constraint_y.cpp \
+ Trader/Interpreter.cpp \
+ Trader/Interpreter_Utils.cpp \
+ Trader/Offer_Database.cpp \
+ Trader/Offer_Iterators.cpp \
+ Trader/Service_Type_Repository.cpp \
+ Trader/Trader.cpp \
+ Trader/Trader_Constraint_Visitors.cpp \
+ Trader/Trader_Interfaces.cpp \
+ Trader/Trader_Utils.cpp \
+ Trader/Trading_Loader.cpp
+
+libTAO_CosTrading_Serv_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_CosTrading_Serv_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ libTAO_CosTrading_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_CosTrading.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Trader/Constraint_Interpreter.h \
+ Trader/Constraint_Nodes.h \
+ Trader/Constraint_Visitors.h \
+ Trader/Interpreter.h \
+ Trader/Interpreter_Utils.h \
+ Trader/Interpreter_Utils_T.cpp \
+ Trader/Offer_Database.h \
+ Trader/Offer_Iterators.h \
+ Trader/Offer_Iterators_T.cpp \
+ Trader/Service_Type_Repository.h \
+ Trader/Trader.h \
+ Trader/Trader_Constraint_Visitors.h \
+ Trader/Trader_Interfaces.h \
+ Trader/Trader_T.cpp \
+ Trader/Trader_Utils.h \
+ Trader/Trading_Loader.h \
+ Trader/trading_serv_export.h
+
+pkgconfig_DATA += \
+ TAO_CosTrading_Serv.pc
+
+CLEANFILES += \
+ TAO_CosTrading_Serv.pc
+
+TAO_CosTrading_Serv.pc: ${top_builddir}/config.status ${srcdir}/TAO_CosTrading_Serv.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_CosTrading_Serv.pc.in
+
+EXTRA_DIST += \
+ CosTrading_Serv.rc \
+ TAO_CosTrading_Serv.pc.in
+
+
+## Makefile.DsLogAdmin_IDL.am
+
+BUILT_SOURCES += \
+ DsLogAdminC.cpp \
+ DsLogAdminC.h \
+ DsLogAdminC.inl \
+ DsLogAdminS.cpp \
+ DsLogAdminS.h \
+ DsLogAdminS.inl \
+ DsLogAdminS_T.cpp \
+ DsLogAdminS_T.h \
+ DsLogAdminS_T.inl
+
+CLEANFILES += \
+ DsLogAdmin-stamp \
+ DsLogAdminC.cpp \
+ DsLogAdminC.h \
+ DsLogAdminC.inl \
+ DsLogAdminS.cpp \
+ DsLogAdminS.h \
+ DsLogAdminS.inl \
+ DsLogAdminS_T.cpp \
+ DsLogAdminS_T.h \
+ DsLogAdminS_T.inl
+
+DsLogAdminC.cpp DsLogAdminC.h DsLogAdminC.inl DsLogAdminS.cpp DsLogAdminS.h DsLogAdminS.inl DsLogAdminS_T.cpp DsLogAdminS_T.h DsLogAdminS_T.inl: DsLogAdmin-stamp
+
+DsLogAdmin-stamp: $(srcdir)/DsLogAdmin.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Log_Export -Wb,stub_export_include=orbsvcs/Log/log_export.h -Wb,skel_export_macro=TAO_Log_Skel_Export -Wb,skel_export_include=orbsvcs/Log/log_skel_export.h $(srcdir)/DsLogAdmin.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ DsLogNotificationC.cpp \
+ DsLogNotificationC.h \
+ DsLogNotificationC.inl \
+ DsLogNotificationS.cpp \
+ DsLogNotificationS.h \
+ DsLogNotificationS.inl \
+ DsLogNotificationS_T.cpp \
+ DsLogNotificationS_T.h \
+ DsLogNotificationS_T.inl
+
+CLEANFILES += \
+ DsLogNotification-stamp \
+ DsLogNotificationC.cpp \
+ DsLogNotificationC.h \
+ DsLogNotificationC.inl \
+ DsLogNotificationS.cpp \
+ DsLogNotificationS.h \
+ DsLogNotificationS.inl \
+ DsLogNotificationS_T.cpp \
+ DsLogNotificationS_T.h \
+ DsLogNotificationS_T.inl
+
+DsLogNotificationC.cpp DsLogNotificationC.h DsLogNotificationC.inl DsLogNotificationS.cpp DsLogNotificationS.h DsLogNotificationS.inl DsLogNotificationS_T.cpp DsLogNotificationS_T.h DsLogNotificationS_T.inl: DsLogNotification-stamp
+
+DsLogNotification-stamp: $(srcdir)/DsLogNotification.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_Log_Export -Wb,stub_export_include=orbsvcs/Log/log_export.h -Wb,skel_export_macro=TAO_Log_Skel_Export -Wb,skel_export_include=orbsvcs/Log/log_skel_export.h $(srcdir)/DsLogNotification.idl
+ @touch $@
+
+
+nobase_include_HEADERS += \
+ DsLogAdmin.idl \
+ DsLogNotification.idl
+
+## Makefile.DsLogAdmin.am
+
+lib_LTLIBRARIES += libTAO_DsLogAdmin.la
+
+libTAO_DsLogAdmin_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_LOG_BUILD_DLL
+
+libTAO_DsLogAdmin_la_SOURCES = \
+ DsLogAdminC.cpp \
+ DsLogNotificationC.cpp
+
+libTAO_DsLogAdmin_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_DsLogAdmin_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ DsLogAdminC.h \
+ DsLogAdminC.inl \
+ DsLogNotificationC.h \
+ DsLogNotificationC.inl \
+ Log/log_export.h
+
+pkgconfig_DATA += \
+ TAO_DsLogAdmin.pc
+
+CLEANFILES += \
+ TAO_DsLogAdmin.pc
+
+TAO_DsLogAdmin.pc: ${top_builddir}/config.status ${srcdir}/TAO_DsLogAdmin.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_DsLogAdmin.pc.in
+
+EXTRA_DIST += \
+ DsLogAdmin.rc \
+ TAO_DsLogAdmin.pc.in
+
+
+## Makefile.DsEventLogAdmin_IDL.am
+
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES += \
+ DsEventLogAdminC.cpp \
+ DsEventLogAdminC.h \
+ DsEventLogAdminC.inl \
+ DsEventLogAdminS.cpp \
+ DsEventLogAdminS.h \
+ DsEventLogAdminS.inl \
+ DsEventLogAdminS_T.cpp \
+ DsEventLogAdminS_T.h \
+ DsEventLogAdminS_T.inl
+
+CLEANFILES += \
+ DsEventLogAdmin-stamp \
+ DsEventLogAdminC.cpp \
+ DsEventLogAdminC.h \
+ DsEventLogAdminC.inl \
+ DsEventLogAdminS.cpp \
+ DsEventLogAdminS.h \
+ DsEventLogAdminS.inl \
+ DsEventLogAdminS_T.cpp \
+ DsEventLogAdminS_T.h \
+ DsEventLogAdminS_T.inl
+
+DsEventLogAdminC.cpp DsEventLogAdminC.h DsEventLogAdminC.inl DsEventLogAdminS.cpp DsEventLogAdminS.h DsEventLogAdminS.inl DsEventLogAdminS_T.cpp DsEventLogAdminS_T.h DsEventLogAdminS_T.inl: DsEventLogAdmin-stamp
+
+DsEventLogAdmin-stamp: $(srcdir)/DsEventLogAdmin.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_EventLog_Export -Wb,stub_export_include=orbsvcs/Log/eventlog_export.h -Wb,skel_export_macro=TAO_EventLog_Skel_Export -Wb,skel_export_include=orbsvcs/Log/eventlog_skel_export.h $(srcdir)/DsEventLogAdmin.idl
+ @touch $@
+
+
+nobase_include_HEADERS += \
+ DsEventLogAdmin.idl
+
+endif !BUILD_MINIMUM_CORBA
+
+## Makefile.DsEventLogAdmin.am
+
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_DsEventLogAdmin.la
+
+libTAO_DsEventLogAdmin_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_EVENTLOG_BUILD_DLL
+
+libTAO_DsEventLogAdmin_la_SOURCES = \
+ DsEventLogAdminC.cpp
+
+libTAO_DsEventLogAdmin_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_DsEventLogAdmin_la_LIBADD = \
+ libTAO_CosEvent.la \
+ libTAO_DsLogAdmin.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ DsEventLogAdminC.h \
+ DsEventLogAdminC.inl \
+ Log/eventlog_export.h
+
+pkgconfig_DATA += \
+ TAO_DsEventLogAdmin.pc
+
+CLEANFILES += \
+ TAO_DsEventLogAdmin.pc
+
+TAO_DsEventLogAdmin.pc: ${top_builddir}/config.status ${srcdir}/TAO_DsEventLogAdmin.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_DsEventLogAdmin.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+
+EXTRA_DIST += \
+ DsEventLogAdmin.rc \
+ TAO_DsEventLogAdmin.pc.in
+
+
+## Makefile.DsLogAdmin_Skel.am
+
+lib_LTLIBRARIES += libTAO_DsLogAdmin_Skel.la
+
+libTAO_DsLogAdmin_Skel_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_LOG_SKEL_BUILD_DLL
+
+libTAO_DsLogAdmin_Skel_la_SOURCES = \
+ DsLogAdminS.cpp \
+ DsLogNotificationS.cpp
+
+libTAO_DsLogAdmin_Skel_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_DsLogAdmin_Skel_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_DsLogAdmin.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ DsLogAdminS.h \
+ DsLogAdminS.inl \
+ DsLogAdminS_T.cpp \
+ DsLogAdminS_T.h \
+ DsLogAdminS_T.inl \
+ DsLogNotificationS.h \
+ DsLogNotificationS.inl \
+ DsLogNotificationS_T.cpp \
+ DsLogNotificationS_T.h \
+ DsLogNotificationS_T.inl \
+ Log/log_skel_export.h
+
+pkgconfig_DATA += \
+ TAO_DsLogAdmin_Skel.pc
+
+CLEANFILES += \
+ TAO_DsLogAdmin_Skel.pc
+
+TAO_DsLogAdmin_Skel.pc: ${top_builddir}/config.status ${srcdir}/TAO_DsLogAdmin_Skel.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_DsLogAdmin_Skel.pc.in
+
+EXTRA_DIST += \
+ TAO_DsLogAdmin_Skel.pc.in
+
+
+## Makefile.DsLogAdmin_Serv.am
+
+lib_LTLIBRARIES += libTAO_DsLogAdmin_Serv.la
+
+libTAO_DsLogAdmin_Serv_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_LOG_SERV_BUILD_DLL
+
+libTAO_DsLogAdmin_Serv_la_SOURCES = \
+ Log/BasicLogFactory_i.cpp \
+ Log/BasicLog_i.cpp \
+ Log/Hash_Iterator_i.cpp \
+ Log/Hash_LogRecordStore.cpp \
+ Log/Hash_LogStore.cpp \
+ Log/Hash_Persistence_Strategy.cpp \
+ Log/Iterator_i.cpp \
+ Log/LogActivator.cpp \
+ Log/LogMgr_i.cpp \
+ Log/LogNotification.cpp \
+ Log/LogRecordStore.cpp \
+ Log/Log_Compaction_Handler.cpp \
+ Log/Log_Constraint_Interpreter.cpp \
+ Log/Log_Constraint_Visitors.cpp \
+ Log/Log_Flush_Handler.cpp \
+ Log/Log_i.cpp
+
+libTAO_DsLogAdmin_Serv_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_DsLogAdmin_Serv_la_LIBADD = \
+ libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ libTAO_DsLogAdmin_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_DsLogAdmin.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Log/BasicLogFactory_i.h \
+ Log/BasicLog_i.h \
+ Log/Hash_Iterator_i.h \
+ Log/Hash_LogRecordStore.h \
+ Log/Hash_LogStore.h \
+ Log/Hash_Persistence_Strategy.h \
+ Log/Iterator_i.h \
+ Log/LogActivator.h \
+ Log/LogMgr_i.h \
+ Log/LogNotification.h \
+ Log/LogRecordStore.h \
+ Log/LogStore.h \
+ Log/Log_Compaction_Handler.h \
+ Log/Log_Constraint_Interpreter.h \
+ Log/Log_Constraint_Visitors.h \
+ Log/Log_Flush_Handler.h \
+ Log/Log_Persistence_Strategy.h \
+ Log/Log_i.h \
+ Log/log_serv_export.h
+
+pkgconfig_DATA += \
+ TAO_DsLogAdmin_Serv.pc
+
+CLEANFILES += \
+ TAO_DsLogAdmin_Serv.pc
+
+TAO_DsLogAdmin_Serv.pc: ${top_builddir}/config.status ${srcdir}/TAO_DsLogAdmin_Serv.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_DsLogAdmin_Serv.pc.in
+
+EXTRA_DIST += \
+ TAO_DsLogAdmin_Serv.pc.in
+
+
+## Makefile.DsEventLogAdmin_Skel.am
+
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_DsEventLogAdmin_Skel.la
+
+libTAO_DsEventLogAdmin_Skel_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_EVENTLOG_SKEL_BUILD_DLL
+
+libTAO_DsEventLogAdmin_Skel_la_SOURCES = \
+ DsEventLogAdminS.cpp
+
+libTAO_DsEventLogAdmin_Skel_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_DsEventLogAdmin_Skel_la_LIBADD = \
+ libTAO_CosEvent_Skel.la \
+ libTAO_DsLogAdmin_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_DsEventLogAdmin.la \
+ libTAO_CosEvent.la \
+ libTAO_DsLogAdmin.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ DsEventLogAdminS.h \
+ DsEventLogAdminS.inl \
+ DsEventLogAdminS_T.cpp \
+ DsEventLogAdminS_T.h \
+ DsEventLogAdminS_T.inl \
+ Log/eventlog_skel_export.h
+
+pkgconfig_DATA += \
+ TAO_DsEventLogAdmin_Skel.pc
+
+CLEANFILES += \
+ TAO_DsEventLogAdmin_Skel.pc
+
+TAO_DsEventLogAdmin_Skel.pc: ${top_builddir}/config.status ${srcdir}/TAO_DsEventLogAdmin_Skel.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_DsEventLogAdmin_Skel.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+
+EXTRA_DIST += \
+ TAO_DsEventLogAdmin_Skel.pc.in
+
+
+## Makefile.DsEventLogAdmin_Serv.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_DsEventLogAdmin_Serv.la
+
+libTAO_DsEventLogAdmin_Serv_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_EVENTLOG_SERV_BUILD_DLL
+
+libTAO_DsEventLogAdmin_Serv_la_SOURCES = \
+ Log/EventLogConsumer.cpp \
+ Log/EventLogFactory_i.cpp \
+ Log/EventLogNotification.cpp \
+ Log/EventLog_i.cpp
+
+libTAO_DsEventLogAdmin_Serv_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_DsEventLogAdmin_Serv_la_LIBADD = \
+ libTAO_CosEvent_Serv.la \
+ 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_Valuetype.la \
+ libTAO_DsLogAdmin_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ libTAO_Svc_Utils.la \
+ libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ libTAO_DsEventLogAdmin_Skel.la \
+ libTAO_CosEvent_Skel.la \
+ libTAO_DsLogAdmin_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_DsEventLogAdmin.la \
+ libTAO_CosEvent.la \
+ libTAO_DsLogAdmin.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Log/EventLogConsumer.h \
+ Log/EventLogFactory_i.h \
+ Log/EventLogNotification.h \
+ Log/EventLog_i.h \
+ Log/eventlog_serv_export.h
+
+pkgconfig_DATA += \
+ TAO_DsEventLogAdmin_Serv.pc
+
+CLEANFILES += \
+ TAO_DsEventLogAdmin_Serv.pc
+
+TAO_DsEventLogAdmin_Serv.pc: ${top_builddir}/config.status ${srcdir}/TAO_DsEventLogAdmin_Serv.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_DsEventLogAdmin_Serv.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+EXTRA_DIST += \
+ TAO_DsEventLogAdmin_Serv.pc.in
+
+
+## Makefile.DsNotifyLogAdmin_IDL.am
+
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES += \
+ DsNotifyLogAdminC.cpp \
+ DsNotifyLogAdminC.h \
+ DsNotifyLogAdminC.inl \
+ DsNotifyLogAdminS.cpp \
+ DsNotifyLogAdminS.h \
+ DsNotifyLogAdminS.inl \
+ DsNotifyLogAdminS_T.cpp \
+ DsNotifyLogAdminS_T.h \
+ DsNotifyLogAdminS_T.inl
+
+CLEANFILES += \
+ DsNotifyLogAdmin-stamp \
+ DsNotifyLogAdminC.cpp \
+ DsNotifyLogAdminC.h \
+ DsNotifyLogAdminC.inl \
+ DsNotifyLogAdminS.cpp \
+ DsNotifyLogAdminS.h \
+ DsNotifyLogAdminS.inl \
+ DsNotifyLogAdminS_T.cpp \
+ DsNotifyLogAdminS_T.h \
+ DsNotifyLogAdminS_T.inl
+
+DsNotifyLogAdminC.cpp DsNotifyLogAdminC.h DsNotifyLogAdminC.inl DsNotifyLogAdminS.cpp DsNotifyLogAdminS.h DsNotifyLogAdminS.inl DsNotifyLogAdminS_T.cpp DsNotifyLogAdminS_T.h DsNotifyLogAdminS_T.inl: DsNotifyLogAdmin-stamp
+
+DsNotifyLogAdmin-stamp: $(srcdir)/DsNotifyLogAdmin.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_NotifyLog_Export -Wb,stub_export_include=orbsvcs/Log/notifylog_export.h -Wb,skel_export_macro=TAO_NotifyLog_Skel_Export -Wb,skel_export_include=orbsvcs/Log/notifylog_skel_export.h $(srcdir)/DsNotifyLogAdmin.idl
+ @touch $@
+
+
+nobase_include_HEADERS += \
+ DsNotifyLogAdmin.idl
+
+endif !BUILD_MINIMUM_CORBA
+
+## Makefile.DsNotifyLogAdmin.am
+
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_DsNotifyLogAdmin.la
+
+libTAO_DsNotifyLogAdmin_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_NOTIFYLOG_BUILD_DLL
+
+libTAO_DsNotifyLogAdmin_la_SOURCES = \
+ DsNotifyLogAdminC.cpp
+
+libTAO_DsNotifyLogAdmin_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_DsNotifyLogAdmin_la_LIBADD = \
+ libTAO_CosNotification.la \
+ libTAO_DsEventLogAdmin.la \
+ libTAO_CosEvent.la \
+ libTAO_DsLogAdmin.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ DsNotifyLogAdminC.h \
+ DsNotifyLogAdminC.inl \
+ Log/notifylog_export.h
+
+pkgconfig_DATA += \
+ TAO_DsNotifyLogAdmin.pc
+
+CLEANFILES += \
+ TAO_DsNotifyLogAdmin.pc
+
+TAO_DsNotifyLogAdmin.pc: ${top_builddir}/config.status ${srcdir}/TAO_DsNotifyLogAdmin.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_DsNotifyLogAdmin.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+
+EXTRA_DIST += \
+ DsNotifyLogAdmin.rc \
+ TAO_DsNotifyLogAdmin.pc.in
+
+
+## Makefile.DsNotifyLogAdmin_Skel.am
+
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_DsNotifyLogAdmin_Skel.la
+
+libTAO_DsNotifyLogAdmin_Skel_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_NOTIFYLOG_SKEL_BUILD_DLL
+
+libTAO_DsNotifyLogAdmin_Skel_la_SOURCES = \
+ DsNotifyLogAdminS.cpp
+
+libTAO_DsNotifyLogAdmin_Skel_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_DsNotifyLogAdmin_Skel_la_LIBADD = \
+ libTAO_CosNotification_Skel.la \
+ libTAO_DsEventLogAdmin_Skel.la \
+ libTAO_CosEvent_Skel.la \
+ libTAO_DsLogAdmin_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_DsNotifyLogAdmin.la \
+ libTAO_CosNotification.la \
+ libTAO_DsEventLogAdmin.la \
+ libTAO_CosEvent.la \
+ libTAO_DsLogAdmin.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ DsNotifyLogAdminS.h \
+ DsNotifyLogAdminS.inl \
+ DsNotifyLogAdminS_T.cpp \
+ DsNotifyLogAdminS_T.h \
+ DsNotifyLogAdminS_T.inl \
+ Log/notifylog_skel_export.h
+
+pkgconfig_DATA += \
+ TAO_DsNotifyLogAdmin_Skel.pc
+
+CLEANFILES += \
+ TAO_DsNotifyLogAdmin_Skel.pc
+
+TAO_DsNotifyLogAdmin_Skel.pc: ${top_builddir}/config.status ${srcdir}/TAO_DsNotifyLogAdmin_Skel.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_DsNotifyLogAdmin_Skel.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+
+EXTRA_DIST += \
+ TAO_DsNotifyLogAdmin_Skel.pc.in
+
+
+## Makefile.DsNotifyLogAdmin_Serv.am
+
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_DsNotifyLogAdmin_Serv.la
+
+libTAO_DsNotifyLogAdmin_Serv_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_NOTIFYLOG_SERV_BUILD_DLL
+
+libTAO_DsNotifyLogAdmin_Serv_la_SOURCES = \
+ Log/NotifyLogConsumer.cpp \
+ Log/NotifyLogFactory_i.cpp \
+ Log/NotifyLogNotification.cpp \
+ Log/NotifyLog_i.cpp
+
+libTAO_DsNotifyLogAdmin_Serv_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_DsNotifyLogAdmin_Serv_la_LIBADD = \
+ libTAO_DsLogAdmin_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ libTAO_Svc_Utils.la \
+ libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ libTAO_DsNotifyLogAdmin_Skel.la \
+ libTAO_CosNotification_Skel.la \
+ libTAO_DsEventLogAdmin_Skel.la \
+ libTAO_CosEvent_Skel.la \
+ libTAO_DsLogAdmin_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_DsNotifyLogAdmin.la \
+ libTAO_CosNotification.la \
+ libTAO_DsEventLogAdmin.la \
+ libTAO_CosEvent.la \
+ libTAO_DsLogAdmin.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Log/NotifyLogConsumer.h \
+ Log/NotifyLogFactory_i.h \
+ Log/NotifyLogNotification.h \
+ Log/NotifyLog_i.h \
+ Log/notifylog_serv_export.h
+
+pkgconfig_DATA += \
+ TAO_DsNotifyLogAdmin_Serv.pc
+
+CLEANFILES += \
+ TAO_DsNotifyLogAdmin_Serv.pc
+
+TAO_DsNotifyLogAdmin_Serv.pc: ${top_builddir}/config.status ${srcdir}/TAO_DsNotifyLogAdmin_Serv.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_DsNotifyLogAdmin_Serv.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+
+EXTRA_DIST += \
+ TAO_DsNotifyLogAdmin_Serv.pc.in
+
+
+## Makefile.ESF.am
+
+
+nobase_include_HEADERS += \
+ ESF/ESF_Busy_Lock.cpp \
+ ESF/ESF_Busy_Lock.h \
+ ESF/ESF_Busy_Lock.i \
+ ESF/ESF_Copy_On_Read.cpp \
+ ESF/ESF_Copy_On_Read.h \
+ ESF/ESF_Copy_On_Write.cpp \
+ ESF/ESF_Copy_On_Write.h \
+ ESF/ESF_Copy_On_Write.i \
+ ESF/ESF_Defaults.h \
+ ESF/ESF_Delayed_Changes.cpp \
+ ESF/ESF_Delayed_Changes.h \
+ ESF/ESF_Delayed_Changes.i \
+ ESF/ESF_Delayed_Command.cpp \
+ ESF/ESF_Delayed_Command.h \
+ ESF/ESF_Delayed_Command.i \
+ ESF/ESF_Immediate_Changes.cpp \
+ ESF/ESF_Immediate_Changes.h \
+ ESF/ESF_Immediate_Changes.i \
+ ESF/ESF_Peer_Admin.cpp \
+ ESF/ESF_Peer_Admin.h \
+ ESF/ESF_Peer_Workers.cpp \
+ ESF/ESF_Peer_Workers.h \
+ ESF/ESF_Peer_Workers.i \
+ ESF/ESF_Proxy_Admin.cpp \
+ ESF/ESF_Proxy_Admin.h \
+ ESF/ESF_Proxy_Admin.i \
+ ESF/ESF_Proxy_Collection.cpp \
+ ESF/ESF_Proxy_Collection.h \
+ ESF/ESF_Proxy_List.cpp \
+ ESF/ESF_Proxy_List.h \
+ ESF/ESF_Proxy_List.i \
+ ESF/ESF_Proxy_RB_Tree.cpp \
+ ESF/ESF_Proxy_RB_Tree.h \
+ ESF/ESF_Proxy_RB_Tree.i \
+ ESF/ESF_Proxy_RefCount_Guard.cpp \
+ ESF/ESF_Proxy_RefCount_Guard.h \
+ ESF/ESF_Proxy_RefCount_Guard.i \
+ ESF/ESF_RefCount_Guard.cpp \
+ ESF/ESF_RefCount_Guard.h \
+ ESF/ESF_RefCount_Guard.i \
+ ESF/ESF_Shutdown_Proxy.cpp \
+ ESF/ESF_Shutdown_Proxy.h \
+ ESF/ESF_Shutdown_Proxy.i \
+ ESF/ESF_Worker.cpp \
+ ESF/ESF_Worker.h \
+ ESF/esf_export.h
+
+## Makefile.FTORB_Utils.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES += \
+ FT_CORBA_ORBC.cpp \
+ FT_CORBA_ORBC.h \
+ FT_CORBA_ORBC.inl \
+ FT_CORBA_ORBS.cpp \
+ FT_CORBA_ORBS.h \
+ FT_CORBA_ORBS.inl \
+ FT_CORBA_ORBS_T.cpp \
+ FT_CORBA_ORBS_T.h \
+ FT_CORBA_ORBS_T.inl
+
+CLEANFILES += \
+ FT_CORBA_ORB-stamp \
+ FT_CORBA_ORBC.cpp \
+ FT_CORBA_ORBC.h \
+ FT_CORBA_ORBC.inl \
+ FT_CORBA_ORBS.cpp \
+ FT_CORBA_ORBS.h \
+ FT_CORBA_ORBS.inl \
+ FT_CORBA_ORBS_T.cpp \
+ FT_CORBA_ORBS_T.h \
+ FT_CORBA_ORBS_T.inl
+
+FT_CORBA_ORBC.cpp FT_CORBA_ORBC.h FT_CORBA_ORBC.inl FT_CORBA_ORBS.cpp FT_CORBA_ORBS.h FT_CORBA_ORBS.inl FT_CORBA_ORBS_T.cpp FT_CORBA_ORBS_T.h FT_CORBA_ORBS_T.inl: FT_CORBA_ORB-stamp
+
+FT_CORBA_ORB-stamp: $(srcdir)/FT_CORBA_ORB.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,skel_export_include=tao/PortableServer/PolicyS.h -Wb,export_macro=TAO_FT_ORB_Utils_Export -Wb,export_include=orbsvcs/FaultTolerance/FT_ORB_Utils_export.h $(srcdir)/FT_CORBA_ORB.idl
+ @touch $@
+
+lib_LTLIBRARIES += libTAO_FTORB_Utils.la
+
+libTAO_FTORB_Utils_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_FT_ORB_UTILS_BUILD_DLL
+
+libTAO_FTORB_Utils_la_SOURCES = \
+ FT_CORBA_ORBC.cpp \
+ FT_CORBA_ORBS.cpp \
+ FaultTolerance/FT_IOGR_Property.cpp
+
+libTAO_FTORB_Utils_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_FTORB_Utils_la_LIBADD = \
+ 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 \
+ 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
+
+nobase_include_HEADERS += \
+ FT_CORBA_ORB.idl \
+ FT_CORBA_ORBC.h \
+ FT_CORBA_ORBC.inl \
+ FT_CORBA_ORBS.h \
+ FT_CORBA_ORBS.inl \
+ FT_CORBA_ORBS_T.cpp \
+ FT_CORBA_ORBS_T.h \
+ FT_CORBA_ORBS_T.inl \
+ FaultTolerance/FT_IOGR_Property.h \
+ FaultTolerance/FT_IOGR_Property.inl \
+ FaultTolerance/FT_ORB_Utils_export.h
+
+pkgconfig_DATA += \
+ TAO_FTORB_Utils.pc
+
+CLEANFILES += \
+ TAO_FTORB_Utils.pc
+
+TAO_FTORB_Utils.pc: ${top_builddir}/config.status ${srcdir}/TAO_FTORB_Utils.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_FTORB_Utils.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+EXTRA_DIST += \
+ TAO_FTORB_Utils.pc.in
+
+
+## Makefile.FTRT_ClientORB.am
+
+if BUILD_CORBA_MESSAGING
+
+lib_LTLIBRARIES += libTAO_FTRT_ClientORB.la
+
+libTAO_FTRT_ClientORB_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_FTRT_BUILD_DLL
+
+libTAO_FTRT_ClientORB_la_SOURCES = \
+ FtRtEvent/ClientORB/FTRT_ClientORB_Initializer.cpp \
+ FtRtEvent/ClientORB/FTRT_ClientORB_Interceptor.cpp \
+ FtRtEvent/ClientORB/FTRT_ClientORB_Loader.cpp
+
+libTAO_FTRT_ClientORB_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_FTRT_ClientORB_la_LIBADD = \
+ $(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
+
+nobase_include_HEADERS += \
+ FtRtEvent/ClientORB/FTRT_ClientORB_Initializer.h \
+ FtRtEvent/ClientORB/FTRT_ClientORB_Interceptor.h \
+ FtRtEvent/ClientORB/FTRT_ClientORB_Loader.h
+
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.RTEvent.am
+
+BUILT_SOURCES += \
+ RtecDefaultEventDataC.cpp \
+ RtecDefaultEventDataC.h \
+ RtecDefaultEventDataC.inl \
+ RtecDefaultEventDataS_T.cpp
+
+CLEANFILES += \
+ RtecDefaultEventData-stamp \
+ RtecDefaultEventDataC.cpp \
+ RtecDefaultEventDataC.h \
+ RtecDefaultEventDataC.inl \
+ RtecDefaultEventDataS_T.cpp
+
+RtecDefaultEventDataC.cpp RtecDefaultEventDataC.h RtecDefaultEventDataC.inl RtecDefaultEventDataS_T.cpp: RtecDefaultEventData-stamp
+
+RtecDefaultEventData-stamp: $(srcdir)/RtecDefaultEventData.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_RTEvent_Export -Wb,stub_export_include=orbsvcs/Event/event_export.h -Wb,skel_export_macro=TAO_RTEvent_Skel_Export -Wb,skel_export_include=orbsvcs/Event/event_skel_export.h $(srcdir)/RtecDefaultEventData.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ RtecEventCommC.cpp \
+ RtecEventCommC.h \
+ RtecEventCommC.inl \
+ RtecEventCommS_T.cpp
+
+CLEANFILES += \
+ RtecEventComm-stamp \
+ RtecEventCommC.cpp \
+ RtecEventCommC.h \
+ RtecEventCommC.inl \
+ RtecEventCommS_T.cpp
+
+RtecEventCommC.cpp RtecEventCommC.h RtecEventCommC.inl RtecEventCommS_T.cpp: RtecEventComm-stamp
+
+RtecEventComm-stamp: $(srcdir)/RtecEventComm.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_RTEvent_Export -Wb,stub_export_include=orbsvcs/Event/event_export.h -Wb,skel_export_macro=TAO_RTEvent_Skel_Export -Wb,skel_export_include=orbsvcs/Event/event_skel_export.h $(srcdir)/RtecEventComm.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ RtecEventChannelAdminC.cpp \
+ RtecEventChannelAdminC.h \
+ RtecEventChannelAdminC.inl \
+ RtecEventChannelAdminS_T.cpp
+
+CLEANFILES += \
+ RtecEventChannelAdmin-stamp \
+ RtecEventChannelAdminC.cpp \
+ RtecEventChannelAdminC.h \
+ RtecEventChannelAdminC.inl \
+ RtecEventChannelAdminS_T.cpp
+
+RtecEventChannelAdminC.cpp RtecEventChannelAdminC.h RtecEventChannelAdminC.inl RtecEventChannelAdminS_T.cpp: RtecEventChannelAdmin-stamp
+
+RtecEventChannelAdmin-stamp: $(srcdir)/RtecEventChannelAdmin.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_RTEvent_Export -Wb,stub_export_include=orbsvcs/Event/event_export.h -Wb,skel_export_macro=TAO_RTEvent_Skel_Export -Wb,skel_export_include=orbsvcs/Event/event_skel_export.h $(srcdir)/RtecEventChannelAdmin.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ RtecUDPAdminC.cpp \
+ RtecUDPAdminC.h \
+ RtecUDPAdminC.inl \
+ RtecUDPAdminS_T.cpp
+
+CLEANFILES += \
+ RtecUDPAdmin-stamp \
+ RtecUDPAdminC.cpp \
+ RtecUDPAdminC.h \
+ RtecUDPAdminC.inl \
+ RtecUDPAdminS_T.cpp
+
+RtecUDPAdminC.cpp RtecUDPAdminC.h RtecUDPAdminC.inl RtecUDPAdminS_T.cpp: RtecUDPAdmin-stamp
+
+RtecUDPAdmin-stamp: $(srcdir)/RtecUDPAdmin.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_RTEvent_Export -Wb,stub_export_include=orbsvcs/Event/event_export.h -Wb,skel_export_macro=TAO_RTEvent_Skel_Export -Wb,skel_export_include=orbsvcs/Event/event_skel_export.h $(srcdir)/RtecUDPAdmin.idl
+ @touch $@
+
+lib_LTLIBRARIES += libTAO_RTEvent.la
+
+libTAO_RTEvent_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_RTEVENT_BUILD_DLL
+
+libTAO_RTEvent_la_SOURCES = \
+ Event_Utilities.cpp \
+ RtecDefaultEventDataC.cpp \
+ RtecEventChannelAdminC.cpp \
+ RtecEventCommC.cpp \
+ RtecUDPAdminC.cpp
+
+libTAO_RTEvent_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_RTEvent_la_LIBADD = \
+ libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Event/event_export.h \
+ Event/event_skel_export.h \
+ Event_Utilities.h \
+ Event_Utilities.i \
+ RtecDefaultEventData.idl \
+ RtecDefaultEventDataC.h \
+ RtecDefaultEventDataC.inl \
+ RtecEventChannelAdmin.idl \
+ RtecEventChannelAdminC.h \
+ RtecEventChannelAdminC.inl \
+ RtecEventComm.idl \
+ RtecEventCommC.h \
+ RtecEventCommC.inl \
+ RtecUDPAdmin.idl \
+ RtecUDPAdminC.h \
+ RtecUDPAdminC.inl
+
+pkgconfig_DATA += \
+ TAO_RTEvent.pc
+
+CLEANFILES += \
+ TAO_RTEvent.pc
+
+TAO_RTEvent.pc: ${top_builddir}/config.status ${srcdir}/TAO_RTEvent.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_RTEvent.pc.in
+
+EXTRA_DIST += \
+ RTEvent.rc \
+ TAO_RTEvent.pc.in
+
+
+## Makefile.RTEvent_Skel.am
+
+if BUILD_CORBA_MESSAGING
+
+lib_LTLIBRARIES += libTAO_RTEvent_Skel.la
+
+libTAO_RTEvent_Skel_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_RTEVENT_SKEL_BUILD_DLL
+
+libTAO_RTEvent_Skel_la_SOURCES = \
+ RtecDefaultEventDataS.cpp \
+ RtecEventChannelAdminS.cpp \
+ RtecEventCommS.cpp \
+ RtecUDPAdminS.cpp
+
+libTAO_RTEvent_Skel_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_RTEvent_Skel_la_LIBADD = \
+ libTAO_RTEvent.la \
+ 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
+
+nobase_include_HEADERS += \
+ Event/event_skel_export.h \
+ RtecDefaultEventDataS.h \
+ RtecDefaultEventDataS.inl \
+ RtecEventChannelAdminS.h \
+ RtecEventChannelAdminS.inl \
+ RtecEventCommS.h \
+ RtecEventCommS.inl \
+ RtecUDPAdminS.h \
+ RtecUDPAdminS.inl
+
+pkgconfig_DATA += \
+ TAO_RTEvent_Skel.pc
+
+CLEANFILES += \
+ TAO_RTEvent_Skel.pc
+
+TAO_RTEvent_Skel.pc: ${top_builddir}/config.status ${srcdir}/TAO_RTEvent_Skel.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_RTEvent_Skel.pc.in
+
+endif BUILD_CORBA_MESSAGING
+
+EXTRA_DIST += \
+ RTEvent_Skel.rc \
+ TAO_RTEvent_Skel.pc.in
+
+
+## Makefile.RTEvent_Serv.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+lib_LTLIBRARIES += libTAO_RTEvent_Serv.la
+
+libTAO_RTEvent_Serv_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_RTEVENT_SERV_BUILD_DLL
+
+libTAO_RTEvent_Serv_la_SOURCES = \
+ Event/ECG_Adapters.cpp \
+ Event/ECG_CDR_Message_Receiver.cpp \
+ Event/ECG_CDR_Message_Sender.cpp \
+ Event/ECG_Complex_Address_Server.cpp \
+ Event/ECG_ConsumerEC_Control.cpp \
+ Event/ECG_Mcast_EH.cpp \
+ Event/ECG_Mcast_Gateway.cpp \
+ Event/ECG_Reactive_ConsumerEC_Control.cpp \
+ Event/ECG_Reconnect_ConsumerEC_Control.cpp \
+ Event/ECG_Simple_Address_Server.cpp \
+ Event/ECG_Simple_Mcast_EH.cpp \
+ Event/ECG_UDP_EH.cpp \
+ Event/ECG_UDP_Out_Endpoint.cpp \
+ Event/ECG_UDP_Receiver.cpp \
+ Event/ECG_UDP_Sender.cpp \
+ Event/EC_And_Filter.cpp \
+ Event/EC_Basic_Factory.cpp \
+ Event/EC_Basic_Filter_Builder.cpp \
+ Event/EC_Bitmask_Filter.cpp \
+ Event/EC_Channel_Destroyer.cpp \
+ Event/EC_Conjunction_Filter.cpp \
+ Event/EC_ConsumerAdmin.cpp \
+ Event/EC_ConsumerControl.cpp \
+ Event/EC_Default_Factory.cpp \
+ Event/EC_Default_ProxyConsumer.cpp \
+ Event/EC_Default_ProxySupplier.cpp \
+ Event/EC_Disjunction_Filter.cpp \
+ Event/EC_Dispatching.cpp \
+ Event/EC_Dispatching_Task.cpp \
+ Event/EC_Event_Channel.cpp \
+ Event/EC_Event_Channel_Base.cpp \
+ Event/EC_Factory.cpp \
+ Event/EC_Filter.cpp \
+ Event/EC_Filter_Builder.cpp \
+ Event/EC_Gateway.cpp \
+ Event/EC_Gateway_IIOP.cpp \
+ Event/EC_Gateway_IIOP_Factory.cpp \
+ Event/EC_Group_Scheduling.cpp \
+ Event/EC_Lifetime_Utils.cpp \
+ Event/EC_MT_Dispatching.cpp \
+ Event/EC_Masked_Type_Filter.cpp \
+ Event/EC_Negation_Filter.cpp \
+ Event/EC_Null_Factory.cpp \
+ Event/EC_Null_Scheduling.cpp \
+ Event/EC_ObserverStrategy.cpp \
+ Event/EC_Per_Supplier_Filter.cpp \
+ Event/EC_Prefix_Filter_Builder.cpp \
+ Event/EC_ProxyConsumer.cpp \
+ Event/EC_ProxySupplier.cpp \
+ Event/EC_Proxy_Disconnector.cpp \
+ Event/EC_QOS_Info.cpp \
+ Event/EC_Reactive_ConsumerControl.cpp \
+ Event/EC_Reactive_Dispatching.cpp \
+ Event/EC_Reactive_SupplierControl.cpp \
+ Event/EC_Reactive_Timeout_Generator.cpp \
+ Event/EC_Scheduling_Strategy.cpp \
+ Event/EC_SupplierAdmin.cpp \
+ Event/EC_SupplierControl.cpp \
+ Event/EC_Supplier_Filter.cpp \
+ Event/EC_Supplier_Filter_Builder.cpp \
+ Event/EC_TPC_Dispatching.cpp \
+ Event/EC_TPC_Dispatching_Task.cpp \
+ Event/EC_TPC_Factory.cpp \
+ Event/EC_TPC_ProxyConsumer.cpp \
+ Event/EC_TPC_ProxySupplier.cpp \
+ Event/EC_Timeout_Filter.cpp \
+ Event/EC_Timeout_Generator.cpp \
+ Event/EC_Trivial_Supplier_Filter.cpp \
+ Event/EC_Type_Filter.cpp \
+ Event/EC_UDP_Admin.cpp
+
+libTAO_RTEvent_Serv_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_RTEvent_Serv_la_LIBADD = \
+ libTAO_RTEvent_Skel.la \
+ libTAO_RTEvent.la \
+ 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
+
+nobase_include_HEADERS += \
+ Channel_Clients_T.cpp \
+ Channel_Clients_T.h \
+ Channel_Clients_T.i \
+ Event/ECG_Adapters.h \
+ Event/ECG_CDR_Message_Receiver.h \
+ Event/ECG_CDR_Message_Receiver.i \
+ Event/ECG_CDR_Message_Sender.h \
+ Event/ECG_CDR_Message_Sender.i \
+ Event/ECG_Complex_Address_Server.h \
+ Event/ECG_Complex_Address_Server.i \
+ Event/ECG_ConsumerEC_Control.h \
+ Event/ECG_Mcast_EH.h \
+ Event/ECG_Mcast_EH.i \
+ Event/ECG_Mcast_Gateway.h \
+ Event/ECG_Mcast_Gateway.i \
+ Event/ECG_Reactive_ConsumerEC_Control.h \
+ Event/ECG_Reconnect_ConsumerEC_Control.h \
+ Event/ECG_Simple_Address_Server.h \
+ Event/ECG_Simple_Address_Server.i \
+ Event/ECG_Simple_Mcast_EH.h \
+ Event/ECG_UDP_EH.h \
+ Event/ECG_UDP_EH.i \
+ Event/ECG_UDP_Out_Endpoint.h \
+ Event/ECG_UDP_Out_Endpoint.i \
+ Event/ECG_UDP_Receiver.h \
+ Event/ECG_UDP_Receiver.i \
+ Event/ECG_UDP_Sender.h \
+ Event/ECG_UDP_Sender.inl \
+ Event/EC_And_Filter.h \
+ Event/EC_Basic_Factory.h \
+ Event/EC_Basic_Filter_Builder.h \
+ Event/EC_Basic_Filter_Builder.i \
+ Event/EC_Bitmask_Filter.h \
+ Event/EC_Busy_Lock.cpp \
+ Event/EC_Busy_Lock.h \
+ Event/EC_Busy_Lock.i \
+ Event/EC_Channel_Destroyer.h \
+ Event/EC_Conjunction_Filter.h \
+ Event/EC_ConsumerAdmin.h \
+ Event/EC_ConsumerControl.h \
+ Event/EC_Default_Factory.h \
+ Event/EC_Default_Factory.i \
+ Event/EC_Default_ProxyConsumer.h \
+ Event/EC_Default_ProxySupplier.h \
+ Event/EC_Disjunction_Filter.h \
+ Event/EC_Dispatching.h \
+ Event/EC_Dispatching_Task.h \
+ Event/EC_Dispatching_Task.i \
+ Event/EC_Event_Channel.h \
+ Event/EC_Event_Channel_Base.h \
+ Event/EC_Event_Channel_Base.i \
+ Event/EC_Factory.h \
+ Event/EC_Filter.h \
+ Event/EC_Filter.i \
+ Event/EC_Filter_Builder.h \
+ Event/EC_Filter_Builder.i \
+ Event/EC_Gateway.h \
+ Event/EC_Gateway_IIOP.h \
+ Event/EC_Gateway_IIOP_Factory.h \
+ Event/EC_Gateway_IIOP_Factory.i \
+ Event/EC_Group_Scheduling.h \
+ Event/EC_Group_Scheduling.inl \
+ Event/EC_Lifetime_Utils.h \
+ Event/EC_Lifetime_Utils.i \
+ Event/EC_Lifetime_Utils_T.cpp \
+ Event/EC_Lifetime_Utils_T.h \
+ Event/EC_Lifetime_Utils_T.i \
+ Event/EC_MT_Dispatching.h \
+ Event/EC_Masked_Type_Filter.h \
+ Event/EC_Negation_Filter.h \
+ Event/EC_Null_Factory.h \
+ Event/EC_Null_Scheduling.h \
+ Event/EC_Null_Scheduling.i \
+ Event/EC_ObserverStrategy.h \
+ Event/EC_ObserverStrategy.i \
+ Event/EC_Per_Supplier_Filter.h \
+ Event/EC_Per_Supplier_Filter.i \
+ Event/EC_Prefix_Filter_Builder.h \
+ Event/EC_Prefix_Filter_Builder.i \
+ Event/EC_ProxyConsumer.h \
+ Event/EC_ProxyConsumer.i \
+ Event/EC_ProxySupplier.h \
+ Event/EC_ProxySupplier.i \
+ Event/EC_Proxy_Disconnector.h \
+ Event/EC_QOS_Info.h \
+ Event/EC_QOS_Info.i \
+ Event/EC_Reactive_ConsumerControl.h \
+ Event/EC_Reactive_ConsumerControl.i \
+ Event/EC_Reactive_Dispatching.h \
+ Event/EC_Reactive_SupplierControl.h \
+ Event/EC_Reactive_SupplierControl.i \
+ Event/EC_Reactive_Timeout_Generator.h \
+ Event/EC_Scheduling_Strategy.h \
+ Event/EC_SupplierAdmin.h \
+ Event/EC_SupplierControl.h \
+ Event/EC_Supplier_Filter.h \
+ Event/EC_Supplier_Filter.i \
+ Event/EC_Supplier_Filter_Builder.h \
+ Event/EC_TPC_Dispatching.h \
+ Event/EC_TPC_Dispatching_Task.h \
+ Event/EC_TPC_Factory.h \
+ Event/EC_TPC_ProxyConsumer.h \
+ Event/EC_TPC_ProxySupplier.h \
+ Event/EC_TPC_ProxySupplier.i \
+ Event/EC_Timeout_Filter.h \
+ Event/EC_Timeout_Filter.i \
+ Event/EC_Timeout_Generator.h \
+ Event/EC_Timeout_Generator.i \
+ Event/EC_Trivial_Supplier_Filter.h \
+ Event/EC_Type_Filter.h \
+ Event/EC_UDP_Admin.h
+
+pkgconfig_DATA += \
+ TAO_RTEvent_Serv.pc
+
+CLEANFILES += \
+ TAO_RTEvent_Serv.pc
+
+TAO_RTEvent_Serv.pc: ${top_builddir}/config.status ${srcdir}/TAO_RTEvent_Serv.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_RTEvent_Serv.pc.in
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+EXTRA_DIST += \
+ RTEvent_Serv.rc \
+ TAO_RTEvent_Serv.pc.in
+
+
+## Makefile.FtRtEvent.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES += \
+ FTRTC.cpp \
+ FTRTC.h \
+ FTRTC.inl \
+ FTRTS.cpp \
+ FTRTS.h \
+ FTRTS.inl \
+ FTRTS_T.cpp \
+ FTRTS_T.h \
+ FTRTS_T.inl
+
+CLEANFILES += \
+ FTRT-stamp \
+ FTRTC.cpp \
+ FTRTC.h \
+ FTRTC.inl \
+ FTRTS.cpp \
+ FTRTS.h \
+ FTRTS.inl \
+ FTRTS_T.cpp \
+ FTRTS_T.h \
+ FTRTS_T.inl
+
+FTRTC.cpp FTRTC.h FTRTC.inl FTRTS.cpp FTRTS.h FTRTS.inl FTRTS_T.cpp FTRTS_T.h FTRTS_T.inl: FTRT-stamp
+
+FTRT-stamp: $(srcdir)/FTRT.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_FtRtEvent_Export -Wb,export_include=orbsvcs/FtRtEvent/Utils/ftrtevent_export.h -GC $(srcdir)/FTRT.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ FtRtecEventCommC.cpp \
+ FtRtecEventCommC.h \
+ FtRtecEventCommC.inl \
+ FtRtecEventCommS.cpp \
+ FtRtecEventCommS.h \
+ FtRtecEventCommS.inl \
+ FtRtecEventCommS_T.cpp \
+ FtRtecEventCommS_T.h \
+ FtRtecEventCommS_T.inl
+
+CLEANFILES += \
+ FtRtecEventComm-stamp \
+ FtRtecEventCommC.cpp \
+ FtRtecEventCommC.h \
+ FtRtecEventCommC.inl \
+ FtRtecEventCommS.cpp \
+ FtRtecEventCommS.h \
+ FtRtecEventCommS.inl \
+ FtRtecEventCommS_T.cpp \
+ FtRtecEventCommS_T.h \
+ FtRtecEventCommS_T.inl
+
+FtRtecEventCommC.cpp FtRtecEventCommC.h FtRtecEventCommC.inl FtRtecEventCommS.cpp FtRtecEventCommS.h FtRtecEventCommS.inl FtRtecEventCommS_T.cpp FtRtecEventCommS_T.h FtRtecEventCommS_T.inl: FtRtecEventComm-stamp
+
+FtRtecEventComm-stamp: $(srcdir)/FtRtecEventComm.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_FtRtEvent_Export -Wb,export_include=orbsvcs/FtRtEvent/Utils/ftrtevent_export.h -GC $(srcdir)/FtRtecEventComm.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ FTRT_GroupManagerC.cpp \
+ FTRT_GroupManagerC.h \
+ FTRT_GroupManagerC.inl \
+ FTRT_GroupManagerS.cpp \
+ FTRT_GroupManagerS.h \
+ FTRT_GroupManagerS.inl \
+ FTRT_GroupManagerS_T.cpp \
+ FTRT_GroupManagerS_T.h \
+ FTRT_GroupManagerS_T.inl
+
+CLEANFILES += \
+ FTRT_GroupManager-stamp \
+ FTRT_GroupManagerC.cpp \
+ FTRT_GroupManagerC.h \
+ FTRT_GroupManagerC.inl \
+ FTRT_GroupManagerS.cpp \
+ FTRT_GroupManagerS.h \
+ FTRT_GroupManagerS.inl \
+ FTRT_GroupManagerS_T.cpp \
+ FTRT_GroupManagerS_T.h \
+ FTRT_GroupManagerS_T.inl
+
+FTRT_GroupManagerC.cpp FTRT_GroupManagerC.h FTRT_GroupManagerC.inl FTRT_GroupManagerS.cpp FTRT_GroupManagerS.h FTRT_GroupManagerS.inl FTRT_GroupManagerS_T.cpp FTRT_GroupManagerS_T.h FTRT_GroupManagerS_T.inl: FTRT_GroupManager-stamp
+
+FTRT_GroupManager-stamp: $(srcdir)/FTRT_GroupManager.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_FtRtEvent_Export -Wb,export_include=orbsvcs/FtRtEvent/Utils/ftrtevent_export.h -GC $(srcdir)/FTRT_GroupManager.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ FtRtecEventChannelAdminC.cpp \
+ FtRtecEventChannelAdminC.h \
+ FtRtecEventChannelAdminC.inl \
+ FtRtecEventChannelAdminS.cpp \
+ FtRtecEventChannelAdminS.h \
+ FtRtecEventChannelAdminS.inl \
+ FtRtecEventChannelAdminS_T.cpp \
+ FtRtecEventChannelAdminS_T.h \
+ FtRtecEventChannelAdminS_T.inl
+
+CLEANFILES += \
+ FtRtecEventChannelAdmin-stamp \
+ FtRtecEventChannelAdminC.cpp \
+ FtRtecEventChannelAdminC.h \
+ FtRtecEventChannelAdminC.inl \
+ FtRtecEventChannelAdminS.cpp \
+ FtRtecEventChannelAdminS.h \
+ FtRtecEventChannelAdminS.inl \
+ FtRtecEventChannelAdminS_T.cpp \
+ FtRtecEventChannelAdminS_T.h \
+ FtRtecEventChannelAdminS_T.inl
+
+FtRtecEventChannelAdminC.cpp FtRtecEventChannelAdminC.h FtRtecEventChannelAdminC.inl FtRtecEventChannelAdminS.cpp FtRtecEventChannelAdminS.h FtRtecEventChannelAdminS.inl FtRtecEventChannelAdminS_T.cpp FtRtecEventChannelAdminS_T.h FtRtecEventChannelAdminS_T.inl: FtRtecEventChannelAdmin-stamp
+
+FtRtecEventChannelAdmin-stamp: $(srcdir)/FtRtecEventChannelAdmin.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_FtRtEvent_Export -Wb,export_include=orbsvcs/FtRtEvent/Utils/ftrtevent_export.h $(srcdir)/FtRtecEventChannelAdmin.idl
+ @touch $@
+
+lib_LTLIBRARIES += libTAO_FtRtEvent.la
+
+libTAO_FtRtEvent_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_FTRTEVENT_BUILD_DLL
+
+libTAO_FtRtEvent_la_SOURCES = \
+ FTRTC.cpp \
+ FTRTS.cpp \
+ FTRT_GroupManagerC.cpp \
+ FTRT_GroupManagerS.cpp \
+ FtRtEvent/Utils/FTEC_Gateway.cpp \
+ FtRtEvent/Utils/Log.cpp \
+ FtRtEvent/Utils/Safe_InputCDR.cpp \
+ FtRtEvent/Utils/UUID.cpp \
+ FtRtecEventChannelAdminC.cpp \
+ FtRtecEventChannelAdminS.cpp \
+ FtRtecEventCommC.cpp \
+ FtRtecEventCommS.cpp
+
+libTAO_FtRtEvent_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_FtRtEvent_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ libTAO_RTEvent_Serv.la \
+ libTAO_RTEvent_Skel.la \
+ libTAO_RTEvent.la \
+ libTAO_Svc_Utils.la \
+ libTAO_FTORB_Utils.la \
+ 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 \
+ 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
+
+nobase_include_HEADERS += \
+ FTRT.idl \
+ FTRTC.h \
+ FTRTC.inl \
+ FTRTS.h \
+ FTRTS.inl \
+ FTRTS_T.cpp \
+ FTRTS_T.h \
+ FTRTS_T.inl \
+ FTRT_GroupManager.idl \
+ FTRT_GroupManagerC.h \
+ FTRT_GroupManagerC.inl \
+ FTRT_GroupManagerS.h \
+ FTRT_GroupManagerS.inl \
+ FTRT_GroupManagerS_T.cpp \
+ FTRT_GroupManagerS_T.h \
+ FTRT_GroupManagerS_T.inl \
+ FtRtEvent/Utils/FTEC_Gateway.h \
+ FtRtEvent/Utils/FTEC_Gateway.inl \
+ FtRtEvent/Utils/Log.h \
+ FtRtEvent/Utils/Log.inl \
+ FtRtEvent/Utils/Safe_InputCDR.h \
+ FtRtEvent/Utils/Safe_InputCDR.inl \
+ FtRtEvent/Utils/UUID.h \
+ FtRtEvent/Utils/UUID.inl \
+ FtRtecEventChannelAdmin.idl \
+ FtRtecEventChannelAdminC.h \
+ FtRtecEventChannelAdminC.inl \
+ FtRtecEventChannelAdminS.h \
+ FtRtecEventChannelAdminS.inl \
+ FtRtecEventChannelAdminS_T.cpp \
+ FtRtecEventChannelAdminS_T.h \
+ FtRtecEventChannelAdminS_T.inl \
+ FtRtecEventComm.idl \
+ FtRtecEventCommC.h \
+ FtRtecEventCommC.inl \
+ FtRtecEventCommS.h \
+ FtRtecEventCommS.inl \
+ FtRtecEventCommS_T.cpp \
+ FtRtecEventCommS_T.h \
+ FtRtecEventCommS_T.inl
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.FTRT_EventChannel.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_FTRT_EventChannel.la
+
+libTAO_FTRT_EventChannel_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_FTRTEC_BUILD_DLL
+
+libTAO_FTRT_EventChannel_la_SOURCES = \
+ FtRtEvent/EventChannel/AMI_Primary_Replication_Strategy.cpp \
+ FtRtEvent/EventChannel/AMI_Replication_Strategy.cpp \
+ FtRtEvent/EventChannel/Basic_Replication_Strategy.cpp \
+ FtRtEvent/EventChannel/Dynamic_Bitset.cpp \
+ FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.cpp \
+ FtRtEvent/EventChannel/FTEC_ConsumerAdmin.cpp \
+ FtRtEvent/EventChannel/FTEC_Event_Channel.cpp \
+ FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.cpp \
+ FtRtEvent/EventChannel/FTEC_Factory.cpp \
+ FtRtEvent/EventChannel/FTEC_Group_Manager.cpp \
+ FtRtEvent/EventChannel/FTEC_ORBInitializer.cpp \
+ FtRtEvent/EventChannel/FTEC_ProxyConsumer.cpp \
+ FtRtEvent/EventChannel/FTEC_ProxySupplier.cpp \
+ FtRtEvent/EventChannel/FTEC_SupplierAdmin.cpp \
+ FtRtEvent/EventChannel/FT_ProxyAdmin_Base.cpp \
+ FtRtEvent/EventChannel/Fault_Detector.cpp \
+ FtRtEvent/EventChannel/Fault_Detector_Loader.cpp \
+ FtRtEvent/EventChannel/ForwardCtrlServerInterceptor.cpp \
+ FtRtEvent/EventChannel/FtEventServiceInterceptor.cpp \
+ FtRtEvent/EventChannel/GroupInfoPublisher.cpp \
+ FtRtEvent/EventChannel/IOGR_Maker.cpp \
+ FtRtEvent/EventChannel/Identification_Service.cpp \
+ FtRtEvent/EventChannel/ObjectGroupManagerHandler.cpp \
+ FtRtEvent/EventChannel/ProxyConsumerStateWorker.cpp \
+ FtRtEvent/EventChannel/ProxySupplierStateWorker.cpp \
+ FtRtEvent/EventChannel/Replication_Service.cpp \
+ FtRtEvent/EventChannel/Replication_Strategy.cpp \
+ FtRtEvent/EventChannel/Request_Context_Repository.cpp \
+ FtRtEvent/EventChannel/SCTP_Fault_Detector.cpp \
+ FtRtEvent/EventChannel/Set_Update_Interceptor.cpp \
+ FtRtEvent/EventChannel/Update_Manager.cpp \
+ FtRtEvent/EventChannel/UpdateableHandler.cpp \
+ FtRtEvent/EventChannel/create_persistent_poa.cpp \
+ FtRtEvent/EventChannel/replace_key.cpp
+
+libTAO_FTRT_EventChannel_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_FTRT_EventChannel_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ libTAO_FtRtEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ libTAO_RTEvent_Serv.la \
+ libTAO_RTEvent_Skel.la \
+ libTAO_RTEvent.la \
+ libTAO_Svc_Utils.la \
+ libTAO_FTORB_Utils.la \
+ 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 \
+ 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
+
+nobase_include_HEADERS += \
+ FtRtEvent/EventChannel/AMI_Primary_Replication_Strategy.h \
+ FtRtEvent/EventChannel/AMI_Replication_Strategy.h \
+ FtRtEvent/EventChannel/Basic_Replication_Strategy.h \
+ FtRtEvent/EventChannel/ConnectionHandler_T.cpp \
+ FtRtEvent/EventChannel/ConnectionHandler_T.h \
+ FtRtEvent/EventChannel/Dynamic_Bitset.h \
+ FtRtEvent/EventChannel/Dynamic_Bitset.inl \
+ FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.h \
+ FtRtEvent/EventChannel/FTEC_ConsumerAdmin.h \
+ FtRtEvent/EventChannel/FTEC_Event_Channel.h \
+ FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.h \
+ FtRtEvent/EventChannel/FTEC_Factory.h \
+ FtRtEvent/EventChannel/FTEC_Group_Manager.h \
+ FtRtEvent/EventChannel/FTEC_ORBInitializer.h \
+ FtRtEvent/EventChannel/FTEC_ProxyConsumer.h \
+ FtRtEvent/EventChannel/FTEC_ProxySupplier.h \
+ FtRtEvent/EventChannel/FTEC_SupplierAdmin.h \
+ FtRtEvent/EventChannel/FT_ProxyAdmin_Base.h \
+ FtRtEvent/EventChannel/FT_ProxyAdmin_T.cpp \
+ FtRtEvent/EventChannel/FT_ProxyAdmin_T.h \
+ FtRtEvent/EventChannel/Fault_Detector.h \
+ FtRtEvent/EventChannel/Fault_Detector_Loader.h \
+ FtRtEvent/EventChannel/Fault_Detector_T.cpp \
+ FtRtEvent/EventChannel/Fault_Detector_T.h \
+ FtRtEvent/EventChannel/ForwardCtrlServerInterceptor.h \
+ FtRtEvent/EventChannel/FtEventServiceInterceptor.h \
+ FtRtEvent/EventChannel/GroupInfoPublisher.h \
+ FtRtEvent/EventChannel/IOGR_Maker.h \
+ FtRtEvent/EventChannel/Identification_Service.h \
+ FtRtEvent/EventChannel/ObjectGroupManagerHandler.h \
+ FtRtEvent/EventChannel/ProxyConsumerStateWorker.h \
+ FtRtEvent/EventChannel/ProxySupplierStateWorker.h \
+ FtRtEvent/EventChannel/Replication_Service.h \
+ FtRtEvent/EventChannel/Replication_Strategy.h \
+ FtRtEvent/EventChannel/Request_Context_Repository.h \
+ FtRtEvent/EventChannel/SCTP_Fault_Detector.h \
+ FtRtEvent/EventChannel/Set_Update_Interceptor.h \
+ FtRtEvent/EventChannel/Update_Manager.h \
+ FtRtEvent/EventChannel/UpdateableHandler.h \
+ FtRtEvent/EventChannel/create_persistent_poa.h \
+ FtRtEvent/EventChannel/ftrtec_export.h
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.FT_ClientORB.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_FT_ClientORB.la
+
+libTAO_FT_ClientORB_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_FT_CLIENTORB_BUILD_DLL
+
+libTAO_FT_ClientORB_la_SOURCES = \
+ FaultTolerance/FT_ClientORBInitializer.cpp \
+ FaultTolerance/FT_ClientPolicyFactory.cpp \
+ FaultTolerance/FT_ClientPolicy_i.cpp \
+ FaultTolerance/FT_ClientRequest_Interceptor.cpp \
+ FaultTolerance/FT_ClientService_Activate.cpp \
+ FaultTolerance/FT_Endpoint_Selector_Factory.cpp \
+ FaultTolerance/FT_Invocation_Endpoint_Selectors.cpp \
+ FaultTolerance/FT_Service_Callbacks.cpp
+
+libTAO_FT_ClientORB_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_FT_ClientORB_la_LIBADD = \
+ libTAO_FTORB_Utils.la \
+ 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 \
+ 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
+
+nobase_include_HEADERS += \
+ FaultTolerance/FT_ClientORBInitializer.h \
+ FaultTolerance/FT_ClientPolicyFactory.h \
+ FaultTolerance/FT_ClientPolicy_i.h \
+ FaultTolerance/FT_ClientPolicy_i.inl \
+ FaultTolerance/FT_ClientRequest_Interceptor.h \
+ FaultTolerance/FT_ClientService_Activate.h \
+ FaultTolerance/FT_Endpoint_Selector_Factory.h \
+ FaultTolerance/FT_Invocation_Endpoint_Selectors.h \
+ FaultTolerance/FT_Service_Callbacks.h
+
+pkgconfig_DATA += \
+ TAO_FT_ClientORB.pc
+
+CLEANFILES += \
+ TAO_FT_ClientORB.pc
+
+TAO_FT_ClientORB.pc: ${top_builddir}/config.status ${srcdir}/TAO_FT_ClientORB.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_FT_ClientORB.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+EXTRA_DIST += \
+ TAO_FT_ClientORB.pc.in
+
+
+## Makefile.FT_ServerORB.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_FT_ServerORB.la
+
+libTAO_FT_ServerORB_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_FT_SERVERORB_BUILD_DLL
+
+libTAO_FT_ServerORB_la_SOURCES = \
+ FaultTolerance/FT_ServerORBInitializer.cpp \
+ FaultTolerance/FT_ServerPolicyFactory.cpp \
+ FaultTolerance/FT_ServerPolicy_i.cpp \
+ FaultTolerance/FT_ServerRequest_Interceptor.cpp \
+ FaultTolerance/FT_ServerService_Activate.cpp
+
+libTAO_FT_ServerORB_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_FT_ServerORB_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ libTAO_FTORB_Utils.la \
+ 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 \
+ 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
+
+nobase_include_HEADERS += \
+ FaultTolerance/FT_ServerORBInitializer.h \
+ FaultTolerance/FT_ServerPolicyFactory.h \
+ FaultTolerance/FT_ServerPolicy_i.h \
+ FaultTolerance/FT_ServerPolicy_i.inl \
+ FaultTolerance/FT_ServerRequest_Interceptor.h \
+ FaultTolerance/FT_ServerService_Activate.h
+
+pkgconfig_DATA += \
+ TAO_FT_ServerORB.pc
+
+CLEANFILES += \
+ TAO_FT_ServerORB.pc
+
+TAO_FT_ServerORB.pc: ${top_builddir}/config.status ${srcdir}/TAO_FT_ServerORB.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_FT_ServerORB.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+
+EXTRA_DIST += \
+ TAO_FT_ServerORB.pc.in
+
+
+## Makefile.FaultTolerance.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES += \
+ FT_CORBAC.cpp \
+ FT_CORBAC.h \
+ FT_CORBAC.inl \
+ FT_CORBAS.cpp \
+ FT_CORBAS.h \
+ FT_CORBAS.inl \
+ FT_CORBAS_T.cpp \
+ FT_CORBAS_T.inl
+
+CLEANFILES += \
+ FT_CORBA-stamp \
+ FT_CORBAC.cpp \
+ FT_CORBAC.h \
+ FT_CORBAC.inl \
+ FT_CORBAS.cpp \
+ FT_CORBAS.h \
+ FT_CORBAS.inl \
+ FT_CORBAS_T.cpp \
+ FT_CORBAS_T.inl
+
+FT_CORBAC.cpp FT_CORBAC.h FT_CORBAC.inl FT_CORBAS.cpp FT_CORBAS.h FT_CORBAS.inl FT_CORBAS_T.cpp FT_CORBAS_T.inl: FT_CORBA-stamp
+
+FT_CORBA-stamp: $(srcdir)/FT_CORBA.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_FT_Export -Wb,export_include=orbsvcs/FaultTolerance/fault_tol_export.h -Wb,skel_export_include=tao/PortableServer/PolicyS.h $(srcdir)/FT_CORBA.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ FT_ReplicaC.cpp \
+ FT_ReplicaC.h \
+ FT_ReplicaC.inl \
+ FT_ReplicaS.cpp \
+ FT_ReplicaS.h \
+ FT_ReplicaS.inl \
+ FT_ReplicaS_T.cpp \
+ FT_ReplicaS_T.inl
+
+CLEANFILES += \
+ FT_Replica-stamp \
+ FT_ReplicaC.cpp \
+ FT_ReplicaC.h \
+ FT_ReplicaC.inl \
+ FT_ReplicaS.cpp \
+ FT_ReplicaS.h \
+ FT_ReplicaS.inl \
+ FT_ReplicaS_T.cpp \
+ FT_ReplicaS_T.inl
+
+FT_ReplicaC.cpp FT_ReplicaC.h FT_ReplicaC.inl FT_ReplicaS.cpp FT_ReplicaS.h FT_ReplicaS.inl FT_ReplicaS_T.cpp FT_ReplicaS_T.inl: FT_Replica-stamp
+
+FT_Replica-stamp: $(srcdir)/FT_Replica.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_FT_Export -Wb,export_include=orbsvcs/FaultTolerance/fault_tol_export.h -Wb,skel_export_include=tao/PortableServer/PolicyS.h $(srcdir)/FT_Replica.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ FT_NotifierC.cpp \
+ FT_NotifierC.h \
+ FT_NotifierC.inl \
+ FT_NotifierS.cpp \
+ FT_NotifierS.h \
+ FT_NotifierS.inl \
+ FT_NotifierS_T.cpp \
+ FT_NotifierS_T.inl
+
+CLEANFILES += \
+ FT_Notifier-stamp \
+ FT_NotifierC.cpp \
+ FT_NotifierC.h \
+ FT_NotifierC.inl \
+ FT_NotifierS.cpp \
+ FT_NotifierS.h \
+ FT_NotifierS.inl \
+ FT_NotifierS_T.cpp \
+ FT_NotifierS_T.inl
+
+FT_NotifierC.cpp FT_NotifierC.h FT_NotifierC.inl FT_NotifierS.cpp FT_NotifierS.h FT_NotifierS.inl FT_NotifierS_T.cpp FT_NotifierS_T.inl: FT_Notifier-stamp
+
+FT_Notifier-stamp: $(srcdir)/FT_Notifier.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_FT_Export -Wb,export_include=orbsvcs/FaultTolerance/fault_tol_export.h -Wb,skel_export_include=tao/PortableServer/PolicyS.h $(srcdir)/FT_Notifier.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ FT_FaultDetectorFactoryC.cpp \
+ FT_FaultDetectorFactoryC.h \
+ FT_FaultDetectorFactoryC.inl \
+ FT_FaultDetectorFactoryS.cpp \
+ FT_FaultDetectorFactoryS.h \
+ FT_FaultDetectorFactoryS.inl \
+ FT_FaultDetectorFactoryS_T.cpp \
+ FT_FaultDetectorFactoryS_T.inl
+
+CLEANFILES += \
+ FT_FaultDetectorFactory-stamp \
+ FT_FaultDetectorFactoryC.cpp \
+ FT_FaultDetectorFactoryC.h \
+ FT_FaultDetectorFactoryC.inl \
+ FT_FaultDetectorFactoryS.cpp \
+ FT_FaultDetectorFactoryS.h \
+ FT_FaultDetectorFactoryS.inl \
+ FT_FaultDetectorFactoryS_T.cpp \
+ FT_FaultDetectorFactoryS_T.inl
+
+FT_FaultDetectorFactoryC.cpp FT_FaultDetectorFactoryC.h FT_FaultDetectorFactoryC.inl FT_FaultDetectorFactoryS.cpp FT_FaultDetectorFactoryS.h FT_FaultDetectorFactoryS.inl FT_FaultDetectorFactoryS_T.cpp FT_FaultDetectorFactoryS_T.inl: FT_FaultDetectorFactory-stamp
+
+FT_FaultDetectorFactory-stamp: $(srcdir)/FT_FaultDetectorFactory.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_FT_Export -Wb,export_include=orbsvcs/FaultTolerance/fault_tol_export.h -Wb,skel_export_include=tao/PortableServer/PolicyS.h $(srcdir)/FT_FaultDetectorFactory.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ FT_ReplicationManagerC.cpp \
+ FT_ReplicationManagerC.h \
+ FT_ReplicationManagerC.inl \
+ FT_ReplicationManagerS.cpp \
+ FT_ReplicationManagerS.h \
+ FT_ReplicationManagerS.inl \
+ FT_ReplicationManagerS_T.cpp \
+ FT_ReplicationManagerS_T.inl
+
+CLEANFILES += \
+ FT_ReplicationManager-stamp \
+ FT_ReplicationManagerC.cpp \
+ FT_ReplicationManagerC.h \
+ FT_ReplicationManagerC.inl \
+ FT_ReplicationManagerS.cpp \
+ FT_ReplicationManagerS.h \
+ FT_ReplicationManagerS.inl \
+ FT_ReplicationManagerS_T.cpp \
+ FT_ReplicationManagerS_T.inl
+
+FT_ReplicationManagerC.cpp FT_ReplicationManagerC.h FT_ReplicationManagerC.inl FT_ReplicationManagerS.cpp FT_ReplicationManagerS.h FT_ReplicationManagerS.inl FT_ReplicationManagerS_T.cpp FT_ReplicationManagerS_T.inl: FT_ReplicationManager-stamp
+
+FT_ReplicationManager-stamp: $(srcdir)/FT_ReplicationManager.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_FT_Export -Wb,export_include=orbsvcs/FaultTolerance/fault_tol_export.h -Wb,skel_export_include=tao/PortableServer/PolicyS.h $(srcdir)/FT_ReplicationManager.idl
+ @touch $@
+
+lib_LTLIBRARIES += libTAO_FaultTolerance.la
+
+libTAO_FaultTolerance_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_FT_BUILD_DLL
+
+libTAO_FaultTolerance_la_SOURCES = \
+ FT_CORBAC.cpp \
+ FT_CORBAS.cpp \
+ FT_FaultDetectorFactoryC.cpp \
+ FT_FaultDetectorFactoryS.cpp \
+ FT_NotifierC.cpp \
+ FT_NotifierS.cpp \
+ FT_ReplicaC.cpp \
+ FT_ReplicaS.cpp \
+ FT_ReplicationManagerC.cpp \
+ FT_ReplicationManagerS.cpp
+
+libTAO_FaultTolerance_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_FaultTolerance_la_LIBADD = \
+ libTAO_FT_ServerORB.la \
+ libTAO_FT_ClientORB.la \
+ libTAO_FTORB_Utils.la \
+ libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ libTAO_CosNotification.la \
+ libTAO_CosEvent.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_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ FT_CORBA.idl \
+ FT_CORBAC.h \
+ FT_CORBAC.inl \
+ FT_CORBAS.h \
+ FT_CORBAS.inl \
+ FT_CORBAS_T.cpp \
+ FT_CORBAS_T.inl \
+ FT_FaultDetectorFactory.idl \
+ FT_FaultDetectorFactoryC.h \
+ FT_FaultDetectorFactoryC.inl \
+ FT_FaultDetectorFactoryS.h \
+ FT_FaultDetectorFactoryS.inl \
+ FT_FaultDetectorFactoryS_T.cpp \
+ FT_FaultDetectorFactoryS_T.inl \
+ FT_Notifier.idl \
+ FT_NotifierC.h \
+ FT_NotifierC.inl \
+ FT_NotifierS.h \
+ FT_NotifierS.inl \
+ FT_NotifierS_T.cpp \
+ FT_NotifierS_T.inl \
+ FT_Replica.idl \
+ FT_ReplicaC.h \
+ FT_ReplicaC.inl \
+ FT_ReplicaS.h \
+ FT_ReplicaS.inl \
+ FT_ReplicaS_T.cpp \
+ FT_ReplicaS_T.inl \
+ FT_ReplicationManager.idl \
+ FT_ReplicationManagerC.h \
+ FT_ReplicationManagerC.inl \
+ FT_ReplicationManagerS.h \
+ FT_ReplicationManagerS.inl \
+ FT_ReplicationManagerS_T.cpp \
+ FT_ReplicationManagerS_T.inl \
+ FaultTolerance/fault_tol_export.h
+
+pkgconfig_DATA += \
+ TAO_FaultTolerance.pc
+
+CLEANFILES += \
+ TAO_FaultTolerance.pc
+
+TAO_FaultTolerance.pc: ${top_builddir}/config.status ${srcdir}/TAO_FaultTolerance.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_FaultTolerance.pc.in
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+EXTRA_DIST += \
+ FaultTolerance.rc \
+ TAO_FaultTolerance.pc.in
+
+
+## Makefile.HTIOP.am
+
+if !BUILD_ACE_FOR_TAO
+
+BUILT_SOURCES += \
+ HTIOPC.cpp \
+ HTIOPC.h \
+ HTIOPC.inl \
+ HTIOPS.h \
+ HTIOPS.inl \
+ HTIOPS_T.cpp \
+ HTIOPS_T.h \
+ HTIOPS_T.inl
+
+CLEANFILES += \
+ HTIOP-stamp \
+ HTIOPC.cpp \
+ HTIOPC.h \
+ HTIOPC.inl \
+ HTIOPS.h \
+ HTIOPS.inl \
+ HTIOPS_T.cpp \
+ HTIOPS_T.h \
+ HTIOPS_T.inl
+
+HTIOPC.cpp HTIOPC.h HTIOPC.inl HTIOPS.h HTIOPS.inl HTIOPS_T.cpp HTIOPS_T.h HTIOPS_T.inl: HTIOP-stamp
+
+HTIOP-stamp: $(srcdir)/HTIOP.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=HTIOP_Export -Wb,export_include=orbsvcs/HTIOP/HTIOP_Export.h $(srcdir)/HTIOP.idl
+ @touch $@
+
+lib_LTLIBRARIES += libTAO_HTIOP.la
+
+libTAO_HTIOP_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(ACE_ROOT)/protocols \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DHTIOP_BUILD_DLL
+
+libTAO_HTIOP_la_SOURCES = \
+ HTIOP/HTIOP_Acceptor.cpp \
+ HTIOP/HTIOP_Acceptor_Impl.cpp \
+ HTIOP/HTIOP_Completion_Handler.cpp \
+ HTIOP/HTIOP_Connection_Handler.cpp \
+ HTIOP/HTIOP_Connector.cpp \
+ HTIOP/HTIOP_Connector_Impl.cpp \
+ HTIOP/HTIOP_Endpoint.cpp \
+ HTIOP/HTIOP_Factory.cpp \
+ HTIOP/HTIOP_Profile.cpp \
+ HTIOP/HTIOP_Transport.cpp \
+ HTIOP/htiop_endpointsC.cpp \
+ HTIOPC.cpp
+
+libTAO_HTIOP_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_HTIOP_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/protocols/ace/HTBP/libACE_HTBP.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ HTIOP.idl \
+ HTIOP/HTIOP_Acceptor.h \
+ HTIOP/HTIOP_Acceptor.i \
+ HTIOP/HTIOP_Acceptor_Impl.h \
+ HTIOP/HTIOP_Completion_Handler.h \
+ HTIOP/HTIOP_Connection_Handler.h \
+ HTIOP/HTIOP_Connector.h \
+ HTIOP/HTIOP_Connector_Impl.h \
+ HTIOP/HTIOP_Endpoint.h \
+ HTIOP/HTIOP_Endpoint.i \
+ HTIOP/HTIOP_Factory.h \
+ HTIOP/HTIOP_Profile.h \
+ HTIOP/HTIOP_Transport.h \
+ HTIOP/htiop_endpoints.pidl \
+ HTIOP/htiop_endpointsC.h \
+ HTIOPC.h \
+ HTIOPC.inl \
+ HTIOPS.h \
+ HTIOPS.inl \
+ HTIOPS_T.cpp \
+ HTIOPS_T.h \
+ HTIOPS_T.inl
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.IFRService.am
+
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_IFRService.la
+
+libTAO_IFRService_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_IFRSERVICE_BUILD_DLL
+
+libTAO_IFRService_la_SOURCES = \
+ IFRService/AbstractInterfaceDef_i.cpp \
+ IFRService/AliasDef_i.cpp \
+ IFRService/ArrayDef_i.cpp \
+ IFRService/AttributeDef_i.cpp \
+ IFRService/ComponentContainer_i.cpp \
+ IFRService/ComponentDef_i.cpp \
+ IFRService/ComponentModuleDef_i.cpp \
+ IFRService/ComponentRepository_i.cpp \
+ IFRService/ConstantDef_i.cpp \
+ IFRService/ConsumesDef_i.cpp \
+ IFRService/Contained_i.cpp \
+ IFRService/Container_i.cpp \
+ IFRService/EmitsDef_i.cpp \
+ IFRService/EnumDef_i.cpp \
+ IFRService/EventDef_i.cpp \
+ IFRService/EventPortDef_i.cpp \
+ IFRService/ExceptionDef_i.cpp \
+ IFRService/ExtAbstractInterfaceDef_i.cpp \
+ IFRService/ExtAttributeDef_i.cpp \
+ IFRService/ExtInterfaceDef_i.cpp \
+ IFRService/ExtLocalInterfaceDef_i.cpp \
+ IFRService/ExtValueDef_i.cpp \
+ IFRService/FactoryDef_i.cpp \
+ IFRService/FinderDef_i.cpp \
+ IFRService/FixedDef_i.cpp \
+ IFRService/HomeDef_i.cpp \
+ IFRService/IDLType_i.cpp \
+ IFRService/IFR_BaseS.cpp \
+ IFRService/IFR_BasicS.cpp \
+ IFRService/IFR_ComponentsS.cpp \
+ IFRService/IFR_ExtendedS.cpp \
+ IFRService/IFR_Service_Loader.cpp \
+ IFRService/IFR_Service_Utils.cpp \
+ IFRService/IRObject_i.cpp \
+ IFRService/InterfaceAttrExtension_i.cpp \
+ IFRService/InterfaceDef_i.cpp \
+ IFRService/LocalInterfaceDef_i.cpp \
+ IFRService/ModuleDef_i.cpp \
+ IFRService/NativeDef_i.cpp \
+ IFRService/OperationDef_i.cpp \
+ IFRService/Options.cpp \
+ IFRService/PrimitiveDef_i.cpp \
+ IFRService/ProvidesDef_i.cpp \
+ IFRService/PublishesDef_i.cpp \
+ IFRService/RecursDef_i.cpp \
+ IFRService/Repository_i.cpp \
+ IFRService/SequenceDef_i.cpp \
+ IFRService/StringDef_i.cpp \
+ IFRService/StructDef_i.cpp \
+ IFRService/TypedefDef_i.cpp \
+ IFRService/UnionDef_i.cpp \
+ IFRService/UsesDef_i.cpp \
+ IFRService/ValueBoxDef_i.cpp \
+ IFRService/ValueDef_i.cpp \
+ IFRService/ValueMemberDef_i.cpp \
+ IFRService/WstringDef_i.cpp
+
+libTAO_IFRService_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_IFRService_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_TypeCodeFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ IFRService/AbstractInterfaceDef_i.h \
+ IFRService/AliasDef_i.h \
+ IFRService/ArrayDef_i.h \
+ IFRService/AttributeDef_i.h \
+ IFRService/ComponentContainer_i.h \
+ IFRService/ComponentDef_i.h \
+ IFRService/ComponentModuleDef_i.h \
+ IFRService/ComponentRepository_i.h \
+ IFRService/ConstantDef_i.h \
+ IFRService/ConsumesDef_i.h \
+ IFRService/Contained_i.h \
+ IFRService/Container_i.h \
+ IFRService/EmitsDef_i.h \
+ IFRService/EnumDef_i.h \
+ IFRService/EventDef_i.h \
+ IFRService/EventPortDef_i.h \
+ IFRService/ExceptionDef_i.h \
+ IFRService/ExtAbstractInterfaceDef_i.h \
+ IFRService/ExtAttributeDef_i.h \
+ IFRService/ExtInterfaceDef_i.h \
+ IFRService/ExtLocalInterfaceDef_i.h \
+ IFRService/ExtValueDef_i.h \
+ IFRService/FactoryDef_i.h \
+ IFRService/FinderDef_i.h \
+ IFRService/FixedDef_i.h \
+ IFRService/HomeDef_i.h \
+ IFRService/IDLType_i.h \
+ IFRService/IFR_BaseS.h \
+ IFRService/IFR_BaseS.inl \
+ IFRService/IFR_BaseS_T.cpp \
+ IFRService/IFR_BasicS.h \
+ IFRService/IFR_BasicS.inl \
+ IFRService/IFR_BasicS_T.cpp \
+ IFRService/IFR_ComponentsS.h \
+ IFRService/IFR_ComponentsS.inl \
+ IFRService/IFR_ComponentsS_T.cpp \
+ IFRService/IFR_ExtendedS.h \
+ IFRService/IFR_ExtendedS.inl \
+ IFRService/IFR_ExtendedS_T.cpp \
+ IFRService/IFR_Service_Loader.h \
+ IFRService/IFR_Service_Utils.h \
+ IFRService/IFR_Service_Utils_T.cpp \
+ IFRService/IRObject_i.h \
+ IFRService/InterfaceAttrExtension_i.h \
+ IFRService/InterfaceDef_i.h \
+ IFRService/LocalInterfaceDef_i.h \
+ IFRService/ModuleDef_i.h \
+ IFRService/NativeDef_i.h \
+ IFRService/OperationDef_i.h \
+ IFRService/Options.h \
+ IFRService/PrimitiveDef_i.h \
+ IFRService/ProvidesDef_i.h \
+ IFRService/PublishesDef_i.h \
+ IFRService/RecursDef_i.h \
+ IFRService/Repository_i.h \
+ IFRService/SequenceDef_i.h \
+ IFRService/StringDef_i.h \
+ IFRService/StructDef_i.h \
+ IFRService/TypedefDef_i.h \
+ IFRService/UnionDef_i.h \
+ IFRService/UsesDef_i.h \
+ IFRService/ValueBoxDef_i.h \
+ IFRService/ValueDef_i.h \
+ IFRService/ValueMemberDef_i.h \
+ IFRService/WstringDef_i.h
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+
+EXTRA_DIST += \
+ IFRService.rc
+
+
+## Makefile.RTCORBAEvent.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+if !BUILD_ACE_FOR_TAO
+
+lib_LTLIBRARIES += libTAO_RTCORBAEvent.la
+
+libTAO_RTCORBAEvent_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_RTCORBAEVENT_BUILD_DLL
+
+libTAO_RTCORBAEvent_la_SOURCES = \
+ Event/EC_RTCORBA_Dispatching.cpp \
+ Event/EC_RTCORBA_Factory.cpp
+
+libTAO_RTCORBAEvent_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_RTCORBAEvent_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_RTPortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ libTAO_RTEvent_Serv.la \
+ libTAO_RTEvent_Skel.la \
+ libTAO_RTEvent.la \
+ 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
+
+nobase_include_HEADERS += \
+ Event/EC_RTCORBA_Dispatching.h \
+ Event/EC_RTCORBA_Factory.h
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_RT_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.RTEventLogAdmin_IDL.am
+
+if BUILD_CORBA_MESSAGING
+
+BUILT_SOURCES += \
+ RTEventLogAdminC.cpp \
+ RTEventLogAdminC.h \
+ RTEventLogAdminC.inl \
+ RTEventLogAdminS.cpp \
+ RTEventLogAdminS.h \
+ RTEventLogAdminS.inl \
+ RTEventLogAdminS_T.cpp \
+ RTEventLogAdminS_T.h \
+ RTEventLogAdminS_T.inl
+
+CLEANFILES += \
+ RTEventLogAdmin-stamp \
+ RTEventLogAdminC.cpp \
+ RTEventLogAdminC.h \
+ RTEventLogAdminC.inl \
+ RTEventLogAdminS.cpp \
+ RTEventLogAdminS.h \
+ RTEventLogAdminS.inl \
+ RTEventLogAdminS_T.cpp \
+ RTEventLogAdminS_T.h \
+ RTEventLogAdminS_T.inl
+
+RTEventLogAdminC.cpp RTEventLogAdminC.h RTEventLogAdminC.inl RTEventLogAdminS.cpp RTEventLogAdminS.h RTEventLogAdminS.inl RTEventLogAdminS_T.cpp RTEventLogAdminS_T.h RTEventLogAdminS_T.inl: RTEventLogAdmin-stamp
+
+RTEventLogAdmin-stamp: $(srcdir)/RTEventLogAdmin.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,stub_export_macro=TAO_RTEventLog_Export -Wb,stub_export_include=orbsvcs/Log/rteventlog_export.h -Wb,skel_export_macro=TAO_RTEventLog_Skel_Export -Wb,skel_export_include=orbsvcs/Log/rteventlog_skel_export.h $(srcdir)/RTEventLogAdmin.idl
+ @touch $@
+
+
+nobase_include_HEADERS += \
+ RTEventLogAdmin.idl
+
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.RTEventLogAdmin.am
+
+if BUILD_CORBA_MESSAGING
+
+lib_LTLIBRARIES += libTAO_RTEventLogAdmin.la
+
+libTAO_RTEventLogAdmin_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_RTEVENTLOG_BUILD_DLL
+
+libTAO_RTEventLogAdmin_la_SOURCES = \
+ RTEventLogAdminC.cpp
+
+libTAO_RTEventLogAdmin_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_RTEventLogAdmin_la_LIBADD = \
+ libTAO_RTEvent.la \
+ 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 \
+ libTAO_DsLogAdmin.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Log/rteventlog_export.h \
+ RTEventLogAdminC.h \
+ RTEventLogAdminC.inl
+
+pkgconfig_DATA += \
+ TAO_RTEventLogAdmin.pc
+
+CLEANFILES += \
+ TAO_RTEventLogAdmin.pc
+
+TAO_RTEventLogAdmin.pc: ${top_builddir}/config.status ${srcdir}/TAO_RTEventLogAdmin.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_RTEventLogAdmin.pc.in
+
+endif BUILD_CORBA_MESSAGING
+
+EXTRA_DIST += \
+ TAO_RTEventLogAdmin.pc.in
+
+
+## Makefile.RTSched.am
+
+BUILT_SOURCES += \
+ RtecSchedulerC.cpp \
+ RtecSchedulerC.h \
+ RtecSchedulerC.inl \
+ RtecSchedulerS.cpp \
+ RtecSchedulerS.h \
+ RtecSchedulerS.inl \
+ RtecSchedulerS_T.cpp \
+ RtecSchedulerS_T.h \
+ RtecSchedulerS_T.inl
+
+CLEANFILES += \
+ RtecScheduler-stamp \
+ RtecSchedulerC.cpp \
+ RtecSchedulerC.h \
+ RtecSchedulerC.inl \
+ RtecSchedulerS.cpp \
+ RtecSchedulerS.h \
+ RtecSchedulerS.inl \
+ RtecSchedulerS_T.cpp \
+ RtecSchedulerS_T.h \
+ RtecSchedulerS_T.inl
+
+RtecSchedulerC.cpp RtecSchedulerC.h RtecSchedulerC.inl RtecSchedulerS.cpp RtecSchedulerS.h RtecSchedulerS.inl RtecSchedulerS_T.cpp RtecSchedulerS_T.h RtecSchedulerS_T.inl: RtecScheduler-stamp
+
+RtecScheduler-stamp: $(srcdir)/RtecScheduler.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_RTSched_Export -Wb,export_include=orbsvcs/Sched/sched_export.h $(srcdir)/RtecScheduler.idl
+ @touch $@
+
+lib_LTLIBRARIES += libTAO_RTSched.la
+
+libTAO_RTSched_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_RTSCHED_BUILD_DLL
+
+libTAO_RTSched_la_SOURCES = \
+ RtecSchedulerC.cpp \
+ RtecSchedulerS.cpp \
+ Runtime_Scheduler.cpp \
+ Sched/Config_Scheduler.cpp \
+ Sched/DynSched.cpp \
+ Sched/Reconfig_Sched_Utils.cpp \
+ Sched/SchedEntry.cpp \
+ Sched/Scheduler.cpp \
+ Sched/Scheduler_Generic.cpp \
+ Sched/Strategy_Scheduler.cpp \
+ Scheduler_Factory.cpp \
+ Scheduler_Utilities.cpp
+
+libTAO_RTSched_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_RTSched_la_LIBADD = \
+ libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ RtecScheduler.idl \
+ RtecSchedulerC.h \
+ RtecSchedulerC.inl \
+ RtecSchedulerS.h \
+ RtecSchedulerS.inl \
+ RtecSchedulerS_T.cpp \
+ RtecSchedulerS_T.h \
+ RtecSchedulerS_T.inl \
+ Runtime_Scheduler.h \
+ Sched/Config_Scheduler.h \
+ Sched/DynSched.h \
+ Sched/DynSched.i \
+ Sched/Reconfig_Sched_Utils.h \
+ Sched/Reconfig_Sched_Utils_T.cpp \
+ Sched/SchedEntry.h \
+ Sched/SchedEntry.i \
+ Sched/Scheduler.h \
+ Sched/Scheduler_Generic.h \
+ Sched/Strategy_Scheduler.h \
+ Scheduler_Factory.h \
+ Scheduler_Factory.i \
+ Scheduler_Utilities.h \
+ Scheduler_Utilities.i
+
+EXTRA_DIST += \
+ RTSched.rc
+
+
+## Makefile.RTEventLogAdmin_Skel.am
+
+if BUILD_CORBA_MESSAGING
+
+lib_LTLIBRARIES += libTAO_RTEventLogAdmin_Skel.la
+
+libTAO_RTEventLogAdmin_Skel_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_RTEVENTLOG_SKEL_BUILD_DLL
+
+libTAO_RTEventLogAdmin_Skel_la_SOURCES = \
+ RTEventLogAdminS.cpp
+
+libTAO_RTEventLogAdmin_Skel_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_RTEventLogAdmin_Skel_la_LIBADD = \
+ libTAO_RTEvent_Skel.la \
+ libTAO_DsLogAdmin_Skel.la \
+ libTAO_RTEventLogAdmin.la \
+ libTAO_RTEvent.la \
+ 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 \
+ libTAO_DsLogAdmin.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Log/rteventlog_skel_export.h \
+ RTEventLogAdminS.h \
+ RTEventLogAdminS.inl \
+ RTEventLogAdminS_T.cpp \
+ RTEventLogAdminS_T.h \
+ RTEventLogAdminS_T.inl
+
+pkgconfig_DATA += \
+ TAO_RTEventLogAdmin_Skel.pc
+
+CLEANFILES += \
+ TAO_RTEventLogAdmin_Skel.pc
+
+TAO_RTEventLogAdmin_Skel.pc: ${top_builddir}/config.status ${srcdir}/TAO_RTEventLogAdmin_Skel.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_RTEventLogAdmin_Skel.pc.in
+
+endif BUILD_CORBA_MESSAGING
+
+EXTRA_DIST += \
+ TAO_RTEventLogAdmin_Skel.pc.in
+
+
+## Makefile.RTEventLogAdmin_Serv.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+lib_LTLIBRARIES += libTAO_RTEventLogAdmin_Serv.la
+
+libTAO_RTEventLogAdmin_Serv_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_RTEVENTLOG_SERV_BUILD_DLL
+
+libTAO_RTEventLogAdmin_Serv_la_SOURCES = \
+ Log/RTEventLogConsumer.cpp \
+ Log/RTEventLogFactory_i.cpp \
+ Log/RTEventLogNotification.cpp \
+ Log/RTEventLog_i.cpp
+
+libTAO_RTEventLogAdmin_Serv_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_RTEventLogAdmin_Serv_la_LIBADD = \
+ libTAO_RTSched.la \
+ libTAO_CosNaming.la \
+ libTAO_RTEvent_Serv.la \
+ libTAO_DsLogAdmin_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ libTAO_RTEventLogAdmin_Skel.la \
+ libTAO_RTEvent_Skel.la \
+ libTAO_DsLogAdmin_Skel.la \
+ libTAO_RTEventLogAdmin.la \
+ libTAO_RTEvent.la \
+ 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 \
+ libTAO_DsLogAdmin.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Log/RTEventLogConsumer.h \
+ Log/RTEventLogFactory_i.h \
+ Log/RTEventLogNotification.h \
+ Log/RTEventLog_i.h \
+ Log/rteventlog_serv_export.h
+
+pkgconfig_DATA += \
+ TAO_RTEventLogAdmin_Serv.pc
+
+CLEANFILES += \
+ TAO_RTEventLogAdmin_Serv.pc
+
+TAO_RTEventLogAdmin_Serv.pc: ${top_builddir}/config.status ${srcdir}/TAO_RTEventLogAdmin_Serv.pc.in
+ ${top_builddir}/config.status --file $@:${srcdir}/TAO_RTEventLogAdmin_Serv.pc.in
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+EXTRA_DIST += \
+ TAO_RTEventLogAdmin_Serv.pc.in
+
+
+## Makefile.RTKokyuEvent.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+lib_LTLIBRARIES += libTAO_RTKokyuEvent.la
+
+libTAO_RTKokyuEvent_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(ACE_ROOT)/Kokyu \
+ -DTAO_RTKOKYUEVENT_BUILD_DLL
+
+libTAO_RTKokyuEvent_la_SOURCES = \
+ Event/EC_Kokyu_Dispatching.cpp \
+ Event/EC_Kokyu_Factory.cpp \
+ Event/EC_Kokyu_Filter.cpp \
+ Event/EC_Kokyu_Filter_Builder.cpp \
+ Event/EC_Kokyu_Scheduling.cpp
+
+libTAO_RTKokyuEvent_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_RTKokyuEvent_la_LIBADD = \
+ $(ACE_BUILDDIR)/Kokyu/libKokyu.la \
+ libTAO_RTSched.la \
+ libTAO_CosNaming.la \
+ libTAO_RTEvent_Serv.la \
+ libTAO_RTEvent_Skel.la \
+ libTAO_RTEvent.la \
+ 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
+
+nobase_include_HEADERS += \
+ Event/EC_Kokyu_Dispatching.h \
+ Event/EC_Kokyu_Dispatching.i \
+ Event/EC_Kokyu_Factory.h \
+ Event/EC_Kokyu_Factory.i \
+ Event/EC_Kokyu_Filter.h \
+ Event/EC_Kokyu_Filter_Builder.h \
+ Event/EC_Kokyu_Filter_Builder.i \
+ Event/EC_Kokyu_Scheduling.h \
+ Event/EC_Kokyu_Scheduling.i
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.RTSchedEvent.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+lib_LTLIBRARIES += libTAO_RTSchedEvent.la
+
+libTAO_RTSchedEvent_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_RTSCHEDEVENT_BUILD_DLL
+
+libTAO_RTSchedEvent_la_SOURCES = \
+ Event/EC_Gateway_Sched.cpp \
+ Event/EC_Priority_Dispatching.cpp \
+ Event/EC_Priority_Scheduling.cpp \
+ Event/EC_Sched_Factory.cpp \
+ Event/EC_Sched_Filter.cpp \
+ Event/EC_Sched_Filter_Builder.cpp
+
+libTAO_RTSchedEvent_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_RTSchedEvent_la_LIBADD = \
+ libTAO_RTSched.la \
+ libTAO_CosNaming.la \
+ libTAO_RTEvent_Serv.la \
+ libTAO_RTEvent_Skel.la \
+ libTAO_RTEvent.la \
+ 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
+
+nobase_include_HEADERS += \
+ Event/EC_Gateway_Sched.h \
+ Event/EC_Priority_Dispatching.h \
+ Event/EC_Priority_Scheduling.h \
+ Event/EC_Priority_Scheduling.i \
+ Event/EC_Sched_Factory.h \
+ Event/EC_Sched_Factory.i \
+ Event/EC_Sched_Filter.h \
+ Event/EC_Sched_Filter_Builder.h \
+ Event/EC_Sched_Filter_Builder.i
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+EXTRA_DIST += \
+ RTSchedEvent.rc
+
+
+## Makefile.RT_Notification.am
+
+if BUILD_RT_CORBA
+if !BUILD_MINIMUM_CORBA
+
+lib_LTLIBRARIES += libTAO_RT_Notification.la
+
+libTAO_RT_Notification_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_NOTIFY_BUILD_DLL
+
+libTAO_RT_Notification_la_SOURCES = \
+ Notify/RT_Builder.cpp \
+ Notify/RT_Factory.cpp \
+ Notify/RT_Notify_Service.cpp \
+ Notify/RT_POA_Helper.cpp \
+ Notify/RT_Properties.cpp \
+ Notify/Structured/RT_StructuredProxyPushSupplier.cpp
+
+libTAO_RT_Notification_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_RT_Notification_la_LIBADD = \
+ libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ libTAO_ETCL.la \
+ libTAO_CosNotification_Skel.la \
+ libTAO_CosEvent_Skel.la \
+ libTAO_CosNotification.la \
+ libTAO_CosEvent.la \
+ libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+nobase_include_HEADERS += \
+ Notify/RT_Builder.h \
+ Notify/RT_Factory.h \
+ Notify/RT_Notify_Service.h \
+ Notify/RT_POA_Helper.h \
+ Notify/RT_Properties.h \
+ Notify/RT_Properties.inl \
+ Notify/Structured/RT_StructuredProxyPushSupplier.h
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_RT_CORBA
+
+EXTRA_DIST += \
+ RT_Notification.rc
+
+
+## Makefile.Security.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+
+BUILT_SOURCES += \
+ CSIC.cpp \
+ CSIC.h \
+ CSIC.inl \
+ CSIS.inl \
+ CSIS_T.inl
+
+CLEANFILES += \
+ CSI-stamp \
+ CSIC.cpp \
+ CSIC.h \
+ CSIC.inl \
+ CSIS.inl \
+ CSIS_T.inl
+
+CSIC.cpp CSIC.h CSIC.inl CSIS.inl CSIS_T.inl: CSI-stamp
+
+CSI-stamp: $(srcdir)/CSI.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_Security_Export -Wb,export_include=orbsvcs/Security/security_export.h $(srcdir)/CSI.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ CSIIOPC.cpp \
+ CSIIOPC.h \
+ CSIIOPC.inl \
+ CSIIOPS.inl \
+ CSIIOPS_T.inl
+
+CLEANFILES += \
+ CSIIOP-stamp \
+ CSIIOPC.cpp \
+ CSIIOPC.h \
+ CSIIOPC.inl \
+ CSIIOPS.inl \
+ CSIIOPS_T.inl
+
+CSIIOPC.cpp CSIIOPC.h CSIIOPC.inl CSIIOPS.inl CSIIOPS_T.inl: CSIIOP-stamp
+
+CSIIOP-stamp: $(srcdir)/CSIIOP.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_Security_Export -Wb,export_include=orbsvcs/Security/security_export.h $(srcdir)/CSIIOP.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ GSSUPC.cpp \
+ GSSUPC.h \
+ GSSUPC.inl \
+ GSSUPS.inl \
+ GSSUPS_T.inl
+
+CLEANFILES += \
+ GSSUP-stamp \
+ GSSUPC.cpp \
+ GSSUPC.h \
+ GSSUPC.inl \
+ GSSUPS.inl \
+ GSSUPS_T.inl
+
+GSSUPC.cpp GSSUPC.h GSSUPC.inl GSSUPS.inl GSSUPS_T.inl: GSSUP-stamp
+
+GSSUP-stamp: $(srcdir)/GSSUP.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_Security_Export -Wb,export_include=orbsvcs/Security/security_export.h $(srcdir)/GSSUP.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ SecurityC.cpp \
+ SecurityC.h \
+ SecurityC.inl \
+ SecurityS.cpp \
+ SecurityS.h \
+ SecurityS.inl \
+ SecurityS_T.cpp \
+ SecurityS_T.inl
+
+CLEANFILES += \
+ Security-stamp \
+ SecurityC.cpp \
+ SecurityC.h \
+ SecurityC.inl \
+ SecurityS.cpp \
+ SecurityS.h \
+ SecurityS.inl \
+ SecurityS_T.cpp \
+ SecurityS_T.inl
+
+SecurityC.cpp SecurityC.h SecurityC.inl SecurityS.cpp SecurityS.h SecurityS.inl SecurityS_T.cpp SecurityS_T.inl: Security-stamp
+
+Security-stamp: $(srcdir)/Security.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_Security_Export -Wb,export_include=orbsvcs/Security/security_export.h $(srcdir)/Security.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ SecurityLevel1C.cpp \
+ SecurityLevel1C.h \
+ SecurityLevel1C.inl \
+ SecurityLevel1S.cpp \
+ SecurityLevel1S.h \
+ SecurityLevel1S.inl \
+ SecurityLevel1S_T.cpp \
+ SecurityLevel1S_T.inl
+
+CLEANFILES += \
+ SecurityLevel1-stamp \
+ SecurityLevel1C.cpp \
+ SecurityLevel1C.h \
+ SecurityLevel1C.inl \
+ SecurityLevel1S.cpp \
+ SecurityLevel1S.h \
+ SecurityLevel1S.inl \
+ SecurityLevel1S_T.cpp \
+ SecurityLevel1S_T.inl
+
+SecurityLevel1C.cpp SecurityLevel1C.h SecurityLevel1C.inl SecurityLevel1S.cpp SecurityLevel1S.h SecurityLevel1S.inl SecurityLevel1S_T.cpp SecurityLevel1S_T.inl: SecurityLevel1-stamp
+
+SecurityLevel1-stamp: $(srcdir)/SecurityLevel1.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_Security_Export -Wb,export_include=orbsvcs/Security/security_export.h $(srcdir)/SecurityLevel1.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ SecurityLevel2C.cpp \
+ SecurityLevel2C.h \
+ SecurityLevel2C.inl \
+ SecurityLevel2S.cpp \
+ SecurityLevel2S.h \
+ SecurityLevel2S.inl \
+ SecurityLevel2S_T.cpp \
+ SecurityLevel2S_T.inl
+
+CLEANFILES += \
+ SecurityLevel2-stamp \
+ SecurityLevel2C.cpp \
+ SecurityLevel2C.h \
+ SecurityLevel2C.inl \
+ SecurityLevel2S.cpp \
+ SecurityLevel2S.h \
+ SecurityLevel2S.inl \
+ SecurityLevel2S_T.cpp \
+ SecurityLevel2S_T.inl
+
+SecurityLevel2C.cpp SecurityLevel2C.h SecurityLevel2C.inl SecurityLevel2S.cpp SecurityLevel2S.h SecurityLevel2S.inl SecurityLevel2S_T.cpp SecurityLevel2S_T.inl: SecurityLevel2-stamp
+
+SecurityLevel2-stamp: $(srcdir)/SecurityLevel2.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_Security_Export -Wb,export_include=orbsvcs/Security/security_export.h $(srcdir)/SecurityLevel2.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ SecurityLevel3C.cpp \
+ SecurityLevel3C.h \
+ SecurityLevel3C.inl \
+ SecurityLevel3S.inl \
+ SecurityLevel3S_T.inl
+
+CLEANFILES += \
+ SecurityLevel3-stamp \
+ SecurityLevel3C.cpp \
+ SecurityLevel3C.h \
+ SecurityLevel3C.inl \
+ SecurityLevel3S.inl \
+ SecurityLevel3S_T.inl
+
+SecurityLevel3C.cpp SecurityLevel3C.h SecurityLevel3C.inl SecurityLevel3S.inl SecurityLevel3S_T.inl: SecurityLevel3-stamp
+
+SecurityLevel3-stamp: $(srcdir)/SecurityLevel3.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_Security_Export -Wb,export_include=orbsvcs/Security/security_export.h $(srcdir)/SecurityLevel3.idl
+ @touch $@
+
+lib_LTLIBRARIES += libTAO_Security.la
+
+libTAO_Security_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_SECURITY_BUILD_DLL
+
+libTAO_Security_la_SOURCES = \
+ CSIC.cpp \
+ CSIIOPC.cpp \
+ GSSUPC.cpp \
+ Security/CSI_Utils.cpp \
+ Security/SL2_EstablishTrustPolicy.cpp \
+ Security/SL2_QOPPolicy.cpp \
+ Security/SL3_ContextEstablishmentPolicy.cpp \
+ Security/SL3_CredentialsAcquirerFactory.cpp \
+ Security/SL3_CredentialsCurator.cpp \
+ Security/SL3_ObjectCredentialsPolicy.cpp \
+ Security/SL3_PolicyFactory.cpp \
+ Security/SL3_SecurityCurrent.cpp \
+ Security/SL3_SecurityCurrent_Impl.cpp \
+ Security/SL3_SecurityManager.cpp \
+ Security/Security_Current.cpp \
+ Security/Security_Current_Impl.cpp \
+ Security/Security_ORBInitializer.cpp \
+ Security/Security_PolicyFactory.cpp \
+ SecurityC.cpp \
+ SecurityLevel1C.cpp \
+ SecurityLevel1S.cpp \
+ SecurityLevel2C.cpp \
+ SecurityLevel2S.cpp \
+ SecurityLevel3C.cpp \
+ SecurityS.cpp
+
+libTAO_Security_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@
+
+libTAO_Security_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.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
+
+nobase_include_HEADERS += \
+ CSI.idl \
+ CSIC.h \
+ CSIC.inl \
+ CSIIOP.idl \
+ CSIIOPC.h \
+ CSIIOPC.inl \
+ CSIIOPS.inl \
+ CSIIOPS_T.inl \
+ CSIS.inl \
+ CSIS_T.inl \
+ GSSUP.idl \
+ GSSUPC.h \
+ GSSUPC.inl \
+ GSSUPS.inl \
+ GSSUPS_T.inl \
+ Security.idl \
+ Security/CSI_Utils.h \
+ Security/SL2_EstablishTrustPolicy.h \
+ Security/SL2_QOPPolicy.h \
+ Security/SL3_ContextEstablishmentPolicy.h \
+ Security/SL3_CredentialsAcquirerFactory.h \
+ Security/SL3_CredentialsCurator.h \
+ Security/SL3_ObjectCredentialsPolicy.h \
+ Security/SL3_PolicyFactory.h \
+ Security/SL3_SecurityCurrent.h \
+ Security/SL3_SecurityCurrent.inl \
+ Security/SL3_SecurityCurrent_Impl.h \
+ Security/SL3_SecurityManager.h \
+ Security/Security_Current.h \
+ Security/Security_Current.inl \
+ Security/Security_Current_Impl.h \
+ Security/Security_ORBInitializer.h \
+ Security/Security_PolicyFactory.h \
+ Security/security_export.h \
+ SecurityC.h \
+ SecurityC.inl \
+ SecurityLevel1.idl \
+ SecurityLevel1C.h \
+ SecurityLevel1C.inl \
+ SecurityLevel1S.h \
+ SecurityLevel1S.inl \
+ SecurityLevel1S_T.cpp \
+ SecurityLevel1S_T.inl \
+ SecurityLevel2.idl \
+ SecurityLevel2C.h \
+ SecurityLevel2C.inl \
+ SecurityLevel2S.h \
+ SecurityLevel2S.inl \
+ SecurityLevel2S_T.cpp \
+ SecurityLevel2S_T.inl \
+ SecurityLevel3.idl \
+ SecurityLevel3C.h \
+ SecurityLevel3C.inl \
+ SecurityLevel3S.inl \
+ SecurityLevel3S_T.inl \
+ SecurityS.h \
+ SecurityS.inl \
+ SecurityS_T.cpp \
+ SecurityS_T.inl
+
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+
+EXTRA_DIST += \
+ Security.rc
+
+
+## Makefile.SSLIOP.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if BUILD_SSL
+if !BUILD_ACE_FOR_TAO
+
+BUILT_SOURCES += \
+ SSLIOPC.cpp \
+ SSLIOPC.h \
+ SSLIOPC.inl \
+ SSLIOPS_T.cpp
+
+CLEANFILES += \
+ SSLIOP-stamp \
+ SSLIOPC.cpp \
+ SSLIOPC.h \
+ SSLIOPC.inl \
+ SSLIOPS_T.cpp
+
+SSLIOPC.cpp SSLIOPC.h SSLIOPC.inl SSLIOPS_T.cpp: SSLIOP-stamp
+
+SSLIOP-stamp: $(srcdir)/SSLIOP.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL -Wb,export_macro=TAO_SSLIOP_Export -Wb,export_include=orbsvcs/SSLIOP/SSLIOP_Export.h $(srcdir)/SSLIOP.idl
+ @touch $@
+
+lib_LTLIBRARIES += libTAO_SSLIOP.la
+
+libTAO_SSLIOP_la_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@ \
+ -DTAO_SSLIOP_BUILD_DLL
+
+libTAO_SSLIOP_la_SOURCES = \
+ SSLIOP/IIOP_SSL_Acceptor.cpp \
+ SSLIOP/IIOP_SSL_Connection_Handler.cpp \
+ SSLIOP/IIOP_SSL_Connector.cpp \
+ SSLIOP/IIOP_SSL_Transport.cpp \
+ SSLIOP/SSLIOP_Accept_Strategy.cpp \
+ SSLIOP/SSLIOP_Acceptor.cpp \
+ SSLIOP/SSLIOP_ClientCredentials.cpp \
+ SSLIOP/SSLIOP_Connection_Handler.cpp \
+ SSLIOP/SSLIOP_Connector.cpp \
+ SSLIOP/SSLIOP_Credentials.cpp \
+ SSLIOP/SSLIOP_CredentialsAcquirer.cpp \
+ SSLIOP/SSLIOP_CredentialsAcquirerFactory.cpp \
+ SSLIOP/SSLIOP_Current.cpp \
+ SSLIOP/SSLIOP_Current_Impl.cpp \
+ SSLIOP/SSLIOP_EVP_PKEY.cpp \
+ SSLIOP/SSLIOP_Endpoint.cpp \
+ SSLIOP/SSLIOP_Factory.cpp \
+ SSLIOP/SSLIOP_Invocation_Interceptor.cpp \
+ SSLIOP/SSLIOP_ORBInitializer.cpp \
+ SSLIOP/SSLIOP_OwnCredentials.cpp \
+ SSLIOP/SSLIOP_Profile.cpp \
+ SSLIOP/SSLIOP_TargetCredentials.cpp \
+ SSLIOP/SSLIOP_Transport.cpp \
+ SSLIOP/SSLIOP_Util.cpp \
+ SSLIOP/params_dup.c \
+ SSLIOP/ssl_endpointsC.cpp \
+ SSLIOPC.cpp
+
+libTAO_SSLIOP_la_LDFLAGS = \
+ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@ @ACE_TLS_LDFLAGS@
+
+libTAO_SSLIOP_la_LIBADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(ACE_BUILDDIR)/ace/SSL/libACE_SSL.la \
+ 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@
+
+nobase_include_HEADERS += \
+ SSLIOP.idl \
+ SSLIOP/IIOP_SSL_Acceptor.h \
+ SSLIOP/IIOP_SSL_Connection_Handler.h \
+ SSLIOP/IIOP_SSL_Connection_Handler.inl \
+ SSLIOP/IIOP_SSL_Connector.h \
+ SSLIOP/IIOP_SSL_Transport.h \
+ SSLIOP/SSLIOP_Accept_Strategy.h \
+ SSLIOP/SSLIOP_Acceptor.h \
+ SSLIOP/SSLIOP_Acceptor.i \
+ SSLIOP/SSLIOP_ClientCredentials.h \
+ SSLIOP/SSLIOP_Connection_Handler.h \
+ SSLIOP/SSLIOP_Connection_Handler.i \
+ SSLIOP/SSLIOP_Connector.h \
+ SSLIOP/SSLIOP_Credentials.h \
+ SSLIOP/SSLIOP_Credentials.inl \
+ SSLIOP/SSLIOP_CredentialsAcquirer.h \
+ SSLIOP/SSLIOP_CredentialsAcquirerFactory.h \
+ SSLIOP/SSLIOP_Current.h \
+ SSLIOP/SSLIOP_Current.inl \
+ SSLIOP/SSLIOP_Current_Impl.h \
+ SSLIOP/SSLIOP_Current_Impl.inl \
+ SSLIOP/SSLIOP_EVP_PKEY.h \
+ SSLIOP/SSLIOP_Endpoint.h \
+ SSLIOP/SSLIOP_Endpoint.i \
+ SSLIOP/SSLIOP_Export.h \
+ SSLIOP/SSLIOP_Factory.h \
+ SSLIOP/SSLIOP_Invocation_Interceptor.h \
+ SSLIOP/SSLIOP_ORBInitializer.h \
+ SSLIOP/SSLIOP_OpenSSL_st_T.h \
+ SSLIOP/SSLIOP_OpenSSL_st_T.inl \
+ SSLIOP/SSLIOP_OwnCredentials.h \
+ SSLIOP/SSLIOP_Profile.h \
+ SSLIOP/SSLIOP_SSL.h \
+ SSLIOP/SSLIOP_TargetCredentials.h \
+ SSLIOP/SSLIOP_Transport.h \
+ SSLIOP/SSLIOP_Util.h \
+ SSLIOP/SSLIOP_X509.h \
+ SSLIOP/params_dup.h \
+ SSLIOP/ssl_endpoints.pidl \
+ SSLIOP/ssl_endpointsC.h \
+ SSLIOPC.h \
+ SSLIOPC.inl
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_SSL
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+
+EXTRA_DIST += \
+ SSLIOP.rc
+
+
+## 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/orbsvcs/Metrics.idl b/TAO/orbsvcs/orbsvcs/Metrics.idl
new file mode 100644
index 00000000000..00e87c7f87a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics.idl
@@ -0,0 +1,331 @@
+// $Id$
+
+#ifndef METRICS_IDL
+#define METRICS_IDL
+
+#include "TimeBase.idl"
+#include "RtecScheduler.idl"
+#pragma prefix ""
+
+module Metrics
+{
+ // Types
+
+ enum TIMEPROBE_EVENT_TYPE
+ {
+ WORK_START,
+ WORK_STOP,
+ WORK_SUSPEND,
+ WORK_RESUME
+ };
+
+ typedef TIMEPROBE_EVENT_TYPE TIMEPROBE_EVENT_TYPE_t;
+
+ typedef TimeBase::TimeT Time; // time type
+ typedef sequence<RtecScheduler::handle_t> Handle_Set_t; // handle sequence
+
+ struct QoSParameter_t
+ // = TITLE
+ // Describes the monitored QoS for an "RT_Operation".
+ //
+ // = DESCRIPTION
+ // The deadline success and failure counts for an operation.
+ {
+ RtecScheduler::handle_t handle;
+ // The handle of the operation for which the information is stored
+
+ string entry_point;
+ // The name of the operation for which the information is stored
+
+ unsigned long deadlines_made;
+ // The number of deadlines successfully met.
+
+ unsigned long deadlines_missed;
+ // The number of deadlines missed.
+
+ unsigned long operations_cancelled;
+ // The number of operations cancelled.
+
+ short is_hrt;
+ // Indicates whether or not the operation is hard real-time.
+ };
+
+ typedef sequence<QoSParameter_t> QoSParameter_Set;
+
+
+ struct QoSData
+ // = TITLE
+ // Describes the monitored QoS for the visualization browser.
+ //
+ // = DESCRIPTION
+ // Aggregate success, failure, and cancellation counts the operations.
+ {
+ long hrt_deadlines_made;
+ // The number of hard real-time deadlines successfully met.
+
+ long hrt_deadlines_missed;
+ // The number of hard real-time deadlines missed.
+
+ long hrt_operations_cancelled;
+ // The number of hard real-time operations that were cancelled.
+
+ long srt_deadlines_made;
+ // The number of soft real-time deadlines successfully met.
+
+ long srt_deadlines_missed;
+ // The number of soft real-time deadlines missed.
+
+ long srt_operations_cancelled;
+ // The number of soft real-time operations that were cancelled.
+ };
+
+ struct UtilData
+ // = TITLE
+ // Describes the monitored QoS for the visualization browser.
+ //
+ // = DESCRIPTION
+ // Aggregate success, failure, and cancellation counts the operations.
+ {
+ double hrt_op_utilization;
+ // The percentage of the time spent in hard real-time operations.
+
+ double srt_op_utilization;
+ // The percentage of the time spent in soft real-time operations.
+
+ double queue_utilization;
+ // The percentage of the time spent managing queues.
+ };
+
+ struct ProbeIdentity_t
+ // = TITLE
+ // Describes the identity of a timeprobe.
+ //
+ // = DESCRIPTION
+ // The name and identifier for a timeprobe.
+ {
+ unsigned long probe_id;
+ // The unique identifier for the timeprobe.
+
+ string probe_name;
+ // The name of the timeprobe.
+ };
+
+ typedef sequence<ProbeIdentity_t> ProbeIdentity_Set;
+
+ struct TimeprobeParameter_t
+ // = TITLE
+ // Describes the monitored data for a timeprobe.
+ //
+ // = DESCRIPTION
+ // The duration of an interval for a timeprobe.
+ {
+ unsigned long probe_id;
+ // The name of the timeprobe that collected the data.
+
+ short is_operation;
+ // Indicates whether or not the data are for an operation.
+
+ short is_hrt;
+ // Indicates whether or not an operation is hard real-time.
+
+ short is_full_interval;
+ // Indicates whether or not the time reported is for the entire
+ // interval measured by the time probe.
+
+ short cross_thread_probe;
+ // Indicates whether or not the time reported is for the entire
+ // interval measured by the time probe.
+
+ Time start_event_time;
+ // The start of the event for sorting purposes.
+
+ Time stop_event_time;
+ // The start of the event for sorting purposes.
+
+ Time interval;
+ // The elapsed time within the timeprobe.
+ };
+
+ typedef sequence<TimeprobeParameter_t> TimeprobeParameter_Set;
+
+
+ // Exceptions
+
+ exception SYNCHRONIZATION {};
+ // A synchronization error occurred in a method.
+
+ exception INTERNAL {};
+ // An error occurred in an internal data structure.
+
+ exception INTERNAL_0 {};
+ exception INTERNAL_1 {};
+ exception INTERNAL_2 {};
+ exception INTERNAL_3 {};
+ exception INTERNAL_4 {};
+ exception INTERNAL_5 {};
+ exception INTERNAL_6 {};
+ exception INTERNAL_7 {};
+ exception INTERNAL_8 {};
+ // These are to track down an infrequently reproducible
+ // error, and should be removed eventually.
+
+ exception NIL_LOGGER {};
+ // An operation was passed a nil logger pointer.
+
+ // Interfaces
+
+ interface QoSLogger
+ // = TITLE
+ // This interface provides access to a QoS logger.
+ //
+ // = DESCRIPTION
+ // This interface allows clients log monitored QoS information.
+ {
+ oneway void send_banner (in string banner);
+ // Sends a banner to the logger, which is recorded in the
+ // output log and communicated to the visualization browser.
+
+ oneway void log_aggregate_QoS (in Metrics::QoSParameter_Set qos_set,
+ in Time interval);
+ // Reports the aggregate QoS information for all operations
+ // to the passed QoS logger.
+
+ oneway void set_identities (in Metrics::ProbeIdentity_Set identity_set);
+ // Binds the names of various timeprobes to their identifiers so
+ // that ids alone can be used (for efficiency) in passing data.
+
+ oneway void set_identity (in Metrics::ProbeIdentity_t identity);
+ // Binds the names of various timeprobes to their identifiers so
+ // that ids alone can be used (for efficiency) in passing data.
+
+ oneway void log_timeprobe_data (in Metrics::TimeprobeParameter_Set data_set,
+ in Time interval);
+ // Reports timeprobe data collected since last run.
+ };
+
+
+ interface QoSMonitor
+ // = TITLE
+ // This interface provides access to a QoS data monitor.
+ //
+ // = DESCRIPTION
+ // This interface allows objects to store and query monitored
+ // QoS information.
+ {
+ void report_made_deadline (in RtecScheduler::handle_t handle)
+ raises (INTERNAL_0);
+ // Report a successful upcall.
+
+ void report_missed_deadline (in RtecScheduler::handle_t handle)
+ raises (INTERNAL_1);
+ // Report an unsuccessful upcall.
+
+ void reset_statistics (in RtecScheduler::handle_t handle)
+ raises (INTERNAL_7, INTERNAL_8);
+ // Resets the aggregate QoS information for the given
+ // operation handle.
+
+ void get_aggregate_QoS (in RtecScheduler::handle_t handle,
+ out Metrics::QoSParameter_t qos)
+ raises (INTERNAL_2, INTERNAL_3);
+ // Retrieves the aggregate QoS information for the given
+ // operation handle.
+
+ void get_aggregate_QoS_set (in Metrics::Handle_Set_t handle_set,
+ out Metrics::QoSParameter_Set qos_set)
+ raises (INTERNAL_4, INTERNAL_5);
+ // Retrieves the aggregate QoS information for all operations
+ // in the passed handle set.
+ };
+
+
+ interface ReportingQoSMonitor : QoSMonitor
+ // = TITLE
+ // This interface provides access to a QoS data monitor.
+ //
+ // = DESCRIPTION
+ // This interface allows objects to report monitored
+ // QoS information to a QoS logger.
+ {
+ void report_aggregate_QoS (in Metrics::QoSLogger logger,
+ in Metrics::Time interval)
+ raises (NIL_LOGGER, INTERNAL_6);
+ // Reports the aggregate QoS information for all operations
+ // to the passed QoS logger.
+ };
+
+ interface FrameManager
+ // = TITLE
+ // This interface provides access to a QoS data monitor.
+ //
+ // = DESCRIPTION
+ // This interface allows objects to query or report monitored
+ // QoS information that was collected by QoS monitoring adapters.
+ {
+ short register_period (in RtecScheduler::Period_t p)
+ raises (INTERNAL, SYNCHRONIZATION);
+ // Binds the period to the internal frame map, with a new frame data
+ // structure. Returns 0 if a new entry is bound successfully,
+ // returns 1 if an attempt is made to bind an existing entry, and
+ // returns -1 if failures occur.
+
+ short update_all_frames_with_time (in Time tv)
+ raises (SYNCHRONIZATION);
+ // Updates time frames, based on the passed time value.
+
+ short update_all_frames ()
+ raises (SYNCHRONIZATION);
+ // Updates time frames, based on the current time as of the call.
+
+ short update_frame_with_time (in RtecScheduler::Period_t p, in Time tv)
+ raises (INTERNAL, SYNCHRONIZATION);
+ // Updates the passed period's time frame, based on the passed time
+ // value.
+
+ short update_frame (in RtecScheduler::Period_t p)
+ raises (INTERNAL, SYNCHRONIZATION);
+ // Updates the passed period's time frame, based on the current time
+ // as of the call.
+
+ short reset_all_frames_with_time (in Time tv)
+ raises (SYNCHRONIZATION);
+ // Resets time frames, based on the passed time value.
+
+ short reset_all_frames ()
+ raises (SYNCHRONIZATION);
+ // Resets time frames, based on the current time as of the call.
+
+ short reset_frame_with_time (in RtecScheduler::Period_t p, in Time tv)
+ raises (INTERNAL, SYNCHRONIZATION);
+ // Resets the passed period's start-of-frame, based on the passed time
+ // value.
+
+ short reset_frame (in RtecScheduler::Period_t p)
+ raises (INTERNAL, SYNCHRONIZATION);
+ // Resets the passed period's start-of-frame, based on the current time
+ // as of the call.
+
+ short get_start_time (in RtecScheduler::Period_t p, out Time start)
+ raises (INTERNAL, SYNCHRONIZATION);
+ // Gets the start time for the period's current frame.
+
+ short get_end_time (in RtecScheduler::Period_t p, out Time end)
+ raises (INTERNAL, SYNCHRONIZATION);
+ // Gets the end time for the period's current frame.
+
+ short get_frame_id (in RtecScheduler::Period_t p, out unsigned long id)
+ raises (INTERNAL, SYNCHRONIZATION);
+ // Gets the locally unique identifier for the period's current frame.
+
+ short get_frame_data (in RtecScheduler::Period_t p, out Time start,
+ out Time end, out unsigned long id)
+ raises (INTERNAL, SYNCHRONIZATION);
+ // Gets the start time, end time, and id for the period's current frame.
+ };
+
+};
+
+#endif /* METRICS_IDL */
+
+
+
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager.cpp b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager.cpp
new file mode 100644
index 00000000000..42663238c81
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager.cpp
@@ -0,0 +1,14 @@
+// $Id$
+
+#ifndef METRICS_FRAME_MANAGER_CPP
+#define METRICS_FRAME_MANAGER_CPP
+
+#include "orbsvcs/Metrics/Metrics_FrameManager.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/Metrics/Metrics_FrameManager.i"
+#endif /* __ACE_INLINE__ */
+
+
+#endif /* METRICS_FRAME_MANAGER_CPP */
+
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager.h b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager.h
new file mode 100644
index 00000000000..689ed44ee6f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager.h
@@ -0,0 +1,37 @@
+// $Id$
+
+#ifndef METRICS_FRAME_MANAGER_H
+#define METRICS_FRAME_MANAGER_H
+
+#include "ace/OS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Hash_Map_Manager.h"
+#include "ace/Singleton.h"
+
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/RtecSchedulerC.h"
+
+#include "orbsvcs/Metrics/Metrics_Utils.h"
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Metrics/Metrics_FrameManager.i"
+#endif /* __ACE_INLINE__ */
+
+#include "orbsvcs/Metrics/Metrics_FrameManager_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef TAO_Metrics_FrameManager<ACE_SYNCH_MUTEX>
+TAO_METRICS_FRAME_MGR_TYPE;
+
+typedef ACE_Singleton<TAO_METRICS_FRAME_MGR_TYPE, ACE_SYNCH_MUTEX>
+TAO_METRICS_FRAME_MGR_SINGLETON;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* METRICS_FRAME_MANAGER_H */
+
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager.i b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager.i
new file mode 100644
index 00000000000..bb47ba99272
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager.i
@@ -0,0 +1,9 @@
+// $Id$
+
+#ifndef METRICS_FRAME_MANAGER_I
+#define METRICS_FRAME_MANAGER_I
+
+
+
+#endif /* METRICS_FRAME_MANAGER_I */
+
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager_T.cpp b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager_T.cpp
new file mode 100644
index 00000000000..d8ff5ef8e8b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager_T.cpp
@@ -0,0 +1,14 @@
+// $Id$
+
+#ifndef METRICS_FRAME_MANAGER_T_CPP
+#define METRICS_FRAME_MANAGER_T_CPP
+
+#include "orbsvcs/Metrics/Metrics_FrameManager_T.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/Metrics/Metrics_FrameManager_T.i"
+#endif /* __ACE_INLINE__ */
+
+
+#endif /* METRICS_FRAME_MANAGER_T_CPP */
+
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager_T.h b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager_T.h
new file mode 100644
index 00000000000..a3226d8647c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager_T.h
@@ -0,0 +1,277 @@
+// $Id$
+
+#ifndef METRICS_FRAME_MANAGER_T_H
+#define METRICS_FRAME_MANAGER_T_H
+
+#include "ace/OS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Hash_Map_Manager.h"
+#include "ace/High_Res_Timer.h"
+
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/RtecSchedulerC.h"
+#include "orbsvcs/MetricsS.h"
+
+#include "orbsvcs/Metrics/Metrics_FrameManager.h"
+
+
+template <class ACE_LOCK>
+struct TAO_Metrics_Frame_Manager_Data
+{
+ // = TITLE
+ // Defines a class for time frame management data.
+ //
+ // = DESCRIPTION
+ // This class makes use of the <ACE_Time_Value> class to
+ // store period and endpoint data for a given time frame.
+
+public:
+
+ TAO_Metrics_Frame_Manager_Data (RtecScheduler::Period_t p)
+ : frame_id_ (0), period_ (0, p / 10) {}
+ // Constructor. Note that p is in hundreds of nanoseconds so we
+ // divide by ten to get microseconds. The start_ and end_ data
+ // members are set equal to ACE_Time_Value::zero by their own
+ // default constructors.
+
+ CORBA::ULong frame_id_;
+ // Stores the number of previous frames for that period. May roll
+ // over, but is intended to provide a locally (for a large range of
+ // locality) unique frame identifier.
+
+ ACE_Time_Value period_;
+ // Relative time to the next frame, from the start of this one.
+
+ ACE_Time_Value start_;
+ // Absolute time of the start of the frame and end of the last.
+
+ ACE_Time_Value end_;
+ // Absolute time to the end of the frame and start of the next.
+
+ ACE_LOCK lock_;
+ // Lock for synchronizing access to the data instance.
+};
+
+
+template <class ACE_LOCK>
+class TAO_Metrics_FrameManager : public POA_Metrics::FrameManager
+
+{
+ // = TITLE
+ // Defines a class that implements a local metrics cache.
+ //
+ // = DESCRIPTION
+ // This class makes use of the <ACE_Metrics_Cache> class to
+ // implement a cache for local use.
+public:
+
+ typedef TAO_Metrics_FrameManager<ACE_LOCK> TAO_METRICS_FRAME_MANAGER_TYPE;
+ typedef TAO_Metrics_Frame_Manager_Data<ACE_LOCK> TAO_METRICS_FRAME_MANAGER_DATA_TYPE;
+
+ typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::Period_t,
+ TAO_METRICS_FRAME_MANAGER_DATA_TYPE *,
+ ACE_Hash<RtecScheduler::Period_t>,
+ ACE_Equal_To<RtecScheduler::Period_t>,
+ ACE_Null_Mutex> METRICS_FRAME_DATA_MAP;
+ // Type of map used for O(1) lookup of monitored data for operations.
+
+ typedef ACE_Hash_Map_Entry<RtecScheduler::Period_t,
+ TAO_METRICS_FRAME_MANAGER_DATA_TYPE *>
+ METRICS_FRAME_DATA_MAP_ENTRY;
+ // Type of entry in monitor map.
+
+ typedef ACE_Hash_Map_Iterator_Ex<RtecScheduler::Period_t,
+ TAO_METRICS_FRAME_MANAGER_DATA_TYPE *,
+ ACE_Hash<RtecScheduler::Period_t>,
+ ACE_Equal_To<RtecScheduler::Period_t>,
+ ACE_Null_Mutex>
+ METRICS_FRAME_DATA_MAP_ITERATOR;
+ // Type of iterator for monitor map.
+
+ TAO_Metrics_FrameManager ();
+ // Constructor.
+
+ ~TAO_Metrics_FrameManager ();
+ // Destructor.
+
+ CORBA::Short register_period (RtecScheduler::Period_t p,
+ CORBA::Environment &ACE_TRY_ENV
+ = CORBA::Environment::default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION));
+ // Binds the period to the internal frame map, with a new frame data
+ // structure. Returns 0 if a new entry is bound successfully,
+ // returns 1 if an attempt is made to bind an existing entry, and
+ // returns -1 if failures occur.
+
+ CORBA::Short update_all_frames (const ACE_Time_Value& tv);
+ // Updates time frames, based on the passed time value.
+
+ CORBA::Short update_all_frames_with_time (Metrics::Time mt,
+ CORBA::Environment &ACE_TRY_ENV
+ = CORBA::Environment::default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::SYNCHRONIZATION));
+ // Updates time frames, based on the passed time value.
+
+ CORBA::Short update_all_frames (CORBA::Environment &ACE_TRY_ENV
+ = CORBA::Environment::default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::SYNCHRONIZATION));
+ // Updates time frames, based on the current time as of the call.
+
+ CORBA::Short update_frame (RtecScheduler::Period_t p, const ACE_Time_Value& tv);
+ // Updates the passed period's time frame, based on the passed time
+ // value.
+
+ CORBA::Short update_frame_with_time (RtecScheduler::Period_t p,
+ Metrics::Time mt,
+ CORBA::Environment &ACE_TRY_ENV
+ = CORBA::Environment::default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION));
+ // Updates the passed period's time frame, based on the passed time
+ // value.
+
+ CORBA::Short update_frame (RtecScheduler::Period_t p,
+ CORBA::Environment &ACE_TRY_ENV
+ = CORBA::Environment::default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION));
+ // Updates the passed period's time frame, based on the current time
+ // as of the call.
+
+ CORBA::Short reset_all_frames (const ACE_Time_Value& tv);
+ // Resets time frames, based on the passed time value.
+
+ CORBA::Short reset_all_frames_with_time (Metrics::Time mt,
+ CORBA::Environment &ACE_TRY_ENV
+ = CORBA::Environment::default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::SYNCHRONIZATION));
+ // Resets time frames, based on the passed time value.
+
+ CORBA::Short reset_all_frames (CORBA::Environment &ACE_TRY_ENV
+ = CORBA::Environment::default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::SYNCHRONIZATION));
+ // Resets time frames, based on the current time as of the call.
+
+ CORBA::Short reset_frame (RtecScheduler::Period_t p, const ACE_Time_Value& tv);
+ // Resets the passed period's start-of-frame, based on the passed time
+ // value.
+
+ CORBA::Short reset_frame_with_time (RtecScheduler::Period_t p,
+ Metrics::Time mt,
+ CORBA::Environment &ACE_TRY_ENV
+ = CORBA::Environment::default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION));
+ // Resets the passed period's start-of-frame, based on the passed time
+ // value.
+
+ CORBA::Short reset_frame (RtecScheduler::Period_t p,
+ CORBA::Environment &ACE_TRY_ENV
+ = CORBA::Environment::default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION));
+ // Resets the passed period's start-of-frame, based on the current time
+ // as of the call.
+
+ CORBA::Short get_start_time (RtecScheduler::Period_t p, ACE_Time_Value &start);
+ // Gets the start time for the period's current frame.
+
+ CORBA::Short get_start_time (RtecScheduler::Period_t p,
+ Metrics::Time &start,
+ CORBA::Environment &ACE_TRY_ENV
+ = CORBA::Environment::default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION));
+ // Gets the start time for the period's current frame.
+
+ CORBA::Short get_end_time (RtecScheduler::Period_t p, ACE_Time_Value &end);
+ // Gets the end time for the period's current frame.
+
+ CORBA::Short get_end_time (RtecScheduler::Period_t p,
+ Metrics::Time &end,
+ CORBA::Environment &ACE_TRY_ENV
+ = CORBA::Environment::default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION));
+ // Gets the end time for the period's current frame.
+
+ CORBA::Short get_frame_id (RtecScheduler::Period_t p,
+ CORBA::ULong &id,
+ CORBA::Environment &ACE_TRY_ENV
+ = CORBA::Environment::default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION));
+ // Gets the locally unique identifier for the period's current frame.
+
+ CORBA::Short get_frame_data (RtecScheduler::Period_t p, ACE_Time_Value &start,
+ ACE_Time_Value &end, CORBA::ULong &id);
+ // Gets the start time, end time, and id period's current frame.
+
+ CORBA::Short get_frame_data (RtecScheduler::Period_t p,
+ Metrics::Time &start,
+ Metrics::Time &end,
+ CORBA::ULong &id,
+ CORBA::Environment &ACE_TRY_ENV
+ = CORBA::Environment::default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION));
+ // Gets the start time, end time, and id period's current frame.
+
+protected:
+
+ CORBA::Short update_data (TAO_Metrics_Frame_Manager_Data<ACE_LOCK> & data,
+ const ACE_Time_Value& tv);
+ // Updates the passed frame data structure's start and end times,
+ // based on the passed time value. This is a protected internal
+ // method, and should only be called with locks already held.
+
+
+ CORBA::Short reset_data (TAO_Metrics_Frame_Manager_Data<ACE_LOCK> & data,
+ const ACE_Time_Value& tv);
+ // Resets the passed frame data structure's start and end times, to
+ // the passed time value and one period later, respectively. This
+ // is a protected internal method, and should only be called with
+ // locks already held.
+
+ METRICS_FRAME_DATA_MAP frame_data_map_;
+ // Maps periods to frame data.
+
+ // Count of the number of registered periods.
+ u_long period_count_;
+
+ ACE_LOCK lock_;
+ // Lock for synchronizing access to the map.
+};
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Metrics/Metrics_FrameManager_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Metrics_FrameManager_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Metrics/Metrics_FrameManager_T.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* METRICS_FRAME_MANAGER_T_H */
+
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager_T.i b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager_T.i
new file mode 100644
index 00000000000..a14671b359e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_FrameManager_T.i
@@ -0,0 +1,821 @@
+// $Id$
+
+#ifndef METRICS_FRAME_MANAGER_T_I
+#define METRICS_FRAME_MANAGER_T_I
+
+
+////////////////////////////////////
+// Class TAO_Metrics_FrameManager //
+////////////////////////////////////
+
+
+// Default constructor.
+
+template <class ACE_LOCK>
+ACE_INLINE
+TAO_Metrics_FrameManager<ACE_LOCK>::
+TAO_Metrics_FrameManager ()
+ : period_count_ (0)
+{
+ // Ensure that the high res timer global scale factor
+ // is set before any of its static methods are used
+ ACE_High_Res_Timer::global_scale_factor ();
+}
+
+// Destructor. Note: this is *not* thread safe. If we're destroying
+// the frame manager then there had better not be any threads in the
+// manager anyway. If a use case requires thread safety at
+// destruction, then some kind of external reader-writer locking and
+// barrier synchronization scheme will be needed to make this work
+// efficiently.
+
+template <class ACE_LOCK>
+ACE_INLINE
+TAO_Metrics_FrameManager<ACE_LOCK>::
+~TAO_Metrics_FrameManager ()
+{
+ // Iterate through and delete the data structures in the map
+ METRICS_FRAME_DATA_MAP_ITERATOR iter (frame_data_map_);
+ while (iter.done () == 0)
+ {
+ delete (*iter).int_id_;
+ ++iter;
+ }
+}
+
+
+// Binds the period to the internal frame map, with a new frame data
+// structure. Returns 0 if a new entry is bound successfully, returns
+// 1 if an attempt is made to bind an existing entry, and returns -1
+// if failures occur.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+register_period (RtecScheduler::Period_t p,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION))
+{
+ // Treat a zero period as a special case: no need to register, but
+ // no harm if someone tries.
+ if (p == 0)
+ {
+ return 0;
+ }
+
+ // Synchronize read/write access to the map while the new period's
+ // frame is being installed.
+ ACE_Write_Guard<ACE_LOCK> mon (this->lock_);
+ if (mon.locked () == 0)
+ {
+ ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ }
+
+ int result = 0;
+ TAO_Metrics_Frame_Manager_Data<ACE_LOCK> * data = 0;
+ if (frame_data_map_.find (p) != 0)
+ {
+ ACE_NEW_RETURN (data, TAO_Metrics_Frame_Manager_Data<ACE_LOCK> (p), -1);
+ result = frame_data_map_.trybind (p, data);
+ if (result == 0)
+ {
+ // All is well: count the new period.
+ ++period_count_;
+ }
+ else
+ {
+ delete data;
+
+ // We failed to bind: throw an exception.
+ ACE_THROW_RETURN (Metrics::INTERNAL (), -1);
+ }
+ }
+
+ return result;
+}
+
+// Updates time frames, based on the passed time value.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+update_all_frames (const ACE_Time_Value& tv)
+{
+ // Synchronize read/write access to the map while the new frames are
+ // being computed.
+ ACE_Write_Guard<ACE_LOCK> mon (this->lock_);
+ if (mon.locked () == 0)
+ {
+ return -1;
+ }
+
+ METRICS_FRAME_DATA_MAP_ITERATOR iter (frame_data_map_);
+ while (iter.done () == 0)
+ {
+ update_data (*((*iter).int_id_), tv);
+ ++iter;
+ }
+ return 0;
+}
+
+
+// Updates time frames, based on the passed time value.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+update_all_frames_with_time (Metrics::Time mt,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::SYNCHRONIZATION))
+{
+ // Reentrant method that calls locked method.
+ ACE_Time_Value tv;
+ ORBSVCS_Time::TimeT_to_Time_Value(tv, mt);
+ if (this->update_all_frames (tv) < 0)
+ {
+ ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ }
+
+ return 0;
+}
+
+// Updates time frames, based on the current time as of the call.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+update_all_frames (CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::SYNCHRONIZATION))
+{
+ // Synchronize read/write access to the map while the new frames are
+ // being computed.
+ ACE_Write_Guard<ACE_LOCK> mon (this->lock_);
+ if (mon.locked () == 0)
+ {
+ ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ }
+
+ METRICS_FRAME_DATA_MAP_ITERATOR iter (frame_data_map_);
+
+ // Grab the common time stamp as late as possible, i.e., after all
+ // locks are held.
+ ACE_Time_Value tv;
+ ACE_hrtime_t hrtime_now = ACE_OS::gethrtime ();
+ ACE_High_Res_Timer::hrtime_to_tv (tv, hrtime_now);
+
+ while (iter.done () == 0)
+ {
+ update_data (*((*iter).int_id_), tv);
+ ++iter;
+ }
+ return 0;
+}
+
+
+// Updates the passed period's time frame, based on the passed time
+// value.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+update_frame (RtecScheduler::Period_t p, const ACE_Time_Value& tv)
+{
+ // Treat a zero period as a special case.
+ if (p == 0)
+ {
+ return 0;
+ }
+
+ TAO_Metrics_Frame_Manager_Data<ACE_LOCK> * data;
+
+ // Synchronize write access to the map during pointer lookup only
+ ACE_Read_Guard<ACE_LOCK> mon (this->lock_);
+ if (mon.locked () == 0)
+ {
+ return -1;
+ }
+
+ if (frame_data_map_.find (p, data) == 0 && data != 0)
+ {
+ mon.release ();
+
+ // Synchronize read/write access to the specific data structure
+ // instance during update
+ ACE_Write_Guard<ACE_LOCK> data_mon (data->lock_);
+ if (data_mon.locked () == 0)
+ {
+ return -1;
+ }
+ return update_data (*data, tv);
+ }
+
+ return -2;
+}
+
+// Updates the passed period's time frame, based on the passed time
+// value.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+update_frame_with_time (RtecScheduler::Period_t p, Metrics::Time mt,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION))
+{
+ // Treat a zero period as a special case.
+ if (p == 0)
+ {
+ return 0;
+ }
+
+ // Reentrant method that calls locked method.
+ ACE_Time_Value tv;
+ ORBSVCS_Time::TimeT_to_Time_Value(tv, mt);
+ switch (this->update_frame (p, tv))
+ {
+ case -1: ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ case -2: ACE_THROW_RETURN (Metrics::INTERNAL (), -1);
+ default: return 0;
+ }
+}
+
+
+// Updates the passed period's time frame, based on the current time
+// as of the call.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+update_frame (RtecScheduler::Period_t p, CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION))
+{
+ // Treat a zero period as a special case.
+ if (p == 0)
+ {
+ return 0;
+ }
+
+ TAO_Metrics_Frame_Manager_Data<ACE_LOCK> * data;
+
+ // Synchronize write access to the map during pointer lookup only
+ ACE_Read_Guard<ACE_LOCK> mon (this->lock_);
+ if (mon.locked () == 0)
+ {
+ ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ }
+
+ if (frame_data_map_.find (p, data) == 0 && data != 0)
+ {
+ mon.release ();
+
+ // Synchronize read/write access to the specific data structure instance during
+ // update
+ ACE_Write_Guard<ACE_LOCK> data_mon (data->lock_);
+ if (data_mon.locked () == 0)
+ {
+ ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ }
+
+ // Grab the time stamp as late as possible, i.e., after all locks
+ // are held.
+ ACE_Time_Value tv;
+ ACE_hrtime_t hrtime_now = ACE_OS::gethrtime ();
+ ACE_High_Res_Timer::hrtime_to_tv (tv, hrtime_now);
+
+ return update_data (*data, tv);
+ }
+
+ ACE_THROW_RETURN (Metrics::INTERNAL (), -1);
+}
+
+
+// Resets time frames, based on the passed time value.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+reset_all_frames (const ACE_Time_Value& tv)
+{
+ // Synchronize read/write access to the map during the reset
+ ACE_Write_Guard<ACE_LOCK> mon (this->lock_);
+ if (mon.locked () == 0)
+ {
+ return -1;
+ }
+
+ METRICS_FRAME_DATA_MAP_ITERATOR iter (frame_data_map_);
+ while (iter.done () == 0)
+ {
+ reset_data (*((*iter).int_id_), tv);
+ ++iter;
+ }
+ return 0;
+}
+
+
+// Resets time frames, based on the passed time value.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+reset_all_frames_with_time (Metrics::Time mt,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::SYNCHRONIZATION))
+{
+ // Reentrant method that calls locked method.
+ ACE_Time_Value tv;
+ ORBSVCS_Time::TimeT_to_Time_Value(tv, mt);
+ if (this->reset_all_frames (tv) < 0)
+ {
+ ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ }
+
+ return 0;
+}
+
+// Resets time frames, based on the current time as of the call.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+reset_all_frames (CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::SYNCHRONIZATION))
+{
+ // Synchronize read/write access to the map during the reset
+ ACE_Write_Guard<ACE_LOCK> mon (this->lock_);
+ if (mon.locked () == 0)
+ {
+ ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ }
+
+ METRICS_FRAME_DATA_MAP_ITERATOR iter (frame_data_map_);
+
+ // Grab the time stamp as late as possible, i.e., after all locks
+ // are held.
+ ACE_Time_Value tv;
+ ACE_hrtime_t hrtime_now = ACE_OS::gethrtime ();
+ ACE_High_Res_Timer::hrtime_to_tv (tv, hrtime_now);
+
+ while (iter.done () == 0)
+ {
+ reset_data (* ((*iter).int_id_), tv);
+ ++iter;
+ }
+ return 0;
+}
+
+
+// Resets the passed period's start-of-frame, based on the passed time
+// value.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+reset_frame (RtecScheduler::Period_t p, const ACE_Time_Value& tv)
+{
+ // Treat a zero period as a special case.
+ if (p == 0)
+ {
+ return 0;
+ }
+
+ TAO_Metrics_Frame_Manager_Data<ACE_LOCK> * data;
+
+ // Synchronize write access to the map during lookup only
+ ACE_Read_Guard<ACE_LOCK> mon (this->lock_);
+ if (mon.locked () == 0)
+ {
+ return -1;
+ }
+
+ if (frame_data_map_.find (p, data) == 0 && data != 0)
+ {
+ mon.release ();
+
+ // Synchronize read/write access to the individual data
+ // structure instance during reset
+ ACE_Write_Guard<ACE_LOCK> data_mon (data->lock_);
+ if (data_mon.locked () == 0)
+ {
+ return -1;
+ }
+
+ return reset_data (*data, tv);
+ }
+
+ return -2;
+}
+
+// Resets the passed period's start-of-frame, based on the passed time
+// value.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+reset_frame_with_time (RtecScheduler::Period_t p, Metrics::Time mt,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION))
+{
+ // Treat a zero period as a special case.
+ if (p == 0)
+ {
+ return 0;
+ }
+
+ // Reentrant method that calls locked method.
+ ACE_Time_Value tv;
+ ORBSVCS_Time::TimeT_to_Time_Value(tv, mt);
+ switch (this->reset_frame (p, tv))
+ {
+ case -1: ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ case -2: ACE_THROW_RETURN (Metrics::INTERNAL (), -1);
+ default: return 0;
+ }
+}
+
+
+// Resets the passed period's start-of-frame, based on the current
+// time as of the call.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+reset_frame (RtecScheduler::Period_t p, CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION))
+{
+ // Treat a zero period as a special case.
+ if (p == 0)
+ {
+ return 0;
+ }
+
+ TAO_Metrics_Frame_Manager_Data<ACE_LOCK> * data;
+
+ // Synchronize write access to the map during lookup only
+ ACE_Read_Guard<ACE_LOCK> mon (this->lock_);
+ if (mon.locked () == 0)
+ {
+ ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ }
+
+ if (frame_data_map_.find (p, data) == 0 && data != 0)
+ {
+ mon.release ();
+
+ // Synchronize read/write access to the individual data
+ // structure instance during reset
+ ACE_Write_Guard<ACE_LOCK> data_mon (data->lock_);
+ if (data_mon.locked () == 0)
+ {
+ ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ }
+
+ // Grab the time stamp as late as possible, i.e., after all locks
+ // are held.
+ ACE_Time_Value tv;
+ ACE_hrtime_t hrtime_now = ACE_OS::gethrtime ();
+ ACE_High_Res_Timer::hrtime_to_tv (tv, hrtime_now);
+
+ if (data == 0)
+ {
+ ACE_THROW_RETURN (Metrics::INTERNAL (), -1);
+ }
+
+ return reset_data (*data, tv);
+ }
+
+ ACE_THROW_RETURN (Metrics::INTERNAL (), -1);
+}
+
+
+// Gets the start time for the period's current frame.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+get_start_time (RtecScheduler::Period_t p, ACE_Time_Value &start)
+{
+ // Treat a zero period as a special case.
+ if (p == 0)
+ {
+ start = ACE_Time_Value::zero;
+ return 0;
+ }
+
+ TAO_Metrics_Frame_Manager_Data<ACE_LOCK> * data;
+
+ // Synchronize write access to the map during lookup only
+ ACE_Read_Guard<ACE_LOCK> mon (this->lock_);
+ if (mon.locked () == 0)
+ {
+ return -1;
+ }
+
+ if (frame_data_map_.find (p, data) == 0 && data != 0)
+ {
+ mon.release ();
+
+ // Synchronize write access to the individual data structure instance
+ ACE_Read_Guard<ACE_LOCK> data_mon (data->lock_);
+ if (data_mon.locked () == 0)
+ {
+ return -1;
+ }
+
+ start.set (data->start_.sec (), data->start_.usec ());
+ return 0;
+ }
+
+ return -2;
+}
+
+// Gets the start time for the period's current frame.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+get_start_time (RtecScheduler::Period_t p, Metrics::Time &start,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION))
+{
+ // Treat a zero period as a special case.
+ if (p == 0)
+ {
+ start = 0;
+ return 0;
+ }
+
+ // Reentrant method that calls locked method.
+ ACE_Time_Value tv;
+ switch (this->get_start_time (p, tv))
+ {
+ case -1: ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ case -2: ACE_THROW_RETURN (Metrics::INTERNAL (), -1);
+ default: ORBSVCS_Time::Time_Value_to_TimeT (start, tv);
+ return 0;
+ }
+}
+
+
+// Gets the end time for the period's current frame.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+get_end_time (RtecScheduler::Period_t p, ACE_Time_Value &end)
+{
+ // Treat a zero period as a special case.
+ if (p == 0)
+ {
+ end = ACE_Time_Value::zero;
+ return 0;
+ }
+
+ TAO_Metrics_Frame_Manager_Data<ACE_LOCK> * data = 0;
+
+ // Synchronize write access to the map during lookup only
+ ACE_Read_Guard<ACE_LOCK> mon (this->lock_);
+ if (mon.locked () == 0)
+ {
+ return -1;
+ }
+
+ if (frame_data_map_.find (p, data) == 0 && data != 0)
+ {
+ mon.release ();
+
+ // Synchronize write access to the individual data structure instance
+ ACE_Read_Guard<ACE_LOCK> data_mon (data->lock_);
+ if (data_mon.locked () == 0)
+ {
+ return -1;
+ }
+
+ end.set (data->end_.sec (), data->end_.usec ());
+ return 0;
+ }
+
+ return -2;
+}
+
+
+// Gets the end time for the period's current frame.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+get_end_time (RtecScheduler::Period_t p, Metrics::Time &end,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION))
+{
+ // Treat a zero period as a special case.
+ if (p == 0)
+ {
+ end = 0;
+ return 0;
+ }
+
+ // Reentrant method that calls locked method.
+ ACE_Time_Value tv;
+ switch (this->get_end_time (p, tv))
+ {
+ case -1: ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ case -2: ACE_THROW_RETURN (Metrics::INTERNAL (), -1);
+ default: ORBSVCS_Time::Time_Value_to_TimeT (end, tv);
+ return 0;
+ }
+}
+
+// Gets the locally unique identifier for the period's current frame.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+get_frame_id (RtecScheduler::Period_t p,
+ CORBA::ULong &id,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION))
+{
+ // Treat a zero period as a special case.
+ if (p == 0)
+ {
+ id = 0;
+ return 0;
+ }
+
+ TAO_Metrics_Frame_Manager_Data<ACE_LOCK> * data;
+
+ // Synchronize write access to the map during lookup only
+ ACE_Read_Guard<ACE_LOCK> mon (this->lock_);
+ if (mon.locked () == 0)
+ {
+ ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ }
+
+ if (frame_data_map_.find (p, data) == 0 && data != 0)
+ {
+ mon.release ();
+
+ // Synchronize write access to the individual data structure instance
+ ACE_Read_Guard<ACE_LOCK> data_mon (data->lock_);
+ if (data_mon.locked () == 0)
+ {
+ ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ }
+
+ id = data->frame_id_;
+ return 0;
+ }
+
+ ACE_THROW_RETURN (Metrics::INTERNAL (), -1);
+}
+
+
+// Gets the start time, end time, and id period's current frame.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+get_frame_data (RtecScheduler::Period_t p, ACE_Time_Value &start,
+ ACE_Time_Value &end, CORBA::ULong &id)
+{
+ // Treat a zero period as a special case.
+ if (p == 0)
+ {
+ start = ACE_Time_Value::zero;
+ end = ACE_Time_Value::zero;
+ id = 0;
+ return 0;
+ }
+
+ TAO_Metrics_Frame_Manager_Data<ACE_LOCK> * data;
+
+ // Synchronize write access to the map during lookup only
+ ACE_Read_Guard<ACE_LOCK> mon (this->lock_);
+ if (mon.locked () == 0)
+ {
+ return -1;
+ }
+
+ if (frame_data_map_.find (p, data) == 0 && data != 0)
+ {
+ mon.release ();
+
+ // Synchronize write access to the individual data structure instance
+ ACE_Read_Guard<ACE_LOCK> data_mon (data->lock_);
+ if (data_mon.locked () == 0)
+ {
+ return -1;
+ }
+
+ start.set (data->start_.sec (), data->start_.usec ());
+ end.set (data->end_.sec (), data->end_.usec ());
+ id = data->frame_id_;
+ return 0;
+ }
+
+ return -2;
+}
+
+
+
+// Gets the start time, end time, and id period's current frame.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+get_frame_data (RtecScheduler::Period_t p, Metrics::Time &start,
+ Metrics::Time &end, CORBA::ULong &id,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL,
+ Metrics::SYNCHRONIZATION))
+{
+ // Treat a zero period as a special case.
+ if (p == 0)
+ {
+ start = 0;
+ end = 0;
+ id = 0;
+ return 0;
+ }
+
+ // Reentrant method that calls locked method.
+ ACE_Time_Value start_tv, end_tv;
+ switch (this->get_frame_data (p, start_tv, end_tv, id))
+ {
+ case -1: ACE_THROW_RETURN (Metrics::SYNCHRONIZATION (), -1);
+ case -2: ACE_THROW_RETURN (Metrics::INTERNAL (), -1);
+ default: ORBSVCS_Time::Time_Value_to_TimeT (start, start_tv);
+ ORBSVCS_Time::Time_Value_to_TimeT (end, end_tv);
+ return 0;
+ }
+}
+
+
+// Updates the passed frame data structure's start and end times,
+// based on the passed time value. This is a protected internal
+// method, and should only be called with locks already held.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+update_data (TAO_Metrics_Frame_Manager_Data<ACE_LOCK> & data, const ACE_Time_Value& tv)
+{
+ if (data.end_ == ACE_Time_Value::zero)
+ {
+ return reset_data (data, tv);
+ }
+
+ // Advance to the frame that encloses the passed time value.
+ while (data.end_ < tv)
+ {
+ data.end_ += data.period_;
+ ++data.frame_id_;
+ }
+
+ data.start_.set (data.end_.sec (), data.end_.usec ());
+ data.start_ -= data.period_;
+ return 0;
+}
+
+
+// Resets the passed frame data structure's start and end times, to
+// the passed time value and one period later, respectively. This is
+// a protected internal method, and should only be called with locks
+// already held.
+
+template <class ACE_LOCK>
+ACE_INLINE CORBA::Short
+TAO_Metrics_FrameManager<ACE_LOCK>::
+reset_data (TAO_Metrics_Frame_Manager_Data<ACE_LOCK> & data, const ACE_Time_Value& tv)
+{
+ data.start_.set (tv.sec (), tv.usec ());
+ data.end_.set (tv.sec () + data.period_.sec (),
+ tv.usec () + data.period_.usec ());
+ return 0;
+}
+
+
+#endif /* METRICS_FRAME_MANAGER_T_I */
+
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache.cpp b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache.cpp
new file mode 100644
index 00000000000..c1b7f9eb788
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache.cpp
@@ -0,0 +1,12 @@
+// $Id$
+
+#ifndef METRICS_LOCAL_CACHE_CPP
+#define METRICS_LOCAL_CACHE_CPP
+
+#include "orbsvcs/Metrics/Metrics_LocalCache.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/Metrics/Metrics_LocalCache.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* METRICS_LOCAL_CACHE_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache.h b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache.h
new file mode 100644
index 00000000000..71fcb092381
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache.h
@@ -0,0 +1,115 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef METRICS_LOCAL_CACHE_H
+#define METRICS_LOCAL_CACHE_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Hash_Map_Manager.h"
+#include "ace/Metrics_Cache.h"
+#include "ace/Metrics_Cache_T.h"
+#include "ace/Singleton.h"
+#include "ace/Synch_Traits.h"
+#include "ace/Thread_Mutex.h"
+
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Scheduler_Factory.h"
+#include "orbsvcs/MetricsC.h"
+
+#include "orbsvcs/Metrics/Metrics_Utils.h"
+
+#if defined (ACE_METRICS_COLLECTION)
+
+#if defined (ACE_ENABLE_TIMEPROBES) && defined (ACE_COMPILE_TIMEPROBES)
+
+#include "orbsvcs/Metrics/Metrics_LocalCache_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef TAO_Metrics_LocalCache<ACE_SYNCH_MUTEX, ACE_New_Allocator>
+TAO_METRICS_CACHE_TYPE;
+
+typedef ACE_Singleton<TAO_METRICS_CACHE_TYPE, ACE_SYNCH_MUTEX>
+TAO_METRICS_CACHE_SINGLETON_TYPE;
+
+typedef TAO_Metrics_ReportingLocalCache<ACE_SYNCH_MUTEX, ACE_New_Allocator>
+TAO_METRICS_REPORTING_CACHE_TYPE;
+
+typedef ACE_Singleton<TAO_METRICS_REPORTING_CACHE_TYPE, ACE_SYNCH_MUTEX>
+TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE;
+
+#if defined (TAO_USES_REPORTING_METRICS)
+typedef TAO_METRICS_REPORTING_CACHE_TYPE TAO_METRICS_CACHE;
+typedef TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE TAO_METRICS_CACHE_SINGLETON;
+#else
+typedef TAO_METRICS_CACHE_TYPE TAO_METRICS_CACHE;
+typedef TAO_METRICS_CACHE_SINGLETON_TYPE TAO_METRICS_CACHE_SINGLETON;
+#endif
+
+/**
+ * NOTE: This is a simple macro which calls the appropriate registration function with the cache to
+ * store the data from this pointer. At the ACE level there is no need to give a PROBE_TYPE
+ * because there is only one probe type (ACE_Timeprobe).
+ *
+ * USAGE_LEVEL: TAO
+ *
+ * Q1: Where is this and the next macro used? One example is on TAO/orbsvcs/orbsvcs/Metrics. No where in the ace code.
+ * So is this a ACE or TAO macro?
+ *
+ * Q2: Is the function (register + METRICS_REGION) a ACE or TAO?
+ * A2: TAO. Define in Metrics_Local_Cache_T.h. The only METRICS_REGION that exists is 'base_metrics'. Used
+ * in $TAO_ROOT/orbsvcs/orbsvcs/Metrics/Metrics_Utils.cpp
+ *
+ * @param METRICS_PTR - Initialized pointer to the Metrics_Cache. This pointer is used to register the probe
+ * with the associated cache.
+ * @param METIRCS_REGION - At present there is only one 'base_metrics'.
+ * @param PROBE_NAME - String name of the probe
+ * @param PROBE_TYPE - Unsigned integer representing the probe type
+ * @param METRICS_HANDLE - Variable used to contain the metrics probe handle that is the result of this function
+ * The type of the handle is a RtecScheduler::handle_t
+ */
+# define REGISTER_METRICS_PROBE_RETURN(METRICS_PTR,METRICS_REGION,PROBE_NAME,PROBE_TYPE,METRICS_HANDLE) \
+do { if((METRICS_PTR->metrics_enabled())) { \
+METRICS_HANDLE = METRICS_PTR-> \
+register_##METRICS_REGION ( \
+PROBE_NAME, \
+PROBE_TYPE); \
+} } while (0)
+
+/**
+ * Same as above but instead of just reporting information to a cache there is also reference to a Metrics_Loger (TAO feature).
+ * The logger is used to record the information. The type of probe is register with the logger
+ *
+ * USAGE_LEVEL: TAO
+ */
+# define REGISTER_METRICS_REPORTING_PROBE_RETURN(METRICS_PTR,METRICS_REGION,PROBE_NAME,PROBE_TYPE,METRICS_LOGGER_REF,METRICS_HANDLE) \
+do { if((METRICS_PTR->metrics_enabled())) { \
+METRICS_HANDLE = METRICS_PTR-> \
+register_##METRICS_REGION## ( \
+PROBE_NAME, \
+PROBE_TYPE, \
+METRICS_LOGGER_REF); \
+} } while (0)
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Metrics/Metrics_LocalCache.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* ACE_ENABLE_TIMEPROBES && ACE_COMPILE_TIMEPROBES */
+#endif /* ACE_METRICS_COLLECTION */
+
+#include /**/ "ace/post.h"
+
+#endif /* METRICS_LOCAL_CACHE_H */
+
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache.i b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache.i
new file mode 100644
index 00000000000..a9ccf1b5acd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache.i
@@ -0,0 +1,10 @@
+// $Id$
+
+#ifndef METRICS_LOCAL_CACHE_I
+#define METRICS_LOCAL_CACHE_I
+
+#endif /* METRICS_LOCAL_CACHE_I */
+
+
+
+
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.cpp b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.cpp
new file mode 100644
index 00000000000..2478ce10532
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.cpp
@@ -0,0 +1,488 @@
+// $Id$
+
+#ifndef METRICS_LOCAL_CACHE_T_CPP
+#define METRICS_LOCAL_CACHE_T_CPP
+
+#include "orbsvcs/Metrics/Metrics_LocalCache_T.h"
+
+#if defined VXWORKS
+#include <cacheLib.h>
+#endif
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//////////////////////////////////////
+// Class TAO_Metrics_LocalTimeprobe //
+//////////////////////////////////////
+
+// Default constructor.
+
+template <class ACE_LOCK, class ALLOCATOR>
+TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::
+TAO_Metrics_LocalTimeprobe (u_int id,
+ const char *name,
+ u_long size,
+ ALLOCATOR * alloc)
+ : ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> (alloc, id, name, size),
+ is_operation_ (0),
+ is_hrt_ (0),
+ data_set_ (0)
+{
+}
+
+template <class ACE_LOCK, class ALLOCATOR>
+void
+TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::report_intervals (int report_full_interval_times)
+{
+ u_long data_set_length = 0;
+
+ // Modified by BRM. This should also work for ACE_Based_Pointer since the conversion
+ // operator should fire.
+ // Metrics::TimeprobeParameter_Set * data_set = data_set_.addr ();
+ Metrics::TimeprobeParameter_Set * data_set = data_set_;
+
+ //ACE_Time_Value full_start_time (ACE_Time_Value::zero);
+ ACE_hrtime_t full_start_time = 0;
+ //ACE_Time_Value full_stop_time (ACE_Time_Value::zero);
+ ACE_hrtime_t full_stop_time = 0;
+
+ if (!data_set)
+ {
+#if defined (METRICS_CACHE_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR,
+ "TAO_Metrics_LocalTimeprobe::report_intervals:"
+ " no data set installed"));
+#endif
+ return;
+ }
+ else
+ {
+ data_set_length = data_set->length ();
+ }
+
+ if (this->current_size_ == 0 && this->report_buffer_full_ == 0)
+ return;
+
+ u_long valid_intervals = 0;
+ int good_interval;
+
+ // Note the case of current_size_ and report_buffer_full_ both being
+ // 0 was checked above, which simplifies this code.
+ // This logic make no sense to me. What are you going for here, Chris?
+ // If the buffer fills, then report_buffer_full == 1, and current size == 0.
+ // We always needs i to start at 0, though?????
+ // u_long i;
+ // i = (report_buffer_full_ == 0) ? 1 : this->current_size_;
+ u_long start_evt_ndx = 0;
+ u_long full_interval_start_evt_ndx = 0;
+ u_long full_interval_start_ndx_set = 0;
+ u_long stop_evt_ndx = 0;
+ short any_cross_thread_event = 0;
+ short is_cross_thread_event = 0;
+ do
+ {
+ // Begin a new interval at each successive start event.
+ if (is_event (this->timeprobes ()[start_evt_ndx],
+ ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_START))
+ {
+ // If we see the start event, then reset the cross thread indicator
+ is_cross_thread_event = 0;
+
+ if (!full_interval_start_ndx_set)
+ {
+ full_interval_start_ndx_set = 1;
+ full_interval_start_evt_ndx = start_evt_ndx;
+ }
+
+ // Accumulates elapsed time in the measured interval, taking
+ // into account paired suspend and resume markers.
+ ACE_Time_Value elapsed_time (ACE_Time_Value::zero);
+
+ // Stores current start time: either from a start or resume event.
+ ACE_Time_Value start_time (this->timeprobes ()[start_evt_ndx].time_);
+
+ // Check if this start time is less than the full interval for worse
+ // case time.
+ if (full_start_time == 0 ||
+ this->timeprobes ()[start_evt_ndx].time_ < full_start_time)
+ {
+ full_start_time = this->timeprobes ()[start_evt_ndx].time_;
+ }
+ if (full_stop_time == 0 ||
+ this->timeprobes ()[start_evt_ndx].time_ > full_stop_time)
+ {
+ full_stop_time = this->timeprobes ()[start_evt_ndx].time_;
+ }
+
+ good_interval = 1;
+
+ // Increment past the start event and start looking for the stop event
+ u_long stop_or_suspend_evt_ndx = (start_evt_ndx + 1) % this ->max_size_; // Modulus increment: loops around at the end.
+ do
+ {
+ // If the index is at the end, skip and exit the loop.
+ if (stop_or_suspend_evt_ndx == this->current_size_)
+ {
+ break;
+ }
+
+ // This needs to be rethought... Events that occur across threads are a real thing.
+ // So for now, the behavior is to just indicate the events that are cross thread
+// if (this->timeprobes ()[start_evt_ndx].thread_ != this->timeprobes ()[stop_or_suspend_evt_ndx].thread_)
+// {
+// stop_or_suspend_evt_ndx = (stop_or_suspend_evt_ndx + 1) % this ->max_size_; // Modulus increment: loops around at the end.
+// continue;
+// }
+
+ // Check for the stop event
+ if (is_event (this->timeprobes ()[stop_or_suspend_evt_ndx],
+ ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_STOP))
+ {
+ ++valid_intervals;
+
+ if (this->timeprobes ()[start_evt_ndx].thread_ != this->timeprobes ()[stop_or_suspend_evt_ndx].thread_)
+ {
+ // If any probe is cross, thread then the interval is cross thread.
+ any_cross_thread_event = 1;
+
+ is_cross_thread_event = 1;
+ }
+
+ // done this way for efficiency: no temporaries constructed
+ elapsed_time += this->timeprobes ()[stop_or_suspend_evt_ndx].time_;
+ elapsed_time -= start_time;
+
+ // This doesn't make sense. Full start time better be the result of
+ // a start event.
+// if (full_start_time == ACE_Time_Value::zero ||
+// this->timeprobes ()[j].time_ < full_start_time)
+// {
+// full_start_time.set (this->timeprobes()[j].time_.sec (),
+// this->timeprobes()[j].time_.usec());
+// }
+
+ if (full_stop_time == 0 ||
+ this->timeprobes ()[stop_or_suspend_evt_ndx].time_ > full_stop_time)
+ {
+ full_stop_time = this->timeprobes()[stop_or_suspend_evt_ndx].time_;
+ }
+
+ stop_evt_ndx = stop_or_suspend_evt_ndx;
+ // Increase the length of the data set and record
+ // the interval info.
+ ++data_set_length;
+ data_set->length (data_set_length);
+ (*(data_set))[data_set_length-1].is_full_interval = 0;
+ (*(data_set))[data_set_length-1].probe_id = this->id_;
+ (*(data_set))[data_set_length-1].is_operation = this->is_operation_;
+ (*(data_set))[data_set_length-1].is_hrt = this->is_hrt_;
+ (*(data_set))[data_set_length-1].cross_thread_probe = is_cross_thread_event;
+ ORBSVCS_Time::Time_Value_to_TimeT
+ ((*(data_set)) [data_set_length-1].start_event_time,
+ this->timeprobes ()[start_evt_ndx].time_);
+ ORBSVCS_Time::Time_Value_to_TimeT
+ ((*(data_set)) [data_set_length-1].stop_event_time,
+ this->timeprobes ()[stop_or_suspend_evt_ndx].time_);
+ ORBSVCS_Time::Time_Value_to_TimeT
+ ((*(data_set)) [data_set_length-1].interval,
+ elapsed_time);
+#if defined (METRICS_CACHE_DEBUG_OUTPUT_ENABLED)
+ ACE_OS::printf (" %9lu\n",
+ (u_long)
+ ACE_U64_TO_U32((*(data_set))
+ [data_set_length-1].interval
+ / 10));
+#endif
+ break;
+ }
+
+ // If it wasn't a stop event, check for a suspend event
+#if defined (ACE_HAS_METRICS_BASE_POINTERS)
+ else if (this->timeprobes ()[stop_or_suspend_evt_ndx].event_ == (u_long)
+ ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_SUSPEND)
+#else
+ else if (this->timeprobes ()[stop_or_suspend_evt_ndx].event_.event_number_ == (u_long)
+ ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_SUSPEND)
+#endif
+ {
+ u_long resume_evt_ndx = (stop_or_suspend_evt_ndx + 1) % this ->max_size_; // Modulus increment: loops around at the end.
+ do
+ {
+ // Skip until we reach the next event in the same thread, or if the
+ // index is at the end, skip and exit the loop.
+// if (this->timeprobes ()[j].thread_ != this->timeprobes ()[k].thread_
+// || k == this->current_size_)
+// {
+// continue;
+// }
+
+ // If we saw a suspend event, the next event has to be a resume event
+ if (is_event (this->timeprobes ()[resume_evt_ndx],
+ ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_RESUME))
+ {
+ // Store the elapsed time between the last
+ // start and the suspend event.
+ elapsed_time +=
+ this->timeprobes ()[stop_or_suspend_evt_ndx].time_ - start_time;
+
+ // Update the start time to be that of the
+ // resume event.
+ start_time = this->timeprobes ()[resume_evt_ndx].time_;
+
+ // This code doesn't make sense here. It always has to hit the stop to
+ // adjust the stop time. Anything else is a partial and invalid.
+// if (full_start_time == ACE_Time_Value::zero ||
+// this->timeprobes ()[resume_evt_ndx].time_ < full_start_time)
+// {
+// full_start_time.
+// set (this->timeprobes()[resume_evt_ndx].time_.sec (),
+// this->timeprobes()[resume_evt_ndx].time_.usec ());
+// }
+// if (full_stop_time == ACE_Time_Value::zero ||
+// this->timeprobes ()[resume_evt_ndx].time_ > full_stop_time)
+// {
+// full_stop_time.
+// set (this->timeprobes()[resume_evt_ndx].time_.sec (),
+// this->timeprobes()[resume_evt_ndx].time_.usec ());
+// }
+
+
+ // Keep looking for the end of the interval
+ // after the resume event.
+ stop_or_suspend_evt_ndx = resume_evt_ndx;
+ break;
+ }
+ else if (is_event (this->timeprobes ()[resume_evt_ndx],
+ ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_START) ||
+ is_event (this->timeprobes ()[resume_evt_ndx],
+ ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_STOP) ||
+ is_event (this->timeprobes ()[resume_evt_ndx],
+ ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_SUSPEND))
+ {
+ // Something went wrong during the current interval:
+ // just ignore the previous start time stamp.
+ good_interval = 0;
+ break;
+ }
+
+ resume_evt_ndx = (resume_evt_ndx + 1) % this ->max_size_; // Modulus increment: loops around at the end.
+
+ } while (resume_evt_ndx != this->current_size_);
+ }
+
+ // If we got a start event, make sure that we don't see another start or resume
+ // until we see a stop or suspend event
+ else if (is_event (this->timeprobes ()[stop_or_suspend_evt_ndx],
+ ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_START) ||
+ is_event (this->timeprobes ()[stop_or_suspend_evt_ndx],
+ ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::WORK_RESUME))
+ {
+ // Something went wrong during the current interval:
+ // just ignore the previous start time stamp.
+ break;
+ }
+
+ stop_or_suspend_evt_ndx = (stop_or_suspend_evt_ndx + 1) % this ->max_size_; // Modulus increment: loops around at the end.
+
+ } while (stop_or_suspend_evt_ndx != this->current_size_ && good_interval);
+
+ // If we found the stop of
+ start_evt_ndx = stop_or_suspend_evt_ndx;
+ }
+
+ start_evt_ndx = (start_evt_ndx + 1) % this ->max_size_; // Modulus increment: loops around at the end.
+
+ } while (start_evt_ndx < this->current_size_);
+
+
+ if (report_full_interval_times)
+ {
+ // Increase the length of the data set and record the full interval.
+ ++data_set_length;
+ data_set->length (data_set_length);
+ (*(data_set))[data_set_length-1].is_full_interval = 1;
+ (*(data_set))[data_set_length-1].probe_id = this->id_;
+ (*(data_set))[data_set_length-1].is_operation = this->is_operation_;
+ (*(data_set))[data_set_length-1].is_hrt = this->is_hrt_;
+ (*(data_set))[data_set_length-1].cross_thread_probe = any_cross_thread_event;
+ ORBSVCS_Time::Time_Value_to_TimeT
+ ((*(data_set)) [data_set_length-1].start_event_time,
+ this->timeprobes ()[start_evt_ndx].time_);
+ ORBSVCS_Time::Time_Value_to_TimeT
+ ((*(data_set)) [data_set_length-1].stop_event_time,
+ this->timeprobes ()[stop_evt_ndx].time_);
+ ORBSVCS_Time::Time_Value_to_TimeT(
+ (*(data_set))[data_set_length-1].interval,
+ full_stop_time - full_start_time);
+ }
+}
+
+
+// Flush the TAO metrics local timeprobe into shared memory.
+
+template <class ACE_LOCK, class ALLOCATOR>
+void
+TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR>::flush_TAO_Metrics_LocalTimeprobe ()
+{
+// TBD - 1) replace VXWORKS with a nicer ACE/TAO #define
+// 2) provide a general capability to apply an arbitrary
+// functor to the whole data structure framework (e.g., flush).
+
+#if defined VXWORKS
+ // TBD - implement this
+#endif
+}
+
+
+//////////////////////////////////
+// Class TAO_Metrics_LocalCache //
+//////////////////////////////////
+
+
+template <class ACE_LOCK, class ALLOCATOR>
+void
+TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::reset_statistics ()
+{
+ // Call the base class reset method first.
+ this->reset_base_statistics ();
+
+ // Iterate over consumer side base map,
+ // resetting probes.
+ METRICS_BASE_MONITOR_MAP_ITERATOR
+ base_iter (this->base_monitor_maps_ [this->consumer_index_]);
+
+ for (TAO_Metrics_Cache_Data_Base * data_base = 0;
+ base_iter.done () == 0;
+ ++base_iter)
+ {
+ // Modified by BRM. This should also work for ACE_Based_Pointer since the conversion
+ // operator should fire.
+// data_base = (*base_iter).int_id_.addr ();
+ data_base = (*base_iter).int_id_;
+ // Modified by BRM. This should also work for ACE_Based_Pointer since the conversion
+ // operator should fire.
+// if (data_base.addr ())
+ if (data_base)
+ {
+ data_base->probe.reset ();
+ }
+ }
+
+
+ // Iterate over consumer side monitor map,
+ // resetting counts and probes.
+ METRICS_MONITOR_MAP_ITERATOR data_iter (this->
+ monitor_maps_ [this->
+ consumer_index_]);
+ for (TAO_Metrics_Cache_Data * data = 0;
+ data_iter.done () == 0;
+ ++data_iter)
+ {
+ // Modified by BRM. This should also work for ACE_Based_Pointer since the conversion
+ // operator should fire.
+// data = (*data_iter).int_id_.addr ();
+ data = (*data_iter).int_id_;
+ if (data)
+ {
+ data->probe.reset ();
+ data->missed_deadlines = 0;
+ data->made_deadlines = 0;
+ data->cancellations = 0;
+ }
+ }
+}
+
+
+// Flush the TAO local metrics cache into shared memory.
+
+template <class ACE_LOCK, class ALLOCATOR>
+void
+TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>::
+flush_TAO_Metrics_LocalCache ()
+{
+#if defined VXWORKS
+
+ // TBD - fix this: is it complete?
+
+ // TBD - add base metrics map flush
+
+ // TBD - do probes need their own flush method?
+
+ // flush the class
+ // cacheFlush (
+ // DATA_CACHE,
+ // this,
+ // sizeof (TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>));
+
+ // flush the monitor data map hash table
+ // cacheFlush (DATA_CACHE,
+ // &monitor_maps_ [this->consumer_index_],
+ // sizeof (METRICS_MONITOR_MAP));
+
+ // flush the nodes in the monitor data map hash table
+ // and the data stored in the nodes.
+ // METRICS_MONITOR_MAP_ITERATOR data_iter (this->
+ // monitor_maps_ [this->
+ // consumer_index_]);
+ // for (;
+ // data_iter.done () == 0;
+ // ++data_iter)
+ // {
+ // METRICS_MONITOR_MAP_ENTRY *entry;
+ // data_iter.next (entry);
+ // if (entry)
+ // {
+ // cacheFlush (DATA_CACHE,
+ // entry,
+ // sizeof (METRICS_MONITOR_MAP_ENTRY));
+ // if (entry->int_id_.addr ())
+ // {
+ // cacheFlush (DATA_CACHE,
+ // entry->int_id_.addr (),
+ // sizeof (TAO_Metrics_Cache_Data));
+ // }
+ // }
+ // }
+
+ // flush the base class probe counts
+ // cacheFlush (DATA_CACHE,
+ // this->
+ // enqueue_count_ [this->consumer_index_].addr (),
+ // this->probe_set_size_ * sizeof (u_long));
+
+ // cacheFlush (DATA_CACHE,
+ // this->
+ // dequeue_count_ [this->consumer_index_].addr (),
+ // this->probe_set_size_ * sizeof (u_long));
+
+ // flush the base class probe pointer arrays
+ // cacheFlush (
+ // DATA_CACHE,
+ // this->enqueue_probes_ [this->consumer_index_],
+ // this->
+ // probe_set_size_
+ // * sizeof (ACE_Metrics_Timeprobe<ACE_LOCK,ALLOCATOR> *));
+ // cacheFlush (
+ // DATA_CACHE,
+ // this->dequeue_probes_ [this->consumer_index_],
+ // this->probe_set_size_
+ // * sizeof (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> *));
+
+ // flush the base class probes
+ // for (u_int i = 0; i < this->probe_set_size_; ++i)
+ // {
+ // cacheFlush (
+ // DATA_CACHE,
+ // this->enqueue_probes_ [this->consumer_index_][i],
+ // sizeof (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>));
+ // cacheFlush (
+ // DATA_CACHE,
+ // this->dequeue_probes_ [this->consumer_index_][i],
+ // sizeof (ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>));
+ // }
+#endif
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* METRICS_LOCAL_CACHE_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.h b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.h
new file mode 100644
index 00000000000..97d51de3248
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_LocalCache_T.h
@@ -0,0 +1,329 @@
+// -*- C++ -*-
+
+// $Id$
+
+#ifndef METRICS_LOCAL_CACHE_T_H
+#define METRICS_LOCAL_CACHE_T_H
+
+#include "ace/OS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Hash_Map_Manager.h"
+#include "ace/Metrics_Cache.h"
+#include "ace/Metrics_Cache_T.h"
+
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Scheduler_Factory.h"
+#include "orbsvcs/MetricsC.h"
+#include "orbsvcs/Metrics/Metrics_Utils.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_HAS_METRICS_BASE_POINTERS)
+ typedef ACE_Based_Pointer<char> ACE_METRICS_STRING_TYPE;
+ typedef ACE_Based_Pointer<Metrics::TimeprobeParameter_Set> ACE_METRICS_PARAMETER_SET_TYPE;
+#else
+ typedef char * ACE_METRICS_STRING_TYPE;
+ typedef Metrics::TimeprobeParameter_Set * ACE_METRICS_PARAMETER_SET_TYPE;
+#endif
+
+//DCL:Commented out to remove Linux compile error
+//#include "orbsvcs/Metrics/Metrics_LocalCache.h"
+
+template <typename ACE_LOCK, typename ALLOCATOR>
+class TAO_Metrics_LocalTimeprobe
+ : public ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>
+{
+ // = TITLE
+ // Defines a class that implements a local timeprobe.
+ //
+ // = DESCRIPTION
+ // This class makes use of the <ACE_Metrics_Timeprobe> class to
+ // implement a timeprobe for use in a local metrics cache.
+public:
+
+ typedef TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR> TAO_METRICS_TIMEPROBE_TYPE;
+
+ TAO_Metrics_LocalTimeprobe (u_int id = 0,
+ const char *name = 0,
+ u_long size
+ = METRICS_DEFAULT_TIMEPROBE_TABLE_SIZE,
+ ALLOCATOR * alloc = (ALLOCATOR*)ALLOCATOR::instance());
+ // Default constructor.
+
+ void report_intervals (int report_full_interval_times = 0);
+ // Reports valid intervals between start and stop events.
+
+ void install_data_set (Metrics::TimeprobeParameter_Set *data_set = 0);
+ // Installs or unistalls the data set into which probe will report.
+
+ void mark_as_operation (void) {this->is_operation_ = 1;}
+ // Marks the probe as being for an operation.
+
+ void set_hrt (int hrt) {this->is_hrt_ = hrt;}
+ // Marks the probe as being SRT/HRT.
+
+ ACE_Time_Value last_recorded_timestamp (void);
+ // Returns the last timestamp that was recorded in the probe.
+ // If no stamps are recorded, returns zero.
+
+ void flush_TAO_Metrics_LocalTimeprobe ();
+ // Flush the TAO metrics local timeprobe into shared memory.
+
+protected:
+
+ int is_operation_;
+ // Indicates whether or not the probe is for an operation.
+
+ int is_hrt_;
+ // Indicates whether or not the probe is Hard Real-Time.
+
+ ACE_METRICS_PARAMETER_SET_TYPE data_set_;
+ // Points to a probe metrics data set.
+};
+
+template <class ACE_LOCK, class ALLOCATOR>
+class TAO_Metrics_LocalCache
+ : public ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>
+{
+ // = TITLE
+ // Defines a class that implements a local metrics cache.
+ //
+ // = DESCRIPTION
+ // This class makes use of the <ACE_Metrics_Cache> class to
+ // implement a cache for local use.
+public:
+
+ typedef ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>
+ ACE_METRICS_TIMEPROBE_TYPE;
+
+#if defined (ACE_HAS_METRICS_BASE_POINTERS)
+ typedef ACE_Based_Pointer<ACE_METRICS_TIMEPROBE_TYPE>
+ ACE_METRICS_TIMEPROBE_BASED_PTR_TYPE;
+#else
+ typedef ACE_METRICS_TIMEPROBE_TYPE * ACE_METRICS_TIMEPROBE_BASED_PTR_TYPE;
+#endif
+
+ typedef TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR> TAO_METRICS_TIMEPROBE_TYPE;
+
+ typedef TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR> TAO_METRICS_CACHE_TYPE;
+
+ struct TAO_Metrics_Cache_Data_Base
+ {
+ ACE_METRICS_STRING_TYPE probe_name;
+ TAO_Metrics_LocalTimeprobe<ACE_LOCK, ALLOCATOR> probe;
+ };
+
+ struct TAO_Metrics_Cache_Data : public TAO_Metrics_Cache_Data_Base
+ {
+ int is_hrt;
+ u_long missed_deadlines;
+ u_long made_deadlines;
+ u_long cancellations;
+ };
+
+#if defined (ACE_HAS_METRICS_BASE_POINTERS)
+ typedef ACE_Based_Pointer<TAO_Metrics_Cache_Data_Base> ACE_METRICS_CACHE_DATA_BASE_TYPE;
+ typedef ACE_Based_Pointer<TAO_Metrics_Cache_Data> ACE_METRICS_CACHE_DATA_TYPE;
+#else
+ typedef TAO_Metrics_Cache_Data_Base* ACE_METRICS_CACHE_DATA_BASE_TYPE;
+ typedef TAO_Metrics_Cache_Data* ACE_METRICS_CACHE_DATA_TYPE;
+#endif
+
+ typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::handle_t,
+ ACE_METRICS_CACHE_DATA_BASE_TYPE,
+ ACE_Hash<RtecScheduler::handle_t>,
+ ACE_Equal_To<RtecScheduler::handle_t>,
+ ACE_Null_Mutex> METRICS_BASE_MONITOR_MAP;
+ // Type of map used for O(1) lookup of monitored data for operations.
+
+ typedef ACE_Hash_Map_Entry<RtecScheduler::handle_t,
+ ACE_METRICS_CACHE_DATA_BASE_TYPE >
+ METRICS_BASE_MONITOR_MAP_ENTRY;
+ // Type of entry in monitor map.
+
+ typedef ACE_Hash_Map_Iterator_Ex<RtecScheduler::handle_t,
+ ACE_METRICS_CACHE_DATA_BASE_TYPE,
+ ACE_Hash<RtecScheduler::handle_t>,
+ ACE_Equal_To<RtecScheduler::handle_t>,
+ ACE_Null_Mutex>
+ METRICS_BASE_MONITOR_MAP_ITERATOR;
+ // Type of iterator for monitor map.
+
+ typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::handle_t,
+ ACE_METRICS_CACHE_DATA_TYPE,
+ ACE_Hash<RtecScheduler::handle_t>,
+ ACE_Equal_To<RtecScheduler::handle_t>,
+ ACE_Null_Mutex> METRICS_MONITOR_MAP;
+ // Type of map used for O(1) lookup of monitored data for operations.
+
+ typedef ACE_Hash_Map_Entry<RtecScheduler::handle_t,
+ ACE_METRICS_CACHE_DATA_TYPE >
+ METRICS_MONITOR_MAP_ENTRY;
+ // Type of entry in monitor map.
+
+ typedef ACE_Hash_Map_Iterator_Ex<RtecScheduler::handle_t,
+ ACE_METRICS_CACHE_DATA_TYPE,
+ ACE_Hash<RtecScheduler::handle_t>,
+ ACE_Equal_To<RtecScheduler::handle_t>,
+ ACE_Null_Mutex>
+ METRICS_MONITOR_MAP_ITERATOR;
+ // Type of iterator for monitor map.
+
+ TAO_Metrics_LocalCache (u_long table_size
+ = METRICS_DEFAULT_TIMEPROBE_TABLE_SIZE,
+ u_long number_of_probes
+ = METRICS_DEFAULT_TIMEPROBE_COUNT,
+ ALLOCATOR * alloc = (ALLOCATOR*)ALLOCATOR::instance());
+ // Constructor.
+
+ ~TAO_Metrics_LocalCache () {this->fini ();}
+ // Destructor.
+
+ void reset_statistics ();
+ // Reset the collection of metrics data.
+
+ int init (u_long number_of_probes);
+ // Factory method for constructing probes.
+
+ void fini ();
+ // Method for destroying probes.
+
+ void register_upcall_adapter (RtecScheduler::handle_t handle,
+ const char *name,
+ int is_hrt,
+ unsigned short incr_upcall_id = 1);
+ // Registers an upcall adapter, allocates monitoring data structures
+ // for it in hash maps if not already present.
+
+ RtecScheduler::handle_t register_base_metrics (const char *name,
+ TAO_Metrics_Utils::Base_Metrics_Type bmt,
+ unsigned short incr_base_id = 1);
+ // Registers a base metrics probe, allocates monitoring data structures
+ // for it in hash maps, returns a handle to the metrics segment.
+
+ void report_upcall_start (RtecScheduler::handle_t handle);
+ // Inline: Records start time of an upcall.
+
+ int report_upcall_stop (RtecScheduler::handle_t handle,
+ const ACE_Time_Value & deadline);
+ // Inline: Records end time of an upcall, returns 0 if the deadline
+ // was made, 1 if the deadline was missed, or -1 if an error occurred.
+ // If the passed deadline is equal to ACE_Time_Value::zero, by definition
+ // the deadline is made, and the method returns 0.
+
+ void report_upcall_cancellation (RtecScheduler::handle_t handle);
+ // Inline: Reports a cancelled upcall.
+
+ void report_base_metrics_start (RtecScheduler::handle_t handle);
+ // Inline: Records start time of a base metrics segment.
+
+ void report_base_metrics_stop (RtecScheduler::handle_t handle);
+ // Inline: Records stop time of a base metrics segment.
+
+ void report_base_metrics_suspend (RtecScheduler::handle_t handle);
+ // Inline: Records start time of a base metrics segment.
+
+ void report_base_metrics_resume (RtecScheduler::handle_t handle);
+ // Inline: Records stop time of a base metrics segment.
+
+ void flush_TAO_Metrics_LocalCache ();
+ // Flush the TAO metrics local cache into shared memory.
+
+protected:
+ void increment_base_handle(TAO_Metrics_Utils::Base_Metrics_Type bmt);
+ // Used to increment the probe id counter for a particular metrics type
+
+ void increment_upcall_handle();
+ // Used to increment the probe id counter for a upcall probe type
+
+ METRICS_BASE_MONITOR_MAP base_monitor_maps_ [2];
+ // These map base metrics ids to base monitor data.
+
+ METRICS_MONITOR_MAP monitor_maps_ [2];
+ // These map operation handles to upcall monitor data.
+
+ // Count of the number of registered sched probes.
+ u_long sched_count_;
+
+ // Count of the number of registered quo probes.
+ u_long quo_count_;
+
+ // Count of the number of registered tns probes.
+ u_long tns_count_;
+
+ // Count of the number of registered teec probes.
+ u_long teec_count_;
+
+ // Count of the number of registered rtarm probes.
+ u_long rtarm_count_;
+
+ // Count of the number of registered upcall adapters.
+ u_long upcall_adapter_count_;
+
+ // Holds the next base metrics probe handle to assign
+ RtecScheduler::handle_t next_base_metrics_handle_;
+
+};
+
+
+
+template <class ACE_LOCK, class ALLOCATOR>
+class TAO_Metrics_ReportingLocalCache
+ : public TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR>
+{
+ // = TITLE
+ // Defines a class that adds metrics logger reporting to a local cache.
+ //
+ // = DESCRIPTION
+ // This class makes use of the <TAO_Metrics_LocalCache> as its
+ // a cache for local use, and adds reporting to the logger.
+public:
+
+ TAO_Metrics_ReportingLocalCache (u_long table_size
+ = METRICS_DEFAULT_TIMEPROBE_TABLE_SIZE,
+ u_long number_of_probes
+ = METRICS_DEFAULT_TIMEPROBE_COUNT,
+ ALLOCATOR * alloc = (ALLOCATOR*)ALLOCATOR::instance());
+ // Constructor.
+
+ ~TAO_Metrics_ReportingLocalCache () {this->fini ();}
+ // Destructor.
+
+ void output_statistics (Metrics::QoSLogger_ptr logger);
+ // Output the statistics to the remote logger servant.
+
+ void register_upcall_adapter (RtecScheduler::handle_t handle,
+ const char *name,
+ int is_hrt,
+ Metrics::QoSLogger_ptr logger);
+ // Registers an upcall adapter, allocates monitoring data structures
+ // for it in hash maps if not already present.
+
+ RtecScheduler::handle_t register_base_metrics (const char *name,
+ TAO_Metrics_Utils::Base_Metrics_Type bmt,
+ Metrics::QoSLogger_ptr logger);
+ // Registers a base metrics probe, allocates monitoring data structures
+ // for it in hash maps, returns a handle to the metrics segment.
+
+ int register_probes (Metrics::QoSLogger_ptr logger);
+ // Registers probes with the logger.
+
+ void flush_TAO_Metrics_ReportingLocalCache ();
+ // Flush the TAO metrics local cache into shared memory.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Metrics/Metrics_LocalCache_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Metrics_LocalCache_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* METRICS_LOCAL_CACHE_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_Logger.cpp b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_Logger.cpp
new file mode 100644
index 00000000000..71f0e444678
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_Logger.cpp
@@ -0,0 +1,871 @@
+// $Id$
+
+#include "orbsvcs/Metrics/Metrics_Logger.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/ace_wchar.h"
+
+ACE_RCSID(Metrics_Logger, Metrics_Logger, "$Id$")
+
+#if defined (ACE_METRICS_COLLECTION)
+
+#if defined (ACE_ENABLE_TIMEPROBES) && defined (ACE_COMPILE_TIMEPROBES)
+
+static const int OPEN_CLOSE_BANNER_CYCLE = 4;
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//////////////////////////////
+// class TAO_Metrics_Logger //
+//////////////////////////////
+
+// Default constructor.
+
+TAO_Metrics_Logger::TAO_Metrics_Logger (int generate_events,
+ int generate_log,
+ int generate_export_file,
+ const char *log_filename)
+ : generate_events_ (generate_events),
+#ifdef VXWORKS
+ generate_log_ (1),
+ log_filename_ ("logger.txt"),
+#else
+ generate_log_ (generate_log),
+ log_filename_ (log_filename),
+#endif
+ generate_totals_(0),
+ generate_export_file_(generate_export_file),
+ log_started_ (0),
+ log_file_ (stdout),
+ export_file_(stdout),
+ saveFileCnt_(0)
+{
+#ifdef VXWORKS
+ taskPrioritySet( taskIdSelf(), 145 );
+#endif
+
+#if defined (METRICS_LOGGER_SENDS_EVENTS)
+ if (this->generate_events_)
+ {
+ // Connect the underlying DOVE event supplier.
+ if (this->dove_supplier_.connect () < 0)
+ {
+#if defined (METRICS_LOGGER_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR, "failed to connect DOVE event supplier\n"));
+#endif
+ this->generate_events_ = 0;
+ }
+ }
+#endif /* METRICS_LOGGER_SENDS_EVENTS */
+
+ if (generate_log_)
+ {
+ if (log_filename_)
+ {
+ log_file_ = ACE_OS::fopen (log_filename_, "w+");
+ if (log_file_ == NULL)
+ {
+ generate_log_ = 0;
+#if defined (METRICS_LOGGER_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR,
+ "Logger failed to open log file %s\n",
+ log_filename_));
+#endif
+ return;
+ }
+
+ if (generate_export_file_)
+ {
+ export_file_ = ACE_OS::fopen ("remote_logger_export.excel", "w+");
+ if (export_file_ == NULL)
+ {
+#if defined (METRICS_LOGGER_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR, "Logger failed to open log file %s\n", log_filename_));
+#endif
+ return;
+ }
+ }
+ log_started_ = 1;
+ }
+
+ // Write a start of logging session message.
+ time_t current_time = ACE_OS::time ();
+ ACE_OS::fprintf (log_file_,
+ "\n\nTAO_Metrics Metrics Logging Session: %s\n\n",
+ ACE_OS::ctime (& current_time));
+
+ ACE_OS::fprintf (export_file_,
+ "\n\nTAO_Metrics Metrics Logging Session: %s\n\n",
+ ACE_OS::ctime (& current_time));
+ if (log_filename_)
+ {
+ ACE_OS::fflush (log_file_);
+ ACE_OS::fflush (export_file_);
+// ACE_OS::fclose (log_file_);
+ }
+ }
+}
+
+
+// Destructor.
+
+TAO_Metrics_Logger::~TAO_Metrics_Logger ()
+{
+ if (generate_log_)
+ {
+ if (log_filename_)
+ {
+// log_file_ = ACE_OS::fopen (log_filename_, "a+");
+ }
+
+ ACE_OS::fprintf (log_file_, "\n\n");
+
+ ACE_OS::fflush (log_file_);
+
+ ACE_OS::fprintf (export_file_, "\n\n");
+ ACE_OS::fflush (export_file_);
+
+ if (log_filename_)
+ {
+// ACE_OS::fclose (log_file_);
+ }
+ }
+
+#if defined (METRICS_LOGGER_SENDS_EVENTS)
+ if (this->generate_events_)
+ {
+ this->dove_supplier_.disconnect ();
+ }
+#endif /* METRICS_LOGGER_SENDS_EVENTS */
+}
+
+
+// Active object loop for processing logged data.
+
+int
+TAO_Metrics_Logger::svc (void)
+{
+ ACE_Message_Block *mb;
+
+ // Loop forever.
+ while (1)
+ if (this->getq (mb) < 0)
+ {
+#if defined (METRICS_LOGGER_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) getq failed in TAO_Metrics_Logger::svc"));
+#endif
+ return -1;
+ }
+ else if (! mb)
+ {
+#if defined (METRICS_LOGGER_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) null message block pointer in TAO_Metrics_Logger::svc"));
+#endif
+ return -1;
+ }
+ else if (! mb->rd_ptr ())
+ {
+#if defined (METRICS_LOGGER_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) null message block pointer in TAO_Metrics_Logger::svc"));
+#endif
+ return -1;
+ }
+ else
+ {
+ // Process message.
+
+ TAO_Metrics_Logger_Data *data = (TAO_Metrics_Logger_Data *) mb->rd_ptr ();
+ switch (data->data_type_)
+ {
+ case TAO_Metrics_Logger_Data::QOS_TYPE:
+ this->process_aggregate_QoS (*data->qos_params_, data->interval_);
+ delete data;
+ delete mb;
+ break;
+
+ case TAO_Metrics_Logger_Data::TIMEPROBE_TYPE:
+ this->process_timeprobe_data (*data->timeprobe_params_, data->interval_);
+ delete data;
+ delete mb;
+ break;
+
+ case TAO_Metrics_Logger_Data::BANNER_TYPE:
+ this->process_banner (data->banner_);
+ delete data;
+ delete mb;
+ break;
+
+ default:
+#if defined (METRICS_LOGGER_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) unrecognized data type in TAO_Metrics_Logger::svc"));
+#endif
+ return -1;
+ }
+ }
+
+// Modified by BAP. Remove unreachable code.
+// return 0;
+}
+
+
+// Sends a banner to be written to the log file and to the visualization browser.
+
+void
+TAO_Metrics_Logger::send_banner (const char *banner
+ ACE_ENV_ARG_DECL)
+ throw (CORBA::SystemException)
+{
+ // Package up the data and put it on the task queue.
+
+ TAO_Metrics_Logger_Data *data;
+ ACE_NEW (data,
+ TAO_Metrics_Logger_Data (TAO_Metrics_Logger_Data::BANNER_TYPE));
+ ACE_NEW (data->banner_, char [ACE_OS::strlen (banner) + 1]);
+ ACE_OS::strcpy (data->banner_, banner);
+
+ ACE_Message_Block *mb;
+ ACE_NEW (mb,
+ ACE_Message_Block ((char *) data,
+ sizeof (TAO_Metrics_Logger_Data)));
+
+ if (this->putq (mb) < 0)
+ {
+#if defined (METRICS_LOGGER_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR,
+ "TAO_Metrics_Logger::send_banner putq failed"));
+#endif
+ }
+}
+
+void
+TAO_Metrics_Logger::process_banner (const char *banner)
+{
+ if (this->generate_log_)
+ {
+ if (log_filename_)
+ {
+// log_file_ = ACE_OS::fopen (log_filename_, "a+");
+ }
+
+ ACE_OS::fprintf (log_file_,
+ "%s\n", banner);
+ ACE_OS::fprintf (export_file_,
+ "%s\n", banner);
+ if (log_filename_)
+ {
+ ACE_OS::fflush (log_file_);
+ ACE_OS::fflush (export_file_);
+
+ // Close and then reopen the file. We can't afford to open & close all of the time.
+ if (( saveFileCnt_++ % OPEN_CLOSE_BANNER_CYCLE) == 0 )
+ {
+ ACE_OS::fclose (log_file_);
+ log_file_ = ACE_OS::fopen (log_filename_, "a+");
+
+ ACE_OS::fclose (export_file_);
+ export_file_ = ACE_OS::fopen ("remote_logger_export.excel", "a+");
+ }
+ }
+ }
+}
+
+
+// Reports the aggregate QoS information for all operations
+// to the passed QoS logger.
+
+void
+TAO_Metrics_Logger::log_aggregate_QoS (const Metrics::QoSParameter_Set & qos_params,
+ Metrics::Time interval
+ ACE_ENV_ARG_DECL)
+ throw (CORBA::SystemException)
+{
+// This is a temporary patch to eliminate this data from the log. It was
+// done to bypass a long rebuild that would have been required otherwise.
+// Remove this patch later. Brian Mendel
+
+ //Added to remove Linux warning (Boeing Extension)
+ ACE_UNUSED_ARG(qos_params);
+ ACE_UNUSED_ARG(interval);
+
+ // Package up the data and put it on the task queue.
+#if 0
+ TAO_Metrics_Logger_Data *data;
+ ACE_NEW (data,
+ TAO_Metrics_Logger_Data (TAO_Metrics_Logger_Data::QOS_TYPE,
+ interval));
+ ACE_NEW (data->qos_params_,
+ Metrics::QoSParameter_Set (qos_params));
+
+ ACE_Message_Block *mb;
+ ACE_NEW (mb,
+ ACE_Message_Block ((char *) data,
+ sizeof (TAO_Metrics_Logger_Data)));
+
+ if (this->putq (mb) < 0)
+ {
+#if defined (METRICS_LOGGER_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR,
+ "TAO_Metrics_Logger::log_aggregate_QoS putq failed"));
+#endif
+ }
+#endif
+}
+
+
+// Processes the aggregate QoS information for all operations
+// to the passed QoS logger.
+
+void
+TAO_Metrics_Logger::process_aggregate_QoS (const Metrics::QoSParameter_Set & qos_params,
+ Metrics::Time interval)
+{
+ //Added to remove Linux warning (Boeing Extension)
+ ACE_UNUSED_ARG(interval);
+
+ if (this->generate_log_)
+ {
+ if (log_filename_)
+ {
+// log_file_ = ACE_OS::fopen (log_filename_, "a+");
+ }
+
+ ACE_OS::fprintf (log_file_,
+ "\nName missed made cancelled\n");
+
+ ACE_OS::fprintf (export_file_,
+ "\n\n Name \t missed \t made \t cancelled\n");
+ }
+
+#if defined (METRICS_LOGGER_SENDS_EVENTS)
+ if (this->generate_events_)
+ {
+ this->qos_data_.hrt_deadlines_missed = 0;
+ this->qos_data_.hrt_deadlines_made = 0;
+ this->qos_data_.hrt_operations_cancelled = 0;
+ this->qos_data_.srt_deadlines_missed = 0;
+ this->qos_data_.srt_deadlines_made = 0;
+ this->qos_data_.srt_operations_cancelled = 0;
+ }
+#endif /* METRICS_LOGGER_SENDS_EVENTS */
+
+ for (u_long i = 0; i < qos_params.length (); ++i)
+ {
+#if defined (METRICS_LOGGER_SENDS_EVENTS)
+ if (this->generate_events_)
+ {
+ if (qos_params [i].is_hrt)
+ {
+ this->qos_data_.hrt_deadlines_missed +=
+ qos_params [i].deadlines_missed;
+ this->qos_data_.hrt_deadlines_made +=
+ qos_params [i].deadlines_made;
+ this->qos_data_.hrt_operations_cancelled +=
+ qos_params [i].operations_cancelled;
+ }
+ else
+ {
+ this->qos_data_.srt_deadlines_missed +=
+ qos_params [i].deadlines_missed;
+ this->qos_data_.srt_deadlines_made +=
+ qos_params [i].deadlines_made;
+ this->qos_data_.srt_operations_cancelled +=
+ qos_params [i].operations_cancelled;
+ }
+ }
+#endif /* METRICS_LOGGER_SENDS_EVENTS */
+
+ if (this->generate_log_)
+ {
+ ACE_OS::fprintf (log_file_,
+ "%-50s %8lu %8lu %8lu\n",
+ (const char *)qos_params [i].entry_point,
+ qos_params [i].deadlines_missed,
+ qos_params [i].deadlines_made,
+ qos_params [i].operations_cancelled);
+ ACE_OS::fprintf (export_file_,
+ " %s \t %lu \t %lu \t %lu\n",
+ (const char *)qos_params [i].entry_point,
+ qos_params [i].deadlines_missed,
+ qos_params [i].deadlines_made,
+ qos_params [i].operations_cancelled);
+ }
+ }
+
+#if defined (METRICS_LOGGER_SENDS_EVENTS)
+ if (this->generate_events_)
+ {
+ // Push an event to the visualization browser.
+ CORBA::Any any;
+
+ ACE_TRY_NEW_ENV
+ {
+ any.replace (Metrics::_tc_QoSData, &qos_data_, 0, ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+#if defined (METRICS_LOGGER_ERROR_OUTPUT_ENABLED)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Metrics_Logger::process_aggregate_QoS");
+#endif
+ return;
+ }
+ ACE_ENDTRY;
+
+ this->dove_supplier_.notify (any);
+ }
+#endif /* METRICS_LOGGER_SENDS_EVENTS */
+
+ if (this->generate_log_)
+ {
+ if (log_filename_)
+ {
+ ACE_OS::fflush (log_file_);
+// ACE_OS::fclose (log_file_);
+ }
+ }
+}
+
+
+// Binds the names of various timeprobes to their identifiers so
+// that ids alone can be used (for efficiency) in passing data.
+
+void
+TAO_Metrics_Logger::set_identities (const Metrics::ProbeIdentity_Set &
+ probe_identities
+ ACE_ENV_ARG_DECL)
+ throw (CORBA::SystemException)
+{
+ for (u_long i = 0; i < probe_identities.length (); ++i)
+ {
+ this->set_identity (probe_identities [i]
+ ACE_ENV_ARG_DECL);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_Metrics_Logger::set_identity (const Metrics::ProbeIdentity_t & probe_identity
+ ACE_ENV_ARG_DECL)
+ throw (CORBA::SystemException)
+{
+ // Look up the existing name that is bound, creating one if there is
+ // not one there already.
+ CORBA::String_var *name = 0;
+ if (probe_name_map_.find (probe_identity.probe_id, name) != 0
+ || name == 0)
+ {
+ ACE_NEW_THROW_EX (name,
+ CORBA::String_var (probe_identity.probe_name),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ // What is this used for? BRM
+ auto_ptr<CORBA::String_var> name_ptr (name);
+
+ if (probe_name_map_.rebind (probe_identity.probe_id, name) < 0)
+ {
+#if defined (METRICS_LOGGER_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR, "TAO_Metrics_Logger::set_identity bind failed.\n"));
+#endif
+ return;
+ }
+
+ // DEBUG
+ const char * name_cstr = name->in ();
+ ACE_DEBUG ((LM_DEBUG,
+ "Logger registered name [%s] with id [%u]\n",
+ name_cstr, probe_identity.probe_id));
+
+ name_ptr.release ();
+ }
+ else
+ {
+ // DEBUG
+ const char * old_name_cstr = name->in ();
+
+ // Unconditionally set the name to the new name.
+ *name = probe_identity.probe_name;
+
+ // DEBUG
+ const char * new_name_cstr = name->in ();
+ ACE_DEBUG ((LM_DEBUG,
+ "Logger CHANGED name from [%s] to [%s] for id [%u]\n",
+ old_name_cstr, new_name_cstr, probe_identity.probe_id));
+ }
+}
+
+
+// Reports timeprobe data collected since last run.
+
+void
+TAO_Metrics_Logger::log_timeprobe_data (const Metrics::TimeprobeParameter_Set &
+ timeprobe_params,
+ Metrics::Time interval
+ ACE_ENV_ARG_DECL)
+ throw (CORBA::SystemException)
+{
+ // Package up the data and put it on the task queue.
+
+ TAO_Metrics_Logger_Data *data;
+ ACE_NEW (data,
+ TAO_Metrics_Logger_Data (TAO_Metrics_Logger_Data::TIMEPROBE_TYPE,
+ interval));
+ ACE_NEW (data->timeprobe_params_,
+ Metrics::TimeprobeParameter_Set (timeprobe_params));
+
+ ACE_Message_Block *mb;
+ ACE_NEW (mb,
+ ACE_Message_Block ((char *) data,
+ sizeof (TAO_Metrics_Logger_Data)));
+
+ if (this->putq (mb) < 0)
+ {
+#if defined (METRICS_LOGGER_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR,
+ "TAO_Metrics_Logger::log_timeprobe_data putq failed"));
+#endif
+ }
+}
+
+
+// Processes timeprobe data collected since last run.
+void
+TAO_Metrics_Logger::process_timeprobe_data (const Metrics::TimeprobeParameter_Set & timeprobe_params,
+ Metrics::Time interval)
+{
+ if (this->generate_log_)
+ {
+ if (log_filename_)
+ {
+ // log_file_ = ACE_OS::fopen (log_filename_, "a+");
+ }
+
+ ACE_OS::fprintf (log_file_,
+ "\n\n\n"
+ "Interval (usec): %9lu \n\n"
+ "Probe elapsed_time(usec) Start Time (usecs) Stop Time (usec)\n\n",
+ // Modified by BAP. This really should be corrected since we are truncating the interval here.
+ // We can get away with it here for now since the intervals are small enough to not roll over.
+ (u_long) ACE_U64_TO_U32(interval)/10 );
+
+ ACE_OS::fprintf (export_file_,
+ "\n\n\n"
+ "Interval (usec): \t %9lu \t \n\n"
+ "Probe \t elapsed_time(usec) \tStart Time (usecs) \t Stop Time (usec)\n\n",
+ // Modified by BAP. This really should be corrected since we are truncating the interval here.
+ // We can get away with it here for now since the intervals are small enough to not roll over.
+ (u_long) ACE_U64_TO_U32(interval)/10 );
+ }
+
+#if defined (METRICS_LOGGER_SENDS_EVENTS)
+ Metrics::Time queue_time = 0;
+ Metrics::Time hrt_op_time = 0;
+ Metrics::Time srt_op_time = 0;
+#endif /* METRICS_LOGGER_SENDS_EVENTS */
+
+ for (u_long i = 0; i < timeprobe_params.length (); ++i)
+ {
+#if defined (METRICS_LOGGER_SENDS_EVENTS)
+ if (! timeprobe_params [i].is_full_interval)
+ {
+ if (timeprobe_params [i].is_operation)
+ {
+ if (timeprobe_params [i].is_hrt)
+ {
+ hrt_op_time += timeprobe_params [i].interval;
+ }
+ else
+ {
+ srt_op_time += timeprobe_params [i].interval;
+ }
+ }
+ else
+ {
+ queue_time += timeprobe_params [i].interval;
+ }
+ }
+#endif /* METRICS_LOGGER_SENDS_EVENTS */
+
+ if (this->generate_log_)
+ {
+ // Look up the name of the probe in the hash map.
+ // If successful, use the name, and if not just use the probe id.
+ CORBA::String_var *probe_name = 0;
+ char format_spec[255];
+ char export_spec[255];
+
+ if (probe_name_map_.find (timeprobe_params [i].probe_id, probe_name) == 0
+ && probe_name != 0)
+ {
+ if (timeprobe_params [i].cross_thread_probe &&
+ timeprobe_params [i].is_full_interval)
+ {
+ if (generate_totals_)
+ {
+#if defined (ACE_LACKS_LONGLONG_T)
+ // This needs to be fixed for platforms that do not have 64 bit support. This will result
+ // in overruns as currently written
+ ACE_OS::fprintf (log_file_,
+ " %-40s (total) %20lu %20lu %20lu *** Cross Thread Event ***\n",
+ (const char *) *probe_name,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].interval)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].start_event_time)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].stop_event_time)/10);
+ ACE_OS::fprintf (export_file_,
+ " %s (total) \t %lu \t %lu \t %lu \t ***Cross Thread Event***\n",
+ (const char *) *probe_name,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].interval)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].start_event_time)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].stop_event_time)/10);
+#else
+ // Build up the format specifiers since the specifier or not portable
+ ACE_OS::strcpy(format_spec, " %-40s (total) ");
+ ACE_OS::strcat(format_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(format_spec, " ");
+ ACE_OS::strcat(format_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(format_spec, " ");
+ ACE_OS::strcat(format_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(format_spec, " *** Cross Thread Event ***\n");
+
+ ACE_OS::strcpy(export_spec, " %-40s (total) \t ");
+ ACE_OS::strcat(export_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(export_spec, " \t ");
+ ACE_OS::strcat(export_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(export_spec, " \t ");
+ ACE_OS::strcat(export_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(export_spec, " \t*** Cross Thread Event ***\n");
+
+ ACE_OS::fprintf (log_file_,
+ format_spec,
+ (const char *) *probe_name,
+ timeprobe_params [i].interval / 10,
+ timeprobe_params [i].start_event_time / 10,
+ timeprobe_params [i].stop_event_time / 10);
+ ACE_OS::fprintf (export_file_,
+ export_spec,
+ (const char *) *probe_name,
+ timeprobe_params [i].interval / 10,
+ timeprobe_params [i].start_event_time / 10,
+ timeprobe_params [i].stop_event_time / 10);
+#endif
+ }
+ }
+ else
+ {
+#if defined (ACE_LACKS_LONGLONG_T)
+ // This needs to be fixed for platforms that do not have 64 bit support. This will result
+ // in overruns as currently written
+ ACE_OS::fprintf (log_file_,
+ " %-40s %20lu %20lu %20lu *** Cross Thread Event ***\n",
+ (const char *) *probe_name,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].interval)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].start_event_time)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].stop_event_time)/10);
+ ACE_OS::fprintf (export_file_,
+ " %s \t %lu \t %lu \t %lu \t ***Cross Thread Event***\n",
+ (const char *) *probe_name,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].interval)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].start_event_time)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].stop_event_time)/10);
+#else
+ // Build up the format specifiers since the specifier or not portable
+ ACE_OS::strcpy(format_spec, " %-40s ");
+ ACE_OS::strcat(format_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(format_spec, " ");
+ ACE_OS::strcat(format_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(format_spec, " ");
+ ACE_OS::strcat(format_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(format_spec, " *** Cross Thread Event ***\n");
+
+ ACE_OS::strcpy(export_spec, " %-40s \t ");
+ ACE_OS::strcat(export_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(export_spec, " \t ");
+ ACE_OS::strcat(export_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(export_spec, " \t ");
+ ACE_OS::strcat(export_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(export_spec, " \t *** Cross Thread Event ***\n");
+
+ ACE_OS::fprintf (log_file_,
+ format_spec,
+ (const char *) *probe_name,
+ timeprobe_params [i].interval / 10,
+ timeprobe_params [i].start_event_time / 10,
+ timeprobe_params [i].stop_event_time / 10);
+ ACE_OS::fprintf (export_file_,
+ export_spec,
+ (const char *) *probe_name,
+ timeprobe_params [i].interval / 10,
+ timeprobe_params [i].start_event_time / 10,
+ timeprobe_params [i].stop_event_time / 10);
+#endif
+ }
+
+ }
+ else
+ {
+ if (timeprobe_params [i].cross_thread_probe &&
+ timeprobe_params [i].is_full_interval)
+ {
+ if (generate_totals_)
+#if defined (ACE_LACKS_LONGLONG_T)
+ ACE_OS::fprintf (log_file_,
+ " [id (total): %8lu] %9lu %9lu %9lu *** Cross Thread Event ***\n",
+ timeprobe_params [i].probe_id,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].interval)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].start_event_time)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].stop_event_time)/10);
+ ACE_OS::fprintf (export_file_,
+ " [id (total): %lu] \t %lu \t %lu \t %lu \t ***Cross Thread Event***\n",
+ timeprobe_params [i].probe_id,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].interval)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].start_event_time)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].stop_event_time)/10);
+#else
+ // Build up the format specifiers since the specifier or not portable
+ ACE_OS::strcpy(format_spec, " [id (total): %8lu] ");
+ ACE_OS::strcat(format_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(format_spec, " ");
+ ACE_OS::strcat(format_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(format_spec, " ");
+ ACE_OS::strcat(format_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(format_spec, " *** Cross Thread Event ***\n");
+
+ ACE_OS::strcpy(export_spec, " [id (total): %8lu] \t ");
+ ACE_OS::strcat(export_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(export_spec, " \t ");
+ ACE_OS::strcat(export_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(export_spec, " \t ");
+ ACE_OS::strcat(export_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(export_spec, " \t*** Cross Thread Event ***\n");
+
+ if (probe_name == 0)
+ {
+ ACE_DEBUG((LM_DEBUG, "Found a probe with id: %d with no name\n", timeprobe_params [i].probe_id));
+ }
+ else
+ {
+ ACE_OS::fprintf (log_file_,
+ format_spec,
+ (const char *) *probe_name,
+ timeprobe_params [i].interval / 10,
+ timeprobe_params [i].start_event_time / 10,
+ timeprobe_params [i].stop_event_time / 10);
+ ACE_OS::fprintf (export_file_,
+ export_spec,
+ (const char *) *probe_name,
+ timeprobe_params [i].interval / 10,
+ timeprobe_params [i].start_event_time / 10,
+ timeprobe_params [i].stop_event_time / 10);
+ }
+#endif
+ }
+ else
+#if defined (ACE_LACKS_LONGLONG_T)
+ ACE_OS::fprintf (log_file_,
+ " [id: %14lu] %9lu %9lu %9lu \n",
+ timeprobe_params [i].probe_id,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].interval)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].start_event_time)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].stop_event_time)/10);
+ ACE_OS::fprintf (export_file_,
+ " [id: %lu] \t %lu \t %lu \t %lu\n",
+ timeprobe_params [i].probe_id,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].interval)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].start_event_time)/10,
+ (u_long) ACE_U64_TO_U32(timeprobe_params [i].stop_event_time)/10);
+#else
+ // Build up the format specifiers since the specifier or not portable
+ ACE_OS::strcpy(format_spec, " [id: %14lu] ");
+ ACE_OS::strcat(format_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(format_spec, " ");
+ ACE_OS::strcat(format_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(format_spec, " ");
+ ACE_OS::strcat(format_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(format_spec, " *** Cross Thread Event ***\n");
+
+ ACE_OS::strcpy(export_spec, " [id: %lu] \t ");
+ ACE_OS::strcat(export_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(export_spec, " \t ");
+ ACE_OS::strcat(export_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(export_spec, " \t ");
+ ACE_OS::strcat(export_spec, ACE_UINT64_FORMAT_SPECIFIER);
+ ACE_OS::strcat(export_spec, " *** Cross Thread Event ***\n");
+
+ if (probe_name == 0)
+ {
+ ACE_DEBUG((LM_DEBUG, "Found a probe with id: %d with no name\n", timeprobe_params [i].probe_id));
+ }
+ else
+ {
+ ACE_OS::fprintf (log_file_,
+ format_spec,
+ (const char *) *probe_name,
+ timeprobe_params [i].interval / 10,
+ timeprobe_params [i].start_event_time / 10,
+ timeprobe_params [i].stop_event_time / 10);
+ ACE_OS::fprintf (export_file_,
+ export_spec,
+ (const char *) *probe_name,
+ timeprobe_params [i].interval / 10,
+ timeprobe_params [i].start_event_time / 10,
+ timeprobe_params [i].stop_event_time / 10);
+ }
+#endif
+
+ }
+ } // End if (this->generate_log_)
+ }
+
+#if defined (METRICS_LOGGER_SENDS_EVENTS)
+ if (this->generate_events_)
+ {
+ CORBA::Any any;
+
+ util_data_.hrt_op_utilization =
+ static_cast<CORBA::Double> (ACE_UINT64_DBLCAST_ADAPTER (hrt_op_time))
+ / static_cast<CORBA::Double> (ACE_UINT64_DBLCAST_ADAPTER (interval));
+
+ util_data_.srt_op_utilization =
+ static_cast<CORBA::Double> (ACE_UINT64_DBLCAST_ADAPTER (srt_op_time))
+ / static_cast<CORBA::Double> (ACE_UINT64_DBLCAST_ADAPTER (interval));
+
+ util_data_.queue_utilization =
+ static_cast<CORBA::Double> (ACE_UINT64_DBLCAST_ADAPTER (queue_time))
+ / static_cast<CORBA::Double> (ACE_UINT64_DBLCAST_ADAPTER (interval));
+
+ ACE_TRY_NEW_ENV
+ {
+ any.replace (Metrics::_tc_UtilData, &util_data_, 0, ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+#if defined (METRICS_LOGGER_ERROR_OUTPUT_ENABLED)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Metrics_Logger::process_aggregate_QoS");
+#endif
+ return;
+ }
+ ACE_ENDTRY;
+
+ this->dove_supplier_.notify (any);
+ }
+#endif /* METRICS_LOGGER_SENDS_EVENTS */
+
+ if (this->generate_log_)
+ {
+ if (log_filename_)
+ {
+ ACE_OS::fflush (log_file_);
+ ACE_OS::fflush (export_file_);
+// ACE_OS::fclose (log_file_);
+ }
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_ENABLE_TIMEPROBES & ACE_COMPILE_TIMEPROBES */
+#endif /* ACE_METRICS_COLLECTION */
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_Logger.h b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_Logger.h
new file mode 100644
index 00000000000..f836ca5faf3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_Logger.h
@@ -0,0 +1,224 @@
+// -*- C++ -*-
+
+// $Id$
+
+#ifndef METRICS_LOGGER_H
+#define METRICS_LOGGER_H
+
+#if ! defined (VXWORKS)
+
+#if defined (ACE_METRICS_COLLECTION)
+
+#if defined (ACE_ENABLE_TIMEPROBES) && defined (ACE_COMPILE_TIMEPROBES)
+
+// Comment out both of these to disable output
+# define METRICS_LOGGER_ERROR_OUTPUT_ENABLED
+# define METRICS_LOGGER_DEBUG_OUTPUT_ENABLED
+
+#endif /* ! VXWORKS */
+
+// Comment this out to disable event passing
+#define TAO_METRICS_LOGGER_SENDS_EVENTS
+
+#include "ace/OS.h"
+#include "ace/Task.h"
+#include "ace/Singleton.h"
+#include "ace/Functor.h"
+#include "ace/Hash_Map_Manager.h"
+
+//#include "tao/TAO.h"
+
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/MetricsS.h"
+#include "orbsvcs/RtecEventCommS.h"
+
+#include "orbsvcs/Metrics/Metrics_Utils.h"
+
+#if defined (METRICS_LOGGER_SENDS_EVENTS)
+#include "MetricsC.h"
+#include "DOVE_Supplier.h"
+#endif /* METRICS_LOGGER_SENDS_EVENTS */
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Metrics_Export TAO_Metrics_Logger_Data
+{
+ // = TITLE
+ // Defines a class for logger data.
+ //
+ // = DESCRIPTION
+ // This class is used to transfer metrics data to the logger class.
+public:
+
+ enum LOGGER_DATA_TYPE {QOS_TYPE, TIMEPROBE_TYPE, BANNER_TYPE};
+
+ TAO_Metrics_Logger_Data (LOGGER_DATA_TYPE data_type,
+ Metrics::Time interval = ORBSVCS_Time::zero ())
+ : data_type_ (data_type),
+ interval_ (interval),
+ qos_params_ (0),
+ timeprobe_params_ (0),
+ banner_ (0)
+ {
+ }
+ // Constructor.
+
+ ~TAO_Metrics_Logger_Data ()
+ {
+ delete qos_params_;
+ delete timeprobe_params_;
+ delete banner_;
+ }
+ // Destructor.
+
+ LOGGER_DATA_TYPE data_type_;
+ // Identifies type of data.
+
+ Metrics::Time interval_;
+ // Time interval over which data were collected.
+
+ Metrics::QoSParameter_Set * qos_params_;
+ // Points to a QoS parameter data set.
+
+ Metrics::TimeprobeParameter_Set * timeprobe_params_;
+ // Points to a timeprobe data set.
+
+ char * banner_;
+ // Banner for entry in the log and/or visualization stream.
+};
+
+
+
+class TAO_Metrics_Export TAO_Metrics_Logger
+ : public ACE_Task<ACE_MT_SYNCH>, public POA_Metrics::QoSLogger
+ // = TITLE
+ // This class implements a Metrics QoS logger.
+ //
+ // = DESCRIPTION
+ // This class allows clients to log monitored QoS.
+{
+public:
+
+ typedef ACE_Hash_Map_Manager_Ex<CORBA::ULong,
+ CORBA::String_var *,
+ ACE_Hash<CORBA::ULong>,
+ ACE_Equal_To<CORBA::ULong>,
+ ACE_Null_Mutex> PROBE_NAME_MAP;
+ // Type of map used for O(1) lookup of probe names.
+
+ typedef ACE_Hash_Map_Entry<CORBA::ULong, CORBA::String_var> PROBE_NAME_MAP_ENTRY;
+ // Type of map used for O(1) lookup of RT_Infos by their handles.
+
+ TAO_Metrics_Logger (int generate_events = 0, int generate_log = 0, int generate_export_file = 1, const char *log_filename = 0);
+ // Default constructor.
+
+ virtual ~TAO_Metrics_Logger ();
+ // Destructor.
+
+ virtual int svc (void);
+ // Active object loop for processing logged data.
+
+ void send_banner (const char *banner
+ ACE_ENV_ARG_DECL)
+ throw (CORBA::SystemException);
+ // Sends a banner to be written to the log file and to the visualization browser.
+
+ void process_banner (const char *banner);
+ // Writes banner to the log file and/or to the visualization browser.
+
+ void log_aggregate_QoS (const Metrics::QoSParameter_Set & qos_params,
+ Metrics::Time interval
+ ACE_ENV_ARG_DECL)
+ throw (CORBA::SystemException);
+ // Reports the aggregate QoS information for all operations
+ // to the passed QoS logger.
+
+ void process_aggregate_QoS (const Metrics::QoSParameter_Set & qos_params,
+ Metrics::Time interval);
+ // Processes the aggregate QoS information for all operations
+ // to the passed QoS logger.
+
+ void set_identities (const Metrics::ProbeIdentity_Set & probe_identities
+ ACE_ENV_ARG_DECL)
+ throw (CORBA::SystemException);
+ // Binds the names of various timeprobes to their identifiers so
+ // that ids alone can be used (for efficiency) in passing data.
+
+ void set_identity (const Metrics::ProbeIdentity_t & probe_identity
+ ACE_ENV_ARG_DECL)
+ throw (CORBA::SystemException);
+ // Binds the names of various timeprobes to their identifiers so
+ // that ids alone can be used (for efficiency) in passing data.
+
+ void log_timeprobe_data (const Metrics::TimeprobeParameter_Set & timeprobe_params,
+ Metrics::Time interval
+ ACE_ENV_ARG_DECL)
+ throw (CORBA::SystemException);
+ // Reports timeprobe data collected since last run.
+
+ void process_timeprobe_data (const Metrics::TimeprobeParameter_Set & timeprobe_params,
+ Metrics::Time interval);
+ // Processes timeprobe data collected since last run.
+
+protected:
+
+ int generate_events_;
+ // Indicates whether or not to generate events for displays.
+
+ int generate_log_;
+ // Indicates whether or not to generate a text log.
+
+ const char *log_filename_;
+ // Name of the text log file (if any)
+
+ int generate_totals_;
+ // Indicates whether information of totals are logged.
+
+ int generate_export_file_;
+ // Indicates whether information of totals are logged.
+
+ int log_started_;
+ // Indicates whether or not the log has been started already.
+
+ FILE *log_file_;
+ // Handle to the text log file (if any).
+
+ FILE *export_file_;
+ // Handle to the excel export log file (if any).
+
+ PROBE_NAME_MAP probe_name_map_;
+ // Maps probe ids to their names.
+
+#if defined (METRICS_LOGGER_SENDS_EVENTS)
+ DOVE_Supplier dove_supplier_;
+ // DOVE Event supplier.
+
+ Metrics::QoSData qos_data_;
+ // QoS data structure.
+
+ Metrics::UtilData util_data_;
+ // Utilization data structure.
+
+#endif /* METRICS_LOGGER_SENDS_EVENTS */
+
+ // Only write the file once every OPEN_CLOSE_BANNER_CYCLE banner
+ // changes
+ int saveFileCnt_;
+};
+
+typedef ACE_Singleton<Metrics::QoSLogger_var, ACE_SYNCH_MUTEX>
+TAO_METRICS_LOGGER_REF_SINGLETON;
+
+typedef ACE_Singleton<TAO_Metrics_Logger, ACE_SYNCH_MUTEX>
+TAO_METRICS_LOGGER_SINGLETON;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_ENABLE_TIMEPROBES & ACE_COMPILE_TIMEPROBES */
+#endif /* ACE_METRICS_COLLECTION */
+
+#endif /* METRICS_LOGGER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor.cpp b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor.cpp
new file mode 100644
index 00000000000..fe4ec645da8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor.cpp
@@ -0,0 +1,23 @@
+// $Id$
+
+#ifndef METRICS_UPCALL_MONITOR_CPP
+#define METRICS_UPCALL_MONITOR_CPP
+
+#include "orbsvcs/Metrics/Metrics_UpcallMonitor.h"
+
+#if defined (ACE_METRICS_COLLECTION)
+
+#if defined (ACE_ENABLE_TIMEPROBES) && defined (ACE_COMPILE_TIMEPROBES)
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/Metrics/Metrics_UpcallMonitor.i"
+#endif /* __ACE_INLINE__ */
+
+#else
+#error ACE_COMPILE_TIMEPROBES must be defined in order to collect metrics
+#endif /* ACE_ENABLE_TIMEPROBES & ACE_COMPILE_TIMEPROBES */
+#endif /* ACE_METRICS_COLLECTION */
+
+
+#endif /* METRICS_UPCALL_MONITOR_CPP */
+
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor.h b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor.h
new file mode 100644
index 00000000000..69dde8b966c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor.h
@@ -0,0 +1,264 @@
+// -*- C++ -*-
+
+// $Id$
+
+#ifndef METRICS_UPCALL_MONITOR_H
+#define METRICS_UPCALL_MONITOR_H
+
+#if defined (ACE_METRICS_COLLECTION)
+
+#if defined (ACE_ENABLE_TIMEPROBES) && defined (ACE_COMPILE_TIMEPROBES)
+
+#if ! defined (VXWORKS)
+
+// Comment out both of these to disable output
+# define METRICS_MONITOR_ERROR_OUTPUT_ENABLED
+# define METRICS_MONITOR_DEBUG_OUTPUT_ENABLED
+
+#endif /* ! VXWORKS */
+
+#include "ace/Singleton.h"
+#include "ace/Hash_Map_Manager.h"
+
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/MetricsS.h"
+
+#include "orbsvcs/Metrics/Metrics_LocalCache.h"
+#include "orbsvcs/Metrics/Metrics_FrameManager.h"
+#include "orbsvcs/Metrics/Metrics_Utils.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Metrics_Export TAO_Metrics_UpcallMonitor
+ : public POA_Metrics::QoSMonitor
+{
+ // = TITLE
+ // This class implements a Metrics QoS monitor.
+ //
+ // = DESCRIPTION
+ // This class allows clients to monitor QoS, collected
+ // by the rest of the metrics framework.
+public:
+
+ typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::handle_t,
+ CORBA::ULong,
+ ACE_Hash<RtecScheduler::handle_t>,
+ ACE_Equal_To<RtecScheduler::handle_t>,
+ ACE_SYNCH_MUTEX> MONITOR_MAP;
+ // Type of map used for O(1) lookup of missed/made deadline counts
+ // by operation handles.
+
+ typedef ACE_Hash_Map_Entry<RtecScheduler::handle_t, CORBA::ULong>
+ MONITOR_MAP_ENTRY;
+ // Type of map used for O(1) lookup of RT_Infos by their handles.
+
+ typedef ACE_Hash_Map_Iterator_Ex<RtecScheduler::handle_t,
+ CORBA::ULong,
+ ACE_Hash<RtecScheduler::handle_t>,
+ ACE_Equal_To<RtecScheduler::handle_t>,
+ ACE_SYNCH_MUTEX> MONITOR_MAP_ITERATOR;
+ // Type of map used for O(1) lookup of missed/made deadline counts
+ // by operation handles.
+
+
+ TAO_Metrics_UpcallMonitor ();
+ // Default constructor.
+
+ ~TAO_Metrics_UpcallMonitor ();
+ // Destructor.
+
+ virtual void
+ report_made_deadline (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_0));
+ // Reports a successful upcall.
+
+ virtual void
+ report_missed_deadline (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_1));
+ // Reports an unsuccessful upcall.
+
+ virtual void
+ get_aggregate_QoS (RtecScheduler::handle_t handle,
+ Metrics::QoSParameter_t_out qos
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_2,
+ Metrics::INTERNAL_3));
+ // Get the aggregate QoS statistics collected for the passed handle.
+
+ virtual void get_aggregate_QoS_set (
+ const Metrics::Handle_Set_t & handle_set,
+ Metrics::QoSParameter_Set_out qos_set
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_4,
+ Metrics::INTERNAL_5));
+ // Get the aggregate QoS statistics collected for each handle in the
+ // passed set.
+
+ virtual void
+ reset_statistics (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_7,
+ Metrics::INTERNAL_8));
+ // Resets the aggregate QoS information for the given operation.
+
+ MONITOR_MAP &missed_map ();
+ // Accessor for map of operation handle to a count of deadlines missed.
+
+ MONITOR_MAP &made_map ();
+ // Accessor for map of operation handle to a count of deadlines made.
+
+private:
+
+ // = Implementation members.
+
+ MONITOR_MAP missed_map_;
+ // Maps operation handle to a count of deadlines missed.
+
+ MONITOR_MAP made_map_;
+ // Maps operation handle to a count of deadlines made.
+
+};
+
+
+class TAO_Metrics_Export TAO_Metrics_ReportingUpcallMonitor
+ : public POA_Metrics::ReportingQoSMonitor
+{
+ // = TITLE
+ // This class implements a reporting extension for a Metrics QoS monitor.
+ //
+ // = DESCRIPTION
+ // This class uses delegation to avoid the ugly consequences of
+ // multiple inheritance from a common IDL base class along two
+ // inheritance paths.
+public:
+
+ typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::handle_t,
+ CORBA::ULong,
+ ACE_Hash<RtecScheduler::handle_t>,
+ ACE_Equal_To<RtecScheduler::handle_t>,
+ ACE_SYNCH_MUTEX> MONITOR_MAP;
+ // Type of map used for O(1) lookup of missed/made deadline counts
+ // by operation handles.
+
+ typedef ACE_Hash_Map_Entry<RtecScheduler::handle_t, CORBA::ULong>
+ MONITOR_MAP_ENTRY;
+ // Type of map used for O(1) lookup of RT_Infos by their handles.
+
+ typedef ACE_Hash_Map_Iterator_Ex<RtecScheduler::handle_t,
+ CORBA::ULong,
+ ACE_Hash<RtecScheduler::handle_t>,
+ ACE_Equal_To<RtecScheduler::handle_t>,
+ ACE_SYNCH_MUTEX> MONITOR_MAP_ITERATOR;
+ // Type of map used for O(1) lookup of missed/made deadline counts
+ // by operation handles.
+
+
+ TAO_Metrics_ReportingUpcallMonitor ();
+ // Default constructor.
+
+ ~TAO_Metrics_ReportingUpcallMonitor ();
+ // Destructor.
+
+ virtual void
+ report_made_deadline (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_0));
+ // Reports a successful upcall.
+
+ virtual void
+ report_missed_deadline (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_1));
+ // Reports an unsuccessful upcall.
+
+ virtual void
+ get_aggregate_QoS (RtecScheduler::handle_t handle,
+ Metrics::QoSParameter_t_out qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_2,
+ Metrics::INTERNAL_3));
+ // Get the aggregate QoS statistics collected for the passed handle.
+
+ virtual void get_aggregate_QoS_set (
+ const Metrics::Handle_Set_t & handle_set,
+ Metrics::QoSParameter_Set_out qos_set
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_4,
+ Metrics::INTERNAL_5));
+ // Get the aggregate QoS statistics collected for each handle in the
+ // passed set.
+
+ virtual void report_aggregate_QoS (
+ Metrics::QoSLogger_ptr logger,
+ Metrics::Time interval
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::NIL_LOGGER,
+ Metrics::INTERNAL_6));
+ // Report the aggregate QoS statistics to the logger.
+
+ virtual void
+ reset_statistics (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_7,
+ Metrics::INTERNAL_8));
+ // Resets the aggregate QoS information for the given operation.
+
+private:
+
+ TAO_Metrics_UpcallMonitor monitor_;
+ // The monitor we're wrapping.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Metrics/Metrics_UpcallMonitor.i"
+#endif /* __ACE_INLINE__ */
+
+#include "orbsvcs/Metrics/Metrics_UpcallMonitor_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef TAO_Metrics_UpcallMonitorAdapter<ACE_SYNCH_MUTEX, ACE_New_Allocator>
+TAO_METRICS_MONITOR_ADAPTER_TYPE;
+
+typedef TAO_Metrics_ReportingUpcallMonitorAdapter<ACE_SYNCH_MUTEX, ACE_New_Allocator>
+TAO_METRICS_REPORTING_MONITOR_ADAPTER_TYPE;
+
+typedef ACE_Singleton<TAO_Metrics_UpcallMonitor, ACE_SYNCH_MUTEX>
+TAO_METRICS_MONITOR_SINGLETON_TYPE;
+
+typedef ACE_Singleton<TAO_Metrics_ReportingUpcallMonitor, ACE_SYNCH_MUTEX>
+TAO_METRICS_REPORTING_MONITOR_SINGLETON_TYPE;
+
+#if defined (TAO_USES_REPORTING_METRICS)
+typedef TAO_METRICS_REPORTING_MONITOR_ADAPTER_TYPE TAO_METRICS_MONITOR_ADAPTER;
+typedef TAO_METRICS_REPORTING_MONITOR_SINGLETON_TYPE TAO_METRICS_MONITOR_SINGLETON;
+#else
+typedef TAO_METRICS_MONITOR_ADAPTER_TYPE TAO_METRICS_MONITOR_ADAPTER;
+typedef TAO_METRICS_MONITOR_SINGLETON_TYPE TAO_METRICS_MONITOR_SINGLETON;
+#endif
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_ENABLE_TIMEPROBES & ACE_COMPILE_TIMEPROBES */
+#endif /* ACE_METRICS_COLLECTION */
+
+#endif /* METRICS_UPCALL_MONITOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor.i b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor.i
new file mode 100644
index 00000000000..9b028ba293b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor.i
@@ -0,0 +1,381 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// @METRICS@
+
+#ifndef METRICS_UPCALL_MONITOR_I
+#define METRICS_UPCALL_MONITOR_I
+
+//# if defined (METRICS_USES_OP_CANCELLATION)
+//# undef METRICS_USES_OP_CANCELLATION
+//# endif /* METRICS_USES_OP_CANCELLATION */
+
+# if ! defined (METRICS_USES_OP_CANCELLATION)
+# define METRICS_USES_OP_CANCELLATION
+# endif /* ! METRICS_USES_OP_CANCELLATION */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/////////////////////////////////////
+// Class TAO_Metrics_UpcallMonitor //
+/////////////////////////////////////
+
+// Default constructor.
+
+ACE_INLINE
+TAO_Metrics_UpcallMonitor::TAO_Metrics_UpcallMonitor ()
+{
+}
+
+// Destructor.
+
+ACE_INLINE
+TAO_Metrics_UpcallMonitor::~TAO_Metrics_UpcallMonitor ()
+{
+}
+
+// Reports a successful upcall.
+
+ACE_INLINE void
+TAO_Metrics_UpcallMonitor::
+report_made_deadline (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_0))
+{
+ CORBA::ULong count = 0;
+ MONITOR_MAP_ENTRY *entry;
+
+ if (made_map_.trybind (handle, count, entry) < 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Failed trybind for handle %u in made map\n", handle));
+ ACE_THROW (Metrics::INTERNAL_0 ());
+ }
+
+ ++entry->int_id_;
+}
+
+// Reports an unsuccessful upcall.
+
+ACE_INLINE void
+TAO_Metrics_UpcallMonitor::
+report_missed_deadline (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_1))
+{
+ CORBA::ULong count = 0;
+ MONITOR_MAP_ENTRY *entry;
+
+ if (missed_map_.trybind (handle, count, entry) < 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Failed trybind for handle %u in missed map\n", handle));
+ ACE_THROW (Metrics::INTERNAL_1 ());
+ }
+
+ ++entry->int_id_;
+}
+
+
+// Get the aggregate QoS statistics collected so far by the monitor.
+
+ACE_INLINE void
+TAO_Metrics_UpcallMonitor::get_aggregate_QoS (RtecScheduler::handle_t handle,
+ Metrics::QoSParameter_t_out qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_2,
+ Metrics::INTERNAL_3))
+{
+ CORBA::ULong made_count = 0;
+ CORBA::ULong missed_count = 0;
+ MONITOR_MAP_ENTRY *made_entry;
+ MONITOR_MAP_ENTRY *missed_entry;
+
+ if (made_map_.trybind (handle, made_count, made_entry) < 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "TAO_Metrics_UpcallMonitor::get_aggregate_QoS: "
+ "Failed trybind for handle %u in made map\n", handle));
+ ACE_THROW (Metrics::INTERNAL_2 ());
+ }
+
+ if (missed_map_.trybind (handle, missed_count, missed_entry) < 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "TAO_Metrics_UpcallMonitor::get_aggregate_QoS: "
+ "Failed trybind for handle %u in missed map\n", handle));
+ ACE_THROW (Metrics::INTERNAL_3 ());
+ }
+
+ ACE_NEW_THROW_EX (qos,
+ Metrics::QoSParameter_t,
+ CORBA::NO_MEMORY ());
+
+ qos->handle = handle;
+ qos->deadlines_made = made_entry->int_id_;
+ qos->deadlines_missed = missed_entry->int_id_;
+ qos->operations_cancelled = 0;
+ qos->is_hrt = 0;
+}
+
+
+// Get the aggregate QoS statistics collected for each handle in the
+// passed set.
+
+ACE_INLINE void
+TAO_Metrics_UpcallMonitor::get_aggregate_QoS_set (
+ const Metrics::Handle_Set_t & handle_set,
+ Metrics::QoSParameter_Set_out qos_set
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_4,
+ Metrics::INTERNAL_5))
+{
+ CORBA::ULong made_count = 0;
+ CORBA::ULong missed_count = 0;
+ MONITOR_MAP_ENTRY *made_entry = 0;
+ MONITOR_MAP_ENTRY *missed_entry = 0;
+
+ ACE_NEW_THROW_EX (qos_set,
+ Metrics::QoSParameter_Set (handle_set.length ()),
+ CORBA::NO_MEMORY ());
+ qos_set->length (handle_set.length ());
+
+
+ for (u_int i = 0; i < handle_set.length (); ++i)
+ {
+ made_count = 0;
+ missed_count = 0;
+ made_entry = 0;
+ missed_entry = 0;
+
+ if (made_map_.trybind (handle_set [i], made_count, made_entry) < 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_Metrics_UpcallMonitor::get_aggregate_QoS_set: "
+ "Failed trybind for handle_set [%d] = %u in made map\n",
+ i, handle_set [i]));
+ ACE_THROW (Metrics::INTERNAL_4 ());
+ }
+
+ if (missed_map_.trybind (handle_set [i], missed_count, missed_entry) < 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_Metrics_UpcallMonitor::get_aggregate_QoS_set: "
+ "Failed trybind for handle_set[%d]=%u in missed map\n",
+ i, handle_set [i]));
+ ACE_THROW (Metrics::INTERNAL_5 ());
+ }
+
+ qos_set [i].handle = handle_set [i];
+ qos_set [i].deadlines_made = made_entry->int_id_;
+ qos_set [i].deadlines_missed = missed_entry->int_id_;
+ qos_set [i].operations_cancelled = 0;
+ qos_set [i].is_hrt = 0;
+ }
+}
+
+
+
+// Resets the aggregate QoS information for the given operation.
+
+ACE_INLINE void
+TAO_Metrics_UpcallMonitor::reset_statistics (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_7,
+ Metrics::INTERNAL_8))
+{
+ CORBA::ULong count = 0;
+
+ if (made_map_.rebind (handle, count) < 0)
+ {
+ ACE_THROW (Metrics::INTERNAL_7 ());
+ }
+
+ if (missed_map_.rebind (handle, count) < 0)
+ {
+ ACE_THROW (Metrics::INTERNAL_8 ());
+ }
+}
+
+
+// Accessor for map of operation handle to a count of deadlines missed.
+
+ACE_INLINE
+TAO_Metrics_UpcallMonitor::MONITOR_MAP &
+TAO_Metrics_UpcallMonitor::missed_map ()
+{
+ return this->missed_map_;
+}
+
+// Accessor for map of operation handle to a count of deadlines made.
+
+ACE_INLINE
+TAO_Metrics_UpcallMonitor::MONITOR_MAP &
+TAO_Metrics_UpcallMonitor::made_map ()
+{
+ return this->made_map_;
+}
+
+//////////////////////////////////////////////
+// Class TAO_Metrics_ReportingUpcallMonitor //
+//////////////////////////////////////////////
+
+// Default constructor.
+
+ACE_INLINE
+TAO_Metrics_ReportingUpcallMonitor::TAO_Metrics_ReportingUpcallMonitor ()
+{
+}
+
+// Destructor.
+
+ACE_INLINE
+TAO_Metrics_ReportingUpcallMonitor::~TAO_Metrics_ReportingUpcallMonitor ()
+{
+}
+
+// Reports a successful upcall.
+
+ACE_INLINE void
+TAO_Metrics_ReportingUpcallMonitor::
+report_made_deadline (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_0))
+{
+ monitor_.report_made_deadline (handle
+ ACE_ENV_ARG_DECL);
+}
+
+// Reports an unsuccessful upcall.
+
+ACE_INLINE void
+TAO_Metrics_ReportingUpcallMonitor::
+report_missed_deadline (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_1))
+{
+ monitor_.report_missed_deadline (handle
+ ACE_ENV_ARG_DECL);
+}
+
+
+// Get the aggregate QoS statistics collected so far by the monitor.
+
+ACE_INLINE void
+TAO_Metrics_ReportingUpcallMonitor::get_aggregate_QoS (RtecScheduler::handle_t handle,
+ Metrics::QoSParameter_t_out qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_2,
+ Metrics::INTERNAL_3))
+{
+ monitor_.get_aggregate_QoS (handle,
+ qos
+ ACE_ENV_ARG_DECL);
+}
+
+
+// Get the aggregate QoS statistics collected for each handle in the
+// passed set.
+
+ACE_INLINE void
+TAO_Metrics_ReportingUpcallMonitor::get_aggregate_QoS_set (
+ const Metrics::Handle_Set_t & handle_set,
+ Metrics::QoSParameter_Set_out qos_set
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_4,
+ Metrics::INTERNAL_5))
+{
+ monitor_.get_aggregate_QoS_set (handle_set,
+ qos_set
+ ACE_ENV_ARG_DECL);
+}
+
+
+
+// Resets the aggregate QoS information for the given operation.
+
+ACE_INLINE void
+TAO_Metrics_ReportingUpcallMonitor::reset_statistics (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::INTERNAL_7,
+ Metrics::INTERNAL_8))
+{
+ monitor_.reset_statistics (handle
+ ACE_ENV_ARG_DECL);
+}
+
+
+// Reports the aggregate QoS statistics to the logger.
+
+ACE_INLINE void
+TAO_Metrics_ReportingUpcallMonitor::report_aggregate_QoS (
+ Metrics::QoSLogger_ptr logger,
+ Metrics::Time interval
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Metrics::NIL_LOGGER,
+ Metrics::INTERNAL_6))
+{
+ if (CORBA::is_nil (logger))
+ {
+ ACE_THROW (Metrics::NIL_LOGGER ());
+ }
+
+ Metrics::QoSParameter_Set qos_set;
+ u_int set_length = 1;
+
+ // First, look at made map handles
+ MONITOR_MAP_ITERATOR iter (monitor_.made_map ());
+ for (; iter.done () == 0; ++iter, ++set_length)
+ {
+ CORBA::ULong missed_count;
+ if (monitor_.missed_map ().find ((*iter).ext_id_, missed_count) < 0)
+ {
+ missed_count = 0;
+ }
+
+ qos_set.length (set_length);
+
+ qos_set [set_length - 1].entry_point = (const char *) "MONITOR MADE_MAP_OP";
+ qos_set [set_length - 1].handle = (*iter).ext_id_;
+ qos_set [set_length - 1].deadlines_made = (*iter).int_id_;
+ qos_set [set_length - 1].deadlines_missed = missed_count;
+ qos_set [set_length - 1].operations_cancelled = 0;
+ qos_set [set_length - 1].is_hrt = 0;
+ }
+
+ // Then, find missed map handles with no made map entry.
+ MONITOR_MAP_ITERATOR missed_iter (monitor_.missed_map ());
+ for (; missed_iter.done () == 0; ++missed_iter)
+ {
+ CORBA::ULong made_count;
+ if (monitor_.made_map ().find ((*missed_iter).ext_id_, made_count) < 0)
+ {
+ qos_set.length (set_length);
+
+ qos_set [set_length - 1].entry_point = (const char *) "MONITOR MISS_MAP_OP";
+ qos_set [set_length - 1].handle = (*missed_iter).ext_id_;
+ qos_set [set_length - 1].deadlines_made = 0;
+ qos_set [set_length - 1].deadlines_missed = (*missed_iter).int_id_;
+ qos_set [set_length - 1].operations_cancelled = 0;
+ qos_set [set_length - 1].is_hrt = 0;
+
+ ++set_length;
+ }
+ }
+
+ logger->log_aggregate_QoS (qos_set, interval);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* METRICS_UPCALL_MONITOR_I */
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor_T.cpp b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor_T.cpp
new file mode 100644
index 00000000000..333b49c3ff6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor_T.cpp
@@ -0,0 +1,28 @@
+// $Id$
+
+#ifndef METRICS_UPCALL_MONITOR_T_CPP
+#define METRICS_UPCALL_MONITOR_T_CPP
+
+#include "orbsvcs/Metrics/Metrics_UpcallMonitor_T.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/Metrics/Metrics_UpcallMonitor_T.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Virtual destructor: destroy actual consumer if we own it.
+template <class ACE_LOCK, class ALLOCATOR>
+TAO_Metrics_UpcallMonitorAdapter<ACE_LOCK, ALLOCATOR>::
+~TAO_Metrics_UpcallMonitorAdapter ()
+{
+ if (adapter_owns_consumer_)
+ {
+ delete (& consumer_);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* METRICS_UPCALL_MONITOR_T_CPP */
+
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor_T.h b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor_T.h
new file mode 100644
index 00000000000..4c5958cb09e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor_T.h
@@ -0,0 +1,164 @@
+// -*- C++ -*-
+
+// $Id$
+
+#ifndef METRICS_UPCALL_MONITOR_T_H
+#define METRICS_UPCALL_MONITOR_T_H
+
+#if ! defined (VXWORKS)
+
+// Comment out both of these to disable output
+# define METRICS_MONITOR_ERROR_OUTPUT_ENABLED
+# define METRICS_MONITOR_DEBUG_OUTPUT_ENABLED
+
+#endif /* ! VXWORKS */
+
+#include "orbsvcs/Metrics/Metrics_LocalCache.h"
+#include "orbsvcs/Metrics/Metrics_FrameManager.h"
+
+#include "ace/Hash_Map_Manager.h"
+
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/MetricsS.h"
+
+#include "orbsvcs/Metrics/Metrics_UpcallMonitor.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class ACE_LOCK, class ALLOCATOR>
+class TAO_Metrics_UpcallMonitorAdapter
+ : public RtecEventComm::PushConsumer
+{
+ // = TITLE
+ // This class implements an adapter for monitoring QoS received by
+ // an event push consumer.
+ //
+ // = DESCRIPTION
+ // This class wraps the consumer event push upcall with time
+ // probe and monitor reporting calls.
+public:
+
+ TAO_Metrics_UpcallMonitorAdapter (
+ POA_Metrics::QoSMonitor & monitor,
+ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR> & cache,
+ TAO_Metrics_FrameManager<ACE_LOCK> & frame_manager,
+ POA_RtecEventComm::PushConsumer & consumer,
+ TAO::String_Manager entry_point,
+ RtecScheduler::handle_t handle,
+ RtecScheduler::Period_t period,
+ RtecScheduler::Time wcet,
+ RtecScheduler::Criticality_t criticality,
+ int adapter_owns_consumer = 1,
+ int cache_register = 1);
+ // Constructor that takes a reference to the various metrics
+ // objects, the actual push consumer we're monitoring, QoS info
+ // about the consumer, and an int that indicates whether (non-zero)
+ // or not (zero) we need to destroy the consumer in our destructor.
+
+ virtual ~TAO_Metrics_UpcallMonitorAdapter ();
+ // Virtual destructor: destroys actual consumer if it owns it.
+
+ RtecScheduler::Period_t get_period ();
+ // Get the current period for the adapter.
+
+ void set_period (RtecScheduler::Period_t period);
+ // Set the current period for the adapter.
+
+ void push (const RtecEventComm::EventSet & data,
+ CORBA::Environment &ACE_TRY_ENV =
+ CORBA::Environment::default_environment ());
+ // Do a monitored push to the actual PushConsumer for which we're a proxy
+
+ void disconnect_push_consumer (CORBA::Environment &ACE_TRY_ENV =
+ CORBA::Environment::default_environment ());
+ // Delegates to the actual PushConsumer for which we're a proxy
+
+protected:
+
+ // = Implementation members.
+
+ POA_Metrics::QoSMonitor & monitor_;
+ // A reference to the monitor to which we report.
+
+ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR> & cache_;
+ // A reference to the metrics data cache to which we report.
+
+ TAO_Metrics_FrameManager<ACE_LOCK> & frame_manager_;
+ // A reference to the frame manager we use.
+
+ POA_RtecEventComm::PushConsumer & consumer_;
+ // A reference to the actual PushConsumer for which we're a proxy
+
+ RtecScheduler::handle_t handle_;
+ // Handle of the operation we're wrapping.
+
+ RtecScheduler::Period_t period_;
+ // Current period for the adapter.
+
+ ACE_Time_Value execution_time_;
+ // Current execution time for the adapter.
+
+ int is_critical_;
+ // Whether or not the adapter is critical.
+
+ int adapter_owns_consumer_;
+ // indicates whether (non-zero) or not (zero) we need
+ // to destroy the consumer in our destructor.
+
+};
+
+template <class ACE_LOCK, class ALLOCATOR>
+class TAO_Metrics_ReportingUpcallMonitorAdapter
+ : public TAO_Metrics_UpcallMonitorAdapter <ACE_LOCK, ALLOCATOR>
+{
+ // = TITLE
+ // This class implements an adapter for monitoring QoS received by
+ // an event push consumer.
+ //
+ // = DESCRIPTION
+ // This class wraps the consumer event push upcall with time
+ // probe and monitor reporting calls.
+public:
+
+ TAO_Metrics_ReportingUpcallMonitorAdapter (
+ POA_Metrics::QoSMonitor & monitor,
+ TAO_Metrics_ReportingLocalCache<ACE_LOCK, ALLOCATOR> & cache,
+ TAO_Metrics_FrameManager<ACE_LOCK> & frame_manager,
+ POA_RtecEventComm::PushConsumer & consumer,
+ TAO::String_Manager entry_point,
+ RtecScheduler::handle_t handle,
+ RtecScheduler::Period_t period,
+ RtecScheduler::Time wcet,
+ RtecScheduler::Criticality_t criticality,
+ int adapter_owns_consumer = 1,
+ Metrics::QoSLogger_ptr logger = 0);
+ // Constructor that takes a reference to a logger object and
+ // info needed to construct or base class.
+
+protected:
+
+ // = Implementation members.
+
+ Metrics::QoSLogger_ptr logger_;
+ // A (possibly null) CORBA pointer to a logging object
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Metrics/Metrics_UpcallMonitor_T.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Metrics/Metrics_UpcallMonitor_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Metrics_UpcallMonitor_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* METRICS_UPCALL_MONITOR_T_H */
+
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor_T.i b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor_T.i
new file mode 100644
index 00000000000..08b866de338
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_UpcallMonitor_T.i
@@ -0,0 +1,263 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// @METRICS@
+
+#ifndef METRICS_UPCALL_MONITOR_T_I
+#define METRICS_UPCALL_MONITOR_T_I
+
+//# if defined (METRICS_USES_OP_CANCELLATION)
+//# undef METRICS_USES_OP_CANCELLATION
+//# endif /* METRICS_USES_OP_CANCELLATION */
+
+# if ! defined (METRICS_USES_OP_CANCELLATION)
+# define METRICS_USES_OP_CANCELLATION
+# endif /* ! METRICS_USES_OP_CANCELLATION */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+////////////////////////////////////////////
+// class TAO_Metrics_UpcallMonitorAdapter //
+////////////////////////////////////////////
+
+
+// Constructor that takes a reference to the actual push consumer
+// we're monitoring and an int that indicates whether (non-zero) or
+// not (zero) we need to destroy the consumer in our destructor.
+
+template <class ACE_LOCK, class ALLOCATOR>
+ACE_INLINE
+TAO_Metrics_UpcallMonitorAdapter<ACE_LOCK, ALLOCATOR>::
+TAO_Metrics_UpcallMonitorAdapter (
+ POA_Metrics::QoSMonitor & monitor,
+ TAO_Metrics_LocalCache<ACE_LOCK, ALLOCATOR> &cache,
+ TAO_Metrics_FrameManager<ACE_LOCK> &frame_manager,
+ POA_RtecEventComm::PushConsumer & consumer,
+ TAO::String_Manager entry_point,
+ RtecScheduler::handle_t handle,
+ RtecScheduler::Period_t period,
+ RtecScheduler::Time wcet,
+ RtecScheduler::Criticality_t criticality,
+ int adapter_owns_consumer,
+ int cache_register)
+ : monitor_ (monitor),
+ cache_ (cache),
+ frame_manager_ (frame_manager),
+ consumer_ (consumer),
+ handle_ (handle),
+ period_ (period),
+ adapter_owns_consumer_ (adapter_owns_consumer)
+{
+//DCL:Added to remove Linux compile warning
+ ACE_UNUSED_ARG(entry_point);
+
+ // Ensure that the high res timer global scale factor
+ // is set before any of its static methods are used
+ ACE_High_Res_Timer::global_scale_factor ();
+
+ // Store the RT_Info execution time.
+ ORBSVCS_Time::TimeT_to_Time_Value(this->execution_time_,
+ wcet);
+ this->is_critical_ =
+ (criticality == RtecScheduler::HIGH_CRITICALITY
+ || criticality == RtecScheduler::VERY_HIGH_CRITICALITY)
+ ? 1 : 0;
+
+ // Use the type-preserving argument rather than the base class
+ // reference which is fine everywhere but here.
+ if (cache_register)
+ {
+ if (cache.metrics_enabled())
+ cache.register_upcall_adapter (this->handle_,
+ entry_point,
+ this->is_critical_);
+ }
+}
+
+
+// Get the current priod for the adapter.
+
+template <class ACE_LOCK, class ALLOCATOR>
+ACE_INLINE RtecScheduler::Period_t
+TAO_Metrics_UpcallMonitorAdapter<ACE_LOCK, ALLOCATOR>::
+get_period ()
+{
+ return this->period_;
+}
+
+
+// Set the current priod for the adapter.
+
+template <class ACE_LOCK, class ALLOCATOR>
+ACE_INLINE void
+TAO_Metrics_UpcallMonitorAdapter<ACE_LOCK, ALLOCATOR>::
+set_period (RtecScheduler::Period_t period)
+{
+ this->period_ = period;
+}
+
+
+// Do a monitored push to the actual PushConsumer for which we're a proxy
+template <class ACE_LOCK, class ALLOCATOR>
+ACE_INLINE void
+TAO_Metrics_UpcallMonitorAdapter<ACE_LOCK, ALLOCATOR>::
+push (const RtecEventComm::EventSet & data,
+ CORBA::Environment &ACE_TRY_ENV)
+{
+ // Save stamped deadline.
+ ACE_Time_Value deadline_tv;
+
+ // If we get an error, just set the deadline to zero, and possibly
+ // complain.
+ if (this->frame_manager_.get_end_time (this->period_, deadline_tv) < 0)
+ {
+ deadline_tv = ACE_Time_Value::zero;
+# if defined (METRICS_MONITOR_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR,
+ "TAO_Metrics_UpcallMonitorAdapter::push"
+ " get_end_time failed .\n"));
+# endif /* METRICS_MONITOR_ERROR_OUTPUT_ENABLED */
+ }
+
+# if defined (METRICS_USES_OP_CANCELLATION)
+
+ // Take current time stamp and add expected execution to get
+ // projected completion. Done this way for efficiency, to minimize
+ // temporaries and their copies and constructor and destructor calls.
+ ACE_Time_Value projected_tv;
+ ACE_hrtime_t hrtime_now = ACE_OS::gethrtime ();
+ ACE_High_Res_Timer::hrtime_to_tv (projected_tv,
+ hrtime_now);
+ projected_tv += this->execution_time_;
+
+ // Operation cancellation: uses WCET to determine whether or not
+ // deadline will be met. A critical operation (is_critical_) is
+ // dispatched unconditionally. A zero deadline indicates an
+ // operation is not deadline-bound and thus is not subject to
+ // cancellation.
+ if (this->is_critical_
+ || deadline_tv >= projected_tv
+ || deadline_tv == ACE_Time_Value::zero)
+ {
+# endif /* METRICS_USES_OP_CANCELLATION */
+
+ // Record the start of the upcall in the cache.
+#if 0
+ if ( this->handle_ != TAO_Metrics_Utils::timeoutEvent ())
+#endif /* 0 */
+ if (cache_.metrics_enabled())
+ cache_.report_upcall_start (this->handle_);
+
+ // Push to the actual consumer.
+ consumer_.push (data, ACE_TRY_ENV);
+ ACE_CHECK;
+
+ // Record the end of the upcall in the cache, and report whether
+ // the deadline was made or missed to the monitor.
+
+#if 0
+ if ( this->handle_ != TAO_Metrics_Utils::timeoutEvent ())
+ {
+#else /* 1 */
+ if (1)
+ {
+#endif /* 0 */
+ if (cache_.metrics_enabled())
+ {
+ int result = cache_.report_upcall_stop (this->handle_, deadline_tv);
+ if (result == 0)
+ {
+ monitor_.report_made_deadline (this->handle_, ACE_TRY_ENV);
+ ACE_CHECK;
+ }
+ else if (result == 1)
+ {
+ monitor_.report_missed_deadline (this->handle_, ACE_TRY_ENV);
+ ACE_CHECK;
+ }
+# if defined (METRICS_MONITOR_ERROR_OUTPUT_ENABLED)
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "TAO_Metrics_UpcallMonitorAdapter::push"
+ " upcall stop reporting failed .\n"));
+ }
+
+# endif /* METRICS_MONITOR_ERROR_OUTPUT_ENABLED */
+ }
+ }
+# if defined (METRICS_USES_OP_CANCELLATION)
+ }
+ else
+ {
+# if defined (METRICS_MONITOR_DEBUG_OUTPUT_ENABLED)
+ ACE_DEBUG ((LM_INFO,
+ "SRT Operation cancelled .\n"));
+# endif /* METRICS_MONITOR_DEBUG_OUTPUT_ENABLED */
+
+ if (cache_.metrics_enabled())
+ {
+ // The operation push was cancelled: report the cancellation to
+ // the cache and the missed deadline to the monitor.
+ cache_.report_upcall_cancellation (this->handle_);
+ monitor_.report_missed_deadline (this->handle_, ACE_TRY_ENV);
+ ACE_CHECK;
+ }
+ }
+
+# endif /* METRICS_USES_OP_CANCELLATION */
+}
+
+// Delegates to the actual PushConsumer for which we're a proxy.
+
+template <class ACE_LOCK, class ALLOCATOR>
+ACE_INLINE void
+TAO_Metrics_UpcallMonitorAdapter<ACE_LOCK, ALLOCATOR>::
+disconnect_push_consumer (CORBA::Environment &ACE_TRY_ENV)
+{
+ consumer_.disconnect_push_consumer (ACE_TRY_ENV);
+}
+
+
+template <class ACE_LOCK, class ALLOCATOR>
+ACE_INLINE
+TAO_Metrics_ReportingUpcallMonitorAdapter<ACE_LOCK, ALLOCATOR>::
+TAO_Metrics_ReportingUpcallMonitorAdapter (
+ POA_Metrics::QoSMonitor & monitor,
+ TAO_Metrics_ReportingLocalCache<ACE_LOCK, ALLOCATOR> &cache,
+ TAO_Metrics_FrameManager<ACE_LOCK> &frame_manager,
+ POA_RtecEventComm::PushConsumer & consumer,
+ TAO::String_Manager entry_point,
+ RtecScheduler::handle_t handle,
+ RtecScheduler::Period_t period,
+ RtecScheduler::Time wcet,
+ RtecScheduler::Criticality_t criticality,
+ int adapter_owns_consumer,
+ Metrics::QoSLogger_ptr logger)
+ : TAO_Metrics_UpcallMonitorAdapter<ACE_LOCK, ALLOCATOR>
+ (monitor,
+ cache,
+ frame_manager,
+ consumer,
+ entry_point,
+ handle,
+ period,
+ wcet,
+ criticality,
+ adapter_owns_consumer,
+ 0 /* don't register */),
+ logger_ (logger)
+{
+ // Use the type-preserving argument rather than the base class
+ // reference which is fine everywhere but here.
+ cache.register_upcall_adapter (this->handle_,
+ entry_point,
+ this->is_critical_,
+ this->logger_);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* METRICS_UPCALL_MONITOR_T_I */
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_Utils.cpp b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_Utils.cpp
new file mode 100644
index 00000000000..99c51fe77b7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_Utils.cpp
@@ -0,0 +1,534 @@
+// $Id$
+
+#ifndef METRICS_UTILS_CPP
+#define METRICS_UTILS_CPP
+
+#if defined (ACE_METRICS_COLLECTION)
+
+#if defined (ACE_ENABLE_TIMEPROBES) && defined (ACE_COMPILE_TIMEPROBES)
+
+
+#include "ace/Metrics_Cache.h"
+#include "orbsvcs/Metrics/Metrics_Utils.h"
+#include "orbsvcs/Metrics/Metrics_LocalCache.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/////////////////////////////
+// Class TAO_Metrics_Utils //
+/////////////////////////////
+
+// Static constants
+
+const u_int WSOA_Metrics_Handles::WSOA_METRICS_MAX_TILING_FACTOR = 64;
+
+const u_int TAO_Metrics_Utils::METRICS_BUFSIZE = 64;
+
+const u_int TAO_Metrics_Utils::METRICS_ENQUEUE_PROBE_ID_BASE = 0;
+const u_int TAO_Metrics_Utils::METRICS_DEQUEUE_PROBE_ID_BASE = 1000;
+const u_int TAO_Metrics_Utils::METRICS_SCHED_PROBE_ID_BASE = 2000;
+const u_int TAO_Metrics_Utils::METRICS_QUO_PROBE_ID_BASE = 3000;
+const u_int TAO_Metrics_Utils::METRICS_RTARM_PROBE_ID_BASE = 4000;
+const u_int TAO_Metrics_Utils::METRICS_TNS_PROBE_ID_BASE = 5000;
+const u_int TAO_Metrics_Utils::METRICS_TEEC_PROBE_ID_BASE = 6000;
+const u_int TAO_Metrics_Utils::METRICS_UPCALL_MONITOR_ADAPTER_ID_BASE = 7000;
+
+// Static variable
+
+RtecScheduler::handle_t TAO_Metrics_Utils::timeoutEvent_ = 72;
+
+
+
+// Static method to set the mission state in the logger.
+
+void
+TAO_Metrics_Utils::set_mission_state (int i, Metrics::QoSLogger_ptr logger)
+{
+ if (CORBA::is_nil (logger))
+ {
+#if defined (METRICS_UTILS_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR,
+ "TAO_Metrics_Utils::set_mission_state:\n"
+ "Logger IOR reference is nil.\n"));
+#endif
+ return;
+ }
+
+ char banner [TAO_Metrics_Utils::METRICS_BUFSIZE];
+ ACE_OS::memset (banner, 0, TAO_Metrics_Utils::METRICS_BUFSIZE);
+ ACE_OS::sprintf (banner, "\n\n*** Mission State %d ***\n\n", i);
+
+ ACE_TRY_NEW_ENV
+ {
+ logger->send_banner (banner
+ ACE_ENV_ARG_DECL);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+#if defined (METRICS_UTILS_ERROR_OUTPUT_ENABLED)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_Metrics_LocalCache::set_mission_state:"
+ " logger call failed\n");
+#endif
+ }
+ ACE_ENDTRY;
+}
+
+// Sets the logger reference.
+
+Metrics::QoSLogger_var
+TAO_Metrics_Utils::get_logger (const char * logger_ior_str,
+ CORBA::ORB_ptr orb)
+{
+ Metrics::QoSLogger_var logger;
+ if (logger_ior_str && orb)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Object_var obj =
+ orb->string_to_object (logger_ior_str);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (obj.in ()))
+ {
+#if defined (METRICS_UTILS_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR,
+ "TAO_Metrics_Utils::get_logger:\n"
+ "Logger IOR string produced a "
+ "nil reference:\n[%s]",
+ logger_ior_str));
+#endif
+ return logger;
+ }
+ else
+ {
+ logger = Metrics::QoSLogger::_narrow (obj.in ());
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (logger.in ()))
+ {
+#if defined (METRICS_UTILS_ERROR_OUTPUT_ENABLED)
+ ACE_ERROR ((LM_ERROR,
+ "TAO_Metrics_LocalCache::set_logger:\n"
+ "Could not narrow IOR to logger:\n[%s]",
+ logger_ior_str));
+#endif
+ return logger;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+#if defined (METRICS_UTILS_ERROR_OUTPUT_ENABLED)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_Metrics_LocalCache::set_logger exception");
+#endif
+ return logger;
+ }
+ ACE_ENDTRY;
+ }
+#if defined (METRICS_UTILS_ERROR_OUTPUT_ENABLED)
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "TAO_Metrics_LocalCache::set_logger:\n"
+ "must pass a non-zero orb and ior pointer\n"));
+ }
+#endif
+ return logger;
+}
+
+
+////////////////////////////////
+// class WSOA_Metrics_Handles //
+////////////////////////////////
+
+// Default constructor - registers all WSOA METRICS INSTRUMENTATION handles.
+
+WSOA_Metrics_Handles::WSOA_Metrics_Handles ()
+ : tiles_requested_ (0)
+ , compute_metrics_handle_(0)
+ , RTARM_triggered_adaptation_metrics_handle_(0)
+ , RTARM_region_transition_metrics_handle_(0)
+ , QuO_contract_eval_metrics_handle_(0)
+ , tile_request_delegate_metrics_handle_(0)
+ , image_received_metrics_handle_(0)
+ , image_processed_metrics_handle_(0)
+ , image_quiescent_metrics_handle_(0)
+ , tile_received_first_metrics_handle_(0)
+ , tile_queuing_first_metrics_handle_(0)
+ , tile_decompression_first_metrics_handle_(0)
+ , tile_decompression_handle_(0)
+ , tile_ipm_first_metrics_handle_(0)
+ , tile_processed_first_metrics_handle_(0)
+ , zlib_compression_handle_(0)
+ , zlib_decompression_handle_(0)
+{
+#ifdef TAO_USES_REPORTING_METRICS
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "TAO_compute_scheduling",
+ TAO_Metrics_Utils::SCHED,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ this->compute_metrics_handle_);
+
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "RTARM_triggered_adaptation",
+ TAO_Metrics_Utils::RTARM,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ this->RTARM_triggered_adaptation_metrics_handle_);
+
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "RTARM_region_transition",
+ TAO_Metrics_Utils::RTARM,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ this->RTARM_region_transition_metrics_handle_);
+
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "QuO_contract_eval",
+ TAO_Metrics_Utils::QUO,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ this->QuO_contract_eval_metrics_handle_);
+
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "tile_request_delegate",
+ TAO_Metrics_Utils::QUO,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ this->tile_request_delegate_metrics_handle_);
+
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "image_received",
+ TAO_Metrics_Utils::QUO,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ this->image_received_metrics_handle_);
+
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "image_processed",
+ TAO_Metrics_Utils::QUO,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ this->image_processed_metrics_handle_);
+
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "image_quiescent",
+ TAO_Metrics_Utils::QUO,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ this->image_quiescent_metrics_handle_);
+
+ char registration_name[64];
+ u_int i;
+
+ // Store the first tile received handle, and make room for the others.
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "tile_received_0",
+ TAO_Metrics_Utils::QUO,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ this->tile_received_first_metrics_handle_);
+
+ RtecScheduler::handle_t temp_metrics_handle = 0;
+ for (i = 1; i <= WSOA_METRICS_MAX_TILING_FACTOR; ++i)
+ {
+ ::sprintf (registration_name, "tile_received_%d", i);
+
+ // We just throw the handles away rather than storing them,
+ // as they're always calculated by offset from the first.
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ registration_name,
+ TAO_Metrics_Utils::QUO,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ temp_metrics_handle);
+ }
+
+ // Store the first tile processed handle, and make room for the others.
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "tile_processed_0",
+ TAO_Metrics_Utils::QUO,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ this->tile_processed_first_metrics_handle_);
+
+ for (i = 1; i <= WSOA_METRICS_MAX_TILING_FACTOR; ++i)
+ {
+ ::sprintf (registration_name, "tile_processed_%d", i);
+
+ // We just throw the handles away rather than storing them,
+ // as they're always calculated by offset from the first.
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ registration_name,
+ TAO_Metrics_Utils::QUO,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ temp_metrics_handle);
+ }
+
+ // Store the first tile processed handle, and make room for the others.
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "tile_queuing_0",
+ TAO_Metrics_Utils::QUO,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ this->tile_queuing_first_metrics_handle_);
+
+ for (i = 1; i <= WSOA_METRICS_MAX_TILING_FACTOR; ++i)
+ {
+ ::sprintf (registration_name, "tile_queuing_%d", i);
+
+ // We just throw the handles away rather than storing them,
+ // as they're always calculated by offset from the first.
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ registration_name,
+ TAO_Metrics_Utils::QUO,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ temp_metrics_handle);
+ }
+
+ // Store the first tile processed handle, and make room for the others.
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "tile_decompression_0",
+ TAO_Metrics_Utils::QUO,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ this->tile_decompression_first_metrics_handle_);
+
+ for (i = 1; i <= WSOA_METRICS_MAX_TILING_FACTOR; ++i)
+ {
+ ::sprintf (registration_name, "tile_decompression_%d", i);
+
+ // We just throw the handles away rather than storing them,
+ // as they're always calculated by offset from the first.
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ registration_name,
+ TAO_Metrics_Utils::QUO,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ temp_metrics_handle);
+ }
+
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "tile_ipm_0",
+ TAO_Metrics_Utils::QUO,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ this->tile_ipm_first_metrics_handle_);
+
+ for (i = 1; i <= WSOA_METRICS_MAX_TILING_FACTOR; ++i)
+ {
+ ::sprintf (registration_name, "tile_ipm_%d", i);
+
+ // We just throw the handles away rather than storing them,
+ // as they're always calculated by offset from the first.
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ registration_name,
+ TAO_Metrics_Utils::QUO,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ temp_metrics_handle);
+ }
+
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "zlib Compression",
+ TAO_Metrics_Utils::SCHED,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ this->zlib_compression_handle_);
+
+ REGISTER_METRICS_REPORTING_PROBE_RETURN(TAO_METRICS_REPORTING_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "zlib Compression",
+ TAO_Metrics_Utils::SCHED,
+ *TAO_METRICS_LOGGER_REF_SINGLETON::instance(),
+ this->zlib_decompression_handle_);
+#else /* ! TAO_USES_REPORTING_METRICS */
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "TAO_compute_scheduling",
+ TAO_Metrics_Utils::SCHED,
+ this->compute_metrics_handle_);
+
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "RTARM_triggered_adaptation",
+ TAO_Metrics_Utils::RTARM,
+ this->RTARM_triggered_adaptation_metrics_handle_);
+
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "RTARM_region_transition",
+ TAO_Metrics_Utils::RTARM,
+ this->RTARM_region_transition_metrics_handle_);
+
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "QuO_contract_eval",
+ TAO_Metrics_Utils::QUO,
+ this->QuO_contract_eval_metrics_handle_);
+
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "tile_request_delegate",
+ TAO_Metrics_Utils::QUO,
+ this->tile_request_delegate_metrics_handle_);
+
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "image_received",
+ TAO_Metrics_Utils::QUO,
+ this->image_received_metrics_handle_);
+
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "image_processed",
+ TAO_Metrics_Utils::QUO,
+ this->image_processed_metrics_handle_);
+
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "image_quiescent",
+ TAO_Metrics_Utils::QUO,
+ this->image_quiescent_metrics_handle_);
+
+ char registration_name[64];
+ u_int i;
+
+ // Store the first tile received handle, and make room for the others.
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "tile_received_0",
+ TAO_Metrics_Utils::QUO,
+ this->tile_received_first_metrics_handle_);
+
+ RtecScheduler::handle_t temp_metrics_handle;
+ for (i = 1; i <= WSOA_METRICS_MAX_TILING_FACTOR; ++i)
+ {
+ ::sprintf (registration_name, "tile_received_%d", i);
+
+ // We just throw the handles away rather than storing them,
+ // as they're always calculated by offset from the first.
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ registration_name,
+ TAO_Metrics_Utils::QUO,
+ temp_metrics_handle);
+ }
+
+ // Store the first tile processed handle, and make room for the others.
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "tile_processed_0",
+ TAO_Metrics_Utils::QUO,
+ this->tile_processed_first_metrics_handle_);
+
+ for (i = 1; i <= WSOA_METRICS_MAX_TILING_FACTOR; ++i)
+ {
+ ::sprintf (registration_name, "tile_processed_%d", i);
+
+ // We just throw the handles away rather than storing them,
+ // as they're always calculated by offset from the first.
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ registration_name,
+ TAO_Metrics_Utils::QUO,
+ temp_metrics_handle);
+ }
+
+ // Store the first tile processed handle, and make room for the others.
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "tile_queuing_0",
+ TAO_Metrics_Utils::QUO,
+ this->tile_queuing_first_metrics_handle_);
+
+ for (i = 1; i <= WSOA_METRICS_MAX_TILING_FACTOR; ++i)
+ {
+ ::sprintf (registration_name, "tile_queuing_%d", i);
+
+ // We just throw the handles away rather than storing them,
+ // as they're always calculated by offset from the first.
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ registration_name,
+ TAO_Metrics_Utils::QUO,
+ temp_metrics_handle);
+ }
+
+ // Store the first tile processed handle, and make room for the others.
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "tile_decompression_0",
+ TAO_Metrics_Utils::QUO,
+ this->tile_decompression_first_metrics_handle_);
+
+ for (i = 1; i <= WSOA_METRICS_MAX_TILING_FACTOR; ++i)
+ {
+ ::sprintf (registration_name, "tile_decompression_%d", i);
+
+ // We just throw the handles away rather than storing them,
+ // as they're always calculated by offset from the first.
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ registration_name,
+ TAO_Metrics_Utils::QUO,
+ temp_metrics_handle);
+ }
+
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "tile_ipm_0",
+ TAO_Metrics_Utils::QUO,
+ this->tile_ipm_first_metrics_handle_);
+
+ for (i = 1; i <= WSOA_METRICS_MAX_TILING_FACTOR; ++i)
+ {
+ ::sprintf (registration_name, "tile_ipm_%d", i);
+
+ // We just throw the handles away rather than storing them,
+ // as they're always calculated by offset from the first.
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ registration_name,
+ TAO_Metrics_Utils::QUO,
+ temp_metrics_handle);
+
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ registration_name,
+ TAO_Metrics_Utils::QUO,
+ tile_decompression_handle_);
+ }
+
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "zlib Compression",
+ TAO_Metrics_Utils::SCHED,
+ this->zlib_compression_handle_);
+
+ REGISTER_METRICS_PROBE_RETURN(TAO_METRICS_CACHE_SINGLETON_TYPE::instance(),
+ base_metrics,
+ "zlib Compression",
+ TAO_Metrics_Utils::SCHED,
+ this->zlib_decompression_handle_);
+#endif /* TAO_USES_REPORTING_METRICS */
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/Metrics/Metrics_Utils.i"
+#endif /* __ACE_INLINE__ */
+
+#else
+#error ACE_COMPILE_TIMEPROBES must be defined in order to collect metrics
+#endif /* ACE_ENABLE_TIMEPROBES & ACE_COMPILE_TIMEPROBES */
+#endif /* ACE_METRICS_COLLECTION */
+
+#endif /* METRICS_UTILS_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_Utils.h b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_Utils.h
new file mode 100644
index 00000000000..5e0e0ebd36d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_Utils.h
@@ -0,0 +1,187 @@
+// -*- C++ -*-
+
+// $Id$
+
+#ifndef METRICS_UTILS_H
+#define METRICS_UTILS_H
+
+
+#if defined (ACE_METRICS_COLLECTION)
+
+#if defined (ACE_ENABLE_TIMEPROBES) && defined (ACE_COMPILE_TIMEPROBES)
+
+#if ! defined (VXWORKS)
+
+// Comment out both of these to disable output
+# define METRICS_UTILS_ERROR_OUTPUT_ENABLED
+# define METRICS_UTILS_DEBUG_OUTPUT_ENABLED
+
+#endif /* ! VXWORKS */
+
+#include "ace/OS.h"
+#include "ace/Singleton.h"
+#include "orbsvcs/RtecSchedulerC.h"
+#include "orbsvcs/MetricsC.h"
+#include "orbsvcs/Metrics/metrics_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Metrics_Export TAO_Metrics_Utils
+{
+ // = TITLE
+ // Defines a class for various metrics utility functions.
+ //
+ // = DESCRIPTION
+ // This class provides static methods for various general
+ // purpose tasks for managing and using the metrics framework.
+
+public:
+
+ // Type declarations
+
+ enum Base_Metrics_Type {SCHED, QUO, RTARM, TNS, TEEC};
+
+ static const u_int METRICS_BUFSIZE;
+ // Constant size for local buffers.
+
+ static const u_int METRICS_ENQUEUE_PROBE_ID_BASE;
+ static const u_int METRICS_DEQUEUE_PROBE_ID_BASE;
+ static const u_int METRICS_SCHED_PROBE_ID_BASE;
+ static const u_int METRICS_QUO_PROBE_ID_BASE;
+ static const u_int METRICS_TNS_PROBE_ID_BASE;
+ static const u_int METRICS_TEEC_PROBE_ID_BASE;
+ static const u_int METRICS_RTARM_PROBE_ID_BASE;
+ static const u_int METRICS_UPCALL_MONITOR_ADAPTER_ID_BASE;
+ // Constants for offsets into ranges of probe ids.
+
+ static void set_mission_state (int i, Metrics::QoSLogger_ptr logger);
+ // Sets the mission state in the logger referenced by the passed pointer.
+
+ static void set_mission_state (int i, const char * logger_ior_str);
+ // Sets the mission state in the logger referenced by the passed ior string.
+
+ static Metrics::QoSLogger_var get_logger (const char * logger_ior_str,
+ CORBA::ORB_ptr orb_);
+ // Gets a pointer to a logger from the passed logger ior string,
+ // using the passed ORB.
+
+ static RtecScheduler::handle_t timeoutEvent (void);
+ // Accessor for static timeout event handle. This handle is ignored
+ // by the QoS monitor, since by definition it will be dispatched
+ // after the end-of-frame.
+
+ static void timeoutEvent (RtecScheduler::handle_t handle);
+ // Mutator for static timeout event handle. This handle is ignored
+ // by the QoS monitor, since by definition it will be dispatched
+ // after the end-of-frame.
+
+private:
+
+ static RtecScheduler::handle_t timeoutEvent_;
+};
+
+
+struct TAO_Metrics_Export WSOA_Metrics_Handles
+{
+ // = TITLE
+ // Defines a helper class for WSOA METRICS INSTRUMENTATION.
+ //
+ // = DESCRIPTION
+ // This class provides a single point of initialization (registration)
+ // and storage for the handles used in WSOA metrics collection. It is necessary
+ // to define this class at this level to cross-cut multiple layers of the
+ // architecture and provide consistent points of instrumentation across layers.
+
+public:
+
+ WSOA_Metrics_Handles ();
+ // Default constructor - registers all handles.
+
+ // number of tile handles to reserve in each category.
+ static const u_int WSOA_METRICS_MAX_TILING_FACTOR;
+
+ // global attribute to decide when image is downloaded.
+ u_long tiles_requested_;
+
+ // Globally accessible handles for METRICS INSTRUMENTATION
+ RtecScheduler::handle_t compute_metrics_handle_;
+ RtecScheduler::handle_t RTARM_triggered_adaptation_metrics_handle_;
+ RtecScheduler::handle_t RTARM_region_transition_metrics_handle_;
+ RtecScheduler::handle_t QuO_contract_eval_metrics_handle_;
+ RtecScheduler::handle_t tile_request_delegate_metrics_handle_;
+ RtecScheduler::handle_t image_received_metrics_handle_;
+ RtecScheduler::handle_t image_processed_metrics_handle_;
+ RtecScheduler::handle_t image_quiescent_metrics_handle_;
+ RtecScheduler::handle_t tile_received_first_metrics_handle_;
+ RtecScheduler::handle_t tile_queuing_first_metrics_handle_;
+ RtecScheduler::handle_t tile_decompression_first_metrics_handle_;
+ RtecScheduler::handle_t tile_decompression_handle_;
+ RtecScheduler::handle_t tile_ipm_first_metrics_handle_;
+ RtecScheduler::handle_t tile_processed_first_metrics_handle_;
+
+ RtecScheduler::handle_t zlib_compression_handle_;
+ RtecScheduler::handle_t zlib_decompression_handle_;
+};
+
+typedef ACE_Singleton<WSOA_Metrics_Handles, ACE_SYNCH_MUTEX>
+WSOA_METRICS_HANDLES_SINGLETON;
+
+/**
+ * NOTE: This is a simple macro which calls the appropriate registration function with the cache to
+ * store the data from this pointer. At the ACE level there is no need to give a PROBE_TYPE
+ * because there is only one probe type (ACE_Timeprobe).
+ *
+ * USAGE_LEVEL: TAO
+ *
+ * Q1: Where is this and the next macro used? One example is on TAO/orbsvcs/orbsvcs/Metrics. No where in the ace code.
+ * So is this a ACE or TAO macro?
+ *
+ * Q2: Is the function (register + METRICS_REGION) a ACE or TAO?
+ * A2: TAO. Define in Metrics_Local_Cache_T.h. The only METRICS_REGION that exists is 'base_metrics'. Used
+ * in $TAO_ROOT/orbsvcs/orbsvcs/Metrics/Metrics_Utils.cpp
+ *
+ * @param METRICS_PTR - Initialized pointer to the Metrics_Cache. This pointer is used to register the probe
+ * with the associated cache.
+ * @param METIRCS_REGION - At present there is only one 'base_metrics'.
+ * @param PROBE_NAME - String name of the probe
+ * @param PROBE_TYPE - Unsigned integer representing the probe type
+ * @param METRICS_HANDLE - Variable used to contain the metrics probe handle that is the result of this function
+ * The type of the handle is a RtecScheduler::handle_t
+ */
+# define REGISTER_METRICS_PROBE_RETURN(METRICS_PTR,METRICS_REGION,PROBE_NAME,PROBE_TYPE,METRICS_HANDLE) \
+do { if((METRICS_PTR->metrics_enabled())) { \
+METRICS_HANDLE = METRICS_PTR-> \
+register_##METRICS_REGION ( \
+PROBE_NAME, \
+PROBE_TYPE); \
+} } while (0)
+
+/**
+ * Same as above but instead of just reporting information to a cache there is also reference to a Metrics_Loger (TAO feature).
+ * The logger is used to record the information. The type of probe is register with the logger
+ *
+ * USAGE_LEVEL: TAO
+ */
+# define REGISTER_METRICS_REPORTING_PROBE_RETURN(METRICS_PTR,METRICS_REGION,PROBE_NAME,PROBE_TYPE,METRICS_LOGGER_REF,METRICS_HANDLE) \
+do { if((METRICS_PTR->metrics_enabled())) { \
+METRICS_HANDLE = METRICS_PTR-> \
+register_##METRICS_REGION## ( \
+PROBE_NAME, \
+PROBE_TYPE, \
+METRICS_LOGGER_REF); \
+} } while (0)
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Metrics/Metrics_Utils.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* ACE_ENABLE_TIMEPROBES & ACE_COMPILE_TIMEPROBES */
+#endif /* ACE_METRICS_COLLECTION */
+
+#endif /* METRICS_UTILS_H */
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/Metrics_Utils.i b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_Utils.i
new file mode 100644
index 00000000000..04a77bddb52
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/Metrics_Utils.i
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef METRICS_UTILS_I
+#define METRICS_UTILS_I
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/////////////////////////////
+// Class TAO_Metrics_Utils //
+/////////////////////////////
+
+// Accessor for static timeout event handle. This handle is ignored
+// by the QoS monitor, since by definition it will be dispatched
+// after the end-of-frame.
+
+ACE_INLINE
+RtecScheduler::handle_t
+TAO_Metrics_Utils::timeoutEvent (void)
+{
+ return TAO_Metrics_Utils::timeoutEvent_;
+}
+
+
+// Mutator for static timeout event handle. This handle is ignored
+// by the QoS monitor, since by definition it will be dispatched
+// after the end-of-frame.
+
+ACE_INLINE
+void
+TAO_Metrics_Utils::timeoutEvent (RtecScheduler::handle_t handle)
+{
+ TAO_Metrics_Utils::timeoutEvent_ = handle;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* METRICS_UTILS_I */
diff --git a/TAO/orbsvcs/orbsvcs/Metrics/metrics_export.h b/TAO/orbsvcs/orbsvcs/Metrics/metrics_export.h
new file mode 100644
index 00000000000..846c6c45427
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Metrics/metrics_export.h
@@ -0,0 +1,50 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TAO_Metrics
+// ------------------------------
+#ifndef TAO_METRICS_EXPORT_H
+#define TAO_METRICS_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if !defined (TAO_METRICS_HAS_DLL)
+# define TAO_METRICS_HAS_DLL 1
+#endif /* ! TAO_METRICS_HAS_DLL */
+
+#if defined (TAO_METRICS_HAS_DLL) && (TAO_METRICS_HAS_DLL == 1)
+# if defined (TAO_METRICS_BUILD_DLL)
+# define TAO_Metrics_Export ACE_Proper_Export_Flag
+# define TAO_METRICS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_METRICS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_METRICS_BUILD_DLL */
+# define TAO_Metrics_Export ACE_Proper_Import_Flag
+# define TAO_METRICS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_METRICS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_METRICS_BUILD_DLL */
+#else /* TAO_METRICS_HAS_DLL == 1 */
+# define TAO_Metrics_Export
+# define TAO_METRICS_SINGLETON_DECLARATION(T)
+# define TAO_METRICS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_METRICS_HAS_DLL == 1 */
+
+// Set TAO_METRICS_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TAO_METRICS_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TAO_METRICS_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TAO_METRICS_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TAO_METRICS_NTRACE */
+
+#if (TAO_METRICS_NTRACE == 1)
+# define TAO_METRICS_TRACE(X)
+#else /* (TAO_METRICS_NTRACE == 1) */
+# define TAO_METRICS_TRACE(X) ACE_TRACE_IMPL(X)
+#endif /* (TAO_METRICS_NTRACE == 1) */
+
+#endif /* TAO_METRICS_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Bindings_Iterator_T.cpp b/TAO/orbsvcs/orbsvcs/Naming/Bindings_Iterator_T.cpp
new file mode 100644
index 00000000000..bee9ae0c932
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Bindings_Iterator_T.cpp
@@ -0,0 +1,232 @@
+// $Id$
+
+#ifndef TAO_BINDINGS_ITERATOR_T_CPP
+#define TAO_BINDINGS_ITERATOR_T_CPP
+
+#include "orbsvcs/Naming/Bindings_Iterator_T.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class ITERATOR, class TABLE_ENTRY>
+TAO_Bindings_Iterator<ITERATOR, TABLE_ENTRY>::TAO_Bindings_Iterator (
+ TAO_Hash_Naming_Context *context,
+ ITERATOR *hash_iter,
+ PortableServer::POA_ptr poa,
+ TAO_SYNCH_RECURSIVE_MUTEX &lock)
+ : destroyed_ (0),
+ context_ (context),
+ hash_iter_ (hash_iter),
+ lock_ (lock),
+ poa_ (PortableServer::POA::_duplicate (poa))
+
+{
+}
+
+template <class ITERATOR, class TABLE_ENTRY>
+TAO_Bindings_Iterator<ITERATOR, TABLE_ENTRY>::~TAO_Bindings_Iterator (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ delete hash_iter_;
+
+ // Since we are going away, decrement the reference count on the
+ // Naming Context we were iterating over.
+ context_->interface ()->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// Return the Default POA of this Servant
+template <class ITERATOR, class TABLE_ENTRY> PortableServer::POA_ptr
+TAO_Bindings_Iterator<ITERATOR, TABLE_ENTRY>::_default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
+
+template <class ITERATOR, class TABLE_ENTRY> CORBA::Boolean
+TAO_Bindings_Iterator<ITERATOR, TABLE_ENTRY>::next_one (
+ CosNaming::Binding_out b
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosNaming::Binding *binding;
+
+ // Allocate a binding to be returned (even if there no more
+ // bindings, we need to allocate an out parameter.)
+ ACE_NEW_THROW_EX (binding,
+ CosNaming::Binding,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ b = binding;
+
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX,
+ ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ // Check to make sure this object is still valid.
+ if (this->destroyed_)
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (), 0);
+
+ // If the context we are iterating over has been destroyed,
+ // self-destruct.
+ if (context_->destroyed ())
+ {
+ destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (), 0);
+ }
+
+ // If there are no more bindings.
+ if (hash_iter_->done ())
+ {
+ b->binding_type = CosNaming::nobject;
+ b->binding_name.length (0);
+ return 0;
+ }
+ else
+ {
+ // Return a binding.
+ TABLE_ENTRY *hash_entry = 0;
+ hash_iter_->next (hash_entry);
+
+ if (populate_binding (hash_entry, *binding) == 0)
+ ACE_THROW_RETURN (CORBA::NO_MEMORY (), 0);
+
+ hash_iter_->advance ();
+ return 1;
+ }
+}
+
+template <class ITERATOR, class TABLE_ENTRY> CORBA::Boolean
+TAO_Bindings_Iterator<ITERATOR, TABLE_ENTRY>::next_n (
+ CORBA::ULong how_many,
+ CosNaming::BindingList_out bl
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // We perform an allocation before obtaining the lock so that an out
+ // parameter is allocated in case we fail to obtain the lock.
+ ACE_NEW_THROW_EX (bl,
+ CosNaming::BindingList (0),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+ // Obtain the lock.
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX,
+ ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ // Check to make sure this object is still valid.
+ if (this->destroyed_)
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (), 0);
+
+ // If the context we are iterating over has been destroyed,
+ // self-destruct.
+ if (context_->destroyed ())
+ {
+ destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (), 0);
+ }
+
+ // Check for illegal parameter values.
+ if (how_many == 0)
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);
+
+ // If there are no more bindings...
+ if (hash_iter_->done ())
+ return 0;
+ else
+ {
+ // Initially assume that the iterator has the requested number of
+ // bindings.
+ bl->length (how_many);
+
+ TABLE_ENTRY *hash_entry = 0;
+
+ // Iterate and populate the BindingList.
+ for (CORBA::ULong i = 0; i < how_many; i++)
+ {
+ hash_iter_->next (hash_entry);
+
+ if (populate_binding (hash_entry, bl[i]) == 0)
+ ACE_THROW_RETURN (CORBA::NO_MEMORY (), 0);
+
+ if (hash_iter_->advance () == 0)
+ {
+ // If no more bindings are left, reset length to the actual
+ // number of bindings populated, and get out of the loop.
+ bl->length (i + 1);
+ break;
+ }
+ }
+ return 1;
+ }
+}
+
+template <class ITERATOR, class TABLE_ENTRY> void
+TAO_Bindings_Iterator<ITERATOR, TABLE_ENTRY>::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX,
+ ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Check to make sure this object is still valid.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ // Mark the object invalid.
+ this->destroyed_ = 1;
+
+ 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;
+}
+
+template <class ITERATOR, class TABLE_ENTRY> int
+TAO_Bindings_Iterator<ITERATOR, TABLE_ENTRY>::populate_binding (
+ TABLE_ENTRY *hash_entry,
+ CosNaming::Binding &b)
+{
+ b.binding_type = hash_entry->int_id_.type_;
+ b.binding_name.length (1);
+
+ // Here we perform a check before assignment to make sure
+ // CORBA::string_dup is not called on 0 pointer, since the spec does
+ // not say what should happen in that case.
+ if (hash_entry->ext_id_.id () != 0)
+ {
+ b.binding_name[0].id =
+ hash_entry->ext_id_.id ();
+ if (b.binding_name[0].id.in () == 0)
+ return 0;
+ }
+ if (hash_entry->ext_id_.kind () != 0)
+ {
+ b.binding_name[0].kind =
+ hash_entry->ext_id_.kind ();
+ if (b.binding_name[0].kind.in () == 0)
+ return 0;
+ }
+ return 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_BINDINGS_ITERATOR_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Bindings_Iterator_T.h b/TAO/orbsvcs/orbsvcs/Naming/Bindings_Iterator_T.h
new file mode 100644
index 00000000000..6bed837d729
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Bindings_Iterator_T.h
@@ -0,0 +1,145 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Bindings_Iterator_T.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_BINDINGS_ITERATOR_T_H
+#define TAO_BINDINGS_ITERATOR_T_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Naming/Hash_Naming_Context.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Bindings_Iterator
+ *
+ * @brief This class implements the <BindingIterator> interface that is
+ * part of the <CosNaming> idl module. This class works with Hash_Map-based
+ * implementations of CosNaming::NamingContext.
+ *
+ * This class is templatized by the types of the underlying
+ * hash table iterator and hash table entry, so that it can be
+ * used for both TAO_Transient_Naming_Context and
+ * TAO_Persistent_Naming_Context (and any other classes with
+ * underlying data structures supporting
+ * ACE_Hash_Map_Manager/Iterator - like interfaces).
+ *
+ * Instances of <TAO_Bindings_Iterator>s affect reference counts
+ * of corresponding Naming Contexts. Reference count on a
+ * Naming Context is incremented by one for a lifetime of each
+ * instance of <TAO_Bindings_Iterator> created for that
+ * context, i.e., a Naming Context cannot
+ * be cleaned up (but, of course, it can be invalidated) before
+ * all of its iterators have been cleaned up. When <destroy>
+ * method is invoked on a Naming Context, all of its iterators are
+ * destroyed in a "lazy evaluation" fashion, i.e., whenever a next
+ * operation is invoked on an iterator, and it can detect that
+ * the corresponding Naming Context has been invalidated, the
+ * iterator is destroyed.
+ */
+template <class ITERATOR, class TABLE_ENTRY>
+class TAO_Bindings_Iterator : public virtual POA_CosNaming::BindingIterator
+{
+public:
+ // = Intialization and termination methods.
+ /**
+ * Constructor expects a pointer to a
+ * dynamically allocated hash map iterator (destructor
+ * deallocates hash map iterator).
+ */
+ TAO_Bindings_Iterator (TAO_Hash_Naming_Context *context,
+ ITERATOR *hash_iter,
+ PortableServer::POA_ptr poa,
+ TAO_SYNCH_RECURSIVE_MUTEX &lock);
+
+
+ /// Destructor.
+ ~TAO_Bindings_Iterator (void);
+
+ /// Returns the Default POA of this Servant object
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+
+ // = Idl methods.
+
+ /// This operation passes back the next unseen binding. True is
+ /// returned if a binding is passed back, and false is returned otherwise.
+ CORBA::Boolean next_one (CosNaming::Binding_out b
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * This operation passes back at most <how_many> unseen bindings.
+ * True is returned if bindings were passed back, and false is
+ * returned if no bindings were passed back.
+ */
+ CORBA::Boolean next_n (CORBA::ULong how_many,
+ CosNaming::BindingList_out bl
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// This operation destroys the iterator.
+ void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // = Helper method.
+
+ /**
+ * Helper function used by TAO_*_Naming_Context and
+ * TAO_BindingIterator: populate a binding <b> with info contained
+ * in <hash_entry>. Return 1 if everything went smoothly, 0 if an
+ * allocation failed.
+ */
+ static int populate_binding (TABLE_ENTRY *hash_entry,
+ CosNaming::Binding &b);
+
+private:
+ /**
+ * Flag indicating whether this iterator is still valid. (The
+ * iterator becomes invalid when <destroy> method has been invoked
+ * on it, or when <destroy> method has been invoked on the
+ * corresponding Naming Context.) This flag is necessary
+ * because immediate destruction of this servant might not be possible
+ * due to pending requests in the POA.
+ */
+ int destroyed_;
+
+ /**
+ * Pointer to the Naming Context we are iterating over. We need
+ * this pointer to make sure the context is still valid before
+ * each iteration, and to decrement its reference count once we are <destroyed>.
+ */
+ TAO_Hash_Naming_Context *context_;
+
+ /// A pointer to the hash map iterator.
+ ITERATOR *hash_iter_;
+
+ /// Lock passed on from Naming Context to serialize access to the
+ /// internal data structure.
+ TAO_SYNCH_RECURSIVE_MUTEX &lock_;
+
+ /// Implement a different _default_POA().
+ PortableServer::POA_var poa_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Naming/Bindings_Iterator_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Bindings_Iterator_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_BINDINGS_ITERATOR_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Entries.cpp b/TAO/orbsvcs/orbsvcs/Naming/Entries.cpp
new file mode 100644
index 00000000000..5fddba2a270
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Entries.cpp
@@ -0,0 +1,127 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// Entries.cpp
+//
+// = AUTHOR
+// Marina Spivak <marina@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Entries.h"
+
+ACE_RCSID(Naming, Entries, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_IntId::TAO_IntId (void)
+ : type_ (CosNaming::nobject)
+{
+ ref_ = CORBA::Object::_nil ();
+}
+
+TAO_IntId::TAO_IntId (CORBA::Object_ptr obj,
+ CosNaming::BindingType type)
+ : type_ (type)
+{
+ ref_ = CORBA::Object::_duplicate (obj);
+}
+
+TAO_IntId::TAO_IntId (const TAO_IntId &rhs)
+{
+ type_ = rhs.type_;
+ ref_ = CORBA::Object::_duplicate (rhs.ref_);
+}
+
+TAO_IntId::~TAO_IntId (void)
+{
+ CORBA::release (ref_);
+}
+
+void
+TAO_IntId::operator= (const TAO_IntId &rhs)
+{
+ // check for self assignment.
+ if (&rhs == this)
+ return;
+
+ type_ = rhs.type_;
+
+ CORBA::release (ref_);
+ ref_ = CORBA::Object::_duplicate (rhs.ref_);
+}
+
+TAO_ExtId::TAO_ExtId (void)
+ : kind_ (),
+ id_ ()
+{
+}
+
+TAO_ExtId::TAO_ExtId (const char *id,
+ const char *kind)
+ : kind_ (kind),
+ id_ (id)
+{
+}
+
+TAO_ExtId::TAO_ExtId (const TAO_ExtId &rhs)
+{
+ id_ = rhs.id_;
+ kind_ = rhs.kind_;
+}
+
+TAO_ExtId::~TAO_ExtId (void)
+{
+}
+
+const char *
+TAO_ExtId::id (void)
+{
+ return id_.fast_rep ();
+}
+
+const char *
+TAO_ExtId::kind (void)
+{
+ return kind_.fast_rep ();
+}
+
+void
+TAO_ExtId::operator= (const TAO_ExtId &rhs)
+{
+ // Check for self assignment.
+ if (&rhs == this)
+ return;
+
+ id_ = rhs.id_;
+ kind_ = rhs.kind_;
+}
+
+bool
+TAO_ExtId::operator== (const TAO_ExtId &rhs) const
+{
+ return id_ == rhs.id_ && kind_ == rhs.kind_;
+}
+
+bool
+TAO_ExtId::operator!= (const TAO_ExtId &rhs) const
+{
+ return id_ != rhs.id_ || kind_ != rhs.kind_;
+}
+
+u_long
+TAO_ExtId::hash (void) const
+{
+ ACE_CString temp (id_);
+ temp += kind_;
+
+ return temp.hash ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Entries.h b/TAO/orbsvcs/orbsvcs/Naming/Entries.h
new file mode 100644
index 00000000000..e41d9bdf258
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Entries.h
@@ -0,0 +1,139 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Entries.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_ENTRIES_H
+#define TAO_ENTRIES_H
+#include /**/ "ace/pre.h"
+
+#include "ace/Hash_Map_Manager.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/SString.h"
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Naming/naming_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_IntId
+ *
+ * @brief Helper class for TAO_Transient_Bindings_Map: unifies several
+ * data items, so they can be stored together as a <value>
+ * for a <key> in a hash table holding the state of a Transient
+ * Naming Context.
+ *
+ * This class holds CORBA Object pointer and a binding type, so
+ * they can be stored together as a <value> for a <key> in a
+ * hash table holding the state of a Transient Naming Context.
+ */
+class TAO_Naming_Serv_Export TAO_IntId
+{
+public:
+ // = Initialization and termination methods.
+ /// Constructor.
+ TAO_IntId (void);
+
+ /// Constructor.
+ TAO_IntId (CORBA::Object_ptr obj,
+ CosNaming::BindingType type /* = CosNaming::nobject */);
+
+ /// Copy constructor.
+ TAO_IntId (const TAO_IntId & rhs);
+
+ /// Destructor.
+ ~TAO_IntId (void);
+
+ /// Assignment operator (does copy memory).
+ void operator= (const TAO_IntId & rhs);
+
+ // = Data members.
+
+ /// Object reference to be stored in a Transient Naming Context.
+ CORBA::Object_ptr ref_;
+
+ /// Binding type for <ref_>.
+ CosNaming::BindingType type_;
+};
+
+/**
+ * @class TAO_ExtId
+ *
+ * @brief Helper class for TAO_Transient_Bindings_Map: unifies several
+ * data items, so they can be stored together as a <key>
+ * for a <value> in a hash table holding the state of a Transient
+ * Naming Context.
+ *
+ * This class holds id and kind strings, so
+ * they can be stored together as a <key> for a <value> in a
+ * hash table holding the state of a Transient Naming Context.
+ */
+class TAO_Naming_Serv_Export TAO_ExtId
+{
+public:
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_ExtId (void);
+
+ /// Constructor.
+ TAO_ExtId (const char *id,
+ const char *kind);
+
+ /// Copy constructor.
+ TAO_ExtId (const TAO_ExtId & rhs);
+
+ /// Destructor.
+ ~TAO_ExtId (void);
+
+ // = Assignment and comparison operators.
+
+ /// Assignment operator (does copy memory).
+ void operator= (const TAO_ExtId & rhs);
+
+ /// Equality comparison operator (must match both id_ and kind_).
+ bool operator== (const TAO_ExtId &rhs) const;
+
+ /// Inequality comparison operator.
+ bool operator!= (const TAO_ExtId &rhs) const;
+
+ /// <hash> function is required in order for this class to be usable by
+ /// ACE_Hash_Map_Manager.
+ u_long hash (void) const;
+
+ // = Data members.
+
+ /// <kind> portion of the name to be associated with some object
+ /// reference in a Transient Naming Context.
+ ACE_CString kind_;
+
+ /// <id> portion of the name to be associated with some object
+ /// reference in a Transient Naming Context.
+ ACE_CString id_;
+
+ // = Accessors
+
+ /// Return <id_> in a const char * format.
+ const char * id (void);
+
+ /// Return <kind_> in a const char * format.
+ const char * kind (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_ENTRIES_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp b/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp
new file mode 100644
index 00000000000..6d5ccc82e09
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp
@@ -0,0 +1,361 @@
+// $Id$
+
+//-----------------------------------------------------------------------------
+// Flat File class implementations
+//-----------------------------------------------------------------------------
+#include "orbsvcs/Naming/Flat_File_Persistence.h"
+
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_sys_stat.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_fcntl.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_NS_FlatFileStream::TAO_NS_FlatFileStream (const ACE_CString & file,
+ const char * mode)
+ : fl_ (0)
+{
+ ACE_TRACE("TAO_NS_FlatFileStream");
+ file_ = file;
+ mode_ = mode;
+}
+
+TAO_NS_FlatFileStream::~TAO_NS_FlatFileStream ()
+{
+ ACE_TRACE("~TAO_NS_FlatFileStream");
+ if ( fl_ != 0 )
+ this->close();
+}
+
+void
+TAO_NS_FlatFileStream::remove ()
+{
+ ACE_TRACE("remove");
+ ACE_OS::unlink(ACE_TEXT_CHAR_TO_TCHAR(file_.c_str()));
+}
+
+int
+TAO_NS_FlatFileStream::exists ()
+{
+ ACE_TRACE("exists");
+ // We could check the mode for this file, but for now just check exists
+ return ! ACE_OS::access(file_.c_str(), F_OK);
+}
+
+int
+TAO_NS_FlatFileStream::open()
+{
+ ACE_TRACE("open");
+ // For now, three flags exist "r", "w", and "c"
+ int flags = 0;
+ const char *fdmode = 0;
+ if( strchr(mode_.c_str(), 'r') )
+ if( strchr(mode_.c_str(), 'w') )
+ flags = O_RDWR, fdmode = "r+";
+ else
+ flags = O_RDONLY, fdmode = "r";
+ else
+ flags = O_WRONLY, fdmode = "w";
+ if( strchr(mode_.c_str(), 'c') )
+ flags |= O_CREAT;
+#ifndef ACE_WIN32
+ if( ACE_OS::flock_init (&filelock_, flags, ACE_TEXT_CHAR_TO_TCHAR(file_.c_str()), 0666) != 0 )
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open file %s for mode %s: (%d) %s\n",
+ file_.c_str(), mode_.c_str(),
+ errno, ACE_OS::strerror(errno)),
+ -1);
+#else
+ if( (filelock_.handle_= ACE_OS::open (ACE_TEXT_CHAR_TO_TCHAR(file_.c_str()), flags, 0)) == ACE_INVALID_HANDLE )
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open file %s for mode %s: (%d) %s\n",
+ file_.c_str(), mode_.c_str(),
+ errno, ACE_OS::strerror(errno)),
+ -1);
+#endif
+ this->fl_ = ACE_OS::fdopen(filelock_.handle_, ACE_TEXT_CHAR_TO_TCHAR(fdmode));
+ if (this->fl_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot fdopen file %s for mode %s: (%d) %s\n",
+ file_.c_str(), mode_.c_str(),
+ errno, ACE_OS::strerror(errno)),
+ -1);
+ return 0;
+}
+
+int
+TAO_NS_FlatFileStream::close()
+{
+ ACE_TRACE("close");
+ ACE_OS::fflush(fl_);
+#ifndef ACE_WIN32
+ ACE_OS::flock_destroy (&filelock_, 0);
+#endif
+ ACE_OS::fclose (fl_); // even though flock_destroy closes the handle
+ // we still need to destroy the FILE*
+
+ fl_ = 0;
+ return 0;
+}
+
+int
+TAO_NS_FlatFileStream::flock (int whence, int start, int len)
+{
+ ACE_TRACE("flock");
+#if defined (ACE_WIN32)
+ ACE_UNUSED_ARG (whence);
+ ACE_UNUSED_ARG (start);
+ ACE_UNUSED_ARG (len);
+#else
+ if( ACE_OS::strcmp(mode_.c_str(), "r") == 0 )
+ ACE_OS::flock_rdlock(&filelock_, whence, start, len);
+ else
+ ACE_OS::flock_wrlock(&filelock_, whence, start, len);
+#endif
+ return 0;
+}
+
+int
+TAO_NS_FlatFileStream::funlock (int whence, int start, int len)
+{
+ ACE_TRACE("funlock");
+#if defined (ACE_WIN32)
+ ACE_UNUSED_ARG (whence);
+ ACE_UNUSED_ARG (start);
+ ACE_UNUSED_ARG (len);
+#else
+ ACE_OS::flock_unlock(&filelock_, whence, start, len);
+#endif
+ return 0;
+}
+
+time_t
+TAO_NS_FlatFileStream::last_changed(void)
+{
+ ACE_TRACE("TAO_NS_FlatFileStream::last_changed");
+ ACE_stat st;
+ ACE_OS::fstat(filelock_.handle_, &st);
+#if !defined (ACE_HAS_WINCE)
+ return st.st_mtime;
+#else
+ return st.st_mtime.sec ();
+#endif /* ACE_HAS_WINCE */
+}
+
+TAO_Storable_Base &
+TAO_NS_FlatFileStream::operator <<(
+ const TAO_NS_Persistence_Header &header)
+{
+ ACE_TRACE("TAO_NS_FlatFileStream::operator <<");
+ ACE_OS::rewind(this->fl_);
+ ACE_OS::fprintf(this->fl_, "%d\n%d\n", header.size(), header.destroyed());
+ ACE_OS::fflush(this->fl_);
+
+ return *this;
+}
+
+TAO_Storable_Base &
+TAO_NS_FlatFileStream::operator >>(
+ TAO_NS_Persistence_Header &header)
+{
+ ACE_TRACE("TAO_NS_FlatFileStream::operator >>");
+ unsigned int size;
+ int destroyed;
+
+ ACE_OS::rewind(this->fl_);
+ switch (fscanf(fl_, "%u\n", &size))
+ {
+ case 0:
+ this->setstate (badbit);
+ return *this;
+ case EOF:
+ this->setstate (eofbit);
+ return *this;
+ }
+ header.size(size);
+
+ switch (fscanf(fl_, "%d\n", &destroyed))
+ {
+ case 0:
+ this->setstate (badbit);
+ return *this;
+ case EOF:
+ this->setstate (eofbit);
+ return *this;
+ }
+ header.destroyed(destroyed);
+
+ return *this;
+
+}
+
+TAO_Storable_Base &
+TAO_NS_FlatFileStream::operator <<(
+ const TAO_NS_Persistence_Record &record)
+{
+ ACE_TRACE("TAO_NS_FlatFileStream::operator <<");
+ TAO_NS_Persistence_Record::Record_Type type = record.type();
+ ACE_OS::fprintf(this->fl_, "%d\n", type);
+
+ ACE_CString id = record.id();
+ ACE_OS::fprintf(this->fl_, ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT("\n%s\n"),
+ id.length(), id.c_str());
+
+ ACE_CString kind = record.kind();
+ ACE_OS::fprintf(this->fl_, ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("\n%s\n"),
+ kind.length(), kind.c_str());
+
+ ACE_CString ref = record.ref();
+ ACE_OS::fprintf(this->fl_, ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT ("\n%s\n"),
+ ref.length(), ref.c_str());
+
+ ACE_OS::fflush(this->fl_);
+
+ return *this;
+}
+
+TAO_Storable_Base &
+TAO_NS_FlatFileStream::operator >>(
+ TAO_NS_Persistence_Record &record)
+{
+ ACE_TRACE("TAO_NS_FlatFileStream::operator >>");
+ TAO_NS_Persistence_Record::Record_Type type;
+ int temp_type_in;
+ switch (fscanf(fl_, "%d\n", &temp_type_in))
+ {
+ case 0:
+ this->setstate (badbit);
+ return *this;
+ case EOF:
+ this->setstate (eofbit);
+ return *this;
+ }
+ type = (TAO_NS_Persistence_Record::Record_Type) temp_type_in;
+ record.type(type);
+
+ int bufSize = 0;
+
+ //id
+ switch (fscanf(fl_, "%d\n", &bufSize))
+ {
+ case 0:
+ this->setstate (badbit);
+ return *this;
+ case EOF:
+ this->setstate (eofbit);
+ return *this;
+ }
+ char *id = new char[bufSize+1];
+ //char *id;
+ //ACE_NEW_RETURN (id, char[bufSize+1], 1);
+ if (ACE_OS::fgets(ACE_TEXT_CHAR_TO_TCHAR(id), bufSize+1, fl_) == 0 &&
+ bufSize != 0)
+ {
+ this->setstate (badbit);
+ return *this;
+ }
+ ACE_CString newId(id);
+ record.id(newId);
+ delete [] id;
+
+ //kind
+ switch (fscanf(fl_, "%d\n", &bufSize))
+ {
+ case 0:
+ this->setstate (badbit);
+ return *this;
+ case EOF:
+ this->setstate (eofbit);
+ return *this;
+ }
+ char *kind = new char[bufSize+1];
+ //char *kind;
+ //ACE_NEW (kind, char[bufSize+1]);
+ if (ACE_OS::fgets(ACE_TEXT_CHAR_TO_TCHAR(kind), bufSize+1, fl_) == 0 &&
+ bufSize != 0)
+ {
+ this->setstate (badbit);
+ return *this;
+ }
+ kind[bufSize] = '\0';
+ ACE_CString newKind(kind);
+ record.kind(newKind);
+ delete [] kind;
+
+ //ref
+ switch (fscanf(fl_, "%d\n", &bufSize))
+ {
+ case 0:
+ this->setstate (badbit);
+ return *this;
+ case EOF:
+ this->setstate (eofbit);
+ return *this;
+ }
+ char *ref = new char[bufSize+1];
+ //char *ref;
+ //ACE_NEW(ref, char[bufSize+1]);
+ if (ACE_OS::fgets(ACE_TEXT_CHAR_TO_TCHAR(ref), bufSize+1, fl_) == 0 &&
+ bufSize != 0)
+ {
+ this->setstate (badbit);
+ return *this;
+ }
+ ACE_CString newRef(ref);
+ record.ref(newRef);
+ delete [] ref;
+
+ return *this;
+
+}
+
+TAO_Storable_Base &
+TAO_NS_FlatFileStream::operator <<(
+ const TAO_NS_Persistence_Global &global)
+{
+ ACE_TRACE("TAO_NS_FlatFileStream::operator <<");
+ ACE_OS::rewind(this->fl_);
+ ACE_OS::fprintf(this->fl_, "%d\n", global.counter());
+ ACE_OS::fflush(this->fl_);
+
+ return *this;
+}
+
+TAO_Storable_Base &
+TAO_NS_FlatFileStream::operator >>(
+ TAO_NS_Persistence_Global &global)
+{
+ ACE_TRACE("TAO_NS_FlatFileStream::operator >>");
+ unsigned int counter = 0;
+
+ ACE_OS::rewind(this->fl_);
+ switch (fscanf(fl_, "%u\n", &counter))
+ {
+ case 0:
+ this->setstate (badbit);
+ break; // Still set the global.counter (to 0)
+ case EOF:
+ this->setstate (eofbit);
+ break; // Still set the global.counter (to 0)
+ }
+ global.counter(counter);
+
+ return *this;
+}
+
+
+TAO_Storable_Base *
+TAO_NS_FlatFileFactory::create_stream (const ACE_CString & file,
+ const ACE_TCHAR * mode)
+{
+ ACE_TRACE("TAO_NS_FlatFileFactory::create_stream");
+ TAO_Storable_Base *stream = 0;
+
+ ACE_NEW_RETURN (stream,
+ TAO_NS_FlatFileStream(file, ACE_TEXT_ALWAYS_CHAR (mode)),
+ 0);
+ return stream;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.h b/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.h
new file mode 100644
index 00000000000..8c76dbc99a3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.h
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Flat_File_Persistence.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_FLAT_FILE_PERSISTENCE_H
+#define TAO_FLAT_FILE_PERSISTENCE_H
+
+#include "orbsvcs/Naming/Storable.h"
+#include "ace/OS_NS_stdio.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//------------------------------------------------------------------------
+// The Flat File concrete classes
+//------------------------------------------------------------------------
+class TAO_NS_FlatFileStream : public TAO_Storable_Base
+{
+public:
+
+ TAO_NS_FlatFileStream(const ACE_CString & file, const char * mode);
+ virtual ~TAO_NS_FlatFileStream();
+
+ /// Remove a file by name (file is not open)
+ virtual void remove();
+
+ /// Check if a file exists on disk (file is not open)
+ virtual int exists();
+
+ /// Open a file (the remaining methods below all require an open file)
+ virtual int open();
+
+ /// Close an open file
+ virtual int close();
+
+ /// Acquire a file lock
+ virtual int flock (int whence, int start, int len);
+
+ /// Release a file lock
+ virtual int funlock (int whence, int start, int len);
+
+ /// Returns the last time an open file was changed
+ virtual time_t last_changed(void);
+
+ /// Write a header to disk
+ virtual TAO_Storable_Base& operator << (
+ const TAO_NS_Persistence_Header& header);
+
+ /// Read a header from disk
+ virtual TAO_Storable_Base& operator >> (
+ TAO_NS_Persistence_Header& header);
+
+ /// Write a record to disk
+ virtual TAO_Storable_Base& operator << (
+ const TAO_NS_Persistence_Record& record);
+
+ /// Read a record from disk
+ virtual TAO_Storable_Base& operator >> (
+ TAO_NS_Persistence_Record& record);
+
+ /// Write the global data to disk
+ virtual TAO_Storable_Base& operator << (
+ const TAO_NS_Persistence_Global& global);
+
+ /// Read the global data from disk
+ virtual TAO_Storable_Base& operator >> (
+ TAO_NS_Persistence_Global& global);
+
+private:
+ ACE_OS::ace_flock_t filelock_;
+ FILE* fl_;
+ ACE_CString file_;
+ ACE_CString mode_;
+};
+
+class TAO_NS_FlatFileFactory : public TAO_Naming_Service_Persistence_Factory
+{
+public:
+ // Factory Methods
+
+ /// Create the stream that can operate on a disk file
+ virtual TAO_Storable_Base *create_stream(const ACE_CString & file,
+ const ACE_TCHAR * mode);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.cpp
new file mode 100644
index 00000000000..3cb59bd6da9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.cpp
@@ -0,0 +1,680 @@
+// $Id$
+// ============================================================================
+//
+// = LIBRARY
+// TAO_CosNaming
+//
+// = FILENAME
+// Hash_Naming_Context.cpp
+//
+// = AUTHOR
+// Marina Spivak <marina@cs.wustl.edu> and
+// Sergio Flores-Gaitan <sergio@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Hash_Naming_Context.h"
+#include "orbsvcs/Naming/nsconf.h"
+#include "ace/Auto_Ptr.h"
+
+ACE_RCSID (Naming,
+ Hash_Naming_Context,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// -------------------------------------------------
+
+TAO_Bindings_Map::~TAO_Bindings_Map (void)
+{
+}
+
+// -------------------------------------------------
+
+TAO_Hash_Naming_Context::TAO_Hash_Naming_Context (PortableServer::POA_ptr poa,
+ const char *poa_id)
+ : context_ (0),
+ interface_ (0),
+ destroyed_ (0),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ poa_id_ (poa_id)
+{
+}
+
+void
+TAO_Hash_Naming_Context::interface (TAO_Naming_Context *i)
+{
+ this->interface_ = i;
+}
+
+TAO_Hash_Naming_Context::~TAO_Hash_Naming_Context (void)
+{
+ delete context_;
+}
+
+PortableServer::POA_ptr
+TAO_Hash_Naming_Context::_default_POA (void)
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
+
+CosNaming::NamingContext_ptr
+TAO_Hash_Naming_Context::get_context (const CosNaming::Name &name
+ ACE_ENV_ARG_DECL)
+{
+ // Naming context we will return.
+ CosNaming::NamingContext_var result =
+ CosNaming::NamingContext::_nil ();
+
+ // Create compound name to be resolved, i.e.,
+ // (<name> - last component). To avoid copying, we can just reuse
+ // <name>'s buffer, since we will not be modifying it.
+ CORBA::ULong name_len = name.length ();
+ CosNaming::Name comp_name (name.maximum (),
+ name_len - 1,
+ const_cast<CosNaming::NameComponent*> (name.get_buffer ()));
+ ACE_TRY
+ {
+ // Resolve the name.
+ CORBA::Object_var context = resolve (comp_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Try narrowing object reference to the NamingContext type.
+ result = CosNaming::NamingContext::_narrow (context.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ // Add the last component of the name, which was stripped before
+ // the call to resolve.
+ CORBA::ULong rest_len = ex.rest_of_name.length () + 1;
+ ex.rest_of_name.length (rest_len);
+ ex.rest_of_name[rest_len - 1] = name[name_len - 1];
+
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ if (CORBA::is_nil (result.in ()))
+ {
+ CosNaming::Name rest;
+ rest.length (2);
+ rest[0] = name[name_len - 2];
+ rest[1] = name[name_len - 1];
+ ACE_THROW_RETURN (CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::not_context,
+ rest),
+ CosNaming::NamingContext::_nil ());
+ }
+ // Finally, if everything went smoothly, just return the resolved
+ // context.
+ return result._retn ();
+}
+
+void
+TAO_Hash_Naming_Context::bind (const CosNaming::Name& n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX,
+ ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ // Get the length of the name.
+ CORBA::ULong name_len = n.length ();
+
+ // Check for invalid name.
+ if (name_len == 0)
+ ACE_THROW (CosNaming::NamingContext::InvalidName());
+
+ // If we received compound name, resolve it to get the context in
+ // which the binding should take place, then perform the binding on
+ // target context.
+ if (name_len > 1)
+ {
+ CosNaming::NamingContext_var context =
+ this->get_context (n ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNaming::Name simple_name;
+ simple_name.length (1);
+ simple_name[0] = n[name_len - 1];
+ ACE_TRY
+ {
+ context->bind (simple_name, obj ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TIMEOUT, timeoutEx)
+ {
+ ACE_TRY_THROW (CosNaming::NamingContext::CannotProceed
+ (context.in (), simple_name));
+ }
+ ACE_ENDTRY;
+ }
+ // If we received a simple name, we need to bind it in this context.
+ else
+ {
+ // Try binding the name.
+ int result = this->context_->bind (n[0].id,
+ n[0].kind,
+ obj,
+ CosNaming::nobject);
+ if (result == 1)
+ ACE_THROW (CosNaming::NamingContext::AlreadyBound());
+
+ // Something went wrong with the internal structure
+ else if (result == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+}
+
+void
+TAO_Hash_Naming_Context::rebind (const CosNaming::Name& n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ // Get the length of the name.
+ CORBA::ULong name_len = n.length ();
+
+ // Check for invalid name.
+ if (name_len == 0)
+ ACE_THROW (CosNaming::NamingContext::InvalidName());
+
+ // If we received compound name, resolve it to get the context in
+ // which the rebinding should take place, then perform the rebinding
+ // on target context.
+ if (name_len > 1)
+ {
+ CosNaming::NamingContext_var context =
+ get_context (n ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNaming::Name simple_name;
+ simple_name.length (1);
+ simple_name[0] = n[name_len - 1];
+ ACE_TRY
+ {
+ context->rebind (simple_name, obj ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TIMEOUT, timeoutEx)
+ {
+ ACE_TRY_THROW (CosNaming::NamingContext::CannotProceed
+ (context.in (), simple_name));
+ }
+ ACE_ENDTRY;
+ }
+ else
+ // If we received a simple name, we need to rebind it in this
+ // context.
+ {
+ int result = this->context_->rebind (n[0].id,
+ n[0].kind,
+ obj,
+ CosNaming::nobject);
+ // Check for error conditions.
+ if (result == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+
+ else if (result == -2)
+ ACE_THROW (CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::not_object,
+ n));
+ }
+}
+
+void
+TAO_Hash_Naming_Context::bind_context (const CosNaming::Name &n,
+ CosNaming::NamingContext_ptr nc
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ // Do not allow binding of nil context reference.
+ if (CORBA::is_nil (nc))
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ // Get the length of the name.
+ CORBA::ULong name_len = n.length ();
+
+ // Check for invalid name.
+ if (name_len == 0)
+ ACE_THROW (CosNaming::NamingContext::InvalidName());
+
+ // If we received compound name, resolve it to get the context in
+ // which the binding should take place, then perform the binding on
+ // target context.
+ if (name_len > 1)
+ {
+ CosNaming::NamingContext_var context =
+ get_context (n ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNaming::Name simple_name;
+ simple_name.length (1);
+ simple_name[0] = n[name_len - 1];
+ ACE_TRY
+ {
+ context->bind_context (simple_name, nc ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TIMEOUT, timeoutEx)
+ {
+ ACE_TRY_THROW (CosNaming::NamingContext::CannotProceed
+ (context.in (), simple_name));
+ }
+ ACE_ENDTRY;
+ }
+ // If we received a simple name, we need to bind it in this context.
+ else
+ {
+ // Try binding the name.
+ int result = this->context_->bind (n[0].id,
+ n[0].kind,
+ nc,
+ CosNaming::ncontext);
+ if (result == 1)
+ ACE_THROW (CosNaming::NamingContext::AlreadyBound());
+
+ // Something went wrong with the internal structure
+ else if (result == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+}
+
+void
+TAO_Hash_Naming_Context::rebind_context (const CosNaming::Name &n,
+ CosNaming::NamingContext_ptr nc
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ // Get the length of the name.
+ CORBA::ULong name_len = n.length ();
+
+ // Check for invalid name.
+ if (name_len == 0)
+ ACE_THROW (CosNaming::NamingContext::InvalidName());
+
+ // If we received compound name, resolve it to get the context in
+ // which the rebinding should take place, then perform the rebinding
+ // on target context.
+ if (name_len > 1)
+ {
+ CosNaming::NamingContext_var context =
+ get_context (n ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNaming::Name simple_name;
+ simple_name.length (1);
+ simple_name[0] = n[name_len - 1];
+ ACE_TRY
+ {
+ context->rebind_context (simple_name, nc ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TIMEOUT, timeoutEx)
+ {
+ ACE_TRY_THROW (CosNaming::NamingContext::CannotProceed
+ (context.in (), simple_name));
+ }
+ ACE_ENDTRY;
+ }
+ else
+ // If we received a simple name, we need to rebind it in this
+ // context.
+ {
+ int result = this->context_->rebind (n[0].id,
+ n[0].kind,
+ nc,
+ CosNaming::ncontext);
+ // Check for error conditions.
+ if (result == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+
+ else if (result == -2)
+ ACE_THROW (CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::not_context,
+ n));
+ }
+}
+
+CORBA::Object_ptr
+TAO_Hash_Naming_Context::resolve (const CosNaming::Name& n
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (),
+ CORBA::Object::_nil ());
+
+ // Get the length of the name.
+ CORBA::ULong name_len = n.length ();
+
+ // Check for invalid name.
+ if (name_len == 0)
+ ACE_THROW_RETURN (CosNaming::NamingContext::InvalidName(),
+ CORBA::Object::_nil ());
+
+ // Resolve the first component of the name.
+
+ // Stores the binding type for the first name component.
+ CosNaming::BindingType type;
+
+ // Stores the object reference bound to the first name component.
+ CORBA::Object_var result;
+
+ if (this->context_->find (n[0].id,
+ n[0].kind,
+ result.out (),
+ type) == -1)
+ ACE_THROW_RETURN (CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::missing_node,
+ n),
+ CORBA::Object::_nil ());
+
+ // If the name we have to resolve is a compound name, we need to
+ // resolve it recursively.
+ if (name_len > 1)
+ {
+ CosNaming::NamingContext_var context =
+ CosNaming::NamingContext::_nil ();
+
+ if (type == CosNaming::ncontext)
+ {
+ // Narrow to NamingContext.
+ context = CosNaming::NamingContext::_narrow (result.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+ }
+ else
+ // The first name component wasn't bound to a NamingContext.
+ ACE_THROW_RETURN (CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::not_context,
+ n),
+ CORBA::Object::_nil ());
+
+ // If narrow failed...
+ if (CORBA::is_nil (context.in ()))
+ ACE_THROW_RETURN (CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::not_context,
+ n),
+ CORBA::Object::_nil ());
+ else
+ {
+ // Successfully resolved the first name component, need to
+ // recursively call resolve on <n> without the first component.
+
+ // We need a name just like <n> but without the first
+ // component. Instead of copying data we can reuse <n>'s
+ // buffer since we will only be using it for 'in' parameters
+ // (no modifications).
+ CosNaming::Name rest_of_name
+ (n.maximum () - 1,
+ n.length () - 1,
+ const_cast<CosNaming::NameComponent*> (n.get_buffer ())
+ + 1);
+
+ // If there are any exceptions, they will propagate up.
+ ACE_TRY
+ {
+ CORBA::Object_ptr resolved_ref;
+ resolved_ref = context->resolve (rest_of_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ return resolved_ref;
+ }
+ ACE_CATCH (CORBA::TIMEOUT, timeoutEx)
+ {
+ ACE_TRY_THROW (CosNaming::NamingContext::CannotProceed
+ (context.in (), rest_of_name));
+ }
+ ACE_ENDTRY;
+ }
+ }
+ // If the name we had to resolve was simple, we just need to return
+ // the result.
+ return result._retn ();
+}
+
+void
+TAO_Hash_Naming_Context::unbind (const CosNaming::Name& n
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ // Get the length of the name.
+ CORBA::ULong name_len = n.length ();
+
+ // Check for invalid name.
+ if (name_len == 0)
+ ACE_THROW (CosNaming::NamingContext::InvalidName());
+
+ // If we received compound name, resolve it to get the context in
+ // which the unbinding should take place, then perform the unbinding
+ // on target context.
+ if (name_len > 1)
+ {
+ CosNaming::NamingContext_var context =
+ get_context (n ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNaming::Name simple_name;
+ simple_name.length (1);
+ simple_name[0] = n[name_len - 1];
+ ACE_TRY
+ {
+ context->unbind (simple_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TIMEOUT, timeoutEx)
+ {
+ ACE_TRY_THROW (CosNaming::NamingContext::CannotProceed
+ (context.in (), simple_name));
+ }
+ ACE_ENDTRY;
+ }
+ // If we received a simple name, we need to unbind it in this
+ // context.
+ else
+ if (this->context_->unbind (n[0].id,
+ n[0].kind) == -1)
+ ACE_THROW (CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::missing_node,
+ n));
+}
+
+CosNaming::NamingContext_ptr
+TAO_Hash_Naming_Context::bind_new_context (const CosNaming::Name& n
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX,
+ ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (),
+ CosNaming::NamingContext::_nil ());
+
+ // Get the length of the name.
+ CORBA::ULong name_len = n.length ();
+
+ // Check for invalid name.
+ if (name_len == 0)
+ ACE_THROW_RETURN (CosNaming::NamingContext::InvalidName(),
+ CosNaming::NamingContext::_nil ());
+
+ // If we received compound name, resolve it to get the context in
+ // which the binding should take place, then perform the operation on
+ // target context.
+ if (name_len > 1)
+ {
+ CosNaming::NamingContext_var context =
+ get_context (n ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ CosNaming::Name simple_name;
+ simple_name.length (1);
+ simple_name[0] = n[name_len - 1];
+ return context->bind_new_context (simple_name ACE_ENV_ARG_PARAMETER);
+ }
+
+ // If we received a simple name, we need to bind it in this context.
+
+ // Stores our new Naming Context.
+ CosNaming::NamingContext_var result =
+ CosNaming::NamingContext::_nil ();
+
+ // Create new context.
+ result = new_context (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ // Bind the new context to the name.
+ ACE_TRY
+ {
+ bind_context (n,
+ result.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // If the bind() operation fails we must destroy the recently
+ // created context, should any exceptions be raised by the
+ // destroy() operation we want to ignore them.
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY_EX(DESTROY)
+ {
+ result->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(DESTROY);
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+ }
+ // Re-raise the exception in bind_context()
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+ return result._retn ();
+}
+
+void
+TAO_Hash_Naming_Context::destroy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX,
+ ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ if (this->context_->current_size () != 0)
+ ACE_THROW (CosNaming::NamingContext::NotEmpty());
+
+ // Destroy is a no-op on a root context.
+ if (root ())
+ return;
+
+ else
+ {
+ this->destroyed_ = 2;
+
+ // Remove self from POA. Because of reference counting, the POA
+ // will automatically delete the servant when all pending requests
+ // on this servant are complete.
+
+ PortableServer::POA_var poa =
+ this->_default_POA ();
+
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId (poa_id_.fast_rep ());
+
+ ACE_CHECK;
+
+ poa->deactivate_object (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+int
+TAO_Hash_Naming_Context::root (void)
+{
+ return (ACE_OS::strcmp (this->poa_id_.fast_rep (),
+ TAO_ROOT_NAMING_CONTEXT) == 0);
+}
+
+int
+TAO_Hash_Naming_Context::destroyed (void)
+{
+ return this->destroyed_;
+}
+
+TAO_Naming_Context *
+TAO_Hash_Naming_Context::interface (void)
+{
+ return this->interface_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.h b/TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.h
new file mode 100644
index 00000000000..21fb9d571f3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.h
@@ -0,0 +1,280 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Hash_Naming_Context.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_HASH_NAMING_CONTEXT_H
+#define TAO_HASH_NAMING_CONTEXT_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Naming/Naming_Context_Interface.h"
+#include "orbsvcs/Naming/naming_serv_export.h"
+
+#include "ace/Recursive_Thread_Mutex.h"
+#include "ace/SString.h"
+
+// This is to remove "inherits via dominance" warnings from MSVC.
+#if defined (_MSC_VER)
+# pragma warning (disable : 4250)
+#endif /* _MSC_VER */
+
+// Note: 'interface' has been defined as struct on WinCE platform and
+// gives a compiler error. This undef has been found harmless on
+// Windows and solaris platforms; however, if this generates
+// error, then proper ifdef must be added around following block.
+#if defined (interface)
+#undef interface
+#endif // interface
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Bindings_Map
+ *
+ * @brief This abstract base class defines an interface for hash-based
+ * data structures used in implementations of NamingContext
+ * (i.e., TAO_Transient_Naming_Context and TAO_Persistent_Naming_Context)
+ *
+ * Define an interface for several hash-based data structures, so
+ * that we can write some code that would work with any of them,
+ * i.e., TAO_Hash_Naming_Context.
+ */
+class TAO_Naming_Serv_Export TAO_Bindings_Map
+{
+
+public:
+
+ /// Destructor.
+ virtual ~TAO_Bindings_Map (void);
+
+ /// Return current number of entries (name bindings) in the
+ /// underlying hash map.
+ virtual size_t current_size (void) = 0;
+
+ /**
+ * Add a binding with the specified parameters to the table.
+ * Return 0 on success and -1 on failure, 1 if there already is a
+ * binding with <id> and <kind>.
+ */
+ virtual int bind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type) = 0;
+
+ /**
+ * Overwrite a binding containing <id> and <kind> (or create a new
+ * one if one doesn't exist) with the specified parameters. Returns
+ * -1 on failure.
+ */
+ virtual int rebind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type) = 0;
+
+ /// Remove a binding containing <id> and <kind> from the table.
+ /// Return 0 on success and -1 on failure.
+ virtual int unbind (const char * id,
+ const char * kind) = 0;
+
+ /**
+ * Find the binding containing <id> and <kind> in the table, and
+ * pass binding's type and object back to the caller by reference.
+ * Return 0 on success and -1 on failure. Note: a 'duplicated' object
+ * reference is assigned to <obj>, so the caller is responsible for
+ * its deallocation.
+ */
+ virtual int find (const char * id,
+ const char * kind,
+ CORBA::Object_ptr & obj,
+ CosNaming::BindingType &type) = 0;
+
+};
+
+/**
+ * @class TAO_Hash_Naming_Context
+ *
+ * @brief This class factors out common code for two 'ConcreteImplementors'
+ * in the Bridge pattern architecture of the CosNaming::NamingContext
+ * implementation.
+ *
+ * This class contains 'algorithm' code that is common to two
+ * hash-table-based implementations of the NamingContext:
+ * TAO_Transient_Naming_Context and TAO_Persistent_Naming_Context.
+ * To help achieve this 'templatization', we use the abstract base
+ * class TAO_Bindings_Map, which provides a common interface to the data structures
+ * used in TAO_Persistent_Namng_Context and TAO_Transient_Naming_Context.
+ */
+class TAO_Naming_Serv_Export TAO_Hash_Naming_Context :public TAO_Naming_Context_Impl
+{
+public:
+ // = Initialization and termination methods.
+ /// Constructor.
+ TAO_Hash_Naming_Context (PortableServer::POA_ptr poa,
+ const char *poa_id);
+
+ /// Set our <interface_> pointer.
+ void interface (TAO_Naming_Context *i);
+
+ /// Destructor.
+ virtual ~TAO_Hash_Naming_Context (void);
+
+ // = Accessors.
+
+ /// Get the pointer to our <interface>.
+ TAO_Naming_Context *interface (void);
+
+ /// Returns true if this Naming Context is a root Naming Context for
+ /// the server, and false otherwise.
+ int root (void);
+
+ /// Returns true if this context had <destroy> operation invoked on
+ /// it, and false otherwise.
+ int destroyed (void);
+
+ // = CosNaming::NamingContext idl interface methods.
+
+ /**
+ * Create a binding for name <n> and object <obj> in the naming
+ * context. Compound names are treated as follows: ctx->bind (<c1;
+ * c2; c3; cn>, obj) = (ctx->resolve (<c1; c2; cn-1>))->bind (<cn>,
+ * obj) if the there already exists a binding for the specified
+ * name, <AlreadyBound> exception is thrown. Naming contexts should
+ * be bound using <bind_context> and <rebind_context> in order to
+ * participate in name resolution later.
+ */
+ virtual void bind (const CosNaming::Name &n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * This is similar to <bind> operation above, except for when the
+ * binding for the specified name already exists in the specified
+ * context. In that case, the existing binding is replaced with the
+ * new one.
+ */
+ virtual void rebind (const CosNaming::Name &n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * This is the version of <bind> specifically for binding naming
+ * contexts, so that they will participate in name resolution when
+ * compound names are passed to be resolved.
+ */
+ virtual void bind_context (const CosNaming::Name &n,
+ CosNaming::NamingContext_ptr nc
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * This is a version of <rebind> specifically for naming contexts,
+ * so that they can participate in name resolution when compound
+ * names are passed.
+ */
+ virtual void rebind_context (const CosNaming::Name &n,
+ CosNaming::NamingContext_ptr nc
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Return object reference that is bound to the name. Compound name
+ * resolve is defined as follows: ctx->resolve (<c1; c2; cn>) =
+ * ctx->resolve (<c1; c2 cn-1>)->resolve (<cn>) The naming service
+ * does not return the type of the object. Clients are responsible
+ * for "narrowing" the object to the appropriate type.
+ */
+ virtual CORBA::Object_ptr resolve (const CosNaming::Name &n
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Remove the name binding from the context. When compound names
+ * are used, unbind is defined as follows: ctx->unbind (<c1; c2;
+ * cn>) = (ctx->resolve (<c1; c2; cn-1>))->unbind (<cn>)
+ */
+ virtual void unbind (const CosNaming::Name &n
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * This operation creates a new context and binds it to the name
+ * supplied as an argument. The newly-created context is
+ * implemented by the same server as the context in which it was
+ * bound (the name argument excluding the last component).
+ */
+ virtual CosNaming::NamingContext_ptr bind_new_context (const CosNaming::Name &n
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Delete the naming context. The user should take care to <unbind> any
+ * bindings in which the given context is bound to some names, to
+ * avoid dangling references when invoking <destroy> operation.
+ * NOTE: <destory> is a no-op on the root context.
+ * NOTE: after <destroy> is invoked on a Naming Context, all
+ * BindingIterators associated with that Naming Context are also destroyed.
+ */
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Returns the Default POA of this Servant object
+ virtual PortableServer::POA_ptr _default_POA (void);
+
+protected:
+ // = Helper method used by other methods.
+
+ /**
+ * <get_context> is used by methods that need to resolve a compound
+ * name before performing the actual operation (e.g., bind, unbind,
+ * etc.) <get_context> takes a full name (including the last
+ * component that doesn't need to be resolved), and returns a
+ * pointer to the target context.
+ */
+ CosNaming::NamingContext_ptr get_context (const CosNaming::Name &name
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Pointer to the data structure used to store this Naming Context's
+ * bindings. <context_> is initialized with a concrete data
+ * structure by subclasses, which know which data structure to use.
+ */
+ TAO_Bindings_Map *context_;
+
+ /**
+ * Pointer to the <interface> object for which we serve as a
+ * <concrete implementation>, i.e., the object that delegates to us
+ * all client CosNaming::NamingContext CORBA calls.
+ * We need this pointer for reference counting.
+ */
+ TAO_Naming_Context *interface_;
+
+ /// Lock used to serialize access to the underlying data structure.
+ TAO_SYNCH_RECURSIVE_MUTEX lock_;
+
+ /**
+ * Flag indicating whether this Naming Context is no longer valid.
+ * This flag is necessary because immediate destruction
+ * might not be possible if there are pending requests on this servant
+ * in the POA.
+ */
+ int destroyed_;
+
+ /// POA we are registered with.
+ PortableServer::POA_var poa_;
+
+ /**
+ * ID with which we are registered with <poa_>.
+ * Note, if <poa_id_> is equivalent to TAO_ROOT_NAMING_CONTEXT, then this Naming Context
+ * is the root Naming Context for the server, i.e., it is un<destroy>able.
+ */
+ ACE_CString poa_id_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_HASH_NAMING_CONTEXT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Client.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Client.cpp
new file mode 100644
index 00000000000..ac7c42f87d0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Client.cpp
@@ -0,0 +1,67 @@
+// $Id$
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/CosNamingC.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID (Naming,
+ Naming_Client,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+CosNaming::NamingContext_ptr
+TAO_Naming_Client::operator -> (void) const
+{
+ return this->naming_context_.ptr ();
+}
+
+CosNaming::NamingContext_ptr
+TAO_Naming_Client::get_context (void) const
+{
+ // Must duplicate this pointer so it can be stored in a _var.
+ return CosNaming::NamingContext::_duplicate (this->naming_context_.in ());
+}
+
+int
+TAO_Naming_Client::init (CORBA::ORB_ptr orb,
+ ACE_Time_Value *timeout)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references ("NameService", timeout ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the NameService.\n"),
+ -1);
+ this->naming_context_ =
+ CosNaming::NamingContext::_narrow (naming_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Naming_Client::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+TAO_Naming_Client::TAO_Naming_Client (void)
+{
+ // Do nothing
+}
+
+TAO_Naming_Client::~TAO_Naming_Client (void)
+{
+ // Do nothing
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Client.h b/TAO/orbsvcs/orbsvcs/Naming/Naming_Client.h
new file mode 100644
index 00000000000..56b48d7f37d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Client.h
@@ -0,0 +1,78 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file Naming_Client.h
+ *
+ * $Id$
+ *
+ * Implement wrappers useful to Naming Service clients.
+ *
+ *
+ * @author Nagarajan Surendran (naga@cs.wustl.edu)
+ * @author Matt Braun <mjb2@cs.wustl.edu>
+ * @author and Douglas C. Schmidt <schmidt@cs.wustl.edu>.
+ */
+//=============================================================================
+
+
+#ifndef TAO_NAMING_CLIENT_H
+#define TAO_NAMING_CLIENT_H
+#include /**/ "ace/pre.h"
+
+#include "tao/ORB.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Naming/naming_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Naming_Client
+ *
+ * @brief This class is intended to simplify programs that want to play
+ * the role of Naming Service clients.
+ *
+ * Wrapper class that locates the root Naming Context. It also
+ * defines the operator-> so that <NamingContext> functions like
+ * <resolve>, etc. can be directly called on a
+ * <TAO_Naming_Client> object, and will be forwarded to the root
+ * Naming Context.
+ */
+class TAO_Naming_Export TAO_Naming_Client
+{
+public:
+ // = Initialization and termination methods.
+
+ /// Default constructor.
+ TAO_Naming_Client (void);
+
+ /**
+ * Look for a Naming Service for a period of <timeout> using
+ * <resolve_initial_references>. Return 0 if Naming Service is
+ * successfully located, and -1 on failure.
+ */
+ int init (CORBA::ORB_ptr orb,
+ ACE_Time_Value *timeout = 0);
+
+ /// Destructor.
+ ~TAO_Naming_Client (void);
+
+ /// Returns a pointer to the root Naming Context.
+ CosNaming::NamingContext_ptr operator-> (void) const;
+
+ /**
+ * Returns a pointer to the root Naming Context. This ptr is
+ * duplicated via <_duplicate> so that it can be stored into a
+ * <*_var>.
+ */
+ CosNaming::NamingContext_ptr get_context (void) const;
+
+protected:
+ /// Reference to the root Naming Context.
+ CosNaming::NamingContext_var naming_context_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_NAMING_CLIENT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.cpp
new file mode 100644
index 00000000000..809c1795a42
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.cpp
@@ -0,0 +1,539 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// Naming_Context_Interface.cpp
+//
+// = AUTHOR
+// Marina Spivak <marina@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Context_Interface.h"
+#include "ace/ACE.h"
+#include "ace/OS_NS_string.h"
+#include "ace/os_include/os_ctype.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Naming_Context::TAO_Naming_Context (TAO_Naming_Context_Impl *impl)
+ : impl_ (impl)
+{
+}
+
+TAO_Naming_Context::~TAO_Naming_Context (void)
+{
+ delete impl_;
+}
+
+PortableServer::POA_ptr
+TAO_Naming_Context::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED/*env*/)
+{
+ return impl_->_default_POA ();
+}
+
+void
+TAO_Naming_Context::bind (const CosNaming::Name &n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName,
+ CosNaming::NamingContext::AlreadyBound))
+{
+ impl_->bind (n, obj ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Naming_Context::rebind (const CosNaming::Name &n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName))
+{
+ impl_->rebind (n, obj ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Naming_Context::bind_context (const CosNaming::Name &n,
+ CosNaming::NamingContext_ptr nc
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName,
+ CosNaming::NamingContext::AlreadyBound))
+{
+ impl_->bind_context (n, nc ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Naming_Context::rebind_context (const CosNaming::Name &n,
+ CosNaming::NamingContext_ptr nc
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName))
+{
+ impl_->rebind_context (n, nc ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Object_ptr
+TAO_Naming_Context::resolve (const CosNaming::Name &n
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName))
+{
+ return impl_->resolve (n ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Naming_Context::unbind (const CosNaming::Name &n
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName))
+{
+ impl_->unbind (n ACE_ENV_ARG_PARAMETER);
+}
+
+CosNaming::NamingContext_ptr
+TAO_Naming_Context::new_context (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return impl_->new_context (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNaming::NamingContext_ptr
+TAO_Naming_Context::bind_new_context (const CosNaming::Name &n
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::AlreadyBound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName))
+{
+ return impl_->bind_new_context (n ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Naming_Context::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotEmpty))
+{
+ impl_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Naming_Context::list (CORBA::ULong how_many,
+ CosNaming::BindingList_out bl,
+ CosNaming::BindingIterator_out bi
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ impl_->list (how_many, bl, bi ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Naming_Context::
+to_string_helper_length (CORBA::ULong &len, const char * &src)
+{
+ for (const char *j =src; *j != '\0'; ++j)
+ {
+ ++len;
+ if (*j == '.' || *j == '\\' || *j == '/')
+ ++len;
+ }
+ ++len; // '.' seperator or '/' seperator
+
+}
+
+void
+TAO_Naming_Context::
+to_string_helper_assign (char * &k, const char * &src)
+{
+ for (; *src != '\0'; ++src)
+ {
+ if (*src == '.' || *src == '\\' || *src == '/')
+ {
+ *k = '\\';
+ ++k;
+ }
+ *k = *src;
+ ++k;
+ }
+
+}
+
+char *
+TAO_Naming_Context::to_string (const CosNaming::Name &n
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::InvalidName))
+{
+ // Accepts a Name and returns a stringified name.
+
+ // Check for invalid name.
+ if (n.length () == 0)
+ ACE_THROW_RETURN (CosNaming::NamingContext::InvalidName(),
+ 0);
+
+ // Length of the return string
+ CORBA::ULong len = 0;
+
+ CORBA::ULong i;
+ for (i=0; i < n.length (); ++i)
+ {
+ const char *id = n[i].id.in ();
+
+ // Count number of characters in id
+ this->to_string_helper_length (len, id);
+
+ const char *kind = n[i].kind.in ();
+
+ // Count number of characters in kind
+ this->to_string_helper_length (len, kind);
+ }
+
+ // Allocate memory to the return parameter
+ //
+ char *str_name = CORBA::string_alloc (len);
+
+ // check for memory allocation
+ //
+ if (str_name == 0)
+ {
+ ACE_THROW_RETURN (CORBA::NO_MEMORY (), 0);
+ }
+
+ char *k = str_name;
+
+ // Stringify the name
+ for (i=0; i < n.length (); ++i)
+ {
+
+ // Stringify Id
+ //
+ const char *id = n[i].id.in ();
+ this->to_string_helper_assign (k, id);
+
+ const char *kind = n[i].kind.in ();
+
+ if (*kind != '\0')
+ {
+ // If 'kind' is set,
+ // Append a seperator between the id and kind.
+ //
+ *k = '.';
+ ++k;
+
+ // Stringify Kind
+ //
+ this->to_string_helper_assign (k, kind);
+ }
+
+ // If this is not the last name component, add a seperator
+ // between the name components
+ //
+ if (i != (n.length ()-1))
+ {
+ *k = '/';
+ ++k;
+ }
+
+ }
+ // Terminate
+ *k = '\0';
+ ++k;
+
+ return str_name;
+}
+
+void
+TAO_Naming_Context::
+to_name_helper (char *dest, const char*& src, Hint hint)
+{
+ for (; *src != '\0'; ++src, ++dest)
+ {
+ if ((hint == HINT_ID && *src == '.') || *src == '/')
+ {
+ *dest = '\0';
+ return;
+ }
+
+ if (*src == '\\')
+ {
+ src++;
+ if (*src == '\0')
+ {
+ // Case: The very last component
+ *dest = '\0';
+ return;
+ }
+ }
+
+ // In all cases.
+ *dest = *src;
+ }
+
+ // Terminate.
+ *dest = '\0';
+}
+
+CosNaming::Name *
+TAO_Naming_Context::to_name (const char *sn
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::InvalidName))
+{
+ // Returns the Name from its stringified form.
+ CosNaming::Name n;
+
+ // Total number of name components in the name
+ CORBA::ULong ncomp = 0;
+
+ // Total length of the unstrigified name
+ CORBA::ULong len=0;
+
+
+ for (const char *j = sn; *j != '\0'; ++j)
+ {
+ // Make a pass through the Name and count each character
+ if (*j == '/')
+ {
+ ncomp++;
+ }
+ else if (*j == '\\')
+ {
+ ++j;
+
+ if (*j == '\0')
+ {
+ // Case: The very last component
+ ++len;
+ }
+ }
+
+ // In all cases.
+ ++len;
+ }
+
+
+ // Check for InvalidName i.e. Invalid stringified name
+ //
+ if (len == 0)
+ ACE_THROW_RETURN (CosNaming::NamingContext::InvalidName(),
+ 0);
+
+ // Assign the length of the return unstringified name.
+ //
+ n.length (ncomp+1);
+
+ // Keeps track of the number of the name component
+ //
+ CORBA::ULong count = 0;
+
+ for (const char *k = sn; *k != '\0';)
+ {
+ if (count > ncomp)
+ {
+ ACE_THROW_RETURN (CosNaming::NamingContext::InvalidName(), 0);
+ }
+
+ char *id = CORBA::string_alloc (len);
+ char *kind = CORBA::string_alloc (len);
+
+ // Assign to the id.
+ this->to_name_helper (id, k, HINT_ID);
+
+ if (*k == '.')
+ {
+ k++;
+ // Assign to kind
+ this->to_name_helper (kind, k, HINT_KIND);
+ }
+ else
+ {
+ *kind = '\0';
+ }
+
+ n[count].id = id;
+ n[count].kind = kind;
+
+ count++;
+
+ // End
+ if (*k == '\0')
+ break;
+ k++;
+ }
+
+ return new CosNaming::Name (n);
+}
+
+int
+TAO_Naming_Context::to_url_is_alnum_or_punctuation (char c)
+{
+ if (isalnum (c))
+ return 1;
+
+ // NON US-ASCII charcters excluding those in this array are the
+ // characters that need to be escaped
+ static char non_escaped_punctuation[] =
+ { ';', '/', ':', '?', '@', '=', '+', '$', ',', '-',
+ '_', '.', '!', '~', '*', '\'', '(', ')' };
+ const size_t non_escaped_punctuation_count =
+ sizeof(non_escaped_punctuation)/sizeof(non_escaped_punctuation[0]);
+ for (const char *j = non_escaped_punctuation;
+ j != non_escaped_punctuation + non_escaped_punctuation_count;
+ ++j)
+ {
+ // But if the character is one of the 18 non US-ASCII characters
+ // and hence need not be escaped, then don't increment the
+ // count.
+ if (*j == c)
+ return 1;
+ }
+ return 0;
+}
+
+size_t
+TAO_Naming_Context::to_url_validate_and_compute_size (
+ const char *addr,
+ const char *sn
+ ACE_ENV_ARG_DECL)
+{
+ size_t addr_len = ACE_OS::strlen (addr);
+
+ // Check for invalid address
+ if (addr_len == 0)
+ ACE_THROW_RETURN (CosNaming::NamingContextExt::InvalidAddress (),
+ 0);
+
+ // Make a pass through the in string name to count the number of
+ // characters and if the character
+ // is to be escaped, increment the number of characters by 3.
+ size_t sn_len = 0;
+ for (const char *i = sn; *i != '\0'; ++i)
+ {
+ ++sn_len;
+
+ if (TAO_Naming_Context::to_url_is_alnum_or_punctuation (*i))
+ continue;
+ sn_len += 3;
+ }
+
+ if (sn_len == 0)
+ ACE_THROW_RETURN (CosNaming::NamingContextExt::InvalidName (), 0);
+
+ return addr_len + sn_len;
+}
+
+char *
+TAO_Naming_Context::to_url (const char * addr,
+ const char * sn
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContextExt::InvalidAddress,
+ CosNaming::NamingContext::InvalidName))
+{
+ /// Compute how many characters will be required for the URL
+ size_t no_char =
+ TAO_Naming_Context::to_url_validate_and_compute_size (addr, sn
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+
+ // The 'corbaname:' tag is to be prepended at the starting of the
+ // return parameter.
+ //
+ char prefix []= "corbaname:";
+
+ // Allocate dynamic memory
+ //
+ char *str_url = CORBA::string_alloc (static_cast<CORBA::ULong> (no_char + sizeof (prefix)));
+
+ // Copy 'prefix' to the return parameter.
+ char *dest = ACE_OS::strcpy (str_url , prefix);
+
+ /// move to end of dest string
+ dest += ACE_OS::strlen(dest);
+
+ // Concatenate the address
+ dest = ACE_OS::strcat (dest, addr);
+
+ /// Concatenate the seperator between the addr and Name
+ dest += ACE_OS::strlen(dest);
+ dest = ACE_OS::strcat (dest, "#");
+
+ /// move to end of dest string
+ dest += ACE_OS::strlen(dest);
+
+ // Now append the stringified object name to the return variable.
+ // The percent '%' character is used as an escape. If a character
+ // that requires escaping is present in a name component it is
+ // encoded as two hexadecimal digits following a '%' character to
+ // represent the octet. The first hexadecimal character represents
+ // the low-order nibble of the octet and the second hexadecimal
+ // character represents the low order nibble.
+
+ for (const char *i = sn; *i != '\0'; ++i)
+ {
+ if (TAO_Naming_Context::to_url_is_alnum_or_punctuation (*i))
+ {
+ // If the character is a US-ASCII Alphanumeric value...
+ *dest = *i; ++dest;
+ continue;
+ }
+ // this must be an escaped character
+
+ *dest = '%'; ++dest;
+
+ // Append the hexadecimal representation of the character.
+ *dest = ACE::nibble2hex ((*i) >> 4); ++dest;
+ *dest = ACE::nibble2hex (*i); ++dest;
+ }
+
+ // Terminate the string
+ *dest = '\0';
+
+ // ACE_OS::strcat (str_url, dest);
+ return str_url;
+}
+
+CORBA::Object_ptr
+TAO_Naming_Context::resolve_str (const char * n
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName
+ ))
+{
+ // Similar to <resolve> above. It accepts a strigified name as an
+ // argument instead of a Name.
+
+ // Get the unstrigified name.
+ CosNaming::Name_var name = this->to_name (n ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ // Pass this unstringified name to resolve and return an Object_ptr
+ return this->resolve (name.in () ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_Naming_Context_Impl::~TAO_Naming_Context_Impl (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.h b/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.h
new file mode 100644
index 00000000000..54140eb5e57
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.h
@@ -0,0 +1,422 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Naming_Context_Interface.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_NAMING_CONTEXT_INTERFACE_H
+#define TAO_NAMING_CONTEXT_INTERFACE_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosNamingS.h"
+
+#include "orbsvcs/Naming/naming_serv_export.h"
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Naming_Context_Impl;
+
+// This is to remove "inherits via dominance" warnings from MSVC.
+#if defined (_MSC_VER)
+# pragma warning (disable : 4250)
+#endif /* _MSC_VER */
+
+/**
+ * @class TAO_Naming_Context
+ *
+ * @brief This class plays a role of the 'Abstraction' (aka 'Interface')
+ * in the Bridge pattern architecture of the CosNaming::NamingContext
+ * implementation.
+ *
+ * This class simply forwards all client requests to a concrete
+ * NamingContext implementation through its <impl_> pointer. See
+ * README file for more info. Comments for the idl methods
+ * describe methods semantics - actual actions are carried out by
+ * concrete implementors.
+ */
+
+class TAO_Naming_Serv_Export TAO_Naming_Context :
+ public virtual POA_CosNaming::NamingContextExt
+{
+public:
+
+ // = Initialization and termination methods.
+ /// Constructor. Initializes <impl_> with a concrete implementation.
+ TAO_Naming_Context (TAO_Naming_Context_Impl *impl);
+
+ /// Destructor.
+ ~TAO_Naming_Context (void);
+
+ // = CosNaming::NamingContext idl interface methods.
+
+ /**
+ * Create a binding for name <n> and object <obj> in the naming
+ * context. Compound names are treated as follows: ctx->bind (<c1;
+ * c2; c3; cn>, obj) = (ctx->resolve (<c1; c2; cn-1>))->bind (<cn>,
+ * obj) if the there already exists a binding for the specified
+ * name, <AlreadyBound> exception is thrown. Naming contexts should
+ * be bound using <bind_context> and <rebind_context> in order to
+ * participate in name resolution later.
+ */
+ virtual void bind (const CosNaming::Name &n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName,
+ CosNaming::NamingContext::AlreadyBound));
+
+ /**
+ * This is similar to <bind> operation above, except for when the
+ * binding for the specified name already exists in the specified
+ * context. In that case, the existing binding is replaced with the
+ * new one.
+ */
+ virtual void rebind (const CosNaming::Name &n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName));
+
+ /**
+ * This is the version of <bind> specifically for binding naming
+ * contexts, so that they will participate in name resolution when
+ * compound names are passed to be resolved.
+ */
+ virtual void bind_context (const CosNaming::Name &n,
+ CosNaming::NamingContext_ptr nc
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName,
+ CosNaming::NamingContext::AlreadyBound));
+
+ /**
+ * This is a version of <rebind> specifically for naming contexts,
+ * so that they can participate in name resolution when compound
+ * names are passed.
+ */
+ virtual void rebind_context (const CosNaming::Name &n,
+ CosNaming::NamingContext_ptr nc
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName));
+
+ /**
+ * Return object reference that is bound to the name. Compound name
+ * resolve is defined as follows: ctx->resolve (<c1; c2; cn>) =
+ * ctx->resolve (<c1; c2 cn-1>)->resolve (<cn>) The naming service
+ * does not return the type of the object. Clients are responsible
+ * for "narrowing" the object to the appropriate type.
+ */
+ virtual CORBA::Object_ptr resolve (const CosNaming::Name &n
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName));
+
+ /**
+ * Remove the name binding from the context. When compound names
+ * are used, unbind is defined as follows: ctx->unbind (<c1; c2;
+ * cn>) = (ctx->resolve (<c1; c2; cn-1>))->unbind (<cn>)
+ */
+ virtual void unbind (const CosNaming::Name &n
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName));
+
+
+ /**
+ * This operation returns a new naming context implemented by the
+ * same naming server in which the operation was invoked. The
+ * context is not bound.
+ */
+ virtual CosNaming::NamingContext_ptr new_context (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * This operation creates a new context and binds it to the name
+ * supplied as an argument. The newly-created context is
+ * implemented by the same server as the context in which it was
+ * bound (the name argument excluding the last component).
+ */
+ virtual CosNaming::NamingContext_ptr bind_new_context (
+ const CosNaming::Name &n
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::AlreadyBound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName));
+
+ /**
+ * Delete the naming context. The user should take care to <unbind> any
+ * bindings in which the given context is bound to some names, to
+ * avoid dangling references when invoking <destroy> operation.
+ * NOTE: <destory> is a no-op on the root context.
+ * NOTE: after <destroy> is invoked on a Naming Context, all
+ * BindingIterators associated with that Naming Context are also destroyed.
+ */
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::NotEmpty));
+
+ /**
+ * Returns at most the requested number of bindings <how_many> in
+ * <bl>. If the naming context contains additional bindings, they
+ * are returned with a BindingIterator. In the naming context does
+ * not contain any additional bindings <bi> returned as null.
+ */
+ virtual void list (CORBA::ULong how_many,
+ CosNaming::BindingList_out bl,
+ CosNaming::BindingIterator_out bi
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * Stringify the name using '\' as the escape character. The
+ * characters '.' , '/' and '\' are to be escaped. If the input name
+ * is invalid i.e. if the number of characters in the name is zero,
+ * an InvalidName exception is to be raised.
+ */
+ virtual char * to_string (const CosNaming::Name &n
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::InvalidName));
+
+ /**
+ * The in parameter is an stringified name. This function removes the
+ * escape character '\' and destringifies the stringified name and returns
+ * it.
+ */
+ virtual CosNaming::Name * to_name (const char *sn
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNaming::NamingContext::InvalidName));
+
+ /**
+ * The in parameter addr refers to the address of the naming context
+ * and sn refers to the strigified name of the object in that
+ * context. This function returns a fully formed URL string like
+ * iiopname://1.1@myhost.555xyz.com:9999/a/b/c
+ */
+ virtual char * to_url ( const char * addr,
+ const char * sn
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNaming::NamingContextExt::InvalidAddress,
+ CosNaming::NamingContext::InvalidName
+ ));
+
+ /**
+ * Similar to <resolve> as in the CosNaming::NamingContext interface.
+ * It accepts a strigified name as an argument instead of a Name.
+ */
+ virtual CORBA::Object_ptr resolve_str (const char * n
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNaming::NamingContext::NotFound,
+ CosNaming::NamingContext::CannotProceed,
+ CosNaming::NamingContext::InvalidName
+ ));
+
+ /// Returns the Default POA of this Servant object
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+private:
+
+ enum Hint
+ {
+ HINT_ID,
+ HINT_KIND
+ };
+
+ /**
+ * This private function is used as a helper to <to_name>. It reads
+ * character by character from 'src' and depending on the character,
+ * either assigns it to 'dest' or returns back to the calling
+ * function. If the character is a seperator between the 'id' and
+ * 'kind' fields or a seperator between two name components, the
+ * control is returned back to the calling function <to_name>.
+ */
+ void to_name_helper (char *dest, const char*& src, Hint hint);
+
+ /**
+ * This method functions similar to <to_name_helper>. If the
+ * character read is '.' or '/' or '\', an escape character '\' is
+ * prepended before the character.
+ */
+ void to_string_helper_assign (char * &k, const char * &src);
+
+ /**
+ * This method helps count the number of characters in 'src' so
+ * that memory can be allocated for the return parameter. For
+ * all '.' , '/' and '\', the count is incremented by 'one' to
+ * account for the escape character that needs to be
+ * added. Seperators between 'id' and 'kind' as well as seperators
+ * between the name components are also counted.
+ */
+ void to_string_helper_length (CORBA::ULong &len, const char * &src);
+
+ /// Return 1 if the character is alphanumeric or a non-scaped
+ /// punctuation.
+ static int to_url_is_alnum_or_punctuation (char c);
+
+ /// Validate the to_url() method input, and compute the size of the
+ /// returned URL address.
+ static size_t to_url_validate_and_compute_size (const char *add,
+ const char *sn
+ ACE_ENV_ARG_DECL);
+
+protected:
+
+ /// A concrete implementor of the NamingContext functions.
+ TAO_Naming_Context_Impl *impl_;
+};
+
+/**
+ * @class TAO_Naming_Context_Impl
+ *
+ * @brief This abstract base class plays a role of the 'Implementor' in the Bridge
+ * pattern architecture of the NamingContext implementation.
+ *
+ * Subclasses of TAO_Naming_Context_Impl provide concrete
+ * implementations of the NamingContext functionality.
+ */
+class TAO_Naming_Serv_Export TAO_Naming_Context_Impl
+{
+
+public:
+
+ /// Destructor.
+ virtual ~TAO_Naming_Context_Impl (void);
+
+ // = CosNaming::NamingContext idl interface methods.
+
+ /**
+ * Create a binding for name <n> and object <obj> in the naming
+ * context. Compound names are treated as follows: ctx->bind (<c1;
+ * c2; c3; cn>, obj) = (ctx->resolve (<c1; c2; cn-1>))->bind (<cn>,
+ * obj) if the there already exists a binding for the specified
+ * name, <AlreadyBound> exception is thrown. Naming contexts should
+ * be bound using <bind_context> and <rebind_context> in order to
+ * participate in name resolution later.
+ */
+ virtual void bind (const CosNaming::Name &n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL) = 0;
+
+ /**
+ * This is similar to <bind> operation above, except for when the
+ * binding for the specified name already exists in the specified
+ * context. In that case, the existing binding is replaced with the
+ * new one.
+ */
+ virtual void rebind (const CosNaming::Name &n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL) = 0;
+
+ /**
+ * This is the version of <bind> specifically for binding naming
+ * contexts, so that they will participate in name resolution when
+ * compound names are passed to be resolved.
+ */
+ virtual void bind_context (const CosNaming::Name &n,
+ CosNaming::NamingContext_ptr nc
+ ACE_ENV_ARG_DECL) = 0;
+
+ /**
+ * This is a version of <rebind> specifically for naming contexts,
+ * so that they can participate in name resolution when compound
+ * names are passed.
+ */
+ virtual void rebind_context (const CosNaming::Name &n,
+ CosNaming::NamingContext_ptr nc
+ ACE_ENV_ARG_DECL) = 0;
+
+ /**
+ * Return object reference that is bound to the name. Compound name
+ * resolve is defined as follows: ctx->resolve (<c1; c2; cn>) =
+ * ctx->resolve (<c1; c2 cn-1>)->resolve (<cn>) The naming service
+ * does not return the type of the object. Clients are responsible
+ * for "narrowing" the object to the appropriate type.
+ */
+ virtual CORBA::Object_ptr resolve (const CosNaming::Name &n
+ ACE_ENV_ARG_DECL) = 0;
+
+ /**
+ * Remove the name binding from the context. When compound names
+ * are used, unbind is defined as follows: ctx->unbind (<c1; c2;
+ * cn>) = (ctx->resolve (<c1; c2; cn-1>))->unbind (<cn>)
+ */
+ virtual void unbind (const CosNaming::Name &n
+ ACE_ENV_ARG_DECL) = 0;
+
+ /**
+ * This operation returns a new naming context implemented by the
+ * same naming server in which the operation was invoked. The
+ * context is not bound.
+ */
+ virtual CosNaming::NamingContext_ptr new_context (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ /**
+ * This operation creates a new context and binds it to the name
+ * supplied as an argument. The newly-created context is
+ * implemented by the same server as the context in which it was
+ * bound (the name argument excluding the last component).
+ */
+ virtual CosNaming::NamingContext_ptr bind_new_context (const CosNaming::Name &n
+ ACE_ENV_ARG_DECL) = 0;
+
+ /**
+ * Delete the naming context. The user should take care to <unbind> any
+ * bindings in which the given context is bound to some names, to
+ * avoid dangling references when invoking <destroy> operation.
+ * NOTE: <destory> is a no-op on the root context.
+ * NOTE: after <destroy> is invoked on a Naming Context, all
+ * BindingIterators associated with that Naming Context are also destroyed.
+ */
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ /**
+ * Returns at most the requested number of bindings <how_many> in
+ * <bl>. If the naming context contains additional bindings, they
+ * are returned with a BindingIterator. In the naming context does
+ * not contain any additional bindings <bi> returned as null.
+ */
+ virtual void list (CORBA::ULong how_many,
+ CosNaming::BindingList_out &bl,
+ CosNaming::BindingIterator_out &bi
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Returns the Default POA of this Servant object
+ virtual PortableServer::POA_ptr _default_POA (void) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_NAMING_CONTEXT_INTERFACE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.cpp
new file mode 100644
index 00000000000..6426cb81819
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.cpp
@@ -0,0 +1,98 @@
+// $Id$
+
+// ================================================================
+// LIBRARY
+// libTAO_CosNaming.so
+//
+// DESCRIPTION
+// This class allows for dynamically loading
+// the Naming Service.
+//
+// AUTHORS
+// Priyanka Gontla <pgontla@ece.uci.edu>
+// Carlos O'Ryan <coryan@uci.edu>
+// ================================================================
+
+#include "orbsvcs/Naming/Naming_Loader.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/Argv_Type_Converter.h"
+
+ACE_RCSID (Naming, Naming_Loader, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Naming_Loader::TAO_Naming_Loader (void)
+{
+ // Constructor
+}
+
+TAO_Naming_Loader::~TAO_Naming_Loader (void)
+{
+ // Destructor
+}
+
+int
+TAO_Naming_Loader::init (int argc, ACE_TCHAR *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Copy command line parameter.
+ ACE_Argv_Type_Converter command_line(argc, argv);
+
+ // Initialize the ORB
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (command_line.get_argc(),
+ command_line.get_ASCII_argv(),
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This function call initializes the Naming Service
+ CORBA::Object_var object =
+ this->create_object (orb.in (),
+ command_line.get_argc(),
+ command_line.get_TCHAR_argv ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // @@ Should we log this???
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+TAO_Naming_Loader::fini (void)
+{
+ // Remove the Naming Service.
+ return this->naming_server_.fini ();
+}
+
+CORBA::Object_ptr
+TAO_Naming_Loader::create_object (CORBA::ORB_ptr orb,
+ int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ int result;
+
+ // Initializes the Naming Service. Returns -1
+ // on an error.
+ result = this->naming_server_.init_with_orb (argc,
+ argv,
+ orb);
+ if (result == -1)
+ return CORBA::Object::_nil ();
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_Naming_Serv, TAO_Naming_Loader)
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.h b/TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.h
new file mode 100644
index 00000000000..9f9543ce3f9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.h
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+// FILENAME
+// Naming_Loader.h
+//
+// DESCRIPTION
+// This class loads the Naming Service dynamically
+// either from svc.conf file or <string_to_object> call.
+//
+// AUTHORS
+// Priyanka Gontla <pgontla@ece.uci.edu>
+//
+// ============================================================================
+
+#ifndef TAO_NAMING_LOADER_H
+#define TAO_NAMING_LOADER_H
+
+#include "tao/Object_Loader.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Naming/Naming_Server.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Naming_Serv_Export TAO_Naming_Loader : public TAO_Object_Loader
+{
+public:
+
+ /// Constructor
+ TAO_Naming_Loader (void);
+
+ /// Destructor
+ ~TAO_Naming_Loader (void);
+
+ /// Called by the Service Configurator framework to initialize the
+ /// Event Service. Defined in <ace/Service_Config.h>
+ virtual int init (int argc, ACE_TCHAR *argv[]);
+
+ /// Called by the Service Configurator framework to remove the
+ /// Event Service. Defined in <ace/Service_Config.h>
+ virtual int fini (void);
+
+ /// This function call initializes the Naming Service given a reference to the
+ /// ORB and the command line parameters.
+ virtual CORBA::Object_ptr create_object (CORBA::ORB_ptr orb,
+ int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+ protected:
+ /// Instance of the TAO_Naming_Server
+ TAO_Naming_Server naming_server_;
+
+private:
+ TAO_Naming_Loader (const TAO_Naming_Loader &);
+ TAO_Naming_Loader &operator = (const TAO_Naming_Loader &);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DECLARE (TAO_Naming_Serv, TAO_Naming_Loader)
+
+#endif /* TAO_NAMING_LOADER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp
new file mode 100644
index 00000000000..5ea0c3bbc03
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp
@@ -0,0 +1,768 @@
+// $Id$
+
+#include "orbsvcs/Naming/Naming_Server.h"
+#include "orbsvcs/Naming/Transient_Naming_Context.h"
+#include "orbsvcs/Naming/Persistent_Context_Index.h"
+#include "orbsvcs/Naming/Storable_Naming_Context.h"
+#include "orbsvcs/Naming/Storable_Naming_Context_Activator.h"
+#include "orbsvcs/Naming/Flat_File_Persistence.h"
+#include "orbsvcs/CosNamingC.h"
+
+#include "tao/debug.h"
+#include "tao/default_ports.h"
+#include "tao/ORB_Core.h"
+
+#include "tao/IORTable/IORTable.h"
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+#include "tao/Messaging/Messaging.h"
+#endif
+
+#include "tao/AnyTypeCode/Any.h"
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (Naming,
+ Naming_Server,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Naming_Server::TAO_Naming_Server (void)
+ : naming_context_ (),
+ ior_multicast_ (0),
+ naming_service_ior_ (),
+ context_index_ (0),
+ ior_file_name_ (0),
+ pid_file_name_ (0),
+ context_size_ (ACE_DEFAULT_MAP_SIZE),
+ persistence_file_name_ (0),
+ base_address_ (TAO_NAMING_BASE_ADDR),
+ multicast_ (0),
+ use_storable_context_ (0),
+ use_servant_activator_ (0),
+ servant_activator_ (0),
+ use_redundancy_(0),
+ round_trip_timeout_ (0),
+ use_round_trip_timeout_ (0)
+{
+}
+
+TAO_Naming_Server::TAO_Naming_Server (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ size_t context_size,
+ ACE_Time_Value *timeout,
+ int resolve_for_existing_naming_service,
+ const ACE_TCHAR *persistence_location,
+ void *base_addr,
+ int enable_multicast,
+ int use_storable_context,
+ int round_trip_timeout,
+ int use_round_trip_timeout)
+ : naming_context_ (),
+ ior_multicast_ (0),
+ naming_service_ior_ (),
+ context_index_ (0),
+ ior_file_name_ (0),
+ pid_file_name_ (0),
+ context_size_ (ACE_DEFAULT_MAP_SIZE),
+ persistence_file_name_ (0),
+ base_address_ (TAO_NAMING_BASE_ADDR),
+ multicast_ (0),
+ use_storable_context_ (use_storable_context),
+ use_servant_activator_ (0),
+ servant_activator_ (0),
+ use_redundancy_(0),
+ round_trip_timeout_ (0),
+ use_round_trip_timeout_ (0)
+{
+ if (this->init (orb,
+ poa,
+ context_size,
+ timeout,
+ resolve_for_existing_naming_service,
+ persistence_location,
+ base_addr,
+ enable_multicast,
+ use_storable_context,
+ round_trip_timeout,
+ use_round_trip_timeout) == -1)
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) %p\n",
+ "TAO_Naming_Server::init"));
+}
+
+
+int
+TAO_Naming_Server::init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ size_t context_size,
+ ACE_Time_Value *timeout,
+ int resolve_for_existing_naming_service,
+ const ACE_TCHAR *persistence_location,
+ void *base_addr,
+ int enable_multicast,
+ int use_storable_context,
+ int round_trip_timeout,
+ int use_round_trip_timeout)
+{
+ if (resolve_for_existing_naming_service)
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Try to find an existing Naming Service.
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references ("NameService",
+ timeout
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (!CORBA::is_nil (naming_obj.in ()))
+ {
+ //
+ // Success in finding a Naming Service.
+ //
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "\nNameService found!\n"));
+
+ this->naming_context_ =
+ CosNaming::NamingContext::_narrow (naming_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->naming_service_ior_ =
+ orb->object_to_string (naming_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return 0;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Naming_Server::init");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ }
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "\nWe'll become a NameService\n"));
+
+ // Become a Naming Service.
+ return this->init_new_naming (orb,
+ poa,
+ persistence_location,
+ base_addr,
+ context_size,
+ enable_multicast,
+ use_storable_context,
+ round_trip_timeout,
+ use_round_trip_timeout);
+}
+
+int
+TAO_Naming_Server::parse_args (int argc,
+ ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("b:do:p:s:f:m:u:r:z:"));
+
+ int c;
+ int size, result;
+
+ // This is declared this way to avoid warnings from
+ // some compilers that complain about mismatching types
+ // in the sscanf.
+#if ACE_SIZEOF_VOID_P == ACE_SIZEOF_LONG_LONG
+ ptrdiff_t address;
+#else
+ long int address;
+#endif /* ACE_SIZEOF_VOID_P */
+
+ // Make sure only one persistence option is specified
+ int f_opt_used = 0;
+ int u_opt_used = 0;
+ int r_opt_used = 0;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // debug flag.
+ TAO_debug_level++;
+ break;
+ case 'o': // outputs the naming service ior to a file.
+ this->ior_file_name_ = get_opts.opt_arg ();
+ break;
+ case 'p':
+ this->pid_file_name_ = get_opts.opt_arg ();
+ break;
+ case 's':
+ size = ACE_OS::atoi (get_opts.opt_arg ());
+ if (size >= 0)
+ this->context_size_ = size;
+ break;
+ case 'b':
+ result = ::sscanf (ACE_TEXT_ALWAYS_CHAR (get_opts.opt_arg ()),
+#if ACE_SIZEOF_VOID_P == ACE_SIZEOF_LONG_LONG
+ ACE_INT64_FORMAT_SPECIFIER,
+#else
+ "%ld",
+#endif /* ACE_SIZEOF_VOID_P */
+ &address);
+ if (result == 0 || result == EOF)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to process <-b> option"),
+ -1);
+ this->base_address_ = (void *) address;
+ break;
+ case 'm':
+ this->multicast_ = ACE_OS::atoi(get_opts.opt_arg ());
+ break;
+ case 'f':
+ this->persistence_file_name_ = get_opts.opt_arg ();
+ f_opt_used = 1;
+ break;
+ case 'r':
+ this->use_redundancy_ = 1;
+ this->use_storable_context_ = 1;
+ this->persistence_file_name_ = get_opts.opt_arg ();
+ r_opt_used = 1;
+ break;
+ case 'u':
+ this->use_storable_context_ = 1;
+ this->persistence_file_name_ = get_opts.opt_arg ();
+ u_opt_used = 1;
+ break;
+ case 'z':
+ this->use_round_trip_timeout_ = 1;
+ this->round_trip_timeout_ = (int)1.0e7 * ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("usage: %s ")
+ ACE_TEXT ("-d ")
+ ACE_TEXT ("-o <ior_output_file> ")
+ ACE_TEXT ("-p <pid_file_name> ")
+ ACE_TEXT ("-s <context_size> ")
+ ACE_TEXT ("-b <base_address> ")
+ ACE_TEXT ("-m <1=enable multicast, 0=disable multicast(default) ")
+ ACE_TEXT ("-f <persistence_file_name> ")
+ ACE_TEXT ("-u <storable_persistence_directory (not used with -f)> ")
+ ACE_TEXT ("-r <redundant_persistence_directory> ")
+ ACE_TEXT ("-z <relative round trip timeout> ")
+ ACE_TEXT ("\n"),
+ argv [0]),
+ -1);
+ }
+
+ if (f_opt_used + u_opt_used + r_opt_used > 1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Only one persistence option can be passed")
+ ACE_TEXT ("\n")),
+ -1);
+
+ return 0;
+}
+
+int
+TAO_Naming_Server::init_with_orb (int argc,
+ ACE_TCHAR *argv [],
+ CORBA::ORB_ptr orb)
+{
+ int result;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Duplicate the ORB
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+
+ // Get the POA from the ORB.
+ 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,
+ ACE_TEXT(" (%P|%t) Unable to initialize the POA.\n")),
+ -1);
+ }
+
+ // Check the non-ORB arguments. this needs to come before we
+ // initialize my_naming_server so that we can pass on some of
+ // the command-line arguments.
+ result = this->parse_args (argc, argv);
+
+ if (result < 0)
+ return result;
+
+ // Get the POA object.
+ this->root_poa_ = PortableServer::POA::_narrow (poa_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_Manager.
+ 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;
+
+ int numPolicies = 2;
+#if (TAO_HAS_MINIMUM_POA == 0)
+ if (this->use_storable_context_)
+ {
+ this->use_servant_activator_ = 1;
+ }
+
+ if (this->use_servant_activator_) {
+ numPolicies += 2;
+ }
+#endif /* TAO_HAS_MINIMUM_POA */
+
+ CORBA::PolicyList policies (numPolicies);
+ policies.length (numPolicies);
+
+ // Id Assignment policy
+ policies[0] =
+ this->root_poa_->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Lifespan policy
+ policies[1] =
+ this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+ if (this->use_servant_activator_)
+ {
+ // Request Processing Policy
+ policies[2] =
+ this->root_poa_->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Servant Retention Policy
+ policies[3] =
+ this->root_poa_->create_servant_retention_policy (PortableServer::RETAIN
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+#endif /* TAO_HAS_MINIMUM_POA */
+
+ // We use a different POA, otherwise the user would have to change
+ // the object key each time it invokes the server.
+ this->ns_poa_ = this->root_poa_->create_POA ("NameService",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ // Warning! If create_POA fails, then the policies won't be
+ // destroyed and there will be hell to pay in memory leaks!
+ ACE_TRY_CHECK;
+
+ // Creation of the new POAs 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;
+ }
+
+ result = this->init (orb,
+ this->ns_poa_.in (),
+ this->context_size_,
+ 0,
+ 0,
+ this->persistence_file_name_,
+ this->base_address_,
+ this->multicast_,
+ this->use_storable_context_,
+ this->round_trip_timeout_,
+ this->use_round_trip_timeout_);
+ if (result == -1)
+ return result;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Naming_Server::init_with_orb");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ if (this->ior_file_name_ != 0)
+ {
+ FILE *iorf = ACE_OS::fopen (this->ior_file_name_, ACE_TEXT("w"));
+ if (iorf == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("Unable to open %s for writing:(%u) %p\n"),
+ this->ior_file_name_,
+ errno,
+ ACE_TEXT("TAO_Naming_Server::init_with_orb")),
+ -1);
+ }
+
+ CORBA::String_var str = this->naming_service_ior ();
+
+ ACE_OS::fprintf (iorf, "%s\n", str.in ());
+ ACE_OS::fclose (iorf);
+ }
+
+ if (this->pid_file_name_ != 0)
+ {
+ FILE *pidf = ACE_OS::fopen (this->pid_file_name_, ACE_TEXT("w"));
+ if (pidf != 0)
+ {
+ ACE_OS::fprintf (pidf,
+ "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pidf);
+ }
+ }
+
+ return 0;
+}
+
+int
+TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ const ACE_TCHAR *persistence_location,
+ void *base_addr,
+ size_t context_size,
+ int enable_multicast,
+ int use_storable_context,
+ int round_trip_timeout,
+ int use_round_trip_timeout)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ if (use_storable_context)
+ {
+ // In lieu of a fully implemented service configurator version
+ // of this Reader and Writer, let's just take something off the
+ // command line for now.
+ TAO_Naming_Service_Persistence_Factory* pf = 0;
+ ACE_NEW_RETURN(pf, TAO_NS_FlatFileFactory, -1);
+ auto_ptr<TAO_Naming_Service_Persistence_Factory> persFactory(pf);
+ // This instance will either get deleted after recreate all or,
+ // in the case of a servant activator's use, on destruction of the
+ // activator.
+
+ // Was a location specified?
+ if (persistence_location == 0)
+ {
+ // No, assign the default location "NameService"
+ persistence_location = ACE_TEXT("NameService");
+ }
+
+ // Now make sure this directory exists
+ if (ACE_OS::access (persistence_location, W_OK|X_OK))
+ {
+ ACE_ERROR ((LM_ERROR, "Invalid persistence directory\n"));
+ return -1;
+ }
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+ if (this->use_servant_activator_)
+ {
+ ACE_NEW_THROW_EX (this->servant_activator_,
+ TAO_Storable_Naming_Context_Activator (orb,
+ persFactory.get(),
+ persistence_location,
+ context_size),
+ CORBA::NO_MEMORY ());
+ this->ns_poa_->set_servant_manager(this->servant_activator_);
+ }
+#endif /* TAO_HAS_MINIMUM_POA */
+
+ this->naming_context_ =
+ TAO_Storable_Naming_Context::recreate_all (orb,
+ poa,
+ TAO_ROOT_NAMING_CONTEXT,
+ context_size,
+ 0,
+ persFactory.get(),
+ persistence_location,
+ use_redundancy_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->use_servant_activator_)
+ persFactory.release();
+ }
+ else if (persistence_location != 0)
+ //
+ // Initialize Persistent Naming Service.
+ //
+ {
+ // Allocate and initialize Persistent Context Index.
+ ACE_NEW_RETURN (this->context_index_,
+ TAO_Persistent_Context_Index (orb, poa),
+ -1);
+
+ if (this->context_index_->open (persistence_location,
+ base_addr) == -1
+ || this->context_index_->init (context_size) == -1)
+ {
+ if (TAO_debug_level >0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_Naming_Server: context_index initialization failed\n"));
+ return -1;
+ }
+
+ // Set the root Naming Context reference.
+ this->naming_context_ =
+ this->context_index_->root_context ();
+ }
+ else
+ {
+ //
+ // Initialize Transient Naming Service.
+ //
+ this->naming_context_ =
+ TAO_Transient_Naming_Context::make_new_context (poa,
+ TAO_ROOT_NAMING_CONTEXT,
+ context_size
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+
+ // Register with the ORB's resolve_initial_references()
+ // mechanism. Primarily useful for dynamically loaded Name
+ // Services.
+ orb->register_initial_reference ("NameService",
+ this->naming_context_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Set the ior of the root Naming Context.
+ this->naming_service_ior_=
+ orb->object_to_string (this->naming_context_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var table_object =
+ orb->resolve_initial_references ("IORTable" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ IORTable::Table_var adapter =
+ IORTable::Table::_narrow (table_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil (adapter.in ()))
+ {
+ ACE_ERROR ((LM_ERROR, "Nil IORTable\n"));
+ }
+ else
+ {
+ CORBA::String_var ior =
+ orb->object_to_string (this->naming_context_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ adapter->bind ("NameService", ior.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+#if defined (ACE_HAS_IP_MULTICAST)
+ if (enable_multicast)
+ {
+ // @@ Marina: is there anyway to implement this stuff
+ // without using ORB_Core_instance()? For example can you
+ // pass the ORB as an argument?
+
+ //
+ // Install ior multicast handler.
+ //
+ // Get reactor instance from TAO.
+ ACE_Reactor *reactor = orb->orb_core()->reactor ();
+
+ // See if the -ORBMulticastDiscoveryEndpoint option was specified.
+ ACE_CString mde (orb->orb_core ()->orb_params ()->mcast_discovery_endpoint ());
+
+ // First, see if the user has given us a multicast port number
+ // on the command-line;
+ u_short port =
+ orb->orb_core ()->orb_params ()->service_port (TAO::MCAST_NAMESERVICE);
+
+ if (port == 0)
+ {
+ // Check environment var. for multicast port.
+ const char *port_number =
+ ACE_OS::getenv ("NameServicePort");
+
+ if (port_number != 0)
+ port = static_cast<u_short> (ACE_OS::atoi (port_number));
+ }
+
+ // Port wasn't specified on the command-line or in environment -
+ // use the default.
+ if (port == 0)
+ port = TAO_DEFAULT_NAME_SERVER_REQUEST_PORT;
+
+ // Instantiate a handler which will handle client requests for
+ // the root Naming Context ior, received on the multicast port.
+ ACE_NEW_RETURN (this->ior_multicast_,
+ TAO_IOR_Multicast (),
+ -1);
+
+ if (mde.length () != 0)
+ {
+ if (this->ior_multicast_->init (this->naming_service_ior_.in (),
+ mde.c_str (),
+ TAO_SERVICEID_NAMESERVICE) == -1)
+ return -1;
+ }
+ else
+ {
+ if (this->ior_multicast_->init (this->naming_service_ior_.in (),
+ port,
+ ACE_DEFAULT_MULTICAST_ADDR,
+ TAO_SERVICEID_NAMESERVICE) == -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,
+ "TAO_Naming_Server: cannot register Event handler\n"));
+ return -1;
+ }
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_Naming_Server: The multicast server setup is done.\n"));
+ }
+#else
+ ACE_UNUSED_ARG (enable_multicast);
+#endif /* ACE_HAS_IP_MULTICAST */
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+ if (use_round_trip_timeout == 1)
+ {
+ TimeBase::TimeT roundTripTimeoutVal = round_trip_timeout;
+ CORBA::Any anyObjectVal;
+ anyObjectVal <<= roundTripTimeoutVal;
+ CORBA::PolicyList polList (1);
+ polList.length (1);
+ polList[0] = orb->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
+ anyObjectVal);
+ ACE_TRY_CHECK;
+
+ // set a timeout on the orb
+ //
+ CORBA::Object_var orbPolicyManagerObj =
+ orb->resolve_initial_references ("ORBPolicyManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::PolicyManager_var orbPolicyManager =
+ CORBA::PolicyManager::_narrow (orbPolicyManagerObj.in ());
+ ACE_TRY_CHECK;
+ orbPolicyManager->set_policy_overrides (polList, CORBA::SET_OVERRIDE);
+
+ polList[0]->destroy ();
+ ACE_TRY_CHECK;
+ polList[0] = CORBA::Policy::_nil ();
+ }
+#else
+ ACE_UNUSED_ARG (use_round_trip_timeout);
+#endif /* TAO_HAS_CORBA_MESSAGING */
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Naming_Server::init_new_naming");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+TAO_Naming_Server::fini (void)
+{
+ // Destroy the child POA ns_poa that is created when initializing
+ // the Naming Service
+ ACE_TRY_NEW_ENV
+ {
+ this->ns_poa_->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ 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
+ {
+ adapter->unbind ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore
+ }
+ ACE_ENDTRY;
+
+
+ if (this->ior_multicast_ != 0)
+ {
+ orb_->orb_core()->reactor ()->remove_handler (this->ior_multicast_,
+ ACE_Event_Handler::READ_MASK | ACE_Event_Handler::DONT_CALL);
+ delete this->ior_multicast_;
+ }
+
+ delete this->context_index_;
+
+ return 0;
+}
+
+char*
+TAO_Naming_Server::naming_service_ior (void)
+{
+ return CORBA::string_dup (this->naming_service_ior_.in ());
+}
+
+CosNaming::NamingContext_ptr
+TAO_Naming_Server::operator-> (void) const
+{
+ return this->naming_context_.ptr ();
+}
+
+TAO_Naming_Server::~TAO_Naming_Server (void)
+{
+#if (TAO_HAS_MINIMUM_POA == 0)
+ if (this->use_servant_activator_)
+ delete this->servant_activator_;
+#endif /* TAO_HAS_MINIMUM_POA */
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.h b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.h
new file mode 100644
index 00000000000..5d7c3919fb6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.h
@@ -0,0 +1,239 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Naming_Server.h
+ *
+ * $Id$
+ *
+ * Implement wrappers useful to Naming Service servers.
+ *
+ *
+ * @author Nagarajan Surendran (naga@cs.wustl.edu)
+ * @author Matt Braun <mjb2@cs.wustl.edu>
+ * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>.
+ */
+//=============================================================================
+
+
+#ifndef TAO_NAMING_SERVER_H
+#define TAO_NAMING_SERVER_H
+#include /**/ "ace/pre.h"
+
+#include "tao/ORB.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/IOR_Multicast.h"
+#include "orbsvcs/Naming/Naming_Context_Interface.h"
+#include "orbsvcs/Naming/nsconf.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward decl;
+class TAO_Persistent_Context_Index;
+class TAO_Storable_Naming_Context_Activator;
+
+/**
+ * @class TAO_Naming_Server
+ *
+ * @brief Defines a wrapper class that holds the root Naming Context.
+ *
+ * This class either finds an existing Naming Service (if the
+ * <resolve_for_existing_naming_service> flag is set) or creates
+ * one (if <resolve_for_existing_naming_service> flag isn't set or
+ * Naming Service was not found). This class also defines the
+ * operator-> so that <NamingContext> functions like <bind>,
+ * <unbind> .. can be called directly on a <TAO_Naming_Server>
+ * object, and be forwareded to the root Naming Context.
+ * This class is intended to simplify
+ * programs that want to play the role of a Naming Service
+ * server. To simplify programs that want to play the role of
+ * Naming Service clients, use <TAO_Naming_Client>.
+ * If a Naming Service is created locally, a TAO_IOR_Multicast
+ * event handler is created and installed on the ORB's reactor.
+ * This event handler allows other clients on the network to
+ * discover and use this Naming Service.
+ * Event handler listens on a multicast port for messages from
+ * clients looking for a Naming Service, and sends back the ior
+ * of the root Naming Context. For more information on how this
+ * bootstraping through a multicast process works, check out
+ * orbsvcs/orbsvcs/TAO_IOR_Multicast.*, implementation of
+ * <resolve_initial_references>, and orbsvcs/Naming/README.
+ */
+class TAO_Naming_Serv_Export TAO_Naming_Server
+{
+public:
+ /// Default constructor.
+ TAO_Naming_Server (void);
+
+ /**
+ * Constructor. Attempts to find an existing Naming Service if
+ * <resolve_for_existing_naming_service> is set to true. If it is
+ * false, or no Naming Service was found during a <timeout> period,
+ * create the Naming Service in this process. If creating the
+ * Naming Service locally, make the root context of size
+ * <context_size>, register it under the <poa>, and make the Naming
+ * Service persistent if <persistence_location> is not 0.
+ * (<persistence_location> specifies name of the file to use for
+ * persistent storage, <base_addr> specifies the address used for
+ * memory mapping <persistent_location> file).
+ * If <enable_multicast> is not zero then the service will respond
+ * to multicast location queries.
+ */
+ TAO_Naming_Server (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ size_t context_size = ACE_DEFAULT_MAP_SIZE,
+ ACE_Time_Value *timeout = 0,
+ int resolve_for_existing_naming_service = 1,
+ const ACE_TCHAR *persistence_location = 0,
+ void *base_addr = TAO_NAMING_BASE_ADDR,
+ int enable_multicast = 1,
+ int use_storable_context = 0,
+ int round_trip_timeout = 0,
+ int use_round_trip_timeout = 0);
+
+ /**
+ * Initializer. Attempts to find an existing Naming Service if
+ * <resolve_for_existing_naming_service> is set to true. If it is
+ * false, or no Naming Service was found during a <timeout> period,
+ * create the Naming Service in this process. If creating the
+ * Naming Service locally, make the root context of size
+ * <context_size>, register it under the <poa>, and make the Naming
+ * Service persistent if <persistence_location> is not 0.
+ * (<persistence_location> specifies name of the file to use for
+ * persistent storage, <base_addr> specifies the address used for
+ * memory mapping <persistent_location> file).
+ * If <enable_multicast> is not zero then the service will respond
+ * to multicast location queries.
+ */
+ int init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ size_t context_size = ACE_DEFAULT_MAP_SIZE,
+ ACE_Time_Value *timeout = 0,
+ int resolve_for_existing_naming_service = 1,
+ const ACE_TCHAR *persistence_location = 0,
+ void *base_addr = TAO_NAMING_BASE_ADDR,
+ int enable_multicast = 1,
+ int use_storable_context = 0,
+ int round_trip_timeout = 0,
+ int use_round_trip_timeout = 0);
+
+ /// Initialize the Naming Service with the command line arguments and
+ /// the ORB.
+ int init_with_orb (int argc,
+ ACE_TCHAR *argv [],
+ CORBA::ORB_ptr orb);
+
+ /// Destroy the child POA created in <init_with_orb>
+ int fini (void);
+
+ /// Destructor.
+ ~TAO_Naming_Server (void);
+
+ /// Returns the IOR of the naming service.
+ char * naming_service_ior (void);
+
+ /// Returns a <NamingContext_ptr> for the root Naming Context.
+ CosNaming::NamingContext_ptr operator-> (void) const;
+
+protected:
+ /**
+ * Helper method: create Naming Service locally.
+ * Make the root context of size
+ * <context_size>, register it under the <root_poa>, and make the Naming
+ * Service persistent if <persistence_location> is not 0.
+ * (<persistence_location> specifies name of the file to use for
+ * persistent storage).
+ * If <enable_multicast> is not zero then the service will respond
+ * to multicast location queries.
+ */
+ int init_new_naming (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr root_poa,
+ const ACE_TCHAR *persistence_location,
+ void *base_addr,
+ size_t context_size,
+ int enable_multicast,
+ int use_storable_context,
+ int round_trip_timeout = 0,
+ int use_round_trip_timeout = 0);
+
+ /// parses the arguments.
+ int parse_args (int argc, ACE_TCHAR *argv[]);
+
+ /// Root NamingContext_ptr.
+ CosNaming::NamingContext_var naming_context_;
+
+ /// The ior_multicast event handler.
+ TAO_IOR_Multicast *ior_multicast_;
+
+ /// The IOR string of the root naming context.
+ CORBA::String_var naming_service_ior_;
+
+ /**
+ * Pointer to the object used to create/initialize
+ * the Naming Service when local persistent Naming Service is
+ * desired.
+ */
+ TAO_Persistent_Context_Index *context_index_;
+
+ /// The ORB
+ CORBA::ORB_var orb_;
+
+ /// The Root POA.
+ PortableServer::POA_var root_poa_;
+
+ /// The Naming Service POA.
+ PortableServer::POA_var ns_poa_;
+
+ /// File to output the Naming Service IOR.
+ const ACE_TCHAR *ior_file_name_;
+
+ /// File to output the process id.
+ const ACE_TCHAR *pid_file_name_;
+
+ /**
+ * Size of the hash_table allocated upon the creation of the Naming
+ * Service context (if one is created). Note: all the contexts
+ * created under the given context will use the same size for their
+ * initial hash table allocations.
+ */
+ size_t context_size_;
+
+ /// Path to the file to be used to store/read in Naming Service
+ /// persistent state.
+ const ACE_TCHAR *persistence_file_name_;
+
+ /// Address to be used for memory mapping Naming Service state file,
+ /// identified by the <persistence_file_name_>.
+ void *base_address_;
+
+ /// If not zero multicast is enabled.
+ int multicast_;
+
+ /// If not zero use flat file persistence
+ int use_storable_context_;
+
+ /**
+ * If not zero use servant activator that uses flat file persistence.
+ */
+ int use_servant_activator_;
+
+ /**
+ * Need to retain the servant activator between calls to
+ * init_with_orb() and init_new_naming().
+ */
+ TAO_Storable_Naming_Context_Activator *servant_activator_;
+
+ /**
+ * If not zero support redundant naming servers.
+ */
+ int use_redundancy_;
+
+ // If not zero use round trip timeout policy set to value specified
+ int round_trip_timeout_;
+ int use_round_trip_timeout_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_NAMING_SERVER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Service_Container.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Service_Container.cpp
new file mode 100644
index 00000000000..a9d8fd2b50b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Service_Container.cpp
@@ -0,0 +1,392 @@
+// $Id$
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// Naming_Service_Container.cpp
+//
+// = AUTHOR
+// Bruce Trask <trask_b@ociweb.com>
+//
+// ============================================================================
+
+
+#ifndef NS_CONTAINER_CPP
+#define NS_CONTAINER_CPP
+
+#include "ace/Malloc_Base.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Naming/Naming_Service_Container.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_ALLOC_HOOK_DEFINE(ACE_NS_Node)
+
+# if ! defined (ACE_HAS_BROKEN_NOOP_DTORS)
+template <class T>
+ACE_NS_Node<T>::~ACE_NS_Node (void)
+{
+}
+# endif /* ! defined (ACE_HAS_BROKEN_NOOP_DTORS) */
+
+template <class T>
+ACE_NS_Node<T>::ACE_NS_Node (const T &i, ACE_NS_Node<T> *n)
+ : next_ (n),
+ item_ (i)
+{
+ // ACE_TRACE ("ACE_NS_Node<T>::ACE_NS_Node");
+}
+
+template <class T>
+ACE_NS_Node<T>::ACE_NS_Node (ACE_NS_Node<T> *n, int)
+ : next_ (n)
+{
+ // ACE_TRACE ("ACE_NS_Node<T>::ACE_NS_Node");
+}
+
+template <class T>
+ACE_NS_Node<T>::ACE_NS_Node (const ACE_NS_Node<T> &s)
+ : next_ (s.next_),
+ item_ (s.item_)
+{
+ // ACE_TRACE ("ACE_NS_Node<T>::ACE_NS_Node");
+}
+
+
+ACE_ALLOC_HOOK_DEFINE(ACE_Unbounded_List)
+
+ template <class T> size_t
+ACE_Unbounded_List<T>::size (void) const
+{
+ // ACE_TRACE ("ACE_Unbounded_List<T>::size");
+ return this->cur_size_;
+}
+
+template <class T> int
+ACE_Unbounded_List<T>::insert_tail (const T &item)
+{
+ ACE_NS_Node<T> *temp;
+
+ // Insert <item> into the old dummy node location.
+ this->head_->item_ = item;
+
+ // Create a new dummy node.
+ ACE_NEW_MALLOC_RETURN (temp,
+ (ACE_NS_Node<T>*) this->allocator_->malloc (sizeof (ACE_NS_Node<T>)),
+ ACE_NS_Node<T> (this->head_->next_),
+ -1);
+ // Link this pointer into the list.
+ this->head_->next_ = temp;
+
+ // Point the head to the new dummy node.
+ this->head_ = temp;
+
+ this->cur_size_++;
+ return 0;
+}
+
+template <class T> void
+ACE_Unbounded_List<T>::reset (void)
+{
+ ACE_TRACE ("reset");
+
+ this->delete_nodes ();
+}
+
+template <class T> void
+ACE_Unbounded_List<T>::dump (void) const
+{
+ ACE_TRACE ("ACE_Unbounded_List<T>::dump");
+
+ ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nhead_ = %u"), this->head_));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nhead_->next_ = %u"), this->head_->next_));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncur_size_ = %d\n"), this->cur_size_));
+
+ T *item = 0;
+#if !defined (ACE_NLOGGING)
+ size_t count = 1;
+#endif /* ! ACE_NLOGGING */
+
+ for (ACE_Unbounded_List_Iterator<T> iter (*(ACE_Unbounded_List<T> *) this);
+ iter.next (item) != 0;
+ iter.advance ())
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("count = %d\n"), count++));
+
+ ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
+}
+
+template <class T> void
+ACE_Unbounded_List<T>::copy_nodes (const ACE_Unbounded_List<T> &us)
+{
+ for (ACE_NS_Node<T> *curr = us.head_->next_;
+ curr != us.head_;
+ curr = curr->next_)
+ this->insert_tail (curr->item_);
+}
+
+template <class T> void
+ACE_Unbounded_List<T>::delete_nodes (void)
+{
+ ACE_NS_Node<T> *curr = this->head_->next_;
+
+ // Keep looking until we've hit the dummy node.
+
+ while (curr != this->head_)
+ {
+ ACE_NS_Node<T> *temp = curr;
+ curr = curr->next_;
+ ACE_DES_FREE_TEMPLATE (temp,
+ this->allocator_->free,
+ ACE_NS_Node,
+ <T>);
+ this->cur_size_--;
+ }
+
+ // Reset the list to be a circular list with just a dummy node.
+ this->head_->next_ = this->head_;
+}
+
+template <class T>
+ACE_Unbounded_List<T>::~ACE_Unbounded_List (void)
+{
+ // ACE_TRACE ("ACE_Unbounded_List<T>::~ACE_Unbounded_List");
+
+ this->delete_nodes ();
+
+ // Delete the dummy node.
+ ACE_DES_FREE_TEMPLATE (head_,
+ this->allocator_->free,
+ ACE_NS_Node,
+ <T>);
+ this->head_ = 0;
+}
+
+template <class T>
+ACE_Unbounded_List<T>::ACE_Unbounded_List (ACE_Allocator *alloc)
+ : head_ (0),
+ cur_size_ (0),
+ allocator_ (alloc)
+{
+ // ACE_TRACE ("ACE_Unbounded_List<T>::ACE_Unbounded_List");
+
+ if (this->allocator_ == 0)
+ this->allocator_ = ACE_Allocator::instance ();
+
+ ACE_NEW_MALLOC (this->head_,
+ (ACE_NS_Node<T>*) this->allocator_->malloc (sizeof (ACE_NS_Node<T>)),
+ ACE_NS_Node<T>);
+ // Make the list circular by pointing it back to itself.
+ this->head_->next_ = this->head_;
+}
+
+template <class T>
+ACE_Unbounded_List<T>::ACE_Unbounded_List (const ACE_Unbounded_List<T> &us)
+ : head_ (0),
+ cur_size_ (0),
+ allocator_ (us.allocator_)
+{
+ ACE_TRACE ("ACE_Unbounded_List<T>::ACE_Unbounded_List");
+
+ if (this->allocator_ == 0)
+ this->allocator_ = ACE_Allocator::instance ();
+
+ ACE_NEW_MALLOC (this->head_,
+ (ACE_NS_Node<T>*) this->allocator_->malloc (sizeof (ACE_NS_Node<T>)),
+ ACE_NS_Node<T>);
+ this->head_->next_ = this->head_;
+ this->copy_nodes (us);
+}
+
+template <class T> void
+ACE_Unbounded_List<T>::operator= (const ACE_Unbounded_List<T> &us)
+{
+ ACE_TRACE ("ACE_Unbounded_List<T>::operator=");
+
+ if (this != &us)
+ {
+ this->delete_nodes ();
+ this->copy_nodes (us);
+ }
+}
+
+template <class T> int
+ACE_Unbounded_List<T>::insert (const T &item)
+{
+ ACE_TRACE ("ACE_Unbounded_List<T>::insert");
+ return this->insert_tail (item);
+}
+
+template <class T> int
+ACE_Unbounded_List<T>::remove (const T &item)
+{
+ // ACE_TRACE ("ACE_Unbounded_List<T>::remove");
+
+ // Insert the item to be founded into the dummy node.
+ this->head_->item_ = item;
+
+ ACE_NS_Node<T> *curr = this->head_;
+
+ while (!(curr->next_->item_ == item))
+ curr = curr->next_;
+
+ if (curr->next_ == this->head_)
+ return -1; // Item was not found.
+ else
+ {
+ ACE_NS_Node<T> *temp = curr->next_;
+ // Skip over the node that we're deleting.
+ curr->next_ = temp->next_;
+ this->cur_size_--;
+ ACE_DES_FREE_TEMPLATE (temp,
+ this->allocator_->free,
+ ACE_NS_Node,
+ <T>);
+ return 0;
+ }
+}
+
+template <class T> ACE_Unbounded_List_Iterator<T>
+ACE_Unbounded_List<T>::begin (void)
+{
+ // ACE_TRACE ("ACE_Unbounded_List<T>::begin");
+ return ACE_Unbounded_List_Iterator<T> (*this);
+}
+
+template <class T> ACE_Unbounded_List_Iterator<T>
+ACE_Unbounded_List<T>::end (void)
+{
+ // ACE_TRACE ("ACE_Unbounded_List<T>::end");
+ return ACE_Unbounded_List_Iterator<T> (*this, 1);
+}
+
+
+ACE_ALLOC_HOOK_DEFINE(ACE_Unbounded_List_Iterator)
+
+ template <class T> void
+ACE_Unbounded_List_Iterator<T>::dump (void) const
+{
+ // ACE_TRACE ("ACE_Unbounded_List_Iterator<T>::dump");
+}
+
+template <class T>
+ACE_Unbounded_List_Iterator<T>::ACE_Unbounded_List_Iterator (ACE_Unbounded_List<T> &s, int end)
+ : current_ (end == 0 ? s.head_->next_ : s.head_ ),
+ set_ (&s)
+{
+ // ACE_TRACE ("ACE_Unbounded_List_Iterator<T>::ACE_Unbounded_List_Iterator");
+}
+
+template <class T> int
+ACE_Unbounded_List_Iterator<T>::advance (void)
+{
+ // ACE_TRACE ("ACE_Unbounded_List_Iterator<T>::advance");
+ this->current_ = this->current_->next_;
+ return this->current_ != this->set_->head_;
+}
+
+template <class T> int
+ACE_Unbounded_List_Iterator<T>::first (void)
+{
+ // ACE_TRACE ("ACE_Unbounded_List_Iterator<T>::first");
+ this->current_ = this->set_->head_->next_;
+ return this->current_ != this->set_->head_;
+}
+
+template <class T> int
+ACE_Unbounded_List_Iterator<T>::done (void) const
+{
+ ACE_TRACE ("ACE_Unbounded_List_Iterator<T>::done");
+
+ return this->current_ == this->set_->head_;
+}
+
+template <class T> int
+ACE_Unbounded_List_Iterator<T>::next (T *&item)
+{
+ // ACE_TRACE ("ACE_Unbounded_List_Iterator<T>::next");
+ if (this->current_ == this->set_->head_)
+ return 0;
+ else
+ {
+ item = &this->current_->item_;
+ return 1;
+ }
+}
+
+template <class T> ACE_Unbounded_List_Iterator<T>
+ACE_Unbounded_List_Iterator<T>::operator++ (int)
+{
+ //ACE_TRACE ("ACE_Unbounded_List_Iterator<T>::operator++ (int)");
+ ACE_Unbounded_List_Iterator<T> retv (*this);
+
+ // postfix operator
+
+ this->advance ();
+ return retv;
+}
+
+template <class T> ACE_Unbounded_List_Iterator<T>&
+ACE_Unbounded_List_Iterator<T>::operator++ (void)
+{
+ // ACE_TRACE ("ACE_Unbounded_List_Iterator<T>::operator++ (void)");
+
+ // prefix operator
+
+ this->advance ();
+ return *this;
+}
+
+template <class T> T&
+ACE_Unbounded_List_Iterator<T>::operator* (void)
+{
+ //ACE_TRACE ("ACE_Unbounded_List_Iterator<T>::operator*");
+ T *retv = 0;
+
+ int result = this->next (retv);
+ ACE_ASSERT (result != 0);
+ ACE_UNUSED_ARG (result);
+
+ return *retv;
+}
+
+template <class T> bool
+ACE_Unbounded_List_Iterator<T>::operator== (const ACE_Unbounded_List_Iterator<T> &rhs) const
+{
+ //ACE_TRACE ("ACE_Unbounded_List_Iterator<T>::operator==");
+ return (this->set_ == rhs.set_ && this->current_ == rhs.current_);
+}
+
+template <class T> bool
+ACE_Unbounded_List_Iterator<T>::operator!= (const ACE_Unbounded_List_Iterator<T> &rhs) const
+{
+ //ACE_TRACE ("ACE_Unbounded_List_Iterator<T>::operator!=");
+ return (this->set_ != rhs.set_ || this->current_ != rhs.current_);
+}
+
+// ---
+
+template <class T> int
+ACE_Unbounded_List<T>::is_empty (void) const
+{
+ ACE_TRACE ("ACE_Unbounded_List<T>::is_empty");
+ return this->head_ == this->head_->next_;
+}
+
+template <class T> int
+ACE_Unbounded_List<T>::is_full (void) const
+{
+ ACE_TRACE ("ACE_Unbounded_List<T>::is_full");
+ return 0; // We should implement a "node of last resort for this..."
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#endif /* NS_CONTAINERS_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Service_Container.h b/TAO/orbsvcs/orbsvcs/Naming/Naming_Service_Container.h
new file mode 100644
index 00000000000..0d4a61f123f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Service_Container.h
@@ -0,0 +1,234 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Naming_Service_Container.h
+ *
+ * $Id$
+ *
+ * @author Bruce Trask <trask_b@ociweb.com>
+ */
+//=============================================================================
+
+
+
+#ifndef NS_CONTAINER_H
+#define NS_CONTAINER_H
+#include /**/ "ace/pre.h"
+
+#include "ace/ACE.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+#include "tao/orbconf.h"
+
+// Need by ACE_DLList_Node.
+#include "ace/Containers.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Allocator;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class T> class ACE_Unbounded_List;
+template <class T> class ACE_Unbounded_List_Iterator;
+
+/**
+ * @class ACE_NS_Node
+ *
+ * @brief Implementation element in a Queue, List, and Stack.
+ */
+template<class T>
+class ACE_NS_Node
+{
+public:
+ friend class ACE_Unbounded_List<T>;
+ friend class ACE_Unbounded_List_Iterator<T>;
+
+# if ! defined (ACE_HAS_BROKEN_NOOP_DTORS)
+ /// This isn't necessary, but it keeps some compilers happy.
+ ~ACE_NS_Node (void);
+# endif /* ! defined (ACE_HAS_BROKEN_NOOP_DTORS) */
+
+private:
+ // = Initialization methods
+ ACE_NS_Node (const T &i, ACE_NS_Node<T> *n);
+ ACE_NS_Node (ACE_NS_Node<T> *n = 0, int = 0);
+ ACE_NS_Node (const ACE_NS_Node<T> &n);
+
+ /// Pointer to next element in the list of <ACE_NS_Node>s.
+ ACE_NS_Node<T> *next_;
+
+ /// Current value of the item in this node.
+ T item_;
+};
+
+/**
+ * @class ACE_Unbounded_List_Iterator
+ *
+ * @brief Implement an iterator over an unbounded List.
+ */
+template <class T>
+class ACE_Unbounded_List_Iterator
+{
+public:
+ // = Initialization method.
+ ACE_Unbounded_List_Iterator (ACE_Unbounded_List<T> &s, int end = 0);
+
+ // = Iteration methods.
+
+ /// Pass back the <next_item> that hasn't been seen in the List.
+ /// Returns 0 when all items have been seen, else 1.
+ int next (T *&next_item);
+
+ /// Move forward by one element in the List. Returns 0 when all the
+ /// items in the List have been seen, else 1.
+ int advance (void);
+
+ /// Move to the first element in the List. Returns 0 if the
+ /// List is empty, else 1.
+ int first (void);
+
+ /// Returns 1 when all items have been seen, else 0.
+ int done (void) const;
+
+ /// Dump the state of an object.
+ void dump (void) const;
+
+ // = STL styled iteration, compare, and reference functions.
+
+ /// Postfix advance.
+ ACE_Unbounded_List_Iterator<T> operator++ (int);
+
+ /// Prefix advance.
+ ACE_Unbounded_List_Iterator<T>& operator++ (void);
+
+ /// Returns a reference to the interal element <this> is pointing to.
+ T& operator* (void);
+
+ /// Check if two iterators point to the same position
+ bool operator== (const ACE_Unbounded_List_Iterator<T> &) const;
+ bool operator!= (const ACE_Unbounded_List_Iterator<T> &) const;
+
+ /// Declare the dynamic allocation hooks.
+ ACE_ALLOC_HOOK_DECLARE;
+
+private:
+
+ /// Pointer to the current node in the iteration.
+ ACE_NS_Node<T> *current_;
+
+ /// Pointer to the set we're iterating over.
+ ACE_Unbounded_List<T> *set_;
+};
+
+/**
+ * @class ACE_Unbounded_List
+ *
+ * @brief Implement a simple unordered set of <T> of unbounded size.
+ *
+ * This implementation of an unordered set uses a circular
+ * linked list with a dummy node. This implementation does not
+ * allow duplicates, but it maintains FIFO ordering of insertions.
+ */
+template <class T>
+class ACE_Unbounded_List
+{
+public:
+ friend class ACE_Unbounded_List_Iterator<T>;
+
+ // Trait definition.
+ typedef ACE_Unbounded_List_Iterator<T> ITERATOR;
+ typedef ACE_Unbounded_List_Iterator<T> iterator;
+
+ // = Initialization and termination methods.
+ /// Constructor. Use user specified allocation strategy
+ /// if specified.
+ ACE_Unbounded_List (ACE_Allocator *alloc = 0);
+
+ /// Copy constructor.
+ ACE_Unbounded_List (const ACE_Unbounded_List<T> &);
+
+ /// Assignment operator.
+ void operator= (const ACE_Unbounded_List<T> &);
+
+ /// Destructor.
+ ~ACE_Unbounded_List (void);
+
+ // = Check boundary conditions.
+
+ /// Returns 1 if the container is empty, otherwise returns 0.
+ int is_empty (void) const;
+
+ /// Returns 1 if the container is full, otherwise returns 0.
+ int is_full (void) const;
+
+ // = Classic unordered set operations.
+
+ /**
+ * Insert <new_item> into the set (doesn't allow duplicates).
+ * Returns -1 if failures occur, 1 if item is already present, else
+ * 0.
+ */
+ int insert (const T &new_item);
+
+ /**
+ * Remove first occurrence of <item> from the set. Returns 0 if
+ * it removes the item, -1 if it can't find the item, and -1 if a
+ * failure occurs.
+ */
+ int remove (const T &item);
+
+ /// Size of the set.
+ size_t size (void) const;
+
+ /// Dump the state of an object.
+ void dump (void) const;
+
+ /// Reset the <ACE_Unbounded_List> to be empty.
+ void reset (void);
+
+ // = STL-styled unidirectional iterator factory.
+ ACE_Unbounded_List_Iterator<T> begin (void);
+ ACE_Unbounded_List_Iterator<T> end (void);
+
+ /// Declare the dynamic allocation hooks.
+ ACE_ALLOC_HOOK_DECLARE;
+
+private:
+ /// Insert <item> at the tail of the set (doesn't check for
+ /// duplicates).
+ int insert_tail (const T &item);
+
+ /// Delete all the nodes in the List.
+ void delete_nodes (void);
+
+ /// Copy nodes into this set.
+ void copy_nodes (const ACE_Unbounded_List<T> &);
+
+ /// Head of the linked list of NS_Nodes.
+ ACE_NS_Node<T> *head_;
+
+ /// Current size of the set.
+ size_t cur_size_;
+
+ /// Allocation strategy of the set.
+ ACE_Allocator *allocator_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Naming/Naming_Service_Container.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Naming_Service_Container.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* NS_CONTAINERS_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp
new file mode 100644
index 00000000000..97c2407a6bb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp
@@ -0,0 +1,310 @@
+// $Id$
+
+#include "orbsvcs/Naming/Persistent_Context_Index.h"
+#include "orbsvcs/Naming/Persistent_Naming_Context.h"
+
+#include "tao/debug.h"
+
+#include "ace/Auto_Ptr.h"
+#include "ace/OS_NS_unistd.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int
+TAO_Persistent_Context_Index::unbind (const char *poa_id)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, -1);
+
+ TAO_Persistent_Index_ExtId name (poa_id);
+ TAO_Persistent_Index_IntId entry;
+ if (this->index_->unbind (name, entry, this->allocator_) != 0)
+ return -1;
+ else
+ {
+ // Free up the memory we allocated in bind().
+ this->allocator_->free ((void *) (entry.counter_));
+ return 0;
+ }
+}
+
+int
+TAO_Persistent_Context_Index::bind (const char *poa_id,
+ ACE_UINT32 *&counter,
+ TAO_Persistent_Context_Index::CONTEXT *hash_map)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, -1);
+
+ // Allocate memory for items to be stored in the table.
+ size_t poa_id_len = ACE_OS::strlen (poa_id) + 1;
+ size_t counter_len = sizeof (ACE_UINT32);
+ char *ptr = (char *) this->allocator_->malloc (poa_id_len + counter_len);
+
+ if (ptr == 0)
+ return -1;
+ else
+ {
+ // Populate memory with data.
+ counter = reinterpret_cast<ACE_UINT32 *> (ptr);
+ *counter = 0;
+ char * poa_id_ptr = ptr + counter_len;
+ ACE_OS::strcpy (poa_id_ptr, poa_id);
+
+ TAO_Persistent_Index_ExtId name (poa_id_ptr);
+ TAO_Persistent_Index_IntId entry (counter, hash_map);
+ int result = -1;
+
+ // Do a normal bind. This will fail if there's already an
+ // entry with the same name.
+ result = this->index_->bind (name, entry, this->allocator_);
+
+ if (result == 1)
+ {
+ // Entry already existed so bind failed. Free our dynamically
+ // allocated memory.
+ this->allocator_->free ((void *) ptr);
+ return result;
+ }
+
+ if (result == -1)
+ // Free our dynamically allocated memory.
+ this->allocator_->free ((void *) ptr);
+ else
+ // If bind() succeed, it will automatically sync
+ // up the map manager entry. However, we must sync up our
+ // name/value memory.
+ this->allocator_->sync (ptr, poa_id_len + counter_len);
+
+ return result;
+ }
+}
+
+TAO_Persistent_Context_Index::TAO_Persistent_Context_Index
+ (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa)
+ : allocator_ (0),
+ index_ (0),
+ index_file_ (0),
+ base_address_ (0),
+ orb_ (CORBA::ORB::_duplicate (orb)),
+ poa_ (PortableServer::POA::_duplicate (poa))
+{
+}
+
+TAO_Persistent_Context_Index::~TAO_Persistent_Context_Index (void)
+{
+ delete allocator_;
+ ACE_OS::free (reinterpret_cast<void *> (const_cast<ACE_TCHAR *> (index_file_)));
+}
+
+ACE_Allocator*
+TAO_Persistent_Context_Index::allocator (void)
+{
+ return allocator_;
+}
+
+CosNaming::NamingContext_ptr
+TAO_Persistent_Context_Index::root_context (void)
+{
+ return CosNaming::NamingContext::_duplicate (root_context_.in ());
+}
+
+CORBA::ORB_ptr
+TAO_Persistent_Context_Index::orb (void)
+{
+ return orb_.in ();
+}
+
+int
+TAO_Persistent_Context_Index::open (const ACE_TCHAR *file_name,
+ void *base_address)
+{
+ this->base_address_ = base_address;
+
+ index_file_ = ACE_OS::strdup (file_name);
+ if (index_file_ == 0)
+ return -1;
+
+ return create_index ();
+}
+
+int
+TAO_Persistent_Context_Index::init (size_t context_size)
+{
+ // Note: in case of an early exit from this (or helper) function due
+ // to an error condition, we rely on POA to clean up all of the servants
+ // already registered with it.
+
+ // Return value of this function (necessary to keep compilers quiet).
+ int status = 0;
+
+ if (index_->current_size () == 0)
+ // CASE 1:there are no Naming Contexts registered. We need to create
+ // one.
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ this->root_context_ =
+ TAO_Persistent_Naming_Context::make_new_context (poa_.in (),
+ TAO_ROOT_NAMING_CONTEXT,
+ context_size,
+ this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ else
+ // CASE 2:Recreate all Naming Contexts.
+ status = recreate_all ();
+
+ return status;
+}
+
+int
+TAO_Persistent_Context_Index::recreate_all (void)
+{
+ CONTEXT_INDEX::ITERATOR *index_iter = 0;
+
+ ACE_NEW_RETURN (index_iter,
+ (CONTEXT_INDEX::ITERATOR) (*index_),
+ -1);
+
+ ACE_Auto_Basic_Ptr<CONTEXT_INDEX::ITERATOR> it (index_iter);
+
+ // Because of broken old g++!!!
+ typedef ACE_Hash_Map_With_Allocator<TAO_Persistent_Index_ExtId,
+ TAO_Persistent_Index_IntId> IND_DEF;
+
+ IND_DEF::ENTRY *entry = 0;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Starting to recreate Naming Contexts from the file... \n"));
+
+ // For each entry in <index_>, create a Naming Context servant.
+ do
+ {
+ index_iter->next (entry);
+
+ // Put together a servant for the new Naming Context.
+
+ TAO_Persistent_Naming_Context *context_impl = 0;
+ ACE_NEW_RETURN (context_impl,
+ TAO_Persistent_Naming_Context (poa_.in (),
+ entry->ext_id_.poa_id_,
+ this,
+ entry->int_id_.hash_map_,
+ entry->int_id_.counter_),
+ -1);
+
+
+ // Put <context_impl> into the auto pointer temporarily, in case next
+ // allocation fails.
+ ACE_Auto_Basic_Ptr<TAO_Persistent_Naming_Context> temp (context_impl);
+
+ TAO_Naming_Context *context = 0;
+ ACE_NEW_RETURN (context,
+ TAO_Naming_Context (context_impl),
+ -1);
+
+ // Let <implementation> know about it's <interface>.
+ context_impl->interface (context);
+
+ // Release auto pointer and start using reference counting to
+ // control our servant.
+ temp.release ();
+ PortableServer::ServantBase_var s = context;
+
+ // Register with the POA.
+ ACE_DECLARE_NEW_CORBA_ENV;
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId (entry->ext_id_.poa_id_);
+
+ this->poa_->activate_object_with_id (id.in (),
+ context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNaming::NamingContext_var result = context->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // If this is the root Naming Context, take a note of it.
+ if (context_impl->root ())
+ this->root_context_= result._retn ();
+
+ } while (index_iter->advance ());
+
+ return 0;
+}
+
+int
+TAO_Persistent_Context_Index::create_index (void)
+{
+ // Make sure that the file name is of the legal length.
+ if (ACE_OS::strlen (index_file_) >= MAXNAMELEN + MAXPATHLEN)
+ {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
+
+#if !defined (CHORUS)
+ ACE_MMAP_Memory_Pool::OPTIONS options (base_address_);
+#else
+ // Use base address == 0, don't use a fixed address.
+ ACE_MMAP_Memory_Pool::OPTIONS options (0,
+ 0,
+ 0,
+ ACE_CHORUS_LOCAL_NAME_SPACE_T_SIZE);
+#endif /* CHORUS */
+
+ // Create the allocator with the appropriate options. The name used
+ // for the lock is the same as one used for the file.
+ ACE_NEW_RETURN (this->allocator_,
+ ALLOCATOR (this->index_file_,
+ this->index_file_,
+ &options),
+ -1);
+
+#if !defined (ACE_LACKS_ACCESS)
+ // Now check if the backing store has been created successfully.
+ if (ACE_OS::access (this->index_file_, F_OK) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "create_index\n"),
+ -1);
+#endif /* ACE_LACKS_ACCESS */
+
+ void *context_index = 0;
+
+ // This is the easy case since if we find hash table in the
+ // memory-mapped file we know it's already initialized.
+ if (this->allocator_->find (TAO_NAMING_CONTEXT_INDEX, context_index) == 0)
+ this->index_ = (CONTEXT_INDEX *) context_index;
+
+ // Create a new <index_> (because we've just created a new
+ // memory-mapped file).
+ else
+ {
+ size_t index_size = sizeof (CONTEXT_INDEX);
+ context_index = this->allocator_->malloc (index_size);
+
+ if (context_index == 0
+ || create_index_helper (context_index) == -1
+ || this->allocator_->bind (TAO_NAMING_CONTEXT_INDEX,
+ context_index) == -1)
+ {
+ // Attempt to clean up.
+ ACE_ERROR ((LM_ERROR,
+ "create_index\n"));
+ this->allocator_->remove ();
+ return -1;
+ }
+ }
+ return 0;
+}
+
+int
+TAO_Persistent_Context_Index::create_index_helper (void *buffer)
+{
+ this->index_ = new (buffer) CONTEXT_INDEX (this->allocator_);
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.h b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.h
new file mode 100644
index 00000000000..97bd7b76018
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.h
@@ -0,0 +1,171 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Persistent_Context_Index.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PERSISTENT_CONTEXT_INDEX_H
+#define TAO_PERSISTENT_CONTEXT_INDEX_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Naming/Persistent_Entries.h"
+#include "orbsvcs/Naming/naming_serv_export.h"
+#include "orbsvcs/Naming/nsconf.h"
+#include "tao/PortableServer/PortableServer.h"
+
+#include "ace/Malloc_T.h"
+#include "ace/MMAP_Memory_Pool.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Persistent_Context_Index
+ *
+ * @brief This class facilitates implementation of Persistent
+ * Naming Service. It keeps track, centrally, of several pieces of
+ * info for each Persistent Naming Context, allowing to perform the
+ * initialization necessary for each Naming Context to
+ * restore the state of the Naming Service from persistent storage
+ * on server start-up.
+ *
+ * This class creates a memory-mapped file, allocates a hash
+ * table from that file, and uses the hash table to store POA id,
+ * and table and counter pointers for each Persistent Naming
+ * Context. There are methods for adding and deleting entries
+ * from this hash table as new Persistent Naming Contexts are
+ * created and old ones are destroyed. This hash table
+ * facilitates Persistent Naming Context servant initialization
+ * upon Naming Server start-up.
+ */
+class TAO_Naming_Serv_Export TAO_Persistent_Context_Index
+{
+public:
+ // = Some typedefs for convenience.
+
+ /// Hash map in which we will store info about each Persistent Naming Context.
+ typedef ACE_Hash_Map_With_Allocator<TAO_Persistent_Index_ExtId,
+ TAO_Persistent_Index_IntId> CONTEXT_INDEX;
+
+ /// Hash map used by Persistent Naming Context to keep its state.
+ typedef ACE_Hash_Map_With_Allocator<TAO_Persistent_ExtId,
+ TAO_Persistent_IntId> CONTEXT;
+
+ /// Allocator we will be using to make the Naming Service persistent.
+ typedef ACE_Allocator_Adapter <ACE_Malloc <ACE_MMAP_MEMORY_POOL, TAO_SYNCH_MUTEX>
+ > ALLOCATOR;
+
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_Persistent_Context_Index (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa);
+
+ /**
+ * Create ACE_Allocator, open/create memory-mapped file with the
+ * specified file name/base address. Find or allocate <index_>.
+ * Return 0 on success or -1 on failure.
+ */
+ int open (const ACE_TCHAR *file_name,
+ void * base_address = TAO_NAMING_BASE_ADDR);
+
+ /**
+ * If <index_> contains no entries (i.e., was just created), create
+ * a root Persistent Naming Context servant with table of size
+ * <context_size>, and make an entry for it
+ * in the <index_>. If <index_> contains entries, create a
+ * Persistent Naming Context servant for each entry. Return 0 on
+ * success and -1 on failure.
+ */
+ int init (size_t context_size);
+
+ /**
+ * Destructor. The memory mapped file that was opened/created is
+ * not deleted, since we want it to keep the state of the Naming
+ * Service until the next run.
+ */
+ ~TAO_Persistent_Context_Index (void);
+
+ // = Methods for adding/removing entries.
+
+ /**
+ * Create an entry for a Persistent Naming Context in <index_>,
+ * i.e., a context with <poa_id>, <counter> and <hash_map> has just
+ * been created, and is registering with us.
+ */
+ int bind (const char *poa_id,
+ ACE_UINT32 *&counter,
+ CONTEXT *hash_map);
+
+ /// Remove an entry for the Persistent Naming Context with <poa_id>
+ /// from <index_> (i.e., this context has just been destroyed).
+ int unbind (const char *poa_id);
+
+ // = Accessors.
+
+ /// Return allocator.
+ ACE_Allocator *allocator (void);
+
+ /// Return orb pointer.
+ CORBA::ORB_ptr orb (void);
+
+ /// Return a pointer to the root Naming Context (returns a copy - must be
+ /// deallocated by the user).
+ CosNaming::NamingContext_ptr root_context (void);
+
+private:
+
+ /// Helper for the <init> method. Iterates over <index_>, and
+ /// creates a servant for each entry.
+ int recreate_all (void);
+
+ /// Helper for the <open> method.
+ int create_index (void);
+
+ /// Helper for <create_index> method: places hash table into an
+ /// allocated space.
+ int create_index_helper (void *buffer);
+
+ /// Lock to prevent multiple threads from modifying entries in the
+ /// <index_> simultanneously.
+ TAO_SYNCH_MUTEX lock_;
+
+ /**
+ * Allocator that deals out memory from a memory-mapped file. We
+ * use it here, and in TAO_Persistent_Naming_Context, whenever we
+ * deal with data that should be kept in persistent store.
+ */
+ ALLOCATOR *allocator_;
+
+ /// Hash map where we keep entries for all Persistent Naming
+ /// Contexts.
+ CONTEXT_INDEX *index_;
+
+ /// Name of the memory-mapped file used by <allocator_>.
+ const ACE_TCHAR *index_file_;
+
+ /// Base address for the memory-mapped file.
+ void *base_address_;
+
+ /// ORB. We use it for several object_to_string conversions, and
+ /// keep it around for Persistent Naming Contexts' use.
+ CORBA::ORB_var orb_;
+
+ /// POA under which to register Persistent Naming Context servants
+ /// during start-up.
+ PortableServer::POA_var poa_;
+
+ /// The reference to the root Naming Context.
+ CosNaming::NamingContext_var root_context_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_PERSISTENT_CONTEXT_INDEX_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Entries.cpp b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Entries.cpp
new file mode 100644
index 00000000000..f5d31b0874c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Entries.cpp
@@ -0,0 +1,208 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// Persistent_Entries.cpp
+//
+// = AUTHOR
+// Marina Spivak <marina@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Persistent_Entries.h"
+#include "ace/SString.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Persistent_IntId::TAO_Persistent_IntId (void)
+ : ref_ (0),
+ type_ (CosNaming::nobject)
+{
+}
+
+TAO_Persistent_IntId::TAO_Persistent_IntId (char * obj_ref,
+ CosNaming::BindingType type)
+ : ref_ (obj_ref),
+ type_ (type)
+{
+}
+
+TAO_Persistent_IntId::TAO_Persistent_IntId (const TAO_Persistent_IntId &rhs)
+{
+ ref_ = rhs.ref_;
+ type_ = rhs.type_;
+}
+
+TAO_Persistent_IntId::~TAO_Persistent_IntId (void)
+{
+}
+
+void
+TAO_Persistent_IntId::operator= (const TAO_Persistent_IntId &rhs)
+{
+ // check for self assignment.
+ if (&rhs == this)
+ return;
+
+ type_ = rhs.type_;
+ ref_ = rhs.ref_;
+}
+
+TAO_Persistent_ExtId::TAO_Persistent_ExtId (void)
+ : id_ (0),
+ kind_ (0)
+{
+}
+
+TAO_Persistent_ExtId::TAO_Persistent_ExtId (const char *id,
+ const char *kind)
+ : id_ (id),
+ kind_ (kind)
+
+{
+}
+
+TAO_Persistent_ExtId::TAO_Persistent_ExtId (const TAO_Persistent_ExtId &rhs)
+{
+ id_ = rhs.id_;
+ kind_ = rhs.kind_;
+}
+
+TAO_Persistent_ExtId::~TAO_Persistent_ExtId (void)
+{
+}
+
+void
+TAO_Persistent_ExtId::operator= (const TAO_Persistent_ExtId &rhs)
+{
+ // Check for self assignment.
+ if (&rhs == this)
+ return;
+
+ id_ = rhs.id_;
+ kind_ = rhs.kind_;
+}
+
+bool
+TAO_Persistent_ExtId::operator== (const TAO_Persistent_ExtId &rhs) const
+{
+ return (ACE_OS::strcmp (id_, rhs.id_) == 0)
+ && (ACE_OS::strcmp (kind_, rhs.kind_) == 0);
+}
+
+bool
+TAO_Persistent_ExtId::operator!= (const TAO_Persistent_ExtId &rhs) const
+{
+ return (ACE_OS::strcmp (id_, rhs.id_) != 0)
+ || (ACE_OS::strcmp (kind_, rhs.kind_) != 0);
+}
+
+u_long
+TAO_Persistent_ExtId::hash (void) const
+{
+ ACE_CString temp (id_);
+ temp += kind_;
+
+ return temp.hash ();
+}
+
+const char *
+TAO_Persistent_ExtId::id (void)
+{
+ return id_;
+}
+
+const char *
+TAO_Persistent_ExtId::kind (void)
+{
+ return kind_;
+}
+
+TAO_Persistent_Index_IntId::TAO_Persistent_Index_IntId (void)
+ : counter_ (0),
+ hash_map_ (0)
+{
+}
+
+TAO_Persistent_Index_IntId::TAO_Persistent_Index_IntId (ACE_UINT32 *counter,
+ ACE_Hash_Map_With_Allocator<TAO_Persistent_ExtId,
+ TAO_Persistent_IntId> * hash_map)
+ : counter_ (counter),
+ hash_map_ (hash_map)
+{
+}
+
+TAO_Persistent_Index_IntId::TAO_Persistent_Index_IntId (const TAO_Persistent_Index_IntId &rhs)
+{
+ counter_ = rhs.counter_;
+ hash_map_ = rhs.hash_map_;
+}
+
+TAO_Persistent_Index_IntId::~TAO_Persistent_Index_IntId (void)
+{
+}
+
+void
+TAO_Persistent_Index_IntId::operator= (const TAO_Persistent_Index_IntId &rhs)
+{
+ // check for self assignment.
+ if (&rhs == this)
+ return;
+
+ counter_ = rhs.counter_;
+ hash_map_ = rhs.hash_map_;
+}
+
+TAO_Persistent_Index_ExtId::TAO_Persistent_Index_ExtId (void)
+ : poa_id_ (0)
+{
+}
+
+TAO_Persistent_Index_ExtId::TAO_Persistent_Index_ExtId (const char *poa_id)
+ : poa_id_ (poa_id)
+{
+}
+
+TAO_Persistent_Index_ExtId::TAO_Persistent_Index_ExtId (const TAO_Persistent_Index_ExtId &rhs)
+{
+ poa_id_ = rhs.poa_id_;
+}
+
+TAO_Persistent_Index_ExtId::~TAO_Persistent_Index_ExtId (void)
+{
+}
+
+void
+TAO_Persistent_Index_ExtId::operator= (const TAO_Persistent_Index_ExtId &rhs)
+{
+ // Check for self assignment.
+ if (&rhs == this)
+ return;
+
+ poa_id_ = rhs.poa_id_;
+}
+
+bool
+TAO_Persistent_Index_ExtId::operator== (const TAO_Persistent_Index_ExtId &rhs) const
+{
+ return (ACE_OS::strcmp (poa_id_, rhs.poa_id_) == 0);
+}
+
+bool
+TAO_Persistent_Index_ExtId::operator!= (const TAO_Persistent_Index_ExtId &rhs) const
+{
+ return (ACE_OS::strcmp (poa_id_, rhs.poa_id_) != 0);
+}
+
+u_long
+TAO_Persistent_Index_ExtId::hash (void) const
+{
+ ACE_CString temp (poa_id_);
+ return temp.hash ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Entries.h b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Entries.h
new file mode 100644
index 00000000000..d418414a945
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Entries.h
@@ -0,0 +1,233 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Persistent_Entries.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PERSISTENT_ENTRIES_H
+#define TAO_PERSISTENT_ENTRIES_H
+#include /**/ "ace/pre.h"
+
+#include "ace/Hash_Map_With_Allocator_T.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Naming/naming_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Persistent_IntId
+ *
+ * @brief Helper class for TAO_Persistent_Bindings_Map: unifies several
+ * data items, so they can be stored together as a <value>
+ * for a <key> in a hash table holding the state of a Persistent
+ * Naming Context.
+ *
+ * This class holds a strigified IOR and a binding type, so
+ * they can be stored together as a <value> for a <key> in a
+ * hash table holding the state of a Persistent Naming Context.
+ * Memory for the ior isn't allocated/deallocated, this class just
+ * copies a pointer.
+ */
+class TAO_Naming_Serv_Export TAO_Persistent_IntId
+{
+public:
+ // = Initialization and termination methods.
+ /// Constructor.
+ TAO_Persistent_IntId (void);
+
+ /// Constructor.
+ TAO_Persistent_IntId (char * obj_ref,
+ CosNaming::BindingType type /* = CosNaming::nobject */);
+
+ /// Copy constructor.
+ TAO_Persistent_IntId (const TAO_Persistent_IntId & rhs);
+
+ /// Destructor.
+ ~TAO_Persistent_IntId (void);
+
+ /// Assignment operator.
+ void operator= (const TAO_Persistent_IntId & rhs);
+
+ // = Data members.
+
+ /// Stringified IOR to be stored in a Persistent Naming Context.
+ const char *ref_;
+
+ /// Binding type for <ref_>.
+ CosNaming::BindingType type_;
+};
+
+/**
+ * @class TAO_Persistent_ExtId
+ *
+ * @brief Helper class for TAO_Persistent_Bindings_Map: unifies several
+ * data items, so they can be stored together as a <key>
+ * for a <value> in a hash table holding the state of a Persistent
+ * Naming Context.
+ *
+ * This class holds id and kind strings, so
+ * they can be stored together as a <key> for a <value> in a
+ * hash table holding the state of a Persistent Naming Context.
+ * Memory for id and kind isn't allocated/deallocated, this
+ * class just copies pointers.
+ */
+class TAO_Naming_Serv_Export TAO_Persistent_ExtId
+{
+public:
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_Persistent_ExtId (void);
+
+ /// Constructor.
+ TAO_Persistent_ExtId (const char *id,
+ const char *kind);
+
+ /// Copy constructor.
+ TAO_Persistent_ExtId (const TAO_Persistent_ExtId & rhs);
+
+ /// Destructor.
+ ~TAO_Persistent_ExtId (void);
+
+ // = Assignment and comparison methods.
+
+ /// Assignment operator (does copy memory).
+ void operator= (const TAO_Persistent_ExtId & rhs);
+
+ /// Equality comparison operator (must match both id_ and kind_).
+ bool operator== (const TAO_Persistent_ExtId &rhs) const;
+
+ /// Inequality comparison operator.
+ bool operator!= (const TAO_Persistent_ExtId &rhs) const;
+
+ /// <hash> function is required in order for this class to be usable by
+ /// ACE_Hash_Map_Manager.
+ u_long hash (void) const;
+
+ // = Data members.
+
+ /// <id> portion of the name to be associated with some object
+ /// reference in a Persistent Naming Context.
+ const char * id_;
+
+ /// <kind> portion of the name to be associated with some object
+ /// reference in a Persistent Naming Context.
+ const char * kind_;
+
+ // Accessors.
+
+ const char * id (void);
+ const char * kind (void);
+};
+
+/**
+ * @class TAO_Persistent_Index_IntId
+ *
+ * @brief Helper class for TAO_Persistent_Context_Index: unifies several
+ * data items, so they can be stored together as a <value>
+ * for a <key> in a hash table holding the state of a Persistent
+ * Context Index. (Persistent Context Index is like directory
+ * that stores info about every active Naming Context).
+ *
+ * This class holds a counter and a hash map pointers, so
+ * they can be stored together as a <value> for a <key> in a
+ * hash table holding the state of a Persistent Context Index.
+ */
+class TAO_Naming_Serv_Export TAO_Persistent_Index_IntId
+{
+public:
+ // = Initialization and termination methods.
+ /// Constructor.
+ TAO_Persistent_Index_IntId (void);
+
+ /// Constructor.
+ TAO_Persistent_Index_IntId (ACE_UINT32 *counter,
+ ACE_Hash_Map_With_Allocator<TAO_Persistent_ExtId,
+ TAO_Persistent_IntId> * hash_map);
+
+ /// Copy constructor.
+ TAO_Persistent_Index_IntId (const TAO_Persistent_Index_IntId & rhs);
+
+ /// Destructor.
+ ~TAO_Persistent_Index_IntId (void);
+
+ /// Assignment operator (does copy memory).
+ void operator= (const TAO_Persistent_Index_IntId & rhs);
+
+ // = Data members.
+
+ /// Pointer to a Persistent Naming Context's counter.
+ ACE_UINT32 *counter_;
+
+ /// Pointer to a Persistent Naming Context's hash map.
+ ACE_Hash_Map_With_Allocator<TAO_Persistent_ExtId,
+ TAO_Persistent_IntId> * hash_map_;
+};
+
+/**
+ * @class TAO_Persistent_Index_ExtId
+ *
+ * @brief Helper class for TAO_Persistent_Context_Index: holds
+ * Persistent Naming Context POA id, so it can be stored as a <key>
+ * for a <value> in a hash table holding state of a Persistent
+ * Context Index. (Persistent Context Index is like directory
+ * that stores info about every active Naming Context).
+ *
+ * We need this wrapper class around the actual data because we must
+ * provide <hash> function for it to work with
+ * ACE_Hash_Map_Manager.
+ */
+class TAO_Naming_Serv_Export TAO_Persistent_Index_ExtId
+{
+public:
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_Persistent_Index_ExtId (void);
+
+ /// Constructor.
+ TAO_Persistent_Index_ExtId (const char *poa_id);
+
+ /// Copy constructor.
+ TAO_Persistent_Index_ExtId (const TAO_Persistent_Index_ExtId & rhs);
+
+ /// Destructor.
+ ~TAO_Persistent_Index_ExtId (void);
+
+ // = Assignment and comparison methods.
+
+ /// Assignment operator (does copy memory).
+ void operator= (const TAO_Persistent_Index_ExtId & rhs);
+
+ /// Equality comparison operator (must match both id_ and kind_).
+ bool operator== (const TAO_Persistent_Index_ExtId &rhs) const;
+
+ /// Inequality comparison operator.
+ bool operator!= (const TAO_Persistent_Index_ExtId &rhs) const;
+
+ /// <hash> function is required in order for this class to be usable by
+ /// ACE_Hash_Map_Manager.
+ u_long hash (void) const;
+
+ // = Data member.
+
+ /// POA id to be associated with the rest of the info for some
+ /// Persistent Naming Context in the Persistent Context Index.
+ const char * poa_id_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_PERSISTENT_ENTRIES_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp
new file mode 100644
index 00000000000..80b4a7f4aa7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp
@@ -0,0 +1,541 @@
+#include "orbsvcs/Naming/Persistent_Naming_Context.h"
+#include "orbsvcs/Naming/Persistent_Context_Index.h"
+#include "orbsvcs/Naming/Bindings_Iterator_T.h"
+#include "ace/OS_NS_stdio.h"
+
+// The following #pragma is needed to disable a warning that occurs
+// in MSVC 6 due to the overly long debugging symbols generated for
+// the ACE_Auto_Basic_Ptr<ACE_Hash_Map_Iterator_Ex<TAO_...> > template
+// instance used by some of the methods in this file.
+#ifdef _MSC_VER
+# pragma warning(disable: 4786) /* identifier was truncated to '255'
+ characters in the browser
+ information */
+#endif /* _MSC_VER */
+
+#include "ace/Auto_Ptr.h"
+
+ACE_RCSID (Naming,
+ Persistent_Naming_Context,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int
+TAO_Persistent_Bindings_Map::unbind (const char *id,
+ const char *kind)
+{
+ TAO_Persistent_ExtId name (id, kind);
+ TAO_Persistent_IntId entry;
+ if (this->map_->unbind (name, entry, this->allocator_) != 0)
+ return -1;
+ else
+ {
+ // Free up the memory we allocated in shared_bind(). Note that
+ // this assumes that the "ref" pointer comes first and that
+ // the ref, id and kind are contiguously allocated (see
+ // shared_bind() for details).
+ this->allocator_->free ((void *) (entry.ref_));
+ return 0;
+ }
+}
+
+int
+TAO_Persistent_Bindings_Map::bind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type)
+{
+ return this->shared_bind (id, kind, obj, type, 0);
+}
+
+int
+TAO_Persistent_Bindings_Map::rebind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type)
+{
+ return this->shared_bind (id, kind, obj, type, 1);
+}
+
+int
+TAO_Persistent_Bindings_Map::find (const char *id,
+ const char *kind,
+ CORBA::Object_ptr & obj,
+ CosNaming::BindingType &type)
+{
+ TAO_Persistent_ExtId name (id, kind);
+ TAO_Persistent_IntId entry;
+
+ if (this->map_->find (name,
+ entry,
+ this->allocator_) != 0)
+ return -1;
+ else
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ obj = orb_->string_to_object (entry.ref_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ type = entry.type_;
+
+ return 0;
+ }
+}
+
+TAO_Persistent_Bindings_Map::TAO_Persistent_Bindings_Map (CORBA::ORB_ptr orb)
+ : allocator_ (0),
+ map_ (0),
+ orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+TAO_Persistent_Bindings_Map::~TAO_Persistent_Bindings_Map (void)
+{
+}
+
+void
+TAO_Persistent_Bindings_Map::destroy (void)
+{
+ this->map_->ACE_Hash_Map_With_Allocator<TAO_Persistent_ExtId, TAO_Persistent_IntId>::~ACE_Hash_Map_With_Allocator ();
+ this->allocator_->free (map_);
+}
+
+TAO_Persistent_Bindings_Map::HASH_MAP *
+TAO_Persistent_Bindings_Map::map (void)
+{
+ return this->map_;
+}
+
+size_t
+TAO_Persistent_Bindings_Map::total_size (void)
+{
+ return this->map_->total_size ();
+}
+
+size_t
+TAO_Persistent_Bindings_Map::current_size (void)
+{
+ return map_->current_size ();
+}
+
+int
+TAO_Persistent_Bindings_Map::open (size_t hash_table_size,
+ ACE_Allocator *alloc)
+{
+ allocator_ = alloc;
+
+ // Use allocator to allocate space for the hash map.
+ void *hash_map = 0;
+ size_t map_size = sizeof (HASH_MAP);
+ hash_map = this->allocator_->malloc (map_size);
+
+ // If allocation failed ...
+ if (hash_map == 0)
+ return -1;
+
+ // Initialize allocated hash map through placement new.
+ if (open_helper (hash_table_size, hash_map) == -1)
+ this->allocator_->free (hash_map);
+
+ return 0;
+}
+
+int
+TAO_Persistent_Bindings_Map::open_helper (size_t hash_table_size,
+ void *buffer)
+{
+ this->map_ = new (buffer) HASH_MAP (hash_table_size, this->allocator_);
+ return 0;
+}
+
+void
+TAO_Persistent_Bindings_Map::set (HASH_MAP *map,
+ ACE_Allocator *alloc)
+{
+ allocator_ = alloc;
+ map_ = map;
+}
+
+int
+TAO_Persistent_Bindings_Map::shared_bind (const char * id,
+ const char * kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type,
+ int rebind)
+{
+ // Obtain a stringified ior of <obj> (i.e., the representation we can store).
+ ACE_DECLARE_NEW_CORBA_ENV;
+ CORBA::String_var ref = orb_->object_to_string (obj ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Calculate and allocate the memory we need to store this name to
+ // object binding.
+ size_t id_len = ACE_OS::strlen (id) + 1;
+ size_t kind_len = ACE_OS::strlen (kind) + 1;
+ size_t ref_len = ACE_OS::strlen (ref.in ()) + 1;
+ size_t total_len = id_len + kind_len + ref_len;
+ char *ptr = (char *) this->allocator_->malloc (total_len);
+
+ // Allocation failed - bail out.
+ if (ptr == 0)
+ return -1;
+
+ // Allocation succeded - place the data into the allocated memory
+ // and procceed.
+ else
+ {
+ // Note that the <ref> *must* come first to make sure we can
+ // retrieve this pointer later on in unbind().
+ char * ref_ptr = ptr;
+ char * id_ptr = ptr + ref_len;
+ char * kind_ptr = ptr + ref_len + id_len;
+ ACE_OS::strcpy (ref_ptr, ref.in ());
+ ACE_OS::strcpy (id_ptr, id);
+ ACE_OS::strcpy (kind_ptr, kind);
+
+ TAO_Persistent_ExtId new_name (id_ptr, kind_ptr);
+ TAO_Persistent_IntId new_entry (ref_ptr, type);
+ int result = -1;
+
+ if (rebind == 0)
+ {
+ // Do a normal bind. This will fail if there's already an
+ // <new_internal> with the same name.
+ result = this->map_->bind (new_name, new_entry, this->allocator_);
+
+ if (result == 1)
+ {
+ // Entry already existed so bind failed. Free our
+ // dynamically allocated memory.
+ this->allocator_->free ((void *) ptr);
+ return result;
+ }
+ }
+ else
+ // Rebind.
+ {
+ TAO_Persistent_ExtId old_name;
+ TAO_Persistent_IntId old_entry;
+
+ // Check that the types of old and new entries match.
+ if (this->map_->find (new_name,
+ old_entry,
+ this->allocator_) == 0
+ && type != old_entry.type_)
+ result = -2;
+
+ // If types match, perform rebind.
+ else
+ result = this->map_->rebind (new_name, new_entry,
+ old_name, old_entry,
+ this->allocator_);
+ if (result == 1)
+ {
+ // Free up the old binding's memory, if it was replaced.
+ // Note, this assumes that the "ref" pointer comes
+ // first, and that the id, kind, and ref are contiguously
+ // allocated (see beginning of this method for details).
+ this->allocator_->free ((void *) old_entry.ref_);
+ }
+ }
+
+ // Check for failures, and clean up dynamically allocated memory
+ // if necessary.
+ if (result < 0)
+ this->allocator_->free ((void *) ptr);
+
+ else
+ // If bind() or rebind() succeeded, they will automatically sync
+ // up the map manager entry. However, we must sync up our
+ // name/value memory.
+ this->allocator_->sync (ptr, total_len);
+
+ return result;
+ }
+}
+
+TAO_Persistent_Naming_Context::TAO_Persistent_Naming_Context (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Persistent_Context_Index *context_index)
+
+ : TAO_Hash_Naming_Context (poa,
+ poa_id),
+ counter_ (0),
+ persistent_context_ (0),
+ index_ (context_index)
+{
+ ACE_NEW (this->persistent_context_,
+ TAO_Persistent_Bindings_Map (context_index->orb ()));
+
+ // Set the superclass pointer.
+ context_ = persistent_context_;
+}
+
+TAO_Persistent_Naming_Context::TAO_Persistent_Naming_Context (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Persistent_Context_Index *context_index,
+ HASH_MAP *map,
+ ACE_UINT32 *counter)
+ : TAO_Hash_Naming_Context (poa,
+ poa_id),
+ counter_ (counter),
+ persistent_context_ (0),
+ index_ (context_index)
+{
+ ACE_NEW (this->persistent_context_,
+ TAO_Persistent_Bindings_Map (context_index->orb ()));
+
+ // Set the superclass pointer.
+ context_ = persistent_context_;
+
+ persistent_context_->set (map, index_->allocator ());
+}
+
+int
+TAO_Persistent_Naming_Context::init (size_t hash_table_size)
+{
+ return persistent_context_->open (hash_table_size, index_->allocator ());
+}
+
+TAO_Persistent_Naming_Context::~TAO_Persistent_Naming_Context (void)
+{
+ // Perform appropriate cleanup based on the destruction level specified.
+
+ if (this->destroyed_ > 1)
+ {
+ // Remove ourselves from context index.
+ index_->unbind (poa_id_.c_str ());
+ // Remove the underlying data structure from persistent storage.
+ persistent_context_->destroy ();
+ }
+ else if (this->destroyed_ == 1)
+ // Remove the underlying data structure from persistent storage.
+ persistent_context_->destroy ();
+}
+
+void
+TAO_Persistent_Naming_Context::set_cleanup_level (int level)
+{
+ this->destroyed_ = level;
+}
+
+CosNaming::NamingContext_ptr
+TAO_Persistent_Naming_Context::make_new_context (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ size_t context_size,
+ TAO_Persistent_Context_Index * ind
+ ACE_ENV_ARG_DECL)
+{
+ // Store the stub we will return here.
+ CosNaming::NamingContext_var result;
+
+ // Put together a servant for the new Naming Context.
+
+ TAO_Persistent_Naming_Context *context_impl = 0;
+ ACE_NEW_THROW_EX (context_impl,
+ TAO_Persistent_Naming_Context (poa,
+ poa_id,
+ ind),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (result._retn ());
+
+ // Put <context_impl> into the auto pointer temporarily, in case next
+ // allocation fails.
+ ACE_Auto_Basic_Ptr<TAO_Persistent_Naming_Context> temp (context_impl);
+
+ if (context_impl->init (context_size) == -1)
+ ACE_THROW_RETURN (CORBA::NO_MEMORY (), result._retn ());
+
+ // Insure appropriate cleanup in case of exception conditions ahead.
+ context_impl->set_cleanup_level (1);
+
+ // Register with the index of Naming Contexts.
+ if (ind->bind (context_impl->poa_id_.c_str (),
+ context_impl->counter_,
+ context_impl->persistent_context_->map ()) == -1)
+ ACE_THROW_RETURN (CORBA::INTERNAL (), result._retn ());
+
+ // Insure appropriate cleanup in case of exception conditions ahead.
+ context_impl->set_cleanup_level (2);
+
+ TAO_Naming_Context *context = 0;
+ ACE_NEW_THROW_EX (context,
+ TAO_Naming_Context (context_impl),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (result._retn ());
+
+ // Let <implementation> know about it's <interface>.
+ context_impl->interface (context);
+
+ // Release auto pointer, and start using reference counting to
+ // control our servant.
+ temp.release ();
+ PortableServer::ServantBase_var s = context;
+
+ // Register the new context with the POA.
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId (poa_id);
+
+ poa->activate_object_with_id (id.in (),
+ context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (result._retn ());
+
+ result = context->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ // Everything went smoothly, without errors - we don't need any cleanup.
+ context_impl->set_cleanup_level (0);
+
+ return result._retn ();
+}
+
+CosNaming::NamingContext_ptr
+TAO_Persistent_Naming_Context::new_context (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX,
+ ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (),
+ CosNaming::NamingContext::_nil ());
+
+ // Generate a POA id for the new context.
+ char poa_id[BUFSIZ];
+ ACE_OS::sprintf (poa_id,
+ "%s_%d",
+ this->poa_id_.c_str (),
+ (*this->counter_)++);
+
+ CosNaming::NamingContext_var result =
+ make_new_context (this->poa_.in (),
+ poa_id,
+ this->persistent_context_->total_size (),
+ this->index_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ return result._retn ();
+}
+
+void
+TAO_Persistent_Naming_Context::list (CORBA::ULong how_many,
+ CosNaming::BindingList_out &bl,
+ CosNaming::BindingIterator_out &bi
+ ACE_ENV_ARG_DECL)
+{
+ // Allocate nil out parameters in case we won't be able to complete
+ // the operation.
+ bi = CosNaming::BindingIterator::_nil ();
+ ACE_NEW_THROW_EX (bl,
+ CosNaming::BindingList (0),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ // Obtain a lock before we proceed with the operation.
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX,
+ ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ // Dynamically allocate hash map iterator.
+ HASH_MAP::ITERATOR *hash_iter = 0;
+ ACE_NEW_THROW_EX (hash_iter,
+ HASH_MAP::ITERATOR
+ (*persistent_context_->map ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ // Store <hash_iter temporarily in auto pointer, in case we'll have
+ // some failures and throw an exception.
+ ACE_Auto_Basic_Ptr<HASH_MAP::ITERATOR> temp (hash_iter);
+
+ // Silliness below is required because of broken old g++!!! E.g.,
+ // without it, we could have just said HASH_MAP::ITERATOR everywhere we use ITER_DEF.
+ typedef ACE_Hash_Map_With_Allocator<TAO_Persistent_ExtId, TAO_Persistent_IntId>::ITERATOR ITER_DEF;
+ typedef ACE_Hash_Map_With_Allocator<TAO_Persistent_ExtId, TAO_Persistent_IntId>::ENTRY ENTRY_DEF;
+
+ // Typedef to the type of BindingIterator servant for ease of use.
+ typedef TAO_Bindings_Iterator<ITER_DEF, ENTRY_DEF> ITER_SERVANT;
+
+ // A pointer to BindingIterator servant.
+ ITER_SERVANT *bind_iter = 0;
+
+ // Number of bindings that will go into the BindingList.
+ CORBA::ULong n;
+
+ // Calculate number of bindings that will go into bl.
+ if (this->context_->current_size () > how_many)
+ n = how_many;
+ else
+ n = static_cast<CORBA::ULong> (this->context_->current_size ());
+
+ // Use hash iterator to populate a BindingList with bindings.
+ bl->length (n);
+
+ ENTRY_DEF *hash_entry = 0;
+
+ for (CORBA::ULong i = 0; i < n; i++)
+ {
+ hash_iter->next (hash_entry);
+ hash_iter->advance ();
+
+ if (ITER_SERVANT::populate_binding (hash_entry, bl[i]) == 0)
+ ACE_THROW (CORBA::NO_MEMORY());
+ }
+
+ // Now we are done with the BindingsList, and we can follow up on
+ // the iterator business.
+
+ // If we do not need to pass back BindingIterator.
+ if (this->context_->current_size () <= how_many)
+ return;
+ else
+ {
+ // Create a BindingIterator for return.
+ ACE_NEW_THROW_EX (bind_iter,
+ ITER_SERVANT (this, hash_iter, this->poa_.in (), this->lock_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ // Release <hash_iter> from auto pointer, and start using the
+ // reference counting to control our servant.
+ temp.release ();
+ PortableServer::ServantBase_var iter = bind_iter;
+
+ // Increment reference count on this Naming Context, so it doesn't get
+ // deleted before the BindingIterator servant gets deleted.
+ interface_->_add_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Register with the POA.
+ char poa_id[BUFSIZ];
+ ACE_OS::sprintf (poa_id,
+ "%s_%d",
+ this->poa_id_.c_str (),
+ (*this->counter_)++);
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId (poa_id);
+
+ this->poa_->activate_object_with_id (id.in (),
+ bind_iter
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ bi = bind_iter->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.h b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.h
new file mode 100644
index 00000000000..4ad3b2e61c0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.h
@@ -0,0 +1,273 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Persistent_Naming_Context.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PERSISTENT_NAMING_CONTEXT_H
+#define TAO_PERSISTENT_NAMING_CONTEXT_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Naming/Hash_Naming_Context.h"
+#include "orbsvcs/Naming/Persistent_Entries.h"
+#include "orbsvcs/Naming/naming_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Persistent_Bindings_Map
+ *
+ * @brief Provides hash-table-based persistent storage for
+ * name to object bindings in a Naming Context.
+ *
+ * Wrapper on top of ACE_Hash_Map_With_Allocator (which is a wrapper
+ * around ACE_Hash_Map_Manager). Uses ACE_Allocator (allocating
+ * from persistent storage) to make bindings persistent and
+ * supports TAO_Bindings_Map interface. Used by TAO_Persistent_Naming_Context.
+ */
+class TAO_Naming_Serv_Export TAO_Persistent_Bindings_Map
+ : public TAO_Bindings_Map
+{
+public:
+
+ /// Underlying data structure - typedef for ease of use.
+ typedef ACE_Hash_Map_With_Allocator<TAO_Persistent_ExtId, TAO_Persistent_IntId> HASH_MAP;
+
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_Persistent_Bindings_Map (CORBA::ORB_ptr orb);
+
+ /// Allocate hash map of size <hash_map_size> from persistent storage
+ /// using the <alloc>.
+ int open (size_t hash_map_size,
+ ACE_Allocator *alloc);
+
+ /// The hash map has already been preallocated for us. We just need
+ /// to set our data members take ownership of it.
+ void set (HASH_MAP *map,
+ ACE_Allocator *alloc);
+
+ /// Destructor. Does not deallocate the hash map: if an instance of
+ /// this class goes out of scope, its hash_map remains in persistent storage.
+ virtual ~TAO_Persistent_Bindings_Map (void);
+
+ /**
+ * This method removes the hash map from persistent storage/frees up
+ * the memory. The hash map better be empty, since we are not
+ * cleaning up the insides. (We could add <close> to clean entries,
+ * but not the data inside the entries.
+ */
+ void destroy (void);
+
+ // = Accessor methods.
+
+ /// Get a pointer to the underlying hash map.
+ HASH_MAP *map (void);
+
+ /// Return the size of the underlying hash table.
+ size_t total_size (void);
+
+ /// Return the size of the underlying hash table.
+ virtual size_t current_size (void);
+
+ // = Name bindings manipulation methods.
+
+ /**
+ * Add a binding with the specified parameters to the table.
+ * Return 0 on success and -1 on failure, 1 if there already is a
+ * binding with <id> and <kind>.
+ */
+ virtual int bind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type);
+
+ /**
+ * Overwrite a binding containing <id> and <kind> (or create a new
+ * one if one doesn't exist) with the specified parameters. Return
+ * 0 or 1 on success. Return -1 or -2 on failure. (-2 is returned
+ * if the new and old bindings differ in type).
+ */
+ virtual int rebind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type);
+
+ /**
+ * Remove a binding containing <id> and <kind> from the table.
+ * Return 0 on success and -1 on failure.
+ */
+ virtual int unbind (const char * id,
+ const char * kind);
+
+ /**
+ * Find the binding containing <id> and <kind> in the table, and
+ * pass binding's type and object back to the caller by reference.
+ * Return 0 on success and -1 on failure. Note: a 'duplicated' object
+ * reference is assigned to <obj>, so the caller is responsible for
+ * its deallocation.
+ */
+ virtual int find (const char * id,
+ const char * kind,
+ CORBA::Object_ptr & obj,
+ CosNaming::BindingType &type);
+
+protected:
+
+ /**
+ * Helper to the <open> method. By isolating placement new into a
+ * separate method, we can deal with memory allocation failures more
+ * efficiently. If there is a problem in HASH_MAP constructor, we
+ * can clean up preallocated space.
+ */
+ int open_helper (size_t hash_table_size,
+ void *buffer);
+
+ /// Helper: factors common code from <bind> and <rebind>.
+ int shared_bind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type,
+ int rebind);
+
+ /// Pointer to the allocator we use to make bindings persistent.
+ ACE_Allocator *allocator_;
+
+ /// Pointer to the underlying hash map.
+ HASH_MAP *map_;
+
+ /// Pointer to the orb. We need it to do string/object conversions.
+ CORBA::ORB_var orb_;
+};
+
+class TAO_Persistent_Context_Index;
+
+/**
+ * @class TAO_Persistent_Naming_Context
+ *
+ * @brief This class plays a role of a 'ConcreteImplementor' in the
+ * Bridge pattern architecture of the CosNaming::NamingContext implementation.
+ *
+ * This class provides a persistent implementation of the
+ * NamingContext functionality, i.e., the state is preserved across
+ * process boundaries. Derives from TAO_Hash_Naming_Context and
+ * uses TAO_Persistent_Bindings_Map to store name to object bindings.
+ */
+class TAO_Naming_Serv_Export TAO_Persistent_Naming_Context : public TAO_Hash_Naming_Context
+{
+public:
+ /// Underlying data structure - typedef for ease of use.
+ typedef TAO_Persistent_Bindings_Map::HASH_MAP HASH_MAP;
+
+ // = Initialization and termination methods.
+
+ /// Constructor. MUST be followed up by <init> to allocate the
+ /// underlying data structure from persistent storage!
+ TAO_Persistent_Naming_Context (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Persistent_Context_Index *context_index);
+
+ /// Allocate the underlying data structure from persistent storage.
+ /// Returns 0 on success and -1 on failure.
+ int init (size_t hash_table_size = ACE_DEFAULT_MAP_SIZE);
+
+ /**
+ * Constructor that takes in preallocated data structure and takes
+ * ownership of it. This constructor is for 'recreating' servants
+ * from persistent state.
+ */
+ TAO_Persistent_Naming_Context (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Persistent_Context_Index *context_index,
+ HASH_MAP * map,
+ ACE_UINT32 *counter);
+
+ /// Destructor.
+ virtual ~TAO_Persistent_Naming_Context (void);
+
+ // = Utility methods.
+ /**
+ * This utility method factors out the code needed to create a new
+ * Persistent Naming Context servant and activate it under the
+ * specified POA with the specified id. This function is static so
+ * that the code can be used, both from inside the class (e.g., <new_context>),
+ * and from outside (e.g., Naming_Utils.cpp).
+ */
+ static CosNaming::NamingContext_ptr make_new_context (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ size_t context_size,
+ TAO_Persistent_Context_Index *ind
+ ACE_ENV_ARG_DECL);
+
+ // = Methods not implemented in TAO_Hash_Naming_Context.
+
+ /**
+ * This operation returns a new naming context implemented by the
+ * same naming server in which the operation was invoked. The
+ * context is not bound.
+ */
+ virtual CosNaming::NamingContext_ptr new_context (ACE_ENV_SINGLE_ARG_DECL);
+
+ /**
+ * Returns at most the requested number of bindings <how_many> in
+ * <bl>. If the naming context contains additional bindings, they
+ * are returned with a BindingIterator. In the naming context does
+ * not contain any additional bindings <bi> returned as null.
+ */
+ virtual void list (CORBA::ULong how_many,
+ CosNaming::BindingList_out &bl,
+ CosNaming::BindingIterator_out &bi
+ ACE_ENV_ARG_DECL);
+
+protected:
+
+ /**
+ * Set <destroyed_> flag (inherited from TAO_Hash_Naming_Context) to
+ * <level>. Legal values for <destroyed_> are 0, 1, and 2. The
+ * values specify the extent of cleanup that should take place in the
+ * context's destructor:
+ * '0' - no cleanup (e.g., if the context goes out of scope, but
+ * it's state is to remain in persistent storage);
+ * '1' - free up the underlying data structure in persistent storage
+ * (e.g., if the initialization of this context was only partially completed
+ * due to some failures, and we need to roll back);
+ * '2' - free up the underlying data structure, and deregister this
+ * naming context from its <index_> (e.g., if the context had
+ * <destroy> method invoked and needs to be completely removed from existence).
+ */
+ void set_cleanup_level (int level);
+
+ /// Counter used for generation of POA ids for children Naming
+ /// Contexts.
+ ACE_UINT32 *counter_;
+
+ /**
+ * A pointer to the underlying data structure used to store name
+ * bindings. While our superclass (TAO_Hash_Naming_Context) also
+ * maintains a pointer to the data structure, keeping this pointer
+ * around saves us from the need to downcast when invoking
+ * non-virtual methods.
+ */
+ TAO_Persistent_Bindings_Map *persistent_context_;
+
+ /**
+ * A pointer to the index object of this naming service: it keeps
+ * track of all the naming contexts created. Every time we make a
+ * new context or destroy one, we need to make an entry there.
+ * Also, we get the allocator needed to initialize us from this guy.
+ */
+ TAO_Persistent_Context_Index *index_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_PERSISTENT_NAMING_CONTEXT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/README b/TAO/orbsvcs/orbsvcs/Naming/README
new file mode 100644
index 00000000000..5145337c611
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/README
@@ -0,0 +1,69 @@
+// $Id$
+
+CONTENT
+=======
+This directory contains files implementing CosNaming idl interfaces
+(from CORBA COSS), as well as a few utilities. Server code, service
+executable, and documentation for using the service are located in
+$TAO_ROOT/orbsvcs/Naming_Service.
+
+
+UTILITIES
+=========
+Naming_{Client,Server}.{h,cpp} contain utility classes that can simplify
+programs which play a role of Naming Service server or client. See
+$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service.{h,cpp} and
+$TAO_ROOT/orbsvcs/tests/Simple_Naming/client.{h,cpp} for examples of
+using these classes.
+
+
+IMPLEMENTATION
+==============
+The architecture for TAO's implementation of CosNaming::NamingContext
+interface follows the Bridge pattern.
+
+ * TAO_Naming_Context (in Naming_Context_Interface.h) inherits from
+ POA skeleton, and plays the role of 'Abstraction' (aka 'Interface')
+ in the Bridge architecture - it forwards all client requests to a
+ 'ConcreteImplementor' through an 'Implementor' pointer.
+
+ * TAO_Naming_Context_Impl (in Naming_Context_Interface.h) is an
+ abstract base class for all concrete implementations of
+ NamingContext functionality (i.e., 'Implementor').
+
+ * Currently, TAO Naming Service has two 'ConcreteImplementors':
+ TAO_Transient_Naming_Context (in Transient_Naming_Context.h), and
+ TAO_Persistent_Naming_Context (in Persistent_Naming_Context.h),
+ providing non-persistent and persistent, hash-table-based implementations of the
+ NamingContext functionality, correspondingly. Both
+ 'ConcreteImplementors' inherit from TAO_Hash_Naming_Context (in
+ Hash_Naming_Context.h), which, in turn, inherits from
+ TAO_Naming_Context_Impl. TAO_Hash_Naming_Context factors out code
+ common to both 'ConcreteImplementors'. (Here we have a form of the
+ Template Method pattern).
+
+* Other major classes:
+ - TAO_Persistent_Context_Index - facilitates implementation of the
+ Persistent version of the Naming Service.
+ - TAO_BindingsIterator - implements CosNaming::BindingIterator
+ interface. Can be used with either of the NamingContext 'ConcreteImplementors'.
+
+* Persistent implementation of the Naming Service uses ACE_Allocators
+ and memory-mapped files.
+
+The Bridge implementation class structure makes it easy to:
+
+1) Create and plug-in different CosNaming::NamingContext implementations by
+ subclassing TAO_Naming_Context_Impl.
+
+2) Dynamically load an appropriate NamingContext implementation at
+ run-time, based on the config file entry, by making TAO_Naming_Context_Impl
+ inherit from ACE_Service_Object...
+
+
+TO-DO
+=====
+Extend CosNaming::NamingContext interface and its implementation to
+support binding of more than one object per name and name
+resolution according to policies (e.g., random or round robin), to provide
+Load Balancing functionality.
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable.cpp b/TAO/orbsvcs/orbsvcs/Naming/Storable.cpp
new file mode 100644
index 00000000000..b04ee7c389d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Storable.cpp
@@ -0,0 +1,25 @@
+// $Id$
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// Storable.cpp
+//
+// = AUTHOR
+// Bruce Trask <trask_b@ociweb.com>
+// Chanaka Liyanaarachchi <chanaka@ociweb.com>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Storable.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/Naming/Storable.inl"
+#endif /* __ACE_INLINE__ */
+
+
+
+
+
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable.h b/TAO/orbsvcs/orbsvcs/Naming/Storable.h
new file mode 100644
index 00000000000..1fcb9bf14b2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Storable.h
@@ -0,0 +1,165 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Storable.h
+ *
+ * $Id$
+ *
+ * @author Bruce Trask <trask_b@ociweb.com>
+ * @author Chanaka Liyanaarachchi <chanaka@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef TAO_NAMING_STORABLE_H
+#define TAO_NAMING_STORABLE_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+#include "ace/SString.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+static const int szInt = sizeof(int);
+static const int szChar = sizeof(char);
+static const int szBool = sizeof(int);
+
+class TAO_NS_Persistence_Header
+{
+ public:
+ void size (unsigned int size);
+ unsigned int size () const ;
+
+ void destroyed (int flag);
+ int destroyed () const ;
+
+ private:
+ unsigned int size_;
+ int destroyed_;
+};
+
+class TAO_NS_Persistence_Record
+{
+ public:
+ enum Record_Type {LOCAL_NCONTEXT, OBJREF, REMOTE_NCONTEXT};
+
+ Record_Type type () const;
+ void type (Record_Type type);
+
+ ACE_CString id () const;
+ void id (const ACE_CString& id);
+
+ ACE_CString kind () const;
+ void kind (const ACE_CString& kind);
+
+ ACE_CString ref () const;
+ void ref (const ACE_CString& ior);
+
+ private:
+ Record_Type type_;
+ ACE_CString id_;
+ ACE_CString kind_;
+ ACE_CString ref_;
+};
+
+class TAO_NS_Persistence_Global
+{
+ public:
+ void counter (unsigned int counter);
+ unsigned int counter () const ;
+
+ private:
+ unsigned int counter_;
+};
+
+class TAO_Storable_Base
+{
+public:
+ TAO_Storable_Base();
+
+ virtual ~TAO_Storable_Base();
+
+ virtual void remove() = 0;
+
+ virtual int exists() = 0;
+
+ virtual int open () = 0;
+
+ virtual int close () = 0;
+
+ virtual int flock (int whence, int start, int len) = 0;
+
+ virtual int funlock (int whence, int start, int len) = 0;
+
+ virtual time_t last_changed(void) = 0;
+
+ // Mimic a portion of the std::ios interface. We need to be able
+ // to indicate error states from the extraction operators below.
+ enum Storable_State { goodbit = 0,
+ badbit = 1,
+ eofbit = 2,
+ failbit = 4
+ };
+
+ void clear (Storable_State state = goodbit);
+
+ void setstate (Storable_State state);
+
+ Storable_State rdstate (void) const;
+
+ bool good (void) const;
+
+ bool bad (void) const;
+
+ bool eof (void) const;
+
+ bool fail (void) const;
+
+ virtual TAO_Storable_Base& operator << (
+ const TAO_NS_Persistence_Header& header) = 0;
+
+ virtual TAO_Storable_Base& operator << (
+ const TAO_NS_Persistence_Record& record) = 0;
+
+ virtual TAO_Storable_Base& operator >> (
+ TAO_NS_Persistence_Header& header) = 0;
+
+ virtual TAO_Storable_Base& operator >> (
+ TAO_NS_Persistence_Record& record) = 0;
+
+ virtual TAO_Storable_Base& operator << (
+ const TAO_NS_Persistence_Global& global) = 0;
+
+ virtual TAO_Storable_Base& operator >> (
+ TAO_NS_Persistence_Global& global) = 0;
+
+private:
+ Storable_State state_;
+};
+
+class TAO_Naming_Service_Persistence_Factory
+{
+public:
+ TAO_Naming_Service_Persistence_Factory();
+
+ virtual ~TAO_Naming_Service_Persistence_Factory();
+
+ // Factory Methods
+
+ virtual TAO_Storable_Base *create_stream(const ACE_CString & file,
+ const ACE_TCHAR * mode) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Naming/Storable.inl"
+#endif /* __ACE_INLINE_ */
+
+#endif /* TAO_NAMING_STORABLE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable.inl b/TAO/orbsvcs/orbsvcs/Naming/Storable.inl
new file mode 100644
index 00000000000..50a149a9c0c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Storable.inl
@@ -0,0 +1,170 @@
+// -*- C++ -*-
+
+// $Id$
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// Storable.i
+//
+// = AUTHOR
+// Bruce Trask <trask_b@ociweb.com>
+// Chanaka Liyanaarachchi <chanaka@ociweb.com>
+//
+// ============================================================================
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE void
+TAO_NS_Persistence_Header::size (unsigned int size)
+{
+ this->size_ = size;
+}
+
+ACE_INLINE unsigned int
+TAO_NS_Persistence_Header::size () const
+{
+ return this->size_;
+}
+
+ACE_INLINE void
+TAO_NS_Persistence_Header::destroyed (int flag)
+{
+ this->destroyed_ = flag;
+}
+
+ACE_INLINE int
+TAO_NS_Persistence_Header::destroyed () const
+{
+ return this->destroyed_;
+}
+
+
+ACE_INLINE TAO_NS_Persistence_Record::Record_Type
+TAO_NS_Persistence_Record::type () const
+{
+ return this->type_;
+}
+
+ACE_INLINE void
+TAO_NS_Persistence_Record::type (Record_Type type)
+{
+ this->type_ = type;
+}
+
+ACE_INLINE ACE_CString
+TAO_NS_Persistence_Record::id () const
+{
+ return this->id_;
+}
+
+ACE_INLINE void
+TAO_NS_Persistence_Record::id (const ACE_CString& id)
+{
+ this->id_ = id;
+}
+
+ACE_INLINE ACE_CString
+TAO_NS_Persistence_Record::kind () const
+{
+ return this->kind_;
+}
+
+ACE_INLINE void
+TAO_NS_Persistence_Record::kind (const ACE_CString& kind)
+{
+ this->kind_ = kind;
+}
+
+ACE_INLINE ACE_CString
+TAO_NS_Persistence_Record::ref () const
+{
+ return this->ref_;
+}
+
+ACE_INLINE void
+TAO_NS_Persistence_Record::ref (const ACE_CString& ref)
+{
+ this->ref_ = ref;
+}
+
+ACE_INLINE void
+TAO_NS_Persistence_Global::counter (unsigned int counter)
+{
+ this->counter_ = counter;
+}
+
+ACE_INLINE unsigned int
+TAO_NS_Persistence_Global::counter () const
+{
+ return this->counter_;
+}
+
+
+ACE_INLINE
+TAO_Naming_Service_Persistence_Factory::TAO_Naming_Service_Persistence_Factory()
+{
+}
+
+ACE_INLINE
+TAO_Naming_Service_Persistence_Factory::~TAO_Naming_Service_Persistence_Factory()
+{
+}
+
+ACE_INLINE
+TAO_Storable_Base::TAO_Storable_Base()
+ : state_ (goodbit)
+{
+}
+
+ACE_INLINE
+TAO_Storable_Base::~TAO_Storable_Base()
+{
+}
+
+ACE_INLINE void
+TAO_Storable_Base::clear (TAO_Storable_Base::Storable_State state)
+{
+ this->state_ = state;
+}
+
+ACE_INLINE void
+TAO_Storable_Base::setstate (TAO_Storable_Base::Storable_State state)
+{
+ this->clear (static_cast <TAO_Storable_Base::Storable_State> (
+ this->rdstate () | state));
+}
+
+ACE_INLINE TAO_Storable_Base::Storable_State
+TAO_Storable_Base::rdstate (void) const
+{
+ return this->state_;
+}
+
+ACE_INLINE bool
+TAO_Storable_Base::good (void) const
+{
+ return (this->state_ == goodbit);
+}
+
+ACE_INLINE bool
+TAO_Storable_Base::bad (void) const
+{
+ return (this->state_ & badbit);
+}
+
+ACE_INLINE bool
+TAO_Storable_Base::eof (void) const
+{
+ return (this->state_ & eofbit);
+}
+
+ACE_INLINE bool
+TAO_Storable_Base::fail (void) const
+{
+ return (this->state_ & failbit);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp
new file mode 100644
index 00000000000..cdcfa73cb3d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp
@@ -0,0 +1,1584 @@
+#include "orbsvcs/Naming/Storable_Naming_Context.h"
+#include "orbsvcs/Naming/Bindings_Iterator_T.h"
+
+#include "tao/debug.h"
+
+// The following #pragma is needed to disable a warning that occurs
+// in MSVC 6 due to the overly long debugging symbols generated for
+// the ACE_Auto_Basic_Ptr<ACE_Hash_Map_Iterator_Ex<TAO_...> > template
+// instance used by some of the methods in this file.
+#ifdef _MSC_VER
+# pragma warning(disable: 4786) /* identifier was truncated to '255'
+ characters in the browser
+ information */
+#endif /* _MSC_VER */
+
+#include "ace/Auto_Ptr.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID (Naming,
+ Storable_Naming_Context,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+const char * TAO_Storable_Naming_Context::root_name_;
+ACE_UINT32 TAO_Storable_Naming_Context::gcounter_;
+ACE_Auto_Ptr<TAO_Storable_Base> TAO_Storable_Naming_Context::gfl_;
+int TAO_Storable_Naming_Context::redundant_;
+
+TAO_Storable_IntId::TAO_Storable_IntId (void)
+ : ref_ (CORBA::string_dup ("")),
+ type_ (CosNaming::nobject)
+{
+}
+
+TAO_Storable_IntId::TAO_Storable_IntId (const char * ior,
+ CosNaming::BindingType type)
+ : ref_ (ior),
+ type_ (type)
+{
+}
+
+TAO_Storable_IntId::TAO_Storable_IntId (const TAO_Storable_IntId &rhs)
+{
+ ref_ = rhs.ref_;
+ type_ = rhs.type_;
+}
+
+TAO_Storable_IntId::~TAO_Storable_IntId (void)
+{
+}
+
+void
+TAO_Storable_IntId::operator= (const TAO_Storable_IntId &rhs)
+{
+ // check for self assignment.
+ if (&rhs == this)
+ return;
+
+ type_ = rhs.type_;
+ ref_ = rhs.ref_;
+}
+
+TAO_Storable_ExtId::TAO_Storable_ExtId (void)
+ : id_ (CORBA::string_dup ("")),
+ kind_ (CORBA::string_dup (""))
+{
+}
+
+TAO_Storable_ExtId::TAO_Storable_ExtId (const char *id,
+ const char *kind)
+ : id_ (id)
+ , kind_ (kind)
+{
+}
+
+TAO_Storable_ExtId::TAO_Storable_ExtId (const TAO_Storable_ExtId &rhs)
+{
+ id_ = rhs.id_;
+ kind_ = rhs.kind_;
+}
+
+TAO_Storable_ExtId::~TAO_Storable_ExtId (void)
+{
+}
+
+void
+TAO_Storable_ExtId::operator= (const TAO_Storable_ExtId &rhs)
+{
+ // Check for self assignment.
+ if (&rhs == this)
+ return;
+
+ id_ = rhs.id_;
+ kind_ = rhs.kind_;
+}
+
+bool
+TAO_Storable_ExtId::operator== (const TAO_Storable_ExtId &rhs) const
+{
+ return (ACE_OS::strcmp (id_.in(), rhs.id_.in()) == 0)
+ && (ACE_OS::strcmp (kind_.in(), rhs.kind_.in()) == 0);
+}
+
+bool
+TAO_Storable_ExtId::operator!= (const TAO_Storable_ExtId &rhs) const
+{
+ return (ACE_OS::strcmp (id_.in(), rhs.id_.in()) != 0)
+ || (ACE_OS::strcmp (kind_.in(), rhs.kind_.in()) != 0);
+}
+
+u_long
+TAO_Storable_ExtId::hash (void) const
+{
+ // @CJC I wager this could be optimized a bit better, but I'm not
+ // sure how much it's called. At the very least, we could allocate
+ // just one ACE_CString, and copy id_ and kind_ into that, rather than
+ // taking a double-hit on allocations.
+ ACE_CString temp (id_.in());
+ temp += kind_.in();
+
+ return temp.hash ();
+}
+
+const char *
+TAO_Storable_ExtId::id (void)
+{
+ return id_.in();
+}
+
+const char *
+TAO_Storable_ExtId::kind (void)
+{
+ return kind_.in();
+}
+
+int
+TAO_Storable_Bindings_Map::unbind (const char *id,
+ const char *kind)
+{
+ ACE_TRACE("unbind");
+ TAO_Storable_ExtId name (id, kind);
+ return this->map_.unbind (name);
+}
+
+int
+TAO_Storable_Bindings_Map::bind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type)
+{
+ ACE_TRACE("bind");
+ return this->shared_bind (id, kind, obj, type, 0);
+}
+
+int
+TAO_Storable_Bindings_Map::rebind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type)
+{
+ ACE_TRACE("rebind");
+ return this->shared_bind (id, kind, obj, type, 1);
+}
+
+int
+TAO_Storable_Bindings_Map::find (const char *id,
+ const char *kind,
+ CORBA::Object_ptr & obj,
+ CosNaming::BindingType &type)
+{
+ ACE_TRACE("find");
+ TAO_Storable_ExtId name (id, kind);
+ TAO_Storable_IntId entry;
+
+ if (this->map_.find (name,
+ entry) != 0)
+ {
+ return -1;
+ }
+ else
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ obj = orb_->string_to_object (entry.ref_.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ type = entry.type_;
+
+ return 0;
+ }
+}
+
+TAO_Storable_Bindings_Map::TAO_Storable_Bindings_Map (size_t hash_table_size,
+ CORBA::ORB_ptr orb)
+ : map_ (hash_table_size),
+ orb_(CORBA::ORB::_duplicate (orb))
+{
+ ACE_TRACE("TAO_Storable_Bindings_Map");
+}
+
+TAO_Storable_Bindings_Map::~TAO_Storable_Bindings_Map (void)
+{
+ ACE_TRACE("~TAO_Storable_Bindings_Map");
+}
+
+TAO_Storable_Bindings_Map::HASH_MAP &
+TAO_Storable_Bindings_Map::map (void)
+{
+ ACE_TRACE("map");
+ return map_;
+}
+
+size_t
+TAO_Storable_Bindings_Map::current_size (void)
+{
+ ACE_TRACE("current_size");
+ return map_.current_size ();
+}
+
+size_t
+TAO_Storable_Bindings_Map::total_size (void)
+{
+ ACE_TRACE("total_size");
+ return map_.total_size ();
+}
+
+int
+TAO_Storable_Bindings_Map::shared_bind (const char * id,
+ const char * kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type,
+ int rebind)
+{
+ ACE_TRACE("shared_bind");
+ TAO_Storable_ExtId new_name (id, kind);
+ CORBA::String_var ior = orb_->object_to_string(obj);
+ TAO_Storable_IntId new_entry (ior.in(), type);
+ TAO_Storable_IntId old_entry;
+
+ if (rebind == 0)
+ {
+ // Do a normal bind.
+ return this->map_.bind (new_name, new_entry);
+ }
+ else
+ // Rebind.
+ {
+ // Check that types of old and new entries match.
+ if (this->map_.find (new_name,
+ old_entry) == 0
+ && type != old_entry.type_)
+ return -2;
+
+ else
+ return this->map_.rebind (new_name, new_entry);
+ }
+}
+
+void TAO_Storable_Naming_Context::Write(TAO_Storable_Base& wrtr)
+{
+ ACE_TRACE("Write");
+ TAO_NS_Persistence_Header header;
+
+ header.size (static_cast<unsigned int> (storable_context_->current_size()));
+ header.destroyed (destroyed_);
+
+ wrtr << header;
+
+ if (0u == header.size ())
+ return;
+
+ ACE_Hash_Map_Iterator<TAO_Storable_ExtId,TAO_Storable_IntId,
+ ACE_Null_Mutex> it = storable_context_->map().begin();
+ ACE_Hash_Map_Iterator<TAO_Storable_ExtId,TAO_Storable_IntId,
+ ACE_Null_Mutex> itend = storable_context_->map().end();
+
+ ACE_Hash_Map_Entry<TAO_Storable_ExtId,TAO_Storable_IntId> ent = *it;
+
+ while (!(it == itend))
+ {
+ TAO_NS_Persistence_Record record;
+
+ ACE_CString name;
+ CosNaming::BindingType bt = (*it).int_id_.type_;
+ if (bt == CosNaming::ncontext)
+ {
+ CORBA::Object_var
+ obj = orb_->string_to_object ((*it).int_id_.ref_.in ());
+ if (obj->_is_collocated ())
+ {
+ // This is a local (i.e. non federated context) we therefore
+ // store only the ObjectID (persistence filename) for the object.
+
+ // The driving force behind storing ObjectIDs rather than IORs for
+ // local contexts is to provide for a redundant naming service.
+ // That is, a naming service that runs simultaneously on multiple
+ // machines sharing a file system. It allows multiple redundant
+ // copies to be started and stopped independently.
+ // The original target platform was Tru64 Clusters where there was
+ // a cluster address. In that scenario, clients may get different
+ // servers on each request, hence the requirement to keep
+ // synchronized to the disk. It also works on non-cluster system
+ // where the client picks one of the redundant servers and uses it,
+ // while other systems can pick different servers. (However in this
+ // scenario, if a server fails and a client must pick a new server,
+ // that client may not use any saved context IORs, instead starting
+ // from the root to resolve names. So this latter mode is not quite
+ // transparent to clients.) [Rich Seibel (seibel_r) of ociweb.com]
+
+ PortableServer::ObjectId_var
+ oid = poa_->reference_to_id (obj.in ());
+ CORBA::String_var
+ nm = PortableServer::ObjectId_to_string (oid.in ());
+ const char
+ *newname = nm.in ();
+ name.set (newname); // The local ObjectID (persistance filename)
+ record.type (TAO_NS_Persistence_Record::LOCAL_NCONTEXT);
+ }
+ else
+ {
+ // Since this is a foreign (federated) context, we can not store
+ // the objectID (because it isn't in our storage), if we did, when
+ // we restore, we would end up either not finding a permanent
+ // record (and thus ending up incorrectly assuming the context was
+ // destroyed) or loading another context altogether (just because
+ // the contexts shares its objectID filename which is very likely).
+ // [Simon Massey (sma) of prismtech.com]
+
+ name.set ((*it).int_id_.ref_.in ()); // The federated context IOR
+ record.type (TAO_NS_Persistence_Record::REMOTE_NCONTEXT);
+ }
+ }
+ else // if (bt == CosNaming::nobject) // shouldn't be any other, can there?
+ {
+ name.set ((*it).int_id_.ref_.in ()); // The non-context object IOR
+ record.type (TAO_NS_Persistence_Record::OBJREF);
+ }
+ record.ref(name);
+
+ const char *myid = (*it).ext_id_.id();
+ ACE_CString id(myid);
+ record.id(id);
+
+ const char *mykind = (*it).ext_id_.kind();
+ ACE_CString kind(mykind);
+ record.kind(kind);
+
+ wrtr << record;
+ it.advance();
+ }
+}
+
+// Helper function to load a new context into the binding_map
+int
+TAO_Storable_Naming_Context::load_map(File_Open_Lock_and_Check *flck
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRACE("load_map");
+ // assume file already open for reading
+ TAO_Storable_Bindings_Map *bindings_map;
+
+ // create the new bindings map
+ ACE_NEW_THROW_EX (bindings_map,
+ TAO_Storable_Bindings_Map (hash_table_size_,orb_.in()),
+ CORBA::NO_MEMORY ());
+
+ // get the data for this bindings map from the file
+
+ TAO_NS_Persistence_Header header;
+ TAO_NS_Persistence_Record record;
+
+ // we are only using the size from this header
+ flck->peer() >> header;
+ if (!flck->peer ().good ())
+ {
+ flck->peer ().clear ();
+ ACE_THROW_RETURN (CORBA::INTERNAL (), -1);
+ }
+
+ // reset the destroyed flag
+ this->destroyed_ = header.destroyed();
+
+ // read in the data for the map
+ for (unsigned int i= 0u; i<header.size(); ++i)
+ {
+ flck->peer() >> record;
+ if (!flck->peer ().good ())
+ {
+ flck->peer ().clear ();
+ ACE_THROW_RETURN (CORBA::INTERNAL (), -1);
+ }
+
+ if (TAO_NS_Persistence_Record::LOCAL_NCONTEXT == record.type ())
+ {
+ PortableServer::ObjectId_var
+ id = PortableServer::string_to_ObjectId (record.ref ().c_str ());
+ const char
+ *intf = interface_->_interface_repository_id ();
+ CORBA::Object_var
+ objref = poa_->create_reference_with_id (id.in (), intf);
+ bindings_map->bind ( record.id ().c_str (),
+ record.kind ().c_str (),
+ objref.in (),
+ CosNaming::ncontext );
+ }
+ else
+ {
+ CORBA::Object_var
+ objref = orb_->string_to_object (record.ref ().c_str ());
+ bindings_map->bind ( record.id ().c_str (),
+ record.kind ().c_str (),
+ objref.in (),
+ ((TAO_NS_Persistence_Record::REMOTE_NCONTEXT == record.type ())
+ ? CosNaming::ncontext // REMOTE_NCONTEXT
+ : CosNaming::nobject )); // OBJREF
+ }
+ }
+ storable_context_ = bindings_map;
+ context_ = storable_context_;
+ return 0;
+}
+
+TAO_Storable_Naming_Context::
+File_Open_Lock_and_Check::File_Open_Lock_and_Check(
+ TAO_Storable_Naming_Context * context,
+ const char * mode
+ ACE_ENV_ARG_DECL)
+:closed_(1),
+ context_(context)
+{
+ ACE_TRACE("File_Open_Lock_and_Check");
+ // We only accept a subset of mode argument, check it
+ rwflags_ = 0;
+ for( unsigned int i = 0; i<ACE_OS::strlen(mode); i++ )
+ {
+ switch (mode[i])
+ {
+ case 'r': rwflags_ |= mode_read;
+ break;
+ case 'w': rwflags_ |= mode_write;
+ break;
+ case 'c': rwflags_ |= mode_create;
+ break;
+ default: rwflags_ = -1;
+ }
+ }
+ if( rwflags_ <= 0 )
+ {
+ errno = EINVAL;
+ ACE_THROW(CORBA::PERSIST_STORE());
+ }
+
+ // build the file name
+ ACE_CString file_name(context->persistence_directory_);
+ file_name += "/";
+ file_name += context->name_;
+
+ // Create the stream
+ fl_ = context->factory_->create_stream(file_name, ACE_TEXT_CHAR_TO_TCHAR(mode));
+ if (TAO_Storable_Naming_Context::redundant_)
+ {
+ if (fl_->open() != 0)
+ {
+ delete fl_;
+ ACE_THROW(CORBA::PERSIST_STORE());
+ }
+
+ // acquire a lock on it
+ if (fl_ -> flock(0, 0, 0) != 0)
+ {
+ fl_->close();
+ delete fl_;
+ ACE_THROW(CORBA::INTERNAL());
+ }
+
+ // now that the file is successfully opened and locked it must be
+ // unlocked/closed before we leave this class
+ closed_ = 0;
+
+ if ( ! (rwflags_ & mode_create) )
+ {
+ // Check if our copy is up to date
+ time_t new_last_changed = fl_->last_changed();
+ if( new_last_changed > context->last_changed_ )
+ {
+ context->last_changed_ = new_last_changed;
+ // Throw our map away
+ delete context->storable_context_;
+ // and build a new one from disk
+ context->load_map(this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ }
+ else if ( ! context->storable_context_ || (rwflags_ & mode_write) )
+ {
+ if (fl_->open() != 0)
+ {
+ delete fl_;
+ ACE_THROW(CORBA::PERSIST_STORE());
+ }
+
+ // now that the file is successfully opened
+ // unlocked/closed before we leave this class
+ closed_ = 0;
+
+ if(!context->storable_context_)
+ {
+ // Load the map from disk
+ context->load_map(this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ else
+ {
+ // Need to insure that fl_ gets deleted
+ delete fl_;
+ }
+}
+
+void
+TAO_Storable_Naming_Context::
+File_Open_Lock_and_Check::release(void)
+{
+ ACE_TRACE("release");
+ if ( ! closed_ )
+ {
+ // If we updated the disk, save the time stamp
+ if(TAO_Storable_Naming_Context::redundant_)
+ {
+ if( rwflags_ & mode_write )
+ context_->last_changed_ = fl_->last_changed();
+ fl_->funlock(0, 0, 0);
+ }
+ fl_->close();
+ delete fl_;
+ closed_ = 1;
+ }
+}
+
+TAO_Storable_Naming_Context::
+File_Open_Lock_and_Check::~File_Open_Lock_and_Check(void)
+{
+ ACE_TRACE("~File_Open_Lock_and_Check");
+ this->release();
+}
+
+TAO_Storable_Base &
+TAO_Storable_Naming_Context::
+File_Open_Lock_and_Check::peer(void)
+{
+ ACE_TRACE("peer");
+ return *fl_;
+}
+
+TAO_Storable_Naming_Context::TAO_Storable_Naming_Context (
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Naming_Service_Persistence_Factory *factory,
+ const ACE_TCHAR *persistence_directory,
+ size_t hash_table_size)
+ : TAO_Hash_Naming_Context (poa,
+ poa_id),
+ counter_ (0),
+ storable_context_ (0),
+ orb_(CORBA::ORB::_duplicate (orb)),
+ name_ (poa_id),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ factory_(factory),
+ persistence_directory_ (ACE_TEXT_ALWAYS_CHAR(persistence_directory)),
+ hash_table_size_(hash_table_size),
+ last_changed_(0)
+{
+ ACE_TRACE("TAO_Storable_Naming_Context");
+}
+
+TAO_Storable_Naming_Context::~TAO_Storable_Naming_Context (void)
+{
+ ACE_TRACE("~TAO_Storable_Naming_Context");
+
+ // If we're in the DTOR as a result of the destroy() operation,
+ // then we go ahead and delete the file. Otherwise, we leave the
+ // file around because they need to be there for persistence.
+ if (this->destroyed_)
+ {
+ // Make sure we delete the associated stream
+ ACE_CString file_name (this->persistence_directory_);
+ file_name += "/";
+ file_name += this->name_;
+
+ // Now delete the file
+ ACE_Auto_Ptr<TAO_Storable_Base>
+ fl (
+ this->factory_->create_stream(file_name.c_str(),
+ ACE_TEXT("r"))
+ );
+ if (fl.get())
+ {
+ if (TAO_debug_level > 5)
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) NameService: removing file %s\n",
+ file_name.fast_rep()));
+ fl->remove ();
+ }
+ }
+}
+
+CosNaming::NamingContext_ptr
+TAO_Storable_Naming_Context::make_new_context (
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ const char *poa_id,
+ size_t context_size,
+ TAO_Naming_Service_Persistence_Factory *factory,
+ const ACE_TCHAR *persistence_directory,
+ TAO_Storable_Naming_Context **new_context
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRACE("make_new_context");
+ // Store the stub we will return here.
+ CosNaming::NamingContext_var result;
+
+ // Put together a servant for the new Naming Context.
+
+ TAO_Storable_Naming_Context *context_impl = 0;
+ ACE_NEW_THROW_EX (context_impl,
+ TAO_Storable_Naming_Context (orb,
+ poa,
+ poa_id,
+ factory,
+ persistence_directory,
+ context_size),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (result._retn ());
+
+ // Put <context_impl> into the auto pointer temporarily, in case next
+ // allocation fails.
+ ACE_Auto_Basic_Ptr<TAO_Storable_Naming_Context> temp (context_impl);
+
+ TAO_Naming_Context *context = 0;
+ ACE_NEW_THROW_EX (context,
+ TAO_Naming_Context (context_impl),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (result._retn ());
+
+ // Let <implementation> know about it's <interface>.
+ context_impl->interface (context);
+
+ // Release auto pointer, and start using reference counting to
+ // control our servant.
+ temp.release ();
+ PortableServer::ServantBase_var s = context;
+
+ // Register the new context with the POA.
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId (poa_id);
+
+ // If we try to register a naming context that is already registered,
+ // the following activation causes a POA::ObjectAlreadyActive exception be
+ // thrown which is transmitted as a CORBA::UNKNOWN on the wire. To rectify
+ // this problem, we explicitly throw the correct INS exception in
+ // this situation.
+ ACE_TRY
+ {
+ poa->activate_object_with_id (id.in (),
+ context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (PortableServer::POA::ObjectAlreadyActive, ex)
+ {
+ ACE_THROW_RETURN (CosNaming::NamingContext::AlreadyBound(),
+ CosNaming::NamingContext::_nil ());
+ }
+ ACE_ENDTRY;
+
+ ACE_CHECK_RETURN (result._retn ());
+
+ result = context->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ // return the address of the new context object so that caller can finish
+ *new_context = context_impl;
+
+ return result._retn ();
+}
+
+CosNaming::NamingContext_ptr
+TAO_Storable_Naming_Context::new_context (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRACE("new_context");
+ ACE_GUARD_THROW_EX (ACE_SYNCH_RECURSIVE_MUTEX,
+ ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ {
+ // Open the backing file
+ File_Open_Lock_and_Check flck(this, "r"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (),
+ CosNaming::NamingContext::_nil ());
+ }
+
+ TAO_NS_Persistence_Global global;
+
+ // Generate a POA id for the new context.
+ if(redundant_)
+ {
+ // acquire a lock on the file that holds our counter
+ if (gfl_->open() != 0)
+ {
+ delete gfl_.release();
+ ACE_THROW_RETURN(CORBA::PERSIST_STORE(),
+ CosNaming::NamingContext::_nil ());
+ }
+ if (gfl_ -> flock(0, 0, 0) != 0)
+ ACE_THROW_RETURN (CORBA::INTERNAL(),
+ CosNaming::NamingContext::_nil ());
+ // get the counter from disk
+ *gfl_.get() >> global;
+ if (!gfl_.get ()->good () &&
+ gfl_.get ()->rdstate () != TAO_Storable_Base::eofbit)
+ {
+ gfl_.get ()->clear ();
+ ACE_THROW_RETURN (CORBA::INTERNAL (), 0);
+ }
+ gcounter_ = global.counter();
+ // use it to generate a new name
+ }
+ char poa_id[BUFSIZ];
+ ACE_OS::sprintf (poa_id,
+ "%s_%d",
+ root_name_,
+ gcounter_++);
+ // then save it back on disk
+ global.counter(gcounter_);
+ *gfl_.get() << global;
+ if(redundant_)
+ {
+ // and release our lock
+ if (gfl_ -> flock(0, 0, 0) != 0)
+ ACE_THROW_RETURN(CORBA::INTERNAL(),
+ CosNaming::NamingContext::_nil ());
+ gfl_->close();
+ }
+
+ // Create a new context.
+ TAO_Storable_Naming_Context *new_context = 0;
+ CosNaming::NamingContext_var result =
+ make_new_context (this->orb_.in (),
+ this->poa_.in (),
+ poa_id,
+ this->storable_context_->total_size (),
+ this->factory_,
+ ACE_TEXT_CHAR_TO_TCHAR (this->persistence_directory_.c_str ()),
+ &new_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ // Since this is a new context, make an empty map in it
+ ACE_NEW_THROW_EX (new_context->storable_context_,
+ TAO_Storable_Bindings_Map (hash_table_size_,orb_.in ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+ new_context->context_ = new_context->storable_context_;
+
+ File_Open_Lock_and_Check flck(new_context, "wc" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+ new_context->Write(flck.peer());
+
+ return result._retn ();
+}
+
+void
+TAO_Storable_Naming_Context::rebind (const CosNaming::Name& n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRACE("rebind");
+ // Get the length of the name.
+ CORBA::ULong name_len = n.length ();
+
+ // Check for invalid name.
+ if (name_len == 0)
+ ACE_THROW (CosNaming::NamingContext::InvalidName());
+
+ // we didn't need a lock to check the input arg, but now we do
+ ACE_GUARD_THROW_EX (ACE_SYNCH_RECURSIVE_MUTEX, ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Open the backing file
+ File_Open_Lock_and_Check flck(this, name_len > 1 ? "r" : "rw"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ // If we received compound name, resolve it to get the context in
+ // which the rebinding should take place, then perform the rebinding
+ // on target context.
+ if (name_len > 1)
+ {
+ // This had been a read on the file so now we are done with it
+ flck.release();
+
+ CosNaming::NamingContext_var context =
+ get_context (n ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNaming::Name simple_name;
+ simple_name.length (1);
+ simple_name[0] = n[name_len - 1];
+ context->rebind (simple_name, obj ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ // If we received a simple name, we need to rebind it in this
+ // context.
+ else
+ {
+ int result = this->context_->rebind (n[0].id,
+ n[0].kind,
+ obj,
+ CosNaming::nobject);
+
+ // Check for error conditions.
+ if (result == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+
+ else if (result == -2)
+ ACE_THROW (CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::not_object, n));
+
+ this->Write(flck.peer());
+ }
+}
+
+void
+TAO_Storable_Naming_Context::bind_context (const CosNaming::Name &n,
+ CosNaming::NamingContext_ptr nc
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRACE("TAO_Storable_Naming_Context::bind_context");
+ // Get the length of the name.
+ CORBA::ULong name_len = n.length ();
+
+ // Check for invalid name.
+ if (name_len == 0)
+ ACE_THROW (CosNaming::NamingContext::InvalidName());
+
+ // Do not allow binding of nil context reference.
+ if (CORBA::is_nil (nc))
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ // we didn't need a lock to check the input arg, but now we do
+ ACE_GUARD_THROW_EX (ACE_SYNCH_RECURSIVE_MUTEX, ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Open the backing file
+ File_Open_Lock_and_Check flck(this, name_len > 1 ? "r" : "rw"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ // If we received compound name, resolve it to get the context in
+ // which the binding should take place, then perform the binding
+ // on target context.
+ if (name_len > 1)
+ {
+ // This had been a read on the file so now we are done with it
+ flck.release();
+
+ CosNaming::NamingContext_var context =
+ get_context (n ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNaming::Name simple_name;
+ simple_name.length (1);
+ simple_name[0] = n[name_len - 1];
+ context->bind_context (simple_name, nc ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ // If we received a simple name, we need to bind it in this context.
+ else
+ {
+ // Try binding the name.
+ int result = this->context_->bind (n[0].id,
+ n[0].kind,
+ nc,
+ CosNaming::ncontext);
+ if (result == 1)
+ ACE_THROW (CosNaming::NamingContext::AlreadyBound());
+
+ // Something went wrong with the internal structure
+ else if (result == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+
+ this->Write(flck.peer());
+ }
+}
+
+void
+TAO_Storable_Naming_Context::rebind_context (const CosNaming::Name &n,
+ CosNaming::NamingContext_ptr nc
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRACE("rebind_context");
+ // Get the length of the name.
+ CORBA::ULong name_len = n.length ();
+
+ // Check for invalid name.
+ if (name_len == 0)
+ ACE_THROW (CosNaming::NamingContext::InvalidName());
+
+ // we didn't need a lock to check the input arg, but now we do
+ ACE_GUARD_THROW_EX (ACE_SYNCH_RECURSIVE_MUTEX, ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Open the backing file
+ File_Open_Lock_and_Check flck(this, name_len > 1 ? "r" : "rw"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ // If we received compound name, resolve it to get the context in
+ // which the rebinding should take place, then perform the rebinding
+ // on target context.
+ if (name_len > 1)
+ {
+ // This had been a read on the file so now we are done with it
+ flck.release();
+
+ CosNaming::NamingContext_var context =
+ get_context (n ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNaming::Name simple_name;
+ simple_name.length (1);
+ simple_name[0] = n[name_len - 1];
+ context->rebind_context (simple_name, nc ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ // If we received a simple name, we need to rebind it in this
+ // context.
+ else
+ {
+ int result = this->context_->rebind (n[0].id,
+ n[0].kind,
+ nc,
+ CosNaming::ncontext);
+ // Check for error conditions.
+ if (result == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+ else if (result == -2)
+ ACE_THROW (CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::not_context, n));
+
+ this->Write(flck.peer());
+ }
+}
+
+CORBA::Object_ptr
+TAO_Storable_Naming_Context::resolve (const CosNaming::Name& n
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRACE("resolve");
+ // Get the length of the name.
+ CORBA::ULong name_len = n.length ();
+
+ // Check for invalid name.
+ if (name_len == 0)
+ ACE_THROW_RETURN (CosNaming::NamingContext::InvalidName(),
+ CORBA::Object::_nil ());
+
+ // we didn't need a lock to check the input arg, but now we do
+ ACE_GUARD_THROW_EX (ACE_SYNCH_RECURSIVE_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ // Open the backing file
+ File_Open_Lock_and_Check flck(this, "r"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (),
+ CORBA::Object::_nil ());
+
+ // Resolve the first component of the name.
+ flck.release();
+
+ // Stores the binding type for the first name component.
+ CosNaming::BindingType type;
+ // Stores the object reference bound to the first name component.
+ CORBA::Object_ptr obj = CORBA::Object::_nil ();
+
+ if (this->context_->find (n[0].id,
+ n[0].kind,
+ obj,
+ type) == -1)
+ ACE_THROW_RETURN (CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::missing_node, n),
+ CORBA::Object::_nil ());
+
+ // Store the value in var to avoid memory leaks.
+ CORBA::Object_var result = obj;
+
+ // If the name we have to resolve is a compound name, we need to
+ // resolve it recursively.
+ if (name_len > 1)
+ {
+ CosNaming::NamingContext_var context =
+ CosNaming::NamingContext::_nil ();
+
+ if (type == CosNaming::ncontext)
+ {
+ // Narrow to NamingContext.
+ context = CosNaming::NamingContext::_narrow (result.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (result._retn ());
+ }
+ else
+ // The first name component wasn't bound to a NamingContext.
+ ACE_THROW_RETURN (CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::not_context,
+ n),
+ CORBA::Object::_nil ());
+
+ // If narrow failed...
+ if (CORBA::is_nil (context.in ()))
+ ACE_THROW_RETURN (CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::not_context, n),
+ CORBA::Object::_nil ());
+ else
+ {
+ // Successfully resolved the first name component, need to
+ // recursively call resolve on <n> without the first component.
+
+ // We need a name just like <n> but without the first
+ // component. Instead of copying data we can reuse <n>'s
+ // buffer since we will only be using it for 'in' parameters
+ // (no modifications).
+ CosNaming::Name rest_of_name
+ (n.maximum () - 1,
+ n.length () - 1,
+ const_cast<CosNaming::NameComponent*> (n.get_buffer ()) + 1);
+
+ // If there are any exceptions, they will propagate up.
+ return context->resolve (rest_of_name
+ ACE_ENV_ARG_PARAMETER);
+ }
+ }
+ // If the name we had to resolve was simple, we just need to return
+ // the result.
+ return result._retn ();
+}
+
+void
+TAO_Storable_Naming_Context::unbind (const CosNaming::Name& n
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRACE("unbind");
+ // Get the length of the name.
+ CORBA::ULong name_len = n.length ();
+
+ // Check for invalid name.
+ if (name_len == 0)
+ ACE_THROW (CosNaming::NamingContext::InvalidName());
+
+ // we didn't need a lock to check the input arg, but now we do
+ ACE_GUARD_THROW_EX (ACE_SYNCH_RECURSIVE_MUTEX, ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Open the backing file
+ File_Open_Lock_and_Check flck(this, name_len > 1 ? "r" : "rw"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ // If we received compound name, resolve it to get the context in
+ // which the unbinding should take place, then perform the unbinding
+ // on target context.
+ if (name_len > 1)
+ {
+ // This had been a read on the file so now we are done with it
+ flck.release();
+
+ CosNaming::NamingContext_var context =
+ get_context (n ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNaming::Name simple_name;
+ simple_name.length (1);
+ simple_name[0] = n[name_len - 1];
+ context->unbind (simple_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ // If we received a simple name, we need to unbind it in this
+ // context.
+ else
+ {
+ if (this->context_->unbind (n[0].id,
+ n[0].kind) == -1)
+ ACE_THROW (CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::missing_node, n));
+
+ this->Write(flck.peer());
+ }
+}
+
+CosNaming::NamingContext_ptr
+TAO_Storable_Naming_Context::bind_new_context (const CosNaming::Name& n
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRACE("bind_new_context");
+ // Get the length of the name.
+ CORBA::ULong name_len = n.length ();
+
+ // Check for invalid name.
+ if (name_len == 0)
+ ACE_THROW_RETURN (CosNaming::NamingContext::InvalidName(),
+ CosNaming::NamingContext::_nil ());
+
+ ACE_GUARD_THROW_EX (ACE_SYNCH_RECURSIVE_MUTEX,
+ ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (),
+ CosNaming::NamingContext::_nil ());
+
+ // Open the backing file
+ File_Open_Lock_and_Check flck(this, name_len > 1 ? "r" : "rw"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (),
+ CosNaming::NamingContext::_nil ());
+
+ // If we received compound name, resolve it to get the context in
+ // which the binding should take place, then perform the operation on
+ // target context.
+ if (name_len > 1)
+ {
+ // This had been a read on the file so now we are done with it
+ flck.release();
+
+ CosNaming::NamingContext_var context =
+ get_context (n ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ CosNaming::Name simple_name;
+ simple_name.length (1);
+ simple_name[0] = n[name_len - 1];
+ return context->bind_new_context (simple_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+ }
+ // If we received a simple name, we need to bind it in this context.
+
+ // This had been a read on the file so now we are done with it
+ flck.release();
+
+ // Stores our new Naming Context.
+ CosNaming::NamingContext_var result =
+ CosNaming::NamingContext::_nil ();
+
+ // Create new context.
+ result = new_context (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ // Bind the new context to the name.
+ ACE_TRY
+ {
+ bind_context (n,
+ result.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY_EX(DESTROY)
+ {
+ result->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(DESTROY);
+ }
+ ACE_CATCHANY
+ {
+ // Do nothing?
+ }
+ ACE_ENDTRY;
+ }
+ // Re-raise the exception in bind_context()
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+ return result._retn ();
+}
+
+void
+TAO_Storable_Naming_Context::destroy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRACE("destroy");
+ ACE_GUARD_THROW_EX (ACE_SYNCH_RECURSIVE_MUTEX,
+ ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Open the backing file
+ File_Open_Lock_and_Check flck(this, "rw"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ if (this->context_->current_size () != 0)
+ ACE_THROW (CosNaming::NamingContext::NotEmpty());
+
+ // Destroy is a no-op on a root context.
+ if (root ())
+ return;
+
+ else
+ {
+ this->destroyed_ = 2;
+
+ // Remove self from POA. Because of reference counting, the POA
+ // will automatically delete the servant when all pending requests
+ // on this servant are complete.
+
+ PortableServer::POA_var poa =
+ this->_default_POA ();
+
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId (poa_id_.fast_rep ());
+
+ ACE_CHECK;
+
+ poa->deactivate_object (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->Write(flck.peer());
+ }
+}
+
+
+void
+TAO_Storable_Naming_Context::bind (const CosNaming::Name& n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRACE("TAO_Storable_Naming_Context::bind");
+ // Get the length of the name.
+ CORBA::ULong name_len = n.length ();
+
+ // Check for invalid name.
+ if (name_len == 0)
+ ACE_THROW (CosNaming::NamingContext::InvalidName());
+
+ // we didn't need a lock to check the input arg, but now we do
+ ACE_GUARD_THROW_EX (ACE_SYNCH_RECURSIVE_MUTEX, ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Open the backing file
+ File_Open_Lock_and_Check flck(this, name_len > 1 ? "r" : "rw"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ // If we received compound name, resolve it to get the context in
+ // which the binding should take place, then perform the binding
+ // on target context.
+ if (name_len > 1)
+ {
+ // This had been a read on the file so now we are done with it
+ flck.release();
+
+ CosNaming::NamingContext_var context =
+ get_context (n ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNaming::Name simple_name;
+ simple_name.length (1);
+ simple_name[0] = n[name_len - 1];
+ context->bind (simple_name, obj ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ // If we received a simple name, we need to bind it in this context.
+ else
+ {
+ // Try binding the name.
+ int result = this->context_->bind (n[0].id,
+ n[0].kind,
+ obj,
+ CosNaming::nobject);
+ if (result == 1)
+ ACE_THROW (CosNaming::NamingContext::AlreadyBound());
+
+ // Something went wrong with the internal structure
+ else if (result == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+
+ this->Write(flck.peer());
+ }
+}
+
+
+void
+TAO_Storable_Naming_Context::list (CORBA::ULong how_many,
+ CosNaming::BindingList_out &bl,
+ CosNaming::BindingIterator_out &bi
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRACE("list");
+ // Allocate nil out parameters in case we won't be able to complete
+ // the operation.
+ bi = CosNaming::BindingIterator::_nil ();
+ ACE_NEW_THROW_EX (bl,
+ CosNaming::BindingList (0),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ // Obtain a lock before we proceed with the operation.
+ ACE_GUARD_THROW_EX (ACE_SYNCH_RECURSIVE_MUTEX,
+ ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Open the backing file
+ File_Open_Lock_and_Check flck(this, "r"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ // We have the map in memory, let the disk go
+ flck.release();
+
+ // Dynamically allocate iterator for traversing the underlying hash map.
+ HASH_MAP::ITERATOR *hash_iter = 0;
+ ACE_NEW_THROW_EX (hash_iter,
+ HASH_MAP::ITERATOR (storable_context_->map ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ // Store <hash_iter temporarily in auto pointer, in case we'll have
+ // some failures and throw an exception.
+ ACE_Auto_Basic_Ptr<HASH_MAP::ITERATOR> temp (hash_iter);
+
+ // Silliness below is required because of broken old g++!!! E.g.,
+ // without it, we could have just said HASH_MAP::ITERATOR everywhere we use ITER_DEF.
+ typedef ACE_Hash_Map_Manager<TAO_Storable_ExtId,
+ TAO_Storable_IntId,
+ ACE_Null_Mutex>::ITERATOR ITER_DEF;
+ typedef ACE_Hash_Map_Manager<TAO_Storable_ExtId,
+ TAO_Storable_IntId,
+ ACE_Null_Mutex>::ENTRY ENTRY_DEF;
+
+ // Typedef to the type of BindingIterator servant for ease of use.
+ typedef TAO_Bindings_Iterator<ITER_DEF, ENTRY_DEF> ITER_SERVANT;
+
+ // A pointer to BindingIterator servant.
+ ITER_SERVANT *bind_iter = 0;
+
+ // Number of bindings that will go into the BindingList <bl>.
+ CORBA::ULong n;
+
+ // Calculate number of bindings that will go into <bl>.
+ if (this->context_->current_size () > how_many)
+ n = how_many;
+ else
+ n = static_cast<CORBA::ULong> (this->context_->current_size ());
+
+ // Use the hash map iterator to populate <bl> with bindings.
+ bl->length (n);
+
+ ENTRY_DEF *hash_entry = 0;
+
+ for (CORBA::ULong i = 0; i < n; i++)
+ {
+ hash_iter->next (hash_entry);
+ hash_iter->advance ();
+
+ if (ITER_SERVANT::populate_binding (hash_entry, bl[i]) == 0)
+ ACE_THROW (CORBA::NO_MEMORY());
+ }
+
+ // Now we are done with the BindingsList, and we can follow up on
+ // the BindingIterator business.
+
+ // If we do not need to pass back BindingIterator.
+ if (this->context_->current_size () <= how_many)
+ return;
+ else
+ {
+ // *** This is a problem. Is there an exception we can throw? ***
+ ACE_UNUSED_ARG (bind_iter);
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+
+#if 0
+ // Create a BindingIterator for return.
+ ACE_NEW_THROW_EX (bind_iter,
+ ITER_SERVANT (this, hash_iter,
+ this->poa_.in (), this->lock_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ // Release <hash_iter> from auto pointer, and start using
+ // reference counting to control our servant.
+ temp.release ();
+ PortableServer::ServantBase_var iter = bind_iter;
+
+ // Increment reference count on this Naming Context, so it doesn't get
+ // deleted before the BindingIterator servant gets deleted.
+ interface_->_add_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Register with the POA.
+ char poa_id[BUFSIZ];
+ ACE_OS::sprintf (poa_id,
+ "%s_%d",
+ this->poa_id_.c_str (),
+ this->counter_++);
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId (poa_id);
+
+ this->poa_->activate_object_with_id (id.in (),
+ bind_iter
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ bi = bind_iter->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+#endif /* 0 */
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include "orbsvcs/Naming/Naming_Service_Container.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+CosNaming::NamingContext_ptr TAO_Storable_Naming_Context::recreate_all(
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ const char *poa_id,
+ size_t context_size,
+ int reentering,
+ TAO_Naming_Service_Persistence_Factory *factory,
+ const ACE_TCHAR *persistence_directory,
+ int use_redundancy
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRACE("recreate_all");
+
+ ACE_UNUSED_ARG (reentering);
+
+ // Whether we are redundant is global
+ redundant_ = use_redundancy;
+
+ // Save the root name for later use
+ root_name_ = poa_id;
+
+ // Create a new context.
+ TAO_Storable_Naming_Context *new_context = 0;
+ CosNaming::NamingContext_var result =
+ make_new_context (orb,
+ poa,
+ poa_id,
+ context_size,
+ factory,
+ persistence_directory,
+ &new_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ // Now does this already exist on disk?
+ ACE_TString file_name(persistence_directory);
+ file_name += ACE_TEXT("/");
+ file_name += ACE_TEXT_CHAR_TO_TCHAR(poa_id);
+ ACE_Auto_Ptr<TAO_Storable_Base> fl (factory->create_stream(ACE_TEXT_ALWAYS_CHAR(file_name.c_str()), ACE_TEXT("r")));
+ if (fl->exists())
+ {
+ // Load the map from disk
+ File_Open_Lock_and_Check flck(new_context, "r" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+ }
+ else
+ {
+ // Since this is a new context, make and empty map in it
+ ACE_NEW_THROW_EX (new_context->storable_context_,
+ TAO_Storable_Bindings_Map (context_size,orb),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+ new_context->context_ = new_context->storable_context_;
+ File_Open_Lock_and_Check flck(new_context, "wc" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+ new_context->Write(flck.peer());
+ }
+
+ // build the global file name
+ file_name += ACE_TEXT("_global");
+
+ // Create the stream for the counter used to uniquely creat context names
+ gfl_.reset(factory->create_stream(ACE_TEXT_ALWAYS_CHAR(file_name.c_str()), ACE_TEXT("crw")));
+ if (gfl_->open() != 0)
+ {
+ delete gfl_.release();
+ ACE_THROW_RETURN(CORBA::PERSIST_STORE(),
+ CosNaming::NamingContext::_nil ());
+ }
+
+ // get the counter from disk
+ TAO_NS_Persistence_Global global;
+ *gfl_.get() >> global;
+ if (!gfl_.get ()->good () &&
+ gfl_.get ()->rdstate () != TAO_Storable_Base::eofbit)
+ {
+ gfl_.get ()->clear ();
+ ACE_THROW_RETURN (CORBA::INTERNAL (), 0);
+ }
+ gcounter_ = global.counter();
+ if(redundant_) gfl_->close();
+
+ return result._retn ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.h b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.h
new file mode 100644
index 00000000000..87f8bb203a2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.h
@@ -0,0 +1,474 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Storable_Naming_Context.h
+ *
+ * $Id$
+ *
+ * @author Bruce Trask <trask_b@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef TAO_STORABLE_NAMING_CONTEXT_H
+#define TAO_STORABLE_NAMING_CONTEXT_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Naming/Hash_Naming_Context.h"
+#include "ace/Hash_Map_Manager.h"
+#include "ace/Auto_Ptr.h"
+
+#include "orbsvcs/Naming/Storable.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Naming_Serv_Export TAO_Storable_IntId
+{
+public:
+ // = Initialization and termination methods.
+ /// Constructor.
+ TAO_Storable_IntId (void);
+
+ /// Constructor.
+ TAO_Storable_IntId (/* in */ const char * ior,
+ CosNaming::BindingType type /* = CosNaming::nobject */);
+
+ /// Copy constructor.
+ TAO_Storable_IntId (const TAO_Storable_IntId & rhs);
+
+ /// Destructor.
+ ~TAO_Storable_IntId (void);
+
+ /// Assignment operator.
+ void operator= (const TAO_Storable_IntId & rhs);
+
+ // = Data members.
+
+ /// Stringified IOR to be stored in a Persistent Naming Context.
+ CORBA::String_var ref_;
+
+ /// Binding type for <ref_>.
+ CosNaming::BindingType type_;
+};
+
+class TAO_Naming_Serv_Export TAO_Storable_ExtId
+{
+public:
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_Storable_ExtId (void);
+
+ /// Constructor.
+ TAO_Storable_ExtId (/* in */ const char *id,
+ /* in */ const char *kind);
+
+ /// Copy constructor.
+ TAO_Storable_ExtId (const TAO_Storable_ExtId & rhs);
+
+ /// Destructor.
+ ~TAO_Storable_ExtId (void);
+
+ // = Assignment and comparison methods.
+
+ /// Assignment operator (does copy memory).
+ void operator= (const TAO_Storable_ExtId & rhs);
+
+ /// Equality comparison operator (must match both id_ and kind_).
+ bool operator== (const TAO_Storable_ExtId &rhs) const;
+
+ /// Inequality comparison operator.
+ bool operator!= (const TAO_Storable_ExtId &rhs) const;
+
+ /// <hash> function is required in order for this class to be usable by
+ /// ACE_Hash_Map_Manager.
+ u_long hash (void) const;
+
+ // = Data members.
+
+ /// <id> portion of the name to be associated with some object
+ /// reference in a Storable Naming Context.
+ CORBA::String_var id_;
+
+ /// <kind> portion of the name to be associated with some object
+ /// reference in a Storable Naming Context.
+ CORBA::String_var kind_;
+
+ // Accessors.
+ // follow the mapping rules!
+
+ const char * id (void);
+ const char * kind (void);
+
+};
+
+
+/**
+ * @class TAO_Storable_Bindings_Map
+ *
+ * @brief Provides hash-table-based transient storage for name to object
+ * bindings in a Naming Context.
+ *
+ * A thin wrapper on top of ACE_Hash_Map_Manager. Supports
+ * TAO_Bindings_Map interface. Used by TAO_Transient_Naming_Context.
+ */
+class TAO_Naming_Serv_Export TAO_Storable_Bindings_Map : public TAO_Bindings_Map
+{
+public:
+
+ /// Underlying data structure - typedef for ease of use.
+ typedef ACE_Hash_Map_Manager<TAO_Storable_ExtId,
+ TAO_Storable_IntId,
+ ACE_Null_Mutex> HASH_MAP;
+
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_Storable_Bindings_Map (size_t hash_table_size, CORBA::ORB_ptr orb);
+
+ /// Destructor.
+ virtual ~TAO_Storable_Bindings_Map (void);
+
+ // = Accessors.
+
+ /// Get a reference to the underlying hash map.
+ HASH_MAP &map (void);
+
+ /// Return the size of the underlying hash table.
+ size_t total_size (void);
+
+ /// Return current number of entries (name bindings) in the
+ /// underlying hash map.
+ virtual size_t current_size (void);
+
+ // = Name bindings manipulation methods.
+
+ /**
+ * Add a binding with the specified parameters to the table.
+ * Return 0 on success and -1 on failure, 1 if there already is a
+ * binding with <id> and <kind>.
+ */
+ virtual int bind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type);
+
+ /**
+ * Overwrite a binding containing <id> and <kind> (or create a new
+ * one if one doesn't exist) with the specified parameters. Return
+ * 0 or 1 on success. Return -1 or -2 on failure. (-2 is returned
+ * if the new and old bindings differ in type).
+ */
+ virtual int rebind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type);
+
+ /**
+ * Remove a binding containing <id> and <kind> from the table.
+ * Return 0 on success and -1 on failure.
+ */
+ virtual int unbind (const char * id,
+ const char * kind);
+
+ /**
+ * Find the binding containing <id> and <kind> in the table, and
+ * pass binding's type and object back to the caller by reference.
+ * Return 0 on success and -1 on failure. Note: a 'duplicated' object
+ * reference is assigned to <obj>, so the caller is responsible for
+ * its deallocation.
+ */
+ virtual int find (const char * id,
+ const char * kind,
+ CORBA::Object_ptr & obj,
+ CosNaming::BindingType &type);
+
+private:
+
+ /// Helper: factors common code from <bind> and <rebind>.
+ int shared_bind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type,
+ int rebind);
+
+ /// Hash map used for storage.
+ HASH_MAP map_;
+
+ CORBA::ORB_var orb_;
+
+};
+
+/**
+ * @class TAO_Storable_Naming_Context
+ *
+ * @brief This class plays a role of a 'ConcreteImplementor' in the
+ * Bridge pattern architecture of the CosNaming::NamingContext
+ * implementation.
+ *
+ * This class provides a implementation of the
+ * NamingContext functionality, i.e., the state can be preserved
+ * across process boundaries. Derives from
+ * TAO_Hash_Naming_Context and uses TAO_Storable_Bindings_Map to
+ * store name to object bindings.
+ */
+class TAO_Naming_Serv_Export TAO_Storable_Naming_Context : public TAO_Hash_Naming_Context
+{
+
+public:
+
+ /// Underlying data structure - typedef for ease of use.
+ typedef TAO_Storable_Bindings_Map::HASH_MAP HASH_MAP;
+
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_Storable_Naming_Context (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Naming_Service_Persistence_Factory *factory,
+ const ACE_TCHAR *persistence_directory,
+ size_t hash_table_size = ACE_DEFAULT_MAP_SIZE);
+
+ /// Destructor.
+ virtual ~TAO_Storable_Naming_Context (void);
+
+ // = Utility methods.
+ /**
+ * This utility method factors out the code needed to create a new
+ * Storable Naming Context servant and activate it under the
+ * specified POA with the specified id. This function is static so
+ * that the code can be used, both from inside the class (e.g.,
+ * <new_context>), and from outside (e.g., Naming_Utils.cpp).
+ */
+ static CosNaming::NamingContext_ptr make_new_context (
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ const char *poa_id,
+ size_t context_size,
+ TAO_Naming_Service_Persistence_Factory *factory,
+ const ACE_TCHAR *persistence_directory,
+ TAO_Storable_Naming_Context **new_context
+ ACE_ENV_ARG_DECL);
+
+ // = Methods not implemented in TAO_Hash_Naming_Context.
+
+ static CosNaming::NamingContext_ptr recreate_all(
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ const char *poa_id,
+ size_t context_size,
+ int reentering,
+ TAO_Naming_Service_Persistence_Factory *factory,
+ const ACE_TCHAR *persistence_directory,
+ int use_redundancy
+ ACE_ENV_ARG_DECL);
+
+
+ /**
+ * This operation returns a new naming context implemented by the
+ * same naming server in which the operation was invoked. The
+ * context is not bound.
+ */
+ virtual CosNaming::NamingContext_ptr new_context (ACE_ENV_SINGLE_ARG_DECL);
+
+ /**
+ * Returns at most the requested number of bindings <how_many> in
+ * <bl>. If the naming context contains additional bindings, they
+ * are returned with a BindingIterator. In the naming context does
+ * not contain any additional bindings <bi> returned as null.
+ */
+ virtual void list (CORBA::ULong how_many,
+ CosNaming::BindingList_out &bl,
+ CosNaming::BindingIterator_out &bi
+ ACE_ENV_ARG_DECL);
+
+
+ virtual void rebind (const CosNaming::Name& n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Create a binding for name <n> and object <obj> in the naming
+ * context. Compound names are treated as follows: ctx->bind (<c1;
+ * c2; c3; cn>, obj) = (ctx->resolve (<c1; c2; cn-1>))->bind (<cn>,
+ * obj) if the there already exists a binding for the specified
+ * name, <AlreadyBound> exception is thrown. Naming contexts should
+ * be bound using <bind_context> and <rebind_context> in order to
+ * participate in name resolution later.
+ */
+ virtual void bind (const CosNaming::Name &n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL);
+
+
+ /**
+ * This is the version of <bind> specifically for binding naming
+ * contexts, so that they will participate in name resolution when
+ * compound names are passed to be resolved.
+ */
+ virtual void bind_context (const CosNaming::Name &n,
+ CosNaming::NamingContext_ptr nc
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * This is a version of <rebind> specifically for naming contexts,
+ * so that they can participate in name resolution when compound
+ * names are passed.
+ */
+ virtual void rebind_context (const CosNaming::Name &n,
+ CosNaming::NamingContext_ptr nc
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Return object reference that is bound to the name. Compound name
+ * resolve is defined as follows: ctx->resolve (<c1; c2; cn>) =
+ * ctx->resolve (<c1; c2 cn-1>)->resolve (<cn>) The naming service
+ * does not return the type of the object. Clients are responsible
+ * for "narrowing" the object to the appropriate type.
+ */
+ virtual CORBA::Object_ptr resolve (const CosNaming::Name &n
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Remove the name binding from the context. When compound names
+ * are used, unbind is defined as follows: ctx->unbind (<c1; c2;
+ * cn>) = (ctx->resolve (<c1; c2; cn-1>))->unbind (<cn>)
+ */
+ virtual void unbind (const CosNaming::Name &n
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * This operation creates a new context and binds it to the name
+ * supplied as an argument. The newly-created context is
+ * implemented by the same server as the context in which it was
+ * bound (the name argument excluding the last component).
+ */
+ virtual CosNaming::NamingContext_ptr bind_new_context (
+ const CosNaming::Name &n
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Delete the naming context. The user should take care to <unbind> any
+ * bindings in which the given context is bound to some names, to
+ * avoid dangling references when invoking <destroy> operation.
+ * NOTE: <destory> is a no-op on the root context.
+ * NOTE: after <destroy> is invoked on a Naming Context, all
+ * BindingIterators associated with that Naming Context are also destroyed.
+ */
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL);
+
+protected:
+
+ /// Global counter used for generation of POA ids for children Naming
+ /// Contexts.
+ static ACE_UINT32 gcounter_;
+
+ /// Counter used for generation of transients
+ ACE_UINT32 counter_;
+
+ /**
+ * A pointer to the underlying data structure used to store name
+ * bindings. While our superclass (TAO_Hash_Naming_Context) also
+ * maintains a pointer to the data structure, keeping this pointer
+ * around saves us from the need to downcast when invoking
+ * non-virtual methods.
+ */
+ TAO_Storable_Bindings_Map *storable_context_;
+
+ CORBA::ORB_var orb_;
+
+ ACE_CString name_;
+
+ PortableServer::POA_var poa_;
+
+ TAO_Naming_Service_Persistence_Factory *factory_;
+
+ /// The directory in which to store the files
+ ACE_CString persistence_directory_;
+
+ /// Save the hash table initial size
+ size_t hash_table_size_;
+
+ /// Disk time that match current memory state
+ time_t last_changed_;
+
+ /// Flag to tell use whether we are redundant or not
+ static int redundant_;
+
+ static const char * root_name_;
+
+ /// The pointer to the global file used to allocate new contexts
+ static ACE_Auto_Ptr<TAO_Storable_Base> gfl_;
+
+/**
+ * @class File_Open_Lock_and_Check
+ *
+ * @brief Helper class for the TAO_Storable_Naming_Context.
+ *
+ * Guard class for the TAO_Storable_Naming_Context. It opens
+ * a file for read/write and sets a lock on it. It then checks
+ * if the file has changed and re-reads it if it has.
+ *
+ * The destructor insures that the lock gets released.
+ *
+ * <pre>
+ * How to use this class:
+ * File_Open_Lock_and_Check flck(this, name_len > 1 ? "r" : "rw");
+ ACE_CHECK;
+ * </pre>
+ */
+class File_Open_Lock_and_Check
+{
+public:
+
+ /// Constructor - we always need the object which we guard.
+ File_Open_Lock_and_Check(TAO_Storable_Naming_Context * context,
+ const char * mode
+ ACE_ENV_ARG_DECL);
+
+ /// Destructor
+ ~File_Open_Lock_and_Check(void);
+
+ /// Releases the lock, closes the file, and deletes the I/O stream.
+ void release(void);
+
+ /// Returns the stream to read/write on
+ TAO_Storable_Base & peer(void);
+
+private:
+ /// Default constructor
+ File_Open_Lock_and_Check(void);
+
+ /// A flag to keep us from trying to close things more than once.
+ int closed_;
+
+ /// We need to save the pointer to our parent for cleaning up
+ TAO_Storable_Naming_Context * context_;
+
+ /// The pointer to the actual file I/O (bridge pattern)
+ TAO_Storable_Base *fl_;
+
+ /// The flags that we were opened with
+ int rwflags_;
+
+ /// Symbolic values for the flags in the above
+ enum{ mode_write = 1, mode_read = 2, mode_create = 4 };
+}; // end of embedded class File_Open_Lock_and_Check
+
+ friend class File_Open_Lock_and_Check;
+
+ int load_map(File_Open_Lock_and_Check *flck ACE_ENV_ARG_DECL);
+
+ void Write(TAO_Storable_Base& wrtr);
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_STORABLE_NAMING_CONTEXT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp
new file mode 100644
index 00000000000..b2bb63bf6cf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp
@@ -0,0 +1,125 @@
+// $Id$
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// Storable_Naming_Context_Activator.h
+//
+// = AUTHOR
+// Byron Harris <harris_b@ociweb.com>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Storable_Naming_Context_Activator.h"
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+#include "orbsvcs/Naming/Naming_Context_Interface.h"
+#include "orbsvcs/Naming/Storable_Naming_Context.h"
+#include "orbsvcs/Naming/Storable.h"
+#include "ace/Auto_Ptr.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Storable_Naming_Context_Activator::TAO_Storable_Naming_Context_Activator (
+ CORBA::ORB_ptr orb,
+ TAO_Naming_Service_Persistence_Factory *factory,
+ const ACE_TCHAR *persistence_directory,
+ size_t context_size)
+ : orb_(orb),
+ factory_(factory),
+ persistence_directory_(persistence_directory),
+ context_size_(context_size)
+{
+}
+
+TAO_Storable_Naming_Context_Activator::~TAO_Storable_Naming_Context_Activator ()
+{
+ delete factory_;
+}
+
+PortableServer::Servant
+TAO_Storable_Naming_Context_Activator::incarnate (
+ const PortableServer::ObjectId &oid,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::ForwardRequest))
+{
+
+ // Make sure complete initialization has been done
+ ACE_ASSERT (factory_ != 0);
+
+ CORBA::String_var poa_id = PortableServer::ObjectId_to_string (oid);
+
+ // The approached used is to simply verify that there is a
+ // persistence element that exists that corresponds to the
+ // poa_id. If so, an empty context is created. Later, when the
+ // context is accessed it will be determined that the contents of
+ // the persistence elment needs to be read in.
+
+ // Does this already exist on disk?
+ ACE_TString file_name(persistence_directory_);
+ file_name += ACE_TEXT("/");
+ file_name += ACE_TEXT_CHAR_TO_TCHAR(poa_id.in());
+ TAO_Storable_Base * fl = factory_->create_stream(ACE_TEXT_ALWAYS_CHAR(file_name.c_str()), ACE_TEXT("rw"));
+ if (!fl->exists()) {
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (),
+ 0);
+ }
+
+ // Store the stub we will return here.
+ CosNaming::NamingContext_var result (CosNaming::NamingContext::_nil());
+
+ // Put together a servant for the new Naming Context.
+
+ TAO_Storable_Naming_Context *context_impl = 0;
+ ACE_NEW_THROW_EX (context_impl,
+ TAO_Storable_Naming_Context (orb_,
+ poa,
+ poa_id.in (),
+ factory_,
+ persistence_directory_,
+ context_size_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ // Put <context_impl> into the auto pointer temporarily, in case next
+ // allocation fails.
+ ACE_Auto_Basic_Ptr<TAO_Storable_Naming_Context> temp (context_impl);
+
+ TAO_Naming_Context *context = 0;
+ ACE_NEW_THROW_EX (context,
+ TAO_Naming_Context (context_impl),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ // Let <implementation> know about it's <interface>.
+ context_impl->interface (context);
+
+ // Release auto pointer, and start using reference counting to
+ // control our servant.
+ temp.release ();
+
+ return context;
+}
+
+void
+TAO_Storable_Naming_Context_Activator::etherealize (
+ const PortableServer::ObjectId &/*oid*/,
+ PortableServer::POA_ptr /*adapter*/,
+ PortableServer::Servant servant,
+ CORBA::Boolean /*cleanup_in_progress*/,
+ CORBA::Boolean remaining_activations
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (!remaining_activations) {
+ delete servant;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_HAS_MINIMUM_POA */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h
new file mode 100644
index 00000000000..d8799fd1137
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// Storable_Naming_Context_Activator.h
+//
+// = AUTHOR
+// Byron Harris <harris_b@ociweb.com>
+//
+// ============================================================================
+
+#ifndef TAO_STORABLE_NAMING_CONTEXT_ACTIVATOR_H
+#define TAO_STORABLE_NAMING_CONTEXT_ACTIVATOR_H
+#include /**/ "ace/pre.h"
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/PortableServer/ServantActivatorC.h"
+#include "tao/LocalObject.h"
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+
+#include "orbsvcs/Naming/naming_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Naming_Service_Persistence_Factory;
+
+/**
+ * A servant activator to be use with a TAO_Storable_Naming_Context.
+ * Permits contexts saved to disk in one naming service process to be
+ * "lazily" created on demand in other processes by reading the
+ * context file off disk only when a request to the context is made.
+ */
+class TAO_Naming_Serv_Export TAO_Storable_Naming_Context_Activator :
+ public virtual PortableServer::ServantActivator
+{
+public:
+
+ /**
+ * The constructor takes arguments needed to create a
+ * TAO_Storable_Naming_Context and TAO_Naming_Context on demand.
+ */
+ TAO_Storable_Naming_Context_Activator(CORBA::ORB_ptr orb,
+ TAO_Naming_Service_Persistence_Factory *factory,
+ const ACE_TCHAR *persistence_directory,
+ size_t context_size);
+
+ virtual ~TAO_Storable_Naming_Context_Activator();
+
+ /**
+ * Create a TAO_Storable_Naming_Context and TAO_Naming_Context on
+ * demand if a request to a naming context CORBA reference is made
+ * and the servant implementing this reference does not yet exist.
+ */
+ virtual PortableServer::Servant incarnate (const PortableServer::ObjectId &oid,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::ForwardRequest));
+
+ /**
+ * Used by the POA to delete the servant created from a call to incarnate.
+ */
+ virtual void etherealize (const PortableServer::ObjectId &oid,
+ PortableServer::POA_ptr adapter,
+ PortableServer::Servant servant,
+ CORBA::Boolean cleanup_in_progress,
+ CORBA::Boolean remaining_activations
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ CORBA::ORB_ptr orb_;
+ TAO_Naming_Service_Persistence_Factory *factory_;
+ const ACE_TCHAR *persistence_directory_;
+ size_t context_size_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_HAS_MINIMUM_POA */
+
+#include /**/ "ace/post.h"
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp
new file mode 100644
index 00000000000..06eb43a44b5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp
@@ -0,0 +1,344 @@
+// $Id$
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// Transient_Naming_Context.cpp
+//
+// = AUTHOR
+// Marina Spivak <marina@cs.wustl.edu> and
+// Sergio Flores-Gaitan <sergio@cs.wustl.edu>
+//
+// ============================================================================
+#include "ace/Auto_Ptr.h"
+#include "orbsvcs/Naming/Transient_Naming_Context.h"
+#include "orbsvcs/Naming/Bindings_Iterator_T.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID(Naming, Transient_Naming_Context, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int
+TAO_Transient_Bindings_Map::unbind (const char *id,
+ const char *kind)
+{
+ TAO_ExtId name (id, kind);
+ return this->map_.unbind (name);
+}
+
+int
+TAO_Transient_Bindings_Map::bind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type)
+{
+ return this->shared_bind (id, kind, obj, type, 0);
+}
+
+int
+TAO_Transient_Bindings_Map::rebind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type)
+{
+ return this->shared_bind (id, kind, obj, type, 1);
+}
+
+int
+TAO_Transient_Bindings_Map::find (const char *id,
+ const char *kind,
+ CORBA::Object_ptr & obj,
+ CosNaming::BindingType &type)
+{
+ TAO_ExtId name (id, kind);
+ TAO_IntId entry;
+
+ if (this->map_.find (name,
+ entry) != 0)
+ return -1;
+ else
+ {
+ obj = CORBA::Object::_duplicate (entry.ref_);
+ type = entry.type_;
+ return 0;
+ }
+}
+
+TAO_Transient_Bindings_Map::TAO_Transient_Bindings_Map (size_t hash_table_size)
+ : map_ (hash_table_size)
+{
+}
+
+TAO_Transient_Bindings_Map::~TAO_Transient_Bindings_Map (void)
+{
+}
+
+TAO_Transient_Bindings_Map::HASH_MAP &
+TAO_Transient_Bindings_Map::map (void)
+{
+ return map_;
+}
+
+size_t
+TAO_Transient_Bindings_Map::current_size (void)
+{
+ return map_.current_size ();
+}
+
+size_t
+TAO_Transient_Bindings_Map::total_size (void)
+{
+ return map_.total_size ();
+}
+
+int
+TAO_Transient_Bindings_Map::shared_bind (const char * id,
+ const char * kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type,
+ int rebind)
+{
+ TAO_ExtId new_name (id, kind);
+ TAO_IntId new_entry (obj, type);
+ TAO_IntId old_entry;
+
+ if (rebind == 0)
+ // Do a normal bind.
+ return this->map_.bind (new_name, new_entry);
+
+ else
+ // Rebind.
+ {
+ // Check that types of old and new entries match.
+ if (this->map_.find (new_name,
+ old_entry) == 0
+ && type != old_entry.type_)
+ return -2;
+
+ else
+ return this->map_.rebind (new_name, new_entry);
+ }
+}
+
+TAO_Transient_Naming_Context::TAO_Transient_Naming_Context (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ size_t hash_table_size)
+ : TAO_Hash_Naming_Context (poa,
+ poa_id),
+ counter_ (0),
+ transient_context_ (0)
+{
+ ACE_NEW (this->transient_context_,
+ TAO_Transient_Bindings_Map (hash_table_size));
+
+ context_ = transient_context_;
+}
+
+TAO_Transient_Naming_Context::~TAO_Transient_Naming_Context (void)
+{
+}
+
+CosNaming::NamingContext_ptr
+TAO_Transient_Naming_Context::make_new_context (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ size_t context_size
+ ACE_ENV_ARG_DECL)
+{
+ // Store the stub we will return here.
+ CosNaming::NamingContext_var result;
+
+ // Put together a servant for the new Naming Context.
+
+ TAO_Transient_Naming_Context *context_impl = 0;
+ ACE_NEW_THROW_EX (context_impl,
+ TAO_Transient_Naming_Context (poa,
+ poa_id,
+ context_size),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (result._retn ());
+
+ // Put <context_impl> into the auto pointer temporarily, in case next
+ // allocation fails.
+ ACE_Auto_Basic_Ptr<TAO_Transient_Naming_Context> temp (context_impl);
+
+ TAO_Naming_Context *context = 0;
+ ACE_NEW_THROW_EX (context,
+ TAO_Naming_Context (context_impl),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (result._retn ());
+
+ // Let <implementation> know about it's <interface>.
+ context_impl->interface (context);
+
+ // Release auto pointer, and start using reference counting to
+ // control our servant.
+ temp.release ();
+ PortableServer::ServantBase_var s = context;
+
+ // Register the new context with the POA.
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId (poa_id);
+
+ poa->activate_object_with_id (id.in (),
+ context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (result._retn ());
+
+ result = context->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ return result._retn ();
+}
+
+CosNaming::NamingContext_ptr
+TAO_Transient_Naming_Context::new_context (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX,
+ ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (),
+ CosNaming::NamingContext::_nil ());
+
+ // Generate a POA id for the new context.
+ char poa_id[BUFSIZ];
+ ACE_OS::sprintf (poa_id,
+ "%s_%d",
+ this->poa_id_.c_str (),
+ this->counter_++);
+
+ // Create a new context.
+ CosNaming::NamingContext_var result =
+ make_new_context (this->poa_.in (),
+ poa_id,
+ this->transient_context_->total_size ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ return result._retn ();
+}
+
+void
+TAO_Transient_Naming_Context::list (CORBA::ULong how_many,
+ CosNaming::BindingList_out &bl,
+ CosNaming::BindingIterator_out &bi
+ ACE_ENV_ARG_DECL)
+{
+ // Allocate nil out parameters in case we won't be able to complete
+ // the operation.
+ bi = CosNaming::BindingIterator::_nil ();
+ ACE_NEW_THROW_EX (bl,
+ CosNaming::BindingList (0),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ // Obtain a lock before we proceed with the operation.
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX,
+ ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Check to make sure this object didn't have <destroy> method
+ // invoked on it.
+ if (this->destroyed_)
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+
+ // Dynamically allocate iterator for traversing the underlying hash map.
+ HASH_MAP::ITERATOR *hash_iter = 0;
+ ACE_NEW_THROW_EX (hash_iter,
+ HASH_MAP::ITERATOR (transient_context_->map ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ // Store <hash_iter temporarily in auto pointer, in case we'll have
+ // some failures and throw an exception.
+ ACE_Auto_Basic_Ptr<HASH_MAP::ITERATOR> temp (hash_iter);
+
+ // Silliness below is required because of broken old g++!!! E.g.,
+ // without it, we could have just said HASH_MAP::ITERATOR everywhere we use ITER_DEF.
+ typedef ACE_Hash_Map_Manager<TAO_ExtId, TAO_IntId, ACE_Null_Mutex>::ITERATOR ITER_DEF;
+ typedef ACE_Hash_Map_Manager<TAO_ExtId, TAO_IntId, ACE_Null_Mutex>::ENTRY ENTRY_DEF;
+
+ // Typedef to the type of BindingIterator servant for ease of use.
+ typedef TAO_Bindings_Iterator<ITER_DEF, ENTRY_DEF>
+ ITER_SERVANT;
+
+ // A pointer to BindingIterator servant.
+ ITER_SERVANT *bind_iter = 0;
+
+ // Number of bindings that will go into the BindingList <bl>.
+ CORBA::ULong n;
+
+ // Calculate number of bindings that will go into <bl>.
+ if (this->context_->current_size () > how_many)
+ n = how_many;
+ else
+ n = static_cast<CORBA::ULong> (this->context_->current_size ());
+
+ // Use the hash map iterator to populate <bl> with bindings.
+ bl->length (n);
+
+ ENTRY_DEF *hash_entry = 0;
+
+ for (CORBA::ULong i = 0; i < n; i++)
+ {
+ hash_iter->next (hash_entry);
+ hash_iter->advance ();
+
+ if (ITER_SERVANT::populate_binding (hash_entry, bl[i]) == 0)
+ ACE_THROW (CORBA::NO_MEMORY());
+ }
+
+ // Now we are done with the BindingsList, and we can follow up on
+ // the BindingIterator business.
+
+ // If we do not need to pass back BindingIterator.
+ if (this->context_->current_size () <= how_many)
+ return;
+ else
+ {
+ // Create a BindingIterator for return.
+ ACE_NEW_THROW_EX (bind_iter,
+ ITER_SERVANT (this, hash_iter, this->poa_.in (), this->lock_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ // Release <hash_iter> from auto pointer, and start using
+ // reference counting to control our servant.
+ temp.release ();
+ PortableServer::ServantBase_var iter = bind_iter;
+
+ // Increment reference count on this Naming Context, so it doesn't get
+ // deleted before the BindingIterator servant gets deleted.
+ interface_->_add_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Register with the POA.
+ char poa_id[BUFSIZ];
+ ACE_OS::sprintf (poa_id,
+ "%s_%d",
+ this->poa_id_.c_str (),
+ this->counter_++);
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId (poa_id);
+
+ this->poa_->activate_object_with_id (id.in (),
+ bind_iter
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ bi = bind_iter->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.h b/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.h
new file mode 100644
index 00000000000..2c3de8a61f3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.h
@@ -0,0 +1,204 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Transient_Naming_Context.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_TRANSIENT_NAMING_CONTEXT_H
+#define TAO_TRANSIENT_NAMING_CONTEXT_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Naming/Hash_Naming_Context.h"
+#include "orbsvcs/Naming/Entries.h"
+#include "ace/Hash_Map_Manager.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Transient_Bindings_Map
+ *
+ * @brief Provides hash-table-based transient storage for name to object
+ * bindings in a Naming Context.
+ *
+ * A thin wrapper on top of ACE_Hash_Map_Manager. Supports
+ * TAO_Bindings_Map interface. Used by TAO_Transient_Naming_Context.
+ */
+class TAO_Naming_Serv_Export TAO_Transient_Bindings_Map : public TAO_Bindings_Map
+{
+public:
+
+ /// Underlying data structure - typedef for ease of use.
+ typedef ACE_Hash_Map_Manager<TAO_ExtId, TAO_IntId, ACE_Null_Mutex> HASH_MAP;
+
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_Transient_Bindings_Map (size_t hash_table_size);
+
+ /// Destructor.
+ virtual ~TAO_Transient_Bindings_Map (void);
+
+ // = Accessors.
+
+ /// Get a reference to the underlying hash map.
+ HASH_MAP &map (void);
+
+ /// Return the size of the underlying hash table.
+ size_t total_size (void);
+
+ /// Return current number of entries (name bindings) in the
+ /// underlying hash map.
+ virtual size_t current_size (void);
+
+ // = Name bindings manipulation methods.
+
+ /**
+ * Add a binding with the specified parameters to the table.
+ * Return 0 on success and -1 on failure, 1 if there already is a
+ * binding with <id> and <kind>.
+ */
+ virtual int bind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type);
+
+ /**
+ * Overwrite a binding containing <id> and <kind> (or create a new
+ * one if one doesn't exist) with the specified parameters. Return
+ * 0 or 1 on success. Return -1 or -2 on failure. (-2 is returned
+ * if the new and old bindings differ in type).
+ */
+ virtual int rebind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type);
+
+ /**
+ * Remove a binding containing <id> and <kind> from the table.
+ * Return 0 on success and -1 on failure.
+ */
+ virtual int unbind (const char * id,
+ const char * kind);
+
+ /**
+ * Find the binding containing <id> and <kind> in the table, and
+ * pass binding's type and object back to the caller by reference.
+ * Return 0 on success and -1 on failure. Note: a 'duplicated' object
+ * reference is assigned to <obj>, so the caller is responsible for
+ * its deallocation.
+ */
+ virtual int find (const char * id,
+ const char * kind,
+ CORBA::Object_ptr & obj,
+ CosNaming::BindingType &type);
+
+private:
+
+ /// Helper: factors common code from <bind> and <rebind>.
+ int shared_bind (const char *id,
+ const char *kind,
+ CORBA::Object_ptr obj,
+ CosNaming::BindingType type,
+ int rebind);
+
+ /// Hash map used for storage.
+ HASH_MAP map_;
+};
+
+/**
+ * @class TAO_Transient_Naming_Context
+ *
+ * @brief This class plays a role of a 'ConcreteImplementor' in the
+ * Bridge pattern architecture of the CosNaming::NamingContext
+ * implementation.
+ *
+ * This class provides a transient implementation of the
+ * NamingContext functionality, i.e., the state is not preserved
+ * across process boundaries. Derives from
+ * TAO_Hash_Naming_Context and uses TAO_Transient_Bindings_Map to
+ * store name to object bindings.
+ */
+class TAO_Naming_Serv_Export TAO_Transient_Naming_Context : public TAO_Hash_Naming_Context
+{
+
+public:
+
+ /// Underlying data structure - typedef for ease of use.
+ typedef TAO_Transient_Bindings_Map::HASH_MAP HASH_MAP;
+
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_Transient_Naming_Context (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ size_t hash_table_size
+ = ACE_DEFAULT_MAP_SIZE);
+
+ /// Destructor.
+ virtual ~TAO_Transient_Naming_Context (void);
+
+ // = Utility methods.
+ /**
+ * This utility method factors out the code needed to create a new
+ * Transient Naming Context servant and activate it under the
+ * specified POA with the specified id. This function is static so
+ * that the code can be used, both from inside the class (e.g., <new_context>),
+ * and from outside (e.g., Naming_Utils.cpp).
+ */
+ static CosNaming::NamingContext_ptr make_new_context (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ size_t context_size
+ ACE_ENV_ARG_DECL);
+
+ // = Methods not implemented in TAO_Hash_Naming_Context.
+
+ /**
+ * This operation returns a new naming context implemented by the
+ * same naming server in which the operation was invoked. The
+ * context is not bound.
+ */
+ virtual CosNaming::NamingContext_ptr new_context (ACE_ENV_SINGLE_ARG_DECL);
+
+ /**
+ * Returns at most the requested number of bindings <how_many> in
+ * <bl>. If the naming context contains additional bindings, they
+ * are returned with a BindingIterator. In the naming context does
+ * not contain any additional bindings <bi> returned as null.
+ */
+ virtual void list (CORBA::ULong how_many,
+ CosNaming::BindingList_out &bl,
+ CosNaming::BindingIterator_out &bi
+ ACE_ENV_ARG_DECL);
+
+protected:
+
+ /// Counter used for generation of POA ids for children Naming
+ /// Contexts.
+ ACE_UINT32 counter_;
+
+ /**
+ * A pointer to the underlying data structure used to store name
+ * bindings. While our superclass (TAO_Hash_Naming_Context) also
+ * maintains a pointer to the data structure, keeping this pointer
+ * around saves us from the need to downcast when invoking
+ * non-virtual methods.
+ */
+ TAO_Transient_Bindings_Map *transient_context_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TRANSIENT_NAMING_CONTEXT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/naming_export.h b/TAO/orbsvcs/orbsvcs/Naming/naming_export.h
new file mode 100644
index 00000000000..3bc9c600e49
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/naming_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_NAMING_EXPORT_H
+#define TAO_NAMING_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_NAMING_HAS_DLL)
+# define TAO_NAMING_HAS_DLL 0
+# endif /* ! TAO_NAMING_HAS_DLL */
+#else
+# if !defined (TAO_NAMING_HAS_DLL)
+# define TAO_NAMING_HAS_DLL 1
+# endif /* ! TAO_NAMING_HAS_DLL */
+#endif
+
+#if defined (TAO_NAMING_HAS_DLL) && (TAO_NAMING_HAS_DLL == 1)
+# if defined (TAO_NAMING_BUILD_DLL)
+# define TAO_Naming_Export ACE_Proper_Export_Flag
+# define TAO_NAMING_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_NAMING_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_NAMING_BUILD_DLL */
+# define TAO_Naming_Export ACE_Proper_Import_Flag
+# define TAO_NAMING_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_NAMING_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_NAMING_BUILD_DLL */
+#else /* TAO_NAMING_HAS_DLL == 1 */
+# define TAO_Naming_Export
+# define TAO_NAMING_SINGLETON_DECLARATION(T)
+# define TAO_NAMING_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_NAMING_HAS_DLL == 1 */
+
+#endif /* TAO_NAMING_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Naming/naming_serv_export.h b/TAO/orbsvcs/orbsvcs/Naming/naming_serv_export.h
new file mode 100644
index 00000000000..220b76294f0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/naming_serv_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_NAMING_SERV_EXPORT_H
+#define TAO_NAMING_SERV_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_NAMING_SERV_HAS_DLL)
+# define TAO_NAMING_SERV_HAS_DLL 0
+# endif /* ! TAO_NAMING_SERV_HAS_DLL */
+#else
+# if !defined (TAO_NAMING_SERV_HAS_DLL)
+# define TAO_NAMING_SERV_HAS_DLL 1
+# endif /* ! TAO_NAMING_SERV_HAS_DLL */
+#endif
+
+#if defined (TAO_NAMING_SERV_HAS_DLL) && (TAO_NAMING_SERV_HAS_DLL == 1)
+# if defined (TAO_NAMING_SERV_BUILD_DLL)
+# define TAO_Naming_Serv_Export ACE_Proper_Export_Flag
+# define TAO_NAMING_SERV_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_NAMING_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_NAMING_SERV_BUILD_DLL */
+# define TAO_Naming_Serv_Export ACE_Proper_Import_Flag
+# define TAO_NAMING_SERV_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_NAMING_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_NAMING_SERV_BUILD_DLL */
+#else /* TAO_NAMING_SERV_HAS_DLL == 1 */
+# define TAO_Naming_Serv_Export
+# define TAO_NAMING_SERV_SINGLETON_DECLARATION(T)
+# define TAO_NAMING_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_NAMING_SERV_HAS_DLL == 1 */
+
+#endif /* TAO_NAMING_SERV_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Naming/naming_skel_export.h b/TAO/orbsvcs/orbsvcs/Naming/naming_skel_export.h
new file mode 100644
index 00000000000..aef94b094c2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/naming_skel_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_NAMING_SKEL_EXPORT_H
+#define TAO_NAMING_SKEL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_NAMING_SKEL_HAS_DLL)
+# define TAO_NAMING_SKEL_HAS_DLL 0
+# endif /* ! TAO_NAMING_SKEL_HAS_DLL */
+#else
+# if !defined (TAO_NAMING_SKEL_HAS_DLL)
+# define TAO_NAMING_SKEL_HAS_DLL 1
+# endif /* ! TAO_NAMING_SKEL_HAS_DLL */
+#endif
+
+#if defined (TAO_NAMING_SKEL_HAS_DLL) && (TAO_NAMING_SKEL_HAS_DLL == 1)
+# if defined (TAO_NAMING_SKEL_BUILD_DLL)
+# define TAO_Naming_Skel_Export ACE_Proper_Export_Flag
+# define TAO_NAMING_SKEL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_NAMING_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_NAMING_SKEL_BUILD_DLL */
+# define TAO_Naming_Skel_Export ACE_Proper_Import_Flag
+# define TAO_NAMING_SKEL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_NAMING_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_NAMING_SKEL_BUILD_DLL */
+#else /* TAO_NAMING_SKEL_HAS_DLL == 1 */
+# define TAO_Naming_Skel_Export
+# define TAO_NAMING_SKEL_SINGLETON_DECLARATION(T)
+# define TAO_NAMING_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_NAMING_SKEL_HAS_DLL == 1 */
+
+#endif /* TAO_NAMING_SKEL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Naming/nsconf.h b/TAO/orbsvcs/orbsvcs/Naming/nsconf.h
new file mode 100644
index 00000000000..6f5b66d830e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/nsconf.h
@@ -0,0 +1,45 @@
+//=============================================================================
+/**
+ * @file nsconf.h
+ *
+ * $Id$
+ *
+ * Name service configuration file.
+ *
+ *
+ * @author Chris Cleeland
+ * @author Douglas C. Schmidt
+ */
+//=============================================================================
+
+#ifndef TAO_NAMESERVICE_CONF_H
+#define TAO_NAMESERVICE_CONF_H
+#include /**/ "ace/pre.h"
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+// TAO Naming Service.
+
+// Memory mapping address used by TAO's Naming Service when run in
+// persistent mode.
+#if !defined (TAO_NAMING_BASE_ADDR)
+# define TAO_NAMING_BASE_ADDR ACE_DEFAULT_BASE_ADDR
+#endif /* ! TAO_NAMING_BASE_ADDR */
+
+// Poa id of the root Naming Context in a Naming server.
+#if !defined (TAO_ROOT_NAMING_CONTEXT)
+# define TAO_ROOT_NAMING_CONTEXT "NameService"
+#endif /* ! TAO_ROOT_NAMING_CONTEXT */
+
+// The name under which the index of naming contexts is stored in
+// persistent naming service.
+#if !defined (TAO_NAMING_CONTEXT_INDEX)
+# define TAO_NAMING_CONTEXT_INDEX "Naming_Context_Index"
+#endif /* ! TAO_NAMING_CONTEXT_INDEX */
+
+
+#include /**/ "ace/post.h"
+#endif /*TAO_NAMESERVICE_CONF_H*/
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Admin.cpp b/TAO/orbsvcs/orbsvcs/Notify/Admin.cpp
new file mode 100644
index 00000000000..48a0a7d9de0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Admin.cpp
@@ -0,0 +1,222 @@
+// $Id$
+#include "orbsvcs/Notify/Admin.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Admin.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Notify,
+ TAO_Notify_Admin,
+ "$Id$")
+
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+
+#include "orbsvcs/Notify/Container_T.h"
+#include "orbsvcs/Notify/Proxy.h"
+#include "orbsvcs/Notify/EventChannel.h"
+#include "orbsvcs/Notify/Topology_Saver.h"
+#include "orbsvcs/Notify/Save_Persist_Worker_T.h"
+#include "orbsvcs/Notify/Reconnect_Worker_T.h"
+#include "orbsvcs/Notify/Consumer_Map.h"
+#include "orbsvcs/Notify/Supplier_Map.h"
+#include "orbsvcs/Notify/ConsumerAdmin.h"
+#include "orbsvcs/Notify/SupplierAdmin.h"
+
+#include "tao/debug.h"
+
+//#define DEBUG_LEVEL 9
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Admin::TAO_Notify_Admin ()
+ : ec_ (0)
+ , filter_operator_ (CosNotifyChannelAdmin::OR_OP)
+ , is_default_ (false)
+{
+ // Initialize all Admin objects to initially be subscribed for all
+ // events. This is a reasonable default and is required to allow
+ // Cos Event consumers/suppliers to send/receive events,
+ this->subscribed_types_.insert (TAO_Notify_EventType::special ());
+}
+
+TAO_Notify_Admin::~TAO_Notify_Admin ()
+{
+}
+
+void
+TAO_Notify_Admin::init (TAO_Notify::Topology_Parent* parent ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (this->ec_.get() == 0);
+
+ this->ec_.reset (dynamic_cast<TAO_Notify_EventChannel *>(parent));
+ ACE_ASSERT (this->ec_.get() != 0);
+
+ // this-> on the following line confuses VC6
+ initialize (parent ACE_ENV_ARG_PARAMETER);
+
+ TAO_Notify_Proxy_Container* proxy_container = 0;
+ ACE_NEW_THROW_EX (proxy_container,
+ TAO_Notify_Proxy_Container (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+ this->proxy_container_.reset (proxy_container);
+
+ this->proxy_container().init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+}
+
+void
+TAO_Notify_Admin::remove (TAO_Notify_Proxy* proxy ACE_ENV_ARG_DECL)
+{
+ this->proxy_container().remove (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Admin::subscribed_types (TAO_Notify_EventTypeSeq& subscribed_types ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Adopt the Admin's subscription.
+ TAO_Notify_EventTypeSeq added (this->subscribed_types_), removed;
+
+ added.add_and_remove (subscribed_types, removed);
+
+ subscribed_types = added;
+}
+
+int
+TAO_Notify_Admin::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int sd_ret = TAO_Notify_Object::shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+ if (sd_ret == 1)
+ return 1;
+
+ this->proxy_container().shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+
+ return 0;
+}
+
+void
+TAO_Notify_Admin::insert (TAO_Notify_Proxy* proxy ACE_ENV_ARG_DECL)
+{
+ this->proxy_container().insert (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Admin::save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL)
+{
+ bool changed = this->children_changed_;
+ this->children_changed_ = false;
+ this->self_changed_ = false;
+
+ if (is_persistent ())
+ {
+ TAO_Notify::NVPList attrs;
+ this->save_attrs(attrs);
+
+ const char* type = this->get_admin_type_name();
+
+ bool want_all_children =
+ saver.begin_object(this->id(), type, attrs, changed
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (want_all_children || this->filter_admin_.is_changed ())
+ {
+ this->filter_admin_.save_persistent(saver ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ if (want_all_children || this->subscribed_types_.is_changed ())
+ {
+ this->subscribed_types_.save_persistent(saver ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ TAO_Notify::Save_Persist_Worker<TAO_Notify_Proxy>
+ wrk(saver, want_all_children);
+ this->proxy_container().collection()->for_each(&wrk
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ saver.end_object(this->id(), type ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+void
+TAO_Notify_Admin::save_attrs (TAO_Notify::NVPList& attrs)
+{
+ TAO_Notify_Object::save_attrs(attrs);
+ attrs.push_back(TAO_Notify::NVP("InterFilterGroupOperator",
+ this->filter_operator_));
+ if (this->is_default_)
+ {
+ attrs.push_back (TAO_Notify::NVP ("default", "yes"));
+ }
+}
+
+void
+TAO_Notify_Admin::load_attrs(const TAO_Notify::NVPList& attrs)
+{
+ TAO_Notify_Object::load_attrs (attrs);
+ const char* value = 0;
+ if (attrs.find ("InterFilterGroupOperator", value))
+ {
+ this->filter_operator_ = static_cast <CosNotifyChannelAdmin::InterFilterGroupOperator> (ACE_OS::atoi (value));
+ }
+
+ if (attrs.find ("default", value))
+ {
+ this->is_default_ = (ACE_OS::strcmp (value, "yes") == 0);
+ }
+}
+
+TAO_Notify::Topology_Object*
+TAO_Notify_Admin::load_child (const ACE_CString &type,
+ CORBA::Long id,
+ const TAO_Notify::NVPList& attrs
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_UNUSED_ARG (attrs);
+ TAO_Notify::Topology_Object* result = this;
+ if (type == "subscriptions")
+ {
+ if (DEBUG_LEVEL)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Admin reload subscription %d\n"),
+ static_cast<int> (id)
+ ));
+ // since we initialized our subscribed types to everything
+ // in the constructor. we have to clear it out first.
+ this->subscribed_types_.reset();
+ result = &this->subscribed_types_;
+ }
+ else if (type == "filter_admin")
+ {
+ if (DEBUG_LEVEL)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Admin reload filter_admin %d\n"),
+ static_cast<int> (id)
+ ));
+ result = & this->filter_admin_;
+ }
+ return result;
+}
+
+void
+TAO_Notify_Admin::reconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify::Reconnect_Worker<TAO_Notify_Proxy> wrk;
+ this->proxy_container().collection()->for_each(&wrk ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Admin.h b/TAO/orbsvcs/orbsvcs/Notify/Admin.h
new file mode 100644
index 00000000000..a7a9487c8c4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Admin.h
@@ -0,0 +1,126 @@
+/* -*- C++ -*- */
+/**
+ * @file Admin.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_ADMIN_H
+#define TAO_Notify_ADMIN_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/FilterAdmin.h"
+#include "orbsvcs/Notify/EventTypeSeq.h"
+#include "orbsvcs/Notify/Topology_Object.h"
+#include "orbsvcs/Notify/EventChannel.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Proxy;
+template <class TYPE> class TAO_Notify_Container_T;
+
+/**
+ * @class TAO_Notify_Admin
+ *
+ * @brief Base class for the ConsumerAdmin and SupplierAdmin.
+ *
+ */
+
+class TAO_Notify_Serv_Export TAO_Notify_Admin : public TAO_Notify::Topology_Parent
+{
+ friend class TAO_Notify_Builder;
+public:
+ typedef CosNotifyChannelAdmin::AdminIDSeq SEQ;
+ typedef CosNotifyChannelAdmin::AdminIDSeq_var SEQ_VAR;
+
+ /// Constuctor
+ TAO_Notify_Admin ();
+
+ /// Destructor
+ virtual ~TAO_Notify_Admin ();
+
+ /// Init
+ void init (TAO_Notify::Topology_Parent * parent ACE_ENV_ARG_DECL);
+
+ /// Insert the proxy in the <proxy_container_>.
+ void insert (TAO_Notify_Proxy* proxy ACE_ENV_ARG_DECL);
+
+ /// Remove type from container_
+ void remove (TAO_Notify_Proxy *proxy ACE_ENV_ARG_DECL);
+
+ /// Access Admin FilterAdmin.
+ TAO_Notify_FilterAdmin& filter_admin (void);
+
+ /// Set Filter operator
+ void filter_operator (
+ CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator
+ );
+
+ /// Access Filter operator
+ CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator (void);
+
+ /// Obtain the Admin's subscribed types.
+ void subscribed_types (TAO_Notify_EventTypeSeq& subscribed_types
+ ACE_ENV_ARG_DECL);
+
+ TAO_Notify_EventChannel * event_channel () const;
+ /// Shutdown
+ virtual int shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+ virtual void save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL);
+ virtual TAO_Notify::Topology_Object* load_child (const ACE_CString &type,
+ CORBA::Long id, const TAO_Notify::NVPList& attrs ACE_ENV_ARG_DECL);
+ virtual void reconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ void set_default (bool is_default);
+ bool is_default () const;
+ virtual void load_attrs(const TAO_Notify::NVPList& attrs);
+
+protected:
+ void save_attrs (TAO_Notify::NVPList& attrs);
+ virtual const char * get_admin_type_name (void) const = 0;
+
+ typedef TAO_Notify_Container_T<TAO_Notify_Proxy> TAO_Notify_Proxy_Container;
+
+ TAO_Notify_Proxy_Container& proxy_container();
+ /// = Data Members
+
+ /// The EventChannel.
+ TAO_Notify_EventChannel::Ptr ec_;
+
+
+ /// The types that we've subscribed our proxy objects with the event manager.
+ TAO_Notify_EventTypeSeq subscribed_types_;
+
+ /// Filter Administration
+ TAO_Notify_FilterAdmin filter_admin_;
+
+ /// Filter operator
+ CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator_;
+
+ bool is_default_;
+private:
+ /// The Proxy Container.
+ ACE_Auto_Ptr< TAO_Notify_Proxy_Container > proxy_container_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Admin.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_ADMIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Admin.inl b/TAO/orbsvcs/orbsvcs/Notify/Admin.inl
new file mode 100644
index 00000000000..d7cb523081e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Admin.inl
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_Notify_EventChannel *
+TAO_Notify_Admin::event_channel () const
+{
+ return this->ec_.get();
+}
+
+
+ACE_INLINE TAO_Notify_FilterAdmin&
+TAO_Notify_Admin::filter_admin (void)
+{
+ return this->filter_admin_;
+}
+
+ACE_INLINE void
+TAO_Notify_Admin::filter_operator (CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator)
+{
+ this->filter_operator_ = filter_operator;
+}
+
+ACE_INLINE CosNotifyChannelAdmin::InterFilterGroupOperator
+TAO_Notify_Admin::filter_operator (void)
+{
+ return this->filter_operator_;
+}
+
+ACE_INLINE
+void
+TAO_Notify_Admin::set_default (bool is_default)
+{
+ this->is_default_ = is_default;
+}
+
+ACE_INLINE
+bool
+TAO_Notify_Admin::is_default (void) const
+{
+ return this->is_default_;
+}
+
+ACE_INLINE TAO_Notify_Admin::TAO_Notify_Proxy_Container&
+TAO_Notify_Admin::proxy_container()
+{
+ ACE_ASSERT( proxy_container_.get() != 0 );
+ return *proxy_container_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/AdminProperties.cpp b/TAO/orbsvcs/orbsvcs/Notify/AdminProperties.cpp
new file mode 100644
index 00000000000..37798f3088f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/AdminProperties.cpp
@@ -0,0 +1,94 @@
+// $Id$
+
+#include "orbsvcs/Notify/AdminProperties.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/AdminProperties.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Notify,
+ TAO_Notify_AdminProperties,
+ "$Id$")
+
+#include "orbsvcs/CosNotificationC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_AdminProperties::TAO_Notify_AdminProperties (void)
+ : max_global_queue_length_ (CosNotification::MaxQueueLength, 0)
+ , max_consumers_ (CosNotification::MaxConsumers, 0)
+ , max_suppliers_ (CosNotification::MaxSuppliers, 0)
+ , reject_new_events_ (CosNotification::RejectNewEvents, 0)
+ , global_queue_length_ (0)
+ , global_queue_not_full_ (global_queue_lock_)
+{
+}
+
+TAO_Notify_AdminProperties::~TAO_Notify_AdminProperties ()
+{
+}
+
+int
+TAO_Notify_AdminProperties::init (const CosNotification::PropertySeq& prop_seq)
+{
+ if (TAO_Notify_PropertySeq::init (prop_seq) != 0)
+ return -1;
+
+ this->max_global_queue_length_.set (*this);
+ this->max_consumers_.set (*this);
+ this->max_suppliers_.set (*this);
+ this->reject_new_events_.set (*this);
+
+ //@@ check if unsupported property was set.
+ // This will happen when number of successfull inits != numbers of items bound in map_.
+
+ return 0;
+}
+
+void
+TAO_Notify_AdminProperties::init ()
+{
+ // This method should only be called once, (during topo load)
+ ACE_ASSERT(this->size() == 0);
+
+ if (this->max_global_queue_length_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= this->max_global_queue_length_.value();
+ this->add(this->max_global_queue_length_.name(), a);
+ }
+ if (this->max_consumers_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= this->max_consumers_.value();
+ this->add(this->max_consumers_.name(), a);
+ }
+ if (this->max_suppliers_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= this->max_suppliers_.value();
+ this->add(this->max_suppliers_.name(), a);
+ }
+ if (this->reject_new_events_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= CORBA::Any::from_boolean(this->reject_new_events_.value());
+ this->add(this->reject_new_events_.name(), a);
+ }
+}
+
+CORBA::Boolean
+TAO_Notify_AdminProperties::queue_full (void)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->global_queue_lock_, 1);
+
+ if (this->max_global_queue_length () == 0)
+ return 0;
+ else
+ if (this->global_queue_length_ >= this->max_global_queue_length ().value ())
+ return 1;
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/AdminProperties.h b/TAO/orbsvcs/orbsvcs/Notify/AdminProperties.h
new file mode 100644
index 00000000000..163e22dc13c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/AdminProperties.h
@@ -0,0 +1,133 @@
+/* -*- C++ -*- */
+/**
+ * @file AdminProperties.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_ADMINPROPERTIES_H
+#define TAO_Notify_ADMINPROPERTIES_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/PropertySeq.h"
+#include "orbsvcs/Notify/Property_T.h"
+#include "orbsvcs/Notify/Property.h"
+#include "orbsvcs/Notify/Property_Boolean.h"
+
+#include "tao/orbconf.h"
+
+#include "ace/Atomic_Op.h"
+#include "ace/Bound_Ptr.h"
+#include "ace/Condition_Thread_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_AdminProperties
+ *
+ * @brief The AdminProperties per EventChannel.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_AdminProperties
+ : public TAO_Notify_PropertySeq
+{
+public:
+ typedef ACE_Strong_Bound_Ptr<TAO_Notify_AdminProperties, TAO_SYNCH_MUTEX> Ptr;
+ /// Constuctor
+ TAO_Notify_AdminProperties (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_AdminProperties ();
+
+ // Init
+ int init (const CosNotification::PropertySeq& prop_seq);
+
+ // finish initialization after values are set by topology load
+ void init ();
+
+ // = Const Accessors
+ const TAO_Notify_Property_Long& max_global_queue_length (void) const;
+ const TAO_Notify_Property_Long& max_consumers (void) const;
+ const TAO_Notify_Property_Long& max_suppliers (void) const;
+ const TAO_Notify_Property_Boolean& reject_new_events (void) const;
+
+ // = Non-const accessors
+ TAO_Notify_Property_Long & max_global_queue_length (void);
+ TAO_Notify_Property_Long & max_consumers (void);
+ TAO_Notify_Property_Long & max_suppliers (void);
+ TAO_Notify_Property_Boolean & reject_new_events (void);
+
+ CORBA::Long& global_queue_length (void);
+ TAO_SYNCH_MUTEX& global_queue_lock (void);
+ TAO_SYNCH_CONDITION& global_queue_not_full (void);
+
+ TAO_Notify_Atomic_Property_Long& consumers (void);
+ TAO_Notify_Atomic_Property_Long& suppliers (void);
+
+ // = Helper method
+ /// Returns true if Queue is full
+ CORBA::Boolean queue_full (void);
+
+protected:
+ // @@ Pradeep can you explain why there is any maximum for these
+ // values? Should they be configurable by the user so the resource
+ // requirements can be bounded?
+
+ // = Admin. properties
+ // for all these properties the default O implies no limit
+ /**
+ * The maximum number of events that will be queued by the channel before
+ * the channel begins discarding events or rejecting new events upon
+ * receipt of each new event.
+ */
+ TAO_Notify_Property_Long max_global_queue_length_;
+
+ /// The maximum number of consumers that can be connected to the channel at
+ /// any given time.
+ TAO_Notify_Property_Long max_consumers_;
+
+ /// The maximum number of suppliers that can be connected to the channel at
+ /// any given time.
+ TAO_Notify_Property_Long max_suppliers_;
+
+ /// Reject any new event.
+ TAO_Notify_Property_Boolean reject_new_events_;
+
+ //= Variables
+ /// This is used to count the queue length across all buffers in the Notify Service
+ /// to enforce the "MaxQueueLength" property.
+ CORBA::Long global_queue_length_;
+
+ /// Global queue lock used to serialize access to all queues.
+ TAO_SYNCH_MUTEX global_queue_lock_;
+
+ /// The condition that the queue_length_ is not at max.
+ TAO_SYNCH_CONDITION global_queue_not_full_;
+
+ /// These are used to count the number of consumers and suppliers connected to
+ /// the system.
+ TAO_Notify_Atomic_Property_Long consumers_;
+ TAO_Notify_Atomic_Property_Long suppliers_;
+};
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/AdminProperties.inl"
+#endif /* __ACE_INLINE__ */
+
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_ADMINPROPERTIES_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/AdminProperties.inl b/TAO/orbsvcs/orbsvcs/Notify/AdminProperties.inl
new file mode 100644
index 00000000000..bc93ae89184
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/AdminProperties.inl
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE const TAO_Notify_Property_Long&
+TAO_Notify_AdminProperties::max_global_queue_length (void) const
+{
+ return this->max_global_queue_length_;
+}
+
+ACE_INLINE TAO_Notify_Property_Long&
+TAO_Notify_AdminProperties::max_global_queue_length (void)
+{
+ return this->max_global_queue_length_;
+}
+
+ACE_INLINE const TAO_Notify_Property_Long&
+TAO_Notify_AdminProperties::max_consumers (void) const
+{
+ return this->max_consumers_;
+}
+
+ACE_INLINE TAO_Notify_Property_Long&
+TAO_Notify_AdminProperties::max_consumers (void)
+{
+ return this->max_consumers_;
+}
+
+ACE_INLINE const TAO_Notify_Property_Long&
+TAO_Notify_AdminProperties::max_suppliers (void) const
+{
+ return this->max_suppliers_;
+}
+
+ACE_INLINE TAO_Notify_Property_Long&
+TAO_Notify_AdminProperties::max_suppliers (void)
+{
+ return this->max_suppliers_;
+}
+
+ACE_INLINE const TAO_Notify_Property_Boolean&
+TAO_Notify_AdminProperties::reject_new_events (void) const
+{
+ return this->reject_new_events_;
+}
+
+ACE_INLINE TAO_Notify_Property_Boolean&
+TAO_Notify_AdminProperties::reject_new_events (void)
+{
+ return this->reject_new_events_;
+}
+
+ACE_INLINE CORBA::Long&
+TAO_Notify_AdminProperties::global_queue_length (void)
+{
+ return this->global_queue_length_;
+}
+
+ACE_INLINE TAO_SYNCH_MUTEX&
+TAO_Notify_AdminProperties::global_queue_lock (void)
+{
+ return this->global_queue_lock_;
+}
+
+ACE_INLINE TAO_SYNCH_CONDITION&
+TAO_Notify_AdminProperties::global_queue_not_full(void)
+{
+ return this->global_queue_not_full_;
+}
+
+ACE_INLINE TAO_Notify_Atomic_Property_Long&
+TAO_Notify_AdminProperties::consumers (void)
+{
+ return this->consumers_;
+}
+
+ACE_INLINE TAO_Notify_Atomic_Property_Long&
+TAO_Notify_AdminProperties::suppliers (void)
+{
+ return this->suppliers_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/AllocTracker.h b/TAO/orbsvcs/orbsvcs/Notify/AllocTracker.h
new file mode 100644
index 00000000000..e7b1b61ea8a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/AllocTracker.h
@@ -0,0 +1,81 @@
+// $Id$
+#ifndef ALLOC_TRACKER_H
+#define ALLOC_TRACKER_H
+#include /**/"ace/pre.h"
+
+#include "orbsvcs/Notify/notify_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//#define DEBUG_MEMORY_USE
+#if defined(_MSC_VER) && defined (_DEBUG) && defined (DEBUG_MEMORY_USE)
+namespace CRT{
+
+/// \brief dump heap allocation stats
+///
+/// This works only on microsoft/windows compilers
+/// but it's handy to diagnose memory allocation problems.
+/// To use, add the following macro in the scope where you
+/// want to check memory usage.
+/// ACE_WIN32_HEAP_MONITOR(name);
+/// where name is a quoted string to label the stats.
+/// When the object created by this macro goes out of scope
+/// it will write a log message like:
+/// (10056|6396) name: New heap blocks: 39; bytes: 19550
+///
+/// For non-debug, or non-vc builds, the macro expands to nothing
+class CrtHeapDumper
+{
+public:
+ CrtHeapDumper(const char * name, bool verbose = false)
+ : name_ (name)
+ , verbose_ (verbose)
+ {
+ _CrtMemCheckpoint (&before_);
+ }
+
+ ~CrtHeapDumper()
+ {
+ dump();
+ }
+ void dump()
+ {
+ _CrtMemState after;
+ _CrtMemCheckpoint (&after);
+ _CrtMemState diff;
+ _CrtMemDifference (&diff, &before_, &after);
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) %s: New heap blocks: %d; bytes: %d\n"),
+ name_.c_str (),
+ static_cast<int> (diff.lCounts[_NORMAL_BLOCK]),
+ static_cast<int> (diff.lSizes[_NORMAL_BLOCK])
+ ));
+ if (this->verbose_)
+ {
+ _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
+ _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT );
+ _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE );
+ _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT );
+ _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE );
+ _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT );
+ _CrtMemDumpAllObjectsSince (&this->before_);
+ }
+ }
+
+private:
+ ACE_CString name_;
+ bool verbose_;
+ _CrtMemState before_;
+};
+} //namespace
+#define ACE_WIN32_HEAP_MONITOR(name) \
+ CRT::CrtHeapDumper heap_check___(name); \
+ ACE_UNUSED_ARG (heap_check___)
+#else // _MSC_VER etc
+ #define ACE_WIN32_HEAP_MONITOR(name)
+#endif // _MSC_VER etc
+#include /**/"ace/post.h"
+#endif // ALLOC_TRACKER_H
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp
new file mode 100644
index 00000000000..2c47a4225ef
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp
@@ -0,0 +1,140 @@
+// $Id$
+
+#include "orbsvcs/Notify/Any/AnyEvent.h"
+
+ACE_RCSID (Notify, TAO_Notify_AnyEvent, "$Id$")
+
+#include "orbsvcs/Notify/Consumer.h"
+
+#include "tao/corba.h"
+#include "tao/debug.h"
+
+//#define DEBUG_LEVEL 10
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_EventType TAO_Notify_AnyEvent_No_Copy::event_type_;
+
+TAO_Notify_AnyEvent_No_Copy::TAO_Notify_AnyEvent_No_Copy (const CORBA::Any &event)
+ : event_ (&event)
+{
+}
+
+TAO_Notify_AnyEvent_No_Copy::~TAO_Notify_AnyEvent_No_Copy ()
+{
+}
+
+const TAO_Notify_EventType&
+TAO_Notify_AnyEvent_No_Copy::type (void) const
+{
+ return this->event_type_;
+}
+
+void
+TAO_Notify_AnyEvent_No_Copy::convert (CosNotification::StructuredEvent& notification) const
+{
+ TAO_Notify_Event::translate (*this->event_, notification);
+}
+
+CORBA::Boolean
+TAO_Notify_AnyEvent_No_Copy::do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) const
+{
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG, "Notify (%P|%t) - "
+ "TAO_Notify_AnyEvent::do_match ()\n"));
+
+ return filter->match(*this->event_ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_AnyEvent_No_Copy::push (TAO_Notify_Consumer* consumer ACE_ENV_ARG_DECL) const
+{
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG, "Notify (%P|%t) - "
+ "TAO_Notify_AnyEvent::push \n"));
+
+ consumer->push (*this->event_ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_AnyEvent_No_Copy::push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const
+{
+ CosNotification::StructuredEvent notification;
+
+ TAO_Notify_Event::translate (*this->event_, notification);
+
+ forwarder->forward_structured (notification ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_AnyEvent_No_Copy::push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const
+{
+ CosNotification::StructuredEvent notification;
+
+ TAO_Notify_Event::translate (*this->event_, notification);
+
+ forwarder->forward_structured_no_filtering (notification ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_AnyEvent_No_Copy::push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const
+{
+ forwarder->forward_any (*this->event_ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_AnyEvent_No_Copy::push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const
+{
+ forwarder->forward_any_no_filtering (*this->event_ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_AnyEvent_No_Copy::marshal (TAO_OutputCDR & cdr) const
+{
+ const ACE_CDR::Octet ANY_CODE = MARSHAL_ANY;
+ cdr.write_octet (ANY_CODE);
+ cdr << (*this->event_);
+}
+
+//static
+TAO_Notify_AnyEvent *
+TAO_Notify_AnyEvent_No_Copy::unmarshal (TAO_InputCDR & cdr)
+{
+ TAO_Notify_AnyEvent * event = 0;
+ CORBA::Any body;
+ if (cdr >> body)
+ {
+ event = new TAO_Notify_AnyEvent (body);
+ }
+ return event;
+}
+
+TAO_Notify_Event *
+TAO_Notify_AnyEvent_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL) const
+{
+ TAO_Notify_Event * new_event;
+ ACE_NEW_THROW_EX (new_event,
+ TAO_Notify_AnyEvent (*this->event_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+ return new_event;
+}
+
+
+/*****************************************************************************/
+
+TAO_Notify_AnyEvent::TAO_Notify_AnyEvent (const CORBA::Any &event)
+ : TAO_Notify_AnyEvent_No_Copy (event)
+ , any_copy_ (event)
+{
+ this->event_ = &any_copy_;
+}
+
+TAO_Notify_AnyEvent::~TAO_Notify_AnyEvent ()
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h
new file mode 100644
index 00000000000..49c5604065f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h
@@ -0,0 +1,121 @@
+/* -*- C++ -*- */
+/**
+ * @file AnyEvent.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_ANYEVENT_H
+#define TAO_Notify_ANYEVENT_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Event.h"
+#include "orbsvcs/Notify/EventType.h"
+
+#include "orbsvcs/CosNotificationC.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Consumer;
+class TAO_Notify_AnyEvent;
+/**
+ * @class TAO_Notify_AnyEvent
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_AnyEvent_No_Copy : public TAO_Notify_Event
+{
+ friend class TAO_Notify_Builder;
+public:
+ /// Constuctor
+ TAO_Notify_AnyEvent_No_Copy (const CORBA::Any &event);
+
+ /// Destructor
+ virtual ~TAO_Notify_AnyEvent_No_Copy ();
+
+ /// Get the event type.
+ virtual const TAO_Notify_EventType& type (void) const;
+
+ CORBA::Boolean do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) const;
+
+ /// Convert to CosNotification::Structured type
+ virtual void convert (CosNotification::StructuredEvent& notification) const;
+
+ /// Push event to consumer
+ virtual void push (TAO_Notify_Consumer* consumer ACE_ENV_ARG_DECL) const;
+
+ /// Push event to the Event_Forwarder interface
+ virtual void push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const;
+
+ /// Push event to the Event_Forwarder interface
+ virtual void push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const;
+
+ /// Push event to the Event_Forwarder interface
+ virtual void push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const;
+
+ /// Push event to the Event_Forwarder interface
+ virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const;
+
+ /// marshal this event into a CDR buffer (for persistence)
+ virtual void marshal (TAO_OutputCDR & cdr) const;
+
+ /// unmarshal this event from a CDR buffer (for persistence)
+ /// \param code a code indicating what type of event to create.
+ /// \param cdr a CDR stream containing the marshalled data for the event.
+ /// \return the new event, or NULL if this is the wrong type of event.
+ static TAO_Notify_AnyEvent * unmarshal (TAO_InputCDR & cdr);
+
+protected:
+ /// returns a copy of this event allocated from the heap
+ virtual TAO_Notify_Event * copy (ACE_ENV_SINGLE_ARG_DECL) const;
+
+protected:
+
+ // This must be a pointer rather than a reference, because the derived
+ // class needs to redirect it to a new copy
+ const CORBA::Any* event_;
+
+ /// Our event type.
+ static TAO_Notify_EventType event_type_;
+};
+
+/****************************************************************************/
+
+/**
+ * @class TAO_Notify_AnyEvent
+ *
+ * @brief AnyEvent implementation.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_AnyEvent : public TAO_Notify_AnyEvent_No_Copy
+{
+public:
+ /// Constuctor
+ TAO_Notify_AnyEvent (const CORBA::Any &event);
+
+ /// Destructor
+ virtual ~TAO_Notify_AnyEvent ();
+
+protected:
+ /// Copy of the Event.
+ CORBA::Any any_copy_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_ANYEVENT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.cpp
new file mode 100644
index 00000000000..bcaef713001
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.cpp
@@ -0,0 +1,90 @@
+// $Id$
+
+#include "orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.h"
+
+ACE_RCSID (Notify, TAO_Notify_CosEC_ProxyPushConsumer, "$Id$")
+
+#include "tao/debug.h"
+#include "orbsvcs/Notify/AdminProperties.h"
+#include "orbsvcs/Notify/Method_Request_Lookup.h"
+#include "orbsvcs/Notify/Worker_Task.h"
+#include "orbsvcs/Notify/Any/AnyEvent.h"
+#include "orbsvcs/Notify/Any/PushSupplier.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_CosEC_ProxyPushConsumer::TAO_Notify_CosEC_ProxyPushConsumer (void)
+{
+}
+
+TAO_Notify_CosEC_ProxyPushConsumer::~TAO_Notify_CosEC_ProxyPushConsumer ()
+{
+}
+
+void
+TAO_Notify_CosEC_ProxyPushConsumer::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+void
+TAO_Notify_CosEC_ProxyPushConsumer::push (const CORBA::Any& any ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventComm::Disconnected
+ ))
+{
+ // Check if we should proceed at all.
+ if (this->admin_properties().reject_new_events () == 1
+ && this->admin_properties().queue_full ())
+ ACE_THROW (CORBA::IMP_LIMIT ());
+
+ if (this->is_connected () == 0)
+ {
+ ACE_THROW (CosEventComm::Disconnected ());
+ }
+
+ TAO_Notify_AnyEvent_No_Copy event (any);
+
+ TAO_Notify_Method_Request_Lookup_No_Copy request (&event, this);
+
+ this->execute_task (request ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_CosEC_ProxyPushConsumer::connect_push_supplier (CosEventComm::PushSupplier_ptr push_supplier ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventChannelAdmin::AlreadyConnected
+ ))
+{
+ // Convert Supplier to Base Type
+ TAO_Notify_PushSupplier *supplier;
+ ACE_NEW_THROW_EX (supplier,
+ TAO_Notify_PushSupplier (this),
+ CORBA::NO_MEMORY ());
+
+ supplier->init (push_supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->connect (supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_CosEC_ProxyPushConsumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_CosEC_ProxyPushConsumer::Ptr guard( this );
+ this->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+const char *
+TAO_Notify_CosEC_ProxyPushConsumer::get_proxy_type_name (void) const
+{
+ return "ec_proxy_push_consumer";
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.h
new file mode 100644
index 00000000000..4690fc1fcdd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.h
@@ -0,0 +1,86 @@
+/* -*- C++ -*- */
+/**
+ * @file CosEC_ProxyPushConsumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_COSEC_PROXYPUSHCONSUMER_H
+#define TAO_Notify_COSEC_PROXYPUSHCONSUMER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosEventChannelAdminS.h"
+
+#include "orbsvcs/Notify/ProxyConsumer_T.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_CosEC_ProxyPushConsumer
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_CosEC_ProxyPushConsumer
+ : public virtual TAO_Notify_ProxyConsumer_T <POA_CosEventChannelAdmin::ProxyPushConsumer>
+{
+ friend class TAO_Notify_Builder;
+public:
+ /// Constuctor
+ TAO_Notify_CosEC_ProxyPushConsumer (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_CosEC_ProxyPushConsumer ();
+
+
+ virtual const char * get_proxy_type_name (void) const;
+
+protected:
+ ///= CosNotifyChannelAdmin::ProxyPushConsumer methods
+
+ virtual void push (const CORBA::Any & data ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+
+ virtual void connect_push_supplier (CosEventComm::PushSupplier_ptr push_supplier ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected
+ ));
+
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+private:
+ /// Release
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_COSEC_PROXYPUSHCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushSupplier.cpp b/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushSupplier.cpp
new file mode 100644
index 00000000000..694b6c378b5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushSupplier.cpp
@@ -0,0 +1,65 @@
+// $Id$
+
+#include "orbsvcs/Notify/Any/CosEC_ProxyPushSupplier.h"
+
+ACE_RCSID (Notify, TAO_Notify_CosEC_ProxyPushSupplier, "$Id$")
+
+#include "tao/debug.h"
+#include "orbsvcs/Notify/Any/PushConsumer.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_CosEC_ProxyPushSupplier::TAO_Notify_CosEC_ProxyPushSupplier (void)
+{
+}
+
+TAO_Notify_CosEC_ProxyPushSupplier::~TAO_Notify_CosEC_ProxyPushSupplier ()
+{
+}
+
+void
+TAO_Notify_CosEC_ProxyPushSupplier::release (void)
+{
+
+ delete this;
+ //@@ inform factory
+}
+
+void
+TAO_Notify_CosEC_ProxyPushSupplier::connect_push_consumer (CosEventComm::PushConsumer_ptr push_consumer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError
+ ))
+{
+ // Convert Consumer to Base Type
+ TAO_Notify_PushConsumer* consumer;
+ ACE_NEW_THROW_EX (consumer,
+ TAO_Notify_PushConsumer (this),
+ CORBA::NO_MEMORY ());
+
+ consumer->init (push_consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->connect (consumer ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_CosEC_ProxyPushSupplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_CosEC_ProxyPushSupplier::Ptr guard( this );
+ this->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+const char *
+TAO_Notify_CosEC_ProxyPushSupplier::get_proxy_type_name (void) const
+{
+ return "ec_proxy_push_supplier";
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushSupplier.h b/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushSupplier.h
new file mode 100644
index 00000000000..0858c51475e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushSupplier.h
@@ -0,0 +1,89 @@
+/* -*- C++ -*- */
+/**
+ * @file CosEC_ProxyPushSupplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_COSEC_PROXYPUSHSUPPLIER_H
+#define TAO_Notify_COSEC_PROXYPUSHSUPPLIER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosEventChannelAdminS.h"
+
+#include "orbsvcs/Notify/ProxySupplier_T.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+#if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT
+template class TAO_Notify_Serv_Export
+TAO_Notify_ProxySupplier_T<POA_CosEventChannelAdmin::ProxyPushSupplier>;
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */
+
+/**
+ * @class TAO_Notify_CosEC_ProxyPushSupplier
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_CosEC_ProxyPushSupplier
+ : public virtual TAO_Notify_ProxySupplier_T <POA_CosEventChannelAdmin::ProxyPushSupplier>
+{
+ friend class TAO_Notify_Builder;
+public:
+ /// Constuctor
+ TAO_Notify_CosEC_ProxyPushSupplier (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_CosEC_ProxyPushSupplier ();
+
+ virtual const char * get_proxy_type_name (void) const;
+
+ // = Interface methods
+ virtual void connect_push_consumer (
+ CosEventComm::PushConsumer_ptr push_consumer
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError
+ ));
+
+ virtual void disconnect_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+private:
+ /// Release
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_COSEC_PROXYPUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushConsumer.cpp
new file mode 100644
index 00000000000..2ae0cda9608
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushConsumer.cpp
@@ -0,0 +1,134 @@
+// $Id$
+
+#include "orbsvcs/Notify/Any/ProxyPushConsumer.h"
+
+ACE_RCSID (Notify, TAO_Notify_ProxyPushConsumer, "$Id$")
+
+#include "tao/debug.h"
+#include "orbsvcs/Notify/AdminProperties.h"
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/Any/AnyEvent.h"
+#include "orbsvcs/Notify/Any/PushSupplier.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_ProxyPushConsumer::TAO_Notify_ProxyPushConsumer (void)
+{
+}
+
+TAO_Notify_ProxyPushConsumer::~TAO_Notify_ProxyPushConsumer ()
+{
+}
+
+void
+TAO_Notify_ProxyPushConsumer::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+CosNotifyChannelAdmin::ProxyType
+TAO_Notify_ProxyPushConsumer::MyType (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return CosNotifyChannelAdmin::PUSH_ANY;
+}
+
+void
+TAO_Notify_ProxyPushConsumer::push (const CORBA::Any& any ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventComm::Disconnected
+ ))
+{
+ // Check if we should proceed at all.
+ if (this->admin_properties().reject_new_events () == 1
+ && this->admin_properties().queue_full ())
+ ACE_THROW (CORBA::IMP_LIMIT ());
+
+ if (this->is_connected () == 0)
+ {
+ ACE_THROW (CosEventComm::Disconnected ());
+ }
+
+ TAO_Notify_AnyEvent_No_Copy event (any);
+ this->push_i (&event ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_ProxyPushConsumer::connect_any_push_supplier (CosEventComm::PushSupplier_ptr push_supplier ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventChannelAdmin::AlreadyConnected
+ ))
+{
+ // Convert Supplier to Base Type
+ TAO_Notify_PushSupplier *supplier;
+ ACE_NEW_THROW_EX (supplier,
+ TAO_Notify_PushSupplier (this),
+ CORBA::NO_MEMORY ());
+
+ supplier->init (push_supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->connect (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void TAO_Notify_ProxyPushConsumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_ProxyPushConsumer::Ptr guard( this );
+ this->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+const char *
+TAO_Notify_ProxyPushConsumer::get_proxy_type_name (void) const
+{
+ return "proxy_push_consumer";
+}
+
+void
+TAO_Notify_ProxyPushConsumer::load_attrs (const TAO_Notify::NVPList& attrs)
+{
+ SuperClass::load_attrs(attrs);
+ ACE_CString ior;
+ if (attrs.load("PeerIOR", ior))
+ {
+ CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ ACE_TRY_CHECK;
+ CosNotifyComm::PushSupplier_var ps = CosNotifyComm::PushSupplier::_nil();
+ if ( ior.length() > 0 )
+ {
+ CORBA::Object_var obj =
+ orb->string_to_object(ior.c_str() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ps = CosNotifyComm::PushSupplier::_unchecked_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ // minor hack: suppress generating subscription updates during reload.
+ bool save_updates = this->updates_off_;
+ this->updates_off_ = true;
+ this->connect_any_push_supplier(ps.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->updates_off_ = save_updates;
+ }
+ ACE_CATCHALL
+ {
+ ACE_ASSERT(0);
+ }
+ ACE_ENDTRY;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushConsumer.h
new file mode 100644
index 00000000000..5d7bb8b4b8e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushConsumer.h
@@ -0,0 +1,96 @@
+/* -*- C++ -*- */
+/**
+ * @file ProxyPushConsumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_PROXYPUSHCONSUMER_H
+#define TAO_Notify_PROXYPUSHCONSUMER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/Notify/ProxyConsumer_T.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_ProxyPushConsumer
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_ProxyPushConsumer
+ : public virtual TAO_Notify_ProxyConsumer_T <
+ POA_CosNotifyChannelAdmin::ProxyPushConsumer
+ >
+{
+ typedef TAO_Notify_ProxyConsumer_T <POA_CosNotifyChannelAdmin::ProxyPushConsumer> SuperClass;
+ friend class TAO_Notify_Builder;
+public:
+ /// Constuctor
+ TAO_Notify_ProxyPushConsumer (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_ProxyPushConsumer ();
+
+
+// virtual void save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL);
+ virtual const char * get_proxy_type_name (void) const;
+
+ virtual void load_attrs (const TAO_Notify::NVPList& attrs);
+
+protected:
+ ///= CosNotifyChannelAdmin::ProxyPushConsumer methods
+
+ virtual CosNotifyChannelAdmin::ProxyType MyType (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void push (const CORBA::Any & data ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+
+ virtual void connect_any_push_supplier (CosEventComm::PushSupplier_ptr push_supplier ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected
+ ));
+
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+private:
+ /// Release
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_PROXYPUSHCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushSupplier.cpp b/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushSupplier.cpp
new file mode 100644
index 00000000000..d478b3253cc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushSupplier.cpp
@@ -0,0 +1,110 @@
+// $Id$
+
+#include "orbsvcs/Notify/Any/ProxyPushSupplier.h"
+
+ACE_RCSID (Notify, TAO_Notify_ProxyPushSupplier, "$Id$")
+
+#include "tao/debug.h"
+#include "orbsvcs/Notify/Any/PushConsumer.h"
+#include "orbsvcs/Notify/Properties.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_ProxyPushSupplier::TAO_Notify_ProxyPushSupplier (void)
+{
+}
+
+TAO_Notify_ProxyPushSupplier::~TAO_Notify_ProxyPushSupplier ()
+{
+}
+
+void
+TAO_Notify_ProxyPushSupplier::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+void
+TAO_Notify_ProxyPushSupplier::connect_any_push_consumer (CosEventComm::PushConsumer_ptr push_consumer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError
+ ))
+{
+ // Convert Consumer to Base Type
+ TAO_Notify_PushConsumer* consumer;
+ ACE_NEW_THROW_EX (consumer,
+ TAO_Notify_PushConsumer (this),
+ CORBA::NO_MEMORY ());
+
+ consumer->init (push_consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->connect (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_ProxyPushSupplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_ProxyPushSupplier::Ptr guard( this );
+ this->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::ProxyType
+TAO_Notify_ProxyPushSupplier::MyType (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return CosNotifyChannelAdmin::PUSH_ANY;
+}
+
+const char *
+TAO_Notify_ProxyPushSupplier::get_proxy_type_name (void) const
+{
+ return "proxy_push_supplier";
+}
+
+void
+TAO_Notify_ProxyPushSupplier::load_attrs (const TAO_Notify::NVPList& attrs)
+{
+ SuperClass::load_attrs(attrs);
+ ACE_CString ior;
+ if (attrs.load("PeerIOR", ior))
+ {
+ CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosNotifyComm::PushConsumer_var pc =
+ CosNotifyComm::PushConsumer::_nil();
+ if (ior.length() > 0)
+ {
+ CORBA::Object_var obj =
+ orb->string_to_object(ior.c_str() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ pc = CosNotifyComm::PushConsumer::_unchecked_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ this->connect_any_push_consumer(pc.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // if we can't reconnect, tough...
+ }
+ ACE_ENDTRY;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushSupplier.h b/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushSupplier.h
new file mode 100644
index 00000000000..e9450202c1c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushSupplier.h
@@ -0,0 +1,98 @@
+/* -*- C++ -*- */
+/**
+ * @file ProxyPushSupplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_PROXYPUSHSUPPLIER_H
+#define TAO_Notify_PROXYPUSHSUPPLIER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/Event_ForwarderS.h"
+
+#include "orbsvcs/Notify/ProxySupplier_T.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+#if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT
+template class TAO_Notify_Serv_Export
+TAO_Notify_ProxySupplier_T<POA_Event_Forwarder::ProxyPushSupplier>;
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */
+
+/**
+ * @class TAO_Notify_ProxyPushSupplier
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_ProxyPushSupplier
+ : public virtual TAO_Notify_ProxySupplier_T <POA_Event_Forwarder::ProxyPushSupplier>
+{
+ typedef TAO_Notify_ProxySupplier_T <POA_Event_Forwarder::ProxyPushSupplier> SuperClass;
+ friend class TAO_Notify_Builder;
+public:
+ /// Constuctor
+ TAO_Notify_ProxyPushSupplier (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_ProxyPushSupplier ();
+
+ virtual const char * get_proxy_type_name (void) const;
+
+ virtual void load_attrs (const TAO_Notify::NVPList& attrs);
+
+ // = Interface methods
+ virtual CosNotifyChannelAdmin::ProxyType MyType (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void connect_any_push_consumer (
+ CosEventComm::PushConsumer_ptr push_consumer
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError
+ ));
+
+ virtual void disconnect_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+private:
+ /// TAO_Notify_Destroy_Callback methods
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_PROXYPUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.cpp
new file mode 100644
index 00000000000..8048c1dcaa5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.cpp
@@ -0,0 +1,118 @@
+// $Id$
+
+#include "orbsvcs/Notify/Any/PushConsumer.h"
+
+ACE_RCSID (Notify,
+ TAO_Notify_PushConsumer,
+ "$Id$")
+
+#include "ace/Bound_Ptr.h"
+#include "orbsvcs/CosEventCommC.h"
+#include "orbsvcs/Notify/Event.h"
+#include "orbsvcs/Notify/Properties.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_PushConsumer::TAO_Notify_PushConsumer (TAO_Notify_ProxySupplier* proxy)
+ :TAO_Notify_Consumer (proxy)
+{
+}
+
+TAO_Notify_PushConsumer::~TAO_Notify_PushConsumer ()
+{
+}
+
+void
+TAO_Notify_PushConsumer::init (CosEventComm::PushConsumer_ptr push_consumer
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize only once
+ ACE_ASSERT( CORBA::is_nil (this->push_consumer_.in()) );
+
+ // push_consumer not optional
+ if (CORBA::is_nil (push_consumer))
+ {
+ ACE_THROW (CORBA::BAD_PARAM());
+ }
+
+ this->push_consumer_ = CosEventComm::PushConsumer::_duplicate (push_consumer);
+
+ ACE_TRY
+ {
+ this->publish_ =
+ CosNotifyComm::NotifyPublish::_narrow (push_consumer
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // _narrow failed which probably means the interface is CosEventComm type.
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_Notify_PushConsumer::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+void
+TAO_Notify_PushConsumer::push (const CORBA::Any& payload ACE_ENV_ARG_DECL)
+{
+ this->push_consumer_->push (payload ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_PushConsumer::push (const CosNotification::StructuredEvent& event ACE_ENV_ARG_DECL)
+{
+ CORBA::Any any;
+
+ TAO_Notify_Event::translate (event, any);
+
+ this->push_consumer_->push (any ACE_ENV_ARG_PARAMETER);
+}
+
+/// Push a batch of events to this consumer.
+void
+TAO_Notify_PushConsumer::push (const CosNotification::EventBatch& event ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_ASSERT(false);
+ ACE_UNUSED_ARG (event);
+ // TODO exception?
+}
+
+ACE_CString
+TAO_Notify_PushConsumer::get_ior (void) const
+{
+ ACE_CString result;
+ CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::String_var ior = orb->object_to_string(this->push_consumer_.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ result = static_cast<const char*> (ior.in ());
+ }
+ ACE_CATCHANY
+ {
+ result.fast_clear();
+ }
+ ACE_ENDTRY;
+ return result;
+}
+
+void
+TAO_Notify_PushConsumer::reconnect_from_consumer (TAO_Notify_Consumer* old_consumer
+ ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_PushConsumer* tmp =
+ dynamic_cast<TAO_Notify_PushConsumer*> (old_consumer);
+ ACE_ASSERT(tmp != 0);
+ this->init(tmp->push_consumer_.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->schedule_timer(false);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.h
new file mode 100644
index 00000000000..b6d8a5827e2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.h
@@ -0,0 +1,78 @@
+/* -*- C++ -*- */
+/**
+ * @file PushConsumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_PUSHCONSUMER_H
+#define TAO_Notify_PUSHCONSUMER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/Notify/Consumer.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_PushConsumer
+ *
+ * @brief Wrapper for the PushConsumer that connect to the EventChannel.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_PushConsumer : public TAO_Notify_Consumer
+{
+public:
+ /// Constuctor
+ TAO_Notify_PushConsumer (TAO_Notify_ProxySupplier* proxy);
+
+ /// Destructor
+ virtual ~TAO_Notify_PushConsumer ();
+
+ /// Init
+ void init (CosEventComm::PushConsumer_ptr push_consumer ACE_ENV_ARG_DECL);
+
+ /// Push <event> to this consumer.
+// virtual void push_i (const TAO_Notify_Event* event ACE_ENV_ARG_DECL);
+
+ /// Push <event> to this consumer.
+ virtual void push (const CORBA::Any& event ACE_ENV_ARG_DECL);
+
+ /// Push <event> to this consumer.
+ virtual void push (const CosNotification::StructuredEvent& event ACE_ENV_ARG_DECL);
+
+ /// Push a batch of events to this consumer.
+ virtual void push (const CosNotification::EventBatch& event ACE_ENV_ARG_DECL);
+
+ /// Retrieve the ior of this peer
+ virtual ACE_CString get_ior (void) const;
+
+ /// on reconnect we need to move events from the old consumer
+ /// to the new one
+ virtual void reconnect_from_consumer (
+ TAO_Notify_Consumer* old_consumer
+ ACE_ENV_ARG_DECL);
+
+protected:
+ /// The Consumer
+ CosEventComm::PushConsumer_var push_consumer_;
+
+private:
+ /// TAO_Notify_Destroy_Callback methods.
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_PUSHCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/PushSupplier.cpp b/TAO/orbsvcs/orbsvcs/Notify/Any/PushSupplier.cpp
new file mode 100644
index 00000000000..e60246795e2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/PushSupplier.cpp
@@ -0,0 +1,65 @@
+// $Id$
+
+#include "orbsvcs/Notify/Any/PushSupplier.h"
+
+ACE_RCSID (Notify, TAO_Notify_PushSupplier, "$Id$")
+#include "orbsvcs/Notify/Properties.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_PushSupplier::TAO_Notify_PushSupplier (TAO_Notify_ProxyConsumer* proxy)
+ :TAO_Notify_Supplier (proxy)
+{
+}
+
+TAO_Notify_PushSupplier::~TAO_Notify_PushSupplier ()
+{
+}
+
+void
+TAO_Notify_PushSupplier::init (CosEventComm::PushSupplier_ptr push_supplier ACE_ENV_ARG_DECL)
+{
+ // TODO: verify single init call
+ // push_supplier is optional
+ this->push_supplier_ = CosEventComm::PushSupplier::_duplicate (push_supplier);
+
+ ACE_TRY
+ {
+ this->subscribe_ = CosNotifyComm::NotifySubscribe::_narrow (push_supplier ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // _narrow failed which probably means the interface is CosEventComm type.
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_Notify_PushSupplier::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+ACE_CString
+TAO_Notify_PushSupplier::get_ior (void) const
+{
+ ACE_CString result;
+ CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::String_var ior = orb->object_to_string(this->push_supplier_.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ result = static_cast<const char*> (ior.in ());
+ }
+ ACE_CATCHANY
+ {
+ result.fast_clear();
+ }
+ ACE_ENDTRY;
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/PushSupplier.h b/TAO/orbsvcs/orbsvcs/Notify/Any/PushSupplier.h
new file mode 100644
index 00000000000..47b7c94d0a7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/PushSupplier.h
@@ -0,0 +1,63 @@
+/* -*- C++ -*- */
+/**
+ * @file PushSupplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_PUSHSUPPLIER_H
+#define TAO_Notify_PUSHSUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/Notify/Supplier.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_ProxyConsumer;
+
+/**
+ * @class TAO_Notify_StructuredPushSupplier
+ *
+ * @brief Wrapper for the PushSupplier that connect to the EventChannel.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_PushSupplier : public TAO_Notify_Supplier
+{
+public:
+ /// Constuctor
+ TAO_Notify_PushSupplier (TAO_Notify_ProxyConsumer* proxy);
+
+ /// Destructor
+ virtual ~TAO_Notify_PushSupplier ();
+
+ /// Init
+ void init (CosEventComm::PushSupplier_ptr push_supplier ACE_ENV_ARG_DECL);
+
+ /// Retrieve the ior of this peer
+ virtual ACE_CString get_ior (void) const;
+
+protected:
+ /// The Supplier
+ CosEventComm::PushSupplier_var push_supplier_;
+
+private:
+ /// TAO_Notify_Destroy_Callback methods
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_PUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Bit_Vector.cpp b/TAO/orbsvcs/orbsvcs/Notify/Bit_Vector.cpp
new file mode 100644
index 00000000000..fd77791b525
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Bit_Vector.cpp
@@ -0,0 +1,114 @@
+// $Id$
+
+#include "orbsvcs/Notify/Bit_Vector.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+
+Bit_Vector::Bit_Vector()
+ : size_(0)
+ , first_set_bit_(0)
+ , first_cleared_bit_(0)
+{
+}
+
+Bit_Vector::~Bit_Vector()
+{
+}
+
+bool
+Bit_Vector::is_set(const size_t location) const
+{
+ bool result = false;
+ if (location < this->size_)
+ {
+ result = (0 != (this->bitvec_[location >> BPW_LOG_2] & (1 << (location % BITS_PER_WORD))));
+ }
+ return result;
+}
+
+void
+Bit_Vector::set_bit(const size_t location, bool set)
+{
+ if (location >= this->size_)
+ {
+ if ((location >> BPW_LOG_2) >= (this->size_ >> BPW_LOG_2))
+ {
+ size_t need = (location >> BPW_LOG_2) - (this->size_ >> BPW_LOG_2);
+ this->bitvec_.resize(this->bitvec_.size() + need + 1, 0);
+ }
+ this->size_ = location + 1;
+ }
+ if (set)
+ {
+ this->bitvec_[location >> BPW_LOG_2] |= (1 << (location % BITS_PER_WORD));
+ }
+ else
+ {
+ this->bitvec_[location >> BPW_LOG_2] &= ~(1 << (location % BITS_PER_WORD));
+ }
+ this->evaluate_firsts(location, set);
+}
+
+size_t
+Bit_Vector::find_first_bit(bool set) const
+{
+ size_t result = 0;
+ if (set)
+ {
+ result = this->first_set_bit_;
+ }
+ else
+ {
+ result = this->first_cleared_bit_;
+ }
+ return result;
+}
+
+void
+Bit_Vector::evaluate_firsts(const size_t location, bool set)
+{
+ if (set)
+ {
+ if (this->first_cleared_bit_ == location)
+ {
+ this->first_cleared_bit_ = this->find_first_bit_of(location, false);
+ }
+ if (this->first_set_bit_ > location)
+ {
+ this->first_set_bit_ = location;
+ }
+ }
+ else if (!set)
+ {
+ if (this->first_set_bit_ == location)
+ {
+ this->first_set_bit_ = this->find_first_bit_of(location, true);
+ }
+ if (this->first_cleared_bit_ > location)
+ {
+ this->first_cleared_bit_ = location;
+ }
+ }
+}
+
+size_t
+Bit_Vector::find_first_bit_of(const size_t location, bool set)
+{
+ size_t newloc = 0;
+ size_t idx = 0;
+ for (idx = location; (newloc == 0) && (idx < this->size_ + 1); idx++)
+ {
+ if (is_set(idx) == set)
+ {
+ newloc = idx;
+ }
+ }
+ return newloc;
+}
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Bit_Vector.h b/TAO/orbsvcs/orbsvcs/Notify/Bit_Vector.h
new file mode 100644
index 00000000000..46f668814bf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Bit_Vector.h
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Bit_Vector.h
+ *
+ * $Id$
+ *
+ * This is a basic bit vector class.
+ *
+ * @author Jonathan Pollack <pollack_j@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef BIT_VECTOR_H
+#define BIT_VECTOR_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+#include "ace/Vector_T.h"
+#include "ace/Basic_Types.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+
+/// \brief Simple bit vector.
+///
+/// Written to support block allocation from persistent storage.
+/// Should be promoted to the ACE level to make it generally usable.
+class TAO_Notify_Serv_Export Bit_Vector
+{
+ typedef ACE_UINT32 BASIC_UINT_TYPE;
+ typedef ACE_Vector<BASIC_UINT_TYPE> VECTOR_TYPE;
+ enum {
+ BITS_PER_WORD = 32,
+ BPW_LOG_2 = 5
+ };
+public:
+
+ /// The constructor.
+ Bit_Vector();
+ /// The destructor.
+ ~Bit_Vector();
+
+ /// \brief Determine if a bit at location is set.
+ bool is_set(const size_t location) const;
+ /// \brief Set or unset a bit at location, growing the vector as needed.
+ void set_bit(const size_t location, bool set);
+
+ /// \brief Find the first bit that is either set or unset in an O(1).
+ size_t find_first_bit(bool set) const;
+
+private:
+ /// Update our first set and unset bits.
+ void evaluate_firsts(const size_t location, bool set);
+ /// Iterate from location to the end, finding the first bit that
+ /// matches the requested set or unset value.
+ size_t find_first_bit_of(const size_t location, bool set);
+
+private:
+ VECTOR_TYPE bitvec_;
+ size_t size_;
+ size_t first_set_bit_;
+ size_t first_cleared_bit_;
+};
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* BIT_VECTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.cpp b/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.cpp
new file mode 100644
index 00000000000..08b6a810187
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.cpp
@@ -0,0 +1,266 @@
+// $Id$
+
+#include "orbsvcs/Notify/Buffering_Strategy.h"
+
+ACE_RCSID (Notify, Buffering_Strategy, "$Id$")
+
+
+#include "orbsvcs/Notify/Method_Request.h"
+#include "orbsvcs/Notify/Notify_Extensions.h"
+#include "orbsvcs/Notify/QoSProperties.h"
+#include "orbsvcs/Notify/Notify_Extensions.h"
+
+#include "orbsvcs/CosNotificationC.h"
+#include "orbsvcs/Time_Utilities.h"
+
+#include "tao/debug.h"
+
+#include "ace/Message_Queue.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Buffering_Strategy::TAO_Notify_Buffering_Strategy (
+ TAO_Notify_Message_Queue& msg_queue,
+ const TAO_Notify_AdminProperties::Ptr& admin_properties)
+: msg_queue_ (msg_queue)
+, admin_properties_ (admin_properties)
+, global_queue_lock_ (admin_properties->global_queue_lock ())
+, global_queue_length_ (admin_properties->global_queue_length ())
+, max_queue_length_ (admin_properties->max_global_queue_length ())
+, order_policy_ (CosNotification::OrderPolicy, CosNotification::AnyOrder)
+, discard_policy_ (CosNotification::DiscardPolicy, CosNotification::AnyOrder)
+, max_events_per_consumer_ (CosNotification::MaxEventsPerConsumer)
+, blocking_policy_ (TAO_Notify_Extensions::BlockingPolicy)
+, global_not_full_ (admin_properties->global_queue_not_full())
+, local_not_full_ (global_queue_lock_)
+, local_not_empty_ (global_queue_lock_)
+, shutdown_ (false)
+{
+}
+
+TAO_Notify_Buffering_Strategy::~TAO_Notify_Buffering_Strategy ()
+{
+}
+
+void
+TAO_Notify_Buffering_Strategy::update_qos_properties
+ (const TAO_Notify_QoSProperties& qos_properties)
+{
+ this->order_policy_.set (qos_properties);
+ this->discard_policy_.set (qos_properties);
+ this->max_events_per_consumer_.set(qos_properties);
+ this->blocking_policy_.set (qos_properties);
+}
+
+void
+TAO_Notify_Buffering_Strategy::shutdown (void)
+{
+ ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->global_queue_lock_);
+
+ if (this->shutdown_)
+ {
+ return;
+ }
+
+ this->shutdown_ = true;
+
+ this->local_not_empty_.broadcast ();
+ this->global_not_full_.broadcast();
+ this->local_not_full_.broadcast();
+}
+
+int
+TAO_Notify_Buffering_Strategy::enqueue (TAO_Notify_Method_Request_Queueable* method_request)
+{
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->global_queue_lock_, -1);
+
+ if (this->shutdown_)
+ return -1;
+
+ bool discarded_existing = false;
+
+ bool local_overflow = this->max_events_per_consumer_.is_valid() &&
+ static_cast <CORBA::Long> (this->msg_queue_.message_count ()) >= this->max_events_per_consumer_.value();
+
+ bool global_overflow = this->max_queue_length_.value () != 0 &&
+ this->global_queue_length_ >= this->max_queue_length_.value ();
+
+ while (local_overflow || global_overflow)
+ {
+ if (blocking_policy_.is_valid())
+ {
+ ACE_Time_Value timeout;
+ ORBSVCS_Time::TimeT_to_Time_Value(timeout, blocking_policy_.value());
+ // Condition variables take an absolute time
+ timeout += ACE_OS::gettimeofday();
+ if (local_overflow)
+ {
+ local_not_full_.wait(&timeout);
+ }
+ else
+ {
+ global_not_full_.wait(&timeout);
+ }
+ if (errno != ETIME)
+ {
+ local_overflow =
+ this->max_events_per_consumer_.is_valid() &&
+ static_cast <CORBA::Long> (this->msg_queue_.message_count ()) >= this->max_events_per_consumer_.value();
+ global_overflow =
+ this->max_queue_length_.value () != 0 &&
+ this->global_queue_length_ >= this->max_queue_length_.value ();
+ continue;
+ }
+ }
+
+ discarded_existing = this->discard(method_request);
+ if (discarded_existing)
+ {
+ --this->global_queue_length_;
+ local_not_full_.signal();
+ global_not_full_.signal();
+ }
+ break;
+ }
+
+ if (! (local_overflow || global_overflow) || discarded_existing)
+ {
+ if (this->queue (method_request) == -1)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "Notify (%P|%t) - Panic! failed to enqueue event\n"));
+ return -1;
+ }
+
+ ++this->global_queue_length_;
+
+ local_not_empty_.signal ();
+ }
+ return this->msg_queue_.message_count ();
+}
+
+int
+TAO_Notify_Buffering_Strategy::dequeue (TAO_Notify_Method_Request_Queueable* &method_request, const ACE_Time_Value *abstime)
+{
+ ACE_Message_Block *mb;
+
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->global_queue_lock_, -1);
+
+ if ( this->shutdown_ )
+ return -1;
+
+ while (this->msg_queue_.message_count () == 0)
+ {
+ this->local_not_empty_.wait (abstime);
+
+ if (this->shutdown_)
+ return -1;
+
+ if (errno == ETIME)
+ return 0;
+ }
+
+ if (this->msg_queue_.dequeue (mb) == -1)
+ return -1;
+
+ method_request = dynamic_cast<TAO_Notify_Method_Request_Queueable*>(mb);
+
+ if (method_request == 0)
+ return -1;
+
+ --this->global_queue_length_;
+ local_not_full_.signal();
+ global_not_full_.signal();
+
+ return 1;
+}
+
+int
+TAO_Notify_Buffering_Strategy::queue (TAO_Notify_Method_Request_Queueable* method_request)
+{
+ if ( this->shutdown_ )
+ return -1;
+
+ CORBA::Short order = this->order_policy_.value();
+
+ if (! this->order_policy_.is_valid() ||
+ order == CosNotification::AnyOrder ||
+ order == CosNotification::FifoOrder)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Notify (%P|%t) - enqueue in fifo order\n"));
+ return this->msg_queue_.enqueue_tail (method_request);
+ }
+
+ if (order == CosNotification::PriorityOrder)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Notify (%P|%t) - enqueue in priority order\n"));
+ return this->msg_queue_.enqueue_prio (method_request);
+ }
+
+ if (order == CosNotification::DeadlineOrder)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Notify (%P|%t) - enqueue in deadline order\n"));
+ return this->msg_queue_.enqueue_deadline (method_request);
+ }
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Notify (%P|%t) - Invalid order policy\n"));
+ return this->msg_queue_.enqueue_tail (method_request);
+}
+
+bool
+TAO_Notify_Buffering_Strategy::discard (TAO_Notify_Method_Request_Queueable* method_request)
+{
+ if (this->shutdown_)
+ {
+ return false;
+ }
+
+ ACE_Message_Block* mb = 0;
+ int result = -1;
+
+ if (this->discard_policy_.is_valid() == 0 ||
+ this->discard_policy_ == CosNotification::AnyOrder ||
+ this->discard_policy_ == CosNotification::FifoOrder)
+ {
+ result = this->msg_queue_.dequeue_head (mb);
+ }
+ else if (this->discard_policy_ == CosNotification::LifoOrder)
+ {
+ // The most current message is NOT the newest one in the queue. It's
+ // the one we're about to add to the queue.
+ result = -1;
+ }
+ else if (this->discard_policy_ == CosNotification::DeadlineOrder)
+ {
+ result = this->msg_queue_.dequeue_deadline (mb);
+ }
+ else if (this->discard_policy_ == CosNotification::PriorityOrder)
+ {
+ result = this->msg_queue_.dequeue_prio (mb);
+ if (mb->msg_priority() >= method_request->msg_priority())
+ {
+ this->msg_queue_.enqueue_prio (mb);
+ result = -1;
+ }
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Notify (%P|%t) - Invalid discard policy\n"));
+ result = this->msg_queue_.dequeue_head (mb);
+ }
+
+ if (result != -1)
+ {
+ ACE_Message_Block::release (mb);
+ return true;
+ }
+
+ return false;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.h b/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.h
new file mode 100644
index 00000000000..7baa636a2d9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.h
@@ -0,0 +1,121 @@
+/* -*- C++ -*- */
+/**
+ * @file Buffering_Strategy.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_BUFFERING_STRATEGY_H
+#define TAO_Notify_BUFFERING_STRATEGY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Null_Condition.h"
+#include "ace/Message_Queue.h"
+
+#include "orbsvcs/TimeBaseC.h"
+
+#include "orbsvcs/Notify/Property.h"
+#include "orbsvcs/Notify/Property_T.h"
+#include "orbsvcs/Notify/AdminProperties.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Method_Request_Queueable;
+class TAO_Notify_QoSProperties;
+
+typedef ACE_Message_Queue<ACE_NULL_SYNCH> TAO_Notify_Message_Queue;
+
+/**
+ * @class TAO_Notify_Buffering_Strategy
+ *
+ * @brief Base Strategy to enqueue and dequeue items from a Message Queue.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Buffering_Strategy
+{
+public:
+ TAO_Notify_Buffering_Strategy (
+ TAO_Notify_Message_Queue& msg_queue,
+ const TAO_Notify_AdminProperties::Ptr& admin_properties);
+
+ ~TAO_Notify_Buffering_Strategy ();
+
+ /// Update state with the following QoS Properties:
+ /// Order Policy
+ /// Discard Policy
+ /// MaxEventsPerConsumer
+ void update_qos_properties (const TAO_Notify_QoSProperties& qos_properties);
+
+ /// Enqueue according the enqueing strategy.
+ /// Return -1 on error else the number of items in the queue.
+ int enqueue (TAO_Notify_Method_Request_Queueable* method_request);
+
+ /// Dequeue batch. This method will block for @a abstime if non-zero or else blocks till an item is available.
+ /// Return -1 on error or if nothing is available, else the number of items actually dequeued (1).
+ int dequeue (TAO_Notify_Method_Request_Queueable* &method_request,
+ const ACE_Time_Value *abstime);
+
+ /// Shutdown
+ void shutdown (void);
+
+private:
+
+ /// Apply the Order Policy and queue. return -1 on error.
+ int queue (TAO_Notify_Method_Request_Queueable* method_request);
+
+ /// Discard as per the Discard Policy.
+ bool discard (TAO_Notify_Method_Request_Queueable* method_request);
+
+ ///= Data Members
+
+ /// The local Message Queue
+ TAO_Notify_Message_Queue& msg_queue_;
+
+ /// Reference to the properties per event channel.
+ TAO_Notify_AdminProperties::Ptr admin_properties_;
+
+ /// The shared global lock used by all the queues.
+ ACE_SYNCH_MUTEX& global_queue_lock_;
+
+ /// The global queue length - queue length accross all the queues.
+ CORBA::Long& global_queue_length_;
+
+ /// The maximum events that can be queued overall.
+ const TAO_Notify_Property_Long& max_queue_length_;
+
+ /// Order of events in internal buffers.
+ TAO_Notify_Property_Short order_policy_;
+
+ /// Policy to discard when buffers are full.
+ TAO_Notify_Property_Short discard_policy_;
+
+ TAO_Notify_Property_Long max_events_per_consumer_;
+ TAO_Notify_Property_Time blocking_policy_;
+
+
+ TAO_SYNCH_CONDITION& global_not_full_;
+ TAO_SYNCH_CONDITION local_not_full_;
+
+ /// Condition that batch size reached.
+ TAO_SYNCH_CONDITION local_not_empty_;
+
+ /// Flag to shutdown.
+ bool shutdown_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_BUFFERING_STRATEGY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Builder.cpp b/TAO/orbsvcs/orbsvcs/Notify/Builder.cpp
new file mode 100644
index 00000000000..bab9d61ecf0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Builder.cpp
@@ -0,0 +1,592 @@
+// $Id$
+#include "orbsvcs/Notify/Builder.h"
+
+ACE_RCSID (Notify,
+ Builder,
+ "$Id$")
+
+#include "ace/Dynamic_Service.h"
+
+#include "tao/PortableServer/PortableServerC.h"
+
+#include "orbsvcs/Notify/Factory.h"
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/POA_Helper.h"
+#include "orbsvcs/Notify/ID_Factory.h"
+#include "orbsvcs/Notify/EventChannelFactory.h"
+#include "orbsvcs/Notify/EventChannel.h"
+#include "orbsvcs/Notify/SupplierAdmin.h"
+#include "orbsvcs/Notify/ConsumerAdmin.h"
+#include "orbsvcs/Notify/Worker_Task.h"
+#include "orbsvcs/Notify/Reactive_Task.h"
+#include "orbsvcs/Notify/ThreadPool_Task.h"
+#include "orbsvcs/Notify/FilterFactory.h"
+#include "orbsvcs/Notify/Object.h"
+#include "orbsvcs/Notify/EventType.h"
+#include "orbsvcs/Notify/Event.h"
+#include "orbsvcs/Notify/Any/AnyEvent.h"
+#include "orbsvcs/Notify/Any/ProxyPushConsumer.h"
+#include "orbsvcs/Notify/Any/ProxyPushSupplier.h"
+#include "orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.h"
+#include "orbsvcs/Notify/Any/CosEC_ProxyPushSupplier.h"
+#include "orbsvcs/Notify/Structured/StructuredProxyPushConsumer.h"
+#include "orbsvcs/Notify/Structured/StructuredProxyPushSupplier.h"
+#include "orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.h"
+#include "orbsvcs/Notify/Sequence/SequenceProxyPushSupplier.h"
+#include "orbsvcs/Notify/ETCL_FilterFactory.h"
+#include "orbsvcs/Notify/Container_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class PROXY_IMPL,
+ class PROXY,
+ class PROXY_PTR,
+ class PROXY_VAR,
+ class PARENT>
+class TAO_Notify_Proxy_Builder_T
+{
+public:
+ PROXY_PTR
+ build (PARENT *parent, CosNotifyChannelAdmin::ProxyID_out proxy_id
+ , const CosNotification::QoSProperties & initial_qos ACE_ENV_ARG_DECL)
+ {
+ PROXY_VAR proxy_ret;
+
+ TAO_Notify_Factory* factory = TAO_Notify_PROPERTIES::instance ()->factory ();
+
+ PROXY_IMPL* proxy = 0;
+ factory->create (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy_ret._retn ());
+
+ PortableServer::ServantBase_var servant (proxy);
+
+ proxy->init (parent ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy_ret._retn ());
+
+ proxy->set_qos (initial_qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy_ret._retn ());
+
+ CORBA::Object_var obj = proxy->activate (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy_ret._retn ());
+
+ proxy_id = proxy->id ();
+
+ proxy_ret = PROXY::_narrow (obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy_ret._retn ());
+
+ // insert proxy in admin container.
+ parent->insert (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PROXY::_nil ());
+
+ return proxy_ret._retn ();
+ }
+
+ PROXY_IMPL*
+ build (PARENT *parent, const CosNotifyChannelAdmin::ProxyID proxy_id
+ ACE_ENV_ARG_DECL)
+ {
+ TAO_Notify_Factory* factory = TAO_Notify_PROPERTIES::instance ()->factory ();
+
+ PROXY_IMPL* proxy = 0;
+ factory->create (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ PortableServer::ServantBase_var servant (proxy);
+
+ proxy->init (parent ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ proxy->activate (proxy, proxy_id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // insert proxy in admin container.
+ parent->insert (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return proxy;
+ }
+
+};
+
+// define the ProxyConsumer Builders.
+typedef TAO_Notify_Proxy_Builder_T<TAO_Notify_ProxyPushConsumer
+ , CosNotifyChannelAdmin::ProxyConsumer
+ , CosNotifyChannelAdmin::ProxyConsumer_ptr
+ , CosNotifyChannelAdmin::ProxyConsumer_var
+ , TAO_Notify_SupplierAdmin>
+TAO_Notify_ProxyPushConsumer_Builder;
+
+typedef TAO_Notify_Proxy_Builder_T<TAO_Notify_StructuredProxyPushConsumer
+ , CosNotifyChannelAdmin::ProxyConsumer
+ , CosNotifyChannelAdmin::ProxyConsumer_ptr
+ , CosNotifyChannelAdmin::ProxyConsumer_var
+ , TAO_Notify_SupplierAdmin>
+TAO_Notify_StructuredProxyPushConsumer_Builder;
+
+typedef TAO_Notify_Proxy_Builder_T<TAO_Notify_SequenceProxyPushConsumer
+ , CosNotifyChannelAdmin::ProxyConsumer
+ , CosNotifyChannelAdmin::ProxyConsumer_ptr
+ , CosNotifyChannelAdmin::ProxyConsumer_var
+ , TAO_Notify_SupplierAdmin>
+TAO_Notify_SequenceProxyPushConsumer_Builder;
+
+typedef TAO_Notify_Proxy_Builder_T<TAO_Notify_CosEC_ProxyPushConsumer
+ , CosEventChannelAdmin::ProxyPushConsumer
+ , CosEventChannelAdmin::ProxyPushConsumer_ptr
+ , CosEventChannelAdmin::ProxyPushConsumer_var
+ , TAO_Notify_SupplierAdmin>
+TAO_Notify_CosEC_ProxyPushConsumer_Builder;
+
+// define the ProxySupplier Builders.
+typedef TAO_Notify_Proxy_Builder_T<TAO_Notify_ProxyPushSupplier
+ , CosNotifyChannelAdmin::ProxySupplier
+ , CosNotifyChannelAdmin::ProxySupplier_ptr
+ , CosNotifyChannelAdmin::ProxySupplier_var
+ , TAO_Notify_ConsumerAdmin>
+TAO_Notify_ProxyPushSupplier_Builder;
+
+typedef TAO_Notify_Proxy_Builder_T<TAO_Notify_StructuredProxyPushSupplier
+ , CosNotifyChannelAdmin::ProxySupplier
+ , CosNotifyChannelAdmin::ProxySupplier_ptr
+ , CosNotifyChannelAdmin::ProxySupplier_var
+ , TAO_Notify_ConsumerAdmin>
+TAO_Notify_StructuredProxyPushSupplier_Builder;
+
+typedef TAO_Notify_Proxy_Builder_T<TAO_Notify_SequenceProxyPushSupplier
+ , CosNotifyChannelAdmin::ProxySupplier
+ , CosNotifyChannelAdmin::ProxySupplier_ptr
+ , CosNotifyChannelAdmin::ProxySupplier_var
+ , TAO_Notify_ConsumerAdmin>
+TAO_Notify_SequenceProxyPushSupplier_Builder;
+
+typedef TAO_Notify_Proxy_Builder_T<TAO_Notify_CosEC_ProxyPushSupplier
+ , CosEventChannelAdmin::ProxyPushSupplier
+ , CosEventChannelAdmin::ProxyPushSupplier_ptr
+ , CosEventChannelAdmin::ProxyPushSupplier_var
+ , TAO_Notify_ConsumerAdmin>
+TAO_Notify_CosEC_ProxyPushSupplier_Builder;
+
+TAO_Notify_Builder::TAO_Notify_Builder (void)
+{
+ // Init the static members.
+ TAO_Notify_AnyEvent::event_type_ = TAO_Notify_EventType::special ();
+}
+
+TAO_Notify_Builder::~TAO_Notify_Builder ()
+{
+}
+
+CosNotifyFilter::FilterFactory_ptr
+TAO_Notify_Builder::build_filter_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_FilterFactory* ff = ACE_Dynamic_Service<TAO_Notify_FilterFactory>::instance ("TAO_Notify_FilterFactory");
+
+ if (ff == 0)
+ {
+ ACE_NEW_THROW_EX (ff,
+ TAO_Notify_ETCL_FilterFactory (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosNotifyFilter::FilterFactory::_nil ());
+ }
+
+ PortableServer::POA_var default_poa = TAO_Notify_PROPERTIES::instance ()->default_poa ();
+
+ return ff->create (default_poa ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::EventChannelFactory_ptr
+TAO_Notify_Builder::build_event_channel_factory (PortableServer::POA_ptr poa ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::EventChannelFactory_var ecf_ret;
+
+ TAO_Notify_Factory* factory = TAO_Notify_PROPERTIES::instance ()->factory ();
+
+ // Create ECF
+ TAO_Notify_EventChannelFactory* ecf = 0;
+ factory->create (ecf ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ecf_ret._retn ());
+
+ ecf->init (poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ecf_ret._retn ());
+ ecf_ret = ecf->activate_self (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ecf_ret._retn ());
+
+ return (ecf_ret._retn ());
+}
+
+CosNotifyChannelAdmin::EventChannel_ptr
+TAO_Notify_Builder::build_event_channel (
+ TAO_Notify_EventChannelFactory* ecf,
+ const CosNotification::QoSProperties & initial_qos,
+ const CosNotification::AdminProperties & initial_admin,
+ CosNotifyChannelAdmin::ChannelID_out id ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::EventChannel_var ec_ret;
+
+ TAO_Notify_Factory* factory = TAO_Notify_PROPERTIES::instance ()->factory ();
+
+ TAO_Notify_EventChannel* ec = 0;
+ factory->create (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ec_ret._retn ());
+
+ ec->init (ecf, initial_qos, initial_admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ec_ret._retn ());
+
+ // insert ec in ec container.
+ ecf->ec_container().insert (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ec_ret._retn ());
+
+ CORBA::Object_var obj = ec->activate (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ec_ret._retn ());
+
+ // Populate the ID to return.
+ id = ec->id ();
+
+ ec_ret = CosNotifyChannelAdmin::EventChannel::_narrow (obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ec_ret._retn ());
+
+ return ec_ret._retn ();
+}
+
+TAO_Notify_EventChannel *
+TAO_Notify_Builder::build_event_channel (
+ TAO_Notify_EventChannelFactory* ecf,
+ const CosNotifyChannelAdmin::ChannelID id ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Factory* factory = TAO_Notify_PROPERTIES::instance ()->factory ();
+
+ TAO_Notify_EventChannel* ec = 0;
+ factory->create (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ec->init (ecf ACE_ENV_ARG_PARAMETER); //, initial_qos, initial_admin
+ ACE_CHECK_RETURN (0);
+
+ // insert ec in ec container.
+ ecf->ec_container().insert (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ec->activate (ec, id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return ec;
+}
+
+CosNotifyChannelAdmin::ConsumerAdmin_ptr
+TAO_Notify_Builder::build_consumer_admin (
+ TAO_Notify_EventChannel* ec,
+ CosNotifyChannelAdmin::InterFilterGroupOperator op,
+ CosNotifyChannelAdmin::AdminID_out id ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ConsumerAdmin_var ca_ret;
+
+ TAO_Notify_Factory* factory = TAO_Notify_PROPERTIES::instance ()->factory ();
+
+ TAO_Notify_ConsumerAdmin* ca = 0;
+ factory->create (ca ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ca_ret._retn ());
+
+ ca->init (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ca_ret._retn ());
+
+ ca->filter_operator (op);
+
+ CORBA::Object_var obj = ca->activate (ca ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ca_ret._retn ());
+
+ id = ca->id ();
+
+ ca_ret = CosNotifyChannelAdmin::ConsumerAdmin::_narrow (obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ca_ret._retn ());
+
+ // insert admin in CA container.
+ ec->ca_container_->insert (ca ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ca_ret._retn ());
+
+ return ca_ret._retn ();
+}
+
+TAO_Notify_ConsumerAdmin *
+TAO_Notify_Builder::build_consumer_admin (
+ TAO_Notify_EventChannel* ec,
+ const CosNotifyChannelAdmin::ChannelID id
+ ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Factory* factory = TAO_Notify_PROPERTIES::instance ()->factory ();
+ TAO_Notify_ConsumerAdmin * ca = 0;
+ factory->create (ca ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ca->init (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Object_var obj = ca->activate (ca, id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // insert admin in CA container.
+ ec->ca_container_->insert (ca ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ return ca;
+}
+
+CosNotifyChannelAdmin::SupplierAdmin_ptr
+TAO_Notify_Builder::build_supplier_admin (TAO_Notify_EventChannel* ec, CosNotifyChannelAdmin::InterFilterGroupOperator op, CosNotifyChannelAdmin::AdminID_out id ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::SupplierAdmin_var sa_ret;
+
+ TAO_Notify_Factory* factory = TAO_Notify_PROPERTIES::instance ()->factory ();
+
+ TAO_Notify_SupplierAdmin* sa = 0;
+ factory->create (sa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (sa_ret._retn ());
+
+ sa->init (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (sa_ret._retn ());
+
+ sa->filter_operator (op);
+
+ CORBA::Object_var obj = sa->activate (sa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (sa_ret._retn ());
+
+ id = sa->id ();
+
+ sa_ret = CosNotifyChannelAdmin::SupplierAdmin::_narrow (obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (sa_ret._retn ());
+
+ // insert admin in SA container.
+ ec->sa_container().insert (sa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (sa_ret._retn ());
+
+ return sa_ret._retn ();
+}
+
+TAO_Notify_SupplierAdmin *
+TAO_Notify_Builder::build_supplier_admin (
+ TAO_Notify_EventChannel* ec,
+ const CosNotifyChannelAdmin::ChannelID id
+ ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Factory* factory = TAO_Notify_PROPERTIES::instance ()->factory ();
+ TAO_Notify_SupplierAdmin * sa = 0;
+ factory->create (sa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ sa->init (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Object_var obj = sa->activate (sa, id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // insert admin in CA container.
+ ec->sa_container().insert (sa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return sa;
+}
+
+CosNotifyChannelAdmin::ProxyConsumer_ptr
+TAO_Notify_Builder::build_proxy(TAO_Notify_SupplierAdmin* sa
+ , CosNotifyChannelAdmin::ClientType ctype
+ , CosNotifyChannelAdmin::ProxyID_out proxy_id
+ , const CosNotification::QoSProperties & initial_qos
+ ACE_ENV_ARG_DECL)
+{
+ switch (ctype)
+ {
+ case CosNotifyChannelAdmin::ANY_EVENT:
+ {
+ TAO_Notify_ProxyPushConsumer_Builder pb;
+ return pb.build (sa, proxy_id, initial_qos ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+
+ case CosNotifyChannelAdmin::STRUCTURED_EVENT:
+ {
+ TAO_Notify_StructuredProxyPushConsumer_Builder pb;
+ return pb.build (sa, proxy_id, initial_qos ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+
+ case CosNotifyChannelAdmin::SEQUENCE_EVENT:
+ {
+ TAO_Notify_SequenceProxyPushConsumer_Builder pb;
+ return pb.build (sa, proxy_id, initial_qos ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+
+ default:
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ CosNotifyChannelAdmin::ProxyConsumer::_nil ());
+ }
+}
+
+CosNotifyChannelAdmin::ProxySupplier_ptr
+TAO_Notify_Builder::build_proxy(TAO_Notify_ConsumerAdmin* ca
+ , CosNotifyChannelAdmin::ClientType ctype
+ , CosNotifyChannelAdmin::ProxyID_out proxy_id
+ , const CosNotification::QoSProperties & initial_qos
+ ACE_ENV_ARG_DECL)
+{
+ switch (ctype)
+ {
+ case CosNotifyChannelAdmin::ANY_EVENT:
+ {
+ TAO_Notify_ProxyPushSupplier_Builder pb;
+ return pb.build (ca, proxy_id, initial_qos ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+
+ case CosNotifyChannelAdmin::STRUCTURED_EVENT:
+ {
+ TAO_Notify_StructuredProxyPushSupplier_Builder pb;
+ return pb.build (ca, proxy_id, initial_qos ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+
+ case CosNotifyChannelAdmin::SEQUENCE_EVENT:
+ {
+ TAO_Notify_SequenceProxyPushSupplier_Builder pb;
+ return pb.build (ca, proxy_id, initial_qos ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+
+ default:
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ CosNotifyChannelAdmin::ProxySupplier::_nil ());
+ }
+}
+
+TAO_Notify_ProxyConsumer *
+TAO_Notify_Builder::build_proxy(TAO_Notify_SupplierAdmin* sa
+ , CosNotifyChannelAdmin::ClientType ctype
+ , const CosNotifyChannelAdmin::ProxyID proxy_id
+ ACE_ENV_ARG_DECL)
+{
+ switch (ctype)
+ {
+ case CosNotifyChannelAdmin::ANY_EVENT:
+ {
+ TAO_Notify_ProxyPushConsumer_Builder pb;
+ return pb.build (sa, proxy_id ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+
+ case CosNotifyChannelAdmin::STRUCTURED_EVENT:
+ {
+ TAO_Notify_StructuredProxyPushConsumer_Builder pb;
+ return pb.build (sa, proxy_id ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+
+ case CosNotifyChannelAdmin::SEQUENCE_EVENT:
+ {
+ TAO_Notify_SequenceProxyPushConsumer_Builder pb;
+ return pb.build (sa, proxy_id ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+
+ default:
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ 0);
+ }
+}
+
+TAO_Notify_ProxySupplier *
+TAO_Notify_Builder::build_proxy(TAO_Notify_ConsumerAdmin* ca
+ , CosNotifyChannelAdmin::ClientType ctype
+ , const CosNotifyChannelAdmin::ProxyID proxy_id
+ ACE_ENV_ARG_DECL)
+{
+ switch (ctype)
+ {
+ case CosNotifyChannelAdmin::ANY_EVENT:
+ {
+ TAO_Notify_ProxyPushSupplier_Builder pb;
+ return pb.build (ca, proxy_id ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+
+ case CosNotifyChannelAdmin::STRUCTURED_EVENT:
+ {
+ TAO_Notify_StructuredProxyPushSupplier_Builder pb;
+ return pb.build (ca, proxy_id ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+
+ case CosNotifyChannelAdmin::SEQUENCE_EVENT:
+ {
+ TAO_Notify_SequenceProxyPushSupplier_Builder pb;
+ return pb.build (ca, proxy_id ACE_ENV_ARG_PARAMETER);
+ }
+ break;
+
+ default:
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ 0);
+ }
+}
+
+CosEventChannelAdmin::ProxyPushSupplier_ptr
+TAO_Notify_Builder::build_proxy (TAO_Notify_ConsumerAdmin* ca ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ProxyID proxy_id;
+
+ TAO_Notify_CosEC_ProxyPushSupplier_Builder pb;
+
+ CosNotification::QoSProperties initial_qos;
+
+ return pb.build (ca, proxy_id, initial_qos ACE_ENV_ARG_PARAMETER);
+}
+
+CosEventChannelAdmin::ProxyPushConsumer_ptr
+TAO_Notify_Builder::build_proxy (TAO_Notify_SupplierAdmin* sa ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ProxyID proxy_id;
+
+ TAO_Notify_CosEC_ProxyPushConsumer_Builder pb;
+
+ CosNotification::QoSProperties initial_qos;
+
+ return pb.build (sa, proxy_id, initial_qos ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Builder::apply_reactive_concurrency (TAO_Notify_Object& object ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Reactive_Task* worker_task;
+
+ ACE_NEW_THROW_EX (worker_task,
+ TAO_Notify_Reactive_Task (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ object.set_worker_task (worker_task);
+
+ worker_task->init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Builder::apply_thread_pool_concurrency (TAO_Notify_Object& object, const NotifyExt::ThreadPoolParams& tp_params ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_ThreadPool_Task* worker_task;
+
+ ACE_NEW_THROW_EX (worker_task,
+ TAO_Notify_ThreadPool_Task (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ object.set_worker_task (worker_task);
+
+ worker_task->init (tp_params, object.admin_properties_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Builder::apply_lane_concurrency (TAO_Notify_Object& /*object*/, const NotifyExt::ThreadPoolLanesParams& /*tpl_params*/ ACE_ENV_ARG_DECL)
+{
+ // No lane support
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Builder.h b/TAO/orbsvcs/orbsvcs/Notify/Builder.h
new file mode 100644
index 00000000000..7ed2c219c65
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Builder.h
@@ -0,0 +1,175 @@
+/* -*- C++ -*- */
+/**
+ * @file Builder.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_BUILDER_H
+#define TAO_Notify_BUILDER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "orbsvcs/NotifyExtC.h"
+
+#include "orbsvcs/Notify/AdminProperties.h"
+#include "orbsvcs/Notify/Topology_Object.h"
+
+#include "tao/PortableServer/PortableServer.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_EventChannelFactory;
+class TAO_Notify_EventChannel;
+class TAO_Notify_SupplierAdmin;
+class TAO_Notify_ConsumerAdmin;
+class TAO_Notify_ProxyConsumer;
+class TAO_Notify_ProxySupplier;
+class TAO_Notify_FilterFactory;
+class TAO_Notify_Object;
+
+/**
+ * @class TAO_Notify_Builder
+ *
+ * @brief Helper class to create and activate CORBA objects.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Builder
+{
+public:
+ TAO_Notify_Builder (void);
+
+ virtual ~TAO_Notify_Builder ();
+
+ ///= Factory Methods
+
+ /// Build EventChannel Factory.
+ virtual CosNotifyChannelAdmin::EventChannelFactory_ptr
+ build_event_channel_factory (PortableServer::POA_ptr poa ACE_ENV_ARG_DECL);
+
+ /// Build the Filter Factory.
+ virtual CosNotifyFilter::FilterFactory_ptr build_filter_factory (
+ ACE_ENV_SINGLE_ARG_DECL
+ );
+
+ /// Build EventChannel.
+ virtual CosNotifyChannelAdmin::EventChannel_ptr
+ build_event_channel (TAO_Notify_EventChannelFactory* ecf
+ , const CosNotification::QoSProperties & initial_qos
+ , const CosNotification::AdminProperties & initial_admin
+ , CosNotifyChannelAdmin::ChannelID_out id
+ ACE_ENV_ARG_DECL);
+
+
+ virtual TAO_Notify_EventChannel *
+ build_event_channel (TAO_Notify_EventChannelFactory* ecf
+ , const CosNotifyChannelAdmin::ChannelID id
+ ACE_ENV_ARG_DECL);
+
+
+ /// Build ConsumerAdmin
+ virtual CosNotifyChannelAdmin::ConsumerAdmin_ptr
+ build_consumer_admin (TAO_Notify_EventChannel* ec
+ , CosNotifyChannelAdmin::InterFilterGroupOperator op
+ , CosNotifyChannelAdmin::AdminID_out id
+ ACE_ENV_ARG_DECL);
+
+ /// Build ConsumerAdmin during topology restore
+ /// TODO: this returns a reference to the actual type
+ /// to accomodate loadable builder/factory there should
+ /// be an appropriate base class for it to return.
+ virtual TAO_Notify_ConsumerAdmin *
+ build_consumer_admin (TAO_Notify_EventChannel* ec
+ , const CosNotifyChannelAdmin::AdminID id //CORBA::Long id // note: an in parameter!
+ ACE_ENV_ARG_DECL);
+
+ /// Build SupplierAdmin
+ virtual CosNotifyChannelAdmin::SupplierAdmin_ptr
+ build_supplier_admin (TAO_Notify_EventChannel * ec
+ , CosNotifyChannelAdmin::InterFilterGroupOperator op
+ , CosNotifyChannelAdmin::AdminID_out id
+ ACE_ENV_ARG_DECL);
+
+ /// Build ConsumerAdmin during topology restore
+ /// TODO: this returns a reference to the actual type
+ /// to accomodate loadable builder/factory there should
+ /// be an appropriate base class for it to return.
+ virtual TAO_Notify_SupplierAdmin *
+ build_supplier_admin (TAO_Notify_EventChannel * ec
+ , const CosNotifyChannelAdmin::AdminID id //CORBA::Long id // note: an in parameter!
+ ACE_ENV_ARG_DECL);
+
+ /// Build ProxyConsumer
+ virtual CosNotifyChannelAdmin::ProxyConsumer_ptr
+ build_proxy (TAO_Notify_SupplierAdmin* sa
+ , CosNotifyChannelAdmin::ClientType ctype
+ , CosNotifyChannelAdmin::ProxyID_out proxy_id
+ , const CosNotification::QoSProperties & initial_qos
+ ACE_ENV_ARG_DECL);
+
+ /// Reload ProxyConsumer
+ virtual TAO_Notify_ProxyConsumer *
+ build_proxy (TAO_Notify_SupplierAdmin* sa
+ , CosNotifyChannelAdmin::ClientType ctype
+ , const CosNotifyChannelAdmin::ProxyID proxy_id
+ ACE_ENV_ARG_DECL);
+
+ /// Build ProxySupplier.
+ virtual CosNotifyChannelAdmin::ProxySupplier_ptr
+ build_proxy (TAO_Notify_ConsumerAdmin* ca
+ , CosNotifyChannelAdmin::ClientType ctype
+ , CosNotifyChannelAdmin::ProxyID_out proxy_id
+ , const CosNotification::QoSProperties & initial_qos
+ ACE_ENV_ARG_DECL);
+
+ /// Reload ProxySupplier.
+ virtual TAO_Notify_ProxySupplier *
+ build_proxy (TAO_Notify_ConsumerAdmin* ca
+ , CosNotifyChannelAdmin::ClientType ctype
+ , const CosNotifyChannelAdmin::ProxyID proxy_id
+ ACE_ENV_ARG_DECL);
+
+ /// Build CosEC style ProxySupplier.
+ virtual CosEventChannelAdmin::ProxyPushSupplier_ptr
+ build_proxy (TAO_Notify_ConsumerAdmin* ca ACE_ENV_ARG_DECL);
+
+ /// Build CosEC style ProxyConsumer.
+ virtual CosEventChannelAdmin::ProxyPushConsumer_ptr
+ build_proxy (TAO_Notify_SupplierAdmin* sa ACE_ENV_ARG_DECL);
+
+ /// Apply Reactive concurrency.
+ virtual void apply_reactive_concurrency (
+ TAO_Notify_Object& object ACE_ENV_ARG_DECL
+ );
+
+ /// Apply Thread Pools.
+ virtual void apply_thread_pool_concurrency (
+ TAO_Notify_Object& object,
+ const NotifyExt::ThreadPoolParams& tp_params
+ ACE_ENV_ARG_DECL
+ );
+
+ /// Apply Thread Pools with Lanes.
+ virtual void apply_lane_concurrency (
+ TAO_Notify_Object& object,
+ const NotifyExt::ThreadPoolLanesParams& tpl_params
+ ACE_ENV_ARG_DECL
+ );
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_BUILDER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp
new file mode 100644
index 00000000000..7b19b418ebc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp
@@ -0,0 +1,702 @@
+// $Id$
+
+#include "orbsvcs/Notify/Consumer.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Consumer.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (RT_Notify, TAO_Notify_Consumer, "$Id$")
+
+#include "orbsvcs/Notify/Timer.h"
+#include "orbsvcs/Notify/ProxySupplier.h"
+#include "orbsvcs/Notify/Method_Request_Event.h"
+
+#include "orbsvcs/Time_Utilities.h"
+
+#include "tao/debug.h"
+#include "tao/corba.h"
+
+#include "ace/Bound_Ptr.h"
+#include "ace/Unbounded_Queue.h"
+
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+static const int DEFAULT_RETRY_TIMEOUT = 10;//120; // Note : This should be a config param or qos setting
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Consumer::TAO_Notify_Consumer (TAO_Notify_ProxySupplier* proxy)
+: proxy_ (proxy)
+, is_suspended_ (0)
+, pacing_ (proxy->qos_properties_.pacing_interval ())
+, max_batch_size_ (CosNotification::MaximumBatchSize, 0)
+, timer_id_ (-1)
+, timer_ (0)
+{
+ Request_Queue* pending_events = 0;
+ ACE_NEW (pending_events, TAO_Notify_Consumer::Request_Queue ());
+ this->pending_events_.reset( pending_events );
+
+ this->timer_.reset( this->proxy ()->timer () );
+}
+
+TAO_Notify_Consumer::~TAO_Notify_Consumer ()
+{
+ if (this->timer_.isSet())
+ {
+ this->cancel_timer ();
+ this->timer_.reset ();
+ }
+}
+
+TAO_Notify_Proxy*
+TAO_Notify_Consumer::proxy (void)
+{
+ return this->proxy_supplier ();
+}
+
+void
+TAO_Notify_Consumer::qos_changed (const TAO_Notify_QoSProperties& qos_properties)
+{
+ this->max_batch_size_ = qos_properties.maximum_batch_size ();
+}
+
+void
+TAO_Notify_Consumer::resume (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->is_suspended_ = 0;
+
+ this->dispatch_pending (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Consumer::enqueue_request (
+ TAO_Notify_Method_Request_Event * request
+ ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Event::Ptr event (
+ request->event ()->queueable_copy (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+
+ TAO_Notify_Method_Request_Event_Queueable * queue_entry;
+ ACE_NEW_THROW_EX (queue_entry,
+ TAO_Notify_Method_Request_Event_Queueable (*request, event),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ if (DEBUG_LEVEL > 3) ACE_DEBUG ( (LM_DEBUG,
+ ACE_TEXT ("Consumer %d: enqueue_request (%d) @%@.\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ request->sequence (),
+ request
+ ));
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, *this->proxy_lock ());
+ this->pending_events().enqueue_tail (queue_entry);
+}
+
+bool
+TAO_Notify_Consumer::enqueue_if_necessary (TAO_Notify_Method_Request_Event * request ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, *this->proxy_lock (), false);
+ if (! this->pending_events().is_empty ())
+ {
+ if (DEBUG_LEVEL > 3)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Consumer %d: enqueuing another event. %d\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ request->sequence ()
+ ));
+ TAO_Notify_Event::Ptr event (
+ request->event ()->queueable_copy (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK_RETURN (false);
+ TAO_Notify_Method_Request_Event_Queueable * queue_entry;
+ ACE_NEW_THROW_EX (queue_entry,
+ TAO_Notify_Method_Request_Event_Queueable (*request,
+ event),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (false);
+ this->pending_events().enqueue_tail (queue_entry);
+ this->schedule_timer (false);
+ return true;
+ }
+ if (this->is_suspended_ == 1)
+ {
+ if (DEBUG_LEVEL > 3)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Suspended Consumer %d enqueing event. %d\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ request->sequence ()
+ ));
+ TAO_Notify_Event::Ptr event (
+ request->event ()->queueable_copy (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK_RETURN (false);
+ TAO_Notify_Method_Request_Event_Queueable * queue_entry;
+ ACE_NEW_THROW_EX (queue_entry,
+ TAO_Notify_Method_Request_Event_Queueable (*request,
+ event),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (false);
+ this->pending_events().enqueue_tail (queue_entry);
+ this->schedule_timer (false);
+ return true;
+ }
+ return false;
+}
+
+void
+TAO_Notify_Consumer::deliver (TAO_Notify_Method_Request_Event * request
+ ACE_ENV_ARG_DECL)
+{
+ // Increment reference counts (safely) to prevent this object and its proxy
+ // from being deleted while the push is in progress.
+ TAO_Notify_Proxy::Ptr proxy_guard (this->proxy ());
+ bool queued = enqueue_if_necessary (request ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ if (!queued)
+ {
+ DispatchStatus status = this->dispatch_request (request);
+ switch (status)
+ {
+ case DISPATCH_SUCCESS:
+ {
+ request->complete ();
+ break;
+ }
+ case DISPATCH_RETRY:
+ {
+ if (DEBUG_LEVEL > 1)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Consumer %d enqueing event %d due ")
+ ACE_TEXT ("to failed dispatch.\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ request->sequence ()));
+ this->enqueue_request (request ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->schedule_timer (true);
+ break;
+ }
+ case DISPATCH_DISCARD:
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer %d: Error during "
+ "direct dispatch. Discarding event:%d.\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ request->sequence ()
+ ));
+ request->complete ();
+ break;
+ }
+ case DISPATCH_FAIL:
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer %d: Failed during "
+ "direct dispatch :%d. Discarding event.\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ request->sequence ()
+ ));
+ request->complete ();
+ ACE_DECLARE_NEW_ENV;
+ ACE_TRY
+ {
+ this->proxy_supplier ()->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // todo is there something meaningful we can do here?
+ ;
+ }
+ ACE_ENDTRY;
+ break;
+ }
+ }
+ }
+}
+
+TAO_Notify_Consumer::DispatchStatus
+TAO_Notify_Consumer::dispatch_request (TAO_Notify_Method_Request_Event * request)
+{
+ DispatchStatus result = DISPATCH_SUCCESS;
+ ACE_DECLARE_NEW_ENV;
+ ACE_TRY
+ {
+ request->event ()->push (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (DEBUG_LEVEL > 8)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Consumer %d dispatched single event %d.\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ request->sequence ()
+ ));
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ if (DEBUG_LEVEL > 0)
+ {
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Consumer %d::push "
+ "(request) %s\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ ex._info ().c_str ()
+ ));
+ }
+ result = DISPATCH_FAIL;
+ }
+ ACE_CATCH (CORBA::TRANSIENT, ex)
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Consumer %d::push "
+ "(request) Transient (minor=%d) %s\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ ex.minor (),
+ ex._info ().c_str ()
+ ));
+ const CORBA::ULong BITS_5_THRU_12_MASK = 0x00000f80u;
+ switch (ex.minor () & 0xfffff000u)
+ {
+ case CORBA::OMGVMCID:
+ switch (ex.minor () & 0x00000fffu)
+ {
+ case 2: // No usable profile
+ case 3: // Request cancelled
+ case 4: // POA destroyed
+ result = DISPATCH_FAIL;
+ break;
+ default:
+ result = DISPATCH_DISCARD;
+ }
+ break;
+
+ case TAO::VMCID:
+ default:
+ switch (ex.minor () & BITS_5_THRU_12_MASK)
+ {
+ case TAO_INVOCATION_SEND_REQUEST_MINOR_CODE:
+ result = DISPATCH_FAIL;
+ break;
+ case TAO_POA_DISCARDING:
+ case TAO_POA_HOLDING:
+ default:
+ result = DISPATCH_RETRY;
+ } break;
+ }
+ }
+ ACE_CATCH (CORBA::TIMEOUT, ex)
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Consumer %u::push "
+ "(request) %s\n"),
+ this->proxy ()->id (),
+ ex._info().c_str ()
+ ));
+ result = DISPATCH_FAIL;
+ }
+ ACE_CATCH (CORBA::COMM_FAILURE, ex)
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Consumer %u::push "
+ "(request) %s\n"),
+ this->proxy ()->id (),
+ ex._info().c_str ()
+ ));
+ result = DISPATCH_FAIL;
+ }
+ ACE_CATCH (CORBA::SystemException, ex)
+ {
+ if (DEBUG_LEVEL > 0)
+ {
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Consumer %d::push "
+ "(request) SystemException %s\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ ex._info ().c_str ()
+ ));
+ }
+ result = DISPATCH_DISCARD;
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Consumer %d::push "
+ "(request) Caught unexpected exception "
+ "pushing event to consumer.\n"),
+ static_cast<int> (this->proxy ()->id ())
+ ));
+ result = DISPATCH_DISCARD;
+ }
+ ACE_ENDTRY;
+
+ // for persistent events that haven't timed out
+ // convert "FAIL" & "DISCARD" to "RETRY"
+ // for transient events, convert RETRY to DISCARD (hey, best_effort.)
+ if (result == DISPATCH_FAIL || result == DISPATCH_DISCARD)
+ {
+ if (request->should_retry ())
+ {
+ result = DISPATCH_RETRY;
+ }
+ }
+ else if (result == DISPATCH_RETRY)
+ {
+ if (! request->should_retry ())
+ {
+ result = DISPATCH_DISCARD;
+ }
+ }
+
+ return result;
+}
+
+TAO_Notify_Consumer::DispatchStatus
+TAO_Notify_Consumer::dispatch_batch (const CosNotification::EventBatch& batch)
+{
+ DispatchStatus result = DISPATCH_SUCCESS;
+ ACE_DECLARE_NEW_ENV;
+ ACE_TRY
+ {
+ this->push (batch ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Consumer "
+ "%d::dispatch_batch() %s\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ ex._info ().c_str ()
+ ));
+ result = DISPATCH_FAIL;
+ }
+ ACE_CATCH (CORBA::TRANSIENT, ex)
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Consumer "
+ "%d::dispatch_batch() Transient (minor=%d) %s\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ ex.minor (),
+ ex._info ().c_str ()
+ ));
+ const CORBA::ULong BITS_5_THRU_12_MASK = 0x00000f80u;
+ switch (ex.minor () & 0xfffff000u)
+ {
+ case CORBA::OMGVMCID:
+ switch (ex.minor () & 0x00000fffu)
+ {
+ case 2: // No usable profile
+ case 3: // Request cancelled
+ case 4: // POA destroyed
+ result = DISPATCH_FAIL;
+ break;
+ default:
+ result = DISPATCH_DISCARD;
+ }
+ break;
+
+ case TAO::VMCID:
+ default:
+ switch (ex.minor () & BITS_5_THRU_12_MASK)
+ {
+ case TAO_INVOCATION_SEND_REQUEST_MINOR_CODE:
+ result = DISPATCH_FAIL;
+ break;
+ case TAO_POA_DISCARDING:
+ case TAO_POA_HOLDING:
+ default:
+ result = DISPATCH_RETRY;
+ } break;
+ }
+ }
+ ACE_CATCH (CORBA::TIMEOUT, ex)
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Consumer "
+ "%u::dispatch_batch() %s\n"),
+ this->proxy ()->id (),
+ ex._info().c_str ()
+ ));
+ result = DISPATCH_FAIL;
+ }
+ ACE_CATCH (CORBA::COMM_FAILURE, ex)
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Consumer "
+ "%u::dispatch_batch() %s\n"),
+ this->proxy ()->id (),
+ ex._info().c_str ()
+ ));
+ result = DISPATCH_FAIL;
+ }
+ ACE_CATCH (CORBA::SystemException, ex)
+ {
+ if (DEBUG_LEVEL > 0)
+ {
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Consumer "
+ "%d::dispatch_batch() SystemException %s\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ ex._info ().c_str ()
+ ));
+ }
+ result = DISPATCH_DISCARD;
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Consumer "
+ "%d::dispatch_batch() Caught unexpected "
+ "exception pushing batch to consumer.\n"),
+ static_cast<int> (this->proxy ()->id ())
+ ));
+ result = DISPATCH_DISCARD;
+ }
+ ACE_ENDTRY;
+ return result;
+}
+
+void
+TAO_Notify_Consumer::dispatch_pending (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ if (DEBUG_LEVEL > 5)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Consumer %d dispatching pending events. Queue size: %d\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ this->pending_events().size ()
+ ));
+
+ // lock ourselves in memory for the duration
+ TAO_Notify_Consumer::Ptr self_grd (this);
+
+ // dispatch events until: 1) the queue is empty; 2) the proxy shuts down, or 3) the dispatch fails
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, *this->proxy_lock ());
+ bool ok = true;
+ while (ok
+ && !this->proxy_supplier ()->has_shutdown ()
+ && !this->pending_events().is_empty ())
+ {
+ if (! dispatch_from_queue ( this->pending_events(), ace_mon))
+ {
+ this->schedule_timer (true);
+ ok = false;
+ }
+ }
+}
+
+
+// virtual: this is the default, overridden for SequencePushConsumer
+bool
+TAO_Notify_Consumer::dispatch_from_queue (Request_Queue & requests, ACE_Guard <TAO_SYNCH_MUTEX> & ace_mon)
+{
+ bool result = true;
+ TAO_Notify_Method_Request_Event_Queueable * request;
+ if (requests.dequeue_head (request) == 0)
+ {
+ ace_mon.release ();
+ DispatchStatus status = this->dispatch_request (request);
+ switch (status)
+ {
+ case DISPATCH_SUCCESS:
+ {
+ request->complete ();
+ request->release ();
+ result = true;
+ ace_mon.acquire ();
+ break;
+ }
+ case DISPATCH_RETRY:
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer %d: Will retry %d\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ request->sequence ()
+ ));
+ ace_mon.acquire ();
+ requests.enqueue_head (request); // put the failed event back where it was
+ result = false;
+ break;
+ }
+ case DISPATCH_DISCARD:
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer %d: Error during "
+ "dispatch. Discarding event:%d.\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ request->sequence ()
+ ));
+ request->complete ();
+ ace_mon.acquire ();
+ result = true;
+ break;
+ }
+ case DISPATCH_FAIL:
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer %d: Failed. "
+ "Discarding event %d.\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ request->sequence ()
+ ));
+ request->complete ();
+ ace_mon.acquire ();
+ while (requests.dequeue_head (request) == 0)
+ {
+ ace_mon.release ();
+ request->complete ();
+ ace_mon.acquire ();
+ }
+ ace_mon.release ();
+ ACE_DECLARE_NEW_ENV;
+ ACE_TRY
+ {
+ this->proxy_supplier ()->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // todo is there something reasonable to do here?
+ }
+ ACE_ENDTRY;
+ ace_mon.acquire ();
+ result = true;
+ break;
+ }
+ default:
+ {
+ ace_mon.acquire ();
+ result = false;
+ break;
+ }
+ }
+ }
+ return result;
+}
+
+//@@todo: rather than is_error, use pacing interval so it will be configurable
+//@@todo: find some way to use batch buffering stratgy for sequence consumers.
+void
+TAO_Notify_Consumer::schedule_timer (bool is_error)
+{
+ if (this->timer_id_ != -1)
+ {
+ return; // We only want a single timeout scheduled.
+ }
+ // don't schedule timer if there's nothing that can be done
+ if (this->is_suspended ())
+ {
+ return;
+ }
+
+ ACE_ASSERT (this->timer_.get() != 0);
+
+ // If we're scheduling the timer due to an error then we want to
+ // use the retry timeout, otherwise we'll assume that the pacing
+ // interval is sufficient for now.
+ ACE_Time_Value tv (DEFAULT_RETRY_TIMEOUT);
+
+ if (! is_error)
+ {
+ if (this->pacing_.is_valid ())
+ {
+ tv = ORBSVCS_Time::to_Time_Value (this->pacing_.value ());
+ }
+ }
+
+ if (DEBUG_LEVEL > 5)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Consumer %d: scheduling pacing/retry for %dms.\n"),
+ static_cast<int> (this->proxy ()->id ()), tv.msec ()));
+ }
+
+ this->timer_id_ =
+ this->timer_->schedule_timer (this, tv, ACE_Time_Value::zero);
+ if (this->timer_id_ == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO_Notify_Consumer %d::schedule_timer () "
+ "Error scheduling timer.\n"),
+ static_cast<int> (this->proxy ()->id ())
+ ));
+ }
+}
+
+void
+TAO_Notify_Consumer::cancel_timer (void)
+{
+ if (this->timer_.isSet() && this->timer_id_ != -1)
+ {
+ if (DEBUG_LEVEL > 5)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Consumer %d canceling dispatch timer.\n"),
+ static_cast<int> (this->proxy ()->id ())
+ ));
+
+ this->timer_->cancel_timer (timer_id_);
+ }
+ this->timer_id_ = -1;
+}
+
+int
+TAO_Notify_Consumer::handle_timeout (const ACE_Time_Value&, const void*)
+{
+ TAO_Notify_Consumer::Ptr grd (this);
+ this->timer_id_ = -1; // This must come first, because dispatch_pending may try to resched
+ ACE_DECLARE_NEW_ENV;
+ ACE_TRY
+ {
+ this->dispatch_pending (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+void
+TAO_Notify_Consumer::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ if (this->timer_.isSet ())
+ {
+ this->cancel_timer ();
+ this->timer_.reset ();
+ }
+}
+
+void
+TAO_Notify_Consumer::dispatch_updates_i (const CosNotification::EventTypeSeq& added, const CosNotification::EventTypeSeq& removed
+ ACE_ENV_ARG_DECL)
+{
+ if (!CORBA::is_nil (this->publish_.in ()))
+ this->publish_->offer_change (added, removed ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_SYNCH_MUTEX*
+TAO_Notify_Consumer::proxy_lock (void)
+{
+ return &this->proxy_->lock_;
+}
+
+TAO_Notify_ProxySupplier*
+TAO_Notify_Consumer::proxy_supplier (void)
+{
+ return this->proxy_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.h b/TAO/orbsvcs/orbsvcs/Notify/Consumer.h
new file mode 100644
index 00000000000..43b591b51e4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.h
@@ -0,0 +1,195 @@
+/* -*- C++ -*- */
+/**
+ * @file Consumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_NOTIFY_CONSUMER_H
+#define TAO_NOTIFY_CONSUMER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNotificationC.h"
+
+#include "orbsvcs/Notify/Peer.h"
+#include "orbsvcs/Notify/Event.h"
+#include "orbsvcs/Notify/Timer.h"
+#include "ace/Event_Handler.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_ProxySupplier;
+class TAO_Notify_Proxy;
+class TAO_Notify_Method_Request_Event_Queueable;
+class TAO_Notify_Method_Request_Event;
+/**
+ * @class TAO_Notify_Consumer
+ *
+ * @brief Astract Base class for wrapping consumer objects that connect to the EventChannel
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Consumer
+ : public TAO_Notify_Peer
+ , public ACE_Event_Handler // to support timer
+{
+
+public:
+ /// Status returned from dispatch attempts
+ enum DispatchStatus {
+ DISPATCH_SUCCESS,
+ DISPATCH_RETRY, // retry this message
+ DISPATCH_DISCARD, // discard this message
+ DISPATCH_FAIL}; // discard all messages and disconnect consumer
+
+public:
+ /// Constuctor
+ TAO_Notify_Consumer (TAO_Notify_ProxySupplier* proxy);
+
+ /// Destructor
+ virtual ~TAO_Notify_Consumer ();
+
+ /// Access Specific Proxy.
+ TAO_Notify_ProxySupplier* proxy_supplier (void);
+
+ /// Access Base Proxy.
+ virtual TAO_Notify_Proxy* proxy (void);
+
+ /// Dispatch Event to consumer
+ void deliver (TAO_Notify_Method_Request_Event * request ACE_ENV_ARG_DECL);
+
+ /// Push <event> to this consumer.
+ virtual void push (const CORBA::Any& event ACE_ENV_ARG_DECL) = 0;
+
+ /// Push <event> to this consumer.
+ virtual void push (const CosNotification::StructuredEvent& event ACE_ENV_ARG_DECL) = 0;
+
+ /// Push a batch of events to this consumer.
+ virtual void push (const CosNotification::EventBatch& event ACE_ENV_ARG_DECL) = 0;
+
+ /// Dispatch the batch of events to the attached consumer
+ DispatchStatus dispatch_batch (const CosNotification::EventBatch& batch);
+
+ /// Dispatch the pending events
+ void dispatch_pending (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Is the connection suspended?
+ CORBA::Boolean is_suspended (void);
+
+ /// Suspend Connection
+ void suspend (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Resume Connection
+ void resume (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Shutdown the consumer
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// on reconnect we need to move events from the old consumer
+ /// to the new one
+ virtual void reconnect_from_consumer (
+ TAO_Notify_Consumer* old_consumer
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Override, Peer::qos_changed
+ virtual void qos_changed (const TAO_Notify_QoSProperties& qos_properties);
+
+protected:
+ typedef ACE_Unbounded_Queue<TAO_Notify_Method_Request_Event_Queueable *> Request_Queue;
+
+ DispatchStatus dispatch_request (TAO_Notify_Method_Request_Event * request);
+
+ /**
+ * \brief Attempt to dispatch event from a queue.
+ *
+ * Called by dispatch_pending. Deliver one or more events to the Consumer.
+ * If delivery fails, events are left in the queue (or discarded depending
+ * on QoS parameters.)
+ * Undelivered, undiscarded requests are left at the front of the queue.
+ * Overridden in sequence consumer to dispatch as an EventBatch.
+ * \return false if delivery failed and the request(s) cannot be discarded.
+ */
+ virtual bool dispatch_from_queue (
+ Request_Queue & requests,
+ ACE_Guard <TAO_SYNCH_MUTEX> & ace_mon);
+
+ void enqueue_request(TAO_Notify_Method_Request_Event * request ACE_ENV_ARG_DECL);
+
+ /// Add request to a queue if necessary.
+ /// Overridden by sequence consumer to "always" put incoming events into the queue.
+ /// @returns true the request has been enqueued; false the request should be handled now.
+ virtual bool enqueue_if_necessary(
+ TAO_Notify_Method_Request_Event * request
+ ACE_ENV_ARG_DECL);
+
+ // Dispatch updates
+ virtual void dispatch_updates_i (const CosNotification::EventTypeSeq& added,
+ const CosNotification::EventTypeSeq& removed
+ ACE_ENV_ARG_DECL);
+
+ /// Get the shared Proxy Lock
+ TAO_SYNCH_MUTEX* proxy_lock (void);
+
+protected:
+ virtual int handle_timeout (const ACE_Time_Value& current_time,
+ const void* act = 0);
+
+
+ /// Schedule timer
+ void schedule_timer (bool is_error = false);
+
+ /// Cancel timer
+ void cancel_timer (void);
+
+ ///= Protected Data Members
+protected:
+ Request_Queue& pending_events();
+
+ /// The Proxy that we associate with.
+ TAO_Notify_ProxySupplier* proxy_;
+
+ /// Suspended Flag.
+ CORBA::Boolean is_suspended_;
+
+ /// Interface that accepts offer_changes
+ CosNotifyComm::NotifyPublish_var publish_;
+
+ /// The Pacing Interval
+ const TAO_Notify_Property_Time & pacing_;
+
+ /// Max. batch size.
+ TAO_Notify_Property_Long max_batch_size_;
+
+ /// Timer Id.
+ long timer_id_;
+
+ /// The Timer Manager that we use.
+ TAO_Notify_Timer::Ptr timer_;
+
+private:
+
+ /// Events pending to be delivered.
+ ACE_Auto_Ptr< Request_Queue > pending_events_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Consumer.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_NOTIFY_CONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.inl b/TAO/orbsvcs/orbsvcs/Notify/Consumer.inl
new file mode 100644
index 00000000000..c1dcd33bbe7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.inl
@@ -0,0 +1,27 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_Notify_Consumer::Request_Queue&
+TAO_Notify_Consumer::pending_events()
+{
+ ACE_ASSERT( pending_events_.get() != 0 );
+ return *pending_events_;
+}
+
+ACE_INLINE CORBA::Boolean
+TAO_Notify_Consumer::is_suspended (void)
+{
+ return this->is_suspended_;
+}
+
+ACE_INLINE void
+TAO_Notify_Consumer::suspend (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->is_suspended_ = 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.cpp b/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.cpp
new file mode 100644
index 00000000000..7b10e3bd40b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.cpp
@@ -0,0 +1,488 @@
+// $Id$
+
+#include "orbsvcs/Notify/ConsumerAdmin.h"
+
+ACE_RCSID (RT_Notify,
+ TAO_Notify_ConsumerAdmin,
+ "$Id$")
+
+#include "orbsvcs/Notify/Subscription_Change_Worker.h"
+#include "orbsvcs/Notify/Proxy.h"
+#include "orbsvcs/Notify/EventChannel.h"
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/Factory.h"
+#include "orbsvcs/Notify/Builder.h"
+#include "orbsvcs/Notify/Find_Worker_T.h"
+#include "orbsvcs/Notify/Seq_Worker_T.h"
+#include "orbsvcs/Notify/ProxySupplier.h"
+
+#include "tao/debug.h"
+
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+
+#include "ace/Auto_Ptr.h"
+
+//#define DEBUG_LEVEL 9
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef TAO_Notify_Find_Worker_T<TAO_Notify_Proxy
+ , CosNotifyChannelAdmin::ProxySupplier
+ , CosNotifyChannelAdmin::ProxySupplier_ptr
+ , CosNotifyChannelAdmin::ProxyNotFound>
+TAO_Notify_ProxySupplier_Find_Worker;
+
+typedef TAO_Notify_Seq_Worker_T<TAO_Notify_Proxy> TAO_Notify_Proxy_Seq_Worker;
+
+TAO_Notify_ConsumerAdmin::TAO_Notify_ConsumerAdmin (void)
+ : TAO_Notify_Admin ()
+{
+}
+
+const char *
+TAO_Notify_ConsumerAdmin::get_admin_type_name () const
+{
+ return "consumer_admin";
+}
+
+
+
+TAO_Notify_ConsumerAdmin::~TAO_Notify_ConsumerAdmin ()
+{
+}
+
+void
+TAO_Notify_ConsumerAdmin::init (TAO_Notify_EventChannel *ec ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Admin::init (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const CosNotification::QoSProperties &default_ca_qos =
+ TAO_Notify_PROPERTIES::instance ()->default_consumer_admin_qos_properties ();
+
+ this->set_qos (default_ca_qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_ConsumerAdmin::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_incr_refcnt ();
+}
+
+void
+TAO_Notify_ConsumerAdmin::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_decr_refcnt ();
+}
+
+void
+TAO_Notify_ConsumerAdmin::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+void
+TAO_Notify_ConsumerAdmin::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ int result = this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ if ( result == 1)
+ return;
+
+ this->ec_->remove (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+TAO_Notify::Topology_Object*
+TAO_Notify_ConsumerAdmin::load_child (const ACE_CString &type,
+ CORBA::Long id, const TAO_Notify::NVPList& attrs ACE_ENV_ARG_DECL)
+{
+ TAO_Notify::Topology_Object* result = this;
+ if (type == "proxy_push_supplier")
+ {
+ if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Admin reload proxy %d\n")
+ , static_cast<int> (id)
+ ));
+ result = this->load_proxy(id, CosNotifyChannelAdmin::ANY_EVENT, attrs ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ else if (type == "structured_proxy_push_supplier")
+ {
+ if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Admin reload proxy %d\n")
+ , static_cast<int> (id)
+ ));
+ result = this->load_proxy(id, CosNotifyChannelAdmin::STRUCTURED_EVENT, attrs ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ else if (type == "sequence_proxy_push_supplier")
+ {
+ if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Admin reload proxy %d\n")
+ , static_cast<int> (id)
+ ));
+ result = this->load_proxy(id, CosNotifyChannelAdmin::SEQUENCE_EVENT, attrs ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+#if 0
+ else if (type == "ec_proxy_push_supplier")
+ {
+ if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Admin reload proxy %d\n")
+ , static_cast<int> (id)
+ ));
+ result = this->load_proxy(id, attrs ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+#endif
+ else
+ {
+ result = TAO_Notify_Admin::load_child (type, id, attrs ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ return result;
+}
+
+TAO_Notify::Topology_Object*
+TAO_Notify_ConsumerAdmin::load_proxy (
+ CORBA::Long id,
+ CosNotifyChannelAdmin::ClientType ctype,
+ const TAO_Notify::NVPList& attrs ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Builder* bld = TAO_Notify_PROPERTIES::instance()->builder();
+ TAO_Notify_ProxySupplier * proxy =
+ bld->build_proxy (this
+ , ctype
+ , id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ ACE_ASSERT(proxy != 0);
+ proxy->load_attrs (attrs);
+ return proxy;
+}
+
+CosNotifyChannelAdmin::ProxySupplier_ptr
+TAO_Notify_ConsumerAdmin::obtain_notification_push_supplier (CosNotifyChannelAdmin::ClientType ctype,
+ CosNotifyChannelAdmin::ProxyID_out proxy_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::AdminLimitExceeded
+ ))
+{
+ CosNotification::QoSProperties initial_qos;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxy =
+ TAO_Notify_PROPERTIES::instance()->builder()->build_proxy (this
+ , ctype
+ , proxy_id
+ , initial_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy._retn ());
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy._retn ());
+ return proxy._retn ();
+}
+
+CosNotifyChannelAdmin::ProxySupplier_ptr
+TAO_Notify_ConsumerAdmin::obtain_notification_push_supplier_with_qos (CosNotifyChannelAdmin::ClientType ctype,
+ CosNotifyChannelAdmin::ProxyID_out proxy_id,
+ const CosNotification::QoSProperties & initial_qos
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::AdminLimitExceeded
+ , CosNotification::UnsupportedQoS
+ ))
+{
+ CosNotifyChannelAdmin::ProxySupplier_var proxy =
+ TAO_Notify_PROPERTIES::instance()->builder()->build_proxy (this
+ , ctype
+ , proxy_id
+ , initial_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy._retn ());
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy._retn ());
+ return proxy._retn ();
+}
+
+CosEventChannelAdmin::ProxyPushSupplier_ptr
+TAO_Notify_ConsumerAdmin::obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ CosEventChannelAdmin::ProxyPushSupplier_var proxy =
+ TAO_Notify_PROPERTIES::instance()->builder()->build_proxy (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy._retn ());
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy._retn ());
+ return proxy._retn ();
+}
+
+CosNotifyChannelAdmin::AdminID
+TAO_Notify_ConsumerAdmin::MyID (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->id ();
+}
+
+CosNotifyChannelAdmin::EventChannel_ptr
+TAO_Notify_ConsumerAdmin::MyChannel (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->ec_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+::CosNotifyChannelAdmin::InterFilterGroupOperator
+TAO_Notify_ConsumerAdmin::MyOperator (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->filter_operator_;
+}
+
+CosNotifyChannelAdmin::ProxyIDSeq*
+TAO_Notify_ConsumerAdmin::push_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_Proxy_Seq_Worker seq_worker;
+
+ return seq_worker.create (this->proxy_container() ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::ProxySupplier_ptr
+TAO_Notify_ConsumerAdmin::get_proxy_supplier (CosNotifyChannelAdmin::ProxyID proxy_id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::ProxyNotFound
+ ))
+{
+ TAO_Notify_ProxySupplier_Find_Worker find_worker;
+
+ return find_worker.resolve (proxy_id, this->proxy_container() ACE_ENV_ARG_PARAMETER);
+}
+
+void TAO_Notify_ConsumerAdmin::set_qos (const CosNotification::QoSProperties & qos ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotification::UnsupportedQoS
+ ))
+{
+ this->TAO_Notify_Object::set_qos (qos ACE_ENV_ARG_PARAMETER);
+}
+
+
+CosNotification::QoSProperties*
+TAO_Notify_ConsumerAdmin::get_qos (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->TAO_Notify_Object::get_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_ConsumerAdmin::subscription_change (const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyComm::InvalidEventType
+ ))
+{
+ TAO_Notify_EventTypeSeq seq_added (added);
+ TAO_Notify_EventTypeSeq seq_removed (removed);
+
+ {
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ this->subscribed_types_.add_and_remove (seq_added, seq_removed);
+
+ TAO_Notify_Subscription_Change_Worker worker (added, removed);
+
+ this->proxy_container().collection()->for_each (&worker ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CosNotifyFilter::FilterID
+TAO_Notify_ConsumerAdmin::add_filter (CosNotifyFilter::Filter_ptr new_filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ CosNotifyFilter::FilterID fid =
+ this->filter_admin_.add_filter (new_filter ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (fid);
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (fid);
+ return fid;
+}
+
+void
+TAO_Notify_ConsumerAdmin::remove_filter (CosNotifyFilter::FilterID filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyFilter::FilterNotFound
+ ))
+{
+ this->filter_admin_.remove_filter (filter ACE_ENV_ARG_PARAMETER);
+}
+
+::CosNotifyFilter::Filter_ptr
+TAO_Notify_ConsumerAdmin::get_filter (CosNotifyFilter::FilterID filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyFilter::FilterNotFound
+ ))
+{
+ return this->filter_admin_.get_filter (filter ACE_ENV_ARG_PARAMETER);
+}
+
+::CosNotifyFilter::FilterIDSeq*
+TAO_Notify_ConsumerAdmin::get_all_filters (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->filter_admin_.get_all_filters (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_ConsumerAdmin::remove_all_filters (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ this->filter_admin_.remove_all_filters (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+/************ UNIMPLMENTED METHODS *************************/
+
+CosNotifyFilter::MappingFilter_ptr
+TAO_Notify_ConsumerAdmin::priority_filter (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CosNotifyFilter::MappingFilter::_nil ());
+}
+
+void
+TAO_Notify_ConsumerAdmin::priority_filter (CosNotifyFilter::MappingFilter_ptr /*priority_filter*/ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+CosNotifyFilter::MappingFilter_ptr
+TAO_Notify_ConsumerAdmin::lifetime_filter (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CosNotifyFilter::MappingFilter::_nil ());
+}
+
+void
+TAO_Notify_ConsumerAdmin::lifetime_filter (CosNotifyFilter::MappingFilter_ptr /*lifetime_filter*/ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+::CosNotifyChannelAdmin::ProxyIDSeq*
+TAO_Notify_ConsumerAdmin::pull_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+CosNotifyChannelAdmin::ProxySupplier_ptr
+TAO_Notify_ConsumerAdmin::obtain_notification_pull_supplier (CosNotifyChannelAdmin::ClientType /*ctype*/,
+ CosNotifyChannelAdmin::ProxyID_out /*proxy_id*/
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::AdminLimitExceeded
+ ))
+
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CosNotifyChannelAdmin::ProxySupplier::_nil ());
+}
+
+void
+TAO_Notify_ConsumerAdmin::validate_qos (const CosNotification::QoSProperties & /*required_qos*/,
+ CosNotification::NamedPropertyRangeSeq_out /*available_qos*/
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotification::UnsupportedQoS
+ ))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+CosEventChannelAdmin::ProxyPullSupplier_ptr
+TAO_Notify_ConsumerAdmin::obtain_pull_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CosEventChannelAdmin::ProxyPullSupplier::_nil ());
+}
+
+TAO_Notify_ProxySupplier *
+TAO_Notify_ConsumerAdmin::find_proxy_supplier (
+ TAO_Notify::IdVec & id_path,
+ size_t position
+ ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_ProxySupplier * result = 0;
+ size_t path_size = id_path.size ();
+ if (position < path_size)
+ {
+ TAO_Notify_ProxySupplier_Find_Worker find_worker;
+ TAO_Notify_Proxy * proxy = find_worker.find (id_path[position], this->proxy_container() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ result = dynamic_cast <TAO_Notify_ProxySupplier *> (proxy);
+ }
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.h b/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.h
new file mode 100644
index 00000000000..a17453cfc07
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.h
@@ -0,0 +1,254 @@
+/* -*- C++ -*- */
+/**
+ * @file ConsumerAdmin.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_CONSUMERADMIN_H
+#define TAO_Notify_CONSUMERADMIN_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/NotifyExtS.h"
+
+#include "orbsvcs/Notify/Admin.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_ProxySupplier;
+
+/**
+ * @class TAO_Notify_ConsumerAdmin
+ *
+ * @brief Implementation of CosNotifyChannelAdmin::ConsumerAdmin
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_ConsumerAdmin : public POA_NotifyExt::ConsumerAdmin
+ , public virtual TAO_Notify_Admin
+{
+public:
+ typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_ConsumerAdmin > Ptr;
+ /// Constuctor
+ TAO_Notify_ConsumerAdmin (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_ConsumerAdmin ();
+
+ /// Init
+ void init (TAO_Notify_EventChannel *ec ACE_ENV_ARG_DECL);
+
+ /// ServantBase refcount methods.
+ virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL);
+
+
+ virtual const char * get_admin_type_name () const;
+
+ virtual TAO_Notify::Topology_Object* load_child (
+ const ACE_CString &type,
+ CORBA::Long id,
+ const TAO_Notify::NVPList& attrs
+ ACE_ENV_ARG_DECL);
+
+ TAO_Notify_ProxySupplier * find_proxy_supplier (
+ TAO_Notify::IdVec & id_path,
+ size_t position
+ ACE_ENV_ARG_DECL);
+
+protected:
+ TAO_Notify::Topology_Object *load_proxy (
+ CORBA::Long id,
+ CosNotifyChannelAdmin::ClientType ctype,
+ const TAO_Notify::NVPList& attrs
+ ACE_ENV_ARG_DECL);
+
+ /// = NotifyExt::ConsumerAdmin methods
+ virtual CosNotifyChannelAdmin::ProxySupplier_ptr
+ obtain_notification_push_supplier_with_qos (CosNotifyChannelAdmin::ClientType ctype,
+ CosNotifyChannelAdmin::ProxyID_out proxy_id,
+ const CosNotification::QoSProperties & initial_qos
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::AdminLimitExceeded
+ , CosNotification::UnsupportedQoS
+ ));
+
+ /// = CosNotifyChannelAdmin::ConsumerAdmin methods
+ virtual CosNotifyChannelAdmin::AdminID MyID (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotifyChannelAdmin::EventChannel_ptr MyChannel (ACE_ENV_SINGLE_ARG_DECL
+
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotifyChannelAdmin::InterFilterGroupOperator MyOperator (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotifyFilter::MappingFilter_ptr priority_filter (ACE_ENV_SINGLE_ARG_DECL
+
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void priority_filter (CosNotifyFilter::MappingFilter_ptr priority_filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotifyFilter::MappingFilter_ptr lifetime_filter (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void lifetime_filter (CosNotifyFilter::MappingFilter_ptr lifetime_filter
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotifyChannelAdmin::ProxyIDSeq * pull_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotifyChannelAdmin::ProxyIDSeq * push_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotifyChannelAdmin::ProxySupplier_ptr get_proxy_supplier (CosNotifyChannelAdmin::ProxyID proxy_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::ProxyNotFound
+ ));
+
+ virtual ::CosNotifyChannelAdmin::ProxySupplier_ptr
+ obtain_notification_pull_supplier (CosNotifyChannelAdmin::ClientType ctype,
+ CosNotifyChannelAdmin::ProxyID_out proxy_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::AdminLimitExceeded
+ ));
+
+ virtual ::CosNotifyChannelAdmin::ProxySupplier_ptr
+ obtain_notification_push_supplier (CosNotifyChannelAdmin::ClientType ctype,
+ CosNotifyChannelAdmin::ProxyID_out proxy_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::AdminLimitExceeded
+ ));
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotification::QoSProperties * get_qos (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void set_qos (const CosNotification::QoSProperties & qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotification::UnsupportedQoS
+ ));
+
+ virtual void validate_qos (const CosNotification::QoSProperties & required_qos,
+ CosNotification::NamedPropertyRangeSeq_out available_qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotification::UnsupportedQoS
+ ));
+
+ virtual void subscription_change (const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyComm::InvalidEventType
+ ));
+
+ virtual CosNotifyFilter::FilterID add_filter (CosNotifyFilter::Filter_ptr new_filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void remove_filter (CosNotifyFilter::FilterID filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyFilter::FilterNotFound
+ ));
+
+ virtual ::CosNotifyFilter::Filter_ptr get_filter (CosNotifyFilter::FilterID filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyFilter::FilterNotFound
+ ));
+
+ virtual ::CosNotifyFilter::FilterIDSeq * get_all_filters (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void remove_all_filters (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosEventChannelAdmin::ProxyPushSupplier_ptr obtain_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosEventChannelAdmin::ProxyPullSupplier_ptr obtain_pull_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+private:
+
+ /// Release this object.
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_CONSUMERADMIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer_Map.h b/TAO/orbsvcs/orbsvcs/Notify/Consumer_Map.h
new file mode 100644
index 00000000000..eec7e570347
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer_Map.h
@@ -0,0 +1,43 @@
+/* -*- C++ -*- */
+/**
+ * @file Consumer_Map.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_CONSUMER_MAP_H
+#define TAO_Notify_CONSUMER_MAP_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+#include "orbsvcs/Notify/Event_Map_T.h"
+#include "orbsvcs/Notify/ProxySupplier.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Consumer_Map
+ *
+ * @brief The Event Map for Consumers.
+ *
+ */
+typedef TAO_Notify_Event_Map_T<TAO_Notify_ProxySupplier,
+ TAO_SYNCH_RW_MUTEX>
+ TAO_Notify_Consumer_Map;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_CONSUMER_MAP_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Container_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Container_T.cpp
new file mode 100644
index 00000000000..3656e3dca86
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Container_T.cpp
@@ -0,0 +1,65 @@
+// $Id$
+
+#ifndef TAO_Notify_CONTAINER_T_CPP
+#define TAO_Notify_CONTAINER_T_CPP
+
+#include "orbsvcs/Notify/Container_T.h"
+
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/Factory.h"
+#include "orbsvcs/Notify/POA_Helper.h"
+
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+#include "orbsvcs/ESF/ESF_Shutdown_Proxy.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Container_T.inl"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class TYPE>
+TAO_Notify_Container_T<TYPE>::TAO_Notify_Container_T (void)
+ : collection_ (0)
+{
+}
+
+template<class TYPE>
+TAO_Notify_Container_T<TYPE>::~TAO_Notify_Container_T ()
+{
+ delete collection_;
+}
+
+template <class TYPE> void
+TAO_Notify_Container_T<TYPE>::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_ESF_Shutdown_Proxy<TYPE> shutdown_worker;
+
+ this->collection_->for_each (&shutdown_worker ACE_ENV_ARG_PARAMETER);
+}
+
+template<class TYPE> void
+TAO_Notify_Container_T<TYPE>::insert (TYPE* type ACE_ENV_ARG_DECL)
+{
+ this->collection_->connected (type ACE_ENV_ARG_PARAMETER);
+}
+
+template<class TYPE> void
+TAO_Notify_Container_T<TYPE>::remove (TYPE* type ACE_ENV_ARG_DECL)
+{
+ this->collection_->disconnected (type ACE_ENV_ARG_PARAMETER);
+}
+
+template<class TYPE> void
+TAO_Notify_Container_T<TYPE>::init (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // get the factory
+ TAO_Notify_Factory* factory = TAO_Notify_PROPERTIES::instance ()->factory ();
+
+ // Init variables
+ factory->create (this->collection_ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_Notify_CONTAINER_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Container_T.h b/TAO/orbsvcs/orbsvcs/Notify/Container_T.h
new file mode 100644
index 00000000000..9c06930d1b2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Container_T.h
@@ -0,0 +1,82 @@
+/* -*- C++ -*- */
+/**
+ * @file Container_T.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_CONTAINER_T_H
+#define TAO_Notify_CONTAINER_T_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Container_T
+ *
+ * @brief A template class that manages a collection.
+ * TYPE = type of collection
+ *
+ */
+template <class TYPE>
+class TAO_Notify_Serv_Export TAO_Notify_Container_T
+{
+ typedef TAO_ESF_Proxy_Collection<TYPE> COLLECTION;
+ public:
+
+ /// Constuctor
+ TAO_Notify_Container_T (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Container_T ();
+
+ /// Init this object.
+ void init (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Insert object to this container.
+ virtual void insert (TYPE* type ACE_ENV_ARG_DECL);
+
+ /// Remove type from container_
+ virtual void remove (TYPE* type ACE_ENV_ARG_DECL);
+
+ /// Shutdown
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Collection
+ COLLECTION* collection (void);
+
+protected:
+ /// The collection data structure that we add objects to.
+ COLLECTION* collection_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Container_T.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Notify/Container_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Container_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_CONTAINER_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Container_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Container_T.inl
new file mode 100644
index 00000000000..ccf274aecbf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Container_T.inl
@@ -0,0 +1,13 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class TYPE> ACE_INLINE ACE_TYPENAME TAO_Notify_Container_T<TYPE>::COLLECTION*
+TAO_Notify_Container_T<TYPE>:: collection (void)
+{
+ return this->collection_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Initializer.cpp b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Initializer.cpp
new file mode 100644
index 00000000000..86d6e46106a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Initializer.cpp
@@ -0,0 +1,17 @@
+// $Id$
+
+#include "orbsvcs/Notify/CosNotify_Initializer.h"
+
+ACE_RCSID(Notify, TAO_Notify_CosNotify_Initializer, "$Id$")
+
+#include "orbsvcs/Notify/CosNotify_Service.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_CosNotify_Initializer::TAO_Notify_CosNotify_Initializer (void)
+{
+ ACE_Service_Config::static_svcs ()->insert (&ace_svc_desc_TAO_CosNotify_Service);
+ ACE_Service_Config::static_svcs ()->insert (&ace_svc_desc_TAO_Notify_Default_EMO_Factory_OLD);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Initializer.h b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Initializer.h
new file mode 100644
index 00000000000..ce08ffd76eb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Initializer.h
@@ -0,0 +1,44 @@
+/* -*- C++ -*- */
+/**
+ * @file CosNotify_Initializer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_COSNOTIFY_INITIALIZER_H
+#define TAO_Notify_COSNOTIFY_INITIALIZER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_CosNotify_Initializer
+ *
+ * @brief Helper to load the Cos Notification service into the service conf. for static links.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_CosNotify_Initializer
+{
+public:
+ /// Constuctor
+ TAO_Notify_CosNotify_Initializer (void);
+};
+
+static TAO_Notify_CosNotify_Initializer TAO_Notify_CosNotify_initializer;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_COSNOTIFY_INITIALIZER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp
new file mode 100644
index 00000000000..2128c1852a4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp
@@ -0,0 +1,314 @@
+// $Id$
+
+#include "orbsvcs/Notify/CosNotify_Service.h"
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/Default_Factory.h"
+#include "orbsvcs/Notify/Builder.h"
+#include "ace/Sched_Params.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/Dynamic_Service.h"
+#include "tao/ORB_Core.h"
+#include "orbsvcs/NotifyExtC.h"
+#include "tao/debug.h"
+
+ACE_RCSID (Notify,
+ TAO_CosNotify_Service,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_CosNotify_Service::TAO_CosNotify_Service (void)
+{
+}
+
+TAO_CosNotify_Service::~TAO_CosNotify_Service ()
+{
+}
+
+int
+TAO_CosNotify_Service::init (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ const ACE_TCHAR *current_arg = 0;
+
+ // Default to an all reactive system.
+ int ec_threads = 0;
+ int consumer_threads = 0;
+ int supplier_threads = 0;
+
+ int task_per_proxy = 0;
+
+ TAO_Notify_Properties *properties = TAO_Notify_PROPERTIES::instance();
+
+ while (arg_shifter.is_anything_left ())
+ {
+ if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-MTDispatching")) == 0)
+ {
+ arg_shifter.consume_arg ();
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) The -MTDispatching option has been deprecated, use -DispatchingThreads \n")));
+ }
+ else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-DispatchingThreads"))))
+ {
+ consumer_threads += ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-MTSourceEval")) == 0)
+ {
+ arg_shifter.consume_arg ();
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) The -MTSourceEval option has been deprecated, use -SourceThreads \n")));
+ }
+ else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-SourceThreads"))))
+ {
+ supplier_threads += ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-MTLookup")) == 0)
+ {
+ arg_shifter.consume_arg ();
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) The -MTLookup option has been deprecated, use -SourceThreads \n")));
+ }
+ else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-LookupThreads"))))
+ {
+ supplier_threads += ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) The -LookupThreads option has been deprecated, use -SourceThreads \n")));
+ }
+ else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-MTListenerEval")) == 0)
+ {
+ arg_shifter.consume_arg ();
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) The -MTListenerEval option has been deprecated, use -DispatchingThreads \n")));
+ }
+ else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ListenerThreads"))))
+ {
+ // Since this option is always added to consumer_threads, we'll
+ // deprecate it in favor of that option.
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) The -ListenerThreads option has been deprecated, use -DispatchingThreads \n")));
+ consumer_threads += ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-AsynchUpdates")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ properties->asynch_updates (1);
+ }
+ else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-NoUpdates")) == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ properties->updates (0);
+ }
+ else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-AllocateTaskperProxy")) == 0)
+ {
+ task_per_proxy = 1;
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-AllowReconnect")) == 0)
+ {
+ arg_shifter.consume_arg ();
+ TAO_Notify_PROPERTIES::instance()->allow_reconnect (true);
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Ignoring unknown option for Notify Factory: %s\n"),
+ arg_shifter.get_current()
+ ));
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ // Init the EC QoS
+ {
+ CosNotification::QoSProperties qos;
+ this->set_threads (qos, ec_threads);
+ properties->default_event_channel_qos_properties (qos);
+ }
+
+ if (task_per_proxy == 0)
+ {
+ // Set the per ConsumerAdmin QoS
+ {
+ if (consumer_threads > 0)
+ ACE_DEBUG((LM_DEBUG, "Using %d threads for each ConsumerAdmin.\n", consumer_threads));
+ CosNotification::QoSProperties qos;
+ this->set_threads (qos, consumer_threads);
+ properties->default_consumer_admin_qos_properties (qos);
+ }
+
+ // Set the per SupplierAdmin QoS
+ {
+ if (supplier_threads > 0)
+ ACE_DEBUG((LM_DEBUG, "Using %d threads for each SupplierAdmin.\n", supplier_threads));
+ CosNotification::QoSProperties qos;
+ this->set_threads (qos, supplier_threads);
+ properties->default_supplier_admin_qos_properties (qos);
+ }
+ }
+ else
+ {
+ // Set the per ProxyConsumer QoS
+ {
+ if (supplier_threads > 0)
+ ACE_DEBUG((LM_DEBUG, "Using %d threads for each Supplier.\n", supplier_threads));
+ CosNotification::QoSProperties qos;
+ this->set_threads (qos, supplier_threads); // lookup thread per proxy doesn't make sense.
+ properties->default_proxy_consumer_qos_properties (qos);
+ }
+
+ // Set the per ProxySupplier QoS
+ {
+ if (consumer_threads > 0)
+ ACE_DEBUG((LM_DEBUG, "Using %d threads for each Consumer.\n", consumer_threads));
+ CosNotification::QoSProperties qos;
+ this->set_threads (qos, consumer_threads);
+ properties->default_proxy_supplier_qos_properties (qos);
+ }
+ }
+
+ return 0;
+}
+
+void
+TAO_CosNotify_Service::set_threads (CosNotification::QoSProperties &qos, int threads)
+{
+ NotifyExt::ThreadPoolParams tp_params =
+ {NotifyExt::CLIENT_PROPAGATED, 0, 0, (unsigned)threads, 0, 0, 0, 0, 0 };
+
+ qos.length (1);
+ qos[0].name = CORBA::string_dup (NotifyExt::ThreadPool);
+ qos[0].value <<= tp_params;
+}
+
+int
+TAO_CosNotify_Service::fini (void)
+{
+ return 0;
+}
+
+void
+TAO_CosNotify_Service::init_service (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG, "Loading the Cos Notification Service...\n"));
+
+ this->init_i (orb ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_CosNotify_Service::init_i (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
+{
+ // Obtain the Root POA
+ CORBA::Object_var object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (object.in ()))
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable to resolve the RootPOA.\n"));
+
+ PortableServer::POA_var default_poa = PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ /// Set the properties
+ TAO_Notify_Properties* properties = TAO_Notify_PROPERTIES::instance();
+
+ properties->orb (orb);
+ properties->default_poa (default_poa.in ());
+
+ // Init the factory
+ this->factory_.reset (this->create_factory (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+ ACE_ASSERT( this->factory_.get() != 0 );
+ TAO_Notify_PROPERTIES::instance()->factory (this->factory_.get());
+
+ this->builder_.reset (this->create_builder (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+ ACE_ASSERT( this->builder_.get() != 0 );
+ TAO_Notify_PROPERTIES::instance()->builder (this->builder_.get());
+}
+
+TAO_Notify_Factory*
+TAO_CosNotify_Service::create_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Factory* factory = ACE_Dynamic_Service<TAO_Notify_Factory>::instance ("TAO_Notify_Factory");
+ if (factory == 0)
+ {
+ ACE_NEW_THROW_EX (factory,
+ TAO_Notify_Default_Factory (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+ }
+ return factory;
+}
+
+TAO_Notify_Builder*
+TAO_CosNotify_Service::create_builder (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Builder* builder = 0;
+ ACE_NEW_THROW_EX (builder,
+ TAO_Notify_Builder (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ return builder;
+}
+
+CosNotifyChannelAdmin::EventChannelFactory_ptr
+TAO_CosNotify_Service::create (PortableServer::POA_ptr poa ACE_ENV_ARG_DECL)
+{
+ return this->builder().build_event_channel_factory (poa ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_CosNotify_Service::remove (TAO_Notify_EventChannelFactory* /*ecf*/ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ // NOP.
+}
+
+TAO_Notify_Factory&
+TAO_CosNotify_Service::factory (void)
+{
+ ACE_ASSERT( this->factory_.get() != 0 );
+ return *this->factory_;
+}
+
+TAO_Notify_Builder&
+TAO_CosNotify_Service::builder (void)
+{
+ ACE_ASSERT( this->builder_.get() != 0 );
+ return *this->builder_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+/*********************************************************************************************************************/
+
+ACE_STATIC_SVC_DEFINE (TAO_Notify_Default_EMO_Factory_OLD,
+ ACE_TEXT (TAO_NOTIFY_DEF_EMO_FACTORY_NAME),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_CosNotify_Service),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+/*********************************************************************************************************************/
+
+ACE_STATIC_SVC_DEFINE (TAO_CosNotify_Service,
+ ACE_TEXT (TAO_COS_NOTIFICATION_SERVICE_NAME),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_CosNotify_Service),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+
+ACE_FACTORY_DEFINE (TAO_Notify_Serv, TAO_CosNotify_Service)
+
+/*********************************************************************************************************************/
diff --git a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h
new file mode 100644
index 00000000000..cc91e77d372
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h
@@ -0,0 +1,95 @@
+/* -*- C++ -*- */
+/**
+ * @file CosNotify_Service.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_COSNOTIFY_SERVICE_H
+#define TAO_Notify_COSNOTIFY_SERVICE_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Service.h"
+#include "orbsvcs/Notify/Builder.h"
+#include "orbsvcs/Notify/Factory.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Properties;
+class TAO_Notify_EventChannelFactory;
+
+/**
+ * @class TAO_CosNotify_Service
+ *
+ * @brief A service object for creating the Notify Service Factory.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_CosNotify_Service : public TAO_Notify_Service
+{
+public:
+ /// Constuctor
+ TAO_CosNotify_Service (void);
+
+ /// Destructor
+ virtual ~TAO_CosNotify_Service ();
+
+ /// Init the service from configurator
+ virtual int init (int argc, ACE_TCHAR *argv[]);
+
+ /// Init the service from driver
+ virtual void init_service (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);
+
+ virtual int fini (void);
+
+ /// Create the Channel Factory.
+ virtual CosNotifyChannelAdmin::EventChannelFactory_ptr create (PortableServer::POA_ptr default_POA ACE_ENV_ARG_DECL);
+
+ /// Called by the factory when it is destroyed.
+ virtual void remove (TAO_Notify_EventChannelFactory* ecf ACE_ENV_ARG_DECL);
+
+protected:
+ /// Init the data members
+ virtual void init_i (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);
+
+private:
+
+ /// Create the Factory for Notify objects.
+ virtual TAO_Notify_Factory* create_factory (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Create the Builder for Notify objects.
+ virtual TAO_Notify_Builder* create_builder (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Set thread options on <qos>.
+ void set_threads (CosNotification::QoSProperties &qos, int threads);
+
+ TAO_Notify_Factory& factory();
+
+ /// Service component for building NS participants.
+ TAO_Notify_Builder& builder();
+
+ /// Service component for object factory operations.
+ ACE_Auto_Ptr< TAO_Notify_Factory > factory_;
+
+ /// Service component for building NS participants.
+ ACE_Auto_Ptr< TAO_Notify_Builder > builder_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (TAO_CosNotify_Service)
+ACE_FACTORY_DECLARE (TAO_Notify_Serv, TAO_CosNotify_Service)
+
+ACE_STATIC_SVC_DECLARE (TAO_Notify_Default_EMO_Factory_OLD)
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_COSNOTIFY_SERVICE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Default_Factory.cpp b/TAO/orbsvcs/orbsvcs/Notify/Default_Factory.cpp
new file mode 100644
index 00000000000..990da34bdbc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Default_Factory.cpp
@@ -0,0 +1,197 @@
+// $Id$
+
+#include "orbsvcs/Notify/Default_Factory.h"
+
+ACE_RCSID (Notify,
+ TAO_Notify_Default_Factory,
+ "$Id$")
+
+#include "orbsvcs/Notify/EventChannelFactory.h"
+#include "orbsvcs/Notify/EventChannel.h"
+#include "orbsvcs/Notify/Admin.h"
+#include "orbsvcs/Notify/Proxy.h"
+#include "orbsvcs/Notify/SupplierAdmin.h"
+#include "orbsvcs/Notify/ConsumerAdmin.h"
+#include "orbsvcs/Notify/Structured/StructuredProxyPushConsumer.h"
+#include "orbsvcs/Notify/Structured/StructuredProxyPushSupplier.h"
+#include "orbsvcs/Notify/Any/ProxyPushConsumer.h"
+#include "orbsvcs/Notify/Any/ProxyPushSupplier.h"
+#include "orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.h"
+#include "orbsvcs/Notify/Any/CosEC_ProxyPushSupplier.h"
+#include "orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.h"
+#include "orbsvcs/Notify/Sequence/SequenceProxyPushSupplier.h"
+#include "orbsvcs/Notify/Supplier.h"
+
+#include "orbsvcs/ESF/ESF_Proxy_List.h"
+#include "orbsvcs/ESF/ESF_Copy_On_Write.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class PROXY>
+class COW_Collection_Default_Factory
+{
+public:
+ typedef ACE_TYPENAME TAO_ESF_Proxy_List<PROXY>::Iterator PROXY_ITER;
+ typedef TAO_ESF_Copy_On_Write<PROXY, TAO_ESF_Proxy_List<PROXY>,PROXY_ITER, ACE_SYNCH> COLLECTION;
+ typedef TAO_ESF_Proxy_Collection<PROXY> BASE_COLLECTION;
+
+ void create (BASE_COLLECTION* &collection ACE_ENV_ARG_DECL)
+ {
+ ACE_NEW_THROW_EX (collection,
+ COLLECTION (),
+ CORBA::INTERNAL ());
+ }
+};
+
+TAO_Notify_Default_Factory::TAO_Notify_Default_Factory (void)
+{
+}
+
+TAO_Notify_Default_Factory::~TAO_Notify_Default_Factory ()
+{
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_ProxySupplier_Collection* &collection ACE_ENV_ARG_DECL)
+{
+ COW_Collection_Default_Factory<TAO_Notify_ProxySupplier> f;
+ f.create (collection ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_ProxyConsumer_Collection* &collection ACE_ENV_ARG_DECL)
+{
+ COW_Collection_Default_Factory<TAO_Notify_ProxyConsumer> f;
+ f.create (collection ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_EventChannel_Collection* &collection ACE_ENV_ARG_DECL)
+{
+ COW_Collection_Default_Factory<TAO_Notify_EventChannel> f;
+ f.create (collection ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_ConsumerAdmin_Collection* &collection ACE_ENV_ARG_DECL)
+{
+ COW_Collection_Default_Factory<TAO_Notify_ConsumerAdmin> f;
+ f.create (collection ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_SupplierAdmin_Collection* &collection ACE_ENV_ARG_DECL)
+{
+ COW_Collection_Default_Factory<TAO_Notify_SupplierAdmin> f;
+ f.create (collection ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_Proxy_Collection* &collection ACE_ENV_ARG_DECL)
+{
+ COW_Collection_Default_Factory<TAO_Notify_Proxy> f;
+ f.create (collection ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_EventChannelFactory*& factory ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (factory,
+ TAO_Notify_EventChannelFactory (),
+ CORBA::NO_MEMORY ());
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_EventChannel*& channel ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (channel,
+ TAO_Notify_EventChannel (),
+ CORBA::NO_MEMORY ());
+}
+
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_SupplierAdmin*& admin ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (admin,
+ TAO_Notify_SupplierAdmin (),
+ CORBA::NO_MEMORY ());
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_ConsumerAdmin*& admin ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (admin,
+ TAO_Notify_ConsumerAdmin (),
+ CORBA::NO_MEMORY ());
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_StructuredProxyPushConsumer*& proxy ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (proxy,
+ TAO_Notify_StructuredProxyPushConsumer (),
+ CORBA::NO_MEMORY ());
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_StructuredProxyPushSupplier*& proxy ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (proxy,
+ TAO_Notify_StructuredProxyPushSupplier (),
+ CORBA::NO_MEMORY ());
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_ProxyPushConsumer*& proxy ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (proxy,
+ TAO_Notify_ProxyPushConsumer (),
+ CORBA::NO_MEMORY ());
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_ProxyPushSupplier*& proxy ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (proxy,
+ TAO_Notify_ProxyPushSupplier (),
+ CORBA::NO_MEMORY ());
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_CosEC_ProxyPushConsumer*& proxy ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (proxy,
+ TAO_Notify_CosEC_ProxyPushConsumer (),
+ CORBA::NO_MEMORY ());
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_CosEC_ProxyPushSupplier*& proxy ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (proxy,
+ TAO_Notify_CosEC_ProxyPushSupplier (),
+ CORBA::NO_MEMORY ());
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_SequenceProxyPushConsumer*& proxy ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (proxy,
+ TAO_Notify_SequenceProxyPushConsumer (),
+ CORBA::NO_MEMORY ());
+}
+
+void
+TAO_Notify_Default_Factory::create (TAO_Notify_SequenceProxyPushSupplier*& proxy ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (proxy,
+ TAO_Notify_SequenceProxyPushSupplier (),
+ CORBA::NO_MEMORY ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_Notify_Serv, TAO_Notify_Default_Factory)
+
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Default_Factory.h b/TAO/orbsvcs/orbsvcs/Notify/Default_Factory.h
new file mode 100644
index 00000000000..106d7cb265d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Default_Factory.h
@@ -0,0 +1,101 @@
+/* -*- C++ -*- */
+/**
+ * @file Default_Factory.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_DEFAULT_FACTORY_H
+#define TAO_Notify_DEFAULT_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Factory.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Default_Factory
+ *
+ * @brief Default_Factory interface for creating Notify Objects.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Default_Factory : public TAO_Notify_Factory
+{
+public:
+ /// Constructor
+ TAO_Notify_Default_Factory (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Default_Factory ();
+
+ /// Create ProxySupplier Collection
+ virtual void create (TAO_Notify_ProxySupplier_Collection*& collection ACE_ENV_ARG_DECL);
+
+ /// Create ProxyConsumer Collection
+ virtual void create (TAO_Notify_ProxyConsumer_Collection*& collection ACE_ENV_ARG_DECL);
+
+ /// Create EventChannel Collection
+ virtual void create (TAO_Notify_EventChannel_Collection*& collection ACE_ENV_ARG_DECL);
+
+ /// Create ConsumerAdmin Collection
+ virtual void create (TAO_Notify_ConsumerAdmin_Collection*& collection ACE_ENV_ARG_DECL);
+
+ /// Create SupplierAdmin Collection
+ virtual void create (TAO_Notify_SupplierAdmin_Collection*& collection ACE_ENV_ARG_DECL);
+
+ /// Create Proxy Collection
+ virtual void create (TAO_Notify_Proxy_Collection*& collection ACE_ENV_ARG_DECL);
+
+ /// Create EventChannelDefault_Factory
+ virtual void create (TAO_Notify_EventChannelFactory*& channel_factory ACE_ENV_ARG_DECL);
+
+ /// Create EventChannel
+ virtual void create (TAO_Notify_EventChannel*& channel ACE_ENV_ARG_DECL);
+
+ /// Create SupplierAdmin
+ virtual void create (TAO_Notify_SupplierAdmin*& admin ACE_ENV_ARG_DECL);
+
+ /// Create ConsumerAdmin
+ virtual void create (TAO_Notify_ConsumerAdmin*& admin ACE_ENV_ARG_DECL);
+
+ /// Create ProxyPushConsumer
+ virtual void create (TAO_Notify_ProxyPushConsumer*& proxy ACE_ENV_ARG_DECL);
+
+ /// Create ProxyPushSupplier
+ virtual void create (TAO_Notify_ProxyPushSupplier*& proxy ACE_ENV_ARG_DECL);
+
+ /// Create CosEC_ProxyPushConsumer
+ virtual void create (TAO_Notify_CosEC_ProxyPushConsumer*& proxy ACE_ENV_ARG_DECL);
+
+ /// Create CosEC_ProxyPushSupplier
+ virtual void create (TAO_Notify_CosEC_ProxyPushSupplier*& proxy ACE_ENV_ARG_DECL);
+
+ /// Create StructuredProxyPushConsumer
+ virtual void create (TAO_Notify_StructuredProxyPushConsumer*& proxy ACE_ENV_ARG_DECL);
+
+ /// Create StructuredProxyPushSupplier
+ virtual void create (TAO_Notify_StructuredProxyPushSupplier*& proxy ACE_ENV_ARG_DECL);
+
+ /// Create SequenceProxyPushConsumer
+ virtual void create (TAO_Notify_SequenceProxyPushConsumer*& proxy ACE_ENV_ARG_DECL);
+
+ /// Create SequenceProxyPushSupplier
+ virtual void create (TAO_Notify_SequenceProxyPushSupplier*& proxy ACE_ENV_ARG_DECL);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DECLARE (TAO_Notify_Serv, TAO_Notify_Default_Factory)
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_DEFAULT_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Delivery_Request.cpp b/TAO/orbsvcs/orbsvcs/Notify/Delivery_Request.cpp
new file mode 100644
index 00000000000..a40986b1a0c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Delivery_Request.cpp
@@ -0,0 +1,103 @@
+// $Id$
+
+#include "orbsvcs/Notify/Delivery_Request.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Delivery_Request.inl"
+#endif /* __ACE_INLINE__ */
+
+#include "orbsvcs/Notify/Routing_Slip.h"
+
+#include "tao/debug.h"
+#include "tao/corba.h"
+
+//#define DEBUG_LEVEL 9
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+
+///////////////////
+// Delivery_Request
+Delivery_Request::Delivery_Request (const Routing_Slip_Ptr & routing_slip, size_t request_id)
+ : routing_slip_ (routing_slip)
+ , request_id_ (request_id)
+ , delivery_type_ (0)
+{
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Delivery_Request:: constructor\n")
+ ));
+}
+
+Delivery_Request::~Delivery_Request ()
+{
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Delivery_Request:: destructor\n")
+ ));
+}
+
+// DO NOT INLINE THIS. It uses the Routing_Slip_Ptr which cannot be declared at
+// the time Delivery_Request.inl is compiled.
+void
+Delivery_Request::complete ()
+{
+ routing_slip_->delivery_request_complete (this->request_id_);
+}
+
+// DO NOT INLINE THIS. It uses the Routing_Slip_Ptr which cannot be declared at
+// the time Delivery_Request.inl is compiled.
+const TAO_Notify_Event::Ptr &
+Delivery_Request::event () const
+{
+ return this->routing_slip_->event ();
+}
+
+void
+Delivery_Request::marshal (TAO_OutputCDR & cdr)
+{
+ if (this->delivery_type_ != 0)
+ {
+ cdr.write_octet (this->delivery_type_);
+ size_t dest_count = this->destination_id_.size ();
+ cdr.write_ulong (dest_count);
+ for (size_t ndest = 0; ndest < dest_count; ++ ndest)
+ {
+ cdr.write_ulong (this->destination_id_ [ndest]);
+ }
+ }
+}
+
+unsigned long
+Delivery_Request::sequence () const
+{
+ return this->routing_slip_->sequence ();
+}
+
+
+bool
+Delivery_Request::should_retry () const
+{
+ return this->routing_slip_->should_retry ();
+}
+
+void
+Delivery_Request::dispatch (
+ TAO_Notify_ProxySupplier * proxy_supplier,
+ bool filter ACE_ENV_ARG_DECL)
+{
+ this->routing_slip_->dispatch (proxy_supplier, filter ACE_ENV_ARG_PARAMETER);
+}
+
+const Routing_Slip_Ptr &
+Delivery_Request::routing_slip () const
+{
+ return this->routing_slip_;
+}
+
+} // namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Delivery_Request.h b/TAO/orbsvcs/orbsvcs/Notify/Delivery_Request.h
new file mode 100644
index 00000000000..744bca7d733
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Delivery_Request.h
@@ -0,0 +1,135 @@
+/* -*- C++ -*- */
+// $Id$
+
+#ifndef TAO_NOTIFY_DELIVERY_REQUEST_H
+#define TAO_NOTIFY_DELIVERY_REQUEST_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+#include "orbsvcs/Notify/Topology_Object.h"
+#include "orbsvcs/Notify/Event.h"
+#include <ace/Vector_T.h>
+#include <ace/Bound_Ptr.h>
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward declarations of referenced classes
+class TAO_Notify_EventChannelFactory;
+class TAO_Notify_ProxySupplier;
+
+namespace TAO_Notify
+{
+
+// Forward declarations of TAO_Notify classes/pointers/collections declared
+// in this header
+class Delivery_Request;
+/// A reference-counted smart pointer to a Delivery_Request.
+typedef ACE_Strong_Bound_Ptr<Delivery_Request, TAO_SYNCH_MUTEX> Delivery_Request_Ptr;
+
+typedef ACE_Unbounded_Queue<Delivery_Request_Ptr> Delivery_Request_Queue;
+
+// Forward declarations of TAO_Notify classes/pointers/collections referenced
+// in this header
+
+class Routing_Slip;
+typedef ACE_Strong_Bound_Ptr<Routing_Slip, TAO_SYNCH_MUTEX> Routing_Slip_Ptr;
+
+/// \brief Represents a request to deliver an event to a particular destination.
+///
+/// A Routing Slip contains a collection of Delivery Requests.
+/// A Delivery Request is associated with a Delivery Method. Delivery Methods
+/// should be lightweight objects because they are copied, queued, and otherwise
+/// passed around while they are waiting to be executed. The Delivery Request is
+/// more stable.
+class TAO_Notify_Serv_Export Delivery_Request
+{
+public:
+ /// Normal constructor
+ /// \param routing_slip the routing slip that owns this Delivery Request.
+ /// \param request_id an id that identifies this Delivery Request to the Routing Slip.
+ Delivery_Request (const Routing_Slip_Ptr & routing_slip, size_t request_id);
+
+ /// \brief A static "factory" method for use during restart.
+ ///
+ /// \param routing_slip. The routing slip to which the new Delivery Request should be attached.
+ /// \param request_id The id used to identify this Delivery Request to the Routing Slip.
+ /// \param ecf The EventChannelFactory responsible for reloading this Delivery Method.
+ /// \param cdr A CDR stream from which the peristent information for this Delivery Requect can be retrieved.
+ /// \return a pointer to the newly-allocated Delivery Request
+ static Delivery_Request_Ptr create (
+ const Routing_Slip_Ptr & routing_slip,
+ size_t request_id,
+ TAO_Notify_EventChannelFactory & ecf,
+ TAO_InputCDR & cdr);
+
+ /// a normal destructor.
+ ~Delivery_Request ();
+
+ /// \brief A method to indicate the delivery is complete.
+ ///
+ /// To be called by the delivery method associated with this delivery request.
+ void complete ();
+
+ /// \brief An accessor method for the event associated with the Routing Slip that owns this Delivery request.
+ const TAO_Notify_Event::Ptr & event () const;
+
+ /// \brief An accessor method for the routing slip that owns this request.
+ const Routing_Slip_Ptr & routing_slip ()const;
+
+ /// \brief Capture Delivery Type for the Delivery Method
+ ///
+ /// Called by the delivery method to capture information that should be persisted.
+ void set_delivery_type (ACE_CDR::Octet type);
+
+ /// \brief Capture destination ID for the Delivery Request.
+ ///
+ /// Called by the delivery method to capture information that should be persisted.
+ void set_destination_id (IdVec & destination_id);
+
+ /// \brief Marshal peristent information for this delivery request and its delivery methods into a CDR stream.
+ ///
+ /// Called during persistent event storage.
+ void marshal (TAO_OutputCDR & cdr);
+
+ /// expose routing slip method
+ unsigned long sequence () const;
+
+ /// expose routing slip method
+ bool should_retry () const;
+
+ /// expose routing slip method
+ void dispatch (TAO_Notify_ProxySupplier * proxy_supplier, bool filter ACE_ENV_ARG_DECL);
+
+ // Meaningless, but needed by ACE_Vector on some platforms (gcc2.x LynxOS)
+ bool operator == (const Delivery_Request & rhs) const;
+ // Meaningless, but needed by ACE_Vector on some platforms
+ bool operator != (const Delivery_Request & rhs) const;
+
+private:
+ /// No null constructor.
+ Delivery_Request ();
+ /// No copy constructor.
+ Delivery_Request (const Delivery_Request & rhs);
+ /// no assignment operator
+ Delivery_Request & operator = (const Delivery_Request & rhs);
+
+private:
+ Routing_Slip_Ptr routing_slip_;
+ size_t request_id_;
+ ACE_CDR::Octet delivery_type_;
+ IdVec destination_id_;
+};
+
+} // namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Delivery_Request.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_NOTIFY_DELIVERY_REQUEST_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Delivery_Request.inl b/TAO/orbsvcs/orbsvcs/Notify/Delivery_Request.inl
new file mode 100644
index 00000000000..a34687b5c64
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Delivery_Request.inl
@@ -0,0 +1,27 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+
+ACE_INLINE
+void
+Delivery_Request::set_delivery_type (ACE_CDR::Octet type)
+{
+ this->delivery_type_ = type;
+}
+
+ACE_INLINE
+void
+Delivery_Request::set_destination_id (IdVec & destination_id)
+{
+ this->destination_id_ = destination_id;
+}
+
+} // namespace TAO_Notify
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp b/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp
new file mode 100644
index 00000000000..ca9765dc57e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp
@@ -0,0 +1,448 @@
+// $Id$
+
+#include "orbsvcs/Notify/ETCL_Filter.h"
+
+ACE_RCSID(Notify,
+ TAO_Notify_ETCL_Filter,
+ "$Id$")
+
+#include "ace/Auto_Ptr.h"
+#include "tao/debug.h"
+#include "orbsvcs/Notify/Notify_Constraint_Visitors.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_ETCL_Filter::TAO_Notify_ETCL_Filter (void)
+ :constraint_expr_ids_ (0)
+{
+}
+
+TAO_Notify_ETCL_Filter::~TAO_Notify_ETCL_Filter ()
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->remove_all_constraints (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Error in Filter dtor\n"));
+
+ // @@ eat exception.
+ }
+ ACE_ENDTRY;
+
+ if (TAO_debug_level > 1)
+ ACE_DEBUG ((LM_DEBUG, "Filter Destroyed\n"));
+}
+
+char*
+TAO_Notify_ETCL_Filter::constraint_grammar (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return CORBA::string_dup ("ETCL");
+}
+
+void
+TAO_Notify_ETCL_Filter::add_constraints_i (const CosNotifyFilter::ConstraintInfoSeq& constraint_info_seq
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::InvalidConstraint
+ ))
+{
+ for (CORBA::ULong index = 0; index < constraint_info_seq.length (); ++index)
+ {
+ TAO_Notify_Constraint_Expr* notify_constr_expr;
+
+ ACE_NEW_THROW_EX (notify_constr_expr,
+ TAO_Notify_Constraint_Expr (),
+ CORBA::NO_MEMORY ());
+ auto_ptr <TAO_Notify_Constraint_Expr> auto_expr (notify_constr_expr);
+
+ const CosNotifyFilter::ConstraintExp& expr =
+ constraint_info_seq[index].constraint_expression;
+
+ notify_constr_expr->interpreter.
+ build_tree (expr.constraint_expr.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ notify_constr_expr->constr_expr = expr;
+
+ CosNotifyFilter::ConstraintID cnstr_id = ++constraint_expr_ids_;
+
+ if (this->constraint_expr_list_.bind (cnstr_id, notify_constr_expr) == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+
+ if (TAO_debug_level > 1)
+ ACE_DEBUG ((LM_DEBUG, "Added constraint to filter %x\n", this, expr.constraint_expr.in ()));
+
+ auto_expr.release ();
+ }
+}
+
+CosNotifyFilter::ConstraintInfoSeq*
+TAO_Notify_ETCL_Filter::add_constraints (const CosNotifyFilter::ConstraintExpSeq& constraint_list
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::InvalidConstraint
+ ))
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ULong constraint_length = constraint_list.length ();
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "constraint_length = %d\n",
+ constraint_length));
+
+ // Create the list that goes out.
+ CosNotifyFilter::ConstraintInfoSeq* infoseq_ptr;
+ ACE_NEW_THROW_EX (infoseq_ptr,
+ CosNotifyFilter::ConstraintInfoSeq (constraint_length),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ CosNotifyFilter::ConstraintInfoSeq_var infoseq (infoseq_ptr);
+ infoseq->length (constraint_length);
+
+ // Populate infoseq.
+ for (CORBA::ULong pop_index = 0; pop_index < constraint_length; ++pop_index)
+ {
+ infoseq[pop_index].constraint_expression =
+ constraint_list [pop_index];
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Adding constraint %d, %s\n",
+ pop_index,
+ constraint_list [pop_index].constraint_expr.in ()));
+ }
+ }
+
+ this->add_constraints_i (infoseq.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return infoseq._retn ();
+}
+
+void
+TAO_Notify_ETCL_Filter::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
+ ))
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // First check if all the ids are valid.
+ u_int index;
+
+ for (index = 0; index < del_list.length (); ++index)
+ {
+ if (this->constraint_expr_list_.find (del_list [index]) == -1)
+ {
+ ACE_THROW (CosNotifyFilter::ConstraintNotFound (del_list [index]));
+ }
+ }
+
+ for (index = 0; index < modify_list.length (); ++index)
+ {
+ if (this->constraint_expr_list_.find (modify_list [index].constraint_id) == -1)
+ {
+ ACE_THROW (CosNotifyFilter::ConstraintNotFound (modify_list [index].constraint_id));
+ }
+ }
+
+ // Remove previous entries and save them in case we need to reinstate them.
+ ACE_Array<TAO_Notify_Constraint_Expr*> constr_saved (modify_list.length ());
+ TAO_Notify_Constraint_Expr* constr_expr = 0;
+
+ for (index = 0; index < modify_list.length (); ++index)
+ {
+ CosNotifyFilter::ConstraintID cnstr_id =
+ modify_list [index].constraint_id;
+
+ if (this->constraint_expr_list_.unbind (cnstr_id, constr_expr) != -1)
+ {
+ constr_saved[index] = constr_expr;
+ }
+ }
+
+ // Now add the new entries.
+ // Keep a list of ids generated in this session.
+ ACE_TRY
+ {
+ this->add_constraints_i (modify_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Restore,
+ for (index = 0; index < modify_list.length (); ++index)
+ {
+ CosNotifyFilter::ConstraintID cnstr_id = ++this->constraint_expr_ids_;
+
+ if (constraint_expr_list_.bind (cnstr_id, constr_saved[index]) == -1)
+ ACE_THROW (CORBA::NO_RESOURCES ());
+ }
+
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ // Now go around deleting...
+ // for the del_list.
+ for (index = 0; index < del_list.length (); ++index)
+ {
+ if (this->constraint_expr_list_.unbind (del_list [index], constr_expr) != -1)
+ {
+ delete constr_expr;
+ }
+ }
+
+ // Delete the old constraints.
+ for (index = 0; index < constr_saved.max_size (); ++index)
+ {
+ delete constr_saved[index];
+ }
+}
+
+CosNotifyFilter::ConstraintInfoSeq*
+TAO_Notify_ETCL_Filter::get_constraints (const CosNotifyFilter::ConstraintIDSeq & id_list
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyFilter::ConstraintNotFound))
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ // Create the list that goes out.
+ CosNotifyFilter::ConstraintInfoSeq *infoseq_ptr;
+ ACE_NEW_THROW_EX (infoseq_ptr,
+ CosNotifyFilter::ConstraintInfoSeq (id_list.length ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ CosNotifyFilter::ConstraintInfoSeq_var infoseq (infoseq_ptr);
+
+ TAO_Notify_Constraint_Expr *notify_constr_expr = 0;
+
+ for (u_int index = 0; index < id_list.length (); ++index)
+ {
+ if (this->constraint_expr_list_.find (id_list[index],
+ notify_constr_expr) == -1)
+ ACE_THROW_RETURN (CosNotifyFilter::ConstraintNotFound (id_list[index]),
+ 0);
+
+ infoseq[index].constraint_expression =
+ notify_constr_expr->constr_expr;
+
+ // Get an id.
+ infoseq[index].constraint_id = id_list[index];
+ }
+
+ return infoseq._retn ();
+}
+
+CosNotifyFilter::ConstraintInfoSeq *
+TAO_Notify_ETCL_Filter::get_all_constraints (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_RETURN (0);
+
+ CORBA::ULong current_size = static_cast<CORBA::ULong> (this->constraint_expr_list_.current_size ());
+
+ // Create the list that goes out.
+ CosNotifyFilter::ConstraintInfoSeq *infoseq_ptr;
+ ACE_NEW_THROW_EX (infoseq_ptr,
+ CosNotifyFilter::ConstraintInfoSeq (current_size),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ CosNotifyFilter::ConstraintInfoSeq_var infoseq (infoseq_ptr);
+
+ infoseq->length (current_size);
+
+ CONSTRAINT_EXPR_LIST::ITERATOR iter (this->constraint_expr_list_);
+ CONSTRAINT_EXPR_LIST::ENTRY *entry;
+
+ for (u_int index = 0; iter.done () == 0; iter.advance (), ++index)
+ {
+ if (iter.next (entry) != 0)
+ {
+ // Why do we cast to a const object?
+ // We want to force the TAO::String_Manager to make a
+ // copy of the string. It wouldn't unless we coax it to use
+ // the correct assignment operator.
+ infoseq[index].constraint_expression =
+ static_cast<const CosNotifyFilter::ConstraintExp> (entry->int_id_->constr_expr);
+
+ infoseq[index].constraint_id = entry->ext_id_;
+ }
+ }
+
+ return infoseq._retn ();
+}
+
+void
+TAO_Notify_ETCL_Filter::remove_all_constraints (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;
+
+ this->remove_all_constraints_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_ETCL_Filter::remove_all_constraints_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CONSTRAINT_EXPR_LIST::ITERATOR iter (this->constraint_expr_list_);
+ CONSTRAINT_EXPR_LIST::ENTRY *entry;
+
+ u_int index;
+
+ for (index = 0; iter.done () == 0; iter.advance (), ++index)
+ {
+ if (iter.next (entry) != 0)
+ {
+ delete entry->int_id_;
+ entry->int_id_ = 0;
+ }
+ }
+
+ this->constraint_expr_list_.unbind_all ();
+}
+
+void
+TAO_Notify_ETCL_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;
+
+ this->remove_all_constraints_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ 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_ETCL_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_ETCL_Filter::match_structured (const CosNotification::StructuredEvent & filterable_data
+ 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);
+
+ // We want to return true if at least one constraint matches.
+ CONSTRAINT_EXPR_LIST::ITERATOR iter (this->constraint_expr_list_);
+ CONSTRAINT_EXPR_LIST::ENTRY *entry;
+
+ TAO_Notify_Constraint_Visitor visitor;
+
+ if (visitor.bind_structured_event (filterable_data) != 0)
+ {
+ // Maybe throw some kind of exception here, or lower down,
+ return 0;
+ }
+
+ for (; iter.done () == 0; iter.advance ())
+ {
+ if (iter.next (entry) != 0)
+ {
+ if (entry->int_id_->interpreter.evaluate (visitor) == 1)
+ {
+ return 1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+CORBA::Boolean
+TAO_Notify_ETCL_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_ETCL_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_ETCL_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_ETCL_Filter::get_callbacks (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
+ 0);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.h b/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.h
new file mode 100644
index 00000000000..758c3ea4e38
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.h
@@ -0,0 +1,175 @@
+/* -*- C++ -*- */
+/**
+ * @file ETCL_Filter.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_ETCL_FILTER_H
+#define TAO_Notify_ETCL_FILTER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Containers_T.h"
+#include "ace/Hash_Map_Manager.h"
+#include "ace/Atomic_Op.h"
+#include "orbsvcs/CosNotifyFilterS.h"
+#include "orbsvcs/Notify/Notify_Constraint_Interpreter.h"
+#include "ace/Null_Mutex.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_ETCL_Filter
+ *
+ * @brief Implementation of CosNotifyFilter::Filter servant.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_ETCL_Filter
+ : public POA_CosNotifyFilter::Filter
+{
+public:
+ /// Constuctor
+ TAO_Notify_ETCL_Filter (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_ETCL_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
+ ));
+
+private:
+ void add_constraints_i (const CosNotifyFilter::ConstraintInfoSeq& constraint_info_seq ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::InvalidConstraint
+ ));
+
+ void remove_all_constraints_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ struct TAO_Notify_Constraint_Expr
+ {
+ // = DESCRIPTION
+ // Structure for associating ConstraintInfo with an interpreter.
+ //
+ CosNotifyFilter::ConstraintExp constr_expr;
+ // Constraint Expression.
+
+ TAO_Notify_Constraint_Interpreter interpreter;
+ // Constraint Interpreter.
+ };
+
+ /// Lock to serialize access to data members.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// Id generator for ConstraintInfo's.
+ CORBA::Long constraint_expr_ids_;
+
+ /// A list of the constraints stored in this filter.
+ typedef ACE_Hash_Map_Manager <CosNotifyFilter::ConstraintID,
+ TAO_Notify_ETCL_Filter::TAO_Notify_Constraint_Expr*,
+ ACE_SYNCH_NULL_MUTEX>
+ CONSTRAINT_EXPR_LIST;
+
+ CONSTRAINT_EXPR_LIST constraint_expr_list_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_ETCL_FILTER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.cpp b/TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.cpp
new file mode 100644
index 00000000000..25d53cd5370
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.cpp
@@ -0,0 +1,81 @@
+// $Id$
+
+#include "orbsvcs/Notify/ETCL_FilterFactory.h"
+
+ACE_RCSID(Notify, TAO_Notify_ETCL_FilterFactory, "$Id$")
+
+#include "orbsvcs/Notify/ETCL_Filter.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_ETCL_FilterFactory::TAO_Notify_ETCL_FilterFactory (void)
+{
+}
+
+TAO_Notify_ETCL_FilterFactory::~TAO_Notify_ETCL_FilterFactory ()
+{
+}
+
+CosNotifyFilter::FilterFactory_ptr
+TAO_Notify_ETCL_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_ETCL_FilterFactory::create_filter (const char *constraint_grammar ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::InvalidGrammar
+ ))
+{
+ // @@: 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_ETCL_Filter* filter = 0;
+
+ ACE_NEW_THROW_EX (filter,
+ TAO_Notify_ETCL_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_ETCL_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 ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_Notify_Serv, TAO_Notify_ETCL_FilterFactory)
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.h b/TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.h
new file mode 100644
index 00000000000..615f010c0cd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.h
@@ -0,0 +1,94 @@
+/* -*- C++ -*- */
+/**
+ * @file ETCL_FilterFactory.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_ETCL_FILTERFACTORY_H
+#define TAO_Notify_ETCL_FILTERFACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_ETCL_FilterFactory
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_ETCL_FilterFactory :
+ public virtual POA_CosNotifyFilter::FilterFactory,
+ public virtual TAO_Notify_FilterFactory
+{
+public:
+ /// Constuctor
+ TAO_Notify_ETCL_FilterFactory (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_ETCL_FilterFactory ();
+
+ ///= TAO_Notify_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_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+ACE_FACTORY_DECLARE (TAO_Notify_Serv, TAO_Notify_ETCL_FilterFactory)
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_ETCL_FILTERFACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event.cpp b/TAO/orbsvcs/orbsvcs/Notify/Event.cpp
new file mode 100644
index 00000000000..98d7bfd48cc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event.cpp
@@ -0,0 +1,84 @@
+// $Id$
+
+#include "orbsvcs/Notify/Event.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Event.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Notify,
+ TAO_Notify_Event,
+ "$Id$")
+
+#include "tao/debug.h"
+#include "tao/CDR.h"
+#include "orbsvcs/CosNotificationC.h"
+// NOTE: unfortunately we must know about derived types to implement unmarshal
+#include "orbsvcs/Notify/Any/AnyEvent.h"
+#include "orbsvcs/Notify/Structured/StructuredEvent.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Event::TAO_Notify_Event (void)
+: priority_ (CosNotification::Priority, CosNotification::DefaultPriority)
+, timeout_ (CosNotification::Timeout)
+, reliable_ (CosNotification::EventReliability, false)
+, clone_ (0)
+, is_on_heap_ (false)
+{
+ // if (TAO_debug_level > 0)
+ // ACE_DEBUG ((LM_DEBUG,"event:%x created\n", this ));
+}
+
+TAO_Notify_Event::~TAO_Notify_Event ()
+{
+ // if (TAO_debug_level > 1)
+ // ACE_DEBUG ((LM_DEBUG,"event:%x destroyed\n", this ));
+}
+void
+TAO_Notify_Event::release (void)
+{
+ delete this;
+}
+
+void
+TAO_Notify_Event::translate (const CORBA::Any& any, CosNotification::StructuredEvent& notification)
+{
+ notification.remainder_of_body <<= any;
+ notification.header.fixed_header.event_type.type_name = CORBA::string_dup ("%ANY");
+ notification.header.fixed_header.event_type.domain_name = CORBA::string_dup ("");
+}
+
+void
+TAO_Notify_Event::translate (const CosNotification::StructuredEvent& notification, CORBA::Any& any)
+{
+ any <<= notification; // is the typecode set by this operation or do we need to set it explicity.
+}
+/// Unmarshal an event from a CDR. (for persistence)
+//static
+TAO_Notify_Event *
+TAO_Notify_Event::unmarshal (TAO_InputCDR & cdr)
+{
+ TAO_Notify_Event * result = 0;
+ ACE_CDR::Octet code = 0;
+ if (cdr.read_octet (code))
+ {
+ switch (code)
+ {
+ case MARSHAL_ANY:
+ result = TAO_Notify_AnyEvent::unmarshal (cdr);
+ break;
+ case MARSHAL_STRUCTURED:
+ result = TAO_Notify_StructuredEvent::unmarshal (cdr);
+ break;
+ default:
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Event::unmarshal: unknown event code %d\n"),
+ code));
+ break;
+ }
+ }
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event.h b/TAO/orbsvcs/orbsvcs/Notify/Event.h
new file mode 100644
index 00000000000..1b44711ce46
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event.h
@@ -0,0 +1,139 @@
+/* -*- C++ -*- */
+/**
+ * @file Event.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_NOTIFY_EVENT_H
+#define TAO_NOTIFY_EVENT_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Refcountable.h"
+#include "orbsvcs/Notify/Property.h"
+#include "orbsvcs/Notify/Property_Boolean.h"
+#include "orbsvcs/Notify/Property_T.h"
+
+#include "orbsvcs/Event_ForwarderS.h"
+#include "orbsvcs/CosNotifyFilterC.h"
+#include "orbsvcs/CosNotificationC.h"
+
+#include "ace/Copy_Disabled.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Consumer;
+class TAO_Notify_EventType;
+
+/**
+ * @class TAO_Notify_Event
+ *
+ * @brief Base class abstraction for Events flowing through the EventChannel.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Event
+ : public TAO_Notify_Refcountable
+ , private ACE_Copy_Disabled
+{
+public:
+ typedef TAO_Notify_Refcountable_Guard_T<TAO_Notify_Event> Ptr;
+
+ // Codes to distinguish marshaled events in persistent storage
+ enum {MARSHAL_ANY=1,MARSHAL_STRUCTURED=2};
+ /// Constuctor
+ TAO_Notify_Event (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Event ();
+
+ /// Translate Any to Structured
+ static void translate (const CORBA::Any& any, CosNotification::StructuredEvent& notification);
+
+ /// Translate Structured to Any
+ static void translate (const CosNotification::StructuredEvent& notification, CORBA::Any& any);
+
+ /// Get the event type.
+ virtual const TAO_Notify_EventType& type (void) const = 0;
+
+ /// Returns true if the filter matches.
+ virtual CORBA::Boolean do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) const = 0;
+
+ /// Convert to CosNotification::Structured type
+ virtual void convert (CosNotification::StructuredEvent& notification) const = 0;
+
+ /// Push event to consumer
+ virtual void push (TAO_Notify_Consumer* consumer ACE_ENV_ARG_DECL) const = 0;
+
+ /// Push event to the Event_Forwarder interface
+ virtual void push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const = 0;
+
+ /// Push event to the Event_Forwarder interface
+ virtual void push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const = 0;
+
+ /// Push event to the Event_Forwarder interface
+ virtual void push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const = 0;
+
+ /// Push event to the Event_Forwarder interface
+ virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const = 0;
+
+ /// Return a pointer to a copy of this event on the heap
+ TAO_Notify_Event* queueable_copy (ACE_ENV_SINGLE_ARG_DECL) const;
+
+ /// marshal this event into a CDR buffer (for persistence)
+ virtual void marshal (TAO_OutputCDR& cdr) const = 0;
+
+ /// Unmarshal an event from a CDR. (for persistence)
+ static TAO_Notify_Event* unmarshal (TAO_InputCDR & cdr);
+
+ ///= Accessors
+ /// Priority
+ const TAO_Notify_Property_Short& priority (void) const;
+
+ /// Timeout
+ const TAO_Notify_Property_Time& timeout (void) const;
+
+ /// Reliable
+ const TAO_Notify_Property_Boolean& reliable(void) const;
+
+protected:
+ /// = QoS properties
+
+ /// Priority.
+ TAO_Notify_Property_Short priority_;
+
+ /// Timeout.
+ TAO_Notify_Property_Time timeout_;
+
+ /// Reliability
+ TAO_Notify_Property_Boolean reliable_;
+
+private:
+ /// Return a pointer to a copy of this event on the heap
+ virtual TAO_Notify_Event* copy (ACE_ENV_SINGLE_ARG_DECL) const = 0;
+
+ virtual void release (void);
+
+ mutable Ptr clone_;
+ bool is_on_heap_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Event.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_NOTIFY_EVENT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event.inl b/TAO/orbsvcs/orbsvcs/Notify/Event.inl
new file mode 100644
index 00000000000..36bdd57e0f5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event.inl
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE const TAO_Notify_Property_Short&
+TAO_Notify_Event::priority (void) const
+{
+ return this->priority_;
+}
+
+ACE_INLINE const TAO_Notify_Property_Time&
+TAO_Notify_Event::timeout (void) const
+{
+ return this->timeout_;
+}
+
+ACE_INLINE const TAO_Notify_Property_Boolean&
+TAO_Notify_Event::reliable (void) const
+{
+ return this->reliable_;
+}
+
+ACE_INLINE
+TAO_Notify_Event*
+TAO_Notify_Event::queueable_copy (ACE_ENV_SINGLE_ARG_DECL) const
+{
+ if ( is_on_heap_ )
+ {
+ return const_cast< TAO_Notify_Event* >( this );
+ }
+ else if (this->clone_.get() == 0)
+ {
+ TAO_Notify_Event* copied = this->copy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ copied->is_on_heap_ = true;
+ this->clone_.reset( copied );
+ }
+ return this->clone_.get();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventChannel.cpp b/TAO/orbsvcs/orbsvcs/Notify/EventChannel.cpp
new file mode 100644
index 00000000000..a55f5e44f6c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/EventChannel.cpp
@@ -0,0 +1,685 @@
+// $Id$
+
+#include "orbsvcs/Notify/EventChannel.h"
+
+#include "orbsvcs/Notify/Container_T.h"
+#include "orbsvcs/Notify/EventChannelFactory.h"
+#include "orbsvcs/Notify/ConsumerAdmin.h"
+#include "orbsvcs/Notify/SupplierAdmin.h"
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/Factory.h"
+#include "orbsvcs/Notify/Builder.h"
+#include "orbsvcs/Notify/Find_Worker_T.h"
+#include "orbsvcs/Notify/Seq_Worker_T.h"
+#include "orbsvcs/Notify/Topology_Saver.h"
+#include "orbsvcs/Notify/Save_Persist_Worker_T.h"
+#include "orbsvcs/Notify/Reconnect_Worker_T.h"
+#include "orbsvcs/Notify/Proxy.h"
+#include "orbsvcs/Notify/Event_Manager.h"
+#include "orbsvcs/Notify/POA_Helper.h"
+
+#include "tao/debug.h"
+//#define DEBUG_LEVEL 9
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+ACE_RCSID(Notify, TAO_Notify_EventChannel, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef TAO_Notify_Find_Worker_T<TAO_Notify_ConsumerAdmin
+ , CosNotifyChannelAdmin::ConsumerAdmin
+ , CosNotifyChannelAdmin::ConsumerAdmin_ptr
+ , CosNotifyChannelAdmin::AdminNotFound>
+TAO_Notify_ConsumerAdmin_Find_Worker;
+
+typedef TAO_Notify_Find_Worker_T<TAO_Notify_SupplierAdmin
+ , CosNotifyChannelAdmin::SupplierAdmin
+ , CosNotifyChannelAdmin::SupplierAdmin_ptr
+ , CosNotifyChannelAdmin::AdminNotFound>
+TAO_Notify_SupplierAdmin_Find_Worker;
+
+typedef TAO_Notify_Seq_Worker_T<TAO_Notify_ConsumerAdmin> TAO_Notify_ConsumerAdmin_Seq_Worker;
+typedef TAO_Notify_Seq_Worker_T<TAO_Notify_SupplierAdmin> TAO_Notify_SupplierAdmin_Seq_Worker;
+
+TAO_Notify_EventChannel::TAO_Notify_EventChannel (void)
+ : ecf_ (0)
+ , ca_container_ (0)
+ , sa_container_ (0)
+{
+}
+
+TAO_Notify_EventChannel::~TAO_Notify_EventChannel ()
+{
+}
+
+void
+TAO_Notify_EventChannel::init (TAO_Notify_EventChannelFactory* ecf
+ , const CosNotification::QoSProperties & initial_qos
+ , const CosNotification::AdminProperties & initial_admin
+ ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (this->ca_container_.get() == 0);
+
+ // this-> on the following line confuses VC6
+ initialize (ecf ACE_ENV_ARG_PARAMETER);
+
+ this->ecf_.reset (ecf);
+
+ // Init ca_container_
+ TAO_Notify_ConsumerAdmin_Container* ca_container = 0;
+ ACE_NEW_THROW_EX (ca_container,
+ TAO_Notify_ConsumerAdmin_Container (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+ this->ca_container_.reset (ca_container);
+
+ this->ca_container().init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Init ca_container_
+ TAO_Notify_SupplierAdmin_Container* sa_container = 0;
+ ACE_NEW_THROW_EX (sa_container,
+ TAO_Notify_SupplierAdmin_Container (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+ this->sa_container_.reset (sa_container);
+
+ this->sa_container().init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Set the admin properties.
+ TAO_Notify_AdminProperties* admin_properties = 0;
+ ACE_NEW_THROW_EX (admin_properties,
+ TAO_Notify_AdminProperties (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ this->set_admin_properties (admin_properties);
+
+ // create the event manager. @@ use factory
+ TAO_Notify_Event_Manager* event_manager = 0;
+ ACE_NEW_THROW_EX (event_manager,
+ TAO_Notify_Event_Manager (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+ this->set_event_manager (event_manager);
+
+ this->event_manager().init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const CosNotification::QoSProperties &default_ec_qos =
+ TAO_Notify_PROPERTIES::instance ()->default_event_channel_qos_properties ();
+
+ this->set_qos (default_ec_qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->set_qos (initial_qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->set_admin (initial_admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Note originally default admins were allocated here, bt this caused problems
+ // attempting to save the topology changes before the Event Channel was completely
+ // constructed and linked to the ECF.
+ // Lazy evaluation also avoids creating unneded admins.
+}
+
+
+void
+TAO_Notify_EventChannel::init (TAO_Notify::Topology_Parent* parent ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (this->ecf_.get() == 0);
+ // this-> on the following line confuses VC6
+ initialize (parent ACE_ENV_ARG_PARAMETER);
+
+ this->ecf_.reset (dynamic_cast <TAO_Notify_EventChannelFactory*>(parent));
+ ACE_ASSERT (this->ecf_.get() !=0);
+
+ // Init ca_container_
+ TAO_Notify_ConsumerAdmin_Container* ca_container = 0;
+ ACE_NEW_THROW_EX (ca_container,
+ TAO_Notify_ConsumerAdmin_Container (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+ this->ca_container_.reset (ca_container);
+
+ this->ca_container().init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_Notify_SupplierAdmin_Container* sa_container = 0;
+ // Init ca_container_
+ ACE_NEW_THROW_EX (sa_container,
+ TAO_Notify_SupplierAdmin_Container (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+ this->sa_container_.reset (sa_container);
+
+ this->sa_container().init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Set the admin properties.
+ TAO_Notify_AdminProperties* admin_properties = 0;
+ ACE_NEW_THROW_EX (admin_properties,
+ TAO_Notify_AdminProperties (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ this->set_admin_properties (admin_properties);
+
+ // create the event manager. @@ use factory
+ TAO_Notify_Event_Manager* event_manager = 0;
+ ACE_NEW_THROW_EX (event_manager,
+ TAO_Notify_Event_Manager (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+ this->set_event_manager (event_manager);
+
+ this->event_manager().init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const CosNotification::QoSProperties &default_ec_qos =
+ TAO_Notify_PROPERTIES::instance ()->default_event_channel_qos_properties ();
+
+ this->set_qos (default_ec_qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+}
+
+
+void
+TAO_Notify_EventChannel::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_incr_refcnt ();
+}
+
+void
+TAO_Notify_EventChannel::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_decr_refcnt ();
+}
+
+void
+TAO_Notify_EventChannel::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+int
+TAO_Notify_EventChannel::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int sd_ret = TAO_Notify_Object::shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+
+ if (sd_ret == 1)
+ return 1;
+
+ this->ca_container().shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+
+ this->sa_container().shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+
+ this->event_manager().shutdown ();
+
+ return 0;
+}
+
+void
+TAO_Notify_EventChannel::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_EventChannel::Ptr guard( this );
+
+ int result = this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ if ( result == 1)
+ return;
+
+ this->ecf_->remove (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->sa_container_.reset( 0 );
+ this->ca_container_.reset( 0 );
+}
+
+void
+TAO_Notify_EventChannel::remove (TAO_Notify_ConsumerAdmin* consumer_admin ACE_ENV_ARG_DECL)
+{
+ this->ca_container().remove (consumer_admin ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_EventChannel::remove (TAO_Notify_SupplierAdmin* supplier_admin ACE_ENV_ARG_DECL)
+{
+ this->sa_container().remove (supplier_admin ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_EventChannel::set_qos (const CosNotification::QoSProperties & qos ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotification::UnsupportedQoS
+ ))
+{
+ this->TAO_Notify_Object::set_qos (qos ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotification::QoSProperties*
+TAO_Notify_EventChannel::get_qos (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->TAO_Notify_Object::get_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::EventChannelFactory_ptr
+TAO_Notify_EventChannel::MyFactory (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->ecf_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::ConsumerAdmin_ptr
+TAO_Notify_EventChannel::default_consumer_admin (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ if (CORBA::is_nil (default_consumer_admin_.in ()))
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->default_admin_mutex_, CosNotifyChannelAdmin::ConsumerAdmin::_nil());
+ if (CORBA::is_nil (default_consumer_admin_.in ()))
+ {
+ CosNotifyChannelAdmin::AdminID id;
+ this->default_consumer_admin_ = this->new_for_consumers (CosNotifyChannelAdmin::OR_OP, id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNotifyChannelAdmin::ConsumerAdmin::_nil());
+ // Wish there was a better way to do this!
+ PortableServer::ServantBase * admin_servant =
+ this->poa()->reference_to_servant (
+ this->default_consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNotifyChannelAdmin::ConsumerAdmin::_nil());
+ TAO_Notify_Admin * pAdmin = dynamic_cast <TAO_Notify_Admin *> (admin_servant);
+ ACE_ASSERT (pAdmin != 0); // if this assert triggers, we have mixed implementations?
+ if (pAdmin != 0)
+ {
+ pAdmin->set_default (true);
+ }
+ }
+ }
+ return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (this->default_consumer_admin_.in ());
+}
+
+CosNotifyChannelAdmin::SupplierAdmin_ptr
+TAO_Notify_EventChannel::default_supplier_admin (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ if (CORBA::is_nil (default_supplier_admin_.in ()))
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->default_admin_mutex_, CosNotifyChannelAdmin::SupplierAdmin::_nil());
+ if (CORBA::is_nil (default_supplier_admin_.in ()))
+ {
+ CosNotifyChannelAdmin::AdminID id;
+ this->default_supplier_admin_ = this->new_for_suppliers (CosNotifyChannelAdmin::OR_OP, id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNotifyChannelAdmin::SupplierAdmin::_nil());
+ PortableServer::ServantBase * admin_servant =
+ this->poa()->poa()->reference_to_servant (
+ this->default_supplier_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ TAO_Notify_Admin * pAdmin = dynamic_cast <TAO_Notify_Admin *> (admin_servant);
+ ACE_ASSERT (pAdmin != 0); // if this assert triggers, we have mixed implementations?
+ if (pAdmin != 0)
+ {
+ pAdmin->set_default (true);
+ }
+ }
+ }
+ return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (this->default_supplier_admin_.in ());
+}
+
+::CosNotifyFilter::FilterFactory_ptr TAO_Notify_EventChannel::default_filter_factory (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->ecf_->get_default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+::CosNotifyChannelAdmin::ConsumerAdmin_ptr
+TAO_Notify_EventChannel::new_for_consumers (CosNotifyChannelAdmin::InterFilterGroupOperator op,
+ CosNotifyChannelAdmin::AdminID_out id ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+
+{
+ ::CosNotifyChannelAdmin::ConsumerAdmin_var ca =
+ TAO_Notify_PROPERTIES::instance()->builder()->build_consumer_admin (this, op, id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ca._retn ());
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ca._retn ());
+ return ca._retn ();
+}
+
+::CosNotifyChannelAdmin::SupplierAdmin_ptr
+TAO_Notify_EventChannel::new_for_suppliers (CosNotifyChannelAdmin::InterFilterGroupOperator op,
+ CosNotifyChannelAdmin::AdminID_out id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ::CosNotifyChannelAdmin::SupplierAdmin_var sa =
+ TAO_Notify_PROPERTIES::instance()->builder()->build_supplier_admin (this, op, id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (sa._retn ());
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (sa._retn ());
+ return sa._retn ();
+}
+
+CosNotifyChannelAdmin::ConsumerAdmin_ptr
+TAO_Notify_EventChannel::get_consumeradmin (CosNotifyChannelAdmin::AdminID id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::AdminNotFound
+ ))
+{
+ TAO_Notify_ConsumerAdmin_Find_Worker find_worker;
+
+ return find_worker.resolve (id, this->ca_container() ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::SupplierAdmin_ptr
+TAO_Notify_EventChannel::get_supplieradmin (CosNotifyChannelAdmin::AdminID id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::AdminNotFound
+ ))
+{
+ TAO_Notify_SupplierAdmin_Find_Worker find_worker;
+
+ return find_worker.resolve (id, this->sa_container() ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::AdminIDSeq*
+TAO_Notify_EventChannel::get_all_consumeradmins (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_ConsumerAdmin_Seq_Worker seq_worker;
+
+ return seq_worker.create (this->ca_container() ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::AdminIDSeq*
+TAO_Notify_EventChannel::get_all_supplieradmins (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_SupplierAdmin_Seq_Worker seq_worker;
+
+ return seq_worker.create (this->sa_container() ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_EventChannel::set_admin (const CosNotification::AdminProperties & admin ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotification::UnsupportedAdmin
+ ))
+{
+ this->admin_properties().init (admin);
+}
+
+CosNotification::AdminProperties*
+TAO_Notify_EventChannel::get_admin (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ CosNotification::AdminProperties_var properties;
+
+ ACE_NEW_THROW_EX (properties,
+ CosNotification::AdminProperties (),
+ CORBA::NO_MEMORY ());
+
+ this->admin_properties().populate (properties);
+
+ return properties._retn ();
+}
+
+CosEventChannelAdmin::ConsumerAdmin_ptr
+TAO_Notify_EventChannel::for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->default_consumer_admin(ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosEventChannelAdmin::SupplierAdmin_ptr
+TAO_Notify_EventChannel::for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->default_supplier_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_EventChannel::validate_qos (const CosNotification::QoSProperties & /*required_qos*/,
+ CosNotification::NamedPropertyRangeSeq_out /*available_qos*/
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotification::UnsupportedQoS
+ ))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+void
+TAO_Notify_EventChannel::save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL)
+{
+ bool changed = this->self_changed_;
+ this->self_changed_ = false;
+ this->children_changed_ = false;
+
+ if (is_persistent ())
+ {
+ TAO_Notify::NVPList attrs;
+ this->save_attrs(attrs);
+
+ bool want_all_children = saver.begin_object(
+ this->id(), "channel", attrs, changed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_Notify::Save_Persist_Worker<TAO_Notify_ConsumerAdmin> ca_wrk(saver, want_all_children);
+
+ this->ca_container().collection()->for_each(&ca_wrk ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_Notify::Save_Persist_Worker<TAO_Notify_SupplierAdmin> sa_wrk(saver, want_all_children);
+ this->sa_container().collection()->for_each(&sa_wrk ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ saver.end_object(this->id(), "channel" ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+namespace {
+ template<class T>
+ void add_attr(TAO_Notify::NVPList& attrs, const T& prop) {
+ if (prop.is_valid())
+ {
+ attrs.push_back(TAO_Notify::NVP (prop));
+ }
+ }
+}
+
+void
+TAO_Notify_EventChannel::save_attrs(TAO_Notify::NVPList& attrs)
+{
+ TAO_Notify_Object::save_attrs(attrs);
+ add_attr(attrs, this->admin_properties().max_global_queue_length());
+ add_attr(attrs, this->admin_properties().max_consumers());
+ add_attr(attrs, this->admin_properties().max_suppliers());
+ add_attr(attrs, this->admin_properties().reject_new_events());
+}
+
+void
+TAO_Notify_EventChannel::load_attrs(const TAO_Notify::NVPList& attrs)
+{
+ TAO_Notify_Object::load_attrs(attrs);
+ attrs.load(this->admin_properties().max_global_queue_length());
+ attrs.load(this->admin_properties().max_consumers());
+ attrs.load(this->admin_properties().max_suppliers());
+ attrs.load(this->admin_properties().reject_new_events());
+ this->admin_properties().init();
+}
+
+TAO_Notify::Topology_Object *
+TAO_Notify_EventChannel::load_child (const ACE_CString &type,
+ CORBA::Long id,
+ const TAO_Notify::NVPList& attrs
+ ACE_ENV_ARG_DECL)
+{
+ TAO_Notify::Topology_Object* result = this;
+ if (type == "consumer_admin")
+ {
+ if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) EventChannel reload consumer_admin %d\n")
+ , static_cast<int> (id)
+ ));
+
+ // call special builder method to reload
+ TAO_Notify_Builder* bld = TAO_Notify_PROPERTIES::instance()->builder();
+ TAO_Notify_ConsumerAdmin * ca = bld->build_consumer_admin (
+ this,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ ca->load_attrs (attrs);
+ if (ca->is_default ())
+ {
+ CORBA::Object_var caob = this->poa()->servant_to_reference (ca ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ this->default_consumer_admin_ =
+ CosNotifyChannelAdmin::ConsumerAdmin::_narrow (
+ caob.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ }
+ result = ca;
+ }
+ else if (type == "supplier_admin")
+ {
+ if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) EventChannel reload supplier_admin %d\n")
+ , static_cast<int> (id)
+ ));
+ TAO_Notify_Builder* bld = TAO_Notify_PROPERTIES::instance()->builder();
+
+ TAO_Notify_SupplierAdmin * sa = bld->build_supplier_admin (
+ this,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ sa->load_attrs (attrs);
+ if (sa->is_default ())
+ {
+ CORBA::Object_var saob = this->poa()->servant_to_reference (sa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ this->default_supplier_admin_ =
+ CosNotifyChannelAdmin::SupplierAdmin::_narrow (
+ saob.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ }
+ result = sa;
+ }
+ return result;
+}
+TAO_Notify_ProxyConsumer *
+TAO_Notify_EventChannel::find_proxy_consumer (TAO_Notify::IdVec & id_path, size_t position ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_ProxyConsumer * result = 0;
+ size_t path_size = id_path.size ();
+ if (position < path_size)
+ {
+ TAO_Notify_SupplierAdmin_Find_Worker find_worker;
+ TAO_Notify_SupplierAdmin * admin = find_worker.find (id_path[position], this->sa_container() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ ++position;
+ if (admin != 0)
+ {
+ result = admin->find_proxy_consumer (id_path, position
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ }
+ }
+ return result;
+}
+
+TAO_Notify_ProxySupplier *
+TAO_Notify_EventChannel::find_proxy_supplier (TAO_Notify::IdVec & id_path, size_t position ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_ProxySupplier * result = 0;
+ size_t path_size = id_path.size ();
+ if (position < path_size)
+ {
+ TAO_Notify_ConsumerAdmin_Find_Worker find_worker;
+ TAO_Notify_ConsumerAdmin * admin = find_worker.find (id_path[position], this->ca_container() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ ++position;
+ if (admin != 0)
+ {
+ result = admin->find_proxy_supplier (id_path, position
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ }
+ }
+ return result;
+}
+
+
+void
+TAO_Notify_EventChannel::reconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify::Reconnect_Worker<TAO_Notify_ConsumerAdmin> ca_wrk;
+ this->ca_container().collection()->for_each(&ca_wrk ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_Notify::Reconnect_Worker<TAO_Notify_SupplierAdmin> sa_wrk;
+ this->sa_container().collection()->for_each(&sa_wrk ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_Notify_EventChannel::TAO_Notify_ConsumerAdmin_Container&
+TAO_Notify_EventChannel::ca_container()
+{
+ ACE_ASSERT( this->ca_container_.get() != 0 );
+ return *ca_container_;
+}
+
+TAO_Notify_EventChannel::TAO_Notify_SupplierAdmin_Container&
+TAO_Notify_EventChannel::sa_container()
+{
+ ACE_ASSERT( this->sa_container_.get() != 0 );
+ return *sa_container_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventChannel.h b/TAO/orbsvcs/orbsvcs/Notify/EventChannel.h
new file mode 100644
index 00000000000..2fe1c13ff05
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/EventChannel.h
@@ -0,0 +1,254 @@
+/* -*- C++ -*- */
+/**
+ * @file EventChannel.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_EVENTCHANNEL_H
+#define TAO_Notify_EVENTCHANNEL_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/Notify/Topology_Object.h"
+#include "orbsvcs/Notify/Object.h"
+#include "orbsvcs/Notify/EventChannelFactory.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_ConsumerAdmin;
+class TAO_Notify_SupplierAdmin;
+class TAO_Notify_EventChannelFactory;
+class TAO_Notify_ProxyConsumer;
+class TAO_Notify_ProxySupplier;
+template <class TYPE> class TAO_Notify_Container_T;
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+/**
+ * @class TAO_Notify_EventChannel
+ *
+ * @brief Implementation of CosNotifyChannelAdmin::EventChannel
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_EventChannel
+ : public POA_CosNotifyChannelAdmin::EventChannel,
+ public TAO_Notify::Topology_Parent
+{
+ friend class TAO_Notify_Builder;
+
+public:
+ typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_EventChannel > Ptr;
+ typedef CosNotifyChannelAdmin::ChannelIDSeq SEQ;
+ typedef CosNotifyChannelAdmin::ChannelIDSeq_var SEQ_VAR;
+
+ /// Constuctor
+ TAO_Notify_EventChannel (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_EventChannel ();
+
+ /// Init
+ void init (TAO_Notify_EventChannelFactory* ecf
+ , const CosNotification::QoSProperties & initial_qos
+ , const CosNotification::AdminProperties & initial_admin
+ ACE_ENV_ARG_DECL);
+
+ /// Init (for reload)
+ void init (TAO_Notify::Topology_Parent * parent
+ ACE_ENV_ARG_DECL);
+
+ /// Remove ConsumerAdmin from its container.
+ void remove (TAO_Notify_ConsumerAdmin* consumer_admin ACE_ENV_ARG_DECL);
+
+ /// Remove SupplierAdmin from its container.
+ void remove (TAO_Notify_SupplierAdmin* supplier_admin ACE_ENV_ARG_DECL);
+
+ /// ServantBase refcount methods.
+ virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL);
+
+ // TAO_Notify::Topology_Parent
+
+ virtual void save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL);
+ virtual TAO_Notify::Topology_Object* load_child (const ACE_CString &type,
+ CORBA::Long id,
+ const TAO_Notify::NVPList& attrs
+ ACE_ENV_ARG_DECL);
+ virtual void reconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ virtual TAO_Notify_Object::ID get_id () const {return id();}
+
+ TAO_Notify_ProxyConsumer * find_proxy_consumer (TAO_Notify::IdVec & id_path, size_t position ACE_ENV_ARG_DECL);
+ TAO_Notify_ProxySupplier * find_proxy_supplier (TAO_Notify::IdVec & id_path, size_t position ACE_ENV_ARG_DECL);
+
+ /// Shutdown
+ virtual int shutdown (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void load_attrs(const TAO_Notify::NVPList& attrs);
+
+private:
+ typedef TAO_Notify_Container_T <TAO_Notify_ConsumerAdmin> TAO_Notify_ConsumerAdmin_Container;
+ typedef TAO_Notify_Container_T <TAO_Notify_SupplierAdmin> TAO_Notify_SupplierAdmin_Container;
+
+ virtual void save_attrs(TAO_Notify::NVPList& attrs);
+
+ /// = Data Members
+ /// The parent object.
+ TAO_Notify_EventChannelFactory::Ptr ecf_;
+
+ TAO_SYNCH_MUTEX default_admin_mutex_;
+
+ // Default Consumer Admin
+ CosNotifyChannelAdmin::ConsumerAdmin_var default_consumer_admin_;
+
+ // Default Supplier Admin
+ CosNotifyChannelAdmin::SupplierAdmin_var default_supplier_admin_;
+
+ /// =CosNotifyChannelAdmin::EventChannel methods
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotifyChannelAdmin::EventChannelFactory_ptr MyFactory (ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotifyChannelAdmin::ConsumerAdmin_ptr default_consumer_admin (ACE_ENV_SINGLE_ARG_DECL
+
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotifyChannelAdmin::SupplierAdmin_ptr default_supplier_admin (ACE_ENV_SINGLE_ARG_DECL
+
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotifyFilter::FilterFactory_ptr default_filter_factory (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotifyChannelAdmin::ConsumerAdmin_ptr new_for_consumers (CosNotifyChannelAdmin::InterFilterGroupOperator op,
+ CosNotifyChannelAdmin::AdminID_out id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotifyChannelAdmin::SupplierAdmin_ptr new_for_suppliers (CosNotifyChannelAdmin::InterFilterGroupOperator op,
+ CosNotifyChannelAdmin::AdminID_out id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotifyChannelAdmin::ConsumerAdmin_ptr get_consumeradmin (CosNotifyChannelAdmin::AdminID id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::AdminNotFound
+ ));
+
+ virtual ::CosNotifyChannelAdmin::SupplierAdmin_ptr get_supplieradmin (CosNotifyChannelAdmin::AdminID id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::AdminNotFound
+ ));
+
+ virtual ::CosNotifyChannelAdmin::AdminIDSeq * get_all_consumeradmins (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotifyChannelAdmin::AdminIDSeq * get_all_supplieradmins (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosNotification::QoSProperties * get_qos (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void set_qos (const CosNotification::QoSProperties & qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotification::UnsupportedQoS
+ ));
+
+ virtual void validate_qos (const CosNotification::QoSProperties & required_qos,
+ CosNotification::NamedPropertyRangeSeq_out available_qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotification::UnsupportedQoS
+ ));
+
+ virtual ::CosNotification::AdminProperties * get_admin (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void set_admin (const CosNotification::AdminProperties & admin ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotification::UnsupportedAdmin
+ ));
+
+ virtual ::CosEventChannelAdmin::ConsumerAdmin_ptr for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual ::CosEventChannelAdmin::SupplierAdmin_ptr for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+private:
+ TAO_Notify_ConsumerAdmin_Container& ca_container();
+ TAO_Notify_SupplierAdmin_Container& sa_container();
+
+ /// ConsumerAdmin Container.
+ ACE_Auto_Ptr< TAO_Notify_ConsumerAdmin_Container > ca_container_;
+
+ /// SupplierAdmin Container.
+ ACE_Auto_Ptr< TAO_Notify_SupplierAdmin_Container > sa_container_;
+
+ /// Release
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_EVENTCHANNEL_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp b/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp
new file mode 100644
index 00000000000..2cf855c3009
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp
@@ -0,0 +1,564 @@
+// $Id$
+
+#include "orbsvcs/Notify/EventChannelFactory.h"
+
+ACE_RCSID(Notify, TAO_Notify_EventChannelFactory, "$Id$")
+
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/Factory.h"
+#include "orbsvcs/Notify/Builder.h"
+#include "orbsvcs/Notify/Topology_Saver.h"
+#include "orbsvcs/Notify/Topology_Loader.h"
+#include "orbsvcs/Notify/Save_Persist_Worker_T.h"
+#include "orbsvcs/Notify/Reconnect_Worker_T.h"
+#include "orbsvcs/Notify/Event_Persistence_Strategy.h"
+#include "orbsvcs/Notify/Routing_Slip_Persistence_Manager.h"
+#include "orbsvcs/Notify/EventChannel.h"
+#include "orbsvcs/Notify/Container_T.h"
+#include "orbsvcs/Notify/Find_Worker_T.h"
+#include "orbsvcs/Notify/Seq_Worker_T.h"
+#include "orbsvcs/Notify/POA_Helper.h"
+
+#include "ace/Dynamic_Service.h"
+
+#include "tao/debug.h"
+//#define DEBUG_LEVEL 9
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Include this here since this is the only file that
+// requires Topology_Factory.
+namespace TAO_Notify
+{
+ // virtual
+ Topology_Factory::~Topology_Factory ()
+ {
+ }
+}
+
+typedef TAO_Notify_Find_Worker_T<TAO_Notify_EventChannel
+ , CosNotifyChannelAdmin::EventChannel
+ , CosNotifyChannelAdmin::EventChannel_ptr
+ , CosNotifyChannelAdmin::ChannelNotFound>
+TAO_Notify_EventChannel_Find_Worker;
+
+typedef TAO_Notify_Seq_Worker_T<TAO_Notify_EventChannel> TAO_Notify_EventChannel_Seq_Worker;
+
+TAO_Notify_EventChannelFactory::TAO_Notify_EventChannelFactory (void)
+ : topology_save_seq_ (0)
+ , topology_factory_(0)
+ , reconnect_registry_(*this)
+ , loading_topology_ (false)
+{
+}
+
+TAO_Notify_EventChannelFactory::~TAO_Notify_EventChannelFactory ()
+{
+}
+
+void
+TAO_Notify_EventChannelFactory::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ int result = this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ if ( result == 1)
+ return;
+
+ TAO_Notify_Properties* properties = TAO_Notify_PROPERTIES::instance();
+
+ // Reset references to CORBA objects.
+ properties->orb (CORBA::ORB::_nil ());
+ properties->default_poa (PortableServer::POA::_nil ());
+
+ ec_container_.reset( 0 );
+}
+
+void
+TAO_Notify_EventChannelFactory::init (PortableServer::POA_ptr poa ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (this->ec_container_.get() == 0);
+
+ this->default_filter_factory_ =
+ TAO_Notify_PROPERTIES::instance()->builder()->build_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Init ec_container_
+ TAO_Notify_EventChannel_Container* ecc = 0;
+ ACE_NEW_THROW_EX (ecc,
+ TAO_Notify_EventChannel_Container (),
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+ this->ec_container_.reset( ecc );
+
+ this->ec_container().init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_Notify_POA_Helper* object_poa = 0;
+
+ // Bootstrap initial Object POA
+ ACE_NEW_THROW_EX (object_poa,
+ TAO_Notify_POA_Helper (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ ACE_Auto_Ptr<TAO_Notify_POA_Helper> auto_object_poa (object_poa);
+
+ object_poa->init (poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->adopt_poa (auto_object_poa.release ());
+
+ // Note topology factory is configured separately from the "builder" mediated
+ // objects since it is independant of the "style" of Notification Service.
+ this->topology_factory_ =
+ ACE_Dynamic_Service <TAO_Notify::Topology_Factory>::instance ("Topology_Factory");
+
+ this->load_topology (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->load_event_persistence (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_EventChannelFactory::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_incr_refcnt ();
+}
+
+void
+TAO_Notify_EventChannelFactory::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_decr_refcnt ();
+}
+
+void
+TAO_Notify_EventChannelFactory::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+void
+TAO_Notify_EventChannelFactory::remove (TAO_Notify_EventChannel* event_channel ACE_ENV_ARG_DECL)
+{
+ this->ec_container().remove (event_channel ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+int
+TAO_Notify_EventChannelFactory::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int sd_ret = TAO_Notify_Object::shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+
+ if (sd_ret == 1)
+ return 1;
+
+ this->ec_container().shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+
+ return 0;
+}
+
+CosNotifyFilter::FilterFactory_ptr
+TAO_Notify_EventChannelFactory::get_default_filter_factory (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return CosNotifyFilter::FilterFactory::_duplicate (this->default_filter_factory_.in ());
+}
+
+::CosNotifyChannelAdmin::EventChannel_ptr TAO_Notify_EventChannelFactory::create_channel (
+ const CosNotification::QoSProperties & initial_qos,
+ const CosNotification::AdminProperties & initial_admin,
+ CosNotifyChannelAdmin::ChannelID_out id ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotification::UnsupportedQoS
+ , CosNotification::UnsupportedAdmin
+ ))
+{
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ TAO_Notify_PROPERTIES::instance()->builder()->build_event_channel (this
+ , initial_qos
+ , initial_admin
+ , id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNotifyChannelAdmin::EventChannel::_nil());
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNotifyChannelAdmin::EventChannel::_nil());
+ return ec._retn ();
+}
+
+CosNotifyChannelAdmin::ChannelIDSeq*
+TAO_Notify_EventChannelFactory::get_all_channels (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_EventChannel_Seq_Worker seq_worker;
+
+ return seq_worker.create (this->ec_container() ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::EventChannel_ptr
+TAO_Notify_EventChannelFactory::get_event_channel (CosNotifyChannelAdmin::ChannelID id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::ChannelNotFound
+ ))
+{
+ TAO_Notify_EventChannel_Find_Worker find_worker;
+
+ return find_worker.resolve (id, this->ec_container() ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_EventChannelFactory::set_topology_factory(TAO_Notify::Topology_Factory* f)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) Debug Topology_Factory installed in EventChannelFactory.\n")
+ ));
+ // If the above meessage appears when you don't expect it
+ // use svc.conf to install the topology factory rather
+ // than calling this method.
+ this->topology_factory_ = f;
+}
+
+void
+TAO_Notify_EventChannelFactory::load_topology (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->loading_topology_ = true;
+ if (this->topology_factory_ != 0)
+ {
+ // create_loader will open and load the persistence file for validation
+ auto_ptr<TAO_Notify::Topology_Loader> tl(this->topology_factory_->create_loader());
+ if (tl.get () != 0)
+ {
+ tl->load (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Topology persistence disabled.\n")));
+ }
+ this->loading_topology_ = false;
+}
+bool
+TAO_Notify_EventChannelFactory::is_persistent () const
+{
+ return true;
+}
+
+void
+TAO_Notify_EventChannelFactory::save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL)
+{
+ bool changed = this->self_changed_;
+ this->self_changed_ = false;
+ this->children_changed_ = false;
+
+ TAO_Notify::NVPList attrs; // ECF has no attributes
+
+ bool want_all_children =
+ saver.begin_object(0, "channel_factory", attrs, changed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // for each deleted child
+ // delete_child // if the child has persistence.
+
+ TAO_Notify::Save_Persist_Worker<TAO_Notify_EventChannel> wrk(saver, want_all_children);
+
+ this->ec_container().collection()->for_each(&wrk ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (want_all_children || this->reconnect_registry_.is_changed ())
+ {
+ this->reconnect_registry_.save_persistent(saver ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ saver.end_object(0, "channel_factory" ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_EventChannelFactory::load_event_persistence (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify::Event_Persistence_Strategy * strategy =
+ ACE_Dynamic_Service <TAO_Notify::Event_Persistence_Strategy>::instance ("Event_Persistence");
+ if (strategy != 0)
+ {
+ if (this->topology_factory_ != 0)
+ {
+ TAO_Notify::Event_Persistence_Factory * factory = strategy->get_factory ();
+ if (factory != 0)
+ {
+ for (
+ TAO_Notify::Routing_Slip_Persistence_Manager * rspm = factory->first_reload_manager();
+ rspm != 0;
+ rspm = rspm->load_next ())
+ {
+ TAO_Notify::Routing_Slip_Ptr routing_slip = TAO_Notify::Routing_Slip::create (*this, rspm);
+ if (!routing_slip.null ())
+ {
+ this->routing_slip_restart_set_.insert (routing_slip);
+ }
+ else
+ {
+ //@@todo: tell the rspm it's an orphan, but we can't during reload
+ // we need collect these and come back later to remove them
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Reload persistent event failed.\n")
+ ));
+ }
+ }
+ }
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Notify Service: Configuration error. Event Persistence requires Topology Persistence.\n")
+ ));
+ ACE_THROW (CORBA::PERSIST_STORE());
+ ACE_CHECK;
+ }
+ }
+}
+
+bool
+TAO_Notify_EventChannelFactory::change_to_parent (ACE_ENV_SINGLE_ARG_DECL)
+{
+ bool saving = false;
+ if (! this->loading_topology_)
+ {
+ // A null pointer means that saving of topology is disabled.
+ if (this->topology_factory_ != 0)
+ {
+ saving = true;
+ // seq is used to check save-in-progress
+ // if it changes while we're waiting for the lock
+ // then our change may have already been saved, so
+ // just return. Caller will signal change again if necessary.
+ short seq = this->topology_save_seq_;
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->topology_save_lock_, CORBA::INTERNAL ());
+ ACE_CHECK_RETURN(false);
+ if (seq == this->topology_save_seq_)
+ {
+ auto_ptr<TAO_Notify::Topology_Saver> saver(this->topology_factory_->create_saver());
+ if (saver.get() != 0)
+ {
+ this->save_persistent(*saver ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(false);
+ saver->close (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (false);
+ }
+ this->topology_save_seq_ += 1;
+ }
+ }
+ }
+ return saving;
+}
+
+TAO_Notify::Topology_Object*
+TAO_Notify_EventChannelFactory::load_child (const ACE_CString& type,
+ CORBA::Long id,
+ const TAO_Notify::
+ NVPList& attrs
+ ACE_ENV_ARG_DECL)
+{
+ // ignore anything but our valid children (ie channel)
+ TAO_Notify::Topology_Object * result = this;
+ if (type == "channel")
+ {
+ if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) EventChannelFactory reload channel %d\n")
+ , static_cast<int> (id)
+ ));
+
+ TAO_Notify_Builder* bld = TAO_Notify_PROPERTIES::instance()->builder();
+ TAO_Notify_EventChannel * ec = bld->build_event_channel(
+ this ,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ ec->load_attrs (attrs);
+
+ result = ec;
+ }
+ else if (type == TAO_Notify::REGISTRY_TYPE)
+ {
+ result = & this->reconnect_registry_;
+ }
+ return result;
+}
+
+void
+TAO_Notify_EventChannelFactory::reconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Reconnect all children first
+ TAO_Notify::Reconnect_Worker<TAO_Notify_EventChannel> wrk;
+
+ this->ec_container().collection()->for_each(&wrk ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Then send reconnection announcement to registered clients
+ ACE_ASSERT (!CORBA::is_nil (this->channel_factory_.in ()));
+ this->reconnect_registry_.send_reconnect (this->channel_factory_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // reactivate events in-progress
+ Routing_Slip_Set::CONST_ITERATOR iter (this->routing_slip_restart_set_);
+ TAO_Notify::Routing_Slip_Ptr * routing_slip;
+ for (iter.first(); iter.next(routing_slip); iter.advance())
+ {
+ (*routing_slip)->reconnect(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ this->routing_slip_restart_set_.reset ();
+}
+
+NotifyExt::ReconnectionRegistry::ReconnectionID
+TAO_Notify_EventChannelFactory::register_callback (
+ NotifyExt::ReconnectionCallback_ptr reconnection
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->reconnect_registry_.register_callback (
+ reconnection
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_EventChannelFactory::unregister_callback (
+ NotifyExt::ReconnectionRegistry::ReconnectionID id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->reconnect_registry_.unregister_callback (
+ id
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_Notify_EventChannelFactory::is_alive (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::Boolean (1);
+}
+
+void
+TAO_Notify_EventChannelFactory::save_topology (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_Notify_ProxyConsumer *
+TAO_Notify_EventChannelFactory::find_proxy_consumer (TAO_Notify::IdVec & id_path, size_t position ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_ProxyConsumer * result = 0;
+ size_t path_size = id_path.size ();
+
+ // EventChannelFactory only: The first id is proably for the ECF itself
+ // if so, silently consume it.
+ if (position < path_size && id_path[position] == this->id())
+ {
+ ++position;
+ }
+ if (position < path_size)
+ {
+ TAO_Notify_EventChannel_Find_Worker find_worker;
+
+ TAO_Notify_EventChannel * ec = find_worker.find (id_path[position], this->ec_container() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ ++position;
+ if (ec != 0)
+ {
+ result = ec->find_proxy_consumer (id_path, position
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ }
+ }
+ return result;
+}
+
+TAO_Notify_ProxySupplier *
+TAO_Notify_EventChannelFactory::find_proxy_supplier (TAO_Notify::IdVec & id_path, size_t position ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_ProxySupplier * result = 0;
+ size_t path_size = id_path.size ();
+
+ // EventChannelFactory only: The first id is proably for the ECF itself
+ // if so, silently consume it.
+ if (position < path_size && id_path[position] == this->id())
+ {
+ ++position;
+ }
+ if (position < path_size)
+ {
+ TAO_Notify_EventChannel_Find_Worker find_worker;
+ TAO_Notify_EventChannel * ec = find_worker.find (id_path[position], this->ec_container() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ ++position;
+ if (ec != 0)
+ {
+ result = ec->find_proxy_supplier (id_path, position
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ }
+ }
+ return result;
+}
+
+CosNotifyChannelAdmin::EventChannelFactory_ptr
+TAO_Notify_EventChannelFactory::activate_self (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_var obj = this->activate (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNotifyChannelAdmin::EventChannelFactory::_nil ());
+ this->channel_factory_
+ = CosNotifyChannelAdmin::EventChannelFactory::_narrow (obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNotifyChannelAdmin::EventChannelFactory::_nil ());
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow (obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNotifyChannelAdmin::EventChannelFactory::_nil ());
+
+ ACE_TRY_NEW_ENV
+ {
+ if (DEBUG_LEVEL > 9)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) TAO_Notify_EventChannelFactory::activate_self") ));
+ }
+ this->reconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // ignore for now
+ }
+ ACE_ENDTRY;
+ return this->channel_factory_._retn();
+}
+
+
+TAO_Notify_Object::ID
+TAO_Notify_EventChannelFactory::get_id () const
+{
+ return id();
+}
+
+TAO_Notify_EventChannelFactory::TAO_Notify_EventChannel_Container&
+TAO_Notify_EventChannelFactory::ec_container()
+{
+ ACE_ASSERT( this->ec_container_.get() != 0 );
+ return *ec_container_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.h b/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.h
new file mode 100644
index 00000000000..be559fae20a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.h
@@ -0,0 +1,207 @@
+/* -*- C++ -*- */
+/**
+ * @file EventChannelFactory.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_EVENTCHANNELFACTORY_H
+#define TAO_Notify_EVENTCHANNELFACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Topology_Object.h"
+#include "orbsvcs/Notify/Topology_Factory.h"
+#include "orbsvcs/Notify/Reconnection_Registry.h"
+#include "orbsvcs/Notify/Routing_Slip.h"
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/NotifyExtS.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class TAO_Notify_EventChannel;
+template <class TYPE> class TAO_Notify_Container_T;
+
+/**
+ * @class TAO_Notify_EventChannelFactory
+ *
+ * @brief Implementation of CosNotifyChannelAdmin::EventChannelFactory
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_EventChannelFactory
+ : public virtual POA_NotifyExt::EventChannelFactory
+ , public TAO_Notify::Topology_Parent
+
+{
+ friend class TAO_Notify_Builder;
+ typedef ACE_Unbounded_Set <TAO_Notify::Routing_Slip_Ptr> Routing_Slip_Set;
+
+public:
+ typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_EventChannelFactory > Ptr;
+
+ /// Constuctor
+ TAO_Notify_EventChannelFactory (void);
+
+ /// Init the factory
+ void init (PortableServer::POA_ptr poa ACE_ENV_ARG_DECL);
+
+ /// Destructor
+ virtual ~TAO_Notify_EventChannelFactory ();
+
+ /// = ServantBase Methods
+ virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Remove <channel> from the <ec_container_>
+ void remove (TAO_Notify_EventChannel* channel ACE_ENV_ARG_DECL);
+
+ /// Accesor for the default filter factory shared by all EC's.
+ virtual CosNotifyFilter::FilterFactory_ptr get_default_filter_factory (
+ ACE_ENV_SINGLE_ARG_DECL
+ );
+
+
+ //////////////////////////
+ // The following methods are for
+ // unit testing and debugging
+
+ /// Use the registered Topology_Factory to create a loader, and
+ /// load the topology. If no Topology_Factory is registered
+ /// then nothing will be loaded.
+ void load_topology (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Use the passed in saver factory to generate topology saver objects.
+ /// Does not take ownership.
+ void set_topology_factory(TAO_Notify::Topology_Factory* sf);
+
+ //-- Topology_Parent
+
+ virtual bool is_persistent () const;
+
+ virtual void save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL);
+ virtual bool change_to_parent (ACE_ENV_SINGLE_ARG_DECL);
+ virtual TAO_Notify::Topology_Object* load_child (const ACE_CString &type,
+ CORBA::Long id,
+ const TAO_Notify::NVPList& attrs
+ ACE_ENV_ARG_DECL);
+ CosNotifyChannelAdmin::EventChannelFactory_ptr activate_self (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void reconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// handle change notifications
+ bool handle_change (ACE_ENV_SINGLE_ARG_DECL);
+
+ void load_event_persistence (ACE_ENV_SINGLE_ARG_DECL);
+
+ virtual void save_topology (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ TAO_Notify_ProxyConsumer * find_proxy_consumer (TAO_Notify::IdVec & id_path, size_t position ACE_ENV_ARG_DECL);
+ TAO_Notify_ProxySupplier * find_proxy_supplier (TAO_Notify::IdVec & id_path, size_t position ACE_ENV_ARG_DECL);
+ TAO_Notify_Object * follow_id_path (TAO_Notify::IdVec & id_path, size_t position ACE_ENV_ARG_DECL);
+ virtual TAO_Notify_Object::ID get_id () const;
+
+
+ private:
+
+ /// = Data Members
+
+ /// The default filter factory.
+ CosNotifyFilter::FilterFactory_var default_filter_factory_;
+
+ /// = NotifyExt methods
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// shutdown
+ virtual int shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+ virtual
+ NotifyExt::ReconnectionRegistry::ReconnectionID register_callback (
+ NotifyExt::ReconnectionCallback_ptr reconnection
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void unregister_callback (
+ NotifyExt::ReconnectionRegistry::ReconnectionID id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean is_alive (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// = CosNotifyChannelAdmin Methods
+
+ virtual ::CosNotifyChannelAdmin::EventChannel_ptr create_channel (
+ const CosNotification::QoSProperties & initial_qos,
+ const CosNotification::AdminProperties & initial_admin,
+ CosNotifyChannelAdmin::ChannelID_out id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotification::UnsupportedQoS,
+ CosNotification::UnsupportedAdmin));
+
+ virtual ::CosNotifyChannelAdmin::ChannelIDSeq * get_all_channels (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::CosNotifyChannelAdmin::EventChannel_ptr get_event_channel (
+ CosNotifyChannelAdmin::ChannelID id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyChannelAdmin::ChannelNotFound));
+
+private:
+ typedef TAO_Notify_Container_T<TAO_Notify_EventChannel> TAO_Notify_EventChannel_Container;
+
+ TAO_Notify_EventChannel_Container& ec_container();
+
+ /// Container for Event Channels.
+ ACE_Auto_Ptr< TAO_Notify_EventChannel_Container > ec_container_;
+
+ TAO_SYNCH_MUTEX topology_save_lock_;
+
+ CosNotifyChannelAdmin::EventChannelFactory_var channel_factory_;
+
+ /// change-in-progress detector to avoid duplicates
+ short topology_save_seq_;
+ TAO_Notify::Topology_Factory* topology_factory_;
+ TAO_Notify::Reconnection_Registry reconnect_registry_;
+ bool loading_topology_;
+
+ Routing_Slip_Set routing_slip_restart_set_;
+
+ /// Release this object.
+ virtual void release (void);
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_EVENTCHANNELFACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventType.cpp b/TAO/orbsvcs/orbsvcs/Notify/EventType.cpp
new file mode 100644
index 00000000000..e86593e9583
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/EventType.cpp
@@ -0,0 +1,180 @@
+// $Id$
+
+#include "orbsvcs/Notify/EventType.h"
+
+#include "ace/ACE.h"
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_string.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/EventType.inl"
+#endif /* __ACE_INLINE__ */
+
+#include "orbsvcs/Notify/Topology_Saver.h"
+
+ACE_RCSID (Notify,
+ TAO_Notify_EventType,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_EventType
+TAO_Notify_EventType::special (void)
+{
+ return TAO_Notify_EventType ("*", "%ALL");
+}
+
+TAO_Notify_EventType::TAO_Notify_EventType (void)
+{
+}
+
+void
+TAO_Notify_EventType::init_i (const char* domain_name, const char* type_name)
+{
+ this->event_type_.domain_name = domain_name;
+ this->event_type_.type_name = type_name;
+
+ if (this->is_special () == 1)
+ {
+ this->event_type_.domain_name = (const char* )"*";
+ this->event_type_.type_name = (const char* )"%ALL";
+ }
+
+ this->recompute_hash ();
+}
+
+TAO_Notify_EventType::TAO_Notify_EventType (const char* domain_name,
+ const char* type_name)
+{
+ this->init_i (domain_name, type_name);
+}
+
+TAO_Notify_EventType::TAO_Notify_EventType (
+ const CosNotification::EventType& event_type
+ )
+{
+ this->init_i (event_type.domain_name.in (), event_type.type_name.in ());
+}
+
+TAO_Notify_EventType::~TAO_Notify_EventType ()
+{
+}
+
+void
+TAO_Notify_EventType::recompute_hash (void)
+{
+ // @@ Pradeep: this code is bound to crash someday if the strings
+ // are too long.... See if the hash_pjw () function can be modified
+ // to take accumulate multiple strings, as in:
+ // hash = ACE::hash_pjw_accummulate (0, str1);
+ // hash = ACE::hash_pjw_accummulate (hash, str2);
+ //
+ // @@ Or use grow the buffer when needed, or just add the two hash
+ // values or something, but fix this code!
+ //
+ char buffer[BUFSIZ];
+ ACE_OS::strcpy (buffer, this->event_type_.domain_name.in ());
+ ACE_OS::strcat (buffer, this->event_type_.type_name.in ());
+
+ this->hash_value_ = ACE::hash_pjw (buffer);
+}
+
+TAO_Notify_EventType&
+TAO_Notify_EventType::operator=(const CosNotification::EventType& event_type)
+{
+ this->init_i (event_type.domain_name.in (),event_type.type_name.in ());
+
+ return *this;
+}
+
+TAO_Notify_EventType&
+TAO_Notify_EventType::operator=(const TAO_Notify_EventType& event_type)
+{
+ if (this == &event_type)
+ return *this;
+
+ this->init_i (event_type.event_type_.domain_name.in (),event_type.event_type_.type_name.in ());
+
+ return *this;
+}
+
+bool
+TAO_Notify_EventType::operator==(const TAO_Notify_EventType& event_type) const
+{
+ if (this->hash () != event_type.hash ())
+ return false;
+ else // compare the strings
+ return (ACE_OS::strcmp (this->event_type_.type_name, event_type.event_type_.type_name) == 0 &&
+ ACE_OS::strcmp (this->event_type_.domain_name, event_type.event_type_.domain_name) == 0
+ );
+}
+
+bool
+TAO_Notify_EventType::operator!=(const TAO_Notify_EventType& event_type) const
+{
+ if (this->hash () != event_type.hash ())
+ return true;
+ else // compare the strings
+ return (ACE_OS::strcmp (this->event_type_.type_name, event_type.event_type_.type_name) != 0 ||
+ ACE_OS::strcmp (this->event_type_.domain_name, event_type.event_type_.domain_name) != 0
+ );
+}
+
+CORBA::Boolean
+TAO_Notify_EventType::is_special (void) const
+{
+ if ((this->event_type_.domain_name == 0 ||
+ ACE_OS::strcmp (this->event_type_.domain_name, "") == 0 ||
+ ACE_OS::strcmp (this->event_type_.domain_name, "*") == 0) &&
+ (this->event_type_.type_name == 0 ||
+ ACE_OS::strcmp (this->event_type_.type_name, "") == 0 ||
+ ACE_OS::strcmp (this->event_type_.type_name, "*") == 0 ||
+ ACE_OS::strcmp (this->event_type_.type_name, "%ALL") == 0))
+ return 1;
+ else
+ return 0;
+}
+
+void
+TAO_Notify_EventType::dump (void) const
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "(%s,%s)",
+ this->event_type_.domain_name.in (),
+ this->event_type_.type_name.in ()));
+}
+
+/// Initialize from an NVPList, return false on failure
+bool TAO_Notify_EventType::init(const TAO_Notify::NVPList& attrs)
+{
+ bool result = false;
+
+ ACE_CString domain;
+ ACE_CString type;
+ if (attrs.load("Domain", domain) && attrs.load("Type", type))
+ {
+ this->init_i(domain.c_str(), type.c_str());
+ result = true;
+ }
+ return result;
+
+}
+
+ // TAO_Notify::Topology_Object
+
+void
+TAO_Notify_EventType::save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL)
+{
+ TAO_Notify::NVPList attrs;
+ bool changed = true;
+
+ attrs.push_back(TAO_Notify::NVP("Domain", this->event_type_.domain_name.in()));
+ attrs.push_back(TAO_Notify::NVP("Type", this->event_type_.type_name.in()));
+ saver.begin_object(0, "subscription", attrs, changed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ saver.end_object(0, "subscription" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventType.h b/TAO/orbsvcs/orbsvcs/Notify/EventType.h
new file mode 100644
index 00000000000..d6ba4bd1033
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/EventType.h
@@ -0,0 +1,107 @@
+/* -*- C++ -*- */
+/**
+ * @file EventType.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_EVENTTYPE_H
+#define TAO_Notify_EVENTTYPE_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotificationC.h"
+#include "orbsvcs/Notify/Topology_Object.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_EventType
+ *
+ * @brief
+ *
+ * This type is used to compare different event types.
+ * It is used by the Event Manager as a key to find subscription lists.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_EventType : public TAO_Notify::Topology_Savable
+{
+public:
+ /// Constuctor
+ TAO_Notify_EventType (void);
+ TAO_Notify_EventType (const char* domain_name, const char* type_name);
+ TAO_Notify_EventType (const CosNotification::EventType& event_type);
+ // Constuctor
+
+ /// Destructor
+ virtual ~TAO_Notify_EventType ();
+
+ /// hash value
+ u_long hash (void) const;
+
+ /// Assignment from CosNotification::EventType
+ TAO_Notify_EventType& operator=(const CosNotification::EventType& event_type);
+
+ /// Assignment operator.
+ TAO_Notify_EventType& operator=(const TAO_Notify_EventType& event_type);
+
+ /// == operator
+ bool operator==(const TAO_Notify_EventType& notify_event_type) const;
+
+ /// != operator
+ bool operator!=(const TAO_Notify_EventType& notify_event_type) const;
+
+ static TAO_Notify_EventType special (void);
+ // Return the special event type.
+
+ CORBA::Boolean is_special (void) const;
+ // Is this the special event (accept everything).
+
+ const CosNotification::EventType& native (void) const;
+ // Get the type underneath us.
+
+ /// Helper to print contents.
+ void dump (void) const;
+
+ /// Initialize from an NVPList, return false on failure
+ bool init(const TAO_Notify::NVPList& attrs);
+
+ // TAO_Notify::Topology_Object
+
+ virtual void save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL);
+
+protected:
+ /// Init this object.
+ void init_i (const char* domain_name, const char* type_name);
+
+ void recompute_hash (void);
+ // Recompute the hash value.
+
+ // = Data Members
+ CosNotification::EventType event_type_;
+ // The event_type that we're decorating.
+
+ u_long hash_value_;
+ // The hash value computed.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/EventType.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_EVENTTYPE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventType.inl b/TAO/orbsvcs/orbsvcs/Notify/EventType.inl
new file mode 100644
index 00000000000..95a07479666
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/EventType.inl
@@ -0,0 +1,19 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE u_long
+TAO_Notify_EventType::hash (void) const
+{
+ return this->hash_value_;
+}
+
+ACE_INLINE const CosNotification::EventType&
+TAO_Notify_EventType::native (void) const
+{
+ return event_type_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventTypeSeq.cpp b/TAO/orbsvcs/orbsvcs/Notify/EventTypeSeq.cpp
new file mode 100644
index 00000000000..bd9d489dd63
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/EventTypeSeq.cpp
@@ -0,0 +1,317 @@
+// $Id$
+
+#include "orbsvcs/Notify/EventTypeSeq.h"
+#include "orbsvcs/Notify/Topology_Saver.h"
+
+#include "tao/debug.h"
+//#define DEBUG_LEVEL 9
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+ACE_RCSID(Notify, TAO_Notify_EventTypeSeq, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_EventTypeSeq::TAO_Notify_EventTypeSeq (void)
+{
+}
+
+TAO_Notify_EventTypeSeq::TAO_Notify_EventTypeSeq (const CosNotification::EventTypeSeq& event_type_seq)
+{
+ this->insert_seq (event_type_seq);
+}
+
+TAO_Notify_EventTypeSeq &
+TAO_Notify_EventTypeSeq::operator = (const TAO_Notify_EventTypeSeq & rhs)
+{
+ ACE_Unbounded_Set <TAO_Notify_EventType>::operator = (rhs);
+ return *this;
+}
+
+TAO_Notify_EventTypeSeq::TAO_Notify_EventTypeSeq (const TAO_Notify_EventTypeSeq & rhs)
+ : TAO_Notify_Object ()
+ , TAO_Notify::Topology_Savable ()
+ , ACE_Unbounded_Set <TAO_Notify_EventType> (rhs)
+ , TAO_Notify::Topology_Object ()
+{
+}
+
+void
+TAO_Notify_EventTypeSeq::populate (CosNotification::EventTypeSeq& event_type_seq) const
+{
+ event_type_seq.length (static_cast<CORBA::ULong> (this->size ()));
+
+ inherited::CONST_ITERATOR iter (*this);
+
+ TAO_Notify_EventType* event_type = 0;
+
+ CORBA::ULong i = 0;
+ for (iter.first (); iter.next (event_type); iter.advance (), ++i)
+ event_type_seq[i] = event_type->native ();
+}
+
+void
+TAO_Notify_EventTypeSeq::populate_no_special (CosNotification::EventTypeSeq& event_type_seq) const
+{
+ // If the special exists in us, don't include it.
+ const TAO_Notify_EventType& special = TAO_Notify_EventType::special ();
+
+ if (this->find (special) == 0)
+ {
+ event_type_seq.length (static_cast<CORBA::ULong> (this->size () - 1));
+ }
+ else
+ event_type_seq.length (static_cast<CORBA::ULong> (this->size ()));
+
+ inherited::CONST_ITERATOR iter (*this);
+
+ TAO_Notify_EventType* event_type;
+
+ CORBA::ULong i = 0;
+ for (iter.first (); iter.next (event_type); iter.advance (), ++i)
+ {
+ if (event_type->is_special () == 0) // if its not the special event type.
+ event_type_seq[i] = event_type->native ();
+ }
+}
+
+void
+TAO_Notify_EventTypeSeq::insert_seq (const CosNotification::EventTypeSeq& event_type_seq)
+{
+ TAO_Notify_EventType event_type;
+
+ for (CORBA::ULong i = 0; i < event_type_seq.length (); ++i)
+ {
+ event_type = event_type_seq[i];
+ inherited::insert (event_type);
+ }
+}
+
+void
+TAO_Notify_EventTypeSeq::remove_seq (const CosNotification::EventTypeSeq& event_type_seq)
+{
+ TAO_Notify_EventType event_type;
+
+ for (CORBA::ULong i = 0; i < event_type_seq.length (); ++i)
+ {
+ event_type = event_type_seq[i];
+ inherited::remove (event_type);
+ }
+}
+
+void
+TAO_Notify_EventTypeSeq::insert_seq (const TAO_Notify_EventTypeSeq& event_type_seq)
+{
+ TAO_Notify_EventTypeSeq::CONST_ITERATOR iter (event_type_seq);
+
+ TAO_Notify_EventType* event_type;
+
+ for (iter.first (); iter.next (event_type); iter.advance ())
+ inherited::insert (*event_type);
+}
+
+void
+TAO_Notify_EventTypeSeq::remove_seq (const TAO_Notify_EventTypeSeq& event_type_seq)
+{
+ TAO_Notify_EventTypeSeq::CONST_ITERATOR iter (event_type_seq);
+
+ TAO_Notify_EventType* event_type;
+
+ for (iter.first (); iter.next (event_type); iter.advance ())
+ inherited::remove (*event_type);
+}
+
+void
+TAO_Notify_EventTypeSeq::add_and_remove (TAO_Notify_EventTypeSeq& seq_added, TAO_Notify_EventTypeSeq& seq_remove)
+{
+ const TAO_Notify_EventType& special = TAO_Notify_EventType::special ();
+
+ if (this->find (special) == 0) // If this object has the special type.
+ {
+ if (seq_added.find (special) == 0) // if the seq. being added has the special type, you cannot be adding or removing anythings. * overrides.
+ {
+ seq_added.reset (); // remove everything from the sequence bening added.
+ seq_remove.reset (); // remove everything form whats being removed.
+ }
+ else // sequence being added does not have *
+ {
+ if (!seq_added.is_empty ()) // if sequence being added is non empty
+ {
+ this->reset (); // take away the * from this object.
+ this->insert_seq (seq_added); // insert the sequence being added as the new list of types.
+
+ seq_remove.reset (); // reset all that is being removed.
+ seq_remove.insert (special); // remove *
+ }
+ else // nothing is being added
+ {
+ if (seq_remove.find (special) == 0) // we're removing everything
+ {
+ this->reset ();
+ seq_remove.reset (); // reset all that is being removed.
+ seq_remove.insert (special); // remove *
+ }
+ else if (!seq_remove.is_empty ())
+ {
+ // if we're currently subscribed for everything and did not added anything, we can't remove something.
+ seq_remove.reset ();
+ }
+ }
+ }
+ }
+ else // if this object does not have the special type.
+ {
+ if (seq_added.find (special) == 0) // but the seq. being added has the special type,
+ {
+ if (seq_remove.find (special) == 0) // and you're removing * as well
+ {
+ seq_added.reset (); // ignore the request
+ seq_remove.reset (); // ignore the request
+ }
+ else // seq being removed does not have the special type
+ {
+ seq_remove.reset (); // everything that we're subscribed for is being removed.
+ seq_remove.insert_seq (*this);
+
+ this->reset (); // insert the special in this object.
+ this->insert (special);
+
+ seq_added.reset (); // also clear our set and add only *
+ seq_added.insert (special);
+ }
+ }
+ else // seq being added does not have special.
+ {
+ if (seq_remove.find (special) == 0) // but we're removing everything.
+ {
+ seq_remove.reset (); // move all that we have currently to removed.
+ seq_remove.insert_seq (*this);
+ }
+
+ // so now there are no specials anywhere..
+ {
+ //= First remove the duplicates in the added and removes lists.
+ // compute the intersection.
+
+ TAO_Notify_EventTypeSeq common;
+ common.intersection (seq_added, seq_remove);
+
+ // remove the common elements from both the lists so Added {BCDK} and Removed {CDEA} will yield Added {BK} and Removed {EA}
+ seq_added.remove_seq (common);
+ seq_remove.remove_seq (common);
+
+ // If we're already subscribed for an element we should not subscribe again (duplicate events).
+ // so if we currently subscribe for ABC and we Added {BK} we should now get ABCK as current subscription and Added {K}
+ common.reset ();
+ common.intersection (*this, seq_added);
+ // remove the common elements from the added list. i,e. doent ask to add what we're already added for.
+ seq_added.remove_seq (common);
+ // update the current subscription.
+ this->insert_seq (seq_added);
+
+
+ // Similarly for removed.. if we're removing EA and now our current list looks like ABC we should emd up with
+ // current subscription BC and Removed {A}
+ common.reset ();
+ common.intersection (*this, seq_remove);
+
+ seq_remove.reset ();
+ seq_remove.insert_seq (common); // only remove what we currently have.
+
+ this->remove_seq (seq_remove);
+ }
+ }
+ }
+}
+
+void
+TAO_Notify_EventTypeSeq::intersection (const TAO_Notify_EventTypeSeq& rhs, const TAO_Notify_EventTypeSeq& lhs)
+{
+ // linear search.
+ TAO_Notify_EventTypeSeq::CONST_ITERATOR rhs_iter (rhs);
+ TAO_Notify_EventType* rhs_event_type;
+
+ TAO_Notify_EventTypeSeq::CONST_ITERATOR lhs_iter (lhs);
+ TAO_Notify_EventType* lhs_event_type;
+
+ for (rhs_iter.first (); rhs_iter.next (rhs_event_type); rhs_iter.advance ())
+ {
+ for (lhs_iter.first (); lhs_iter.next (lhs_event_type); lhs_iter.advance ())
+ {
+ if (*rhs_event_type == *lhs_event_type) // if both are same add to this object.
+ this->insert (*rhs_event_type);
+ }
+ }
+}
+
+void
+TAO_Notify_EventTypeSeq::dump (void) const
+{
+ TAO_Notify_EventTypeSeq::CONST_ITERATOR iter (*this);
+
+ TAO_Notify_EventType* event_type;
+
+ for (iter.first (); iter.next (event_type); iter.advance ())
+ {
+ event_type->dump ();
+ ACE_DEBUG ((LM_DEBUG, ", "));
+ }
+}
+
+ // TAO_Notify::Topology_Object
+void
+TAO_Notify_EventTypeSeq::save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL)
+{
+ bool changed = this->self_changed_;
+ this->self_changed_ = false;
+ this->children_changed_ = false;
+ TAO_Notify::NVPList attrs;
+
+ TAO_Notify_EventTypeSeq::ITERATOR iter (*this);
+ TAO_Notify_EventType* event_type;
+
+ if (this->size() != 0)
+ {
+ saver.begin_object(0, "subscriptions", attrs, changed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ for (iter.first (); iter.next (event_type) != 0; iter.advance ())
+ {
+ event_type->save_persistent(saver ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+// todo:
+// for all deleted children
+// {
+// saver.delete_child(child_type, child_id);
+// }
+ saver.end_object(0, "subscriptions" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+TAO_Notify::Topology_Object*
+TAO_Notify_EventTypeSeq::load_child (const ACE_CString &type, CORBA::Long id,
+ const TAO_Notify::NVPList& attrs ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_UNUSED_ARG (id);
+ TAO_Notify::Topology_Object *result = this;
+ TAO_Notify_EventType et;
+
+ if ((type == "subscription") && et.init(attrs))
+ {
+ if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Event_Type reload subscription\n")
+ ));
+ inherited::insert(et);
+ }
+ return result;
+}
+
+void
+TAO_Notify_EventTypeSeq::release (void)
+{
+ delete this;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventTypeSeq.h b/TAO/orbsvcs/orbsvcs/Notify/EventTypeSeq.h
new file mode 100644
index 00000000000..cf66b603c04
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/EventTypeSeq.h
@@ -0,0 +1,88 @@
+/* -*- C++ -*- */
+/**
+ * @file EventTypeSeq.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_EVENTTYPESEQ_H
+#define TAO_Notify_EVENTTYPESEQ_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/EventType.h"
+#include "ace/Unbounded_Set.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_EventTypeSeq
+ *
+ * @brief Allows operations using the CosNotification::EventTypeSeq type.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_EventTypeSeq
+ : public ACE_Unbounded_Set <TAO_Notify_EventType>
+ , public TAO_Notify::Topology_Object
+{
+ typedef ACE_Unbounded_Set <TAO_Notify_EventType> inherited;
+
+public:
+ /// Constructor
+ TAO_Notify_EventTypeSeq (void);
+ TAO_Notify_EventTypeSeq (const CosNotification::EventTypeSeq& event_type_seq);
+ TAO_Notify_EventTypeSeq (const TAO_Notify_EventTypeSeq & rhs);
+ TAO_Notify_EventTypeSeq & operator = (const TAO_Notify_EventTypeSeq & rhs);
+
+ /// Preprocess the types added and removed.
+ void add_and_remove (TAO_Notify_EventTypeSeq& added, TAO_Notify_EventTypeSeq& removed);
+
+ /// Populate this sequence with the intersection of rhs and lhs.
+ void intersection (const TAO_Notify_EventTypeSeq& rhs, const TAO_Notify_EventTypeSeq& lhs);
+
+ /// insert_seq the contents of <event_type_seq> into this object.
+ void insert_seq (const CosNotification::EventTypeSeq& event_type_seq);
+
+ /// remove_seq the contents of <event_type_seq> from this object.
+ void remove_seq (const CosNotification::EventTypeSeq& event_type_seq);
+
+ /// insert_seq the contents of <event_type_seq> into this object.
+ void insert_seq (const TAO_Notify_EventTypeSeq& event_type_seq);
+
+ /// remove_seq the contents of <event_type_seq> from this object.
+ void remove_seq (const TAO_Notify_EventTypeSeq& event_type_seq);
+
+ /// Populate <event_type_seq> with the contents of this object.
+ void populate (CosNotification::EventTypeSeq& event_type) const;
+
+ /// Populate <event_type_seq> with the contents of this object.
+ // Excludes the special event type. This is used to avoid sending * type updates to proxys.
+ void populate_no_special (CosNotification::EventTypeSeq& event_type) const;
+
+ /// Print the contents.
+ void dump (void) const;
+
+ // TAO_Notify::Topology_Object
+
+ virtual void save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL);
+ virtual TAO_Notify::Topology_Object* load_child (const ACE_CString &type, CORBA::Long id,
+ const TAO_Notify::NVPList& attrs ACE_ENV_ARG_DECL);
+
+private:
+
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_EVENTTYPESEQ_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.cpp b/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.cpp
new file mode 100644
index 00000000000..35264373bd4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.cpp
@@ -0,0 +1,309 @@
+// $Id$
+
+#include "orbsvcs/Notify/Event_Manager.h"
+
+ACE_RCSID(Notify, TAO_Notify_Event_Manager, "$Id$")
+
+#include "orbsvcs/Notify/ProxyConsumer.h"
+#include "orbsvcs/Notify/ProxySupplier.h"
+#include "orbsvcs/Notify/Consumer_Map.h"
+#include "orbsvcs/Notify/Supplier_Map.h"
+#include "orbsvcs/Notify/Event_Map_T.h"
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+
+#include "tao/debug.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/*****************************************************************************/
+
+/**
+ * @class TAO_Notify_ProxyConsumer_Update_Worker
+ *
+ * @brief Inform ProxyConsumer of updates.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_ProxyConsumer_Update_Worker : public TAO_ESF_Worker<TAO_Notify_ProxyConsumer>
+{
+public:
+ TAO_Notify_ProxyConsumer_Update_Worker (const TAO_Notify_EventTypeSeq& added, const TAO_Notify_EventTypeSeq& removed);
+
+protected:
+ ///= TAO_ESF_Worker method
+ void work (TAO_Notify_ProxyConsumer* proxy ACE_ENV_ARG_DECL);
+
+ const TAO_Notify_EventTypeSeq& added_;
+ const TAO_Notify_EventTypeSeq& removed_;
+};
+
+/********************************************************************************/
+
+/**
+ * @class TAO_Notify_ProxySupplier_Update_Worker
+ *
+ * @brief Inform ProxySupplier of updates.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_ProxySupplier_Update_Worker : public TAO_ESF_Worker<TAO_Notify_ProxySupplier>
+{
+public:
+ TAO_Notify_ProxySupplier_Update_Worker (const TAO_Notify_EventTypeSeq& added, const TAO_Notify_EventTypeSeq& removed);
+
+protected:
+ ///= TAO_ESF_Worker method
+ void work (TAO_Notify_ProxySupplier* proxy ACE_ENV_ARG_DECL);
+
+ const TAO_Notify_EventTypeSeq& added_;
+ const TAO_Notify_EventTypeSeq& removed_;
+};
+
+/********************************************************************************/
+
+TAO_Notify_Event_Manager::TAO_Notify_Event_Manager (void)
+{
+}
+
+TAO_Notify_Event_Manager::~TAO_Notify_Event_Manager ()
+{
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "destroying consumer/supplier map count = %d/%d, \n",
+ this->consumer_map().proxy_count (), this->supplier_map().proxy_count ()));
+ }
+}
+
+void TAO_Notify_Event_Manager::release()
+{
+ delete this;
+}
+
+void
+TAO_Notify_Event_Manager::init (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_ASSERT (this->consumer_map_.get() == 0);
+
+ TAO_Notify_Consumer_Map* consumer_map = 0;
+ ACE_NEW_THROW_EX (consumer_map,
+ TAO_Notify_Consumer_Map (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ this->consumer_map_.reset( consumer_map );
+
+ this->consumer_map().init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_Notify_Supplier_Map* supplier_map = 0;
+ ACE_NEW_THROW_EX (supplier_map,
+ TAO_Notify_Supplier_Map (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ this->supplier_map_.reset( supplier_map );
+
+ this->supplier_map_->init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Event_Manager::shutdown (void)
+{
+}
+
+void
+TAO_Notify_Event_Manager::connect (TAO_Notify_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL)
+{
+ this->consumer_map().connect (proxy_supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Inform about offered types.
+ TAO_Notify_EventTypeSeq removed;
+ proxy_supplier->types_changed (this->offered_types (), removed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Event_Manager::disconnect (TAO_Notify_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL)
+{
+ this->consumer_map().disconnect (proxy_supplier ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Event_Manager::connect (TAO_Notify_ProxyConsumer* proxy_consumer ACE_ENV_ARG_DECL)
+{
+ this->supplier_map().connect (proxy_consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ // Inform about subscription types.
+ TAO_Notify_EventTypeSeq removed;
+ proxy_consumer->types_changed (this->subscription_types (), removed ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Event_Manager::disconnect (TAO_Notify_ProxyConsumer* proxy_consumer ACE_ENV_ARG_DECL)
+{
+ this->supplier_map().disconnect (proxy_consumer ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Event_Manager::offer_change (TAO_Notify_ProxyConsumer* proxy_consumer, const TAO_Notify_EventTypeSeq& added, const TAO_Notify_EventTypeSeq& removed ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_EventTypeSeq new_added, last_removed;
+
+ this->publish (proxy_consumer, added, new_added ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->un_publish (proxy_consumer, removed, last_removed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_Notify_Consumer_Map::ENTRY::COLLECTION* updates_collection = this->consumer_map().updates_collection ();
+
+ TAO_Notify_ProxySupplier_Update_Worker worker (new_added, last_removed);
+
+ if (updates_collection != 0)
+ updates_collection->for_each (&worker ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Event_Manager::subscription_change (TAO_Notify_ProxySupplier* proxy_supplier, const TAO_Notify_EventTypeSeq& added, const TAO_Notify_EventTypeSeq& removed ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_EventTypeSeq new_added, last_removed;
+
+ this->subscribe (proxy_supplier, added, new_added ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->un_subscribe (proxy_supplier, removed, last_removed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_Notify_Supplier_Map::ENTRY::COLLECTION* updates_collection = this->supplier_map().updates_collection ();
+
+ TAO_Notify_ProxyConsumer_Update_Worker worker (new_added, last_removed);
+
+ if (updates_collection != 0)
+ {
+ updates_collection->for_each (&worker ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_Notify_Event_Manager::subscribe (TAO_Notify_ProxySupplier* proxy_supplier, const TAO_Notify_EventTypeSeq& seq, TAO_Notify_EventTypeSeq& new_seq ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_EventTypeSeq::CONST_ITERATOR iter (seq);
+
+ TAO_Notify_EventType* event_type;
+
+ for (iter.first (); iter.next (event_type) != 0; iter.advance ())
+ {
+ int result = this->consumer_map().insert (proxy_supplier, *event_type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (result == 1)
+ new_seq.insert (*event_type);
+ }
+}
+
+void
+TAO_Notify_Event_Manager::un_subscribe (TAO_Notify_ProxySupplier* proxy_supplier, const TAO_Notify_EventTypeSeq& seq, TAO_Notify_EventTypeSeq& last_seq ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_EventTypeSeq::CONST_ITERATOR iter (seq);
+
+ TAO_Notify_EventType* event_type = 0;
+
+ for (iter.first (); iter.next (event_type) != 0; iter.advance ())
+ {
+ int result = this->consumer_map().remove (proxy_supplier, *event_type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (result == 1)
+ last_seq.insert (*event_type);
+ }
+}
+
+void
+TAO_Notify_Event_Manager::publish (TAO_Notify_ProxyConsumer* proxy_consumer, const TAO_Notify_EventTypeSeq& seq, TAO_Notify_EventTypeSeq& new_seq ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_EventTypeSeq::CONST_ITERATOR iter (seq);
+
+ TAO_Notify_EventType* event_type = 0;
+
+ for (iter.first (); iter.next (event_type) != 0; iter.advance ())
+ {
+ int result = supplier_map().insert (proxy_consumer, *event_type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (result == 1)
+ new_seq.insert (*event_type);
+ }
+}
+
+void
+TAO_Notify_Event_Manager::un_publish (TAO_Notify_ProxyConsumer* proxy_consumer, const TAO_Notify_EventTypeSeq& seq, TAO_Notify_EventTypeSeq& last_seq ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_EventTypeSeq::CONST_ITERATOR iter (seq);
+
+ TAO_Notify_EventType* event_type = 0;
+
+ for (iter.first (); iter.next (event_type) != 0; iter.advance ())
+ {
+ int result = supplier_map().remove (proxy_consumer, *event_type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (result == 1)
+ last_seq.insert (*event_type);
+ }
+}
+
+TAO_Notify_Consumer_Map&
+TAO_Notify_Event_Manager::consumer_map (void)
+{
+ ACE_ASSERT( this->consumer_map_.get() != 0 );
+ return *this->consumer_map_;
+}
+
+TAO_Notify_Supplier_Map&
+TAO_Notify_Event_Manager::supplier_map (void)
+{
+ ACE_ASSERT( this->supplier_map_.get() != 0 );
+ return *this->supplier_map_;
+}
+
+const TAO_Notify_EventTypeSeq&
+TAO_Notify_Event_Manager::offered_types (void) const
+{
+ return this->supplier_map_->event_types ();
+}
+
+const TAO_Notify_EventTypeSeq&
+TAO_Notify_Event_Manager::subscription_types (void) const
+{
+ return this->consumer_map_->event_types ();
+}
+
+/********************************************************************************/
+
+TAO_Notify_ProxyConsumer_Update_Worker::TAO_Notify_ProxyConsumer_Update_Worker (const TAO_Notify_EventTypeSeq& added, const TAO_Notify_EventTypeSeq& removed)
+ :added_ (added), removed_ (removed)
+{
+}
+
+void
+TAO_Notify_ProxyConsumer_Update_Worker::work (TAO_Notify_ProxyConsumer* proxy ACE_ENV_ARG_DECL)
+{
+ proxy->types_changed (added_, removed_ ACE_ENV_ARG_PARAMETER);
+}
+
+/*****************************************************************************/
+
+TAO_Notify_ProxySupplier_Update_Worker::TAO_Notify_ProxySupplier_Update_Worker (const TAO_Notify_EventTypeSeq& added, const TAO_Notify_EventTypeSeq& removed)
+ :added_ (added), removed_ (removed)
+{
+}
+
+void
+TAO_Notify_ProxySupplier_Update_Worker::work (TAO_Notify_ProxySupplier* proxy ACE_ENV_ARG_DECL)
+{
+ proxy->types_changed (added_, removed_ ACE_ENV_ARG_PARAMETER);
+}
+
+/*****************************************************************************/
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.h b/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.h
new file mode 100644
index 00000000000..ee897512072
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.h
@@ -0,0 +1,136 @@
+/* -*- C++ -*- */
+/**
+ * @file Event_Manager.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_EVENT_MANAGER_H
+#define TAO_Notify_EVENT_MANAGER_H
+
+#include /**/ "ace/pre.h"
+#include "ace/Auto_Ptr.h"
+
+#include "orbsvcs/Notify/Refcountable.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/orbconf.h"
+
+#include "ace/CORBA_macros.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_ProxySupplier;
+class TAO_Notify_ProxyConsumer;
+class TAO_Notify_EventTypeSeq;
+
+template <class PROXY, class ACE_LOCK>
+class TAO_Notify_Event_Map_T;
+
+typedef TAO_Notify_Event_Map_T<TAO_Notify_ProxySupplier,
+ TAO_SYNCH_RW_MUTEX>
+ TAO_Notify_Consumer_Map;
+
+typedef TAO_Notify_Event_Map_T<TAO_Notify_ProxyConsumer,
+ TAO_SYNCH_RW_MUTEX>
+ TAO_Notify_Supplier_Map;
+
+namespace CORBA
+{
+ class Environment;
+}
+
+/**
+ * @class TAO_Notify_Event_Manager
+ *
+ * @brief A class that manages the Consumer and Supplier maps.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Event_Manager : public TAO_Notify_Refcountable
+{
+public:
+ typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_Event_Manager > Ptr;
+ /// Constuctor
+ TAO_Notify_Event_Manager (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Event_Manager ();
+
+ void release();
+
+ /// Init
+ void init (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Init
+ void shutdown (void);
+
+ /// Connect ProxySupplier
+ void connect (TAO_Notify_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL);
+
+ /// Disconnect ProxySupplier
+ void disconnect (TAO_Notify_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL);
+
+ /// Connect ProxyConsumer
+ void connect (TAO_Notify_ProxyConsumer* proxy_consumer ACE_ENV_ARG_DECL);
+
+ /// Disconnect ProxyConsumer
+ void disconnect (TAO_Notify_ProxyConsumer* proxy_consumer ACE_ENV_ARG_DECL);
+
+ /// Map accessors.
+ TAO_Notify_Consumer_Map& consumer_map (void);
+ TAO_Notify_Supplier_Map& supplier_map (void);
+
+ /// Offer change received on <proxy_consumer>.
+ void offer_change (TAO_Notify_ProxyConsumer* proxy_consumer, const TAO_Notify_EventTypeSeq& added, const TAO_Notify_EventTypeSeq& removed ACE_ENV_ARG_DECL);
+
+ /// Subscription change received on <proxy_supplier>.
+ void subscription_change (TAO_Notify_ProxySupplier* proxy_supplier, const TAO_Notify_EventTypeSeq& added, const TAO_Notify_EventTypeSeq& removed ACE_ENV_ARG_DECL);
+
+ /// What are the types being offered.
+ const TAO_Notify_EventTypeSeq& offered_types (void) const;
+
+ /// What are the types being subscribed.
+ const TAO_Notify_EventTypeSeq& subscription_types (void) const;
+
+protected:
+ /// Subscribe <proxy_supplier> to the event type sequence list <seq>.
+ void subscribe (TAO_Notify_ProxySupplier* proxy_supplier, const TAO_Notify_EventTypeSeq& seq, TAO_Notify_EventTypeSeq& new_seq ACE_ENV_ARG_DECL);
+
+ /// Unsubscribe <proxy_supplier> to the event type sequence list <seq>.
+ void un_subscribe (TAO_Notify_ProxySupplier* proxy_supplier, const TAO_Notify_EventTypeSeq& seq, TAO_Notify_EventTypeSeq& last_seq ACE_ENV_ARG_DECL);
+
+ /// Subscribe <proxy_consumer> to the event type sequence list <seq>.
+ void publish (TAO_Notify_ProxyConsumer* proxy_consumer, const TAO_Notify_EventTypeSeq& seq, TAO_Notify_EventTypeSeq& new_seq ACE_ENV_ARG_DECL);
+
+ /// Subscribe <proxy_consumer> to the event type sequence list <seq>.
+ void un_publish (TAO_Notify_ProxyConsumer* proxy_consumer, const TAO_Notify_EventTypeSeq& seq, TAO_Notify_EventTypeSeq& last_seq ACE_ENV_ARG_DECL);
+
+private:
+ // Disallow copying and assignment; we don't need them
+ // and if we let the compiler generate them it needs the
+ // full declaration of the template arguments for ACE_Auto_Ptr<>
+ // below.
+ TAO_Notify_Event_Manager (TAO_Notify_Event_Manager&);
+ TAO_Notify_Event_Manager& operator= (TAO_Notify_Event_Manager&);
+
+ /// Consumer Map
+ ACE_Auto_Ptr< TAO_Notify_Consumer_Map > consumer_map_;
+
+ /// Supplier Map
+ ACE_Auto_Ptr< TAO_Notify_Supplier_Map > supplier_map_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_EVENT_MANAGER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.cpp
new file mode 100644
index 00000000000..5488c3ad420
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.cpp
@@ -0,0 +1,58 @@
+// $Id$
+
+#ifndef TAO_Notify_EVENT_MAP_ENTRY_CPP
+#define TAO_Notify_EVENT_MAP_ENTRY_CPP
+
+#include "orbsvcs/Notify/Event_Map_Entry_T.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Event_Map_Entry_T.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Notify,
+ TAO_Notify_Event_Map_Entry_T,
+ "$Id$")
+
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/Factory.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class PROXY>
+TAO_Notify_Event_Map_Entry_T<PROXY>::TAO_Notify_Event_Map_Entry_T (void)
+ : collection_ (0), count_ (0), usage_count_ (1)
+{
+}
+
+template <class PROXY>
+TAO_Notify_Event_Map_Entry_T<PROXY>::~TAO_Notify_Event_Map_Entry_T ()
+{
+ delete collection_;
+}
+
+template <class PROXY> void
+TAO_Notify_Event_Map_Entry_T<PROXY>::init (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Factory* factory = TAO_Notify_PROPERTIES::instance ()->factory ();
+
+ factory->create (collection_ ACE_ENV_ARG_PARAMETER);
+}
+
+template <class PROXY> void
+TAO_Notify_Event_Map_Entry_T<PROXY>::connected (PROXY* proxy ACE_ENV_ARG_DECL)
+{
+ this->collection_->connected (proxy ACE_ENV_ARG_PARAMETER);
+ ++count_;
+}
+
+template <class PROXY> void
+TAO_Notify_Event_Map_Entry_T<PROXY>::disconnected (PROXY* proxy ACE_ENV_ARG_DECL)
+{
+ this->collection_->disconnected (proxy ACE_ENV_ARG_PARAMETER);
+ --count_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_Notify_EVENT_MAP_ENTRY_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.h b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.h
new file mode 100644
index 00000000000..e362f9a7efb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.h
@@ -0,0 +1,101 @@
+/* -*- C++ -*- */
+/**
+ * @file Event_Map_Entry_T.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_EVENT_MAP_ENTRY_T_H
+#define TAO_Notify_EVENT_MAP_ENTRY_T_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Copy_Disabled.h"
+#include "ace/Atomic_Op.h"
+#include "ace/CORBA_macros.h"
+#include "tao/ORB_Constants.h"
+#include "tao/orbconf.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class PROXY, class ACE_LOCK> class TAO_Notify_Event_Map_T;
+template <class PROXY> class TAO_ESF_Proxy_Collection;
+
+/**
+ * @class TAO_Notify_Event_Map_Entry_T
+ *
+ * @brief The entry stored in the event map.
+ *
+ */
+template <class PROXY>
+class TAO_Notify_Event_Map_Entry_T : private ACE_Copy_Disabled
+{
+public:
+ typedef TAO_ESF_Proxy_Collection<PROXY> COLLECTION;
+
+ /// Constructor
+ TAO_Notify_Event_Map_Entry_T (void);
+
+ /// Destructor
+ ~TAO_Notify_Event_Map_Entry_T (void);
+
+ /// Init - Allocates collection
+ void init (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Connect
+ void connected (PROXY* proxy ACE_ENV_ARG_DECL);
+
+ /// Disconnect
+ void disconnected (PROXY* proxy ACE_ENV_ARG_DECL);
+
+ /// Collection accessor
+ COLLECTION* collection (void);
+
+ /// Count accessor
+ int count (void);
+
+ ///= Reference counting methods.
+ // Incr the ref count.
+ CORBA::ULong _incr_refcnt (void);
+
+ // Decr the ref count. This object is destroyed when the count is 0.
+ CORBA::ULong _decr_refcnt (void);
+
+protected:
+ /// The Collection
+ COLLECTION* collection_;
+
+ /// Count of PROXY's connected in the collection;
+ int count_;
+
+ /// Count of users accessing this entry.
+ ACE_Atomic_Op<TAO_SYNCH_MUTEX,int> usage_count_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Event_Map_Entry_T.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Notify/Event_Map_Entry_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Event_Map_Entry_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_EVENT_MAP_ENTRY_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.inl
new file mode 100644
index 00000000000..89da0eaed96
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.inl
@@ -0,0 +1,31 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class PROXY> ACE_INLINE ACE_TYPENAME
+TAO_Notify_Event_Map_Entry_T<PROXY>::COLLECTION*
+TAO_Notify_Event_Map_Entry_T<PROXY>::collection (void) {
+ return collection_;
+}
+
+template <class PROXY> ACE_INLINE int
+TAO_Notify_Event_Map_Entry_T<PROXY>::count (void)
+{
+ return this->count_;
+}
+
+template <class PROXY> ACE_INLINE CORBA::ULong
+TAO_Notify_Event_Map_Entry_T<PROXY>::_incr_refcnt (void)
+{
+ return ++this->usage_count_;
+}
+
+template <class PROXY> ACE_INLINE CORBA::ULong
+TAO_Notify_Event_Map_Entry_T<PROXY>::_decr_refcnt (void)
+{
+ return --this->usage_count_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.cpp
new file mode 100644
index 00000000000..121d1f51fd0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.cpp
@@ -0,0 +1,166 @@
+// $Id$
+
+#ifndef TAO_Notify_EVENT_MAP_T_CPP
+#define TAO_Notify_EVENT_MAP_T_CPP
+
+#include "orbsvcs/Notify/Event_Map_T.h"
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+#include "orbsvcs/Notify/Event_Map_Entry_T.h"
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/Factory.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Event_Map_T.inl"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class PROXY, class ACE_LOCK>
+TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::TAO_Notify_Event_Map_T (void)
+ :proxy_count_ (0)
+{
+
+}
+
+template <class PROXY, class ACE_LOCK>
+TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::~TAO_Notify_Event_Map_T ()
+{
+}
+
+template <class PROXY, class ACE_LOCK> void
+TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::init (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->broadcast_entry_.init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->updates_entry_.init (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+template <class PROXY, class ACE_LOCK> void
+TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::connect (PROXY* proxy ACE_ENV_ARG_DECL)
+{
+ this->updates_entry_.connected (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_WRITE_GUARD (ACE_LOCK, ace_mon, this->lock_);
+ ++this->proxy_count_;
+}
+
+template <class PROXY, class ACE_LOCK> void
+TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::disconnect (PROXY* proxy ACE_ENV_ARG_DECL)
+{
+ this->updates_entry_.disconnected (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_WRITE_GUARD (ACE_LOCK, ace_mon, this->lock_);
+ --this->proxy_count_;
+}
+
+template <class PROXY, class ACE_LOCK> int
+TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::insert (PROXY* proxy, const TAO_Notify_EventType& event_type ACE_ENV_ARG_DECL)
+{
+ ENTRY* entry;
+
+ int result = -1;
+
+ if (event_type.is_special () == 1)
+ {
+ entry = &this->broadcast_entry_;
+
+ result = 0;
+ }
+ else
+ {
+ ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
+
+ result = this->map_.find (event_type, entry);
+ }
+
+ if (result == -1) // This type is being seen for the first time.
+ {
+ ACE_NEW_THROW_EX (entry,
+ ENTRY (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (-1);
+
+ entry->init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ entry->connected (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
+
+ if (map_.bind (event_type, entry) == -1)
+ ACE_THROW_RETURN (CORBA::NO_MEMORY (), -1);
+
+ if (this->event_types_.insert (event_type) == -1)
+ return -1;
+
+ return 1;
+ }
+ else // Add to existing entry or the broadcast entry.
+ {
+ entry->connected (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ return 0;
+}
+
+template <class PROXY, class ACE_LOCK> int
+TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::remove (PROXY* proxy, const TAO_Notify_EventType& event_type ACE_ENV_ARG_DECL)
+{
+ ENTRY* entry = 0;
+
+ if (event_type.is_special () == 1)
+ {
+ entry = &this->broadcast_entry_;
+
+ entry->disconnected (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ else
+ {
+ int result = -1;
+
+ {
+ ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
+
+ result = this->map_.find (event_type, entry);
+ }
+
+ if (result == 0)
+ {
+ entry->disconnected (proxy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (entry->count () == 0)
+ {
+ /// Exec a strategy for removing entries.
+ /// Strategy 1: remove_immediately
+ /// Strategy 2: remove a bunch_after crossing a threshold
+ /// Strategy 3: use cached allocator and 1
+
+ // Strategy 1:
+ ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
+
+ this->map_.unbind (event_type);
+
+ if (entry->_decr_refcnt () == 0)
+ delete entry;
+
+ if (this->event_types_.remove (event_type) == -1)
+ return -1;
+
+ return 1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_Notify_EVENT_MAP_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.h b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.h
new file mode 100644
index 00000000000..011cb6530da
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.h
@@ -0,0 +1,123 @@
+/* -*- C++ -*- */
+/**
+ * @file Event_Map_T.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_EVENT_MAP_T_H
+#define TAO_Notify_EVENT_MAP_T_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Hash_Map_Manager.h"
+#include "ace/CORBA_macros.h"
+
+#include "orbsvcs/Notify/EventType.h"
+#include "orbsvcs/Notify/Event_Map_Entry_T.h"
+#include "orbsvcs/Notify/EventTypeSeq.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Event_Map_T
+ *
+ * @brief Template class for storing the collection of Proxys.
+ *
+ */
+template <class PROXY, class ACE_LOCK>
+class TAO_Notify_Event_Map_T
+{
+
+public:
+ typedef TAO_Notify_Event_Map_Entry_T<PROXY> ENTRY;
+
+ /// Constuctor
+ TAO_Notify_Event_Map_T (void);
+
+ /// Destructor
+ ~TAO_Notify_Event_Map_T ();
+
+ /// Init
+ void init (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Connect a PROXY
+ void connect (PROXY* proxy ACE_ENV_ARG_DECL);
+
+ /// Disconnect a PROXY
+ void disconnect (PROXY* proxy ACE_ENV_ARG_DECL);
+
+ /// Associate PROXY and event_type.
+ /// Returns 1 if <event_type> is being seem for the 1st time otherwise returns 0.
+ /// Returns -1 on error.
+ int insert (PROXY* proxy, const TAO_Notify_EventType& event_type ACE_ENV_ARG_DECL);
+
+ /// Remove association of PROXY and event_type.
+ /// Returns 1 if <event_type> is being seem for the last time otherwise returns 0.
+ /// Returns -1 on error.
+ int remove (PROXY* proxy, const TAO_Notify_EventType& event_type ACE_ENV_ARG_DECL);
+
+ /// Find the collection mapped to the <event_type>
+ /// The usage_count on the entry returned is incremented.
+ ENTRY* find (const TAO_Notify_EventType& event_type ACE_ENV_ARG_DECL);
+
+ /// Find the default broadcast list.
+ ACE_TYPENAME ENTRY::COLLECTION* broadcast_collection (void);
+
+ /// Find the update list. This is all the PROXYS connected to this Map.
+ ACE_TYPENAME ENTRY::COLLECTION* updates_collection (void);
+
+ /// Release the usage count on this entry.
+ void release (ENTRY* entry);
+
+ /// Access all the event types available
+ const TAO_Notify_EventTypeSeq& event_types (void);
+
+ /// Access number of proxys connected in all.
+ int proxy_count (void);
+
+protected:
+ /// The Map that stores eventtype to entry mapping.
+ ACE_Hash_Map_Manager <TAO_Notify_EventType, ENTRY*, ACE_SYNCH_NULL_MUTEX> map_;
+
+ /// The lock to use.
+ ACE_LOCK lock_;
+
+ /// Count of proxys connected.
+ int proxy_count_;
+
+ /// The default broadcast list for EventType::special.
+ ENTRY broadcast_entry_;
+
+ /// Update Entry - Keeps a list of all PROXY's connected to this Map. Updates are send to this list.
+ ENTRY updates_entry_;
+
+ /// The event types that are available in this map.
+ TAO_Notify_EventTypeSeq event_types_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Event_Map_T.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Notify/Event_Map_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Event_Map_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_EVENT_MAP_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.inl
new file mode 100644
index 00000000000..2b485893049
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.inl
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class PROXY, class ACE_LOCK> ACE_INLINE TAO_Notify_Event_Map_Entry_T<PROXY>*
+TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::find (const TAO_Notify_EventType& event_type ACE_ENV_ARG_DECL_NOT_USED)
+{
+ TAO_Notify_Event_Map_Entry_T<PROXY>* entry;
+
+ ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, 0);
+
+ if (map_.find (event_type, entry) == 0)
+ {
+ entry->_incr_refcnt ();
+ return entry;
+ }
+ else
+ return 0;
+}
+
+template <class PROXY, class ACE_LOCK> ACE_INLINE void
+TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::release (ENTRY* entry)
+{
+ ACE_WRITE_GUARD (ACE_LOCK, ace_mon, this->lock_);
+
+ if (entry->_decr_refcnt () == 0)
+ delete entry;
+}
+
+template <class PROXY, class ACE_LOCK> ACE_INLINE ACE_TYPENAME TAO_Notify_Event_Map_Entry_T<PROXY>::COLLECTION*
+TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::broadcast_collection (void)
+{
+ return this->broadcast_entry_.collection ();
+}
+
+template <class PROXY, class ACE_LOCK> ACE_INLINE ACE_TYPENAME TAO_Notify_Event_Map_Entry_T<PROXY>::COLLECTION*
+TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::updates_collection (void)
+{
+ return this->updates_entry_.collection ();
+}
+
+template <class PROXY, class ACE_LOCK> ACE_INLINE int
+TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::proxy_count (void)
+{
+ return this->proxy_count_;
+}
+
+template <class PROXY, class ACE_LOCK> ACE_INLINE const TAO_Notify_EventTypeSeq&
+TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::event_types (void)
+{
+ return this->event_types_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Persistence_Factory.cpp b/TAO/orbsvcs/orbsvcs/Notify/Event_Persistence_Factory.cpp
new file mode 100644
index 00000000000..3caa8a0c5a1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Persistence_Factory.cpp
@@ -0,0 +1,13 @@
+#include "orbsvcs/Notify/Event_Persistence_Factory.h"
+
+ACE_RCSID (Notify,
+ Event_Persistence_Factory,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify::Event_Persistence_Factory::~Event_Persistence_Factory (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Persistence_Factory.h b/TAO/orbsvcs/orbsvcs/Notify/Event_Persistence_Factory.h
new file mode 100644
index 00000000000..0abc936b92a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Persistence_Factory.h
@@ -0,0 +1,54 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file Event_Persistence_Factory.h
+ *
+ * $Id$
+ *
+ * A factory class that creates a Routing_Slip_Persistence_Manager.
+ *
+ * @author Jonathan Pollack <pollack_j@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef EVENT_PERSISTENCE_FACTORY_H
+#define EVENT_PERSISTENCE_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ class Routing_Slip_Persistence_Manager;
+ class Persistent_Callback;
+
+ /// interface to be implemented by specific Event_Persistence_Factories
+ class TAO_Notify_Serv_Export Event_Persistence_Factory
+ {
+ public:
+ virtual ~Event_Persistence_Factory();
+
+ /// Create a Persistence Manager
+ virtual Routing_Slip_Persistence_Manager *
+ create_routing_slip_persistence_manager (Persistent_Callback * callback) = 0;
+
+ /// Begin the reload process by returning the first Routing_Slip_Persistence_Manager
+ /// to continue call Routing_Slip_Persistence_Manager::load_next ()
+ virtual Routing_Slip_Persistence_Manager * first_reload_manager () = 0;
+
+ };
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* EVENT_PERSISTENCE_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Persistence_Strategy.h b/TAO/orbsvcs/orbsvcs/Notify/Event_Persistence_Strategy.h
new file mode 100644
index 00000000000..51019bac62a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Persistence_Strategy.h
@@ -0,0 +1,51 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file Event_Persistence_Strategy.h
+ *
+ * $Id$
+ *
+ * A factory class that creates a Routing_Slip_Persistence_Manager.
+ *
+ * @author Jonathan Pollack <pollack_j@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef EVENT_PERSISTENCE_STRATEGY_H
+#define EVENT_PERSISTENCE_STRATEGY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+#include "ace/Service_Object.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ class Event_Persistence_Factory;
+
+ /// Interface to be implemented by specific strategies
+ class TAO_Notify_Serv_Export Event_Persistence_Strategy: public ACE_Service_Object
+ {
+ public:
+
+ // get the current factory, creating it if necessary
+ virtual Event_Persistence_Factory * get_factory () = 0;
+
+ // release the current factory so a new one can be created
+ virtual void reset () = 0;
+ };
+
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* EVENT_PERSISTENCE_STRATEGY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Factory.h b/TAO/orbsvcs/orbsvcs/Notify/Factory.h
new file mode 100644
index 00000000000..22fc4dcf653
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Factory.h
@@ -0,0 +1,136 @@
+/* -*- C++ -*- */
+/**
+ * @file Factory.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_FACTORY_H
+#define TAO_Notify_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+#include "ace/CORBA_macros.h"
+#include "ace/Service_Object.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Lock;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Object;
+class TAO_Notify_EventChannelFactory;
+class TAO_Notify_EventChannel;
+class TAO_Notify_SupplierAdmin;
+class TAO_Notify_ConsumerAdmin;
+class TAO_Notify_ProxyPushConsumer;
+class TAO_Notify_CosEC_ProxyPushSupplier;
+class TAO_Notify_CosEC_ProxyPushConsumer;
+class TAO_Notify_ProxyPushSupplier;
+class TAO_Notify_StructuredProxyPushConsumer;
+class TAO_Notify_StructuredProxyPushSupplier;
+class TAO_Notify_SequenceProxyPushConsumer;
+class TAO_Notify_SequenceProxyPushSupplier;
+class TAO_Notify_ProxyConsumer;
+class TAO_Notify_ProxySupplier;
+class TAO_Notify_ConsumerAdmin;
+class TAO_Notify_SupplierAdmin;
+class TAO_Notify_Proxy;
+class TAO_Notify_Consumer;
+class TAO_Notify_Supplier;
+class TAO_Notify_Peer;
+
+namespace CORBA
+{
+ class Environment;
+}
+
+template <class PROXY> class TAO_ESF_Proxy_Collection;
+
+typedef TAO_ESF_Proxy_Collection<TAO_Notify_ProxyConsumer> TAO_Notify_ProxyConsumer_Collection;
+typedef TAO_ESF_Proxy_Collection<TAO_Notify_ProxySupplier> TAO_Notify_ProxySupplier_Collection;
+
+typedef TAO_ESF_Proxy_Collection<TAO_Notify_EventChannel> TAO_Notify_EventChannel_Collection;
+typedef TAO_ESF_Proxy_Collection<TAO_Notify_ConsumerAdmin> TAO_Notify_ConsumerAdmin_Collection;
+typedef TAO_ESF_Proxy_Collection<TAO_Notify_SupplierAdmin> TAO_Notify_SupplierAdmin_Collection;
+typedef TAO_ESF_Proxy_Collection<TAO_Notify_Proxy> TAO_Notify_Proxy_Collection;
+
+/**
+ * @class TAO_Notify_Factory
+ *
+ * @brief Factory interface for creating Notify Objects.
+ *
+ */
+class /*TAO_Notify_Serv_Export*/ TAO_Notify_Factory : public ACE_Service_Object
+{
+public:
+ /// Create ProxySupplier Collection
+ virtual void create (TAO_Notify_ProxySupplier_Collection*& collection ACE_ENV_ARG_DECL) = 0;
+
+ /// Create ProxyConsumer Collection
+ virtual void create (TAO_Notify_ProxyConsumer_Collection*& collection ACE_ENV_ARG_DECL) = 0;
+
+ /// Create EventChannel Collection
+ virtual void create (TAO_Notify_EventChannel_Collection*& collection ACE_ENV_ARG_DECL) = 0;
+
+ /// Create ConsumerAdmin Collection
+ virtual void create (TAO_Notify_ConsumerAdmin_Collection*& collection ACE_ENV_ARG_DECL) = 0;
+
+ /// Create SupplierAdmin Collection
+ virtual void create (TAO_Notify_SupplierAdmin_Collection*& collection ACE_ENV_ARG_DECL) = 0;
+
+ /// Create Proxy Collection
+ virtual void create (TAO_Notify_Proxy_Collection*& collection ACE_ENV_ARG_DECL) = 0;
+
+ /// Create EventChannelFactory
+ virtual void create (TAO_Notify_EventChannelFactory*& channel_factory ACE_ENV_ARG_DECL) = 0;
+
+ /// Create EventChannel
+ virtual void create (TAO_Notify_EventChannel*& channel ACE_ENV_ARG_DECL) = 0;
+
+ /// Create SupplierAdmin
+ virtual void create (TAO_Notify_SupplierAdmin*& admin ACE_ENV_ARG_DECL) = 0;
+
+ /// Create ConsumerAdmin
+ virtual void create (TAO_Notify_ConsumerAdmin*& admin ACE_ENV_ARG_DECL) = 0;
+
+ /// Create ProxyPushConsumer
+ virtual void create (TAO_Notify_ProxyPushConsumer*& proxy ACE_ENV_ARG_DECL) = 0;
+
+ /// Create ProxyPushSupplier
+ virtual void create (TAO_Notify_ProxyPushSupplier*& proxy ACE_ENV_ARG_DECL) = 0;
+
+ /// Create CosEC_ProxyPushConsumer
+ virtual void create (TAO_Notify_CosEC_ProxyPushConsumer*& proxy ACE_ENV_ARG_DECL) = 0;
+
+ /// Create CosEC_ProxyPushSupplier
+ virtual void create (TAO_Notify_CosEC_ProxyPushSupplier*& proxy ACE_ENV_ARG_DECL) = 0;
+
+ /// Create StructuredProxyPushConsumer
+ virtual void create (TAO_Notify_StructuredProxyPushConsumer*& proxy ACE_ENV_ARG_DECL) = 0;
+
+ /// Create StructuredProxyPushSupplier
+ virtual void create (TAO_Notify_StructuredProxyPushSupplier*& proxy ACE_ENV_ARG_DECL) = 0;
+
+ /// Create SequenceProxyPushConsumer
+ virtual void create (TAO_Notify_SequenceProxyPushConsumer*& proxy ACE_ENV_ARG_DECL) = 0;
+
+ /// Create SequenceProxyPushSupplier
+ virtual void create (TAO_Notify_SequenceProxyPushSupplier*& proxy ACE_ENV_ARG_DECL) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.cpp b/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.cpp
new file mode 100644
index 00000000000..81b86902a36
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.cpp
@@ -0,0 +1,204 @@
+/* -*- C++ -*- $Id$ */
+
+#include "orbsvcs/Notify/FilterAdmin.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/FilterAdmin.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Notify, FilterAdmin, "$Id$")
+
+#include "orbsvcs/Notify/Topology_Saver.h"
+#include "orbsvcs/Notify/Properties.h"
+#include "ace/Bound_Ptr.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Implementation skeleton constructor
+TAO_Notify_FilterAdmin::TAO_Notify_FilterAdmin (void)
+{
+}
+
+// Implementation skeleton destructor
+TAO_Notify_FilterAdmin::~TAO_Notify_FilterAdmin (void)
+{
+}
+
+CosNotifyFilter::FilterID
+TAO_Notify_FilterAdmin::add_filter (CosNotifyFilter::Filter_ptr new_filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (CORBA::is_nil (new_filter))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);
+
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ CosNotifyFilter::FilterID new_id = this->filter_ids_.id ();
+
+ CosNotifyFilter::Filter_var new_filter_var =
+ CosNotifyFilter::Filter::_duplicate (new_filter);
+
+ if (this->filter_list_.bind (new_id, new_filter_var) == -1)
+ ACE_THROW_RETURN (CORBA::INTERNAL (),
+ 0);
+ else
+ return new_id;
+}
+
+void
+TAO_Notify_FilterAdmin::remove_filter (CosNotifyFilter::FilterID filter_id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::FilterNotFound
+ ))
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ if (this->filter_list_.unbind (filter_id) == -1)
+ ACE_THROW (CosNotifyFilter::FilterNotFound ());
+}
+
+CosNotifyFilter::Filter_ptr
+TAO_Notify_FilterAdmin::get_filter (CosNotifyFilter::FilterID filter_id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::FilterNotFound
+ ))
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (CosNotifyFilter::Filter::_nil ());
+
+ CosNotifyFilter::Filter_var filter_var;
+
+ if (this->filter_list_.find (filter_id,
+ filter_var) == -1)
+ ACE_THROW_RETURN (CosNotifyFilter::FilterNotFound (),
+ 0);
+
+ return filter_var._retn ();
+}
+
+CosNotifyFilter::FilterIDSeq*
+TAO_Notify_FilterAdmin::get_all_filters (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_RETURN (0);
+
+ // Figure out the length of the list.
+ size_t len = this->filter_list_.current_size ();
+
+ CosNotifyFilter::FilterIDSeq* list_ptr;
+
+ // Allocate the list of <len> length.
+ ACE_NEW_THROW_EX (list_ptr,
+ CosNotifyFilter::FilterIDSeq,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ CosNotifyFilter::FilterIDSeq_var list (list_ptr);
+
+ list->length (static_cast<CORBA::ULong> (len));
+
+ FILTER_LIST::ITERATOR iter (this->filter_list_);
+ FILTER_LIST::ENTRY *entry;
+
+ u_int index;
+
+ for (index = 0; iter.next (entry) != 0; iter.advance (), ++index)
+ {
+ list[index] = entry->ext_id_;
+ }
+
+ return list._retn ();
+}
+
+void
+TAO_Notify_FilterAdmin::remove_all_filters (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;
+
+ this->filter_list_.unbind_all ();
+}
+
+void
+TAO_Notify_FilterAdmin::save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL)
+{
+ if (this->filter_list_.current_size() == 0)
+ return;
+
+ bool changed = true;
+
+ TAO_Notify::NVPList attrs;
+ bool want_children = saver.begin_object(0, "filter_admin", attrs, changed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ if (want_children)
+ {
+ FILTER_LIST::ITERATOR iter (this->filter_list_);
+ FILTER_LIST::ENTRY* entry;
+
+ TAO_Notify_Properties* properties = TAO_Notify_PROPERTIES::instance();
+ CORBA::ORB_var orb = properties->orb();
+ ACE_ASSERT(! CORBA::is_nil(orb.in()));
+
+ for (; iter.next(entry) != 0; iter.advance())
+ {
+ TAO_Notify::NVPList fattrs;
+ CORBA::Long id = entry->ext_id_;
+ CORBA::String_var ior = orb->object_to_string(entry->int_id_.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ fattrs.push_back(TAO_Notify::NVP("IOR", ior.in()));
+ saver.begin_object(id, "filter", fattrs, changed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ saver.end_object(id, "filter" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+
+ saver.end_object(0, "filter_admin" ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_Notify::Topology_Object*
+TAO_Notify_FilterAdmin::load_child (const ACE_CString &type, CORBA::Long id,
+ const TAO_Notify::NVPList& attrs ACE_ENV_ARG_DECL)
+{
+ if (type == "filter")
+ {
+ TAO_Notify_Properties* properties = TAO_Notify_PROPERTIES::instance();
+ CORBA::ORB_var orb = properties->orb();
+ ACE_ASSERT(! CORBA::is_nil(orb.in()));
+ ACE_CString ior;
+ attrs.load("IOR", ior);
+
+ CORBA::Object_var obj = orb->string_to_object(ior.c_str() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ CosNotifyFilter::Filter_var filter = CosNotifyFilter::Filter::_unchecked_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ if (! CORBA::is_nil(filter.in()))
+ {
+ this->filter_ids_.set_last_used(id);
+ if (this->filter_list_.bind (id, filter) != 0)
+ ACE_THROW_RETURN (CORBA::INTERNAL (), 0);
+ }
+ }
+ return this;
+}
+
+void
+TAO_Notify_FilterAdmin::release (void)
+{
+ delete this;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.h b/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.h
new file mode 100644
index 00000000000..dfa0d7eb7af
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.h
@@ -0,0 +1,117 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file FilterAdmin.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef NOTIFY_FILTERADMIN_H
+
+#define NOTIFY_FILTERADMIN_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosNotifyFilterS.h"
+
+#include "ace/Hash_Map_Manager.h"
+
+#include "orbsvcs/Notify/ID_Factory.h"
+#include "orbsvcs/Notify/Event.h"
+#include "orbsvcs/Notify/notify_serv_export.h"
+#include "orbsvcs/Notify/Topology_Object.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_FilterAdmin
+ *
+ * @brief FilterAdmin interface methods implementation.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_FilterAdmin
+ : public TAO_Notify::Topology_Object
+{
+
+ public:
+ /// Constructor
+ TAO_Notify_FilterAdmin (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_FilterAdmin (void);
+
+ // = match operation on all the filters
+ /// See if any of the filters match.
+ CORBA::Boolean match (const TAO_Notify_Event::Ptr &event ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::UnsupportedFilterableData
+ ));
+
+ // = match operation on all the filters
+ /// See if any of the filters match.
+ CORBA::Boolean match (const TAO_Notify_Event* event ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::UnsupportedFilterableData
+ ));
+
+ virtual CosNotifyFilter::FilterID add_filter (CosNotifyFilter::Filter_ptr new_filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void remove_filter (CosNotifyFilter::FilterID filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::FilterNotFound
+ ));
+
+ virtual CosNotifyFilter::Filter_ptr get_filter (CosNotifyFilter::FilterID filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::FilterNotFound
+ ));
+
+ virtual CosNotifyFilter::FilterIDSeq * get_all_filters (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void remove_all_filters (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+
+ // TAO_Notify::Topology_Object
+
+ virtual void save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL);
+ virtual TAO_Notify::Topology_Object* load_child (const ACE_CString &type, CORBA::Long id,
+ const TAO_Notify::NVPList& attrs ACE_ENV_ARG_DECL);
+ private:
+ typedef ACE_Hash_Map_Manager <CosNotifyFilter::FilterID, CosNotifyFilter::Filter_var, ACE_SYNCH_NULL_MUTEX> FILTER_LIST;
+
+ virtual void release (void);
+
+ /// Mutex to serialize access to data members.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// List of filters
+ FILTER_LIST filter_list_;
+
+ /// Id generator for proxy suppliers
+ TAO_Notify_ID_Factory filter_ids_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/FilterAdmin.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* NOTIFY_FILTERADMIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.inl b/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.inl
new file mode 100644
index 00000000000..3b30256fbb4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.inl
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+//
+//$Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE CORBA::Boolean
+TAO_Notify_FilterAdmin::match (const TAO_Notify_Event* event 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 no filter is active, match is successfull.
+ if (this->filter_list_.current_size () == 0)
+ return 1;
+
+ // We want to return true if atleast one constraint matches.
+ FILTER_LIST::ITERATOR iter (this->filter_list_);
+ FILTER_LIST::ENTRY *entry;
+ CORBA::Boolean ret_val = 0;
+
+ for (; iter.next (entry); iter.advance ())
+ {
+ ret_val = event->do_match (entry->int_id_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (ret_val == 1)
+ return 1;
+ }
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/FilterFactory.h b/TAO/orbsvcs/orbsvcs/Notify/FilterFactory.h
new file mode 100644
index 00000000000..a806f8d9437
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/FilterFactory.h
@@ -0,0 +1,49 @@
+/* -*- C++ -*- */
+/**
+ * @file FilterFactory.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_FILTERFACTORY_H
+#define TAO_Notify_FILTERFACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Service_Object.h"
+
+#include "tao/PortableServer/PortableServer.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_FilterFactory
+ *
+ * @brief Service Object to obtain a CosNotifyFilter::FilterFactory reference.
+ *
+ */
+class /*TAO_Notify_Serv_Export*/ TAO_Notify_FilterFactory : public ACE_Service_Object
+{
+public:
+ /// Factory method to create a FilterFactory reference
+ /// The Factory is activated in the default POA. The filters created are activated in the <filter_poa>.
+ virtual CosNotifyFilter::FilterFactory_ptr create (
+ PortableServer::POA_var& filter_poa
+ ACE_ENV_ARG_DECL) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_FILTERFACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.cpp
new file mode 100644
index 00000000000..de2822ae61b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.cpp
@@ -0,0 +1,49 @@
+// $Id$
+
+#ifndef TAO_Notify_FIND_WORKER_T_CPP
+#define TAO_Notify_FIND_WORKER_T_CPP
+
+#include "orbsvcs/Notify/Find_Worker_T.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Find_Worker_T.inl"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class TYPE, class INTERFACE, class INTERFACE_PTR, class EXCEPTION>
+TAO_Notify_Find_Worker_T<TYPE,INTERFACE,INTERFACE_PTR,EXCEPTION>::TAO_Notify_Find_Worker_T (void)
+ :id_ (0), result_ (0)
+{
+}
+
+template<class TYPE, class INTERFACE, class INTERFACE_PTR, class EXCEPTION> TYPE*
+TAO_Notify_Find_Worker_T<TYPE,INTERFACE,INTERFACE_PTR,EXCEPTION>::find (const TAO_Notify_Object::ID id, CONTAINER& container ACE_ENV_ARG_DECL)
+{
+ this->id_ = id;
+
+ container.collection ()->for_each (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->result_;
+}
+
+template<class TYPE, class INTERFACE, class INTERFACE_PTR, class EXCEPTION> INTERFACE_PTR
+TAO_Notify_Find_Worker_T<TYPE,INTERFACE,INTERFACE_PTR,EXCEPTION>::resolve (const TAO_Notify_Object::ID id, CONTAINER& container ACE_ENV_ARG_DECL)
+{
+ this->find (id, container ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (INTERFACE::_nil ());
+
+ if (this->result_ == 0)
+ ACE_THROW_RETURN (EXCEPTION ()
+ , INTERFACE::_nil ());
+
+ CORBA::Object_var object = this->result_->ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (INTERFACE::_nil ());
+
+ return INTERFACE::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_Notify_FIND_WORKER_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.h b/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.h
new file mode 100644
index 00000000000..c9c09eca0fa
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.h
@@ -0,0 +1,77 @@
+/* -*- C++ -*- */
+/**
+ * @file Find_Worker_T.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_FIND_WORKER_T_H
+#define TAO_Notify_FIND_WORKER_T_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+#include "orbsvcs/ESF/ESF_Worker.h"
+#include "orbsvcs/Notify/Container_T.h"
+#include "orbsvcs/Notify/Object.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Find_Worker_T
+ *
+ * @brief Helper to locate a TYPE given its ID.
+ *
+ */
+template <class TYPE, class INTERFACE, class INTERFACE_PTR, class EXCEPTION>
+class TAO_Notify_Serv_Export TAO_Notify_Find_Worker_T : public TAO_ESF_Worker<TYPE>
+{
+ typedef TAO_Notify_Container_T<TYPE> CONTAINER;
+ typedef TAO_ESF_Proxy_Collection<TYPE> COLLECTION;
+
+public:
+ /// Constructor
+ TAO_Notify_Find_Worker_T (void);
+
+ /// Find the Type.
+ TYPE* find (const TAO_Notify_Object::ID id, CONTAINER& container ACE_ENV_ARG_DECL);
+
+ /// Find and resolve to the Interface.
+ INTERFACE_PTR resolve (const TAO_Notify_Object::ID id, CONTAINER& container ACE_ENV_ARG_DECL);
+
+protected:
+ ///= TAO_ESF_Worker method
+ void work (TYPE* object ACE_ENV_ARG_DECL);
+
+ /// The id we're looking for.
+ TAO_Notify_Object::ID id_;
+
+ /// The result
+ TYPE* result_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Find_Worker_T.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Notify/Find_Worker_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Find_Worker_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_FIND_WORKER_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.inl
new file mode 100644
index 00000000000..2b9af82e37a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.inl
@@ -0,0 +1,14 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class TYPE, class INTERFACE, class INTERFACE_PTR, class EXCEPTION> ACE_INLINE void
+TAO_Notify_Find_Worker_T<TYPE,INTERFACE,INTERFACE_PTR,EXCEPTION>::work (TYPE* type ACE_ENV_ARG_DECL_NOT_USED)
+{
+ if (type->id () == this->id_)
+ this->result_ = type;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ID_Factory.cpp b/TAO/orbsvcs/orbsvcs/Notify/ID_Factory.cpp
new file mode 100644
index 00000000000..71f0721ee0e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ID_Factory.cpp
@@ -0,0 +1,22 @@
+// $Id$
+
+#include "orbsvcs/Notify/ID_Factory.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/ID_Factory.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Notify, TAO_Notify_ID_Factory, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_ID_Factory::TAO_Notify_ID_Factory (void)
+ : seed_ (0)
+{
+}
+
+TAO_Notify_ID_Factory::~TAO_Notify_ID_Factory ()
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ID_Factory.h b/TAO/orbsvcs/orbsvcs/Notify/ID_Factory.h
new file mode 100644
index 00000000000..f6596be8410
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ID_Factory.h
@@ -0,0 +1,62 @@
+/* -*- C++ -*- */
+/**
+ * @file ID_Factory.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_ID_FACTORY_H
+#define TAO_Notify_ID_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Atomic_Op.h"
+
+#include "orbsvcs/Notify/Object.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_ID_Factory
+ *
+ * @brief A simple factory for generating ID's for objects created by Notify.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_ID_Factory
+{
+public:
+ /// Constuctor
+ TAO_Notify_ID_Factory (void);
+
+ /// Destructor
+ ~TAO_Notify_ID_Factory ();
+
+ TAO_Notify_Object::ID id (void);
+
+ void set_last_used (const TAO_Notify_Object::ID id);
+
+private:
+ // Can't use atomic op, because we added the set_last_used() method.
+ TAO_Notify_Object::ID seed_;
+ TAO_SYNCH_MUTEX mtx_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/ID_Factory.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_ID_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ID_Factory.inl b/TAO/orbsvcs/orbsvcs/Notify/ID_Factory.inl
new file mode 100644
index 00000000000..6aa178a4421
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ID_Factory.inl
@@ -0,0 +1,24 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE TAO_Notify_Object::ID
+TAO_Notify_ID_Factory::id (void)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mtx_, 0);
+ return ++seed_;
+}
+
+ACE_INLINE void
+TAO_Notify_ID_Factory::set_last_used (const TAO_Notify_Object::ID id)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mtx_);
+ if (this->seed_ < id)
+ {
+ this->seed_ = id;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request.cpp
new file mode 100644
index 00000000000..e9dc45dbb07
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request.cpp
@@ -0,0 +1,62 @@
+// $Id$
+
+#include "orbsvcs/Notify/Method_Request.h"
+
+#include "orbsvcs/Time_Utilities.h"
+#include "ace/OS_NS_sys_time.h"
+
+ACE_RCSID(Notify, TAO_Notify_Method_Request_Queueable, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Method_Request::~TAO_Notify_Method_Request (void)
+{
+}
+
+TAO_Notify_Method_Request_Queueable *
+TAO_Notify_Method_Request_Queueable::copy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return this;
+}
+
+TAO_Notify_Method_Request_Queueable::TAO_Notify_Method_Request_Queueable()
+{
+}
+
+TAO_Notify_Method_Request_Queueable::TAO_Notify_Method_Request_Queueable(const TAO_Notify_Event * event)
+{
+ this->init (event);
+}
+
+void
+TAO_Notify_Method_Request_Queueable::init (const TAO_Notify_Event* event)
+{
+ ACE_ASSERT( event != 0 );
+ // Set the parameters that affect queuing in the message queue.
+ // The ACE_Message_Block priorities go from 0 (lowest) to ULONG_MAX
+ // (highest), while the Notification Events go from -32767 (lowest,
+ // even though CORBA::Short goes to -32768) to 32767 (highest).
+
+ // Convert to CORBA::Long to preserve the sign. Conversion to
+ // unsigned long will happen automatically and we do not have to worry
+ // about losing the number in the addition since priority () returns a
+ // CORBA::Short.
+ this->msg_priority ((CORBA::Long)event->priority ().value () + PRIORITY_BASE);
+
+ // The deadline time for the message block is absolute, while the
+ // timeout for the event is relative to the time it was received.
+ // So, we do a little conversion and set it on the message block (us)
+
+ const TAO_Notify_Property_Time& timeout = event->timeout ();
+
+ if (timeout.is_valid () && timeout != 0)
+ {
+ ACE_Time_Value deadline;
+ ORBSVCS_Time::TimeT_to_Time_Value(deadline, timeout.value());
+ deadline += ACE_OS::gettimeofday ();
+ this->msg_deadline_time (deadline);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request.h
new file mode 100644
index 00000000000..271c2d721b4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+
+/**
+ * @file Method_Request.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_METHOD_REQUEST_H
+#define TAO_Notify_METHOD_REQUEST_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Message_Block.h"
+#include "ace/Bound_Ptr.h"
+#include "ace/OS_NS_sys_time.h"
+
+#include "orbsvcs/Notify/Event.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Method_Request_Queueable;
+
+/**
+ * @class TAO_Notify_Method_Request
+ *
+ * @brief Base class for Method Requests
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request
+{
+public:
+ /// Destructor.
+ virtual ~TAO_Notify_Method_Request (void);
+
+ /// Execute the Request
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL) = 0;
+ virtual TAO_Notify_Method_Request_Queueable* copy (ACE_ENV_SINGLE_ARG_DECL) = 0;
+};
+
+/***********************************************************************/
+
+/**
+ * @class TAO_Notify_Method_Request_Queueable
+ *
+ * @brief Interface for NS method Requests
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Queueable
+ : public ACE_Message_Block
+ , public TAO_Notify_Method_Request
+{
+public:
+ enum {PRIORITY_BASE = 32768};
+
+ TAO_Notify_Method_Request_Queueable();
+ TAO_Notify_Method_Request_Queueable(const TAO_Notify_Event * event);
+
+ virtual TAO_Notify_Method_Request_Queueable* copy (ACE_ENV_SINGLE_ARG_DECL);
+ void init (const TAO_Notify_Event * event);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_METHOD_REQUEST_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp
new file mode 100644
index 00000000000..af503aa3077
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp
@@ -0,0 +1,304 @@
+// $Id$
+
+#include "orbsvcs/Notify/Method_Request_Dispatch.h"
+
+ACE_RCSID(Notify, TAO_Notify_Method_Request_Dispatch, "$Id$")
+
+#include "orbsvcs/Notify/ProxySupplier.h"
+#include "orbsvcs/Notify/Consumer.h"
+#include "orbsvcs/Notify/Admin.h"
+#include "orbsvcs/Notify/ConsumerAdmin.h"
+#include "orbsvcs/Notify/EventChannelFactory.h"
+
+#include "tao/debug.h"
+#include "tao/CDR.h"
+
+#include "ace/OS_NS_stdio.h"
+
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Constuct from event
+TAO_Notify_Method_Request_Dispatch::TAO_Notify_Method_Request_Dispatch (
+ const TAO_Notify_Event * event,
+ TAO_Notify_ProxySupplier* proxy_supplier,
+ bool filtering)
+ : TAO_Notify_Method_Request_Event (event)
+ , proxy_supplier_ (proxy_supplier)
+ , filtering_ (filtering)
+{
+}
+
+// Construct from a delivery rquest
+TAO_Notify_Method_Request_Dispatch::TAO_Notify_Method_Request_Dispatch (
+ const TAO_Notify::Delivery_Request_Ptr & delivery,
+ TAO_Notify_ProxySupplier* proxy_supplier,
+ bool filtering)
+ : TAO_Notify_Method_Request_Event (delivery)
+ , proxy_supplier_ (proxy_supplier)
+ , filtering_ (filtering)
+{
+}
+
+// Constuct construct from another method request+event
+// event is passed separately because we may be using a copy
+// of the one in the previous method request
+TAO_Notify_Method_Request_Dispatch::TAO_Notify_Method_Request_Dispatch (
+ const TAO_Notify_Method_Request_Event & request,
+ const TAO_Notify_Event * event,
+ TAO_Notify_ProxySupplier* proxy_supplier,
+ bool filtering)
+ : TAO_Notify_Method_Request_Event (request, event)
+ , proxy_supplier_ (proxy_supplier)
+ , filtering_ (filtering)
+{
+}
+
+TAO_Notify_Method_Request_Dispatch::~TAO_Notify_Method_Request_Dispatch ()
+{
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Destroy TAO_Notify_Method_Request_Dispatch @%@\n"),
+ this));
+#endif
+}
+
+int TAO_Notify_Method_Request_Dispatch::execute_i (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->proxy_supplier_->has_shutdown ())
+ return 0; // If we were shutdown while waiting in the queue, return with no action.
+
+ if (this->filtering_ == 1)
+ {
+ TAO_Notify_Admin& parent = this->proxy_supplier_->consumer_admin ();
+ CORBA::Boolean val = this->proxy_supplier_->check_filters (this->event_,
+ parent.filter_admin (),
+ parent.filter_operator ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (TAO_debug_level > 1)
+ ACE_DEBUG ((LM_DEBUG, "Proxysupplier %x filter eval result = %d",&this->proxy_supplier_ , val));
+
+ // Filter failed - do nothing.
+ if (val == 0)
+ return 0;
+ }
+
+ ACE_TRY
+ {
+ TAO_Notify_Consumer* consumer = this->proxy_supplier_->consumer ();
+
+ if (consumer != 0)
+ {
+ consumer->deliver (this ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("TAO_Notify_Method_Request_Dispatch::: error sending event.\n ")
+ );
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+/// Static method used to reconstruct a Method Request Dispatch
+TAO_Notify_Method_Request_Dispatch_Queueable *
+TAO_Notify_Method_Request_Dispatch::unmarshal (
+ TAO_Notify::Delivery_Request_Ptr & delivery_request,
+ TAO_Notify_EventChannelFactory &ecf,
+ TAO_InputCDR & cdr
+ ACE_ENV_ARG_DECL)
+{
+ bool ok = true;
+ TAO_Notify_Method_Request_Dispatch_Queueable * result = 0;
+ ACE_CString textpath;
+ CORBA::ULong count;
+ if (cdr.read_ulong (count))
+ {
+ TAO_Notify::IdVec id_path (count);
+ for (size_t nid = 0; ok && nid < count; ++nid)
+ {
+ TAO_Notify_Object::ID id = 0;
+ if ( cdr.read_long (id))
+ {
+ id_path.push_back (id);
+ char idbuf[20];
+ ACE_OS::snprintf (idbuf, sizeof(idbuf)-1, "/%d", static_cast<int> (id));
+ textpath += idbuf;
+ }
+ else
+ {
+ ok = false;
+ }
+ }
+
+ if (ok)
+ {
+ TAO_Notify_ProxySupplier* proxy_supplier = ecf.find_proxy_supplier (id_path,
+ 0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ if (proxy_supplier != 0)
+ {
+ if (DEBUG_LEVEL > 6) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Method_Request_Dispatch reload event for %s\n")
+ , textpath.c_str()
+ ));
+ ACE_NEW_NORETURN (result,
+ TAO_Notify_Method_Request_Dispatch_Queueable (delivery_request, proxy_supplier, true));
+ }
+ else
+ {
+ TAO_Notify_ProxyConsumer * proxy_consumer = ecf.find_proxy_consumer (id_path, 0 ACE_ENV_ARG_PARAMETER); //@@todo
+ if (proxy_consumer == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Method_Request_Dispatch::unmarshal: unknown proxy id %s\n")
+ , textpath.c_str()
+ ));
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Method_Request_Dispatch::unmarshal: wrong type of proxy id %s\n")
+ , textpath.c_str()
+ ));
+ }
+ }
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Method_Request_Dispatch::unmarshal: Cant read proxy id path\n")
+ ));
+ }
+ }
+ return result;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+
+/*******************************************************************/
+
+// Constuct construct from another method request+event
+// event is passed separately because we may be using a copy
+// of the one in the previous method request
+TAO_Notify_Method_Request_Dispatch_Queueable::TAO_Notify_Method_Request_Dispatch_Queueable (
+ const TAO_Notify_Method_Request_Event & request,
+ TAO_Notify_Event::Ptr & event,
+ TAO_Notify_ProxySupplier* proxy_supplier,
+ bool filtering)
+ : TAO_Notify_Method_Request_Dispatch (request, event.get (), proxy_supplier, filtering)
+ , TAO_Notify_Method_Request_Queueable (event.get ())
+ , event_var_( event )
+{
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Construct Method_Request_Dispatch @%@\n"),
+ this));
+#endif
+}
+
+ /// Constuct construct from Delivery Request
+ /// should ONLY be used by unmarshall
+TAO_Notify_Method_Request_Dispatch_Queueable::TAO_Notify_Method_Request_Dispatch_Queueable (
+ const TAO_Notify::Delivery_Request_Ptr & request,
+ TAO_Notify_ProxySupplier* proxy_supplier,
+ bool filtering)
+ : TAO_Notify_Method_Request_Dispatch (request, request->event ().get (), proxy_supplier, filtering)
+ , TAO_Notify_Method_Request_Queueable (request->event ().get ())
+ , event_var_( request->event () )
+
+{
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Construct unmarshalled Method_Request_Dispatch_Queueable @%@\n"),
+ this));
+#endif
+}
+
+TAO_Notify_Method_Request_Dispatch_Queueable::~TAO_Notify_Method_Request_Dispatch_Queueable ()
+{
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Destroy TAO_Notify_Method_Request_Dispatch_Queueable @%@\n"),
+ this));
+#endif
+}
+
+int
+TAO_Notify_Method_Request_Dispatch_Queueable::execute (ACE_ENV_SINGLE_ARG_DECL)
+{
+ return this->execute_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+/*********************************************************************************************************/
+
+TAO_Notify_Method_Request_Dispatch_No_Copy::TAO_Notify_Method_Request_Dispatch_No_Copy (
+ const TAO_Notify_Event* event,
+ TAO_Notify_ProxySupplier* proxy_supplier,
+ bool filtering)
+ : TAO_Notify_Method_Request_Dispatch (event, proxy_supplier, filtering)
+{
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Construct Method_Request_Dispatch_No_Copy @%@\n"),
+ this));
+#endif
+}
+ /// Constuct construct from another method request
+TAO_Notify_Method_Request_Dispatch_No_Copy::TAO_Notify_Method_Request_Dispatch_No_Copy (
+ const TAO_Notify_Method_Request_Event & request,
+ TAO_Notify_ProxySupplier* proxy_supplier,
+ bool filtering)
+ : TAO_Notify_Method_Request_Dispatch (request, request.event (), proxy_supplier, filtering)
+{
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Construct Method_Request_Dispatch_No_Copy @%@\n"),
+ this));
+#endif
+}
+
+TAO_Notify_Method_Request_Dispatch_No_Copy:: ~TAO_Notify_Method_Request_Dispatch_No_Copy ()
+{
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Destroy Method_Request_Dispatch_No_Copy @%@\n"),
+ this));
+#endif
+}
+
+int
+TAO_Notify_Method_Request_Dispatch_No_Copy::execute (ACE_ENV_SINGLE_ARG_DECL)
+{
+ return this->execute_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_Notify_Method_Request_Queueable*
+TAO_Notify_Method_Request_Dispatch_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Method_Request_Queueable* request;
+
+ TAO_Notify_Event::Ptr event_var (
+ this->event_->queueable_copy (ACE_ENV_SINGLE_ARG_PARAMETER) );
+ ACE_CHECK_RETURN (0);
+
+ ACE_NEW_THROW_EX (request,
+ TAO_Notify_Method_Request_Dispatch_Queueable (*this, event_var, this->proxy_supplier_.get(), this->filtering_),
+ //TAO_Notify_Method_Request_Dispatch_Queueable (*this, event_var, this->proxy_supplier_, this->filtering_),
+ CORBA::INTERNAL ());
+
+ return request;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h
new file mode 100644
index 00000000000..fed8d063cfa
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h
@@ -0,0 +1,170 @@
+// -*- C++ -*-
+
+/**
+ * @file Method_Request_Dispatch.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_DISPATCH_METHOD_REQUEST_H
+#define TAO_Notify_DISPATCH_METHOD_REQUEST_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Method_Request.h"
+#include "orbsvcs/Notify/Refcountable.h"
+#include "orbsvcs/Notify/Method_Request_Event.h"
+#include "orbsvcs/Notify/ProxySupplier.h"
+#include "orbsvcs/Notify/Delivery_Request.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_EventChannelFactory;
+class TAO_InputCDR;
+class TAO_Notify_Method_Request_Dispatch_Queueable;
+
+/**
+ * @class TAO_Notify_Method_Request_Dispatch
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch
+ : public TAO_Notify_Method_Request_Event
+{
+public:
+ /// an arbitrary code (Octet) to identify this delivery method type in persistent storage
+ enum {persistence_code = 1};
+
+ /// Constuct from event
+ TAO_Notify_Method_Request_Dispatch (
+ const TAO_Notify_Event * event,
+ TAO_Notify_ProxySupplier* proxy_supplier,
+ bool filtering);
+
+ /// Construct from a delivery rquest
+ TAO_Notify_Method_Request_Dispatch (
+ const TAO_Notify::Delivery_Request_Ptr & delivery,
+ TAO_Notify_ProxySupplier* proxy_supplier,
+ bool filtering);
+
+ /// Constuct construct from another method request+event
+ /// event is passed separately because we may be using a copy
+ /// of the one in the previous method request
+ TAO_Notify_Method_Request_Dispatch (
+ const TAO_Notify_Method_Request_Event & request,
+ const TAO_Notify_Event * event,
+ TAO_Notify_ProxySupplier* proxy_supplier,
+ bool filtering);
+
+public:
+ /// Destructor
+ virtual ~TAO_Notify_Method_Request_Dispatch ();
+
+ /// Static method used to reconstruct a Method Request Dispatch
+ static TAO_Notify_Method_Request_Dispatch_Queueable * unmarshal (
+ TAO_Notify::Delivery_Request_Ptr & delivery_request,
+ TAO_Notify_EventChannelFactory &ecf,
+ TAO_InputCDR & cdr
+ ACE_ENV_ARG_DECL);
+
+
+protected:
+ /// Execute the dispatch operation.
+ int execute_i (ACE_ENV_SINGLE_ARG_DECL);
+
+protected:
+ /// The Proxy
+ TAO_Notify_ProxySupplier::Ptr proxy_supplier_;
+
+ /// Flag is true if we want to do filtering else false.
+ bool filtering_;
+};
+
+/**
+ * @class TAO_Notify_Method_Request_Dispatch_Queueable
+ *
+ * @brief Dispatchs an event to a proxy supplier.
+ *
+ */
+
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch_Queueable
+ : public TAO_Notify_Method_Request_Dispatch
+ , public TAO_Notify_Method_Request_Queueable
+{
+public:
+ /// Construct construct from another method request+event
+ /// event is passed separately because we may be using a copy
+ /// of the one in the previous method request
+ TAO_Notify_Method_Request_Dispatch_Queueable (
+ const TAO_Notify_Method_Request_Event & request,
+ TAO_Notify_Event::Ptr & event,
+ TAO_Notify_ProxySupplier* proxy_supplier,
+ bool filtering);
+
+ /// Constuct construct from Delivery Request
+ /// should ONLY be used by unmarshall
+ TAO_Notify_Method_Request_Dispatch_Queueable (
+ const TAO_Notify::Delivery_Request_Ptr & request,
+ TAO_Notify_ProxySupplier* proxy_supplier,
+ bool filtering);
+
+ /// Destructor
+ virtual ~TAO_Notify_Method_Request_Dispatch_Queueable ();
+
+ /// Execute the Request
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ TAO_Notify_Event::Ptr event_var_;
+ TAO_Notify_ProxySupplier::Ptr proxy_guard_;
+};
+
+/*****************************************************************************/
+
+/**
+ * @class TAO_Notify_Method_Request_Dispatch_No_Copy
+ *
+ * @brief Dispatchs an event to a proxy supplier.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch_No_Copy
+ : public TAO_Notify_Method_Request_Dispatch
+ , public TAO_Notify_Method_Request
+{
+public:
+ /// Constuct from event
+ TAO_Notify_Method_Request_Dispatch_No_Copy (
+ const TAO_Notify_Event * event,
+ TAO_Notify_ProxySupplier* proxy_supplier,
+ bool filtering);
+
+ /// Constuct construct from another method request
+ TAO_Notify_Method_Request_Dispatch_No_Copy (
+ const TAO_Notify_Method_Request_Event & request,
+ TAO_Notify_ProxySupplier* proxy_supplier,
+ bool filtering);
+
+ /// Destructor
+ virtual ~TAO_Notify_Method_Request_Dispatch_No_Copy ();
+
+ /// Execute the Request
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Create a copy of this method request
+ virtual TAO_Notify_Method_Request_Queueable* copy (ACE_ENV_SINGLE_ARG_DECL);
+};
+
+/*****************************************************************************/
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_DISPATCH_METHOD_REQUEST_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.cpp
new file mode 100644
index 00000000000..53ab33da14c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.cpp
@@ -0,0 +1,102 @@
+// $Id$
+
+#include "orbsvcs/Notify/Method_Request_Event.h"
+#include "orbsvcs/Notify/Delivery_Request.h"
+
+ACE_RCSID (Notify, TAO_Notify_Method_Request_Event_Queueable, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Method_Request_Event::TAO_Notify_Method_Request_Event (
+ const TAO_Notify_Event * event)
+ : event_ (event)
+{
+}
+
+TAO_Notify_Method_Request_Event::TAO_Notify_Method_Request_Event (
+ const TAO_Notify::Delivery_Request_Ptr & request)
+ : event_ (request->event ().get ())
+ , delivery_request_ (request)
+{
+}
+
+TAO_Notify_Method_Request_Event::TAO_Notify_Method_Request_Event (
+ const TAO_Notify_Method_Request_Event & rhs,
+ const TAO_Notify_Event * event)
+ : event_ (event)
+ , delivery_request_ (rhs.delivery_request_)
+{
+}
+
+TAO_Notify_Method_Request_Event::~TAO_Notify_Method_Request_Event()
+{
+}
+
+void
+TAO_Notify_Method_Request_Event::complete ()
+{
+ if (this->delivery_request_.get () != 0)
+ {
+ this->delivery_request_->complete ();
+ }
+}
+
+
+unsigned long
+TAO_Notify_Method_Request_Event::sequence ()
+{
+ if (this->delivery_request_.get () != 0)
+ {
+ return this->delivery_request_->sequence ();
+ }
+ return 0;
+}
+
+bool
+TAO_Notify_Method_Request_Event::should_retry ()
+{
+ if (this->delivery_request_.get () != 0)
+ {
+ return this->delivery_request_->should_retry ();
+ }
+ return false;
+}
+
+/**********************************************************/
+
+
+TAO_Notify_Method_Request_Event_Queueable::TAO_Notify_Method_Request_Event_Queueable (
+ const TAO_Notify_Method_Request_Event & prev_request,
+ const TAO_Notify_Event::Ptr& event)
+ : TAO_Notify_Method_Request_Queueable (event.get ())
+ , TAO_Notify_Method_Request_Event (prev_request, event.get ())
+ , event_var_ (event)
+{
+}
+
+TAO_Notify_Method_Request_Event_Queueable::TAO_Notify_Method_Request_Event_Queueable (
+ TAO_Notify::Delivery_Request_Ptr & request)
+ : TAO_Notify_Method_Request_Queueable (request->event ().get ())
+ , TAO_Notify_Method_Request_Event (request, request->event ().get ())
+ , event_var_ (request->event ())
+{
+}
+
+TAO_Notify_Method_Request_Event_Queueable::~TAO_Notify_Method_Request_Event_Queueable ()
+{
+}
+
+int
+TAO_Notify_Method_Request_Event_Queueable::execute (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ ACE_ASSERT (false);
+ return -1;
+}
+
+const TAO_Notify_Event *
+TAO_Notify_Method_Request_Event::event() const
+{
+ return this->event_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.h
new file mode 100644
index 00000000000..4acb97f10d9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.h
@@ -0,0 +1,104 @@
+// -*- C++ -*-
+
+/**
+ * @file Method_Request_Event.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_METHOD_REQUEST_EVENT_H
+#define TAO_Notify_METHOD_REQUEST_EVENT_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Method_Request.h"
+#include "orbsvcs/Notify/Event.h"
+#include "orbsvcs/Notify/ProxySupplier.h"
+#include "tao/Basic_Types.h"
+#include "ace/CORBA_macros.h"
+#include "orbsvcs/Notify/Delivery_Request.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Method_Request_Event
+ *
+ * @brief A base class for all Method Requests that are associated with events.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Event
+{
+public:
+ /// Construct from event
+ TAO_Notify_Method_Request_Event (const TAO_Notify_Event *);
+
+ /// Construct from a delivery request
+ TAO_Notify_Method_Request_Event (
+ const TAO_Notify::Delivery_Request_Ptr & delivery_request);
+
+ /// Construct from another Method Request
+ /// Event is passed separately because it may be a copy of the one in request.
+ TAO_Notify_Method_Request_Event (const TAO_Notify_Method_Request_Event & rhs,
+ const TAO_Notify_Event * event);
+
+public:
+ /// Destructor
+ virtual ~TAO_Notify_Method_Request_Event ();
+
+ const TAO_Notify_Event * event() const;
+ void complete ();
+ unsigned long sequence ();
+ bool should_retry ();
+
+protected:
+
+ /// The Event
+ const TAO_Notify_Event * event_;
+
+ /// Pointer to the routing slip's delivery request (if any)
+ TAO_Notify::Delivery_Request_Ptr delivery_request_;
+};
+
+/***************************************************************/
+
+/**
+ * @class TAO_Notify_Method_Request_Event_Queueable
+ *
+ * @brief A method request for storing events.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Event_Queueable
+ : public TAO_Notify_Method_Request_Queueable
+ , public TAO_Notify_Method_Request_Event
+{
+public:
+ /// Constuctor
+ /// Not the event_var is passed as a separate parameter to avoid throwing
+ /// exceptions from the constructor if it's necessary to copy the event.
+ TAO_Notify_Method_Request_Event_Queueable (
+ const TAO_Notify_Method_Request_Event & prev_request,
+ const TAO_Notify_Event::Ptr & event);
+
+ TAO_Notify_Method_Request_Event_Queueable (
+ TAO_Notify::Delivery_Request_Ptr & request);
+
+ /// Destructor
+ virtual ~TAO_Notify_Method_Request_Event_Queueable ();
+
+ /// satisfy the pure virtual method. Should never be called.
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL);
+private:
+ TAO_Notify_Event::Ptr event_var_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_METHOD_REQUEST_EVENT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp
new file mode 100644
index 00000000000..bee058ab534
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp
@@ -0,0 +1,233 @@
+// $Id$
+
+#include "orbsvcs/Notify/Method_Request_Lookup.h"
+
+ACE_RCSID(Notify, TAO_Notify_Method_Request_Lookup, "$Id$")
+
+#include "orbsvcs/Notify/Consumer_Map.h"
+#include "orbsvcs/Notify/ProxySupplier.h"
+#include "orbsvcs/Notify/ProxyConsumer.h"
+#include "orbsvcs/Notify/Proxy.h"
+#include "orbsvcs/Notify/Admin.h"
+#include "orbsvcs/Notify/SupplierAdmin.h"
+#include "orbsvcs/Notify/Method_Request_Dispatch.h"
+#include "orbsvcs/Notify/Delivery_Request.h"
+#include "orbsvcs/Notify/EventChannelFactory.h"
+#include "orbsvcs/Notify/Event_Manager.h"
+#include "orbsvcs/Notify/Factory.h"
+
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+
+#include "tao/debug.h"
+#include "tao/CDR.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Method_Request_Lookup::TAO_Notify_Method_Request_Lookup (
+ const TAO_Notify_Event * event,
+ TAO_Notify_ProxyConsumer * proxy)
+ : TAO_Notify_Method_Request_Event (event)
+ , proxy_consumer_ (proxy)
+{
+}
+
+TAO_Notify_Method_Request_Lookup::~TAO_Notify_Method_Request_Lookup ()
+{
+}
+
+void
+TAO_Notify_Method_Request_Lookup::work (
+ TAO_Notify_ProxySupplier* proxy_supplier
+ ACE_ENV_ARG_DECL)
+{
+ if (delivery_request_.get () == 0)
+ {
+ TAO_Notify_Method_Request_Dispatch_No_Copy request (*this, proxy_supplier, true);
+ proxy_supplier->deliver (request ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ delivery_request_->dispatch (proxy_supplier, true ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+int TAO_Notify_Method_Request_Lookup::execute_i (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->proxy_consumer_->has_shutdown ())
+ return 0; // If we were shutdown while waiting in the queue, return with no action.
+
+ TAO_Notify_SupplierAdmin& parent = this->proxy_consumer_->supplier_admin ();
+
+ CORBA::Boolean val = this->proxy_consumer_->check_filters (this->event_,
+ parent.filter_admin (),
+ parent.filter_operator ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (TAO_debug_level > 1)
+ ACE_DEBUG ((LM_DEBUG, "Proxyconsumer %x filter eval result = %d",&this->proxy_consumer_ , val));
+
+ // Filter failed - do nothing.
+ if (val == 0)
+ return 0;
+
+ // The map of subscriptions.
+ TAO_Notify_Consumer_Map& map = this->proxy_consumer_->event_manager ().consumer_map ();
+
+ TAO_Notify_Consumer_Map::ENTRY* entry = map.find (this->event_->type () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO_Notify_ProxySupplier_Collection* consumers = 0;
+
+ if (entry != 0)
+ {
+ consumers = entry->collection ();
+
+ if (consumers != 0)
+ {
+ consumers->for_each (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ map.release (entry);
+ }
+
+ // Get the default consumers
+ consumers = map.broadcast_collection ();
+
+ if (consumers != 0)
+ {
+ consumers->for_each (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ this->complete ();
+ return 0;
+}
+
+/// Static method used to reconstruct a Method Request Dispatch
+TAO_Notify_Method_Request_Lookup_Queueable *
+TAO_Notify_Method_Request_Lookup::unmarshal (
+ TAO_Notify::Delivery_Request_Ptr & delivery_request,
+ TAO_Notify_EventChannelFactory &ecf,
+ TAO_InputCDR & cdr
+ ACE_ENV_ARG_DECL)
+{
+ bool ok = true;
+ TAO_Notify_Method_Request_Lookup_Queueable * result = 0;
+ CORBA::ULong count;
+ if (cdr.read_ulong (count))
+ {
+ TAO_Notify::IdVec id_path (count);
+ for (size_t nid = 0; ok && nid < count; ++nid)
+ {
+ TAO_Notify_Object::ID id = 0;
+ if ( cdr.read_long (id))
+ {
+ id_path.push_back (id);
+ }
+ else
+ {
+ ok = false;
+ }
+ }
+
+ if (ok)
+ {
+ TAO_Notify_ProxyConsumer * proxy_consumer = ecf.find_proxy_consumer (
+ id_path,
+ 0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ if (proxy_consumer != 0)
+ {
+ ACE_NEW_NORETURN (result,
+ TAO_Notify_Method_Request_Lookup_Queueable (delivery_request, proxy_consumer));
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Method_Request_Lookup_No_Copy::unmarshal: unknown proxy id\n")
+ ));
+ }
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Notify_Method_Request_Lookup_No_Copy::unmarshal: Cant read proxy id path\n")
+ ));
+ }
+ }
+ return result;
+
+}
+
+
+/****************************************************************/
+
+TAO_Notify_Method_Request_Lookup_Queueable::TAO_Notify_Method_Request_Lookup_Queueable (
+ const TAO_Notify_Event::Ptr& event,
+ TAO_Notify_ProxyConsumer* proxy_consumer)
+ : TAO_Notify_Method_Request_Lookup (event.get (), proxy_consumer)
+ , TAO_Notify_Method_Request_Queueable (event.get ())
+ , event_var_ (event)
+ , proxy_guard_ (proxy_consumer)
+{
+}
+
+TAO_Notify_Method_Request_Lookup_Queueable::TAO_Notify_Method_Request_Lookup_Queueable (
+ TAO_Notify::Delivery_Request_Ptr & request,
+ TAO_Notify_ProxyConsumer * proxy_consumer)
+ : TAO_Notify_Method_Request_Lookup (request->event ().get (), proxy_consumer)
+ , TAO_Notify_Method_Request_Queueable (request->event ().get ())
+ , event_var_ (request->event ())
+ , proxy_guard_ (proxy_consumer)
+{
+}
+
+
+TAO_Notify_Method_Request_Lookup_Queueable::~TAO_Notify_Method_Request_Lookup_Queueable ()
+{
+}
+
+int
+TAO_Notify_Method_Request_Lookup_Queueable::execute (ACE_ENV_SINGLE_ARG_DECL)
+{
+ return this->execute_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+/******************************************************************************************************/
+
+TAO_Notify_Method_Request_Lookup_No_Copy::TAO_Notify_Method_Request_Lookup_No_Copy (
+ const TAO_Notify_Event* event,
+ TAO_Notify_ProxyConsumer* proxy_consumer)
+ : TAO_Notify_Method_Request_Lookup (event, proxy_consumer)
+{
+}
+
+TAO_Notify_Method_Request_Lookup_No_Copy::~TAO_Notify_Method_Request_Lookup_No_Copy ()
+{
+}
+
+int
+TAO_Notify_Method_Request_Lookup_No_Copy::execute (ACE_ENV_SINGLE_ARG_DECL)
+{
+ return this->execute_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_Notify_Method_Request_Queueable*
+TAO_Notify_Method_Request_Lookup_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Method_Request_Queueable* request;
+
+ TAO_Notify_Event::Ptr event(this->event_->queueable_copy(ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK_RETURN (0);
+
+ ACE_NEW_THROW_EX (request,
+ TAO_Notify_Method_Request_Lookup_Queueable (event, this->proxy_consumer_),
+ CORBA::INTERNAL ());
+
+ return request;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h
new file mode 100644
index 00000000000..d54bb62833e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h
@@ -0,0 +1,140 @@
+// -*- C++ -*-
+
+/**
+ * @file Method_Request_Lookup.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+#ifndef TAO_Notify_LOOKUP_METHOD_REQUEST_H
+#define TAO_Notify_LOOKUP_METHOD_REQUEST_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+#include "orbsvcs/Notify/Method_Request_Event.h"
+#include "orbsvcs/Notify/ProxySupplier.h"
+#include "orbsvcs/Notify/ProxyConsumer.h"
+#include "orbsvcs/Notify/Consumer_Map.h"
+#include "orbsvcs/Notify/Delivery_Request.h"
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Method_Request_Lookup_Queueable;
+class TAO_Notify_Event;
+
+/**
+ * @class TAO_Notify_Method_Request_Lookup
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Lookup
+ : public TAO_ESF_Worker<TAO_Notify_ProxySupplier>
+ , public TAO_Notify_Method_Request_Event
+{
+public:
+
+ /// an arbitrary code (Octet) to identify this type of request in persistent storage
+ enum {persistence_code = 2};
+
+ /// Destructor
+ virtual ~TAO_Notify_Method_Request_Lookup ();
+
+ /// Static method used to reconstruct a Method Request Dispatch
+ static TAO_Notify_Method_Request_Lookup_Queueable * unmarshal (
+ TAO_Notify::Delivery_Request_Ptr & delivery_request,
+ TAO_Notify_EventChannelFactory &ecf,
+ TAO_InputCDR & cdr
+ ACE_ENV_ARG_DECL);
+
+protected:
+ /// Constuctor
+ TAO_Notify_Method_Request_Lookup (const TAO_Notify_Event * event, TAO_Notify_ProxyConsumer * proxy);
+
+ /// Execute the dispatch operation.
+ int execute_i (ACE_ENV_SINGLE_ARG_DECL);
+
+ ///= TAO_ESF_Worker method
+ virtual void work (TAO_Notify_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL);
+
+protected:
+
+ /// The Proxy
+ TAO_Notify_ProxyConsumer* proxy_consumer_;
+};
+
+/***************************************************************/
+
+/**
+ * @class TAO_Notify_Method_Request_Lookup_Queueable
+ *
+ * @brief Lookup command object looks up the event type of the given event in the consumer map and send the event to each proxysupplier.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Lookup_Queueable
+ : public TAO_Notify_Method_Request_Lookup
+ , public TAO_Notify_Method_Request_Queueable
+{
+public:
+ /// Constuctor from event
+ TAO_Notify_Method_Request_Lookup_Queueable (
+ const TAO_Notify_Event::Ptr& event,
+ TAO_Notify_ProxyConsumer * proxy_consumer);
+
+ /// Constuctor from delivery request
+ TAO_Notify_Method_Request_Lookup_Queueable (
+ TAO_Notify::Delivery_Request_Ptr & request,
+ TAO_Notify_ProxyConsumer * proxy_consumer);
+
+ /// Destructor
+ virtual ~TAO_Notify_Method_Request_Lookup_Queueable ();
+
+ /// Execute the Request
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ TAO_Notify_Event::Ptr event_var_;
+ TAO_Notify_ProxyConsumer::Ptr proxy_guard_;
+};
+
+/*****************************************************************************************************************************/
+
+/**
+ * @class TAO_Notify_Method_Request_Lookup_No_Copy
+ *
+ * @brief Lookup command object looks up the event type of the given event in the consumer map and send the event to each proxysupplier.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Lookup_No_Copy
+ : public TAO_Notify_Method_Request_Lookup
+ , public TAO_Notify_Method_Request
+{
+public:
+ /// Constuctor
+ TAO_Notify_Method_Request_Lookup_No_Copy (
+ const TAO_Notify_Event* event,
+ TAO_Notify_ProxyConsumer* proxy_consumer);
+
+ /// Destructor
+ virtual ~TAO_Notify_Method_Request_Lookup_No_Copy ();
+
+ /// Execute the Request
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Create a copy of this object.
+ virtual TAO_Notify_Method_Request_Queueable* copy (ACE_ENV_SINGLE_ARG_DECL);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_LOOKUP_METHOD_REQUEST_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Shutdown.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Shutdown.cpp
new file mode 100644
index 00000000000..74ca99ef829
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Shutdown.cpp
@@ -0,0 +1,35 @@
+// $Id$
+
+#include "orbsvcs/Notify/Method_Request_Shutdown.h"
+#include "orbsvcs/Notify/ThreadPool_Task.h"
+
+ACE_RCSID(Notify, TAO_Notify_Method_Request_Shutdown, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Method_Request_Shutdown::TAO_Notify_Method_Request_Shutdown (TAO_Notify_ThreadPool_Task* task)
+ : task_ (task)
+{
+}
+
+TAO_Notify_Method_Request_Shutdown::~TAO_Notify_Method_Request_Shutdown ()
+{
+}
+
+TAO_Notify_Method_Request_Queueable*
+TAO_Notify_Method_Request_Shutdown::copy (void)
+{
+ return new TAO_Notify_Method_Request_Shutdown (this->task_);
+}
+
+int
+TAO_Notify_Method_Request_Shutdown::execute (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ // Shut down the scheduler by deactivating the activation queue's
+ // underlying message queue - should pop all worker threads off their
+ // wait and they'll exit.
+ this->task_->msg_queue ()->deactivate ();
+ return -1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Shutdown.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Shutdown.h
new file mode 100644
index 00000000000..af38f816524
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Shutdown.h
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+
+/**
+ * @file Method_Request_Shutdown.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_METHOD_REQUEST_SHUTDOWN_H
+#define TAO_Notify_METHOD_REQUEST_SHUTDOWN_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Method_Request.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_ThreadPool_Task;
+
+/**
+ * @class TAO_Notify_Method_Request_Shutdown
+ *
+ * @brief Shutdown message for the ThreadPool_Task
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Shutdown : public TAO_Notify_Method_Request_Queueable
+{
+public:
+ /// Constuctor
+ TAO_Notify_Method_Request_Shutdown (TAO_Notify_ThreadPool_Task* task);
+
+ /// Destructor
+ virtual ~TAO_Notify_Method_Request_Shutdown ();
+
+ /// Create a copy of this object.
+ TAO_Notify_Method_Request_Queueable* copy (void);
+
+ /// Execute the Request
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ // Task to shutdown
+ TAO_Notify_ThreadPool_Task* task_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_METHOD_REQUEST_SHUTDOWN_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.cpp
new file mode 100644
index 00000000000..18ac5fa1841
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.cpp
@@ -0,0 +1,59 @@
+// $Id$
+
+#include "orbsvcs/Notify/Method_Request_Updates.h"
+
+ACE_RCSID(Notify, TAO_Notify_Method_Request_Updates, "$Id$")
+
+#include "tao/debug.h"
+#include "orbsvcs/Notify/Proxy.h"
+#include "orbsvcs/Notify/Peer.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Method_Request_Updates::TAO_Notify_Method_Request_Updates (const TAO_Notify_EventTypeSeq& added, const TAO_Notify_EventTypeSeq& removed, TAO_Notify_Proxy* proxy)
+ : TAO_Notify_Method_Request_Updates_Base (added, removed, proxy)
+{
+}
+
+TAO_Notify_Method_Request_Updates::~TAO_Notify_Method_Request_Updates ()
+{
+}
+
+int
+TAO_Notify_Method_Request_Updates::execute (ACE_ENV_SINGLE_ARG_DECL)
+{
+ return this->execute_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+/*****************************************************************************/
+
+TAO_Notify_Method_Request_Updates_No_Copy::TAO_Notify_Method_Request_Updates_No_Copy (const TAO_Notify_EventTypeSeq& added
+ , const TAO_Notify_EventTypeSeq& removed, TAO_Notify_Proxy* proxy)
+ : TAO_Notify_Method_Request_Updates_No_Copy_Base (added, removed, proxy)
+{
+}
+
+TAO_Notify_Method_Request_Updates_No_Copy::~TAO_Notify_Method_Request_Updates_No_Copy ()
+{
+}
+
+TAO_Notify_Method_Request_Queueable*
+TAO_Notify_Method_Request_Updates_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Method_Request_Queueable* request = 0;
+
+ ACE_NEW_THROW_EX (request,
+ TAO_Notify_Method_Request_Updates (this->added_, this->removed_, this->proxy_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (request);
+
+ return request;
+}
+
+int
+TAO_Notify_Method_Request_Updates_No_Copy::execute (ACE_ENV_SINGLE_ARG_DECL)
+{
+ return this->execute_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.h
new file mode 100644
index 00000000000..b9410188772
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.h
@@ -0,0 +1,90 @@
+// -*- C++ -*-
+
+/**
+ * @file Method_Request_Updates.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_METHOD_REQUEST_UPDATES_H
+#define TAO_Notify_METHOD_REQUEST_UPDATES_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Method_Request_Updates_T.h"
+#include "orbsvcs/Notify/Method_Request.h"
+#include "orbsvcs/Notify/EventTypeSeq.h"
+#include "orbsvcs/Notify/Proxy.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef TAO_Notify_Method_Request_Updates_T<const TAO_Notify_EventTypeSeq
+ , TAO_Notify_Proxy::Ptr
+ , const TAO_Notify_EventTypeSeq&
+ , TAO_Notify_Proxy*
+ > TAO_Notify_Method_Request_Updates_Base;
+
+/**
+ * @class TAO_Notify_Method_Request_Updates
+ *
+ * @brief Command Object to send updates to proxys.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Updates
+ : public TAO_Notify_Method_Request_Updates_Base
+ , public TAO_Notify_Method_Request_Queueable
+{
+public:
+ /// Constuctor
+ TAO_Notify_Method_Request_Updates (const TAO_Notify_EventTypeSeq& added, const TAO_Notify_EventTypeSeq& removed, TAO_Notify_Proxy* proxy);
+
+ /// Destructor
+ virtual ~TAO_Notify_Method_Request_Updates ();
+
+ /// Execute the Request
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL);
+};
+
+/*****************************************************************************/
+
+typedef TAO_Notify_Method_Request_Updates_T<const TAO_Notify_EventTypeSeq&
+ , TAO_Notify_Proxy*
+ , const TAO_Notify_EventTypeSeq&
+ , TAO_Notify_Proxy*
+ > TAO_Notify_Method_Request_Updates_No_Copy_Base;
+
+/**
+ * @class TAO_Notify_Method_Request_Updates_No_Copy
+ *
+ * @brief Command Object to send updates to proxys.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Updates_No_Copy
+ : public TAO_Notify_Method_Request_Updates_No_Copy_Base
+ , public TAO_Notify_Method_Request
+{
+public:
+ /// Constuctor
+ TAO_Notify_Method_Request_Updates_No_Copy (const TAO_Notify_EventTypeSeq& added, const TAO_Notify_EventTypeSeq& removed, TAO_Notify_Proxy* proxy);
+
+ /// Destructor
+ virtual ~TAO_Notify_Method_Request_Updates_No_Copy ();
+
+ /// Create a copy of this object.
+ virtual TAO_Notify_Method_Request_Queueable* copy (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Execute the Request
+ virtual int execute (ACE_ENV_SINGLE_ARG_DECL);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_METHOD_REQUEST_UPDATES_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.cpp
new file mode 100644
index 00000000000..19db54e852f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.cpp
@@ -0,0 +1,28 @@
+// $Id$
+
+#ifndef TAO_Notify_Method_Request_Updates_T_CPP
+#define TAO_Notify_Method_Request_Updates_T_CPP
+
+#include "orbsvcs/Notify/Method_Request_Updates_T.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Method_Request_Updates_T.inl"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class SEQ, class PROXY, class SEQ_PARAM, class PROXY_PARAM>
+TAO_Notify_Method_Request_Updates_T<SEQ, PROXY, SEQ_PARAM, PROXY_PARAM>::TAO_Notify_Method_Request_Updates_T (SEQ_PARAM added, SEQ_PARAM removed,
+ PROXY_PARAM proxy)
+ : added_ (added), removed_ (removed), proxy_ (proxy)
+{
+}
+
+template <class SEQ, class PROXY, class SEQ_PARAM, class PROXY_PARAM>
+TAO_Notify_Method_Request_Updates_T<SEQ, PROXY, SEQ_PARAM, PROXY_PARAM>::~TAO_Notify_Method_Request_Updates_T ()
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_Notify_Method_Request_Updates_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.h
new file mode 100644
index 00000000000..53b6c1d7b30
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.h
@@ -0,0 +1,81 @@
+/* -*- C++ -*- */
+/**
+ * @file Method_Request_Updates_T.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_METHOD_REQUEST_UPDATES_T_H
+#define TAO_Notify_METHOD_REQUEST_UPDATES_T_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/orbconf.h"
+#include "ace/CORBA_macros.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace CORBA
+{
+ class Environment;
+}
+
+/**
+ * @class TAO_Notify_Method_Request_Updates_T
+ *
+ * @brief
+ *
+ */
+template <class SEQ, class PROXY, class SEQ_PARAM, class PROXY_PARAM>
+class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Updates_T
+{
+public:
+ /// Constuctor
+ TAO_Notify_Method_Request_Updates_T (SEQ_PARAM added,
+ SEQ_PARAM removed,
+ PROXY_PARAM proxy);
+
+ /// Destructor
+ virtual ~TAO_Notify_Method_Request_Updates_T ();
+
+ /// Execute the Request
+ int execute_i (ACE_ENV_SINGLE_ARG_DECL);
+
+protected:
+ /// Update Added
+ SEQ added_;
+
+ /// Update Removed
+ SEQ removed_;
+
+ /// The Proxy that will receive the updates.
+ PROXY proxy_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Method_Request_Updates_T.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Notify/Method_Request_Updates_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Method_Request_Updates_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_METHOD_REQUEST_UPDATES_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.inl
new file mode 100644
index 00000000000..657b6dd0929
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.inl
@@ -0,0 +1,36 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "tao/debug.h"
+#include "orbsvcs/Notify/Peer.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class SEQ, class PROXY, class SEQ_PARAM, class PROXY_PARAM> ACE_INLINE int
+TAO_Notify_Method_Request_Updates_T<SEQ, PROXY, SEQ_PARAM, PROXY_PARAM>::execute_i (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->proxy_->has_shutdown ())
+ return 0; // If we were shutdown while waiting in the queue, return with no action.
+
+ ACE_TRY
+ {
+ TAO_Notify_Peer* peer = this->proxy_->peer();
+
+ if (peer != 0)
+ {
+ peer->dispatch_updates (this->added_, this->removed_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Notify_Method_Request_Updates::execute error sending updates\n ");
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Name_Value_Pair.cpp b/TAO/orbsvcs/orbsvcs/Notify/Name_Value_Pair.cpp
new file mode 100644
index 00000000000..7d1109eb65e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Name_Value_Pair.cpp
@@ -0,0 +1,216 @@
+// $Id$
+
+#include "orbsvcs/Notify/Name_Value_Pair.h"
+#include "orbsvcs/Notify/Property_T.h"
+#include "ace/OS_String.h"
+#include "ace/OS_NS_stdio.h"
+
+namespace
+{
+ ACE_UINT64 string_to_uint64 (const char * s)
+ {
+ size_t const len = ACE_OS::strlen (s);
+ if (len == 0)
+ return 0;
+ if (! isdigit(s[0]))
+ return 0;
+
+ ACE_UINT64 t = 0;
+ for (size_t i = 0; i < len; ++i)
+ {
+ if (isdigit(s[i]) == 0)
+ {
+ break;
+ }
+ t *= 10;
+ t += (s[i] - '0');
+ }
+ return t;
+ }
+}
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ NVP::NVP()
+ {
+ }
+
+ NVP::NVP(const TAO_Notify_Property_Short& p)
+ : name(p.name())
+ {
+ char buf[64];
+ ACE_OS::sprintf (buf, "%d", p.value ());
+ value = buf;
+ }
+
+ NVP::NVP(const TAO_Notify_Property_Long& p)
+ : name(p.name())
+ {
+ char buf[64];
+ long temp = static_cast<long> (p.value ());
+ ACE_OS::sprintf (buf, "%ld", temp);
+ value = buf;
+ }
+
+ NVP::NVP(const TAO_Notify_Property_Time& p)
+ : name(p.name())
+ {
+ ACE_TCHAR buf[128];
+ ACE_UINT64 us = p.value();
+#ifdef ACE_LACKS_LONGLONG_T
+ us.as_string(buf);
+#else
+ ACE_OS::sprintf(buf, ACE_UINT64_FORMAT_SPECIFIER, us);
+#endif /* ACE_LACKS_LONGLONG_T */
+ value = ACE_TEXT_ALWAYS_CHAR (buf);
+ }
+
+ NVP::NVP(const TAO_Notify_Property_Boolean& p)
+ : name(p.name())
+ {
+ value = p.value() ? "true" : "false";
+ }
+
+ NVP::NVP(const char * n, CORBA::Long v)
+ : name(n)
+ {
+ char buf[64];
+ long temp = v;
+ ACE_OS::sprintf (buf, "%ld", temp);
+ value = buf;
+ }
+
+ NVP::NVP(const char * n, const char * v)
+ : name(n), value(v)
+ {
+ }
+
+ NVP::NVP(const char * n, const ACE_CString & v)
+ : name(n), value(v)
+ {
+ }
+
+ bool NVP::operator==(const NVP& rhs) const
+ {
+ return (this->name == rhs.name) != 0;
+ }
+
+ bool NVP::operator!=(const NVP& rhs) const
+ {
+ return ! (rhs == *this);
+ }
+
+ bool NVPList::find (const char * name, ACE_CString& val) const
+ {
+ for (size_t i = 0; i < list_.size(); ++i)
+ {
+ if (list_[i].name == name)
+ {
+ val = list_[i].value;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ bool NVPList::find (const char * name, const char *& val) const
+ {
+ for (size_t i = 0; i < list_.size(); ++i)
+ {
+ if (list_[i].name == name)
+ {
+ val = list_[i].value.c_str ();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ void NVPList::load(TAO_Notify_Property_Short& p) const
+ {
+ const char * v;
+ if (find(p.name(), v))
+ {
+ p.assign (static_cast<CORBA::Short> (ACE_OS::atoi(v)));
+ }
+ }
+
+ void NVPList::load(TAO_Notify_Property_Long& p) const
+ {
+ const char * v;
+ if (find(p.name(), v))
+ {
+ p.assign (static_cast<CORBA::Long> (ACE_OS::atoi(v)));
+ }
+ }
+
+ void NVPList::load(TAO_Notify_Property_Time& p) const
+ {
+ const char * v;
+ if (find(p.name (), v))
+ {
+ p.assign (static_cast<TimeBase::TimeT> (string_to_uint64(v)));
+ }
+ }
+
+ void NVPList::load(TAO_Notify_Property_Boolean& p) const
+ {
+ ACE_CString v;
+ if (find(p.name (), v))
+ {
+ if (v == "true")
+ {
+ p = 1;
+ }
+ else
+ {
+ p = 0;
+ }
+ }
+ }
+
+ bool NVPList::load(const char * n, CORBA::Long& v) const
+ {
+ const char * val;
+ if (find(n, val))
+ {
+ v = static_cast<CORBA::Long> (ACE_OS::atoi(val));
+ return true;
+ }
+ return false;
+ }
+
+ bool NVPList::load(const char * n, ACE_CString& v) const
+ {
+ return find(n, v);
+ }
+
+ void NVPList::push_back(const NVP& v)
+ {
+ for (size_t i = 0; i < list_.size(); ++i)
+ {
+ if (list_[i].name == v.name)
+ {
+ list_[i].value = v.value;
+ return;
+ }
+ }
+ list_.push_back(v);
+ }
+
+ size_t NVPList::size() const
+ {
+ return list_.size();
+ }
+
+ const NVP& NVPList::operator[](size_t ndx) const
+ {
+ ACE_ASSERT (ndx < list_.size());
+ return list_[ndx];
+ }
+
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Name_Value_Pair.h b/TAO/orbsvcs/orbsvcs/Notify/Name_Value_Pair.h
new file mode 100644
index 00000000000..6aa695f0e4a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Name_Value_Pair.h
@@ -0,0 +1,102 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+* @file Name_Value_Pair.h
+*
+* $Id$
+*
+* @author Jonathan Pollack <pollack_j@ociweb.com>
+*/
+//=============================================================================
+
+#ifndef NAME_VALUE_PAIR_H
+#define NAME_VALUE_PAIR_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/Property.h"
+#include "orbsvcs/Notify/Property_Boolean.h"
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#include "ace/SString.h"
+#include "ace/Vector_T.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ /**
+ * \brief Name/Value Pair
+ *
+ * Associates a name (character string) with a value (encoded into a character string)
+ * For use in managing properties.
+ */
+ class TAO_Notify_Serv_Export NVP {
+ public:
+ /// Construct an undefined name/value (to allow use in collections)
+ NVP();
+ /// Construct from a property containing a short value.
+ explicit NVP(const TAO_Notify_Property_Short& p);
+ /// Construct from a property containing a long value.
+ explicit NVP(const TAO_Notify_Property_Long& p);
+ /// Construct from a property containing a time value
+ explicit NVP(const TAO_Notify_Property_Time& p);
+ /// Construct from a property containing a boolean value
+ explicit NVP(const TAO_Notify_Property_Boolean& p);
+
+ /// Construct from name and long value.
+ NVP(const char * n, CORBA::Long v);
+ /// Construct from name and string value.
+ NVP(const char * n, const char * v);
+ /// Construct from name and string value.
+ NVP(const char * n, const ACE_CString & v);
+
+ /// Assignment operator
+ bool operator==(const NVP& rhs) const;
+ /// Comparison operator compares only name (not value)
+ bool operator!=(const NVP& rhs) const;
+ ACE_CString name;
+ ACE_CString value;
+ };
+
+ /**
+ * \brief Collection of Name/Value Pairs
+ */
+ class TAO_Notify_Serv_Export NVPList {
+ public:
+ /// Find the NVP with the same name as the property, copy the value.
+ void load(TAO_Notify_Property_Short& p) const;
+ /// Find the NVP with the same name as the property, copy the value.
+ void load(TAO_Notify_Property_Long& p) const;
+ /// Find the NVP with the same name as the property, copy the value.
+ void load(TAO_Notify_Property_Time& p) const;
+ /// Find the NVP with the same name as the property, copy the value.
+ void load(TAO_Notify_Property_Boolean& p) const;
+ /// Find the NVP with specified name, copy the value to a string.
+ bool load(const char * n, CORBA::Long& v) const;
+ /// Find the NVP with specified name, copy the value to a long.
+ bool load(const char * n, ACE_CString& v) const;
+ /// add a new name/value pair.
+ void push_back(const NVP& v);
+ /// size of the collection.
+ size_t size() const;
+ /// access NVP via numeric index.
+ const NVP& operator[](size_t ndx) const;
+ /// low level access: find
+ bool find (const char * name, ACE_CString& val) const;
+ /// low level access: use this when you don't need a CString
+ bool find (const char * name, const char *& val) const;
+
+ private:
+ ACE_Vector<NVP> list_;
+ };
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* NAME_VALUE_PAIR_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.cpp
new file mode 100644
index 00000000000..5d6f3e11e21
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.cpp
@@ -0,0 +1,49 @@
+// $Id$
+
+#include "orbsvcs/Notify/Notify_Constraint_Interpreter.h"
+#include "orbsvcs/Notify/Notify_Constraint_Visitors.h"
+
+ACE_RCSID(Notify, NS_Constraint_Interpreter, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Constraint_Interpreter::TAO_Notify_Constraint_Interpreter (void)
+{
+}
+
+TAO_Notify_Constraint_Interpreter::~TAO_Notify_Constraint_Interpreter (void)
+{
+}
+
+void
+TAO_Notify_Constraint_Interpreter::build_tree (
+ const char *constraints
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CosNotifyFilter::InvalidConstraint,
+ CORBA::NO_MEMORY))
+{
+ if (TAO_ETCL_Interpreter::is_empty_string (constraints))
+ {
+ // Root is deleted in the TAO_Interpreter's destructor.
+ ACE_NEW_THROW_EX (this->root_,
+ TAO_ETCL_Literal_Constraint ((CORBA::Boolean) 1),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ }
+ else
+ {
+ // root_ is set in this base class call.
+ if (TAO_ETCL_Interpreter::build_tree (constraints) != 0)
+ ACE_THROW (CosNotifyFilter::InvalidConstraint ());
+ }
+}
+
+CORBA::Boolean
+TAO_Notify_Constraint_Interpreter::evaluate (TAO_Notify_Constraint_Visitor &evaluator)
+{
+ return evaluator.evaluate_constraint (this->root_);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.h
new file mode 100644
index 00000000000..acb7c8b9d86
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.h
@@ -0,0 +1,65 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Notify_Constraint_Interpreter.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_NOTIFY_CONSTRAINT_INTERPRETER_H
+#define TAO_NOTIFY_CONSTRAINT_INTERPRETER_H
+
+#include /**/ "ace/pre.h"
+#include "orbsvcs/ETCL/ETCL_Interpreter.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ETCL/ETCL_Constraint.h"
+#include "orbsvcs/CosNotifyFilterC.h"
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Constraint_Visitor;
+
+/**
+ * @class TAO_Notify_Constraint_Interpreter
+ *
+ * @brief "ETCL" Interpreter for the Notify queries.
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Constraint_Interpreter : public TAO_ETCL_Interpreter
+{
+public:
+ // = Initialization and termination methods.
+ TAO_Notify_Constraint_Interpreter (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Constraint_Interpreter (void);
+
+ /**
+ * This method builds an expression tree representing the
+ * constraint specified in <constraints>, and throws an Illegal
+ * Constraint exception if the constraint given has syntax errors or
+ * semantic errors, such as mismatched types.
+ */
+ void build_tree (const char* constraints
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosNotifyFilter::InvalidConstraint,
+ CORBA::NO_MEMORY));
+
+ /// Returns true if the constraint is evaluated successfully by
+ /// the evaluator.
+ CORBA::Boolean evaluate (TAO_Notify_Constraint_Visitor &evaluator);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_NOTIFY_CONSTRAINT_INTERPRETER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.cpp
new file mode 100644
index 00000000000..f342c7e93f5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.cpp
@@ -0,0 +1,1465 @@
+// $Id$
+
+#include "orbsvcs/Notify/Notify_Constraint_Visitors.h"
+#include "orbsvcs/ETCL/ETCL_Constraint.h"
+#include "orbsvcs/ETCL/ETCL_y.h"
+#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h"
+#include "tao/DynamicAny/DynArray_i.h"
+#include "tao/DynamicAny/DynSequence_i.h"
+#include "tao/DynamicAny/DynStruct_i.h"
+#include "tao/DynamicAny/DynUnion_i.h"
+#include "tao/DynamicAny/DynEnum_i.h"
+#include "tao/DynamicAny/DynAnyFactory.h"
+#include "tao/CDR.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Constraint_Visitor::TAO_Notify_Constraint_Visitor (void)
+ : implicit_id_ (TAO_Notify_Constraint_Visitor::EMPTY),
+ implicit_ids_(implicit_ids_size_),
+ filterable_data_(filterable_data_size_),
+ variable_header_(variable_header_size_)
+{
+ (void) this->implicit_ids_.bind (ACE_CString ("filterable_data",
+ 0,
+ 0),
+ FILTERABLE_DATA);
+ (void) this->implicit_ids_.bind (ACE_CString ("header",
+ 0,
+ 0),
+ HEADER);
+ (void) this->implicit_ids_.bind (ACE_CString ("remainder_of_body",
+ 0,
+ 0),
+ REMAINDER_OF_BODY);
+ (void) this->implicit_ids_.bind (ACE_CString ("fixed_header",
+ 0,
+ 0),
+ FIXED_HEADER);
+ (void) this->implicit_ids_.bind (ACE_CString ("variable_header",
+ 0,
+ 0),
+ VARIABLE_HEADER);
+ (void) this->implicit_ids_.bind (ACE_CString ("event_name",
+ 0,
+ 0),
+ EVENT_NAME);
+ (void) this->implicit_ids_.bind (ACE_CString ("event_type",
+ 0,
+ 0),
+ EVENT_TYPE);
+ (void) this->implicit_ids_.bind (ACE_CString ("domain_name",
+ 0,
+ 0),
+ DOMAIN_NAME);
+ (void) this->implicit_ids_.bind (ACE_CString ("type_name",
+ 0,
+ 0),
+ TYPE_NAME);
+}
+
+int
+TAO_Notify_Constraint_Visitor::bind_structured_event (const CosNotification::StructuredEvent &s_event)
+{
+ // The two sequences contained in a structured event are
+ // copied into hash tables so iteration is done only once.
+
+ CORBA::ULong length = s_event.filterable_data.length ();
+ CORBA::ULong index = 0;
+
+ for (index = 0; index < length; ++index)
+ {
+ ACE_CString name_str (s_event.filterable_data[index].name, 0, 0);
+
+ int status =
+ this->filterable_data_.bind (
+ name_str,
+ s_event.filterable_data[index].value
+ );
+
+ if (status != 0)
+ return -1;
+ }
+
+ length = s_event.header.variable_header.length ();
+
+ for (index = 0; index < length; ++index)
+ {
+ ACE_CString name_str (s_event.header.variable_header[index].name, 0, 0);
+
+ int status =
+ this->variable_header_.bind (
+ name_str,
+ s_event.header.variable_header[index].value
+ );
+
+ if (status != 0)
+ return -1;
+ }
+
+ this->domain_name_ =
+ CORBA::string_dup (s_event.header.fixed_header.event_type.domain_name);
+
+ this->type_name_ =
+ CORBA::string_dup (s_event.header.fixed_header.event_type.type_name);
+
+ this->event_name_ =
+ CORBA::string_dup (s_event.header.fixed_header.event_name);
+
+ this->remainder_of_body_ = s_event.remainder_of_body;
+
+ return 0;
+}
+
+CORBA::Boolean
+TAO_Notify_Constraint_Visitor::evaluate_constraint (
+ TAO_ETCL_Constraint* root
+ )
+{
+ CORBA::Boolean result = 0;
+ this->queue_.reset ();
+
+ // Evaluate the constraint in root_;
+ if (root != 0)
+ {
+ if ((root->accept (this) == 0) &&
+ (! this->queue_.is_empty ()))
+ {
+ TAO_ETCL_Literal_Constraint top;
+ this->queue_.dequeue_head (top);
+ result = (CORBA::Boolean) top;
+ }
+ }
+
+ // If a property couldn't be evaluated we must return 0.
+ return result;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_literal (
+ TAO_ETCL_Literal_Constraint *literal
+ )
+{
+ this->queue_.enqueue_head (*literal);
+ return 0;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_identifier (TAO_ETCL_Identifier *ident)
+{
+ int return_value = -1;
+ const char *name = ident->value ();
+ ACE_CString key (name, 0, 0);
+
+ CORBA::Any any;
+
+ if (this->filterable_data_.find (key, any) == 0)
+ {
+ if (any.impl() != 0)
+ {
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (&any));
+ return_value = 0;
+ }
+ }
+
+ return return_value;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_union_value (
+ TAO_ETCL_Union_Value *union_value
+ )
+{
+ switch (union_value->sign ())
+ {
+ case 0:
+ this->queue_.enqueue_head (*union_value->string ());
+ break;
+ case -1:
+ this->queue_.enqueue_head (-(*union_value->integer ()));
+ break;
+ case 1:
+ this->queue_.enqueue_head (*union_value->integer ());
+ break;
+ default:
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_union_pos (
+ TAO_ETCL_Union_Pos *union_pos
+ )
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ if (union_pos->union_value ()->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint disc_val;
+ this->queue_.dequeue_head (disc_val);
+
+ TAO_DynUnion_i dyn_union;
+ dyn_union.init (this->current_value_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::TypeCode_var tc = this->current_value_->type ();
+
+ switch (disc_val.expr_type ())
+ {
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ case TAO_ETCL_UNSIGNED:
+ {
+ CORBA::Any disc_any;
+ CORBA::TypeCode_var disc_tc =
+ tc->discriminator_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::TCKind disc_kind =
+ TAO_DynAnyFactory::unalias (disc_tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ switch (disc_kind)
+ {
+ case CORBA::tk_boolean:
+ disc_any <<= CORBA::Any::from_boolean ((CORBA::Boolean) disc_val);
+ break;
+ case CORBA::tk_short:
+ disc_any <<= (CORBA::Short) ((CORBA::Long) disc_val);
+ break;
+ case CORBA::tk_ushort:
+ disc_any <<= (CORBA::UShort) ((CORBA::ULong) disc_val);
+ break;
+ case CORBA::tk_long:
+ disc_any <<= (CORBA::Long) disc_val;
+ break;
+ case CORBA::tk_ulong:
+ disc_any <<= (CORBA::ULong) disc_val;
+ break;
+ case CORBA::tk_enum:
+ {
+ TAO_OutputCDR cdr;
+ cdr.write_ulong ((CORBA::ULong) disc_val);
+ TAO_InputCDR in_cdr (cdr);
+ TAO::Unknown_IDL_Type *unk = 0;
+ ACE_NEW_RETURN (unk,
+ TAO::Unknown_IDL_Type (disc_tc.in (),
+ in_cdr),
+ -1);
+
+ disc_any.replace (unk);
+ break;
+ }
+ // @@@ (JP) I don't think ETCL handles 64-bit
+ // integers at this point, and I also think that
+ // chars and/or wchars will just come out in the
+ // constraint as (w)strings of length 1.
+ case CORBA::tk_longlong:
+ case CORBA::tk_ulonglong:
+ case CORBA::tk_char:
+ case CORBA::tk_wchar:
+ default:
+ return -1;
+ }
+
+ DynamicAny::DynAny_var dyn_any =
+ TAO_DynAnyFactory::make_dyn_any (disc_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ dyn_union.set_discriminator (dyn_any.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ DynamicAny::DynAny_var u_member =
+ dyn_union.member (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->current_value_ =
+ u_member->to_any (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ break;
+ }
+ case TAO_ETCL_STRING:
+ {
+ const char *name = (const char *) disc_val;
+ CORBA::ULong count =
+ tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ const char *member_name = 0;
+ CORBA::ULong i = 0;
+
+ for (i = 0; i < count; ++i)
+ {
+ member_name = tc->member_name (i
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ACE_OS::strcmp (name, member_name) == 0)
+ break;
+ }
+
+ // If there's no match, member_label will throw
+ // CORBA::TypeCode::Bounds and the catch block will
+ // return -1;
+ this->current_value_ = tc->member_label (i
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ break;
+ }
+ // The TAO_ETCL_Union_Value that was put on the queue
+ // shouldn't have any other type.
+ default:
+ return -1;
+ }
+
+ TAO_ETCL_Constraint *nested = union_pos->component ();
+
+ // If there's no nested component, then we just want the
+ // union member value on the queue. Otherwise, we want
+ // the member value in current_value_ while we visit
+ // the nested component.
+ if (nested == 0)
+ {
+ TAO_ETCL_Literal_Constraint lit (this->current_value_.ptr ());
+ this->queue_.enqueue_head (lit);
+ return 0;
+ }
+ else
+ return nested->accept (this);
+ }
+ else
+ return -1;
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_component_pos (
+ TAO_ETCL_Component_Pos *pos
+ )
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // If we are here (from visit_component) the Any containing the
+ // component as found in filterable_data_ will be in current_value_.
+ CORBA::TypeCode_var tc = this->current_value_->type ();
+ CORBA::TCKind kind = TAO_DynAnyFactory::unalias (tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DynamicAny::DynAny_var member;
+ CORBA::Boolean success = 0;
+ CORBA::ULong slot = (CORBA::ULong) *pos->integer ();
+
+ switch (kind)
+ {
+ case CORBA::tk_enum:
+ {
+ TAO_DynEnum_i dyn_enum;
+ dyn_enum.init (this->current_value_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ success = dyn_enum.seek (slot
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (success == 0)
+ return -1;
+
+ member =
+ dyn_enum.current_component (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ break;
+ }
+ case CORBA::tk_struct:
+ {
+ TAO_DynStruct_i dyn_struct;
+ dyn_struct.init (this->current_value_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ success = dyn_struct.seek (slot
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (success == 0)
+ return -1;
+
+ member = dyn_struct.current_component (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ break;
+ }
+ // @@@ (JP) I think enums and structs are the only two cases
+ // handled by Component_Pos, since arrays and sequences are
+ // handled by Component_Array, and unions are handled by
+ // Union_Pos.
+ default:
+ return -1;
+ }
+
+ CORBA::Any_var value = member->to_any (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_ETCL_Constraint *comp = pos->component ();
+
+ if (comp == 0)
+ {
+ TAO_ETCL_Literal_Constraint result (value.ptr ());
+ this->queue_.enqueue_head (result);
+ return 0;
+ }
+ else
+ {
+ this->current_value_ = value._retn ();
+ return comp->accept (this);
+ }
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_component_assoc (
+ TAO_ETCL_Component_Assoc *assoc
+ )
+{
+ CORBA::Any any;
+ ACE_CString name (assoc->identifier ()->value (),
+ 0,
+ 0);
+
+ switch (this->implicit_id_)
+ {
+ case FILTERABLE_DATA:
+ if (this->filterable_data_.find (name, any) != 0
+ || any.impl() == 0)
+ return -1;
+ break;
+ case VARIABLE_HEADER:
+ if (this->variable_header_.find (name, any) != 0
+ || any.impl() == 0)
+ return -1;
+ break;
+ // Only the sequence members of CosNotification::StructuredEvent
+ // can be treated as associative arrays.
+ default:
+ return -1;
+ }
+
+ TAO_ETCL_Constraint *comp = assoc->component ();
+ CORBA::Any *any_ptr = 0;
+
+ if (comp == 0)
+ {
+ TAO_ETCL_Literal_Constraint result (&any);
+ this->queue_.enqueue_head (result);
+
+ // If we're at the end of the line, put the name into
+ // current_value_ so visit_exist can use it.
+ ACE_NEW_RETURN (any_ptr,
+ CORBA::Any,
+ -1);
+ (*any_ptr) <<= name.c_str ();
+ this->current_value_ = any_ptr;
+
+ return 0;
+ }
+ else
+ {
+ ACE_NEW_RETURN (any_ptr,
+ CORBA::Any (any),
+ -1);
+ this->current_value_ = any_ptr;
+ return comp->accept (this);
+ }
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_component_array (TAO_ETCL_Component_Array *array)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // If we are here (from visit_component) the Any containing the
+ // component as found in filterable_data_ will be in
+ // current_value_.
+ CORBA::TypeCode_var tc = this->current_value_->type ();
+ CORBA::TCKind kind = TAO_DynAnyFactory::unalias (tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DynamicAny::DynAny_var member;
+ CORBA::Boolean success = 0;
+ CORBA::ULong slot = (CORBA::ULong) *array->integer ();
+
+ switch (kind)
+ {
+ case CORBA::tk_array:
+ {
+ TAO_DynEnum_i dyn_array;
+ dyn_array.init (this->current_value_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ success = dyn_array.seek (slot
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (success == 0)
+ return -1;
+
+ member = dyn_array.current_component (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ break;
+ }
+ case CORBA::tk_sequence:
+ {
+ TAO_DynStruct_i dyn_sequence;
+ dyn_sequence.init (this->current_value_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ success = dyn_sequence.seek (slot
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (success == 0)
+ return -1;
+
+ member =
+ dyn_sequence.current_component (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ break;
+ }
+ // Enums and sequences are the only two cases handled
+ // by Component_Array.
+ default:
+ return -1;
+ }
+
+ CORBA::Any_var value = member->to_any (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_ETCL_Constraint *comp = array->component ();
+
+ if (comp == 0)
+ {
+ TAO_ETCL_Literal_Constraint result (value.ptr ());
+ this->queue_.enqueue_head (result);
+ return 0;
+ }
+ else
+ {
+ this->current_value_ = value._retn ();
+ return comp->accept (this);
+ }
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_special (TAO_ETCL_Special *special)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::TypeCode_var tc = this->current_value_->type ();
+ tc = TAO_DynAnyFactory::strip_alias (tc.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::TCKind kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ switch (special->type ())
+ {
+ case TAO_ETCL_LENGTH:
+ {
+ CORBA::ULong length;
+
+ switch (kind)
+ {
+ case CORBA::tk_sequence:
+ {
+ TAO_DynSequence_i dyn_seq;
+ dyn_seq.init (current_value_.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DynamicAny::AnySeq_var any_seq =
+ dyn_seq.get_elements (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ length = any_seq->length ();
+ }
+ break;
+ case CORBA::tk_array:
+ {
+ length = tc->length (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ break;
+ default:
+ return -1;
+ }
+
+ TAO_ETCL_Literal_Constraint lit (length);
+ this->queue_.enqueue_head (lit);
+ return 0;
+ }
+ case TAO_ETCL_DISCRIMINANT:
+ {
+ // If the TCKind is not a union, the call to init() will
+ // raise an exception, and the catch block will return -1;
+ TAO_DynUnion_i dyn_union;
+ dyn_union.init (this->current_value_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DynamicAny::DynAny_var disc =
+ dyn_union.get_discriminator (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any_var disc_any = disc->to_any (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_ETCL_Literal_Constraint lit (disc_any.ptr ());
+ this->queue_.enqueue_head (lit);
+ return 0;
+ }
+ case TAO_ETCL_TYPE_ID:
+ {
+ const char *name = tc->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_ETCL_Literal_Constraint lit (name);
+ this->queue_.enqueue_head (lit);
+ return 0;
+ }
+ case TAO_ETCL_REPOS_ID:
+ {
+ const char *id = tc->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_ETCL_Literal_Constraint lit (id);
+ this->queue_.enqueue_head (lit);
+ return 0;
+ }
+ default:
+ return -1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_component (
+ TAO_ETCL_Component *component
+ )
+{
+ TAO_ETCL_Constraint *nested = component->component ();
+ TAO_ETCL_Identifier *identifier = component->identifier ();
+ ACE_CString component_name (identifier->value (),
+ 0,
+ 0);
+ CORBA::Any *any_ptr = 0;
+
+ if (this->implicit_ids_.find (component_name, this->implicit_id_) != 0)
+ this->implicit_id_ = TAO_Notify_Constraint_Visitor::EMPTY;
+
+ // If this component has no sub-component, only an identifier, then
+ // we just visit the identifier, which puts a literal on the queue
+ // to be handled upon returning from this method call. If there is
+ // a sub-component, we store the literal's value in our member _var
+ // for possible examination at a more nested level, and visit the
+ // sub-component. If the identifier matches one of the nested field
+ // names in CosNotification::StructuredEvent, we just visit the
+ // nested component, if any.
+ if (this->implicit_id_ == TAO_Notify_Constraint_Visitor::EMPTY)
+ {
+ if (nested == 0)
+ {
+ // If this is the end of the line, we put the component name
+ // into current_value_ so visit_exist can use it.
+ ACE_NEW_RETURN (any_ptr,
+ CORBA::Any,
+ -1);
+ (*any_ptr) <<= component_name.c_str ();
+ this->current_value_ = any_ptr;
+ return identifier->accept (this);
+ }
+ else
+ {
+ int result = identifier->accept (this);
+
+ if (result != 0)
+ return result;
+
+ TAO_ETCL_Literal_Constraint id;
+ this->queue_.dequeue_head (id);
+ ACE_NEW_RETURN (any_ptr,
+ CORBA::Any (*(const CORBA::Any *) id),
+ -1);
+ this->current_value_ = any_ptr;
+ }
+ }
+
+ if (nested != 0)
+ return nested->accept (this);
+ else
+ {
+ switch (this->implicit_id_)
+ {
+ case TYPE_NAME:
+ {
+ TAO_ETCL_Literal_Constraint tn (this->type_name_.in ());
+ this->queue_.enqueue_head (tn);
+ return 0;
+ }
+ case EVENT_NAME:
+ {
+ TAO_ETCL_Literal_Constraint en (this->event_name_.in ());
+ this->queue_.enqueue_head (en);
+ return 0;
+ }
+ case DOMAIN_NAME:
+ {
+ TAO_ETCL_Literal_Constraint dn (this->domain_name_.in ());
+ this->queue_.enqueue_head (dn);
+ return 0;
+ }
+ case REMAINDER_OF_BODY:
+ {
+ TAO_ETCL_Literal_Constraint rob (&this->remainder_of_body_);
+ this->queue_.enqueue_head (rob);
+ return 0;
+ }
+ // The above cases are the leaves of the
+ // CosNotification::StructuredEvent "tree". Anything else and we
+ // should have a nested component. otherwise, it's an error.
+ default:
+ return -1;
+ }
+ }
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_dot (TAO_ETCL_Dot *dot)
+{
+ // If we are here, we know we're headed for a more nested
+ // level, so we just visit it, there's nothing else in this
+ // constraint.
+ return dot->component ()->accept (this);
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_eval (TAO_ETCL_Eval *eval)
+{
+ // Nothing to do but visit the contained component.
+ return eval->component ()->accept (this);
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_default (TAO_ETCL_Default *def)
+{
+ TAO_ETCL_Constraint *comp = def->component ();
+
+ if (comp == 0)
+ return -1;
+
+ if (comp->accept (this) != 0)
+ return -1;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::TypeCode_var tc = this->current_value_->type ();
+
+ // If the current member is not a union, this call will throw
+ // BadKind and the catch block will return -1.
+ CORBA::Long default_index = tc->default_index (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // No default index.
+ if (default_index == -1)
+ {
+ TAO_ETCL_Literal_Constraint result ((CORBA::Boolean) 0);
+ this->queue_.enqueue_head (result);
+ return 0;
+ }
+
+ // Okay, there's a default index, but is it active?
+
+ TAO_ETCL_Literal_Constraint disc;
+ this->queue_.dequeue_head (disc);
+ TAO_ETCL_Literal_Constraint default_index_value (default_index);
+ return (disc == default_index_value);
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_exist (TAO_ETCL_Exist *exist)
+{
+ TAO_ETCL_Constraint *component = exist->component ();
+
+ if (component->accept (this) == 0)
+ {
+ const char *value = 0;
+ CORBA::Boolean result = 0;
+
+ // For the two cases below, we don't want the item at the top of
+ // the queue, because it's the result of a hash table
+ // lookup. For an existence test, we want the key value, which
+ // is stored in the current_value_ member.
+ if (this->implicit_id_ == FILTERABLE_DATA
+ || this->implicit_id_ == VARIABLE_HEADER)
+ {
+ TAO_ETCL_Literal_Constraint current (&this->current_value_.inout ());
+ value = CORBA::string_dup ((const char *) current);
+ }
+
+ switch (this->implicit_id_)
+ {
+ case FILTERABLE_DATA:
+ result =
+ (this->filterable_data_.find (ACE_CString (value, 0, 0)) == 0);
+ break;
+ case VARIABLE_HEADER:
+ result =
+ (this->variable_header_.find (ACE_CString (value, 0, 0)) == 0);
+ break;
+ case TYPE_NAME:
+ result = (this->type_name_.in () != 0);
+ break;
+ case EVENT_NAME:
+ result = (this->event_name_.in () != 0);
+ break;
+ case DOMAIN_NAME:
+ result = (this->domain_name_.in () != 0);
+ break;
+ // Anything other than the above cases is an error.
+ default:
+ return -1;
+ }
+
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+
+ return 0;
+ }
+
+ return -1;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_unary_expr (
+ TAO_ETCL_Unary_Expr *unary_expr
+ )
+{
+ TAO_ETCL_Constraint *subexpr = unary_expr->subexpr ();
+
+ if (subexpr->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint subexpr_result;
+ CORBA::Boolean result = 0;
+ int op_type = unary_expr->type ();
+
+ switch (op_type)
+ {
+ case TAO_ETCL_NOT:
+ this->queue_.dequeue_head (subexpr_result);
+ result = ! (CORBA::Boolean) subexpr_result;
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ return 0;
+ case TAO_ETCL_MINUS:
+ // The leading '-' was parsed separately, so we have to pull
+ // the literal constraint off the queue, apply the class' own
+ // unary minus operator, and put it back.
+ this->queue_.dequeue_head (subexpr_result);
+ this->queue_.enqueue_head (-subexpr_result);
+ return 0;
+ case TAO_ETCL_PLUS:
+ // Leave the literal constraint on the queue. The leading
+ // '+' was just syntactic sugar - no action is necessary.
+ return 0;
+ default:
+ // The parser should never construct a TAO_ETCL_Unary_Constraint
+ // behind any operators except the above three.
+ return -1;
+ }
+ }
+
+ return -1;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_binary_expr (
+ TAO_ETCL_Binary_Expr *binary_expr
+ )
+{
+ int bin_op_type = binary_expr->type ();
+
+ switch (bin_op_type)
+ {
+ case TAO_ETCL_OR:
+ return this->visit_or (binary_expr);
+ case TAO_ETCL_AND:
+ return this->visit_and (binary_expr);
+ case TAO_ETCL_LT:
+ case TAO_ETCL_LE:
+ case TAO_ETCL_GT:
+ case TAO_ETCL_GE:
+ case TAO_ETCL_EQ:
+ case TAO_ETCL_NE:
+ case TAO_ETCL_PLUS:
+ case TAO_ETCL_MINUS:
+ case TAO_ETCL_MULT:
+ case TAO_ETCL_DIV:
+ return this->visit_binary_op (binary_expr,
+ bin_op_type);
+ case TAO_ETCL_TWIDDLE:
+ return this->visit_twiddle (binary_expr);
+ case TAO_ETCL_IN:
+ return this->visit_in (binary_expr);
+ default:
+ return -1;
+ }
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_or (
+ TAO_ETCL_Binary_Expr *binary
+ )
+{
+ int return_value = -1;
+ CORBA::Boolean result = 0;
+ TAO_ETCL_Constraint *lhs = binary->lhs ();
+
+ if (lhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint lhs_result;
+ this->queue_.dequeue_head (lhs_result);
+ result = (CORBA::Boolean) lhs_result;
+
+ // Short-circuiting OR.
+ if (result == 0)
+ {
+ TAO_ETCL_Constraint *rhs = binary->rhs ();
+
+ if (rhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint rhs_result;
+ this->queue_.dequeue_head (rhs_result);
+ result = (CORBA::Boolean) rhs_result;
+ return_value = 0;
+ }
+ }
+ else
+ return_value = 0;
+ }
+
+ if (return_value == 0)
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+
+ return return_value;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_and (TAO_ETCL_Binary_Expr *binary)
+{
+ int return_value = -1;
+ CORBA::Boolean result = 0;
+ TAO_ETCL_Constraint *lhs = binary->lhs ();
+
+ if (lhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint lhs_result;
+ this->queue_.dequeue_head (lhs_result);
+ result = (CORBA::Boolean) lhs_result;
+
+ // Short-circuiting AND.
+ if (result == 1)
+ {
+ TAO_ETCL_Constraint *rhs = binary->rhs ();
+
+ if (rhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint rhs_result;
+ this->queue_.dequeue_head (rhs_result);
+ result = (CORBA::Boolean) rhs_result;
+ return_value = 0;
+ }
+ }
+ else
+ return_value = 0;
+ }
+
+ if (return_value == 0)
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+
+ return return_value;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_binary_op (TAO_ETCL_Binary_Expr *binary,
+ int op_type)
+{
+ int return_value = -1;
+ TAO_ETCL_Constraint *lhs = binary->lhs ();
+ CORBA::Boolean result = 0;
+
+ // Perform an operation on the results of evaluating the left and
+ // right branches of this subtree.
+ if (lhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint left_operand;
+ this->queue_.dequeue_head (left_operand);
+ TAO_ETCL_Constraint *rhs = binary->rhs ();
+
+ if (rhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint right_operand;
+ this->queue_.dequeue_head (right_operand);
+ return_value = 0;
+
+ switch (op_type)
+ {
+ case TAO_ETCL_LT:
+ result = left_operand < right_operand;
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ break;
+ case TAO_ETCL_LE:
+ result = left_operand <= right_operand;
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ break;
+ case TAO_ETCL_GT:
+ result = left_operand > right_operand;
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ break;
+ case TAO_ETCL_GE:
+ result = left_operand >= right_operand;
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ break;
+ case TAO_ETCL_EQ:
+ result = left_operand == right_operand;
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ break;
+ case TAO_ETCL_NE:
+ result = left_operand != right_operand;
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ break;
+ case TAO_ETCL_PLUS:
+ this->queue_.enqueue_head (left_operand + right_operand);
+ break;
+ case TAO_ETCL_MINUS:
+ this->queue_.enqueue_head (left_operand - right_operand);
+ break;
+ case TAO_ETCL_MULT:
+ this->queue_.enqueue_head (left_operand * right_operand);
+ break;
+ case TAO_ETCL_DIV:
+ this->queue_.enqueue_head (left_operand / right_operand);
+ break;
+ default:
+ return_value = -1;
+ }
+ }
+ }
+
+ return return_value;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_twiddle (TAO_ETCL_Binary_Expr *binary)
+{
+ int return_value = -1;
+ TAO_ETCL_Constraint *lhs = binary->lhs ();
+
+ // Determine if the left operand is a substring of the right.
+ if (lhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint left;
+ this->queue_.dequeue_head (left);
+ TAO_ETCL_Constraint *rhs = binary->rhs ();
+
+ if (rhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint right;
+ this->queue_.dequeue_head (right);
+ CORBA::Boolean result =
+ (ACE_OS::strstr ((const char *) right,
+ (const char *) left) != 0);
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ return_value = 0;
+ }
+ }
+
+ return return_value;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_in (TAO_ETCL_Binary_Expr *binary)
+{
+ int return_value = -1;
+ TAO_ETCL_Constraint *lhs = binary->lhs ();
+
+ // Determine if the left operand is contained in the right.
+ if (lhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint left;
+ this->queue_.dequeue_head (left);
+
+ TAO_ETCL_Constraint *rhs = binary->rhs ();
+
+ if (rhs->accept (this) == 0)
+ {
+ TAO_ETCL_Literal_Constraint bag;
+ this->queue_.dequeue_head (bag);
+
+ if (bag.expr_type () == TAO_ETCL_COMPONENT)
+ {
+ const CORBA::Any *component = (const CORBA::Any *) bag;
+ CORBA::TCKind kind = CORBA::tk_null;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::TypeCode_var tc = component->type ();
+ kind = TAO_DynAnyFactory::unalias (tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return return_value;
+ }
+ ACE_ENDTRY;
+
+ CORBA::Boolean result = 0;
+
+ switch (kind)
+ {
+ case CORBA::tk_sequence:
+ result = this->sequence_does_contain (component,
+ left);
+ break;
+ case CORBA::tk_array:
+ result = this->array_does_contain (component,
+ left);
+ break;
+ case CORBA::tk_struct:
+ result = this->struct_does_contain (component,
+ left);
+ break;
+ case CORBA::tk_union:
+ result = this->union_does_contain (component,
+ left);
+ break;
+ case CORBA::tk_any:
+ result = this->any_does_contain (component,
+ left);
+ break;
+ default:
+ return return_value;
+ }
+
+ this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
+ return_value = 0;
+ }
+ }
+ }
+
+ return return_value;
+}
+
+int
+TAO_Notify_Constraint_Visitor::visit_preference (TAO_ETCL_Preference *)
+{
+ // According to OMG 00-06-20 section 2.4.1, the Notification Service
+ // does not use the preference operators. The method must be here
+ // because it is called by the ETCL node, which may be used by other
+ // CORBA services that do use the preference operators.
+ return -1;
+}
+
+CORBA::Boolean
+TAO_Notify_Constraint_Visitor::sequence_does_contain (const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::TypeCode_var type = any->type ();
+ CORBA::TypeCode_var base_type =
+ TAO_DynAnyFactory::strip_alias (type.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::TypeCode_var content_type =
+ base_type->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::TCKind kind =
+ TAO_DynAnyFactory::unalias (content_type.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The literal and the array elements must be
+ // of the same simple type.
+ CORBA::Boolean match = this->simple_type_match (item.expr_type (),
+ kind);
+
+ if (match == 0)
+ return 0;
+
+ TAO_DynSequence_i dyn_seq;
+ dyn_seq.init (*any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DynamicAny::AnySeq_var any_seq =
+ dyn_seq.get_elements (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ULong length = any_seq->length ();
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ TAO_ETCL_Literal_Constraint element (&any_seq[i]);
+
+ if (item == element)
+ return 1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return 0;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+CORBA::Boolean
+TAO_Notify_Constraint_Visitor::array_does_contain (const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::TypeCode_var type = any->type ();
+ CORBA::TCKind kind = TAO_DynAnyFactory::unalias (type.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The literal and the array elements must be
+ // of the same simple type.
+ CORBA::Boolean match = this->simple_type_match (item.expr_type (),
+ kind);
+
+ if (match == 0)
+ return 0;
+
+ TAO_DynArray_i dyn_array;
+ dyn_array.init (*any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DynamicAny::AnySeq_var any_seq =
+ dyn_array.get_elements (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ULong length = any_seq->length ();
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ TAO_ETCL_Literal_Constraint element (&any_seq[i]);
+
+ if (item == element)
+ return 1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return 0;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+CORBA::Boolean
+TAO_Notify_Constraint_Visitor::struct_does_contain (const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ TAO_DynStruct_i dyn_struct;
+ dyn_struct.init (*any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DynamicAny::NameValuePairSeq_var members =
+ dyn_struct.get_members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ULong length = members->length ();
+ CORBA::TypeCode_var tc;
+ CORBA::TCKind kind;
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ tc = members[i].value.type ();
+ kind = TAO_DynAnyFactory::unalias (tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The literal and the struct member must be
+ // of the same simple type.
+ CORBA::Boolean match = this->simple_type_match (item.expr_type (),
+ kind);
+
+ if (match == 0)
+ continue;
+
+ TAO_ETCL_Literal_Constraint element (&members[i].value);
+
+ if (item == element)
+ return 1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return 0;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+CORBA::Boolean
+TAO_Notify_Constraint_Visitor::union_does_contain (const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ TAO_DynUnion_i dyn_union;
+ dyn_union.init (*any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DynamicAny::DynAny_var cc =
+ dyn_union.current_component (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any_var member = cc->to_any (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::TypeCode_var tc = member->type ();
+ CORBA::TCKind kind = TAO_DynAnyFactory::unalias (tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The literal and the union member must be
+ // of the same simple type.
+ CORBA::Boolean match = this->simple_type_match (item.expr_type (),
+ kind);
+
+ if (match == 0)
+ return 0;
+
+ TAO_ETCL_Literal_Constraint element (&member.inout ());
+
+ return (item == element);
+ }
+ ACE_CATCHANY
+ {
+ return 0;
+ }
+ ACE_ENDTRY;
+}
+
+CORBA::Boolean
+TAO_Notify_Constraint_Visitor::any_does_contain (
+ const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item
+ )
+{
+ const CORBA::Any *result = 0;
+
+ *any >>= result;
+
+ TAO_ETCL_Literal_Constraint element (const_cast<CORBA::Any *>(result));
+ return item == element;
+}
+
+CORBA::Boolean
+TAO_Notify_Constraint_Visitor::simple_type_match (int expr_type,
+ CORBA::TCKind tc_kind)
+{
+ switch (expr_type)
+ {
+ case TAO_ETCL_STRING:
+ if (tc_kind != CORBA::tk_string)
+ return 0;
+ break;
+ case TAO_ETCL_DOUBLE:
+ if (tc_kind != CORBA::tk_double
+ && tc_kind != CORBA::tk_float)
+ return 0;
+ break;
+ case TAO_ETCL_INTEGER:
+ case TAO_ETCL_SIGNED:
+ if (tc_kind != CORBA::tk_short
+ && tc_kind != CORBA::tk_long
+ && tc_kind != CORBA::tk_longlong)
+ return 0;
+ break;
+ case TAO_ETCL_UNSIGNED:
+ if (tc_kind != CORBA::tk_ushort
+ && tc_kind != CORBA::tk_ulong
+ && tc_kind != CORBA::tk_ulonglong)
+ return 0;
+ break;
+ case TAO_ETCL_BOOLEAN:
+ if (tc_kind != CORBA::tk_boolean)
+ return 0;
+ break;
+ default:
+ return 0;
+ }
+ return 1;
+}
+
+const size_t TAO_Notify_Constraint_Visitor::implicit_ids_size_ = 27;
+const size_t TAO_Notify_Constraint_Visitor::filterable_data_size_ = 31;
+const size_t TAO_Notify_Constraint_Visitor::variable_header_size_ = 31;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.h
new file mode 100644
index 00000000000..2033737b4ec
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.h
@@ -0,0 +1,168 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Notify_Constraint_Visitors.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ * @author Jeff Parsons <parsons@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef NOTIFY_CONSTRAINT_VISITORS_H
+#define NOTIFY_CONSTRAINT_VISITORS_H
+
+#include /**/ "ace/pre.h"
+#include "ace/Hash_Map_Manager.h"
+#include "ace/Unbounded_Queue.h"
+#include "ace/Null_Mutex.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ETCL/ETCL_Constraint_Visitor.h"
+#include "orbsvcs/ETCL/ETCL_Constraint.h"
+#include "orbsvcs/CosNotificationC.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Property_Constraint;
+
+class TAO_Notify_Serv_Export TAO_Notify_Constraint_Visitor
+ : public TAO_ETCL_Constraint_Visitor
+{
+public:
+ /// Constructor.
+ TAO_Notify_Constraint_Visitor (void);
+
+ /// Put the event data into our hash map.
+ int bind_structured_event (const CosNotification::StructuredEvent &s_event);
+
+ /**
+ * Returns 1 if the event satisfies the constraint
+ * represented by the the expression tree rooted at <root>, 0 if it
+ * doesn't. If an error occurs during the process, the traversal
+ * automatically fails.
+ */
+ CORBA::Boolean evaluate_constraint (TAO_ETCL_Constraint *root);
+
+ // The overridden methods.
+ int visit_literal (TAO_ETCL_Literal_Constraint *);
+ int visit_identifier (TAO_ETCL_Identifier *);
+ int visit_union_value (TAO_ETCL_Union_Value *);
+ int visit_union_pos (TAO_ETCL_Union_Pos *);
+ int visit_component_pos (TAO_ETCL_Component_Pos *);
+ int visit_component_assoc (TAO_ETCL_Component_Assoc *);
+ int visit_component_array (TAO_ETCL_Component_Array *);
+ int visit_special (TAO_ETCL_Special *);
+ int visit_component (TAO_ETCL_Component *);
+ int visit_dot (TAO_ETCL_Dot *);
+ int visit_eval (TAO_ETCL_Eval *);
+ int visit_default (TAO_ETCL_Default *);
+ int visit_exist (TAO_ETCL_Exist *);
+ int visit_unary_expr (TAO_ETCL_Unary_Expr *);
+ int visit_binary_expr (TAO_ETCL_Binary_Expr *);
+ int visit_preference (TAO_ETCL_Preference *);
+
+protected:
+ // Sub-methods for visit_binary_expr().
+ int visit_or (TAO_ETCL_Binary_Expr *);
+ int visit_and (TAO_ETCL_Binary_Expr *);
+ int visit_twiddle (TAO_ETCL_Binary_Expr *);
+ int visit_in (TAO_ETCL_Binary_Expr *);
+ int visit_binary_op (TAO_ETCL_Binary_Expr *binary_expr,
+ int op_type);
+
+ // These use dynamic anys to look inside the ETCL component.
+ CORBA::Boolean sequence_does_contain (const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item);
+ CORBA::Boolean array_does_contain (const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item);
+ CORBA::Boolean struct_does_contain (const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item);
+ CORBA::Boolean union_does_contain (const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item);
+ CORBA::Boolean any_does_contain (const CORBA::Any *any,
+ TAO_ETCL_Literal_Constraint &item);
+
+ // Utility function to compare a TAO_ETCL_Literal_Constraint type
+ // and a type code.
+ CORBA::Boolean simple_type_match (int expr_type,
+ CORBA::TCKind tc_kind);
+
+ enum structured_event_field
+ {
+ FILTERABLE_DATA,
+ HEADER,
+ FIXED_HEADER,
+ EVENT_TYPE,
+ DOMAIN_NAME,
+ TYPE_NAME,
+ EVENT_NAME,
+ VARIABLE_HEADER,
+ REMAINDER_OF_BODY,
+ EMPTY
+ };
+
+ /// Storage for the type of implicit id the component has (if any).
+ structured_event_field implicit_id_;
+
+ /// Size of implicit_ids_ hash map.
+ /// @note A fixed set of 9 keys are stored in this map. In the absence
+ /// of a minimal perfect hash, ACE's default hash_pjw() and a hash size
+ /// of 27 ensures each element is hashed to a unique bucket.
+ /// TODO: define inline once VC6 support is deprecated.
+ static const size_t implicit_ids_size_;
+
+ /// Lookup table for the implicit ids, to avoid string comparisons in
+ /// derived visitors.
+ ACE_Hash_Map_Manager <ACE_CString, structured_event_field, ACE_Null_Mutex>
+ implicit_ids_;
+
+ /// Size of filterable_data_ hash map.
+ /// TODO: define inline once VC6 support is deprecated.
+ static const size_t filterable_data_size_;
+
+ /// Used to lookup names and values in the event's 'filterable_data' field.
+ ACE_Hash_Map_Manager <ACE_CString, CORBA::Any, ACE_Null_Mutex>
+ filterable_data_;
+
+ /// Size of variable_header_ hash map.
+ /// TODO: define inline once VC6 support is deprecated.
+ static const size_t variable_header_size_;
+
+ /// Used to lookup names and values in the event's 'variable_header' field.
+ ACE_Hash_Map_Manager <ACE_CString, CORBA::Any, ACE_Null_Mutex>
+ variable_header_;
+
+ /// Storage for string names under the structured event's
+ /// 'fixed_header' field.
+ CORBA::String_var domain_name_;
+ CORBA::String_var type_name_;
+ CORBA::String_var event_name_;
+
+ /// Storage for the structured_event's 'remainder_of_body' field.
+ CORBA::Any remainder_of_body_;
+
+ /// The result of a non_boolean operation.
+ ACE_Unbounded_Queue <TAO_ETCL_Literal_Constraint> queue_;
+
+ /// Holder for a value found in the event fields filterable_data,
+ /// variable_header or remainder_of_body.
+ CORBA::Any_var current_value_;
+
+ /// Holder for a string name in the event fields fixed_header,
+ /// variable_header, or filterable_data.
+ CORBA::String_var current_name_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* NOTIFY_CONSTRAINT_VISITORS_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_CO_Factory.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_CO_Factory.cpp
new file mode 100644
index 00000000000..5110d567625
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_CO_Factory.cpp
@@ -0,0 +1,17 @@
+// $Id$
+
+#include "orbsvcs/Notify/Notify_Default_CO_Factory.h"
+
+ACE_RCSID(Notify, Notify_Default_CO_Factory, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int
+TAO_Notify_Default_CO_Factory::init_svc (void)
+{
+ // NOP.
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_CO_Factory.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_CO_Factory.h
new file mode 100644
index 00000000000..8976e345f10
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_CO_Factory.h
@@ -0,0 +1,48 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Notify_Default_CO_Factory.h
+ *
+ * $Id$
+ *
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef NOTIFY_DEFAULT_CO_FACTORY_H
+#define NOTIFY_DEFAULT_CO_FACTORY_H
+
+#include /**/ "ace/pre.h"
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Default_CO_Factory
+ *
+ * @brief TAO_Notify_Default_CO_Factory
+ *
+ * Maintained for backward compatibility.
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Default_CO_Factory
+{
+public:
+ /// Helper function to register the default factory into the service
+ /// configurator.
+ static int init_svc (void);
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* NOTIFY_DEFAULT_CO_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_Collection_Factory.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_Collection_Factory.cpp
new file mode 100644
index 00000000000..37a286dbb99
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_Collection_Factory.cpp
@@ -0,0 +1,17 @@
+// $Id$
+
+#include "orbsvcs/Notify/Notify_Default_Collection_Factory.h"
+
+ACE_RCSID(Notify, Notify_Default_Collection_Factory, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int
+TAO_Notify_Default_Collection_Factory::init_svc (void)
+{
+ // NOP.
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_Collection_Factory.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_Collection_Factory.h
new file mode 100644
index 00000000000..c416d093de5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_Collection_Factory.h
@@ -0,0 +1,47 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Notify_Default_Collection_Factory.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef NOTIFY_DEFAULT_COLLECTION_FACTORY_H
+#define NOTIFY_DEFAULT_COLLECTION_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Default_Collection_Factory
+ *
+ * @brief Maintained for backward compatibility.
+ *
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Default_Collection_Factory
+{
+public:
+
+ /// Helper function to register the default factory into the service
+ /// configurator.
+ static int init_svc (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* NOTIFY_DEFAULT_COLLECTION_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_EMO_Factory.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_EMO_Factory.cpp
new file mode 100644
index 00000000000..2c9cc3f9237
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_EMO_Factory.cpp
@@ -0,0 +1,17 @@
+// $Id$
+
+#include "orbsvcs/Notify/Notify_Default_EMO_Factory.h"
+
+ACE_RCSID(Notify, Notify_Default_EMO_Factory, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int
+TAO_Notify_Default_EMO_Factory::init_svc (void)
+{
+ // NOP.
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_EMO_Factory.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_EMO_Factory.h
new file mode 100644
index 00000000000..73023b439bf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_EMO_Factory.h
@@ -0,0 +1,45 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Notify_Default_EMO_Factory.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef NOTIFY_DEFAULT_EMO_FACTORY_H
+#define NOTIFY_DEFAULT_EMO_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Default_EMO_Factory
+ *
+ * @brief Maintained for backward compatibility.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Default_EMO_Factory
+{
+public:
+ /// Helper function to register the default factory into the service
+ /// configurator.
+ static int init_svc (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* NOTIFY_DEFAULT_EMO_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_POA_Factory.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_POA_Factory.cpp
new file mode 100644
index 00000000000..6d32c554047
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_POA_Factory.cpp
@@ -0,0 +1,17 @@
+// $Id$
+
+#include "orbsvcs/Notify/Notify_Default_POA_Factory.h"
+
+ACE_RCSID(Notify, Notify_Default_POA_Factory, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int
+TAO_Notify_Default_POA_Factory::init_svc (void)
+{
+ // NOP.
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_POA_Factory.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_POA_Factory.h
new file mode 100644
index 00000000000..62674479d29
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Default_POA_Factory.h
@@ -0,0 +1,44 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Notify_Default_POA_Factory.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_NOTIFY_DEFAULT_POA_FACTORY_H
+#define TAO_NOTIFY_DEFAULT_POA_FACTORY_H
+
+#include /**/ "ace/pre.h"
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Default_POA_Factory
+ *
+ * @brief Maintained for backward compatibility.
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Default_POA_Factory
+{
+public:
+ /// Helper function to register the default factory into the service
+ /// configurator.
+ static int init_svc (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_NOTIFY_DEFAULT_POA_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.cpp
new file mode 100644
index 00000000000..2bc881f15a7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.cpp
@@ -0,0 +1,41 @@
+// $Id$
+
+#include "orbsvcs/Notify/Notify_EventChannelFactory_i.h"
+
+#include "orbsvcs/Notify/Service.h"
+#include "ace/Dynamic_Service.h"
+#include "tao/PortableServer/Root_POA.h"
+#include "tao/ORB_Core.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+CosNotifyChannelAdmin::EventChannelFactory_ptr
+TAO_Notify_EventChannelFactory_i::create (PortableServer::POA_ptr default_POA ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory;
+
+ TAO_Notify_Service* notify_service = ACE_Dynamic_Service<TAO_Notify_Service>::instance (TAO_COS_NOTIFICATION_SERVICE_NAME);
+
+ if (notify_service == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Service not found! check conf. file\n"));
+ return notify_factory._retn ();
+ }
+
+ TAO_Root_POA *poa = dynamic_cast <TAO_Root_POA*> (default_POA);
+
+ if (poa == 0)
+ return notify_factory._retn ();
+
+ CORBA::ORB_ptr orb = poa->orb_core ().orb () ;
+
+ notify_service->init_service (orb ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (notify_factory._retn ());
+
+ notify_factory = notify_service->create (default_POA ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (notify_factory._retn ());
+
+ return notify_factory._retn ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.h
new file mode 100644
index 00000000000..60ccb0b068d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.h
@@ -0,0 +1,44 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Notify_EventChannelFactory_i.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef NOTIFY_EVENTCHANNELFACTORY_I_H
+#define NOTIFY_EVENTCHANNELFACTORY_I_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_EventChannelFactory_i
+ *
+ * @brief Class maintained for Backward compatibility.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_EventChannelFactory_i
+{
+public:
+ /// Create a factory servant and activates it with the default POA.
+ /// Also creates a resource factory and assigns it this default_POA.
+ static CosNotifyChannelAdmin::EventChannelFactory_ptr create (PortableServer::POA_ptr default_POA ACE_ENV_ARG_DECL);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* NOTIFY_EVENTCHANNELFACTORY_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Extensions.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_Extensions.cpp
new file mode 100644
index 00000000000..a73b9be6a6c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Extensions.cpp
@@ -0,0 +1,12 @@
+// $Id$
+
+#include "orbsvcs/Notify/Notify_Extensions.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify_Extensions
+{
+ const char BlockingPolicy[] = "BlockingPolicy";
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Extensions.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_Extensions.h
new file mode 100644
index 00000000000..247e7655d40
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Extensions.h
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+// $Id$
+
+#ifndef TAO_NOTIFY_EXTENSIONS_H
+#define TAO_NOTIFY_EXTENSIONS_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/orbconf.h"
+
+#if defined (TAO_EXPORT_MACRO)
+# undef TAO_EXPORT_MACRO
+#endif /* TAO_EXPORT_MACRO */
+#define TAO_EXPORT_MACRO TAO_Notify_Export
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify_Extensions
+{
+ TAO_NAMESPACE_STORAGE_CLASS const char BlockingPolicy[];
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_NOTIFY_EXTENSIONS_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Object.cpp b/TAO/orbsvcs/orbsvcs/Notify/Object.cpp
new file mode 100644
index 00000000000..a00a6c374b8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Object.cpp
@@ -0,0 +1,372 @@
+// $Id$
+
+#include "orbsvcs/Notify/Object.h"
+#include "orbsvcs/Notify/POA_Helper.h"
+#include "orbsvcs/Notify/Worker_Task.h"
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/Builder.h"
+#include "orbsvcs/Notify/ThreadPool_Task.h"
+#include "orbsvcs/Notify/Reactive_Task.h"
+#include "tao/debug.h"
+#include "orbsvcs/Notify/Event_Manager.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Object.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Notify, TAO_Notify_Object, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Object::TAO_Notify_Object (void)
+: poa_ (0)
+, proxy_poa_ (0)
+, own_proxy_poa_ (false)
+, object_poa_ (0)
+, own_object_poa_ (false)
+, id_ (0)
+, own_worker_task_ (false)
+, shutdown_ (false)
+{
+ if (TAO_debug_level > 2 )
+ ACE_DEBUG ((LM_DEBUG,"object:%x created\n", this ));
+}
+
+TAO_Notify_Object::~TAO_Notify_Object ()
+{
+ if (TAO_debug_level > 2 )
+ ACE_DEBUG ((LM_DEBUG,"object:%x destroyed\n", this ));
+
+ this->destroy_proxy_poa ();
+ this->destroy_object_poa ();
+ this->destroy_poa ();
+}
+
+void
+TAO_Notify_Object::initialize (TAO_Notify_Object* parent)
+{
+ ACE_ASSERT (parent != 0 && this->event_manager_.get() == 0);
+
+ // Do not use sets to avoid asserts.
+ // Object must be able to inherit NULL references
+ // due to current design.
+ this->event_manager_ = parent->event_manager_;
+ this->admin_properties_ = parent->admin_properties_;
+ this->inherit_poas( *parent );
+ this->worker_task_ = parent->worker_task_;
+
+ // Pass QoS
+ parent->qos_properties_.transfer (this->qos_properties_);
+ this->qos_changed (this->qos_properties_);
+}
+
+void
+TAO_Notify_Object::set_event_manager( TAO_Notify_Event_Manager* event_manager )
+{
+ ACE_ASSERT( event_manager != 0 );
+ this->event_manager_.reset( event_manager );
+}
+
+CORBA::Object_ptr
+TAO_Notify_Object::activate (PortableServer::Servant servant ACE_ENV_ARG_DECL)
+{
+ return this->poa_->activate (servant, this->id_ ACE_ENV_ARG_PARAMETER);
+}
+
+/// Activate with existing id
+CORBA::Object_ptr
+TAO_Notify_Object::activate (
+ PortableServer::Servant servant,
+ CORBA::Long id
+ ACE_ENV_ARG_DECL)
+{
+ this->id_ = id;
+ return this->poa_->activate_with_id (servant, this->id_ ACE_ENV_ARG_PARAMETER);
+}
+
+
+void
+TAO_Notify_Object::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ this->poa_->deactivate (this->id_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Do not propagate any exceptions
+ if (TAO_debug_level > 2)
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "(%P|%t)\n");
+ ACE_DEBUG ((LM_DEBUG, "Could not deactivate object %d\n", this->id_));
+ }
+ }
+ ACE_ENDTRY;
+}
+
+int
+TAO_Notify_Object::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 1);
+
+ if (this->shutdown_ == 1)
+ return 1; // Another thread has already run shutdown.
+
+ this->shutdown_ = 1;
+ }
+
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+
+ this->shutdown_worker_task ();
+
+ return 0;
+}
+
+CORBA::Object_ptr
+TAO_Notify_Object::ref (ACE_ENV_SINGLE_ARG_DECL)
+{
+ return this->poa_->id_to_reference (this->id_ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Object::shutdown_worker_task (void)
+{
+ // Only do this if we are the owner.
+ TAO_Notify_Worker_Task::Ptr task( this->worker_task_ );
+ this->worker_task_.reset();
+ if ( task.isSet() )
+ {
+ if ( this->own_worker_task_ )
+ {
+ task->shutdown ();
+ }
+ }
+}
+
+void
+TAO_Notify_Object::destroy_proxy_poa (void)
+{
+ if (this->proxy_poa_ != 0)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ if ( this->proxy_poa_ == this->object_poa_ ) this->object_poa_ = 0;
+ if ( this->proxy_poa_ == this->poa_ ) this->poa_ = 0;
+
+ if ( this->own_proxy_poa_ == true )
+ {
+ this->own_proxy_poa_ = false;
+ ACE_Auto_Ptr< TAO_Notify_POA_Helper > app( object_poa_ );
+ this->proxy_poa_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ this->proxy_poa_ = 0;
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level > 2)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Proxy shutdown error (%P|%t)\n");
+ }
+ ACE_ENDTRY;
+ }
+}
+
+void
+TAO_Notify_Object::destroy_object_poa (void)
+{
+ if (this->object_poa_ != 0)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ if ( this->object_poa_ == this->proxy_poa_ ) this->proxy_poa_ = 0;
+ if ( this->object_poa_ == this->poa_ ) this->poa_ = 0;
+
+ if ( this->own_object_poa_ == true )
+ {
+ this->own_object_poa_ = false;
+ ACE_Auto_Ptr< TAO_Notify_POA_Helper > aop( object_poa_ );
+ this->object_poa_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ this->object_poa_ = 0;
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level > 2)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Proxy shutdown error (%P|%t)\n");
+ }
+ ACE_ENDTRY;
+ }
+}
+
+/// Shutdown the current poa.
+void TAO_Notify_Object::destroy_poa (void)
+{
+ this->poa_ = 0;
+}
+
+void
+TAO_Notify_Object::set_worker_task (TAO_Notify_Worker_Task* worker_task)
+{
+ ACE_ASSERT( worker_task != 0 );
+
+ // shutdown the current worker.
+ this->shutdown_worker_task ();
+
+ this->worker_task_.reset (worker_task);
+
+ this->own_worker_task_ = true;
+}
+
+void
+TAO_Notify_Object::set_proxy_poa (TAO_Notify_POA_Helper* proxy_poa)
+{
+ // shutdown current proxy poa.
+ this->destroy_proxy_poa ();
+
+ this->proxy_poa_ = proxy_poa;
+
+ this->own_proxy_poa_ = true;
+}
+
+void
+TAO_Notify_Object::set_object_poa (TAO_Notify_POA_Helper* object_poa)
+{
+ // shutdown current object poa.
+ this->destroy_object_poa ();
+
+ this->object_poa_ = object_poa;
+
+ this->own_object_poa_ = true;
+}
+
+void
+TAO_Notify_Object::set_poa (TAO_Notify_POA_Helper* poa)
+{
+ this->poa_ = poa;
+}
+
+void
+TAO_Notify_Object::set_qos (const CosNotification::QoSProperties & qos ACE_ENV_ARG_DECL)
+{
+ CosNotification::PropertyErrorSeq err_seq;
+
+ TAO_Notify_QoSProperties new_qos_properties;
+
+ if (new_qos_properties.init (qos, err_seq) == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+
+ // Apply the appropriate concurrency QoS
+ if (new_qos_properties.thread_pool ().is_valid ())
+ {
+ if (new_qos_properties.thread_pool ().value ().static_threads == 0)
+ {
+ TAO_Notify_PROPERTIES::instance()->builder()->apply_reactive_concurrency (*this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ TAO_Notify_PROPERTIES::instance()->builder()->
+ apply_thread_pool_concurrency (*this, new_qos_properties.thread_pool ().value () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ else if (new_qos_properties.thread_pool_lane ().is_valid ())
+ TAO_Notify_PROPERTIES::instance()->builder()->
+ apply_lane_concurrency (*this, new_qos_properties.thread_pool_lane ().value () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Update the Thread Task's QoS properties..
+ this->worker_task_->update_qos_properties (new_qos_properties);
+
+ // Inform subclasses of QoS changed.
+ this->qos_changed (new_qos_properties);
+
+ // Init the the overall QoS on this object.
+ if (new_qos_properties.copy (this->qos_properties_) == -1)
+ ACE_THROW (CORBA::INTERNAL ());
+
+ if (err_seq.length () > 0) // Unsupported Property
+ ACE_THROW (CosNotification::UnsupportedQoS (err_seq));
+}
+
+CosNotification::QoSProperties*
+TAO_Notify_Object::get_qos (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotification::QoSProperties_var properties;
+
+ ACE_NEW_THROW_EX (properties,
+ CosNotification::QoSProperties (),
+ CORBA::NO_MEMORY ());
+
+ this->qos_properties_.populate (properties);
+
+ return properties._retn ();
+}
+
+bool
+TAO_Notify_Object::find_qos_property_value (
+ const char * name,
+ CosNotification::PropertyValue & value) const
+{
+ return this->qos_properties_.find (name, value);
+}
+
+
+void
+TAO_Notify_Object::qos_changed (const TAO_Notify_QoSProperties& /*qos_properties*/)
+{
+ // NOP.
+}
+
+TAO_Notify_Timer*
+TAO_Notify_Object::timer (void)
+{
+ ACE_ASSERT (worker_task_.get() != 0);
+ return this->worker_task_->timer ();
+}
+
+namespace
+{
+ template<class T>
+ void add_qos_attr(TAO_Notify::NVPList& attrs, const T& prop)
+ {
+ if (prop.is_valid())
+ {
+ attrs.push_back(TAO_Notify::NVP (prop));
+ }
+ }
+} // namespace
+
+void
+TAO_Notify_Object::save_attrs (TAO_Notify::NVPList& attrs)
+{
+ add_qos_attr(attrs, this->qos_properties_.event_reliability ());
+ add_qos_attr(attrs, this->qos_properties_.connection_reliability ());
+ add_qos_attr(attrs, this->qos_properties_.priority ());
+ add_qos_attr(attrs, this->qos_properties_.timeout ());
+ add_qos_attr(attrs, this->qos_properties_.stop_time_supported ());
+ add_qos_attr(attrs, this->qos_properties_.maximum_batch_size ());
+ add_qos_attr(attrs, this->qos_properties_.pacing_interval ());
+}
+
+void
+TAO_Notify_Object::load_attrs(const TAO_Notify::NVPList& attrs)
+{
+ attrs.load (this->qos_properties_.event_reliability ());
+ attrs.load (this->qos_properties_.connection_reliability ());
+ attrs.load (this->qos_properties_.priority ());
+ attrs.load (this->qos_properties_.timeout ());
+ attrs.load (this->qos_properties_.stop_time_supported ());
+ attrs.load (this->qos_properties_.maximum_batch_size ());
+ attrs.load (this->qos_properties_.pacing_interval ());
+ this->qos_properties_.init ();
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Object.h b/TAO/orbsvcs/orbsvcs/Notify/Object.h
new file mode 100644
index 00000000000..7b9cb510b6c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Object.h
@@ -0,0 +1,221 @@
+// -*- C++ -*-
+
+/**
+ * @file Object.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_OBJECT_H
+#define TAO_Notify_OBJECT_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/QoSProperties.h"
+#include "orbsvcs/Notify/AdminProperties.h"
+#include "orbsvcs/Notify/Worker_Task.h"
+#include "orbsvcs/Notify/Refcountable.h"
+#include "orbsvcs/Notify/Name_Value_Pair.h"
+#include "orbsvcs/Notify/Event_Manager.h"
+
+#include "orbsvcs/NotifyExtC.h"
+
+#include "tao/PortableServer/Servant_Base.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_POA_Helper;
+class TAO_Notify_Timer;
+class TAO_Notify_RT_Builder;
+
+/**
+ * @class TAO_Notify_Object
+ *
+ * @brief Base Object for RT_Notify's CORBA Objects.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Object : public TAO_Notify_Refcountable
+{
+ friend class TAO_Notify_Builder;
+ friend class TAO_Notify_RT_Builder;
+
+public:
+ /// Id for Objects.
+ typedef CORBA::Long ID;
+
+ /// Destructor
+ virtual ~TAO_Notify_Object (void);
+
+ /// This Object's ID
+ ID id (void) const;
+
+ /// Activate
+ virtual CORBA::Object_ptr activate (PortableServer::Servant servant ACE_ENV_ARG_DECL);
+
+ /// Activate with existing id
+ virtual CORBA::Object_ptr activate (
+ PortableServer::Servant servant,
+ CORBA::Long id
+ ACE_ENV_ARG_DECL);
+
+ /// Deactivate
+ void deactivate (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Have we been shutdown. returns 1 if shutdown.
+ int has_shutdown (void);
+
+ void execute_task (TAO_Notify_Method_Request& method_request ACE_ENV_ARG_DECL);
+
+ /// Get CORBA Ref.
+ CORBA::Object_ptr ref (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Set the QoS Properties.
+ virtual void set_qos (const CosNotification::QoSProperties & qos ACE_ENV_ARG_DECL);
+
+ /// Get the QoS Properties.
+ CosNotification::QoSProperties* get_qos (ACE_ENV_SINGLE_ARG_DECL);
+
+ bool find_qos_property_value (
+ const char * name,
+ CosNotification::PropertyValue & value)const;
+
+ /// Obtain the Timer manager associated with this object.
+ virtual TAO_Notify_Timer* timer (void);
+
+ /// Accessor for the Event Manager
+ TAO_Notify_Event_Manager& event_manager (void);
+
+ /// shutdown. Returns 1 ifif the shutdown was already run once before.
+ virtual int shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Load our attributes. Each derived type should call the superclass
+ /// load first before loading its own attributes.
+ virtual void load_attrs(const TAO_Notify::NVPList& attrs);
+
+protected:
+ /// Constructor
+ TAO_Notify_Object (void);
+
+ /// Init this object with data from <rhs>.
+ void initialize (TAO_Notify_Object* parent);
+
+ /// Uses the poas from the supplied object
+ void inherit_poas (TAO_Notify_Object& parent);
+
+ /// Adopts the supplied poa as all are poas
+ void adopt_poa (TAO_Notify_POA_Helper* single);
+
+ /// Changes the primary poa to the current proxy poa
+ void set_primary_as_proxy_poa();
+
+ /// Accessor for the proxy_poa_
+ TAO_Notify_POA_Helper* proxy_poa (void);
+
+ /// Accessor for the object_poa_
+ TAO_Notify_POA_Helper* object_poa (void);
+
+ /// Get the POA assigned to us.
+ TAO_Notify_POA_Helper* poa (void);
+
+ // Sets the admin properties
+ void set_event_manager( TAO_Notify_Event_Manager* event_manager );
+
+ // Sets the admin properties
+ void set_admin_properties( TAO_Notify_AdminProperties* admin_properties );
+
+ /// Accessor for the Admin Properties
+ TAO_Notify_AdminProperties& admin_properties (void);
+
+ /// Notification that can be overridden by subclasses to be informed that <qos_properties_> have been modified.
+ virtual void qos_changed (const TAO_Notify_QoSProperties& qos_properties);
+
+ /// Called by derived types to save their attributes. Each
+ /// derived type should call its superclass version before
+ /// saving its own attrs.
+ virtual void save_attrs(TAO_Notify::NVPList& attrs);
+
+ ///= Protected data members.
+
+ /// QoS Properties.
+ TAO_Notify_QoSProperties qos_properties_;
+
+private:
+ /// Set Worker Task. This object assume ownership of the set object.
+ void set_worker_task (TAO_Notify_Worker_Task* worker_task);
+
+ /// Setting the proxy_poa_ gives ownership to this class.
+ void set_proxy_poa (TAO_Notify_POA_Helper* proxy_poa);
+
+ /// Setting the object_poa_ gives ownership to this class.
+ void set_object_poa (TAO_Notify_POA_Helper* object_poa);
+
+ /// Setting the object_poa_ gives ownership to this class.
+ void set_poa (TAO_Notify_POA_Helper* object_poa);
+
+ /// Shutdown the current worker task and delete it if we own it.
+ void shutdown_worker_task (void);
+
+ /// Shutdown the current proxy poa.
+ void destroy_proxy_poa (void);
+
+ /// Shutdown the current object poa.
+ void destroy_object_poa (void);
+
+ /// Shutdown the current poa.
+ void destroy_poa (void);
+
+protected:
+
+ /// The mutex to serialize access to state variables.
+ TAO_SYNCH_MUTEX lock_;
+
+private:
+
+ /// The POA in which the object is activated.
+ TAO_Notify_POA_Helper* poa_;
+
+ /// The POA in which the proxys are activated.
+ TAO_Notify_POA_Helper* proxy_poa_;
+ bool own_proxy_poa_;
+
+ /// The POA in which the object's children are activated.
+ TAO_Notify_POA_Helper* object_poa_;
+ bool own_object_poa_;
+
+ /// Id assigned to this object
+ ID id_;
+
+ /// The event manager.
+ //TAO_Notify_Event_Manager inl includes Object.h
+ TAO_Notify_Refcountable_Guard_T< TAO_Notify_Event_Manager > event_manager_;
+
+ /// Admin Properties.
+ TAO_Notify_AdminProperties::Ptr admin_properties_;
+
+ /// Worker Task.
+ TAO_Notify_Worker_Task::Ptr worker_task_;
+ bool own_worker_task_;
+
+ /// Are we shutdown (i,e. scheduled for destroy).
+ bool shutdown_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Object.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_OBJECT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Object.inl b/TAO/orbsvcs/orbsvcs/Notify/Object.inl
new file mode 100644
index 00000000000..fcc77e8b4d8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Object.inl
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE CORBA::Long
+TAO_Notify_Object::id (void) const
+{
+ return id_;
+}
+
+ACE_INLINE void
+TAO_Notify_Object::execute_task (TAO_Notify_Method_Request& method_request ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Worker_Task::Ptr task( this->worker_task_ );
+ if ( task.isSet() )
+ {
+ task->execute( method_request ACE_ENV_ARG_PARAMETER );
+ }
+}
+
+ACE_INLINE void
+TAO_Notify_Object::inherit_poas (TAO_Notify_Object& parent)
+{
+ this->set_proxy_poa( parent.proxy_poa() );
+ this->set_object_poa( parent.object_poa() );
+ this->set_poa( parent.poa() );
+
+ // Do not take ownership of parent's poas
+ own_proxy_poa_ = false;
+ own_object_poa_ = false;
+}
+
+ACE_INLINE void
+TAO_Notify_Object::adopt_poa (TAO_Notify_POA_Helper* single)
+{
+ ACE_ASSERT( single != 0 );
+ this->set_proxy_poa( single );
+ this->set_object_poa( single );
+ this->set_poa( single );
+
+ // Maintain ownership of the poa
+}
+
+ACE_INLINE void
+TAO_Notify_Object::set_primary_as_proxy_poa()
+{
+ this->set_poa( this->proxy_poa() );
+}
+
+ACE_INLINE TAO_Notify_POA_Helper*
+TAO_Notify_Object::poa (void)
+{
+ return this->poa_;
+}
+
+ACE_INLINE TAO_Notify_POA_Helper*
+TAO_Notify_Object::object_poa (void)
+{
+ return this->object_poa_;
+}
+
+ACE_INLINE TAO_Notify_POA_Helper*
+TAO_Notify_Object::proxy_poa (void)
+{
+ return this->proxy_poa_;
+}
+
+ACE_INLINE int
+TAO_Notify_Object::has_shutdown (void)
+{
+ return this->shutdown_;
+}
+
+ACE_INLINE void
+TAO_Notify_Object::set_admin_properties( TAO_Notify_AdminProperties* admin_properties )
+{
+ ACE_ASSERT( admin_properties != 0 );
+ this->admin_properties_.reset( admin_properties );
+}
+
+ACE_INLINE TAO_Notify_Event_Manager&
+TAO_Notify_Object::event_manager (void)
+{
+ ACE_ASSERT( this->event_manager_.get() != 0 );
+ return *this->event_manager_;
+}
+
+ACE_INLINE TAO_Notify_AdminProperties&
+TAO_Notify_Object::admin_properties (void)
+{
+ ACE_ASSERT( this->admin_properties_.get() != 0 );
+ return *this->admin_properties_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.cpp b/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.cpp
new file mode 100644
index 00000000000..0137934dd22
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.cpp
@@ -0,0 +1,218 @@
+// $Id$
+
+#include "orbsvcs/Notify/POA_Helper.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/POA_Helper.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(RT_Notify, TAO_Notify_POA_Helper, "$Id$")
+
+#include "tao/debug.h"
+//#define DEBUG_LEVEL 10
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif // DEBUG_LEVEL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_POA_Helper::TAO_Notify_POA_Helper (void)
+{
+}
+
+TAO_Notify_POA_Helper::~TAO_Notify_POA_Helper ()
+{
+}
+
+ACE_CString
+TAO_Notify_POA_Helper::get_unique_id (void)
+{
+ /// Factory for generating unique ids for the POAs.
+ static TAO_Notify_ID_Factory poa_id_factory;
+
+ char buf[32];
+ ACE_OS::itoa (poa_id_factory.id (), buf, 10);
+
+ return ACE_CString (buf);
+}
+
+void
+TAO_Notify_POA_Helper::init (PortableServer::POA_ptr parent_poa, const char* poa_name ACE_ENV_ARG_DECL)
+{
+ CORBA::PolicyList policy_list (2);
+
+ this->set_policy (parent_poa, policy_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->create_i (parent_poa, poa_name, policy_list ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_POA_Helper::init (PortableServer::POA_ptr parent_poa ACE_ENV_ARG_DECL)
+{
+ ACE_CString child_poa_name = this->get_unique_id ();
+
+ this->init (parent_poa, child_poa_name.c_str () ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_POA_Helper::set_policy (PortableServer::POA_ptr parent_poa, CORBA::PolicyList &policy_list ACE_ENV_ARG_DECL)
+{
+ policy_list.length (2);
+
+ policy_list[0] =
+ parent_poa->create_id_uniqueness_policy (PortableServer::UNIQUE_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ policy_list[1] =
+ parent_poa->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void
+TAO_Notify_POA_Helper::create_i (PortableServer::POA_ptr parent_poa, const char* poa_name, CORBA::PolicyList &policy_list ACE_ENV_ARG_DECL)
+{
+ PortableServer::POAManager_var manager =
+ parent_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Create the child POA.
+ this->poa_ = parent_poa->create_POA (poa_name,
+ manager.in (),
+ policy_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG, "Created POA : %s\n", this->poa_->the_name ()));
+ /*
+ // Destroy the policies
+ for (CORBA::ULong index = 0; index < policy_list.length (); ++index)
+ {
+ policy_list[index]->destroy ();
+ }
+ */
+}
+
+PortableServer::ObjectId *
+TAO_Notify_POA_Helper::long_to_ObjectId (CORBA::Long id ACE_ENV_ARG_DECL) const
+{
+ // Modified code from string_to_ObjectId ..
+ //
+
+ CORBA::ULong buffer_size = 4;
+
+ // Create the buffer for the Id
+ CORBA::Octet *buffer = PortableServer::ObjectId::allocbuf (buffer_size);
+
+ // Copy the contents
+ ACE_OS::memcpy (buffer, (char*)&id, buffer_size);
+
+ // @@ Pradeep: TAO guarantees that Long is 4 bytes wide, but the
+ // standard only guarantees that it is at least 4 bytes wide. You
+ // may want to think about that....
+
+ // Create and return a new ID
+ PortableServer::ObjectId *obj_id = 0;
+ ACE_NEW_THROW_EX (obj_id,
+ PortableServer::ObjectId (buffer_size,
+ buffer_size,
+ buffer,
+ 1),
+ CORBA::NO_MEMORY ());
+
+ return obj_id;
+}
+
+CORBA::Object_ptr
+TAO_Notify_POA_Helper::activate (PortableServer::Servant servant, CORBA::Long& id ACE_ENV_ARG_DECL)
+{
+ // Generate a new ID.
+ id = this->id_factory_.id ();
+
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG, "Activating object with id = %d in POA : %s\n", id, this->poa_->the_name ()));
+
+ // Convert CORBA::Long to ObjectId
+ PortableServer::ObjectId_var oid =
+ this->long_to_ObjectId (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ poa_->activate_object_with_id (oid.in (),
+ servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ return poa_->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Object_ptr
+TAO_Notify_POA_Helper::activate_with_id (PortableServer::Servant servant, CORBA::Long id ACE_ENV_ARG_DECL)
+{
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG, "Activating object with existing id = %d in POA : %s\n", id, this->poa_->the_name ()));
+ this->id_factory_.set_last_used (id);
+
+ // Convert CORBA::Long to ObjectId
+ PortableServer::ObjectId_var oid =
+ this->long_to_ObjectId (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ poa_->activate_object_with_id (oid.in (),
+ servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ return poa_->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_POA_Helper::deactivate (CORBA::Long id ACE_ENV_ARG_DECL) const
+{
+ // Convert CORBA::Long to ObjectId
+ PortableServer::ObjectId_var oid =
+ this->long_to_ObjectId (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa_->deactivate_object (oid.in () ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Object_ptr
+TAO_Notify_POA_Helper::id_to_reference (CORBA::Long id ACE_ENV_ARG_DECL) const
+{
+ // Convert CORBA::Long to ObjectId
+ PortableServer::ObjectId_var oid =
+ this->long_to_ObjectId (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ return poa_->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+PortableServer::ServantBase *
+TAO_Notify_POA_Helper::reference_to_servant (CORBA::Object_ptr ptr ACE_ENV_ARG_DECL) const
+{
+ return poa_->reference_to_servant (ptr ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Object_ptr
+TAO_Notify_POA_Helper::servant_to_reference (
+ PortableServer::ServantBase * servant ACE_ENV_ARG_DECL) const
+{
+ return poa_->servant_to_reference (servant ACE_ENV_ARG_PARAMETER);
+}
+
+
+void
+TAO_Notify_POA_Helper::destroy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ poa_->destroy (1,0 ACE_ENV_ARG_PARAMETER);
+ // The <wait_for_completion> flag = 0
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.h b/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.h
new file mode 100644
index 00000000000..57b4208324e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.h
@@ -0,0 +1,115 @@
+// -*- C++ -*-
+
+/**
+ * @file POA_Helper.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_POA_Helper_H
+#define TAO_Notify_POA_Helper_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/ID_Factory.h"
+
+#include "tao/PortableServer/PortableServer.h"
+
+#include "ace/Copy_Disabled.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_POA_Helper
+ *
+ * @brief POA Abstraction.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_POA_Helper : private ACE_Copy_Disabled
+{
+public:
+ /// Default Constructor
+ TAO_Notify_POA_Helper (void);
+
+ /// Create a new PortableServer::POA.
+ void init (PortableServer::POA_ptr parent_poa,
+ const char* poa_name
+ ACE_ENV_ARG_DECL);
+
+ /// Create a new PortableServer::POA. The name is chosen at random.
+ void init (PortableServer::POA_ptr parent_poa ACE_ENV_ARG_DECL);
+
+ /// Destructor
+ virtual ~TAO_Notify_POA_Helper ();
+
+ /// Get underlying POA
+ PortableServer::POA_ptr poa (void);
+
+ /// Destroy underlying POA.
+ void destroy (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Activate Object, the POA will assign an ID and return its value.
+ CORBA::Object_ptr activate (PortableServer::Servant servant,
+ CORBA::Long& id
+ ACE_ENV_ARG_DECL);
+
+ /// Activate Object, using existing ID
+ CORBA::Object_ptr activate_with_id (PortableServer::Servant servant, CORBA::Long id ACE_ENV_ARG_DECL);
+
+ /// Deactivate Object with ID
+ void deactivate (CORBA::Long id
+ ACE_ENV_ARG_DECL) const;
+
+ /// Convert ID to reference.
+ CORBA::Object_ptr id_to_reference (CORBA::Long id
+ ACE_ENV_ARG_DECL) const;
+
+ /// Convert reference to pointer to servant
+ PortableServer::ServantBase * reference_to_servant (CORBA::Object_ptr ptr
+ ACE_ENV_ARG_DECL) const;
+
+ CORBA::Object_ptr servant_to_reference (PortableServer::ServantBase * servant ACE_ENV_ARG_DECL) const;
+
+protected:
+ /// Set default POA policies.
+ virtual void set_policy (PortableServer::POA_ptr parent_poa,
+ CORBA::PolicyList &policy_list
+ ACE_ENV_ARG_DECL);
+
+ /// Apply the polices and create child POA.
+ void create_i (PortableServer::POA_ptr parent_poa,
+ const char* poa_name,
+ CORBA::PolicyList &policy_list ACE_ENV_ARG_DECL);
+
+ /// Generate a unique id for each POA created.
+ ACE_CString get_unique_id (void);
+
+ /// Convert id to ObjectID
+ PortableServer::ObjectId* long_to_ObjectId (CORBA::Long id
+ ACE_ENV_ARG_DECL) const;
+
+protected:
+ /// POA
+ PortableServer::POA_var poa_;
+
+ /// ID Factory for objects.
+ TAO_Notify_ID_Factory id_factory_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/POA_Helper.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_POA_Helper_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.inl b/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.inl
new file mode 100644
index 00000000000..dc559fb00c4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.inl
@@ -0,0 +1,13 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE PortableServer::POA_ptr
+TAO_Notify_POA_Helper::poa (void)
+{
+ return this->poa_.in ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Peer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Peer.cpp
new file mode 100644
index 00000000000..6caa4aa6552
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Peer.cpp
@@ -0,0 +1,125 @@
+// $Id$
+
+#include "orbsvcs/Notify/Peer.h"
+
+ACE_RCSID(Notify, TAO_Notify_Peer, "$Id$")
+
+#include "orbsvcs/Notify/Proxy.h"
+
+#include "tao/debug.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Peer::TAO_Notify_Peer (void)
+{
+}
+
+TAO_Notify_Peer::~TAO_Notify_Peer ()
+{
+}
+
+void
+TAO_Notify_Peer::qos_changed (const TAO_Notify_QoSProperties& /*qos_properties*/)
+{
+ // NOP.
+}
+
+void
+TAO_Notify_Peer::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ // NOP.
+}
+
+void
+TAO_Notify_Peer::handle_dispatch_exception (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Sever all association when a remote client misbehaves. Other strategies like reties are possible but not implemented.
+ this->proxy ()->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Peer::dispatch_updates (const TAO_Notify_EventTypeSeq & added, const TAO_Notify_EventTypeSeq & removed ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_EventTypeSeq subscribed_types ;
+ this->proxy ()->subscribed_types (subscribed_types ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TRY
+ {
+ CosNotification::EventTypeSeq cos_added;
+ CosNotification::EventTypeSeq cos_removed;
+
+ const TAO_Notify_EventType& special = TAO_Notify_EventType::special ();
+
+ // Don;t inform of types that we already know about.
+ // E.g. if we're subscribed for {A,B,C,F}
+ // and we receive an update with added list {A,B,G}
+ // then, we should only send {G} because peer already knows about {A, B}
+ // However if we're subscribed for everything, send all kinds of adds.
+
+ // Don;t inform of removed types that we don;t care about.
+ // e.g. if we're currently subscribed for {A,B,C,F}
+ // and we receive an update with removed list {A, B, D}
+ // then, we should only send {A,B} because the peer is not interested in D.
+ // However if we're subscribed for everything, send all kinds of removes.
+
+ TAO_Notify_EventTypeSeq added_result = added;
+ TAO_Notify_EventTypeSeq removed_result;
+
+ if (subscribed_types.find (special) != 0)
+ {
+ added_result.remove_seq (subscribed_types);
+ removed_result.intersection (subscribed_types, removed);
+ }
+ else
+ {
+ removed_result = removed;
+ }
+
+ added_result.populate_no_special (cos_added);
+ removed_result.populate_no_special (cos_removed);
+
+ if (cos_added.length () != 0 || cos_removed.length () != 0)
+ {
+ // Protect this object from being destroyed in this scope.
+ TAO_Notify_Proxy::Ptr proxy_guard(this->proxy ());
+
+ this->dispatch_updates_i (cos_added, cos_removed ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, not_exist)
+ {
+ this->handle_dispatch_exception (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::NO_IMPLEMENT, no_impl)
+ {
+ // The peer does not implement the offer/subscription_change method
+ // Do nothing. Later, perhaps set a flag that helps us decide if we should dispatch_updates_i.
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ this->handle_dispatch_exception (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Do nothing
+ }
+ ACE_ENDTRY;
+}
+
+CORBA::ULong
+TAO_Notify_Peer::_incr_refcnt (void)
+{
+ return this->proxy ()->_incr_refcnt ();
+}
+
+CORBA::ULong
+TAO_Notify_Peer::_decr_refcnt (void)
+{
+ return this->proxy ()->_decr_refcnt ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Peer.h b/TAO/orbsvcs/orbsvcs/Notify/Peer.h
new file mode 100644
index 00000000000..142ef4484cf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Peer.h
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+
+/**
+ * @file Peer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_PEER_H
+#define TAO_Notify_PEER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotificationC.h"
+#include "orbsvcs/Notify/EventTypeSeq.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Proxy;
+class TAO_Notify_QoSProperties;
+class TAO_Notify_Peer;
+
+/**
+ * @class TAO_Notify_Peer
+ *
+ * @brief Base class for Supplier and Consumer classes.
+ * This object delegates its reference count to its creator proxy object.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Peer
+{
+public:
+ typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_Peer > Ptr;
+ /// Constuctor
+ TAO_Notify_Peer (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Peer ();
+
+ /// This method sigantures deliberately match the RefCounting methods required for ESF Proxy
+ CORBA::ULong _incr_refcnt (void);
+ CORBA::ULong _decr_refcnt (void);
+
+ /// Shutdown the peer.
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Access Proxy.
+ virtual TAO_Notify_Proxy* proxy (void) = 0;
+
+ // Dispatch updates
+ virtual void dispatch_updates (const TAO_Notify_EventTypeSeq & added,
+ const TAO_Notify_EventTypeSeq & removed
+ ACE_ENV_ARG_DECL);
+
+ /// QoS changed notification from the Peer.
+ virtual void qos_changed (const TAO_Notify_QoSProperties& qos_properties);
+
+ /// Handle dispatch exceptions.
+ void handle_dispatch_exception (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Retrieve the ior of this peer
+ virtual ACE_CString get_ior (void) const = 0;
+
+protected:
+ /// Implementation of Peer specific dispatch_updates
+ virtual void dispatch_updates_i (const CosNotification::EventTypeSeq& added,
+ const CosNotification::EventTypeSeq& removed
+ ACE_ENV_ARG_DECL) = 0;
+
+private:
+ /// Release
+ virtual void release (void) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_PEER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.cpp b/TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.cpp
new file mode 100644
index 00000000000..18cda388126
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.cpp
@@ -0,0 +1,400 @@
+// $Id$
+
+#include "orbsvcs/Notify/Persistent_File_Allocator.h"
+
+#include "tao/debug.h"
+#include "ace/OS_NS_string.h"
+
+//#define DEBUG_LEVEL 9
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+
+Persistent_Callback::~Persistent_Callback()
+{
+}
+
+Persistent_Storage_Block::Persistent_Storage_Block(const size_t block_number,
+ const size_t block_size)
+ : block_number_(block_number)
+ , no_write_(false)
+ , sync_(false)
+ , block_size_(block_size)
+ , callback_(0)
+ , allocator_owns_(true)
+{
+ ACE_NEW(this->data_, unsigned char[this->block_size_]);
+ ACE_OS::memset(this->data_, 0, this->block_size_);
+
+}
+
+Persistent_Storage_Block::Persistent_Storage_Block(
+ const Persistent_Storage_Block& psb)
+ : block_number_(psb.block_number_)
+ , no_write_(psb.no_write_)
+ , sync_(psb.sync_)
+ , block_size_(psb.block_size_)
+ , callback_(psb.callback_)
+ , allocator_owns_(psb.allocator_owns_)
+{
+ ACE_NEW(this->data_, unsigned char[this->block_size_]);
+ ACE_OS::memcpy(this->data_, psb.data(), this->block_size_);
+}
+
+Persistent_Storage_Block::~Persistent_Storage_Block()
+{
+ delete [] this->data_;
+ this->data_ = 0;
+}
+
+void
+Persistent_Storage_Block::set_no_write()
+{
+ this->no_write_ = true;
+ this->reassign_data(0, true);
+}
+
+bool
+Persistent_Storage_Block::get_no_write()
+{
+ return this->no_write_;
+}
+
+void
+Persistent_Storage_Block::set_sync()
+{
+ this->sync_ = true;
+}
+
+bool
+Persistent_Storage_Block::get_sync() const
+{
+ return this->sync_;
+}
+
+size_t
+Persistent_Storage_Block::block_number() const
+{
+ return this->block_number_;
+}
+
+unsigned char*
+Persistent_Storage_Block::data() const
+{
+ return this->data_;
+}
+
+void
+Persistent_Storage_Block::reassign_data(unsigned char* newptr,
+ bool delete_old)
+{
+ if (delete_old)
+ {
+ delete [] this->data_;
+ }
+ this->data_ = newptr;
+}
+
+void
+Persistent_Storage_Block::set_callback(Persistent_Callback* callback)
+{
+ this->callback_ = callback;
+}
+
+Persistent_Callback*
+Persistent_Storage_Block::get_callback() const
+{
+ return this->callback_;
+}
+
+void
+Persistent_Storage_Block::set_allocator_owns(bool allocator_owns)
+{
+ this->allocator_owns_ = allocator_owns;
+}
+
+bool
+Persistent_Storage_Block::get_allocator_owns() const
+{
+ return this->allocator_owns_;
+}
+
+Persistent_File_Allocator::Persistent_File_Allocator()
+ : pstore_()
+ , terminate_thread_(false)
+ , thread_active_(false)
+ , wake_up_thread_(queue_lock_)
+{
+}
+
+Persistent_File_Allocator::~Persistent_File_Allocator()
+{
+ this->shutdown_thread();
+}
+
+bool
+Persistent_File_Allocator::open (const ACE_TCHAR* filename,
+ const size_t block_size)
+{
+ bool file_opened = this->pstore_.open(filename, block_size);
+ if (file_opened)
+ {
+ this->thread_active_ = true;
+ this->thread_manager_.spawn(this->thr_func, this);
+ }
+ return file_opened;
+}
+
+void
+Persistent_File_Allocator::shutdown()
+{
+ this->shutdown_thread();
+}
+
+Persistent_Storage_Block*
+Persistent_File_Allocator::allocate()
+{
+ Persistent_Storage_Block* result = 0;
+ size_t block_number = 0;
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+ if (!this->allocate_block(block_number))
+ {
+ //@@todo: this should never happen
+ // why not. What if the disk is full? Oh, I see we
+ // allocate non-existent blocks. FIX this
+ }
+ if (DEBUG_LEVEL > 0) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Persistent_File_Allocator::allocate: %d\n"),
+ static_cast<int> (block_number)
+ ));
+ result = this->allocate_at(block_number);
+ return result;
+}
+
+Persistent_Storage_Block*
+Persistent_File_Allocator::allocate_at(size_t block_number)
+{
+ Persistent_Storage_Block* result = 0;
+ this->used(block_number);
+ if (DEBUG_LEVEL > 0) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Persistent_File_Allocator::allocate at : %d\n"),
+ static_cast<int> (block_number)
+ ));
+ ACE_NEW_RETURN(result, Persistent_Storage_Block(
+ block_number,
+ this->block_size()),
+ 0);
+ return result;
+}
+
+Persistent_Storage_Block*
+Persistent_File_Allocator::allocate_nowrite()
+{
+ Persistent_Storage_Block* result = 0;
+ ACE_NEW_RETURN (result,
+ Persistent_Storage_Block (static_cast<size_t> (~0), 0),
+ 0);
+ result->set_no_write();
+
+ return result;
+}
+
+void
+Persistent_File_Allocator::used(size_t block_number)
+{
+ ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->free_blocks_lock_);
+ if (DEBUG_LEVEL > 0) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Persistent_File_Allocator::used: %d\n"),
+ static_cast<int> (block_number)
+ ));
+ ACE_ASSERT (!this->free_blocks_.is_set (block_number));
+ this->free_blocks_.set_bit(block_number, true);
+}
+
+void
+Persistent_File_Allocator::free(size_t block_number)
+{
+ if (DEBUG_LEVEL > 0) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Persistent_File_Allocator::free: %d\n"),
+ static_cast<int> (block_number)
+ ));
+ ACE_ASSERT (this->free_blocks_.is_set (block_number));
+ this->free_block(block_number);
+}
+
+size_t
+Persistent_File_Allocator::block_size() const
+{
+ return pstore_.block_size();
+}
+
+bool
+Persistent_File_Allocator::read(Persistent_Storage_Block* psb)
+{
+ bool result = this->thread_active_;
+ bool cached = false;
+ if (result)
+ {
+ Persistent_Storage_Block** psbtemp = 0;
+ {
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->queue_lock_, false);
+ size_t queue_size = this->block_queue_.size();
+ for (size_t idx = 0; !cached && (idx < queue_size); ++idx)
+ {
+ // We want to start at the end of the queue and work backwards...
+ size_t actual_block = (queue_size - idx) - 1;
+ if (0 == this->block_queue_.get(psbtemp, actual_block))
+ {
+ cached = ((*psbtemp)->block_number() == psb->block_number());
+ }
+ }
+ // this needs to be done in the guarded section
+ if (cached && (0 != psbtemp))
+ {
+ ACE_OS::memcpy(psb->data(), (*psbtemp)->data(), this->block_size());
+ }
+ }
+ if (!cached)
+ {
+ result = pstore_.read(psb->block_number(), psb->data());
+ }
+ }
+ return result;
+}
+
+bool
+Persistent_File_Allocator::write(Persistent_Storage_Block* psb)
+{
+ bool result = this->thread_active_;
+ if (result)
+ {
+ Persistent_Storage_Block* ourpsb = psb;
+ if (!psb->get_allocator_owns())
+ {
+ if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Copy PSB %d\n")
+ , static_cast<int> (psb->block_number ())
+ ));
+ ACE_NEW_RETURN(ourpsb, Persistent_Storage_Block(*psb), false);
+ ourpsb->set_allocator_owns(true);
+ }
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->queue_lock_, false);
+ if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Queueing PSB to write block %d\n")
+ , static_cast<int> (psb->block_number ())
+ ));
+ result = (0 == this->block_queue_.enqueue_tail(ourpsb));
+ this->wake_up_thread_.signal();
+ }
+ return result;
+}
+
+void
+Persistent_File_Allocator::free_block(const size_t block_number)
+{
+ ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->free_blocks_lock_);
+ ACE_ASSERT (this->free_blocks_.is_set (block_number));
+ this->free_blocks_.set_bit(block_number, false);
+}
+
+bool
+Persistent_File_Allocator::allocate_block(size_t& block_number)
+{
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->free_blocks_lock_, 0);
+ block_number = this->free_blocks_.find_first_bit(false);
+ return true;
+}
+
+ACE_THR_FUNC_RETURN
+Persistent_File_Allocator::thr_func(void * arg)
+{
+ Persistent_File_Allocator* pfa = static_cast<Persistent_File_Allocator*> (arg);
+ pfa->run();
+ return 0;
+}
+
+size_t
+Persistent_File_Allocator::file_size () const
+{
+ return this->pstore_.size ();
+}
+
+void
+Persistent_File_Allocator::shutdown_thread()
+{
+ if (this->thread_active_)
+ {
+ {
+ ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->queue_lock_);
+ this->terminate_thread_ = true;
+ this->wake_up_thread_.signal();
+ }
+ this->thread_manager_.close();
+ ACE_ASSERT (!this->terminate_thread_);
+ ACE_ASSERT (!this->thread_active_);
+ }
+}
+
+void
+Persistent_File_Allocator::run()
+{
+ // We need this because we could be working on writing data
+ // when a call to terminate comes in!
+ bool do_more_work = true;
+ while (do_more_work)
+ {
+ do_more_work = false;
+ Persistent_Storage_Block * blk = 0;
+ {
+ ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->queue_lock_);
+ while (this->block_queue_.is_empty() && !terminate_thread_)
+ {
+ this->wake_up_thread_.wait();
+ }
+ // Awkward interface to peek at head of unbounded queue
+ Persistent_Storage_Block ** pblk = 0;
+ if (0 == this->block_queue_.get(pblk))
+ {
+ do_more_work = true;
+ blk = *pblk;
+ }
+ }
+ if (0 != blk)
+ {
+ Persistent_Callback *callback = blk->get_callback();
+ if (!blk->get_no_write())
+ {
+ pstore_.write(blk->block_number(), blk->data(), blk->get_sync());
+ }
+ {
+ Persistent_Storage_Block * blk2 = 0;
+ ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->queue_lock_);
+ this->block_queue_.dequeue_head (blk2);
+ // if this triggers, someone pushed onto the head of the queue
+ // or removed the head from the queue without telling ME.
+ ACE_ASSERT (blk2 == blk);
+ }
+ // If we own the block, then delete it.
+ if (blk->get_allocator_owns())
+ {
+ delete blk;
+ blk = 0;
+ }
+ if (0 != callback)
+ {
+ callback->persist_complete();
+ }
+ }
+ }
+ this->terminate_thread_ = false;
+ this->thread_active_ = false;
+}
+
+} /* namespace TAO_Notify */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.h b/TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.h
new file mode 100644
index 00000000000..718be6e8f54
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Persistent_File_Allocator.h
@@ -0,0 +1,208 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Persistent_File_Allocator.h
+ *
+ * $Id$
+ *
+ * A Persistent_File_Allocator manages a free list and allocates and
+ * deallocates blocks from a Random_File. There should be only one
+ * Persistent_File_Allocator for each Random_File.
+ *
+ * @author Jonathan Pollack <pollack_j@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef PERSISTENT_FILE_ALLOCATOR_H
+#define PERSISTENT_FILE_ALLOCATOR_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/Notify/notify_serv_export.h"
+#include "orbsvcs/Notify/Random_File.h"
+#include "orbsvcs/Notify/Bit_Vector.h"
+#include "ace/Containers_T.h"
+#include "ace/Unbounded_Queue.h"
+#include "ace/Thread_Manager.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+
+/// \brief An interface to allow callbacks on completion of persistent storage
+/// requests.
+class TAO_Notify_Serv_Export Persistent_Callback
+{
+public:
+ virtual ~Persistent_Callback();
+ /// \brief Called by a Persistent_File_Allocator when a write request has
+ /// completed.
+ virtual void persist_complete() = 0;
+};
+
+/**
+ * \brief A class to represent a block on disk.
+ *
+ * Contains the raw data to be written on disk as well as
+ * positioning information, synchronization information, and a pointer
+ * to a callback.
+ */
+class TAO_Notify_Serv_Export Persistent_Storage_Block
+{
+public:
+ /// The constructor. Initializes the callback to NULL.
+ Persistent_Storage_Block(
+ const size_t block_number,
+ const size_t block_size);
+ /// The copy constructor. Makes a deep copy of the passed in PSB.
+ Persistent_Storage_Block(const Persistent_Storage_Block& psb);
+ /// The destructor.
+ ~Persistent_Storage_Block();
+
+ /// Set our block to not have any data at all - a no-op. This can be
+ /// used to implement a checkpoint in the write stream.
+ void set_no_write();
+ /// Find out whether we have data to be written.
+ bool get_no_write();
+
+ /// Set our block to be written as a near-atomic operation.
+ void set_sync();
+ /// Find out whether this block should be written near-atomically.
+ bool get_sync() const;
+
+ /// Find out our physical block number.
+ size_t block_number() const;
+
+ /// Return our data to the user.
+ unsigned char* data() const;
+ /// Set our data pointer, and optionally delete it.
+ void reassign_data(unsigned char* newptr, bool delete_old = false);
+
+ /// Return block number and relinquish ownership.
+ size_t detach ();
+
+ /// Set our callback.
+ void set_callback(Persistent_Callback* callback);
+ /// Get our callback.
+ Persistent_Callback* get_callback() const;
+
+ /// Set ownership of this PSB.
+ void set_allocator_owns(bool allocator_owns = true);
+ /// Get ownership status of this PSB.
+ bool get_allocator_owns() const;
+
+private:
+ /// Our raw data.
+ unsigned char* data_;
+ /// The block number corresponding to our data.
+ size_t block_number_;
+ /// Are we a no-op with just a callback?
+ bool no_write_;
+ /// Write in near-atomic fashion.
+ bool sync_;
+ /// The size of our block.
+ size_t block_size_;
+ /// Our optional callback function, to be used in such things as state
+ /// transitions.
+ Persistent_Callback* callback_;
+ /// Does the allocator obtain ownership of our block?
+ bool allocator_owns_;
+};
+
+/**
+ * \brief A class that manages the details of persistent storage.
+ *
+ * Maintains a free list, write queue, allocations of new
+ * blocks, reads, and writes. This class also manages a thread that performs
+ * background updating of a Random_File.
+ * @@todo this is too much for one class to do. It should be refactored.
+ * @@todo: we shouldn't arbitrarily use a thread.
+ */
+class TAO_Notify_Serv_Export Persistent_File_Allocator
+{
+public:
+ /// The constructor.
+ Persistent_File_Allocator();
+ /// The destructor.
+ ~Persistent_File_Allocator();
+
+ bool open (const ACE_TCHAR* filename,
+ const size_t block_size = 512);
+
+ /// \brief Wait for pending I/O and terminate our work thread.
+ void shutdown();
+
+ /// Allocate a new Persistent_Storage_Block and initialize it to an unused
+ /// block of storage.
+ Persistent_Storage_Block* allocate();
+
+ /// \brief Allocate a new Persistent_Storage_Block at a given address
+ Persistent_Storage_Block* allocate_at(size_t block_number);
+
+ /// \brief Allocate a PSB that is marked to not persist
+ Persistent_Storage_Block* allocate_nowrite();
+
+ /// \brief Mark a block as used, removing it from the free list.
+ void used(size_t block_number);
+
+ /// \brief Mark a block number as able to be used again.
+ void free(size_t block_number);
+
+ /// \brief Access block size.
+ size_t block_size() const;
+
+ /// \brief Read data into a PSB.
+ ///
+ /// Data will come either from the queue of blocks to be written, or
+ /// it will be read from the file if there are no queued write requests for
+ /// this block.
+ bool read(Persistent_Storage_Block* psb);
+
+ /// \brief Write this block to the file,
+ ///
+ /// Add the Persistent_Storage_Block to our write queue and let the
+ /// worker thread handle writing this to the Random_File.
+ bool write(Persistent_Storage_Block* psb);
+
+ /// for information (unit test) only.
+ size_t file_size () const;
+
+private:
+ /// Free a previously assigned block.
+ void free_block(const size_t block_number);
+ /// Find and allocate a free block.
+ bool allocate_block(size_t& block_number);
+
+ /// Used during thread startup to cast us back to ourselves and call the
+ /// run() method.
+ static ACE_THR_FUNC_RETURN thr_func(void * arg);
+ /// Wait for pending I/O to complete and shut our worker thread down safely.
+ void shutdown_thread();
+ /// The worker's execution thread.
+ void run();
+
+private:
+ ACE_Thread_Manager thread_manager_;
+ Random_File pstore_;
+ Bit_Vector free_blocks_;
+ ACE_Unbounded_Queue<Persistent_Storage_Block*> block_queue_;
+ ACE_SYNCH_MUTEX lock_;
+ ACE_SYNCH_MUTEX free_blocks_lock_;
+ ACE_SYNCH_MUTEX queue_lock_;
+ bool terminate_thread_;
+ bool thread_active_;
+ ACE_SYNCH_CONDITION wake_up_thread_;
+};
+
+} /* namespace TAO_Notify */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* PERSISTENT_FILE_ALLOCATOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp b/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp
new file mode 100644
index 00000000000..798f24fb7f1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp
@@ -0,0 +1,44 @@
+// $Id$
+
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/NotifyExtC.h"
+#include "tao/debug.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Properties.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Notify,
+ TAO_Notify_Properties,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Properties::TAO_Notify_Properties (void)
+ : factory_ (0)
+ , builder_ (0)
+ , asynch_updates_ (0)
+ , allow_reconnect_ (false)
+ , updates_ (1)
+{
+ // In case no conf. file is specified, the EC will default to reactive concurrency.
+ NotifyExt::ThreadPoolParams tp_params =
+ {NotifyExt::CLIENT_PROPAGATED,0, 0, 0, 0, 0, 0, 0,0};
+
+ this->ec_qos_.length (1);
+ this->ec_qos_[0].name = CORBA::string_dup (NotifyExt::ThreadPool);
+ this->ec_qos_[0].value <<= tp_params;
+
+ if (TAO_debug_level > 1)
+ ACE_DEBUG ((LM_DEBUG, "in TAO_Properties ctos %x\n", this));
+}
+
+TAO_Notify_Properties::~TAO_Notify_Properties ()
+{
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template class TAO_Singleton<TAO_Notify_Properties, ACE_Thread_Mutex> *TAO_Singleton<TAO_Notify_Properties, ACE_Thread_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Properties.h b/TAO/orbsvcs/orbsvcs/Notify/Properties.h
new file mode 100644
index 00000000000..7ab3ec74637
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Properties.h
@@ -0,0 +1,155 @@
+// -*- C++ -*-
+
+/**
+ * @file Properties.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_PROPERTIES_H
+#define TAO_Notify_PROPERTIES_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotificationC.h"
+
+#include "tao/PortableServer/PortableServer.h"
+
+#include "tao/TAO_Singleton.h"
+#include "tao/ORB.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Factory;
+class TAO_Notify_Builder;
+
+/**
+ * @class TAO_Notify_Properties
+ *
+ * @brief Global properties that strategize Notify's run-time behaviour.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Properties
+{
+public:
+ /// Constuctor
+ TAO_Notify_Properties (void);
+
+ /// Destructor
+ ~TAO_Notify_Properties ();
+
+ // = Property Accessors
+ TAO_Notify_Factory* factory (void);
+ void factory (TAO_Notify_Factory* factory);
+
+ TAO_Notify_Builder* builder (void);
+ void builder (TAO_Notify_Builder* builder);
+
+ CORBA::ORB_ptr orb (void);
+ void orb (CORBA::ORB_ptr orb);
+
+ PortableServer::POA_ptr default_poa (void);
+ void default_poa (PortableServer::POA_ptr default_poa);
+
+ CORBA::Boolean asynch_updates (void);
+ void asynch_updates (CORBA::Boolean asynch_updates);
+
+ bool allow_reconnect (void);
+ void allow_reconnect (bool b);
+
+ // Turn on/off update messages.
+ CORBA::Boolean updates (void);
+ void updates (CORBA::Boolean updates);
+
+ // The QoS Property that must be applied to each newly created Event Channel
+ const CosNotification::QoSProperties& default_event_channel_qos_properties (void);
+
+ // Set the default EC QoS Property.
+ void default_event_channel_qos_properties (const CosNotification::QoSProperties &ec_qos);
+
+ // The QoS Property that must be applied to each newly created Supplier Admin
+ const CosNotification::QoSProperties& default_supplier_admin_qos_properties (void);
+
+ // Set the default SA QoS Property.
+ void default_supplier_admin_qos_properties (const CosNotification::QoSProperties &sa_qos);
+
+ // The QoS Property that must be applied to each newly created Consumer Admin
+ const CosNotification::QoSProperties& default_consumer_admin_qos_properties (void);
+
+ // Set the default CA QoS Property.
+ void default_consumer_admin_qos_properties (const CosNotification::QoSProperties &ca_qos);
+
+ // The QoS Property that must be applied to each newly created Proxy Supplier
+ const CosNotification::QoSProperties& default_proxy_supplier_qos_properties (void);
+
+ // Set the default PS QoS Property.
+ void default_proxy_supplier_qos_properties (const CosNotification::QoSProperties &ps_qos);
+
+ // The QoS Property that must be applied to each newly created Proxy Consumer
+ const CosNotification::QoSProperties& default_proxy_consumer_qos_properties (void);
+
+ // Set the default PC QoS Property.
+ void default_proxy_consumer_qos_properties (const CosNotification::QoSProperties &pc_qos);
+
+protected:
+ /// Object Factory
+ TAO_Notify_Factory* factory_;
+
+ /// Object Builder
+ TAO_Notify_Builder* builder_;
+
+ /// ORB
+ CORBA::ORB_var orb_;
+
+ // POA
+ PortableServer::POA_var default_poa_;
+
+ /// True if send asynch updates.
+ CORBA::Boolean asynch_updates_;
+
+ /// True if clients can reconnect to proxies.
+ bool allow_reconnect_;
+
+ /// True if updates are enabled (default).
+ CORBA::Boolean updates_;
+
+ /// The Update period for updates.
+ ACE_Time_Value update_period_;
+
+ /// The default EC QoS Properties.
+ CosNotification::QoSProperties ec_qos_;
+
+ /// The default SA QoS Properties.
+ CosNotification::QoSProperties sa_qos_;
+
+ /// The default CA QoS Properties.
+ CosNotification::QoSProperties ca_qos_;
+
+ /// The default PS QoS Properties.
+ CosNotification::QoSProperties ps_qos_;
+
+ /// The default PC QoS Properties.
+ CosNotification::QoSProperties pc_qos_;
+};
+
+TAO_NOTIFY_SERV_SINGLETON_DECLARE (TAO_Singleton, TAO_Notify_Properties, TAO_SYNCH_MUTEX)
+
+typedef TAO_Singleton<TAO_Notify_Properties, TAO_SYNCH_MUTEX> TAO_Notify_PROPERTIES;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Properties.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_PROPERTIES_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Properties.inl b/TAO/orbsvcs/orbsvcs/Notify/Properties.inl
new file mode 100644
index 00000000000..c53e7087f8e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Properties.inl
@@ -0,0 +1,151 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE TAO_Notify_Factory*
+TAO_Notify_Properties::factory (void)
+{
+ return this->factory_;
+}
+
+ACE_INLINE void
+TAO_Notify_Properties::factory (TAO_Notify_Factory* factory)
+{
+ this->factory_ = factory;
+}
+
+ACE_INLINE TAO_Notify_Builder*
+TAO_Notify_Properties::builder (void)
+{
+ return this->builder_;
+}
+
+ACE_INLINE void
+TAO_Notify_Properties::builder (TAO_Notify_Builder* builder)
+{
+ this->builder_ = builder;
+}
+
+ACE_INLINE CORBA::ORB_ptr
+TAO_Notify_Properties::orb (void)
+{
+ return CORBA::ORB::_duplicate (orb_.in ());
+}
+
+ACE_INLINE void
+TAO_Notify_Properties::orb (CORBA::ORB_ptr orb)
+{
+ orb_ = CORBA::ORB::_duplicate (orb);
+}
+
+ACE_INLINE PortableServer::POA_ptr
+TAO_Notify_Properties::default_poa (void)
+{
+ return PortableServer::POA::_duplicate (this->default_poa_.in ());
+}
+
+ACE_INLINE void
+TAO_Notify_Properties::default_poa (PortableServer::POA_ptr default_poa)
+{
+ this->default_poa_ = PortableServer::POA::_duplicate (default_poa);
+}
+
+ACE_INLINE CORBA::Boolean
+TAO_Notify_Properties::asynch_updates (void)
+{
+ return this->asynch_updates_;
+}
+
+ACE_INLINE void
+TAO_Notify_Properties::asynch_updates (CORBA::Boolean asynch_updates)
+{
+ this->asynch_updates_ = asynch_updates;
+}
+
+ACE_INLINE bool
+TAO_Notify_Properties::allow_reconnect (void)
+{
+ return this->allow_reconnect_;
+}
+
+ACE_INLINE void
+TAO_Notify_Properties::allow_reconnect (bool b)
+{
+ this->allow_reconnect_ = b;
+}
+
+ACE_INLINE CORBA::Boolean
+TAO_Notify_Properties::updates (void)
+{
+ return this->updates_;
+}
+
+ACE_INLINE void
+TAO_Notify_Properties::updates (CORBA::Boolean updates)
+{
+ this->updates_ = updates;
+}
+
+ACE_INLINE const CosNotification::QoSProperties&
+TAO_Notify_Properties::default_event_channel_qos_properties (void)
+{
+ return this->ec_qos_;
+}
+
+ACE_INLINE void
+TAO_Notify_Properties::default_event_channel_qos_properties (const CosNotification::QoSProperties &ec_qos)
+{
+ this->ec_qos_ = ec_qos;
+}
+
+ACE_INLINE const CosNotification::QoSProperties&
+TAO_Notify_Properties::default_supplier_admin_qos_properties (void)
+{
+ return this->sa_qos_;
+}
+
+ACE_INLINE void
+TAO_Notify_Properties::default_supplier_admin_qos_properties (const CosNotification::QoSProperties &sa_qos)
+{
+ this->sa_qos_ = sa_qos;
+}
+
+ACE_INLINE const CosNotification::QoSProperties&
+TAO_Notify_Properties::default_consumer_admin_qos_properties (void)
+{
+ return this->ca_qos_;
+}
+
+ACE_INLINE void
+TAO_Notify_Properties::default_consumer_admin_qos_properties (const CosNotification::QoSProperties &ca_qos)
+{
+ this->ca_qos_ = ca_qos;
+}
+
+ACE_INLINE const CosNotification::QoSProperties&
+TAO_Notify_Properties::default_proxy_supplier_qos_properties (void)
+{
+ return this->ps_qos_;
+}
+
+ACE_INLINE void
+TAO_Notify_Properties::default_proxy_supplier_qos_properties (const CosNotification::QoSProperties &ps_qos)
+{
+ this->ps_qos_ = ps_qos;
+}
+
+ACE_INLINE const CosNotification::QoSProperties&
+TAO_Notify_Properties::default_proxy_consumer_qos_properties (void)
+{
+ return this->pc_qos_;
+}
+
+ACE_INLINE void
+TAO_Notify_Properties::default_proxy_consumer_qos_properties (const CosNotification::QoSProperties &pc_qos)
+{
+ this->pc_qos_ = pc_qos;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Property.h b/TAO/orbsvcs/orbsvcs/Notify/Property.h
new file mode 100644
index 00000000000..2d0ef880733
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Property.h
@@ -0,0 +1,49 @@
+/* -*- C++ -*- */
+/**
+ * @file Property.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_PROPERTY_H
+#define TAO_Notify_PROPERTY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/NotifyExtC.h"
+
+#include "tao/orbconf.h"
+#include "tao/TimeBaseC.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+template <class LOCK, class TYPE> class ACE_Atomic_Op;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class TYPE> class TAO_Notify_Property_T;
+template <class TYPE> class TAO_Notify_StructProperty_T;
+
+typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX,CORBA::Long> TAO_Notify_Atomic_Property_Long;
+typedef TAO_Notify_Property_T<CORBA::Long> TAO_Notify_Property_Long;
+typedef TAO_Notify_Property_T<CORBA::ULong> TAO_Notify_Property_ULong;
+typedef TAO_Notify_Property_T<CORBA::Short> TAO_Notify_Property_Short;
+typedef TAO_Notify_Property_T<TimeBase::TimeT> TAO_Notify_Property_Time;
+typedef TAO_Notify_StructProperty_T<NotifyExt::ThreadPoolParams> TAO_Notify_Property_ThreadPool;
+typedef TAO_Notify_StructProperty_T<NotifyExt::ThreadPoolLanesParams> TAO_Notify_Property_ThreadPoolLanes;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_PROPERTY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.cpp b/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.cpp
new file mode 100644
index 00000000000..bd8adc484f6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.cpp
@@ -0,0 +1,65 @@
+// $Id$
+
+#include "orbsvcs/Notify/PropertySeq.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/PropertySeq.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Notify, TAO_Notify_PropertySeq, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_PropertySeq::TAO_Notify_PropertySeq (void)
+{
+}
+
+TAO_Notify_PropertySeq::~TAO_Notify_PropertySeq ()
+{
+}
+
+int
+TAO_Notify_PropertySeq::init (const CosNotification::PropertySeq& prop_seq)
+{
+ ACE_CString name;
+
+ for (CORBA::ULong i = 0; i < prop_seq.length (); ++i)
+ {
+ name = prop_seq[i].name.in ();
+
+ if (this->property_map_.rebind (name, prop_seq[i].value) == -1)
+ return -1;
+ }
+ // Note call to rebind. This allows to call <init> to set updates.
+
+ return 0;
+}
+
+int
+TAO_Notify_PropertySeq::populate (CosNotification::PropertySeq_var& prop_seq) const
+{
+ PROPERTY_MAP::CONST_ITERATOR iterator (this->property_map_);
+
+ int index = prop_seq->length ();
+ prop_seq->length (static_cast<CORBA::ULong> (index + this->property_map_.current_size ()));
+
+ for (PROPERTY_MAP::ENTRY *entry = 0;
+ iterator.next (entry) != 0;
+ iterator.advance (), ++index)
+ {
+ (*prop_seq)[index].name = CORBA::string_dup (entry->ext_id_.c_str ());
+ (*prop_seq)[index].value = entry->int_id_;
+ }
+
+ return 0;
+}
+
+void
+TAO_Notify_PropertySeq::add(const ACE_CString& name, const CORBA::Any& val)
+{
+ int ret = this->property_map_.rebind (name, val);
+ ACE_ASSERT(ret >= 0);
+ ACE_UNUSED_ARG (ret); // because the assert disappears in release builds
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.h b/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.h
new file mode 100644
index 00000000000..315aac46a0b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.h
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+
+/**
+ * @file PropertySeq.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_PROPERTYSEQ_H
+#define TAO_Notify_PROPERTYSEQ_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotificationC.h"
+
+#include "ace/Hash_Map_Manager.h"
+#include "ace/SString.h"
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_PropertySeq
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_PropertySeq
+{
+public:
+ /// Constuctor
+ TAO_Notify_PropertySeq (void);
+
+ /// Destructor
+ ~TAO_Notify_PropertySeq ();
+
+ /// Return 0 on success, -1 on error.
+ int init (const CosNotification::PropertySeq& prop_seq);
+
+ /// Find the <value> for property <name>. Returns 0 on success.
+ int find (const char* name, CosNotification::PropertyValue& value) const;
+
+ /// Return -1 on error.
+ int populate (CosNotification::PropertySeq_var& prop_seq) const;
+
+ /// return the number of properties available as a sequence
+ size_t size() const;
+
+protected:
+ /// Add the value. Used by subclasses to initialize the property map from their
+ /// member variables.
+ void add(const ACE_CString& name, const CORBA::Any& val);
+
+protected:
+ /// Property Map.
+ typedef ACE_Hash_Map_Manager <ACE_CString, CosNotification::PropertyValue, ACE_SYNCH_NULL_MUTEX> PROPERTY_MAP;
+
+ PROPERTY_MAP property_map_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/PropertySeq.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_PROPERTYSEQ_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.inl b/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.inl
new file mode 100644
index 00000000000..043f28ab9b6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.inl
@@ -0,0 +1,22 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE int
+TAO_Notify_PropertySeq::find (const char* name,
+ CosNotification::PropertyValue& value) const
+{
+ ACE_CString str_name (name);
+ return this->property_map_.find (str_name, value);
+}
+
+ACE_INLINE
+size_t
+TAO_Notify_PropertySeq::size() const
+{
+ return this->property_map_.current_size();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.cpp b/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.cpp
new file mode 100644
index 00000000000..378ca42dc41
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.cpp
@@ -0,0 +1,47 @@
+// $Id$
+
+#include "orbsvcs/Notify/Property_Boolean.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Property_Boolean.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Notify, TAO_Notify_Property_Boolean, "$Id$")
+
+#include "orbsvcs/Notify/PropertySeq.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Property_Boolean::TAO_Notify_Property_Boolean (const char* name)
+ : name_ (name), valid_(0)
+{
+}
+
+TAO_Notify_Property_Boolean::TAO_Notify_Property_Boolean (const char* name, CORBA::Boolean initial)
+ :name_ (name), value_ (initial), valid_ (1)
+{
+}
+
+int
+TAO_Notify_Property_Boolean::set (const TAO_Notify_PropertySeq& property_seq)
+{
+ CosNotification::PropertyValue value;
+
+ if (property_seq.find (this->name_, value) == -1)
+ return -1;
+
+ value >>= CORBA::Any::to_boolean (this->value_);
+
+ return 0;
+}
+
+void
+TAO_Notify_Property_Boolean::get (CosNotification::PropertySeq& prop_seq)
+{
+ /// Make space
+ prop_seq.length (prop_seq.length () + 1);
+
+ prop_seq[prop_seq.length () - 1].value <<= CORBA::Any::from_boolean (this->value_);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.h b/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.h
new file mode 100644
index 00000000000..53c0f441de9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.h
@@ -0,0 +1,89 @@
+// -*- C++ -*-
+
+/**
+ * @file Property_Boolean.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_PROPERTY_BOOLEAN_H
+#define TAO_Notify_PROPERTY_BOOLEAN_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotificationC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_PropertySeq;
+
+/**
+ * @class TAO_Notify_Property_Boolean
+ *
+ * @brief Boolean Property.
+ *
+ */
+/*******************************************************************************/
+
+class TAO_Notify_Serv_Export TAO_Notify_Property_Boolean
+{
+public:
+ /// Constuctor
+ TAO_Notify_Property_Boolean (const char* name, CORBA::Boolean initial);
+
+ /// Constuctor
+ TAO_Notify_Property_Boolean (const char* name);
+
+ /// Assignment from TAO_Notify_Property_Boolean
+ TAO_Notify_Property_Boolean& operator= (const TAO_Notify_Property_Boolean& rhs);
+
+ /// Assignment from CORBA::Boolean
+ TAO_Notify_Property_Boolean& operator= (const CORBA::Boolean& rhs);
+
+ /// Equality comparison operator.
+ bool operator== (const CORBA::Boolean &rhs) const;
+
+ /// Inequality comparison operator.
+ bool operator!= (const CORBA::Boolean &rhs) const;
+
+ int set (const TAO_Notify_PropertySeq& property_seq);
+
+ void get (CosNotification::PropertySeq& prop_seq);
+
+ /// Return the name
+ const char * name (void) const;
+
+ /// Return the value.
+ CORBA::Boolean value (void) const;
+
+ /// Is the current value valid
+ CORBA::Boolean is_valid (void) const;
+
+protected:
+ /// The Property name.
+ const char* name_;
+
+ /// The value
+ CORBA::Boolean value_;
+
+ /// Is the value valid
+ CORBA::Boolean valid_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Property_Boolean.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_PROPERTY_BOOLEAN_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.inl b/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.inl
new file mode 100644
index 00000000000..bccd42bed59
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.inl
@@ -0,0 +1,62 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE TAO_Notify_Property_Boolean&
+TAO_Notify_Property_Boolean::operator= (const TAO_Notify_Property_Boolean& rhs)
+{
+ if (this == &rhs)
+ return *this;
+
+ if (rhs.is_valid ())
+ {
+ this->name_ = rhs.name_;
+ this->value_ = rhs.value_;
+ this->valid_ = rhs.valid_;
+ }
+
+ return *this;
+}
+
+ACE_INLINE TAO_Notify_Property_Boolean&
+TAO_Notify_Property_Boolean::operator= (const CORBA::Boolean& value)
+{
+ this->value_ = value;
+
+ return *this;
+}
+
+ACE_INLINE bool
+TAO_Notify_Property_Boolean::operator== (const CORBA::Boolean &rhs) const
+{
+ return (this->value_ == rhs);
+}
+
+ACE_INLINE bool
+TAO_Notify_Property_Boolean::operator!= (const CORBA::Boolean &rhs) const
+{
+ return (this->value_ != rhs);
+}
+
+ACE_INLINE
+const char *
+TAO_Notify_Property_Boolean::name (void) const
+{
+ return this->name_;
+}
+
+ACE_INLINE CORBA::Boolean
+TAO_Notify_Property_Boolean::value (void) const
+{
+ return this->value_;
+}
+
+ACE_INLINE CORBA::Boolean
+TAO_Notify_Property_Boolean::is_valid (void) const
+{
+ return this->valid_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Property_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Property_T.cpp
new file mode 100644
index 00000000000..75b5675e2d5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Property_T.cpp
@@ -0,0 +1,137 @@
+// $Id$
+
+#ifndef TAO_Notify_PROPERTY_T_CPP
+#define TAO_Notify_PROPERTY_T_CPP
+
+#include "orbsvcs/Notify/Property_T.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Property_T.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Notify,
+ TAO_Notify_Property_T,
+ "$Id$")
+
+#include "orbsvcs/Notify/PropertySeq.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/*****************************************************************************/
+
+template <class TYPE>
+TAO_Notify_PropertyBase_T<TYPE>::TAO_Notify_PropertyBase_T (const char* name)
+ : name_ (name), valid_(0)
+{
+}
+
+template <class TYPE>
+TAO_Notify_PropertyBase_T<TYPE>::TAO_Notify_PropertyBase_T (const char* name, const TYPE& initial)
+ : name_ (name), value_ (initial), valid_ (1)
+{
+}
+
+template <class TYPE>
+TAO_Notify_PropertyBase_T<TYPE>::TAO_Notify_PropertyBase_T (
+ const TAO_Notify_PropertyBase_T &rhs)
+ : name_ (rhs.name_),
+ value_ (rhs.value_),
+ valid_ (rhs.valid_)
+{
+
+}
+
+template <class TYPE>
+TAO_Notify_PropertyBase_T<TYPE>::~TAO_Notify_PropertyBase_T ()
+{
+}
+
+template <class TYPE> void
+TAO_Notify_PropertyBase_T<TYPE>::get (CosNotification::PropertySeq& prop_seq)
+{
+ /// Make space
+ prop_seq.length (prop_seq.length () + 1);
+
+ prop_seq[prop_seq.length () - 1].value <<= this->value_;
+}
+
+/*******************************************************************************/
+
+template <class TYPE>
+TAO_Notify_Property_T<TYPE>::TAO_Notify_Property_T (const char* name)
+ :TAO_Notify_PropertyBase_T <TYPE> (name)
+{
+}
+
+template <class TYPE>
+TAO_Notify_Property_T<TYPE>::TAO_Notify_Property_T (const char* name, const TYPE& initial)
+ :TAO_Notify_PropertyBase_T <TYPE> (name, initial)
+{
+}
+
+template <class TYPE> int
+TAO_Notify_Property_T<TYPE>::set (const TAO_Notify_PropertySeq& property_seq)
+{
+ CosNotification::PropertyValue value;
+
+ if (property_seq.find (this->name_, value) == 0 && (value >>= this->value_))
+ {
+ this->valid_ = 1;
+ return 0;
+ }
+
+ this->valid_ = 0;
+ return -1;
+}
+
+template <class TYPE> int
+TAO_Notify_Property_T<TYPE>::set(const CosNotification::PropertyValue &value)
+{
+ if (value >>= this->value_)
+ {
+ this->valid_ = 1;
+ return 0;
+ }
+
+ return -1;
+}
+
+/*******************************************************************************/
+
+template <class TYPE>
+TAO_Notify_StructProperty_T<TYPE>::TAO_Notify_StructProperty_T (const char* name)
+ :name_ (name), valid_(0)
+{
+}
+
+template <class TYPE>
+TAO_Notify_StructProperty_T<TYPE>::TAO_Notify_StructProperty_T (const char* name, const TYPE& initial)
+ :name_ (name), value_ (initial), valid_ (1)
+{
+}
+
+template <class TYPE> int
+TAO_Notify_StructProperty_T<TYPE>::set (
+ const TAO_Notify_PropertySeq& property_seq)
+{
+ CosNotification::PropertyValue value;
+
+ if (property_seq.find (this->name_, value) == 0)
+ {
+ TYPE* extract_type = 0;
+
+ if ((value >>= extract_type) && extract_type != 0) // make sure we get something valid.
+ {
+ this->value_ = *extract_type; // copy
+ this->valid_ = 1;
+ return 0;
+ }
+ }
+
+ this->valid_ = 0;
+ return -1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_Notify_PROPERTY_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Property_T.h b/TAO/orbsvcs/orbsvcs/Notify/Property_T.h
new file mode 100644
index 00000000000..39a79608659
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Property_T.h
@@ -0,0 +1,170 @@
+// -*- C++ -*-
+
+/**
+ * @file Property_T.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_PROPERTY_T_H
+#define TAO_Notify_PROPERTY_T_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/SString.h"
+
+#include "orbsvcs/CosNotificationC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_PropertySeq;
+
+/**
+ * @class TAO_Notify_PropertyBase_T
+ *
+ * @brief
+ *
+ */
+template <class TYPE>
+class TAO_Notify_PropertyBase_T
+{
+public:
+ /// Constuctor
+ TAO_Notify_PropertyBase_T (const char* name, const TYPE& initial);
+
+ /// Constuctor
+ TAO_Notify_PropertyBase_T (const char* name);
+
+ /// Copy Constuctor
+ TAO_Notify_PropertyBase_T (const TAO_Notify_PropertyBase_T &rhs);
+
+ /// Destructor
+ ~TAO_Notify_PropertyBase_T ();
+
+ /// Equality comparison operator.
+ bool operator== (const TYPE &rhs) const;
+
+ /// Inequality comparison operator.
+ bool operator!= (const TYPE &rhs) const;
+
+ /// Populate the Property Sequence with this valid value.
+ void get (CosNotification::PropertySeq& prop_seq);
+
+ // assign a new value
+ void assign (const TYPE& value);
+
+ /// Return the value.
+ const TYPE& value (void) const;
+
+ /// Return the name
+ const char * name (void) const;
+
+ /// Is the current value valid
+ CORBA::Boolean is_valid (void) const;
+
+ /// Invalidate this property's value.
+ void invalidate (void);
+
+protected:
+ /// The Property name.
+ const char* name_;
+
+ /// The value
+ TYPE value_;
+
+ /// Is the value valid
+ CORBA::Boolean valid_;
+};
+
+
+/*******************************************************************************/
+/**
+ * @class TAO_Notify_Property_T
+ *
+ * @brief
+ *
+ */
+template <class TYPE>
+class TAO_Notify_Property_T : public TAO_Notify_PropertyBase_T<TYPE>
+{
+public:
+ /// Constuctor
+ TAO_Notify_Property_T (const char* name, const TYPE& initial);
+
+ /// Constuctor
+ TAO_Notify_Property_T (const char* name);
+
+ /// Init this Property from the sequence.
+ /// Returns 0 on success, -1 on error
+ int set (const TAO_Notify_PropertySeq& property_seq);
+
+ /// Init this Property from the CosNotification::PropertyValue
+ /// Returns 0 on success, -1 on error
+ int set (const CosNotification::PropertyValue &value);
+};
+
+/*******************************************************************************/
+/**
+ * @class TAO_Notify_StructProperty_T
+ *
+ * @brief
+ *
+ */
+template <class TYPE>
+class TAO_Notify_StructProperty_T
+{
+public:
+ /// Constuctor
+ TAO_Notify_StructProperty_T (const char* name, const TYPE& initial);
+
+ /// Constuctor
+ TAO_Notify_StructProperty_T (const char* name);
+
+ /// Init this Property from the sequence.
+ /// Returns 0 on success, -1 on error
+ int set (const TAO_Notify_PropertySeq& property_seq);
+
+ /// Return the name
+ const char * name (void) const;
+
+ /// Return the value.
+ const TYPE& value (void) const;
+
+ /// Is the current value valid
+ CORBA::Boolean is_valid (void) const;
+
+protected:
+ /// The Property name.
+ const char* name_;
+
+ /// The value
+ TYPE value_;
+
+ /// Is the value valid
+ CORBA::Boolean valid_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Property_T.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Notify/Property_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Property_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_PROPERTY_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Property_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Property_T.inl
new file mode 100644
index 00000000000..7f66d30c0c0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Property_T.inl
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class TYPE> ACE_INLINE const TYPE&
+TAO_Notify_PropertyBase_T<TYPE>::value (void) const
+{
+ return this->value_;
+}
+
+template <class TYPE> ACE_INLINE
+const char *
+TAO_Notify_PropertyBase_T<TYPE>::name (void) const
+{
+ return this->name_;
+}
+
+template <class TYPE> ACE_INLINE CORBA::Boolean
+TAO_Notify_PropertyBase_T<TYPE>::is_valid (void) const
+{
+ return this->valid_;
+}
+
+template <class TYPE> ACE_INLINE bool
+TAO_Notify_PropertyBase_T<TYPE>::operator== (const TYPE &rhs) const
+{
+ return (this->value_ == rhs);
+}
+
+template <class TYPE> ACE_INLINE bool
+TAO_Notify_PropertyBase_T<TYPE>::operator!= (const TYPE &rhs) const
+{
+ return (this->value_ != rhs);
+}
+
+template <class TYPE> ACE_INLINE void
+TAO_Notify_PropertyBase_T<TYPE>:: invalidate (void)
+{
+ this->valid_ = 0;
+}
+
+template <class TYPE> ACE_INLINE
+void
+TAO_Notify_PropertyBase_T<TYPE>:: assign (const TYPE& value)
+{
+ this->value_ = value;
+ this->valid_ = 1;
+}
+
+
+
+/******************************************************************************/
+
+template <class TYPE> ACE_INLINE
+const char *
+TAO_Notify_StructProperty_T<TYPE>::name (void) const
+{
+ return this->name_;
+}
+
+template <class TYPE> ACE_INLINE const TYPE&
+TAO_Notify_StructProperty_T<TYPE>::value (void) const
+{
+ return this->value_;
+}
+
+
+
+template <class TYPE> ACE_INLINE CORBA::Boolean
+TAO_Notify_StructProperty_T<TYPE>::is_valid (void) const
+{
+ return this->valid_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Proxy.cpp b/TAO/orbsvcs/orbsvcs/Notify/Proxy.cpp
new file mode 100644
index 00000000000..a088943d05b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Proxy.cpp
@@ -0,0 +1,199 @@
+// $Id$
+
+#include "orbsvcs/Notify/Proxy.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Proxy.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Notify, TAO_Notify_Proxy, "$Id$")
+
+#include "orbsvcs/Notify/Peer.h"
+#include "orbsvcs/Notify/Proxy.h"
+#include "orbsvcs/Notify/Method_Request_Updates.h"
+#include "orbsvcs/Notify/Worker_Task.h"
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/POA_Helper.h"
+#include "orbsvcs/Notify/Topology_Saver.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Proxy::TAO_Notify_Proxy (void)
+ : updates_off_ (0)
+{
+}
+
+TAO_Notify_Proxy::~TAO_Notify_Proxy ()
+{
+}
+
+CORBA::Object_ptr
+TAO_Notify_Proxy::activate (PortableServer::Servant servant ACE_ENV_ARG_DECL)
+{
+ // Set the POA that we use to return our <ref>
+ this->set_primary_as_proxy_poa();
+ return TAO_Notify_Object::activate (servant ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Object_ptr
+TAO_Notify_Proxy::activate (PortableServer::Servant servant,
+ CORBA::Long id
+ ACE_ENV_ARG_DECL)
+{
+ // Set the POA that we use to return our <ref>
+ this->set_primary_as_proxy_poa();
+ return TAO_Notify_Object::activate (servant, id ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Proxy::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_ASSERT (this->proxy_poa() != 0 );
+ this->proxy_poa()->deactivate (this->id() ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Proxy::subscribed_types (TAO_Notify_EventTypeSeq& subscribed_types ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // copy
+ subscribed_types = this->subscribed_types_;
+}
+
+void
+TAO_Notify_Proxy::types_changed (const TAO_Notify_EventTypeSeq& added, const TAO_Notify_EventTypeSeq& removed ACE_ENV_ARG_DECL)
+{
+ // return if the updates for this proxy are turned off or
+ // if all the updates in the channel are switched off.
+ if (this->updates_off_ == 1 || TAO_Notify_PROPERTIES::instance()->updates () == 0)
+ return;
+
+ TAO_Notify_Method_Request_Updates_No_Copy request (added, removed, this);
+
+ if (TAO_Notify_PROPERTIES::instance()->asynch_updates () == 1) // if we should send the updates synchronously.
+ {
+ this->execute_task (request ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else // execute in the current thread context.
+ {
+ request.execute (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+CosNotification::EventTypeSeq*
+TAO_Notify_Proxy::obtain_types (CosNotifyChannelAdmin::ObtainInfoMode mode, const TAO_Notify_EventTypeSeq& types ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ CosNotification::EventTypeSeq_var event_type_seq;
+
+ ACE_NEW_THROW_EX (event_type_seq,
+ CosNotification::EventTypeSeq (),
+ CORBA::NO_MEMORY ());
+
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (event_type_seq._retn ());
+
+ if (mode == CosNotifyChannelAdmin::ALL_NOW_UPDATES_OFF ||
+ mode == CosNotifyChannelAdmin::ALL_NOW_UPDATES_ON)
+ {
+ types.populate (event_type_seq);
+ }
+
+ if (mode == CosNotifyChannelAdmin::NONE_NOW_UPDATES_ON ||
+ mode == CosNotifyChannelAdmin::ALL_NOW_UPDATES_ON)
+ {
+ this->updates_off_ = 0;
+ }
+ else
+ {
+ this->updates_off_ = 1;
+ }
+
+ return event_type_seq._retn ();
+}
+
+void
+TAO_Notify_Proxy::qos_changed (const TAO_Notify_QoSProperties& qos_properties)
+{
+ //Inform Peers of qos changes.
+ TAO_Notify_Peer* peer = this->peer ();
+
+ if (peer != 0)
+ peer->qos_changed (qos_properties);
+}
+
+void
+TAO_Notify_Proxy::save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL)
+{
+ bool changed = this->children_changed_;
+ this->children_changed_ = false;
+ this->self_changed_ = false;
+
+ if (is_persistent ())
+ {
+ TAO_Notify::NVPList attrs;
+ this->save_attrs(attrs);
+
+ const char * type_name = this->get_proxy_type_name ();
+ bool want_all_children = saver.begin_object(this->id(), type_name, attrs, changed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (want_all_children || this->filter_admin_.is_changed ())
+ {
+ this->filter_admin_.save_persistent(saver ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (want_all_children || this->subscribed_types_.is_changed ())
+ {
+ this->subscribed_types_.save_persistent(saver ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // todo: handle removed children
+
+ saver.end_object(this->id(), type_name ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+void
+TAO_Notify_Proxy::save_attrs (TAO_Notify::NVPList& attrs)
+{
+ TAO_Notify_Object::save_attrs(attrs);
+ TAO_Notify_Peer * peer = this->peer();
+ if (peer != 0)
+ {
+ attrs.push_back (TAO_Notify::NVP("PeerIOR", peer->get_ior()));
+ }
+}
+
+TAO_Notify::Topology_Object*
+TAO_Notify_Proxy::load_child (const ACE_CString &type, CORBA::Long id,
+ const TAO_Notify::NVPList& attrs ACE_ENV_ARG_DECL)
+{
+ ACE_UNUSED_ARG (id);
+ ACE_UNUSED_ARG (attrs);
+ TAO_Notify::Topology_Object* result = this;
+ if (type == "subscriptions")
+ {
+ // since we initialized our subscribed types to everything
+ // in the constructor. we have to clear it out first.
+ this->subscribed_types_.reset();
+ result = &this->subscribed_types_;
+ ACE_CHECK_RETURN(0);
+ }
+ else if (type == "filter_admin")
+ {
+ result = & this->filter_admin_;
+ }
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Proxy.h b/TAO/orbsvcs/orbsvcs/Notify/Proxy.h
new file mode 100644
index 00000000000..d6931ece562
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Proxy.h
@@ -0,0 +1,139 @@
+// -*- C++ -*-
+
+/**
+ * @file Proxy.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_PROXY_H
+#define TAO_Notify_PROXY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Topology_Object.h"
+#include "orbsvcs/Notify/EventTypeSeq.h"
+#include "orbsvcs/Notify/FilterAdmin.h"
+#include "orbsvcs/Notify/Admin.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Admin;
+class TAO_Notify_Peer;
+
+/**
+ * @class TAO_Notify_Proxy
+ *
+ * @brief Base class proxy for all proxys in NS.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Proxy
+ : public TAO_Notify::Topology_Parent
+{
+ friend class TAO_Notify_Peer;
+
+public:
+ typedef TAO_Notify_Refcountable_Guard_T<TAO_Notify_Proxy> Ptr;
+ typedef CosNotifyChannelAdmin::ProxyIDSeq SEQ;
+ typedef CosNotifyChannelAdmin::ProxyIDSeq_var SEQ_VAR;
+
+ /// Constuctor
+ TAO_Notify_Proxy (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Proxy ();
+
+ /// Activate
+ virtual CORBA::Object_ptr activate (PortableServer::Servant servant
+ ACE_ENV_ARG_DECL);
+
+ /// Activate with a given ID
+ virtual CORBA::Object_ptr activate (
+ PortableServer::Servant servant,
+ CORBA::Long id
+ ACE_ENV_ARG_DECL);
+
+ /// Deactivate
+ void deactivate (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Obtain the Proxy's subscribed types.
+ void subscribed_types (TAO_Notify_EventTypeSeq& subscribed_types
+ ACE_ENV_ARG_DECL);
+
+ /// Check if this event passes the admin and proxy filters.
+ CORBA::Boolean check_filters (
+ const TAO_Notify_Event* event,
+ TAO_Notify_FilterAdmin& parent_filter_admin,
+ CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator
+ ACE_ENV_ARG_DECL
+ );
+
+ /// Inform this proxy that the following types are being advertised.
+ void types_changed (const TAO_Notify_EventTypeSeq& added,
+ const TAO_Notify_EventTypeSeq& removed
+ ACE_ENV_ARG_DECL);
+
+ /// Have updates been turned off.
+ CORBA::Boolean updates_off (void);
+
+ /// Destroy this object.
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ /// Access our Peer.
+ virtual TAO_Notify_Peer* peer (void) = 0;
+
+ /// Implement the Obtain Types.
+ virtual CosNotification::EventTypeSeq* obtain_types (
+ CosNotifyChannelAdmin::ObtainInfoMode mode,
+ const TAO_Notify_EventTypeSeq& types
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Notification of subscriptions/offers set at the admin.
+ virtual void admin_types_changed (const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL) = 0;
+
+
+ /// Override, TAO_Notify_Object::qos_changed
+ virtual void qos_changed (const TAO_Notify_QoSProperties& qos_properties);
+
+ // TAO_Notify::Topology_Object
+
+ virtual void save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL);
+ virtual void save_attrs(TAO_Notify::NVPList& attrs);
+ virtual const char * get_proxy_type_name (void) const = 0;
+
+ virtual TAO_Notify::Topology_Object* load_child (const ACE_CString &type, CORBA::Long id,
+ const TAO_Notify::NVPList& attrs ACE_ENV_ARG_DECL);
+
+protected:
+
+ /// Filter Administration
+ TAO_Notify_FilterAdmin filter_admin_;
+
+ /// The types that we're subscribed with the event manager.
+ TAO_Notify_EventTypeSeq subscribed_types_;
+
+ /// True if updates have been turned off.
+ CORBA::Boolean updates_off_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Proxy.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_PROXY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Proxy.inl b/TAO/orbsvcs/orbsvcs/Notify/Proxy.inl
new file mode 100644
index 00000000000..6eff985b31e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Proxy.inl
@@ -0,0 +1,40 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE CORBA::Boolean
+TAO_Notify_Proxy::updates_off (void)
+{
+ return this->updates_off_;
+}
+
+ACE_INLINE CORBA::Boolean
+TAO_Notify_Proxy::check_filters (const TAO_Notify_Event* event
+ , TAO_Notify_FilterAdmin& parent_filter_admin
+ , CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator
+ ACE_ENV_ARG_DECL)
+{
+ // check if it passes the parent filter.
+ CORBA::Boolean parent_val =
+ parent_filter_admin.match (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::Boolean val = 0;
+
+ if (filter_operator == CosNotifyChannelAdmin::AND_OP)
+ {
+ val = parent_val && this->filter_admin_.match (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ else
+ {
+ val = parent_val || this->filter_admin_.match (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return val;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.cpp
new file mode 100644
index 00000000000..cd7587bfacd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.cpp
@@ -0,0 +1,204 @@
+// $Id$
+
+#include "orbsvcs/Notify/ProxyConsumer.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/ProxyConsumer.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Notify, TAO_Notify_ProxyConsumer, "$Id$")
+
+#include "tao/debug.h"
+#include "ace/Atomic_Op.h"
+#include "orbsvcs/Notify/Supplier.h"
+#include "orbsvcs/Notify/AdminProperties.h"
+#include "orbsvcs/Notify/Property.h"
+#include "orbsvcs/Notify/Proxy.h"
+#include "orbsvcs/Notify/Event_Manager.h"
+#include "orbsvcs/Notify/Method_Request_Lookup.h"
+#include "orbsvcs/Notify/Worker_Task.h"
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/SupplierAdmin.h"
+#include "orbsvcs/Notify/EventChannel.h"
+#include "orbsvcs/Notify/Routing_Slip.h"
+
+//#define DEBUG_LEVEL 10
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_ProxyConsumer::TAO_Notify_ProxyConsumer (void)
+ : supplier_admin_ (0)
+{
+}
+
+TAO_Notify_ProxyConsumer::~TAO_Notify_ProxyConsumer ()
+{
+}
+
+TAO_Notify_Peer*
+TAO_Notify_ProxyConsumer::peer (void)
+{
+ return this->supplier ();
+}
+
+void
+TAO_Notify_ProxyConsumer::init (TAO_Notify::Topology_Parent* topology_parent ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT( this->supplier_admin_.get() == 0 );
+
+ TAO_Notify_Proxy::initialize (topology_parent ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_admin_.reset (dynamic_cast<TAO_Notify_SupplierAdmin *>(topology_parent));
+ ACE_ASSERT (this->supplier_admin_.get() != 0);
+
+ const CosNotification::QoSProperties &default_ps_qos =
+ TAO_Notify_PROPERTIES::instance ()->default_proxy_consumer_qos_properties ();
+
+ this->set_qos (default_ps_qos ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_ProxyConsumer::connect (TAO_Notify_Supplier *supplier ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventChannelAdmin::AlreadyConnected
+ ))
+{
+ // Adopt the supplier
+ ACE_Auto_Ptr< TAO_Notify_Supplier > auto_supplier (supplier);
+
+ TAO_Notify_Atomic_Property_Long& supplier_count = this->admin_properties().suppliers ();
+ const TAO_Notify_Property_Long& max_suppliers = this->admin_properties().max_suppliers ();
+
+ if (max_suppliers != 0 && supplier_count >= max_suppliers.value ())
+ {
+ ACE_THROW (CORBA::IMP_LIMIT ()); // we've reached the limit of suppliers connected.
+ }
+
+ {
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // if supplier is set and reconnect not allowed we get out.
+ if (this->is_connected () && TAO_Notify_PROPERTIES::instance()->allow_reconnect() == false)
+ {
+ ACE_THROW (CosEventChannelAdmin::AlreadyConnected ());
+ }
+
+ // Adopt the supplier
+ this->supplier_ = auto_supplier;
+
+ this->supplier_admin_->subscribed_types (this->subscribed_types_ ACE_ENV_ARG_PARAMETER); // get the parents subscribed types.
+ ACE_CHECK;
+ }
+
+ // Inform QoS values.
+ ACE_ASSERT (this->supplier_.get() != 0);
+ this->supplier_->qos_changed (this->qos_properties_);
+
+ TAO_Notify_EventTypeSeq removed;
+
+ this->event_manager().offer_change (this, this->subscribed_types_, removed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->event_manager().connect (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Increment the global supplier count
+ ++supplier_count;
+}
+void
+TAO_Notify_ProxyConsumer::push_i (TAO_Notify_Event * event ACE_ENV_ARG_DECL)
+{
+ if (this->supports_reliable_events ())
+ {
+ TAO_Notify_Event::Ptr pevent(event->queueable_copy(ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+ TAO_Notify::Routing_Slip_Ptr routing_slip =
+ TAO_Notify::Routing_Slip::create (pevent ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT ("ProxyConsumer routing event.\n")));
+ routing_slip->route (this, true ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ routing_slip->wait_persist ();
+ }
+ else
+ {
+ TAO_Notify_Method_Request_Lookup_No_Copy request (event, this);
+ this->execute_task (request ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+bool
+TAO_Notify_ProxyConsumer::supports_reliable_events () const
+{
+ bool reliable = false;
+ CosNotification::PropertyValue value;
+ if (this->find_qos_property_value (CosNotification::EventReliability, value))
+ {
+ CORBA::Long setting;
+ if (value >>= setting)
+ {
+ reliable = (setting == CosNotification::Persistent);
+ }
+ }
+ return reliable;
+}
+
+void
+TAO_Notify_ProxyConsumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_EventTypeSeq added;
+
+ event_manager().offer_change (this, added, this->subscribed_types_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->event_manager().disconnect (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Decrement the global supplier count
+ this->admin_properties().suppliers ()--;
+}
+
+int
+TAO_Notify_ProxyConsumer::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->TAO_Notify_Object::shutdown (ACE_ENV_SINGLE_ARG_PARAMETER) == 1)
+ return 1;
+
+ ACE_CHECK_RETURN (1);
+
+ this->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+
+ if (this->supplier_.get() != 0)
+ {
+ this->supplier_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+ }
+ return 0;
+}
+
+void
+TAO_Notify_ProxyConsumer::destroy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int result = this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ if ( result == 1)
+ return;
+
+ this->supplier_admin_->remove (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Do not reset this->supplier_.
+ // It is not safe to delete the non-refcounted supplier here.
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.h
new file mode 100644
index 00000000000..17890c772f2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.h
@@ -0,0 +1,105 @@
+// -*- C++ -*-
+
+/**
+ * @file ProxyConsumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_PROXYCONSUMER_H
+#define TAO_Notify_PROXYCONSUMER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+#include "orbsvcs/Notify/Event.h"
+#include "orbsvcs/Notify/Proxy.h"
+#include "orbsvcs/Notify/SupplierAdmin.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosEventChannelAdminC.h"
+
+#include "ace/Auto_Ptr.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Supplier;
+
+/**
+ * @class TAO_Notify_ProxyConsumer
+ *
+ * @brief Base class for all types of ProxyConsumer implementations.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_ProxyConsumer
+ : public virtual TAO_Notify_Proxy
+{
+public:
+ typedef TAO_Notify_Refcountable_Guard_T<TAO_Notify_ProxyConsumer> Ptr;
+ /// Constuctor
+ TAO_Notify_ProxyConsumer (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_ProxyConsumer ();
+
+ /// init: overrides Topology_Object method
+ virtual void init (TAO_Notify::Topology_Parent * topology_parent ACE_ENV_ARG_DECL);
+
+ /// Connect
+ void connect (TAO_Notify_Supplier* supplier ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventChannelAdmin::AlreadyConnected
+ ));
+
+ /// Disconnect
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Shutdown (TAO_Notify_Container_T method)
+ virtual int shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Destroy this object.
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL);
+
+
+ /// Return 1 if connected
+ bool is_connected (void) const;
+
+ /// The SA parent.
+ TAO_Notify_SupplierAdmin& supplier_admin (void);
+
+protected:
+ /// Access the Supplier
+ TAO_Notify_Supplier* supplier (void);
+
+ /// Accept an event from the Supplier
+ void push_i (TAO_Notify_Event * event ACE_ENV_ARG_DECL);
+
+private:
+ /// Is this part of a reliable channel
+ bool supports_reliable_events () const;
+
+ ///= Data Members.
+ /// The SA parent.
+ TAO_Notify_SupplierAdmin::Ptr supplier_admin_;
+
+ /// The Supplier that we're connect to.
+ ACE_Auto_Ptr<TAO_Notify_Supplier> supplier_;
+
+ /// Access our Peer.
+ virtual TAO_Notify_Peer* peer (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/ProxyConsumer.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_PROXYCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.inl b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.inl
new file mode 100644
index 00000000000..b2b0c8bb5c8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.inl
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE bool
+TAO_Notify_ProxyConsumer::is_connected (void) const
+{
+ return (this->supplier_.get() != 0);
+}
+
+ACE_INLINE TAO_Notify_Supplier*
+TAO_Notify_ProxyConsumer::supplier (void)
+{
+ return this->supplier_.get();
+}
+
+ACE_INLINE TAO_Notify_SupplierAdmin&
+TAO_Notify_ProxyConsumer::supplier_admin (void)
+{
+ ACE_ASSERT( this->supplier_admin_.get() != 0 );
+ return *this->supplier_admin_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer_T.cpp
new file mode 100644
index 00000000000..a47122b58d5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer_T.cpp
@@ -0,0 +1,84 @@
+// $Id$
+
+#ifndef TAO_Notify_PROXYCONSUMER_T_CPP
+#define TAO_Notify_PROXYCONSUMER_T_CPP
+
+#include "orbsvcs/Notify/ProxyConsumer_T.h"
+#include "orbsvcs/Notify/SupplierAdmin.h"
+
+#include "orbsvcs/Notify/Event_Manager.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class SERVANT_TYPE>
+TAO_Notify_ProxyConsumer_T<SERVANT_TYPE>::TAO_Notify_ProxyConsumer_T (void)
+{
+}
+
+template <class SERVANT_TYPE>
+TAO_Notify_ProxyConsumer_T<SERVANT_TYPE>::~TAO_Notify_ProxyConsumer_T ()
+{
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_ProxyConsumer_T<SERVANT_TYPE>::admin_types_changed (const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL)
+{
+ this->offer_change (added, removed ACE_ENV_ARG_PARAMETER);
+}
+
+template <class SERVANT_TYPE> CosNotifyChannelAdmin::SupplierAdmin_ptr
+TAO_Notify_ProxyConsumer_T<SERVANT_TYPE>::MyAdmin (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ CosNotifyChannelAdmin::SupplierAdmin_var ret;
+
+ CORBA::Object_var object = this->supplier_admin().ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ret._retn ());
+
+ ret = CosNotifyChannelAdmin::SupplierAdmin::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+
+ return ret._retn ();
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_ProxyConsumer_T<SERVANT_TYPE>::offer_change (const CosNotification::EventTypeSeq & added, const CosNotification::EventTypeSeq & removed ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType
+ ))
+{
+ TAO_Notify_EventTypeSeq seq_added (added);
+ TAO_Notify_EventTypeSeq seq_removed (removed);
+
+ {
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ this->subscribed_types_.add_and_remove (seq_added, seq_removed);
+ }
+
+ this->event_manager().offer_change (this,
+ seq_added,
+ seq_removed
+ ACE_ENV_ARG_PARAMETER);
+}
+
+template <class SERVANT_TYPE> CosNotification::EventTypeSeq*
+TAO_Notify_ProxyConsumer_T<SERVANT_TYPE>::obtain_subscription_types (
+ CosNotifyChannelAdmin::ObtainInfoMode mode
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return
+ this->obtain_types (mode, this->event_manager().subscription_types ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_Notify_PROXYCONSUMER_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer_T.h b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer_T.h
new file mode 100644
index 00000000000..bcb0ada782b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer_T.h
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+/**
+ * @file ProxyConsumer_T.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_PROXYCONSUMER_T_H
+#define TAO_Notify_PROXYCONSUMER_T_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Proxy_T.h"
+#include "orbsvcs/Notify/ProxyConsumer.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_ProxyConsumer_T
+ *
+ * @brief
+ *
+ */
+template <class SERVANT_TYPE>
+class TAO_Notify_Serv_Export TAO_Notify_ProxyConsumer_T
+ : public virtual TAO_Notify_Proxy_T <SERVANT_TYPE>,
+ public virtual TAO_Notify_ProxyConsumer
+{
+public:
+ /// Constuctor
+ TAO_Notify_ProxyConsumer_T (void);
+
+ /// Destructor
+ ~TAO_Notify_ProxyConsumer_T ();
+
+ /// Notification of subscriptions set at the admin.
+ virtual void admin_types_changed (const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL);
+
+ virtual CosNotifyChannelAdmin::SupplierAdmin_ptr MyAdmin (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual CosNotification::EventTypeSeq * obtain_subscription_types (
+ CosNotifyChannelAdmin::ObtainInfoMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType
+ ));
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Notify/ProxyConsumer_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ProxyConsumer_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_PROXYCONSUMER_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp
new file mode 100644
index 00000000000..4d7a0c3023d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp
@@ -0,0 +1,166 @@
+// $Id$
+
+#include "orbsvcs/Notify/ProxySupplier.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/ProxySupplier.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Notify, TAO_Notify_ProxySupplier, "$Id$")
+
+#include "orbsvcs/Notify/Event_Manager.h"
+#include "orbsvcs/Notify/AdminProperties.h"
+#include "orbsvcs/Notify/Consumer.h"
+#include "orbsvcs/Notify/Method_Request_Dispatch.h"
+#include "orbsvcs/Notify/Worker_Task.h"
+#include "orbsvcs/Notify/Buffering_Strategy.h"
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/ConsumerAdmin.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_ProxySupplier::TAO_Notify_ProxySupplier (void)
+ : consumer_admin_ (0)
+{
+}
+
+TAO_Notify_ProxySupplier::~TAO_Notify_ProxySupplier ()
+{
+}
+
+void
+TAO_Notify_ProxySupplier::init (TAO_Notify_ConsumerAdmin* consumer_admin ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (consumer_admin != 0 && this->consumer_admin_.get() == 0);
+
+ TAO_Notify_Proxy::initialize (consumer_admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_admin_.reset (consumer_admin);
+
+ const CosNotification::QoSProperties &default_ps_qos =
+ TAO_Notify_PROPERTIES::instance ()->default_proxy_supplier_qos_properties ();
+
+ this->set_qos (default_ps_qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_Notify_Peer*
+TAO_Notify_ProxySupplier:: peer (void)
+{
+ return this->consumer ();
+}
+
+void
+TAO_Notify_ProxySupplier::connect (TAO_Notify_Consumer *consumer ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventChannelAdmin::AlreadyConnected
+ ))
+{
+ // Adopt the consumer
+ ACE_Auto_Ptr< TAO_Notify_Consumer > auto_consumer (consumer);
+
+ TAO_Notify_Atomic_Property_Long& consumer_count = this->admin_properties().consumers ();
+ const TAO_Notify_Property_Long& max_consumers = this->admin_properties().max_consumers ();
+
+ if (max_consumers != 0 && consumer_count >= max_consumers.value ())
+ {
+ ACE_THROW (CORBA::IMP_LIMIT ()); // we've reached the limit of consumers connected.
+ }
+
+ {
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // if consumer is set and reconnect not allowed we get out.
+ if (this->is_connected () && TAO_Notify_PROPERTIES::instance()->allow_reconnect() == false)
+ {
+ ACE_THROW (CosEventChannelAdmin::AlreadyConnected ());
+ }
+
+ // Adopt the consumer
+ this->consumer_ = auto_consumer;
+
+ this->consumer_admin_->subscribed_types (this->subscribed_types_ ACE_ENV_ARG_PARAMETER); // get the parents subscribed types.
+ ACE_CHECK;
+ }
+
+ // Inform QoS values.
+ ACE_ASSERT (this->consumer_.get() != 0);
+ this->consumer_->qos_changed (this->qos_properties_);
+
+ TAO_Notify_EventTypeSeq removed;
+
+ this->event_manager().subscription_change (this, this->subscribed_types_, removed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->event_manager().connect (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Increment the global consumer count
+ ++consumer_count;
+}
+
+void
+TAO_Notify_ProxySupplier::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_EventTypeSeq added;
+
+ this->event_manager().subscription_change (this, added, this->subscribed_types_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->event_manager().disconnect (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Decrement the global consumer count
+ this->admin_properties().consumers ()--;
+}
+
+int
+TAO_Notify_ProxySupplier::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->TAO_Notify_Object::shutdown (ACE_ENV_SINGLE_ARG_PARAMETER) == 1)
+ return 1;
+
+ ACE_CHECK_RETURN (1);
+
+ this->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+
+ if (this->consumer_.get() != 0)
+ {
+ this->consumer_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ return 0;
+}
+
+void
+TAO_Notify_ProxySupplier::destroy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int result = this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ if ( result == 1)
+ return;
+
+ this->consumer_admin_->remove (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Do not reset this->consumer_.
+ // It is not safe to delete the non-refcounted consumer here.
+}
+
+void
+TAO_Notify_ProxySupplier::deliver (TAO_Notify_Method_Request_Dispatch_No_Copy & request ACE_ENV_ARG_DECL)
+{
+ this->execute_task (request ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_ProxySupplier::qos_changed (const TAO_Notify_QoSProperties& qos_properties)
+{
+ TAO_Notify_Proxy::qos_changed (qos_properties);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h
new file mode 100644
index 00000000000..17ced483590
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h
@@ -0,0 +1,101 @@
+// -*- C++ -*-
+
+/**
+ * @file ProxySupplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_PROXYSUPPLIER_H
+#define TAO_Notify_PROXYSUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Event.h"
+#include "orbsvcs/Notify/Proxy.h"
+#include "orbsvcs/Notify/ConsumerAdmin.h"
+
+#include "orbsvcs/CosEventChannelAdminC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Consumer;
+class TAO_Notify_Method_Request_Dispatch_No_Copy;
+/**
+ * @class TAO_Notify_ProxySupplier
+ *
+ * @brief Base class for all the ProxySuppliers.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_ProxySupplier : public virtual TAO_Notify_Proxy
+{
+ friend class TAO_Notify_Consumer;
+
+public:
+ typedef TAO_Notify_Refcountable_Guard_T<TAO_Notify_ProxySupplier> Ptr;
+ /// Constuctor
+ TAO_Notify_ProxySupplier (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_ProxySupplier ();
+
+ /// Init
+ virtual void init (TAO_Notify_ConsumerAdmin* consumer_admin ACE_ENV_ARG_DECL);
+
+ /// Connect
+ void connect (TAO_Notify_Consumer* consumer ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventChannelAdmin::AlreadyConnected
+ ));
+ /// Disconnect
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Dispatch Event to consumer
+ virtual void deliver (TAO_Notify_Method_Request_Dispatch_No_Copy & request ACE_ENV_ARG_DECL);
+
+ /// Override TAO_Notify_Container_T::shutdown method
+ virtual int shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Destroy this object.
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Override, TAO_Notify_Proxy::qos_changed to apply MaxEventssPerConsumer QoS.
+ virtual void qos_changed (const TAO_Notify_QoSProperties& qos_properties);
+
+ /// Returns true if connected
+ bool is_connected (void) const;
+
+ /// Access the Consumer
+ TAO_Notify_Consumer* consumer (void);
+
+ /// The CA parent.
+ TAO_Notify_ConsumerAdmin& consumer_admin (void);
+
+private:
+ ///= Data Members.
+ /// The CA parent.
+ TAO_Notify_ConsumerAdmin::Ptr consumer_admin_;
+
+ /// The Consumer that we're connect to.
+ ACE_Auto_Ptr<TAO_Notify_Consumer> consumer_;
+
+ /// Access our Peer.
+ virtual TAO_Notify_Peer* peer (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/ProxySupplier.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_PROXYSUPPLIER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.inl b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.inl
new file mode 100644
index 00000000000..c7afa257d59
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.inl
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE bool
+TAO_Notify_ProxySupplier::is_connected (void) const
+{
+ return ( this->consumer_.get() != 0 );
+}
+
+ACE_INLINE TAO_Notify_Consumer*
+TAO_Notify_ProxySupplier::consumer (void)
+{
+ return this->consumer_.get();
+}
+
+ACE_INLINE TAO_Notify_ConsumerAdmin&
+TAO_Notify_ProxySupplier::consumer_admin (void)
+{
+ ACE_ASSERT( this->consumer_admin_.get() != 0 );
+ return *this->consumer_admin_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier_T.cpp
new file mode 100644
index 00000000000..622acba3277
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier_T.cpp
@@ -0,0 +1,227 @@
+// $Id$
+
+#ifndef TAO_Notify_PROXYSUPPLIER_T_CPP
+#define TAO_Notify_PROXYSUPPLIER_T_CPP
+
+#include "orbsvcs/Notify/ProxySupplier_T.h"
+
+#include "orbsvcs/Notify/Consumer.h"
+#include "orbsvcs/Notify/Structured/StructuredEvent.h"
+#include "orbsvcs/Notify/Any/AnyEvent.h"
+
+#include "orbsvcs/Notify/Method_Request_Dispatch.h"
+#include "orbsvcs/Notify/Worker_Task.h"
+#include "orbsvcs/Notify/Event_Manager.h"
+#include "orbsvcs/Notify/ConsumerAdmin.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class SERVANT_TYPE>
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::TAO_Notify_ProxySupplier_T (void)
+ : is_suspended_ (0)
+{
+}
+
+template <class SERVANT_TYPE>
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::~TAO_Notify_ProxySupplier_T ()
+{
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::admin_types_changed (const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL)
+{
+ this->subscription_change (added, removed ACE_ENV_ARG_PARAMETER);
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::forward_structured (const CosNotification::StructuredEvent& notification ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_StructuredEvent_No_Copy event (notification);
+
+ TAO_Notify_Method_Request_Dispatch_No_Copy request (&event, this, 1);
+
+ this->execute_task (request ACE_ENV_ARG_PARAMETER);
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::forward_structured_no_filtering (const CosNotification::StructuredEvent& notification ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_StructuredEvent_No_Copy event(notification);
+
+ TAO_Notify_Method_Request_Dispatch_No_Copy request (&event, this, 0);
+
+ this->execute_task (request ACE_ENV_ARG_PARAMETER);
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::forward_any (const CORBA::Any & any ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_AnyEvent_No_Copy event (any);
+
+ TAO_Notify_Method_Request_Dispatch_No_Copy request (&event, this, 1);
+
+ this->execute_task (request ACE_ENV_ARG_PARAMETER);
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::forward_any_no_filtering (const CORBA::Any& any ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_AnyEvent_No_Copy event(any);
+
+ TAO_Notify_Method_Request_Dispatch_No_Copy request (&event, this, 0);
+
+ this->execute_task (request ACE_ENV_ARG_PARAMETER);
+}
+
+template <class SERVANT_TYPE> CosNotification::EventTypeSeq*
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::obtain_offered_types (CosNotifyChannelAdmin::ObtainInfoMode mode ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->obtain_types (mode, this->event_manager().offered_types () ACE_ENV_ARG_PARAMETER);
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::subscription_change (const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyComm::InvalidEventType))
+{
+ TAO_Notify_EventTypeSeq seq_added (added);
+ TAO_Notify_EventTypeSeq seq_removed (removed);
+
+ {
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ this->subscribed_types_.add_and_remove (seq_added, seq_removed);
+ }
+
+ this->event_manager().subscription_change (this, seq_added, seq_removed ACE_ENV_ARG_PARAMETER);
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::suspend_connection (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyChannelAdmin::ConnectionAlreadyInactive,
+ CosNotifyChannelAdmin::NotConnected
+ ))
+{
+ {
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, CORBA::INTERNAL ());
+
+ if (this->is_connected () == 0)
+ ACE_THROW (CosNotifyChannelAdmin::NotConnected ());
+
+ if (this->consumer()->is_suspended () == 1)
+ ACE_THROW (CosNotifyChannelAdmin::ConnectionAlreadyInactive ());
+ }
+
+ this->consumer()->suspend (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::resume_connection (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyChannelAdmin::ConnectionAlreadyActive,
+ CosNotifyChannelAdmin::NotConnected
+ ))
+{
+ {
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, CORBA::INTERNAL ());
+
+ if (this->is_connected () == 0)
+ ACE_THROW (CosNotifyChannelAdmin::NotConnected ());
+
+ if (this->consumer()->is_suspended () == 0)
+ ACE_THROW (CosNotifyChannelAdmin::ConnectionAlreadyActive ());
+ }
+
+ this->consumer()->resume (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+template <class SERVANT_TYPE> CosNotifyChannelAdmin::ConsumerAdmin_ptr
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::MyAdmin (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ CosNotifyChannelAdmin::ConsumerAdmin_var ret;
+
+ CORBA::Object_var object = this->consumer_admin().ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (ret._retn ());
+
+ ret = CosNotifyChannelAdmin::ConsumerAdmin::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+
+ return ret._retn ();
+}
+
+/***************************** UNIMPLEMENTED METHODS***************************************/
+
+template <class SERVANT_TYPE> CosNotifyFilter::MappingFilter_ptr
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::priority_filter (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
+ CosNotifyFilter::MappingFilter::_nil ());
+
+ return CosNotifyFilter::MappingFilter::_nil ();
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::priority_filter (CosNotifyFilter::MappingFilter_ptr /*priority_filter*/ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+template <class SERVANT_TYPE> CosNotifyFilter::MappingFilter_ptr
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::lifetime_filter (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
+ CosNotifyFilter::MappingFilter::_nil ());
+
+ return CosNotifyFilter::MappingFilter::_nil ();
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_ProxySupplier_T<SERVANT_TYPE>::lifetime_filter (CosNotifyFilter::MappingFilter_ptr /*lifetime_filter*/ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* #define TAO_Notify_PROXYSUPPLIER_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier_T.h b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier_T.h
new file mode 100644
index 00000000000..f31cba76ee9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier_T.h
@@ -0,0 +1,161 @@
+// -*- C++ -*-
+
+/**
+ * @file ProxySupplier_T.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_PROXYSUPPLIER_T_H
+#define TAO_Notify_PROXYSUPPLIER_T_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Proxy_T.h"
+#include "orbsvcs/Notify/ProxySupplier.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_ProxySupplier_T
+ *
+ * @brief
+ *
+ */
+template <class SERVANT_TYPE>
+class TAO_Notify_ProxySupplier_T : public virtual TAO_Notify_Proxy_T <SERVANT_TYPE>, public virtual TAO_Notify_ProxySupplier
+{
+public:
+ /// Constuctor
+ TAO_Notify_ProxySupplier_T (void);
+
+ /// Destructor
+ ~TAO_Notify_ProxySupplier_T ();
+
+ /// Notification of subscriptions set at the admin.
+ virtual void admin_types_changed (const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL);
+
+ ///= POA_Notify_Internal methods
+ /// POA_Notify_Internal::Event_Forwarder method
+ virtual void forward_structured (const CosNotification::StructuredEvent & event ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// POA_Notify_Internal::Event_Forwarder method
+ virtual void forward_structured_no_filtering (const CosNotification::StructuredEvent & event ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// POA_Notify_Internal::Event_Forwarder method
+ virtual void forward_any (const CORBA::Any & event ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// POA_Notify_Internal::Event_Forwarder method
+ virtual void forward_any_no_filtering (const CORBA::Any & event ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+protected:
+ //= Data Members
+ CORBA::Boolean is_suspended_;
+
+ // = Interface methods
+ virtual CosNotifyChannelAdmin::ConsumerAdmin_ptr MyAdmin (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void suspend_connection (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyChannelAdmin::ConnectionAlreadyInactive,
+ CosNotifyChannelAdmin::NotConnected
+ ));
+
+ virtual void resume_connection (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyChannelAdmin::ConnectionAlreadyActive,
+ CosNotifyChannelAdmin::NotConnected
+ ));
+
+ virtual CosNotifyFilter::MappingFilter_ptr priority_filter (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void priority_filter (
+ CosNotifyFilter::MappingFilter_ptr priority_filter
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual CosNotifyFilter::MappingFilter_ptr lifetime_filter (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void lifetime_filter (
+ CosNotifyFilter::MappingFilter_ptr lifetime_filter
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual CosNotification::EventTypeSeq * obtain_offered_types (
+ CosNotifyChannelAdmin::ObtainInfoMode mode
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType
+ ));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Notify/ProxySupplier_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("ProxySupplier_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_PROXYSUPPLIER_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Proxy_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Proxy_T.cpp
new file mode 100644
index 00000000000..518db5e5c02
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Proxy_T.cpp
@@ -0,0 +1,165 @@
+// $Id$
+
+#include "orbsvcs/Notify/Proxy_T.h"
+
+#ifndef TAO_Notify_PROXY_T_CPP
+#define TAO_Notify_PROXY_T_CPP
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class SERVANT_TYPE>
+TAO_Notify_Proxy_T<SERVANT_TYPE>::TAO_Notify_Proxy_T (void)
+{
+ // Any object that is used by the POA gets a reference count of 1 at construction
+ this->_incr_refcnt();
+}
+
+template <class SERVANT_TYPE>
+TAO_Notify_Proxy_T<SERVANT_TYPE>::~TAO_Notify_Proxy_T ()
+{
+}
+
+template <class SERVANT_TYPE> PortableServer::Servant
+TAO_Notify_Proxy_T<SERVANT_TYPE>::servant (void)
+{
+ return this;
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_Proxy_T<SERVANT_TYPE>::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_incr_refcnt ();
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_Proxy_T<SERVANT_TYPE>::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_decr_refcnt ();
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_Proxy_T<SERVANT_TYPE>::validate_event_qos (const CosNotification::QoSProperties & /*required_qos*/, CosNotification::NamedPropertyRangeSeq_out /*available_qos*/ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotification::UnsupportedQoS
+ ))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+template <class SERVANT_TYPE> CosNotification::QoSProperties*
+TAO_Notify_Proxy_T<SERVANT_TYPE>::get_qos (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_RETURN (0);
+
+ return this->TAO_Notify_Object::get_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_Proxy_T<SERVANT_TYPE>::set_qos (const CosNotification::QoSProperties & qos ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotification::UnsupportedQoS
+ ))
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+
+ this->TAO_Notify_Object::set_qos (qos ACE_ENV_ARG_PARAMETER);
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_Proxy_T<SERVANT_TYPE>::validate_qos (
+ const CosNotification::QoSProperties & /*required_qos*/,
+ CosNotification::NamedPropertyRangeSeq_out /*available_qos*/
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotification::UnsupportedQoS
+ ))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+template <class SERVANT_TYPE> CosNotifyFilter::FilterID
+TAO_Notify_Proxy_T<SERVANT_TYPE>::add_filter (CosNotifyFilter::Filter_ptr new_filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ CosNotifyFilter::FilterID fid =
+ this->filter_admin_.add_filter (new_filter ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(fid);
+ return fid;
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_Proxy_T<SERVANT_TYPE>::remove_filter (
+ CosNotifyFilter::FilterID filter
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::FilterNotFound
+ ))
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+
+ this->filter_admin_.remove_filter (filter ACE_ENV_ARG_PARAMETER);
+}
+
+template <class SERVANT_TYPE> CosNotifyFilter::Filter_ptr
+TAO_Notify_Proxy_T<SERVANT_TYPE>::get_filter (CosNotifyFilter::FilterID filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::FilterNotFound
+ ))
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (CosNotifyFilter::Filter::_nil ());
+
+ return this->filter_admin_.get_filter (filter ACE_ENV_ARG_PARAMETER);
+}
+
+template <class SERVANT_TYPE> CosNotifyFilter::FilterIDSeq*
+TAO_Notify_Proxy_T<SERVANT_TYPE>::get_all_filters (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_RETURN (0);
+
+ return this->filter_admin_.get_all_filters (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+template <class SERVANT_TYPE> void
+TAO_Notify_Proxy_T<SERVANT_TYPE>::remove_all_filters (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+
+ this->filter_admin_.remove_all_filters (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_Notify_PROXY_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Proxy_T.h b/TAO/orbsvcs/orbsvcs/Notify/Proxy_T.h
new file mode 100644
index 00000000000..2cdc149f502
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Proxy_T.h
@@ -0,0 +1,161 @@
+// -*- C++ -*-
+
+/**
+ * @file Proxy_T.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_PROXY_T_H
+#define TAO_Notify_PROXY_T_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Proxy.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Proxy_T
+ *
+ * @brief The is a base class for all proxys , templatized by the servant
+ * type. All the Filter Admin and QoS Admin interface methods are
+ * implemented here by delegating to the admin implementations.
+ *
+ */
+template <class SERVANT_TYPE>
+class TAO_Notify_Proxy_T : public SERVANT_TYPE, public virtual TAO_Notify_Proxy
+{
+public:
+ /// Constuctor
+ TAO_Notify_Proxy_T (void);
+
+ /// Destructor
+ ~TAO_Notify_Proxy_T ();
+
+ /// Implements TAO_Notify_Object::servant method.
+ virtual PortableServer::Servant servant (void);
+
+ /// ServantBase refcount methods.
+ virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL);
+
+ virtual void validate_event_qos (
+ const CosNotification::QoSProperties & required_qos,
+ CosNotification::NamedPropertyRangeSeq_out available_qos
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotification::UnsupportedQoS
+ ));
+
+ virtual CosNotification::QoSProperties * get_qos (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void set_qos (
+ const CosNotification::QoSProperties & qos
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotification::UnsupportedQoS
+ ));
+
+ virtual void validate_qos (
+ const CosNotification::QoSProperties & required_qos,
+ CosNotification::NamedPropertyRangeSeq_out available_qos
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotification::UnsupportedQoS
+ ));
+
+ virtual CosNotifyFilter::FilterID add_filter (
+ CosNotifyFilter::Filter_ptr new_filter
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void remove_filter (
+ CosNotifyFilter::FilterID filter
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::FilterNotFound
+ ));
+
+ virtual CosNotifyFilter::Filter_ptr get_filter (
+ CosNotifyFilter::FilterID filter
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::FilterNotFound
+ ));
+
+ virtual CosNotifyFilter::FilterIDSeq * get_all_filters (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void remove_all_filters (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+};
+
+#if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT
+template class TAO_Notify_Serv_Export
+TAO_Notify_Proxy_T<POA_Event_Forwarder::StructuredProxyPushSupplier>;
+template class TAO_Notify_Serv_Export
+TAO_Notify_Proxy_T<POA_CosNotifyChannelAdmin::SequenceProxyPushSupplier>;
+template class TAO_Notify_Serv_Export
+TAO_Notify_Proxy_T<POA_Event_Forwarder::ProxyPushSupplier>;
+template class TAO_Notify_Serv_Export
+TAO_Notify_Proxy_T<POA_CosEventChannelAdmin::ProxyPushSupplier>;
+template class TAO_Notify_Serv_Export
+TAO_Notify_Proxy_T<POA_CosNotifyChannelAdmin::StructuredProxyPushConsumer>;
+template class TAO_Notify_Serv_Export
+TAO_Notify_Proxy_T<POA_CosNotifyChannelAdmin::SequenceProxyPushConsumer>;
+template class TAO_Notify_Serv_Export
+TAO_Notify_Proxy_T<POA_CosNotifyChannelAdmin::ProxyPushConsumer>;
+template class TAO_Notify_Serv_Export
+TAO_Notify_Proxy_T<POA_CosEventChannelAdmin::ProxyPushConsumer>;
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Notify/Proxy_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Proxy_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_PROXY_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/QoSProperties.cpp b/TAO/orbsvcs/orbsvcs/Notify/QoSProperties.cpp
new file mode 100644
index 00000000000..73d20823325
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/QoSProperties.cpp
@@ -0,0 +1,218 @@
+// $Id$
+
+#include "orbsvcs/Notify/QoSProperties.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/QoSProperties.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Notify, TAO_Notify_QoSProperties, "$Id$")
+
+#include "orbsvcs/Notify/Property.h"
+#include "orbsvcs/Notify/Notify_Extensions.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_QoSProperties::TAO_Notify_QoSProperties (void)
+ : event_reliability_(CosNotification::EventReliability)
+ , connection_reliability_(CosNotification::ConnectionReliability)
+ , priority_ (CosNotification::Priority)
+ , timeout_ (CosNotification::Timeout)
+ , stop_time_supported_ (CosNotification::StopTimeSupported)
+ , maximum_batch_size_ (CosNotification::MaximumBatchSize)
+ , pacing_interval_ (CosNotification::PacingInterval)
+ , max_events_per_consumer_ (CosNotification::MaxEventsPerConsumer)
+ , discard_policy_ (CosNotification::DiscardPolicy)
+ , order_policy_ (CosNotification::OrderPolicy)
+ , thread_pool_ (NotifyExt::ThreadPool)
+ , thread_pool_lane_ (NotifyExt::ThreadPoolLanes)
+ , blocking_policy_(TAO_Notify_Extensions::BlockingPolicy)
+{
+ unsupported_[0] = CosNotification::StartTimeSupported;
+}
+
+TAO_Notify_QoSProperties::~TAO_Notify_QoSProperties ()
+{
+}
+
+int
+TAO_Notify_QoSProperties::unsupported (ACE_CString& name)
+{
+ for (int i = 0; i < UNSUPPORTED_PROPERTY_COUNT; ++i)
+ {
+ if (this->unsupported_[i] == name)
+ return 1;
+ }
+
+ return 0;
+}
+void
+TAO_Notify_QoSProperties::init ()
+{
+ if (this->event_reliability_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= this->event_reliability_.value();
+ this->add(this->event_reliability_.name(), a);
+ }
+ if (this->connection_reliability_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= this->connection_reliability_.value();
+ this->add(this->connection_reliability_.name(), a);
+ }
+ if (this->priority_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= this->priority_.value();
+ this->add(this->priority_.name(), a);
+ }
+ if (this->timeout_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= this->timeout_.value();
+ this->add(this->timeout_.name(), a);
+ }
+ if (this->stop_time_supported_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= CORBA::Any::from_boolean (this->stop_time_supported_.value());
+ this->add(this->stop_time_supported_.name(), a);
+ }
+ if (this->maximum_batch_size_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= this->maximum_batch_size_.value();
+ this->add(this->maximum_batch_size_.name(), a);
+ }
+ if (this->pacing_interval_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= this->pacing_interval_.value();
+ this->add(this->pacing_interval_.name(), a);
+ }
+ if (this->max_events_per_consumer_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= this->max_events_per_consumer_.value();
+ this->add(this->max_events_per_consumer_.name(), a);
+ }
+ if (this->discard_policy_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= this->discard_policy_.value();
+ this->add(this->discard_policy_.name(), a);
+ }
+ if (this->order_policy_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= this->order_policy_.value();
+ this->add(this->order_policy_.name(), a);
+ }
+
+ if (this->thread_pool_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= this->thread_pool_.value();
+ this->add(this->thread_pool_.name(), a);
+ }
+ if (this->thread_pool_lane_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= this->thread_pool_lane_.value();
+ this->add(this->thread_pool_lane_.name(), a);
+ }
+ if (this->blocking_policy_.is_valid())
+ {
+ CORBA::Any a;
+ a <<= this->blocking_policy_.value();
+ this->add(this->blocking_policy_.name(), a);
+ }
+}
+
+int
+TAO_Notify_QoSProperties::init (const CosNotification::PropertySeq& prop_seq, CosNotification::PropertyErrorSeq& err_seq)
+{
+ int err_index = -1;
+
+ ACE_CString name;
+ for (CORBA::ULong i = 0; i < prop_seq.length (); ++i)
+ {
+ name = prop_seq[i].name.in();
+
+ if (this->unsupported (name))
+ {
+ err_index = err_seq.length ();
+ err_seq.length (err_seq.length () + 1);
+
+ err_seq[err_index].code = CosNotification::UNSUPPORTED_PROPERTY;
+ err_seq[err_index].name = CORBA::string_dup (prop_seq[i].name);
+ }
+ else if (this->property_map_.rebind (prop_seq[i].name.in (), prop_seq[i].value) == -1)
+ return -1;
+ // Note call to rebind. This allows to call <init> to set updates.
+ }
+
+ if (prop_seq.length () > 0)
+ {
+ this->event_reliability_.set (*this);
+ this->connection_reliability_.set (*this);
+ this->priority_.set (*this);
+ this->timeout_.set (*this);
+ this->stop_time_supported_.set (*this);
+ this->maximum_batch_size_.set (*this);
+ this->pacing_interval_.set (*this);
+ this->max_events_per_consumer_.set (*this);
+ this->discard_policy_.set (*this);
+ this->order_policy_.set (*this);
+
+ this->thread_pool_.set (*this);
+ this->thread_pool_lane_.set (*this);
+ this->blocking_policy_.set (*this);
+ }
+
+ return err_index == -1 ? 0 : 1;
+}
+
+int
+TAO_Notify_QoSProperties::copy (TAO_Notify_QoSProperties& qos_properties)
+{
+ qos_properties.event_reliability_ = this->event_reliability_;
+ qos_properties.connection_reliability_ = this->connection_reliability_;
+ qos_properties.priority_ = this->priority_;
+ qos_properties.timeout_ = this->timeout_;
+ qos_properties.stop_time_supported_ = this->stop_time_supported_;
+ qos_properties.maximum_batch_size_ = this->maximum_batch_size_;
+ qos_properties.pacing_interval_ = this->pacing_interval_;
+ qos_properties.max_events_per_consumer_ = this->max_events_per_consumer_;
+ qos_properties.discard_policy_ = this->discard_policy_;
+ qos_properties.order_policy_ = this->order_policy_;
+
+ qos_properties.blocking_policy_ = this->blocking_policy_;
+
+ PROPERTY_MAP::ITERATOR iter (this->property_map_);
+ PROPERTY_MAP::ENTRY *entry;
+
+ for (; iter.next (entry); iter.advance ())
+ {
+ if (qos_properties.property_map_.rebind (entry->ext_id_, entry->int_id_) == -1)
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+TAO_Notify_QoSProperties::transfer (TAO_Notify_QoSProperties& qos_properties)
+{
+ if (this->copy (qos_properties) == -1)
+ return -1;
+
+ // unbind the properties that we don't want to transfer.
+ qos_properties.property_map_.unbind (NotifyExt::ThreadPool);
+ qos_properties.property_map_.unbind (NotifyExt::ThreadPoolLanes);
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/QoSProperties.h b/TAO/orbsvcs/orbsvcs/Notify/QoSProperties.h
new file mode 100644
index 00000000000..6ce71f0941c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/QoSProperties.h
@@ -0,0 +1,120 @@
+// -*- C++ -*-
+
+/**
+ * @file QoSProperties.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_QOSPROPERTIES_H
+#define TAO_Notify_QOSPROPERTIES_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/PropertySeq.h"
+#include "orbsvcs/Notify/Property_T.h"
+#include "orbsvcs/Notify/Property_Boolean.h"
+#include "orbsvcs/Notify/Property.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_QoSProperties
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_QoSProperties : public TAO_Notify_PropertySeq
+{
+public:
+ /// Constuctor
+ TAO_Notify_QoSProperties (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_QoSProperties ();
+
+ /// Return 0 on success, 1 if unsupported properties were detected and -1 on error.
+ int init (const CosNotification::PropertySeq& prop_seq, CosNotification::PropertyErrorSeq& err_seq);
+
+ /// This version initializes the base from our members
+ void init ();
+
+ /// Populate <qos_properties> with all properties from this object. Returns -1 on error.
+ int copy (TAO_Notify_QoSProperties& qos_properties);
+
+ /// Populate <qos_properties> with properties that can be transfered.Returns -1 on error.
+ int transfer (TAO_Notify_QoSProperties& qos_properties);
+
+ ///= Accessors
+ const TAO_Notify_Property_ThreadPool& thread_pool (void) const;
+ const TAO_Notify_Property_ThreadPoolLanes& thread_pool_lane (void) const;
+
+ const TAO_Notify_Property_Short& event_reliability (void) const;
+ const TAO_Notify_Property_Short& connection_reliability (void) const;
+ const TAO_Notify_Property_Short& priority (void) const;
+ const TAO_Notify_Property_Time& timeout (void) const;
+ const TAO_Notify_Property_Boolean& stop_time_supported (void) const;
+ const TAO_Notify_Property_Long& maximum_batch_size (void) const;
+ const TAO_Notify_Property_Time& pacing_interval (void) const;
+ const TAO_Notify_Property_Long& max_events_per_consumer (void) const;
+ const TAO_Notify_Property_Short& discard_policy(void) const;
+ const TAO_Notify_Property_Short& order_policy(void) const;
+ const TAO_Notify_Property_Time& blocking_policy(void) const;
+
+ // The non-const accessors are used during topology load
+ TAO_Notify_Property_Short& event_reliability (void);
+ TAO_Notify_Property_Short& connection_reliability (void);
+ TAO_Notify_Property_Short& priority (void);
+ TAO_Notify_Property_Time& timeout (void);
+ TAO_Notify_Property_Boolean& stop_time_supported (void);
+ TAO_Notify_Property_Long& maximum_batch_size (void);
+ TAO_Notify_Property_Time& pacing_interval (void);
+ TAO_Notify_Property_Long& max_events_per_consumer (void);
+ TAO_Notify_Property_Short& discard_policy(void);
+ TAO_Notify_Property_Short& order_policy(void);
+ TAO_Notify_Property_Time& blocking_policy(void);
+
+protected:
+ /// Return 1 if <value> is unsupported.
+ int unsupported (ACE_CString& name);
+
+ enum {UNSUPPORTED_PROPERTY_COUNT = 1};
+
+ ///= Unsupported Properties.
+ ACE_CString unsupported_[UNSUPPORTED_PROPERTY_COUNT];
+
+ ///= Supported standard properties
+ TAO_Notify_Property_Short event_reliability_;
+ TAO_Notify_Property_Short connection_reliability_;
+ TAO_Notify_Property_Short priority_;
+ TAO_Notify_Property_Time timeout_;
+ TAO_Notify_Property_Boolean stop_time_supported_;
+ TAO_Notify_Property_Long maximum_batch_size_;
+ TAO_Notify_Property_Time pacing_interval_;
+ TAO_Notify_Property_Long max_events_per_consumer_;
+ TAO_Notify_Property_Short discard_policy_;
+ TAO_Notify_Property_Short order_policy_;
+
+ /// TAO Extensions
+ TAO_Notify_Property_ThreadPool thread_pool_;
+ TAO_Notify_Property_ThreadPoolLanes thread_pool_lane_;
+ TAO_Notify_Property_Time blocking_policy_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/QoSProperties.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_QOSPROPERTIES_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/QoSProperties.inl b/TAO/orbsvcs/orbsvcs/Notify/QoSProperties.inl
new file mode 100644
index 00000000000..6cf7f8f44fa
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/QoSProperties.inl
@@ -0,0 +1,163 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+const TAO_Notify_Property_Short&
+TAO_Notify_QoSProperties::event_reliability(void) const
+{
+ return this->event_reliability_;
+}
+
+ACE_INLINE
+const TAO_Notify_Property_Short&
+TAO_Notify_QoSProperties::connection_reliability(void) const
+{
+ return this->connection_reliability_;
+}
+
+ACE_INLINE
+const TAO_Notify_Property_Short&
+TAO_Notify_QoSProperties::priority(void) const
+{
+ return this->priority_;
+}
+
+ACE_INLINE
+const TAO_Notify_Property_Time&
+TAO_Notify_QoSProperties::timeout(void) const
+{
+ return this->timeout_;
+}
+
+ACE_INLINE
+const TAO_Notify_Property_Boolean&
+TAO_Notify_QoSProperties::stop_time_supported(void) const
+{
+ return this->stop_time_supported_;
+}
+
+ACE_INLINE const TAO_Notify_Property_Long&
+TAO_Notify_QoSProperties::maximum_batch_size (void) const
+{
+ return this->maximum_batch_size_;
+}
+
+ACE_INLINE const TAO_Notify_Property_Time&
+TAO_Notify_QoSProperties::pacing_interval (void) const
+{
+ return this->pacing_interval_;
+}
+
+ACE_INLINE
+const TAO_Notify_Property_Long&
+TAO_Notify_QoSProperties::max_events_per_consumer (void) const
+{
+ return this->max_events_per_consumer_;
+}
+
+ACE_INLINE
+const TAO_Notify_Property_Short&
+TAO_Notify_QoSProperties::discard_policy(void) const
+{
+ return this->discard_policy_;
+}
+
+ACE_INLINE
+const TAO_Notify_Property_Short&
+TAO_Notify_QoSProperties::order_policy(void) const
+{
+ return this->order_policy_;
+}
+
+ACE_INLINE const TAO_Notify_Property_ThreadPool&
+TAO_Notify_QoSProperties::thread_pool (void) const
+{
+ return this->thread_pool_;
+}
+
+ACE_INLINE const TAO_Notify_Property_ThreadPoolLanes&
+TAO_Notify_QoSProperties::thread_pool_lane (void) const
+{
+ return this->thread_pool_lane_;
+}
+
+ACE_INLINE
+const TAO_Notify_Property_Time&
+TAO_Notify_QoSProperties::blocking_policy(void) const
+{
+ return this->blocking_policy_;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+ACE_INLINE
+TAO_Notify_Property_Short&
+TAO_Notify_QoSProperties::event_reliability(void)
+{
+ return this->event_reliability_;
+}
+
+ACE_INLINE
+TAO_Notify_Property_Short&
+TAO_Notify_QoSProperties::connection_reliability(void)
+{
+ return this->connection_reliability_;
+}
+
+ACE_INLINE
+TAO_Notify_Property_Short&
+TAO_Notify_QoSProperties::priority(void)
+{
+ return this->priority_;
+}
+
+ACE_INLINE
+TAO_Notify_Property_Time&
+TAO_Notify_QoSProperties::timeout(void)
+{
+ return this->timeout_;
+}
+
+ACE_INLINE
+TAO_Notify_Property_Boolean&
+TAO_Notify_QoSProperties::stop_time_supported(void)
+{
+ return this->stop_time_supported_;
+}
+
+ACE_INLINE TAO_Notify_Property_Long&
+TAO_Notify_QoSProperties::maximum_batch_size (void)
+{
+ return this->maximum_batch_size_;
+}
+
+ACE_INLINE TAO_Notify_Property_Time&
+TAO_Notify_QoSProperties::pacing_interval (void)
+{
+ return this->pacing_interval_;
+}
+ACE_INLINE
+TAO_Notify_Property_Long&
+TAO_Notify_QoSProperties::max_events_per_consumer (void)
+{
+ return this->max_events_per_consumer_;
+}
+
+ACE_INLINE
+TAO_Notify_Property_Short&
+TAO_Notify_QoSProperties::discard_policy(void)
+{
+ return this->discard_policy_;
+}
+
+ACE_INLINE
+TAO_Notify_Property_Short&
+TAO_Notify_QoSProperties::order_policy(void)
+{
+ return this->order_policy_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/README b/TAO/orbsvcs/orbsvcs/Notify/README
new file mode 100644
index 00000000000..c30991c4c95
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/README
@@ -0,0 +1,51 @@
+README,v 1.5 2000/12/07 05:56:27 pradeep Exp
+
+README for the Notification Service
+-----------------------------------
+
+Implementation notes
+--------------------
+
+Here is a brief description of the MT options for the Notify Service.
+The motivation for adding these "knobs" is give the user a chance to
+fine tune his/her thread requirements in the Service at its
+bottlenecks. These bottlenecks are at filter evaluation and in the two
+way push to consumers. These are the points at which the Event Channel
+has to interact with remote objects whose implementation is unknown to
+the Event Channel. e.g. if a consumer decided to execute a tight loop
+in its push method, it would block the entire event channel if it was
+single threaded. By deploying a thread pool to perform dispatching
+events to consumers - we can alleviate this problem.
+
+[Also read the $TAO_ROOT/orbsvcs/Notify_Service/README for a proper
+description of how to specify these parameters.]
+
+-DispatchingThreads
+Consider a Notify service running with just one thread, namely the main.
+In this case when the event channel dispatches an event to a consumer (by
+calling its push method) all other consumers will be blocked, waiting for
+their push methods to be invoked. To decouple the consumers from one
+another we can deploy dispatching threads using this option.
+
+
+-SourceThreads
+Deploys a thread pool after event receipt from the supplier. All subsequent
+notification channel processing can happen on this thread and the original
+publishing push() can be ended. Separates server side processing of the
+event from the supplier's publication.
+
+
+Usage:
+-----
+Use the $TAO_ROOT/orbsvcs/Notify_Service to register a ChannelFactory with the
+Naming Service.See the README for more details.
+
+Examples:
+--------
+The $TAO_ROOT/orbsvcs/examples/Notify/Filter example shows how to using
+filtering.
+
+The $TAO_ROOT/orbsvcs/examples/Notify/Subscribe example shows how consumers
+can subscribe only to the required event types.
+
+send comments/suggestions to Pradeep Gore <pradeep@cs.wustl.edu>
diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_Builder.cpp b/TAO/orbsvcs/orbsvcs/Notify/RT_Builder.cpp
new file mode 100644
index 00000000000..98b297f069a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/RT_Builder.cpp
@@ -0,0 +1,73 @@
+// $Id$
+
+#include "orbsvcs/Notify/RT_Builder.h"
+
+#include "ace/Auto_Ptr.h"
+#include "ace/Dynamic_Service.h"
+#include "orbsvcs/Notify/ETCL_FilterFactory.h"
+#include "orbsvcs/Notify/RT_POA_Helper.h"
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/NotifyExtC.h"
+#include "orbsvcs/Notify/Object.h"
+
+ACE_RCSID (RT_Notify,
+ TAO_Notify_RT_Builder,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_RT_Builder::TAO_Notify_RT_Builder (void)
+{
+}
+
+TAO_Notify_RT_Builder::~TAO_Notify_RT_Builder ()
+{
+}
+
+void
+TAO_Notify_RT_Builder::apply_thread_pool_concurrency (TAO_Notify_Object& object
+ , const NotifyExt::ThreadPoolParams& tp_params ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_RT_POA_Helper* proxy_poa = 0;
+
+ // Bootstrap EC Proxy POA
+ ACE_NEW_THROW_EX (proxy_poa,
+ TAO_Notify_RT_POA_Helper (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ ACE_Auto_Ptr<TAO_Notify_POA_Helper> auto_proxy_poa (proxy_poa);
+
+ PortableServer::POA_var default_poa = TAO_Notify_PROPERTIES::instance ()->default_poa ();
+
+ proxy_poa->init (default_poa.in (), tp_params ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Give ownership of proxy_poa
+ object.set_proxy_poa (auto_proxy_poa.release ());
+}
+
+void
+TAO_Notify_RT_Builder::apply_lane_concurrency (TAO_Notify_Object& object
+ , const NotifyExt::ThreadPoolLanesParams& tpl_params ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_RT_POA_Helper* proxy_poa = 0;
+
+ // Bootstrap EC Proxy POA
+ ACE_NEW_THROW_EX (proxy_poa,
+ TAO_Notify_RT_POA_Helper (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ ACE_Auto_Ptr<TAO_Notify_POA_Helper> auto_proxy_poa (proxy_poa);
+
+ PortableServer::POA_var default_poa = TAO_Notify_PROPERTIES::instance ()->default_poa ();
+
+ proxy_poa->init (default_poa.in (), tpl_params ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Give ownership of proxy_poa
+ object.set_proxy_poa (auto_proxy_poa.release ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_Builder.h b/TAO/orbsvcs/orbsvcs/Notify/RT_Builder.h
new file mode 100644
index 00000000000..6e0b2bba087
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/RT_Builder.h
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+
+/**
+ * @file RT_Builder.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_RT_BUILDER_H
+#define TAO_Notify_RT_BUILDER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/rt_notify_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Builder.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_RT_Builder
+ *
+ * @brief Builder for RT specific classes.
+ *
+ */
+class TAO_RT_Notify_Export TAO_Notify_RT_Builder : public TAO_Notify_Builder
+{
+public:
+ /// Constuctor
+ TAO_Notify_RT_Builder (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_RT_Builder ();
+
+ /// Apply Thread Pools.
+ virtual void apply_thread_pool_concurrency (TAO_Notify_Object& object, const NotifyExt::ThreadPoolParams& tp_params ACE_ENV_ARG_DECL);
+
+ /// Apply Thread Pools with Lanes.
+ virtual void apply_lane_concurrency (TAO_Notify_Object& object, const NotifyExt::ThreadPoolLanesParams& tpl_params ACE_ENV_ARG_DECL);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_RT_BUILDER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_Factory.cpp b/TAO/orbsvcs/orbsvcs/Notify/RT_Factory.cpp
new file mode 100644
index 00000000000..af5484fed61
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/RT_Factory.cpp
@@ -0,0 +1,131 @@
+// $Id$
+
+#include "orbsvcs/Notify/RT_Factory.h"
+#include "orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.h"
+
+ACE_RCSID(RT_Notify, TAO_Notify_RT_Factory, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_RT_Factory::TAO_Notify_RT_Factory (void)
+{
+}
+
+TAO_Notify_RT_Factory::~TAO_Notify_RT_Factory ()
+{
+}
+
+void
+TAO_Notify_RT_Factory::create (TAO_Notify_StructuredProxyPushSupplier*& proxy ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (proxy,
+ TAO_Notify_RT_StructuredProxyPushSupplier (),
+ CORBA::NO_MEMORY ());
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_ProxySupplier_Collection*& collection ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (collection ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_ProxyConsumer_Collection*& collection ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (collection ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_EventChannel_Collection*& collection ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (collection ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_ConsumerAdmin_Collection*& collection ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (collection ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_SupplierAdmin_Collection*& collection ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (collection ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_Proxy_Collection*& collection ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (collection ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_EventChannelFactory*& channel_factory ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (channel_factory ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_EventChannel*& channel ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (channel ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_SupplierAdmin*& admin ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (admin ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_ConsumerAdmin*& admin ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (admin ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_ProxyPushConsumer*& proxy ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_ProxyPushSupplier*& proxy ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_CosEC_ProxyPushConsumer*& proxy ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_CosEC_ProxyPushSupplier*& proxy ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_StructuredProxyPushConsumer*& proxy ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_SequenceProxyPushConsumer*& proxy ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_Factory:: create (TAO_Notify_SequenceProxyPushSupplier*& proxy ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Default_Factory::create (proxy ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_RT_Notify, TAO_Notify_RT_Factory)
diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_Factory.h b/TAO/orbsvcs/orbsvcs/Notify/RT_Factory.h
new file mode 100644
index 00000000000..38bf46c4662
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/RT_Factory.h
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+/**
+ * @file RT_Factory.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_RT_FACTORY_H
+#define TAO_Notify_RT_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/rt_notify_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Default_Factory.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_RT_Factory
+ *
+ * @brief The Factory for the RT aware Notify classes.
+ *
+ */
+class TAO_RT_Notify_Export TAO_Notify_RT_Factory : public TAO_Notify_Default_Factory
+{
+public:
+ /// Constuctor
+ TAO_Notify_RT_Factory (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_RT_Factory ();
+
+ /// Create ProxySupplier Collection
+ virtual void create (TAO_Notify_ProxySupplier_Collection*& collection ACE_ENV_ARG_DECL);
+
+ /// Create ProxyConsumer Collection
+ virtual void create (TAO_Notify_ProxyConsumer_Collection*& collection ACE_ENV_ARG_DECL);
+
+ /// Create EventChannel Collection
+ virtual void create (TAO_Notify_EventChannel_Collection*& collection ACE_ENV_ARG_DECL);
+
+ /// Create ConsumerAdmin Collection
+ virtual void create (TAO_Notify_ConsumerAdmin_Collection*& collection ACE_ENV_ARG_DECL);
+
+ /// Create SupplierAdmin Collection
+ virtual void create (TAO_Notify_SupplierAdmin_Collection*& collection ACE_ENV_ARG_DECL);
+
+ /// Create Proxy Collection
+ virtual void create (TAO_Notify_Proxy_Collection*& collection ACE_ENV_ARG_DECL);
+
+ /// Create EventChannelDefault_Factory
+ virtual void create (TAO_Notify_EventChannelFactory*& channel_factory ACE_ENV_ARG_DECL);
+
+ /// Create EventChannel
+ virtual void create (TAO_Notify_EventChannel*& channel ACE_ENV_ARG_DECL);
+
+ /// Create SupplierAdmin
+ virtual void create (TAO_Notify_SupplierAdmin*& admin ACE_ENV_ARG_DECL);
+
+ /// Create ConsumerAdmin
+ virtual void create (TAO_Notify_ConsumerAdmin*& admin ACE_ENV_ARG_DECL);
+
+ /// Create ProxyPushConsumer
+ virtual void create (TAO_Notify_ProxyPushConsumer*& proxy ACE_ENV_ARG_DECL);
+
+ /// Create ProxyPushSupplier
+ virtual void create (TAO_Notify_ProxyPushSupplier*& proxy ACE_ENV_ARG_DECL);
+
+ /// Create CosEC_ProxyPushConsumer
+ virtual void create (TAO_Notify_CosEC_ProxyPushConsumer*& proxy ACE_ENV_ARG_DECL);
+
+ /// Create CosEC_ProxyPushSupplier
+ virtual void create (TAO_Notify_CosEC_ProxyPushSupplier*& proxy ACE_ENV_ARG_DECL);
+
+ /// Create StructuredProxyPushConsumer
+ virtual void create (TAO_Notify_StructuredProxyPushConsumer*& proxy ACE_ENV_ARG_DECL);
+
+ /// Create StructuredProxyPushSupplier
+ virtual void create (TAO_Notify_StructuredProxyPushSupplier*& proxy ACE_ENV_ARG_DECL);
+
+ /// Create SequenceProxyPushConsumer
+ virtual void create (TAO_Notify_SequenceProxyPushConsumer*& proxy ACE_ENV_ARG_DECL);
+
+ /// Create SequenceProxyPushSupplier
+ virtual void create (TAO_Notify_SequenceProxyPushSupplier*& proxy ACE_ENV_ARG_DECL);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DECLARE (TAO_RT_Notify, TAO_Notify_RT_Factory)
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_RT_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_Notify_Service.cpp b/TAO/orbsvcs/orbsvcs/Notify/RT_Notify_Service.cpp
new file mode 100644
index 00000000000..f9e4ce24128
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/RT_Notify_Service.cpp
@@ -0,0 +1,98 @@
+// $Id$
+
+#include "orbsvcs/Notify/RT_Notify_Service.h"
+
+ACE_RCSID(RT_Notify, TAO_Notify_RT_Notify_Service, "$Id$")
+
+#include "ace/Dynamic_Service.h"
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/RT_Properties.h"
+#include "orbsvcs/Notify/RT_Factory.h"
+#include "orbsvcs/Notify/RT_Builder.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_RT_Notify_Service::TAO_RT_Notify_Service (void)
+{
+}
+
+TAO_RT_Notify_Service::~TAO_RT_Notify_Service ()
+{
+}
+
+void
+TAO_RT_Notify_Service::init_service (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG, "Loading the Real-Time Notification Service...\n"));
+
+ this->init_i (orb ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_RT_Notify_Service::init_i (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
+{
+ //Init the base class.
+ TAO_CosNotify_Service::init_i (orb ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_Notify_RT_Properties* properties = TAO_Notify_RT_PROPERTIES::instance();
+
+ // 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 RTCurrent
+ object =
+ orb->resolve_initial_references ("RTCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RTCORBA::Current_var current =
+ RTCORBA::Current::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ /// Set the properties
+ properties->rt_orb (rt_orb.in ());
+ properties->current (current.in ());
+}
+
+TAO_Notify_Factory*
+TAO_RT_Notify_Service::create_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Factory* factory =
+ ACE_Dynamic_Service<TAO_Notify_Factory>::instance ("TAO_Notify_Factory");
+
+ if (factory == 0)
+ {
+ ACE_NEW_THROW_EX (factory,
+ TAO_Notify_RT_Factory (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN(0);
+ }
+ return factory;
+}
+
+TAO_Notify_Builder*
+TAO_RT_Notify_Service::create_builder (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Builder* builder = 0;
+ ACE_NEW_THROW_EX (builder,
+ TAO_Notify_RT_Builder (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN(0);
+
+ return builder;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_RT_Notify,TAO_RT_Notify_Service)
diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_Notify_Service.h b/TAO/orbsvcs/orbsvcs/Notify/RT_Notify_Service.h
new file mode 100644
index 00000000000..6383e95fc34
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/RT_Notify_Service.h
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+
+/**
+ * @file RT_Notify_Service.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_RT_NOTIFY_SERVICE_H
+#define TAO_Notify_RT_NOTIFY_SERVICE_H
+
+#include /**/ "ace/pre.h"
+#include "orbsvcs/Notify/rt_notify_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/CosNotify_Service.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_RT_Notify_Service
+ *
+ * @brief Implemetation of the TAO_Notify_Service interface for RT Notification.
+ *
+ */
+class TAO_RT_Notify_Export TAO_RT_Notify_Service : public TAO_CosNotify_Service
+{
+public:
+ /// Constuctor
+ TAO_RT_Notify_Service (void);
+
+ /// Destructor
+ ~TAO_RT_Notify_Service ();
+
+ /// Init the service.
+ virtual void init_service (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);
+
+protected:
+ /// Init the data members
+ virtual void init_i (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);
+
+ /// Create the Factory for RT Notify objects.
+ virtual TAO_Notify_Factory* create_factory (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Creates the Builder for RT Notify objects.
+ virtual TAO_Notify_Builder* create_builder (ACE_ENV_SINGLE_ARG_DECL);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DECLARE (TAO_RT_Notify,TAO_RT_Notify_Service)
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_RT_NOTIFY_SERVICE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_POA_Helper.cpp b/TAO/orbsvcs/orbsvcs/Notify/RT_POA_Helper.cpp
new file mode 100644
index 00000000000..81859ded60f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/RT_POA_Helper.cpp
@@ -0,0 +1,166 @@
+// $Id$
+
+#include "orbsvcs/Notify/RT_POA_Helper.h"
+#include "tao/RTCORBA/RTCORBA.h"
+#include "tao/debug.h"
+#include "orbsvcs/NotifyExtC.h"
+#include "orbsvcs/Notify/RT_Properties.h"
+#include "ace/SString.h"
+
+ACE_RCSID (Notify,
+ TAO_Notify_RT_POA_Helper,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_RT_POA_Helper::~TAO_Notify_RT_POA_Helper ()
+{
+}
+
+void
+TAO_Notify_RT_POA_Helper::init (PortableServer::POA_ptr parent_poa, const NotifyExt::ThreadPoolParams& tp_params ACE_ENV_ARG_DECL)
+{
+ ACE_CString child_poa_name = this->get_unique_id ();
+
+ this->init (parent_poa, child_poa_name.c_str (), tp_params ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_POA_Helper::init (PortableServer::POA_ptr parent_poa, const char* poa_name
+ , const NotifyExt::ThreadPoolParams& tp_params ACE_ENV_ARG_DECL)
+{
+ CORBA::PolicyList policy_list (4);
+
+ this->set_policy (parent_poa, policy_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RTCORBA::RTORB_var rt_orb = TAO_Notify_RT_PROPERTIES::instance ()->rt_orb ();
+
+ RTCORBA::PriorityModel priority_model =
+ tp_params.priority_model == NotifyExt::CLIENT_PROPAGATED ?
+ RTCORBA::CLIENT_PROPAGATED : RTCORBA::SERVER_DECLARED;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Priority Model = %d, Server prio = %d\n"
+ , tp_params.priority_model, tp_params.server_priority));
+
+ policy_list.length (3);
+ policy_list[2] =
+ rt_orb->create_priority_model_policy (priority_model,
+ tp_params.server_priority
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Creating threadpool: static threads = %d, def. prio = %d\n"
+ , tp_params.static_threads, tp_params.default_priority));
+
+ // Create the thread-pool.
+ RTCORBA::ThreadpoolId threadpool_id =
+ rt_orb->create_threadpool (tp_params.stacksize,
+ tp_params.static_threads,
+ tp_params.dynamic_threads,
+ tp_params.default_priority,
+ tp_params.allow_request_buffering,
+ tp_params.max_buffered_requests,
+ tp_params.max_request_buffer_size
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ policy_list.length (4);
+ policy_list[3] =
+ rt_orb->create_threadpool_policy (threadpool_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->create_i (parent_poa, poa_name, policy_list ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_POA_Helper::init (PortableServer::POA_ptr parent_poa, const NotifyExt::ThreadPoolLanesParams& tpl_params ACE_ENV_ARG_DECL)
+{
+ ACE_CString child_poa_name = this->get_unique_id ();
+
+ this->init (parent_poa, child_poa_name.c_str (), tpl_params ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_POA_Helper::init (PortableServer::POA_ptr parent_poa, const char* poa_name
+ , const NotifyExt::ThreadPoolLanesParams& tpl_params ACE_ENV_ARG_DECL)
+{
+ CORBA::PolicyList policy_list (4);
+
+ this->set_policy (parent_poa, policy_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RTCORBA::RTORB_var rt_orb = TAO_Notify_RT_PROPERTIES::instance ()->rt_orb ();
+
+ RTCORBA::PriorityModel priority_model =
+ tpl_params.priority_model == NotifyExt::CLIENT_PROPAGATED ?
+ RTCORBA::CLIENT_PROPAGATED : RTCORBA::SERVER_DECLARED;
+
+ policy_list.length (3);
+ policy_list[2] =
+ rt_orb->create_priority_model_policy (priority_model,
+ tpl_params.server_priority
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Populate RTCORBA Lanes.
+ RTCORBA::ThreadpoolLanes lanes (tpl_params.lanes.length ());
+ lanes.length (tpl_params.lanes.length ());
+
+ for (CORBA::ULong index = 0; index < tpl_params.lanes.length (); ++index)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Creating threadpool lane %d: priority = %d, static threads = %d\n",
+ index, tpl_params.lanes[index].lane_priority, tpl_params.lanes[index].static_threads));
+ }
+
+ lanes[index].lane_priority = tpl_params.lanes[index].lane_priority;
+ lanes[index].static_threads = tpl_params.lanes[index].static_threads;
+ lanes[index].dynamic_threads = tpl_params.lanes[index].dynamic_threads;
+ }
+
+ // Create the thread-pool.
+ RTCORBA::ThreadpoolId threadpool_id =
+ rt_orb->create_threadpool_with_lanes (tpl_params.stacksize,
+ lanes,
+ tpl_params.allow_borrowing,
+ tpl_params.allow_request_buffering,
+ tpl_params.max_buffered_requests,
+ tpl_params.max_request_buffer_size
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ policy_list.length (4);
+ policy_list[3] =
+ rt_orb->create_threadpool_policy (threadpool_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->create_i (parent_poa, poa_name, policy_list ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_RT_POA_Helper::init (PortableServer::POA_ptr parent_poa ACE_ENV_ARG_DECL)
+{
+ CORBA::PolicyList policy_list (1);
+
+ RTCORBA::RTORB_var rt_orb = TAO_Notify_RT_PROPERTIES::instance ()->rt_orb ();
+
+ policy_list.length (1);
+
+ policy_list[0] =
+ rt_orb->create_priority_model_policy (RTCORBA::CLIENT_PROPAGATED,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_CString child_poa_name = this->get_unique_id ();
+
+ this->create_i (parent_poa, child_poa_name.c_str (), policy_list ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_POA_Helper.h b/TAO/orbsvcs/orbsvcs/Notify/RT_POA_Helper.h
new file mode 100644
index 00000000000..d272420ef98
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/RT_POA_Helper.h
@@ -0,0 +1,63 @@
+// -*- C++ -*-
+
+/**
+ * @file RT_POA_Helper.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_RT_POA_Helper_H
+#define TAO_Notify_RT_POA_Helper_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/rt_notify_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/POA_Helper.h"
+#include "orbsvcs/NotifyExtC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_RT_POA_Helper
+ *
+ * @brief Helper for creating RT POA objects.
+ *
+ */
+class TAO_RT_Notify_Export TAO_Notify_RT_POA_Helper : public TAO_Notify_POA_Helper
+{
+public:
+ /// Destructor
+ ~TAO_Notify_RT_POA_Helper ();
+
+ /// Create a new PortableServer::POA.
+ /// The UNIQUE_ID, USER_ID , CLIENT_PROPAGATED and thread pool policy is applied to the new POA.
+ void init (PortableServer::POA_ptr parent_poa, const char* poa_name, const NotifyExt::ThreadPoolParams& tp_params ACE_ENV_ARG_DECL);
+
+ /// Create a new PortableServer::POA. The name is chosen at random.
+ /// The UNIQUE_ID, USER_ID , CLIENT_PROPAGATED and thread pool policy is applied to the new POA.
+ void init (PortableServer::POA_ptr parent_poa, const NotifyExt::ThreadPoolParams& tp_params ACE_ENV_ARG_DECL);
+
+ /// Create a new PortableServer::POA.
+ /// The UNIQUE_ID, USER_ID , CLIENT_PROPAGATED and thread lane policy is applied to the new POA.
+ void init (PortableServer::POA_ptr parent_poa, const char* poa_name,
+ const NotifyExt::ThreadPoolLanesParams& tpl_params ACE_ENV_ARG_DECL);
+
+ /// Create a new PortableServer::POA. The name is chosen at random.
+ /// The UNIQUE_ID, USER_ID , CLIENT_PROPAGATED and thread lane policy is applied to the new POA.
+ void init (PortableServer::POA_ptr parent_poa, const NotifyExt::ThreadPoolLanesParams& tpl_params ACE_ENV_ARG_DECL);
+
+ /// Create a new PortableServer::POA. The name is chosen at random.
+ /// The CLIENT_PROPAGATED policy is applied to the new POA.
+ void init (PortableServer::POA_ptr parent_poa ACE_ENV_ARG_DECL);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_RT_POA_Helper_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.cpp b/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.cpp
new file mode 100644
index 00000000000..6a5aff084e8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.cpp
@@ -0,0 +1,22 @@
+// $Id$
+
+#include "orbsvcs/Notify/RT_Properties.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/RT_Properties.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(RT_Notify, TAO_Notify_RT_Properties, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_RT_Properties::TAO_Notify_RT_Properties (void)
+{
+}
+
+TAO_Notify_RT_Properties::~TAO_Notify_RT_Properties ()
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.h b/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.h
new file mode 100644
index 00000000000..124f8757145
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.h
@@ -0,0 +1,68 @@
+// -*- C++ -*-
+
+/**
+ * @file RT_Properties.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_RT_PROPERTIES_H
+#define TAO_Notify_RT_PROPERTIES_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/rt_notify_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/TAO_Singleton.h"
+#include "tao/RTCORBA/RTCORBA.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_RT_Properties
+ *
+ * @brief RT specifc global properties are stored here.
+ *
+ */
+class TAO_RT_Notify_Export TAO_Notify_RT_Properties
+{
+ friend class TAO_Singleton<TAO_Notify_RT_Properties, TAO_SYNCH_MUTEX>;
+
+public:
+ /// Constuctor
+ TAO_Notify_RT_Properties (void);
+
+ /// Destructor
+ ~TAO_Notify_RT_Properties ();
+
+ RTCORBA::RTORB_ptr rt_orb (void);
+ void rt_orb (RTCORBA::RTORB_ptr rt_orb);
+
+ RTCORBA::Current_ptr current (void);
+ void current (RTCORBA::Current_ptr current);
+
+protected:
+ /// RT-ORB
+ RTCORBA::RTORB_var rt_orb_;
+
+ /// Current
+ RTCORBA::Current_var current_;
+};
+
+TAO_RT_NOTIFY_SINGLETON_DECLARE (TAO_Singleton, TAO_Notify_RT_Properties, TAO_SYNCH_MUTEX)
+
+typedef TAO_Singleton<TAO_Notify_RT_Properties, TAO_SYNCH_MUTEX> TAO_Notify_RT_PROPERTIES;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/RT_Properties.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_RT_PROPERTIES_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.inl b/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.inl
new file mode 100644
index 00000000000..71fae93e7ba
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.inl
@@ -0,0 +1,31 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE RTCORBA::RTORB_ptr
+TAO_Notify_RT_Properties::rt_orb (void)
+{
+ return RTCORBA::RTORB::_duplicate (rt_orb_.in ());
+}
+
+ACE_INLINE void
+TAO_Notify_RT_Properties::rt_orb (RTCORBA::RTORB_ptr rt_orb)
+{
+ rt_orb_ = RTCORBA::RTORB::_duplicate (rt_orb);
+}
+
+ACE_INLINE RTCORBA::Current_ptr
+TAO_Notify_RT_Properties::current (void)
+{
+ return RTCORBA::Current::_duplicate (current_.in());
+}
+
+ACE_INLINE void
+TAO_Notify_RT_Properties::current (RTCORBA::Current_ptr current)
+{
+ current_ = RTCORBA::Current::_duplicate (current);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Random_File.cpp b/TAO/orbsvcs/orbsvcs/Notify/Random_File.cpp
new file mode 100644
index 00000000000..b0e528de02b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Random_File.cpp
@@ -0,0 +1,161 @@
+// $Id$
+
+#include "orbsvcs/Notify/Random_File.h"
+
+#include "ace/OS.h"
+#include "ace/Log_Msg.h"
+#include "tao/debug.h"
+//#define DEBUG_LEVEL 9
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+
+Random_File::Random_File()
+ : block_size_(512)
+{
+}
+
+Random_File::~Random_File()
+{
+ this->close();
+}
+
+size_t
+Random_File::block_size() const
+{
+ return this->block_size_;
+}
+
+size_t
+Random_File::size() const
+{
+ Random_File * mutable_this = const_cast<Random_File *> (this);
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, mutable_this->lock_, 0);
+ size_t original_pos = mutable_this->tell ();
+ mutable_this->ACE_FILE::seek(0, SEEK_END);
+ size_t cursize = mutable_this->tell();
+ mutable_this->ACE_FILE::seek (original_pos, SEEK_SET);
+ if ((cursize % this->block_size_) != 0)
+ {
+ cursize += this->block_size_;
+ }
+ return cursize / this->block_size_;
+}
+
+bool
+Random_File::open(const ACE_TCHAR* filename, size_t block_size)
+{
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, false);
+ this->block_size_ = block_size;
+ bool result = (this->close() == 0);
+
+ if (result)
+ {
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Opening file %s\n")
+ , filename
+ ));
+ ACE_HANDLE handle = ACE_OS::open(filename,
+ O_CREAT | O_RDWR | O_BINARY,
+ ACE_DEFAULT_FILE_PERMS);
+
+ if (handle == ACE_INVALID_HANDLE)
+ {
+ result = false;
+ }
+ else
+ {
+ this->set_handle(handle);
+ if (this->get_handle() == 0)
+ {
+ result = false;
+ }
+ else
+ {
+ result = (this->addr_.set(filename) == 0);
+ }
+ }
+ }
+ return result;
+}
+
+bool
+Random_File::write(const size_t block_number, void* buf, bool atomic)
+{
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, false);
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Write block %d %c\n"),
+ static_cast<int> (block_number),
+ (atomic ? '*' : ' ')
+ ));
+ bool result = this->seek(block_number);
+ if (result)
+ {
+ if (atomic)
+ {
+ // sync before so that any block pointed to from this block
+ // will be there when this block is written.
+ result = sync();
+ }
+ // ACE uses an ssize_t for buffer size, so we do this to make it happy.
+ ssize_t block_size = this->block_size_;
+ if (result && (block_size !=
+ ACE_OS::write(this->get_handle(), buf, block_size)))
+ {
+ result = false;
+ }
+ if (result && atomic)
+ {
+ // sync after to provide the caller with a guarantee that
+ // this block is physically written to the storage device.
+ result = sync();
+ }
+ }
+ return result;
+}
+
+bool
+Random_File::read(const size_t block_number, void* buf)
+{
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, false);
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Read block %d\n"),
+ static_cast<int> (block_number)
+ ));
+ bool result = this->seek(block_number);
+ if (result)
+ {
+ ssize_t block_size = this->block_size_;
+ if (block_size !=
+ ACE_OS::read(this->get_handle(), buf, block_size))
+ {
+ result = false;
+ }
+ }
+ return result;
+}
+
+bool
+Random_File::seek(const size_t block_number)
+{
+ ssize_t destloc = block_number * this->block_size_;
+ bool result = (destloc == this->ACE_FILE::seek(destloc, SEEK_SET));
+ return result;
+}
+
+bool
+Random_File::sync()
+{
+ bool result = false;
+ result = (0 == ACE_OS::fsync(this->get_handle()));
+ return result;
+}
+
+} /* namespace TAO_Notify */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Random_File.h b/TAO/orbsvcs/orbsvcs/Notify/Random_File.h
new file mode 100644
index 00000000000..c3ebfcd96bf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Random_File.h
@@ -0,0 +1,94 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Random_File.h
+ *
+ * $Id$
+ *
+ * This class implements a a random-access file containing
+ * fixed-size blocks.
+ *
+ * @author Jonathan Pollack <pollack_j@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef RANDOM_FILE_H
+#define RANDOM_FILE_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/Notify/notify_serv_export.h"
+#include "tao/Versioned_Namespace.h"
+#include "ace/FILE.h"
+#include "ace/streams.h"
+#include "ace/Synch_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+
+/**
+ * \brief A random file class.
+ *
+ * Derived from ACE_FILE, this class provides access to a
+ * file of fixed-size blocks.
+ *
+ */
+class TAO_Notify_Serv_Export Random_File : public ACE_FILE
+{
+public:
+ /// The constructor.
+ Random_File();
+
+ /// The destructor, which closes the open file.
+ ~Random_File();
+
+ /// Open a file with default permissions.
+ bool open(const ACE_TCHAR* filename, size_t block_size = 512);
+
+ /// Accessor for the block size.
+ /// Note signed size_t is used to be compatible with
+ /// ACE_FILE.
+ size_t block_size() const;
+
+ /// Return the current file size, in number of blocks.
+ size_t size() const;
+
+ /// Write a block to our file, potentially as an "atomic" write.
+ /// If the atomic argument is true, then the operating system's
+ /// write-through cache for this file is flushed both before and
+ /// after the write.
+ /// The flush before ensures that any record pointers in this block
+ /// will point to records that actually appear in the file.
+ /// The flush after provides the caller with a guarantee that
+ /// the data will appear in the file even if the system fails
+ /// immediately after this method returns.
+ bool write(const size_t block_number, void* buffer, bool atomic = false);
+
+ /// Read a block from our file.
+ bool read(const size_t block_number, void* buffer);
+
+private:
+ /// Seek to a given block number, used by reads and writes.
+ bool seek(const size_t block_number);
+
+ /// Synchronize the file to disk, used to implement atomic.
+ bool sync();
+
+private:
+ size_t block_size_;
+ ACE_SYNCH_MUTEX lock_;
+};
+
+} /* namespace TAO_Notify */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* RANDOM_FILE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.cpp b/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.cpp
new file mode 100644
index 00000000000..be6bdd90518
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.cpp
@@ -0,0 +1,59 @@
+// $Id$
+
+#include "orbsvcs/Notify/Reactive_Task.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Reactive_Task.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Notify, TAO_Notify_Reactive_Task, "$Id$")
+
+#include "orbsvcs/Notify/Timer_Reactor.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Reactive_Task::TAO_Notify_Reactive_Task (void)
+ :timer_ (0)
+{
+}
+
+TAO_Notify_Reactive_Task::~TAO_Notify_Reactive_Task ()
+{
+}
+
+void
+TAO_Notify_Reactive_Task::init (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_ASSERT (this->timer_.get() == 0);
+
+ TAO_Notify_Timer_Reactor* timer = 0;
+ ACE_NEW_THROW_EX (timer,
+ TAO_Notify_Timer_Reactor (),
+ CORBA::NO_MEMORY ());
+ this->timer_.reset (timer);
+}
+
+void
+TAO_Notify_Reactive_Task::release (void)
+{
+ delete this; //TODO: Release via factory.
+}
+
+void
+TAO_Notify_Reactive_Task::shutdown (void)
+{
+}
+
+void
+TAO_Notify_Reactive_Task::execute (TAO_Notify_Method_Request& method_request ACE_ENV_ARG_DECL)
+{
+ method_request.execute (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_Notify_Timer*
+TAO_Notify_Reactive_Task::timer (void)
+{
+ return this->timer_.get();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.h b/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.h
new file mode 100644
index 00000000000..b7a602cd67c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.h
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+
+/**
+ * @file Reactive_Task.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_REACTIVE_TASK_H
+#define TAO_Notify_REACTIVE_TASK_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Worker_Task.h"
+#include "orbsvcs/Notify/AdminProperties.h"
+#include "orbsvcs/Notify/Timer_Reactor.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Reactive_Task
+ *
+ * @brief A reactive worker task. Simply executes the command in the
+ * caller's context.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Reactive_Task
+ : public TAO_Notify_Worker_Task
+{
+public:
+ /// Constuctor
+ TAO_Notify_Reactive_Task (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Reactive_Task ();
+
+ /// Init the reactive task.
+ void init (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Shutdown task
+ virtual void shutdown (void);
+
+ /// Exec the request.
+ virtual void execute (TAO_Notify_Method_Request& method_request ACE_ENV_ARG_DECL);
+
+ /// The object used by clients to register timers. This method returns a Reactor based Timer.
+ virtual TAO_Notify_Timer* timer (void);
+
+ /// Returns NULL.
+ virtual TAO_Notify_Buffering_Strategy* buffering_strategy (void);
+
+private:
+ /// The timer.
+ TAO_Notify_Timer_Reactor::Ptr timer_;
+
+ /// Release
+ virtual void release (void);
+};
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Reactive_Task.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_REACTIVE_TASK_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.inl b/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.inl
new file mode 100644
index 00000000000..d2b6ec811e5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.inl
@@ -0,0 +1,13 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE TAO_Notify_Buffering_Strategy*
+TAO_Notify_Reactive_Task::buffering_strategy (void)
+{
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Reconnect_Worker_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Reconnect_Worker_T.cpp
new file mode 100644
index 00000000000..4c5857f45c8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Reconnect_Worker_T.cpp
@@ -0,0 +1,41 @@
+//=============================================================================
+/**
+* @file Reconnect_Worker_T.cpp
+*
+* $Id$
+*
+* @author Jonathan Pollack <pollack_j@ociweb.com>
+*/
+//=============================================================================
+
+#ifndef RECONNECT_WORKER_CPP
+#define RECONNECT_WORKER_CPP
+
+#include "orbsvcs/Notify/Reconnect_Worker_T.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ template<class TOPOOBJ>
+ Reconnect_Worker<TOPOOBJ>::Reconnect_Worker()
+ {
+ }
+
+ template<class TOPOOBJ>
+ void
+ Reconnect_Worker<TOPOOBJ>::work (TOPOOBJ* o ACE_ENV_ARG_DECL)
+ {
+ ACE_ASSERT(o != 0);
+ o->reconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* RECONNECT_WORKER_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Reconnect_Worker_T.h b/TAO/orbsvcs/orbsvcs/Notify/Reconnect_Worker_T.h
new file mode 100644
index 00000000000..a4c71244ec2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Reconnect_Worker_T.h
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+* @file Reconnect_Worker_T.h
+*
+* $Id$
+*
+* @author Jonathan Pollack <pollack_j@ociweb.com>
+*/
+//=============================================================================
+
+#ifndef RECONNECT_WORKER_H
+#define RECONNECT_WORKER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ /**
+ * \brief Iterate through children reconnecting after reloading persistent information.
+ */
+ template<class TOPOOBJ>
+ class Reconnect_Worker : public TAO_ESF_Worker<TOPOOBJ>
+ {
+ public:
+ /// Constructor
+ Reconnect_Worker();
+
+ // override virtual ESF_Worker method
+ virtual void work (TOPOOBJ* o ACE_ENV_ARG_DECL);
+ };
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Notify/Reconnect_Worker_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Reconnect_Worker_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+
+#endif /* RECONECT_WORKER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Reconnection_Registry.cpp b/TAO/orbsvcs/orbsvcs/Notify/Reconnection_Registry.cpp
new file mode 100644
index 00000000000..8eba0d841ef
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Reconnection_Registry.cpp
@@ -0,0 +1,257 @@
+// -*- C++ -*-
+
+/**
+ * @file Reconnection_Registry.cpp
+ *
+ * $Id$
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+#include "orbsvcs/Notify/Reconnection_Registry.h"
+
+#include "tao/debug.h"
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/Topology_Saver.h"
+#include "ace/Vector_T.h"
+//#define DEBUG_LEVEL 10
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ const char REGISTRY_TYPE[] = "reconnect_registry";
+ const char RECONNECT_ID[] = "ReconnectId";
+ const char RECONNECT_IOR[] = "IOR";
+ const char REGISTRY_CALLBACK_TYPE[] = "reconnect_callback";
+
+ Reconnection_Registry::Reconnection_Registry (Topology_Parent & parent)
+ : highest_id_(0)
+ {
+ // not the best technique, here. Take advantage of "protected"
+ Topology_Object::topology_parent_ = &parent;
+ }
+
+ Reconnection_Registry::~Reconnection_Registry ()
+ {
+ }
+
+ //////////////////////////
+ // During normal operation
+
+ NotifyExt::ReconnectionRegistry::ReconnectionID
+ Reconnection_Registry::register_callback (
+ NotifyExt::ReconnectionCallback_ptr callback
+ ACE_ENV_ARG_DECL)
+ {
+ //@@todo DO WE NEED THREAD SAFENESS?
+ NotifyExt::ReconnectionRegistry::ReconnectionID next_id = ++highest_id_;
+
+ if (DEBUG_LEVEL > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Reconnect registry: registering %d\n"),
+ static_cast<int> (next_id)
+ ));
+ }
+ TAO_Notify_Properties* properties = TAO_Notify_PROPERTIES::instance();
+ CORBA::ORB_var orb = properties->orb ();
+
+ CORBA::String_var cior = orb->object_to_string (callback ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ ACE_CString ior(cior.in ());
+ if ( 0 != reconnection_registry_.bind (next_id, ior))
+ {
+ //todo throw something;
+ }
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return next_id;
+ }
+
+ void
+ Reconnection_Registry::unregister_callback (NotifyExt::ReconnectionRegistry::ReconnectionID id
+ ACE_ENV_ARG_DECL)
+ {
+ if (DEBUG_LEVEL > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Reconnect registry: unregistering %d\n"),
+ static_cast<int> (id)
+ ));
+ }
+ if ( 0 != reconnection_registry_.unbind (id))
+ {
+ //@@todo throw something
+ }
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ CORBA::Boolean
+ Reconnection_Registry::is_alive (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ {
+ return CORBA::Boolean(1);
+ }
+
+ //////////////////////
+ // During topology save
+
+ void
+ Reconnection_Registry::save_persistent (Topology_Saver& saver ACE_ENV_ARG_DECL)
+ {
+ bool change = this->self_changed_;
+ this->self_changed_ = false;
+ this->children_changed_ = false;
+
+ NVPList attrs;
+ //@@todo: bool want_all_children =
+ saver.begin_object (0, REGISTRY_TYPE, attrs, change ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ Reconnection_Registry_Type::ENTRY *entry;
+ for (Reconnection_Registry_Type::ITERATOR iter (this->reconnection_registry_);
+ iter.next (entry);
+ iter.advance ())
+ {
+ NVPList cattrs;
+ if (DEBUG_LEVEL > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Reconnect registry: saving %d\n"),
+ static_cast<int> (entry->ext_id_)
+ ));
+ }
+ cattrs.push_back(NVP(RECONNECT_ID, entry->ext_id_));
+ cattrs.push_back(NVP(RECONNECT_IOR, entry->int_id_));
+ saver.begin_object (entry->ext_id_, REGISTRY_CALLBACK_TYPE, cattrs, true ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ saver.end_object (entry->ext_id_, REGISTRY_CALLBACK_TYPE ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+// todo:
+// for all deleted children
+// {
+// saver.delete_child(child_type, child_id);
+// }
+ saver.end_object (0, REGISTRY_TYPE ACE_ENV_ARG_PARAMETER);
+ }
+
+ ///////////////////////////////////////
+ // During reload of persistent topology
+
+ Topology_Object*
+ Reconnection_Registry::load_child (const ACE_CString & type,
+ CORBA::Long,
+ const NVPList& attrs
+ ACE_ENV_ARG_DECL_NOT_USED)
+ {
+ if (type == REGISTRY_CALLBACK_TYPE)
+ {
+ NotifyExt::ReconnectionRegistry::ReconnectionID id;
+ ACE_CString ior;
+ if (attrs.load (RECONNECT_ID, id) && attrs.load (RECONNECT_IOR, ior))
+ {
+ if (id > highest_id_)
+ {
+ highest_id_ = id;
+
+ if (DEBUG_LEVEL > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Reconnect registry: reloading %d\n"),
+ static_cast<int> (id)
+ ));
+ }
+ }
+ if ( 0 != reconnection_registry_.bind (id, ior))
+ {
+ //@@todo - throw something;
+ }
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Reconnect registry: missing attribute\n")
+ ));
+ }
+ }
+ return this;
+ }
+
+ void
+ Reconnection_Registry::send_reconnect (CosNotifyChannelAdmin::EventChannelFactory_ptr dest_factory
+ ACE_ENV_ARG_DECL_NOT_USED)
+ {
+ TAO_Notify_Properties* properties = TAO_Notify_PROPERTIES::instance();
+ CORBA::ORB_var orb = properties->orb ();
+ ACE_Vector <NotifyExt::ReconnectionRegistry::ReconnectionID> bad_ids;
+
+ Reconnection_Registry_Type::ENTRY *entry;
+ for (Reconnection_Registry_Type::ITERATOR iter (this->reconnection_registry_);
+ iter.next (entry);
+ iter.advance ())
+ {
+ ACE_DECLARE_NEW_ENV;
+ ACE_TRY
+ {
+ if (DEBUG_LEVEL > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Reconnection Registry: Sending reconnection to client %d\n"),
+ static_cast<int> (entry->ext_id_)
+ ));
+ }
+ ACE_CString & ior = entry->int_id_;
+ CORBA::Object_var obj = orb->string_to_object (ior.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ NotifyExt::ReconnectionCallback_var callback =
+ NotifyExt::ReconnectionCallback::_narrow (obj.in ());
+ if (!CORBA::is_nil (callback.in ()))
+ {
+ callback->reconnect (dest_factory ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Reconnection Registry: Can't resolve reconnection client's IOR %d\n"),
+ static_cast<int> (entry->ext_id_)
+ ));
+
+ //throw this entry away but you've got an iterator so be careful
+ bad_ids.push_back (entry->ext_id_);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Reconnection Registry: Exception sending reconnection to client -- discarding registry entry\n")
+ ));
+ //throw this entry away but you've got an iterator so be careful
+ bad_ids.push_back (entry->ext_id_);
+ //@@todo : we might want to check for retryable exceptions, but for now...
+ }
+ ACE_ENDTRY;
+ }
+ size_t bad_count = bad_ids.size ();
+ for (size_t nbad = 0; nbad < bad_count; ++nbad)
+ {
+ this->reconnection_registry_.unbind (bad_ids[nbad]);
+ }
+ }
+
+ void
+ Reconnection_Registry::release (void)
+ {
+ delete this;
+ //@@ inform factory
+ }
+
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Reconnection_Registry.h b/TAO/orbsvcs/orbsvcs/Notify/Reconnection_Registry.h
new file mode 100644
index 00000000000..0c84190d5a9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Reconnection_Registry.h
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+/**
+ * @file Reconnection_Registry.h
+ *
+ * $Id$
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+
+#ifndef TAO_NOTIFY_RECONNECTION_REGISTRY_H
+#define TAO_NOTIFY_RECONNECTION_REGISTRY_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/Notify/Topology_Object.h"
+
+#include "orbsvcs/NotifyExtS.h"
+
+#include "ace/Hash_Map_Manager_T.h"
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ extern const char REGISTRY_TYPE[];
+ extern const char RECONNECT_ID[];
+ extern const char RECONNECT_IOR[];
+ extern const char REGISTRY_CALLBACK_TYPE[];
+
+ /**
+ * @class Reconnection_Registry
+ *
+ * @brief Implementation of ReconnectionRegistry
+ *
+ */
+ class TAO_Notify_Serv_Export Reconnection_Registry
+ : public Topology_Object
+ {
+ /// The registry consists of a map from ReconnectionID to stringified IOR
+ typedef ACE_Hash_Map_Manager_Ex<NotifyExt::ReconnectionRegistry::ReconnectionID,
+ ACE_CString,
+ ACE_Hash<NotifyExt::ReconnectionRegistry::ReconnectionID>,
+ ACE_Equal_To<NotifyExt::ReconnectionRegistry::ReconnectionID>,
+ ACE_SYNCH_NULL_MUTEX> Reconnection_Registry_Type;
+
+ public:
+
+ /// Constructor
+ Reconnection_Registry (Topology_Parent & parent);
+
+ /// Destructor
+ virtual ~Reconnection_Registry ();
+
+ //////////////////////////
+ // During normal operation
+
+ /// add a new callback to the registry
+ ::NotifyExt::ReconnectionRegistry::ReconnectionID register_callback (
+ ::NotifyExt::ReconnectionCallback_ptr callback
+ ACE_ENV_ARG_DECL);
+
+ ///
+ void unregister_callback (::NotifyExt::ReconnectionRegistry::ReconnectionID id
+ ACE_ENV_ARG_DECL);
+
+ CORBA::Boolean is_alive (ACE_ENV_SINGLE_ARG_DECL);
+
+ //////////////////////
+ // During topology save
+ virtual void save_persistent (Topology_Saver& saver ACE_ENV_ARG_DECL);
+
+ ///////////////////////////////////////
+ // During reload of persistent topology
+
+ virtual Topology_Object* load_child (const ACE_CString & type,
+ CORBA::Long id,
+ const NVPList& attrs
+ ACE_ENV_ARG_DECL);
+
+ void send_reconnect (CosNotifyChannelAdmin::EventChannelFactory_ptr dest_factory
+ ACE_ENV_ARG_DECL);
+
+ private:
+ void release (void);
+
+ Reconnection_Registry_Type reconnection_registry_;
+ ::NotifyExt::ReconnectionRegistry::ReconnectionID highest_id_;
+ };
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ <ace/post.h>
+#endif /* TAO_NOTIFY_RECONNECTION_REGISTRY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Refcountable.cpp b/TAO/orbsvcs/orbsvcs/Notify/Refcountable.cpp
new file mode 100644
index 00000000000..0d06a3c0e05
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Refcountable.cpp
@@ -0,0 +1,252 @@
+// $Id$
+
+#include "orbsvcs/Notify/Refcountable.h"
+#include "tao/debug.h"
+#include "ace/Log_Msg.h"
+
+#include "ace/Guard_T.h"
+
+ACE_RCSID(Notify, TAO_Notify_Refcountable, "$Id$")
+
+#if ( TAO_NOTIFY_REFCOUNT_DIAGNOSTICS != 0 )
+
+#include <map>
+#include <string>
+#include <typeinfo.h>
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Tracker
+ *
+ * @brief A debugging tool to track the creation of TAO_Notify_Refcountable objects.
+ *
+ * Usage:
+ * Set USE_TAO_NOTIFY_TRACKER defined above to 1
+ * At any significant point to check object usage
+ * TAO_Notify_Tracker::get_instance().dump();
+ */
+class TAO_Notify_Tracker
+{
+public:
+ struct Entry
+ {
+ TAO_Notify_Refcountable* obj;
+ std::string class_name;
+ };
+
+ static TAO_Notify_Tracker& get_instance();
+
+ void add( TAO_Notify_Refcountable* p );
+
+ void remove( const TAO_Notify_Refcountable* p );
+
+ Entry find( const TAO_Notify_Refcountable* p ) const;
+
+ void dump( const char* title = 0 );
+
+private:
+ TAO_Notify_Tracker();
+ ~TAO_Notify_Tracker();
+
+ friend class std::auto_ptr< TAO_Notify_Tracker >;
+ static std::auto_ptr< TAO_Notify_Tracker > s_instance;
+ mutable TAO_SYNCH_MUTEX lock_;
+ typedef std::map<int, Entry> EntityMap;
+ EntityMap map_;
+ int id_counter_;
+ int last_dump_count_;
+};
+
+void
+TAO_Notify_Refcountable::diagnostic_dump( const char* title )
+{
+ TAO_Notify_Tracker::get_instance().dump( title );
+}
+
+#endif /* TAO_NOTIFY_REFCOUNT_DIAGNOSTICS */
+
+
+TAO_Notify_Refcountable::TAO_Notify_Refcountable (void)
+{
+}
+
+TAO_Notify_Refcountable::~TAO_Notify_Refcountable ()
+{
+#if ( TAO_NOTIFY_REFCOUNT_DIAGNOSTICS != 0 )
+ TAO_Notify_Tracker::Entry e = TAO_Notify_Tracker::get_instance().find( this );
+ if ( e.obj != 0 )
+ {
+ ACE_DEBUG ((LM_DEBUG,"object:%x %s(%d) with refcount:%d destroyed incorrectly.\n",
+ e.obj, e.class_name, e.obj->ref_id_, e.obj->refcount_.value() ));
+
+ if ( e.obj != this || e.obj->ref_id_ != this->ref_id_ )
+ {
+ ACE_DEBUG ((LM_DEBUG, " with an ID mismatch %x->%d != %x->%d!\n",
+ this, ref_id_, e.obj, e.obj->ref_id_));
+ }
+ TAO_Notify_Tracker::get_instance().remove( this );
+ }
+#endif
+ CORBA::ULong refcount = this->refcount_.value();
+ ACE_ASSERT( refcount == 0 );
+ ACE_UNUSED_ARG(refcount);
+}
+
+
+CORBA::ULong
+TAO_Notify_Refcountable::_incr_refcnt (void)
+{
+ CORBA::Long refcount = ++this->refcount_;
+ if (TAO_debug_level > 1 )
+ {
+ ACE_DEBUG ((LM_DEBUG,"object:%x incr refcount = %d\n", this, refcount ));
+ }
+#if ( TAO_NOTIFY_REFCOUNT_DIAGNOSTICS != 0 )
+ // Stack-instantiated-non-servants should never have _incr_refcnt called.
+ // We do not care about stack-instances. Stack-instantiated servants break
+ // the tracker.
+ if ( refcount == 1 )
+ {
+ TAO_Notify_Tracker::get_instance().add( this );
+ }
+#endif
+ return refcount;
+}
+
+CORBA::ULong
+TAO_Notify_Refcountable::_decr_refcnt (void)
+{
+ CORBA::Long refcount = --this->refcount_;
+
+ if (TAO_debug_level > 1 )
+ {
+ ACE_DEBUG ((LM_DEBUG,"object:%x decr refcount = %d\n", this, refcount ));
+ }
+
+ ACE_ASSERT(refcount >= 0);
+
+ if (refcount == 0)
+ {
+ #if ( USE_TAO_NOTIFY_TRACKER != 0 )
+ TAO_Notify_Tracker::get_instance().remove( this );
+ #endif
+ this->release ();
+ }
+ return refcount;
+}
+
+#if ( TAO_NOTIFY_REFCOUNT_DIAGNOSTICS != 0 )
+
+std::auto_ptr< TAO_Notify_Tracker > TAO_Notify_Tracker::s_instance;
+
+TAO_Notify_Tracker::TAO_Notify_Tracker()
+: id_counter_(0)
+, last_dump_count_(0)
+{
+}
+
+
+TAO_Notify_Tracker::~TAO_Notify_Tracker()
+{
+ dump( "destruction" );
+}
+
+
+void
+TAO_Notify_Tracker::dump( const char* title )
+{
+ ACE_Guard<TAO_SYNCH_MUTEX> grd(this->lock_);
+
+ ACE_DEBUG ((LM_DEBUG,"\nTAO_Notify_Tracker: %s\n", (title ? title : "dump")));
+
+ EntityMap::const_iterator iter( map_.begin() );
+ while ( iter != map_.end() )
+ {
+ ACE_DEBUG ((LM_DEBUG,"object:%x %s(%d) with refcount:%d.\n",
+ iter->second.obj, iter->second.class_name, iter->first, iter->second.obj->refcount_.value() ));
+ iter++;
+ }
+
+ EntityMap::size_type current_count = map_.size();
+ int diff = ( current_count - last_dump_count_ );
+ ACE_DEBUG ((LM_DEBUG,"Count: %u\nDifference: %+d\n", current_count, diff ));
+ last_dump_count_ = current_count;
+}
+
+
+TAO_Notify_Tracker&
+TAO_Notify_Tracker::get_instance()
+{
+ if ( s_instance.get() == 0 )
+ {
+ s_instance.reset( new TAO_Notify_Tracker );
+ }
+ return *s_instance;
+}
+
+
+void
+TAO_Notify_Tracker::add( TAO_Notify_Refcountable* p )
+{
+ if ( p == 0 ) return;
+
+ ACE_Guard<TAO_SYNCH_MUTEX> grd(this->lock_);
+ int id = ++id_counter_;
+
+ Entry e = { p, typeid(*p).name() };
+ std::pair< EntityMap::iterator, bool > result =
+ map_.insert( std::make_pair( id, e ) );
+ EntityMap::iterator& it = result.first;
+ if ( result.second == false )
+ {
+ ACE_DEBUG ((LM_DEBUG,"object:%x %s(%d) added twice.\n",
+ it->second.obj, it->second.class_name.c_str(), it->first ));
+ }
+ else
+ {
+ p->ref_id_ = id;
+ }
+}
+
+
+void
+TAO_Notify_Tracker::remove( const TAO_Notify_Refcountable* p )
+{
+ if ( p == 0 ) return;
+
+ ACE_Guard<TAO_SYNCH_MUTEX> grd(this->lock_);
+ int ref_id = p->ref_id_;
+ EntityMap::iterator iter( map_.find( ref_id ) );
+ if ( iter == map_.end() )
+ {
+ const char* class_name = typeid(*iter->second.obj).name();
+ ACE_DEBUG ((LM_DEBUG,"object:%x %s(%d) not found.\n",
+ p, class_name, ref_id ));
+ }
+ else
+ {
+ map_.erase( iter );
+ }
+}
+
+
+TAO_Notify_Tracker::Entry
+TAO_Notify_Tracker::find( const TAO_Notify_Refcountable* p ) const
+{
+ Entry e = { 0, "" };
+ if ( p == 0 ) return e;
+
+ ACE_Guard<TAO_SYNCH_MUTEX> grd(this->lock_);
+ int ref_id = p->ref_id_;
+ EntityMap::const_iterator iter( map_.find( ref_id ) );
+ if ( iter != map_.end() )
+ {
+ return iter->second;
+ }
+ return e;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_NOTIFY_REFCOUNT_DIAGNOSTICS */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Refcountable.h b/TAO/orbsvcs/orbsvcs/Notify/Refcountable.h
new file mode 100644
index 00000000000..960c7e37a93
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Refcountable.h
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+
+/**
+ * @file Refcountable.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_REFCOUNTABLE_H
+#define TAO_Notify_REFCOUNTABLE_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+#include "orbsvcs/Notify/Refcountable_Guard_T.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/orbconf.h"
+#include "tao/Basic_Types.h"
+#include "ace/Synch_Traits.h"
+#include "ace/Thread_Mutex.h"
+#include "ace/Atomic_Op.h"
+
+// Debugging macros
+#ifndef TAO_NOTIFY_REFCOUNT_DIAGNOSTICS
+#define TAO_NOTIFY_REFCOUNT_DIAGNOSTICS 0
+#endif
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Refcountable
+ *
+ * @brief Thread-safe refounting, calls the <release> method when refcount falls to 0.
+ *
+ * The refcount is initialized to 0. When an instance of a
+ * derived class becomes owned by a managed pointer
+ * (Refcountable_Guard_T) the reference count becomes non-zero.
+ *
+ * Instances declared on the stack should always have a
+ * refcount of zero.
+ *
+ * A method that creates or simply returns an instance of
+ * Refcountable should not increment the reference count. It is
+ * the responsibility of the client to increment the reference
+ * count (take ownership or guard against deletion). The client
+ * cannot know if the method will or will not incr the refcount
+ * on its behalf.
+ *
+ * Use Refcountable_Guard_T or similar service to guarantee the
+ * exception safe direct pairing of increments and decrements. Avoid
+ * calling _incr_refcnt and _decr_refcnt.
+ */
+
+class TAO_Notify_Serv_Export TAO_Notify_Refcountable
+{
+public:
+ typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_Refcountable > Ptr;
+
+ /// Constructor
+ TAO_Notify_Refcountable (void);
+
+ /// Destructor
+ /// public for stack allocated instances
+ virtual ~TAO_Notify_Refcountable ();
+
+ /// This method sigantures deliberately match the RefCounting methods required for ESF Proxy
+ /// Public for bridge implementations and various guard classes
+ CORBA::ULong _incr_refcnt (void);
+ CORBA::ULong _decr_refcnt (void);
+
+#if ( TAO_NOTIFY_REFCOUNT_DIAGNOSTICS != 0 )
+ static void diagnostic_dump( const char* title = 0 );
+#endif
+
+private:
+ /// The release method is called when the refcount reaches 0.
+ virtual void release (void) = 0;
+
+ // Use a signed counter so that we can more easily detect
+ // boundary conditions such as too many _decr_refcnt() calls.
+ ACE_Atomic_Op<TAO_SYNCH_MUTEX, CORBA::Long> refcount_;
+
+#if ( TAO_NOTIFY_REFCOUNT_DIAGNOSTICS != 0 )
+ friend class TAO_Notify_Tracker;
+ int ref_id_;
+#endif
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_REFCOUNTABLE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.cpp
new file mode 100644
index 00000000000..9f037fef711
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.cpp
@@ -0,0 +1,14 @@
+// $Id$
+
+#ifndef TAO_Notify_REFCOUNTABLE_GUARD_T_CPP
+#define TAO_Notify_REFCOUNTABLE_GUARD_T_CPP
+
+#include "orbsvcs/Notify/Refcountable_Guard_T.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Refcountable_Guard_T.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Notify, TAO_Notify_Refcountable_Guard_T, "$Id$")
+
+#endif /* TAO_Notify_REFCOUNTABLE_GUARD_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h
new file mode 100644
index 00000000000..67e8bd8bdbc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h
@@ -0,0 +1,89 @@
+// -*- C++ -*-
+
+/**
+ * @file Refcountable_Guard_T.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_REFCOUNTABLE_GUARD_T_H
+#define TAO_Notify_REFCOUNTABLE_GUARD_T_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Refcountable_Guard_T
+ *
+ * @brief Increments the reference count in the constructor, the count is decremented in the destructor.
+ * See Refcountable.h for further notes on usage.
+ *
+ */
+template <class T>
+class TAO_Notify_Refcountable_Guard_T
+{
+public:
+ /// Constuctor
+ explicit TAO_Notify_Refcountable_Guard_T (T* t = 0);
+
+ /// Copy constructor
+ TAO_Notify_Refcountable_Guard_T (const TAO_Notify_Refcountable_Guard_T<T>& rhs);
+
+ /// Destructor
+ ~TAO_Notify_Refcountable_Guard_T ();
+
+ /// Redirection operator
+ T* get (void) const;
+
+ /// Boolean test
+ bool isSet (void) const;
+
+ /// Redirection operator
+ T* operator -> (void) const;
+
+ /// Dereference operator
+ T& operator * () const;
+
+ /// Reassignment
+ void reset (T* t = 0);
+
+ // There is no logical release. Release could return an invalid object.
+
+ /// Assignment
+ TAO_Notify_Refcountable_Guard_T<T>& operator = (
+ const TAO_Notify_Refcountable_Guard_T<T>& rhs);
+
+private:
+ void swap( TAO_Notify_Refcountable_Guard_T<T>& rhs );
+
+ T* t_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Refcountable_Guard_T.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Notify/Refcountable_Guard_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Refcountable_Guard_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_REFCOUNTABLE_GUARD_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl
new file mode 100644
index 00000000000..4ab55e0b75f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "ace/Log_Msg.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class T> ACE_INLINE
+TAO_Notify_Refcountable_Guard_T<T>::TAO_Notify_Refcountable_Guard_T (T *t)
+ : t_ (t)
+{
+ if ( this->t_ != static_cast< T* >( 0 ) ) this->t_->_incr_refcnt();
+}
+
+template <class T> ACE_INLINE
+TAO_Notify_Refcountable_Guard_T<T>::TAO_Notify_Refcountable_Guard_T (const TAO_Notify_Refcountable_Guard_T<T> &rhs)
+ : t_ (rhs.t_)
+{
+ if ( this->t_ != static_cast< T* >( 0 ) ) this->t_->_incr_refcnt();
+}
+
+template <class T> ACE_INLINE
+TAO_Notify_Refcountable_Guard_T<T>::~TAO_Notify_Refcountable_Guard_T ()
+{
+ if ( this->t_ != static_cast< T* >( 0 ) ) this->t_->_decr_refcnt();
+}
+
+template <class T> ACE_INLINE
+T*
+TAO_Notify_Refcountable_Guard_T<T>::get (void) const
+{
+ return this->t_;
+}
+
+template <class T> ACE_INLINE
+bool
+TAO_Notify_Refcountable_Guard_T<T>::isSet (void) const
+{
+ return ( this->t_ != static_cast< T* >( 0 ) );
+}
+
+
+template <class T> ACE_INLINE
+T*
+TAO_Notify_Refcountable_Guard_T<T>::operator-> (void) const
+{
+ ACE_ASSERT ( this->t_ != static_cast< T* >( 0 ) );
+ return this->t_;
+}
+
+template <class T> ACE_INLINE
+T&
+TAO_Notify_Refcountable_Guard_T<T>::operator* (void) const
+{
+ ACE_ASSERT ( this->t_ != static_cast< T* >( 0 ) );
+ return *this->t_;
+}
+
+template <class T> ACE_INLINE
+TAO_Notify_Refcountable_Guard_T<T> &
+TAO_Notify_Refcountable_Guard_T<T>::operator = (
+ const TAO_Notify_Refcountable_Guard_T<T> & rhs)
+{
+ reset( rhs.t_ );
+ return *this;
+}
+
+
+template <class T> ACE_INLINE
+void
+TAO_Notify_Refcountable_Guard_T<T>::reset (T* t)
+{
+ if (this->t_ != t)
+ {
+ TAO_Notify_Refcountable_Guard_T<T> temp( t );
+ swap( temp );
+ }
+}
+
+template <class T> ACE_INLINE
+void
+TAO_Notify_Refcountable_Guard_T<T>::swap(
+ TAO_Notify_Refcountable_Guard_T<T>& rhs )
+{
+ T* temp = this->t_;
+ this->t_ = rhs.t_;
+ rhs.t_ = temp;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip.cpp b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip.cpp
new file mode 100644
index 00000000000..eb101ef2105
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip.cpp
@@ -0,0 +1,933 @@
+// $Id$
+
+#include "orbsvcs/Notify/Routing_Slip.h"
+
+#include "orbsvcs/Notify/Delivery_Request.h"
+#include "orbsvcs/Notify/Worker_Task.h"
+#include "orbsvcs/Notify/ProxyConsumer.h"
+#include "orbsvcs/Notify/ProxySupplier.h"
+#include "orbsvcs/Notify/Event_Persistence_Strategy.h"
+#include "orbsvcs/Notify/Routing_Slip_Persistence_Manager.h"
+#include "orbsvcs/Notify/Routing_Slip_Queue.h"
+#include "orbsvcs/Notify/Method_Request_Lookup.h"
+#include "orbsvcs/Notify/Method_Request_Dispatch.h"
+
+#include "tao/debug.h"
+#include "tao/corba.h"
+
+#include "ace/Dynamic_Service.h"
+
+//#define DEBUG_LEVEL 9
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+#define QUEUE_ALLOWED 1
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+///////////////////////
+// Routing_Slip Statics
+
+Routing_Slip_Queue Routing_Slip::persistent_queue_(QUEUE_ALLOWED);
+
+TAO_SYNCH_MUTEX Routing_Slip::sequence_lock_;
+int Routing_Slip::routing_slip_sequence_= 0;
+size_t Routing_Slip::count_enter_transient_ = 0;
+size_t Routing_Slip::count_continue_transient_ = 0;
+size_t Routing_Slip::count_enter_reloaded_ = 0;
+size_t Routing_Slip::count_enter_new_ = 0;
+size_t Routing_Slip::count_continue_new_ = 0;
+size_t Routing_Slip::count_enter_complete_while_new_ = 0;
+size_t Routing_Slip::count_enter_saving_ = 0;
+size_t Routing_Slip::count_enter_saved_ = 0;
+size_t Routing_Slip::count_enter_updating_ = 0;
+size_t Routing_Slip::count_enter_changed_while_saving_ = 0;
+size_t Routing_Slip::count_continue_changed_while_saving_ = 0;
+size_t Routing_Slip::count_enter_changed_ = 0;
+size_t Routing_Slip::count_continue_changed_ = 0;
+size_t Routing_Slip::count_enter_complete_ = 0;
+size_t Routing_Slip::count_enter_deleting_ = 0;
+size_t Routing_Slip::count_enter_terminal_ = 0;
+
+Routing_Slip_Ptr
+Routing_Slip::create (const TAO_Notify_Event::Ptr& event ACE_ENV_ARG_DECL)
+{
+ Routing_Slip * prs;
+ ACE_NEW_THROW_EX (prs, Routing_Slip (event), CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (Routing_Slip_Ptr());
+ Routing_Slip_Ptr result(prs);
+ result->this_ptr_ = result; // let the pointers touch so they use the same ref count
+
+ // note we don't care about ultra-precise stats, so no guard for these
+ if (DEBUG_LEVEL > 8 && ((result->sequence_ % 100) == 0))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Routing_Slip_Statistics\n")
+ ACE_TEXT (" enter_transient \t%d\n")
+ ACE_TEXT (" continue_transient \t%d\n")
+ ACE_TEXT (" enter_reloaded \t%d\n")
+ ACE_TEXT (" enter_new \t%d\n")
+ ACE_TEXT (" continue_new \t%d\n")
+ ACE_TEXT (" enter_complete_while_new \t%d\n")
+ ACE_TEXT (" enter_saving \t%d\n")
+ ACE_TEXT (" enter_saved \t%d\n")
+ ACE_TEXT (" enter_updating \t%d\n")
+ ACE_TEXT (" enter_changed_while_saving \t%d\n")
+ ACE_TEXT (" continue_changed_while_saving\t%d\n")
+ ACE_TEXT (" enter_changed \t%d\n")
+ ACE_TEXT (" continue_changed \t%d\n")
+ ACE_TEXT (" enter_complete \t%d\n")
+ ACE_TEXT (" enter_deleting \t%d\n")
+ ACE_TEXT (" enter_terminal \t%d\n")
+ , static_cast<int> (count_enter_transient_)
+ , static_cast<int> (count_continue_transient_)
+ , static_cast<int> (count_enter_reloaded_)
+ , static_cast<int> (count_enter_new_)
+ , static_cast<int> (count_continue_new_)
+ , static_cast<int> (count_enter_complete_while_new_)
+ , static_cast<int> (count_enter_saving_)
+ , static_cast<int> (count_enter_saved_)
+ , static_cast<int> (count_enter_updating_)
+ , static_cast<int> (count_enter_changed_while_saving_)
+ , static_cast<int> (count_continue_changed_while_saving_)
+ , static_cast<int> (count_enter_changed_)
+ , static_cast<int> (count_continue_changed_)
+ , static_cast<int> (count_enter_complete_)
+ , static_cast<int> (count_enter_deleting_)
+ , static_cast<int> (count_enter_terminal_)
+ ));
+ }
+ return result;
+}
+
+// static
+Routing_Slip_Ptr
+Routing_Slip::create (
+ TAO_Notify_EventChannelFactory & ecf,
+ Routing_Slip_Persistence_Manager * rspm)
+{
+ Routing_Slip_Ptr result;
+ ACE_Message_Block * event_mb = 0;
+ ACE_Message_Block * rs_mb = 0;
+ ACE_DECLARE_NEW_ENV;
+ ACE_TRY
+ {
+ if (rspm->reload (event_mb, rs_mb))
+ {
+ TAO_InputCDR cdr_event (event_mb);
+ TAO_Notify_Event::Ptr event (TAO_Notify_Event::unmarshal (cdr_event));
+ if (event.isSet())
+ {
+ result = create (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ TAO_InputCDR cdr_rs (rs_mb);
+ if ( result->unmarshal (ecf, cdr_rs))
+ {
+ result->set_rspm (rspm);
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Routing_Slip::create: Unmarshalling failed for routing slip.\n")
+ ));
+ result.reset ();
+ }
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Routing_Slip::create: Unmarshalling failed for event.\n")
+ ));
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Routing_Slip::create: Exception reloading event.\n")
+ ));
+ }
+ ACE_ENDTRY;
+ delete event_mb;
+ delete rs_mb;
+
+ return result;
+}
+
+void
+Routing_Slip::set_rspm (Routing_Slip_Persistence_Manager * rspm)
+{
+ this->rspm_ = rspm;
+ if (rspm_ != 0)
+ {
+ rspm->set_callback (this);
+ }
+}
+
+Routing_Slip::Routing_Slip(
+ const TAO_Notify_Event::Ptr& event)
+ : is_safe_ (false)
+ , until_safe_ (internals_)
+ , this_ptr_ (0)
+ , event_(event)
+ , state_ (rssCREATING)
+ , complete_requests_ (0)
+ , rspm_ (0)
+{
+ Routing_Slip_Guard guard (sequence_lock_);
+ this->sequence_ = ++routing_slip_sequence_;
+ if (DEBUG_LEVEL > 1) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: constructor\n"),
+ this->sequence_
+ ));
+}
+
+Routing_Slip::~Routing_Slip ()
+{
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: destructor\n"),
+ this->sequence_
+ ));
+}
+
+bool
+Routing_Slip::create_persistence_manager()
+{
+ if (this->rspm_ == 0)
+ {
+ Event_Persistence_Strategy * strategy =
+ ACE_Dynamic_Service <TAO_Notify::Event_Persistence_Strategy>::instance ("Event_Persistence");
+ if (strategy != 0)
+ {
+ Event_Persistence_Factory * factory = strategy->get_factory ();
+ if (factory != 0)
+ {
+ set_rspm (factory->create_routing_slip_persistence_manager(this));
+ }
+ }
+ }
+ return this->rspm_ != 0;
+}
+
+const TAO_Notify_Event::Ptr &
+Routing_Slip::event () const
+{
+ return this->event_;
+}
+
+void
+Routing_Slip::wait_persist ()
+{
+ Routing_Slip_Guard guard (this->internals_);
+ while (!this->is_safe_)
+ {
+ this->until_safe_.wait ();
+ }
+}
+
+void
+Routing_Slip::route (TAO_Notify_ProxyConsumer* pc, bool reliable_channel ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT(pc != 0);
+
+ TAO_Notify_ProxyConsumer::Ptr pcgrd(pc);
+
+ Routing_Slip_Guard guard (this->internals_);
+
+ size_t request_id = delivery_requests_.size ();
+
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: add Delivery_Request #%d: lookup, completed %d of %d\n"),
+ this->sequence_,
+ static_cast<int> (request_id),
+ static_cast<int> (this->complete_requests_),
+ static_cast<int> (this->delivery_requests_.size ())
+ ));
+
+ Delivery_Request_Ptr request (new Delivery_Request (this->this_ptr_, request_id));
+ this->delivery_requests_.push_back (request);
+ TAO_Notify_Method_Request_Lookup_Queueable method (request, pc);
+
+ if (this->state_ == rssCREATING)
+ {
+ if (! reliable_channel)
+ {
+ enter_state_transient (guard);
+ }
+ else if (ACE_Dynamic_Service <TAO_Notify::Event_Persistence_Strategy>::instance ("Event_Persistence") == 0)
+ {
+ enter_state_transient (guard);
+ }
+ else if (! this->event_->reliable().is_valid())
+ {
+ enter_state_new (guard);
+ }
+ else if (this->event_->reliable().value() == CosNotification::Persistent)
+ {
+ enter_state_new (guard);
+ }
+ else
+ {
+ enter_state_transient (guard);
+ }
+ }
+ guard.release ();
+ pc->execute_task (method ACE_ENV_ARG_PARAMETER);
+}
+#if 0 // forward
+void
+Routing_Slip::forward (TAO_Notify_ProxySupplier* ps, bool filter)
+{
+ // must be the first action
+ ACE_ASSERT (this->state_ == rssCREATING);
+
+ TAO_Notify_ProxySupplier::Ptr psgrd(ps);
+ Routing_Slip_Guard guard (this->internals_);
+
+ enter_state_transient (guard);
+ size_t request_id = delivery_requests_.size ();
+
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: add Delivery_Request #%d: Forward %s; completed %d of %d\n"),
+ this->sequence_,
+ static_cast<int> (request_id),
+ filter ? ACE_TEXT ("Filter") : ACE_TEXT ("No Filter"),
+ static_cast<int> (this->complete_requests_),
+ static_cast<int> (this->delivery_requests_.size ())
+ ));
+
+ Delivery_Request_Ptr request (new Delivery_Request (this->this_ptr_, request_id));
+ if (! ps->has_shutdown() )
+ {
+ this->delivery_requests_.push_back (request);
+// Delivery_Method_Dispatch method (request, ps, filter);
+ TAO_Notify_Method_Request_Dispatch_No_Copy method (request, ps, filter);
+ guard.release ();
+ if (DEBUG_LEVEL > 8)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Routing Slip #%d: dispatching Delivery_Request %d to "
+ "proxy supplier %d\n",
+ this->sequence_,
+ static_cast<int> (request_id),
+ ps->id()));
+ ps->worker_task()->execute (method);
+ }
+ else
+ {
+ if (DEBUG_LEVEL > 5)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Routing Slip #%d: not dispatching Delivery_Request %d to "
+ "proxy supplier %d; already shut down\n",
+ this->sequence_,
+ static_cast<int> (request_id),
+ ps->id()));
+ }
+}
+#endif // forward
+
+void
+Routing_Slip::dispatch (
+ TAO_Notify_ProxySupplier* ps,
+ bool filter
+ ACE_ENV_ARG_DECL)
+{
+ // cannot be the first action
+ ACE_ASSERT (this->state_ != rssCREATING);
+
+ TAO_Notify_ProxySupplier::Ptr psgrd(ps);
+ Routing_Slip_Guard guard (this->internals_);
+
+ size_t request_id = delivery_requests_.size ();
+
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: add Delivery_Request #%d: Dispatch %s; completed %d of %d\n"),
+ this->sequence_,
+ static_cast<int> (request_id),
+ filter ? ACE_TEXT ("Filter") : ACE_TEXT ("No Filter"),
+ static_cast<int> (this->complete_requests_),
+ static_cast<int> (this->delivery_requests_.size ())
+ ));
+
+ Delivery_Request_Ptr request (new Delivery_Request (this->this_ptr_, request_id));
+ if (! ps->has_shutdown() )
+ {
+ this->delivery_requests_.push_back (request);
+ TAO_Notify_Method_Request_Dispatch_No_Copy method (request, ps, filter);
+ guard.release ();
+ if (DEBUG_LEVEL > 8)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Routing Slip #%d: dispatching Delivery_Request %d to "
+ "proxy supplier %d\n",
+ this->sequence_,
+ static_cast<int> (request_id),
+ ps->id()));
+ ps->execute_task (method ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ if (DEBUG_LEVEL > 5)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Routing Slip #%d: not dispatching Delivery_Request %d to "
+ "proxy supplier %d; already shut down\n",
+ this->sequence_,
+ static_cast<int> (request_id),
+ ps->id()));
+ }
+}
+
+//////////
+// signals
+
+void
+Routing_Slip::delivery_request_complete (size_t request_id)
+{
+ Routing_Slip_Guard guard (this->internals_);
+ ACE_ASSERT (request_id < this->delivery_requests_.size ());
+ // reset the pointer to allow the delivery_request to be deleted.
+ this->delivery_requests_[request_id].reset ();
+ this->complete_requests_ += 1;
+
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: delivery_request_complete #%d: completed %d of %d\n"),
+ this->sequence_,
+ static_cast<int> (request_id),
+ static_cast<int> (this->complete_requests_),
+ static_cast<int> (this->delivery_requests_.size ())
+ ));
+ State state = this->state_;
+ switch (state)
+ {
+ case rssTRANSIENT:
+ {
+ continue_state_transient (guard);
+ break;
+ }
+ case rssNEW:
+ {
+ continue_state_new (guard);
+ break;
+ }
+ case rssSAVING:
+ {
+ enter_state_changed_while_saving (guard);
+ break;
+ }
+ case rssUPDATING:
+ {
+ enter_state_changed_while_saving (guard);
+ break;
+ }
+ case rssSAVED:
+ {
+ enter_state_changed (guard);
+ break;
+ }
+ case rssCHANGED_WHILE_SAVING:
+ {
+ continue_state_changed_while_saving (guard);
+ break;
+ }
+ case rssCHANGED:
+ {
+ continue_state_changed (guard);
+ break;
+ }
+ default:
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Notification Service Routing Slip: Unexpected delivery_request_complete in state %d\n"),
+ static_cast<int> (this->state_)
+ ));
+ break;
+ }
+ }
+}
+
+void
+Routing_Slip::at_front_of_persist_queue ()
+{
+ Routing_Slip_Guard guard (this->internals_);
+ State state = this->state_;
+ switch (state)
+ {
+ case rssNEW:
+ {
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: NEW Reached front of queue\n"),
+ this->sequence_
+ ));
+ enter_state_saving (guard);
+ break;
+ }
+ case rssCOMPLETE_WHILE_NEW:
+ {
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: COMPLETE_WHILE_NEW Reached front of queue\n"),
+ this->sequence_
+ ));
+ this->persistent_queue_.complete ();
+ enter_state_terminal (guard);
+ break;
+ }
+ case rssCHANGED:
+ {
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: CHANGED Reached front of queue\n"),
+ this->sequence_
+ ));
+ enter_state_updating (guard);
+ break;
+ }
+ case rssCOMPLETE:
+ {
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: COMPLETE Reached front of queue\n"),
+ this->sequence_
+ ));
+ enter_state_deleting (guard);
+ break;
+ }
+ default:
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Routing Slip %d: Unexpected at_front_of_persist_queue in state %d\n"),
+ this->sequence_,
+ static_cast<int> (this->state_)
+ ));
+ break;
+ }
+ }
+}
+
+void
+Routing_Slip::persist_complete ()
+{
+ // keep this object around til this method returns.
+ Routing_Slip_Ptr me(this->this_ptr_);
+ Routing_Slip_Guard guard (this->internals_);
+ ACE_ASSERT (guard.locked ());
+
+ // allow the ConsumerProxy to return from the CORBA push call.
+ if (! is_safe_)
+ {
+ is_safe_ = true;
+ this->until_safe_.signal ();
+ }
+
+ State state = this->state_;
+ switch (state)
+ {
+ case rssSAVING:
+ {
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: SAVING persist complete\n"),
+ this->sequence_
+ ));
+ enter_state_saved(guard);
+ break;
+ }
+ case rssCHANGED_WHILE_SAVING:
+ {
+ enter_state_changed (guard);
+ break;
+ }
+ case rssUPDATING:
+ {
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: UPDATING persist complete\n"),
+ this->sequence_
+ ));
+ enter_state_saved (guard);
+ break;
+ }
+ case rssDELETING:
+ {
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: DELETING persist complete\n"),
+ this->sequence_
+ ));
+ enter_state_terminal (guard);
+ break;
+ }
+ default:
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Notification Service Routing Slip: Unexpected transition in state %d\n"),
+ static_cast<int> (this->state_)
+ ));
+ break;
+ }
+ }
+ this->persistent_queue_.complete ();
+}
+
+//////////////////
+// support methods
+
+bool
+Routing_Slip::all_deliveries_complete () const
+{
+ return this->complete_requests_ == this->delivery_requests_.size ();
+}
+
+void
+Routing_Slip::add_to_persist_queue(Routing_Slip_Guard & guard)
+{
+ guard.release ();
+ this->persistent_queue_.add (this->this_ptr_);
+ guard.acquire (); // necessary?
+}
+
+////////////////////
+// State transitions
+
+void
+Routing_Slip::enter_state_new (Routing_Slip_Guard & guard)
+{
+ ++count_enter_new_;
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: enter state NEW\n"),
+ this->sequence_
+ ));
+ this->state_ = rssNEW;
+ add_to_persist_queue(guard);
+}
+
+void
+Routing_Slip::continue_state_new (Routing_Slip_Guard & guard)
+{
+ ++count_continue_new_;
+ if (all_deliveries_complete ())
+ {
+ this->enter_state_complete_while_new (guard);
+ }
+}
+void
+Routing_Slip::enter_state_complete_while_new (Routing_Slip_Guard & guard)
+{
+ ++count_enter_complete_while_new_;
+ ACE_UNUSED_ARG (guard);
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: enter state COMPLETE_WHILE_NEW\n"),
+ this->sequence_
+ ));
+ // allow the ConsumerProxy to return from the CORBA push call.
+ if (! is_safe_)
+ {
+ is_safe_ = true;
+ this->until_safe_.signal ();
+ }
+ this->state_ = rssCOMPLETE_WHILE_NEW;
+}
+
+void
+Routing_Slip::enter_state_reloaded (Routing_Slip_Guard & guard)
+{
+ ++count_enter_reloaded_;
+ ACE_UNUSED_ARG (guard);
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #&d: enter state RELOADED\n"),
+ this->sequence_
+ ));
+ this->state_ = rssRELOADED;
+}
+
+void
+Routing_Slip::enter_state_transient (Routing_Slip_Guard & guard)
+{
+ ++count_enter_transient_;
+ ACE_UNUSED_ARG (guard);
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: enter state TRANSIENT\n"),
+ this->sequence_
+ ));
+ this->state_ = rssTRANSIENT;
+ if (! is_safe_)
+ {
+ is_safe_ = true;
+ this->until_safe_.signal ();
+ }
+ if (all_deliveries_complete ())
+ {
+ enter_state_terminal (guard);
+ }
+}
+
+void
+Routing_Slip::continue_state_transient (Routing_Slip_Guard & guard)
+{
+ ++count_continue_transient_;
+ if (all_deliveries_complete ())
+ {
+ enter_state_terminal (guard);
+ }
+}
+void
+Routing_Slip::enter_state_saving (Routing_Slip_Guard & guard)
+{
+ ++count_enter_saving_;
+ if (!create_persistence_manager ())
+ {
+ // Note This should actually be a throw (out of memory)
+ // but we cheat and make this a transient event.
+ this->persistent_queue_.complete ();
+ enter_state_transient (guard);
+ }
+ else
+ {
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: enter state SAVING\n"),
+ this->sequence_
+ ));
+ this->state_ = rssSAVING;
+
+ TAO_OutputCDR event_cdr;
+ this->event_->marshal (event_cdr);
+
+ const ACE_Message_Block *event_mb = event_cdr.begin ();
+ TAO_OutputCDR rs_cdr;
+ marshal (rs_cdr);
+ const ACE_Message_Block *rs_mb = rs_cdr.begin ();
+
+ guard.release ();
+ this->rspm_->store (*event_mb, *rs_mb);
+
+ guard.acquire (); // necessary?
+ }
+}
+
+void
+Routing_Slip::enter_state_saved (Routing_Slip_Guard & guard)
+{
+ ++count_enter_saved_;
+ ACE_UNUSED_ARG (guard);
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: enter state SAVED\n"),
+ this->sequence_
+ ));
+ this->state_ = rssSAVED;
+}
+
+void
+Routing_Slip::enter_state_updating (Routing_Slip_Guard & guard)
+{
+ ++count_enter_updating_;
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: enter state UPDATING\n"),
+ this->sequence_
+ ));
+ this->state_ = rssUPDATING;
+
+ TAO_OutputCDR rs_cdr;
+ marshal (rs_cdr);
+ const ACE_Message_Block *rs_mb = rs_cdr.begin ();
+ guard.release ();
+
+ ACE_ASSERT (this->rspm_ != 0);
+ this->rspm_->update (*rs_mb);
+ guard.acquire (); // necessary?
+}
+
+
+void
+Routing_Slip::enter_state_changed_while_saving (Routing_Slip_Guard & guard)
+{
+ ++count_enter_changed_while_saving_;
+ ACE_UNUSED_ARG (guard);
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: enter state CHANGED_WHILE_SAVING\n"),
+ this->sequence_
+ ));
+ this->state_ = rssCHANGED_WHILE_SAVING;
+}
+
+void
+Routing_Slip::continue_state_changed_while_saving (Routing_Slip_Guard & guard)
+{
+ ACE_UNUSED_ARG (guard);
+ // no action necessary
+}
+
+void
+Routing_Slip::enter_state_changed (Routing_Slip_Guard & guard)
+{
+ ++count_enter_changed_;
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: enter state CHANGED\n"),
+ this->sequence_
+ ));
+ // complete state change BEFORE initiating request to avoid
+ // race condition if request finishes before state is stable.
+ this->state_ = rssCHANGED;
+ if (all_deliveries_complete ())
+ {
+ enter_state_complete (guard);
+ }
+ add_to_persist_queue (guard);
+}
+
+void
+Routing_Slip::continue_state_changed (Routing_Slip_Guard & guard)
+{
+ ++count_continue_changed_;
+ if (all_deliveries_complete ())
+ {
+ enter_state_complete (guard);
+ }
+}
+
+void
+Routing_Slip::enter_state_complete (Routing_Slip_Guard & guard)
+{
+ ++count_enter_complete_;
+ ACE_UNUSED_ARG (guard);
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: enter state COMPLETE\n"),
+ this->sequence_
+ ));
+ this->state_ = rssCOMPLETE;
+}
+
+void
+Routing_Slip::enter_state_deleting (Routing_Slip_Guard & guard)
+{
+ ++count_enter_deleting_;
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: enter state DELETING\n"),
+ this->sequence_
+ ));
+ this->state_ = rssDELETING;
+ guard.release ();
+ this->rspm_->remove ();
+ guard.acquire (); // necessary?
+}
+
+void
+Routing_Slip::enter_state_terminal (Routing_Slip_Guard & guard)
+{
+ ++count_enter_terminal_;
+ ACE_UNUSED_ARG (guard);
+ ACE_ASSERT( this->is_safe_);
+ if (DEBUG_LEVEL > 8) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Routing Slip #%d: enter state TERMINAL\n"),
+ this->sequence_
+ ));
+ this->state_ = rssTERMINAL;
+ this->this_ptr_.reset ();
+}
+
+void
+Routing_Slip::marshal (TAO_OutputCDR & cdr)
+{
+ size_t request_count = this->delivery_requests_.size();
+ cdr.write_ulong (request_count - this->complete_requests_);
+ for (size_t nreq = 0; nreq < request_count; ++nreq)
+ {
+ Delivery_Request * request = this->delivery_requests_[nreq].get ();
+ if (request != 0)
+ {
+ request->marshal (cdr);
+ }
+ }
+}
+
+bool
+Routing_Slip::unmarshal (TAO_Notify_EventChannelFactory &ecf, TAO_InputCDR & cdr)
+{
+ CORBA::ULong count = 0;
+ cdr.read_ulong (count);
+ for (size_t nreq = 0; nreq < count; ++nreq)
+ {
+ ACE_CDR::Octet code = 0;
+ while (cdr.read_octet(code))
+ {
+ ACE_DECLARE_NEW_ENV;
+ ACE_TRY
+ {
+ if (code == TAO_Notify_Method_Request_Dispatch::persistence_code)
+ {
+ Delivery_Request * prequest;
+ ACE_NEW_THROW_EX (
+ prequest,
+ Delivery_Request(this_ptr_, this->delivery_requests_.size ()),
+ CORBA::NO_MEMORY ());
+ ACE_TRY_CHECK;
+ Delivery_Request_Ptr request(prequest);
+ TAO_Notify_Method_Request_Dispatch_Queueable * method =
+ TAO_Notify_Method_Request_Dispatch::unmarshal (
+ request,
+ ecf,
+ cdr
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (method != 0)
+ {
+ this->delivery_requests_.push_back (request);
+ this->delivery_methods_.push_back (method);
+ }
+ }
+ else if (code == TAO_Notify_Method_Request_Lookup::persistence_code)
+ {
+ Delivery_Request_Ptr request(new Delivery_Request(this_ptr_, this->delivery_requests_.size ()));
+ TAO_Notify_Method_Request_Lookup_Queueable * method =
+ TAO_Notify_Method_Request_Lookup::unmarshal (
+ request,
+ ecf,
+ cdr
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK
+ if (method != 0)
+ {
+ this->delivery_requests_.push_back (request);
+ this->delivery_methods_.push_back (method);
+ }
+ }
+ }
+ ACE_CATCHANY;
+ {
+ // @@todo should we log this?
+ // just ignore failures
+ }
+ ACE_ENDTRY;
+ }
+ }
+ return this->delivery_requests_.size () > 0;
+}
+
+void
+Routing_Slip::reconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ Routing_Slip_Guard guard (this->internals_);
+ enter_state_saved (guard);
+ guard.release ();
+ //@@todo is there a worker_task available to do this?
+ size_t count = this->delivery_methods_.size ();
+ for (size_t nmethod = 0; nmethod < count; ++nmethod)
+ {
+ this->delivery_methods_[nmethod]->execute (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ this->delivery_methods_.clear ();
+}
+
+int
+Routing_Slip::sequence() const
+{
+ return this->sequence_;
+}
+
+bool
+Routing_Slip::should_retry () const
+{
+ // simple minded test: if it's transient, don't retry it
+ // @@todo Eventually this should check timeout, discard policy, etc.
+ return this->state_ != rssTRANSIENT;
+}
+
+} // namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip.h b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip.h
new file mode 100644
index 00000000000..5670dfc1d05
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip.h
@@ -0,0 +1,242 @@
+// -*- C++ -*-
+
+/**
+ * @file Routing_Slip.h
+ *
+ * $Id$
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+
+#ifndef TAO_NOTIFY_ROUTING_SLIP_H
+#define TAO_NOTIFY_ROUTING_SLIP_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+#include "orbsvcs/Notify/Event.h"
+#include "orbsvcs/Notify/Delivery_Request.h"
+#include "orbsvcs/Notify/Event_Persistence_Factory.h"
+
+#include "orbsvcs/Notify/Persistent_File_Allocator.h" // for Persistent_Callback
+
+#include <ace/Vector_T.h>
+#include <ace/Malloc_Base.h> // necessary?
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward declarations of classes/pointers/collections
+// referenced from this header
+class TAO_Notify_EventChannelFactory;
+class TAO_Notify_Method_Request;
+class TAO_Notify_ProxyConsumer;
+class TAO_Notify_ProxySupplier;
+class TAO_Notify_Method_Request_Queueable;
+
+namespace TAO_Notify
+{
+
+class Routing_Slip_Persistence_Manager;
+
+// Forward declarations of TAO_Notify classes/pointers/collections
+// referenced from this header
+
+/// A vector of Delivery Requests. The body of a Routing_Slip.
+typedef ACE_Vector <Delivery_Request_Ptr> Delivery_Request_Vec;
+
+/// A vector of Methods_. Used during recovery.
+typedef ACE_Vector <TAO_Notify_Method_Request_Queueable *> Delivery_Method_Vec;
+
+class Routing_Slip;
+/// A reference-counted smart pointer to a Routing_Slip
+typedef ACE_Strong_Bound_Ptr<Routing_Slip, TAO_SYNCH_MUTEX> Routing_Slip_Ptr;
+
+class Routing_Slip_Persistence_Manager;
+
+class Routing_Slip_Queue;
+
+/**
+ * \brief Class which manages the delivery of events to destination.
+ *
+ * Interacts with persistent storage to provide reliable delivery.
+ */
+class TAO_Notify_Serv_Export Routing_Slip : public Persistent_Callback
+{
+ typedef ACE_Guard< TAO_SYNCH_MUTEX > Routing_Slip_Guard;
+public:
+ /// "Factory" method for normal use.
+ static Routing_Slip_Ptr create (const TAO_Notify_Event::Ptr& event
+ ACE_ENV_ARG_DECL);
+
+ /// "Factory" method for use during reload from persistent storage.
+ static Routing_Slip_Ptr create (
+ TAO_Notify_EventChannelFactory & ecf,
+ Routing_Slip_Persistence_Manager * rspm);
+
+ void set_rspm (Routing_Slip_Persistence_Manager * rspm);
+
+ void reconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// destructor (should be private but that inspires compiler wars)
+ virtual ~Routing_Slip ();
+
+ //////////////////
+ // Action requests
+
+ /// Route this event to destinations
+ /// must be the Action request after
+ /// the routing slip is created.
+ void route (TAO_Notify_ProxyConsumer* pc, bool reliable_channel ACE_ENV_ARG_DECL);
+
+ /// \brief Schedule delivery to a consumer via a proxy supplier
+ /// \param proxy_supplier the proxy supplier that will deliver the event
+ /// \param filter should consumer-based filtering be applied?
+ void dispatch (TAO_Notify_ProxySupplier * proxy_supplier, bool filter ACE_ENV_ARG_DECL);
+
+
+ /////////////////////////////////////////
+ /// \brief Wait until the event/routing_slip has
+ /// been saved at least once.
+ void wait_persist ();
+
+ /////////////////////////////////////
+ // signals from the rest of the world
+
+ /// \brief A delivery request has been satisfied.
+ void delivery_request_complete (size_t request_id);
+
+ /// \brief This Routing_Slip reached the front of the persistence queue
+ void at_front_of_persist_queue ();
+
+ /// \brief The persistent storage has completed the last request.
+ virtual void persist_complete ();
+
+ /////////////////////////////////////////////////////
+ // \brief Access the event associated with this routing slip
+ const TAO_Notify_Event::Ptr & event () const;
+
+ /// \brief Provide an identifying number for this Routing Slip
+ /// to use in debug messages.
+ int sequence() const;
+
+ /// \brief Should delivery of this event be retried if it fails?
+ bool should_retry () const;
+
+private:
+ ////////////////////
+ // state transitions
+ void enter_state_transient (Routing_Slip_Guard & guard);
+ void continue_state_transient (Routing_Slip_Guard & guard);
+ void enter_state_reloaded (Routing_Slip_Guard & guard);
+ void enter_state_new (Routing_Slip_Guard & guard);
+ void continue_state_new (Routing_Slip_Guard & guard);
+ void enter_state_complete_while_new (Routing_Slip_Guard & guard);
+ void enter_state_saving (Routing_Slip_Guard & guard);
+ void enter_state_saved (Routing_Slip_Guard & guard);
+ void enter_state_updating (Routing_Slip_Guard & guard);
+ void enter_state_changed_while_saving (Routing_Slip_Guard & guard);
+ void continue_state_changed_while_saving (Routing_Slip_Guard & guard);
+ void enter_state_changed (Routing_Slip_Guard & guard);
+ void continue_state_changed (Routing_Slip_Guard & guard);
+ void enter_state_complete (Routing_Slip_Guard & guard);
+ void enter_state_deleting (Routing_Slip_Guard & guard);
+ void enter_state_terminal (Routing_Slip_Guard & guard);
+
+private:
+ bool create_persistence_manager();
+
+ /// Private constructor for use by create method
+ Routing_Slip(const TAO_Notify_Event::Ptr& event);
+
+ /// Test to see if all deliveries are complete.
+ bool all_deliveries_complete () const;
+
+ /// This routing_slip needs to be saved.
+ void add_to_persist_queue(Routing_Slip_Guard & guard);
+
+ /// Marshal into a CDR
+ void marshal (TAO_OutputCDR & cdr);
+
+ /// Marshal from CDR
+ bool unmarshal (TAO_Notify_EventChannelFactory &ecf, TAO_InputCDR & rscdr);
+
+private:
+ /// Protection for internal information
+ TAO_SYNCH_MUTEX internals_;
+ /// true when event persistence qos is guaranteed
+ bool is_safe_;
+ /// signalled when is_safe_ goes true
+ ACE_SYNCH_CONDITION until_safe_;
+
+ /// Smart pointer to this object
+ /// Provides continuity between smart pointers and "Routing_Slip::this"
+ /// Also lets the Routing_Slip manage its own minimum lifetime.
+ Routing_Slip_Ptr this_ptr_;
+
+ // The event being delivered.
+ TAO_Notify_Event::Ptr event_;
+
+ /// A mini-state machine to control persistence
+ /// See external doc for circles and arrows.
+ enum State
+ {
+ rssCREATING,
+ rssTRANSIENT,
+ rssRELOADED,
+ rssNEW,
+ rssCOMPLETE_WHILE_NEW,
+ rssSAVING,
+ rssSAVED,
+ rssUPDATING,
+ rssCHANGED_WHILE_SAVING,
+ rssCHANGED,
+ rssCOMPLETE,
+ rssDELETING,
+ rssTERMINAL
+ } state_;
+
+ /// A collection of delivery requests
+ Delivery_Request_Vec delivery_requests_;
+
+ /// Methods that should be restarted during event recovery
+ Delivery_Method_Vec delivery_methods_;
+
+ /// How many delivery requests are complete
+ size_t complete_requests_;
+
+ /// Pointer to a Routing_Slip_Persistence_Manager
+ Routing_Slip_Persistence_Manager * rspm_;
+
+ int sequence_;
+
+ static TAO_SYNCH_MUTEX sequence_lock_;
+ static int routing_slip_sequence_;
+ static size_t count_enter_transient_;
+ static size_t count_continue_transient_;
+ static size_t count_enter_reloaded_;
+ static size_t count_enter_new_;
+ static size_t count_continue_new_;
+ static size_t count_enter_complete_while_new_;
+ static size_t count_enter_saving_;
+ static size_t count_enter_saved_;
+ static size_t count_enter_updating_;
+ static size_t count_enter_changed_while_saving_;
+ static size_t count_continue_changed_while_saving_;
+ static size_t count_enter_changed_;
+ static size_t count_continue_changed_;
+ static size_t count_enter_complete_;
+ static size_t count_enter_deleting_;
+ static size_t count_enter_terminal_;
+
+ static Routing_Slip_Queue persistent_queue_;
+};
+
+} // namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_NOTIFY_ROUTING_SLIP_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.cpp b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.cpp
new file mode 100644
index 00000000000..62915a67221
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.cpp
@@ -0,0 +1,804 @@
+// $Id$
+
+#include "orbsvcs/Notify/Routing_Slip_Persistence_Manager.h"
+#include "orbsvcs/Notify/Standard_Event_Persistence.h"
+#include "orbsvcs/Notify/Persistent_File_Allocator.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+
+Routing_Slip_Persistence_Manager::Routing_Slip_Persistence_Manager(
+ Standard_Event_Persistence_Factory* factory)
+ : removed_(false)
+ , serial_number_(0)
+ , allocator_(factory->allocator())
+ , factory_(factory)
+ , first_event_block_(0)
+ , first_routing_slip_block_(0)
+ , callback_(0)
+ , event_mb_ (0)
+ , routing_slip_mb_(0)
+{
+ this->prev_manager_ = this;
+ this->next_manager_ = this;
+}
+
+Routing_Slip_Persistence_Manager::~Routing_Slip_Persistence_Manager()
+{
+ ACE_ASSERT(this->prev_manager_ == this);
+ ACE_ASSERT(this->next_manager_ == this);
+ delete this->first_event_block_;
+ this->first_event_block_ = 0;
+ delete this->first_routing_slip_block_;
+ this->first_routing_slip_block_ = 0;
+ delete this->event_mb_;
+ this->event_mb_ = 0;
+ delete this->routing_slip_mb_;
+ this->routing_slip_mb_ = 0;
+}
+
+void
+Routing_Slip_Persistence_Manager::set_callback(Persistent_Callback* callback)
+{
+ ACE_GUARD(ACE_SYNCH_MUTEX, ace_mon, this->lock_);
+ this->callback_ = callback;
+}
+
+bool
+Routing_Slip_Persistence_Manager::store_root()
+{
+ bool result = false;
+
+ this->factory_->get_preallocated_pointer (
+ this->routing_slip_header_.next_serial_number,
+ this->routing_slip_header_.next_routing_slip_block);
+
+ // we should already have a psb, but JIC
+ ACE_ASSERT(this->first_routing_slip_block_ != 0);
+ ACE_ASSERT(this->first_routing_slip_block_->block_number() ==
+ ROUTING_SLIP_ROOT_BLOCK_NUMBER);
+
+ // Don't take any chances. Use hard-wired root serial number.
+ this->routing_slip_header_.serial_number = ROUTING_SLIP_ROOT_SERIAL_NUMBER;
+
+ // This will eventually break after something like 58000 years.
+ // At such time we should change this to !=.
+ ACE_ASSERT(this->routing_slip_header_.next_serial_number >
+ ROUTING_SLIP_ROOT_SERIAL_NUMBER);
+
+ ACE_Message_Block versioninfo(2);
+ versioninfo.wr_ptr()[0] = 1; // Major version number
+ versioninfo.wr_ptr()[1] = 0; // Minor version number
+ versioninfo.wr_ptr(2);
+ ACE_GUARD_RETURN(ACE_SYNCH_MUTEX, ace_mon, this->lock_, result);
+ result = this->build_chain(this->first_routing_slip_block_,
+ this->routing_slip_header_, this->allocated_routing_slip_blocks_,
+ versioninfo);
+ if (result)
+ {
+ this->routing_slip_header_.put_header(*this->first_routing_slip_block_);
+ this->allocator_->write(this->first_routing_slip_block_);
+ }
+ return result;
+}
+
+bool
+Routing_Slip_Persistence_Manager::reload(
+ ACE_Message_Block*& event,
+ ACE_Message_Block*& routing_slip)
+{
+ bool result = false;
+ if (this->event_mb_ != 0 && this->routing_slip_mb_ != 0)
+ {
+ event = this->event_mb_;
+ this->event_mb_ = 0;
+ routing_slip = this->routing_slip_mb_;
+ this->routing_slip_mb_ = 0;
+ result = true;
+ }
+ else
+ {
+ event = 0;
+ routing_slip = 0;
+ }
+ return result;
+}
+
+bool
+Routing_Slip_Persistence_Manager::load(
+ Block_Number block_number,
+ Block_Serial_Number expected_serial_number)
+{
+ /**
+ * NOTE: There is no need to worry about guarding anything. We assume
+ * that there will be one and only one thread doing the entire
+ * reload process.
+ */
+ bool result = false;
+ size_t block_size = this->allocator_->block_size();
+ this->first_routing_slip_block_ =
+ this->allocator_->allocate_at(block_number);
+ this->first_routing_slip_block_->set_allocator_owns(false);
+ this->first_routing_slip_block_->set_sync();
+
+ this->serial_number_ = expected_serial_number;
+
+ ACE_NEW_NORETURN(this->routing_slip_mb_, ACE_Message_Block(block_size));
+ ACE_NEW_NORETURN(this->event_mb_, ACE_Message_Block(block_size));
+ if (this->event_mb_ != 0 && this->routing_slip_mb_ != 0)
+ {
+ if (this->reload_chain(
+ this->first_routing_slip_block_,
+ this->routing_slip_header_,
+ this->allocated_routing_slip_blocks_,
+ this->routing_slip_mb_,
+ expected_serial_number))
+ {
+ if (this->routing_slip_header_.event_block != 0)
+ {
+ this->first_event_block_ = this->allocator_->allocate_at(
+ this->routing_slip_header_.event_block);
+ result = this->reload_chain(
+ this->first_event_block_,
+ this->event_header_,
+ this->allocated_event_blocks_,
+ this->event_mb_,
+ 0);
+ }
+ else if (block_number == ROUTING_SLIP_ROOT_BLOCK_NUMBER)
+ {
+ // only the root can lack event
+ result = true;
+ }
+ else
+ {
+ ACE_ERROR((LM_ERROR,
+ ACE_TEXT(
+ "(%P|%t) Reloaded Persistent Event is missing event.\n")
+ ));
+ }
+ }
+ }
+ if (! result)
+ {
+ delete this->routing_slip_mb_;
+ this->routing_slip_mb_ = 0;
+ delete this->event_mb_;
+ this->event_mb_ = 0;
+ }
+ return result;
+}
+
+Routing_Slip_Persistence_Manager *
+Routing_Slip_Persistence_Manager::load_next ()
+{
+ Routing_Slip_Persistence_Manager * result;
+ ACE_NEW_RETURN(result, Routing_Slip_Persistence_Manager (this->factory_), 0);
+
+ if (result->load(this->routing_slip_header_.next_routing_slip_block,
+ this->routing_slip_header_.next_serial_number))
+ {
+ result->dllist_push_back();
+ }
+ else
+ {
+ // steal the psb for use as the next psb.
+ // delete the rspm. We'll create another one later.
+ Persistent_Storage_Block * next_psb = result->first_routing_slip_block_;
+ result->first_routing_slip_block_ = 0;
+// next_psb->set_allocator_owns(true);
+ this->factory_->done_reloading (
+ next_psb,
+ result->serial_number_);
+ delete result;
+ result = 0;
+ }
+ return result;
+}
+
+bool
+Routing_Slip_Persistence_Manager::store(const ACE_Message_Block& event,
+ const ACE_Message_Block& routing_slip)
+{
+ bool result = false;
+ ACE_GUARD_RETURN(ACE_SYNCH_MUTEX, ace_mon, this->lock_, result);
+ if (!this->removed_)
+ {
+ result = store_i(event, routing_slip);
+ }
+ return result;
+}
+
+bool
+Routing_Slip_Persistence_Manager::update(const ACE_Message_Block& routing_slip)
+{
+ bool result = false;
+ ACE_GUARD_RETURN(ACE_SYNCH_MUTEX, ace_mon, this->lock_, result);
+ // If we have not gotten the event yet or we have no allocator, fail
+ if (!this->removed_)
+ {
+ if (this->persisted())
+ {
+ result = update_i(routing_slip);
+ }
+ }
+ return result;
+}
+
+bool
+Routing_Slip_Persistence_Manager::remove()
+{
+ bool result = false;
+ ACE_GUARD_RETURN(ACE_SYNCH_MUTEX, ace_mon, this->lock_, result);
+ // Assert that this is in the dllist
+ ACE_ASSERT(this->prev_manager_ != this);
+ ACE_ASSERT(this->persisted());
+ Routing_Slip_Persistence_Manager* prev = this->prev_manager_;
+ // Once our previous manager removes us, we can deallocate in any order
+ this->factory_->lock.acquire();
+ this->remove_from_dllist();
+ result = prev->update_next_manager(this);
+ this->factory_->lock.release();
+ size_t block_number = 0;
+ if (this->first_routing_slip_block_ != 0)
+ {
+ this->allocator_->free(this->first_routing_slip_block_->block_number());
+ delete this->first_routing_slip_block_;
+ this->first_routing_slip_block_ = 0;
+ }
+ if (this->first_event_block_ != 0)
+ {
+ this->allocator_->free(this->first_event_block_->block_number());
+ delete this->first_event_block_;
+ this->first_event_block_ = 0;
+ }
+ while (this->allocated_routing_slip_blocks_.pop(block_number) == 0)
+ {
+ this->allocator_->free(block_number);
+ }
+ while (this->allocated_event_blocks_.pop(block_number) == 0)
+ {
+ this->allocator_->free(block_number);
+ }
+ this->removed_ = true;
+ Persistent_Storage_Block* callbackblock =
+ this->allocator_->allocate_nowrite();
+ callbackblock->set_callback(this->callback_);
+ result &= this->allocator_->write(callbackblock);
+ return result;
+}
+
+Routing_Slip_Persistence_Manager::Block_Header::Block_Header(Header_Type type)
+ : serial_number (0)
+ , next_overflow(0)
+ , header_type (static_cast<Block_Type> (type))
+ , data_size(0)
+{
+}
+Routing_Slip_Persistence_Manager::Block_Header::~Block_Header (void)
+{
+}
+
+size_t
+Routing_Slip_Persistence_Manager::Block_Header::extract_header(
+ Persistent_Storage_Block& psb, size_t offset)
+{
+ size_t pos = offset;
+ unsigned char* data = psb.data();
+
+ serial_number = data[pos++];
+ serial_number = (serial_number << 8) + data[pos++];
+ serial_number = (serial_number << 8) + data[pos++];
+ serial_number = (serial_number << 8) + data[pos++];
+ serial_number = (serial_number << 8) + data[pos++];
+ serial_number = (serial_number << 8) + data[pos++];
+ serial_number = (serial_number << 8) + data[pos++];
+ serial_number = (serial_number << 8) + data[pos++];
+
+ next_overflow = data[pos++];
+ next_overflow = (next_overflow << 8) + data[pos++];
+ next_overflow = (next_overflow << 8) + data[pos++];
+ next_overflow = (next_overflow << 8) + data[pos++];
+
+ header_type = data[pos++];
+ header_type = (data_size << 8) + data[pos++];
+
+ data_size = data[pos++];
+ data_size = (data_size << 8) + data[pos++];
+ return pos;
+}
+
+size_t
+Routing_Slip_Persistence_Manager::Block_Header::put_header(
+ Persistent_Storage_Block& psb, size_t offset)
+{
+ // Assume that our psb can hold our small amount of data...
+ size_t pos = offset;
+ unsigned char* data = psb.data();
+ // Store serial_number
+ data[pos++] = static_cast<unsigned char> ((serial_number >> 56) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((serial_number >> 48) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((serial_number >> 40) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((serial_number >> 32) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((serial_number >> 24) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((serial_number >> 16) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((serial_number >> 8) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((serial_number >> 0) & 0xff);
+ // Store next_overflow
+ data[pos++] = static_cast<unsigned char> (next_overflow >> 24);
+ data[pos++] = static_cast<unsigned char> ((next_overflow >> 16) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((next_overflow >> 8) & 0xff);
+ data[pos++] = static_cast<unsigned char> (next_overflow & 0xff);
+ // Store header_type
+ data[pos++] = static_cast<unsigned char> ((header_type >> 8) & 0xff);
+ data[pos++] = static_cast<unsigned char> (header_type & 0xff);
+ // Store data_size
+ data[pos++] = static_cast<unsigned char> ((data_size >> 8) & 0xff);
+ data[pos++] = static_cast<unsigned char> (data_size & 0xff);
+
+ return pos;
+}
+
+Routing_Slip_Persistence_Manager::Routing_Slip_Header::Routing_Slip_Header()
+ : Block_Header (BT_Event)
+ , next_routing_slip_block(0)
+ , next_serial_number(0)
+ , event_block(0)
+{
+}
+
+size_t
+Routing_Slip_Persistence_Manager::Routing_Slip_Header::extract_header(
+ Persistent_Storage_Block& psb, size_t offset)
+{
+ size_t pos = offset;
+ pos = this->Block_Header::extract_header(psb, pos);
+ unsigned char* data = psb.data();
+ next_routing_slip_block = data[pos++];
+ next_routing_slip_block = (next_routing_slip_block << 8) + data[pos++];
+ next_routing_slip_block = (next_routing_slip_block << 8) + data[pos++];
+ next_routing_slip_block = (next_routing_slip_block << 8) + data[pos++];
+ next_serial_number = data[pos++];
+ next_serial_number = (next_serial_number << 8) + data[pos++];
+ next_serial_number = (next_serial_number << 8) + data[pos++];
+ next_serial_number = (next_serial_number << 8) + data[pos++];
+ next_serial_number = (next_serial_number << 8) + data[pos++];
+ next_serial_number = (next_serial_number << 8) + data[pos++];
+ next_serial_number = (next_serial_number << 8) + data[pos++];
+ next_serial_number = (next_serial_number << 8) + data[pos++];
+ event_block = data[pos++];
+ event_block = (event_block << 8) + data[pos++];
+ event_block = (event_block << 8) + data[pos++];
+ event_block = (event_block << 8) + data[pos++];
+ return pos;
+}
+
+size_t
+Routing_Slip_Persistence_Manager::Routing_Slip_Header::put_header(
+ Persistent_Storage_Block& psb, size_t offset)
+{
+ // Assume that our psb can hold our small amount of data...
+ size_t pos = offset;
+ // Store serial number, next_overflow and data_size
+ pos = this->Block_Header::put_header(psb, pos);
+
+ unsigned char* data = psb.data();
+ // Store next_routing_slip_block
+ data[pos++] = static_cast<unsigned char> (next_routing_slip_block >> 24);
+ data[pos++] = static_cast<unsigned char> ((next_routing_slip_block >> 16) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((next_routing_slip_block >> 8) & 0xff);
+ data[pos++] = static_cast<unsigned char> (next_routing_slip_block & 0xff);
+ // Store serial_number
+ data[pos++] = static_cast<unsigned char> ((next_serial_number >> 56) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((next_serial_number >> 48) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((next_serial_number >> 40) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((next_serial_number >> 32) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((next_serial_number >> 24) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((next_serial_number >> 16) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((next_serial_number >> 8) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((next_serial_number >> 0) & 0xff);
+ // Store event_block
+ data[pos++] = static_cast<unsigned char> (event_block >> 24);
+ data[pos++] = static_cast<unsigned char> ((event_block >> 16) & 0xff);
+ data[pos++] = static_cast<unsigned char> ((event_block >> 8) & 0xff);
+ data[pos++] = static_cast<unsigned char> (event_block & 0xff);
+ return pos;
+}
+
+Routing_Slip_Persistence_Manager::Overflow_Header::Overflow_Header ()
+ : Block_Header (BT_Overflow)
+{
+}
+
+Routing_Slip_Persistence_Manager::Event_Header::Event_Header ()
+ : Block_Header (BT_Routing_Slip)
+{
+}
+
+bool
+Routing_Slip_Persistence_Manager::store_i(const ACE_Message_Block& event,
+ const ACE_Message_Block& routing_slip)
+{
+ bool result = false;
+
+ bool initially_persisted = this->persisted();
+ if (!initially_persisted)
+ {
+ this->factory_->lock.acquire();
+ this->factory_->preallocate_next_record(this->serial_number_,
+ this->first_routing_slip_block_,
+ this->routing_slip_header_.next_serial_number,
+ this->routing_slip_header_.next_routing_slip_block);
+ this->routing_slip_header_.serial_number = this->serial_number_;
+ }
+
+ result = this->build_chain(this->first_routing_slip_block_,
+ this->routing_slip_header_, this->allocated_routing_slip_blocks_,
+ routing_slip);
+
+ if (result)
+ {
+ // No need for a callback here since we do our own below
+ result &= this->store_event(event);
+ // If we have an event block allocated, update our header
+ if (this->first_event_block_ != 0)
+ {
+ this->routing_slip_header_.event_block =
+ this->first_event_block_->block_number();
+ }
+ else
+ {
+ ACE_ERROR((LM_ERROR,
+ ACE_TEXT(
+ "(%P|%t) No Event is being stored with this routing slip.\n")
+ ));
+ }
+ // Always write our first block out.
+ this->dllist_push_back();
+ result &= (this->write_first_routing_slip_block() != 0);
+ // because the first rs blocks everywhere have been given sync, we are
+ // guaranteed that they will be totally written by the time we get to this
+ // empty callback-only block.
+ Persistent_Storage_Block* callbackblock =
+ this->allocator_->allocate_nowrite();
+ callbackblock->set_callback(this->callback_);
+ result &= this->allocator_->write(callbackblock);
+ }
+ if (!initially_persisted)
+ {
+ this->factory_->lock.release();
+ }
+ return result;
+}
+
+bool
+Routing_Slip_Persistence_Manager::update_i(
+ const ACE_Message_Block& routing_slip)
+{
+ bool result = true;
+ size_t routing_slip_size = routing_slip.total_length();
+ if (routing_slip_size != 0)
+ {
+ result = this->build_chain(this->first_routing_slip_block_,
+ this->routing_slip_header_, this->allocated_routing_slip_blocks_,
+ routing_slip);
+
+ result &= this->allocator_->write(this->first_routing_slip_block_);
+ }
+ Persistent_Storage_Block* callbackblock =
+ this->allocator_->allocate_nowrite();
+ callbackblock->set_callback(this->callback_);
+ result &= this->allocator_->write(callbackblock);
+ return result;
+}
+
+bool
+Routing_Slip_Persistence_Manager::store_event(
+ const ACE_Message_Block& event)
+{
+ bool result = true;
+ size_t event_size = event.total_length();
+ if (event_size != 0)
+ {
+ if (this->first_event_block_ == 0)
+ {
+ this->first_event_block_ = this->allocator_->allocate();
+ this->first_event_block_->set_allocator_owns(false);
+ }
+
+ result = this->build_chain(this->first_event_block_,
+ this->event_header_, this->allocated_event_blocks_,
+ event);
+
+ result &= this->allocator_->write(this->first_event_block_);
+ }
+ return result;
+}
+
+size_t
+Routing_Slip_Persistence_Manager::fill_block(Persistent_Storage_Block& psb,
+ size_t offset_into_block, const ACE_Message_Block* data,
+ size_t offset_into_msg)
+{
+ unsigned char* ptr = (unsigned char*)data->rd_ptr();
+ return this->fill_block(psb, offset_into_block, ptr + offset_into_msg,
+ data->length() - offset_into_msg);
+}
+
+size_t
+Routing_Slip_Persistence_Manager::fill_block(Persistent_Storage_Block& psb,
+ size_t offset_into_block, unsigned char* data, size_t data_size)
+{
+ size_t result = 0;
+ if (data_size > 0)
+ {
+ const size_t max_size = this->allocator_->block_size() - offset_into_block;
+ size_t size_to_copy = data_size;
+ if (size_to_copy > max_size)
+ {
+ size_to_copy = max_size;
+ result = data_size - size_to_copy;
+ }
+ else
+ {
+ result = 0;
+ }
+ ACE_OS::memcpy(psb.data() + offset_into_block, data, size_to_copy);
+ }
+ return result;
+}
+
+bool
+Routing_Slip_Persistence_Manager::build_chain(
+ Persistent_Storage_Block* first_block, Block_Header& first_header,
+ ACE_Unbounded_Stack<size_t>& allocated_blocks,
+ const ACE_Message_Block& data)
+{
+ size_t data_size = data.total_length();
+ size_t remainder = data_size;
+ bool result = true;
+ // Save the number of items currently on the allocation list for
+ ACE_Unbounded_Stack<size_t> blocks_to_free;
+ size_t block_number = 0;
+
+ // reverse the order so when we pop, we free up things closer to block 0
+ // first
+ while (allocated_blocks.pop(block_number) == 0)
+ {
+ blocks_to_free.push(block_number);
+ }
+ size_t pos = first_header.put_header(
+ *first_block);
+ const ACE_Message_Block* mblk = &data;
+ remainder = this->fill_block(*first_block, pos, mblk, 0);
+ while ((remainder == 0) && (mblk->cont() != 0))
+ {
+ pos += mblk->length();
+ mblk = mblk->cont();
+ remainder = this->fill_block(*first_block, pos, mblk, 0);
+ }
+ first_header.data_size =
+ static_cast<TAO_Notify::Routing_Slip_Persistence_Manager::Block_Size> (data_size - remainder);
+ first_header.next_overflow = 0;
+
+ Block_Header* prevhdr = &first_header;
+ Persistent_Storage_Block* prevblk = first_block;
+
+ while (remainder > 0)
+ {
+ Overflow_Header* hdr = 0;
+ ACE_NEW_RETURN(hdr, Overflow_Header, result);
+
+ Persistent_Storage_Block* curblk = this->allocator_->allocate();
+ allocated_blocks.push(curblk->block_number());
+ // Set the previous block's overflow "pointer" to us.
+ prevhdr->next_overflow = curblk->block_number();
+ prevhdr->put_header(*prevblk);
+ pos = hdr->put_header(*curblk);
+ hdr->data_size =
+ static_cast<TAO_Notify::Routing_Slip_Persistence_Manager::Block_Size> (remainder);
+
+ size_t offset_into_msg = mblk->length() - remainder;
+ remainder = this->fill_block(*curblk, pos, mblk, offset_into_msg);
+ while ((remainder == 0) && (mblk->cont() != 0))
+ {
+ pos += mblk->length();
+ mblk = mblk->cont();
+ remainder = this->fill_block(*curblk, pos, mblk, 0);
+ }
+
+ hdr->data_size = hdr->data_size -
+ static_cast<TAO_Notify::Routing_Slip_Persistence_Manager::Block_Size> (remainder);
+ if (prevblk != first_block)
+ {
+ // allocator obtains ownership, so write out and delete the header
+ // only.
+ result &= this->allocator_->write(prevblk);
+ delete prevhdr;
+ }
+ prevblk = curblk;
+ prevhdr = hdr;
+ }
+ if (prevblk != first_block)
+ {
+ prevhdr->put_header(*prevblk);
+ result &= this->allocator_->write(prevblk);
+ delete prevhdr;
+ }
+ pos = first_header.put_header(
+ *first_block);
+ // Free all but the first routing_slip_block
+ while (blocks_to_free.pop(block_number) == 0)
+ {
+ this->allocator_->free(block_number);
+ }
+
+ return result;
+}
+
+bool
+Routing_Slip_Persistence_Manager::reload_chain(
+ Persistent_Storage_Block* first_block, Block_Header& first_header,
+ ACE_Unbounded_Stack<size_t>& allocated_blocks,
+ ACE_Message_Block* amb,
+ ACE_UINT64 expected_serial_number
+ )
+{
+ bool result = false;
+ size_t block_size = this->allocator_->block_size();
+ if (this->allocator_->read(first_block))
+ {
+ size_t pos = 0;
+ size_t nextptr = 0;
+ ACE_Message_Block* mbptr = amb;
+ ACE_Message_Block* mbnew = 0;
+
+ pos = first_header.extract_header(*first_block);
+ if (first_header.serial_number == expected_serial_number)
+ {
+ // We have to copy the first block because we cache it.
+ ACE_OS::memcpy(mbptr->wr_ptr(), first_block->data(),
+ block_size);
+ mbptr->rd_ptr(pos);
+ mbptr->wr_ptr(pos + first_header.data_size);
+ nextptr = first_header.next_overflow;
+ while (nextptr != 0)
+ {
+ Overflow_Header overflow_header;
+ ACE_NEW_RETURN(mbnew, ACE_Message_Block(block_size), result);
+ mbptr->cont(mbnew);
+ Persistent_Storage_Block* psb = this->allocator_->allocate_at(nextptr);
+ mbptr = mbnew;
+ // Deallocate the PSB's data and reallocate it to our wr_ptr()...
+ psb->reassign_data(static_cast<unsigned char*> (static_cast<void*> (mbptr->wr_ptr())), true);
+ // ...read into the PSB (whose data is inside of the AMB)...
+ this->allocator_->read(psb);
+ allocated_blocks.push(psb->block_number());
+ // ...extract all headers so we know the data's size...
+ pos = overflow_header.extract_header(*psb);
+ // ...set up the region that somebody else can look at...
+ mbptr->rd_ptr(pos);
+ mbptr->wr_ptr(pos + overflow_header.data_size);
+ // ...then make sure we don't delete data since we don't own it.
+ psb->reassign_data(0);
+ delete psb;
+ nextptr = overflow_header.next_overflow;
+ }
+ result = true;
+ }
+ }
+ return result;
+}
+
+bool
+Routing_Slip_Persistence_Manager::update_next_manager(
+ Routing_Slip_Persistence_Manager* next)
+{
+ bool result = false;
+ ACE_GUARD_RETURN(ACE_SYNCH_MUTEX, ace_mon, this->lock_, result);
+ ACE_ASSERT(this->persisted());
+ if (!this->removed_)
+ {
+ bool updated = false;
+ if (this->next_manager_ != 0)
+ {
+ if (this->routing_slip_header_.next_serial_number !=
+ next->routing_slip_header_.next_serial_number)
+ {
+ this->routing_slip_header_.next_serial_number =
+ next->routing_slip_header_.next_serial_number;
+ updated = true;
+ }
+ if (this->routing_slip_header_.next_routing_slip_block !=
+ next->routing_slip_header_.next_routing_slip_block)
+ {
+ this->routing_slip_header_.next_routing_slip_block =
+ next->routing_slip_header_.next_routing_slip_block;
+ updated = true;
+ }
+ }
+ if (updated)
+ {
+ this->write_first_routing_slip_block();
+ }
+ }
+ return result;
+}
+
+bool
+Routing_Slip_Persistence_Manager::persisted()
+{
+ return (0 != this->first_routing_slip_block_);
+}
+
+bool
+Routing_Slip_Persistence_Manager::is_root () const
+{
+ return this->serial_number_ == ROUTING_SLIP_ROOT_SERIAL_NUMBER;
+}
+
+void
+Routing_Slip_Persistence_Manager::release_all ()
+{
+ ACE_ASSERT(is_root());
+ while (this->next_manager_ != this)
+ {
+ Routing_Slip_Persistence_Manager * next = this->next_manager_;
+ next->remove_from_dllist();
+ ACE_ASSERT(next != this->next_manager_);
+ delete next;
+ }
+}
+
+size_t
+Routing_Slip_Persistence_Manager::write_first_routing_slip_block(
+ bool prepare_only)
+{
+ size_t pos = this->routing_slip_header_.put_header(
+ *this->first_routing_slip_block_);
+ if (!prepare_only)
+ {
+ this->allocator_->write(this->first_routing_slip_block_);
+ }
+ return pos;
+}
+
+void
+Routing_Slip_Persistence_Manager::dllist_push_back()
+{
+ insert_before (&this->factory_->root());
+}
+
+void
+Routing_Slip_Persistence_Manager::insert_before (Routing_Slip_Persistence_Manager * node)
+{
+ // Since this is a private function, the caller should have done locking
+ // on the factory before calling here. The same is true for removals.
+ ACE_ASSERT(this->prev_manager_ == this);
+ ACE_ASSERT(this->next_manager_ == this);
+ ACE_ASSERT(node != this);
+ this->prev_manager_ = node->prev_manager_;
+ node->prev_manager_ = this;
+ this->next_manager_ = node;
+ this->prev_manager_->next_manager_ = this;
+}
+
+void
+Routing_Slip_Persistence_Manager::remove_from_dllist()
+{
+ // Since this is a private function, the caller should have done locking
+ // on the factory before calling here. The same is true for insertions.
+ ACE_ASSERT(this->persisted());
+ ACE_ASSERT(this->prev_manager_ != this);
+ ACE_ASSERT(this->next_manager_ != this);
+ this->prev_manager_->next_manager_ = this->next_manager_;
+ this->next_manager_->prev_manager_ = this->prev_manager_;
+ this->prev_manager_ = this;
+ this->next_manager_ = this;
+}
+
+} /* namespace TAO_Notify */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.h b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.h
new file mode 100644
index 00000000000..0704a315884
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Persistence_Manager.h
@@ -0,0 +1,267 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Routing_Slip_Persistence_Manager.h
+ *
+ * $Id$
+ *
+ * A Routing_Slip_Persistence manager controls the actual allocation of
+ * blocks through a Persistent_Storage_Allocator and can persist an
+ * event and its routing slip.
+ *
+ * @author Jonathan Pollack <pollack_j@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef ROUTING_SLIP_PERSISTENCE_MANAGER_H
+#define ROUTING_SLIP_PERSISTENCE_MANAGER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+#include "ace/Message_Block.h"
+#include "ace/Synch_T.h"
+#include "ace/Containers_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+// Some forward declarations.
+class Standard_Event_Persistence_Factory;
+class Persistent_File_Allocator;
+class Persistent_Storage_Block;
+class Persistent_Callback;
+
+/**
+ * \brief Manage interaction between Routing_Slip and persistent storage.
+ *
+ * todo: to complete the strategization of event persistent storage this
+ * should become an interface that is implemented differently by different
+ * strategies. For now it interacts with Standard_Event_Persistence.
+ */
+class TAO_Notify_Serv_Export Routing_Slip_Persistence_Manager
+{
+public:
+ /// A unique identifier for logical blocks in persistent storage.
+ typedef ACE_UINT64 Block_Serial_Number;
+ /// The physical address of a block in persistent storage.
+ typedef ACE_UINT32 Block_Number;
+ /// The size of a block in persistent storage.
+ typedef ACE_UINT16 Block_Size;
+ /// A code to indicate the type of block in persistent storage.
+ typedef ACE_UINT16 Block_Type;
+
+ /// The constructor.
+ Routing_Slip_Persistence_Manager(Standard_Event_Persistence_Factory* factory);
+
+ /// The destructor.
+ ~Routing_Slip_Persistence_Manager();
+
+ /// Set up callbacks
+ void set_callback(Persistent_Callback* callback);
+
+
+ /// Store an event + routing slip.
+ bool store(const ACE_Message_Block& event,
+ const ACE_Message_Block& routing_slip);
+
+ /// \brief Update the routing slip.
+ ///
+ /// We must always overwrite the first block
+ /// last, and it may not chance. Other blocks should be freed and
+ /// reallocated.
+ bool update(const ACE_Message_Block& routing_slip);
+
+ /// \brief Remove our associated event and routing slip from the
+ /// Persistent_File_Allocator.
+ bool remove();
+
+ /////////////////////////////////////////
+ // Methods to be used during reload only.
+
+ /// \brief Call this method to recover data during event reload.
+ ///
+ /// It should not fail under normal circumstances.
+ /// Caller owns the resulting message blocks and is responsible
+ /// for deleting them.
+ /// Reload the event and routing_slip from the Persistent_File_Allocator.
+ bool reload(ACE_Message_Block*& event, ACE_Message_Block*&routing_slip);
+
+ /// \brief Get next RSPM during reload.
+ ///
+ /// After using the data from the reload method, call this
+ /// method to get the next RSPM. It returns a null pointer
+ /// when all persistent events have been reloaded.
+ Routing_Slip_Persistence_Manager * load_next ();
+
+ /////////////////////////
+ // Implementation methods.
+ // Should not be called by Routing_Slip
+
+ /// \brief Commit root data to disk, which should only be done for a root node.
+ bool store_root();
+
+ /// \brief Reload data into this RSPM from the given block/serial#
+ ///
+ /// \return false if the reload is not successful.
+ bool load(Block_Number block_number, Block_Serial_Number expected_serial_number);
+
+ /// \brief Is this RSPM attached to the root block?
+ bool is_root () const;
+
+ /// \brief During cleanup for shut down, release all chained RSPMs.
+ void release_all ();
+
+private:
+ /**
+ * \brief private: Storage for header information of all persistent block.
+ */
+ class Block_Header
+ {
+ public:
+ enum Header_Type {
+ BT_Routing_Slip,
+ BT_Event,
+ BT_Overflow
+ };
+
+ Block_Header(Header_Type type);
+ virtual ~Block_Header (void);
+ virtual size_t extract_header(Persistent_Storage_Block& psb,
+ size_t offset = 0);
+ virtual size_t put_header(Persistent_Storage_Block& psb,
+ size_t offset = 0);
+
+ public:
+ /// Our serial number
+ Block_Serial_Number serial_number;
+ /// Address of the overflow record (if any)
+ Block_Number next_overflow;
+ /// How much extra header data is in this block (not including this header)
+ Block_Type header_type;
+ /// How much actual data is in this block? (not including headers)
+ Block_Size data_size;
+ };
+
+ /**
+ * \brief private: Storage for header information for Routing_Slip blocks.
+ */
+ class Routing_Slip_Header : public Block_Header
+ {
+ public:
+ Routing_Slip_Header();
+ virtual size_t extract_header(Persistent_Storage_Block& psb,
+ size_t offset = 0);
+ virtual size_t put_header(Persistent_Storage_Block& psb,
+ size_t offset = 0);
+
+ public:
+ /// The next event in the system
+ Block_Number next_routing_slip_block;
+ /// The next expected serial number
+ Block_Serial_Number next_serial_number;
+ Block_Number event_block;
+ };
+
+ /// \brief An Event block header.
+ ///
+ /// is just a Block_Header with no extra data
+ class Event_Header : public Block_Header
+ {
+ public:
+ Event_Header ();
+ };
+
+ /// \brief An overflow block header.
+ ///
+ /// is just a Block_Header with no extra data
+ /// The same record type is used for both Routing_Slip
+ /// and Event overflows.
+ class Overflow_Header : public Block_Header
+ {
+ public:
+ Overflow_Header ();
+ };
+
+ bool store_i(const ACE_Message_Block& event,
+ const ACE_Message_Block& routing_slip);
+
+ bool update_i(const ACE_Message_Block& routing_slip);
+
+ bool store_event(const ACE_Message_Block& event);
+
+ /// Fill in a block with data, and return the number of bytes
+ /// of data remaining to be written.
+ size_t fill_block(Persistent_Storage_Block& psb,
+ size_t offset_into_block, const ACE_Message_Block* data,
+ size_t offset_into_msg);
+ size_t fill_block(Persistent_Storage_Block& psb,
+ size_t offset_into_block, unsigned char* data,
+ size_t data_size);
+
+ /// Build a chain of Persistent_Storage_Blocks
+ bool build_chain(
+ Persistent_Storage_Block* first_block,
+ Block_Header& first_header,
+ ACE_Unbounded_Stack<size_t>& allocated_blocks,
+ const ACE_Message_Block& data);
+
+ /// Reload a chain from persistent store.
+ bool reload_chain(Persistent_Storage_Block* first_block,
+ Block_Header& first_header,
+ ACE_Unbounded_Stack<size_t>& allocated_blocks,
+ ACE_Message_Block* amb,
+ ACE_UINT64 expected_serial_number);
+
+ /// Locked method to do the work of setting the next_manager_.
+ bool update_next_manager(Routing_Slip_Persistence_Manager* next);
+
+ /// Have we been persisted yet?
+ bool persisted();
+
+ /// Write out our first event block.
+ size_t write_first_routing_slip_block(bool prepare_only = false);
+
+ /// Insert ourselves into a linked list of Routing_Slip_Persistnce_Managers
+ void dllist_push_back();
+
+ void insert_before (Routing_Slip_Persistence_Manager * node);
+
+ /// Remove ourselves from a linked list of Routing_Slip_Persistence_Managers
+ void remove_from_dllist();
+
+private:
+ ACE_SYNCH_MUTEX lock_;
+ bool removed_;
+ ACE_UINT64 serial_number_;
+ Persistent_File_Allocator* allocator_;
+ Standard_Event_Persistence_Factory* factory_;
+ Event_Header event_header_;
+ Routing_Slip_Header routing_slip_header_;
+ Persistent_Storage_Block* first_event_block_;
+ Persistent_Storage_Block* first_routing_slip_block_;
+ /// We are part of a doubly-linked list
+ Routing_Slip_Persistence_Manager* prev_manager_;
+ Routing_Slip_Persistence_Manager* next_manager_;
+ ACE_Unbounded_Stack<size_t> allocated_event_blocks_;
+ ACE_Unbounded_Stack<size_t> allocated_routing_slip_blocks_;
+ Persistent_Callback* callback_;
+
+ /// if these are non-zero we own 'em
+ ACE_Message_Block * event_mb_;
+ ACE_Message_Block * routing_slip_mb_;
+};
+
+} /* namespace TAO_Notify */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* ROUTING_SLIP_PERSISTENCE_MANAGER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Queue.cpp b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Queue.cpp
new file mode 100644
index 00000000000..4447981d06f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Queue.cpp
@@ -0,0 +1,112 @@
+// $Id$
+
+#include "orbsvcs/Notify/Routing_Slip_Queue.h"
+
+#include "tao/debug.h"
+#include "ace/Dynamic_Service.h"
+
+//#define DEBUG_LEVEL 9
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ Routing_Slip_Queue::Routing_Slip_Queue (size_t allowed)
+ : allowed_ (allowed)
+ , active_ (0)
+ {
+ }
+
+ Routing_Slip_Queue::~Routing_Slip_Queue ()
+ {
+ }
+
+ void
+ Routing_Slip_Queue::add (const Routing_Slip_Ptr & routing_slip)
+ {
+ Guard guard (internals_);
+ ACE_ASSERT (guard.locked()); // check recursion
+ if (this->allowed_ == 0)
+ {
+ ++this->active_;
+ guard.release ();
+ routing_slip->at_front_of_persist_queue ();
+// guard.acquire ();
+ }
+ else
+ {
+ this->queue_.enqueue_tail (routing_slip);
+ dispatch (guard);
+ }
+ }
+
+ void Routing_Slip_Queue::complete ()
+ {
+ Guard guard (internals_);
+ ACE_ASSERT (guard.locked()); // check recursion
+ ACE_ASSERT (this->active_ > 0);
+ --this->active_;
+ dispatch (guard);
+ }
+
+ void
+ Routing_Slip_Queue::dispatch (Guard & guard)
+ {
+ // we start out pretty nice,
+ // but the more work we do for other people
+ // the less nice we get.
+ size_t nice = this->allowed_ + 1;
+ while (nice > 0 && (this->active_ < this->allowed_))
+ {
+ if (dispatch_one (guard))
+ {
+ --nice;
+ }
+ else
+ {
+ // that's about as nice as I get.
+ nice = 0;
+ }
+ }
+ }
+
+ bool
+ Routing_Slip_Queue::dispatch_one (Guard & guard)
+ {
+ bool ok = false;
+ Routing_Slip_Ptr routing_slip;
+ if (this->queue_.dequeue_head (routing_slip) == 0)
+ {
+ ++this->active_;
+ guard.release ();
+ routing_slip->at_front_of_persist_queue ();
+ guard.acquire ();
+ }
+ return ok;
+ }
+
+ void
+ Routing_Slip_Queue::set_allowed (size_t allowed)
+ {
+ Guard guard (internals_);
+ size_t allowed_was = this->allowed_;
+ this->allowed_ = allowed;
+ if (allowed == 0 && allowed_was != 0)
+ {
+ while (dispatch_one (guard))
+ {
+ ; // work happens in dispatc_one
+ }
+ }
+ else
+ {
+ dispatch (guard);
+ }
+ }
+} // namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Queue.h b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Queue.h
new file mode 100644
index 00000000000..4d28e093c0b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Routing_Slip_Queue.h
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+// $Id$
+
+#ifndef TAO_NOTIFY_ROUTING_SLIP_QUEUE_H
+#define TAO_NOTIFY_ROUTING_SLIP_QUEUE_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/Routing_Slip.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ /**
+ * \brief A queue of Routing_Slips waiting to be persisted.
+ *
+ * The Routing_Slip_Queue keeps a queue of Routing_Slips waiting
+ * to be written to persistent storage. The "allowed" parameter
+ * determines how many Routing_Slips can be handled simultaneously
+ * by the persistent storage. Until this threshold is reached,
+ * Routing_Slips are not held in the queue, but pass straight through.
+ *
+ * Once the allowe number of Routing_Slips are being handled, any
+ * additional requests are held in the queue until persistence is
+ * complete for another Routing_Slips.
+ *
+ * Having Routing_Slips waiting in the queue is "a good thing" [TM]
+ * because it allows delivery completions to be applied to the
+ * routing slip before it is written -- thereby reducing or completely
+ * eliminating the number of actual writes to persistent storage.
+ *
+ * Experimentation indicates that a good value for "allowed" is 1.
+ *
+ * Allowed == 0 is treated as a special case meaning pass all Routing_Slips
+ * through the queue immediately. Setting it a good way to test how well
+ * your storage device withstands continuous beating.
+ */
+ class TAO_Notify_Serv_Export Routing_Slip_Queue
+ {
+ typedef ACE_Unbounded_Queue <Routing_Slip_Ptr> Queue;
+ typedef ACE_Guard< TAO_SYNCH_MUTEX > Guard;
+ public:
+ /**
+ * \brief Construct setting "allowed".
+ * \param allowed the number of Routing_Slips that can be handled
+ * simultaneously by the persistent store.
+ */
+ Routing_Slip_Queue (size_t allowed = 1);
+ /// Destructor.
+ ~Routing_Slip_Queue ();
+
+ /**
+ * \brief Add a routing slip to the tail of the queue and dispatch if necessary.
+ */
+ void add (const Routing_Slip_Ptr & routing_slip);
+ /**
+ * \brief A call back to indicate that processing is complete for a previously-queued
+ * Routing_Slip.
+ */
+ void complete ();
+
+ /**
+ * /brief Adjust the "allowed" value on-the-fly (not recommended, but it works.)
+ */
+ void set_allowed (size_t allowed);
+
+ private:
+ void dispatch (Guard & guard);
+ bool dispatch_one (Guard & guard);
+
+ private:
+ Routing_Slip_Queue (const Routing_Slip_Queue & rhs);
+ Routing_Slip_Queue & operator = (const Routing_Slip_Queue & rhs);
+ private:
+ // configuration setting
+ size_t allowed_;
+ /// Protection for internal information
+ TAO_SYNCH_MUTEX internals_;
+ size_t active_;
+ Queue queue_;
+
+ };
+} // namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_NOTIFY_ROUTING_SLIP_QUEUE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Save_Persist_Worker_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Save_Persist_Worker_T.cpp
new file mode 100644
index 00000000000..1be68b66c33
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Save_Persist_Worker_T.cpp
@@ -0,0 +1,47 @@
+//=============================================================================
+/**
+* @file Save_Persist_Worker_T.cpp
+*
+* $Id$
+*
+* @author Jonathan Pollack <pollack_j@ociweb.com>
+*/
+//=============================================================================
+
+#ifndef SAVE_PERSIST_WORKER_CPP
+#define SAVE_PERSIST_WORKER_CPP
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ template<class TOPOOBJ>
+ Save_Persist_Worker<TOPOOBJ>::Save_Persist_Worker(Topology_Saver& saver,
+ bool want_all_children)
+ : saver_ (saver)
+ , want_all_children_ (want_all_children)
+ {
+ }
+
+ template<class TOPOOBJ>
+ void
+ Save_Persist_Worker<TOPOOBJ>::work (TOPOOBJ* o ACE_ENV_ARG_DECL)
+ {
+ ACE_ASSERT(o != 0);
+ if (this->want_all_children_ || o->is_changed ())
+ {
+ o->save_persistent (saver_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* SAVE_PERSIST_WORKER_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Save_Persist_Worker_T.h b/TAO/orbsvcs/orbsvcs/Notify/Save_Persist_Worker_T.h
new file mode 100644
index 00000000000..a9d425891f0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Save_Persist_Worker_T.h
@@ -0,0 +1,63 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+* \file Save_Persist_Worker_T.h
+*
+* $Id$
+*
+* \author Jonathan Pollack <pollack_j@ociweb.com>
+*/
+//=============================================================================
+
+#ifndef SAVE_PERSIST_WORKER_H
+#define SAVE_PERSIST_WORKER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ /**
+ * \brief Iterate through children saving persistent topology information.
+ */
+ template<class TOPOOBJ>
+ class Save_Persist_Worker : public TAO_ESF_Worker<TOPOOBJ>
+ {
+ public:
+ /**
+ * /brief Constructor
+ * /param saver the object that will save persistent information.
+ * /param want_all_children if true, unmodified children should be saved, too.
+ */
+ Save_Persist_Worker(Topology_Saver& saver, bool want_all_children);
+
+ // override virtual ESF_Worker method
+ virtual void work (TOPOOBJ* o ACE_ENV_ARG_DECL);
+
+ private:
+ Topology_Saver& saver_;
+ bool want_all_children_;
+ };
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Notify/Save_Persist_Worker_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Save_Persist_Worker_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+
+#endif /* SAVE_PERSIST_WORKER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.cpp
new file mode 100644
index 00000000000..a1a29b3eb35
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.cpp
@@ -0,0 +1,38 @@
+// $Id$
+
+#ifndef TAO_Notify_SEQ_WORKER_T_CPP
+#define TAO_Notify_SEQ_WORKER_T_CPP
+
+#include "orbsvcs/Notify/Seq_Worker_T.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Seq_Worker_T.inl"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class T>
+TAO_Notify_Seq_Worker_T<T>::TAO_Notify_Seq_Worker_T (void)
+{
+}
+
+template<class TYPE> ACE_TYPENAME TAO_Notify_Seq_Worker_T<TYPE>::SEQ*
+TAO_Notify_Seq_Worker_T<TYPE>::create (CONTAINER &container ACE_ENV_ARG_DECL)
+{
+ SEQ* tmp;
+ ACE_NEW_THROW_EX (tmp, //this->seq_,
+ SEQ (),
+ CORBA::INTERNAL ());
+
+ this->seq_ = tmp;
+
+ container.collection ()->for_each (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return this->seq_._retn ();
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_Notify_SEQ_WORKER_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.h b/TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.h
new file mode 100644
index 00000000000..5e89210356e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.h
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+/**
+ * @file Seq_Worker_T.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_SEQ_WORKER_T_H
+#define TAO_Notify_SEQ_WORKER_T_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+#include "orbsvcs/ESF/ESF_Worker.h"
+#include "orbsvcs/Notify/Container_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Seq_Worker_T
+ *
+ * @brief Helper to construct a sequence of IDS in a collections.
+ *
+ */
+template <class TYPE>
+class TAO_Notify_Serv_Export TAO_Notify_Seq_Worker_T
+ : public TAO_ESF_Worker<TYPE>
+{
+ typedef TAO_Notify_Container_T<TYPE> CONTAINER;
+ typedef TAO_ESF_Proxy_Collection<TYPE> COLLECTION;
+ typedef typename TYPE::SEQ SEQ;
+ typedef typename TYPE::SEQ_VAR SEQ_VAR;
+
+public:
+ /// Constructor
+ TAO_Notify_Seq_Worker_T (void);
+
+ /// create a SEQ
+ SEQ* create (CONTAINER& container ACE_ENV_ARG_DECL);
+
+protected:
+ ///= TAO_ESF_Worker method
+ void work (TYPE* object ACE_ENV_ARG_DECL);
+
+ /// The result
+ SEQ_VAR seq_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Seq_Worker_T.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Notify/Seq_Worker_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Seq_Worker_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_SEQ_WORKER_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.inl
new file mode 100644
index 00000000000..43dc3487646
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.inl
@@ -0,0 +1,15 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<class TYPE> ACE_INLINE void
+TAO_Notify_Seq_Worker_T<TYPE>::work (TYPE* type ACE_ENV_ARG_DECL_NOT_USED)
+{
+ this->seq_->length (this->seq_->length () + 1);
+
+ this->seq_[this->seq_->length () - 1] = type->id ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.cpp
new file mode 100644
index 00000000000..a7c5adb49c3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.cpp
@@ -0,0 +1,139 @@
+// $Id$
+
+#include "orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.h"
+
+ACE_RCSID (Notify, TAO_Notify_SequenceProxyPushConsumer, "$Id$")
+
+#include "tao/debug.h"
+#include "orbsvcs/Notify/Sequence/SequencePushSupplier.h"
+#include "orbsvcs/Notify/AdminProperties.h"
+#include "orbsvcs/Notify/Structured/StructuredEvent.h"
+#include "orbsvcs/Notify/Properties.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_SequenceProxyPushConsumer::TAO_Notify_SequenceProxyPushConsumer (void)
+:pacing_interval_ (CosNotification::PacingInterval)
+{
+}
+
+TAO_Notify_SequenceProxyPushConsumer::~TAO_Notify_SequenceProxyPushConsumer ()
+{
+}
+
+void
+TAO_Notify_SequenceProxyPushConsumer::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+CosNotifyChannelAdmin::ProxyType
+TAO_Notify_SequenceProxyPushConsumer::MyType (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return CosNotifyChannelAdmin::PUSH_SEQUENCE;
+}
+
+void
+TAO_Notify_SequenceProxyPushConsumer::connect_sequence_push_supplier (CosNotifyComm::SequencePushSupplier_ptr push_supplier ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventChannelAdmin::AlreadyConnected
+ ))
+{
+ // Convert Supplier to Base Type
+ TAO_Notify_SequencePushSupplier *supplier;
+ ACE_NEW_THROW_EX (supplier,
+ TAO_Notify_SequencePushSupplier (this),
+ CORBA::NO_MEMORY ());
+
+ supplier->init (push_supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->connect (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_SequenceProxyPushConsumer::push_structured_events (const CosNotification::EventBatch& event_batch ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventComm::Disconnected
+ ))
+{
+ // Check if we should proceed at all.
+ if (this->admin_properties().reject_new_events () == 1 && this->admin_properties().queue_full ())
+ ACE_THROW (CORBA::IMP_LIMIT ());
+
+ if (this->is_connected () == 0)
+ {
+ ACE_THROW (CosEventComm::Disconnected ());
+ }
+
+ for (CORBA::ULong i = 0; i < event_batch.length (); ++i)
+ {
+ const CosNotification::StructuredEvent& notification = event_batch[i];
+
+ TAO_Notify_StructuredEvent_No_Copy event (notification);
+ this->push_i (&event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_Notify_SequenceProxyPushConsumer::disconnect_sequence_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_SequenceProxyPushConsumer::Ptr guard( this );
+ this->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+const char *
+TAO_Notify_SequenceProxyPushConsumer::get_proxy_type_name (void) const
+{
+ return "sequence_proxy_push_consumer";
+}
+
+void
+TAO_Notify_SequenceProxyPushConsumer::load_attrs (const TAO_Notify::NVPList& attrs)
+{
+ SuperClass::load_attrs(attrs);
+ ACE_CString ior;
+ if (attrs.load("PeerIOR", ior))
+ {
+ CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosNotifyComm::SequencePushSupplier_var ps = CosNotifyComm::SequencePushSupplier::_nil();
+ if ( ior.length() > 0 )
+ {
+ CORBA::Object_var obj = orb->string_to_object(ior.c_str() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ps = CosNotifyComm::SequencePushSupplier::_unchecked_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ // minor hack: suppress generating subscription updates during reload.
+ bool save_updates = this->updates_off_;
+ this->updates_off_ = true;
+ this->connect_sequence_push_supplier(ps.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->updates_off_ = save_updates;
+ }
+ ACE_CATCHANY
+ {
+ ACE_ASSERT(0);
+ }
+ ACE_ENDTRY;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.h
new file mode 100644
index 00000000000..4db216993cb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.h
@@ -0,0 +1,102 @@
+/* -*- C++ -*- */
+/**
+ * @file SequenceProxyPushConsumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_SEQUENCEPROXYPUSHCONSUMER_H
+#define TAO_Notify_SEQUENCEPROXYPUSHCONSUMER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+
+#include "orbsvcs/Notify/ProxyConsumer_T.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_SequenceProxyPushConsumer
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_SequenceProxyPushConsumer
+ : public virtual TAO_Notify_ProxyConsumer_T <POA_CosNotifyChannelAdmin::SequenceProxyPushConsumer>
+{
+ typedef TAO_Notify_ProxyConsumer_T <POA_CosNotifyChannelAdmin::SequenceProxyPushConsumer> SuperClass;
+ friend class TAO_Notify_Builder;
+public:
+ /// Constuctor
+ TAO_Notify_SequenceProxyPushConsumer (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_SequenceProxyPushConsumer ();
+
+ virtual const char * get_proxy_type_name (void) const;
+
+ virtual void load_attrs (const TAO_Notify::NVPList& attrs);
+
+protected:
+ ///= Data Members
+ TAO_Notify_Property_Time pacing_interval_;
+
+ ///= Protected Methods
+
+ //= interface methods
+ virtual CosNotifyChannelAdmin::ProxyType MyType (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void connect_sequence_push_supplier (CosNotifyComm::SequencePushSupplier_ptr push_supplier
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected
+ ));
+
+ 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
+ ));
+
+private:
+ /// TAO_Notify_Destroy_Callback methods
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_SEQUENCEPROXYPUSHCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushSupplier.cpp b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushSupplier.cpp
new file mode 100644
index 00000000000..be2f9f74299
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushSupplier.cpp
@@ -0,0 +1,108 @@
+// $Id$
+
+#include "orbsvcs/Notify/Sequence/SequenceProxyPushSupplier.h"
+
+ACE_RCSID (Notify, TAO_Notify_SequenceProxyPushSupplier, "$Id$")
+
+#include "tao/debug.h"
+#include "orbsvcs/Notify/Sequence/SequencePushConsumer.h"
+#include "orbsvcs/Notify/Properties.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_SequenceProxyPushSupplier::TAO_Notify_SequenceProxyPushSupplier (void)
+{
+}
+
+TAO_Notify_SequenceProxyPushSupplier::~TAO_Notify_SequenceProxyPushSupplier ()
+{
+}
+
+void
+TAO_Notify_SequenceProxyPushSupplier::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+void
+TAO_Notify_SequenceProxyPushSupplier::connect_sequence_push_consumer (CosNotifyComm::SequencePushConsumer_ptr push_consumer ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventChannelAdmin::AlreadyConnected
+ , CosEventChannelAdmin::TypeError
+ ))
+{
+ // Convert Consumer to Base Type
+ TAO_Notify_SequencePushConsumer* consumer;
+ ACE_NEW_THROW_EX (consumer,
+ TAO_Notify_SequencePushConsumer (this),
+ CORBA::NO_MEMORY ());
+
+ consumer->init (push_consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->connect (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_SequenceProxyPushSupplier::disconnect_sequence_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+
+{
+ TAO_Notify_SequenceProxyPushSupplier::Ptr guard( this );
+ this->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::ProxyType
+TAO_Notify_SequenceProxyPushSupplier::MyType (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return CosNotifyChannelAdmin::PUSH_SEQUENCE;
+}
+
+const char *
+TAO_Notify_SequenceProxyPushSupplier::get_proxy_type_name (void) const
+{
+ return "sequence_proxy_push_supplier";
+}
+
+void
+TAO_Notify_SequenceProxyPushSupplier::load_attrs (const TAO_Notify::NVPList& attrs)
+{
+ SuperClass::load_attrs(attrs);
+ ACE_CString ior;
+ if (attrs.load("PeerIOR", ior))
+ {
+ CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosNotifyComm::SequencePushConsumer_var pc = CosNotifyComm::SequencePushConsumer::_nil();
+ if (ior.length() > 0)
+ {
+ CORBA::Object_var obj = orb->string_to_object(ior.c_str() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ pc = CosNotifyComm::SequencePushConsumer::_unchecked_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ this->connect_sequence_push_consumer(pc.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // if we can't reconnect, tough
+ }
+ ACE_ENDTRY;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushSupplier.h b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushSupplier.h
new file mode 100644
index 00000000000..6603d5613e9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushSupplier.h
@@ -0,0 +1,99 @@
+/* -*- C++ -*- */
+/**
+ * @file SequenceProxyPushSupplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_SEQUENCEPROXYPUSHSUPPLIER_H
+#define TAO_Notify_SEQUENCEPROXYPUSHSUPPLIER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+
+#include "orbsvcs/Notify/ProxySupplier_T.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+#if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT
+template class TAO_Notify_Serv_Export
+TAO_Notify_ProxySupplier_T<POA_CosNotifyChannelAdmin::SequenceProxyPushSupplier>;
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */
+
+/**
+ * @class TAO_Notify_SequenceProxyPushSupplier
+ *
+ * @brief Implements the CosNotifyChannelAdmin::SequenceProxyPushSupplier methods.
+ *
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_SequenceProxyPushSupplier
+ : public virtual TAO_Notify_ProxySupplier_T <POA_CosNotifyChannelAdmin::SequenceProxyPushSupplier>
+{
+ typedef TAO_Notify_ProxySupplier_T <POA_CosNotifyChannelAdmin::SequenceProxyPushSupplier> SuperClass;
+ friend class TAO_Notify_Builder;
+
+public:
+ /// Constuctor
+ TAO_Notify_SequenceProxyPushSupplier (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_SequenceProxyPushSupplier ();
+
+
+ virtual const char * get_proxy_type_name (void) const;
+
+ virtual void load_attrs (const TAO_Notify::NVPList& attrs);
+
+ /// = Servant methods
+ virtual CosNotifyChannelAdmin::ProxyType MyType (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void connect_sequence_push_consumer (
+ CosNotifyComm::SequencePushConsumer_ptr push_consumer
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError
+ ));
+
+ virtual void disconnect_sequence_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// TAO_Notify_Destroy_Callback methods
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_SEQUENCEPROXYPUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp
new file mode 100644
index 00000000000..19f972cd0cc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp
@@ -0,0 +1,297 @@
+// $Id$
+
+#include "orbsvcs/Notify/Sequence/SequencePushConsumer.h"
+
+ACE_RCSID (Notify, TAO_Notify_SequencePushConsumer, "$Id$")
+
+#include "ace/Reactor.h"
+#include "tao/debug.h"
+#include "orbsvcs/Notify/QoSProperties.h"
+#include "orbsvcs/Notify/ProxySupplier.h"
+#include "orbsvcs/Notify/Worker_Task.h"
+#include "orbsvcs/Notify/Consumer.h"
+#include "orbsvcs/Notify/Method_Request_Dispatch.h"
+#include "orbsvcs/Notify/Method_Request_Event.h"
+#include "orbsvcs/Notify/Timer.h"
+#include "orbsvcs/Notify/Proxy.h"
+#include "orbsvcs/Notify/Properties.h"
+//#define DEBUG_LEVEL 10
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_SequencePushConsumer::TAO_Notify_SequencePushConsumer (TAO_Notify_ProxySupplier* proxy)
+: TAO_Notify_Consumer (proxy)
+{
+}
+
+TAO_Notify_SequencePushConsumer::~TAO_Notify_SequencePushConsumer ()
+{
+}
+
+void
+TAO_Notify_SequencePushConsumer::init (CosNotifyComm::SequencePushConsumer_ptr push_consumer ACE_ENV_ARG_DECL)
+{
+ // Initialize only once
+ ACE_ASSERT( CORBA::is_nil (this->push_consumer_.in()) );
+
+ if (CORBA::is_nil (push_consumer))
+ {
+ ACE_THROW (CORBA::BAD_PARAM());
+ }
+
+ this->push_consumer_ = CosNotifyComm::SequencePushConsumer::_duplicate (push_consumer);
+ this->publish_ = CosNotifyComm::NotifyPublish::_duplicate (push_consumer);
+}
+
+void
+TAO_Notify_SequencePushConsumer::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+bool
+TAO_Notify_SequencePushConsumer::dispatch_from_queue (Request_Queue& requests, ACE_Guard <TAO_SYNCH_MUTEX> & ace_mon)
+{
+ bool result = true;
+ if (DEBUG_LEVEL > 0)
+ {
+ ACE_DEBUG ( (LM_DEBUG,
+ ACE_TEXT ("(%P|%t) SequencePushConsumer dispatch queued requests. queue size:%u\n"),
+ requests.size ()));
+ }
+
+ long queue_size = requests.size ();
+ CORBA::Long max_batch_size = queue_size;
+ if (this->max_batch_size_.is_valid () )
+ {
+ max_batch_size = this->max_batch_size_.value ();
+ }
+ CORBA::Long batch_size = queue_size;
+ if (batch_size > max_batch_size)
+ {
+ batch_size = max_batch_size;
+ }
+ if (batch_size > 0)
+ {
+ CosNotification::EventBatch batch (batch_size);
+ batch.length (batch_size);
+
+ Request_Queue completed;
+
+ CORBA::Long pos = 0;
+ TAO_Notify_Method_Request_Event_Queueable * request = 0;
+ while (pos < batch_size && requests.dequeue_head (request) == 0)
+ {
+ if (DEBUG_LEVEL > 0)
+ {
+ ACE_DEBUG ( (LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Sequence Dispatch Method_Request_Dispatch @%@\n"),
+ request));
+ }
+
+ const TAO_Notify_Event * ev = request->event ();
+ ev->convert (batch [pos]);
+ ++pos;
+
+ // note enqueue at head, use queue as stack.
+ completed.enqueue_head (request);
+ }
+ batch.length (pos);
+ ACE_ASSERT (pos > 0);
+
+ ace_mon.release ();
+ TAO_Notify_Consumer::DispatchStatus status =
+ this->dispatch_batch (batch);
+ ace_mon.acquire ();
+ switch (status)
+ {
+ case DISPATCH_SUCCESS:
+ {
+ TAO_Notify_Method_Request_Event_Queueable * request = 0;
+ while (completed.dequeue_head (request) == 0)
+ {
+ request->complete ();
+ request->release ();
+ }
+ result = true;
+ break;
+ }
+ case DISPATCH_FAIL:
+ {
+ TAO_Notify_Method_Request_Event_Queueable * request = 0;
+ while (completed.dequeue_head (request) == 0)
+ {
+ if (request->should_retry ())
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer %d: Will retry %d\n"),
+ static_cast <int> (this->proxy ()->id ()),
+ request->sequence ()));
+ requests.enqueue_head (request);
+ result = false;
+ }
+ else
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer %d: Discarding %d\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ request->sequence ()));
+ request->complete ();
+ request->release ();
+ }
+ }
+ while (requests.dequeue_head (request) == 0)
+ {
+ if (request->should_retry ())
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer %d: Will retry %d\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ request->sequence ()));
+ requests.enqueue_head (request);
+ result = false;
+ }
+ else
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer %d: Discarding %d\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ request->sequence ()));
+ request->complete ();
+ request->release ();
+ }
+ }
+ ace_mon.release();
+ ACE_DECLARE_NEW_ENV;
+ ACE_TRY
+ {
+ this->proxy_supplier ()->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // todo is there something meaningful we can do here?
+ ;
+ }
+ ACE_ENDTRY;
+ ace_mon.acquire();
+ break;
+ }
+ case DISPATCH_RETRY:
+ case DISPATCH_DISCARD:
+ {
+ TAO_Notify_Method_Request_Event_Queueable * request = 0;
+ while (completed.dequeue_head (request) == 0)
+ {
+ if (request->should_retry ())
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer %d: Will retry %d\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ request->sequence ()));
+ requests.enqueue_head (request);
+ result = false;
+ }
+ else
+ {
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer %d: Discarding %d\n"),
+ static_cast<int> (this->proxy ()->id ()),
+ request->sequence ()));
+ request->complete ();
+ request->release ();
+ }
+ }
+ break;
+ }
+ default:
+ {
+ result = false;
+ break;
+ }
+ }
+ }
+ return result;
+}
+
+bool
+TAO_Notify_SequencePushConsumer::enqueue_if_necessary (
+ TAO_Notify_Method_Request_Event * request
+ ACE_ENV_ARG_DECL)
+{
+ if (DEBUG_LEVEL > 0)
+ ACE_DEBUG ( (LM_DEBUG, "SequencePushConsumer enqueing event.\n"));
+ this->enqueue_request (request ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (false);
+
+ size_t mbs = static_cast<size_t>(this->max_batch_size_.value());
+
+ if (this->pending_events().size() >= mbs || this->pacing_.is_valid () == 0)
+ {
+ this->dispatch_pending (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (false);
+ }
+ else
+ {
+ schedule_timer (false);
+ }
+ return true;
+}
+
+
+void
+TAO_Notify_SequencePushConsumer::push (const CORBA::Any& /*event*/ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ //NOP
+}
+
+void
+TAO_Notify_SequencePushConsumer::push (const CosNotification::StructuredEvent& /*notification*/ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ //NOP
+}
+
+
+void
+TAO_Notify_SequencePushConsumer::push (const CosNotification::EventBatch& event_batch ACE_ENV_ARG_DECL)
+{
+ this->push_consumer_->push_structured_events (event_batch ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+ACE_CString
+TAO_Notify_SequencePushConsumer::get_ior (void) const
+{
+ ACE_CString result;
+ CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance ()->orb ();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::String_var ior = orb->object_to_string (this->push_consumer_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ result = static_cast<const char*> (ior.in ());
+ }
+ ACE_CATCHANY
+ {
+ result.fast_clear();
+ }
+ ACE_ENDTRY;
+ return result;
+}
+
+void
+TAO_Notify_SequencePushConsumer::reconnect_from_consumer (TAO_Notify_Consumer* old_consumer
+ ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_SequencePushConsumer* tmp = dynamic_cast<TAO_Notify_SequencePushConsumer *> (old_consumer);
+ ACE_ASSERT(tmp != 0);
+ this->init(tmp->push_consumer_.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->schedule_timer(false);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h
new file mode 100644
index 00000000000..ac5661e674f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h
@@ -0,0 +1,94 @@
+/* -*- C++ -*- */
+/**
+ * @file SequencePushConsumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_SEQUENCEPUSHCONSUMER_H
+#define TAO_Notify_SEQUENCEPUSHCONSUMER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Event_Handler.h"
+#include "orbsvcs/Notify/Event.h"
+#include "orbsvcs/Notify/Property.h"
+#include "orbsvcs/Notify/Property_T.h"
+#include "orbsvcs/Notify/Consumer.h"
+#include "orbsvcs/Notify/AdminProperties.h"
+#include "ace/Null_Condition.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_ProxySupplier;
+class TAO_Notify_QoSProperties;
+class TAO_Notify_Timer;
+
+/**
+ * @class TAO_Notify_SequencePushConsumer
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_SequencePushConsumer
+ : public TAO_Notify_Consumer
+{
+public:
+ TAO_Notify_SequencePushConsumer (TAO_Notify_ProxySupplier* proxy);
+
+ virtual ~TAO_Notify_SequencePushConsumer ();
+
+ /// Init the Consumer
+ void init (CosNotifyComm::SequencePushConsumer_ptr push_consumer ACE_ENV_ARG_DECL);
+
+ /// Add request to a queue if necessary.
+ /// for Sequence it's always necessary.
+ virtual bool enqueue_if_necessary(
+ TAO_Notify_Method_Request_Event * request
+ ACE_ENV_ARG_DECL);
+
+ virtual bool dispatch_from_queue (
+ Request_Queue & requests,
+ ACE_Guard <TAO_SYNCH_MUTEX> & ace_mon);
+
+
+ /// Push <event> to this consumer.
+ virtual void push (const CORBA::Any& event ACE_ENV_ARG_DECL);
+
+ // Push event.
+ virtual void push (const CosNotification::StructuredEvent & event ACE_ENV_ARG_DECL);
+
+ /// Push a batch of events to this consumer.
+ virtual void push (const CosNotification::EventBatch& event ACE_ENV_ARG_DECL);
+
+ /// Retrieve the ior of this peer
+ virtual ACE_CString get_ior (void) const;
+
+ /// on reconnect we need to move events from the old consumer
+ /// to the new one
+ virtual void reconnect_from_consumer (TAO_Notify_Consumer* old_consumer
+ ACE_ENV_ARG_DECL);
+
+protected:
+
+ /// The Consumer
+ CosNotifyComm::SequencePushConsumer_var push_consumer_;
+
+private:
+ /// TAO_Notify_Destroy_Callback methods.
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_SEQUENCEPUSHCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushSupplier.cpp b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushSupplier.cpp
new file mode 100644
index 00000000000..df010388763
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushSupplier.cpp
@@ -0,0 +1,56 @@
+// $Id$
+
+#include "orbsvcs/Notify/Sequence/SequencePushSupplier.h"
+
+ACE_RCSID (Notify, TAO_Notify_SequencePushSupplier, "$Id$")
+
+#include "orbsvcs/Notify/Properties.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_SequencePushSupplier::TAO_Notify_SequencePushSupplier (TAO_Notify_ProxyConsumer* proxy)
+ :TAO_Notify_Supplier (proxy)
+{
+}
+
+TAO_Notify_SequencePushSupplier::~TAO_Notify_SequencePushSupplier ()
+{
+}
+
+void
+TAO_Notify_SequencePushSupplier::init (CosNotifyComm::SequencePushSupplier_ptr push_supplier ACE_ENV_ARG_DECL_NOT_USED)
+{
+ // TODO: verify single init call
+ // push_supplier is optional
+ this->push_supplier_ = CosNotifyComm::SequencePushSupplier::_duplicate (push_supplier);
+ this->subscribe_ = CosNotifyComm::NotifySubscribe::_duplicate (push_supplier);
+}
+
+void
+TAO_Notify_SequencePushSupplier::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+ACE_CString
+TAO_Notify_SequencePushSupplier::get_ior (void) const
+{
+ ACE_CString result;
+ CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::String_var ior = orb->object_to_string(this->push_supplier_.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ result = static_cast<const char*> (ior.in ());
+ }
+ ACE_CATCHANY
+ {
+ result.fast_clear();
+ }
+ ACE_ENDTRY;
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushSupplier.h b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushSupplier.h
new file mode 100644
index 00000000000..2b2af2efc08
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushSupplier.h
@@ -0,0 +1,61 @@
+/* -*- C++ -*- */
+/**
+ * @file SequencePushSupplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_SEQUENCEPUSHSUPPLIER_H
+#define TAO_Notify_SEQUENCEPUSHSUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/Notify/Supplier.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_ProxyConsumer;
+
+/**
+ * @class TAO_Notify_SequencePushSupplier
+ *
+ * @brief Wrapper for the SequencePushSupplier that connect to the EventChannel.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_SequencePushSupplier : public TAO_Notify_Supplier
+{
+public:
+ /// Constuctor
+ TAO_Notify_SequencePushSupplier (TAO_Notify_ProxyConsumer* proxy);
+
+ /// Destructor
+ virtual ~TAO_Notify_SequencePushSupplier ();
+
+ /// Init
+ void init (CosNotifyComm::SequencePushSupplier_ptr push_supplier ACE_ENV_ARG_DECL);
+
+ /// TAO_Notify_Destroy_Callback methods
+ virtual void release (void);
+
+ /// Retrieve the ior of this peer
+ virtual ACE_CString get_ior (void) const;
+
+protected:
+ /// The Supplier
+ CosNotifyComm::SequencePushSupplier_var push_supplier_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_SEQUENCEPUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Service.cpp b/TAO/orbsvcs/orbsvcs/Notify/Service.cpp
new file mode 100644
index 00000000000..f4cda660134
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Service.cpp
@@ -0,0 +1,15 @@
+// $Id$
+
+#include "orbsvcs/Notify/Service.h"
+
+ACE_RCSID (Notify,
+ TAO_Notify_Service,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Service::~TAO_Notify_Service ()
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Service.h b/TAO/orbsvcs/orbsvcs/Notify/Service.h
new file mode 100644
index 00000000000..6fdfd47f2ab
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Service.h
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+
+/**
+ * @file Service.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_SERVICE_H
+#define TAO_Notify_SERVICE_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+#include "ace/Service_Object.h"
+#include "ace/Service_Config.h"
+#include "ace/CORBA_macros.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace PortableServer
+{
+ class POA;
+ typedef POA *POA_ptr;
+}
+
+namespace CosNotifyChannelAdmin
+{
+ class EventChannelFactory;
+ typedef EventChannelFactory *EventChannelFactory_ptr;
+}
+
+namespace CORBA
+{
+ class ORB;
+ typedef ORB *ORB_ptr;
+}
+
+/**
+ * @class TAO_Notify_Service
+ *
+ * @brief Abstract ACE_Service_Object interface that is a
+ * factory for creating a Notify EventChannelFactory.
+ * Note that a Service creates only 1 Factory object.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Service : public ACE_Service_Object
+{
+public:
+ /// Destructor.
+ virtual ~TAO_Notify_Service (void);
+
+ /// Init the service from configurator
+ virtual int init (int argc, ACE_TCHAR *argv[]) = 0;
+
+ /// Init the service.
+ virtual void init_service (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) = 0;
+
+ /// Create the Channel Factory.
+ virtual CosNotifyChannelAdmin::EventChannelFactory_ptr create (
+ PortableServer::POA_ptr default_POA ACE_ENV_ARG_DECL
+ ) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#define TAO_NOTIFY_DEF_EMO_FACTORY_NAME "Notify_Default_Event_Manager_Objects_Factory"
+
+#define TAO_NOTIFICATION_SERVICE_NAME "TAO_Notify_Service"
+
+#define TAO_COS_NOTIFICATION_SERVICE_NAME "TAO_CosNotify_Service"
+
+#define TAO_RT_NOTIFICATION_SERVICE_NAME "TAO_RT_Notify_Service"
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_SERVICE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Standard_Event_Persistence.cpp b/TAO/orbsvcs/orbsvcs/Notify/Standard_Event_Persistence.cpp
new file mode 100644
index 00000000000..65389ef7c35
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Standard_Event_Persistence.cpp
@@ -0,0 +1,234 @@
+// $Id$
+
+#include "orbsvcs/Notify/Standard_Event_Persistence.h"
+#include "orbsvcs/Notify/Persistent_File_Allocator.h"
+#include "tao/debug.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/OS_NS_strings.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+
+Standard_Event_Persistence::Standard_Event_Persistence ()
+ : filename_ (ACE_TEXT ("__PERSISTENT_EVENT__.DB"))
+ , block_size_ (512)
+ , factory_ (0)
+{
+}
+
+Standard_Event_Persistence::~Standard_Event_Persistence ()
+{
+}
+
+// get the current factory, creating it if necessary
+Event_Persistence_Factory *
+Standard_Event_Persistence::get_factory ()
+{
+ //@@todo guard? ; doublecheck?
+ if (this->factory_ == 0)
+ {
+ ACE_NEW_NORETURN (
+ this->factory_,
+ Standard_Event_Persistence_Factory ()
+ );
+ if (this->factory_ != 0)
+ {
+ if (!this->factory_->open (this->filename_.c_str ()))
+ {
+ this->factory_ = 0;
+ }
+ }
+ }
+ return this->factory_;
+}
+
+// release the current factory so a new one can be created
+void
+Standard_Event_Persistence::reset ()
+{
+ delete this->factory_;
+ this->factory_ = 0;
+}
+
+int
+Standard_Event_Persistence::init (int argc, ACE_TCHAR *argv[])
+{
+ int result = 0;
+ bool verbose = false;
+ for (int narg = 0; narg < argc; ++narg)
+ {
+ ACE_TCHAR * av = argv[narg];
+ if (ACE_OS::strcasecmp (av, ACE_TEXT ("-v")) == 0)
+ {
+ verbose = true;
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Standard_Event_Persistence: -verbose\n")
+ ));
+ }
+ else if (ACE_OS::strcasecmp (av, ACE_TEXT ("-file_path")) == 0 && narg + 1 < argc)
+ {
+ this->filename_ = argv[narg + 1];
+ if (TAO_debug_level > 0 || verbose)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Standard_Event_Persistence: Setting -file_path: %s\n"),
+ this->filename_.c_str ()
+ ));
+ }
+ narg += 1;
+ }
+ else if (ACE_OS::strcasecmp (av, ACE_TEXT ("-block_size")) == 0 && narg + 1 < argc)
+ {
+ this->block_size_ = ACE_OS::atoi(argv[narg + 1]);
+ if (TAO_debug_level > 0 || verbose)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Standard_Event_Persistence: Setting -block_size: %d\n"),
+ this->block_size_
+ ));
+ }
+ narg += 1;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Unknown parameter to Standard Event Persistence: %s\n"),
+ argv[narg]
+ ));
+ result = -1;
+ }
+ }
+ return result;
+}
+
+int
+Standard_Event_Persistence::fini ()
+{
+ delete this->factory_;
+ this->factory_ = 0;
+ return 0;
+}
+
+Standard_Event_Persistence_Factory::Standard_Event_Persistence_Factory ()
+ : allocator_()
+ , root_(this)
+ , psb_(0)
+ , serial_number_(ROUTING_SLIP_ROOT_SERIAL_NUMBER + 1)
+ , is_reloading_ (false)
+{
+}
+
+bool
+Standard_Event_Persistence_Factory::open (const ACE_TCHAR* filename,
+ ACE_UINT32 block_size)
+{
+ bool result = false;
+ if (allocator_.open (filename, block_size))
+ {
+ this->is_reloading_ = this->root_.load(ROUTING_SLIP_ROOT_BLOCK_NUMBER, ROUTING_SLIP_ROOT_SERIAL_NUMBER);
+ if (! this->is_reloading_)
+ {
+ ACE_ASSERT (this->psb_ == 0);
+// this->psb_ = this->allocator_.allocate();
+ this->root_.store_root();
+ }
+ result = true;
+ }
+ return result;
+}
+
+Standard_Event_Persistence_Factory::~Standard_Event_Persistence_Factory()
+{
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Standard_Event_Persistence_Factory::~Standard_Event_Persistence_Factory\n")
+ ));
+ }
+ this->root_.release_all ();
+ delete this->psb_;
+ this->psb_ = 0;
+ this->allocator_.shutdown();
+}
+
+Routing_Slip_Persistence_Manager*
+Standard_Event_Persistence_Factory::create_routing_slip_persistence_manager(
+ Persistent_Callback* callback)
+{
+ Routing_Slip_Persistence_Manager* rspm = 0;
+ ACE_NEW_RETURN(rspm, Routing_Slip_Persistence_Manager(this), rspm);
+ rspm->set_callback(callback);
+ return rspm;
+}
+
+Routing_Slip_Persistence_Manager *
+Standard_Event_Persistence_Factory::first_reload_manager()
+{
+ Routing_Slip_Persistence_Manager * result = 0;
+ if (this->is_reloading_)
+ {
+ result = this->root_.load_next();
+ }
+ return result;
+}
+
+void
+Standard_Event_Persistence_Factory::done_reloading(
+ Persistent_Storage_Block * next_psb,
+ ACE_UINT64 current_serial_number)
+{
+ ACE_ASSERT (this->psb_ == 0);
+ this->psb_ = next_psb;
+ this->serial_number_ = current_serial_number;
+ this->is_reloading_ = false;
+}
+
+void
+Standard_Event_Persistence_Factory::preallocate_next_record(
+ ACE_UINT64& current_serial_number,
+ Persistent_Storage_Block*& current_psb,
+ ACE_UINT64& next_serial_number,
+ ACE_UINT32& next_block_number)
+{
+ // return current serial number and
+ // a psb containing current record number
+ current_serial_number = this->serial_number_;
+ this->psb_->set_allocator_owns(false); // give up ownership
+ this->psb_->set_sync();
+ current_psb = this->psb_;
+ this->get_preallocated_pointer (next_serial_number, next_block_number);
+}
+
+void
+Standard_Event_Persistence_Factory::get_preallocated_pointer(
+ ACE_UINT64& next_serial_number,
+ ACE_UINT32& next_block_number)
+{
+ ++this->serial_number_;
+ this->psb_ = this->allocator_.allocate();
+
+ next_serial_number = this->serial_number_;
+ next_block_number = this->psb_->block_number();
+}
+
+Persistent_File_Allocator*
+Standard_Event_Persistence_Factory::allocator()
+{
+ return &this->allocator_;
+}
+
+Routing_Slip_Persistence_Manager &
+Standard_Event_Persistence_Factory::root()
+{
+ return this->root_;
+}
+
+} // End TAO_Notify_Namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_NAMESPACE_DEFINE (TAO_Notify_Serv,
+ TAO_Notify_Standard_Event_Persistence,
+ TAO_Notify::Standard_Event_Persistence)
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Standard_Event_Persistence.h b/TAO/orbsvcs/orbsvcs/Notify/Standard_Event_Persistence.h
new file mode 100644
index 00000000000..995577d761a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Standard_Event_Persistence.h
@@ -0,0 +1,134 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * \file Event_Persistence_Factory.h
+ *
+ * $Id$
+ *
+ * The standard implementation of Event_Persistence_Factory.
+ *
+ * \author Jonathan Pollack <pollack_j@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef STANDARD_EVENT_PERSISTENCE_H
+#define STANDARD_EVENT_PERSISTENCE_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/Notify/Event_Persistence_Strategy.h"
+#include "orbsvcs/Notify/Event_Persistence_Factory.h"
+#include "orbsvcs/Notify/Persistent_File_Allocator.h"
+#include "orbsvcs/Notify/Routing_Slip_Persistence_Manager.h"
+#include <ace/SString.h>
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ static const ACE_UINT32 ROUTING_SLIP_ROOT_BLOCK_NUMBER = 0;
+ static const ACE_UINT64 ROUTING_SLIP_ROOT_SERIAL_NUMBER = 1;
+
+ /// \brief Standard (i.e. default) implementation of Event_Persistence_Factory interface
+ class TAO_Notify_Serv_Export Standard_Event_Persistence_Factory :
+ public Event_Persistence_Factory
+ {
+ public:
+ /// Constructor
+ Standard_Event_Persistence_Factory ();
+ /// Destructor
+ virtual ~Standard_Event_Persistence_Factory();
+
+ /// Open persistence file and initialize.
+ /// /param filename the fully qualified path/name of the file to contain
+ /// persistent information.
+ /// /param block_size the size of a physical block on the device containing
+ /// the file.
+ bool open (const ACE_TCHAR* filename, ACE_UINT32 block_size = 512);
+
+ //////////////////////////////////////////////////////
+ // Implement Event_Persistence_Factory virtual methods.
+ virtual Routing_Slip_Persistence_Manager*
+ create_routing_slip_persistence_manager(Persistent_Callback* callback);
+
+ virtual Routing_Slip_Persistence_Manager * first_reload_manager();
+
+ /// reloading process complete. Where should the chain continue?
+ void done_reloading(
+ Persistent_Storage_Block * next_psb,
+ ACE_UINT64 current_serial_number);
+
+ /// return current serial # and a psb containing current record#
+ /// allocate new serial # and record number, and return those, too.
+ void preallocate_next_record(
+ ACE_UINT64& current_serial_number,
+ Persistent_Storage_Block*& current_psb,
+ ACE_UINT64& next_serial_number,
+ ACE_UINT32& next_block_number);
+
+ // return block pointer info for the
+ void get_preallocated_pointer(
+ ACE_UINT64& next_serial_number,
+ ACE_UINT32& next_block_number);
+
+ /// Accessor for file allocator.
+ /// Intended for use only by the Routing Slip Persistence Manager
+ Persistent_File_Allocator* allocator();
+
+ /// Access root record.
+ /// Intended for use only by the Routing Slip Persistence Manager
+ Routing_Slip_Persistence_Manager & root();
+
+ public:
+ ACE_SYNCH_MUTEX lock;
+
+ private:
+ Persistent_File_Allocator allocator_;
+ Routing_Slip_Persistence_Manager root_;
+ Persistent_Storage_Block* psb_;
+ ACE_UINT64 serial_number_;
+ bool is_reloading_;
+ };
+
+ /// \brief The standard implementation of the
+ /// Event_Persistence_Strategy interface.
+ class TAO_Notify_Serv_Export Standard_Event_Persistence :
+ public Event_Persistence_Strategy
+ {
+ public :
+ /// Constructor.
+ Standard_Event_Persistence ();
+ /// Destructor.
+ virtual ~Standard_Event_Persistence ();
+ /////////////////////////////////////////////
+ // Override Event_Persistent_Strategy methods
+ // Parse arguments and initialize.
+ virtual int init(int argc, ACE_TCHAR *argv[]);
+ // Prepare for shutdown
+ virtual int fini ();
+
+ // get the current factory, creating it if necessary
+ virtual Event_Persistence_Factory * get_factory ();
+
+ private:
+ // release the current factory so a new one can be created
+ virtual void reset ();
+
+ ACE_TString filename_; // set via -file_path
+ ACE_UINT32 block_size_; // set via -block_size
+ Standard_Event_Persistence_Factory * factory_;
+ };
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DECLARE (TAO_Notify_Serv, TAO_Notify_Standard_Event_Persistence)
+
+#include /**/ "ace/post.h"
+#endif /* STANDARD_EVENT_PERSISTENCE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.cpp
new file mode 100644
index 00000000000..c4df69993b1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.cpp
@@ -0,0 +1,81 @@
+// $Id$
+
+#include "orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.h"
+#include "tao/debug.h"
+
+#include "tao/debug.h"
+#include "orbsvcs/Notify/Method_Request_Dispatch.h"
+
+ACE_RCSID (Notify, TAO_Notify_RT_StructuredProxyPushSupplier, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_RT_StructuredProxyPushSupplier::TAO_Notify_RT_StructuredProxyPushSupplier (void)
+{
+}
+
+TAO_Notify_RT_StructuredProxyPushSupplier::~TAO_Notify_RT_StructuredProxyPushSupplier ()
+{
+}
+
+CORBA::Object_ptr
+TAO_Notify_RT_StructuredProxyPushSupplier::activate (PortableServer::Servant servant ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var object = TAO_Notify_Proxy::activate (servant ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ // Obtain our ref.
+ CORBA::Object_var obj = this->ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ this->event_forwarder_ = Event_Forwarder::StructuredProxyPushSupplier::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+
+ return object._retn ();
+}
+
+CORBA::Object_ptr
+TAO_Notify_RT_StructuredProxyPushSupplier::activate (PortableServer::Servant ,
+ CORBA::Long ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return CORBA::Object::_nil ();
+}
+
+void
+TAO_Notify_RT_StructuredProxyPushSupplier::deliver (TAO_Notify_Method_Request_Dispatch_No_Copy & request ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ request.event()->push (this->event_forwarder_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level > 2)
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "(%P|%t) TAO_Notify_RT_StructuredProxyPushSupplier::push failed\n");
+ }
+
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_Notify_RT_StructuredProxyPushSupplier::push_no_filtering (const TAO_Notify_Event* event ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ event->push_no_filtering (this->event_forwarder_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level > 2)
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "(%P|%t) TAO_Notify_RT_StructuredProxyPushSupplier::push failed\n");
+ }
+
+ }
+ ACE_ENDTRY;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.h b/TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.h
new file mode 100644
index 00000000000..995a4ceeb31
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.h
@@ -0,0 +1,63 @@
+/* -*- C++ -*- */
+/**
+ * @file RT_StructuredProxyPushSupplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_RT_STRUCTUREDPROXYPUSHSUPPLIER_H
+#define TAO_Notify_RT_STRUCTUREDPROXYPUSHSUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/rt_notify_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Structured/StructuredProxyPushSupplier.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_RT_StructuredProxyPushSupplier
+ *
+ * @brief
+ *
+ */
+class TAO_RT_Notify_Export TAO_Notify_RT_StructuredProxyPushSupplier :
+ public virtual TAO_Notify_StructuredProxyPushSupplier
+{
+public:
+ /// Constuctor
+ TAO_Notify_RT_StructuredProxyPushSupplier (void);
+
+ /// Destructor
+ ~TAO_Notify_RT_StructuredProxyPushSupplier ();
+
+ /// Activate this object and obtain the Event_Forwarder interface.
+ virtual CORBA::Object_ptr activate (PortableServer::Servant servant ACE_ENV_ARG_DECL);
+
+ /// Dummy method to prevent hidden TAO_Notify_Proxy::activate warning.
+ virtual CORBA::Object_ptr activate (PortableServer::Servant servant,
+ CORBA::Long id ACE_ENV_ARG_DECL);
+
+ /// Dispatch Event to consumer
+ void deliver (TAO_Notify_Method_Request_Dispatch_No_Copy & request ACE_ENV_ARG_DECL);
+
+ /// Dispatch Event to consumer, no filtering
+ virtual void push_no_filtering (const TAO_Notify_Event* event ACE_ENV_ARG_DECL);
+
+private:
+ /// Our ref.
+ Event_Forwarder::StructuredProxyPushSupplier_var event_forwarder_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_RT_STRUCTUREDPROXYPUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp
new file mode 100644
index 00000000000..86d312d8f4e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp
@@ -0,0 +1,142 @@
+// $Id$
+
+#include "orbsvcs/Notify/Structured/StructuredEvent.h"
+
+ACE_RCSID(RT_Notify, TAO_Notify_StructuredEvent, "$Id$")
+
+#include "orbsvcs/Notify/PropertySeq.h"
+#include "orbsvcs/Notify/Consumer.h"
+#include "tao/debug.h"
+#include "tao/corba.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_StructuredEvent_No_Copy::TAO_Notify_StructuredEvent_No_Copy (const CosNotification::StructuredEvent &notification)
+ : notification_ (&notification), type_ (notification.header.fixed_header.event_type)
+{
+ 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)
+ this->priority_.set (prop_seq[i].value);
+ else if (ACE_OS::strcmp (prop_seq[i].name.in (), CosNotification::Timeout) == 0)
+ this->timeout_.set (prop_seq[i].value);
+ }
+}
+
+const TAO_Notify_EventType&
+TAO_Notify_StructuredEvent_No_Copy::type (void) const
+{
+ return this->type_;
+}
+
+TAO_Notify_StructuredEvent_No_Copy::~TAO_Notify_StructuredEvent_No_Copy ()
+{
+}
+
+void
+TAO_Notify_StructuredEvent_No_Copy::marshal (TAO_OutputCDR & cdr) const
+{
+ static const ACE_CDR::Octet STRUCTURED_CODE = MARSHAL_STRUCTURED;
+ cdr.write_octet (STRUCTURED_CODE);
+ cdr << (*this->notification_);
+}
+
+//static
+TAO_Notify_StructuredEvent *
+TAO_Notify_StructuredEvent_No_Copy::unmarshal (TAO_InputCDR & cdr)
+{
+ TAO_Notify_StructuredEvent * event = 0;
+ CosNotification::StructuredEvent body;
+ if (cdr >> body)
+ {
+ event = new TAO_Notify_StructuredEvent (body);
+ }
+ return event;
+}
+
+TAO_Notify_Event *
+TAO_Notify_StructuredEvent_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL) const
+{
+ TAO_Notify_Event * new_event;
+ ACE_NEW_THROW_EX (new_event,
+ TAO_Notify_StructuredEvent (*this->notification_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+ return new_event;
+}
+
+CORBA::Boolean
+TAO_Notify_StructuredEvent_No_Copy::do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) const
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Notify (%P|%t) - "
+ "TAO_Notify_StructuredEvent::do_match ()\n"));
+
+ return filter->match_structured (*this->notification_ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_StructuredEvent_No_Copy::convert (CosNotification::StructuredEvent& notification) const
+{
+ notification = *this->notification_;
+}
+
+void
+TAO_Notify_StructuredEvent_No_Copy::push (TAO_Notify_Consumer* consumer ACE_ENV_ARG_DECL) const
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Notify (%P|%t) - "
+ "TAO_Notify_StructuredEvent::do_push ("
+ "CosNotifyComm::StructuredPushConsumer_ptr)\n"));
+
+ consumer->push (*this->notification_ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_StructuredEvent_No_Copy::push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const
+{
+ forwarder->forward_structured (*this->notification_ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_StructuredEvent_No_Copy::push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const
+{
+ forwarder->forward_structured_no_filtering (*this->notification_ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_StructuredEvent_No_Copy::push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const
+{
+ CORBA::Any any;
+
+ TAO_Notify_Event::translate (*this->notification_, any);
+
+ forwarder->forward_any (any ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_StructuredEvent_No_Copy::push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const
+{
+ CORBA::Any any;
+
+ TAO_Notify_Event::translate (*this->notification_, any);
+
+ forwarder->forward_any_no_filtering (any ACE_ENV_ARG_PARAMETER);
+}
+
+/*****************************************************************************************************/
+
+TAO_Notify_StructuredEvent::TAO_Notify_StructuredEvent (const CosNotification::StructuredEvent& notification)
+ : TAO_Notify_StructuredEvent_No_Copy (notification)
+ , notification_copy (notification)
+{
+ this->notification_ = &notification_copy;
+}
+
+TAO_Notify_StructuredEvent::~TAO_Notify_StructuredEvent ()
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h
new file mode 100644
index 00000000000..5ed850afd93
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h
@@ -0,0 +1,112 @@
+/* -*- C++ -*- */
+/**
+ * @file StructuredEvent.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+#ifndef TAO_Notify_STRUCTUREDEVENT_H
+#define TAO_Notify_STRUCTUREDEVENT_H
+
+#include /**/ "ace/pre.h"
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Event.h"
+#include "orbsvcs/Notify/EventType.h"
+#include "orbsvcs/CosNotificationC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_StructuredEvent;
+
+/**
+ * @class TAO_Notify_StructuredEvent_No_Copy
+ *
+ * @brief StructuredEvent implementation.
+ *
+ */
+
+class TAO_Notify_Serv_Export TAO_Notify_StructuredEvent_No_Copy : public TAO_Notify_Event
+{
+public:
+ /// Constuctor
+ TAO_Notify_StructuredEvent_No_Copy (const CosNotification::StructuredEvent& notification);
+
+ /// Destructor
+ virtual ~TAO_Notify_StructuredEvent_No_Copy ();
+
+ /// marshal this event into a CDR buffer (for persistence)
+ virtual void marshal (TAO_OutputCDR & cdr) const;
+
+ CORBA::Boolean do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) const;
+
+ /// Convert to CosNotification::Structured type
+ virtual void convert (CosNotification::StructuredEvent& notification) const;
+
+ /// Get the event type.
+ virtual const TAO_Notify_EventType& type (void) const;
+
+ /// Push event to consumer
+ virtual void push (TAO_Notify_Consumer* consumer ACE_ENV_ARG_DECL) const;
+
+ /// Push event to the Event_Forwarder interface
+ virtual void push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const;
+
+ /// Push event to the Event_Forwarder interface
+ virtual void push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const;
+
+ /// Push event to the Event_Forwarder interface
+ virtual void push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const;
+
+ /// Push event to the Event_Forwarder interface
+ virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const;
+
+ /// unmarshal this event from a CDR buffer (for persistence)
+ /// \return the new event, or NULL if this is the wrong type of event.
+ static TAO_Notify_StructuredEvent * unmarshal (TAO_InputCDR & cdr);
+
+protected:
+ /// returns a copy of this event allocated on the heap
+ virtual TAO_Notify_Event * copy (ACE_ENV_SINGLE_ARG_DECL) const;
+
+ /// Structured Event
+ const CosNotification::StructuredEvent* notification_;
+
+ /// Our type.
+ const TAO_Notify_EventType type_;
+};
+
+/*****************************************************************************/
+
+/**
+ * @class TAO_Notify_StructuredEvent
+ *
+ * @brief StructuredEvent implementation.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_StructuredEvent : public TAO_Notify_StructuredEvent_No_Copy
+{
+public:
+ /// Constuctor
+ TAO_Notify_StructuredEvent (const CosNotification::StructuredEvent& notification);
+
+ /// Destructor
+ virtual ~TAO_Notify_StructuredEvent ();
+
+
+protected:
+ /// Copy of the Event.
+ CosNotification::StructuredEvent notification_copy;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_STRUCTUREDEVENT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.cpp
new file mode 100644
index 00000000000..d79e907a741
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.cpp
@@ -0,0 +1,135 @@
+// $Id$
+
+#include "orbsvcs/Notify/Structured/StructuredProxyPushConsumer.h"
+
+ACE_RCSID(RT_Notify, TAO_Notify_StructuredProxyPushConsumer, "$Id$")
+
+#include "ace/Bound_Ptr.h"
+#include "ace/Auto_Ptr.h"
+#include "tao/debug.h"
+#include "orbsvcs/Notify/Structured/StructuredPushSupplier.h"
+#include "orbsvcs/Notify/Structured/StructuredEvent.h"
+#include "orbsvcs/Notify/AdminProperties.h"
+#include "orbsvcs/Notify/Properties.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_StructuredProxyPushConsumer::TAO_Notify_StructuredProxyPushConsumer (void)
+{
+}
+
+TAO_Notify_StructuredProxyPushConsumer::~TAO_Notify_StructuredProxyPushConsumer ()
+{
+}
+
+void
+TAO_Notify_StructuredProxyPushConsumer::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+CosNotifyChannelAdmin::ProxyType
+TAO_Notify_StructuredProxyPushConsumer::MyType (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return CosNotifyChannelAdmin::PUSH_STRUCTURED;
+}
+
+void
+TAO_Notify_StructuredProxyPushConsumer::connect_structured_push_supplier (CosNotifyComm::StructuredPushSupplier_ptr push_supplier ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventChannelAdmin::AlreadyConnected
+ ))
+{
+ // Convert Supplier to Base Type
+ TAO_Notify_StructuredPushSupplier * supplier;
+ ACE_NEW_THROW_EX (supplier,
+ TAO_Notify_StructuredPushSupplier (this),
+ CORBA::NO_MEMORY ());
+
+ supplier->init (push_supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->connect (supplier ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_StructuredProxyPushConsumer::push_structured_event (const CosNotification::StructuredEvent & notification ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventComm::Disconnected
+ ))
+{
+ // Check if we should proceed at all.
+ if (this->admin_properties().reject_new_events () == 1
+ && this->admin_properties().queue_full ())
+ ACE_THROW (CORBA::IMP_LIMIT ());
+
+ if (this->is_connected () == 0)
+ {
+ ACE_THROW (CosEventComm::Disconnected ());
+ }
+
+ TAO_Notify_StructuredEvent_No_Copy event (notification);
+ this->push_i (&event ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_StructuredProxyPushConsumer::disconnect_structured_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_StructuredProxyPushConsumer::Ptr guard( this );
+ this->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+const char *
+TAO_Notify_StructuredProxyPushConsumer::get_proxy_type_name (void) const
+{
+ return "structured_proxy_push_consumer";
+}
+
+void
+TAO_Notify_StructuredProxyPushConsumer::load_attrs (const TAO_Notify::NVPList& attrs)
+{
+ SuperClass::load_attrs(attrs);
+ ACE_CString ior;
+ if (attrs.load("PeerIOR", ior))
+ {
+ CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ ACE_TRY_CHECK;
+ CosNotifyComm::StructuredPushSupplier_var ps = CosNotifyComm::StructuredPushSupplier::_nil();
+ if ( ior.length() > 0 )
+ {
+ CORBA::Object_var obj = orb->string_to_object(ior.c_str() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ps = CosNotifyComm::StructuredPushSupplier::_unchecked_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ // minor hack: suppress generating subscription updates during reload.
+ bool save_updates = this->updates_off_;
+ this->updates_off_ = true;
+ this->connect_structured_push_supplier(ps.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->updates_off_ = save_updates;
+ }
+ ACE_CATCHANY
+ {
+ // if we can't reconnect to peer, tough...
+ }
+ ACE_ENDTRY;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.h
new file mode 100644
index 00000000000..82ec83de086
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.h
@@ -0,0 +1,105 @@
+/* -*- C++ -*- */
+/**
+ * @file StructuredProxyPushConsumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_STRUCTUREDPROXYPUSHCONSUMER_H
+#define TAO_Notify_STRUCTUREDPROXYPUSHCONSUMER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+
+#include "orbsvcs/Notify/ProxyConsumer_T.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_StructuredProxyPushConsumer
+ *
+ * @brief CosNotifyChannelAdmin::StructuredProxyPushConsumer implementation.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_StructuredProxyPushConsumer
+ : public virtual TAO_Notify_ProxyConsumer_T <POA_CosNotifyChannelAdmin::StructuredProxyPushConsumer>
+{
+ typedef TAO_Notify_ProxyConsumer_T <POA_CosNotifyChannelAdmin::StructuredProxyPushConsumer> SuperClass;
+ friend class TAO_Notify_Builder;
+
+public:
+ /// Constuctor
+ TAO_Notify_StructuredProxyPushConsumer (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_StructuredProxyPushConsumer ();
+
+
+ virtual void load_attrs (const TAO_Notify::NVPList& attrs);
+
+protected:
+
+ // = interface methods
+ virtual CosNotifyChannelAdmin::ProxyType MyType (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void connect_structured_push_supplier (
+ CosNotifyComm::StructuredPushSupplier_ptr push_supplier
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected
+ ));
+
+ 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
+ ));
+
+ virtual const char * get_proxy_type_name (void) const;
+
+private:
+
+ /// Release
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_STRUCTUREDPROXYPUSHCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushSupplier.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushSupplier.cpp
new file mode 100644
index 00000000000..10e753f3437
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushSupplier.cpp
@@ -0,0 +1,111 @@
+// $Id$
+
+#include "orbsvcs/Notify/Structured/StructuredProxyPushSupplier.h"
+
+#include "tao/PortableServer/Servant_Base.h"
+#include "tao/debug.h"
+
+#include "orbsvcs/Notify/Structured/StructuredPushConsumer.h"
+#include "orbsvcs/Notify/Properties.h"
+
+
+ACE_RCSID(RT_Notify, TAO_Notify_StructuredProxyPushSupplier, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_StructuredProxyPushSupplier::TAO_Notify_StructuredProxyPushSupplier (void)
+{
+}
+
+TAO_Notify_StructuredProxyPushSupplier::~TAO_Notify_StructuredProxyPushSupplier ()
+{
+}
+
+void
+TAO_Notify_StructuredProxyPushSupplier::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+CosNotifyChannelAdmin::ProxyType
+TAO_Notify_StructuredProxyPushSupplier::MyType (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return CosNotifyChannelAdmin::PUSH_STRUCTURED;
+}
+
+void
+TAO_Notify_StructuredProxyPushSupplier::connect_structured_push_consumer (CosNotifyComm::StructuredPushConsumer_ptr push_consumer ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventChannelAdmin::AlreadyConnected
+ , CosEventChannelAdmin::TypeError
+ ))
+{
+ // Convert Consumer to Base Type
+ TAO_Notify_StructuredPushConsumer* consumer;
+ ACE_NEW_THROW_EX (consumer,
+ TAO_Notify_StructuredPushConsumer (this),
+ CORBA::NO_MEMORY ());
+
+ consumer->init (push_consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->connect (consumer ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_StructuredProxyPushSupplier::disconnect_structured_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+
+{
+ TAO_Notify_StructuredProxyPushSupplier::Ptr guard( this );
+ this->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+const char *
+TAO_Notify_StructuredProxyPushSupplier::get_proxy_type_name (void) const
+{
+ return "structured_proxy_push_supplier";
+}
+
+void
+TAO_Notify_StructuredProxyPushSupplier::load_attrs (const TAO_Notify::NVPList& attrs)
+{
+ SuperClass::load_attrs(attrs);
+ ACE_CString ior;
+ if (attrs.load("PeerIOR", ior))
+ {
+ CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosNotifyComm::StructuredPushConsumer_var pc = CosNotifyComm::StructuredPushConsumer::_nil();
+ if (ior.length() > 0)
+ {
+ CORBA::Object_var obj = orb->string_to_object(ior.c_str() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ pc = CosNotifyComm::StructuredPushConsumer::_unchecked_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ this->connect_structured_push_consumer(pc.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // if we can't connect... tough
+ }
+ ACE_ENDTRY;
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushSupplier.h b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushSupplier.h
new file mode 100644
index 00000000000..b3a3526dbe9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushSupplier.h
@@ -0,0 +1,103 @@
+/* -*- C++ -*- */
+/**
+ * @file StructuredProxyPushSupplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_STRUCTUREDPROXYPUSHSUPPLIER_H
+#define TAO_Notify_STRUCTUREDPROXYPUSHSUPPLIER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/Event_ForwarderS.h"
+
+#include "orbsvcs/Notify/ProxySupplier_T.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+#if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT
+template class TAO_Notify_Serv_Export
+TAO_Notify_ProxySupplier_T<POA_Event_Forwarder::StructuredProxyPushSupplier>;
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */
+
+/**
+ * @class TAO_Notify_StructuredProxyPushSupplier
+ *
+ * @brief Implements the CosNotifyChannelAdmin::StructuredProxyPushSupplier methods.
+ *
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_StructuredProxyPushSupplier
+ : public virtual TAO_Notify_ProxySupplier_T <POA_Event_Forwarder::StructuredProxyPushSupplier>
+{
+ typedef TAO_Notify_ProxySupplier_T <POA_Event_Forwarder::StructuredProxyPushSupplier> SuperClass;
+ friend class TAO_Notify_Builder;
+
+public:
+ /// Constuctor
+ TAO_Notify_StructuredProxyPushSupplier (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_StructuredProxyPushSupplier ();
+
+
+ virtual void load_attrs (const TAO_Notify::NVPList& attrs);
+
+ /// = Servant methods
+ // = interface methods
+ virtual CosNotifyChannelAdmin::ProxyType MyType (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void connect_structured_push_consumer (
+ CosNotifyComm::StructuredPushConsumer_ptr push_consumer
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventChannelAdmin::AlreadyConnected,
+ CosEventChannelAdmin::TypeError
+ ));
+
+ virtual void disconnect_structured_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual const char * get_proxy_type_name (void) const;
+
+private:
+
+ /// Release
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_STRUCTUREDPROXYPUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp
new file mode 100644
index 00000000000..feb1b56c29c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp
@@ -0,0 +1,101 @@
+// $Id$
+#include "orbsvcs/Notify/Structured/StructuredPushConsumer.h"
+
+ACE_RCSID(RT_Notify, TAO_Notify_StructuredPushConsumer, "$Id$")
+
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/Event.h"
+#include "ace/Bound_Ptr.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_StructuredPushConsumer::TAO_Notify_StructuredPushConsumer (TAO_Notify_ProxySupplier* proxy)
+ :TAO_Notify_Consumer (proxy)
+{
+}
+
+TAO_Notify_StructuredPushConsumer::~TAO_Notify_StructuredPushConsumer ()
+{
+}
+
+void
+TAO_Notify_StructuredPushConsumer::init (CosNotifyComm::StructuredPushConsumer_ptr push_consumer ACE_ENV_ARG_DECL)
+{
+ // Initialize only once
+ ACE_ASSERT( CORBA::is_nil (this->push_consumer_.in()) );
+
+ if (CORBA::is_nil (push_consumer))
+ {
+ ACE_THROW (CORBA::BAD_PARAM());
+ }
+
+ this->push_consumer_ = CosNotifyComm::StructuredPushConsumer::_duplicate (push_consumer);
+
+ this->publish_ = CosNotifyComm::NotifyPublish::_duplicate (push_consumer);
+
+}
+
+void
+TAO_Notify_StructuredPushConsumer::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+void
+TAO_Notify_StructuredPushConsumer::push (const CORBA::Any& event ACE_ENV_ARG_DECL)
+{
+ CosNotification::StructuredEvent notification;
+
+ TAO_Notify_Event::translate (event, notification);
+
+ this->push_consumer_->push_structured_event (notification ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_StructuredPushConsumer::push (const CosNotification::StructuredEvent& event ACE_ENV_ARG_DECL)
+{
+ this->push_consumer_->push_structured_event (event ACE_ENV_ARG_PARAMETER);
+}
+
+/// Push a batch of events to this consumer.
+void
+TAO_Notify_StructuredPushConsumer::push (const CosNotification::EventBatch& event ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_ASSERT(false);
+ ACE_UNUSED_ARG (event);
+ // TODO exception?
+}
+
+void
+TAO_Notify_StructuredPushConsumer::reconnect_from_consumer (TAO_Notify_Consumer* old_consumer
+ ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_StructuredPushConsumer* tmp = dynamic_cast<TAO_Notify_StructuredPushConsumer *> (old_consumer);
+ ACE_ASSERT(tmp != 0);
+ this->init(tmp->push_consumer_.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->schedule_timer(false);
+}
+
+ACE_CString
+TAO_Notify_StructuredPushConsumer::get_ior (void) const
+{
+ ACE_CString result;
+ CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::String_var ior = orb->object_to_string(this->push_consumer_.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ result = static_cast<const char*> (ior.in ());
+ }
+ ACE_CATCHANY
+ {
+ result.fast_clear();
+ }
+ ACE_ENDTRY;
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h
new file mode 100644
index 00000000000..9b9d603d383
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h
@@ -0,0 +1,81 @@
+/* -*- C++ -*- */
+/**
+ * @file StructuredPushConsumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_STRUCTUREDPUSHCONSUMER_H
+#define TAO_Notify_STRUCTUREDPUSHCONSUMER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/Notify/Consumer.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_ProxySupplier;
+
+/**
+ * @class TAO_Notify_StructuredPushConsumer
+ *
+ * @brief Wrapper for the StructuredPushConsumer that connect to the EventChannel.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_StructuredPushConsumer : public TAO_Notify_Consumer
+{
+public:
+ /// Constuctor
+ TAO_Notify_StructuredPushConsumer (TAO_Notify_ProxySupplier* proxy);
+
+ /// Init the Consumer
+ void init (CosNotifyComm::StructuredPushConsumer_ptr push_consumer ACE_ENV_ARG_DECL);
+
+ /// Destructor
+ virtual ~TAO_Notify_StructuredPushConsumer ();
+
+ /// Push <event> to this consumer.
+// virtual void push_i (const TAO_Notify_Event* event ACE_ENV_ARG_DECL);
+
+ /// Push <event> to this consumer.
+ virtual void push (const CORBA::Any& event ACE_ENV_ARG_DECL);
+
+ /// Push <event> to this consumer.
+ virtual void push (const CosNotification::StructuredEvent& event ACE_ENV_ARG_DECL);
+
+ /// Push a batch of events to this consumer.
+ virtual void push (const CosNotification::EventBatch& event ACE_ENV_ARG_DECL);
+
+ /// Retrieve the ior of this peer
+ virtual ACE_CString get_ior (void) const;
+
+ /// on reconnect we need to move events from the old consumer
+ /// to the new one
+ virtual void reconnect_from_consumer (
+ TAO_Notify_Consumer* old_consumer
+ ACE_ENV_ARG_DECL);
+
+
+protected:
+ /// The Consumer
+ CosNotifyComm::StructuredPushConsumer_var push_consumer_;
+
+private:
+ /// Release
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_STRUCTUREDPUSHCONSUMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushSupplier.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushSupplier.cpp
new file mode 100644
index 00000000000..69e28687a34
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushSupplier.cpp
@@ -0,0 +1,55 @@
+// $Id$
+
+#include "orbsvcs/Notify/Structured/StructuredPushSupplier.h"
+
+ACE_RCSID(RT_Notify, TAO_Notify_StructuredPushSupplier, "$Id$")
+#include "orbsvcs/Notify/Properties.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_StructuredPushSupplier::TAO_Notify_StructuredPushSupplier (TAO_Notify_ProxyConsumer* proxy)
+ :TAO_Notify_Supplier (proxy)
+{
+}
+
+TAO_Notify_StructuredPushSupplier::~TAO_Notify_StructuredPushSupplier ()
+{
+}
+
+void
+TAO_Notify_StructuredPushSupplier::init (CosNotifyComm::StructuredPushSupplier_ptr push_supplier ACE_ENV_ARG_DECL_NOT_USED)
+{
+ // TODO: verify single init call
+ // push_supplier is optional
+ this->push_supplier_ = CosNotifyComm::StructuredPushSupplier::_duplicate (push_supplier);
+ this->subscribe_ = CosNotifyComm::NotifySubscribe::_duplicate (push_supplier);
+}
+
+void
+TAO_Notify_StructuredPushSupplier::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+ACE_CString
+TAO_Notify_StructuredPushSupplier::get_ior (void) const
+{
+ ACE_CString result;
+ CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::String_var ior = orb->object_to_string(this->push_supplier_.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ result = static_cast<const char*> (ior.in ());
+ }
+ ACE_CATCHANY
+ {
+ result.fast_clear();
+ }
+ ACE_ENDTRY;
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushSupplier.h b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushSupplier.h
new file mode 100644
index 00000000000..b123bdb35d7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushSupplier.h
@@ -0,0 +1,62 @@
+/* -*- C++ -*- */
+/**
+ * @file StructuredPushSupplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_STRUCTUREDPUSHSUPPLIER_H
+#define TAO_Notify_STRUCTUREDPUSHSUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/Notify/Supplier.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_ProxyConsumer;
+
+/**
+ * @class TAO_Notify_StructuredPushSupplier
+ *
+ * @brief Wrapper for the StructuredPushSupplier that connect to the EventChannel.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_StructuredPushSupplier : public TAO_Notify_Supplier
+{
+public:
+ /// Constuctor
+ TAO_Notify_StructuredPushSupplier (TAO_Notify_ProxyConsumer* proxy);
+
+ /// Destructor
+ virtual ~TAO_Notify_StructuredPushSupplier ();
+
+ /// Init
+ void init (CosNotifyComm::StructuredPushSupplier_ptr push_supplier ACE_ENV_ARG_DECL);
+
+ /// Retrieve the ior of this peer
+ virtual ACE_CString get_ior (void) const;
+
+protected:
+ /// The Supplier
+ CosNotifyComm::StructuredPushSupplier_var push_supplier_;
+
+private:
+ /// Release
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_STRUCTUREDPUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Subscription_Change_Worker.cpp b/TAO/orbsvcs/orbsvcs/Notify/Subscription_Change_Worker.cpp
new file mode 100644
index 00000000000..70e0e846b04
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Subscription_Change_Worker.cpp
@@ -0,0 +1,29 @@
+// $Id$
+
+#include "orbsvcs/Notify/Subscription_Change_Worker.h"
+
+#include "orbsvcs/Notify/Proxy.h"
+
+ACE_RCSID(Notify, TAO_Subscription_Change_Worker, "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Subscription_Change_Worker::TAO_Notify_Subscription_Change_Worker (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed)
+ : added_ (added), removed_ (removed)
+{
+}
+
+TAO_Notify_Subscription_Change_Worker::~TAO_Notify_Subscription_Change_Worker ()
+{
+}
+
+void
+TAO_Notify_Subscription_Change_Worker::work (TAO_Notify_Proxy* proxy ACE_ENV_ARG_DECL)
+{
+ proxy->admin_types_changed (this->added_, this->removed_ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Subscription_Change_Worker.h b/TAO/orbsvcs/orbsvcs/Notify/Subscription_Change_Worker.h
new file mode 100644
index 00000000000..dc17f2a64b6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Subscription_Change_Worker.h
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+
+/**
+ * @file Subscription_Change_Worker.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_SUBSCRIPTION_CHANGE_WORKER_H
+#define TAO_SUBSCRIPTION_CHANGE_WORKER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotificationC.h"
+#include "orbsvcs/ESF/ESF_Worker.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Proxy;
+
+/**
+ * @class TAO_Subscription_Change_Worker
+ *
+ * @brief
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Subscription_Change_Worker : public TAO_ESF_Worker<TAO_Notify_Proxy>
+{
+public:
+ /// Constuctor
+ TAO_Notify_Subscription_Change_Worker (const CosNotification::EventTypeSeq & added, const CosNotification::EventTypeSeq & removed);
+
+ /// Destructor
+ virtual ~TAO_Notify_Subscription_Change_Worker ();
+
+ ///= TAO_ESF_Worker method
+ void work (TAO_Notify_Proxy* proxy ACE_ENV_ARG_DECL);
+
+protected:
+ const CosNotification::EventTypeSeq & added_;
+ const CosNotification::EventTypeSeq & removed_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_SUBSCRIPTION_CHANGE_WORKER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Supplier.cpp b/TAO/orbsvcs/orbsvcs/Notify/Supplier.cpp
new file mode 100644
index 00000000000..bf1d0eae7ee
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Supplier.cpp
@@ -0,0 +1,41 @@
+// $Id$
+
+#include "orbsvcs/Notify/Supplier.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Supplier.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Notify, TAO_Notify_Supplier, "$Id$")
+
+#include "orbsvcs/Notify/ProxyConsumer.h"
+#include "orbsvcs/Notify/Proxy.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Supplier::TAO_Notify_Supplier (TAO_Notify_ProxyConsumer* proxy)
+ : proxy_ (proxy)
+{
+}
+
+TAO_Notify_Supplier::~TAO_Notify_Supplier ()
+{
+}
+
+TAO_Notify_Proxy*
+TAO_Notify_Supplier::proxy (void)
+{
+ return this->proxy_consumer ();
+}
+
+void
+TAO_Notify_Supplier::dispatch_updates_i (
+ const CosNotification::EventTypeSeq& added,
+ const CosNotification::EventTypeSeq& removed
+ ACE_ENV_ARG_DECL)
+{
+ if (!CORBA::is_nil (this->subscribe_.in ()))
+ this->subscribe_->subscription_change (added, removed ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Supplier.h b/TAO/orbsvcs/orbsvcs/Notify/Supplier.h
new file mode 100644
index 00000000000..f8032aae3d7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Supplier.h
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+/**
+ * @file Supplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_SUPPLIER_H
+#define TAO_Notify_SUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Peer.h"
+
+#include "orbsvcs/CosNotifyCommC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_ProxyConsumer;
+
+/**
+ * @class TAO_Notify_Supplier
+ *
+ * @brief Base Wrappers for Suppliers that connect to the EventChannel.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Supplier : public TAO_Notify_Peer
+{
+public:
+ /// Constuctor
+ TAO_Notify_Supplier (TAO_Notify_ProxyConsumer* proxy);
+
+ /// Destructor
+ virtual ~TAO_Notify_Supplier ();
+
+ /// Access Specific Proxy.
+ TAO_Notify_ProxyConsumer* proxy_consumer (void);
+
+ /// Access Base Proxy.
+ virtual TAO_Notify_Proxy* proxy (void);
+
+protected:
+ /// Dispatch updates implementation.
+ virtual void dispatch_updates_i (const CosNotification::EventTypeSeq& added,
+ const CosNotification::EventTypeSeq& removed
+ ACE_ENV_ARG_DECL);
+
+ /// The proxy that we associate with.
+ TAO_Notify_ProxyConsumer* proxy_;
+
+ /// Interface that accepts subscription_changes
+ CosNotifyComm::NotifySubscribe_var subscribe_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Supplier.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_SUPPLIER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Supplier.inl b/TAO/orbsvcs/orbsvcs/Notify/Supplier.inl
new file mode 100644
index 00000000000..19d48fb5634
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Supplier.inl
@@ -0,0 +1,13 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE TAO_Notify_ProxyConsumer*
+TAO_Notify_Supplier::proxy_consumer (void)
+{
+ return this->proxy_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.cpp b/TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.cpp
new file mode 100644
index 00000000000..71ff8590b4c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.cpp
@@ -0,0 +1,430 @@
+// $Id$
+
+#include "orbsvcs/Notify/SupplierAdmin.h"
+
+ACE_RCSID (RT_Notify,
+ TAO_Notify_SupplierAdmin,
+ "$Id$")
+
+#include "orbsvcs/Notify/Builder.h"
+#include "orbsvcs/Notify/ProxyConsumer.h"
+#include "orbsvcs/Notify/EventChannel.h"
+#include "orbsvcs/Notify/Subscription_Change_Worker.h"
+#include "orbsvcs/Notify/Find_Worker_T.h"
+#include "orbsvcs/Notify/Seq_Worker_T.h"
+#include "orbsvcs/Notify/Properties.h"
+
+#include "tao/debug.h"
+
+#include "orbsvcs/ESF/ESF_Proxy_Collection.h"
+
+//#define DEBUG_LEVEL 9
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef TAO_Notify_Find_Worker_T<TAO_Notify_Proxy
+ , CosNotifyChannelAdmin::ProxyConsumer
+ , CosNotifyChannelAdmin::ProxyConsumer_ptr
+ , CosNotifyChannelAdmin::ProxyNotFound>
+TAO_Notify_ProxyConsumer_Find_Worker;
+
+typedef TAO_Notify_Seq_Worker_T<TAO_Notify_Proxy> TAO_Notify_Proxy_Seq_Worker;
+
+TAO_Notify_SupplierAdmin::TAO_Notify_SupplierAdmin (void)
+ : TAO_Notify_Admin ()
+{
+}
+
+const char *
+TAO_Notify_SupplierAdmin::get_admin_type_name () const
+{
+ return "supplier_admin";
+}
+
+TAO_Notify_SupplierAdmin::~TAO_Notify_SupplierAdmin ()
+{
+}
+
+void
+TAO_Notify_SupplierAdmin::init (TAO_Notify_EventChannel *ec ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Admin::init (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const CosNotification::QoSProperties &default_sa_qos =
+ TAO_Notify_PROPERTIES::instance ()->default_supplier_admin_qos_properties ();
+
+ this->set_qos (default_sa_qos ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_SupplierAdmin::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_incr_refcnt ();
+}
+
+void
+TAO_Notify_SupplierAdmin::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->_decr_refcnt ();
+}
+
+void
+TAO_Notify_SupplierAdmin::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+void
+TAO_Notify_SupplierAdmin::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ int result = this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ if ( result == 1)
+ return;
+
+ this->ec_->remove (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_Notify::Topology_Object*
+TAO_Notify_SupplierAdmin::load_child (const ACE_CString &type,
+ CORBA::Long id, const TAO_Notify::NVPList& attrs ACE_ENV_ARG_DECL)
+{
+ TAO_Notify::Topology_Object* result = this;
+ if (type == "proxy_push_consumer")
+ {
+ if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Admin reload proxy %d\n")
+ , static_cast<int> (id)
+ ));
+ result = this->load_proxy(id, CosNotifyChannelAdmin::ANY_EVENT, attrs ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ else if (type == "structured_proxy_push_consumer")
+ {
+ if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Admin reload proxy %d\n")
+ , static_cast<int> (id)
+ ));
+ result = this->load_proxy(id, CosNotifyChannelAdmin::STRUCTURED_EVENT, attrs ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ else if (type == "sequence_proxy_push_consumer")
+ {
+ if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Admin reload proxy %d\n")
+ , static_cast<int> (id)
+ ));
+ result = this->load_proxy(id, CosNotifyChannelAdmin::SEQUENCE_EVENT, attrs ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ else
+ {
+ result = TAO_Notify_Admin::load_child (type, id, attrs ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ return result;
+}
+
+TAO_Notify::Topology_Object*
+TAO_Notify_SupplierAdmin::load_proxy (
+ CORBA::Long id,
+ CosNotifyChannelAdmin::ClientType ctype,
+ const TAO_Notify::NVPList& attrs ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_Builder* bld = TAO_Notify_PROPERTIES::instance()->builder();
+ TAO_Notify_ProxyConsumer * proxy =
+ bld->build_proxy (this
+ , ctype
+ , id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ ACE_ASSERT(proxy != 0);
+ proxy->load_attrs (attrs);
+ return proxy;
+}
+
+
+void
+TAO_Notify_SupplierAdmin::set_qos (const CosNotification::QoSProperties & qos ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotification::UnsupportedQoS
+ ))
+{
+ this->TAO_Notify_Object::set_qos (qos ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotification::QoSProperties*
+TAO_Notify_SupplierAdmin::get_qos (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->TAO_Notify_Object::get_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::ProxyConsumer_ptr
+TAO_Notify_SupplierAdmin::obtain_notification_push_consumer (CosNotifyChannelAdmin::ClientType ctype
+ , CosNotifyChannelAdmin::ProxyID_out proxy_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::AdminLimitExceeded
+ ))
+
+{
+ CosNotification::QoSProperties initial_qos;
+
+ CosNotifyChannelAdmin::ProxyConsumer_var proxy =
+ TAO_Notify_PROPERTIES::instance()->builder()->build_proxy (this
+ , ctype
+ , proxy_id
+ , initial_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy._retn ());
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy._retn ());
+ return proxy._retn ();
+}
+
+CosNotifyChannelAdmin::ProxyConsumer_ptr
+TAO_Notify_SupplierAdmin::obtain_notification_push_consumer_with_qos (CosNotifyChannelAdmin::ClientType ctype,
+ CosNotifyChannelAdmin::ProxyID_out proxy_id,
+ const CosNotification::QoSProperties & initial_qos
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::AdminLimitExceeded
+ , CosNotification::UnsupportedQoS
+ ))
+{
+ CosNotifyChannelAdmin::ProxyConsumer_var proxy =
+ TAO_Notify_PROPERTIES::instance()->builder()->build_proxy (this
+ , ctype
+ , proxy_id,
+ initial_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy._retn ());
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy._retn ());
+ return proxy._retn ();
+}
+
+
+CosEventChannelAdmin::ProxyPushConsumer_ptr
+TAO_Notify_SupplierAdmin::obtain_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ CosEventChannelAdmin::ProxyPushConsumer_var proxy =
+ TAO_Notify_PROPERTIES::instance()->builder()->build_proxy (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy._retn ());
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (proxy._retn ());
+ return proxy._retn ();
+}
+
+CosNotifyChannelAdmin::AdminID
+TAO_Notify_SupplierAdmin::MyID (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->id ();
+}
+
+CosNotifyChannelAdmin::EventChannel_ptr
+TAO_Notify_SupplierAdmin::MyChannel (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->ec_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+::CosNotifyChannelAdmin::InterFilterGroupOperator
+TAO_Notify_SupplierAdmin::MyOperator (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->filter_operator_;
+}
+
+CosNotifyChannelAdmin::ProxyIDSeq*
+TAO_Notify_SupplierAdmin::push_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ TAO_Notify_Proxy_Seq_Worker seq_worker;
+
+ return seq_worker.create (this->proxy_container() ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyChannelAdmin::ProxyConsumer_ptr
+TAO_Notify_SupplierAdmin::get_proxy_consumer (CosNotifyChannelAdmin::ProxyID proxy_id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::ProxyNotFound
+ ))
+{
+ TAO_Notify_ProxyConsumer_Find_Worker find_worker;
+
+ return find_worker.resolve (proxy_id, this->proxy_container() ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_SupplierAdmin::offer_change (const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyComm::InvalidEventType
+ ))
+
+{
+ TAO_Notify_EventTypeSeq seq_added (added);
+ TAO_Notify_EventTypeSeq seq_removed (removed);
+
+ {
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ this->subscribed_types_.add_and_remove (seq_added, seq_removed);
+
+ TAO_Notify_Subscription_Change_Worker worker (added, removed);
+
+ this->proxy_container().collection ()->for_each (&worker ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+CosNotifyFilter::FilterID
+TAO_Notify_SupplierAdmin::add_filter (CosNotifyFilter::Filter_ptr new_filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ CosNotifyFilter::FilterID fid =
+ this->filter_admin_.add_filter (new_filter ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (fid);
+ this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (fid);
+ return fid;
+}
+
+void
+TAO_Notify_SupplierAdmin::remove_filter (CosNotifyFilter::FilterID filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyFilter::FilterNotFound
+ ))
+{
+ this->filter_admin_.remove_filter (filter ACE_ENV_ARG_PARAMETER);
+}
+
+::CosNotifyFilter::Filter_ptr
+TAO_Notify_SupplierAdmin::get_filter (CosNotifyFilter::FilterID filter ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyFilter::FilterNotFound
+ ))
+{
+ return this->filter_admin_.get_filter (filter ACE_ENV_ARG_PARAMETER);
+}
+
+::CosNotifyFilter::FilterIDSeq*
+TAO_Notify_SupplierAdmin::get_all_filters (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return this->filter_admin_.get_all_filters (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_SupplierAdmin::remove_all_filters (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ this->filter_admin_.remove_all_filters (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+/************** UNIMPLEMENTED METHODS ***************/
+
+CosEventChannelAdmin::ProxyPullConsumer_ptr
+TAO_Notify_SupplierAdmin::obtain_pull_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CosEventChannelAdmin::ProxyPullConsumer::_nil ());
+}
+
+CosNotifyChannelAdmin::ProxyIDSeq*
+TAO_Notify_SupplierAdmin::pull_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+
+void
+TAO_Notify_SupplierAdmin::validate_qos (const CosNotification::QoSProperties & /*required_qos*/,
+ CosNotification::NamedPropertyRangeSeq_out /*available_qos*/
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotification::UnsupportedQoS
+ ))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+CosNotifyChannelAdmin::ProxyConsumer_ptr
+TAO_Notify_SupplierAdmin::obtain_notification_pull_consumer (CosNotifyChannelAdmin::ClientType /*ctype*/,
+ CosNotifyChannelAdmin::ProxyID_out /*proxy_id*/
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyChannelAdmin::AdminLimitExceeded
+ ))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CosNotifyChannelAdmin::ProxyConsumer::_nil ());
+}
+
+TAO_Notify_ProxyConsumer *
+TAO_Notify_SupplierAdmin::find_proxy_consumer (
+ TAO_Notify::IdVec & id_path,
+ size_t position
+ ACE_ENV_ARG_DECL)
+{
+ TAO_Notify_ProxyConsumer * result = 0;
+ size_t path_size = id_path.size ();
+ if (position < path_size)
+ {
+ TAO_Notify_ProxyConsumer_Find_Worker find_worker;
+ TAO_Notify_Proxy * proxy = find_worker.find (id_path[position], this->proxy_container() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ result = dynamic_cast <TAO_Notify_ProxyConsumer *> (proxy);
+ }
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.h b/TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.h
new file mode 100644
index 00000000000..eeeaf0d40ab
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.h
@@ -0,0 +1,219 @@
+// -*- C++ -*-
+
+/**
+ * @file SupplierAdmin.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_SUPPLIERADMIN_H
+#define TAO_Notify_SUPPLIERADMIN_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+#include "orbsvcs/Notify/Admin.h"
+
+#include "orbsvcs/NotifyExtS.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_ProxyConsumer;
+
+/**
+ * @class TAO_Notify_SupplierAdmin
+ *
+ * @brief Implementation of CosNotifyChannelAdmin::SupplierAdmin
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_SupplierAdmin
+ : public virtual POA_NotifyExt::SupplierAdmin,
+ public virtual TAO_Notify_Admin
+{
+public:
+ typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_SupplierAdmin > Ptr;
+
+ /// Constuctor
+ TAO_Notify_SupplierAdmin (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_SupplierAdmin ();
+
+ /// Init
+ void init (TAO_Notify_EventChannel *ec ACE_ENV_ARG_DECL);
+
+ /// ServantBase refcount methods.
+ virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL);
+
+
+ virtual const char * get_admin_type_name () const;
+
+ virtual TAO_Notify::Topology_Object* load_child (
+ const ACE_CString &type,
+ CORBA::Long id,
+ const TAO_Notify::NVPList& attrs
+ ACE_ENV_ARG_DECL);
+
+ TAO_Notify_ProxyConsumer * find_proxy_consumer (
+ TAO_Notify::IdVec & id_path,
+ size_t position
+ ACE_ENV_ARG_DECL);
+
+protected:
+
+ TAO_Notify::Topology_Object *load_proxy (
+ CORBA::Long id,
+ CosNotifyChannelAdmin::ClientType ctype,
+ const TAO_Notify::NVPList& attrs
+ ACE_ENV_ARG_DECL);
+
+ /// = NotifyExt::SupplierAdmin methods
+ CosNotifyChannelAdmin::ProxyConsumer_ptr
+ obtain_notification_push_consumer_with_qos (
+ CosNotifyChannelAdmin::ClientType ctype,
+ CosNotifyChannelAdmin::ProxyID_out proxy_id,
+ const CosNotification::QoSProperties & initial_qos
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyChannelAdmin::AdminLimitExceeded,
+ CosNotification::UnsupportedQoS));
+
+ /// = CosNotifyChannelAdmin::SupplierAdmin methods
+ virtual CosNotifyChannelAdmin::AdminID MyID (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::CosNotifyChannelAdmin::EventChannel_ptr MyChannel (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::CosNotifyChannelAdmin::InterFilterGroupOperator MyOperator (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::CosNotifyChannelAdmin::ProxyIDSeq * pull_consumers (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::CosNotifyChannelAdmin::ProxyIDSeq * push_consumers (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::CosNotifyChannelAdmin::ProxyConsumer_ptr get_proxy_consumer (
+ CosNotifyChannelAdmin::ProxyID proxy_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyChannelAdmin::ProxyNotFound));
+
+ virtual ::CosNotifyChannelAdmin::ProxyConsumer_ptr
+ obtain_notification_pull_consumer (
+ CosNotifyChannelAdmin::ClientType ctype,
+ CosNotifyChannelAdmin::ProxyID_out proxy_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyChannelAdmin::AdminLimitExceeded));
+
+ virtual ::CosNotifyChannelAdmin::ProxyConsumer_ptr
+ obtain_notification_push_consumer (
+ CosNotifyChannelAdmin::ClientType ctype,
+ CosNotifyChannelAdmin::ProxyID_out proxy_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyChannelAdmin::AdminLimitExceeded));
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::CosNotification::QoSProperties* get_qos (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void set_qos (const CosNotification::QoSProperties& qos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotification::UnsupportedQoS));
+
+ virtual void validate_qos (
+ const CosNotification::QoSProperties & required_qos,
+ CosNotification::NamedPropertyRangeSeq_out available_qos
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotification::UnsupportedQoS));
+
+ virtual void offer_change (const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyComm::InvalidEventType
+ ));
+
+ virtual CosNotifyFilter::FilterID add_filter (
+ CosNotifyFilter::Filter_ptr new_filter ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void remove_filter (
+ CosNotifyFilter::FilterID filter ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyFilter::FilterNotFound));
+
+ virtual ::CosNotifyFilter::Filter_ptr get_filter (
+ CosNotifyFilter::FilterID filter
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyFilter::FilterNotFound));
+
+ virtual ::CosNotifyFilter::FilterIDSeq * get_all_filters (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void remove_all_filters (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::CosEventChannelAdmin::ProxyPushConsumer_ptr obtain_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::CosEventChannelAdmin::ProxyPullConsumer_ptr obtain_pull_consumer (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// Release
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_SUPPLIERADMIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Supplier_Map.h b/TAO/orbsvcs/orbsvcs/Notify/Supplier_Map.h
new file mode 100644
index 00000000000..0a28afc1792
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Supplier_Map.h
@@ -0,0 +1,37 @@
+// -*- C++ -*-
+
+/**
+ * @file Supplier_Map.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_SUPPLIER_MAP_H
+#define TAO_Notify_SUPPLIER_MAP_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Event_Map_T.h"
+#include "orbsvcs/Notify/ProxyConsumer.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @typedef TAO_Notify_Supplier_Map
+ *
+ * @brief The Event Map for Suppliers.
+ *
+ */
+typedef TAO_Notify_Event_Map_T<TAO_Notify_ProxyConsumer, TAO_SYNCH_RW_MUTEX> TAO_Notify_Supplier_Map;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_SUPPLIER_MAP_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp
new file mode 100644
index 00000000000..01a7a51711f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp
@@ -0,0 +1,200 @@
+// $Id$
+
+#include "orbsvcs/Notify/ThreadPool_Task.h"
+
+ACE_RCSID(Notify, TAO_Notify_ThreadPool_Task, "$Id$")
+
+#include "orbsvcs/Notify/Properties.h"
+#include "orbsvcs/Notify/Timer_Queue.h"
+#include "orbsvcs/Notify/Buffering_Strategy.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+
+#include "ace/OS_NS_errno.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_ThreadPool_Task::TAO_Notify_ThreadPool_Task (void)
+: shutdown_ (false)
+{
+}
+
+TAO_Notify_ThreadPool_Task::~TAO_Notify_ThreadPool_Task ()
+{
+}
+
+int
+TAO_Notify_ThreadPool_Task::init (int argc, ACE_TCHAR **argv)
+{
+ return this->ACE_Task<ACE_NULL_SYNCH>::init (argc, argv);
+}
+
+TAO_Notify_Timer*
+TAO_Notify_ThreadPool_Task::timer (void)
+{
+ return this->timer_.get();
+}
+
+void
+TAO_Notify_ThreadPool_Task::init (const NotifyExt::ThreadPoolParams& tp_params,
+ const TAO_Notify_AdminProperties::Ptr& admin_properties ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (this->timer_.get() == 0);
+
+ TAO_Notify_Timer_Queue* timer = 0;
+ ACE_NEW_THROW_EX (timer,
+ TAO_Notify_Timer_Queue (),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ this->timer_.reset (timer);
+
+
+ TAO_Notify_Buffering_Strategy* buffering_strategy = 0;
+ ACE_NEW_THROW_EX (buffering_strategy,
+ TAO_Notify_Buffering_Strategy (*msg_queue (), admin_properties),
+ CORBA::NO_MEMORY ());
+ this->buffering_strategy_.reset (buffering_strategy);
+ ACE_CHECK;
+
+ long flags = THR_NEW_LWP | THR_DETACHED;
+ CORBA::ORB_var orb =
+ TAO_Notify_PROPERTIES::instance()->orb ();
+
+ flags |=
+ orb->orb_core ()->orb_params ()->thread_creation_flags ();
+
+ // Guards the thread for auto-deletion; paired with close.
+ // This is done in the originating thread before the spawn to
+ // avoid any race conditions.
+ for ( CORBA::ULong i = 0; i < tp_params.static_threads; ++i )
+ {
+ this->_incr_refcnt();
+ }
+
+ // Become an active object.
+ if (this->ACE_Task <ACE_NULL_SYNCH>::activate (flags,
+ tp_params.static_threads,
+ 0,
+ ACE_THR_PRI_OTHER_DEF) == -1)
+ {
+ // Undo the ref counts on error
+ for ( CORBA::ULong i = 0; i < tp_params.static_threads; ++i )
+ {
+ this->_decr_refcnt();
+ }
+
+ if (TAO_debug_level > 0)
+ {
+ if (ACE_OS::last_error () == EPERM)
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Insufficient privilege.\n")));
+ else
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%t) task activation at priority %d failed\n")
+ ACE_TEXT ("exiting!\n%a"),
+ tp_params.default_priority));
+ }
+ ACE_THROW (CORBA::BAD_PARAM ());
+ }
+}
+
+void
+TAO_Notify_ThreadPool_Task::execute (TAO_Notify_Method_Request& method_request ACE_ENV_ARG_DECL)
+{
+ if (!shutdown_)
+ {
+ TAO_Notify_Method_Request_Queueable* request_copy = method_request.copy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->buffering_strategy_->enqueue (request_copy) == -1)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "NS_ThreadPool_Task (%P|%t) - "
+ "failed to enqueue\n"));
+ }
+ }
+}
+
+int
+TAO_Notify_ThreadPool_Task::svc (void)
+{
+ TAO_Notify_Method_Request_Queueable* method_request;
+
+ while (!shutdown_)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ ACE_Time_Value* dequeue_blocking_time = 0;
+ ACE_Time_Value earliest_time;
+
+ if (!this->timer_->impl().is_empty ())
+ {
+ earliest_time = this->timer_->impl().earliest_time ();
+ dequeue_blocking_time = &earliest_time;
+ }
+
+ // Dequeue 1 item
+ int result = buffering_strategy_->dequeue (method_request, dequeue_blocking_time);
+
+ if (result > 0)
+ {
+ method_request->execute (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Message_Block::release (method_request);
+ }
+ else if (errno == ETIME)
+ {
+ this->timer_->impl ().expire ();
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "ThreadPool_Task dequeue failed\n"));
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ThreadPool_Task (%P|%t) exception in method request\n");
+ }
+ ACE_ENDTRY;
+ } /* while */
+
+ return 0;
+}
+
+void
+TAO_Notify_ThreadPool_Task::shutdown (void)
+{
+ if (this->shutdown_)
+ {
+ return;
+ }
+
+ this->shutdown_ = true;
+
+ this->buffering_strategy_->shutdown ();
+}
+
+void
+TAO_Notify_ThreadPool_Task::release (void)
+{
+ delete this;
+}
+
+int
+TAO_Notify_ThreadPool_Task::close (u_long)
+{
+ // _incr_refcnt() for each spawned thread in init()
+ this->_decr_refcnt();
+ return 0;
+}
+
+void
+TAO_Notify_ThreadPool_Task::update_qos_properties (const TAO_Notify_QoSProperties& qos_properties)
+{
+ this->buffering_strategy_->update_qos_properties (qos_properties);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h
new file mode 100644
index 00000000000..ffff9d3a1a6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h
@@ -0,0 +1,98 @@
+// -*- C++ -*-
+
+/**
+ * @file ThreadPool_Task.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_THREADPOOL_TASK_H
+#define TAO_Notify_THREADPOOL_TASK_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#include "orbsvcs/Notify/Timer_Queue.h"
+#include "orbsvcs/Notify/AdminProperties.h"
+#include "orbsvcs/Notify/Worker_Task.h"
+
+#include "ace/Task.h"
+#include "ace/Message_Queue.h"
+#include "ace/Reactor.h"
+#include "ace/Null_Condition.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Buffering_Strategy;
+
+/**
+ * @class TAO_Notify_ThreadPool_Task
+ *
+ * @brief Implements a Thread Pool Worker Task.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_ThreadPool_Task
+ : public TAO_Notify_Worker_Task
+ , public ACE_Task<ACE_NULL_SYNCH>
+{
+ friend class TAO_Notify_Method_Request_Shutdown;
+
+public:
+ /// Constuctor
+ TAO_Notify_ThreadPool_Task (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_ThreadPool_Task ();
+
+ /// Call the base class init
+ virtual int init (int argc, ACE_TCHAR **argv);
+
+ /// release reference to my self.
+ virtual int close (u_long flags);
+
+ /// Activate the threadpool
+ void init (const NotifyExt::ThreadPoolParams& tp_params, const TAO_Notify_AdminProperties::Ptr& admin_properties ACE_ENV_ARG_DECL);
+
+ /// Queue the request
+ virtual void execute (TAO_Notify_Method_Request& method_request ACE_ENV_ARG_DECL);
+
+ /// Shutdown task
+ virtual void shutdown ();
+
+ /// Update QoS Properties.
+ virtual void update_qos_properties (const TAO_Notify_QoSProperties& qos_properties);
+
+ /// The object used by clients to register timers.
+ virtual TAO_Notify_Timer* timer (void);
+
+protected:
+ /// Task svc
+ virtual int svc (void);
+
+private:
+ /// Release
+ virtual void release (void);
+
+ /// The buffering strategy to use.
+ ACE_Auto_Ptr< TAO_Notify_Buffering_Strategy > buffering_strategy_;
+
+ /// Shutdown
+ bool shutdown_;
+
+ /// The Queue based timer.
+ TAO_Notify_Timer_Queue::Ptr timer_;
+};
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_Notify_THREADPOOL_TASK_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Timer.h b/TAO/orbsvcs/orbsvcs/Notify/Timer.h
new file mode 100644
index 00000000000..3b3a829f7e7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Timer.h
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+
+/**
+ * @file Timer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_TIMER_H
+#define TAO_Notify_TIMER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Refcountable.h"
+
+#include "ace/Time_Value.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Event_Handler;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Timer
+ *
+ * @brief Interface for scheduling timers.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Timer : public TAO_Notify_Refcountable
+{
+public:
+ typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_Timer > Ptr;
+ /// Destructor
+ virtual ~TAO_Notify_Timer (){};
+
+ /// Schedule a timer
+ virtual long schedule_timer (ACE_Event_Handler *handler,
+ const ACE_Time_Value &delay_time,
+ const ACE_Time_Value &interval) = 0;
+
+ /// Cancel Timer
+ virtual int cancel_timer (long timer_id) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_TIMER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Timer_Queue.cpp b/TAO/orbsvcs/orbsvcs/Notify/Timer_Queue.cpp
new file mode 100644
index 00000000000..642f313f2f3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Timer_Queue.cpp
@@ -0,0 +1,48 @@
+// $Id$
+
+#include "orbsvcs/Notify/Timer_Queue.h"
+
+ACE_RCSID (Notify, TAO_Notify_Timer_Queue, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Timer_Queue::TAO_Notify_Timer_Queue (void)
+{
+}
+
+TAO_Notify_Timer_Queue::~TAO_Notify_Timer_Queue ()
+{
+}
+
+void
+TAO_Notify_Timer_Queue::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+long
+TAO_Notify_Timer_Queue::schedule_timer (ACE_Event_Handler *handler,
+ const ACE_Time_Value &delay_time,
+ const ACE_Time_Value &interval)
+{
+ return
+ this->timer_queue_.schedule (handler,
+ 0,
+ timer_queue_.gettimeofday () + delay_time,
+ interval);
+}
+
+int
+TAO_Notify_Timer_Queue::cancel_timer (long timer_id)
+{
+ return this->timer_queue_.cancel (timer_id);
+}
+
+ACE_Timer_Queue&
+TAO_Notify_Timer_Queue::impl (void)
+{
+ return this->timer_queue_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Timer_Queue.h b/TAO/orbsvcs/orbsvcs/Notify/Timer_Queue.h
new file mode 100644
index 00000000000..3f0f021e217
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Timer_Queue.h
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+/**
+ * @file Timer_Queue.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_TIMER_QUEUE_H
+#define TAO_Notify_TIMER_QUEUE_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#include "orbsvcs/Notify/Timer.h"
+
+#include "ace/Timer_Queue.h"
+#include "ace/Timer_Heap.h"
+#include "ace/Recursive_Thread_Mutex.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Timer_Queue
+ *
+ * @brief ACE_Timer_Queue based timer.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Timer_Queue : public TAO_Notify_Timer
+{
+public:
+ typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_Timer_Queue > Ptr;
+
+ /// Constuctor
+ TAO_Notify_Timer_Queue (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Timer_Queue ();
+
+
+ /// Schedule a timer
+ virtual long schedule_timer (ACE_Event_Handler *handler,
+ const ACE_Time_Value &delay_time,
+ const ACE_Time_Value &interval);
+
+ /// Cancel Timer
+ virtual int cancel_timer (long timer_id);
+
+ /// Get the native impl.
+ ACE_Timer_Queue& impl (void);
+
+protected:
+ /// The Timer Queue
+ ACE_Timer_Heap timer_queue_;
+
+private:
+ /// Release
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_TIMER_QUEUE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Timer_Reactor.cpp b/TAO/orbsvcs/orbsvcs/Notify/Timer_Reactor.cpp
new file mode 100644
index 00000000000..8109a230c30
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Timer_Reactor.cpp
@@ -0,0 +1,50 @@
+// $Id$
+
+#include "orbsvcs/Notify/Timer_Reactor.h"
+
+ACE_RCSID (Notify,
+ Timer_Reactor,
+ "$Id$")
+
+#include "orbsvcs/Notify/Properties.h"
+#include "tao/ORB_Core.h"
+#include "ace/Reactor.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Timer_Reactor::TAO_Notify_Timer_Reactor (void)
+ :reactor_ (0)
+{
+ // Get the ORB
+ CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb ();
+
+ this->reactor_ = orb->orb_core ()->reactor ();
+}
+
+TAO_Notify_Timer_Reactor::~TAO_Notify_Timer_Reactor ()
+{
+}
+
+void
+TAO_Notify_Timer_Reactor::release (void)
+{
+ delete this;
+ //@@ inform factory
+}
+
+long
+TAO_Notify_Timer_Reactor::schedule_timer (ACE_Event_Handler *handler,
+ const ACE_Time_Value &delay_time,
+ const ACE_Time_Value &interval)
+{
+ return this->reactor_->schedule_timer (handler, 0, delay_time, interval);
+}
+
+int
+TAO_Notify_Timer_Reactor::cancel_timer (long timer_id)
+{
+ return this->reactor_->cancel_timer (timer_id);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Timer_Reactor.h b/TAO/orbsvcs/orbsvcs/Notify/Timer_Reactor.h
new file mode 100644
index 00000000000..31ef686604c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Timer_Reactor.h
@@ -0,0 +1,66 @@
+// -*- C++ -*-
+
+/**
+ * @file Timer_Reactor.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_TIMER_REACTOR_H
+#define TAO_Notify_TIMER_REACTOR_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+#include "orbsvcs/Notify/Timer.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Reactor;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Timer_Reactor
+ *
+ * @brief Reactor::instance based timer. The timers are dispatched by
+ * the main thread.
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Timer_Reactor : public TAO_Notify_Timer
+{
+public:
+ typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_Timer_Reactor > Ptr;
+
+ /// Constuctor
+ TAO_Notify_Timer_Reactor (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Timer_Reactor ();
+
+
+ /// Schedule a timer
+ virtual long schedule_timer (ACE_Event_Handler *handler,
+ const ACE_Time_Value &delay_time,
+ const ACE_Time_Value &interval);
+
+ /// Cancel Timer
+ virtual int cancel_timer (long timer_id);
+
+protected:
+ /// The instance reactor that we use.
+ ACE_Reactor* reactor_;
+
+private:
+ /// Release
+ virtual void release (void);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_TIMER_REACTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Topology_Factory.h b/TAO/orbsvcs/orbsvcs/Notify/Topology_Factory.h
new file mode 100644
index 00000000000..33f313825a6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Topology_Factory.h
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+
+/**
+ * @file Topology_Factory.h
+ *
+ * $Id$
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+
+#ifndef TAO_NOTIFY_TOPOLOGY_FACTORY_H
+#define TAO_NOTIFY_TOPOLOGY_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#include "ace/Service_Object.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ class Topology_Saver;
+ class Topology_Loader;
+
+ /**
+ * @brief Service Object to allow dynamic control of the loaded saver factory.
+ *
+ */
+ class TAO_Notify_Serv_Export Topology_Factory : public ACE_Service_Object
+ {
+ public:
+ /// Create a Saver.
+ /// \return a pointer to a Topology_Saver which must be deleted
+ /// by the caller.
+ virtual Topology_Saver* create_saver () = 0;
+ /// Create a Loader
+ /// \return a pointer to a Topology_Loader which must be deleted
+ /// by the caller.
+ virtual Topology_Loader* create_loader () = 0;
+ virtual ~Topology_Factory ();
+ };
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Topology_Loader.cpp b/TAO/orbsvcs/orbsvcs/Notify/Topology_Loader.cpp
new file mode 100644
index 00000000000..27eeb6ad143
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Topology_Loader.cpp
@@ -0,0 +1,20 @@
+// $Id$
+
+#include "orbsvcs/Notify/Topology_Loader.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify::Topology_Loader::Topology_Loader ()
+{
+}
+
+TAO_Notify::Topology_Loader::~Topology_Loader ()
+{
+}
+
+void
+TAO_Notify::Topology_Loader::close (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Topology_Loader.h b/TAO/orbsvcs/orbsvcs/Notify/Topology_Loader.h
new file mode 100644
index 00000000000..599afa07985
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Topology_Loader.h
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Topology_Loader.h
+ *
+ * $Id$
+ *
+ * @author Jonathan Pollack <pollack_j@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef TOPOLOGY_LOADER_H
+#define TOPOLOGY_LOADER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+#include "ace/CORBA_macros.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace CORBA
+{
+ class Environment;
+}
+
+namespace TAO_Notify
+{
+
+/// A forward declaration.
+class Topology_Object;
+
+/**
+ * \brief An interface for an object that loads Persistent Topology Information.
+ *
+ * A persistent store must provide an implemention this interface.
+ *
+ */
+class TAO_Notify_Serv_Export Topology_Loader
+{
+public:
+ /// The constructor.
+ Topology_Loader ();
+
+ /// The destructor.
+ virtual ~Topology_Loader ();
+
+ /** \brief Begin the restore process.
+ *
+ * Call this function to start the reload of data from a persistent store.
+ * When the Topology_Loader detects a child object, it should
+ * call the load_child method of the object passed in, then do the same
+ * loading process on the returned object.
+ */
+ virtual void load (Topology_Object *root ACE_ENV_ARG_DECL) = 0;
+
+ /**
+ * \brief Close the loader after loading is complete.
+ *
+ * This is not pure virtual because some loaders may not need to be closed.
+ * The default implementation does nothing.
+ *
+ * There should be a corresponding open, but the signature may
+ * vary based on the type of loader, so we can't include it in the
+ * interface.
+ */
+ virtual void close (ACE_ENV_SINGLE_ARG_DECL);
+};
+
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TOPOLOGY_LOADER */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Topology_Object.cpp b/TAO/orbsvcs/orbsvcs/Notify/Topology_Object.cpp
new file mode 100644
index 00000000000..ac174723aa3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Topology_Object.cpp
@@ -0,0 +1,151 @@
+// $Id$
+
+#include "orbsvcs/Notify/Topology_Object.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Topology_Object.inl"
+#endif /* __ACE_INLINE__ */
+
+// question: is there a race_conditon with self_changed and children_changed?
+// answer: toplogy_changed and/or children_changed must be set after the change is
+// made, and before the call to child_change.
+// self_changed and children_changed must be cleared before this object and its
+// children have been saved in Topology_Object::save_persistent ().
+// If these rules are followed, the only risk is a (harmless) extra save.
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ Topology_Savable::~Topology_Savable (void)
+ {
+ }
+
+ void
+ Topology_Savable::reconnect (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ {
+ }
+
+ Topology_Object::Topology_Object ()
+ : TAO_Notify_Object ()
+ , Topology_Savable ()
+ , self_changed_ (false)
+ , children_changed_ (false)
+ , topology_parent_ (0)
+ {
+ }
+
+ Topology_Object::~Topology_Object ()
+ {
+ }
+
+ void
+ Topology_Object::initialize (Topology_Parent* topology_parent ACE_ENV_ARG_DECL_NOT_USED)
+ {
+ ACE_ASSERT (topology_parent != 0 && this->topology_parent_ == 0);
+ this->topology_parent_ = topology_parent;
+ TAO_Notify_Object::initialize (topology_parent);
+ }
+
+ Topology_Parent *
+ Topology_Object::topology_parent () const
+ {
+ return this->topology_parent_;
+ }
+
+
+ Topology_Object *
+ Topology_Object::load_child (const ACE_CString & /*type*/,
+ CORBA::Long /* id */,
+ const NVPList& /* attrs */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ {
+ return 0;
+ }
+
+ bool
+ Topology_Object::is_persistent () const
+ {
+ bool result = false;
+ if (this->qos_properties_.event_reliability().is_valid ())
+ {
+ result = CosNotification::Persistent == this->qos_properties_.event_reliability().value ();
+ }
+ else if (this->topology_parent () != 0)
+ {
+ result = this->topology_parent ()->is_persistent ();
+ }
+ return result;
+ }
+
+ bool
+ Topology_Object::self_change (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ this->self_changed_ = true;
+ return send_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
+ bool
+ Topology_Object::send_change (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ bool saving = false;
+ if (is_persistent ())
+ {
+ while (this->self_changed_ || this->children_changed_)
+ {
+ saving = this->change_to_parent (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (false);
+ if (!saving)
+ {
+ this->self_changed_ = false;
+ this->children_changed_ = false;
+ }
+ }
+ }
+ else
+ {
+ this->self_changed_ = false;
+ this->children_changed_ = false;
+ }
+ return saving;
+ }
+
+ bool
+ Topology_Object::change_to_parent (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ bool result = false;
+ Topology_Parent * parent = this->topology_parent();
+ if (parent != 0)
+ {
+ result = parent->child_change(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (false);
+ }
+ return result;
+ }
+
+ void
+ Topology_Object::get_id_path (TAO_Notify::IdVec & id_path) const
+ {
+ if (this->topology_parent() != 0)
+ {
+ this->topology_parent()->get_id_path (id_path);
+ }
+ id_path.push_back (this->get_id ());
+ }
+
+ TAO_Notify_Object::ID
+ Topology_Object::get_id () const
+ {
+ // If this assert triggers then implement the
+ // get_id method in the actual class
+ // derived from Topology_Object
+ // or else figure out why this method was called
+ // on an object that doesn't have an id.
+ ACE_ASSERT (false);
+ // if it is called in a release build, provide 'em a value
+ return -1;
+ }
+
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Topology_Object.h b/TAO/orbsvcs/orbsvcs/Notify/Topology_Object.h
new file mode 100644
index 00000000000..53e825c0939
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Topology_Object.h
@@ -0,0 +1,213 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+* @file Topology_Object.h
+*
+* $Id$
+*
+* @author Jonathan Pollack <pollack_j@ociweb.com>
+*/
+//=============================================================================
+
+#ifndef TOPOLOGY_OBJECT_H
+#define TOPOLOGY_OBJECT_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/Object.h"
+#include "orbsvcs/Notify/Name_Value_Pair.h"
+
+#include "ace/SString.h"
+#include "ace/Vector_T.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// \namespace TAO_Notify
+/// \brief A namespace to be used by all of TAO's Notification Service
+/// implementation.
+///
+/// The initial implementation used the TAO_Notify_ prefix rather than
+/// a namespace. As part of the reliable Notification Service project
+/// we started using this TAO_Notify namespace, but there are still
+/// many parts of the Notification Service that are in the global
+/// namespace with a TAO_NS prefix.
+
+// @@ Wouldn't it be better to use something like
+//
+// namespace TAO
+// {
+// namespace Notify {}
+//
+// }
+//
+namespace TAO_Notify
+{
+ class Topology_Saver;
+ class Topology_Parent;
+
+ /// A vector of IDS. Used as a path from the EventChannelFactory to a proxy.
+ typedef ACE_Vector <TAO_Notify_Object::ID> IdVec;
+
+ /// \brief Interface to be implemented by savable topology objects.
+ class TAO_Notify_Serv_Export Topology_Savable
+ {
+ public:
+ /// Destructor.
+ virtual ~Topology_Savable (void);
+
+ /// Save our state to a Topology_Saver.
+ ///
+ /// Use the methods of a Topology_Saver to store all information we want
+ /// persisted. This function is called by our parent, which gives us a
+ /// saver to use. In turn, we must call this function on all of our
+ /// children.
+ /// The implementation should look like:
+ /// bool change = this->self_changed_;
+ /// this->self_changed_ = false;
+ /// this->children_changed_ = false;
+ /// if (is_persistent ())
+ /// {
+ /// bool want_all_children = saver.begin_object(
+ /// this->id(), type, attrs, change ACE_ENV_ARG_PARAMETER);
+ /// ACE_CHECK;
+ /// for all children
+ /// {
+ /// if (want_all_children || child.is_changed())
+ /// {
+ /// child.save_persistent(saver ACE_ENV_ARG_PARAMETER);
+ /// ACE_CHECK;
+ /// }
+ /// }
+ /// for all deleted children
+ /// {
+ /// saver.delete_child(child_type, child_id);
+ /// }
+ /// saver.end_object(this->id(), type ACE_ENV_ARG_PARAMETER);
+ /// )
+ virtual void save_persistent (Topology_Saver& saver ACE_ENV_ARG_DECL) = 0;
+
+ /// Re-establish connections that we had before a shutdown.
+ ///
+ /// After a topology restore, this method is called so we can reconnect
+ /// to any external objects with whom we were interacting. We should
+ /// call the reconnect() method on all of our children to give them
+ /// the chance to do the same.
+ virtual void reconnect (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+ };
+
+ /// \brief Base class for Persistent Topology Objects.
+ ///
+ /// Topology objects must be derived from this class to allow themselves
+ /// to be persisted.
+ /// Note: virtual inheritance from TopologySavable is unnecessary,
+ /// but HP ACC compiler warns if it's not there.
+ class TAO_Notify_Serv_Export Topology_Object :
+ public virtual TAO_Notify_Object,
+ public virtual Topology_Savable
+ {
+ public:
+ /// The constructor.
+ Topology_Object ();
+
+ /// The destructor.
+ virtual ~Topology_Object ();
+
+ /// Init this object with data from <rhs>.
+ virtual void initialize (Topology_Parent* topology_parent ACE_ENV_ARG_DECL);
+
+ /// \brief Create a child of the appropriate type and return it.
+ ///
+ /// Use "type" as passed in to determine what kind of child (supporting
+ /// the Topology_Object interface) to create and return. Inform it of
+ /// its new ID.
+ virtual Topology_Object* load_child (const ACE_CString & /*type*/,
+ CORBA::Long /* id */,
+ const NVPList& /* attrs */
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// \brief Find the id associated with topology object.
+ ///
+ /// A bit of a hack because id is unknown to Topology_Object
+ /// the get_id returns the same thing as id -- we just need someone
+ /// to find it for us.
+ virtual TAO_Notify_Object::ID get_id () const;
+
+ /// \brief Get the path of id's from the root to this object.
+ void get_id_path (IdVec & id_path) const;
+
+ /// \brief Is there an unsaved change for this object or its children?
+ bool is_changed () const;
+
+ protected:
+ /// \brief Should this object be saved?
+ ///
+ /// This is a way for send_change() and save_persistent() to find out
+ /// if this object has a persistent QoS connection property.
+ /// \return true (default) if object should be saved.
+ virtual bool is_persistent () const;
+
+ /// \brief Method to report change in this object
+ ///
+ /// see also Topology_Parent::child_change ()
+ /// \return false if save will never happen
+ bool self_change (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// \brief pointer to our topological parent
+ ///
+ /// \return 0 if none
+ Topology_Parent * topology_parent () const;
+
+ /// \brief Handle details of propagating change
+ ///
+ /// \return false if save will never happen
+ bool send_change (ACE_ENV_SINGLE_ARG_DECL);
+
+ private:
+ /// \brief Send change to parent.
+ ///
+ /// Override this if you don't expect to have a parent
+ /// (top level of tree)
+ /// private virtual because this should only be called from send_change()
+ /// \return false if save will never happen
+ virtual bool change_to_parent (ACE_ENV_SINGLE_ARG_DECL);
+
+ protected:
+ /// true if this object changed since last save_persistent
+ bool self_changed_;
+ /// true of any of this object's children changed since last save_persistent
+ bool children_changed_;
+
+ /// A safely-typed copy of parent_;
+ Topology_Parent * topology_parent_;
+ };
+
+ /// \brief Interface for topology objects that act as parents.
+ ///
+ /// Any topology object which contains other topology objects
+ /// must implement this interface so that it's children can signal
+ /// that they have changed.
+ class TAO_Notify_Serv_Export Topology_Parent : public Topology_Object
+ {
+ public:
+ /// Called by a child that has changed.
+ /// A child calls this method to report that it has changed.
+ /// \return false if save will never happen
+ bool child_change (ACE_ENV_SINGLE_ARG_DECL);
+ };
+
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Notify/Topology_Object.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TOPOLOGY_OBJECT */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Topology_Object.inl b/TAO/orbsvcs/orbsvcs/Notify/Topology_Object.inl
new file mode 100644
index 00000000000..14363a16d6f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Topology_Object.inl
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ ACE_INLINE
+ bool
+ Topology_Object::is_changed () const
+ {
+ return this->self_changed_ | this->children_changed_;
+ }
+
+ ACE_INLINE
+ bool
+ Topology_Parent::child_change (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ this->children_changed_ = true;
+ return send_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Topology_Saver.cpp b/TAO/orbsvcs/orbsvcs/Notify/Topology_Saver.cpp
new file mode 100644
index 00000000000..65c9aa9f681
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Topology_Saver.cpp
@@ -0,0 +1,16 @@
+// $Id$
+
+#include "orbsvcs/Notify/Topology_Saver.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify::Topology_Saver::~Topology_Saver ()
+{
+}
+
+void
+TAO_Notify::Topology_Saver::close (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Topology_Saver.h b/TAO/orbsvcs/orbsvcs/Notify/Topology_Saver.h
new file mode 100644
index 00000000000..91648109b7a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Topology_Saver.h
@@ -0,0 +1,114 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+* @file Topology_Saver.h
+*
+* $Id$
+*
+* @author Jonathan Pollack <pollack_j@ociweb.com>
+*/
+//=============================================================================
+
+#ifndef TOPOLOGY_SAVER_H
+#define TOPOLOGY_SAVER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/Topology_Object.h"
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ /**
+ * \brief An interface to be implemented by objects that save Topology.
+ *
+ * A persistent topology store must provide an implemention this interface.
+ *
+ */
+ class TAO_Notify_Serv_Export Topology_Saver
+ {
+ public:
+
+ /// The destructor.
+ virtual ~Topology_Saver ();
+
+ /** \brief Begin the storage of an object.
+ *
+ * Call this function with the type and ID of an object to be stored.
+ * This object may have children, and this will necessitate nested calls
+ * to begin_object.
+ * Design principle:
+ * Names should be descriptive enough to allow the objects' parent to create
+ * an instance of the desired class. This instance will be registered
+ * with the poa using the id.
+ * The instance itself should will load its own attributes.
+ * Example <proxy type="push_supplier" events="any" id="20"...> is not a
+ * good design because the name "proxy" is not descriptive enough.
+ * "<structured_proxy_push_supplier id="20"...> is better because this
+ * allows the parent to create the correct type of object without decoding
+ * attributes.
+ * \param id numeric id for this object
+ * \param type string containing the unique type name for this class of objects
+ * \param attrs a collection of name/value attributes
+ * \param change true if this object's attributes have changed.
+ * \return bool want_all_children. If true even changed children should be saved.
+ */
+ virtual bool begin_object (CORBA::Long id,
+ const ACE_CString &type,
+ const NVPList& attrs,
+ bool changed
+ ACE_ENV_ARG_DECL) = 0;
+
+ /** \brief Report deleted children to the saver.
+ *
+ * Use the ID and "type" as passed in to determine which child we should
+ * delete. A parent should call this function when one of its children
+ * is deleted.
+ * \param id numeric id for the deleted child
+ * \param type the type name for the class of the deleted child.
+ *
+ */
+ virtual void delete_child (
+ CORBA::Long id,
+ const ACE_CString & type
+ ACE_ENV_ARG_DECL_NOT_USED)
+ {
+ ACE_UNUSED_ARG (id);
+ ACE_UNUSED_ARG (type);
+ }
+
+ /** \brief End the storage of an object.
+ *
+ * This function should be called to end the scope of the current object
+ * and commit it to the persistent store.
+ */
+ virtual void end_object (CORBA::Long id,
+ const ACE_CString &type
+ ACE_ENV_ARG_DECL) = 0;
+
+ /**
+ * \brief Close the saver.
+ *
+ * This is not pure virtual. The default implementation does nothing.
+ *
+ * There should be a corresponding open, but the signature may
+ * vary based on the type of saver, so we can't include it in the
+ * interface.
+ */
+ virtual void close (ACE_ENV_SINGLE_ARG_DECL);
+ };
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TOPOLOGY_SAVER */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Worker_Task.cpp b/TAO/orbsvcs/orbsvcs/Notify/Worker_Task.cpp
new file mode 100644
index 00000000000..6fb6d3c2e6b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Worker_Task.cpp
@@ -0,0 +1,22 @@
+// $Id$
+
+#include "orbsvcs/Notify/Worker_Task.h"
+
+ACE_RCSID(Notify, TAO_Notify_Worker_Task, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Notify_Worker_Task::TAO_Notify_Worker_Task (void)
+{
+}
+
+TAO_Notify_Worker_Task::~TAO_Notify_Worker_Task ()
+{
+}
+
+void
+TAO_Notify_Worker_Task::update_qos_properties (const TAO_Notify_QoSProperties& /*qos_properties*/)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Worker_Task.h b/TAO/orbsvcs/orbsvcs/Notify/Worker_Task.h
new file mode 100644
index 00000000000..b1e529c56bd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/Worker_Task.h
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+
+/**
+ * @file Worker_Task.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef TAO_Notify_WORKER_TASK_H
+#define TAO_Notify_WORKER_TASK_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/notify_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Notify/Method_Request.h"
+#include "orbsvcs/Notify/Refcountable.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_AdminProperties;
+class TAO_Notify_QoSProperties;
+class TAO_Notify_Timer;
+class TAO_Notify_Buffering_Strategy;
+
+/**
+ * @class TAO_Notify_Worker_Task
+ *
+ * @brief Base Worker Task.
+ *
+ * Memory Management : The Worker Task should be allocated on the heap and
+ * the <shutdown> method should be called to release memory.
+ *
+ */
+class TAO_Notify_Serv_Export TAO_Notify_Worker_Task : public TAO_Notify_Refcountable
+{
+public:
+ typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_Worker_Task > Ptr;
+
+ /// Constuctor
+ TAO_Notify_Worker_Task (void);
+
+ /// Update QoS Properties.
+ virtual void update_qos_properties (const TAO_Notify_QoSProperties& qos_properties);
+
+ ///= Public method to be implemented by subclasses.
+ /// Exec the request.
+ virtual void execute (TAO_Notify_Method_Request& method_request ACE_ENV_ARG_DECL) = 0;
+
+ /// Shutdown task
+ virtual void shutdown (void) = 0;
+
+ /// The object used by clients to register timers.
+ virtual TAO_Notify_Timer* timer (void) = 0;
+
+
+protected:
+ /// Destructor
+ virtual ~TAO_Notify_Worker_Task ();
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_WORKER_TASK_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/XML_Loader.cpp b/TAO/orbsvcs/orbsvcs/Notify/XML_Loader.cpp
new file mode 100644
index 00000000000..7dd33e5deb6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/XML_Loader.cpp
@@ -0,0 +1,234 @@
+// $Id$
+
+#include "orbsvcs/Notify/XML_Loader.h"
+#include "orbsvcs/Notify/Topology_Object.h"
+
+#include "ACEXML/common/DefaultHandler.h"
+#include "ACEXML/parser/parser/Parser.h"
+#include "ACEXML/common/FileCharStream.h"
+
+#include "ace/Containers_T.h"
+#include "tao/debug.h"
+#include "ace/OS_NS_unistd.h"
+
+//#define DEBUG_LEVEL 9
+#ifndef DEBUG_LEVEL
+# define DEBUG_LEVEL TAO_debug_level
+#endif //DEBUG_LEVEL
+
+using namespace TAO_Notify;
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify {
+ extern const char TOPOLOGY_ID_NAME[];
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+namespace {
+ CORBA::Long makeNVPList (NVPList& nvp, ACEXML_Attributes* attrs)
+ {
+ CORBA::Long id = 0;
+ for (size_t i = 0; i < attrs->getLength (); ++i)
+ {
+ const char * name = attrs->getQName (i);
+ const char * value = attrs->getValue (i);
+ if (ACE_OS::strcmp (name,
+ TAO_VERSIONED_NAMESPACE_NAME::TAO_Notify::TOPOLOGY_ID_NAME) == 0)
+ {
+ id = ACE_OS::atoi (value);
+ }
+ nvp.push_back (NVP (name, value));
+ }
+ return id;
+ }
+}
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ XML_Loader::XML_Loader ()
+ : input_ (0)
+ , live_ (false)
+ {
+ }
+
+ XML_Loader::~XML_Loader ()
+ {
+ }
+
+ bool
+ XML_Loader::open (const ACE_CString & base_name)
+ {
+ bool result = false;
+
+ // if *.xml exists, use it
+ // if it does not exist then
+ // use the previous one was renamed to *.000
+ // If neither *.xml nor *.000 exist then something
+ // "impossible" happened (or its a new system with no saved state).
+
+ this->file_name_ = base_name;
+ this->file_name_ += ".xml";
+
+ // 4 is "read permission"
+ result = (0 == ACE_OS::access (this->file_name_.c_str (), 4));
+ if (result)
+ {
+ this->live_ = false;
+ ACEXML_FileCharStream* fstm = new ACEXML_FileCharStream;
+ // xml input source will take ownership
+
+ if (fstm->open (this->file_name_.c_str ()) == 0)
+ {
+ // InputSource takes ownership
+ ACEXML_InputSource input (fstm);
+
+ ACEXML_Parser parser;
+ parser.setContentHandler (this);
+ parser.setDTDHandler (this);
+ parser.setErrorHandler (this);
+ parser.setEntityResolver (this);
+
+ ACEXML_TRY_NEW_ENV
+ {
+ parser.parse (&input ACEXML_ENV_ARG_PARAMETER);
+ ACEXML_TRY_CHECK;
+ }
+ ACEXML_CATCH (ACEXML_Exception, ex)
+ {
+ // The only way to find out what it is, it to let it print itself, so...
+ ACE_ERROR ((LM_ERROR, "Unable to load \"%s\".\n Will try backup file.\n", this->file_name_.c_str ()));
+ ex.print ();
+ result = false;
+ }
+ ACEXML_ENDTRY;
+ }
+ else
+ {
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("Unable to open the XML input file: %s.\n Will try backup file.\n"), file_name_.c_str()));
+ result = false;
+ }
+ }
+
+ if (! result)
+ {
+ this->file_name_ = base_name;
+ this->file_name_ += ".000";
+ result = (0 == ACE_OS::access (this->file_name_.c_str (), 4));
+ }
+ return result;
+ }
+
+ //virtual
+ void
+ XML_Loader::load (Topology_Object *root ACE_ENV_ARG_DECL)
+ {
+ ACE_ASSERT (root != 0);
+ this->live_ = true;
+
+ ACEXML_FileCharStream* fstm = new ACEXML_FileCharStream;
+ // xml input source will take ownership
+
+ if (fstm->open (this->file_name_.c_str ()) == 0)
+ {
+ // InputSource takes ownership
+ ACEXML_InputSource input (fstm);
+
+ ACEXML_Parser parser;
+ parser.setContentHandler (this);
+ parser.setDTDHandler (this);
+ parser.setErrorHandler (this);
+ parser.setEntityResolver (this);
+
+ ACEXML_TRY_NEW_ENV
+ {
+ object_stack_.push (root);
+ parser.parse (&input ACEXML_ENV_ARG_PARAMETER);
+ ACEXML_TRY_CHECK;
+ ACE_ASSERT (object_stack_.size () == 1);
+ Topology_Object* cur;
+ object_stack_.pop (cur);
+ }
+ ACEXML_CATCH (ACEXML_Exception, ex)
+ {
+ // The only way to find out what it is, it to let it print itself, so...
+ ACE_ERROR ((LM_ERROR, "Unable to load \"%s\".\n", this->file_name_.c_str ()));
+ ex.print ();
+ ACE_THROW(CORBA::INTERNAL());
+ }
+ ACEXML_ENDTRY;
+ }
+ else
+ {
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("Unable to open the XML input file: %s.\n"), file_name_.c_str()));
+ ACE_THROW(CORBA::INTERNAL());
+ }
+ }
+
+ void
+ XML_Loader::startElement (const ACEXML_Char*,
+ const ACEXML_Char*,
+ const ACEXML_Char* name,
+ ACEXML_Attributes* xml_attrs ACEXML_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (ACEXML_SAXException))
+ {
+ ACE_ASSERT (name != 0);
+ ACE_ASSERT (xml_attrs != 0);
+ if (this->live_)
+ {
+ ACE_ASSERT (object_stack_.size () > 0);
+ Topology_Object* cur = 0;
+ if (object_stack_.top (cur) == 0)
+ {
+ ACE_DECLARE_NEW_ENV;
+ ACE_TRY
+ {
+ NVPList attrs;
+ CORBA::Long id = makeNVPList (attrs, xml_attrs);
+
+ if (DEBUG_LEVEL > 5) ACE_DEBUG ((LM_INFO,
+ ACE_TEXT("(%P|%t) XML_Loader: Element %s\n"),
+ name
+ ));
+
+ ACE_CString cname (name);
+ Topology_Object* next = cur->load_child (
+ cname, id, attrs ACE_ENV_ARG_PARAMETER);
+ ACE_ASSERT(next != 0);
+ ACE_TRY_CHECK;
+ object_stack_.push (next);
+ }
+ ACE_CATCHANY
+ {
+ ACEXML_THROW (ACEXML_SAXException (ACE_ANY_EXCEPTION._info ().c_str ()));
+ }
+ ACE_ENDTRY;
+ }
+ }
+ }
+
+ void
+ XML_Loader::endElement (const ACEXML_Char*,
+ const ACEXML_Char*,
+ const ACEXML_Char* name ACEXML_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ( (ACEXML_SAXException))
+ {
+ ACE_UNUSED_ARG (name);
+ if (this->live_)
+ {
+ ACE_ASSERT (object_stack_.size () > 0);
+ if (DEBUG_LEVEL > 5) ACE_DEBUG ((LM_INFO,
+ ACE_TEXT("(%P|%t) XML_Loader: End Element %s\n"),
+ name
+ ));
+ Topology_Object* cur;
+ object_stack_.pop (cur);
+ }
+ }
+
+} /* namespace TAO_Notify */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/XML_Loader.h b/TAO/orbsvcs/orbsvcs/Notify/XML_Loader.h
new file mode 100644
index 00000000000..7069179d9bd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/XML_Loader.h
@@ -0,0 +1,87 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file XML_Loader.h
+ *
+ * $Id$
+ *
+ * A topology saver class that outputs XML.
+ *
+ * @author Jonathan Pollack <pollack_j@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef XML_LOADER_H
+#define XML_LOADER_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/Notify/Topology_Loader.h"
+
+#include "ACEXML/common/DefaultHandler.h"
+#include "ACEXML/parser/parser/Parser.h"
+#include "ACEXML/common/FileCharStream.h"
+
+#include "ace/streams.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ /// \brief Load Notification Service Topology from an XML file.
+class XML_Loader : public ACEXML_DefaultHandler , public Topology_Loader
+{
+public:
+ /// The constructor.
+ XML_Loader ();
+
+ virtual ~XML_Loader ();
+
+ /// Open a file and perform preliminary validation to determine whether
+ /// the file is complete and valid.
+ bool open (const ACE_CString & file_name);
+
+ ///////////////////////////////////
+ // Override Topology_Loader methods
+ // see Topology_Loader.h for documentation
+ virtual void load (Topology_Object *root ACE_ENV_ARG_DECL);
+
+
+ /////////////////////////////////////////
+ // Override ACEXML_DefaultHandler methods
+
+ virtual void startElement (const ACEXML_Char* namespaceURI,
+ const ACEXML_Char* localName,
+ const ACEXML_Char* qName,
+ ACEXML_Attributes* atts ACEXML_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((ACEXML_SAXException));
+
+ virtual void endElement (const ACEXML_Char*,
+ const ACEXML_Char*,
+ const ACEXML_Char* name ACEXML_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((ACEXML_SAXException));
+
+
+private:
+ /// The name of the file from which data is read.
+ ACE_CString file_name_;
+ /// A stream representing our current output.
+ FILE * input_;
+
+ typedef ACE_Unbounded_Stack<Topology_Object*> TopoStack;
+ TopoStack object_stack_;
+ // if false, then we're just checking syntax of topology file.
+ bool live_;
+};
+
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* XML_LOADER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/XML_Saver.cpp b/TAO/orbsvcs/orbsvcs/Notify/XML_Saver.cpp
new file mode 100644
index 00000000000..f6f0864b46f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/XML_Saver.cpp
@@ -0,0 +1,203 @@
+// $Id$
+
+#include "orbsvcs/Notify/XML_Saver.h"
+
+#include "ACEXML/common/XML_Util.h"
+
+#include "ace/High_Res_Timer.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ extern const char TOPOLOGY_ID_NAME[];
+
+ XML_Saver::XML_Saver(bool timestamp)
+ : output_ (0)
+ , close_out_ (false)
+ , backup_count_ (1)
+ , timestamp_ (timestamp)
+ {
+ }
+
+ XML_Saver::~XML_Saver()
+ {
+ if (this->output_ != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) XML_Saver warning close not called or failed\n")
+ ));
+ }
+ }
+
+ void
+ XML_Saver::backup_file_name (char * file_path, int nfile)
+ {
+ ACE_OS::snprintf(file_path, MAXPATHLEN, "%s.%3.3d",
+ this->base_name_.c_str (),
+ nfile);
+ }
+
+ void
+ XML_Saver::close (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ if (this->close_out_ && this->output_ != 0)
+ {
+ this->end_object(0, "notification_service" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_OS::fclose(this->output_);
+ this->output_ = 0;
+
+ // delete the oldest backup file (if it exists)
+ size_t nfile = this->backup_count_ - 1;
+ char old_path [MAXPATHLEN + 1];
+ backup_file_name (old_path, nfile);
+ ACE_OS::unlink (old_path);
+
+ while (nfile != 0)
+ {
+ char new_path [MAXPATHLEN + 1];
+ nfile -= 1;
+ backup_file_name (new_path, nfile);
+ // this may fail, we don't care
+ ACE_OS::rename (new_path, old_path);
+ ACE_OS::strcpy (old_path, new_path);
+ }
+ // old_path now contains the name of the backup file
+ ACE_CString xml_name = this->base_name_;
+ xml_name += ".xml";
+
+ ACE_OS::rename (xml_name.c_str (), old_path);
+
+ ACE_CString new_name = this->base_name_;
+ new_name += ".new";
+ ACE_OS::rename (new_name.c_str (), xml_name.c_str ());
+ }
+ this->output_ = 0;
+ }
+
+ bool
+ XML_Saver::open(const ACE_CString & base_name, size_t backup_count)
+ {
+ this->base_name_ = base_name;
+ this->backup_count_ = backup_count;
+ if (base_name == "cout")
+ {
+ this->output_ = stdout;
+ this->close_out_ = false;
+ }
+ else if (base_name == "cerr")
+ {
+ this->output_ = stderr;
+ this->close_out_ = false;
+ }
+ else
+ {
+ ACE_CString file_name = base_name;
+ file_name += ".new";
+
+ this->output_ = ACE_OS::fopen (file_name.c_str(), ACE_TEXT("wb"));
+ if (this->output_) {
+ this->close_out_ = true;
+ } else {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) XML_Saver unable to open %s\n"),
+ base_name.c_str()));
+ }
+ }
+ if (this->output_ != 0)
+ {
+ FILE *out = this->output_;
+
+ ACE_OS::fprintf (out, "<?xml version=\"1.0\"?>\n");
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ bool changed = true;
+ NVPList attrs;
+
+ ACE_Time_Value now = ACE_High_Res_Timer::gettimeofday();
+
+ ACE_UINT64 nowus = now.usec();
+ static const ACE_UINT64 USECSPERSEC = 1000 * 1000;
+ ACE_UINT64 tmpus = now.sec();
+ nowus += tmpus * USECSPERSEC;
+
+ char nowusstr[128];
+#ifdef ACE_LACKS_LONGLONG_T
+ nowus.as_string(nowusstr);
+#else
+ ACE_OS::sprintf(nowusstr, ACE_UINT64_FORMAT_SPECIFIER, nowus);
+#endif /* ACE_LACKS_LONGLONG_T */
+
+ attrs.push_back(NVP("version", "1.0"));
+ if (this->timestamp_)
+ {
+ attrs.push_back(NVP("timestamp", nowusstr));
+ }
+ this->begin_object(0, "notification_service", attrs, changed ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("(%P|%t) XML_Saver Unknown exception\n"));
+ delete this->output_;
+ this->output_ = 0;
+ }
+ ACE_ENDTRY;
+ }
+ return this->output_ != 0;
+ }
+
+ bool XML_Saver::begin_object(CORBA::Long id,
+ const ACE_CString& type,
+ const NVPList& attrs,
+ bool /* changed */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ {
+ ACE_ASSERT(this->output_ != 0);
+
+ FILE *out = this->output_;
+
+ ACE_OS::fprintf (out, "%s%s%s", indent_.c_str(), "<", type.c_str());
+ if (id != 0)
+ {
+ // not all ostreams know what to do with a CORBA::Long
+ long lid = id;
+ ACE_OS::fprintf (out, " %s%s%ld%s", TOPOLOGY_ID_NAME, "=\"", lid, "\"");
+ }
+
+ const size_t BUF_SIZE = 512;
+ ACE_CString tmp(BUF_SIZE);
+ for (size_t idx = 0; idx < attrs.size(); idx++)
+ {
+ ACEXML_escape_string(attrs[idx].value, tmp);
+ ACE_OS::fprintf (out, "%s%s%s%s%s", " ",
+ attrs[idx].name.c_str (), "=\"", tmp.c_str(), "\"");
+ }
+ ACE_OS::fprintf (out, ">\n");
+ this->indent_ += " ";
+ return true;
+ }
+
+ void XML_Saver::end_object (CORBA::Long /* id */,
+ const ACE_CString& type
+ ACE_ENV_ARG_DECL_NOT_USED)
+ {
+ ACE_ASSERT(this->output_ != 0);
+ FILE *out = this->output_;
+ if (this->indent_.length() >= 2)
+ {
+ this->indent_ = this->indent_.substr(2);
+ }
+ ACE_OS::fprintf (out, "%s%s%s%s", indent_.c_str(), "</",
+ type.c_str(), ">\n");
+ }
+} /* namespace TAO_Notify */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/XML_Saver.h b/TAO/orbsvcs/orbsvcs/Notify/XML_Saver.h
new file mode 100644
index 00000000000..f7c9afb87e1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/XML_Saver.h
@@ -0,0 +1,87 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file XML_Saver.h
+ *
+ * $Id$
+ *
+ * @author Jonathan Pollack <pollack_j@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef XML_SAVER_H
+#define XML_SAVER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/Topology_Saver.h"
+
+#include "ace/streams.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+
+/**
+ * \brief Save Notification Service Topology to an XML file.
+ */
+class XML_Saver : public Topology_Saver
+{
+public:
+ /// Construct an XML_Saver.
+ /// Initialization is deferred to "open()"
+ XML_Saver (bool timestamp = true);
+
+ virtual ~XML_Saver ();
+
+ /// Open the output file.
+ /// \param file_name the fully qualified file name
+ /// \return true if successful
+ bool open (const ACE_CString & file_name, size_t backup_count);
+
+ //////////////////////////////////
+ // Override Topology_Saver methods
+ // see Topology_Saver.h for doc
+ virtual bool begin_object (CORBA::Long id,
+ const ACE_CString& type,
+ const NVPList& attrs,
+ bool changed
+ ACE_ENV_ARG_DECL);
+
+ virtual void end_object (CORBA::Long id,
+ const ACE_CString& type
+ ACE_ENV_ARG_DECL);
+
+ virtual void close (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ void backup_file_name (char * file_path, int nfile);
+
+private:
+ /// A stream representing our current output.
+ FILE * output_;
+ bool close_out_;
+
+ /// the name of the output file
+ ACE_CString base_name_;
+ size_t backup_count_;
+
+ /// true to enable timestamping
+ bool timestamp_;
+
+ /// A string consisting of spaces that is our current indentation level.
+ ACE_CString indent_;
+
+};
+
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* XML_SAVER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/XML_Topology_Factory.cpp b/TAO/orbsvcs/orbsvcs/Notify/XML_Topology_Factory.cpp
new file mode 100644
index 00000000000..8b263987fe8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/XML_Topology_Factory.cpp
@@ -0,0 +1,162 @@
+// $Id$
+
+#include "orbsvcs/Notify/XML_Topology_Factory.h"
+#include "orbsvcs/Notify/XML_Saver.h"
+#include "orbsvcs/Notify/XML_Loader.h"
+
+#include "tao/debug.h"
+#include "ace/OS_NS_strings.h"
+//#include "ace/Service_Object.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ const char TOPOLOGY_ID_NAME[] = "TopologyID";
+
+ XML_Topology_Factory::XML_Topology_Factory()
+ : save_base_path_ ("./Notification_Service_Topology")
+ , load_base_path_ ("./Notification_Service_Topology")
+ , backup_count_ (2)
+ , timestamp_ (true)
+ {
+ }
+
+ // virtual
+ XML_Topology_Factory::~XML_Topology_Factory ()
+ {
+ }
+
+ // virtual
+ Topology_Saver*
+ XML_Topology_Factory::create_saver ()
+ {
+ XML_Saver *saver = 0;
+
+ ACE_NEW_RETURN (saver, XML_Saver (this->timestamp_), 0);
+
+ if (! saver->open ( this->save_base_path_.c_str (), this->backup_count_))
+ {
+ delete saver;
+ saver = 0;
+ }
+ return static_cast<Topology_Saver *> (saver);
+ }
+
+ // virtual
+ Topology_Loader*
+ XML_Topology_Factory::create_loader()
+ {
+ XML_Loader *loader = 0;
+ ACE_NEW_NORETURN(loader, XML_Loader);
+
+ if (! loader->open(this->load_base_path_))
+ {
+ delete loader;
+ loader = 0;
+ }
+ return static_cast<Topology_Loader *> (loader);
+ }
+
+ // virtual
+ int
+ XML_Topology_Factory::init (int argc, ACE_TCHAR *argv[])
+ {
+ int result = 0;
+ bool verbose = false;
+ for (int narg = 0; narg < argc; ++narg)
+ {
+ ACE_TCHAR * av = argv[narg];
+ if (ACE_OS::strcasecmp (av, "-v") == 0)
+ {
+ verbose = true;
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Standard_Event_Persistence: -verbose\n")
+ ));
+ }
+ else if (ACE_OS::strcasecmp (av, "-base_path") == 0 && narg + 1 < argc)
+ {
+ this->save_base_path_ = argv[narg + 1];
+ this->load_base_path_ = argv[narg + 1];
+ if (TAO_debug_level > 0 || verbose)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) XML_TopologyFactory: Setting -base_path: %s\n"),
+ this->save_base_path_.c_str ()
+ ));
+ }
+ narg += 1;
+ }
+ else if (ACE_OS::strcasecmp (av, "-save_base_path") == 0 && narg + 1 < argc)
+ {
+ this->save_base_path_ = argv[narg + 1];
+ if (TAO_debug_level > 0 || verbose)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) XML_TopologyFactory: Setting -save_base_path: %s\n"),
+ this->save_base_path_.c_str ()
+ ));
+ }
+ narg += 1;
+ }
+ else if (ACE_OS::strcasecmp (av, "-load_base_path") == 0 && narg + 1 < argc)
+ {
+ this->load_base_path_ = argv[narg + 1];
+ if (TAO_debug_level > 0 || verbose)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) XML_TopologyFactory: Setting -load_base_path: %s\n"),
+ this->load_base_path_.c_str ()
+ ));
+ }
+ narg += 1;
+ }
+ else if (ACE_OS::strcasecmp (av, "-backup_count") == 0 && narg + 1 < argc)
+ {
+ this->backup_count_ = ACE_OS::atoi(argv[narg + 1]);
+ if (TAO_debug_level > 0 || verbose)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) XML_TopologyFactory: Setting -file_count: %d\n"),
+ this->backup_count_
+ ));
+ }
+ narg += 1;
+ }
+ else if (ACE_OS::strcasecmp (av, "-no_timestamp") == 0)
+ {
+ this->timestamp_ = false;
+ if (TAO_debug_level > 0 || verbose)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) XML_TopologyFactory: Setting -no_timestamp\n")
+ ));
+ }
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Unknown parameter to XML Topology Factory: %s\n"),
+ argv[narg]
+ ));
+ result = -1;
+ }
+ }
+ return result;
+ }
+
+ // virtual
+ int
+ XML_Topology_Factory::fini ()
+ {
+ // nothing to do yet
+ return 0;
+ }
+} /* namespace TAO_Notify */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_NAMESPACE_DEFINE (TAO_Notify_Persist,
+ TAO_Notify_XML_Topology_Factory,
+ TAO_Notify::XML_Topology_Factory)
diff --git a/TAO/orbsvcs/orbsvcs/Notify/XML_Topology_Factory.h b/TAO/orbsvcs/orbsvcs/Notify/XML_Topology_Factory.h
new file mode 100644
index 00000000000..b6dc0686d8a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/XML_Topology_Factory.h
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file XML_Topology_Factory.h
+ *
+ * $Id$
+ *
+ * @author Jonathan Pollack <pollack_j@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef XML_TOPOLOGY_FACTORY_H
+#define XML_TOPOLOGY_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Notify/Topology_Factory.h"
+#include "orbsvcs/Notify/notify_persist_export.h"
+
+#include "tao/corba.h"
+#include "ace/SString.h"
+
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_Notify
+{
+ extern const char TOPOLOGY_ID_NAME[];
+
+ /**
+ * \brief Create XML topology savers and loaders
+ *
+ * Loaded by a svc.conf line like:
+ * dynamic Topology_Factory Service_Object* TAO_CosNotificationd:_make_XML_Topology_Factory() "[arguments]"
+ * where arguments are:
+ * -base_path Base path (directory and filename) for both saving and loading.
+ * .xml will be appended to the base path
+ * Default is ./Notification_Service_Topology
+ * -save_base_path Base path for saving.
+ * -load_base_path Base path for loading.
+ * -file_count How many backup copies to keep. Default is 1
+ * -no_timestamp Disable timestamping (makes files diffable)
+ * Note: you can set both saving and storing to the same file using -base_path
+ * Or you can set them independently using -save_base_path
+ * and -load_base_path
+ *
+ */
+ class TAO_Notify_Persist_Export XML_Topology_Factory : public Topology_Factory
+ {
+ public:
+ /// The constructor.
+ XML_Topology_Factory ();
+ virtual ~XML_Topology_Factory ();
+
+ ////////////////////////////////////
+ // Override Topology_Factory methods
+ // documented in Topology_Factory.h
+ virtual Topology_Saver* create_saver ();
+ virtual Topology_Loader* create_loader();
+
+ ////////////////////////////////
+ // Override Share_Object methods
+ // documented in ace/Shared_Object.h
+ virtual int init (int argc, ACE_TCHAR *argv[]);
+ virtual int fini ();
+
+ private:
+ ACE_CString save_base_path_;
+ ACE_CString load_base_path_;
+ size_t backup_count_;
+ bool timestamp_;
+ };
+
+} // namespace TAO_Notify
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DECLARE (TAO_Notify_Persist, TAO_Notify_XML_Topology_Factory)
+
+#include /**/ "ace/post.h"
+#endif /* XML_TOPOLOGY_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Notify/notify_export.h b/TAO/orbsvcs/orbsvcs/Notify/notify_export.h
new file mode 100644
index 00000000000..d17be740d41
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/notify_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_EXPORT_H
+#define TAO_NOTIFY_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_NOTIFY_HAS_DLL)
+# define TAO_NOTIFY_HAS_DLL 0
+# endif /* ! TAO_NOTIFY_HAS_DLL */
+#else
+# if !defined (TAO_NOTIFY_HAS_DLL)
+# define TAO_NOTIFY_HAS_DLL 1
+# endif /* ! TAO_NOTIFY_HAS_DLL */
+#endif
+
+#if defined (TAO_NOTIFY_HAS_DLL) && (TAO_NOTIFY_HAS_DLL == 1)
+# if defined (TAO_NOTIFY_BUILD_DLL)
+# define TAO_Notify_Export ACE_Proper_Export_Flag
+# define TAO_NOTIFY_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_NOTIFY_BUILD_DLL */
+# define TAO_Notify_Export ACE_Proper_Import_Flag
+# define TAO_NOTIFY_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_NOTIFY_BUILD_DLL */
+#else /* TAO_NOTIFY_HAS_DLL == 1 */
+# define TAO_Notify_Export
+# define TAO_NOTIFY_SINGLETON_DECLARATION(T)
+# define TAO_NOTIFY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_NOTIFY_HAS_DLL == 1 */
+
+#endif /* TAO_NOTIFY_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Notify/notify_persist_export.h b/TAO/orbsvcs/orbsvcs/Notify/notify_persist_export.h
new file mode 100644
index 00000000000..ae5ef11a7b9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/notify_persist_export.h
@@ -0,0 +1,60 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TAO_Notify_Persist
+// ------------------------------
+#ifndef TAO_NOTIFY_PERSIST_EXPORT_H
+#define TAO_NOTIFY_PERSIST_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_NOTIFY_PERSIST_HAS_DLL)
+# define TAO_NOTIFY_PERSIST_HAS_DLL 0
+# endif /* ! TAO_NOTIFY_PERSIST_HAS_DLL */
+#else
+# if !defined (TAO_NOTIFY_PERSIST_HAS_DLL)
+# define TAO_NOTIFY_PERSIST_HAS_DLL 1
+# endif /* ! TAO_NOTIFY_PERSIST_HAS_DLL */
+#endif
+
+#if defined (TAO_NOTIFY_PERSIST_HAS_DLL) && (TAO_NOTIFY_PERSIST_HAS_DLL == 1)
+# if defined (TAO_NOTIFY_PERSIST_BUILD_DLL)
+# define TAO_Notify_Persist_Export ACE_Proper_Export_Flag
+# define TAO_NOTIFY_PERSIST_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFY_PERSIST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_NOTIFY_PERSIST_BUILD_DLL */
+# define TAO_Notify_Persist_Export ACE_Proper_Import_Flag
+# define TAO_NOTIFY_PERSIST_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFY_PERSIST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_NOTIFY_PERSIST_BUILD_DLL */
+#else /* TAO_NOTIFY_PERSIST_HAS_DLL == 1 */
+# define TAO_Notify_Persist_Export
+# define TAO_NOTIFY_PERSIST_SINGLETON_DECLARATION(T)
+# define TAO_NOTIFY_PERSIST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_NOTIFY_PERSIST_HAS_DLL == 1 */
+
+// Set TAO_NOTIFY_PERSIST_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TAO_NOTIFY_PERSIST_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TAO_NOTIFY_PERSIST_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TAO_NOTIFY_PERSIST_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TAO_NOTIFY_PERSIST_NTRACE */
+
+#if (TAO_NOTIFY_PERSIST_NTRACE == 1)
+# define TAO_NOTIFY_PERSIST_TRACE(X)
+#else /* (TAO_NOTIFY_PERSIST_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define TAO_NOTIFY_PERSIST_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (TAO_NOTIFY_PERSIST_NTRACE == 1) */
+
+#endif /* TAO_NOTIFY_PERSIST_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Notify/notify_serv_export.h b/TAO/orbsvcs/orbsvcs/Notify/notify_serv_export.h
new file mode 100644
index 00000000000..ec47ee40ada
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/notify_serv_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_SERV_EXPORT_H
+#define TAO_NOTIFY_SERV_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_NOTIFY_SERV_HAS_DLL)
+# define TAO_NOTIFY_SERV_HAS_DLL 0
+# endif /* ! TAO_NOTIFY_SERV_HAS_DLL */
+#else
+# if !defined (TAO_NOTIFY_SERV_HAS_DLL)
+# define TAO_NOTIFY_SERV_HAS_DLL 1
+# endif /* ! TAO_NOTIFY_SERV_HAS_DLL */
+#endif
+
+#if defined (TAO_NOTIFY_SERV_HAS_DLL) && (TAO_NOTIFY_SERV_HAS_DLL == 1)
+# if defined (TAO_NOTIFY_SERV_BUILD_DLL)
+# define TAO_Notify_Serv_Export ACE_Proper_Export_Flag
+# define TAO_NOTIFY_SERV_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFY_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_NOTIFY_SERV_BUILD_DLL */
+# define TAO_Notify_Serv_Export ACE_Proper_Import_Flag
+# define TAO_NOTIFY_SERV_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFY_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_NOTIFY_SERV_BUILD_DLL */
+#else /* TAO_NOTIFY_SERV_HAS_DLL == 1 */
+# define TAO_Notify_Serv_Export
+# define TAO_NOTIFY_SERV_SINGLETON_DECLARATION(T)
+# define TAO_NOTIFY_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_NOTIFY_SERV_HAS_DLL == 1 */
+
+#endif /* TAO_NOTIFY_SERV_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Notify/notify_skel_export.h b/TAO/orbsvcs/orbsvcs/Notify/notify_skel_export.h
new file mode 100644
index 00000000000..52b01d16fd6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/notify_skel_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_SKEL_EXPORT_H
+#define TAO_NOTIFY_SKEL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_NOTIFY_SKEL_HAS_DLL)
+# define TAO_NOTIFY_SKEL_HAS_DLL 0
+# endif /* ! TAO_NOTIFY_SKEL_HAS_DLL */
+#else
+# if !defined (TAO_NOTIFY_SKEL_HAS_DLL)
+# define TAO_NOTIFY_SKEL_HAS_DLL 1
+# endif /* ! TAO_NOTIFY_SKEL_HAS_DLL */
+#endif
+
+#if defined (TAO_NOTIFY_SKEL_HAS_DLL) && (TAO_NOTIFY_SKEL_HAS_DLL == 1)
+# if defined (TAO_NOTIFY_SKEL_BUILD_DLL)
+# define TAO_Notify_Skel_Export ACE_Proper_Export_Flag
+# define TAO_NOTIFY_SKEL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFY_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_NOTIFY_SKEL_BUILD_DLL */
+# define TAO_Notify_Skel_Export ACE_Proper_Import_Flag
+# define TAO_NOTIFY_SKEL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFY_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_NOTIFY_SKEL_BUILD_DLL */
+#else /* TAO_NOTIFY_SKEL_HAS_DLL == 1 */
+# define TAO_Notify_Skel_Export
+# define TAO_NOTIFY_SKEL_SINGLETON_DECLARATION(T)
+# define TAO_NOTIFY_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_NOTIFY_SKEL_HAS_DLL == 1 */
+
+#endif /* TAO_NOTIFY_SKEL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Notify/rt_notify_export.h b/TAO/orbsvcs/orbsvcs/Notify/rt_notify_export.h
new file mode 100644
index 00000000000..288a67cb67f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Notify/rt_notify_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_EXPORT_H
+#define TAO_RT_NOTIFY_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_RT_NOTIFY_HAS_DLL)
+# define TAO_RT_NOTIFY_HAS_DLL 0
+# endif /* ! TAO_RT_NOTIFY_HAS_DLL */
+#else
+# if !defined (TAO_RT_NOTIFY_HAS_DLL)
+# define TAO_RT_NOTIFY_HAS_DLL 1
+# endif /* ! TAO_RT_NOTIFY_HAS_DLL */
+#endif
+
+#if defined (TAO_RT_NOTIFY_HAS_DLL) && (TAO_RT_NOTIFY_HAS_DLL == 1)
+# if defined (TAO_RT_NOTIFY_BUILD_DLL)
+# define TAO_RT_Notify_Export ACE_Proper_Export_Flag
+# define TAO_RT_NOTIFY_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RT_NOTIFY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RT_NOTIFY_BUILD_DLL */
+# define TAO_RT_Notify_Export ACE_Proper_Import_Flag
+# define TAO_RT_NOTIFY_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RT_NOTIFY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RT_NOTIFY_BUILD_DLL */
+#else /* TAO_RT_NOTIFY_HAS_DLL == 1 */
+# define TAO_RT_Notify_Export
+# define TAO_RT_NOTIFY_SINGLETON_DECLARATION(T)
+# define TAO_RT_NOTIFY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RT_NOTIFY_HAS_DLL == 1 */
+
+#endif /* TAO_RT_NOTIFY_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/NotifyExt.idl b/TAO/orbsvcs/orbsvcs/NotifyExt.idl
new file mode 100644
index 00000000000..5e0d9ca9b69
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/NotifyExt.idl
@@ -0,0 +1,184 @@
+/**
+ * @file NotifyExt.idl
+ *
+ * @brief Additional interfaces for QoS properties to Notify.
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef _NOTIFY_EXT_IDL_
+#define _NOTIFY_EXT_IDL_
+
+#include "CosNotifyChannelAdmin.idl"
+
+#pragma prefix ""
+
+/**
+ * @namespace NotifyExt
+ *
+ * @brief Notify Extensions.
+ */
+module NotifyExt
+{
+ // Priority defs. same as RTCORBA
+ typedef short Priority;
+ const Priority minPriority = 0;
+ const Priority maxPriority = 32767;
+
+ enum PriorityModel
+ {
+ CLIENT_PROPAGATED,
+ SERVER_DECLARED
+ };
+
+ /*
+ * ThreadPool QoS property,
+ */
+ const string ThreadPool = "ThreadPool";
+
+ // ThreadPoolParams : same as RTCORBA::create_threadpool
+ struct ThreadPoolParams
+ {
+ PriorityModel priority_model;
+ Priority server_priority;
+
+ unsigned long stacksize;
+ unsigned long static_threads;
+ unsigned long dynamic_threads;
+ Priority default_priority;
+ boolean allow_request_buffering;
+ unsigned long max_buffered_requests;
+ unsigned long max_request_buffer_size;
+ };
+
+ /*
+ * ThreadPoolLanes QoS property,
+ */
+ const string ThreadPoolLanes = "ThreadPoolLanes";
+
+ struct ThreadPoolLane
+ {
+ PriorityModel priority_model;
+ Priority server_priority;
+
+ Priority lane_priority;
+ unsigned long static_threads;
+ unsigned long dynamic_threads;
+ };
+
+ typedef sequence <ThreadPoolLane> ThreadPoolLanes_List;
+
+ struct ThreadPoolLanesParams
+ {
+ PriorityModel priority_model;
+ Priority server_priority;
+
+ unsigned long stacksize;
+ ThreadPoolLanes_List lanes;
+ boolean allow_borrowing;
+ boolean allow_request_buffering;
+ unsigned long max_buffered_requests;
+ unsigned long max_request_buffer_size;
+ };
+
+ /**
+ * \brief An interface which gets registered with a ReconnectionRegistry.
+ *
+ * A supplier or consumer must implement this interface in order to
+ * allow the Notification Service to attempt to reconnect to it after
+ * a failure. The supplier or consumer must register its instance of
+ * this interface with the ReconnectionRegistry.
+ */
+ interface ReconnectionCallback
+ {
+ /// Perform operations to reconnect to the Notification Service
+ /// after a failure.
+ void reconnect (in Object new_connection);
+
+ /// Check to see if the ReconnectionCallba ck is alive
+ boolean is_alive ();
+ };
+
+ /**
+ * \brief An interface that handles registration of suppliers and consumers.
+ *
+ * This registry should be implemented by an EventChannelFactory and
+ * will call the appropriate reconnect methods for all ReconnectionCallback
+ * objects registered with it.
+ */
+ interface ReconnectionRegistry
+ {
+ typedef long ReconnectionID;
+ ReconnectionID register_callback(in ReconnectionCallback reconection);
+
+ void unregister_callback (in ReconnectionID id);
+
+ /// Check to see if the ReconnectionRegistry is alive
+ boolean is_alive ();
+ };
+
+ /**
+ * Extend the EventChannelFactory to have a shutdown method
+ * and a Reconnection Registry
+ */
+ interface EventChannelFactory
+ : CosNotifyChannelAdmin::EventChannelFactory
+ , ReconnectionRegistry
+ {
+ void destroy ();
+ /// save topology: for diagnostic and testing purposes
+ /// Normal topology save is automatic when connectivity persistence
+ /// is configured.
+ void save_topology();
+ };
+
+ interface ConsumerAdmin : CosNotifyChannelAdmin::ConsumerAdmin
+ {
+ // Create a new push-style proxy supplier
+ /**
+ * @param ctype The event format that the ProxyConsumer should
+ * support
+ * @param proxy_id The ID assigned to the new proxy supplier
+ * @param initial_qos Configure the initial QoS properties of the
+ * new Proxy.
+ * @return The new ProxySupplier
+ * @throws AdminLimitExceeded if a limit in this admin is reached,
+ * such as the maximum number of proxies.
+ * @throws CosNotification::UnsupportedQoS if the requested QoS
+ * properties cannot be satisfied or are invalid
+ */
+ CosNotifyChannelAdmin::ProxySupplier obtain_notification_push_supplier_with_qos (in CosNotifyChannelAdmin::ClientType ctype,
+ out CosNotifyChannelAdmin::ProxyID proxy_id,
+ in CosNotification::QoSProperties initial_qos)
+ raises ( CosNotifyChannelAdmin::AdminLimitExceeded,
+ CosNotification::UnsupportedQoS
+ );
+ };
+
+ interface SupplierAdmin : CosNotifyChannelAdmin::SupplierAdmin
+ {
+ // Create a new push-style proxy supplier
+ /**
+ * @param ctype The event format that the ProxyConsumer should
+ * support
+ * @param proxy_id The ID assigned to the new proxy supplier
+ * @param initial_qos Configure the initial QoS properties of the
+ * new Proxy.
+ * @return The new ProxyConsumer
+ * @throws AdminLimitExceeded if a limit in this admin is reached,
+ * such as the maximum number of proxies.
+ * @throws CosNotification::UnsupportedQoS if the requested QoS
+ * properties cannot be satisfied or are invalid
+ */
+ CosNotifyChannelAdmin::ProxyConsumer obtain_notification_push_consumer_with_qos (in CosNotifyChannelAdmin::ClientType ctype,
+ out CosNotifyChannelAdmin::ProxyID proxy_id,
+ in CosNotification::QoSProperties initial_qos)
+ raises ( CosNotifyChannelAdmin::AdminLimitExceeded,
+ CosNotification::UnsupportedQoS
+ );
+ };
+};
+
+#endif /* _NOTIFY_EXT_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/Null_MediaCtrl.idl b/TAO/orbsvcs/orbsvcs/Null_MediaCtrl.idl
new file mode 100644
index 00000000000..199b8d40398
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Null_MediaCtrl.idl
@@ -0,0 +1,5 @@
+// $Id$
+
+interface Null_MediaCtrl
+{
+};
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup.idl b/TAO/orbsvcs/orbsvcs/PortableGroup.idl
new file mode 100644
index 00000000000..310952a767a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup.idl
@@ -0,0 +1,323 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file PortableGroup.idl
+ *
+ * $Id$
+ */
+//=============================================================================
+
+#ifndef _PORTABLEGROUP_IDL_
+#define _PORTABLEGROUP_IDL_
+
+#include "tao/PortableServer/PortableServer_include.pidl"
+#include "CosNaming.idl"
+#include "tao/IOP.pidl"
+#include "tao/GIOP.pidl"
+#include <orb.idl>
+#include "PortableGroup_Simple_DS.idl"
+
+module PortableGroup
+{
+ typeprefix PortableGroup "omg.org";
+
+ /// MembershipStyle
+ const string PG_MEMBERSHIP_STYLE =
+ "org.omg.PortableGroup.MembershipStyle";
+
+ /// InitialNumberMembers
+ const string PG_INITIAL_NUMBER_MEMBERS =
+ "org.omg.PortableGroup.InitialNumberMembers";
+
+ /// MinimumNumberMembers
+ const string PG_MINIMUM_NUMBER_MEMBERS =
+ "org.omg.PortableGroup.MinimumNumberMembers";
+
+ /// Factories
+ const string PG_FACTORIES = "org.omg.PortableGroup.Factories";
+
+ typedef sequence <octet> GroupIIOPProfile; // tag = TAG_GROUP_IIOP
+
+ // Specification of Common Types and Exceptions for Group Management
+ interface GenericFactory;
+
+ typedef CORBA::RepositoryId _TypeId;
+ typedef Object ObjectGroup;
+ typedef sequence<ObjectGroup> ObjectGroups;
+ typedef CosNaming::Name Name;
+ typedef any Value;
+
+ struct Property {
+ Name nam;
+ Value val;
+ };
+
+ typedef sequence<Property> Properties;
+ typedef Name Location;
+ typedef sequence<Location> Locations;
+ typedef Properties Criteria;
+
+ struct FactoryInfo {
+ GenericFactory the_factory;
+ Location the_location;
+ Criteria the_criteria;
+ };
+ typedef sequence<FactoryInfo> FactoryInfos;
+
+ typedef long MembershipStyleValue;
+ const MembershipStyleValue MEMB_APP_CTRL = 0;
+ const MembershipStyleValue MEMB_INF_CTRL = 1;
+
+ typedef FactoryInfos FactoriesValue;
+ typedef unsigned short InitialNumberMembersValue;
+ typedef unsigned short MinimumNumberMembersValue;
+
+ exception InterfaceNotFound {};
+ exception ObjectGroupNotFound {};
+ exception MemberNotFound {};
+ exception ObjectNotFound {};
+ exception MemberAlreadyPresent {};
+ exception ObjectNotCreated {};
+ exception ObjectNotAdded {};
+ /// TAO Specific: TypeConfict exception
+ exception TypeConflict {};
+ exception UnsupportedProperty {
+ Name nam;
+ Value val;
+ };
+
+ exception InvalidProperty {
+ Name nam;
+ Value val;
+ };
+
+ exception NoFactory {
+ Location the_location;
+ _TypeId type_id;
+ };
+
+ exception InvalidCriteria {
+ Criteria invalid_criteria;
+ };
+
+ exception CannotMeetCriteria {
+ Criteria unmet_criteria;
+ };
+
+ // Specification of PropertyManager Interface
+ interface PropertyManager {
+
+ void set_default_properties (in Properties props)
+ raises (InvalidProperty, UnsupportedProperty);
+
+ Properties get_default_properties();
+
+ void remove_default_properties (in Properties props)
+ raises (InvalidProperty, UnsupportedProperty);
+
+ void set_type_properties (in _TypeId type_id, in Properties overrides)
+ raises (InvalidProperty, UnsupportedProperty);
+
+ Properties get_type_properties(in _TypeId type_id);
+
+ void remove_type_properties (in _TypeId type_id, in Properties props)
+ raises (InvalidProperty, UnsupportedProperty);
+
+ void set_properties_dynamically
+ (in ObjectGroup object_group, in Properties overrides)
+ raises (ObjectGroupNotFound,
+ InvalidProperty,
+ UnsupportedProperty);
+
+ Properties get_properties (in ObjectGroup object_group)
+ raises (ObjectGroupNotFound);
+ }; // endPropertyManager
+
+
+ // Specification of ObjectGroupManager Interface
+ interface ObjectGroupManager {
+ ObjectGroup create_member (in ObjectGroup object_group,
+ in Location the_location,
+ in _TypeId type_id,
+ in Criteria the_criteria)
+ raises (ObjectGroupNotFound,
+ MemberAlreadyPresent,
+ NoFactory,
+ ObjectNotCreated,
+ InvalidCriteria,
+ CannotMeetCriteria);
+
+ ObjectGroup add_member (in ObjectGroup object_group,
+ in Location the_location,
+ in Object member)
+ raises (ObjectGroupNotFound,
+ MemberAlreadyPresent,
+ ObjectNotAdded);
+
+ ObjectGroup remove_member (in ObjectGroup object_group,
+ in Location the_location)
+ raises (ObjectGroupNotFound, MemberNotFound);
+
+ Locations locations_of_members (in ObjectGroup object_group)
+ raises (ObjectGroupNotFound);
+
+ ObjectGroups groups_at_location (in Location the_location);
+
+ ObjectGroupId get_object_group_id (in ObjectGroup object_group)
+ raises (ObjectGroupNotFound);
+
+ ObjectGroup get_object_group_ref (in ObjectGroup object_group)
+ raises (ObjectGroupNotFound);
+
+ Object get_member_ref (in ObjectGroup object_group,
+ in Location loc)
+ raises (ObjectGroupNotFound, MemberNotFound);
+
+ // TAO-specific extension.
+ ObjectGroup get_object_group_ref_from_id (
+ in ObjectGroupId group_id)
+ raises (ObjectGroupNotFound);
+
+ }; // end ObjectGroupManager
+
+
+ // Specification of GenericFactory Interface
+ interface GenericFactory {
+ typedef any FactoryCreationId;
+
+ Object create_object (in _TypeId type_id,
+ in Criteria the_criteria,
+ out FactoryCreationId factory_creation_id)
+ raises (NoFactory,
+ ObjectNotCreated,
+ InvalidCriteria,
+ InvalidProperty,
+ CannotMeetCriteria);
+
+ void delete_object (in FactoryCreationId factory_creation_id)
+ raises (ObjectNotFound);
+
+ }; // end GenericFactory
+
+ ///////////////////////
+ // The following FactoryRegistry interface is not included in the OMG PortableGroup IDL.
+ // It's an extension needed as part of implementing the FT CORBA specification.
+
+
+ /**
+ * a name for the role the object will play
+ * This allows multiple objects that implement the same interface (TypeId)
+ * to exist at a location as long as they play different roles.
+ */
+ typedef CORBA::Identifier RoleName;
+
+ /**
+ * Reserved criteria name for specifing role.
+ */
+ const string role_criterion = "org.omg.portablegroup.Role";
+
+ /**
+ * Interface to allow generic factories for replicas to register themselves.
+ * Factories are distinguished by the role to be played by the created-object (role) and the
+ * location at which they create the object (FactoryInfo.the_location)
+ *
+ * Because this is an extension to the FT CORBA specification applications that wish to
+ * adhere to the specification as written should use the type id as the role name when
+ * interacting with the FactoryRegistry.
+ */
+ interface FactoryRegistry
+ {
+ /**
+ * register a factory to create objects of the given type
+ * at the location given in the FactoryInfo.
+ *
+ * @param role the role the object-to-be-created plays.
+ * @param type_id type id of the object-to-be-created.
+ * @param factory_info information about the factory including its location.
+ * @throws MemberAlreadyPresent if there is already a factory for this type of object
+ * at this location.
+ * @throws TypeConflict if the specified type_id is different from the type_id previously
+ * registered for this role.
+ */
+ void register_factory(in RoleName role, in _TypeId type_id, in FactoryInfo factory_info)
+ raises (MemberAlreadyPresent, TypeConflict);
+
+ /**
+ * Remove the registration of a factory.
+ * @param role the role played by the object formerly created by this factory.
+ * @param location where the factory formerly created objects.
+ * @throws MemberNotPresent if no factory is available for the given role at this location.
+ */
+ void unregister_factory(in RoleName role, in Location the_location)
+ raises (MemberNotFound);
+
+ /**
+ * Remove the registration of all factories that create a particular type of object.
+ * If no factories exist for the given type, the registry is unchanged.
+ * This is not an error.
+ * @param type_id the type of object formerly created by the factories to be unregistered.
+ */
+ void unregister_factory_by_role(in RoleName role);
+
+ /**
+ * Remove the registration of all factories that create objects at a particular location.
+ * If the location is unknown the registry is unchanged.
+ * This is not an error.
+ * @param location where the factories formerly created objects.
+ */
+ void unregister_factory_by_location(in Location the_location);
+
+ /**
+ * List all the factories that create objects that fill a given role
+ * If the role is unknown, an empty list is returned. This is not an error.
+ * @param role the type of object the factories create.
+ * @param type_id what type of object is created to fill this role.
+ */
+ FactoryInfos list_factories_by_role(in RoleName role, out _TypeId type_id);
+
+ /**
+ * List all the factories that create a objects at a given location.
+ * If no factories are registered for this location, an empty list is returned.
+ * This is not an error.
+ * @param location where the factories create objects.
+ */
+ FactoryInfos list_factories_by_location(in Location the_location);
+
+ }; // end of FactoryRegistry
+
+
+ const string TAO_UPDATE_OBJECT_GROUP_METHOD_NAME = "tao_update_object_group";
+
+ interface TAO_UpdateObjectGroup {
+ /**
+ * Pseudo used method to update IOGR in Object Group Members
+ * TAO specific. The CORBA spec. doesn't address the issue.
+ */
+ void tao_update_object_group (
+ in string iogr,
+ in PortableGroup::ObjectGroupRefVersion version,
+ in boolean is_primary);
+ };
+
+ exception NotAGroupObject {};
+ typedef sequence <PortableServer::ObjectId> IDs;
+
+ local interface GOA : PortableServer::POA {
+ PortableServer::ObjectId create_id_for_reference(in Object the_ref)
+ raises (NotAGroupObject);
+
+ IDs reference_to_ids(in Object the_ref)
+ raises (NotAGroupObject);
+
+ void associate_reference_with_id (in Object ref,
+ in PortableServer::ObjectId oid)
+ raises (NotAGroupObject);
+
+ void disassociate_reference_with_id (in Object ref,
+ in PortableServer::ObjectId oid)
+ raises (NotAGroupObject);
+ };
+}; // end PortableGroup
+
+#endif /* _PORTABLEGROUP_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup.mpc b/TAO/orbsvcs/orbsvcs/PortableGroup.mpc
new file mode 100644
index 00000000000..2c63bc2bff5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup.mpc
@@ -0,0 +1,40 @@
+// -*- MPC -*-
+// $Id$
+
+project(PortableGroup) : orbsvcslib, core, naming, iormanip, messaging, minimum_corba, tao_versioning_idl_defaults {
+ sharedname = TAO_PortableGroup
+ idlflags += -Wb,export_macro=TAO_PortableGroup_Export \
+ -Wb,export_include=orbsvcs/PortableGroup/portablegroup_export.h
+ dynamicflags = TAO_PORTABLEGROUP_BUILD_DLL
+ tagchecks += PortableGroup
+
+ IDL_Files {
+ miop.idl
+ PortableGroup_Simple_DS.idl
+ }
+
+ IDL_Files {
+ idlflags += -GC
+ PortableGroup.idl
+ }
+
+ Source_Files {
+ miopC.cpp
+ miopS.cpp
+ PortableGroupC.cpp
+ PortableGroupS.cpp
+ PortableGroup_Simple_DSC.cpp
+ PortableGroup
+ }
+
+ Header_Files {
+ PortableGroup/portablegroup_export.h
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_PortableGroup.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup.rc b/TAO/orbsvcs/orbsvcs/PortableGroup.rc
new file mode 100644
index 00000000000..a432c83a01c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "PortableGroup\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_PortableGroupDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_PortableGroup.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/GOA.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/GOA.cpp
new file mode 100644
index 00000000000..804e235f797
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/GOA.cpp
@@ -0,0 +1,711 @@
+#include "orbsvcs/PortableGroup/GOA.h"
+
+
+ACE_RCSID (PortableGroup,
+ GOA,
+ "$Id$")
+
+
+#include "orbsvcs/PortableGroup/PortableGroup_Acceptor_Registry.h"
+#include "orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.h"
+
+#include "tao/ORB_Core.h"
+#include "tao/ORB.h"
+#include "tao/Stub.h"
+#include "tao/Tagged_Components.h"
+#include "tao/Profile.h"
+#include "tao/CDR.h"
+
+#include "ace/Auto_Ptr.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+PortableServer::ObjectId *
+TAO_GOA::create_id_for_reference (CORBA::Object_ptr the_ref
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ PortableGroup::NotAGroupObject
+ ))
+{
+ // Get the RepositoryId from the Group reference so
+ // we know what kind of reference to make.
+ const char* repository_id = the_ref->_stubobj ()->type_id.in ();
+
+ // Create a temporary object reference and then get the
+ // ObjectId out of it.
+ CORBA::Object_var obj_ref = this->create_reference (repository_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ PortableServer::ObjectId_var obj_id =
+ this->reference_to_id (obj_ref.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Associate the object reference with the group reference.
+ this->associate_group_with_ref (the_ref,
+ obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return obj_id._retn ();
+}
+
+PortableGroup::IDs *
+TAO_GOA::reference_to_ids (CORBA::Object_ptr the_ref
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ PortableGroup::NotAGroupObject
+ ))
+{
+ ACE_UNUSED_ARG (the_ref);
+
+ return 0;
+}
+
+void
+TAO_GOA::associate_reference_with_id (CORBA::Object_ptr ref,
+ const PortableServer::ObjectId & oid
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ PortableGroup::NotAGroupObject
+ ))
+{
+ // Create a reference for the specified ObjectId, since
+ // it is much easier to extract the object key from the
+ // reference.
+ CORBA::Object_var obj_ref = this->id_to_reference (oid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Associate the object reference with the group reference.
+ this->associate_group_with_ref (ref,
+ obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_GOA::disassociate_reference_with_id (CORBA::Object_ptr ref,
+ const PortableServer::ObjectId & oid
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ PortableGroup::NotAGroupObject
+ ))
+{
+ ACE_UNUSED_ARG (ref);
+ ACE_UNUSED_ARG (oid);
+}
+
+
+TAO_GOA::TAO_GOA (const TAO_Root_POA::String &name,
+ PortableServer::POAManager_ptr poa_manager,
+ const TAO_POA_Policy_Set &policies,
+ TAO_Root_POA *parent,
+ ACE_Lock &lock,
+ TAO_SYNCH_MUTEX &thread_lock,
+ TAO_ORB_Core &orb_core,
+ TAO_Object_Adapter *object_adapter
+ ACE_ENV_ARG_DECL)
+ : TAO_Regular_POA (name,
+ poa_manager,
+ policies,
+ parent,
+ lock,
+ thread_lock,
+ orb_core,
+ object_adapter
+ ACE_ENV_ARG_PARAMETER)
+{
+}
+
+TAO_GOA::~TAO_GOA (void)
+{
+}
+
+TAO_Root_POA *
+TAO_GOA::new_POA (const String &name,
+ PortableServer::POAManager_ptr poa_manager,
+ const TAO_POA_Policy_Set &policies,
+ TAO_Root_POA *parent,
+ ACE_Lock &lock,
+ TAO_SYNCH_MUTEX &thread_lock,
+ TAO_ORB_Core &orb_core,
+ TAO_Object_Adapter *object_adapter
+ ACE_ENV_ARG_DECL)
+{
+ TAO_GOA *poa = 0;
+
+ ACE_NEW_THROW_EX (poa,
+ TAO_GOA (name,
+ poa_manager,
+ policies,
+ parent,
+ lock,
+ thread_lock,
+ orb_core,
+ object_adapter
+ ACE_ENV_ARG_PARAMETER),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ return poa;
+}
+
+// Standard POA interfaces
+PortableServer::POA_ptr
+TAO_GOA::create_POA (const char *adapter_name,
+ PortableServer::POAManager_ptr poa_manager,
+ const CORBA::PolicyList &policies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::AdapterAlreadyExists,
+ PortableServer::POA::InvalidPolicy))
+{
+ PortableServer::POA_ptr poa = this->TAO_Regular_POA::create_POA (adapter_name,
+ poa_manager,
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (poa);
+ return poa;
+}
+
+PortableServer::POA_ptr
+TAO_GOA::find_POA (const char *adapter_name,
+ CORBA::Boolean activate_it
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::AdapterNonExistent))
+{
+ PortableServer::POA_ptr poa = this->TAO_Regular_POA::find_POA (adapter_name,
+ activate_it
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (poa);
+ return poa;
+}
+
+void
+TAO_GOA::destroy (CORBA::Boolean etherealize_objects,
+ CORBA::Boolean wait_for_completion
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->TAO_Regular_POA::destroy (etherealize_objects,
+ wait_for_completion
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+
+PortableServer::ThreadPolicy_ptr
+TAO_GOA::create_thread_policy (PortableServer::ThreadPolicyValue value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableServer::ThreadPolicy_ptr policy =
+ this->TAO_Regular_POA::create_thread_policy (value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (policy);
+ return policy;
+}
+
+#endif /* TAO_HAS_MINIMUM_POA == 0 */
+
+PortableServer::LifespanPolicy_ptr
+TAO_GOA::create_lifespan_policy (PortableServer::LifespanPolicyValue value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableServer::LifespanPolicy_ptr policy =
+ this->TAO_Regular_POA::create_lifespan_policy (value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (policy);
+ return policy;
+}
+
+PortableServer::IdUniquenessPolicy_ptr
+TAO_GOA::create_id_uniqueness_policy (PortableServer::IdUniquenessPolicyValue value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableServer::IdUniquenessPolicy_ptr policy =
+ this->TAO_Regular_POA::create_id_uniqueness_policy (value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (policy);
+ return policy;
+}
+
+
+PortableServer::IdAssignmentPolicy_ptr
+TAO_GOA::create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableServer::IdAssignmentPolicy_ptr policy =
+ this->TAO_Regular_POA::create_id_assignment_policy (value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (policy);
+ return policy;
+}
+
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+
+PortableServer::ImplicitActivationPolicy_ptr
+TAO_GOA::create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableServer::ImplicitActivationPolicy_ptr policy =
+ this->TAO_Regular_POA::create_implicit_activation_policy (value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (policy);
+ return policy;
+}
+
+PortableServer::ServantRetentionPolicy_ptr
+TAO_GOA::create_servant_retention_policy (PortableServer::ServantRetentionPolicyValue value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableServer::ServantRetentionPolicy_ptr policy =
+ this->TAO_Regular_POA::create_servant_retention_policy (value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (policy);
+ return policy;
+}
+
+
+PortableServer::RequestProcessingPolicy_ptr
+TAO_GOA::create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableServer::RequestProcessingPolicy_ptr policy =
+ this->TAO_Regular_POA::create_request_processing_policy (value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (policy);
+ return policy;
+}
+
+
+#endif /* TAO_HAS_MINIMUM_POA == 0 */
+
+char *
+TAO_GOA::the_name (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ char * name =
+ this->TAO_Regular_POA::the_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (name);
+ return name;
+}
+
+PortableServer::POA_ptr
+TAO_GOA::the_parent (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableServer::POA_ptr parent =
+ this->TAO_Regular_POA::the_parent (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (parent);
+ return parent;
+}
+
+PortableServer::POAList *
+TAO_GOA::the_children (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableServer::POAList *children =
+ this->TAO_Regular_POA::the_children (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (children);
+ return children;
+}
+
+PortableServer::POAManager_ptr
+TAO_GOA::the_POAManager (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableServer::POAManager_ptr poa_manager =
+ this->TAO_Regular_POA::the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (poa_manager);
+ return poa_manager;
+}
+
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+
+PortableServer::AdapterActivator_ptr
+TAO_GOA::the_activator (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableServer::AdapterActivator_ptr activator =
+ this->TAO_Regular_POA::the_activator (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (activator);
+ return activator;
+}
+
+void
+TAO_GOA::the_activator (PortableServer::AdapterActivator_ptr adapter_activator
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->TAO_Regular_POA::the_activator (adapter_activator
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+PortableServer::ServantManager_ptr
+TAO_GOA::get_servant_manager (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::WrongPolicy))
+{
+ PortableServer::ServantManager_ptr servant_manager =
+ this->TAO_Regular_POA::get_servant_manager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (servant_manager);
+ return servant_manager;
+}
+
+void
+TAO_GOA::set_servant_manager (PortableServer::ServantManager_ptr imgr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::WrongPolicy))
+{
+ this->TAO_Regular_POA::set_servant_manager (imgr
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+PortableServer::Servant
+TAO_GOA::get_servant (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::NoServant,
+ PortableServer::POA::WrongPolicy))
+{
+ PortableServer::Servant servant =
+ this->TAO_Regular_POA::get_servant (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (servant);
+ return servant;
+}
+
+void
+TAO_GOA::set_servant (PortableServer::Servant servant
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::WrongPolicy))
+{
+ this->TAO_Regular_POA::set_servant (servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+#endif /* TAO_HAS_MINIMUM_POA == 0 */
+
+PortableServer::ObjectId *
+TAO_GOA::activate_object (PortableServer::Servant p_servant
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ServantAlreadyActive,
+ PortableServer::POA::WrongPolicy))
+{
+ PortableServer::ObjectId *object_id =
+ this->TAO_Regular_POA::activate_object (p_servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (object_id);
+ return object_id;
+}
+
+void
+TAO_GOA::activate_object_with_id (const PortableServer::ObjectId &id,
+ PortableServer::Servant p_servant
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ServantAlreadyActive,
+ PortableServer::POA::ObjectAlreadyActive,
+ PortableServer::POA::WrongPolicy))
+{
+ this->TAO_Regular_POA::activate_object_with_id (id,
+ p_servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_GOA::deactivate_object (const PortableServer::ObjectId &oid
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ObjectNotActive,
+ PortableServer::POA::WrongPolicy))
+{
+ this->TAO_Regular_POA::deactivate_object (oid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CORBA::Object_ptr
+TAO_GOA::create_reference (const char *intf
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::WrongPolicy))
+{
+ CORBA::Object_ptr obj =
+ this->TAO_Regular_POA::create_reference (intf
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (obj);
+ return obj;
+}
+
+CORBA::Object_ptr
+TAO_GOA::create_reference_with_id (const PortableServer::ObjectId &oid,
+ const char *intf
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Object_ptr obj =
+ this->TAO_Regular_POA::create_reference_with_id (oid,
+ intf
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (obj);
+ return obj;
+}
+
+PortableServer::ObjectId *
+TAO_GOA::servant_to_id (PortableServer::Servant p_servant
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ServantNotActive,
+ PortableServer::POA::WrongPolicy))
+{
+ PortableServer::ObjectId *object_id =
+ this->TAO_Regular_POA::servant_to_id (p_servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (object_id);
+ return object_id;
+}
+
+CORBA::Object_ptr
+TAO_GOA::servant_to_reference (PortableServer::Servant p_servant
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ServantNotActive,
+ PortableServer::POA::WrongPolicy))
+{
+ CORBA::Object_ptr obj =
+ this->TAO_Regular_POA::servant_to_reference (p_servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (obj);
+ return obj;
+}
+
+
+PortableServer::Servant
+TAO_GOA::reference_to_servant (CORBA::Object_ptr reference
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ObjectNotActive,
+ PortableServer::POA::WrongAdapter,
+ PortableServer::POA::WrongPolicy))
+{
+ PortableServer::Servant servant =
+ this->TAO_Regular_POA::reference_to_servant (reference
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (servant);
+ return servant;
+}
+
+PortableServer::ObjectId *
+TAO_GOA::reference_to_id (CORBA::Object_ptr reference
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::WrongAdapter,
+ PortableServer::POA::WrongPolicy))
+{
+ PortableServer::ObjectId *object_id =
+ this->TAO_Regular_POA::reference_to_id (reference
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (object_id);
+ return object_id;
+}
+
+PortableServer::Servant
+TAO_GOA::id_to_servant (const PortableServer::ObjectId &oid
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ObjectNotActive,
+ PortableServer::POA::WrongPolicy))
+{
+ PortableServer::Servant servant =
+ this->TAO_Regular_POA::id_to_servant (oid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (servant);
+ return servant;
+}
+
+CORBA::Object_ptr
+TAO_GOA::id_to_reference (const PortableServer::ObjectId &oid
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ObjectNotActive,
+ PortableServer::POA::WrongPolicy))
+{
+ CORBA::Object_ptr obj =
+ this->TAO_Regular_POA::id_to_reference (oid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (obj);
+ return obj;
+}
+
+CORBA::OctetSeq *
+TAO_GOA::id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->TAO_Regular_POA::id (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+int
+TAO_GOA::find_group_component (const CORBA::Object_ptr the_ref,
+ PortableGroup::TagGroupTaggedComponent &group)
+{
+ const TAO_MProfile& profiles = the_ref->_stubobj ()->base_profiles ();
+ const TAO_Profile* profile;
+ CORBA::ULong slot;
+
+ // Iterate through the tagged profiles, and
+ // create acceptors for the multicast ones.
+ slot = 0;
+ while (0 != (profile = profiles.get_profile (slot)))
+ {
+ if (this->find_group_component_in_profile (profile, group) == 0)
+ return 0;
+
+ ++slot;
+ }
+
+ // Not found.
+ return -1;
+}
+
+int
+TAO_GOA::find_group_component_in_profile (const TAO_Profile* profile,
+ PortableGroup::TagGroupTaggedComponent &group)
+{
+ // Iterate through the tagged components looking for
+ // group tag.
+ const TAO_Tagged_Components& components = profile->tagged_components ();
+
+ IOP::TaggedComponent tagged_component;
+ tagged_component.tag = IOP::TAG_GROUP;
+
+ // Try to find it.
+ if (components.get_component (tagged_component) == 0)
+ return -1;
+
+ // Found it.
+ const CORBA::Octet *buf =
+ tagged_component.component_data.get_buffer ();
+
+ TAO_InputCDR in_cdr (reinterpret_cast <const char*> (buf),
+ tagged_component.component_data.length ());
+
+ // Extract the Byte Order.
+ CORBA::Boolean byte_order;
+ if ((in_cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ return -1;
+ in_cdr.reset_byte_order (static_cast <int> (byte_order));
+
+ if ((in_cdr >> group) == 0)
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_GOA::create_group_acceptors (CORBA::Object_ptr the_ref,
+ TAO_PortableGroup_Acceptor_Registry &acceptor_registry,
+ TAO_ORB_Core &orb_core
+ ACE_ENV_ARG_DECL)
+{
+ const TAO_MProfile& profiles = the_ref->_stubobj ()->base_profiles ();
+ const TAO_Profile* profile;
+ CORBA::ULong slot;
+ int num = 0;
+
+ // Iterate through the tagged profiles, and
+ // create acceptors for the multicast ones.
+ slot = 0;
+ while (0 != (profile = profiles.get_profile (slot)))
+ {
+ if (profile->supports_multicast ())
+ {
+ acceptor_registry.open (profile,
+ orb_core
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ ++num;
+ }
+
+ ++slot;
+ }
+
+ // Return the number of acceptors registered.
+ return num;
+}
+
+void
+TAO_GOA::associate_group_with_ref (
+ CORBA::Object_ptr group_ref,
+ CORBA::Object_ptr obj_ref
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::NotAGroupObject))
+{
+ // Find the Group Component so that we can extract the Group ID.
+ PortableGroup::TagGroupTaggedComponent *tmp_group_id;
+ ACE_NEW_THROW_EX (tmp_group_id,
+ PortableGroup::TagGroupTaggedComponent,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableGroup::TagGroupTaggedComponent_var group_id = tmp_group_id;
+
+ if (this->find_group_component (group_ref, group_id.inout ()) != 0)
+ {
+ // Group component wasn't found. The group reference
+ // that was passed in must be bogus.
+ ACE_THROW (PortableGroup::NotAGroupObject ());
+ }
+
+ PortableGroup_Request_Dispatcher *rd =
+ dynamic_cast <PortableGroup_Request_Dispatcher*>(
+ this->orb_core_.request_dispatcher());
+
+ // Create the acceptors necessary to receive requests for the
+ // specified group reference.
+ this->create_group_acceptors (group_ref,
+ rd->acceptor_registry_,
+ this->orb_core_
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK;
+
+
+ // Add a mapping from GroupId to Object key in the PortableGroup
+ const TAO::ObjectKey &key =
+ obj_ref->_stubobj ()->profile_in_use ()->object_key ();
+ rd->group_map_.add_groupid_objectkey_pair (group_id._retn (),
+ key
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/GOA.h b/TAO/orbsvcs/orbsvcs/PortableGroup/GOA.h
new file mode 100644
index 00000000000..d5bbdeb04dd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/GOA.h
@@ -0,0 +1,329 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file GOA.h
+ *
+ * $Id$
+ *
+ * Header file for Group Object Adapter
+ *
+ * @author Several
+ */
+//=============================================================================
+
+#ifndef TAO_GOA_H
+#define TAO_GOA_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroupC.h"
+#include "tao/PortableServer/Regular_POA.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Profile;
+class TAO_PortableGroup_Acceptor_Registry;
+
+/**
+ * @class TAO_GOA
+ *
+ * @brief Implementation of the PortableGroup::GOA interface.
+ *
+ * Implementation of the PortableGroup::GOA interface.
+ */
+class TAO_PortableGroup_Export TAO_GOA :
+ public virtual PortableGroup::GOA,
+ public virtual TAO_Regular_POA
+{
+public:
+ // Methods added by the
+ /// @name MIOP specification methods
+ //@{
+ virtual PortableServer::ObjectId * create_id_for_reference (
+ CORBA::Object_ptr the_ref
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ PortableGroup::NotAGroupObject
+ ));
+
+
+ virtual PortableGroup::IDs * reference_to_ids (
+ CORBA::Object_ptr the_ref
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ PortableGroup::NotAGroupObject
+ ));
+
+ virtual void associate_reference_with_id (
+ CORBA::Object_ptr ref,
+ const PortableServer::ObjectId & oid
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ PortableGroup::NotAGroupObject
+ ));
+
+ virtual void disassociate_reference_with_id (
+ CORBA::Object_ptr ref,
+ const PortableServer::ObjectId & oid
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ PortableGroup::NotAGroupObject
+ ));
+ //@}
+
+ // Standard POA interface methods
+ PortableServer::POA_ptr create_POA (const char *adapter_name,
+ PortableServer::POAManager_ptr poa_manager,
+ const CORBA::PolicyList &policies
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::AdapterAlreadyExists,
+ PortableServer::POA::InvalidPolicy));
+
+ PortableServer::POA_ptr find_POA (const char *adapter_name,
+ CORBA::Boolean activate_it
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::AdapterNonExistent));
+
+ void destroy (CORBA::Boolean etherealize_objects,
+ CORBA::Boolean wait_for_completion
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+
+ PortableServer::ThreadPolicy_ptr create_thread_policy (PortableServer::ThreadPolicyValue value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+#endif /* TAO_HAS_MINIMUM_POA == 0 */
+
+ PortableServer::LifespanPolicy_ptr create_lifespan_policy (PortableServer::LifespanPolicyValue value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ PortableServer::IdUniquenessPolicy_ptr create_id_uniqueness_policy (PortableServer::IdUniquenessPolicyValue value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ PortableServer::IdAssignmentPolicy_ptr create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+
+ PortableServer::ImplicitActivationPolicy_ptr create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ PortableServer::ServantRetentionPolicy_ptr create_servant_retention_policy (PortableServer::ServantRetentionPolicyValue value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ PortableServer::RequestProcessingPolicy_ptr create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+#endif /* TAO_HAS_MINIMUM_POA == 0 */
+
+ char * the_name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ PortableServer::POA_ptr the_parent (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ PortableServer::POAList *the_children (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ PortableServer::POAManager_ptr the_POAManager (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+
+ PortableServer::AdapterActivator_ptr the_activator (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void the_activator (PortableServer::AdapterActivator_ptr adapter_activator
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ PortableServer::ServantManager_ptr get_servant_manager (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::WrongPolicy));
+
+ void set_servant_manager (PortableServer::ServantManager_ptr imgr
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::WrongPolicy));
+
+ PortableServer::Servant get_servant (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::NoServant,
+ PortableServer::POA::WrongPolicy));
+
+ void set_servant (PortableServer::Servant servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::WrongPolicy));
+
+#endif /* TAO_HAS_MINIMUM_POA == 0 */
+
+ PortableServer::ObjectId *activate_object (PortableServer::Servant p_servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ServantAlreadyActive,
+ PortableServer::POA::WrongPolicy));
+
+ void activate_object_with_id (const PortableServer::ObjectId &id,
+ PortableServer::Servant p_servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ServantAlreadyActive,
+ PortableServer::POA::ObjectAlreadyActive,
+ PortableServer::POA::WrongPolicy));
+
+ void deactivate_object (const PortableServer::ObjectId &oid
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ObjectNotActive,
+ PortableServer::POA::WrongPolicy));
+
+ CORBA::Object_ptr create_reference (const char *intf
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::WrongPolicy));
+
+ CORBA::Object_ptr create_reference_with_id (const PortableServer::ObjectId &oid,
+ const char *intf
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ PortableServer::ObjectId *servant_to_id (PortableServer::Servant p_servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ServantNotActive,
+ PortableServer::POA::WrongPolicy));
+
+ CORBA::Object_ptr servant_to_reference (PortableServer::Servant p_servant
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ServantNotActive,
+ PortableServer::POA::WrongPolicy));
+
+ PortableServer::Servant reference_to_servant (CORBA::Object_ptr reference
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ObjectNotActive,
+ PortableServer::POA::WrongAdapter,
+ PortableServer::POA::WrongPolicy));
+
+ PortableServer::ObjectId *reference_to_id (CORBA::Object_ptr reference
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::WrongAdapter,
+ PortableServer::POA::WrongPolicy));
+
+ PortableServer::Servant id_to_servant (const PortableServer::ObjectId &oid
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ObjectNotActive,
+ PortableServer::POA::WrongPolicy));
+
+ CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &oid
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableServer::POA::ObjectNotActive,
+ PortableServer::POA::WrongPolicy));
+
+ CORBA::OctetSeq *id (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // End standard POA interface methods.
+
+ TAO_GOA (const String &name,
+ PortableServer::POAManager_ptr poa_manager,
+ const TAO_POA_Policy_Set &policies,
+ TAO_Root_POA *parent,
+ ACE_Lock &lock,
+ TAO_SYNCH_MUTEX &thread_lock,
+ TAO_ORB_Core &orb_core,
+ TAO_Object_Adapter *object_adapter
+ ACE_ENV_ARG_DECL);
+
+ virtual ~TAO_GOA (void);
+
+ // Used to force the initialization of the code.
+ static int Initializer (void);
+
+protected:
+
+ /// Template method for creating new POA's of this type.
+ virtual TAO_Root_POA *new_POA (const String &name,
+ PortableServer::POAManager_ptr poa_manager,
+ const TAO_POA_Policy_Set &policies,
+ TAO_Root_POA *parent,
+ ACE_Lock &lock,
+ TAO_SYNCH_MUTEX &thread_lock,
+ TAO_ORB_Core &orb_core,
+ TAO_Object_Adapter *object_adapter
+ ACE_ENV_ARG_DECL);
+
+ int find_group_component (const CORBA::Object_ptr the_ref,
+ PortableGroup::TagGroupTaggedComponent &group);
+
+ int find_group_component_in_profile (
+ const TAO_Profile* profile,
+ PortableGroup::TagGroupTaggedComponent &group
+ );
+
+ int create_group_acceptors (
+ CORBA::Object_ptr the_ref,
+ TAO_PortableGroup_Acceptor_Registry &acceptor_registry,
+ TAO_ORB_Core &orb_core
+ ACE_ENV_ARG_DECL
+ );
+
+ /// Helper function to associate group references with
+ /// object references.
+ void associate_group_with_ref (
+ CORBA::Object_ptr group_ref,
+ CORBA::Object_ptr obj_ref
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::NotAGroupObject));
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_GOA_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.cpp
new file mode 100644
index 00000000000..ac2bbec66cf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.cpp
@@ -0,0 +1,29 @@
+#include "orbsvcs/PortableGroup/MIOP.h"
+#include "orbsvcs/PortableGroup/UIPMC_Factory.h"
+#include "ace/Service_Config.h"
+#include "orbsvcs/PortableGroup/PortableGroup_Loader.h"
+#include "orbsvcs/PortableGroup/PG_Object_Adapter_Factory.h"
+
+ACE_RCSID (PortableGroup,
+ UIPMC_Factory,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ /*static*/ int
+ MIOP_Loader::Initializer (void)
+ {
+ ACE_Service_Config::process_directive (
+ ace_svc_desc_TAO_PortableGroup_Loader);
+
+ ACE_Service_Config::process_directive (
+ ace_svc_desc_TAO_PG_Object_Adapter_Factory);
+
+ return ACE_Service_Config::process_directive (
+ ace_svc_desc_TAO_UIPMC_Protocol_Factory);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.h b/TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.h
new file mode 100644
index 00000000000..7e6219a5e67
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/MIOP.h
@@ -0,0 +1,45 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file MIOP.h
+ *
+ * $Id$
+ *
+ * @author Bala Natarajan
+ */
+//=============================================================================
+#ifndef TAO_MIOP_H
+#define TAO_MIOP_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+
+ class TAO_PortableGroup_Export MIOP_Loader
+ {
+ public:
+ /// Used to force the insertion of UIPMC_Factory in the service
+ /// configurator.
+ static int Initializer (void);
+ };
+
+ static int
+ Requires_MIOP_Initializer = MIOP_Loader::Initializer ();
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /*TAO_MIOP_H*/
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Default_Property_Validator.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Default_Property_Validator.cpp
new file mode 100644
index 00000000000..fe3650caa71
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Default_Property_Validator.cpp
@@ -0,0 +1,151 @@
+#include "orbsvcs/PortableGroup/PG_Default_Property_Validator.h"
+#include "orbsvcs/PortableGroup/PG_Operators.h"
+
+
+ACE_RCSID (PortableGroup,
+ PG_Default_Property_Validator,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_PG_Default_Property_Validator::TAO_PG_Default_Property_Validator (void)
+ : membership_ (1),
+ factories_ (1)
+{
+ this->membership_.length (1);
+ this->membership_[0].id = CORBA::string_dup ("org.omg.PortableGroup.MembershipStyle");
+
+ this->factories_.length (1);
+ this->factories_[0].id = CORBA::string_dup ("org.omg.PortableGroup.Factories");
+}
+
+TAO_PG_Default_Property_Validator::~TAO_PG_Default_Property_Validator (void)
+{
+}
+
+void
+TAO_PG_Default_Property_Validator::validate_property (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ const CORBA::ULong len = props.length ();
+
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ const PortableGroup::Property & property = props[i];
+
+ if (property.nam == this->membership_)
+ {
+ PortableGroup::MembershipStyleValue membership;
+ if (!(property.val >>= membership)
+ || (membership != PortableGroup::MEMB_APP_CTRL
+ && membership != PortableGroup::MEMB_INF_CTRL))
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+ else if (property.nam == this->factories_)
+ {
+ const PortableGroup::FactoriesValue * factories;
+ if (!(property.val >>= factories))
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ else
+ {
+ const CORBA::ULong flen = factories->length ();
+
+ if (flen == 0)
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+
+ for (CORBA::ULong j = 0; j < flen; ++j)
+ {
+ const PortableGroup::FactoryInfo & factory_info =
+ (*factories)[j];
+
+ if (CORBA::is_nil (factory_info.the_factory.in ())
+ || factory_info.the_location.length () == 0)
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+ }
+ }
+ }
+}
+
+void
+TAO_PG_Default_Property_Validator::validate_criteria (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::CannotMeetCriteria))
+{
+ const CORBA::ULong len = props.length ();
+ PortableGroup::Criteria invalid_criteria;
+
+ // Optimize for the worst case scenario where all properties are
+ // invalid.
+ invalid_criteria.length (len);
+
+ /// The invalid criteria index.
+ CORBA::ULong p = 0;
+
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ const PortableGroup::Property & property = props[i];
+
+ if (property.nam == this->membership_)
+ {
+ PortableGroup::MembershipStyleValue membership;
+ if (!(property.val >>= membership)
+ || (membership != PortableGroup::MEMB_APP_CTRL
+ && membership != PortableGroup::MEMB_INF_CTRL))
+ invalid_criteria[p++] = property;
+ }
+ else if (property.nam == this->factories_)
+ {
+ PortableGroup::FactoriesValue * factories;
+ if (!(property.val >>= factories))
+ invalid_criteria[p++] = property;
+ else
+ {
+ const CORBA::ULong flen = factories->length ();
+
+ if (flen == 0)
+ invalid_criteria[p++] = property;
+ else
+ {
+ for (CORBA::ULong j = 0; j < flen; ++j)
+ {
+ const PortableGroup::FactoryInfo & factory_info =
+ (*factories)[j];
+
+ if (CORBA::is_nil (factory_info.the_factory.in ())
+ || factory_info.the_location.length () == 0)
+ {
+ invalid_criteria[p++] = property;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (p > 0)
+ {
+ // Reduce the length of the invalid criteria sequence in an
+ // effort to optimize the copying that will occur when the below
+ // exception is thrown. Reducing the length is fast since no
+ // deallocations should occur.
+ invalid_criteria.length (p);
+
+ ACE_THROW (PortableGroup::InvalidCriteria (invalid_criteria));
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Default_Property_Validator.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Default_Property_Validator.h
new file mode 100644
index 00000000000..9f9ced075d9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Default_Property_Validator.h
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Default_Property_Validator.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_PG_DEFAULT_PROPERTY_VALIDATOR_H
+#define TAO_PG_DEFAULT_PROPERTY_VALIDATOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+#include "orbsvcs/PortableGroupC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_PG_Default_Property_Validator
+ *
+ * @brief Default property validator implementation.
+ *
+ * This Property_Validator verifies that all properties defined in the
+ * PortableGroup IDL module are valid. This property validator can be
+ * subclassed to validate a different property set.
+ */
+class TAO_PortableGroup_Export TAO_PG_Default_Property_Validator
+{
+public:
+
+ /// Constructor.
+ TAO_PG_Default_Property_Validator (void);
+
+ /// Destructor
+ virtual ~TAO_PG_Default_Property_Validator (void);
+
+ /// Validate the given properties. Throw an exception when the
+ /// first invalid property is encountered. The remaining properties
+ /// will not be validated.
+ virtual void validate_property (const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /// Validate the given properties/criteria. All criteria
+ /// will be validated regardless of whether or not an invalid
+ /// property was encountered.
+ virtual void validate_criteria (const PortableGroup::Properties & criteria
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::CannotMeetCriteria));
+
+private:
+
+ /**
+ * @name Pre-initialize property Names.
+ *
+ * These properties are pre-initialized once to reduce property
+ * validation overhead. Note that the InitialNumberReplicas and
+ * MinimumNumberReplicas properties are not validated since there are
+ * no restrictions imposed by TAO's PortableGroup implementation
+ * regarding the number of such members.
+ */
+ //@{
+ PortableGroup::Name membership_;
+ PortableGroup::Name factories_;
+ //@}
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_PROPERTY_VALIDATOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.cpp
new file mode 100644
index 00000000000..330d3984006
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.cpp
@@ -0,0 +1,733 @@
+// -*- C++ -*-
+// $Id$
+
+#include "orbsvcs/PortableGroup/PG_FactoryRegistry.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Vector_T.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/Auto_Ptr.h"
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+#include "tao/PortableServer/POAManagerC.h"
+#include "orbsvcs/PortableGroup/PG_Operators.h" // operator == on CosNaming::Name
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Use this macro at the beginning of CORBA methods
+// to aid in debugging.
+#define METHOD_ENTRY(name) \
+ if (TAO_debug_level <= 6){} else \
+ 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) \
+ if (TAO_debug_level <= 6){} else \
+ ACE_DEBUG (( LM_DEBUG, \
+ "Leave %s\n", #name \
+ )); \
+ return /* value goes here */
+
+TAO::PG_FactoryRegistry::PG_FactoryRegistry (const char * name)
+ : identity_(name)
+ , orb_ (0)
+ , poa_ (0)
+ , object_id_ (0)
+ , this_obj_ (0)
+ , ior_output_file_(0)
+ , ns_name_(0)
+ , naming_context_(0)
+ , this_name_(1)
+ , quit_on_idle_(0)
+ , quit_state_(LIVE)
+ , linger_(0)
+{
+}
+
+TAO::PG_FactoryRegistry::~PG_FactoryRegistry (void)
+{
+}
+
+//////////////////////////////////////////////////////
+// PG_FactoryRegistry public, non-CORBA methods
+
+int TAO::PG_FactoryRegistry::parse_args (int argc, char * argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:n:q");
+ 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 'q':
+ {
+ this->quit_on_idle_ = 1;
+ break;
+ }
+
+ case '?':
+ // fall thru
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " -o <registry ior file>"
+ " -n <name to use to register with name service>"
+ " -q{uit on idle}"
+ "\n",
+ argv [0]),
+ -1);
+ break;
+ }
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+const char * TAO::PG_FactoryRegistry::identity () const
+{
+ return this->identity_.c_str();
+}
+
+void TAO::PG_FactoryRegistry::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ this->quit_state_ = GONE;
+}
+
+int TAO::PG_FactoryRegistry::idle (int & result ACE_ENV_ARG_DECL_NOT_USED)
+{
+ result = 0;
+ int quit = 0;
+ if (this->quit_state_ == GONE)
+ {
+ if (linger_ < 2)
+ {
+ ++linger_;
+ }
+ else
+ {
+ quit = 1;
+ }
+ }
+ return quit;
+}
+
+
+int TAO::PG_FactoryRegistry::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);
+ this->ns_name_ = 0;
+ }
+ return 0;
+}
+
+
+void TAO::PG_FactoryRegistry::init (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (CORBA::is_nil (this->orb_.in ()));
+ ACE_ASSERT (CORBA::is_nil (this->poa_.in ()));
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+ this->poa_ = PortableServer::POA::_duplicate (poa);
+ ACE_ASSERT ( ! CORBA::is_nil (this->orb_.in ()));
+ ACE_ASSERT ( ! CORBA::is_nil (this->poa_.in ()));
+
+ // Register with the POA.
+ this->object_id_ = this->poa_->activate_object (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // find my identity as a corba object
+ this->this_obj_ =
+ this->poa_->id_to_reference (object_id_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // and create a ior string
+ this->ior_ = this->orb_->object_to_string (this->this_obj_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+}
+
+int TAO::PG_FactoryRegistry::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
+ this->this_obj_ =
+ this->poa_->id_to_reference (object_id_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+
+ // and create a ior string
+ this->ior_ = this->orb_->object_to_string (this->this_obj_.in ()
+ 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 (this->ior_output_file_,
+ this->ior_.in ());
+ }
+
+ 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);
+ }
+
+ 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->this_obj_.in() //CORBA::Object::_duplicate(this_obj)
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+ }
+
+ return result;
+}
+
+
+::PortableGroup::FactoryRegistry_ptr TAO::PG_FactoryRegistry::reference()
+{
+ // narrow and duplicate
+ return ::PortableGroup::FactoryRegistry::_narrow(this->this_obj_.in ());
+}
+
+
+//////////////////////////////////////////
+// PG_FactoryRegistry CORBA methods
+
+/* Reference:info
+ typedef CosNaming::Name Name;
+ typedef Name Location;
+ struct FactoryInfo {
+ GenericFactory the_factory;
+ Location the_location;
+ Criteria the_criteria;
+ };
+ typedef sequence<FactoryInfo> FactoryInfos;
+*/
+
+TAO::PG_FactoryRegistry::RoleInfo::RoleInfo(size_t estimated_number_entries)
+ : infos_(estimated_number_entries)
+{
+}
+
+
+void TAO::PG_FactoryRegistry::register_factory (
+ const char * role,
+ const char * type_id,
+ const PortableGroup::FactoryInfo & factory_info
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::MemberAlreadyPresent
+ , PortableGroup::TypeConflict))
+{
+ METHOD_ENTRY(TAO::PG_FactoryRegistry::register_factory);
+
+ RoleInfo * role_info = 0;
+ auto_ptr<RoleInfo> safe_entry;
+ if (this->registry_.find(role, role_info) != 0)
+ {
+ ACE_DEBUG(( LM_DEBUG,
+ "%s: adding new role: %s:%s\n",
+ this->identity_.c_str(), role, type_id));
+
+ // Note the 5. It's a guess about the number of factories
+ // that might exist for any particular role object.
+ // todo: make it a parameter.
+ ACE_NEW_THROW_EX (role_info,
+ RoleInfo(5),
+ CORBA::NO_MEMORY());
+ ACE_CHECK;
+
+ ACE_AUTO_PTR_RESET (safe_entry, role_info, RoleInfo);
+ role_info->type_id_ = type_id;
+ }
+ else
+ {
+ if (role_info->type_id_ != type_id)
+ {
+ ACE_THROW ( PortableGroup::TypeConflict() );
+ }
+ }
+
+ PortableGroup::FactoryInfos & infos = role_info->infos_;;
+ size_t length = infos.length();
+ for (size_t nInfo = 0; nInfo < length; ++nInfo)
+ {
+ PortableGroup::FactoryInfo & info = infos[nInfo];
+ if (info.the_location == factory_info.the_location)
+ {
+ ACE_ERROR(( LM_ERROR,
+ "%s: Attempt to register duplicate location %s for role: %s\n" ,
+ this->identity_.c_str(),
+ static_cast<const char *> (info.the_location[0].id),
+ role));
+ ACE_THROW (PortableGroup::MemberAlreadyPresent() );
+ }
+ }
+
+ infos.length(length + 1);
+ infos[length] = factory_info;
+
+ if (safe_entry.get() != 0)
+ {
+ this->registry_.bind(role, safe_entry.release());
+ }
+
+ ACE_DEBUG(( LM_DEBUG,
+ "%s: Added factory: [%d] %s@%s \n",
+ this->identity_.c_str(),
+ static_cast<int> (length + 1),
+ role,
+ static_cast<const char *> (factory_info.the_location[0].id)
+ ));
+
+ METHOD_RETURN(TAO::PG_FactoryRegistry::register_factory);
+}
+
+void TAO::PG_FactoryRegistry::unregister_factory (
+ const char * role,
+ const PortableGroup::Location & location
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException, PortableGroup::MemberNotFound))
+{
+ METHOD_ENTRY(TAO::PG_FactoryRegistry::unregister_factory);
+
+ RoleInfo * role_info = 0;
+ if (this->registry_.find(role, role_info) == 0)
+ {
+ PortableGroup::FactoryInfos & infos = role_info->infos_;
+ int found = 0;
+ size_t length = infos.length();
+ for (size_t nInfo = 0; !found && nInfo < length; ++nInfo)
+ {
+ PortableGroup::FactoryInfo & info = infos[nInfo];
+ if (info.the_location == location)
+ {
+ found = 1;
+
+ ACE_ERROR(( LM_INFO,
+ "%s: Unregistering factory %s@%s\n",
+ this->identity_.c_str(),
+ role,
+ static_cast<const char *> (location[0].id)
+ ));
+ if (length > 1)
+ {
+ // if this is not the last entry
+ if (nInfo + 1 < length)
+ {
+ // move last entry into newly-emptied slot
+ infos[nInfo] = infos[length - 1];
+ nInfo = length -1;
+ }
+ infos.length(nInfo);
+ }
+ else
+ {
+ ACE_ASSERT ( length == 1 );
+ if (this->registry_.unbind (role) == 0)
+ {
+ ACE_DEBUG(( LM_INFO,
+ "%s: No more factories registered for %s\n",
+ this->identity_.c_str(),
+ role
+ ));
+ delete role_info;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "%s: LOGIC ERROR AT " __FILE__ " (%d): Entry to be deleted disappeared\n",
+ this->identity_.c_str(),
+ __LINE__));
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ ACE_ERROR(( LM_ERROR,
+ "%s, Attempt to unregister factory for unknown role %s\n",
+ this->identity_.c_str(),
+ role
+ ));
+ ACE_THROW ( PortableGroup::MemberNotFound() );
+ }
+
+ //////////////////////
+ // request complete
+ // check quit-on-idle
+ if (registry_.current_size() == 0 && quit_state_ == LIVE)
+ {
+ ACE_ERROR(( LM_INFO,
+ "%s is idle\n",
+ identity()
+ ));
+ if (quit_on_idle_)
+ {
+ this->poa_->deactivate_object (this->object_id_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ quit_state_ = DEACTIVATED;
+ }
+ }
+
+ METHOD_RETURN(TAO::PG_FactoryRegistry::unregister_factory);
+}
+
+void TAO::PG_FactoryRegistry::unregister_factory_by_role (
+ const char * role
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ METHOD_ENTRY(TAO::PG_FactoryRegistry::unregister_factory_by_role);
+
+ RoleInfo * role_info = 0;
+ if (this->registry_.unbind(role, role_info) == 0)
+ {
+ ACE_DEBUG(( LM_DEBUG,
+ "%s: Unregistering all factories for role %s\n",
+ this->identity_.c_str(),
+ role
+ ));
+ // delete the entire set of factories for this location.
+ delete role_info;
+ }
+ else
+ {
+ ACE_ERROR(( LM_INFO,
+ "%s: Unregister_factory_by_role: unknown role: %s\n",
+ this->identity_.c_str(),
+ role
+ ));
+ }
+
+ /////////////////////
+ // Function complete
+ // check quit options
+ if (registry_.current_size() == 0 && quit_state_ == LIVE)
+ {
+ ACE_ERROR(( LM_INFO,
+ "%s is idle\n",
+ identity()
+ ));
+ if (quit_on_idle_)
+ {
+ this->poa_->deactivate_object (this->object_id_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ quit_state_ = DEACTIVATED;
+ }
+ }
+
+ METHOD_RETURN(TAO::PG_FactoryRegistry::unregister_factory_by_role);
+}
+
+void TAO::PG_FactoryRegistry::unregister_factory_by_location (
+ const PortableGroup::Location & location
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ METHOD_ENTRY(TAO::PG_FactoryRegistry::unregister_factory_by_location);
+
+ ////////////////////////////////////////////
+ // a vector of roles that need to be deleted.
+ ACE_Vector<ACE_CString> emptyRoles;
+
+ // iterate through the registery
+ for (RegistryType_Iterator it = this->registry_.begin();
+ it != this->registry_.end();
+ ++it)
+ {
+ RegistryType_Entry & entry = *it;
+ ACE_CString & role = entry.ext_id_;
+ RoleInfo * role_info = entry.int_id_;
+
+ PortableGroup::FactoryInfos & infos = role_info->infos_;
+ // ACE_ERROR((LM_INFO, "unregister_factory_by_location: Checking role %s\n", role.c_str() ));
+
+ int found = 0;
+ size_t length = infos.length();
+ for (size_t nInfo = 0; !found && nInfo < length; ++nInfo)
+ {
+ PortableGroup::FactoryInfo & info = infos[nInfo];
+ if (info.the_location == location)
+ {
+
+ ACE_ERROR((LM_INFO,
+ "%s: Unregister_factory_by_location: Removing: [%d] %s@%s\n",
+ this->identity_.c_str(),
+ static_cast<int> (nInfo),
+ role.c_str(),
+ static_cast<const char *> (location[0].id)
+ ));
+ found = 1;
+ if (length > 1)
+ {
+ while (nInfo + 1 < length)
+ {
+ ACE_ERROR((LM_INFO,
+ "%s: Unregister_factory_by_location: Move: [%d] %s to [%d]\n",
+ this->identity_.c_str(),
+ (int)nInfo + 1, role.c_str(), (int)nInfo
+ ));
+ infos[nInfo] = infos[nInfo + 1];
+ nInfo += 1;
+ }
+ ACE_ERROR((LM_INFO,
+ "%s: unregister_factory_by_location: New length [%d] %s\n",
+ this->identity_.c_str(),
+ (int)nInfo, role.c_str()
+ ));
+ infos.length(nInfo);
+ }
+ else
+ {
+ ACE_ERROR((LM_INFO,
+ "%s: Removed all entries for %s\n",
+ this->identity_.c_str(),
+ role.c_str()
+ ));
+ ACE_ASSERT ( length == 1 );
+ // remember entries to be deleted
+ emptyRoles.push_back(entry.ext_id_);
+ }
+ }
+ }
+ }
+
+ // now remove any roles that became empty
+
+ for (size_t nRole = 0; nRole < emptyRoles.size(); ++nRole)
+ {
+ ACE_ERROR((LM_INFO,
+ "%s: Remove role %s\n",
+ this->identity_.c_str(),
+ emptyRoles[nRole].c_str()
+ ));
+ RoleInfo * role_info;
+ if (this->registry_.unbind(emptyRoles[nRole], role_info) == 0)
+ {
+ delete role_info;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "%s: LOGIC ERROR AT " __FILE__ " (%d): Role to be deleted disappeared\n",
+ this->identity_.c_str(),
+ __LINE__));
+ }
+ }
+ //////////////////////////
+ // If all types are gone...
+ if (registry_.current_size() == 0 && quit_state_ == LIVE)
+ {
+ ACE_ERROR(( LM_INFO,
+ "%s is idle\n",
+ identity()
+ ));
+ if (quit_on_idle_)
+ {
+ this->poa_->deactivate_object (this->object_id_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ quit_state_ = DEACTIVATED;
+ }
+ }
+
+ METHOD_RETURN(TAO::PG_FactoryRegistry::unregister_factory_by_location);
+}
+
+::PortableGroup::FactoryInfos * TAO::PG_FactoryRegistry::list_factories_by_role (
+ const char * role,
+ CORBA::String_out type_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ METHOD_ENTRY(TAO::PG_FactoryRegistry::list_factories_by_role);
+
+ // allocate stucture to be returned.
+ PortableGroup::FactoryInfos_var result = 0;
+ ACE_NEW_THROW_EX (result, ::PortableGroup::FactoryInfos(),
+ CORBA::NO_MEMORY (TAO::VMCID, CORBA::COMPLETED_NO));
+
+ ACE_CHECK_RETURN (0);
+
+ RoleInfo * role_info = 0;
+ if (this->registry_.find(role, role_info) == 0)
+ {
+ type_id = CORBA::string_dup(role_info->type_id_.c_str());
+ (*result) = role_info->infos_;
+ }
+ else
+ {
+ type_id = CORBA::string_dup("");
+ ACE_ERROR(( LM_INFO,
+ "%s: list_factories_by_role: unknown role %s\n",
+ this->identity_.c_str(),
+ role
+ ));
+ }
+ METHOD_RETURN(TAO::PG_FactoryRegistry::list_factories_by_role) result._retn();
+}
+
+::PortableGroup::FactoryInfos * TAO::PG_FactoryRegistry::list_factories_by_location (
+ const PortableGroup::Location & location
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ METHOD_ENTRY(TAO::PG_FactoryRegistry::list_factories_by_location);
+ ::PortableGroup::FactoryInfos_var result;
+ ACE_NEW_THROW_EX (result, ::PortableGroup::FactoryInfos(this->registry_.current_size()),
+ CORBA::NO_MEMORY (TAO::VMCID, CORBA::COMPLETED_NO));
+
+ ACE_CHECK_RETURN (0);
+
+ size_t result_length = 0;
+
+ // iterate through the registery
+ for (RegistryType_Iterator it = this->registry_.begin();
+ it != this->registry_.end();
+ ++it)
+ {
+ RegistryType_Entry & entry = *it;
+ RoleInfo * role_info = entry.int_id_;
+
+ PortableGroup::FactoryInfos & found_infos = role_info->infos_;
+ // iterate through the entry for this type
+ int found = 0;
+ size_t length = found_infos.length();
+ for (size_t nInfo = 0; !found && nInfo < length; ++nInfo)
+ {
+ PortableGroup::FactoryInfo & info = found_infos[nInfo];
+ if (info.the_location == location)
+ {
+ found = 1;
+ result_length += 1;
+ result->length(result_length);
+ (*result)[result_length-1] = info;
+ }
+ }
+ }
+
+ METHOD_RETURN(TAO::PG_FactoryRegistry::list_factories_by_location) result._retn();
+}
+
+//////////////////////////////
+// Implementation methods
+
+int TAO::PG_FactoryRegistry::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,
+ "Open failed for %s\n", outputFile
+ ));
+ }
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.h
new file mode 100644
index 00000000000..b16268b5f66
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.h
@@ -0,0 +1,263 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_FactoryRegistry.h
+ *
+ * $Id$
+ *
+ * This file declares the implementation of PortableGroup::FactoryRegistry.
+ * Eventually this should be folded into the Fault Tolerance ReplicationManager
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef TAO_PG_FACTORYREGISTRY_H_
+#define TAO_PG_FACTORYREGISTRY_H_
+#include /**/ "ace/pre.h"
+#include /**/ "ace/ACE.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+/////////////////////////////////
+// Includes needed by this header
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+#include "orbsvcs/PortableGroupS.h"
+#include "ace/Hash_Map_Manager.h"
+#include "ace/SString.h"
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//////////////////////////////////
+// Classes declared in this header
+namespace TAO
+{
+ class PG_FactoryRegistry;
+}
+
+/////////////////////
+// Forward references
+
+namespace TAO
+{
+ /**
+ * Implement the PortableGroup::FactoryRegistry interface
+ * Note FactoryRegistry is not part of the OMG standard. It was added
+ * as part of the TAO implementation of Fault Tolerant CORBA
+ */
+ class TAO_PortableGroup_Export PG_FactoryRegistry
+ : public virtual POA_PortableGroup::FactoryRegistry
+ {
+ struct RoleInfo
+ {
+ ACE_CString type_id_;
+ PortableGroup::FactoryInfos infos_;
+
+ RoleInfo(size_t estimated_number_entries = 5);
+ };
+ typedef ACE_Null_Mutex MapMutex;
+ typedef ACE_Hash_Map_Manager <ACE_CString, RoleInfo *, MapMutex> RegistryType;
+ typedef ACE_Hash_Map_Entry <ACE_CString, RoleInfo *> RegistryType_Entry;
+ typedef ACE_Hash_Map_Iterator <ACE_CString, RoleInfo *, MapMutex> RegistryType_Iterator;
+
+ //////////////////////
+ // non-CORBA interface
+ public:
+ /// Constructor
+ PG_FactoryRegistry (const char * name = "FactoryRegistry");
+
+ /// virtual Destructor
+ virtual ~PG_FactoryRegistry (void);
+
+ /**
+ * 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 orbManager 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);
+
+ /**
+ * alternative init using designated poa
+ */
+ void init (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa 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);
+
+ /**
+ * Processing to happen when the ORB's event loop is idle.
+ * @param result is a place to return status to be returned by the process
+ * @returns 0 to continue. 1 to quit.
+ */
+ int idle(int & result ACE_ENV_ARG_DECL);
+
+ /**
+ * Identify this object.
+ * @return a string to identify this object for logging/console message purposes.
+ */
+ const char * identity () const;
+
+ /**
+ * An object reference to the this object.
+ * Duplicated by the call so it may (and probably should) be assigned to a _var..
+ */
+ ::PortableGroup::FactoryRegistry_ptr reference();
+
+ ////////////////////////////////
+ // override servant base methods
+ virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL);
+
+ //////////////////
+ // CORBA interface
+ // See IDL for documentation
+
+ virtual void register_factory (
+ const char * role,
+ const char * type_id,
+ const PortableGroup::FactoryInfo & factory_info
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::MemberAlreadyPresent
+ , PortableGroup::TypeConflict));
+
+ virtual void unregister_factory (
+ const char * role,
+ const PortableGroup::Location & location
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException, PortableGroup::MemberNotFound));
+
+ virtual void unregister_factory_by_role (
+ const char * role
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+ virtual void unregister_factory_by_location (
+ const PortableGroup::Location & location
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::PortableGroup::FactoryInfos * list_factories_by_role (
+ const char * role,
+ CORBA::String_out type_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::PortableGroup::FactoryInfos * list_factories_by_location (
+ const PortableGroup::Location & location
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /////////////////////////
+ // Implementation methods
+ private:
+ /**
+ * Write this factory's IOR to a file
+ */
+ int write_ior_file (const char * outputFile, const char * ior);
+
+ ///////////////
+ // Data Members
+ private:
+
+ /**
+ * A human-readable string to distinguish this from other Notifiers.
+ */
+ ACE_CString identity_;
+
+ /**
+ * 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.
+ */
+ TAO_SYNCH_MUTEX internals_;
+ typedef ACE_Guard<TAO_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_;
+
+ /**
+ * This objects identity as a CORBA object.
+ */
+ CORBA::Object_var this_obj_;
+
+ /**
+ * 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 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_;
+
+ /**
+ * Quit on idle flag.
+ */
+ int quit_on_idle_;
+
+ /**
+ * State of the quit process
+ */
+ enum {LIVE, DEACTIVATED, GONE} quit_state_;
+
+ int linger_;
+
+ RegistryType registry_;
+
+ };
+} // namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif // TAO_PG_FACTORYREGISTRY_H_
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Factory_Map.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Factory_Map.h
new file mode 100644
index 00000000000..33c4e1cf421
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Factory_Map.h
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+
+//=======================================================================
+/**
+ * @file PG_Factory_Map.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=======================================================================
+
+
+#ifndef TAO_PG_FACTORY_MAP_H
+#define TAO_PG_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 "orbsvcs/PortableGroup/PG_Factory_Set.h"
+
+#include "orbsvcs/PortableGroupC.h"
+
+#include "ace/Hash_Map_Manager_T.h"
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Factory hash map.
+typedef ACE_Hash_Map_Manager_Ex<
+ ACE_UINT32,
+ TAO_PG_Factory_Set,
+ ACE_Hash<ACE_UINT32>,
+ ACE_Equal_To<ACE_UINT32>,
+ ACE_Null_Mutex> TAO_PG_Factory_Map;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_FACTORY_MAP_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Factory_Set.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Factory_Set.h
new file mode 100644
index 00000000000..9b545e49831
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Factory_Set.h
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+
+//=======================================================================
+/**
+ * @file PG_Factory_Set.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=======================================================================
+
+
+#ifndef TAO_PG_FACTORY_SET_H
+#define TAO_PG_FACTORY_SET_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"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_PG_Factory_Node
+ *
+ * @brief Structure that contains all factory-specific information.
+ *
+ * Each member created by the infrastructure instead of the
+ * application will have a corresponding TAO_PG_Factory_Node structure
+ * associated with it. A list of these will be maintained by the
+ * infrastructure so that it is possible for the instrastructure to
+ * destroy members it created when destroying the object group.
+ */
+struct TAO_PG_Factory_Node
+{
+ /// Member factory information.
+ PortableGroup::FactoryInfo factory_info;
+
+ /// FactoryCreationId assigned to the member.
+ PortableGroup::GenericFactory::FactoryCreationId_var factory_creation_id;
+
+};
+
+typedef ACE_Array_Base<TAO_PG_Factory_Node> TAO_PG_Factory_Set;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_FACTORY_SET_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.cpp
new file mode 100644
index 00000000000..0461276bea1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.cpp
@@ -0,0 +1,780 @@
+#include "orbsvcs/PortableGroup/PG_GenericFactory.h"
+#include "orbsvcs/PortableGroup/PG_MemberInfo.h"
+#include "orbsvcs/PortableGroup/PG_ObjectGroupManager.h"
+#include "orbsvcs/PortableGroup/PG_PropertyManager.h"
+#include "orbsvcs/PortableGroup/PG_Property_Utils.h"
+#include "orbsvcs/PortableGroup/PG_conf.h"
+
+#include "ace/OS_NS_stdio.h"
+
+#include "tao/ORB_Constants.h"
+
+ACE_RCSID (PortableGroup,
+ PG_GenericFactory,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_PG_GenericFactory::TAO_PG_GenericFactory (
+ TAO_PG_ObjectGroupManager & object_group_manager,
+ TAO_PG_PropertyManager & property_manager)
+ : poa_ (),
+ object_group_manager_ (object_group_manager),
+ property_manager_ (property_manager),
+ factory_map_ (TAO_PG_MAX_OBJECT_GROUPS),
+ next_fcid_ (0),
+ lock_ ()
+{
+ this->object_group_manager_.generic_factory (this);
+}
+
+TAO_PG_GenericFactory::~TAO_PG_GenericFactory (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ TAO_PG_Factory_Map::iterator end = this->factory_map_.end ();
+ for (TAO_PG_Factory_Map::iterator i = this->factory_map_.begin ();
+ i != end;
+ ++i)
+ {
+ TAO_PG_Factory_Set & factory_set = (*i).int_id_;
+
+ ACE_TRY
+ {
+ this->delete_object_i (factory_set,
+ 1 /* Ignore exceptions */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions.
+ }
+ ACE_ENDTRY;
+ }
+
+ (void) this->factory_map_.close ();
+}
+
+CORBA::Object_ptr
+TAO_PG_GenericFactory::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))
+{
+ PortableGroup::Properties_var properties =
+ this->property_manager_.get_type_properties (type_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ PortableGroup::MembershipStyleValue membership_style =
+ TAO_PG_MEMBERSHIP_STYLE;
+ PortableGroup::FactoriesValue factory_infos(0);
+
+ PortableGroup::InitialNumberMembersValue initial_number_members =
+ TAO_PG_INITIAL_NUMBER_MEMBERS;
+ PortableGroup::MinimumNumberMembersValue minimum_number_members =
+ TAO_PG_MINIMUM_NUMBER_MEMBERS;
+
+ // Make sure the criteria for the object group being created are
+ // valid.
+ this->process_criteria (type_id,
+ the_criteria,
+ membership_style,
+ factory_infos,
+ initial_number_members,
+ minimum_number_members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ CORBA::ULong fcid = 0;
+
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ CORBA::Object::_nil ());
+
+ // Start out with an initial value.
+ fcid = this->next_fcid_;
+
+ // Loop until a free FactoryCreationId is found, being careful to
+ // search through the range of FactoryCreationIds only once.
+ while (this->factory_map_.find (this->next_fcid_) == 0)
+ {
+ this->next_fcid_++;
+
+ // If this is true, then no FactoryCreationIds are available.
+ // This is highly unlikely since TAO implements a
+ // FactoryCreationId as a 32 bit unsigned integer, meaning
+ // that over 4 billion object groups are being managed by this
+ // generic factory!
+ if (this->next_fcid_ == fcid)
+ ACE_THROW_RETURN (PortableGroup::ObjectNotCreated (),
+ CORBA::Object::_nil ());
+ }
+
+ // Just in case this->next_fcid_ was modified in the above search,
+ // reassign the value.
+ fcid = this->next_fcid_;
+ }
+
+ // The ObjectId for the newly created object group is comprised
+ // solely of the FactoryCreationId.
+ PortableServer::ObjectId_var oid;
+ this->get_ObjectId (fcid, oid.out ());
+
+ PortableGroup::ObjectGroup_var object_group =
+ this->object_group_manager_.create_object_group (fcid,
+ oid.in (),
+ type_id,
+ the_criteria
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ TAO_PG_Factory_Set factory_set;
+
+ const CORBA::ULong factory_infos_count = factory_infos.length ();
+
+ ACE_TRY
+ {
+ if (factory_infos_count > 0
+ && membership_style == PortableGroup::MEMB_INF_CTRL)
+ {
+ this->populate_object_group (object_group.in (),
+ type_id,
+ factory_infos,
+ initial_number_members,
+ factory_set
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->factory_map_.bind (fcid, factory_set) != 0)
+ ACE_TRY_THROW (PortableGroup::ObjectNotCreated ());
+
+ }
+
+ // Allocate a new FactoryCreationId for use as an "out" parameter.
+ PortableGroup::GenericFactory::FactoryCreationId * tmp = 0;
+ ACE_NEW_THROW_EX (tmp,
+ PortableGroup::GenericFactory::FactoryCreationId,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ factory_creation_id = tmp;
+
+ *tmp <<= fcid;
+ }
+ ACE_CATCHANY
+ {
+ this->delete_object_i (factory_set,
+ 1 /* Ignore exceptions */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->object_group_manager_.destroy_object_group (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ CORBA::Object::_nil ());
+
+ // Object group was successfully created. Increment the next
+ // FactoryCreationId in preparation for the next object group.
+ this->next_fcid_++;
+ }
+
+ return object_group._retn ();
+}
+
+void
+TAO_PG_GenericFactory::delete_object (
+ const PortableGroup::GenericFactory::FactoryCreationId &
+ factory_creation_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectNotFound))
+{
+ CORBA::ULong fcid = 0;
+
+ if (factory_creation_id >>= fcid) // Extract the actual FactoryCreationId.
+ {
+ // Successfully extracted the FactoryCreationId. Now find the
+ // TAO_PG_Factory_Set corresponding to it.
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_);
+
+ // If no entry exists in the factory map, infrastructure
+ // controlled membership was not used.
+ TAO_PG_Factory_Map::ENTRY *entry = 0;
+ if (this->factory_map_.find (fcid, entry) == 0)
+ {
+ TAO_PG_Factory_Set & factory_set = entry->int_id_;
+
+ this->delete_object_i (factory_set,
+ 0 /* Do not ignore exceptions */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->factory_map_.unbind (fcid) != 0)
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+ }
+ else
+ ACE_THROW (PortableGroup::ObjectNotFound ()); // @@
+ // CORBA::BAD_PARAM
+ // instead?
+
+ // The ObjectId for the newly created object group is comprised
+ // solely of the FactoryCreationId.
+ PortableServer::ObjectId_var oid;
+ this->get_ObjectId (fcid, oid.out ());
+
+ // Destroy the object group entry.
+ this->object_group_manager_.destroy_object_group (
+ oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_PG_GenericFactory::delete_object_i (TAO_PG_Factory_Set & factory_set,
+ CORBA::Boolean ignore_exceptions
+ ACE_ENV_ARG_DECL)
+{
+ const size_t len = factory_set.size ();
+
+ size_t ilen = len;
+ for (size_t i = 0; i != len; ++i)
+ {
+ // Destroy the object group member in reverse order in case the
+ // array list is only partially destroyed and another call to
+ // GenericFactory::delete_object() occurs afterwards.
+ --ilen;
+
+ TAO_PG_Factory_Node & factory_node = factory_set[ilen];
+
+ PortableGroup::GenericFactory_ptr factory =
+ factory_node.factory_info.the_factory.in ();
+ const PortableGroup::GenericFactory::FactoryCreationId & member_fcid =
+ factory_node.factory_creation_id.in ();
+
+ ACE_TRY
+ {
+ factory->delete_object (member_fcid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Exceptions are generally only ignored when this
+ // GenericFactory (not the one being invoked above) is
+ // destroyed. The idea is to allow the GenericFactory to be
+ // destroyed regardless of whether or not all object group
+ // members have been destroyed, and minimize the number of
+ // object group members that have not been destroyed.
+ if (!ignore_exceptions)
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ // Since GenericFactory::delete_object() can throw an exception,
+ // decrease the size of the factory array incrementally since
+ // some object group members may not have been destroyed yet.
+ // Note that this size reduction is fast since no memory is
+ // actually deallocated.
+ factory_set.size (ilen);
+ }
+}
+
+void
+TAO_PG_GenericFactory::delete_member (
+ CORBA::ULong group_id,
+ const PortableGroup::Location & location
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_);
+
+ // If no entry exists in the factory map, infrastructure
+ // controlled membership was not used.
+ TAO_PG_Factory_Map::ENTRY *entry = 0;
+ if (this->factory_map_.find (group_id, entry) == 0)
+ {
+ TAO_PG_Factory_Set & factory_set = entry->int_id_;
+
+ const size_t len = factory_set.size ();
+
+ // Iterate through the factory_set until a location match
+ // occurs. If a location match occurs, the member was created
+ // by the infrastructure, i.e. this GenericFactory
+ // implementation. If no location matches, the member was
+ // created by the application, and no operation will be
+ // performed.
+ //
+ // @todo This is linear search. Change to use a container with
+ // better search times.
+ for (size_t i = 0; i < len; ++i)
+ {
+ TAO_PG_Factory_Node & node = factory_set[i];
+ PortableGroup::FactoryInfo & info = node.factory_info;
+
+ if (info.the_location == location)
+ {
+ info.the_factory->delete_object (node.factory_creation_id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // The member has been successfully deleted. Reduce the
+ // size of the factory_set accordingly.
+ if (len > 1)
+ {
+ // Move the last element to the location of the
+ // current one and reduce the size of the set by
+ // one.
+ const size_t new_len = len - 1;
+ node = factory_set[new_len]; // Memberwise copy
+ factory_set.size (new_len);
+ }
+ else
+ {
+ // A copy isn't necessary if the last member was
+ // deleted.
+ factory_set.size (0);
+ }
+
+ return;
+ }
+ }
+ }
+}
+
+void
+TAO_PG_GenericFactory::poa (PortableServer::POA_ptr p)
+{
+ ACE_ASSERT (CORBA::is_nil (this->poa_.in ())
+ && !CORBA::is_nil (p));
+
+ this->poa_ = PortableServer::POA::_duplicate (p);
+}
+
+void
+TAO_PG_GenericFactory::populate_object_group (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const char * type_id,
+ const PortableGroup::FactoryInfos & factory_infos,
+ PortableGroup::InitialNumberMembersValue initial_number_members,
+ TAO_PG_Factory_Set & factory_set
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::ULong factory_infos_count = factory_infos.length ();
+ factory_set.size (factory_infos_count);
+
+ for (CORBA::ULong j = 0; j < factory_infos_count; ++j)
+ {
+ TAO_PG_Factory_Node & factory_node = factory_set[j];
+
+ const PortableGroup::FactoryInfo &factory_info = factory_infos[j];
+
+ if (j < static_cast<CORBA::ULong> (initial_number_members))
+ {
+ PortableGroup::GenericFactory_ptr factory =
+ factory_info.the_factory.in ();
+
+ if (CORBA::is_nil (factory))
+ {
+ // @@ instead InvalidProperty?
+ ACE_THROW (PortableGroup::NoFactory (factory_info.the_location,
+ type_id));
+ }
+
+ // Do not allow the PortableGroup::MemberAlreadyPresent
+ // exception to be propagated to this scope.
+ const CORBA::Boolean propagate_member_already_present = 0;
+
+ factory_node.factory_creation_id =
+ this->create_member (object_group,
+ factory_info,
+ type_id,
+ propagate_member_already_present
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ factory_node.factory_info = factory_info; // Memberwise copy
+ }
+}
+
+void
+TAO_PG_GenericFactory::get_ObjectId (
+ CORBA::ULong fcid,
+ PortableServer::ObjectId_out oid)
+{
+ // Since the POA used by the LoadManager uses the NON_RETAIN
+ // policy, explicitly choose an ObjectId that is unique to a given
+ // type.
+
+ // Make the ObjectId be the next value of the number of types that
+ // have been registered with the LoadManager. For example, if two
+ // types of objects have been registered with the LoadManager, then
+ // the ObjectId for the object currently being registered will be
+ // "3" since the object will be the third type of object registered
+ // with the LoadManager. Previously used values will not be reused
+ // to ensure that a ServantLocator does not inadvertently return a
+ // reference to an object that had a previously used ObjectId.
+ // Specifcally, the numerical value used for the ObjectId increases
+ // monotonically.
+
+ // 4294967295UL -- Largest 32 bit unsigned integer
+ // 123456789012 -- 10 digits
+ // + 2 for "UL" (unnecessary, but let's be safe)
+ // + 1 for null terminator
+ // + 1 for good luck. :-)
+ const size_t MAX_OID_LEN = 14;
+
+ char oid_str[MAX_OID_LEN] = { 0 };
+ ACE_OS::sprintf (oid_str,
+ "%ul",
+ fcid);
+
+ oid = PortableServer::string_to_ObjectId (oid_str);
+}
+
+void
+TAO_PG_GenericFactory::process_criteria (
+ const char * type_id,
+ const PortableGroup::Criteria & criteria,
+ PortableGroup::MembershipStyleValue & membership_style,
+ PortableGroup::FactoriesValue & factory_infos,
+ PortableGroup::InitialNumberMembersValue & initial_number_members,
+ PortableGroup::MinimumNumberMembersValue & minimum_number_members
+ ACE_ENV_ARG_DECL)
+{
+ // Get type-specific properties.
+ PortableGroup::Properties_var props =
+ this->property_manager_.get_type_properties (type_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Merge the given criteria with the type-specific criteria.
+ TAO_PG::override_properties (criteria, props.inout ());
+
+ PortableGroup::Criteria unmet_criteria;
+ unmet_criteria.length (4); // The four criteria understood by this
+ // method.
+
+ // Unmet criteria count.
+ CORBA::ULong uc = 0;
+
+ PortableGroup::Name name (1);
+ name.length (1);
+
+ PortableGroup::Value value;
+ PortableGroup::Value value1;
+ PortableGroup::Value value2;
+ PortableGroup::Value value3;
+
+ // MembershipStyle
+ name[0].id = CORBA::string_dup ("org.omg.PortableGroup.MembershipStyle");
+ if (TAO_PG::get_property_value (name, props.in (), value)
+ && (!(value >>= membership_style)
+ || (membership_style != PortableGroup::MEMB_APP_CTRL
+ && membership_style != PortableGroup::MEMB_INF_CTRL)))
+ {
+ // This only occurs if extraction of the actual value from the
+ // Any fails.
+ ACE_THROW (PortableGroup::InvalidProperty (name, value));
+ }
+
+ // Factories
+ const PortableGroup::FactoryInfos * factory_infos_tmp = 0;
+ name[0].id = CORBA::string_dup ("org.omg.PortableGroup.Factories");
+ if (TAO_PG::get_property_value (name, props.in (), value1)
+ && !(value1 >>= factory_infos_tmp))
+ {
+ // This only occurs if extraction of the actual value from the
+ // Any fails.
+ ACE_THROW (PortableGroup::InvalidProperty (name, value1));
+ }
+
+ const CORBA::ULong factory_infos_count =
+ (factory_infos_tmp == 0 ? 0 : factory_infos_tmp->length ());
+
+ // InitialNumberMembers
+ name[0].id =
+ CORBA::string_dup ("org.omg.PortableGroup.InitialNumberMembers");
+ if (TAO_PG::get_property_value (name, props.in (), value2)
+ && !(value2 >>= initial_number_members))
+ {
+ // This only occurs if extraction of the actual value from the
+ // Any fails.
+ ACE_THROW (PortableGroup::InvalidProperty (name, value2));
+ }
+
+ if (membership_style == PortableGroup::MEMB_INF_CTRL)
+ {
+ // If the number of factories is less than the initial number of
+ // members or the desired number of initial members cannot
+ // possibly be created.
+
+ if (factory_infos_count < static_cast<CORBA::ULong> (initial_number_members))
+ {
+ unmet_criteria[uc].nam = name;
+ unmet_criteria[uc++].val = value2;
+ }
+ }
+
+ // MinimumNumberMembers
+ name[0].id =
+ CORBA::string_dup ("org.omg.PortableGroup.MinimumNumberMembers");
+ if (TAO_PG::get_property_value (name, props.in (), value3)
+ && !(value3 >>= minimum_number_members))
+ {
+ // This only occurs if extraction of the actual value from the
+ // Any fails.
+ ACE_THROW (PortableGroup::InvalidProperty (name, value3));
+ }
+
+ // If the minimum number of members is less than the initial number
+ // of members, the MinimumNumberMembers property is cannot be
+ // initially met.
+ //
+ // @note This code is not part of the above "MEMB_INF_CTRL" criteria
+ // check since the "name" and "value" variables have been
+ // changed.
+ if (membership_style == PortableGroup::MEMB_INF_CTRL)
+ {
+ if (minimum_number_members < initial_number_members
+ || static_cast<CORBA::ULong> (minimum_number_members) > factory_infos_count)
+ {
+ unmet_criteria[uc].nam = name;
+ unmet_criteria[uc++].val = value3;
+ }
+ else if (factory_infos_tmp != 0)
+ {
+ factory_infos.length (factory_infos_count);
+ factory_infos = *factory_infos_tmp;
+ }
+ }
+
+ if (uc > 0)
+ {
+ // Reduce the length of the unmet criteria sequence in an effort
+ // to optimize the copying that will occur when the below
+ // exception is thrown. Reducing the length is fast since no
+ // deallocations should occur.
+ unmet_criteria.length (uc);
+
+ ACE_THROW (PortableGroup::CannotMeetCriteria (unmet_criteria));
+ }
+}
+
+void
+TAO_PG_GenericFactory::check_minimum_number_members (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CORBA::ULong group_id,
+ const char * type_id
+ ACE_ENV_ARG_DECL)
+{
+ // Check if we've dropped below the MinimumNumberMembers threshold.
+ // If so, attempt to create enough new members to fill the gap.
+
+ // If no entry exists in the factory map, infrastructure (this
+ // GenericFactory implementation) controlled membership was not
+ // used.
+ TAO_PG_Factory_Map::ENTRY *entry = 0;
+ if (this->factory_map_.find (group_id, entry) != 0)
+ return;
+
+ TAO_PG_Factory_Set & factory_set = entry->int_id_;
+
+ PortableGroup::Properties_var props =
+ this->property_manager_.get_properties (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableGroup::Name name (1);
+ name.length (1);
+
+ PortableGroup::Value value;
+
+ // MinimumNumberMembers
+ name[0].id =
+ CORBA::string_dup ("org.omg.PortableGroup.MinimumNumberMembers");
+
+ PortableGroup::MinimumNumberMembersValue minimum_number_members;
+
+ if (TAO_PG::get_property_value (name, props.in (), value))
+ {
+ if (!(value >>= minimum_number_members))
+ {
+ // This only occurs if extraction of the actual value from
+ // the Any fails. It shouldn't fail at this point.
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ const CORBA::ULong count =
+ this->object_group_manager_.member_count (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (count >= static_cast<CORBA::ULong> (minimum_number_members))
+ return;
+
+ const CORBA::ULong gap =
+ static_cast<CORBA::ULong> (minimum_number_members) - count;
+
+ CORBA::ULong creation_count = 0;
+
+ const size_t len = factory_set.size ();
+
+ static const PortableGroup::GenericFactory::FactoryCreationId *
+ nil_fcid = 0;
+
+ for (size_t i = 0; i < len; ++i)
+ {
+ TAO_PG_Factory_Node & node = factory_set[i];
+
+ PortableGroup::GenericFactory::FactoryCreationId * const tmp_fcid =
+ node.factory_creation_id;
+
+ // Check if the application supplied GenericFactory was
+ // already invoked.
+ if (tmp_fcid != nil_fcid)
+ continue;
+
+ ACE_TRY
+ {
+ const CORBA::Boolean propagate_member_already_present = 1;
+
+ node.factory_creation_id =
+ this->create_member (object_group,
+ node.factory_info,
+ type_id,
+ propagate_member_already_present
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ++creation_count;
+
+ // Check if the MinimumNumberMembers threshold gap has
+ // been filled.
+ if (gap == creation_count)
+ return;
+ }
+ ACE_CATCH (PortableGroup::MemberAlreadyPresent, ex)
+ {
+ // Ignore this exception and continue.
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+
+ // @todo If we get this far, and the MinimumNumberMembers
+ // threshold gap hasn't been filled, what do we do? Throw
+ // a CORBA::TRANSIENT?
+ }
+}
+
+PortableGroup::GenericFactory::FactoryCreationId *
+TAO_PG_GenericFactory::create_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::FactoryInfo & factory_info,
+ const char * type_id,
+ const CORBA::Boolean propagate_member_already_present
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::NoFactory,
+ PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::InvalidProperty,
+ PortableGroup::CannotMeetCriteria,
+ PortableGroup::MemberAlreadyPresent))
+{
+ PortableGroup::GenericFactory::FactoryCreationId_var fcid;
+
+ CORBA::Object_var member =
+ factory_info.the_factory->create_object (type_id,
+ factory_info.the_criteria,
+ fcid.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ACE_TRY
+ {
+ // @@ Should an "_is_a()" be performed here? While it
+ // appears to be the right thing to do, it can be
+ // expensive.
+ //
+ // Make sure an Object of the correct type was created.
+ // It is possible that an object of the wrong type was
+ // created if the type_id parameter does not match the
+ // type of object the GenericFactory creates.
+ CORBA::Boolean right_type_id =
+ member->_is_a (type_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // @todo Strategize this -- e.g. strict type checking.
+ if (!right_type_id)
+ {
+ // An Object of incorrect type was created. Delete
+ // it, and throw a NoFactory exception.
+ factory_info.the_factory->delete_object (fcid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TRY_THROW (PortableGroup::NoFactory (factory_info.the_location,
+ type_id));
+ }
+
+ this->object_group_manager_._tao_add_member (
+ object_group,
+ factory_info.the_location,
+ member.in (),
+ type_id,
+ propagate_member_already_present
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // If the member reference is not nil, then the factory
+ // was successfully invoked. Since an exception was
+ // thrown, clean up the up created member.
+ if (!CORBA::is_nil (member.in ()))
+ {
+ factory_info.the_factory->delete_object (fcid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ return fcid._retn ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.h
new file mode 100644
index 00000000000..96b725c941a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_GenericFactory.h
@@ -0,0 +1,248 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_GenericFactory.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PG_GENERIC_FACTORY_H
+#define TAO_PG_GENERIC_FACTORY_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/PortableGroup/PG_Factory_Map.h"
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+#include "tao/PortableServer/PortableServerC.h"
+#include "orbsvcs/PortableGroupC.h"
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Forward declarations.
+class TAO_PG_ObjectGroupManager;
+class TAO_PG_PropertyManager;
+
+struct TAO_PG_ObjectGroup_Map_Entry;
+
+
+/**
+ * @class TAO_PG_GenericFactory
+ *
+ * @brief PortableGroup::GenericFactory implementation used by the
+ * load balancer when creating object groups.
+ *
+ * This GenericFactory creates an object group reference for given set
+ * of replicas. Those replicas will be created by this GenericFactory
+ * if the "infrastructure-controlled" membership style is configured.
+ */
+class TAO_PortableGroup_Export TAO_PG_GenericFactory
+ : public virtual PortableGroup::GenericFactory
+{
+public:
+
+ /// Constructor.
+ TAO_PG_GenericFactory (TAO_PG_ObjectGroupManager & object_group_map,
+ TAO_PG_PropertyManager & property_manager);
+
+ /// Destructor.
+ ~TAO_PG_GenericFactory (void);
+
+ /**
+ * @name TAO_LoadBalancer::GenericFactory methods
+ */
+ //@{
+
+ /**
+ * Create an object of the specified type that adheres to the
+ * restrictions defined by the provided Criteria. The out
+ * FactoryCreationId parameter may be passed to the delete_object()
+ * method to delete the object.
+ */
+ 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));
+
+ /**
+ * Delete the object corresponding to the provided
+ * FactoryCreationId. If the object is actually an ObjectGroup,
+ * then all members within the ObjectGroup will be deleted.
+ * Afterward, the ObjectGroup itself will be deleted.
+ */
+ virtual void delete_object (
+ const PortableGroup::GenericFactory::FactoryCreationId &
+ factory_creation_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectNotFound));
+
+ //@}
+
+ /// Set the POA to use when creating object references.
+ void poa (PortableServer::POA_ptr p);
+
+ /// Call delete_object() on all factories use to create members in a
+ /// given object group.
+ /**
+ * If ignore_exceptions is true, any exception returned from the
+ * delete_object() call on the remote factory will be ignored in
+ * order to allow other objects to be deleted via other registered
+ * factories.
+ */
+ void delete_object_i (TAO_PG_Factory_Set & factory_set,
+ CORBA::Boolean ignore_exceptions
+ ACE_ENV_ARG_DECL);
+
+ /// If the member corresponding to the given group ID and location
+ /// was created by the infrastructure, call delete_object() on the
+ /// remote GenericFactory that created it.
+ /**
+ * This method is only used by the TAO_PG_ObjectGroupManager class
+ * when ObjectGroupManager::remove_member() is explicitly called.
+ */
+ void delete_member (CORBA::ULong group_id,
+ const PortableGroup::Location & location
+ ACE_ENV_ARG_DECL);
+
+ /// Verify that the MinimumNumberMembers criterion is satisfied.
+ /**
+ * If the current number of members in the given object group is
+ * less than the MinimumNumberMembers criterion in effect for that
+ * group, the infrastructure will attempt create and add more
+ * members to the group by invoking any unused application-supplied
+ * GenericFactorys.
+ */
+ void check_minimum_number_members (
+ PortableGroup::ObjectGroup_ptr object_group,
+ CORBA::ULong group_id,
+ const char * type_id
+ ACE_ENV_ARG_DECL);
+
+ /// Create a new object group member using the supplied FactoryInfo
+ /// and RepositoryId and add it to the given object group.
+ /**
+ * @note This method is only used by the infrastructure.
+ */
+ PortableGroup::GenericFactory::FactoryCreationId * create_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::FactoryInfo & factory_info,
+ const char * type_id,
+ const CORBA::Boolean propagate_member_already_present
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::NoFactory,
+ PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::InvalidProperty,
+ PortableGroup::CannotMeetCriteria,
+ PortableGroup::MemberAlreadyPresent));
+
+private:
+
+ /// Populate the object group being created. Called when the
+ /// infrastructure-controlled membership style is used for the
+ /// object group being created.
+ void populate_object_group (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const char * type_id,
+ const PortableGroup::FactoryInfos &factory_infos,
+ PortableGroup::InitialNumberMembersValue initial_number_members,
+ TAO_PG_Factory_Set & factory_set
+ ACE_ENV_ARG_DECL);
+
+ /// Get a new ObjectId to be used when creating a new ObjectGroup.
+ /**
+ * An ObjectId created by this method will never be reused within
+ * the scope of a given ReplicationManager. A value suitable for
+ * use in a map association <ext_id> is also returned.
+ */
+ void get_ObjectId (CORBA::ULong fcid,
+ PortableServer::ObjectId_out oid);
+
+ /// Process criteria to be applied to the object group being
+ /// created.
+ /**
+ * Only the MemberShipStyle, Factories, InitialNumberMembers and
+ * MinimumNumberMembers criteria/properties are defined by the
+ * PortableGroup IDL. Other services that implement the
+ * GenericFactory interface, such as load balancing and fault
+ * tolerance, may choose to support more.
+ * @par
+ * The extracted criteria are object group-specific. In particular,
+ * they are the object group creation time criteria.
+ */
+ void process_criteria (
+ const char * type_id,
+ const PortableGroup::Criteria & criteria,
+ PortableGroup::MembershipStyleValue & membership_style,
+ PortableGroup::FactoriesValue & factory_infos,
+ PortableGroup::InitialNumberMembersValue & initial_number_members,
+ PortableGroup::MinimumNumberMembersValue & minimum_number_members
+ ACE_ENV_ARG_DECL);
+
+private:
+
+ /// Reference to the POA used to create object group references.
+ PortableServer::POA_var poa_;
+
+ /// Reference to the ObjectGroup map.
+ TAO_PG_ObjectGroupManager & object_group_manager_;
+
+ /// Reference to the PropertyManager.
+ TAO_PG_PropertyManager & property_manager_;
+
+ /// Table that maps FactoryCreationId to TAO_PG_Factory_Set.
+ /**
+ * The TAO_PG_Factory_Set corresponding to a given FactoryCreationId
+ * contains the information necessary to clean up objects (members)
+ * that were created by the infrastructure, i.e. this
+ * GenericFactory. For example, this GenericFactory will invoke
+ * other application defined GenericFactorys when creating new
+ * object group members. The information returned from those
+ * application defined GenericFactorys is stored in a
+ * TAO_PG_Factory_Set, and thus this table.
+ */
+ TAO_PG_Factory_Map factory_map_;
+
+ /// The FactoryCreationId that will be assigned to the next object
+ /// group that is created.
+ /**
+ * Value that is used when assigning a FactoryCreationId to the
+ * factory that was used to create a given ObjectGroup. The
+ * FactoryCreationId is typically comprised of this value in
+ * addition to another value that makes it unique to a given Load
+ * Balancer.
+ */
+ CORBA::ULong next_fcid_;
+
+ /// Lock used to synchronize access to the factory creation id
+ /// index (i.e. next_fcid_).
+ TAO_SYNCH_MUTEX lock_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_GENERIC_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp
new file mode 100644
index 00000000000..3c84812d454
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp
@@ -0,0 +1,232 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Group_Factory.cpp
+ *
+ * $Id$
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#include "orbsvcs/PortableGroup/PG_Group_Factory.h"
+#include "orbsvcs/PortableGroup/PG_Property_Utils.h"
+#include "orbsvcs/PortableGroup/PG_conf.h"
+#include "orbsvcs/PortableGroupC.h"
+#include "orbsvcs/PortableGroup/PG_Object_Group.h"
+#include <orbsvcs/PortableGroup/PG_Utils.h>
+
+ACE_RCSID (PortableGroup,
+ PG_Group_Factory,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::PG_Group_Factory::PG_Group_Factory ()
+ : orb_ (CORBA::ORB::_nil())
+ , poa_ (PortableServer::POA::_nil())
+ , manipulator_ ()
+ , domain_id_ ("default-domain")
+
+{
+}
+
+TAO::PG_Group_Factory::~PG_Group_Factory (void)
+{
+ for (Group_Map_Iterator it = this->group_map_.begin ();
+ it != this->group_map_.end ();
+ ++it)
+ {
+ TAO::PG_Object_Group * group = (*it).int_id_;
+ delete group;
+ }
+ this->group_map_.unbind_all ();
+}
+
+
+void TAO::PG_Group_Factory::init (
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableGroup::FactoryRegistry_ptr factory_registry
+ ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (CORBA::is_nil (this->orb_.in ()));
+ ACE_ASSERT (CORBA::is_nil (this->poa_.in ()));
+ ACE_ASSERT (CORBA::is_nil (this->factory_registry_.in ()));
+
+ this->orb_ = CORBA::ORB::_duplicate(orb);
+ this->poa_ = PortableServer::POA::_duplicate (poa);
+ this->factory_registry_ = PortableGroup::FactoryRegistry::_duplicate (factory_registry);
+
+
+ ACE_ASSERT (!CORBA::is_nil (this->orb_.in ()));
+ ACE_ASSERT (!CORBA::is_nil (this->poa_.in ()));
+ ACE_ASSERT (!CORBA::is_nil (this->factory_registry_.in ()));
+
+ this->manipulator_.init (orb, poa ACE_ENV_ARG_PARAMETER);
+// ACE_CHECK;
+}
+
+
+TAO::PG_Object_Group * TAO::PG_Group_Factory::create_group (
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria,
+ TAO::PG_Property_Set * typeid_properties
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::NoFactory,
+ PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::InvalidProperty,
+ PortableGroup::CannotMeetCriteria))
+{
+ ///////////////////////////////////
+ // Create an empty group reference
+
+ PortableGroup::ObjectGroupId group_id = 0;
+ PortableGroup::ObjectGroup_var empty_group =
+ this->manipulator_.create_object_group (
+ type_id,
+ this->domain_id_,
+ group_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // pick up the object group information as assigned by
+ // ObjectGroupManager
+
+ PortableGroup::TagGroupTaggedComponent tagged_component;
+ if (! TAO::PG_Utils::get_tagged_component (empty_group, tagged_component))
+ {
+ ACE_THROW_RETURN (PortableGroup::ObjectNotCreated(), 0);
+ }
+
+ TAO::PG_Object_Group * objectGroup = 0;
+
+ ACE_NEW_THROW_EX (
+ objectGroup,
+ TAO::PG_Object_Group (
+ this->orb_.in (),
+ this->factory_registry_.in (),
+ this->manipulator_,
+ empty_group.in (),
+ tagged_component,
+ type_id,
+ the_criteria,
+ typeid_properties
+ ),
+ CORBA::NO_MEMORY());
+
+ if (this->group_map_.bind (group_id, objectGroup) != 0)
+ {
+ delete objectGroup;
+ ACE_THROW_RETURN (PortableGroup::ObjectNotCreated(), 0);
+ }
+ return objectGroup;
+}
+
+void TAO::PG_Group_Factory::delete_group (PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectNotFound))
+{
+ if (! destroy_group (object_group))
+ {
+ ACE_THROW (PortableGroup::ObjectNotFound ());
+ }
+}
+
+
+void TAO::PG_Group_Factory::delete_group (PortableGroup::ObjectGroupId group_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectNotFound))
+{
+ if (! destroy_group (group_id))
+ {
+ ACE_THROW (PortableGroup::ObjectNotFound ());
+ }
+}
+
+ // insert group. Take ownership
+int TAO::PG_Group_Factory::insert_group ( ::TAO::PG_Object_Group * group)
+{
+ return insert_group (group->get_object_group_id(), group);
+}
+
+int TAO::PG_Group_Factory::insert_group (PortableGroup::ObjectGroupId group_id, ::TAO::PG_Object_Group * group)
+{
+ return (this->group_map_.bind (group_id, group) == 0);
+}
+
+int TAO::PG_Group_Factory::find_group (PortableGroup::ObjectGroupId group_id, ::TAO::PG_Object_Group *& group) const
+{
+ return (this->group_map_.find (group_id , group) == 0);
+}
+
+int TAO::PG_Group_Factory::find_group (PortableGroup::ObjectGroup_ptr object_group, ::TAO::PG_Object_Group *& group) const
+{
+ int result = 0;
+ PortableGroup::TagGroupTaggedComponent tc;
+ if (TAO::PG_Utils::get_tagged_component (object_group, tc))
+ {
+ result = find_group (tc.object_group_id, group);
+ }
+ return result;
+}
+
+int TAO::PG_Group_Factory::destroy_group (PortableGroup::ObjectGroupId group_id)
+{
+ ::TAO::PG_Object_Group * group = 0;
+ int result = (this->group_map_.unbind (group_id, group) == 0);
+ if (result)
+ {
+ delete group;
+ }
+ return result;
+}
+
+int TAO::PG_Group_Factory::destroy_group (PortableGroup::ObjectGroup_ptr object_group)
+{
+ PortableGroup::TagGroupTaggedComponent tc;
+ TAO::PG_Utils::get_tagged_component (object_group, tc);
+ return destroy_group (tc.object_group_id);
+}
+
+
+
+PortableGroup::ObjectGroups *
+TAO::PG_Group_Factory::groups_at_location (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException))
+{
+ size_t upper_limit = this->group_map_.current_size ();
+ PortableGroup::ObjectGroups * result = 0;
+ ACE_NEW_THROW_EX (
+ result,
+ PortableGroup::ObjectGroups (upper_limit),
+ CORBA::NO_MEMORY());
+ ACE_CHECK_RETURN (0);
+
+ result->length(upper_limit);
+
+ size_t group_count = 0;
+ for (Group_Map_Iterator it = this->group_map_.begin ();
+ it != this->group_map_.end ();
+ ++it)
+ {
+ TAO::PG_Object_Group * group = (*it).int_id_;
+ if (group->has_member_at (the_location))
+ {
+ (*result)[group_count] = group->reference ();
+ ++group_count;
+ }
+ }
+ result->length (group_count);
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h
new file mode 100644
index 00000000000..b9bd1309492
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h
@@ -0,0 +1,184 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Group_Factory.h
+ *
+ * $Id$
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef TAO_PG_GROUP_FACTORY_H
+#define TAO_PG_GROUP_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroup/PG_Object_Group_Manipulator.h"
+
+#include "orbsvcs/PortableGroupC.h"
+
+#include "tao/PortableServer/PortableServer.h"
+
+#include "ace/ACE.h"
+#include "ace/Hash_Map_Manager.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//////////////////
+// Forward reference
+namespace TAO
+{
+ class PG_Property_Set;
+} // namespace TAO_PG
+
+namespace TAO
+{
+ /////////////////////
+ // forward references
+ class PG_Object_Group;
+
+ /**
+ * class PG_Group_Factory
+ */
+ class TAO_PortableGroup_Export PG_Group_Factory
+ {
+ ////////////////////////////////////////////////////////////
+ // typedef private implementation classes
+ typedef ACE_Hash_Map_Manager_Ex<
+ PortableGroup::ObjectGroupId,
+ ::TAO::PG_Object_Group *,
+ ACE_Hash<ACE_UINT64>,
+ ACE_Equal_To<ACE_UINT64>,
+ TAO_SYNCH_MUTEX> Group_Map;
+
+ typedef ACE_Hash_Map_Entry <PortableGroup::ObjectGroupId, ::TAO::PG_Object_Group *> Group_Map_Entry;
+
+ typedef ACE_Hash_Map_Iterator_Ex <
+ PortableGroup::ObjectGroupId,
+ ::TAO::PG_Object_Group *,
+ ACE_Hash<ACE_UINT64>,
+ ACE_Equal_To<ACE_UINT64>,
+ TAO_SYNCH_MUTEX> Group_Map_Iterator;
+
+ public:
+
+ /// Constructor.
+ PG_Group_Factory ();
+
+ /// Destructor.
+ ~PG_Group_Factory ();
+
+ void init (
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableGroup::FactoryRegistry_ptr factory_registry
+ ACE_ENV_ARG_DECL);
+
+
+ TAO::PG_Object_Group * create_group (
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria,
+ TAO::PG_Property_Set * typeid_properties
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::NoFactory,
+ PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::InvalidProperty,
+ PortableGroup::CannotMeetCriteria));
+
+
+ void delete_group (PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectNotFound));
+
+
+ void delete_group (PortableGroup::ObjectGroupId group_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectNotFound));
+
+ PortableGroup::ObjectGroups *
+ groups_at_location (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException));
+
+
+
+ /**
+ * insert existing group. Take ownership
+ * note: uses group id extracted from group object
+ * @return bool true if insertion successful
+ */
+ int insert_group ( ::TAO::PG_Object_Group * group);
+
+ /**
+ * insert group. Take ownership
+ * @return bool true if insertion successful
+ */
+ int insert_group (PortableGroup::ObjectGroupId group_id, ::TAO::PG_Object_Group * group);
+
+ /**
+ * find group
+ * @return bool true if found
+ */
+ int find_group (PortableGroup::ObjectGroupId group_id, ::TAO::PG_Object_Group *& group) const;
+
+ /**
+ * find group
+ * note: uses group id extracted from object_group
+ * @return bool true if found
+ */
+ int find_group (PortableGroup::ObjectGroup_ptr object_group, ::TAO::PG_Object_Group *& group) const;
+
+ /**
+ * remove group from map and delete it.
+ * @return bool true if found
+ */
+ int destroy_group (PortableGroup::ObjectGroupId object_group_id);
+
+ /**
+ * remove group from map and delete it.
+ * note: uses group id extracted from object_group
+ * @return bool true if found
+ */
+ int destroy_group (PortableGroup::ObjectGroup_ptr object_group);
+
+ private:
+
+ private:
+
+ CORBA::ORB_var orb_;
+
+ /// Reference to the POA used to create object group references.
+ PortableServer::POA_var poa_;
+
+ /// The factory registry for replica factories
+ PortableGroup::FactoryRegistry_var factory_registry_;
+
+ ::TAO::PG_Object_Group_Manipulator manipulator_;
+
+ const char * domain_id_;
+
+ Group_Map group_map_;
+
+
+ };
+} // namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_GROUP_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Guard.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Guard.cpp
new file mode 100644
index 00000000000..dc93a9e2e2c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Guard.cpp
@@ -0,0 +1,59 @@
+#include "orbsvcs/PortableGroup/PG_Group_Guard.h"
+
+#include "orbsvcs/PortableGroup/PG_GenericFactory.h"
+#include "orbsvcs/PortableGroup/PG_ObjectGroupManager.h"
+
+
+ACE_RCSID (PortableGroup,
+ PG_Group_Guard,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_PG_Group_Guard::TAO_PG_Group_Guard (
+ TAO_PG_GenericFactory & generic_factory,
+ TAO_PG_Factory_Set & factory_set,
+ TAO_PG_ObjectGroupManager & group_manager,
+ const PortableServer::ObjectId & oid)
+ : generic_factory_ (generic_factory),
+ factory_set_ (factory_set),
+ group_manager_ (group_manager),
+ oid_ (oid),
+ released_ (0)
+{
+}
+
+TAO_PG_Group_Guard::~TAO_PG_Group_Guard (void)
+{
+ if (!this->released_)
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->generic_factory_.delete_object_i (this->factory_set_,
+ 1 // Ignore exceptions
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This should never throw an exception if this Guard is
+ // used properly.
+ this->group_manager_.destroy_object_group (this->oid_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore all exceptions.
+ }
+ ACE_ENDTRY;
+ }
+}
+
+void
+TAO_PG_Group_Guard::release (void)
+{
+ this->released_ = 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Guard.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Guard.h
new file mode 100644
index 00000000000..2c6ca8fe9ee
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Guard.h
@@ -0,0 +1,93 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Group_Guard.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PG_GROUP_GUARD_H
+#define TAO_PG_GROUP_GUARD_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/PortableGroup/PG_Factory_Set.h"
+
+#include "tao/PortableServer/PortableServerC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Forward declarations.
+class TAO_PG_GenericFactory;
+class TAO_PG_ObjectGroupManager;
+
+/**
+ * @class TAO_PG_Group_Guard
+ *
+ * @brief Guard implementation used to make object group cleanup
+ * exception-safe.
+ *
+ * This guard's destructor performs cleanup of object group
+ * resources. Thus, cleanup is performed when this guard goes out of
+ * scope unless explicitly released from that responsibility.
+ *
+ * This guard is meant to be used internally by the
+ * TAO_PG_GenericFactory class.
+ */
+class TAO_PG_Group_Guard
+{
+public:
+
+ /// Constructor.
+ TAO_PG_Group_Guard (TAO_PG_GenericFactory & generic_factory,
+ TAO_PG_Factory_Set & factory_set,
+ TAO_PG_ObjectGroupManager & group_manager,
+ const PortableServer::ObjectId & oid);
+
+ /// Destructor.
+ ~TAO_PG_Group_Guard (void);
+
+ /// Relinquish cleanup responsibility.
+ void release (void);
+
+private:
+
+ /// Reference to the infrastructure TAO_PG_GenericFactory that
+ /// created the below TAO_PG_Factory_Set.
+ TAO_PG_GenericFactory & generic_factory_;
+
+ /// Reference to the TAO_PG_Factory_Set that contains all
+ /// application-specific GenericFactory object references.
+ TAO_PG_Factory_Set & factory_set_;
+
+ /// Reference to the TAO_PG_ObjectGroupManager that maintains the
+ /// object group map.
+ TAO_PG_ObjectGroupManager & group_manager_;
+
+ /// Reference to the ObjectId that is the map key necessary to
+ /// unbind the corresponding object group map entry from the map
+ /// upon destruction.
+ const PortableServer::ObjectId & oid_;
+
+ /// Flag that dictates whether or not the destructor will perform
+ /// cleanup.
+ int released_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_GROUP_GUARD_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Equal_To.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Equal_To.cpp
new file mode 100644
index 00000000000..2fc8e11dadc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Equal_To.cpp
@@ -0,0 +1,11 @@
+// -*- C++ -*-
+
+#include "orbsvcs/PortableGroup/PG_Location_Equal_To.h"
+
+ACE_RCSID (PortableGroup,
+ PG_Location_Equal_To,
+ "$Id$")
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/PortableGroup/PG_Location_Equal_To.inl"
+#endif /* !__ACE_INLINE__ */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Equal_To.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Equal_To.h
new file mode 100644
index 00000000000..cbfc12a8949
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Equal_To.h
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Location_Equal_To.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PG_LOCATION_EQUAL_TO_H
+#define TAO_PG_LOCATION_EQUAL_TO_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/PortableGroup/PG_Operators.h"
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+#include "orbsvcs/PortableGroupC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_PG_Location_Equal_To
+ *
+ * @brief "Equal_To" function object that determines if two location
+ * names are the same.
+ *
+ * This functor simply does a string comparison of each of the
+ * elements in the given TAO_PortableGroup::Location name sequences.
+ */
+class TAO_PortableGroup_Export TAO_PG_Location_Equal_To
+{
+public:
+
+ /// Perform a string comparison on each of the sequence elements in
+ /// the given locations.
+ int operator() (const PortableGroup::Location &lhs,
+ const PortableGroup::Location &rhs) const;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/PortableGroup/PG_Location_Equal_To.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_LOCATION_EQUAL_TO_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Equal_To.inl b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Equal_To.inl
new file mode 100644
index 00000000000..052d968242b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Equal_To.inl
@@ -0,0 +1,15 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE int
+TAO_PG_Location_Equal_To::operator () (
+ const PortableGroup::Location &lhs,
+ const PortableGroup::Location &rhs) const
+{
+ return lhs == rhs;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Hash.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Hash.cpp
new file mode 100644
index 00000000000..0197726bfe8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Hash.cpp
@@ -0,0 +1,13 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "orbsvcs/PortableGroup/PG_Location_Hash.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/PortableGroup/PG_Location_Hash.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (PortableGroup,
+ PG_Location_Hash,
+ "$Id$")
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Hash.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Hash.h
new file mode 100644
index 00000000000..d59b5320ff0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Hash.h
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Location_Hash.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PG_LOCATION_HASH_H
+#define TAO_PG_LOCATION_HASH_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/PortableGroup/portablegroup_export.h"
+#include "orbsvcs/PortableGroupC.h"
+#include "ace/ACE.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_PG_Location_Hash
+ *
+ * @brief Hash function object for generating a hash for a Location.
+ */
+class TAO_PortableGroup_Export TAO_PG_Location_Hash
+{
+
+public:
+
+ /// Creates a hash based on all of elements of the given Location
+ CORBA::ULong operator() (const PortableGroup::Location &) const;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/PortableGroup/PG_Location_Hash.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_LOCATION_HASH_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Hash.inl b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Hash.inl
new file mode 100644
index 00000000000..a0b591b1068
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Hash.inl
@@ -0,0 +1,25 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE CORBA::ULong
+TAO_PG_Location_Hash::operator() (
+ const PortableGroup::Location &location) const
+{
+ // @todo Interim implementation until we figure out what to do when a
+ // location has multiple components.
+
+ CORBA::ULong len = location.length ();
+ CORBA::ULong hash = 0;
+
+ for (CORBA::ULong i = 0; i < len; ++i)
+ hash +=
+ ACE::hash_pjw (location[i].id.in ()) +
+ ACE::hash_pjw (location[i].kind.in ());
+
+ return hash;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Map.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Map.h
new file mode 100644
index 00000000000..e0eb6dbf756
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Location_Map.h
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+
+//=======================================================================
+/**
+ * @file PG_Location_Map.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=======================================================================
+
+
+#ifndef TAO_PG_LOCATION_MAP_H
+#define TAO_PG_LOCATION_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 "orbsvcs/PortableGroup/PG_Location_Hash.h"
+#include "orbsvcs/PortableGroup/PG_Location_Equal_To.h"
+
+#include "orbsvcs/PortableGroupC.h"
+
+#include "ace/Array_Base.h"
+#include "ace/Hash_Map_Manager_T.h"
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Forward declarations.
+struct TAO_PG_ObjectGroup_Map_Entry;
+
+typedef ACE_Array_Base<TAO_PG_ObjectGroup_Map_Entry *>
+ TAO_PG_ObjectGroup_Array;
+
+/// Location hash map.
+typedef ACE_Hash_Map_Manager_Ex<
+ PortableGroup::Location,
+ TAO_PG_ObjectGroup_Array *,
+ TAO_PG_Location_Hash,
+ TAO_PG_Location_Equal_To,
+ ACE_Null_Mutex> TAO_PG_Location_Map;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_LOCATION_MAP_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_MemberInfo.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_MemberInfo.cpp
new file mode 100644
index 00000000000..1485e8277d9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_MemberInfo.cpp
@@ -0,0 +1,18 @@
+#include "orbsvcs/PortableGroup/PG_MemberInfo.h"
+#include "orbsvcs/PortableGroup/PG_Operators.h"
+
+ACE_RCSID (PortableGroup,
+ PG_MemberInfo,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+bool
+TAO_PG_MemberInfo::operator== (const TAO_PG_MemberInfo & rhs)
+{
+ // For the purposes of the member info set, only the location is
+ // important.
+ return location == rhs.location;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_MemberInfo.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_MemberInfo.h
new file mode 100644
index 00000000000..41d428bd0bb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_MemberInfo.h
@@ -0,0 +1,62 @@
+// -*- C++ -*-
+
+//=======================================================================
+/**
+ * @file PG_MemberInfo.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=======================================================================
+
+
+#ifndef TAO_PG_MEMBER_INFO_H
+#define TAO_PG_MEMBER_INFO_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/Unbounded_Set.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_PG_MemberInfo
+ *
+ * @brief Structure that contains all member-specific information.
+ *
+ * Structure that contains all member-specific information.
+ */
+struct TAO_PG_MemberInfo
+{
+
+ /// Reference to the member.
+ CORBA::Object_var member;
+
+ /// The location at which the member resides.
+ PortableGroup::Location location;
+
+ /// Equality operator.
+ /**
+ * For the purposes of the member info set, only the location is
+ * important. In particular, if a member already resides at the
+ * given location, this equality operator will return true.
+ */
+ bool operator== (const TAO_PG_MemberInfo & rhs);
+
+};
+
+typedef ACE_Unbounded_Set<TAO_PG_MemberInfo> TAO_PG_MemberInfo_Set;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_MEMBER_INFO_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Null_Property_Validator.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Null_Property_Validator.cpp
new file mode 100644
index 00000000000..5251b3d7931
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Null_Property_Validator.cpp
@@ -0,0 +1,30 @@
+#include "orbsvcs/PortableGroup/PG_Null_Property_Validator.h"
+
+
+ACE_RCSID (PortableGroup,
+ PG_Null_Property_Validator,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void
+TAO_PG_Null_Property_Validator::validate_property (
+ const PortableGroup::Properties &
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+}
+
+void
+TAO_PG_Null_Property_Validator::validate_criteria (
+ const PortableGroup::Properties &
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::CannotMeetCriteria))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Null_Property_Validator.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Null_Property_Validator.h
new file mode 100644
index 00000000000..41047a90c99
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Null_Property_Validator.h
@@ -0,0 +1,67 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Null_Property_Validator.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_PG_NULL_PROPERTY_VALIDATOR_H
+#define TAO_PG_NULL_PROPERTY_VALIDATOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+#include "orbsvcs/PortableGroupC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_PG_Null_Property_Validator
+ *
+ * @brief No-op property validator.
+ *
+ * This property validator performs no validation whatsoever.
+ */
+class TAO_PortableGroup_Export TAO_PG_Null_Property_Validator
+{
+public:
+
+ /// Validate the given properties.
+ /**
+ * This particular implementation performs no validation
+ * whatsoever.
+ */
+ void validate_property (const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /// Validate the given criteria.
+ /**
+ * This particular implementation performs no validation
+ * whatsoever.
+ */
+ void validate_criteria (const PortableGroup::Properties & criteria
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::CannotMeetCriteria));
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_PROPERTY_VALIDATOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroupManager.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroupManager.cpp
new file mode 100644
index 00000000000..7b78ef895bc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroupManager.cpp
@@ -0,0 +1,871 @@
+#include "orbsvcs/PortableGroup/PG_ObjectGroupManager.h"
+#include "orbsvcs/PortableGroup/PG_GenericFactory.h"
+#include "orbsvcs/PortableGroup/PG_conf.h"
+#include "orbsvcs/PortableGroup/PG_Operators.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+
+#include "ace/Auto_Ptr.h"
+#include "ace/Reverse_Lock_T.h"
+
+ACE_RCSID (PortableGroup,
+ PG_ObjectGroupManager,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_PG_ObjectGroupManager::TAO_PG_ObjectGroupManager (void)
+ : poa_ (),
+ object_group_map_ (TAO_PG_MAX_OBJECT_GROUPS),
+ location_map_ (TAO_PG_MAX_LOCATIONS),
+ generic_factory_ (0),
+ lock_ ()
+{
+}
+
+TAO_PG_ObjectGroupManager::~TAO_PG_ObjectGroupManager (void)
+{
+ for (TAO_PG_Location_Map::iterator i = this->location_map_.begin ();
+ i != this->location_map_.end ();
+ ++i)
+ {
+ // Destroy the group array
+ delete (*i).int_id_;
+ }
+ (void) this->location_map_.close ();
+
+ for (TAO_PG_ObjectGroup_Map::iterator j = this->object_group_map_.begin ();
+ j != this->object_group_map_.end ();
+ ++j)
+ {
+ // Destroy the object group entry
+ delete (*j).int_id_;
+ }
+ (void) this->object_group_map_.close ();
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_PG_ObjectGroupManager::create_member (
+ PortableGroup::ObjectGroup_ptr /* object_group */,
+ const PortableGroup::Location & /* the_location */,
+ const char * /* type_id */,
+ const PortableGroup::Criteria & /* the_criteria */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::NoFactory,
+ PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::CannotMeetCriteria))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
+ PortableGroup::ObjectGroup::_nil ());
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_PG_ObjectGroupManager::add_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ CORBA::Object_ptr member
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::ObjectNotAdded))
+{
+ if (CORBA::is_nil (member))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ PortableGroup::ObjectGroup::_nil ());
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ PortableGroup::ObjectGroup::_nil ());
+
+ // Verify that the member's RepositoryId matches the object group's
+ // type ID.
+ const CORBA::Boolean check_type_id = 1;
+
+ return this->add_member_i (object_group,
+ the_location,
+ member,
+ check_type_id
+ ACE_ENV_ARG_PARAMETER);
+
+}
+
+
+PortableGroup::ObjectGroup_ptr
+TAO_PG_ObjectGroupManager::_tao_add_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ CORBA::Object_ptr member,
+ const char * type_id,
+ const CORBA::Boolean propagate_member_already_present
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::NoFactory))
+{
+ if (CORBA::is_nil (member))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ PortableGroup::ObjectGroup::_nil ());
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ PortableGroup::ObjectGroup::_nil ());
+
+ PortableGroup::ObjectGroup_var new_group;
+
+ ACE_TRY
+ {
+ // TypeId already checked by GenericFactory.
+ const CORBA::Boolean check_type_id = 0;
+
+ new_group = this->add_member_i (object_group,
+ the_location,
+ member,
+ check_type_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (PortableGroup::ObjectGroupNotFound, ex)
+ {
+ ACE_TRY_THROW (CORBA::INTERNAL ());
+ }
+ ACE_CATCH (PortableGroup::MemberAlreadyPresent, ex)
+ {
+ if (propagate_member_already_present)
+ ACE_RE_THROW;
+ else
+ ACE_TRY_THROW (CORBA::INTERNAL ());
+ }
+ ACE_CATCH (PortableGroup::ObjectNotAdded, ex)
+ {
+ ACE_TRY_THROW (PortableGroup::NoFactory (the_location,
+ type_id));
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (PortableGroup::ObjectGroup::_nil ());
+
+ return new_group._retn ();
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_PG_ObjectGroupManager::add_member_i (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ CORBA::Object_ptr member,
+ const CORBA::Boolean check_type_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::ObjectNotAdded))
+{
+ TAO_PG_ObjectGroup_Map_Entry * group_entry =
+ this->get_group_entry (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableGroup::ObjectGroup::_nil ());
+
+ if (check_type_id)
+ {
+ CORBA::Boolean right_type_id =
+ this->valid_type_id (object_group,
+ group_entry,
+ member
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableGroup::ObjectGroup::_nil ());
+
+ if (!right_type_id)
+ {
+ // The member's type_id does not match the object group's
+ // type_id.
+ ACE_THROW_RETURN (PortableGroup::ObjectNotAdded (),
+ PortableGroup::ObjectGroup::_nil ());
+ }
+ }
+
+ TAO_PG_ObjectGroup_Array * groups = 0;
+ if (this->location_map_.find (the_location, groups) == 0
+ && this->member_already_present (*groups, group_entry))
+ ACE_THROW_RETURN (PortableGroup::MemberAlreadyPresent (),
+ PortableGroup::ObjectGroup::_nil ());
+
+ TAO_PG_MemberInfo member_info;
+ member_info.member = CORBA::Object::_duplicate (member);
+ member_info.location = the_location;
+
+ if (groups == 0)
+ {
+ ACE_NEW_THROW_EX (groups,
+ TAO_PG_ObjectGroup_Array,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ auto_ptr<TAO_PG_ObjectGroup_Array> safe_groups (groups);
+
+ // This should not fail!
+ if (this->location_map_.bind (the_location, groups) != 0)
+ {
+ ACE_THROW_RETURN (PortableGroup::ObjectNotAdded (),
+ PortableGroup::ObjectGroup::_nil ());
+ }
+
+ (void) safe_groups.release ();
+ }
+
+ // No object group member of the object group with the given
+ // ObjectGroupId resides at the location. Add the object group
+ // entry to array of object groups residing at the location.
+ const size_t groups_len = groups->size ();
+ groups->size (groups_len + 1);
+ (*groups)[groups_len] = group_entry;
+
+ // Don't bother checking for duplicates since a check is already
+ // performed when binding to the location map above.
+ if (group_entry->member_infos.insert_tail (member_info) != 0)
+ ACE_THROW_RETURN (PortableGroup::ObjectNotAdded (),
+ PortableGroup::ObjectGroup::_nil ());
+
+ return PortableGroup::ObjectGroup::_duplicate (object_group);
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_PG_ObjectGroupManager::remove_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound))
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->lock_, 0);
+
+ TAO_PG_ObjectGroup_Map_Entry * group_entry =
+ this->get_group_entry (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableGroup::ObjectGroup::_nil ());
+
+ TAO_PG_ObjectGroup_Array * groups = 0;
+ if (this->location_map_.find (the_location, groups) != 0)
+ ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (),
+ PortableGroup::ObjectGroup::_nil ());
+
+ // Multiple members from different object groups may reside at the
+ // same location. Iterate through the list to attempt to find a
+ // match for the exact object group.
+ size_t to_be_removed = 0;
+
+ // get the position of the object group in the object_group_array
+ to_be_removed = this->get_object_group_position (*groups, group_entry);
+
+ // remove the element from the array and resize the array.
+ const size_t groups_len = groups->size ();
+ size_t j;
+ for (size_t i = to_be_removed; i < groups_len - 1; ++i)
+ {
+ j = i + 1;
+ (*groups)[i] = (*groups)[j];
+ }
+
+ groups->size (groups_len - 1);
+
+ TAO_PG_MemberInfo_Set & member_infos = group_entry->member_infos;
+
+ TAO_PG_MemberInfo_Set::iterator end = member_infos.end ();
+
+ for (TAO_PG_MemberInfo_Set::iterator iter = member_infos.begin ();
+ iter != end;
+ ++iter)
+ {
+ const TAO_PG_MemberInfo & info = *iter;
+
+ if (info.location == the_location)
+ {
+ // Give the GenericFactory a chance to delete a member if
+ // its membership is under infrastructure control.
+ if (this->generic_factory_)
+ {
+ this->generic_factory_->delete_member (group_entry->group_id,
+ the_location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableGroup::ObjectGroup::_nil ());
+ }
+
+ if (member_infos.remove (info) == 0)
+ {
+ if (this->generic_factory_)
+ {
+ this->generic_factory_->check_minimum_number_members (
+ object_group,
+ group_entry->group_id,
+ group_entry->type_id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableGroup::ObjectGroup::_nil ());
+ }
+
+ return PortableGroup::ObjectGroup::_duplicate (object_group);
+ }
+ else
+ break;
+ }
+ }
+
+ ACE_THROW_RETURN (PortableGroup::MemberNotFound (),
+ PortableGroup::ObjectGroup::_nil ());
+}
+
+PortableGroup::Locations *
+TAO_PG_ObjectGroupManager::locations_of_members (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->lock_, 0);
+
+ TAO_PG_ObjectGroup_Map_Entry * group_entry =
+ this->get_group_entry (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ PortableGroup::Locations *temp = 0;
+ ACE_NEW_THROW_EX (temp,
+ PortableGroup::Locations,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ PortableGroup::Locations_var locations = temp;
+
+ TAO_PG_MemberInfo_Set & member_infos = group_entry->member_infos;
+
+ locations->length (static_cast<CORBA::ULong> (member_infos.size ()));
+
+ CORBA::ULong loc = 0;
+ TAO_PG_MemberInfo_Set::iterator end = member_infos.end ();
+
+ for (TAO_PG_MemberInfo_Set::iterator i = member_infos.begin ();
+ i != end;
+ ++i)
+ locations[loc++] = (*i).location;
+
+ return locations._retn ();
+}
+
+PortableGroup::ObjectGroups *
+TAO_PG_ObjectGroupManager::groups_at_location (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableGroup::ObjectGroups * ogs;
+ ACE_NEW_THROW_EX (ogs,
+ PortableGroup::ObjectGroups,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ PortableGroup::ObjectGroups_var object_groups = ogs;
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->lock_, 0);
+
+ TAO_PG_ObjectGroup_Array * groups;
+ if (this->location_map_.find (the_location, groups) == 0)
+ {
+ CORBA::ULong len = static_cast<CORBA::ULong> (groups->size ());
+
+ ogs->length (len);
+
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ object_groups[i] =
+ PortableGroup::ObjectGroup::_duplicate (
+ (*groups)[i]->object_group.in ());
+ }
+ }
+
+ return object_groups._retn ();
+}
+
+PortableGroup::ObjectGroupId
+TAO_PG_ObjectGroupManager::get_object_group_id (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ 0);
+
+ TAO_PG_ObjectGroup_Map_Entry * entry =
+ this->get_group_entry (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (entry == 0)
+ ACE_THROW_RETURN (CORBA::INTERNAL (), 0);
+
+ // Only the lower 32 bits of the 64 bit PortableGroup::ObjectGroupId
+ // are ever used.
+ return entry->group_id;
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_PG_ObjectGroupManager::get_object_group_ref (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+ TAO_PG_ObjectGroup_Map_Entry * entry = 0;
+
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ PortableGroup::ObjectGroup::_nil ());
+
+
+ entry = this->get_group_entry (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableGroup::ObjectGroup::_nil ());
+ }
+
+ if (entry == 0)
+ ACE_THROW_RETURN (CORBA::INTERNAL (),
+ PortableGroup::ObjectGroup::_nil ());
+
+ // This implemenation does not change the object group reference.
+ return PortableGroup::ObjectGroup::_duplicate (object_group);
+}
+
+CORBA::Object_ptr
+TAO_PG_ObjectGroupManager::get_member_ref (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & loc
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound))
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ CORBA::Object::_nil ());
+
+ TAO_PG_ObjectGroup_Map_Entry * group_entry =
+ this->get_group_entry (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableGroup::ObjectGroup::_nil ());
+
+ // This method assumes that it is faster to check for non-existence
+ // of an object group (and hence the member) at a given location,
+ // instead of existence of a member at a given location.
+
+ TAO_PG_ObjectGroup_Array * groups = 0;
+ if (this->location_map_.find (loc, groups) == 0
+ && this->member_already_present (*groups, group_entry))
+ {
+ TAO_PG_MemberInfo_Set & member_infos = group_entry->member_infos;
+
+ TAO_PG_MemberInfo_Set::iterator end = member_infos.end ();
+
+ // @todo If the object group contains a large number of members,
+ // this loop could take a while. Explore potentially
+ // faster containers for the list of PG_MemberInfos in the
+ // future.
+ for (TAO_PG_MemberInfo_Set::iterator i = member_infos.begin ();
+ i != end;
+ ++i)
+ if ((*i).location == loc)
+ return CORBA::Object::_duplicate ((*i).member.in ());
+ }
+
+ // No member of the given object group is present at the given
+ // location.
+ ACE_THROW_RETURN (PortableGroup::MemberNotFound (),
+ CORBA::Object::_nil ());
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_PG_ObjectGroupManager::get_object_group_ref_from_id (
+ PortableGroup::ObjectGroupId group_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::ObjectGroupNotFound
+ ))
+{
+ //@@ If we change the PG's concept of ObjectGroupId from
+ // PortableServer::ObjectId to PortableGroup::ObjectGroupId, can
+ // just call TAO_PG_ObjectGroupManager::object_group() here.
+
+ TAO_PG_ObjectGroup_Map_Entry * group_entry = 0;
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ PortableGroup::ObjectGroup::_nil ());
+
+ if (this->object_group_map_.find (ACE_U64_TO_U32 (group_id),
+ group_entry)
+ != 0)
+ {
+ ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (),
+ PortableGroup::ObjectGroup::_nil ());
+ }
+ }
+
+ if (group_entry == 0)
+ {
+ ACE_THROW_RETURN (CORBA::INTERNAL (),
+ PortableGroup::ObjectGroup::_nil ());
+ }
+
+ return
+ PortableGroup::ObjectGroup::_duplicate (group_entry->object_group.in ());
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_PG_ObjectGroupManager::create_object_group (
+ CORBA::ULong group_id,
+ const PortableServer::ObjectId &oid,
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria
+ ACE_ENV_ARG_DECL)
+{
+ if (CORBA::is_nil (this->poa_.in ()))
+ ACE_THROW_RETURN (CORBA::INTERNAL (), CORBA::Object::_nil ());
+
+ // Create a reference for the ObjectGroup corresponding to the
+ // RepositoryId of the object being created.
+ CORBA::Object_var object_group =
+ this->poa_->create_reference_with_id (oid,
+ type_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ TAO_PG_ObjectGroup_Map_Entry * group_entry = 0;
+ ACE_NEW_THROW_EX (group_entry,
+ TAO_PG_ObjectGroup_Map_Entry,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ auto_ptr<TAO_PG_ObjectGroup_Map_Entry> safe_group_entry (group_entry);
+
+ // Set the RepositoryId associated with the created ObjectGroup_Map
+ // entry.
+ group_entry->type_id = CORBA::string_dup (type_id);
+
+ group_entry->group_id = group_id;
+
+ group_entry->object_group = object_group;
+
+ CORBA::ULong len = the_criteria.length ();
+ group_entry->properties.length (len);
+ for (CORBA::ULong i = 0; i < len; ++i)
+ group_entry->properties[i] = the_criteria[i];
+
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ 0);
+
+ if (this->object_group_map_.bind (oid, group_entry) != 0)
+ ACE_THROW_RETURN (PortableGroup::ObjectNotCreated (),
+ PortableGroup::ObjectGroup::_nil ());
+ }
+
+ (void) safe_group_entry.release ();
+
+ return object_group._retn ();
+}
+
+void
+TAO_PG_ObjectGroupManager::destroy_object_group (
+ const PortableServer::ObjectId & oid
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_);
+
+ TAO_PG_ObjectGroup_Map_Entry * group_entry = 0;
+ if (this->object_group_map_.unbind (oid, group_entry) != 0)
+ ACE_THROW (PortableGroup::ObjectNotFound ());
+
+ delete group_entry;
+}
+
+char *
+TAO_PG_ObjectGroupManager::type_id (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ 0);
+
+ TAO_PG_ObjectGroup_Map_Entry * group_entry =
+ this->get_group_entry (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return CORBA::string_dup (group_entry->type_id.in ());
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_PG_ObjectGroupManager::object_group (const PortableServer::ObjectId & oid)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ PortableGroup::ObjectGroup::_nil ());
+
+ TAO_PG_ObjectGroup_Map_Entry * group_entry = 0;
+ if (this->object_group_map_.find (oid, group_entry) == 0)
+ return
+ PortableGroup::ObjectGroup::_duplicate (group_entry->object_group.in ());
+ else
+ return PortableGroup::ObjectGroup::_nil ();
+}
+
+CORBA::ULong
+TAO_PG_ObjectGroupManager::member_count (
+ PortableGroup::ObjectGroup_ptr group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+// ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+// guard,
+// this->lock_,
+// 0);
+
+ TAO_PG_ObjectGroup_Map_Entry * group_entry =
+ this->get_group_entry (group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return static_cast<CORBA::ULong> (group_entry->member_infos.size ());
+}
+
+void
+TAO_PG_ObjectGroupManager::poa (PortableServer::POA_ptr p)
+{
+ this->poa_ = PortableServer::POA::_duplicate (p);
+}
+
+
+PortableGroup::Properties *
+TAO_PG_ObjectGroupManager::get_properties (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+ PortableGroup::Properties * properties = 0;
+ ACE_NEW_THROW_EX (properties,
+ PortableGroup::Properties,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ PortableGroup::Properties_var safe_properties = properties;
+
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ 0);
+
+ TAO_PG_ObjectGroup_Map_Entry * group_entry =
+ this->get_group_entry (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ *properties = group_entry->properties;
+ }
+
+ return safe_properties._retn ();
+}
+
+TAO_PG_ObjectGroup_Map_Entry *
+TAO_PG_ObjectGroupManager::get_group_entry (
+ CORBA::Object_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+ if (CORBA::is_nil (this->poa_.in ()))
+ ACE_THROW_RETURN (CORBA::INTERNAL (), 0);
+
+ PortableServer::ObjectId_var oid;
+ ACE_TRY
+ {
+ oid = this->poa_->reference_to_id (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (PortableServer::POA::WrongAdapter, ex)
+ {
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ex, "TAO_PG (%P|%t) Unexpected exception\n");
+
+ ACE_TRY_THROW (CORBA::INTERNAL ());
+ }
+ ACE_CATCH (PortableServer::POA::WrongPolicy, ex)
+ {
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ex, "TAO_PG (%P|%t) Unexpected exception\n");
+
+ ACE_TRY_THROW (CORBA::INTERNAL ());
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ TAO_PG_ObjectGroup_Map_Entry * group_entry = 0;
+ if (this->object_group_map_.find (oid.in (), group_entry) != 0)
+ ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (),
+ 0);
+
+ return group_entry;
+}
+
+CORBA::Boolean
+TAO_PG_ObjectGroupManager::member_already_present (
+ const TAO_PG_ObjectGroup_Array &groups,
+ TAO_PG_ObjectGroup_Map_Entry * group_entry)
+{
+ // Multiple members from different object groups may reside at the
+ // same location. Iterate through the list to attempt to find a
+ // match.
+ size_t len = groups.size ();
+ for (size_t i = 0; i < len; ++i)
+ {
+ // It should be enough just to compare the group_entry pointers,
+ // but that seems brittle. Better to check a controlled value,
+ // like the ObjectGroupId.
+ if (groups[i]->group_id == group_entry->group_id)
+ {
+ // Member with given type ID exists at the given
+ // location.
+ return 1;
+ }
+ }
+
+ // No member with given type ID present at the given location.
+ return 0;
+}
+
+size_t
+TAO_PG_ObjectGroupManager::get_object_group_position (
+ const TAO_PG_ObjectGroup_Array &groups,
+ TAO_PG_ObjectGroup_Map_Entry * group_entry)
+{
+ // Multiple members from different object groups may reside at the
+ // same location. Iterate through the list to attempt to find a
+ // match.
+ size_t len = groups.size ();
+ for (size_t i = 0; i < len; ++i)
+ {
+ // It should be enough just to compare the group_entry pointers,
+ // but that seems brittle. Better to check a controlled value,
+ // like the ObjectGroupId.
+ if (groups[i]->group_id == group_entry->group_id)
+ {
+ // Member with given type ID exists at the given
+ // location.
+ return i;
+ }
+ }
+
+ // No member with given type ID present at the given location.
+ return 0;
+}
+
+CORBA::Boolean
+TAO_PG_ObjectGroupManager::valid_type_id (
+ PortableGroup::ObjectGroup_ptr object_group,
+ TAO_PG_ObjectGroup_Map_Entry * group_entry,
+ CORBA::Object_ptr member
+ ACE_ENV_ARG_DECL)
+{
+ // @todo Strategize this -- e.g. strict type checking.
+
+ if (CORBA::is_nil (member))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), false);
+
+ // Before we can use this code, i.e. the reverse lock, the
+ // TAO_PG_ObjectGroup_Entry should be made so that it is reference
+ // counted. This is necessary since releasing the lock would
+ // allow other threads to destroy/unbind the object group entry.
+ // Another alternative is to simply attempt to reacquire the
+ // object group map entry once the lock is reacquired, which is
+ // easier to implement.
+
+ // Copy the type_id before releasing the lock to avoid a race
+ // condition.
+ CORBA::String_var type_id =
+ CORBA::string_dup (group_entry->type_id.in ());
+
+ CORBA::Boolean right_type_id = 0;
+ {
+ // Release the lock during the type_id check. No need to block
+ // other threads during the invocation.
+ ACE_Reverse_Lock<TAO_SYNCH_MUTEX> reverse_lock (this->lock_);
+
+ ACE_GUARD_RETURN (ACE_Reverse_Lock<TAO_SYNCH_MUTEX>,
+ reverse_guard,
+ reverse_lock,
+ right_type_id);
+
+ // Make sure an Object of the correct type was created. It is
+ // possible that an object of the wrong type was created if the
+ // type_id parameter does not match the type of object the
+ // GenericFactory creates.
+ right_type_id =
+ member->_is_a (type_id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (right_type_id);
+ }
+
+ // Make sure the group entry still exists. It may have been
+ // destroyed by another thread.
+ group_entry = this->get_group_entry (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (right_type_id);
+
+ return right_type_id;
+}
+
+void
+TAO_PG_ObjectGroupManager::generic_factory (
+ TAO_PG_GenericFactory * generic_factory)
+{
+ this->generic_factory_ = generic_factory;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroupManager.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroupManager.h
new file mode 100644
index 00000000000..b78cc4028f3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroupManager.h
@@ -0,0 +1,314 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_ObjectGroupManager.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PG_OBJECT_GROUP_MANAGER_H
+#define TAO_PG_OBJECT_GROUP_MANAGER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+#include "orbsvcs/PortableGroupS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroup/PG_ObjectGroup_Map.h"
+#include "orbsvcs/PortableGroup/PG_Location_Map.h"
+
+#include "tao/PortableServer/Key_Adapters.h"
+#include "tao/PortableServer/PortableServerC.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Forward declarations
+class TAO_PG_GenericFactory;
+
+
+/**
+ * @class TAO_PG_ObjectGroupManager
+ *
+ * @brief PortableGroup::ObjectGroupManager implementation.
+ *
+ * The ObjectGroupManager provides the interface necessary to
+ * facilitate application-controlled object group membership.
+ */
+class TAO_PortableGroup_Export TAO_PG_ObjectGroupManager
+ : public virtual POA_PortableGroup::ObjectGroupManager
+{
+public:
+
+ /// Constructor.
+ TAO_PG_ObjectGroupManager (void);
+
+ /// Destructor.
+ ~TAO_PG_ObjectGroupManager (void);
+
+ /**
+ * @name PortableGroup::ObjectGroupManager methods
+ *
+ * Methods required by the PortableGroup::ObjectGroupManager
+ * interface.
+ */
+ //@{
+
+ /// Create a member and add it to the given object group.
+ virtual PortableGroup::ObjectGroup_ptr create_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::NoFactory,
+ PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::CannotMeetCriteria));
+
+ /// Add an existing object to the ObjectGroup.
+ virtual PortableGroup::ObjectGroup_ptr add_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ CORBA::Object_ptr member
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::ObjectNotAdded));
+
+ /**
+ * Remove an object at a specific location from the given
+ * ObjectGroup. Deletion of application created objects must be
+ * deleted by the application. Objects created by the
+ * infrastructure (load balancer) will be deleted by the
+ * infrastructure.
+ */
+ virtual PortableGroup::ObjectGroup_ptr remove_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound));
+
+ /// Return the locations of the members in the given ObjectGroup.
+ virtual PortableGroup::Locations * locations_of_members (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+ /// Return the locations of the members in the given ObjectGroup.
+ virtual PortableGroup::ObjectGroups * groups_at_location (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the ObjectGroupId for the given ObjectGroup.
+ /// @note Does this method make sense for load balanced objects?
+ virtual PortableGroup::ObjectGroupId get_object_group_id (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+ /// @note Does this method make sense for load balanced objects?
+ virtual PortableGroup::ObjectGroup_ptr get_object_group_ref (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+ /// Return the reference corresponding to the member of a given
+ /// ObjectGroup at the given location.
+ virtual CORBA::Object_ptr get_member_ref (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & loc
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberNotFound));
+ /**
+ * TAO-specific extension.
+ * Return the ObjectGroup reference for the given ObjectGroupId.
+ */
+ virtual PortableGroup::ObjectGroup_ptr get_object_group_ref_from_id (
+ PortableGroup::ObjectGroupId group_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::ObjectGroupNotFound
+ ));
+
+ //@}
+
+ /// TAO-specific member addition method.
+ /**
+ * This method is meant to be invoked by TAO's GenericFactory
+ * implementation. It is designed to allow only certain exceptions
+ * to be propagated to the caller, and to prevent redundant remote
+ * RepositoryId checking.
+ */
+ PortableGroup::ObjectGroup_ptr _tao_add_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ CORBA::Object_ptr member,
+ const char * type_id,
+ const CORBA::Boolean propagate_member_already_present
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::NoFactory));
+
+ /// Create object group hash map entry that represents an actual
+ /// ObjectGroup.
+ /**
+ * @note This method is used mainly by the
+ * GenericFactory::create_object() method.
+ */
+ PortableGroup::ObjectGroup_ptr create_object_group (
+ CORBA::ULong group_id,
+ const PortableServer::ObjectId &oid,
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria
+ ACE_ENV_ARG_DECL);
+
+ /// Destroy the object group corresponding to the given ObjectId.
+ /**
+ * @note This method is used mainly by the
+ * GenericFactory::delete_object() method.
+ */
+ void destroy_object_group (const PortableServer::ObjectId & oid
+ ACE_ENV_ARG_DECL);
+
+ /// Return the properties set when the object group was created, and
+ /// the dynamic properties that may have overridden them.
+ PortableGroup::Properties * get_properties (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+ /// Return the type_id for the given object group.
+ char * type_id (PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL);
+
+ /// Return the object group associated with the given ObjectId.
+ /**
+ * @return Returns PortableGroup::ObjectGroup::_nil() if no object
+ * group corresponding to the given ObjectId exists.
+ */
+ PortableGroup::ObjectGroup_ptr object_group (
+ const PortableServer::ObjectId & oid);
+
+ /// Return the number of members in the given object group.
+ CORBA::ULong member_count (PortableGroup::ObjectGroup_ptr group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+ /// Set the POA to use when converting object group references to
+ /// ObjectIds.
+ void poa (PortableServer::POA_ptr p);
+
+ /// Set the pointer to the GenericFactory associated with this
+ /// ObjectGroupManager.
+ /**
+ * The TAO_PG_GenericFactory will only be used when
+ * ObjectGroupManager::remove_member() is explicitly called so that
+ * the infrastructure may be given an opportunity to clean up any
+ * object group members it may have created.
+ */
+ void generic_factory (TAO_PG_GenericFactory * generic_factory);
+
+protected:
+
+ /// Underlying and non-locking implementation of the add_member()
+ /// and _tao_add_member() methods in this class.
+ PortableGroup::ObjectGroup_ptr add_member_i (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ CORBA::Object_ptr member,
+ const CORBA::Boolean check_type_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::ObjectNotAdded));
+
+ /// Obtain the ObjectGroup hash map entry corresponding to the given
+ /// ObjectGroup reference.
+ TAO_PG_ObjectGroup_Map_Entry * get_group_entry (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+
+ /// Check if a member resides at the location to which the group
+ /// array belongs to.
+ /**
+ * A member is actually represented by the object group to which it
+ * belongs. In this implementation, a pointer to a object group
+ * hash map entry is associated with a given a location.
+ */
+ CORBA::Boolean member_already_present (
+ const TAO_PG_ObjectGroup_Array & groups,
+ TAO_PG_ObjectGroup_Map_Entry * group_entry);
+
+ /// get the position of the object_group_map_entry
+ size_t get_object_group_position (
+ const TAO_PG_ObjectGroup_Array & groups,
+ TAO_PG_ObjectGroup_Map_Entry * group_entry);
+
+ /// Verify that the member type_id matches the object group type_id.
+ /**
+ * @todo Strategize this -- e.g. strict type checking.
+ */
+ CORBA::Boolean valid_type_id (
+ PortableGroup::ObjectGroup_ptr object_group,
+ TAO_PG_ObjectGroup_Map_Entry * group_entry,
+ CORBA::Object_ptr member
+ ACE_ENV_ARG_DECL);
+
+private:
+
+ /// Reference to the POA that created the object group references.
+ PortableServer::POA_var poa_;
+
+ /// The underlying table that contains all object group
+ /// information.
+ TAO_PG_ObjectGroup_Map object_group_map_;
+
+ /// Map that contains list of all members at a given location, in
+ /// addition to the load monitor at that location.
+ TAO_PG_Location_Map location_map_;
+
+ /// Pointer to the TAO_PG_GenericFactory class responsible for
+ /// object group creation/destruction.
+ TAO_PG_GenericFactory * generic_factory_;
+
+ /// Lock used to synchronize access to the underlying tables.
+ TAO_SYNCH_MUTEX lock_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_OBJECT_GROUP_MANAGER_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroup_Map.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroup_Map.h
new file mode 100644
index 00000000000..4673a79df0f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroup_Map.h
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+
+//=======================================================================
+/**
+ * @file PG_ObjectGroup_Map.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=======================================================================
+
+
+#ifndef TAO_PG_OBJECTGROUP_MAP_H
+#define TAO_PG_OBJECTGROUP_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 "orbsvcs/PortableGroup/PG_MemberInfo.h"
+
+#include "orbsvcs/PortableGroupC.h"
+
+#include "tao/PortableServer/Key_Adapters.h"
+#include "tao/PortableServer/PortableServerC.h"
+
+#include "ace/Hash_Map_Manager_T.h"
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_PG_ObjectGroup_Map_Entry
+ *
+ * @brief Value field of the ObjectGroup map.
+ */
+struct TAO_PG_ObjectGroup_Map_Entry
+{
+public:
+
+ /// The RepositoryId corresponding to all Members in the
+ /// ObjectGroup.
+ CORBA::String_var type_id;
+
+ /// This is the PortableGroup::ObjectGroupId.
+ /**
+ * The spec states that PortableGroup::ObjectGroupId is a
+ * CORBA::ULongLong. However, the over 4 billion group IDs that can
+ * be represented by a CORBA::ULong should be plenty for any
+ * application.
+ */
+ CORBA::ULong group_id;
+
+ /// Reference to the ObjectGroup.
+ PortableGroup::ObjectGroup_var object_group;
+
+ /// Unbounded set containing member references and all related
+ /// information for each member.
+ TAO_PG_MemberInfo_Set member_infos;
+
+ /// Properties used when creating this object group, in addition to
+ /// those set dynamically after the creation.
+ PortableGroup::Properties properties;
+
+};
+
+/// ObjectId hash map typedef.
+typedef ACE_Hash_Map_Manager_Ex<
+ PortableServer::ObjectId,
+ TAO_PG_ObjectGroup_Map_Entry *,
+ TAO_ObjectId_Hash,
+ ACE_Equal_To<PortableServer::ObjectId>,
+ ACE_Null_Mutex> TAO_PG_ObjectGroup_Map;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_OBJECTGROUP_MAP_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Adapter_Factory.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Adapter_Factory.cpp
new file mode 100644
index 00000000000..f8545615ad6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Adapter_Factory.cpp
@@ -0,0 +1,48 @@
+// $Id$
+
+#include "orbsvcs/PortableGroup/PG_Object_Adapter_Factory.h"
+#include "orbsvcs/PortableGroup/PG_Servant_Dispatcher.h"
+
+#include "tao/PortableServer/Object_Adapter.h"
+#include "tao/ORB_Core.h"
+
+ACE_RCSID (TAO_PortableGroup,
+ PG_Object_Adapter_Factory,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_PG_Object_Adapter_Factory::TAO_PG_Object_Adapter_Factory (void)
+{
+}
+
+TAO_Adapter*
+TAO_PG_Object_Adapter_Factory::create (TAO_ORB_Core *orb_core)
+{
+ TAO_Object_Adapter *object_adapter = 0;
+ ACE_NEW_RETURN (object_adapter,
+ TAO_Object_Adapter (orb_core->server_factory ()->
+ active_object_map_creation_parameters (),
+ *orb_core),
+ 0);
+
+ // Create and register the RT servant dispatcher.
+ TAO_PG_Servant_Dispatcher *rt_servant_dispatcher = 0;
+ ACE_NEW_RETURN (rt_servant_dispatcher,
+ TAO_PG_Servant_Dispatcher,
+ 0);
+ object_adapter->servant_dispatcher (rt_servant_dispatcher);
+
+
+ return object_adapter;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_FACTORY_DEFINE (TAO_PortableGroup, TAO_PG_Object_Adapter_Factory)
+ACE_STATIC_SVC_DEFINE (TAO_PG_Object_Adapter_Factory,
+ ACE_TEXT ("TAO_GOA"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_PG_Object_Adapter_Factory),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Adapter_Factory.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Adapter_Factory.h
new file mode 100644
index 00000000000..7edf4fe521e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Adapter_Factory.h
@@ -0,0 +1,47 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Object_Adapter_Factory.h
+ *
+ * $Id$
+ *
+ * @author Johnny Willemsen
+ */
+// ===================================================================
+
+#ifndef TAO_PG_OBJECT_ADAPTER_FACTORY_H
+#define TAO_PG_OBJECT_ADAPTER_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#include "tao/PortableServer/Object_Adapter_Factory.h"
+#include "tao/orbconf.h"
+
+#include "ace/Service_Config.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_PortableGroup_Export TAO_PG_Object_Adapter_Factory : public TAO_Object_Adapter_Factory
+{
+public:
+ /// Constructor
+ TAO_PG_Object_Adapter_Factory (void);
+
+ /// Create adapter.
+ virtual TAO_Adapter *create (TAO_ORB_Core *orb_core);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (TAO_PG_Object_Adapter_Factory)
+ACE_FACTORY_DECLARE (TAO_PortableGroup, TAO_PG_Object_Adapter_Factory)
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_OBJECT_ADAPTER_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp
new file mode 100644
index 00000000000..09d492e76a0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp
@@ -0,0 +1,896 @@
+// $Id$
+
+#include "orbsvcs/PortableGroup/PG_Object_Group.h"
+#include "orbsvcs/PortableGroup/PG_conf.h"
+
+#include "orbsvcs/PortableGroup/PG_Operators.h" // Borrow operator== on CosNaming::Name
+#include "orbsvcs/PortableGroup/PG_Utils.h"
+
+#include "tao/debug.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Vector_T.h"
+
+
+// Borland Developer Studio 2006 and earlier give a warning about comparing
+// signed and unsigned values in the minimum_polulate() and
+// initial_populate() warnings. The comparison uses a unsigned long and
+// unsigned short and it seems that the compiler promotes the unsigned
+// short of an int and this then gives the warning. Just for Borland
+// disabled the warning in this file.
+#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x582)
+# pragma option push -w-csu
+# pragma nopushoptwarn
+# pragma nopackwarning
+#endif /* __BORLANDC__ && __BORLANDC__ <= 0x582 */
+
+#define TODO int todo;
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::PG_Object_Group::MemberInfo::MemberInfo (
+ CORBA::Object_ptr member,
+ const PortableGroup::Location & location)
+ : member_ (CORBA::Object::_duplicate (member))
+ , factory_(PortableGroup::GenericFactory::_nil ())
+ , location_ (location)
+ , is_primary_ (0)
+{
+}
+
+TAO::PG_Object_Group::MemberInfo::MemberInfo (
+ CORBA::Object_ptr member,
+ const PortableGroup::Location & location,
+ PortableGroup::GenericFactory_ptr factory,
+ PortableGroup::GenericFactory::FactoryCreationId factory_id)
+ : member_ (CORBA::Object::_duplicate (member))
+ , factory_ (PortableGroup::GenericFactory::_duplicate (factory))
+ , factory_id_ (factory_id)
+ , location_ (location)
+ , is_primary_ (0)
+{
+}
+
+TAO::PG_Object_Group::MemberInfo::~MemberInfo (void)
+{
+ if( ! CORBA::is_nil (this->factory_.in()))
+ {
+ this->factory_->delete_object (this->factory_id_);
+ }
+}
+
+
+TAO::PG_Object_Group::PG_Object_Group (
+ CORBA::ORB_ptr orb,
+ PortableGroup::FactoryRegistry_ptr factory_registry,
+ TAO::PG_Object_Group_Manipulator & manipulator,
+ CORBA::Object_ptr empty_group,
+ const PortableGroup::TagGroupTaggedComponent & tagged_component,
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria,
+ TAO::PG_Property_Set * type_properties)
+ : internals_()
+ , orb_ (CORBA::ORB::_duplicate (orb))
+ , factory_registry_ (PortableGroup::FactoryRegistry::_duplicate (factory_registry))
+ , manipulator_ (manipulator)
+ , empty_ (1)
+ , role_ (type_id)
+ , type_id_ (CORBA::string_dup (type_id))
+ , tagged_component_ (tagged_component)
+ , reference_ (CORBA::Object::_duplicate(empty_group))
+ , members_ ()
+ , primary_location_(0)
+ , properties_ (the_criteria, type_properties)
+ , initial_number_members_ (0)
+ , minimum_number_members_ (0)
+ , group_specific_factories_ ()
+{
+}
+
+TAO::PG_Object_Group::~PG_Object_Group (void)
+{
+ for (MemberMap_Iterator it = this->members_.begin();
+ it != this->members_.end();
+ ++it)
+ {
+ MemberInfo * member = (*it).int_id_;
+ delete member;
+ }
+ this->members_.unbind_all ();
+}
+
+#if 0 // may want this again someday
+/////////////////////
+// q&d debug function
+static void
+dump_ior (const char * base,
+ const char * ext,
+ unsigned long version,
+ const char * iogr)
+{
+ char filename[1000];
+ ACE_OS::sprintf(filename, "%s_%lu.%s", base, version, ext );
+
+ FILE * iorfile = ACE_OS::fopen(filename, "w");
+ ACE_OS::fwrite (iogr, 1, ACE_OS::strlen(iogr), iorfile);
+ ACE_OS::fclose (iorfile);
+}
+#endif // may want this again someday
+
+PortableGroup::ObjectGroup_ptr
+TAO::PG_Object_Group::reference (void) const
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->internals_,
+ PortableGroup::ObjectGroup::_nil ());
+ return PortableGroup::ObjectGroup::_duplicate (this->reference_);
+}
+
+void
+TAO::PG_Object_Group::get_group_specific_factories (
+ PortableGroup::FactoryInfos & result) const
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
+
+ // copy is needed to have some semblance of thread safeness.
+ // if performance is an issue avoid this method.
+ result = this->group_specific_factories_;
+}
+
+const PortableGroup::Location &
+TAO::PG_Object_Group::get_primary_location (void) const
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->internals_,
+ this->primary_location_);
+ return this->primary_location_;
+}
+
+
+PortableGroup::ObjectGroup_ptr
+TAO::PG_Object_Group::add_member_to_iogr (CORBA::Object_ptr member
+ ACE_ENV_ARG_DECL)
+{
+ // assume internals is locked
+
+ PortableGroup::ObjectGroup_var result;
+
+ ////////////////////////////
+ // @@ HACK ALERT
+ // The PortableGroup::ObjectGroupManager creates an object reference
+ // containing a dummy entry so it will have a place to store the
+ // tagged group component. If this is the first entry, we need to
+ // remove that entry once we have a *real* member. This can be
+ // avoided when we get support for TAG_MULTIPLE_COMPONENTS. For
+ // now, we already have a copy of the tagGroupTagged component and
+ // we're going to use it below wen we increment the group version so
+ // we can clean out the dummy entry.
+ PortableGroup::ObjectGroup_var cleaned =
+ PortableGroup::ObjectGroup::_duplicate (this->reference_.in ());
+ if (this->empty_)
+ {
+ // remove the original profile. It's a dummy entry supplied by
+ // create_object.
+ cleaned =
+ this->manipulator_.remove_profiles (cleaned.in (),
+ this->reference_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableGroup::ObjectGroup::_nil());
+ this->empty_ = 0;
+ }
+
+ // create a list of references to be merged
+ TAO_IOP::TAO_IOR_Manipulation::IORList iors (2);
+ iors.length (2);
+ iors [0] = CORBA::Object::_duplicate (cleaned.in());
+ iors [1] = CORBA::Object::_duplicate (member);
+
+ // Now merge the list into one new IOGR
+ result =
+ this->manipulator_.merge_iors (iors ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (PortableGroup::ObjectGroup::_nil ());
+ return result._retn ();
+}
+
+void
+TAO::PG_Object_Group::add_member (const PortableGroup::Location & the_location,
+ CORBA::Object_ptr member
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectNotAdded))
+
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
+
+ /////////////////////////////////////////
+ // Convert the new member to a string IOR
+ // This keeps a clean IOR (not an IOGR!)
+ // while we add it to a group. We need a
+ // IORs, not IOGRs to send new IOGRs out
+ // to replicas.
+
+ CORBA::String_var member_ior_string =
+ orb_->object_to_string (member
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableGroup::ObjectGroup_var new_reference =
+ add_member_to_iogr (member
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Convert new member back to a (non group) ior.
+ CORBA::Object_var member_ior =
+ this->orb_->string_to_object (member_ior_string.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ MemberInfo * info = 0;
+ ACE_NEW_THROW_EX (info,
+ MemberInfo (member_ior.in (),
+ the_location),
+ CORBA::NO_MEMORY());
+
+ if (this->members_.bind (the_location, info) != 0)
+ {
+ // @@ Dale why this is a NO MEMORY exception?
+ ACE_THROW(CORBA::NO_MEMORY());
+ }
+
+ this->reference_ = new_reference; // note var-to-var assignment does
+ // a duplicate
+ if (this->increment_version ())
+ {
+ this->distribute_iogr (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ ACE_THROW (PortableGroup::ObjectNotAdded ());
+ }
+
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("PG (%P|%t) exit Object_Group add_member \n")));
+ }
+}
+
+int
+TAO::PG_Object_Group::set_primary_member (
+ TAO_IOP::TAO_IOR_Property * prop,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::MemberNotFound))
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->internals_,
+ 0);
+ int result = 1;
+ MemberInfo * info = 0;
+ if (this->members_.find (the_location, info) == 0)
+ {
+ int cleared = 0;
+ this->primary_location_ = the_location;
+ for (MemberMap_Iterator it = this->members_.begin();
+ !cleared && it != this->members_.end();
+ ++it)
+ {
+ cleared = (*it).int_id_->is_primary_;
+ (*it).int_id_->is_primary_ = 0;
+ }
+ info->is_primary_ = 1;
+
+ int set_ok =
+ this->manipulator_.set_primary (prop,
+ this->reference_.in (),
+ info->member_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ if (!set_ok)
+ {
+ if (TAO_debug_level > 3)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - ")
+ ACE_TEXT ("Can't set primary in IOGR .\n")
+ ));
+ }
+//@@: ACE_THROW (FT::PrimaryNotSet());
+ result = 0;
+ }
+
+ if (result && this->increment_version ())
+ {
+ this->distribute_iogr (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ else
+ {
+ if (TAO_debug_level > 3)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("TAO-PG (%P|%t) - set_primary_location ")
+ ACE_TEXT("throwing PrimaryNotSet because increment")
+ ACE_TEXT("version failed.\n")
+ ));
+ }
+//@@: ACE_THROW (FT::PrimaryNotSet());
+ result = 0;
+ }
+ }
+ else
+ {
+ if (TAO_debug_level > 3)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO-PG (%P|%t) - set_primary_location ")
+ ACE_TEXT ("throwing MemberNotFound.\n")));
+ }
+ ACE_THROW_RETURN (PortableGroup::MemberNotFound(),
+ -1);
+ }
+
+ return result;
+}
+
+
+void
+TAO::PG_Object_Group::remove_member (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::MemberNotFound))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
+ MemberInfo * info = 0;
+ if (this->members_.unbind (the_location, info) == 0)
+ {
+ if (this->members_.current_size() > 0)
+ {
+ this->reference_ =
+ this->manipulator_.remove_profiles (this->reference_.in (),
+ info->member_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ empty_ = 1;
+ }
+
+ delete info;
+
+ if (the_location == this->primary_location_)
+ {
+ this->primary_location_.length(0);
+ }
+
+ if (this->increment_version ())
+ {
+ this->distribute_iogr (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ }
+ else
+ {
+ if (TAO_debug_level > 6)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO-PG (%P|%t) - "
+ "remove_member throwing MemberNotFound.\n"
+ ));
+ }
+ ACE_THROW (PortableGroup::MemberNotFound() );
+ }
+}
+
+
+PortableGroup::ObjectGroupId
+TAO::PG_Object_Group::get_object_group_id (void) const
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->internals_,
+ 0);
+ return this->tagged_component_.object_group_id;
+}
+
+void
+TAO::PG_Object_Group::set_properties_dynamically (
+ const PortableGroup::Properties & overrides
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
+
+ this->properties_.decode (overrides ACE_ENV_ARG_PARAMETER);
+
+ //@@ int todo_override_rather_than_replace?
+}
+
+void
+TAO::PG_Object_Group::get_properties (
+ PortableGroup::Properties_var & result) const
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
+ this->properties_.export_properties(*result);
+}
+
+
+PortableGroup::TypeId
+TAO::PG_Object_Group::get_type_id (void) const
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->internals_,
+ 0);
+ return CORBA::string_dup (this->type_id_);
+}
+
+
+///////////////////
+// Internal method
+
+int
+TAO::PG_Object_Group::increment_version (void)
+{
+ // assume internals is locked
+ int result = 0;
+ this->tagged_component_.object_group_ref_version += 1;
+ if (TAO_debug_level > 3)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("%T %n (%P|%t) - Setting IOGR version to %u\n"),
+ static_cast<unsigned> (this->tagged_component_.object_group_ref_version)
+ ));
+ }
+
+ // Set the version
+ if (TAO::PG_Utils::set_tagged_component (this->reference_,
+ this->tagged_component_))
+ {
+ result = 1;
+ }
+ return result;
+}
+
+
+//////////////////
+// Internal method
+void
+TAO::PG_Object_Group::distribute_iogr (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // assume internals is locked
+ CORBA::String_var iogr =
+ this->orb_->object_to_string (this->reference_.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+// size_t n_rep = 0; // for dump_ior below
+ for (MemberMap_Iterator it = this->members_.begin();
+ it != this->members_.end ();
+ ++it)
+ {
+ MemberInfo const * info = (*it).int_id_;
+ //
+ // Unchecked narrow means the member doesn't have to actually implement the TAO_UpdateObjectGroup interface
+ // PortableGroup::TAO_UpdateObjectGroup_var uog = PortableGroup::TAO_UpdateObjectGroup::_unchecked_narrow ( info->member_);
+ // but it doesn work: error message at replica is:
+ // TAO-FT (2996|976) - Wrong version information within the interceptor [1 | 0]
+ // TAO_Perfect_Hash_OpTable:find for operation 'tao_update_object_group' (length=23) failed
+ // back to using _narrow
+ PortableGroup::TAO_UpdateObjectGroup_var uog =
+ PortableGroup::TAO_UpdateObjectGroup::_narrow ( info->member_.in ());
+ if (!CORBA::is_nil (uog.in ()))
+ {
+ ACE_TRY_NEW_ENV
+ {
+ if (TAO_debug_level > 3)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "PG (%P|%t) - Object_Group pushing "
+ "IOGR to %s member: %s@%s.\n",
+ (info->is_primary_ ? "Primary" : "Backup"),
+ this->role_.c_str (),
+ static_cast<const char *> (info->location_[0].id)
+ ));
+ }
+ // dump_ior ("group", "iogr", this->tagged_component_.object_group_ref_version, iogr);
+ // CORBA::String_var replica_ior = this->orb_->object_to_string(uog.in() ACE_ENV_ARG_PARAMETER);
+ // dump_ior (info->location_[0].id, "ior", (this->tagged_component_.object_group_ref_version * 100) + n_rep++, replica_ior);
+ uog->tao_update_object_group (iogr.in (),
+ this->tagged_component_.object_group_ref_version,
+ info->is_primary_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // we expect an exception
+ // tao_update_object_group is not a real method
+ }
+ ACE_ENDTRY;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "TAO::PG_Object_Group::distribute iogr can't "
+ "narrow member reference to "
+ "PortableGroup::TAO_UpdateObjectGroup.\n"
+ ));
+ }
+ }
+}
+
+PortableGroup::Locations *
+TAO::PG_Object_Group::locations_of_members (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->internals_,
+ 0);
+
+ PortableGroup::Locations * result = 0;
+
+ size_t count = this->members_.current_size ();
+
+ ACE_NEW_THROW_EX (
+ result,
+ PortableGroup::Locations (count),
+ CORBA::NO_MEMORY() );
+ ACE_CHECK_RETURN (0);
+
+ result->length (count);
+
+ size_t pos = 0;
+ for (MemberMap_Iterator it = this->members_.begin();
+ it != this->members_.end();
+ ++it)
+ {
+ const PortableGroup::Location & location = (*it).ext_id_;
+ PortableGroup::Location & out = (*result)[pos];
+ out = location;
+ }
+ return result;
+}
+
+CORBA::Object_ptr
+TAO::PG_Object_Group::get_member_reference (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ PortableGroup::MemberNotFound))
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->internals_,
+ CORBA::Object::_nil ());
+
+ CORBA::Object_var result;
+
+ MemberInfo * info = 0;
+ if (this->members_.find (the_location, info) == 0)
+ {
+ result = CORBA::Object::_duplicate (info->member_.in ());
+ }
+ else
+ {
+ ACE_THROW_RETURN (PortableGroup::MemberNotFound(), result._retn ());
+ }
+ return result._retn ();
+}
+
+
+PortableGroup::MembershipStyleValue
+TAO::PG_Object_Group::get_membership_style (void) const
+{
+ PortableGroup::MembershipStyleValue membership_style = 0;
+ if (!TAO::find (properties_,
+ PortableGroup::PG_MEMBERSHIP_STYLE,
+ membership_style))
+ {
+ membership_style = TAO_PG_MEMBERSHIP_STYLE;
+ }
+ return membership_style;
+}
+
+
+PortableGroup::MinimumNumberMembersValue
+TAO::PG_Object_Group::get_minimum_number_members (void) const
+{
+ PortableGroup::MinimumNumberMembersValue minimum_number_members = 0;
+ if (!TAO::find (properties_,
+ PortableGroup::PG_MINIMUM_NUMBER_MEMBERS,
+ minimum_number_members))
+ {
+ minimum_number_members = TAO_PG_MINIMUM_NUMBER_MEMBERS;
+ }
+ return minimum_number_members;
+}
+
+PortableGroup::InitialNumberMembersValue
+TAO::PG_Object_Group::get_initial_number_members (void) const
+{
+ PortableGroup::InitialNumberMembersValue initial_number_members = 0;
+ if (!TAO::find (properties_,
+ PortableGroup::PG_INITIAL_NUMBER_MEMBERS,
+ initial_number_members))
+ {
+ initial_number_members = TAO_PG_INITIAL_NUMBER_MEMBERS;
+ }
+ return initial_number_members;
+}
+
+void
+TAO::PG_Object_Group::create_member (
+ const PortableGroup::Location & the_location,
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::NoFactory,
+ PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::CannotMeetCriteria))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
+
+
+ if (0 != this->members_.find (the_location))
+ {
+ // @@ what if factories were passed as criteria?
+
+ CORBA::String_var factory_type;
+ PortableGroup::FactoryInfos_var factories =
+ this->factory_registry_->list_factories_by_role (
+ role_.c_str(),
+ factory_type.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ what if factory_type != type_id != this->type_id_
+
+ int created = 0; // bool
+ CORBA::ULong factory_count = factories->length ();
+ for (CORBA::ULong factory_pos = 0;
+ ! created && factory_pos < factory_count;
+ ++factory_pos)
+ {
+ const PortableGroup::FactoryInfo & factory_info =
+ (*factories)[factory_pos];
+ if (factory_info.the_location == the_location)
+ {
+ // @@ should we merge the_criteria with
+ // factory_info.the_criteria?
+
+ PortableGroup::GenericFactory::FactoryCreationId_var fcid;
+ CORBA::Object_var member =
+ factory_info.the_factory->create_object (
+ type_id,
+ the_criteria,
+ fcid. out()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // convert the new member to a stringified IOR to avoid
+ // contamination with group info
+ CORBA::String_var member_ior_string =
+ orb_->object_to_string (member.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableGroup::ObjectGroup_var new_reference =
+ this->add_member_to_iogr (member.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Convert new member back to a (non group) ior.
+ CORBA::Object_var member_ior =
+ this->orb_->string_to_object (member_ior_string.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ MemberInfo * info = 0;
+ ACE_NEW_THROW_EX (info, MemberInfo(
+ member_ior.in(),
+ the_location,
+ factory_info.the_factory,
+ fcid.in ()),
+ CORBA::NO_MEMORY());
+ ACE_CHECK;
+
+ if (this->members_.bind (the_location, info) != 0)
+ {
+ ACE_THROW(CORBA::NO_MEMORY());
+ }
+
+ this->reference_ = new_reference; // note var-to-var
+ // assignment does a
+ // duplicate
+ if (this->increment_version ())
+ {
+ this->distribute_iogr (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ created = 1;
+ }
+ }
+ if (! created)
+ {
+ ACE_THROW (PortableGroup::NoFactory ());
+ }
+ }
+ else
+ {
+ ACE_THROW (PortableGroup::MemberAlreadyPresent ());
+ }
+}
+
+void
+TAO::PG_Object_Group::create_members (size_t count ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::NoFactory))
+{
+ // assume internals is locked
+ // @@ what if factories were passed as criteria?
+
+ CORBA::String_var factory_type;
+ PortableGroup::FactoryInfos_var factories =
+ this->factory_registry_->list_factories_by_role (
+ role_.c_str(),
+ factory_type.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong factory_count = factories->length ();
+ if (factory_count > 0)
+ {
+ CORBA::ULong factory_pos = 0;
+ while (members_.current_size () < count && factory_pos < factory_count)
+ {
+ const PortableGroup::FactoryInfo & factory_info =
+ (*factories)[factory_pos];
+ const PortableGroup::Location & factory_location =
+ factory_info.the_location;
+ if (0 != this->members_.find (factory_location))
+ {
+ ///////////////////////////////////////////
+ // If a factory refuses to create a replica
+ // it's not fatal.
+ ACE_TRY_NEW_ENV
+ {
+ PortableGroup::GenericFactory::FactoryCreationId_var fcid;
+ CORBA::Object_var member =
+ factory_info.the_factory->create_object (
+ this->type_id_.in (),
+ factory_info.the_criteria,
+ fcid. out()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // convert the new member to a stringified IOR to avoid
+ // contamination with group info
+ CORBA::String_var member_ior_string =
+ orb_->object_to_string (member.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableGroup::ObjectGroup_var new_reference =
+ this->add_member_to_iogr (member.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Convert new member back to a (non group) ior.
+ CORBA::Object_var member_ior =
+ this->orb_->string_to_object (member_ior_string.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ MemberInfo * info = 0;
+ ACE_NEW_THROW_EX (info, MemberInfo(
+ member_ior.in(),
+ factory_location,
+ factory_info.the_factory,
+ fcid.in ()),
+ CORBA::NO_MEMORY());
+ ACE_TRY_CHECK;
+
+ if (this->members_.bind (factory_location, info) != 0)
+ {
+ ACE_TRY_THROW(CORBA::NO_MEMORY());
+ }
+ this->reference_ =
+ new_reference; // note var-to-var assignment does
+ // a duplicate
+ }
+ ACE_CATCHANY
+ {
+ // log, but otherwise ignore the errorf
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("PG (%P|%t) Replica Factory ")
+ ACE_TEXT ("@ %s refused create_object ")
+ ACE_TEXT ("request for type %s\n"),
+ static_cast<const char *> (factory_info.the_location[0].id),
+ static_cast<const char *> (this->type_id_.in ())
+ ));
+ }
+ }
+ ACE_ENDTRY;
+ }
+ }
+
+ if (this->increment_version ())
+ {
+ this->distribute_iogr (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ else
+ {
+ ACE_THROW (PortableGroup::NoFactory());
+ }
+}
+
+void
+TAO::PG_Object_Group::initial_populate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
+
+ if (this->get_membership_style () == PortableGroup::MEMB_INF_CTRL)
+ {
+ PortableGroup::InitialNumberMembersValue initial_number_members =
+ this->get_initial_number_members ();
+
+ if (this->members_.current_size () < initial_number_members)
+ {
+ this->create_members (initial_number_members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+}
+
+void
+TAO::PG_Object_Group::minimum_populate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
+
+ if ( this->get_membership_style () == PortableGroup::MEMB_INF_CTRL )
+ {
+ PortableGroup::MinimumNumberMembersValue minimum_number_members =
+ this->get_minimum_number_members ();
+ if (members_.current_size () < minimum_number_members)
+ {
+ this->create_members (minimum_number_members ACE_ENV_ARG_PARAMETER);
+ }
+ }
+}
+
+int
+TAO::PG_Object_Group::has_member_at (const PortableGroup::Location & location)
+{
+ return (0 == this->members_.find (location));
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// Restore original compiler flags.
+#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x582)
+# pragma option pop
+# pragma nopushoptwarn
+# pragma nopackwarning
+#endif /* __BORLANDC__ && __BORLANDC__ <= 0x582 */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h
new file mode 100644
index 00000000000..aaf4628cda3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h
@@ -0,0 +1,382 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Object_Group.h
+ *
+ * $Id$
+ *
+ * Manage all information related to an object group.
+ * @@ Note: the above description is optimistic. The hope is to eventually
+ * @@ consolidate all information related to an object group into this object.
+ * @@ however at the moment GenericFactory, ObjectGroupManager, and
+ * FT_ReplicationManager have parallel collections of object group
+ * information.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef TAO_PG_OBJECT_GROUP_H_
+#define TAO_PG_OBJECT_GROUP_H_
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+/////////////////////////////////
+// Includes needed by this header
+#include "orbsvcs/PortableGroup/PG_Property_Set.h"
+#include "orbsvcs/PortableGroup/PG_Location_Hash.h"
+#include "orbsvcs/PortableGroup/PG_Location_Equal_To.h"
+#include "orbsvcs/PortableGroup/PG_Object_Group_Manipulator.h"
+#include "orbsvcs/PortableGroupC.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "ace/Hash_Map_Manager_T.h"
+#include "ace/ACE.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/////////////////////
+// Forward references
+
+namespace TAO_IOP
+{
+ class TAO_IOR_Property;
+}
+
+////////////////
+// Class declarations
+namespace TAO
+{
+ /**
+ */
+ class TAO_PortableGroup_Export PG_Object_Group
+ {
+ // Information about an object group member
+ struct MemberInfo
+ {
+ /// Reference to the member.
+ CORBA::Object_var member_;
+
+ /// The factory that was used to create this object
+ /// nil if application created.
+ PortableGroup::GenericFactory_var factory_;
+
+ /// FactoryCreationId assigned to the member. Empty if application created
+ PortableGroup::GenericFactory::FactoryCreationId factory_id_;
+
+ /// Location where this member exists
+ PortableGroup::Location location_;
+
+
+ /// TRUE if this is primary member
+ CORBA::Boolean is_primary_;
+
+
+ ///////////////
+ // Methods
+
+ /// Construct an application-supplied member.
+ MemberInfo (CORBA::Object_ptr member, const PortableGroup::Location & location);
+
+ /// Construct a infrastructure-created member.
+ MemberInfo (
+ CORBA::Object_ptr member,
+ const PortableGroup::Location & location,
+ PortableGroup::GenericFactory_ptr factory,
+ PortableGroup::GenericFactory::FactoryCreationId factory_id);
+
+ /// Destructor
+ ~MemberInfo();
+ };
+
+ typedef TAO_SYNCH_MUTEX MemberMapMutex;
+ typedef ACE_Hash_Map_Manager_Ex <
+ PortableGroup::Location,
+ MemberInfo *,
+ TAO_PG_Location_Hash,
+ TAO_PG_Location_Equal_To,
+ MemberMapMutex> MemberMap;
+ typedef ACE_Hash_Map_Entry <PortableGroup::Location, MemberInfo *> MemberMap_Entry;
+ typedef ACE_Hash_Map_Iterator_Ex <
+ PortableGroup::Location,
+ MemberInfo *,
+ TAO_PG_Location_Hash,
+ TAO_PG_Location_Equal_To,
+ MemberMapMutex> MemberMap_Iterator;
+
+ /////////////////////
+ // Construct/Destruct
+ public:
+ /**
+ * @@TODO DOC
+ */
+ PG_Object_Group (
+ CORBA::ORB_ptr orb,
+ PortableGroup::FactoryRegistry_ptr factory_registry,
+ TAO::PG_Object_Group_Manipulator & manipulator,
+ CORBA::Object_ptr empty_group,
+ const PortableGroup::TagGroupTaggedComponent & tagged_component,
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria,
+ TAO::PG_Property_Set * type_properties);
+
+
+ /// Destructor
+ ~PG_Object_Group ();
+
+ /////////////////
+ // public methods
+
+ public:
+ /// return a duplicated reference to this group (IOGR)
+ PortableGroup::ObjectGroup_ptr reference()const;
+
+ /**
+ * Note the caller receives a copy of the factoryinfos in the result argument.
+ * inefficient, but thread safe.
+ */
+ void get_group_specific_factories (PortableGroup::FactoryInfos & result) const;
+
+ /**
+ * get location of primary member
+ */
+ const PortableGroup::Location & get_primary_location() const;
+
+ /**
+ * returns a duplicate
+ * caller must release
+ */
+ PortableGroup::TypeId get_type_id ()const;
+
+
+ /**
+ * @@TODO DOC
+ */
+ PortableGroup::MembershipStyleValue get_membership_style() const;
+
+ /**
+ * @@TODO DOC
+ */
+ PortableGroup::MinimumNumberMembersValue get_minimum_number_members () const;
+
+ /**
+ * @@TODO DOC
+ */
+ PortableGroup::InitialNumberMembersValue get_initial_number_members () const;
+
+
+
+ /**
+ * @@TODO DOC
+ */
+ void set_properties_dynamically (
+ const PortableGroup::Properties & overrides
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /**
+ * @@TODO DOC
+ */
+ void get_properties (PortableGroup::Properties_var & result) const
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * @@TODO DOC
+ */
+ PortableGroup::ObjectGroupId get_object_group_id () const;
+
+ /**
+ * Add a new member to the group.
+ * @param the_location the location for the new member
+ * @param member the member to be added
+ */
+ void add_member (
+ const PortableGroup::Location & the_location,
+ CORBA::Object_ptr member
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::ObjectNotAdded));
+
+ /**
+ * set the replica at the given location to be primary.
+ * Note: This should return void and throw FT::PrimaryNotSet
+ * but to avoid dependancies between PortableGroup and FaultTolerance
+ * it returns a boolean result. A false return means caller should
+ * throw FT::PrimaryNot_Set.
+ */
+ int set_primary_member (
+ TAO_IOP::TAO_IOR_Property * prop,
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::MemberNotFound
+ ));
+
+ /**
+ * @@TODO DOC
+ */
+ void remove_member (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::MemberNotFound));
+
+
+ /**
+ * @@TODO DOC
+ */
+ void create_member (
+ const PortableGroup::Location & the_location,
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::MemberAlreadyPresent,
+ PortableGroup::NoFactory,
+ PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::CannotMeetCriteria));
+
+ /**
+ * @@TODO DOC
+ */
+ PortableGroup::Locations * locations_of_members (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * @@TODO DOC
+ */
+ CORBA::Object_ptr get_member_reference (
+ const PortableGroup::Location & the_location
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ PortableGroup::MemberNotFound));
+
+
+ /**
+ * @@TODO DOC
+ */
+ void initial_populate (ACE_ENV_SINGLE_ARG_DECL);
+
+ /**
+ * @@TODO DOC
+ */
+ void minimum_populate (ACE_ENV_SINGLE_ARG_DECL);
+
+
+ /**
+ * @@TODO DOC
+ */
+ int has_member_at (const PortableGroup::Location & location );
+
+ /////////////////////////
+ // Implementation methods
+ private:
+
+ int increment_version ();
+
+ void distribute_iogr (ACE_ENV_SINGLE_ARG_DECL);
+
+ PortableGroup::ObjectGroup_ptr add_member_to_iogr(CORBA::Object_ptr member ACE_ENV_ARG_DECL);
+
+
+ void create_members (size_t count ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ PortableGroup::NoFactory
+ ));
+
+
+ /////////////////////////
+ // Forbidden methods
+ private:
+ PG_Object_Group ();
+ PG_Object_Group (const PG_Object_Group & rhs);
+ PG_Object_Group & operator = (const PG_Object_Group & rhs);
+
+
+ /////////////////
+ // Static Methods
+ public:
+
+ ///////////////
+ // Static Data
+ private:
+
+ ///////////////
+ // Data Members
+ private:
+
+ /**
+ * Protect internal state.
+ */
+ mutable TAO_SYNCH_MUTEX internals_;
+
+ CORBA::ORB_var orb_;
+
+ /// Where to find the factories for replicas.
+ PortableGroup::FactoryRegistry_var factory_registry_;
+
+
+ // The object group manipulator
+ TAO::PG_Object_Group_Manipulator & manipulator_;
+
+ /// boolean true if empty group
+ int empty_;
+
+ ACE_CString role_;
+ PortableGroup::TypeId_var type_id_;
+
+ /**
+ * the GroupTaggedComponent that defines this group
+ * contains:
+ * GIOP::Version component_version;
+ * TAO::String_Manager group_domain_id;
+ * PortableGroup::ObjectGroupId object_group_id;
+ * PortableGroup::ObjectGroupRefVersion object_group_ref_version;
+ */
+ PortableGroup::TagGroupTaggedComponent tagged_component_;
+
+ /**
+ * the reference (IOGR) to this group
+ */
+ PortableGroup::ObjectGroup_var reference_;
+
+ /**
+ * The CORBA object id assigned to this object group
+ */
+ PortableServer::ObjectId_var object_id_;
+
+ // group members
+ MemberMap members_;
+
+ PortableGroup::Location primary_location_;
+
+ // Miscellaneous properties passed to create_object when this group
+ // was initially created. To be used to create new members.
+ TAO::PG_Property_Set properties_;
+
+ // Cached property information
+
+ PortableGroup::InitialNumberMembersValue initial_number_members_;
+ PortableGroup::MinimumNumberMembersValue minimum_number_members_;
+ PortableGroup::FactoryInfos group_specific_factories_;
+
+ };
+} // namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif // TAO_PG_OBJECT_GROUP_H_
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Manipulator.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Manipulator.cpp
new file mode 100644
index 00000000000..2fb57ae571a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Manipulator.cpp
@@ -0,0 +1,190 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Object_Group_Manipulator.cpp
+ *
+ * $Id$
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#include "orbsvcs/PortableGroup/PG_Object_Group_Manipulator.h"
+#include "orbsvcs/PortableGroup/PG_Utils.h"
+
+#include "tao/debug.h"
+#include <ace/OS_NS_stdio.h>
+
+ACE_RCSID (PortableGroup,
+ PG_Object_Group_Manipulator,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::PG_Object_Group_Manipulator::PG_Object_Group_Manipulator ()
+ : orb_ (CORBA::ORB::_nil ())
+ , poa_ (PortableServer::POA::_nil ())
+ , iorm_ ()
+ , lock_ogid_ ()
+ , next_ogid_ (1) // don't use ogid 0
+{
+}
+
+TAO::PG_Object_Group_Manipulator::~PG_Object_Group_Manipulator ()
+{
+}
+
+void TAO::PG_Object_Group_Manipulator::allocate_ogid (PortableGroup::ObjectGroupId & ogid)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_ogid_);
+
+ // The numerical value used for the ObjectId increases
+ // monotonically.
+
+ ogid = this->next_ogid_;
+ this->next_ogid_ += 1;
+}
+
+PortableServer::ObjectId * TAO::PG_Object_Group_Manipulator::convert_ogid_to_oid (PortableGroup::ObjectGroupId ogid) const
+{
+ // 4294967295 -- Largest 32 bit unsigned integer
+ char oid_str[11];
+ ACE_OS::snprintf (oid_str, sizeof(oid_str),
+ "%lu",
+ static_cast<ACE_UINT32> (ogid));
+ oid_str[sizeof(oid_str) - 1] = '\0';
+
+ return PortableServer::string_to_ObjectId (oid_str);
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO::PG_Object_Group_Manipulator::create_object_group (
+ const char * type_id,
+ const char * domain_id,
+ PortableGroup::ObjectGroupId & group_id
+ ACE_ENV_ARG_DECL)
+{
+ allocate_ogid(group_id);
+ PortableServer::ObjectId_var oid = convert_ogid_to_oid (group_id);
+
+ // Create a reference for the ObjectGroup
+ CORBA::Object_var object_group =
+ this->poa_->create_reference_with_id (oid.in(),
+ type_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ PortableGroup::TagGroupTaggedComponent tag_component;
+
+ tag_component.component_version.major = (CORBA::Octet) 1;
+ tag_component.component_version.minor = (CORBA::Octet) 0;
+ tag_component.group_domain_id = domain_id;
+ tag_component.object_group_id = group_id;
+ tag_component.object_group_ref_version = 0;
+
+ // Set the property
+ TAO::PG_Utils::set_tagged_component (object_group,
+ tag_component);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ return object_group._retn ();
+}
+
+void
+TAO::PG_Object_Group_Manipulator::init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (CORBA::is_nil (this->orb_.in ()) && !CORBA::is_nil (orb));
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+
+ ACE_ASSERT (CORBA::is_nil (this->poa_.in ()) && !CORBA::is_nil (poa));
+ this->poa_ = PortableServer::POA::_duplicate (poa);
+
+ // Get an object reference for the ORBs IORManipulation object!
+ CORBA::Object_var IORM = this->orb_->resolve_initial_references (
+ TAO_OBJID_IORMANIPULATION, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->iorm_ = TAO_IOP::TAO_IOR_Manipulation::_narrow (
+ IORM.in () ACE_ENV_ARG_PARAMETER);
+// ACE_CHECK;
+}
+
+int TAO::PG_Object_Group_Manipulator::set_primary (
+ TAO_IOP::TAO_IOR_Property * prop,
+ PortableGroup::ObjectGroup_ptr group,
+ CORBA::Object_ptr new_primary
+ ACE_ENV_ARG_DECL) const
+{
+ int sts = this->iorm_->is_primary_set (prop, group ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ if (sts)
+ {
+ (void)this->iorm_->remove_primary_tag (prop, group ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ /////note: iorm takes it's parameters in the "wrong" order for this call
+ return this->iorm_->set_primary (prop, new_primary, group ACE_ENV_ARG_PARAMETER);
+}
+
+PortableGroup::ObjectGroup_ptr TAO::PG_Object_Group_Manipulator::merge_iors(
+ TAO_IOP::TAO_IOR_Manipulation::IORList & list ACE_ENV_ARG_DECL) const
+{
+ return this->iorm_->merge_iors (list ACE_ENV_ARG_PARAMETER);
+}
+
+PortableGroup::ObjectGroup_ptr TAO::PG_Object_Group_Manipulator::remove_profiles(
+ PortableGroup::ObjectGroup_ptr group,
+ PortableGroup::ObjectGroup_ptr profile
+ ACE_ENV_ARG_DECL) const
+{
+ return this->iorm_->remove_profiles(group, profile ACE_ENV_ARG_PARAMETER);
+}
+
+void dump_membership (const char * label, PortableGroup::ObjectGroup_ptr member)
+{
+ ACE_UNUSED_ARG (label);
+ ACE_UNUSED_ARG (member);
+#if 0
+ PortableGroup::TagFTGroupTaggedComponent ft_tag_component;
+ TAO_FT_IOGR_Property prop (ft_tag_component);
+ if (this->iorm_->is_primary_set (&prop, member))
+ {
+ ACE_DEBUG ( (LM_DEBUG,
+ ACE_TEXT ("%T %n (%P|%t) - %s: PRIMARY member.\n"),
+ label
+ ));
+ }
+ else
+ {
+ ACE_DEBUG ( (LM_DEBUG,
+ ACE_TEXT ("%T %n (%P|%t) - %s: backup member.\n"),
+ label
+ ));
+ }
+
+ PortableGroup::TagGroupTaggedComponent tag_component;
+ if (TAO::PG_Utils::get_tagged_component (member, tag_component))
+ {
+ ACE_DEBUG ( (LM_DEBUG,
+ ACE_TEXT ("%T %n (%P|%t) - %s: Group: .")
+ ACE_TEXT (" version: %u\n"),
+
+ label,
+ tag_component.object_group_ref_version
+ ));
+ }
+ else
+ {
+ ACE_DEBUG ( (LM_DEBUG,
+ ACE_TEXT ("%T %n (%P|%t) - %s: No group information found.\n"),
+ label
+ ));
+ }
+#endif
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Manipulator.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Manipulator.h
new file mode 100644
index 00000000000..4397cbfe8e0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Manipulator.h
@@ -0,0 +1,123 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Object_Group_Manipulator.h
+ *
+ * $Id$
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PG_OBJECT_GROUP_MANIPULATOR_H
+#define TAO_PG_OBJECT_GROUP_MANIPULATOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroupS.h"
+
+#include "tao/IORManipulation/IORManip_Loader.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+
+ /**
+ * @class TAO::PG_Object_Group_Manipulator
+ *
+ * @brief PortableGroup::ObjectGroupManager implementation.
+ *
+ * The ObjectGroupManager provides the interface necessary to
+ * facilitate application-controlled object group membership.
+ */
+ class TAO_PortableGroup_Export PG_Object_Group_Manipulator
+ {
+ public:
+
+ /// Constructor.
+ PG_Object_Group_Manipulator ();
+
+ /// Destructor.
+ ~PG_Object_Group_Manipulator ();
+
+ /**
+ * Initializes the group creator.
+ */
+ void init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Create an empty object group.
+ */
+ PortableGroup::ObjectGroup_ptr create_object_group (
+ const char * type_id,
+ const char * domain_id,
+ PortableGroup::ObjectGroupId & group_id
+ ACE_ENV_ARG_DECL);
+
+ PortableGroup::ObjectGroup_ptr remove_profiles (
+ PortableGroup::ObjectGroup_ptr group,
+ PortableGroup::ObjectGroup_ptr profile
+ ACE_ENV_ARG_DECL) const;
+
+ PortableGroup::ObjectGroup_ptr merge_iors (
+ TAO_IOP::TAO_IOR_Manipulation::IORList & iors
+ ACE_ENV_ARG_DECL) const;
+
+ int set_primary (
+ TAO_IOP::TAO_IOR_Property * prop,
+ PortableGroup::ObjectGroup_ptr reference,
+ CORBA::Object_ptr new_primary
+ ACE_ENV_ARG_DECL) const;
+
+ void dump_membership (const char * label,
+ PortableGroup::ObjectGroup_ptr member) const;
+
+ private:
+
+ /**
+ * Allocate an ogid for a new object group
+ */
+ void allocate_ogid (PortableGroup::ObjectGroupId & ogid);
+
+ /**
+ * convert numeric OGID to Sequence<Octet> oid
+ */
+ PortableServer::ObjectId *
+ convert_ogid_to_oid (PortableGroup::ObjectGroupId ogid) const;
+
+ private:
+
+ /// The orb
+ CORBA::ORB_var orb_;
+
+ /// Reference to the POA that created the object group references.
+ PortableServer::POA_var poa_;
+
+ /// The ORBs IORManipulation object
+ TAO_IOP::TAO_IOR_Manipulation_var iorm_;
+
+ /// Lock used to synchronize access to next_ogid_.
+ TAO_SYNCH_MUTEX lock_ogid_;
+
+ /// Next ogid to be allocated.
+ PortableGroup::ObjectGroupId next_ogid_;
+
+ };
+} //namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO::PG_OBJECT_GROUP_CREATOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Operators.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Operators.cpp
new file mode 100644
index 00000000000..9513dc724bb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Operators.cpp
@@ -0,0 +1,33 @@
+#include "orbsvcs/PortableGroup/PG_Operators.h"
+#include "ace/OS_NS_string.h"
+
+ACE_RCSID (PortableGroup,
+ PG_Operators,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+bool
+operator== (const CosNaming::Name & lhs, const CosNaming::Name & rhs)
+{
+ const CORBA::ULong lhs_len = lhs.length ();
+ const CORBA::ULong rhs_len = rhs.length ();
+
+ if (lhs_len != rhs_len)
+ return false;
+
+ for (CORBA::ULong i = 0; i < lhs_len; ++i)
+ if (ACE_OS::strcmp (lhs[i].id.in (), rhs[i].id.in ()) != 0
+ || ACE_OS::strcmp (lhs[i].kind.in (), rhs[i].kind.in ()) != 0)
+ return false;
+
+ return true;
+}
+
+bool
+operator!= (const CosNaming::Name & lhs, const CosNaming::Name & rhs)
+{
+ return !(lhs == rhs);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Operators.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Operators.h
new file mode 100644
index 00000000000..6218b5da005
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Operators.h
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+
+
+//=============================================================================
+/**
+ * @file PG_Operators.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PG_OPERATORS_H
+#define TAO_PG_OPERATORS_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNamingC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Global CosNaming::Name equality operator.
+/**
+ * Used for checking equality of PortableGroup::Location and
+ * PortableGroup::Property variables.
+ */
+bool TAO_PortableGroup_Export operator== (const CosNaming::Name & lhs,
+ const CosNaming::Name & rhs);
+
+/// Global CosNaming::Name inequality operator.
+/**
+ * This simple implementation simply negates the result of the
+ * equality operator.
+ */
+bool TAO_PortableGroup_Export operator!= (const CosNaming::Name & lhs,
+ const CosNaming::Name & rhs);
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_OPERATORS_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.cpp
new file mode 100644
index 00000000000..de1fa1c7223
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.cpp
@@ -0,0 +1,67 @@
+//=============================================================================
+/**
+ * @file PG_Properties_Encoder.cpp
+ *
+ * $Id$
+ *
+ * This file implements classes to help manage the Properties
+ * defined in the Portable Object Group.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+#include "orbsvcs/PortableGroup/PG_Properties_Encoder.h"
+
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/PortableGroup/PG_Properties_Encoder.inl"
+#endif /* ! __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//////////
+// Properties_Encoder
+TAO_PG::Properties_Encoder::Properties_Encoder ()
+{
+}
+
+TAO_PG::Properties_Encoder::~Properties_Encoder ()
+{
+}
+
+
+void TAO_PG::Properties_Encoder::add (
+ const char * name,
+ const PortableGroup::Value & value)
+{
+ NamedValue nv(name, value);
+ values_.push_back(nv);
+}
+
+void TAO_PG::Properties_Encoder::encode (
+ PortableGroup::Properties * property_set) const
+{
+ ACE_ASSERT (property_set != 0);
+ size_t count = values_.size();
+ property_set->length(count);
+ for( size_t nItem = 0; nItem < count; ++nItem )
+ {
+ const NamedValue & nv = values_[nItem];
+ PortableGroup::Property & property = (*property_set)[nItem];
+ PortableGroup::Name & nsName = property.nam;
+ PortableGroup::Value & anyValue = property.val;
+ // assign the value
+ anyValue = (nv.value_);
+
+ // assign the name
+ // @@: This restricts the name to a single level with no "kind"
+ // @@: remove this restriction (?)
+ nsName.length(1);
+ CosNaming::NameComponent & nc = nsName[0];
+
+ nc.id = CORBA::string_dup (nv.name_.c_str());
+ // nc.kind defaults to empty. Leave it that way (for now)
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.h
new file mode 100644
index 00000000000..d1780105873
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.h
@@ -0,0 +1,101 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Properties_Encoder.h
+ *
+ * $Id$
+ *
+ * This file declares a class to help manage PortableGroup::Properties
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+#ifndef TAO_PG_PROPERTIES_ENCODER_H
+#define TAO_PG_PROPERTIES_ENCODER_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/PortableGroupS.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#include "ace/Vector_T.h"
+#include "ace/SString.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_PG
+{
+ /**
+ * A helper to assemble a set of properties into a PortableGroup::Properties structure.
+ *
+ * To use a Properties_Encoder:
+ * Create it.
+ * Add properties to it using the add method.
+ * Allocate a new PortableGroup::Properties.
+ * Use the encode method to transfer the properties into the
+ * PortableGroup::Properties.
+ */
+ class TAO_PortableGroup_Export Properties_Encoder
+ {
+ // Originally NamedValue was an ACE_Pair, but ACE_Pair allows operator ==
+ // (delegating to the member's operators ==.) Since CORBA::Any does
+ // not support operator ==, this confused gcc version 2.9-gnupro-98r2
+ // on LynxOS pfadev04 3.0.1 110298-G PowerPC
+ struct NamedValue
+ {
+ public:
+ ACE_CString name_;
+ PortableGroup::Value value_;
+ NamedValue ();
+ NamedValue (const ACE_CString & name, const PortableGroup::Value & value);
+ NamedValue (const NamedValue & rhs);
+ NamedValue & operator = (const NamedValue & rhs);
+ /// Meaningless method to keep ACE_Vector happy
+ bool operator == (const NamedValue &rhs) const;
+ /// Meaningless method to keep ACE_Vector happy
+ bool operator != (const NamedValue &rhs) const;
+ };
+ typedef ACE_Vector< NamedValue, 10 > NamedValueVec;
+
+ public:
+ /**
+ * Construct an empty set of properties.
+ */
+ Properties_Encoder ();
+
+ /// standard destructor
+ ~Properties_Encoder ();
+
+ /**
+ * add a name/value property to the Properties_Encoder.
+ */
+ void add (const char * name, const PortableGroup::Value & value);
+
+ /**
+ * Encode all properties in this Properties_Encoder into a PortableGroup::Properties.
+ *
+ */
+ void encode (PortableGroup::Properties * property_set) const;
+
+ private:
+ Properties_Encoder (const Properties_Encoder & rhs);
+ Properties_Encoder & operator = (const Properties_Encoder & rhs);
+ private:
+ NamedValueVec values_;
+ };
+
+} //namespace TAO_PG
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/PortableGroup/PG_Properties_Encoder.inl"
+#endif /* __ACE_INLINE__ */
+#include /**/ "ace/post.h"
+#endif // TAO_PG_PROPERTIES_ENCODER_H
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.inl b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.inl
new file mode 100644
index 00000000000..aa64246f6a5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.inl
@@ -0,0 +1,64 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Properties_Encoder.inl
+ *
+ * $Id$
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_PG
+{
+ ACE_INLINE
+ Properties_Encoder::NamedValue::NamedValue ()
+ {
+ }
+
+ ACE_INLINE
+ Properties_Encoder::NamedValue::NamedValue (const ACE_CString & name, const PortableGroup::Value & value)
+ : name_ (name)
+ , value_ (value)
+ {
+ }
+
+ ACE_INLINE
+ Properties_Encoder::NamedValue::NamedValue (const Properties_Encoder::NamedValue & rhs)
+ : name_ (rhs.name_)
+ , value_ (rhs.value_)
+ {
+ }
+
+ ACE_INLINE
+ Properties_Encoder::NamedValue &
+ Properties_Encoder::NamedValue::operator = (const Properties_Encoder::NamedValue & rhs)
+ {
+ if (this != &rhs)
+ {
+ this->name_ = rhs.name_;
+ this->value_ = rhs.value_;
+ }
+ return *this;
+ }
+
+ ACE_INLINE
+ bool
+ Properties_Encoder::NamedValue::operator == (const Properties_Encoder::NamedValue &rhs) const
+ {
+ return this->name_ == rhs.name_;
+ }
+
+ ACE_INLINE
+ bool
+ Properties_Encoder::NamedValue::operator != (const Properties_Encoder::NamedValue &rhs) const
+ {
+ return this->name_ != rhs.name_;
+ }
+
+} //namespace TAO_PG
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.cpp
new file mode 100644
index 00000000000..cc8d023d899
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.cpp
@@ -0,0 +1,151 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Properties_Support.cpp
+ *
+ * $Id$
+ *
+ * This file implements classes to help manage PortableGroup::Properties
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#include "orbsvcs/PortableGroup/PG_Properties_Support.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::PG_Properties_Support::PG_Properties_Support ()
+{
+}
+
+TAO::PG_Properties_Support::~PG_Properties_Support ()
+{
+
+}
+
+void TAO::PG_Properties_Support::set_default_property (const char * name,
+ const PortableGroup::Value & value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->default_properties_.set_property(name, value ACE_ENV_ARG_PARAMETER);
+}
+
+void TAO::PG_Properties_Support::set_default_properties (const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->default_properties_.decode (props ACE_ENV_ARG_PARAMETER);
+}
+
+PortableGroup::Properties *
+TAO::PG_Properties_Support::get_default_properties (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ PortableGroup::Properties_var result;
+ ACE_NEW_THROW_EX ( result, PortableGroup::Properties(), CORBA::NO_MEMORY());
+ ACE_CHECK_RETURN (0);
+ this->default_properties_.export_properties (*result);
+ return result._retn ();
+}
+
+void TAO::PG_Properties_Support::remove_default_properties (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->default_properties_.remove (props);
+}
+
+void
+TAO::PG_Properties_Support::set_type_properties (
+ const char *type_id,
+ const PortableGroup::Properties & overrides
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
+
+ TAO::PG_Property_Set * typeid_properties;
+ if ( 0 != this->properties_map_.find (type_id, typeid_properties))
+ {
+ ACE_NEW_THROW_EX (
+ typeid_properties,
+ TAO::PG_Property_Set (overrides, & this->default_properties_),
+ CORBA::NO_MEMORY());
+ this->properties_map_.bind (type_id, typeid_properties);
+ }
+ typeid_properties->clear ();
+ typeid_properties->decode (overrides ACE_ENV_ARG_PARAMETER);
+}
+
+PortableGroup::Properties *
+TAO::PG_Properties_Support::get_type_properties (
+ const char *type_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException))
+{
+ PortableGroup::Properties_var result;
+ ACE_NEW_THROW_EX (result, PortableGroup::Properties(), CORBA::NO_MEMORY ());
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->internals_, 0);
+
+ TAO::PG_Property_Set * typeid_properties = 0;
+ if ( 0 != this->properties_map_.find (type_id, typeid_properties))
+ {
+ typeid_properties->export_properties (*result);
+ }
+ return result._retn ();
+}
+
+void
+TAO::PG_Properties_Support::remove_type_properties (
+ const char *type_id,
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ( (CORBA::SystemException))
+{
+ // NOTE: do not actually delete the properties for this type.
+ // There may be object groups depending on these.
+ // Reference counted pointers could be used to allow property sets
+ // for unused typeids to be deleted.
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
+
+ TAO::PG_Property_Set * typeid_properties = 0;
+ if ( 0 != this->properties_map_.find (type_id, typeid_properties))
+ {
+ typeid_properties->remove (props);
+ }
+}
+
+
+TAO::PG_Property_Set *
+TAO::PG_Properties_Support::find_typeid_properties (
+ const char *type_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->internals_, 0);
+
+ TAO::PG_Property_Set * typeid_properties = 0;
+ if ( 0 != this->properties_map_.find (type_id, typeid_properties))
+ {
+ ACE_NEW_THROW_EX (
+ typeid_properties,
+ TAO::PG_Property_Set (& this->default_properties_),
+ CORBA::NO_MEMORY());
+ this->properties_map_.bind (type_id, typeid_properties);
+ }
+ return typeid_properties;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.h
new file mode 100644
index 00000000000..50e2f504ffd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Support.h
@@ -0,0 +1,214 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Properties_Support.h
+ *
+ * $Id$
+ *
+ * This file declares classes to help manage the PortableGroup::Properties
+ * It serves roughly the same purpose as PG_PropertiesManager, but takes a
+ * different approach that suits the needs of FT CORBA.
+ * It would be possible to replace PG_PropertiesManager, or implement it in
+ * terms of PG_Properties_Support at some time in the future.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+#ifndef TAO_PG_PROPERTIES_SUPPORT_H
+#define TAO_PG_PROPERTIES_SUPPORT_H
+
+#include "orbsvcs/PortableGroup/PG_Property_Set.h"
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ /**
+ * This Properties Support object manages Property Sets (TAO::PG_Property_Set).
+ *
+ * One set, default_properties_,
+ * acts as a "global" default set of properties.
+ *
+ * The collection, properties_map_, contains a set of properties for each
+ * PortableGroup::type_id. The default set acts as a "parent" for each of
+ * these type_id sets.
+ *
+ * Expected use: When an object group is created that implements the interface
+ * identified by type_id, the corresponding typed_id propery set acts as a
+ * parent to the Property set contained in the PG_Object_Group.
+ *
+ * This heirarchy of property sets provides the correct property behavior. A
+ * request for a propery to an ObjectGroup will be satisfied from:
+ * by the object group group property set, or
+ * the typed_id property set, or
+ * the default property set, or
+ * the request will fail..
+ *
+ * Note that changes to type_id or default properties will be visible
+ * immediately at the ObjectGroup level.
+ */
+
+ class TAO_PortableGroup_Export PG_Properties_Support
+ {
+ typedef ACE_Hash_Map_Manager<
+ ACE_CString,
+ ::TAO::PG_Property_Set *,
+ TAO_SYNCH_MUTEX> Properties_Map;
+ typedef ACE_Hash_Map_Iterator<
+ ACE_CString,
+ ::TAO::PG_Property_Set *,
+ TAO_SYNCH_MUTEX> Properties_Map_Iterator;
+
+ public:
+ PG_Properties_Support ();
+ ~PG_Properties_Support ();
+
+ /**
+ * Set a single default property.
+ * Overwriting any value previously set for that property.
+ * Leaving all other properties untouched.
+ * @param name the name of the property to set
+ * @value an Any containing the value.
+ */
+ void set_default_property (const char * name,
+ const PortableGroup::Value & value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * Update the default property set.
+ *
+ * Properties that appear in props are replaced in or added to the default
+ * property set. Properties that do not appear in props are unchanged.
+ *
+ * @param props the set of properties to update the defaults.
+ */
+ void set_default_properties (const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * Export the default properties in PortableGroup::Properties format.
+ *
+ * This produces the properties in a format suitable for use across
+ * a CORBA interface.
+ * The caller owns the resulting Properties and must release it to avoid
+ * resource leaks.
+ * @returns a newly allocated PortableGroup::Properties.
+ */
+ PortableGroup::Properties * get_default_properties (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /**
+ * Undefine default properties that appear in props.
+ *
+ * Properties that are defined in props are removed from the default
+ * property set. Removal is done by name. The property values do not
+ * have to match. There is no penalty for attempting to remove a property
+ * that does not exist.
+ * @param props a set of propertys to be removed by name.
+ */
+ void remove_default_properties (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * Override or define properties associated with a type_id.
+ *
+ * If a property set does not exist for type_id, a new one will be created.
+ * Any property included in overrides will be set or replaced in the type_id
+ * property set. Any property not in overrides will be unchanged.
+ *
+ * Contrary to the "throws" specification, this method does not attempt
+ * to validate the properties because doing so would unnecessarily constrain
+ * the uses to which this class could be put (although one could strategize the
+ * validation.)
+ */
+ void set_type_properties (
+ const char *type_id,
+ const PortableGroup::Properties & overrides
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /**
+ * Export the property set in a PortableGroup::Properties format.
+ *
+ * This produces the properties associated with a type_id -- including
+ * any default properties that have not been overridden at the type_id level
+ * in a format suitable for use across a CORBA interface.
+ *
+ * The caller owns the resulting Properties and must release it to avoid
+ * resource leaks.
+ *
+ * Compare this method to find_typeid_properties which returns a pointer
+ * to the internal representation of the properties in TAO::PG_Property_Set
+ * format. This is more efficient, but suitable only for internal use.
+ *
+ * @param type_id identifies the set of properties to be exported.
+ * @returns a newly allocated PortableGroup::Properties that must be released by the caller.
+ */
+ PortableGroup::Properties * get_type_properties (
+ const char *type_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException));
+
+ /**
+ * Export the property set in a PortableGroup::Properties format.
+ *
+ * This method is intended to provide a parent
+ * for the property set in a newly-created Object Group of the given
+ * type_id.
+ *
+ * Callers who intend to send the property set across a CORBA interface
+ * should use the get_type_properties method.
+ *
+ * @param type_id identifies the set of properties to be found.
+ * @returns a pointer to a Property_Set owned by this Properties_Support object.
+ */
+ TAO::PG_Property_Set * find_typeid_properties (
+ const char *type_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * Undefine default properties that appear in props.
+ *
+ * Properties that are defined in props are removed from the type_id
+ * property set. Removal is done by name. The property values do not
+ * have to match. There is no penalty for attempting to remove a property
+ * that does not exist.
+ * @param props a set of propertys to be removed by name from the type_id set.
+ */
+ void remove_type_properties (
+ const char *type_id,
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException));
+
+ ///////////////
+ // Data Members
+ private:
+ /**
+ * Protect internal state.
+ */
+ TAO_SYNCH_MUTEX internals_;
+
+ /// The default property set.
+ TAO::PG_Property_Set default_properties_;
+
+ /// A collection of property sets indexed by type_id.
+ Properties_Map properties_map_;
+ };
+} //namespace TAO_PG
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif // TAO_PG_PROPERTIES_SUPPORT_H
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_PropertyManager.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_PropertyManager.cpp
new file mode 100644
index 00000000000..f6d9fb2a13c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_PropertyManager.cpp
@@ -0,0 +1,368 @@
+// -*- C++ -*-
+
+#include "orbsvcs/PortableGroup/PG_PropertyManager.h"
+#include "orbsvcs/PortableGroup/PG_ObjectGroupManager.h"
+#include "orbsvcs/PortableGroup/PG_Property_Utils.h"
+
+#include "tao/ORB_Constants.h"
+
+#include "ace/SString.h"
+
+ACE_RCSID (PortableGroup,
+ PG_PropertyManager,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_PG_PropertyManager::TAO_PG_PropertyManager (
+ TAO_PG_ObjectGroupManager & object_group_manager)
+ : object_group_manager_ (object_group_manager),
+ default_properties_ (),
+ type_properties_ (),
+ lock_ (),
+ property_validator_ ()
+{
+}
+
+
+void
+TAO_PG_PropertyManager::set_default_properties (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ // First verify that the "Factories" property is not in the
+ // Properties sequence. According to the spec, it is not allowed to
+ // be set as part of the default properties.
+ PortableGroup::Name factories;
+ factories.length (1);
+ factories[0].id = CORBA::string_dup ("org.omg.PortableGroup.Factories");
+
+ CORBA::ULong len = props.length ();
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ PortableGroup::Property property = props[i];
+
+ if (property.nam == factories)
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+
+ this->property_validator_.validate_property (props
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_);
+
+ this->default_properties_ = props;
+}
+
+
+PortableGroup::Properties *
+TAO_PG_PropertyManager::get_default_properties (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->lock_, 0);
+
+ PortableGroup::Properties * props = 0;
+ ACE_NEW_THROW_EX (props,
+ PortableGroup::Properties (this->default_properties_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ return props;
+}
+
+
+void
+TAO_PG_PropertyManager::remove_default_properties (
+ const PortableGroup::Properties &props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ if (props.length () == 0)
+ return; // @@ Throw CORBA::BAD_PARAM instead?
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_);
+
+ this->remove_properties (props,
+ this->default_properties_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void
+TAO_PG_PropertyManager::set_type_properties (
+ const char * type_id,
+ const PortableGroup::Properties & overrides
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ this->property_validator_.validate_property (overrides
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong num_overrides = overrides.length ();
+
+ if (num_overrides == 0)
+ return; // Throw CORBA::BAD_PARAM exception instead?
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_);
+
+ Type_Prop_Table::ENTRY * entry = 0;
+ if (this->type_properties_.find (type_id, entry) != 0)
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ PortableGroup::Properties & props = entry->int_id_;
+ props = overrides;
+}
+
+
+PortableGroup::Properties *
+TAO_PG_PropertyManager::get_type_properties (
+ const char * type_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->lock_, 0);
+
+
+ Type_Prop_Table::ENTRY * entry = 0;
+ PortableGroup::Properties * type_properties = 0;
+
+ if (this->type_properties_.find (type_id, entry) == 0)
+ type_properties = &entry->int_id_;
+
+ const CORBA::ULong def_props_len = this->default_properties_.length ();
+ const CORBA::ULong type_props_len =
+ (type_properties == 0 ? 0 : type_properties->length ());
+ const CORBA::ULong props_len =
+ (def_props_len > type_props_len ? def_props_len : type_props_len);
+
+ PortableGroup::Properties * tmp_properties = 0;
+ ACE_NEW_THROW_EX (tmp_properties,
+ PortableGroup::Properties (props_len),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ PortableGroup::Properties_var properties = tmp_properties;
+
+ // Set the length to the length of the largest of the two property
+ // sequences. The idea is to keep the cost of the incremental
+ // growth that may occur in TAO_PG::override_properties() to a
+ // minimum.
+ properties->length (props_len);
+
+ *tmp_properties = this->default_properties_;
+
+ if (type_properties != 0 && type_props_len > 0)
+ TAO_PG::override_properties (*type_properties, *tmp_properties);
+
+ return properties._retn ();
+}
+
+
+void
+TAO_PG_PropertyManager::remove_type_properties (
+ const char * type_id,
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ if (props.length () == 0)
+ return; // @@ Throw CORBA::BAD_PARAM instead?
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_);
+
+ Type_Prop_Table::ENTRY * entry = 0;
+ if (this->type_properties_.find (type_id, entry) != 0)
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ PortableGroup::Properties & type_properties = entry->int_id_;
+
+ this->remove_properties (props,
+ type_properties
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void
+TAO_PG_PropertyManager::set_properties_dynamically (
+ PortableGroup::ObjectGroup_ptr /* object_group */,
+ const PortableGroup::Properties & /* overrides */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+#if 0
+ // First verify that the "InitialNumberMembers" property is not in
+ // the Properties sequence. According to the spec, it is not
+ // allowed to be set as part of the default properties.
+ PortableGroup::Name factories;
+ factories.length (1);
+ factories[0].id =
+ CORBA::string_dup ("org.omg.PortableGroup.InitialNumberMembers");
+
+ CORBA::ULong len = props.length ();
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ PortableGroup::Property property = props[i];
+
+ if (property.nam == factories)
+ ACE_THROW (PortableGroup::InvalidProperty (property.nam,
+ property.val));
+ }
+
+ this->property_validator_.validate_property (overrides
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @todo Set the properties in the object group map entry.
+#endif /* 0 */
+
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+
+PortableGroup::Properties *
+TAO_PG_PropertyManager::get_properties (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound))
+{
+ CORBA::ULong properties_len = 0;
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, property_map_guard, this->lock_, 0);
+
+ // @@ Race condition here!
+ PortableGroup::Properties_var dynamic_properties =
+ this->object_group_manager_.get_properties (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ULong dyn_props_len = dynamic_properties->length ();
+ if (dyn_props_len > properties_len)
+ properties_len = dyn_props_len;
+
+ CORBA::String_var type_id =
+ this->object_group_manager_.type_id (object_group
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ULong type_props_len = 0;
+ PortableGroup::Properties * type_properties = 0;
+ Type_Prop_Table::ENTRY * type_entry = 0;
+ if (this->type_properties_.find (type_id.in (), type_entry) == 0)
+ {
+ type_properties = &type_entry->int_id_;
+ type_props_len = type_properties->length ();
+
+ if (type_props_len > properties_len)
+ properties_len = type_props_len;
+ }
+
+ CORBA::ULong def_props_len = this->default_properties_.length ();
+ if (def_props_len > properties_len)
+ properties_len = def_props_len;
+
+ PortableGroup::Properties * tmp_properties = 0;
+ ACE_NEW_THROW_EX (tmp_properties,
+ PortableGroup::Properties (properties_len),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ PortableGroup::Properties_var properties = tmp_properties;
+
+ // Set the length to the length of the largest of the three property
+ // sequences. The idea is to keep the cost of the incremental
+ // growth that may occur in TAO_PG::override_properties() to a
+ // minimum.
+ properties->length (properties_len);
+
+ // Start out with a copy of the default properties.
+ *tmp_properties = this->default_properties_;
+
+ // Override default properties with type-specific properties.
+ if (type_properties != 0)
+ TAO_PG::override_properties (*type_properties, *tmp_properties);
+
+ // Now override with the dynamic (object group) properties.
+ TAO_PG::override_properties (dynamic_properties.in (), *tmp_properties);
+
+ return properties._retn ();
+}
+
+
+void
+TAO_PG_PropertyManager::remove_properties (
+ const PortableGroup::Properties & to_be_removed,
+ PortableGroup::Properties &properties
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty))
+{
+ const CORBA::ULong num_removed = to_be_removed.length ();
+ if (num_removed == 0)
+ return; // @@ Throw CORBA::BAD_PARAM instead?
+
+ const CORBA::ULong old_length = properties.length ();
+
+ const CORBA::ULong new_length = old_length - num_removed;
+
+ PortableGroup::Properties new_properties (new_length);
+ new_properties.length (new_length);
+
+ // @@ Slow O(n^2) operation. Switching to a faster container for
+ // the default properties might be a good idea at some point in
+ // the future.
+ CORBA::ULong n = 0;
+ for (CORBA::ULong i = 0; i < num_removed; ++i)
+ {
+ const CORBA::ULong old_n = n;
+ const PortableGroup::Property &remove = to_be_removed[i];
+
+ for (CORBA::ULong j = 0; j < old_length; ++j)
+ if (remove.nam != properties[j].nam)
+ new_properties[n++] = properties[j];
+
+ // The property to be removed doesn't exist in the current list
+ // of default properties.
+ if (n == old_n)
+ ACE_THROW (PortableGroup::InvalidProperty (remove.nam,
+ remove.val));
+ }
+
+ // All properties were successfully removed, and the remaining ones
+ // were placed in the "new_properties" variable. Now copy that
+ // variable.
+ properties = new_properties;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_PropertyManager.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_PropertyManager.h
new file mode 100644
index 00000000000..5d6c40fa063
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_PropertyManager.h
@@ -0,0 +1,192 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_PropertyManager.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_PG_PROPERTY_MANAGER_H
+#define TAO_PG_PROPERTY_MANAGER_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/PortableGroup/PG_Default_Property_Validator.h"
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+#include "orbsvcs/PortableGroupS.h"
+
+#include "ace/SString.h"
+#include "ace/Null_Mutex.h"
+#include "ace/Functor.h"
+#include "ace/Hash_Map_Manager_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Forward declarations.
+class TAO_PG_ObjectGroupManager;
+
+/**
+ * @class TAO_PG_PropertyManager
+ *
+ * @brief Class that implements the PortableGroup::PropertyManager
+ * interface.
+ *
+ * Only the default and type-specific properties are housed in this
+ * class. The properties used at creation time of an object group and
+ * those set dynamically after object group creation are stored in the
+ * TAO_PG_ObjectGroup_Map_Entry structure. However, the
+ * PropertyManager is still used to manage those properties.
+ */
+class TAO_PortableGroup_Export TAO_PG_PropertyManager
+ : public virtual POA_PortableGroup::PropertyManager
+{
+public:
+
+ /// Constructor.
+ TAO_PG_PropertyManager (TAO_PG_ObjectGroupManager & object_group_manager);
+
+ /**
+ * @name PortableGroup::PropertyManager methods
+ *
+ * Methods required by the PortableGroup::PropertyManager
+ * interface.
+ */
+ //@{
+
+ /// Set the default properties to be used by all object groups.
+ virtual void set_default_properties (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /// Get the default properties used by all object groups.
+ virtual PortableGroup::Properties * get_default_properties (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Remove default properties.
+ virtual void remove_default_properties (
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /// Set properties associated with a given Member type. These
+ /// properties override the default properties.
+ virtual void set_type_properties (
+ const char * type_id,
+ const PortableGroup::Properties & overrides
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /**
+ * Return the properties associated with a give Replica type. These
+ * properties include the type-specific properties in use, in
+ * addition to the default properties that were not overridden.
+ */
+ virtual PortableGroup::Properties * get_type_properties (
+ const char * type_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Remove the given properties associated with the Replica type ID.
+ virtual void remove_type_properties (
+ const char * type_id,
+ const PortableGroup::Properties & props
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /**
+ * Dynamically set the properties associated with a given object
+ * group as the load balancer and replicas are being executed.
+ * These properties override the type-specific and default
+ * properties.
+ */
+ virtual void set_properties_dynamically (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Properties & overrides
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+ /**
+ * Return the properties currently in use by the given object
+ * group. These properties include those that were set dynamically,
+ * type-specific properties that weren't overridden, properties that
+ * were used when the replica was created, and default properties
+ * that weren't overridden.
+ */
+ virtual PortableGroup::Properties * get_properties (
+ PortableGroup::ObjectGroup_ptr object_group
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectGroupNotFound));
+
+ //@}
+
+ /// Type-specific property hash map.
+ typedef ACE_Hash_Map_Manager_Ex<
+ ACE_CString,
+ PortableGroup::Properties,
+ ACE_Hash<ACE_CString>,
+ ACE_Equal_To<ACE_CString>,
+ ACE_Null_Mutex> Type_Prop_Table;
+
+private:
+
+ /// Remove properties "to_be_removed" from the given list of
+ /// properties.
+ void remove_properties (const PortableGroup::Properties & to_be_removed,
+ PortableGroup::Properties &properties
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::InvalidProperty,
+ PortableGroup::UnsupportedProperty));
+
+private:
+
+ /// Table that maps ObjectId to Object Group related information.
+ TAO_PG_ObjectGroupManager & object_group_manager_;
+
+ /// Default properties.
+ PortableGroup::Properties default_properties_;
+
+ /// Table of type-specific object group properties.
+ Type_Prop_Table type_properties_;
+
+ /// Lock used to synchronize access to the default properties and
+ /// the type-specific properties.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// The property validator.
+ /**
+ * @todo Strategize the validator, or use template policies.
+ */
+ TAO_PG_Default_Property_Validator property_validator_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_PROPERTY_MANAGER_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp
new file mode 100644
index 00000000000..e63ff905d9d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp
@@ -0,0 +1,360 @@
+//=============================================================================
+/**
+ * @file PG_Property_Set.cpp
+ *
+ * $Id$
+ *
+ * This file implements classes to help manage the Properties
+ * defined in the Portable Object Group.
+ *
+ * Note: this started as a simple helper class to make decoding sets of properties
+ * easier, but expanded to provide more general support for managing sets of properties.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+#include "orbsvcs/PortableGroup/PG_Property_Set.h"
+#include "tao/debug.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//////////////////////
+// PG_Property_Set
+
+TAO::PG_Property_Set::PG_Property_Set()
+ : defaults_ (0)
+{
+}
+
+TAO::PG_Property_Set::PG_Property_Set (
+ const PortableGroup::Properties & property_set
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ : defaults_ (0)
+{
+ this->decode (property_set ACE_ENV_ARG_PARAMETER);
+}
+
+TAO::PG_Property_Set::PG_Property_Set (
+ const PortableGroup::Properties & property_set,
+ PG_Property_Set * defaults
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ : defaults_ (defaults)
+{
+ this->decode (property_set ACE_ENV_ARG_PARAMETER);
+}
+
+
+TAO::PG_Property_Set::PG_Property_Set (
+ PG_Property_Set * defaults)
+ : defaults_ (defaults)
+{
+}
+
+TAO::PG_Property_Set::~PG_Property_Set ()
+{
+ this->clear ();
+}
+
+void
+TAO::PG_Property_Set::decode (const PortableGroup::Properties & property_set
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
+
+ size_t count = property_set.length ();
+ for (size_t nItem = 0; nItem < count; ++nItem)
+ {
+ const PortableGroup::Property & property = property_set[nItem];
+ const CosNaming::Name & nsName = property.nam;
+ // note assumption one level name with no kind
+ // @@ TODO: fix this
+ const CosNaming::NameComponent & nc = nsName[0];
+
+ this->set_property (static_cast<const char *> (nc.id),
+ property.val
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+#if 0
+ ACE_CString name = static_cast<const char *> (nc.id);
+
+ const PortableGroup::Value * value_copy;
+ ACE_NEW_THROW_EX (value_copy,
+ PortableGroup::Value (property.val),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ const PortableGroup::Value * replaced_value = 0;
+ if (0 == this->values_.rebind (name, value_copy, replaced_value))
+ {
+ if (0 != replaced_value)
+ {
+ delete replaced_value;
+ }
+ }
+ else
+ {
+ if (TAO_debug_level > 3)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ "%n\n%T: Property_set: rebind failed.\n"
+ ));
+ }
+ // @@ should throw something here
+ ACE_THROW (CORBA::NO_MEMORY ());
+ }
+#endif
+ }
+}
+
+void TAO::PG_Property_Set::clear ()
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
+ for (ValueMapIterator it = this->values_.begin ();
+ it != this->values_.end ();
+ ++it)
+ {
+ delete (*it).int_id_;
+ }
+ this->values_.unbind_all ();
+}
+
+void TAO::PG_Property_Set::remove (const PortableGroup::Properties & property_set)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
+ size_t count = property_set.length ();
+ for (size_t nItem = 0; nItem < count; ++nItem)
+ {
+ const PortableGroup::Property & property = property_set[nItem];
+ const CosNaming::Name & nsName = property.nam;
+ // note assumption one level name with no kind
+ // @@ TODO: fix this
+ const CosNaming::NameComponent & nc = nsName[0];
+ ACE_CString name = static_cast<const char *> (nc.id);
+
+ const PortableGroup::Value * deleted_value;
+ if ( 0 == this->values_.unbind (name, deleted_value))
+ {
+ delete deleted_value;
+ }
+ else
+ {
+ // don't worry about it.
+ }
+ }
+}
+
+void TAO::PG_Property_Set::set_property (
+ const char * name,
+ const PortableGroup::Value & value
+ ACE_ENV_ARG_DECL)
+{
+ ACE_CString key (name);
+ PortableGroup::Value * value_copy;
+ ACE_NEW_THROW_EX (
+ value_copy, PortableGroup::Value (value),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ const PortableGroup::Value * replaced_value = 0;
+ if (0 == this->values_.rebind (name, value_copy, replaced_value))
+ {
+ if (0 != replaced_value)
+ {
+ delete replaced_value;
+ }
+ }
+ else
+ {
+ if (TAO_debug_level > 3)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ "%n\n%T: Property_set: rebind failed.\n"
+ ));
+ }
+ // @@ should throw something here
+ ACE_THROW (CORBA::NO_MEMORY ());
+ }
+}
+
+
+
+void TAO::PG_Property_Set::export_properties(PortableGroup::Properties & property_set) const
+{
+ ValueMap merged_values;
+ this->merge_properties (merged_values);
+
+ property_set.length (merged_values.current_size ());
+
+ size_t pos = 0;
+ for (ValueMapIterator it = merged_values.begin ();
+ it != merged_values.end ();
+ ++it)
+ {
+ const ACE_CString & name = (*it).ext_id_;
+ const PortableGroup::Value * value = (*it).int_id_;
+
+ PortableGroup::Property & property = property_set[pos];
+ CosNaming::Name & nsName = property.nam;
+ //@@ note assumption: single level name, no kind
+ nsName.length(1);
+ CosNaming::NameComponent & nc = nsName[0];
+ nc.id = CORBA::string_dup (name.c_str ());
+ PortableGroup::Value & val = property.val;
+ val = *value; // NOTE: Any assignment does a deep copy
+ ++pos;
+ }
+ ACE_ASSERT (pos == property_set.length ());
+}
+
+void TAO::PG_Property_Set::merge_properties (ValueMap & merged_values) const
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);
+ if (0 != this->defaults_)
+ {
+ this->defaults_->merge_properties (merged_values);
+ }
+ // note AFICT ACE_Hash_Map does not support const iterators, hence the const cast.
+ ValueMap & mutable_values = const_cast<ValueMap &> (this->values_);
+ for (ValueMapIterator it = mutable_values.begin ();
+ it != mutable_values.end ();
+ ++it)
+ {
+ merged_values.rebind ( (*it).ext_id_, (*it).int_id_);
+ }
+}
+
+
+
+int TAO::PG_Property_Set::find (
+ const ACE_CString & key,
+ const PortableGroup::Value *& pValue) const
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->internals_, 0);
+ int found = (0 == this->values_.find (key, pValue));
+ if (! found)
+ {
+ if (0 != this->defaults_)
+ {
+ found = this->defaults_->find (key, pValue);
+ }
+ }
+ return found;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+//#define PG_PS_UNIT_TEST
+#ifdef PG_PS_UNIT_TEST
+#include "orbsvcs/PortableGroup/PG_Properties_Encoder.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int TAO_PG::test_encode_decode ()
+{
+ int result = 1;
+ static const long testLong = 123456L;
+ static const char * testLongKey = "MyLong";
+
+ static const char * testString = "Now is the time for all good people.";
+ static const char * testStringKey = "plover";
+
+ static const double testDouble = 3.1415;
+ static const char * testDoubleKey = "pi";
+
+ PortableGroup::Properties_var property_set = new PortableGroup::Properties;
+ //scope encoder to be sure its gone before decoding
+ {
+ TAO_PG::Encoder encoder;
+ PortableGroup::Value value;
+ value <<= (CORBA::Long) testLong;
+ encoder.add (testLongKey, value);
+
+ value <<= testString;
+ encoder.add (testStringKey, value);
+
+ value <<= (CORBA::Double) testDouble;
+ encoder.add (testDoubleKey, value);
+
+ encoder.encode (property_set);
+ }
+
+ TAO::PG_Property_Set decoder (property_set);
+
+ CORBA::Long longResult = 0;
+ if (find (decoder, testLongKey, longResult) )
+ {
+ if (longResult != testLong)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ "%n\n%T: %s = %d expecting %d\n",
+ testLongKey,
+ (int)longResult,
+ (int)testLong
+ ));
+ result = 0;
+ }
+ }
+ else
+ {
+ ACE_ERROR ( (LM_ERROR,
+ "%n\n%T: Can't find value for %s\n", testLongKey
+ ));
+ result = 0;
+ }
+
+ const char * stringResult = "";
+ if (find (decoder, testStringKey, stringResult))
+ {
+ if (0 != ACE_OS::strcmp (testString, stringResult))
+ {
+ ACE_ERROR ( (LM_ERROR,
+ "%n\n%T: %s = \"%s\" expecting \"%s\"\n",
+ testStringKey,
+ (int)stringResult,
+ (int)testString
+ ));
+ result = 0;
+ }
+ }
+ else
+ {
+ ACE_ERROR ( (LM_ERROR,
+ "%n\n%T: Can't find value for %s\n", testStringKey
+ ));
+ result = 0;
+ }
+
+
+ CORBA::Double doubleResult = 0.0;
+ if (find (decoder, testDoubleKey, doubleResult))
+ {
+ if (doubleResult != testDouble)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ "%n\n%T: %s = \"%f\" expecting \"%f\"\n",
+ testDoubleKey,
+ doubleResult,
+ testDouble
+ ));
+ result = 0;
+ }
+ }
+ else
+ {
+ ACE_ERROR ( (LM_ERROR,
+ "%n\n%T: Can't find value for %s\n", testDoubleKey
+ ));
+ result = 0;
+ }
+
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif // PG_PS_UNIT_TEST
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.h
new file mode 100644
index 00000000000..44aae869da7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.h
@@ -0,0 +1,200 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Property_Set.h
+ *
+ * $Id$
+ *
+ * This file declares classes to help manage the Properties
+ * defined in the Portable Object Group.
+ *
+ * Note: this started as a simple helper class to make decoding sets of properties
+ * easier, but expanded to provide more general support for managing sets of properties.
+ *
+ * A more appropriate name would be PG_Properties_Set. Maybe this can be changed someday.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+#ifndef TAO_PG_PROPERTY_SET
+#define TAO_PG_PROPERTY_SET
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+#include "orbsvcs/PortableGroupS.h"
+#include "orbsvcs/CosNamingC.h"
+#include "ace/Hash_Map_Manager.h"
+#include "ace/SString.h"
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+
+ /**
+ * The PG_Property_Set captures the set of properties from a
+ * PortableGroup::Properties structure in a more usable format (a
+ * hash map), and provides methods for operating on these properties.
+ *
+ * It supports "chains" of property sets to implement default value semantics.
+ * If a requested property is not found in this set, the default set(s) are searched.
+ * Thus, any property found at this level overrides the defaults.
+ *
+ * See: PG_Properties_Support for more details on use of this object.
+ *
+ * A PG_Property_Set may also be used for it's original purpose as a stand-alone
+ * helper class for extracting values from PortableGroup::Properties.
+ */
+
+ class TAO_PortableGroup_Export PG_Property_Set
+ {
+ typedef ACE_Hash_Map_Manager<
+ ACE_CString,
+ const PortableGroup::Value *,
+ ACE_SYNCH_NULL_MUTEX> ValueMap;
+ typedef ACE_Hash_Map_Iterator<
+ ACE_CString,
+ const PortableGroup::Value *,
+ ACE_SYNCH_NULL_MUTEX> ValueMapIterator;
+
+ public:
+
+ /**
+ * constructor: empty set with no defaults.
+ */
+ PG_Property_Set (void);
+
+ /**
+ * constructor
+ * @param property_set the properties to be decoded
+ */
+ PG_Property_Set (const PortableGroup::Properties & property_set
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * constructor with defaults
+ * @param property_set the properties to be decoded
+ * @param defaults a propert set decoder that supplies default values.
+ */
+ PG_Property_Set (const PortableGroup::Properties & property_set,
+ PG_Property_Set * defaults
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * constructor with defaults, but no properties (yet)
+ * (note this is not a copy constructor)
+ * @param defaults a propert set decoder that supplies default values.
+ */
+ PG_Property_Set (PG_Property_Set * defaults);
+
+
+ ~PG_Property_Set ();
+
+ /**
+ * general purpose find. returns a pointer to an Any
+ * if templated methods were available:
+ * template <typename TYPE >
+ * int find (const ACE_CString & key, TYPE & value) const;
+ * instead, see global function below
+ * @param key the (simple) name of the property
+ * @param pValue an out parameter to receive a pointer to the Any containing the value
+ * @returns boolean true if found
+ */
+ int find (const ACE_CString & key, const PortableGroup::Value *& pValue)const;
+
+
+ /**
+ * Decode additional properties
+ * Duplicate values replace previous values.
+ * @param property_set the properties to be decoded
+ */
+ void decode (const PortableGroup::Properties & property_set ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * Clear properties
+ * Does not clear default properties.
+ */
+ void clear ();
+
+ void remove (const PortableGroup::Properties & property_set)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * set or replace a single property
+ */
+ void set_property (
+ const char * name,
+ const PortableGroup::Value & value
+ ACE_ENV_ARG_DECL);
+
+
+ /**
+ * Export the properties to a PortableGroup::Properties
+ *
+ * This method is intended to be used to implement the PropertyManager::get_*_properties
+ * methods. If you want to access the properties for any purpose other than exporting
+ * them across a CORBA interface, it is much more efficient to use the find interface.
+ *
+ */
+ void export_properties(PortableGroup::Properties & property_set) const;
+
+ /////////////////////////
+ // Implementation Methods
+ private:
+ /**
+ * populate a ValueMap with the properties known to this decoder
+ * including but overriding default values
+ */
+ void merge_properties (ValueMap & merged_values) const;
+
+ ////////////////////
+ // Forbidden methods
+ private:
+ PG_Property_Set(const PG_Property_Set & rhs);
+ PG_Property_Set & operator = (const PG_Property_Set & rhs);
+
+ ///////////////
+ // Data Members
+ private:
+
+ /**
+ * Protect internal state.
+ */
+ mutable TAO_SYNCH_MUTEX internals_;
+
+ ValueMap values_;
+ /**
+ * a parent to another property decoder that provides default values
+ * these can be chained indefinitely.
+ * @todo reference counted pointers would be a good idea here.
+ */
+ PG_Property_Set * defaults_;
+ };
+
+
+#ifdef PG_PS_UNIT_TEST
+
+ /**
+ * unit test: encode and decode properties.
+ * Initialize CORBA before calling this function.
+ * Success is silent, failure prints on cerr.
+ * @returns 1 if test passed; 0 if test failed.
+ */
+ int test_encode_decode();
+#endif // PG_PS_UNIT_TEST
+} //namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+////////////////////////////////////
+// include templated helper function
+#include "orbsvcs/PortableGroup/PG_Property_Set_Find.h"
+
+#include /**/ "ace/post.h"
+
+#endif // TAO_PG_PROPERTY_SET
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set_Find.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set_Find.h
new file mode 100644
index 00000000000..6f68524d8ac
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set_Find.h
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Property_Set_Find.h
+ *
+ * $Id$
+ *
+ * This is a companion function for the properties docoder
+ * to work around compilers that don't support templated methods.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+#ifndef TAO_PG_PROPERTY_SET_FIND_H
+#define TAO_PG_PROPERTY_SET_FIND_H
+#include /**/ "ace/pre.h"
+#include <ace/ACE.h>
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#include "ace/Hash_Map_Manager.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ /**
+ * Find a value in a TAO::PG_Property_Set.
+ * This is a work-around for the lack of
+ * templated methods.
+ */
+ template <typename TYPE>
+ int find (const PG_Property_Set & decoder, const ACE_CString & key, TYPE & value)
+ {
+ int result = 0;
+ PortableGroup::Value const * any;
+ if ( decoder.find (key, any))
+ {
+ result = ((*any) >>= value);
+ }
+ return result;
+ }
+
+} //namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif // TAO_PG_PROPERTY_SET_FIND_H
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Utils.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Utils.cpp
new file mode 100644
index 00000000000..897facce517
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Utils.cpp
@@ -0,0 +1,82 @@
+#include "orbsvcs/PortableGroup/PG_Property_Utils.h"
+#include "orbsvcs/PortableGroup/PG_Operators.h"
+
+ACE_RCSID (PortableGroup,
+ PG_Property_Utils,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+CORBA::Boolean
+TAO_PG::get_property_value (const PortableGroup::Name & property_name,
+ const PortableGroup::Properties & properties,
+ PortableGroup::Value & property_value)
+{
+ const CORBA::ULong len = properties.length ();
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ const PortableGroup::Property & property = properties[i];
+ if (property.nam == property_name)
+ {
+ property_value = property.val;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+void
+TAO_PG::override_properties (
+ const PortableGroup::Properties & overrides,
+ PortableGroup::Properties &properties)
+{
+ const CORBA::ULong num_overrides = overrides.length ();
+ if (num_overrides == 0)
+ return;
+
+ const CORBA::ULong old_length = properties.length ();
+
+ const CORBA::ULong new_length =
+ (num_overrides > old_length ? num_overrides : old_length);
+
+ // Increase the length wholesale as much as possible. The idea is
+ // to keep the cost of the incremental growth that may occur below
+ // to a minimum.
+ properties.length (new_length);
+
+ // @@ Slow O(n^2) operation. Note that it may be slower than O(n^2)
+ // if the length of the property sequence must be increased
+ // on-the-fly due to the allocations and copies incurred by such
+ // an operation.
+ for (CORBA::ULong i = 0; i < num_overrides; ++i)
+ {
+ const PortableGroup::Property &override = overrides[i];
+
+ CORBA::ULong j = 0;
+ for ( ; j < old_length; ++j)
+ if (properties[j].nam == override.nam)
+ {
+ properties[j].val = override.val;
+ break;
+ }
+
+ // No property to override. Append the override.
+ if (j == old_length)
+ {
+ // @@ Slow incremental growth! In order to set the length
+ // only once, i.e. a priori, instead of multiple times a
+ // searches in the override list and the property list
+ // must be performed to determine how many additional
+ // properties from the override list must be appended to
+ // the properties list. Depending on the size of each
+ // list, such an operation may be just as slow as this
+ // operation.
+ const CORBA::ULong current_length = properties.length ();
+ properties.length (current_length + 1);
+ properties[current_length] = override;
+ }
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Utils.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Utils.h
new file mode 100644
index 00000000000..8e8395f2bc6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Utils.h
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Property_Utils.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PG_PROPERTY_UTILS_H
+#define TAO_PG_PROPERTY_UTILS_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/PortableGroup/portablegroup_export.h"
+#include "orbsvcs/PortableGroupC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO_PG
+{
+ /// Retrieve the value of the given property from the given property
+ /// list.
+ /**
+ * @return true if successful, false otherwise
+ */
+ TAO_PortableGroup_Export CORBA::Boolean get_property_value (
+ const PortableGroup::Name & property_name,
+ const PortableGroup::Properties & properties,
+ PortableGroup::Value & property_value);
+
+ /// Override properties in the "properties" sequence with those in
+ /// the "overrides" sequence.
+ /**
+ * If no property is overridden, the override in question will be
+ * appended to the "properties" list.
+ */
+ TAO_PortableGroup_Export void override_properties (
+ const PortableGroup::Properties & overrides,
+ PortableGroup::Properties &properties);
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_PG_PROPERTY_UTILS_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Servant_Dispatcher.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Servant_Dispatcher.cpp
new file mode 100644
index 00000000000..4b3504795e2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Servant_Dispatcher.cpp
@@ -0,0 +1,70 @@
+// $Id$
+
+#include "orbsvcs/PortableGroup/GOA.h"
+#include "orbsvcs/PortableGroup/PG_Servant_Dispatcher.h"
+
+ACE_RCSID(PortableGroup,
+ PG_Servant_Dispatcher,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_PG_Servant_Dispatcher::~TAO_PG_Servant_Dispatcher (void)
+{
+}
+
+TAO_Root_POA *
+TAO_PG_Servant_Dispatcher::create_Root_POA (const ACE_CString &name,
+ PortableServer::POAManager_ptr poa_manager,
+ const TAO_POA_Policy_Set &policies,
+ ACE_Lock &lock,
+ TAO_SYNCH_MUTEX &thread_lock,
+ TAO_ORB_Core &orb_core,
+ TAO_Object_Adapter *object_adapter
+ ACE_ENV_ARG_DECL)
+{
+ TAO_Root_POA *poa = 0;
+
+ ACE_NEW_THROW_EX (poa,
+ TAO_GOA (name,
+ poa_manager,
+ policies,
+ 0,
+ lock,
+ thread_lock,
+ orb_core,
+ object_adapter
+ ACE_ENV_ARG_PARAMETER),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ return poa;
+}
+
+void
+TAO_PG_Servant_Dispatcher::pre_invoke_remote_request (
+ TAO_Root_POA &,
+ CORBA::Short,
+ TAO_ServerRequest &,
+ TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_PG_Servant_Dispatcher::pre_invoke_collocated_request (
+ TAO_Root_POA &,
+ CORBA::Short,
+ TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_PG_Servant_Dispatcher::post_invoke (
+ TAO_Root_POA &,
+ TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Servant_Dispatcher.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Servant_Dispatcher.h
new file mode 100644
index 00000000000..a5718c240cc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Servant_Dispatcher.h
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Servant_Dispatcher.h
+ *
+ * $Id$
+ *
+ * @author Johnny Willemsen <jwillemsen@remedy.nl>
+ */
+//=============================================================================
+
+#ifndef TAO_PG_SERVANT_DISPATCHER_H
+#define TAO_PG_SERVANT_DISPATCHER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+#include "tao/PortableServer/Servant_Dispatcher.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_PG_Servant_Dispatcher
+ *
+ * @brief Concrete instantiation of the Servant_Dispatcher strategy.
+ *
+ * This class just calls _dispatch on the servant_upcall. No extra
+ * processing is done or needed.
+ *
+ */
+class TAO_PortableGroup_Export TAO_PG_Servant_Dispatcher
+ : public TAO_Servant_Dispatcher
+{
+public:
+ virtual ~TAO_PG_Servant_Dispatcher (void);
+
+ /// Pre_invoke remote request.
+ void pre_invoke_remote_request (TAO_Root_POA &poa,
+ CORBA::Short servant_priority,
+ TAO_ServerRequest &req,
+ TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &pre_invoke_state
+ ACE_ENV_ARG_DECL);
+
+ /// Pre_invoke collocated request.
+ void pre_invoke_collocated_request (TAO_Root_POA &poa,
+ CORBA::Short servant_priority,
+ TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &pre_invoke_state
+ ACE_ENV_ARG_DECL);
+
+ /// Post_invoke request.
+ void post_invoke (TAO_Root_POA &poa,
+ TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &pre_invoke_state);
+
+ /// Factory method for creating new POA's.
+ TAO_Root_POA *create_Root_POA (const ACE_CString &name,
+ PortableServer::POAManager_ptr poa_manager,
+ const TAO_POA_Policy_Set &policies,
+ ACE_Lock &lock,
+ TAO_SYNCH_MUTEX &thread_lock,
+ TAO_ORB_Core &orb_core,
+ TAO_Object_Adapter *object_adapter
+ ACE_ENV_ARG_DECL);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_PG_SERVANT_DISPATCHER_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Utils.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Utils.cpp
new file mode 100644
index 00000000000..a57079ffea8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Utils.cpp
@@ -0,0 +1,176 @@
+#include "orbsvcs/PortableGroup/PG_Utils.h"
+
+#include "tao/MProfile.h"
+#include "tao/Profile.h"
+#include "tao/Stub.h"
+#include "tao/Tagged_Components.h"
+#include "tao/CDR.h"
+
+#include "ace/OS_NS_string.h"
+
+
+ACE_RCSID (PortableGroup,
+ PG_Utils,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ /*static*/ CORBA::Boolean
+ PG_Utils::set_tagged_component (
+ PortableGroup::ObjectGroup *&ior,
+ PortableGroup::TagGroupTaggedComponent &tg)
+ {
+ if (ior->_stubobj () == 0)
+ return 0;
+
+ // We need to apply the property for every profile in the IOR
+ TAO_MProfile &tmp_pfiles =
+ ior->_stubobj ()->base_profiles ();
+
+ // Create the output CDR stream
+ TAO_OutputCDR cdr;
+
+ IOP::TaggedComponent tagged_components;
+ tagged_components.tag = IOP::TAG_FT_GROUP;
+
+ // Encode the property in to the tagged_components
+ CORBA::Boolean retval =
+ PG_Utils::encode_properties (cdr,
+ tg);
+
+ if (retval == 0)
+ return retval;
+
+ // Get the length of the CDR stream
+ CORBA::ULong length = static_cast<CORBA::ULong> (cdr.total_length ());
+
+ // Set the length
+ tagged_components.component_data.length (length);
+
+ // Get the pointer to the underlying buffer
+ CORBA::Octet *buf =
+ tagged_components.component_data.get_buffer ();
+
+ for (const ACE_Message_Block *i = cdr.begin ();
+ i != 0;
+ i = i->cont ())
+ {
+
+ ACE_OS::memcpy (buf, i->rd_ptr (), i->length ());
+ buf += i->length ();
+ }
+ const IOP::TaggedComponent &tmp_tc = tagged_components;
+
+ // Get the profile count.
+ CORBA::ULong count =
+ ior->_stubobj ()->base_profiles ().profile_count ();
+
+ // Go through every profile and set the TaggedComponent field
+ for (CORBA::ULong p_idx = 0; p_idx < count ; ++p_idx)
+ {
+ // Get the tagged components in the profile
+ TAO_Tagged_Components &tag_comp =
+ tmp_pfiles.get_profile (p_idx)->tagged_components ();
+
+ // Finally set the <tagged_component> in the
+ // <TAO_Tagged_Component>
+ tag_comp.set_component (tmp_tc);
+ }
+
+ // Success
+ return 1;
+ }
+
+ /*static*/ CORBA::Boolean
+ PG_Utils::get_tagged_component (
+ PortableGroup::ObjectGroup *&ior,
+ PortableGroup::TagGroupTaggedComponent &tg)
+ {
+ if (ior->_stubobj () == 0)
+ return 0;
+
+ TAO_MProfile &mprofile =
+ ior->_stubobj ()->base_profiles ();
+
+ // Looking for a tagged component with a TAG_FT_GROUP flag.
+ IOP::TaggedComponent tc;
+ tc.tag = IOP::TAG_FT_GROUP;
+
+ CORBA::ULong count =
+ mprofile.profile_count ();
+
+ for (CORBA::ULong i = 0;
+ i < count;
+ i++)
+ {
+
+ // Get the Tagged Components
+ const TAO_Tagged_Components &pfile_tagged =
+ mprofile.get_profile (i)->tagged_components ();
+
+ // Look for the primary
+ if (pfile_tagged.get_component (tc) == 1)
+ {
+ TAO_InputCDR cdr (reinterpret_cast<const char*> (tc.component_data.get_buffer ()),
+ tc.component_data.length ());
+
+ CORBA::Boolean byte_order;
+
+ cdr >> ACE_InputCDR::to_boolean (byte_order);
+
+ if (!cdr.good_bit ())
+ return 0;
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ cdr >> tg;
+
+ if (cdr.good_bit ())
+ return 1;
+ }
+ }
+
+ return 0;
+ }
+
+ CORBA::Boolean
+ PG_Utils::encode_properties (
+ TAO_OutputCDR &cdr,
+ PortableGroup::TagGroupTaggedComponent &tg)
+ {
+ cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER);
+
+ if (!cdr.good_bit ())
+ return 0;
+
+ // the version info
+ cdr << tg.component_version;
+
+ if (!cdr.good_bit ())
+ return 0;
+
+ // the domain id
+ cdr << tg.group_domain_id.in ();
+
+ if (!cdr.good_bit ())
+ return 0;
+
+ // Object group id
+ cdr << tg.object_group_id;
+
+ if (!cdr.good_bit ())
+ return 0;
+
+ // Object group reference version
+ cdr << tg.object_group_ref_version;
+
+ if (!cdr.good_bit ())
+ return 0;
+
+ return cdr.good_bit ();
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Utils.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Utils.h
new file mode 100644
index 00000000000..5552f38c3a3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Utils.h
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_Utils.h
+ *
+ * $Id$
+ *
+ * Utility methods
+ *
+ * @author Balachandran Natarajan <bala@dre.vanderbilt.edu>
+ */
+//=============================================================================
+#ifndef TAO_PORTABLEGROUP_UTILS_H
+#define TAO_PORTABLEGROUP_UTILS_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroupC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ /**
+ * @class PG_Utils
+ *
+ * @brief Simple utility class
+ */
+ class TAO_PortableGroup_Export PG_Utils
+ {
+ public:
+
+ /// Set tagged component for the object group
+ static CORBA::Boolean set_tagged_component (
+ PortableGroup::ObjectGroup *&ior,
+ PortableGroup::TagGroupTaggedComponent &t);
+
+ /// Get tagged component for the object group
+ static CORBA::Boolean get_tagged_component (
+ PortableGroup::ObjectGroup *&ior,
+ PortableGroup::TagGroupTaggedComponent &t);
+
+ private:
+ static CORBA::Boolean encode_properties (
+ TAO_OutputCDR &cdr,
+ PortableGroup::TagGroupTaggedComponent &tg);
+ };
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /*TAO_PORTABLEGROUP_UTILS_H*/
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_conf.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_conf.h
new file mode 100644
index 00000000000..7f993ad8f71
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_conf.h
@@ -0,0 +1,64 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PG_conf.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PG_CONF_H
+#define TAO_PG_CONF_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"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+#ifndef TAO_PG_MAX_OBJECT_GROUPS // @@ why create arbitrary limits?
+/// The maximum number of object groups to be managed by the
+/// ObjectGroupManager. This number is also equal to the number of
+/// factory sets managed by the GenericFactory.
+const size_t TAO_PG_MAX_OBJECT_GROUPS = 1024;
+#endif /* TAO_PG_MAX_NUMBER_OF_OBJECT_GROUPS */
+
+#ifndef TAO_PG_MAX_LOCATIONS // @@ why create arbitrary limits?
+/// The maximum number of locations to be managed by the
+/// ObjectGroupManager.
+const size_t TAO_PG_MAX_LOCATIONS = 1024;
+#endif /* TAO_PG_MAX_LOCATIONS */
+
+#ifndef TAO_PG_MEMBERSHIP_STYLE
+/// The default object group membership style.
+const PortableGroup::MembershipStyleValue TAO_PG_MEMBERSHIP_STYLE =
+ PortableGroup::MEMB_INF_CTRL;
+#endif /* TAO_PG_INITIAL_NUMBER_MEMBERS */
+
+#ifndef TAO_PG_INITIAL_NUMBER_MEMBERS
+/// The default initial number of object group members.
+const PortableGroup::InitialNumberMembersValue TAO_PG_INITIAL_NUMBER_MEMBERS =
+ 2;
+#endif /* TAO_PG_INITIAL_NUMBER_MEMBERS */
+
+#ifndef TAO_PG_MINIMUM_NUMBER_MEMBERS
+/// The default minimum number of object group members.
+const PortableGroup::MinimumNumberMembersValue TAO_PG_MINIMUM_NUMBER_MEMBERS =
+ TAO_PG_INITIAL_NUMBER_MEMBERS;
+#endif /* TAO_PG_MINIMUM_NUMBER_MEMBERS */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PG_CONF_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Acceptor_Registry.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Acceptor_Registry.cpp
new file mode 100644
index 00000000000..a22594ca04b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Acceptor_Registry.cpp
@@ -0,0 +1,191 @@
+// $Id$
+
+#include "orbsvcs/PortableGroup/PortableGroup_Acceptor_Registry.h"
+#include "tao/ORB_Core.h"
+#include "tao/Profile.h"
+#include "tao/Protocol_Factory.h"
+#include "tao/GIOP_Message_State.h"
+#include "tao/debug.h"
+#include "tao/Endpoint.h"
+#include "tao/Thread_Lane_Resources.h"
+#include "tao/Leader_Follower.h"
+
+ACE_RCSID (PortableGroup,
+ PortableGroup_Acceptor_Registry,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_PortableGroup_Acceptor_Registry::TAO_PortableGroup_Acceptor_Registry (void)
+{
+}
+
+TAO_PortableGroup_Acceptor_Registry::~TAO_PortableGroup_Acceptor_Registry (void)
+{
+ // Free the memory for the endpoints.
+ Entry *entry;
+ Acceptor_Registry_Iterator iter (this->registry_);
+
+ while (iter.next (entry))
+ {
+ delete entry->endpoint;
+ delete entry->acceptor;
+ iter.advance ();
+ }
+}
+
+
+void
+TAO_PortableGroup_Acceptor_Registry::open (const TAO_Profile* profile,
+ TAO_ORB_Core &orb_core
+ ACE_ENV_ARG_DECL)
+{
+ Entry *entry;
+
+ if (this->find (profile, entry) == 1)
+ {
+ // Found it. Increment the reference count.
+ ++entry->cnt;
+ }
+ else
+ {
+ // Not found. Open a new acceptor.
+
+ // Now get the list of available protocol factories.
+ TAO_ProtocolFactorySetItor end =
+ orb_core.protocol_factories ()->end ();
+
+ // int found = 0;
+ // If usable protocol (factory) is found then this will be
+ // set equal to 1.
+
+ for (TAO_ProtocolFactorySetItor factory =
+ orb_core.protocol_factories ()->begin ();
+ factory != end;
+ ++factory)
+ {
+ if ((*factory)->factory ()->tag () == profile->tag ())
+ {
+ this->open_i (profile,
+ orb_core,
+ factory
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // found = 1; // A usable protocol was found.
+ }
+ else
+ continue;
+ }
+ }
+}
+
+#define MAX_ADDR_LENGTH (32)
+
+void
+TAO_PortableGroup_Acceptor_Registry::open_i (const TAO_Profile* profile,
+ TAO_ORB_Core &orb_core,
+ TAO_ProtocolFactorySetItor &factory
+ ACE_ENV_ARG_DECL)
+{
+ TAO_Acceptor *acceptor = (*factory)->factory ()->make_acceptor ();
+
+ if (acceptor != 0)
+ {
+ // Extract the desired endpoint/protocol version if one
+ // exists.
+ const TAO_GIOP_Message_Version &version = profile->version ();
+ char buffer [MAX_ADDR_LENGTH];
+
+ // Removed the constness of profile. We're not changing
+ // anything, but need to call a nonconst function.
+ TAO_Profile* nc_profile = const_cast<TAO_Profile *> (profile);
+ nc_profile->endpoint ()->addr_to_string (buffer, MAX_ADDR_LENGTH);
+
+ if (acceptor->open (&orb_core,
+ orb_core.lane_resources ().leader_follower ().reactor(),
+ version.major,
+ version.minor,
+ buffer,
+ 0) == -1)
+ {
+ delete acceptor;
+
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) ")
+ ACE_TEXT ("unable to open acceptor ")
+ ACE_TEXT ("for <%s>%p\n"),
+ buffer,
+ ""));
+
+ ACE_THROW (CORBA::BAD_PARAM (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_ACCEPTOR_REGISTRY_OPEN_LOCATION_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+
+ // Add acceptor to list.
+ Entry tmp_entry;
+ tmp_entry.acceptor = acceptor;
+ tmp_entry.endpoint = nc_profile->endpoint ()->duplicate ();
+ tmp_entry.cnt = 1;
+
+ if (this->registry_.enqueue_tail (tmp_entry) == -1)
+ {
+ delete acceptor;
+
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) ")
+ ACE_TEXT ("unable to add acceptor to registry")
+ ACE_TEXT ("for <%s>%p\n"),
+ buffer,
+ ""));
+
+ ACE_THROW (CORBA::BAD_PARAM (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_ACCEPTOR_REGISTRY_OPEN_LOCATION_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) ")
+ ACE_TEXT ("unable to create acceptor ")
+ ));
+
+ ACE_THROW (CORBA::BAD_PARAM (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_ACCEPTOR_REGISTRY_OPEN_LOCATION_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+}
+
+int
+TAO_PortableGroup_Acceptor_Registry::find (const TAO_Profile* profile,
+ Entry *&entry)
+{
+ Acceptor_Registry_Iterator iter (this->registry_);
+
+ while (iter.next (entry))
+ {
+ // Since the endpoint routine is nonconst, need to
+ // cast away the constness even though we're not
+ // changing anything.
+ TAO_Profile *nc_profile = const_cast<TAO_Profile *> (profile);
+ if (entry->endpoint->is_equivalent (nc_profile->endpoint ()))
+ return 1;
+
+ iter.advance ();
+ }
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Acceptor_Registry.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Acceptor_Registry.h
new file mode 100644
index 00000000000..1ecc90efa4d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Acceptor_Registry.h
@@ -0,0 +1,117 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PortableGroup_Acceptor_Registry.h
+ *
+ * $Id$
+ *
+ * Registry for dynamically created acceptors.
+ *
+ * @author Frank Hunleth <fhunleth@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_PORTABLEGROUP_ACCEPTOR_REGISTRY_H
+#define TAO_PORTABLEGROUP_ACCEPTOR_REGISTRY_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Unbounded_Queue.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/CORBA_macros.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#include "tao/Transport_Acceptor.h"
+#include "tao/Resource_Factory.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Profile;
+
+namespace CORBA
+{
+ class Environment;
+}
+
+/**
+ * @class TAO_PortableGroup_Acceptor_Registry
+ *
+ * @brief .
+ *
+ * There is one TAO_PortableGroup_Acceptor_Registry per ORB_Core.
+ */
+class TAO_PortableGroup_Export TAO_PortableGroup_Acceptor_Registry
+{
+public:
+
+ /**
+ * @struct Entry
+ *
+ * @brief Value field of the portable group acceptor registry.
+ */
+ struct Entry
+ {
+ /// Pointer to the acceptor for this GroupId.
+ TAO_Acceptor *acceptor;
+
+ /// Cached endpoint that the acceptor is listening on.
+ TAO_Endpoint *endpoint;
+
+ /// Count of times that this GroupId has been opened.
+ int cnt;
+ };
+
+
+ // = Initialization and termination methods.
+ /// Default constructor.
+ TAO_PortableGroup_Acceptor_Registry (void);
+
+ /// Default destructor.
+ ~TAO_PortableGroup_Acceptor_Registry (void);
+
+ /// Open an acceptor based on a tagged profile.
+ void open (const TAO_Profile* profile,
+ TAO_ORB_Core &orb_core
+ ACE_ENV_ARG_DECL);
+
+ /// Close all open acceptors.
+ int close_all (void);
+
+ typedef ACE_Unbounded_Queue<Entry> Acceptor_Registry;
+ typedef ACE_Unbounded_Queue_Iterator<Entry> Acceptor_Registry_Iterator;
+
+protected:
+
+ /// Helper function to open a group acceptor.
+ void open_i (const TAO_Profile* profile,
+ TAO_ORB_Core &orb_core,
+ TAO_ProtocolFactorySetItor &factory
+ ACE_ENV_ARG_DECL);
+
+ /// Find an acceptor by using a profile.
+ int find (const TAO_Profile* profile,
+ Entry *&entry);
+
+private:
+
+ // The acceptor registry should not be copied.
+ TAO_PortableGroup_Acceptor_Registry (
+ const TAO_PortableGroup_Acceptor_Registry&);
+ void operator= (const TAO_PortableGroup_Acceptor_Registry&);
+
+private:
+ /// List of acceptors that are currently open.
+ Acceptor_Registry registry_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PORTABLEGROUP_ACCEPTOR_REGISTRY_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.cpp
new file mode 100644
index 00000000000..2878d3db9a6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.cpp
@@ -0,0 +1,83 @@
+// $Id$
+
+#include "orbsvcs/PortableGroup/PortableGroup_Loader.h"
+#include "orbsvcs/PortableGroup/PG_Object_Adapter_Factory.h"
+#include "orbsvcs/PortableGroup/PortableGroup_ORBInitializer.h"
+#include "ace/Dynamic_Service.h"
+#include "tao/ORB_Core.h"
+#include "tao/ORBInitializer_Registry.h"
+
+ACE_RCSID (PortableGroup,
+ PortableGroup_Loader,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_PortableGroup_Loader::TAO_PortableGroup_Loader (void)
+{
+}
+
+int
+TAO_PortableGroup_Loader::init (int /*argc*/,
+ char* /*argv*/ [])
+{
+ ACE_TRACE ("TAO_PortableGroup_Loader::init");
+ // Register the ORB initializer.
+ ACE_TRY_NEW_ENV
+ {
+ PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
+ PortableInterceptor::ORBInitializer::_nil ();
+ PortableInterceptor::ORBInitializer_var orb_initializer;
+
+ /// Register the Portablegroup ORBInitializer.
+ ACE_NEW_THROW_EX (temp_orb_initializer,
+ TAO_PortableGroup_ORBInitializer (),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_TRY_CHECK;
+ orb_initializer = temp_orb_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Unexpected exception caught while initializing the PortableGroup:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+TAO_PortableGroup_Loader::Initializer (void)
+{
+ ACE_Service_Config::process_directive (ace_svc_desc_TAO_PortableGroup_Loader);
+ TAO_PortableGroup_Loader *tmp =
+ ACE_Dynamic_Service<TAO_PortableGroup_Loader>::instance (
+ "PortableGroup_Loader");
+
+ if (tmp != 0)
+ {
+ return tmp->init (0, 0);
+ }
+
+ return -1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DEFINE (TAO_PortableGroup_Loader,
+ ACE_TEXT ("PortableGroup_Loader"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_PortableGroup_Loader),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
+ACE_FACTORY_DEFINE (TAO_PortableGroup, TAO_PortableGroup_Loader)
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.h
new file mode 100644
index 00000000000..7dac70972c2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Loader.h
@@ -0,0 +1,68 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PortableGroup_Loader.h
+ *
+ * $Id$
+ *
+ * Loads and initializes the PortableGroup extensions to TAO.
+ *
+ * @author Frank Hunleth <fhunleth@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_PORTABLEGROUP_LOADER_H
+#define TAO_PORTABLEGROUP_LOADER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+#include "ace/Service_Config.h"
+#include "ace/Service_Object.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_PortableGroup_Adapter
+ *
+ * @brief TAO_PortableGroup_Adapter.
+ *
+ * This class acts as a facade for the PortableGroup library to the
+ * ORB.
+ */
+class TAO_PortableGroup_Export TAO_PortableGroup_Loader
+ : public ACE_Service_Object
+{
+public:
+ /// Constructor.
+ TAO_PortableGroup_Loader (void);
+
+ /// Initialize the PortableGroup loader hooks.
+ virtual int init (int argc,
+ char *[]);
+
+ /// Used to force the initialization of the ORB code.
+ static int Initializer (void);
+};
+
+static int
+TAO_Requires_PortableGroup_Initializer =
+ TAO_PortableGroup_Loader::Initializer ();
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (TAO_PortableGroup_Loader)
+ACE_FACTORY_DECLARE (TAO_PortableGroup, TAO_PortableGroup_Loader)
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PORTABLEGROUP_LOADER_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp
new file mode 100644
index 00000000000..870c6b75e59
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp
@@ -0,0 +1,71 @@
+// $Id$
+
+#include "orbsvcs/PortableGroup/PortableGroup_ORBInitializer.h"
+#include "orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.h"
+
+#include "tao/Exception.h"
+#include "tao/ORB_Core.h"
+#include "tao/PI/ORBInitInfo.h"
+#include "tao/debug.h"
+
+ACE_RCSID (PortableGroup,
+ PortableGroup_ORBInitializer,
+ "$Id$")
+
+static const char pg_poa_factory_name[] = "TAO_GOA";
+static const char pg_poa_factory_directive[] = ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "TAO_GOA", "TAO_PortableGroup", "_make_TAO_PG_Object_Adapter_Factory", "");
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void
+TAO_PortableGroup_ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Narrow to a TAO_ORBInitInfo object to get access to the
+ // orb_core() TAO extension.
+ TAO_ORBInitInfo_var tao_info = TAO_ORBInitInfo::_narrow (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (tao_info.in ()))
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) PortableGroup_ORBInitializer::pre_init:\n"
+ "(%P|%t) Unable to narrow "
+ "\"PortableInterceptor::ORBInitInfo_ptr\" to\n"
+ "(%P|%t) \"TAO_ORBInitInfo_ptr.\"\n"));
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ // Set a new request dispatcher in the ORB.
+ PortableGroup_Request_Dispatcher *rd = 0;
+ ACE_NEW_THROW_EX (rd,
+ PortableGroup_Request_Dispatcher (),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ tao_info->orb_core ()->request_dispatcher (rd);
+
+ // If the application resolves the root POA, make sure we load the PG POA.
+ TAO_ORB_Core::set_poa_factory (pg_poa_factory_name,
+ pg_poa_factory_directive);
+}
+
+void
+TAO_PortableGroup_ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.h
new file mode 100644
index 00000000000..56f730edd59
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.h
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PortableGroup_ORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Frank Hunleth <fhunleth@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PORTABLEGROUP_ORB_INITIALIZER_H
+#define TAO_PORTABLEGROUP_ORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PI/PI.h"
+#include "tao/LocalObject.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// PortableGroup ORB initializer.
+class TAO_PortableGroup_Export TAO_PortableGroup_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));
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PORTABLEGROUP_ORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.cpp
new file mode 100644
index 00000000000..ae3fbe2d941
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.cpp
@@ -0,0 +1,61 @@
+// $Id$
+
+#include "orbsvcs/PortableGroup/UIPMC_Profile.h"
+#include "orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.h"
+#include "orbsvcs/PortableGroup/PortableGroup_Loader.h"
+
+#include "tao/TAO_Server_Request.h"
+#include "tao/ORB_Core.h"
+
+ACE_RCSID (PortableGroup,
+ PortableGroup_Request_Dispatcher,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+PortableGroup_Request_Dispatcher::~PortableGroup_Request_Dispatcher (void)
+{
+}
+
+void
+PortableGroup_Request_Dispatcher::dispatch (TAO_ORB_Core *orb_core,
+ TAO_ServerRequest &request,
+ CORBA::Object_out forward_to
+ ACE_ENV_ARG_DECL)
+{
+ // Check if the request contains a tagged profile
+ if (request.profile ().discriminator () == GIOP::ProfileAddr)
+ {
+ // Get the IOP::Tagged profile.
+ const IOP::TaggedProfile &tagged_profile =
+ request.profile ().tagged_profile ();
+ PortableGroup::TagGroupTaggedComponent group;
+
+ // Extract a Group ID from the profile if it exists.
+ int result = TAO_UIPMC_Profile::extract_group_component (tagged_profile,
+ group);
+ if (result == 0)
+ {
+ // Got a group. Dispatch based on the group ID
+ this->group_map_.dispatch (&group,
+ orb_core,
+ request,
+ forward_to
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ return;
+ }
+
+ // Else, fall through and dispatch based on object key like normal.
+ }
+
+ // Dispatch based on object key.
+ orb_core->adapter_registry ()->dispatch (request.object_key (),
+ request,
+ forward_to
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.h
new file mode 100644
index 00000000000..fb6ae13e934
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.h
@@ -0,0 +1,70 @@
+//-*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PortableGroup_Request_Dispatcher.h
+ *
+ * $Id$
+ *
+ * A class that strategizes the request dispatching procedure.
+ *
+ * @author Frank Hunleth <fhunleth@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PORTABLEGROUP_REQUEST_DISPATCHER_H
+#define TAO_PORTABLEGROUP_REQUEST_DISPATCHER_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/Request_Dispatcher.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+#include "orbsvcs/PortableGroup/Portable_Group_Map.h"
+#include "orbsvcs/PortableGroup/PortableGroup_Acceptor_Registry.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward declarations.
+class TAO_PortableGroup_Loader;
+
+/**
+ * @class PortableGroup_Request_Dispatcher
+ *
+ * @brief A class that strategizes the request dispatching procedure.
+ *
+ */
+class TAO_PortableGroup_Export PortableGroup_Request_Dispatcher
+ : public TAO_Request_Dispatcher
+{
+ friend class TAO_GOA;
+
+public:
+
+ /// Destructor.
+ virtual ~PortableGroup_Request_Dispatcher (void);
+
+ /**
+ * Dispatch a request.
+ */
+ virtual void dispatch (TAO_ORB_Core *orb_core,
+ TAO_ServerRequest &request,
+ CORBA::Object_out forward_to
+ ACE_ENV_ARG_DECL);
+
+private:
+
+ /// Hash map containing the GroupId->ObjectKey mappings.
+ TAO_Portable_Group_Map group_map_;
+
+ /// Registry for all of the group (multicast) acceptors.
+ TAO_PortableGroup_Acceptor_Registry acceptor_registry_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_PORTABLEGROUP_REQUEST_DISPATCHER_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/Portable_Group_Map.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/Portable_Group_Map.cpp
new file mode 100644
index 00000000000..73745a4460b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/Portable_Group_Map.cpp
@@ -0,0 +1,180 @@
+// $Id$
+
+#include "orbsvcs/PortableGroup/Portable_Group_Map.h"
+#include "tao/ORB_Core.h"
+#include "tao/TAO_Server_Request.h"
+#include "tao/CDR.h"
+
+ACE_RCSID (PortableGroup,
+ Portable_Group_Map,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Constructor.
+TAO_Portable_Group_Map::TAO_Portable_Group_Map ()
+{
+}
+
+/// Destructor.
+TAO_Portable_Group_Map::~TAO_Portable_Group_Map (void)
+{
+ for (Iterator i = this->map_.begin ();
+ i != this->map_.end ();
+ ++i)
+ {
+ // Deallocate the id.
+ delete (*i).ext_id_;
+
+ // Delete the chain of Map_Entries.
+ Map_Entry *entry = (*i).int_id_;
+ while (entry)
+ {
+ Map_Entry *next = entry->next;
+ delete entry;
+ entry = next;
+ }
+
+ }
+
+ this->map_.close ();
+}
+
+
+void
+TAO_Portable_Group_Map::add_groupid_objectkey_pair (
+ PortableGroup::TagGroupTaggedComponent *group_id,
+ const TAO::ObjectKey &key
+ ACE_ENV_ARG_DECL
+ )
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_);
+
+ Map_Entry *new_entry;
+
+ // We take ownership of the group_id memory. Be sure we don't
+ // forget about it.
+ PortableGroup::TagGroupTaggedComponent_var safe_group = group_id;
+
+ ACE_NEW_THROW_EX (new_entry,
+ Map_Entry (),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ // Fill out the entry.
+ new_entry->key = key;
+
+ // First, check if the GroupId is already in the map.
+ Map_Entry *entry;
+ if (this->map_.find (group_id,
+ entry) == 0)
+ {
+ // Add the object key to the list of object keys serviced by this GroupId.
+ new_entry->next = entry->next;
+ entry->next = new_entry;
+ }
+ else
+ {
+ new_entry->next = 0;
+
+ // Add the
+ int result =
+ this->map_.bind (group_id,
+ new_entry);
+
+ if (result != 0)
+ {
+ delete new_entry;
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ // Transfer ownership of group_id to the map.
+ (void) safe_group._retn ();
+ }
+}
+
+void
+TAO_Portable_Group_Map::remove_groupid_objectkey_pair (const PortableGroup::TagGroupTaggedComponent* /*group_id*/,
+ const TAO::ObjectKey &/*key*/
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+
+}
+
+
+void
+TAO_Portable_Group_Map::dispatch (PortableGroup::TagGroupTaggedComponent* group_id,
+ TAO_ORB_Core *orb_core,
+ TAO_ServerRequest &request,
+ CORBA::Object_out forward_to
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_);
+
+ // Look up the GroupId.
+ Map_Entry *entry = 0;
+ if (this->map_.find (group_id,
+ entry) == 0)
+ {
+
+ // Save the read pointer in the message block since
+ // every time we dispatch the request, we need to
+ // reset it so that the request demarshals correctly.
+ TAO_InputCDR *tao_in = request.incoming ();
+ ACE_Message_Block *msgblk =
+ const_cast<ACE_Message_Block *> (tao_in->start ());
+ char *read_ptr = msgblk->rd_ptr ();
+
+ // Iterate through the list of ObjectKeys.
+ while (entry)
+ {
+ orb_core->adapter_registry ()->dispatch (entry->key,
+ request,
+ forward_to
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Reset the read pointer in the message block.
+ msgblk->rd_ptr (read_ptr);
+ entry = entry->next;
+ }
+ }
+}
+
+u_long
+TAO_GroupId_Hash::operator () (const PortableGroup::TagGroupTaggedComponent *id) const
+{
+ u_long hash =
+ ACE::hash_pjw ((const char *) id->group_domain_id,
+ ACE_OS::strlen ((const char *) id->group_domain_id));
+
+ // Truncate the object_group_id in half for the has.
+ // Divide by one so that the ACE_U_LongLong representation
+ // will automatically cast down to a u_long
+ hash += (u_long) (id->object_group_id / 1);
+
+ hash += id->object_group_ref_version;
+
+ return hash;
+}
+
+int
+TAO_GroupId_Equal_To::operator () (
+ const PortableGroup::TagGroupTaggedComponent *lhs,
+ const PortableGroup::TagGroupTaggedComponent *rhs) const
+{
+ return
+ ACE_OS::strcmp (lhs->group_domain_id, rhs->group_domain_id) == 0
+ && lhs->object_group_id == rhs->object_group_id
+ && lhs->object_group_ref_version == rhs->object_group_ref_version;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/Portable_Group_Map.h b/TAO/orbsvcs/orbsvcs/PortableGroup/Portable_Group_Map.h
new file mode 100644
index 00000000000..c6c69ae9e11
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/Portable_Group_Map.h
@@ -0,0 +1,139 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Portable_Group_Map.h
+ *
+ * $Id$
+ *
+ * @author Frank Hunleth <fhunleth@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_PORTABLE_GROUP_MAP_H
+#define TAO_PORTABLE_GROUP_MAP_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroupC.h"
+
+#include "tao/Object_KeyC.h"
+
+#include "ace/Null_Mutex.h"
+#include "ace/Hash_Map_Manager_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ServerRequest;
+
+/**
+ * @class TAO_GroupId_Hash
+ *
+ * @brief Hashing class for Group Ids.
+ *
+ * Define the hash() method for Group Ids.
+ */
+class TAO_PortableGroup_Export TAO_GroupId_Hash
+{
+public:
+
+ /// Returns hash value.
+ u_long operator () (const PortableGroup::TagGroupTaggedComponent *id) const;
+};
+
+/**
+ * @class TAO_GroupId_Equal_To
+ *
+ * @brief Hashing class for Group Ids.
+ *
+ * Define the Equal_To () method for Object Ids.
+ */
+class TAO_PortableGroup_Export TAO_GroupId_Equal_To
+{
+public:
+
+ /// Returns 1 if equal.
+ int operator () (const PortableGroup::TagGroupTaggedComponent *lhs,
+ const PortableGroup::TagGroupTaggedComponent *rhs) const;
+};
+
+/**
+ * @class TAO_Portable_Group_Map
+ *
+ * @brief Map of GroupIds to ObjectKeys.
+ */
+class TAO_PortableGroup_Export TAO_Portable_Group_Map
+{
+public:
+
+ /**
+ * @struct Map_Entry
+ *
+ * @brief Value field of the portable group map.
+ */
+ struct Map_Entry
+ {
+ /// The key.
+ TAO::ObjectKey key;
+
+ /// next ObjectKey in the group.
+ struct Map_Entry *next;
+ };
+
+ /// Constructor.
+ TAO_Portable_Group_Map ();
+
+ /// Destructor.
+ ~TAO_Portable_Group_Map (void);
+
+ /// Add a GroupId->ObjectKey mapping to the map.
+ /// This function takes ownership of the memory pointed to be group_id
+ void add_groupid_objectkey_pair (PortableGroup::TagGroupTaggedComponent *group_id,
+ const TAO::ObjectKey &key
+ ACE_ENV_ARG_DECL);
+
+
+ /// Remove a GroupId->ObjectKey mapping from the map.
+ void remove_groupid_objectkey_pair (const PortableGroup::TagGroupTaggedComponent* group_id,
+ const TAO::ObjectKey &key
+ ACE_ENV_ARG_DECL);
+
+ /// Dispatch a request to all of the ObjectIds that belong to
+ /// the specified group.
+ void dispatch (PortableGroup::TagGroupTaggedComponent* group_id,
+ TAO_ORB_Core *orb_core,
+ TAO_ServerRequest &request,
+ CORBA::Object_out forward_to
+ ACE_ENV_ARG_DECL);
+
+ /// Id hash map.
+ typedef ACE_Hash_Map_Manager_Ex<
+ PortableGroup::TagGroupTaggedComponent *,
+ Map_Entry *,
+ TAO_GroupId_Hash,
+ TAO_GroupId_Equal_To,
+ ACE_Null_Mutex> GroupId_Table;
+ typedef GroupId_Table::iterator Iterator;
+
+protected:
+ /// Lock used to synchronize access to map_.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// Id map.
+ GroupId_Table map_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+//#if defined (__ACE_INLINE__)
+//# include "Portable_Group_Map.i"
+//#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_PORTABLE_GROUP_MAP_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/README b/TAO/orbsvcs/orbsvcs/PortableGroup/README
new file mode 100644
index 00000000000..7faf4cd6e46
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/README
@@ -0,0 +1,43 @@
+$Id$
+
+This directory contains an implementation of the MIOP specification
+for TAO. This currently includes:
+
+ . The UIPMC (Unreliable IP multicast) Pluggable Protocol
+ . The PortableGroup extensions to the POA
+ . Request dispatch hooks to TAO to dispatch based on GroupID
+
+For examples on how to use MIOP, see $TAO_ROOT/orbsvcs/tests/Miop.
+
+Compilation Note:
+
+The PortableGroup library requires the CosNaming library due to references
+to it in the IDL from the MIOP specification. It is not really used in
+actual implementation.
+
+Implementation Notes:
+
+The current MIOP implementation is usable, but not complete according
+to the final MIOP specification. The following are current limitations:
+
+ 1. MIOP packet reassembly. This limits requests to about 5-6K in length
+ depending on the platform. Miop packet segmentation is available,
+ but not completely tested.
+
+ 2. Disassociating a group reference from a servant is not implemented.
+ If interested in fixing this, be aware of the race conditions if a
+ servant disassociates during an upcall. The TAO event services all
+ have code to handle this issue.
+
+ 3. Clients must call _unchecked_narrow to narrow any group references
+ since a multicast group manager isn't supported yet (and UIPMC does
+ not support twoway invocations)
+
+ 4. TAO does not have a multicast group manager, so groups must be
+ assigned by creating a MIOP CORBALOC formatted reference. See
+ the tests or the MIOP specification for example group references.
+
+ 5. TAO does not have a multicast gateway implementation, so using MIOP
+ is currently limited to networks that natively support multicast
+
+
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp
new file mode 100644
index 00000000000..1b3377b9f19
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp
@@ -0,0 +1,354 @@
+// This may look like C, but it's really -*- C++ -*-
+//
+// $Id$
+
+#include "orbsvcs/PortableGroup/UIPMC_Profile.h"
+#include "orbsvcs/PortableGroup/UIPMC_Acceptor.h"
+
+#include "tao/MProfile.h"
+#include "tao/ORB_Core.h"
+#include "tao/debug.h"
+#include "tao/Protocols_Hooks.h"
+#include "tao/ORB_Constants.h"
+
+#include "ace/Auto_Ptr.h"
+#include "ace/os_include/os_netdb.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/PortableGroup/UIPMC_Acceptor.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (PortableGroup,
+ UIPMC_Acceptor,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_UIPMC_Acceptor::TAO_UIPMC_Acceptor (CORBA::Boolean /*flag*/)
+ : TAO_Acceptor (IOP::TAG_UIPMC),
+ addrs_ (0),
+ hosts_ (0),
+ endpoint_count_ (0),
+ version_ (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR),
+ orb_core_ (0),
+ connection_handler_ (0)
+{
+}
+
+TAO_UIPMC_Acceptor::~TAO_UIPMC_Acceptor (void)
+{
+ // Make sure we are closed before we start destroying the
+ // strategies.
+ this->close ();
+
+ delete [] this->addrs_;
+
+ for (size_t i = 0; i < this->endpoint_count_; ++i)
+ CORBA::string_free (this->hosts_[i]);
+
+ delete [] this->hosts_;
+}
+
+int
+TAO_UIPMC_Acceptor::create_profile (const TAO::ObjectKey &,
+ TAO_MProfile &,
+ CORBA::Short)
+{
+ // The standard mechanism for adding profiles to object references
+ // for each pluggable protocol doesn't apply to UIPMC profiles, so
+ // this function just returns success without doing anything. The
+ // appropiate mechanism for getting UIPMC profiles is to call the
+ // multicast group manager to get a Group reference. Invocations
+ // sent to this group reference will be dispatched to the servants
+ // that belong to that group.
+ return 0;
+}
+
+int
+TAO_UIPMC_Acceptor::is_collocated (const TAO_Endpoint *)
+{
+ // @@ Not clear how
+ // to best handle collation. For example, one servant could
+ // be collocated, but we still need to send the request out on
+ // the network to see if there are any other servants in the
+ // group.
+ return 0; // Not collocated
+}
+
+int
+TAO_UIPMC_Acceptor::close (void)
+{
+ return 0;
+}
+
+int
+TAO_UIPMC_Acceptor::open (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
+ int major,
+ int minor,
+ const char *address,
+ const char *options)
+{
+ this->orb_core_ = orb_core;
+
+ if (this->hosts_ != 0)
+ {
+ // The hostname cache has already been set!
+ // This is bad mojo, i.e. an internal TAO error.
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) ")
+ ACE_TEXT ("UIPMC_Acceptor::open - ")
+ ACE_TEXT ("hostname already set\n\n")),
+ -1);
+ }
+
+ if (address == 0)
+ return -1;
+
+ if (major >=0 && minor >= 0)
+ this->version_.set_version (static_cast<CORBA::Octet> (major),
+ static_cast<CORBA::Octet> (minor));
+ // Parse options
+ if (this->parse_options (options) == -1)
+ return -1;
+
+ ACE_INET_Addr addr;
+
+ const char *port_separator_loc = ACE_OS::strchr (address, ':');
+ const char *specified_hostname = 0;
+ char tmp_host[MAXHOSTNAMELEN + 1];
+
+ // Both host and port have to be specified.
+ if (addr.set (address) != 0)
+ return -1;
+
+ // Extract out just the host part of the address.
+ size_t len = port_separator_loc - address;
+ ACE_OS::memcpy (tmp_host, address, len);
+ tmp_host[len] = '\0';
+
+ specified_hostname = tmp_host;
+
+ this->endpoint_count_ = 1; // Only one hostname to store
+
+ ACE_NEW_RETURN (this->addrs_,
+ ACE_INET_Addr[this->endpoint_count_],
+ -1);
+
+ ACE_NEW_RETURN (this->hosts_,
+ char *[this->endpoint_count_],
+ -1);
+
+ this->hosts_[0] = 0;
+
+ if (this->hostname (orb_core,
+ addr,
+ this->hosts_[0],
+ specified_hostname) != 0)
+ return -1;
+
+ // Copy the addr. The port is (re)set in
+ // TAO_UIPMC_Acceptor::open_i().
+ if (this->addrs_[0].set (addr) != 0)
+ return -1;
+
+ return this->open_i (addr,
+ reactor);
+}
+
+int
+TAO_UIPMC_Acceptor::open_default (TAO_ORB_Core *,
+ ACE_Reactor *,
+ int,
+ int,
+ const char *)
+{
+ // There is no such thing as a default multicast listen
+ // port. The mechanism for choosing these ports is done
+ // when creating the group ids. (I.e. not here).
+ return -1;
+}
+
+int
+TAO_UIPMC_Acceptor::open_i (const ACE_INET_Addr& addr,
+ ACE_Reactor *reactor)
+{
+ ACE_NEW_RETURN (this->connection_handler_,
+ TAO_UIPMC_Connection_Handler (this->orb_core_),
+ -1);
+
+ this->connection_handler_->local_addr (addr);
+ this->connection_handler_->open_server ();
+
+ int result =
+ reactor->register_handler (this->connection_handler_,
+ ACE_Event_Handler::READ_MASK);
+ if (result == -1)
+ return result;
+
+ // Connection handler ownership now belongs to the Reactor.
+ this->connection_handler_->remove_reference ();
+
+ // Set the port for each addr. If there is more than one network
+ // interface then the endpoint created on each interface will be on
+ // the same port. This is how a wildcard socket bind() is supposed
+ // to work.
+ u_short port = addr.get_port_number ();
+ for (size_t j = 0; j < this->endpoint_count_; ++j)
+ this->addrs_[j].set_port_number (port, 1);
+
+ if (TAO_debug_level > 5)
+ {
+ for (size_t i = 0; i < this->endpoint_count_; ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nTAO (%P|%t) UIPMC_Acceptor::open_i - ")
+ ACE_TEXT ("listening on: <%s:%u>\n"),
+ this->hosts_[i],
+ this->addrs_[i].get_port_number ()));
+ }
+ }
+
+ return 0;
+}
+
+int
+TAO_UIPMC_Acceptor::hostname (TAO_ORB_Core *,
+ ACE_INET_Addr &addr,
+ char *&host,
+ const char *)
+{
+ // Only have dotted decimal addresses for multicast.
+ return this->dotted_decimal_address (addr, host);
+}
+
+int
+TAO_UIPMC_Acceptor::dotted_decimal_address (ACE_INET_Addr &addr,
+ char *&host)
+{
+ const char *tmp = addr.get_host_addr ();
+ if (tmp == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\n\nTAO (%P|%t) ")
+ ACE_TEXT ("UIPMC_Acceptor::dotted_decimal_address ")
+ ACE_TEXT ("- %p\n\n"),
+ ACE_TEXT ("cannot determine hostname")));
+ return -1;
+ }
+
+ host = CORBA::string_dup (tmp);
+ return 0;
+}
+
+CORBA::ULong
+TAO_UIPMC_Acceptor::endpoint_count (void)
+{
+ return this->endpoint_count_;
+}
+
+int
+TAO_UIPMC_Acceptor::object_key (IOP::TaggedProfile &,
+ TAO::ObjectKey &)
+{
+ // No object key to extract. Just return success.
+ return 1;
+}
+
+
+int
+TAO_UIPMC_Acceptor::parse_options (const char *str)
+{
+ if (str == 0)
+ return 0; // No options to parse. Not a problem.
+
+ // Use an option format similar to the one used for CGI scripts in
+ // HTTP URLs.
+ // e.g.: option1=foo&option2=bar
+
+ ACE_CString options (str);
+
+ size_t len = options.length ();
+
+ const char option_delimiter = '&';
+
+ // Count the number of options.
+
+ CORBA::ULong option_count = 1;
+ // Number of endpoints in the string (initialized to 1).
+
+ // Only check for endpoints after the protocol specification and
+ // before the object key.
+ for (size_t i = 0; i < len; ++i)
+ if (options[i] == option_delimiter)
+ ++option_count;
+
+ // The idea behind the following loop is to split the options into
+ // (option, name) pairs.
+ // For example,
+ // `option1=foo&option2=bar'
+ // will be parsed into:
+ // `option1=foo'
+ // `option2=bar'
+
+ ACE_CString::size_type begin = 0;
+ ACE_CString::size_type end = 0;
+
+ for (CORBA::ULong j = 0; j < option_count; ++j)
+ {
+ if (j < option_count - 1)
+ end = options.find (option_delimiter, begin);
+ else
+ end = len;
+
+ if (end == begin)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Zero length UIPMC option.\n")),
+ -1);
+ else if (end != ACE_CString::npos)
+ {
+ ACE_CString opt = options.substring (begin, end);
+
+ ACE_CString::size_type const slot = opt.find ("=");
+
+ if (slot == len - 1
+ || slot == ACE_CString::npos)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) UIPMC option <%s> is ")
+ ACE_TEXT ("missing a value.\n"),
+ opt.c_str ()),
+ -1);
+
+ ACE_CString name = opt.substring (0, slot);
+ ACE_CString value = opt.substring (slot + 1);
+
+ if (name.length () == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Zero length UIPMC ")
+ ACE_TEXT ("option name.\n")),
+ -1);
+
+ if (name == "priority")
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Invalid UIPMC endpoint format: ")
+ ACE_TEXT ("endpoint priorities no longer supported. \n"),
+ value.c_str ()),
+ -1);
+ }
+ else
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Invalid UIPMC option: <%s>\n"),
+ name.c_str ()),
+ -1);
+
+ begin = end + 1;
+ }
+ else
+ break; // No other options.
+ }
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.h
new file mode 100644
index 00000000000..6c783e885c1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.h
@@ -0,0 +1,160 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file UIPMC_Acceptor.h
+ *
+ * $Id$
+ *
+ * MIOP specific acceptor processing
+ *
+ * @author Frank Hunleth <fhunleth@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_UIPMC_ACCEPTOR_H
+#define TAO_UIPMC_ACCEPTOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/UIPMC_Connection_Handler.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Transport_Acceptor.h"
+#include "tao/Acceptor_Impl.h"
+#include "tao/GIOP_Message_State.h"
+
+#include "ace/Acceptor.h"
+#include "ace/SOCK_Acceptor.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// TAO UIPMC_Acceptor concrete call defination
+
+/**
+ * @class TAO_UIPMC_Acceptor
+ *
+ * @brief TAO_UIPMC_Acceptor
+ *
+ * The UIPMC-specific bridge class for the concrete acceptor.
+ */
+class TAO_PortableGroup_Export TAO_UIPMC_Acceptor : public TAO_Acceptor
+{
+public:
+ /// Constructor.
+ TAO_UIPMC_Acceptor (CORBA::Boolean flag = 0);
+
+ /// Destructor.
+ ~TAO_UIPMC_Acceptor (void);
+
+ /// @@ Helper method for the implementation repository, should go
+ /// away
+ const ACE_INET_Addr& address (void) const;
+
+ /// Returns the array of endpoints in this acceptor
+ const ACE_INET_Addr *endpoints (void);
+
+ /**
+ * The TAO_Acceptor methods, check the documentation in
+ * Pluggable.h for details.
+ */
+ virtual int open (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
+ int version_major,
+ int version_minor,
+ const char *address,
+ const char *options = 0);
+ virtual int open_default (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
+ int version_major,
+ int version_minor,
+ const char *options = 0);
+ virtual int close (void);
+ virtual int create_profile (const TAO::ObjectKey &object_key,
+ TAO_MProfile &mprofile,
+ CORBA::Short priority);
+ virtual int is_collocated (const TAO_Endpoint *endpoint);
+ virtual CORBA::ULong endpoint_count (void);
+
+ virtual int object_key (IOP::TaggedProfile &profile,
+ TAO::ObjectKey &key);
+
+ /**
+ * Set the host name for the given addr.
+ * A hostname may be forced by using specified_hostname. This
+ * is useful if the given address corresponds to more than one
+ * hostname and the desired one cannot be determined in any
+ * other way.
+ */
+ int hostname (TAO_ORB_Core *orb_core,
+ ACE_INET_Addr &addr,
+ char *&host,
+ const char *specified_hostname = 0);
+
+ /**
+ * Set the host name for the given address using the dotted decimal
+ * format.
+ */
+ int dotted_decimal_address (ACE_INET_Addr &addr,
+ char *&host);
+
+protected:
+
+ /**
+ * Implement the common part of the open*() methods. This method is
+ * virtual to allow a derived class implementation to be invoked
+ * instead.
+ */
+ virtual int open_i (const ACE_INET_Addr &addr,
+ ACE_Reactor *reactor);
+
+ /// Parse protocol specific options.
+ virtual int parse_options (const char *options);
+
+protected:
+
+ /// Array of ACE_INET_Addr instances, each one corresponding to a
+ /// given network interface.
+ ACE_INET_Addr *addrs_;
+
+ /**
+ * Cache the information about the endpoints serviced by this
+ * acceptor.
+ * There may in fact be multiple hostnames for this endpoint. For
+ * example, if the IP address is INADDR_ANY (0.0.0.0) then there
+ * will be possibly a different hostname for each interface.
+ */
+ char **hosts_;
+
+ /// The number of host names cached in the hosts_ array (equivalent
+ /// to the number of endpoints opened by this Acceptor).
+ CORBA::ULong endpoint_count_;
+
+ /**
+ * The GIOP version for this endpoint
+ * @@ Theoretically this shouldn't be here!! We need to look at a
+ * way to move this out
+ */
+ TAO_GIOP_Message_Version version_;
+
+ /// ORB Core.
+ TAO_ORB_Core *orb_core_;
+
+private:
+
+ TAO_UIPMC_Connection_Handler *connection_handler_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/PortableGroup/UIPMC_Acceptor.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_UIPMC_ACCEPTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.i b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.i
new file mode 100644
index 00000000000..ec296d0f9b6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.i
@@ -0,0 +1,29 @@
+// -*- C++ -*-
+//
+// $Id$
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE const ACE_INET_Addr&
+TAO_UIPMC_Acceptor::address (void) const
+{
+ ACE_ASSERT (this->addrs_ != 0);
+
+ // @@ This is busted.
+ // The Implementation Repository will have to start supporting
+ // IORs with multiple profiles. For now, we just return the
+ // first addr.
+ // -Ossama
+ return this->addrs_[0];
+}
+
+ACE_INLINE const ACE_INET_Addr *
+TAO_UIPMC_Acceptor::endpoints (void)
+{
+ ACE_ASSERT (this->addrs_ != 0);
+
+ return this->addrs_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp
new file mode 100644
index 00000000000..df2fbd006c7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp
@@ -0,0 +1,267 @@
+// This may look like C, but it's really -*- C++ -*-
+//
+// $Id$
+
+
+#include "orbsvcs/PortableGroup/UIPMC_Connection_Handler.h"
+#include "orbsvcs/PortableGroup/UIPMC_Transport.h"
+#include "orbsvcs/PortableGroup/UIPMC_Endpoint.h"
+
+#include "tao/Timeprobe.h"
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+#include "tao/ORB.h"
+#include "tao/CDR.h"
+#include "tao/Server_Strategy_Factory.h"
+#include "tao/Transport_Cache_Manager.h"
+#include "tao/Thread_Lane_Resources.h"
+#include "tao/Base_Transport_Property.h"
+#include "tao/Resume_Handle.h"
+
+
+ACE_RCSID(PortableGroup,
+ UIPMC_Connection_Handler,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_UIPMC_Connection_Handler::TAO_UIPMC_Connection_Handler (ACE_Thread_Manager *t)
+ : TAO_UIPMC_SVC_HANDLER (t, 0 , 0),
+ TAO_Connection_Handler (0),
+ udp_socket_ (ACE_sap_any_cast (ACE_INET_Addr &)),
+ mcast_socket_ (),
+ using_mcast_ (0)
+{
+ // This constructor should *never* get called, it is just here to
+ // make the compiler happy: the default implementation of the
+ // Creation_Strategy requires a constructor with that signature, we
+ // don't use that implementation, but some (most?) compilers
+ // instantiate it anyway.
+ ACE_ASSERT (0);
+}
+
+
+TAO_UIPMC_Connection_Handler::TAO_UIPMC_Connection_Handler (TAO_ORB_Core *orb_core)
+ : TAO_UIPMC_SVC_HANDLER (orb_core->thr_mgr (), 0, 0),
+ TAO_Connection_Handler (orb_core),
+ udp_socket_ (ACE_sap_any_cast (ACE_INET_Addr &)),
+ mcast_socket_ (),
+ using_mcast_ (0)
+{
+ TAO_UIPMC_Transport* specific_transport = 0;
+ ACE_NEW(specific_transport,
+ TAO_UIPMC_Transport(this, orb_core, 0));
+
+ // store this pointer (indirectly increment ref count)
+ this->transport (specific_transport);
+}
+
+
+TAO_UIPMC_Connection_Handler::~TAO_UIPMC_Connection_Handler (void)
+{
+ if (this->using_mcast_)
+ {
+ // Closing a multicast socket automatically unsubscribes us from
+ // the multicast group.
+ this->mcast_socket_.close ();
+ }
+ else
+ this->udp_socket_.close ();
+
+ delete this->transport ();
+}
+
+ACE_HANDLE
+TAO_UIPMC_Connection_Handler::get_handle (void) const
+{
+ if (this->using_mcast_)
+ return this->mcast_socket_.get_handle ();
+ else
+ return this->udp_socket_.get_handle ();
+}
+
+const ACE_INET_Addr &
+TAO_UIPMC_Connection_Handler::addr (void)
+{
+ return this->addr_;
+}
+
+
+void
+TAO_UIPMC_Connection_Handler::addr (const ACE_INET_Addr &addr)
+{
+ this->addr_ = addr;
+}
+
+
+const ACE_INET_Addr &
+TAO_UIPMC_Connection_Handler::local_addr (void)
+{
+ return local_addr_;
+}
+
+
+void
+TAO_UIPMC_Connection_Handler::local_addr (const ACE_INET_Addr &addr)
+{
+ local_addr_ = addr;
+}
+
+
+const ACE_SOCK_Dgram &
+TAO_UIPMC_Connection_Handler::dgram (void)
+{
+ return this->udp_socket_;
+}
+
+const ACE_SOCK_Dgram_Mcast &
+TAO_UIPMC_Connection_Handler::mcast_dgram (void)
+{
+ return this->mcast_socket_;
+}
+
+
+int
+TAO_UIPMC_Connection_Handler::open_handler (void *v)
+{
+ return this->open (v);
+}
+
+int
+TAO_UIPMC_Connection_Handler::open (void*)
+{
+ this->udp_socket_.open (this->local_addr_);
+
+ if(TAO_debug_level > 5)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("TAO (%P|%t) TAO_UIPMC_Connection_Handler::open, ")
+ ACE_TEXT("listening on: <%s:%u>\n"),
+ this->local_addr_.get_host_addr (),
+ this->local_addr_.get_port_number ()));
+ }
+
+ this->using_mcast_ = 0;
+
+ // Set that the transport is now connected, if fails we return -1
+ // Use C-style cast b/c otherwise we get warnings on lots of
+ // compilers
+ if (!this->transport ()->post_open ((size_t) this->udp_socket_.get_handle ()))
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_UIPMC_Connection_Handler::open_server (void)
+{
+ this->mcast_socket_.join (this->local_addr_);
+ if( TAO_debug_level > 5)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("TAO (%P|%t) TAO_UIPMC_Connection_Handler::open_server, ")
+ ACE_TEXT("subcribed to multicast group at %s:%d\n"),
+ this->local_addr_.get_host_addr (),
+ this->local_addr_.get_port_number ()
+ ));
+ }
+
+ this->transport ()->id ((size_t) this->mcast_socket_.get_handle ());
+ this->using_mcast_ = 1;
+
+ return 0;
+}
+
+int
+TAO_UIPMC_Connection_Handler::resume_handler (void)
+{
+ return ACE_Event_Handler::ACE_APPLICATION_RESUMES_HANDLER;
+}
+
+int
+TAO_UIPMC_Connection_Handler::close_connection (void)
+{
+ return this->close_connection_eh (this);
+}
+
+int
+TAO_UIPMC_Connection_Handler::handle_input (ACE_HANDLE h)
+{
+ return this->handle_input_eh (h, this);
+}
+
+int
+TAO_UIPMC_Connection_Handler::handle_output (ACE_HANDLE handle)
+{
+ int result =
+ this->handle_output_eh (handle, this);
+
+ if (result == -1)
+ {
+ this->close_connection ();
+ return 0;
+ }
+
+ return result;
+}
+
+int
+TAO_UIPMC_Connection_Handler::handle_timeout (const ACE_Time_Value &,
+ const void *)
+{
+ // We don't use this upcall for I/O. This is only used by the
+ // Connector to indicate that the connection timedout. Therefore,
+ // we should call close().
+ return this->close ();
+}
+
+int
+TAO_UIPMC_Connection_Handler::handle_close (ACE_HANDLE,
+ ACE_Reactor_Mask)
+{
+ // No asserts here since the handler is registered with the Reactor
+ // and the handler ownership is given to the Reactor. When the
+ // Reactor closes, it will call handle_close() on the handler. It
+ // is however important to overwrite handle_close() to do nothing
+ // since the base class does too much.
+ return 0;
+}
+
+int
+TAO_UIPMC_Connection_Handler::close (u_long)
+{
+ this->state_changed (TAO_LF_Event::LFS_CONNECTION_CLOSED,
+ this->orb_core ()->leader_follower ());
+ this->transport ()->remove_reference ();
+ return 0;
+}
+
+int
+TAO_UIPMC_Connection_Handler::release_os_resources (void)
+{
+ return this->peer().close ();
+}
+
+int
+TAO_UIPMC_Connection_Handler::add_transport_to_cache (void)
+{
+ ACE_INET_Addr addr;
+
+ // This function is called by the acceptor to add this
+ // transport to the transport cache. This is really
+ // important for proper shutdown. The address used
+ // is irrelevent, since UIPMC is connectionless.
+
+ // Construct a UIPMC_Endpoint object.
+ TAO_UIPMC_Endpoint endpoint (addr);
+
+ // Construct a property object
+ TAO_Base_Transport_Property prop (&endpoint);
+
+ // Add the handler to Cache
+ return this->orb_core ()->lane_resources ()
+ .transport_cache ().cache_transport (&prop,
+ this->transport ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.h
new file mode 100644
index 00000000000..51153c2d196
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.h
@@ -0,0 +1,149 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file UIPMC_Connection_Handler.h
+ *
+ * $Id$
+ *
+ * @author Frank Hunleth <fhunleth@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_UIPMC_CONNECTION_HANDLER_H
+#define TAO_UIPMC_CONNECTION_HANDLER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroup/UIPMC_Transport.h"
+
+#include "tao/Wait_Strategy.h"
+#include "tao/Connection_Handler.h"
+
+#include "ace/Acceptor.h"
+#include "ace/Reactor.h"
+#include "ace/SOCK_Dgram_Mcast.h"
+#include "ace/SOCK_Dgram.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward Decls
+class TAO_Pluggable_Messaging;
+
+// ****************************************************************
+
+/**
+ * @class TAO_UIPMC_Connection_Handler
+ *
+ * @brief Handles requests on a single connection.
+ *
+ * The Connection handler which is common for the Acceptor and
+ * the Connector
+ */
+class TAO_PortableGroup_Export TAO_UIPMC_Connection_Handler :
+ public TAO_UIPMC_SVC_HANDLER,
+ public TAO_Connection_Handler
+{
+
+public:
+
+ TAO_UIPMC_Connection_Handler (ACE_Thread_Manager* t = 0);
+
+ /// Constructor. <arg> parameter is used by the Acceptor to pass the
+ /// protocol configuration properties for this connection.
+ TAO_UIPMC_Connection_Handler (TAO_ORB_Core *orb_core);
+
+
+ /// Destructor.
+ ~TAO_UIPMC_Connection_Handler (void);
+
+ //@{
+ /** @name Connection Handler overloads
+ */
+ virtual int open_handler (void *v);
+ //@}
+
+ // @@ Frank: Similar to open, but called on server
+ virtual int open_server (void);
+
+ /// Close called by the Acceptor or Connector when connection
+ /// establishment fails.
+ int close (u_long = 0);
+
+ //@{
+ /** @name Event Handler overloads
+ */
+ virtual int resume_handler (void);
+ virtual int close_connection (void);
+ virtual int handle_input (ACE_HANDLE);
+ virtual int handle_output (ACE_HANDLE);
+ virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask);
+ virtual int handle_timeout (const ACE_Time_Value &current_time,
+ const void *act = 0);
+ virtual int open (void *);
+ //@}
+
+ /// Add ourselves to Cache.
+ int add_transport_to_cache (void);
+
+ // UIPMC Additions - Begin
+ ACE_HANDLE get_handle (void) const;
+
+ const ACE_INET_Addr &addr (void);
+
+ void addr (const ACE_INET_Addr &addr);
+
+ const ACE_INET_Addr &local_addr (void);
+
+ void local_addr (const ACE_INET_Addr &addr);
+
+ const ACE_INET_Addr &server_addr (void);
+
+ void server_addr (const ACE_INET_Addr &addr);
+
+ const ACE_SOCK_Dgram &dgram (void);
+
+ const ACE_SOCK_Dgram_Mcast &mcast_dgram (void);
+ // UIPMC Additions - End
+
+protected:
+
+ // UIPMC Additions - Begin
+
+ /// Client side UDP socket (send only).
+ ACE_SOCK_Dgram udp_socket_;
+
+ /// Server side Mcast UDP socket (receive only).
+ ACE_SOCK_Dgram_Mcast mcast_socket_;
+
+ /// Flag that specifies whether multicast is in use or not.
+ CORBA::Boolean using_mcast_;
+
+ // This is always the remote address
+ ACE_INET_Addr addr_;
+
+ // This is always the local address for the connector
+ ACE_INET_Addr local_addr_;
+
+ // UIPMC Additions - End
+
+ //@{
+ /**
+ * @name TAO_Connection Handler overloads
+ */
+ virtual int release_os_resources (void);
+ //@}
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_UIPMC_CONNECTION_HANDLER_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.cpp
new file mode 100644
index 00000000000..30f909e93e4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.cpp
@@ -0,0 +1,215 @@
+// $Id$
+
+#include "orbsvcs/PortableGroup/UIPMC_Profile.h"
+#include "orbsvcs/PortableGroup/UIPMC_Connector.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+#include "tao/Environment.h"
+#include "tao/Base_Transport_Property.h"
+#include "tao/Protocols_Hooks.h"
+
+#include "ace/Connector.h"
+#include "ace/OS_NS_strings.h"
+
+ACE_RCSID (PortableGroup,
+ UIPMC_Connector, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_UIPMC_Connector::TAO_UIPMC_Connector (CORBA::Boolean)
+ : TAO_Connector (IOP::TAG_UIPMC)
+{
+}
+
+TAO_UIPMC_Connector::~TAO_UIPMC_Connector (void)
+{
+}
+
+int
+TAO_UIPMC_Connector::open (TAO_ORB_Core *orb_core)
+{
+ this->orb_core (orb_core);
+
+ // For the sake of uniformity do
+ if (this->create_connect_strategy () == -1)
+ return -1;
+
+ // @@ Michael: We do not use traditional connection management.
+
+ return 0;
+}
+
+int
+TAO_UIPMC_Connector::close (void)
+{
+ SvcHandlerIterator iter (svc_handler_table_);
+
+ while (!iter.done ())
+ {
+ (*iter).int_id_->remove_reference ();
+ iter++;
+ }
+
+ return 0;
+}
+
+int
+TAO_UIPMC_Connector::set_validate_endpoint (TAO_Endpoint *endpoint)
+{
+ if (endpoint->tag () != IOP::TAG_UIPMC)
+ return -1;
+
+ TAO_UIPMC_Endpoint *uipmc_endpoint =
+ dynamic_cast<TAO_UIPMC_Endpoint *> (endpoint );
+
+ if (uipmc_endpoint == 0)
+ return -1;
+
+ const ACE_INET_Addr &remote_address =
+ uipmc_endpoint->object_addr ();
+
+ // Verify that the remote ACE_INET_Addr was initialized properly.
+ // Failure can occur if hostname lookup failed when initializing the
+ // remote ACE_INET_Addr.
+ if (remote_address.get_type () != AF_INET)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) UIPMC connection failed.\n")
+ ACE_TEXT ("TAO (%P|%t) This is most likely ")
+ ACE_TEXT ("due to a hostname lookup ")
+ ACE_TEXT ("failure.\n")));
+ }
+
+ return -1;
+ }
+
+ return 0;
+}
+
+TAO_Transport *
+TAO_UIPMC_Connector::make_connection (TAO::Profile_Transport_Resolver *,
+ TAO_Transport_Descriptor_Interface &desc,
+ ACE_Time_Value *)
+{
+ TAO_UIPMC_Endpoint *uipmc_endpoint =
+ dynamic_cast<TAO_UIPMC_Endpoint *> (desc.endpoint ());
+
+ if (uipmc_endpoint == 0)
+ return 0;
+
+ const ACE_INET_Addr &remote_address =
+ uipmc_endpoint->object_addr ();
+
+ TAO_UIPMC_Connection_Handler *svc_handler = 0;
+
+ if (this->svc_handler_table_.find (remote_address, svc_handler) == -1)
+ {
+ TAO_UIPMC_Connection_Handler *svc_handler_i = 0;
+ ACE_NEW_RETURN (svc_handler_i,
+ TAO_UIPMC_Connection_Handler (this->orb_core ()),
+ 0);
+
+ svc_handler_i->local_addr (ACE_sap_any_cast (ACE_INET_Addr &));
+ svc_handler_i->addr (remote_address);
+
+ svc_handler_i->open (0);
+
+ svc_handler_table_.bind (remote_address,
+ svc_handler_i);
+ svc_handler = svc_handler_i;
+
+ if (TAO_debug_level > 2)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) UIPMC_Connector::make_connection, ")
+ ACE_TEXT ("new connection on HANDLE %d\n"),
+ svc_handler->get_handle ()));
+ }
+
+ // @@ Michael: We do not use traditional connection management.
+ svc_handler->add_reference ();
+
+ return svc_handler->transport ();
+}
+
+
+TAO_Profile *
+TAO_UIPMC_Connector::create_profile (TAO_InputCDR& cdr)
+{
+ TAO_Profile *pfile;
+ ACE_NEW_RETURN (pfile,
+ TAO_UIPMC_Profile (this->orb_core ()),
+ 0);
+
+ int r = pfile->decode (cdr);
+ if (r == -1)
+ {
+ pfile->_decr_refcnt ();
+ pfile = 0;
+ }
+
+ return pfile;
+}
+
+TAO_Profile *
+TAO_UIPMC_Connector::make_profile (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // The endpoint should be of the form:
+ // N.n@host:port/object_key
+ // or:
+ // host:port/object_key
+
+ TAO_Profile *profile = 0;
+ ACE_NEW_THROW_EX (profile,
+ TAO_UIPMC_Profile (this->orb_core ()),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ return profile;
+}
+
+int
+TAO_UIPMC_Connector::check_prefix (const char *endpoint)
+{
+ // Check for a valid string
+ if (!endpoint || !*endpoint)
+ return -1; // Failure
+
+ static const char protocol[] = "miop";
+ static size_t const len = sizeof (protocol) - 1;
+
+ size_t const slot = ACE_OS::strchr (endpoint, ':') - endpoint;
+
+ // Check for the proper prefix in the IOR. If the proper prefix
+ // isn't in the IOR then it is not an IOR we can use.
+ if (slot == len
+ && ACE_OS::strncasecmp (endpoint, protocol, len) == 0)
+ return 0;
+
+ return -1;
+ // Failure: not a MIOP IOR
+ // DO NOT throw an exception here.
+}
+
+char
+TAO_UIPMC_Connector::object_key_delimiter (void) const
+{
+ return TAO_UIPMC_Profile::object_key_delimiter_;
+}
+
+int
+TAO_UIPMC_Connector::cancel_svc_handler (
+ TAO_Connection_Handler * /* svc_handler */)
+{
+ // Noop
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.h
new file mode 100644
index 00000000000..43357053bd2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.h
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file UIPMC_Connector.h
+ *
+ * $Id$
+ *
+ * MIOP specific connector processing.
+ *
+ * @author Frank Hunleth <fhunleth@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_UIPMC_CONNECTOR_H
+#define TAO_UIPMC_CONNECTOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroup/UIPMC_Connection_Handler.h"
+
+#include "tao/Transport_Connector.h"
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// ****************************************************************
+
+/**
+ * @class TAO_UIPMC_Connector
+ *
+ * @brief UIPMC-specific Connector bridge for pluggable protocols.
+ *
+ * Concrete instance of the TAO_Connector class. Responsible
+ * for establishing a connection with a server and is called from the
+ * Connector_Registory.
+ */
+class TAO_PortableGroup_Export TAO_UIPMC_Connector : public TAO_Connector
+{
+public:
+ // = Initialization and termination methods.
+ /// Constructor.
+ TAO_UIPMC_Connector (CORBA::Boolean flag = 0);
+
+ /// Destructor.
+ ~TAO_UIPMC_Connector (void);
+
+ // = The TAO_Connector methods, please check the documentation on
+ // Transport_Connector.h
+ int open (TAO_ORB_Core *orb_core);
+ int close (void);
+ TAO_Profile *create_profile (TAO_InputCDR& cdr);
+
+ virtual int check_prefix (const char *endpoint);
+
+ virtual char object_key_delimiter (void) const;
+
+protected:
+ /// = More TAO_Connector methods, please check the documentation on
+ /// Transport_Connector.h
+ int set_validate_endpoint (TAO_Endpoint *endpoint);
+
+ TAO_Transport *make_connection (TAO::Profile_Transport_Resolver *r,
+ TAO_Transport_Descriptor_Interface &desc,
+ ACE_Time_Value *timeout = 0);
+
+ virtual TAO_Profile * make_profile (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Cancel the passed cvs handler from the connector
+ virtual int cancel_svc_handler (TAO_Connection_Handler * svc_handler);
+
+private:
+ // @@ Michael: UDP Addition
+ ACE_Hash_Map_Manager_Ex < ACE_INET_Addr,
+ TAO_UIPMC_Connection_Handler *,
+ ACE_Hash < ACE_INET_Addr >,
+ ACE_Equal_To < ACE_INET_Addr >,
+ ACE_Null_Mutex >
+ svc_handler_table_;
+
+ typedef ACE_Hash_Map_Iterator_Ex < ACE_INET_Addr,
+ TAO_UIPMC_Connection_Handler *,
+ ACE_Hash < ACE_INET_Addr >,
+ ACE_Equal_To < ACE_INET_Addr >,
+ ACE_Null_Mutex >
+ SvcHandlerIterator;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_UIPMC_CONNECTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.cpp
new file mode 100644
index 00000000000..056cfd741b6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.cpp
@@ -0,0 +1,150 @@
+// $Id$
+
+#include "orbsvcs/PortableGroup/UIPMC_Endpoint.h"
+#include "orbsvcs/PortableGroup/UIPMC_Profile.h"
+
+#include "tao/debug.h"
+#include "ace/Guard_T.h"
+#include "tao/ORB_Constants.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_Memory.h"
+
+ACE_RCSID (tao,
+ UIPMC_Endpoint,
+ "$Id$")
+
+
+#if !defined (__ACE_INLINE__)
+# include "orbsvcs/PortableGroup/UIPMC_Endpoint.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_UIPMC_Endpoint::TAO_UIPMC_Endpoint (void)
+ : TAO_Endpoint (IOP::TAG_UIPMC),
+ object_addr_ (),
+ next_ (0)
+{
+}
+
+
+TAO_UIPMC_Endpoint::TAO_UIPMC_Endpoint (const ACE_INET_Addr &addr)
+ : TAO_Endpoint (IOP::TAG_UIPMC),
+ object_addr_ (addr),
+ next_ (0)
+{
+ this->object_addr (addr);
+}
+
+TAO_UIPMC_Endpoint::TAO_UIPMC_Endpoint (const CORBA::Octet class_d_address[4],
+ CORBA::UShort port)
+ : TAO_Endpoint (IOP::TAG_UIPMC),
+ port_ (port),
+ next_ (0)
+{
+ for (int i = 0; i<4; i++)
+ this->class_d_address_[i] = class_d_address[i];
+
+ this->update_object_addr ();
+}
+
+
+TAO_UIPMC_Endpoint::~TAO_UIPMC_Endpoint (void)
+{
+
+}
+
+void
+TAO_UIPMC_Endpoint::object_addr (const ACE_INET_Addr &addr)
+{
+ this->port_ = addr.get_port_number();
+ this->uint_ip_addr (addr.get_ip_address ());
+
+ this->object_addr_.set (addr);
+}
+
+const char *
+TAO_UIPMC_Endpoint::get_host_addr (void) const
+{
+ return this->object_addr_.get_host_addr ();
+}
+
+
+int
+TAO_UIPMC_Endpoint::addr_to_string (char *buffer, size_t length)
+{
+ size_t actual_len =
+ 15 // chars in dotted decimal addr
+ + sizeof (':') // delimiter
+ + 5 // max port
+ + sizeof ('\0');
+
+ if (length < actual_len)
+ return -1;
+
+ ACE_OS::sprintf (buffer, "%d.%d.%d.%d:%d",
+ this->class_d_address_[0],
+ this->class_d_address_[1],
+ this->class_d_address_[2],
+ this->class_d_address_[3],
+ this->port_);
+
+ return 0;
+}
+
+TAO_Endpoint *
+TAO_UIPMC_Endpoint::next (void)
+{
+ return this->next_;
+}
+
+TAO_Endpoint *
+TAO_UIPMC_Endpoint::duplicate (void)
+{
+ TAO_UIPMC_Endpoint *endpoint = 0;
+
+ ACE_NEW_RETURN (endpoint,
+ TAO_UIPMC_Endpoint (this->object_addr_),
+ 0);
+
+ return endpoint;
+}
+
+CORBA::Boolean
+TAO_UIPMC_Endpoint::is_equivalent (const TAO_Endpoint *other_endpoint)
+{
+ TAO_Endpoint *endpt = const_cast<TAO_Endpoint *> (other_endpoint);
+
+ TAO_UIPMC_Endpoint *endpoint = dynamic_cast<TAO_UIPMC_Endpoint *> (endpt);
+ if (endpoint == 0)
+ return 0;
+
+ return
+ this->port_ == endpoint->port_
+ && ACE_OS::memcmp (this->class_d_address_, endpoint->class_d_address_, 4) == 0;
+}
+
+CORBA::ULong
+TAO_UIPMC_Endpoint::hash (void)
+{
+ if (this->hash_val_ != 0)
+ return this->hash_val_;
+
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->addr_lookup_lock_,
+ this->hash_val_);
+ // .. DCL
+ if (this->hash_val_ != 0)
+ return this->hash_val_;
+
+ this->hash_val_ =
+ this->uint_ip_addr () + this->port_;
+ }
+
+ return this->hash_val_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.h
new file mode 100644
index 00000000000..3c137d6c9ef
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.h
@@ -0,0 +1,129 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file UIPMC_Endpoint.h
+ *
+ * $Id$
+ *
+ * UIPMC implementation of PP Framework Endpoint interface.
+ *
+ * @author Frank Hunleth <fhunleth@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_UIPMC_ENDPOINT_H
+#define TAO_UIPMC_ENDPOINT_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/Endpoint.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/INET_Addr.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_UIPMC_Endpoint
+ *
+ * @brief TAO_UIPMC_Endpoint
+ *
+ * UIPMC-specific implementation of PP Framework Endpoint interface.
+ */
+class TAO_PortableGroup_Export TAO_UIPMC_Endpoint : public TAO_Endpoint
+{
+public:
+ // = Initialization and termination methods.
+
+ /// Default constructor.
+ TAO_UIPMC_Endpoint (void);
+
+ /// Constructor.
+ TAO_UIPMC_Endpoint (const ACE_INET_Addr &addr);
+
+ /// Constructor. @@ Frank - deprecate this.
+ TAO_UIPMC_Endpoint (const CORBA::Octet class_d_address[4],
+ CORBA::UShort port);
+
+ /// Destructor.
+ ~TAO_UIPMC_Endpoint (void);
+
+ // = Implementation of abstract TAO_Endpoint methods. See
+ // Endpoint.h for their documentation.
+
+ virtual TAO_Endpoint *next (void);
+ virtual int addr_to_string (char *buffer, size_t length);
+
+ /// Makes a copy of <this>
+ virtual TAO_Endpoint *duplicate (void);
+
+ /// Return true if this endpoint is equivalent to <other_endpoint>. Two
+ /// endpoints are equivalent iff their port and host are the same.
+ CORBA::Boolean is_equivalent (const TAO_Endpoint *other_endpoint);
+
+ /// Return a hash value for this object.
+ CORBA::ULong hash (void);
+
+ // Allocates memory and returns a copy of <this>
+
+ // = UIPMC_Endpoint-specific methods.
+
+ /// Return a reference to the <object_addr>.
+ const ACE_INET_Addr &object_addr (void) const;
+
+ /// Set the IP multicast address and port.
+ void object_addr (const ACE_INET_Addr &addr);
+
+ /// Return a pointer to the stringified host address (not including the
+ /// port). This class retains ownership of the address memory.
+ const char *get_host_addr (void) const;
+
+ /// Return the port number.
+ CORBA::UShort port (void) const;
+
+ /// Set the port number.
+ CORBA::UShort port (CORBA::UShort p); //@@ Frank - deprecate this.
+
+ //TAO_UIPMC_Connection_Handler *&hint (void);
+ // Access to our <hint_>.
+
+
+private:
+
+ /// Helper methods for getting and setting the IP address.
+ ACE_UINT32 uint_ip_addr (void) const;
+ void uint_ip_addr (ACE_UINT32 ip_addr);
+
+ /// Helper method to update the cached object address.
+ void update_object_addr (void);
+
+ /// IP Multicast address. @@ Frank - deprecate this.
+ CORBA::Octet class_d_address_[4];
+
+ /// UDP port number. @@ Frank - deprecate this.
+ CORBA::UShort port_;
+
+ /// Cached instance of <ACE_INET_Addr> for use in making
+ /// invocations, etc.
+ ACE_INET_Addr object_addr_;
+
+ /// UIPMC Endpoints can be stringed into a list. Return the next
+ /// endpoint in the list, if any.
+ TAO_UIPMC_Endpoint *next_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+# include "orbsvcs/PortableGroup/UIPMC_Endpoint.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_UIPMC_PROFILE_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.i b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.i
new file mode 100644
index 00000000000..7d91cc4d459
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.i
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE const ACE_INET_Addr &
+TAO_UIPMC_Endpoint::object_addr (void) const
+{
+ return this->object_addr_;
+}
+
+
+ACE_INLINE CORBA::UShort
+TAO_UIPMC_Endpoint::port (void) const
+{
+ return this->port_;
+}
+
+ACE_INLINE CORBA::UShort
+TAO_UIPMC_Endpoint::port (CORBA::UShort p)
+{
+ return this->port_ = p;
+}
+
+
+ACE_INLINE ACE_UINT32
+TAO_UIPMC_Endpoint::uint_ip_addr (void) const
+{
+ return (((ACE_UINT32)this->class_d_address_[0] << 24) |
+ ((ACE_UINT32)this->class_d_address_[1] << 16) |
+ ((ACE_UINT32)this->class_d_address_[2] << 8) |
+ ((ACE_UINT32)this->class_d_address_[3]));
+}
+
+ACE_INLINE void
+TAO_UIPMC_Endpoint::uint_ip_addr (ACE_UINT32 ip_addr)
+{
+ this->class_d_address_[0] = (CORBA::Char)(ip_addr >> 24);
+ this->class_d_address_[1] = (CORBA::Char)((ip_addr >> 16) & 0xff);
+ this->class_d_address_[2] = (CORBA::Char)((ip_addr >> 8) & 0xff);
+ this->class_d_address_[3] = (CORBA::Char)(ip_addr & 0xff);
+}
+
+ACE_INLINE void
+TAO_UIPMC_Endpoint::update_object_addr (void)
+{
+ this->object_addr_.set (this->port_,
+ this->uint_ip_addr ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.cpp
new file mode 100644
index 00000000000..3a16a9f9793
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.cpp
@@ -0,0 +1,99 @@
+// $Id$
+
+#include "orbsvcs/PortableGroup/UIPMC_Factory.h"
+#include "orbsvcs/PortableGroup/UIPMC_Acceptor.h"
+#include "orbsvcs/PortableGroup/UIPMC_Connector.h"
+#include "ace/OS_NS_strings.h"
+#include "tao/ORB_Constants.h"
+
+ACE_RCSID (PortableGroup,
+ UIPMC_Factory,
+ "$Id$")
+
+static const char the_prefix[] = "uipmc";
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_UIPMC_Protocol_Factory::TAO_UIPMC_Protocol_Factory (void)
+ : TAO_Protocol_Factory (IOP::TAG_UIPMC),
+ major_ (TAO_DEF_GIOP_MAJOR),
+ minor_ (TAO_DEF_GIOP_MINOR)
+{
+}
+
+TAO_UIPMC_Protocol_Factory::~TAO_UIPMC_Protocol_Factory (void)
+{
+}
+
+int
+TAO_UIPMC_Protocol_Factory::match_prefix (const ACE_CString &prefix)
+{
+ // Check for the proper prefix for this protocol.
+ return (ACE_OS::strcasecmp (prefix.c_str (), ::the_prefix) == 0);
+}
+
+const char *
+TAO_UIPMC_Protocol_Factory::prefix (void) const
+{
+ return ::the_prefix;
+}
+
+char
+TAO_UIPMC_Protocol_Factory::options_delimiter (void) const
+{
+ return '/';
+}
+
+TAO_Acceptor *
+TAO_UIPMC_Protocol_Factory::make_acceptor (void)
+{
+ TAO_Acceptor *acceptor = 0;
+
+ ACE_NEW_RETURN (acceptor,
+ TAO_UIPMC_Acceptor,
+ 0);
+
+ return acceptor;
+}
+
+int
+TAO_UIPMC_Protocol_Factory::init (int /* argc */,
+ char* /* argv */ [])
+{
+ return 0;
+}
+
+TAO_Connector *
+TAO_UIPMC_Protocol_Factory::make_connector (void)
+{
+ TAO_Connector *connector = 0;
+
+ ACE_NEW_RETURN (connector,
+ TAO_UIPMC_Connector,
+ 0);
+ return connector;
+}
+
+int
+TAO_UIPMC_Protocol_Factory::requires_explicit_endpoint (void) const
+{
+ // A multicast endpoint can't be picked automatically in the
+ // pluggable protocol framework. It must be determined from
+ // the UIPMC profile that has the group reference. This information
+ // is either specified by the user or generated by the
+ // multicast group manager or other UIPMC profile generation
+ // interface.
+ return 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DEFINE (TAO_UIPMC_Protocol_Factory,
+ ACE_TEXT ("UIPMC_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_UIPMC_Protocol_Factory),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+ACE_FACTORY_DEFINE (TAO_PortableGroup, TAO_UIPMC_Protocol_Factory)
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.h
new file mode 100644
index 00000000000..8b7ab75adf2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.h
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file UIPMC_Factory.h
+ *
+ * $Id$
+ *
+ * @author Frank Hunleth <fhunleth@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_UIPMC_FACTORY_H
+#define TAO_UIPMC_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/Protocol_Factory.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Service_Config.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Acceptor;
+class TAO_Connector;
+
+class TAO_PortableGroup_Export TAO_UIPMC_Protocol_Factory : public TAO_Protocol_Factory
+{
+public:
+ TAO_UIPMC_Protocol_Factory (void);
+ virtual ~TAO_UIPMC_Protocol_Factory (void);
+
+ // = Service Configurator hooks.
+ /// Dynamic linking hook
+ virtual int init (int argc, char* argv[]);
+
+ /// Verify prefix is a match
+ virtual int match_prefix (const ACE_CString &prefix);
+
+ /// Returns the prefix used by the protocol.
+ virtual const char *prefix (void) const;
+
+ /// Return the character used to mark where an endpoint ends and
+ /// where its options begin.
+ virtual char options_delimiter (void) const;
+
+ // = Check Protocol_Factory.h for a description of these methods.
+ virtual TAO_Acceptor *make_acceptor (void);
+ virtual TAO_Connector *make_connector (void);
+ virtual int requires_explicit_endpoint (void) const;
+
+private:
+ /// Changing the version number can be used to provide backwards
+ /// compatibility with old clients.
+ int major_;
+ int minor_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE (TAO_UIPMC_Protocol_Factory)
+ACE_FACTORY_DECLARE (TAO_PortableGroup, TAO_UIPMC_Protocol_Factory)
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_UIPMC_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Message_Block_Data_Iterator.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Message_Block_Data_Iterator.cpp
new file mode 100644
index 00000000000..4e3d4173fcf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Message_Block_Data_Iterator.cpp
@@ -0,0 +1,89 @@
+// $Id$
+
+#include "orbsvcs/PortableGroup/UIPMC_Message_Block_Data_Iterator.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+UIPMC_Message_Block_Data_Iterator::UIPMC_Message_Block_Data_Iterator (iovec *iov, int iovcnt) :
+ iov_ (iov),
+ iovcnt_ (iovcnt),
+ iov_ptr_ (0),
+ iov_index_ (0),
+ iov_len_left_ (0),
+ state_ (INTER_BLOCK)
+{
+}
+
+size_t
+UIPMC_Message_Block_Data_Iterator::next_block (size_t max_length,
+ iovec &block)
+{
+ if (this->state_ == INTER_BLOCK)
+ {
+ // Check that there are some iovec buffers left.
+ if (this->iov_index_ >= this->iovcnt_)
+ return 0;
+
+
+ size_t current_iov_len =
+ this->iov_[this->iov_index_].iov_len;
+
+ if (current_iov_len <= max_length)
+ {
+ // Return the full data portion.
+ block.iov_len = static_cast<u_long> (current_iov_len);
+ block.iov_base = this->iov_[this->iov_index_].iov_base;
+
+ // Go to the next block.
+ this->iov_index_++;
+
+ return current_iov_len;
+ }
+ else
+ {
+ // Let the caller use the first part of this
+ // message block.
+ block.iov_len = static_cast<u_long> (max_length);
+ block.iov_base = this->iov_[this->iov_index_].iov_base;
+
+ // Break up the block.
+ this->iov_len_left_ = current_iov_len - max_length;
+ this->iov_ptr_ =
+ reinterpret_cast<char *> (reinterpret_cast<char *> (block.iov_base)
+ + max_length);
+ this->state_ = INTRA_BLOCK;
+
+ return max_length;
+ }
+ }
+ else
+ {
+ // Currently scanning a split block.
+ if (this->iov_len_left_ <= max_length)
+ {
+ // Return everything that's left in the block.
+ block.iov_len = static_cast<u_long> (this->iov_len_left_);
+ block.iov_base = this->iov_ptr_;
+
+ // Go to the next block.
+ this->iov_index_++;
+
+ // Update the state.
+ this->state_ = INTER_BLOCK;
+
+ return this->iov_len_left_;
+ }
+ else
+ {
+ // Split a little more off the block.
+ block.iov_len = static_cast<u_long> (this->iov_len_left_);
+ block.iov_base = this->iov_ptr_;
+
+ this->iov_len_left_ -= max_length;
+ this->iov_ptr_ += max_length;
+ return max_length;
+ }
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Message_Block_Data_Iterator.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Message_Block_Data_Iterator.h
new file mode 100644
index 00000000000..0378e1aac7c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Message_Block_Data_Iterator.h
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file UIPMC_Message_Block_Data_Iterator.h
+ *
+ * $Id$
+ *
+ * @author Frank Hunleth <frank@hunleth.com>
+ */
+//=============================================================================
+
+#ifndef TAO_UIPMC_MESSAGE_BLOCK_DATA_ITERATOR_H
+#define TAO_UIPMC_MESSAGE_BLOCK_DATA_ITERATOR_H
+#include /**/ "ace/pre.h"
+
+#include "ace/os_include/sys/os_uio.h"
+#include "ace/os_include/os_stddef.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class UIPMC_Message_Block_Data_Iterator
+ *
+ * @brief This is a help class for iterating through ACE_Message_Blocks and to
+ * segment them into MIOP packets.
+ */
+class UIPMC_Message_Block_Data_Iterator
+{
+public:
+ /// Constructor
+ UIPMC_Message_Block_Data_Iterator (iovec *iov, int iovcnt);
+
+ /// Get the next data block that has a size less than or equal
+ /// to max_length. Return the length of the block returned.
+ size_t next_block (size_t max_length,
+ iovec &block);
+
+private:
+ enum State
+ {
+ INTER_BLOCK,
+ INTRA_BLOCK
+ };
+
+ iovec *iov_;
+ int iovcnt_;
+
+ // Point internal to a message block, if we have to split one up.
+ char *iov_ptr_;
+ int iov_index_;
+
+ // Length used in a split message block.
+ size_t iov_len_left_;
+
+ // Current message iterator state.
+ State state_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_UIPMC_MESSAGE_BLOCK_DATA_ITERATOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.cpp
new file mode 100644
index 00000000000..d242aef76a1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.cpp
@@ -0,0 +1,800 @@
+// $Id$
+
+#include "orbsvcs/PortableGroup/UIPMC_Profile.h"
+#include "orbsvcs/PortableGroup/miopconf.h"
+#include "tao/CDR.h"
+#include "tao/Environment.h"
+#include "tao/ORB.h"
+#include "tao/ORB_Core.h"
+#include "tao/debug.h"
+#include "tao/target_specification.h"
+#include "ace/os_include/os_ctype.h"
+
+#include "orbsvcs/miopC.h"
+#include "orbsvcs/PortableGroupC.h"
+
+ACE_RCSID (PortableGroup,
+ UIPMC_Profile,
+ "$Id$")
+
+static const char the_prefix[] = "uipmc";
+
+// UIPMC doesn't support object keys, so send profiles by default in the GIOP 1.2 target
+// specification.
+static const CORBA::Short default_addressing_mode_ = TAO_Target_Specification::Profile_Addr;
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+const char TAO_UIPMC_Profile::object_key_delimiter_ = '/';
+
+char
+TAO_UIPMC_Profile::object_key_delimiter (void) const
+{
+ return TAO_UIPMC_Profile::object_key_delimiter_;
+}
+
+
+TAO_UIPMC_Profile::TAO_UIPMC_Profile (TAO_ORB_Core *orb_core)
+ : TAO_Profile (IOP::TAG_UIPMC,
+ orb_core,
+ TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)),
+ endpoint_ (),
+ count_ (1),
+ tagged_profile_ ()
+{
+ addressing_mode_ = default_addressing_mode_;
+}
+
+TAO_UIPMC_Profile::TAO_UIPMC_Profile (const ACE_INET_Addr &addr,
+ TAO_ORB_Core *orb_core)
+ : TAO_Profile (IOP::TAG_UIPMC,
+ orb_core,
+ TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)),
+ endpoint_ (addr),
+ count_ (1),
+ tagged_profile_ ()
+{
+ addressing_mode_ = default_addressing_mode_;
+}
+
+TAO_UIPMC_Profile::TAO_UIPMC_Profile (const CORBA::Octet class_d_address[4],
+ CORBA::UShort port,
+ TAO_ORB_Core *orb_core)
+ : TAO_Profile (IOP::TAG_UIPMC,
+ orb_core,
+ TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)),
+ endpoint_ (class_d_address, port),
+ count_ (1),
+ tagged_profile_ ()
+{
+ addressing_mode_ = default_addressing_mode_;
+}
+
+/*
+
+TAO_UIPMC_Profile::TAO_UIPMC_Profile (const char *string,
+ TAO_ORB_Core *orb_core
+ ACE_ENV_ARG_DECL)
+ : TAO_Profile (TAO_TAG_UIPMC_PROFILE,
+ orb_core,
+ TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)),
+ endpoint_ (),
+ count_ (1),
+ tagged_profile_ ()
+{
+ this->add_group_component ();
+ this->parse_string (string ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ addressing_mode_ = default_addressing_mode_;
+}
+
+TAO_UIPMC_Profile::TAO_UIPMC_Profile (TAO_ORB_Core *orb_core)
+ : TAO_Profile (TAO_TAG_UIPMC_PROFILE,
+ orb_core,
+ TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)),
+ endpoint_ (),
+ count_ (1),
+ tagged_profile_ ()
+{
+ addressing_mode_ = default_addressing_mode_;
+}
+*/
+
+TAO_UIPMC_Profile::~TAO_UIPMC_Profile (void)
+{
+}
+
+int
+TAO_UIPMC_Profile::decode (TAO_InputCDR& cdr)
+{
+ // The following is a selective reproduction of TAO_Profile::decode
+
+ CORBA::ULong encap_len = cdr.length ();
+
+ // Read and verify major, minor versions, ignoring profiles
+ // whose versions we don't understand.
+ if (!(cdr.read_octet (this->version_.major)
+ && this->version_.major == TAO_DEF_GIOP_MAJOR
+ && cdr.read_octet (this->version_.minor)
+ && this->version_.minor <= TAO_DEF_GIOP_MINOR))
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Profile::decode - v%d.%d\n"),
+ this->version_.major,
+ this->version_.minor));
+ }
+
+ return -1;
+ }
+
+ // Transport specific details
+ if (this->decode_profile (cdr) < 0)
+ {
+ return -1;
+ }
+
+ // UIPMC profiles must have tagged components.
+ if (this->tagged_components_.decode (cdr) == 0)
+ {
+ return -1;
+ }
+
+ if (cdr.length () != 0 && TAO_debug_level)
+ {
+ // If there is extra data in the profile we are supposed to
+ // ignore it, but print a warning just in case...
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("%d bytes out of %d left after profile data\n"),
+ cdr.length (),
+ encap_len));
+ }
+
+ // We don't call ::decode_endpoints because it is implemented
+ // as ACE_NOTSUP_RETURN (-1) for this profile
+
+ return 1;
+}
+
+int
+TAO_UIPMC_Profile::decode_endpoints (void)
+{
+ ACE_NOTSUP_RETURN (-1);
+}
+
+int
+TAO_UIPMC_Profile::decode_profile (TAO_InputCDR& cdr)
+{
+ CORBA::UShort port = 0;
+ ACE_CString address;
+ if (!(cdr.read_string (address)
+ && cdr.read_ushort (port)))
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) UIPMC_Profile::decode - ")
+ ACE_TEXT ("Couldn't unmarshal address and port!\n")));
+ return -1;
+ }
+
+ if (cdr.good_bit ())
+ {
+ // If everything was successful, update the endpoint's address
+ // and port with the new data.
+ ACE_INET_Addr addr (port, address.c_str ());
+ this->endpoint_.object_addr (addr);
+ return 1;
+ }
+
+ return -1;
+}
+
+void
+TAO_UIPMC_Profile::parse_string (const char *string
+ ACE_ENV_ARG_DECL)
+{
+ this->parse_string_i (string
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_UIPMC_Profile::parse_string_i (const char *string
+ ACE_ENV_ARG_DECL)
+{
+ // Remove the "N.n@" version prefix, if it exists, and verify the
+ // version is one that we accept.
+
+ // Check for MIOP version
+ if (isdigit (string [0]) &&
+ string[1] == '.' &&
+ isdigit (string [2]) &&
+ string[3] == '@')
+ {
+ if (string[0] != '1' ||
+ string[2] != '0')
+ {
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+
+ string += 4;
+ // Skip over the "N.n@"
+ }
+
+ // UIPMC profiles always use GIOP 1.2
+ this->version_.set_version (1, 2);
+
+ //
+ // Parse the group_id.
+ //
+
+ // Parse the group component version.
+ if (isdigit (string [0]) &&
+ string[1] == '.' &&
+ isdigit (string [2]) &&
+ string[3] == '-')
+ {
+ CORBA::Char major;
+ CORBA::Char minor;
+
+ major = (char) (string [0] - '0');
+ minor = (char) (string [2] - '0');
+
+ // Verify that a supported version of MIOP is specified.
+ if (major != TAO_DEF_MIOP_MAJOR ||
+ minor > TAO_DEF_MIOP_MINOR)
+ {
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+
+ // Skip over "N.n-"
+ string += 4;
+ }
+ else
+ {
+ // The group component version is mandatory.
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+
+ // Parse the group_domain_id.
+ // The Domain ID is terminated with a '-'.
+
+ // Wrap the string in a ACE_CString
+ ACE_CString ace_str (string, 0, 0);
+
+ // Look for the group domain delimitor.
+ ACE_CString::size_type pos = ace_str.find ('-');
+
+ if (pos == ACE_CString::npos)
+ {
+ // The group_domain_id is mandatory, so throw an
+ // exception if it isn't found.
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+
+ // Save the group_domain_id.
+ ACE_CString group_domain_id = ace_str.substring (0, pos);
+
+ // Parse the group_id.
+ // The group_id is terminated with a '-' or a '/'.
+
+ // Skip past the last '-'.
+ ++pos;
+ ACE_CString::size_type end_pos = ace_str.find ('-',pos);
+
+ CORBA::Boolean parse_group_ref_version_flag = 0;
+
+ if (end_pos != ACE_CString::npos)
+ {
+ // String was terminated by a '-', so there's a group
+ // reference version to be parsed.
+ parse_group_ref_version_flag = 1;
+ }
+ else
+ {
+ // Look for a slash as the separator.
+ end_pos = ace_str.find ('/', pos);
+
+ if (end_pos == ACE_CString::npos)
+ {
+ // The Group ID is mandatory, so throw an exception.
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+ }
+
+ // Get the domain_id.
+ ACE_CString str_domain_id = ace_str.substring (pos, end_pos - pos);
+
+ // Convert the domain_id into numerical form.
+ // @@ group_id is actually 64 bits, but strtoul only can parse 32 bits.
+ // @@ Need a 64 bit strtoul...
+ PortableGroup::ObjectGroupId group_id =
+ ACE_OS::strtoul (str_domain_id.c_str (), 0, 10);
+
+ PortableGroup::ObjectGroupRefVersion ref_version = 0;
+ if (parse_group_ref_version_flag)
+ {
+ // Try to find the group version. It is terminated by a '/'.
+ pos = end_pos + 1;
+ end_pos = ace_str.find ('/', pos);
+ if (end_pos == ACE_CString::npos)
+ {
+ // The group version was expected but not found,
+ // so throw an exception.
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+
+ ACE_CString str_group_ref_ver = ace_str.substring (pos, end_pos - pos);
+
+ ref_version =
+ ACE_OS::strtoul (str_group_ref_ver.c_str (), 0, 10);
+ }
+
+ // Parse the group multicast address.
+ // The multicast address is terminated by a ':'.
+ pos = end_pos + 1;
+ end_pos = ace_str.find (':', pos);
+
+ if (end_pos == ACE_CString::npos)
+ {
+ // The multicast address is mandatory, so throw an exception,
+ // since it wasn't found.
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+
+ ACE_CString mcast_addr = ace_str.substring (pos, end_pos - pos);
+
+ // Parse the multicast port number.
+
+ // First check that there's something left in the string.
+ pos = end_pos + 1;
+ if (ace_str[pos] == '\0')
+ {
+ // The multicast port is mandatory, so throw an exception,
+ // since it wasn't found.
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+
+ CORBA::UShort mcast_port =
+ static_cast<CORBA::UShort> (ACE_OS::strtoul (ace_str.c_str () + pos, 0, 10));
+
+ //
+ // Finally, set all of the fields of the profile.
+ //
+
+ ACE_INET_Addr addr (mcast_port, mcast_addr.c_str ());
+ this->endpoint_.object_addr (addr);
+
+ this->set_group_info (group_domain_id.c_str (),
+ group_id,
+ ref_version);
+
+}
+
+CORBA::Boolean
+TAO_UIPMC_Profile::do_is_equivalent (const TAO_Profile *other_profile)
+{
+ const TAO_UIPMC_Profile *op =
+ dynamic_cast<const TAO_UIPMC_Profile *> (other_profile);
+
+ if (op == 0)
+ return 0;
+
+ return this->endpoint_.is_equivalent (&op->endpoint_);
+}
+
+CORBA::ULong
+TAO_UIPMC_Profile::hash (CORBA::ULong max
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ // Get the hashvalue for all endpoints.
+ CORBA::ULong hashval = this->endpoint_.hash ();
+
+ hashval += this->version_.minor;
+ hashval += this->tag ();
+
+ return hashval % max;
+}
+
+TAO_Endpoint*
+TAO_UIPMC_Profile::endpoint (void)
+{
+ return &this->endpoint_;
+}
+
+int
+TAO_UIPMC_Profile::encode_endpoints (void)
+{
+ return 1;
+}
+
+CORBA::ULong
+TAO_UIPMC_Profile::endpoint_count (void) const
+{
+ return 1;
+}
+
+char *
+TAO_UIPMC_Profile::to_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ // @@ Frank: Update to pull out GroupID information...
+
+ size_t buflen = (ACE_OS::strlen (::the_prefix) +
+ 3 /* "loc" */ +
+ 1 /* colon separator */ +
+ 2 /* double-slash separator */ +
+ 1 /* major version */ +
+ 1 /* decimal point */ +
+ 1 /* minor version */ +
+ 1 /* `@' character */ +
+ 15 /* dotted decimal IPv4 address */ +
+ 1 /* colon separator */ +
+ 5 /* port number */);
+
+ char * buf = CORBA::string_alloc (static_cast<CORBA::ULong> (buflen));
+
+ ACE_OS::sprintf (buf,
+ "corbaloc:%s://1.0@%s:%d",
+ ::the_prefix,
+ this->endpoint_.get_host_addr (),
+ this->endpoint_.port ());
+ return buf;
+}
+
+const char *
+TAO_UIPMC_Profile::prefix (void)
+{
+ return ::the_prefix;
+}
+
+IOP::TaggedProfile &
+TAO_UIPMC_Profile::create_tagged_profile (void)
+{
+ // Check whether we have already created the TaggedProfile
+ if (this->tagged_profile_.profile_data.length () == 0)
+ {
+ // As we have not created we will now create the TaggedProfile
+ this->tagged_profile_.tag = IOP::TAG_UIPMC;
+
+ // Create the encapsulation....
+ TAO_OutputCDR encap;
+
+ // Create the profile body
+ this->create_profile_body (encap);
+
+ CORBA::ULong length =
+ static_cast<CORBA::ULong> (encap.total_length ());
+
+#if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
+ // Place the message block in to the Sequence of Octets that we
+ // have
+ this->tagged_profile_.profile_data.replace (length,
+ encap.begin ());
+#else
+ this->tagged_profile_.profile_data.length (length);
+ CORBA::Octet *buffer =
+ this->tagged_profile_.profile_data.get_buffer ();
+ for (const ACE_Message_Block *i = encap.begin ();
+ i != encap.end ();
+ i = i->next ())
+ {
+ ACE_OS::memcpy (buffer, i->rd_ptr (), i->length ());
+ buffer += i->length ();
+ }
+#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
+ }
+
+ return this->tagged_profile_;
+}
+
+void
+TAO_UIPMC_Profile::create_profile_body (TAO_OutputCDR &encap) const
+{
+ encap.write_octet (TAO_ENCAP_BYTE_ORDER);
+
+ // The GIOP version
+ // Note: Only GIOP 1.2 and above are supported currently for MIOP.
+ encap.write_octet (this->version_.major);
+ encap.write_octet (this->version_.minor);
+
+ // Address.
+ encap.write_string (this->endpoint_.get_host_addr ());
+
+ // Port number.
+ encap.write_ushort (this->endpoint_.port ());
+
+ // UIPMC is only supported by versions of GIOP that have tagged components,
+ // so unconditionally encode the components.
+ this->tagged_components ().encode (encap);
+}
+
+/*
+int
+TAO_UIPMC_Profile::decode_endpoints (void)
+{
+ IOP::TaggedComponent tagged_component;
+ tagged_component.tag = TAO_TAG_ENDPOINTS;
+
+ if (this->tagged_components_.get_component (tagged_component))
+ {
+ const CORBA::Octet *buf =
+ tagged_component.component_data.get_buffer ();
+
+ TAO_InputCDR in_cdr (reinterpret_cast<const char*> (buf),
+ tagged_component.component_data.length ());
+
+ // Extract the Byte Order.
+ CORBA::Boolean byte_order;
+ if ((in_cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ return -1;
+ in_cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ // Extract endpoints sequence.
+ TAO_UIPMCEndpointSequence endpoints;
+
+ if ((in_cdr >> endpoints) == 0)
+ return -1;
+
+ // Get the priority of the first endpoint (head of the list.
+ // It's other data is extracted as part of the standard profile
+ // decoding.
+ this->endpoint_.priority (endpoints[0].priority);
+
+ // Use information extracted from the tagged component to
+ // populate the profile. Skip the first endpoint, since it is
+ // always extracted through standard profile body. Also, begin
+ // from the end of the sequence to preserve endpoint order,
+ // since <add_endpoint> method reverses the order of endpoints
+ // in the list.
+ for (CORBA::ULong i = endpoints.length () - 1;
+ i > 0;
+ --i)
+ {
+ TAO_UIPMC_Endpoint *endpoint = 0;
+ ACE_NEW_RETURN (endpoint,
+ TAO_UIPMC_Endpoint (endpoints[i].host,
+ endpoints[i].port,
+ endpoints[i].priority),
+ -1);
+
+ this->add_endpoint (endpoint);
+ }
+ }
+
+ return 0;
+}
+*/
+
+void
+TAO_UIPMC_Profile::set_group_info (const char *domain_id,
+ PortableGroup::ObjectGroupId group_id,
+ PortableGroup::ObjectGroupRefVersion ref_version)
+{
+ // First, record the group information.
+ this->group_domain_id_.set (domain_id);
+ this->group_id_ = group_id;
+ this->ref_version_ = ref_version;
+
+ // Update the cached version of the group component.
+ this->update_cached_group_component ();
+}
+
+void
+TAO_UIPMC_Profile::update_cached_group_component (void)
+{
+ PortableGroup::TagGroupTaggedComponent group;
+
+ // Encode the data structure.
+ group.component_version.major = TAO_DEF_MIOP_MAJOR;
+ group.component_version.minor = TAO_DEF_MIOP_MINOR;
+
+ group.group_domain_id = CORBA::string_dup (this->group_domain_id_.c_str ());
+ group.object_group_id = this->group_id_;
+ group.object_group_ref_version = this->ref_version_;
+
+ TAO_OutputCDR out_cdr;
+
+ // Write the byte order.
+ out_cdr << ACE_OutputCDR::from_boolean (ACE_CDR_BYTE_ORDER);
+
+ // Write the group information.
+ if ((out_cdr << group) == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Error marshaling group component!"));
+ return;
+ }
+
+ size_t length = out_cdr.total_length ();
+
+ IOP::TaggedComponent tagged_component;
+ tagged_component.tag = IOP::TAG_GROUP;
+ tagged_component.component_data.length (static_cast<CORBA::ULong> (length));
+ CORBA::Octet *buf =
+ tagged_component.component_data.get_buffer ();
+
+ for (const ACE_Message_Block *iterator = out_cdr.begin ();
+ iterator != 0;
+ iterator = iterator->cont ())
+ {
+ size_t i_length = iterator->length ();
+ ACE_OS::memcpy (buf, iterator->rd_ptr (), i_length);
+
+ buf += i_length;
+ }
+
+ // Add component with encoded endpoint data to this profile's
+ // TaggedComponents.
+ this->tagged_components_.set_component (tagged_component);
+}
+
+void
+TAO_UIPMC_Profile::request_target_specifier (
+ TAO_Target_Specification &target_spec,
+ TAO_Target_Specification::TAO_Target_Address required_type
+ ACE_ENV_ARG_DECL)
+{
+ // Fill out the target specifier based on the required type.
+ switch (required_type)
+ {
+ case TAO_Target_Specification::Profile_Addr:
+
+ // Only using a profile as the target specifier is supported
+ // at this time. Object keys are strictly not supported since
+ // UIPMC profiles do not have object keys.
+ target_spec.target_specifier (
+ this->create_tagged_profile ());
+ break;
+
+ case TAO_Target_Specification::Key_Addr:
+ case TAO_Target_Specification::Reference_Addr:
+ default:
+ // Unsupported or unknown required type. Throw an exception.
+ ACE_THROW (CORBA::MARSHAL ());
+ }
+}
+
+int
+TAO_UIPMC_Profile::supports_multicast (void) const
+{
+ // Yes! We support multicast!
+ return 1;
+}
+
+void
+TAO_UIPMC_Profile::addressing_mode (CORBA::Short addr_mode
+ ACE_ENV_ARG_DECL)
+{
+ // ** See race condition note about addressing mode in Profile.h **
+ switch (addr_mode)
+ {
+ case TAO_Target_Specification::Profile_Addr:
+ case TAO_Target_Specification::Reference_Addr:
+ this->addressing_mode_ = addr_mode;
+ break;
+
+ case TAO_Target_Specification::Key_Addr:
+ // There is no object key, so it is not supported.
+
+ default:
+ ACE_THROW (CORBA::BAD_PARAM (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+ }
+}
+
+int
+TAO_UIPMC_Profile::extract_group_component (const IOP::TaggedProfile &profile,
+ PortableGroup::TagGroupTaggedComponent &group)
+{
+ // Create the decoding stream from the encapsulation in the buffer,
+//#if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
+// TAO_InputCDR cdr (profile.profile_data.mb ());
+//#else
+ TAO_InputCDR cdr (reinterpret_cast<const char*> (profile.profile_data.get_buffer ()),
+ profile.profile_data.length ());
+//#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
+
+ // Extract the Byte Order.
+ CORBA::Boolean byte_order;
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ return -1;
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ // Read and verify major, minor versions, ignoring UIPMC profiles
+ // whose versions we don't understand.
+ CORBA::Octet major;
+ CORBA::Octet minor = CORBA::Octet();
+
+ // Read the version. We just read it here. We don't*do any*
+ // processing.
+ if (!(cdr.read_octet (major)
+ && cdr.read_octet (minor)))
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) UIPMC_Profile::extract_group_component - v%d.%d\n"),
+ major,
+ minor));
+ }
+ return -1;
+ }
+
+ // Decode the endpoint.
+ ACE_CString address;
+ CORBA::UShort port;
+
+ if (!(cdr.read_string (address)
+ && cdr.read_ushort (port)))
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) UIPMC_Profile::extract_group_component - Couldn't unmarshal address and port!\n")));
+ return -1;
+ }
+
+ TAO_Tagged_Components tagged_components;
+ if (tagged_components.decode (cdr) == 0)
+ return -1;
+
+ IOP::TaggedComponent tagged_component;
+ tagged_component.tag = IOP::TAG_GROUP;
+
+ // Try to find it.
+ if (tagged_components.get_component (tagged_component) == 0)
+ return -1;
+
+ // Found it.
+ const CORBA::Octet *buf =
+ tagged_component.component_data.get_buffer ();
+
+ TAO_InputCDR in_cdr (reinterpret_cast<const char*> (buf),
+ tagged_component.component_data.length ());
+
+ // Extract the Byte Order.
+ if ((in_cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ return -1;
+ in_cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ if ((in_cdr >> group) == 0)
+ return -1;
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.h
new file mode 100644
index 00000000000..a6f8846eeb5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.h
@@ -0,0 +1,165 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file UIPMC_Profile.h
+ *
+ * $Id$
+ *
+ * UIPMC profile specific processing
+ *
+ * @author Frank Hunleth <fhunleth@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_UIPMC_PROFILE_H
+#define TAO_UIPMC_PROFILE_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroup/UIPMC_Endpoint.h"
+
+#include "orbsvcs/PortableGroupC.h"
+
+#include "tao/Object_KeyC.h"
+#include "tao/target_specification.h"
+#include "tao/Profile.h"
+
+#include "ace/SString.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// TAO UIPMC_Profile concrete Profile definitions
+/**
+ * @class TAO_UIPMC_Profile
+ *
+ * @brief This class defines the protocol specific attributes required
+ * for locating ORBs over a TCP/IP network.
+ *
+ * This class defines the UIPMC profile as specified in the CORBA
+ * specification.
+ *
+ * @NOTE: This class inherits the ObjectKey from TAO_Profile which may
+ * not be needed at all! But lets punt on this for the timebeing.
+ */
+class TAO_PortableGroup_Export TAO_UIPMC_Profile : public TAO_Profile
+{
+public:
+ /// The object key delimiter that UIPMC uses or expects.
+ static const char object_key_delimiter_;
+ virtual char object_key_delimiter (void) const;
+
+ /// Return the char string prefix.
+ static const char *prefix (void);
+
+ /// Profile constructor, default. Used when the profile contents
+ /// are not yet known or when it is being decoded from an IOR.
+ TAO_UIPMC_Profile (TAO_ORB_Core *orb_core);
+
+ /// Profile constructor, same as above except the object_key has
+ /// already been marshaled.
+ TAO_UIPMC_Profile (const ACE_INET_Addr &addr,
+ TAO_ORB_Core *orb_core);
+
+ /// Profile constructor.
+ TAO_UIPMC_Profile (const CORBA::Octet class_d_address[4],
+ CORBA::UShort port,
+ TAO_ORB_Core *orb_core);
+
+ /// Create object using a string ior.
+ TAO_UIPMC_Profile (const char *string,
+ TAO_ORB_Core *orb_core
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Destructor is to be called only through <_decr_refcnt>.
+ ~TAO_UIPMC_Profile (void);
+
+ /// Template methods. Please see tao/Profile.h for documentation.
+
+ /// N.B. We have to override the TAO_Profile default decode because
+ /// in UIPMC there is no object key marshalled and we do not implement
+ /// a useable ::decode_endpoints
+ virtual int decode (TAO_InputCDR& cdr);
+ virtual void parse_string (const char *string
+ ACE_ENV_ARG_DECL);
+ virtual char * to_string (ACE_ENV_SINGLE_ARG_DECL);
+ virtual int encode_endpoints (void);
+ virtual TAO_Endpoint *endpoint (void);
+ virtual CORBA::ULong endpoint_count (void) const;
+ virtual CORBA::ULong hash (CORBA::ULong max
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ virtual IOP::TaggedProfile &create_tagged_profile (void);
+ virtual void request_target_specifier (
+ TAO_Target_Specification &target_spec,
+ TAO_Target_Specification::TAO_Target_Address r
+ ACE_ENV_ARG_DECL);
+ virtual int supports_multicast (void) const;
+ virtual void addressing_mode (CORBA::Short addr_mode
+ ACE_ENV_ARG_DECL);
+ static int extract_group_component (const IOP::TaggedProfile &profile,
+ PortableGroup::TagGroupTaggedComponent &group);
+
+ /// Add the mandatory group component to this profile.
+ void set_group_info (const char *domain_id,
+ PortableGroup::ObjectGroupId group_id,
+ PortableGroup::ObjectGroupRefVersion ref_version);
+
+
+protected:
+ /// Template methods, please see documentation in tao/Profile.h
+ virtual int decode_profile (TAO_InputCDR& cdr);
+ virtual int decode_endpoints (void);
+ virtual void parse_string_i (const char *
+ ACE_ENV_ARG_DECL);
+ virtual void create_profile_body (TAO_OutputCDR &cdr) const;
+ virtual CORBA::Boolean do_is_equivalent (const TAO_Profile *other_profile);
+ virtual void update_cached_group_component (void);
+
+protected:
+
+ /**
+ * Head of this profile's list of endpoints. This endpoint is not
+ * dynamically allocated because a profile always contains at least
+ * one endpoint.
+ *
+ * Currently, a profile contains more than one endpoint, i.e.,
+ * list contains more than just the head, only when RTCORBA is enabled.
+ * However, in the near future, this will be used in nonRT
+ * mode as well, e.g., to support TAG_ALTERNATE_IIOP_ADDRESS
+ * feature.
+ * Addressing info of the default endpoint, i.e., head of the list,
+ * is transmitted using standard UIPMC ProfileBody components. See
+ * <encode_endpoints> method documentation above for how the rest of
+ * the endpoint list is transmitted.
+ */
+ TAO_UIPMC_Endpoint endpoint_;
+
+ /// Number of endpoints in the list headed by <endpoint_>.
+ CORBA::ULong count_;
+
+private:
+
+ /// Cached version of our tagged profile.
+ IOP::TaggedProfile tagged_profile_;
+
+ /// Group Domain ID.
+ ACE_CString group_domain_id_;
+
+ /// Our group ID within the group domain.
+ PortableGroup::ObjectGroupId group_id_;
+
+ /// The group reference's version.
+ PortableGroup::ObjectGroupRefVersion ref_version_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_UIPMC_PROFILE_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp
new file mode 100644
index 00000000000..32c3b149dcb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp
@@ -0,0 +1,613 @@
+// $Id$
+
+#include "orbsvcs/PortableGroup/UIPMC_Profile.h"
+#include "orbsvcs/PortableGroup/UIPMC_Transport.h"
+#include "orbsvcs/PortableGroup/UIPMC_Connection_Handler.h"
+#include "orbsvcs/PortableGroup/UIPMC_Message_Block_Data_Iterator.h"
+#include "orbsvcs/PortableGroup/UIPMC_Acceptor.h"
+#include "orbsvcs/PortableGroup/UIPMC_Wait_Never.h"
+
+#include "tao/Acceptor_Registry.h"
+#include "tao/operation_details.h"
+#include "tao/Timeprobe.h"
+#include "tao/CDR.h"
+#include "tao/Transport_Mux_Strategy.h"
+#include "tao/Wait_Strategy.h"
+#include "tao/Stub.h"
+#include "tao/ORB_Core.h"
+#include "tao/debug.h"
+#include "tao/Resume_Handle.h"
+#include "tao/GIOP_Message_Base.h"
+#include "tao/GIOP_Message_Lite.h"
+
+ACE_RCSID (PortableGroup,
+ UIPMC_Transport,
+ "$Id$")
+
+
+// Local MIOP Definitions:
+
+// Note: We currently support packet fragmentation on transmit, but
+// do not support reassembly.
+
+// Limit the number of fragments that we can divide a message
+// into.
+#define MIOP_MAX_FRAGMENTS (1)
+#define MIOP_MAX_HEADER_SIZE (272) // See MIOP Spec. Must be a multiple of 8.
+#define MIOP_MAX_DGRAM_SIZE (ACE_MAX_DGRAM_SIZE)
+
+#define MIOP_MAGIC_OFFSET (0)
+#define MIOP_VERSION_OFFSET (4)
+#define MIOP_FLAGS_OFFSET (5)
+#define MIOP_PACKET_LENGTH_OFFSET (6)
+#define MIOP_PACKET_NUMBER_OFFSET (8)
+#define MIOP_NUMBER_OF_PACKETS_OFFSET (12)
+#define MIOP_ID_LENGTH_OFFSET (16)
+#define MIOP_MIN_LENGTH_ID (0)
+#define MIOP_MAX_LENGTH_ID (252)
+#define MIOP_ID_DEFAULT_LENGTH (12)
+#define MIOP_ID_CONTENT_OFFSET (20)
+#define MIOP_HEADER_PADDING (0) // The ID field needs to be padded to
+ // a multiple of 8 bytes.
+#define MIOP_HEADER_SIZE (MIOP_ID_CONTENT_OFFSET \
+ + MIOP_ID_DEFAULT_LENGTH \
+ + MIOP_HEADER_PADDING)
+#define MIOP_MIN_HEADER_SIZE (MIOP_ID_CONTENT_OFFSET \
+ + MIOP_MIN_LENGTH_ID \
+ + (8 - MIOP_MIN_LENGTH_ID) /* padding */)
+
+static const CORBA::Octet miop_magic[4] = { 0x4d, 0x49, 0x4f, 0x50 }; // 'M', 'I', 'O', 'P'
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+struct MIOP_Packet
+{
+ iovec iov[ACE_IOV_MAX];
+ int iovcnt;
+ int length;
+};
+
+
+TAO_UIPMC_Transport::TAO_UIPMC_Transport (TAO_UIPMC_Connection_Handler *handler,
+ TAO_ORB_Core *orb_core,
+ CORBA::Boolean /*flag*/)
+ : TAO_Transport (IOP::TAG_UIPMC,
+ orb_core)
+ , connection_handler_ (handler)
+ , messaging_object_ (0)
+{
+ // Use the normal GIOP object
+ ACE_NEW (this->messaging_object_,
+ TAO_GIOP_Message_Base (orb_core,
+ this,
+ MIOP_MAX_DGRAM_SIZE));
+
+ // Replace the default wait strategy with our own
+ // since we don't support waiting on anything.
+ delete this->ws_;
+ ACE_NEW (this->ws_,
+ TAO_UIPMC_Wait_Never (this));
+}
+
+TAO_UIPMC_Transport::~TAO_UIPMC_Transport (void)
+{
+ delete this->messaging_object_;
+}
+
+ACE_Event_Handler *
+TAO_UIPMC_Transport::event_handler_i (void)
+{
+ return this->connection_handler_;
+}
+
+TAO_Connection_Handler *
+TAO_UIPMC_Transport::connection_handler_i (void)
+{
+ return this->connection_handler_;
+}
+
+TAO_Pluggable_Messaging *
+TAO_UIPMC_Transport::messaging_object (void)
+{
+ return this->messaging_object_;
+}
+
+
+void
+TAO_UIPMC_Transport::write_unique_id (TAO_OutputCDR &miop_hdr, unsigned long unique)
+{
+ // We currently construct a unique ID for each MIOP message by
+ // concatenating the address of the buffer to a counter. We may
+ // also need to use a MAC address or something more unique to
+ // fully comply with the MIOP specification.
+
+ static unsigned long counter = 1; // Don't worry about race conditions on counter,
+ // since buffer addresses can't be the same if
+ // this is being called simultaneously.
+
+ CORBA::Octet unique_id[MIOP_ID_DEFAULT_LENGTH];
+
+ unique_id[0] = static_cast<CORBA::Octet> (unique & 0xff);
+ unique_id[1] = static_cast<CORBA::Octet> ((unique & 0xff00) >> 8);
+ unique_id[2] = static_cast<CORBA::Octet> ((unique & 0xff0000) >> 16);
+ unique_id[3] = static_cast<CORBA::Octet> ((unique & 0xff000000) >> 24);
+
+ unique_id[4] = static_cast<CORBA::Octet> (counter & 0xff);
+ unique_id[5] = static_cast<CORBA::Octet> ((counter & 0xff00) >> 8);
+ unique_id[6] = static_cast<CORBA::Octet> ((counter & 0xff0000) >> 16);
+ unique_id[7] = static_cast<CORBA::Octet> ((counter & 0xff000000) >> 24);
+
+ unique_id[8] = 0;
+ unique_id[9] = 0;
+ unique_id[10] = 0;
+ unique_id[11] = 0;
+
+ miop_hdr.write_ulong (MIOP_ID_DEFAULT_LENGTH);
+ miop_hdr.write_octet_array (unique_id, MIOP_ID_DEFAULT_LENGTH);
+}
+
+ssize_t
+TAO_UIPMC_Transport::send (iovec *iov, int iovcnt,
+ size_t &bytes_transferred,
+ const ACE_Time_Value *)
+{
+ const ACE_INET_Addr &addr = this->connection_handler_->addr ();
+ bytes_transferred = 0;
+
+ // Calculate the bytes to send. This value is only used for
+ // error conditions to fake a good return. We do this for
+ // semantic consistency with DIOP, and since errors aren't
+ // handled correctly from send_i (our fault). If these
+ // semantics are not desirable, the error handling problems
+ // that need to be fixed can be found in
+ // UIPMC_Connection_Handler::decr_refcount which will need to
+ // deregister the connection handler from the UIPMC_Connector
+ // cache.
+ ssize_t bytes_to_send = 0;
+ for (int i = 0; i < iovcnt; i++)
+ bytes_to_send += iov[i].iov_len;
+
+ MIOP_Packet fragments[MIOP_MAX_FRAGMENTS];
+ MIOP_Packet *current_fragment;
+ int num_fragments = 1;
+
+ UIPMC_Message_Block_Data_Iterator mb_iter (iov, iovcnt);
+
+ // Initialize the first fragment
+ current_fragment = &fragments[0];
+ current_fragment->iovcnt = 1; // The MIOP Header
+ current_fragment->length = MIOP_HEADER_SIZE;
+
+ // Go through all of the message blocks.
+ while (mb_iter.next_block (MIOP_MAX_DGRAM_SIZE - current_fragment->length,
+ current_fragment->iov[current_fragment->iovcnt]))
+ {
+ // Increment the length and iovcnt.
+ current_fragment->length += current_fragment->iov[current_fragment->iovcnt].iov_len;
+ current_fragment->iovcnt++;
+
+ // Check if we've filled up this fragment or if we've run out of
+ // iov entries.
+ if (current_fragment->length == MIOP_MAX_DGRAM_SIZE ||
+ current_fragment->iovcnt == ACE_IOV_MAX)
+ {
+ // Make a new fragment.
+ num_fragments++;
+
+ // Check if too many fragments
+ if (num_fragments > MIOP_MAX_FRAGMENTS)
+ {
+ // This is an error as we do not send more.
+ // Silently drop the message but log an error.
+
+ // Pluggable_Messaging::transport_message only
+ // cares if it gets -1 or 0 so we can return a
+ // partial length and it will think all has gone
+ // well.
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\n\nTAO (%P|%t) ")
+ ACE_TEXT ("UIPMC_Transport::send_i ")
+ ACE_TEXT ("Message of size %d needs too many MIOP fragments (max is %d).\n")
+ ACE_TEXT ("You may be able to increase ACE_MAX_DGRAM_SIZE.\n"),
+ bytes_to_send,
+ MIOP_MAX_FRAGMENTS));
+ }
+
+ // Pretend it is o.k. See note by bytes_to_send calculation.
+ bytes_transferred = bytes_to_send;
+ return 1;
+ }
+
+ // Otherwise, initialize another fragment.
+ current_fragment++;
+ current_fragment->iovcnt = 1; // The MIOP Header
+ current_fragment->length = MIOP_HEADER_SIZE;
+ }
+ }
+
+ // Build a generic MIOP Header.
+
+ // Allocate space on the stack for the header (add 8 to account for
+ // the possibility of adjusting for alignment).
+ char header_buffer[MIOP_HEADER_SIZE + 8];
+ TAO_OutputCDR miop_hdr (header_buffer, MIOP_HEADER_SIZE + 8);
+
+ miop_hdr.write_octet_array (miop_magic, 4); // Magic
+ miop_hdr.write_octet (0x10); // Version
+ CORBA::Octet *flags_field = reinterpret_cast<CORBA::Octet *> (miop_hdr.current ()->wr_ptr ());
+
+ // Write flags octet:
+ // Bit Description
+ // 0 Endian
+ // 1 Stop message flag (Assigned later)
+ // 2 - 7 Set to 0
+ miop_hdr.write_octet (TAO_ENCAP_BYTE_ORDER); // Flags
+
+ // Packet Length
+ // NOTE: We can save pointers and write them later without byte swapping since
+ // in CORBA, the sender chooses the endian.
+ CORBA::UShort *packet_length = reinterpret_cast<CORBA::UShort *> (miop_hdr.current ()->wr_ptr ());
+ miop_hdr.write_short (0);
+
+ // Packet number
+ CORBA::ULong *packet_number = reinterpret_cast<CORBA::ULong *> (miop_hdr.current ()->wr_ptr ());
+ miop_hdr.write_ulong (0);
+
+ // Number of packets field
+ miop_hdr.write_ulong (num_fragments);
+
+ // UniqueId
+ ptrdiff_t unique_id = reinterpret_cast<ptrdiff_t> (iov);
+ this->write_unique_id (miop_hdr,
+ static_cast<unsigned long> (unique_id));
+
+ // Send the buffers.
+ current_fragment = &fragments[0];
+ while (num_fragments > 0 &&
+ current_fragment->iovcnt > 1)
+ {
+ // Fill in the packet length header field.
+ *packet_length = static_cast<CORBA::UShort> (current_fragment->length);
+
+ // If this is the last fragment, set the stop message flag.
+ if (num_fragments == 1)
+ {
+ *flags_field |= 0x02;
+ }
+
+ // Setup the MIOP header in the iov list.
+ current_fragment->iov[0].iov_base = miop_hdr.current ()->rd_ptr ();
+ current_fragment->iov[0].iov_len = MIOP_HEADER_SIZE;
+
+ // Send the fragment. - Need to check for errors!!
+ ssize_t rc = this->connection_handler_->dgram ().send (current_fragment->iov,
+ current_fragment->iovcnt,
+ addr);
+
+ if (rc <= 0)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\n\nTAO (%P|%t) ")
+ ACE_TEXT ("UIPMC_Transport::send")
+ ACE_TEXT (" %p\n\n"),
+ ACE_TEXT ("Error returned from transport:")));
+ }
+
+ // Pretend it is o.k. See note by bytes_to_send calculation.
+ bytes_transferred = bytes_to_send;
+ return 1;
+ }
+
+ // Increment the number of bytes transferred, but don't
+ // count the MIOP header that we added.
+ bytes_transferred += rc - MIOP_HEADER_SIZE;
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_UIPMC_Transport::send_i: sent %d bytes to %s:%d\n",
+ rc,
+ addr.get_host_addr (),
+ addr.get_port_number ()));
+ }
+
+ // Go to the next fragment.
+ (*packet_number)++;
+ ++current_fragment;
+ --num_fragments;
+ }
+
+ // Return total bytes transferred.
+ return bytes_transferred;
+}
+
+
+ssize_t
+TAO_UIPMC_Transport::recv (char *buf,
+ size_t len,
+ const ACE_Time_Value * /*max_wait_time*/)
+{
+ ACE_INET_Addr from_addr;
+
+ ssize_t n = this->connection_handler_->mcast_dgram ().recv (buf,
+ len,
+ from_addr);
+ if (TAO_debug_level > 5)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_UIPMC_Transport::recv_i: received %d bytes from %s:%d\n",
+ n,
+ from_addr.get_host_addr (),
+ from_addr.get_port_number ()));
+ }
+
+ // Make sure that we at least have a MIOP header.
+ if (n < MIOP_MIN_HEADER_SIZE)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_UIPMC_Transport::recv_i: packet of size %d is too small from %s:%d\n",
+ n,
+ from_addr.get_host_addr (),
+ from_addr.get_port_number ()));
+ }
+ return 0;
+ }
+
+ // Check for MIOP magic bytes.
+ if (buf[MIOP_MAGIC_OFFSET] != miop_magic [0] ||
+ buf[MIOP_MAGIC_OFFSET + 1] != miop_magic [1] ||
+ buf[MIOP_MAGIC_OFFSET + 2] != miop_magic [2] ||
+ buf[MIOP_MAGIC_OFFSET + 3] != miop_magic [3])
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_UIPMC_Transport::recv_i: UIPMC packet didn't contain magic bytes.\n"));
+ }
+
+ return 0;
+ }
+
+ // Retrieve the byte order.
+ // 0 = Big endian
+ // 1 = Small endian
+ CORBA::Octet byte_order = buf[MIOP_FLAGS_OFFSET] & 0x01;
+
+ // Ignore the header version, other flags, packet length and number of packets.
+
+ // Get the length of the ID.
+ CORBA::ULong id_length;
+#if !defined (ACE_DISABLE_SWAP_ON_READ)
+ if (byte_order == ACE_CDR_BYTE_ORDER)
+ {
+ id_length = *reinterpret_cast<ACE_CDR::ULong*> (&buf[MIOP_ID_LENGTH_OFFSET]);
+ }
+ else
+ {
+ ACE_CDR::swap_4 (&buf[MIOP_ID_LENGTH_OFFSET],
+ reinterpret_cast<char*> (&id_length));
+ }
+#else
+ id_length = *reinterpret_cast<ACE_CDR::ULong*> (&buf[MIOP_ID_LENGTH_OFFSET]);
+#endif /* ACE_DISABLE_SWAP_ON_READ */
+
+ // Make sure that the length field is legal.
+ if (id_length > MIOP_MAX_LENGTH_ID ||
+ static_cast<ssize_t> (MIOP_ID_CONTENT_OFFSET + id_length) > n)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_UIPMC_Transport::recv_i: Invalid ID length.\n"));
+ }
+
+ return 0;
+ }
+
+ // Trim off the header for now.
+ ssize_t miop_header_size = (MIOP_ID_CONTENT_OFFSET + id_length + 7) & ~0x7;
+ if (miop_header_size > n)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_UIPMC_Transport::recv_i: MIOP packet not large enough for padding.\n"));
+ }
+
+ return 0;
+ }
+
+ n -= miop_header_size;
+ ACE_OS::memmove (buf, buf + miop_header_size, n);
+
+ return n;
+}
+
+int
+TAO_UIPMC_Transport::handle_input (TAO_Resume_Handle &rh,
+ ACE_Time_Value *max_wait_time,
+ int /*block*/)
+{
+ // If there are no messages then we can go ahead to read from the
+ // handle for further reading..
+
+ // The buffer on the stack which will be used to hold the input
+ // messages
+ char buf [MIOP_MAX_DGRAM_SIZE];
+
+#if defined (ACE_INITIALIZE_MEMORY_BEFORE_USE)
+ (void) ACE_OS::memset (buf,
+ '\0',
+ sizeof buf);
+#endif /* ACE_INITIALIZE_MEMORY_BEFORE_USE */
+
+ // Create a data block
+ ACE_Data_Block db (sizeof (buf),
+ ACE_Message_Block::MB_DATA,
+ buf,
+ this->orb_core_->input_cdr_buffer_allocator (),
+ this->orb_core_->locking_strategy (),
+ ACE_Message_Block::DONT_DELETE,
+ this->orb_core_->input_cdr_dblock_allocator ());
+
+ // Create a message block
+ ACE_Message_Block message_block (&db,
+ ACE_Message_Block::DONT_DELETE,
+ this->orb_core_->input_cdr_msgblock_allocator ());
+
+
+ // Align the message block
+ ACE_CDR::mb_align (&message_block);
+
+
+ // Read the message into the message block that we have created on
+ // the stack.
+ ssize_t n = this->recv (message_block.rd_ptr (),
+ message_block.space (),
+ max_wait_time);
+
+ // If there is an error return to the reactor..
+ if (n <= 0)
+ {
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO: (%P|%t|%N|%l) recv returned error on transport %d after fault %p\n"),
+ this->id (),
+ ACE_TEXT ("handle_input_i ()\n")));
+ }
+
+ if (n == -1)
+ this->tms_->connection_closed ();
+
+ return n;
+ }
+
+ // Set the write pointer in the stack buffer.
+ message_block.wr_ptr (n);
+
+
+ // Make a node of the message block..
+ TAO_Queued_Data qd (&message_block);
+ size_t mesg_length;
+
+ // Parse the incoming message for validity. The check needs to be
+ // performed by the messaging objects.
+ if (this->messaging_object ()->parse_next_message (message_block,
+ qd,
+ mesg_length) == -1)
+ {
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO: (%P|%t|%N|%l) handle_input failed on transport %d after fault\n"),
+ this->id () ));
+ }
+
+ return -1;
+ }
+
+ if (message_block.length () > mesg_length)
+ {
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO: (%P|%t|%N|%l) handle_input failed on transport %d after fault\n"),
+ this->id () ));
+ }
+
+ return -1;
+ }
+
+ // NOTE: We are not performing any queueing nor any checking for
+ // missing data. We are assuming that ALL the data would be got in a
+ // single read.
+
+ // Process the message
+ return this->process_parsed_messages (&qd, rh);
+}
+
+int
+TAO_UIPMC_Transport::register_handler (void)
+{
+ // We never register register the handler with the reactor
+ // as we never need to be informed about any incoming data,
+ // assuming we only use one-ways.
+ // If we would register and ICMP Messages would arrive, e.g
+ // due to a not reachable server, we would get informed - as this
+ // disturbs the general MIOP assumptions of not being
+ // interested in any network failures, we ignore ICMP messages.
+ return 0;
+}
+
+int
+TAO_UIPMC_Transport::send_request (TAO_Stub *stub,
+ TAO_ORB_Core *orb_core,
+ TAO_OutputCDR &stream,
+ int message_semantics,
+ ACE_Time_Value *max_wait_time)
+{
+ if (this->ws_->sending_request (orb_core,
+ message_semantics) == -1)
+ return -1;
+
+ if (this->send_message (stream,
+ stub,
+ message_semantics,
+ max_wait_time) == -1)
+
+ return -1;
+
+ return 0;
+}
+
+int
+TAO_UIPMC_Transport::send_message (TAO_OutputCDR &stream,
+ TAO_Stub *stub,
+ int message_semantics,
+ ACE_Time_Value *max_wait_time)
+{
+ // Format the message in the stream first
+ if (this->messaging_object_->format_message (stream) != 0)
+ return -1;
+
+ // Strictly speaking, should not need to loop here because the
+ // socket never gets set to a nonblocking mode ... some Linux
+ // versions seem to need it though. Leaving it costs little.
+
+ // This guarantees to send all data (bytes) or return an error.
+ ssize_t n = this->send_message_shared (stub,
+ message_semantics,
+ stream.begin (),
+ max_wait_time);
+
+ if (n == -1)
+ {
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO: (%P|%t|%N|%l) closing transport %d after fault %p\n"),
+ this->id (),
+ ACE_TEXT ("send_message ()\n")));
+
+ return -1;
+ }
+
+ return 1;
+}
+
+int
+TAO_UIPMC_Transport::messaging_init (CORBA::Octet major,
+ CORBA::Octet minor)
+{
+ this->messaging_object_->init (major,
+ minor);
+ return 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.h
new file mode 100644
index 00000000000..634b85c0b1a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.h
@@ -0,0 +1,131 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file UIPMC_Transport.h
+ *
+ * $Id$
+ *
+ * @author Frank Hunleth <fhunleth@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_UIPMC_TRANSPORT_H
+#define TAO_UIPMC_TRANSPORT_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Transport.h"
+
+#include "ace/SOCK_Stream.h"
+#include "ace/Svc_Handler.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward decls.
+class TAO_UIPMC_Connection_Handler;
+class TAO_ORB_Core;
+class TAO_Operation_Details;
+class TAO_Pluggable_Messaging;
+class TAO_Acceptor;
+
+// Service Handler for this transport
+typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
+ TAO_UIPMC_SVC_HANDLER;
+
+#if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT
+template class TAO_PortableGroup_Export ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>;
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */
+
+/**
+ * @class TAO_UIPMC_Transport
+ *
+ * @brief Specialization of the base TAO_Transport class to handle the
+ * MIOP protocol.
+ */
+class TAO_PortableGroup_Export TAO_UIPMC_Transport : public TAO_Transport
+{
+public:
+
+ /// Constructor.
+ TAO_UIPMC_Transport (TAO_UIPMC_Connection_Handler *handler,
+ TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag);
+
+ /// Default destructor.
+ ~TAO_UIPMC_Transport (void);
+
+ /// Look for the documentation in Transport.h.
+ virtual int handle_input (TAO_Resume_Handle &rh,
+ ACE_Time_Value *max_wait_time = 0,
+ int block = 0);
+protected:
+ /** @name Overridden Template Methods
+ *
+ * These are implementations of template methods declared by TAO_Transport.
+ */
+ //@{
+
+ virtual ACE_Event_Handler * event_handler_i (void);
+ virtual TAO_Connection_Handler *connection_handler_i (void);
+ virtual TAO_Pluggable_Messaging *messaging_object (void);
+
+ /// Write the complete Message_Block chain to the connection.
+ virtual ssize_t send (iovec *iov, int iovcnt,
+ size_t &bytes_transferred,
+ const ACE_Time_Value *max_wait_time);
+
+
+ /// Read len bytes from into buf.
+ virtual ssize_t recv (char *buf,
+ size_t len,
+ const ACE_Time_Value *s = 0);
+
+ virtual int register_handler (void);
+
+public:
+ /// @@TODO: These methods IMHO should have more meaningful
+ /// names. The names seem to indicate nothing.
+ virtual int send_request (TAO_Stub *stub,
+ TAO_ORB_Core *orb_core,
+ TAO_OutputCDR &stream,
+ int message_semantics,
+ ACE_Time_Value *max_wait_time);
+
+ virtual int send_message (TAO_OutputCDR &stream,
+ TAO_Stub *stub = 0,
+ int message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST,
+ ACE_Time_Value *max_time_wait = 0);
+
+ /// Initialising the messaging object
+ virtual int messaging_init (CORBA::Octet major,
+ CORBA::Octet minor);
+
+ //@}
+
+private:
+ /// Process the message that we have read.
+ int process_message (void);
+
+ /// Construct and write a unique ID to the MIOP header.
+ void write_unique_id (TAO_OutputCDR &miop_hdr, unsigned long unique);
+
+private:
+
+ /// The connection service handler used for accessing lower layer
+ /// communication protocols.
+ TAO_UIPMC_Connection_Handler *connection_handler_;
+
+ /// Our messaging object.
+ TAO_Pluggable_Messaging *messaging_object_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_UIPMC_TRANSPORT_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Wait_Never.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Wait_Never.cpp
new file mode 100644
index 00000000000..0e1a0f1bc89
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Wait_Never.cpp
@@ -0,0 +1,53 @@
+// $Id$
+
+#include "orbsvcs/PortableGroup/UIPMC_Wait_Never.h"
+#include "tao/ORB_Core.h"
+#include "tao/Transport.h"
+#include "tao/debug.h"
+
+ACE_RCSID(tao, Wait_On_Leader_Follower, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_UIPMC_Wait_Never::TAO_UIPMC_Wait_Never (TAO_Transport *transport)
+ : TAO_Wait_Strategy (transport)
+{
+}
+
+TAO_UIPMC_Wait_Never::~TAO_UIPMC_Wait_Never (void)
+{
+}
+
+int
+TAO_UIPMC_Wait_Never::register_handler (void)
+{
+ return -1;
+}
+
+bool
+TAO_UIPMC_Wait_Never::non_blocking (void) const
+{
+ return true;
+}
+
+bool
+TAO_UIPMC_Wait_Never::can_process_upcalls (void) const
+{
+ return true;
+}
+
+int
+TAO_UIPMC_Wait_Never::sending_request (TAO_ORB_Core *,
+ int)
+{
+ return 0;
+}
+
+int
+TAO_UIPMC_Wait_Never::wait (ACE_Time_Value *,
+ TAO_Synch_Reply_Dispatcher &)
+{
+ return -1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Wait_Never.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Wait_Never.h
new file mode 100644
index 00000000000..9f39cd77b91
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Wait_Never.h
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file UIPMC_Wait_Never.h
+ *
+ * $Id$
+ *
+ * @author Frank Hunleth <fhunleth@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_UIPMC_WAIT_NEVER_H
+#define TAO_UIPMC_WAIT_NEVER_H
+#include /**/ "ace/pre.h"
+
+#include "tao/Wait_Strategy.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroup/portablegroup_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_UIPMC_Wait_Never
+ *
+ * @brief Since two-ways are not supported by UIPMC and more
+ * generally, anything that requires waiting isn't supported, so
+ * return error if anyone tries to do this.
+ */
+class TAO_PortableGroup_Export TAO_UIPMC_Wait_Never : public TAO_Wait_Strategy
+{
+
+public:
+ /// Constructor.
+ TAO_UIPMC_Wait_Never (TAO_Transport *transport);
+
+ /// Destructor.
+ virtual ~TAO_UIPMC_Wait_Never (void);
+
+ // = Documented in TAO_Wait_Strategy.
+ virtual int sending_request (TAO_ORB_Core *orb_core,
+ int two_way);
+ virtual int wait (ACE_Time_Value *max_wait_time,
+ TAO_Synch_Reply_Dispatcher &rd);
+ virtual int register_handler (void);
+ virtual bool non_blocking (void) const;
+ virtual bool can_process_upcalls (void) const;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_UIPMC_WAIT_NEVER_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/miopconf.h b/TAO/orbsvcs/orbsvcs/PortableGroup/miopconf.h
new file mode 100644
index 00000000000..44db690f7b2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/miopconf.h
@@ -0,0 +1,41 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file miopconf.h
+ *
+ * $Id$
+ *
+ * Build configuration file.
+ *
+ * @author Copyright 1995 by Sun Microsystems, Inc.
+ * @author Chris Cleeland
+ * @author Douglas C. Schmidt
+ */
+//=============================================================================
+
+#ifndef TAO_MIOPCONF_H
+#define TAO_MIOPCONF_H
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+// This is the version of the MIOP spec that TAO supports. The
+// exact usage of the version has not been emphasized. But TAO should
+// get a TaggedComponents for a group with this version number. So, for
+// the present, we do a sanity check for our version and raise an error on
+// a mismatch.
+
+#if !defined (TAO_DEF_MIOP_MAJOR)
+#define TAO_DEF_MIOP_MAJOR 1
+#endif /* TAO_DEF_MIOP_MAJOR */
+#if !defined (TAO_DEF_MIOP_MINOR)
+#define TAO_DEF_MIOP_MINOR 0
+#endif /* TAO_DEF_MIOP_MINOR */
+
+#include /**/ "ace/post.h"
+#endif /*TAO_MIOPCONF_H*/
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/portablegroup_export.h b/TAO/orbsvcs/orbsvcs/PortableGroup/portablegroup_export.h
new file mode 100644
index 00000000000..15494956536
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/portablegroup_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_PORTABLEGROUP_EXPORT_H
+#define TAO_PORTABLEGROUP_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_PORTABLEGROUP_HAS_DLL)
+# define TAO_PORTABLEGROUP_HAS_DLL 0
+# endif /* ! TAO_PORTABLEGROUP_HAS_DLL */
+#else
+# if !defined (TAO_PORTABLEGROUP_HAS_DLL)
+# define TAO_PORTABLEGROUP_HAS_DLL 1
+# endif /* ! TAO_PORTABLEGROUP_HAS_DLL */
+#endif
+
+#if defined (TAO_PORTABLEGROUP_HAS_DLL) && (TAO_PORTABLEGROUP_HAS_DLL == 1)
+# if defined (TAO_PORTABLEGROUP_BUILD_DLL)
+# define TAO_PortableGroup_Export ACE_Proper_Export_Flag
+# define TAO_PORTABLEGROUP_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_PORTABLEGROUP_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_PORTABLEGROUP_BUILD_DLL */
+# define TAO_PortableGroup_Export ACE_Proper_Import_Flag
+# define TAO_PORTABLEGROUP_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_PORTABLEGROUP_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_PORTABLEGROUP_BUILD_DLL */
+#else /* TAO_PORTABLEGROUP_HAS_DLL == 1 */
+# define TAO_PortableGroup_Export
+# define TAO_PORTABLEGROUP_SINGLETON_DECLARATION(T)
+# define TAO_PORTABLEGROUP_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_PORTABLEGROUP_HAS_DLL == 1 */
+
+#endif /* TAO_PORTABLEGROUP_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup_Simple_DS.idl b/TAO/orbsvcs/orbsvcs/PortableGroup_Simple_DS.idl
new file mode 100644
index 00000000000..5da9ea78453
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup_Simple_DS.idl
@@ -0,0 +1,41 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file PortableGroup_Simple_DS.idl
+ *
+ * $Id$
+ *
+ * The aim of this file is to provide a seperation between the actual
+ * PortableGroup interface and some of the data structures defined in
+ * this module. This would be apparent if you look at
+ * FT_CORBA_ORB.idl. FT_CORBA_ORB.idl can get away by just including
+ * this file and the generated code from this instead of linking in
+ * PortableGroup and the likes.
+ */
+//=============================================================================
+
+#ifndef _PORTABLEGROUP_SIMPLE_DS_IDL_
+#define _PORTABLEGROUP_SIMPLE_DS_IDL_
+
+#include "tao/GIOP.pidl"
+
+module PortableGroup
+{
+ typeprefix PortableGroup "omg.org";
+
+ // Specification for Interoperable Object Group References
+ typedef string GroupDomainId;
+ typedef unsigned long long ObjectGroupId;
+ typedef unsigned long ObjectGroupRefVersion;
+
+ struct TagGroupTaggedComponent
+ { // tag = TAG_GROUP;
+ GIOP::Version component_version;
+ GroupDomainId group_domain_id;
+ ObjectGroupId object_group_id;
+ ObjectGroupRefVersion object_group_ref_version;
+ };
+};
+
+#endif /*_PORTABLEGROUP_SIMPLE_DS_IDL_*/
diff --git a/TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.cpp b/TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.cpp
new file mode 100644
index 00000000000..817d0726b4b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.cpp
@@ -0,0 +1,1888 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// cos
+//
+// = FILENAME
+// CosPropertyService_i.cpp
+//
+// = AUTHOR
+// Alexander Babu Arulanthu <alex@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Property/CosPropertyService_i.h"
+#include "ace/ACE.h"
+#include "ace/OS_NS_string.h"
+
+ACE_RCSID(Property, CosPropertyService_i, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// = Methods to deal with ACE_Hash_Map_Manager.
+
+CosProperty_Hash_Key::CosProperty_Hash_Key (void)
+{
+}
+
+CosProperty_Hash_Key::CosProperty_Hash_Key (const char * &name)
+ : pname_ (CORBA::string_dup (name))
+{
+}
+
+CosProperty_Hash_Key::CosProperty_Hash_Key (const CosPropertyService::PropertyName &name)
+ : pname_ (CORBA::string_dup (name))
+{
+}
+
+CosProperty_Hash_Key::CosProperty_Hash_Key (const CosProperty_Hash_Key &src)
+ : pname_ (src.pname_)
+{
+}
+
+bool
+CosProperty_Hash_Key::operator == (const CosProperty_Hash_Key &hash_key) const
+{
+ return (ACE_OS::strcmp (this->pname_,
+ hash_key.pname_) == 0);
+}
+
+u_long
+CosProperty_Hash_Key::hash (void) const
+{
+ u_long ret = ACE::hash_pjw (this->pname_);
+
+ return ret;
+}
+
+CosProperty_Hash_Key::~CosProperty_Hash_Key (void)
+{
+}
+
+//======================================================================
+
+CosProperty_Hash_Value::CosProperty_Hash_Value (void)
+{
+}
+
+CosProperty_Hash_Value::CosProperty_Hash_Value (const CORBA::Any &any,
+ const CosPropertyService::PropertyModeType &mode)
+ : pvalue_ (any),
+ pmode_ (mode)
+{
+}
+
+CosProperty_Hash_Value::CosProperty_Hash_Value (const CosProperty_Hash_Value &src)
+ : pvalue_ (src.pvalue_),
+ pmode_ (src.pmode_)
+{
+}
+
+CosProperty_Hash_Value::~CosProperty_Hash_Value (void)
+{
+}
+
+//======================================================================
+
+// Constructor.
+TAO_PropertySetFactory::TAO_PropertySetFactory (void)
+{
+}
+
+// Destructor.
+TAO_PropertySetFactory::~TAO_PropertySetFactory (void)
+{
+}
+
+// Returns a new TAO_PropertySet object. "The property set returned
+// will *not* have any initial properties." Keep sequence of things
+// new'ed and at the destructor of the factory delete all these New'ed
+// things.
+
+CosPropertyService::PropertySet_ptr
+TAO_PropertySetFactory::create_propertyset (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // New a TAO_PropertySet.
+ TAO_PropertySet *new_set;
+ ACE_NEW_RETURN (new_set, TAO_PropertySet, 0);
+
+ // Successful, store this in the products sequence and return.
+ CORBA::ULong cur_len = this->propertyset_products_.length ();
+ this->propertyset_products_.length (cur_len + 1);
+ this->propertyset_products_[cur_len] = new_set;
+ return new_set->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// Allows a client to create a new TAO_PropertySet with specific
+// constraints. "All the properties will have *fixed-normal* modes".
+
+CosPropertyService::PropertySet_ptr
+TAO_PropertySetFactory::create_constrained_propertyset (const CosPropertyService::PropertyTypes &allowed_property_types,
+ const CosPropertyService::Properties &allowed_properties
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::ConstraintNotSupported))
+{
+ TAO_PropertySet *new_set = 0;
+ CosPropertyService::PropertySet_ptr propset_ptr = 0;
+
+ ACE_TRY
+ {
+ // New a TAO_PropertySet using these constraints.
+ ACE_NEW_RETURN (new_set,
+ TAO_PropertySet (allowed_property_types,
+ allowed_properties
+ ACE_ENV_ARG_PARAMETER), 0);
+ ACE_TRY_CHECK;
+
+ // Successful, store this in the products sequence.
+ CORBA::ULong products_len = this->propertyset_products_.length ();
+ this->propertyset_products_.length (products_len + 1);
+ this->propertyset_products_[products_len] = new_set;
+
+ // All done.
+ propset_ptr = new_set->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::UserException, ex)
+ {
+ // Release the memory.
+ delete new_set;
+
+ // Throw the exception.
+ ACE_TRY_THROW (CosPropertyService::ConstraintNotSupported());
+ }
+ ACE_CATCH (CORBA::SystemException, ex)
+ {
+ // Release memory.
+ delete new_set;
+
+ // Throw the exception.
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ return propset_ptr;
+}
+
+// Allows a client to create a new TAO_PropertySet with specific
+// constraints. "All the properties will have *fixed-normal* modes".
+
+CosPropertyService::PropertySet_ptr
+TAO_PropertySetFactory::create_initial_propertyset (const CosPropertyService::Properties &initial_properties
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::MultipleExceptions))
+{
+ TAO_PropertySet *new_set = 0;
+ CosPropertyService::PropertySet_ptr propset_ptr = 0;
+
+ ACE_TRY
+ {
+ // New a TAO_PropertySet.
+ ACE_NEW_RETURN (new_set,
+ TAO_PropertySet (initial_properties
+ ACE_ENV_ARG_PARAMETER), 0);
+ ACE_TRY_CHECK;
+
+ // Successful, store this in the products sequence.
+ CORBA::ULong products_len = this->propertyset_products_.length ();
+ this->propertyset_products_.length (products_len + 1);
+ this->propertyset_products_[products_len] = new_set;
+
+ // All done.
+ propset_ptr = new_set->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosPropertyService::MultipleExceptions, ex)
+ {
+ // Release memory.
+ delete new_set;
+
+ // Throw the exception.
+ ACE_RE_THROW;
+ }
+ ACE_CATCH (CORBA::SystemException, ex)
+ {
+ // Release the memory.
+ delete new_set;
+
+ // Throw the exception.
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ return propset_ptr;
+}
+
+// Destructor.
+TAO_PropertySetDefFactory::~TAO_PropertySetDefFactory (void)
+{
+ // Release all the new'ed products.
+ for (CORBA::ULong pi = 0;
+ pi < this->propertysetdef_products_.length ();
+ pi++)
+ delete this->propertysetdef_products_[pi];
+}
+
+//======================================================================
+
+// Constrctor.
+TAO_PropertySetDefFactory::TAO_PropertySetDefFactory (void)
+{
+}
+
+// Returns a new TAO_PropertySetDef object. "The property setdef
+// returned will *not* have any initial properties."
+// Keep sequence of things new'ed and at the destructor of the factory
+// delete all these New'ed things.
+
+CosPropertyService::PropertySetDef_ptr
+TAO_PropertySetDefFactory::create_propertysetdef (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // New a TAO_PropertySetDef.
+ TAO_PropertySetDef *new_set;
+ ACE_NEW_RETURN (new_set, TAO_PropertySetDef, 0);
+
+ // Successful, store this in the products sequence and return.
+ CORBA::ULong cur_len = this->propertysetdef_products_.length ();
+ this->propertysetdef_products_.length (cur_len + 1);
+ this->propertysetdef_products_[cur_len] = new_set;
+
+ CosPropertyService::PropertySetDef_ptr propsetdef_ptr =
+ new_set->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return propsetdef_ptr;
+}
+
+CosPropertyService::PropertySetDef_ptr
+TAO_PropertySetDefFactory::create_constrained_propertysetdef (const CosPropertyService::PropertyTypes &allowed_property_types,
+ const CosPropertyService::PropertyDefs &allowed_property_defs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::ConstraintNotSupported))
+{
+ TAO_PropertySetDef *new_set = 0;
+ CosPropertyService::PropertySetDef_ptr propsetdef_ptr = 0;
+
+ ACE_TRY
+ {
+ // New a TAO_PropertySetDef using these constraints.
+ ACE_NEW_RETURN (new_set,
+ TAO_PropertySetDef (allowed_property_types,
+ allowed_property_defs
+ ACE_ENV_ARG_PARAMETER), 0);
+ ACE_TRY_CHECK;
+
+ // Successful, store this in the products sequence.
+ CORBA::ULong products_len = this->propertysetdef_products_.length ();
+ this->propertysetdef_products_.length (products_len + 1);
+ this->propertysetdef_products_[products_len] = new_set;
+
+ // All done. Return the pointer.
+ propsetdef_ptr = new_set->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::UserException, ex)
+ {
+ // Release the memory.
+ delete new_set;
+
+ // Throw the exception.
+ ACE_TRY_THROW (CosPropertyService::ConstraintNotSupported());
+ }
+ ACE_CATCH (CORBA::SystemException, ex)
+ {
+ // Release memory.
+ delete new_set;
+
+ // Throw the exception.
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ return propsetdef_ptr;
+}
+
+// Allows the client to create a new TAO_PropertySetDef with specific
+// initital constraints.
+
+CosPropertyService::PropertySetDef_ptr
+TAO_PropertySetDefFactory::create_initial_propertysetdef (const CosPropertyService::PropertyDefs &initial_property_defs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::MultipleExceptions))
+{
+ TAO_PropertySetDef *new_set = 0;
+ CosPropertyService::PropertySetDef_ptr propsetdef_ptr = 0;
+
+ ACE_TRY
+ {
+ // New a TAO_PropertySet using these lengths.
+ ACE_NEW_RETURN (new_set,
+ TAO_PropertySetDef (initial_property_defs
+ ACE_ENV_ARG_PARAMETER), 0);
+ ACE_TRY_CHECK;
+
+ // Successful, store this in the products sequence.
+ CORBA::ULong products_len = this->propertysetdef_products_.length ();
+ this->propertysetdef_products_.length (products_len + 1);
+ this->propertysetdef_products_[products_len] = new_set;
+
+ // All done.
+ propsetdef_ptr = new_set->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosPropertyService::MultipleExceptions, ex)
+ {
+ // Release memory.
+ delete new_set;
+
+ // Throw the exception.
+ ACE_RE_THROW;
+ }
+ ACE_CATCH (CORBA::SystemException, ex)
+ {
+ // Release the memory.
+ delete new_set;
+
+ // Throw the exception.
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ return propsetdef_ptr;
+}
+
+//======================================================================
+
+// Makes default sized hash_table_. All the sequences are set the max
+// length as 0.
+
+TAO_PropertySet::TAO_PropertySet (void)
+{
+}
+
+// Init values that the PropertySetFactory will want to specify. Write
+// the allowed properties in the Hash Table with *fixed-normal* mode.
+// @@ Need to check for duplicate properties and raise exceptions.
+
+
+TAO_PropertySet::TAO_PropertySet (const CosPropertyService::PropertyTypes allowed_property_types,
+ const CosPropertyService::Properties allowed_properties
+ ACE_ENV_ARG_DECL)
+ : allowed_property_types_ (allowed_property_types),
+ allowed_property_names_ (allowed_properties.length ())
+{
+ // Set the length for the sequence, just to make sure.
+ this->allowed_property_names_.length (allowed_properties.length ());
+
+ // Keep the allowed property names in the sequence..
+ for (CORBA::ULong ni = 0;
+ ni < allowed_properties.length ();
+ ni++)
+ this->allowed_property_names_[ni] =
+ allowed_properties[ni].property_name;
+
+ // Define the allowed properties in the hash table.
+ ACE_TRY
+ {
+ this->define_properties (allowed_properties
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_PropertySet-Constructor");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+// TAO_PropertySetDef's constructor needs this, for initializing the
+// allowed properties' sequence withe just the maximum length.
+
+TAO_PropertySet::TAO_PropertySet (const CosPropertyService::PropertyTypes allowed_property_types,
+ const CORBA::ULong number_of_allowed_properties
+ ACE_ENV_ARG_DECL_NOT_USED)
+ : allowed_property_types_ (allowed_property_types),
+ allowed_property_names_ (number_of_allowed_properties)
+{
+}
+
+// PropertySetFactory needs this constructor. Store all the initial
+// properies with *normal* modes.
+
+
+TAO_PropertySet::TAO_PropertySet (const CosPropertyService::Properties initial_properties
+ ACE_ENV_ARG_DECL)
+{
+ // Define all the initial properties in the Property Set. All take
+ // *normal* modes.
+ ACE_TRY
+ {
+ this->define_properties (initial_properties
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_PropertySet-Constructor");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+// Destructor. All sequences will be deleted.
+
+TAO_PropertySet::~TAO_PropertySet (void)
+{
+}
+
+// Function to modify or add a property to the PropertySet:
+// Adds the name and the value to the set... Doesn't check for Typecode
+// overwriting, duplicate names, void names etc, yet.
+// @@ Uses Normal mode as the default mode of properties, We can
+// change this behavior based on the Initial set of allowed modes, if
+// there is anything like that set by the client.
+
+
+void
+TAO_PropertySet::define_property (const char *property_name,
+ const CORBA::Any &property_value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::InvalidPropertyName,
+ CosPropertyService::ConflictingProperty,
+ CosPropertyService::UnsupportedTypeCode,
+ CosPropertyService::UnsupportedProperty,
+ CosPropertyService::ReadOnlyProperty))
+{
+ // Check the name's validity.
+ if (property_name == 0)
+ ACE_THROW (CosPropertyService::InvalidPropertyName());
+
+ CORBA::TypeCode_var arg_tc = property_value.type ();
+
+ // Is this type allowed?
+ if (is_type_allowed (arg_tc.in ()) != 1)
+ ACE_THROW (CosPropertyService::UnsupportedTypeCode());
+
+ // Is this property allowed?
+ if (is_property_allowed (property_name) != 1)
+ ACE_THROW (CosPropertyService::UnsupportedProperty());
+
+ // Try to bind the property. Use normal mode.
+ CosProperty_Hash_Key hash_key (property_name);
+ CosProperty_Hash_Value hash_value (property_value,
+ CosPropertyService::normal);
+ COSPROPERTY_HASH_ENTRY *entry_ptr;
+ //CosProperty_Hash_Key old_key;
+ //CosProperty_Hash_Value old_value;
+
+ int ret = this->hash_table_.bind (hash_key,
+ hash_value,
+ entry_ptr);
+
+ CORBA::TypeCode_var mapped_tc;
+
+ switch (ret)
+ {
+ case 0:
+ break;
+ case 1:
+ // Property already exists.
+
+ // Is the pointer valid?
+ if (entry_ptr == 0)
+ ACE_THROW (CORBA::UNKNOWN ());
+
+ mapped_tc = entry_ptr->int_id_.pvalue_.type ();
+
+ {
+ CORBA::Boolean const equal_tc =
+ mapped_tc.in ()->equal (arg_tc.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // If type is not the same, raise exception.
+ if (!equal_tc)
+ ACE_THROW (CosPropertyService::ConflictingProperty());
+ }
+
+ // If mode is read only, raise exception.
+ if ((entry_ptr->int_id_.pmode_ == CosPropertyService::read_only) ||
+ (entry_ptr->int_id_.pmode_ == CosPropertyService::fixed_readonly))
+ ACE_THROW (CosPropertyService::ReadOnlyProperty());
+
+ // Use the mode that is already there.
+ hash_value.pmode_ = entry_ptr->int_id_.pmode_;
+
+ // Everything is fine. Overwrite the value.
+ if (this->hash_table_.rebind (hash_key,
+ hash_value) != 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_PropertySet::Define Property failed\n"));
+ ACE_THROW (CORBA::UNKNOWN ());
+ }
+ break;
+ default:
+ // Error. ret is -1.
+ ACE_THROW (CORBA::UNKNOWN ());
+ }
+
+ return;
+}
+
+// Tells whether this type is allowed in this property set or no.
+
+CORBA::Boolean
+TAO_PropertySet::is_type_allowed (CORBA::TypeCode_ptr type)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ // If the sequence is empty, no constraints.
+ if (this->allowed_property_types_.length () == 0)
+ return 1;
+
+ // Check in the allowed_property_types sequence.
+ CORBA::Boolean ret_val = 0;
+ for (CORBA::ULong ti = 0;
+ ti < this->allowed_property_types_.length ();
+ ti++)
+ {
+ ACE_TRY
+ {
+ ret_val = this->allowed_property_types_[ti]->equal (type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ret_val == 1)
+ return 1;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_PropertySet::is_type_allowed failed");
+ return ret_val;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ }
+
+ // Type not found.
+ return ret_val;
+}
+
+// Tells whether this property is allowed in this property or no.
+
+CORBA::Boolean
+TAO_PropertySet::is_property_allowed (const char* property_name)
+{
+ // If the sequence is empty, no constraints.
+ if (this->allowed_property_names_.length() == 0)
+ return 1;
+
+ // Check in the allowed_property_names.
+ for (CORBA::ULong ni = 0;
+ ni < this->allowed_property_names_.length ();
+ ni++)
+ if (ACE_OS::strcmp ((const char *) this->allowed_property_names_[ni],
+ property_name) == 0)
+ return 1;
+
+ // Name not found in the sequence.
+ return 0;
+}
+
+// Defining a sequence of properties
+//
+// Check for overwriting, duplicate names, void names etc and raise
+// appropriate exceptions.
+
+
+void
+TAO_PropertySet::define_properties (const CosPropertyService::Properties &nproperties
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::MultipleExceptions))
+{
+ // Get the length.
+ CORBA::ULong sequence_length = nproperties.length ();
+
+ // Define multiple exceptions object.
+ CosPropertyService::MultipleExceptions multi_ex;
+
+ for (CORBA::ULong pi = 0; pi < sequence_length; pi++)
+ {
+ ACE_TRY
+ {
+ // Define this property.
+ this->define_property (nproperties [pi].property_name.in (),
+ nproperties [pi].property_value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosPropertyService::InvalidPropertyName, ex)
+ {
+ CORBA::ULong len = multi_ex.exceptions.length ();
+ multi_ex.exceptions.length (len + 1);
+ multi_ex.exceptions[len].reason =
+ CosPropertyService::invalid_property_name;
+ multi_ex.exceptions[len].failing_property_name =
+ nproperties[pi].property_name;
+ }
+ ACE_CATCH (CosPropertyService::ConflictingProperty, ex)
+ {
+ CORBA::ULong len = multi_ex.exceptions.length ();
+ multi_ex.exceptions.length (len + 1);
+ multi_ex.exceptions[len].reason =
+ CosPropertyService::conflicting_property;
+ multi_ex.exceptions[len].failing_property_name =
+ nproperties[pi].property_name;
+ }
+ ACE_CATCH (CosPropertyService::ReadOnlyProperty, ex)
+ {
+ CORBA::ULong len = multi_ex.exceptions.length ();
+ multi_ex.exceptions.length (len + 1);
+ multi_ex.exceptions[len].reason =
+ CosPropertyService::read_only_property;
+ multi_ex.exceptions[len].failing_property_name =
+ nproperties[pi].property_name;
+ }
+ ACE_CATCH (CosPropertyService::UnsupportedTypeCode, ex)
+ {
+ CORBA::ULong len = multi_ex.exceptions.length ();
+ multi_ex.exceptions.length (len + 1);
+ multi_ex.exceptions[len].reason =
+ CosPropertyService::unsupported_type_code;
+ multi_ex.exceptions[len].failing_property_name =
+ nproperties[pi].property_name;
+ }
+ ACE_CATCH (CosPropertyService::UnsupportedProperty, ex)
+ {
+ CORBA::ULong len = multi_ex.exceptions.length ();
+ multi_ex.exceptions.length (len + 1);
+ multi_ex.exceptions[len].reason =
+ CosPropertyService::unsupported_property;
+ multi_ex.exceptions[len].failing_property_name =
+ nproperties[pi].property_name;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+
+ // Raise the multi exception if needed.
+ if (multi_ex.exceptions.length () > 0)
+ ACE_THROW (CosPropertyService::MultipleExceptions (multi_ex));
+}
+
+// Returns the current number of properties associated with this
+// PropertySet.
+
+
+CORBA::ULong
+TAO_PropertySet::get_number_of_properties (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return static_cast<CORBA::ULong> (this->hash_table_.current_size ());
+}
+
+// Returns all of the property names currently defined in the
+// PropertySet. If the PropertySet contains more than <how_many>
+// property names, then the remaining property names are put into the
+// PropertyNamesIterator.
+
+
+void
+TAO_PropertySet::get_all_property_names (CORBA::ULong how_many,
+ CosPropertyService::PropertyNames_out property_names,
+ CosPropertyService::PropertyNamesIterator_out rest
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Allocating storage is a must.
+ ACE_NEW (property_names,
+ CosPropertyService::PropertyNames);
+
+ CORBA::ULong num_of_properties =
+ this->get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (num_of_properties == 0)
+ // Nothing to do.
+ return;
+
+ // Set the length of the property_names appropriately.
+ CORBA::ULong sequence_length = 0;
+
+ if (how_many > 0)
+ {
+ if (how_many >= num_of_properties)
+ sequence_length = num_of_properties;
+ else
+ sequence_length = how_many;
+ property_names->length (sequence_length);
+ }
+
+ // Iterate thru names and put them in the property_names.
+
+ COSPROPERTY_HASH_ENTRY *entry_ptr;
+ COSPROPERTY_HASH_ITERATOR iterator (this->hash_table_);
+
+ for (CORBA::ULong ni = 0;
+ ni < sequence_length;
+ ni++, iterator.advance ())
+ if (iterator.next (entry_ptr) != 0)
+ property_names [ni] =
+ CORBA::string_dup (entry_ptr->ext_id_.pname_.in ());
+
+ // If there are some more properties, put them in the
+ // iterator. How?? Make a new PropertySet and use that to create
+ // propertyNames Iterator.
+
+ if (num_of_properties > how_many)
+ {
+ TAO_PropertySet *property_set;
+
+ ACE_NEW (property_set, TAO_PropertySet);
+
+ for (CORBA::ULong i = how_many;
+ i < num_of_properties;
+ i++, iterator.advance ())
+ if (iterator.next (entry_ptr) != 0)
+ if (property_set->hash_table_.bind (entry_ptr->ext_id_,
+ entry_ptr->int_id_) < 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Error:TAO_PropertySet::get_all_property_names\n"));
+
+ // Make the NamesIterator out of this TAO_PropertySet.
+ TAO_PropertyNamesIterator *names_iterator;
+ ACE_NEW (names_iterator, TAO_PropertyNamesIterator (*property_set));
+
+ // Init the out parameter.
+
+ // Get the Interface ptr.
+ CosPropertyService::PropertyNamesIterator_ptr iterator_ptr =
+ names_iterator->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // POA stuff todo here, since we have <destroy> method in the
+ // <NamesIterator> interface.
+ // Give ownership of this servant to the POA.
+ names_iterator->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Init the out parameter.
+ rest = iterator_ptr;
+ }
+}
+
+// Returns the value of a property in the PropertySet.
+
+
+CORBA::Any *
+TAO_PropertySet::get_property_value (const char *property_name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::PropertyNotFound,
+ CosPropertyService::InvalidPropertyName))
+{
+ // Check the name's validity.
+ if (property_name == 0)
+ ACE_THROW_RETURN (CosPropertyService::InvalidPropertyName(),
+ 0);
+
+ // Get the value out of the hash table.
+
+ CosProperty_Hash_Key hash_key (property_name);
+ CosProperty_Hash_Value hash_value;
+
+ if (this->hash_table_.find (hash_key, hash_value) != 0)
+ ACE_THROW_RETURN (CosPropertyService::PropertyNotFound(),
+ 0);
+
+ // Return the any value got.
+ CORBA::Any *any_ptr =0;
+ ACE_NEW_RETURN (any_ptr,
+ CORBA::Any (hash_value.pvalue_),
+ 0);
+ return any_ptr;
+}
+
+// Returns the values of the properties listed in property_names. When
+// the boolean return value is true, the Properties parameter contains
+// valid values for all requested property names. If false, then all
+// properties with a value of type tk_void may have failed due to
+// <PropertyNotFound> or <InvalidPropertyName>.
+
+
+CORBA::Boolean
+TAO_PropertySet::get_properties (const CosPropertyService::PropertyNames &property_names,
+ CosPropertyService::Properties_out nproperties
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Allocate memory for the out parameter.
+ ACE_NEW_RETURN (nproperties,
+ CosPropertyService::Properties,
+ 0);
+
+ // Validate the length.
+ CORBA::ULong n = property_names.length ();
+ if (n == 0)
+ return 0;
+
+ // Set the length for the out parameter.
+ nproperties->length (n);
+
+ // Get values for all the names.
+
+ CORBA::Any_ptr any_ptr = 0;
+ CORBA::Boolean ret_val = 1;
+
+ for (CORBA::ULong i = 0; i < n; i++)
+ {
+ any_ptr = get_property_value (property_names [i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (any_ptr != 0)
+ {
+ // Property is found.
+ nproperties [i].property_name = property_names [i];
+ nproperties [i].property_value = *any_ptr;
+ }
+ else
+ {
+ // Invalid name. Ret value is False.
+ ret_val = 0;
+
+ // Assign void type to this name in the out parameter.
+ nproperties [i].property_name =
+ property_names [i];
+
+ // Make an any value with tk_void type.
+ CORBA::Any any;
+ any._tao_set_typecode (CORBA::_tc_void);
+ nproperties [i].property_value = any;
+ }
+ }
+
+ return ret_val;
+}
+
+
+void
+TAO_PropertySet::get_all_properties (CORBA::ULong how_many,
+ CosPropertyService::Properties_out nproperties,
+ CosPropertyService::PropertiesIterator_out rest
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Allocate memory for the out parameter.
+ ACE_NEW (nproperties,
+ CosPropertyService::Properties);
+
+ // Validate the length.
+ CORBA::ULong num_of_properties =
+ this->get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (num_of_properties == 0)
+ return;
+
+ // Set the length for the nproperties if how_many > 0.
+ CORBA::ULong sequence_length = 0;
+
+ if (how_many > 0)
+ {
+ if (how_many >= num_of_properties)
+ sequence_length = num_of_properties;
+ else
+ sequence_length = how_many;
+
+ nproperties->length (sequence_length);
+ }
+
+ // Prepare an iterator and iterate through the PropertySet. Retrive
+ // the values.
+
+ COSPROPERTY_HASH_ITERATOR iterator (this->hash_table_);
+ COSPROPERTY_HASH_ENTRY *entry_ptr = 0;
+
+ for (CORBA::ULong i = 0;
+ i < sequence_length;
+ i++, iterator.advance ())
+ if (iterator.next (entry_ptr) != 0)
+ {
+ nproperties[i].property_name =
+ CORBA::string_dup (entry_ptr->ext_id_.pname_.in ());
+ nproperties[i].property_value =
+ entry_ptr->int_id_.pvalue_;
+ }
+
+ // If there are more properties, put them in the <PropertiesIterator>.
+ // Make a new <TAO_PropertySet> and use that to create an Properties
+ // iterator. put that in a iterator and assign that to the out
+ // paramerter.
+
+ if (num_of_properties > how_many)
+ {
+ TAO_PropertySet *prop_set;
+
+ ACE_NEW (prop_set, TAO_PropertySet);
+
+ for (CORBA::ULong i = sequence_length;
+ i < num_of_properties;
+ i++, iterator.advance ())
+ {
+ if (iterator.next (entry_ptr) != 0
+ && prop_set->hash_table_.bind (entry_ptr->ext_id_,
+ entry_ptr->int_id_) < 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Error:TAO_PropertySet::get_all_properties\n"));
+ }
+
+ // Make the iterator out of the new TAO_Propset.
+ TAO_PropertiesIterator *iterator = 0;
+ ACE_NEW (iterator,
+ TAO_PropertiesIterator (*prop_set));
+
+ // Init the out parameter.
+
+ // Get the interface ptr.
+ CosPropertyService::PropertiesIterator_ptr iterator_ptr =
+ iterator->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // POA stuff todo here, since we have <destroy> method in the
+ // <NamesIterator> interface.
+ // Give ownership of this servant to the POA.
+ iterator->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Init the out parameter.
+ rest = iterator_ptr;
+ }
+}
+
+// Deletes the specified property if it exists from a PropertySet.
+
+
+void
+TAO_PropertySet::delete_property (const char *property_name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::PropertyNotFound,
+ CosPropertyService::InvalidPropertyName,
+ CosPropertyService::FixedProperty))
+{
+ // Check the name's validity.
+ if (property_name == 0)
+ ACE_THROW (CosPropertyService::InvalidPropertyName());
+
+ // Get the entry from the Hash Table.
+
+ CosProperty_Hash_Key hash_key (property_name);
+ COSPROPERTY_HASH_ENTRY *entry_ptr = 0;
+
+ if (this->hash_table_.find (hash_key,
+ entry_ptr) == -1)
+ ACE_THROW (CosPropertyService::PropertyNotFound());
+
+ // If property is fixed, then raise exception.
+ if ((entry_ptr->int_id_.pmode_ == CosPropertyService::fixed_normal)
+ || (entry_ptr->int_id_.pmode_ == CosPropertyService::fixed_readonly))
+ ACE_THROW (CosPropertyService::FixedProperty());
+
+ // Unbind this property.
+ if (this->hash_table_.unbind (entry_ptr) != 0)
+ {
+ ACE_THROW (CORBA::UNKNOWN ());
+ }
+
+ return;
+}
+
+// Deletes the properties defined in the property_names
+// parameter. This is a batch operation that returns the
+// MultipleExceptions exception if any delete failed.
+
+
+void
+TAO_PropertySet::delete_properties (const CosPropertyService::PropertyNames &property_names
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::MultipleExceptions))
+{
+ // Get the length.
+ CORBA::ULong sequence_length = property_names.length ();
+
+ // Declare multiple exceptions' object.
+ CosPropertyService::MultipleExceptions *multi_ex = 0;
+ ACE_NEW (multi_ex,
+ CosPropertyService::MultipleExceptions);
+
+ for (CORBA::ULong pi = 0; pi < sequence_length; pi++)
+ {
+ ACE_TRY
+ {
+ // Delete this property.
+ this->delete_property (property_names[pi]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosPropertyService::InvalidPropertyName, ex)
+ {
+ // Put this exception in the multiple exception.
+ CORBA::ULong len = multi_ex->exceptions.length ();
+ multi_ex->exceptions.length (len + 1);
+ multi_ex->exceptions[len].reason =
+ CosPropertyService::invalid_property_name;
+ multi_ex->exceptions[len].failing_property_name =
+ property_names[pi];
+ }
+ ACE_CATCH (CosPropertyService::PropertyNotFound, ex)
+ {
+ // Put this exception in the multiple exception.
+ CORBA::ULong len = multi_ex->exceptions.length ();
+ multi_ex->exceptions.length (len + 1);
+ multi_ex->exceptions[len].reason =
+ CosPropertyService::property_not_found;
+ multi_ex->exceptions[len].failing_property_name =
+ property_names[pi];
+ }
+ ACE_CATCH (CosPropertyService::FixedProperty, ex)
+ {
+ // Put this exception in the multiple exception.
+ CORBA::ULong len = multi_ex->exceptions.length ();
+ multi_ex->exceptions.length (len + 1);
+ multi_ex->exceptions[len].reason =
+ CosPropertyService::fixed_property;
+ multi_ex->exceptions[len].failing_property_name =
+ property_names[pi];
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ // We cant afford to get this. Throw this.
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+
+ // Raise the multiple exceptions if there are any.
+ if (multi_ex->exceptions.length () > 0)
+ ACE_THROW (CosPropertyService::MultipleExceptions (*multi_ex));
+}
+
+// Delete all the properties in the current ProperySet : Delete the
+// properties one by one.
+
+
+CORBA::Boolean
+TAO_PropertySet::delete_all_properties (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Get all the property names in a names' sequence.
+ CosPropertyService::PropertyNames *names_ptr = 0;
+ CosPropertyService::PropertyNames_out names_out (names_ptr);
+ CosPropertyService::PropertyNames_var names;
+
+ CosPropertyService::PropertyNamesIterator *iter_ptr = 0;
+ CosPropertyService::PropertyNamesIterator_out iter_out (iter_ptr);
+ CosPropertyService::PropertyNamesIterator_var iter;
+
+ CORBA::ULong size = this->get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->get_all_property_names (size,
+ names_out,
+ iter_out
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Get the out values on to the var varibles.
+ names = names_out.ptr ();
+ iter = iter_out.ptr ();
+
+ // Delete all these properties.
+ this->delete_properties (names.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // All properties deleted.
+ return 1;
+}
+
+// Returns TRUE if the property is defined in the PropertySet.
+
+
+CORBA::Boolean
+TAO_PropertySet::is_property_defined (const char *property_name
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::InvalidPropertyName))
+{
+ CosProperty_Hash_Key hash_key (property_name);
+
+ if (this->hash_table_.find (hash_key) == 0)
+ return 1;
+ else
+ return 0;
+}
+
+
+void
+TAO_PropertySet::operator= (const TAO_PropertySet &)
+{
+ // Empty.
+}
+
+//======================================================================
+
+// Makes default sized hash_table_.
+
+TAO_PropertySetDef::TAO_PropertySetDef (void)
+{
+}
+
+// Constructor that the factory uses.
+
+TAO_PropertySetDef::TAO_PropertySetDef (const CosPropertyService::PropertyTypes allowed_property_types,
+ const CosPropertyService::PropertyDefs allowed_property_defs
+ ACE_ENV_ARG_DECL)
+ : TAO_PropertySet(allowed_property_types,
+ allowed_property_defs.length ()
+ ACE_ENV_ARG_PARAMETER)
+{
+ // Set the length of the allowed property names.
+ this->allowed_property_names_.length (allowed_property_defs.length ());
+
+ // Copy the allowed properties' names to the sequence.
+ for (CORBA::ULong ni = 0; ni < allowed_property_defs.length (); ni++)
+ this->allowed_property_names_[ni] =
+ allowed_property_defs[ni].property_name;
+
+ // Define the allowed properties in the hash table.
+ ACE_TRY
+ {
+ this->define_properties_with_modes (allowed_property_defs
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+// Constructor that the factory uses.
+
+TAO_PropertySetDef::TAO_PropertySetDef (const CosPropertyService::PropertyDefs initial_property_defs
+ ACE_ENV_ARG_DECL)
+{
+ this->define_properties_with_modes (initial_property_defs
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// Destructor.
+
+TAO_PropertySetDef::~TAO_PropertySetDef (void)
+{
+}
+
+// Return the sequence that is there in side.
+void
+TAO_PropertySetDef::get_allowed_property_types (CosPropertyService::PropertyTypes_out property_types
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Copy contents of the sequence.
+ ACE_NEW (property_types,
+ CosPropertyService::PropertyTypes (this->allowed_property_types_));
+}
+
+void
+TAO_PropertySetDef::get_allowed_properties (CosPropertyService::PropertyDefs_out property_defs
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // We have all the names, get the values and the modes from the Hash
+ // Table and return.
+
+ // Allocate memory.
+ ACE_NEW (property_defs,
+ CosPropertyService::PropertyDefs (this->allowed_property_names_.length ()));
+
+ // Get the modes and property values for all these property
+ // names. Some may not be there in the Hash Table, probably got
+ // deleted because of their modes were not safe.
+
+ // @@ TO DO.
+}
+
+// Check for name's validity. If name not there define it. If it is
+// there and if type is equal and if mode allows define it else raise
+// exception.
+void
+TAO_PropertySetDef::define_property_with_mode (const char *property_name,
+ const CORBA::Any &property_value,
+ CosPropertyService::PropertyModeType property_mode
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::InvalidPropertyName,
+ CosPropertyService::ConflictingProperty,
+ CosPropertyService::UnsupportedTypeCode,
+ CosPropertyService::UnsupportedProperty,
+ CosPropertyService::UnsupportedMode,
+ CosPropertyService::ReadOnlyProperty))
+{
+ // Check the names validity.
+ if (property_name == 0)
+ ACE_THROW (CosPropertyService::InvalidPropertyName());
+
+ // Is this type allowed?
+ if (is_type_allowed (property_value.type ()) != 1)
+ ACE_THROW (CosPropertyService::UnsupportedTypeCode());
+
+ // Is this property allowed?
+ if (is_property_allowed (property_name) != 1)
+ ACE_THROW (CosPropertyService::UnsupportedProperty());
+
+ // Is this a valid mode.
+ if (property_mode == CosPropertyService::undefined)
+ ACE_THROW (CosPropertyService::UnsupportedMode());
+
+ // Try to bind the Property.
+ CosProperty_Hash_Key hash_key (property_name);
+ CosProperty_Hash_Value hash_value (property_value,
+ property_mode);
+ COSPROPERTY_HASH_ENTRY *entry_ptr;
+
+
+ int ret = this->hash_table_.bind (hash_key, hash_value, entry_ptr);
+
+ //CosProperty_Hash_Value old_value;
+ //CosProperty_Hash_Key old_key;
+
+ switch (ret)
+ {
+ case 0:
+ break;
+ case 1:
+ // Property name exists.
+
+ // Is the pointer valid.
+ if (entry_ptr == 0)
+ ACE_THROW (CORBA::UNKNOWN ());
+
+ // If type is not the same, raise exception.
+ if (entry_ptr->int_id_.pvalue_.type () != property_value.type ())
+ ACE_THROW (CosPropertyService::ConflictingProperty());
+
+ // If mode is read only, raise exception.
+ if ((entry_ptr->int_id_.pmode_ == CosPropertyService::read_only) ||
+ (entry_ptr->int_id_.pmode_ == CosPropertyService::fixed_readonly))
+ ACE_THROW (CosPropertyService::ReadOnlyProperty());
+
+ // If current mode is fixed_normal, but the new mode is not
+ // fixed, reject it.
+ if ((entry_ptr->int_id_.pmode_ ==
+ CosPropertyService::fixed_normal) &&
+ (property_mode < CosPropertyService::fixed_normal))
+ ACE_THROW (CosPropertyService::UnsupportedMode());
+
+ // Everything is fine. Overwrite the value.
+ if (this->hash_table_.rebind (hash_key,
+ hash_value) > 0)
+ {
+ break;
+ }
+ default:
+ // Error. ret is -1 or rebind returned other than 1.
+ ACE_THROW (CORBA::UNKNOWN ());
+ }
+
+ return;
+}
+
+// Define one by one. If any excceptions raised, build
+// MultipleExceptions sequence and raise that.
+void
+TAO_PropertySetDef::define_properties_with_modes (const CosPropertyService::PropertyDefs &property_defs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::MultipleExceptions))
+{
+ // Get the length.
+ CORBA::ULong sequence_length = property_defs.length ();
+
+ // Define multiple exceptions object.
+ CosPropertyService::MultipleExceptions multi_ex;
+
+ // Try defining the propdefs one by one.
+ for (CORBA::ULong i = 0; i < sequence_length; i++)
+ {
+ ACE_TRY
+ {
+ // Define the property.
+ this->define_property_with_mode (property_defs[i].property_name,
+ property_defs[i].property_value,
+ property_defs[i].property_mode
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosPropertyService::InvalidPropertyName, ex)
+ {
+ CORBA::ULong len = multi_ex.exceptions.length ();
+ multi_ex.exceptions.length (len + 1);
+ multi_ex.exceptions[len].reason =
+ CosPropertyService::invalid_property_name;
+ multi_ex.exceptions[len].failing_property_name =
+ property_defs[i].property_name;
+ }
+ ACE_CATCH (CosPropertyService::ConflictingProperty, ex)
+ {
+ CORBA::ULong len = multi_ex.exceptions.length ();
+ multi_ex.exceptions.length (len + 1);
+ multi_ex.exceptions[len].reason =
+ CosPropertyService::conflicting_property;
+ multi_ex.exceptions[len].failing_property_name =
+ property_defs[i].property_name;
+ }
+ ACE_CATCH (CosPropertyService::ReadOnlyProperty, ex)
+ {
+ CORBA::ULong len = multi_ex.exceptions.length ();
+ multi_ex.exceptions.length (len + 1);
+ multi_ex.exceptions[len].reason =
+ CosPropertyService::read_only_property;
+ multi_ex.exceptions[len].failing_property_name =
+ property_defs[i].property_name;
+ }
+ ACE_CATCH (CosPropertyService::UnsupportedTypeCode, ex)
+ {
+ CORBA::ULong len = multi_ex.exceptions.length ();
+ multi_ex.exceptions.length (len + 1);
+ multi_ex.exceptions[len].reason =
+ CosPropertyService::unsupported_type_code;
+ multi_ex.exceptions[len].failing_property_name =
+ property_defs[i].property_name;
+ }
+ ACE_CATCH (CosPropertyService::UnsupportedProperty, ex)
+ {
+ CORBA::ULong len = multi_ex.exceptions.length ();
+ multi_ex.exceptions.length (len + 1);
+ multi_ex.exceptions[len].reason =
+ CosPropertyService::unsupported_property;
+ multi_ex.exceptions[len].failing_property_name =
+ property_defs[i].property_name;
+ }
+ ACE_CATCH (CosPropertyService::UnsupportedMode, ex)
+ {
+ CORBA::ULong len = multi_ex.exceptions.length ();
+ multi_ex.exceptions.length (len + 1);
+ multi_ex.exceptions[len].reason =
+ CosPropertyService::unsupported_mode;
+ multi_ex.exceptions[len].failing_property_name =
+ property_defs[i].property_name;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+
+ // Raise the multi exception if needed.
+ if (multi_ex.exceptions.length () > 0)
+ ACE_THROW (CosPropertyService::MultipleExceptions (multi_ex));
+}
+
+// Get the mode of a property. Raises InvalidpropertyName,
+// PropertyNotFound exceptions.
+CosPropertyService::PropertyModeType
+TAO_PropertySetDef::get_property_mode (const char *property_name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::PropertyNotFound,
+ CosPropertyService::InvalidPropertyName))
+{
+ // Check for the name's validity.
+ if (property_name == 0)
+ ACE_THROW_RETURN (CosPropertyService::InvalidPropertyName(),
+ CosPropertyService::undefined);
+
+ // Find the property in the hash table.
+ CosProperty_Hash_Key hash_key (property_name);
+ CosProperty_Hash_Value hash_value;
+
+ int ret = this->hash_table_.find (hash_key, hash_value);
+
+ switch (ret)
+ {
+ case 0:
+ // Property found.
+ return hash_value.pmode_;
+ default:
+ // Error or property is not found.
+ ACE_THROW_RETURN (CosPropertyService::PropertyNotFound(),
+ CosPropertyService::undefined);
+ }
+}
+
+// Batch operation for getting the property. Invoke get_property_mode
+// for each name.
+// Return value False indicates that properties with *undefined* modes
+// have failed due to PropertyNotFound or InvalidPropertyName exception.
+// Returning False in case of *Nothing to retun* or New is
+// failing. The caller has to check the out parameter whether it is
+// Nil or no, before doing something with it.
+CORBA::Boolean
+TAO_PropertySetDef::get_property_modes (const CosPropertyService::PropertyNames &property_names,
+ CosPropertyService::PropertyModes_out property_modes
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Allocate memory for the out parameter.
+ ACE_NEW_RETURN (property_modes,
+ CosPropertyService::PropertyModes,
+ 1);
+
+ // Validate the length of names sequence.
+ CORBA::ULong sequence_length = property_names.length ();
+
+ if (sequence_length == 0)
+ return 1;
+
+ // Set the length of the sequence.
+ property_modes->length (sequence_length);
+
+ // Intialize thre return value.
+ CORBA::Boolean ret = 1;
+
+ // Invoking get_property_mode for each name.
+ CosPropertyService::PropertyModeType mode;
+ for (CORBA::ULong i = 0; i < sequence_length; i++)
+ {
+ ACE_TRY
+ {
+ // Invoke get_property_mode for this name.
+ mode = this->get_property_mode (property_names[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Store the mode in the out sequence.
+ property_modes[i].property_name = property_names[i];
+ property_modes[i].property_mode = mode;
+ }
+ ACE_CATCHANY
+ {
+ // Return value becomes false.
+ ret = 1;
+
+ // Assign this property to the out parameter with undefined
+ // mode.
+ property_modes[i].property_name = property_names[i];
+ property_modes[i].property_mode = CosPropertyService::undefined;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ }
+
+ return ret;
+}
+
+// Changing the mode of the property.
+// "Normal" to anything is possible.
+// "Readonly" mode to "Fixed-Readonly" is possible. Others not possible.
+// "Fixed-Normal" to "Fixed-Readonly" is possible. Other things are impossible.
+// "Fixed-Readonly" to anything is *not* possible.
+void
+TAO_PropertySetDef::set_property_mode (const char *property_name,
+ CosPropertyService::PropertyModeType property_mode
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::InvalidPropertyName,
+ CosPropertyService::PropertyNotFound,
+ CosPropertyService::UnsupportedMode))
+{
+ // Check the names validity.
+ if (property_name == 0)
+ ACE_THROW (CosPropertyService::InvalidPropertyName());
+
+ // Trying to set to undefined mode is not allowed.
+ if (property_mode == CosPropertyService::undefined)
+ ACE_THROW (CosPropertyService::UnsupportedMode());
+
+ // Find the property from the Hash Table.
+ CosProperty_Hash_Key hash_key (property_name);
+ CosProperty_Hash_Value hash_value;
+
+ int ret = this->hash_table_.find (hash_key, hash_value);
+
+ //CosProperty_Hash_Value old_value;
+ //CosProperty_Hash_Key old_key;
+
+ // Act acc to the ret value.
+ switch (ret)
+ {
+ case 0:
+ // Property found.
+
+ // If the new mode is the same as the old one, nothing to do.
+ if (hash_value.pmode_ == property_mode)
+ return;
+
+ // Check for legality of the mode change.
+ switch (hash_value.pmode_)
+ {
+ case CosPropertyService::normal:
+ // Set the new mode and update the hash table.
+ hash_value.pmode_ = property_mode;
+ if (this->hash_table_.rebind (hash_key,
+ hash_value) != 1)
+ // Return values 0 and -1 are not possible.
+ ACE_THROW (CORBA::UNKNOWN ());
+ break;
+
+ case CosPropertyService::read_only:
+ // Read_only to fixed read only alone is possible.
+ if (property_mode != CosPropertyService::fixed_readonly)
+ ACE_THROW (CosPropertyService::UnsupportedMode());
+ else
+ {
+ // Change the mode and update hash table.
+ hash_value.pmode_ = property_mode;
+ if (this->hash_table_.rebind (hash_key,
+ hash_value) != 1)
+ // Return values 0 and -1 are not possible.
+ ACE_THROW (CORBA::UNKNOWN ());
+ }
+ break;
+
+ case CosPropertyService::fixed_normal:
+ // Fixed_normal to fixed_readonly alone is possible.
+ if (property_mode != CosPropertyService::fixed_readonly)
+ ACE_THROW (CosPropertyService::UnsupportedMode());
+ else
+ {
+ // Change the mode and update the hash table.
+ hash_value.pmode_ = property_mode;
+ if (this->hash_table_.rebind (hash_key,
+ hash_value) != 1)
+ // Return values 0 and -1 are not possible.
+ ACE_THROW (CORBA::UNKNOWN ());
+ }
+ break;
+
+ default:
+ // Fixed_readonly to any mode is not possible.
+ ACE_THROW (CosPropertyService::UnsupportedMode());
+ }
+ break;
+ case -1:
+ default:
+ // Error or property not found in the Hash Table.
+ ACE_THROW (CosPropertyService::PropertyNotFound());
+ }
+}
+
+// Batch operation for setting the property. Raises
+// MultipleExceptions. Set the properties one by one, catch
+// exceptions if any and keep them as in the multiple exceptions
+// sequence and return.
+
+void
+TAO_PropertySetDef::set_property_modes (const CosPropertyService::PropertyModes &property_modes
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::MultipleExceptions))
+{
+ // Get the length of the sequence.
+ CORBA::ULong sequence_length = property_modes.length ();
+
+ // Multiple exception variable to keep track of exceptions.
+ CosPropertyService::MultipleExceptions multi_ex;
+
+ // Set modes one by one.
+ for (CORBA::ULong i = 0; i < sequence_length; i++)
+ {
+ ACE_TRY
+ {
+ this->set_property_mode (property_modes[i].property_name,
+ property_modes[i].property_mode
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosPropertyService::PropertyNotFound, ex)
+ {
+ // Put this exception in the multiple exception.
+ CORBA::ULong len = multi_ex.exceptions.length ();
+ multi_ex.exceptions.length (len + 1);
+ multi_ex.exceptions[len].reason =
+ CosPropertyService::property_not_found;
+ multi_ex.exceptions[len].failing_property_name =
+ property_modes[i].property_name;
+ }
+ ACE_CATCH (CosPropertyService::InvalidPropertyName, ex)
+ {
+ // Put this exception in the multiple exception.
+ CORBA::ULong len = multi_ex.exceptions.length ();
+ multi_ex.exceptions.length (len + 1);
+ multi_ex.exceptions[len].reason =
+ CosPropertyService::invalid_property_name;
+ multi_ex.exceptions[len].failing_property_name =
+ property_modes[i].property_name;
+ }
+ ACE_CATCH (CosPropertyService::UnsupportedMode, ex)
+ {
+ // Put this exception in the multiple exception.
+ CORBA::ULong len = multi_ex.exceptions.length ();
+ multi_ex.exceptions.length (len + 1);
+ multi_ex.exceptions[len].reason =
+ CosPropertyService::unsupported_mode;
+ multi_ex.exceptions[len].failing_property_name =
+ property_modes[i].property_name;
+ }
+ ACE_CATCH (CORBA::SystemException, systex)
+ {
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+
+ // Raise the multi_ex, if needed.
+ if (multi_ex.exceptions.length () > 0)
+ ACE_THROW (CosPropertyService::MultipleExceptions (multi_ex));
+}
+
+//======================================================================
+
+// Constructor. Construct the iterator from the PropertySet object.
+
+TAO_PropertyNamesIterator::TAO_PropertyNamesIterator (TAO_PropertySet &property_set)
+ : iterator_ (property_set.hash_table_)
+{
+}
+
+// Destructor.
+
+TAO_PropertyNamesIterator::~TAO_PropertyNamesIterator (void)
+{
+}
+
+// Resets the position in an iterator to the first property name, if
+// one exists.
+
+void
+TAO_PropertyNamesIterator::reset (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->iterator_ = this->iterator_.map ().begin ();
+}
+
+// The next_one operation returns true if an item exists at the
+// current position in the iterator with an output parameter of a
+// property name. A return of false signifies no more items in the
+// iterator.
+
+CORBA::Boolean
+TAO_PropertyNamesIterator::next_one (CORBA::String_out property_name
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ COSPROPERTY_HASH_ENTRY *entry_ptr;
+
+ if (this->iterator_.next (entry_ptr) != 0)
+ {
+ property_name =
+ CORBA::string_dup (entry_ptr->ext_id_.pname_.in ());
+ this->iterator_.advance ();
+ return 1;
+ }
+ else
+ return 0;
+}
+
+CORBA::Boolean
+TAO_PropertyNamesIterator::next_n (CORBA::ULong how_many,
+ CosPropertyService::PropertyNames_out property_names
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Allocate memory for the out parameter.
+ ACE_NEW_RETURN (property_names,
+ CosPropertyService::PropertyNames,
+ 0);
+
+ COSPROPERTY_HASH_ENTRY *entry_ptr = 0;
+
+ if (this->iterator_.next (entry_ptr) == 0 || how_many == 0)
+ return 0;
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (this->iterator_.map ().current_size ());
+
+ CORBA::ULong len = 0;
+ if (how_many <= size)
+ len = how_many;
+ else
+ len = size;
+ property_names->length (len);
+
+ for (CORBA::ULong ni = 0;
+ ni < property_names->length ();
+ ni++, this->iterator_.advance ())
+ if (this->iterator_.next (entry_ptr) != 0)
+ property_names [ni] =
+ CORBA::string_dup (entry_ptr->ext_id_.pname_.in ());
+
+ return 1;
+}
+
+void
+TAO_PropertyNamesIterator::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Remove self from POA. Because of reference counting, the POA
+ // will automatically delete the servant when all pending requests
+ // on this servant are complete.
+
+ 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;
+}
+
+//======================================================================
+
+TAO_PropertiesIterator::TAO_PropertiesIterator (TAO_PropertySet &property_set)
+ : iterator_ (property_set.hash_table_)
+{
+}
+
+TAO_PropertiesIterator::~TAO_PropertiesIterator (void)
+{
+}
+
+void
+TAO_PropertiesIterator::reset (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->iterator_ = this->iterator_.map ().begin ();
+}
+
+CORBA::Boolean
+TAO_PropertiesIterator::next_one (CosPropertyService::Property_out aproperty
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ COSPROPERTY_HASH_ENTRY *entry_ptr;
+
+ if (this->iterator_.next (entry_ptr) != 0)
+ {
+ aproperty = new CosPropertyService::Property;
+ aproperty->property_name = entry_ptr->ext_id_.pname_;
+ aproperty->property_value = entry_ptr->int_id_.pvalue_;
+ this->iterator_.advance ();
+ return 1;
+ }
+ else
+ {
+ aproperty = new CosPropertyService::Property;
+ return 0;
+ }
+}
+
+CORBA::Boolean
+TAO_PropertiesIterator::next_n (CORBA::ULong how_many,
+ CosPropertyService::Properties_out nproperties
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Allocate memory for the out parameter.
+ ACE_NEW_RETURN (nproperties,
+ CosPropertyService::Properties,
+ 0);
+
+ COSPROPERTY_HASH_ENTRY *entry_ptr = 0;
+
+ if (this->iterator_.next (entry_ptr) == 0 || how_many == 0)
+ return 0;
+
+ CORBA::ULong size = static_cast<CORBA::ULong> (this->iterator_.map ().current_size ());
+
+ CORBA::ULong len;
+ if (how_many <= size)
+ len = how_many;
+ else
+ len = size;
+ nproperties->length (len);
+
+ for (CORBA::ULong ni = 0;
+ ni < nproperties->length ();
+ ni++,
+ this->iterator_.advance ())
+ {
+ if (this->iterator_.next (entry_ptr) != 0)
+ {
+ nproperties [ni].property_name = entry_ptr->ext_id_.pname_;
+ nproperties [ni].property_value =
+ entry_ptr->int_id_.pvalue_;
+ }
+ else
+ break;
+ }
+
+ return 1;
+}
+
+void
+TAO_PropertiesIterator::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Remove self from POA. Because of reference counting, the POA
+ // will automatically delete the servant when all pending requests
+ // on this servant are complete.
+
+ 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;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.h b/TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.h
new file mode 100644
index 00000000000..d887745dec3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.h
@@ -0,0 +1,621 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CosPropertyService_i.h
+ *
+ * $Id$
+ *
+ * @author Alexander Babu Arulanthu <alex@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_COSPROPERTYSERVICE_I_H
+#define TAO_COSPROPERTYSERVICE_I_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Property/property_serv_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosPropertyS.h"
+
+#include "tao/Sequence_T.h"
+#include "ace/Hash_Map_Manager.h"
+#include "ace/Null_Mutex.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// = Classes to deal with the ACE_Hash_Map_Manager.
+
+class TAO_Property_Serv_Export CosProperty_Hash_Key
+{
+ // = TITLE
+ // Key for the Hash Table. The EXT_ID of the
+ // ACE_Hash_Map_Manager.
+public:
+ // = Initialization and termination methods.
+
+ CosProperty_Hash_Key (void);
+ // Default constructor.
+
+ CosProperty_Hash_Key (const char * &name);
+ // Constructor from a const string.
+
+ CosProperty_Hash_Key (const CosPropertyService::PropertyName &name);
+ // Costructor that takes PropertyName.
+
+ CosProperty_Hash_Key (const CosProperty_Hash_Key &hash_key);
+ // Copy constructor.
+
+ virtual ~CosProperty_Hash_Key (void);
+ // Destructor.
+
+ virtual bool operator == (const CosProperty_Hash_Key &hash_key) const;
+ // The operator for hash binding and "find"ing.
+
+ virtual u_long hash (void) const;
+ // The function that computes a hash value.
+
+// private:
+
+ CosPropertyService::PropertyName_var pname_;
+ // Storage pointer.
+};
+
+class TAO_Property_Serv_Export CosProperty_Hash_Value
+{
+ // = TITLE
+ // This will be the value part in the Hash_Table. The INT_ID of
+ // the ACE_Hash_Map_Manager.
+public:
+ // = Initialization and termination methods.
+
+ CosProperty_Hash_Value (void);
+ // Default constructor.
+
+ CosProperty_Hash_Value (const CORBA::Any &any,
+ const CosPropertyService::PropertyModeType &mode);
+ // Constructor with the property_value and the property_mode.
+
+ CosProperty_Hash_Value (const CosProperty_Hash_Value &hash_value);
+ // Copy constructor.
+
+ virtual ~CosProperty_Hash_Value (void);
+ // Destructor.
+
+//private:
+
+ CORBA::Any pvalue_;
+ // property value.
+
+ CosPropertyService::PropertyModeType pmode_;
+ // Property Mode.
+};
+
+// ============================================================================
+
+// Forward declaration.
+class TAO_PropertySet;
+
+// ============================================================================
+
+class TAO_Property_Serv_Export TAO_PropertySetFactory : public virtual POA_CosPropertyService::PropertySetFactory
+{
+ // = TITLE
+ // Factory class for the TAO_PropertySet class objects.
+ //
+ // = DESCRIPTION
+ // The object may be created with some predfined properties.
+public:
+ // = Initialization and termination methods.
+
+ TAO_PropertySetFactory (void);
+ // Constructor.
+
+ virtual ~TAO_PropertySetFactory (void);
+ // Destructor.
+
+ virtual CosPropertyService::PropertySet_ptr
+ create_propertyset (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Returns a new TAO_PropertySet object. "The property set returned
+ // will *not* have any initial properties."
+
+ virtual CosPropertyService::PropertySet_ptr
+ create_constrained_propertyset (const CosPropertyService::PropertyTypes &allowed_property_types,
+ const CosPropertyService::Properties &allowed_properties
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::ConstraintNotSupported));
+ // Allows a client to create a new TAO_PropertySet with specific
+ // constraints. "All the properties will have *fixed-normal* modes".
+
+ virtual CosPropertyService::PropertySet_ptr
+ create_initial_propertyset (const CosPropertyService::Properties &initial_properties
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::MultipleExceptions));
+ // Allows a client to create a new TAO_PropertySet with specific
+ // initial properties."All the properties will have *fixed-normal"
+ // modes".
+
+private:
+ TAO::unbounded_value_sequence<TAO_PropertySet*> propertyset_products_;
+ // The PropertySet objects new'ed and given to the client. Let us
+ // keep track all of them so that we can delete them at the end.
+};
+
+// ============================================================================
+
+// Forward declaration.
+class TAO_PropertySetDef;
+
+// ============================================================================
+
+class TAO_Property_Serv_Export TAO_PropertySetDefFactory : public virtual POA_CosPropertyService::PropertySetDefFactory
+{
+ // = TITLE
+ // Factory class for the TAO_PropertySetDef objects.
+ //
+ // = DESCRIPTION
+ // The object creation may be done with some predefined properties.
+public:
+ // = Initialization and termination methods.
+
+ TAO_PropertySetDefFactory(void);
+ // Constructor.
+
+ virtual ~TAO_PropertySetDefFactory (void);
+ // Destructor.
+
+ virtual CosPropertyService::PropertySetDef_ptr
+ create_propertysetdef (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Returns a new TAO_PropertySetDef object.
+
+ virtual CosPropertyService::PropertySetDef_ptr
+ create_constrained_propertysetdef (const CosPropertyService::PropertyTypes &allowed_property_types,
+ const CosPropertyService::PropertyDefs &allowed_property_defs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::ConstraintNotSupported));
+ // Allows a client to create a new TAO_PropertySetDef with specific
+ // constraints.
+
+ virtual CosPropertyService::PropertySetDef_ptr
+ create_initial_propertysetdef (const CosPropertyService::PropertyDefs &initial_property_defs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::MultipleExceptions));
+ // Allows a client to create a new TAO_PropertySetDef with specific
+ // initial properties.
+
+private:
+ TAO::unbounded_value_sequence<TAO_PropertySetDef*> propertysetdef_products_;
+ // The PropertySet objects new'ed and given to the client. Let us
+ // keep track all of them so that we can delete them at the end.
+};
+
+// ============================================================================
+
+class TAO_Property_Serv_Export TAO_PropertySet : public virtual POA_CosPropertyService::PropertySet
+{
+ // = TITLE
+ // Gives operations for defining, deleting, enumerating and
+ // checking of properties.
+ //
+ // = DESCRIPTION
+ // Uses a HashTable to manage the properties.
+public:
+ friend class TAO_PropertyNamesIterator;
+ friend class TAO_PropertiesIterator;
+
+ // = Initialization and termination methods.
+
+ TAO_PropertySet (void);
+ // Default constructor.
+
+ TAO_PropertySet (const CosPropertyService::PropertyTypes allowed_property_types,
+ const CosPropertyService::Properties allowed_properties
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ // Init values that the PropertySetFactory will want to specify.
+
+ TAO_PropertySet (const CosPropertyService::Properties initial_properties
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ // PropertySetFactory needs this constructor.
+
+ TAO_PropertySet (const CosPropertyService::PropertyTypes allowed_property_types,
+ const CORBA::ULong number_of_allowed_propertydefs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ // PropertySetDef's construction needs this.
+
+ virtual ~TAO_PropertySet (void);
+ // Destructor function.
+
+ virtual void define_property (const char *property_name,
+ const CORBA::Any &property_value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::InvalidPropertyName,
+ CosPropertyService::ConflictingProperty,
+ CosPropertyService::UnsupportedTypeCode,
+ CosPropertyService::UnsupportedProperty,
+ CosPropertyService::ReadOnlyProperty));
+
+ // Store the property in the hash after checking for validity of the
+ // property name, duplicate name, type code over writing etc.
+
+ virtual void define_properties (const CosPropertyService::Properties &nproperties
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::MultipleExceptions));
+ // Define a sequence of properties at a time.
+
+ virtual CORBA::ULong get_number_of_properties (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Get the number of properties that are currently defined in the
+ // PropertySet.
+
+ virtual void get_all_property_names (CORBA::ULong how_many,
+ CosPropertyService::PropertyNames_out property_names,
+ CosPropertyService::PropertyNamesIterator_out rest
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Get the names of all the properties that are currently defined in
+ // the property set.
+
+ virtual CORBA::Any *get_property_value (const char *property_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::PropertyNotFound,
+ CosPropertyService::InvalidPropertyName));
+ // Get the value of the property, given the name.
+
+ virtual CORBA::Boolean get_properties (const CosPropertyService::PropertyNames &property_names,
+ CosPropertyService::Properties_out nproperties
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Get all names and their property values.
+
+ virtual void get_all_properties (CORBA::ULong how_many,
+ CosPropertyService::Properties_out nproperties,
+ CosPropertyService::PropertiesIterator_out rest
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Returns all of the property names currently defined in the
+ // PropertySet. If the PropertySet contains more than how_many
+ // property names, then the remaining property names are put into the PropertyNamesIterator.
+
+ virtual void delete_property (const char *property_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::PropertyNotFound,
+ CosPropertyService::InvalidPropertyName,
+ CosPropertyService::FixedProperty));
+ // Delete a property given a name.
+
+ virtual void delete_properties (const CosPropertyService::PropertyNames &property_names
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::MultipleExceptions));
+ // Delete all the these properties from this property set.
+
+ virtual CORBA::Boolean delete_all_properties (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Delete everything from this property set.
+
+ virtual CORBA::Boolean is_property_defined (const char *property_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::InvalidPropertyName));
+ // Tell whether this property is defined or no. Forget about the
+ // value.
+
+protected:
+ typedef ACE_Hash_Map_Manager<CosProperty_Hash_Key, CosProperty_Hash_Value, ACE_Null_Mutex>
+ COSPROPERTY_HASH_MAP;
+ typedef ACE_Hash_Map_Entry<CosProperty_Hash_Key, CosProperty_Hash_Value>
+ COSPROPERTY_HASH_ENTRY;
+ typedef ACE_Hash_Map_Iterator<CosProperty_Hash_Key, CosProperty_Hash_Value, ACE_Null_Mutex>
+ COSPROPERTY_HASH_ITERATOR;
+ // Typedefs are useful.
+
+ CORBA::Boolean is_type_allowed (CORBA::TypeCode_ptr type);
+ // Tells whether this type is allowed in this property set or no.
+
+ CORBA::Boolean is_property_allowed (const char *name);
+ // Tells whether this property is allowed in this property set or
+ // no.
+
+private:
+ void operator= (const TAO_PropertySet &);
+ // Made private because not usable
+
+ TAO_PropertySet (const TAO_PropertySet &);
+ // Not possible to copy
+
+public: // @todo make private
+ COSPROPERTY_HASH_MAP hash_table_;
+ // This Hash_Table manages storage for our properties.
+
+protected:
+ CosPropertyService::PropertyTypes allowed_property_types_;
+ // Stores the property types that can be allowed in this property
+ // set.
+
+ CosPropertyService::PropertyNames allowed_property_names_;
+ // Stores the property names that are allowed in this property
+ // set. These properties will be defined with *fixed-normal* modes, by default, at
+ // creation.
+ // If this is *not* empty, these properties will be the only
+ // properties that will exist in this property set. Nothing more
+ // can be defined.
+};
+
+// ============================================================================
+
+class TAO_Property_Serv_Export TAO_PropertySetDef : public virtual POA_CosPropertyService::PropertySetDef,
+ public virtual TAO_PropertySet
+{
+ // = TITLE
+ // This class implements PropertySetDef interface, which is
+ // specialization (subclass) of PropertySet interface. This
+ // class provides operations to PropertySet constraints, define
+ // and modify with modes, and to get or set property modes.
+ //
+ // = DESCRIPTION
+ // It should be noted that a TAO_PropertySetDef is still considered
+ // a PropertySet. The specialization operations are simply to
+ // provide more client access and control of the characteristics
+ // (metadata) of a PropertySet.
+public:
+ // = Initialization and termination methods.
+ TAO_PropertySetDef (void);
+ // Constructor.
+
+ TAO_PropertySetDef (const CosPropertyService::PropertyTypes allowed_property_types,
+ const CosPropertyService::PropertyDefs allowed_property
+ ACE_ENV_ARG_DECL);
+ // The factory uses this constructor.
+
+ TAO_PropertySetDef (const CosPropertyService::PropertyDefs initial_property_defs
+ ACE_ENV_ARG_DECL);
+ // This is also for the factory.
+
+ virtual ~TAO_PropertySetDef (void);
+ // Destructor.
+
+ virtual void get_allowed_property_types (CosPropertyService::PropertyTypes_out property_types
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Indicates which types of properties are supported by this
+ // PropertySet. If the output sequence is empty, then there is no
+ // restrictions on the any TypeCode portion of the property_value
+ // field of a Property in this PropertySet, unless the
+ // get_allowed_properties output sequence is not empty.
+
+ virtual void get_allowed_properties (CosPropertyService::PropertyDefs_out property_defs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // Indicates which properties are supported by this PropertySet. If
+ // the output sequence is empty, then there is no restrictions on
+ // the properties that can be in this PropertySet, unless the
+ // get_allowed_property_types output sequence is not empty.
+
+ virtual void define_property_with_mode (const char *property_name,
+ const CORBA::Any &property_value,
+ CosPropertyService::PropertyModeType property_mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::InvalidPropertyName,
+ CosPropertyService::ConflictingProperty,
+ CosPropertyService::UnsupportedTypeCode,
+ CosPropertyService::UnsupportedProperty,
+ CosPropertyService::UnsupportedMode,
+ CosPropertyService::ReadOnlyProperty));
+ // This operation will modify or add a property to the
+ // PropertySet. If the property already exists, then the property
+ // type is checked before the value is overwritten. The property
+ // mode is also checked to be sure a new value may be written. If
+ // the property does not exist, then the property is added to the
+ // PropertySet. If type or mode is violated, ConflictingProperty
+ // exception is thrown.
+
+ virtual void define_properties_with_modes (const CosPropertyService::PropertyDefs &property_defs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::MultipleExceptions));
+ // This operation will modify or add each of the properties in the
+ // Properties parameter to the PropertySet.
+
+ virtual CosPropertyService::PropertyModeType get_property_mode (const char *property_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::PropertyNotFound,
+ CosPropertyService::InvalidPropertyName));
+ // Get the mode of a property. Raises InvalidpropertyName,
+ // PropertyNotFound exceptions.
+
+ virtual CORBA::Boolean get_property_modes (const CosPropertyService::PropertyNames &property_names,
+ CosPropertyService::PropertyModes_out property_modes
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Batch operation for getting the property. Invoke
+ // get_property_mode for each name. Return value False indicates
+ // that properties with *undefined* modes have failed due to
+ // PropertyNotFound or InvalidPropertyName exception. Returning
+ // False in case of *Nothing to retun* or New is failing. The caller
+ // has to check the out parameter whether it is Nil or no, before
+ // doing something with it.
+
+ virtual void set_property_mode (const char *property_name,
+ CosPropertyService::PropertyModeType property_mode
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::InvalidPropertyName,
+ CosPropertyService::PropertyNotFound,
+ CosPropertyService::UnsupportedMode));
+ // Set the mode of a property. Watch the following. The change of
+ // mode is allowed introduce more constraints, but it should not
+ // relax the constraints. The following decisions have been made, in
+ // TAO's implementation. The Property Spec has left this to the
+ // implenters. "Normal" to anything is possible. "Readonly" mode
+ // to "Fixed-Readonly" is possible. Others not possible.
+ // "Fixed-Normal" to "Fixed-Readonly" is possible. Other things are
+ // impossible. "Fixed-Readonly" to anything is *not* possible. For
+ // all illegal set_mode attempts, UnsupportedMode exception is
+ // raised.
+
+ virtual void set_property_modes (const CosPropertyService::PropertyModes &property_modes
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosPropertyService::MultipleExceptions));
+ // Batch operation for setting the property. Raises
+ // MultipleExceptions.
+};
+
+// ============================================================================
+
+class TAO_Property_Serv_Export TAO_PropertyNamesIterator
+ : public virtual POA_CosPropertyService::PropertyNamesIterator
+{
+ // = TITLE
+ // The PropertyNamesIterator interface allows a client to
+ // iterate through the names using the next_one or next_n operations.
+ //
+ // = DESCRIPTION
+ // A PropertySet maintains a set of name-value pairs. The
+ // get_all_property_names operation returns a sequence of names
+ // (PropertyNames). If there are additional names, the
+ // get_all_property_names operation returns an object supporting
+ // the PropertyNamesIterator interface with the additional names.
+public:
+ // = Initialization and termination methods.
+ TAO_PropertyNamesIterator (TAO_PropertySet &property_set);
+ // Constructor.
+
+ virtual ~TAO_PropertyNamesIterator (void);
+ // Destructor.
+
+ virtual void reset (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The reset operation resets the position in an iterator to the
+ // first property name, if one exists.
+
+ virtual CORBA::Boolean next_one (CORBA::String_out property_name
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The next_one operation returns true if an item exists at the
+ // current position in the iterator with an output parameter of a
+ // property name. A return of false signifies no more items in the iterator.
+
+
+ virtual CORBA::Boolean next_n (CORBA::ULong how_many,
+ CosPropertyService::PropertyNames_out property_names
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The next_n operation returns true if an item exists at the
+ // current position in the iterator and the how_many parameter was
+ // set greater than zero. The output is a PropertyNames sequence
+ // with at most the how_many number of names. A return of false
+ // signifies no more items in the iterator.
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Destroys the iterator.
+private:
+ typedef ACE_Hash_Map_Manager<CosProperty_Hash_Key, CosProperty_Hash_Value, ACE_Null_Mutex>
+ COSPROPERTY_HASH_MAP;
+ typedef ACE_Hash_Map_Iterator<CosProperty_Hash_Key, CosProperty_Hash_Value, ACE_Null_Mutex>
+ COSPROPERTY_HASH_ITERATOR;
+ typedef ACE_Hash_Map_Entry<CosProperty_Hash_Key, CosProperty_Hash_Value>
+ COSPROPERTY_HASH_ENTRY;
+
+ COSPROPERTY_HASH_ITERATOR iterator_;
+ // The Iterator object.
+};
+
+// ============================================================================
+
+class TAO_Property_Serv_Export TAO_PropertiesIterator
+ : public virtual POA_CosPropertyService::PropertiesIterator
+{
+ // = TITLE
+ // Thid class implements PropertiesIterator interface allows a client to
+ // iterate through the name-value pairs using the next_one or
+ // next_n operations.
+ //
+ // = DESCRIPTION
+ // A PropertySet maintains a set of name-value pairs. The
+ // get_all_properties operation of the PropertySet interface
+ // returns a sequence of Property structures (Properties). If
+ // there are additional properties, the get_all_properties
+ // operation returns an object supporting the PropertiesIterator
+ // interface with the additional properties.
+public:
+ // = Initialization and termination methods.
+ TAO_PropertiesIterator (TAO_PropertySet &property_set);
+ // Constructor.
+
+ virtual ~TAO_PropertiesIterator (void);
+ // Destructor.
+
+ virtual void reset (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Resets the position in an iterator to the first property, if one exists.
+
+ virtual CORBA::Boolean next_one (CosPropertyService::Property_out aproperty
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The next_one operation returns true if an item exists at the
+ // current position in the iterator with an output parameter of a
+ // property. A return of false signifies no more items in the
+ // iterator.
+
+ virtual CORBA::Boolean next_n (CORBA::ULong how_many,
+ CosPropertyService::Properties_out nproperties
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The next_n operation returns true if an item exists at the
+ // current position in the iterator and the how_many parameter was
+ // set greater than zero. The output is a properties sequence with
+ // at most the how_many number of properties. A return of false
+ // signifies no more items in the iterator.
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Destroys the iterator.
+
+private:
+ typedef ACE_Hash_Map_Manager<CosProperty_Hash_Key, CosProperty_Hash_Value, ACE_Null_Mutex>
+ COSPROPERTY_HASH_MAP;
+ typedef ACE_Hash_Map_Iterator<CosProperty_Hash_Key, CosProperty_Hash_Value, ACE_Null_Mutex>
+ COSPROPERTY_HASH_ITERATOR;
+ typedef ACE_Hash_Map_Entry<CosProperty_Hash_Key, CosProperty_Hash_Value>
+ COSPROPERTY_HASH_ENTRY;
+
+ COSPROPERTY_HASH_ITERATOR iterator_;
+ // The iterator object.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_COSPROPERTYSERVICE_I_H */
diff --git a/TAO/orbsvcs/orbsvcs/Property/property_export.h b/TAO/orbsvcs/orbsvcs/Property/property_export.h
new file mode 100644
index 00000000000..7013fca3a56
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Property/property_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_PROPERTY_EXPORT_H
+#define TAO_PROPERTY_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_PROPERTY_HAS_DLL)
+# define TAO_PROPERTY_HAS_DLL 0
+# endif /* ! TAO_PROPERTY_HAS_DLL */
+#else
+# if !defined (TAO_PROPERTY_HAS_DLL)
+# define TAO_PROPERTY_HAS_DLL 1
+# endif /* ! TAO_PROPERTY_HAS_DLL */
+#endif
+
+#if defined (TAO_PROPERTY_HAS_DLL) && (TAO_PROPERTY_HAS_DLL == 1)
+# if defined (TAO_PROPERTY_BUILD_DLL)
+# define TAO_Property_Export ACE_Proper_Export_Flag
+# define TAO_PROPERTY_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_PROPERTY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_PROPERTY_BUILD_DLL */
+# define TAO_Property_Export ACE_Proper_Import_Flag
+# define TAO_PROPERTY_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_PROPERTY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_PROPERTY_BUILD_DLL */
+#else /* TAO_PROPERTY_HAS_DLL == 1 */
+# define TAO_Property_Export
+# define TAO_PROPERTY_SINGLETON_DECLARATION(T)
+# define TAO_PROPERTY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_PROPERTY_HAS_DLL == 1 */
+
+#endif /* TAO_PROPERTY_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Property/property_serv_export.h b/TAO/orbsvcs/orbsvcs/Property/property_serv_export.h
new file mode 100644
index 00000000000..593f9bc7d37
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Property/property_serv_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_PROPERTY_SERV_EXPORT_H
+#define TAO_PROPERTY_SERV_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_PROPERTY_SERV_HAS_DLL)
+# define TAO_PROPERTY_SERV_HAS_DLL 0
+# endif /* ! TAO_PROPERTY_SERV_HAS_DLL */
+#else
+# if !defined (TAO_PROPERTY_SERV_HAS_DLL)
+# define TAO_PROPERTY_SERV_HAS_DLL 1
+# endif /* ! TAO_PROPERTY_SERV_HAS_DLL */
+#endif
+
+#if defined (TAO_PROPERTY_SERV_HAS_DLL) && (TAO_PROPERTY_SERV_HAS_DLL == 1)
+# if defined (TAO_PROPERTY_SERV_BUILD_DLL)
+# define TAO_Property_Serv_Export ACE_Proper_Export_Flag
+# define TAO_PROPERTY_SERV_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_PROPERTY_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_PROPERTY_SERV_BUILD_DLL */
+# define TAO_Property_Serv_Export ACE_Proper_Import_Flag
+# define TAO_PROPERTY_SERV_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_PROPERTY_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_PROPERTY_SERV_BUILD_DLL */
+#else /* TAO_PROPERTY_SERV_HAS_DLL == 1 */
+# define TAO_Property_Serv_Export
+# define TAO_PROPERTY_SERV_SINGLETON_DECLARATION(T)
+# define TAO_PROPERTY_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_PROPERTY_SERV_HAS_DLL == 1 */
+
+#endif /* TAO_PROPERTY_SERV_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Property/property_skel_export.h b/TAO/orbsvcs/orbsvcs/Property/property_skel_export.h
new file mode 100644
index 00000000000..60a4aa4fe46
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Property/property_skel_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_PROPERTY_SKEL_EXPORT_H
+#define TAO_PROPERTY_SKEL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_PROPERTY_SKEL_HAS_DLL)
+# define TAO_PROPERTY_SKEL_HAS_DLL 0
+# endif /* ! TAO_PROPERTY_SKEL_HAS_DLL */
+#else
+# if !defined (TAO_PROPERTY_SKEL_HAS_DLL)
+# define TAO_PROPERTY_SKEL_HAS_DLL 1
+# endif /* ! TAO_PROPERTY_SKEL_HAS_DLL */
+#endif
+
+#if defined (TAO_PROPERTY_SKEL_HAS_DLL) && (TAO_PROPERTY_SKEL_HAS_DLL == 1)
+# if defined (TAO_PROPERTY_SKEL_BUILD_DLL)
+# define TAO_Property_Skel_Export ACE_Proper_Export_Flag
+# define TAO_PROPERTY_SKEL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_PROPERTY_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_PROPERTY_SKEL_BUILD_DLL */
+# define TAO_Property_Skel_Export ACE_Proper_Import_Flag
+# define TAO_PROPERTY_SKEL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_PROPERTY_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_PROPERTY_SKEL_BUILD_DLL */
+#else /* TAO_PROPERTY_SKEL_HAS_DLL == 1 */
+# define TAO_Property_Skel_Export
+# define TAO_PROPERTY_SKEL_SINGLETON_DECLARATION(T)
+# define TAO_PROPERTY_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_PROPERTY_SKEL_HAS_DLL == 1 */
+
+#endif /* TAO_PROPERTY_SKEL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/RTCORBAEvent.mpc b/TAO/orbsvcs/orbsvcs/RTCORBAEvent.mpc
new file mode 100644
index 00000000000..92ffc461d20
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTCORBAEvent.mpc
@@ -0,0 +1,27 @@
+// -*- MPC -*-
+// $Id$
+
+project(RTCORBAEvent) : orbsvcslib, core, rtevent_serv, rtportableserver {
+ sharedname = TAO_RTCORBAEvent
+ dynamicflags = TAO_RTCORBAEVENT_BUILD_DLL
+ tagchecks += RTCORBAEvent
+
+ IDL_Files {
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ RTCORBAEvent {
+ Event/EC_RTCORBA_Dispatching.cpp
+ Event/EC_RTCORBA_Factory.cpp
+ }
+ }
+
+ Header_Files {
+ }
+
+ Inline_Files {
+ }
+
+ Template_Files {
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/RTCosScheduling.idl b/TAO/orbsvcs/orbsvcs/RTCosScheduling.idl
new file mode 100644
index 00000000000..7ffd6662db1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTCosScheduling.idl
@@ -0,0 +1,107 @@
+/* -*- idl -*- */
+
+//=============================================================================
+/**
+ * @file RTCosScheduling.idl
+ *
+ * $Id$
+ *
+ * @author Matt Murphy <murphym@cs.uri.edu>
+ */
+//=============================================================================
+
+/**
+ * This directory contains the idl for the RTCORBA 1.0 Scheduling Service.
+ * To generate the stubs and skeletons, run
+ * tao_idl -I $TAO_ROOT/ RTCosScheduling.idl
+ *
+ */
+
+
+#ifndef _RT_COS_SCHEDULING_
+#define _RT_COS_SCHEDULING_
+
+#include <orb.idl>
+#include "tao/PortableServer/PortableServer_include.pidl"
+
+/**
+ * @module RTCosScheduling
+ *
+ * @brief This module contains the interfaces for the RTCORBA 1.0
+ * Scheduling Service.
+ */
+module RTCosScheduling {
+
+ /**
+ * This exception is thrown by schedule activity when an activity name
+ * is passed that is associated with a priority in the config file.
+ * It is thrown by schedule_object when an object name is passed in
+ * that was not assiciated with a resource priority ceiling in the
+ * config file.
+ */
+ exception UnknownName {};
+
+ /**
+ * @interface ClientScheduler
+ *
+ * @brief This interface is used by clients who wish to
+ * schedule activities using the RT CORBA 1.0 Scheduling Service.
+ */
+ local interface ClientScheduler {
+
+ /**
+ * schedule_activity associates an activity name with a known priority
+ * for that activity. It then sets RT Current to that priority.
+ * If the name passed does not have a priority associated then
+ * schedule_activity throws an UnknownName exception.
+ *
+ * @param activity_name is the name of the activity that the client
+ * would like to run. The activity_name is associated with a
+ * priority by schedule_activity and RT Current is set to that
+ * priority.
+ */
+ void schedule_activity(in string activity_name )
+ raises (UnknownName);
+ };
+
+ /**
+ * @interface ServerScheduler
+ *
+ * @brief This interface is used by nodes that hold a local object
+ * reference.
+ */
+ local interface ServerScheduler {
+
+ /**
+ * create_POA is called by servers that would like to use the
+ * RT CORBA 2.0 Scheduling Service.
+ *
+ * @param parent The poa to base the RT POA upon
+ * @param adapter_name the adapter name for the poa
+ * @param a_POAManager the poa_manager
+ * @param policies the list of non real time policies to be set
+ *
+ */
+ PortableServer::POA create_POA (
+ in PortableServer::POA parent,
+ in string adapter_name,
+ in PortableServer::POAManager a_POAManager,
+ in CORBA::PolicyList policies)
+ raises (PortableServer::POA::AdapterAlreadyExists,
+ PortableServer::POA::InvalidPolicy);
+
+ /**
+ * schedule_object is called on servers to associate a
+ * CORBA object reference with a name. This allows the
+ * scheduling service to map a server object name to a resource
+ * ceiling. An UnknownName exception is found if the object name
+ * is not found in the config file.
+ */
+ void schedule_object(in Object obj, in string name)
+ raises (UnknownName);
+
+ };
+};
+
+
+#endif // _RT_COS_SCHEDULING_IDL_
diff --git a/TAO/orbsvcs/orbsvcs/RTCosScheduling.mpc b/TAO/orbsvcs/orbsvcs/RTCosScheduling.mpc
new file mode 100644
index 00000000000..0350cf8953f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTCosScheduling.mpc
@@ -0,0 +1,24 @@
+// -*- MPC -*-
+// $Id$
+
+project(RTCosScheduling) : orbsvcslib, core, rtportableserver, interceptors, codecfactory, tao_versioning_idl_defaults {
+ sharedname = TAO_RTCosScheduling
+ idlflags += -Gd -Wb,export_macro=TAO_RTCosScheduling_Export -Wb,export_include=orbsvcs/RTCosScheduling/RTCosScheduling_export.h
+ dynamicflags += TAO_RTCOSSCHEDULING_BUILD_DLL
+ tagchecks += RTCosScheduling
+ requires += dummy_label
+
+ IDL_Files {
+ RTCosScheduling.idl
+ }
+ Source_Files(ORBSVCS_COMPONENTS) {
+ RTCosScheduling {
+ RTCosSchedulingC.cpp
+ RTCosSchedulingS.cpp
+ RTCosScheduling
+ }
+ }
+ Template_Files {
+ }
+}
+
diff --git a/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ClientScheduler_i.cpp b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ClientScheduler_i.cpp
new file mode 100644
index 00000000000..d13cfe93576
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ClientScheduler_i.cpp
@@ -0,0 +1,524 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file RTCosScheduling_ClientScheduler_i.cpp
+ *
+ * $Id$
+ *
+ * @author Matt Murphy <murphym@cs.uri.edu>
+ */
+//=============================================================================
+
+#include "orbsvcs/RTCosScheduling/RTCosScheduling_ClientScheduler_i.h"
+
+#include "ace/OS_NS_errno.h"
+#include "ace/OS_NS_stdio.h"
+
+#include "tao/ORB_Core.h"
+#include "tao/LocalObject.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/CodecFactory/CodecFactory.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+
+ /// Constructor
+ RTCosScheduling_ClientScheduler_i::RTCosScheduling_ClientScheduler_i (
+ CORBA::ORB_var orb,
+ char *node_name,
+ char *file)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ /// Read the resources and ceilings from the config file
+ /// and put them into the activity_map_
+ if ( !ACE_OS::strcmp(file,"") || file == NULL)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "No config supplied to the ServerScheduler, "
+ "Server will not scheudle object execution "
+ "(ServerScheduler interceptor not installed)"));
+ }
+ else if (!tasks(node_name, file, &activity_map_))
+ {
+ ACE_DEBUG((LM_DEBUG,"Invalid Filename given, aborting!\n"));
+ ACE_OS::exit(1);
+ }
+ // The tasks were successfully read in, create the client interceptor
+ else
+ {
+#if (TAO_HAS_INTERCEPTORS == 1)
+ ACE_NEW_THROW_EX (this->client_interceptor_,
+ RTCosScheduling_ClientScheduler_Interceptor(orb),
+ CORBA::NO_MEMORY());
+ ACE_CHECK;
+
+ TAO_ORB_Core *orb_core = orb->orb_core();
+
+ // @@ (OO) Why isn't an ORBInitializer being used to
+ // register the interceptor? In fact, all of the
+ // following code should be done in an
+ // ORBInitializer, except for the interceptor list
+ // iteration. That is already done by the ORB when
+ // using an ORBInitializer to register an
+ // interceptor.
+
+ /// First, get a list of all interceptors currently registered
+ TAO::ClientRequestInterceptor_List::TYPE &interceptors =
+ orb_core->client_request_interceptors();
+
+
+ /// Now check to see if the ServerScheduler Interceptor has already
+ /// been registered
+ u_int i;
+ u_int unregistered = 1;
+ for (i = 0; i < interceptors.size() && unregistered; ++i)
+ {
+ if (ACE_OS::strncmp(interceptors[i]->_interface_repository_id (),
+ this->client_interceptor_->_interface_repository_id(),
+ ACE_OS::strlen(
+ this->client_interceptor_->_interface_repository_id()-2))
+ == 0)
+ {
+ /// The interceptor is already registered,
+ /// don't try to register it again
+ unregistered = 0;
+ }
+ }
+
+ /// if the ServerScheduler Interceptor was not registered by
+ /// another POA then register it now
+ if (unregistered)
+ {
+ orb_core->add_interceptor(this->client_interceptor_
+ ACE_ENV_ARG_PARAMETER);
+ }
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+
+ /// Now resolve a reference to the Real Time ORB
+ CORBA::Object_var rt_obj =
+ orb->resolve_initial_references("RTORB"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get a reference to the real time orb
+ RTCORBA::RTORB_var rt_orb =
+ RTCORBA::RTORB::_narrow (rt_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// resolve a reference to RT Current
+ rt_obj =
+ orb->resolve_initial_references ("RTCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->current_ =
+ RTCORBA::Current::_narrow (rt_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK
+
+ /// Resolve a reference to the Linear Priority Mapping Manager
+ rt_obj =
+ orb->resolve_initial_references("PriorityMappingManager"
+ ACE_ENV_ARG_PARAMETER);
+ RTCORBA::PriorityMappingManager_var mapping_manager =
+ RTCORBA::PriorityMappingManager::_narrow(rt_obj.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// Create the Linear Priority Mapping Manager
+ ACE_NEW_THROW_EX(this->pm_,
+ TAO_Linear_Priority_Mapping(
+ ACE_SCHED_FIFO),
+ CORBA::NO_MEMORY());
+ // WHERE the parameter is one of SCHED_OTHER, SCHED_FIFO, or SCHED_RR
+
+ mapping_manager->mapping(this->pm_);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR((LM_ERROR, "Could not configure the orb"));
+ ACE_OS::exit(1);
+ }
+ ACE_ENDTRY;
+}
+
+
+/// Implementation skeleton destructor
+RTCosScheduling_ClientScheduler_i::~RTCosScheduling_ClientScheduler_i (void)
+{
+ delete this->pm_;
+#if (TAO_HAS_INTERCEPTORS == 1)
+ delete this->client_interceptor_;
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+}
+
+
+void RTCosScheduling_ClientScheduler_i::schedule_activity (
+ const char * activity_name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RTCosScheduling::UnknownName))
+{
+ /// Look up the priority using the activity name in the activity map
+ COS_SCHEDULER_ACTIVITY_VALUE priority = 0;
+ CORBA::Short result =
+ this->activity_map_.find(activity_name,
+ priority);
+
+ /// If the activity/priority was found, set the current to the
+ /// appropriate priority.
+ if (result != -1)
+ {
+ this->current_->the_priority(priority
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ /// If the activity was not found, throw an UnknownName exception.
+ else
+ {
+ ACE_THROW (RTCosScheduling::UnknownName());
+ }
+}
+
+
+int
+RTCosScheduling_ClientScheduler_i::tasks(
+ const char *node_name,
+ const char *file_name,
+ CosSchedulerActivityMap *activity_map)
+{
+ /// get the activity list just for the particular node
+ const unsigned int BUF_MAX = 256;
+
+ FILE *fp = ACE_OS::fopen(file_name, "r");
+ /// Make sure we can open the file
+ if (fp == NULL)
+ {
+ /// Error return of we cannot open the file.
+ ACE_ERROR_RETURN((LM_ERROR,
+ "Could not find the config file %s, aborting\n",
+ file_name),
+ 0);
+ }
+
+
+ char line[BUF_MAX], key[64];
+ ACE_OS::strsncpy(key, "Node ", sizeof(key));
+ ACE_OS::strcat(key, node_name);
+
+ /// Skip to the appropriate node
+#ifndef ACE_LACKS_CLEARERR
+ ACE_OS::clearerr(fp);
+#else
+# warning ACE_OS::clearerr() is unimplemented on this platform.
+# warning This code may not function properly.
+#endif /* !ACE_LACKS_CLEARERR */
+ do
+ {
+ ACE_OS::fgets(line, BUF_MAX, fp);
+ /// Make sure we did not hit the end of file
+ if (ACE_OS::last_error() == EOF)
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ "Node %s not found in config file\n",
+ node_name),
+ 0);
+ break;
+ }
+ }
+ while (ACE_OS::strncmp(line, key, ACE_OS::strlen(key)) != 0);
+
+ /// Skip to the appropriate task section of the node
+#ifndef ACE_LACKS_CLEARERR
+ ACE_OS::clearerr(fp);
+#else
+# warning ACE_OS::clearerr() is unimplemented on this platform.
+# warning This code may not function properly.
+#endif /* !ACE_LACKS_CLEARERR */
+ do
+ {
+ ACE_OS::fgets(line, BUF_MAX, fp);
+ /// Make sure we did not hit the end of file
+ if (ACE_OS::last_error() == EOF)
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ "Task list not found for node %s\n",
+ node_name),
+ 0);
+ break;
+ }
+ }
+ while (ACE_OS::strncmp(line, "Tasks:", ACE_OS::strlen("Tasks:")) != 0);
+
+ CORBA::Short done = 0;
+ COS_SCHEDULER_ACTIVITY_KEY name;
+ COS_SCHEDULER_ACTIVITY_VALUE priority = 0;
+ u_int delimiter;
+
+ /// read each activity/priority pair from the config file
+ while (!done)
+ {
+ /// get the activity name
+ ACE_OS::fgets(line, BUF_MAX, fp);
+
+ /// Make sure we did not hit the end of file
+ if (ACE_OS::last_error() == EOF)
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ "Task list not found for node %s\n",
+ node_name),
+ 0);
+ break;
+ }
+
+ /// check to make sure we have not reached the end of the list.
+ if (ACE_OS::strncmp(line, "END", ACE_OS::strlen("END")) != 0)
+ {
+ name = ACE_CString(line);
+ delimiter = name.find('\t');
+ char *p = ACE_OS::strchr(line, '\t');
+ if (p)
+ priority = ACE_OS::atoi(p);
+ if (priority == 0)
+ priority = RTCORBA::minPriority;
+ if (delimiter < name.length() && delimiter > 0)
+ {
+ activity_map->bind(name.substr(0, delimiter), priority);
+ }
+ else
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ "Error in reading activities from %s",
+ file_name),
+ 0);
+ }
+ }
+ else
+ {
+ done = 1;
+ }
+ }
+
+ return 1;
+}
+
+
+#if (TAO_HAS_INTERCEPTORS == 1)
+
+RTCosScheduling_ClientScheduler_Interceptor::RTCosScheduling_ClientScheduler_Interceptor() : name_("RTCosScheduling_Client_Interceptor")
+{
+ ACE_TRY_NEW_ENV
+ {
+ /// resolve a reference to RT Current
+ int argc = 0;
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ 0,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("RTCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil(obj.in()))
+ {
+ ACE_OS::exit(1);
+ }
+ else
+ {
+ this->current_ =
+ RTCORBA::Current::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ }
+ ACE_CHECK;
+
+ obj =
+ orb->resolve_initial_references("CodecFactory"
+ ACE_ENV_ARG_PARAMETER);
+
+ IOP::CodecFactory_var codec_factory;
+ if (CORBA::is_nil(obj.in()))
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "Could not initialize client interceptor, aborting!\n"));
+ ACE_OS::exit(1);
+ }
+ else
+ {
+ codec_factory = IOP::CodecFactory::_narrow(obj.in());
+ }
+
+
+ IOP::Encoding encoding;
+ encoding.format = IOP::ENCODING_CDR_ENCAPS;
+ encoding.major_version = 1;
+ encoding.minor_version = 2;
+
+ this->codec_ = codec_factory->create_codec(encoding);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ "There was an error constructing the "
+ "ClientScheduler Interceptor\n");
+ }
+ ACE_ENDTRY;
+}
+
+
+RTCosScheduling_ClientScheduler_Interceptor::RTCosScheduling_ClientScheduler_Interceptor(
+ const CORBA::ORB_var orb) : name_("RTCosScheduling_Client_Interceptor")
+{
+ ACE_TRY_NEW_ENV
+ {
+ /// resolve a reference to RT Current
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("RTCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ if (CORBA::is_nil(obj.in()))
+ {
+ ACE_OS::exit(1);
+ }
+ else
+ {
+ this->current_ =
+ RTCORBA::Current::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ }
+ ACE_TRY_CHECK;
+
+ obj =
+ orb->resolve_initial_references("CodecFactory"
+ ACE_ENV_ARG_PARAMETER);
+
+ // set up the codec factory to create the codec necessary to
+ // encode the octet stream for the service context
+ IOP::CodecFactory_var codec_factory;
+ if (CORBA::is_nil(obj.in()))
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "Could not initialize client interceptor, aborting!\n"));
+ ACE_OS::exit(1);
+ }
+ else
+ {
+ codec_factory = IOP::CodecFactory::_narrow(obj.in());
+ }
+
+
+ IOP::Encoding encoding;
+ encoding.format = IOP::ENCODING_CDR_ENCAPS;
+ encoding.major_version = 1;
+ encoding.minor_version = 2;
+
+ // Create the codec
+ this->codec_ = codec_factory->create_codec(encoding);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ "Error in creating Client Interceptor\n");
+ }
+ ACE_ENDTRY;
+}
+
+char *
+RTCosScheduling_ClientScheduler_Interceptor::name (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+return CORBA::string_dup(this->name_);
+}
+
+void
+RTCosScheduling_ClientScheduler_Interceptor::destroy (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+RTCosScheduling_ClientScheduler_Interceptor::send_request (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_TRY
+ {
+
+ // Get the Corba priority that the activity is currently running at
+ CORBA::Any the_priority_as_any;
+ the_priority_as_any <<=
+ this->current_->the_priority();
+ ACE_TRY_CHECK;
+
+ // Set up a service context to hold the priority
+ IOP::ServiceContext sc;
+ sc.context_id = IOP::RTCorbaPriority;
+
+ // Convert the priority to an octet stream
+ // (that is how service contexts send data)
+ sc.context_data =
+ reinterpret_cast<CORBA::OctetSeq &> (*this->codec_->encode (the_priority_as_any));
+ ACE_TRY_CHECK;
+
+ // add the service context
+ ri->add_request_service_context(sc, 0);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ERROR - in Client interceptor\n");
+ ACE_TRY_THROW (CORBA::INTERNAL ());
+ }
+ ACE_ENDTRY;
+}
+
+void
+RTCosScheduling_ClientScheduler_Interceptor::send_poll (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+RTCosScheduling_ClientScheduler_Interceptor::receive_reply (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+RTCosScheduling_ClientScheduler_Interceptor::receive_exception (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+RTCosScheduling_ClientScheduler_Interceptor::receive_other (
+ PortableInterceptor::ClientRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ClientScheduler_i.h b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ClientScheduler_i.h
new file mode 100644
index 00000000000..69ac688e910
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ClientScheduler_i.h
@@ -0,0 +1,218 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file RTCosScheduling_ClientScheduler_i.h
+ *
+ * $Id$
+ *
+ * @author Matt Murphy <murphym@cs.uri.edu>
+ */
+//=============================================================================
+
+#ifndef CLIENT_SCHEDULER_I_H
+#define CLIENT_SCHEDULER_I_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Map_T.h"
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (__BORLANDC__)
+#pragma option push -w-rvl -w-rch -w-ccc -w-inl
+#endif /* __BORLANDC__ */
+
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+#include "ace/SString.h"
+#include <orbsvcs/RTCosSchedulingC.h>
+#include <orbsvcs/RTCosScheduling/RTCosScheduling_export.h>
+#include "tao/RTCORBA/Priority_Mapping_Manager.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/CodecFactory/CodecFactory.h"
+#include "tao/RTCORBA/Linear_Priority_Mapping.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO {
+
+#ifndef COS_SCHEDULER_ACTIVITY_MAP
+#define COS_SCHEDULER_ACTIVITY_MAP
+ /**
+ * This typedef is used in RTCosScheduling_ClientScheduler
+ * to map activity names,stored as an ACE_CString,
+ * to CORBA priorities
+ */
+ typedef ACE_CString COS_SCHEDULER_ACTIVITY_KEY;
+ typedef CORBA::Long COS_SCHEDULER_ACTIVITY_VALUE;
+
+ typedef ACE_Map_Manager_Adapter<
+ COS_SCHEDULER_ACTIVITY_KEY,
+ COS_SCHEDULER_ACTIVITY_VALUE,
+ ACE_Noop_Key_Generator<COS_SCHEDULER_ACTIVITY_KEY> >
+ CosSchedulerActivityMap;
+#endif /* ACTIVITY_MAP */
+
+#if TAO_HAS_INTERCEPTORS
+/**
+ * @class ClientRequestInterceptor
+ *
+ * @brief Simple concrete client request interceptor.
+ */
+class RTCosScheduling_ClientScheduler_Interceptor
+ : public PortableInterceptor::ClientRequestInterceptor
+{
+public:
+
+ RTCosScheduling_ClientScheduler_Interceptor();
+ RTCosScheduling_ClientScheduler_Interceptor(const CORBA::ORB_var orb);
+
+ virtual ~RTCosScheduling_ClientScheduler_Interceptor() { }
+ /**
+ * @name Methods Required by the Client 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 client request interceptors.
+ */
+ //@{
+ /// Return the name of this ClientRequestInterceptor.
+ //
+ 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 send_request (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_poll (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_reply (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_exception (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_other (
+ PortableInterceptor::ClientRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+ //@}
+
+private:
+
+ /// The name of the interceptor
+ const char* name_;
+
+ /// reference to set local priority
+ RTCORBA::Current_var current_;
+
+ IOP::Codec_var codec_;
+
+};
+#endif /* TAO_HAS_INTERCEPTORS */
+
+/**
+ * @class RTCosScheduling_ClientScheduler
+ *
+ * @brief Used in conjunction with the class ServerScheduler to
+ * provide RTCORBA 1.0 compliant scheduling
+ *
+ * This class provides the framework necessary for a client node
+ * to retrieve scheduling information from a config file and set
+ * the local OS priority.
+ *
+ */
+class TAO_RTCosScheduling_Export RTCosScheduling_ClientScheduler_i :
+ public virtual RTCosScheduling::ClientScheduler,
+ public virtual CORBA::LocalObject
+{
+
+ public:
+//@{
+ /*
+ * Constructs a new ClientScheduler object for use on a client
+ * that wishes to use the RTCORBA 1.0 Scheduling Service.
+ *
+ * @param orb The orb
+ * @param node The name of the node the client resides on
+ */
+ RTCosScheduling_ClientScheduler_i (CORBA::ORB_var orb,
+ char* node,
+ char* file);
+
+ ///Destructor
+ virtual ~RTCosScheduling_ClientScheduler_i (void);
+
+
+ /**
+ * Called by clients to set the local thread priority to
+ * that specified in the scheduling config file
+ *
+ * @param activity_name the name of the activity that signifies
+ * the desired priority
+ */
+ virtual void schedule_activity (
+ const char *activity_name
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RTCosScheduling::UnknownName));
+//@}
+
+ private:
+ /// The map to match activity names with corba priorities
+ CosSchedulerActivityMap activity_map_;
+
+ /// RT Current, to change the priority of the thread
+ RTCORBA::Current_var current_;
+
+ /// RT Corba Priority Mapping
+ RTCORBA::PriorityMapping *pm_;
+
+#if TAO_HAS_INTERCEPTORS
+ /// The Server Interceptor that handles the PCP control
+ RTCosScheduling_ClientScheduler_Interceptor *client_interceptor_;
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ int tasks(const char *node_name,
+ const char *file_name,
+ CosSchedulerActivityMap *activity_map);
+
+};
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#if defined (__BORLANDC__)
+#pragma option pop
+#endif /* __BORLANDC__ */
+
+#include /**/ "ace/post.h"
+#endif /* CLIENT_SCHEDULER_I */
diff --git a/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp
new file mode 100644
index 00000000000..2f10810d9c9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.cpp
@@ -0,0 +1,519 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file RTCosScheduling_PCP_Manager.cpp
+ *
+ * $Id$
+ *
+ * @author Matt Murphy <murphym@cs.uri.edu>
+ */
+//=============================================================================
+
+#include "orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.h"
+#include "ace/Condition_Thread_Mutex.h"
+#include "ace/Thread.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO {
+
+CosSchedulingLockList::CosSchedulingLockList(CosSchedulingLockNode *lock_array,
+ const int size,
+ ACE_SYNCH_MUTEX *mutex)
+{
+ ACE_TRY_NEW_ENV
+ {
+ /*
+ * The pointers to the beginnings of the lists must be globally visible,
+ * so I have chosen to use the first three locks in the array.
+ * lock_array[0].next() (== free_->next() ) -> start of free list
+ * lock_array[1].next() (== granted_->next()) -> start of granted list
+ * lock_array[2].next() (== pending_->next()) -> start of pending list
+ */
+
+ /// start of the free list
+ lock_array[0].next(&lock_array[3]);
+
+ /// start with an empty granted list
+ lock_array[1].next(0);
+
+ /// start with an empty pending list
+ lock_array[2].next(0);
+
+ /// initialize the free list (link together the elements in the array)
+ for (int i = 3; i < (size - 1); ++i)
+ {
+ lock_array[i].next(&lock_array[i + 1]);
+ ACE_NEW_THROW_EX(lock_array[i].condition_,
+ ACE_SYNCH_CONDITION(*mutex),
+ CORBA::NO_MEMORY());
+ }
+ ACE_TRY_CHECK;
+ lock_array[size - 1].next(0); /// terminate the free list
+
+
+ /// Update the positions
+ this->free_ = &lock_array[0];
+ this->granted_ = &lock_array[1];
+ this->pending_ = &lock_array[2];
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG((LM_ERROR,
+ "Error in %s: Line %d - Could not generate a Locklist in shared memory\n",
+ __FILE__,
+ __LINE__));
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ "Exception: CosSchedulingLockList()");
+ }
+ ACE_ENDTRY;
+}
+
+void
+CosSchedulingLockList::destroy(const int size)
+{
+ for (int i = 3; i < size; ++i)
+ {
+ this->free_[i].condition_->remove();
+ delete &free_[i].condition_;
+ }
+}
+
+int
+CosSchedulingLockList::grant_lock(const CosSchedulingLockNode& L)
+{
+ if (this->free_->next() == 0)
+ {
+ return 0; /// no free nodes left
+ }
+ /// take a node from the free list
+ CosSchedulingLockNode *new_lock = this->free_->next();
+ this->free_->next(this->free_->next()->next());
+ *new_lock = L;
+
+ if ((this->granted_->next() == 0)
+ || (this->granted_->next()->priority_ceiling_ <= L.priority_ceiling_))
+ {
+ /// insert at the head of the list
+ new_lock->next(this->granted_->next());
+ this->granted_->next(new_lock);
+ }
+ else
+ {
+ /// find the proper location to insert
+ /// the new lock (ordered by priority ceiling)
+ CosSchedulingLockNode *current_lock = granted_->next();
+ while ((current_lock->next() != 0)
+ && (current_lock->next()->priority_ceiling_ > L.priority_ceiling_))
+ {
+ current_lock = current_lock->next();
+ }
+ new_lock->next(current_lock->next());
+ current_lock->next(new_lock);
+ }
+
+ return 1;
+}
+
+int
+CosSchedulingLockList::defer_lock(const CosSchedulingLockNode& L,
+ ACE_SYNCH_MUTEX & mutex)
+{
+ if (this->free_->next() == 0)
+ {
+ return 0; /// no free nodes left
+ }
+ CosSchedulingLockNode *new_lock = free_->next();
+ this->free_->next(free_->next()->next());
+ *new_lock = L;
+
+ if ((this->pending_->next() == 0)
+ ||(this->pending_->next()->priority_ <= L.priority_))
+ {
+ /// insert at the head of the list
+ new_lock->next(this->pending_->next());
+ this->pending_->next(new_lock);
+ }
+ else
+ {
+ /// find the proper location to insert the new lock
+ CosSchedulingLockNode *current_lock = pending_->next();
+ while ((current_lock->next() != 0)
+ && (current_lock->next()->priority_ceiling_ > L.priority_ceiling_))
+ {
+ current_lock = current_lock->next();
+ }
+ new_lock->next(current_lock->next());
+ current_lock->next(new_lock);
+ }
+
+
+ if (new_lock->condition_)
+ {
+ new_lock->condition_->wait(mutex);
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+
+int
+CosSchedulingLockList::release_lock(CosSchedulingLockNode& L)
+{
+ if (this->granted_->next() == 0)
+ {
+ return 0; /// empty list of granted locks
+ }
+
+ if (this->granted_->next()->threadID_ == L.threadID_)
+ {
+ /// remove the lock at the head of the list and put it on the free list
+
+ /// Set the Lock to the next one in the granted list
+ L = *(this->granted_->next());
+
+ /// (sets next offset from previous statement)
+ L.next(this->granted_->next()->next());
+
+ /// set the next granted's next one to be the next free one
+ this->granted_->next()->next(this->free_->next());
+
+ /// Set the next free one to be the next granted one
+ this->free_->next(this->granted_->next());
+
+ /// Set the next granted on to be the Lock's next one
+ this->granted_->next(L.next());
+
+ /// Set the Locks next on to NULL
+ L.next(0);
+
+ return 1;
+ }
+
+ /// find the lock to remove
+ CosSchedulingLockNode *current_lock = granted_->next();
+ while ((current_lock->next() != 0)
+ && (current_lock->next()->threadID_ != L.threadID_))
+ {
+ current_lock = current_lock->next();
+ }
+ if (current_lock->next() != 0)
+ {
+ /// removes lock and prepends to the free list, as above
+ L = *(current_lock->next());
+ L.next(current_lock->next()->next());
+ current_lock->next()->next(this->free_->next());
+ this->free_->next(current_lock->next());
+ current_lock->next(L.next());
+ L.next(0);
+ return 1;
+ }
+
+ return 0;
+}
+
+int
+CosSchedulingLockList::remove_deferred_lock(CosSchedulingLockNode& L)
+{
+ if (this->pending_->next() == 0)
+ {
+ return 0; /// empty list of pending locks
+ }
+
+ /// take pending lock off the head of the list
+ /// (highest priority request) and add to the free list
+ L = *(this->pending_->next());
+ CosSchedulingLockNode * fn = this->pending_->next();
+ this->pending_->next(this->pending_->next()->next());
+ fn->next(this->free_->next());
+ this->free_->next(fn);
+
+ return 1;
+}
+
+PCP_Manager::PCP_Manager(CosSchedulingLockList *locks,
+ ACE_SYNCH_MUTEX *mutex,
+ const RTCORBA::Current_var current)
+: locks_(locks),
+ mutex_(mutex),
+ current_(current)
+{
+ /// Get the thread ID
+ this->threadID_ = (ACE_OS::getpid() << 16) + int(ACE_Thread::self());
+}
+
+void
+PCP_Manager::lock(const int priority_ceiling, const int priority)
+{
+ ACE_TRY_NEW_ENV
+ {
+
+ /// we do not want the thread to be pre-empted inside
+ /// this critical section, so we
+ /// will set its priority to the highest possible
+ // This is not completely necessary since the server should be running
+ // at RTCORBA::maxPriority
+ this->current_->the_priority(RTCORBA::maxPriority);
+ this->mutex_->acquire();
+ ACE_TRY_CHECK;
+
+ /// create a structure to store my own lock request
+ CosSchedulingLockNode MyLock;
+ MyLock.threadID_ = this->threadID_;
+ MyLock.priority_ceiling_ = MyLock.elevated_priority_ = priority_ceiling;
+ MyLock.priority_ = priority;
+ /// Start by assuming we don't have the lock then go look for it
+ int HaveLock = 0;
+ while (!HaveLock)
+ {
+ /// retrieve the highest priority ceiling from the list
+ CosSchedulingLockNode *highest_lock = this->locks_->highest_ceiling();
+ int prio_ceiling;
+ /// check to see if are at the highest priority,
+ /// if so set the priority ceiling
+ if (highest_lock)
+ {
+ prio_ceiling = highest_lock->priority_ceiling_;
+ }
+ else
+ {
+ prio_ceiling = -1;
+ }
+
+ /// if I hold the highest ceiling or my priority is higher than the
+ /// highest ceiling, just get the lock
+ if ((highest_lock == 0) ||
+ (highest_lock->threadID_ == this->threadID_) ||
+ (highest_lock->priority_ceiling_ < priority))
+ {
+ /// Try and grant the lock, if it is not granted,
+ /// then there are unfortunately no more lock nodes
+ if (!this->locks_->grant_lock (MyLock))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Fatal error--out of lock nodes!!!"));
+ }
+ /// Lock obtained from grant_lock, don't loop again
+ HaveLock = 1;
+ }
+ else
+ {
+ /// There is another lock out there active, put this one
+ /// in the list of pending locks
+ if (this->locks_->defer_lock(MyLock, *this->mutex_))
+ {
+ /// done waiting for it, remove it from the pending
+ /// lock list, will try again to grant on next loop
+ /// iteration
+ this->locks_->remove_deferred_lock (MyLock);
+ }
+ else
+ {
+ ACE_ERROR((LM_ERROR,
+ "Error in deferring lock\n"));
+ }
+ ACE_TRY_CHECK;
+ }
+ }
+
+ /// remove mutex on the lock list
+ this->mutex_->release();
+ ACE_TRY_CHECK;
+
+ /// at this point we have the right to set the OS priority
+ /// Do so at the priority ceiline.
+ this->current_->the_priority(priority_ceiling);
+
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG((LM_ERROR,
+ "Error in %s: Line %d - Could lock resource\n"
+ __FILE__,
+ __LINE__));
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ "Exception: PCP_Manager::lock");
+ }
+ ACE_ENDTRY;
+}
+
+void PCP_Manager::release_lock()
+{
+ ACE_TRY_NEW_ENV
+ {
+ /// To prevent pre-emption in the critical section,
+ /// which could lead to unbounded blocking
+ this->current_->the_priority(RTCORBA::maxPriority);
+
+ /// set up the mutex
+ this->mutex_->acquire();
+ ACE_TRY_CHECK;
+
+ /// remove the lock node from the list of locks
+ CosSchedulingLockNode L;
+ L.threadID_ = this->threadID_;
+ this->locks_->release_lock(L);
+
+ /// Done with the list, release the mutex
+ this->mutex_->release();
+ ACE_TRY_CHECK;
+
+ /// Let the highest priority lock signal the condition variable
+ CosSchedulingLockNode *waiter = this->locks_->highest_priority();
+ if (waiter)
+ {
+ waiter->condition_->signal();
+ }
+ ACE_TRY_CHECK;
+
+ /// We do not need to restore priority because we have already set this
+ // thread to wait at RTCORBA::maxPriority at the start of this method
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG((LM_ERROR,
+ "Error in %s: Line %d - Could not release lock\n"
+ __FILE__,
+ __LINE__));
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ "Exception: PCP_Manager::release_lock");
+ }
+ ACE_ENDTRY;
+}
+
+
+PCP_Manager_Factory::PCP_Manager_Factory(const char *shared_file)
+{
+ ACE_TRY_NEW_ENV
+ {
+#if !defined (ACE_LACKS_MMAP)
+ char temp_file[MAXPATHLEN + 1];
+
+ /// Get the temporary directory
+ if (ACE::get_temp_dir (temp_file,
+ MAXPATHLEN - ACE_OS_String::strlen(shared_file))
+ == -1)
+ {
+ ACE_DEBUG((LM_ERROR,
+ "Error in %s: Line %d - Shared File Name too long\n"
+ __FILE__,
+ __LINE__));
+ ACE_OS::exit(1);
+ }
+ ACE_TRY_CHECK;
+
+ /// Add the filename to the end
+ ACE_OS_String::strcat (temp_file, shared_file);
+
+ /// Store in the global variable.
+ this->shm_key_ = temp_file;
+
+#ifndef ACE_LACKS_MKSTEMP
+ if (ACE_OS::mkstemp (this->shm_key_) == 0
+#else
+ char *new_key = ACE_OS::mktemp (this->shm_key_);
+ if (ACE_OS::fopen(new_key, "w") != NULL
+#endif /* ACE_LACKS_MKSTEMP */
+ || (ACE_OS::unlink (this->shm_key_) == -1
+#ifndef ACE_HAS_WINCE
+ && errno == EPERM
+#endif /* ACE_HAS_WINCE */
+ ))
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) %p\n",
+ this->shm_key_));
+ ACE_TRY_CHECK;
+
+#else /* !ACE_LACKS_MMAP */
+ ACE_DEBUG((LM_ERROR,
+ "Error in %s: Line %d - ACE_LACKS_MMAP - cannot create shared memory\n"
+ __FILE__,
+ __LINE__));
+ ACE_OS::exit();
+#endif /* !ACE_LACKS_MMAP */
+
+ /// determine space requirements for the lock list
+ u_int CosSchedulingLockList_space =
+ LOCK_ARRAY_SIZE * sizeof (CosSchedulingLockNode);
+
+ /// allocate space in shared memory for size of the lock list
+ int result =
+ this->mem_.open(this->shm_key_, CosSchedulingLockList_space);
+
+ /// Make sure shared memory CosSchedulingLockList is ok, scheduling
+ /// service cannot run without it.
+ if (result == -1)
+ {
+ ACE_ERROR((LM_ERROR,
+ "Error in %s: Line %d - Error in creating the shared "
+ " memory segment to hold Lock information, "
+ "aborting ServerScheduler.\n"
+ __FILE__,
+ __LINE__));
+ ACE_OS::exit(1);
+ }
+
+ ACE_CHECK;
+
+ /// Make the shared memory a place for a lock list
+ this->lock_array_ = static_cast<CosSchedulingLockNode *> (this->mem_.malloc(CosSchedulingLockList_space));
+ /// get the pointer to the list of locks and
+ /// construct a lock list manager object
+ if (this->lock_array_ == 0)
+ {
+ ACE_ERROR((LM_ERROR,
+ "Error in %s: Line %d - Error in creating "
+ "array to hold lock information "
+ "ServerScheduler not created\n "
+ __FILE__,
+ __LINE__));
+ ACE_OS::exit(1);
+ }
+ else
+ {
+ /// construct the new lock list in shared memory
+ ACE_NEW_THROW_EX(this->locks_,
+ CosSchedulingLockList(this->lock_array_,
+ LOCK_ARRAY_SIZE,
+ &this->mutex_),
+ CORBA::NO_MEMORY()
+ );
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR((LM_ERROR,
+ "Error in %s: Line %d - Error in creating "
+ "PCP_Manager_Factory to create new PCP_Managers\n"
+ __FILE__,
+ __LINE__));
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ "PCP_Manager_Factory::PCP_Manager_Factory\n");
+ }
+ ACE_ENDTRY;
+}
+
+PCP_Manager_Factory::~PCP_Manager_Factory()
+{
+ /// throw out all the old Locks
+ this->locks_->destroy(LOCK_ARRAY_SIZE);
+ /// and delete the shared memory
+ this->mem_.remove();
+ delete this->locks_;
+}
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.h b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.h
new file mode 100644
index 00000000000..b7d3cda9069
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.h
@@ -0,0 +1,316 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file RTCosScheduling_PCP_Manager.h
+ *
+ * $Id$
+ *
+ * @author Matt Murphy <murphym@cs.uri.edu>
+ * @author based upon work by Greg Cooper
+ * @author University of Rhode Island
+ */
+//=============================================================================
+
+#ifndef PCP_MANAGER_H
+#define PCP_MANAGER_H
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Shared_Memory_MM.h"
+#include "ace/Map_T.h"
+#include "ace/SString.h"
+#include "tao/RTCORBA/RTCORBA.h"
+
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+#if defined (__BORLANDC__)
+#pragma option push -w-rvl -w-rch -w-ccc -w-inl
+#endif /* __BORLANDC__ */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO {
+
+
+#if !defined (LOCK_ARRAY_SIZE)
+ #define LOCK_ARRAY_SIZE 1024
+#endif /* LOCK_ARRAY_SIZE */
+
+#ifndef COS_SCHEDULING_CONTAINERS
+#define COS_SCHEDULING_CONTAINERS
+ /*
+ * ResourceCeilingMap
+ *
+ * This typedef is used in the RTCORBA 1.0 Scheduling Service to
+ * map names of resources on a server with priority ceilings.
+ */
+ typedef ACE_CString COS_SCHEDULING_RESOURCE_KEY;
+ typedef int COS_SCHEDULING_RESOURCE_VALUE;
+
+ typedef ACE_Map_Manager_Adapter<
+ COS_SCHEDULING_RESOURCE_KEY,
+ COS_SCHEDULING_RESOURCE_VALUE,
+ ACE_Noop_Key_Generator<COS_SCHEDULING_RESOURCE_KEY> > CosSchedulingResourceMap;
+#endif /* COS_SCHEDULING_CONTAINERS */
+
+
+/**
+* @class CosSchedulingLockList
+*
+* @brief This program provides an abstract mechanism
+* for the PCP_Manager class to store its lists of locks in
+* shared memory. It provides an efficient allocation and
+* retrieval system and uses a pseudo-linked-list based on
+* offsets (rather than absolute pointers) which allows it
+* to work regardless of where it is mapped in a process's
+* address space. This means it can be used in a shared
+* memory segment.
+*
+*/
+struct CosSchedulingLockNode
+{
+ /// unique ID of the thread owning the lock
+ int threadID_;
+
+ /// the lock's priority ceiling
+ int priority_ceiling_;
+
+ /// the thread's original global priority
+ int priority_;
+
+ /// the thread's elevated priority
+ int elevated_priority_;
+
+ /// offset to the next lock in the list
+ int next_offset_;
+
+ /// Condition Variable to wait on Mutex
+ ACE_SYNCH_CONDITION *condition_;
+
+ /**
+ * Translates the offset to the next lock
+ * to a pointer and returns it
+ */
+ struct CosSchedulingLockNode *next();
+
+ /**
+ * Translates the pointer into an offset and
+ * stores it in the structure
+ */
+ void next(const struct CosSchedulingLockNode *Next);
+
+ /**
+ * Copies the relevant fields while preserving those which should not be
+ *modified
+ */
+ const CosSchedulingLockNode& operator=(const CosSchedulingLockNode& L);
+
+};
+
+class CosSchedulingLockList
+{
+ public:
+ /**
+ * Creates a CosSchedulingLockList structure using the storage in lock_array:
+ * if Init is 1, the array is initialized to indicate that
+ * none of the nodes are in use
+ *
+ * @param lock_array The shared memory space for the CosSchedulingLockList
+ * @param size The size of the lock list
+ * @param mutex the mutex that guards the CosSchedulingLockList
+ */
+ CosSchedulingLockList(CosSchedulingLockNode *lock_array,
+ const int size,
+ ACE_SYNCH_MUTEX *mutex);
+
+ /**
+ * Calls ACE_Thread::remove() on all conditions in the list;
+ * should only be called when SchedInit terminates
+ * (may not be necessary then)
+ *
+ * @param size the number of locks to destroy, starting at head
+ */
+ void destroy(const int size);
+
+ /**
+ * Adds L to the granted list, if space is available
+ * (returns success); the list of granted locks is kept sorted
+ * by priority-ceiling so that the highest ceiling can
+ * be found quickly at the head
+ *
+ * @param L the CosSchedulingLockNode to add to the granted list.
+ */
+ int grant_lock(const CosSchedulingLockNode& L);
+
+ /**
+ * Adds L to the pending list, if space is available
+ * (returns success); the list of pending locks is kept
+ * sorted by priority so that the highest priority thread
+ * awaiting a lock will be at the head; returns pointer to
+ * condition variable upon success, NULL otherwise
+ *
+ * @param L The lock to add to the pending list.
+ * @param mutex The mutex that guards the locks.
+ */
+ int defer_lock(const CosSchedulingLockNode& L,
+ ACE_SYNCH_MUTEX &mutex);
+
+ /**
+ * Removes a node from the granted lock list whose threadID_
+ * matches that of L, replacing L with the removed lock
+ *
+ * @param L released lock
+ */
+ int release_lock(CosSchedulingLockNode& L);
+
+ /**
+ * Removes the first node from the pending lock list,
+ * replacing L with the removed lock
+ *
+ * @param L Reference to the lock that is removed from pending
+ */
+ int remove_deferred_lock(CosSchedulingLockNode& L);
+
+ /**
+ * Returns a pointer to the node containing the highest ceiling (the
+ * first node in the list of held locks)
+ */
+ CosSchedulingLockNode *highest_ceiling();
+
+
+ /**
+ * Returns a pointer to the node with the highest priority
+ * (from the first node in the list of pending locks
+ */
+ CosSchedulingLockNode *highest_priority();
+
+ private:
+
+ /// A list of free locks
+ CosSchedulingLockNode *free_;
+
+ /// A list of Free locks
+ CosSchedulingLockNode *granted_;
+
+ /// A list of pending locks awaiting to be locked
+ CosSchedulingLockNode *pending_;
+
+};
+
+
+/**
+* @class PCP_Manager
+*
+* @brief PCP_Manager handles Priority Ceiling Control Protocol for the
+* RTCORBA 1.0 ServerScheduler
+* Each thread needs a PCP_Manager object: these are created by the
+* PCP_Manager_Factory object, of which only one is needed per process
+*
+*/
+class PCP_Manager
+{
+public:
+
+ /**
+ * Initializes a PCP_Manager object with the given lists, mutex,
+ * condition variable, and priority mapper.
+ *
+ * @param locks A list of the locks to use in the PCP_Manager.
+ * @param mutex The mutex to guard the locks.
+ */
+ PCP_Manager(CosSchedulingLockList *locks,
+ ACE_SYNCH_MUTEX *mutex,
+ const RTCORBA::Current_var current);
+
+ /**
+ * Acquires a lock on a shared resource using the
+ * priority ceiling protocol
+ *
+ * @param PriorityCeiling The priority ceiling of the lock
+ * @param priority The priority to lock at.
+ */
+ void lock(const int PriorityCeiling, const int Priority);
+
+ /**
+ * Releases a lock previously granted with lock()
+ */
+ void release_lock();
+
+ /**
+ * Returns the mThreadID data member
+ */
+ int threadID();
+
+ private:
+ int threadID_; /// ID of thread owning this object
+ CosSchedulingLockList *locks_; /// combined list of locks
+ ACE_SYNCH_MUTEX *mutex_; /// Mutex to guard lock list
+ RTCORBA::Current_var current_; /// reference to set local priority
+
+};
+
+/**
+* @class PCP_Manager_Factory
+*
+* @brief Creates PCP_Managers. Each process needs only one of
+* these objects: it can create a PCP_Manager object for each
+* thread as need arises.
+*/
+class PCP_Manager_Factory
+{
+public:
+
+ /**
+ * Initializes a PCP_Manager_Factory: each process should only
+ * do this once. It attaches a shared memory segment and retrieves
+ * pointers to the granted and pending lock lists as well as
+ * the mutex and condition variable.
+ */
+ PCP_Manager_Factory(const char *shared_file);
+
+ ~PCP_Manager_Factory();
+
+ /**
+ * Creates a new PCP manager object using the lists and
+ * synchronization objects found in shared memory.
+ */
+ PCP_Manager New_PCP_Manager(RTCORBA::Current_var current);
+
+ private:
+ CosSchedulingLockList *locks_; /// lists of granted and pending locks
+ ACE_SYNCH_MUTEX mutex_; /// The mutex for locking the lock list
+ ACE_Shared_Memory_MM mem_; /// shared memory space
+ char *shm_key_; /// Key for shared memory
+ CosSchedulingLockNode *lock_array_; /// The lock list
+
+};
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.i"
+#endif /* __ACE_INLINE__ */
+
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#if defined (__BORLANDC__)
+#pragma option pop
+#endif /* __BORLANDC__ */
+
+#include /**/ "ace/post.h"
+#endif /* PCP_MANAGER_H */
diff --git a/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.i b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.i
new file mode 100644
index 00000000000..15e9ced25a9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.i
@@ -0,0 +1,98 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file RTCosScheduling_PCP_Manager.i
+ *
+ * $Id$
+ *
+ * @author Matt Murphy <murphym@cs.uri.edu>
+ * @author based upon work by Greg Cooper
+ * @author University of Rhode Island
+ */
+//=============================================================================
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * Returns a pointer to the node containing the highest ceiling (the
+ * first node in the list of held locks)
+ */
+ACE_INLINE TAO::CosSchedulingLockNode *
+TAO::CosSchedulingLockList::highest_ceiling()
+{
+ return this->granted_->next();
+}
+
+
+/**
+ * Returns a pointer to the node with the highest priority
+ * (from the first node in the list of pending locks
+ */
+ACE_INLINE TAO::CosSchedulingLockNode *
+TAO::CosSchedulingLockList::highest_priority()
+{
+ return this->pending_->next();
+}
+
+
+/**
+ * Returns the mThreadID data member
+ */
+ACE_INLINE int
+TAO::PCP_Manager::threadID()
+{
+ return this->threadID_;
+}
+
+
+/**
+ * Creates a new PCP manager object using the lists and
+ * synchronization objects found in shared memory.
+ */
+ACE_INLINE TAO::PCP_Manager
+TAO::PCP_Manager_Factory::New_PCP_Manager(RTCORBA::Current_var current)
+{
+ return TAO::PCP_Manager(this->locks_, &this->mutex_, current);
+}
+
+ACE_INLINE struct TAO::CosSchedulingLockNode *
+TAO::CosSchedulingLockNode::next()
+{
+ /// INT_MAX is a special value indicating the end of a list
+ if (this->next_offset_ == INT_MAX)
+ {
+ return 0;
+ }
+ else
+ {
+ return this + this->next_offset_;
+ }
+}
+
+ACE_INLINE void
+TAO::CosSchedulingLockNode::next(const struct CosSchedulingLockNode *next_lock)
+{
+ /// INT_MAX is a special value indicating the end of a list
+ if (next_lock == 0)
+ {
+ this->next_offset_ = INT_MAX;
+ }
+ else
+ {
+ this->next_offset_ = next_lock - this;
+ }
+}
+
+ACE_INLINE const TAO::CosSchedulingLockNode&
+TAO::CosSchedulingLockNode::operator=(const CosSchedulingLockNode& L)
+{
+ this->threadID_ = L.threadID_;
+ this->priority_ceiling_ = L.priority_ceiling_;
+ this->priority_ = L.priority_;
+ this->elevated_priority_ = L.elevated_priority_;
+
+ return *this;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.cpp b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.cpp
new file mode 100644
index 00000000000..d0fb3c1c07b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.cpp
@@ -0,0 +1,766 @@
+//=============================================================================
+/**
+ * @file RTCosScheduling_ServerScheduler_i.cpp
+ *
+ * $Id$
+ *
+ * @author Matt Murphy <murphym@cs.uri.edu>
+ */
+//=============================================================================
+
+#include "orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.h"
+#include "ace/OS_NS_errno.h"
+#include "ace/OS_NS_unistd.h"
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.i"
+#endif /* __ACE_INLINE__ */
+
+#include "tao/ORB_Core.h"
+#include "tao/PortableServer/Root_POA.h"
+#include "tao/RTCORBA/Linear_Priority_Mapping.h"
+#include "tao/RTCORBA/Priority_Mapping_Manager.h"
+#include "tao/RTPortableServer/RTPortableServer.h"
+#include "tao/CodecFactory/CodecFactory.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO {
+
+RTCosScheduling_ServerScheduler_i::
+ RTCosScheduling_ServerScheduler_i (char *node,
+ char *file,
+ char *shared_file,
+ int numthreads
+ )
+: num_threads_(numthreads),
+ shared_file_(shared_file)
+{
+ /// Read the Resources and ceilings from the config file
+ /// and put them into the resource_map_
+ if ( !ACE_OS::strcmp(file,"") || file == NULL || !TAO_HAS_INTERCEPTORS)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "Server will not schedule object execution "
+ "(ServerScheduler interceptor not installed)"));
+ }
+ else if (!resources(node, file, &this->resource_map_))
+ {
+ ACE_OS::exit(1);
+ }
+}
+
+
+// Implementation skeleton destructor
+RTCosScheduling_ServerScheduler_i::~RTCosScheduling_ServerScheduler_i (void)
+{
+ delete this->pm_;
+}
+
+
+int
+RTCosScheduling_ServerScheduler_i::configure_ORB(TAO_ORB_Core *orb_core)
+{
+ ACE_TRY_NEW_ENV
+ {
+
+ // Get an object reference to orb from the orb core
+ CORBA::ORB_ptr orb = orb_core->orb();
+
+#if TAO_HAS_INTERCEPTORS
+ /// Construct the interceptor that the Scheduling service uses
+ RTCosScheduling_ServerScheduler_Interceptor *server_interceptor = 0;;
+ ACE_NEW_THROW_EX(server_interceptor,
+ RTCosScheduling_ServerScheduler_Interceptor(orb,
+ this->shared_file_,
+ &this->object_name_map_,
+ &this->resource_map_),
+ CORBA::NO_MEMORY());
+ ACE_TRY_CHECK;
+
+ /// First, get a list of all interceptors currently registered
+ TAO::ServerRequestInterceptor_List::TYPE &interceptors =
+ orb_core->server_request_interceptors();
+
+
+ /// Now check to see if the ServerScheduler Interceptor has already
+ /// been registered
+ u_int i;
+ u_int unregistered = 1;
+ for (i = 0; i < interceptors.size() && unregistered; ++i)
+ {
+ if (ACE_OS::strncmp(
+ interceptors[i]->_interface_repository_id (),
+ server_interceptor->_interface_repository_id(),
+ ACE_OS::strlen(
+ server_interceptor->_interface_repository_id())-2)
+ == 0)
+ {
+ /// The interceptor is already registered,
+ /// don't try to register it again
+ unregistered = 0;
+ }
+ }
+
+ if (unregistered)
+ {
+ orb_core->add_interceptor(server_interceptor
+ ACE_ENV_ARG_PARAMETER);
+ }
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ /// Resolve a reference to the Linear Priority Mapping Manager
+ CORBA::Object_var rt_obj =
+ orb->resolve_initial_references("PriorityMappingManager"
+ ACE_ENV_ARG_PARAMETER);
+ if (CORBA::is_nil(rt_obj.in()))
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "Priority Mapping Manager not available, "
+ "RT not used on server!\n"));
+ return 0;
+ }
+ RTCORBA::PriorityMappingManager_var mapping_manager =
+ RTCORBA::PriorityMappingManager::_narrow(rt_obj.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// Create the Linear Priority Mapping Manager
+ ACE_NEW_THROW_EX(this->pm_,
+ TAO_Linear_Priority_Mapping(
+ ACE_SCHED_FIFO),
+ CORBA::NO_MEMORY());
+
+ mapping_manager->mapping(this->pm_);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR((LM_ERROR, "Could not configure the orb"));
+ ACE_OS::exit(1);
+ }
+ ACE_ENDTRY;
+ return 1;
+}
+
+
+::PortableServer::POA_ptr RTCosScheduling_ServerScheduler_i::create_POA (
+ PortableServer::POA_ptr parent,
+ const char * adapter_name,
+ PortableServer::POAManager_ptr a_POAManager,
+ const CORBA::PolicyList & policies
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC (( CORBA::SystemException
+ , PortableServer::POA::AdapterAlreadyExists
+ , PortableServer::POA::InvalidPolicy))
+{
+ ACE_TRY_NEW_ENV
+ {
+ // We should hopefully be using more than one thread
+#if defined (ACE_HAS_THREADS)
+ u_int has_threads = 2;
+#else
+ u_int has_threads = 1;
+#endif /* ACE_HAS_THREADS */
+
+ /// Get the ORB core from the POA Manager
+ TAO_Root_POA *tao_poa = dynamic_cast<TAO_Root_POA*>(parent);
+
+ TAO_ORB_Core &orb_core = tao_poa->orb_core();
+
+ /// configure the orb (linear mapping, register interceptor, etc.)
+ configure_ORB(&orb_core);
+
+ /// Get an object reference to orb from the orb core
+ CORBA::ORB_ptr orb = orb_core.orb();
+
+ /// Now resolve a reference to the Real Time ORB
+ CORBA::Object_var rt_obj =
+ orb->resolve_initial_references("RTORB"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil(rt_obj.in()))
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "RTORB not available, "
+ "not using RT on the server!\n"));
+ return 0;
+ }
+
+ /// Get the reference to the RT ORB
+ RTCORBA::RTORB_var rt_orb =
+ RTCORBA::RTORB::_narrow (rt_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil(rt_orb.in ()))
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "Could not initialize orb for the server interceptor, "
+ "RT will not be used!\n"));
+ return 0;
+ }
+
+
+ // Copy the non realtime policy list
+ CORBA::PolicyList poa_policy_list = policies;
+ poa_policy_list.length (policies.length()+has_threads);
+
+ /// Set the server to run at max priority so it will immediately
+ /// process intercepts and place new requests into the approprate queue
+ poa_policy_list[policies.length()] =
+ rt_orb->create_priority_model_policy (
+ RTCORBA::SERVER_DECLARED,
+ RTCORBA::maxPriority
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Set up the threadpool
+#if defined (ACE_HAS_THREADS)
+ CORBA::ULong stacksize = 0;
+
+ /// ideally 1, but not implemented in TAO. This is fine as long
+ /// the system is not overloaded and can accept all requests
+ CORBA::Boolean allow_request_buffering = 0;
+
+ // ideally max_concurrent - num_threads_, but no request buffer in TAO
+ CORBA::ULong max_buffered_requests = 0;
+
+ /// TAO does not have, nor plan to implement, request buffering
+ CORBA::ULong max_request_buffer_size = 0;
+
+ /// This comes from the model of the system
+ CORBA::ULong static_threads = this->num_threads_;
+
+ CORBA::ULong dynamic_threads = 0;
+
+ /// Set it to max so there will be no priority inversions
+ /// while the request is accepted
+ CORBA::ULong default_thread_priority = RTCORBA::maxPriority;
+
+ /// Create the threadpool the server uses to execute requests
+ RTCORBA::ThreadpoolId threadpool =
+ rt_orb->create_threadpool (stacksize,
+ static_threads,
+ dynamic_threads,
+ default_thread_priority,
+ allow_request_buffering,
+ max_buffered_requests,
+ max_request_buffer_size
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_policy_list[policies.length()+1] =
+ rt_orb->create_threadpool_policy (threadpool
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#endif /* ACE_HAS_THREADS */
+
+
+ /// Create the RT POA
+ PortableServer::POA_var poa =
+ parent->create_POA (adapter_name,
+ a_POAManager,
+ poa_policy_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RTPortableServer::POA_var rt_poa =
+ RTPortableServer::POA::_narrow(poa.in()
+ ACE_ENV_ARG_PARAMETER);
+
+ /// return the reference to the RT POA
+ return rt_poa.in();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ "ERROR: Could not create a Scheduling Service POA\n");
+ return parent;
+ }
+ ACE_ENDTRY;
+ return parent;
+}
+
+void
+RTCosScheduling_ServerScheduler_i::schedule_object (
+ CORBA::Object_ptr obj,
+ const char * name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException
+ , RTCosScheduling::UnknownName))
+{
+ /// Check and see if the object name is in the resource map,
+ /// if it is, then there is a ceiling for it and we can add it to the
+ /// object name map. If there is no name in the resource map, then there
+ /// is no valid ceiling for it, throw an UnknownName exception
+ if (this->resource_map_.find(name) == -1)
+ {
+ ACE_THROW (RTCosScheduling::UnknownName());
+ }
+ else
+ {
+ this->object_name_map_.rebind(obj, name);
+ ACE_CHECK;
+ }
+}
+
+
+
+#if TAO_HAS_INTERCEPTORS
+RTCosScheduling_ServerScheduler_Interceptor::RTCosScheduling_ServerScheduler_Interceptor(
+ CORBA::ORB_ptr orb,
+ char *shared_file,
+ CosSchedulingObjectMap *ObjectMap,
+ CosSchedulingResourceMap *resourceMap)
+: name_("RTCosScheduling_ServerScheduler_Interceptor"),
+ orb_(orb),
+ object_name_map_(ObjectMap),
+ resource_map_(resourceMap)
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Create a new Priority Ceiling protocol manager factory
+ ACE_NEW_THROW_EX(this->PCP_factory_,
+ PCP_Manager_Factory(shared_file),
+ CORBA::NO_MEMORY());
+ ACE_CHECK;
+
+
+ /// Now resolve a reference to the Real Time ORB
+ CORBA::Object_var obj =
+ this->orb_->resolve_initial_references("RTORB"
+ ACE_ENV_ARG_PARAMETER);
+ RTCORBA::RTORB_var rt_orb;
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil(obj.in ()))
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "RTORB not available, "
+ "RT ServerScheduler not used!\n"));
+ return;
+ }
+ else
+ {
+ rt_orb =RTCORBA::RTORB::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+
+ // Now get a reference to the RTCurrent
+ // for the PCP manager to control
+ obj = this->orb_->resolve_initial_references ("RTCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil(obj.in()))
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "RTCurrent not available, "
+ "RT ServerScheduler not used!\n"));
+ return;
+ }
+ else
+ {
+ this->current_ =
+ RTCORBA::Current::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+
+ // Now get a reference to the codec factory to create a codec that will
+ // decode the client priority sent in the service context
+ obj =
+ this->orb_->resolve_initial_references ("CodecFactory"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil(obj.in()))
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "Could not initalize the server interceptor Codec, "
+ "RT ServerScheduler not used!\n"));
+ return;
+ }
+ else
+ {
+ this->codec_factory_ = IOP::CodecFactory::_narrow(obj.in());
+ }
+ ACE_TRY_CHECK;
+
+
+ // Set up the codec
+ IOP::Encoding encoding;
+ encoding.format = IOP::ENCODING_CDR_ENCAPS;
+ encoding.major_version = 1;
+ encoding.minor_version = 2;
+
+ this->codec_ = this->codec_factory_->create_codec(encoding);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ "Error in installing the interceptor for the ServerScheduler\n");
+ }
+ ACE_ENDTRY;
+}
+
+
+// Delete the objects we have made in the interceptor
+RTCosScheduling_ServerScheduler_Interceptor::~RTCosScheduling_ServerScheduler_Interceptor()
+{
+ this->object_name_map_ = 0;
+ this->resource_map_ = 0;
+ delete this->PCP_factory_;
+}
+
+void
+RTCosScheduling_ServerScheduler_Interceptor::receive_request(
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC((
+ CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_TRY_NEW_ENV
+ {
+
+ ACE_CString name = "";
+ COS_SCHEDULING_RESOURCE_VALUE ceiling, base_priority = 0;
+
+ // Now get a reference to the POA, this is used to get a reference
+ // to the target object
+ PortableInterceptor::AdapterName *adapter_seq = ri->adapter_name();
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa;
+ const char *adapter_name =
+ (*adapter_seq)[adapter_seq->length() - 1];
+
+ CORBA::Object_var obj =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil(obj.in()))
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "Could not get root POA, "
+ "RT scheduling not used on server!\n"));
+ return;
+ }
+ else
+ {
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow(obj.in());
+ if (CORBA::is_nil(root_poa.in()))
+ {
+ ACE_ERROR((LM_ERROR,
+ "No POA found in Interceptor prio not set\n"));
+ return;
+ }
+ poa = root_poa->find_POA(adapter_name, 0);
+ ACE_TRY_CHECK;
+ }
+
+ // decode the Client priority sent in the service context
+ IOP::ServiceId id = IOP::RTCorbaPriority;
+ IOP::ServiceContext_var sc;
+ ACE_TRY_EX(svc_req)
+ {
+ sc = ri->get_request_service_context(id);
+ ACE_TRY_CHECK_EX(svc_req);
+ }
+ ACE_CATCHANY
+ {
+ // The RTCorbaPriority was not sent, do not use real time
+ // Here we cannot let the server continue to run at
+ // RTCORBA::maxPriority, so change to RTCORBA::minPriority
+ // and things will run best effort
+ this->current_->the_priority(RTCORBA::minPriority);
+ return;
+ }
+ ACE_ENDTRY;
+
+ CORBA::OctetSeq ocSeq = CORBA::OctetSeq(
+ sc->context_data.length(),
+ sc->context_data.length(),
+ sc->context_data.get_buffer(),
+ 0);
+ ACE_TRY_CHECK;
+
+ CORBA::Any the_priority_as_any;
+ the_priority_as_any = *this->codec_->decode(ocSeq);
+ ACE_TRY_CHECK;
+
+ RTCORBA::Priority the_client_priority;
+ the_priority_as_any >>= the_client_priority;
+ ACE_TRY_CHECK;
+
+ // get the object from the object ID that is passed
+ CORBA::OctetSeq_var oseq = ri->object_id();
+ PortableServer::ObjectId oid(oseq -> length(),
+ oseq -> length(),
+ oseq -> get_buffer(),
+ 0);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var target_object = poa->id_to_reference(oid);
+ ACE_TRY_CHECK;
+
+ // Check to make sure we have the object as scheduled by the
+ // ServerScheduler
+ if (this->object_name_map_->find(target_object, name) == -1 )
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "Object not found in config file, "
+ "RT ServerScheduler not used!\n"));
+ // Here we cannot let the server continue to run at
+ // RTCORBA:: maxPriority, so it will run at minPriority
+ // and things will run best effort
+ this->current_->the_priority(RTCORBA::minPriority);
+ return;
+ }
+
+ /// If the object name if found, get its priority ceiling
+ if (this->resource_map_->find(name, ceiling) == -1 )
+ {
+ /// We could not find the Object's priority ceiling
+ /// given its name
+ ACE_DEBUG((LM_DEBUG,
+ "Object Resource Ceiling not found in config file, "
+ "RT ServerScheduler not used!\n"));
+ // Here we cannot let the server continue to run at
+ // RTCORBA:: maxPriority, so it will run at minPriority
+ // and things will run best effort
+ this->current_->the_priority(RTCORBA::minPriority);
+ return;
+ }
+
+ /// Get the base priority of the server
+ if (this->resource_map_->find("BP", base_priority) == -1 )
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "Server Base Priority not found in config file, "
+ "RTServerScheduler not used!\n"));
+ // Here we cannot let the server continue to run at
+ // RTCORBA:: maxPriority, so it will run at minPriority
+ // and things will run best effort
+ this->current_->the_priority(RTCORBA::minPriority);
+ return;
+ }
+
+ /// Create a new PCP Manager to manage the priority control
+ COS_SCHEDULING_INVOCATION_VALUE p = 0;
+ ACE_NEW_THROW_EX(p,
+ PCP_Manager(
+ PCP_factory_->New_PCP_Manager(this->current_)),
+ CORBA::NO_MEMORY());
+ ACE_TRY_CHECK;
+
+ // Get the lock on the resource, using MPCP
+
+ p->lock(ceiling + base_priority,
+ the_client_priority + base_priority);
+
+ /// store the thread in the invocation list
+ this->invocation_map_.bind(
+ p->threadID(),
+ p);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ "Unknown exception in the receive request\n");
+ ACE_OS::exit(1);
+ }
+ ACE_ENDTRY;
+}
+
+void
+RTCosScheduling_ServerScheduler_Interceptor::send_reply(
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((
+ CORBA::SystemException
+ ))
+{
+ ACE_UNUSED_ARG(ri);
+ finish_execution();
+}
+
+void
+RTCosScheduling_ServerScheduler_Interceptor::finish_execution()
+{
+ PCP_Manager *p = 0;
+ this->invocation_map_.unbind((ACE_OS::getpid() << 16) + int(ACE_Thread::self()),p);
+ if (p)
+ {
+ /// Release the Lock on the Thread
+ p->release_lock();
+ /// Delete the PCP Manager
+ delete p;
+ }
+}
+
+char*
+RTCosScheduling_ServerScheduler_Interceptor::name(ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((CORBA::SystemException))
+{
+ return CORBA::string_dup(this->name_);
+}
+
+void
+RTCosScheduling_ServerScheduler_Interceptor::destroy(ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((CORBA::SystemException))
+{
+}
+
+void
+RTCosScheduling_ServerScheduler_Interceptor::receive_request_service_contexts(
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((
+ CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+}
+
+void
+RTCosScheduling_ServerScheduler_Interceptor::send_exception(
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ACE_UNUSED_ARG(ri);
+ finish_execution();
+}
+
+void
+RTCosScheduling_ServerScheduler_Interceptor::send_other(
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((
+ CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+ {
+ ACE_UNUSED_ARG(ri);
+ finish_execution();
+ }
+
+#endif /* TAO_HAS_INTERCEPTORS */
+
+int
+RTCosScheduling_ServerScheduler_i::resources(
+ const char *node_name,
+ const char *file_name,
+ CosSchedulingResourceMap *resource_map)
+{
+ /// get the resource list list just for the particular node
+ const unsigned int BUF_MAX = 256;
+ FILE *fp = ACE_OS::fopen(file_name, "r");
+ if (fp == NULL)
+ {
+ /// Error return of we cannot open the file.
+ ACE_ERROR_RETURN((LM_ERROR,
+ "Could not find the config file %s, aborting\n",
+ file_name),
+ 0);
+ }
+
+
+ char line[BUF_MAX], key[64];
+ ACE_OS::strncpy(key, "Node ", sizeof("Node "));
+ ACE_OS::strcat(key, node_name);
+
+#ifndef ACE_LACKS_CLEARERR
+ ACE_OS::clearerr(fp);
+#else
+# warning ACE_OS::clearerr() is unimplemented on this platform.
+# warning This code may not function properly.
+#endif /* !ACE_LACKS_CLEARERR */
+ do
+ {
+ ACE_OS::fgets(line, BUF_MAX, fp);
+ if (ACE_OS::last_error() == EOF)
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ "Node %s not found in config file\n",
+ node_name),
+ 0);
+ break;
+ }
+
+ }
+ while (ACE_OS::strncmp(line,key,ACE_OS::strlen(key)) != 0);
+
+ /// Skip to the appropriate Task section of the node
+#ifndef ACE_LACKS_CLEARERR
+ ACE_OS::clearerr(fp);
+#else
+# warning ACE_OS::clearerr() is unimplemented on this platform.
+# warning This code may not function properly.
+#endif /* !ACE_LACKS_CLEARERR */
+ do
+ {
+ ACE_OS::fgets(line, BUF_MAX, fp);
+ /// Make sure we did not hit the end of file
+ if (ACE_OS::last_error() == EOF)
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ "Task list not found for node %s\n",
+ node_name),
+ 0);
+ break;
+ }
+
+ }
+ while (ACE_OS::strncmp(line,
+ "Resources:",
+ ACE_OS::strlen("Resources:")
+ ) != 0);
+
+ CORBA::Short done = 0;
+ COS_SCHEDULING_RESOURCE_KEY name;
+ COS_SCHEDULING_RESOURCE_VALUE priority = 0;
+ u_int delimiter;
+
+ /// read each activity/priority pair from the config file
+ while (!done)
+ {
+ /// get the activity name
+ ACE_OS::fgets(line, BUF_MAX, fp);
+
+ /// check to make sure we have not reached the end of the list.
+ if (ACE_OS::strncmp(line, "END", ACE_OS::strlen(line)-1) != 0)
+ {
+ name = ACE_CString(line);
+ delimiter = name.find('\t');
+ char *p = ACE_OS::strchr(line, '\t');
+ if (p)
+ priority = ACE_OS::atoi(p);
+ if (priority == 0)
+ priority = RTCORBA::minPriority;
+ if (delimiter < name.length() && delimiter > 0)
+ {
+ resource_map->bind(name.substr(0, delimiter), priority);
+ }
+ else
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ "Error in reading resources from %s, aborting",
+ file_name),
+ 0);
+ }
+ }
+ else
+ {
+ done = 1;
+ }
+ }
+
+ return 1;
+}
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.h b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.h
new file mode 100644
index 00000000000..beb95c8417c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.h
@@ -0,0 +1,316 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file RTCosScheduling_ServerScheduler_i.h
+ *
+ * $Id$
+ *
+ * @author Matt Murphy <murphym@cs.uri.edu>
+ */
+//=============================================================================
+
+#ifndef SERVER_SCHEDULERI_H
+#define SERVER_SCHEDULERI_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Map_T.h"
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/SString.h"
+#include <orbsvcs/RTCosSchedulingS.h>
+#include <orbsvcs/RTCosScheduling/RTCosScheduling_export.h>
+#include "orbsvcs/RTCosScheduling/RTCosScheduling_PCP_Manager.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/CodecFactory/CodecFactory.h"
+#include "tao/LocalObject.h"
+
+
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+#if defined (__BORLANDC__)
+#pragma option push -w-rvl -w-rch -w-ccc -w-inl
+#endif /* __BORLANDC__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+#ifndef RTCOSSCHEDULING_SERVER_CONTAINERS
+#define RTCOSSCHEDULING_SERVER_CONTAINERS
+
+/**
+ * CosSchedulingObjectNameMap
+ *
+ * This typedef is used by the RTCORBA 1.0 ServerScheduler to map
+ * CORBA object references to names
+ */
+
+typedef CORBA::Object_var COS_SCHEDULING_OBJECT_NAME_KEY;
+typedef ACE_CString COS_SCHEDULING_OBJECT_NAME_VALUE;
+
+template<>
+class TAO_RTCosScheduling_Export ACE_Equal_To< COS_SCHEDULING_OBJECT_NAME_KEY >
+{
+ public:
+ int operator () (const COS_SCHEDULING_OBJECT_NAME_KEY lhs,
+ const COS_SCHEDULING_OBJECT_NAME_KEY rhs) const;
+};
+
+
+namespace TAO {
+
+class TAO_RTCosScheduling_Export CosSchedulingObjectMap_Hash_Key
+{
+public:
+ u_long operator () (const COS_SCHEDULING_OBJECT_NAME_KEY &key) const;
+};
+
+typedef ACE_Hash_Map_Manager_Ex_Adapter<
+ COS_SCHEDULING_OBJECT_NAME_KEY,
+ COS_SCHEDULING_OBJECT_NAME_VALUE,
+ CosSchedulingObjectMap_Hash_Key,
+ ACE_Equal_To<COS_SCHEDULING_OBJECT_NAME_KEY>,
+ ACE_Noop_Key_Generator<COS_SCHEDULING_OBJECT_NAME_KEY> > CosSchedulingObjectMap;
+
+/**
+ * This typedef is used in the ServerScheduler to hold a list of
+ * priority ceiling protocol managers for each active method call
+ * from a client.
+ */
+typedef int COS_SCHEDULING_INVOCATION_KEY;
+typedef PCP_Manager * COS_SCHEDULING_INVOCATION_VALUE;
+
+class CosSchedulingInvocation_Hash_key
+{
+public:
+ u_long operator () (const COS_SCHEDULING_INVOCATION_KEY &key) const;
+};
+
+typedef ACE_Hash_Map_Manager_Ex_Adapter<
+ COS_SCHEDULING_INVOCATION_KEY,
+ COS_SCHEDULING_INVOCATION_VALUE,
+ CosSchedulingInvocation_Hash_key,
+ ACE_Equal_To<COS_SCHEDULING_INVOCATION_KEY>,
+ ACE_Noop_Key_Generator<COS_SCHEDULING_INVOCATION_KEY> > CosSchedulingInvocationMap;
+
+
+#endif /* RTCOSSCHEDULING_SERVER_CONTAINERS */
+
+#if TAO_HAS_INTERCEPTORS
+ /**
+ * @class RTCosScheduling_ServerScheduler_Interceptor
+ *
+ * @brief The RTCosScheduling_ServerScheduler_Interceptor intercepts CORBA
+ * requests on behalf of the RTCORBA 1.0 scheduling service and
+ * schedules the requests.
+ */
+ class RTCosScheduling_ServerScheduler_Interceptor
+ : public PortableInterceptor::ServerRequestInterceptor
+ {
+ public :
+ RTCosScheduling_ServerScheduler_Interceptor(CORBA::ORB_ptr orb,
+ char *shared_file,
+ CosSchedulingObjectMap *CosSchedulingObjectMap,
+ CosSchedulingResourceMap *resourceMap);
+
+
+ virtual ~RTCosScheduling_ServerScheduler_Interceptor();
+
+ 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(
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC((
+ CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ 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 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));
+
+ void finish_execution();
+
+
+ private:
+
+ /// The name of the interceptor
+ const char* name_;
+
+ /// reference to set local priority
+ RTCORBA::Current_var current_;
+
+ /// Factory reference to receive PCP_managers
+ PCP_Manager_Factory * PCP_factory_;
+
+ /// Map to match threadIDs with PCP_Managers
+ CosSchedulingInvocationMap invocation_map_;
+
+ //The orb
+ CORBA::ORB_ptr orb_;
+
+ /// Map to match CORBA::Object_vars to names
+ CosSchedulingObjectMap *object_name_map_;
+
+ /// Map to match Resource names to Ceilings
+ CosSchedulingResourceMap *resource_map_;
+
+ // The codec to decode incoming CORBA Priorities
+ IOP::Codec_var codec_;
+
+
+ // The factory to create the codec
+ IOP::CodecFactory_var codec_factory_;
+ };
+
+#endif /* TAO_HAS_INTERCEPTORS */
+
+ /**
+ * @class RTCosScheduling_ServerScheduler_i
+ *
+ * @brief The ServerScheduler class handles server side
+ * scheduling for the RTCORBA 1.0 Scheduling Service.
+ */
+ class TAO_RTCosScheduling_Export RTCosScheduling_ServerScheduler_i
+ : public virtual RTCosScheduling::ServerScheduler,
+ public virtual CORBA::LocalObject
+ {
+ public:
+ // Constructor
+ RTCosScheduling_ServerScheduler_i (char *node,
+ char *file,
+ char *shared_file,
+ int numthreads);
+
+ //Destructor
+ virtual ~RTCosScheduling_ServerScheduler_i (void);
+
+ /**
+ * This creates and returns a RT POA for use on the server.
+ * It accepts a set of non-RT policies and sets these as
+ * well as RT policies (threadpooling and Server Declared).
+ *
+ * @param parent The poa to base the RT POA upon
+ * @param adapter_name the adapter name for the poa
+ * @param a_POAManager the poa_manager
+ * @param policies the list of non real time policies to be set
+ */
+ virtual ::PortableServer::POA_ptr create_POA (
+ PortableServer::POA_ptr parent,
+ const char * adapter_name,
+ PortableServer::POAManager_ptr a_POAManager,
+ const CORBA::PolicyList & policies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableServer::POA::AdapterAlreadyExists
+ , PortableServer::POA::InvalidPolicy));
+
+ /**
+ * This maps a CORBA::Object_var with a name. The names are
+ * later associated with priority ceiling stored in the
+ * scheduling config file.
+ *
+ * @param obj the CORBA object reference to associate with a name
+ * @param name name to associate with the CORBA object reference
+ */
+ virtual void schedule_object (CORBA::Object_ptr obj,
+ const char * name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC (( CORBA::SystemException
+ , RTCosScheduling::UnknownName));
+
+ private:
+
+ /**
+ * This sets the orb for the ServerScheduler,
+ * it also resolves references to RT current and sets
+ * priority mapping
+ */
+ int configure_ORB(TAO_ORB_Core *orb_core);
+
+ /// RT Current, to change the priority of the thread
+
+ /// RT Corba Priority Mapping , uses
+ /// Linear Priority Mapping
+ RTCORBA::PriorityMapping *pm_;
+
+ /// The number of threads in the server threadpool
+ int num_threads_;
+
+ char *shared_file_;
+
+ /// The map to match CORBA::Object_vars
+ /// to names
+ CosSchedulingObjectMap object_name_map_;
+
+ /// The map to match resource names to corba priorities
+ CosSchedulingResourceMap resource_map_;
+
+ /*
+ * resources populates a string/int map with a list of resources (keys)
+ * and associated priority ceilings(values)
+ *
+ * @param node_name the name of the node the client resides on,
+ * resources() only retrieves ceilings for the local node
+ *
+ * @param map resource_map a reference to the resource map to populate
+ *
+ */
+ int resources(const char* node_name,
+ const char* file_name,
+ CosSchedulingResourceMap * resource_map);
+ };
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.i"
+#endif /* __ACE_INLINE__ */
+
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#if defined (__BORLANDC__)
+#pragma option pop
+#endif /* __BORLANDC__ */
+
+
+#include /**/ "ace/post.h"
+#endif /* SERVER_SCHEDULERI_H */
diff --git a/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.i b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.i
new file mode 100644
index 00000000000..4bf50f13a5b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.i
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file RTCosScheduling_ServerScheduler_i.i
+ *
+ * $Id$
+ *
+ * @author Matt Murphy <murphym@cs.uri.edu>
+ */
+//=============================================================================
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE int
+ACE_Equal_To< COS_SCHEDULING_OBJECT_NAME_KEY >::operator () (
+ COS_SCHEDULING_OBJECT_NAME_KEY lhs,
+ COS_SCHEDULING_OBJECT_NAME_KEY rhs) const
+{
+ return lhs->_is_equivalent(rhs.in());
+}
+
+ACE_INLINE u_long
+TAO::CosSchedulingObjectMap_Hash_Key::operator () (
+ const COS_SCHEDULING_OBJECT_NAME_KEY &key) const
+{
+ u_long value = key->_hash(ACE_UINT32_MAX);
+ return value;
+}
+
+ACE_INLINE u_long
+TAO::CosSchedulingInvocation_Hash_key::operator () (
+ const COS_SCHEDULING_INVOCATION_KEY &key) const
+{
+ return static_cast<u_long> (key);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_export.h b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_export.h
new file mode 100644
index 00000000000..413a49c7658
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTCosScheduling/RTCosScheduling_export.h
@@ -0,0 +1,60 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TAO_RTCosScheduling
+// ------------------------------
+#ifndef TAO_RTCOSSCHEDULING_EXPORT_H
+#define TAO_RTCOSSCHEDULING_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_RTCOSSCHEDULING_HAS_DLL)
+# define TAO_RTCOSSCHEDULING_HAS_DLL 0
+# endif /* ! TAO_RTCOSSCHEDULING_HAS_DLL */
+#else
+# if !defined (TAO_RTCOSSCHEDULING_HAS_DLL)
+# define TAO_RTCOSSCHEDULING_HAS_DLL 1
+# endif /* ! TAO_RTCOSSCHEDULING_HAS_DLL */
+#endif
+
+#if defined (TAO_RTCOSSCHEDULING_HAS_DLL) && (TAO_RTCOSSCHEDULING_HAS_DLL == 1)
+# if defined (TAO_RTCOSSCHEDULING_BUILD_DLL)
+# define TAO_RTCosScheduling_Export ACE_Proper_Export_Flag
+# define TAO_RTCOSSCHEDULING_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTCOSSCHEDULING_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RTCOSSCHEDULING_BUILD_DLL */
+# define TAO_RTCosScheduling_Export ACE_Proper_Import_Flag
+# define TAO_RTCOSSCHEDULING_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTCOSSCHEDULING_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RTCOSSCHEDULING_BUILD_DLL */
+#else /* TAO_RTCOSSCHEDULING_HAS_DLL == 1 */
+# define TAO_RTCosScheduling_Export
+# define TAO_RTCOSSCHEDULING_SINGLETON_DECLARATION(T)
+# define TAO_RTCOSSCHEDULING_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RTCOSSCHEDULING_HAS_DLL == 1 */
+
+// Set TAO_RTCOSSCHEDULING_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TAO_RTCOSSCHEDULING_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TAO_RTCOSSCHEDULING_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TAO_RTCOSSCHEDULING_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TAO_RTCOSSCHEDULING_NTRACE */
+
+#if (TAO_RTCOSSCHEDULING_NTRACE == 1)
+# define TAO_RTCOSSCHEDULING_TRACE(X)
+#else /* (TAO_RTCOSSCHEDULING_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define TAO_RTCOSSCHEDULING_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (TAO_RTCOSSCHEDULING_NTRACE == 1) */
+
+#endif /* TAO_RTCOSSCHEDULING_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/RTEvent.mpc b/TAO/orbsvcs/orbsvcs/RTEvent.mpc
new file mode 100644
index 00000000000..72141564487
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTEvent.mpc
@@ -0,0 +1,55 @@
+// -*- MPC -*-
+// $Id$
+
+project(RTEvent) : orbsvcslib, core, svc_utils, tao_versioning_idl_defaults {
+ sharedname = TAO_RTEvent
+ idlflags += -Wb,stub_export_macro=TAO_RTEvent_Export -Wb,stub_export_include=orbsvcs/Event/event_export.h -Wb,skel_export_macro=TAO_RTEvent_Skel_Export -Wb,skel_export_include=orbsvcs/Event/event_skel_export.h
+ dynamicflags = TAO_RTEVENT_BUILD_DLL
+ tagchecks += RTEvent
+
+ IDL_Files {
+ RtecDefaultEventData.idl
+ RtecEventComm.idl
+ RtecEventChannelAdmin.idl
+ RtecUDPAdmin.idl
+ }
+
+ // This could be simplified if the cpp files for RTEvent were
+ // in their own directory.
+ Source_Files {
+ Event_Utilities.cpp
+ RtecDefaultEventDataC.cpp
+ RtecEventCommC.cpp
+ RtecEventChannelAdminC.cpp
+ RtecUDPAdminC.cpp
+ }
+
+ Header_Files {
+ Event_Utilities.h
+ RtecDefaultEventDataC.h
+ RtecEventCommC.h
+ RtecEventChannelAdminC.h
+ RtecUDPAdminC.h
+ Event/event_export.h
+ Event/event_skel_export.h
+ }
+
+ Inline_Files {
+ Event_Utilities.i
+ RtecDefaultEventDataC.inl
+ RtecEventCommC.inl
+ RtecEventChannelAdminC.inl
+ RtecUDPAdminC.inl
+ }
+
+ Resource_Files{
+ RTEvent.rc
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_RTEvent.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/RTEvent.rc b/TAO/orbsvcs/orbsvcs/RTEvent.rc
new file mode 100644
index 00000000000..9bb0b0f9439
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTEvent.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "RTEvent\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_RTEventDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_RTEvent.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/RTEventLogAdmin.idl b/TAO/orbsvcs/orbsvcs/RTEventLogAdmin.idl
new file mode 100644
index 00000000000..2d2f900fae4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTEventLogAdmin.idl
@@ -0,0 +1,56 @@
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// RTEventLogAdmin.idl
+//
+// = DESCRIPTION
+// This module defines the EventLog and
+// EventLogFactory interfaces.
+//
+// = AUTHOR
+// D A Hanvey (d.hanvey@qub.ac.uk)
+//
+// ============================================================================
+
+#ifndef RTEVENT_LOG_ADMIN_IDL
+#define RTEVENT_LOG_ADMIN_IDL
+
+#include "RtecEventChannelAdmin.idl"
+// CORBA Event Service
+
+#include "DsLogAdmin.idl"
+
+#pragma prefix "omg.org"
+
+module RTEventLogAdmin
+{
+ interface EventLog : DsLogAdmin::Log,
+ RtecEventChannelAdmin::EventChannel{};
+
+ interface EventLogFactory : DsLogAdmin::LogMgr,
+ RtecEventChannelAdmin::ConsumerAdmin
+ {
+ EventLog create (
+ in DsLogAdmin::LogFullActionType full_action,
+ in unsigned long long max_size,
+ in DsLogAdmin::CapacityAlarmThresholdList thresholds,
+ out DsLogAdmin::LogId id
+ ) raises (DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold);
+
+ EventLog create_with_id (
+ in DsLogAdmin::LogId id,
+ in DsLogAdmin::LogFullActionType full_action,
+ in unsigned long long max_size,
+ in DsLogAdmin::CapacityAlarmThresholdList thresholds
+ ) raises (DsLogAdmin::LogIdAlreadyExists,
+ DsLogAdmin::InvalidLogFullAction,
+ DsLogAdmin::InvalidThreshold);
+
+ };
+
+};
+
+#endif /* RTEVENT_LOG_ADMIN_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/RTEventLogAdmin.mpc b/TAO/orbsvcs/orbsvcs/RTEventLogAdmin.mpc
new file mode 100644
index 00000000000..5ecee5826dd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTEventLogAdmin.mpc
@@ -0,0 +1,107 @@
+// -*- MPC -*-
+// $Id$
+
+project(RTEventLogAdmin_IDL) : orbsvcslib, core, dslogadmin, rtevent, tao_versioning_idl_defaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=TAO_RTEventLog_Export -Wb,stub_export_include=orbsvcs/Log/rteventlog_export.h -Wb,skel_export_macro=TAO_RTEventLog_Skel_Export -Wb,skel_export_include=orbsvcs/Log/rteventlog_skel_export.h
+
+ IDL_Files {
+ RTEventLogAdmin.idl
+ }
+}
+
+project(RTEventLogAdmin) : orbsvcslib, core, dslogadmin, rtevent {
+ sharedname = TAO_RTEventLogAdmin
+ dynamicflags = TAO_RTEVENTLOG_BUILD_DLL
+ tagchecks += RTEventLog
+ after += RTEventLogAdmin_IDL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ RTEventLogAdminC.cpp
+ }
+
+ Header_Files {
+ RTEventLogAdminC.h
+ Log/rteventlog_export.h
+ }
+
+ Inline_Files {
+ RTEventLogAdminC.inl
+ }
+
+ Template_Files {
+ }
+
+ // explicit Resource_Files to avoid including _Skel & _Serv rc files.
+ Resource_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_RTEventLogAdmin.pc.in
+ }
+}
+
+project(RTEventLogAdmin_Skel) : orbsvcslib, core, rteventlogadmin, dslogadmin_skel, rtevent_skel, portableserver {
+ sharedname = TAO_RTEventLogAdmin_Skel
+ dynamicflags = TAO_RTEVENTLOG_SKEL_BUILD_DLL
+ tagchecks += RTEventLog
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ RTEventLogAdminS.cpp
+ }
+
+ Header_Files {
+ RTEventLogAdminS.h
+ RTEventLogAdminS_T.h
+ Log/rteventlog_skel_export.h
+ }
+
+ Inline_Files {
+ RTEventLogAdminS.inl
+ RTEventLogAdminS_T.inl
+ }
+
+ Template_Files {
+ RTEventLogAdminS_T.cpp
+ }
+
+ Pkgconfig_Files {
+ TAO_RTEventLogAdmin_Skel.pc.in
+ }
+}
+
+project(RTEventLogAdmin_Serv) : orbsvcslib, core, rteventlogadmin_skel, dslogadmin_serv, rtevent_serv, rtsched {
+ sharedname = TAO_RTEventLogAdmin_Serv
+ dynamicflags = TAO_RTEVENTLOG_SERV_BUILD_DLL
+ tagchecks += RTEventLog
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Log/RTEventLogConsumer.cpp
+ Log/RTEventLogFactory_i.cpp
+ Log/RTEventLogNotification.cpp
+ Log/RTEventLog_i.cpp
+ }
+
+ Header_Files {
+ Log/rteventlog_serv_export.h
+ }
+
+ Inline_Files {
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_RTEventLogAdmin_Serv.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/RTEvent_Serv.mpc b/TAO/orbsvcs/orbsvcs/RTEvent_Serv.mpc
new file mode 100644
index 00000000000..1e9797263d9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTEvent_Serv.mpc
@@ -0,0 +1,99 @@
+// -*- MPC -*-
+// $Id$
+
+project(RTEvent_Serv) : orbsvcslib, core, rtevent_skel, svc_utils, messaging {
+ avoids += ace_for_tao // Requires ACE_crc32
+ sharedname = TAO_RTEvent_Serv
+ dynamicflags = TAO_RTEVENT_SERV_BUILD_DLL
+ tagchecks += RTEvent
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Event/ECG_Adapters.cpp
+ Event/ECG_CDR_Message_Receiver.cpp
+ Event/ECG_CDR_Message_Sender.cpp
+ Event/ECG_Complex_Address_Server.cpp
+ Event/ECG_Mcast_EH.cpp
+ Event/ECG_Mcast_Gateway.cpp
+ Event/ECG_Simple_Address_Server.cpp
+ Event/ECG_Simple_Mcast_EH.cpp
+ Event/ECG_UDP_EH.cpp
+ Event/ECG_UDP_Out_Endpoint.cpp
+ Event/ECG_UDP_Receiver.cpp
+ Event/ECG_UDP_Sender.cpp
+ Event/ECG_ConsumerEC_Control.cpp
+ Event/ECG_Reactive_ConsumerEC_Control.cpp
+ Event/ECG_Reconnect_ConsumerEC_Control.cpp
+ Event/EC_And_Filter.cpp
+ Event/EC_Basic_Factory.cpp
+ Event/EC_Basic_Filter_Builder.cpp
+ Event/EC_Bitmask_Filter.cpp
+ Event/EC_Channel_Destroyer.cpp
+ Event/EC_Conjunction_Filter.cpp
+ Event/EC_ConsumerAdmin.cpp
+ Event/EC_ConsumerControl.cpp
+ Event/EC_Default_Factory.cpp
+ Event/EC_Default_ProxyConsumer.cpp
+ Event/EC_Default_ProxySupplier.cpp
+ Event/EC_Disjunction_Filter.cpp
+ Event/EC_Dispatching.cpp
+ Event/EC_Dispatching_Task.cpp
+ Event/EC_Event_Channel.cpp
+ Event/EC_Event_Channel_Base.cpp
+ Event/EC_Factory.cpp
+ Event/EC_Filter.cpp
+ Event/EC_Filter_Builder.cpp
+ Event/EC_Gateway.cpp
+ Event/EC_Gateway_IIOP.cpp
+ Event/EC_Gateway_IIOP_Factory.cpp
+ Event/EC_Group_Scheduling.cpp
+ Event/EC_Lifetime_Utils.cpp
+ Event/EC_Masked_Type_Filter.cpp
+ Event/EC_MT_Dispatching.cpp
+ Event/EC_Negation_Filter.cpp
+ Event/EC_Null_Factory.cpp
+ Event/EC_Null_Scheduling.cpp
+ Event/EC_ObserverStrategy.cpp
+ Event/EC_Per_Supplier_Filter.cpp
+ Event/EC_Prefix_Filter_Builder.cpp
+ Event/EC_ProxyConsumer.cpp
+ Event/EC_ProxySupplier.cpp
+ Event/EC_Proxy_Disconnector.cpp
+ Event/EC_QOS_Info.cpp
+ Event/EC_Reactive_ConsumerControl.cpp
+ Event/EC_Reactive_Dispatching.cpp
+ Event/EC_Reactive_SupplierControl.cpp
+ Event/EC_Reactive_Timeout_Generator.cpp
+ Event/EC_Scheduling_Strategy.cpp
+ Event/EC_SupplierAdmin.cpp
+ Event/EC_SupplierControl.cpp
+ Event/EC_Supplier_Filter.cpp
+ Event/EC_Supplier_Filter_Builder.cpp
+ Event/EC_Timeout_Filter.cpp
+ Event/EC_Timeout_Generator.cpp
+ Event/EC_Trivial_Supplier_Filter.cpp
+ Event/EC_Type_Filter.cpp
+ Event/EC_UDP_Admin.cpp
+ Event/EC_TPC_Dispatching.cpp
+ Event/EC_TPC_Dispatching_Task.cpp
+ Event/EC_TPC_Factory.cpp
+ Event/EC_TPC_ProxyConsumer.cpp
+ Event/EC_TPC_ProxySupplier.cpp
+ }
+
+ Template_Files {
+ Event/EC_Busy_Lock.cpp
+ Event/EC_Lifetime_Utils_T.cpp
+ Channel_Clients_T.cpp
+ }
+
+ Resource_Files{
+ RTEvent_Serv.rc
+ }
+
+ Pkgconfig_Files {
+ TAO_RTEvent_Serv.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/RTEvent_Serv.rc b/TAO/orbsvcs/orbsvcs/RTEvent_Serv.rc
new file mode 100644
index 00000000000..db8c3e96a2c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTEvent_Serv.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "RTEvent_Serv\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_RTEvent_ServDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_RTEvent_Serv.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/RTEvent_Skel.mpc b/TAO/orbsvcs/orbsvcs/RTEvent_Skel.mpc
new file mode 100644
index 00000000000..6a8bb6d38b6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTEvent_Skel.mpc
@@ -0,0 +1,44 @@
+// -*- MPC -*-
+// $Id$
+
+project(RTEvent_Skel) : orbsvcslib, core, rtevent, portableserver {
+ sharedname = TAO_RTEvent_Skel
+ dynamicflags = TAO_RTEVENT_SKEL_BUILD_DLL
+ tagchecks += RTEvent
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ RtecDefaultEventDataS.cpp
+ RtecEventCommS.cpp
+ RtecEventChannelAdminS.cpp
+ RtecUDPAdminS.cpp
+ }
+
+ Header_Files {
+ RtecDefaultEventDataS.h
+ RtecEventCommS.h
+ RtecEventChannelAdminS.h
+ RtecUDPAdminS.h
+ Event/event_skel_export.h
+ }
+
+ Inline_Files {
+ RtecDefaultEventDataS.inl
+ RtecEventCommS.inl
+ RtecEventChannelAdminS.inl
+ RtecUDPAdminS.inl
+ }
+
+ Template_Files {
+ }
+
+ Resource_Files{
+ RTEvent_Skel.rc
+ }
+
+ Pkgconfig_Files {
+ TAO_RTEvent_Skel.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/RTEvent_Skel.rc b/TAO/orbsvcs/orbsvcs/RTEvent_Skel.rc
new file mode 100644
index 00000000000..89f1ed77e4f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTEvent_Skel.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "RTEvent_Skel\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_RTEvent_SkelDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_RTEvent_Skel.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/RTKokyuEvent.mpc b/TAO/orbsvcs/orbsvcs/RTKokyuEvent.mpc
new file mode 100644
index 00000000000..e56df1c1027
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTKokyuEvent.mpc
@@ -0,0 +1,24 @@
+// -*- MPC -*-
+// $Id$
+
+project(RTKokyuEvent) : orbsvcslib, core, rtevent_serv, rtsched, kokyu {
+ sharedname = TAO_RTKokyuEvent
+ dynamicflags = TAO_RTKOKYUEVENT_BUILD_DLL
+ tagchecks += RTKokyuEvent
+
+ IDL_Files {
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ RTKokyuEvent {
+ Event/EC_Kokyu_Dispatching.cpp
+ Event/EC_Kokyu_Factory.cpp
+ Event/EC_Kokyu_Filter.cpp
+ Event/EC_Kokyu_Filter_Builder.cpp
+ Event/EC_Kokyu_Scheduling.cpp
+ }
+ }
+
+ Template_Files {
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/RTSched.mpc b/TAO/orbsvcs/orbsvcs/RTSched.mpc
new file mode 100644
index 00000000000..4659069665c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTSched.mpc
@@ -0,0 +1,32 @@
+// -*- MPC -*-
+// $Id$
+
+project(RTSched) : orbsvcslib, core, naming, portableserver, svc_utils, tao_versioning_idl_defaults {
+ sharedname = TAO_RTSched
+ idlflags += -Wb,export_macro=TAO_RTSched_Export -Wb,export_include=orbsvcs/Sched/sched_export.h
+ dynamicflags = TAO_RTSCHED_BUILD_DLL
+ tagchecks += Sched
+
+ IDL_Files {
+ RtecScheduler.idl
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ Sched {
+ RtecSchedulerC.cpp
+ RtecSchedulerS.cpp
+ Scheduler_Factory.cpp
+ Runtime_Scheduler.cpp
+ Scheduler_Utilities.cpp
+ Sched
+ }
+ }
+
+ Template_Files {
+ }
+
+ // To avoid picking up RTSchedEvent.rc as well, explicitly list the files.
+ Resource_Files {
+ RTSched.rc
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/RTSched.rc b/TAO/orbsvcs/orbsvcs/RTSched.rc
new file mode 100644
index 00000000000..88566f35e85
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTSched.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "RTSched\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_RTSchedDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_RTSched.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/RTSchedEvent.mpc b/TAO/orbsvcs/orbsvcs/RTSchedEvent.mpc
new file mode 100644
index 00000000000..e23e9e8e73f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTSchedEvent.mpc
@@ -0,0 +1,25 @@
+// -*- MPC -*-
+// $Id$
+
+project(RTSchedEvent) : orbsvcslib, core, rtevent_serv, rtsched {
+ sharedname = TAO_RTSchedEvent
+ dynamicflags = TAO_RTSCHEDEVENT_BUILD_DLL
+ tagchecks += RTSchedEvent
+
+ IDL_Files {
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ RTSchedEvent {
+ Event/EC_Gateway_Sched.cpp
+ Event/EC_Priority_Dispatching.cpp
+ Event/EC_Priority_Scheduling.cpp
+ Event/EC_Sched_Factory.cpp
+ Event/EC_Sched_Filter.cpp
+ Event/EC_Sched_Filter_Builder.cpp
+ }
+ }
+
+ Template_Files {
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/RTSchedEvent.rc b/TAO/orbsvcs/orbsvcs/RTSchedEvent.rc
new file mode 100644
index 00000000000..4962285f17b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RTSchedEvent.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "RTSchedEvent\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_RTSchedEventDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_RTSchedEvent.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/RT_Notification.mpc b/TAO/orbsvcs/orbsvcs/RT_Notification.mpc
new file mode 100644
index 00000000000..f43b2825357
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RT_Notification.mpc
@@ -0,0 +1,26 @@
+// -*- MPC -*-
+// $Id$
+
+project(RT_Notification) : orbsvcslib, core, rtcorba, notification_serv, tao_versioning_idl_defaults {
+ sharedname = TAO_RT_Notification
+ idlflags += -Wb,export_macro=TAO_RT_Notify_Export -Wb,export_include=orbsvcs/Notify/rt_notify_export.h
+ dynamicflags = TAO_RT_NOTIFY_BUILD_DLL
+ tagchecks += RT_Notify
+
+ IDL_Files {
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ RT_Notify {
+ Notify/RT_Builder.cpp
+ Notify/RT_Factory.cpp
+ Notify/RT_Notify_Service.cpp
+ Notify/RT_POA_Helper.cpp
+ Notify/RT_Properties.cpp
+ Notify/Structured/RT_StructuredProxyPushSupplier.cpp
+ }
+ }
+
+ Template_Files {
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/RT_Notification.rc b/TAO/orbsvcs/orbsvcs/RT_Notification.rc
new file mode 100644
index 00000000000..f39d9fe9699
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RT_Notification.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "CosNotification\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_CosNotificationDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_CosNotification.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/RtecBase.idl b/TAO/orbsvcs/orbsvcs/RtecBase.idl
new file mode 100644
index 00000000000..193e6f65299
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RtecBase.idl
@@ -0,0 +1,92 @@
+// $Id$
+/**
+ * @file RtecBase.idl
+ *
+ * @brief Define the RtecBase module
+ *
+ * RtecBase.idl,v 1.2 2001/09/17 20:50:34 coryan Exp
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_RTEC_BASE_IDL
+#define TAO_RTEC_BASE_IDL
+
+/**
+ * @namespace RtecBase
+ *
+ * @brief Define types shared by the real-time scheduling and event
+ * services.
+ *
+ * These types are defined in a separate module to decouple the
+ * real-time event services from the scheduling service interface (and
+ * implementation!)
+ */
+module RtecBase
+{
+ /// Specify type of call.
+ enum Dependency_Type_t
+ {
+ /// One-way call.
+ ONE_WAY_CALL,
+ /// Two-way call.
+ TWO_WAY_CALL
+ };
+
+ /// Provide a fast, low-footprint identifier for RT_Infos.
+ /**
+ * The Event and Scheduling Service need to communicate information
+ * about RT_Infos (descriptions about the scheduling properties of a
+ * simple operation). On a centralized application one would use
+ * pointers for such a task, but obviously that does not work on a
+ * distributed system.
+ * It is tempting to use object references to identify each RT_Info,
+ * but that does not work either: first the *contents* of the
+ * RT_Info must be transmitted between applications, and object
+ * references are not good identifiers (due to the semantics of
+ * _is_equivalent())
+ *
+ * The handle_t type is used to generate unique identifiers on the
+ * scheduling service, the Event Service can then refer to any
+ * RT_Info using either their name or the quicker handle_t.
+ */
+ typedef long handle_t;
+
+ enum Dependency_Enabled_Type_t
+ // Specify whether a dependency is enabled, disabled, or
+ // non-volatile (enabled + cannot be disabled automatically).
+ {
+ DEPENDENCY_DISABLED,
+ DEPENDENCY_ENABLED,
+ DEPENDENCY_NON_VOLATILE
+ };
+
+ /// Define dependencies between two RT_Infos
+ struct Dependency_Info
+ {
+ /// Type of dependency
+ Dependency_Type_t dependency_type;
+
+ /// Number of times the dependency is called
+ long number_of_calls;
+
+ /// Dependency
+ handle_t rt_info;
+
+ handle_t rt_info_depended_on;
+ Dependency_Enabled_Type_t enabled;
+ // Notice the reference to the RT_Info we
+ // depend on.
+ };
+
+ /// Helper typedef to define the OS priority.
+ typedef long OS_Priority;
+
+ /// Helper typedef to define the OS-independent priority
+ typedef long Preemption_Priority_t;
+
+ /// Helper typedef to define the OS-independent sub-priority
+ typedef long Preemption_Subpriority_t;
+};
+
+#endif /* TAO_RTEC_BASE_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/RtecDefaultEventData.idl b/TAO/orbsvcs/orbsvcs/RtecDefaultEventData.idl
new file mode 100644
index 00000000000..ab51ef3a3bb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RtecDefaultEventData.idl
@@ -0,0 +1,78 @@
+/**
+ * @file RtecDefaultEventData.idl
+ *
+ * @brief Define the RtecBase module
+ *
+ * $Id$
+ *
+ * TAO's Real-time Event Service is described in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_RTEC_DEFAULTEVENTDATA_IDL
+#define TAO_RTEC_DEFAULTEVENTDATA_IDL
+
+#include <OctetSeq.pidl>
+
+#pragma prefix ""
+
+/// Define one of the common event payloads
+typedef CORBA::OctetSeq EventPayload;
+
+/**
+ * @brief User defined Event Data
+ *
+ *
+ * This structure defines the default payload in TAO's Real-time Event
+ * Service.
+ *
+ * Users wanting maximum flexibility can use an Any, users that only
+ * have one type of event may use structures, other users may preffer
+ * union, trying to strike a balance between performance and
+ * flexibility. Users willing to implement their own marshalling may
+ * use a sequence of octets.
+ *
+ * The Event Service is completely transparent as to the contents of
+ * this structure.
+ */
+struct RtecEventData
+{
+#ifndef TAO_LACKS_EVENT_CHANNEL_OCTET_SEQUENCE
+ /// Add padding to align the octet sequence contents
+ /**
+ * This fields ensures that the contents of the octet sequence
+ * following are always aligned to an 8-byte boundary.
+ * Such alignment allows application developers to implement custom
+ * demarshaling from the octet sequence without requiring any data
+ * copies.
+ *
+ * This is how this works:
+ * - The last field in the header is an 8-byte unsigned long, hence
+ the header finishes on an 8 byte boundary.
+ * - The pad1 long has 4 bytes.
+ * - The length in the octet sequence adds another 4 bytes.
+ * - Thus the data in the octet sequence starts on an 8 bytes
+ * boundary too.
+ */
+ long pad1;
+
+ /// Octet sequence payload.
+ /**
+ * This is the payload used more often by high-performance
+ * applications.
+ */
+ EventPayload payload;
+#endif /* TAO_LACKS_EVENT_CHANNEL_OCTET_SEQUENCE */
+
+#ifndef TAO_LACKS_EVENT_CHANNEL_ANY
+ /// Use a CORBA any type as payload.
+ any any_value;
+#endif /* TAO_LACKS_EVENT_CHANNEL_ANY */
+};
+
+#pragma prefix ""
+
+#endif /* TAO_RTEC_DEFAULTEVENTDATA_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/RtecEventChannelAdmin.idl b/TAO/orbsvcs/orbsvcs/RtecEventChannelAdmin.idl
new file mode 100644
index 00000000000..b217e6bffca
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RtecEventChannelAdmin.idl
@@ -0,0 +1,393 @@
+/**
+ * @file RtecEventChannelAdmin.idl
+ *
+ * @brief Define the RtecEventChannelAdmin module
+ *
+ * $Id$
+ *
+ * TAO's Real-time Event Service is described in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ * @author Tim Harrison <harrison@cs.wustl.edu>
+ */
+
+#ifndef TAO_RTEC_EVENTCHANNELADMIN_IDL
+#define TAO_RTEC_EVENTCHANNELADMIN_IDL
+
+#include "RtecEventComm.idl"
+#include "RtecBase.idl"
+
+/**
+ * @namespace RtecEventChannelAdmin
+ *
+ * @brief Interfaces and data structures provided by TAO's Real-time
+ * Event Service implementation
+ */
+module RtecEventChannelAdmin
+{
+ /**
+ * @exception AlreadyConnected
+ *
+ * @brief Exception raised if a consumer or supplier tries to
+ * reconnect even though it is connected already.
+ *
+ * In some configurations the Event Channel implementation allows
+ * reconnections, and treats them as changes in the QoS properties
+ * of the client. This exception is not used in those cases.
+ */
+ exception AlreadyConnected {};
+
+ /**
+ * @struct Dependency
+ *
+ * @brief Encapsulate the parameters of a consumer QoS property
+ *
+ * This structure is used to represent both filtering information
+ * and the QoS requirements that the consumer has for events that
+ * pass the filter.
+ *
+ * @todo It has become painfully obvious that we don't need a
+ * complete RtecEventComm::Event to declare the dependency, simply
+ * the EventHeader would do.
+ */
+ struct Dependency
+ {
+ /// The filtering information, usually takes the form of an event
+ /// type and/or source that the consumer is interested in.
+ RtecEventComm::Event event;
+
+ /// The handle to the RT_Info structure that describes the
+ /// behavior of the consumer upon receiving such an event
+ /**
+ * This handle is ignored for Event Channels configured without an
+ * scheduling service.
+ */
+ RtecBase::handle_t rt_info;
+ };
+
+ /// Define a list of consumer QoS properties
+ typedef sequence<Dependency> DependencySet;
+
+ /**
+ * @struct ConsumerQOS
+ *
+ * @brief Define the complete QoS properties of a consumer
+ *
+ * Consumers declared their QoS properties using a DependencySet and
+ * a special flag to indicate if they are a gateway consumer.
+ * Gateway consumers are ignored in the computation of changes to
+ * the subscription list.
+ */
+ struct ConsumerQOS
+ {
+ /// List of QoS, filtering, correlation and timeouts for this
+ /// consumer.
+ DependencySet dependencies;
+
+ /// If TRUE the consumer is a gateway, i.e., it forwards events
+ /// from a remote peer.
+ boolean is_gateway;
+ };
+
+ /**
+ * @struct Publication
+ *
+ * @brief Encapsulate one supplier publication and the QoS
+ * properties for that publication.
+ *
+ * Suppliers can publish multiple event types, each one with
+ * different QoS properties.
+ *
+ * @todo It has become painfully obvious that we don't need a
+ * complete RtecEventComm::Event to declare the publication, simply
+ * the EventHeader would do.
+ */
+ struct Publication
+ {
+ /// The event publication, normally only the event source and type
+ /// (from the header) is considered.
+ RtecEventComm::Event event;
+
+ /// The dependency information, this includes the RT_Info handle,
+ /// the type of request and other details.
+ /**
+ * This field is ignored by event channels configured without an
+ * scheduling service.
+ */
+ RtecBase::Dependency_Info dependency_info;
+ };
+
+ /// A list of Publication structures
+ typedef sequence<Publication> PublicationSet;
+
+ /**
+ * @struct SupplierQOS
+ *
+ * @brief Describe the complete QoS and filtering properties for a
+ * supplier
+ *
+ * Consumers declared their QoS properties and publications using a
+ * PublicationSet and a special flag to indicate if they are a
+ * gateway supplier.
+ * Gateway suppliers are ignored in the computation of changes to
+ * the publication list.
+ */
+ struct SupplierQOS
+ {
+ /// The publications
+ PublicationSet publications;
+
+ /// Set to TRUE if the supplier is a gateway.
+ boolean is_gateway;
+ };
+
+ /**
+ * @exception TypeError
+ *
+ * @brief Obsolete exception
+ */
+ exception TypeError {};
+
+ /**
+ * @interface ProxyPushSupplier
+ *
+ * @brief Interface used to implement the Abstract Session pattern
+ * for the consumers
+ *
+ * Each consumer converse with the Event Channel via a different
+ * object that implements the ProxyPushSupplier interface. This is
+ * a common idiom in CORBA, as it allows the identification of the
+ * remove consumer efficiently.
+ */
+ interface ProxyPushSupplier : RtecEventComm::PushSupplier
+ {
+ /// Connect a consumer with the Event Channel
+ /**
+ * The ConsumerQOS argument is used to setup the filtering and
+ * QoS properties of the consumer.
+ *
+ * @param push_consumer The consumer that will receive the events.
+ * @param qos The QoS properties for this consumer
+ * @throws CORBA::BAD_PARAM if push_consumer is nil
+ * @throws AlreadyConnected if this operation is invoked multiple
+ * times
+ * @todo The TypeError exception is not used and should be
+ * removed.
+ */
+ void connect_push_consumer(in RtecEventComm::PushConsumer push_consumer,
+ in ConsumerQOS qos)
+ raises(AlreadyConnected, TypeError);
+
+ /// Temporarily suspend reception of events from the Event
+ /// Channel.
+ /**
+ * Calling this method is more efficient than dropping the
+ * events when received by the consumer, and less expensive than
+ * disconnecting and connecting again (but it is not free!!)
+ */
+ void suspend_connection ();
+
+ /// Resume the reception of events.
+ void resume_connection ();
+
+/*
+ //@{
+ void checkpoint (in RtecEventComm::SequenceNumber last_received)
+ raises (Invalid_Checkpoint);
+ void resend_by_sequence (in RtecEventComm::SequenceNumber last_received)
+ raises (Invalid_Resend_Request);
+ void resend_by_date (in RtecEventComm::Time last_timestamp)
+ raises (Invalid_Resend_Request);
+ //@}
+*/
+ };
+
+ /**
+ * @interface ProxyPushConsumer
+ *
+ * @brief Interface used to implement the Abstract Session pattern
+ * for the suppliers.
+ *
+ * Each supplier converse with the Event Channel via a different
+ * object that implements the ProxyPushConsumer interface. This is
+ * a common idiom in CORBA, as it allows identification of the
+ * remote supplier efficiently.
+ */
+ interface ProxyPushConsumer : RtecEventComm::PushConsumer
+ {
+ /// Connect a supplier with the Event Channel
+ /**
+ * @param push_supplier A callback interface, the
+ * disconnect_push_supplier operation is called when the Event
+ * Channel is destroyed.
+ * @param qos This argument is used to pre-compute filtering and
+ * QoS properties for the supplier.
+ *
+ * @throws CORBA::BAD_PARAM if the push_supplier argument is nil
+ * @throws AlreadyConnected if this operation is invoked multiple
+ * times.
+ */
+ void connect_push_supplier (in RtecEventComm::PushSupplier push_supplier,
+ in SupplierQOS qos)
+ raises (AlreadyConnected);
+ };
+
+ /**
+ * @interface ConsumerAdmin
+ *
+ * @brief Implement an Abstract Factory to create ProxyPushSupplier
+ * objects.
+ */
+ interface ConsumerAdmin
+ {
+ /// Create a new ProxyPushSupplier object
+ /**
+ * There is an inherent risk of leaking a ProxyPushSupplier
+ * here, i.e. if the application does not call
+ * connect_push_consumer() at all. The Event Service may choose
+ * to reclaim ProxyPushSupplier objects that have been idle for
+ * too long.
+ */
+ ProxyPushSupplier obtain_push_supplier ();
+ };
+
+ /**
+ * @class SupplierAdmin
+ *
+ * @brief Implement an Abstract Factory to create ProxyPushConsumer
+ * objects.
+ */
+ interface SupplierAdmin
+ {
+ /// Create a new ProxyPushConsumer object
+ /**
+ * There is an inherent risk of leaking a ProxyPushConsumer
+ * here, i.e. if the application does not call
+ * connect_push_supplier() at all. The Event Service may choose
+ * to reclaim ProxyPushConsumer objects that have been idle for
+ * too long.
+ */
+ ProxyPushConsumer obtain_push_consumer ();
+ };
+
+ /**
+ * @class Observer
+ *
+ * @brief Monitor changes in the consumer subscriptions and/or
+ * supplier publciations.
+ *
+ * The event channel reports changes in its internal subscription
+ * and/or publication list via this interface.
+ */
+ interface Observer
+ {
+ /// A change in the list of consumers has ocurred.
+ /**
+ * The disjunction of the subscriptions is sent to the
+ * observer.
+ */
+ void update_consumer (in ConsumerQOS sub);
+
+ /// A change in the list of suppliers has ocurred.
+ /**
+ * The list of all the event publications is passed to the
+ * observer.
+ */
+ void update_supplier (in SupplierQOS pub);
+ };
+
+ /// Opaque identifier for a connected Observer.
+ typedef unsigned long Observer_Handle;
+
+ /**
+ * @class EventChannel
+ *
+ * @brief The main interface for the event service
+ *
+ * This class provides the main entry point for the Event Service.
+ * The class follows a protocol similar to the COS Events Service as
+ * described in the CORBAservices spec.
+ */
+ interface EventChannel
+ {
+ /**
+ * @exception SYNCHRONIZATION_ERROR
+ *
+ * @brief Exception raised if the Event Channel cannot acquire its
+ * internal locks.
+ */
+ exception SYNCHRONIZATION_ERROR {};
+
+ /**
+ * @exception CANT_APPEND_OBSERVER
+ *
+ * @brief Exception raised if the Event Channel is unable to add
+ * an observer due to some internal limitation.
+ */
+ exception CANT_APPEND_OBSERVER {};
+
+ /**
+ * @exception CANT_REMOVE_OBSERVER
+ *
+ * @brief Exception raised if the Event Channel is unable to remove
+ * an observer due to some internal limitation or because the
+ * observer cannot be found.
+ */
+ exception CANT_REMOVE_OBSERVER {};
+
+ //@{
+ /**
+ * @name Unused exceptions
+ *
+ * @todo The following exceptions are not declared in any raises()
+ * clause, therefore they cannot be raised! They should be
+ * removed or added to the right places.
+ */
+
+ /// Exception raised if the QOS properties required are invalid or
+ /// cannot be satisfied
+ exception QOS_ERROR {};
+
+ /// Exception raised if the subscriptions are invalid
+ exception SUBSCRIPTION_ERROR {};
+
+ /// Exception raised if the requested correlation (a form of
+ /// filtering) is invalid
+ exception CORRELATION_ERROR {};
+
+ /// Exception raised if the event cannot be dispatched
+ exception DISPATCH_ERROR {};
+ //@}
+
+ /// Consumers call this method to gain access to the
+ /// ProxyPushSupplier factory.
+ ConsumerAdmin for_consumers ();
+
+ /// Suppliers call this method to gain access to the
+ /// ProxyPushConsumer factory.
+ SupplierAdmin for_suppliers ();
+
+ /// Shuts down the Event Channel.
+ /**
+ * Calling this methods destroys the event service, all its
+ * resource and results in a call to disconnect_push_XXX() on all
+ * connected clients.
+ */
+ void destroy ();
+
+ /// Add an observer to the event channel.
+ /**
+ * Return the handle used in the remove_observer() call.
+ */
+ Observer_Handle append_observer (in Observer gw)
+ raises (SYNCHRONIZATION_ERROR,CANT_APPEND_OBSERVER);
+
+ /// Remove the observer.
+ void remove_observer (in Observer_Handle gw)
+ raises (SYNCHRONIZATION_ERROR,CANT_REMOVE_OBSERVER);
+ };
+};
+
+#endif /* TAO_RTEC_EVENTCHANNELADMIN_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/RtecEventComm.idl b/TAO/orbsvcs/orbsvcs/RtecEventComm.idl
new file mode 100644
index 00000000000..59fe732f592
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RtecEventComm.idl
@@ -0,0 +1,175 @@
+/**
+ * @file RtecEventComm.idl
+ *
+ * @brief Define the RtecEventComm module
+ *
+ * $Id$
+ *
+ * TAO's Real-time Event Service is described in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ * @author Tim Harrison <harrison@cs.wustl.edu>
+ */
+#ifndef TAO_RTEC_EVENTCOMM_IDL
+#define TAO_RTEC_EVENTCOMM_IDL
+
+#include "TimeBase.idl"
+
+// Remove the prefix definition...
+// @@ TODO Is this the "Right Thing"? AFAIK the spec does not mention
+// if pragmas should survive the file scope...
+#pragma prefix ""
+
+#include "RtecDefaultEventData.idl"
+
+/**
+ * @namespace RtecEventComm
+ *
+ * @brief Interfaces and data structures used by the event service
+ * clients
+ */
+module RtecEventComm
+{
+ /// The event data
+ typedef RtecEventData EventData;
+
+ /// Shortcut for the time structures.
+ typedef TimeBase::TimeT Time;
+
+ typedef long EventSourceID;
+ typedef long _EventType;
+
+ /**
+ * @struct EventHeader
+ *
+ * @brief Define the structure of an event header
+ *
+ * The event header is the portion of the event examined by the
+ * event service for filtering purposes.
+ *
+ * Events can be filtered based on their type and SourceID, though
+ * the latest is a misnomer, over time it has evolved into a 'source
+ * class' or 'event domain' field, i.e. multiple sources can have
+ * the same 'ID' and the same source can generate events with
+ * different IDs.
+ */
+ struct EventHeader
+ {
+ /// The event type.
+ /**
+ * Notice that the 'type' of the event may or may not be related
+ * to the data type in its contents. I.e. it is perfectly
+ * possible to send the same payload with different values in this
+ * field. In other words, this is just a filterable value, and
+ * it is up to the application to define (or not) its relation to
+ * the contents of the event.
+ */
+ _EventType type;
+
+ /// Some way to identify the supplier.
+ EventSourceID source;
+
+ /// The "Time To Live" counter.
+ /**
+ * Each time an EC process the event it decreases the TTL field,
+ * when it gets to zero the message is no longer forwarded.
+ */
+ long ttl;
+
+ /// Applications can use this field to time-stamp the event at the
+ /// source.
+ /**
+ * @todo Because the filtering language uses EventHeaders as
+ * filtering expressions (yeah, it sucks) we also use this field
+ * to pass timeout values into the EC filter.
+ */
+ Time creation_time;
+
+#ifndef TAO_LACKS_EVENT_CHANNEL_TIMESTAMPS
+ //@{
+ /** @name Benchmarking timestamps
+ *
+ * The following timestamps are used to benchmark the Event
+ * Channel, they should not be used by the application and may be
+ * removed without notice.
+ */
+ Time ec_recv_time;
+ Time ec_send_time;
+ //@}
+#endif /* TAO_LACKS_EVENT_CHANNEL_TIMESTAMPS */
+ };
+
+ /**
+ * @struct Event
+ *
+ * @brief The basic events delivered by the Event Service.
+ *
+ * The event service uses this structure to pass events around.
+ */
+ struct Event
+ {
+ /// The header, used for filtering
+ EventHeader header;
+
+ /// The payload, the event service treats this as an opaque data
+ /// field.
+ EventData data;
+ };
+ /// The real argument to the push() operations.
+ /**
+ * For performance reasons TAO's Real-time Event Service uses
+ * sequences of events
+ */
+ typedef sequence<Event> EventSet;
+
+ /**
+ * @interface PushConsumer
+ *
+ * @brief Define the interface used by consumers to receive events.
+ *
+ * Applications usually implement this interface to subscribe for
+ * events.
+ */
+ interface PushConsumer
+ {
+ /// Main event delivery callback
+ oneway void push (in EventSet data);
+
+ /// Callback method to indicate a disconnection.
+ /**
+ * If the event service is destroyed while a consumer is still
+ * connected then the following callback operation is invoked on
+ * the consumer.
+ *
+ * The same operation is used by suppliers to disconnect from the
+ * Event Channel, but it is invoked via their
+ * RtecEventChannelAdmin::ProxyPushConsumer peer.
+ */
+ void disconnect_push_consumer ();
+ };
+
+ /**
+ * @interface PushSupplier
+ *
+ * @brief Defines the interface used by suppliers to receive
+ * callbacks from the Event Channel.
+ */
+ interface PushSupplier
+ {
+ /// Callback method to indicate a disconnection.
+ /**
+ * If the event service is destroyed while a supplier is still
+ * connected then the following callback operation is invoked on
+ * the supplier.
+ *
+ * The same operation is used by consumers to disconnect from the
+ * Event Channel, but it is invoked via their
+ * RtecEventChannelAdmin::ProxyPushSupplier peer.
+ */
+ void disconnect_push_supplier ();
+ };
+};
+
+#endif /* TAO_RTEC_EVENTCOMM_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/RtecScheduler.idl b/TAO/orbsvcs/orbsvcs/RtecScheduler.idl
new file mode 100644
index 00000000000..374ef6c195b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RtecScheduler.idl
@@ -0,0 +1,496 @@
+// $Id$
+
+#ifndef TAO_RTEC_SCHEDULER_IDL
+#define TAO_RTEC_SCHEDULER_IDL
+
+#include "TimeBase.idl"
+#include "RtecBase.idl"
+#pragma prefix ""
+
+module RtecScheduler
+{
+ // Module TimeBase defines the OMG Time Service.
+ typedef TimeBase::TimeT Time; // 100 nanoseconds
+ typedef Time Quantum_t;
+
+ typedef long Period_t; // 100 nanoseconds
+
+ typedef long Threads_t;
+
+ typedef sequence<Period_t> Period_Set;
+
+ enum Criticality_t
+ // Defines the criticality of the operation.
+ // For use with Dynamic Scheduler.
+ {
+ VERY_LOW_CRITICALITY,
+ LOW_CRITICALITY,
+ MEDIUM_CRITICALITY,
+ HIGH_CRITICALITY,
+ VERY_HIGH_CRITICALITY
+ };
+
+ enum Importance_t
+ // Defines the importance of the operation,
+ // which can be used by the Scheduler as a
+ // "tie-breaker" when other scheduling
+ // parameters are equal.
+ {
+ VERY_LOW_IMPORTANCE,
+ LOW_IMPORTANCE,
+ MEDIUM_IMPORTANCE,
+ HIGH_IMPORTANCE,
+ VERY_HIGH_IMPORTANCE
+ };
+
+ enum Info_Type_t
+ // Defines type of operation information.
+ {
+ OPERATION,
+ CONJUNCTION,
+ DISJUNCTION,
+ REMOTE_DEPENDANT
+ };
+
+ typedef RtecBase::Dependency_Enabled_Type_t Dependency_Enabled_Type_t;
+ typedef RtecBase::Dependency_Type_t Dependency_Type_t;
+
+ enum RT_Info_Enabled_Type_t
+ // Specify whether an RT_Info is enabled, disabled, or
+ // non-volatile (enabled + cannot be disabled automatically).
+ {
+ RT_INFO_DISABLED,
+ RT_INFO_ENABLED,
+ RT_INFO_NON_VOLATILE
+ };
+
+ typedef RtecBase::handle_t handle_t;
+ // RT_Info's are assigned per-application
+ // unique identifiers.
+
+ struct RT_Info_Enable_State_Pair
+ {
+ handle_t handle;
+ RT_Info_Enabled_Type_t enabled;
+ };
+
+ typedef sequence<RT_Info_Enable_State_Pair> RT_Info_Enable_State_Pair_Set;
+
+ typedef RtecBase::Dependency_Info Dependency_Info;
+
+ typedef sequence<Dependency_Info> Dependency_Set;
+
+ typedef RtecBase::OS_Priority OS_Priority;
+ typedef RtecBase::Preemption_Subpriority_t Preemption_Subpriority_t;
+ typedef RtecBase::Preemption_Priority_t Preemption_Priority_t;
+
+ struct RT_Info
+ // = TITLE
+ // Describes the QoS for an "RT_Operation".
+ //
+ // = DESCRIPTION
+ // The CPU requirements and QoS for each
+ // "entity" implementing an application
+ // operation is described by the following
+ // information.
+ {
+ // Application-defined string that uniquely
+ // identifies the operation.
+ string entry_point;
+
+ // The scheduler-defined unique identifier.
+ handle_t handle;
+
+ // Execution times.
+ Time worst_case_execution_time;
+ Time typical_execution_time;
+
+ // To account for server data caching.
+ Time cached_execution_time;
+
+ // For rate-base operations, this expresses
+ // the rate. 0 means "completely pasive",
+ // i.e., this operation only executes when
+ // called.
+ Period_t period;
+
+ // Operation Criticality (user assigned significance).
+ Criticality_t criticality;
+
+ // Operation importance, used to "break ties".
+ Importance_t importance;
+
+ // For time-slicing (for BACKGROUND operations only).
+ Quantum_t quantum;
+
+ // The number of internal threads contained by
+ // the operation.
+ Threads_t threads;
+
+ // The following attributes are defined by
+ // the Scheduler once the off-line schedule
+ // is computed.
+
+ // The operations we depend upon.
+ Dependency_Set dependencies;
+
+ // The OS thread priority for processing the
+ // events generated from this RT_Info.=
+ OS_Priority priority;
+
+ // For ordering RT_Info's with equal priority.
+ Preemption_Subpriority_t preemption_subpriority;
+
+ // The queue number for this RT_Info.
+ Preemption_Priority_t preemption_priority;
+
+ // Info_Type
+ Info_Type_t info_type;
+ // Whether or not the RT_Info is enabled.
+ RT_Info_Enabled_Type_t enabled;
+
+ // Token reserved for the scheduler's internal use:
+ // information placed here from outside the scheduler
+ // implementation is prone to be overwritten.
+ unsigned long long volatile_token;
+ };
+
+ enum Dispatching_Type_t
+ // Defines the type of prioritization strategy
+ // to be used by a dispatching queue
+ {
+ STATIC_DISPATCHING,
+ DEADLINE_DISPATCHING,
+ LAXITY_DISPATCHING
+ };
+
+ struct Config_Info
+ // = TITLE
+ // Describes configuration information for a dispatching queue
+ //
+ // = DESCRIPTION
+ // The CPU requirements and QoS for each
+ // "entity" implementing an application
+ // operation is described by the following
+ // information.
+ {
+ // preemption priority for messages dispatched by the queue
+ Preemption_Priority_t preemption_priority;
+
+ // OS priority of the dispatching thread associated with the queue
+ OS_Priority thread_priority;
+
+ // type of dispatching queue
+ Dispatching_Type_t dispatching_type;
+
+ // Set of timer periods associated with the priority level
+ Period_Set timer_periods;
+ };
+
+ typedef sequence<Config_Info> Config_Info_Set;
+
+ enum Anomaly_Severity
+ // Defines the type of prioritization strategy
+ // to be used by a dispatching queue
+ {
+ ANOMALY_FATAL,
+ ANOMALY_ERROR,
+ ANOMALY_WARNING,
+ ANOMALY_NONE
+ };
+
+ struct Scheduling_Anomaly
+ // = TITLE
+ // Describes an anomalous condition encountered during scheduling.
+ //
+ // = DESCRIPTION
+ // The severity and description of an anomolous
+ // condition encountered during schedule computation
+ // is described by the following information.
+ {
+ // Application-defined string that describes
+ // the anomalous condition.
+ string description;
+
+ // Severity of the anomaly
+ Anomaly_Severity severity;
+ };
+
+ typedef sequence<Scheduling_Anomaly> Scheduling_Anomaly_Set;
+
+ exception CYCLIC_DEPENDENCIES {};
+ // There are cycles in the registered dependencies.
+
+ exception UNRESOLVED_LOCAL_DEPENDENCIES {};
+ // There are unresolved local dependencies: one
+ // or more nodes that are not declared as having
+ // unresolved remote dependencies has no threads,
+ // period, or dependencies on another node.
+
+ exception THREAD_SPECIFICATION {};
+ // A node that specifies threads does not specify a period.
+
+ exception DUPLICATE_NAME {};
+ // The application is trying to register the same task again.
+
+ exception UNKNOWN_TASK {};
+ // The RT_Info handle was not valid.
+
+ exception NOT_SCHEDULED {};
+ // The application is trying to obtain scheduling information, but
+ // none is available.
+
+ exception UTILIZATION_BOUND_EXCEEDED {};
+ exception INSUFFICIENT_THREAD_PRIORITY_LEVELS {};
+ exception TASK_COUNT_MISMATCH {};
+ // Problems while computing scheduling.
+
+ exception UNKNOWN_PRIORITY_LEVEL {};
+ // Problems obtaining run-time dispatch queue info.
+
+ exception SYNCHRONIZATION_FAILURE {};
+ // Problems acquiring a synchronization resource.
+
+ exception INTERNAL {};
+ // Problems with the internal scheduler data structures.
+
+ typedef sequence<RT_Info> RT_Info_Set;
+
+ // TODO: Find a reasonable name for this interface, maybe we should
+ // change the name of the module to RtecSchedulerAdmin and name this
+ // Scheduler
+ interface Scheduler
+ // = DESCRIPTION
+ // This class holds all the RT_Info's for a single application.
+ // During the configuration run this will be implemented as a
+ // single remote object, whose services are used by the
+ // suppliers, consumers and the EC.
+ // At run-time each process will hold a copy of the compiled
+ // version of the Scheduler, using the precomputed data to
+ // resolve requests (avoiding any remote calls) and ignoring any
+ // requests for modifying its state.
+ // A Factory class will be used to choose the proper
+ // implementation.
+ //
+ // This class must be registered with the naming service using a
+ // well known name ("Scheduler" seems the obvious choice), the
+ // Naming Context will account for different applications and
+ // modes.
+ //
+ // Once the scheduling data is computed it can be retrieved
+ // remotely to generate the code for the run-time version.
+ {
+ handle_t create (in string entry_point)
+ raises (DUPLICATE_NAME, INTERNAL, SYNCHRONIZATION_FAILURE);
+ // Creates a new RT_Info entry for the function identifier
+ // "entry_point", it can be any string, but the fully qualified
+ // name function name is suggested.
+ // Returns a handle to the RT_Info.
+
+ handle_t lookup (in string entry_point)
+ raises (UNKNOWN_TASK, SYNCHRONIZATION_FAILURE);
+ // Lookups a handle for entry_point.
+
+ RT_Info get (in handle_t handle)
+ raises (UNKNOWN_TASK, SYNCHRONIZATION_FAILURE);
+ // Retrieve information about an RT_Info.
+
+ void set (in handle_t handle,
+ in Criticality_t criticality,
+ in Time wc_time,
+ in Time typical_time,
+ in Time cached_time,
+ in Period_t period,
+ in Importance_t importance,
+ in Quantum_t quantum,
+ in Threads_t threads,
+ in Info_Type_t info_type)
+ raises (UNKNOWN_TASK, INTERNAL, SYNCHRONIZATION_FAILURE);
+ // Set the input attributes of an RT_Info. Multiple calls
+ // to set with the same handle will result in registration
+ // of different tuples for the same RT_Info, e.g., for multi-rate
+ // admission control.
+ // Notice that some values may not be modified (like priority).
+ // Criticality and Info_Type are only used with the Dynamic Scheduler.
+
+ void reset (in handle_t handle,
+ in Criticality_t criticality,
+ in Time wc_time,
+ in Time typical_time,
+ in Time cached_time,
+ in Period_t period,
+ in Importance_t importance,
+ in Quantum_t quantum,
+ in Threads_t threads,
+ in Info_Type_t info_type)
+ raises (UNKNOWN_TASK, INTERNAL, SYNCHRONIZATION_FAILURE);
+ // Removes previous tuples and resets the attributes of an RT_Info.
+ // Notice that some values may not be modified (like priority).
+ // Criticality and Info_Type are only used with the Dynamic Scheduler.
+
+
+ void set_seq (in RT_Info_Set infos)
+ raises (UNKNOWN_TASK, INTERNAL, SYNCHRONIZATION_FAILURE);
+ // Set the input attributes of an RT_Info. Tuples for the passed
+ // sequence elements will be concatenated with the previous
+ // tuples for the same RT_Infos, e.g., for multi-rate admission control.
+ // Notice that some values may not be modified (like priority).
+
+ void reset_seq (in RT_Info_Set infos)
+ raises (UNKNOWN_TASK, INTERNAL, SYNCHRONIZATION_FAILURE);
+ // Reset the input attributes of an RT_Info. Tuples for the passed
+ // sequence elements will be replace the previous
+ // tuples for the same RT_Infos, e.g., for multi-rate admission control.
+ // Notice that some values may not be modified (like priority).
+
+ void replace_seq (in RT_Info_Set infos)
+ raises (UNKNOWN_TASK, INTERNAL, SYNCHRONIZATION_FAILURE);
+ // Replace all RT_Infos, setting characteristics of the RT_Infos
+ // corresponding to the passed handles. All other RT_Infos are reset
+ // to their uninitialized values, i.e., the same they have just after
+ // the create call.
+
+ void add_dependency (in handle_t handle,
+ in handle_t dependency,
+ in long number_of_calls,
+ in Dependency_Type_t dependency_type)
+ raises (SYNCHRONIZATION_FAILURE, UNKNOWN_TASK);
+ // Adds <dependency> to <handle>.
+ // Dependency_Type_t is only used with the Dynamic Scheduler.
+
+ void remove_dependency (in handle_t handle,
+ in handle_t dependency,
+ in long number_of_calls,
+ in Dependency_Type_t dependency_type)
+ raises (SYNCHRONIZATION_FAILURE, UNKNOWN_TASK);
+ // Removes <dependency> from <handle>. Raises UNKNOWN_TASK
+ // if no matching dependency is found.
+
+ void set_dependency_enable_state (in handle_t handle,
+ in handle_t dependency,
+ in long number_of_calls,
+ in Dependency_Type_t dependency_type,
+ in Dependency_Enabled_Type_t enabled)
+ raises (SYNCHRONIZATION_FAILURE, UNKNOWN_TASK);
+ // Enables or disables <dependency> on <handle>. Raises UNKNOWN_TASK
+ // if no matching dependency is found.
+
+ void set_dependency_enable_state_seq (in Dependency_Set dependencies)
+ raises (SYNCHRONIZATION_FAILURE, UNKNOWN_TASK);
+ // Sets the enable state of each dependency in the sequence. Raises
+ // UNKNOWN_TASK if no matching dependency is found.
+
+ void set_rt_info_enable_state (in handle_t handle,
+ in RT_Info_Enabled_Type_t enabled)
+ raises (SYNCHRONIZATION_FAILURE, INTERNAL, UNKNOWN_TASK);
+ // Enables or disables the RT_Info. Raises UNKNOWN_TASK
+ // if no matching RT_Info is found.
+
+ void set_rt_info_enable_state_seq (in RT_Info_Enable_State_Pair_Set pair_set)
+ raises (SYNCHRONIZATION_FAILURE, INTERNAL, UNKNOWN_TASK);
+ // Enables or disables each rt_info in the passed set. Raises UNKNOWN_TASK
+ // if no matching dependency is found.
+
+ void priority (in handle_t handle,
+ out OS_Priority o_priority,
+ out Preemption_Subpriority_t p_subpriority,
+ out Preemption_Priority_t p_priority)
+ raises (UNKNOWN_TASK, SYNCHRONIZATION_FAILURE, NOT_SCHEDULED);
+ void entry_point_priority (in string entry_point,
+ out OS_Priority o_priority,
+ out Preemption_Subpriority_t p_subpriority,
+ out Preemption_Priority_t p_priority)
+ raises (UNKNOWN_TASK, SYNCHRONIZATION_FAILURE, NOT_SCHEDULED);
+ // Obtain the run time priorities.
+ // TODO: Do we need the two interfaces or is it simply confusing?
+ // If we should to keep only the <handle> version: Are the extra
+ // round-trips too expensive?
+ // If we choose only the <entry_point> version: Are the copies for
+ // the string affordable?
+
+ void compute_scheduling (in long minimum_priority,
+ in long maximum_priority,
+ out RT_Info_Set infos,
+ out Dependency_Set dependencies,
+ out Config_Info_Set configs,
+ out Scheduling_Anomaly_Set anomalies)
+ raises (UTILIZATION_BOUND_EXCEEDED,
+ SYNCHRONIZATION_FAILURE,
+ INSUFFICIENT_THREAD_PRIORITY_LEVELS,
+ TASK_COUNT_MISMATCH,
+ INTERNAL,
+ DUPLICATE_NAME);
+ // Computes the scheduling priorities, returns the RT_Info's with
+ // their priorities properly filled.
+ // This info can be cached by a Run_Time_Scheduler service or
+ // dumped into a C++ file for compilation and even faster (static)
+ // lookup.
+
+
+ void recompute_scheduling (in long minimum_priority,
+ in long maximum_priority,
+ out Scheduling_Anomaly_Set anomalies)
+ raises (UTILIZATION_BOUND_EXCEEDED,
+ SYNCHRONIZATION_FAILURE,
+ INSUFFICIENT_THREAD_PRIORITY_LEVELS,
+ TASK_COUNT_MISMATCH,
+ INTERNAL,
+ DUPLICATE_NAME);
+ // Recomputes the scheduling priorities, etc.
+
+ void get_rt_info_set (out RT_Info_Set infos)
+ raises (SYNCHRONIZATION_FAILURE,
+ INTERNAL);
+ // Returns the set of rt_infos, with their assigned priorities (as
+ // of the last schedule re-computation).
+
+ void get_dependency_set (out Dependency_Set dependencies)
+ raises (SYNCHRONIZATION_FAILURE,
+ INTERNAL);
+ // Returns the set of rt_infos, with their assigned priorities (as
+ // of the last schedule re-computation).
+
+ void get_config_info_set (out Config_Info_Set configs)
+ raises (SYNCHRONIZATION_FAILURE,
+ INTERNAL);
+ // Returns the set of config_infos, describing the appropriate
+ // number, types, and priority levels for the dispatching lanes.
+
+ void dispatch_configuration (in Preemption_Priority_t p_priority,
+ out OS_Priority o_priority,
+ out Dispatching_Type_t d_type)
+ raises (NOT_SCHEDULED,
+ SYNCHRONIZATION_FAILURE,
+ UNKNOWN_PRIORITY_LEVEL);
+ // Returns the thread priority and dispatching type assigned
+ // to the dispatching priority level that was passed in. This
+ // information can be used to configure the queues through which
+ // the scheduled operations are to be dispatched.
+ //
+ // If the schedule has not been computed:
+ // raises (NOT_SCHEDULED);
+ //
+ // If the schedule has been computed, but the passed
+ // priority level is outside those assigned:
+ // raises (UNKNOWN_PRIORITY_LEVEL);
+
+
+ Preemption_Priority_t last_scheduled_priority ()
+ raises (SYNCHRONIZATION_FAILURE, NOT_SCHEDULED);
+ // Returns the last priority number assigned to an operation in the schedule.
+ // The number returned is one less than the total number of scheduled priorities.
+ // All scheduled priorities range from 0 to the number returned, inclusive.
+ //
+ // If the schedule has not been computed:
+ // raises (NOT_SCHEDULED);
+
+ void get_config_infos(out Config_Info_Set configs)
+ raises (SYNCHRONIZATION_FAILURE, NOT_SCHEDULED);
+ // Provides the set of Config_Infos associated with the current schedule.
+ //
+ // If the schedule has not been computed:
+ // raises (NOT_SCHEDULED);
+ };
+};
+
+#endif /* TAO_RTEC_SCHEDULER_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/RtecUDPAdmin.idl b/TAO/orbsvcs/orbsvcs/RtecUDPAdmin.idl
new file mode 100644
index 00000000000..b63f52fe9a2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/RtecUDPAdmin.idl
@@ -0,0 +1,61 @@
+/**
+ * @file RtecUDPAdmin.idl
+ *
+ * @brief Define the RtecUDPAdmin module
+ *
+ * $Id$
+ *
+ * TAO's Real-time Event Service is described in:
+ *
+ * http://doc.ece.uci.edu/~coryan/EC/
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_RTEC_UDP_ADMIN_IDL
+#define TAO_RTEC_UDP_ADMIN_IDL
+
+#include "RtecEventComm.idl"
+
+/**
+ * @namespace RtecUDPAdmin
+ *
+ * @brief Define the data structures and interfaces used by UDP-based
+ * gateways
+ */
+module RtecUDPAdmin
+{
+ /**
+ * @struct UDP_Addr
+ *
+ * @brief Represent a UDP SAP.
+ */
+ struct UDP_Addr
+ {
+ /// The IP address
+ unsigned long ipaddr;
+ /// The UDP port
+ unsigned short port;
+ };
+
+ /**
+ * @interface AddrServer
+ *
+ * @brief Defines a interface to configure the mapping between
+ * events and multicast groups (or UDP broadcast or UDP unicast)
+ * addresses.
+ */
+ interface AddrServer
+ {
+ /// Get the UDP address give the event header
+ /**
+ * @param header The event header, used to fetch the type and
+ * source of the event
+ * @param addr Return the address used for the given event type
+ */
+ void get_addr (in RtecEventComm::EventHeader header,
+ out UDP_Addr addr);
+ };
+};
+
+#endif /* TAO_RTEC_UDP_ADMIN_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp
new file mode 100644
index 00000000000..d582988c508
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp
@@ -0,0 +1,594 @@
+// $Id$
+
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Runtime_Scheduler.h"
+#include "ace/OS_NS_string.h"
+
+ACE_RCSID (orbsvcs,
+ Runtime_Scheduler,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Constructor. Initialize the data from the POD_RT_Info array.
+
+ACE_Runtime_Scheduler::
+ACE_Runtime_Scheduler (int config_count,
+ ACE_Scheduler_Factory::POD_Config_Info config_info[],
+ int entry_count,
+ ACE_Scheduler_Factory::POD_RT_Info rt_info[])
+ : config_count_ (config_count),
+ config_info_ (config_info),
+ entry_count_ (entry_count),
+ rt_info_ (rt_info)
+{
+}
+
+// Create an RT_Info. In the config run scheduler this actually constructs
+// a new RT_Info. Here, we just return its handle, or an error value if
+// it's not present.
+
+RtecScheduler::handle_t
+ACE_Runtime_Scheduler::create (const char *entry_point
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::DUPLICATE_NAME))
+{
+ // Just make sure it's there and return its handle.
+ for (int i = 0; i < entry_count_; ++i)
+ if (ACE_OS::strcmp (entry_point,
+ rt_info_[i].entry_point) == 0)
+ return i + 1;
+
+ // TODO: throw an exception or print an error.
+ return -1;
+}
+
+// Lookup a handle for an RT_Info, and return its handle, or an error
+// value if it's not present.
+
+RtecScheduler::handle_t
+ACE_Runtime_Scheduler::lookup (const char * entry_point
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return create (entry_point ACE_ENV_ARG_PARAMETER);
+}
+
+
+// Return a pointer to the RT_Info corresponding to the passed handle.
+
+RtecScheduler::RT_Info *
+ACE_Runtime_Scheduler::get (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK))
+{
+ if (handle <= 0 || handle > entry_count_)
+ ACE_THROW_RETURN (RtecScheduler::UNKNOWN_TASK (),
+ 0);
+ // Note: there is no memory leak here, according to the CORBA spec,
+ // we are supposed to allocate an structure and return it, the
+ // caller owns it from then on.
+
+ // Allocate a new RT_Info
+ RtecScheduler::RT_Info* info;
+ ACE_NEW_THROW_EX (info,
+ RtecScheduler::RT_Info,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+
+ info->entry_point = rt_info_[handle - 1].entry_point;
+ info->handle = rt_info_[handle - 1].handle;
+ info->worst_case_execution_time = rt_info_[handle - 1].worst_case_execution_time;
+ info->typical_execution_time = rt_info_[handle - 1].typical_execution_time;
+ info->cached_execution_time = rt_info_[handle - 1].cached_execution_time;
+ info->period = rt_info_[handle - 1].period;
+ info->criticality = RtecScheduler::Criticality_t(rt_info_[handle - 1].criticality);
+ info->importance = RtecScheduler::Importance_t(rt_info_[handle - 1].importance);
+ info->quantum = rt_info_[handle - 1].quantum;
+ info->threads = rt_info_[handle - 1].threads;
+ info->priority = rt_info_[handle - 1].priority;
+ info->preemption_subpriority = rt_info_[handle - 1].static_subpriority;
+ info->preemption_priority = rt_info_[handle - 1].preemption_priority;
+ info->info_type = RtecScheduler::Info_Type_t(rt_info_[handle - 1].info_type);
+
+ return info;
+}
+
+
+// Set characteristics of the RT_Info corresponding to the passed handle.
+
+void
+ACE_Runtime_Scheduler::set (::RtecScheduler::handle_t handle,
+ ::RtecScheduler::Criticality_t criticality,
+ ::RtecScheduler::Time time,
+ ::RtecScheduler::Time typical_time,
+ ::RtecScheduler::Time cached_time,
+ ::RtecScheduler::Period_t period,
+ ::RtecScheduler::Importance_t importance,
+ ::RtecScheduler::Quantum_t quantum,
+ ::RtecScheduler::Threads_t threads,
+ ::RtecScheduler::Info_Type_t info_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK))
+{
+ // We compare the values with the ones stored and print a message on
+ // any differences.
+ if (handle <= 0 || handle > entry_count_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Unknown task: no entry for handle %d\n",
+ handle));
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK());
+ // NOTREACHED
+ }
+ if (rt_info_[handle - 1].worst_case_execution_time != time
+ || rt_info_[handle - 1].typical_execution_time != typical_time
+ || rt_info_[handle - 1].cached_execution_time != cached_time
+ || rt_info_[handle - 1].period != period
+ || rt_info_[handle - 1].criticality != criticality
+ || rt_info_[handle - 1].importance != static_cast<CORBA::Long> (importance)
+ || rt_info_[handle - 1].quantum != quantum
+ || rt_info_[handle - 1].info_type != info_type
+ || rt_info_[handle - 1].threads != static_cast<CORBA::Long> (threads))
+ ACE_ERROR ((LM_ERROR,
+ "invalid data for RT_Info: %s\n",
+ (const char*)rt_info_[handle - 1].entry_point));
+ // TODO: throw something here.
+}
+
+
+void
+ACE_Runtime_Scheduler::reset (RtecScheduler::handle_t handle,
+ RtecScheduler::Criticality_t criticality,
+ RtecScheduler::Time time,
+ RtecScheduler::Time typical_time,
+ RtecScheduler::Time cached_time,
+ RtecScheduler::Period_t period,
+ RtecScheduler::Importance_t importance,
+ RtecScheduler::Quantum_t quantum,
+ RtecScheduler::Threads_t threads,
+ RtecScheduler::Info_Type_t info_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK))
+{
+ // Just go ahead and call the set method
+ this->set (handle, criticality, time, typical_time, cached_time,
+ period, importance, quantum, threads, info_type ACE_ENV_ARG_PARAMETER );
+}
+
+
+void
+ACE_Runtime_Scheduler::set_seq (const RtecScheduler::RT_Info_Set& infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+{
+ for (u_int i = 0; i < infos.length (); ++i)
+ {
+#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x582) && defined (NDEBUG)
+ // BCB2006 and BCB6 get an internal backend error when building this
+ // code in release mode, reported to Borland as QC27961
+ RtecScheduler::RT_Info info = infos[i];
+
+ // Call the internal set method.
+ this->set (info.handle,
+ info.criticality,
+ info.worst_case_execution_time,
+ info.typical_execution_time,
+ info.cached_execution_time,
+ info.period,
+ info.importance,
+ info.quantum,
+ info.threads,
+ info.info_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#else
+ // Call the internal set method.
+ this->set (infos[i].handle,
+ infos[i].criticality,
+ infos[i].worst_case_execution_time,
+ infos[i].typical_execution_time,
+ infos[i].cached_execution_time,
+ infos[i].period,
+ infos[i].importance,
+ infos[i].quantum,
+ infos[i].threads,
+ infos[i].info_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#endif
+ }
+}
+
+void
+ACE_Runtime_Scheduler::replace_seq (const RtecScheduler::RT_Info_Set& infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+{
+ for (u_int i = 0; i < infos.length (); ++i)
+ {
+#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x582) && defined (NDEBUG)
+ // BCB2006 and BCB6 get an internal backend error when building this
+ // code in release mode, reported to Borland as QC27961
+ RtecScheduler::RT_Info info = infos[i];
+
+ // Call the internal set method.
+ this->set (info.handle,
+ info.criticality,
+ info.worst_case_execution_time,
+ info.typical_execution_time,
+ info.cached_execution_time,
+ info.period,
+ info.importance,
+ info.quantum,
+ info.threads,
+ info.info_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#else
+ // Call the internal set method.
+ this->set (infos[i].handle,
+ infos[i].criticality,
+ infos[i].worst_case_execution_time,
+ infos[i].typical_execution_time,
+ infos[i].cached_execution_time,
+ infos[i].period,
+ infos[i].importance,
+ infos[i].quantum,
+ infos[i].threads,
+ infos[i].info_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#endif
+ }
+}
+
+
+void
+ACE_Runtime_Scheduler::reset_seq (const RtecScheduler::RT_Info_Set& infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+{
+ // Just call the set sequence method
+ this->set_seq (infos ACE_ENV_ARG_PARAMETER);
+}
+
+
+// Returns the priority and subpriority values assigned to an RT_Info,
+// based on its handle.
+
+void
+ACE_Runtime_Scheduler::priority (RtecScheduler::handle_t handle,
+ RtecScheduler::OS_Priority& o_priority,
+ RtecScheduler::Preemption_Subpriority_t& subpriority,
+ RtecScheduler::Preemption_Priority_t& p_priority
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::NOT_SCHEDULED))
+{
+ if (handle <= 0 || handle > entry_count_)
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ // NOTREACHED
+
+ o_priority = rt_info_[handle - 1].priority;
+ subpriority = rt_info_[handle - 1].static_subpriority;
+ p_priority = rt_info_[handle - 1].preemption_priority;
+}
+
+
+// Returns the priority and subpriority values assigned to an RT_Info,
+// based on its entry point name.
+
+void
+ACE_Runtime_Scheduler::entry_point_priority (const char * entry_point,
+ RtecScheduler::OS_Priority& priority,
+ RtecScheduler::Preemption_Subpriority_t& subpriority,
+ RtecScheduler::Preemption_Priority_t& p_priority
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::NOT_SCHEDULED))
+{
+ RtecScheduler::handle_t handle = lookup (entry_point ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (handle < -1)
+ // The exception was thrown or is in ACE_ENV_SINGLE_ARG_PARAMETER already.
+ return;
+ this->priority (handle,
+ priority,
+ subpriority,
+ p_priority
+ ACE_ENV_ARG_PARAMETER);
+}
+
+
+// In the config run scheduler, this method registers a dependency between
+// two RT_Infos. In the run time scheduler, this is a no-op.
+
+void
+ACE_Runtime_Scheduler::add_dependency (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t /* dependency */,
+ CORBA::Long /* number_of_calls */,
+ RtecScheduler::Dependency_Type_t /* dependency_type */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK))
+{
+ if (handle <= 0 || handle > entry_count_)
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ // NOTREACHED
+
+#if 0
+ // Just check that the information is consistent.
+ RtecScheduler::Dependency_Set& deps = rt_info_[handle - 1]->dependencies;
+ for (CORBA::ULong i = 0; i < deps.length (); ++i)
+ {
+ if (deps[i].rt_info == dependency
+ && deps[i].number_of_calls == number_of_calls
+ && deps[i].dependency_type == dependency_type)
+ {
+ return;
+ }
+ }
+ ACE_ERROR ((LM_ERROR, "unmatched dependency on %s\n",
+ (const char*)rt_info_[handle - 1]->entry_point));
+#endif
+}
+
+
+// In the reconfig scheduler, this method removes a dependency between
+// two RT_Infos. In the run time scheduler, this is a no-op.
+
+void
+ACE_Runtime_Scheduler::remove_dependency (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t /* dependency */,
+ CORBA::Long /* number_of_calls */,
+ RtecScheduler::Dependency_Type_t /* dependency_type */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK))
+{
+ if (handle <= 0 || handle > entry_count_)
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+}
+
+
+// In the reconfig scheduler, this method enables a dependency between
+// two RT_Infos. In the run time scheduler, this is a no-op.
+
+void
+ACE_Runtime_Scheduler::set_dependency_enable_state (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t /* dependency */,
+ CORBA::Long /* number_of_calls */,
+ RtecScheduler::Dependency_Type_t /* dependency_type */,
+ RtecScheduler::Dependency_Enabled_Type_t /* enabled */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK))
+{
+ if (handle <= 0 || handle > entry_count_)
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+}
+
+
+// In the reconfig scheduler, this method enables or disables an RT_Info.
+// In the run time scheduler, this is a no-op.
+
+void
+ACE_Runtime_Scheduler::set_rt_info_enable_state (RtecScheduler::handle_t handle,
+ RtecScheduler::RT_Info_Enabled_Type_t /* enabled */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK))
+{
+ if (handle <= 0 || handle > entry_count_)
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+}
+
+
+void ACE_Runtime_Scheduler::set_dependency_enable_state_seq (const RtecScheduler::Dependency_Set & dependencies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK))
+ // This method sets the enable state of a sequence of dependencies.
+{
+ ACE_UNUSED_ARG (dependencies);
+
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+void ACE_Runtime_Scheduler::set_rt_info_enable_state_seq (
+ const RtecScheduler::RT_Info_Enable_State_Pair_Set &
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK))
+// This method enables or disables a sequence of RT_Infos.
+{
+}
+
+// In the config run scheduler, this method causes scheduling information
+// to be computed for all registered RT_Infos. In the run time scheduler,
+// this is a no-op.
+
+void
+ACE_Runtime_Scheduler::compute_scheduling (CORBA::Long /* minimum_priority */,
+ CORBA::Long /* maximum_priority */,
+ RtecScheduler::RT_Info_Set_out /* infos */,
+ RtecScheduler::Dependency_Set_out /*dependencies */,
+ RtecScheduler::Config_Info_Set_out /* configs */,
+ RtecScheduler::Scheduling_Anomaly_Set_out /* anomalies */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UTILIZATION_BOUND_EXCEEDED,
+ RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS,
+ RtecScheduler::TASK_COUNT_MISMATCH))
+{
+ // TODO: Right now just do nothing, later we could validate the
+ // priorities (without recomputing).
+ // TODO: fill up the infos.
+ return;
+}
+
+// Recomputes the scheduling priorities, etc.
+
+void
+ACE_Runtime_Scheduler::recompute_scheduling (CORBA::Long minimum_priority,
+ CORBA::Long maximum_priority,
+ RtecScheduler::Scheduling_Anomaly_Set_out anomalies
+ ACE_ENV_ARG_DECL_NOT_USED)
+
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UTILIZATION_BOUND_EXCEEDED,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS,
+ RtecScheduler::TASK_COUNT_MISMATCH,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::DUPLICATE_NAME))
+{
+ // TODO: Right now just do nothing.
+ ACE_UNUSED_ARG(minimum_priority);
+ ACE_UNUSED_ARG(maximum_priority);
+ ACE_UNUSED_ARG(anomalies);
+
+ return;
+}
+
+
+// Returns the set of rt_infos, with their assigned priorities (as
+// of the last schedule re-computation).
+
+void
+ACE_Runtime_Scheduler::get_rt_info_set (RtecScheduler::RT_Info_Set_out infos
+ ACE_ENV_ARG_DECL_NOT_USED)
+
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL))
+{
+ // TODO: Right now just do nothing.
+ ACE_UNUSED_ARG(infos);
+ return;
+}
+
+
+// Returns the set of rt_infos, with their assigned priorities (as
+// of the last schedule re-computation).
+
+void
+ACE_Runtime_Scheduler::get_dependency_set (RtecScheduler::Dependency_Set_out dependencies
+ ACE_ENV_ARG_DECL_NOT_USED)
+
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL))
+{
+ // TODO: Right now just do nothing.
+ ACE_UNUSED_ARG(dependencies);
+ return;
+}
+
+
+// Returns the set of config_infos, describing the appropriate
+// number, types, and priority levels for the dispatching lanes.
+
+void
+ACE_Runtime_Scheduler::get_config_info_set (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL))
+{
+ // TODO: Right now just do nothing.
+ ACE_UNUSED_ARG(configs);
+ return;
+}
+
+
+// Provides the thread priority and queue type for the given priority
+// level.
+
+void
+ACE_Runtime_Scheduler::dispatch_configuration (RtecScheduler::Preemption_Priority_t p_priority,
+ RtecScheduler::OS_Priority& priority,
+ RtecScheduler::Dispatching_Type_t & d_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::NOT_SCHEDULED,
+ RtecScheduler::UNKNOWN_PRIORITY_LEVEL))
+{
+ // Throw an exception if a valid schedule has not been loaded
+ if (config_count_ <= 0
+ || config_info_ [p_priority].preemption_priority != p_priority)
+ {
+ ACE_THROW (RtecScheduler::NOT_SCHEDULED ());
+ ACE_NOTREACHED (return);
+ }
+ // throw an exception if an invalid priority was passed
+ else if (p_priority < 0 || p_priority >= config_count_)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_PRIORITY_LEVEL());
+ ACE_NOTREACHED (return);
+ }
+ else
+ {
+ priority = config_info_ [p_priority].thread_priority;
+ d_type = config_info_ [p_priority].dispatching_type;
+ return;
+ }
+}
+
+
+// Returns the last priority number assigned to an operation in the
+// schedule. The number returned is one less than the total number
+// of scheduled priorities. All scheduled priorities range from 0
+// to the number returned, inclusive.
+
+RtecScheduler::Preemption_Priority_t
+ACE_Runtime_Scheduler::last_scheduled_priority (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::NOT_SCHEDULED))
+{
+ // throw an exception if a valid schedule has not been loaded
+ if (config_count_ <= 0)
+ ACE_THROW_RETURN (RtecScheduler::NOT_SCHEDULED(),
+ (RtecScheduler::Preemption_Priority_t) -1);
+ else
+ return (RtecScheduler::Preemption_Priority_t) (config_count_ - 1);
+}
+
+
+void
+ACE_Runtime_Scheduler::get_config_infos (RtecScheduler::Config_Info_Set_out /*configs */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::NOT_SCHEDULED))
+{
+ // throw an exception if a valid schedule has not been loaded
+ if (this->config_count_ <= 0)
+ ACE_THROW (RtecScheduler::NOT_SCHEDULED());
+ //TODO: fill the Config_Info_Set with the runtime Config_Infos
+ //for now, this function is unimplemented
+ //
+ // @@ If unimplemented we either return a CORBA::NO_IMPL exception
+ // or a proprietary ACE_NOTSUP; -- Bala
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.h b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.h
new file mode 100644
index 00000000000..f7afe874c75
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.h
@@ -0,0 +1,288 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Runtime_Scheduler.h
+//
+// = AUTHOR
+// Chris Gill <cdgill@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef ACE_RUNTIME_SCHEDULER_H
+#define ACE_RUNTIME_SCHEDULER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Scheduler_Factory.h"
+#include "orbsvcs/RtecSchedulerS.h"
+#include "orbsvcs/Sched/sched_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_RTSched_Export ACE_Runtime_Scheduler : public POA_RtecScheduler::Scheduler
+{
+ // = TITLE
+ // A fast and simple servant for RtecScheduler::Scheduler based on
+ // precomputed schedules.
+ //
+ // = DESCRIPTION
+ // This class offers the services of the scheduler, but based on
+ // precomputed and precompiled information. This results in a
+ // highly optimized execution after the configuration runs.
+public:
+ ACE_Runtime_Scheduler (int config_count,
+ ACE_Scheduler_Factory::POD_Config_Info config_info[],
+ int entry_count,
+ ACE_Scheduler_Factory::POD_RT_Info rt_info[]);
+ // Constructor. Initialize the data from the POD_RT_Info array.
+
+ virtual RtecScheduler::handle_t create (const char * entry_point
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::DUPLICATE_NAME));
+ // Create an RT_Info. In the config run scheduler this actually constructs
+ // a new RT_Info. Here, we just return its handle, or an error value if
+ // it's not present.
+
+ virtual RtecScheduler::handle_t lookup (const char * entry_point
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC((CORBA::SystemException));
+ // Lookup a handle for an RT_Info, and return its handle, or an error
+ // value if it's not present.
+
+ virtual RtecScheduler::RT_Info* get (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK));
+ // Return a pointer to the RT_Info corresponding to the passed handle.
+
+ virtual void set (::RtecScheduler::handle_t handle,
+ ::RtecScheduler::Criticality_t criticality,
+ ::RtecScheduler::Time time,
+ ::RtecScheduler::Time typical_time,
+ ::RtecScheduler::Time cached_time,
+ ::RtecScheduler::Period_t period,
+ ::RtecScheduler::Importance_t importance,
+ ::RtecScheduler::Quantum_t quantum,
+ ::RtecScheduler::Threads_t threads,
+ ::RtecScheduler::Info_Type_t info_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK));
+ // Set characteristics of the RT_Info corresponding to the passed handle.
+
+ virtual void reset (RtecScheduler::handle_t handle,
+ RtecScheduler::Criticality_t criticality,
+ RtecScheduler::Time time,
+ RtecScheduler::Time typical_time,
+ RtecScheduler::Time cached_time,
+ RtecScheduler::Period_t period,
+ RtecScheduler::Importance_t importance,
+ RtecScheduler::Quantum_t quantum,
+ RtecScheduler::Threads_t threads,
+ RtecScheduler::Info_Type_t info_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK));
+ // Reset characteristics of the RT_Info corresponding to the passed handle.
+
+ virtual void set_seq (const RtecScheduler::RT_Info_Set& infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Set characteristics of the RT_Infos corresponding to the passed handles.
+ // Tuples are added in the case of existing and/or multiple definitions.
+
+ virtual void replace_seq (const RtecScheduler::RT_Info_Set& infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Replace characteristics of the RT_Infos corresponding to the
+ // passed handles.
+
+ virtual void reset_seq (const RtecScheduler::RT_Info_Set& infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Reset characteristics of the RT_Infos corresponding to the passed handles.
+ // Tuples are replaced in the case of existing and/or multiple definitions.
+
+ virtual void priority (RtecScheduler::handle_t handle,
+ RtecScheduler::OS_Priority& o_priority,
+ RtecScheduler::Preemption_Subpriority_t& p_subpriority,
+ RtecScheduler::Preemption_Priority_t& p_priority
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::NOT_SCHEDULED));
+ // Returns the priority and subpriority values assigned to an RT_Info,
+ // based on its handle.
+
+ virtual void entry_point_priority (const char * entry_point,
+ RtecScheduler::OS_Priority& o_priority,
+ RtecScheduler::Preemption_Subpriority_t& p_subpriority,
+ RtecScheduler::Preemption_Priority_t& p_priority
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::NOT_SCHEDULED));
+ // Returns the priority and subpriority values assigned to an RT_Info,
+ // based on its entry point name.
+
+ virtual void add_dependency (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK));
+ // In the config run scheduler, this method registers a dependency between
+ // two RT_Infos. In the run time scheduler, this is a no-op.
+
+ virtual void remove_dependency (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK));
+ // In the reconfig scheduler, this method removes a dependency between
+ // two RT_Infos. In the run time scheduler, this is a no-op.
+
+ virtual void set_dependency_enable_state (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type,
+ RtecScheduler::Dependency_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK));
+ // In the reconfig scheduler, this method (re)enabes a dependency between
+ // two RT_Infos. In the run time scheduler, this is a no-op.
+
+ virtual void set_rt_info_enable_state (RtecScheduler::handle_t handle,
+ RtecScheduler::RT_Info_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK));
+ // In the reconfig scheduler, enables or disables an RT_Info.
+ // In the run time scheduler, this is a no-op.
+
+ virtual void set_dependency_enable_state_seq (const RtecScheduler::Dependency_Set & dependencies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method sets the enable state of a sequence of dependencies.
+
+ virtual void set_rt_info_enable_state_seq (const RtecScheduler::RT_Info_Enable_State_Pair_Set & pair_set
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method enables or disables a sequence of RT_Infos.
+
+ virtual void compute_scheduling (CORBA::Long minimum_priority,
+ CORBA::Long maximum_priority,
+ RtecScheduler::RT_Info_Set_out infos,
+ RtecScheduler::Dependency_Set_out deps,
+ RtecScheduler::Config_Info_Set_out configs,
+ RtecScheduler::Scheduling_Anomaly_Set_out anomalies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UTILIZATION_BOUND_EXCEEDED,
+ RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS,
+ RtecScheduler::TASK_COUNT_MISMATCH));
+ // In the config run scheduler, this method causes scheduling information
+ // to be computed for all registered RT_Infos. In the run time scheduler,
+ // this is a no-op.
+
+ virtual void recompute_scheduling (CORBA::Long minimum_priority,
+ CORBA::Long maximum_priority,
+ RtecScheduler::Scheduling_Anomaly_Set_out anomalies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UTILIZATION_BOUND_EXCEEDED,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS,
+ RtecScheduler::TASK_COUNT_MISMATCH,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::DUPLICATE_NAME));
+ // Recomputes the scheduling priorities, etc.
+
+ virtual void get_rt_info_set (RtecScheduler::RT_Info_Set_out infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL));
+ // Returns the set of rt_infos, with their assigned priorities (as
+ // of the last schedule re-computation).
+
+ virtual void get_dependency_set (RtecScheduler::Dependency_Set_out dependencies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL));
+ // Returns the set of rt_infos, with their assigned priorities (as
+ // of the last schedule re-computation).
+
+ virtual void get_config_info_set (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL));
+ // Returns the set of config_infos, describing the appropriate
+ // number, types, and priority levels for the dispatching lanes.
+
+ virtual void dispatch_configuration (RtecScheduler::Preemption_Priority_t p_priority,
+ RtecScheduler::OS_Priority& o_priority,
+ RtecScheduler::Dispatching_Type_t & d_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::NOT_SCHEDULED,
+ RtecScheduler::UNKNOWN_PRIORITY_LEVEL));
+ // Provides the thread priority and queue type for the given priority level.
+
+ virtual RtecScheduler::Preemption_Priority_t last_scheduled_priority (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::NOT_SCHEDULED));
+ // Returns the last priority number assigned to an operation in the
+ // schedule. The number returned is one less than the total number
+ // of scheduled priorities. All scheduled priorities range from 0
+ // to the number returned, inclusive.
+
+ virtual void get_config_infos (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::NOT_SCHEDULED));
+
+private:
+ int config_count_;
+ // The number of elements in the config array.
+
+ ACE_Scheduler_Factory::POD_Config_Info* config_info_;
+ // The array of precomputed queue configuration structures.
+
+ int entry_count_;
+ // The number of elements in the RT_Info array.
+
+ ACE_Scheduler_Factory::POD_RT_Info* rt_info_;
+ // The array of precomputed RT_Info structures.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* ACE_RUNTIME_SCHEDULER_H */
diff --git a/TAO/orbsvcs/orbsvcs/SL3CSI.idl b/TAO/orbsvcs/orbsvcs/SL3CSI.idl
new file mode 100644
index 00000000000..3f6f3981d43
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SL3CSI.idl
@@ -0,0 +1,353 @@
+//tabstop=4
+//***********************************************************************
+// ORBAsec SL3
+// ----------------------------------------------------------------------
+// Copyright (C) 2001 Adiron, LLC.
+// All rights reserved.
+// ----------------------------------------------------------------------
+// $Id$
+//***********************************************************************
+#ifndef _SL3CSIArgs_IDL_
+#define _SL3CSIArgs_IDL_
+#include <SL3/SecurityLevel3.idl>
+#include <SL3/Trust.idl>
+#include <SL3/UserPassword.idl>
+#include <SL3/TransportSecurity.idl>
+#include <SL3/SL3AQArgs.idl>
+#include <SL3OMG/ATLAS.idl>
+#include <SL3/SL3Authorization.idl>
+#include <SL3/ATLASCache.idl>
+
+#pragma prefix "adiron.com"
+
+/**
+ * This module contains structures and a factory interface to
+ * create tagged argument lists that will be given to the
+ * args parameter of the SecurityLevel3::CredentialsCurator.
+ * <p>
+ * ORBAsec SL3 uses this kind of mechanism because it is the
+ * easiest way to represent optional arguments.
+ * <P>
+ * To alleviate the hassles of dealing with any's and creating
+ * them, there is a factory retrieved by ORB::resolve_initial_references
+ * using "SL3:ArgumentFactory". From this object one may create an
+ * acquisition argument builder. This approach takes most of the work
+ * out of forming the Credentials acquisition argument.
+ * The form of the arguments and their requiredness or optionality
+ * are defined by the specific acquisition mechanisms using them.
+ *
+ * The Credentials Acquired with these arguments handle the
+ * CORBA CSIv2 protocol.
+ */
+module SL3CSI {
+
+ /**
+ * There is currently only one acquisition method for
+ * CSI based Credentials.
+ */
+ const SecurityLevel3::AcquisitionMethod AQM_CSIArgs = "CSIArgs";
+
+ /**
+ * An object of this interface is created by the Argument Factory Object.
+ * It aids in creating the Credentials Acquisition Argument for
+ * CSI based Credentials.
+ */
+ local interface CSIArgBuilder : SL3AQArgs::GenericArgBuilder {
+
+ /**
+ * This operation explicitly disables caching of ATLAS tokens.
+ * This is used in the case where CSI credentials are needed
+ * in order to communicate with an external cache. If cacheing
+ * were enabled in this case, then there would be a cache for
+ * the cache, which gets recursively messy.
+ */
+ void addSetNoLocalCache();
+
+ /**
+ * This operation adds an already existing ATLASCache as an
+ * acquisition argument. This is used in the case where an
+ * externalized cache is to be used. If a cache is not
+ * explicitly added to the argument, then a new cache will
+ * be created by the Credentials Curator.
+ */
+ void addATLASCache(
+ in ATLASCache::AuthTokenCache cache
+ );
+
+ /**
+ * This operation places a user defined Password Generator
+ * in the acquisition argument.
+ */
+ void addUserPasswordCAGenerator(
+ in UserPassword::PasswordGenerator generator
+ );
+
+ /**
+ * This operation places a user defined Password Processor
+ * in the acquisition argument.
+ */
+ void addUserPasswordCAProcessor(
+ in UserPassword::PasswordProcessor processor
+ );
+
+ /**
+ * This operation causes the creation credentials that
+ * have a "quoted" principal. CSI Credentials of this
+ * type will assert the particular principal name to a server.
+ */
+ void addNamedQuotedPrincipal(
+ in SecurityLevel3::PrincipalName principal_name
+ );
+
+ /**
+ * This operation causes the creation credentials that
+ * have a "quoted" principal. CSI Credentials of this
+ * type will assert the particular identity to a server.
+ */
+ void addEncodedQuotedPrincipal(
+ in SecurityLevel3::IdentityStatement identity
+ );
+
+ /**
+ * This operation places a user defined Trust Decider in
+ * the acquisition argument.
+ */
+ void addLocalTrustInServerDecider(
+ in Trust::LocalTrustInServerDecider trust_decider
+ );
+
+ /**
+ * This operation causes CSI Credentials to be created
+ * over a particular transport as if you created the
+ * transport credentials using the
+ * TransportSecurity::CredentialsCurator and used the
+ * addUseTransportCredentials operation of this object.
+ */
+ void addTransportCredentialsAQArgs(
+ in TransportSecurity::MechanismId mechanism_id,
+ in TransportSecurity::AcquisitionMethod acquisition_method,
+ in any acquisition_arguments
+ );
+
+ /**
+ * This operation causes CSI Credentials to be created
+ * over a particular transport credentials that have
+ * already been created by using the
+ * TransportSecurity::CredentialsCurator.
+ */
+ void addUseTransportCredentials(
+ in TransportSecurity::OwnCredentials credentials
+ );
+
+ /**
+ * This operation adds an ATLAS to your CSI Credentials.
+ * ATLAS is the Authorization Token Layer Acquisition Service.
+ * Each ATLAS represents a specific Authorization context, and
+ * is used to give your clients the ability to "log" in, and
+ * present credentials (i.e. an Authorization Token) for which
+ * to work the requests. It also gives the ability for clients
+ * to cache the tokens, so performance will be better.
+ * <p>
+ * None of the arguments can be null.
+ * <p>
+ * The cache_id is the caching Id, according to the ATLAS
+ * specification which must be unique to this authorization
+ * context, amongst all other authorization contexts. If you
+ * do not have a cache id, then this argument should be an
+ * empty octet sequence.
+ * <P>
+ * The token_dispenser is the ATLAS AuthTokenDispenser interface.
+ * This cannot be a "local" object.
+ * <p>
+ * The supports_delegation_by_client and requires_delegation_by_client
+ * arguments tell the client the way in which it
+ * will use the ATLAS. This
+ * information gets put in the ATLAS Profile, which is put
+ * in the IOR of the objects associated with the credentials.
+ * <p>
+ * The token_processor is the "sister" to the ATLAS, as it
+ * understands the tokens that the ATLAS ships out to clients.
+ * It is specific to the Authorization context. It may be
+ * a local object, but also can make remote calls.
+ */
+ void addATLASObject(
+ in ATLAS::ATLASCacheId cache_id,
+ in ATLAS::AuthTokenDispenser token_dispenser,
+ in boolean supports_delegation_by_client,
+ in boolean requires_delegation_by_client,
+ in SL3Authorization::TokenProcessor token_processor
+ );
+
+ };
+
+ /**
+ * This interface is a factory for arguments that will
+ * be in use for ORBAsec credentials acquisition mechanisms.
+ * It is retrievable off the ORB at "SL3:ArgumentFactory"
+ */
+ local interface ArgumentFactory {
+
+ /**
+ * Creates a new CSI Argument Builder object with the specified
+ * Credentials usage.
+ */
+ CSIArgBuilder createCSIArgBuilder(
+ in SecurityLevel3::CredentialsUsage usage
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * an flag that will disable the creation of the default
+ * ATLASCache.
+ *
+ * @see CSIArgBuilder
+ */
+ SL3AQArgs::Argument createSetNoLocalCache();
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * an ATLASCache implementation to use for caching ATLAS
+ * tokens.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the CSIArgBuilder.
+ *
+ * @see CSIArgBuilder
+ */
+ SL3AQArgs::Argument createATLASCache(
+ in ATLASCache::AuthTokenCache cache
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * the following information for acquiring CSI credentials.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the CSIArgBuilder.
+ *
+ * @see CSIArgBuilder
+ */
+ SL3AQArgs::Argument createUserPasswordCAGenerator(
+ in UserPassword::PasswordGenerator generator
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * the following information for acquiring CSI credentials.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the CSIArgBuilder.
+ *
+ * @see CSIArgBuilder
+ */
+ SL3AQArgs::Argument createUserPasswordCAProcessor(
+ in UserPassword::PasswordProcessor processor
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * the following information for acquiring CSI credentials.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the CSIArgBuilder.
+ *
+ * @see CSIArgBuilder
+ */
+ SL3AQArgs::Argument createKerberosCAGenerator(
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * the following information for acquiring CSI credentials.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the CSIArgBuilder.
+ *
+ * @see CSIArgBuilder
+ */
+ SL3AQArgs::Argument createKerberosCAProcessor(
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * the following information for acquiring CSI credentials.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the CSIArgBuilder.
+ *
+ * @see CSIArgBuilder
+ */
+ SL3AQArgs::Argument createNamedQuotedPrincipal(
+ in SecurityLevel3::PrincipalName prin_name
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * the following information for acquiring CSI credentials.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the CSIArgBuilder.
+ *
+ * @see CSIArgBuilder
+ */
+ SL3AQArgs::Argument createEncodedQuotedPrincipal(
+ in SecurityLevel3::IdentityStatement prin_name
+ );
+
+ /**
+ * This operation creates a Arg_TrustInServerDecider tagged
+ * argument.
+ */
+ SL3AQArgs::Argument createLocalTrustInServerDecider(
+ in Trust::LocalTrustInServerDecider trust_decider
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * the following information for acquiring CSI credentials.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the CSIArgBuilder.
+ *
+ * @see CSIArgBuilder
+ */
+ SL3AQArgs::Argument createTransportCredentialsAQArgs(
+ in TransportSecurity::MechanismId mechanism_id,
+ in TransportSecurity::AcquisitionMethod acquisition_method,
+ in any acquisition_arguments
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * the following information for acquiring CSI credentials.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the CSIArgBuilder.
+ *
+ * @see CSIArgBuilder
+ */
+ SL3AQArgs::Argument createUseTransportCredentials(
+ in TransportSecurity::OwnCredentials credentials
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * the following information for acquiring CSI credentials.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the CSIArgBuilder.
+ *
+ * @see CSIArgBuilder
+ */
+ SL3AQArgs::Argument createATLASObject(
+ in ATLAS::ATLASCacheId cache_id,
+ in ATLAS::AuthTokenDispenser token_dispenser,
+ in boolean supports_endorsement_by_client,
+ in boolean requires_endorsement_by_client,
+ in SL3Authorization::TokenProcessor token_processor
+ );
+
+ };
+
+};
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/SL3TCPIP.idl b/TAO/orbsvcs/orbsvcs/SL3TCPIP.idl
new file mode 100644
index 00000000000..f6d2c1a5246
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SL3TCPIP.idl
@@ -0,0 +1,203 @@
+//tabstop=4
+//***********************************************************************
+// ORBAsec SL3
+// ----------------------------------------------------------------------
+// Copyright (C) 2001 Adiron, LLC.
+// All rights reserved.
+// ----------------------------------------------------------------------
+// $Id$
+//***********************************************************************
+#ifndef _SL3TCPIP_IDL_
+#define _SL3TCPIP_IDL_
+#include <orb.idl>
+#include <SL3/SecurityLevel3.idl>
+#include <SL3/TransportSecurity.idl>
+#include <SL3/SL3AQArgs.idl>
+
+#pragma prefix "adiron.com"
+
+module SL3TCPIP {
+
+ const TransportSecurity::MechanismId MID_TCPIP = "TCPIP";
+
+ /**
+ * This is the only acquisition mechanism for acquiring TCPIP
+ * Transport Credentials.
+ */
+ const TransportSecurity::AcquisitionMethod AQM_TCPIPArgs = "TCPIPArgs";
+
+ /**
+ * An object of this interface is created by the Argument Factory Object.
+ * It aids in creating the Credentials Acquisition Argument for
+ * TCPIP based Transport Credentials.
+ */
+ local interface TCPIPArgBuilder : SL3AQArgs::GenericArgBuilder {
+
+ /**
+ * This operation adds Transport Credentials CSIv1 protocol
+ * version capability.
+ * @param support If false, the associated transports will
+ * always be expected to carry CSIv2 information.
+ * Default is true.
+ * For CSIv2 capability without the ability to
+ * use these credentials for CSIv1 transports, this
+ * argument must be explicitly stated with a value
+ * of false.
+ */
+ void addSupportCSIv1(
+ in boolean support
+ );
+
+ /**
+ * This operation adds Transport Credentials CSIv2 protocol
+ * version capability.
+ * @param support If false, the associated transports will
+ * not, or be expected to carry CSIv2 information.
+ * If true, they must, if CSIv1 support is false.
+ * It's default value is false.
+ */
+ void addSupportCSIv2(
+ in boolean support
+ );
+
+ /**
+ * This operation adds Transport Credentials Initiator Options to
+ * the acquisition argument. This argument is only relevant when
+ * the Credentials Usage include Initiate.
+ *
+ * @param bind This argument contains the interface to which to bind.
+ * An empty string signifies to use the operating system
+ * default.
+ * @param low_port If this argument is 0, the system select the port.
+ * If this argument is not 0, then connections
+ * will attempt to bind to this port or higher.
+ * @param high_port If low_port is not 0, and this argument is greater
+ * than or equal to low_port, then the lowest
+ * available port within the range will be selected.
+ * @param timeout Timeout (in milliseconds) for connection establishment.
+ * The value 0 indicates an indefinite wait.
+ */
+ void addTCPIPInitiatorOptions(
+ in string bind, // Interface to bind the socket to.
+ // If empty, then system selects
+ in long low_port, // If 0 system selects
+ in long high_port, // Only if low_port != 0, high port >=low_port
+ // If equal, it binds to that port.
+ // If greater, it will try for ports within
+ // the range.
+ in long timeout // default timeout for connections.
+ );
+
+ /**
+ * This operation adds Transport Credentials Acceptor Options to
+ * the acquisition argument. This argument is only relevant when
+ * the Credentials Usage include Accept.
+ *
+ * @param hosts This operation contains a list of "hosts", or
+ * addresses that should be placed in the IOR of
+ * objects associated with these credentials.
+ * @param bind This argument contains the interface to which to
+ * bind. An empty string signifies to use the
+ * operating system default.
+ * @param low_port If this argument is 0, the system select the port.
+ * If this argument is not 0, then connections
+ * will attempt to bind to this port or higher.
+ * @param high_port If low_port is not 0, and this argument is greater
+ * than or equal to low_port, then the lowest
+ * available port within the range will be selected.
+ * @param backlog Socket Listening Backlog. 0 means use operating
+ * system default.
+ * @param numeric If this argument is true, all addresses associated
+ * with these credentials that are placed in IORs
+ * will be in numeric form.
+ */
+ void addTCPIPAcceptorOptions(
+ in CORBA::StringSeq hosts, // If empty, system select
+ in string bind, // if not empty, must be one of hosts.
+ in long low_port, // 0 means system select
+ in long high_port, // Only if low_port != 0;
+ in long backlog, // socket parameter
+ in boolean numeric // use numeric addresses inIORs?
+ );
+ };
+
+ /**
+ * This interface is used to create the TCPIP Argument Builder
+ */
+ local interface ArgumentFactory : SL3AQArgs::ArgumentFactory {
+
+ /**
+ * This operation creates a TCPIP Transport Security
+ * Credentials Acquisition Argument Builder.
+ */
+ TCPIPArgBuilder createTCPIPArgBuilder(
+ in TransportSecurity::CredentialsUsage usage
+ );
+
+ /**
+ * This operation creates a TaggedArgument containing
+ * the following information for acquiring transport
+ * credentials with CSIv1 capability turned off or on.
+ *
+ * @param support. If false, call GIOP requests traveling
+ * over these transports is expected to
+ * carry CSIv2 information.
+ */
+ SL3AQArgs::Argument createSupportCSIv1(
+ in boolean support
+ );
+
+ /**
+ * This operation creates a TaggedArgument containing
+ * the following information for acquiring transport
+ * credentials with CSIv2 capability turned off or on.
+ *
+ * @param support. If false, call GIOP requests traveling
+ * over these transports will not and is
+ * not expected to carry CSIv2 information.
+ */
+ SL3AQArgs::Argument createSupportCSIv2(
+ in boolean support
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * the following information for acquiring TCPIP credentials.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the TCPIPArgBuilder.
+ *
+ * @see TCPIPArgBuilder
+ */
+ SL3AQArgs::Argument createTCPIPInitiatorOptions(
+ in string bind, // Interface to bind the socket to.
+ // If empty, then system selects
+ in long low_port, // If 0 system selects
+ in long high_port, // Only if low_port != 0, high port >=low_port
+ // If equal, it binds to that port.
+ // If greater, it will try for ports within
+ // the range.
+ in long timeout // default timeout for connections.
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * the following information for acquiring TCPIP credentials.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the TCPIPArgBuilder.
+ *
+ * @see TCPIPArgBuilder
+ */
+ SL3AQArgs::Argument createTCPIPAcceptorOptions(
+ in CORBA::StringSeq hosts, // If empty, system select
+ in string bind, // if not empty, must be one of hosts.
+ in long low_port, // 0 means system select
+ in long high_port, // Only if low_port != 0;
+ in long backlog, // socket parameter
+ in boolean numeric // use numeric addresses inIORs?
+ );
+ };
+};
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/SL3TLS.idl b/TAO/orbsvcs/orbsvcs/SL3TLS.idl
new file mode 100644
index 00000000000..c5701351e11
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SL3TLS.idl
@@ -0,0 +1,350 @@
+//tabstop=4
+//***********************************************************************
+// ORBAsec SL3
+// ----------------------------------------------------------------------
+// Copyright (C) 2001 Adiron, LLC.
+// All rights reserved.
+// ----------------------------------------------------------------------
+// $Id$
+//***********************************************************************
+#ifndef _SL3TLS_IDL_
+#define _SL3TLS_IDL_
+#include <orb.idl>
+#include <SL3/SecurityLevel3.idl>
+#include <SL3/TransportSecurity.idl>
+#include <SL3/SL3AQArgs.idl>
+#include <SL3/SL3TCPIP.idl>
+
+#pragma prefix "adiron.com"
+
+module SL3TLS {
+ const TransportSecurity::MechanismId MID_TLS = "TLS";
+
+ /**
+ * This is the only acquisition mechanism for acquiring TLS
+ * Transport Credentials.
+ */
+ const TransportSecurity::AcquisitionMethod AQM_TLSArgs = "TLSArgs";
+
+ /**
+ * Implementers may create their own local version of
+ * this interface to verify chains of X509 Certificates.
+ */
+ local interface TLSX509IdentityVerifier {
+
+ /**
+ * This operation is called by the security service at the
+ * TLS Transport Credentials creation phase to add certificates
+ * as trusted entities directed by other TLS options.
+ */
+ void add_trusted_authority(
+ in SecurityLevel3::X509IdentityStatement auth
+ );
+
+ /**
+ * This operation is called by the security service to determine
+ * if the peer is allowed to be anonymous. This means that the
+ * peer has not delivered a certificate and did not authenticate
+ * itself.
+ */
+ boolean is_anonymous_allowed();
+
+ /**
+ * This operation is called by the security service at the
+ * transport authentication phase, when the peer certificate
+ * needs to be verified. The X509IdentityStatement will contain
+ * a sequence of encoded X509 Certificates, which may be empty.
+ */
+ boolean verify(
+ in SecurityLevel3::X509IdentityStatement ident
+ );
+ };
+
+ /**
+ * The TLS KeyStore Acquisition Builder extends the TCPIP
+ * Builder. This is because the same TCPIP Acquisition Arguments
+ * apply to TLS, as TCPIP sits underneath TLS.
+ */
+ local interface TLSKeyStoreArgBuilder : SL3TCPIP::TCPIPArgBuilder {
+
+ /**
+ * This operation adds a X509 Certificate Chain Identity Verifier
+ * argument to the acquisition arguments.
+ *
+ * @param verifier The locally defined interface that will verify
+ * the certificate chain.
+ */
+ void addTLSX509IdentityVerifier(
+ in TLSX509IdentityVerifier verifier
+ );
+
+ /**
+ * This operation is used when there is a password on
+ * the keystore.
+ *
+ * @param keystore This argument contains the URL of the
+ * keystore.
+ * @param storetype This argument contains the type of the
+ * keystore. Currently, one of "IAIKKeyStore"
+ * or "jks".
+ * @param storepass This is the password that protects the
+ * key store.
+ * @param keyalias This argument contains the alias of a private
+ * key in the keystore. If this argument is
+ * an empty string, then the credentials will
+ * be considered anonymous.
+ * @param keypass This argument contains the password that
+ * unlocks the private key named by the keyalias.
+ * @param trusted_cert_names
+ * This argument contains the alias of certificates
+ * in the key store that are considered trusted
+ * to verify certificates of the peer during
+ * authentication. A empty string sequence signifies
+ * that the default chain verifier will accept
+ * chains ending in any trusted certificate
+ * entry found in the keystore.
+ * <p>
+ * Note: On the default TLSX509IdentityVerifier, anonymous
+ * communication is always allowed.
+ */
+ void addTLSKeyStoreWithStorePass(
+ in string keystore,
+ in string storetype,
+ in string storepass,
+ in string keyalias,
+ in string keypass,
+ in CORBA::StringSeq trusted_cert_names
+ );
+
+ /**
+ * This operation is used when there is no password on
+ * the keystore. This approach should only be used in
+ * cases where the integrity of the keystore is not an issue.
+ *
+ * @param keystore This argument contains the URL of the
+ * keystore.
+ * @param storetype This argument contains the type of the
+ * keystore. Currently, one of "IAIKKeyStore"
+ * or "jks".
+ * @param keyalias This argument contains the alias of a private
+ * key in the keystore. If this argument is
+ * an empty string, then the credentials will
+ * be considered anonymous.
+ * @param keypass This argument contains the password that
+ * unlocks the private key named by the keyalias.
+ * @param trusted_cert_names
+ * This argument contains the alias of certificates
+ * in the key store that are considered trusted
+ * to verify certificates of the peer during
+ * authentication. A empty string sequence signifies
+ * that the default chain verifier will accept
+ * chains ending in any trusted certificate
+ * entry found in the keystore.
+ * <p>
+ * Note: On the default TLSX509IdentityVerifier, anonymous
+ * communication is always allowed.
+ */
+ void addTLSKeyStoreNoStorePass(
+ in string keystore,
+ in string storetype,
+ in string keyalias,
+ in string keypass,
+ in CORBA::StringSeq trusted_cert_names
+ );
+
+ /**
+ * This operation is used when there is a password on
+ * the keystore.
+ *
+ * @param keystore This argument contains the octet
+ * sequence containing the keystore.
+ * @param storetype This argument contains the type of the
+ * keystore. Currently, one of "IAIKKeyStore"
+ * or "jks".
+ * @param storepass This is the password that protects the
+ * key store.
+ * @param keyalias This argument contains the alias of a private
+ * key in the keystore. If this argument is
+ * an empty string, then the credentials will
+ * be considered anonymous.
+ * @param keypass This argument contains the password that
+ * unlocks the private key named by the keyalias.
+ * @param trusted_cert_names
+ * This argument contains the alias of certificates
+ * in the key store that are considered trusted
+ * to verify certificates of the peer during
+ * authentication. A empty string sequence signifies
+ * that the default chain verifier will accept
+ * chains ending in any trusted certificate
+ * entry found in the keystore.
+ * <p>
+ * Note: On the default TLSX509IdentityVerifier, anonymous
+ * communication is always allowed.
+ */
+ void addTLSEncodedKeyStoreWithStorePass(
+ in CORBA::OctetSeq keystore,
+ in string storetype,
+ in string storepass,
+ in string keyalias,
+ in string keypass,
+ in CORBA::StringSeq trusted_cert_names
+ );
+
+ /**
+ * This operation is used when there is no password on
+ * the keystore. This approach should only be used in
+ * cases where the integrity of the keystore is not an issue.
+ *
+ * @param keystore This argument contains the octet
+ * sequence containing the keystore.
+ * @param storetype This argument contains the type of the
+ * keystore. Currently, one of "IAIKKeyStore"
+ * or "jks".
+ * @param keyalias This argument contains the alias of a private
+ * key in the keystore. If this argument is
+ * an empty string, then the credentials will
+ * be considered anonymous.
+ * @param keypass This argument contains the password that
+ * unlocks the private key named by the keyalias.
+ * @param trusted_cert_names
+ * This argument contains the alias of certificates
+ * in the key store that are considered trusted
+ * to verify certificates of the peer during
+ * authentication. A empty string sequence signifies
+ * that the default chain verifier will accept
+ * chains ending in any trusted certificate
+ * entry found in the keystore.
+ * <p>
+ * Note: On the default TLSX509IdentityVerifier, anonymous
+ * communication is always allowed.
+ */
+ void addTLSEncodedKeyStoreNoStorePass(
+ in CORBA::OctetSeq keystore,
+ in string storetype,
+ in string keyalias,
+ in string keypass,
+ in CORBA::StringSeq trusted_cert_names
+ );
+ };
+
+ /**
+ * This acquisition mechanism specifies getting TLS credential
+ * information from a Java KeyStore file. The Argument Factory
+ * and Builder inherit the TCPIP.
+ * The arguments used in TCPIP apply
+ * in setting up TCPIP sockets, because TCPIP lies
+ * below SSL/TLS.
+ * <p>
+ * If the TCPIPInitiatorOptions and/or TCPIPAcceptorOptions
+ * arguments are present, then they are followed, otherwise
+ * defaults for TCPIP are used.
+ * <p>
+ * The Arguments should have one of
+ * TLSKeyStoreWithStorePass or TLSKeyStoreNoStorePass. If
+ * neither of them is specified, the resulting Credentials will
+ * run in TLS anonymously.
+ *
+ */
+ const TransportSecurity::AcquisitionMethod
+ AQM_TLSKeyStoreArgs = "TLSKeyStoreArgs";
+
+ /**
+ * This object allows to create the Builder for use with TLS
+ * and a Java KeyStore.
+ */
+ local interface ArgumentFactory : SL3TCPIP::ArgumentFactory {
+
+ /**
+ * This operation creates a TLS KeyStore Arg Builder
+ * object.
+ */
+ TLSKeyStoreArgBuilder createTLSKeyStoreArgBuilder(
+ in TransportSecurity::CredentialsUsage usage
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * a reference to a X509 Certificate Chain Verifier
+ */
+ SL3AQArgs::Argument createTLSX509IdentityVerifier(
+ in TLSX509IdentityVerifier verifier
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * the following information for acquiring credentials
+ * from a Java KeyStore that is protected with a password.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the TLSKeyStoreArgBuilder.
+ *
+ * @see TLSKeyStoreArgBuilder
+ */
+ SL3AQArgs::Argument createTLSKeyStoreWithStorePass(
+ in string keystore,
+ in string storetype,
+ in string storepass,
+ in string keyalias,
+ in string keypass,
+ in CORBA::StringSeq trusted_cert_names
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * the following information for acquiring credentials
+ * from a Java KeyStore that may be protected with a password.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the TLSKeyStoreArgBuilder.
+ *
+ * @see TLSKeyStoreArgBuilder
+ */
+ SL3AQArgs::Argument createTLSKeyStoreNoStorePass(
+ in string keystore,
+ in string storetype,
+ in string keyalias,
+ in string keypass,
+ in CORBA::StringSeq trusted_cert_names
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * the following information for acquiring credentials
+ * from a Java KeyStore that is protected with a password.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the TLSKeyStoreArgBuilder.
+ *
+ * @see TLSKeyStoreArgBuilder
+ */
+ SL3AQArgs::Argument createTLSEncodedKeyStoreWithStorePass(
+ in CORBA::OctetSeq keystore,
+ in string storetype,
+ in string storepass,
+ in string keyalias,
+ in string keypass,
+ in CORBA::StringSeq trusted_cert_names
+ );
+
+ /**
+ * This operation creates a Tagged Argument containing
+ * the following information for acquiring credentials
+ * from a Java KeyStore that may be protected with a password.
+ * <p>
+ * For a description of the arguments, please see the
+ * corresponding operation in the TLSKeyStoreArgBuilder.
+ *
+ * @see TLSKeyStoreArgBuilder
+ */
+ SL3AQArgs::Argument createTLSEncodedKeyStoreNoStorePass(
+ in CORBA::OctetSeq keystore,
+ in string storetype,
+ in string keyalias,
+ in string keypass,
+ in CORBA::StringSeq trusted_cert_names
+ );
+
+ };
+
+};
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP.idl b/TAO/orbsvcs/orbsvcs/SSLIOP.idl
new file mode 100644
index 00000000000..ba4f9c406b6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP.idl
@@ -0,0 +1,98 @@
+// -*- IDL -*-
+//
+// $Id$
+
+// File: SSLIOP.idl
+// Part of the Security Service with additions from the Firewall
+// specification.
+
+#ifndef _SSLIOP_IDL
+#define _SSLIOP_IDL
+
+#include "tao/IOP.pidl"
+#include "Security.idl"
+// #include <Firewall.idl>
+
+#pragma prefix "omg.org"
+
+module SSLIOP {
+
+ /// Security mechanism SSL
+ const IOP::ComponentId TAG_SSL_SEC_TRANS = 20;
+
+ struct SSL {
+ Security::AssociationOptions target_supports;
+ Security::AssociationOptions target_requires;
+ unsigned short port;
+ };
+
+ // const Firewall::IdTag TAG_ID_SSL_CERT = xx; // OMG allocated
+
+ /// A DER encoded X.509 certificate.
+ typedef sequence<octet> ASN_1_Cert;
+
+ /// A chain of DER encoded X.509 certificates. The chain is actually
+ /// a sequence, according CORBA CDR encapsulation rules.
+ /// The sender's certificate is first, followed by any Certificate
+ /// Authority certificates proceeding sequentially upward.
+ typedef sequence<ASN_1_Cert> SSL_Cert;
+
+ /// The following are TAO extensions.
+# pragma prefix "ssliop.tao"
+ /// The SSLIOP::Current interface provides methods to gain access to
+ /// the SSL session state for the current execution context.
+ local interface Current : CORBA::Current {
+
+
+ /// Exception that indicates a SSLIOP::Current operation was
+ /// invoked outside of an SSL session.
+ exception NoContext {};
+
+ /// Return the peer certificate associated with the current
+ /// request.
+ ASN_1_Cert get_peer_certificate () raises (NoContext);
+
+ /// Return the certificate chain associated with the current
+ /// execution context. If no SSL session is being used for the
+ /// request or upcall, then the NoContext exception is raised.
+ /**
+ * On the client side, the chain does include the peer (server)
+ * certficate. However, the certificate chain on the server side
+ * does NOT contain the peer (client) certificate.
+ */
+ SSL_Cert get_peer_certificate_chain () raises (NoContext);
+
+ /// Returns true if the current execution context is not within a
+ /// SSL session. This method is mostly useful as an inexpensive
+ /// means of determining whether or not SSL session state is
+ /// available.
+ boolean no_context ();
+ };
+
+ enum FileType {
+ ASN1,
+ PEM
+ };
+
+ struct File {
+ FileType type;
+ string filename;
+ string password; // Only needed for encrypted PEM files.
+ };
+
+ /// The AuthData structure is the SSLIOP-specific authentication
+ /// data that will be passed to the
+ /// SecurityLevel2::PrincipalAuthenticator::authenticate() method.
+ /// Note that this TAO-specific.
+ struct AuthData {
+ File certificate;
+ File key;
+ };
+
+# pragma prefix "omg.org"
+
+};
+
+#pragma prefix ""
+
+#endif /* _SSLIOP_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP.mpc b/TAO/orbsvcs/orbsvcs/SSLIOP.mpc
new file mode 100644
index 00000000000..4485f068c26
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP.mpc
@@ -0,0 +1,29 @@
+// -*- MPC -*-
+//
+// $Id$
+
+project(SSLIOP) : orbsvcslib, core, security, ssl, pi_server, interceptors, tao_versioning_idl_defaults {
+ sharedname = TAO_SSLIOP
+ idlflags += -Wb,export_macro=TAO_SSLIOP_Export -Wb,export_include=orbsvcs/SSLIOP/SSLIOP_Export.h -SS
+ dynamicflags = TAO_SSLIOP_BUILD_DLL
+ tagchecks += SSLIOP
+ pch_header =
+ pch_source =
+
+ IDL_Files {
+ SSLIOP.idl
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ SSLIOP {
+ SSLIOP
+ }
+ }
+
+ IDL_Files {
+ idlflags += -Sci -Gp -Gd -Ge 1 -Sc -Sa -Sorb \
+ -o SSLIOP
+ idlflags -= -St
+ SSLIOP/ssl_endpoints.pidl
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP.rc b/TAO/orbsvcs/orbsvcs/SSLIOP.rc
new file mode 100644
index 00000000000..861b6bf944a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "SSLIOP\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_SSLIOPDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_SSLIOP.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.cpp
new file mode 100644
index 00000000000..89bea659c76
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.cpp
@@ -0,0 +1,39 @@
+#include "orbsvcs/SSLIOP/IIOP_SSL_Acceptor.h"
+
+#include "tao/ORB_Core.h"
+#include "tao/debug.h"
+
+
+ACE_RCSID (SSLIOP,
+ IIOP_SSL_Acceptor,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::IIOP_SSL_Acceptor::IIOP_SSL_Acceptor (CORBA::Boolean flag)
+ : TAO_IIOP_Acceptor (flag),
+ base_acceptor_ (),
+ creation_strategy_ (0),
+ concurrency_strategy_ (0),
+ accept_strategy_ (0)
+{
+}
+
+TAO::IIOP_SSL_Acceptor::~IIOP_SSL_Acceptor (void)
+{
+ // Make sure we are closed before we start destroying the
+ // strategies.
+ this->close ();
+
+ delete this->creation_strategy_;
+ delete this->concurrency_strategy_;
+ delete this->accept_strategy_;
+}
+
+int
+TAO::IIOP_SSL_Acceptor::close (void)
+{
+ return this->base_acceptor_.close ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.h b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.h
new file mode 100644
index 00000000000..951e2ab73be
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.h
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file IIOP_SSL_Acceptor.h
+ *
+ * $Id$
+ *
+ * SSL-aware IIOP specific acceptor processing
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_IIOP_SSL_ACCEPTOR_H
+#define TAO_IIOP_SSL_ACCEPTOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/IIOP_Acceptor.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+
+ /**
+ * @class IIOP_SSL_Acceptor
+ *
+ * @brief An SSL aware IIOP acceptor.
+ *
+ * The class differs from the non-SSL aware TAO_IIOP_Acceptor class
+ * since it uses a different a set of Acceptor strategies. In
+ * particular, it overrides the open_i() method to use the Acceptor
+ * strategies tailored to use the SSL aware server connection handler.
+ * See the TAO_IIOP_SSL_Connection_Handler notes for details.
+ */
+ class IIOP_SSL_Acceptor : public TAO_IIOP_Acceptor
+ {
+ public:
+
+ typedef ACE_Strategy_Acceptor<IIOP_SSL_Connection_Handler, ACE_SOCK_ACCEPTOR> TAO_IIOP_SSL_BASE_ACCEPTOR;
+ typedef TAO_Creation_Strategy<IIOP_SSL_Connection_Handler> TAO_IIOP_SSL_CREATION_STRATEGY;
+ typedef TAO_Concurrency_Strategy<IIOP_SSL_Connection_Handler> TAO_IIOP_SSL_CONCURRENCY_STRATEGY;
+ typedef TAO_Accept_Strategy<IIOP_SSL_Connection_Handler, ACE_SOCK_ACCEPTOR> TAO_IIOP_SSL_ACCEPT_STRATEGY;
+
+ /// Constructor.
+ IIOP_SSL_Acceptor (CORBA::Boolean flag = 0);
+
+ /// Destructor.
+ ~IIOP_SSL_Acceptor (void);
+
+ virtual int close (void);
+
+ private:
+
+ /// The concrete acceptor, as a pointer to it's base class.
+ TAO_IIOP_SSL_BASE_ACCEPTOR base_acceptor_;
+
+ /**
+ * @name Acceptor Strategies
+ *
+ * Server side creation, concurrency and accept strategies.
+ */
+ //@{
+ TAO_IIOP_SSL_CREATION_STRATEGY *creation_strategy_;
+ TAO_IIOP_SSL_CONCURRENCY_STRATEGY *concurrency_strategy_;
+ TAO_IIOP_SSL_ACCEPT_STRATEGY *accept_strategy_;
+ //@}
+
+ };
+
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_IIOP_SSL_ACCEPTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.cpp
new file mode 100644
index 00000000000..fb9a61ba32b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.cpp
@@ -0,0 +1,90 @@
+#include "orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.h"
+#include "orbsvcs/SSLIOP/IIOP_SSL_Transport.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h"
+#include "tao/Timeprobe.h"
+#include "tao/ORB_Core.h"
+#include "tao/ORB.h"
+#include "tao/debug.h"
+
+
+ACE_RCSID (SSLIOP,
+ IIOP_SSL_Connection_Handler,
+ "$Id$")
+
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_ENABLE_TIMEPROBES)
+
+static const char * const TAO_IIOP_SSL_Connect_Timeprobe_Description[] =
+{
+ "IIOP_SSL_Connection_Handler::handle_input - start",
+ "IIOP_SSL_Connection_Handler::handle_input - end",
+
+ "IIOP_SSL_Connection_Handler::handle_locate - start",
+ "IIOP_SSL_Connection_Handler::handle_locate - end",
+
+ "IIOP_SSL_Connection_Handler::receive_request - end",
+
+ "IIOP_SSL_Connection_Handler::send_request - start",
+ "IIOP_SSL_Connection_Handler::send_request - end"};
+
+enum
+{
+ // Timeprobe description table start key
+ TAO_IIOP_SSL_CONNECTION_HANDLER_HANDLE_INPUT_START = 320,
+ TAO_IIOP_SSL_CONNECTION_HANDLER_HANDLE_INPUT_END,
+
+ TAO_IIOP_SSL_CONNECTION_HANDLER_HANDLE_LOCATE_START,
+ TAO_IIOP_SSL_CONNECTION_HANDLER_HANDLE_LOCATE_END,
+
+ TAO_IIOP_SSL_CONNECTION_HANDLER_RECEIVE_REQUEST_END
+
+};
+
+// Setup Timeprobes
+ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_IIOP_SSL_Connect_Timeprobe_Description,
+ TAO_IIOP_SSL_CONNECTION_HANDLER_HANDLE_INPUT_START);
+
+#endif /* ACE_ENABLE_TIMEPROBES */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::IIOP_SSL_Connection_Handler::IIOP_SSL_Connection_Handler (
+ ACE_Thread_Manager *t)
+ : TAO_IIOP_Connection_Handler (t)
+{
+ // This constructor should *never* get called, it is just here to
+ // make the compiler happy: the default implementation of the
+ // Creation_Strategy requires a constructor with that signature, we
+ // don't use that implementation, but some (most?) compilers
+ // instantiate it anyway.
+ ACE_ASSERT (0);
+}
+
+
+TAO::IIOP_SSL_Connection_Handler::IIOP_SSL_Connection_Handler (
+ TAO_ORB_Core *orb_core,
+ CORBA::Boolean /* flag */)
+ : TAO_IIOP_Connection_Handler (orb_core, 0)
+{
+ // Delete the transport with TAO_IIOP_Connection_Handler.
+ delete this->transport ();
+
+ IIOP_SSL_Transport* specific_transport = 0;
+ ACE_NEW (specific_transport,
+ IIOP_SSL_Transport (this,
+ orb_core,
+ 0));
+
+ // store this pointer
+ this->transport (specific_transport);
+}
+
+TAO::IIOP_SSL_Connection_Handler::~IIOP_SSL_Connection_Handler (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.h b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.h
new file mode 100644
index 00000000000..3c81122ede9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.h
@@ -0,0 +1,122 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file IIOP_SSL_Connection_Handler.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_IIOP_SSL_CONNECTION_HANDLER_H
+#define TAO_IIOP_SSL_CONNECTION_HANDLER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/SSLIOP/SSLIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SSLIOP/SSLIOP_Current.h"
+
+#include "orbsvcs/SSLIOPC.h"
+#include "tao/IIOP_Connection_Handler.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+
+ /**
+ * @class IIOP_SSL_Connection_Handler
+ *
+ * @brief
+ * IIOP connection handler designed to be "SSL aware," i.e. it is
+ * aware of the existence of the SSLIOP connection handler. It
+ * makes sure that SSL session state from a previous connection is
+ * not associated with the non-SSL connection handled by this
+ * handler.
+ *
+ * This class is just a place holder to create the
+ * TAO_IIOP_SSL_Transport which does the work of clearing the TSS
+ * SSL state.
+ */
+ class IIOP_SSL_Connection_Handler : public TAO_IIOP_Connection_Handler
+ {
+ public:
+
+ /// Constructor.
+ IIOP_SSL_Connection_Handler (ACE_Thread_Manager* t = 0);
+ IIOP_SSL_Connection_Handler (TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag);
+
+ /// Destructor.
+ ~IIOP_SSL_Connection_Handler (void);
+
+ };
+
+ // ****************************************************************
+
+ /**
+ * @class Null_SSL_State_Guard
+ *
+ * @brief
+ * This class sets up null TSS SSL state upon instantiation, and
+ * restores the previous TSS SSL state when that instance goes out
+ * of scope.
+ *
+ * This guard is used to make TSS SSL state configuration and
+ * deconfiguration during an upcall exception safe. Exceptions are
+ * not supposed to be propagated up to the scope this guard is used
+ * in, so this guard may be unnecessary. However, since proper TSS
+ * SSL state configuration/deconfiguration is critical to proper
+ * security support, this guard is used to ensure that
+ * configuration/deconfiguration is exception safe.
+ */
+ class Null_SSL_State_Guard
+ {
+ public:
+
+ /// Constructor that sets up the null TSS SSL state.
+ Null_SSL_State_Guard (TAO::SSLIOP::Current_ptr current,
+ int &result);
+
+ /// Destructor that restores the previous TSS SSL state.
+ ~Null_SSL_State_Guard (void);
+
+ private:
+
+ /// The SSLIOP::Current implementation that was previously
+ /// associated with the current thread and invocation.
+ /**
+ * It is stored here until the invocation completes, after which
+ * it placed back into TSS.
+ */
+ TAO::SSLIOP::Current_Impl *previous_current_impl_;
+
+ /// Reference to the SSLIOP::Current object.
+ TAO::SSLIOP::Current_ptr current_;
+
+ /// Flag that specifies whether or not setup of the SSLIOP::Current
+ /// object completed for the current thread and invocation.
+ bool setup_done_;
+
+ };
+
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.inl"
+#endif /* __ACE_INLINE__ */
+
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_IIOP_SSL_CONNECTION_HANDLER_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.inl b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.inl
new file mode 100644
index 00000000000..7a0b3d4b320
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.inl
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO::Null_SSL_State_Guard::Null_SSL_State_Guard (
+ TAO::SSLIOP::Current_ptr current,
+ int &result)
+ : previous_current_impl_ (0),
+ current_ (current), // No need to duplicate
+ setup_done_ (false)
+{
+ // Invalidate the TSS SSL session state to make sure that SSL state
+ // from a previous SSL connection is not confused with this non-SSL
+ // connection.
+ current->setup (this->previous_current_impl_,
+ 0, // Null SSL state
+ this->setup_done_);
+
+ result = 0;
+}
+
+ACE_INLINE
+TAO::Null_SSL_State_Guard::~Null_SSL_State_Guard (void)
+{
+ // Restore the previous TSS SSL state.
+ this->current_->teardown (this->previous_current_impl_,
+ this->setup_done_);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.cpp
new file mode 100644
index 00000000000..51a3db9a486
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.cpp
@@ -0,0 +1,288 @@
+#include "orbsvcs/SSLIOP/IIOP_SSL_Connector.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+#include "tao/Environment.h"
+#include "tao/IIOP_Endpoint.h"
+#include "tao/Transport_Cache_Manager.h"
+#include "tao/Thread_Lane_Resources.h"
+#include "tao/Connect_Strategy.h"
+#include "tao/Wait_Strategy.h"
+#include "tao/Profile_Transport_Resolver.h"
+#include "tao/Transport.h"
+
+#include "ace/Strategies_T.h"
+
+
+ACE_RCSID (SSLIOP,
+ IIOP_SSL_Connector,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::IIOP_SSL_Connector::IIOP_SSL_Connector (CORBA::Boolean flag)
+ : TAO_IIOP_Connector (flag),
+ connect_strategy_ (),
+ base_connector_ ()
+{
+}
+
+TAO::IIOP_SSL_Connector::~IIOP_SSL_Connector (void)
+{
+}
+
+int
+TAO::IIOP_SSL_Connector::open (TAO_ORB_Core *orb_core)
+{
+ this->orb_core (orb_core);
+
+ // Create our connect strategy
+ if (this->create_connect_strategy () == -1)
+ return -1;
+
+ // Our connect creation strategy
+ CONNECT_CREATION_STRATEGY *connect_creation_strategy = 0;
+
+ ACE_NEW_RETURN (connect_creation_strategy,
+ CONNECT_CREATION_STRATEGY (orb_core->thr_mgr (),
+ orb_core,
+ this->lite_flag_),
+ -1);
+
+ // Our activation strategy
+ CONNECT_CONCURRENCY_STRATEGY *concurrency_strategy = 0;
+
+ ACE_NEW_RETURN (concurrency_strategy,
+ CONNECT_CONCURRENCY_STRATEGY (orb_core),
+ -1);
+
+
+ return this->base_connector_.open (this->orb_core ()->reactor (),
+ connect_creation_strategy,
+ &this->connect_strategy_,
+ concurrency_strategy);
+}
+
+int
+TAO::IIOP_SSL_Connector::close (void)
+{
+ delete this->base_connector_.creation_strategy ();
+ delete this->base_connector_.concurrency_strategy ();
+ return this->base_connector_.close ();
+}
+
+int
+TAO::IIOP_SSL_Connector::set_validate_endpoint (TAO_Endpoint *endpoint)
+{
+ if (endpoint->tag () != IOP::TAG_INTERNET_IOP)
+ return -1;
+
+ TAO_IIOP_Endpoint *iiop_endpoint =
+ dynamic_cast<TAO_IIOP_Endpoint *> (endpoint);
+
+ if (iiop_endpoint == 0)
+ return -1;
+
+ const ACE_INET_Addr &remote_address =
+ iiop_endpoint->object_addr ();
+
+ // Verify that the remote ACE_INET_Addr was initialized properly.
+ // Failure can occur if hostname lookup failed when initializing the
+ // remote ACE_INET_Addr.
+ if (remote_address.get_type () != AF_INET)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) IIOP_SSL connection failed.\n")
+ ACE_TEXT ("TAO (%P|%t) This is most likely ")
+ ACE_TEXT ("due to a hostname lookup ")
+ ACE_TEXT ("failure.\n")));
+ }
+
+ return -1;
+ }
+
+ return 0;
+}
+
+TAO_Transport *
+TAO::IIOP_SSL_Connector::make_connection (
+ TAO::Profile_Transport_Resolver *r,
+ TAO_Transport_Descriptor_Interface &desc,
+ ACE_Time_Value *max_wait_time)
+{
+ TAO_IIOP_Endpoint *iiop_endpoint =
+ dynamic_cast<TAO_IIOP_Endpoint *> (desc.endpoint ());
+
+ if (iiop_endpoint == 0)
+ return 0;
+
+ const ACE_INET_Addr &remote_address =
+ iiop_endpoint->object_addr ();
+
+ if (TAO_debug_level > 4)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) IIOP_SSL_Connector::connect ")
+ ACE_TEXT ("making a new connection \n")));
+
+ // Get the right synch options
+ ACE_Synch_Options synch_options;
+
+ this->active_connect_strategy_->synch_options (max_wait_time,
+ synch_options);
+
+ // If we don't need to block for a transport just set the timeout to
+ // be zero.
+ ACE_Time_Value tmp_zero (ACE_Time_Value::zero);
+ if (!r->blocked_connect ())
+ {
+ synch_options.timeout (ACE_Time_Value::zero);
+ max_wait_time = &tmp_zero;
+ }
+
+
+ IIOP_SSL_Connection_Handler *svc_handler = 0;
+
+ // Connect.
+ int result =
+ this->base_connector_.connect (svc_handler,
+ remote_address,
+ synch_options);
+
+ // The connect() method creates the service handler and bumps the
+ // #REFCOUNT# up one extra. There are three possibilities from
+ // calling connect(): (a) connection succeeds immediately - in this
+ // case, the #REFCOUNT# on the handler is two; (b) connection
+ // completion is pending - in this case, the #REFCOUNT# on the
+ // handler is also two; (c) connection fails immediately - in this
+ // case, the #REFCOUNT# on the handler is one since close() gets
+ // called on the handler.
+ //
+ // The extra reference count in
+ // TAO_Connect_Creation_Strategy::make_svc_handler() is needed in
+ // the case when connection completion is pending and we are going
+ // to wait on a variable in the handler to changes, signifying
+ // success or failure. Note, that this increment cannot be done
+ // once the connect() returns since this might be too late if
+ // another thread pick up the completion and potentially deletes the
+ // handler before we get a chance to increment the reference count.
+
+ // Make sure that we always do a remove_reference
+ ACE_Event_Handler_var svc_handler_auto_ptr (svc_handler);
+
+ TAO_Transport *transport =
+ svc_handler->transport ();
+
+ if (result == -1)
+ {
+ // No immediate result, wait for completion
+ if (errno == EWOULDBLOCK)
+ {
+ // Try to wait until connection completion. Incase we block, then we
+ // get a connected transport or not. In case of non block we get
+ // a connected or not connected transport
+ if (!this->wait_for_connection_completion (r,
+ transport,
+ max_wait_time))
+ {
+ if (TAO_debug_level > 2)
+ ACE_ERROR ((LM_ERROR, "TAO (%P|%t) - IIOP_SSL_Connector::"
+ "make_connection, "
+ "wait for completion failed\n"));
+ }
+ }
+ else
+ {
+ // Transport is not usable
+ transport = 0;
+ }
+ }
+
+ // In case of errors transport is zero
+ if (transport == 0)
+ {
+ // Give users a clue to the problem.
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "TAO (%P|%t) - IIOP_SSL_Connector::make_connection, "
+ "connection to <%s:%d> failed (%p)\n",
+ iiop_endpoint->host (), iiop_endpoint->port (),
+ "errno"));
+ }
+
+ return 0;
+ }
+
+ // At this point, the connection has be successfully connected.
+ // #REFCOUNT# is one.
+ if (TAO_debug_level > 2)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - IIOP_SSL_Connector::make_connection, "
+ "new connection to <%s:%d> on Transport[%d]\n",
+ iiop_endpoint->host (), iiop_endpoint->port (),
+ svc_handler->peer ().get_handle ()));
+
+ // Add the handler to Cache
+ int retval =
+ this->orb_core ()->lane_resources ().transport_cache ().cache_transport (
+ &desc,
+ transport);
+
+ // Failure in adding to cache.
+ if (retval != 0)
+ {
+ // Close the handler.
+ svc_handler->close ();
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "TAO (%P|%t) - IIOP_SSL_Connector::make_connection, "
+ "could not add the new connection to cache\n"));
+ }
+
+ return 0;
+ }
+
+ if (transport->is_connected () &&
+ transport->wait_strategy ()->register_handler () != 0)
+ {
+ // Registration failures.
+
+ // Purge from the connection cache, if we are not in the cache, this
+ // just does nothing.
+ (void) transport->purge_entry ();
+
+ // Close the handler.
+ (void) transport->close_connection ();
+
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "TAO (%P|%t) - IIOP_SSL_Connector [%d]::make_connection, "
+ "could not register the transport "
+ "in the reactor.\n",
+ transport->id ()));
+
+ return 0;
+ }
+
+ return transport;
+}
+
+int
+TAO::IIOP_SSL_Connector::cancel_svc_handler (
+ TAO_Connection_Handler * svc_handler)
+{
+ IIOP_SSL_Connection_Handler* handler=
+ dynamic_cast<IIOP_SSL_Connection_Handler*> (svc_handler);
+
+ if (handler)
+ // Cancel from the connector
+ return this->base_connector_.cancel (handler);
+
+ return -1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.h b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.h
new file mode 100644
index 00000000000..b051fa19cae
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.h
@@ -0,0 +1,104 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file IIOP_SSL_Connector.h
+ *
+ * $Id$
+ *
+ * IIOP specific connector processing -- SSL aware version
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_IIOP_SSL_CONNECTOR_H
+#define TAO_IIOP_SSL_CONNECTOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/IIOP_Connector.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ /**
+ * @class IIOP_SSL_Connector
+ *
+ * @brief IIOP-specific Connector (SSL aware) bridge for pluggable
+ * protocols.
+ *
+ * Concrete instance of the TAO_Connector class. Responsible
+ * for establishing a connection with a server and is called from the
+ * Connector_Registry.
+ */
+ class IIOP_SSL_Connector : public TAO_IIOP_Connector
+ {
+ public:
+
+ /// Constructor.
+ IIOP_SSL_Connector (CORBA::Boolean flag = 0);
+
+ /// Destructor.
+ ~IIOP_SSL_Connector (void);
+
+ int open (TAO_ORB_Core *orb_core);
+ int close (void);
+
+ public:
+
+ typedef TAO_Connect_Concurrency_Strategy<IIOP_SSL_Connection_Handler>
+ CONNECT_CONCURRENCY_STRATEGY;
+
+ typedef TAO_Connect_Creation_Strategy<IIOP_SSL_Connection_Handler>
+ CONNECT_CREATION_STRATEGY;
+
+ typedef ACE_Connect_Strategy<IIOP_SSL_Connection_Handler,
+ ACE_SOCK_CONNECTOR>
+ CONNECT_STRATEGY ;
+
+ typedef ACE_Strategy_Connector<IIOP_SSL_Connection_Handler,
+ ACE_SOCK_CONNECTOR>
+ BASE_CONNECTOR;
+
+ protected:
+
+ /**
+ * @name The TAO_Connector Methods
+ *
+ * Check the documentation in tao/Transport_Connector.h for details.
+ */
+ //@{
+ int set_validate_endpoint (TAO_Endpoint *ep);
+
+ TAO_Transport *make_connection (TAO::Profile_Transport_Resolver *r,
+ TAO_Transport_Descriptor_Interface &desc,
+ ACE_Time_Value *timeout = 0);
+
+ virtual int cancel_svc_handler (TAO_Connection_Handler * svc_handler);
+ //@}
+
+ private:
+
+ /// Our connect strategy
+ CONNECT_STRATEGY connect_strategy_;
+
+ /// The connector initiating connection requests for IIOP_SSL.
+ BASE_CONNECTOR base_connector_;
+ };
+
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_IIOP_SSL_CONNECTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.cpp
new file mode 100644
index 00000000000..1a5d1724a2e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.cpp
@@ -0,0 +1,54 @@
+#include "orbsvcs/SSLIOP/IIOP_SSL_Transport.h"
+#include "orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Util.h"
+
+#include "tao/ORB_Core.h"
+#include "tao/ORB.h"
+#include "tao/Timeprobe.h"
+#include "tao/debug.h"
+
+
+ACE_RCSID (SSLIOP,
+ IIOP_SSL_Transport,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::IIOP_SSL_Transport::IIOP_SSL_Transport (
+ IIOP_SSL_Connection_Handler *handler,
+ TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag)
+ : TAO_IIOP_Transport (handler,
+ orb_core,
+ flag)
+{
+ this->current_ =
+ TAO::SSLIOP::Util::current (orb_core);
+}
+
+TAO::IIOP_SSL_Transport::~IIOP_SSL_Transport (void)
+{
+}
+
+int
+TAO::IIOP_SSL_Transport::handle_input (TAO_Resume_Handle &rh,
+ ACE_Time_Value *max_wait_time,
+ int block)
+{
+ int result = 0;
+
+ // Invalidate the TSS SSL session state to make sure that SSL state
+ // from a previous SSL connection is not confused with this non-SSL
+ // connection.
+ TAO::Null_SSL_State_Guard guard (this->current_.in (), result);
+
+ if (result != 0)
+ return -1;
+
+ return
+ this->TAO_IIOP_Transport::handle_input (rh,
+ max_wait_time,
+ block);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.h b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.h
new file mode 100644
index 00000000000..a6c1aa7ea0f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.h
@@ -0,0 +1,90 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file IIOP_SSL_Transport.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_IIOP_SSL_TRANSPORT_H
+#define TAO_IIOP_SSL_TRANSPORT_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/SSLIOP/SSLIOP_Current.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/IIOP_Transport.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ORB_Core;
+class TAO_Resume_Handle;
+
+namespace TAO
+{
+ class IIOP_SSL_Connection_Handler;
+
+ /**
+ * @class IIOP_SSL_Transport
+ *
+ * @brief
+ * IIOP Transport designed to be "SSL aware," i.e. it is
+ * aware of the existence of the SSLIOP Transport. It makes
+ * sure that SSL session state from a previous connection is not
+ * associated with the non-SSL connection handled by this handler.
+ *
+ * However, this class overrides the handle_input() method to
+ * invalidate the current TSS SSL state during a standard IIOP
+ * (insecure) upcall. This prevents SSL session state from a
+ * previous SSL connection from being associated with non-SSL
+ * connections processed by this connection handler. In particular,
+ * this is very important for closing a security hole in nested
+ * upcalls. For example, an SSLIOP request is made. During that
+ * secure upcall, an insecure nested upcall is made. A naive
+ * implementation would associate the TSS SSL state from the secure
+ * upcall with the insecure upcall. This implementation closes that
+ * security hole.
+ */
+ class IIOP_SSL_Transport : public TAO_IIOP_Transport
+ {
+ public:
+ /// Constructor.
+ IIOP_SSL_Transport (IIOP_SSL_Connection_Handler *handler,
+ TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag = 0);
+
+ /// Default destructor.
+ ~IIOP_SSL_Transport (void);
+
+ /** @name Overridden Template Methods
+ *
+ * Please check the documentation in "tao/Transport.h" for more
+ * details.
+ */
+ virtual int handle_input (TAO_Resume_Handle &rh,
+ ACE_Time_Value *max_wait_time = 0,
+ int block = 0);
+
+ protected:
+
+ /// Reference to the TAO::SSLIOP::Current object.
+ TAO::SSLIOP::Current_var current_;
+
+ };
+
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_IIOP_SSL_TRANSPORT_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Accept_Strategy.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Accept_Strategy.cpp
new file mode 100644
index 00000000000..5de9b828787
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Accept_Strategy.cpp
@@ -0,0 +1,66 @@
+#include "orbsvcs/SSLIOP/SSLIOP_Accept_Strategy.h"
+
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_Accept_Strategy,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SSLIOP::Accept_Strategy::Accept_Strategy (
+ TAO_ORB_Core * orb_core,
+ const ACE_Time_Value & timeout)
+ : TAO_Accept_Strategy<TAO::SSLIOP::Connection_Handler,
+ ACE_SSL_SOCK_ACCEPTOR> (orb_core),
+ timeout_ (timeout)
+{
+}
+
+int
+TAO::SSLIOP::Accept_Strategy::accept_svc_handler (handler_type * svc_handler)
+{
+ ACE_TRACE ("TAO::SSLIOP::Accept_Strategy::accept_svc_handler");
+
+ // The following code is basically the same code found in
+ // ACE_Accept_Strategy::accept_svc_handler(). The only difference
+ // is that a timeout value is passed to the peer acceptor's accept()
+ // method. A timeout is necessary to prevent malicious or
+ // misbehaved clients from only completing the TCP handshake and not
+ // the SSL handshake. Without the timeout, a denial-of-service
+ // vulnerability would exist where multiple incomplete SSL passive
+ // connections (i.e. where only the TCP handshake is completed)
+ // could result in the server process running out of file
+ // descriptors. That would be due to the SSL handshaking process
+ // blocking/waiting for the handshake to complete.
+
+ // The timeout value will be modified. Make a copy.
+ ACE_Time_Value timeout (this->timeout_);
+
+ // Try to find out if the implementation of the reactor that we are
+ // using requires us to reset the event association for the newly
+ // created handle. This is because the newly created handle will
+ // inherit the properties of the listen handle, including its event
+ // associations.
+ const int reset_new_handle = this->reactor_->uses_event_associations ();
+
+ if (this->peer_acceptor_.accept (svc_handler->peer (), // stream
+ 0, // remote address
+ &timeout, // timeout
+ 1, // restart
+ reset_new_handle // reset new handler
+ ) == -1)
+ {
+ // Ensure that errno is preserved in case the svc_handler
+ // close() method resets it.
+ ACE_Errno_Guard error (errno);
+
+ // Close down handler to avoid memory leaks.
+ svc_handler->close (0);
+
+ return -1;
+ }
+ else
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Accept_Strategy.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Accept_Strategy.h
new file mode 100644
index 00000000000..0ce82cca857
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Accept_Strategy.h
@@ -0,0 +1,98 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_Accept_Strategy.h
+ *
+ * $Id$
+ *
+ * IIOP/SSL specific accept strategy
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SSLIOP_ACCEPT_STRATEGY_H
+#define TAO_SSLIOP_ACCEPT_STRATEGY_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/SSLIOP/SSLIOP_Connection_Handler.h"
+
+#include "tao/Acceptor_Impl.h"
+
+#include "ace/SSL/SSL_SOCK_Acceptor.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+
+ /**
+ * @class Accept_Strategy
+ *
+ * @brief SSLIOP-specific accept strategy that builds on the
+ * TAO_Accept_Strategy implementation.
+ *
+ * This accept strategy builds on on the TAO_Accept_Strategy
+ * implementation. It sub-classes that class, and overrides the
+ * accept_svc_handler() method so that a timeout value may be
+ * passed to the underlying peer acceptor. This is necessary to
+ * defend against a simple Denial-of-Service attack.
+ * @par
+ * Since SSL requires two handshakes, one TCP and one SSL, it is
+ * possible for a malicious client to establish a TCP connection
+ * to the SSL port, and never complete the SSL handshake. The
+ * underlying SSL passive connection code would block/hang waiting
+ * for the SSL handshake to complete. Given enough incomplete
+ * connections where only the TCP handshake is completed, a server
+ * process could potentially run out of available file
+ * descriptors, thus preventing legitimate client connections from
+ * being established.
+ * @par.
+ * The timeout defense alluded to above bounds the time this sort of
+ * DoS attack lasts.
+ */
+ class Accept_Strategy
+ : public TAO_Accept_Strategy<TAO::SSLIOP::Connection_Handler,
+ ACE_SSL_SOCK_ACCEPTOR>
+ {
+ public:
+
+ /// Constructor.
+ Accept_Strategy (TAO_ORB_Core * orb_core,
+ const ACE_Time_Value & timeout);
+
+ /// Overridden method that forces a passive connection timeout value
+ /// to be passed to the underlying acceptor.
+ virtual int accept_svc_handler (handler_type * svc_handler);
+
+ private:
+
+ /// The accept() timeout.
+ /**
+ * This timeout includes the overall time to complete the SSL
+ * handshake. This includes both the TCP handshake and the SSL
+ * handshake.
+ */
+ const ACE_Time_Value timeout_;
+
+ };
+
+ } // End SSLIOP namespace
+} // End TAO namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_ACCEPT_STRATEGY_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp
new file mode 100644
index 00000000000..41428c0a1ed
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp
@@ -0,0 +1,684 @@
+#include "orbsvcs/SSLIOP/SSLIOP_Acceptor.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Profile.h"
+
+#include "tao/MProfile.h"
+#include "tao/ORB_Core.h"
+#include "tao/Server_Strategy_Factory.h"
+#include "tao/Codeset_Manager.h"
+#include "tao/CDR.h"
+#include "tao/debug.h"
+
+#if !defined(__ACE_INLINE__)
+#include "orbsvcs/SSLIOP/SSLIOP_Acceptor.i"
+#endif /* __ACE_INLINE__ */
+
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_Acceptor,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SSLIOP::Acceptor::Acceptor (::Security::QOP qop,
+ const ACE_Time_Value & timeout)
+ : TAO::IIOP_SSL_Acceptor (),
+ ssl_acceptor_ (),
+ creation_strategy_ (0),
+ concurrency_strategy_ (0),
+ accept_strategy_ (0),
+ timeout_ (timeout)
+{
+ // --- CSIv1 ---
+
+ // Clear all bits in the SSLIOP::SSL association option fields.
+ this->ssl_component_.target_supports = 0;
+ this->ssl_component_.target_requires = 0;
+
+ // SSLIOP requires these Security::AssociationOptions by default.
+ ACE_SET_BITS (this->ssl_component_.target_requires,
+ ::Security::Integrity
+ | ::Security::Confidentiality
+ | ::Security::NoDelegation);
+
+ // SSLIOP supports these Security::AssociationOptions by default.
+ ACE_SET_BITS (this->ssl_component_.target_supports,
+ ::Security::Integrity
+ | ::Security::Confidentiality
+ | ::Security::EstablishTrustInTarget
+ | ::Security::NoDelegation);
+
+ // Initialize the default SSL port to zero (wild card port).
+ this->ssl_component_.port = 0;
+
+ // @@ This should go away once we support setting security
+ // association options through policies.
+ if (qop == ::Security::SecQOPNoProtection)
+ ACE_SET_BITS (this->ssl_component_.target_supports,
+ ::Security::NoProtection);
+
+
+ // --- CSIv2 ---
+
+ // Clear all bits in the CSIIOP::TLS_SEC_TRANS association option
+ // fields.
+ this->csiv2_component_.target_supports = 0;
+ this->csiv2_component_.target_requires = 0;
+
+ // SSLIOP requires these CSIIOP::AssociationOptions by default.
+ ACE_SET_BITS (this->csiv2_component_.target_requires,
+ CSIIOP::Integrity
+ | CSIIOP::Confidentiality
+ | CSIIOP::NoDelegation);
+
+ // SSLIOP supports these CSIIOP::AssociationOptions by default.
+ ACE_SET_BITS (this->csiv2_component_.target_supports,
+ CSIIOP::Integrity
+ | CSIIOP::Confidentiality
+ | CSIIOP::EstablishTrustInTarget
+ | CSIIOP::NoDelegation);
+
+ // @@ This should go away once we support setting security
+ // association options through policies.
+ if (qop == CSIIOP::NoProtection)
+ ACE_SET_BITS (this->csiv2_component_.target_supports,
+ CSIIOP::NoProtection);
+}
+
+TAO::SSLIOP::Acceptor::~Acceptor (void)
+{
+ // Make sure we are closed before we start destroying the
+ // strategies.
+ this->close ();
+
+ delete this->creation_strategy_;
+ delete this->concurrency_strategy_;
+ delete this->accept_strategy_;
+}
+
+int
+TAO::SSLIOP::Acceptor::create_profile (const TAO::ObjectKey &object_key,
+ TAO_MProfile &mprofile,
+ CORBA::Short priority)
+{
+ // Sanity check.
+ if (this->endpoint_count_ == 0)
+ return -1;
+
+ // Check if multiple endpoints should be put in one profile or
+ // if they should be spread across multiple profiles.
+ if (priority == TAO_INVALID_PRIORITY)
+ return this->create_new_profile (object_key,
+ mprofile,
+ priority);
+ else
+ return this->create_shared_profile (object_key,
+ mprofile,
+ priority);
+}
+
+int
+TAO::SSLIOP::Acceptor::create_new_profile (const TAO::ObjectKey &object_key,
+ TAO_MProfile &mprofile,
+ CORBA::Short priority)
+{
+ // Adding this->endpoint_count_ to the TAO_MProfile.
+ const int count = mprofile.profile_count ();
+ if ((mprofile.size () - count) < this->endpoint_count_
+ && mprofile.grow (count + this->endpoint_count_) == -1)
+ return -1;
+
+ // Create a profile for each acceptor endpoint.
+ for (size_t i = 0; i < this->endpoint_count_; ++i)
+ {
+ TAO_SSLIOP_Profile *pfile = 0;
+
+ // @@ We need to create an SSLIOP::SSL component for the object
+ // we're creating an MProfile for. This will allow us to
+ // properly embed secure invocation policies in the generated
+ // IOR, i.e. secure invocation policies on a per-object
+ // basis, rather than on a per-endpoint basis. If no secure
+ // invocation policies have been set then we should use the
+ // below default SSLIOP::SSL component.
+ ACE_NEW_RETURN (pfile,
+ TAO_SSLIOP_Profile (this->hosts_[i],
+ this->addrs_[i].get_port_number (),
+ object_key,
+ this->addrs_[i],
+ this->version_,
+ this->orb_core_,
+ &(this->ssl_component_)),
+ -1);
+ pfile->endpoint ()->priority (priority);
+
+ if (mprofile.give_profile (pfile) == -1)
+ {
+ pfile->_decr_refcnt ();
+ pfile = 0;
+ return -1;
+ }
+
+ if (this->orb_core_->orb_params ()->std_profile_components () == 0)
+ continue;
+
+ pfile->tagged_components ().set_orb_type (TAO_ORB_TYPE);
+
+ TAO_Codeset_Manager *csm = this->orb_core_->codeset_manager();
+ if (csm)
+ csm->set_codeset (pfile->tagged_components());
+
+ IOP::TaggedComponent component;
+ component.tag = ::SSLIOP::TAG_SSL_SEC_TRANS;
+
+ // @@???? Check this code, only intended as guideline...
+ TAO_OutputCDR cdr;
+ cdr << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER);
+
+ // @@ We need to create an SSLIOP::SSL component for the object
+ // we're creating an MProfile for. This will allow us to
+ // properly embed secure invocation policies in the generated
+ // IOR, i.e. secure invocation policies on a per-object
+ // basis, rather than on a per-endpoint basis. If no secure
+ // invocation policies have been set then we should use the
+ // below default SSLIOP::SSL component.
+ cdr << this->ssl_component_;
+
+ // TAO extension, replace the contents of the octet sequence with
+ // the CDR stream
+ const CORBA::ULong length = cdr.total_length ();
+ component.component_data.length (length);
+ CORBA::Octet *buf = component.component_data.get_buffer ();
+ for (const ACE_Message_Block *i = cdr.begin ();
+ i != 0;
+ i = i->cont ())
+ {
+ ACE_OS::memcpy (buf, i->rd_ptr (), i->length ());
+ buf += i->length ();
+ }
+
+ pfile->tagged_components ().set_component (component);
+ }
+
+ return 0;
+}
+
+
+int
+TAO::SSLIOP::Acceptor::create_shared_profile (const TAO::ObjectKey &object_key,
+ TAO_MProfile &mprofile,
+ CORBA::Short priority)
+{
+ size_t index = 0;
+ TAO_Profile *pfile = 0;
+ TAO_SSLIOP_Profile *ssliop_profile = 0;
+
+ // First see if <mprofile> already contains a SSLIOP profile.
+ for (TAO_PHandle i = 0; i != mprofile.profile_count (); ++i)
+ {
+ pfile = mprofile.get_profile (i);
+ if (pfile->tag () == IOP::TAG_INTERNET_IOP)
+ {
+ ssliop_profile = dynamic_cast<TAO_SSLIOP_Profile *> (pfile);
+ if (ssliop_profile == 0)
+ return -1;
+ break;
+ }
+ }
+
+ // If <mprofile> doesn't contain SSLIOP_Profile, we need to create
+ // one.
+ if (ssliop_profile == 0)
+ {
+ // @@ We need to create an SSLIOP::SSL component for the object
+ // we're creating an MProfile for. This will allow us to
+ // properly embed secure invocation policies in the generated
+ // IOR, i.e. secure invocation policies on a per-object
+ // basis, rather than on a per-endpoint basis. If no secure
+ // invocation policies have been set then we should use the
+ // below default SSLIOP::SSL component.
+ ACE_NEW_RETURN (ssliop_profile,
+ TAO_SSLIOP_Profile (this->hosts_[0],
+ this->addrs_[0].get_port_number (),
+ object_key,
+ this->addrs_[0],
+ this->version_,
+ this->orb_core_,
+ &(this->ssl_component_)),
+ -1);
+
+ TAO_SSLIOP_Endpoint *ssliop_endp =
+ dynamic_cast<TAO_SSLIOP_Endpoint *> (ssliop_profile->endpoint ());
+
+ ssliop_endp->priority (priority);
+ ssliop_endp->iiop_endpoint ()->priority (priority);
+
+ if (mprofile.give_profile (ssliop_profile) == -1)
+ {
+ ssliop_profile->_decr_refcnt ();
+ ssliop_profile = 0;
+ return -1;
+ }
+
+ if (this->orb_core_->orb_params ()->std_profile_components () != 0)
+ {
+ ssliop_profile->tagged_components ().set_orb_type (TAO_ORB_TYPE);
+
+ TAO_Codeset_Manager *csm = this->orb_core_->codeset_manager();
+ if (csm)
+ csm->set_codeset(ssliop_profile->tagged_components());
+
+ IOP::TaggedComponent component;
+ component.tag = ::SSLIOP::TAG_SSL_SEC_TRANS;
+ // @@???? Check this code, only intended as guideline...
+ TAO_OutputCDR cdr;
+ cdr << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER);
+
+ // @@ We need to create an SSLIOP::SSL component for the
+ // object we're creating an MProfile for. This will
+ // allow us to properly embed secure invocation policies
+ // in the generated IOR, i.e. secure invocation policies
+ // on a per-object basis, rather than on a per-endpoint
+ // basis. If no secure invocation policies have been set
+ // then we should use the below default SSLIOP::SSL
+ // component.
+ cdr << this->ssl_component_;
+
+ // TAO extension, replace the contents of the octet sequence with
+ // the CDR stream
+ CORBA::ULong length = cdr.total_length ();
+ component.component_data.length (length);
+ CORBA::Octet *buf = component.component_data.get_buffer ();
+ for (const ACE_Message_Block *i = cdr.begin ();
+ i != 0;
+ i = i->cont ())
+ {
+ ACE_OS::memcpy (buf, i->rd_ptr (), i->length ());
+ buf += i->length ();
+ }
+
+ ssliop_profile->tagged_components ().set_component (component);
+ }
+
+ index = 1;
+ }
+
+ // Add any remaining endpoints to the SSLIOP_Profile.
+ for (;
+ index < this->endpoint_count_;
+ ++index)
+ {
+ TAO_SSLIOP_Endpoint *ssl_endp = 0;
+ TAO_IIOP_Endpoint *iiop_endp = 0;
+ ACE_NEW_RETURN (iiop_endp,
+ TAO_IIOP_Endpoint (this->hosts_[index],
+ this->addrs_[index].get_port_number (),
+ this->addrs_[index]),
+ -1);
+ iiop_endp->priority (priority);
+
+ ACE_NEW_RETURN (ssl_endp,
+ TAO_SSLIOP_Endpoint (&(this->ssl_component_),
+ iiop_endp),
+ -1);
+
+ ssl_endp->priority (priority);
+ ssliop_profile->add_endpoint (ssl_endp);
+ }
+
+ return 0;
+}
+
+int
+TAO::SSLIOP::Acceptor::is_collocated (const TAO_Endpoint *endpoint)
+{
+ const TAO_SSLIOP_Endpoint *endp =
+ dynamic_cast<const TAO_SSLIOP_Endpoint *> (endpoint);
+
+ // Make sure the dynamically cast pointer is valid.
+ if (endp == 0)
+ return 0;
+
+ for (size_t i = 0; i < this->endpoint_count_; ++i)
+ {
+ // @@ TODO The following code looks funky, why only the address
+ // is compared? What about the IIOP address? Why force a
+ // DNS lookup every time an SSLIOP object is decoded:
+ //
+ // http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=1220
+ //
+ if (endp->iiop_endpoint ()->object_addr () == this->addrs_[i])
+ return 1; // Collocated
+ }
+
+ return 0; // Not collocated
+}
+
+int
+TAO::SSLIOP::Acceptor::close (void)
+{
+ int r = this->ssl_acceptor_.close ();
+ if (this->IIOP_SSL_Acceptor::close () != 0)
+ r = -1;
+
+ return r;
+}
+
+int
+TAO::SSLIOP::Acceptor::open (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
+ int major,
+ int minor,
+ const char *address,
+ const char *options)
+{
+ // Ensure that neither the endpoint configuration nor the ORB
+ // configuration violate security measures.
+ if (this->verify_secure_configuration (orb_core,
+ major,
+ minor) != 0)
+ return -1;
+
+ ACE_INET_Addr addr;
+ ACE_CString specified_hostname;
+ if (this->parse_address (address, addr, specified_hostname) == -1)
+ return -1;
+
+ // Open the non-SSL enabled endpoints, then open the SSL enabled
+ // endpoints.
+ if (this->IIOP_SSL_Acceptor::open (orb_core,
+ reactor,
+ major,
+ minor,
+ address,
+ options) != 0)
+ return -1;
+
+ // The SSL port is set in the parse_options() method. All we have
+ // to do is call open_i()
+ addr.set_port_number (this->ssl_component_.port);
+
+ return this->ssliop_open_i (orb_core,
+ addr,
+ reactor);
+}
+
+int
+TAO::SSLIOP::Acceptor::open_default (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
+ int major,
+ int minor,
+ const char *options)
+{
+ // Ensure that neither the endpoint configuration nor the ORB
+ // configuration violate security measures.
+ if (this->verify_secure_configuration (orb_core,
+ major,
+ minor) != 0)
+ return -1;
+
+ // Open the non-SSL enabled endpoints, then open the SSL enabled
+ // endpoints.
+ if (this->IIOP_SSL_Acceptor::open_default (orb_core,
+ reactor,
+ major,
+ minor,
+ options) == -1)
+ return -1;
+
+ // Now that each network interface's hostname has been cached, open
+ // an endpoint on each network interface using the INADDR_ANY
+ // address.
+ ACE_INET_Addr addr;
+
+ // this->ssl_component_.port is initialized to zero or it is set in
+ // this->parse_options().
+ if (addr.set (this->ssl_component_.port,
+ static_cast<ACE_UINT32> (INADDR_ANY),
+ 1) != 0)
+ return -1;
+
+ return this->ssliop_open_i (orb_core,
+ addr,
+ reactor);
+}
+
+int
+TAO::SSLIOP::Acceptor::ssliop_open_i (TAO_ORB_Core *orb_core,
+ const ACE_INET_Addr& addr,
+ ACE_Reactor *reactor)
+{
+ this->orb_core_ = orb_core;
+
+ // Explicitly disable GIOPlite support since it introduces security
+ // holes.
+ static const int giop_lite = 0;
+
+ ACE_NEW_RETURN (this->creation_strategy_,
+ CREATION_STRATEGY (this->orb_core_,
+ giop_lite),
+ -1);
+
+ ACE_NEW_RETURN (this->concurrency_strategy_,
+ CONCURRENCY_STRATEGY (this->orb_core_),
+ -1);
+
+ ACE_NEW_RETURN (this->accept_strategy_,
+ ACCEPT_STRATEGY (this->orb_core_,
+ this->timeout_),
+ -1);
+
+ u_short requested_port = addr.get_port_number ();
+ if (requested_port == 0)
+ {
+ // don't care, i.e., let the OS choose an ephemeral port
+ if (this->ssl_acceptor_.open (addr,
+ reactor,
+ this->creation_strategy_,
+ this->accept_strategy_,
+ this->concurrency_strategy_,
+ 0, 0, 0, 1,
+ this->reuse_addr_) == -1)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\n\nTAO (%P|%t) ")
+ ACE_TEXT ("SSLIOP_Acceptor::open_i - %p\n\n"),
+ ACE_TEXT ("cannot open acceptor")));
+ return -1;
+ }
+ }
+ else
+ {
+ ACE_INET_Addr a(addr);
+
+ int found_a_port = 0;
+ ACE_UINT32 last_port = requested_port + this->port_span_ - 1;
+ if (last_port > ACE_MAX_DEFAULT_PORT)
+ {
+ last_port = ACE_MAX_DEFAULT_PORT;
+ }
+
+ for (ACE_UINT32 p = requested_port; p <= last_port; p++)
+ {
+ if (TAO_debug_level > 5)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) IIOP_Acceptor::open_i() ")
+ ACE_TEXT ("trying to listen on port %d\n"), p));
+
+ // Now try to actually open on that port
+ a.set_port_number ((u_short)p);
+ if (this->ssl_acceptor_.open (a,
+ reactor,
+ this->creation_strategy_,
+ this->accept_strategy_,
+ this->concurrency_strategy_,
+ 0, 0, 0, 1,
+ this->reuse_addr_) != -1)
+ {
+ found_a_port = 1;
+ break;
+ }
+ }
+
+ // Now, if we couldn't locate a port, we punt
+ if (! found_a_port)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\n\nTAO (%P|%t) ")
+ ACE_TEXT ("SSLIOP_Acceptor::open_i - %p\n\n"),
+ ACE_TEXT ("cannot open acceptor")));
+ return -1;
+ }
+ }
+
+ ACE_INET_Addr ssl_address;
+
+ // We do this to make sure the port number the endpoint is listening
+ // on gets set in the addr.
+ if (this->ssl_acceptor_.acceptor ().get_local_addr (ssl_address) != 0)
+ {
+ // @@ Should this be a catastrophic error???
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\n\nTAO (%P|%t) ")
+ ACE_TEXT ("SSLIOP_Acceptor::open_i - %p\n\n"),
+ ACE_TEXT ("cannot get local addr")));
+ return -1;
+ }
+
+ // Reset the SSL endpoint port to the one chosen by the OS (or by
+ // the user if provided.
+ this->ssl_component_.port = ssl_address.get_port_number ();
+
+ (void) this->ssl_acceptor_.acceptor().enable (ACE_CLOEXEC);
+ // This avoids having child processes acquire the listen socket
+ // thereby denying the server the opportunity to restart on a
+ // well-known endpoint. This does not affect the aberrent behavior
+ // on Win32 platforms.
+
+ if (TAO_debug_level > 5)
+ {
+ for (size_t i = 0; i < this->endpoint_count_; ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) ")
+ ACE_TEXT ("SSLIOP_Acceptor::open_i - ")
+ ACE_TEXT ("listening on: <%s:%u>\n"),
+ this->hosts_[i],
+ this->ssl_component_.port));
+ }
+ }
+
+ return 0;
+}
+
+int
+TAO::SSLIOP::Acceptor::parse_options_i (int &argc, ACE_CString ** argv)
+{
+ //first, do the base class parser, then parse the leftovers.
+ int result = this->IIOP_SSL_Acceptor::parse_options_i(argc,argv);
+ if (result == -1)
+ return result;
+
+ // then parse out our own options.
+ int i = 0;
+ while (i < argc)
+ {
+ // since the base class has already iterated over the list once,
+ // it has vound any ill-formed options. Therefore we don't need
+ // to do that again here.
+ int slot = argv[i]->find ("=");
+ ACE_CString name = argv[i]->substring (0, slot);
+ ACE_CString value = argv[i]->substring (slot + 1);
+
+ if (name == "priority")
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Invalid SSLIOP endpoint format: ")
+ ACE_TEXT ("endpoint priorities no longer supported. \n"),
+ value.c_str ()),
+ -1);
+ }
+ else if (ACE_OS::strcmp (name.c_str (), "ssl_port") == 0)
+ {
+ int ssl_port = ACE_OS::atoi (value.c_str ());
+
+ if (ssl_port >= 0 && ssl_port < 65536)
+ this->ssl_component_.port = ssl_port;
+ else
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Invalid ")
+ ACE_TEXT ("IIOP/SSL endpoint ")
+ ACE_TEXT ("port: <%s>\n"),
+ value.c_str ()),
+ -1);
+ }
+ else
+ {
+ // the name is not known, skip to the next option
+ i++;
+ continue;
+ }
+ // at the end, we've consumed this argument. Shift the list and
+ // put this one on the end. This technique has the effect of
+ // putting them in reverse order, but that doesn't matter, since
+ // these arguments are only whole strings.
+ argc--;
+ ACE_CString *temp = argv[i];
+ for (int j = i; j <= argc-1; j++)
+ argv[j] = argv[j+1];
+ argv[argc] = temp;
+
+ }
+ return 0;
+}
+
+int
+TAO::SSLIOP::Acceptor::verify_secure_configuration (TAO_ORB_Core *orb_core,
+ int major,
+ int minor)
+{
+ // Sanity check.
+ if (major < 1)
+ {
+ // There is no such thing as IIOP 0.x.
+ errno = EINVAL;
+ return -1;
+ }
+
+ // In order to support a secure connection, the SSLIOP::SSL tagged
+ // component must be embedded in the IOR. This isn't possible if
+ // the user elects to disable standard profile components.
+ // Similarly, IIOP 1.0 does not support tagged components, which
+ // makes it impossible to embed the SSLIOP::SSL tagged component
+ // within the IOR. If the given object explicitly disallows
+ // insecure invocations and standard profile components are
+ // disabled, then return with an error since secure invocations
+ // cannot be supported without standard profile components.
+ //
+ // Note that it isn't enough to support NoProtection. NoProtection
+ // must be required since "support" does not preclude the secure
+ // port from being used.
+
+ if ((orb_core->orb_params ()->std_profile_components () == 0
+ || (major == 1 && minor == 0))
+ && ACE_BIT_DISABLED (this->ssl_component_.target_requires,
+ ::Security::NoProtection))
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Cannot support secure ")
+ ACE_TEXT ("IIOP over SSL connection if\n")
+ ACE_TEXT ("(%P|%t) standard profile ")
+ ACE_TEXT ("components are disabled\n")
+ ACE_TEXT ("(%P|%t) or IIOP 1.0 endpoint is ")
+ ACE_TEXT ("used.\n")));
+
+ errno = EINVAL;
+ return -1;
+ }
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h
new file mode 100644
index 00000000000..f8c12442dc3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h
@@ -0,0 +1,169 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_Acceptor.h
+ *
+ * $Id$
+ *
+ * IIOP/SSL specific acceptor processing
+ *
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SSLIOP_ACCEPTOR_H
+#define TAO_SSLIOP_ACCEPTOR_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/SSLIOP/IIOP_SSL_Acceptor.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Accept_Strategy.h"
+
+#include "orbsvcs/SSLIOPC.h" /* CSIv1 */
+#include "orbsvcs/CSIIOPC.h" /* CSIv2 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+
+ /**
+ * @class Acceptor
+ *
+ * @brief The SSLIOP-specific bridge class for the concrete acceptor.
+ */
+ class Acceptor
+ : public IIOP_SSL_Acceptor
+ {
+ public:
+
+ /// Constructor.
+ Acceptor (::Security::QOP qop,
+ const ACE_Time_Value & timeout);
+
+ /// Destructor.
+ ~Acceptor (void);
+
+ typedef ACE_Strategy_Acceptor<Connection_Handler, ACE_SSL_SOCK_ACCEPTOR> BASE_ACCEPTOR;
+ typedef TAO_Creation_Strategy<Connection_Handler> CREATION_STRATEGY;
+ typedef TAO_Concurrency_Strategy<Connection_Handler> CONCURRENCY_STRATEGY;
+ typedef Accept_Strategy ACCEPT_STRATEGY;
+
+ /**
+ * @name The TAO_Acceptor Methods
+ *
+ * Check the documentation in tao/Pluggable.h for details.
+ */
+ //@{
+ virtual int open (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
+ int version_major,
+ int version_minor,
+ const char *address,
+ const char *options = 0);
+ virtual int open_default (TAO_ORB_Core *orb_core,
+ ACE_Reactor *reactor,
+ int version_major,
+ int version_minor,
+ const char *options = 0);
+ virtual int close (void);
+ virtual int create_profile (const TAO::ObjectKey &object_key,
+ TAO_MProfile &mprofile,
+ CORBA::Short priority);
+ virtual int is_collocated (const TAO_Endpoint* endpoint);
+ //@}
+
+ /// Retrieve the CSIv1 SSLIOP::SSL component associated with the
+ /// endpoints set up by this acceptor.
+ const ::SSLIOP::SSL &ssl_component (void) const;
+
+ private:
+
+ /// Implement the common part of the open*() methods.
+ int ssliop_open_i (TAO_ORB_Core *orb_core,
+ const ACE_INET_Addr& addr,
+ ACE_Reactor *reactor);
+
+ /// Parse protocol specific options.
+ virtual int parse_options_i (int &argc, ACE_CString ** argv);
+
+ /// Ensure that neither the endpoint configuration nor the ORB
+ /// configuration violate security measures.
+ int verify_secure_configuration (TAO_ORB_Core *orb_core,
+ int major,
+ int minor);
+
+ /// Helper method to add a new profile to the mprofile for
+ /// each endpoint.
+ int create_new_profile (const TAO::ObjectKey &object_key,
+ TAO_MProfile &mprofile,
+ CORBA::Short priority);
+
+ /// Helper method to create a profile that contains all of
+ /// our endpoints.
+ int create_shared_profile (const TAO::ObjectKey &object_key,
+ TAO_MProfile &mprofile,
+ CORBA::Short priority);
+
+ private:
+
+ /// The concrete acceptor, as a pointer to it's base class.
+ BASE_ACCEPTOR ssl_acceptor_;
+
+ /**
+ * @name Acceptor Strategies
+ *
+ * Strategies used when accepting an incoming connection.
+ */
+ CREATION_STRATEGY *creation_strategy_;
+ CONCURRENCY_STRATEGY *concurrency_strategy_;
+ ACCEPT_STRATEGY *accept_strategy_;
+
+ /// The CSIv1 SSL component.
+ /**
+ * This is the SSLIOP endpoint-specific tagged component that is
+ * embedded in a given IOR.
+ */
+ ::SSLIOP::SSL ssl_component_;
+
+ /// The SSLIOP CSIv2 tagged component.
+ /**
+ *
+ */
+ CSIIOP::TLS_SEC_TRANS csiv2_component_;
+
+ /// The accept() timeout.
+ /**
+ * This timeout includes the overall time to complete the SSL
+ * handshake. This includes both the TCP handshake and the SSL
+ * handshake.
+ */
+ const ACE_Time_Value timeout_;
+
+ };
+
+ } // End SSLIOP namespace.
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(__ACE_INLINE__)
+#include "orbsvcs/SSLIOP/SSLIOP_Acceptor.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_ACCEPTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.i b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.i
new file mode 100644
index 00000000000..9dd630f54ef
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.i
@@ -0,0 +1,14 @@
+// -*- C++ -*-
+//
+// $Id$
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE const SSLIOP::SSL &
+TAO::SSLIOP::Acceptor::ssl_component (void) const
+{
+ return this->ssl_component_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ClientCredentials.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ClientCredentials.cpp
new file mode 100644
index 00000000000..4cf1fe799fb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ClientCredentials.cpp
@@ -0,0 +1,142 @@
+// $Id$
+
+#include "orbsvcs/SSLIOP/SSLIOP_ClientCredentials.h"
+#include "orbsvcs/SSLIOP/SSLIOP_OwnCredentials.h"
+
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_ClientCredentials,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SSLIOP::ClientCredentials::ClientCredentials (
+ X509 * cert,
+ EVP_PKEY *evp,
+ SSL * ssl)
+ : SSLIOP_Credentials (cert, evp),
+ ssl_ (TAO::SSLIOP::OpenSSL_traits< ::SSL >::_duplicate (ssl))
+{
+}
+
+TAO::SSLIOP::ClientCredentials::~ClientCredentials (void)
+{
+}
+
+SecurityLevel3::CredentialsType
+TAO::SSLIOP::ClientCredentials::creds_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return SecurityLevel3::CT_ClientCredentials;
+}
+
+char *
+TAO::SSLIOP::ClientCredentials::context_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+SecurityLevel3::Principal *
+TAO::SSLIOP::ClientCredentials::client_principal (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+SecurityLevel3::StatementList *
+TAO::SSLIOP::ClientCredentials::client_supporting_statements (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+SecurityLevel3::ResourceNameList *
+TAO::SSLIOP::ClientCredentials::client_restricted_resources (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+SecurityLevel3::Principal *
+TAO::SSLIOP::ClientCredentials::target_principal (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+SecurityLevel3::StatementList *
+TAO::SSLIOP::ClientCredentials::target_supporting_statements (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+SecurityLevel3::ResourceNameList *
+TAO::SSLIOP::ClientCredentials::target_restricted_resources (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+SecurityLevel3::OwnCredentials_ptr
+TAO::SSLIOP::ClientCredentials::parent_credentials (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ SecurityLevel3::OwnCredentials_ptr creds =
+ SecurityLevel3::OwnCredentials::_nil ();
+
+ ACE_NEW_THROW_EX (creds,
+ TAO::SSLIOP::OwnCredentials (
+ ::SSL_get_certificate (this->ssl_.in ()),
+ ::SSL_get_privatekey (this->ssl_.in ())),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (creds);
+
+ return creds;
+}
+
+CORBA::Boolean
+TAO::SSLIOP::ClientCredentials::client_authentication (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // If the client presented no certificate (i.e. cert_.ptr() == 0),
+ // the client was not authenticated. Otherwise, verify the peer's
+ // certificate.
+
+ return
+ this->x509_.in () != 0
+ && SSL_get_verify_result (this->ssl_.in ()) == X509_V_OK;
+}
+
+CORBA::Boolean
+TAO::SSLIOP::ClientCredentials::target_authentication (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), false);
+}
+
+CORBA::Boolean
+TAO::SSLIOP::ClientCredentials::confidentiality (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), false);
+}
+
+CORBA::Boolean
+TAO::SSLIOP::ClientCredentials::integrity (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // TAO's SSLIOP pluggable transport always provides integrity. Note
+ // that if we
+
+ return true;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ClientCredentials.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ClientCredentials.h
new file mode 100644
index 00000000000..ce621276918
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ClientCredentials.h
@@ -0,0 +1,153 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_ClientCredentials.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SSLIOP_CLIENT_CREDENTIALS_H
+#define TAO_SSLIOP_CLIENT_CREDENTIALS_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/SSLIOP/SSLIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SSLIOP/SSLIOP_Credentials.h"
+#include "orbsvcs/SSLIOP/SSLIOP_SSL.h"
+
+#include "orbsvcs/SecurityLevel3C.h"
+
+#include "tao/LocalObject.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+ /**
+ * @class ClientCredentials
+ *
+ * @brief
+ *
+ *
+ */
+ class ClientCredentials
+ : public virtual SecurityLevel3::ClientCredentials,
+ public virtual SSLIOP_Credentials
+ {
+ public:
+
+ /// Constructor
+ ClientCredentials (::X509 * cert,
+ ::EVP_PKEY * evp,
+ ::SSL * ssl);
+
+ /**
+ * @name SecurityLevel3::Credentials Methods
+ *
+ * Methods required by the SecurityLevel3::Credentials
+ * interface.
+ */
+ //@{
+ virtual SecurityLevel3::CredentialsType creds_type (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ /**
+ * @name SecurityLevel3::ClientCredentials Methods
+ *
+ * Methods required by the SecurityLevel3::ClientCredentials
+ * interface.
+ */
+ //@{
+ virtual char * context_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::Principal * client_principal (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::StatementList * client_supporting_statements (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::ResourceNameList * client_restricted_resources (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::Principal * target_principal (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::StatementList * target_supporting_statements (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::ResourceNameList * target_restricted_resources (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::OwnCredentials_ptr parent_credentials (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean client_authentication (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean target_authentication (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean confidentiality (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean integrity (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management
+ * through the reference counting mechanism.
+ */
+ ~ClientCredentials (void);
+
+ private:
+
+ /// Reference to the OpenSSL @c SSL data structure associated
+ /// with the current security context (e.g. SSL connection).
+ TAO::SSLIOP::SSL_var ssl_;
+
+ };
+
+ } // End SSLIOP namespace
+} // End TAO namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_CLIENT_CREDENTIALS_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp
new file mode 100644
index 00000000000..3d652c1df81
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp
@@ -0,0 +1,445 @@
+#include "orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Endpoint.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Util.h"
+
+#include "tao/debug.h"
+#include "tao/Base_Transport_Property.h"
+#include "tao/ORB_Core.h"
+#include "tao/IIOP_Endpoint.h"
+#include "tao/IIOP_Connection_Handler.h"
+#include "tao/Transport_Cache_Manager.h"
+#include "tao/Thread_Lane_Resources.h"
+#include "tao/Wait_Strategy.h"
+#include "tao/Protocols_Hooks.h"
+#include "ace/os_include/netinet/os_tcp.h"
+#include "ace/os_include/os_netdb.h"
+
+#if !defined (__ACE_INLINE__)
+# include "orbsvcs/SSLIOP/SSLIOP_Connection_Handler.i"
+#endif /* ! __ACE_INLINE__ */
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_Connection_Handler,
+ "$Id$")
+
+// ****************************************************************
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SSLIOP::Connection_Handler::Connection_Handler (
+ ACE_Thread_Manager *t)
+ : SVC_HANDLER (t, 0 , 0),
+ TAO_Connection_Handler (0),
+ current_ ()
+{
+ // This constructor should *never* get called, it is just here to
+ // make the compiler happy: the default implementation of the
+ // Creation_Strategy requires a constructor with that signature, we
+ // don't use that implementation, but some (most?) compilers
+ // instantiate it anyway.
+ ACE_ASSERT (0);
+}
+
+TAO::SSLIOP::Connection_Handler::Connection_Handler (
+ TAO_ORB_Core *orb_core,
+ CORBA::Boolean /* flag */) // SSLIOP does *not* support GIOPlite
+ : SVC_HANDLER (orb_core->thr_mgr (), 0, 0),
+ TAO_Connection_Handler (orb_core),
+ current_ ()
+{
+ this->current_ =
+ TAO::SSLIOP::Util::current (orb_core);
+
+ TAO::SSLIOP::Transport* specific_transport = 0;
+ ACE_NEW (specific_transport,
+ TAO::SSLIOP::Transport (this, orb_core, 0));
+
+ // store this pointer (indirectly increment ref count)
+ this->transport (specific_transport);
+}
+
+TAO::SSLIOP::Connection_Handler::~Connection_Handler (void)
+{
+ delete this->transport ();
+}
+
+int
+TAO::SSLIOP::Connection_Handler::open_handler (void *v)
+{
+ return this->open (v);
+}
+
+int
+TAO::SSLIOP::Connection_Handler::open (void *)
+{
+ TAO_IIOP_Protocol_Properties protocol_properties;
+
+ // Initialize values from ORB params.
+ protocol_properties.send_buffer_size_ =
+ this->orb_core ()->orb_params ()->sock_sndbuf_size ();
+ protocol_properties.recv_buffer_size_ =
+ this->orb_core ()->orb_params ()->sock_rcvbuf_size ();
+ protocol_properties.no_delay_ =
+ this->orb_core ()->orb_params ()->nodelay ();
+
+ TAO_Protocols_Hooks *tph =
+ this->orb_core ()->get_protocols_hooks ();
+
+ int client =
+ this->transport ()->opened_as () == TAO::TAO_CLIENT_ROLE;;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ if (client)
+ {
+ tph->client_protocol_properties_at_orb_level (
+ protocol_properties
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ tph->server_protocol_properties_at_orb_level (
+ protocol_properties
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ if (this->set_socket_option (this->peer (),
+ protocol_properties.send_buffer_size_,
+ protocol_properties.recv_buffer_size_) == -1)
+ return -1;
+
+#if !defined (ACE_LACKS_TCP_NODELAY)
+ if (this->peer ().set_option (ACE_IPPROTO_TCP,
+ TCP_NODELAY,
+ (void *) &protocol_properties.no_delay_,
+ sizeof (protocol_properties.no_delay_)) == -1)
+ return -1;
+#endif /* ! ACE_LACKS_TCP_NODELAY */
+
+ if (this->transport ()->wait_strategy ()->non_blocking ())
+ {
+ if (this->peer ().enable (ACE_NONBLOCK) == -1)
+ return -1;
+
+ // Enable partial SSL writes.
+ //
+ // By default, OpenSSL attempts to send the entire chunk of
+ // data. This is fine for relatively small chunks of data.
+ // However, if SSL_write() returns with an SSL_ERROR_WANT_WRITE
+ // (basically an EWOULDBLOCK) when using non-blocking I/O, TAO
+ // may attempt to resend the same data with a potentially
+ // different buffer address. Such a scenario is prone to happen
+ // when sending large chunks of data that cause flow control to
+ // occur. For most protocol implementations this is fine.
+ // OpenSSL, on the other hand, requires that the same arguments
+ // be passed to SSL_write() if an SSL_ERROR_WANT_WRITE error
+ // occured on a previous SSL_write() attempt, which cannot be
+ // guaranteed by TAO's current message queuing/construction
+ // code, often resulting in a "bad write retry" OpenSSL error.
+ // To work around this issue, we enable partial SSL_write()s in
+ // SSL/TLS connections created by TAO's SSLIOP pluggable
+ // protocol. Doing so makes SSL_write() behave like write(2).
+ //
+ // This isn't an issue when using blocking I/O.
+ (void) ::SSL_set_mode (this->peer ().ssl (),
+ SSL_MODE_ENABLE_PARTIAL_WRITE);
+ (void) ::SSL_set_mode (this->peer ().ssl (),
+ SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
+ }
+
+ // Called by the <Strategy_Acceptor> when the handler is
+ // completely connected.
+ ACE_INET_Addr remote_addr;
+ if (this->peer ().get_remote_addr (remote_addr) == -1)
+ return -1;
+
+ ACE_INET_Addr local_addr;
+ if (this->peer ().get_local_addr (local_addr) == -1)
+ return -1;
+
+ int use_dotted_decimal_addresses =
+ this->orb_core ()->orb_params ()->use_dotted_decimal_addresses ();
+
+ if (local_addr.get_ip_address () == remote_addr.get_ip_address ()
+ && local_addr.get_port_number () == remote_addr.get_port_number ())
+ {
+ if (TAO_debug_level > 0)
+ {
+ char remote_as_string[MAXHOSTNAMELEN + 16];
+ char local_as_string[MAXHOSTNAMELEN + 16];
+
+ (void) remote_addr.addr_to_string (remote_as_string,
+ sizeof (remote_as_string),
+ use_dotted_decimal_addresses);
+ (void) local_addr.addr_to_string (local_as_string,
+ sizeof (local_as_string),
+ use_dotted_decimal_addresses);
+ ACE_ERROR ((LM_ERROR,
+ "TAO(%P|%t) - TAO::SSLIOP::Connection_Handler::open, "
+ "Holy Cow! The remote addr and "
+ "local addr are identical (%s == %s)\n",
+ remote_as_string, local_as_string));
+ }
+
+ return -1;
+ }
+
+ if (TAO_debug_level > 0)
+ {
+ char client[MAXHOSTNAMELEN + 16];
+
+ // Verify that we can resolve the peer hostname.
+ if (remote_addr.addr_to_string (client,
+ sizeof (client),
+ use_dotted_decimal_addresses) == -1)
+ {
+ ACE_OS::strcpy (client, "*unable to obtain*");
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) SSLIOP connection from ")
+ ACE_TEXT ("client <%s> on [%d]\n"),
+ client,
+ this->peer ().get_handle ()));
+
+ // Verify that we can resolve our hostname.
+ if (local_addr.addr_to_string (client,
+ sizeof (client),
+ use_dotted_decimal_addresses) == -1)
+ {
+ ACE_OS::strcpy (client, "*unable to obtain*");
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) SSLIOP connection accepted from ")
+ ACE_TEXT ("server <%s> on [%d]\n"),
+ client,
+ this->get_handle ()));
+ }
+
+ // Set that the transport is now connected, if fails we return -1
+ // Use C-style cast b/c otherwise we get warnings on lots of
+ // compilers
+ if (!this->transport ()->post_open ((size_t) this->get_handle ()))
+ return -1;
+
+ // @@ Not needed
+ this->state_changed (TAO_LF_Event::LFS_SUCCESS,
+ this->orb_core ()->leader_follower ());
+
+ return 0;
+}
+
+int
+TAO::SSLIOP::Connection_Handler::resume_handler (void)
+{
+ return ACE_Event_Handler::ACE_APPLICATION_RESUMES_HANDLER;
+}
+
+int
+TAO::SSLIOP::Connection_Handler::close_connection (void)
+{
+ return this->close_connection_eh (this);
+}
+
+int
+TAO::SSLIOP::Connection_Handler::handle_input (ACE_HANDLE h)
+{
+ return this->handle_input_eh (h, this);
+}
+
+int
+TAO::SSLIOP::Connection_Handler::handle_output (ACE_HANDLE handle)
+{
+ const int result =
+ this->handle_output_eh (handle, this);
+
+ if (result == -1)
+ {
+ this->close_connection ();
+ return 0;
+ }
+
+ return result;
+}
+
+int
+TAO::SSLIOP::Connection_Handler::handle_timeout (const ACE_Time_Value &,
+ const void *)
+{
+ // We don't use this upcall for I/O. This is only used by the
+ // Connector to indicate that the connection timedout. Therefore,
+ // we should call close().
+ return this->close ();
+}
+
+int
+TAO::SSLIOP::Connection_Handler::handle_close (ACE_HANDLE,
+ ACE_Reactor_Mask)
+{
+ ACE_ASSERT (0);
+ return 0;
+}
+
+int
+TAO::SSLIOP::Connection_Handler::close (u_long)
+{
+ return this->close_handler ();
+}
+
+int
+TAO::SSLIOP::Connection_Handler::release_os_resources (void)
+{
+ return this->peer().close ();
+}
+
+void
+TAO::SSLIOP::Connection_Handler::pos_io_hook (int & return_value)
+{
+ if (return_value == 0 && ::SSL_pending (this->peer ().ssl ()))
+ return_value = 1;
+}
+
+int
+TAO::SSLIOP::Connection_Handler::add_transport_to_cache (void)
+{
+ ACE_INET_Addr addr;
+
+ // Get the peername.
+ //
+ // Note that the port set in the ACE_INET_Addr is actually the SSL
+ // port!
+ if (this->peer ().get_remote_addr (addr) == -1)
+ return -1;
+
+ // Construct an IIOP_Endpoint object
+ TAO_IIOP_Endpoint tmpoint (
+ addr,
+ this->orb_core()->orb_params()->use_dotted_decimal_addresses());
+
+ // @@ This is broken. We need to include the SecurityAssociation
+ // options to be able to truly distinguish cached SSLIOP
+ // transports.
+ const ::SSLIOP::SSL ssl =
+ {
+ 0, // target_supports
+ 0, // target_requires
+ addr.get_port_number () // port
+ };
+
+ TAO_SSLIOP_Endpoint endpoint (&ssl,
+ &tmpoint);
+
+ // Construct a property object
+ TAO_Base_Transport_Property prop (&endpoint);
+
+ TAO::Transport_Cache_Manager &cache =
+ this->orb_core ()->lane_resources ().transport_cache ();
+
+ // Add the handler to Cache
+ return cache.cache_idle_transport (&prop,
+ this->transport ());
+}
+
+int
+TAO::SSLIOP::Connection_Handler::process_listen_point_list (
+ IIOP::ListenPointList &listen_list)
+{
+ // Get the size of the list
+ const CORBA::ULong len = listen_list.length ();
+
+ for (CORBA::ULong i = 0; i < len; ++i)
+ {
+ IIOP::ListenPoint listen_point = listen_list[i];
+ ACE_INET_Addr addr (listen_point.port,
+ listen_point.host.in ());
+
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Listening port [%d] on [%s]\n",
+ listen_point.port,
+ listen_point.host.in ()));
+ }
+
+ // Construct an IIOP_Endpoint object using the host as provided
+ // in the listen point list. We must use the host in that form
+ // because that's also how the ORB on the other side will
+ // advertise the host in an IOR.
+ //
+ // Note that the port in the ACE_INET_Addr is actually the SSL
+ // port!
+ TAO_IIOP_Endpoint tmpoint (listen_point.host.in (),
+ listen_point.port,
+ addr);
+
+ // @@ This is broken. Instead of just using the default CORBA
+ // SecurityAssociation options, by not supplying SSLIOP::SSL
+ // instance in the endpoint constructor, we need to include the
+ // actual SecurityAssociation options so that the invocation to
+ // the originator is attempted with the appropriate security
+ // settings. Unfortunately, there is currently no portable way to
+ // send the SecurityAssociation options with the
+ // IIOP::ListenPointList. Presumably the new Firewall
+ // specification will address this deficiency.
+ TAO_SSLIOP_Synthetic_Endpoint endpoint (&tmpoint);
+
+ // Construct a property object
+ TAO_Base_Transport_Property prop (&endpoint);
+
+ // Mark the connection as bidirectional
+ prop.set_bidir_flag (1);
+
+ // The property for this handler has changed. Recache the
+ // handler with this property
+ const int retval = this->transport ()->recache_transport (&prop);
+ if (retval == -1)
+ return retval;
+
+ // Make the handler idle and ready for use
+ this->transport ()->make_idle ();
+ }
+
+ return 0;
+}
+
+int
+TAO::SSLIOP::Connection_Handler::setup_ssl_state (
+ TAO::SSLIOP::Current_Impl *&previous_current_impl,
+ TAO::SSLIOP::Current_Impl *new_current_impl,
+ bool &setup_done)
+{
+ // Make the SSL session state available to the SSLIOP::Current
+ // TSS object.
+ new_current_impl->ssl (this->peer ().ssl ());
+
+ // The following call is reentrant and thread-safe
+ this->current_->setup (previous_current_impl,
+ new_current_impl,
+ setup_done);
+
+ return 0;
+}
+
+void
+TAO::SSLIOP::Connection_Handler::teardown_ssl_state (
+ TAO::SSLIOP::Current_Impl *previous_current_impl,
+ bool &setup_done)
+{
+ this->current_->teardown (previous_current_impl,
+ setup_done);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h
new file mode 100644
index 00000000000..9ce3ba997af
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h
@@ -0,0 +1,202 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_Connection_Handler.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SSLIOP_CONNECTION_HANDLER_H
+#define TAO_SSLIOP_CONNECTION_HANDLER_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/SSLIOP/SSLIOP_Current.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Transport.h"
+
+#include "tao/Connection_Handler.h"
+#include "tao/IIOPC.h"
+
+#include "ace/Reactor.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_IIOP_Properties;
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+
+ /**
+ * @class Connection_Handler
+ *
+ * @brief Handles requests on a single connection.
+ *
+ * The Connection handler which is common for the Acceptor and
+ * the Connector
+ */
+ class Connection_Handler
+ : public SVC_HANDLER,
+ public TAO_Connection_Handler
+ {
+ public:
+
+ Connection_Handler (ACE_Thread_Manager* t = 0);
+
+ /// Constructor.
+ /**
+ * @param arg Parameter is used by the Acceptor to pass the
+ * protocol configuration properties for this
+ * connection.
+ */
+ Connection_Handler (TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag);
+
+ /// Destructor.
+ ~Connection_Handler (void);
+
+ /**
+ * @name Connection Handler overloads
+ *
+ * Connection Handler overloads.
+ */
+ //@{
+ virtual int open_handler (void *);
+ //@}
+
+ /// Close called by the Acceptor or Connector when connection
+ /// establishment fails.
+ int close (u_long = 0);
+
+ //@{
+ /** @name Event Handler overloads
+ */
+ virtual int resume_handler (void);
+ virtual int close_connection (void);
+ virtual int handle_input (ACE_HANDLE);
+ virtual int handle_output (ACE_HANDLE);
+ virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask);
+ virtual int handle_timeout (const ACE_Time_Value &current_time,
+ const void *act = 0);
+ virtual int open (void *);
+ //@}
+
+ /// Add ourselves to cache.
+ int add_transport_to_cache (void);
+
+ /// Process the @a listen_list.
+ int process_listen_point_list (IIOP::ListenPointList &listen_list);
+
+ /// Make the SSL session state available to the SSLIOP::Current
+ /// object.
+ int setup_ssl_state (TAO::SSLIOP::Current_Impl *&previous_current_impl,
+ TAO::SSLIOP::Current_Impl *new_current_impl,
+ bool &setup_done);
+
+ /// Teardown the SSL session state.
+ void teardown_ssl_state (
+ TAO::SSLIOP::Current_Impl *previous_current_impl,
+ bool &setup_done);
+
+ protected:
+
+ //@{
+ /**
+ * @name TAO_Connection Handler overloads
+ */
+ virtual int release_os_resources (void);
+ virtual void pos_io_hook (int & return_value);
+ //@}
+
+ protected:
+
+ /// Reference to the SSLIOP::Current object (downcast to gain
+ /// access to the low-level management methods).
+ TAO::SSLIOP::Current_var current_;
+
+ private:
+
+ /// TCP configuration for this connection.
+ TAO_IIOP_Properties *tcp_properties_;
+
+ };
+
+ // ****************************************************************
+
+ /**
+ * @class State_Guard
+ *
+ * @brief This Class that sets up TSS SSL states upon
+ * instantiation, and tears down the TSS SSL state when
+ * that instance goes out of scope.
+ *
+ * This guard is used to make TSS SSL state configuration and
+ * deconfiguration during an upcall exception safe. Exceptions
+ * are not supposed to be propagated up to the scope this guard is
+ * used in, so this guard may be unnecessary. However, since
+ * proper TSS SSL state configuration/deconfiguration is critical
+ * to proper security support, this guard is used to ensure that
+ * configuration/deconfiguration is exception safe.
+ */
+ class State_Guard
+ {
+ public:
+
+ /// Constructor that sets up the TSS SSL state.
+ State_Guard (TAO::SSLIOP::Connection_Handler *handler,
+ int &result);
+
+ /// Destructor that tears down the TSS SSL state.
+ ~State_Guard (void);
+
+ private:
+
+ /// Pointer to the connection handler currently handling the
+ /// request/upcall.
+ Connection_Handler *handler_;
+
+ /// The SSLIOP::Current implementation that was previously
+ /// associated with the current thread and invocation.
+ /**
+ * It is stored here until the invocation completes, after which it
+ * placed back into TSS.
+ */
+ Current_Impl *previous_current_impl_;
+
+ /// The SSLIOP::Current implementation to be associated with the
+ /// current invocation.
+ Current_Impl current_impl_;
+
+ /// Flag that specifies whether or not setup of the SSLIOP::Current
+ /// object completed for the current thread and invocation.
+ bool setup_done_;
+
+ };
+
+ } // End SSLIOP namespace.
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/SSLIOP/SSLIOP_Connection_Handler.i"
+#endif /* __ACE_INLINE__ */
+
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_CONNECTION_HANDLER_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.i b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.i
new file mode 100644
index 00000000000..193fc62f426
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.i
@@ -0,0 +1,29 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO::SSLIOP::State_Guard::State_Guard (
+ TAO::SSLIOP::Connection_Handler *handler,
+ int &result)
+ : handler_ (handler),
+ previous_current_impl_ (0),
+ current_impl_ (),
+ setup_done_ (false)
+{
+ // Set up the SSLIOP::Current object.
+ result = this->handler_->setup_ssl_state (this->previous_current_impl_,
+ &(this->current_impl_),
+ this->setup_done_);
+}
+
+ACE_INLINE
+TAO::SSLIOP::State_Guard::~State_Guard (void)
+{
+ this->handler_->teardown_ssl_state (this->previous_current_impl_,
+ this->setup_done_);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp
new file mode 100644
index 00000000000..3635555cb98
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp
@@ -0,0 +1,862 @@
+#include "orbsvcs/SSLIOP/SSLIOP_Connector.h"
+#include "orbsvcs/SSLIOP/SSLIOP_OwnCredentials.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Profile.h"
+#include "orbsvcs/SSLIOP/SSLIOP_X509.h"
+
+#include "orbsvcs/SecurityLevel2C.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+#include "tao/Client_Strategy_Factory.h"
+#include "tao/Environment.h"
+#include "tao/Base_Transport_Property.h"
+#include "tao/Transport_Cache_Manager.h"
+#include "tao/Thread_Lane_Resources.h"
+#include "tao/Stub.h"
+#include "tao/Transport_Connector.h"
+#include "tao/Blocked_Connect_Strategy.h"
+#include "tao/Wait_Strategy.h"
+#include "tao/Profile_Transport_Resolver.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/os_include/os_netdb.h"
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_Connector,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SSLIOP::Connector::Connector (::Security::QOP qop)
+ : TAO::IIOP_SSL_Connector (),
+ qop_ (qop),
+ connect_strategy_ (),
+ base_connector_ ()
+{
+}
+
+int
+TAO::SSLIOP::Connector::open (TAO_ORB_Core *orb_core)
+{
+ // Since the ACE_Strategy_Connector (and ACE_Connector) cannot
+ // handle non-blocking connections with protocols that have more
+ // than one handshake, such as SSL, force blocking connections for
+ // SSLIOP. This deficiency will be addressed soon.
+ ACE_NEW_RETURN (this->active_connect_strategy_,
+ TAO_Blocked_Connect_Strategy (orb_core),
+ -1);
+
+ if (this->TAO::IIOP_SSL_Connector::open (orb_core) == -1)
+ return -1;
+
+ // Our connect creation strategy
+ CONNECT_CREATION_STRATEGY *connect_creation_strategy = 0;
+
+ ACE_NEW_RETURN (connect_creation_strategy,
+ CONNECT_CREATION_STRATEGY
+ (orb_core->thr_mgr (),
+ orb_core,
+ 0 /* Forcibly disable TAO's GIOPlite feature.
+ It introduces a security hole. */),
+ -1);
+
+ // Our activation strategy
+ CONNECT_CONCURRENCY_STRATEGY *concurrency_strategy = 0;
+
+ ACE_NEW_RETURN (concurrency_strategy,
+ CONNECT_CONCURRENCY_STRATEGY (orb_core),
+ -1);
+
+ ACE_Reactor *r = this->orb_core ()->reactor ();
+
+ return this->base_connector_.open (r,
+ connect_creation_strategy,
+ &this->connect_strategy_,
+ concurrency_strategy);
+}
+
+int
+TAO::SSLIOP::Connector::close (void)
+{
+ (void) this->TAO::IIOP_SSL_Connector::close ();
+
+ delete this->base_connector_.creation_strategy ();
+ delete this->base_connector_.concurrency_strategy ();
+ return this->base_connector_.close ();
+}
+
+TAO_Transport *
+TAO::SSLIOP::Connector::connect (TAO::Profile_Transport_Resolver *resolver,
+ TAO_Transport_Descriptor_Interface *desc,
+ ACE_Time_Value *timeout
+ ACE_ENV_ARG_DECL)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Connector::connect, ")
+ ACE_TEXT ("looking for SSLIOP connection.\n")));
+
+ TAO_Endpoint *endpoint = desc->endpoint ();
+
+ if (endpoint->tag () != IOP::TAG_INTERNET_IOP)
+ return 0;
+
+ TAO_SSLIOP_Endpoint *ssl_endpoint =
+ dynamic_cast<TAO_SSLIOP_Endpoint *> (endpoint);
+
+ if (ssl_endpoint == 0)
+ return 0;
+
+ // @@ TODO: The EstablishTrust policy should be evaluated once per
+ // connection, not once per invocation. This should
+ // improve performance.
+ //
+ // Check if the user overrode the default establishment of trust
+ // policy for the current object.
+ CORBA::Policy_var policy =
+ resolver->stub ()->get_policy (::Security::SecEstablishTrustPolicy
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ SecurityLevel2::EstablishTrustPolicy_var trust_policy =
+ SecurityLevel2::EstablishTrustPolicy::_narrow (policy.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // We use a pointer and temporary to make it obvious to determine
+ // if no establishment of trust policy was set. Specifically, if
+ // the "trust" pointer below is zero, then the SSLIOP pluggable
+ // protocol default value will be used.
+ ::Security::EstablishTrust trust = { 0 , 0 };
+ if (!CORBA::is_nil (trust_policy.in ()))
+ {
+ trust = trust_policy->trust (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ // Flag that states whether any form of establishment of trust
+ // should occur.
+ CORBA::Boolean const establish_trust =
+ trust.trust_in_target || trust.trust_in_client;
+
+ // @@ Should this be in a "policy validator?"
+ //
+ // If the SSL port is zero, then no SSLIOP tagged component was
+ // available in the IOR, meaning that there is no way to establish
+ // trust. Throw an exception.
+ if (ssl_endpoint->ssl_component ().port == 0
+ && establish_trust)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO_SSLIOP (%P|%t) ERROR: ")
+ ACE_TEXT ("Cannot establish trust since ")
+ ACE_TEXT ("no SSLIOP tagged component was ")
+ ACE_TEXT ("found in the IOR.\n")));
+ }
+
+ ACE_THROW_RETURN (CORBA::INV_POLICY (), // @@ Correct exception?
+ 0);
+ }
+
+ // Check if the user overrode the default Quality-of-Protection for
+ // the current object.
+ policy = resolver->stub ()->get_policy (::Security::SecQOPPolicy
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ SecurityLevel2::QOPPolicy_var qop_policy =
+ SecurityLevel2::QOPPolicy::_narrow (policy.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Temporary variable used to avoid overwriting the default value
+ // set when the ORB was initialized.
+ ::Security::QOP qop = this->qop_;
+
+ if (!CORBA::is_nil (qop_policy.in ()))
+ {
+ qop = qop_policy->qop (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ // If the SSL port is zero, then no SSLIOP tagged component was
+ // available in the IOR, meaning that there is no way to make a
+ // secure invocation. Throw an exception.
+ if (qop != ::Security::SecQOPNoProtection
+ && ssl_endpoint->ssl_component ().port == 0)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO_SSLIOP (%P|%t) ERROR: ")
+ ACE_TEXT ("Cannot make secure invocation since ")
+ ACE_TEXT ("no SSLIOP tagged component was ")
+ ACE_TEXT ("found in the IOR.\n")));
+ }
+
+ ACE_THROW_RETURN (CORBA::INV_POLICY (), // @@ Correct exception?
+ 0);
+ }
+
+ if ((!establish_trust && qop == ::Security::SecQOPNoProtection)
+ || ssl_endpoint->ssl_component ().port == 0)
+ {
+ return this->iiop_connect (ssl_endpoint,
+ resolver,
+ timeout
+ ACE_ENV_ARG_PARAMETER);
+ }
+
+ return this->ssliop_connect (ssl_endpoint,
+ qop,
+ trust,
+ resolver,
+ desc,
+ timeout
+ ACE_ENV_ARG_PARAMETER);
+}
+
+
+TAO_Profile *
+TAO::SSLIOP::Connector::create_profile (TAO_InputCDR& cdr)
+{
+ TAO_Profile *pfile = 0;
+ ACE_NEW_RETURN (pfile,
+ TAO_SSLIOP_Profile (this->orb_core ()),
+ 0);
+
+ const int r = pfile->decode (cdr);
+ if (r == -1)
+ {
+ pfile->_decr_refcnt ();
+ pfile = 0;
+ }
+
+ return pfile;
+}
+
+TAO_Profile *
+TAO::SSLIOP::Connector::make_profile (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // The endpoint should be of the form:
+ // N.n@host:port/object_key
+ // or:
+ // host:port/object_key
+
+ TAO_Profile *profile = 0;
+ ACE_NEW_THROW_EX (profile,
+ TAO_SSLIOP_Profile (this->orb_core (),
+ 0), // SSL component
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ return profile;
+}
+
+
+TAO_Profile *
+TAO::SSLIOP::Connector::make_secure_profile (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // The endpoint should be of the form:
+ // N.n@host:port/object_key
+ // or:
+ // host:port/object_key
+
+ TAO_Profile *profile = 0;
+ ACE_NEW_THROW_EX (profile,
+ TAO_SSLIOP_Profile (this->orb_core (),
+ 1), // SSL component
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ return profile;
+}
+
+
+
+TAO_Profile *
+TAO::SSLIOP::Connector::corbaloc_scan (const char *endpoint,
+ size_t &len
+ ACE_ENV_ARG_DECL)
+{
+ int ssl_only = 0;
+ if (this->check_prefix (endpoint) == 0)
+ {
+ ssl_only = 1;
+ }
+ else
+ {
+ if (this->TAO_IIOP_Connector::check_prefix (endpoint) != 0)
+ return 0;
+ }
+
+ // Determine the (first in a list of possibly > 1) endpoint address
+ const char *comma_pos = ACE_OS::strchr (endpoint,',');
+ const char *slash_pos = ACE_OS::strchr (endpoint,'/');
+ if (comma_pos == 0 && slash_pos == 0)
+ {
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("(%P|%t) SSLIOP_Connector::corbaloc_scan warning: ")
+ ACE_TEXT("supplied string contains no comma or slash: %s\n"),
+ endpoint));
+ }
+ len = ACE_OS::strlen (endpoint);
+ }
+ else if (slash_pos != 0 || comma_pos > slash_pos)
+ {
+ // The endpoint address does not extend past the first '/' or ','
+ len = slash_pos - endpoint;
+ }
+ else
+ {
+ len = comma_pos - endpoint;
+ }
+
+ //Create the corresponding profile
+ TAO_Profile *ptmp = 0;
+ if (ssl_only)
+ {
+ ptmp = this->make_secure_profile (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+ else
+ {
+ ptmp = this->make_profile (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return ptmp;
+}
+
+
+int
+TAO::SSLIOP::Connector::check_prefix (const char *endpoint)
+{
+ // Check for a valid string
+ if (!endpoint || !*endpoint) return -1; // Failure
+
+ const char *protocol[] = { "ssliop", "sslioploc" };
+
+ size_t first_slot = ACE_OS::strchr (endpoint, ':') - endpoint;
+
+ size_t len0 = ACE_OS::strlen (protocol[0]);
+ size_t len1 = ACE_OS::strlen (protocol[1]);
+
+ // Check for the proper prefix in the IOR. If the proper prefix
+ // isn't in the IOR then it is not an IOR we can use.
+ if (first_slot == len0 && ACE_OS::strncmp (endpoint, protocol[0], len0) == 0)
+ return 0;
+
+ if (first_slot == len1 && ACE_OS::strncmp (endpoint, protocol[1], len1) == 0)
+ return 0;
+
+ // Failure: not an SSLIOP IOR
+ // DO NOT throw an exception here.
+ return -1;
+}
+
+
+TAO_Transport*
+TAO::SSLIOP::Connector::iiop_connect (
+ TAO_SSLIOP_Endpoint *ssl_endpoint,
+ TAO::Profile_Transport_Resolver *resolver,
+ ACE_Time_Value *timeout
+ ACE_ENV_ARG_DECL)
+{
+ const ::SSLIOP::SSL &ssl_component = ssl_endpoint->ssl_component ();
+
+ // Only allow connection to the insecure IIOP port if the endpoint
+ // explicitly allows it, i.e. if the Security::NoProtection security
+ // association bit is set in the SSLIOP::SSL::target_supports field.
+ // The server performs the same permission check, so this check is
+ // an optimization since a connection will not be established
+ // needlessly, i.e. rejected due to lack of permission.
+ //
+ // Note that it is still possible for the standard non-SSLIOP aware
+ // IIOP pluggable protocol to attempt to connect to the insecure
+ // port. In that case, the server will have to prevent the
+ // connection, and subsequently the request, from completing.
+ if (ACE_BIT_DISABLED (ssl_component.target_supports,
+ ::Security::NoProtection))
+ ACE_THROW_RETURN (CORBA::NO_PERMISSION (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EPERM),
+ CORBA::COMPLETED_NO),
+ 0);
+
+ TAO_IIOP_Endpoint *iiop_endpoint = ssl_endpoint->iiop_endpoint ();
+
+ // An IIOP-only transport descriptor must be used instead of the one
+ // passed to this method since the latter is used for SSLIOP
+ // connections. Doing so prevents an IIOP-only cached transport
+ // from being associated with an SSLIOP connection.
+ TAO_Base_Transport_Property iiop_desc (iiop_endpoint);
+
+ // Note that the IIOP-only transport descriptor is used!
+ return
+ this->TAO::IIOP_SSL_Connector::connect (
+ resolver,
+ &iiop_desc,
+ timeout
+ ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_Transport *
+TAO::SSLIOP::Connector::ssliop_connect (
+ TAO_SSLIOP_Endpoint *ssl_endpoint,
+ ::Security::QOP qop,
+ const ::Security::EstablishTrust &trust,
+ TAO::Profile_Transport_Resolver *resolver,
+ TAO_Transport_Descriptor_Interface *desc,
+ ACE_Time_Value *max_wait_time
+ ACE_ENV_ARG_DECL)
+{
+ const ::SSLIOP::SSL &ssl_component = ssl_endpoint->ssl_component ();
+
+ // @@ The following check for "required insecurity" seems odd, but
+ // I haven't seen anything in the Security spec that says this
+ // policy isn't possible.
+ // -Ossama
+
+ // If the endpoint requires an insecure connection, i.e. the
+ // Security::NoProtection security association bit in the
+ // SSLIOP::SSL::target_requires field is enabled, then prevent an
+ // SSL connection from occuring.
+ if (ACE_BIT_ENABLED (ssl_component.target_requires,
+ ::Security::NoProtection))
+ ACE_THROW_RETURN (CORBA::NO_PERMISSION (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EPERM),
+ CORBA::COMPLETED_NO),
+ 0);
+
+ // If the invocation wants integrity without confidentiality but the
+ // server does not support "no protection," then it won't be
+ // possible to provide integrity. In order to support integrity
+ // without confidentiality, encryption must be disabled but secure
+ // hashes must remain enabled. This is achieved using the "eNULL"
+ // cipher. However, the "eNULL" cipher is only enabled on the
+ // server side if "no protection" is enabled.
+ if (ACE_BIT_DISABLED (ssl_component.target_supports,
+ ::Security::NoProtection)
+ && qop == ::Security::SecQOPIntegrity)
+ ACE_THROW_RETURN (CORBA::INV_POLICY (), 0);
+
+ const ACE_INET_Addr &remote_address =
+ ssl_endpoint->object_addr ();
+
+ // Verify that the remote ACE_INET_Addr was initialized
+ // properly. Failure can occur if hostname lookup failed when
+ // initializing the remote ACE_INET_Addr.
+ if (remote_address.get_type () != AF_INET)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) SSLIOP connection failed.\n")
+ ACE_TEXT ("TAO (%P|%t) This is most likely ")
+ ACE_TEXT ("due to a hostname lookup ")
+ ACE_TEXT ("failure.\n")));
+ }
+
+ return 0;
+ }
+
+ int result = 0;
+ TAO::SSLIOP::Connection_Handler *svc_handler = 0;
+ TAO_Transport *transport = 0;
+
+ // Before we can check the cache to find an existing connection, we
+ // need to make sure the ssl_endpoint is fully initialized with the
+ // local security information. This endpoint initalized by the
+ // profile does not (and cannot) contain the desired QOP, trust, or
+ // credential information which is necesary to uniquely identify
+ // this connection.
+ if (!ssl_endpoint->credentials_set ())
+ {
+ if (TAO_debug_level > 2)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Initializing SSLIOP_Endpoint \n")
+ ));
+
+ if (this->base_connector_.creation_strategy ()->make_svc_handler (
+ svc_handler) != 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Unable to create SSLIOP ")
+ ACE_TEXT ("service handler.\n")));
+
+ return 0;
+ }
+
+ ACE_Auto_Basic_Ptr<TAO::SSLIOP::Connection_Handler>
+ safe_handler (svc_handler);
+ TAO::SSLIOP::OwnCredentials_var credentials =
+ this->retrieve_credentials (resolver->stub (),
+ svc_handler->peer ().ssl ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ svc_handler = safe_handler.release ();
+ ssl_endpoint->set_sec_attrs (qop, trust, credentials.in());
+ }
+
+ // Check the Cache first for connections
+ if (this->orb_core ()->lane_resources ().transport_cache ().find_transport (
+ desc,
+ transport) == 0)
+ {
+ if (TAO_debug_level > 2)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - SSLIOP_Connector::ssliop_connect, ")
+ ACE_TEXT ("got existing transport[%d]\n"),
+ transport->id ()));
+
+ // When the transport is not connected wait for completion
+ if (!transport->is_connected())
+ {
+ if (!this->wait_for_connection_completion (resolver,
+ transport,
+ max_wait_time))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - SSLIOP_Connector::ssliop_connect,")
+ ACE_TEXT ("wait for completion failed\n")));
+
+ }
+ }
+ }
+ else
+ {
+ if (TAO_debug_level > 4)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - SSLIOP_Connector::ssliop_connect, ")
+ ACE_TEXT ("making a new connection \n")));
+
+ // Purge connections (if necessary)
+ this->orb_core ()->lane_resources ().transport_cache ().purge ();
+
+ // The svc_handler is created beforehand so that we can get
+ // access to the underlying ACE_SSL_SOCK_Stream (the peer) and
+ // its SSL pointer member prior to descending into the
+ // ACE_Strategy_Connector (the "base_connector_"). This is
+ // thread-safe and reentrant, hence no synchronization is
+ // necessary.
+ //
+ // The make_svc_handler() method creates the service handler and
+ // bumps the #REFCOUNT# up one extra. The extra reference count
+ // in TAO_Connect_Creation_Strategy::make_svc_handler() is
+ // needed in the case when connection completion is pending and
+ // we are going to wait on a variable in the handler to changes,
+ // signifying success or failure. Note, that this increment
+ // cannot be done once the connect() returns since this might be
+ // too late if another thread pick up the completion and
+ // potentially deletes the handler before we get a chance to
+ // increment the reference count.
+ if (svc_handler == 0 &&
+ this->base_connector_.creation_strategy ()->make_svc_handler (
+ svc_handler) != 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Unable to create SSLIOP ")
+ ACE_TEXT ("service handler.\n")));
+
+ return 0;
+ }
+
+ ACE_Auto_Basic_Ptr<TAO::SSLIOP::Connection_Handler>
+ safe_handler (svc_handler);
+
+ // Setup the establishment of trust connection properties, if
+ // any.
+ int verify_mode = 0;
+
+ // On the server side, "trust_in_client" requires that a peer
+ // (client) certificate exist. Fail if one doesn't exist.
+ //
+ // In SSLIOP's case, trust_in_client also implies
+ // trust_in_target.
+ if (trust.trust_in_client)
+ verify_mode = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
+
+ // Require verification of the target's certificate.
+ else if (trust.trust_in_target)
+ verify_mode = SSL_VERIFY_PEER;
+
+ // Trust in neither the client nor the target is explicitly
+ // specified. Use the default setting.
+ else
+ verify_mode =
+ ACE_SSL_Context::instance ()->default_verify_mode ();
+
+ ::SSL_set_verify (svc_handler->peer ().ssl (),
+ verify_mode,
+ 0);
+
+ // The "eNULL" cipher disables encryption but still uses a
+ // secure hash (e.g. SHA1 or MD5) to ensure integrity. (Try the
+ // command "openssl ciphers -v eNULL".)
+ //
+ // Note that it is not possible to completely disable protection
+ // here.
+ if ((qop == ::Security::SecQOPNoProtection
+ || qop == ::Security::SecQOPIntegrity)
+ && ::SSL_set_cipher_list (svc_handler->peer ().ssl (),
+ "eNULL") == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Unable to set eNULL ")
+ ACE_TEXT ("SSL cipher.\n")));
+
+ ACE_THROW_RETURN (CORBA::INV_POLICY (), 0);
+ }
+
+ svc_handler = safe_handler.release ();
+
+ // Get the right synch options
+ ACE_Synch_Options synch_options;
+
+ this->active_connect_strategy_->synch_options (max_wait_time,
+ synch_options);
+
+ // If we don't need to block for a transport just set the timeout to
+ // be zero.
+ ACE_Time_Value tmp_zero (ACE_Time_Value::zero);
+ if (!resolver->blocked_connect ())
+ {
+ synch_options.timeout (ACE_Time_Value::zero);
+ max_wait_time = &tmp_zero;
+ }
+
+ // We obtain the transport in the <svc_handler> variable. As we
+ // know now that the connection is not available in Cache we can
+ // make a new connection
+ result = this->base_connector_.connect (svc_handler,
+ remote_address,
+ synch_options);
+
+ // There are three possibilities from calling connect(): (a)
+ // connection succeeds immediately - in this case, the
+ // #REFCOUNT# on the handler is two; (b) connection completion
+ // is pending - in this case, the #REFCOUNT# on the handler is
+ // also two; (c) connection fails immediately - in this case,
+ // the #REFCOUNT# on the handler is one since close() gets
+ // called on the handler.
+
+ // Make sure that we always do a remove_reference
+ ACE_Event_Handler_var svc_handler_auto_ptr (svc_handler);
+
+ transport =
+ svc_handler->transport ();
+
+ if (result == -1)
+ {
+ // No immediate result, wait for completion
+ if (errno == EWOULDBLOCK)
+ {
+ // Try to wait until connection completion. Incase we block, then we
+ // get a connected transport or not. In case of non block we get
+ // a connected or not connected transport
+ if (!this->wait_for_connection_completion (resolver,
+ transport,
+ max_wait_time))
+ {
+ if (TAO_debug_level > 2)
+ ACE_ERROR ((LM_ERROR, "TAO (%P|%t) - SSLIOP_Connector::"
+ "ssliop_connect, "
+ "wait for completion failed\n"));
+ }
+ }
+ else
+ {
+ // Transport is not usable
+ transport = 0;
+ }
+ }
+
+ // In case of errors transport is zero
+ if (transport == 0)
+ {
+ // Give users a clue to the problem.
+ if (TAO_debug_level)
+ {
+ char buffer [MAXHOSTNAMELEN + 6 + 1];
+ ssl_endpoint->addr_to_string (buffer,
+ sizeof (buffer) - 1);
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - SSL connection to ")
+ ACE_TEXT ("<%s:%d> failed (%p)\n"),
+ buffer,
+ remote_address.get_port_number (),
+ ACE_TEXT ("errno")));
+ }
+
+ return 0;
+ }
+
+ // At this point, the connection has be successfully connected.
+ // #REFCOUNT# is one.
+ if (TAO_debug_level > 2)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - SSLIOP_Connector::ssliop_connect, "
+ "new SSL connection to port %d on transport[%d]\n",
+ remote_address.get_port_number (),
+ svc_handler->peer ().get_handle ()));
+
+ // Add the handler to Cache
+ int retval =
+ this->orb_core ()->
+ lane_resources ().transport_cache ().cache_transport (desc,
+ transport);
+
+ // Failure in adding to cache.
+ if (retval != 0)
+ {
+ // Close the handler.
+ svc_handler->close ();
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "TAO (%P|%t) - SLIIOP_Connector::ssliop_connect, "
+ "could not add the new connection to cache\n"));
+ }
+
+ return 0;
+ }
+
+ if (transport->is_connected () &&
+ transport->wait_strategy ()->register_handler () != 0)
+ {
+ // Registration failures.
+
+ // Purge from the connection cache, if we are not in the cache, this
+ // just does nothing.
+ (void) transport->purge_entry ();
+
+ // Close the handler.
+ (void) transport->close_connection ();
+
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "TAO (%P|%t) - SSLIOP_Connector [%d]::ssliop_connect, "
+ "could not register the transport "
+ "in the reactor.\n",
+ transport->id ()));
+
+ return 0;
+ }
+ }
+
+ return transport;
+}
+
+TAO::SSLIOP::OwnCredentials *
+TAO::SSLIOP::Connector::retrieve_credentials (TAO_Stub *stub,
+ SSL *ssl
+ ACE_ENV_ARG_DECL)
+{
+ // Check if the user overrode the default invocation credentials.
+ CORBA::Policy_var policy =
+ stub->get_policy (::SecurityLevel3::ContextEstablishmentPolicyType
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (TAO::SSLIOP::OwnCredentials::_nil ());
+
+ SecurityLevel3::ContextEstablishmentPolicy_var creds_policy =
+ SecurityLevel3::ContextEstablishmentPolicy::_narrow (
+ policy.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (TAO::SSLIOP::OwnCredentials::_nil ());
+
+ TAO::SSLIOP::OwnCredentials_var ssliop_credentials;
+
+ // Set the Credentials (X.509 certificates and corresponding private
+ // keys) to be used for this invocation.
+ if (!CORBA::is_nil (creds_policy.in ()))
+ {
+ SecurityLevel3::OwnCredentialsList_var creds_list =
+ creds_policy->creds_list (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (TAO::SSLIOP::OwnCredentials::_nil ());
+
+ if (creds_list->length () > 0)
+ {
+ // Assume that we've got an SSLIOP credential.
+ SecurityLevel3::Credentials_ptr credentials =
+ creds_list[0u];
+
+ ssliop_credentials =
+ TAO::SSLIOP::OwnCredentials::_narrow (credentials
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (TAO::SSLIOP::OwnCredentials::_nil ());
+
+ if (!CORBA::is_nil (ssliop_credentials.in ()))
+ {
+ TAO::SSLIOP::X509_var x509 = ssliop_credentials->x509 ();
+ if (::SSL_use_certificate (ssl, x509.in ()) != 1)
+ return TAO::SSLIOP::OwnCredentials::_nil ();
+
+ TAO::SSLIOP::EVP_PKEY_var evp = ssliop_credentials->evp ();
+ if (evp.in () != 0
+ && ::SSL_use_PrivateKey (ssl, evp.in ()) != 1)
+ {
+ // Invalidate the certificate we just set.
+ (void) ::SSL_use_certificate (ssl, 0);
+ return TAO::SSLIOP::OwnCredentials::_nil ();
+ }
+ }
+ }
+ }
+ else
+ {
+ // Use the default certificate and private key, i.e. the one set
+ // in the SSL_CTX that was used when creating the SSL data
+ // structure.
+
+ /**
+ * @todo Check if the CredentialsCurator contains a default set
+ * of SSLIOP OwnCredentials.
+ */
+
+ TAO::SSLIOP::OwnCredentials_ptr & c = ssliop_credentials.out ();
+ ACE_NEW_THROW_EX (c,
+ TAO::SSLIOP::OwnCredentials (
+ ::SSL_get_certificate (ssl),
+ ::SSL_get_privatekey (ssl)),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (TAO::SSLIOP::OwnCredentials::_nil ());
+ }
+
+ return ssliop_credentials._retn ();
+}
+
+int
+TAO::SSLIOP::Connector::cancel_svc_handler (
+ TAO_Connection_Handler * svc_handler)
+{
+ TAO::SSLIOP::Connection_Handler* handler=
+ dynamic_cast<TAO::SSLIOP::Connection_Handler*> (svc_handler);
+
+ if (handler)
+ // Cancel from the connector
+ return this->base_connector_.cancel (handler);
+
+ return -1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h
new file mode 100644
index 00000000000..99578662196
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h
@@ -0,0 +1,162 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_Connector.h
+ *
+ * $Id$
+ *
+ * SSLIOP specific connector processing
+ *
+ * @author Carlos O'Ryan
+ * @author Ossama Othman
+ */
+//=============================================================================
+
+
+#ifndef TAO_SSLIOP_CONNECTOR_H
+#define TAO_SSLIOP_CONNECTOR_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/SSLIOP/IIOP_SSL_Connector.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h"
+
+#include "ace/SSL/SSL_SOCK_Connector.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Forward declarations.
+class TAO_Base_Transport_Property;
+
+class TAO_SSLIOP_Endpoint;
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+ class OwnCredentials;
+
+ /**
+ * @class Connector
+ *
+ * @brief SSLIOP-specific Connector bridge for pluggable protocols.
+ *
+ * Concrete instance of the TAO_Connector class. Responsible
+ * for establishing a connection with a server and is called from
+ * the Connector_Registry.
+ */
+ class Connector : public TAO::IIOP_SSL_Connector
+ {
+ public:
+
+ /// Constructor.
+ Connector (::Security::QOP qop);
+
+ /**
+ * @name The TAO_Connector methods
+ *
+ * Please check the documentation in Transport_Connector.h
+ */
+ //@{
+ virtual int open (TAO_ORB_Core *orb_core);
+ virtual int close (void);
+ virtual TAO_Transport *connect (TAO::Profile_Transport_Resolver *r,
+ TAO_Transport_Descriptor_Interface *desc,
+ ACE_Time_Value *timeout
+ ACE_ENV_ARG_DECL);
+
+ virtual TAO_Profile *create_profile (TAO_InputCDR& cdr);
+ virtual int check_prefix (const char *endpoint);
+ virtual TAO_Profile * corbaloc_scan (const char *ior,
+ size_t &len
+ ACE_ENV_ARG_DECL);
+
+ //@}
+
+ protected:
+
+ /**
+ * @name @c TAO_Connector Methods
+ *
+ * Methods required by the @c TAO_Connector base class.
+ *
+ * @see @c TAO_Connector
+ */
+ //@{
+ virtual TAO_Profile * make_profile (ACE_ENV_SINGLE_ARG_DECL);
+ virtual int cancel_svc_handler (TAO_Connection_Handler * svc_handler);
+ //@}
+
+ /// SSL-specific profile
+ TAO_Profile * make_secure_profile (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// IIOP-specific connection establishment.
+ /**
+ * @note The IIOP endpoint is extracted from the SSLIOP endpoint.
+ */
+ TAO_Transport* iiop_connect (TAO_SSLIOP_Endpoint *ssliop_endpoint,
+ TAO::Profile_Transport_Resolver *r,
+ ACE_Time_Value *timeout
+ ACE_ENV_ARG_DECL);
+
+ /// SSLIOP-specific connection establishment.
+ TAO_Transport* ssliop_connect (TAO_SSLIOP_Endpoint *ssliop_endpoint,
+ ::Security::QOP qop,
+ const ::Security::EstablishTrust &trust,
+ TAO::Profile_Transport_Resolver *r,
+ TAO_Transport_Descriptor_Interface *desc,
+ ACE_Time_Value *timeout
+ ACE_ENV_ARG_DECL);
+
+ /// Retrieve SSLIOP credentials from the policy overrides list
+ /// and set up the underlying SSL connection to use the X.509
+ /// certificates stored within them.
+ TAO::SSLIOP::OwnCredentials * retrieve_credentials (TAO_Stub *stub,
+ SSL *ssl
+ ACE_ENV_ARG_DECL);
+
+ public:
+
+ typedef TAO_Connect_Concurrency_Strategy<Connection_Handler>
+ CONNECT_CONCURRENCY_STRATEGY;
+
+ typedef TAO_Connect_Creation_Strategy<Connection_Handler>
+ CONNECT_CREATION_STRATEGY;
+
+ typedef ACE_Connect_Strategy<Connection_Handler,
+ ACE_SSL_SOCK_CONNECTOR>
+ CONNECT_STRATEGY;
+
+ typedef ACE_Strategy_Connector<Connection_Handler,
+ ACE_SSL_SOCK_CONNECTOR>
+ BASE_CONNECTOR;
+
+ private:
+
+ /// If zero, connect to IIOP over SSL port by default.
+ /// Otherwise, connect to the insecure IIOP port.
+ ::Security::QOP qop_;
+
+ /// Our connect strategy
+ CONNECT_STRATEGY connect_strategy_;
+
+ /// The connector initiating connection requests for IIOP.
+ BASE_CONNECTOR base_connector_;
+
+ };
+
+ } // End SSLIOP namespace.
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_CONNECTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.cpp
new file mode 100644
index 00000000000..9f8804ad604
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.cpp
@@ -0,0 +1,267 @@
+#include "orbsvcs/SSLIOP/SSLIOP_Credentials.h"
+
+#include "tao/ORB_Constants.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_Credentials,
+ "$Id$")
+
+
+#if !defined (__ACE_INLINE__)
+# include "orbsvcs/SSLIOP/SSLIOP_Credentials.inl"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SSLIOP_Credentials::SSLIOP_Credentials (::X509 *cert, ::EVP_PKEY *evp)
+ : x509_ (TAO::SSLIOP::OpenSSL_traits< ::X509 >::_duplicate (cert)),
+ evp_ (TAO::SSLIOP::OpenSSL_traits< ::EVP_PKEY >::_duplicate (evp)),
+ id_ (),
+ creds_usage_ (SecurityLevel3::CU_Indefinite),
+ expiry_time_ (),
+ creds_state_ (SecurityLevel3::CS_Invalid)
+{
+ ::X509 *x = cert;
+
+ if (x != 0)
+ {
+ // We use the X.509 certificate's serial number as the
+ // credentials Id.
+ BIGNUM * bn = ASN1_INTEGER_to_BN (::X509_get_serialNumber (x), 0);
+ if (BN_is_zero (bn))
+ this->id_ = CORBA::string_dup ("X509: 00");
+ else
+ {
+ char * id = BN_bn2hex (bn);
+
+ ACE_CString s =
+ ACE_CString ("X509: ")
+ + ACE_CString (const_cast<const char *> (id));
+
+ this->id_ = CORBA::string_dup (s.c_str ());
+
+#ifdef OPENSSL_free
+ OPENSSL_free (id);
+#else
+ // Older versions of OpenSSL didn't define the OpenSSL
+ // macro.
+ CRYPTO_free (id);
+#endif /* OPENSSL_free */
+ }
+
+ // -------------------------------------------
+
+ TimeBase::UtcT & t = this->expiry_time_;
+
+ const ASN1_TIME * exp = X509_get_notAfter (x);
+
+ if (exp->length > ACE_SIZEOF_LONG_LONG)
+ {
+ // @@ Will this ever happen?
+
+ // Overflow!
+ t.time = ACE_UINT64_LITERAL (0xffffffffffffffff);
+ }
+ else
+ {
+ t.time = 0;
+ for (int i = 0; i < exp->length; ++i)
+ {
+ t.time <<= 8;
+ t.time |= (unsigned char) exp->data[i];
+ }
+ }
+ }
+}
+
+TAO::SSLIOP_Credentials::~SSLIOP_Credentials (void)
+{
+}
+
+char *
+TAO::SSLIOP_Credentials::creds_id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup (this->id_.in ());
+}
+
+SecurityLevel3::CredentialsUsage
+TAO::SSLIOP_Credentials::creds_usage (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return SecurityLevel3::CU_Indefinite;
+}
+
+TimeBase::UtcT
+TAO::SSLIOP_Credentials::expiry_time (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->expiry_time_;
+}
+
+SecurityLevel3::CredentialsState
+TAO::SSLIOP_Credentials::creds_state (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ const ::X509 *x = this->x509_.in ();
+
+ // The pointer to the underlying X509 structure should only be zero
+ // if destroy() was called on this Credentials object.
+ if (x == 0)
+ ACE_THROW_RETURN (CORBA::BAD_OPERATION (),
+ SecurityLevel3::CS_Invalid);
+
+ if (this->creds_state_ == SecurityLevel3::CS_Valid)
+ {
+ // Make sure the X.509 certificate is still valid.
+
+ const int after_status =
+ ::X509_cmp_current_time (X509_get_notAfter (x));
+
+ if (after_status == 0)
+ {
+ // Error in certificate's "not after" field.
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), // @@ Correct exception?
+ SecurityLevel3::CS_Invalid);
+ }
+ else if (after_status > 0) // Certificate has expired.
+ this->creds_state_ = SecurityLevel3::CS_Expired;
+ }
+ else if (this->creds_state_ == SecurityLevel3::CS_Invalid)
+ {
+ // Check if the X.509 certificate has become valid.
+
+ const int before_status =
+ ::X509_cmp_current_time (X509_get_notBefore (x));
+
+ if (before_status == 0)
+ {
+ // Error in certificate's "not before" field.
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), // @@ Correct exception?
+ SecurityLevel3::CS_Invalid);
+ }
+ else if (before_status < 0) // Certificate is now valid.
+ this->creds_state_ = SecurityLevel3::CS_Valid;
+ }
+
+ return this->creds_state_;
+}
+
+char *
+TAO::SSLIOP_Credentials::add_relinquished_listener (
+ SecurityLevel3::RelinquishedCredentialsListener_ptr /* listener */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+void
+TAO::SSLIOP_Credentials::remove_relinquished_listener (const char * /* id */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+bool
+TAO::SSLIOP_Credentials::operator== (const TAO::SSLIOP_Credentials &rhs)
+{
+ ::X509 * xa = this->x509_.in ();
+ ::X509 * xb = rhs.x509_.in ();
+ // EVP_PKEY *ea = this->evp_.in ();
+ // EVP_PKEY *eb = rhs.evp_.in ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ // No need for a full blown ACE_TRY/CATCH block.
+
+ const SecurityLevel3::CredentialsType lct =
+ this->creds_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (false);
+
+ const SecurityLevel3::CredentialsType rct =
+ const_cast<TAO::SSLIOP_Credentials &> (rhs).creds_type (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (false);
+
+ // Don't bother check the creds_id and expiry_time attributes. They
+ // are checked implicitly by the below X509_cmp() call.
+ //
+ // Additionally, the creds_state attribute is not included in the
+ // check since it is not considered important when distinguishing
+ // between two Credentials.
+
+ return
+ lct == rct
+ && this->creds_usage_ == rhs.creds_usage_
+ && ((xa == xb) || (xa != 0 && xb != 0 && ::X509_cmp (xa, xb) == 0))
+// && ((ea == eb) || (ea != 0 && eb != 0 && ::EVP_PKEY_cmp (ea, eb) == 0))
+ ;
+}
+
+CORBA::ULong
+TAO::SSLIOP_Credentials::hash (void) const
+{
+ ::X509 * x509 = this->x509_.in ();
+
+ return (x509 == 0 ? 0 : ::X509_issuer_name_hash (x509));
+}
+
+TAO::SSLIOP::Credentials_ptr
+TAO::SSLIOP_Credentials::_narrow (CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return TAO::SSLIOP_Credentials::_duplicate (
+ dynamic_cast<TAO::SSLIOP_Credentials *> (obj));
+}
+
+TAO::SSLIOP::Credentials_ptr
+TAO::SSLIOP_Credentials::_duplicate (TAO::SSLIOP::Credentials_ptr obj)
+{
+ if (!CORBA::is_nil (obj))
+ obj->_add_ref ();
+
+ return obj;
+}
+
+// -----------------------------------------------------------
+
+TAO::SSLIOP::Credentials_ptr
+tao_TAO_SSLIOP_Credentials_duplicate (TAO::SSLIOP::Credentials_ptr p)
+{
+ return TAO::SSLIOP_Credentials::_duplicate (p);
+}
+
+void
+tao_TAO_SSLIOP_Credentials_release (TAO::SSLIOP::Credentials_ptr p)
+{
+ CORBA::release (p);
+}
+
+TAO::SSLIOP::Credentials_ptr
+tao_TAO_SSLIOP_Credentials_nil (void)
+{
+ return TAO::SSLIOP_Credentials::_nil ();
+}
+
+TAO::SSLIOP::Credentials_ptr
+tao_TAO_SSLIOP_Credentials_narrow (CORBA::Object *p
+ ACE_ENV_ARG_DECL)
+{
+ return TAO::SSLIOP_Credentials::_narrow (p
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Object_ptr
+tao_TAO_SSLIOP_Credentials_upcast (void *src)
+{
+ TAO::SSLIOP_Credentials **tmp =
+ static_cast<TAO::SSLIOP_Credentials **> (src);
+
+ return *tmp;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.h
new file mode 100644
index 00000000000..5fdf4f78e6c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.h
@@ -0,0 +1,186 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_Credentials.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_SSLIOP_CREDENTIALS_H
+#define TAO_SSLIOP_CREDENTIALS_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/SSLIOP/SSLIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SSLIOP/SSLIOP_X509.h"
+#include "orbsvcs/SSLIOP/SSLIOP_EVP_PKEY.h"
+#include "orbsvcs/SecurityLevel3C.h"
+#include "tao/LocalObject.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ class SSLIOP_Credentials;
+
+ namespace SSLIOP
+ {
+ typedef SSLIOP_Credentials* Credentials_ptr;
+ typedef TAO_Pseudo_Var_T<SSLIOP_Credentials> Credentials_var;
+ typedef TAO_Pseudo_Out_T<SSLIOP_Credentials> Credentials_out;
+ }
+
+ /**
+ * @class SSLIOP_Credentials
+ *
+ * @brief SSLIOP-specific implementation of the
+ * SecurityLevel3::Credentials interface.
+ *
+ * This class encapsulates the X.509 certificate associated with a
+ * given a principal.
+ *
+ * @note Why is this class not the TAO::SSLIOP namespace? Because
+ * brain damaged MSVC++ 6 cannot call a base class
+ * constructor of class declared in a namespace that is more
+ * than one level deep in a sub-class base member
+ * initializer list.
+ */
+ class TAO_SSLIOP_Export SSLIOP_Credentials
+ : public virtual SecurityLevel3::Credentials,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+ typedef SSLIOP::Credentials_ptr _ptr_type;
+ typedef SSLIOP::Credentials_var _var_type;
+ typedef SSLIOP::Credentials_out _out_type;
+
+ /// Constructor
+ SSLIOP_Credentials (::X509 * cert, ::EVP_PKEY * evp);
+
+ /**
+ * @name SecurityLevel3::Credentials Methods
+ *
+ * Methods required by the SecurityLevel3::Credentials
+ * interface.
+ */
+ //@{
+ virtual char * creds_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual
+ SecurityLevel3::CredentialsType creds_type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+
+ virtual SecurityLevel3::CredentialsUsage creds_usage (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual TimeBase::UtcT expiry_time (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::CredentialsState creds_state (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual char * add_relinquished_listener (
+ SecurityLevel3::RelinquishedCredentialsListener_ptr listener
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void remove_relinquished_listener (const char * id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+
+ //@{
+ /// Return a pointer to the underlying X.509 certificate.
+ /**
+ * @note Caller owns the returned object. Use a
+ * TAO::SSLIOP::X509_var.
+ */
+ ::X509 *x509 (void);
+ //@}
+
+ /// Return a pointer to the underlying private key.
+ /**
+ * @return Non-zero value if private key is used.
+ *
+ * @note Caller owns the returned object. Use a
+ * TAO::SSLIOP::EVP_PKEY_var.
+ */
+ ::EVP_PKEY *evp (void);
+ //@}
+
+ bool operator== (const SSLIOP_Credentials &rhs);
+
+ CORBA::ULong hash (void) const;
+
+ // The static operations.
+ static SSLIOP::Credentials_ptr _duplicate (SSLIOP::Credentials_ptr obj);
+
+ static SSLIOP::Credentials_ptr _narrow (CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL);
+
+ static SSLIOP::Credentials_ptr _nil (void)
+ {
+ return (SSLIOP::Credentials_ptr) 0;
+ }
+
+ //@}
+
+ protected:
+
+ /// Destructor.
+ /**
+ * Protected destructor to enforce proper memory management
+ * through the reference counting mechanism.
+ */
+ ~SSLIOP_Credentials (void);
+
+ protected:
+
+ /// Reference to the X.509 certificate associated with this SSLIOP
+ /// Credentials object.
+ SSLIOP::X509_var x509_;
+
+ /// Reference to the private key associated with the X.509
+ /// certificate.
+ SSLIOP::EVP_PKEY_var evp_;
+
+ /// Credentials Identifier.
+ CORBA::String_var id_;
+
+ /// The intended usage of the Credentials.
+ SecurityLevel3::CredentialsUsage creds_usage_;
+
+ /// The time these Credentials expire.
+ TimeBase::UtcT expiry_time_;
+
+ /// The validity of the Credentials.
+ SecurityLevel3::CredentialsState creds_state_;
+
+ };
+
+// } // End SSLIOP namespace
+} // End TAO namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+# include "orbsvcs/SSLIOP/SSLIOP_Credentials.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_CREDENTIALS_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.inl b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.inl
new file mode 100644
index 00000000000..42970eb800f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.inl
@@ -0,0 +1,21 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE ::X509 *
+TAO::SSLIOP_Credentials::x509 (void)
+{
+ return
+ TAO::SSLIOP::OpenSSL_traits< ::X509 >::_duplicate (this->x509_.in ());
+}
+
+ACE_INLINE ::EVP_PKEY *
+TAO::SSLIOP_Credentials::evp (void)
+{
+ return
+ TAO::SSLIOP::OpenSSL_traits< ::EVP_PKEY >::_duplicate (this->evp_.in ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirer.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirer.cpp
new file mode 100644
index 00000000000..fcccd07cc67
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirer.cpp
@@ -0,0 +1,388 @@
+// $Id$
+
+#include "orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirer.h"
+#include "orbsvcs/SSLIOP/SSLIOP_OwnCredentials.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+
+#include "ace/SSL/SSL_Context.h"
+
+#include "ace/OS_NS_stdio.h"
+
+#include <openssl/x509.h>
+#include <openssl/pem.h>
+
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_CredentialsAcquirer,
+ "$Id$")
+
+
+// -------------------------------------------------------
+
+#if (defined (TAO_HAS_VERSIONED_NAMESPACE) && TAO_HAS_VERSIONED_NAMESPACE == 1)
+# define TAO_SSLIOP_PASSWORD_CALLBACK_NAME ACE_PREPROC_CONCATENATE(TAO_VERSIONED_NAMESPACE_NAME, _TAO_SSLIOP_password_callback)
+#else
+# define TAO_SSLIOP_PASSWORD_CALLBACK_NAME TAO_SSLIOP_password_callback
+#endif /* TAO_HAS_VERSIONED_NAMESPACE == 1 */
+
+
+extern "C"
+int
+TAO_SSLIOP_PASSWORD_CALLBACK_NAME (char *buf,
+ int size,
+ int /* rwflag */,
+ void *userdata)
+{
+ // @@ I'm probably over complicating this implementation, but that's
+ // what you get when you try to be overly efficient. :-)
+ // -Ossama
+
+ const char * password = static_cast<char *> (userdata);
+
+ int pwlen = -1;
+
+ if (password != 0)
+ {
+ pwlen = ACE_OS::strlen (password);
+
+ int copy_len = pwlen + 1; // Include the NULL terminator
+
+ // Clear the portion of the buffer that exceeds the space that
+ // will be occupied by the password.
+ if (copy_len < size)
+ ACE_OS::memset (buf + copy_len, 0, size - copy_len);
+
+ // Make sure we don't overflow the OpenSSL supplied buffer.
+ // Truncate the password if necessary.
+ copy_len = (copy_len > size) ? size : copy_len;
+
+ ACE_OS::memcpy (buf, password, copy_len);
+
+ // NULL terminate the truncated password.
+ if (copy_len > size)
+ {
+ pwlen = size - 1;
+ buf[pwlen] = '\0';
+ }
+ }
+
+ return pwlen;
+}
+
+// -------------------------------------------------------
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SSLIOP::CredentialsAcquirer::CredentialsAcquirer (
+ TAO::SL3::CredentialsCurator_ptr curator,
+ const CORBA::Any & acquisition_arguments)
+ : lock_ (),
+ curator_ (TAO::SL3::CredentialsCurator::_duplicate (curator)),
+ acquisition_arguments_ (acquisition_arguments),
+ destroyed_ (false)
+{
+}
+
+TAO::SSLIOP::CredentialsAcquirer::~CredentialsAcquirer (void)
+{
+}
+
+char *
+TAO::SSLIOP::CredentialsAcquirer::acquisition_method (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return CORBA::string_dup ("SL3TLS");
+}
+
+SecurityLevel3::AcquisitionStatus
+TAO::SSLIOP::CredentialsAcquirer::current_status (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (SecurityLevel3::AQST_Failed);
+
+ return SecurityLevel3::AQST_Succeeded; // @@ Really?
+}
+
+CORBA::ULong
+TAO::SSLIOP::CredentialsAcquirer::nth_iteration (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // SSL/TLS credentials is single-step process from the point-of-view
+ // of the caller.
+ return 1;
+}
+
+CORBA::Any *
+TAO::SSLIOP::CredentialsAcquirer::get_continuation_data (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // SSL/TLS credentials acquisition does generate continuation data.
+ ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (), 0);
+}
+
+SecurityLevel3::AcquisitionStatus
+TAO::SSLIOP::CredentialsAcquirer::continue_acquisition (
+ const CORBA::Any & /* acquisition_arguments */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // SSL/TLS credentials acquisition does generate continuation data.
+ ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (),
+ SecurityLevel3::AQST_Failed);
+}
+
+SecurityLevel3::OwnCredentials_ptr
+TAO::SSLIOP::CredentialsAcquirer::get_credentials (CORBA::Boolean on_list
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (SecurityLevel3::OwnCredentials::_nil ());
+
+ ::SSLIOP::AuthData *data;
+
+ if (!(this->acquisition_arguments_ >>= data))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ SecurityLevel3::OwnCredentials::_nil ());
+
+ TAO::SSLIOP::X509_var x509 = this->make_X509 (data->certificate);
+
+ if (x509.in () == 0)
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ SecurityLevel3::OwnCredentials::_nil ());
+
+ TAO::SSLIOP::EVP_PKEY_var evp = this->make_EVP_PKEY (data->key);
+
+ if (evp.in () == 0)
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ SecurityLevel3::OwnCredentials::_nil ());
+
+ // Verify that the private key is consistent with the certificate.
+ if (::X509_check_private_key (x509.in (), evp.in ()) != 1)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) ERROR: Private key is not ")
+ ACE_TEXT ("consistent with X.509 certificate")));
+
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ SecurityLevel3::OwnCredentials::_nil ());
+ }
+
+ TAO::SSLIOP::OwnCredentials * creds;
+ ACE_NEW_THROW_EX (creds,
+ TAO::SSLIOP::OwnCredentials (x509.in (), evp.in ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (SecurityLevel3::OwnCredentials::_nil ());
+
+ SecurityLevel3::OwnCredentials_var credentials = creds;
+
+ if (on_list)
+ {
+ this->curator_->_tao_add_own_credentials (creds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (SecurityLevel3::OwnCredentials::_nil ());
+ }
+
+ this->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (SecurityLevel3::OwnCredentials::_nil ());
+
+ return credentials._retn ();
+}
+
+void
+TAO::SSLIOP::CredentialsAcquirer::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_GUARD (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_);
+
+ if (!this->destroyed_)
+ {
+ this->destroyed_ = true;
+
+ // Release our reference to the CredentialsCurator.
+ (void) this->curator_.out ();
+ }
+}
+
+void
+TAO::SSLIOP::CredentialsAcquirer::check_validity (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_);
+
+ if (this->destroyed_)
+ ACE_THROW (CORBA::BAD_INV_ORDER ());
+}
+
+::X509 *
+TAO::SSLIOP::CredentialsAcquirer::make_X509 (const ::SSLIOP::File &certificate)
+{
+ // No password is used or needed when reading ASN.1 encoded
+ // certificates.
+
+ const char *filename = certificate.filename.in ();
+
+ if (filename == 0)
+ return 0;
+
+ FILE *fp = 0;
+ ::X509 *x = 0;
+
+ if (certificate.type == ::SSLIOP::ASN1)
+ {
+ // ASN.1/DER encoded certificate
+
+ // No password is used or needed when reading ASN.1 encoded
+ // certificates.
+
+ const char *filename = certificate.filename.in ();
+
+ if (filename == 0)
+ return 0;
+
+ fp = ACE_OS::fopen (filename, "rb");
+
+ if (fp == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) SSLIOP::CredentialsAcquirer::make_X509 - %p\n"),
+ ACE_TEXT ("fopen")));
+
+ return 0;
+ }
+
+ // Read ASN.1 / DER encoded X.509 certificate from a file, and
+ // convert it to OpenSSL's internal X.509 format.
+ x = ::d2i_X509_fp (fp, 0);
+ }
+ else
+ {
+ // PEM encoded certificate
+
+ fp = ACE_OS::fopen (filename, "r");
+
+ if (fp == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) SSLIOP::CredentialsAcquirer::make_X509 - %p\n"),
+ ACE_TEXT ("fopen")));
+
+ return 0;
+ }
+
+ const char *password = certificate.password.in ();
+
+ // Read PEM encoded X.509 certificate from a file, and convert
+ // it to OpenSSL's internal X.509 format.
+ x = PEM_read_X509 (fp,
+ 0,
+ TAO_SSLIOP_PASSWORD_CALLBACK_NAME,
+ const_cast<char *> (password));
+ }
+
+ (void) ACE_OS::fclose (fp);
+
+ if (x == 0 && TAO_debug_level > 0)
+ ACE_SSL_Context::report_error ();
+
+ return x;
+}
+
+::EVP_PKEY *
+TAO::SSLIOP::CredentialsAcquirer::make_EVP_PKEY (const ::SSLIOP::File &key)
+{
+ // No password is used or needed when reading ASN.1 encoded
+ // private keys.
+
+ const char *filename = key.filename.in ();
+
+ if (filename == 0)
+ return 0;
+
+ FILE *fp = 0;
+ ::EVP_PKEY *evp = 0;
+
+ if (key.type == ::SSLIOP::ASN1)
+ {
+ // ASN.1/DER encoded private key
+
+ // No password is used or needed when reading ASN.1 encoded
+ // private keys.
+
+ const char *filename = key.filename.in ();
+
+ if (filename == 0)
+ return 0;
+
+ fp = ACE_OS::fopen (filename, "rb");
+
+ if (fp == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) SSLIOP::CredentialsAcquirer::make_EVP_PKEY ")
+ ACE_TEXT ("- %p\n"),
+ ACE_TEXT ("fopen")));
+
+ return 0;
+ }
+
+ // Read ASN.1 / DER encoded private key from a file, and convert
+ // it to OpenSSL's internal private key format.
+ evp = ::d2i_PrivateKey_fp (fp, 0);
+ }
+ else
+ {
+ // PEM encoded private key
+
+ fp = ACE_OS::fopen (filename, "r");
+
+ if (fp == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) SSLIOP::CredentialsAcquirer::make_EVP_PKEY ")
+ ACE_TEXT ("- %p\n"),
+ ACE_TEXT ("fopen")));
+
+ return 0;
+ }
+
+ const char *password = key.password.in ();
+
+ // Read PEM encoded private key from a file, and convert it to
+ // OpenSSL's internal private key format.
+ evp = PEM_read_PrivateKey (fp,
+ 0,
+ TAO_SSLIOP_PASSWORD_CALLBACK_NAME,
+ const_cast<char *> (password));
+ }
+
+ (void) ACE_OS::fclose (fp);
+
+ if (evp == 0 && TAO_debug_level > 0)
+ ACE_SSL_Context::report_error ();
+
+ return evp;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirer.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirer.h
new file mode 100644
index 00000000000..734ca4d1884
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirer.h
@@ -0,0 +1,154 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_CredentialsAcquirer.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SSLIOP_CREDENTIALS_ACQUIRER_H
+#define TAO_SSLIOP_CREDENTIALS_ACQUIRER_H
+
+#include /**/ "ace/pre.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Security/SL3_CredentialsCurator.h"
+
+#include "orbsvcs/SSLIOPC.h"
+#include "orbsvcs/SecurityLevel3C.h"
+
+#include "tao/LocalObject.h"
+
+#include <openssl/opensslconf.h>
+
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+
+/// Forward declarations for OpenSSL data structures.
+extern "C"
+{
+ typedef struct x509_st X509;
+ typedef struct evp_pkey_st EVP_PKEY;
+}
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+ /**
+ * @class CredentialsAcquirer
+ *
+ * @brief SSLIOP-specific SecurityLevel3::CredentialsAcquirer
+ * implementation.
+ *
+ * This class generates SSLIOP-specific credentials.
+ */
+ class TAO_SSLIOP_Export CredentialsAcquirer
+ : public virtual SecurityLevel3::CredentialsAcquirer,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+
+ /// Constructor
+ CredentialsAcquirer (TAO::SL3::CredentialsCurator_ptr curator,
+ const CORBA::Any & acquisition_arguments);
+
+ /**
+ * @name SecurityLevel3::CredentialsAcquirer Methods
+ *
+ * Methods required by the SecurityLevel3::CredentialsAcquirer
+ * interface.
+ */
+ //@{
+ virtual char * acquisition_method (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::AcquisitionStatus current_status (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ULong nth_iteration (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Any * get_continuation_data (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::AcquisitionStatus continue_acquisition (
+ const CORBA::Any & acquisition_arguments
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::OwnCredentials_ptr get_credentials (
+ CORBA::Boolean on_list
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management
+ * through the reference counting mechanism.
+ */
+ ~CredentialsAcquirer (void);
+
+ private:
+
+ /// Verify that this CredentialsAcquirer object is still valid,
+ /// i.e. hasn't been destroyed.
+ void check_validity (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Create an OpenSSL X.509 certificate data structure.
+ static ::X509 * make_X509 (const ::SSLIOP::File &certificate);
+
+ /// Create an OpenSSL EVP_PKEY key data structure.
+ static ::EVP_PKEY * make_EVP_PKEY (const ::SSLIOP::File &key);
+
+ private:
+
+ /// Lock used for synchronization.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// Reference to the TAO CredentialsCurator implementation.
+ TAO::SL3::CredentialsCurator_var curator_;
+
+ /// SSLIOP-specific credentials acquisition arguments.
+ const CORBA::Any & acquisition_arguments_;
+
+ /// Has this CredentialsAcquirer object completed credentials
+ /// acquisition or been explicitly destroyed?
+ bool destroyed_;
+
+ };
+
+ } // End SSLIOP namespace
+} // End TAO namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_CREDENTIALS_ACQUIRER_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirerFactory.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirerFactory.cpp
new file mode 100644
index 00000000000..06ac8c86977
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirerFactory.cpp
@@ -0,0 +1,30 @@
+// $Id$
+
+#include "orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirerFactory.h"
+#include "orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirer.h"
+
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_CredentialsAcquirerFactory,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+SecurityLevel3::CredentialsAcquirer_ptr
+TAO::SSLIOP::CredentialsAcquirerFactory::make (
+ TAO::SL3::CredentialsCurator_ptr curator,
+ const CORBA::Any & acquisition_arguments
+ ACE_ENV_ARG_DECL)
+{
+ SecurityLevel3::CredentialsAcquirer_ptr ca;
+ ACE_NEW_THROW_EX (ca,
+ TAO::SSLIOP::CredentialsAcquirer (curator,
+ acquisition_arguments),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (SecurityLevel3::CredentialsAcquirer::_nil ());
+
+ return ca;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirerFactory.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirerFactory.h
new file mode 100644
index 00000000000..dcc44e36919
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirerFactory.h
@@ -0,0 +1,65 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_CredentialsAcquirerFactory.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SSLIOP_CREDENTIALS_ACQUIRER_FACTORY_H
+#define TAO_SSLIOP_CREDENTIALS_ACQUIRER_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/SSLIOP/SSLIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Security/SL3_CredentialsAcquirerFactory.h"
+
+#include "orbsvcs/SecurityLevel3C.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+
+ /**
+ * @class CredentialsAcquirerFactory
+ *
+ * @brief SSLIOP-specific TAO::SL3::CredentialsAcquirerFactory
+ * implementation.
+ *
+ * This class generates SSLIOP::CredentialsAcquirer instances.
+ */
+ class TAO_SSLIOP_Export CredentialsAcquirerFactory
+ : public virtual TAO::SL3::CredentialsAcquirerFactory
+ {
+ public:
+
+ /// Create a TAO::SSLIOP::CredentialsAcquirerFactory.
+ virtual SecurityLevel3::CredentialsAcquirer_ptr make (
+ TAO::SL3::CredentialsCurator_ptr curator,
+ const CORBA::Any & acquisition_arguments
+ ACE_ENV_ARG_DECL);
+
+ };
+
+ } // End SSLIOP namespace
+} // End TAO namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_CREDENTIALS_ACQUIRER_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.cpp
new file mode 100644
index 00000000000..9d39c05ba21
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.cpp
@@ -0,0 +1,197 @@
+#include "orbsvcs/SSLIOP/SSLIOP_Current.h"
+#include "tao/debug.h"
+
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_Current,
+ "$Id$")
+
+
+#if !defined (__ACE_INLINE__)
+# include "orbsvcs/SSLIOP/SSLIOP_Current.inl"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SSLIOP::Current::Current (TAO_ORB_Core *orb_core)
+ : tss_slot_ (0),
+ orb_core_ (orb_core)
+{
+}
+
+TAO::SSLIOP::Current::~Current (void)
+{
+}
+
+::SSLIOP::ASN_1_Cert *
+TAO::SSLIOP::Current::get_peer_certificate (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ SSLIOP::Current::NoContext))
+{
+ TAO::SSLIOP::Current_Impl *impl = this->implementation ();
+
+ // If the implementation pointer returned from TSS is zero, then
+ // we're not in the middle of a request or an upcall. Throw an
+ // exception to indicate that.
+ if (impl == 0)
+ ACE_THROW_RETURN (::SSLIOP::Current::NoContext (), 0);
+
+ // A valid value must always be returned, so instantiate a sequence
+ // regardless of whether or not it is populated with certificates.
+ ::SSLIOP::ASN_1_Cert *c = 0;
+ ACE_NEW_THROW_EX (c,
+ ::SSLIOP::ASN_1_Cert,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ ::SSLIOP::ASN_1_Cert_var certificate = c;
+
+ // Populate the sequence with the DER encoded certificate.
+ impl->get_peer_certificate (c);
+
+ return certificate._retn ();
+}
+
+SSLIOP::SSL_Cert *
+TAO::SSLIOP::Current::get_peer_certificate_chain (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ SSLIOP::Current::NoContext))
+{
+ TAO::SSLIOP::Current_Impl *impl = this->implementation ();
+
+ // If the implementation pointer returned from TSS is zero, then
+ // we're not in the middle of a request or an upcall. Throw an
+ // exception to indicate that.
+ if (impl == 0)
+ ACE_THROW_RETURN (SSLIOP::Current::NoContext (), 0);
+
+ // A valid value must always be returned, so instantiate a sequence
+ // regardless of whether or not it is populated with certificates.
+ ::SSLIOP::SSL_Cert *c = 0;
+ ACE_NEW_THROW_EX (c,
+ ::SSLIOP::SSL_Cert,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ ::SSLIOP::SSL_Cert_var cert_chain = c;
+
+ // Populate the sequence with the chain of DER encoded certificates.
+ impl->get_peer_certificate_chain (c);
+
+ return cert_chain._retn ();
+}
+
+CORBA::Boolean
+TAO::SSLIOP::Current::no_context (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return (this->implementation () == 0 ? 1 : 0);
+}
+
+void
+TAO::SSLIOP::Current::setup (TAO::SSLIOP::Current_Impl *&prev_impl,
+ TAO::SSLIOP::Current_Impl *new_impl,
+ bool &setup_done)
+{
+ // Set the current context and remember the old one.
+
+ prev_impl = this->implementation ();
+
+ (void) this->implementation (new_impl); // Check for error?
+
+ // Setup is complete.
+ setup_done = true;
+}
+
+void
+TAO::SSLIOP::Current::teardown (TAO::SSLIOP::Current_Impl *prev_impl,
+ bool &setup_done)
+{
+ if (setup_done)
+ {
+ // Reset the old context.
+ (void) this->implementation (prev_impl);
+ setup_done = false;
+ }
+}
+
+TAO::SSLIOP::Current_ptr
+TAO::SSLIOP::Current::_narrow (
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return TAO::SSLIOP::Current::_duplicate (
+ dynamic_cast<TAO::SSLIOP::Current *> (obj));
+}
+
+TAO::SSLIOP::Current_ptr
+TAO::SSLIOP::Current::_duplicate (TAO::SSLIOP::Current_ptr obj)
+{
+ if (!CORBA::is_nil (obj))
+ obj->_add_ref ();
+
+ return obj;
+}
+
+const char *
+TAO::SSLIOP::Current::_interface_repository_id (void) const
+{
+ return "IDL:TAO/SSLIOP/Current:1.0";
+}
+
+// ----------------------------------------------------------------
+
+TAO::SSLIOP::Current_ptr
+tao_TAO_SSLIOP_Current_duplicate (
+ TAO::SSLIOP::Current_ptr p
+ )
+{
+ return TAO::SSLIOP::Current::_duplicate (p);
+}
+
+void
+tao_TAO_SSLIOP_Current_release (
+ TAO::SSLIOP::Current_ptr p
+ )
+{
+ CORBA::release (p);
+}
+
+TAO::SSLIOP::Current_ptr
+tao_TAO_SSLIOP_Current_nil (
+ void
+ )
+{
+ return TAO::SSLIOP::Current::_nil ();
+}
+
+TAO::SSLIOP::Current_ptr
+tao_TAO_SSLIOP_Current_narrow (
+ CORBA::Object *p
+ ACE_ENV_ARG_DECL
+ )
+{
+ return TAO::SSLIOP::Current::_narrow (p ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Object *
+tao_TAO_SSLIOP_Current_upcast (
+ void *src
+ )
+{
+ TAO::SSLIOP::Current **tmp =
+ static_cast<TAO::SSLIOP::Current **> (src);
+ return *tmp;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.h
new file mode 100644
index 00000000000..02b68b6f60b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.h
@@ -0,0 +1,177 @@
+// -*- C++ -*-
+
+// ===================================================================
+/**
+ * @file SSLIOP_Current.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+// ===================================================================
+
+#ifndef TAO_SSLIOP_CURRENT_H
+#define TAO_SSLIOP_CURRENT_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/SSLIOP/SSLIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SSLIOP/SSLIOP_Current_Impl.h"
+
+#include "orbsvcs/SSLIOPC.h"
+#include "tao/ORB_Core.h"
+#include "tao/LocalObject.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+ class Current;
+ typedef Current * Current_ptr;
+ typedef TAO_Pseudo_Var_T<Current> Current_var;
+ typedef TAO_Pseudo_Out_T<Current> Current_out;
+
+ /**
+ * @class Current
+ *
+ * @brief Implementation of the TAO SSLIOP::Current extension.
+ *
+ * This object can be used to obtain SSL session related
+ * information about the current execution context. For example,
+ * SSL peer certificate chains for the current request can be
+ * obtained from this object.
+ */
+ class Current
+ : public ::SSLIOP::Current,
+ public TAO_Local_RefCounted_Object
+ {
+ public:
+ typedef Current_ptr _ptr_type;
+ typedef Current_var _var_type;
+ typedef Current_out _out_type;
+
+ /// Constructor.
+ Current (TAO_ORB_Core *orb_core);
+
+ /// Return the peer certificate associated with the current
+ /// request.
+ virtual ::SSLIOP::ASN_1_Cert * get_peer_certificate (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ ::SSLIOP::Current::NoContext));
+
+ /**
+ * Return the certificate chain associated with the current
+ * execution context. If no SSL session is being used for the
+ * request or upcall, then the NoContext exception is raised.
+ * On the client side, the chain does include the peer (server)
+ * certficate. However, the certificate chain on the server
+ * side does NOT contain the peer (client) certificate.
+ */
+ virtual ::SSLIOP::SSL_Cert * get_peer_certificate_chain (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ ::SSLIOP::Current::NoContext));
+
+ /**
+ * This method is mostly useful as an inexpensive means of
+ * determining whether or not SSL session state is available.
+ *
+ * @return @c true if the current execution context is not
+ * within a SSL session.
+ */
+ virtual CORBA::Boolean no_context (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Set the TSS slot ID assigned to this object.
+ void tss_slot (size_t slot);
+
+ /// Setup the Current.
+ void setup (Current_Impl *& prev_impl,
+ Current_Impl * new_impl,
+ bool &setup_done);
+
+ /// Teardown the Current for this request.
+ void teardown (Current_Impl *prev_impl,
+ bool &setup_done);
+
+ /**
+ * @name Downcast and Reference Counting Methods
+ *
+ * These are basically the same methods generated by the IDL
+ * compiler for all IDL interfaces.
+ */
+ //@{
+ // The static operations.
+ static Current_ptr _duplicate (Current_ptr obj);
+
+ static Current_ptr _narrow (CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL);
+
+ static Current_ptr _nil (void)
+ {
+ return (Current_ptr)0;
+ }
+
+ virtual const char* _interface_repository_id (void) const;
+ //@}
+
+ protected:
+
+ /// Destructor
+ ~Current (void);
+
+ /// Set the TSS SSLIOP::Current implementation.
+ int implementation (Current_Impl *impl);
+
+ /// Return the TSS SSLIOP::Current implementation.
+ Current_Impl *implementation (void);
+
+ private:
+
+ /// Prevent copying through the copy constructor and the assignment
+ /// operator.
+ //@{
+ Current (const Current &);
+ void operator= (const Current &);
+ //@}
+
+ private:
+
+ /// TSS slot assigned to this object.
+ size_t tss_slot_;
+
+ /// Pointer to the ORB Core corresponding to the ORB with which this
+ /// object is registered.
+ TAO_ORB_Core * const orb_core_;
+ };
+ } // End SSLIOP namespace.
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+# include "orbsvcs/SSLIOP/SSLIOP_Current.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_CURRENT_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.inl b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.inl
new file mode 100644
index 00000000000..1584b919606
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current.inl
@@ -0,0 +1,40 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE void
+TAO::SSLIOP::Current::tss_slot (size_t slot)
+{
+ this->tss_slot_ = slot;
+}
+
+ACE_INLINE int
+TAO::SSLIOP::Current::implementation (TAO::SSLIOP::Current_Impl *impl)
+{
+ if (this->orb_core_ == 0)
+ return -1;
+
+ return this->orb_core_->set_tss_resource (this->tss_slot_, impl);
+}
+
+ACE_INLINE TAO::SSLIOP::Current_Impl *
+TAO::SSLIOP::Current::implementation (void)
+{
+ if (this->orb_core_ == 0)
+ return 0;
+
+ TAO::SL3::SecurityCurrent_Impl *impl =
+ static_cast<TAO::SL3::SecurityCurrent_Impl *> (
+ this->orb_core_->get_tss_resource (this->tss_slot_));
+
+ // Make sure we've got SSL session state in TSS before allowing
+ // further use of the SSLIOP::Current object.
+ if (impl != 0 && impl->tag () == ::SSLIOP::TAG_SSL_SEC_TRANS)
+ return dynamic_cast<TAO::SSLIOP::Current_Impl *> (impl);
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current_Impl.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current_Impl.cpp
new file mode 100644
index 00000000000..27f173dfaac
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current_Impl.cpp
@@ -0,0 +1,128 @@
+#include "orbsvcs/SSLIOP/SSLIOP_Current_Impl.h"
+
+#include "ace/OS_String.h"
+
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_Current_Impl,
+ "$Id$")
+
+
+#if !defined (__ACE_INLINE__)
+# include "orbsvcs/SSLIOP/SSLIOP_Current_Impl.inl"
+#endif /* __ACE_INLINE__ */
+
+#include "orbsvcs/SSLIOP/SSLIOP_X509.h"
+#include "orbsvcs/SSLIOP/SSLIOP_ClientCredentials.h"
+
+#include "tao/ORB_Constants.h"
+
+#include <openssl/x509.h>
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SSLIOP::Current_Impl::~Current_Impl (void)
+{
+}
+
+SecurityLevel3::ClientCredentials_ptr
+TAO::SSLIOP::Current_Impl::client_credentials (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO::SSLIOP::X509_var cert = ::SSL_get_peer_certificate (this->ssl_);
+ if (cert.ptr () == 0)
+ ACE_THROW_RETURN (CORBA::BAD_OPERATION (),
+ SecurityLevel3::ClientCredentials::_nil ());
+
+ SecurityLevel3::ClientCredentials_ptr creds;
+ ACE_NEW_THROW_EX (creds,
+ TAO::SSLIOP::ClientCredentials (cert.in (),
+ 0,
+ this->ssl_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (SecurityLevel3::ClientCredentials::_nil ());
+
+ return creds;
+}
+
+CORBA::Boolean
+TAO::SSLIOP::Current_Impl::request_is_local (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+void
+TAO::SSLIOP::Current_Impl::get_peer_certificate (
+ ::SSLIOP::ASN_1_Cert *certificate)
+{
+ if (this->ssl_ == 0)
+ return;
+
+ TAO::SSLIOP::X509_var cert = ::SSL_get_peer_certificate (this->ssl_);
+ if (cert.ptr () == 0)
+ return;
+
+ // Get the size of the ASN.1 encoding.
+ const int cert_length = ::i2d_X509 (cert.in (), 0);
+ if (cert_length <= 0)
+ return;
+
+ certificate->length (cert_length);
+
+ CORBA::Octet *buffer = certificate->get_buffer ();
+
+ // Convert from the internal X509 representation to the DER encoding
+ // representation.
+ (void) ::i2d_X509 (cert.in (), &buffer);
+}
+
+void
+TAO::SSLIOP::Current_Impl::get_peer_certificate_chain (
+ ::SSLIOP::SSL_Cert *cert_chain)
+{
+ if (this->ssl_ == 0)
+ return;
+
+ STACK_OF (X509) *certs = ::SSL_get_peer_cert_chain (this->ssl_);
+ if (certs == 0)
+ return;
+
+ const int chain_length = sk_X509_num (certs);
+ cert_chain->length (chain_length);
+
+ // Copy the peer certificate chain to the SSLIOP::SSL_Cert
+ // sequence.
+ for (int i = 0; i < chain_length; ++i)
+ {
+ // Extract the certificate from the OpenSSL X509 stack.
+ ::X509 *x = sk_X509_value (certs, i);
+
+ // Get the size of the ASN.1 encoding.
+ const int cert_length = ::i2d_X509 (x, 0);
+ if (cert_length <= 0)
+ continue; // @@ What do we do if there is an error?
+
+ ::SSLIOP::ASN_1_Cert &certificate = (*cert_chain)[i];
+ certificate.length (cert_length);
+
+ CORBA::Octet *buffer = certificate.get_buffer ();
+
+ // Convert from the internal X509 representation to the DER
+ // encoding representation.
+ (void) ::i2d_X509 (x, &buffer);
+ }
+}
+
+CORBA::ULong
+TAO::SSLIOP::Current_Impl::tag (void) const
+{
+ return ::SSLIOP::TAG_SSL_SEC_TRANS;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current_Impl.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current_Impl.h
new file mode 100644
index 00000000000..32bc8c7a283
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current_Impl.h
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+
+// ===================================================================
+/**
+ * @file SSLIOP_Current_Impl.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+// ===================================================================
+
+#ifndef TAO_SSLIOP_CURRENT_IMPL_H
+#define TAO_SSLIOP_CURRENT_IMPL_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/SSLIOPC.h"
+#include "orbsvcs/Security/SL3_SecurityCurrent_Impl.h"
+
+#include <openssl/ssl.h>
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+ /**
+ * @class Current_Impl
+ *
+ * @brief TSS portion of the TAO SSLIOP::Current extension, and
+ * the SSLIOP-specific SecurityLevel3::SecurityCurrent
+ * object.
+ *
+ * This class encapsulates the thread-specific state of an SSL
+ * session during a given upcall.
+ */
+ class Current_Impl : public TAO::SL3::SecurityCurrent_Impl
+ {
+ public:
+
+ /// Constructor.
+ Current_Impl (void);
+
+ /// Destructor
+ ~Current_Impl (void);
+
+ /// Implementation of the SSLIOP-specific
+ /// SecurityLevel3::client_credentials() method.
+ virtual SecurityLevel3::ClientCredentials_ptr client_credentials (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Implementation of the SSLIOP-specific
+ /// SecurityLevel3::request_is_local() method.
+ virtual CORBA::Boolean request_is_local (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the SSL peer certificate associated with the
+ /// current request as an octet sequence, i.e. a DER encoded
+ /// certificate.
+ void get_peer_certificate (::SSLIOP::ASN_1_Cert *certificate);
+
+ /// Return the SSL peer certificate chain associated with the
+ /// current request as a sequence of DER encoded certificates.
+ void get_peer_certificate_chain (::SSLIOP::SSL_Cert *cert_chain);
+
+ /// Set the pointer to the underlying SSL session state.
+ void ssl (SSL *s);
+
+ /// Return pointer to the SSL session state for the current upcall.
+ SSL *ssl (void);
+
+ protected:
+
+ /// Return the unique tag that identifies the concrete subclass.
+ virtual CORBA::ULong tag (void) const;
+
+ private:
+
+ /// Prevent copying through the copy constructor and the assignment
+ /// operator.
+ //@{
+ Current_Impl (const Current_Impl &);
+ void operator= (const Current_Impl &);
+ //@}
+
+ private:
+
+ /// The SSL session state corresponding to the current upcall.
+ SSL *ssl_;
+
+ };
+ } // End SSLIOP namespace.
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+# include "orbsvcs/SSLIOP/SSLIOP_Current_Impl.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_CURRENT_IMPL_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current_Impl.inl b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current_Impl.inl
new file mode 100644
index 00000000000..d1f4b91ee81
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Current_Impl.inl
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//
+// $Id$
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO::SSLIOP::Current_Impl::Current_Impl (void)
+ : ssl_ (0)
+{
+}
+
+ACE_INLINE void
+TAO::SSLIOP::Current_Impl::ssl (SSL *s)
+{
+ this->ssl_ = s;
+}
+
+ACE_INLINE SSL *
+TAO::SSLIOP::Current_Impl::ssl (void)
+{
+ return this->ssl_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_EVP_PKEY.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_EVP_PKEY.cpp
new file mode 100644
index 00000000000..020904b53d2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_EVP_PKEY.cpp
@@ -0,0 +1,76 @@
+// -*- C++ -*-
+
+#include "orbsvcs/SSLIOP/SSLIOP_EVP_PKEY.h"
+
+#include <openssl/x509.h>
+#include <openssl/rsa.h>
+#include <openssl/dsa.h>
+#include <openssl/dh.h>
+#include "orbsvcs/SSLIOP/params_dup.h"
+
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_EVP_PKEY,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+::EVP_PKEY *
+TAO::SSLIOP::OpenSSL_traits< ::EVP_PKEY >::copy (::EVP_PKEY const & key)
+{
+ ::EVP_PKEY * pkey = const_cast< ::EVP_PKEY *> (&key);
+
+ // We're using the EVP_PKEY_var even though it depends on this
+ // trait function. This works since we're not actually using
+ // any of the EVP_PKEY_var methods that call this copy()
+ // trait. This allows us to maintain exception safety.
+ TAO::SSLIOP::EVP_PKEY_var p = ::EVP_PKEY_new ();
+
+ switch (::EVP_PKEY_type (pkey->type))
+ {
+ case EVP_PKEY_RSA:
+ {
+ RSA * rsa = ::EVP_PKEY_get1_RSA (pkey);
+ if (rsa != 0)
+ {
+ // Not exception safe!
+ ::EVP_PKEY_set1_RSA (p.in (), RSAPrivateKey_dup (rsa));
+ ::RSA_free (rsa);
+ }
+ }
+ break;
+
+ case EVP_PKEY_DSA:
+ {
+ DSA * dsa = ::EVP_PKEY_get1_DSA (pkey);
+ if (dsa != 0)
+ {
+ // Not exception safe!
+ ::EVP_PKEY_set1_DSA (p.in (), DSAPARAMS_DUP_WRAPPER_NAME (dsa));
+ ::DSA_free (dsa);
+ }
+ }
+ break;
+
+ case EVP_PKEY_DH:
+ {
+ DH * dh = ::EVP_PKEY_get1_DH (pkey);
+ if (dh != 0)
+ {
+ // Not exception safe!
+ ::EVP_PKEY_set1_DH (p.in (), DHPARAMS_DUP_WRAPPER_NAME (dh));
+ ::DH_free (dh);
+ }
+ }
+ break;
+
+ default:
+ // We should never get here!
+ return 0;
+ }
+
+ return p._retn ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_EVP_PKEY.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_EVP_PKEY.h
new file mode 100644
index 00000000000..8c43b8a5b68
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_EVP_PKEY.h
@@ -0,0 +1,79 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_EVP_PKEY.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre,vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_SSLIOP_EVP_PKEY_H
+#define TAO_SSLIOP_EVP_PKEY_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/SSLIOP/SSLIOP_OpenSSL_st_T.h"
+
+#include <openssl/evp.h>
+#include <openssl/crypto.h>
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+ // OpenSSL @c EVP_PKEY structure traits specialization.
+ template <>
+ struct OpenSSL_traits< ::EVP_PKEY >
+ {
+ /// OpenSSL lock ID for use in OpenSSL CRYPTO_add() reference
+ /// count manipulation function.
+ enum { LOCK_ID = CRYPTO_LOCK_EVP_PKEY };
+
+ /// Increase the reference count on the given OpenSSL structure.
+ /**
+ * @note This used to be in a function template but MSVC++ 6
+ * can't handle function templates correctly so reproduce
+ * the code in each specialization. *sigh*
+ */
+ static ::EVP_PKEY * _duplicate (::EVP_PKEY * st)
+ {
+ if (st != 0)
+ CRYPTO_add (&(st->references),
+ 1,
+ LOCK_ID);
+
+ return st;
+ }
+
+ /// Perform deep copy of the given OpenSSL structure.
+ static ::EVP_PKEY * copy (::EVP_PKEY const & key);
+
+ /// Decrease the reference count on the given OpenSSL
+ /// structure.
+ static void release (::EVP_PKEY * st)
+ {
+ ::EVP_PKEY_free (st);
+ }
+ };
+
+ typedef OpenSSL_st_var< ::EVP_PKEY > EVP_PKEY_var;
+
+ } // End SSLIOP namespace.
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_EVP_PKEY_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp
new file mode 100644
index 00000000000..62061e03009
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp
@@ -0,0 +1,382 @@
+#include "orbsvcs/SSLIOP/SSLIOP_Endpoint.h"
+
+#include "tao/IIOP_Endpoint.h"
+
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+#include "ace/os_include/os_netdb.h"
+
+#include "tao/debug.h"
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_Endpoint,
+ "$Id$")
+
+
+#if !defined (__ACE_INLINE__)
+# include "orbsvcs/SSLIOP/SSLIOP_Endpoint.i"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_SSLIOP_Endpoint::TAO_SSLIOP_Endpoint (const ::SSLIOP::SSL *ssl_component,
+ TAO_IIOP_Endpoint *iiop_endp)
+ : TAO_Endpoint (IOP::TAG_INTERNET_IOP),
+ object_addr_ (),
+ next_ (0),
+ iiop_endpoint_ (iiop_endp),
+ destroy_iiop_endpoint_ (false),
+ qop_ (::Security::SecQOPIntegrityAndConfidentiality),
+#if !defined (VXWORKS) && !defined (__QNX__)
+ // Some compilers don't like the initialization
+ trust_ (),
+#endif /* !VXWORKS && !__QNX__ */
+ credentials_ (),
+ credentials_set_ (0)
+{
+ if (ssl_component != 0)
+ {
+ // Copy the security association options in the IOR's SSL tagged
+ // component.
+ this->ssl_component_.target_supports = ssl_component->target_supports;
+ this->ssl_component_.target_requires = ssl_component->target_requires;
+ this->ssl_component_.port = ssl_component->port;
+ }
+ else
+ {
+ // No SSL tagged component is available so construct a default
+ // set of security association options, in addition to the IANA
+ // assigned IIOP over SSL port (684). This is generally a
+ // client side issue.
+
+ // Clear all bits in the SSLIOP::SSL association option fields.
+ this->ssl_component_.target_supports = 0;
+ this->ssl_component_.target_requires = 0;
+
+ // SSLIOP requires these Security::AssociationOptions by default.
+ ACE_SET_BITS (this->ssl_component_.target_requires,
+ ::Security::Integrity
+ | ::Security::Confidentiality
+ | ::Security::NoDelegation);
+
+ // SSLIOP supports these Security::AssociationOptions by
+ // default.
+ //
+ // Note that the Security::NoProtection bit is set since we
+ // can't be sure if the server supports SSL, and TAO's SSLIOP
+ // implementation must support IIOP over SSL and plain IIOP.
+ ACE_SET_BITS (this->ssl_component_.target_supports,
+ ::Security::Integrity
+ | ::Security::Confidentiality
+ | ::Security::EstablishTrustInTarget
+ | ::Security::NoProtection
+ | ::Security::NoDelegation);
+
+ // Initialize the default SSL port to zero, not the IANA
+ // assigned IIOP over SSL port (684). We usually only get here
+ // if we're creating a profile on the client side using an IOR
+ // that does not contain an SSLIOP tagged component.
+ this->ssl_component_.port = 0;
+ }
+
+ // Invalidate the Addr until the first attempt to use it is made.
+ this->object_addr_.set_type (-1);
+
+ this->trust_.trust_in_target = 1;
+ this->trust_.trust_in_client = 1;
+}
+
+TAO_SSLIOP_Endpoint::~TAO_SSLIOP_Endpoint (void)
+{
+ if (this->destroy_iiop_endpoint_)
+ delete this->iiop_endpoint_;
+}
+
+#if 0
+static void
+dump_endpoint (const char* msg, const TAO_Endpoint *other_endpoint)
+{
+
+ TAO_Endpoint *endpt = const_cast<TAO_Endpoint *> (other_endpoint);
+
+ TAO_SSLIOP_Endpoint *endpoint =
+ dynamic_cast<TAO_SSLIOP_Endpoint *> (endpt);
+
+ if (endpoint == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) endpoint - %s: Unable to cast an endpoint to SSLIOP_Endpoint\n", msg));
+ return;
+ }
+
+ char hostaddr[MAXHOSTNAMELEN + 16];
+ int gothost = endpoint->addr_to_string (hostaddr, sizeof hostaddr);
+
+ ACE_DEBUG ((LM_INFO, "TAO (%P|%t) SSLIOPEndpoint %s - %@ {%s, ssl=%d, iiop=%d,"
+ " qop=%d, trst=(%d,%d), c=%@, crdh=0x%x}, h=0x%x\n",
+ msg,
+ endpoint,
+ (gothost == 0 ? hostaddr : "*UNKNOWN*"),
+ endpoint->ssl_component ().port ,
+ endpoint->iiop_endpoint ()->port (),
+ endpoint->qop() ,
+ endpoint->trust().trust_in_target ,
+ endpoint->trust().trust_in_client ,
+ endpoint->credentials() ,
+ (endpoint->credentials_set () ? endpoint->credentials()->hash () : 0) ,
+ endpoint->hash ()));
+}
+#endif /* 0 */
+
+int
+TAO_SSLIOP_Endpoint::addr_to_string (char *buffer, size_t length)
+{
+ size_t actual_len =
+ ACE_OS::strlen (this->iiop_endpoint_->host ()) // chars in host name
+ + sizeof (':') // delimiter
+ + ACE_OS::strlen ("65536") // max port
+ + sizeof ('\0');
+
+ if (length < actual_len)
+ return -1;
+
+ ACE_OS::sprintf (buffer,
+ "%s:%d",
+ this->iiop_endpoint_->host (),
+ this->ssl_component_.port);
+
+ return 0;
+}
+
+
+TAO_Endpoint *
+TAO_SSLIOP_Endpoint::next (void)
+{
+ return this->next_;
+}
+
+CORBA::Boolean
+TAO_SSLIOP_Endpoint::is_equivalent (const TAO_Endpoint *other_endpoint)
+{
+ TAO_Endpoint *endpt = const_cast<TAO_Endpoint *> (other_endpoint);
+
+ TAO_SSLIOP_Endpoint *endpoint =
+ dynamic_cast<TAO_SSLIOP_Endpoint *> (endpt);
+
+ if (endpoint == 0)
+ return 0;
+
+ ::Security::EstablishTrust t = endpoint->trust ();
+
+ if ((this->ssl_component_.port != 0
+ && endpoint->ssl_component_.port != 0
+ && this->ssl_component_.port != endpoint->ssl_component_.port)
+ || this->qop_ != endpoint->qop ()
+ || this->trust_.trust_in_target != t.trust_in_target
+ || this->trust_.trust_in_client != t.trust_in_client
+ || (!CORBA::is_nil (this->credentials_.in ())
+ && !(*this->credentials_.in () == *endpoint->credentials ())))
+ {
+ return 0;
+ }
+
+ // Comparing the underlying iiop endpoints is wrong, as their port
+ // numbers often may not make sense. Or may not being used anyway.
+ // Therefore, we only need to directly compare the hosts. See also the
+ // comments in the hash() method.
+ if (this->iiop_endpoint() == 0 || endpoint->iiop_endpoint() == 0)
+ return 0;
+
+ if ((ACE_OS::strcmp (this->iiop_endpoint()->host (),
+ endpoint->iiop_endpoint()->host ()) != 0))
+ return 0;
+
+ return 1;
+}
+
+TAO_Endpoint *
+TAO_SSLIOP_Endpoint::duplicate (void)
+{
+ TAO_SSLIOP_Endpoint *endpoint = 0;
+
+ // @@ We need to set the priority of the newly formed endpoint. It
+ // shouldnt be a problem as long as SSL is not used with RTCORBA.
+ ACE_NEW_RETURN (endpoint,
+ TAO_SSLIOP_Endpoint (&this->ssl_component_,
+ 0),
+ 0);
+
+ if (this->credentials_set_)
+ endpoint->set_sec_attrs (this->qop_,this->trust_, this->credentials_.in());
+
+ endpoint->iiop_endpoint (this->iiop_endpoint_, true);
+ endpoint->hash_val_ = this->hash_val_;
+ return endpoint;
+}
+
+CORBA::ULong
+TAO_SSLIOP_Endpoint::hash (void)
+{
+ // there is actually the potential for a race of the inverse case,
+ // since setting the security attributes will reset the hash_val_,
+ // it is possible this test to pass, but then have the hash reset
+ // before the value is returned.
+ if (this->hash_val_ != 0)
+ return this->hash_val_;
+
+ // Do this with no locks held, as it may try to acquire it, too.
+ const ACE_INET_Addr &oaddr = this->object_addr();
+
+ { // nested scope for the lock
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->addr_lookup_lock_,
+ this->hash_val_);
+ // .. DCL
+ if (this->hash_val_ != 0)
+ return this->hash_val_;
+
+
+ // Note that we are not using the underlying IIOP endpoint's hash
+ // value in order to avoid the influence of the IIOP port number,
+ // since it is ignored anyway. When it features a
+ // purely fictional port number, as when accepting an SSL
+ // connection, the unsecured port is undefined and
+ // had we used it in computing the hash it would have broken the
+ // bi-directional support - as the 'guessed' IIOP port value will
+ // hardly match the one specified in the bi-dir service context.
+ this->hash_val_ =
+ oaddr.get_ip_address ()
+ + this->ssl_component_.port;
+ }
+
+ return this->hash_val_;
+}
+
+
+const ACE_INET_Addr &
+TAO_SSLIOP_Endpoint::object_addr (void) const
+{
+ // The object_addr_ is initialized here, rather than at IOR decode
+ // time for several reasons:
+ // 1. A request on the object may never be invoked.
+ // 2. The DNS setup may have changed dynamically.
+ // ...etc..
+
+ // Double checked locking optimization.
+ if (this->object_addr_.get_type () != AF_INET)
+ {
+ const ACE_INET_Addr &iiop_addr = this->iiop_endpoint_->object_addr ();
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->addr_lookup_lock_,
+ this->object_addr_);
+
+ if (this->object_addr_.get_type () != AF_INET)
+ {
+ this->object_addr_ = iiop_addr;
+ this->object_addr_.set_port_number (this->ssl_component_.port);
+ }
+ }
+
+ return this->object_addr_;
+}
+
+void
+TAO_SSLIOP_Endpoint::set_sec_attrs (::Security::QOP q,
+ const ::Security::EstablishTrust &t,
+ const TAO::SSLIOP::OwnCredentials_ptr c)
+{
+ if (this->credentials_set_)
+ return;
+
+ ACE_GUARD (TAO_SYNCH_MUTEX,
+ guard,
+ this->addr_lookup_lock_);
+
+ // double-check
+ if (this->credentials_set_)
+ return;
+
+ this->qop_ = q;
+ this->trust_ = t;
+ this->credentials_ = TAO::SSLIOP::OwnCredentials::_duplicate (c);
+ this->credentials_set_ = 1;
+
+ // reset the hash value to force a recomputation.
+ this->hash_val_ = 0;
+}
+
+
+
+
+TAO_SSLIOP_Synthetic_Endpoint::~TAO_SSLIOP_Synthetic_Endpoint ()
+{
+}
+
+TAO_SSLIOP_Synthetic_Endpoint::TAO_SSLIOP_Synthetic_Endpoint (const ::SSLIOP::SSL *ssl)
+ : TAO_SSLIOP_Endpoint (ssl, 0)
+{
+}
+
+
+TAO_SSLIOP_Synthetic_Endpoint::TAO_SSLIOP_Synthetic_Endpoint (TAO_IIOP_Endpoint *iiop_endp)
+ : TAO_SSLIOP_Endpoint ((const ::SSLIOP::SSL *)0, iiop_endp)
+{
+ this->ssl_component_.port = iiop_endp->port ();
+}
+
+
+CORBA::Boolean
+TAO_SSLIOP_Synthetic_Endpoint::is_equivalent (const TAO_Endpoint *other_endpoint)
+{
+ TAO_Endpoint *endpt = const_cast<TAO_Endpoint *> (other_endpoint);
+
+ TAO_SSLIOP_Endpoint *endpoint =
+ dynamic_cast<TAO_SSLIOP_Endpoint *> (endpt);
+
+ if (endpoint == 0)
+ return 0;
+
+ if ((this->ssl_component ().port != 0
+ && endpoint->ssl_component ().port != 0
+ && this->ssl_component ().port != endpoint->ssl_component ().port)
+ || this->qop () < endpoint->qop ())
+ {
+ return 0;
+ }
+
+ // Comparing the underlying iiop endpoints is wrong, as their port
+ // numbers often may not make sense, or are not being used anyway.
+ // Therefore, directly comparing the hosts at this point. See also the
+ // comments in the hash() method
+ if (this->iiop_endpoint() == 0 || endpoint->iiop_endpoint() == 0)
+ return 0;
+
+ if ((ACE_OS::strcmp (this->iiop_endpoint()->host (),
+ endpoint->iiop_endpoint()->host ()) != 0))
+ return 0;
+
+ return 1;
+}
+
+TAO_Endpoint *
+TAO_SSLIOP_Synthetic_Endpoint::duplicate (void)
+{
+ TAO_SSLIOP_Synthetic_Endpoint *endpoint = 0;
+
+ // @@ We need to set the priority of the newly formed endpoint. It
+ // shouldnt be a problem as long as SSL is not used with RTCORBA.
+ ACE_NEW_RETURN (endpoint,
+ TAO_SSLIOP_Synthetic_Endpoint (&(this->ssl_component ())),
+ 0);
+
+ if (this->credentials_set())
+ endpoint->set_sec_attrs (this->qop (),this->trust (), this->credentials ());
+
+ endpoint->iiop_endpoint (this->iiop_endpoint (), true);
+ endpoint->hash_val_ = this->hash ();
+ return endpoint;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h
new file mode 100644
index 00000000000..d05fec097ad
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h
@@ -0,0 +1,256 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_Endpoint.h
+ *
+ * $Id$
+ *
+ * SSLIOP implementation of PP Framework Endpoint interface.
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_SSLIOP_ENDPOINT_H
+#define TAO_SSLIOP_ENDPOINT_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/SSLIOP/SSLIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SSLIOP/SSLIOP_OwnCredentials.h"
+
+#include "orbsvcs/SSLIOPC.h"
+#include "orbsvcs/SecurityC.h"
+
+#include "tao/IIOP_Endpoint.h"
+#include "ace/INET_Addr.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ /// Tag for storing multiple ssl endpoints within a single profile.
+ const ACE_UINT32 TAG_SSL_ENDPOINTS = 0x54414f01U;
+}
+
+// namespace TAO
+// {
+// namespace SSLIOP
+// {
+ /**
+ * @class Endpoint
+ *
+ * @brief SSLIOP-specific implementation of PP Framework Endpoint
+ * interface.
+ *
+ *
+ */
+ class TAO_SSLIOP_Export TAO_SSLIOP_Endpoint : public TAO_Endpoint
+ {
+ public:
+
+ friend class TAO_SSLIOP_Profile;
+
+ /// Constructor
+ TAO_SSLIOP_Endpoint (const ::SSLIOP::SSL *ssl_component,
+ TAO_IIOP_Endpoint *iiop_endp);
+
+ /// Destructor.
+ virtual ~TAO_SSLIOP_Endpoint (void);
+
+ /**
+ * @name TAO_Endpoint Methods
+ *
+ * See Endpoint.h for their documentation.
+ */
+ //@{
+ virtual TAO_Endpoint *next (void);
+ virtual int addr_to_string (char *buffer, size_t length);
+
+ /// Return true if this endpoint is equivalent to @param
+ /// other_endpoint. The relationship is defined as equivalency of
+ /// their qop, hostname and ssl ports (if non-zero).
+ /// Two endpoints may be equivalent even if their iiop counterparts are
+ /// not. In fact, there are cases (as with the LPL processing)
+ /// when those counterparts are not known at all.
+ CORBA::Boolean is_equivalent (const TAO_Endpoint *other_endpoint);
+
+ /// Return a copy of the corresponding endpoints by allocating
+ /// memory.
+ virtual TAO_Endpoint *duplicate (void);
+
+ /// Return a hash value for this object. Note that only the IP
+ /// address and port are used to generate the hash value. This may
+ /// cause a few more hash table collisions in the transport cache,
+ /// because a synthesized SSLIOP endpoints for an address will
+ /// have the same hash value as a fully qualified one. The
+ /// redeeming feature is that it makes / bi-directional SSLIOP work
+ /// by allowing descendent class (Synthetic_Endpoint) instances to
+ /// be used as keys in the cache manager and match other fully
+ /// qualified endpoint. (which were used earlier to cache a
+ /// particular transport)
+ virtual CORBA::ULong hash (void);
+ //@}
+
+ /**
+ * @name SSLIOP_Endpoint-specific Methods
+ */
+ //@{
+ /// Return SSL component corresponding to this endpoint.
+ const ::SSLIOP::SSL &ssl_component (void) const;
+
+ /// Accessor to our IIOP counterpart.
+ TAO_IIOP_Endpoint *iiop_endpoint (void) const;
+
+ /// Mutator to our IIOP counterpart.
+ /**
+ * @param destroy If set to @c true, the TAO::SSLIOP::Endpoint
+ * object retains ownership of the given
+ * TAO_IIOP_Endpoint.
+ */
+ void iiop_endpoint (TAO_IIOP_Endpoint *endpoint, bool destroy);
+
+ /// Return the SSLIOP-specific ACE_INET_Addr.
+ const ACE_INET_Addr &object_addr (void) const;
+
+ /// Set the Quality-of-Protection, establishment of trust, and
+ /// credentials for this endpoint. This is all done in one function
+ /// so that the guard may be used uniformly.
+ void set_sec_attrs (::Security::QOP qop,
+ const ::Security::EstablishTrust &trust,
+ const TAO::SSLIOP::OwnCredentials_ptr creds);
+
+ /// Get the Quality-of-Protection settings for this endpoint.
+ ::Security::QOP qop (void) const;
+
+ /// Get the establishment of trust settings for this endpoint.
+ ::Security::EstablishTrust trust (void) const;
+
+ /// Get the credentials for this endpoint.
+ /**
+ * @note This method does not follow C++ mapping memory
+ * management rules. Specifically, no duplication or
+ * reference counting occurs in this method. This is so
+ * that no additional locks occur when checking the
+ * transport cache.
+ */
+ TAO::SSLIOP::OwnCredentials * credentials (void) const;
+ //@}
+
+
+ /// Credentials are not supplied by the constructor, and it is
+ /// valid to have a nil credential, for instance if the
+ /// SSL_use_certificate() method returns 0. Therefore it is
+ /// necessary to have a new method to distinguish between a
+ /// credential that is nil because it has not been set, vs one
+ /// that was set to nil explicitly.
+ int credentials_set (void) const;
+
+ protected:
+
+ /// Cache the SSL tagged component in a decoded format. Notice
+ /// that we do not need to marshal this object!
+ ::SSLIOP::SSL ssl_component_;
+
+ private:
+
+ /// Cached instance of ACE_INET_Addr for use in making invocations,
+ /// etc.
+ mutable ACE_INET_Addr object_addr_;
+
+ /// IIOP Endpoints can be stringed into a list. Return the next
+ /// endpoint in the list, if any.
+ TAO_SSLIOP_Endpoint *next_;
+
+ /// IIOP counterpart.
+ /**
+ * Since SSLIOP is an 'extension' of IIOP, each SSLIOP_Endpoint
+ * contains SSL-specific information plus a pointer to the
+ * IIOP_Endpoint containing the IIOP portion of our address.
+ */
+ TAO_IIOP_Endpoint *iiop_endpoint_;
+
+ /// Flag that determines whether or not the iiop_endpoint_ member is
+ /// deallocated with delete().
+ bool destroy_iiop_endpoint_;
+
+ /// Quailty-of-Protection settings for this endpoint object.
+ ::Security::QOP qop_;
+
+ /// Establishment of trust settings for this endpoint object.
+ ::Security::EstablishTrust trust_;
+
+ /// SSLIOP-specific credentials for this endpoint object.
+ TAO::SSLIOP::OwnCredentials_var credentials_;
+
+ /// A flag indicating that credentials_ was explicitly initialized
+ int credentials_set_;
+ };
+
+ /**
+ * @class SSLIOP_Synthetic_Endpoint
+ *
+ * @brief SSLIOP-specific implementation of PP Framework Endpoint
+ * interface, representing synthetic endpoints. An endpoints
+ * is synthetic whenever there is insuficient data to fully
+ * initialize an SSLIOP endpoint: qop, trust, credentials,
+ * etc. Such as when creating an SSLIOP endpoint in response
+ * of a Listen Point List or accepting a connection.
+ *
+ * LPL and IOR-originated endpoints can now compare as
+ * equivalent, if they denote the same host, port and
+ * protection. That would have given some false
+ * positives in some very obscure cases (same SSL port, but
+ * different protection or undelying IIOP port, or vice versa)
+ * The "synthetic eVndpoint" has its very own is_equivalent()
+ * to help eliminate any false positives and make the process
+ * more clear.
+ *
+ */
+ class TAO_SSLIOP_Export TAO_SSLIOP_Synthetic_Endpoint : public TAO_SSLIOP_Endpoint
+ {
+ public:
+
+ /// Constructor
+ TAO_SSLIOP_Synthetic_Endpoint (TAO_IIOP_Endpoint *iiop_endp);
+
+ /// Destructor.
+ virtual ~TAO_SSLIOP_Synthetic_Endpoint (void);
+
+ /**
+ * Return true if this endpoint is equivalent to @param
+ * other_endpoint.
+ * Two synthetic endpoints are equivalent iff their iiop counterparts are
+ * equivalent, and, if both have non-zero ssl ports, their ssl
+ * ports are the same.
+ */
+ CORBA::Boolean is_equivalent (const TAO_Endpoint *other_endpoint);
+
+ /// Return a copy of the corresponding endpoints by allocating
+ /// memory.
+ virtual TAO_Endpoint *duplicate (void);
+
+ private:
+ TAO_SSLIOP_Synthetic_Endpoint (const ::SSLIOP::SSL *ssl);
+
+ };
+
+// } // End SSLIOP namespace.
+// } // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/SSLIOP/SSLIOP_Endpoint.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_ENDPOINT_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i
new file mode 100644
index 00000000000..9ea9beb96b6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+//
+// $Id$
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE TAO_IIOP_Endpoint *
+TAO_SSLIOP_Endpoint::iiop_endpoint (void) const
+{
+ return this->iiop_endpoint_;
+}
+
+ACE_INLINE void
+TAO_SSLIOP_Endpoint::iiop_endpoint (TAO_IIOP_Endpoint *iiop_endpoint,
+ bool destroy)
+{
+ if (iiop_endpoint != 0)
+ {
+ TAO_IIOP_Endpoint *new_endpoint = 0;
+
+ if (destroy)
+ {
+ TAO_Endpoint *endpoint = iiop_endpoint->duplicate ();
+
+ new_endpoint = dynamic_cast<TAO_IIOP_Endpoint *> (endpoint);
+
+ }
+ else
+ new_endpoint = iiop_endpoint;
+
+ if (this->destroy_iiop_endpoint_)
+ delete this->iiop_endpoint_;
+
+ this->iiop_endpoint_ = new_endpoint;
+ this->destroy_iiop_endpoint_ = destroy;
+ }
+}
+
+ACE_INLINE const ::SSLIOP::SSL &
+TAO_SSLIOP_Endpoint::ssl_component (void) const
+{
+ return this->ssl_component_;
+}
+
+ACE_INLINE ::Security::QOP
+TAO_SSLIOP_Endpoint::qop (void) const
+{
+ return this->qop_;
+}
+
+ACE_INLINE ::Security::EstablishTrust
+TAO_SSLIOP_Endpoint::trust (void) const
+{
+ return this->trust_;
+}
+
+ACE_INLINE TAO::SSLIOP::OwnCredentials *
+TAO_SSLIOP_Endpoint::credentials (void) const
+{
+ return this->credentials_.in ();
+}
+
+ACE_INLINE int
+TAO_SSLIOP_Endpoint::credentials_set (void) const
+{
+ return this->credentials_set_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Export.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Export.h
new file mode 100644
index 00000000000..806577d0855
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_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_SSLIOP_EXPORT_H
+#define TAO_SSLIOP_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_SSLIOP_HAS_DLL)
+# define TAO_SSLIOP_HAS_DLL 0
+# endif /* ! TAO_SSLIOP_HAS_DLL */
+#else
+# if !defined (TAO_SSLIOP_HAS_DLL)
+# define TAO_SSLIOP_HAS_DLL 1
+# endif /* ! TAO_SSLIOP_HAS_DLL */
+#endif
+
+#if defined (TAO_SSLIOP_HAS_DLL) && (TAO_SSLIOP_HAS_DLL == 1)
+# if defined (TAO_SSLIOP_BUILD_DLL)
+# define TAO_SSLIOP_Export ACE_Proper_Export_Flag
+# define TAO_SSLIOP_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_SSLIOP_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_SSLIOP_BUILD_DLL */
+# define TAO_SSLIOP_Export ACE_Proper_Import_Flag
+# define TAO_SSLIOP_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_SSLIOP_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_SSLIOP_BUILD_DLL */
+#else /* TAO_SSLIOP_HAS_DLL == 1 */
+# define TAO_SSLIOP_Export
+# define TAO_SSLIOP_SINGLETON_DECLARATION(T)
+# define TAO_SSLIOP_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_SSLIOP_HAS_DLL == 1 */
+
+#endif /* TAO_SSLIOP_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp
new file mode 100644
index 00000000000..49a369925e7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp
@@ -0,0 +1,614 @@
+#include "orbsvcs/SSLIOP/SSLIOP_Factory.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Acceptor.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Connector.h"
+#include "orbsvcs/SSLIOP/SSLIOP_ORBInitializer.h"
+#include "ace/OS_NS_strings.h"
+
+#include "orbsvcs/Security/Security_ORBInitializer.h" /// @todo should go away
+
+#include "tao/debug.h"
+#include "tao/ORBInitializer_Registry.h"
+
+#include "ace/SSL/sslconf.h"
+#include "ace/SSL/SSL_Context.h"
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_Factory,
+ "$Id$")
+
+
+// An SSL session id seed value. Needs not be too unique, just somewhat
+// different. See the OpenSSL manual
+static const unsigned char session_id_context_[] =
+ "$Id$";
+
+// Protocol name prefix
+static const char * const the_prefix[] = {"iiop", "ssliop"};
+
+// An OS-dependent path separator character
+static ACE_TCHAR const TAO_PATH_SEPARATOR_STRING[] =
+#if defined(ACE_WIN32)
+ ACE_TEXT (";");
+#else
+ ACE_TEXT (":");
+#endif
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+ static const long ACCEPT_TIMEOUT = 10; // Default accept timeout
+ // in seconds.
+ }
+}
+
+TAO::SSLIOP::Protocol_Factory::Protocol_Factory (void)
+ : TAO_Protocol_Factory (IOP::TAG_INTERNET_IOP),
+ qop_ (::Security::SecQOPIntegrityAndConfidentiality),
+ timeout_ (TAO::SSLIOP::ACCEPT_TIMEOUT)
+{
+}
+
+TAO::SSLIOP::Protocol_Factory::~Protocol_Factory (void)
+{
+}
+
+int
+TAO::SSLIOP::Protocol_Factory::match_prefix (const ACE_CString &prefix)
+{
+ // Check for the proper prefix for this protocol.
+ return (ACE_OS::strcasecmp (prefix.c_str (), ::the_prefix[0]) == 0)
+ || (ACE_OS::strcasecmp (prefix.c_str (), ::the_prefix[1]) == 0);
+}
+
+const char *
+TAO::SSLIOP::Protocol_Factory::prefix (void) const
+{
+ // Note: This method doesn't seem to be used anywhere. Moreover,
+ // keeping it may make things more confusing - a Factory can
+ // well be handling multiple protocol prefixes, not just one!
+ // Shouldn't it be deprecated?
+ return ::the_prefix[0];
+}
+
+char
+TAO::SSLIOP::Protocol_Factory::options_delimiter (void) const
+{
+ return '/';
+}
+
+TAO_Acceptor *
+TAO::SSLIOP::Protocol_Factory::make_acceptor (void)
+{
+ TAO_Acceptor *acceptor = 0;
+
+ ACE_NEW_RETURN (acceptor,
+ TAO::SSLIOP::Acceptor (this->qop_,
+ this->timeout_),
+ 0);
+
+ return acceptor;
+}
+
+
+// Parses a X509 path. Beware: This function modifies
+// the buffer pointed to by arg!
+int
+TAO::SSLIOP::Protocol_Factory::parse_x509_file (char *arg,
+ char **path)
+{
+ ACE_ASSERT (arg != 0);
+ ACE_ASSERT (path != 0);
+
+ char *lst = 0;
+ const char *type_name = ACE_OS::strtok_r (arg, ":", &lst);
+ *path = ACE_OS::strtok_r (0, "", &lst);
+
+ if (ACE_OS::strcasecmp (type_name, "ASN1") == 0)
+ return SSL_FILETYPE_ASN1;
+
+ if (ACE_OS::strcasecmp (type_name, "PEM") == 0)
+ return SSL_FILETYPE_PEM;
+
+ return -1;
+}
+
+
+int
+TAO::SSLIOP::Protocol_Factory::init (int argc,
+ char* argv[])
+{
+ char *certificate_path = 0;
+ char *private_key_path = 0;
+ char *dhparams_path = 0;
+ char *ca_file = 0;
+ char *ca_dir = 0;
+ char *rand_path = 0;
+
+ int certificate_type = -1;
+ int private_key_type = -1;
+ int dhparams_type = -1;
+
+ int prevdebug = -1;
+
+ CSIIOP::AssociationOptions csiv2_target_supports =
+ CSIIOP::Integrity | CSIIOP::Confidentiality;
+ CSIIOP::AssociationOptions csiv2_target_requires =
+ CSIIOP::Integrity | CSIIOP::Confidentiality;
+
+ // Force the Singleton instance to be initialized/instantiated.
+ // Some SSLIOP option combinations below will result in the
+ // Singleton instance never being initialized. In that case,
+ // problems may occur later on due to lack of initialization of the
+ // underlying SSL library (e.g. OpenSSL), which occurs when an
+ // ACE_SSL_Context is instantiated.
+
+ // The code is cleaner this way anyway.
+ ACE_SSL_Context * ssl_ctx = ACE_SSL_Context::instance ();
+ ACE_ASSERT (ssl_ctx != 0);
+
+ size_t session_id_len =
+ (sizeof session_id_context_ >= SSL_MAX_SSL_SESSION_ID_LENGTH)
+ ? SSL_MAX_SSL_SESSION_ID_LENGTH
+ : sizeof session_id_context_;
+
+ // Note that this function returns 1, if the operation succeded.
+ // See SSL_CTX_set_session_id_context(3)
+ if( 1 != ::SSL_CTX_set_session_id_context (ssl_ctx->context(),
+ session_id_context_,
+ session_id_len))
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Unable to set the session id ")
+ ACE_TEXT ("context to \'%s\'\n"), session_id_context_));
+
+ return -1;
+ }
+
+ for (int curarg = 0; curarg != argc; ++curarg)
+ {
+ if ((ACE_OS::strcasecmp (argv[curarg],
+ "-verbose") == 0)
+ || (ACE_OS::strcasecmp (argv[curarg],
+ "-v") == 0))
+ {
+ if (TAO_debug_level == 0)
+ {
+ prevdebug = TAO_debug_level;
+ TAO_debug_level = 1;
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (argv[curarg],
+ "-SSLNoProtection") == 0)
+ {
+ // Enable the eNULL cipher. Note that enabling the "eNULL"
+ // cipher only disables encryption. However, certificate
+ // exchanges will still occur.
+ if (::SSL_CTX_set_cipher_list (ssl_ctx->context (),
+ "DEFAULT:eNULL") == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Unable to set eNULL ")
+ ACE_TEXT ("SSL cipher in SSLIOP ")
+ ACE_TEXT ("factory.\n")));
+
+ return -1;
+ }
+
+ // This does not disable secure invocations on the server
+ // side. It merely enables insecure ones. On the client
+ // side, secure invocations will be disabled unless
+ // overridden by a SecurityLevel2::QOPPolicy in the object
+ // reference.
+ this->qop_ = ::Security::SecQOPNoProtection;
+
+ ACE_SET_BITS (csiv2_target_supports,
+ CSIIOP::NoProtection);
+
+ ACE_CLR_BITS (csiv2_target_requires,
+ CSIIOP::Confidentiality);
+ }
+
+ else if (ACE_OS::strcasecmp (argv[curarg],
+ "-SSLCertificate") == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ certificate_type = parse_x509_file (argv[curarg], &certificate_path);
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (argv[curarg],
+ "-SSLPrivateKey") == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ private_key_type = parse_x509_file (argv[curarg], &private_key_path);
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (argv[curarg],
+ "-SSLAuthenticate") == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ int mode = SSL_VERIFY_NONE;
+ if (ACE_OS::strcasecmp (argv[curarg], "NONE") == 0)
+ {
+ mode = SSL_VERIFY_NONE;
+ }
+ else if (ACE_OS::strcasecmp (argv[curarg], "SERVER") == 0)
+ {
+ mode = SSL_VERIFY_PEER;
+
+ ACE_SET_BITS (csiv2_target_supports,
+ CSIIOP::EstablishTrustInTarget
+ | CSIIOP::EstablishTrustInClient);
+ }
+ else if (ACE_OS::strcasecmp (argv[curarg], "CLIENT") == 0
+ || ACE_OS::strcasecmp (argv[curarg],
+ "SERVER_AND_CLIENT") == 0)
+ {
+ mode = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
+
+ ACE_SET_BITS (csiv2_target_supports,
+ CSIIOP::EstablishTrustInTarget
+ | CSIIOP::EstablishTrustInClient);
+
+ ACE_SET_BITS (csiv2_target_requires,
+ CSIIOP::EstablishTrustInClient);
+ }
+
+ ssl_ctx->default_verify_mode (mode);
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (argv[curarg],
+ "-SSLAcceptTimeout") == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ float timeout = 0;
+
+ if (sscanf (argv[curarg], "%f", &timeout) != 1
+ || timeout < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ERROR: Invalid -SSLAcceptTimeout "
+ "value: %s.\n",
+ argv[curarg]),
+ -1);
+ else
+ this->timeout_.set (timeout);
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (argv[curarg],
+ "-SSLDHparams") == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ dhparams_type = parse_x509_file (argv[curarg], &dhparams_path);
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (argv[curarg],
+ "-SSLCAfile") == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ (void) parse_x509_file (argv[curarg], &ca_file);
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (argv[curarg],
+ "-SSLCApath") == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ ca_dir = argv[curarg];
+ }
+ }
+
+ else if (ACE_OS::strcasecmp (argv[curarg],
+ "-SSLrand") == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ rand_path = argv[curarg];
+ }
+ }
+ }
+
+ // Load some (more) entropy from the user specified sources
+ // in addition to what's pointed to by ACE_SSL_RAND_FILE_ENV
+ if (rand_path != 0)
+ {
+ short errors = 0;
+ char *file_name = 0;
+ const char *path = ACE_OS::strtok_r (rand_path,
+ TAO_PATH_SEPARATOR_STRING,
+ &file_name);
+ while ( path != 0)
+ {
+ if( -1 == ssl_ctx->seed_file (path, -1))
+ {
+ errors++;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Failed to load ")
+ ACE_TEXT ("more entropy from <%s>: %m\n"), path));
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Loaded ")
+ ACE_TEXT ("more entropy from <%s>\n"), path));
+ }
+
+ path = ACE_OS::strtok_r (0, TAO_PATH_SEPARATOR_STRING, &file_name);
+ }
+
+ if (errors > 0)
+ return -1;
+ }
+
+ // Load any trusted certificates explicitely rather than relying on
+ // previously set SSL_CERT_FILE and/or SSL_CERT_PATH environment variable
+ if (ca_file != 0 || ca_dir != 0)
+ {
+ if (ssl_ctx->load_trusted_ca (ca_file, ca_dir) != 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Unable to load ")
+ ACE_TEXT ("CA certs from %s%s%s\n"),
+ ((ca_file != 0) ? ca_file : ACE_TEXT ("a file pointed to by ")
+ ACE_TEXT (ACE_SSL_CERT_FILE_ENV)
+ ACE_TEXT (" env var (if any)")),
+ ACE_TEXT (" and "),
+ ((ca_dir != 0) ? ca_dir : ACE_TEXT ("a directory pointed to by ")
+ ACE_TEXT (ACE_SSL_CERT_DIR_ENV)
+ ACE_TEXT (" env var (if any)"))));
+
+ return -1;
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT ("TAO (%P|%t) SSLIOP loaded ")
+ ACE_TEXT ("Trusted Certificates from %s%s%s\n"),
+ ((ca_file != 0) ? ca_file : ACE_TEXT ("a file pointed to by ")
+ ACE_TEXT (ACE_SSL_CERT_FILE_ENV)
+ ACE_TEXT (" env var (if any)")),
+ ACE_TEXT (" and "),
+ ((ca_dir != 0) ? ca_dir : ACE_TEXT ("a directory pointed to by ")
+ ACE_TEXT (ACE_SSL_CERT_DIR_ENV)
+ ACE_TEXT (" env var (if any)"))));
+ }
+ }
+
+ // Load in the DH params. If there was a file explicitly specified,
+ // then we do that here, otherwise we load them in from the cert file.
+ // Note that we only do this on the server side, I think so we might
+ // need to defer this 'til later in the acceptor or something...
+ if (dhparams_path == 0)
+ {
+ // If the user didn't explicitly specify a DH parameters file, we
+ // also might find it concatenated in the certificate file.
+ // So, we set the dhparams to that if it wasn't explicitly set.
+ dhparams_path = certificate_path;
+ dhparams_type = certificate_type;
+ }
+
+ if (dhparams_path != 0)
+ {
+ if (ssl_ctx->dh_params (dhparams_path,
+ dhparams_type) != 0)
+ {
+ if (dhparams_path != certificate_path)
+ {
+ // We only want to fail catastrophically if the user specified
+ // a dh parameter file and we were unable to actually find it
+ // and load from it.
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) SSLIOP_Factory: ")
+ ACE_TEXT ("unable to set ")
+ ACE_TEXT ("DH parameters <%s>\n"),
+ dhparams_path));
+ return -1;
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT ("(%P|%t) SSLIOP_Factory: ")
+ ACE_TEXT ("No DH parameters found in ")
+ ACE_TEXT ("certificate <%s>; either none ")
+ ACE_TEXT ("are needed (RSA) or problems ")
+ ACE_TEXT ("will ensue later.\n"),
+ dhparams_path));
+ }
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT ("(%P|%t) SSLIOP loaded ")
+ ACE_TEXT ("Diffie-Hellman params ")
+ ACE_TEXT ("from %s\n"),
+ dhparams_path));
+ }
+ }
+
+ // The certificate must be set before the private key since the
+ // ACE_SSL_Context attempts to check the private key for
+ // consistency. That check requires the certificate to be available
+ // in the underlying SSL_CTX.
+ if (certificate_path != 0)
+ {
+ if (ssl_ctx->certificate (certificate_path,
+ certificate_type) != 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Unable to set ")
+ ACE_TEXT ("SSL certificate <%s> ")
+ ACE_TEXT ("in SSLIOP factory.\n"),
+ certificate_path));
+
+ return -1;
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT ("TAO (%P|%t) SSLIOP loaded ")
+ ACE_TEXT ("SSL certificate ")
+ ACE_TEXT ("from %s\n"),
+ certificate_path));
+ }
+ }
+
+ if (private_key_path != 0)
+ {
+ if (ssl_ctx->private_key (private_key_path,
+ private_key_type) != 0)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) Unable to set ")
+ ACE_TEXT ("SSL private key ")
+ ACE_TEXT ("<%s> in SSLIOP factory.\n"),
+ private_key_path));
+ }
+
+ return -1;
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT ("TAO (%P|%t) SSLIOP loaded ")
+ ACE_TEXT ("Private Key ")
+ ACE_TEXT ("from %s\n"),
+ private_key_path));
+ }
+ }
+
+ if (this->register_orb_initializer (csiv2_target_supports,
+ csiv2_target_requires) != 0)
+ return -1;
+
+ if (prevdebug != -1)
+ TAO_debug_level = prevdebug;
+
+ return 0;
+}
+
+int
+TAO::SSLIOP::Protocol_Factory::register_orb_initializer (
+ CSIIOP::AssociationOptions csiv2_target_supports,
+ CSIIOP::AssociationOptions csiv2_target_requires)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // @todo: This hard-coding should be fixed once SECIOP is
+ // supported.
+ // Register the Security ORB initializer.
+ PortableInterceptor::ORBInitializer_ptr tmp;
+ ACE_NEW_THROW_EX (tmp,
+ TAO::Security::ORBInitializer,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_TRY_CHECK;
+
+ PortableInterceptor::ORBInitializer_var initializer = tmp;
+
+ PortableInterceptor::register_orb_initializer (initializer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Register the SSLIOP ORB initializer.
+ // PortableInterceptor::ORBInitializer_ptr tmp;
+ ACE_NEW_THROW_EX (tmp,
+ TAO::SSLIOP::ORBInitializer (this->qop_,
+ csiv2_target_supports,
+ csiv2_target_requires),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_TRY_CHECK;
+
+ //PortableInterceptor::ORBInitializer_var initializer = tmp;
+ initializer = tmp;
+
+ PortableInterceptor::register_orb_initializer (initializer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Unable to register SSLIOP ORB "
+ "initializer.");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+
+TAO_Connector *
+TAO::SSLIOP::Protocol_Factory::make_connector (void)
+{
+ TAO_Connector *connector = 0;
+
+ ACE_NEW_RETURN (connector,
+ TAO::SSLIOP::Connector (this->qop_),
+ 0);
+ return connector;
+}
+
+int
+TAO::SSLIOP::Protocol_Factory::requires_explicit_endpoint (void) const
+{
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DEFINE (TAO_SSLIOP_Protocol_Factory,
+ ACE_TEXT ("SSLIOP_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_SSLIOP_Protocol_Factory),
+ ACE_Service_Type::DELETE_THIS
+ | ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+ACE_FACTORY_DEFINE (TAO_SSLIOP, TAO_SSLIOP_Protocol_Factory)
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.h
new file mode 100644
index 00000000000..169e12b7bf2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.h
@@ -0,0 +1,141 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_Factory.h
+ *
+ * $Id$
+ *
+ * SSLIOP implementation of PP Framework Protocol_Factory interface.
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SSLIOP_FACTORY_H
+#define TAO_SSLIOP_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/SSLIOP/SSLIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SecurityC.h"
+#include "orbsvcs/CSIIOPC.h"
+
+#include "tao/Protocol_Factory.h"
+
+#include "ace/Service_Config.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Acceptor;
+class TAO_Connector;
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+
+ /**
+ * @class Protocol_Factory
+ *
+ * @brief SSLIOP-specific protocol factory implementation.
+ *
+ * This class implements the SSLIOP-specific protocol factory
+ * implementation for use in TAO's pluggable protocols framework.
+ */
+ class TAO_SSLIOP_Export Protocol_Factory
+ : public TAO_Protocol_Factory
+ {
+ public:
+
+ /// Constructor.
+ Protocol_Factory (void);
+
+ /// Destructor.
+ virtual ~Protocol_Factory (void);
+
+ // = Service Configurator hooks.
+ /// Dynamic linking hook
+ virtual int init (int argc, char* argv[]);
+
+ /// Verify prefix is a match
+ virtual int match_prefix (const ACE_CString & prefix);
+
+ /// Returns the prefix used by the protocol.
+ virtual const char * prefix (void) const;
+
+ /// Return the character used to mark where an endpoint ends and
+ /// where its options begin.
+ virtual char options_delimiter (void) const;
+
+ // = Check Protocol_Factory.h for a description of these methods.
+ virtual TAO_Acceptor * make_acceptor (void);
+ virtual TAO_Connector * make_connector (void);
+ virtual int requires_explicit_endpoint (void) const;
+
+ private:
+
+ /// Parse an X509 file path, which is expected to looks like:
+ /// <X509Path> ::= <Prefix> ':' <Path>
+ /// <Prefix> ::= 'PEM' | 'ASN1'
+ /// <Path> ::= any-string
+ /// Returns either SSL_FILETYPE_ASN1, SSL_FILETYPE_PEM or -1
+ /// if the prefix can not be recognized. The *path will point
+ /// to the part of the original buffer, after the initial ':',
+ /// or will contain 0, if no path was specified.
+ ///
+ /// Beware: This function modifies the buffer pointed to by arg!
+ ///
+ static int parse_x509_file (char *arg, char **path);
+
+ /// Create and register the SSLIOP ORB initializer.
+ int register_orb_initializer (
+ CSIIOP::AssociationOptions csiv2_target_supports,
+ CSIIOP::AssociationOptions csiv2_target_requires);
+
+ private:
+
+ /// Default quality-of-protection settings for the SSLIOP
+ /// pluggable protocol.
+ ::Security::QOP qop_;
+
+ /// The accept() timeout.
+ /**
+ * This timeout includes the overall time to complete the SSL
+ * handshake. This includes both the TCP handshake and the SSL
+ * handshake.
+ */
+ ACE_Time_Value timeout_;
+
+ /// The SSLIOP-specific CSIv2 transport mechanism component.
+ /**
+ * This SSLIOP-specific structure is embedded in the CSIv2 transport
+ * mechanism list of the @c CSIIOP::CompoundSecMechList IOR tagged
+ * component.
+ */
+ // CSIIOP::TLS_SEC_TRANS * csiv2_component_;
+
+ };
+ } // End SSLIOP namespace.
+} // End TAO namespace.
+
+// Work around preprocessor tokenization.
+typedef TAO::SSLIOP::Protocol_Factory TAO_SSLIOP_Protocol_Factory;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+ACE_STATIC_SVC_DECLARE_EXPORT (TAO_SSLIOP, TAO_SSLIOP_Protocol_Factory)
+ACE_STATIC_SVC_REQUIRE (TAO_SSLIOP_Protocol_Factory)
+ACE_FACTORY_DECLARE (TAO_SSLIOP, TAO_SSLIOP_Protocol_Factory)
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Invocation_Interceptor.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Invocation_Interceptor.cpp
new file mode 100644
index 00000000000..5e90c389e80
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Invocation_Interceptor.cpp
@@ -0,0 +1,175 @@
+#include "orbsvcs/SSLIOP/SSLIOP_Invocation_Interceptor.h"
+
+#include "orbsvcs/SecurityLevel2C.h"
+
+#include "tao/ORB_Constants.h"
+#include "tao/PortableServer/PS_CurrentC.h"
+#include "tao/debug.h"
+
+#if defined(SSLIOP_DEBUG_PEER_CERTIFICATE)
+#include <openssl/x509.h> // @@ For debugging code below
+#endif /* DEBUG_PEER_CERTIFICATES */
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_Invocation_Interceptor,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SSLIOP::Server_Invocation_Interceptor::Server_Invocation_Interceptor (
+ ::SSLIOP::Current_ptr current,
+ ::Security::QOP qop)
+ : ssliop_current_ (::SSLIOP::Current::_duplicate (current)),
+ qop_ (qop)
+{
+}
+
+TAO::SSLIOP::Server_Invocation_Interceptor::~Server_Invocation_Interceptor (
+ void)
+{
+}
+
+char *
+TAO::SSLIOP::Server_Invocation_Interceptor::name (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("TAO::SSLIOP::Server_Invocation_Interceptor");
+}
+
+void
+TAO::SSLIOP::Server_Invocation_Interceptor::destroy (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+
+void
+TAO::SSLIOP::Server_Invocation_Interceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr /*ri*/
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ // The current upcall is not being performed through an SSL
+ // connection. If server is configured to disallow insecure
+ // invocations then throw a CORBA::NO_PERMISSION exception.
+ // @@ TODO: Once the SecurityManager is implemented, query it
+ // for the current object's
+ // SecureInvocationPolicy of type
+ // SecTargetSecureInvocationPolicy so that we can
+ // accept or reject requests on a per-object basis
+ // instead on a per-endpoint basis.
+ CORBA::Boolean const no_ssl =
+ this->ssliop_current_->no_context (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level >= 3)
+ ACE_DEBUG ((LM_DEBUG, "SSLIOP (%P|%t) Interceptor (context), ssl=%d\n", !(no_ssl)));
+
+ if (no_ssl && this->qop_ != ::Security::SecQOPNoProtection)
+ ACE_THROW (CORBA::NO_PERMISSION ());
+
+#if defined(DEBUG_PEER_CERTIFICATES)
+ ACE_TRY
+ {
+ // If the request was not made through an SSL connection, then
+ // this method will throw the SSLIOP::Current::NoContext
+ // exception. Otherwise, it will return a DER encoded X509
+ // certificate.
+ ::SSLIOP::ASN_1_Cert_var cert =
+ this->ssliop_current_->get_peer_certificate (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // @@ The following debugging code works but I don't think that
+ // we should include it since it dumps alot of information,
+ // i.e. prints two lines of information per request.
+ if (TAO_debug_level > 1)
+ {
+ CORBA::Octet *der_cert = cert->get_buffer ();
+
+ X509 *peer = ::d2i_X509 (0, &der_cert, cert->length ());
+ if (peer != 0)
+ {
+ char buf[BUFSIZ] = { 0 };
+
+ ::X509_NAME_oneline (::X509_get_subject_name (peer),
+ buf,
+ BUFSIZ);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Certificate subject: %s\n",
+ buf));
+
+ ::X509_NAME_oneline (::X509_get_issuer_name (peer),
+ buf,
+ BUFSIZ);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Certificate issuer: %s\n",
+ buf));
+
+
+ ::X509_free (peer);
+ }
+ }
+ }
+ ACE_CATCH (::SSLIOP::Current::NoContext, exc)
+ {
+ // The current upcall is not being performed through an SSL
+ // connection. If server is configured to disallow insecure
+ // invocations then throw a CORBA::NO_PERMISSION exception.
+ // @@ TODO: Once the SecurityManager is implemented, query it
+ // for the current object's
+ // SecureInvocationPolicy of type
+ // SecTargetSecureInvocationPolicy so that we can
+ // accept or reject requests on a per-object basis
+ // instead on a per-endpoint basis.
+ if (this->qop_ != ::Security::SecQOPNoProtection)
+ ACE_THROW (CORBA::NO_PERMISSION ());
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+#endif /* DEBUG_PEER_CERTIFICATES */
+}
+
+
+void
+TAO::SSLIOP::Server_Invocation_Interceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr /* ri */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+TAO::SSLIOP::Server_Invocation_Interceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr /* ri */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO::SSLIOP::Server_Invocation_Interceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr /* ri */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+TAO::SSLIOP::Server_Invocation_Interceptor::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr /* ri */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Invocation_Interceptor.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Invocation_Interceptor.h
new file mode 100644
index 00000000000..9ab7aaffad1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Invocation_Interceptor.h
@@ -0,0 +1,148 @@
+// -*- C++ -*-
+
+// ===================================================================
+/**
+ * @file SSLIOP_Invocation_Interceptor.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+// ===================================================================
+
+#ifndef TAO_SSLIOP_INVOCATION_INTERCEPTOR_H
+#define TAO_SSLIOP_INVOCATION_INTERCEPTOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/SSLIOP/SSLIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SSLIOPC.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI_Server/PI_Server.h"
+#include "tao/LocalObject.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 */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+ /**
+ * @class Server_Invocation_Interceptor
+ *
+ * @brief Secure invocation server request interceptor.
+ *
+ * This server request interceptor rejects insecure request
+ * invocations if the effective target object policy requires
+ * secure invocations.
+ */
+ class Server_Invocation_Interceptor
+ : public virtual PortableInterceptor::ServerRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+
+ /// Constructor.
+ Server_Invocation_Interceptor (::SSLIOP::Current_ptr current,
+ ::Security::QOP qop);
+
+ /**
+ * @name PortableInterceptor::ServerRequestInterceptor Methods
+ *
+ * Methods required by the
+ * PortableInterceptor::ServerRequestInterceptor interface.
+ */
+ //@{
+ 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));
+ //@}
+
+ protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to force deallocation by the reference
+ * counting mechanism.
+ */
+ ~Server_Invocation_Interceptor (void);
+
+ private:
+
+ /**
+ * @name Copying and Assignment
+ *
+ * Protected to prevent copying through the copy constructor and the
+ * assignment operator.
+ */
+ //@{
+ Server_Invocation_Interceptor (const Server_Invocation_Interceptor &);
+ void operator= (const Server_Invocation_Interceptor &);
+ //@}
+
+ private:
+
+ /// Reference to the current SSLIOP execution context.
+ ::SSLIOP::Current_var ssliop_current_;
+
+ /// The default quality-of-protection settings in use.
+ ::Security::QOP qop_;
+
+ };
+
+ } // End SSLIOP namespace.
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_INVOCATION_INTERCEPTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.cpp
new file mode 100644
index 00000000000..6f36fa774c5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.cpp
@@ -0,0 +1,248 @@
+#include "orbsvcs/SSLIOP/SSLIOP_ORBInitializer.h"
+
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_ORBInitializer,
+ "$Id$")
+
+
+#include "orbsvcs/SSLIOP/SSLIOP_Current.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Invocation_Interceptor.h"
+//#include "SSLIOP_IORInterceptor.h"
+#include "orbsvcs/SSLIOP/SSLIOP_CredentialsAcquirerFactory.h"
+
+#include "orbsvcs/Security/SL3_SecurityCurrent.h"
+#include "orbsvcs/Security/SL3_CredentialsCurator.h"
+
+#include "orbsvcs/SSLIOPC.h"
+#include "orbsvcs/CSIIOPC.h"
+
+#include "tao/Exception.h"
+#include "tao/PI/ORBInitInfo.h"
+#include "tao/debug.h"
+
+#include "ace/Auto_Ptr.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SSLIOP::ORBInitializer::ORBInitializer (
+ ::Security::QOP qop,
+ CSIIOP::AssociationOptions csiv2_target_supports,
+ CSIIOP::AssociationOptions csiv2_target_requires)
+ : qop_ (qop),
+ csiv2_target_supports_ (csiv2_target_supports),
+ csiv2_target_requires_ (csiv2_target_requires)
+{
+}
+
+void
+TAO::SSLIOP::ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_ORBInitInfo_var tao_info =
+ TAO_ORBInitInfo::_narrow (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (tao_info.in ()))
+ ACE_THROW (CORBA::INV_OBJREF ());
+
+ // SSLIOP doesn't use the ORB Core until a request invocation occurs
+ // so there is no problem in retrieving the ORB Core pointer in this
+ // pre_init() method.
+ TAO_ORB_Core *orb_core = tao_info->orb_core ();
+
+ // Create the SSLIOP::Current object.
+ // Note that a new SSLIOP::Current object is created for each ORB.
+ // It wouldn't be very useful to share security context information
+ // with another ORB that isn't configured with security, for
+ // example.
+ SSLIOP::Current_ptr current;
+ ACE_NEW_THROW_EX (current,
+ TAO::SSLIOP::Current (orb_core),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ SSLIOP::Current_var ssliop_current = current;
+
+ // Register the SSLIOP::Current object reference with the ORB.
+ info->register_initial_reference ("SSLIOPCurrent",
+ ssliop_current.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO::SSLIOP::ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Note we do not store the SSLIOP::Current as a class member since
+ // we need to avoid potential problems where the same
+ // SSLIOP::Current object is shared between ORBs. Each ORB should
+ // have its own unique SSLIOP::Current object. By obtaining the
+ // SSLIOP::Current object from the resolve_initial_references()
+ // mechanism, we are guaranteed that the SSLIOP::Current object is
+ // specific to the ORB being initialized since a new SSLIOP::Current
+ // object is registered for each ORB in this ORBInitializer's
+ // pre_init() method.
+
+ CORBA::Object_var obj =
+ info->resolve_initial_references ("SSLIOPCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ SSLIOP::Current_var ssliop_current =
+ SSLIOP::Current::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (!CORBA::is_nil (ssliop_current.in ()))
+ {
+ TAO::SSLIOP::Current *tao_current =
+ dynamic_cast<TAO::SSLIOP::Current *> (ssliop_current.in ());
+
+ if (tao_current != 0)
+ {
+ const size_t slot =
+ this->get_tss_slot_id (info ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ tao_current->tss_slot (slot);
+ }
+ else
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ // Create the SSLIOP secure invocation server request interceptor.
+ PortableInterceptor::ServerRequestInterceptor_ptr si =
+ PortableInterceptor::ServerRequestInterceptor::_nil ();
+ ACE_NEW_THROW_EX (si,
+ TAO::SSLIOP::Server_Invocation_Interceptor (
+ ssliop_current.in (),
+ this->qop_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableInterceptor::ServerRequestInterceptor_var si_interceptor =
+ si;
+
+ // Register the SSLIOP secure invocation server request interceptor
+ // with the ORB.
+ info->add_server_request_interceptor (si_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+// TAO_ORBInitInfo_var tao_info =
+// TAO_ORBInitInfo::_narrow (info
+// ACE_ENV_ARG_PARAMETER);
+// ACE_CHECK;
+
+// if (CORBA::is_nil (tao_info.in ()))
+// ACE_THROW (CORBA::INV_OBJREF ());
+
+// TAO_ORB_Core * orb_core = tao_info->orb_core ();
+
+// // Create the SSLIOP IOR interceptor.
+// PortableInterceptor::IORInterceptor_ptr ii =
+// PortableInterceptor::IORInterceptor::_nil ();
+// ACE_NEW_THROW_EX (ii,
+// TAO::SSLIOP::IORInterceptor (orb_core,
+// this->csiv2_target_supports_,
+// this->csiv2_target_requires_),
+// CORBA::NO_MEMORY (
+// CORBA::SystemException::_tao_minor_code (
+// TAO::VMCID,
+// ENOMEM),
+// CORBA::COMPLETED_NO));
+// ACE_CHECK;
+
+// PortableInterceptor::IORInterceptor_var ior_interceptor =
+// ii;
+
+// // Register the SSLIOP IORInterceptor.
+// info->add_ior_interceptor (ior_interceptor.in ()
+// ACE_ENV_ARG_PARAMETER);
+// ACE_CHECK;
+
+ // Register the SSLIOP-specific vault with the
+ // PrincipalAuthenticator.
+ obj = info->resolve_initial_references ("SecurityLevel3:SecurityManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ SecurityLevel3::SecurityManager_var manager =
+ SecurityLevel3::SecurityManager::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ SecurityLevel3::CredentialsCurator_var curator =
+ manager->credentials_curator (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO::SL3::CredentialsCurator_var tao_curator =
+ TAO::SL3::CredentialsCurator::_narrow (curator.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO::SSLIOP::CredentialsAcquirerFactory * factory;
+ ACE_NEW_THROW_EX (factory,
+ TAO::SSLIOP::CredentialsAcquirerFactory,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ auto_ptr<TAO::SSLIOP::CredentialsAcquirerFactory> safe_factory;
+
+ tao_curator->register_acquirer_factory ("SL3TLS",
+ factory
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ (void) safe_factory.release (); // CredentialsCurator now owns
+ // CredentialsAcquirerFactory.
+}
+
+size_t
+TAO::SSLIOP::ORBInitializer::get_tss_slot_id (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+{
+ // Obtain the Security Service TSS slot ID from the SecurityCurrent
+ // object.
+ CORBA::Object_var obj =
+ info->resolve_initial_references ("SecurityLevel3:SecurityCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ SecurityLevel3::SecurityCurrent_var current =
+ SecurityLevel3::SecurityCurrent::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ TAO::SL3::SecurityCurrent * security_current =
+ dynamic_cast<TAO::SL3::SecurityCurrent *> (current.in ());
+
+ if (security_current == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Unable to obtain TSS slot ID from "
+ "\"SecurityCurrent\" object.\n"));
+
+ ACE_THROW_RETURN (CORBA::INTERNAL (), 0);
+ }
+
+ return security_current->tss_slot ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.h
new file mode 100644
index 00000000000..905b526d000
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.h
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_ORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SSLIOP_ORB_INITIALIZER_H
+#define TAO_SSLIOP_ORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/SSLIOP/SSLIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CSIIOPC.h"
+#include "orbsvcs/SecurityC.h"
+
+#include "tao/PI/PI.h"
+#include "tao/LocalObject.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+
+ /**
+ * @name ORBInitializer
+ *
+ * @brief
+ * ORB initializer that registers all SSLIOP-specific interceptors and
+ * object references.
+ */
+ class ORBInitializer
+ : public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+
+ /// Constructor.
+ ORBInitializer (::Security::QOP qop,
+ CSIIOP::AssociationOptions csiv2_target_supports,
+ CSIIOP::AssociationOptions csiv2_target_requires);
+
+ 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:
+
+ // Obtain the TSS slot ID assigned to the "SSLIOPCurrent" object.
+ size_t get_tss_slot_id (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL);
+
+ private:
+
+ /// The default quality-of-protection settings in use.
+ ::Security::QOP qop_;
+
+ /// Default support CSIv2 association options.
+ CSIIOP::AssociationOptions csiv2_target_supports_;
+
+ /// Default required CSIv2 association options.
+ CSIIOP::AssociationOptions csiv2_target_requires_;
+ };
+
+ } // End SSLIOP namespace.
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_ORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.cpp
new file mode 100644
index 00000000000..f20eb554f4c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.cpp
@@ -0,0 +1,17 @@
+// $Id$
+
+#ifndef TAO_SSLIOP_OPENSSL_ST_T_CPP
+#define TAO_SSLIOP_OPENSSL_ST_T_CPP
+
+#include "orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+#if !defined (__ACE_INLINE__)
+#include "orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.inl"
+#endif /* !__ACE_INLINE__ */
+
+#endif /* TAO_SSLIOP_OPENSSL_ST_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.h
new file mode 100644
index 00000000000..1fee4c1504b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.h
@@ -0,0 +1,139 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_OpenSSL_st_T.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_SSLIOP_OPENSSL_ST_T_H
+#define TAO_SSLIOP_OPENSSL_ST_T_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+ /**
+ * @struct OpenSSL_traits
+ *
+ * @brief Template traits structure for OpenSSL data structures.
+ *
+ * Template traits structure containing constants and functions
+ * specific to a given OpenSSL data structure.
+ */
+ template <typename T>
+ struct OpenSSL_traits;
+
+ /**
+ * @name CORBA-style Reference Count Manipulation Methods
+ *
+ * These reference count manipulation methods are generally
+ * specific to OpenSSL structures.
+ */
+ /// Increase the reference count on the given OpenSSL structure.
+ template <typename T>
+ T * _duplicate (T * st);
+
+ /// Deep copy the given OpenSSL structure.
+ template <typename T>
+ T * copy (T const & st);
+
+ /// Decrease the reference count on the given OpenSSL structure.
+ template <typename T>
+ void release (T * st);
+
+ /**
+ * @class OpenSSL_st_var
+ *
+ * @brief "_var" class for the OpenSSL @param T structure.
+ *
+ * This class is simply used to make operations on instances of
+ * the OpenSSL @c T structure exception safe. It is only used
+ * internally by the SSLIOP pluggable transport.
+ */
+ template <typename T>
+ class OpenSSL_st_var
+ {
+ public:
+
+ /**
+ * @name Constructors
+ *
+ * Constructors.
+ */
+ //@{
+ OpenSSL_st_var (void);
+ OpenSSL_st_var (T * st);
+ OpenSSL_st_var (OpenSSL_st_var<T> const & v);
+ OpenSSL_st_var (T const & st);
+ //@}
+
+ /// Destructor
+ ~OpenSSL_st_var (void);
+
+ /**
+ * @name Assignment operators.
+ *
+ * Assignment operators.
+ */
+ //@{
+ OpenSSL_st_var<T> & operator= (T* st);
+ OpenSSL_st_var<T> & operator= (OpenSSL_st_var<T> const & v);
+ OpenSSL_st_var<T> & operator= (T const & st);
+ //@}
+
+ T const * operator-> (void) const;
+ T* operator-> (void);
+
+ operator const T& () const;
+ operator T& ();
+
+ T* in (void) const;
+ T*& inout (void);
+ T*& out (void);
+ T* _retn (void);
+ T* ptr (void) const;
+
+ private:
+
+ /// The OpenSSL structure whose reference count is managed.
+ T * st_;
+
+ };
+ } // End SSLIOP namespace.
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+# include "orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+# pragma implementation ("SSLIOP_OpenSSL_st_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_OPENSSL_ST_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.inl b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.inl
new file mode 100644
index 00000000000..0233a73fc01
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.inl
@@ -0,0 +1,165 @@
+// -*- C++ -*-
+//
+// $Id$
+
+
+#include <openssl/crypto.h>
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <typename T> ACE_INLINE T *
+TAO::SSLIOP::_duplicate (T * st)
+{
+ // Shallow copy.
+
+ // OpenSSL provides no structure-specific functions to increase the
+ // reference count on the structure it defines, so we do it
+ // manually.
+ if (st != 0)
+ CRYPTO_add (&(st->references),
+ 1,
+ TAO::SSLIOP::OpenSSL_traits<T>::LOCK_ID);
+
+ return st;
+}
+
+template <typename T> ACE_INLINE T *
+TAO::SSLIOP::copy (T const & st)
+{
+ // Deep copy.
+ return TAO::SSLIOP::OpenSSL_traits<T>::copy (st);
+}
+
+template <typename T> ACE_INLINE void
+TAO::SSLIOP::release (T * st)
+{
+ TAO::SSLIOP::OpenSSL_traits<T>::release (st);
+}
+
+// -------------------------------------------------------------------
+
+template <typename T> ACE_INLINE
+TAO::SSLIOP::OpenSSL_st_var<T>::OpenSSL_st_var (void)
+ : st_ (0)
+{
+}
+
+template <typename T> ACE_INLINE
+TAO::SSLIOP::OpenSSL_st_var<T>::OpenSSL_st_var (T * st)
+ : st_ (st)
+{
+}
+
+template <typename T> ACE_INLINE
+TAO::SSLIOP::OpenSSL_st_var<T>::OpenSSL_st_var (
+ TAO::SSLIOP::OpenSSL_st_var<T> const & st)
+ : st_ (TAO::SSLIOP::OpenSSL_traits<T>::_duplicate (st.ptr ()))
+{
+}
+
+template <typename T> ACE_INLINE
+TAO::SSLIOP::OpenSSL_st_var<T>::OpenSSL_st_var (T const & st)
+ : st_ (TAO::SSLIOP::OpenSSL_traits<T>::copy (st))
+{
+}
+
+template <typename T> ACE_INLINE
+TAO::SSLIOP::OpenSSL_st_var<T>::~OpenSSL_st_var (void)
+{
+ TAO::SSLIOP::OpenSSL_traits<T>::release (this->st_);
+ // TAO::SSLIOP::release (this->st_);
+}
+
+template <typename T> ACE_INLINE TAO::SSLIOP::OpenSSL_st_var<T> &
+TAO::SSLIOP::OpenSSL_st_var<T>::operator= (T * st)
+{
+ TAO::SSLIOP::OpenSSL_traits<T>::release (this->st_);
+ this->st_ = st;
+ return *this;
+}
+
+template <typename T> ACE_INLINE TAO::SSLIOP::OpenSSL_st_var<T> &
+TAO::SSLIOP::OpenSSL_st_var<T>::operator= (
+ TAO::SSLIOP::OpenSSL_st_var<T> const & st)
+{
+ if (this != &st)
+ {
+ TAO::SSLIOP::OpenSSL_traits<T>::release (this->st_);
+ this->st_ = TAO::SSLIOP::OpenSSL_traits<T>::_duplicate (st.ptr ());
+ }
+
+ return *this;
+}
+
+template <typename T> ACE_INLINE TAO::SSLIOP::OpenSSL_st_var<T> &
+TAO::SSLIOP::OpenSSL_st_var<T>::operator= (T const & st)
+{
+ if (this->st_ != &st)
+ {
+ TAO::SSLIOP::OpenSSL_traits<T>::release (this->st_);
+ this->st_ = TAO::SSLIOP::OpenSSL_traits<T>::copy (st);
+ }
+
+ return *this;
+}
+
+template <typename T> ACE_INLINE T const *
+TAO::SSLIOP::OpenSSL_st_var<T>::operator-> (void) const
+{
+ return this->st_;
+}
+
+template <typename T> ACE_INLINE T *
+TAO::SSLIOP::OpenSSL_st_var<T>::operator-> (void)
+{
+ return this->st_;
+}
+
+template <typename T> ACE_INLINE
+TAO::SSLIOP::OpenSSL_st_var<T>::operator T const &() const
+{
+ return *this->st_;
+}
+
+template <typename T> ACE_INLINE
+TAO::SSLIOP::OpenSSL_st_var<T>::operator T &()
+{
+ return *this->st_;
+}
+
+template <typename T> ACE_INLINE T *
+TAO::SSLIOP::OpenSSL_st_var<T>::in (void) const
+{
+ return this->st_;
+}
+
+template <typename T> ACE_INLINE T *&
+TAO::SSLIOP::OpenSSL_st_var<T>::inout (void)
+{
+ return this->st_;
+}
+
+template <typename T> ACE_INLINE T *&
+TAO::SSLIOP::OpenSSL_st_var<T>::out (void)
+{
+ TAO::SSLIOP::OpenSSL_traits<T>::release (this->st_);
+ this->st_ = 0;
+ return this->st_;
+}
+
+template <typename T> ACE_INLINE T *
+TAO::SSLIOP::OpenSSL_st_var<T>::_retn (void)
+{
+ // Yield ownership of the OpenSSL structure.
+ T * st = this->st_;
+ this->st_ = 0;
+ return st;
+}
+
+template <typename T> ACE_INLINE T *
+TAO::SSLIOP::OpenSSL_st_var<T>::ptr (void) const
+{
+ return this->st_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OwnCredentials.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OwnCredentials.cpp
new file mode 100644
index 00000000000..7d90833fff5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OwnCredentials.cpp
@@ -0,0 +1,77 @@
+// $Id$
+
+#include "orbsvcs/SSLIOP/SSLIOP_OwnCredentials.h"
+
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_OwnCredentials,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SSLIOP::OwnCredentials::OwnCredentials (X509 *cert, EVP_PKEY *evp)
+ : SSLIOP_Credentials (cert, evp)
+{
+}
+
+TAO::SSLIOP::OwnCredentials::~OwnCredentials (void)
+{
+}
+
+TAO::SSLIOP::OwnCredentials_ptr
+TAO::SSLIOP::OwnCredentials::_duplicate (TAO::SSLIOP::OwnCredentials_ptr obj)
+{
+ if (!CORBA::is_nil (obj))
+ obj->_add_ref ();
+
+ return obj;
+}
+
+TAO::SSLIOP::OwnCredentials_ptr
+TAO::SSLIOP::OwnCredentials::_narrow (CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return TAO::SSLIOP::OwnCredentials::_duplicate (
+ dynamic_cast<TAO::SSLIOP::OwnCredentials *> (obj));
+}
+
+TAO::SSLIOP::OwnCredentials_ptr
+TAO::SSLIOP::OwnCredentials::_nil (void)
+{
+ return (OwnCredentials *) 0;
+
+}
+
+SecurityLevel3::CredentialsType
+TAO::SSLIOP::OwnCredentials::creds_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return SecurityLevel3::CT_OwnCredentials;
+}
+
+SecurityLevel3::CredsInitiator_ptr
+TAO::SSLIOP::OwnCredentials::creds_initiator (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
+ SecurityLevel3::CredsInitiator::_nil ());
+}
+
+SecurityLevel3::CredsAcceptor_ptr
+TAO::SSLIOP::OwnCredentials::creds_acceptor (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
+ SecurityLevel3::CredsAcceptor::_nil ());
+}
+
+void
+TAO::SSLIOP::OwnCredentials::release_credentials (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->creds_state_ = SecurityLevel3::CS_PendingRelease;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OwnCredentials.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OwnCredentials.h
new file mode 100644
index 00000000000..8376cda69dc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OwnCredentials.h
@@ -0,0 +1,121 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_OwnCredentials.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SSLIOP_OWN_CREDENTIALS_H
+#define TAO_SSLIOP_OWN_CREDENTIALS_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/SSLIOP/SSLIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SSLIOP/SSLIOP_Credentials.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+ class OwnCredentials;
+ typedef OwnCredentials* OwnCredentials_ptr;
+ typedef TAO_Pseudo_Var_T<OwnCredentials> OwnCredentials_var;
+ typedef TAO_Pseudo_Out_T<OwnCredentials> OwnCredentials_out;
+
+ /**
+ * @class OwnCredentials
+ *
+ * @brief Credentials representing our identity, not our peer's
+ * identity.
+ *
+ * @c OwnCredentials are a representation of our identity, not our
+ * peer's identity.
+ */
+ class OwnCredentials
+ : public virtual SecurityLevel3::OwnCredentials,
+ public virtual SSLIOP_Credentials
+ {
+ public:
+ typedef OwnCredentials_ptr _ptr_type;
+ typedef OwnCredentials_var _var_type;
+ typedef OwnCredentials_out _out_type;
+
+ /// Constructor
+ OwnCredentials (::X509 *cert, ::EVP_PKEY *evp);
+
+ static OwnCredentials_ptr _duplicate (OwnCredentials_ptr obj);
+ static OwnCredentials_ptr _nil (void);
+ static OwnCredentials_ptr _narrow (CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * @name SecurityLevel3::TargetCredentials Methods
+ *
+ * Methods required by the SecurityLevel3::Credentials
+ * interface.
+ */
+ //@{
+ SecurityLevel3::CredentialsType creds_type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ /**
+ * @name SecurityLevel3::OwnCredentials Methods
+ *
+ * Methods required by the SecurityLevel3::OwnCredentials
+ * interface.
+ */
+ //@{
+ virtual SecurityLevel3::CredsInitiator_ptr creds_initiator (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::CredsAcceptor_ptr creds_acceptor (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void release_credentials (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management
+ * through the reference counting mechanism.
+ */
+ ~OwnCredentials (void);
+ };
+
+ } // End SSLIOP namespace
+} // End TAO namespace
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_OWN_CREDENTIALS_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp
new file mode 100644
index 00000000000..f9c084779cd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp
@@ -0,0 +1,357 @@
+#include "orbsvcs/SSLIOP/SSLIOP_Profile.h"
+#include "orbsvcs/SSLIOP/ssl_endpointsC.h"
+#include "tao/CDR.h"
+#include "tao/Environment.h"
+#include "ace/OS_NS_string.h"
+
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_Profile,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_SSLIOP_Profile::TAO_SSLIOP_Profile (const ACE_INET_Addr & addr,
+ const TAO::ObjectKey & object_key,
+ const TAO_GIOP_Message_Version & version,
+ TAO_ORB_Core * orb_core,
+ const ::SSLIOP::SSL * ssl_component)
+ : TAO_IIOP_Profile (addr,
+ object_key,
+ version,
+ orb_core),
+ ssl_endpoint_ (ssl_component, 0),
+ ssl_only_ (0)
+{
+ this->ssl_endpoint_.iiop_endpoint (&this->endpoint_, true);
+}
+
+TAO_SSLIOP_Profile::TAO_SSLIOP_Profile (const char * host,
+ CORBA::UShort port,
+ const TAO::ObjectKey & object_key,
+ const ACE_INET_Addr & addr,
+ const TAO_GIOP_Message_Version & version,
+ TAO_ORB_Core * orb_core,
+ const ::SSLIOP::SSL * ssl_component)
+ : TAO_IIOP_Profile (host,
+ port,
+ object_key,
+ addr,
+ version,
+ orb_core),
+ ssl_endpoint_ (ssl_component, 0),
+ ssl_only_ (0)
+{
+ this->ssl_endpoint_.iiop_endpoint (&this->endpoint_, true);
+}
+
+TAO_SSLIOP_Profile::TAO_SSLIOP_Profile (TAO_ORB_Core * orb_core,
+ const ::SSLIOP::SSL * ssl_component)
+ : TAO_IIOP_Profile (orb_core),
+ ssl_endpoint_ (ssl_component, 0),
+ ssl_only_ (0)
+{
+ this->ssl_endpoint_.iiop_endpoint (&this->endpoint_, true);
+}
+
+TAO_SSLIOP_Profile::TAO_SSLIOP_Profile (TAO_ORB_Core * orb_core, int ssl_only)
+ : TAO_IIOP_Profile (orb_core),
+ ssl_endpoint_ (0, 0),
+ ssl_only_ (ssl_only)
+{
+ this->ssl_endpoint_.iiop_endpoint (&this->endpoint_, true);
+}
+
+TAO_SSLIOP_Profile::~TAO_SSLIOP_Profile (void)
+{
+ // Clean up the list of endpoints since we own it.
+ // Skip the head, since it is not dynamically allocated.
+ TAO_Endpoint *tmp = 0;
+
+ for (TAO_Endpoint *next = this->ssl_endpoint_.next ();
+ next != 0;
+ next = tmp)
+ {
+ tmp = next->next ();
+ delete next;
+ }
+}
+
+// return codes:
+// -1 -> error
+// 0 -> can't understand this version
+// 1 -> success.
+int
+TAO_SSLIOP_Profile::decode (TAO_InputCDR & cdr)
+{
+ int r = this->TAO_IIOP_Profile::decode (cdr);
+ if (r != 1)
+ return r;
+
+ // Attempt to decode SSLIOP::SSL tagged component. It may not be
+ // there if we are dealing with pure IIOP profile.
+ int ssl_component_found = 0;
+ IOP::TaggedComponent component;
+ component.tag = ::SSLIOP::TAG_SSL_SEC_TRANS;
+
+ if (this->tagged_components ().get_component (component))
+ {
+ TAO_InputCDR cdr (reinterpret_cast<const char*> (
+ component.component_data.get_buffer ()),
+ component.component_data.length ());
+ CORBA::Boolean byte_order;
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ return -1;
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ if (cdr >> this->ssl_endpoint_.ssl_component_)
+ ssl_component_found = 1;
+ else
+ return -1;
+ }
+
+ // Since IIOP portion of the profile has already been decoded, we
+ // know how many endpoints it should contain and can finish
+ // initialization accordingly.
+ if (this->count_ < 2)
+ {
+ // This profile contains only one endpoint. Finish initializing
+ // it.
+ this->ssl_endpoint_.iiop_endpoint (&this->endpoint_, true);
+ this->ssl_endpoint_.priority (this->endpoint_.priority ());
+ return 1;
+ }
+ else
+ {
+ // This profile contains more than one endpoint.
+ if (ssl_component_found)
+ {
+ // It is true ssl profile, i.e., not just IIOP, so must have
+ // ssl endpoints encoded.
+
+ if (this->decode_tagged_endpoints () == -1)
+ return -1;
+
+ return 1;
+ }
+ else
+ {
+ // IIOP profile - doesn't have ssl endpoints encoded. We
+ // must create 'dummy' ssl endpoint list anyways, in order to
+ // make iiop endpoints accessable and usable.
+ for (size_t i = 0;
+ i < this->count_;
+ ++i)
+ {
+ TAO_SSLIOP_Endpoint *endpoint = 0;
+ ACE_NEW_RETURN (endpoint,
+ TAO_SSLIOP_Endpoint (0, 0),
+ -1);
+ this->add_endpoint (endpoint);
+ }
+
+ // Now that we have a complete list of ssl endpoins, we can
+ // connect them with their iiop counterparts.
+ TAO_IIOP_Endpoint *iiop_endp = &this->endpoint_;
+
+ for (TAO_SSLIOP_Endpoint * ssl_endp = &this->ssl_endpoint_;
+ ssl_endp != 0;
+ ssl_endp = ssl_endp->next_)
+ {
+ ssl_endp->iiop_endpoint (iiop_endp, true);
+ ssl_endp->priority (iiop_endp->priority ());
+ iiop_endp = iiop_endp->next_;
+ }
+
+ return 1;
+ }
+ }
+}
+
+CORBA::Boolean
+TAO_SSLIOP_Profile::do_is_equivalent (const TAO_Profile * other_profile)
+{
+ const TAO_SSLIOP_Profile *op =
+ dynamic_cast<const TAO_SSLIOP_Profile *> (other_profile);
+
+ // Make sure we have a TAO_SSLIOP_Profile.
+ if (op == 0)
+ return 0;
+
+ // Now verify TAO_SSLIOP_Endpoint equivalence.
+ const TAO_SSLIOP_Endpoint *other_endp = &op->ssl_endpoint_;
+ for (TAO_SSLIOP_Endpoint *endp = &this->ssl_endpoint_;
+ endp != 0;
+ endp = endp->next_)
+ {
+ if (endp->is_equivalent (other_endp))
+ other_endp = other_endp->next_;
+ else
+ return 0;
+ }
+
+ return 1;
+}
+
+TAO_Endpoint*
+TAO_SSLIOP_Profile::endpoint (void)
+{
+ return &this->ssl_endpoint_;
+}
+
+void
+TAO_SSLIOP_Profile::add_endpoint (TAO_SSLIOP_Endpoint * endp)
+{
+ endp->next_ = this->ssl_endpoint_.next_;
+ this->ssl_endpoint_.next_ = endp;
+
+ // We do not want to add our IIOP endpoint counterpart when we are
+ // decoding a profile, and IIOP endpoints have been added before we
+ // even get to SSLIOP-specific decoding.
+ if (endp->iiop_endpoint () != 0)
+ this->TAO_IIOP_Profile::add_endpoint (endp->iiop_endpoint ());
+}
+
+int
+TAO_SSLIOP_Profile::encode_endpoints (void)
+{
+ // If we have more than one endpoint, we encode info about others
+ // into a tagged component for wire transfer.
+ if (this->count_ > 1)
+ {
+ // Encode all endpoints except the first one, since it is always
+ // transferred through standard profile component.
+
+ // Create a data structure and fill it with endpoint info for wire
+ // transfer.
+ TAO_SSLEndpointSequence endpoints;
+ endpoints.length (this->count_ - 1);
+
+ const TAO_SSLIOP_Endpoint *endpoint = this->ssl_endpoint_.next_;
+ for (size_t i = 0;
+ i < this->count_ - 1;
+ ++i)
+ {
+ endpoints[i] = endpoint->ssl_component ();
+ endpoint = endpoint->next_;
+ }
+
+ // Encode the data structure.
+ TAO_OutputCDR out_cdr;
+ if ((out_cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)
+ == 0)
+ || (out_cdr << endpoints) == 0)
+ return -1;
+
+ const CORBA::ULong length = out_cdr.total_length ();
+
+ IOP::TaggedComponent tagged_component;
+ tagged_component.tag = TAO::TAG_SSL_ENDPOINTS;
+ tagged_component.component_data.length (length);
+ CORBA::Octet *buf =
+ tagged_component.component_data.get_buffer ();
+
+ for (const ACE_Message_Block *iterator = out_cdr.begin ();
+ iterator != 0;
+ iterator = iterator->cont ())
+ {
+ CORBA::ULong i_length = iterator->length ();
+ ACE_OS::memcpy (buf, iterator->rd_ptr (), i_length);
+
+ buf += i_length;
+ }
+
+ // Add component with encoded endpoint data to this profile's
+ // TaggedComponents.
+ tagged_components_.set_component (tagged_component);
+ }
+
+ return this->TAO_IIOP_Profile::encode_endpoints ();
+}
+
+int
+TAO_SSLIOP_Profile::decode_tagged_endpoints (void)
+{
+ IOP::TaggedComponent tagged_component;
+ tagged_component.tag = TAO::TAG_SSL_ENDPOINTS;
+
+ if (this->tagged_components_.get_component (tagged_component))
+ {
+ const CORBA::Octet *buf =
+ tagged_component.component_data.get_buffer ();
+
+ TAO_InputCDR in_cdr (reinterpret_cast<const char* > (buf),
+ tagged_component.component_data.length ());
+
+ // Extract the Byte Order.
+ CORBA::Boolean byte_order;
+ if ((in_cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ return -1;
+ in_cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ // Extract endpoints sequence.
+ TAO_SSLEndpointSequence endpoints;
+ if ((in_cdr >> endpoints) == 0)
+ return -1;
+
+ // Use information extracted from the tagged component to
+ // populate the profile. Begin from the end of the sequence to
+ // preserve endpoint order, since <add_endpoint> method reverses
+ // the order of endpoints in the list.
+ for (CORBA::ULong i = endpoints.length () - 1;
+ (i + 1) != 0;
+ --i)
+ {
+ TAO_SSLIOP_Endpoint *endpoint = 0;
+ ACE_NEW_RETURN (endpoint,
+ TAO_SSLIOP_Endpoint (0, 0),
+ -1);
+ endpoint->ssl_component_ = endpoints[i];
+ this->add_endpoint (endpoint);
+ }
+
+ // Now that we have a complete list of ssl endpoins, we can
+ // connect them with their iiop counterparts, which have been
+ // extracted/chained during the IIOP profile decoding.
+ TAO_IIOP_Endpoint *iiop_endp = &this->endpoint_;
+
+ for (TAO_SSLIOP_Endpoint * ssl_endp = &this->ssl_endpoint_;
+ ssl_endp != 0;
+ ssl_endp = ssl_endp->next_)
+ {
+ ssl_endp->iiop_endpoint (iiop_endp, true);
+ ssl_endp->priority (iiop_endp->priority ());
+ iiop_endp = iiop_endp->next_;
+ }
+
+ return 0;
+ }
+
+ // Since this method is only called if we are expecting
+ // TAO_TAG_SSL_ENDPOINTS component, failure to find it is an error.
+ return -1;
+}
+
+void
+TAO_SSLIOP_Profile::parse_string (const char * ior
+ ACE_ENV_ARG_DECL)
+{
+ TAO_IIOP_Profile::parse_string (ior
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->ssl_endpoint_.iiop_endpoint (&this->endpoint_, true);
+
+ if( ssl_only_)
+ {
+ this->ssl_endpoint_.ssl_component_.port = this->endpoint_.port_;
+
+ // Note that the Security::NoProtection bit is cleared since we
+ // are sure the server supports SSL (we're told so)
+ ACE_CLR_BITS (this->ssl_endpoint_.ssl_component_.target_supports,
+ Security::NoProtection);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.h
new file mode 100644
index 00000000000..849914f148d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.h
@@ -0,0 +1,179 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_Profile.h
+ *
+ * $Id$
+ *
+ * SSLIOP profile specific processing
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SSLIOP_PROFILE_H
+#define TAO_SSLIOP_PROFILE_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/SSLIOP/SSLIOP_Endpoint.h"
+#include "tao/IIOP_Profile.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// namespace TAO
+// {
+// namespace SSLIOP
+// {
+
+ /**
+ * @class Profile
+ *
+ * @brief This class defines the protocol specific attributes
+ * required for locating ORBs over a TCP/IP network, using
+ * either IIOP or IIOP/SSL for communication.
+ *
+ * This class extends TAO_IIOP_Profile to support secure
+ * communication using SSL.
+ */
+ class TAO_SSLIOP_Profile : public TAO_IIOP_Profile
+ {
+ public:
+ /// Profile constructor, same as above except the object_key has
+ /// already been marshaled.
+ TAO_SSLIOP_Profile (const ACE_INET_Addr & addr,
+ const TAO::ObjectKey & object_key,
+ const TAO_GIOP_Message_Version & version,
+ TAO_ORB_Core * orb_core,
+ const ::SSLIOP::SSL * ssl_component);
+
+ /// Profile constructor, this is the most efficient since it
+ /// doesn't require any address resolution processing.
+ TAO_SSLIOP_Profile (const char *host,
+ CORBA::UShort port,
+ const TAO::ObjectKey & object_key,
+ const ACE_INET_Addr & addr,
+ const TAO_GIOP_Message_Version & version,
+ TAO_ORB_Core * orb_core,
+ const ::SSLIOP::SSL * ssl_component);
+
+ /// Create profile with the given SSLIOP tagged component.
+ TAO_SSLIOP_Profile (TAO_ORB_Core * orb_core,
+ const ::SSLIOP::SSL * ssl_component);
+
+ /// Profile constructor. ssl_only != 0 will force secure
+ /// connections, pnly.
+ TAO_SSLIOP_Profile (TAO_ORB_Core * orb_core, int ssl_only = 0);
+
+
+ // = Please see Profile.h for the documentation of these methods.
+ virtual int decode (TAO_InputCDR& cdr);
+ virtual int encode_endpoints (void);
+ virtual TAO_Endpoint *endpoint (void);
+
+ /**
+ * Override parse_string() from the base class to update the SSL
+ * endpoint's iiop endpoint once the base class has completed
+ * parsing the string.
+ *@par
+ * Initialize this object using the given input string.
+ * URL-style string contain only one endpoint.
+ */
+ virtual void parse_string (const char * string
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Add @a endp to this profile's list of endpoints (it is
+ * inserted next to the head of the list). This profiles takes
+ * ownership of @a endp. If @a endp's @c iiop_endpoint_ member
+ * is not 0, it is added to our parent's class endpoint list.
+ */
+ void add_endpoint (TAO_SSLIOP_Endpoint * endp);
+
+ protected:
+
+ /// Destructor.
+ /**
+ * Protected destructor to enforce proper memory management
+ * through the reference counting mechanism.
+ */
+ ~TAO_SSLIOP_Profile (void);
+
+ /// Profile equivalence template method.
+ /**
+ * @see TAO_Profile::do_is_equivalent()
+ */
+ virtual CORBA::Boolean do_is_equivalent (
+ const TAO_Profile * other_profile);
+
+ private:
+
+ /**
+ * Helper for @c decode. Decodes TAO_TAG_SSL_ENDPOINTS from a
+ * tagged component. Decode only if RTCORBA is enabled.
+ *
+ * @return 0 on success and -1 on failure.
+ *
+ * @note This should be enabled only when RTCORBA is enabled,
+ * but sadly others pay the price (of footprint) under
+ * normal operations.
+ */
+ int decode_tagged_endpoints (void);
+
+ /**
+ * Head of this profile's list of endpoints. This endpoint is
+ * not dynamically allocated because a profile always contains
+ * at least one endpoint.
+ * @par
+ * Currently, a profile contains more than one endpoint, i.e.,
+ * list contains more than just the head, only when RTCORBA is
+ * enabled. However, in the near future, this will be used in
+ * non-RT mode as well, e.g., to support @c
+ * TAG_ALTERNATE_IIOP_ADDRESS feature.
+ * @par
+ * Since SSLIOP profile is an extension of IIOP profile, its
+ * addressing info is contained in two places: IIOP parent
+ * class contains all iiop addressing while this class contains
+ * SSL-specific addressing additions to iiop. This means that
+ * there are two lists of endpoints: one maintained in the
+ * parent class and one maintained here. Each ssl endpoint
+ * maintains a pointer to its counterpart in the parent class
+ * endpoint list.
+ * @par
+ * For transmission of IIOP addressing information, see
+ * @c TAO_IIOP_Profile. Addressing info of the default SSL
+ * endpoint, i.e., head of the list, is transmitted using
+ * standard SSLIOP::TAG_SSL_SEC_TRANS tagged component. See
+ * @c encode_endpoints method documentation above for how the
+ * rest of the SSL endpoint list is transmitted.
+ */
+ TAO_SSLIOP_Endpoint ssl_endpoint_;
+
+ /**
+ * Allways treat this endpoint as secure, even if the constructor
+ * did not explicitely specify a tagged component for SSL.
+ * @par
+ * Most likely the parse_string() will supply a subset of the
+ * attributes - port number, for instance.
+ */
+ int ssl_only_;
+
+ };
+
+// } // End SSLIOP namespace.
+// } // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_PROFILE_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_SSL.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_SSL.h
new file mode 100644
index 00000000000..b9b01e4a85d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_SSL.h
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_SSL.h
+ *
+ * OpenSSL @c SSL data structure specializations and typedefs.
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_SSLIOP_SSL_H
+#define TAO_SSLIOP_SSL_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/SSLIOP/SSLIOP_OpenSSL_st_T.h"
+
+#include <openssl/ssl.h>
+#include <openssl/crypto.h>
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+ // OpenSSL @c SSL structure traits specialization.
+ template <>
+ struct OpenSSL_traits< ::SSL >
+ {
+ /// OpenSSL lock ID for use in OpenSSL CRYPTO_add() reference
+ /// count manipulation function.
+ enum { LOCK_ID = CRYPTO_LOCK_SSL };
+
+ /// Increase the reference count on the given OpenSSL structure.
+ /**
+ * @note This used to be in a function template but MSVC++ 6
+ * can't handle function templates correctly so reproduce
+ * the code in each specialization. *sigh*
+ */
+ static ::SSL * _duplicate (::SSL * st)
+ {
+ if (st != 0)
+ CRYPTO_add (&(st->references),
+ 1,
+ LOCK_ID);
+
+ return st;
+ }
+
+ /// Perform deep copy of the given OpenSSL structure.
+ static ::SSL * copy (::SSL const & st)
+ {
+ return ::SSL_dup (const_cast< ::SSL * > (&st));
+ }
+
+ /// Decrease the reference count on the given OpenSSL
+ /// structure.
+ static void release (::SSL * st)
+ {
+ ::SSL_free (st);
+ }
+ };
+
+ typedef OpenSSL_st_var< ::SSL > SSL_var;
+
+ } // End SSLIOP namespace.
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_SSL_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_TargetCredentials.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_TargetCredentials.cpp
new file mode 100644
index 00000000000..a081a95c168
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_TargetCredentials.cpp
@@ -0,0 +1,134 @@
+#include "orbsvcs/SSLIOP/SSLIOP_TargetCredentials.h"
+
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_TargetCredentials,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SSLIOP::TargetCredentials::TargetCredentials (::X509 *cert,
+ ::EVP_PKEY *evp)
+ : SSLIOP_Credentials (cert, evp)
+{
+}
+
+
+SecurityLevel3::CredentialsType
+TAO::SSLIOP::TargetCredentials::creds_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return SecurityLevel3::CT_TargetCredentials;
+}
+
+char *
+TAO::SSLIOP::TargetCredentials::context_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+SecurityLevel3::Principal *
+TAO::SSLIOP::TargetCredentials::client_principal (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+SecurityLevel3::StatementList *
+TAO::SSLIOP::TargetCredentials::client_supporting_statements (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+SecurityLevel3::ResourceNameList *
+TAO::SSLIOP::TargetCredentials::client_restricted_resources (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+SecurityLevel3::Principal *
+TAO::SSLIOP::TargetCredentials::target_principal (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+SecurityLevel3::StatementList *
+TAO::SSLIOP::TargetCredentials::target_supporting_statements (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+SecurityLevel3::ResourceNameList *
+TAO::SSLIOP::TargetCredentials::target_restricted_resources (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+SecurityLevel3::OwnCredentials_ptr
+TAO::SSLIOP::TargetCredentials::parent_credentials (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
+ SecurityLevel3::OwnCredentials::_nil ());
+}
+
+CORBA::Boolean
+TAO::SSLIOP::TargetCredentials::client_authentication (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+CORBA::Boolean
+TAO::SSLIOP::TargetCredentials::target_authentication (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+CORBA::Boolean
+TAO::SSLIOP::TargetCredentials::confidentiality (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+CORBA::Boolean
+TAO::SSLIOP::TargetCredentials::integrity (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+CORBA::Boolean
+TAO::SSLIOP::TargetCredentials::target_embodied (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+CORBA::Boolean
+TAO::SSLIOP::TargetCredentials::target_endorsed (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+}
+
+void
+TAO::SSLIOP::TargetCredentials::release (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_TargetCredentials.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_TargetCredentials.h
new file mode 100644
index 00000000000..920db9d2e61
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_TargetCredentials.h
@@ -0,0 +1,129 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_TargetCredentials.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_SSLIOP_TARGET_CREDENTIALS_H
+#define TAO_SSLIOP_TARGET_CREDENTIALS_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/SSLIOP/SSLIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SSLIOP/SSLIOP_Credentials.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+ /**
+ * @class TargetCredentials
+ *
+ * @brief SSLIOP-specific implementation of the
+ * SecurityLevel3::TargetCredentials interface.
+ *
+ * This class implements SSLIOP-specific
+ * SecurityLevel3::TargetCredentials.
+ */
+ class TAO_SSLIOP_Export TargetCredentials
+ : public virtual SecurityLevel3::TargetCredentials,
+ public virtual SSLIOP_Credentials
+ {
+ public:
+
+ TargetCredentials (::X509 *cert, ::EVP_PKEY *evp);
+
+ /**
+ * @name SecurityLevel3::Credentials Methods
+ *
+ * Methods required by the SecurityLevel3::Credentials
+ * interface.
+ */
+ //@{
+ virtual SecurityLevel3::CredentialsType creds_type (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ /**
+ * @name SecurityLevel3::TargetCredentials Methods
+ *
+ * Methods required by the SecurityLevel3::TargetCredentials
+ * interface.
+ */
+ //@{
+ virtual char * context_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::Principal * client_principal (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::StatementList * client_supporting_statements (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::ResourceNameList * client_restricted_resources (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::Principal * target_principal (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::StatementList * target_supporting_statements (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::ResourceNameList * target_restricted_resources (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::OwnCredentials_ptr parent_credentials (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean client_authentication (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean target_authentication (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean confidentiality (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean integrity (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean target_embodied (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean target_endorsed (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void release (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ };
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_TARGET_CREDENTIALS_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp
new file mode 100644
index 00000000000..3f60b36bcdf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp
@@ -0,0 +1,385 @@
+#include "orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Transport.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Profile.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Acceptor.h"
+
+#include "tao/debug.h"
+
+#include "tao/Timeprobe.h"
+#include "tao/CDR.h"
+#include "tao/Transport_Mux_Strategy.h"
+#include "tao/Wait_Strategy.h"
+#include "tao/Stub.h"
+#include "tao/ORB_Core.h"
+#include "tao/debug.h"
+#include "tao/GIOP_Message_Base.h"
+#include "tao/Acceptor_Registry.h"
+#include "tao/Thread_Lane_Resources.h"
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_Transport,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SSLIOP::Transport::Transport (
+ TAO::SSLIOP::Connection_Handler *handler,
+ TAO_ORB_Core *orb_core,
+ CORBA::Boolean /* flag */)
+ : TAO_Transport (IOP::TAG_INTERNET_IOP, orb_core),
+ connection_handler_ (handler),
+ messaging_object_ (0)
+{
+ // Use the normal GIOP object
+ ACE_NEW (this->messaging_object_,
+ TAO_GIOP_Message_Base (orb_core, this));
+}
+
+TAO::SSLIOP::Transport::~Transport (void)
+{
+ delete this->messaging_object_;
+}
+
+ACE_Event_Handler *
+TAO::SSLIOP::Transport::event_handler_i (void)
+{
+ return this->connection_handler_;
+}
+
+TAO_Connection_Handler *
+TAO::SSLIOP::Transport::connection_handler_i (void)
+{
+ return this->connection_handler_;
+}
+
+TAO_Pluggable_Messaging *
+TAO::SSLIOP::Transport::messaging_object (void)
+{
+ return this->messaging_object_;
+}
+
+int
+TAO::SSLIOP::Transport::handle_input (TAO_Resume_Handle &rh,
+ ACE_Time_Value *max_wait_time,
+ int block)
+{
+ int result = 0;
+
+ // Set up the SSLIOP::Current object.
+ TAO::SSLIOP::State_Guard ssl_state_guard (this->connection_handler_,
+ result);
+
+ if (result == -1)
+ return -1;
+
+ return TAO_Transport::handle_input (rh,
+ max_wait_time,
+ block);
+}
+
+ssize_t
+TAO::SSLIOP::Transport::send (iovec *iov,
+ int iovcnt,
+ size_t &bytes_transferred,
+ const ACE_Time_Value *max_wait_time)
+{
+ const ssize_t retval =
+ this->connection_handler_->peer ().sendv (iov, iovcnt, max_wait_time);
+
+ if (retval > 0)
+ bytes_transferred = retval;
+
+ return retval;
+}
+
+ssize_t
+TAO::SSLIOP::Transport::recv (char *buf,
+ size_t len,
+ const ACE_Time_Value *max_wait_time)
+{
+ const ssize_t n = this->connection_handler_->peer ().recv (buf,
+ len,
+ max_wait_time);
+
+ // Most of the errors handling is common for
+ // Now the message has been read
+ if (n == -1
+ && TAO_debug_level > 4
+ && errno != ETIME)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - %p \n"),
+ ACE_TEXT ("TAO - read message failure ")
+ ACE_TEXT ("recv_i () \n")));
+ }
+
+ // Error handling
+ if (n == -1)
+ {
+ if (errno == EWOULDBLOCK)
+ return 0;
+
+ return -1;
+ }
+ // @@ What are the other error handling here??
+ else if (n == 0)
+ {
+ return -1;
+ }
+
+ return n;
+}
+
+int
+TAO::SSLIOP::Transport::send_request (TAO_Stub *stub,
+ TAO_ORB_Core *orb_core,
+ TAO_OutputCDR &stream,
+ int message_semantics,
+ ACE_Time_Value *max_wait_time)
+{
+ if (this->ws_->sending_request (orb_core,
+ message_semantics) == -1)
+ return -1;
+
+ if (this->send_message (stream,
+ stub,
+ message_semantics,
+ max_wait_time) == -1)
+
+ return -1;
+
+ return 0;
+}
+
+int
+TAO::SSLIOP::Transport::send_message (TAO_OutputCDR &stream,
+ TAO_Stub *stub,
+ int message_semantics,
+ ACE_Time_Value *max_wait_time)
+{
+ // Format the message in the stream first
+ if (this->messaging_object_->format_message (stream) != 0)
+ return -1;
+
+ // Strictly speaking, should not need to loop here because the
+ // socket never gets set to a nonblocking mode ... some Linux
+ // versions seem to need it though. Leaving it costs little.
+
+ // This guarantees to send all data (bytes) or return an error.
+ const ssize_t n = this->send_message_shared (stub,
+ message_semantics,
+ stream.begin (),
+ max_wait_time);
+
+ if (n == -1)
+ {
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO: (%P|%t|%N|%l) closing transport ")
+ ACE_TEXT ("%d after fault %p\n"),
+ this->id (),
+ ACE_TEXT ("send_message ()\n")));
+
+ return -1;
+ }
+
+ return 1;
+}
+
+
+int
+TAO::SSLIOP::Transport::generate_request_header (
+ TAO_Operation_Details &opdetails,
+ TAO_Target_Specification &spec,
+ TAO_OutputCDR &msg)
+{
+ // Check whether we have a Bi Dir IIOP policy set, whether the
+ // messaging objects are ready to handle bidirectional connections
+ // and also make sure that we have not recd. or sent any information
+ // regarding this before...
+ if (this->orb_core ()->bidir_giop_policy ()
+ && this->messaging_object_->is_ready_for_bidirectional (msg)
+ && this->bidirectional_flag () < 0)
+ {
+ this->set_bidir_context_info (opdetails);
+
+ // Set the flag to 1
+ this->bidirectional_flag (1);
+
+ // At the moment we enable BiDIR giop we have to get a new
+ // request id to make sure that we follow the even/odd rule
+ // for request id's. We only need to do this when enabled
+ // it, after that the Transport Mux Strategy will make sure
+ // that the rule is followed
+ opdetails.request_id (this->tms ()->request_id ());
+ }
+
+ // We are going to pass on this request to the underlying messaging
+ // layer. It should take care of this request
+ return TAO_Transport::generate_request_header (opdetails,
+ spec,
+ msg);
+}
+
+int
+TAO::SSLIOP::Transport::messaging_init (CORBA::Octet major,
+ CORBA::Octet minor)
+{
+ this->messaging_object_->init (major,
+ minor);
+ return 1;
+}
+
+
+int
+TAO::SSLIOP::Transport::tear_listen_point_list (TAO_InputCDR &cdr)
+{
+ CORBA::Boolean byte_order;
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ return -1;
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ IIOP::ListenPointList listen_list;
+ if ((cdr >> listen_list) == 0)
+ return -1;
+
+ // As we have received a bidirectional information, set the flag to
+ // 0
+ this->bidirectional_flag (0);
+
+ return this->connection_handler_->process_listen_point_list (listen_list);
+}
+
+
+
+void
+TAO::SSLIOP::Transport::set_bidir_context_info (
+ TAO_Operation_Details &opdetails)
+{
+ // Get a handle on to the acceptor registry
+ TAO_Acceptor_Registry &ar =
+ this->orb_core ()->lane_resources ().acceptor_registry ();
+
+ // Get the first acceptor in the registry
+ TAO_AcceptorSetIterator acceptor = ar.begin ();
+
+ IIOP::ListenPointList listen_point_list;
+
+ for (;
+ acceptor != ar.end ();
+ acceptor++)
+ {
+ // Check whether it is a IIOP acceptor
+ if ((*acceptor)->tag () == IOP::TAG_INTERNET_IOP)
+ {
+ if (this->get_listen_point (listen_point_list,
+ *acceptor) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "TAO (%P|%t) - SSLIOP_Transport::set_bidir_info, ",
+ "error getting listen_point \n"));
+
+ return;
+ }
+ }
+ }
+
+ // We have the ListenPointList at this point. Create a output CDR
+ // stream at this point
+ TAO_OutputCDR cdr;
+
+ // Marshall the information into the stream
+ if ((cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER) == 0)
+ || (cdr << listen_point_list) == 0)
+ return;
+
+ // Add this info in to the svc_list
+ opdetails.request_service_context ().set_context (IOP::BI_DIR_IIOP,
+ cdr);
+ return;
+}
+
+
+int
+TAO::SSLIOP::Transport::get_listen_point (
+ IIOP::ListenPointList &listen_point_list,
+ TAO_Acceptor *acceptor)
+{
+ TAO::SSLIOP::Acceptor *ssliop_acceptor =
+ dynamic_cast<TAO::SSLIOP::Acceptor *> (acceptor);
+
+ if (ssliop_acceptor == 0)
+ return -1;
+
+ // Get the array of IIOP (not SSLIOP!) endpoints serviced by the
+ // SSLIOP_Acceptor.
+ const ACE_INET_Addr *endpoint_addr =
+ ssliop_acceptor->endpoints ();
+
+ // Get the count
+ const size_t count =
+ ssliop_acceptor->endpoint_count ();
+
+ // The SSL port is stored in the SSLIOP::SSL component associated
+ // with the SSLIOP_Acceptor.
+ const ::SSLIOP::SSL &ssl = ssliop_acceptor->ssl_component ();
+
+ // Get the local address of the connection
+ ACE_INET_Addr local_addr;
+ {
+ if (this->connection_handler_->peer ().get_local_addr (local_addr)
+ == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Could not resolve local host")
+ ACE_TEXT (" address in get_listen_point()\n")),
+ -1);
+ }
+
+ }
+
+ // Note: Looks like there is no point in sending the list of
+ // endpoints on interfaces on which this connection has not
+ // been established. If this is wrong, please correct me.
+ CORBA::String_var local_interface;
+
+ // Get the hostname for the local address
+ if (ssliop_acceptor->hostname (this->orb_core_,
+ local_addr,
+ local_interface.out ()) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Could not resolve local host")
+ ACE_TEXT (" name \n")),
+ -1);
+ }
+
+ for (size_t index = 0; index < count; ++index)
+ {
+ if (local_addr.get_ip_address ()
+ == endpoint_addr[index].get_ip_address ())
+ {
+ // Get the count of the number of elements
+ const CORBA::ULong len = listen_point_list.length ();
+
+ // Increase the length by 1
+ listen_point_list.length (len + 1);
+
+ // We have the connection and the acceptor endpoint on the
+ // same interface
+ IIOP::ListenPoint & point = listen_point_list[len];
+ point.host = CORBA::string_dup (local_interface.in ());
+
+ // All endpoints, if more than one, serviced by the
+ // SSLIOP_Acceptor should be listening on the same port (due
+ // to the bind to the INADDR_ANY address).
+ point.port = ssl.port;
+ }
+ }
+
+ return 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h
new file mode 100644
index 00000000000..fec7a5ee95f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h
@@ -0,0 +1,159 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_Transport.h
+ *
+ * $Id$
+ *
+ * SSLIOP Transport specific processing.
+ *
+ * @author Carlos O'Ryan <coryan@ece.uci.edu>
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SSLIOP_TRANSPORT_H
+#define TAO_SSLIOP_TRANSPORT_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/SSLIOP/SSLIOP_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Transport.h"
+#include "tao/operation_details.h"
+#include "tao/GIOP_Message_Version.h"
+#include "tao/Pluggable_Messaging_Utils.h"
+#include "tao/IIOPC.h"
+
+#include "ace/SSL/SSL_SOCK_Stream.h"
+
+#include "ace/Svc_Handler.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward decls.
+class TAO_ORB_Core;
+class TAO_Pluggable_Messaging;
+class TAO_Acceptor;
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+ typedef ACE_Svc_Handler<ACE_SSL_SOCK_STREAM, ACE_NULL_SYNCH> SVC_HANDLER;
+
+ class Handler_Base;
+ class Connection_Handler;
+
+ /**
+ * @class Transport
+ *
+ * @brief SSLIOP-specific transport implementation.
+ *
+ * SSLIOP-specific transport implementation.
+ */
+ class TAO_SSLIOP_Export Transport : public TAO_Transport
+ {
+ public:
+
+ /// Constructor.
+ Transport (Connection_Handler *handler,
+ TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag);
+
+ /// Default destructor.
+ ~Transport (void);
+
+ /// Overload of the handle_input () in the TAO_Transport
+ /// class. This is required to set up the state guard. The
+ /// thread-per-connection and wait on RW strategies call this
+ /// handle_input ().
+ virtual int handle_input (TAO_Resume_Handle &rh,
+ ACE_Time_Value *max_wait_time = 0,
+ int block = 0);
+
+ protected:
+ /** @name Overridden Template Methods
+ *
+ * These are implementations of template methods declared by
+ * TAO_Transport.
+ */
+ //@{
+ virtual ACE_Event_Handler * event_handler_i (void);
+ virtual TAO_Connection_Handler *connection_handler_i (void);
+
+ virtual TAO_Pluggable_Messaging *messaging_object (void);
+
+ /// Write the complete Message_Block chain to the connection.
+ virtual ssize_t send (iovec *iov, int iovcnt,
+ size_t &bytes_transferred,
+ const ACE_Time_Value *timeout = 0);
+
+ /// Read len bytes from into buf.
+ virtual ssize_t recv (char *buf,
+ size_t len,
+ const ACE_Time_Value *s = 0);
+
+ public:
+ /// @todo These methods IMHO should have more meaningful
+ /// names. The names seem to indicate nothing.
+ virtual int send_request (TAO_Stub *stub,
+ TAO_ORB_Core *orb_core,
+ TAO_OutputCDR &stream,
+ int message_semantics,
+ ACE_Time_Value *max_wait_time);
+
+ virtual int send_message (TAO_OutputCDR &stream,
+ TAO_Stub *stub = 0,
+ int message_semantics =
+ TAO_Transport::TAO_TWOWAY_REQUEST,
+ ACE_Time_Value *max_time_wait = 0);
+
+ virtual int generate_request_header (TAO_Operation_Details &opdetails,
+ TAO_Target_Specification &spec,
+ TAO_OutputCDR &msg);
+
+ /// Initialising the messaging object
+ virtual int messaging_init (CORBA::Octet major,
+ CORBA::Octet minor);
+
+ /// Open teh service context list and process it.
+ virtual int tear_listen_point_list (TAO_InputCDR &cdr);
+ //@}
+
+ private:
+
+ /// Set the Bidirectional context info in the service context
+ /// list.
+ void set_bidir_context_info (TAO_Operation_Details &opdetails);
+
+ /// Add the listen points in @a acceptor to the @a
+ /// listen_point_list if this connection is in the same
+ /// interface as that of the endpoints in the @a acceptor.
+ int get_listen_point (IIOP::ListenPointList &listen_point_list,
+ TAO_Acceptor *acceptor);
+
+ private:
+
+ /// The connection service handler used for accessing lower layer
+ /// communication protocols.
+ Connection_Handler *connection_handler_;
+
+ /// Our messaging object.
+ TAO_Pluggable_Messaging *messaging_object_;
+ };
+
+ } // End SSLIOP namespace.
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_SSLIOP_TRANSPORT_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.cpp
new file mode 100644
index 00000000000..385e58f64e2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.cpp
@@ -0,0 +1,58 @@
+#include "orbsvcs/SSLIOP/SSLIOP_Util.h"
+
+
+ACE_RCSID (SSLIOP,
+ SSLIOP_Util,
+ "$Id$")
+
+
+#include "orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Current.h"
+
+#include "tao/ORB_Core.h"
+#include "tao/debug.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SSLIOP::Current_ptr
+TAO::SSLIOP::Util::current (
+ TAO_ORB_Core *orb_core)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Go straight to the object_ref_table in the ORB Core to avoid
+ // the ORB::resolve_initial_references() mechanism's complaints
+ // about the fact that the ORB isn't fully initialized yet
+ // (happens on the client side).
+ CORBA::Object_var obj =
+ orb_core->object_ref_table ().resolve_initial_reference (
+ "SSLIOPCurrent");
+
+ TAO::SSLIOP::Current_var tao_current =
+ TAO::SSLIOP::Current::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (tao_current.in ()))
+ ACE_TRY_THROW (CORBA::INV_OBJREF ());
+
+ return tao_current._retn ();
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Could not resolve "
+ "\"SSLIOPCurrent\" object");
+
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.h
new file mode 100644
index 00000000000..15e3e5f1545
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.h
@@ -0,0 +1,65 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_Util.h
+ *
+ * $Id$
+ *
+ * Utility class used by the SSLIOP pluggable protocol.
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SSLIOP_UTIL_H
+#define TAO_SSLIOP_UTIL_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/SSLIOP/SSLIOP_Current.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ORB_Core;
+class TAO_IIOP_Properties;
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+ /**
+ * @class Util
+ *
+ * @brief Class that provides utility/helper methods for several
+ * classes in the SSLIOP pluggable protocol.
+ *
+ * Methods useful to many classes in the SSLIOP pluggable protocol
+ * are centrally located in this uility class.
+ */
+ class Util
+ {
+ public:
+
+ /// Access Current.
+ static TAO::SSLIOP::Current_ptr current (
+ TAO_ORB_Core *orb_core);
+
+ };
+
+ } // End SSLIOP namespace.
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_UTIL_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_X509.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_X509.h
new file mode 100644
index 00000000000..fc46e69fa9c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_X509.h
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SSLIOP_X509.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_SSLIOP_X509_H
+#define TAO_SSLIOP_X509_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/SSLIOP/SSLIOP_OpenSSL_st_T.h"
+
+#include <openssl/x509.h>
+#include <openssl/crypto.h>
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SSLIOP
+ {
+ // OpenSSL @c X509 structure traits specialization.
+ template <>
+ struct OpenSSL_traits< ::X509 >
+ {
+ /// OpenSSL lock ID for use in OpenSSL CRYPTO_add() reference
+ /// count manipulation function.
+ enum { LOCK_ID = CRYPTO_LOCK_X509 };
+
+ /// Increase the reference count on the given OpenSSL structure.
+ /**
+ * @note This used to be in a function template but MSVC++ 6
+ * can't handle function templates correctly so reproduce
+ * the code in each specialization. *sigh*
+ */
+ static ::X509 * _duplicate (::X509 * st)
+ {
+ if (st != 0)
+ CRYPTO_add (&(st->references),
+ 1,
+ LOCK_ID);
+
+ return st;
+ }
+
+ /// Perform deep copy of the given OpenSSL structure.
+ static ::X509 * copy (::X509 const & st)
+ {
+ return ::X509_dup (const_cast< ::X509 *> (&st));
+ }
+
+ /// Decrease the reference count on the given OpenSSL
+ /// structure.
+ static void release (::X509 * st)
+ {
+ ::X509_free (st);
+ }
+ };
+
+ typedef OpenSSL_st_var< ::X509 > X509_var;
+
+ } // End SSLIOP namespace.
+} // End TAO namespace.
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SSLIOP_X509_H */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/params_dup.c b/TAO/orbsvcs/orbsvcs/SSLIOP/params_dup.c
new file mode 100644
index 00000000000..cea38d78e06
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/params_dup.c
@@ -0,0 +1,19 @@
+// $Id$
+
+#include "params_dup.h"
+
+#include <openssl/asn1.h>
+
+
+DSA *
+DSAPARAMS_DUP_WRAPPER_NAME (DSA * dsa)
+{
+ return DSAparams_dup (dsa);
+}
+
+DH *
+DHPARAMS_DUP_WRAPPER_NAME (DH * dh)
+{
+ return DHparams_dup (dh);
+}
+
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/params_dup.h b/TAO/orbsvcs/orbsvcs/SSLIOP/params_dup.h
new file mode 100644
index 00000000000..350705ec2d0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/params_dup.h
@@ -0,0 +1,44 @@
+/* $Id$ */
+
+#ifndef TAO_SSLIOP_PARAMS_DUP_H
+#define TAO_SSLIOP_PARAMS_DUP_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/config-macros.h"
+#include "tao/Versioned_Namespace.h"
+
+// As of 0.9.7e, OpenSSL's DSAparams_dup() and DHparams_dup() macros
+// contain casts that are invalid in C++. These C wrapper functions
+// allows them to be called from C++.
+
+#include <openssl/dsa.h>
+#include <openssl/dh.h>
+
+#if (defined (TAO_HAS_VERSIONED_NAMESPACE) && TAO_HAS_VERSIONED_NAMESPACE == 1)
+
+# define DSAPARAMS_DUP_WRAPPER_NAME ACE_PREPROC_CONCATENATE(TAO_VERSIONED_NAMESPACE_NAME, _DSAparams_dup_wrapper)
+# define DHPARAMS_DUP_WRAPPER_NAME ACE_PREPROC_CONCATENATE(TAO_VERSIONED_NAMESPACE_NAME, _DHparams_dup_wrapper)
+
+#else
+
+# define DSAPARAMS_DUP_WRAPPER_NAME DSAparams_dup_wrapper
+# define DHPARAMS_DUP_WRAPPER_NAME DHparams_dup_wrapper
+
+#endif /* ACE_HAS_VERSIONED_NAMESPACE == 1 */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern DSA *DSAPARAMS_DUP_WRAPPER_NAME (DSA *dsa);
+extern DH *DHPARAMS_DUP_WRAPPER_NAME (DH *dh);
+
+#ifdef __cplusplus
+}
+#endif
+
+#include /**/ "ace/post.h"
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/ssl_endpoints.pidl b/TAO/orbsvcs/orbsvcs/SSLIOP/ssl_endpoints.pidl
new file mode 100644
index 00000000000..93bbab422d8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/ssl_endpoints.pidl
@@ -0,0 +1,33 @@
+// $Id$
+// ================================================================
+
+/**
+ * This file contains idl definition for data structures used to
+ * encapsulate data in TAO_TAG_SSL_ENDPOINTS tagged component. This
+ * TAO-specific component is used for transmission of multiple
+ * endpoints per single SSLIOP profile. See SSLIOP_Profile.*
+ * for more details.
+ *
+ * This file was used to generate the code in
+ * ssl_endpoints.* The command used to generate code
+ * is:
+ *
+ * tao_idl
+ * -Sa -Sc -Gp -Gd -DCORBA3 -Sci
+ * -Wb,export_macro=TAO_SSLIOP_Export \
+ * -Wb,pre_include="ace/pre.h" \
+ * -Wb,post_include="ace/post.h" \
+ * ssl_endpoints.pidl
+ */
+
+#ifndef _SSL_ENDPOINTS_IDL_
+#define _SSL_ENDPOINTS_IDL_
+
+#include "orbsvcs/SSLIOP.idl"
+
+/// Stores information for a collection of SSLIOP endpoints.
+typedef sequence <SSLIOP::SSL> TAO_SSLEndpointSequence;
+
+#pragma prefix ""
+
+#endif /* _SSL_ENDPOINTS_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/ssl_endpointsC.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/ssl_endpointsC.cpp
new file mode 100644
index 00000000000..b9d85e7b2b7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/ssl_endpointsC.cpp
@@ -0,0 +1,165 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:291
+
+
+#include "tao/AnyTypeCode/Null_RefCount_Policy.h"
+#include "tao/AnyTypeCode/TypeCode_Constants.h"
+#include "tao/AnyTypeCode/Alias_TypeCode_Static.h"
+#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h"
+#include "tao/AnyTypeCode/String_TypeCode_Static.h"
+#include "orbsvcs/SSLIOP/ssl_endpointsC.h"
+#include "tao/CDR.h"
+
+#if defined (__BORLANDC__)
+#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig
+#endif /* __BORLANDC__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// TAO_IDL - Generated from
+// be\be_visitor_arg_traits.cpp:69
+
+// Arg traits specializations.
+namespace TAO
+{
+}
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_sequence/sequence_cs.cpp:65
+
+#if !defined (_TAO_SSLENDPOINTSEQUENCE_CS_)
+#define _TAO_SSLENDPOINTSEQUENCE_CS_
+
+TAO_SSLEndpointSequence::TAO_SSLEndpointSequence (void)
+{}
+
+TAO_SSLEndpointSequence::TAO_SSLEndpointSequence (
+ CORBA::ULong max
+ )
+ : TAO::unbounded_value_sequence<
+ SSLIOP::SSL
+ >
+ (max)
+{}
+
+TAO_SSLEndpointSequence::TAO_SSLEndpointSequence (
+ CORBA::ULong max,
+ CORBA::ULong length,
+ SSLIOP::SSL * buffer,
+ CORBA::Boolean release
+ )
+ : TAO::unbounded_value_sequence<
+ SSLIOP::SSL
+ >
+ (max, length, buffer, release)
+{}
+
+TAO_SSLEndpointSequence::TAO_SSLEndpointSequence (
+ const TAO_SSLEndpointSequence &seq
+ )
+ : TAO::unbounded_value_sequence<
+ SSLIOP::SSL
+ >
+ (seq)
+{}
+
+TAO_SSLEndpointSequence::~TAO_SSLEndpointSequence (void)
+{}
+
+#endif /* end #if !defined */
+
+// TAO_IDL - Generated from
+// be\be_visitor_typecode/alias_typecode.cpp:31
+
+
+
+// TAO_IDL - Generated from
+// be\be_visitor_typecode/typecode_defn.cpp:925
+
+
+#ifndef _TAO_TYPECODE_TAO_SSLEndpointSequence_GUARD
+#define _TAO_TYPECODE_TAO_SSLEndpointSequence_GUARD
+namespace TAO
+{
+ namespace TypeCode
+ {
+ TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *,
+ TAO::Null_RefCount_Policy>
+ TAO_SSLEndpointSequence_0 (
+ CORBA::tk_sequence,
+ &SSLIOP::_tc_SSL,
+ 0U);
+
+ ::CORBA::TypeCode_ptr const tc_TAO_SSLEndpointSequence_0 =
+ &TAO_SSLEndpointSequence_0;
+
+ }
+}
+
+
+#endif /* _TAO_TYPECODE_TAO_SSLEndpointSequence_GUARD */
+static TAO::TypeCode::Alias<char const *,
+ CORBA::TypeCode_ptr const *,
+ TAO::Null_RefCount_Policy>
+ _tao_tc_TAO_SSLEndpointSequence (
+ CORBA::tk_alias,
+ "IDL:TAO_SSLEndpointSequence:1.0",
+ "TAO_SSLEndpointSequence",
+ &TAO::TypeCode::tc_TAO_SSLEndpointSequence_0);
+
+::CORBA::TypeCode_ptr const _tc_TAO_SSLEndpointSequence =
+ &_tao_tc_TAO_SSLEndpointSequence;
+
+// TAO_IDL - Generated from
+// be\be_visitor_sequence/cdr_op_cs.cpp:96
+
+#if !defined _TAO_CDR_OP_TAO_SSLEndpointSequence_CPP_
+#define _TAO_CDR_OP_TAO_SSLEndpointSequence_CPP_
+
+CORBA::Boolean operator<< (
+ TAO_OutputCDR &strm,
+ const TAO_SSLEndpointSequence &_tao_sequence
+ )
+{
+ return TAO::marshal_sequence(strm, _tao_sequence);
+}
+
+CORBA::Boolean operator>> (
+ TAO_InputCDR &strm,
+ TAO_SSLEndpointSequence &_tao_sequence
+ )
+{
+ return TAO::demarshal_sequence(strm, _tao_sequence);
+}
+
+#endif /* _TAO_CDR_OP_TAO_SSLEndpointSequence_CPP_ */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/ssl_endpointsC.h b/TAO/orbsvcs/orbsvcs/SSLIOP/ssl_endpointsC.h
new file mode 100644
index 00000000000..5d117696d17
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/ssl_endpointsC.h
@@ -0,0 +1,158 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:153
+
+#ifndef _TAO_IDL_ORIG_SSL_ENDPOINTSC_H_
+#define _TAO_IDL_ORIG_SSL_ENDPOINTSC_H_
+
+#include /**/ "ace/pre.h"
+
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/ORB.h"
+#include "tao/SystemException.h"
+#include "tao/Environment.h"
+#include "tao/Sequence_T.h"
+#include "tao/Seq_Var_T.h"
+#include "tao/Seq_Out_T.h"
+
+#include "orbsvcs/SSLIOPC.h"
+
+#if defined (TAO_EXPORT_MACRO)
+#undef TAO_EXPORT_MACRO
+#endif
+#define TAO_EXPORT_MACRO TAO_SSLIOP_Export
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+#if defined (__BORLANDC__)
+#pragma option push -w-rvl -w-rch -w-ccc -w-inl
+#endif /* __BORLANDC__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// TAO_IDL - Generated from
+// be\be_visitor_sequence/sequence_ch.cpp:101
+
+#if !defined (_TAO_SSLENDPOINTSEQUENCE_CH_)
+#define _TAO_SSLENDPOINTSEQUENCE_CH_
+
+class TAO_SSLEndpointSequence;
+
+typedef
+ TAO_FixedSeq_Var_T<
+ TAO_SSLEndpointSequence
+ >
+ TAO_SSLEndpointSequence_var;
+
+typedef
+ TAO_Seq_Out_T<
+ TAO_SSLEndpointSequence
+ >
+ TAO_SSLEndpointSequence_out;
+
+class TAO_SSLIOP_Export TAO_SSLEndpointSequence
+ : public
+ TAO::unbounded_value_sequence<
+ SSLIOP::SSL
+ >
+{
+public:
+ TAO_SSLEndpointSequence (void);
+ TAO_SSLEndpointSequence (CORBA::ULong max);
+ TAO_SSLEndpointSequence (
+ CORBA::ULong max,
+ CORBA::ULong length,
+ SSLIOP::SSL* buffer,
+ CORBA::Boolean release = false
+ );
+ TAO_SSLEndpointSequence (const TAO_SSLEndpointSequence &);
+ ~TAO_SSLEndpointSequence (void);
+
+ typedef TAO_SSLEndpointSequence_var _var_type;
+};
+
+#endif /* end #if !defined */
+
+// TAO_IDL - Generated from
+// be\be_visitor_typecode/typecode_decl.cpp:44
+
+extern TAO_SSLIOP_Export ::CORBA::TypeCode_ptr const _tc_TAO_SSLEndpointSequence;
+
+// TAO_IDL - Generated from
+// be\be_visitor_traits.cpp:61
+
+// Traits specializations.
+namespace TAO
+{
+}
+
+// TAO_IDL - Generated from
+// be\be_visitor_sequence/cdr_op_ch.cpp:71
+
+#if !defined _TAO_CDR_OP_TAO_SSLEndpointSequence_H_
+#define _TAO_CDR_OP_TAO_SSLEndpointSequence_H_
+
+TAO_SSLIOP_Export CORBA::Boolean operator<< (
+ TAO_OutputCDR &,
+ const TAO_SSLEndpointSequence &
+ );
+TAO_SSLIOP_Export CORBA::Boolean operator>> (
+ TAO_InputCDR &,
+ TAO_SSLEndpointSequence &
+ );
+
+#endif /* _TAO_CDR_OP_TAO_SSLEndpointSequence_H_ */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// TAO_IDL - Generated from
+// be\be_codegen.cpp:955
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#if defined (__BORLANDC__)
+#pragma option pop
+#endif /* __BORLANDC__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* ifndef */
+
+
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp b/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp
new file mode 100644
index 00000000000..c8c56c6b5ac
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp
@@ -0,0 +1,674 @@
+// ============================================================================
+//
+// $Id$
+//
+// ============================================================================
+
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Scheduler_Factory.h"
+
+#include "orbsvcs/Sched/Config_Scheduler.h"
+
+ACE_RCSID(Sched, Config_Scheduler, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_Config_Scheduler::ACE_Config_Scheduler (void)
+#if defined (TAO_USES_STRATEGY_SCHEDULER)
+ : scheduler_strategy_ (static_cast<RtecScheduler::Preemption_Priority_t> (TAO_MIN_CRITICAL_PRIORITY))
+ , impl (new ACE_Strategy_Scheduler (scheduler_strategy_))
+#else
+ : impl (new Scheduler_Generic)
+#endif /* defined (TAO_USES_STRATEGY_SCHEDULER) */
+{
+ // impl->output_level (10);
+}
+
+ACE_Config_Scheduler::~ACE_Config_Scheduler (void)
+{
+ delete impl;
+}
+
+RtecScheduler::handle_t
+ACE_Config_Scheduler::create (const char * entry_point
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::DUPLICATE_NAME))
+{
+ typedef RtecScheduler::RT_Info* RT_Info_ptr;
+
+ RtecScheduler::RT_Info** rt_info = 0;
+ ACE_NEW_RETURN (rt_info, RT_Info_ptr[1], -1);
+
+ ACE_NEW_RETURN (rt_info[0], RtecScheduler::RT_Info, -1);
+
+ rt_info[0]->entry_point = CORBA::string_dup(entry_point);
+ rt_info[0]->handle = -1;
+ rt_info[0]->worst_case_execution_time = ORBSVCS_Time::zero ();
+ rt_info[0]->typical_execution_time = ORBSVCS_Time::zero ();
+ rt_info[0]->cached_execution_time = ORBSVCS_Time::zero ();
+ rt_info[0]->period = 0;
+ rt_info[0]->criticality = RtecScheduler::VERY_LOW_CRITICALITY;
+ rt_info[0]->importance = RtecScheduler::VERY_LOW_IMPORTANCE;
+ rt_info[0]->quantum = ORBSVCS_Time::zero ();
+ rt_info[0]->threads = 0;
+ rt_info[0]->priority = 0;
+ rt_info[0]->preemption_subpriority = 0;
+ rt_info[0]->preemption_priority = 0;
+ rt_info[0]->info_type = RtecScheduler::OPERATION;
+ rt_info[0]->volatile_token = 0;
+
+ RtecScheduler::handle_t handle = -1;
+#if defined (TAO_USES_STRATEGY_SCHEDULER)
+ switch (impl->register_task (rt_info[0], handle))
+#else
+ switch (impl->register_task (rt_info, 1, handle))
+#endif /* defined (TAO_USES_STRATEGY_SCHEDULER) */
+
+ {
+ case BaseSchedImplType::SUCCEEDED:
+ break;
+ case BaseSchedImplType::ST_VIRTUAL_MEMORY_EXHAUSTED:
+ case BaseSchedImplType::ST_TASK_ALREADY_REGISTERED:
+ default:
+ delete rt_info[0];
+ delete[] rt_info;
+ ACE_ERROR ((LM_ERROR,
+ "Config_Scheduler::create - register_task failed\n"));
+ // @@ TODO: throw something.
+ break;
+ }
+ return handle;
+}
+
+RtecScheduler::handle_t
+ACE_Config_Scheduler::lookup (const char * entry_point
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ RtecScheduler::RT_Info* rt_info = 0;
+ switch (impl->get_rt_info (entry_point, rt_info))
+ {
+ case BaseSchedImplType::SUCCEEDED:
+ return rt_info->handle;
+ ACE_NOTREACHED (break);
+ case BaseSchedImplType::FAILED:
+ case BaseSchedImplType::ST_UNKNOWN_TASK:
+ default:
+ ACE_ERROR ((LM_ERROR,
+ "Config_Scheduler::lookup - get_rt_info failed\n"));
+ // @@ TODO: throw something.
+ break;
+ }
+ return -1;
+}
+
+RtecScheduler::RT_Info*
+ACE_Config_Scheduler::get (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK))
+{
+ RtecScheduler::RT_Info* rt_info = 0;
+ switch (impl->lookup_rt_info (handle, rt_info))
+ {
+ case BaseSchedImplType::SUCCEEDED:
+ {
+ // IDL memory managment semantics require that we return a copy.
+ RtecScheduler::RT_Info* copy;
+ ACE_NEW_RETURN (copy, RtecScheduler::RT_Info (*rt_info), 0);
+ return copy;
+ }
+ ACE_NOTREACHED (break);
+ case BaseSchedImplType::FAILED:
+ case BaseSchedImplType::ST_UNKNOWN_TASK:
+ default:
+ ACE_ERROR ((LM_ERROR,
+ "Config_Scheduler::get - lookup_rt_info failed\n"));
+ // @@ TODO: throw something.
+ break;
+ }
+ return 0;
+}
+
+void ACE_Config_Scheduler::set (RtecScheduler::handle_t handle,
+ RtecScheduler::Criticality_t criticality,
+ RtecScheduler::Time time,
+ RtecScheduler::Time typical_time,
+ RtecScheduler::Time cached_time,
+ RtecScheduler::Period_t period,
+ RtecScheduler::Importance_t importance,
+ RtecScheduler::Quantum_t quantum,
+ CORBA::Long threads,
+ RtecScheduler::Info_Type_t info_type
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK))
+{
+ RtecScheduler::RT_Info* rt_info = 0;
+ switch (impl->lookup_rt_info (handle, rt_info))
+ {
+ case BaseSchedImplType::SUCCEEDED:
+ rt_info->criticality = criticality,
+ rt_info->worst_case_execution_time = time;
+ rt_info->typical_execution_time = typical_time;
+ rt_info->cached_execution_time = cached_time;
+ rt_info->period = period;
+ rt_info->importance = importance;
+ rt_info->quantum = quantum;
+ rt_info->threads = threads;
+ rt_info->info_type = info_type;
+ break;
+ case BaseSchedImplType::FAILED:
+ case BaseSchedImplType::ST_UNKNOWN_TASK:
+ default:
+ ACE_ERROR ((LM_ERROR,
+ "Config_Scheduler::set - lookup_rt_info failed\n"));
+ // @@ TODO: throw something.
+ break;
+ }
+}
+
+void ACE_Config_Scheduler::priority (RtecScheduler::handle_t handle,
+ RtecScheduler::OS_Priority& priority,
+ RtecScheduler::Preemption_Subpriority_t& p_subpriority,
+ RtecScheduler::Preemption_Priority_t& p_priority
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::NOT_SCHEDULED))
+{
+
+ if (impl->priority (handle, priority, p_subpriority, p_priority) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Config_Scheduler::priority - priority failed\n"));
+ // TODO: throw something.
+ }
+}
+
+void ACE_Config_Scheduler::entry_point_priority (const char * entry_point,
+ RtecScheduler::OS_Priority& priority,
+ RtecScheduler::Preemption_Subpriority_t& p_subpriority,
+ RtecScheduler::Preemption_Priority_t& p_priority
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::NOT_SCHEDULED))
+{
+ this->priority (lookup (entry_point ACE_ENV_ARG_PARAMETER),
+ priority, p_subpriority, p_priority
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void ACE_Config_Scheduler::add_dependency (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t
+ dependency_type
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK))
+{
+
+ RtecScheduler::RT_Info* rt_info = 0;
+ switch (impl->lookup_rt_info (handle, rt_info))
+ {
+ case BaseSchedImplType::SUCCEEDED:
+ {
+ RtecScheduler::Dependency_Info dep;
+ dep.rt_info = dependency;
+ dep.number_of_calls = number_of_calls;
+ dep.dependency_type = dependency_type;
+#if defined (TAO_USES_STRATEGY_SCHEDULER)
+ impl->add_dependency (rt_info, dep);
+#else
+ BaseSchedImplType::add_dependency (rt_info, dep);
+#endif /* defined (TAO_USES_STRATEGY_SCHEDULER) */
+
+ }
+ break;
+ case BaseSchedImplType::FAILED:
+ case BaseSchedImplType::ST_UNKNOWN_TASK:
+ default:
+ ACE_ERROR ((LM_ERROR,
+ "cannot find %d to add dependency", handle));
+ // TODO: throw something.
+ break;
+ }
+}
+
+void ACE_Config_Scheduler::compute_scheduling (CORBA::Long minimum_priority,
+ CORBA::Long maximum_priority,
+ RtecScheduler::RT_Info_Set_out infos,
+ RtecScheduler::Dependency_Set_out dependencies,
+ RtecScheduler::Config_Info_Set_out configs,
+ RtecScheduler::Scheduling_Anomaly_Set_out anomalies
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UTILIZATION_BOUND_EXCEEDED,
+ RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS,
+ RtecScheduler::TASK_COUNT_MISMATCH))
+{
+
+ // Initialize the scheduler implementation.
+ impl->init (minimum_priority, maximum_priority);
+
+ // Construct an unbounded set to hold any scheduling anomalies.
+ ACE_Unbounded_Set<RtecScheduler::Scheduling_Anomaly *> anomaly_set;
+
+ // Invoke the imlementation's scheduling method.
+ BaseSchedImplType::status_t schedule_status;
+ schedule_status = impl->schedule (anomaly_set);
+
+ if (dependencies.ptr () == 0)
+ {
+ dependencies = new RtecScheduler::Dependency_Set ();
+ }
+
+ // Iterate over the set of anomalies, reporting each one, storing
+ // it in the set of anomalies to return, and determining the worst
+ // anomaly severity.
+ RtecScheduler::Anomaly_Severity severity = RtecScheduler::ANOMALY_NONE;
+ RtecScheduler::Scheduling_Anomaly **anomaly = 0;
+ const char *anomaly_severity_msg = "NONE";
+ CORBA::ULong anomaly_index = 0;
+ CORBA::ULong anomaly_set_size =
+ static_cast<CORBA::ULong> (anomaly_set.size ());
+ if (anomalies.ptr () == 0)
+ {
+ anomalies =
+ new RtecScheduler::Scheduling_Anomaly_Set (anomaly_set_size);
+ }
+ anomalies->length (anomaly_set_size);
+ ACE_Unbounded_Set_Iterator<RtecScheduler::Scheduling_Anomaly *>
+ anomaly_iter (anomaly_set);
+ for (anomaly_iter.first (), anomaly_index = 0;
+ anomaly_iter.next (anomaly);
+ anomaly_iter.advance (), ++anomaly_index)
+ {
+ if (0 == *anomaly)
+ {
+ // if for some reason we stored a null anomaly pointer,
+ // just give default values to that entry in the sequence.
+ anomalies[anomaly_index].severity = RtecScheduler::ANOMALY_NONE;
+ anomalies[anomaly_index].description = "";
+ continue;
+ }
+
+ // Keep track of the *worst* anomaly severity
+ switch ((*anomaly)->severity)
+ {
+ case RtecScheduler::ANOMALY_FATAL:
+ anomaly_severity_msg = "FATAL";
+ severity = RtecScheduler::ANOMALY_FATAL;
+ break;
+
+ case RtecScheduler::ANOMALY_ERROR:
+ anomaly_severity_msg = "ERROR";
+ if (severity != RtecScheduler::ANOMALY_FATAL)
+ {
+ severity = RtecScheduler::ANOMALY_ERROR;
+ }
+ break;
+
+ case RtecScheduler::ANOMALY_WARNING:
+ anomaly_severity_msg = "WARNING";
+ if ((severity != RtecScheduler::ANOMALY_FATAL) &&
+ (severity != RtecScheduler::ANOMALY_ERROR))
+ {
+ severity = RtecScheduler::ANOMALY_WARNING;
+ }
+ break;
+
+ // case RtecScheduler::ANOMALY_NONE:
+ // case Anomaly_Severity_TAO_ENUM_32BIT_ENFORCER:
+ default:
+ anomaly_severity_msg = "UNKNOWN";
+ break;
+ }
+
+ // Output the anomaly message
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: %s\n",
+ anomaly_severity_msg,
+ (*anomaly)->description.in ()));
+
+ // Store the anomaly in the anomaly sequence out parameter
+ anomalies[anomaly_index] = **anomaly;
+
+ // Release the anomaly node.
+ delete *anomaly;
+ }
+
+ switch (severity)
+ {
+ // On a fatal anomaly abort without generating a schedule.
+ case RtecScheduler::ANOMALY_FATAL:
+ // TODO: throw something.
+ ACE_ERROR ((LM_ERROR, "Schedule failed due to FATAL anomaly.\n"));
+ return;
+
+ // Otherwise, make sure we didn't get a fatal return type.
+ default:
+ switch (schedule_status)
+ {
+ case BaseSchedImplType::ST_BAD_INTERNAL_POINTER :
+ // TODO: throw something.
+ ACE_ERROR ((LM_ERROR,
+ "Schedule failed due to bad internal pointer.\n"));
+ return;
+
+ case BaseSchedImplType::ST_VIRTUAL_MEMORY_EXHAUSTED :
+ // TODO: throw something.
+ ACE_ERROR ((LM_ERROR,
+ "Schedule failed due to insufficient memory.\n"));
+ return;
+
+ case BaseSchedImplType::THREAD_COUNT_MISMATCH :
+ // TODO: throw something.
+ ACE_ERROR ((LM_ERROR,
+ "Schedule failed due to thread count mismatch.\n"));
+ return;
+
+ case BaseSchedImplType::TASK_COUNT_MISMATCH :
+ // TODO: throw something.
+ ACE_ERROR ((LM_ERROR,
+ "Schedule failed due to task count mismatch.\n"));
+ return;
+
+ // Otherwise, go ahead and generate a schedule.
+ default:
+ break;
+ }
+ break;
+ }
+
+ // return the set of scheduled RT_Infos
+ if (infos.ptr () == 0)
+ {
+ infos = new RtecScheduler::RT_Info_Set (impl->tasks ());
+ }
+ infos->length (impl->tasks ());
+ for (RtecScheduler::handle_t handle = 1;
+ handle <= static_cast<RtecScheduler::handle_t> (impl->tasks ());
+ ++handle)
+ {
+ RtecScheduler::RT_Info* rt_info = 0;
+ switch (impl->lookup_rt_info (handle, rt_info))
+ {
+ case BaseSchedImplType::SUCCEEDED:
+ // We know that handles start at 1.
+ infos[static_cast<CORBA::ULong> (handle - 1)] = *rt_info;
+ break;
+ case BaseSchedImplType::FAILED:
+ case BaseSchedImplType::ST_UNKNOWN_TASK:
+ default:
+ ACE_ERROR ((LM_ERROR,
+ "Config_Scheduler::schedule - lookup_rt_info failed\n"));
+ // TODO: throw something.
+ break;
+ }
+ }
+
+ // return the set of scheduled Config_Infos
+ if (configs.ptr () == 0)
+ {
+ configs =
+ new RtecScheduler::Config_Info_Set(impl->minimum_priority_queue () + 1);
+ }
+ configs->length (impl->minimum_priority_queue () + 1);
+ for (RtecScheduler::Preemption_Priority_t priority = 0;
+ priority <=
+ static_cast<RtecScheduler::Preemption_Priority_t> (impl->minimum_priority_queue ());
+ ++priority)
+ {
+ RtecScheduler::Config_Info* config_info = 0;
+ switch (impl->lookup_config_info (priority, config_info))
+ {
+ case BaseSchedImplType::SUCCEEDED:
+ // We know that handles start at 1.
+ configs[CORBA::ULong(priority)] = *config_info;
+ break;
+ case BaseSchedImplType::FAILED:
+ case BaseSchedImplType::ST_UNKNOWN_TASK:
+ default:
+ ACE_ERROR ((LM_ERROR,
+ "Config_Scheduler::schedule - "
+ "lookup_config_info failed\n"));
+ // TODO: throw something.
+ break;
+ }
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "Schedule prepared.\n"));
+ ACE_DEBUG ((LM_DEBUG, "Dumping to stdout.\n"));
+ ACE_Scheduler_Factory::dump_schedule (*(infos.ptr()),
+ *(dependencies.ptr()),
+ *(configs.ptr()),
+ *(anomalies.ptr()), 0);
+ ACE_DEBUG ((LM_DEBUG, "Dump done.\n"));
+}
+
+
+void ACE_Config_Scheduler::dispatch_configuration (RtecScheduler::Preemption_Priority_t p_priority,
+ RtecScheduler::OS_Priority& priority,
+ RtecScheduler::Dispatching_Type_t & d_type
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::NOT_SCHEDULED,
+ RtecScheduler::UNKNOWN_PRIORITY_LEVEL))
+{
+
+ if (impl->dispatch_configuration (p_priority, priority, d_type) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Config_Scheduler::dispatch_configuration -"
+ " dispatch_configuration failed\n"));
+ // TODO: throw something.
+ }
+}
+ // provide the thread priority and queue type for the given priority level
+
+
+RtecScheduler::Preemption_Priority_t
+ACE_Config_Scheduler::last_scheduled_priority (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::NOT_SCHEDULED))
+{
+
+ RtecScheduler::Preemption_Priority_t priority = impl->minimum_priority_queue ();
+
+ if (priority < 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Config_Scheduler::last_scheduled_priority - priorities failed\n"));
+ // TODO: throw something.
+ }
+
+ return priority;
+}
+ // Returns the last priority number assigned to an operation in the schedule.
+ // The number returned is one less than the total number of scheduled priorities.
+ // All scheduled priorities range from 0 to the number returned, inclusive.
+
+void
+ACE_Config_Scheduler::get_config_infos (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::NOT_SCHEDULED))
+{
+ ACE_UNUSED_ARG ((configs));
+
+ //TODO: fill the Config_Info_Set with the runtime Config_Infos
+ //for now, this function is unimplemented
+ return;
+}
+
+void ACE_Config_Scheduler::reset (RtecScheduler::handle_t,
+ RtecScheduler::Criticality_t,
+ RtecScheduler::Time,
+ RtecScheduler::Time,
+ RtecScheduler::Time,
+ RtecScheduler::Period_t,
+ RtecScheduler::Importance_t,
+ RtecScheduler::Quantum_t,
+ CORBA::Long,
+ RtecScheduler::Info_Type_t
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+void ACE_Config_Scheduler::set_seq (const RtecScheduler::RT_Info_Set&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+// Set characteristics of the RT_Infos corresponding to the passed handles.
+// Tuples are added in the case of existing and/or multiple definitions.
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+void ACE_Config_Scheduler::reset_seq (const RtecScheduler::RT_Info_Set&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+// Reset characteristics of the RT_Infos corresponding to the passed handles.
+// Tuples are replaced in the case of existing and/or multiple definitions.
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+void ACE_Config_Scheduler::replace_seq (const RtecScheduler::RT_Info_Set&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+// Replace all RT_Infos, resetting characteristics of the RT_Infos
+// corresponding to the passed handles. All other RT_Infos are
+// reset to their uninitialized values, i.e., the same they have
+// just after the create call.
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+void ACE_Config_Scheduler::remove_dependency (RtecScheduler::handle_t,
+ RtecScheduler::handle_t,
+ CORBA::Long,
+ RtecScheduler::Dependency_Type_t
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK))
+// This method removes a dependency between two RT_Infos.
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+void ACE_Config_Scheduler::set_dependency_enable_state (RtecScheduler::handle_t,
+ RtecScheduler::handle_t,
+ CORBA::Long,
+ RtecScheduler::Dependency_Type_t,
+ RtecScheduler::Dependency_Enabled_Type_t
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK))
+// This method sets the enable state of a dependency between two RT_Infos.
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+void ACE_Config_Scheduler::set_dependency_enable_state_seq (const RtecScheduler::Dependency_Set &
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK))
+// This method sets the enable state of a sequence of dependencies.
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+void ACE_Config_Scheduler::set_rt_info_enable_state (RtecScheduler::handle_t,
+ RtecScheduler::RT_Info_Enabled_Type_t
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK))
+// This method enables or disables an RT_Info.
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+void ACE_Config_Scheduler::set_rt_info_enable_state_seq (
+ const RtecScheduler::RT_Info_Enable_State_Pair_Set &
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK))
+// This method enables or disables a sequence of RT_Infos.
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+void ACE_Config_Scheduler::recompute_scheduling (CORBA::Long,
+ CORBA::Long,
+ RtecScheduler::Scheduling_Anomaly_Set_out
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UTILIZATION_BOUND_EXCEEDED,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS,
+ RtecScheduler::TASK_COUNT_MISMATCH,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::DUPLICATE_NAME))
+// Recomputes the scheduling priorities, etc.
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+void ACE_Config_Scheduler::get_rt_info_set (RtecScheduler::RT_Info_Set_out
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL))
+// Returns the set of rt_infos, with their assigned priorities (as
+// of the last schedule re-computation).
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+void ACE_Config_Scheduler::get_dependency_set (RtecScheduler::Dependency_Set_out
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL))
+// Returns the set of rt_infos, with their assigned priorities (as
+// of the last schedule re-computation).
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+void ACE_Config_Scheduler::get_config_info_set (RtecScheduler::Config_Info_Set_out
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL))
+// Returns the set of config_infos, describing the appropriate
+// number, types, and priority levels for the dispatching lanes.
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.h b/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.h
new file mode 100644
index 00000000000..d6b378d8f82
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.h
@@ -0,0 +1,318 @@
+// -*- C++ -*-
+
+// $Id$
+
+#ifndef ACE_CONFIG_SCHEDULER_H
+#define ACE_CONFIG_SCHEDULER_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/OS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RtecSchedulerS.h"
+#include "orbsvcs/Event_Service_Constants.h"
+
+#include "orbsvcs/Sched/sched_export.h"
+
+#if defined (TAO_USES_STRATEGY_SCHEDULER)
+#include "orbsvcs/Sched/Strategy_Scheduler.h"
+#else
+#include "orbsvcs/Sched/Scheduler_Generic.h"
+#endif /* defined (TAO_USES_STRATEGY_SCHEDULER) */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_RTSched_Export ACE_Config_Scheduler
+: public POA_RtecScheduler::Scheduler
+ // = TITLE
+ // A (local) implementation for the RtecScheduler::Scheduler service.
+ //
+ // = DESCRIPTION
+ // This class implements a servant for the
+ // RtecScheduler::Scheduler service, using the Scheduler classes
+ // distributed with the EC.
+{
+public:
+
+ ACE_Config_Scheduler (void);
+ virtual ~ACE_Config_Scheduler (void);
+
+ virtual RtecScheduler::handle_t create (const char * entry_point
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, RtecScheduler::DUPLICATE_NAME));
+
+ virtual RtecScheduler::handle_t lookup (const char * entry_point
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC((CORBA::SystemException));
+
+ virtual RtecScheduler::RT_Info* get (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, RtecScheduler::UNKNOWN_TASK));
+
+ virtual void set (RtecScheduler::handle_t handle,
+ RtecScheduler::Criticality_t criticality,
+ RtecScheduler::Time time,
+ RtecScheduler::Time typical_time,
+ RtecScheduler::Time cached_time,
+ RtecScheduler::Period_t period,
+ RtecScheduler::Importance_t importance,
+ RtecScheduler::Quantum_t quantum,
+ CORBA::Long threads,
+ RtecScheduler::Info_Type_t info_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, RtecScheduler::UNKNOWN_TASK));
+
+ virtual void priority (RtecScheduler::handle_t handle,
+ RtecScheduler::OS_Priority& priority,
+ RtecScheduler::Preemption_Subpriority_t& p_subpriority,
+ RtecScheduler::Preemption_Priority_t& p_priority
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::NOT_SCHEDULED));
+
+ virtual void entry_point_priority (const char * entry_point,
+ RtecScheduler::OS_Priority& priority,
+ RtecScheduler::Preemption_Subpriority_t& p_subpriority,
+ RtecScheduler::Preemption_Priority_t& p_priority
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::NOT_SCHEDULED));
+
+ virtual void add_dependency (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK));
+
+ virtual void compute_scheduling (CORBA::Long minimum_priority,
+ CORBA::Long maximum_priority,
+ RtecScheduler::RT_Info_Set_out infos,
+ RtecScheduler::Dependency_Set_out dependencies,
+ RtecScheduler::Config_Info_Set_out configs,
+ RtecScheduler::Scheduling_Anomaly_Set_out anomalies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC((CORBA::SystemException,
+ RtecScheduler::UTILIZATION_BOUND_EXCEEDED,
+ RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS,
+ RtecScheduler::TASK_COUNT_MISMATCH));
+
+ virtual void dispatch_configuration (RtecScheduler::Preemption_Priority_t p_priority,
+ RtecScheduler::OS_Priority& priority,
+ RtecScheduler::Dispatching_Type_t & d_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::NOT_SCHEDULED,
+ RtecScheduler::UNKNOWN_PRIORITY_LEVEL));
+ // provide the thread priority and queue type for the given priority level
+
+ virtual RtecScheduler::Preemption_Priority_t
+ last_scheduled_priority (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::NOT_SCHEDULED));
+ // Returns the last priority number assigned to an operation in the
+ // schedule.
+ // The number returned is one less than the total number of
+ // scheduled priorities.
+ // All scheduled priorities range from 0 to the number returned,
+ // inclusive.
+
+ virtual void get_config_infos (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::NOT_SCHEDULED));
+ // Provides the set of Config_Infos associated with the current schedule.
+
+ virtual void reset (RtecScheduler::handle_t handle,
+ RtecScheduler::Criticality_t criticality,
+ RtecScheduler::Time time,
+ RtecScheduler::Time typical_time,
+ RtecScheduler::Time cached_time,
+ RtecScheduler::Period_t period,
+ RtecScheduler::Importance_t importance,
+ RtecScheduler::Quantum_t quantum,
+ CORBA::Long threads,
+ RtecScheduler::Info_Type_t info_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Reset characteristics of the RT_Info corresponding to the passed handle.
+
+ virtual void set_seq (const RtecScheduler::RT_Info_Set& infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Set characteristics of the RT_Infos corresponding to the passed handles.
+ // Tuples are added in the case of existing and/or multiple definitions.
+
+ virtual void reset_seq (const RtecScheduler::RT_Info_Set& infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Reset characteristics of the RT_Infos corresponding to the passed handles.
+ // Tuples are replaced in the case of existing and/or multiple definitions.
+
+ virtual void replace_seq (const RtecScheduler::RT_Info_Set& infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Replace all RT_Infos, resetting characteristics of the RT_Infos
+ // corresponding to the passed handles. All other RT_Infos are
+ // reset to their uninitialized values, i.e., the same they have
+ // just after the create call.
+
+ virtual void remove_dependency (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method removes a dependency between two RT_Infos.
+
+ virtual void set_dependency_enable_state (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type,
+ RtecScheduler::Dependency_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method sets the enable state of a dependency between two RT_Infos.
+
+ virtual void set_dependency_enable_state_seq (const RtecScheduler::Dependency_Set & dependencies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method sets the enable state of a sequence of dependencies.
+
+ virtual void set_rt_info_enable_state (RtecScheduler::handle_t handle,
+ RtecScheduler::RT_Info_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method enables or disables an RT_Info.
+
+ virtual void set_rt_info_enable_state_seq (const RtecScheduler::RT_Info_Enable_State_Pair_Set & pair_set
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method enables or disables a sequence of RT_Infos.
+
+ virtual void recompute_scheduling (CORBA::Long minimum_priority,
+ CORBA::Long maximum_priority,
+ RtecScheduler::Scheduling_Anomaly_Set_out anomalies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UTILIZATION_BOUND_EXCEEDED,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS,
+ RtecScheduler::TASK_COUNT_MISMATCH,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::DUPLICATE_NAME));
+ // Recomputes the scheduling priorities, etc.
+
+ virtual void get_rt_info_set (RtecScheduler::RT_Info_Set_out infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL));
+ // Returns the set of rt_infos, with their assigned priorities (as
+ // of the last schedule re-computation).
+
+ virtual void get_dependency_set (RtecScheduler::Dependency_Set_out dependencies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL));
+ // Returns the set of rt_infos, with their assigned priorities (as
+ // of the last schedule re-computation).
+
+ virtual void get_config_info_set (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL));
+ // Returns the set of config_infos, describing the appropriate
+ // number, types, and priority levels for the dispatching lanes.
+
+
+private:
+
+#if defined (TAO_USES_STRATEGY_SCHEDULER)
+
+ // trait for the scheduler implementation base class
+ typedef ACE_DynScheduler BaseSchedImplType;
+
+ // traits for the scheduler strategy
+#if defined (TAO_USES_MUF_SCHEDULING)
+
+ typedef ACE_MUF_Scheduler_Strategy Scheduler_Strategy;
+
+#elif defined (TAO_USES_MLF_SCHEDULING)
+# if ! defined (TAO_MIN_CRITICAL_PRIORITY)
+# define TAO_MIN_CRITICAL_PRIORITY 0
+# endif /* ! defined (TAO_MIN_CRITICAL_PRIORITY) */
+ typedef ACE_MLF_Scheduler_Strategy Scheduler_Strategy;
+
+#elif defined (TAO_USES_EDF_SCHEDULING)
+
+# if ! defined (TAO_MIN_CRITICAL_PRIORITY)
+# define TAO_MIN_CRITICAL_PRIORITY 0
+# endif /* ! defined (TAO_MIN_CRITICAL_PRIORITY) */
+ typedef ACE_EDF_Scheduler_Strategy Scheduler_Strategy;
+
+#elif defined (TAO_USES_RMS_SCHEDULING)
+# if ! defined (TAO_MIN_CRITICAL_PRIORITY)
+# define TAO_MIN_CRITICAL_PRIORITY 0
+# endif /* ! defined (TAO_MIN_CRITICAL_PRIORITY) */
+ typedef ACE_RMS_Scheduler_Strategy Scheduler_Strategy;
+
+#elif defined (TAO_USES_CRITICALITY_SCHEDULING)
+ typedef ACE_Criticality_Scheduler_Strategy Scheduler_Strategy;
+
+#else
+ #error scheduling strategy must be defined
+
+#endif /* defined (TAO_USES_MUF_SCHEDULING) */
+
+ Scheduler_Strategy scheduler_strategy_;
+
+#else /* ! defined (TAO_USES_STRATEGY_SCHEDULER) */
+
+ // trait for the scheduler implementation base class
+ typedef ACE_Scheduler BaseSchedImplType;
+
+#endif /* defined (TAO_USES_STRATEGY_SCHEDULER) */
+
+ // implementation base class pointer
+ BaseSchedImplType* impl;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* ACE_CONFIG_SCHEDULER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Sched/DynSched.cpp b/TAO/orbsvcs/orbsvcs/Sched/DynSched.cpp
new file mode 100644
index 00000000000..69b1e25ddca
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/DynSched.cpp
@@ -0,0 +1,2423 @@
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// sched
+//
+// = FILENAME
+// DynSched.cpp
+//
+// = CREATION DATE
+// 23 January 1997
+//
+// = AUTHOR
+// Chris Gill
+//
+// ============================================================================
+
+#include "orbsvcs/Sched/DynSched.h"
+#include "ace/Basic_Types.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/Null_Mutex.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Sched/DynSched.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Sched, DynSched, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//////////////////////
+// Helper functions //
+//////////////////////
+
+// compare the DFS finish times of two task entries, order higher time *first*
+#if defined (ACE_HAS_WINCE)
+int _cdecl compare_entry_finish_times (const void *first, const void *second)
+#else
+extern "C" int compare_entry_finish_times (const void *first, const void *second)
+#endif // ACE_HAS_WINCE
+{
+ // sort blank entries to the end
+ if (! first)
+ {
+ return (second) ? 1 : 0;
+ }
+ else if (! second)
+ {
+ return -1;
+ }
+
+ const Task_Entry *first_entry =
+ * static_cast<const Task_Entry *const *> (first);
+ const Task_Entry *second_entry =
+ * static_cast<const Task_Entry *const *> (second);
+
+ // sort blank entries to the end
+ if (! first_entry)
+ {
+ return (second_entry) ? 1 : 0;
+ }
+ else if (! second_entry)
+ {
+ return -1;
+ }
+
+ if (first_entry->finished () > second_entry->finished ())
+ {
+ return -1;
+ }
+ else if (first_entry->finished () < second_entry->finished ())
+ {
+ return 1;
+ }
+
+ return 0;
+}
+
+//////////////////////////////////////////
+// class ACE_DynScheduler member functions //
+//////////////////////////////////////////
+
+const char *
+ACE_DynScheduler::status_message (ACE_DynScheduler::status_t status)
+{
+ switch (status)
+ {
+ case NOT_SCHEDULED :
+ return "NOT_SCHEDULED";
+ case SUCCEEDED :
+ return "SUCCEEDED";
+ case ST_NO_TASKS_REGISTERED :
+ return "ST_NO_TASKS_REGISTERED";
+ case ST_TASK_ALREADY_REGISTERED :
+ return "TASK_ALREADY_REGISTERED";
+ case ST_BAD_INTERNAL_POINTER :
+ return "BAD_INTERNAL_POINTER";
+ case ST_VIRTUAL_MEMORY_EXHAUSTED :
+ return "VIRTUAL_MEMORY_EXHAUSTED";
+ case ST_UNKNOWN_TASK :
+ return "UNKNOWN_TASK";
+ case TASK_COUNT_MISMATCH :
+ return "TASK_COUNT_MISMATCH";
+ case THREAD_COUNT_MISMATCH :
+ return "THREAD_COUNT_MISMATCH";
+ case INVALID_PRIORITY :
+ return "INVALID_PRIORITY";
+ case TWO_WAY_DISJUNCTION :
+ return "TWO_WAY_DISJUNCTION (IGNORED)";
+ case TWO_WAY_CONJUNCTION :
+ return "TWO_WAY_CONJUNCTION (IGNORED)";
+ case UNRECOGNIZED_INFO_TYPE :
+ return "UNRECOGNIZED_INFO_TYPE (IGNORED)";
+
+ // The following are only used during scheduling (in the case of
+ // off-line scheduling, they are only used prior to runtime).
+ // To save a little code space (280 bytes on g++ 2.7.2/Solaris 2.5.1),
+ // we could conditionally compile them so that they're not in the
+ // runtime version.
+ case ST_UTILIZATION_BOUND_EXCEEDED :
+ return "UTILIZATION_BOUND_EXCEEDED";
+ case ST_INSUFFICIENT_THREAD_PRIORITY_LEVELS :
+ return "INSUFFICIENT_THREAD_PRIORITY_LEVELS";
+ case ST_CYCLE_IN_DEPENDENCIES :
+ return "CYCLE_IN_DEPENDENCIES";
+ case ST_UNRESOLVED_REMOTE_DEPENDENCIES :
+ return "ST_UNRESOLVED_REMOTE_DEPENDENCIES";
+ case ST_UNRESOLVED_LOCAL_DEPENDENCIES :
+ return "ST_UNRESOLVED_LOCAL_DEPENDENCIES";
+ case ST_INVALID_PRIORITY_ORDERING :
+ return "INVALID_PRIORITY_ORDERING";
+ case UNABLE_TO_OPEN_SCHEDULE_FILE :
+ return "UNABLE_TO_OPEN_SCHEDULE_FILE";
+ case UNABLE_TO_WRITE_SCHEDULE_FILE :
+ return "UNABLE_TO_WRITE_SCHEDULE_FILE";
+ // End of config-only status values.
+
+ default:
+ break;
+ }
+
+ return "UNKNOWN STATUS";
+}
+
+// = Utility function for creating an entry for determining
+// the severity of an anomaly detected during scheduling.
+ACE_DynScheduler::Anomaly_Severity
+ACE_DynScheduler::anomaly_severity (ACE_DynScheduler::status_t status)
+{
+ // Determine severity of the anomaly
+ switch (status)
+ {
+ // Fatal anomalies reflect unrecoverable internal scheduler errors
+ case ST_BAD_INTERNAL_POINTER :
+ case ST_VIRTUAL_MEMORY_EXHAUSTED :
+ case THREAD_COUNT_MISMATCH :
+ case TASK_COUNT_MISMATCH :
+ return RtecScheduler::ANOMALY_FATAL;
+
+ // Errors reflect severe problems with given scheduling information
+ case UNABLE_TO_OPEN_SCHEDULE_FILE :
+ case UNABLE_TO_WRITE_SCHEDULE_FILE :
+ case NOT_SCHEDULED :
+ case ST_UNRESOLVED_LOCAL_DEPENDENCIES :
+ case ST_UNKNOWN_TASK :
+ case ST_CYCLE_IN_DEPENDENCIES :
+ case ST_INVALID_PRIORITY_ORDERING :
+ return RtecScheduler::ANOMALY_ERROR;
+
+ // Warnings reflect serious problems with given scheduling information
+ case ST_TASK_ALREADY_REGISTERED :
+ case ST_UNRESOLVED_REMOTE_DEPENDENCIES :
+ case ST_UTILIZATION_BOUND_EXCEEDED :
+ case ST_INSUFFICIENT_THREAD_PRIORITY_LEVELS :
+ case TWO_WAY_DISJUNCTION :
+ case TWO_WAY_CONJUNCTION :
+ case UNRECOGNIZED_INFO_TYPE :
+ case ST_NO_TASKS_REGISTERED :
+ return RtecScheduler::ANOMALY_WARNING;
+
+ // Produce a lowest severity anomaly for any unknown status value
+ default:
+ return RtecScheduler::ANOMALY_NONE;
+ }
+}
+
+
+// = Utility function for creating an entry for the
+// log of anomalies detected during scheduling.
+ACE_DynScheduler::Scheduling_Anomaly *
+ACE_DynScheduler::create_anomaly (ACE_DynScheduler::status_t status)
+{
+ ACE_DynScheduler::Scheduling_Anomaly * anomaly;
+ ACE_NEW_RETURN (anomaly, ACE_DynScheduler::Scheduling_Anomaly, 0);
+
+ anomaly->severity = anomaly_severity (status);
+ anomaly->description = status_message (status);
+
+ return anomaly;
+}
+
+
+ACE_DynScheduler::ACE_DynScheduler ()
+ // Set the minimum and maximum priority to those for the current platform.
+ // This shouldn't be necessary, but UPSingleProcessorOrb::initialize_reactors
+ // creates threads before the Event Channel calls Scheduler::init ().
+ : minimum_priority_ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO,
+ ACE_SCOPE_PROCESS))
+ , maximum_priority_ (ACE_Sched_Params::priority_max (ACE_SCHED_FIFO,
+ ACE_SCOPE_PROCESS))
+ , task_entries_ (0)
+ , ordered_task_entries_ (0)
+ , thread_delineators_ (0)
+ , ordered_thread_dispatch_entries_ (0)
+ , dispatch_entries_ (0)
+ , config_info_entries_ (0)
+ , expanded_dispatches_ (0)
+ , ordered_dispatch_entries_ (0)
+ , dispatch_entry_count_ (0)
+ , threads_ (0)
+ , timeline_ (0)
+ , lock_ ()
+ , rt_info_entries_ ()
+ , handles_ (0)
+ , runtime_filename_ (0)
+ , rt_info_filename_ (0)
+ , timeline_filename_ (0)
+ , tasks_ (0)
+ , status_ (NOT_SCHEDULED)
+ , output_level_ (0)
+ , frame_size_ (1)
+ , critical_set_frame_size_ (0)
+ , utilization_ (0.0)
+ , critical_set_utilization_ (0.0)
+ , minimum_priority_queue_ (0)
+ , minimum_guaranteed_priority_queue_ (-1)
+ , up_to_date_ (0)
+ , min_dispatch_id_ (0)
+ , max_dispatch_id_ (0)
+{
+}
+
+
+ACE_DynScheduler::~ACE_DynScheduler ()
+{
+ // release all resources used for the most recent schedule
+ reset ();
+}
+
+
+void
+ACE_DynScheduler::init (const OS_Priority minimum_priority,
+ const OS_Priority maximum_priority,
+ const char *runtime_filename,
+ const char *rt_info_filename,
+ const char *timeline_filename)
+{
+ minimum_priority_ = minimum_priority;
+ maximum_priority_ = maximum_priority;
+ runtime_filename_ = runtime_filename;
+ rt_info_filename_ = rt_info_filename;
+ timeline_filename_ = timeline_filename;
+}
+ // = initializes the scheduler.
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::register_task (RT_Info *rt_info, handle_t &handle)
+{
+ ACE_DynScheduler::status_t ret = ST_UNKNOWN_TASK;
+
+ // check the pointer we were passed
+ if (! rt_info)
+ {
+ handle = 0;
+ return ret;
+ }
+
+ // try to store the new task's information . . .
+ switch (rt_info_entries_.insert (rt_info))
+ {
+ case 0 : // successfully inserted
+ {
+ rt_info->handle = (handle = ++handles_);
+ ret = SUCCEEDED;
+
+ // zero out the task entry ACT used by the scheduler
+ rt_info->volatile_token = 0;
+
+ // make sure the schedule is reset when a new task is registered
+ reset ();
+
+ if (output_level () >= 5)
+ {
+ ACE_OS::printf ("registered task \"%s\" with RT_Info at %p\n",
+ (const char*)(rt_info->entry_point), rt_info);
+ }
+ }
+ break;
+
+ case 1 : // the entry had already been inserted
+ handle = 0;
+ ret = ST_TASK_ALREADY_REGISTERED;
+ break;
+
+ default :
+ // case -1 : insert failed, probably because virtual memory exhaused
+ handle = 0;
+ ret = ST_VIRTUAL_MEMORY_EXHAUSTED;
+ break;
+ }
+
+ return ret;
+}
+ // = registers a task.
+
+
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::get_rt_info (Object_Name name,
+ RT_Info* &rtinfo)
+{
+ handle_t handle;
+
+ // This makes a copy. We can optimize this with our own string
+ // class.
+ ACE_CString lookup (name);
+ // Search the map for the <name>. If found, return the RT_Info.
+ if (info_collection_.find (lookup, rtinfo) >= 0)
+ {
+ // If we find it, return.
+ return SUCCEEDED;
+ }
+ else
+ // Otherwise, make one, bind it, and register it.
+ {
+ rtinfo = new RT_Info;
+ rtinfo->info_type = RtecScheduler::OPERATION;
+ rtinfo->entry_point = CORBA::string_dup(name);
+ // Bind the rtinfo to the name.
+ if (info_collection_.bind (lookup, rtinfo) != 0)
+ {
+ delete rtinfo;
+ rtinfo = 0;
+ return FAILED; // Error!
+ }
+ else
+ {
+ // Register the task
+ status_t result = this->register_task (rtinfo, handle);
+ if (result == SUCCEEDED)
+ {
+ rtinfo->handle = handle;
+ return ST_UNKNOWN_TASK; // Didn't find it, but made one!
+ }
+ else
+ {
+ rtinfo->handle = 0;
+ return FAILED;
+ }
+ }
+ }
+}
+
+
+
+
+int ACE_DynScheduler::priority (
+ const RtecScheduler::handle_t handle,
+ RtecScheduler::OS_Priority &priority,
+ RtecScheduler::Preemption_Subpriority_t &subpriority,
+ RtecScheduler::Preemption_Priority_t &preemption_prio)
+{
+ // look up the RT_Info that has the given handle
+ RT_Info *rt_info = 0;
+ if (lookup_rt_info (handle, rt_info) == SUCCEEDED)
+ {
+ // copy the priority values from the RT_Info
+ priority = rt_info->priority;
+ subpriority = rt_info->preemption_subpriority;
+ preemption_prio = rt_info->preemption_priority;
+
+ return 0;
+ }
+ else
+
+ {
+ // RT_Info not found: assign default priority values
+ priority = minimum_priority_;
+ subpriority = ACE_Scheduler_MIN_SUB_PRIORITY;
+ preemption_prio = ACE_Scheduler_MAX_PREEMPTION_PRIORITY;
+
+ if (output_level () >= 3)
+ {
+ ACE_OS::printf ("preemption_prio %d: min %d, pri %d, min_pri %d\n",
+ preemption_prio, minimum_priority_queue (),
+ priority, minimum_priority_);
+ }
+
+ return -1;
+ }
+}
+ // "priority" is the OS thread priority that was assigned to the Task that
+ // was assigned "handle". "subpriority" combines the dynamic and static
+ // subpriorities of the Task that was assigned handle. "preemption_prio"
+ // is a platform-independent priority queue number, ranging from a
+ // highest priority value of 0 to the lowest priority value, which is
+ // returned by "minimum_priority_queue ()". The current and deadline times
+ // supplied are used to compute the operation's dynamic subpriority
+ // Returns 0 on success, or -1 if an invalid handle was supplied.
+
+
+int ACE_DynScheduler::number_of_dependencies(RT_Info* rt_info)
+{
+ return rt_info->dependencies.length();
+}
+
+int ACE_DynScheduler::number_of_dependencies(RT_Info& rt_info)
+{
+ return rt_info.dependencies.length();
+}
+
+int ACE_DynScheduler::add_dependency(RT_Info* rt_info,
+ Dependency_Info& d)
+{
+ RT_Info *temp_info = 0; // temporary pointer to the caller's RT_Info
+
+ switch (d.dependency_type)
+ {
+ case RtecBase::TWO_WAY_CALL:
+
+ temp_info = rt_info;
+ break;
+
+ case RtecBase::ONE_WAY_CALL:
+
+ // swap the handles and point to the caller instead of the called operation
+ if (lookup_rt_info (d.rt_info, temp_info) != SUCCEEDED)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("cannot find %d to add dependency\n"), d.rt_info));
+ return -1;
+ }
+
+ d.rt_info = rt_info->handle;
+ break;
+
+ default:
+
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("unrecognized dependency type %d for %s\n"),
+ d.dependency_type, ACE_TEXT_CHAR_TO_TCHAR(rt_info->entry_point.in ())));
+ return -1;
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("Sched (%t) adding %s dependency to caller: %s\n"),
+ (const ACE_TCHAR *) ((d.dependency_type == RtecBase::TWO_WAY_CALL)
+ ? ACE_TEXT("TWO_WAY") : ACE_TEXT("ONE_WAY")),
+ ACE_TEXT_CHAR_TO_TCHAR(temp_info->entry_point.in ())));
+
+ RtecScheduler::Dependency_Set& set = temp_info->dependencies;
+ int l = set.length();
+ set.length(l + 1);
+ set[l] = d;
+ return 0;
+}
+
+void ACE_DynScheduler::export_to_file (RT_Info* info, FILE* file)
+{
+ ACE_DynScheduler::export_to_file (*info, file);
+}
+
+void ACE_DynScheduler::export_to_file (RT_Info& info, FILE* file)
+{
+ (void) ACE_OS::fprintf (file,
+ "%s\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%u\n"
+ "# begin calls\n%d\n",
+ info.entry_point.in (),
+ info.handle,
+ ACE_U64_TO_U32 (info.worst_case_execution_time),
+ ACE_U64_TO_U32 (info.typical_execution_time),
+ ACE_U64_TO_U32 (info.cached_execution_time),
+ int(info.period),
+ info.criticality,
+ info.importance,
+ ACE_U64_TO_U32 (info.quantum),
+ info.threads,
+ number_of_dependencies(info));
+
+ for (int i = 0; i < number_of_dependencies(info); ++i)
+ {
+ RT_Info tmp;
+ (void) ACE_OS::fprintf (file, "%s, %d\n",
+ (const char*)tmp.entry_point,
+ info.dependencies[i].number_of_calls);
+
+ }
+
+ (void) ACE_OS::fprintf (file, "# end calls\n%d\n%d\n\n",
+ info.priority,
+ info.preemption_subpriority);
+
+
+}
+
+
+int
+ACE_DynScheduler::dispatch_configuration (const Preemption_Priority & p_priority,
+ OS_Priority & priority,
+ Dispatching_Type & d_type)
+{
+ // look up the stored configuration info for the given priority level
+ Config_Info *config_info;
+ if (lookup_config_info (p_priority, config_info) != SUCCEEDED)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("Config info for priority %lu could not be found\n"),
+ p_priority),
+ -1);
+ }
+
+ priority = config_info->thread_priority;
+ d_type = config_info->dispatching_type;
+
+ return 0;
+}
+ // provide the thread priority and queue type for the given priority level
+
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::lookup_rt_info (handle_t handle,
+ RT_Info*& rtinfo)
+{
+ if (handle < 0 || (size_t) handle > rt_info_entries_.size ())
+ {
+ return ST_UNKNOWN_TASK;
+ }
+
+ RT_Info** entry;
+ ACE_Unbounded_Set_Iterator <RT_Info *> i (rt_info_entries_);
+ while (i.next (entry) != 0)
+ {
+ i.advance ();
+ RT_Info* info_ptr = *entry;
+ if (info_ptr->handle == handle)
+ {
+ rtinfo = info_ptr;
+ return SUCCEEDED;
+ }
+ }
+
+ return ST_UNKNOWN_TASK;
+}
+ // obtains an RT_Info based on its "handle".
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::lookup_config_info (Preemption_Priority priority,
+ Config_Info* &config_info)
+{
+ if (config_info_entries_ == 0)
+ {
+ return NOT_SCHEDULED;
+ }
+
+ if (priority < 0 || (size_t) priority > config_info_entries_->size ())
+ {
+ return ST_UNKNOWN_PRIORITY;
+ }
+
+ Config_Info** entry;
+ ACE_Unbounded_Set_Iterator <Config_Info *> i (*config_info_entries_);
+ while (i.next (entry) != 0)
+ {
+ i.advance ();
+ Config_Info* config_ptr = *entry;
+ if (config_ptr->preemption_priority == priority)
+ {
+ config_info = config_ptr;
+ return SUCCEEDED;
+ }
+ }
+
+ return ST_UNKNOWN_PRIORITY;
+}
+ // Obtains a Config_Info based on its priority.
+
+
+void
+ACE_DynScheduler::reset ()
+{
+ // if the schedule is up to date, free resources
+ // and mark schedule as not being up to date
+ if (up_to_date_)
+ {
+ delete [] task_entries_;
+ task_entries_ = 0;
+
+ delete [] ordered_task_entries_;
+ ordered_task_entries_ = 0;
+
+ delete thread_delineators_;
+ thread_delineators_ = 0;
+
+ delete [] ordered_thread_dispatch_entries_;
+ ordered_thread_dispatch_entries_ = 0;
+
+ if (dispatch_entries_)
+ {
+ // free all the dispatch entries in the list, then the list itself
+ ACE_Unbounded_Set_Iterator <Dispatch_Entry *> iter (*dispatch_entries_);
+ Dispatch_Entry **entry = 0;
+ for (iter.first (); ! iter.done (); iter.advance (), entry = 0)
+ {
+ if ((iter.next (entry) != 0) && (entry) && (*entry))
+ {
+ delete (*entry);
+ }
+ }
+ delete dispatch_entries_;
+ dispatch_entries_ = 0;
+ }
+
+ if (config_info_entries_)
+ {
+ // free all the config info entries in the list, then the list itself
+ ACE_Unbounded_Set_Iterator <Config_Info *> iter (*config_info_entries_);
+ Config_Info **entry = 0;
+ for (iter.first (); ! iter.done (); iter.advance (), entry = 0)
+ {
+ if ((iter.next (entry) != 0) && (entry) && (*entry))
+ {
+ delete (*entry);
+ }
+ }
+ delete config_info_entries_;
+ config_info_entries_ = 0;
+ }
+
+
+ if (expanded_dispatches_)
+ {
+ // free all the dispatch entries in the list, then the list itself
+ ACE_Unbounded_Set_Iterator <Dispatch_Entry *> expanded_iter (*expanded_dispatches_);
+ Dispatch_Entry **expanded_entry = 0;
+ for (expanded_iter.first (); ! expanded_iter.done ();
+ expanded_iter.advance (), expanded_entry = 0)
+ {
+ if ((expanded_iter.next (expanded_entry) != 0) &&
+ (expanded_entry) && (*expanded_entry))
+ {
+ delete (*expanded_entry);
+ }
+ }
+ delete expanded_dispatches_;
+ expanded_dispatches_ = 0;
+ }
+
+ delete [] ordered_dispatch_entries_;
+ ordered_dispatch_entries_ = 0;
+
+ dispatch_entry_count_ = 0;
+ threads_ = 0;
+
+ status_ = NOT_SCHEDULED;
+
+ frame_size_ = 1;
+ critical_set_frame_size_ = 0;
+ utilization_ = 0.0;
+ critical_set_utilization_ = 0.0;
+ minimum_priority_queue_ = 0;
+ minimum_guaranteed_priority_queue_ = -1;
+
+ if (timeline_)
+ {
+ // iterate over and delete the set of timeline entries
+ ACE_Ordered_MultiSet_Iterator <TimeLine_Entry_Link> t_iter (*timeline_);
+ TimeLine_Entry_Link *t_entry = 0;
+ for (t_iter.first (); ! t_iter.done (); t_iter.advance (), t_entry = 0)
+ {
+ if ((t_iter.next (t_entry) != 0) && (t_entry))
+ {
+ delete &(t_entry->entry ());
+ }
+ }
+ delete timeline_;
+ timeline_ = 0;
+ }
+
+ up_to_date_ = 0;
+ }
+}
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::schedule (
+ ACE_Unbounded_Set<RtecScheduler::Scheduling_Anomaly *> &anomaly_set)
+{
+ ACE_GUARD_RETURN (LOCK, ace_mon, lock_, ACE_DynScheduler::FAILED);
+
+ RtecScheduler::Anomaly_Severity severity = RtecScheduler::ANOMALY_NONE;
+ RtecScheduler::Anomaly_Severity temp_severity = RtecScheduler::ANOMALY_NONE;
+ status_t temp_status = SUCCEEDED;
+ Scheduling_Anomaly *anomaly = 0;
+ ACE_CString unresolved_locals (""), unresolved_remotes ("");
+
+ if (up_to_date_)
+ {
+ // do nothing if the RT_Infos have not changed
+ // since the last valid schedule was generated
+ return SUCCEEDED;
+ }
+ else
+ {
+ // save the total number of registered RT_Infos
+ tasks (static_cast<u_int> (rt_info_entries_.size ()));
+ }
+
+ // set up the task entry data structures
+ status_ = setup_task_entries ();
+ if (status_ != SUCCEEDED)
+ {
+ // Create an anomaly, add it to anomaly set
+ anomaly = create_anomaly (status_);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+
+ switch (anomaly->severity)
+ {
+ case RtecScheduler::ANOMALY_FATAL :
+ return status_;
+
+ default:
+ severity = anomaly->severity;
+ break;
+ }
+ }
+
+ // check for cycles in the dependency graph: as a side effect, leaves
+ // the ordered_task_entries_ pointer array sorted in topological order,
+ // which is used by propagate_dispatches () to ensure that dispatches
+ // are propagated top down in the call graph.
+ temp_status = check_dependency_cycles ();
+ if (temp_status != SUCCEEDED)
+ {
+ // Create an anomaly, add it to anomaly set
+ anomaly = create_anomaly (temp_status);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+
+ switch (anomaly->severity)
+ {
+ case RtecScheduler::ANOMALY_FATAL :
+ status_ = temp_status;
+ return status_;
+
+ case RtecScheduler::ANOMALY_ERROR :
+ severity = anomaly->severity;
+ status_ = temp_status;
+ break;
+
+ case RtecScheduler::ANOMALY_WARNING :
+ if (severity == RtecScheduler::ANOMALY_NONE)
+ {
+ severity = anomaly->severity;
+ status_ = temp_status;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ // task entries are related, now threads can be found
+ temp_status = identify_threads (unresolved_locals,
+ unresolved_remotes);
+ if (temp_status != SUCCEEDED)
+ {
+ temp_severity = anomaly_severity (temp_status);
+ switch (temp_severity)
+ {
+ case RtecScheduler::ANOMALY_FATAL :
+ status_ = temp_status;
+ return status_;
+
+ case RtecScheduler::ANOMALY_ERROR :
+ severity = temp_severity;
+ status_ = temp_status;
+ break;
+
+ case RtecScheduler::ANOMALY_WARNING :
+ if (severity == RtecScheduler::ANOMALY_NONE)
+ {
+ severity = temp_severity;
+ status_ = temp_status;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ // invoke the internal thread scheduling method of the strategy
+ temp_status = schedule_threads (anomaly_set);
+ if (temp_status != SUCCEEDED)
+ {
+ temp_severity = anomaly_severity (temp_status);
+ switch (temp_severity)
+ {
+ case RtecScheduler::ANOMALY_FATAL :
+ status_ = temp_status;
+ return status_;
+
+ case RtecScheduler::ANOMALY_ERROR :
+ severity = temp_severity;
+ status_ = temp_status;
+ break;
+
+ case RtecScheduler::ANOMALY_WARNING :
+ if (severity == RtecScheduler::ANOMALY_NONE)
+ {
+ severity = temp_severity;
+ status_ = temp_status;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ // propagate the dispatch information from the
+ // threads throughout the call graph
+ temp_status = propagate_dispatches (anomaly_set,
+ unresolved_locals,
+ unresolved_remotes);
+ if (temp_status != SUCCEEDED)
+ {
+ temp_severity = anomaly_severity (temp_status);
+ switch (temp_severity)
+ {
+ case RtecScheduler::ANOMALY_FATAL :
+ status_ = temp_status;
+ return status_;
+
+ case RtecScheduler::ANOMALY_ERROR :
+ severity = temp_severity;
+ status_ = temp_status;
+ break;
+
+ case RtecScheduler::ANOMALY_WARNING :
+ if (severity == RtecScheduler::ANOMALY_NONE)
+ {
+ severity = temp_severity;
+ status_ = temp_status;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ // log anomalies for unresolved local dependencies
+ if (unresolved_locals.length () > 0)
+ {
+ // Create an anomaly, add it to anomaly set
+ anomaly = create_anomaly (ST_UNRESOLVED_LOCAL_DEPENDENCIES);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+
+ ACE_NEW_RETURN (anomaly, ACE_DynScheduler::Scheduling_Anomaly,
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+
+ ACE_CString temp_str ("The following entry points have "
+ "unresolved local dependencies:\n");
+ temp_str += unresolved_locals;
+
+ anomaly->severity =
+ anomaly_severity (ST_UNRESOLVED_LOCAL_DEPENDENCIES);
+ anomaly->description = temp_str.c_str ();
+ anomaly_set.insert (anomaly);
+ }
+
+ // log anomalies for unresolved remote dependencies
+ if (unresolved_remotes.length () > 0)
+ {
+ // Create an anomaly, add it to anomaly set
+ anomaly = create_anomaly (ST_UNRESOLVED_REMOTE_DEPENDENCIES);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+
+ ACE_NEW_RETURN (anomaly, ACE_DynScheduler::Scheduling_Anomaly,
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+
+ ACE_CString temp_str ("The following entry points have "
+ "unresolved remote dependencies:\n");
+ temp_str += unresolved_remotes;
+
+ anomaly->severity =
+ anomaly_severity (ST_UNRESOLVED_REMOTE_DEPENDENCIES);
+ anomaly->description = temp_str.c_str ();
+ anomaly_set.insert (anomaly);
+ }
+
+ // invoke the internal dispatch scheduling method of the strategy
+ temp_status = schedule_dispatches (anomaly_set);
+ if (temp_status != SUCCEEDED)
+ {
+ temp_severity = anomaly_severity (temp_status);
+ switch (temp_severity)
+ {
+ case RtecScheduler::ANOMALY_FATAL :
+ status_ = temp_status;
+ return status_;
+
+ case RtecScheduler::ANOMALY_ERROR :
+ severity = temp_severity;
+ status_ = temp_status;
+ break;
+
+ case RtecScheduler::ANOMALY_WARNING :
+ if (severity == RtecScheduler::ANOMALY_NONE)
+ {
+ severity = temp_severity;
+ status_ = temp_status;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ // calculate utilization, total frame size, critical set
+ temp_status = calculate_utilization_params ();
+ if (temp_status != SUCCEEDED)
+ {
+ // Create an anomaly, add it to anomaly set
+ anomaly = create_anomaly (temp_status);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+
+ switch (anomaly->severity)
+ {
+ case RtecScheduler::ANOMALY_FATAL :
+ status_ = temp_status;
+ return status_;
+
+ case RtecScheduler::ANOMALY_ERROR :
+ severity = anomaly->severity;
+ status_ = temp_status;
+ break;
+
+ case RtecScheduler::ANOMALY_WARNING :
+ if (severity == RtecScheduler::ANOMALY_NONE)
+ {
+ severity = anomaly->severity;
+ status_ = temp_status;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ // calculate utilization, total frame size, critical set
+ temp_status = store_assigned_info ();
+ if (temp_status != SUCCEEDED)
+ {
+ // Create an anomaly, add it to anomaly set
+ anomaly = create_anomaly (temp_status);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+
+ switch (anomaly->severity)
+ {
+ case RtecScheduler::ANOMALY_FATAL :
+ status_ = temp_status;
+ return status_;
+
+ case RtecScheduler::ANOMALY_ERROR :
+ severity = anomaly->severity;
+ status_ = temp_status;
+ break;
+
+ case RtecScheduler::ANOMALY_WARNING :
+ if (severity == RtecScheduler::ANOMALY_NONE)
+ {
+ severity = anomaly->severity;
+ status_ = temp_status;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ // generate, store the timeline to a file if file was given
+ if (timeline_filename_ != 0)
+ {
+ // generate the scheduling timeline over the total frame size
+ temp_status = create_timeline ();
+ if (temp_status != SUCCEEDED)
+ {
+ // Create an anomaly, add it to anomaly set
+ anomaly = create_anomaly (temp_status);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+
+ switch (anomaly->severity)
+ {
+ case RtecScheduler::ANOMALY_FATAL :
+ status_ = temp_status;
+ return status_;
+
+ case RtecScheduler::ANOMALY_ERROR :
+ severity = anomaly->severity;
+ status_ = temp_status;
+ break;
+
+ case RtecScheduler::ANOMALY_WARNING :
+ if (severity == RtecScheduler::ANOMALY_NONE)
+ {
+ severity = anomaly->severity;
+ status_ = temp_status;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+
+ temp_status = output_timeline (timeline_filename_, 0);
+ if (temp_status != SUCCEEDED)
+ {
+ // Create an anomaly, add it to anomaly set
+ anomaly = create_anomaly (temp_status);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+
+ switch (anomaly->severity)
+ {
+ case RtecScheduler::ANOMALY_FATAL :
+ status_ = temp_status;
+ return status_;
+
+ case RtecScheduler::ANOMALY_ERROR :
+ severity = anomaly->severity;
+ status_ = temp_status;
+ break;
+
+ case RtecScheduler::ANOMALY_WARNING :
+ if (severity == RtecScheduler::ANOMALY_NONE)
+ {
+ severity = anomaly->severity;
+ status_ = temp_status;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+
+ // if a valid schedule was generated, mark it as up to date
+ switch (status_)
+ {
+ // These are statuses that indicate a reasonable schedule was generated.
+ case SUCCEEDED:
+ case ST_TASK_ALREADY_REGISTERED :
+ case ST_UNRESOLVED_REMOTE_DEPENDENCIES :
+ case ST_UTILIZATION_BOUND_EXCEEDED :
+ case ST_INSUFFICIENT_THREAD_PRIORITY_LEVELS :
+
+ // if we made it here, the schedule is done
+ up_to_date_ = 1;
+
+ break;
+
+ default:
+ break;
+ }
+
+
+ return status_;
+}
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::propagate_dispatches (
+ ACE_Unbounded_Set<RtecScheduler::Scheduling_Anomaly *> &anomaly_set,
+ ACE_CString & unresolved_locals,
+ ACE_CString & unresolved_remotes)
+{
+ u_long i;
+ frame_size_ = 1;
+ status_t status = SUCCEEDED;
+ Scheduling_Anomaly * anomaly = 0;
+
+ // iterate through the ordered_task_entries_ array in order
+ // from highest DFS finishing time to lowest, so that every
+ // calling dispatch is accessed before those it calls:
+ // the dispatches propagate top down through the call DAG
+ for (i = 0; i < tasks (); ++i)
+ {
+ switch (ordered_task_entries_ [i]->merge_dispatches (*dispatch_entries_,
+ unresolved_locals,
+ unresolved_remotes))
+ {
+ case Task_Entry::INTERNAL_ERROR :
+ // Create an anomaly, add it to anomaly set
+ anomaly = create_anomaly (ST_BAD_INTERNAL_POINTER);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+
+ return ST_BAD_INTERNAL_POINTER;
+
+ case Task_Entry::TWO_WAY_DISJUNCTION :
+ if (status == SUCCEEDED)
+ {
+ status = TWO_WAY_DISJUNCTION;
+ }
+ anomaly = create_anomaly (TWO_WAY_DISJUNCTION);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+ break;
+
+ case Task_Entry::TWO_WAY_CONJUNCTION :
+ if (status == SUCCEEDED)
+ {
+ status = TWO_WAY_CONJUNCTION;
+ }
+ anomaly = create_anomaly (TWO_WAY_CONJUNCTION);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+ break;
+
+ case Task_Entry::UNRECOGNIZED_INFO_TYPE :
+ if (status == SUCCEEDED)
+ {
+ status = UNRECOGNIZED_INFO_TYPE;
+ }
+ anomaly = create_anomaly (UNRECOGNIZED_INFO_TYPE);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+ break;
+
+ case Task_Entry::SUCCEEDED :
+ default:
+ break;
+ }
+
+ if (ordered_task_entries_ [i]->effective_period () > 0)
+ {
+ frame_size_ =
+ ACE::minimum_frame_size (frame_size_,
+ ordered_task_entries_ [i]->
+ effective_period ());
+ }
+ }
+
+ return status;
+}
+// propagate the dispatch information from the
+// threads throughout the call graph
+
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::calculate_utilization_params (void)
+{
+ critical_set_frame_size_ = 0;
+ utilization_ = 0.0;
+ critical_set_utilization_ = 0.0;
+
+ minimum_priority_queue_ =
+ ordered_dispatch_entries_ [0]->priority ();
+
+ minimum_guaranteed_priority_queue_ = -1;
+
+ // iterate through ordered task entries, calculating frame size, utilization
+ for (u_int i = 0; i < dispatch_entry_count_; ++i)
+ {
+ // if we've just finished examining another priority level
+ if (minimum_priority_queue_ != ordered_dispatch_entries_ [i]->priority ())
+ {
+ // update parameters for the previous priority level
+ update_priority_level_params ();
+
+ // update the minimum priority queue
+ minimum_priority_queue_ = ordered_dispatch_entries_ [i]->priority ();
+ }
+
+ // Only consider computation times of dispatches of
+ // OPERATION and REMOTE_DEPENDANT descriptors.
+ if (((ordered_dispatch_entries_ [i]->task_entry ().info_type () ==
+ RtecScheduler::OPERATION) ||
+ (ordered_dispatch_entries_ [i]->task_entry ().info_type () ==
+ RtecScheduler::REMOTE_DEPENDANT)) &&
+ (ordered_dispatch_entries_ [i]->task_entry ().effective_period () > 0))
+ {
+ utilization_ +=
+ static_cast<double> (ACE_UINT64_DBLCAST_ADAPTER (ordered_dispatch_entries_ [i]->
+ task_entry ().rt_info ()->worst_case_execution_time)) /
+ static_cast<double> (ordered_dispatch_entries_ [i]->
+ task_entry ().effective_period ());
+ }
+ }
+
+ // update parameters for the lowest priority level
+ update_priority_level_params ();
+
+ // if the critical set is schedulable, return success
+ return (1.0 - critical_set_utilization_ > DBL_EPSILON)
+ ? SUCCEEDED : ST_UTILIZATION_BOUND_EXCEEDED;
+}
+
+
+
+void
+ACE_DynScheduler::update_priority_level_params ()
+{
+ // if we've just finished examining a critical priority level
+ if (minimum_priority_queue_ <= minimum_critical_priority ())
+ {
+ // update the information about the critical set
+ critical_set_frame_size_ = frame_size_;
+ critical_set_utilization_ = utilization_;
+ }
+
+ // if the lowest priority level considered is schedulable
+ if (1.0 - utilization_ > DBL_EPSILON)
+ {
+ // the minimum guaranteed priority queue is the minimum considered so far
+ minimum_guaranteed_priority_queue_ = minimum_priority_queue_;
+ }
+}
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::setup_task_entries (void)
+{
+ // store number of tasks, based on registrations
+ tasks (static_cast<u_int> (rt_info_entries_.size ()));
+
+ // bail out if there are no tasks registered
+ if (tasks () <= 0)
+ {
+ return ST_NO_TASKS_REGISTERED;
+ }
+
+ // clear the decks of any previous scheduling information
+ reset ();
+
+ // allocate new table of task entries (wrappers for rt_infos)
+ size_t task_count = tasks ();
+ ACE_NEW_RETURN (task_entries_, Task_Entry [task_count],
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+
+ // allocate new table of pointers to task entries (for sorting)
+ ACE_NEW_RETURN (ordered_task_entries_, Task_Entry *[task_count],
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+ // @@ TODO: this is completely bogus code, the bit-wise
+ // representation of a null pointer is not always a string of
+ // zeroes. The correct way to intialize this array is with a for
+ // loop.
+ // ACE_OS::memset (ordered_task_entries_, 0,
+ // sizeof (Task_Entry *) * task_count);
+ for (size_t j = 0; j != task_count; ++j)
+ ordered_task_entries_[j] = 0;
+
+ // allocate new unbounded set for pointers to
+ // task entries that delineate threads
+ ACE_NEW_RETURN (thread_delineators_, ACE_Unbounded_Set <Dispatch_Entry *>,
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+
+ // allocate new unbounded set for pointers to dispatch entries
+ ACE_NEW_RETURN (dispatch_entries_,
+ ACE_Unbounded_Set <Dispatch_Entry *>,
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+
+ // allocate new unbounded set for pointers to config info entries
+ ACE_NEW_RETURN (config_info_entries_,
+ ACE_Unbounded_Set <Config_Info *>,
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+
+
+ // set up links between rt_info_entries_, task_entries_,
+ // and ordered_task_entries_ tables
+ ACE_Unbounded_Set_Iterator <RT_Info *> iter (rt_info_entries_);
+ for (u_int i = 0; i < tasks (); ++i, iter.advance ())
+ {
+ RT_Info** info_entry;
+
+ // tie task entry to corresponding rt_info
+ if (! iter.next (info_entry))
+ {
+ return ST_BAD_INTERNAL_POINTER;
+ }
+ task_entries_ [i].rt_info (*info_entry);
+
+ // Tie rt_info to corresponding task entry: the double cast is
+ // needed to ensure that the size of the pointer and the size of the
+ // stored magic cookie are the same (see the definition of
+ // ptrdiff_t in ACE to grok how this works portably).
+ task_entries_ [i].rt_info ()->volatile_token =
+ static_cast<CORBA::ULongLong> (reinterpret_cast<ptrdiff_t> (&(task_entries_ [i])));
+
+ // tie ordered task entry pointer to corresponding task entry
+ ordered_task_entries_ [i] = &(task_entries_ [i]);
+ }
+
+ // set up bidirectional links between task entries
+ return relate_task_entries ();
+}
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::relate_task_entries (void)
+{
+ status_t status = SUCCEEDED;
+
+ // do DFS traversal of the entire RT_Info handle dependency DAG, replicating
+ // the handle dependency DAG as a calls DAG of pointers between task
+ // entries (and creating its transpose, the callers DAG). This is done
+ // to avoid the O(n) cost of handle lookups in the RT_Infos for further
+ // traversal of the graph during schedule sorting. One useful side effect
+ // of this traversal is that is produces a topological ordering of dependencies
+ // in the traversal finishing times, which can be used to detect call cycles.
+ long time = 0;
+
+ for (u_int i = 0; i < tasks (); ++i)
+ {
+ if ((status = relate_task_entries_recurse (time, task_entries_[i]))
+ != SUCCEEDED)
+ {
+ break;
+ }
+ }
+
+ return status;
+}
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::relate_task_entries_recurse (long &time, Task_Entry &entry)
+{
+
+ // may have entered at a non-root node previously, so this does
+ // not necessarily indicate a cycle in the dependency graph
+ if (entry.dfs_status () != Task_Entry::NOT_VISITED)
+ {
+ return SUCCEEDED;
+ }
+
+ // when a node is discovered, mark it as visited, increment "time" and
+ // store as the entry's discovery time. This is not currently used in
+ // the scheduling algorithms, but is left in for possible future use
+ // as it shows full parenthetization of entry discovery/finishing.
+ entry.dfs_status (Task_Entry::VISITED);
+ entry.discovered (++time);
+
+ u_int dependency_count = number_of_dependencies (*entry.rt_info ());
+ if (dependency_count > 0)
+ {
+ // traverse dependencies of underlying RT_Info
+ for (u_int i = 0; i < dependency_count; ++i)
+ {
+ // obtain a pointer to the corresponding Task_Entry for each dependency
+
+ RT_Info* dependency_info = 0;
+ lookup_rt_info(entry.rt_info ()->dependencies[i].rt_info, dependency_info);
+
+ if (! dependency_info)
+ {
+ return ST_BAD_INTERNAL_POINTER;
+ }
+
+ // Obtain a pointer to the Task_Entry from the dependency
+ // RT_Info: the double cast is needed to ensure that the size of
+ // the pointer and the size of the stored magic cookie are the
+ // same (see the definition of ptrdiff_t in ACE to grok how
+ // this works portably).
+ Task_Entry *dependency_entry_ptr =
+ ACE_LONGLONG_TO_PTR (Task_Entry *, dependency_info->volatile_token);
+
+ if (! dependency_entry_ptr)
+ {
+ return ST_BAD_INTERNAL_POINTER;
+ }
+
+ // relate the entries according to the direction of the dependency
+ Task_Entry_Link *link;
+ ACE_NEW_RETURN (link,
+ Task_Entry_Link (entry,
+ *dependency_entry_ptr,
+ entry.rt_info ()->dependencies[i].number_of_calls,
+ entry.rt_info ()->dependencies[i].dependency_type),
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+
+ dependency_entry_ptr->callers ().insert (link);
+ entry.calls ().insert (link);
+
+ // depth first recursion on the newly identified entry
+ relate_task_entries_recurse (time, *dependency_entry_ptr);
+ }
+ }
+
+ // when a node is finished, mark it as finished, increment "time" and
+ // store as the entry's finish time. This produces a topological ordering
+ // based on dependencies, which is used to check for call cycles.
+ entry.dfs_status (Task_Entry::FINISHED);
+ entry.finished (++time);
+
+ return SUCCEEDED;
+}
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::identify_threads (ACE_CString & unresolved_locals,
+ ACE_CString & unresolved_remotes)
+{
+ u_int i, j;
+ ACE_DynScheduler::status_t result = SUCCEEDED;
+ char string_buffer [BUFSIZ];
+
+ // walk array of task entries, picking out thread delineators
+ for (i = 0; i < tasks_; i++)
+ {
+ // if entry has exposed threads or no callers, it may be a thread
+ if ((task_entries_ [i].rt_info ()->threads > 0) ||
+ (task_entries_ [i].callers ().is_empty ()))
+ {
+ // if its period is valued, it's a thread delineator
+ if (task_entries_ [i].rt_info ()->period > 0)
+ {
+ task_entries_ [i].effective_period (task_entries_ [i].rt_info ()->period);
+ task_entries_ [i].is_thread_delineator (1);
+
+ // create a Dispatch_Entry for each thread of the delimiting Task_Entry
+ u_int thread_count = (task_entries_ [i].rt_info ()->threads > 0)
+ ? task_entries_ [i].rt_info ()->threads : 1;
+ // Just use low 32 bits of effective_period. This will
+ // have to change when TimeBase.idl is finalized.
+ const TimeBase::TimeT zero = 0;
+ for (j = 0; j < thread_count; j++)
+ {
+ Dispatch_Entry *dispatch_ptr;
+ const TimeBase::TimeT effective_period =
+ task_entries_ [i].effective_period ();
+ ACE_NEW_RETURN(dispatch_ptr,
+ Dispatch_Entry (zero,
+ effective_period,
+ task_entries_ [i].rt_info ()->preemption_priority,
+ task_entries_ [i].rt_info ()->priority,
+ task_entries_ [i]),
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+
+ if ((task_entries_ [i].dispatches ().insert (Dispatch_Entry_Link (*dispatch_ptr)) < 0) ||
+ (dispatch_entries_->insert (dispatch_ptr) < 0) ||
+ (thread_delineators_->insert (dispatch_ptr) < 0))
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+
+ // increase the count of thread dispatches
+ ++ threads_;
+ }
+ }
+ else if (task_entries_ [i].rt_info ()->info_type == RtecScheduler::REMOTE_DEPENDANT)
+ {
+ // Warn about unresolved remote dependencies, mark the task entry
+
+ result = (result == SUCCEEDED)
+ ? ST_UNRESOLVED_REMOTE_DEPENDENCIES
+ : result;
+
+ task_entries_ [i].has_unresolved_remote_dependencies (1);
+
+ ACE_DEBUG (
+ (LM_DEBUG,
+ ACE_TEXT("Warning: an operation identified by ")
+ ACE_TEXT("\"%s\" has unresolved remote dependencies.\n"),
+ ACE_TEXT_CHAR_TO_TCHAR((const char*)task_entries_ [i].rt_info ()->entry_point)));
+
+ // Record entry point in list of unresolved remote dependencies
+ ACE_OS::sprintf (string_buffer, "// %s\n",
+ (const char*) task_entries_ [i].rt_info ()->
+ entry_point);
+ unresolved_remotes +=
+ ACE_CString (string_buffer);
+ }
+ else
+ {
+ // Local node that no one calls and has neither rate nor threads is suspect
+ ACE_DEBUG (
+ (LM_DEBUG,
+ ACE_TEXT("Error: operation \"%s\" does not specify a period or\n")
+ ACE_TEXT("visible threads, and is not called by any other operation.\n")
+ ACE_TEXT("Are there backwards dependencies.\n"),
+ ACE_TEXT_CHAR_TO_TCHAR((const char*)task_entries_ [i].rt_info ()->entry_point)));
+
+ result = ST_UNRESOLVED_LOCAL_DEPENDENCIES;
+
+ task_entries_ [i].has_unresolved_local_dependencies (1);
+
+ // Record entry point in list of unresolved local dependencies
+ ACE_OS::sprintf (string_buffer, "// %s\n",
+ (const char*) task_entries_ [i].rt_info ()->
+ entry_point);
+ unresolved_locals +=
+ ACE_CString (string_buffer);
+ }
+ }
+ }
+
+ return result;
+}
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::check_dependency_cycles (void)
+{
+ status_t return_status = SUCCEEDED;
+
+ // sort the pointers to entries in order of descending finish time
+ ACE_OS::qsort ((void *) ordered_task_entries_,
+ tasks (),
+ sizeof (Task_Entry *),
+ compare_entry_finish_times);
+
+ // set all the dfs_status indicators to NOT_VISITED
+ u_int i;
+ for (i = 0; i < tasks (); ++i)
+ {
+ ordered_task_entries_ [i]->dfs_status (Task_Entry::NOT_VISITED);
+ }
+
+ // recurse on each entry, saving most recent status if it is not SUCCEEDED
+ for (i = 0; i < tasks (); ++i)
+ {
+ status_t status =
+ check_dependency_cycles_recurse (*ordered_task_entries_ [i]);
+
+ if (status != SUCCEEDED)
+ {
+ return_status = status;
+ }
+ }
+
+ return return_status;
+}
+ // uses strongly connected components algorithm: consider entries
+ // in order of finishing time from dependency DAG traversal,
+ // but traverse transpose graph: any entry that has a dependant
+ // that was not previously visited in this traversal is part
+ // of a dependency cycle
+
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::check_dependency_cycles_recurse (Task_Entry &entry)
+{
+ status_t return_status = SUCCEEDED;
+
+ // halt DFS recursion on callers graph if entry has already been visited
+ if (entry.dfs_status () != Task_Entry::NOT_VISITED)
+ {
+ return return_status;
+ }
+
+ // mark the entry as visited
+ entry.dfs_status (Task_Entry::VISITED);
+
+ // check all the calling operations: if there is one that has not already been
+ // visited, mark the return status indicating there is a cycle, print
+ // an error message to that effect, and recurse on that dependant
+ Task_Entry_Link **calling_entry_link;
+ ACE_Unbounded_Set_Iterator <Task_Entry_Link *> i (entry.callers ());
+ while (i.next (calling_entry_link) != 0)
+ {
+ i.advance ();
+ if ((*calling_entry_link)->caller ().dfs_status () == Task_Entry::NOT_VISITED)
+ {
+ // indicate the two tasks are in (the same) dependency cycle
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("Tasks \"%s\" and \"%s\" are part of a call cycle.\n"),
+ ACE_TEXT_CHAR_TO_TCHAR((*calling_entry_link)->caller ().rt_info ()->entry_point.in ()),
+ ACE_TEXT_CHAR_TO_TCHAR(entry.rt_info ()->entry_point.in ())));
+
+ // set return status, ignore status returned by recursive call:
+ // we already know there are cycles in the dependencies
+ return_status = ST_CYCLE_IN_DEPENDENCIES;
+ check_dependency_cycles_recurse ((*calling_entry_link)->caller ());
+ }
+ }
+
+ // mark the entry as finished
+ entry.dfs_status (Task_Entry::FINISHED);
+
+ return return_status;
+}
+
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::schedule_threads (ACE_Unbounded_Set<RtecScheduler::Scheduling_Anomaly *> &anomaly_set)
+{
+ // make sure there are as many thread delineator
+ // entries in the set as the counter indicates
+ if (threads_ != thread_delineators_->size ())
+ {
+ return THREAD_COUNT_MISMATCH;
+ }
+
+ // allocate an array of pointers to the thread delineators
+ ACE_NEW_RETURN (ordered_thread_dispatch_entries_,
+ Dispatch_Entry * [threads_],
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+ ACE_OS::memset (ordered_thread_dispatch_entries_, 0,
+ sizeof (Dispatch_Entry *) * threads_);
+
+
+ // copy pointers to the thread delineators from the set to the array
+ ACE_Unbounded_Set_Iterator <Dispatch_Entry *> iter (*thread_delineators_);
+ for (u_int i = 0; i < threads_; ++i, iter.advance ())
+ {
+ Dispatch_Entry** dispatch_entry;
+
+ if (! iter.next (dispatch_entry))
+ {
+ return ST_BAD_INTERNAL_POINTER;
+ }
+
+ ordered_thread_dispatch_entries_ [i] = *dispatch_entry;
+ }
+
+ // sort the thread dispatch entries into priority order
+ status_t status = sort_dispatches (ordered_thread_dispatch_entries_, threads_);
+
+ if (status == SUCCEEDED)
+ {
+ // assign priorities to the thread dispatch entries
+ status = assign_priorities (ordered_thread_dispatch_entries_,
+ threads_, anomaly_set);
+ }
+
+ return status;
+}
+ // thread scheduling method: sets up array of pointers to task
+ // entries that are threads, calls internal thread scheduling method
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::schedule_dispatches (ACE_Unbounded_Set<RtecScheduler::Scheduling_Anomaly *> &anomaly_set)
+{
+ dispatch_entry_count_ = static_cast<u_int> (dispatch_entries_->size ());
+
+ ACE_NEW_RETURN (ordered_dispatch_entries_,
+ Dispatch_Entry * [dispatch_entry_count_],
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+ ACE_OS::memset (ordered_dispatch_entries_, 0,
+ sizeof (Dispatch_Entry *) * dispatch_entry_count_);
+
+ ACE_Unbounded_Set_Iterator <Dispatch_Entry *> iter (*dispatch_entries_);
+ for (u_int i = 0; i < dispatch_entry_count_; ++i, iter.advance ())
+ {
+ Dispatch_Entry** dispatch_entry;
+
+ if (! iter.next (dispatch_entry))
+ {
+ return ST_BAD_INTERNAL_POINTER;
+ }
+
+ ordered_dispatch_entries_ [i] = *dispatch_entry;
+ }
+
+ // sort the entries in order of priority and subpriority
+ sort_dispatches (ordered_dispatch_entries_, dispatch_entry_count_);
+
+ // assign dynamic and static subpriorities to the thread dispatch entries
+ return assign_subpriorities (ordered_dispatch_entries_,
+ dispatch_entry_count_, anomaly_set);
+}
+ // dispatch scheduling method: sets up an array of dispatch entries,
+ // calls internal dispatch scheduling method.
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::store_assigned_info (void)
+{
+ for (u_int i = 0; i < dispatch_entry_count_; ++i)
+ {
+ if ((! ordered_dispatch_entries_) || (! (ordered_dispatch_entries_[i])) ||
+ (! (ordered_dispatch_entries_[i]->task_entry ().rt_info ())))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::store_assigned_info () could not store ")
+ ACE_TEXT("priority information (error in internal representation)")),
+ ST_BAD_INTERNAL_POINTER);
+ }
+
+ // set OS priority and Scheduler preemption priority and static
+ // preemption subpriority in underlying RT_Info
+ ordered_dispatch_entries_ [i]->task_entry ().rt_info ()->priority =
+ ordered_dispatch_entries_ [i]->OS_priority ();
+ ordered_dispatch_entries_ [i]->task_entry ().rt_info ()->preemption_priority =
+ ordered_dispatch_entries_ [i]->priority ();
+ ordered_dispatch_entries_ [i]->task_entry ().rt_info ()->preemption_subpriority =
+ ordered_dispatch_entries_ [i]->static_subpriority ();
+ }
+
+ return SUCCEEDED;
+}
+ // = store assigned information back into the RT_Infos
+
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::create_timeline ()
+{
+ // queue of previously scheduled entries that need to be rescheduled
+ ACE_Unbounded_Queue <Dispatch_Entry *> reschedule_queue;
+
+ status_t status = SUCCEEDED;
+
+ ACE_NEW_RETURN(timeline_, ACE_Ordered_MultiSet <TimeLine_Entry_Link>,
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+
+ ACE_NEW_RETURN(expanded_dispatches_, ACE_Unbounded_Set <Dispatch_Entry *>,
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+
+ // start with the id of the first entry in the array
+ min_dispatch_id_ = ordered_dispatch_entries_[0]->dispatch_id ();
+ max_dispatch_id_ = ordered_dispatch_entries_[0]->dispatch_id ();
+
+ for (u_long i = 0; i < dispatch_entry_count_; ++i)
+ {
+ // update the minimal and maximal id values for the schedule
+ if (ordered_dispatch_entries_[i]->dispatch_id () < min_dispatch_id_)
+ {
+ min_dispatch_id_ = ordered_dispatch_entries_[i]->dispatch_id ();
+ }
+ if (ordered_dispatch_entries_[i]->dispatch_id () > max_dispatch_id_)
+ {
+ max_dispatch_id_ = ordered_dispatch_entries_[i]->dispatch_id ();
+ }
+
+ // only put OPERATION and REMOTE_DEPENDANT dispatches into the timeline.
+ if ((ordered_dispatch_entries_[i]->task_entry().info_type () !=
+ RtecScheduler::OPERATION) &&
+ (ordered_dispatch_entries_[i]->task_entry().info_type () !=
+ RtecScheduler::REMOTE_DEPENDANT))
+ {
+ continue;
+ }
+
+ // schedule the current dispatch entry into the timeline
+ status = schedule_timeline_entry (*(ordered_dispatch_entries_[i]),
+ reschedule_queue);
+ if (status != SUCCEEDED)
+ {
+ break;
+ }
+
+ // iterate through the set of dispatch entries that need to be rescheduled
+ Dispatch_Entry *rescheduled_entry;
+ while (reschedule_queue.is_empty () == 0)
+ {
+
+ if (reschedule_queue.dequeue_head (rescheduled_entry) < 0)
+ {
+ status = ST_BAD_INTERNAL_POINTER;
+ break;
+ }
+
+ status = schedule_timeline_entry (*rescheduled_entry, reschedule_queue);
+ if (status != SUCCEEDED)
+ {
+ break;
+ }
+ }
+ if (status != SUCCEEDED)
+ {
+ break;
+ }
+
+ // Schedule additional dispatches of the entry
+ // over the total frame size into the timeline.
+ u_long current_frame_offset = 0;
+ u_long task_period =
+ ordered_dispatch_entries_[i]->task_entry ().effective_period ();
+ for (current_frame_offset = task_period;
+ current_frame_offset < frame_size_;
+ current_frame_offset += task_period)
+ {
+ Dispatch_Entry *new_dispatch_entry;
+
+ // create a new dispatch entry at the current sub-frame offset
+ // Just use low 32 bits of arrival and deadline. This will
+ // have to change when TimeBase.idl is finalized.
+ const TimeBase::TimeT arrival =
+ ordered_dispatch_entries_[i]->arrival () +
+ static_cast<ACE_UINT32> (current_frame_offset);
+ const TimeBase::TimeT deadline=
+ ordered_dispatch_entries_[i]->deadline () +
+ static_cast<ACE_UINT32> (current_frame_offset);
+
+ ACE_NEW_RETURN (
+ new_dispatch_entry,
+ Dispatch_Entry (arrival,
+ deadline,
+ ordered_dispatch_entries_[i]->priority (),
+ ordered_dispatch_entries_[i]->OS_priority (),
+ ordered_dispatch_entries_[i]->task_entry (),
+ ordered_dispatch_entries_[i]),
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+
+ // add the new dispatch entry to the set of expanded dispatches
+ expanded_dispatches_->insert (new_dispatch_entry);
+
+ // schedule the new dispatch entry into the timeline
+ status = schedule_timeline_entry (*new_dispatch_entry, reschedule_queue);
+ if (status != SUCCEEDED)
+ {
+ break;
+ }
+
+ while (reschedule_queue.is_empty () == 0)
+ {
+ if (reschedule_queue.dequeue_head (rescheduled_entry) < 0)
+ {
+ status = ST_BAD_INTERNAL_POINTER;
+ break;
+ }
+ status = schedule_timeline_entry (*rescheduled_entry, reschedule_queue);
+ if (status != SUCCEEDED)
+ {
+ break;
+ }
+ }
+ if (status != SUCCEEDED)
+ {
+ break;
+ }
+ }
+
+ if (status != SUCCEEDED)
+ {
+ break;
+ }
+ }
+
+ return status;
+}
+ // Create a timeline.
+
+
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::output_dispatch_priorities (const char *filename)
+{
+ status_t status = UNABLE_TO_OPEN_SCHEDULE_FILE;
+
+ // open the file
+ FILE *file = ACE_OS::fopen (ACE_TEXT_CHAR_TO_TCHAR(filename), ACE_TEXT("w"));
+ if (file)
+ {
+ status = output_dispatch_priorities (file);
+ fclose (file);
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_dispatch_priorities: ")
+ ACE_TEXT("Could not open schedule file (\"%s\")"),
+ ACE_TEXT_CHAR_TO_TCHAR(filename)));
+ }
+
+ return status;
+}
+
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::output_dispatch_priorities (FILE *file)
+{
+
+ u_long dispatch_count = 0;
+ u_long i = 0;
+ for (i = 0; i < dispatch_entry_count_; ++i)
+ {
+ dispatch_count +=
+ frame_size_
+ / ordered_dispatch_entries_[i]->task_entry ().effective_period ();
+ }
+
+ if (ACE_OS::fprintf (
+ file, "\n\nSCHEDULING RESULTS:\n\n"
+ "Number of dispatches: %3lu\n"
+ "Number of threads: %3u\n"
+ "Number of tasks: %3u\n"
+ "Scheduler Status: [%d] %s\n"
+ "Total Frame Size: %lu nsec (%f Hz)\n"
+ "Critical Set Frame Size: %lu nsec (%f Hz)\n"
+ "Utilization: %f\n"
+ "Critical Set Utilization: %f\n"
+ "Minimum Priority Queue: %3d\n"
+ "Minimum Guaranteed Priority Queue: %3d\n"
+ "Minimum Critical Priority: %3d\n\n\n"
+
+ "DISPATCH PRIORITIES:\n\n"
+ " (critical \n"
+ " instant) \n"
+ " dispatch dynamic static \n"
+ "operation ID priority subpriority subpriority\n"
+ "--------- -------- -------- ----------- -----------\n",
+ dispatch_count, threads_, tasks_, status_,
+ status_message(status_), frame_size_,
+ (double) (10000000.0 / ((double) frame_size_)),
+ critical_set_frame_size_,
+ (double) (10000000.0 / ((double) critical_set_frame_size_)),
+ utilization_, critical_set_utilization_,
+ int(minimum_priority_queue_),
+ int(minimum_guaranteed_priority_queue_),
+ int(minimum_critical_priority ())) < 0)
+
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_dispatch_priorities: ")
+ ACE_TEXT("Could not write to schedule file\n")),
+ UNABLE_TO_WRITE_SCHEDULE_FILE);
+ }
+
+ for (i = 0; i < dispatch_entry_count_; ++i)
+ {
+ if (ACE_OS::fprintf (file, "%-11s %8lu %8u %11u %11u\n",
+ ordered_dispatch_entries_[i]->task_entry ().rt_info ()->
+ entry_point.in (),
+ ordered_dispatch_entries_[i]->dispatch_id (),
+ ordered_dispatch_entries_[i]->priority (),
+ ordered_dispatch_entries_[i]->dynamic_subpriority (),
+ ordered_dispatch_entries_[i]->static_subpriority ()) < 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_dispatch_priorities: ")
+ ACE_TEXT("Could not write to schedule file\n")),
+ UNABLE_TO_WRITE_SCHEDULE_FILE);
+ }
+ }
+
+ return SUCCEEDED;
+}
+
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::output_dispatch_timeline (const char *filename)
+{
+ status_t status = UNABLE_TO_OPEN_SCHEDULE_FILE;
+
+ // open the file
+ FILE *file = ACE_OS::fopen (ACE_TEXT_CHAR_TO_TCHAR(filename), ACE_TEXT("w"));
+ if (file)
+ {
+ status = output_dispatch_timeline (file);
+ fclose (file);
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_dispatch_timeline: ")
+ ACE_TEXT("Could not open schedule file (\"%s\")"),
+ filename));
+ }
+
+ return status;
+}
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::output_dispatch_timeline (FILE *file)
+{
+ if (ACE_OS::fprintf (
+ file, "\n\nDISPATCH TIMELINE:\n\n"
+ " dispatch arrival deadline start stop execution latency laxity\n"
+ "operation ID (nsec) (nsec) (nsec) (nsec) time (nsec) (nsec) (nsec)\n"
+ "--------- ----------- ------- -------- ----- ------ ----------- ------- ------\n") < 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_dispatch_timeline: ")
+ ACE_TEXT("Could not write to schedule file")),
+ UNABLE_TO_WRITE_SCHEDULE_FILE);
+ }
+
+ // iterate through timeline, picking out entries whose prev_ pointer
+ // is null (i.e. those representing the start of a dispatch), find end
+ // of dispatch, output the operation, dispatch, priority, and time info
+ ACE_Ordered_MultiSet_Iterator <TimeLine_Entry_Link> iter (*timeline_);
+ for (iter.first (); iter.done () == 0; iter.advance ())
+ {
+ TimeLine_Entry_Link *link;
+ if ((iter.next (link) == 0) || (! link))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_dispatch_timeline: ")
+ ACE_TEXT("Bad internal pointer\n")),
+ ST_BAD_INTERNAL_POINTER);
+ }
+
+ // for each timeline entry that starts a dispatch
+ if (link->entry ().prev () == 0)
+ {
+ // find the last time slice for the dispatch
+ TimeLine_Entry *last_entry = &(link->entry ());
+ while (last_entry->next ())
+ {
+ last_entry = last_entry->next ();
+ }
+
+ Time tmp = last_entry->stop () - link->entry ().arrival () -
+ link->entry ().dispatch_entry ().task_entry ().rt_info ()->
+ worst_case_execution_time;
+ if (link->entry ().dispatch_entry ().original_dispatch ())
+ {
+ if (ACE_OS::fprintf (
+ file,
+ "%-11s [%4lu] %4lu %7u %8u %8u "
+ "%10u %11u %10d %10d\n",
+ link->entry ().dispatch_entry ().task_entry ().rt_info ()->
+ entry_point.in (),
+ link->entry ().dispatch_entry ().original_dispatch ()->dispatch_id (),
+ link->entry ().dispatch_entry ().dispatch_id (),
+ ACE_U64_TO_U32 (link->entry ().arrival ()),
+ ACE_U64_TO_U32 (link->entry ().deadline ()),
+ ACE_U64_TO_U32 (link->entry ().start ()),
+ ACE_U64_TO_U32 (last_entry->stop ()),
+ ACE_U64_TO_U32 (link->entry ().dispatch_entry ().task_entry ().
+ rt_info ()->worst_case_execution_time),
+ ACE_U64_TO_U32 (tmp),
+ ACE_U64_TO_U32 (link->entry ().deadline () -
+ last_entry->stop ())) < 0)
+
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_dispatch_timeline: ")
+ ACE_TEXT("Unable to write to schedule file\n")),
+ UNABLE_TO_WRITE_SCHEDULE_FILE);
+ }
+ }
+ else
+ {
+ if (ACE_OS::fprintf (
+ file,
+ "%-11s %11lu %7u %8u %8u %10u %11u %10d %10d\n",
+ link->entry ().dispatch_entry ().task_entry ().rt_info ()->
+ entry_point.in (),
+ link->entry ().dispatch_entry ().dispatch_id (),
+ ACE_U64_TO_U32 (link->entry ().arrival ()),
+ ACE_U64_TO_U32 (link->entry ().deadline ()),
+ ACE_U64_TO_U32 (link->entry ().start ()),
+ ACE_U64_TO_U32 (last_entry->stop ()),
+ ACE_U64_TO_U32 (link->entry ().dispatch_entry ().task_entry ().
+ rt_info ()->worst_case_execution_time),
+ ACE_U64_TO_U32 (tmp),
+ ACE_U64_TO_U32 (link->entry ().deadline () -
+ last_entry->stop ())) < 0)
+
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_dispatch_timeline: ")
+ ACE_TEXT("Unable to write to schedule file\n")),
+ UNABLE_TO_WRITE_SCHEDULE_FILE);
+ }
+ }
+ }
+ }
+
+ return SUCCEEDED;
+}
+ // this prints the entire set of timeline outputs to the specified file
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::output_preemption_timeline (const char *filename)
+{
+ status_t status = UNABLE_TO_OPEN_SCHEDULE_FILE;
+
+ // open the file
+ FILE *file = ACE_OS::fopen (ACE_TEXT_CHAR_TO_TCHAR(filename), ACE_TEXT("w"));
+ if (file)
+ {
+ status = output_preemption_timeline (file);
+ fclose (file);
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_preemption_timeline: ")
+ ACE_TEXT("Cannot open timeline file (\"%s\")\n"),
+ ACE_TEXT_CHAR_TO_TCHAR(filename)));
+ }
+
+ return status;
+}
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::output_preemption_timeline (FILE *file)
+{
+ if (ACE_OS::fprintf (
+ file, "\n\nPREEMPTION TIMELINE:\n\n"
+ " dispatch start stop \n"
+ "operation ID (nsec) (nsec)\n"
+ "--------- ----------- ------ ------\n") < 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_preemption_timeline: ")
+ ACE_TEXT("Cannot write to timeline file\n")),
+ UNABLE_TO_WRITE_SCHEDULE_FILE);
+ }
+
+ ACE_Ordered_MultiSet_Iterator <TimeLine_Entry_Link> iter (*timeline_);
+
+ TimeLine_Entry_Link *link;
+ for (iter.first (); iter.done () == 0; iter.advance ())
+ {
+ if ((iter.next (link) == 0) || (! link))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_preemption_timeline: ")
+ ACE_TEXT("Bad internal pointer\n")),
+ ST_BAD_INTERNAL_POINTER);
+ }
+
+ if (link->entry ().dispatch_entry ().original_dispatch ())
+ {
+ if (ACE_OS::fprintf (
+ file, "%-9s [%4lu] %4lu %8u %8u\n",
+ link->entry ().dispatch_entry ().task_entry ().rt_info ()->
+ entry_point.in (),
+ link->entry ().dispatch_entry ().original_dispatch ()->dispatch_id (),
+ link->entry ().dispatch_entry ().dispatch_id (),
+ ACE_U64_TO_U32 (link->entry ().start ()),
+ ACE_U64_TO_U32 (link->entry ().stop ())) < 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_preemption_timeline: ")
+ ACE_TEXT("Cannot write to timeline file\n")),
+ UNABLE_TO_WRITE_SCHEDULE_FILE);
+ }
+ }
+ else
+ {
+ if (ACE_OS::fprintf (
+ file, "%-9s %11lu %8u %8u\n",
+ link->entry ().dispatch_entry ().task_entry ().rt_info ()->
+ entry_point.in (),
+ link->entry ().dispatch_entry ().dispatch_id (),
+ ACE_U64_TO_U32 (link->entry ().start ()),
+ ACE_U64_TO_U32 (link->entry ().stop ())) < 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_preemption_timeline: ")
+ ACE_TEXT("Cannot write to timeline file\n")),
+ UNABLE_TO_WRITE_SCHEDULE_FILE);
+ }
+ }
+ }
+
+ return SUCCEEDED;
+}
+
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::output_viewer_timeline (const char *filename)
+{
+ status_t status = UNABLE_TO_OPEN_SCHEDULE_FILE;
+
+ // open the file
+ FILE *file = ACE_OS::fopen (ACE_TEXT_CHAR_TO_TCHAR(filename), ACE_TEXT("w"));
+ if (file)
+ {
+ status = output_dispatch_timeline (file);
+ fclose (file);
+ }
+
+ return status;
+}
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::output_viewer_timeline (FILE *file)
+{
+ if (ACE_OS::fprintf (
+ file, "\n\nVIEWER TIMELINE:\n\n"
+ " arrival deadline completion execution \n"
+ "operation utilization overhead (nsec) (nsec) time (nsec) time (nsec)\n"
+ "--------- ----------- -------- ------- -------- ----------- -----------\n") < 0)
+ {
+ return UNABLE_TO_WRITE_SCHEDULE_FILE;
+ }
+
+ // iterate through timeline, picking out dispatches in chronological
+ // order of operation completion time
+ int entries_remain = 1;
+ Time accumulated_execution = 0;
+ Time current_accumulated_execution = 0;
+ Time last_completion = 0;
+ Time current_completion = 0;
+ TimeLine_Entry *current_entry = 0;
+ TimeLine_Entry *current_last_entry = 0;
+
+ while (entries_remain)
+ {
+ last_completion = current_completion;
+
+ accumulated_execution = 0;
+ current_accumulated_execution = 0;
+ current_completion = 0;
+ current_entry = 0;
+ current_last_entry = 0;
+
+ ACE_Ordered_MultiSet_Iterator <TimeLine_Entry_Link> iter (*timeline_);
+ for (iter.first (); iter.done () == 0; iter.advance ())
+ {
+ TimeLine_Entry_Link *link;
+ if ((iter.next (link) == 0) || (! link))
+ {
+ return ST_BAD_INTERNAL_POINTER;
+ }
+
+ accumulated_execution += link->entry ().stop () -
+ link->entry ().start ();
+
+ // for each timeline entry that starts a dispatch
+ if (link->entry ().prev () == 0)
+ {
+ // find the last time slice for the dispatch
+ TimeLine_Entry *last_entry = &(link->entry ());
+ while (last_entry->next ())
+ {
+ last_entry = last_entry->next ();
+ }
+
+ if ((last_entry->stop () > last_completion) &&
+ ((last_entry->stop () < current_completion) ||
+ (current_completion == 0U)))
+ {
+ current_completion = last_entry->stop ();
+ current_entry = &(link->entry ());
+ current_last_entry = last_entry;
+ }
+ }
+
+ // save the accumulated execution if we're at
+ // the last entry for the current dispatch
+ if (current_last_entry == &(link->entry ()))
+ {
+ current_accumulated_execution = accumulated_execution;
+ }
+ }
+
+ // if we found another entry, print it (otherwise we're done)
+ if (current_entry)
+ {
+ if (ACE_OS::fprintf (
+ file, "%-11s %9f %9f %8u %8u %11u %11u\n",
+ current_entry->dispatch_entry ().task_entry ().rt_info ()->
+ entry_point.in (),
+ static_cast<double> (ACE_UINT64_DBLCAST_ADAPTER(current_accumulated_execution)) /
+ static_cast<double> (ACE_UINT64_DBLCAST_ADAPTER(current_completion)),
+ 0.0,
+ ACE_U64_TO_U32 (current_entry->arrival ()),
+ ACE_U64_TO_U32 (current_entry->deadline ()),
+ ACE_U64_TO_U32 (current_last_entry->stop ()),
+ ACE_U64_TO_U32 (current_entry->dispatch_entry ().task_entry ().
+ rt_info ()->worst_case_execution_time)) < 0)
+ {
+ return UNABLE_TO_WRITE_SCHEDULE_FILE;
+ }
+ }
+ else
+ {
+ entries_remain = 0;
+ }
+ }
+
+ return SUCCEEDED;
+}
+
+
+ACE_DynScheduler::status_t
+ACE_DynScheduler::output_timeline (const char *filename, const char *heading)
+{
+ status_t status = SUCCEEDED;
+ FILE *file = 0;
+
+ // bail out if we're not up to date or there is no timeline
+ if ((! up_to_date_) || (! timeline_))
+ {
+ status = NOT_SCHEDULED;
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_timeline: ")
+ ACE_TEXT("Schedule not generated")));
+ }
+
+ if (status == SUCCEEDED)
+ {
+ // open the file
+ file = ACE_OS::fopen (ACE_TEXT_CHAR_TO_TCHAR(filename), ACE_TEXT("w"));
+ if (! file)
+ {
+ status = UNABLE_TO_OPEN_SCHEDULE_FILE;
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_timeline: ")
+ ACE_TEXT("Could not open schedule file")));
+ }
+ }
+
+ if ((status == SUCCEEDED) && (heading))
+ {
+ if (ACE_OS::fprintf (file, "%s\n\n", heading) < 0)
+ {
+ status = UNABLE_TO_WRITE_SCHEDULE_FILE;
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("ACE_DynScheduler::output_timeline: ")
+ ACE_TEXT("Could not write to schedule file")));
+ }
+ }
+
+ if (status == SUCCEEDED)
+ {
+ status = output_dispatch_priorities (file);
+ }
+
+ if (status == SUCCEEDED)
+ {
+ status = output_dispatch_timeline (file);
+ }
+
+ if (status == SUCCEEDED)
+ {
+ status = output_preemption_timeline (file);
+ }
+
+ if (status == SUCCEEDED)
+ {
+ status = output_viewer_timeline (file);
+ }
+
+ if (file)
+ {
+ fclose (file);
+ }
+
+ return status;
+}
+ // this prints the entire set of timeline outputs to the specified file
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Sched/DynSched.h b/TAO/orbsvcs/orbsvcs/Sched/DynSched.h
new file mode 100644
index 00000000000..bae77c581a2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/DynSched.h
@@ -0,0 +1,544 @@
+// -*- C++ -*-
+
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// sched
+//
+// = FILENAME
+// DynSched.h
+//
+// = CREATION DATE
+// 23 January 1997
+//
+// = AUTHOR
+// Chris Gill
+//
+// ============================================================================
+
+#ifndef DYNSCHED_H
+#define DYNSCHED_H
+#include /**/ "ace/pre.h"
+
+#include "ace/ACE.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Map_Manager.h"
+#include "ace/Message_Block.h"
+#include "ace/SString.h"
+#include "orbsvcs/Sched/SchedEntry.h"
+#include "orbsvcs/Sched/sched_export.h"
+#include "ace/Recursive_Thread_Mutex.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_RTSched_Export ACE_DynScheduler
+ // = TITLE
+ // Dispatch scheduling interface.
+ //
+ // = DESCRIPTION
+ // This abstract base class provides the majority of the
+ // implementation of either an off-line scheduler, or the
+ // necessary on-line component of the Scheduler.
+{
+public:
+
+ //////////////////////////////
+ // public type declarations //
+ //////////////////////////////
+
+ typedef RtecScheduler::handle_t handle_t;
+ typedef RtecScheduler::Dependency_Info Dependency_Info;
+ typedef RtecScheduler::Preemption_Priority_t Preemption_Priority;
+ typedef RtecScheduler::OS_Priority OS_Priority;
+ typedef RtecScheduler::Preemption_Subpriority_t Sub_Priority;
+ typedef RtecScheduler::RT_Info RT_Info;
+ typedef RtecScheduler::Config_Info Config_Info;
+ typedef RtecScheduler::Time Time;
+ typedef RtecScheduler::Period_t Period;
+ typedef RtecScheduler::Info_Type_t Info_Type;
+ typedef RtecScheduler::Dependency_Type_t Dependency_Type;
+ typedef RtecScheduler::Dispatching_Type_t Dispatching_Type;
+ typedef RtecScheduler::Scheduling_Anomaly Scheduling_Anomaly;
+ typedef RtecScheduler::Anomaly_Severity Anomaly_Severity;
+
+ typedef ACE_Map_Entry <ACE_CString, RT_Info *> Thread_Map_Entry;
+ typedef ACE_Map_Manager <ACE_CString, RT_Info *, ACE_Null_Mutex>
+ Thread_Map;
+ typedef ACE_Map_Iterator <ACE_CString, RT_Info *, ACE_Null_Mutex>
+ Thread_Map_Iterator;
+
+ typedef const char *Object_Name;
+ // Objects are named by unique strings.
+
+ enum status_t {
+ // The following are used both by the runtime Scheduler and during
+ // scheduling.
+ NOT_SCHEDULED = -1 // the schedule () method has not been called yet
+ , FAILED = -1
+ , SUCCEEDED
+ , ST_UNKNOWN_TASK
+ , ST_UNKNOWN_PRIORITY
+ , ST_TASK_ALREADY_REGISTERED
+ , ST_NO_TASKS_REGISTERED
+ , ST_BAD_DEPENDENCIES_ON_TASK
+ , ST_BAD_INTERNAL_POINTER
+ , ST_VIRTUAL_MEMORY_EXHAUSTED
+ , TWO_WAY_DISJUNCTION
+ , TWO_WAY_CONJUNCTION
+ , UNRECOGNIZED_INFO_TYPE
+
+ // The following are only used by the runtime Scheduler.
+ , TASK_COUNT_MISMATCH // only used by schedule ()
+ , THREAD_COUNT_MISMATCH // only used by schedule ()
+ , INVALID_PRIORITY // only used by schedule (): mismatch of
+ // (off-line, maybe) Scheduler output to
+ // the runtime Scheduler component.
+
+ // The following are only used during scheduling (in the case of
+ // off-line scheduling, they are only used prior to runtime).
+ , ST_UTILIZATION_BOUND_EXCEEDED
+ , ST_INSUFFICIENT_THREAD_PRIORITY_LEVELS
+ , ST_CYCLE_IN_DEPENDENCIES
+ , ST_UNRESOLVED_REMOTE_DEPENDENCIES
+ , ST_UNRESOLVED_LOCAL_DEPENDENCIES
+ , ST_INVALID_PRIORITY_ORDERING
+ , UNABLE_TO_OPEN_SCHEDULE_FILE
+ , UNABLE_TO_WRITE_SCHEDULE_FILE
+ };
+
+
+
+ /////////////////////////////
+ // public member functions //
+ /////////////////////////////
+
+ virtual ~ACE_DynScheduler ();
+ // public dtor
+
+ // = Utility function for outputting the textual
+ // representation of a status_t value.
+ static const char * status_message (status_t status);
+
+ // = Utility function for creating an entry for determining
+ // the severity of an anomaly detected during scheduling.
+ static Anomaly_Severity anomaly_severity (status_t status);
+
+ // = Utility function for creating an entry for the
+ // log of anomalies detected during scheduling.
+ static Scheduling_Anomaly * create_anomaly (status_t status);
+
+
+ // = Initialize the scheduler.
+ void init (const OS_Priority minimum_priority,
+ const OS_Priority maximum_priority,
+ const char *runtime_filename = 0,
+ const char *rt_info_filename = 0,
+ const char *timeline_filename = 0);
+ // The minimum and maximum priority are the OS-specific priorities that
+ // are used when creating the schedule (assigning priorities). The
+ // minimum_priority is the priority value of the lowest priority.
+ // It may be numerically higher than the maximum_priority, on OS's such
+ // as VxWorks that use lower values to indicate higher priorities.
+ //
+ // When Scheduler::schedule is called, the schedule is output to the
+ // file named by "runtime_filename" if it is non-zero.
+ // This file is compilable; it is linked into the runtime executable
+ // to provide priorities to the runtime scheduling component.
+ // If the "rt_info_filename" is non-zero, the RT_Info for
+ // every task is exported to it. It is not used at runtime.
+ // If the "timeline_filename" is non-zero, the timeline output
+ // file is created. It is not used at runtime.
+ //
+ // The runtime scheduling component ignores these filenames. It just
+ // uses the priorities that were linked in to the executable, after
+ // converting them to platform-specific values.
+
+ void reset ();
+ // Prepare for another schedule computation: once a reasonable schedule
+ // has been generated, a new schedule will not be computed unless an
+ // RT_Info is added, or this method is invoked to clear the previous
+ // schedule (allows fault correcting alteration of RT_Infos outside the
+ // scheduler implementation, followed by generation of a new schedule).
+
+ // = Registers a task.
+ status_t register_task (RT_Info *, handle_t &handle);
+ // If the Task registration succeeds, this function returns SUCCEEDED
+ // and sets "handle" to a unique identifier for the task.
+ // Otherwise, it returns either VIRTUAL_MEMORY_EXHAUSTED or
+ // TASK_ALREADY_REGISTERED sets the handle to 0. (A task may
+ // only be registered once.)
+
+ status_t get_rt_info (Object_Name name, RT_Info* &rtinfo);
+ // Tries to find the RT_Info corresponding to <name> in the RT_Info
+ // database. Returns SUCCEEDED if <name> was found and <rtinfo> was
+ // set. Returns UNKNOWN_TASK if <name> was not found, but <rtinfo>
+ // was set to a newly allocated RT_Info. In this UNKNOWN_TASK case,
+ // the task must call RT_Info::set to fill in execution properties.
+ // In the SUCCEEDED and UNKNOWN_TASK cases, this->register_task
+ // (rtinfo, 0, handle) is called. Returns FAILED if an error
+ // occurs.
+ //
+ // One motivation for allocating RT_Info's from within the Scheduler
+ // is to allow RT_Infos to persist after the tasks that use them.
+ // For instance, we may want to call this->schedule right before the
+ // application exits a configuration run. If the tasks have been
+ // deleted (deleting their RT_Infos with them), this->schedule will
+ // fail.
+
+ status_t lookup_rt_info (handle_t handle, RT_Info* &rtinfo);
+ // Obtains an RT_Info based on its "handle".
+
+ status_t lookup_config_info (Preemption_Priority priority,
+ Config_Info* &config_info);
+ // Obtains a Config_Info based on its priority.
+
+ status_t
+ schedule (ACE_Unbounded_Set<Scheduling_Anomaly *> &anomaly_set);
+ // This sets up the data structures, invokes the internal scheduling method.
+
+ status_t output_timeline (const char *filename, const char *heading);
+ // this prints the entire set of timeline outputs to the specified file
+
+
+ // = Access a thread priority.
+ virtual int priority (const handle_t handle,
+ OS_Priority &priority,
+ Sub_Priority &subpriority,
+ Preemption_Priority &preemption_prio);
+ // "priority" is the OS thread priority that was assigned to the Task that
+ // was assigned "handle". "subpriority" combines the dynamic and static
+ // subpriorities of the Task that was assigned handle. "preemption_prio"
+ // is a platform-independent priority queue number, ranging from a
+ // highest priority value of 0 to the lowest priority value, which is
+ // returned by "minimum_priority_queue ()". Returns 0 on success,
+ // or -1 if an invalid handle was supplied.
+
+ // = Access the platform-independent priority value of the lowest-priority
+ // thread.
+ Preemption_Priority minimum_priority_queue () const;
+
+ // = Access the number of tasks.
+ u_int tasks () const;
+
+ // = Access the number of threads.
+ u_int threads () const;
+
+ // = Access the current scheduler status.
+ status_t status () const;
+
+ // = Access the current output (debugging) level.
+ u_int output_level () const;
+ // Default is 0; set to 1 to print out schedule, by task. Set
+ // to higher than one for debugging info.
+
+ // = Set the scheduler output (debugging) level.
+ void output_level (const u_int level);
+ // the only supported levels are 0 (quiet), 1 (verbose) and 2 (debug)
+
+ int add_dependency(RT_Info* rt_info,
+ Dependency_Info& d);
+
+ static int number_of_dependencies(RT_Info* rt_info);
+ static int number_of_dependencies(RT_Info& rt_info);
+
+ static void export_to_file (RT_Info*, FILE* file);
+ static void export_to_file (RT_Info&, FILE* file);
+
+ // accessors for the minimal and maximal dispatch entry id in the schedule
+ u_long min_dispatch_id () const;
+ u_long max_dispatch_id () const;
+
+ virtual int dispatch_configuration (const Preemption_Priority &p_priority,
+ OS_Priority& priority,
+ Dispatching_Type & d_type);
+ // provide the thread priority and queue type for the given priority level
+
+protected:
+
+ ////////////////////////////////
+ // protected member functions //
+ ////////////////////////////////
+
+ ACE_DynScheduler ();
+
+ status_t schedule_threads (
+ ACE_Unbounded_Set<RtecScheduler::Scheduling_Anomaly *> &anomaly_set);
+ // thread scheduling method: sets up array of pointers to task
+ // entries that are threads, calls internal thread scheduling method
+
+ status_t schedule_dispatches (
+ ACE_Unbounded_Set<RtecScheduler::Scheduling_Anomaly *> &anomaly_set);
+ // dispatch scheduling method: sets up an array of dispatch entries,
+ // calls internal dispatch scheduling method.
+
+ virtual status_t store_assigned_info (void);
+ // = store assigned information back into the RT_Infos
+
+ // = Set the minimum priority value.
+ void minimum_priority_queue (const Preemption_Priority minimum_priority_queue_number);
+
+ // = Set the number of tasks.
+ void tasks (const u_int tasks);
+
+ // = Set the number of threads.
+ void threads (const u_int threads);
+
+ // = Set the current scheduler status.
+ void status (const status_t new_status);
+
+ /////////////////////////////////////////////
+ // protected pure virtual member functions //
+ /////////////////////////////////////////////
+
+ virtual Preemption_Priority minimum_critical_priority () = 0;
+ // = determine the minimum critical priority number
+
+ virtual status_t sort_dispatches (Dispatch_Entry **, u_int) = 0;
+ // internal sorting method: this orders the dispatches by
+ // static priority and dynamic and static subpriority.
+
+ virtual status_t assign_priorities (
+ Dispatch_Entry **dispatches,
+ u_int count,
+ ACE_Unbounded_Set<RtecScheduler::Scheduling_Anomaly *> &anomaly_set) = 0;
+ // = assign priorities to the sorted dispatches
+
+ virtual status_t assign_subpriorities (
+ Dispatch_Entry **dispatches,
+ u_int count,
+ ACE_Unbounded_Set<RtecScheduler::Scheduling_Anomaly *> &anomaly_set) = 0;
+ // = assign dynamic and static sub-priorities to the sorted dispatches
+
+ virtual status_t
+ schedule_timeline_entry (Dispatch_Entry &dispatch_entry,
+ ACE_Unbounded_Queue <Dispatch_Entry *>
+ &reschedule_queue) = 0;
+ // = schedule a dispatch entry into the timeline being created
+
+ ////////////////////////////
+ // protected data members //
+ ////////////////////////////
+
+ OS_Priority minimum_priority_;
+ // The minimum OS thread priority value that the application specified (in
+ // its call to init ()).
+
+ OS_Priority maximum_priority_;
+ // The maximum OS thread priority value that the application specified (in
+ // its call to init ()).
+
+ Task_Entry *task_entries_;
+ // Collection of known tasks.
+
+ Task_Entry **ordered_task_entries_;
+ // An array of pointers to task entries which wrap RT_Infos. It is
+ // sorted by the DFS finishing time and then the resulting topological
+ // over the call graph is used both to check for call chain cycles and
+ // to correctly propagate scheduling information away from the threads.
+
+ ACE_Unbounded_Set <Dispatch_Entry *> *thread_delineators_;
+ // identifies dispatch entries whose underlying
+ // Task Entries delineate threads
+
+ Dispatch_Entry **ordered_thread_dispatch_entries_;
+ // An array of pointers to task entries which initiate call chains.
+ // It is sorted by the schedule_threads method defined in the derived class.
+
+ ACE_Unbounded_Set <Dispatch_Entry *> *dispatch_entries_;
+ // the set of dispatch entries
+
+ ACE_Unbounded_Set <Config_Info *> *config_info_entries_;
+ // Collection of dispatch configuration entries.
+
+ ACE_Unbounded_Set <Dispatch_Entry *> *expanded_dispatches_;
+ // expanded set of dispatch entries (all dispatch entries produced by
+ // expanding sub-frames to the total frame size during timeline creation)
+
+ Dispatch_Entry **ordered_dispatch_entries_;
+ // An array of pointers to dispatch entries. It is
+ // sorted by the schedule_dispatches method.
+
+ u_int dispatch_entry_count_;
+ // the number of dispatch entries in the schedule
+
+ u_int threads_;
+ // the number of dispatch entries in the schedule
+
+ ACE_Ordered_MultiSet <TimeLine_Entry_Link> *timeline_;
+ // Ordered MultiSet of timeline entries.
+
+private:
+
+ ///////////////////////////////
+ // private type declarations //
+ ///////////////////////////////
+
+ typedef ACE_CString EXT;
+ typedef RT_Info *INT;
+
+#if defined (ACE_HAS_THREADS)
+ typedef TAO_SYNCH_MUTEX SYNCH;
+ typedef TAO_SYNCH_RECURSIVE_MUTEX LOCK;
+#else
+ typedef ACE_Null_Mutex SYNCH;
+ typedef ACE_Null_Mutex LOCK;
+#endif /* ACE_HAS_THREADS */
+
+ typedef ACE_Map_Manager<EXT, INT, TAO_SYNCH_MUTEX> Info_Collection;
+ typedef ACE_Map_Iterator<EXT, INT, TAO_SYNCH_MUTEX> Info_Collection_Iterator;
+ typedef ACE_Map_Entry<EXT, INT> Info_Collection_Entry;
+
+ //////////////////////////////
+ // private member functions //
+ //////////////////////////////
+
+ status_t create_timeline ();
+ // Create a timeline.
+
+ status_t output_dispatch_timeline (const char *filename);
+ status_t output_dispatch_timeline (FILE *file);
+ // this prints a dispatch timeline to the specified file
+
+ status_t output_preemption_timeline (const char *filename);
+ status_t output_preemption_timeline (FILE *file);
+ // this prints a preemption timeline to the specified file
+
+ status_t output_viewer_timeline (const char *filename);
+ status_t output_viewer_timeline (FILE *file);
+ // this prints a scheduling viewer timeline to the specified file
+
+ status_t output_dispatch_priorities (const char *filename);
+ status_t output_dispatch_priorities (FILE *file);
+ // this prints the scheduling parameters and assigned priorities to the specified file
+
+ // = Set up the task entry data structures
+ status_t setup_task_entries (void);
+
+ // = Relate the task entries according to the
+ // dependencies of the underlying RT_Infos
+ status_t relate_task_entries (void);
+
+ // recursively traverse dependency graph, relating
+ // task entries and performing DFS start/end marking
+ status_t relate_task_entries_recurse (long &time, Task_Entry &entry);
+
+ // identify thread delimiters
+ status_t
+ identify_threads (ACE_CString & unresolved_locals,
+ ACE_CString & unresolved_remotes);
+
+ // checks for cycles in the dependency graph
+ status_t check_dependency_cycles (void);
+
+ // recursion used to check for cycles in the dependency graph
+ status_t check_dependency_cycles_recurse (Task_Entry &entry);
+
+ // = Aggregate the scheduling parameters of the threads
+ status_t aggregate_thread_parameters (void);
+
+ // = recursion over oneway dependencies used to aggregate thread parameters
+ status_t aggregate_oneways_recurse (Task_Entry &entry);
+
+ // = recursion over twoway dependencies used to aggregate thread parameters
+ status_t aggregate_twoways_recurse (Task_Entry &entry);
+
+ // update the scheduling parameters for the previous priority level
+ void update_priority_level_params ();
+
+ status_t
+ propagate_dispatches (
+ ACE_Unbounded_Set<RtecScheduler::Scheduling_Anomaly *> &anomaly_set,
+ ACE_CString & unresolved_locals,
+ ACE_CString & unresolved_remotes);
+ // propagate the dispatch information from the
+ // threads throughout the call graph
+
+ status_t calculate_utilization_params ();
+ // calculate utilization, frame size, etc.
+
+ // the following functions are not implememented
+ ACE_DynScheduler (const ACE_DynScheduler &);
+ ACE_DynScheduler &operator= (const ACE_DynScheduler &);
+
+ //////////////////////////
+ // private data members //
+ //////////////////////////
+
+ LOCK lock_;
+ // This protects access to the scheduler during configuration runs.
+
+ ACE_Unbounded_Set <RT_Info *> rt_info_entries_;
+ // Collection of known tasks.
+
+ u_int handles_;
+ // The number of task handles dispensed so far.
+
+ const char *runtime_filename_;
+ // Destination file of Scheduler output from the configuration run.
+
+ const char *rt_info_filename_;
+ // Destination file of all rt_info data from the configuration run.
+
+ const char *timeline_filename_;
+ // The destination of the timeline.
+
+ Info_Collection info_collection_;
+ // A binding of name to rt_info. This is the mapping for every
+ // rt_info in the process.
+
+ u_int tasks_;
+
+ status_t status_;
+
+ u_int output_level_;
+
+ u_long frame_size_; /* 100 nanosec */
+ // minimum frame size for all tasks
+
+ u_long critical_set_frame_size_; /* 100 nanosec */
+ // minimum frame size for guaranteed schedulable tasks
+
+ double utilization_;
+ // total utilization for all tasks
+
+ double critical_set_utilization_;
+ // minimum frame size for guaranteed schedulable tasks
+
+ Preemption_Priority minimum_priority_queue_;
+ // The platform-independent priority value of the Event Channel's
+ // minimum priority dispatch queue. The value of the maximum priority
+ // dispatch queue is always 0.
+
+ Preemption_Priority minimum_guaranteed_priority_queue_;
+ // The platform-independent priority value of the minimum priority dispatch
+ // queue whose operations are guaranteed to be schedulable. The value of
+ // the maximum priority dispatch queue is always 0, -1 indicates none can
+ // be guaranteed.
+
+ u_int up_to_date_;
+ // indicates whether the a valid schedule has been generated since the last
+ // relevant change (addition, alteration or removal of an RT_Info, etc.)
+
+ u_long min_dispatch_id_;
+
+ u_long max_dispatch_id_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Sched/DynSched.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* DYNSCHED_H */
+
+// EOF
diff --git a/TAO/orbsvcs/orbsvcs/Sched/DynSched.i b/TAO/orbsvcs/orbsvcs/Sched/DynSched.i
new file mode 100644
index 00000000000..8e27d24c28e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/DynSched.i
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// sched
+//
+// = FILENAME
+// DynSched.i
+//
+// = CREATION DATE
+// 23 January 1997
+//
+// = AUTHOR
+// Chris Gill
+//
+// ============================================================================
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+////////////////////////////
+// Class ACE_DynScheduler //
+////////////////////////////
+
+ACE_INLINE ACE_DynScheduler::Preemption_Priority
+ACE_DynScheduler::minimum_priority_queue () const
+{
+ return minimum_priority_queue_;
+}
+ // This is intended for use by the Event Channel, so it can determine the
+ // number of priority dispatch queues to create.
+
+// = Access the number of tasks.
+ACE_INLINE u_int
+ACE_DynScheduler::tasks () const
+{
+ return tasks_;
+}
+
+ // = Access the number of threads.
+ACE_INLINE u_int
+ACE_DynScheduler::threads () const
+{
+ return threads_;
+}
+
+ // = Access the current scheduler status.
+ACE_INLINE ACE_DynScheduler::status_t
+ACE_DynScheduler::status () const
+{
+ return status_;
+}
+
+ // = Access the current output (debugging) level.
+ACE_INLINE u_int
+ACE_DynScheduler::output_level () const {
+ return output_level_;
+}
+ // Default is 0; set to 1 to print out schedule, by task. Set
+ // to higher than one for debugging info.
+
+ // = Set the scheduler output (debugging) level.
+ACE_INLINE void
+ACE_DynScheduler::output_level (const u_int level)
+{
+ output_level_ = level;
+}
+ // the only supported levels are 0 (quiet), 1 (verbose) and 2
+ // (debug)
+
+ACE_INLINE void
+ACE_DynScheduler::minimum_priority_queue (const Preemption_Priority minimum_priority_queue_number)
+{
+ minimum_priority_queue_ = minimum_priority_queue_number;
+}
+
+ // = Set the number of tasks.
+ACE_INLINE void
+ACE_DynScheduler::tasks (const u_int tasks)
+{
+ tasks_ = tasks;
+}
+
+ // = Set the number of threads.
+// TBD - remove this - allowing the application to modify this is *not* good
+ACE_INLINE void
+ACE_DynScheduler::threads (const u_int threads)
+{
+ threads_ = threads;
+}
+
+ // = Set the current scheduler status.
+ACE_INLINE void
+ACE_DynScheduler::status (const status_t new_status)
+{
+ status_ = new_status;
+}
+
+ACE_INLINE u_long
+ACE_DynScheduler::min_dispatch_id () const
+{
+ return min_dispatch_id_;
+}
+
+ACE_INLINE u_long
+ACE_DynScheduler::max_dispatch_id () const
+{
+ return max_dispatch_id_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils.cpp b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils.cpp
new file mode 100644
index 00000000000..f3669c611c5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils.cpp
@@ -0,0 +1,1808 @@
+// ============================================================================
+//
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Reconfig_Sched_Utils.cpp
+//
+// = AUTHOR
+// Chris Gill <cdgill@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_RECONFIG_SCHED_UTILS_C
+#define TAO_RECONFIG_SCHED_UTILS_C
+
+#include "orbsvcs/Sched/Reconfig_Sched_Utils_T.h"
+#include "orbsvcs/Sched/Reconfig_Sched_Utils.h"
+
+
+#include "orbsvcs/Time_Utilities.h"
+
+
+ACE_RCSID (Sched, Reconfig_Sched_Utils, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+///////////////////////////
+// struct TAO_RT_Info_Ex //
+///////////////////////////
+
+// Default Constructor.
+
+TAO_RT_Info_Ex::TAO_RT_Info_Ex ()
+{
+ // Note: the entry_point string takes care of itself.
+ handle = 0;
+ criticality = RtecScheduler::VERY_LOW_CRITICALITY;
+ worst_case_execution_time = 0;
+ typical_execution_time = 0;
+ cached_execution_time = 0;
+ period = 0;
+ importance = RtecScheduler::VERY_LOW_IMPORTANCE;
+ quantum = 0;
+ threads = 0;
+ info_type = RtecScheduler::OPERATION;
+ priority = 0;
+ preemption_subpriority = 0;
+ preemption_priority = 0;
+ enabled = RtecScheduler::RT_INFO_ENABLED;
+ volatile_token = 0;
+}
+
+
+// Constructor from an RT_Info
+// (Also serves as a copy constructor)
+
+TAO_RT_Info_Ex::TAO_RT_Info_Ex (const RtecScheduler::RT_Info &info)
+{
+ this->entry_point = info.entry_point;
+ this->handle = info.handle;
+ this->criticality = info.criticality;
+ this->worst_case_execution_time = info.worst_case_execution_time;
+ this->typical_execution_time = info.typical_execution_time;
+ this->cached_execution_time = info.cached_execution_time;
+ this->period = info.period;
+ this->importance = info.importance;
+ this->quantum = info.quantum;
+ this->threads = info.threads;
+ this->info_type = info.info_type;
+ this->priority = info.priority;
+ this->preemption_subpriority = info.preemption_subpriority;
+ this->preemption_priority = info.preemption_priority;
+ this->enabled = info.enabled; // TODO- rethink?
+ this->volatile_token = info.volatile_token;
+}
+
+
+// Destructor.
+TAO_RT_Info_Ex::~TAO_RT_Info_Ex ()
+{
+}
+
+
+// Assignment operator with an RT_Info on the RHS.
+
+void
+TAO_RT_Info_Ex::operator = (const RtecScheduler::RT_Info &info)
+{
+ // IMPORTANT: we don't copy the name or the handle or the output
+ // attributes or the volatile token (entry pointer) or the valid
+ // flag. These can only be copied in the copy ctor at
+ // initialization.
+
+ criticality = info.criticality;
+ worst_case_execution_time = info.worst_case_execution_time;
+ typical_execution_time = info.typical_execution_time;
+ cached_execution_time = info.cached_execution_time;
+ period = info.period;
+ importance = info.importance;
+ quantum = info.quantum;
+ threads = info.threads;
+ info_type = info.info_type;
+ enabled = info.enabled;
+}
+
+
+// Resets all data members to initial (invalid) values, and removes
+// tuples corresponding to the reset flags.
+
+void
+TAO_RT_Info_Ex::reset (u_long reset_flags)
+{
+ // IMPORTANT: among the input arguments, we only reset the period ...
+ // TBD - if execution times etc. can be selected as well, then reset those, e.g.,
+ //
+ // criticality = RtecScheduler::VERY_LOW_CRITICALITY;
+ // worst_case_execution_time = 0;
+ // typical_execution_time = 0;
+ // cached_execution_time = 0;
+ // importance = RtecScheduler::VERY_LOW_IMPORTANCE;
+ // quantum = 0;
+ // threads = 0;
+ // info_type = RtecScheduler::OPERATION;
+
+ period = 0;
+
+ // ... However, we do reset the output attributes ...
+
+ priority = 0;
+ preemption_subpriority = 0;
+ preemption_priority = 0;
+
+ // ... and the appropriate tuples associated with the entry.
+ TAO_Reconfig_Scheduler_Entry * entry_ptr =
+ ACE_LONGLONG_TO_PTR (TAO_Reconfig_Scheduler_Entry *,
+ volatile_token);
+
+ //ACE_DEBUG((LM_DEBUG, "Removing Entries for RT_Info: %d, entry_ptr: %x\n", handle, entry_ptr));
+ if (entry_ptr)
+ {
+ entry_ptr->remove_tuples (reset_flags);
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR, "Pointer to associated entry is zero."));
+ }
+}
+
+void
+TAO_RT_Info_Ex::enabled_state (RtecScheduler::RT_Info_Enabled_Type_t enabled_in)
+{
+ TAO_Reconfig_Scheduler_Entry * entry_ptr =
+ ACE_LONGLONG_TO_PTR (TAO_Reconfig_Scheduler_Entry *,
+ volatile_token);
+ if (entry_ptr)
+ {
+ this->enabled = enabled_in;
+ entry_ptr->enabled_state (enabled_in);
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR, "Pointer to associated entry is zero."));
+ }
+}
+
+RtecScheduler::RT_Info_Enabled_Type_t
+TAO_RT_Info_Ex::enabled_state ()
+{
+ return this->enabled;
+}
+
+
+
+//////////////////////////////
+// struct TAO_RT_Info_Tuple //
+//////////////////////////////
+
+// Default Constructor.
+TAO_RT_Info_Tuple::TAO_RT_Info_Tuple ()
+ : rate_index (0)
+{
+}
+
+
+// Constructor from an RT_Info.
+// (Also serves as a copy constructor)
+
+TAO_RT_Info_Tuple::TAO_RT_Info_Tuple (const RtecScheduler::RT_Info &info)
+ : TAO_RT_Info_Ex (info),
+ rate_index (0)
+{
+}
+
+// Destructor.
+
+TAO_RT_Info_Tuple::~TAO_RT_Info_Tuple ()
+{
+}
+
+
+// Assignment operator with an RT_Info on the RHS.
+
+void
+TAO_RT_Info_Tuple::operator = (const RtecScheduler::RT_Info &info)
+{
+ static_cast<TAO_RT_Info_Ex> (*this) = info;
+}
+
+
+// Less-than comparison operator: orders tuples by ascending rate (descending period).
+
+bool
+TAO_RT_Info_Tuple::operator < (const TAO_RT_Info_Tuple &t)
+{
+ return (this->period > t.period) ? true : false;
+}
+
+
+////////////////////////////////////////
+// class TAO_Reconfig_Scheduler_Entry //
+////////////////////////////////////////
+
+// Constructor.
+
+TAO_Reconfig_Scheduler_Entry::
+TAO_Reconfig_Scheduler_Entry (TAO_RT_Info_Ex &rt_info)
+ : actual_rt_info_ (&rt_info),
+ fwd_dfs_status_ (NOT_VISITED),
+ rev_dfs_status_ (NOT_VISITED),
+ fwd_discovered_ (-1),
+ rev_discovered_ (-1),
+ fwd_finished_ (-1),
+ rev_finished_ (-1),
+ is_thread_delineator_ (0),
+ has_unresolved_remote_dependencies_ (0),
+ has_unresolved_local_dependencies_ (0),
+ aggregate_exec_time_ (0),
+ orig_tuple_period_sum_ (0),
+ prop_tuple_period_sum_ (0),
+ orig_tuple_count_ (0),
+ prop_tuple_count_ (0),
+ current_admitted_tuple_ (0),
+ enabled_ (rt_info.enabled)
+ // effective_exec_multiplier_ (0), //WSOA merge commented out
+ // effective_period_ (0) //WSOA merge commented out
+{
+ // Store the RT_Info fields.
+ this->orig_rt_info_data (*actual_rt_info_);
+}
+
+// Constructor.
+
+TAO_Reconfig_Scheduler_Entry::
+~TAO_Reconfig_Scheduler_Entry ()
+{
+ this->remove_tuples (ORIGINAL | PROPAGATED);
+}
+
+
+// Removes all tuples from the entry.
+
+void
+TAO_Reconfig_Scheduler_Entry::
+remove_tuples (u_long tuple_flags)
+{
+ TAO_RT_Info_Tuple **tuple_ptr_ptr;
+
+ if (tuple_flags & ORIGINAL)
+ {
+ TUPLE_SET_ITERATOR orig_tuple_iter (this->orig_tuple_subset_);
+
+ while (orig_tuple_iter.done () == 0)
+ {
+ if (orig_tuple_iter.next (tuple_ptr_ptr) == 0
+ || tuple_ptr_ptr == 0 || *tuple_ptr_ptr == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Failed to access tuple under iterator"));
+ return;
+ }
+
+ delete (*tuple_ptr_ptr);
+
+ orig_tuple_iter.advance ();
+ }
+
+ this->orig_tuple_subset_.reset ();
+ }
+
+ // If either the originals or the propagated tuple pointers are to
+ // be removed, we have to get rid of the propagated pointers lest
+ // they become handles to access violations after the original
+ // tuples are destroyed.
+ if (tuple_flags & PROPAGATED
+ || tuple_flags & ORIGINAL)
+ {
+ this->prop_tuple_subset_.reset ();
+ }
+}
+
+
+// Adds a new tuple to the entry and updates the
+// rate indices and mean rate for the tuples.
+
+int
+TAO_Reconfig_Scheduler_Entry::
+insert_tuple (TAO_RT_Info_Tuple &tuple,
+ Tuple_Type tuple_type,
+ int replace)
+{
+ // Choose the appropriate tuple subset.
+ TUPLE_SET *set_ptr = (tuple_type == ORIGINAL) ? & orig_tuple_subset_ : & prop_tuple_subset_;
+
+ // Recompute rate indices.
+
+ tuple.rate_index = 0;
+ TAO_RT_Info_Tuple **tuple_ptr_ptr;
+
+ TUPLE_SET_ITERATOR tuple_iter (*set_ptr);
+
+ while (tuple_iter.done () == 0)
+ {
+ // Get a pointer to the tuple under the iterator.
+ if (tuple_iter.next (tuple_ptr_ptr) == 0
+ || tuple_ptr_ptr == 0 || *tuple_ptr_ptr == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Failed to access tuple under iterator"), -1);
+ }
+
+ // Update existing tuples
+ if ((*tuple_ptr_ptr)->period > tuple.period)
+ {
+ // Move the tuple's rate index higher than any in the set
+ // with lower rates.
+ ++tuple.rate_index;
+ }
+ else if (replace && (*tuple_ptr_ptr)->period == tuple.period)
+ {
+ // If the replace flag is set, and there is already a tuple
+ // with the same rate in the set, just update that tuple and
+ // return.
+ **tuple_ptr_ptr = tuple;
+ return 1;
+ }
+ else
+ {
+ // Otherwise, just update the rate index of the subsequent
+ // tuples, which have the same or higher rates.
+ ++(*tuple_ptr_ptr)->rate_index;
+ }
+
+ tuple_iter.advance ();
+ }
+
+ // Update aggregate rate data, insert the tuple
+ if (tuple_type == ORIGINAL)
+ {
+ this->orig_tuple_period_sum_ += tuple.period;
+ ++this->orig_tuple_count_;
+ return (this->orig_tuple_subset_.insert (&tuple) < 0) ? -1 : 0;
+ }
+ else
+ {
+ this->prop_tuple_period_sum_ += tuple.period;
+ ++this->prop_tuple_count_;
+ return (this->prop_tuple_subset_.insert (&tuple) < 0) ? -1 : 0;
+ }
+}
+
+
+// Updates a matching tuple.
+
+int
+TAO_Reconfig_Scheduler_Entry::
+update_tuple (TAO_RT_Info_Ex &info,
+ Tuple_Type tuple_type)
+{
+ // Choose the appropriate tuple subset.
+ TUPLE_SET *set_ptr = (tuple_type == ORIGINAL) ? & orig_tuple_subset_ : & prop_tuple_subset_;
+
+ // Find and update the first matching tuple, if any.
+
+ TAO_RT_Info_Tuple **tuple_ptr_ptr;
+ TUPLE_SET_ITERATOR tuple_iter (*set_ptr);
+
+ while (tuple_iter.done () == 0)
+ {
+ // Get a pointer to the tuple under the iterator.
+ if (tuple_iter.next (tuple_ptr_ptr) == 0
+ || tuple_ptr_ptr == 0 || *tuple_ptr_ptr == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Failed to access tuple under iterator"), -1);
+ }
+ else if ((*tuple_ptr_ptr)->period < info.period)
+ {
+ // If we've hit a tuple with a shorter period (higher rate),
+ // then we're done.
+ break;
+ }
+ else if ((*tuple_ptr_ptr)->period == info.period)
+ {
+ // If the replace flag is set, and there is already a tuple
+ // with the same rate in the set, just update that tuple and
+ // return.
+ **tuple_ptr_ptr = info;
+ return 1;
+ }
+
+ tuple_iter.advance ();
+ }
+
+ return 0;
+}
+
+
+// Registers tuples into the passed tuple pointer array.
+int
+TAO_Reconfig_Scheduler_Entry::
+register_tuples (TAO_RT_Info_Tuple ** tuple_ptr_array,
+ long &tuple_count)
+{
+ // Iterate over the tuples, adding them to the pointer array.
+
+ TAO_RT_Info_Tuple **tuple_ptr_ptr;
+ TUPLE_SET_ITERATOR tuple_iter (orig_tuple_subset_);
+
+ while (tuple_iter.done () == 0)
+ {
+ // Get a pointer to the tuple under the iterator.
+ if (tuple_iter.next (tuple_ptr_ptr) == 0
+ || tuple_ptr_ptr == 0 || *tuple_ptr_ptr == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Failed to access tuple under iterator"), -1);
+ }
+ else
+ {
+ tuple_ptr_array [tuple_count] = *tuple_ptr_ptr;
+ ++tuple_count;
+ }
+
+ tuple_iter.advance ();
+ }
+
+ return 0;
+}
+
+
+
+
+// Accessor for original RT_Info data.
+
+TAO_RT_Info_Ex &
+TAO_Reconfig_Scheduler_Entry::orig_rt_info_data ()
+{
+ return orig_rt_info_data_;
+}
+
+
+// Mutator for stored original RT_Info data.
+
+void
+TAO_Reconfig_Scheduler_Entry::orig_rt_info_data (TAO_RT_Info_Ex &data)
+{
+ // Only store the information that can be updated by the public interface at run-time.
+ this->orig_rt_info_data_.worst_case_execution_time = data.worst_case_execution_time;
+ this->orig_rt_info_data_.typical_execution_time = data.typical_execution_time;
+ this->orig_rt_info_data_.cached_execution_time = data.cached_execution_time;
+ this->orig_rt_info_data_.period = data.period;
+ this->orig_rt_info_data_.criticality = data.criticality;
+ this->orig_rt_info_data_.importance = data.importance;
+ this->orig_rt_info_data_.quantum = data.quantum;
+ this->orig_rt_info_data_.threads = data.threads;
+ this->orig_rt_info_data_.info_type = data.info_type;
+ this->orig_rt_info_data_.enabled = data.enabled;
+}
+
+// Accessor for actual RT_Info pointer.
+
+TAO_RT_Info_Ex *
+TAO_Reconfig_Scheduler_Entry::
+actual_rt_info ()
+{
+ return this->actual_rt_info_;
+}
+
+
+// Mutator for actual RT_Info pointer.
+
+void
+TAO_Reconfig_Scheduler_Entry::
+actual_rt_info (TAO_RT_Info_Ex *rt_info)
+{
+ this->actual_rt_info_ = rt_info;
+}
+
+
+// Accessor for when the node was discovered in forward DFS traversal.
+
+long
+TAO_Reconfig_Scheduler_Entry::
+fwd_discovered () const
+{
+ return this->fwd_discovered_;
+}
+
+
+// Mutator for when the node was discovered in forward DFS traversal.
+
+void
+TAO_Reconfig_Scheduler_Entry::
+fwd_discovered (long l)
+{
+ this->fwd_discovered_ = l;
+}
+
+
+// Accessor for when the node was discovered in reverse DFS traversal.
+
+long
+TAO_Reconfig_Scheduler_Entry::
+rev_discovered () const
+{
+ return this->rev_discovered_;
+}
+
+
+// Mutator for when the node was discovered in reverse DFS traversal.
+
+void
+TAO_Reconfig_Scheduler_Entry::
+rev_discovered (long l)
+{
+ this->rev_discovered_ = l;
+}
+
+
+// Accessor for when the node was finished in forward DFS traversal.
+
+long
+TAO_Reconfig_Scheduler_Entry::
+fwd_finished () const
+{
+ return this->fwd_finished_;
+}
+
+
+// Mutator for when the node was finished in forward DFS traversal.
+
+void
+TAO_Reconfig_Scheduler_Entry::
+fwd_finished (long l)
+{
+ this->fwd_finished_ = l;
+}
+
+
+// Accessor for when the node was finished in reverse DFS traversal.
+
+long
+TAO_Reconfig_Scheduler_Entry::
+rev_finished () const
+{
+ return this->rev_finished_;
+}
+
+
+// Mutator for when the node was finished in reverse DFS traversal.
+
+void
+TAO_Reconfig_Scheduler_Entry::
+rev_finished (long l)
+{
+ this->rev_finished_ = l;
+}
+
+
+// Accessor for forward DFS traversal status of the node.
+
+TAO_Reconfig_Scheduler_Entry::DFS_Status
+TAO_Reconfig_Scheduler_Entry::
+fwd_dfs_status () const
+{
+ return this->fwd_dfs_status_;
+}
+
+
+// Mutator for forward DFS traversal status of the node.
+
+void
+TAO_Reconfig_Scheduler_Entry::
+fwd_dfs_status (TAO_Reconfig_Scheduler_Entry::DFS_Status ds)
+{
+ this->fwd_dfs_status_ = ds;
+}
+
+
+
+// Accessor for DFS traversal status of the node.
+
+TAO_Reconfig_Scheduler_Entry::DFS_Status
+TAO_Reconfig_Scheduler_Entry::
+rev_dfs_status () const
+{
+ return this->rev_dfs_status_;
+}
+
+
+// Mutator for DFS traversal status of the node.
+
+void
+TAO_Reconfig_Scheduler_Entry::
+rev_dfs_status (TAO_Reconfig_Scheduler_Entry::DFS_Status ds)
+{
+ this->rev_dfs_status_ = ds;
+}
+
+
+// Accessor for flag indicating whether node is a thread
+// delineator.
+
+int
+TAO_Reconfig_Scheduler_Entry::
+is_thread_delineator () const
+{
+ return this->is_thread_delineator_;
+}
+
+
+// Mutator for flag indicating whether node is a thread
+// delineator.
+
+void
+TAO_Reconfig_Scheduler_Entry::
+is_thread_delineator (int i)
+{
+ this->is_thread_delineator_ = i;
+}
+
+
+// Accessor for flag indicating whether node has unresolved remote
+// dependencies.
+
+int
+TAO_Reconfig_Scheduler_Entry::
+has_unresolved_remote_dependencies () const
+{
+ return this->has_unresolved_remote_dependencies_;
+}
+
+
+// Mutator for flag indicating whether node has unresolved remote
+// dependencies.
+
+void
+TAO_Reconfig_Scheduler_Entry::
+has_unresolved_remote_dependencies (int i)
+{
+ this->has_unresolved_remote_dependencies_ = i;
+}
+
+
+// Accessor for flag indicating whether node has unresolved local
+// dependencies.
+
+int
+TAO_Reconfig_Scheduler_Entry::
+has_unresolved_local_dependencies () const
+{
+ return this->has_unresolved_local_dependencies_;
+}
+
+
+// Mutator for flag indicating whether node has unresolved local
+// dependencies.
+
+void
+TAO_Reconfig_Scheduler_Entry::
+has_unresolved_local_dependencies (int i)
+{
+ this->has_unresolved_local_dependencies_ = i;
+}
+
+/* WSOA merge - commented out
+// Accessor for effective period of corresponding RT_Info.
+
+RtecScheduler::Period_t
+TAO_Reconfig_Scheduler_Entry::
+effective_period ()
+{
+ return this->effective_period_;
+}
+
+
+// Mutator for effective period of corresponding RT_Info.
+
+void
+TAO_Reconfig_Scheduler_Entry::
+effective_period (RtecScheduler::Period_t p)
+{
+ this->effective_period_ = p;
+}
+
+
+// Accessor for effective execution time of corresponding RT_Info.
+
+CORBA::Long
+TAO_Reconfig_Scheduler_Entry::
+effective_exec_multiplier ()
+{
+ return this->effective_exec_multiplier_;
+}
+
+
+// Mutator for effective execution time of corresponding RT_Info.
+
+void
+TAO_Reconfig_Scheduler_Entry::
+effective_exec_multiplier (CORBA::Long l)
+{
+ this->effective_exec_multiplier_ = l;
+}
+*/
+
+///////////////////////////
+
+TAO_Reconfig_Sched_Entry_Visitor::~TAO_Reconfig_Sched_Entry_Visitor (void)
+{
+}
+
+///////////////////////////
+// TAO_RSE_Reset_Visitor //
+///////////////////////////
+
+// Constructor.
+
+TAO_RSE_Reset_Visitor::TAO_RSE_Reset_Visitor ()
+{
+}
+
+
+// Resets the fields in the entry to pre-DFS traversal states.
+// Returns 0 on success and -1 on error.
+
+int
+TAO_RSE_Reset_Visitor::visit (TAO_Reconfig_Scheduler_Entry &rse)
+{
+ // Note that this value differs from what is set in the
+ // constructor for the entry. This is because the reset
+ // visitor is applied prior to a DFS traversal, in which callers
+ // *unset* the thread delineator status of any of their called
+ // operations that do not specify a period or threads.
+
+ if (rse.actual_rt_info ()->enabled != RtecScheduler::RT_INFO_NON_VOLATILE)
+ {
+ rse.is_thread_delineator (1);
+
+ // Only reset the period for entries that are not root nodes. Added by BRM.
+ if (rse.actual_rt_info ()->threads == 0)
+ {
+ rse.actual_rt_info ()->period = 0;
+ }
+ }
+
+ // Remove the propagated tuples in the entry.
+ rse.remove_tuples (TAO_Reconfig_Scheduler_Entry::PROPAGATED);
+
+ rse.fwd_dfs_status (TAO_Reconfig_Scheduler_Entry::NOT_VISITED);
+ rse.rev_dfs_status (TAO_Reconfig_Scheduler_Entry::NOT_VISITED);
+ rse.fwd_discovered (-1);
+ rse.rev_discovered (-1);
+ rse.fwd_finished (-1);
+ rse.rev_finished (-1);
+ rse.has_unresolved_remote_dependencies (0);
+ rse.has_unresolved_local_dependencies (0);
+ rse.aggregate_exec_time (rse.actual_rt_info ()->worst_case_execution_time);
+ rse.current_admitted_tuple (0);
+
+ //WSOA merge - commented out
+ // These settings are used for a conservative but
+ // efficient approach to estimating utilization:
+ // for an exact algorithm using frame merging,
+ // other initial settings might be needed.
+ //rse.effective_exec_multiplier (0);
+ //rse.effective_period (0);
+
+ return 0;
+}
+
+
+// Accessor for effective execution time of corresponding RT_Info.
+
+RtecScheduler::Time
+TAO_Reconfig_Scheduler_Entry::
+aggregate_exec_time ()
+{
+ return this->aggregate_exec_time_;
+}
+
+
+// Mutator for effective execution time of corresponding RT_Info.
+
+void
+TAO_Reconfig_Scheduler_Entry::
+aggregate_exec_time (RtecScheduler::Time t)
+{
+ this->aggregate_exec_time_ = t;
+}
+
+// Accessor for the sum of periods for tuples directly associated
+// with the entry.
+RtecScheduler::Period_t
+TAO_Reconfig_Scheduler_Entry::
+orig_tuple_period_sum ()
+{
+ return orig_tuple_period_sum_;
+}
+
+
+// Mutator for the sum of periods for tuples directly associated
+// with the entry.
+void
+TAO_Reconfig_Scheduler_Entry::
+orig_tuple_period_sum (RtecScheduler::Period_t p)
+{
+ orig_tuple_period_sum_ = p;
+}
+
+
+// Accessor for the sum of periods for tuples propagated via
+// dependencies on other entries.
+RtecScheduler::Period_t
+TAO_Reconfig_Scheduler_Entry::
+prop_tuple_period_sum ()
+{
+ return prop_tuple_period_sum_;
+}
+
+
+// Mutator for the sum of periods for tuples propagated via
+// dependencies on other entries.
+void
+TAO_Reconfig_Scheduler_Entry::
+prop_tuple_period_sum (RtecScheduler::Period_t p)
+{
+ prop_tuple_period_sum_ = p;
+}
+
+
+// Accessor for the number of tuples directly associated with the
+// entry.
+u_int
+TAO_Reconfig_Scheduler_Entry::
+orig_tuple_count ()
+{
+ return orig_tuple_count_;
+}
+
+
+// Mutator for the number of tuples directly associated with the
+// entry.
+void
+TAO_Reconfig_Scheduler_Entry::
+orig_tuple_count (u_int c)
+{
+ orig_tuple_count_ = c;
+}
+
+
+// Accessor for the number of tuples propagated via dependencies on
+// other entries.
+u_int
+TAO_Reconfig_Scheduler_Entry::
+prop_tuple_count ()
+{
+ return prop_tuple_count_;
+}
+
+
+// Mutator for the number of tuples propagated via dependencies on
+// other entries.
+void
+TAO_Reconfig_Scheduler_Entry::
+prop_tuple_count (u_int c)
+{
+ prop_tuple_count_ = c;
+}
+
+
+// Accessor for the set of tuples directly associated with the
+// entry.
+TUPLE_SET &
+TAO_Reconfig_Scheduler_Entry::
+orig_tuple_subset ()
+{
+ return orig_tuple_subset_;
+}
+
+
+// Accessor for the set of tuples propagated via dependencies on
+// other entries.
+TUPLE_SET &
+TAO_Reconfig_Scheduler_Entry::
+prop_tuple_subset ()
+{
+ return prop_tuple_subset_;
+}
+
+
+TAO_RT_Info_Tuple *
+TAO_Reconfig_Scheduler_Entry::
+current_admitted_tuple ()
+{
+ return current_admitted_tuple_;
+}
+
+
+void
+TAO_Reconfig_Scheduler_Entry::
+current_admitted_tuple (TAO_RT_Info_Tuple * t)
+{
+ current_admitted_tuple_ = t;
+}
+
+// Accessor for flag indicating whether or not node is enabled.
+
+RtecScheduler::RT_Info_Enabled_Type_t
+TAO_Reconfig_Scheduler_Entry::
+enabled_state () const
+{
+ return this->enabled_;
+}
+
+
+// Mutator for flag indicating whether or not node is enabled.
+
+void
+TAO_Reconfig_Scheduler_Entry::
+enabled_state (RtecScheduler::RT_Info_Enabled_Type_t et)
+{
+ this->enabled_ = et;
+}
+
+
+////////////////////////////////////////////
+
+TAO_RT_Info_Tuple_Visitor::~TAO_RT_Info_Tuple_Visitor (void)
+{
+}
+
+////////////////////////////////////////////
+// class TAO_Reconfig_Sched_Strategy_Base //
+////////////////////////////////////////////
+
+
+// Ordering function to compare the DFS finish times of
+// two RT_Info_Tuples
+int
+TAO_Reconfig_Sched_Strategy_Base::comp_tuple_finish_times (const void *first, const void *second)
+{
+ // Convert the passed pointers: the double cast is needed to
+ // make Sun C++ 4.2 happy.
+ TAO_RT_Info_Tuple **first_tuple =
+ reinterpret_cast<TAO_RT_Info_Tuple **> (const_cast<void *> (first));
+
+ //volatile_token is a TAO_Reconfig_Scheduler_Entry*, but we need to treat it as a void*
+ void * first_entry = ACE_LONGLONG_TO_PTR (void *,
+ (*first_tuple)->volatile_token);
+
+ TAO_RT_Info_Tuple **second_tuple =
+ reinterpret_cast<TAO_RT_Info_Tuple **> (const_cast<void *> (second));
+
+ //volatile_token is a TAO_Reconfig_Scheduler_Entry*, but we need to treat it as a void*
+ void * second_entry = ACE_LONGLONG_TO_PTR (TAO_Reconfig_Scheduler_Entry *,
+ (*second_tuple)->volatile_token);
+
+ return TAO_Reconfig_Sched_Strategy_Base::comp_entry_finish_times(first_entry,second_entry);
+}
+
+// Ordering function to compare the DFS finish times of
+// two task entries, so qsort orders these in topological
+// order, with the higher times *first*
+int
+TAO_Reconfig_Sched_Strategy_Base::comp_entry_finish_times (const void *first, const void *second)
+{
+ const TAO_Reconfig_Scheduler_Entry *first_entry =
+ * reinterpret_cast<const TAO_Reconfig_Scheduler_Entry *const *> (first);
+
+ const TAO_Reconfig_Scheduler_Entry *second_entry =
+ * reinterpret_cast<const TAO_Reconfig_Scheduler_Entry *const *> (second);
+
+ // sort blank entries to the end
+ if (! first_entry)
+ {
+ return (second_entry) ? 1 : 0;
+ }
+ else if (! second_entry)
+ {
+ return -1;
+ }
+
+ // sort disabled entries to the end
+ if (first_entry->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return (second_entry->enabled_state () == RtecScheduler::RT_INFO_DISABLED) ? 0 : 1;
+ }
+ else if (second_entry->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return -1;
+ }
+
+ // Sort entries with higher forward DFS finishing times before those
+ // with lower forward DFS finishing times.
+ if (first_entry->fwd_finished () >
+ second_entry->fwd_finished ())
+ {
+ return -1;
+ }
+ else if (first_entry->fwd_finished () <
+ second_entry->fwd_finished ())
+ {
+ return 1;
+ }
+
+ return 0;
+}
+
+// Determines whether or not an entry is critical, based on operation characteristics.
+// returns 1 if critical, 0 if not
+
+int
+TAO_Reconfig_Sched_Strategy_Base::is_critical (TAO_Reconfig_Scheduler_Entry &rse)
+{
+ // Look at the underlying RT_Info's criticality field.
+ return (rse.actual_rt_info ()->criticality == RtecScheduler::HIGH_CRITICALITY ||
+ rse.actual_rt_info ()->criticality == RtecScheduler::VERY_HIGH_CRITICALITY)
+ ? 1 : 0;
+}
+
+// Determines whether or not a tuple is critical, based on operation
+// characteristics. returns 1 if critical, 0 if not
+
+int
+TAO_Reconfig_Sched_Strategy_Base::is_critical (TAO_RT_Info_Tuple &t)
+{
+ // Look at the underlying RT_Info's criticality field.
+ return (t.criticality == RtecScheduler::HIGH_CRITICALITY ||
+ t.criticality == RtecScheduler::VERY_HIGH_CRITICALITY)
+ ? 1 : 0;
+}
+
+
+// Compares two entries by subpriority alone. Returns -1 if the first
+// one is higher, 0 if they're the same, and 1 if the second one is
+// higher.
+
+int
+TAO_Reconfig_Sched_Strategy_Base::compare_subpriority (TAO_Reconfig_Scheduler_Entry &lhs,
+ TAO_Reconfig_Scheduler_Entry &rhs)
+{
+ // First, compare importance.
+
+ if (lhs.actual_rt_info ()->importance > rhs.actual_rt_info ()->importance)
+ {
+ return -1;
+ }
+ else if (lhs.actual_rt_info ()->importance < rhs.actual_rt_info ()->importance)
+ {
+ return 1;
+ }
+
+ // Same importance, so look at dfs finish time as a tiebreaker.
+
+ else if (lhs.fwd_finished () > rhs.fwd_finished ())
+ {
+ return -1;
+ }
+ else if (lhs.fwd_finished () < rhs.fwd_finished ())
+ {
+ return 1;
+ }
+
+ // Same dfs finish time, so look at handle as a tiebreaker.
+
+ else if (lhs.actual_rt_info ()->handle > rhs.actual_rt_info ()->handle)
+ {
+ return -1;
+ }
+ else if (lhs.actual_rt_info ()->handle < rhs.actual_rt_info ()->handle)
+ {
+ return 1;
+ }
+
+ // They're the same if we got here.
+ return 0;
+}
+
+
+////////////////////////////////////////////////
+// class TAO_MUF_FAIR_Reconfig_Sched_Strategy //
+////////////////////////////////////////////////
+
+// Ordering function used to qsort an array of TAO_RT_Info_Tuple
+// pointers into a total <priority, subpriority> ordering. Returns -1
+// if the first one is higher, 0 if they're the same, and 1 if the
+// second one is higher.
+
+int
+TAO_MUF_FAIR_Reconfig_Sched_Strategy::total_priority_comp (const void *s, const void *t)
+{
+ // Convert the passed pointers: the double cast is needed to
+ // make Sun C++ 4.2 happy.
+ TAO_Reconfig_Scheduler_Entry **first =
+ reinterpret_cast<TAO_Reconfig_Scheduler_Entry **> (const_cast<void *> (s));
+ TAO_Reconfig_Scheduler_Entry **second =
+ reinterpret_cast<TAO_Reconfig_Scheduler_Entry **> (const_cast<void *> (t));
+
+ // Check the converted pointers.
+ if (first == 0 || *first == 0)
+ {
+ return (second == 0 || *second == 0) ? 0 : 1;
+ }
+ else if (second == 0 || *second == 0)
+ {
+ return -1;
+ }
+
+ // sort disabled entries to the end
+ if ((*first)->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return ((*second)->enabled_state () == RtecScheduler::RT_INFO_DISABLED) ? 0 : 1;
+ }
+ else if ((*second)->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return -1;
+ }
+
+ int result =
+ TAO_MUF_FAIR_Reconfig_Sched_Strategy::compare_priority (**first,
+ **second);
+
+ // Check whether they were distinguished by priority.
+ if (result == 0)
+ {
+ return TAO_Reconfig_Sched_Strategy_Base::compare_subpriority (**first,
+ **second);
+ }
+ else
+ {
+ return result;
+ }
+}
+
+
+// Ordering function used to qsort an array of RT_Info_Tuple
+// pointers into a total ordering for admission control. Returns
+// -1 if the first one is higher, 0 if they're the same, and 1 if
+// the second one is higher.
+
+int
+TAO_MUF_FAIR_Reconfig_Sched_Strategy::total_admission_comp (const void *s,
+ const void *t)
+{
+ // Convert the passed pointers: the double cast is needed to
+ // make Sun C++ 4.2 happy.
+ TAO_RT_Info_Tuple **first =
+ reinterpret_cast<TAO_RT_Info_Tuple **> (const_cast<void *> (s));
+
+ TAO_Reconfig_Scheduler_Entry * first_entry =
+ ACE_LONGLONG_TO_PTR (TAO_Reconfig_Scheduler_Entry *,
+ (*first)->volatile_token);
+
+ TAO_RT_Info_Tuple **second =
+ reinterpret_cast<TAO_RT_Info_Tuple **> (const_cast<void *> (t));
+
+ TAO_Reconfig_Scheduler_Entry * second_entry =
+ ACE_LONGLONG_TO_PTR (TAO_Reconfig_Scheduler_Entry *,
+ (*second)->volatile_token);
+
+ // Check the converted pointers.
+ if (first == 0 || *first == 0)
+ {
+ return (second == 0 || *second == 0) ? 0 : 1;
+ }
+ else if (second == 0 || *second == 0)
+ {
+ return -1;
+ }
+
+ // sort disabled tuples to the end
+ if ((*first)->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return ((*second)->enabled_state () == RtecScheduler::RT_INFO_DISABLED) ? 0 : 1;
+ }
+ else if ((*second)->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return -1;
+ }
+
+ // First, compare according to rate index.
+
+ if ((*first)->rate_index < (*second)->rate_index)
+ {
+ return -1;
+ }
+ else if ((*second)->rate_index < (*first)->rate_index)
+ {
+ return 1;
+ }
+
+ // Then compare by priority.
+
+ int result =
+ TAO_MUF_FAIR_Reconfig_Sched_Strategy::compare_priority (**first, **second);
+ if (result != 0)
+ {
+ return result;
+ }
+
+ // Then compare by subpriority.
+
+ result = TAO_Reconfig_Sched_Strategy_Base::compare_subpriority (*first_entry,
+ *second_entry);
+ if (result != 0)
+ {
+ return result;
+ }
+
+ return 0;
+}
+
+
+
+// Compares two RT_Info entries by priority alone. Returns -1 if the
+// first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+int
+TAO_MUF_FAIR_Reconfig_Sched_Strategy::compare_priority (TAO_Reconfig_Scheduler_Entry &lhs,
+ TAO_Reconfig_Scheduler_Entry &rhs)
+{
+ // In MUF, priority is per criticality level: compare criticalities.
+ if (lhs.actual_rt_info ()->criticality >
+ rhs.actual_rt_info ()->criticality)
+ {
+ return -1;
+ }
+ else if (lhs.actual_rt_info ()->criticality <
+ rhs.actual_rt_info ()->criticality)
+ {
+ return 1;
+ }
+
+ // They're the same if we got here.
+ return 0;
+}
+
+
+// Compares two RT_Info tuples by priority alone. Returns -1 if the
+// first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+int
+TAO_MUF_FAIR_Reconfig_Sched_Strategy::compare_priority (TAO_RT_Info_Tuple &lhs,
+ TAO_RT_Info_Tuple &rhs)
+{
+ // In MUF, priority is per criticality level: compare criticalities.
+ if (lhs.criticality > rhs.criticality)
+ {
+ return -1;
+ }
+ else if (lhs.criticality < rhs.criticality)
+ {
+ return 1;
+ }
+
+ // They're the same if we got here.
+ return 0;
+}
+
+
+// Fills in a static dispatch configuration for a priority level, based
+// on the operation characteristics of a representative scheduling entry.
+
+int
+TAO_MUF_FAIR_Reconfig_Sched_Strategy::assign_config (RtecScheduler::Config_Info &info,
+ TAO_Reconfig_Scheduler_Entry &rse)
+{
+ // Global and thread priority of dispatching queue are simply
+ // those assigned the representative operation it will dispatch.
+ info.preemption_priority = rse.actual_rt_info ()->preemption_priority;
+ info.thread_priority = rse.actual_rt_info ()->priority;
+
+ // Dispatching queues are all laxity-based in this strategy.
+ info.dispatching_type = RtecScheduler::LAXITY_DISPATCHING;
+
+ return 0;
+}
+
+///////////////////////////////////////////////////
+// class TAO_RMS_FAIR_Reconfig_Sched_Strategy //
+///////////////////////////////////////////////////
+
+
+// Ordering function used to qsort an array of TAO_RT_Info_Tuple
+// pointers into a total <priority, subpriority> ordering. Returns -1
+// if the first one is higher, 0 if they're the same, and 1 if the
+// second one is higher.
+
+int
+TAO_RMS_FAIR_Reconfig_Sched_Strategy::total_priority_comp (const void *s, const void *t)
+{
+ // Convert the passed pointers: the double cast is needed to
+ // make Sun C++ 4.2 happy.
+ TAO_Reconfig_Scheduler_Entry **first =
+ reinterpret_cast<TAO_Reconfig_Scheduler_Entry **> (const_cast<void *> (s));
+ TAO_Reconfig_Scheduler_Entry **second =
+ reinterpret_cast<TAO_Reconfig_Scheduler_Entry **> (const_cast<void *> (t));
+
+ // Check the converted pointers.
+ if (first == 0 || *first == 0)
+ {
+ return (second == 0 || *second == 0) ? 0 : 1;
+ }
+ else if (second == 0 || *second == 0)
+ {
+ return -1;
+ }
+
+ // sort disabled entries to the end
+ if ((*first)->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return ((*second)->enabled_state () == RtecScheduler::RT_INFO_DISABLED) ? 0 : 1;
+ }
+ else if ((*second)->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return -1;
+ }
+
+
+ // Check whether they are distinguished by priority, and if not,
+ // then by subpriority.
+
+ int result =
+ TAO_RMS_FAIR_Reconfig_Sched_Strategy::compare_priority (**first,
+ **second);
+
+ if (result == 0)
+ {
+ return TAO_Reconfig_Sched_Strategy_Base::compare_subpriority (**first,
+ **second);
+ }
+ else
+ {
+ return result;
+ }
+}
+
+
+// Ordering function used to qsort an array of RT_Info_Tuple
+// pointers into a total ordering for admission control. Returns
+// -1 if the first one is higher, 0 if they're the same, and 1 if
+// the second one is higher.
+
+int
+TAO_RMS_FAIR_Reconfig_Sched_Strategy::total_admission_comp (const void *s,
+ const void *t)
+{
+ // Convert the passed pointers: the double cast is needed to
+ // make Sun C++ 4.2 happy.
+ TAO_RT_Info_Tuple **first =
+ reinterpret_cast<TAO_RT_Info_Tuple **> (const_cast<void *> (s));
+
+ TAO_Reconfig_Scheduler_Entry * first_entry =
+ ACE_LONGLONG_TO_PTR (TAO_Reconfig_Scheduler_Entry *,
+ (*first)->volatile_token);
+
+ TAO_RT_Info_Tuple **second =
+ reinterpret_cast<TAO_RT_Info_Tuple **> (const_cast<void *> (t));
+
+ TAO_Reconfig_Scheduler_Entry * second_entry =
+ ACE_LONGLONG_TO_PTR (TAO_Reconfig_Scheduler_Entry *,
+ (*second)->volatile_token);
+
+ // Check the converted pointers.
+ if (first == 0 || *first == 0)
+ {
+ return (second == 0 || *second == 0) ? 0 : 1;
+ }
+ else if (second == 0 || *second == 0)
+ {
+ return -1;
+ }
+
+ // sort disabled tuples to the end
+ if ((*first)->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return ((*second)->enabled_state () == RtecScheduler::RT_INFO_DISABLED) ? 0 : 1;
+ }
+ else if ((*second)->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return -1;
+ }
+
+ // First, compare by rate index.
+
+ if ((*first)->rate_index < (*second)->rate_index)
+ {
+ return -1;
+ }
+ else if ((*second)->rate_index < (*first)->rate_index)
+ {
+ return 1;
+ }
+
+ // Then compare by priority.
+
+ int result =
+ TAO_RMS_FAIR_Reconfig_Sched_Strategy::compare_criticality (**first,
+ **second);
+ if (result != 0)
+ {
+ return result;
+ }
+
+ // Then compare by subpriority.
+
+ result = TAO_Reconfig_Sched_Strategy_Base::compare_subpriority (*first_entry,
+ *second_entry);
+ if (result != 0)
+ {
+ return result;
+ }
+
+ return 0;
+}
+
+
+// Compares two RT_Info entries by criticality alone. Returns -1 if the
+// first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+int
+TAO_RMS_FAIR_Reconfig_Sched_Strategy::compare_criticality(TAO_Reconfig_Scheduler_Entry &lhs,
+ TAO_Reconfig_Scheduler_Entry &rhs)
+{
+ ACE_UNUSED_ARG (lhs);
+ ACE_UNUSED_ARG (rhs);
+ // In RMS_FAIR, no consideration of criticalities
+ return 0;
+}
+
+// Compares two RT_Info entries by criticality alone. Returns -1 if the
+// first one is higher, 0 if they're the same, and 1 if the second one is higher.
+int
+TAO_RMS_FAIR_Reconfig_Sched_Strategy::compare_criticality(TAO_RT_Info_Tuple &lhs,
+ TAO_RT_Info_Tuple &rhs)
+{
+ ACE_UNUSED_ARG (lhs);
+ ACE_UNUSED_ARG (rhs);
+ // In plain RMS, no consideration of criticalities
+ return 0;
+}
+
+// Compares two RT_Info entries by priority alone. Returns -1 if the
+// first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+int
+TAO_RMS_FAIR_Reconfig_Sched_Strategy::compare_priority (TAO_Reconfig_Scheduler_Entry &lhs,
+ TAO_Reconfig_Scheduler_Entry &rhs)
+{
+ //differentiate by rate.
+ if (lhs.actual_rt_info ()->period < rhs.actual_rt_info ()->period)
+ {
+ return -1;
+ }
+ else if (lhs.actual_rt_info ()->period > rhs.actual_rt_info ()->period)
+ {
+ return 1;
+ }
+
+ // They're the same if we got here.
+ return 0;
+}
+
+
+// Compares two RT_Info tuples by priority alone. Returns -1 if the
+// first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+int
+TAO_RMS_FAIR_Reconfig_Sched_Strategy::compare_priority (TAO_RT_Info_Tuple &lhs,
+ TAO_RT_Info_Tuple &rhs)
+{
+ // In RMS_FAIR, priority is partitioned based on rate:
+ if (lhs.period < rhs.period)
+ {
+ return -1;
+ }
+ else if (lhs.period > rhs.period)
+ {
+ return 1;
+ }
+
+ // They're the same if we got here.
+ return 0;
+}
+
+
+// Fills in a static dispatch configuration for a priority level, based
+// on the operation characteristics of a representative scheduling entry.
+
+int
+TAO_RMS_FAIR_Reconfig_Sched_Strategy::assign_config (RtecScheduler::Config_Info &info,
+ TAO_Reconfig_Scheduler_Entry &rse)
+{
+ // Global and thread priority of dispatching queue are simply
+ // those assigned the representative operation it will dispatch.
+ info.preemption_priority = rse.actual_rt_info ()->preemption_priority;
+ info.thread_priority = rse.actual_rt_info ()->priority;
+
+ // In RMS_FAIR, all queues are static
+ info.dispatching_type = RtecScheduler::STATIC_DISPATCHING;
+
+ return 0;
+}
+
+///////////////////////////////////////////////////
+// class TAO_RMS_MLF_Reconfig_Sched_Strategy //
+///////////////////////////////////////////////////
+
+
+// Ordering function used to qsort an array of TAO_RT_Info_Tuple
+// pointers into a total <priority, subpriority> ordering. Returns -1
+// if the first one is higher, 0 if they're the same, and 1 if the
+// second one is higher.
+
+int
+TAO_RMS_MLF_Reconfig_Sched_Strategy::total_priority_comp (const void *s, const void *t)
+{
+ // Convert the passed pointers: the double cast is needed to
+ // make Sun C++ 4.2 happy.
+ TAO_Reconfig_Scheduler_Entry **first =
+ reinterpret_cast<TAO_Reconfig_Scheduler_Entry **> (const_cast<void *> (s));
+ TAO_Reconfig_Scheduler_Entry **second =
+ reinterpret_cast<TAO_Reconfig_Scheduler_Entry **> (const_cast<void *> (t));
+
+ // Check the converted pointers.
+ if (first == 0 || *first == 0)
+ {
+ return (second == 0 || *second == 0) ? 0 : 1;
+ }
+ else if (second == 0 || *second == 0)
+ {
+ return -1;
+ }
+
+ // sort disabled entries to the end
+ if ((*first)->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return ((*second)->enabled_state () == RtecScheduler::RT_INFO_DISABLED) ? 0 : 1;
+ }
+ else if ((*second)->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return -1;
+ }
+
+
+ // Check whether they are distinguished by priority, and if not,
+ // then by subpriority.
+
+ int result =
+ TAO_RMS_MLF_Reconfig_Sched_Strategy::compare_priority (**first,
+ **second);
+
+ if (result == 0)
+ {
+ return TAO_Reconfig_Sched_Strategy_Base::compare_subpriority (**first,
+ **second);
+ }
+ else
+ {
+ return result;
+ }
+}
+
+
+// Ordering function used to qsort an array of RT_Info_Tuple
+// pointers into a total ordering for admission control. Returns
+// -1 if the first one is higher, 0 if they're the same, and 1 if
+// the second one is higher.
+
+int
+TAO_RMS_MLF_Reconfig_Sched_Strategy::total_admission_comp (const void *s,
+ const void *t)
+{
+ // Convert the passed pointers: the double cast is needed to
+ // make Sun C++ 4.2 happy.
+ TAO_RT_Info_Tuple **first =
+ reinterpret_cast<TAO_RT_Info_Tuple **> (const_cast<void *> (s));
+
+ TAO_Reconfig_Scheduler_Entry * first_entry =
+ ACE_LONGLONG_TO_PTR (TAO_Reconfig_Scheduler_Entry *,
+ (*first)->volatile_token);
+
+ TAO_RT_Info_Tuple **second =
+ reinterpret_cast<TAO_RT_Info_Tuple **> (const_cast<void *> (t));
+
+ TAO_Reconfig_Scheduler_Entry * second_entry =
+ ACE_LONGLONG_TO_PTR (TAO_Reconfig_Scheduler_Entry *,
+ (*second)->volatile_token);
+
+ // Check the converted pointers.
+ if (first == 0 || *first == 0)
+ {
+ return (second == 0 || *second == 0) ? 0 : 1;
+ }
+ else if (second == 0 || *second == 0)
+ {
+ return -1;
+ }
+
+ // sort disabled tuples to the end
+ if ((*first)->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return ((*second)->enabled_state () == RtecScheduler::RT_INFO_DISABLED) ? 0 : 1;
+ }
+ else if ((*second)->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return -1;
+ }
+
+ // First, compare by rate index.
+
+ if ((*first)->rate_index < (*second)->rate_index)
+ {
+ return -1;
+ }
+ else if ((*second)->rate_index < (*first)->rate_index)
+ {
+ return 1;
+ }
+
+ // Then compare by priority.
+
+ int result =
+ TAO_RMS_MLF_Reconfig_Sched_Strategy::compare_criticality (**first,
+ **second);
+ if (result != 0)
+ {
+ return result;
+ }
+
+ // Then compare by subpriority.
+
+ result = TAO_Reconfig_Sched_Strategy_Base::compare_subpriority (*first_entry,
+ *second_entry);
+ if (result != 0)
+ {
+ return result;
+ }
+
+ return 0;
+}
+
+
+// Compares two RT_Info entries by criticality alone. Returns -1 if the
+// first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+int
+TAO_RMS_MLF_Reconfig_Sched_Strategy::compare_criticality(TAO_Reconfig_Scheduler_Entry &lhs,
+ TAO_Reconfig_Scheduler_Entry &rhs)
+{
+ // In RMS+MLF, priority is per criticality level: compare criticalities.
+
+ if (lhs.actual_rt_info ()->criticality > rhs.actual_rt_info ()->criticality)
+ {
+ return -1;
+ }
+ else if (lhs.actual_rt_info ()->criticality < rhs.actual_rt_info ()->criticality)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+// Compares two RT_Info entries by criticality alone. Returns -1 if the
+// first one is higher, 0 if they're the same, and 1 if the second one is higher.
+int
+TAO_RMS_MLF_Reconfig_Sched_Strategy::compare_criticality(TAO_RT_Info_Tuple &lhs,
+ TAO_RT_Info_Tuple &rhs)
+{
+ if (lhs.criticality > rhs.criticality)
+ {
+ return -1;
+ }
+ else if (lhs.criticality < rhs.criticality)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+// Compares two RT_Info entries by priority alone. Returns -1 if the
+// first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+int
+TAO_RMS_MLF_Reconfig_Sched_Strategy::compare_priority (TAO_Reconfig_Scheduler_Entry &lhs,
+ TAO_Reconfig_Scheduler_Entry &rhs)
+{
+ // In RMS+MLF, priority is per criticality level: compare criticalities.
+ int result = TAO_RMS_MLF_Reconfig_Sched_Strategy::compare_criticality(lhs, rhs);
+
+ if (result != 0)
+ {
+ return result;
+ }
+
+ // Same criticality: if high criticality, differentiate by rate.
+ if (TAO_Reconfig_Sched_Strategy_Base::is_critical (rhs))
+ {
+ if (lhs.actual_rt_info ()->period < rhs.actual_rt_info ()->period)
+ {
+ return -1;
+ }
+ else if (lhs.actual_rt_info ()->period > rhs.actual_rt_info ()->period)
+ {
+ return 1;
+ }
+ }
+
+ // They're the same if we got here.
+ return 0;
+}
+
+
+// Compares two RT_Info tuples by priority alone. Returns -1 if the
+// first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+int
+TAO_RMS_MLF_Reconfig_Sched_Strategy::compare_priority (TAO_RT_Info_Tuple &lhs,
+ TAO_RT_Info_Tuple &rhs)
+{
+ // In RMS_Dyn, priority is first partitioned per criticality level:
+ // compare criticalities.
+
+ if (lhs.criticality > rhs.criticality)
+ {
+ return -1;
+ }
+ else if (lhs.criticality < rhs.criticality)
+ {
+ return 1;
+ }
+
+ // Same criticality: if high criticality, differentiate by rate.
+ else if (TAO_Reconfig_Sched_Strategy_Base::is_critical (rhs))
+ {
+ if (lhs.period < rhs.period)
+ {
+ return -1;
+ }
+ else if (lhs.period > rhs.period)
+ {
+ return 1;
+ }
+ }
+
+ // They're the same if we got here.
+ return 0;
+}
+
+// Fills in a static dispatch configuration for a priority level, based
+// on the operation characteristics of a representative scheduling entry.
+
+int
+TAO_RMS_MLF_Reconfig_Sched_Strategy::assign_config (RtecScheduler::Config_Info &info,
+ TAO_Reconfig_Scheduler_Entry &rse)
+{
+ // Global and thread priority of dispatching queue are simply
+ // those assigned the representative operation it will dispatch.
+ info.preemption_priority = rse.actual_rt_info ()->preemption_priority;
+ info.thread_priority = rse.actual_rt_info ()->priority;
+
+ // Critical queues are static, and non-critical ones are
+ // laxity-based in this strategy.
+ if (TAO_Reconfig_Sched_Strategy_Base::is_critical (rse))
+ {
+ info.dispatching_type = RtecScheduler::STATIC_DISPATCHING;
+ }
+ else
+ {
+ info.dispatching_type = RtecScheduler::LAXITY_DISPATCHING;
+ }
+
+ return 0;
+}
+
+
+#endif /* TAO_RECONFIG_SCHED_UTILS_C */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils.h b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils.h
new file mode 100644
index 00000000000..408d42bb56f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils.h
@@ -0,0 +1,669 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Reconfig_Scheduler_Utils.h
+//
+// = AUTHOR
+// Chris Gill <cdgill@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_RECONFIG_SCHED_UTILS_H
+#define TAO_RECONFIG_SCHED_UTILS_H
+#include /**/ "ace/pre.h"
+
+// Uncomment this to turn on some extra trace level debugging info,
+// comment it out to turn off that extra debugging info.
+//#define SCHEDULER_LOGGING
+
+#include "ace/config-all.h"
+
+#include "orbsvcs/Scheduler_Factory.h"
+#include "orbsvcs/RtecSchedulerS.h"
+#include "orbsvcs/Sched/sched_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+struct TAO_RTSched_Export TAO_RT_Info_Ex
+ : public RtecScheduler::RT_Info
+ // = TITLE
+ // A wrapper class for the IDL-generated RT_Info operation descriptors.
+ //
+ // = DESCRIPTION
+ // This class provides (re)initialization methods and a validity flag
+ // for the underlying IDL-generated RT_Info descriptor.
+{
+ TAO_RT_Info_Ex ();
+ // Default Constructor.
+
+ TAO_RT_Info_Ex (const RtecScheduler::RT_Info &);
+ // Constructor from an RT_Info
+ // (also serves as a copy constructor).
+
+ virtual ~TAO_RT_Info_Ex ();
+ // Destructor.
+
+ void operator = (const RtecScheduler::RT_Info &);
+ // Assignment operator with an RT_Info on the RHS.
+
+ virtual void reset (u_long reset_flags);
+ // Resets output data members to initial values, and removes tuples
+ // corresponding to the reset flags.
+
+ virtual void enabled_state (RtecScheduler::RT_Info_Enabled_Type_t);
+ // Sets the info and underlying entry's enable states.
+
+ virtual RtecScheduler::RT_Info_Enabled_Type_t enabled_state ();
+ // Returns the info's enable state.
+};
+
+
+struct TAO_RTSched_Export TAO_RT_Info_Tuple
+ : public TAO_RT_Info_Ex
+ // = TITLE
+ // An implementation class used to wrap available operation descriptors.
+ // Each operation may have one or more tuples describing different rates,
+ // etc., for the same operation.
+ //
+ // = DESCRIPTION
+ // This class enables admission control within the Reconfig Scheduler,
+ // which offers improved performance compared to admission control
+ // outside the scheduler.
+{
+ TAO_RT_Info_Tuple ();
+ // Default Constructor.
+
+ TAO_RT_Info_Tuple (const RtecScheduler::RT_Info &);
+ // Constructor from an RT_Info.
+ // (also serves as a copy constructor).
+
+ virtual ~TAO_RT_Info_Tuple ();
+ // Destructor.
+
+ void operator = (const RtecScheduler::RT_Info &);
+ // Assignment operator with an RT_Info on the RHS.
+
+ bool operator < (const TAO_RT_Info_Tuple &t);
+ // Less-than comparison operator: orders tuples by ascending rate (descending period).
+
+ u_long rate_index;
+ // Index of the tuple in the operation's ordered available rates
+};
+
+
+class TAO_RTSched_Export TAO_Reconfig_Scheduler_Entry
+ // = TITLE
+ // An implementation class used to decouple the available descriptors
+ // from the admitted descriptors, and to store interim scheduling results
+ // such as DFS finishing order, etc.
+ //
+ // = DESCRIPTION
+ // This class improves the performance of the Reconfig Scheduler
+ // by saving information from one computation for use in other
+ // computations, and simplifies the implementation logic.
+{
+public:
+
+ // Info for DFS traversal, topological sort of call graph.
+ enum DFS_Status {NOT_VISITED, VISITED, FINISHED};
+
+ enum Tuple_Type {ORIGINAL = 0x01UL, PROPAGATED = 0x02UL};
+
+ TAO_Reconfig_Scheduler_Entry (TAO_RT_Info_Ex &rt_info);
+ // Constructor.
+
+ ~TAO_Reconfig_Scheduler_Entry ();
+ // Destructor.
+
+ void remove_tuples (u_long tuple_flags = ORIGINAL | PROPAGATED);
+ // Removes all tuples from the entry.
+
+ int insert_tuple (TAO_RT_Info_Tuple &tuple,
+ Tuple_Type tuple_type = ORIGINAL,
+ int replace = 0);
+ // Inserts a tuple into the appropriate tuple multiset.
+
+ int update_tuple (TAO_RT_Info_Ex &info,
+ Tuple_Type tuple_type = ORIGINAL);
+ // Updates a matching tuple.
+
+ int register_tuples (TAO_RT_Info_Tuple ** tuple_ptr_array,
+ long &tuple_count);
+ // Registers tuples into the passed tuple pointer array.
+
+ TAO_RT_Info_Ex & orig_rt_info_data (void);
+ // Accessor for stored original RT_Info data.
+
+ void orig_rt_info_data (TAO_RT_Info_Ex &data);
+ // Mutator for stored original RT_Info data.
+
+ TAO_RT_Info_Ex * actual_rt_info ();
+ // Accessor for actual RT_Info.
+
+ void actual_rt_info (TAO_RT_Info_Ex *);
+ // Mutator for actual RT_Info.
+
+ long fwd_discovered () const;
+ // Accessor for when the node was discovered in forward DFS traversal.
+
+ void fwd_discovered (long l);
+ // Mutator for when the node was discovered in forward DFS traversal.
+
+ long rev_discovered () const;
+ // Accessor for when the node was discovered in reverse DFS traversal.
+
+ void rev_discovered (long l);
+ // Mutator for when the node was discovered in reverse DFS traversal.
+
+ long fwd_finished () const;
+ // Accessor for when the node was finished in forward DFS traversal.
+
+ void fwd_finished (long l);
+ // Mutator for when the node was finished in forward DFS traversal.
+
+ long rev_finished () const;
+ // Accessor for when the node was finished in reverse DFS traversal.
+
+ void rev_finished (long l);
+ // Mutator for when the node was finished in reverse DFS traversal.
+
+ DFS_Status fwd_dfs_status () const;
+ // Accessor for forward DFS traversal status of the node.
+
+ DFS_Status rev_dfs_status () const;
+ // Accessor for reverse DFS traversal status of the node.
+
+ void fwd_dfs_status (DFS_Status ds);
+ // Mutator for forward DFS traversal status of the node.
+
+ void rev_dfs_status (DFS_Status ds);
+ // Mutator for reverse DFS traversal status of the node.
+
+ int is_thread_delineator () const;
+ // Accessor for flag indicating whether node is a thread
+ // delineator.
+
+ void is_thread_delineator (int i);
+ // Mutator for flag indicating whether node is a thread
+ // delineator.
+
+ int has_unresolved_remote_dependencies () const;
+ // Accessor for flag indicating whether node has unresolved remote
+ // dependencies.
+
+ void has_unresolved_remote_dependencies (int i);
+ // Mutator for flag indicating whether node has unresolved remote
+ // dependencies.
+
+ int has_unresolved_local_dependencies () const;
+ // Accessor for flag indicating whether node has unresolved local
+ // dependencies.
+
+ void has_unresolved_local_dependencies (int i);
+ // Mutator for flag indicating whether node has unresolved local
+ // dependencies.
+
+ RtecScheduler::Time aggregate_exec_time ();
+ // Accessor for effective execution time of the corresponding
+ // RT_Info and all of its disjunctively (i.e., dispatching waveforms
+ // are additive) executed dependants.
+
+ void aggregate_exec_time (RtecScheduler::Time t);
+ // Mutator for effective execution time of the corresponding RT_Info
+ // and its disjunctively executed dependants.
+
+ RtecScheduler::Period_t orig_tuple_period_sum ();
+ // Accessor for the sum of periods for tuples directly associated
+ // with the entry. It can be used to compute the mean rate for the
+ // entry.
+
+ void orig_tuple_period_sum (RtecScheduler::Period_t p);
+ // Mutator for the sum of periods for tuples directly associated
+ // with the entry. It can be used to compute the mean rate for the
+ // entry.
+
+ RtecScheduler::Period_t prop_tuple_period_sum ();
+ // Accessor for the sum of periods for tuples propagated via
+ // dependencies on other entries. It can be used to compute the
+ // mean rate for the entry.
+
+ void prop_tuple_period_sum (RtecScheduler::Period_t p);
+ // Mutator for the sum of periods for tuples propagated via
+ // dependencies on other entries. It can be used to compute the
+ // mean rate for the entry.
+
+ u_int orig_tuple_count ();
+ // Accessor for the number of tuples directly associated with the
+ // entry.
+
+ void orig_tuple_count (u_int c);
+ // Mutator for the number of tuples directly associated with the
+ // entry.
+
+ u_int prop_tuple_count ();
+ // Accessor for the number of tuples propagated via dependencies on
+ // other entries.
+
+ void prop_tuple_count (u_int c);
+ // Mutator for the number of tuples propagated via dependencies on
+ // other entries.
+
+ TUPLE_SET& orig_tuple_subset ();
+ // Accessor for the set of tuples directly associated with the
+ // entry.
+
+ TUPLE_SET& prop_tuple_subset ();
+ // Accessor for the set of tuples propagated via dependencies on
+ // other entries.
+
+ TAO_RT_Info_Tuple * current_admitted_tuple ();
+ // Returns a pointer to the entry's most recently admitted tuple.
+ // The pointer is zero if no tuples have been admitted so far.
+
+ void current_admitted_tuple (TAO_RT_Info_Tuple *);
+ // Sets a pointer to the entry's most recently admitted tuple.
+ // The pointer is zero if no tuples have been admitted so far.
+
+ RtecScheduler::RT_Info_Enabled_Type_t enabled_state () const;
+ // Accessor for flag indicating whether or not node is enabled.
+
+ void enabled_state (RtecScheduler::RT_Info_Enabled_Type_t);
+ // Mutator for flag indicating whether or not node is enabled.
+
+/* WSOA merge - commented out
+ RtecScheduler::Period_t effective_period ();
+ // Accessor for effective period of corresponding RT_Info.
+
+ void effective_period (RtecScheduler::Period_t p);
+ // Mutator for effective period of corresponding RT_Info.
+
+ CORBA::Long effective_exec_multiplier ();
+ // Accessor for effective execution time multiplier of corresponding
+ // RT_Info.
+
+ void effective_exec_multiplier (CORBA::Long l);
+ // Mutator for effective execution time multiplier of corresponding
+ // RT_Info.
+*/
+
+private:
+
+ TAO_RT_Info_Ex orig_rt_info_data_;
+ // Stores the values of operation characteristics as they were specified
+ // in the most recent call to the Reconfig_Scheduler's set () method.
+ // That way, the scheduler propagation pass can overwrite RT_Info fields
+ // without losing the original values. This is useful when
+
+ TAO_RT_Info_Ex *actual_rt_info_;
+ // Points to the actual RT_Info to which the schedling entry corresponds.
+
+ DFS_Status fwd_dfs_status_;
+ // Forward depth-first-search status of the entry.
+
+ DFS_Status rev_dfs_status_;
+ // Reverse depth-first-search status of the entry.
+
+ long fwd_discovered_;
+ // Forward depth-first-search discovery order of the entry.
+
+ long rev_discovered_;
+ // Reverse depth-first-search discovery order of the entry.
+
+ long fwd_finished_;
+ // Forward depth-first-search completion order of the entry.
+
+ long rev_finished_;
+ // Reverse depth-first-search completion order of the entry.
+
+ int is_thread_delineator_;
+ // Flag identifying threads in the call graph.
+
+ int has_unresolved_remote_dependencies_;
+ // Flag indicating whether or not there are unresolved remote
+ // dependencies in the entry's dependency call chain.
+
+ int has_unresolved_local_dependencies_;
+ // Flag indicating whether or not there are unresolved local
+ // dependencies in the entry's dependency call chain.
+
+ RtecScheduler::Time aggregate_exec_time_;
+ // Effective execution time for corresponding RT_Info and its
+ // disjunctively executed dependants.
+
+ RtecScheduler::Period_t orig_tuple_period_sum_;
+ // Sum of periods for tuples directly associated with the entry. It
+ // can be used to compute the mean rate for the entry.
+
+ RtecScheduler::Period_t prop_tuple_period_sum_;
+ // The sum of periods for tuples propagated via dependencies on
+ // other entries. It can be used to compute the mean rate for the
+ // entry.
+
+ u_int orig_tuple_count_;
+ // The number of tuples directly associated with the entry.
+
+ u_int prop_tuple_count_;
+ // The number of tuples propagated via dependencies on other
+ // entries.
+
+ TUPLE_SET orig_tuple_subset_;
+ // The set of tuples directly associated with the entry.
+
+ TUPLE_SET prop_tuple_subset_;
+ // The set of tuples propagated via dependencies on other entries.
+
+ TAO_RT_Info_Tuple * current_admitted_tuple_;
+ // A pointer to the entry's most recently admitted tuple.
+
+ RtecScheduler::RT_Info_Enabled_Type_t enabled_;
+ // Flag indicating whether or not node is enabled.
+
+ /* - WSOA merge - commented out
+ CORBA::Long effective_exec_multiplier_;
+ // Effective execution time multiplier for corresponding RT_Info.
+
+ RtecScheduler::Period_t effective_period_;
+ // Effective period of corresponding RT_Info.
+ */
+};
+
+
+class TAO_RTSched_Export TAO_Reconfig_Sched_Entry_Visitor
+ // = TITLE
+ // An abstract base class for scheduler entry visitors.
+ //
+ // = DESCRIPTION
+ // This class simplifies the reconfig scheduler implementation
+ // by giving a common interface for distinct visitors over the
+ // scheduling entries.
+{
+public:
+
+ /// Destructor.
+ virtual ~TAO_Reconfig_Sched_Entry_Visitor (void);
+
+ virtual int visit (TAO_Reconfig_Scheduler_Entry &) = 0;
+ // Visit a Reconfig Scheduler Entry.
+
+};
+
+
+class TAO_RTSched_Export TAO_RSE_Reset_Visitor :
+ public TAO_Reconfig_Sched_Entry_Visitor
+ // = TITLE
+ // A scheduler entry visitor that resets nodes.
+ //
+ // = DESCRIPTION
+ // This class resets each node it visits to an initial state
+ // prior to the first DFS traversal for topological sorting.
+{
+public:
+
+ TAO_RSE_Reset_Visitor ();
+ // Constructor.
+
+ virtual ~TAO_RSE_Reset_Visitor () {}
+ // Destructor.
+
+ virtual int visit (TAO_Reconfig_Scheduler_Entry &rse);
+ // Resets the fields in the entry to pre-DFS traversal states.
+ // Returns 0 on success and -1 on error.
+};
+
+class TAO_RTSched_Export TAO_RT_Info_Tuple_Visitor
+ // = TITLE
+ // An abstract base class for RT_Info tuple visitors.
+ //
+ // = DESCRIPTION
+ // This class simplifies the reconfig scheduler implementation
+ // by giving a common interface for distinct visitors over the
+ // RT_Info tuples.
+{
+public:
+
+ /// Destructor.
+ virtual ~TAO_RT_Info_Tuple_Visitor (void);
+
+ virtual int visit (TAO_RT_Info_Tuple &) = 0;
+ // Visit a RT_Info tuple.
+
+};
+
+class TAO_RTSched_Export TAO_Reconfig_Sched_Strategy_Base
+ // = TITLE
+ // A base class for scheduling strategies
+ //
+ // = DESCRIPTION This class provides a DFS finish time comparison
+ // function, a static subpriority comparison function, and a
+ // criticality evaluation function for all scheduling strategies.
+{
+public:
+
+ static int comp_tuple_finish_times (const void *first, const void *second);
+ // Ordering function to compare the DFS finish times of
+ // two RT_Info_Tuples
+
+ static int comp_entry_finish_times (const void *first, const void *second);
+ // Ordering function to compare the DFS finish times of
+ // two task entries, so qsort orders these in topological
+ // order, with the higher times *first*.
+
+ static int is_critical (TAO_Reconfig_Scheduler_Entry &rse);
+ // Determines whether or not an entry is critical, based on
+ // operation characteristics. returns 1 if critical, 0 if not
+
+ static int is_critical (TAO_RT_Info_Tuple &t);
+ // Determines whether or not a tuple is critical, based on operation
+ // characteristics. returns 1 if critical, 0 if not
+
+ static int compare_subpriority (TAO_Reconfig_Scheduler_Entry &,
+ TAO_Reconfig_Scheduler_Entry &);
+ // Compares two entries by subpriority alone. Returns -1 if the
+ // first one is higher, 0 if they're the same, and 1 if the second one is higher.
+};
+
+class TAO_RTSched_Export TAO_MUF_FAIR_Reconfig_Sched_Strategy
+ : public TAO_Reconfig_Sched_Strategy_Base
+ // = TITLE
+ // A scheduling strategy that implements the Maximum Urgency First
+ // scheduling algorithm with Fair Admission of Indexed Rates
+ // (FAIR).
+ //
+ // = DESCRIPTION
+ // The strategy assigns static thread and global priority according
+ // to operation criticality, assigns static subpriority according to
+ // importance and then topological order, and assigns a dispatching
+ // configuration with a minimum laxity dispatching queue for each
+ // distinct criticality level. It admits operation tuples in order
+ // of ascending rate index, where the lowest rate for an operation
+ // has index 0, the next higher rate has index 1, etc.
+{
+public:
+
+ static int total_priority_comp (const void *, const void *);
+ // Ordering function used to qsort an array of RT_Info_Tuple
+ // pointers into a total <priority, subpriority> ordering. Returns
+ // -1 if the first one is higher, 0 if they're the same, and 1 if
+ // the second one is higher.
+
+ static int total_admission_comp (const void *, const void *);
+ // Ordering function used to qsort an array of RT_Info_Tuple
+ // pointers into a total ordering for admission control. Returns
+ // -1 if the first one is higher, 0 if they're the same, and 1 if
+ // the second one is higher.
+
+ static int compare_priority (TAO_Reconfig_Scheduler_Entry &,
+ TAO_Reconfig_Scheduler_Entry &);
+ // Compares two entries by priority alone. Returns -1 if the
+ // first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+ static int compare_priority (TAO_RT_Info_Tuple &,
+ TAO_RT_Info_Tuple &);
+ // Compares two tuples by priority alone. Returns -1 if the
+ // first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+ static int compare_admission_order (TAO_RT_Info_Tuple &,
+ TAO_RT_Info_Tuple &);
+ // Compares two tuples by the given admission ordering. Returns -1 if the
+ // first one is earlier, 0 if they're the same, and 1 if the second one is earlier.
+
+ static int assign_config (RtecScheduler::Config_Info &,
+ TAO_Reconfig_Scheduler_Entry &);
+ // Fills in a static dispatch configuration for a priority level, based
+ // on the operation characteristics of a representative scheduling entry.
+};
+
+class TAO_RTSched_Export TAO_RMS_FAIR_Reconfig_Sched_Strategy
+ : public TAO_Reconfig_Sched_Strategy_Base
+ // = TITLE
+ // A scheduling strategy that implements the Boeing RMS-Dynamic
+ // scheduling algorithm, and the Honeywell MNO admission control
+ // algorithm.
+ //
+ // = DESCRIPTION
+ // The strategy assigns static thread and global priority
+ // according to criticality and rate, assigns static subpriority
+ // according to importance and then topological order, and assigns
+ // a dispatching configuration with a static dispatching queue for
+ // each high criticality rate, and a single minimum laxity
+ // dispatching queue for all low criticality operations. It
+ // admits the lowest rate-index tuple for each operation, then
+ // admits operations at their highest admissible rates in priority
+ // order.
+{
+public:
+
+ static int total_priority_comp (const void *, const void *);
+ // Ordering function used to qsort an array of RT_Info_Tuple
+ // pointers into a total <priority, subpriority> ordering. Returns
+ // -1 if the first one is higher, 0 if they're the same, and 1 if
+ // the second one is higher.
+
+ static int total_admission_comp (const void *, const void *);
+ // Ordering function used to qsort an array of RT_Info_Tuple
+ // pointers into a total ordering for admission control. Returns
+ // -1 if the first one is higher, 0 if they're the same, and 1 if
+ // the second one is higher.
+
+ static int compare_criticality(TAO_Reconfig_Scheduler_Entry &lhs,
+ TAO_Reconfig_Scheduler_Entry &rhs);
+ // Compares two entries by criticality alone. Returns -1 if the
+ // first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+ static int compare_criticality(TAO_RT_Info_Tuple &lhs,
+ TAO_RT_Info_Tuple &rhs);
+ // Compares two entries by criticality alone. Returns -1 if the
+ // first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+ static int compare_priority (TAO_Reconfig_Scheduler_Entry &,
+ TAO_Reconfig_Scheduler_Entry &);
+ // Compares two entries by priority alone. Returns -1 if the
+ // first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+ static int compare_priority (TAO_RT_Info_Tuple &,
+ TAO_RT_Info_Tuple &);
+ // Compares two tuples by priority alone. Returns -1 if the
+ // first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+ static int compare_admission_order (TAO_RT_Info_Tuple &,
+ TAO_RT_Info_Tuple &);
+ // Compares two entries by admission ordering policy. Returns -1 if the
+ // first one is earlier, 0 if they're the same, and 1 if the second one is earlier.
+
+ static int compare_subpriority (TAO_Reconfig_Scheduler_Entry &,
+ TAO_Reconfig_Scheduler_Entry &);
+ // Compares two entries by subpriority alone. Returns -1 if the
+ // first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+ static int assign_config (RtecScheduler::Config_Info &,
+ TAO_Reconfig_Scheduler_Entry &);
+ // Fills in a static dispatch configuration for a priority level, based
+ // on the operation characteristics of a representative scheduling entry.
+};
+
+class TAO_RTSched_Export TAO_RMS_MLF_Reconfig_Sched_Strategy
+ : public TAO_Reconfig_Sched_Strategy_Base
+ // = TITLE
+ // A scheduling strategy that implements the Boeing RMS-Dynamic
+ // scheduling algorithm, and the Honeywell MNO admission control
+ // algorithm.
+ //
+ // = DESCRIPTION
+ // The strategy assigns static thread and global priority
+ // according to criticality and rate, assigns static subpriority
+ // according to importance and then topological order, and assigns
+ // a dispatching configuration with a static dispatching queue for
+ // each high criticality rate, and a single minimum laxity
+ // dispatching queue for all low criticality operations. It
+ // admits the lowest rate-index tuple for each operation, then
+ // admits operations at their highest admissible rates in priority
+ // order.
+{
+public:
+
+ static int total_priority_comp (const void *, const void *);
+ // Ordering function used to qsort an array of RT_Info_Tuple
+ // pointers into a total <priority, subpriority> ordering. Returns
+ // -1 if the first one is higher, 0 if they're the same, and 1 if
+ // the second one is higher.
+
+ static int total_admission_comp (const void *, const void *);
+ // Ordering function used to qsort an array of RT_Info_Tuple
+ // pointers into a total ordering for admission control. Returns
+ // -1 if the first one is higher, 0 if they're the same, and 1 if
+ // the second one is higher.
+
+ static int compare_criticality(TAO_Reconfig_Scheduler_Entry &lhs,
+ TAO_Reconfig_Scheduler_Entry &rhs);
+ // Compares two entries by criticality alone. Returns -1 if the
+ // first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+ static int compare_criticality(TAO_RT_Info_Tuple &lhs,
+ TAO_RT_Info_Tuple &rhs);
+ // Compares two entries by criticality alone. Returns -1 if the
+ // first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+ static int compare_priority (TAO_Reconfig_Scheduler_Entry &,
+ TAO_Reconfig_Scheduler_Entry &);
+ // Compares two entries by priority alone. Returns -1 if the
+ // first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+ static int compare_priority (TAO_RT_Info_Tuple &,
+ TAO_RT_Info_Tuple &);
+ // Compares two tuples by priority alone. Returns -1 if the
+ // first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+ static int compare_admission_order (TAO_RT_Info_Tuple &,
+ TAO_RT_Info_Tuple &);
+ // Compares two entries by admission ordering policy. Returns -1 if the
+ // first one is earlier, 0 if they're the same, and 1 if the second one is earlier.
+
+ static int compare_subpriority (TAO_Reconfig_Scheduler_Entry &,
+ TAO_Reconfig_Scheduler_Entry &);
+ // Compares two entries by subpriority alone. Returns -1 if the
+ // first one is higher, 0 if they're the same, and 1 if the second one is higher.
+
+ static int assign_config (RtecScheduler::Config_Info &,
+ TAO_Reconfig_Scheduler_Entry &);
+ // Fills in a static dispatch configuration for a priority level, based
+ // on the operation characteristics of a representative scheduling entry.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// Include the templates here.
+#include "orbsvcs/Sched/Reconfig_Sched_Utils_T.h"
+
+#include /**/ "ace/post.h"
+#endif /* TAO_RECONFIG_SCHED_UTILS_H */
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.cpp b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.cpp
new file mode 100644
index 00000000000..cfc7cfd332a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.cpp
@@ -0,0 +1,1085 @@
+// ============================================================================
+//
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Reconfig_Sched_Utils_T.cpp
+//
+// = AUTHOR
+// Chris Gill <cdgill@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_RECONFIG_SCHED_UTILS_T_CPP
+#define TAO_RECONFIG_SCHED_UTILS_T_CPP
+
+#include "orbsvcs/Sched/Reconfig_Sched_Utils_T.h"
+#include "ace/Sched_Params.h"
+#include "ace/ACE.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+////////////////////////////////
+// TAO_RSE_Dependency_Visitor //
+////////////////////////////////
+
+// Constructor.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+TAO_RSE_Dependency_Visitor
+ (DEPENDENCY_SET_MAP & dependency_map, RT_INFO_MAP & rt_info_map)
+ : dependency_map_ (dependency_map),
+ rt_info_map_ (rt_info_map)
+{
+}
+
+
+// Visit a Reconfig Scheduler Entry. This method calls protected hook
+// methods that can be overridden by derived classes, according to the
+// Template Method design pattern.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+visit (TAO_Reconfig_Scheduler_Entry &rse)
+{
+ int result = 0;
+
+ /* WSOA merge - commented out
+ // Call unconditional action method, which performs any necessary
+ // modifications that are applied to each node unconditionally.
+ if (this->unconditional_action (rse) < 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_RSE_Dependency_Visitor::"
+ "visit: error from unconditional action.\n"), -1);
+ }
+ */
+
+ // Call precondition hook method, and only proceed if the
+ // precondition returns 0 for success.
+
+ result = this->precondition (rse);
+ if (result < 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_RSE_Dependency_Visitor::"
+ "visit: error from precondition evaluation.\n"), -1);
+ }
+
+ if (result == 0)
+ {
+ // Call prefix action method, which performs any necessary
+ // modifications on the node prior to visiting its successors.
+ if (this->prefix_action (rse) < 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_RSE_Dependency_Visitor::"
+ "visit: error from prefix action.\n"), -1);
+ }
+
+ // Get the dependency set for the current entry.
+ RtecScheduler::Dependency_Set *dependency_set = 0;
+ if (dependency_map_.find (rse.actual_rt_info ()->handle,
+ dependency_set) == 0)
+ {
+ // Iterate over the set of dependencies for the current entry.
+ TAO_Reconfig_Scheduler_Entry * next_rse = 0;
+ TAO_RT_Info_Ex *next_rt_info = 0;
+ for (u_int i = 0; i < dependency_set->length (); ++i)
+ {
+ // Skip over disabled dependencies
+ if ((*dependency_set) [i].enabled == RtecBase::DEPENDENCY_DISABLED)
+ {
+ continue;
+ }
+
+ // Take the handle from the dependency and use it
+ // to obtain an RT_Info pointer from the map.
+ if (rt_info_map_.find ((*dependency_set) [i].rt_info,
+ next_rt_info) != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "RT_Info (%i) not found.\n",
+ (*dependency_set) [i].rt_info), -1);
+ }
+
+ // Extract a pointer to the scheduling entry from the RT_Info.
+
+ if (next_rt_info == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "RT_Info in map was null.\n"),
+ -1);
+ }
+
+ // Reference the associated scheduling entry: the double cast is
+ // needed to ensure that the size of the pointer and the size of the
+ // stored magic cookie are the same
+ next_rse =
+ ACE_LONGLONG_TO_PTR (TAO_Reconfig_Scheduler_Entry *,
+ next_rt_info->volatile_token);
+ if (next_rse == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Entry pointer in RT_Info was null.\n"),
+ -1);
+ }
+
+ // Call pre-recursion action method, which performs any necessary
+ // modifications to a successor (or the entry) prior to recursing
+ // on the successor.
+ result = this->pre_recurse_action (rse, *next_rse,
+ (*dependency_set) [i]);
+ if (result < 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_RSE_Dependency_Visitor::visit: "
+ "error from pre-recursion action.\n"),
+ -1);
+ }
+
+ // If the pre-recursion action returned 0, visit the successor.
+ if (result == 0)
+ {
+ this->visit (*next_rse);
+ }
+ }
+
+ }
+
+ // Call postfix action method, which performs any necessary
+ // modifications on the node after visiting all its successors.
+ if (this->postfix_action (rse) < 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "TAO_RSE_Dependency_Visitor::"
+ "visit: error from postfix action.\n"), -1);
+ }
+ }
+
+ return 0;
+}
+
+// WSOA merge - commented out
+// // Performs an unconditional action when the entry is first reached.
+// // Returns 0 for success, and -1 if an error occurred.
+
+// template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+// TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+// unconditional_action (TAO_Reconfig_Scheduler_Entry & /* rse */)
+// {
+// // Default behavior: just return success.
+// return 0;
+// }
+//
+
+// Tests whether or not any conditional actions should be taken for
+// the entry. Returns 0 if the actions should be applied, 1 if the
+// entry should be left alone, and -1 if an error occurred.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+precondition (TAO_Reconfig_Scheduler_Entry &rse)
+{
+ // Only signal to proceed (0) if the passed entry is enabled or non-volatile
+ return (rse.enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ ? 1
+ : 0;
+}
+
+
+// Performs an action on the entry prior to visiting any of
+// its successors. Returns 0 on success and -1 on error.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+prefix_action (TAO_Reconfig_Scheduler_Entry & /* rse */)
+{
+ // Default behavior: just return success.
+ return 0;
+}
+
+
+// Performs an action on a successor entry prior to visiting
+// it. Returns 0 on success and -1 on error.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+pre_recurse_action (TAO_Reconfig_Scheduler_Entry & /* entry */,
+ TAO_Reconfig_Scheduler_Entry & /* successor */,
+ const RtecScheduler::Dependency_Info & /* di */)
+{
+ // Default behavior: just return success.
+ return 0;
+}
+
+
+// Performs an action on the entry after visiting all of
+// its successors. Returns 0 on success and -1 on error.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+postfix_action (TAO_Reconfig_Scheduler_Entry & /* rse */)
+{
+ // Default behavior: just return success.
+ return 0;
+}
+
+
+
+/////////////////////////
+// TAO_RSE_DFS_Visitor //
+/////////////////////////
+
+// Constructor.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+TAO_RSE_DFS_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+TAO_RSE_DFS_Visitor
+ (ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP & dependency_map,
+ ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::RT_INFO_MAP & rt_info_map)
+ : TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>
+ (dependency_map, rt_info_map),
+ DFS_time_ (0)
+{
+}
+
+
+// Makes sure the entry has not previously been visited in forward DFS.
+// Returns 0 if the actions should be applied, 1 if the entry
+// should be left alone, and -1 if an error occurred.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_DFS_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+precondition (TAO_Reconfig_Scheduler_Entry &rse)
+{
+ int result =
+ TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+ precondition (rse);
+
+ return (result == 0)
+ ? ((rse.fwd_dfs_status () == TAO_Reconfig_Scheduler_Entry::NOT_VISITED)
+ ? 0
+ : 1)
+ : result;
+}
+
+// Marks entry as forward visited and sets its forward DFS start
+// time, prior to visiting any of its successors. Returns 0 on
+// success and -1 on error.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_DFS_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+prefix_action (TAO_Reconfig_Scheduler_Entry &rse)
+{
+ rse.fwd_dfs_status (TAO_Reconfig_Scheduler_Entry::VISITED);
+ rse.fwd_discovered (this->DFS_time_++);
+ return 0;
+}
+
+
+// Marks whether or not successor is a thread delineator prior to
+// visiting it. Returns 0 on success and -1 on error.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_DFS_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+pre_recurse_action (TAO_Reconfig_Scheduler_Entry & /* entry */,
+ TAO_Reconfig_Scheduler_Entry & successor,
+ const RtecScheduler::Dependency_Info & /* di */)
+{
+ // Enabled operations we reached via a dependency and that do not
+ // specify a period are not thread delineators.
+ if (successor.enabled_state () != RtecScheduler::RT_INFO_DISABLED
+ && successor.actual_rt_info ()->period == 0
+ && successor.actual_rt_info ()->threads == 0)
+ {
+ successor.is_thread_delineator (0);
+ }
+
+ return 0;
+}
+
+
+// Marks entry as forward finished and sets its forward DFS finish
+// time, after all of its successors have been visited. Returns 0
+// on success and -1 on error.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_DFS_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+postfix_action (TAO_Reconfig_Scheduler_Entry &rse)
+{
+ rse.fwd_dfs_status (TAO_Reconfig_Scheduler_Entry::FINISHED);
+ rse.fwd_finished (this->DFS_time_++);
+ return 0;
+}
+
+
+/////////////////////////
+// TAO_RSE_SCC_Visitor //
+/////////////////////////
+
+// Constructor.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+TAO_RSE_SCC_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+TAO_RSE_SCC_Visitor
+ (ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP & dependency_map,
+ ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::RT_INFO_MAP & rt_info_map)
+ : TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>
+ (dependency_map, rt_info_map),
+ DFS_time_ (0),
+ number_of_cycles_ (0),
+ in_a_cycle_ (0)
+{
+}
+
+// Accessor for number of cycles detected in traversal.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_SCC_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+number_of_cycles (void)
+{
+ return this->number_of_cycles_;
+}
+
+
+// Accessor for whether or not the recursion is within a previously
+// detected cycle.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_SCC_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+in_a_cycle (void)
+{
+ return this->in_a_cycle_;
+}
+
+
+// Mutator for whether or not the recursion is within a previously
+// detected cycle.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_RSE_SCC_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+in_a_cycle (int i)
+{
+ this->in_a_cycle_ = i;
+}
+
+/* WSOA merge - commented out
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_SCC_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+unconditional_action (TAO_Reconfig_Scheduler_Entry &rse)
+{
+ if (rse.is_thread_delineator () &&
+ rse.effective_period () == 0)
+ {
+ rse.effective_period (rse.actual_rt_info ()->period);
+ long threads = rse.actual_rt_info ()->threads;
+ rse.effective_exec_multiplier (threads > 0 ? threads : 1);
+ }
+
+ return 0;
+}
+*/
+
+// Makes sure the entry has not previously been visited in the
+// reverse DFS (call graph transpose) direction. Returns 0 if
+// the actions should be applied, 1 if the entry should be left
+// alone, and -1 if an error occurred.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_SCC_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+precondition (TAO_Reconfig_Scheduler_Entry &rse)
+{
+ int result =
+ TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+ precondition (rse);
+
+ return (result == 0)
+ ? ((rse.rev_dfs_status () == TAO_Reconfig_Scheduler_Entry::NOT_VISITED)
+ ? 0
+ : 1)
+ : 1;
+}
+
+
+// Marks reverse status as visited and sets reverse start time for
+// entry, prior to visiting any of its successors. Returns 0 on
+// success and -1 on error.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_SCC_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+prefix_action (TAO_Reconfig_Scheduler_Entry &rse)
+{
+ rse.rev_dfs_status (TAO_Reconfig_Scheduler_Entry::VISITED);
+ rse.rev_discovered (this->DFS_time_++);
+ return 0;
+}
+
+
+// Checks reverse status of each successor. For any that have not
+// been previously visited, it complains about the entry and
+// successor being part of a cycle, stores the fact that a cycle was
+// detected, and maintains a count of the total number of cycles
+// (strongly connected components). Returns 0 on success and -1 on
+// an error (finding a cycle is not considered an error, at least as
+// far as this method is concerned).
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_SCC_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+pre_recurse_action (TAO_Reconfig_Scheduler_Entry &entry,
+ TAO_Reconfig_Scheduler_Entry &successor,
+ const RtecScheduler::Dependency_Info & /* di */)
+{
+ if (successor.enabled_state () !=
+ RtecScheduler::RT_INFO_DISABLED
+ && successor.rev_dfs_status () ==
+ TAO_Reconfig_Scheduler_Entry::NOT_VISITED)
+ {
+ if (this->in_a_cycle () == 0)
+ {
+ this->in_a_cycle (1);
+ ++this->number_of_cycles_;
+ }
+
+ ACE_DEBUG ((LM_ERROR,
+ "RT_Infos \"%s\" and \"%s\" are part of dependency cycle %d.\n",
+ entry.actual_rt_info ()->entry_point.in (),
+ successor.actual_rt_info ()->entry_point.in (),
+ this->number_of_cycles_));
+ }
+
+ return 0;
+}
+
+
+// Sets the entry's reverse finish time and marks it as finished in
+// the reverse DFS traversal, after visiting all of its successors.
+// Returns 0 on success and -1 on error.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_SCC_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+postfix_action (TAO_Reconfig_Scheduler_Entry &rse)
+{
+ rse.rev_dfs_status (TAO_Reconfig_Scheduler_Entry::FINISHED);
+ rse.rev_finished (this->DFS_time_++);
+ return 0;
+}
+
+/////////////////////////////////////////
+// TAO_RSE_Reverse_Propagation_Visitor //
+/////////////////////////////////////////
+
+// Constructor.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+TAO_RSE_Reverse_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+TAO_RSE_Reverse_Propagation_Visitor
+ (ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP & dependency_map,
+ ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::RT_INFO_MAP & rt_info_map)
+ : TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK> (dependency_map, rt_info_map)
+{
+}
+
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_Reverse_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+pre_recurse_action (TAO_Reconfig_Scheduler_Entry &entry,
+ TAO_Reconfig_Scheduler_Entry &successor,
+ const RtecScheduler::Dependency_Info & /* di */)
+{
+ // @TODO - check for conjunction nodes here and perform conjunctive
+ // function on existing rate tuples. Idea: treat conjunctive tuples
+ // as skolem functions over the possible rates of their incedent
+ // edges thread delineators!!! Then, can tentatively compute
+ // utilization for rate combinations. Question: can I find a case
+ // where this makes tuple rate admission non-monotonic??? I.e.,
+ // where a higher rate for an input results in a lower utilization?
+ // Might require a skew in the exec times and rates. What are the
+ // determining characteristics of this? What impact if any does
+ // phasing have on this?
+
+ // Check for conjunction nodes and don't propagate
+ // upward from them: they represent a cut point in the graph.
+ // Do not allow conjunction nodes for now.
+ if (entry.actual_rt_info ()->info_type == RtecScheduler::CONJUNCTION)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Conjunction Nodes are not supported currently.")),
+ -1);
+ }
+ else
+ {
+ // @TODO - replace the explicit WCET attribute propagation with
+ // a scheduling strategy functor that propagates arbitrary
+ // execution time attributes. BTW, for conjunctions BCET and WCET
+ // are probably needed relative the upper and lower bounds on
+ // arrival waveforms.
+
+ // Add the successor's aggregate time to the entry's aggregate time.
+ // Since we're visiting in topological order (called nodes before
+ // calling nodes), the successor's aggregate time is up to date.
+ if (successor.enabled_state () != RtecScheduler::RT_INFO_DISABLED)
+ {
+ entry.aggregate_exec_time (entry.aggregate_exec_time ()
+ + successor.aggregate_exec_time ());
+ }
+ }
+
+
+ // Do not recurse on the successor node, just continue to the next successor.
+ return 1;
+}
+
+
+/////////////////////////////////////////
+// TAO_RSE_Forward_Propagation_Visitor //
+/////////////////////////////////////////
+
+// Constructor.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+TAO_RSE_Forward_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+TAO_RSE_Forward_Propagation_Visitor
+ (ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP & dependency_map,
+ ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::RT_INFO_MAP & rt_info_map)
+ : TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK> (dependency_map, rt_info_map),
+ unresolved_locals_ (0),
+ unresolved_remotes_ (0),
+ thread_specification_errors_ (0)
+{
+}
+
+
+// Accessor for number of nodes with unresolved local dependencies.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_Forward_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+unresolved_locals (void)
+{
+ return this->unresolved_locals_;
+}
+
+
+// Mutator for number of nodes with unresolved local dependencies.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_RSE_Forward_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+unresolved_locals (int i)
+{
+ this->unresolved_locals_ = i;
+}
+
+
+// Accessor for number of nodes with unresolved remote dependencies.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_Forward_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+unresolved_remotes (void)
+{
+ return this->unresolved_remotes_;
+}
+
+
+// Mutator for number of nodes with unresolved remote dependencies.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_RSE_Forward_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+unresolved_remotes (int i)
+{
+ this->unresolved_remotes_ = i;
+}
+
+// Accessor for number of nodes with thread specification errors.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_Forward_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+thread_specification_errors (void)
+{
+ return this->thread_specification_errors_;
+}
+
+
+// Mutator for number of nodes with thread specification errors.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_RSE_Forward_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+thread_specification_errors (int i)
+{
+ this->thread_specification_errors_ = i;
+}
+
+
+// Tests the entry for possibly having unresolved remote or local
+// dependencies prior to visiting any of its successors, and also
+// checks for thread specification errors. Returns 0 on success and
+// -1 on error (having unresolved dependencies or thread specification
+// problems is not considered an error, at least for this method).
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_Forward_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+prefix_action (TAO_Reconfig_Scheduler_Entry &rse)
+{
+ // Complain about anything that is still marked as a thread
+ // delineator but does not have a period: if it has threads, it is a
+ // specification error. Otherwise, if it's not a remote dependant
+ // (per RT_Info's info_type field) it has unresolved *local*
+ // dependencies.
+
+ if (rse.is_thread_delineator ())
+ {
+ if (rse.actual_rt_info ()->period == 0)
+ {
+ if (rse.actual_rt_info ()->threads == 0)
+ {
+ if (rse.actual_rt_info ()->info_type ==
+ RtecScheduler::REMOTE_DEPENDANT)
+ {
+ ++this->unresolved_remotes_;
+
+ ACE_DEBUG ((LM_ERROR,
+ "RT_Info \"%s\" has unresolved "
+ "remote dependencies.\n",
+ rse.actual_rt_info ()->entry_point.in ()));
+ }
+ else
+ {
+ ++this->unresolved_locals_;
+
+ ACE_DEBUG ((LM_ERROR,
+ "RT_Info \"%s\" has unresolved "
+ "local dependencies.\n",
+ rse.actual_rt_info ()->entry_point.in ()));
+ }
+ }
+ else
+ {
+ // Specification error: any RT_Info that specifies threads
+ // must also specify a period.
+ ++this->thread_specification_errors_;
+ ACE_DEBUG ((LM_ERROR,
+ "RT_Info \"%s\" specifies %1d "
+ "threads, but no period.\n",
+ rse.actual_rt_info ()->entry_point.in (),
+ rse.actual_rt_info ()->threads));
+ }
+ }
+ }
+
+ return 0;
+}
+
+
+// Propagates effective period from entry to successor prior to
+// visiting successor. Returns 0 on success and -1 on error.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_Forward_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+pre_recurse_action (TAO_Reconfig_Scheduler_Entry &entry,
+ TAO_Reconfig_Scheduler_Entry &successor,
+ const RtecScheduler::Dependency_Info & /* di */)
+{
+ if (successor.enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return 1;
+ }
+
+ TAO_RT_Info_Tuple **tuple_ptr_ptr;
+
+ TUPLE_SET_ITERATOR orig_tuple_iter (entry.orig_tuple_subset ());
+
+ while (orig_tuple_iter.done () == 0)
+ {
+ if (orig_tuple_iter.next (tuple_ptr_ptr) == 0
+ || tuple_ptr_ptr == 0 || *tuple_ptr_ptr == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Failed to access tuple under iterator"));
+ return -1;
+ }
+
+ // @TODO - check for conjunction nodes here and perform conjunctive
+ // function on existing rate tuples.
+
+#ifdef SCHEDULER_LOGGING
+ ACE_DEBUG((LM_DEBUG, "Inserting new propagated tuple for RT_Info: %d, entry_ptr: 0x%x, tuple_ptr: 0x%x\n",
+ successor.actual_rt_info ()->handle,
+ &successor,
+ (*tuple_ptr_ptr)));
+#endif
+ // Propagate tuples disjunctively.
+ successor.insert_tuple (**tuple_ptr_ptr,
+ TAO_Reconfig_Scheduler_Entry::PROPAGATED);
+
+ successor.actual_rt_info ()->period =
+ (successor.actual_rt_info ()->period == 0)
+ ? (*tuple_ptr_ptr)->period
+ : ACE::minimum_frame_size (successor.actual_rt_info ()->period,
+ (*tuple_ptr_ptr)->period);
+ orig_tuple_iter.advance ();
+ }
+
+ TUPLE_SET_ITERATOR prop_tuple_iter (entry.prop_tuple_subset ());
+
+ while (prop_tuple_iter.done () == 0)
+ {
+ if (prop_tuple_iter.next (tuple_ptr_ptr) == 0
+ || tuple_ptr_ptr == 0 || *tuple_ptr_ptr == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Failed to access tuple under iterator"));
+ return -1;
+ }
+
+ // @TODO - check for conjunction nodes here and perform conjunctive
+ // function on existing rate tuples.
+
+#ifdef SCHEDULER_LOGGING
+ ACE_DEBUG((LM_DEBUG, "Inserting new propagated tuple for RT_Info: %d, entry_ptr: 0x%x, tuple_ptr: 0x%x\n",
+ successor.actual_rt_info ()->handle,
+ &successor,
+ (*tuple_ptr_ptr)));
+#endif
+
+ // Propagate tuples disjunctively.
+ successor.insert_tuple (**tuple_ptr_ptr,
+ TAO_Reconfig_Scheduler_Entry::PROPAGATED);
+
+ successor.actual_rt_info ()->period =
+ (successor.actual_rt_info ()->period == 0)
+ ? (*tuple_ptr_ptr)->period
+ : ACE::minimum_frame_size (successor.actual_rt_info ()->period,
+ (*tuple_ptr_ptr)->period);
+
+ prop_tuple_iter.advance ();
+ }
+
+ // Do not recurse on the successor node, just continue to the next successor.
+ return 1;
+}
+
+////////////////////////////////////
+// class TAO_RSE_Priority_Visitor //
+////////////////////////////////////
+
+// Constructor.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+TAO_RSE_Priority_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+TAO_RSE_Priority_Visitor (RtecScheduler::handle_t handles,
+ TAO_Reconfig_Scheduler_Entry ** entry_ptr_array)
+ : previous_entry_ (0),
+ first_subpriority_entry_ (0),
+ priority_ (0),
+ subpriority_ (0),
+ os_priority_ (ACE_Sched_Params::priority_max (ACE_SCHED_FIFO,
+ ACE_SCOPE_PROCESS)),
+ handles_ (handles),
+ entry_ptr_array_ (entry_ptr_array)
+{
+}
+
+
+// Visit a RT_Info tuple. This method assigns a priority and
+// subpriority value to each tuple. Priorities are assigned in
+// increasing numeric order, with lower numbers corresponding to
+// higher priorities.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_Priority_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::visit (TAO_Reconfig_Scheduler_Entry &rse)
+{
+ int result = 0;
+#ifdef SCHEDULER_LOGGING
+ ACE_DEBUG ((LM_DEBUG,
+ "Priority_Visitor visiting %s[%d],crit=%d,period=%d\n",
+ rse.actual_rt_info ()->entry_point.in(),
+ rse.actual_rt_info ()->handle,
+ rse.actual_rt_info ()->criticality,
+ rse.actual_rt_info ()->period));
+#endif
+
+ if (previous_entry_ == 0)
+ {
+ // Indicate a new priority level was assigned.
+ result = 1;
+
+ // If we're on the first node, store the start of the array
+ // as the start of the priority level.
+ first_subpriority_entry_ = this->entry_ptr_array_;
+ rse.actual_rt_info ()->preemption_subpriority = subpriority_;
+ }
+ else
+ {
+#ifdef SCHEDULER_LOGGING
+ ACE_DEBUG ((LM_DEBUG,
+ "Previous entry %s[%d],crit=%d,period=%d\n",
+ previous_entry_->actual_rt_info ()->entry_point.in(),
+ previous_entry_->actual_rt_info ()->handle,
+ previous_entry_->actual_rt_info ()->criticality,
+ previous_entry_->actual_rt_info ()->period));
+#endif
+ // Don't change priority levels on a disabled node.
+ if (rse.enabled_state () == RtecScheduler::RT_INFO_DISABLED
+ || RECONFIG_SCHED_STRATEGY::compare_priority (*previous_entry_, rse) == 0)
+ {
+ // Subpriority is increased at each new node.
+ ++subpriority_;
+
+ // Store negative value of subpriority level: will be
+ // adjusted by adding back in the total number of
+ // subpriorities in the priority level, so the
+ // subpriorities are assigned in decreasing order.
+ rse.actual_rt_info ()->preemption_subpriority = - subpriority_;
+ }
+ else
+ {
+ // Indicate a new priority level was assigned.
+ result = 1;
+
+ // Iterate back through and adjust the subpriority levels.
+ for (int i = 0; i <= subpriority_; ++i, ++first_subpriority_entry_)
+ {
+ (*first_subpriority_entry_)->actual_rt_info ()->
+ preemption_subpriority += subpriority_;
+ }
+
+ subpriority_ = 0;
+ rse.actual_rt_info ()->preemption_subpriority = subpriority_;
+
+ ++priority_;
+#ifdef SCHEDULER_LOGGING
+ ACE_DEBUG ((LM_DEBUG, "New priority %d formed\n", priority_));
+#endif
+ os_priority_ = ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
+ os_priority_,
+ ACE_SCOPE_PROCESS);
+ }
+ }
+
+ // Assign the entry's priority and subpriority values
+ rse.actual_rt_info ()->priority = os_priority_;
+ rse.actual_rt_info ()->preemption_priority = priority_;
+
+ // Remember the current entry for the next visit.
+ previous_entry_ = &rse;
+
+ return result;
+}
+
+
+// Finishes scheduler entry priority assignment by iterating over the
+// remaining entries in the last subpriority level, and adjusting
+// their subpriorities.
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_Priority_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::finish ()
+{
+ // Iterate back through and adjust the subpriority levels.
+ for (int i = 0; i <= subpriority_; ++i, ++first_subpriority_entry_)
+ {
+ (*first_subpriority_entry_)->actual_rt_info ()->
+ preemption_subpriority += subpriority_;
+ }
+
+ // Indicate no new priority level was identified.
+ return 0;
+}
+
+///////////////////////////////////////
+// class TAO_Tuple_Admission_Visitor //
+///////////////////////////////////////
+
+// Constructor.
+
+template <class RECONFIG_SCHED_STRATEGY>
+TAO_Tuple_Admission_Visitor<RECONFIG_SCHED_STRATEGY>::
+TAO_Tuple_Admission_Visitor (const CORBA::Double & critical_utilization_threshold,
+ const CORBA::Double & noncritical_utilization_threshold)
+ : critical_utilization_ (0.0),
+ noncritical_utilization_ (0.0),
+ total_critical_utilization_ (0.0),
+ total_noncritical_utilization_ (0.0),
+ critical_utilization_threshold_ (critical_utilization_threshold),
+ noncritical_utilization_threshold_ (noncritical_utilization_threshold)
+{
+}
+
+// Visit a Reconfig Scheduler Entry. This method
+// determines the utilization by the entry, and
+// adds it to the critical or non-critical utilization,
+// depending on whether or not the strategy says the
+// operation is critical.
+
+template <class RECONFIG_SCHED_STRATEGY> int
+TAO_Tuple_Admission_Visitor<RECONFIG_SCHED_STRATEGY>::visit (TAO_RT_Info_Tuple &t)
+{
+ TAO_Reconfig_Scheduler_Entry *entry =
+ ACE_LONGLONG_TO_PTR (TAO_Reconfig_Scheduler_Entry *,
+ t.volatile_token);
+
+ // Ignore disabled tuples and entries
+ if (t.enabled_state () == RtecScheduler::RT_INFO_DISABLED
+ || entry->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ return 0;
+ }
+
+ // Compute the current tuple's utilization.
+ CORBA::Double delta_utilization =
+ (static_cast<CORBA::Double> (t.threads)
+ * static_cast<CORBA::Double> (ACE_UINT64_DBLCAST_ADAPTER (entry->
+ aggregate_exec_time ())))
+ / static_cast<CORBA::Double> (t.period);
+
+ // Subtract the previous tuple's utilization (if any) for the entry.
+ if (entry->current_admitted_tuple ())
+ {
+ delta_utilization -=
+ (static_cast<CORBA::Double> (entry->current_admitted_tuple ()->threads)
+ * static_cast<CORBA::Double> (ACE_UINT64_DBLCAST_ADAPTER (entry->
+ aggregate_exec_time ())))
+ / static_cast<CORBA::Double> (entry->current_admitted_tuple ()->period);
+ }
+
+ if (RECONFIG_SCHED_STRATEGY::is_critical (t))
+ {
+ this->total_critical_utilization_ += delta_utilization;
+
+ if (this->critical_utilization_ + this->noncritical_utilization_
+ +delta_utilization
+ < this->critical_utilization_threshold_)
+ {
+ this->critical_utilization_ += delta_utilization;
+ entry->current_admitted_tuple (&t);
+ entry->actual_rt_info ()->period = t.period;
+ }
+ }
+ else
+ {
+ this->total_noncritical_utilization_ += delta_utilization;
+ if (this->critical_utilization_ + this->noncritical_utilization_
+ +delta_utilization
+ < this->noncritical_utilization_threshold_)
+ {
+ this->noncritical_utilization_ += delta_utilization;
+ entry->current_admitted_tuple (&t);
+ entry->actual_rt_info ()->period = t.period;
+ }
+ }
+ return 0;
+}
+
+
+// Accessor for utilization by critical operations.
+
+template <class RECONFIG_SCHED_STRATEGY> CORBA::Double
+TAO_Tuple_Admission_Visitor<RECONFIG_SCHED_STRATEGY>::critical_utilization ()
+{
+ return this->critical_utilization_;
+}
+
+
+// Accessor for utilization by noncritical operations.
+
+template <class RECONFIG_SCHED_STRATEGY> CORBA::Double
+TAO_Tuple_Admission_Visitor<RECONFIG_SCHED_STRATEGY>::noncritical_utilization ()
+{
+ return this->noncritical_utilization_;
+}
+
+template <class RECONFIG_SCHED_STRATEGY> CORBA::Double
+TAO_Tuple_Admission_Visitor<RECONFIG_SCHED_STRATEGY>::total_critical_utilization ()
+{
+ return this->total_critical_utilization_;
+}
+
+
+// Accessor for utilization by noncritical operations.
+
+template <class RECONFIG_SCHED_STRATEGY> CORBA::Double
+TAO_Tuple_Admission_Visitor<RECONFIG_SCHED_STRATEGY>::total_noncritical_utilization ()
+{
+ return this->total_noncritical_utilization_;
+}
+
+// Accessor for utilization threshold for critical operations.
+
+template <class RECONFIG_SCHED_STRATEGY> CORBA::Double
+TAO_Tuple_Admission_Visitor<RECONFIG_SCHED_STRATEGY>::critical_utilization_threshold ()
+{
+ return this->critical_utilization_threshold_;
+}
+
+
+// Accessor for utilization by noncritical operations.
+
+template <class RECONFIG_SCHED_STRATEGY> CORBA::Double
+TAO_Tuple_Admission_Visitor<RECONFIG_SCHED_STRATEGY>::noncritical_utilization_threshold ()
+{
+ return this->noncritical_utilization_threshold_;
+}
+
+
+/////////////////////////////////////////
+// TAO_RSE_Criticality_Propagation_Visitor //
+/////////////////////////////////////////
+
+// Constructor.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+TAO_RSE_Criticality_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+TAO_RSE_Criticality_Propagation_Visitor
+ (ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP & dependency_map,
+ ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::RT_INFO_MAP & rt_info_map)
+ : TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK> (dependency_map, rt_info_map)
+{
+}
+
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_RSE_Criticality_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+pre_recurse_action (TAO_Reconfig_Scheduler_Entry &entry,
+ TAO_Reconfig_Scheduler_Entry &successor,
+ const RtecScheduler::Dependency_Info & /* di */)
+{
+#ifdef SCHEDULER_LOGGING
+ ACE_DEBUG ((LM_DEBUG,
+ "Crit Prop_Visitor visiting %s[%d], successor is %s[%d]\n",
+ entry.actual_rt_info ()->entry_point.in(),
+ entry.actual_rt_info ()->handle,
+ successor.actual_rt_info ()->entry_point.in(),
+ successor.actual_rt_info ()->handle));
+#endif
+
+ if (successor.enabled_state () != RtecScheduler::RT_INFO_DISABLED)
+ {
+ RtecScheduler::Criticality_t entry_crit =
+ entry.actual_rt_info ()->criticality;
+ RtecScheduler::Criticality_t succ_crit =
+ successor.actual_rt_info ()->criticality;
+ RtecScheduler::Criticality_t max_crit = entry_crit;
+
+ if (max_crit < succ_crit)
+ max_crit = succ_crit;
+
+ successor.actual_rt_info ()->criticality = max_crit;
+
+#ifdef SCHEDULER_LOGGING
+ ACE_DEBUG ((LM_DEBUG,
+ "Successor's new criticality is %d\n",
+ successor.actual_rt_info ()->criticality));
+#endif
+ }
+
+ // Do not recurse on the successor node, just continue to the next successor.
+ return 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_RECONFIG_SCHED_UTILS_T_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.h b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.h
new file mode 100644
index 00000000000..b66b0f389bd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils_T.h
@@ -0,0 +1,490 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Reconfig_Scheduler_Utils_T.h
+//
+// = AUTHOR
+// Chris Gill <cdgill@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_RECONFIG_SCHED_UTILS_T_H
+#define TAO_RECONFIG_SCHED_UTILS_T_H
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+#include "orbsvcs/Sched/Reconfig_Sched_Utils.h"
+#include "ace/Hash_Map_Manager.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//////////////////////////////////////////
+// Reconfig Sched Entry Visitor classes //
+//////////////////////////////////////////
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+class TAO_RSE_Dependency_Visitor :
+ public TAO_Reconfig_Sched_Entry_Visitor
+ // = TITLE
+ // A base class for scheduler entry visitors that use a
+ // dependency map to traverse a dependency graph over entries.
+ //
+ // = DESCRIPTION
+ // This class hold the maps and a constructor that
+ // derived classes may call to pass them in.
+{
+public:
+
+ typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::handle_t,
+ RtecScheduler::Dependency_Set*,
+ ACE_Hash<RtecScheduler::handle_t>,
+ ACE_Equal_To<RtecScheduler::handle_t>,
+ ACE_LOCK> DEPENDENCY_SET_MAP;
+ // Type of map used for O(1) lookup of RT_Info
+ // dependency sets by caller or called handle.
+
+ typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::handle_t,
+ TAO_RT_Info_Ex*,
+ ACE_Hash<RtecScheduler::handle_t>,
+ ACE_Equal_To<RtecScheduler::handle_t>,
+ ACE_LOCK> RT_INFO_MAP;
+ // Type of map used for O(1) lookup of RT_Infos by their handles.
+
+ TAO_RSE_Dependency_Visitor
+ (DEPENDENCY_SET_MAP & dependency_map,
+ RT_INFO_MAP & rt_info_map);
+ // Constructor.
+
+ virtual int visit (TAO_Reconfig_Scheduler_Entry &);
+ // Visit a Reconfig Scheduler Entry. This method calls
+ // protected hook methods that can be overridden by
+ // derived classes, according to the Template Method
+ // design pattern.
+
+protected:
+ /* WSOA merge - commented out
+ virtual int unconditional_action (TAO_Reconfig_Scheduler_Entry &rse);
+ // Performs an unconditional action when the entry is first reached.
+ // Returns 0 for success, and -1 if an error occurred.
+ */
+ virtual int precondition (TAO_Reconfig_Scheduler_Entry &rse);
+ // Tests whether or not any conditional actions should be taken for
+ // the entry. Returns 0 if the actions should be applied, 1 if the
+ // entry should be left alone, and -1 if an error occurred.
+
+ virtual int prefix_action (TAO_Reconfig_Scheduler_Entry &rse);
+ // Performs an action on the entry prior to visiting any of
+ // its successors. Returns 0 on success and -1 on error.
+
+ virtual int pre_recurse_action (TAO_Reconfig_Scheduler_Entry &entry,
+ TAO_Reconfig_Scheduler_Entry &successor,
+ const RtecScheduler::Dependency_Info &di);
+ // Performs an action on a successor entry prior to visiting
+ // it. Returns 0 if the successor should be visited recursively,
+ // 1 if the successor should not be visited, and -1 on error.
+
+ virtual int postfix_action (TAO_Reconfig_Scheduler_Entry &rse);
+ // Performs an action on the entry after visiting all of
+ // its successors. Returns 0 on success and -1 on error.
+
+ DEPENDENCY_SET_MAP & dependency_map_;
+ // Map of dependencies between RT_Info handles.
+
+ RT_INFO_MAP & rt_info_map_;
+ // Map of handles into RT_Infos.
+
+};
+
+
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+class TAO_RSE_DFS_Visitor :
+ public TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>
+ // = TITLE
+ // A scheduler entry visitor that marks nodes with DFS start
+ // and finish times.
+ //
+ // = DESCRIPTION
+ // This class does DFS traversal marking of each node it visits,
+ // as appropriate according to DFS state markers.
+{
+public:
+
+ TAO_RSE_DFS_Visitor
+ (ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP & dependency_map,
+ ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::RT_INFO_MAP & rt_info_map);
+ // Constructor.
+
+protected:
+ virtual int precondition (TAO_Reconfig_Scheduler_Entry &rse);
+ // Makes sure the entry has not previously been visited in forward DFS.
+ // Returns 0 if the actions should be applied, 1 if the entry
+ // should be left alone, and -1 if an error occurred.
+
+ virtual int prefix_action (TAO_Reconfig_Scheduler_Entry &rse);
+ // Marks entry as forward visited and sets its forward DFS start
+ // time, prior to visiting any of its successors. Returns 0 on
+ // success and -1 on error.
+
+ virtual int pre_recurse_action (TAO_Reconfig_Scheduler_Entry &entry,
+ TAO_Reconfig_Scheduler_Entry &successor,
+ const RtecScheduler::Dependency_Info &di);
+ // Marks whether or not successor is a thread delineator prior to
+ // visiting it. Returns 0 on success and -1 on error.
+
+ virtual int postfix_action (TAO_Reconfig_Scheduler_Entry &rse);
+ // Marks entry as forward finished and sets its forward DFS finish
+ // time, after all of its successors have been visited. Returns 0
+ // on success and -1 on error.
+
+private:
+ int DFS_time_;
+ // Keeps track of DFS start and finish times.
+
+};
+
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+class TAO_RSE_SCC_Visitor :
+ public TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>
+ // = TITLE
+ // A scheduler entry visitor that checks for cycles in the graph.
+ //
+ // = DESCRIPTION
+ // This class, when applied to nodes in the transpose of the DFS graph as
+ // ordered for the strongly connected components algorithm, will
+ // flag cycles in the graph.
+{
+public:
+
+ TAO_RSE_SCC_Visitor
+ (ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP & dependency_map,
+ ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::RT_INFO_MAP & rt_info_map);
+ // Constructor.
+
+ int number_of_cycles (void);
+ // Accessor for number of cycles detected in traversal.
+
+ int in_a_cycle (void);
+ // Accessor for whether or not the recursion is within a previously
+ // detected cycle.
+
+ void in_a_cycle (int);
+ // Mutator for whether or not the recursion is within a previously
+ // detected cycle.
+
+protected:
+ /* WSOA merge - commented out
+ virtual int unconditional_action (TAO_Reconfig_Scheduler_Entry &rse);
+ // If the entry is a thread delineator, sets its effective period and
+ // execution multiplier from the values in its corresponding RT_Info.
+ // Returns 0 for success, and -1 if an error occurred.
+ */
+
+ virtual int precondition (TAO_Reconfig_Scheduler_Entry &rse);
+ // Makes sure the entry has not previously been visited in the
+ // reverse DFS (call graph transpose) direction. Returns 0 if
+ // the actions should be applied, 1 if the entry should be left
+ // alone, and -1 if an error occurred.
+
+ virtual int prefix_action (TAO_Reconfig_Scheduler_Entry &rse);
+ // Marks reverse status as visited and sets reverse start time for
+ // entry, prior to visiting any of its successors. Returns 0 on
+ // success and -1 on error.
+
+ virtual int pre_recurse_action (TAO_Reconfig_Scheduler_Entry &entry,
+ TAO_Reconfig_Scheduler_Entry &successor,
+ const RtecScheduler::Dependency_Info &di);
+ // Checks reverse status of each successor. For any that have not
+ // been previously visited, it complains about the entry and
+ // successor being part of a cycle, stores the fact that a cycle was
+ // detected, and maintains a count of the total number of cycles
+ // (strongly connected components). Returns 0 on success and -1 on
+ // an error (finding a cycle is not considered an error, at least as
+ // far as this method is concerned).
+
+ virtual int postfix_action (TAO_Reconfig_Scheduler_Entry &rse);
+ // Sets the entry's reverse finish time and marks it as finished in
+ // the reverse DFS traversal, after visiting all of its successors.
+ // Returns 0 on success and -1 on error.
+
+private:
+ int DFS_time_;
+ // Keeps track of DFS start and finish times.
+
+ int number_of_cycles_;
+ // Keeps track of DFS start and finish times.
+
+ int in_a_cycle_;
+ // Indicates whether or not the recursion is
+ // currently within a previously discovered cycle.
+};
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+class TAO_RSE_Reverse_Propagation_Visitor :
+ public TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>
+ // = TITLE
+ // A scheduler entry visitor that propagates aggregate execution
+ // times from called to calling nodes in a topologically ordered
+ // graph.
+ //
+ // = DESCRIPTION
+ // This class computes the aggregate execution time of each node
+ // and its dependants, according to its dependencies.
+{
+public:
+
+ TAO_RSE_Reverse_Propagation_Visitor
+ (ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP & dependency_map,
+ ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::RT_INFO_MAP & rt_info_map);
+ // Constructor.
+
+protected:
+
+ virtual int pre_recurse_action (TAO_Reconfig_Scheduler_Entry &entry,
+ TAO_Reconfig_Scheduler_Entry &successor,
+ const RtecScheduler::Dependency_Info &di);
+ // Propagates aggregate execution time from successor to calling
+ // entry. Returns 1 on success (to prevent recursion on the
+ // successor), and -1 on error.
+
+};
+
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+class TAO_RSE_Forward_Propagation_Visitor :
+ public TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>
+ // = TITLE
+ // A scheduler entry visitor that propagates effective periods and
+ // execution time multipliers between nodes in a topologically
+ // ordered graph.
+ //
+ // = DESCRIPTION
+ // This class computes the effective period of each node, according to
+ // its dependencies, and the period and threads it specifies.
+{
+public:
+
+ TAO_RSE_Forward_Propagation_Visitor
+ (ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP & dependency_map,
+ ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::RT_INFO_MAP & rt_info_map);
+ // Constructor.
+
+ int unresolved_locals (void);
+ // Accessor for number of nodes with unresolved local dependencies.
+
+ void unresolved_locals (int);
+ // Mutator for numberof nodes with unresolved local dependencies.
+
+ int unresolved_remotes (void);
+ // Accessor for number of nodes with unresolved remote dependencies.
+
+ void unresolved_remotes (int);
+ // Mutator for number of nodes with unresolved remote dependencies.
+
+ int thread_specification_errors (void);
+ // Accessor for number of nodes with thread specification errors.
+
+ void thread_specification_errors (int);
+ // Mutator for number of nodes with thread specification errors.
+
+protected:
+ virtual int prefix_action (TAO_Reconfig_Scheduler_Entry &rse);
+ // Tests the entry for possibly having unresolved remote or local
+ // dependencies prior to visiting any of its successors. Returns 0
+ // on success and -1 on error (having unresolved remote or local
+ // dependencies is not considered an error, at least for this
+ // method).
+
+ virtual int pre_recurse_action (TAO_Reconfig_Scheduler_Entry &entry,
+ TAO_Reconfig_Scheduler_Entry &successor,
+ const RtecScheduler::Dependency_Info &di);
+ // Propagates effective period and execution time multiplier from
+ // entry to successor prior to visiting successor. Returns 1 on
+ // success (to prevent recursion on the successor), and -1 on error.
+
+private:
+
+ int unresolved_locals_;
+ // Number of nodes with unresolved local dependencies.
+
+ int unresolved_remotes_;
+ // Number of nodes with unresolved remote dependencies.
+
+ int thread_specification_errors_;
+ // Number of nodes with thread specification errors.
+};
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+class TAO_RSE_Priority_Visitor :
+ public TAO_Reconfig_Sched_Entry_Visitor
+ // = TITLE
+ // An entry visitor that assigns static priority and subpriority
+ // values to entries in an array already sorted in static
+ // <priority, subpriority> order.
+ //
+ // = DESCRIPTION
+ // The visitor uses the parameterized strategy type to determine
+ // priority and subpriority boundaries.
+{
+public:
+
+ TAO_RSE_Priority_Visitor (RtecScheduler::handle_t handles,
+ TAO_Reconfig_Scheduler_Entry ** entry_ptr_array);
+ // Constructor.
+
+ virtual int visit (TAO_Reconfig_Scheduler_Entry &);
+ // Visit a RT_Info tuple. This method assigns a priority and
+ // subpriority value to each tuple. Priorities are assigned in
+ // increasing value order, with lower numbers corresponding to
+ // higher priorities. Returns -1 on error, 1 if a new priority was
+ // assigned, or 0 otherwise.
+
+ int finish ();
+ // Finishes tuple priority assignment by iterating over the
+ // remaining tuples in the last subpriority level, and adjusting
+ // their subpriorities.
+
+private:
+
+ TAO_Reconfig_Scheduler_Entry *previous_entry_;
+ // Pointer to previous tuple in the iteration.
+
+ TAO_Reconfig_Scheduler_Entry **first_subpriority_entry_;
+ // Pointer to first subpriority tuple in the priority level.
+
+ RtecScheduler::Preemption_Priority_t priority_;
+ // Current priority value.
+
+ RtecScheduler::Preemption_Subpriority_t subpriority_;
+ // Current subpriority value.
+
+ RtecScheduler::OS_Priority os_priority_;
+ // Current OS (thread) priority value.
+
+ RtecScheduler::handle_t handles_;
+ // Number of handles in the entry pointer array.
+
+ TAO_Reconfig_Scheduler_Entry ** entry_ptr_array_;
+ // An array of pointers to entries we will be visiting.
+};
+
+template <class RECONFIG_SCHED_STRATEGY>
+class TAO_Tuple_Admission_Visitor :
+ public TAO_RT_Info_Tuple_Visitor
+ // = TITLE
+
+ // A tuple visitor that accumulates utilization separately for
+ // critical and non-critical operations. Operation tuples that
+ // fit within the threashold defined for their criticality level
+ // are admitted to the schedule, by updating the corresponding
+ // RT_Info with the tuple data.
+ //
+ // = DESCRIPTION
+ // The visitor uses the parameterized strategy type to determine
+ // whether or not a given operation is critical.
+{
+public:
+
+ TAO_Tuple_Admission_Visitor (const CORBA::Double & critical_utilization_threshold,
+ const CORBA::Double & noncritical_utilization_threshold);
+ // Constructor.
+
+ virtual int visit (TAO_RT_Info_Tuple &);
+ // Visit an RT_Info tuple. This method determines the utilization by
+ // the tuple, and if it's admissible, updates its RT_Info and either
+ // the critical or non-critical utilization, depending on whether or
+ // not the strategy says the operation is critical.
+
+ CORBA::Double critical_utilization ();
+ // Accessor for utilization by critical operations.
+
+ CORBA::Double noncritical_utilization ();
+ // Accessor for utilization by noncritical operations.
+
+ CORBA::Double critical_utilization_threshold ();
+ // Accessor for utilization by critical operations.
+
+ CORBA::Double noncritical_utilization_threshold ();
+ // Accessor for utilization by noncritical operations.
+
+ CORBA::Double total_critical_utilization ();
+ // Accessor for utilization by critical operations.
+
+ CORBA::Double total_noncritical_utilization ();
+ // Accessor for utilization by noncritical operations.
+
+private:
+
+ CORBA::Double critical_utilization_;
+ // Utilization by critical operations.
+
+ CORBA::Double noncritical_utilization_;
+ // Utilization by noncritical operations.
+
+ CORBA::Double total_critical_utilization_;
+ // Utilization by critical operations.
+
+ CORBA::Double total_noncritical_utilization_;
+ // Utilization by noncritical operations.
+
+ CORBA::Double critical_utilization_threshold_;
+ // Utilization by critical operations.
+
+ CORBA::Double noncritical_utilization_threshold_;
+ // Utilization by noncritical operations.
+};
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+class TAO_RSE_Criticality_Propagation_Visitor :
+ public TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>
+ // = TITLE
+ // A scheduler entry visitor that propagates criticality
+ // from called to calling nodes in a topologically ordered
+ // graph.
+ //
+ // = DESCRIPTION
+ // This class computes the criticality of each node
+ // and its dependants, according to its dependencies.
+{
+public:
+
+ TAO_RSE_Criticality_Propagation_Visitor
+ (ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP & dependency_map,
+ ACE_TYPENAME TAO_RSE_Dependency_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::RT_INFO_MAP & rt_info_map);
+ // Constructor.
+
+protected:
+
+ virtual int pre_recurse_action (TAO_Reconfig_Scheduler_Entry &entry,
+ TAO_Reconfig_Scheduler_Entry &successor,
+ const RtecScheduler::Dependency_Info &di);
+ // Propagates criticality from successor to calling
+ // entry. Returns 1 on success (to prevent recursion on the
+ // successor), and -1 on error.
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Sched/Reconfig_Sched_Utils_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Reconfig_Sched_Utils_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_RECONFIG_SCHED_UTILS_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler.h b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler.h
new file mode 100644
index 00000000000..1734634a104
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler.h
@@ -0,0 +1,38 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Reconfig_Scheduler.h
+//
+// = AUTHOR
+// Chris Gill <cdgill@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_RECONFIG_SCHEDULER_H
+#define TAO_RECONFIG_SCHEDULER_H
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+
+
+#include "ace/Hash_Map_Manager.h"
+#include "ace/RB_Tree.h"
+#include "orbsvcs/Scheduler_Factory.h"
+#include "orbsvcs/RtecSchedulerS.h"
+#include "orbsvcs/Sched/Reconfig_Sched_Utils.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+// Include the templates here.
+#include "orbsvcs/Sched/Reconfig_Scheduler_T.h"
+
+#include /**/ "ace/post.h"
+#endif /* TAO_RECONFIG_SCHEDULER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp
new file mode 100644
index 00000000000..76e925b5086
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp
@@ -0,0 +1,3218 @@
+// ============================================================================
+//
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Reconfig_Scheduler_T.cpp
+//
+// = AUTHOR
+// Chris Gill <cdgill@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_RECONFIG_SCHEDULER_T_C
+#define TAO_RECONFIG_SCHEDULER_T_C
+
+#include "orbsvcs/Sched/Reconfig_Scheduler_T.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "ace/Auto_Ptr.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//#ifdef _DEBUG
+//#define SCHEDULER_LOGGING 1
+//#endif
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//////////////////////////////////////////////
+// Helper function type definition for sort //
+//////////////////////////////////////////////
+
+// This is awkward, but it makes MSVC++ happy.
+extern "C"
+{
+typedef int (*COMP_FUNC) (const void*, const void*);
+}
+
+
+// Default constructor.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+TAO_Reconfig_Scheduler (int enforce_schedule_stability,
+ const CORBA::Double & critical_utilization_threshold,
+ const CORBA::Double & noncritical_utilization_threshold)
+ : config_info_count_ (0),
+ rt_info_count_ (0),
+ rt_info_tuple_count_ (0),
+ next_handle_ (1),
+ entry_ptr_array_ (0),
+ entry_ptr_array_size_ (0),
+ tuple_ptr_array_ (0),
+ tuple_ptr_array_size_ (0),
+ stability_flags_ (SCHED_NONE_STABLE),
+ enforce_schedule_stability_ (enforce_schedule_stability),
+ dependency_count_ (0),
+ last_scheduled_priority_ (0),
+ noncritical_utilization_ (0.0),
+ critical_utilization_ (0.0),
+ noncritical_utilization_threshold_ (noncritical_utilization_threshold),
+ critical_utilization_threshold_ (critical_utilization_threshold)
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler default ctor.\n"));
+#endif /* SCHEDULER_LOGGING */
+}
+
+// Constructor. Initialize the scheduler from the POD_Config_Info, POD_RT_Info,
+// and POD_Dependency arrays, plus stability flag.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+TAO_Reconfig_Scheduler (int config_count,
+ ACE_Scheduler_Factory::POD_Config_Info config_infos[],
+ int rt_info_count,
+ ACE_Scheduler_Factory::POD_RT_Info rt_infos[],
+ int dependency_count,
+ ACE_Scheduler_Factory::POD_Dependency_Info dependency_infos[],
+ u_long stability_flags,
+ int enforce_schedule_stability,
+ const CORBA::Double & critical_utilization_threshold,
+ const CORBA::Double & noncritical_utilization_threshold)
+ : config_info_count_ (0),
+ rt_info_count_ (0),
+ rt_info_tuple_count_ (0),
+ next_handle_ (1),
+ stability_flags_ (SCHED_ALL_STABLE),
+ enforce_schedule_stability_ (enforce_schedule_stability),
+ dependency_count_ (0),
+ last_scheduled_priority_ (0),
+ noncritical_utilization_ (0.0),
+ critical_utilization_ (0.0),
+ noncritical_utilization_threshold_ (noncritical_utilization_threshold),
+ critical_utilization_threshold_ (critical_utilization_threshold)
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler alternative ctor.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ // @ TODO - think about what it means to emit all the tuples as
+ // well as the established RT_Infos. State is more complex now.
+
+ // The init method can throw an exception, which must be caught
+ // *inside* the constructor to be portable between compilers that
+ // differ in whether they support native C++ exceptions.
+ ACE_TRY_NEW_ENV
+ {
+ this->init (config_count, config_infos,
+ rt_info_count, rt_infos,
+ dependency_count, dependency_infos,
+ stability_flags ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, corba_sysex)
+ {
+ ACE_ERROR ((LM_ERROR, "TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, "
+ "ACE_LOCK>::TAO_Reconfig_Scheduler "
+ "system exception: cannot init scheduler.\n"));
+ }
+ ACE_ENDTRY;
+}
+
+
+// Destructor.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+~TAO_Reconfig_Scheduler ()
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler dtor.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_TRY_NEW_ENV
+ {
+ this->close (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, corba_sysex)
+ {
+ ACE_ERROR ((LM_ERROR, "TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, "
+ "ACE_LOCK>::~TAO_Reconfig_Scheduler "
+ "exception: cannot close scheduler.\n"));
+ }
+ ACE_ENDTRY;
+
+ // Delete the entry and tuple pointer arrays.
+ delete [] entry_ptr_array_;
+ delete [] tuple_ptr_array_;
+}
+
+// Additive initialization: can be called multiple times, with
+// new sets of operation, dependency, and config information.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+init (int config_count,
+ ACE_Scheduler_Factory::POD_Config_Info config_info[],
+ int rt_info_count,
+ ACE_Scheduler_Factory::POD_RT_Info rt_info[],
+ int dependency_count,
+ ACE_Scheduler_Factory::POD_Dependency_Info dependency_info[],
+ u_long stability_flags
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::DUPLICATE_NAME,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::init.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK_RETURN (-1);
+
+ int result = 0;
+ int i = 0;
+
+/* WSOA merge - commented out
+ // Clear out the previous entries, if any.
+ this->close (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+*/
+
+ // Re-map the RT_Info and dependency handle values if necessary.
+ // Assumes that dependencies only refer to handles within the
+ // current set: changing that assumption would require us to use
+ // operation names, and the equivalent of a symbol table and
+ // relocating linker for RT_Infos to do this correctly in the
+ // general case.
+ if (this->next_handle_ > 1)
+ {
+ for (i = 0; i < rt_info_count; ++i)
+ {
+ rt_info [i].handle += this->next_handle_ - 1;
+ }
+ for (i = 0; i < dependency_count; ++i)
+ {
+ dependency_info [i].info_that_depends += this->next_handle_ - 1;
+ dependency_info [i].info_depended_on += this->next_handle_ - 1;
+ }
+ }
+
+ // (Re)initialize using the new settings.
+
+ // Add the passed config infos to the scheduler
+ auto_ptr<RtecScheduler::Config_Info> new_config_info_ptr;
+ for (i = 0; i < config_count; ++i)
+ {
+ RtecScheduler::Config_Info* new_config_info;
+ ACE_NEW_THROW_EX (new_config_info,
+ RtecScheduler::Config_Info,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (-1);
+
+ // Make sure the new config info is cleaned up if we exit abruptly.
+ ACE_AUTO_PTR_RESET (new_config_info_ptr, new_config_info, RtecScheduler::Config_Info);
+
+ result = config_info_map_.bind (config_info [i].preemption_priority,
+ new_config_info);
+ switch (result)
+ {
+ case -1:
+ // Something bad but unknown occurred while trying to bind in map.
+ ACE_THROW_RETURN (RtecScheduler::INTERNAL (), -1);
+
+ case 1:
+ // Tried to bind an operation that was already in the map.
+ ACE_THROW_RETURN (RtecScheduler::DUPLICATE_NAME (), -1);
+
+ default:
+ break;
+ }
+
+ new_config_info->preemption_priority =
+ config_info [i].preemption_priority;
+ new_config_info->thread_priority =
+ config_info [i].thread_priority;
+ new_config_info->dispatching_type =
+ config_info [i].dispatching_type;
+
+ if (new_config_info->preemption_priority >
+ last_scheduled_priority_)
+ {
+ this->last_scheduled_priority_ =
+ new_config_info->preemption_priority;
+ }
+
+ // Release the auto_ptr so it does not clean
+ // up the sucessfully bound config info.
+ new_config_info_ptr.release ();
+
+ // Increase the count of successfully bound config infos.
+ ++this->config_info_count_;
+ }
+
+ // Add RT_Infos to scheduler
+ TAO_RT_Info_Ex* new_rt_info;
+ for (int num_rt_infos = 0; num_rt_infos < rt_info_count; ++num_rt_infos)
+ {
+ new_rt_info = create_i (rt_info [num_rt_infos].entry_point,
+ rt_info [num_rt_infos].handle, 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (new_rt_info == 0)
+ {
+ ACE_THROW_RETURN (RtecScheduler::INTERNAL (), -1);
+ }
+
+ // Set the new info's enabled state
+ new_rt_info->enabled_state (rt_info [num_rt_infos].enabled);
+
+ // Fill in the portions to which the user has access.
+ this->set_i (new_rt_info,
+ RtecScheduler::Criticality_t (rt_info [num_rt_infos].criticality),
+ rt_info [num_rt_infos].worst_case_execution_time,
+ rt_info [num_rt_infos].typical_execution_time,
+ rt_info [num_rt_infos].cached_execution_time,
+ rt_info [num_rt_infos].period,
+ RtecScheduler::Importance_t (rt_info [num_rt_infos].importance),
+ rt_info [num_rt_infos].quantum,
+ rt_info [num_rt_infos].threads,
+ RtecScheduler::Info_Type_t (rt_info [num_rt_infos].info_type)
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Fill in the scheduler managed portions.
+ new_rt_info->priority =
+ rt_info [num_rt_infos].priority;
+ new_rt_info->preemption_subpriority =
+ rt_info [num_rt_infos].static_subpriority;
+ new_rt_info->preemption_priority =
+ rt_info [num_rt_infos].preemption_priority;
+ new_rt_info->volatile_token = 0;
+
+ // Add dependencies between RT_Infos to scheduler.
+ for (i = 0; i < dependency_count; ++i)
+ {
+ add_dependency_i (dependency_info [dependency_count_].info_that_depends,
+ dependency_info [dependency_count_].info_depended_on,
+ dependency_info [dependency_count_].number_of_calls,
+ dependency_info [dependency_count_].dependency_type,
+ dependency_info [dependency_count_].enabled
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ++this->dependency_count_;
+ }
+
+ }
+
+ // Set stability flags after the operations are loaded, as the passed flags
+ // should be respected as being the stability state of the passed schedule.
+ this->stability_flags_ = stability_flags;
+
+ return result;
+}
+
+// Closes the scheduler, releasing all current resources.
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::close (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::close.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ // Unbind and delete each RT_Info in the map: this also cleans up
+ // all the entries and tuples associated with each RT_Info.
+ TAO_RT_Info_Ex *rt_info = 0;
+ RtecScheduler::handle_t handle;
+ while (rt_info_map_.current_size () > 0)
+ {
+ handle = (*rt_info_map_.begin ()).ext_id_;
+ if (rt_info_map_.unbind (handle, rt_info) == 0)
+ {
+ if (rt_info_tree_.unbind (rt_info->entry_point) == 0)
+ {
+ // Delete the entry associated with the RT_Info, then
+ // the RT_Info itself.
+ delete ACE_LONGLONG_TO_PTR (TAO_Reconfig_Scheduler_Entry *,
+ rt_info->volatile_token);
+ delete rt_info;
+ }
+ else
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+ else
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+ }
+
+ // Delete each Config_Info in the map.
+ RtecScheduler::Preemption_Priority_t config_priority;
+ RtecScheduler::Config_Info *config_info = 0;
+ while (config_info_map_.current_size () > 0)
+ {
+ config_priority = (*config_info_map_.begin ()).ext_id_;
+ if (config_info_map_.unbind (config_priority, config_info) == 0)
+ {
+ delete config_info;
+ }
+ else
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+
+ // Delete each dependency set in the caller map
+ RtecScheduler::Dependency_Set *dependency_set = 0;
+ while (calling_dependency_set_map_.current_size () > 0)
+ {
+ handle = (*calling_dependency_set_map_.begin ()).ext_id_;
+ if (calling_dependency_set_map_.unbind (handle, dependency_set) == 0)
+ {
+ delete dependency_set;
+ }
+ else
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+
+ // Delete each dependency set in the called map
+ while (called_dependency_set_map_.current_size () > 0)
+ {
+ handle = (*called_dependency_set_map_.begin ()).ext_id_;
+ if (called_dependency_set_map_.unbind (handle, dependency_set) == 0)
+ {
+ delete dependency_set;
+ }
+ else
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+
+ // Zero out the scheduling entry pointer array but do not deallocate it.
+ if (entry_ptr_array_size_ > 0)
+ {
+ ACE_OS::memset (this->entry_ptr_array_, 0,
+ sizeof (TAO_Reconfig_Scheduler_Entry *)
+ * this->entry_ptr_array_size_);
+ }
+
+ // Zero out the scheduling entry pointer array but do not deallocate it.
+ if (tuple_ptr_array_size_ > 0)
+ {
+ ACE_OS::memset (this->tuple_ptr_array_, 0,
+ sizeof (TAO_RT_Info_Tuple *)
+ * this->tuple_ptr_array_size_);
+ }
+
+ // Finally, reset the entry counts and start over with the lowest
+ // handle number.
+ this->config_info_count_ = 0;
+ this->rt_info_count_ = 0;
+ this->rt_info_tuple_count_ = 0;
+ this->next_handle_ = 1;
+}
+
+// Create an RT_Info. If it does not exist, a new RT_Info is
+// created and inserted into the schedule, and the handle of the new
+// RT_Info is returned. If the RT_Info already exists, an exception
+// is thrown.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+RtecScheduler::handle_t
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+create (const char *entry_point
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::DUPLICATE_NAME,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::create.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK_RETURN (0);
+
+ RtecScheduler::handle_t handle = next_handle_;
+ create_i (entry_point, handle, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (handle);
+
+ // Set affected stability flags.
+ this->stability_flags_ |=
+ SCHED_UTILIZATION_NOT_STABLE |
+ SCHED_PRIORITY_NOT_STABLE;
+
+ return handle;
+}
+
+// Lookup a handle for an RT_Info, and return its handle, or an error
+// value if it's not present.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+RtecScheduler::handle_t
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+lookup (const char * entry_point
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::lookup.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK_RETURN (0);
+
+ RtecScheduler::handle_t handle;
+ handle = this->lookup_i (entry_point ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (handle);
+
+ return handle;
+}
+
+
+// Return a pointer to the RT_Info corresponding to the passed handle.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+RtecScheduler::RT_Info *
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+get (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::get.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK_RETURN (0);
+
+ // Find the RT_Info in the hash map.
+ TAO_RT_Info_Ex *rt_info = 0;
+ if (rt_info_map_.find (handle, rt_info) != 0)
+ {
+ ACE_THROW_RETURN (RtecScheduler::UNKNOWN_TASK (), 0);
+ }
+
+ // Allocate a new RT_Info
+ RtecScheduler::RT_Info* new_info;
+ ACE_NEW_THROW_EX (new_info,
+ RtecScheduler::RT_Info,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ *new_info = *rt_info;
+
+ return new_info;
+}
+
+
+// Set characteristics of the RT_Info corresponding to the passed handle.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+set (::RtecScheduler::handle_t handle,
+ ::RtecScheduler::Criticality_t criticality,
+ ::RtecScheduler::Time time,
+ ::RtecScheduler::Time typical_time,
+ ::RtecScheduler::Time cached_time,
+ ::RtecScheduler::Period_t period,
+ ::RtecScheduler::Importance_t importance,
+ ::RtecScheduler::Quantum_t quantum,
+ ::RtecScheduler::Threads_t threads,
+ ::RtecScheduler::Info_Type_t info_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::set.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ // Look up the RT_Info by its handle, throw an exception if it's not there.
+ TAO_RT_Info_Ex *rt_info_ptr = 0;
+ if (rt_info_map_.find (handle, rt_info_ptr) != 0)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+
+ if (rt_info_ptr == 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+
+ // Enable the RT_Info if it was disabled. Does not modify NON_VOLATILE ops.
+ if (rt_info_ptr->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ rt_info_ptr->enabled_state (RtecScheduler::RT_INFO_ENABLED);
+ }
+
+ // Call the internal set method.
+ this->set_i (rt_info_ptr, criticality, time, typical_time,
+ cached_time, period, importance, quantum,
+ threads, info_type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+
+ // Update stability flags. For now, just mark everything as unstable.
+ // @@ TODO - revisit this and see if we can efficiently detect when
+ // changes do not affect stability of various aspects.
+ this->stability_flags_ |= SCHED_UTILIZATION_NOT_STABLE;
+ this->stability_flags_ |= SCHED_PRIORITY_NOT_STABLE;
+ this->stability_flags_ |= SCHED_PROPAGATION_NOT_STABLE;
+
+ return;
+}
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+reset (RtecScheduler::handle_t handle,
+ RtecScheduler::Criticality_t criticality,
+ RtecScheduler::Time time,
+ RtecScheduler::Time typical_time,
+ RtecScheduler::Time cached_time,
+ RtecScheduler::Period_t period,
+ RtecScheduler::Importance_t importance,
+ RtecScheduler::Quantum_t quantum,
+ CORBA::Long threads,
+ RtecScheduler::Info_Type_t info_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::reset.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ // Look up the RT_Info by its handle, throw an exception if it's not there.
+ TAO_RT_Info_Ex *rt_info_ptr = 0;
+ if (rt_info_map_.find (handle, rt_info_ptr) != 0)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+ if (rt_info_ptr == 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+
+ // Enable the RT_Info if it was disabled. Does not modify NON_VOLATILE ops.
+ if (rt_info_ptr->enabled_state () == RtecScheduler::RT_INFO_NON_VOLATILE)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+ else
+ {
+ // Reset the RT_Info.
+ rt_info_ptr->reset (TAO_Reconfig_Scheduler_Entry::ORIGINAL
+ | TAO_Reconfig_Scheduler_Entry::PROPAGATED);
+
+ rt_info_ptr->enabled_state (RtecScheduler::RT_INFO_ENABLED);
+ }
+
+ // Refresh the internal tuple pointer array.
+ this->refresh_tuple_ptr_array_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Then call the internal set method.
+ this->set_i (rt_info_ptr, criticality, time, typical_time,
+ cached_time, period, importance, quantum,
+ threads, info_type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+
+ // Update stability flags. For now, just mark everything as unstable.
+ // @@ TODO - revisit this and see if we can efficiently detect when
+ // changes do not affect stability of various aspects.
+ this->stability_flags_ |= SCHED_UTILIZATION_NOT_STABLE;
+ this->stability_flags_ |= SCHED_PRIORITY_NOT_STABLE;
+ this->stability_flags_ |= SCHED_PROPAGATION_NOT_STABLE;
+
+ return;
+}
+
+
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+set_seq (const RtecScheduler::RT_Info_Set& infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::set_seq.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ for (u_int i = 0; i < infos.length (); ++i)
+ {
+ // Look up the RT_Info by its handle, throw an exception if it's not there.
+ TAO_RT_Info_Ex *rt_info_ptr = 0;
+ if (rt_info_map_.find (infos[i].handle, rt_info_ptr) != 0)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+
+ if (rt_info_ptr == 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+
+ // Enable the RT_Info if it was disabled. Does not modify NON_VOLATILE ops.
+ if (rt_info_ptr->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ rt_info_ptr->enabled_state (RtecScheduler::RT_INFO_ENABLED);
+ }
+
+#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x582) && defined (NDEBUG)
+ // BCB2006 and BCB6 get an internal backend error when building this
+ // code in release mode, reported to Borland as QC27961
+ // Call the internal set method.
+ RtecScheduler::RT_Info info = infos[i];
+
+ this->set_i (rt_info_ptr,
+ info.criticality,
+ info.worst_case_execution_time,
+ info.typical_execution_time,
+ info.cached_execution_time,
+ info.period,
+ info.importance,
+ info.quantum,
+ info.threads,
+ info.info_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#else
+ this->set_i (rt_info_ptr,
+ infos[i].criticality,
+ infos[i].worst_case_execution_time,
+ infos[i].typical_execution_time,
+ infos[i].cached_execution_time,
+ infos[i].period,
+ infos[i].importance,
+ infos[i].quantum,
+ infos[i].threads,
+ infos[i].info_type
+ ACE_ENV_ARG_PARAMETER);
+#endif
+ }
+
+ // Update stability flags. For now, just mark everything as unstable.
+ // @@ TODO - revisit this and see if we can efficiently detect when
+ // changes do not affect stability of various aspects.
+ this->stability_flags_ |= SCHED_UTILIZATION_NOT_STABLE;
+ this->stability_flags_ |= SCHED_PRIORITY_NOT_STABLE;
+ this->stability_flags_ |= SCHED_PROPAGATION_NOT_STABLE;
+
+ return;
+}
+
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+reset_seq (const RtecScheduler::RT_Info_Set& infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::reset_seq.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ TAO_RT_Info_Ex *rt_info_ptr = 0;
+ u_int i;
+
+ for (i = 0; i < infos.length (); ++i)
+ {
+ // Look up the RT_Info by its handle, throw an exception if it's not there.
+ if (rt_info_map_.find (infos[i].handle, rt_info_ptr) != 0)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+
+ // Enable the RT_Info. Does not modify NON_VOLATILE ops.
+ if (rt_info_ptr->enabled_state () == RtecScheduler::RT_INFO_NON_VOLATILE)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+ else
+ {
+ // Reset the RT_Info.
+ rt_info_ptr->reset (TAO_Reconfig_Scheduler_Entry::ORIGINAL
+ | TAO_Reconfig_Scheduler_Entry::PROPAGATED);
+
+ rt_info_ptr->enabled_state (RtecScheduler::RT_INFO_ENABLED);
+ }
+ }
+
+ // Refresh the internal tuple pointer array.
+ this->refresh_tuple_ptr_array_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ for (i = 0; i < infos.length (); ++i)
+ {
+ // Look up the RT_Info by its handle, throw an exception if it's not there.
+ if (rt_info_map_.find (infos[i].handle, rt_info_ptr) != 0)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+
+ if (rt_info_ptr == 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+
+#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x582) && defined (NDEBUG)
+ // BCB2006 and BCB6 get an internal backend error when building this
+ // code in release mode, reported to Borland as QC27961
+ // Call the internal set method.
+ RtecScheduler::RT_Info info = infos[i];
+
+ // Call the internal set method.
+ this->set_i (rt_info_ptr,
+ info.criticality,
+ info.worst_case_execution_time,
+ info.typical_execution_time,
+ info.cached_execution_time,
+ info.period,
+ info.importance,
+ info.quantum,
+ info.threads,
+ info.info_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#else
+ // Call the internal set method.
+ this->set_i (rt_info_ptr,
+ infos[i].criticality,
+ infos[i].worst_case_execution_time,
+ infos[i].typical_execution_time,
+ infos[i].cached_execution_time,
+ infos[i].period,
+ infos[i].importance,
+ infos[i].quantum,
+ infos[i].threads,
+ infos[i].info_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#endif
+ }
+
+ // Update stability flags. For now, just mark everything as unstable.
+ // @@ TODO - revisit this and see if we can efficiently detect when
+ // changes do not affect stability of various aspects.
+ this->stability_flags_ |= SCHED_UTILIZATION_NOT_STABLE;
+ this->stability_flags_ |= SCHED_PRIORITY_NOT_STABLE;
+ this->stability_flags_ |= SCHED_PROPAGATION_NOT_STABLE;
+
+ return;
+}
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+replace_seq (const RtecScheduler::RT_Info_Set& infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::replace_seq.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ TAO_RT_Info_Ex *rt_info_ptr = 0;
+
+ for (ACE_TYPENAME RT_INFO_MAP::iterator info_iter (this->rt_info_map_);
+ info_iter.done () == 0;
+ ++info_iter)
+ {
+ // Get a pointer to each registered RT_Info.
+ rt_info_ptr = (*info_iter).int_id_;
+ if (! rt_info_ptr)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+
+ switch (rt_info_ptr->enabled_state ())
+ {
+ case RtecScheduler::RT_INFO_ENABLED:
+
+ // Disable enabled RT_Infos.
+ rt_info_ptr->enabled_state (RtecScheduler::RT_INFO_DISABLED);
+
+ // Reset Enabled and Non-Volatile RT_Infos.
+ rt_info_ptr->reset (TAO_Reconfig_Scheduler_Entry::ORIGINAL
+ | TAO_Reconfig_Scheduler_Entry::PROPAGATED);
+ break;
+
+ // Intentional fall-through to ignore non-volatile RT_Infos
+ case RtecScheduler::RT_INFO_NON_VOLATILE:
+
+ default: // Ignore disabled RT_Infos.
+ break;
+ }
+ }
+
+ // Zero out the tuple pointer array, set count to zero
+ ACE_OS::memset (this->tuple_ptr_array_, 0,
+ sizeof (TAO_RT_Info_Tuple *)
+ * this->tuple_ptr_array_size_);
+ this->rt_info_tuple_count_ = 0;
+
+ for (u_int i = 0; i < infos.length (); ++i)
+ {
+ // Look up the RT_Info by its handle, throw an exception if it's not there.
+ if (rt_info_map_.find (infos[i].handle, rt_info_ptr) != 0)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+
+ if (rt_info_ptr == 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+
+ // Enable the RT_Info if it was disabled. Does not modify NON_VOLATILE ops.
+ if (rt_info_ptr->enabled_state () == RtecScheduler::RT_INFO_DISABLED)
+ {
+ rt_info_ptr->enabled_state (RtecScheduler::RT_INFO_ENABLED);
+ }
+
+#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x582) && defined (NDEBUG)
+ // BCB2006 and BCB6 get an internal backend error when building this
+ // code in release mode, reported to Borland as QC27961
+ // Call the internal set method.
+ RtecScheduler::RT_Info info = infos[i];
+
+ // Call the internal set method.
+ this->set_i (rt_info_ptr,
+ info.criticality,
+ info.worst_case_execution_time,
+ info.typical_execution_time,
+ info.cached_execution_time,
+ info.period,
+ info.importance,
+ info.quantum,
+ info.threads,
+ info.info_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#else
+ // Call the internal set method.
+ this->set_i (rt_info_ptr,
+ infos[i].criticality,
+ infos[i].worst_case_execution_time,
+ infos[i].typical_execution_time,
+ infos[i].cached_execution_time,
+ infos[i].period,
+ infos[i].importance,
+ infos[i].quantum,
+ infos[i].threads,
+ infos[i].info_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#endif
+ }
+
+ // Update stability flags. For now, just mark everything as unstable.
+ // @@ TODO - revisit this and see if we can efficiently detect when
+ // changes do not affect stability of various aspects.
+ this->stability_flags_ |= SCHED_UTILIZATION_NOT_STABLE;
+ this->stability_flags_ |= SCHED_PRIORITY_NOT_STABLE;
+ this->stability_flags_ |= SCHED_PROPAGATION_NOT_STABLE;
+
+ return;
+}
+
+
+// Returns the priority and subpriority values assigned to an RT_Info,
+// based on its handle.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+priority (RtecScheduler::handle_t handle,
+ RtecScheduler::OS_Priority& o_priority,
+ RtecScheduler::Preemption_Subpriority_t& subpriority,
+ RtecScheduler::Preemption_Priority_t& p_priority
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::NOT_SCHEDULED))
+{
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ // Check stability flags.
+ if ((this->stability_flags_ & SCHED_PRIORITY_NOT_STABLE)
+ && this->enforce_schedule_stability_)
+ {
+ ACE_THROW (RtecScheduler::NOT_SCHEDULED ());
+ }
+
+ // CDG - TBD - address priority "generations" i.e., after an
+ // adaptive transition. For now, go ahead and return whatever
+ // priority is there, even if the RT_Info_Ex is disabled.
+
+ TAO_RT_Info_Ex *rt_info = 0;
+ if (rt_info_map_.find (handle, rt_info) != 0)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+
+ o_priority = rt_info->priority;
+ subpriority = rt_info->preemption_subpriority;
+ p_priority = rt_info->preemption_priority;
+}
+
+
+// Returns the priority and subpriority values assigned to an RT_Info,
+// based on its entry point name.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+entry_point_priority (const char * entry_point,
+ RtecScheduler::OS_Priority& priority,
+ RtecScheduler::Preemption_Subpriority_t& subpriority,
+ RtecScheduler::Preemption_Priority_t& p_priority
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::NOT_SCHEDULED))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::entry_point_priority.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ RtecScheduler::handle_t handle =
+ this->lookup_i (entry_point ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->priority_i (handle,
+ priority,
+ subpriority,
+ p_priority
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+// This method registers a dependency between two RT_Infos.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+add_dependency (RtecScheduler::handle_t handle /* RT_Info that has the dependency */,
+ RtecScheduler::handle_t dependency /* RT_Info on which it depends */,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::add_dependency.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ // Delegate to the internal method.
+ add_dependency_i (handle, dependency, number_of_calls, dependency_type,
+ RtecBase::DEPENDENCY_ENABLED ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Since the call graph topology has changed, set *all*
+ // stability flags before incrementing the dependency count.
+ this->stability_flags_ |= SCHED_UTILIZATION_NOT_STABLE;
+ ++dependency_count_;
+}
+
+
+// This method removes a dependency between two RT_Infos.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+remove_dependency (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::remove_dependency.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ // Delegate to the internal method.
+ remove_dependency_i (handle, dependency, number_of_calls,
+ dependency_type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Since the call graph topology has changed, set *all*
+ // stability flags before incrementing the dependency count.
+ this->stability_flags_ |= SCHED_UTILIZATION_NOT_STABLE;
+ --dependency_count_;
+}
+
+// This method sets the enable state for a dependency between two RT_Infos.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+set_dependency_enable_state (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type,
+ RtecScheduler::Dependency_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::set_dependency_enable_state.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ // Delegate to the internal method.
+ set_dependency_enable_state_i (handle, dependency, number_of_calls,
+ dependency_type, enabled ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+// This method sets the enable state of a sequence of dependencies.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+set_dependency_enable_state_seq (const RtecScheduler::Dependency_Set & dependencies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::set_dependency_enable_state_seq.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ // Delegate to the internal method for each dependency in the sequence.
+ for (u_int i = 0; i < dependencies.length (); ++i)
+ {
+ set_dependency_enable_state_i (dependencies[i].rt_info,
+ dependencies[i].rt_info_depended_on,
+ dependencies[i].number_of_calls,
+ dependencies[i].dependency_type,
+ dependencies[i].enabled
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+
+// This method enables or disables an RT_Info.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+set_rt_info_enable_state (RtecScheduler::handle_t handle,
+ RtecScheduler::RT_Info_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::set_rt_info_enable_state.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ // Look up the RT_Info by its handle, throw an exception if it's not there.
+ TAO_RT_Info_Ex *rt_info_ptr = 0;
+ if (rt_info_map_.find (handle, rt_info_ptr) != 0)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+
+ if (rt_info_ptr == 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+
+ // Enable the RT_Info.
+ rt_info_ptr->enabled_state (enabled);
+}
+
+
+// This method enables or disables a sequence of RT_Infos.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+set_rt_info_enable_state_seq (const RtecScheduler::RT_Info_Enable_State_Pair_Set & pair_set
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::set_rt_info_enable_state_seq.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ for (u_int i = 0; i < pair_set.length (); ++i)
+ {
+ // Look up the RT_Info by its handle, throw an exception if it's not there.
+ TAO_RT_Info_Ex *rt_info_ptr = 0;
+ if (rt_info_map_.find (pair_set[i].handle, rt_info_ptr) != 0)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+
+ if (rt_info_ptr == 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+
+ // Enable the RT_Info.
+ rt_info_ptr->enabled_state (pair_set[i].enabled);
+ }
+}
+
+
+// If information has been added or changed since the last stable
+// schedule was computed, this method causes scheduling information
+// to be computed for all registered RT_Infos. If the schedule is
+// already stable, this is a no-op
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+compute_scheduling (CORBA::Long minimum_priority,
+ CORBA::Long maximum_priority,
+ RtecScheduler::RT_Info_Set_out infos,
+ RtecScheduler::Dependency_Set_out dependencies,
+ RtecScheduler::Config_Info_Set_out configs,
+ RtecScheduler::Scheduling_Anomaly_Set_out anomalies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UTILIZATION_BOUND_EXCEEDED,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS,
+ RtecScheduler::TASK_COUNT_MISMATCH,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::DUPLICATE_NAME))
+{
+ // Delegates to recompute_scheduling and the respective accessors.
+ this->recompute_scheduling (minimum_priority, maximum_priority,
+ anomalies ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->get_rt_info_set (infos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->get_dependency_set (dependencies ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->get_config_info_set (configs ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+#if defined (SCHEDULER_DUMP)
+ ACE_DEBUG ((LM_TRACE, "Schedule prepared.\n"));
+ ACE_DEBUG ((LM_TRACE, "Dumping to stdout.\n"));
+ ACE_Scheduler_Factory::dump_schedule (*(infos.ptr()), *(dependencies.ptr()), *(configs.ptr()),
+ *(anomalies.ptr()), 0);
+ ACE_DEBUG ((LM_TRACE, "Dump done.\n"));
+#endif // SCHEDULER_DUMP
+
+ return;
+}
+
+// Recomputes the scheduling priorities, etc.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+recompute_scheduling (CORBA::Long /* minimum_priority */,
+ CORBA::Long /* maximum_priority */,
+ RtecScheduler::Scheduling_Anomaly_Set_out anomalies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UTILIZATION_BOUND_EXCEEDED,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS,
+ RtecScheduler::TASK_COUNT_MISMATCH,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::DUPLICATE_NAME))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::compute_scheduling.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ // @@ TO DO - use these to establish the bounds of priority assignment.
+ // minimum_priority
+ // maximum_priority
+
+ // If everything is already up to date, we're done.
+ if (SCHED_ALL_STABLE == stability_flags_)
+ {
+
+ // Must always provide a value for an out parameter
+ ACE_NEW_THROW_EX (anomalies,
+ RtecScheduler::Scheduling_Anomaly_Set (0),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ return;
+ }
+
+ // @@ TO DO - use try/catch blocks to catch exceptions and add anomalies
+ // to scheduling anomaly set, and then perhaps rethrow)
+
+ if ((this->stability_flags_ & SCHED_PROPAGATION_NOT_STABLE)
+ || (this->stability_flags_ & SCHED_UTILIZATION_NOT_STABLE))
+ {
+
+#if defined (SCHEDULER_LOGGING)
+ ACE_Scheduler_Factory::log_scheduling_entries(entry_ptr_array_,
+ this->rt_info_count_,
+ "1_pre_crit_traverse.txt");
+#endif
+
+ // Traverse criticality dependency graph, assigning a
+ // topological ordering and identifying threads.
+ crit_dfs_traverse_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+#if defined (SCHEDULER_LOGGING)
+ ACE_Scheduler_Factory::log_scheduling_entries(entry_ptr_array_,
+ this->rt_info_count_,
+ "2_crit_dfs_traverse_i.txt");
+#endif
+
+ // Propagate criticalities.
+ propagate_criticalities_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+#if defined (SCHEDULER_LOGGING)
+ ACE_Scheduler_Factory::log_scheduling_entries(entry_ptr_array_,
+ this->rt_info_count_,
+ "3_propagate_criticalities_i.txt");
+#endif
+
+#if defined (SCHEDULER_LOGGING)
+ ACE_Scheduler_Factory::log_scheduling_entries(entry_ptr_array_,
+ this->rt_info_count_,
+ "4_pre_traverse.txt");
+#endif
+
+ // Traverse dependency graph, assigning a topological ordering and identifying threads.
+ dfs_traverse_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+#if defined (SCHEDULER_LOGGING)
+ ACE_Scheduler_Factory::log_scheduling_entries(entry_ptr_array_,
+ this->rt_info_count_,
+ "5_dfs_traverse_i.txt");
+#endif
+
+ // Sort an array of RT_info handles in topological order, check
+ // for loops using the strongly connected components algorithm.
+ detect_cycles_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+#if defined (SCHEDULER_LOGGING)
+ ACE_Scheduler_Factory::log_scheduling_entries(entry_ptr_array_,
+ this->rt_info_count_,
+ "6_detect_cycles_i.txt");
+#endif
+
+ // Perform admission control for task delineator rate tuples.
+ perform_admission_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+#if defined (SCHEDULER_LOGGING)
+ ACE_Scheduler_Factory::log_scheduling_entries(entry_ptr_array_,
+ this->rt_info_count_,
+ "7_perform_admission_i.txt");
+#endif
+
+ // Propagate effective execution time and period, set total frame size.
+ propagate_characteristics_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+#if defined (SCHEDULER_LOGGING)
+ ACE_Scheduler_Factory::log_scheduling_entries(entry_ptr_array_,
+ this->rt_info_count_,
+ "8_propagate_characteristics_i.txt");
+#endif
+
+ }
+
+ if (this->stability_flags_ & SCHED_PRIORITY_NOT_STABLE)
+ {
+ // Sort operations by urgency, then assign priorities and
+ // subpriorities in one pass. Sets last scheduled priority and
+ // last feasible priority.
+ assign_priorities_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+#if defined (SCHEDULER_LOGGING)
+ ACE_Scheduler_Factory::log_scheduling_entries(entry_ptr_array_,
+ this->rt_info_count_,
+ "9_assign_priorities_i.txt");
+#endif
+
+ }
+
+ // @@ TODO: record any scheduling anomalies in a set within the scheduler,
+ // storing the maximum severity level recorded so far.
+ if (anomalies.ptr () == 0)
+ {
+ ACE_NEW_THROW_EX (anomalies,
+ RtecScheduler::Scheduling_Anomaly_Set (0),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "cutil = %f, ncutil = %f\n",
+ this->critical_utilization_,
+ this->noncritical_utilization_));
+
+ if (this->critical_utilization_ > critical_utilization_threshold_ ||
+ this->noncritical_utilization_ > noncritical_utilization_threshold_)
+ {
+ CORBA::ULong len = anomalies->length ();
+ anomalies->length (len + 1);
+ anomalies[len].description = CORBA::string_dup("Utilization Bound exceeded");
+ anomalies[len].severity = RtecScheduler::ANOMALY_ERROR;
+ }
+
+ // Set stability flags last.
+ this->stability_flags_ = SCHED_ALL_STABLE;
+ return;
+}
+
+
+// Returns the set of rt_infos, with their assigned priorities (as
+// of the last schedule re-computation).
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+get_rt_info_set (RtecScheduler::RT_Info_Set_out infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL))
+{
+ // return the set of scheduled RT_Infos
+
+ if (infos.ptr () == 0)
+ {
+ ACE_NEW_THROW_EX (infos,
+ RtecScheduler::RT_Info_Set (this->rt_info_count_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ }
+
+ infos->length (this->rt_info_count_);
+ TAO_RT_Info_Ex* rt_info = 0;
+ for (ACE_TYPENAME RT_INFO_MAP::iterator info_iter (this->rt_info_map_);
+ info_iter.done () == 0;
+ ++info_iter)
+ {
+ // TODO - rethink this: is it more useful to only return the *enabled* RT_Infos?
+ rt_info = (*info_iter).int_id_;
+ infos[static_cast<CORBA::ULong> (rt_info->handle - 1)] = *rt_info;
+ }
+
+ return;
+}
+
+
+// Returns the set of rt_infos, with their assigned priorities (as
+// of the last schedule re-computation).
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+get_dependency_set (RtecScheduler::Dependency_Set_out dependencies
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL))
+{
+ // Return the set of dependencies: just need to iterate over one of the maps.
+
+ if (dependencies.ptr () == 0)
+ {
+ dependencies = new RtecScheduler::Dependency_Set (this->dependency_count_);
+ }
+ dependencies->length (this->dependency_count_);
+ RtecScheduler::Dependency_Set *dependency_set = 0;
+ int i = 0;
+ for (ACE_TYPENAME DEPENDENCY_SET_MAP::iterator
+ dependency_iter (this->called_dependency_set_map_);
+ dependency_iter.done () == 0 && i < this->dependency_count_;
+ ++dependency_iter)
+ {
+ dependency_set = (*dependency_iter).int_id_;
+ for (u_int j = 0;
+ j < dependency_set->length () && i < this->dependency_count_;
+ ++i, ++j)
+ {
+ (* dependencies) [i] = (*dependency_set) [j];
+ // For two-way calls, swap the handles (stored in reverse order in the called map)
+ if ((* dependencies) [i].dependency_type == RtecBase::TWO_WAY_CALL)
+ {
+ (* dependencies) [i].rt_info = (* dependency_set) [j].rt_info_depended_on;
+ (* dependencies) [i].rt_info_depended_on = (* dependency_set) [j].rt_info;
+ }
+ }
+ }
+
+ return;
+}
+
+
+// Returns the set of config_infos, describing the appropriate
+// number, types, and priority levels for the dispatching lanes.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+get_config_info_set (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL))
+{
+ // Return the set of scheduled Config_Infos.
+
+ if (configs.ptr () == 0)
+ {
+ ACE_NEW_THROW_EX (configs,
+ RtecScheduler::Config_Info_Set(this->
+ config_info_count_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ }
+
+ configs->length (this->config_info_count_);
+ RtecScheduler::Config_Info* config_info = 0;
+ for (ACE_TYPENAME CONFIG_INFO_MAP::iterator config_iter (this->config_info_map_);
+ config_iter.done () == 0;
+ ++config_iter)
+ {
+ config_info = (*config_iter).int_id_;
+ configs[static_cast<CORBA::ULong> (config_info->preemption_priority)] = *config_info;
+ }
+
+ return;
+}
+
+
+// Provides the thread priority and queue type for the given priority
+// level.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+dispatch_configuration (RtecScheduler::Preemption_Priority_t p_priority,
+ RtecScheduler::OS_Priority& t_priority,
+ RtecScheduler::Dispatching_Type_t & d_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::NOT_SCHEDULED,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_PRIORITY_LEVEL))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::dispatch_configuration.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ // Check stability flags
+ if ((this->stability_flags_ & SCHED_PRIORITY_NOT_STABLE)
+ && this->enforce_schedule_stability_)
+ {
+ ACE_THROW (RtecScheduler::NOT_SCHEDULED ());
+ }
+
+ RtecScheduler::Config_Info *config_info = 0;
+ if (config_info_map_.find (p_priority, config_info) != 0)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_PRIORITY_LEVEL());
+ }
+
+ t_priority = config_info->thread_priority;
+ d_type = config_info->dispatching_type;
+}
+
+
+// Returns the last priority number assigned to an operation in the
+// schedule. The number returned is one less than the total number
+// of scheduled priorities. All scheduled priorities range from 0
+// to the number returned, inclusive.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+RtecScheduler::Preemption_Priority_t
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+last_scheduled_priority (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::NOT_SCHEDULED))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::last_scheduled_priority.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK_RETURN (0);
+
+ // Check schedule stability flags.
+ if ((this->stability_flags_ & SCHED_PRIORITY_NOT_STABLE)
+ && this->enforce_schedule_stability_)
+ {
+ ACE_THROW_RETURN (RtecScheduler::NOT_SCHEDULED (),
+ (RtecScheduler::Preemption_Priority_t) -1);
+ }
+
+ return last_scheduled_priority_;
+}
+
+// Provides the set of Config_Infos associated with the current schedule.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+get_config_infos (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::NOT_SCHEDULED))
+{
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK;
+
+ // Check schedule stability flags.
+ if ((this->stability_flags_ & SCHED_PRIORITY_NOT_STABLE)
+ && this->enforce_schedule_stability_)
+ {
+ ACE_THROW (RtecScheduler::NOT_SCHEDULED ());
+ }
+
+ // return the set of Config_Infos
+ if (configs.ptr () == 0)
+ {
+ ACE_NEW_THROW_EX (configs,
+ RtecScheduler::Config_Info_Set(this->
+ config_info_count_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ }
+ configs->length (this->config_info_count_);
+ RtecScheduler::Config_Info* config_info = 0;
+ for (ACE_TYPENAME CONFIG_INFO_MAP::iterator config_iter (this->config_info_map_);
+ config_iter.done () == 0;
+ ++config_iter)
+ {
+ config_info = (*config_iter).int_id_;
+ configs[static_cast<CORBA::ULong> (config_info->preemption_priority)] = *config_info;
+ }
+}
+
+
+// Internal method to create an RT_Info. If it does not exist, a new
+// RT_Info is created and inserted into the schedule, and the handle
+// of the new RT_Info is returned. If the RT_Info already exists,
+// then if the ignore_duplicates flag is set, the handle is simply
+// returned; otherwise, an exception is thrown.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+TAO_RT_Info_Ex *
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+create_i (const char *entry_point,
+ RtecScheduler::handle_t handle,
+ int ignore_duplicates
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::DUPLICATE_NAME,
+ RtecScheduler::INTERNAL))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::create_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ TAO_RT_Info_Ex* new_rt_info = 0;
+ TAO_Reconfig_Scheduler_Entry* new_sched_entry = 0;
+ int result = 0;
+
+ // If we're ignoring duplicates, check for and return the existing
+ // entry if there is one.
+ if (ignore_duplicates
+ && rt_info_map_.find (handle, new_rt_info) == 0)
+ {
+ return new_rt_info;
+ }
+
+ // Create a new scheduling entry for the RT_Info.
+ ACE_NEW_THROW_EX (new_rt_info,
+ TAO_RT_Info_Ex,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ // Make sure the new scheduling entry is cleaned up if we exit abruptly.
+ auto_ptr<TAO_RT_Info_Ex> new_rt_info_ptr (new_rt_info);
+
+ // Set some reasonable default values, and store the passed ones.
+ new_rt_info->entry_point = CORBA::string_dup (entry_point);
+ new_rt_info->handle = handle;
+
+ // Bind the new RT_Info to its handle, in the RT_Info map.
+ result = rt_info_map_.bind (handle, new_rt_info);
+ switch (result)
+ {
+ case -1:
+ // Something bad but unknown occurred while trying to bind in map.
+ ACE_THROW_RETURN (RtecScheduler::INTERNAL (), 0);
+
+ case 1:
+ // Tried to bind an operation that was already in the map.
+ if (ignore_duplicates)
+ {
+ // Should never get here unless something is badly awry.
+ ACE_THROW_RETURN (RtecScheduler::INTERNAL (), 0);
+ }
+ else
+ {
+ // Already bound, and we're not ignoring duplicates.
+ ACE_THROW_RETURN (RtecScheduler::DUPLICATE_NAME (), 0);
+ }
+
+ default:
+ break;
+ }
+
+ // Bind the new RT_Info to *its* entry point, in the tree.
+ result = rt_info_tree_.bind (new_rt_info->entry_point, new_rt_info);
+ switch (result)
+ {
+ case -1:
+ // Something bad but unknown occurred while trying to bind in tree.
+ rt_info_map_.unbind (handle);
+ ACE_THROW_RETURN (RtecScheduler::INTERNAL (), 0);
+
+ case 1:
+ // Tried to bind an operation that was already in the tree.
+ rt_info_map_.unbind (handle);
+ ACE_THROW_RETURN (RtecScheduler::DUPLICATE_NAME (), 0);
+
+ default:
+ break;
+ }
+
+ // Create a new scheduling entry for the RT_Info.
+ ACE_NEW_THROW_EX (new_sched_entry,
+ TAO_Reconfig_Scheduler_Entry (*new_rt_info),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ // Make sure the new scheduling entry is cleaned up if we exit abruptly.
+ auto_ptr<TAO_Reconfig_Scheduler_Entry> new_sched_entry_ptr (new_sched_entry);
+
+ // Maintain the size of the entry pointer array.
+ maintain_scheduling_array (entry_ptr_array_, entry_ptr_array_size_,
+ handle ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+
+ // Store the new entry in the scheduling entry pointer array.
+ entry_ptr_array_ [handle - 1] = new_sched_entry;
+
+ // Release the auto pointers, so their destruction does not
+ // remove the new rt_info that is now in the map and tree,
+ // or the scheduling entry attached to the rt_info.
+ new_rt_info_ptr.release ();
+ new_sched_entry_ptr.release ();
+
+ // Connect the entry to the RT_Info.
+ new_rt_info->volatile_token =
+ static_cast<CORBA::ULongLong> (reinterpret_cast<ptrdiff_t> (new_sched_entry));
+
+ // With everything safely registered in the map and tree, just
+ // update the next handle and info counter and return the new info.
+ if (handle >= this->next_handle_)
+ {
+ this->next_handle_ = handle + 1;
+ }
+ if (handle > this->rt_info_count_)
+ {
+ this->rt_info_count_ = handle;
+ }
+
+ return new_rt_info;
+}
+
+// Internal method to set characteristics of the passed RT_Info.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+set_i (TAO_RT_Info_Ex *rt_info,
+ RtecScheduler::Criticality_t criticality,
+ RtecScheduler::Time time,
+ RtecScheduler::Time typical_time,
+ RtecScheduler::Time cached_time,
+ RtecScheduler::Period_t period,
+ RtecScheduler::Importance_t importance,
+ RtecScheduler::Quantum_t quantum,
+ CORBA::Long threads,
+ RtecScheduler::Info_Type_t info_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::set_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ // Do not allow conjunction nodes for now.
+ if (info_type == RtecScheduler::CONJUNCTION)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("Conjunction Nodes are not supported currently.")));
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+
+
+ // Set the base RT_Info to have the attributes of the latest values.
+ rt_info->criticality = criticality;
+ rt_info->worst_case_execution_time = time;
+ rt_info->typical_execution_time = typical_time;
+ rt_info->cached_execution_time = cached_time;
+ rt_info->period = period;
+ rt_info->importance = importance;
+ rt_info->quantum = quantum;
+ rt_info->threads = threads;
+ rt_info->info_type = info_type;
+
+ // If a rate is advertised, create a separate tuple for that rate.
+ if (period > 0)
+ {
+ TAO_Reconfig_Scheduler_Entry * rse_ptr =
+ ACE_LONGLONG_TO_PTR (TAO_Reconfig_Scheduler_Entry *,
+ rt_info->volatile_token);
+// ACE_DEBUG((LM_DEBUG, "Updating or inserting tuple for RT_Info: %d, entry_ptr: %x\n", rt_info->handle, rse_ptr));
+ if (rse_ptr == 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+
+ int result = rse_ptr->update_tuple (*rt_info);
+ if (result < 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ else if (result == 0) // We did not find an existing tuple.
+ {
+ // Create a new RT_Info tuple from the passed RT_Info.
+ TAO_RT_Info_Tuple *tuple_ptr = 0;
+ ACE_NEW_THROW_EX (tuple_ptr,
+ TAO_RT_Info_Tuple (*rt_info),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+
+ // Make sure the new tuple is cleaned up if we exit abruptly.
+ auto_ptr<TAO_RT_Info_Tuple> tuple_auto_ptr (tuple_ptr);
+
+// ACE_DEBUG((LM_DEBUG, "Tuple not found. Inserting new tuple for RT_Info: %d, entry_ptr: 0x%x, tuple_ptr: 0x%x\n",
+// rt_info->handle,
+// rse_ptr,
+// tuple_ptr));
+ // Add the tuple to the entry's original tuple set
+ result = rse_ptr->insert_tuple (*tuple_ptr);
+ if (result < 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+
+ // Maintain the size of the entry pointer array.
+ maintain_scheduling_array (tuple_ptr_array_,
+ tuple_ptr_array_size_,
+ rt_info_tuple_count_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Store the new tuple in the tuple pointer array.
+ tuple_ptr_array_ [this->rt_info_tuple_count_] = tuple_ptr;
+
+ ++this->rt_info_tuple_count_;
+
+ // All is well: release the auto pointer's hold on the tuple.
+ tuple_auto_ptr.release ();
+ }
+ }
+}
+
+
+
+// Internal method to lookup a handle for an RT_Info, and return its
+// handle, or an error value if it's not present.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+RtecScheduler::handle_t
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+lookup_i (const char * entry_point
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::lookup_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ TAO_RT_Info_Ex *rt_info = 0;
+ if (rt_info_tree_.find (entry_point, rt_info) != 0)
+ {
+ ACE_THROW_RETURN (RtecScheduler::UNKNOWN_TASK (), 0);
+ }
+
+ return rt_info->handle;
+}
+
+// Internal method that returns the priority and subpriority values
+// assigned to an RT_Info, based on its handle.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+priority_i (RtecScheduler::handle_t handle,
+ RtecScheduler::OS_Priority& o_priority,
+ RtecScheduler::Preemption_Subpriority_t& subpriority,
+ RtecScheduler::Preemption_Priority_t& p_priority
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::NOT_SCHEDULED))
+{
+ // Check stability flags.
+ if ((this->stability_flags_ & SCHED_PRIORITY_NOT_STABLE)
+ && this->enforce_schedule_stability_)
+ {
+ ACE_THROW (RtecScheduler::NOT_SCHEDULED ());
+ }
+
+ TAO_RT_Info_Ex *rt_info = 0;
+ if (rt_info_map_.find (handle, rt_info) != 0)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+
+ o_priority = rt_info->priority;
+ subpriority = rt_info->preemption_subpriority;
+ p_priority = rt_info->preemption_priority;
+}
+
+
+// This internal method registers a dependency between two RT_Infos.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+add_dependency_i (RtecScheduler::handle_t handle /* RT_Info that has the dependency */,
+ RtecScheduler::handle_t dependency /* RT_Info on which it depends */,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type,
+ RtecScheduler::Dependency_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::add_dependency_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ // All dependencies are mapped by both the calling and called
+ // operation handles, so that a topological sort can be performed
+ // once over both one-way and two-way dependencies. The dependency
+ // specification is in absolute terms, however, so that the calling
+ // and called handles are reversed for one-way and two way
+ // dependencies.
+
+ switch (dependency_type)
+ {
+ // In a two-way call, the calling operation depends on the
+ // called operation.
+ case RtecBase::TWO_WAY_CALL:
+
+ // Add the calling dependency map entry
+ map_dependency_i (handle, // calling handle
+ dependency, // called handle
+ calling_dependency_set_map_, // calling map
+ number_of_calls,
+ dependency_type,
+ enabled
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Add the called dependency map entry
+ map_dependency_i (dependency, // called handle
+ handle, // calling handle
+ called_dependency_set_map_, // called map
+ number_of_calls,
+ dependency_type,
+ enabled
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ break;
+
+ // In a one-way call, the called operation depends on the
+ // calling operation.
+ case RtecBase::ONE_WAY_CALL:
+
+ // Add the calling dependency map entry
+ map_dependency_i (dependency, // calling handle
+ handle, // called handle
+ calling_dependency_set_map_, // calling map
+ number_of_calls,
+ dependency_type,
+ enabled
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Add the called dependency map entry
+ map_dependency_i (handle, // called handle
+ dependency, // calling handle
+ called_dependency_set_map_, // called map
+ number_of_calls,
+ dependency_type,
+ enabled
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ break;
+
+ default:
+
+ // There should not be any other kinds of dependencies.
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+
+ // Add the criticality dependency map entry.
+ // If A---TW--->B and C---OW--->D, the add_dependency_calls
+ // would look like this
+ // add_dependency (A, B, TW)
+ // add_dependency (D, C, OW)
+ // Neither of the other two maps capture these dependencies
+ // A depends on B and D depends on C.
+ // The calling dependency map captures
+ // A calls B and C calls D.
+ // The called dependency map captures
+ // B called by A and D called by C.
+
+ map_dependency_i (handle, // calling handle
+ dependency, // called handle
+ crit_dependency_set_map_,// crit dependency map
+ number_of_calls,
+ dependency_type,
+ enabled
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+}
+
+
+// This internal method removes a dependency between two RT_Infos.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+remove_dependency_i (RtecScheduler::handle_t handle /* RT_Info that has the dependency */,
+ RtecScheduler::handle_t dependency /* RT_Info on which it depends */,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::remove_dependency_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ // All dependencies are mapped by both the calling and called
+ // operation handles, so that a topological sort can be performed
+ // once over both one-way and two-way dependencies. The dependency
+ // specification is in absolute terms, however, so that the calling
+ // and called handles are reversed for one-way and two way
+ // dependencies.
+
+ switch (dependency_type)
+ {
+ // In a two-way call, the calling operation depends on the
+ // called operation.
+ case RtecBase::TWO_WAY_CALL:
+
+ // Remove the calling dependency map entry
+ unmap_dependency_i (handle, // calling handle
+ dependency, // called handle
+ calling_dependency_set_map_, // calling map
+ number_of_calls,
+ dependency_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Remove the called dependency map entry
+ unmap_dependency_i (dependency, // called handle
+ handle, // calling handle
+ called_dependency_set_map_, // called map
+ number_of_calls,
+ dependency_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ break;
+
+ // In a one-way call, the called operation depends on the
+ // calling operation.
+ case RtecBase::ONE_WAY_CALL:
+
+ // Remove the calling dependency map entry
+ unmap_dependency_i (dependency, // calling handle
+ handle, // called handle
+ calling_dependency_set_map_, // calling map
+ number_of_calls,
+ dependency_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Remove the called dependency map entry
+ unmap_dependency_i (handle, // called handle
+ dependency, // calling handle
+ called_dependency_set_map_, // called map
+ number_of_calls,
+ dependency_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ break;
+
+ default:
+
+ // There should not be any other kinds of dependencies.
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+}
+
+
+// This method sets the enable state for a dependency between two RT_Infos.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+set_dependency_enable_state_i (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type,
+ RtecScheduler::Dependency_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::set_dependency_enable_state_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ // All dependencies are mapped by both the calling and called
+ // operation handles, so that a topological sort can be performed
+ // once over both one-way and two-way dependencies. The dependency
+ // specification is in absolute terms, however, so that the calling
+ // and called handles are reversed for one-way and two way
+ // dependencies.
+
+ switch (dependency_type)
+ {
+ // In a two-way call, the calling operation depends on the
+ // called operation.
+ case RtecBase::TWO_WAY_CALL:
+
+ // Update the calling dependency map entry
+ map_dependency_enable_state_i (handle, // calling handle
+ dependency, // called handle
+ calling_dependency_set_map_, // calling map
+ number_of_calls,
+ dependency_type,
+ enabled
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Update the called dependency map entry
+ map_dependency_enable_state_i (dependency, // called handle
+ handle, // calling handle
+ called_dependency_set_map_, // called map
+ number_of_calls,
+ dependency_type,
+ enabled
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ break;
+
+ // In a one-way call, the called operation depends on the
+ // calling operation.
+ case RtecBase::ONE_WAY_CALL:
+
+ // Update the calling dependency map entry
+ map_dependency_enable_state_i (dependency, // calling handle
+ handle, // called handle
+ calling_dependency_set_map_, // calling map
+ number_of_calls,
+ dependency_type,
+ enabled
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Update the called dependency map entry
+ map_dependency_enable_state_i (handle, // called handle
+ dependency, // calling handle
+ called_dependency_set_map_, // called map
+ number_of_calls,
+ dependency_type,
+ enabled
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ break;
+
+ default:
+
+ // There should not be any other kinds of dependencies.
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+}
+
+// This method installs a dependency in a dependency set map.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+map_dependency_i (RtecScheduler::handle_t key,
+ RtecScheduler::handle_t handle,
+ ACE_TYPENAME TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP &dependency_map,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type,
+ RtecScheduler::Dependency_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::map_dependency_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ RtecScheduler::Dependency_Set *dependency_set;
+
+ // Look up the dependency set in the passed map
+ if (dependency_map.find (key, dependency_set) != 0)
+ {
+ // Create a new one
+ ACE_NEW_THROW_EX (dependency_set,
+ RtecScheduler::Dependency_Set,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ if (dependency_map.bind (key, dependency_set) != 0)
+ {
+ delete dependency_set;
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+
+ // Insert unconditionally: there can be multiple copies
+ // of the same dependency, if the user so chooses.
+ int prev_length = dependency_set->length ();
+ dependency_set->length (prev_length + 1);
+ (*dependency_set) [prev_length].rt_info = handle;
+ (*dependency_set) [prev_length].rt_info_depended_on = key; // may actually be the other way around
+ (*dependency_set) [prev_length].number_of_calls = number_of_calls;
+ (*dependency_set) [prev_length].dependency_type = dependency_type;
+ (*dependency_set) [prev_length].enabled = enabled;
+}
+
+
+// This method removes a dependency from a dependency set map.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+unmap_dependency_i (RtecScheduler::handle_t key,
+ RtecScheduler::handle_t handle,
+ ACE_TYPENAME TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP &dependency_map,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::unmap_dependency_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ RtecScheduler::Dependency_Set *dependency_set = 0;
+
+ // Try to unbind the matching dependency set from the passed map
+ // and if successful, destroy the
+ if (dependency_map.find (key, dependency_set) == 0)
+ {
+ if (dependency_set)
+ {
+ int prev_length = dependency_set->length ();
+ int found = 0;
+ for (int i = 0; i < prev_length; ++i)
+ {
+ if ((*dependency_set) [i].rt_info == handle
+ && (*dependency_set) [i].number_of_calls == number_of_calls
+ && (*dependency_set) [i].dependency_type == dependency_type)
+ {
+ // we found the dependency to delete: set our
+ // found flag to true and compact the array
+ found = 1;
+ for (int j = i+1; j < prev_length; ++j)
+ {
+ (*dependency_set) [j - 1].rt_info = (*dependency_set) [j].rt_info;
+ (*dependency_set) [j - 1].number_of_calls = (*dependency_set) [j].number_of_calls;
+ (*dependency_set) [j - 1].dependency_type = (*dependency_set) [j].dependency_type;
+ (*dependency_set) [j - 1].enabled = (*dependency_set) [j].enabled;
+ }
+ dependency_set->length (prev_length - 1);
+ break;
+ }
+ }
+
+ if (!found)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+ }
+ else
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+ else
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+}
+
+// Internal method that enables or disables a dependency between two RT_Infos.
+// Assumes it is being called with all locks held, and does *not*
+// set any schedule stability flags.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+map_dependency_enable_state_i (RtecScheduler::handle_t key,
+ RtecScheduler::handle_t handle,
+ ACE_TYPENAME
+ TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP &dependency_map,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type,
+ RtecScheduler::Dependency_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::map_dependency_enable_state_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ RtecScheduler::Dependency_Set *dependency_set = 0;
+
+ // Try to unbind the matching dependency set from the passed map
+ // and if successful, destroy the
+ if (dependency_map.find (key, dependency_set) == 0)
+ {
+ if (dependency_set)
+ {
+ int set_length = dependency_set->length ();
+ int found = 0;
+ for (int i = 0; i < set_length; ++i)
+ {
+ if ((*dependency_set) [i].rt_info == handle
+ && (*dependency_set) [i].number_of_calls == number_of_calls
+ && (*dependency_set) [i].dependency_type == dependency_type)
+ {
+ // we found the dependency to update
+ found = 1;
+ (*dependency_set) [i].enabled = enabled;
+ break;
+ }
+ }
+
+ if (!found)
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+ }
+ else
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+ else
+ {
+ ACE_THROW (RtecScheduler::UNKNOWN_TASK ());
+ }
+}
+
+
+// Traverses dependency graph, assigning a topological ordering.
+// Resets scheduling entries, do DFS traversal, constructs DFS map.
+// Fills in: dfs_status_, discovered_, finished_, is_thread_delineator_,
+// has_unresolved_remote_dependencies_, has_unresolved_local_dependencies_,
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+dfs_traverse_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::dfs_traverse_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ int i; // index into array of scheduling entry pointers
+
+ // Reset registered RT_Infos.
+ TAO_RSE_Reset_Visitor reset_visitor;
+ for (i = 0; i < this->rt_info_count_; ++i)
+ {
+ if (reset_visitor.visit (* (entry_ptr_array_ [i])) < 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+
+ // Traverse registered RT_Infos, assigning DFS start, finish order.
+ TAO_RSE_DFS_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>
+ dfs_visitor (this->calling_dependency_set_map_,
+ this->rt_info_map_);
+ for (i = 0; i < this->rt_info_count_; ++i)
+ {
+ if (dfs_visitor.visit (* (entry_ptr_array_ [i])) < 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+}
+
+
+
+// Sorts an array of RT_info handles in topological order, then
+// checks for loops, marks unresolved remote dependencies.
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+detect_cycles_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::CYCLIC_DEPENDENCIES))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::detect_cycles_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ // Sort the pointers to entries in order of descending forward
+ // finish times, which produces a reverse topological ordering,
+ // with callers ahead of called nodes.
+ ACE_OS::qsort (reinterpret_cast<void *> (entry_ptr_array_),
+ this->rt_info_count_,
+ sizeof (TAO_Reconfig_Scheduler_Entry *),
+ reinterpret_cast<COMP_FUNC> (RECONFIG_SCHED_STRATEGY::comp_entry_finish_times));
+
+ // Traverse entries in reverse topological order,
+ // looking for strongly connected components (cycles).
+ TAO_RSE_SCC_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>
+ scc_visitor (this->called_dependency_set_map_,
+ this->rt_info_map_);
+ for (int i = 0; i < this->rt_info_count_; ++i)
+ {
+ // Each new top level entry marks a potential new cycle.
+ scc_visitor.in_a_cycle (0);
+
+ if (scc_visitor.visit (* (entry_ptr_array_ [i])) < 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+
+ // Check whether any cycles were detected.
+ if (scc_visitor.number_of_cycles () > 0)
+ {
+ ACE_THROW (RtecScheduler::CYCLIC_DEPENDENCIES ());
+ }
+}
+
+
+// Propagates aggregate execution times, then performs admission over
+// rate tuples.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+perform_admission_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((RtecScheduler::UTILIZATION_BOUND_EXCEEDED,
+ CORBA::SystemException,
+ RtecScheduler::INTERNAL))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::perform_admission_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ // Traverse entries in topological (ascending forward DFS
+ // finish time) order, propagating aggregate execution
+ // time from called nodes to calling node at each step.
+
+ TAO_RSE_Reverse_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>
+ prop_visitor (this->calling_dependency_set_map_,
+ this->rt_info_map_);
+ int i;
+ for (i = this->rt_info_count_ - 1; i >= 0; --i)
+ {
+ if (prop_visitor.visit (* (entry_ptr_array_ [i])) < 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+
+ // Sort the pointers to original tuples in ascending admission
+ // order, according to the scheduling strategy's admission policy.
+ ACE_OS::qsort (reinterpret_cast<void *> (tuple_ptr_array_),
+ this->rt_info_tuple_count_,
+ sizeof (TAO_RT_Info_Tuple *),
+ reinterpret_cast<COMP_FUNC> (RECONFIG_SCHED_STRATEGY::total_admission_comp));
+
+ // Traverse tuples in admission order, updating the associate tuple
+ // for each thread delineator.
+#if defined (SCHEDULER_LOGGING)
+ ACE_Scheduler_Factory::log_scheduling_tuples(tuple_ptr_array_,
+ this->rt_info_tuple_count_,
+ "sorted_admit_tuples.txt");
+#endif
+
+ TAO_Tuple_Admission_Visitor<RECONFIG_SCHED_STRATEGY>
+ admit_visitor (critical_utilization_threshold_,
+ noncritical_utilization_threshold_);
+
+ for (i = 0; i < this->rt_info_tuple_count_; ++i)
+ {
+ if (admit_visitor.visit (* (tuple_ptr_array_ [i])) < 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+
+
+ // Store the values accumulated by the visitor.
+ this->noncritical_utilization_ =
+ admit_visitor.total_noncritical_utilization ();
+ this->critical_utilization_ =
+ admit_visitor.total_critical_utilization ();
+}
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+crit_dfs_traverse_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::crit_dfs_traverse_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ int i; // index into array of scheduling entry pointers
+
+ // Reset registered RT_Infos.
+ TAO_RSE_Reset_Visitor reset_visitor;
+ for (i = 0; i < this->rt_info_count_; ++i)
+ {
+ if (reset_visitor.visit (* (entry_ptr_array_ [i])) < 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+
+ // Traverse registered RT_Infos, assigning DFS start, finish order.
+ TAO_RSE_DFS_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>
+ dfs_visitor (this->crit_dependency_set_map_,
+ this->rt_info_map_);
+ for (i = 0; i < this->rt_info_count_; ++i)
+ {
+ if (dfs_visitor.visit (* (entry_ptr_array_ [i])) < 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+}
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+propagate_criticalities_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::propagate_criticalities_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ // Sort the pointers to original tuples in ascending admission
+ // order, according to the scheduling strategy's admission policy.
+
+ ACE_OS::qsort (reinterpret_cast<void *> (tuple_ptr_array_),
+ this->rt_info_tuple_count_,
+ sizeof (TAO_RT_Info_Tuple *),
+ reinterpret_cast<COMP_FUNC> (RECONFIG_SCHED_STRATEGY::comp_tuple_finish_times ));
+
+ // Traverse entries in topological (ascending forward DFS
+ // finish time) order, propagating aggregate execution
+ // time from called nodes to calling node at each step.
+
+ TAO_RSE_Criticality_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>
+ crit_prop_visitor (this->crit_dependency_set_map_,
+ this->rt_info_map_);
+ int i;
+ for (i = 0; i<this->rt_info_count_; ++i)
+ {
+ if (crit_prop_visitor.visit (* (entry_ptr_array_ [i])) < 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+ for (i = this->rt_info_count_-1; i>=0; --i)
+ {
+ if (crit_prop_visitor.visit (* (entry_ptr_array_ [i])) < 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+}
+
+// Propagates periods, sets total frame size.
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+propagate_characteristics_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNRESOLVED_LOCAL_DEPENDENCIES,
+ RtecScheduler::THREAD_SPECIFICATION))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::propagate_characteristics_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ // Traverse entries in reverse topological (descending forward DFS
+ // finish time) order, propagating period and effective execution
+ // time from calling node to called node at each step.
+ TAO_RSE_Forward_Propagation_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>
+ prop_visitor (this->calling_dependency_set_map_,
+ this->rt_info_map_);
+ for (int i = 0; i < this->rt_info_count_; ++i)
+ {
+ if (prop_visitor.visit (* (entry_ptr_array_ [i])) < 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+
+ // Check whether any unresolved local dependencies were detected.
+ if (prop_visitor.unresolved_locals () > 0)
+ {
+ ACE_THROW (RtecScheduler::UNRESOLVED_LOCAL_DEPENDENCIES ());
+ }
+
+ // Check whether any thread specification errors were detected.
+ if (prop_visitor.thread_specification_errors () > 0)
+ {
+ ACE_THROW (RtecScheduler::THREAD_SPECIFICATION ());
+ }
+}
+
+// Sort operations by urgency (done by strategy), then
+// assign priorities and subpriorities in one pass.
+// Sets last scheduled priority.
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+assign_priorities_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::DUPLICATE_NAME))
+{
+ int i;
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::assign_priorities_i.\n"));
+
+ ACE_DEBUG ((LM_DEBUG, "Scheduler::entry ptr array before sorting is\n"));
+ for (i = 0; i < this->rt_info_count_; ++i)
+ {
+ RtecScheduler::RT_Info* rt_info_ptr =
+ this->entry_ptr_array_[i]->actual_rt_info ();
+ ACE_DEBUG ((LM_DEBUG,
+ " %s [%d] crit=%d,prio=%d,preemption_prio=%d,subprio=%d\n ",
+ rt_info_ptr->entry_point.in (),
+ rt_info_ptr->handle,
+ rt_info_ptr->criticality,
+ rt_info_ptr->priority,
+ rt_info_ptr->preemption_priority,
+ rt_info_ptr->preemption_subpriority));
+ }
+#endif /* SCHEDULER_LOGGING */
+
+ // Sort the pointers to entries in descending order
+ // of static priority and static subpriority, according
+ // to our given scheduling strategy.
+ ACE_OS::qsort (reinterpret_cast<void *> (entry_ptr_array_),
+ this->rt_info_count_,
+ sizeof (TAO_Reconfig_Scheduler_Entry *),
+ reinterpret_cast<COMP_FUNC> (RECONFIG_SCHED_STRATEGY::total_priority_comp));
+
+#ifdef SCHEDULER_LOGGING
+ ACE_DEBUG ((LM_DEBUG, "Scheduler::qsorted array is\n"));
+ for (i = 0; i < this->rt_info_count_; ++i)
+ {
+ RtecScheduler::RT_Info* rt_info_ptr =
+ this->entry_ptr_array_[i]->actual_rt_info ();
+ ACE_DEBUG ((LM_DEBUG,
+ " %s [%d] crit=%d,prio=%d,preemption_prio=%d,subprio=%d\n ",
+ rt_info_ptr->entry_point.in (),
+ rt_info_ptr->handle,
+ rt_info_ptr->criticality,
+ rt_info_ptr->priority,
+ rt_info_ptr->preemption_priority,
+ rt_info_ptr->preemption_subpriority));
+ }
+#endif
+
+ // Empty out the previously stored configuration infos, if any.
+ RtecScheduler::Preemption_Priority_t config_priority;
+ RtecScheduler::Config_Info *config_info_temp = 0;
+ while (config_info_map_.current_size () > 0)
+ {
+ config_priority = (*config_info_map_.begin ()).ext_id_;
+ if (config_info_map_.unbind (config_priority, config_info_temp) == 0)
+ {
+ delete config_info_temp;
+ }
+ else
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+ this->config_info_count_ = 0;
+
+ // Traverse using a priority assignment visitor, which uses a
+ // strategy to decide when a new priority or subpriority is reached.
+ TAO_RSE_Priority_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK>
+ prio_visitor (this->rt_info_count_, this->entry_ptr_array_);
+ auto_ptr<RtecScheduler::Config_Info> new_config_info_ptr;
+ for (i = 0; i <= this->rt_info_count_; ++i)
+ {
+ int result;
+
+ if (i < this->rt_info_count_)
+ {
+ // Visit the next entry in the array.
+ result = prio_visitor.visit (* (this->entry_ptr_array_ [i]));
+ }
+ else
+ {
+ // Finish up after all enties in the array have been visited.
+ result = prio_visitor.finish ();
+ }
+
+ if (result < 0)
+ {
+ // Something bad happened with the internal data structures.
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ else if (result == 1)
+ {
+ RtecScheduler::Config_Info* new_config_info;
+ ACE_NEW_THROW_EX (new_config_info,
+ RtecScheduler::Config_Info,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ // Make sure the new config info is cleaned up if we exit abruptly.
+ ACE_AUTO_PTR_RESET (new_config_info_ptr, new_config_info, RtecScheduler::Config_Info);
+
+ // Have the strategy fill in the new config info for that
+ // priority level, using the representative scheduling entry.
+ if (RECONFIG_SCHED_STRATEGY::assign_config (*new_config_info,
+ *(entry_ptr_array_ [i])) < 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+
+ if (new_config_info->preemption_priority >
+ this->last_scheduled_priority_)
+ {
+ this->last_scheduled_priority_ =
+ new_config_info->preemption_priority;
+ }
+
+ result = config_info_map_.bind (new_config_info->preemption_priority,
+ new_config_info);
+ switch (result)
+ {
+ case -1:
+ // Something bad but unknown occurred while trying to bind in map.
+ ACE_THROW (RtecScheduler::INTERNAL ());
+
+ case 1:
+ // Tried to bind an operation that was already in the map.
+ ACE_THROW (RtecScheduler::DUPLICATE_NAME ());
+
+ default:
+ ++this->config_info_count_;
+ break;
+ }
+
+ // Release the auto_ptr so it does not clean
+ // up the sucessfully bound config info.
+ new_config_info_ptr.release ();
+ }
+ }
+}
+
+
+// Refreshes the array of tuple pointers, tuple pointer count.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+refresh_tuple_ptr_array_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL))
+{
+#if defined (SCHEDULER_LOGGING)
+ ACE_DEBUG ((LM_TRACE,
+ " TAO_Reconfig_Scheduler::refresh_tuple_ptr_array_i.\n"));
+#endif /* SCHEDULER_LOGGING */
+
+ // Zero out the tuple pointer array, set count to zero
+ ACE_OS::memset (this->tuple_ptr_array_, 0,
+ sizeof (TAO_RT_Info_Tuple *)
+ * this->tuple_ptr_array_size_);
+ this->rt_info_tuple_count_ = 0;
+
+ for (int i = 0; i < this->rt_info_count_; ++i)
+ {
+ if (entry_ptr_array_ [i]->register_tuples (this->tuple_ptr_array_,
+ this->rt_info_tuple_count_) < 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+}
+
+// Accesses scheduling strategy for the reconfig scheduler.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> RECONFIG_SCHED_STRATEGY &
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::sched_strategy ()
+{
+ return this->sched_strategy_;
+}
+
+
+// Accesses map for O(1) lookup of Config_Infos by priority level.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+ACE_TYPENAME TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::CONFIG_INFO_MAP &
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::config_info_map ()
+{
+ return this->config_info_map_;
+}
+
+
+// Returns the number of config infos, which is also the number of
+// assigned priority levels.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> long
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::config_info_count ()
+{
+ return this->config_info_count_;
+}
+
+
+// Accesses map for O(1) lookup of RT_Infos by handle.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+ACE_TYPENAME TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::RT_INFO_MAP &
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::rt_info_map ()
+{
+ return this->rt_info_map_;
+}
+
+
+// Returns the number of registered RT_Infos.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> long
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::rt_info_count ()
+{
+ return this->rt_info_count_;
+}
+
+// Returns the number of registered RT_Info tuples.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> long
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::rt_info_tuple_count ()
+{
+ return this->rt_info_tuple_count_;
+}
+
+
+// Accesses tree for O(log n) lookup of RT_Infos by name.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+ACE_TYPENAME TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::RT_INFO_TREE &
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::rt_info_tree ()
+{
+ return this->rt_info_tree_;
+}
+
+
+// Accesses map for O(1) lookup of RT_Info dependency
+// set by the caller operation's handle.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+ACE_TYPENAME TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP &
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::calling_dependency_set_map ()
+{
+ return this->calling_dependency_set_map_;
+}
+
+
+// Accesses map for O(1) lookup of RT_Info dependency
+// set by the called operation's handle.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+ACE_TYPENAME TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP &
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::called_dependency_set_map ()
+{
+ return this->called_dependency_set_map_;
+}
+
+
+// Returns the number of dependencies in the dependency lists of all RT_Infos.
+// This is used when traversing the dependency graph.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::dependency_count ()
+{
+ return this->dependency_count_;
+}
+
+// Accessor for utilization by noncritical tasks.
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+CORBA::Double
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+noncritical_utilization ()
+{
+ return noncritical_utilization_;
+}
+
+// Accessor for utilization by critical tasks.
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+CORBA::Double
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+critical_utilization ()
+{
+ return critical_utilization_;
+}
+
+// Accessor for noncritical task utilization threshold.
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+CORBA::Double
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+noncritical_utilization_threshold ()
+{
+ return noncritical_utilization_threshold_;
+}
+
+// Mutator for noncritical task utilization threshold.
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+noncritical_utilization_threshold (const CORBA::Double &d)
+{
+ noncritical_utilization_threshold_ = d;
+}
+
+// Accessor for critical task utilization threshold.
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+CORBA::Double
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+critical_utilization_threshold ()
+{
+ return critical_utilization_threshold_;
+}
+
+// Mutator for critical task utilization threshold.
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+critical_utilization_threshold (const CORBA::Double &d)
+{
+ critical_utilization_threshold_ = d;
+}
+
+
+// Helper function: makes sure there is room in the scheduling pointer
+// arrays. This function expands the array eagerly, to minimize
+// memory allocation overhead.
+
+template <class ARRAY_ELEMENT_TYPE> void
+maintain_scheduling_array (ARRAY_ELEMENT_TYPE ** & current_ptr_array,
+ long & current_ptr_array_size,
+ RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (current_ptr_array_size <= handle)
+ {
+ long new_size = handle + 1;
+ ARRAY_ELEMENT_TYPE ** new_array;
+
+ if (current_ptr_array_size > 0)
+ {
+ // Store previous array size.
+ for (new_size = 2 * current_ptr_array_size;
+ new_size <= handle;
+ new_size *= 2);
+ }
+
+ // Allocate the new array of the proper size, zero it out.
+
+ ACE_NEW_THROW_EX (new_array,
+ ARRAY_ELEMENT_TYPE * [new_size],
+ CORBA::NO_MEMORY ());
+
+ ACE_OS::memset (new_array, 0,
+ sizeof (ARRAY_ELEMENT_TYPE *) *
+ new_size);
+
+ if (current_ptr_array_size > 0)
+ {
+ // Copy in the previous array.
+ ACE_OS::memcpy (new_array, current_ptr_array,
+ sizeof (ARRAY_ELEMENT_TYPE *) *
+ current_ptr_array_size);
+
+ // Free the old array and swap to point to the new one.
+ delete [] current_ptr_array;
+ }
+
+ current_ptr_array = new_array;
+ current_ptr_array_size = new_size;
+ }
+}
+
+/* WSOA merge - commented out
+// Compute utilization, set last feasible priority.
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+compute_utilization_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL))
+{
+ TAO_RSE_Utilization_Visitor<RECONFIG_SCHED_STRATEGY> util_visitor;
+ for (int i = 0; i < this->rt_info_count_; ++i)
+ {
+ if (util_visitor.visit (* (entry_ptr_array_ [i])) < 0)
+ {
+ ACE_THROW (RtecScheduler::INTERNAL ());
+ }
+ }
+
+ // Store the values accumulated by the visitor.
+ this->noncritical_utilization_ =
+ util_visitor.noncritical_utilization ();
+ this->critical_utilization_ =
+ util_visitor.critical_utilization ();
+}
+
+
+// Static helper method to give an RT_Info some reasonable default values.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::init_rt_info (RtecScheduler::RT_Info &rt_info)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Set some reasonable default values.
+ rt_info.criticality = RtecScheduler::VERY_LOW_CRITICALITY;
+ rt_info.worst_case_execution_time = 0;
+ rt_info.typical_execution_time = 0;
+ rt_info.cached_execution_time = 0;
+ rt_info.period = 1;
+ rt_info.importance = RtecScheduler::VERY_LOW_IMPORTANCE;
+ rt_info.quantum = 0;
+ rt_info.threads = 0;
+ rt_info.info_type = RtecScheduler::OPERATION;
+ rt_info.priority = 0;
+ rt_info.preemption_subpriority = 0;
+ rt_info.preemption_priority = 0;
+ rt_info.volatile_token = 0;
+}
+
+*/
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_RECONFIG_SCHEDULER_T_C */
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h
new file mode 100644
index 00000000000..ec7f53542bb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h
@@ -0,0 +1,777 @@
+// -*- C++ -*-
+
+// $Id$
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Reconfig_Scheduler_T.h
+//
+// = AUTHOR
+// Chris Gill <cdgill@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_RECONFIG_SCHEDULER_T_H
+#define TAO_RECONFIG_SCHEDULER_T_H
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+
+#include "orbsvcs/Sched/Reconfig_Scheduler.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+class TAO_Reconfig_Scheduler :
+ public POA_RtecScheduler::Scheduler
+ // = TITLE
+ // A servant for RtecScheduler::Scheduler that can be initialized
+ // and run solely with precomputed scheduling information, but is also
+ // designed to perform efficient recomputation of scheduling info
+ // in the face of run-time changes to RT_Infos in the schedule.
+ //
+ // = DESCRIPTION
+ // This class implements the TAO scheduling service. It has
+ // the ability to accept and use precomputed scheduling information
+ // with deterministic performance once the schedule is fully configured.
+ // It also provides efficient and flexible lookup and computation
+ // during schedule configuration, so that it can be used during
+ // both schedule configuration and run-time phases of operation.
+ //
+{
+public:
+
+ typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::handle_t,
+ TAO_RT_Info_Ex *,
+ ACE_Hash<RtecScheduler::handle_t>,
+ ACE_Equal_To<RtecScheduler::handle_t>,
+ ACE_LOCK> RT_INFO_MAP;
+ // Type of map used for O(1) lookup of RT_Infos by their handles.
+
+ typedef ACE_RB_Tree<const char *,
+ TAO_RT_Info_Ex*,
+ ACE_Less_Than<const char *>,
+ ACE_LOCK> RT_INFO_TREE;
+ // Type of tree used for O(log n) lookup of RT_Infos by their names.
+
+ typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::Preemption_Priority_t,
+ RtecScheduler::Config_Info*,
+ ACE_Hash<RtecScheduler::Preemption_Priority_t>,
+ ACE_Equal_To<RtecScheduler::Preemption_Priority_t>,
+ ACE_LOCK> CONFIG_INFO_MAP;
+ // Type of map used for O(1) lookup of Config_Infos by their priorities.
+
+ typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::handle_t,
+ RtecScheduler::Dependency_Set*,
+ ACE_Hash<RtecScheduler::handle_t>,
+ ACE_Equal_To<RtecScheduler::handle_t>,
+ ACE_LOCK> DEPENDENCY_SET_MAP;
+ // Type of map used for O(1) lookup of RT_Info
+ // dependency sets by caller or called handle.
+
+ typedef typename DEPENDENCY_SET_MAP::ITERATOR DEPENDENCY_SET_MAP_ITERATOR;
+ // Type of iterator for traversal of RT_Info dependency sets by
+ // caller or called handle.
+
+ TAO_Reconfig_Scheduler (int enforce_schedule_stability = 0,
+ const CORBA::Double & critical_utilization_threshold = 1.0,
+ const CORBA::Double & noncritical_utilization_threshold = 1.1);
+ // Default constructor.
+
+ TAO_Reconfig_Scheduler (int config_count,
+ ACE_Scheduler_Factory::POD_Config_Info config_info[],
+ int entry_count,
+ ACE_Scheduler_Factory::POD_RT_Info rt_info[],
+ int dependency_count,
+ ACE_Scheduler_Factory::POD_Dependency_Info dependency_info[],
+ u_long stability_flags,
+ int enforce_schedule_stability = 0,
+ const CORBA::Double & critical_utilization_threshold = 1.0,
+ const CORBA::Double & noncritical_utilization_threshold = 1.1);
+ // Constructor. Initialize the scheduler from POD_Config_Info, POD_RT_Info,
+ // and POD_Dependency arrays, plus schedule stability flags.
+
+ ~TAO_Reconfig_Scheduler ();
+ // Destructor.
+
+ int init (int config_count,
+ ACE_Scheduler_Factory::POD_Config_Info config_info[],
+ int rt_info_count,
+ ACE_Scheduler_Factory::POD_RT_Info rt_info[],
+ int dependency_count,
+ ACE_Scheduler_Factory::POD_Dependency_Info dependency_info[],
+ u_long stability_flags
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::DUPLICATE_NAME,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL));
+ // Initializes the scheduler with the passed information.
+
+ void close (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Closes the scheduler, releasing all current resources.
+
+ virtual RtecScheduler::handle_t create (const char * entry_point
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::DUPLICATE_NAME,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Create an RT_Info. If it does not exist, a new RT_Info is
+ // created and inserted into the schedule, and the handle of the new
+ // RT_Info is returned. If the RT_Info already exists, an exception
+ // is thrown.
+
+ virtual RtecScheduler::handle_t lookup (const char * entry_point
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Lookup a handle for an RT_Info, and return its handle, or an error
+ // value if it's not present.
+
+ virtual RtecScheduler::RT_Info* get (RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Return a pointer to the RT_Info corresponding to the passed handle.
+
+ virtual void set (::RtecScheduler::handle_t handle,
+ ::RtecScheduler::Criticality_t criticality,
+ ::RtecScheduler::Time time,
+ ::RtecScheduler::Time typical_time,
+ ::RtecScheduler::Time cached_time,
+ ::RtecScheduler::Period_t period,
+ ::RtecScheduler::Importance_t importance,
+ ::RtecScheduler::Quantum_t quantum,
+ ::RtecScheduler::Threads_t threads,
+ ::RtecScheduler::Info_Type_t info_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Set characteristics of the RT_Info corresponding to the passed handle.
+
+ virtual void reset (RtecScheduler::handle_t handle,
+ RtecScheduler::Criticality_t criticality,
+ RtecScheduler::Time time,
+ RtecScheduler::Time typical_time,
+ RtecScheduler::Time cached_time,
+ RtecScheduler::Period_t period,
+ RtecScheduler::Importance_t importance,
+ RtecScheduler::Quantum_t quantum,
+ CORBA::Long threads,
+ RtecScheduler::Info_Type_t info_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Reset characteristics of the RT_Info corresponding to the passed handle.
+
+ virtual void set_seq (const RtecScheduler::RT_Info_Set& infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Set characteristics of the RT_Infos corresponding to the passed handles.
+ // Tuples are added in the case of existing and/or multiple definitions.
+
+ virtual void reset_seq (const RtecScheduler::RT_Info_Set& infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Reset characteristics of the RT_Infos corresponding to the passed handles.
+ // Tuples are replaced in the case of existing and/or multiple definitions.
+
+ virtual void replace_seq (const RtecScheduler::RT_Info_Set& infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::SYNCHRONIZATION_FAILURE));
+ // Replace all RT_Infos, resetting characteristics of the RT_Infos
+ // corresponding to the passed handles. All other RT_Infos are
+ // reset to their uninitialized values, i.e., the same they have
+ // just after the create call.
+
+ virtual void priority (RtecScheduler::handle_t handle,
+ RtecScheduler::OS_Priority& o_priority,
+ RtecScheduler::Preemption_Subpriority_t& p_subpriority,
+ RtecScheduler::Preemption_Priority_t& p_priority
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::NOT_SCHEDULED));
+ // Returns the priority and subpriority values assigned to an RT_Info,
+ // based on its handle.
+
+ virtual void entry_point_priority (const char * entry_point,
+ RtecScheduler::OS_Priority& o_priority,
+ RtecScheduler::Preemption_Subpriority_t& p_subpriority,
+ RtecScheduler::Preemption_Priority_t& p_priority
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::NOT_SCHEDULED));
+ // Returns the priority and subpriority values assigned to an RT_Info,
+ // based on its entry point name.
+
+ virtual void add_dependency (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method registers a dependency between two RT_Infos.
+
+ virtual void remove_dependency (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method removes a dependency between two RT_Infos.
+
+ virtual void set_dependency_enable_state (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type,
+ RtecScheduler::Dependency_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method sets the enable state of a dependency between two RT_Infos.
+
+ virtual void set_dependency_enable_state_seq (const RtecScheduler::Dependency_Set & dependencies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method sets the enable state of a sequence of dependencies.
+
+ virtual void set_rt_info_enable_state (RtecScheduler::handle_t handle,
+ RtecScheduler::RT_Info_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method enables or disables an RT_Info.
+
+ virtual void set_rt_info_enable_state_seq (const RtecScheduler::RT_Info_Enable_State_Pair_Set & pair_set
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method enables or disables a sequence of RT_Infos.
+
+ virtual void compute_scheduling (CORBA::Long minimum_priority,
+ CORBA::Long maximum_priority,
+ RtecScheduler::RT_Info_Set_out infos,
+ RtecScheduler::Dependency_Set_out dependencies,
+ RtecScheduler::Config_Info_Set_out configs,
+ RtecScheduler::Scheduling_Anomaly_Set_out anomalies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UTILIZATION_BOUND_EXCEEDED,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS,
+ RtecScheduler::TASK_COUNT_MISMATCH,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::DUPLICATE_NAME));
+ // If information has been added or changed since the last stable
+ // schedule was computed, this method causes scheduling information
+ // to be computed for all registered RT_Infos. If the schedule is
+ // already stable, this is a no-op.
+
+ virtual void recompute_scheduling (CORBA::Long minimum_priority,
+ CORBA::Long maximum_priority,
+ RtecScheduler::Scheduling_Anomaly_Set_out anomalies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UTILIZATION_BOUND_EXCEEDED,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS,
+ RtecScheduler::TASK_COUNT_MISMATCH,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::DUPLICATE_NAME));
+ // Recomputes the scheduling priorities, etc.
+
+ virtual void get_rt_info_set (RtecScheduler::RT_Info_Set_out infos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL));
+ // Returns the set of rt_infos, with their assigned priorities (as
+ // of the last schedule re-computation).
+
+ virtual void get_dependency_set (RtecScheduler::Dependency_Set_out dependencies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL));
+ // Returns the set of rt_infos, with their assigned priorities (as
+ // of the last schedule re-computation).
+
+ virtual void get_config_info_set (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL));
+ // Returns the set of config_infos, describing the appropriate
+ // number, types, and priority levels for the dispatching lanes.
+
+
+ virtual void dispatch_configuration (RtecScheduler::Preemption_Priority_t p_priority,
+ RtecScheduler::OS_Priority& o_priority,
+ RtecScheduler::Dispatching_Type_t & d_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::NOT_SCHEDULED,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::UNKNOWN_PRIORITY_LEVEL));
+ // Provides the thread priority and queue type for the given priority level.
+
+ virtual RtecScheduler::Preemption_Priority_t last_scheduled_priority (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::NOT_SCHEDULED));
+ // Returns the last priority number assigned to an operation in the
+ // schedule. The number returned is one less than the total number
+ // of scheduled priorities. All scheduled priorities range from 0
+ // to the number returned, inclusive.
+
+ virtual void get_config_infos (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::NOT_SCHEDULED));
+ // Provides the set of Config_Infos associated with the current schedule.
+
+ // = Accessors that allow controlled relaxations of encapsulation.
+
+ RECONFIG_SCHED_STRATEGY & sched_strategy ();
+ // Accesses scheduling strategy for the reconfig scheduler.
+
+ CONFIG_INFO_MAP & config_info_map ();
+ // Accesses map for O(1) lookup of Config_Infos by priority level.
+
+ long config_info_count ();
+ // Returns the number of config infos, which is also the number of
+ // assigned priority levels.
+
+ RT_INFO_MAP & rt_info_map ();
+ // Accesses map for O(1) lookup of RT_Infos by handle.
+
+ long rt_info_count ();
+ // Returns the number of registered RT_Infos.
+
+ long rt_info_tuple_count ();
+ // Returns the number of registered RT_Info tuples.
+
+ RT_INFO_TREE & rt_info_tree ();
+ // Accesses tree for O(log n) lookup of RT_Infos by name.
+
+ DEPENDENCY_SET_MAP & calling_dependency_set_map ();
+ // Accesses map for O(1) lookup of RT_Info dependency
+ // set by the caller operation's handle.
+
+ DEPENDENCY_SET_MAP & called_dependency_set_map ();
+ // Accesses map for O(1) lookup of RT_Info dependency
+ // set by the called operation's handle.
+
+ int dependency_count ();
+ // Returns the number of dependencies in the dependency lists of all RT_Infos.
+ // This is used when traversing the dependency graph.
+
+ CORBA::Double noncritical_utilization ();
+ // Accessor for utilization by noncritical tasks.
+
+ CORBA::Double critical_utilization ();
+ // Accessor for utilization by critical tasks.
+
+ CORBA::Double noncritical_utilization_threshold ();
+ // Accessor for noncritical task utilization threshold.
+
+ void noncritical_utilization_threshold (const CORBA::Double &);
+ // Mutator for noncritical task utilization threshold.
+
+ CORBA::Double critical_utilization_threshold ();
+ // Accessor for critical task utilization threshold.
+
+ void critical_utilization_threshold (const CORBA::Double &);
+ // Mutator for critical task utilization threshold.
+
+protected:
+
+ // @@ TO DO: use a memento to save and restore scheduler state without
+ // breaking encapsulation, particularly of these flags.
+
+ // @@ TO DO: Recheck the applicability and fine-grain management of
+ // these flags. Do these still correctly reflect the phases
+ // of the computation?
+
+ enum Stability_Flags
+ {
+ // This should always be zero.
+ SCHED_ALL_STABLE = 0x00UL,
+
+ // Individual stability flags, each of
+ // which should have a distinct bit value.
+
+ // Utilization may need to be recomputed.
+ SCHED_UTILIZATION_NOT_STABLE = 0x01UL,
+
+ // Priorities may need to be recomputed.
+ SCHED_PRIORITY_NOT_STABLE = 0x02UL,
+
+ // Characteristics may need to be repropagated.
+ SCHED_PROPAGATION_NOT_STABLE = 0x04UL,
+
+ // This should be the disjunction of
+ // all the individual stability flags.
+ SCHED_NONE_STABLE =
+ SCHED_UTILIZATION_NOT_STABLE |
+ SCHED_PRIORITY_NOT_STABLE |
+ SCHED_PROPAGATION_NOT_STABLE
+ };
+ // Flags indicating stability conditions of schedule.
+
+ TAO_RT_Info_Ex * create_i (const char * entry_point,
+ RtecScheduler::handle_t handle,
+ int ignore_duplicates
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::DUPLICATE_NAME,
+ RtecScheduler::INTERNAL));
+ // Internal method to create an RT_Info. If it does not exist, a
+ // new RT_Info is created and inserted into the schedule, and the
+ // handle of the new RT_Info is returned. If the RT_Info already
+ // exists, then if the ignore_duplicates flag is set, the handle
+ // is simply returned; otherwise, an exception is thrown.
+
+ void set_i (TAO_RT_Info_Ex *rt_info,
+ RtecScheduler::Criticality_t criticality,
+ RtecScheduler::Time time,
+ RtecScheduler::Time typical_time,
+ RtecScheduler::Time cached_time,
+ RtecScheduler::Period_t period,
+ RtecScheduler::Importance_t importance,
+ RtecScheduler::Quantum_t quantum,
+ CORBA::Long threads,
+ RtecScheduler::Info_Type_t info_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL));
+ // Internal method to set characteristics of the passed RT_Info.
+
+ virtual RtecScheduler::handle_t lookup_i (const char * entry_point
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK));
+ // Internal method to look up a handle for an RT_Info, and return
+ // its handle, or an exception if it's not present.
+
+ virtual void priority_i (RtecScheduler::handle_t handle,
+ RtecScheduler::OS_Priority& o_priority,
+ RtecScheduler::Preemption_Subpriority_t& p_subpriority,
+ RtecScheduler::Preemption_Priority_t& p_priority
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::UNKNOWN_TASK,
+ RtecScheduler::NOT_SCHEDULED));
+ // Internal method to return the priority and subpriority
+ // values assigned to an RT_Info, based on its handle.
+
+ virtual void add_dependency_i (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type,
+ RtecScheduler::Dependency_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK));
+ // Internal method that registers a dependency between two RT_Infos.
+ // Assumes it is being called with all locks held, and does *not*
+ // set any schedule stability flags.
+
+ virtual void remove_dependency_i (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK));
+ // Internal method that removes a dependency between two RT_Infos.
+ // Assumes it is being called with all locks held, and does *not*
+ // set any schedule stability flags.
+
+ virtual void set_dependency_enable_state_i (RtecScheduler::handle_t handle,
+ RtecScheduler::handle_t dependency,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type,
+ RtecScheduler::Dependency_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK));
+ // Internal method that enables or disables a dependency between two RT_Infos.
+ // Assumes it is being called with all locks held, and does *not*
+ // set any schedule stability flags.
+
+
+ virtual void map_dependency_i
+ (RtecScheduler::handle_t key,
+ RtecScheduler::handle_t handle,
+ ACE_TYPENAME TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP &dependency_map,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type,
+ RtecScheduler::Dependency_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method installs a dependency in a dependency set map.
+
+ void unmap_dependency_i (RtecScheduler::handle_t key,
+ RtecScheduler::handle_t handle,
+ ACE_TYPENAME TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP &dependency_map,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method removes a dependency from a dependency set map.
+
+ void map_dependency_enable_state_i (RtecScheduler::handle_t key,
+ RtecScheduler::handle_t handle,
+ ACE_TYPENAME
+ TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP &dependency_map,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type,
+ RtecScheduler::Dependency_Enabled_Type_t enabled
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNKNOWN_TASK));
+ // This method updates the enable state of a dependency in a dependency set map.
+
+ virtual void dfs_traverse_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL));
+ // Traverses dependency graph, assigning a topological ordering.
+ // Resets DFS map entries, do DFS traversal, constructs DFS map.
+
+ virtual void detect_cycles_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::CYCLIC_DEPENDENCIES));
+ // Sorts an array of RT_info handles in topological order, then
+ // checks for loops, marks unresolved remote dependencies.
+
+ void perform_admission_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((RtecScheduler::UTILIZATION_BOUND_EXCEEDED,
+ CORBA::SystemException,
+ RtecScheduler::INTERNAL));
+ // Compute aggregate execution times, then performs admission over
+ // rate tuples.
+
+
+ void crit_dfs_traverse_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL));
+ // Traverses criticality dependency graph, assigning a topological
+ // ordering. Resets DFS map entries, do DFS traversal, constructs
+ // DFS map.
+
+
+ void propagate_criticalities_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL));
+ // Propagates criticalities.
+
+
+ void propagate_characteristics_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::UNRESOLVED_LOCAL_DEPENDENCIES,
+ RtecScheduler::THREAD_SPECIFICATION));
+ // Propagates effective execution time and period, sets total frame size.
+
+ virtual void assign_priorities_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL,
+ RtecScheduler::DUPLICATE_NAME));
+ // Sort operations by urgency (done by strategy), then assign
+ // priorities and subpriorities in one pass. (Re)computes utilization
+ // and sets last scheduled priority and last feasible priority.
+
+ void refresh_tuple_ptr_array_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL));
+ // Refreshes the array of tuple pointers, corrects the count.
+
+/* WSOA merge - commented out
+ virtual void compute_utilization_i (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::INTERNAL));
+ // Compute utilization, set last feasible priority.
+
+
+ static void init_rt_info (RtecScheduler::RT_Info &rt_info)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Helper method to give an RT_Info some reasonable default values
+*/
+ // = Protected class members.
+
+ RECONFIG_SCHED_STRATEGY sched_strategy_;
+ // Scheduling strategy for the reconfig scheduler.
+
+ CONFIG_INFO_MAP config_info_map_;
+ // Map for O(1) lookup of Config_Infos by priority level.
+
+ long config_info_count_;
+ // The number of config infos, which is also the number of priority
+ // levels.
+
+ RT_INFO_MAP rt_info_map_;
+ // Map for O(1) lookup of RT_Infos by handle.
+
+ long rt_info_count_;
+ // The number of registered RT_Infos.
+
+ long rt_info_tuple_count_;
+ // The number of registered RT_Info tuples.
+
+ RT_INFO_TREE rt_info_tree_;
+ // Tree for O(log n) lookup of RT_Infos by name.
+
+ DEPENDENCY_SET_MAP calling_dependency_set_map_;
+ // Map for O(1) lookup of RT_Info dependency
+ // set by the caller operation's handle.
+
+ DEPENDENCY_SET_MAP called_dependency_set_map_;
+ // Map for O(1) lookup of RT_Info dependency
+ // set by the called operation's handle.
+
+ DEPENDENCY_SET_MAP crit_dependency_set_map_;
+ // Map for O(1) lookup of RT_Info dependency set. The above two maps
+ // store the calling and called dependencies. This map stores the
+ // true dependencies based on criticality propagation direction. For
+ // two-ways, this is the same as the direction of invocation,
+ // whereas for one-ways, it is in the opposite direction.
+
+ RtecScheduler::handle_t next_handle_;
+ // Next RT_Info descriptor handle to allocate. The first handle is
+ // always 1.
+
+ TAO_Reconfig_Scheduler_Entry ** entry_ptr_array_;
+ // Array of pointers to scheduling entries. This
+ // array is maintained by the methods that create
+ // scheduling entries, and sorted in topological
+ // order and then priority order at various points
+ // during schedule computation.
+
+ long entry_ptr_array_size_;
+ // Size of the array of scheduling entry pointers.
+
+ TAO_RT_Info_Tuple ** tuple_ptr_array_;
+ // Array of pointers to scheduling entries. This
+ // array is maintained by the methods that create
+ // scheduling entries, and sorted in topological
+ // order and then priority order at various points
+ // during schedule computation.
+
+ long tuple_ptr_array_size_;
+ // Size of the array of scheduling entry pointers.
+
+ u_long stability_flags_;
+ // Flags indicating whether a stable schedule has been computed
+ // since the last addition or modification of information, and which
+ // parts of the schedule are unstable.
+
+ int enforce_schedule_stability_;
+ // Indicates whether the scheduler should enforce stability by
+ // throwing an exception: otherwise for operations where this
+ // matters, it will simply return a default value if nothing
+ // has been generated.
+
+ int dependency_count_;
+ // The number of dependencies in the dependency lists of all RT_Infos.
+ // This is used when traversing the dependency graph.
+
+ RtecScheduler::Preemption_Priority_t last_scheduled_priority_;
+ // Stores the last priority for which an operation can be scheduled
+
+ CORBA::Double noncritical_utilization_;
+ // Utilization by noncritical tasks.
+
+ CORBA::Double critical_utilization_;
+ // Utilization by critical tasks.
+
+ CORBA::Double noncritical_utilization_threshold_;
+ // Utilization by noncritical tasks.
+
+ CORBA::Double critical_utilization_threshold_;
+ // Utilization by critical tasks.
+
+ ACE_LOCK mutex_;
+ // Mutual exclusion lock for the scheduler itself. This is needed to
+ // synchronize updates and accesses to scheduling information.
+};
+
+
+template <class ARRAY_ELEMENT_TYPE> void
+maintain_scheduling_array (ARRAY_ELEMENT_TYPE ** & current_ptr_array,
+ long & current_ptr_array_size,
+ RtecScheduler::handle_t handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+// Helper function: makes sure there is room in the scheduling pointer
+// arrays. This function expands the array eagerly, to minimize time
+// overhead for memory allocation (at a cost of some unused space).
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Sched/Reconfig_Scheduler_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Reconfig_Scheduler_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+
+#include /**/ "ace/post.h"
+#endif /* TAO_RECONFIG_SCHEDULER_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.cpp b/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.cpp
new file mode 100644
index 00000000000..5dc53ae9ffb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.cpp
@@ -0,0 +1,938 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// sched
+//
+// = FILENAME
+// SchedEntry.cpp
+//
+// = CREATION DATE
+// 7 February 1998
+//
+// = AUTHOR
+// Chris Gill
+//
+// ============================================================================
+
+#include "orbsvcs/Sched/SchedEntry.h"
+#include "ace/SString.h"
+#include "ace/OS_NS_stdio.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Sched/SchedEntry.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Sched, SchedEntry, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+Task_Entry::Task_Entry (void)
+ : rt_info_ (0),
+ effective_period_(0),
+ dfs_status_ (NOT_VISITED),
+ discovered_ (-1),
+ finished_ (-1),
+ is_thread_delineator_ (0),
+ has_unresolved_remote_dependencies_ (0),
+ has_unresolved_local_dependencies_ (0),
+ calls_ (),
+ callers_ ()
+{
+}
+
+Task_Entry::~Task_Entry (void)
+{
+ // Zero out the task entry ACT in the corresponding rt_info
+ rt_info_->volatile_token = 0;
+
+ ACE_Unbounded_Set_Iterator <Task_Entry_Link *> iter(calls_);
+ Task_Entry_Link **link = 0;
+
+ // Iterate through the "calls" set of Task Entry Links and free each one
+
+ for (iter.first ();
+ ! iter.done ();
+ iter.advance (), link = 0)
+ {
+ if (iter.next (link) != 0 && link != 0 && *link != 0)
+ {
+ // remove the link object pointer from the calling entry's
+ // "callers" set and destroy the link object
+ (*link)->called ().callers_.remove (*link);
+ delete (*link);
+ }
+ }
+}
+
+// Merge dispatches according to info type and type of call, update
+// relevant scheduling characteristics for this entry.
+
+Task_Entry::Propagation_Status
+Task_Entry::merge_dispatches (ACE_Unbounded_Set <Dispatch_Entry *> &dispatch_entries,
+ ACE_CString &unresolved_locals,
+ ACE_CString &unresolved_remotes)
+{
+ Task_Entry::Propagation_Status result = SUCCEEDED;
+ switch (info_type ())
+ {
+ case RtecScheduler::DISJUNCTION:
+
+ // Prohibit two-way dispatches of a disjunction group, and
+ // disjunctively merge its one-way dispatches. NOTE: one
+ // interpretation of disjunction for two-way calls is that the
+ // caller calls one OR the other, but this is problematic: how
+ // do we map the dispatches for this ?
+ if (prohibit_dispatches (RtecBase::TWO_WAY_CALL) < 0)
+ result = TWO_WAY_DISJUNCTION;
+
+ if (disjunctive_merge (RtecBase::ONE_WAY_CALL,
+ dispatch_entries,
+ unresolved_locals,
+ unresolved_remotes) < 0)
+ result = INTERNAL_ERROR;
+ break;
+
+ case RtecScheduler::CONJUNCTION:
+
+ // Prohibit two-way dispatches of a conjunction group,
+ // and conjunctively merge its one-way dispatches.
+ // NOTE: one interpretation of disjunction for two-way calls
+ // is that the caller calls BOTH, so that there is a
+ // disjunctive merge of each two-way, as for the OPERATION
+ // (prohibit for now, as the additional complexity of allowing
+ // conjunctions of two-ways, but not disjunctions does not
+ // buy us anything, anyway).
+ if (prohibit_dispatches (RtecBase::TWO_WAY_CALL) < 0)
+ result = TWO_WAY_CONJUNCTION;
+ if (conjunctive_merge (RtecBase::ONE_WAY_CALL,
+ dispatch_entries,
+ unresolved_locals,
+ unresolved_remotes) < 0)
+ result = INTERNAL_ERROR;
+ break;
+
+ case RtecScheduler::OPERATION:
+ case RtecScheduler::REMOTE_DEPENDANT:
+
+ // Disjunctively merge the operation's two-way dispatches, and
+ // conjunctively merge its one-way dispatches.
+ if (disjunctive_merge (RtecBase::TWO_WAY_CALL,
+ dispatch_entries,
+ unresolved_locals,
+ unresolved_remotes) < 0)
+ result = INTERNAL_ERROR;
+ if (conjunctive_merge (RtecBase::ONE_WAY_CALL,
+ dispatch_entries,
+ unresolved_locals,
+ unresolved_remotes) < 0)
+ result = INTERNAL_ERROR;
+ break;
+
+ default:
+
+ // There should not be any other kind of RT_Info, or if there
+ // is, the above switch logic is in need of repair.
+ result = UNRECOGNIZED_INFO_TYPE;
+ break;
+ }
+
+ return result;
+}
+
+// Prohibit calls of the given type: currently used to enforce the
+// notion that two-way calls to disjunctive or conjunctive RT_Infos do
+// not have any defined meaning, and thus should be considered
+// dependency specification errors: if these constraints are removed
+// in the future, this method should be removed as well Returns 0 if
+// all is well, or -1 if an error has occurred.
+
+int
+Task_Entry::prohibit_dispatches (Dependency_Type dt)
+{
+ // Iterate over the set of dependencies, ensuring none of them has
+ // the given dependency type.
+ for (ACE_Unbounded_Set_Iterator <Task_Entry_Link *> iter (callers_);
+ ! iter.done ();
+ iter.advance ())
+ {
+ Task_Entry_Link **link;
+
+ if (iter.next (link) == 0
+ || link == 0
+ || *link == 0
+ || (*link)->dependency_type () == dt)
+ return -1;
+ }
+
+ return 0;
+}
+
+// Perform disjunctive merge of arrival times of oneway calls: all
+// arrival times of all dependencies are duplicated by the multiplier
+// and repetition over the new frame size.
+
+int
+Task_Entry::disjunctive_merge (Dependency_Type dt,
+ ACE_Unbounded_Set <Dispatch_Entry *> &dispatch_entries,
+ ACE_CString &unresolved_locals,
+ ACE_CString &unresolved_remotes)
+{
+ char string_buffer[BUFSIZ];
+
+ // Iterate over the set of dependencies, merging dispatches of the
+ // callers over the enclosing frame size.
+ for (ACE_Unbounded_Set_Iterator <Task_Entry_Link *> iter (callers_);
+ ! iter.done ();
+ iter.advance ())
+ {
+ Task_Entry_Link **link;
+
+ if (iter.next (link) == 0
+ || link == 0
+ || *link == 0)
+ return -1;
+
+ // The link matches the dependency type given
+ if ((*link)->dependency_type () == dt)
+ {
+ // Check for and warn about unresolved remote dependencies
+ // in the ONE_WAY call graph.
+ if ((*link)->dependency_type () == RtecBase::ONE_WAY_CALL
+ && (*link)->caller ().has_unresolved_remote_dependencies ()
+ && ! this->has_unresolved_remote_dependencies ())
+ {
+ // Propagate the unresolved remote dependency flag, and
+ // issue a debug scheduler warning.
+ this->has_unresolved_remote_dependencies (1);
+ ACE_DEBUG ((LM_DEBUG,
+ "Warning: an operation identified by "
+ "\"%s\" has unresolved remote dependencies.\n",
+ (const char*) this->rt_info ()->entry_point));
+
+ // Record entry point in list of unresolved remote
+ // dependencies
+ ACE_OS::sprintf (string_buffer,
+ "// %s\n",
+ (const char*) this->rt_info ()->entry_point);
+ unresolved_remotes +=
+ ACE_CString (string_buffer);
+
+ }
+
+ // Check for and warn about unresolved local dependencies in
+ // the ONE_WAY call graph.
+ if ((*link)->dependency_type () == RtecBase::ONE_WAY_CALL
+ && (*link)->caller ().has_unresolved_local_dependencies ()
+ && ! this->has_unresolved_local_dependencies ())
+ {
+ // Propagate the unresolved local dependency flag, and
+ // issue a debug scheduler warning.
+ this->has_unresolved_local_dependencies (1);
+ ACE_DEBUG ((LM_DEBUG,
+ "Warning: an operation identified by "
+ "\"%s\" has unresolved local dependencies.\n",
+ (const char*) this->rt_info ()->entry_point));
+
+ // Record entry point in list of unresolved local
+ // dependencies
+ ACE_OS::sprintf (string_buffer,
+ "// %s\n",
+ (const char*) this->rt_info ()->entry_point);
+ unresolved_locals +=
+ ACE_CString (string_buffer);
+ }
+
+ // Merge the caller's dispatches into the current set.
+ if (merge_frames (dispatch_entries,
+ *this,
+ dispatches_,
+ (*link)->caller ().dispatches_, effective_period_,
+ (*link)->caller ().effective_period_,
+ (*link)->number_of_calls ()) < 0)
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+// Perform conjunctive merge of arrival times of calls: all arrival
+// times of all dependencies are duplicated by the multiplier and
+// repetition over the new frame size and then iteratively merged by
+// choosing the maximal arrival time at the current position in each
+// queue (iteration is in lockstep over all queues, and ends when any
+// queue ends).
+
+int
+Task_Entry::conjunctive_merge (Dependency_Type dt,
+ ACE_Unbounded_Set <Dispatch_Entry *> &dispatch_entries,
+ ACE_CString &unresolved_locals,
+ ACE_CString &unresolved_remotes)
+{
+ int result = 0;
+ char string_buffer [BUFSIZ];
+
+ // Iterate over the dependencies, and determine the total frame
+ // size.
+
+ u_long frame_size = 1;
+
+ ACE_Unbounded_Set_Iterator <Task_Entry_Link *> dep_iter (callers_);
+
+ for (dep_iter.first ();
+ dep_iter.done () == 0;
+ dep_iter.advance ())
+ {
+ Task_Entry_Link **link;
+
+ if (dep_iter.next (link) == 0
+ || link == 0
+ || *link == 0)
+ return -1;
+
+ // The link matches the dependency type given.
+ if ((*link)->dependency_type () == dt)
+ {
+ // Check for and warn about unresolved remote dependencies
+ // in the ONE_WAY call graph.
+ if ((*link)->dependency_type () == RtecBase::ONE_WAY_CALL
+ && (*link)->caller ().has_unresolved_remote_dependencies ()
+ && ! this->has_unresolved_remote_dependencies ())
+ {
+ // Propagate the unresolved remote dependency flag, and
+ // issue a debug scheduler warning.
+ this->has_unresolved_remote_dependencies (1);
+ ACE_DEBUG ((LM_DEBUG,
+ "Warning: an operation identified by "
+ "\"%s\" has unresolved remote dependencies.\n",
+ (const char*) this->rt_info ()->entry_point));
+
+ // Record entry point in list of unresolved remote
+ // dependencies
+ ACE_OS::sprintf (string_buffer,
+ "// %s\n",
+ (const char*) this->rt_info ()->entry_point);
+ unresolved_remotes +=
+ ACE_CString (string_buffer);
+ }
+
+ // Check for and warn about unresolved local dependencies in
+ // the ONE_WAY call graph.
+ if ((*link)->dependency_type () == RtecBase::ONE_WAY_CALL
+ && (*link)->caller ().has_unresolved_local_dependencies ()
+ && ! this->has_unresolved_local_dependencies ())
+ {
+ // Propagate the unresolved local dependency flag, and
+ // issue a debug scheduler warning.
+ this->has_unresolved_local_dependencies (1);
+ ACE_DEBUG ((LM_DEBUG,
+ "Warning: an operation identified by "
+ "\"%s\" has unresolved local dependencies.\n",
+ (const char*) this->rt_info ()->entry_point));
+
+ // Record entry point in list of unresolved local dependencies
+ ACE_OS::sprintf (string_buffer,
+ "// %s\n",
+ (const char*) this->rt_info ()->entry_point);
+ unresolved_locals +=
+ ACE_CString (string_buffer);
+ }
+
+ frame_size = ACE::minimum_frame_size (frame_size,
+ (*link)->caller ().effective_period_);
+ }
+ }
+
+ // Reframe dispatches in the set to the new frame size (expands the
+ // set's effective period to be the new enclosing frame).
+ if (reframe (dispatch_entries,
+ *this, dispatches_,
+ effective_period_,
+ frame_size) < 0)
+ return -1;
+
+ // A container and iterator for virtual dispatch sets over which the
+ // conjunction will operate
+ ACE_Ordered_MultiSet <Dispatch_Proxy_Iterator *> conj_set;
+ ACE_Ordered_MultiSet_Iterator <Dispatch_Proxy_Iterator *> conj_set_iter (conj_set);
+
+ // Iterate over the dependencies, and for each of the given call
+ // type, create a Dispatch_Proxy_Iterator for the caller's dispatch
+ // set, using the caller's period, the total frame size, and the
+ // number of calls: if any of the sets is empty, just return 0;
+ for (dep_iter.first ();
+ dep_iter.done () == 0;
+ dep_iter.advance ())
+ {
+ Task_Entry_Link **link;
+ if (dep_iter.next (link) == 0
+ || link == 0
+ || *link == 0)
+ return -1;
+
+ // The link matches the dependency type given.
+ if ((*link)->dependency_type () == dt)
+ {
+ Dispatch_Proxy_Iterator *proxy_ptr;
+ ACE_NEW_RETURN (proxy_ptr,
+ Dispatch_Proxy_Iterator ((*link)->caller ().dispatches_,
+ (*link)->caller ().effective_period_,
+ frame_size,
+ (*link)->number_of_calls ()),
+ -1);
+
+ // If there are no entries in the virtual set, we're done.
+ if (proxy_ptr->done ())
+ return 0;
+ else if (conj_set.insert (proxy_ptr, conj_set_iter) < 0)
+ return -1;
+ }
+ }
+
+ // loop, adding conjunctive dispatches, until one of the conjunctive
+ // dispatch sources runs out of entries over the total frame
+ conj_set_iter.first ();
+ int more_dispatches = (conj_set_iter.done ()) ? 0 : 1;
+ while (more_dispatches)
+ {
+ Time arrival = 0;
+ Time deadline = 0;
+ Preemption_Priority priority = 0;
+ OS_Priority OS_priority = 0;
+
+ for (conj_set_iter.first ();
+ conj_set_iter.done () == 0;
+ conj_set_iter.advance ())
+ {
+ // initialize to earliest arrival and deadline, and highest priority
+ arrival = 0;
+ deadline = 0;
+ priority = 0;
+ OS_priority = 0;
+
+ // Policy: conjunctively dispatched operations get the
+ // latest deadline of any of the dispatches in the
+ // conjunction at the time they were dispatched - when and
+ // if it is useful to change any of the merge policies, this
+ // should be one of the decisions factored out into the
+ // conjunctive merge strategy class.
+
+ // Policy: conjunctively dispatched operations get the
+ // lowest priority of any of the dispatches in the
+ // conjunction at the time they were dispatched - when and
+ // if it is useful to change any of the merge policies, this
+ // should be one of the decisions factored out into the
+ // conjunctive merge strategy class.
+
+ // Obtain a pointer to the current dispatch proxy iterator.
+ Dispatch_Proxy_Iterator **proxy_iter;
+ if (conj_set_iter.next (proxy_iter) == 0
+ || proxy_iter == 0
+ || *proxy_iter == 0)
+ return -1;
+
+ // Use latest arrival, latest deadline, lowest priority (0 is highest).
+ if (arrival <= (*proxy_iter)->arrival ())
+ arrival = (*proxy_iter)->arrival ();
+ if (deadline <= (*proxy_iter)->deadline ())
+ deadline = (*proxy_iter)->deadline ();
+ if (priority <= (*proxy_iter)->priority ())
+ {
+ priority = (*proxy_iter)->priority ();
+ OS_priority = (*proxy_iter)->OS_priority ();
+ }
+
+ (*proxy_iter)->advance ();
+
+ if ((*proxy_iter)->done ())
+ more_dispatches = 0;
+ }
+
+ Dispatch_Entry *entry_ptr;
+ ACE_NEW_RETURN (entry_ptr,
+ Dispatch_Entry (arrival,
+ deadline,
+ priority,
+ OS_priority,
+ *this),
+ -1);
+
+ // If even one new dispatch was inserted, result is "something
+ // happened".
+ result = 1;
+
+ // Add the new dispatch entry to the set of all dispatches, and
+ // a link to it to the dispatch links for this task entry.
+ if (dispatch_entries.insert (entry_ptr) < 0)
+ return -1;
+
+ // Use iterator for efficient insertion into the dispatch set.
+ ACE_Ordered_MultiSet_Iterator <Dispatch_Entry_Link> insert_iter (dispatches_);
+ if (dispatches_.insert (Dispatch_Entry_Link (*entry_ptr),
+ insert_iter) < 0)
+ return -1;
+
+ // TBD - Clients are not assigned priority, but rather obtain it
+ // from their call dependencies. We could complain here if
+ // there is a priority specified that doesn't match (or is lower
+ // QoS?)
+ }
+
+ return result;
+}
+
+// This static method is used to reframe an existing dispatch set to
+// the given new period multiplier, creating new instances of each
+// existing dispatch (with adjusted arrival and deadline) in each
+// successive sub-frame. Returns 1 if the set was reframed to a new
+// period, 0 if the set was not changed (the new period was not a
+// multiple of the old one), or -1 if an error occurred.
+
+int
+Task_Entry::reframe (ACE_Unbounded_Set <Dispatch_Entry *> &dispatch_entries,
+ Task_Entry &owner,
+ ACE_Ordered_MultiSet <Dispatch_Entry_Link> &set,
+ u_long &set_period, u_long new_period)
+{
+ int result = 0;
+
+ // if the set period is zero, treat it as uninitialized,
+ // and simply value the set period with the new period
+ if (set_period)
+ {
+ // make sure the new period is greater than the current
+ // set period, and that they are harmonically related
+ if (new_period <= set_period)
+ // return an error if they're not harmonically related,
+ // do nothing if set's frame is a multiple of the new frame
+ return (set_period % new_period) ? -1 : 0;
+ else if (new_period % set_period)
+ return -1;
+
+ // make a shallow copy of the set in a new ordered multiset
+ // using the Dispatch_Entry_Link smart pointers
+ ACE_Ordered_MultiSet <Dispatch_Entry_Link> new_set;
+ ACE_Ordered_MultiSet_Iterator <Dispatch_Entry_Link> new_iter (new_set);
+ ACE_Ordered_MultiSet_Iterator <Dispatch_Entry_Link> set_iter (set);
+
+ for (set_iter.first (); set_iter.done () == 0; set_iter.advance ())
+ {
+ Dispatch_Entry_Link *link;
+
+ if (set_iter.next (link) == 0)
+ return -1;
+ else if (new_set.insert (*link, new_iter) < 0)
+ return -1;
+ }
+
+ // Do a deep copy merge back into the set using the new period
+ // and starting after the 0th sub-frame: this puts all
+ // dispatches after the 0th sub-frame of the new period into the
+ // set, and leaves existing dispatches in the 0th sub-frame of
+ // the new period in the set as well.
+ result = merge_frames (dispatch_entries,
+ owner,
+ set,
+ new_set,
+ new_period,
+ set_period,
+ 1,
+ 1);
+ }
+
+ // update the set's period to be the new frame
+ set_period = new_period;
+
+ return result;
+}
+
+// This static method is used to merge an existing dispatch set,
+// multiplied by the given multipliers for the period and number of
+// instances in each period of each existing dispatch, into the given
+// "into" set, without affecting the "from set".
+
+int
+Task_Entry::merge_frames (ACE_Unbounded_Set <Dispatch_Entry *> &dispatch_entries,
+ Task_Entry &owner,
+ ACE_Ordered_MultiSet <Dispatch_Entry_Link> &dest,
+ ACE_Ordered_MultiSet <Dispatch_Entry_Link> &src,
+ u_long &dest_period,
+ u_long src_period,
+ u_long number_of_calls,
+ u_long starting_dest_sub_frame)
+{
+ int status = 0;
+
+ // reframe dispatches in the destination set to the new frame size
+ // (expands the destination set's period to be the new enclosing frame)
+ if (reframe (dispatch_entries,
+ owner,
+ dest,
+ dest_period,
+ ACE::minimum_frame_size (dest_period,
+ src_period)) < 0)
+ return -1;
+
+ // use iterator for efficient insertion into the destination set
+ ACE_Ordered_MultiSet_Iterator <Dispatch_Entry_Link> dest_iter (dest);
+
+ // do virtual iteration over the source set in the new frame, adding
+ // adjusted dispatch entries to the destination
+ Dispatch_Proxy_Iterator src_iter (src,
+ src_period,
+ dest_period,
+ number_of_calls,
+ starting_dest_sub_frame);
+
+ for (src_iter.first (starting_dest_sub_frame);
+ src_iter.done () == 0;
+ src_iter.advance ())
+ {
+ // Policy: disjunctively dispatched operations get their
+ // deadline and priority from the original dispatch - when and
+ // if it is useful to change any of the merge policies, this
+ // should be one of the decisions factored out into the
+ // disjunctive merge strategy class.
+
+ Dispatch_Entry *entry_ptr;
+ ACE_NEW_RETURN (entry_ptr,
+ Dispatch_Entry (src_iter.arrival (),
+ src_iter.deadline (),
+ src_iter.priority (),
+ src_iter.OS_priority (),
+ owner),
+ -1);
+
+ // if even one new dispatch was inserted, status is "something happened".
+ status = 1;
+
+ // add the new dispatch entry to the set of all dispatches, and
+ // a link to it to the dispatch links for this task entry
+ if (dispatch_entries.insert (entry_ptr) < 0)
+ return -1;
+
+ else if (dest.insert (Dispatch_Entry_Link (*entry_ptr), dest_iter) < 0)
+ return -1;
+
+ // TBD - Clients are not assigned priority, but rather obtain it
+ // from their call dependencies. We could complain here if
+ // there is a priority specified that doesn't match (or is lower
+ // QoS?)
+ }
+
+ return status;
+}
+
+Task_Entry_Link::Task_Entry_Link (Task_Entry &caller,
+ Task_Entry &called,
+ CORBA::Long number_of_calls,
+ RtecScheduler::Dependency_Type_t dependency_type)
+ : number_of_calls_ (number_of_calls),
+ caller_ (caller),
+ called_ (called),
+ dependency_type_ (dependency_type)
+{
+}
+
+Dispatch_Entry::Dispatch_Id Dispatch_Entry::next_id_ = 0;
+
+Dispatch_Entry::Dispatch_Entry (Time arrival,
+ Time deadline,
+ Preemption_Priority priority,
+ OS_Priority os_priority,
+ Task_Entry &task_entry,
+ Dispatch_Entry *original_dispatch)
+ : priority_ (priority),
+ OS_priority_ (os_priority),
+ dynamic_subpriority_ (0),
+ static_subpriority_ (0),
+ arrival_ (arrival),
+ deadline_ (deadline),
+ task_entry_ (task_entry),
+ original_dispatch_ (original_dispatch)
+{
+ // obtain, increment the next id
+ dispatch_id_ = next_id_++;
+}
+
+Dispatch_Entry::Dispatch_Entry (const Dispatch_Entry &d)
+ : priority_ (d.priority_),
+ OS_priority_ (d.OS_priority_),
+ dynamic_subpriority_ (d.dynamic_subpriority_),
+ static_subpriority_ (d.static_subpriority_),
+ arrival_ (d.arrival_),
+ deadline_ (d.deadline_),
+ task_entry_ (d.task_entry_),
+ original_dispatch_ (d.original_dispatch_)
+{
+ // obtain, increment the next id
+ dispatch_id_ = next_id_++;
+}
+
+bool
+Dispatch_Entry::operator < (const Dispatch_Entry &d) const
+{
+ // for positioning in the ordered dispatch multiset
+
+ // lowest arrival time first
+ if (this->arrival_ != d.arrival_)
+ return this->arrival_ < d.arrival_ ? true : false;
+
+ // highest priority second
+ if (this->priority_ != d.priority_)
+ return this->priority_ > d.priority_ ? true : false;
+
+ // lowest laxity (highest dynamic sub-priority) third Just use low
+ // 32 bits of worst_case_execution_time. This will have to change
+ // when TimeBase.idl is finalized.
+ //
+ // NOTE: Leave the -= code intact as it's a workaround of a BCB4
+ // internal compiler error.
+ Time this_laxity = deadline_;
+ this_laxity -= task_entry ().rt_info ()->worst_case_execution_time;
+
+ Time that_laxity = d.deadline_;
+ that_laxity -= d.task_entry ().rt_info ()->worst_case_execution_time;
+
+ if (this_laxity != that_laxity)
+ return (this_laxity < that_laxity) ? true : false;
+
+ // finally, by higher importance
+ return (task_entry ().rt_info ()->importance >
+ d.task_entry ().rt_info ()->importance) ? true : false;
+}
+
+// ctor
+
+Dispatch_Entry_Link::Dispatch_Entry_Link (Dispatch_Entry &d)
+ : dispatch_entry_ (d)
+{
+}
+
+// copy ctor
+
+Dispatch_Entry_Link::Dispatch_Entry_Link (const Dispatch_Entry_Link &d)
+ : dispatch_entry_ (d.dispatch_entry_)
+{
+}
+
+// ctor
+
+Dispatch_Proxy_Iterator::Dispatch_Proxy_Iterator
+ (ACE_Ordered_MultiSet <Dispatch_Entry_Link> &set,
+ u_long actual_frame_size,
+ u_long virtual_frame_size,
+ u_long number_of_calls,
+ u_long starting_sub_frame)
+ : number_of_calls_ (number_of_calls),
+ current_call_ (0),
+ actual_frame_size_ (actual_frame_size),
+ virtual_frame_size_ (virtual_frame_size),
+ current_frame_offset_ (actual_frame_size * starting_sub_frame),
+ iter_ (set)
+{
+ first (starting_sub_frame);
+}
+
+// positions the iterator at the first entry of the passed sub-frame,
+// returns 1 if it could position the iterator correctly, 0 if not,
+// and -1 if an error occurred.
+
+int
+Dispatch_Proxy_Iterator::first (u_int sub_frame)
+{
+ if (actual_frame_size_ * (sub_frame) >= virtual_frame_size_)
+ {
+ // can not position the virtual iterator
+ // in the given range: do nothing
+ return 0;
+ }
+
+ // restart the call counter
+ current_call_ = 0;
+
+ // use the given sub-frame offset if it's valid
+ current_frame_offset_ = actual_frame_size_ * sub_frame;
+
+ // restart the iterator
+ return iter_.first ();
+}
+
+// positions the iterator at the last entry of the total frame,
+// returns 1 if it could position the iterator correctly, 0 if not,
+// and -1 if an error occurred.
+
+int
+Dispatch_Proxy_Iterator::last (void)
+{
+ // use the last call
+ current_call_ = number_of_calls_ - 1;
+
+ // use the last sub-frame
+ current_frame_offset_ = virtual_frame_size_ - actual_frame_size_;
+
+ // position the iterator at the last dispatch
+ return iter_.first ();
+}
+
+// positions the iterator at the next entry of the total frame,
+// returns 1 if it could position the iterator correctly, 0 if not,
+// and -1 if an error occurred.
+
+int
+Dispatch_Proxy_Iterator::advance (void)
+{
+ int result = 1;
+
+ if (iter_.done ())
+ result = 0; // cannot retreat if we're out of bounds
+ else if (current_call_ < number_of_calls_ - 1)
+ // if we're still in the same set of calls, increment the call counter
+ ++current_call_;
+ else
+ {
+ // roll over the call counter
+ current_call_ = 0;
+
+ // advance the iterator in the current sub-frame
+ if (! iter_.advance ())
+ {
+ // if we're not already in the last sub_frame
+ if (current_frame_offset_ + actual_frame_size_ < virtual_frame_size_)
+ {
+ // increment the sub-frame offset
+ current_frame_offset_ += actual_frame_size_;
+
+ // restart the iterator at the front of the sub-frame
+ result = iter_.first ();
+ }
+ else
+ result = 0; // cannot advance if we're already at the end
+ }
+ }
+
+ return result;
+}
+
+// positions the iterator at the previous entry of the total frame,
+// returns 1 if it could position the iterator correctly, 0 if not,
+// and -1 if an error occurred.
+
+int
+Dispatch_Proxy_Iterator::retreat (void)
+{
+ int result = 1;
+
+ if (iter_.done ())
+ result = 0; // cannot retreat if we're out of bounds
+ else if (current_call_ > 0)
+ // if we're still in the same set of calls, decrement the call counter
+ --current_call_;
+ else
+ {
+ // roll over the call counter
+ current_call_ = number_of_calls_ - 1;
+
+ // back up the iterator in the current sub-frame
+ if (!iter_.retreat ())
+ {
+ // if we're not already in the 0th sub_frame
+ if (current_frame_offset_ > 0)
+ {
+ // decrement the sub-frame offset
+ current_frame_offset_ -= actual_frame_size_;
+
+ // restart the iterator at the tail of the sub-frame
+ result = iter_.last ();
+ }
+ else
+ result = 0; // cannot retreat if we're already at the start
+ }
+ }
+
+ return result;
+}
+
+// returns the adjusted arrival time of the virtual entry
+
+RtecScheduler::Time
+Dispatch_Proxy_Iterator::arrival (void) const
+{
+ Dispatch_Entry_Link *link;
+ if (iter_.done ()
+ || iter_.next(link) == 0
+ || link == 0)
+ return 0;
+
+ // Just use low 32 bits of arrival. This will have to change when
+ // TimeBase.idl is finalized.
+ return link->dispatch_entry ().arrival () +
+ RtecScheduler::Time (current_frame_offset_);
+}
+
+// returns the adjusted deadline time of the virtual entry
+
+RtecScheduler::Time
+Dispatch_Proxy_Iterator::deadline (void) const
+{
+ Dispatch_Entry_Link *link;
+ if (iter_.done ()
+ || iter_.next(link) == 0
+ || link == 0)
+ return 0;
+
+ // Just use low 32 bits of deadline. This will have to change when
+ // TimeBase.idl is finalized.
+ return link->dispatch_entry ().deadline () +
+ RtecScheduler::Time (current_frame_offset_);
+}
+
+// returns the scheduler priority of the virtual entry
+
+Dispatch_Proxy_Iterator::Preemption_Priority
+Dispatch_Proxy_Iterator::priority (void) const
+{
+ Dispatch_Entry_Link *link;
+
+ if (iter_.done ()
+ || iter_.next(link) == 0
+ || link == 0)
+ return 0;
+
+ return link->dispatch_entry ().priority ();
+}
+
+// returns the OS priority of the virtual entry
+
+Dispatch_Proxy_Iterator::OS_Priority
+Dispatch_Proxy_Iterator::OS_priority (void) const
+{
+ Dispatch_Entry_Link *link;
+ if (iter_.done ()
+ || iter_.next(link) == 0
+ || link == 0)
+ return 0;
+
+ return link->dispatch_entry ().OS_priority ();
+}
+
+// time slice constructor
+
+TimeLine_Entry::TimeLine_Entry (Dispatch_Entry &dispatch_entry,
+ Time start, Time stop,
+ Time arrival, Time deadline,
+ TimeLine_Entry *next,
+ TimeLine_Entry *prev)
+ : dispatch_entry_ (dispatch_entry),
+ start_ (start),
+ stop_ (stop),
+ arrival_ (arrival),
+ deadline_ (deadline),
+ next_ (next),
+ prev_ (prev)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.h b/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.h
new file mode 100644
index 00000000000..e84ceb6cad3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.h
@@ -0,0 +1,648 @@
+// -*- C++ -*-
+
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// sched
+//
+// = FILENAME
+// SchedEntry.h
+//
+// = CREATION DATE
+// 7 February 1998
+//
+// = AUTHOR
+// Chris Gill <cdgill@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef SCHEDENTRY_H
+#define SCHEDENTRY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Sched/sched_export.h"
+#include "orbsvcs/RtecSchedulerC.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "ace/Containers.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//////////////////////
+// Helper Functions //
+//////////////////////
+
+
+// Forward declaration of classes.
+class Task_Entry;
+class Task_Entry_Link;
+class Dispatch_Entry;
+class Dispatch_Entry_Link;
+class Dispatch_Proxy_Iterator;
+
+
+class TAO_RTSched_Export Dispatch_Entry_Link
+// = TITLE
+// Dispatch Entry Link
+//
+// = DESCRIPTION
+// Light-weight sortable "smart pointer" to a dispatch entry.
+//
+{
+public:
+
+ typedef RtecScheduler::handle_t handle_t;
+ typedef RtecScheduler::Dependency_Info Dependency_Info;
+ typedef RtecScheduler::Preemption_Priority_t Preemption_Priority;
+ typedef RtecScheduler::OS_Priority OS_Priority;
+ typedef RtecScheduler::Preemption_Subpriority_t Sub_Priority;
+ typedef RtecScheduler::RT_Info RT_Info;
+ typedef RtecScheduler::Time Time;
+ typedef RtecScheduler::Period_t Period;
+ typedef RtecScheduler::Info_Type_t Info_Type;
+ typedef RtecScheduler::Dependency_Type_t Dependency_Type;
+
+ Dispatch_Entry_Link (Dispatch_Entry &d);
+ // Constructor.
+
+ Dispatch_Entry_Link (const Dispatch_Entry_Link &d);
+ // Copy constructor.
+
+ ~Dispatch_Entry_Link ();
+ // Destructor.
+
+ bool operator < (const Dispatch_Entry_Link &d) const;
+ // Less than comparison operator.
+
+ Dispatch_Entry &dispatch_entry () const;
+ // Accessor for reference to the dispatch entry.
+
+private:
+
+ Dispatch_Entry &dispatch_entry_;
+ // Dispatch entry to which the smart pointer refers.
+};
+
+
+
+class TAO_RTSched_Export Task_Entry
+// = TITLE
+// Task Entry.
+//
+// = DESCRIPTION
+// Wrapper for the RT_Info, which aggregates all its dispatches.
+//
+{
+public:
+
+ typedef RtecScheduler::handle_t handle_t;
+ typedef RtecScheduler::Dependency_Info Dependency_Info;
+ typedef RtecScheduler::Preemption_Priority_t Preemption_Priority;
+ typedef RtecScheduler::OS_Priority OS_Priority;
+ typedef RtecScheduler::Preemption_Subpriority_t Sub_Priority;
+ typedef RtecScheduler::RT_Info RT_Info;
+ typedef RtecScheduler::Time Time;
+ typedef RtecScheduler::Period_t Period;
+ typedef RtecScheduler::Info_Type_t Info_Type;
+ typedef RtecScheduler::Dependency_Type_t Dependency_Type;
+
+ // Info for DFS traversal, topological sort of call graph.
+ enum DFS_Status {NOT_VISITED, VISITED, FINISHED};
+
+ // Status of merging dispatches.
+ enum Propagation_Status {SUCCEEDED,
+ TWO_WAY_DISJUNCTION,
+ TWO_WAY_CONJUNCTION,
+ INTERNAL_ERROR,
+ UNRECOGNIZED_INFO_TYPE};
+
+ // Constructor.
+ Task_Entry ();
+
+ // Destructor.
+ ~Task_Entry ();
+
+ // Merges dispatches according to info type, update
+ // relevant scheduling characteristics for this entry.
+ // Returns 0 if all is well, or -1 if an error occurred.
+ Propagation_Status merge_dispatches (
+ ACE_Unbounded_Set <Dispatch_Entry *> &dispatch_entries,
+ ACE_CString & unresolved_locals,
+ ACE_CString & unresolved_remotes);
+
+ // Gets the pointer to the underlying RT_Info.
+ RT_Info *rt_info () const;
+
+ // Sets the pointer to the underlying RT_Info.
+ void rt_info (RT_Info *info);
+
+ // Gets the effective period for the task entry.
+ Period effective_period () const;
+
+ // Sets the effective period for the task entry.
+ void effective_period (Period p);
+
+ // Sets when the node was discovered in DFS traversal.
+ void discovered (long l);
+
+ // Gets when the node was discovered in DFS traversal.
+ long discovered () const;
+
+ // Sets when the node was finished in DFS traversal.
+ void finished (long l);
+
+ // Gets when the node was finished in DFS traversal.
+ long finished () const;
+
+ // Sets DFS traversal status of the node.
+ void dfs_status (DFS_Status ds);
+
+ // Gets DFS traversal status of the node.
+ DFS_Status dfs_status () const;
+
+ // Sets a flag indicating whether node is a thread delineator.
+ void is_thread_delineator (int i);
+
+ // Gets the flag indicating whether node is a thread delineator.
+ int is_thread_delineator () const;
+
+ // Sets a flag indicating whether node has unresolved remote dependencies.
+ void has_unresolved_remote_dependencies (int i);
+
+ // Gets the flag indicating whether node has unresolved remote dependencies.
+ int has_unresolved_remote_dependencies () const;
+
+ // Sets a flag indicating whether node has unresolved local dependencies.
+ void has_unresolved_local_dependencies (int i);
+
+ // Gets the flag indicating whether node has unresolved local dependencies.
+ int has_unresolved_local_dependencies () const;
+
+ // Gets the set of links to Task Entries which this entry calls.
+ ACE_Unbounded_Set <Task_Entry_Link *> & calls ();
+
+ // Gets the set of links to Task Entries which call this entry.
+ ACE_Unbounded_Set <Task_Entry_Link *> & callers ();
+
+ // Gets the set of arrivals in the effective period.
+ ACE_Ordered_MultiSet<Dispatch_Entry_Link> &dispatches ();
+
+ // Gets the type of RT_Info the entry wraps.
+ Info_Type info_type () const;
+
+ // Gets the effective execution time for the task entry.
+ u_long effective_execution_time () const;
+
+private:
+
+ // Prohibits calls of the given type: currently used to enforce
+ // the notion that two-way calls to disjunctive or conjunctive
+ // RT_Infos do not have any defined meaning, and thus should be
+ // considered dependency specification errors: if these constraints
+ // are removed in the future, this method should be removed as well.
+ // Returns 0 if all is well, or -1 if an error has occurred.
+ int prohibit_dispatches (Dependency_Type dt);
+
+ // Performs a disjunctive merge of arrival times of calls of the given
+ // type: all arrival times of all callers of that type are duplicated by
+ // the multiplier and repetition over the new frame size and merged.
+ // Returns 0 if all is well, or -1 if an error has occurred.
+ int disjunctive_merge (
+ Dependency_Type dt,
+ ACE_Unbounded_Set <Dispatch_Entry *> &dispatch_entries,
+ ACE_CString & unresolved_locals,
+ ACE_CString & unresolved_remotes);
+
+ // Performs a conjunctive merge of arrival times of calls of the given
+ // type: all arrival times of all callers of that type are duplicated
+ // by the multiplier and repetition over the new frame size and then
+ // iteratively merged by choosing the maximal arrival time at
+ // the current position in each queue (iteration is in lockstep
+ // over all queues, and ends when any queue ends). Returns 0 if
+ // all is well, or -1 if an error has occurred.
+ int conjunctive_merge (
+ Dependency_Type dt,
+ ACE_Unbounded_Set <Dispatch_Entry *> &dispatch_entries,
+ ACE_CString & unresolved_locals,
+ ACE_CString & unresolved_remotes);
+
+ // This static method is used to reframe an existing dispatch set
+ // to the given new period multiplier, creating new instances of
+ // each existing dispatch (with adjusted arrival and deadline)
+ // in each successive sub-frame. Returns 1 if the set was reframed
+ // to a new period, 0 if the set was not changed (the new period
+ // was not a multiple of the old one), or -1 if an error occurred.
+ static int reframe (ACE_Unbounded_Set <Dispatch_Entry *> &dispatch_entries,
+ Task_Entry &owner,
+ ACE_Ordered_MultiSet <Dispatch_Entry_Link> &set,
+ u_long &set_period, u_long new_period);
+
+ // This static method is used to merge an existing dispatch set,
+ // multiplied by the given multipliers for the period and number of
+ // instances in each period of each existing dispatch, into the
+ // given "into" set, without affecting the "from set". Returns 1 if
+ // the source set was correctly merged into the destination set,
+ // 0 if nothing happened, and -1 if an error occurred.
+ static int merge_frames (ACE_Unbounded_Set <Dispatch_Entry *> &dispatch_entries,
+ Task_Entry &owner,
+ ACE_Ordered_MultiSet <Dispatch_Entry_Link> &dest,
+ ACE_Ordered_MultiSet <Dispatch_Entry_Link> &src,
+ u_long &dest_period,
+ u_long src_period,
+ u_long number_of_calls = 1,
+ u_long starting_dest_sub_frame = 0);
+
+ // A pointer to the underlying RT_Info.
+ RT_Info *rt_info_;
+
+ // The effective period for the task entry.
+ u_long effective_period_;
+
+ // The set of arrivals in the entry's effective period.
+ ACE_Ordered_MultiSet<Dispatch_Entry_Link> dispatches_;
+
+ // Depth-first-search status of the entry.
+ DFS_Status dfs_status_;
+
+ // Depth-first-search discovery order of the entry.
+ long discovered_;
+
+ // Depth-first-search completion order of the entry.
+ long finished_;
+
+ // Flag identifying threads in the call graph.
+ int is_thread_delineator_;
+
+ // Flag indicating whether or not there are unresolved remote
+ // dependencies in the entry's dependency call chain.
+ int has_unresolved_remote_dependencies_;
+
+ // Flag indicating whether or not there are unresolved local
+ // dependencies in the entry's dependency call chain.
+ int has_unresolved_local_dependencies_;
+
+ // Set of links to Task Entries which this entry calls.
+ ACE_Unbounded_Set <Task_Entry_Link *> calls_;
+
+ // Set of links to Task Entries which call this entry.
+ ACE_Unbounded_Set <Task_Entry_Link *> callers_;
+
+};
+
+
+// Wrapper for dependencies between RT_Infos
+class TAO_RTSched_Export Task_Entry_Link
+{
+public:
+
+ typedef RtecScheduler::handle_t handle_t;
+ typedef RtecScheduler::Dependency_Info Dependency_Info;
+ typedef RtecScheduler::Preemption_Priority_t Preemption_Priority;
+ typedef RtecScheduler::OS_Priority OS_Priority;
+ typedef RtecScheduler::Preemption_Subpriority_t Sub_Priority;
+ typedef RtecScheduler::RT_Info RT_Info;
+ typedef RtecScheduler::Time Time;
+ typedef RtecScheduler::Period_t Period;
+ typedef RtecScheduler::Info_Type_t Info_Type;
+ typedef RtecScheduler::Dependency_Type_t Dependency_Type;
+
+ // ctor
+ Task_Entry_Link (Task_Entry &caller,
+ Task_Entry &called,
+ CORBA::Long number_of_calls,
+ Dependency_Type dependency_type);
+
+ // accessor: number of calls
+ CORBA::Long number_of_calls () const;
+
+ // accessor: dependency type
+ Dependency_Type dependency_type () const;
+
+ // accessor: calling task entry
+ Task_Entry &caller () const;
+
+ // accessor: called task entry
+ Task_Entry &called () const;
+
+private:
+
+ // the number of calls of the operation
+ CORBA::Long number_of_calls_;
+
+ // the calling operation
+ Task_Entry &caller_;
+
+ // the called operation
+ Task_Entry &called_;
+
+ // the type of call dependency
+ Dependency_Type dependency_type_;
+};
+
+
+class TAO_RTSched_Export Dispatch_Entry
+{
+// = TITLE
+// Dispatch Entry
+//
+// = DESCRIPTION
+// Descriptor object for a single dispatch of an operation.
+//
+public:
+
+ typedef RtecScheduler::handle_t handle_t;
+ typedef RtecScheduler::Dependency_Info Dependency_Info;
+ typedef RtecScheduler::Preemption_Priority_t Preemption_Priority;
+ typedef RtecScheduler::OS_Priority OS_Priority;
+ typedef RtecScheduler::Preemption_Subpriority_t Sub_Priority;
+ typedef RtecScheduler::RT_Info RT_Info;
+ typedef RtecScheduler::Time Time;
+ typedef RtecScheduler::Period_t Period;
+ typedef RtecScheduler::Info_Type_t Info_Type;
+ typedef RtecScheduler::Dependency_Type_t Dependency_Type;
+
+ typedef u_long Dispatch_Id;
+
+ // ctor
+ Dispatch_Entry (Time arrival,
+ Time deadline,
+ Preemption_Priority priority,
+ OS_Priority os_priority,
+ Task_Entry &task_entry,
+ Dispatch_Entry *original_dispatch = 0);
+
+ // copy ctor
+ Dispatch_Entry (const Dispatch_Entry &d);
+
+ // id accessor
+ Dispatch_Id dispatch_id () const;
+
+ // arrival accessor
+ Time arrival () const;
+
+ // deadline accessor
+ Time deadline () const;
+
+ // scheduler priority accessor and mutator
+ Preemption_Priority priority () const;
+ void priority (Preemption_Priority p);
+
+ // scheduler priority accessor and mutator
+ OS_Priority OS_priority () const;
+ void OS_priority (OS_Priority p);
+
+ // dynamic subpriority accessor and mutator
+ Sub_Priority dynamic_subpriority () const;
+ void dynamic_subpriority (Sub_Priority p);
+
+ // static subpriority accessor and mutator
+ Sub_Priority static_subpriority () const;
+ void static_subpriority (Sub_Priority p);
+
+ // task entry accessor
+ Task_Entry &task_entry () const;
+
+ // LT comparator
+ // TBD - make this a global comparison operator
+ // instead of a class member function
+ bool operator < (const Dispatch_Entry &d) const;
+
+ // accessor for pointer to original dispatch
+ Dispatch_Entry *original_dispatch ();
+
+private:
+ // TBD - add reference counting to Dispatch Entry class,
+ // make the link a friend, up/down count as links come and go,
+ // and call entry dtor when ref count drops to 0
+
+ // stores the next dispatch entry id to be used
+ static Dispatch_Id next_id_;
+
+ // the id of the current dispatch entry
+ Dispatch_Id dispatch_id_;
+
+ // scheduler priority of the current dispatch entry
+ Preemption_Priority priority_;
+
+ // OS priority of the current dispatch entry
+ OS_Priority OS_priority_;
+
+ // scheduler dynamic subpriority of the current dispatch entry
+ Sub_Priority dynamic_subpriority_;
+
+ // scheduler static subpriority of the current dispatch entry
+ Sub_Priority static_subpriority_;
+
+ // the arrival time of the current dispatch entry
+ Time arrival_;
+
+ // the deadline of the current dispatch entry
+ Time deadline_;
+
+ // stores the id of the related task entry
+ Task_Entry &task_entry_;
+
+ // stores a pointer to the original dispatch entry if this
+ // is a dispatch generated by expanding the original frame
+ Dispatch_Entry *original_dispatch_;
+
+};
+
+class TAO_RTSched_Export Dispatch_Proxy_Iterator
+// = TITLE
+// This class implements an iterator abstraction over a virtual
+// frame size and number of calls, using an actual ordered
+// multiset of dispatch entries over an actual frame size.
+// It also serves as a proxy for the virtual dispatch to which
+// it refers. Rhetorical question: is it possible to separate
+// the iterator and proxy abstractions here without defeating the
+// purpose of the design, which is to avoid constructing
+// superfluous dispatch entries (per the conjunctive merge use case) ?
+{
+public:
+
+ typedef RtecScheduler::handle_t handle_t;
+ typedef RtecScheduler::Dependency_Info Dependency_Info;
+ typedef RtecScheduler::Preemption_Priority_t Preemption_Priority;
+ typedef RtecScheduler::OS_Priority OS_Priority;
+ typedef RtecScheduler::Preemption_Subpriority_t Sub_Priority;
+ typedef RtecScheduler::RT_Info RT_Info;
+ typedef RtecScheduler::Time Time;
+ typedef RtecScheduler::Period_t Period;
+ typedef RtecScheduler::Info_Type_t Info_Type;
+ typedef RtecScheduler::Dependency_Type_t Dependency_Type;
+
+ Dispatch_Proxy_Iterator (ACE_Ordered_MultiSet <Dispatch_Entry_Link> &set,
+ u_long actual_frame_size,
+ u_long virtual_frame_size,
+ u_long number_of_calls_ = 1,
+ u_long starting_sub_frame = 0);
+ // ctor
+
+ ////////////////////////
+ // iterator interface //
+ ////////////////////////
+
+ int done () const;
+ // returns 0 if there are more entries to see, 1 if not
+
+ int first (u_int sub_frame = 0);
+ // positions the iterator at the first entry of the passed
+ // sub-frame, returns 1 if it could position the iterator
+ // correctly, 0 if not, and -1 if an error occurred.
+
+ int last ();
+ // positions the iterator at the last entry of the total
+ // frame, returns 1 if it could position the iterator
+ // correctly, 0 if not, and -1 if an error occurred.
+
+ int advance ();
+ // positions the iterator at the next entry of the total
+ // frame, returns 1 if it could position the iterator
+ // correctly, 0 if not, and -1 if an error occurred.
+
+ int retreat ();
+ // positions the iterator at the previous entry of the total
+ // frame, returns 1 if it could position the iterator
+ // correctly, 0 if not, and -1 if an error occurred.
+
+ /////////////////////
+ // proxy interface //
+ /////////////////////
+
+ Time arrival () const;
+ // returns the adjusted arrival time of the virtual entry
+
+ Time deadline () const;
+ // returns the adjusted deadline time of the virtual entry
+
+ Preemption_Priority priority () const;
+ // returns the scheduler priority of the virtual entry
+
+ OS_Priority OS_priority () const;
+ // returns the OS priority of the virtual entry
+
+
+private:
+
+ u_long number_of_calls_;
+ // the number of calls corresponding to each actual dispatch
+
+ u_long current_call_;
+ // the current call number for this dispatch (zero based)
+
+ u_long actual_frame_size_;
+ // the frame size of the actual dispatches
+
+ u_long virtual_frame_size_;
+ // the virtaul frame size over which to iterate
+
+ u_long current_frame_offset_;
+ // the current offset into the virtual frame
+ // (should be a multiple of the actual frame size)
+
+ ACE_Ordered_MultiSet_Iterator <Dispatch_Entry_Link> iter_;
+};
+
+
+
+class TAO_RTSched_Export TimeLine_Entry
+{
+public:
+
+ typedef RtecScheduler::handle_t handle_t;
+ typedef RtecScheduler::Dependency_Info Dependency_Info;
+ typedef RtecScheduler::Preemption_Priority_t Preemption_Priority;
+ typedef RtecScheduler::OS_Priority OS_Priority;
+ typedef RtecScheduler::Preemption_Subpriority_t Sub_Priority;
+ typedef RtecScheduler::RT_Info RT_Info;
+ typedef RtecScheduler::Time Time;
+ typedef RtecScheduler::Period_t Period;
+ typedef RtecScheduler::Info_Type_t Info_Type;
+ typedef RtecScheduler::Dependency_Type_t Dependency_Type;
+
+ // time slice constructor
+ TimeLine_Entry (Dispatch_Entry &dispatch_entry,
+ Time start,
+ Time stop,
+ Time arrival,
+ Time deadline,
+ TimeLine_Entry *next = 0,
+ TimeLine_Entry *prev = 0);
+
+ // dispatch entry accessor
+ Dispatch_Entry &dispatch_entry () const;
+
+ // accessors for time slice start and stop times (100 nanoseconds)
+ Time start () const;
+ Time stop () const;
+ Time arrival () const;
+ Time deadline () const;
+
+ // accessor and mutator for next and prev slices for this dispatch
+ TimeLine_Entry *next (void) const;
+ void next (TimeLine_Entry *);
+ TimeLine_Entry *prev (void) const;
+ void prev (TimeLine_Entry *);
+
+ bool operator < (const TimeLine_Entry&) const;
+
+private:
+
+ // the dispatch entry to which the time slice corresponds
+ Dispatch_Entry &dispatch_entry_;
+
+ // priority time slice times (100 nanoseconds)
+ Time start_;
+ Time stop_;
+ Time arrival_;
+ Time deadline_;
+
+ // next and previous priority time slices for this dispatch entry
+ TimeLine_Entry *next_;
+ TimeLine_Entry *prev_;
+
+};
+
+class TAO_RTSched_Export TimeLine_Entry_Link
+{
+public:
+
+ typedef RtecScheduler::handle_t handle_t;
+ typedef RtecScheduler::Dependency_Info Dependency_Info;
+ typedef RtecScheduler::Preemption_Priority_t Preemption_Priority;
+ typedef RtecScheduler::OS_Priority OS_Priority;
+ typedef RtecScheduler::Preemption_Subpriority_t Sub_Priority;
+ typedef RtecScheduler::RT_Info RT_Info;
+ typedef RtecScheduler::Time Time;
+ typedef RtecScheduler::Period_t Period;
+ typedef RtecScheduler::Info_Type_t Info_Type;
+ typedef RtecScheduler::Dependency_Type_t Dependency_Type;
+
+ TimeLine_Entry_Link (TimeLine_Entry &t);
+ // ctor
+
+ TimeLine_Entry &entry () const;
+ // accessor for the underlying entry
+
+ bool operator < (const TimeLine_Entry_Link&) const;
+ // comparison operator
+
+private:
+
+ TimeLine_Entry &entry_;
+ // the underlying entry
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Sched/SchedEntry.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* SCHEDENTRY_H */
+
+// EOF
diff --git a/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.i b/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.i
new file mode 100644
index 00000000000..13f00111d67
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.i
@@ -0,0 +1,447 @@
+// -*- C++ -*-
+
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// sched
+//
+// = FILENAME
+// SchedEntry.i
+//
+// = CREATION DATE
+// 7 February 1998
+//
+// = AUTHOR
+// Chris Gill
+//
+// ============================================================================
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//////////////////////
+// Class Task_Entry //
+//////////////////////
+
+// return a pointer to the underlying RT_Info
+ACE_INLINE Task_Entry::RT_Info *
+Task_Entry::rt_info () const
+{
+ return rt_info_;
+}
+
+// set the underlying RT_Info pointer
+ACE_INLINE void
+Task_Entry::rt_info (Task_Entry::RT_Info *info)
+{
+ rt_info_ = info;
+}
+
+// get effective period for the task entry
+ACE_INLINE Task_Entry::Period
+Task_Entry::effective_period () const
+{
+ return effective_period_;
+}
+
+// set effective period for the task entry
+ACE_INLINE void
+Task_Entry::effective_period (Task_Entry::Period p)
+{
+ effective_period_ = p;
+}
+
+ACE_INLINE void
+Task_Entry::discovered (long l)
+{
+ discovered_ = l;
+ dfs_status_ = VISITED;
+}
+
+ACE_INLINE long
+Task_Entry::discovered () const
+{
+ return discovered_;
+}
+
+ACE_INLINE void
+Task_Entry::finished (long l)
+{
+ finished_ = l;
+ dfs_status_ = FINISHED;
+}
+
+ACE_INLINE long
+Task_Entry::finished () const
+{
+ return finished_;
+}
+
+ACE_INLINE Task_Entry::DFS_Status
+Task_Entry::dfs_status () const
+{
+ return dfs_status_;
+}
+
+ACE_INLINE void
+Task_Entry::dfs_status (Task_Entry::DFS_Status ds)
+{
+ dfs_status_ = ds;
+}
+
+// Sets a flag indicating whether node is a thread delineator.
+
+ACE_INLINE void
+Task_Entry::is_thread_delineator (int i)
+{
+ is_thread_delineator_ = i;
+}
+
+// Gets the flag indicating whether node is a thread delineator.
+
+ACE_INLINE int
+Task_Entry::is_thread_delineator () const
+{
+ return is_thread_delineator_;
+}
+
+// Sets a flag indicating whether node has unresolved remote dependencies.
+
+ACE_INLINE void
+Task_Entry::has_unresolved_remote_dependencies (int i)
+{
+ has_unresolved_remote_dependencies_ = i;
+}
+
+// Gets the flag indicating whether node has unresolved remote dependencies.
+
+ACE_INLINE int
+Task_Entry::has_unresolved_remote_dependencies () const
+{
+ return has_unresolved_remote_dependencies_;
+}
+
+
+// Sets a flag indicating whether node has unresolved local dependencies.
+
+ACE_INLINE void
+Task_Entry::has_unresolved_local_dependencies (int i)
+{
+ has_unresolved_local_dependencies_ = i;
+}
+
+// Gets the flag indicating whether node has unresolved local dependencies.
+
+ACE_INLINE int
+Task_Entry::has_unresolved_local_dependencies () const
+{
+ return has_unresolved_local_dependencies_;
+}
+
+// Gets the set of Task Entries on which this entry depends.
+
+ACE_INLINE ACE_Unbounded_Set <Task_Entry_Link *> &
+Task_Entry::calls ()
+{
+ return calls_;
+}
+
+// Gets the set of Task Entries which depend on this entry.
+
+ACE_INLINE ACE_Unbounded_Set <Task_Entry_Link *> &
+Task_Entry::callers ()
+{
+ return callers_;
+}
+
+// Gets set of arrivals in the entry's effective period.
+
+ACE_INLINE ACE_Ordered_MultiSet<Dispatch_Entry_Link> &
+Task_Entry::dispatches ()
+{
+ return dispatches_;
+}
+
+
+ACE_INLINE Task_Entry::Info_Type
+Task_Entry::info_type () const
+{
+ return rt_info_->info_type;
+}
+
+ACE_INLINE u_long
+Task_Entry::effective_execution_time () const
+{
+ // Just use low 32 bits. This will have to change when TimeBase.idl
+ // is finalized.
+ ACE_UINT32 worst_case_execution_time =
+ ACE_U64_TO_U32 (rt_info_->worst_case_execution_time);
+
+ return ((rt_info_->info_type == RtecScheduler::OPERATION) ||
+ (rt_info_->info_type == RtecScheduler::REMOTE_DEPENDANT))
+ ? static_cast<u_long> (worst_case_execution_time * dispatches_.size ())
+ : 0;
+}
+
+
+///////////////////////////
+// Class Task_Entry_Link //
+///////////////////////////
+
+
+// accessor: number of calls of dependency by dependant
+ACE_INLINE CORBA::Long
+Task_Entry_Link::number_of_calls () const
+{
+ return number_of_calls_;
+}
+
+ACE_INLINE Task_Entry_Link::Dependency_Type
+Task_Entry_Link::dependency_type () const
+{
+ return dependency_type_;
+}
+
+// accessor: dependant task entry
+ACE_INLINE Task_Entry &
+Task_Entry_Link::caller () const
+{
+ return caller_;
+}
+
+// accessor: dependency task entry
+ACE_INLINE Task_Entry &
+Task_Entry_Link::called () const
+{
+ return called_;
+}
+
+//////////////////////////
+// Class Dispatch Entry //
+//////////////////////////
+
+ACE_INLINE u_long
+Dispatch_Entry::dispatch_id () const
+{
+ return dispatch_id_;
+}
+
+ACE_INLINE Dispatch_Entry::Preemption_Priority
+Dispatch_Entry::priority () const
+{
+ return priority_;
+}
+
+ACE_INLINE void
+Dispatch_Entry::priority (Dispatch_Entry::Preemption_Priority p)
+{
+ priority_ = p;
+}
+
+ACE_INLINE Dispatch_Entry::OS_Priority
+Dispatch_Entry::OS_priority () const
+{
+ return OS_priority_;
+}
+
+ACE_INLINE void
+Dispatch_Entry::OS_priority (Dispatch_Entry::OS_Priority p)
+{
+ OS_priority_ = p;
+}
+
+ACE_INLINE Dispatch_Entry::Sub_Priority
+Dispatch_Entry::dynamic_subpriority () const
+{
+ return dynamic_subpriority_;
+}
+
+ACE_INLINE void
+Dispatch_Entry::dynamic_subpriority (Dispatch_Entry::Sub_Priority p)
+{
+ dynamic_subpriority_ = p;
+}
+
+ACE_INLINE Dispatch_Entry::Sub_Priority
+Dispatch_Entry::static_subpriority () const
+{
+ return static_subpriority_;
+}
+
+ACE_INLINE void
+Dispatch_Entry::static_subpriority (Dispatch_Entry::Sub_Priority p)
+{
+ static_subpriority_ = p;
+}
+
+
+ACE_INLINE Dispatch_Entry::Time
+Dispatch_Entry::arrival () const
+{
+ return arrival_;
+}
+
+ACE_INLINE Dispatch_Entry::Time
+Dispatch_Entry::deadline () const
+{
+ return deadline_;
+}
+
+ACE_INLINE Task_Entry &
+Dispatch_Entry::task_entry () const
+{
+ return task_entry_;
+}
+
+
+// accessor for pointer to original dispatch
+ACE_INLINE Dispatch_Entry *
+Dispatch_Entry::original_dispatch ()
+{
+ return original_dispatch_;
+}
+
+
+///////////////////////////////
+// Class Dispatch_Entry_Link //
+///////////////////////////////
+
+ACE_INLINE
+Dispatch_Entry_Link::~Dispatch_Entry_Link ()
+{
+}
+ // dtor
+
+ACE_INLINE bool
+Dispatch_Entry_Link::operator < (const Dispatch_Entry_Link &d) const
+{
+ return (this->dispatch_entry_ < d.dispatch_entry_);
+}
+ // GT comparator
+
+
+ACE_INLINE Dispatch_Entry &
+Dispatch_Entry_Link::dispatch_entry () const
+{
+ return dispatch_entry_;
+}
+ // accessor for reference to dispatch entry
+
+
+///////////////////////////////////
+// Class Dispatch_Proxy_Iterator //
+///////////////////////////////////
+
+ACE_INLINE int
+Dispatch_Proxy_Iterator::done () const
+{
+ return iter_.done ();
+}
+ // returns 0 if there are more entries to see, 1 if not
+
+
+//////////////////////////
+// Class TimeLine_Entry //
+//////////////////////////
+
+ // dispatch entry accessor
+ACE_INLINE Dispatch_Entry &
+TimeLine_Entry::dispatch_entry () const
+{
+ return dispatch_entry_;
+}
+
+
+// accessor for time slice start time (100 nanoseconds)
+ACE_INLINE RtecScheduler::Time
+TimeLine_Entry::start () const
+{
+ return start_;
+}
+
+// accessor for time slice stop time (100 nanoseconds)
+ACE_INLINE RtecScheduler::Time
+TimeLine_Entry::stop () const
+{
+ return stop_;
+}
+
+// accessor for time slice stop time (100 nanoseconds)
+ACE_INLINE RtecScheduler::Time
+TimeLine_Entry::arrival () const
+{
+ return arrival_;
+}
+
+// accessor for time slice stop time (100 nanoseconds)
+ACE_INLINE RtecScheduler::Time
+TimeLine_Entry::deadline () const
+{
+ return deadline_;
+}
+
+
+// accessor for next slice for this dispatch
+ACE_INLINE TimeLine_Entry *
+TimeLine_Entry::next (void) const
+{
+ return next_;
+}
+
+// mutator for next slice for this dispatch
+ACE_INLINE void
+TimeLine_Entry::next (TimeLine_Entry *t)
+{
+ next_ = t;
+}
+
+// accessor for previous slice for this dispatch
+ACE_INLINE TimeLine_Entry *
+TimeLine_Entry::prev (void) const
+{
+ return prev_;
+}
+
+// mutator for previous slice for this dispatch
+ACE_INLINE void
+TimeLine_Entry::prev (TimeLine_Entry *t)
+{
+ prev_ = t;
+}
+
+
+ACE_INLINE bool
+TimeLine_Entry::operator < (const TimeLine_Entry &t) const
+{
+ return (start_ < t.start_) ? true : false;
+}
+ // comparison operator
+
+
+///////////////////////////////
+// Class TimeLine_Entry_Link //
+///////////////////////////////
+
+
+ACE_INLINE TimeLine_Entry_Link::TimeLine_Entry_Link (TimeLine_Entry &t)
+ : entry_ (t)
+{
+}
+ // ctor
+
+ACE_INLINE TimeLine_Entry &
+TimeLine_Entry_Link::entry () const
+{
+ return entry_;
+}
+ // accessor for the underlying entry
+
+ACE_INLINE bool
+TimeLine_Entry_Link::operator < (const TimeLine_Entry_Link &l) const
+{
+ return (entry_ < l.entry_);
+}
+ // comparison operator
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Scheduler.cpp b/TAO/orbsvcs/orbsvcs/Sched/Scheduler.cpp
new file mode 100644
index 00000000000..13ecbf74fc0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/Scheduler.cpp
@@ -0,0 +1,271 @@
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// sched
+//
+// = FILENAME
+// Scheduler.cpp
+//
+// = CREATION DATE
+// 23 January 1997
+//
+// = AUTHOR
+// David Levine
+//
+// ============================================================================
+
+#include "ace/Sched_Params.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Sched/Scheduler.h"
+#include "ace/OS_NS_stdio.h"
+
+#include "ace/Lock_Adapter_T.h"
+
+ACE_RCSID(Sched, Scheduler, "$Id$")
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+// class Scheduler static members
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+const ACE_Scheduler::mode_t ACE_Scheduler::CURRENT_MODE = 0xFFFFFFFF;
+
+ACE_Scheduler *ACE_Scheduler::instance_ = 0;
+
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+// class ACE_Scheduler static functions
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+void
+ACE_Scheduler::output (FILE *file, const status_t status)
+{
+ switch (status)
+ {
+ case NOT_SCHEDULED :
+ ACE_OS::fprintf (file, "NOT_SCHEDULED");
+ break;
+ case SUCCEEDED :
+ ACE_OS::fprintf (file, "SUCCEEDED");
+ break;
+ case ST_TASK_ALREADY_REGISTERED :
+ ACE_OS::fprintf (file, "TASK_ALREADY_REGISTERED");
+ break;
+ case ST_VIRTUAL_MEMORY_EXHAUSTED :
+ ACE_OS::fprintf (file, "VIRTUAL_MEMORY_EXHAUSTED");
+ break;
+ case ST_UNKNOWN_TASK :
+ ACE_OS::fprintf (file, "UNKNOWN_TASK");
+ break;
+ case INVALID_MODE :
+ ACE_OS::fprintf (file, "INVALID_MODE");
+ break;
+ case MODE_COUNT_MISMATCH :
+ ACE_OS::fprintf (file, "MODE_COUNT_MISMATCH");
+ break;
+ case TASK_COUNT_MISMATCH :
+ ACE_OS::fprintf (file, "TASK_COUNT_MISMATCH");
+ break;
+ case INVALID_PRIORITY :
+ ACE_OS::fprintf (file, "INVALID_PRIORITY");
+ break;
+
+ // The following are only used during scheduling (in the case of
+ // off-line scheduling, they are only used prior to runtime).
+ // To save a little code space (280 bytes on g++ 2.7.2/Solaris 2.5.1),
+ // we could conditionally compile them so that they're not in the
+ // runtime version.
+ case ST_UTILIZATION_BOUND_EXCEEDED :
+ ACE_OS::fprintf (file, "UTILIZATION_BOUND_EXCEEDED");
+ break;
+ case ST_INSUFFICIENT_THREAD_PRIORITY_LEVELS :
+ ACE_OS::fprintf (file, "INSUFFICIENT_THREAD_PRIORITY_LEVELS");
+ break;
+ case ST_CYCLE_IN_DEPENDENCIES :
+ ACE_OS::fprintf (file, "CYCLE_IN_DEPENDENCIES");
+ break;
+ case UNABLE_TO_OPEN_SCHEDULE_FILE :
+ ACE_OS::fprintf (file, "UNABLE_TO_OPEN_SCHEDULE_FILE");
+ break;
+ case UNABLE_TO_WRITE_SCHEDULE_FILE :
+ ACE_OS::fprintf (file, "UNABLE_TO_WRITE_SCHEDULE_FILE");
+ break;
+ // End of config-only status values.
+
+ default:
+ ACE_OS::fprintf (file, "UNKNOWN STATUS: %d", status);
+ }
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+// class ACE_Scheduler member functions
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+ACE_Scheduler::ACE_Scheduler () :
+ minimum_priority_queue_ (0), // Could initialize this to -1, but it's
+ // unsigned and we don't really need to
+ // distinguish between no queues and one
+ // queue.
+ modes_ (0),
+ tasks_ (0),
+ threads_ (0),
+ mode_ (0),
+ status_ (NOT_SCHEDULED),
+ output_level_ (0)
+{
+}
+
+
+ACE_Scheduler::~ACE_Scheduler ()
+{
+}
+
+
+// ************************************************************
+
+ACE_Scheduler::status_t
+ACE_Scheduler::get_rt_info (Object_Name name,
+ RT_Info* &rtinfo)
+{
+ handle_t handle;
+
+ // This makes a copy. We can optimize this with our own string
+ // class.
+ ACE_CString lookup (name);
+ // Search the map for the <name>. If found, return the RT_Info.
+ RT_Info **info_array = 0;
+ if (info_collection_.find (lookup, info_array) >= 0)
+ {
+ rtinfo = info_array[0];
+ // If we find it, return.
+ return SUCCEEDED;
+ }
+ else
+ // Otherwise, make one, bind it, and register it.
+ {
+ rtinfo = new RT_Info;
+ rtinfo->entry_point = name;
+ // Create and array (size one) of RT_Info*
+ info_array = new RT_Info*[1];
+ info_array[0] = rtinfo;
+ // Bind the rtinfo to the name.
+ if (info_collection_.bind (lookup, info_array) != 0)
+ {
+ delete rtinfo;
+ delete info_array;
+ rtinfo = 0;
+ return FAILED; // Error!
+ }
+ else
+ {
+ // Register the array.
+ status_t result = this->register_task (info_array, 1, handle);
+ if (result == SUCCEEDED)
+ {
+ rtinfo->handle = handle;
+ return ST_UNKNOWN_TASK; // Didn't find it, but made one!
+ }
+ else
+ {
+ rtinfo->handle = 0;
+ return FAILED;
+ }
+ }
+ }
+}
+
+int ACE_Scheduler::number_of_dependencies(RT_Info* rt_info)
+{
+ return rt_info->dependencies.length();
+}
+
+int ACE_Scheduler::number_of_dependencies(RT_Info& rt_info)
+{
+ return rt_info.dependencies.length();
+}
+
+int ACE_Scheduler::add_dependency(RT_Info* rt_info,
+ const Dependency_Info& d)
+{
+ // ACE_DEBUG ((LM_DEBUG, "Sched (%t) adding dependency to: %s\n",
+ // (const char*)rt_info->entry_point));
+ RtecScheduler::Dependency_Set& set = rt_info->dependencies;
+ int l = set.length();
+ set.length(l + 1);
+ set[l] = d;
+ return 0;
+}
+
+void ACE_Scheduler::export_to_file (RT_Info* info, FILE* file)
+{
+ ACE_Scheduler::export_to_file (*info, file);
+}
+
+void ACE_Scheduler::export_to_file (RT_Info& info, FILE* file)
+{
+ // The divide-by-1 is for ACE_U_LongLong support.
+ (void) ACE_OS::fprintf (file,
+ ACE_TEXT("%s\n%d\n")
+ ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT("\n")
+ ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT("\n")
+ ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT("\n")
+ ACE_TEXT("%d\n%d\n")
+ ACE_UINT64_FORMAT_SPECIFIER ACE_TEXT("\n")
+ ACE_TEXT("%u\n# begin dependencies\n%d\n"),
+ (const char*)info.entry_point,
+ info.handle,
+ ORBSVCS_Time::to_hrtime (info.worst_case_execution_time) / 1,
+ ORBSVCS_Time::to_hrtime (info.typical_execution_time) / 1,
+ ORBSVCS_Time::to_hrtime (info.cached_execution_time) / 1,
+ info.period,
+ info.importance,
+ ORBSVCS_Time::to_hrtime (info.quantum) / 1,
+ info.threads,
+ number_of_dependencies(info));
+
+ for (int i = 0; i < number_of_dependencies(info); ++i)
+ {
+ RT_Info tmp;
+ // TODO: info.dependencies [i].rt_info >>= &tmp;
+ (void) ACE_OS::fprintf (file, "%s, %d\n",
+ (const char*)tmp.entry_point,
+ info.dependencies[i].number_of_calls);
+
+ }
+
+ (void) ACE_OS::fprintf (file, "# end dependencies\n%d\n%d\n\n",
+ info.priority,
+ info.preemption_subpriority);
+
+
+}
+
+int
+ACE_Scheduler::dispatch_configuration (const Preemption_Priority & p_priority,
+ OS_Thread_Priority & priority,
+ Dispatching_Type & d_type)
+{
+ // look up the stored configuration info for the given priority level
+ Config_Info *config_info;
+ if (lookup_config_info (p_priority, config_info) != SUCCEEDED)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Config info for priority %lu could not be found\n",
+ p_priority),
+ -1);
+ }
+
+ priority = config_info->thread_priority;
+ d_type = config_info->dispatching_type;
+
+ return 0;
+}
+ // provide the thread priority and queue type for the given priority level
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Scheduler.h b/TAO/orbsvcs/orbsvcs/Sched/Scheduler.h
new file mode 100644
index 00000000000..8cad8d40736
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/Scheduler.h
@@ -0,0 +1,300 @@
+/* -*- C++ -*- */
+//
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// sched
+//
+// = FILENAME
+// Scheduler.h
+//
+// = CREATION DATE
+// 23 January 1997
+//
+// = AUTHOR
+// David Levine
+//
+// ============================================================================
+
+#ifndef SCHEDULER_H
+#define SCHEDULER_H
+#include /**/ "ace/pre.h"
+
+#include "ace/ACE.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Map_Manager.h"
+#include "ace/Message_Block.h"
+#include "ace/SString.h"
+#include "ace/Unbounded_Set.h"
+
+#include "orbsvcs/RtecSchedulerC.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Sched/sched_export.h"
+
+class TAO_RTSched_Export ACE_Scheduler
+ // = TITLE
+ // Thread scheduler interface.
+ //
+ // = DESCRIPTION
+ // This virtual base class is the interface to either an off-line
+ // scheduler, or to the necessary on-line component of the Scheduler.
+{
+public:
+ typedef u_int mode_t;
+
+ typedef RtecScheduler::handle_t handle_t;
+ typedef RtecScheduler::Dependency_Info Dependency_Info;
+ typedef RtecScheduler::Preemption_Priority_t Preemption_Priority;
+ typedef RtecScheduler::OS_Priority OS_Thread_Priority;
+ typedef RtecScheduler::Preemption_Subpriority_t Sub_Priority;
+ typedef RtecScheduler::RT_Info RT_Info;
+ typedef RtecScheduler::Config_Info Config_Info;
+ typedef RtecScheduler::Time Time;
+ typedef RtecScheduler::Dispatching_Type_t Dispatching_Type;
+ typedef RtecScheduler::Scheduling_Anomaly Scheduling_Anomaly;
+
+ // Map some types to simplify re-use.
+
+ typedef const char *Object_Name;
+ // Objects are named by unique strings.
+
+ static const mode_t CURRENT_MODE;
+
+ enum status_t {
+ // The following are used both by the runtime Scheduler and during
+ // scheduling.
+ NOT_SCHEDULED = -1 // the schedule () method has not been called yet
+ , FAILED = -1
+ , SUCCEEDED
+ , ST_UNKNOWN_TASK
+ , ST_UNKNOWN_PRIORITY
+ , ST_TASK_ALREADY_REGISTERED
+ , ST_VIRTUAL_MEMORY_EXHAUSTED
+ , ST_BAD_INTERNAL_POINTER
+
+ // The following are only used by the runtime Scheduler.
+ , INVALID_MODE
+ , MODE_COUNT_MISMATCH // only used by schedule ()
+ , TASK_COUNT_MISMATCH // only used by schedule ()
+ , THREAD_COUNT_MISMATCH // only used by schedule ()
+ , INVALID_PRIORITY // only used by schedule (): mismatch of
+ // (off-line, maybe) Scheduler output to
+ // the runtime Scheduler component.
+
+ // The following are only used during scheduling (in the case of
+ // off-line scheduling, they are only used prior to runtime).
+ , ST_UTILIZATION_BOUND_EXCEEDED
+ , ST_INSUFFICIENT_THREAD_PRIORITY_LEVELS
+ , ST_CYCLE_IN_DEPENDENCIES
+ , ST_UNRESOLVED_REMOTE_DEPENDENCIES
+ , UNABLE_TO_OPEN_SCHEDULE_FILE
+ , UNABLE_TO_WRITE_SCHEDULE_FILE
+ };
+
+ virtual ~ACE_Scheduler ();
+
+ // = Utility function for outputting the textual representation of a
+ // status_t value to a FILE.
+ static void output (FILE *, const status_t);
+
+ // = Initialize the scheduler.
+ virtual void init (const int minimum_priority,
+ const int maximum_priority,
+ const char *runtime_filename = 0,
+ const char *rt_info_filename = 0,
+ const char *timeline_filename = 0) = 0;
+ // The minimum and maximum priority are the OS-specific priorities that
+ // are used when creating the schedule (assigning priorities). The
+ // minimum_priority is the priority value of the lowest priority.
+ // It may be numerically higher than the maximum_priority, on OS's such
+ // as VxWorks that use lower values to indicate higher priorities.
+ //
+ // When Scheduler::schedule is called, the schedule is output to the
+ // file named by "runtime_filename" if it is non-zero.
+ // This file is compilable; it is linked into the runtime executable
+ // to provide priorities to the runtime scheduling component.
+ // If the "rt_info_filename" is non-zero, the RT_Info for
+ // every task is exported to it. It is not used at runtime.
+ // If the "timeline_filename" is non-zero, the timeline output
+ // file is created. It is not used at runtime.
+ //
+ // The runtime scheduling component ignores these filenames. It just
+ // uses the priorities that were linked in to the executable, after
+ // converting them to platform-specific values.
+
+ // = Registers a task.
+ virtual status_t register_task (RT_Info *[],
+ const u_int number_of_modes,
+ handle_t &handle) = 0;
+ // If the Task registration succeeds, this function returns SUCCEEDED
+ // and sets "handle" to a unique identifier for the task.
+ // Otherwise, it returns either VIRTUAL_MEMORY_EXHAUSTED or
+ // TASK_ALREADY_REGISTERED sets the handle to 0. (A task may
+ // only be registered once.)
+ // The RT_Info * array is indexed by mode; there must be one element for
+ // each mode, as specified by number_of_modes. If a task does not
+ // run in a mode, then its entry in the array for that mode must
+ // be 0.
+
+ virtual status_t get_rt_info (Object_Name name,
+ RT_Info* &rtinfo);
+ // Tries to find the RT_Info corresponding to <name> in the RT_Info
+ // database. Returns SUCCEEDED if <name> was found and <rtinfo> was
+ // set. Returns UNKNOWN_TASK if <name> was not found, but <rtinfo>
+ // was set to a newly allocated RT_Info. In this UNKNOWN_TASK case,
+ // the task must call RT_Info::set to fill in execution properties.
+ // In the SUCCEEDED and UNKNOWN_TASK cases, this->register_task
+ // (rtinfo, 0, handle) is called. Returns FAILED if an error
+ // occurs.
+ //
+ // One motivation for allocating RT_Info's from within the Scheduler
+ // is to allow RT_Infos to persist after the tasks that use them.
+ // For instance, we may want to call this->schedule right before the
+ // application exits a configuration run. If the tasks have been
+ // deleted (deleting their RT_Infos with them), this->schedule will
+ // fail.
+
+ virtual status_t lookup_rt_info (handle_t handle,
+ RT_Info* &rtinfo) = 0;
+ // Obtains an RT_Info based on its "handle".
+
+ virtual status_t lookup_config_info (Preemption_Priority priority,
+ Config_Info* &config_info) = 0;
+ // Obtains a Config_Info based on its priority.
+
+
+
+ // = Computes the schedule.
+ virtual status_t
+ schedule (ACE_Unbounded_Set<Scheduling_Anomaly *> &anomaly_set) = 0;
+ // This actually generates the files.
+
+ // = Access a thread priority.
+ virtual int priority (const handle_t handle,
+ OS_Thread_Priority &priority,
+ Sub_Priority &subpriority,
+ Preemption_Priority &preemption_prio,
+ const mode_t = CURRENT_MODE) const = 0;
+ // Defines "priority" as the priority that was assigned to the Task that
+ // was assigned "handle", for the specified mode. Defines "subpriority"
+ // as the relative ordering (due to dependencies) within the priority.
+ // Returns 0 on success, or -1 if an invalid mode or handle are supplied.
+ // Queue numbers are platform-independent priority values, ranging from
+ // a highest priority value of 0 to the lowest priority value, which is
+ // returned by "minimum_priority_queue ()". The current and deadline times
+ // are part of the scheduling service implementation interface, but may be
+ // ignored by some implementations and used by others.
+
+ // = Access the platform-independent priority value of the lowest-priority
+ // thread.
+ u_int minimum_priority_queue () const { return minimum_priority_queue_; }
+ // This is intended for use by the Event Channel, so it can determine the
+ // number of priority dispatch queues to create.
+
+ // = Access the number of modes.
+ u_int modes () const { return modes_; }
+
+ // = Access the number of tasks.
+ u_int tasks () const { return tasks_; }
+
+ // = Access the number of threads.
+ u_int threads () const { return threads_; }
+
+ // = Access the current mode.
+ mode_t mode () const { return mode_; }
+
+ // = Set the current mode.
+ void mode (const mode_t mode) { mode_ = mode; }
+
+ // = Access the current scheduler status.
+ status_t status () const { return status_; }
+
+ // = Access the current output (debugging) level.
+ u_int output_level () const { return output_level_; }
+ // Default is 0; set to 1 to print out schedule, by task. Set
+ // to higher than one for debugging info.
+
+ // = Set the scheduler output (debugging) level.
+ void output_level (const u_int level) { output_level_ = level; }
+ // the only supported levels are 0 (quiet), 1 (verbose) and 2
+ // (debug)
+
+ static int add_dependency(RT_Info* rt_info,
+ const Dependency_Info& d);
+
+ static int number_of_dependencies(RT_Info* rt_info);
+ static int number_of_dependencies(RT_Info& rt_info);
+
+ static void export_to_file (RT_Info*, FILE* file);
+ static void export_to_file (RT_Info&, FILE* file);
+
+ virtual int dispatch_configuration (const Preemption_Priority &p_priority,
+ OS_Thread_Priority& priority,
+ Dispatching_Type & d_type);
+ // provide the thread priority and queue type for the given priority level
+
+
+protected:
+ ACE_Scheduler ();
+
+ // = Set the minimum priority value.
+ void minimum_priority_queue (const u_int minimum_priority_queue_number)
+ { minimum_priority_queue_ = minimum_priority_queue_number; }
+
+ // = Set the number of modes.
+ void modes (const u_int modes) { modes_ = modes; }
+
+ // = Set the number of tasks.
+ void tasks (const u_int tasks) { tasks_ = tasks; }
+
+ // = Set the number of threads.
+ void threads (const u_int threads) { threads_ = threads; }
+
+ // = Set the current scheduler status.
+ void status (const status_t new_status) { status_ = new_status; }
+
+private:
+ typedef ACE_CString EXT;
+ typedef RT_Info **INT;
+
+ typedef ACE_Map_Manager<EXT, INT, TAO_SYNCH_MUTEX> Info_Collection;
+ typedef ACE_Map_Iterator<EXT, INT, TAO_SYNCH_MUTEX> Info_Collection_Iterator;
+ typedef ACE_Map_Entry<EXT, INT> Info_Collection_Entry;
+
+ Info_Collection info_collection_;
+ // A binding of name to rt_info. This is the mapping for every
+ // rt_info in the process.
+
+ static ACE_Scheduler *instance_;
+
+ u_int minimum_priority_queue_;
+ // The platform-independent priority value of the Event Channel's
+ // minimum priority dispatch queue. The value of the maximum priority
+ // dispatch queue is always 0.
+
+ u_int modes_;
+ u_int tasks_;
+ u_int threads_;
+
+ mode_t mode_;
+ status_t status_;
+ u_int output_level_;
+
+ // the following functions are not implememented
+ ACE_Scheduler (const ACE_Scheduler &);
+ ACE_Scheduler &operator= (const ACE_Scheduler &);
+};
+
+typedef ACE_Scheduler Scheduler;
+
+#include /**/ "ace/post.h"
+#endif /* SCHEDULER_H */
+
+
+// EOF
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Scheduler_Generic.cpp b/TAO/orbsvcs/orbsvcs/Sched/Scheduler_Generic.cpp
new file mode 100644
index 00000000000..69448fa30b6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/Scheduler_Generic.cpp
@@ -0,0 +1,269 @@
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// sched
+//
+// = FILENAME
+// Scheduler_Generic.cpp
+//
+// = CREATION DATE
+// 19 November 1997
+//
+// = AUTHOR
+// David Levine
+//
+// ============================================================================
+
+#include "ace/Sched_Params.h"
+
+#include "orbsvcs/Sched/Scheduler_Generic.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID(Sched, Scheduler_Generic, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+// static functions
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+// Structure for storing the RT_Info information for each task, per mode.
+struct Mode_Entry
+{
+ RtecScheduler::RT_Info *rt_info_;
+ u_long start_time_; // microseconds
+ u_long stop_time_; // microseconds
+
+ Mode_Entry() :
+ rt_info_ (0),
+ start_time_ (0),
+ stop_time_ (0)
+ {
+ }
+
+ Mode_Entry(RtecScheduler::RT_Info *const rt_info,
+ const u_long start_time = 0,
+ const u_long stop_time = 0) :
+ rt_info_ (rt_info),
+ start_time_ (start_time),
+ stop_time_ (stop_time)
+ {
+ }
+
+ ~Mode_Entry () {}
+
+ Mode_Entry &operator= (const Mode_Entry &entry)
+ {
+ if (this != &entry)
+ {
+ rt_info_ = entry.rt_info_;
+ start_time_ = entry.start_time_;
+ stop_time_ = entry.stop_time_;
+ }
+
+ return *this;
+ }
+};
+
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+// class Scheduler_Generic member functions
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+Scheduler_Generic::Scheduler_Generic () :
+ Scheduler (),
+ handles_ (0),
+ // Set the minimum priority to that for the current platform. This
+ // shouldn't be necessary, but UPSingleProcessorOrb::initialize_reactors
+ // creates threads before the Event Channel calls Scheduler::init ().
+ minimum_priority_ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO,
+ ACE_SCOPE_THREAD)),
+ increasing_priority_ (-1),
+ task_entries_ ()
+{
+ config_info_.preemption_priority = ACE_Scheduler_MAX_PREEMPTION_PRIORITY;
+ config_info_.thread_priority = minimum_priority_;
+ config_info_.dispatching_type = RtecScheduler::STATIC_DISPATCHING;
+}
+
+
+Scheduler_Generic::~Scheduler_Generic ()
+{
+ reset ();
+}
+
+
+void
+Scheduler_Generic::reset ()
+{
+}
+
+Scheduler::status_t
+Scheduler_Generic::lookup_rt_info (handle_t handle,
+ RT_Info*& rtinfo)
+{
+ if (handle < 0 || (size_t) handle > task_entries_.size ())
+ {
+ return ST_UNKNOWN_TASK;
+ }
+ RT_Info*** entry;
+ ACE_Unbounded_Set_Iterator <RT_Info **> i (task_entries_);
+ while (i.next (entry) != 0)
+ {
+ i.advance ();
+ RT_Info** array = *entry;
+ if (array[0]->handle == handle)
+ {
+ rtinfo = array[0];
+ return SUCCEEDED;
+ }
+ }
+
+ return ST_UNKNOWN_TASK;
+}
+
+Scheduler::status_t
+Scheduler_Generic::lookup_config_info (Preemption_Priority priority,
+ Config_Info* &config_info)
+{
+ if (priority == config_info_.preemption_priority)
+ {
+ config_info = &config_info_;
+ return SUCCEEDED;
+ }
+ else
+ {
+ return ST_UNKNOWN_PRIORITY;
+ }
+}
+ // Obtains a Config_Info based on its priority.
+
+
+Scheduler::status_t
+Scheduler_Generic::register_task (RT_Info *rt_info [],
+ const u_int number_of_modes,
+ handle_t &handle)
+{
+ status_t ret;
+
+ // try to store the new task's information . . .
+ switch (task_entries_.insert (rt_info))
+ {
+ case 0 : // successfully inserted
+ {
+ rt_info [0]->handle = (handle = ++handles_);
+
+ // assigned the same handle to the RT_Info for each of its modes
+ for (u_int i = 1; i < number_of_modes; ++i)
+ {
+ if (rt_info [i] != 0)
+ rt_info [i]->handle = handle;
+ }
+
+ if (number_of_modes > modes ())
+ {
+ modes (number_of_modes);
+ }
+
+ ret = SUCCEEDED;
+
+ if (output_level () >= 5)
+ {
+ ACE_OS::printf ("registered task \"%s\" with RT_Info starting "
+ "at %p\n",
+ (const char*)rt_info[0]->entry_point,
+ rt_info[0]);
+ }
+ }
+ break;
+
+ case 1 : // the entry had already been inserted
+ handle = 0;
+ ret = ST_TASK_ALREADY_REGISTERED;
+ break;
+
+ default :
+ // case -1 : insert failed, probably because virtual memory exhaused
+ handle = 0;
+ ret = ST_VIRTUAL_MEMORY_EXHAUSTED;
+ break;
+ }
+
+ return ret;
+}
+
+
+void
+Scheduler_Generic::init (const int minimum_priority,
+ const int maximum_priority,
+ const char *runtime_filename,
+ const char *rt_info_filename,
+ const char *timeline_filename)
+{
+ minimum_priority_ = minimum_priority;
+ maximum_priority_ = maximum_priority;
+ runtime_filename_ = runtime_filename;
+ rt_info_filename_ = rt_info_filename;
+ timeline_filename_ = timeline_filename;
+ config_info_.thread_priority = minimum_priority_;
+}
+
+
+Scheduler::status_t
+Scheduler_Generic::schedule (ACE_Unbounded_Set<Scheduling_Anomaly *> &
+ /* anomaly_set */)
+{
+ ACE_GUARD_RETURN (LOCK, ace_mon, lock_, ACE_Scheduler::FAILED);
+
+ // here goes . . .
+
+ increasing_priority_ = maximum_priority_ >= minimum_priority_;
+
+ status_t status = ACE_Scheduler::SUCCEEDED;
+
+ // store number of tasks, based on registrations
+ tasks (static_cast<u_int> (task_entries_.size ()));
+
+ if (output_level () > 0)
+ {
+ print_schedule ();
+ }
+
+ return status;
+}
+
+
+int
+Scheduler_Generic::priority (const handle_t /* handle */,
+ OS_Thread_Priority &priority,
+ Sub_Priority &subpriority,
+ Preemption_Priority &preemption_prio,
+ const mode_t /* requested_mode */) const
+{
+ priority = minimum_priority_;
+ subpriority = ACE_Scheduler_MIN_SUB_PRIORITY;
+ preemption_prio = ACE_Scheduler_MAX_PREEMPTION_PRIORITY;
+
+ if (output_level () >= 3)
+ {
+ ACE_OS::printf ("preemption_prio %d: min %d, pri %d, min_pri %d\n",
+ preemption_prio, minimum_priority_queue (),
+ priority, minimum_priority_);
+ }
+
+ return 0;
+}
+
+
+void
+Scheduler_Generic::print_schedule ()
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Scheduler_Generic.h b/TAO/orbsvcs/orbsvcs/Sched/Scheduler_Generic.h
new file mode 100644
index 00000000000..1b73b4d1c4b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/Scheduler_Generic.h
@@ -0,0 +1,140 @@
+// -*- C++ -*-
+
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// sched
+//
+// = FILENAME
+// Scheduler_Generic.h
+//
+// = CREATION DATE
+// 19 November 1997
+//
+// = AUTHOR
+// David Levine
+//
+// ============================================================================
+
+#ifndef SCHEDULER_INTERNAL_H
+#define SCHEDULER_INTERNAL_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Sched/Scheduler.h"
+#include "ace/Unbounded_Set.h"
+#include "ace/Synch_Traits.h"
+#include "ace/Recursive_Thread_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_RTSched_Export Scheduler_Generic : public ACE_Scheduler
+ // = TITLE
+ // Implementation of an off-line scheduler.
+ //
+ // = DESCRIPTION
+ // Schedules tasks, assigning the same priority to all of them.
+{
+public:
+ Scheduler_Generic ();
+ virtual ~Scheduler_Generic ();
+
+ // = Initialize the scheduler.
+ virtual void init (const int minimum_priority,
+ const int maximum_priority,
+ const char *runtime_filename = 0,
+ const char *rt_info_filename = 0,
+ const char *timeline_filename = 0);
+
+ // = Registers a task.
+ virtual status_t register_task (RT_Info *[],
+ const u_int number_of_modes,
+ handle_t &handle);
+
+ virtual status_t lookup_rt_info (handle_t handle,
+ RT_Info* &rtinfo);
+ // Obtains an RT_Info based on its "handle".
+
+ virtual status_t lookup_config_info (Preemption_Priority priority,
+ Config_Info* &config_info);
+ // Obtains a Config_Info based on its priority.
+
+ // = Computes the schedule.
+ virtual status_t
+ schedule (ACE_Unbounded_Set<Scheduling_Anomaly *> &anomaly_set);
+
+ // = Access a thread priority.
+ virtual int priority (const handle_t handle,
+ OS_Thread_Priority &priority,
+ Sub_Priority &subpriority,
+ Preemption_Priority &preemption_prio,
+ const mode_t = CURRENT_MODE) const;
+ // Defines "priority" as the priority that was assigned to the Task that
+ // was assigned "handle", for the specified mode. Defines "subpriority"
+ // as the relative ordering (due to dependencies) within the priority.
+ // Returns 0 on success, or 1 if an invalid mode or handle are supplied.
+
+private:
+ u_int handles_;
+ // The number of task handles dispensed so far.
+
+ int minimum_priority_;
+ // The minimum priority value that the application specified (in
+ // its call to init ()).
+
+ int maximum_priority_;
+ // The maximum priority value that the application specified (in
+ // its call to init ()).
+
+ const char *runtime_filename_;
+ // Destination file of Scheduler output from the configuration run.
+
+ const char *rt_info_filename_;
+ // Destination file of all rt_info data from the configuration run.
+
+ const char *timeline_filename_;
+ // The destination of the timeline.
+
+ int increasing_priority_;
+ // Set to 1 if priority values increase with increasing priority,
+ // such as on Solaris and Win32, or 0 if they decrease, such as on
+ // VxWorks.
+
+ ACE_Unbounded_Set <RT_Info **> task_entries_;
+ // Collection of known tasks.
+
+ Config_Info config_info_;
+ // dispatchin configuration info
+
+#if defined (ACE_HAS_THREADS)
+ typedef TAO_SYNCH_RECURSIVE_MUTEX LOCK;
+#else
+ typedef ACE_Null_Mutex LOCK;
+#endif /* ACE_HAS_THREADS */
+
+ LOCK lock_;
+ // This protects access to the scheduler during configuration runs.
+
+
+ ///////////////////////////////////////
+ // member functions for internal use //
+ ///////////////////////////////////////
+
+ void reset ();
+ // Prepare for another schedule computation, but do not
+ // disturb the "output" (priorities that have already been assigned).
+
+ void print_schedule ();
+ // Display the schedule, task-by-task.
+
+ Scheduler_Generic (const Scheduler_Generic &);
+ Scheduler_Generic &operator= (const Scheduler_Generic &);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* SCHEDULER_INTERNAL_H */
+
+// EOF
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Strategy_Scheduler.cpp b/TAO/orbsvcs/orbsvcs/Sched/Strategy_Scheduler.cpp
new file mode 100644
index 00000000000..8b27fdbd690
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/Strategy_Scheduler.cpp
@@ -0,0 +1,1394 @@
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// sched
+//
+// = FILENAME
+// Strategy_Scheduler.cpp
+//
+// = CREATION DATE
+// 22 December 1997
+//
+// = AUTHOR
+// Chris Gill
+//
+// ============================================================================
+
+#include "orbsvcs/Sched/Strategy_Scheduler.h"
+#include "ace/Sched_Params.h"
+
+ACE_RCSID (Sched,
+ Strategy_Scheduler,
+ "$Id$")
+
+//////////////////////////////////////////////
+// Helper function type definition for sort //
+//////////////////////////////////////////////
+
+#if defined (ACE_HAS_WINCE)
+typedef int (_cdecl* COMP_FUNC) (const void*, const void*);
+#else
+// This is awkward, but it makes MSVC++ happy.
+extern "C"
+{
+typedef int (*COMP_FUNC) (const void*, const void*);
+}
+#endif // ACE_HAS_WINCE
+
+///////////////////////////////////////////////////
+// class ACE_Strategy_Scheduler member functions //
+///////////////////////////////////////////////////
+
+// = Constructor.
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_Strategy_Scheduler::ACE_Strategy_Scheduler (ACE_Scheduler_Strategy &strategy)
+ : ACE_DynScheduler (),
+ strategy_ (strategy)
+{
+}
+
+
+// = Virtual destructor.
+
+ACE_Strategy_Scheduler::~ACE_Strategy_Scheduler ()
+{
+}
+
+
+// = Sets up the schedule in the order generated
+// by the strategy's comparison operators.
+
+ACE_DynScheduler::status_t
+ACE_Strategy_Scheduler::sort_dispatches (Dispatch_Entry **dispatches,
+ u_int count)
+{
+ // Sort the entries in order of priority and subpriority.
+ strategy_.sort (dispatches, count);
+
+ return ACE_DynScheduler::SUCCEEDED;
+}
+
+// = Assigns priorities and sub-priorities to the sorted schedule,
+// according to the strategy's priority comparison operator.
+
+ACE_DynScheduler::status_t
+ACE_Strategy_Scheduler::assign_priorities (
+ Dispatch_Entry **dispatches,
+ u_int count,
+ ACE_Unbounded_Set<RtecScheduler::Scheduling_Anomaly *> &anomaly_set)
+{
+ // Start with happy status.
+ ACE_DynScheduler::status_t status = SUCCEEDED;
+
+ RtecScheduler::Scheduling_Anomaly * anomaly = 0;
+
+ // Start with the highest OS priority in the given range and work downward:
+ // if we run out of values to assign, return an error.
+ int current_OS_priority = maximum_priority_;
+
+ // Start scheduler priority at 0 (highest priority queue number)
+ // NOTE: 0 is highest for priority, lowest for dynamic and static subpriority.
+ Preemption_Priority current_scheduler_priority = 0;
+
+ // Value the OS and scheduler priorities in 0th dispatch entry.
+ dispatches[0]->OS_priority (current_OS_priority);
+ dispatches[0]->priority (current_scheduler_priority);
+
+ // Store the dispatch configuration for the highest priority level.
+ Config_Info *config_ptr;
+ ACE_NEW_RETURN (config_ptr, Config_Info, ST_VIRTUAL_MEMORY_EXHAUSTED);
+ config_ptr->preemption_priority = current_scheduler_priority;
+ config_ptr->thread_priority = current_OS_priority;
+ config_ptr->dispatching_type = strategy_.dispatch_type (*(dispatches[0]));
+ if (config_info_entries_->insert (config_ptr) < 0)
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+
+ // Traverse ordered dispatch entry array, assigning priority
+ // (array is sorted from highest to lowest priority).
+ for (u_int i = 1; i < count; ++i)
+ {
+ switch (strategy_.priority_comp (*(dispatches[i-1]),
+ *(dispatches[i])))
+ {
+ case -1: // The current entry is at lower priority than the previous.
+ {
+ // Decrease priority by incrementing the current scheduling priority
+ // number: 0 is the highest priority number.
+ ++current_scheduler_priority;
+
+ // Check for OS priority level boundaries: because OS priority values
+ // can run in either increasing or decreasing order, there is no easy,
+ // portable way to check other than exact comparison to the bounds
+ // that were given in init () or that came from the platform itself.
+ if ((current_OS_priority == minimum_priority_) ||
+ (current_OS_priority == ACE_Sched_Params::previous_priority (
+ ACE_SCHED_FIFO,
+ current_OS_priority,
+ ACE_SCOPE_PROCESS)))
+ {
+ // If we have run out of priority levels to assign, indicate
+ // this in the return status, unless a more severe problem is
+ // already reflected there. Log an anomaly but keep right on
+ // assigning the minimum OS priority in the range to the remaining
+ // tasks.
+ status = (status == SUCCEEDED)
+ ? ST_INSUFFICIENT_THREAD_PRIORITY_LEVELS
+ : status;
+
+ // Log the anomaly.
+ anomaly =
+ create_anomaly (ST_INSUFFICIENT_THREAD_PRIORITY_LEVELS);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+ }
+ else
+ {
+ // We're still in range, so decrement the current OS priority level.
+ current_OS_priority =
+ ACE_Sched_Params::previous_priority (ACE_SCHED_FIFO,
+ current_OS_priority,
+ ACE_SCOPE_PROCESS);
+ }
+
+ // Store the dispatch configuration for the new priority level.
+ ACE_NEW_RETURN(config_ptr, Config_Info, ST_VIRTUAL_MEMORY_EXHAUSTED);
+ config_ptr->preemption_priority = current_scheduler_priority;
+ config_ptr->thread_priority = current_OS_priority;
+ config_ptr->dispatching_type = strategy_.dispatch_type (*(dispatches[i]));
+ if (config_info_entries_->insert (config_ptr) < 0)
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+
+ break;
+ }
+ case 0: // Still at the same priority level.
+
+ break;
+
+ default: // Should never reach here: something *bad* has happened.
+
+ ACE_ERROR ((
+ LM_ERROR,
+ "Priority assignment failure: tasks"
+ " \"%s\" and \"%s\" are out of order.\n",
+ dispatches [i-1]->task_entry ().rt_info ()->entry_point.in (),
+ dispatches [i]->task_entry ().rt_info ()->entry_point.in ()));
+
+ status = ACE_DynScheduler::ST_INVALID_PRIORITY_ORDERING;
+
+ // Log the anomaly.
+ anomaly =
+ create_anomaly (ST_INVALID_PRIORITY_ORDERING);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+ }
+
+ // Set OS priority of the current dispatch entry.
+ dispatches[i]->OS_priority (current_OS_priority);
+
+ // Set scheduler priority of the current dispatch entry.
+ dispatches[i]->priority (current_scheduler_priority);
+ }
+
+ return status;
+}
+
+
+// = Assigns dynamic and static sub-priorities to the sorted dispatch
+// schedule, according to the strategy's subpriority comparisons.
+
+ACE_DynScheduler::status_t
+ACE_Strategy_Scheduler::assign_subpriorities (
+ Dispatch_Entry **dispatches,
+ u_int count,
+ ACE_Unbounded_Set<RtecScheduler::Scheduling_Anomaly *> &anomaly_set)
+{
+ ACE_DynScheduler::status_t status = ACE_DynScheduler::SUCCEEDED;
+ RtecScheduler::Scheduling_Anomaly * anomaly = 0;
+
+ // Start subpriority levels and element counts at 1, set level values in
+ // the first entry, increment the static subpriority level.
+ Sub_Priority dynamic_subpriority_level = 0;
+ Sub_Priority static_subpriority_level = 0;
+ u_int dynamic_subpriority_elements = 1;
+ u_int static_subpriority_elements = 1;
+ dispatches [0]->dynamic_subpriority (dynamic_subpriority_level);
+ dispatches [0]->static_subpriority (static_subpriority_level);
+
+ // Advance the static subpriority level.
+ static_subpriority_level++;
+
+ u_int i,j;
+ // Traverse ordered dispatch entry array, assigning priority
+ // (array is sorted from highest to lowest priority).
+ for (i = 1; i < count; ++i)
+ {
+ switch (strategy_.priority_comp (*(dispatches [i-1]),
+ *(dispatches [i])))
+ {
+ case -1: // The current entry is at lower priority than the previous.
+ {
+ // Fill in the high to low dynamic subpriority values by subtracting
+ // the previously assigned subpriority value of each of element in the
+ // current priority level from the value of last subpriority level.
+ for (j = 1; j <= dynamic_subpriority_elements; ++j)
+ {
+ dispatches [i - j]->
+ dynamic_subpriority (dynamic_subpriority_level -
+ dispatches [i - j]-> dynamic_subpriority ());
+ }
+ for (j = 1; j <= static_subpriority_elements; ++j)
+ {
+ dispatches [i - j]->
+ static_subpriority (static_subpriority_level -
+ dispatches [i - j]-> static_subpriority () - 1);
+ }
+
+ // Reset the subpriority counters, set these values in the
+ // current entry, and increment the static subpriority counter.
+ dynamic_subpriority_elements = 1;
+ static_subpriority_elements = 1;
+ dynamic_subpriority_level = 0;
+ static_subpriority_level = 0;
+ dispatches [i]->dynamic_subpriority (dynamic_subpriority_level);
+ dispatches [i]->static_subpriority (static_subpriority_level);
+
+ // Advance the static subpriority level.
+ static_subpriority_level++;
+
+ break;
+ }
+
+ case 0: // Still at the same priority level.
+
+ // Compare the dynamic subpriorities.
+ switch (strategy_.dynamic_subpriority_comp (*(dispatches[i-1]),
+ *(dispatches[i])))
+ {
+ case -1: // The current entry is at lower dynamic subpriority.
+
+ // Increment the dynamic subpriority level.
+ ++dynamic_subpriority_level;
+
+ // Update the static subpriority as well: this avoids problems
+ // with non-determinism if due to run-time conditions, two
+ // dispatches line up with identical dynamic subpriority that
+ // were considered different with respect to the critical instant.
+ dispatches [i]->static_subpriority (static_subpriority_level);
+ static_subpriority_level++;
+ static_subpriority_elements++;
+
+ break;
+
+ case 0: // Still at the same dynamic subpriority level.
+ {
+ switch (strategy_.static_subpriority_comp (*(dispatches[i-1]),
+ *(dispatches[i])))
+ {
+ case -1:
+ case 0:
+
+ // Assign and then increment the static subpriority: even if
+ // still at the same dynamic or static subpriority level as
+ // far as the scheduling strategy is concerned, assign a new
+ // one anyway, to give a completely deterministic schedule
+ // even if the dynamic subpriorities happen to align due to
+ // run-time variation.
+ dispatches [i]->static_subpriority (static_subpriority_level);
+ static_subpriority_level++;
+ static_subpriority_elements++;
+ break;
+
+ default: // We should never reach here: something *bad* has happened.
+
+ ACE_ERROR ((
+ LM_ERROR,
+ "Static subpriority assignment failure: tasks"
+ " \"%s\" and \"%s\" are out of order.\n",
+ dispatches [i-1]->task_entry ().rt_info ()->entry_point.in (),
+ dispatches [i]->task_entry ().rt_info ()->entry_point.in ()));
+
+ status = ST_INVALID_PRIORITY_ORDERING;
+
+ // Log the anomaly.
+ anomaly =
+ create_anomaly (ST_INVALID_PRIORITY_ORDERING);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+ }
+ break;
+ }
+
+ default: // We should never reach here: something *bad* has happened.
+
+ ACE_ERROR ((
+ LM_ERROR,
+ "Dynamic subpriority assignment failure: tasks"
+ " \"%s\" and \"%s\" are out of order.\n",
+ dispatches [i-1]->task_entry ().rt_info ()->entry_point.in (),
+ dispatches [i]->task_entry ().rt_info ()->entry_point.in ()));
+
+ status = ACE_DynScheduler::ST_INVALID_PRIORITY_ORDERING;
+
+ // Log the anomaly.
+ anomaly =
+ create_anomaly (ST_INVALID_PRIORITY_ORDERING);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+ }
+
+ dispatches [i]->dynamic_subpriority (dynamic_subpriority_level);
+ dynamic_subpriority_elements++;
+
+ break;
+
+ default: // We should never reach here: something *bad* has happened.
+
+ ACE_ERROR ((
+ LM_ERROR,
+ "Priority assignment failure: tasks"
+ " \"%s\" and \"%s\" are out of order.\n",
+ dispatches [i-1]->task_entry ().rt_info ()->entry_point.in (),
+ dispatches [i]->task_entry ().rt_info ()->entry_point.in ()));
+
+ status = ACE_DynScheduler::ST_INVALID_PRIORITY_ORDERING;
+
+ // Log the anomaly.
+ anomaly =
+ create_anomaly (ST_INVALID_PRIORITY_ORDERING);
+ if (anomaly)
+ {
+ anomaly_set.insert (anomaly);
+ }
+ else
+ {
+ return ST_VIRTUAL_MEMORY_EXHAUSTED;
+ }
+ }
+ }
+
+ // Fill in the high to low subpriority values for the last priority
+ // level by subtracting the previously assigned subpriorities from
+ // the total number of subpriorities.
+ for (j = 1; j <= dynamic_subpriority_elements; ++j)
+ {
+ dispatches [i - j]->
+ dynamic_subpriority (dynamic_subpriority_level -
+ dispatches [i - j]->dynamic_subpriority ());
+ }
+ for (j = 1; j <= static_subpriority_elements; ++j)
+ {
+ dispatches [i - j]->
+ static_subpriority (static_subpriority_level -
+ dispatches [i - j]->static_subpriority () - 1);
+ }
+
+ return status;
+}
+
+// = Determine the minimum critical priority number.
+
+ACE_DynScheduler::Preemption_Priority
+ACE_Strategy_Scheduler::minimum_critical_priority ()
+{
+ return strategy_.minimum_critical_priority ();
+}
+
+
+// = Schedules a dispatch entry into the timeline being created.
+
+ACE_DynScheduler::status_t
+ACE_Strategy_Scheduler::schedule_timeline_entry (
+ Dispatch_Entry &dispatch_entry,
+ ACE_Unbounded_Queue <Dispatch_Entry *> &reschedule_queue)
+{
+ status_t status = SUCCEEDED;
+
+ // Timeline entries cover the execution time of the dispatch.
+ Time remaining_time =
+ dispatch_entry.task_entry().rt_info ()->worst_case_execution_time;
+
+ // Initialize last stop time to arrival time of the dispatch.
+ Time last_stop = dispatch_entry.arrival ();
+
+ TimeLine_Entry *last_entry = 0;
+ TimeLine_Entry *current_entry = 0;
+ ACE_Ordered_MultiSet_Iterator <TimeLine_Entry_Link> iter (*timeline_);
+ for (iter.first (); (remaining_time > 0U) && (iter.done () == 0);
+ iter.advance ())
+ {
+ TimeLine_Entry_Link *link;
+ if ((iter.next (link) == 0) || (! link))
+ {
+ return ST_BAD_INTERNAL_POINTER;
+ }
+
+ // For each entry already in the timeline that is the first one for a
+ // dispatch, and has lower dynamic subpriority and does not have greater
+ // static priority, and starts in the period in which the new entry would
+ // execute, advance the iterator to the next timeline entry
+ // having a different dispatch entry (if there is such), add its dispatch
+ // entry to the reschedule set, remove all TimeLine_Entry_Links that
+ // correspond to that dispatch entry, and delete all its TimeLine_Entry
+ // objects as well. NOTE: 0 is highest priority, 1 next, etc.
+ while ((iter.done () == 0) &&
+ (link->entry ().start() < last_stop + remaining_time) &&
+ (link->entry ().start() >= last_stop) &&
+ (link->entry ().prev () == 0) &&
+ (link->entry ().dispatch_entry().priority () >=
+ dispatch_entry.priority ()) &&
+ (strategy_.dynamic_subpriority (dispatch_entry, link->entry ().start ()) >
+ strategy_.dynamic_subpriority (link->entry ().dispatch_entry (),
+ link->entry ().start ())))
+ {
+ // Point to the dispatch entry whose timeline entries will be removed and
+ // rescheduled, and to the timeline entry heading the bilinked list of
+ // timeline entries to be removed.
+ Dispatch_Entry *removed_dispatch_entry
+ = &(link->entry ().dispatch_entry());
+ TimeLine_Entry *remove_entry = & (link->entry ());
+
+ // Put the dispatch entry into the set of entries that will be
+ // rescheduled at the end of this method (tail recursively).
+ reschedule_queue.enqueue_tail (removed_dispatch_entry);
+
+ // Advance the iterator to the next timeline entry (if there is one)
+ // that is not for the dispatch entry being removed.
+ while (iter.done () == 0)
+ {
+ // Point to the current link.
+ if ((iter.next (link) == 0) || (! link))
+ {
+ return ST_BAD_INTERNAL_POINTER;
+ }
+
+ // Advance until a different dispatch entry is found,
+ // or we run off the end of the timeline.
+ if (&(link->entry ().dispatch_entry ()) ==
+ removed_dispatch_entry)
+ {
+ iter.advance ();
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ // Remove entries corresponding to the rescheduled
+ // dispatch from the timeline and destroy them.
+ TimeLine_Entry *next_remove_entry = 0;
+ while (remove_entry)
+ {
+ next_remove_entry = remove_entry->next ();
+
+ timeline_->remove (TimeLine_Entry_Link (*remove_entry));
+ delete remove_entry;
+
+ remove_entry = next_remove_entry;
+ }
+ }
+
+ // Exit the outer loop if there are no more entries in the timeline.
+ if (iter.done () != 0)
+ {
+ break;
+ }
+
+ // If there's room, schedule a new timeline entry for the dispatch.
+ if (link->entry ().start() > last_stop)
+ {
+ ACE_NEW_RETURN (
+ current_entry,
+ TimeLine_Entry (
+ dispatch_entry,
+ last_stop,
+ (((remaining_time + last_stop) < link->entry ().start())
+ ? (remaining_time + last_stop) : link->entry ().start()),
+ dispatch_entry.arrival (),
+ dispatch_entry.deadline (),
+ (TimeLine_Entry *) 0, last_entry),
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+
+ // Patch up the pointers within the list of entries for this dispatch.
+ if (last_entry)
+ {
+ last_entry->next (current_entry);
+ }
+ last_entry = current_entry;
+
+ timeline_->insert(TimeLine_Entry_Link(*current_entry));
+
+ // Update the remaining time and last stop values.
+ remaining_time -= ((remaining_time < (link->entry ().start() - last_stop))
+ ? remaining_time : (link->entry ().start() - last_stop));
+ }
+
+ // Update the last stop time.
+ if (last_stop < link->entry ().stop ())
+ {
+ last_stop = link->entry ().stop ();
+ }
+ }
+
+ // If there is still dispatch time remaining, and we've
+ // reached the end of the list, insert what's left.
+ if (remaining_time > 0U)
+ {
+ ACE_NEW_RETURN (
+ current_entry,
+ TimeLine_Entry (
+ dispatch_entry,
+ last_stop,
+ remaining_time + last_stop,
+ dispatch_entry.arrival (),
+ dispatch_entry.deadline (),
+ 0, last_entry),
+ ST_VIRTUAL_MEMORY_EXHAUSTED);
+
+ // Patch up the pointers within the list of entries for this dispatch.
+ if (last_entry)
+ {
+ last_entry->next (current_entry);
+ }
+
+ timeline_->insert(TimeLine_Entry_Link(*current_entry));
+ }
+
+ return status;
+}
+
+
+
+////////////////////////////////////////////////////////////////////
+// class template ACE_Strategy_Scheduler_Factory member functions //
+////////////////////////////////////////////////////////////////////
+
+// = Constructs and returns a scheduler strategized with
+// an instance of the the parameterized strategy type.
+
+template <class STRATEGY> ACE_Strategy_Scheduler *
+ACE_Strategy_Scheduler_Factory<STRATEGY>::create (RtecScheduler::Preemption_Priority_t minimum_critical_priority)
+{
+ ACE_Strategy_Scheduler *the_scheduler = 0;
+ STRATEGY *the_strategy;
+
+ ACE_NEW_RETURN(the_strategy, STRATEGY(minimum_critical_priority), 0);
+
+ ACE_NEW_RETURN (the_scheduler, ACE_Strategy_Scheduler (*the_strategy), 0);
+
+ return the_scheduler;
+}
+
+
+
+/////////////////////////////////////////////////////////////////
+// abstract base class ACE_Scheduler_Strategy member functions //
+/////////////////////////////////////////////////////////////////
+
+// = Constructor.
+
+ACE_Scheduler_Strategy::ACE_Scheduler_Strategy (
+ ACE_DynScheduler::Preemption_Priority minimum_critical_priority)
+ : minimum_critical_priority_ (minimum_critical_priority)
+{
+}
+
+ACE_Scheduler_Strategy::~ACE_Scheduler_Strategy (void)
+{
+}
+
+// = Compares two dispatch entries using the specific priority, dynamic
+// subpriority, and static subpriority method definitions provided by
+// the derived strategy class to produce the strategy specific sort
+// ordering: returns -1 if the first Dispatch_Entry is greater in the order,
+// 0 if they are equivalent, or 1 if the second Dispatch_Entry is greater in
+// the order.
+
+int
+ACE_Scheduler_Strategy::sort_comp
+ (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry)
+{
+ // Order first by the priority ordering.
+ int result = priority_comp (first_entry, second_entry);
+
+ // Within same priority, order by dynamic subpriority.
+ if (result == 0)
+ {
+ result = dynamic_subpriority_comp (first_entry, second_entry);
+ }
+
+ // If same dynamic subpriority, order by static subpriority.
+ if (result == 0)
+ {
+ result = static_subpriority_comp (first_entry, second_entry);
+ }
+
+ return result;
+}
+
+// = Provides a lowest level ordering based first on importance (descending),
+// and then on the dependency topological sort finishing time (ascending).
+
+int
+ACE_Scheduler_Strategy::static_subpriority_comp (
+ const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry)
+{
+ // Order first by importance assigned to underlying RT_Info (descending).
+ if (first_entry.task_entry ().rt_info ()->importance >
+ second_entry.task_entry ().rt_info ()->importance)
+ {
+ return -1;
+ }
+ else if (first_entry.task_entry ().rt_info ()->importance <
+ second_entry.task_entry ().rt_info ()->importance)
+ {
+ return 1;
+ }
+ else
+ {
+ // Order last by the topological sort finishing time (ascending).
+ if (first_entry.task_entry ().finished () <
+ second_entry.task_entry ().finished ())
+ {
+ return -1;
+ }
+ else if (first_entry.task_entry ().finished () >
+ second_entry.task_entry ().finished ())
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+}
+
+
+// = Base class supplies default behavior: returns 0
+// for minimum critical priority number.
+
+ACE_DynScheduler::Preemption_Priority
+ACE_Scheduler_Strategy::minimum_critical_priority ()
+{
+ return 0;
+}
+
+
+
+/////////////////////////////////////////////////////////////////////////
+// class ACE_MUF_Scheduler_Strategy static data member initializations //
+/////////////////////////////////////////////////////////////////////////
+
+ACE_MUF_Scheduler_Strategy * ACE_MUF_Scheduler_Strategy::instance_ = 0;
+
+///////////////////////////////////////////////////////
+// class ACE_MUF_Scheduler_Strategy member functions //
+///////////////////////////////////////////////////////
+
+// = Returns an instance of the strategy.
+
+ACE_MUF_Scheduler_Strategy *
+ACE_MUF_Scheduler_Strategy::instance ()
+{
+ if (0 == ACE_MUF_Scheduler_Strategy::instance_)
+ {
+ ACE_NEW_RETURN (ACE_MUF_Scheduler_Strategy::instance_,
+ ACE_MUF_Scheduler_Strategy, 0);
+ }
+
+ return ACE_MUF_Scheduler_Strategy::instance_;
+}
+
+// = Compares two dispatch entries by maximum criticality: returns -1 if the
+// first Dispatch_Entry is greater in the order, 0 if they're equivalent, or
+// 1 if the second Dispatch_Entry is greater in the order.
+
+int
+ACE_MUF_Scheduler_Strategy::priority_comp (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry)
+{
+ // Order by criticality (descending).
+ if (first_entry.task_entry ().rt_info ()->criticality >
+ second_entry.task_entry ().rt_info ()->criticality)
+ {
+ return -1;
+ }
+ else if (first_entry.task_entry ().rt_info ()->criticality <
+ second_entry.task_entry ().rt_info ()->criticality)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0; // Same priority level.
+ }
+}
+
+
+// = Sorts the dispatch entry pointer array in descending urgency order.
+
+void
+ACE_MUF_Scheduler_Strategy::sort (Dispatch_Entry **dispatch_entries, u_int size)
+{
+ ACE_OS::qsort ((void *) dispatch_entries,
+ size,
+ sizeof (Dispatch_Entry *),
+ (COMP_FUNC) ACE_MUF_Scheduler_Strategy::sort_function);
+}
+
+
+// = Default constructor.
+
+ACE_MUF_Scheduler_Strategy::ACE_MUF_Scheduler_Strategy (
+ ACE_DynScheduler::Preemption_Priority minimum_critical_priority)
+ :ACE_Scheduler_Strategy (minimum_critical_priority)
+{
+}
+
+
+// = Virtual destructor.
+
+ACE_MUF_Scheduler_Strategy::~ACE_MUF_Scheduler_Strategy ()
+{
+}
+
+
+// = Returns a dynamic subpriority value for the given entry and the
+// current time: if the operation has non-negative laxity, then the
+// value is positive, and a lower laxity gives a higher dynamic
+// subpriority; if the operation has negative laxity, the value
+// is the (negative) laxity value.
+
+long
+ACE_MUF_Scheduler_Strategy::dynamic_subpriority (Dispatch_Entry &entry,
+ RtecScheduler::Time current_time)
+{
+ long laxity =
+ ACE_U64_TO_U32 (entry.deadline () - current_time -
+ entry.task_entry ().rt_info ()->worst_case_execution_time);
+
+ return (laxity > 0) ? LONG_MAX - laxity : laxity;
+}
+
+
+// = Orders two dispatch entries by ascending laxity: returns -1 if the
+// first Dispatch_Entry is greater in the order, 0 if they're equivalent,
+// 1 if the second Dispatch_Entry is greater in the order.
+
+int
+ACE_MUF_Scheduler_Strategy::dynamic_subpriority_comp
+ (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry)
+{
+ // Order by descending dynamic priority according to ascending laxity.
+ u_long laxity1 =
+ ACE_U64_TO_U32 (first_entry.deadline () - first_entry.arrival () -
+ first_entry.task_entry ().rt_info ()->worst_case_execution_time);
+
+ u_long laxity2 =
+ ACE_U64_TO_U32 (second_entry.deadline () - first_entry.arrival () -
+ second_entry.task_entry ().rt_info ()->worst_case_execution_time);
+
+ if (laxity1 < laxity2)
+ {
+ return -1;
+ }
+ else if (laxity1 > laxity2)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+
+// = Comparison function to pass to qsort.
+
+int
+ACE_MUF_Scheduler_Strategy::sort_function (void *arg1, void *arg2)
+{
+ return ACE_MUF_Scheduler_Strategy::instance ()->
+ sort_comp (** static_cast<Dispatch_Entry **> (arg1),
+ ** static_cast<Dispatch_Entry **> (arg2));
+}
+
+
+// = Returns the minimum critical priority number.
+
+ACE_DynScheduler::Preemption_Priority
+ACE_MUF_Scheduler_Strategy::minimum_critical_priority ()
+{
+ return minimum_critical_priority_;
+}
+
+
+// = Provides the dispatching queue type for the given dispatch entry.
+
+ACE_DynScheduler::Dispatching_Type
+ACE_MUF_Scheduler_Strategy::dispatch_type (const Dispatch_Entry & /* entry */)
+{
+ return RtecScheduler::LAXITY_DISPATCHING;
+}
+
+
+
+
+/////////////////////////////////////////////////////////////////////////
+// class ACE_RMS_Scheduler_Strategy static data member initializations //
+/////////////////////////////////////////////////////////////////////////
+
+ACE_RMS_Scheduler_Strategy * ACE_RMS_Scheduler_Strategy::instance_ = 0;
+
+///////////////////////////////////////////////////////
+// class ACE_RMS_Scheduler_Strategy member functions //
+///////////////////////////////////////////////////////
+
+// = Returns an instance of the strategy.
+
+ACE_RMS_Scheduler_Strategy *
+ACE_RMS_Scheduler_Strategy::instance ()
+{
+ if (0 == ACE_RMS_Scheduler_Strategy::instance_)
+ {
+ ACE_NEW_RETURN (ACE_RMS_Scheduler_Strategy::instance_,
+ ACE_RMS_Scheduler_Strategy, 0);
+ }
+
+ return ACE_RMS_Scheduler_Strategy::instance_;
+}
+
+// = Compares two dispatch entries by minimum period: returns -1 if the
+// first Dispatch_Entry is greater in the order, 0 if they're equivalent,
+// or 1 if the second Dispatch_Entry is greater in the order.
+
+int
+ACE_RMS_Scheduler_Strategy::priority_comp (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry)
+{
+ // compare by decreasing dispatch period
+ if ((first_entry.deadline () - first_entry.arrival ()) <
+ (second_entry.deadline () - second_entry.arrival ()))
+ {
+ return -1;
+ }
+ else if ((first_entry.deadline () - first_entry.arrival ()) >
+ (second_entry.deadline () - second_entry.arrival ()))
+ {
+ return 1;
+ }
+ else
+ {
+ return 0; // same priority level
+ }
+}
+
+
+// = Sorts the dispatch entry pointer array in descending RMS (rate) order.
+
+void
+ACE_RMS_Scheduler_Strategy::sort (
+ Dispatch_Entry **dispatch_entries_, u_int size)
+{
+ ACE_OS::qsort ((void *) dispatch_entries_,
+ size,
+ sizeof (Dispatch_Entry *),
+ (COMP_FUNC) ACE_RMS_Scheduler_Strategy::sort_function);
+}
+
+
+// = Default constructor.
+
+ACE_RMS_Scheduler_Strategy::ACE_RMS_Scheduler_Strategy (
+ ACE_DynScheduler::Preemption_Priority minimum_critical_priority)
+ :ACE_Scheduler_Strategy (minimum_critical_priority)
+{
+}
+
+
+// = Virtual destructor.
+
+ACE_RMS_Scheduler_Strategy::~ACE_RMS_Scheduler_Strategy ()
+{
+}
+
+
+// = All entries have the same dynamic subpriority value.
+
+long
+ACE_RMS_Scheduler_Strategy::dynamic_subpriority (
+ Dispatch_Entry & /* entry */,
+ RtecScheduler::Time /* current_time */)
+{
+ return 0;
+}
+
+
+// = All tasks in a given priority level have the same dynamic
+// subpriority under RMS.
+
+int
+ACE_RMS_Scheduler_Strategy::dynamic_subpriority_comp
+ (const Dispatch_Entry & /* first_entry */,
+ const Dispatch_Entry & /* second_entry */)
+{
+ return 0;
+}
+
+
+// Comparison function to pass to qsort.
+
+int
+ACE_RMS_Scheduler_Strategy::sort_function (void *arg1, void *arg2)
+{
+ return ACE_RMS_Scheduler_Strategy::instance ()->
+ sort_comp (** static_cast<Dispatch_Entry **> (arg1),
+ ** static_cast<Dispatch_Entry **> (arg2));
+}
+
+
+// = Returns minimum critical priority number.
+
+ACE_DynScheduler::Preemption_Priority
+ACE_RMS_Scheduler_Strategy::minimum_critical_priority ()
+{
+ return minimum_critical_priority_;
+}
+
+
+// = Provide the dispatching queue type for the given dispatch entry.
+
+ACE_DynScheduler::Dispatching_Type
+ACE_RMS_Scheduler_Strategy::dispatch_type (const Dispatch_Entry & /* entry */)
+{
+ return RtecScheduler::STATIC_DISPATCHING;
+}
+
+
+
+/////////////////////////////////////////////////////////////////////////
+// class ACE_MLF_Scheduler_Strategy static data member initializations //
+/////////////////////////////////////////////////////////////////////////
+
+ACE_MLF_Scheduler_Strategy * ACE_MLF_Scheduler_Strategy::instance_ = 0;
+
+///////////////////////////////////////////////////////
+// class ACE_MLF_Scheduler_Strategy member functions //
+///////////////////////////////////////////////////////
+
+// = Returns an instance of the strategy.
+
+ACE_MLF_Scheduler_Strategy *
+ACE_MLF_Scheduler_Strategy::instance ()
+{
+ if (0 == ACE_MLF_Scheduler_Strategy::instance_)
+ {
+ ACE_NEW_RETURN (ACE_MLF_Scheduler_Strategy::instance_,
+ ACE_MLF_Scheduler_Strategy, 0);
+ }
+
+ return ACE_MLF_Scheduler_Strategy::instance_;
+}
+
+
+// = Just returns 0, as all dispatch entries are of equivalent
+// static priority under MLF.
+
+int
+ACE_MLF_Scheduler_Strategy::priority_comp (const Dispatch_Entry & /* first_entry */,
+ const Dispatch_Entry & /* second_entry */)
+{
+ return 0;
+}
+
+
+// = Sorts the dispatch entry pointer array in ascending laxity order.
+
+void
+ACE_MLF_Scheduler_Strategy::sort (
+ Dispatch_Entry **dispatch_entries_, u_int size)
+{
+ ACE_OS::qsort ((void *) dispatch_entries_,
+ size,
+ sizeof (Dispatch_Entry *),
+ (COMP_FUNC) ACE_MLF_Scheduler_Strategy::sort_function);
+}
+
+
+// = Default constructor.
+
+ACE_MLF_Scheduler_Strategy::ACE_MLF_Scheduler_Strategy (
+ ACE_DynScheduler::Preemption_Priority /* minimum_critical_priority */)
+ :ACE_Scheduler_Strategy (0)
+{
+}
+
+
+// = Virtual destructor
+
+ACE_MLF_Scheduler_Strategy::~ACE_MLF_Scheduler_Strategy ()
+{
+}
+
+
+// = Returns a dynamic subpriority value for the given entry and the
+// current time relative to its arrival.
+
+long
+ACE_MLF_Scheduler_Strategy::dynamic_subpriority (Dispatch_Entry &entry,
+ RtecScheduler::Time current_time)
+{
+ long laxity =
+ ACE_U64_TO_U32 (entry.deadline () - current_time -
+ entry.task_entry ().rt_info ()->worst_case_execution_time);
+
+ return (laxity > 0) ? LONG_MAX - laxity : laxity;
+}
+
+
+// = Orders two dispatch entries by ascending laxity: returns -1 if the
+// first Dispatch_Entry is greater in the order, 0 if they're equivalent,
+// or 1 if the second Dispatch_Entry is greater in the order.
+
+int
+ACE_MLF_Scheduler_Strategy::dynamic_subpriority_comp
+ (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry)
+{
+ // Order by descending dynamic priority according to ascending laxity.
+ u_long laxity1 =
+ ACE_U64_TO_U32 (first_entry.deadline () - first_entry.arrival () -
+ first_entry.task_entry ().rt_info ()->worst_case_execution_time);
+
+ u_long laxity2 =
+ ACE_U64_TO_U32 (second_entry.deadline () - first_entry.arrival () -
+ second_entry.task_entry ().rt_info ()->worst_case_execution_time);
+
+ if (laxity1 < laxity2)
+ {
+ return -1;
+ }
+ else if (laxity1 > laxity2)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+
+// = Comparison function to pass to qsort.
+
+int
+ACE_MLF_Scheduler_Strategy::sort_function (void *arg1, void *arg2)
+{
+ return ACE_MLF_Scheduler_Strategy::instance ()->
+ sort_comp (** static_cast<Dispatch_Entry **> (arg1),
+ ** static_cast<Dispatch_Entry **> (arg2));
+}
+
+
+// = Provides the dispatching queue type for the given dispatch entry.
+
+ACE_DynScheduler::Dispatching_Type
+ACE_MLF_Scheduler_Strategy::dispatch_type (const Dispatch_Entry & /* entry */)
+{
+ return RtecScheduler::LAXITY_DISPATCHING;
+}
+
+
+
+/////////////////////////////////////////////////////////////////////////
+// class ACE_EDF_Scheduler_Strategy static data member initializations //
+/////////////////////////////////////////////////////////////////////////
+
+ACE_EDF_Scheduler_Strategy * ACE_EDF_Scheduler_Strategy::instance_ = 0;
+
+///////////////////////////////////////////////////////
+// class ACE_EDF_Scheduler_Strategy member functions //
+///////////////////////////////////////////////////////
+
+// = Returns an instance of the strategy.
+
+ACE_EDF_Scheduler_Strategy *
+ACE_EDF_Scheduler_Strategy::instance ()
+{
+ if (0 == ACE_EDF_Scheduler_Strategy::instance_)
+ {
+ ACE_NEW_RETURN (ACE_EDF_Scheduler_Strategy::instance_,
+ ACE_EDF_Scheduler_Strategy, 0);
+ }
+
+ return ACE_EDF_Scheduler_Strategy::instance_;
+}
+
+// = Just returns 0, as all dispatch entries are of
+// equivalent static priority under EDF.
+
+int
+ACE_EDF_Scheduler_Strategy::priority_comp (const Dispatch_Entry & /* first_entry */,
+ const Dispatch_Entry & /* second_entry */)
+{
+ return 0;
+}
+
+
+// = Sort the dispatch entry pointer array in ascending deadline (period) order.
+
+void
+ACE_EDF_Scheduler_Strategy::sort (
+ Dispatch_Entry **dispatch_entries_, u_int size)
+{
+ ACE_OS::qsort ((void *) dispatch_entries_,
+ size,
+ sizeof (Dispatch_Entry *),
+ (COMP_FUNC) ACE_EDF_Scheduler_Strategy::sort_function);
+}
+
+
+// = Default constructor.
+
+ACE_EDF_Scheduler_Strategy::ACE_EDF_Scheduler_Strategy (
+ ACE_DynScheduler::Preemption_Priority /* minimum_critical_priority */)
+ :ACE_Scheduler_Strategy (0)
+{
+}
+
+
+// = Virtual destructor.
+
+ACE_EDF_Scheduler_Strategy::~ACE_EDF_Scheduler_Strategy ()
+{
+}
+
+// = Returns a dynamic subpriority value for the given entry and the
+// current time relative to its arrival.
+
+long
+ACE_EDF_Scheduler_Strategy::dynamic_subpriority (Dispatch_Entry &entry,
+ RtecScheduler::Time current_time)
+{
+ long time_to_deadline =
+ ACE_U64_TO_U32 (entry.deadline () - current_time);
+
+ return (time_to_deadline > 0)
+ ? LONG_MAX - time_to_deadline : time_to_deadline;
+}
+
+
+// = Orders two dispatch entries by ascending time to deadline: returns -1 if
+// the first Dispatch_Entry is greater in the order, 0 if they're equivalent,
+// or 1 if the second Dispatch_Entry is greater in the order.
+
+int
+ACE_EDF_Scheduler_Strategy::dynamic_subpriority_comp
+ (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry)
+{
+ // Order by dispatchable interval (ascending).
+ if (first_entry.deadline () - first_entry.arrival () <
+ second_entry.deadline () - first_entry.arrival ())
+ {
+ return -1;
+ }
+ else if (first_entry.deadline () - first_entry.arrival () >
+ second_entry.deadline () - first_entry.arrival ())
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+
+// = Comparison function to pass to qsort.
+
+int
+ACE_EDF_Scheduler_Strategy::sort_function (void *arg1, void *arg2)
+{
+ return ACE_EDF_Scheduler_Strategy::instance ()->
+ sort_comp (** static_cast<Dispatch_Entry **> (arg1),
+ ** static_cast<Dispatch_Entry **> (arg2));
+}
+
+// = Provides the dispatching queue type for the given dispatch entry.
+
+ACE_DynScheduler::Dispatching_Type
+ACE_EDF_Scheduler_Strategy::dispatch_type (const Dispatch_Entry & /* entry */)
+{
+ return RtecScheduler::DEADLINE_DISPATCHING;
+}
+
+
+//////////////////////////////////////////////
+// class ACE_Criticality_Scheduler_Strategy //
+// static data member initializations //
+//////////////////////////////////////////////
+
+ACE_Criticality_Scheduler_Strategy *
+ACE_Criticality_Scheduler_Strategy::instance_ = 0;
+
+///////////////////////////////////////////////////////////////
+// class ACE_Criticality_Scheduler_Strategy member functions //
+///////////////////////////////////////////////////////////////
+
+// = Returns an instance of the strategy.
+
+ACE_Criticality_Scheduler_Strategy *
+ACE_Criticality_Scheduler_Strategy::instance ()
+{
+ if (0 == ACE_Criticality_Scheduler_Strategy::instance_)
+ {
+ ACE_NEW_RETURN (ACE_Criticality_Scheduler_Strategy::instance_,
+ ACE_Criticality_Scheduler_Strategy, 0);
+ }
+
+ return ACE_Criticality_Scheduler_Strategy::instance_;
+}
+
+// = Compares two dispatch entries by minimum period: returns -1 if the
+// first Dispatch_Entry is greater in the order, 0 if they're equivalent,
+// or 1 if the second Dispatch_Entry is greater in the order.
+
+int
+ACE_Criticality_Scheduler_Strategy::priority_comp (
+ const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry)
+{
+ // Order by criticality (descending).
+ if (first_entry.task_entry ().rt_info ()->criticality >
+ second_entry.task_entry ().rt_info ()->criticality)
+ {
+ return -1;
+ }
+ else if (first_entry.task_entry ().rt_info ()->criticality <
+ second_entry.task_entry ().rt_info ()->criticality)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0; // Same priority level.
+ }
+}
+
+// = Sorts the dispatch entry pointer array in descending criticality order.
+
+void
+ACE_Criticality_Scheduler_Strategy::sort (
+ Dispatch_Entry **dispatch_entries_, u_int size)
+{
+ ACE_OS::qsort ((void *) dispatch_entries_,
+ size,
+ sizeof (Dispatch_Entry *),
+ (COMP_FUNC) ACE_Criticality_Scheduler_Strategy::sort_function);
+}
+
+
+// = Default constructor.
+
+ACE_Criticality_Scheduler_Strategy::ACE_Criticality_Scheduler_Strategy (
+ ACE_DynScheduler::Preemption_Priority minimum_critical_priority)
+ :ACE_Scheduler_Strategy (minimum_critical_priority)
+{
+}
+
+
+// = Virtual destructor.
+
+ACE_Criticality_Scheduler_Strategy::~ACE_Criticality_Scheduler_Strategy ()
+{
+}
+
+// = All entries have the same dynamic subpriority value.
+
+long
+ACE_Criticality_Scheduler_Strategy::dynamic_subpriority (
+ Dispatch_Entry & /* entry */,
+ RtecScheduler::Time /* current_time */)
+{
+ return 0;
+}
+
+
+// = All tasks in a given priority level have the same dynamic
+// subpriority under this strategy.
+
+int
+ACE_Criticality_Scheduler_Strategy::dynamic_subpriority_comp
+ (const Dispatch_Entry & /* first_entry */,
+ const Dispatch_Entry & /* second_entry */)
+{
+ return 0;
+}
+
+
+// = Comparison function to pass to qsort.
+
+int
+ACE_Criticality_Scheduler_Strategy::sort_function (void *arg1, void *arg2)
+{
+ return ACE_Criticality_Scheduler_Strategy::instance ()->
+ sort_comp (** static_cast<Dispatch_Entry **> (arg1),
+ ** static_cast<Dispatch_Entry **> (arg2));
+}
+
+
+// = Returns minimum critical priority number.
+
+ACE_DynScheduler::Preemption_Priority
+ACE_Criticality_Scheduler_Strategy::minimum_critical_priority ()
+{
+ return minimum_critical_priority_;
+}
+
+// = Provides the dispatching queue type for the given dispatch entry.
+
+ACE_DynScheduler::Dispatching_Type
+ACE_Criticality_Scheduler_Strategy::dispatch_type (
+ const Dispatch_Entry & /* entry */)
+{
+ return RtecScheduler::STATIC_DISPATCHING;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Strategy_Scheduler.h b/TAO/orbsvcs/orbsvcs/Sched/Strategy_Scheduler.h
new file mode 100644
index 00000000000..e323855d33e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/Strategy_Scheduler.h
@@ -0,0 +1,505 @@
+// -*- C++ -*-
+
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// sched
+//
+// = FILENAME
+// Strategy_Scheduler.h
+//
+// = CREATION DATE
+// 22 December 1997
+//
+// = AUTHOR
+// Chris Gill
+//
+// ============================================================================
+
+#ifndef STRATEGY_SCHEDULER_H
+#define STRATEGY_SCHEDULER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Sched/DynSched.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// forward declaration of the abstract base class for scheduler strategies
+class ACE_Scheduler_Strategy;
+
+/////////////////////////////////
+// Strategized scheduler class //
+/////////////////////////////////
+
+class TAO_RTSched_Export ACE_Strategy_Scheduler : public ACE_DynScheduler
+ // = TITLE
+ // ACE_Strategy_Scheduler
+ //
+ // = DESCRIPTION
+ // Strategized scheduler implementation. Provides an implementation
+ // of all strategy specific scheduling mechanisms, which relies on the
+ // methods of the associated strategy class.
+{
+// public interface
+public:
+
+ ACE_Strategy_Scheduler (ACE_Scheduler_Strategy &strategy);
+ // = Constructor.
+
+ virtual ~ACE_Strategy_Scheduler ();
+ // = Virtual destructor.
+
+ status_t assign_priorities (
+ Dispatch_Entry **dispatches, u_int count,
+ ACE_Unbounded_Set<RtecScheduler::Scheduling_Anomaly *> &anomaly_set);
+ // = Assigns priorities to the sorted dispatch schedule,
+ // according to the strategy's priority comparison operator.
+
+ status_t assign_subpriorities (
+ Dispatch_Entry **dispatches, u_int count,
+ ACE_Unbounded_Set<RtecScheduler::Scheduling_Anomaly *> &anomaly_set);
+ // = Assigns dynamic and static sub-priorities to the sorted dispatch
+ // schedule, according to the strategy's subpriority comparisons.
+
+ virtual Preemption_Priority minimum_critical_priority ();
+ // = Determine the minimum critical priority number.
+
+private:
+
+ virtual status_t schedule_timeline_entry (Dispatch_Entry &dispatch_entry,
+ ACE_Unbounded_Queue <Dispatch_Entry *>
+ &reschedule_queue);
+ // = Schedules a dispatch entry into the timeline being created.
+
+ virtual status_t sort_dispatches (Dispatch_Entry **dispatches, u_int count);
+ // = Sets up the schedule in the order generated by the strategy.
+
+ ACE_Scheduler_Strategy &strategy_;
+ // = Strategy for comparing and sorting dispatch entries.
+
+ ACE_Strategy_Scheduler (const ACE_Strategy_Scheduler &);
+ ACE_Strategy_Scheduler &operator= (const ACE_Strategy_Scheduler &);
+};
+
+
+
+////////////////////////////////////////
+// Factory for strategized schedulers //
+////////////////////////////////////////
+
+template <class STRATEGY>
+class ACE_Strategy_Scheduler_Factory
+ // = TITLE
+ // ACE_Strategy_Scheduler_Factory
+ //
+ // = DESCRIPTION
+ // Provides a type parameterized factory method that constructs
+ // and returns a scheduler that uses the given scheduling strategy
+{
+public:
+
+ static ACE_Strategy_Scheduler * create (RtecScheduler::Preemption_Priority_t minimum_critical_priority);
+ // = Constructs and returns a scheduler strategized with
+ // an instance of the the parameterized strategy type.
+};
+
+
+//////////////////////////
+// Scheduler Strategies //
+//////////////////////////
+
+class TAO_RTSched_Export ACE_Scheduler_Strategy
+ // = TITLE
+ // ACE_Scheduler_Strategy
+ //
+ // = DESCRIPTION
+ // Abstract Base Class for scheduling strategies: each derived class
+ // must define an ordering strategy for dispatch entries based on a
+ // specific scheduling algorithm.
+{
+public:
+
+ ACE_Scheduler_Strategy (ACE_DynScheduler::Preemption_Priority minimum_critical_priority = 0);
+ // = Constructor.
+
+ /// Destructor.
+ virtual ~ACE_Scheduler_Strategy (void);
+
+ virtual int priority_comp (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry) = 0;
+ // = Compares two dispatch entries in strategy specific high to low
+ // priority ordering: returns -1 if the first Dispatch_Entry is greater
+ // in the order, 0 if they are equivalent, or 1 if the second
+ // Dispatch_Entry is greater in the order.
+
+ virtual void sort (Dispatch_Entry **dispatch_entries,
+ u_int count) = 0;
+ // = Sorts the dispatch entry link pointer array according to
+ // the specific sort order defined by the strategy.
+
+ virtual ACE_DynScheduler::Preemption_Priority minimum_critical_priority ();
+ // = Determines the minimum critical priority number.
+
+ virtual int dynamic_subpriority_comp (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry) = 0;
+ // = Compares two dispatch entries in strategy specific high to low
+ // dynamic subpriority ordering: returns -1 if the first Dispatch_Entry
+ // is greater in the order, 0 if they are equivalent, or 1 if the
+ // second Dispatch_Entry is greater in the order.
+
+ virtual long dynamic_subpriority (Dispatch_Entry &entry,
+ RtecScheduler::Time current_time) = 0;
+ // = Returns a dynamic subpriority value
+ // for the given timeline entry at the current time.
+
+ virtual int static_subpriority_comp (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry);
+ // = Provides a lowest level ordering based first on importance
+ // (descending), and then on the dependency topological sort finishing
+ // time (ascending).
+
+ virtual ACE_DynScheduler::Dispatching_Type
+ dispatch_type (const Dispatch_Entry &entry) = 0;
+ // = Provide the dispatching queue type for the given dispatch entry.
+
+protected:
+
+ int sort_comp (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry);
+ // = Compares two dispatch entries using the specific priority, dynamic
+ // subpriority, and static subpriority method definitions provided by
+ // the derived strategy class to produce the strategy specific sort
+ // ordering: returns -1 if the first Dispatch_Entry is greater in the
+ // order, 0 if they are equivalent, or 1 if the second Dispatch_Entry is
+ // greater in the order. This is an example of the Template Method
+ // pattern (and also of Pree's Unification Metapattern), in which
+ // derived classes provide definitions of the methods on which the
+ // sort_comp Template Method relies.
+
+ ACE_DynScheduler::Preemption_Priority minimum_critical_priority_;
+ // = The minimum critical priority number for the strategy.
+};
+
+
+
+class TAO_RTSched_Export ACE_MUF_Scheduler_Strategy : public ACE_Scheduler_Strategy
+ // = TITLE
+ // ACE_MUF_Scheduler_Strategy
+ //
+ // = DESCRIPTION
+ // Defines "schedule" method using Maximum Urgency First
+ // scheduling algorithm.
+{
+public:
+
+ ACE_MUF_Scheduler_Strategy (ACE_DynScheduler::Preemption_Priority minimum_critical_priority = 0);
+ // = Constructor.
+
+ virtual ~ACE_MUF_Scheduler_Strategy ();
+ // = Virtual destructor.
+
+ static ACE_MUF_Scheduler_Strategy *instance ();
+ // = Returns an instance of the strategy.
+
+ virtual int priority_comp (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry);
+ // = Compares two dispatch entries by maximum criticality: returns -1 if
+ // the first Dispatch_Entry is greater in the order, 0 if they're
+ // equivalent, or 1 if the second Dispatch_Entry is greater in the order.
+
+ virtual void sort (Dispatch_Entry **dispatch_entries,
+ u_int count);
+ // = Sorts the dispatch entry link pointer array
+ // in descending urgency order.
+
+ virtual ACE_DynScheduler::Preemption_Priority minimum_critical_priority ();
+ // = Determines the minimum critical priority number.
+
+ virtual ACE_DynScheduler::Dispatching_Type
+ dispatch_type (const Dispatch_Entry &entry);
+ // = Provides the dispatching queue type for the given dispatch entry.
+
+protected:
+
+ virtual long dynamic_subpriority (Dispatch_Entry &entry,
+ RtecScheduler::Time current_time);
+ // = Returns a dynamic subpriority value at the current time for
+ // the given timeline entry: if the operation has
+ // non-negative laxity, then the value is positive, and a lower
+ // laxity gives a higher dynamic subpriority; if the operation
+ // has negative laxity, the value is the (negative) laxity value.
+
+ virtual int dynamic_subpriority_comp (
+ const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry);
+ // = Orders two dispatch entries by ascending laxity: returns -1 if the
+ // first Dispatch_Entry is greater in the order, 0 if they're equivalent,
+ // 1 if the second Dispatch_Entry is greater in the order.
+
+private:
+
+ // = Comparison function to pass to qsort: calls instance ()->sort_comp ().
+#if defined (ACE_HAS_WINCE)
+ static int _cdecl sort_function (void *arg1, void *arg2);
+#else
+ static int sort_function (void *arg1, void *arg2);
+#endif // ACE_HAS_WINCE
+
+ static ACE_MUF_Scheduler_Strategy *instance_;
+ // Instance of the strategy.
+};
+
+
+class TAO_RTSched_Export ACE_RMS_Scheduler_Strategy : public ACE_Scheduler_Strategy
+ // = TITLE
+ // ACE_RMS_Scheduler_Strategy
+ //
+ // = DESCRIPTION
+ // Defines "schedule" method using Rate Monotonic
+ // Scheduling algorithm.
+{
+public:
+
+ ACE_RMS_Scheduler_Strategy (ACE_DynScheduler::Preemption_Priority minimum_critical_priority = 0);
+ // = Constructor.
+
+ virtual ~ACE_RMS_Scheduler_Strategy ();
+ // = Virtual destructor.
+
+ static ACE_RMS_Scheduler_Strategy *instance ();
+ // Returns an instance of the strategy.
+
+ virtual int priority_comp (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry);
+ // = Compares two dispatch entries by minimum period: returns -1 if the
+ // first Dispatch_Entry is greater in the order, 0 if they're equivalent,
+ // or 1 if the second Dispatch_Entry is greater in the order.
+
+ virtual void sort (Dispatch_Entry **dispatch_entries,
+ u_int count);
+ // = Sorts the dispatch entry link pointer array in
+ // descending RMS (rate) order.
+
+ virtual ACE_DynScheduler::Preemption_Priority minimum_critical_priority ();
+ // = Determine the minimum critical priority number.
+
+ virtual ACE_DynScheduler::Dispatching_Type
+ dispatch_type (const Dispatch_Entry &entry);
+ // = Provide the dispatching queue type for the given dispatch entry.
+
+protected:
+
+ virtual long dynamic_subpriority (Dispatch_Entry &entry,
+ RtecScheduler::Time current_time);
+ // = Just returns 0: all operations have
+ // the same dynamic subpriority value.
+
+ virtual int dynamic_subpriority_comp
+ (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry);
+ // = All dispatches in a given priority level have the same dynamic
+ // subpriority under RMS: just returns 0.
+
+private:
+
+ static int sort_function (void *arg1, void *arg2);
+ // = Comparison function to pass to qsort: calls instance ()->sort_comp ().
+
+ static ACE_RMS_Scheduler_Strategy *instance_;
+ // = Instance of the strategy.
+
+};
+
+
+
+class TAO_RTSched_Export ACE_MLF_Scheduler_Strategy : public ACE_Scheduler_Strategy
+ // = TITLE
+ // ACE_MLF_Scheduler_Strategy
+ //
+ // = DESCRIPTION
+ // Defines "schedule" method using Minimum Laxity First
+ // scheduling algorithm.
+{
+public:
+
+ ACE_MLF_Scheduler_Strategy (ACE_DynScheduler::Preemption_Priority minimum_critical_priority = 0);
+ // = Constructor.
+
+ virtual ~ACE_MLF_Scheduler_Strategy ();
+ // = Virtual destructor.
+
+ static ACE_MLF_Scheduler_Strategy *instance ();
+ // = Returns an instance of the strategy.
+
+ virtual int priority_comp (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry);
+ // = Just returns 0, as all dispatch entries are of equivalent
+ // static priority under MLF.
+
+ virtual void sort (Dispatch_Entry **dispatch_entries,
+ u_int count);
+ // = Sorts the dispatch entry link pointer array in ascending laxity order.
+
+ virtual ACE_DynScheduler::Dispatching_Type
+ dispatch_type (const Dispatch_Entry &entry);
+ // = Provide the dispatching queue type for the given dispatch entry.
+
+protected:
+
+ virtual long dynamic_subpriority (Dispatch_Entry &entry,
+ RtecScheduler::Time current_time);
+ // = Returns a dynamic subpriority value at the current time for
+ // the given timeline entry: if the operation has
+ // non-negative laxity, then the value is positive, and a lower
+ // laxity gives a higher dynamic subpriority; if the operation
+ // has negative laxity, the value is the (negative) laxity value.
+
+ virtual int dynamic_subpriority_comp
+ (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry);
+ // = Orders two dispatch entries by ascending laxity: returns -1 if the
+ // first Dispatch_Entry is greater in the order, 0 if they're equivalent,
+ // or 1 if the second Dispatch_Entry is greater in the order.
+
+private:
+
+ static int sort_function (void *arg1, void *arg2);
+ // = Comparison function to pass to qsort: calls instance ()->sort_comp ().
+
+ static ACE_MLF_Scheduler_Strategy *instance_;
+ // = Instance of the strategy
+
+};
+
+
+class TAO_RTSched_Export ACE_EDF_Scheduler_Strategy : public ACE_Scheduler_Strategy
+ // = TITLE
+ // ACE_EDF_Scheduler_Strategy
+ //
+ // = DESCRIPTION
+ // Defines "schedule" method using Earliest Deadline First
+ // scheduling algorithm.
+{
+public:
+
+ ACE_EDF_Scheduler_Strategy (ACE_DynScheduler::Preemption_Priority minimum_critical_priority = 0);
+ // = Default constructor.
+
+ virtual ~ACE_EDF_Scheduler_Strategy ();
+ // = Virtual destructor.
+
+ static ACE_EDF_Scheduler_Strategy *instance ();
+ // = Returns an instance of the strategy.
+
+ virtual int priority_comp (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry);
+ // = Returns 0, as all dispatch entries are of equivalent
+ // priority under EDF.
+
+ virtual void sort (Dispatch_Entry **dispatch_entries,
+ u_int count);
+ // = Sorts the dispatch entry link pointer array
+ // in ascending deadline (period) order.
+
+ virtual ACE_DynScheduler::Dispatching_Type
+ dispatch_type (const Dispatch_Entry &entry);
+ // = Provide the dispatching queue type for the given dispatch entry.
+
+protected:
+
+ virtual long dynamic_subpriority (Dispatch_Entry &entry,
+ RtecScheduler::Time current_time);
+ // = Returns a dynamic subpriority value at the current time for the
+ // given timeline entry: if the operation has non-negative
+ // time to deadline, then value is positive, and a shorter time to
+ // deadline gives a higher dynamic subpriority; if the operation has a
+ // negative time to deadline, the value is (negative) time to deadline.
+
+
+ virtual int dynamic_subpriority_comp
+ (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry);
+ // = Orders two dispatch entries by ascending time to deadline: returns -1
+ // if the first Dispatch_Entry is greater in the order, 0 if they're
+ // equivalent, or 1 if the second Dispatch_Entry is greater in the order.
+
+private:
+
+ static int sort_function (void *arg1, void *arg2);
+ // = Comparison function to pass to qsort: calls instance ()->sort_comp ().
+
+ static ACE_EDF_Scheduler_Strategy *instance_;
+ // = Instance of the strategy.
+
+};
+
+
+class TAO_RTSched_Export ACE_Criticality_Scheduler_Strategy : public ACE_Scheduler_Strategy
+ // = TITLE
+ // ACE_Criticality_Scheduler_Strategy
+ //
+ // = DESCRIPTION
+ // Defines "schedule" method using a simple mapping directly from
+ // operation criticality to static priority.
+{
+public:
+
+ ACE_Criticality_Scheduler_Strategy (ACE_DynScheduler::Preemption_Priority minimum_critical_priority = 0);
+ // = Constructor.
+
+ virtual ~ACE_Criticality_Scheduler_Strategy ();
+ // = Virtual destructor.
+
+ static ACE_Criticality_Scheduler_Strategy *instance ();
+ // = Returns an instance of the strategy.
+
+ virtual int priority_comp (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry);
+ // = Compares two dispatch entries by minimum period: returns -1 if the
+ // first Dispatch_Entry is greater in the order, 0 if they're equivalent,
+ // or 1 if the second Dispatch_Entry is greater in the order.
+
+ virtual void sort (Dispatch_Entry **dispatch_entries,
+ u_int count);
+ // = Sort the dispatch entry link pointer array in descending
+ // criticality order.
+
+ virtual ACE_DynScheduler::Preemption_Priority minimum_critical_priority ();
+ // = Determine the minimum critical priority number.
+
+ virtual ACE_DynScheduler::Dispatching_Type
+ dispatch_type (const Dispatch_Entry &entry);
+ // Provide the dispatching queue type for the given dispatch entry.
+
+protected:
+
+ virtual long dynamic_subpriority (Dispatch_Entry &entry,
+ RtecScheduler::Time current_time);
+ // = Just returns 0: all operations have
+ // the same dynamic subpriority value.
+
+ virtual int dynamic_subpriority_comp
+ (const Dispatch_Entry &first_entry,
+ const Dispatch_Entry &second_entry);
+ // = All dispatches in a given priority level have the same dynamic
+ // subpriority under this strategy: just returns 0.
+
+private:
+
+ static int sort_function (void *arg1, void *arg2);
+ // = Comparison function to pass to qsort: calls instance ()->sort_comp ().
+
+ static ACE_Criticality_Scheduler_Strategy *instance_;
+ // = Instance of the strategy.
+
+};
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* STRATEGY_SCHEDULER_H */
+
+// EOF
diff --git a/TAO/orbsvcs/orbsvcs/Sched/sched_export.h b/TAO/orbsvcs/orbsvcs/Sched/sched_export.h
new file mode 100644
index 00000000000..422a13eed9a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Sched/sched_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_RTSCHED_EXPORT_H
+#define TAO_RTSCHED_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_RTSCHED_HAS_DLL)
+# define TAO_RTSCHED_HAS_DLL 0
+# endif /* ! TAO_RTSCHED_HAS_DLL */
+#else
+# if !defined (TAO_RTSCHED_HAS_DLL)
+# define TAO_RTSCHED_HAS_DLL 1
+# endif /* ! TAO_RTSCHED_HAS_DLL */
+#endif
+
+#if defined (TAO_RTSCHED_HAS_DLL) && (TAO_RTSCHED_HAS_DLL == 1)
+# if defined (TAO_RTSCHED_BUILD_DLL)
+# define TAO_RTSched_Export ACE_Proper_Export_Flag
+# define TAO_RTSCHED_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTSCHED_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RTSCHED_BUILD_DLL */
+# define TAO_RTSched_Export ACE_Proper_Import_Flag
+# define TAO_RTSCHED_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTSCHED_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RTSCHED_BUILD_DLL */
+#else /* TAO_RTSCHED_HAS_DLL == 1 */
+# define TAO_RTSched_Export
+# define TAO_RTSCHED_SINGLETON_DECLARATION(T)
+# define TAO_RTSCHED_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RTSCHED_HAS_DLL == 1 */
+
+#endif /* TAO_RTSCHED_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp
new file mode 100644
index 00000000000..44ebd3e82b3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp
@@ -0,0 +1,795 @@
+// $Id$
+
+#include "ace/OS.h"
+#include "ace/Singleton.h"
+#include "ace/Null_Mutex.h"
+
+#include "orbsvcs/Runtime_Scheduler.h"
+#include "orbsvcs/Sched/Reconfig_Scheduler.h"
+#include "orbsvcs/Sched/Reconfig_Sched_Utils.h"
+#include "orbsvcs/Scheduler_Factory.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Scheduler_Factory.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(orbsvcs,
+ Scheduler_Factory,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Initialize static class members.
+RtecScheduler::Scheduler_ptr ACE_Scheduler_Factory::server_ = 0;
+ACE_Scheduler_Factory::Factory_Status ACE_Scheduler_Factory::status_ =
+ ACE_Scheduler_Factory::UNINITIALIZED;
+
+
+RtecScheduler::Period_t ACE_Scheduler_Factory::period_default_ = 0;
+RtecScheduler::Threads_t ACE_Scheduler_Factory::threads_default_ = 0;
+RtecScheduler::Importance_t ACE_Scheduler_Factory::importance_default_ = RtecScheduler::MEDIUM_IMPORTANCE;
+RtecScheduler::Criticality_t ACE_Scheduler_Factory::criticality_default_ = RtecScheduler::HIGH_CRITICALITY;
+RtecScheduler::RT_Info_Enabled_Type_t ACE_Scheduler_Factory::rt_info_enable_state_default_ = RtecScheduler::RT_INFO_NON_VOLATILE;
+
+RtecScheduler::Period_t ACE_Scheduler_Factory::period_default()
+{
+ return period_default_;
+}
+
+RtecScheduler::Threads_t ACE_Scheduler_Factory::threads_default()
+{
+ return threads_default_;
+}
+
+RtecScheduler::Importance_t ACE_Scheduler_Factory::importance_default()
+{
+ return importance_default_;
+}
+
+RtecScheduler::Criticality_t ACE_Scheduler_Factory::criticality_default()
+{
+ return criticality_default_;
+}
+
+void ACE_Scheduler_Factory::period_default(RtecScheduler::Period_t period_default)
+{
+ period_default_ = period_default;
+}
+
+void ACE_Scheduler_Factory::threads_default(RtecScheduler::Threads_t threads_default)
+{
+ threads_default_ = threads_default;
+}
+
+void ACE_Scheduler_Factory::importance_default(RtecScheduler::Importance_t importance_default)
+{
+ importance_default_ = importance_default;
+}
+
+void ACE_Scheduler_Factory::criticality_default(RtecScheduler::Criticality_t criticality_default)
+{
+ criticality_default_ = criticality_default;
+}
+
+RtecScheduler::RT_Info_Enabled_Type_t ACE_Scheduler_Factory::rt_info_enable_state_default()
+{
+ return rt_info_enable_state_default_;
+}
+
+void ACE_Scheduler_Factory::rt_info_enable_state_default(RtecScheduler::RT_Info_Enabled_Type_t rt_info_enable_state_default)
+{
+ rt_info_enable_state_default_ = rt_info_enable_state_default;
+}
+
+// This symbols are extern because the automatic template
+// instantiation mechanism in SunCC gets confused otherwise.
+int TAO_SF_config_count = -1;
+ACE_Scheduler_Factory::POD_Config_Info* TAO_SF_config_info = 0;
+int TAO_SF_entry_count = -1;
+ACE_Scheduler_Factory::POD_RT_Info* TAO_SF_rt_info = 0;
+int TAO_SF_dependency_count = -1;
+ACE_Scheduler_Factory::POD_Dependency_Info* TAO_SF_dep_info = 0;
+
+struct ACE_Scheduler_Factory_Data
+{
+ // = TITLE
+ // Helper struct, to encapsulate the singleton static server and
+ // ACE_TSS objects. We can't use ACE_Singleton directly, because
+ // construction of ACE_Runtime_Scheduler takes arguments.
+
+/* WSOA merge - commented out
+ ACE_Runtime_Scheduler scheduler_;
+ // The static runtime scheduler.
+*/
+
+ TAO_Reconfig_Scheduler<TAO_MUF_FAIR_Reconfig_Sched_Strategy, ACE_SYNCH_MUTEX> scheduler_;
+ // The scheduler.
+
+ ACE_TSS<ACE_TSS_Type_Adapter<RtecScheduler::Preemption_Priority_t> >
+ preemption_priority_;
+ // The dispatch queue number of the calling thread. For access by
+ // applications; must be set by either the application or Event
+ // Channel.
+
+ ACE_Scheduler_Factory_Data (void)
+ : scheduler_ (TAO_SF_config_count,
+ TAO_SF_config_info,
+ TAO_SF_entry_count,
+ TAO_SF_rt_info,
+ TAO_SF_dependency_count,
+ TAO_SF_dep_info,
+ 0),
+ preemption_priority_ ()
+ {
+ }
+};
+
+static ACE_Scheduler_Factory_Data *ace_scheduler_factory_data = 0;
+
+int ACE_Scheduler_Factory::use_runtime (int cc,
+ POD_Config_Info cfgi[],
+ int ec,
+ POD_RT_Info rti[])
+{
+ if (server_ != 0 || TAO_SF_entry_count != -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("ACE_Scheduler_Factory::use_runtime - ")
+ ACE_TEXT("server already configured\n")),
+ -1);
+ TAO_SF_config_count = cc;
+ TAO_SF_config_info = cfgi;
+ TAO_SF_entry_count = ec;
+ TAO_SF_rt_info = rti;
+ status_ = ACE_Scheduler_Factory::RUNTIME;
+
+ return 0;
+}
+
+static RtecScheduler::Scheduler_ptr
+static_server (void)
+{
+ RtecScheduler::Scheduler_ptr server_ = 0;
+
+ // This isn't thread safe, but the static instance that it replaces
+ // wasn't thread safe either. Hola, Sr. Sandiego :-) If it needs to
+ // be made thread safe, it should be protected using double-checked
+ // locking.
+ if (! ace_scheduler_factory_data &&
+ (ace_scheduler_factory_data =
+ ACE_Singleton<ACE_Scheduler_Factory_Data,
+ ACE_Null_Mutex>::instance ()) == 0)
+ return 0;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ server_ = ace_scheduler_factory_data->scheduler_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("ACE_Scheduler_Factory - configured static server\n")));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT("ACE_Scheduler_Factory::config_runtime - ")
+ ACE_TEXT("cannot allocate server\n"));
+ }
+ ACE_ENDTRY;
+
+ return server_;
+}
+
+int
+ACE_Scheduler_Factory::use_config (CosNaming::NamingContext_ptr naming)
+{
+ return ACE_Scheduler_Factory::use_config (naming,
+ "ScheduleService");
+}
+
+int
+ACE_Scheduler_Factory::use_config (CosNaming::NamingContext_ptr naming,
+ const char* name)
+{
+ if (server_ != 0 || TAO_SF_entry_count != -1)
+ // No errors, runtime execution simply takes precedence over
+ // config runs.
+ return 0;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosNaming::Name schedule_name (1);
+ schedule_name.length (1);
+ schedule_name[0].id = CORBA::string_dup (name);
+ CORBA::Object_var objref =
+ naming->resolve (schedule_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ server_ =
+ RtecScheduler::Scheduler::_narrow(objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ server_ = 0;
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT("ACE_Scheduler_Factory::use_config - ")
+ ACE_TEXT(" exception while resolving server\n"));
+ }
+ ACE_ENDTRY;
+
+ status_ = ACE_Scheduler_Factory::CONFIG;
+ return 0;
+}
+
+int
+ACE_Scheduler_Factory::server (RtecScheduler::Scheduler_ptr sptr)
+{
+ if (server_ != 0 || TAO_SF_entry_count != -1)
+ return -1;
+
+ server_ = RtecScheduler::Scheduler::_duplicate (sptr);
+ return 0;
+}
+
+RtecScheduler::Scheduler_ptr
+ACE_Scheduler_Factory::server (void)
+{
+ if (server_ == 0 && TAO_SF_entry_count != -1)
+ server_ = static_server ();
+
+ if (server_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("ACE_Scheduler_Factor::server - ")
+ ACE_TEXT("no scheduling service configured\n")),
+ 0);
+ return server_;
+}
+
+static char header[] =
+"// $Id $\n\n"
+"// This file was automatically generated by the Scheduler_Factory.\n"
+"// Before editing the file please consider generating it again.\n"
+"\n"
+"#include \"orbsvcs/Scheduler_Factory.h\"\n"
+"\n";
+
+static char footer[] =
+"\n"
+"// This sets up Scheduler_Factory to use the runtime version.\n"
+"int scheduler_factory_setup = \n"
+" ACE_Scheduler_Factory::use_runtime (configs_size, configs, infos_size, infos);\n"
+"\n"
+"// EOF\n";
+
+static char start_anomalies_found[] =
+"\n// The following scheduling anomalies were detected:\n";
+
+static char start_anomalies_none[] =
+"\n// There were no scheduling anomalies.\n";
+
+static char start_infos[] =
+"\n\nstatic ACE_Scheduler_Factory::POD_RT_Info infos[] = {\n";
+
+static char end_infos[] =
+"};\n\n"
+"static int infos_size = sizeof(infos)/sizeof(infos[0]);\n\n";
+
+static char end_infos_empty[] =
+"};\n\n"
+"static int infos_size = 0;\n\n";
+
+static char start_dependencies[] =
+"\n\nstatic ACE_Scheduler_Factory::POD_Dependency_Info dependencies[] = {\n";
+
+static char end_dependencies[] =
+"};\n\n"
+"static int dependencies_size = sizeof(dependencies)/sizeof(dependencies[0]);\n\n";
+
+static char end_dependencies_empty[] =
+"};\n\n"
+"static int dependencies_size = 0;\n\n";
+
+static char start_configs[] =
+"\nstatic ACE_Scheduler_Factory::POD_Config_Info configs[] = {\n";
+
+static char end_configs[] =
+"};\n\n"
+"static int configs_size = sizeof(configs)/sizeof(configs[0]);\n\n";
+
+static char end_configs_empty[] =
+"};\n\n"
+"static int configs_size = 0;\n\n";
+
+int ACE_Scheduler_Factory::dump_schedule
+ (const RtecScheduler::RT_Info_Set& infos,
+ const RtecScheduler::Dependency_Set& dependencies,
+ const RtecScheduler::Config_Info_Set& configs,
+ const RtecScheduler::Scheduling_Anomaly_Set& anomalies,
+ const char* file_name,
+ const char* rt_info_format,
+ const char* dependency_format,
+ const char* config_info_format,
+ int dump_disabled_infos,
+ int dump_disabled_dependencies)
+{
+ u_int i;
+ char entry_point [BUFSIZ];
+
+ // Default format for printing RT_Info output.
+ if (rt_info_format == 0)
+ rt_info_format = "{%20s, /* entry_point */\n"
+ "%10d, /* handle */\n"
+ "%10d, /* worst_case_execution_time */,\n"
+ "%10d, /* typical_execution_time */,\n"
+ "%10d, /* cached_execution_time */,\n"
+ "%10d, /* period */\n"
+ "(RtecScheduler::Criticality_t) %d, /* [ VL_C = 0, L_C = 1, M_C = 2, H_C = 3, VH_C = 4] */\n"
+ "(RtecScheduler::Importance_t) %d, /* [ VL_I = 0, L_I = 1, M_I = 2, H_I = 3, VH_I = 4] */\n"
+ "%10d, /* quantum */\n"
+ "%10d, /* threads */\n"
+ "%10d, /* priority */\n"
+ "%10d, /* preemption_subpriority */\n"
+ "%10d, /* preemption_priority */\n"
+ "(RtecScheduler::Info_Type_t) %d, /* [OPERATION = 0, CONJUNCTION = 1, DISJUNCTION = 2, REMOTE_DEPENDANT = 3] */\n"
+ "(RtecScheduler::RT_Info_Enabled_Type_t) %d } /* [RT_INFO_DISABLED = 0, RT_INFO_ENABLED = 1, RT_INFO_NON_VOLATILE = 2] */\n";
+
+
+ // Default format for printing dependency output.
+ if (dependency_format == 0)
+ dependency_format = " { (RtecScheduler::Dependency_Type_t) %d, %10d, "
+ "%10d, %10d,"
+ "(RtecScheduler::Dependency_Enabled_Type_t) %d }";
+
+ // Default format for printing Config_Info output.
+ if (config_info_format == 0)
+ config_info_format = " { %10d, %10d, "
+ "(RtecScheduler::Dispatching_Type_t) %d }";
+
+ FILE* file = stdout;
+ if (file_name != 0)
+ {
+ file = ACE_OS::fopen (ACE_TEXT_CHAR_TO_TCHAR(file_name), ACE_TEXT("w"));
+ if (file == 0)
+ return -1;
+ }
+ ACE_OS::fprintf (file, header);
+
+ // Indicate anomalies encountered during scheduling.
+
+ ACE_OS::fprintf(file, (anomalies.length () > 0
+ ? start_anomalies_found
+ : start_anomalies_none));
+
+ for (i = 0; i < anomalies.length (); ++i)
+ {
+ const RtecScheduler::Scheduling_Anomaly& anomaly = anomalies[i];
+ switch (anomaly.severity)
+ {
+ case RtecScheduler::ANOMALY_FATAL:
+ ACE_OS::fprintf(file, "FATAL: ");
+ break;
+
+ case RtecScheduler::ANOMALY_ERROR:
+ ACE_OS::fprintf(file, "ERROR: ");
+ break;
+
+ case RtecScheduler::ANOMALY_WARNING:
+ ACE_OS::fprintf(file, "// WARNING: ");
+ break;
+
+ default:
+ ACE_OS::fprintf(file, "// UNKNOWN: ");
+ break;
+ }
+
+ ACE_OS::fprintf (file,
+ "%s\n",
+ (const char *) anomaly.description);
+ }
+
+ // Print out banner indicating which infos are dumped.
+ if (dump_disabled_infos)
+ {
+ ACE_OS::fprintf (file, "\n// Both enabled and disabled RT_Infos were dumped to this file.\n\n");
+ }
+ else
+ {
+ ACE_OS::fprintf (file, "\n// Only enabled RT_Infos were dumped to this file.\n\n");
+ }
+
+ // Print out operation QoS info.
+ ACE_OS::fprintf (file, start_infos);
+
+ for (i = 0;
+ i < infos.length ();
+ ++i)
+ {
+ const RtecScheduler::RT_Info& info = infos[i];
+
+ if (dump_disabled_infos
+ || info.enabled == RtecScheduler::RT_INFO_ENABLED
+ || info.enabled == RtecScheduler::RT_INFO_NON_VOLATILE)
+ {
+ if (i != 0)
+ // Finish previous line.
+ ACE_OS::fprintf(file, ",\n");
+
+ const RtecScheduler::RT_Info& info = infos[i];
+
+ // Put quotes around the entry point name, exactly as it is stored.
+ ACE_OS::sprintf (entry_point,
+ "\"%s\"",
+ (const char *) info.entry_point);
+
+ // @@ TODO Eventually the TimeT structure will be a 64-bit
+ // unsigned int, we will have to change this dump method then.
+ ACE_OS::fprintf (file,
+ rt_info_format,
+ entry_point,
+ info.handle,
+ ACE_CU64_TO_CU32 (info.worst_case_execution_time),
+ ACE_CU64_TO_CU32 (info.typical_execution_time),
+ ACE_CU64_TO_CU32 (info.cached_execution_time),
+ info.period,
+ info.criticality,
+ info.importance,
+ ACE_CU64_TO_CU32 (info.quantum),
+ info.threads,
+ info.priority,
+ info.preemption_subpriority,
+ info.preemption_priority,
+ info.info_type,
+ info.enabled);
+ }
+ }
+
+ // Finish last line.
+ ACE_OS::fprintf(file, "\n");
+
+ if (infos.length () > 0)
+ ACE_OS::fprintf (file, end_infos);
+ else
+ ACE_OS::fprintf (file, end_infos_empty);
+
+ // Print out banner indicating which dependencies are dumped.
+ if (dump_disabled_dependencies)
+ {
+ ACE_OS::fprintf (file, "\n// Both enabled and disabled dependencies were dumped to this file.\n\n");
+ }
+ else
+ {
+ ACE_OS::fprintf (file, "\n// Only enabled dependencies were dumped to this file.\n\n");
+ }
+
+ // Print out operation dependency info.
+ ACE_OS::fprintf (file, start_dependencies);
+
+ for (i = 0;
+ i < dependencies.length ();
+ ++i)
+ {
+ const RtecScheduler::Dependency_Info& dep = dependencies[i];
+
+ if (dump_disabled_infos
+ || dep.enabled == RtecBase::DEPENDENCY_ENABLED
+ || dep.enabled == RtecBase::DEPENDENCY_NON_VOLATILE)
+ {
+ // Finish previous line.
+ if (i != 0)
+ {
+ ACE_OS::fprintf (file, ",\n");
+ }
+
+ ACE_OS::fprintf (file,
+ dependency_format,
+ dep.dependency_type,
+ dep.number_of_calls,
+ dep.rt_info,
+ dep.rt_info_depended_on,
+ dep.enabled);
+ }
+ }
+
+ // Finish last line.
+ ACE_OS::fprintf (file, "\n");
+
+ if (dependencies.length () > 0)
+ ACE_OS::fprintf (file, end_dependencies);
+ else
+ ACE_OS::fprintf (file, end_dependencies_empty);
+
+
+ // Print out queue configuration info.
+ ACE_OS::fprintf (file, start_configs);
+
+ for (i = 0;
+ i < configs.length ();
+ ++i)
+ {
+ if (i != 0)
+ // Finish previous line.
+ ACE_OS::fprintf (file, ",\n");
+
+ const RtecScheduler::Config_Info& config = configs[i];
+ ACE_OS::fprintf (file,
+ config_info_format,
+ config.preemption_priority,
+ config.thread_priority,
+ config.dispatching_type);
+ }
+
+ // Finish last line.
+ ACE_OS::fprintf (file, "\n");
+
+ if (configs.length () > 0)
+ ACE_OS::fprintf (file, end_configs);
+ else
+ ACE_OS::fprintf (file, end_configs_empty);
+
+ ACE_OS::fprintf (file, footer);
+ ACE_OS::fclose (file);
+ return 0;
+}
+
+void ACE_Scheduler_Factory::log_scheduling_entry(TAO_Reconfig_Scheduler_Entry * entry, FILE* file)
+{
+
+ if( entry == 0 )
+ {
+ ACE_OS::fprintf (file, "Entry is NULL");
+ return;
+ }
+
+ // Print out the actual rt_info data
+ const char* rt_info_format = "{%20s, /* entry_point */\n"
+ "%10d, /* handle */\n"
+ "%10d, /* period */\n"
+ "%10d, /* criticality */\n"
+ "%10d, /* threads */\n"
+ "%10d, /* priority */\n"
+ "%10d, /* preemption_subpriority */\n"
+ "%10d, /* preemption_priority */\n"
+ "%10d /* enabled */\n";
+
+ TAO_RT_Info_Ex* actual_info = entry->actual_rt_info();
+
+ ACE_OS::fprintf (file,
+ rt_info_format,
+ actual_info->entry_point.in(),
+ actual_info->handle,
+ actual_info->period,
+ actual_info->criticality,
+ actual_info->threads,
+ actual_info->priority,
+ actual_info->preemption_subpriority,
+ actual_info->preemption_priority,
+ actual_info->enabled);
+
+
+ // Print out the current admitted tuple
+ const char* admitted_tuple_format = " {"
+ "%13d, /* handle */\n"
+ "%13d, /* rate_index */\n"
+ "%13d, /* period */\n"
+ "%13d, /* criticality */\n"
+ "%13d, /* priority */\n"
+ "%13d, /* preemption_subpriority */\n"
+ "%13d, /* preemption_priority */\n"
+ "%13d } /* enabled */\n";
+
+ TAO_RT_Info_Tuple* current_admitted_tuple = entry->current_admitted_tuple();
+
+ ACE_OS::fprintf(file, "\n Current admitted Tuple:\n");
+ if( current_admitted_tuple == 0 )
+ {
+ ACE_OS::fprintf (file, " =>NONE_ADMITTED\n");
+ }
+ else
+ {
+ ACE_OS::fprintf (file,
+ admitted_tuple_format,
+ current_admitted_tuple->handle,
+ current_admitted_tuple->rate_index,
+ current_admitted_tuple->period,
+ current_admitted_tuple->criticality,
+ current_admitted_tuple->priority,
+ current_admitted_tuple->preemption_subpriority,
+ current_admitted_tuple->preemption_priority,
+ current_admitted_tuple->enabled);
+ }
+
+ // Print out the orig_tuple_subset_
+ ACE_OS::fprintf(file, "\n Original Tuple Subset\n {\n");
+ log_tuple_subset(entry->orig_tuple_subset(), file);
+ ACE_OS::fprintf(file, "\n }");
+
+ // Print out the prop_tuple_subset_
+ ACE_OS::fprintf(file, "\n Propagated Tuple Subset\n {\n");
+ log_tuple_subset(entry->prop_tuple_subset(), file);
+ ACE_OS::fprintf(file, "\n }\n}");
+
+
+}
+
+void ACE_Scheduler_Factory::log_tuple_subset(TUPLE_SET & tuple_subset,
+ FILE* file)
+{
+ TAO_RT_Info_Tuple **tuple_ptr_ptr;
+ const char* subset_tuple_format = " {\n"
+ "%13d, /* handle */\n"
+ "%13d, /* rate_index */\n"
+ "%13d, /* period */\n"
+ "%13d, /* criticality */\n"
+ "%13d, /* threads */\n"
+ "%13d, /* priority */\n"
+ "%13d, /* preemption_subpriority */\n"
+ "%13d, /* preemption_priority */\n"
+ "%13d } /* enabled */\n";
+
+ TUPLE_SET_ITERATOR
+ tuple_iter (tuple_subset);
+
+
+ while (tuple_iter.done () == 0)
+ {
+ // Get a pointer to the tuple COPY under the iterator.
+ if (tuple_iter.next (tuple_ptr_ptr) == 0
+ || tuple_ptr_ptr == 0 || ((*tuple_ptr_ptr) == 0) )
+ {
+ ACE_OS::fprintf (file, "{ NULL TUPLE POINTER }\n");
+ }
+ else
+ {
+
+ ACE_OS::fprintf (file,
+ subset_tuple_format,
+ (*tuple_ptr_ptr)->handle,
+ (*tuple_ptr_ptr)->rate_index,
+ (*tuple_ptr_ptr)->period,
+ (*tuple_ptr_ptr)->criticality,
+ (*tuple_ptr_ptr)->threads,
+ (*tuple_ptr_ptr)->priority,
+ (*tuple_ptr_ptr)->preemption_subpriority,
+ (*tuple_ptr_ptr)->preemption_priority,
+ (*tuple_ptr_ptr)->enabled);
+ }
+
+ tuple_iter.advance ();
+ }
+}
+
+int
+ACE_Scheduler_Factory::log_scheduling_entries(TAO_Reconfig_Scheduler_Entry ** entry_ptr_array,
+ long entry_ptr_array_size,
+ const char* file_name)
+{
+ // Open the file
+ FILE* file = stdout;
+ if (file_name != 0)
+ {
+ file = ACE_OS::fopen (file_name, ACE_TEXT ("w"));
+ if (file == 0)
+ return -1;
+ }
+
+
+ // Iterate through the array. The index is the (handle - 1) of the rt_info in the array
+ for(int index = 0; index < entry_ptr_array_size; ++index)
+ {
+ ACE_OS::fprintf(file, "\n\nScheduler Entry Array contents\n");
+ TAO_Reconfig_Scheduler_Entry * entry = entry_ptr_array[index];
+
+ log_scheduling_entry(entry, file);
+
+
+ }
+
+
+ ACE_OS::fclose (file);
+ return 0;
+
+}
+
+void
+ACE_Scheduler_Factory::log_scheduling_tuples(
+ TAO_RT_Info_Tuple ** tuple_ptr_array,
+ long tuple_ptr_array_size,
+ const char* file_name)
+{
+ // Open the file
+ FILE* file = stdout;
+ if (file_name != 0)
+ {
+ file = ACE_OS::fopen (file_name, ACE_TEXT ("w"));
+ if (file == 0)
+ return;
+ }
+
+ static const char subset_tuple_format[] =
+ " {\n"
+ "%13d, /* handle */\n"
+ "%13lu, /* rate_index */\n"
+ "%13d, /* period */\n"
+ "%13d, /* criticality */\n"
+ "%13d, /* priority */\n"
+ "%13d, /* preemption_subpriority */\n"
+ "%13d, /* preemption_priority */\n"
+ "%13d } /* enabled */\n";
+
+ for (int ndx = 0; ndx < tuple_ptr_array_size; ndx++)
+ {
+ fprintf(file,
+ subset_tuple_format,
+ tuple_ptr_array[ndx]->handle,
+ tuple_ptr_array[ndx]->rate_index,
+ tuple_ptr_array[ndx]->period,
+ tuple_ptr_array[ndx]->criticality,
+ tuple_ptr_array[ndx]->priority,
+ tuple_ptr_array[ndx]->preemption_subpriority,
+ tuple_ptr_array[ndx]->preemption_priority,
+ tuple_ptr_array[ndx]->enabled);
+ }
+
+ ACE_OS::fclose (file);
+}
+#if defined (HPUX) && !defined (__GNUG__)
+ // aCC can't handle RtecScheduler::Preemption_Priority_t used as an operator
+ // name.
+ typedef CORBA::Long RtecScheduler_Preemption_Priority_t;
+#endif /* HPUX && !g++ */
+
+RtecScheduler::Preemption_Priority_t
+ACE_Scheduler_Factory::preemption_priority (void)
+{
+ // Return whatever we've got. The application or Event Channel is
+ // responsible for making sure that it was set.
+ if (ace_scheduler_factory_data->preemption_priority_.ts_object ())
+ {
+ ACE_TSS_Type_Adapter<RtecScheduler::Preemption_Priority_t> *tss =
+ ace_scheduler_factory_data->preemption_priority_;
+ // egcs 1.0.1 raises an internal compiler error if we implicitly
+ // call the type conversion operator. So, call it explicitly.
+#if defined (HPUX) && !defined (__GNUG__)
+ const RtecScheduler::Preemption_Priority_t preemption_priority =
+ static_cast<RtecScheduler::Preemption_Priority_t> (tss->operator RtecScheduler_Preemption_Priority_t ());
+#else
+ const RtecScheduler::Preemption_Priority_t preemption_priority =
+ static_cast<RtecScheduler::Preemption_Priority_t> (tss->operator RtecScheduler::Preemption_Priority_t ());
+#endif /* HPUX && !g++ */
+ return preemption_priority;
+ }
+ else
+ return static_cast<RtecScheduler::Preemption_Priority_t> (-1);
+}
+
+void
+ACE_Scheduler_Factory::set_preemption_priority
+ (const RtecScheduler::Preemption_Priority_t preemption_priority)
+{
+ // Probably don't need this, because it should be safe to assume
+ // that static_server () was called before this function. But just
+ // in case . . .
+ if (!ace_scheduler_factory_data
+ && (ace_scheduler_factory_data =
+ ACE_Singleton<ACE_Scheduler_Factory_Data,
+ ACE_Null_Mutex>::instance ()) == 0)
+ return;
+
+ ace_scheduler_factory_data->preemption_priority_->
+#if defined (HPUX) && !defined (__GNUG__)
+ // aCC can't handle the typedef.
+ operator RtecScheduler_Preemption_Priority_t & () = preemption_priority;
+#else
+ operator RtecScheduler::Preemption_Priority_t & () = preemption_priority;
+#endif /* HPUX && !g++ */
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Singleton<ACE_Scheduler_Factory_Data, ACE_Null_Mutex> *ACE_Singleton<ACE_Scheduler_Factory_Data, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Scheduler_Factory.h b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.h
new file mode 100644
index 00000000000..f0b9fdf91ab
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.h
@@ -0,0 +1,280 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Scheduler_Factory.h
+//
+// = AUTHOR
+// Chris Gill <cdgill@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef ACE_SCHEDULER_FACTORY_H
+#define ACE_SCHEDULER_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "ace/Containers_T.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/RtecSchedulerC.h"
+#include "orbsvcs/Sched/sched_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Reconfig_Scheduler_Entry;
+struct TAO_RT_Info_Tuple;
+typedef ACE_Ordered_MultiSet<TAO_RT_Info_Tuple *> TUPLE_SET;
+typedef ACE_Ordered_MultiSet_Iterator<TAO_RT_Info_Tuple *> TUPLE_SET_ITERATOR;
+
+class TAO_RTSched_Export ACE_Scheduler_Factory
+{
+ // = TITLE
+ // Factory of scheduler services.
+ //
+ // = DESCRIPTION
+ // This class acts as a factory for scheduler servers. At config
+ // time it will return a remote server, which will actually
+ // compute the scheduling parameters. At run-time it returns a
+ // local server, which will use the results of the config runs to
+ // actually do the scheduling, without incurring in RPC overheads.
+public:
+ enum Factory_Status
+ {
+ // = TITLE
+ // Factory Status
+ //
+ // = DESCRIPTION
+ // This type enumerates the possible states of the factory:
+ // uninitialized, or in a configuration, runtime, or
+ // reconfigurable mode of operation.
+
+ UNINITIALIZED,
+ CONFIG,
+ RECONFIG,
+ RUNTIME
+ };
+
+ struct POD_RT_Info
+ {
+ // = TITLE
+ // Plain Old Data for RT_Infos.
+ //
+ // = DESCRIPTION
+ // This class provide us with a plain old data version of
+ // RT_Info, this is useful for implementing arrays of
+ // those.
+
+ const char *entry_point;
+ RtecScheduler::handle_t handle;
+ RtecScheduler::Time worst_case_execution_time;
+ RtecScheduler::Time typical_execution_time;
+ RtecScheduler::Time cached_execution_time;
+ RtecScheduler::Period_t period;
+ CORBA::Long criticality;
+ CORBA::Long importance;
+ RtecScheduler::Quantum_t quantum;
+ RtecScheduler::Threads_t threads;
+ RtecScheduler::OS_Priority priority;
+ RtecScheduler::Preemption_Subpriority_t static_subpriority;
+ RtecScheduler::Preemption_Priority_t preemption_priority;
+ CORBA::Long info_type;
+ RtecScheduler::RT_Info_Enabled_Type_t enabled;
+
+ };
+
+
+ struct POD_Dependency_Info
+ {
+ // = TITLE
+ // Plain Old Data for RT_Info Dependencies.
+ //
+ // = DESCRIPTION
+ // This class provide us with a plain old data version of
+ // dependencies between RT_Infos. This is useful for implementing
+ // arrays of those.
+
+ RtecScheduler::Dependency_Type_t dependency_type;
+ CORBA::Long number_of_calls;
+ RtecScheduler::handle_t info_that_depends;
+ RtecScheduler::handle_t info_depended_on;
+ RtecScheduler::Dependency_Enabled_Type_t enabled;
+ };
+
+ struct POD_Config_Info
+ {
+ // = TITLE
+ // Plain Old Data for dispatch queue configuration information.
+ //
+ // = DESCRIPTION
+ // This class provide us with a plain old data version of
+ // configuration info, which is useful for implementing static arrays
+ // NOTE: if used in an array, the run-time scheduler requires that the
+ // array index match the preemption priority stored in the config info
+ // at that index: this is used to detect uninitialized/corrupted schedules
+ RtecScheduler::Preemption_Priority_t preemption_priority;
+ RtecScheduler::OS_Priority thread_priority;
+ RtecScheduler::Dispatching_Type_t dispatching_type;
+ };
+
+ struct POD_Scheduling_Anomaly
+ {
+ // = TITLE
+ // Plain Old Data for scheduling anomaly information.
+ //
+ // = DESCRIPTION
+ // This class provide us with a plain old data version of
+ // scheduling anomalies, which is used to generate error
+ // and warning lines in the runtime scheduling header output.
+
+ const char* description;
+ RtecScheduler::Anomaly_Severity severity;
+ };
+
+ static int use_config (CosNaming::NamingContext_ptr naming);
+ // Setup the variables needed for a config run, using the
+ // NamingContext to locate a Scheduler.
+
+ static int use_config (CosNaming::NamingContext_ptr naming,
+ const char* name);
+ // Setup the variables needed for a config run, using the
+ // NamingContext to locate a Scheduler.
+
+ static int use_runtime (int cc,
+ POD_Config_Info cfgi[],
+ int ec,
+ POD_RT_Info rti[]);
+ // Disable config runs in the Factory and sets up the precomputed
+ // scheduling information.
+
+ static int server (RtecScheduler::Scheduler_ptr);
+ static RtecScheduler::Scheduler_ptr server (void);
+ // Return the Real-time Scheduling Service used for this run.
+ // Must have been configured either using use_context() or use_data().
+ //
+ // Normally use_data() is called at static elaboration time, so
+ // everything is automatic. On config runs use_context() is called
+ // from main, after resolve_initial_references.
+
+ static int dump_schedule (const RtecScheduler::RT_Info_Set& infos,
+ const RtecScheduler::Dependency_Set& dependencies,
+ const RtecScheduler::Config_Info_Set& configs,
+ const RtecScheduler::Scheduling_Anomaly_Set& anomalies,
+ const char* file_name = 0,
+ const char* rt_info_format = 0,
+ const char* dependency_format = 0,
+ const char* config_info_format = 0,
+ int dump_disabled_infos = 0,
+ int dump_disabled_dependencies = 0);
+ // This helper function will dump the schedule returned by a
+ // RtecScheduler::Scheduler into a file, the file can be compiled to
+ // create an efficient local implementation of the Scheduler.
+
+ // TODO: How to do cleanup()? Use the ACE_Object_Manager stuff?
+
+ static void log_scheduling_entry(TAO_Reconfig_Scheduler_Entry * entry,
+ FILE* file);
+ // This helper function prints out a single scheduling entry contents
+
+ static int log_scheduling_entries(TAO_Reconfig_Scheduler_Entry ** entry_ptr_array,
+ long entry_ptr_array_size,
+ const char* file_name);
+ // This helper function prints out the intermediate scheduling entries
+
+ static void log_scheduling_tuples(TAO_RT_Info_Tuple ** tuple_ptr_array,
+ long tuple_ptr_array_size,
+ const char* file_name);
+ // This helper function prints out the arry used to create scheduling entries
+ // sorted in topological order then priority order
+
+ static void log_tuple_subset(TUPLE_SET & tuple_subset,
+ FILE* file);
+
+ static Factory_Status status (void);
+ // This helper function allows the application to determine whether
+ // the factory is uninitialized, or in a config or runtime mode of
+ // operation.
+
+ // = Access the (OS independent) preemption priority of the calling thread.
+ static RtecScheduler::Preemption_Priority_t preemption_priority ();
+ // Returns (u_int) -1 if the preemption priority hadn't been set.
+
+ // = Set the (OS independent) preemption priority of the calling thread.
+ static void set_preemption_priority
+ (const RtecScheduler::Preemption_Priority_t);
+ // The application or Event Channel is responsible for making sure
+ // that the preemption priority is set before any access of the
+ // preemption priority.
+
+ // Accessor for obtaining the default period (Boeing Extension)
+ static RtecScheduler::Period_t period_default();
+ // Method for setting the default period (Boeing Extension)
+ static void period_default(RtecScheduler::Period_t period_default);
+
+ // Accessor for obtaining the default threads (Boeing Extension)
+ static RtecScheduler::Threads_t threads_default();
+ // Method for setting the default threads (Boeing Extension)
+ static void threads_default(RtecScheduler::Threads_t threads_default);
+
+ // Accessor for obtaining the default importance (VERY_LOW_IMPORTANCE to VERY_HIGH_IMPORTANCE). (Boeing Extension)
+ static RtecScheduler::Importance_t importance_default();
+ // Method for setting the default importance (VERY_LOW_IMPORTANCE to VERY_HIGH_IMPORTANCE). (Boeing Extension)
+ static void importance_default(RtecScheduler::Importance_t importance_default);
+
+ // Accessor for obtaining the default criticality (VERY_LOW_CRITICALITY to VERY_HIGH_CRITICALITY). (Boeing Extension)
+ static RtecScheduler::Criticality_t criticality_default();
+ // Method for setting the default criticality (VERY_LOW_CRITICALITY to VERY_HIGH_CRITICALITY). (Boeing Extension)
+ static void criticality_default(RtecScheduler::Criticality_t criticality_default);
+
+ // Accessor for obtaining the default rt_info enabled state. (RT_INFO_DISABLED, RT_INFO_ENABLED, or RT_INFO_NON_VOLATILE)
+ static RtecScheduler::RT_Info_Enabled_Type_t rt_info_enable_state_default();
+
+ // Method for setting the default rt_info enabled state. (RT_INFO_DISABLED, RT_INFO_ENABLED, or RT_INFO_NON_VOLATILE)
+ static void rt_info_enable_state_default(RtecScheduler::RT_Info_Enabled_Type_t rt_info_enable_state_default);
+
+protected:
+
+ static int no_config_run (void);
+ // By default this factory assumes we are runnning a config
+ // run. Calling this method disables that. Since the methods
+ // returns an int it can be used to initialize a static variable,
+ // hence calling it before main(); this technique can be used in the
+ // code emitted for the run-time scheduler, automagically disabling
+ // the config_run() when that code is linked in.
+
+private:
+ static RtecScheduler::Scheduler_ptr server_;
+
+ static Factory_Status status_;
+ // Default period configuration. (Boeing Extension)
+ static RtecScheduler::Period_t period_default_;
+ // Default threads configuration. (Boeing Extension)
+ static RtecScheduler::Threads_t threads_default_;
+
+ // Default importance configuration. (Boeing Extension)
+ static RtecScheduler::Importance_t importance_default_;
+ // Default criticality. (Boeing Extension)
+ static RtecScheduler::Criticality_t criticality_default_;
+
+ // Default rt_info enabled state. (Boeing Extension)
+ static RtecScheduler::RT_Info_Enabled_Type_t rt_info_enable_state_default_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Scheduler_Factory.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_SCHEDULER_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Scheduler_Factory.i b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.i
new file mode 100644
index 00000000000..2c01870582f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.i
@@ -0,0 +1,21 @@
+// -*- C++ -*-
+
+// ============================================================================
+//
+// $Id$
+//
+// ============================================================================
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// This helper function allows the application to determine whether
+// the factory is uninitialized, or in a config or runtime mode of
+// operation.
+
+ACE_INLINE ACE_Scheduler_Factory::Factory_Status
+ACE_Scheduler_Factory::status (void)
+{
+ return status_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Scheduler_Utilities.cpp b/TAO/orbsvcs/orbsvcs/Scheduler_Utilities.cpp
new file mode 100644
index 00000000000..b2454e5155f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Scheduler_Utilities.cpp
@@ -0,0 +1,12 @@
+// $Id$
+
+#include "orbsvcs/Scheduler_Utilities.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "orbsvcs/Scheduler_Utilities.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (orbsvcs,
+ Scheduler_Utilities,
+ "$Id$")
+
diff --git a/TAO/orbsvcs/orbsvcs/Scheduler_Utilities.h b/TAO/orbsvcs/orbsvcs/Scheduler_Utilities.h
new file mode 100644
index 00000000000..6c39123b4f9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Scheduler_Utilities.h
@@ -0,0 +1,68 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Scheduler_Utilities.h
+//
+// = AUTHOR
+// Chris Gill <cdgill@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef ACE_SCHEDULER_UTILITIES_H
+#define ACE_SCHEDULER_UTILITIES_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecSchedulerC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Sched/sched_export.h"
+
+class TAO_RTSched_Export ACE_RT_Info : public RtecScheduler::RT_Info
+{
+ // = TITLE
+ // Offers a convenient C++ interface to the IDL RT_Info structure.
+ //
+ // = DESCRIPTION
+ // For performance reasons the RT_Info data is represented as an
+ // IDL structure, this permits sending complete RT_Info's from the
+ // client to the server. Unfortunately this precludes the usage
+ // of member functions and constructors, this class serves as a
+ // helper to implement those without loosing the performance on
+ // IDL.
+public:
+
+ /// Construct a helper class instance from values for
+ /// the fields of the IDL struct it wraps.
+ ACE_RT_Info (const char* entry_point,
+ RtecScheduler::Time worst_time,
+ RtecScheduler::Time typical_time,
+ RtecScheduler::Time cached_time,
+ RtecScheduler::Period_t period,
+ RtecScheduler::Importance_t importance,
+ RtecScheduler::Quantum_t quantum,
+ CORBA::Long threads);
+
+ /// Construct a helper class instance from the IDL struct it wraps.
+ ACE_RT_Info (const RtecScheduler::RT_Info& rt_info);
+
+ /// Add a dependency of one RT_Info upon another.
+ int add_dependency(RtecScheduler::handle_t dep,
+ int number_of_calls = 1);
+
+};
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Scheduler_Utilities.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_SCHEDULER_UTILITIES_H */
diff --git a/TAO/orbsvcs/orbsvcs/Scheduler_Utilities.i b/TAO/orbsvcs/orbsvcs/Scheduler_Utilities.i
new file mode 100644
index 00000000000..ede4dc7780d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Scheduler_Utilities.i
@@ -0,0 +1,40 @@
+// ============================================================================
+//
+// $Id$
+//
+// ============================================================================
+
+
+// Construct a helper class instance from values for
+// the fields of the IDL struct it wraps.
+
+ACE_INLINE
+ACE_RT_Info::ACE_RT_Info (const char* entry_point_,
+ RtecScheduler::Time worst_time_,
+ RtecScheduler::Time typical_time_,
+ RtecScheduler::Time cached_time_,
+ RtecScheduler::Period_t period_,
+ RtecScheduler::Importance_t importance_,
+ RtecScheduler::Quantum_t quantum_,
+ CORBA::Long threads_)
+{
+ // Cannot use the initialization list, as these are members of the wrapped base
+ // class. This wrapper class must assign them in the constructor body.
+ this->entry_point = entry_point_;
+ this->worst_case_execution_time = worst_time_;
+ this->typical_execution_time = typical_time_;
+ this->cached_execution_time = cached_time_;
+ this->period = period_;
+ this->importance = importance_;
+ this->quantum = quantum_;
+ this->threads = threads_;
+}
+
+
+// Construct a helper class instance from the IDL struct it wraps.
+
+ACE_INLINE
+ACE_RT_Info::ACE_RT_Info (const RtecScheduler::RT_Info& rt_info)
+ : RtecScheduler::RT_Info (rt_info)
+{
+}
diff --git a/TAO/orbsvcs/orbsvcs/Security.idl b/TAO/orbsvcs/orbsvcs/Security.idl
new file mode 100644
index 00000000000..836462ec784
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security.idl
@@ -0,0 +1,358 @@
+// -*- IDL -*-
+//
+// $Id$
+
+
+#ifndef _SECURITY_IDL_
+#define _SECURITY_IDL_
+
+#include "tao/TimeBase.pidl"
+#include <orb.idl>
+
+#pragma prefix "omg.org"
+
+module Security {
+
+#pragma version Security 1.8
+
+ typedef string SecurityName;
+ typedef sequence<octet> Opaque;
+
+ // Constant declarations for Security Service Options
+ const CORBA::ServiceOption SecurityLevel1 = 1;
+ const CORBA::ServiceOption SecurityLevel2 = 2;
+ const CORBA::ServiceOption NonRepudiation = 3;
+ const CORBA::ServiceOption SecurityORBServiceReady = 4;
+ const CORBA::ServiceOption SecurityServiceReady = 5;
+ const CORBA::ServiceOption ReplaceORBServices = 6;
+ const CORBA::ServiceOption ReplaceSecurityServices = 7;
+ const CORBA::ServiceOption StandardSecureInteroperability = 8;
+ const CORBA::ServiceOption DCESecureInteroperability = 9;
+
+ // Service options for Common Secure Interoperability
+ const CORBA::ServiceOption CommonInteroperabilityLevel0 = 10;
+ const CORBA::ServiceOption CommonInteroperabilityLevel1 = 11;
+ const CORBA::ServiceOption CommonInteroperabilityLevel2 = 12;
+
+ // Security mech types supported for secure association
+ const CORBA::ServiceDetailType SecurityMechanismType = 1;
+
+ // privilege types supported in standard access policy
+ const CORBA::ServiceDetailType SecurityAttribute = 2;
+
+ // extensible families for standard data types
+ struct ExtensibleFamily {
+ unsigned short family_definer;
+ unsigned short family;
+ };
+
+ typedef sequence<octet> OID;
+
+ typedef sequence<OID> OIDList;
+
+ // security attributes
+ typedef unsigned long SecurityAttributeType;
+
+ // other attributes; family = 0
+
+ const SecurityAttributeType AuditId = 1;
+ const SecurityAttributeType AccountingId = 2;
+ const SecurityAttributeType NonRepudiationId = 3;
+
+ // privilege attributes; family = 1
+
+ const SecurityAttributeType _Public = 1;
+ const SecurityAttributeType AccessId = 2;
+ const SecurityAttributeType PrimaryGroupId = 3;
+ const SecurityAttributeType GroupId = 4;
+ const SecurityAttributeType Role = 5;
+ const SecurityAttributeType AttributeSet = 6;
+ const SecurityAttributeType Clearance = 7;
+ const SecurityAttributeType Capability = 8;
+
+ struct AttributeType {
+ ExtensibleFamily attribute_family;
+ SecurityAttributeType attribute_type;
+ };
+
+ typedef sequence<AttributeType> AttributeTypeList;
+
+ struct SecAttribute {
+ AttributeType attribute_type;
+ OID defining_authority;
+ Opaque value;
+ // the value of this attribute can be
+ // decoded only with knowledge of defining authority
+ };
+
+ typedef sequence <SecAttribute> AttributeList;
+
+ // Authentication return status
+ enum AuthenticationStatus {
+ SecAuthSuccess,
+ SecAuthFailure,
+ SecAuthContinue,
+ SecAuthExpired
+ };
+
+ // Association return status
+ enum AssociationStatus {
+ SecAssocSuccess,
+ SecAssocFailure,
+ SecAssocContinue
+ };
+
+ // Authentication method
+ typedef unsigned long AuthenticationMethod;
+
+ typedef sequence<AuthenticationMethod> AuthenticationMethodList;
+
+ // Credential types
+
+ enum InvocationCredentialsType {
+ SecOwnCredentials,
+ SecReceivedCredentials,
+ SecTargetCredentials
+ };
+
+ // Declarations related to Rights
+
+ struct Right {
+ ExtensibleFamily rights_family;
+ string the_right;
+ };
+
+ typedef sequence <Right> RightsList;
+
+ enum RightsCombinator {
+ SecAllRights,
+ SecAnyRight
+ };
+
+ // Delegation related
+
+ enum DelegationState {
+ SecInitiator,
+ SecDelegate
+ };
+
+ enum DelegationDirective {
+ Delegate,
+ NoDelegate
+ };
+
+ // pick up from TimeBase
+
+ typedef TimeBase::UtcT UtcT;
+ typedef TimeBase::IntervalT IntervalT;
+ typedef TimeBase::TimeT TimeT;
+
+ // Security features available on credentials.
+
+ enum SecurityFeature {
+ SecNoDelegation,
+ SecSimpleDelegation,
+ SecCompositeDelegation,
+ SecNoProtection,
+ SecIntegrity,
+ SecConfidentiality,
+ SecIntegrityAndConfidentiality,
+ SecDetectReplay,
+ SecDetectMisordering,
+ SecEstablishTrustInTarget,
+ SecEstablishTrustInClient
+ };
+
+ // Quality of protection which can be specified
+ // for an object reference and used to protect messages
+ enum QOP {
+ SecQOPNoProtection,
+ SecQOPIntegrity,
+ SecQOPConfidentiality,
+ SecQOPIntegrityAndConfidentiality
+ };
+
+ // Type of SecurityContext
+ enum SecurityContextType {
+ SecClientSecurityContext,
+ SecServerSecurityContext
+ };
+
+ // Operational State of a Security Context
+ enum SecurityContextState {
+ SecContextInitialized,
+ SecContextContinued,
+ SecContextClientEstablished,
+ SecContextEstablished,
+ SecContextEstablishExpired,
+ SecContextExpired,
+ SecContextInvalid
+ };
+
+ struct ChannelBindings {
+ unsigned long initiator_addrtype;
+ CORBA::OctetSeq initiator_address;
+ unsigned long acceptor_addrtype;
+ CORBA::OctetSeq acceptor_address;
+ CORBA::OctetSeq application_data;
+ };
+
+ // For use with SecurityReplaceable
+ struct OpaqueBuffer {
+ Opaque buffer;
+ unsigned long startpos;
+ unsigned long endpos;
+ // startpos <= endpos
+ // OpaqueBuffer is said to be empty if startpos == endpos
+ };
+
+ // Association options which can be administered
+ // on secure invocation policy and used to
+ // initialize security context
+ typedef unsigned short AssociationOptions;
+
+ const AssociationOptions NoProtection = 1;
+ const AssociationOptions Integrity = 2;
+ const AssociationOptions Confidentiality = 4;
+ const AssociationOptions DetectReplay = 8;
+ const AssociationOptions DetectMisordering = 16;
+ const AssociationOptions EstablishTrustInTarget = 32;
+ const AssociationOptions EstablishTrustInClient = 64;
+ const AssociationOptions NoDelegation = 128;
+ const AssociationOptions SimpleDelegation = 256;
+ const AssociationOptions CompositeDelegation = 512;
+
+ // Flag to indicate whether association options being
+ // administered are the "required" or "supported" set
+ enum RequiresSupports {
+ SecRequires,
+ SecSupports
+ };
+
+ // Direction of communication for which
+ // secure invocation policy applies
+ enum CommunicationDirection {
+ SecDirectionBoth,
+ SecDirectionRequest,
+ SecDirectionReply
+ };
+
+ // security association mechanism type
+ typedef string MechanismType;
+ typedef sequence<MechanismType> MechanismTypeList;
+
+ // AssociationOptions-Direction pair
+ struct OptionsDirectionPair {
+ AssociationOptions options;
+ CommunicationDirection direction;
+ };
+
+ typedef sequence <OptionsDirectionPair> OptionsDirectionPairList;
+
+ // Delegation mode which can be administered
+ enum DelegationMode {
+ SecDelModeNoDelegation, // i.e. use own credentials
+ SecDelModeSimpleDelegation, // delegate received credentials
+ SecDelModeCompositeDelegation // delegate both
+ };
+
+ // Association options supported by a given mech type
+ struct MechandOptions {
+ MechanismType mechanism_type;
+ AssociationOptions options_supported;
+ };
+
+ typedef sequence <MechandOptions> MechandOptionsList;
+
+ // Attribute of the SecurityLevel2::EstablishTrustPolicy
+ struct EstablishTrust {
+ boolean trust_in_client;
+ boolean trust_in_target;
+ };
+
+ // Audit
+ typedef unsigned long AuditChannelId;
+ typedef unsigned short _EventType;
+
+ const _EventType AuditAll = 0;
+ const _EventType AuditPrincipalAuth = 1;
+ const _EventType AuditSessionAuth = 2;
+ const _EventType AuditAuthorization = 3;
+ const _EventType AuditInvocation = 4;
+ const _EventType AuditSecEnvChange = 5;
+ const _EventType AuditPolicyChange = 6;
+ const _EventType AuditObjectCreation = 7;
+ const _EventType AuditObjectDestruction = 8;
+ const _EventType AuditNonRepudiation = 9;
+
+ enum DayOfTheWeek {
+ Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
+ };
+
+ enum AuditCombinator {
+ SecAllSelectors,
+ SecAnySelector
+ };
+
+ struct AuditEventType {
+ ExtensibleFamily event_family;
+ _EventType event_type;
+ };
+
+ typedef sequence <AuditEventType> AuditEventTypeList;
+
+ typedef unsigned long SelectorType;
+
+ const SelectorType InterfaceName = 1;
+ const SelectorType ObjectRef = 2;
+ const SelectorType Operation = 3;
+ const SelectorType Initiator = 4;
+ const SelectorType SuccessFailure = 5;
+ const SelectorType Time = 6;
+ const SelectorType DayOfWeek = 7;
+
+ // values defined for audit_needed and audit_write are:
+ // InterfaceName: CORBA::RepositoryId
+ // ObjectRef: object reference
+ // Operation: op_name
+ // Initiator: Credentials
+ // SuccessFailure: boolean
+ // Time: utc time on audit_write; time picked up from
+ // environment in audit_needed if required
+ // DayOfWeek: DayOfTheWeek
+
+ struct SelectorValue {
+ SelectorType selector;
+ any value;
+ };
+
+ typedef sequence <SelectorValue> SelectorValueList;
+
+ // Constant declaration for valid Security Policy Types
+
+ // General administrative policies
+ const CORBA::PolicyType SecClientInvocationAccess = 1;
+ const CORBA::PolicyType SecTargetInvocationAccess = 2;
+ const CORBA::PolicyType SecApplicationAccess = 3;
+ const CORBA::PolicyType SecClientInvocationAudit = 4;
+ const CORBA::PolicyType SecTargetInvocationAudit = 5;
+ const CORBA::PolicyType SecApplicationAudit = 6;
+ const CORBA::PolicyType SecDelegation = 7;
+ const CORBA::PolicyType SecClientSecureInvocation = 8;
+ const CORBA::PolicyType SecTargetSecureInvocation = 9;
+ const CORBA::PolicyType SecNonRepudiation = 10;
+
+
+ // Policies used to control attributes of a binding to a target
+ const CORBA::PolicyType SecMechanismsPolicy = 12;
+ const CORBA::PolicyType SecInvocationCredentialsPolicy = 13;
+ const CORBA::PolicyType SecFeaturePolicy = 14; // obsolete
+ const CORBA::PolicyType SecQOPPolicy = 15;
+
+ const CORBA::PolicyType SecDelegationDirectivePolicy = 38;
+ const CORBA::PolicyType SecEstablishTrustPolicy = 39;
+};
+
+#pragma prefix ""
+
+#endif /* _SECURITY_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/Security.mpc b/TAO/orbsvcs/orbsvcs/Security.mpc
new file mode 100644
index 00000000000..fb03dc6acc9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security.mpc
@@ -0,0 +1,42 @@
+// -*- MPC -*-
+// $Id$
+
+project(Security) : orbsvcslib, corba_messaging, core, portableserver, pi, interceptors, valuetype, tao_versioning_idl_defaults {
+ sharedname = TAO_Security
+ idlflags += -Wb,export_macro=TAO_Security_Export -Wb,export_include=orbsvcs/Security/security_export.h
+ dynamicflags = TAO_SECURITY_BUILD_DLL
+ tagchecks += Security
+
+ IDL_Files {
+ CSI.idl
+ CSIIOP.idl
+ GSSUP.idl
+ Security.idl
+ SecurityLevel1.idl
+ SecurityLevel2.idl
+ SecurityLevel3.idl
+ }
+
+ Source_Files(ORBSVCS_COMPONENTS) {
+ Security {
+ CSIC.cpp
+ CSIIOPC.cpp
+ GSSUPC.cpp
+ SecurityC.cpp
+ SecurityS.cpp
+ SecurityLevel1C.cpp
+ SecurityLevel1S.cpp
+ SecurityLevel2C.cpp
+ SecurityLevel2S.cpp
+ SecurityLevel3C.cpp
+ Security
+ }
+ }
+
+ Header_Files {
+ Security/security_export.h
+ }
+
+ Template_Files {
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/Security.rc b/TAO/orbsvcs/orbsvcs/Security.rc
new file mode 100644
index 00000000000..9138ebe5f3b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "Security\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_SecurityDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_Security.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/Security/CSI_Utils.cpp b/TAO/orbsvcs/orbsvcs/Security/CSI_Utils.cpp
new file mode 100644
index 00000000000..0e7c1a01478
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/CSI_Utils.cpp
@@ -0,0 +1,69 @@
+// $Id$
+
+#include "orbsvcs/Security/CSI_Utils.h"
+#include "orbsvcs/CSIC.h"
+
+#include "tao/CDR.h"
+
+#include "ace/OS_NS_string.h"
+
+
+ACE_RCSID (Security,
+ CSI_Utils,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void
+TAO::CSI_Utils::create_sas_service_context (
+ const CSI::SASContextBody & sas_context,
+ IOP::ServiceContext & sc)
+{
+ // Marshal CSI::SASContextBody union into an octet sequence suitable
+ // for placement in an IOP::ServiceContext.
+ // (TAO's compiled marshaling is used for performance reasons.)
+
+ TAO_OutputCDR cdr;
+ cdr << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER);
+
+ cdr << sas_context;
+
+ sc.context_id = IOP::SecurityAttributeService;
+
+ // TAO extension, replace the contents of the octet sequence with
+ // the CDR stream.
+ const CORBA::ULong len = cdr.total_length ();
+ sc.context_data.length (len);
+ CORBA::Octet * buf = sc.context_data.get_buffer ();
+ for (const ACE_Message_Block * i = cdr.begin ();
+ i != 0;
+ i = i->cont ())
+ {
+ ACE_OS::memcpy (buf, i->rd_ptr (), i->length ());
+ buf += i->length ();
+ }
+}
+
+bool
+TAO::CSI_Utils::extract_sas_service_context (
+ const IOP::ServiceContext & sc,
+ CSI::SASContextBody & sas_context)
+{
+ // Demarshal CSI::SASContextBody union from ServiceContext.
+ // (TAO's compiled marshaling is used for performance reasons.)
+
+ TAO_InputCDR cdr (reinterpret_cast<const char*> (
+ sc.context_data.get_buffer ()),
+ sc.context_data.length ());
+
+ ACE_CDR::Boolean byte_order;
+
+ if (!(cdr >> ACE_InputCDR::to_boolean (byte_order)))
+ return false;
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ return (cdr >> sas_context);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/CSI_Utils.h b/TAO/orbsvcs/orbsvcs/Security/CSI_Utils.h
new file mode 100644
index 00000000000..8f233dbfd97
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/CSI_Utils.h
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CSI_Utils.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_CSI_UTILS_H
+#define TAO_CSI_UTILS_H
+
+// No need to include "ace/pre.h" and "ace/post.h". This header and
+// the declared types/variables are not meant to be used outside TAO's
+// CSIv2 implementation.
+
+#include "tao/orbconf.h"
+#include "tao/Versioned_Namespace.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward declarations
+namespace IOP
+{
+ struct ServiceContext;
+}
+
+namespace CSI
+{
+ class SASContextBody;
+}
+
+namespace TAO
+{
+ namespace CSI_Utils
+ {
+ /// Populate given IOP::ServiceContext with given CSI::SASContextBody.
+ void create_sas_service_context (const CSI::SASContextBody & sas_context,
+ IOP::ServiceContext & sc);
+
+ /// Extract CSI::SASContextBody from given IOP::ServiceContext.
+ /**
+ * @return Success == true, Failure == false.
+ */
+ bool extract_sas_service_context (const IOP::ServiceContext & sc,
+ CSI::SASContextBody & sas_context);
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_CSI_UTILS_H */
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL2_EstablishTrustPolicy.cpp b/TAO/orbsvcs/orbsvcs/Security/SL2_EstablishTrustPolicy.cpp
new file mode 100644
index 00000000000..20216f4a905
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL2_EstablishTrustPolicy.cpp
@@ -0,0 +1,63 @@
+// -*- C++ -*-
+
+#include "orbsvcs/Security/SL2_EstablishTrustPolicy.h"
+
+#include "tao/ORB_Constants.h"
+
+
+ACE_RCSID (Security,
+ SL2_EstablishTrustPolicy,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::Security::EstablishTrustPolicy::EstablishTrustPolicy (
+ const ::Security::EstablishTrust &trust)
+ : trust_ (trust)
+{
+}
+
+TAO::Security::EstablishTrustPolicy::~EstablishTrustPolicy (void)
+{
+}
+
+CORBA::PolicyType
+TAO::Security::EstablishTrustPolicy::policy_type (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return ::Security::SecEstablishTrustPolicy;
+}
+
+CORBA::Policy_ptr
+TAO::Security::EstablishTrustPolicy::copy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO::Security::EstablishTrustPolicy *policy = 0;
+ ACE_NEW_THROW_EX (policy,
+ TAO::Security::EstablishTrustPolicy (this->trust_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return policy;
+}
+
+void
+TAO::Security::EstablishTrustPolicy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+::Security::EstablishTrust
+TAO::Security::EstablishTrustPolicy::trust (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->trust_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL2_EstablishTrustPolicy.h b/TAO/orbsvcs/orbsvcs/Security/SL2_EstablishTrustPolicy.h
new file mode 100644
index 00000000000..b7910c316d9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL2_EstablishTrustPolicy.h
@@ -0,0 +1,106 @@
+// -*- C++ -*-
+
+// ===================================================================
+/**
+ * @file SL2_EstablishTrustPolicy.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+// ===================================================================
+
+
+#ifndef TAO_ESTABLISH_TRUST_POLICY_H
+#define TAO_ESTABLISH_TRUST_POLICY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Security/security_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SecurityLevel2C.h"
+
+#include "tao/LocalObject.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace Security
+ {
+
+ /**
+ * @class EstablishTrustPolicy
+ *
+ * @brief Implementation of the
+ * SecurityLevel2::EstablishTrustPolicy.
+ *
+ * This policy can be used to enable or disable establishment of
+ * trust in the client or the target or both on a per-object
+ * basis. For example, it can be set as a policy override using
+ * the standard CORBA::Object::_set_policy_overrides() method.
+ @par
+ * This policy can be created by using the
+ * CORBA::ORB::create_policy() method by passing it the
+ * Security::SecEstablishTrustPolicy policy type, and the
+ *
+ * appropriate Security::EstablishTrust structure (inserted into a
+ * CORBA::Any).
+ */
+ class EstablishTrustPolicy
+ : public virtual SecurityLevel2::EstablishTrustPolicy,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+
+ /// Constructor
+ EstablishTrustPolicy (const ::Security::EstablishTrust &trust);
+
+ /**
+ * @name CORBA::Policy Methods
+ */
+ //@{
+ virtual CORBA::PolicyType policy_type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Policy_ptr copy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ /// Return the "establish trust" value associated with this
+ /// policy.
+ virtual ::Security::EstablishTrust trust (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management
+ * through the reference counting mechanism.
+ */
+ ~EstablishTrustPolicy (void);
+
+ private:
+
+ /// Quality of protection which can be specified for an object
+ /// reference and used to protect messages.
+ ::Security::EstablishTrust const trust_;
+
+ };
+
+ } // End Security namespace
+} // End TAO namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_ESTABLISH_TRUST_POLICY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL2_QOPPolicy.cpp b/TAO/orbsvcs/orbsvcs/Security/SL2_QOPPolicy.cpp
new file mode 100644
index 00000000000..9175ac608b0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL2_QOPPolicy.cpp
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+
+#include "orbsvcs/Security/SL2_QOPPolicy.h"
+
+#include "tao/ORB_Constants.h"
+
+
+ACE_RCSID (Security,
+ SL2_QOPPolicy,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::Security::QOPPolicy::QOPPolicy (::Security::QOP qop)
+ : qop_ (qop)
+{
+}
+
+TAO::Security::QOPPolicy::~QOPPolicy (void)
+{
+}
+
+CORBA::PolicyType
+TAO::Security::QOPPolicy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return ::Security::SecQOPPolicy;
+}
+
+CORBA::Policy_ptr
+TAO::Security::QOPPolicy::copy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO::Security::QOPPolicy * policy = 0;
+ ACE_NEW_THROW_EX (policy,
+ TAO::Security::QOPPolicy (this->qop_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return policy;
+}
+
+void
+TAO::Security::QOPPolicy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+Security::QOP
+TAO::Security::QOPPolicy::qop (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->qop_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL2_QOPPolicy.h b/TAO/orbsvcs/orbsvcs/Security/SL2_QOPPolicy.h
new file mode 100644
index 00000000000..ff8b99e2309
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL2_QOPPolicy.h
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+
+// ===================================================================
+/**
+ * @file SL2_QOPPolicy.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+// ===================================================================
+
+
+#ifndef TAO_SL2_QOP_POLICY_H
+#define TAO_SL2_QOP_POLICY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Security/security_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SecurityLevel2C.h"
+
+#include "tao/LocalObject.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace Security
+ {
+ /**
+ * @class QOPPolicy
+ *
+ * @brief Implementation of the SecurityLevel2::QOPPolicy
+ * interface.
+ *
+ * This policy can be used to affect the quality of protection
+ * (QoP) for invocation on a per-object basis. For example, it
+ * can be set as a policy override using the standard
+ * CORBA::Object::_set_policy_overrides() method.
+ * @par
+ * This policy can be created by using the
+ * CORBA::ORB::create_policy() method by passing it the
+ * Security::SecQOPPolicy policy type, and the appropriate
+ * Security::QOP enumeration (inserted into a CORBA::Any).
+ */
+ class QOPPolicy
+ : public virtual SecurityLevel2::QOPPolicy,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+
+ /// Constructor
+ QOPPolicy (::Security::QOP qop);
+
+ /**
+ * @name CORBA::Policy Methods
+ */
+ //@{
+ virtual CORBA::PolicyType policy_type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Policy_ptr copy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ /// Return the Quality-of-Protection value associated with this
+ /// policy.
+ virtual ::Security::QOP qop (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management
+ * through the reference counting mechansim.
+ */
+ ~QOPPolicy (void);
+
+ private:
+
+ /// Quality of protection which can be specified for an object
+ /// reference and used to protect messages.
+ ::Security::QOP const qop_;
+
+ };
+
+ } // End Security namespace
+} // End TAO namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SL2_QOP_POLICY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_ContextEstablishmentPolicy.cpp b/TAO/orbsvcs/orbsvcs/Security/SL3_ContextEstablishmentPolicy.cpp
new file mode 100644
index 00000000000..22b8d7ad961
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_ContextEstablishmentPolicy.cpp
@@ -0,0 +1,126 @@
+// $Id$
+
+#include "orbsvcs/Security/SL3_ContextEstablishmentPolicy.h"
+
+
+ACE_RCSID (Security,
+ SL3_ContextEstablishmentPolicy,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SL3::ContextEstablishmentPolicy::ContextEstablishmentPolicy (
+ SecurityLevel3::CredsDirective creds_directive,
+ const SecurityLevel3::OwnCredentialsList & creds_list,
+ SecurityLevel3::FeatureDirective use_client_auth,
+ SecurityLevel3::FeatureDirective use_target_auth,
+ SecurityLevel3::FeatureDirective use_confidentiality,
+ SecurityLevel3::FeatureDirective use_integrity)
+ : creds_directive_ (creds_directive),
+ creds_list_ (creds_list),
+ use_client_auth_ (use_client_auth),
+ use_target_auth_ (use_target_auth),
+ use_confidentiality_ (use_confidentiality),
+ use_integrity_ (use_integrity)
+{
+}
+
+TAO::SL3::ContextEstablishmentPolicy::~ContextEstablishmentPolicy (void)
+{
+}
+
+SecurityLevel3::CredsDirective
+TAO::SL3::ContextEstablishmentPolicy::creds_directive (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->creds_directive_;
+}
+
+SecurityLevel3::OwnCredentialsList *
+TAO::SL3::ContextEstablishmentPolicy::creds_list (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ SecurityLevel3::OwnCredentialsList * creds = 0;
+
+ ACE_NEW_THROW_EX (creds,
+ SecurityLevel3::OwnCredentialsList (this->creds_list_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (creds);
+
+ return creds;
+}
+
+SecurityLevel3::FeatureDirective
+TAO::SL3::ContextEstablishmentPolicy::use_client_auth (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->use_client_auth_;
+}
+
+SecurityLevel3::FeatureDirective
+TAO::SL3::ContextEstablishmentPolicy::use_target_auth (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->use_target_auth_;
+}
+
+SecurityLevel3::FeatureDirective
+TAO::SL3::ContextEstablishmentPolicy::use_confidentiality (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->use_confidentiality_;
+}
+
+SecurityLevel3::FeatureDirective
+TAO::SL3::ContextEstablishmentPolicy::use_integrity (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->use_integrity_;
+}
+
+CORBA::PolicyType
+TAO::SL3::ContextEstablishmentPolicy::policy_type (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return SecurityLevel3::ContextEstablishmentPolicyType;
+}
+
+CORBA::Policy_ptr
+TAO::SL3::ContextEstablishmentPolicy::copy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Policy_ptr p = CORBA::Policy::_nil ();
+ ACE_NEW_THROW_EX (p,
+ TAO::SL3::ContextEstablishmentPolicy (
+ this->creds_directive_,
+ this->creds_list_,
+ this->use_client_auth_,
+ this->use_target_auth_,
+ this->use_confidentiality_,
+ this->use_integrity_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (p);
+
+ return p;
+}
+
+void
+TAO::SL3::ContextEstablishmentPolicy::destroy (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->creds_directive_ = SecurityLevel3::CD_Default;
+ this->creds_list_.length (0);
+ this->use_client_auth_ = SecurityLevel3::FD_UseDefault;
+ this->use_target_auth_ = SecurityLevel3::FD_UseDefault;
+ this->use_confidentiality_ = SecurityLevel3::FD_UseDefault;
+ this->use_integrity_ = SecurityLevel3::FD_UseDefault;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_ContextEstablishmentPolicy.h b/TAO/orbsvcs/orbsvcs/Security/SL3_ContextEstablishmentPolicy.h
new file mode 100644
index 00000000000..266c1dd31f6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_ContextEstablishmentPolicy.h
@@ -0,0 +1,134 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SL3_ContextEstablishmentPolicy.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SL3_CONTEXT_ESTABLISHMENT_POLICY_H
+#define TAO_SL3_CONTEXT_ESTABLISHMENT_POLICY_H
+
+#include /**/ "ace/pre.h"
+#include "orbsvcs/Security/security_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SecurityLevel3C.h"
+
+#include "tao/LocalObject.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SL3
+ {
+ /**
+ * @class ContextEstablishmentPolicy
+ *
+ * @brief
+ *
+ *
+ */
+ class ContextEstablishmentPolicy
+ : public virtual SecurityLevel3::ContextEstablishmentPolicy,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+
+ /// Constructor
+ ContextEstablishmentPolicy (
+ SecurityLevel3::CredsDirective creds_directive,
+ const SecurityLevel3::OwnCredentialsList & creds_list,
+ SecurityLevel3::FeatureDirective use_client_auth,
+ SecurityLevel3::FeatureDirective use_target_auth,
+ SecurityLevel3::FeatureDirective use_confidentiality,
+ SecurityLevel3::FeatureDirective use_integrity);
+
+ /**
+ * @name SecurityLevel3::ContextEstablishmentPolicy Methods
+ *
+ * Methods required by the
+ * SecurityLevel3::ContextEstablishmentPolicy interface.
+ */
+ //@{
+ virtual SecurityLevel3::CredsDirective creds_directive (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::OwnCredentialsList * creds_list (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::FeatureDirective use_client_auth (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::FeatureDirective use_target_auth (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::FeatureDirective use_confidentiality (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::FeatureDirective use_integrity (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::PolicyType policy_type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Policy_ptr copy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management
+ * through the reference counting mechanism.
+ */
+ ~ContextEstablishmentPolicy (void);
+
+ private:
+
+ SecurityLevel3::CredsDirective creds_directive_;
+ SecurityLevel3::OwnCredentialsList creds_list_;
+ SecurityLevel3::FeatureDirective use_client_auth_;
+ SecurityLevel3::FeatureDirective use_target_auth_;
+ SecurityLevel3::FeatureDirective use_confidentiality_;
+ SecurityLevel3::FeatureDirective use_integrity_;
+
+ };
+
+ } // End SL3 namespace
+
+} // End TAO namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SL3_CONTEXT_ESTABLISHMENT_POLICY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsAcquirerFactory.cpp b/TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsAcquirerFactory.cpp
new file mode 100644
index 00000000000..80a5304154e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsAcquirerFactory.cpp
@@ -0,0 +1,14 @@
+#include "orbsvcs/Security/SL3_CredentialsAcquirerFactory.h"
+
+
+ACE_RCSID (Security,
+ SL3_CredentialsAcquirerFactory,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SL3::CredentialsAcquirerFactory::~CredentialsAcquirerFactory (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsAcquirerFactory.h b/TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsAcquirerFactory.h
new file mode 100644
index 00000000000..6320a50b252
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsAcquirerFactory.h
@@ -0,0 +1,68 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SL3_CredentialsAcquirerFactory.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SL3_CREDENTIALS_ACQUIRER_FACTORY_H
+#define TAO_SL3_CREDENTIALS_ACQUIRER_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Security/security_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Security/SL3_CredentialsCurator.h"
+
+#include "orbsvcs/SecurityLevel3C.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SL3
+ {
+
+ /**
+ * @class CredentialsAcquirerFactory
+ *
+ * @brief Abstract base class for all concrete
+ * CredentialsAcquirerFactory implementations.
+ *
+ * All concrete CredentialsAcquirerFactory classes must implement
+ * this interface.
+ */
+ class TAO_Security_Export CredentialsAcquirerFactory
+ {
+ public:
+
+ /// Destructor.
+ virtual ~CredentialsAcquirerFactory (void);
+
+ /// Create a TAO::SL3::CredentialsAcquirerFactory.
+ virtual SecurityLevel3::CredentialsAcquirer_ptr make (
+ TAO::SL3::CredentialsCurator_ptr curator,
+ const CORBA::Any & acquisition_arguments
+ ACE_ENV_ARG_DECL) = 0;
+
+ };
+
+ } // End SL3 namespace
+} // End TAO namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SL3_CREDENTIALS_ACQUIRER_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsCurator.cpp b/TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsCurator.cpp
new file mode 100644
index 00000000000..6555f46469c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsCurator.cpp
@@ -0,0 +1,284 @@
+// $Id$
+
+#include "orbsvcs/Security/SL3_CredentialsCurator.h"
+#include "orbsvcs/Security/SL3_CredentialsAcquirerFactory.h"
+
+
+ACE_RCSID (Security,
+ SL3_CredentialsCurator,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SL3
+ {
+ static const size_t CREDENTIALS_TABLE_SIZE = 128;
+ }
+}
+
+TAO::SL3::CredentialsCurator::CredentialsCurator (void)
+ : lock_ (),
+ acquirer_factories_ (),
+ credentials_table_ (TAO::SL3::CREDENTIALS_TABLE_SIZE)
+{
+}
+
+TAO::SL3::CredentialsCurator::~CredentialsCurator (void)
+{
+ const Factory_Iterator fend = this->acquirer_factories_.end ();
+ for (Factory_Iterator i = this->acquirer_factories_.begin ();
+ i != fend;
+ ++i)
+ {
+ // Deallocate the Acquistion Method.
+ CORBA::string_free (const_cast<char *> ((*i).ext_id_));
+
+ delete (*i).int_id_;
+ }
+
+ this->acquirer_factories_.close ();
+
+ const Credentials_Iterator end = this->credentials_table_.end ();
+ for (Credentials_Iterator j = this->credentials_table_.begin ();
+ j != end;
+ ++j)
+ {
+ // Deallocate the CredentialsId.
+ CORBA::string_free (const_cast<char *> ((*j).ext_id_));
+ }
+
+ this->credentials_table_.close ();
+}
+
+TAO::SL3::CredentialsCurator_ptr
+TAO::SL3::CredentialsCurator::_duplicate (TAO::SL3::CredentialsCurator_ptr obj)
+{
+ if (!CORBA::is_nil (obj))
+ obj->_add_ref ();
+
+ return obj;
+}
+
+TAO::SL3::CredentialsCurator_ptr
+TAO::SL3::CredentialsCurator::_narrow (CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ return TAO::SL3::CredentialsCurator::_duplicate (
+ dynamic_cast<TAO::SL3::CredentialsCurator *> (obj));
+}
+
+TAO::SL3::CredentialsCurator_ptr
+TAO::SL3::CredentialsCurator::_nil (void)
+{
+ return (CredentialsCurator *) 0;
+}
+
+SecurityLevel3::AcquisitionMethodList *
+TAO::SL3::CredentialsCurator::supported_methods (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ SecurityLevel3::AcquisitionMethodList * list;
+ ACE_NEW_THROW_EX (list,
+ SecurityLevel3::AcquisitionMethodList,
+ CORBA::NO_MEMORY ());
+ SecurityLevel3::AcquisitionMethodList_var methods = list;
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ 0);
+
+ methods->length (this->acquirer_factories_.current_size ());
+
+ CORBA::ULong n = 0;
+
+ const Factory_Iterator end = this->acquirer_factories_.end ();
+ for (Factory_Iterator i = this->acquirer_factories_.begin ();
+ i != end;
+ ++i)
+ {
+ methods[n++] = CORBA::string_dup ((*i).ext_id_);
+ }
+
+ return methods._retn ();
+}
+
+SecurityLevel3::CredentialsAcquirer_ptr
+TAO::SL3::CredentialsCurator::acquire_credentials (
+ const char * acquisition_method,
+ const CORBA::Any & acquisition_arguments
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO::SL3::CredentialsAcquirerFactory * factory;
+
+ if (this->acquirer_factories_.find (acquisition_method,
+ factory) == 0)
+ {
+ return factory->make (this,
+ acquisition_arguments
+ ACE_ENV_ARG_PARAMETER);
+ }
+
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (),
+ SecurityLevel3::CredentialsAcquirer::_nil ());
+
+}
+
+SecurityLevel3::OwnCredentialsList *
+TAO::SL3::CredentialsCurator::default_creds_list (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ SecurityLevel3::OwnCredentialsList * list;
+ ACE_NEW_THROW_EX (list,
+ SecurityLevel3::OwnCredentialsList,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ SecurityLevel3::OwnCredentialsList_var creds_list = list;
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ 0);
+
+ creds_list->length (this->credentials_table_.current_size ());
+
+ CORBA::ULong n = 0;
+
+ const Credentials_Iterator end = this->credentials_table_.end ();
+ for (Credentials_Iterator i = this->credentials_table_.begin ();
+ i != end;
+ ++i)
+ {
+ creds_list[n++] =
+ SecurityLevel3::OwnCredentials::_duplicate ((*i).int_id_.in());
+ }
+
+ return creds_list._retn ();
+}
+
+SecurityLevel3::CredentialsIdList *
+TAO::SL3::CredentialsCurator::default_creds_ids (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ SecurityLevel3::CredentialsIdList * list;
+ ACE_NEW_THROW_EX (list,
+ SecurityLevel3::CredentialsIdList,
+ CORBA::NO_MEMORY ());
+ SecurityLevel3::CredentialsIdList_var creds_ids = list;
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ 0);
+
+ creds_ids->length (this->credentials_table_.current_size ());
+
+ CORBA::ULong n = 0;
+
+ const Credentials_Iterator end = this->credentials_table_.end ();
+ for (Credentials_Iterator i = this->credentials_table_.begin ();
+ i != end;
+ ++i)
+ {
+ creds_ids[n++] = CORBA::string_dup ((*i).ext_id_);
+ }
+
+ return creds_ids._retn ();
+}
+
+SecurityLevel3::OwnCredentials_ptr
+TAO::SL3::CredentialsCurator::get_own_credentials (
+ const char * credentials_id
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ Credentials_Table::ENTRY * entry;
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ this->lock_,
+ SecurityLevel3::OwnCredentials::_nil ());
+
+ if (this->credentials_table_.find (credentials_id, entry) != 0)
+ {
+ return SecurityLevel3::OwnCredentials::_nil ();
+ }
+
+ return
+ SecurityLevel3::OwnCredentials::_duplicate (entry->int_id_.in ());
+}
+
+void
+TAO::SL3::CredentialsCurator::release_own_credentials (
+ const char * credentials_id
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ Credentials_Table::ENTRY * entry;
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_);
+
+ if (this->credentials_table_.find (credentials_id, entry) == 0)
+ {
+ // Deallocate the external ID (a const char *) before unbinding.
+ CORBA::string_free (const_cast<char *> (entry->ext_id_));
+
+ (void) this->credentials_table_.unbind (entry);
+ }
+}
+
+void
+TAO::SL3::CredentialsCurator:: register_acquirer_factory (
+ const char * acquisition_method,
+ TAO::SL3::CredentialsAcquirerFactory * factory
+ ACE_ENV_ARG_DECL)
+{
+ if (acquisition_method == 0 || factory == 0)
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ CORBA::String_var method = CORBA::string_dup (acquisition_method);
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_);
+
+ const int result =
+ this->acquirer_factories_.bind (method.in (), factory);
+
+ if (result == 1) // Entry already exists in table.
+ ACE_THROW (CORBA::BAD_INV_ORDER ());
+ else if (result == -1) // Failure.
+ ACE_THROW (CORBA::INTERNAL ());
+
+
+ // CredentialsCurator now owns the acquisition method id.
+ (void) method._retn ();
+
+ // Otherwise success!
+}
+
+void
+TAO::SL3::CredentialsCurator::_tao_add_own_credentials (
+ SecurityLevel3::OwnCredentials_ptr credentials
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::String_var credentials_id =
+ credentials->creds_id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ SecurityLevel3::OwnCredentials_var creds =
+ SecurityLevel3::OwnCredentials::_duplicate (credentials);
+
+ if (this->credentials_table_.bind (credentials_id.in (),
+ creds) != 0)
+ {
+ ACE_THROW (CORBA::NO_RESOURCES ());
+ }
+
+ // CredentialsCurator nows owns the id.
+ (void) credentials_id._retn ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsCurator.h b/TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsCurator.h
new file mode 100644
index 00000000000..85edccb3963
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_CredentialsCurator.h
@@ -0,0 +1,176 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SL3_CredentialsCurator.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SL3_CREDENTIALS_CURATOR_H
+#define TAO_SL3_CREDENTIALS_CURATOR_H
+
+#include /**/ "ace/pre.h"
+#include "orbsvcs/Security/security_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SecurityLevel3C.h"
+
+#include "tao/LocalObject.h"
+
+#include "ace/Hash_Map_Manager_T.h"
+#include "ace/Map_Manager.h"
+
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SL3
+ {
+ class CredentialsAcquirerFactory;
+
+ class CredentialsCurator;
+ typedef CredentialsCurator* CredentialsCurator_ptr;
+ typedef TAO_Pseudo_Var_T<CredentialsCurator> CredentialsCurator_var;
+ typedef TAO_Pseudo_Out_T<CredentialsCurator> CredentialsCurator_out;
+
+ /**
+ * @class CredentialsCurator
+ *
+ * @brief Implementation of the SecurityLevel3::CredentialsCurator
+ * object.
+ *
+ * This class provides a means for creating and managing
+ * OwnCredentials.
+ */
+ class TAO_Security_Export CredentialsCurator
+ : public virtual SecurityLevel3::CredentialsCurator,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+ typedef CredentialsCurator_ptr _ptr_type;
+ typedef CredentialsCurator_var _var_type;
+ typedef CredentialsCurator_out _out_type;
+
+ /**
+ * The type of table that maps acquisition method to acquirer
+ * factory.
+ */
+ typedef ACE_Map_Manager<const char *,
+ TAO::SL3::CredentialsAcquirerFactory *,
+ ACE_Null_Mutex> Acquirer_Factory_Table;
+ typedef Acquirer_Factory_Table::iterator Factory_Iterator;
+
+ typedef ACE_Hash_Map_Manager_Ex <const char *,
+ SecurityLevel3::OwnCredentials_var,
+ ACE_Hash<const char *>,
+ ACE_Equal_To<const char *>,
+ ACE_Null_Mutex> Credentials_Table;
+ typedef Credentials_Table::iterator Credentials_Iterator;
+
+ /// Constructor
+ CredentialsCurator (void);
+
+ static CredentialsCurator_ptr _duplicate (CredentialsCurator_ptr obj);
+ static CredentialsCurator_ptr _nil (void);
+ static CredentialsCurator_ptr _narrow (CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * @name SecurityLevel3::CredentialsCurator Methods
+ *
+ * Methods required by the SecurityLevel3::CredentialsCurator
+ * interface.
+ */
+ //@{
+ virtual SecurityLevel3::AcquisitionMethodList * supported_methods (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::CredentialsAcquirer_ptr acquire_credentials (
+ const char * acquisition_method,
+ const CORBA::Any & acquisition_arguments
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::OwnCredentialsList * default_creds_list (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::CredentialsIdList * default_creds_ids (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::OwnCredentials_ptr get_own_credentials (
+ const char * credentials_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void release_own_credentials (const char * credentials_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ /// Register CredentialsAcquirer factory.
+ /**
+ * @note The CredentialsCurator retains ownership of the
+ * factory.
+ */
+ void register_acquirer_factory (
+ const char * acquisition_method,
+ TAO::SL3::CredentialsAcquirerFactory * factory
+ ACE_ENV_ARG_DECL);
+
+ /// TAO-specific means of adding credentials to this
+ /// CredentialsCurator's "own credentials" list.
+ void _tao_add_own_credentials (
+ SecurityLevel3::OwnCredentials_ptr credentials
+ ACE_ENV_ARG_DECL);
+
+ protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management
+ * through the reference counting mechanism.
+ */
+ ~CredentialsCurator (void);
+
+ private:
+
+ /// Lock used to synchronize access to underlying tables.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// Table of CredentialsAcquirer factories.
+ Acquirer_Factory_Table acquirer_factories_;
+
+ /// Table of OwnCredentials.
+ Credentials_Table credentials_table_;
+ };
+ } // End SL3 namespace
+} // End TAO namespace
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SL3_CREDENTIALS_CURATOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_ObjectCredentialsPolicy.cpp b/TAO/orbsvcs/orbsvcs/Security/SL3_ObjectCredentialsPolicy.cpp
new file mode 100644
index 00000000000..69cac1d1ae1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_ObjectCredentialsPolicy.cpp
@@ -0,0 +1,65 @@
+// $Id$
+
+#include "orbsvcs/Security/SL3_ObjectCredentialsPolicy.h"
+
+
+ACE_RCSID (Security,
+ SL3_ObjectCredentialsPolicy,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SL3::ObjectCredentialsPolicy::ObjectCredentialsPolicy (
+ const SecurityLevel3::OwnCredentialsList & creds)
+ : creds_list_ (creds)
+{
+}
+
+TAO::SL3::ObjectCredentialsPolicy::~ObjectCredentialsPolicy (void)
+{
+}
+
+SecurityLevel3::OwnCredentialsList *
+TAO::SL3::ObjectCredentialsPolicy::creds_list (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ SecurityLevel3::OwnCredentialsList * creds = 0;
+
+ ACE_NEW_THROW_EX (creds,
+ SecurityLevel3::OwnCredentialsList (this->creds_list_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (creds);
+
+ return creds;
+}
+
+CORBA::PolicyType
+TAO::SL3::ObjectCredentialsPolicy::policy_type (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return SecurityLevel3::ObjectCredentialsPolicyType;
+}
+
+CORBA::Policy_ptr
+TAO::SL3::ObjectCredentialsPolicy::copy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Policy_ptr p = CORBA::Policy::_nil ();
+ ACE_NEW_THROW_EX (p,
+ TAO::SL3::ObjectCredentialsPolicy (this->creds_list_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (p);
+
+ return p;
+}
+
+void
+TAO::SL3::ObjectCredentialsPolicy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->creds_list_.length (0);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_ObjectCredentialsPolicy.h b/TAO/orbsvcs/orbsvcs/Security/SL3_ObjectCredentialsPolicy.h
new file mode 100644
index 00000000000..c4479d9aa8e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_ObjectCredentialsPolicy.h
@@ -0,0 +1,110 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SL3_ObjectCredentialsPolicy.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SL3_OBJECT_CREDENTIALS_POLICY_H
+#define TAO_SL3_OBJECT_CREDENTIALS_POLICY_H
+
+#include /**/ "ace/pre.h"
+#include "orbsvcs/Security/security_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SecurityLevel3C.h"
+
+#include "tao/LocalObject.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SL3
+ {
+ /**
+ * @class ObjectCredentialsPolicy
+ *
+ * @brief POA-specific Policy containing server's "own"
+ * credentials.
+ *
+ * This policy may be passed in the PolicyList argument of
+ * PortableServer::POA::create_POA() method. Targets under that
+ * POA will have the credentials contained within this Policy
+ * associated with them.
+ */
+ class ObjectCredentialsPolicy
+ : public virtual SecurityLevel3::ObjectCredentialsPolicy,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+
+ /// Constructor
+ ObjectCredentialsPolicy (
+ const SecurityLevel3::OwnCredentialsList & creds);
+
+ /**
+ * @name SecurityLevel3::ObjectCredentialsPolicy Methods
+ *
+ * Methods required by the
+ * SecurityLevel3::ObjectCredentialsPolicy interface.
+ */
+ //@{
+ virtual SecurityLevel3::OwnCredentialsList * creds_list (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::PolicyType policy_type (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Policy_ptr copy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management
+ * through the reference counting mechanism.
+ */
+ ~ObjectCredentialsPolicy (void);
+
+ private:
+
+ /// List of POA-specific OwnCredentials.
+ SecurityLevel3::OwnCredentialsList creds_list_;
+
+ };
+
+ } // End SL3 namespace
+
+} // End TAO namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SL3_OBJECT_CREDENTIALS_POLICY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_PolicyFactory.cpp b/TAO/orbsvcs/orbsvcs/Security/SL3_PolicyFactory.cpp
new file mode 100644
index 00000000000..959a93e4885
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_PolicyFactory.cpp
@@ -0,0 +1,63 @@
+// $Id$
+
+#include "orbsvcs/Security/SL3_PolicyFactory.h"
+#include "orbsvcs/Security/SL3_ContextEstablishmentPolicy.h"
+#include "orbsvcs/Security/SL3_ObjectCredentialsPolicy.h"
+
+
+ACE_RCSID (Security,
+ SL3_PolicyFactory,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+CORBA::Policy_ptr
+TAO::SL3::PolicyFactory::create_policy (CORBA::PolicyType type,
+ const CORBA::Any & value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CORBA::PolicyError))
+{
+ CORBA::Policy_ptr policy = CORBA::Policy::_nil ();
+
+ if (type == SecurityLevel3::ContextEstablishmentPolicyType)
+ {
+ SecurityLevel3::ContextEstablishmentPolicyArgument * arg = 0;
+ if (!(value >>= arg))
+ ACE_THROW_RETURN (CORBA::INTERNAL (),
+ policy);
+
+ ACE_NEW_THROW_EX (policy,
+ TAO::SL3::ContextEstablishmentPolicy (
+ arg->creds_directive,
+ arg->creds_list,
+ arg->use_client_auth,
+ arg->use_target_auth,
+ arg->use_confidentiality,
+ arg->use_integrity),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (policy);
+ }
+ else if (type == SecurityLevel3::ObjectCredentialsPolicyType)
+ {
+ SecurityLevel3::ObjectCredentialsPolicyArgument * creds = 0;
+ if (!(value >>= creds))
+ ACE_THROW_RETURN (CORBA::INTERNAL (),
+ policy);
+
+ ACE_NEW_THROW_EX (policy,
+ TAO::SL3::ObjectCredentialsPolicy (*creds),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (policy);
+ }
+ else
+ {
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ policy);
+ }
+
+ return policy;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_PolicyFactory.h b/TAO/orbsvcs/orbsvcs/Security/SL3_PolicyFactory.h
new file mode 100644
index 00000000000..9c3a36b0913
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_PolicyFactory.h
@@ -0,0 +1,82 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SL3_PolicyFactory.h
+ *
+ * $Id$
+ *
+ * PolicyFactory implementation for the SecurityLevel3 policies.
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_SL3_POLICY_FACTORY_H
+#define TAO_SL3_POLICY_FACTORY_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PI/PI.h"
+#include "tao/LocalObject.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SL3
+ {
+
+ /**
+ * @class olicyFactory
+ *
+ * @brief SecurityLevel3 PolicyFactory
+ *
+ * PolicyFactory for all SecurityLevel3 policies.
+ */
+ class PolicyFactory
+ : public virtual PortableInterceptor::PolicyFactory,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+
+ /**
+ * @name Methods Required by the PolicyFactory 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 PolicyFactory
+ * sub-classes.
+ */
+ //@{
+
+ /// Construct a Test::Policy object as a test.
+ virtual CORBA::Policy_ptr create_policy (CORBA::PolicyType type,
+ const CORBA::Any & value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CORBA::PolicyError));
+
+ //@}
+
+ };
+
+ } // End SL3 namespace.
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_SL3_POLICY_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent.cpp b/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent.cpp
new file mode 100644
index 00000000000..db6609f803b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent.cpp
@@ -0,0 +1,60 @@
+// $Id$
+
+#include "orbsvcs/Security/SL3_SecurityCurrent.h"
+
+
+ACE_RCSID (Security,
+ SL3_SecurityCurrent,
+ "$Id$")
+
+
+#if !defined (__ACE_INLINE__)
+# include "orbsvcs/Security/SL3_SecurityCurrent.inl"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SL3::SecurityCurrent::SecurityCurrent (size_t tss_slot,
+ TAO_ORB_Core * oc)
+ : tss_slot_ (tss_slot),
+ orb_core_ (oc)
+{
+}
+
+
+TAO::SL3::SecurityCurrent::~SecurityCurrent (void)
+{
+}
+
+SecurityLevel3::ClientCredentials_ptr
+TAO::SL3::SecurityCurrent::client_credentials (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO::SL3::SecurityCurrent_Impl * impl = this->implementation ();
+
+ // If the implementation pointer returned from TSS is zero, then
+ // we're not in the middle of a request/upcall. Throw an exception
+ // to indicate that.
+ if (impl == 0)
+ ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (),
+ SecurityLevel3::ClientCredentials::_nil ());
+
+ return impl->client_credentials (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO::SL3::SecurityCurrent::request_is_local (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO::SL3::SecurityCurrent_Impl * impl = this->implementation ();
+
+ // If the implementation pointer returned from TSS is zero, then
+ // we're not in the middle of a request/upcall. Throw an exception
+ // to indicate that.
+ if (impl == 0)
+ ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (), false);
+
+ return impl->request_is_local (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent.h b/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent.h
new file mode 100644
index 00000000000..b592530c19e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent.h
@@ -0,0 +1,152 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SL3_SecurityCurrent.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SL3_SECURITY_CURRENT_H
+#define TAO_SL3_SECURITY_CURRENT_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Security/security_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Security/SL3_SecurityCurrent_Impl.h"
+
+#include "orbsvcs/SecurityLevel3C.h"
+
+#include "tao/LocalObject.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_ORB_Core;
+
+namespace TAO
+{
+ namespace SL3
+ {
+ /**
+ * @class SecurityCurrent
+ *
+ * @brief SecurityLevel3::SecurityCurrent implementation.
+ *
+ * Thread-specific information may be retrieved from the target
+ * security service through this object.
+ *
+ * @note This SecurityCurrent implementation basically a variant
+ * of the bridge design pattern. All operations are
+ * delegated on to concrete implementations.
+ */
+ class TAO_Security_Export SecurityCurrent
+ : public virtual SecurityLevel3::SecurityCurrent,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+
+ /// Constructor
+ SecurityCurrent (size_t tss_slot, TAO_ORB_Core * oc);
+
+ /**
+ * @name SecurityLevel3::SecurityCurrent Methods
+ *
+ * Methods required by the SecurityLevel3::SecurityCurrent
+ * interface.
+ */
+ //@{
+ virtual SecurityLevel3::ClientCredentials_ptr client_credentials (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean request_is_local (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ /// Return the TSS slot ID assigned to the "SecurityCurrent"
+ /// object.
+ /**
+ * The concrete thread-specific storage SecurityCurrent
+ * implementations will each use this slot ID.
+ */
+ size_t tss_slot (void) const;
+
+ protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management
+ * through the reference counting mechanism.
+ */
+ ~SecurityCurrent (void);
+
+ private:
+
+ /// Set the thread-specific storage
+ /// SecurityLevel3::SecurityCurrent implementation.
+ /**
+ * The pointer is actually one to a concrete implementation provided
+ * by the underlying security mechanism. For example, SSLIOP
+ * implements its own SSLIOP-specific operations corresponding
+ * to the ones exposed by the SecurityCurrent interface.
+ * Similarly, SECIOP would do the same.
+ * @par
+ * There is no function that places the implementation pointer
+ * in TSS. The underlying security mechanism does that.
+ */
+ SecurityCurrent_Impl * implementation (void);
+
+ private:
+
+ /**
+ * @name Retricted Copying and Assignment
+ *
+ * Prevent copying through the copy constructor and the
+ * assignment operator.
+ */
+ //@{
+ SecurityCurrent (const SecurityCurrent &);
+ void operator= (const SecurityCurrent &);
+ //@}
+
+ private:
+
+ /// Thread-specific storage slot assigned to this object.
+ const size_t tss_slot_;
+
+ /// Pointer to the ORB Core corresponding to the ORB with which
+ /// this object is registered.
+ TAO_ORB_Core * const orb_core_;
+
+ };
+
+ } // End SL3 namespace
+} // End TAO namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+# include "orbsvcs/Security/SL3_SecurityCurrent.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SL3_SECURITY_CURRENT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent.inl b/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent.inl
new file mode 100644
index 00000000000..4194ffe1895
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent.inl
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "tao/ORB_Core.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE size_t
+TAO::SL3::SecurityCurrent::tss_slot (void) const
+{
+ return this->tss_slot_;
+}
+
+ACE_INLINE TAO::SL3::SecurityCurrent_Impl *
+TAO::SL3::SecurityCurrent::implementation (void)
+{
+ TAO::SL3::SecurityCurrent_Impl *impl =
+ static_cast<TAO::SL3::SecurityCurrent_Impl *> (
+ this->orb_core_->get_tss_resource (this->tss_slot_));
+
+ return impl;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent_Impl.cpp b/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent_Impl.cpp
new file mode 100644
index 00000000000..14b7a548c16
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent_Impl.cpp
@@ -0,0 +1,16 @@
+// -*- C++ -*-
+
+#include "orbsvcs/Security/SL3_SecurityCurrent_Impl.h"
+
+ACE_RCSID (Security,
+ SL3_Security_Current_Impl,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SL3::SecurityCurrent_Impl::~SecurityCurrent_Impl (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent_Impl.h b/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent_Impl.h
new file mode 100644
index 00000000000..59501c69339
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityCurrent_Impl.h
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+
+// ===================================================================
+/**
+ * @file SL3_SecurityCurrent_Impl.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+// ===================================================================
+
+#ifndef TAO_SL3_SECURITY_CURRENT_IMPL_H
+#define TAO_SL3_SECURITY_CURRENT_IMPL_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/Security/security_export.h"
+#include "orbsvcs/SecurityLevel3C.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SL3
+ {
+ /**
+ * @class SecurityCurrent_Impl
+ *
+ * @brief Base class for the TSS portion of any underlying
+ * security mechanism.
+ *
+ * This class provides the same interface as the
+ * SecurityLevel3::SecurityCurrent object. However, it is not
+ * derived from that interface since we need to explicitly avoid
+ * virtual inheritance so that it is safe to store subclasses in a
+ * "void * *" and later cast that pointer back to the subclass
+ * pointer type.
+ */
+ class TAO_Security_Export SecurityCurrent_Impl
+ {
+ public:
+
+ /// Destructor.
+ virtual ~SecurityCurrent_Impl (void);
+
+ /**
+ * @name SecurityLevel3::Current Methods
+ *
+ * These methods are founds in the SecurityLevel3::Current
+ * interface.
+ */
+ //@{
+ /// Return the Credentials received from the client associate with
+ /// the current request.
+ virtual SecurityLevel3::ClientCredentials_ptr client_credentials (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+
+ /// Is the current request local?
+ virtual CORBA::Boolean request_is_local (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+ //@}
+
+ /// Return the unique tag that identifies the concrete subclass.
+ virtual CORBA::ULong tag (void) const = 0;
+
+ };
+
+ } // End Security namespace.
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SL3_SECURITY_CURRENT_IMPL_H */
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityManager.cpp b/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityManager.cpp
new file mode 100644
index 00000000000..1cf548a4f2e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityManager.cpp
@@ -0,0 +1,84 @@
+// $Id$
+
+#include "orbsvcs/Security/SL3_SecurityManager.h"
+#include "orbsvcs/Security/SL3_ContextEstablishmentPolicy.h"
+#include "orbsvcs/Security/SL3_ObjectCredentialsPolicy.h"
+
+
+ACE_RCSID (Security,
+ SL3_SecurityManager,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::SL3::SecurityManager::SecurityManager (
+ SecurityLevel3::CredentialsCurator_ptr cc)
+ : credentials_curator_ (SecurityLevel3::CredentialsCurator::_duplicate (cc))
+{
+}
+
+TAO::SL3::SecurityManager::~SecurityManager (void)
+{
+}
+
+SecurityLevel3::CredentialsCurator_ptr
+TAO::SL3::SecurityManager::credentials_curator (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return
+ SecurityLevel3::CredentialsCurator::_duplicate (
+ this->credentials_curator_.in ());
+}
+
+SecurityLevel3::TargetCredentials_ptr
+TAO::SL3::SecurityManager::get_target_credentials (CORBA::Object_ptr /* the_object */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
+ SecurityLevel3::TargetCredentials::_nil ());
+}
+
+SecurityLevel3::ContextEstablishmentPolicy_ptr
+TAO::SL3::SecurityManager::create_context_estab_policy (
+ SecurityLevel3::CredsDirective creds_directive,
+ const SecurityLevel3::OwnCredentialsList & creds_list,
+ SecurityLevel3::FeatureDirective use_client_auth,
+ SecurityLevel3::FeatureDirective use_target_auth,
+ SecurityLevel3::FeatureDirective use_confidentiality,
+ SecurityLevel3::FeatureDirective use_integrity
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ SecurityLevel3::ContextEstablishmentPolicy_ptr policy;
+ ACE_NEW_THROW_EX (policy,
+ TAO::SL3::ContextEstablishmentPolicy (creds_directive,
+ creds_list,
+ use_client_auth,
+ use_target_auth,
+ use_confidentiality,
+ use_integrity),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (policy);
+
+ return policy;
+}
+
+SecurityLevel3::ObjectCredentialsPolicy_ptr
+TAO::SL3::SecurityManager::create_object_creds_policy (
+ const SecurityLevel3::OwnCredentialsList & creds_list
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ SecurityLevel3::ObjectCredentialsPolicy_ptr policy;
+ ACE_NEW_THROW_EX (policy,
+ TAO::SL3::ObjectCredentialsPolicy (creds_list),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (policy);
+
+ return policy;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityManager.h b/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityManager.h
new file mode 100644
index 00000000000..3f1ac2054ae
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityManager.h
@@ -0,0 +1,119 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SL3_SecurityManager.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SL3_SECURITY_MANAGER_H
+#define TAO_SL3_SECURITY_MANAGER_H
+
+#include /**/ "ace/pre.h"
+#include "orbsvcs/Security/security_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SecurityLevel3C.h"
+
+#include "tao/LocalObject.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace SL3
+ {
+ /**
+ * @class SecurityManager
+ *
+ * @brief
+ *
+ *
+ */
+ class SecurityManager
+ : public virtual SecurityLevel3::SecurityManager,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+
+ /// Constructor
+ SecurityManager (SecurityLevel3::CredentialsCurator_ptr cc);
+
+ /**
+ * @name SecurityLevel3::SecurityManager Methods
+ *
+ * Methods required by the SecurityLevel3::SecurityManager
+ * interface.
+ */
+ //@{
+ virtual SecurityLevel3::CredentialsCurator_ptr credentials_curator (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::TargetCredentials_ptr get_target_credentials (
+ CORBA::Object_ptr the_object
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::ContextEstablishmentPolicy_ptr
+ create_context_estab_policy (
+ SecurityLevel3::CredsDirective creds_directive,
+ const SecurityLevel3::OwnCredentialsList & creds_list,
+ SecurityLevel3::FeatureDirective use_client_auth,
+ SecurityLevel3::FeatureDirective use_target_auth,
+ SecurityLevel3::FeatureDirective use_confidentiality,
+ SecurityLevel3::FeatureDirective use_integrity
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual SecurityLevel3::ObjectCredentialsPolicy_ptr
+ create_object_creds_policy (
+ const SecurityLevel3::OwnCredentialsList & cred_list
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management
+ * through the reference counting mechanism.
+ */
+ virtual ~SecurityManager (void);
+
+ private:
+
+ /// The ORB-specific SecurityLevel3::CredentialsCurator
+ /// reference.
+ SecurityLevel3::CredentialsCurator_var credentials_curator_;
+
+ };
+
+ } // End SL3 namespace
+} // End TAO namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SL3_SECURITY_MANAGER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Security/Security_Current.cpp b/TAO/orbsvcs/orbsvcs/Security/Security_Current.cpp
new file mode 100644
index 00000000000..0470c54ab17
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/Security_Current.cpp
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+
+#include "orbsvcs/Security/Security_Current.h"
+#include "tao/debug.h"
+
+ACE_RCSID (Security,
+ Security_Current,
+ "$Id$")
+
+#if !defined (__ACE_INLINE__)
+# include "orbsvcs/Security/Security_Current.inl"
+#endif /* __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Security_Current::TAO_Security_Current (size_t tss_slot,
+ const char *orb_id)
+ : tss_slot_ (tss_slot),
+ orb_id_ (orb_id),
+ orb_core_ (0)
+{
+}
+
+TAO_Security_Current::~TAO_Security_Current (void)
+{
+}
+
+Security::AttributeList *
+TAO_Security_Current::get_attributes (
+ const Security::AttributeTypeList &attributes
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO::Security::Current_Impl *impl = this->implementation ();
+
+ // If the implementation pointer returned from TSS is zero, then
+ // we're not in the middle of a request/upcall. Throw an exception
+ // to indicate that.
+ if (impl == 0)
+ ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (), 0);
+
+ return impl->get_attributes (attributes ACE_ENV_ARG_PARAMETER);
+}
+
+SecurityLevel2::ReceivedCredentials_ptr
+TAO_Security_Current::received_credentials (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO::Security::Current_Impl *impl = this->implementation ();
+
+ // If the implementation pointer returned from TSS is zero, then
+ // we're not in the middle of a request/upcall. Throw an exception
+ // to indicate that.
+ if (impl == 0)
+ ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (), 0);
+
+ return impl->received_credentials (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+int
+TAO_Security_Current::init (void)
+{
+ int result = 0;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ this->orb_id_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->orb_core_ = orb.in ()->orb_core ();
+
+ // No longer need the ORBid, so reclaim the memory it was
+ // occupying.
+ (void) this->orb_id_.out ();
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level >= 1)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Could not initialize SecurityCurrent:");
+
+ result = -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return result;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/Security_Current.h b/TAO/orbsvcs/orbsvcs/Security/Security_Current.h
new file mode 100644
index 00000000000..118689ca9d4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/Security_Current.h
@@ -0,0 +1,149 @@
+// -*- C++ -*-
+
+// ===================================================================
+/**
+ * @file Security_Current.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+// ===================================================================
+
+#ifndef TAO_SECURITY_CURRENT_H
+#define TAO_SECURITY_CURRENT_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Security/security_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/SecurityLevel2C.h"
+#include "tao/ORB_Core.h"
+#include "tao/LocalObject.h"
+
+#include "orbsvcs/Security/Security_Current_Impl.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Security_Current
+ *
+ * @brief Implementation of the SecurityLevel2::Current interface.
+ *
+ * This object can be used to obtain session related security
+ * information about the current execution context.
+ */
+class TAO_Security_Export TAO_Security_Current
+ : public SecurityLevel2::Current,
+ public TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ TAO_Security_Current (size_t tss_slot, const char *orb_id);
+
+ /**
+ * @name SecurityLevel1::Current Methods
+ *
+ * These methods are founds in the SecurityLevel1::Current
+ * interface.
+ */
+ //@{
+ /// Return the security attributes corresponding to the types in the
+ /// given attribute type list associated with the current request.
+ virtual Security::AttributeList * get_attributes (
+ const Security::AttributeTypeList & attributes
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ /**
+ * @name SecurityLevel2::Current Methods
+ *
+ * These methods are founds in the SecurityLevel2::Current
+ * interface.
+ */
+ //@{
+ /// Return the Credentials received from the client associate with
+ /// the current request.
+ virtual SecurityLevel2::ReceivedCredentials_ptr received_credentials (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+ /// Return the TSS slot ID assigned to the "SecurityCurrent" object.
+ /**
+ * The concrete TSS SecurityCurrent implementations will each use
+ * this slot ID.
+ */
+ size_t tss_slot (void) const;
+
+protected:
+
+ /// Destructor
+ /// Protected to force allocation on the heap.
+ ~TAO_Security_Current (void);
+
+ /// Fully initialize this object. This method is used predominantly
+ /// to set the ORB core pointer.
+ int init (void);
+
+ /// Set the TSS Security::Current implementation.
+ /**
+ * The pointer is actually one to a concrete implementation provided
+ * by the underlying security mechanism. For example, SSLIOP
+ * implements the SecurityLevel2::Current interface. Similarly,
+ * SECIOP would do the same.
+ *
+ * There is no function that places the implementation pointer in
+ * TSS. The underlying security mechanism does that.
+ */
+ TAO::Security::Current_Impl *implementation (void);
+
+private:
+
+ /// Prevent copying through the copy constructor and the assignment
+ /// operator.
+ //@{
+ TAO_Security_Current (const TAO_Security_Current &);
+ void operator= (const TAO_Security_Current &);
+ //@}
+
+private:
+
+ /// TSS slot assigned to this object.
+ size_t const tss_slot_;
+
+ /// The ORBid of the ORB with which this object is registered.
+ CORBA::String_var orb_id_;
+
+ /// Pointer to the ORB Core corresponding to the ORB with which this
+ /// object is registered.
+ TAO_ORB_Core * orb_core_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+# include "orbsvcs/Security/Security_Current.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SECURITY_CURRENT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Security/Security_Current.inl b/TAO/orbsvcs/orbsvcs/Security/Security_Current.inl
new file mode 100644
index 00000000000..eee8c6c11fe
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/Security_Current.inl
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE size_t
+TAO_Security_Current::tss_slot (void) const
+{
+ return this->tss_slot_;
+}
+
+ACE_INLINE TAO::Security::Current_Impl *
+TAO_Security_Current::implementation (void)
+{
+ if (this->orb_core_ == 0 && this->init () != 0)
+ return 0;
+
+ TAO::Security::Current_Impl *impl =
+ static_cast<TAO::Security::Current_Impl *> (
+ this->orb_core_->get_tss_resource (this->tss_slot_));
+
+ return impl;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/Security_Current_Impl.cpp b/TAO/orbsvcs/orbsvcs/Security/Security_Current_Impl.cpp
new file mode 100644
index 00000000000..a0239a9ca7d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/Security_Current_Impl.cpp
@@ -0,0 +1,15 @@
+// -*- C++ -*-
+
+#include "orbsvcs/Security/Security_Current_Impl.h"
+
+ACE_RCSID (Security,
+ SL3_Security_Current_Impl,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::Security::Current_Impl::~Current_Impl (void)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/Security_Current_Impl.h b/TAO/orbsvcs/orbsvcs/Security/Security_Current_Impl.h
new file mode 100644
index 00000000000..f92e121fddf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/Security_Current_Impl.h
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+
+// ===================================================================
+/**
+ * @file Security_Current_Impl.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+// ===================================================================
+
+#ifndef TAO_SECURITY_CURRENT_IMPL_H
+#define TAO_SECURITY_CURRENT_IMPL_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/Security/security_export.h"
+#include "orbsvcs/SecurityLevel2C.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace Security
+ {
+ /**
+ * @class Current_Impl
+ *
+ * @brief Base class for the TSS portion of any underlying
+ * security mechanism.
+ *
+ * This class provides the same interface as the
+ * SecurityLevel3::Current object. However, it is not derived
+ * from that interface since we need to explicitly avoid virtual
+ * inheritance so that it is safe to store subclasses in a "void
+ * *" and later cast that pointer back to the subclass pointer
+ * type.
+ */
+ class TAO_Security_Export Current_Impl
+ {
+ public:
+
+ /// Destructor.
+ virtual ~Current_Impl (void);
+
+ /**
+ * @name SecurityLevel1::Current Methods
+ *
+ * These methods are founds in the SecurityLevel1::Current
+ * interface.
+ */
+ //@{
+ /// Return the security attributes corresponding to the types in
+ /// the given attribute type list associated with the current
+ /// request.
+ virtual ::Security::AttributeList * get_attributes (
+ const ::Security::AttributeTypeList & attributes
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+ //@}
+
+ /**
+ * @name SecurityLevel2::Current Methods
+ *
+ * These methods are founds in the SecurityLevel2::Current
+ * interface.
+ */
+ //@{
+ /// Return the Credentials received from the client associate with
+ /// the current request.
+ virtual SecurityLevel2::ReceivedCredentials_ptr received_credentials (
+ ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+ //@}
+
+ /// Return the unique tag that identifies the concrete subclass.
+ virtual CORBA::ULong tag (void) const = 0;
+
+ };
+
+ } // End Security namespace.
+} // End TAO namespace.
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SECURITY_CURRENT_IMPL_H */
diff --git a/TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.cpp
new file mode 100644
index 00000000000..396f2116aa0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.cpp
@@ -0,0 +1,240 @@
+// -*- C++ -*-
+
+#include "orbsvcs/Security/Security_ORBInitializer.h"
+
+ACE_RCSID (Security,
+ Security_ORBInitializer,
+ "$Id$")
+
+
+// #include "Security_Current.h"
+#include "orbsvcs/Security/SL3_SecurityCurrent.h"
+#include "orbsvcs/Security/SL3_CredentialsCurator.h"
+#include "orbsvcs/Security/SL3_SecurityManager.h"
+
+#include "orbsvcs/SecurityC.h"
+
+#include "tao/PI/ORBInitInfo.h"
+#include "tao/ORB_Constants.h"
+#include "tao/debug.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void
+TAO::Security::ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Narrow to a TAO_ORBInitInfo object to get access to the
+ // allocate_tss_slot_id() TAO extension.
+ TAO_ORBInitInfo_var tao_info =
+ TAO_ORBInitInfo::_narrow (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (tao_info.in ()))
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) Security_ORBInitializer::pre_init:\n"
+ "(%P|%t) Unable to narrow "
+ "\"PortableInterceptor::ORBInitInfo_ptr\" to\n"
+ "(%P|%t) \"TAO_ORBInitInfo_ptr.\"\n"));
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+// // Reserve a TSS slot in the ORB core internal TSS resources for the
+// // thread-specific portion of Security::Current.
+// size_t old_tss_slot = tao_info->allocate_tss_slot_id (0
+// ACE_ENV_ARG_PARAMETER);
+// ACE_CHECK;
+
+// CORBA::String_var orb_id = info->orb_id (ACE_ENV_SINGLE_ARG_PARAMETER);
+// ACE_CHECK;
+
+// // Create the SecurityLevel2::Current object.
+// SecurityLevel2::Current_ptr current = SecurityLevel2::Current::_nil ();
+// ACE_NEW_THROW_EX (current,
+// TAO_Security_Current (old_tss_slot, orb_id.in ()),
+// CORBA::NO_MEMORY (
+// CORBA::SystemException::_tao_minor_code (
+// TAO::VMCID,
+// ENOMEM),
+// CORBA::COMPLETED_NO));
+// ACE_CHECK;
+
+// SecurityLevel2::Current_var security_current = current;
+
+// // Register the SecurityLevel2::Current object reference with the
+// // ORB.
+// info->register_initial_reference ("SecurityCurrent",
+// security_current.in ()
+// ACE_ENV_ARG_PARAMETER);
+// ACE_CHECK;
+
+ // Reserve a TSS slot in the ORB core internal TSS resources for the
+ // thread-specific portion of SecurityLevel3::SecurityCurrent
+ // object.
+ size_t tss_slot = tao_info->allocate_tss_slot_id (0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+
+ // Create the SecurityLevel3::Current object.
+ SecurityLevel3::SecurityCurrent_ptr current3;
+ ACE_NEW_THROW_EX (current3,
+ TAO::SL3::SecurityCurrent (tss_slot,
+ tao_info->orb_core ()),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ SecurityLevel3::SecurityCurrent_var security_current3 = current3;
+
+ // Register the SecurityLevel2::Current object reference with the
+ // ORB.
+ info->register_initial_reference ("SecurityLevel3:SecurityCurrent",
+ security_current3.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Create the SecurityLevel3::CredentialsCurator object.
+ SecurityLevel3::CredentialsCurator_ptr curator;
+ ACE_NEW_THROW_EX (curator,
+ TAO::SL3::CredentialsCurator,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ SecurityLevel3::CredentialsCurator_var credentials_curator = curator;
+
+ // Register the SecurityLevel3::CredentialsCurator object reference
+ // with the ORB.
+ info->register_initial_reference ("SecurityLevel3:CredentialsCurator",
+ credentials_curator.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Create the SecurityLevel3::SecurityManager object.
+ SecurityLevel3::SecurityManager_ptr manager3;
+ ACE_NEW_THROW_EX (manager3,
+ TAO::SL3::SecurityManager (credentials_curator.in ()),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ SecurityLevel3::SecurityManager_var security_manager3 = manager3;
+
+ // Register the SecurityLevel3::SecurityManager object reference
+ // with the ORB.
+ info->register_initial_reference ("SecurityLevel3:SecurityManager",
+ security_manager3.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO::Security::ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->register_policy_factories (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO::Security::ORBInitializer::register_policy_factories (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+{
+ // Register the security policy factories.
+
+ if (CORBA::is_nil (this->policy_factory_.in ()))
+ {
+ PortableInterceptor::PolicyFactory_ptr policy_factory;
+ ACE_NEW_THROW_EX (policy_factory,
+ TAO::Security::PolicyFactory,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ this->policy_factory_ = policy_factory;
+ }
+
+ // Bind the same policy factory to all security related policy
+ // types since a single policy factory is used to create each of
+ // the different types of security policies.
+
+ CORBA::PolicyType type;
+
+ type = ::Security::SecQOPPolicy;
+ info->register_policy_factory (type,
+ this->policy_factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ type = ::Security::SecMechanismsPolicy;
+ info->register_policy_factory (type,
+ this->policy_factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ type = ::Security::SecInvocationCredentialsPolicy;
+ info->register_policy_factory (type,
+ this->policy_factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ type = ::Security::SecFeaturePolicy; // Deprecated
+ info->register_policy_factory (type,
+ this->policy_factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ type = ::Security::SecDelegationDirectivePolicy;
+ info->register_policy_factory (type,
+ this->policy_factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ type = ::Security::SecEstablishTrustPolicy;
+ info->register_policy_factory (type,
+ this->policy_factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+
+ type = SecurityLevel3::ContextEstablishmentPolicyType;
+ info->register_policy_factory (type,
+ this->policy_factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+
+ type = SecurityLevel3::ObjectCredentialsPolicyType;
+ info->register_policy_factory (type,
+ this->policy_factory_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+
+ // ----------------------------------------------------------------
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.h b/TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.h
new file mode 100644
index 00000000000..c6a17685f4d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.h
@@ -0,0 +1,106 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO
+//
+// = FILENAME
+// Security_ORBInitializer.h
+//
+// = AUTHOR
+// Ossama Othman <ossama@uci.edu>
+//
+// ============================================================================
+
+#ifndef TAO_SECURITY_ORB_INITIALIZER_H
+#define TAO_SECURITY_ORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Security/security_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PI/PI.h"
+#include "tao/LocalObject.h"
+
+#include "orbsvcs/Security/Security_PolicyFactory.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/// Security ORB initializer.
+namespace TAO
+{
+ namespace Security
+ {
+
+ /**
+ * @class ORBInitializer
+ *
+ * @brief ORBInitializer that configures CORBA Security features
+ * into an ORB.
+ *
+ * This ORBInitializer configures CORBA Security features into an
+ * ORB, such as CSIv2, security objects, security policy
+ * factories, etc, into an ORB.
+ */
+ class TAO_Security_Export ORBInitializer
+ : public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+
+ /**
+ * @name PortableInterceptor::ORBInitializer Methods.
+ *
+ * Methods required by the PortableInterceptor::ORBInitializer
+ * interface.
+ */
+ //@{
+ 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 Security policy factories.
+ void register_policy_factories (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL);
+
+ private:
+
+ /// PolicyFactory that is used to create all security related
+ /// policies capable of being created via ORB::create_policy().
+ PortableInterceptor::PolicyFactory_var policy_factory_;
+
+ };
+
+ } // End Security namespace
+} // End TAO namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SECURITY_ORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Security/Security_PolicyFactory.cpp b/TAO/orbsvcs/orbsvcs/Security/Security_PolicyFactory.cpp
new file mode 100644
index 00000000000..96f0ddbb787
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/Security_PolicyFactory.cpp
@@ -0,0 +1,159 @@
+// -*- C++ -*-
+
+#include "orbsvcs/Security/Security_PolicyFactory.h"
+
+ACE_RCSID (Security,
+ Security_PolicyFactory,
+ "$Id$")
+
+#include "orbsvcs/Security/SL2_QOPPolicy.h"
+#include "orbsvcs/Security/SL2_EstablishTrustPolicy.h"
+
+#include "orbsvcs/Security/SL3_ContextEstablishmentPolicy.h"
+#include "orbsvcs/Security/SL3_ObjectCredentialsPolicy.h"
+
+#include "orbsvcs/SecurityLevel2C.h"
+#include "orbsvcs/SecurityLevel3C.h"
+
+#include "tao/ORB_Constants.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+CORBA::Policy_ptr
+TAO::Security::PolicyFactory::create_policy (
+ CORBA::PolicyType type,
+ const CORBA::Any &value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CORBA::PolicyError))
+{
+ // Not all security policies can be created using the
+ // ORB::create_policy() mechanism. Only those that can be created
+ // using that mechanism are supported by this factory.
+
+ if (type == ::Security::SecQOPPolicy)
+ {
+ ::Security::QOP qop;
+
+ // Extract the desired Quality-of-Protection value from the
+ // given Any.
+ if (!(value >>= qop))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO),
+ CORBA::Policy::_nil ());
+
+ TAO::Security::QOPPolicy * qop_policy = 0;
+ ACE_NEW_THROW_EX (qop_policy,
+ TAO::Security::QOPPolicy (qop),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return qop_policy;
+ }
+
+ else if (type == ::Security::SecEstablishTrustPolicy)
+ {
+ ::Security::EstablishTrust *trust = 0;
+
+ // Extract the desired establishing of trust value from the
+ // given Any.
+ if (!(value >>= trust))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO),
+ CORBA::Policy::_nil ());
+
+ TAO::Security::EstablishTrustPolicy * trust_policy = 0;
+ ACE_NEW_THROW_EX (trust_policy,
+ TAO::Security::EstablishTrustPolicy (*trust),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return trust_policy;
+ }
+
+ else if (type == SecurityLevel3::ContextEstablishmentPolicyType)
+ {
+ SecurityLevel3::ContextEstablishmentPolicyArgument * args = 0;
+
+ // Extract the desired establishing of trust value from the
+ // given Any.
+ if (!(value >>= args))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO),
+ CORBA::Policy::_nil ());
+
+ TAO::SL3::ContextEstablishmentPolicy * policy = 0;
+ ACE_NEW_THROW_EX (policy,
+ TAO::SL3::ContextEstablishmentPolicy (
+ args->creds_directive,
+ args->creds_list,
+ args->use_client_auth,
+ args->use_target_auth,
+ args->use_confidentiality,
+ args->use_integrity),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return policy;
+ }
+
+ else if (type == SecurityLevel3::ObjectCredentialsPolicyType)
+ {
+ SecurityLevel3::OwnCredentialsList * creds = 0;
+
+ // Extract the desired establishing of trust value from the
+ // given Any.
+ if (!(value >>= creds))
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO),
+ CORBA::Policy::_nil ());
+
+ TAO::SL3::ObjectCredentialsPolicy * policy = 0;
+ ACE_NEW_THROW_EX (policy,
+ TAO::SL3::ObjectCredentialsPolicy (*creds),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return policy;
+ }
+
+ else if (type == ::Security::SecInvocationCredentialsPolicy
+ || type == ::Security::SecMechanismsPolicy
+ || type == ::Security::SecFeaturePolicy // Deprecated.
+ || type == ::Security::SecDelegationDirectivePolicy)
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::UNSUPPORTED_POLICY),
+ CORBA::Policy::_nil ());
+ else
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Security/Security_PolicyFactory.h b/TAO/orbsvcs/orbsvcs/Security/Security_PolicyFactory.h
new file mode 100644
index 00000000000..4596caadcb3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/Security_PolicyFactory.h
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Security_PolicyFactory.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SECURITY_POLICY_FACTORY_H
+#define TAO_SECURITY_POLICY_FACTORY_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Security/security_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PI/PI.h"
+#include "tao/LocalObject.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 */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ namespace Security
+ {
+
+ /**
+ * @class PolicyFactory
+ *
+ * @brief Policy factory for all security related policies.
+ *
+ * Policy factory for all security related policies.
+ */
+ class PolicyFactory
+ : public PortableInterceptor::PolicyFactory,
+ public TAO_Local_RefCounted_Object
+ {
+ public:
+
+ virtual CORBA::Policy_ptr create_policy (CORBA::PolicyType type,
+ const CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CORBA::PolicyError));
+ };
+
+ } // End Security namespace
+} // End TAO namespace
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SECURITY_POLICY_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Security/security_export.h b/TAO/orbsvcs/orbsvcs/Security/security_export.h
new file mode 100644
index 00000000000..af588c4850a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Security/security_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_SECURITY_EXPORT_H
+#define TAO_SECURITY_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_SECURITY_HAS_DLL)
+# define TAO_SECURITY_HAS_DLL 0
+# endif /* ! TAO_SECURITY_HAS_DLL */
+#else
+# if !defined (TAO_SECURITY_HAS_DLL)
+# define TAO_SECURITY_HAS_DLL 1
+# endif /* ! TAO_SECURITY_HAS_DLL */
+#endif
+
+#if defined (TAO_SECURITY_HAS_DLL) && (TAO_SECURITY_HAS_DLL == 1)
+# if defined (TAO_SECURITY_BUILD_DLL)
+# define TAO_Security_Export ACE_Proper_Export_Flag
+# define TAO_SECURITY_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_SECURITY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_SECURITY_BUILD_DLL */
+# define TAO_Security_Export ACE_Proper_Import_Flag
+# define TAO_SECURITY_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_SECURITY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_SECURITY_BUILD_DLL */
+#else /* TAO_SECURITY_HAS_DLL == 1 */
+# define TAO_Security_Export
+# define TAO_SECURITY_SINGLETON_DECLARATION(T)
+# define TAO_SECURITY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_SECURITY_HAS_DLL == 1 */
+
+#endif /* TAO_SECURITY_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/SecurityAdmin.idl b/TAO/orbsvcs/orbsvcs/SecurityAdmin.idl
new file mode 100644
index 00000000000..f215aa6868b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SecurityAdmin.idl
@@ -0,0 +1,143 @@
+// -*- C++ -*-
+//
+// $Id$
+
+
+#ifdef _SECURITY_ADMIN_IDL_
+#define _SECURITY_ADMIN_IDL_
+
+#include <SecurityLevel2.idl>
+
+#pragma prefix "omg.org"
+
+module SecurityAdmin {
+
+# pragma version SecurityAdmin 1.5
+
+ // interface AccessPolicy
+ interface AccessPolicy : CORBA::Policy {
+
+# pragma version AccessPolicy 1.5
+
+ Security::RightsList get_effective_rights (
+ in Security::AttributeList attrib_list,
+ in Security::ExtensibleFamily rights_family
+ );
+
+ Security::RightsList get_all_effective_rights(
+ in Security::AttributeList attrib_list
+ );
+ };
+
+ // interface DomainAccessPolicy
+ interface DomainAccessPolicy : AccessPolicy {
+
+# pragma version DomainAccessPolicy 1.5
+
+ void grant_rights(
+ in Security::SecAttribute priv_attr,
+ in Security::DelegationState del_state,
+ in Security::ExtensibleFamily rights_family,
+ in Security::RightsList rights
+ );
+
+ void revoke_rights(
+ in Security::SecAttribute priv_attr,
+ in Security::DelegationState del_state,
+ in Security::ExtensibleFamily rights_family,
+ in Security::RightsList rights
+ );
+
+ void replace_rights (
+ in Security::SecAttribute priv_attr,
+ in Security::DelegationState del_state,
+ in Security::ExtensibleFamily rights_family,
+ in Security::RightsList rights
+ );
+
+ Security::RightsList get_rights (
+ in Security::SecAttribute priv_attr,
+ in Security::DelegationState del_state,
+ in Security::ExtensibleFamily rights_family
+ );
+
+ Security::RightsList get_all_rights(
+ in Security::SecAttribute priv_attr,
+ in Security::DelegationState del_state
+ );
+ };
+
+ // interface AuditPolicy
+ interface AuditPolicy : CORBA::Policy {
+
+# pragma version AuditPolicy 1.5
+
+ void set_audit_selectors (
+ in CORBA::RepositoryId object_type,
+ in Security::AuditEventTypeList events,
+ in Security::SelectorValueList selectors,
+ in Security::AuditCombinator audit_combinator
+ );
+
+ void clear_audit_selectors (
+ in CORBA::RepositoryId object_type,
+ in Security::AuditEventTypeList events
+ );
+
+ void replace_audit_selectors (
+ in CORBA::RepositoryId object_type,
+ in Security::AuditEventTypeList events,
+ in Security::SelectorValueList selectors,
+ in Security::AuditCombinator audit_combinator
+ );
+
+ void get_audit_selectors (
+ in CORBA::RepositoryId object_type,
+ in Security::AuditEventTypeList events,
+ in Security::SelectorValueList selectors,
+ in Security::AuditCombinator audit_combinator
+ );
+
+ void set_audit_channel (
+ in Security::AuditChannelId audit_channel_id
+ );
+ };
+
+ // interface SecureInvocationPolicy
+ interface SecureInvocationPolicy : CORBA::Policy {
+
+# pragma version SecureInvocationPolicy 1.5
+
+ void set_association_options(
+ in CORBA::RepositoryId object_type,
+ in Security::RequiresSupports requires_supports,
+ in Security::CommunicationDirection direction,
+ in Security::AssociationOptions options
+ );
+
+ Security::AssociationOptions get_association_options(
+ in CORBA::RepositoryID object_type,
+ in Security::RequiresSupports requires_supports,
+ in Security::CommunicationDirection direction
+ );
+ };
+
+ // interface DelegationPolicy
+ interface DelegationPolicy : CORBA::Policy {
+
+# pragma version DelegationPolicy 1.5
+
+ void set_delegation_mode(
+ in CORBA::InterfaceDef object_type,
+ in Security::DelegationMode mode
+ );
+
+ Security::DelegationMode get_delegation_mode(
+ in CORBA::RepositoryId object_type
+ );
+ };
+};
+
+#pragma prefix ""
+
+#endif /* _SECURITY_ADMIN_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/SecurityLevel1.idl b/TAO/orbsvcs/orbsvcs/SecurityLevel1.idl
new file mode 100644
index 00000000000..4f165fde1ed
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SecurityLevel1.idl
@@ -0,0 +1,31 @@
+// -*- IDL -*-
+//
+// $Id$
+
+
+#ifndef _SECURITY_LEVEL_1_IDL_
+#define _SECURITY_LEVEL_1_IDL_
+
+#include <orbsvcs/Security.idl>
+
+#pragma prefix "omg.org"
+
+module SecurityLevel1 {
+
+# pragma version SecurityLevel1 1.8
+
+ local interface Current : CORBA::Current { // Locality Constrained
+# pragma version Current 1.8
+
+ // thread specific operations
+
+ Security::AttributeList get_attributes (
+ in Security::AttributeTypeList attributes
+ );
+
+ };
+};
+
+#pragma prefix ""
+
+#endif /* _SECURITY_LEVEL_1_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/SecurityLevel2.idl b/TAO/orbsvcs/orbsvcs/SecurityLevel2.idl
new file mode 100644
index 00000000000..4826c449ed4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SecurityLevel2.idl
@@ -0,0 +1,274 @@
+// -*- IDL -*-
+//
+// $Id$
+
+
+#ifndef _SECURITY_LEVEL_2_IDL_
+#define _SECURITY_LEVEL_2_IDL_
+
+#include <orbsvcs/SecurityLevel1.idl>
+
+#pragma prefix "omg.org"
+
+module SecurityLevel2 {
+
+# pragma version SecurityLevel2 1.8
+
+ // Forward declaration of interfaces
+ local interface PrincipalAuthenticator;
+ local interface Credentials;
+ local interface Current;
+
+ // Interface PrincipalAuthenticator
+ local interface PrincipalAuthenticator {
+# pragma version PrincipalAuthenticator 1.8
+
+ Security::AuthenticationMethodList
+ get_supported_authen_methods(
+ in Security::MechanismType mechanism
+ );
+
+ Security::AuthenticationStatus authenticate (
+ in Security::AuthenticationMethod method,
+ in Security::MechanismType mechanism,
+ in Security::SecurityName security_name,
+ in any auth_data,
+ in Security::AttributeList privileges,
+ out Credentials creds,
+ out any continuation_data,
+ out any auth_specific_data
+ );
+
+ Security::AuthenticationStatus continue_authentication (
+ in any response_data,
+ in Credentials creds,
+ out any continuation_data,
+ out any auth_specific_data
+ );
+ };
+
+
+ // Interface Credentials
+ local interface Credentials {
+# pragma version Credentials 1.8
+
+ Credentials copy ();
+
+ void destroy();
+
+ readonly attribute Security::InvocationCredentialsType
+ credentials_type;
+
+ readonly attribute Security::AuthenticationStatus
+ authentication_state;
+
+ readonly attribute Security::MechanismType mechanism;
+
+ attribute Security::AssociationOptions
+ accepting_options_supported;
+
+ attribute Security::AssociationOptions
+ accepting_options_required;
+
+ attribute Security::AssociationOptions
+ invocation_options_supported;
+
+ attribute Security::AssociationOptions
+ invocation_options_required;
+
+ boolean get_security_feature (
+ in Security::CommunicationDirection direction,
+ in Security::SecurityFeature feature
+ );
+
+ boolean set_attributes (
+ in Security::AttributeList requested_attributes,
+ out Security::AttributeList actual_attributes
+ );
+
+ Security::AttributeList get_attributes (
+ in Security::AttributeTypeList attributes
+ );
+
+ boolean is_valid (out Security::UtcT expiry_time);
+
+ boolean refresh (in any refresh_data);
+
+ };
+
+ typedef sequence <Credentials> CredentialsList;
+
+ local interface ReceivedCredentials : Credentials {
+
+# pragma version ReceivedCredentials 1.8
+
+ readonly attribute Credentials accepting_credentials;
+
+ readonly attribute Security::AssociationOptions
+ association_options_used;
+
+ readonly attribute Security::DelegationState delegation_state;
+
+ readonly attribute Security::DelegationMode delegation_mode;
+
+ };
+
+ local interface TargetCredentials : Credentials {
+
+# pragma version TargetCredentials 1.8
+
+ readonly attribute Credentials initiating_credentials;
+
+ readonly attribute Security::AssociationOptions
+ association_options_used;
+
+ };
+
+ // RequiredRights Interface
+ interface RequiredRights {
+
+ void get_required_rights(
+ in Object obj,
+ in CORBA::Identifier operation_name,
+ in CORBA::RepositoryId interface_name,
+ out Security::RightsList rights,
+ out Security::RightsCombinator rights_combinator
+ );
+
+ void set_required_rights(
+ in CORBA::Identifier operation_name,
+ in CORBA::RepositoryId interface_name,
+ in Security::RightsList rights,
+ in Security::RightsCombinator rights_combinator
+ );
+ };
+
+
+ // interface audit channel
+ local interface AuditChannel {
+
+# pragma version AuditChannel 1.8
+
+ void audit_write (
+ in Security::AuditEventType event_type,
+ in CredentialsList creds,
+ in Security::UtcT time,
+ in Security::SelectorValueList descriptors,
+ in any event_specific_data
+ );
+
+ readonly attribute Security::AuditChannelId audit_channel_id;
+
+ };
+
+
+ // interface for Audit Decision
+ local interface AuditDecision {
+
+# pragma version AuditDecision 1.8
+
+ boolean audit_needed (
+ in Security::AuditEventType event_type,
+ in Security::SelectorValueList value_list
+ );
+
+ readonly attribute AuditChannel audit_channel;
+
+ };
+
+
+ local interface AccessDecision {
+
+# pragma version AccessDecision 1.8
+
+ boolean access_allowed (
+ in SecurityLevel2::CredentialsList cred_list,
+ in Object target,
+ in CORBA::Identifier operation_name,
+ in CORBA::Identifier target_interface_name
+ );
+ };
+
+
+ // Policy interfaces to control bindings
+
+ local interface QOPPolicy : CORBA::Policy {
+# pragma version QOPPolicy 1.8
+ readonly attribute Security::QOP qop;
+
+ };
+
+ local interface MechanismPolicy : CORBA::Policy {
+# pragma version MechanismPolicy 1.8
+ readonly attribute Security::MechanismTypeList mechanisms;
+ };
+
+ local interface InvocationCredentialsPolicy : CORBA::Policy {
+# pragma version InvocationCredentialsPolicy 1.8
+ readonly attribute CredentialsList creds;
+ };
+
+ local interface EstablishTrustPolicy : CORBA::Policy {
+# pragma version EstablishTrustPolicy 1.8
+ readonly attribute Security::EstablishTrust trust;
+ };
+
+ local interface DelegationDirectivePolicy : CORBA::Policy {
+# pragma version DelegationDirectivePolicy 1.8
+ readonly attribute Security::DelegationDirective delegation_directive;
+ };
+
+ local interface SecurityManager {
+
+# pragma version SecurityManager 1.8
+
+ // Process/Capsule/ORB Instance specific operations
+
+ readonly attribute Security::MechandOptionsList
+ supported_mechanisms;
+
+ readonly attribute CredentialsList own_credentials;
+
+ readonly attribute RequiredRights
+ required_rights_object;
+
+ readonly attribute PrincipalAuthenticator
+ principal_authenticator;
+
+ readonly attribute AccessDecision
+ access_decision;
+
+ readonly attribute AuditDecision
+ audit_decision;
+
+ TargetCredentials get_target_credentials (
+ in Object obj_ref
+ );
+
+ void remove_own_credentials(
+ in Credentials creds
+ );
+
+ CORBA::Policy get_security_policy (
+ in CORBA::PolicyType policy_type
+ );
+ };
+
+ // Interface Current derived from SecurityLevel1::Current providing
+ // additional operations on Current at this security level.
+ // This is implemented by the ORB
+ local interface Current : SecurityLevel1::Current {
+
+# pragma version Current 1.8
+
+ // Thread specific
+
+ readonly attribute ReceivedCredentials received_credentials;
+
+ };
+
+};
+
+#pragma prefix ""
+
+#endif /* _SECURITY_LEVEL_2_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/SecurityLevel3.idl b/TAO/orbsvcs/orbsvcs/SecurityLevel3.idl
new file mode 100644
index 00000000000..58a1162f82e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SecurityLevel3.idl
@@ -0,0 +1,2037 @@
+//tabstop=4
+//***********************************************************************
+// ORBAsec SL3
+// ----------------------------------------------------------------------
+// Copyright (C) 2001 Adiron, LLC.
+// All rights reserved.
+// ----------------------------------------------------------------------
+// $Id$
+//***********************************************************************
+
+//***********************************************************************
+/**
+ * @note Some interfaces in this IDL module have been altered from the
+ * original Adiron sources.
+ */
+//***********************************************************************
+
+
+#ifndef _SecurityLevel3_
+#define _SecurityLevel3_
+
+#include "tao/Policy.pidl"
+#include "tao/TimeBase.pidl"
+
+#pragma prefix "adiron.com"
+
+/**
+ * The Security Level 3 module contains the data definitions and
+ * the Application Programmers Interface for dealing with the
+ * ORBAsec SL3 Security, and the new CSIv2 Security Protocol, which has
+ * been adopted by the OMG.
+ * <p>
+ * The SecurityLevel3 interfaces and its security data structures
+ * are based on the Principal Calculus. This is a mathematical
+ * model of representing principals for the use of access control
+ * and auditing.
+ * <p>
+ * The SecurityLevel3 Security Service is represented by two objects
+ * that are returned by the ORB's resolve_initial_reference call.
+ * Those two objects are the SecurityManager and the SecurityCurrent.
+ * Other objects associated with the security service emanate from
+ * these two objects.
+ * <p>
+ * The SecurityLevel3 Security Service has a Credentials model. This
+ * model, which is heavily based on the Principal Calculus, yields
+ * an API for accessing principal information. The credentials
+ * represent a principal's credentials, as well as the establishment
+ * of security contexts between client and servers.
+ * <p>
+ * The SecurityLevel3 Security Service is currently CSIv2 Level 2
+ * compliant:
+ * <ul>
+ * <li>
+ * It works over TLS and plain TCPIP.
+ * <li>
+ * It handles the GSSUP (Username/Password) mechanism for
+ * CSI level Client Authentication.
+ * <li>
+ * It has the ability to "quote" an identity, i.e. CSIv2
+ * Identity Assertion.
+ * <li>
+ * It has the ability to "push" privileges, which it does
+ * ATLAS enabled servers.
+ * <li>
+ * It has the ability to install your own authorization
+ * token process that can allow for delegation.
+ * </ul>
+ * <p>
+ * The Security Level 3 ORB Security Service does supports retention
+ * of CSI state. Client Authentication information and Identity
+ * assertion information is transmitted on each request.
+ * <p>
+ * The Security Level 3 ORB Security Service does not automatically
+ * support endorsement at this time (CSIv2 Level 2 compliance), but
+ * does give you facility to do so.
+ */
+module SecurityLevel3 {
+
+ /**
+ * The Adiron VMCID, which is used in Minor Error Codes,
+ * Policy Tags, etc.
+ */
+ const unsigned long ADIRON_VMCID = 0xA11C000;
+
+ //-------------------------------------------------------------
+ // Security Level 3 Data Representations
+ //
+ //-------------------------------------------------------------
+
+ //
+ // A Principal Name
+ // A principal name always has a type, and a path of
+ // name components. They are ordered from least significant
+ // to most significant. For example, if a principal is represented
+ // by a single X.509 certificate, the first element in the path
+ // is the SubjectDN, and the second is the IssuerDN.
+ //
+ /**
+ * A NameType is used for typing a PrincipalName data structure.
+ * A NameType is a string that represents an ASN.1
+ * OBJECT IDENTIFIER. Its representation usually of the form
+ * "oid:1.2.3.4". Other forms may be possible. It is used
+ * for encoding name type identifiers, which are ASN.1 DER encoded
+ * OBJECT IDENTIFIERs, in the CSI protocol.
+ * @see NameComponent
+ * @see NamePath
+ * @see NameValue
+ * @see PrincipalName
+ */
+ typedef string NameType;
+
+ /**
+ * A NameComponent is an ordered component of a NamePath. The
+ * least significant component is always the first component.
+ * It is the type of a wstring to handle international character
+ * values.
+ * @see NameType
+ * @see NamePath
+ * @see NameValue
+ * @see PrincipalName
+ */
+ typedef wstring NameComponent;
+
+ /**
+ * A NamePath is an ordered collection of NameComponents, ordered
+ * from the least significant to most significant. For example,
+ * an identity that is defined by a certificate that has a
+ * SubjectDN of "C=US,CN=Joe,O=Adiron" and an IssuerDN of
+ * "C=US,CN=AdironCA,O=Adiron" will have the following
+ * name components:
+ * <pre>
+ * NameComponent[0] = "C=US,CN=Joe,O=Adiron"
+ * NameComponent[1] = "C=US,CN=AdironCA,O=Adiron"
+ * </pre>
+ * @see NameType
+ * @see NameComponent
+ * @see NameValue
+ * @see PrincipalName
+ */
+ typedef sequence<NameComponent> NamePath;
+
+ /**
+ * A NameValue is the value component of a PrincipalName,
+ * which is a "type-value" pair. It is defined as a NamePath.
+ * @see NameType
+ * @see NameComponent
+ * @see NamePath
+ * @see PrincipalName
+ */
+ typedef NamePath NameValue;
+
+ /**
+ * A PrincipalName is a "type-value" structure. The type directs
+ * what the encoding and format of the components in the the
+ * value component are. For example, a type of "X509DirectoryPath"
+ * means that the value contains the DNs of the subject and
+ * subsequent issuers.
+ * @see NameType
+ * @see NameComponent
+ * @see NamePath
+ * @see NameValue
+ */
+ struct PrincipalName {
+ NameType the_type;
+ NameValue the_name;
+ };
+
+ /**
+ * A list of PrincipalNames.
+ * @see PrincipalName
+ */
+ typedef sequence<PrincipalName> PrincipalNameList;
+
+
+ //
+ // Attributes for privileges and other things. They are type value pairs.
+ //
+
+ /**
+ * A PrinAttribute is a "type-value" pair, usually attributed to
+ * a Principal by some means, such as values stored in its certificate
+ * or environmental concerns, such as the channel the principal was
+ * authenticated over.
+ * <p>
+ * The type of a PrinAttribute is represented by a string.
+ * <p>
+ * Privilege Attribute Types, that might come from X.509 certificates
+ * might be represented by OIDs. OIDs are represented as:
+ * <pre>
+ * oid:n1.n2.n3.n4.n5.n6....
+ * for an OID where ni are non-negative integers.
+ * </pre>
+ * These OIDs are meant to be used to direct the "type-value" encoding
+ * of a GSS-API ExportName, which uses an OID as a type that directs
+ * the encoding of the value.
+ * <p>
+ * Example Environmental Attribute Types
+ * <p><pre>
+ * SL3:ChannelIdentifier
+ * SL3:LocalAddress
+ * SL3:LocalPort
+ * SL3:TransportMechanism
+ * SL3:TLSCipherSuite
+ * </pre>
+ * @see PrinAttribute
+ */
+ typedef string PrinAttributeType;
+
+ /**
+ * A PrinAttributeValue is a wide character string that encodes
+ * or decodes the value of an attribute. An attempt is always
+ * meant to represent an attribute's value in a human readable
+ * string form. If the value cannot be decoded this way, and its
+ * native form is binary, then it is represented in a Hex encoding
+ * of the binary form.
+ * @see PrinAttribute
+ */
+ typedef wstring PrinAttributeValue;
+
+ /**
+ * A PrinAttribute is a "type-value" pair, usually attributed to
+ * a Principal by some means, such as values stored in its certificate
+ * or environmental concerns, such as the channel the principal was
+ * authenticated over.
+ * @see PrinAttribute
+ */
+ struct PrinAttribute {
+ PrinAttributeType the_type;
+ PrinAttributeValue the_value;
+ };
+
+ /**
+ * A list of PrinAttributes.
+ * @see PrinAttribute
+ */
+ typedef sequence<PrinAttribute> PrinAttributeList;
+
+
+ /**
+ * This is just a sequence of strings that make
+ * up the components of a ResourceName.
+ * @see ResourceName
+ */
+ typedef sequence<string> ResourceNameComponents;
+
+ /**
+ * A ResourceName is the constructed name of a "resource". A
+ * ResourceName is closely modeled after CORBAmed's Resource
+ * Access Decision (RAD) facility's "Resource". It contains
+ * a sequence of strings.
+ */
+ struct ResourceName {
+ ResourceNameComponents components;
+ };
+
+ /**
+ * A List of Resource Names.
+ * @See ResourceName
+ */
+ typedef sequence<ResourceName> ResourceNameList;
+
+
+ //
+ // NameTypes used in SL3
+ //
+
+ /**
+ * An NT_KerberosName is a NameType that signifies that the
+ * value of a PrincipalName is a Kerberos formated name.
+ * A KerberosName is a single string encoded in the
+ * familiar "name@REALM" format.
+ * <p>
+ * From GSS-Kerboeros RFC 1964:
+ * <p>
+ * 2.1.1. Kerberos Principal Name Form
+ * <p>
+ * This name form shall be represented by the Object Identifier {iso(1)
+ * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
+ * krb5(2) krb5_name(1)}.
+ */
+ const NameType NT_KerberosName = "oid:1.2.840.113554.1.2.2.1";
+
+ /**
+ * An NT_X509DirectoryNamePath is a NameType that signifies that
+ * the value of a PrincipalName is constructed from a chain
+ * of certificates, such that the end entity is the least
+ * significant position, with the subsequent issuers following
+ * in order of signature.
+ * <p>
+ * The coding of the names is the string encoding of
+ * complete X.500 DN's, such as "C=US, CN=Joe, O=Adiron".
+ * There is no indication whether the last DN in the path is a
+ * "root", i.e. it's issuer is the same.
+ */
+ const NameType NT_X509DirectoryNamePath = "SL3:X509DirectoryPathName";
+
+ /**
+ * The NT_Anonymous is a name type that specifies that the
+ * PrincipalName is representing the "anonymous" principal.
+ * Its value always as a single name component of "anonymous"
+ */
+ const NameType NT_Anonymous = "SL3:anonymous";
+
+ /**
+ * The NT_StringName is a NameType that specifies that the
+ * PrincipalName is represented by a single NameComponent
+ * of name in a "scoped" name space. The name and scope
+ * are separated by a single "@" character. The escape character
+ * is "\". This string name as we call it is the same form
+ * used for the GSSUP (GSS-UserPassword NameType). This
+ * oid is the OID defined by the OMG CSIv2 specification. It
+ * is the value defined by the CSI::GSS_NT_Scoped_Username_OID
+ * constant.
+ */
+ const NameType NT_StringName = "oid:2.23.130.1.2.1";
+
+ //
+ // Privileges
+ //
+
+ /**
+ * A ScopedPrivileges structure represents privileges that
+ * belong to a scope defined by a principal. This structure
+ * is used to represent a principal that is a privilege authority
+ * that issues privileges. Privileges are represented as
+ * PrinAttributes.
+ */
+ struct ScopedPrivileges {
+ PrincipalName privilege_authority;
+ PrinAttributeList privileges;
+ };
+
+ /**
+ * A list of ScopedPrivileges
+ * @see ScopedPrivileges
+ */
+ typedef sequence<ScopedPrivileges> ScopedPrivilegesList;
+
+ //
+ // Principals
+ //
+
+ /**
+ * A Principal comes in three forms, which correspond to the
+ * Principal Calculus. The forms are "Simple", "Quoting", and
+ * "Proxy". Simple is a principal that represents a single
+ * entity, usually "speaking for" itself. A "Quoting" principal
+ * is a "compound" principal that says that one principal is
+ * speaking on behalf of another, usually denoted by "(A|B)", i.e.
+ * "A is quoting B", which means that "A is speaking on behalf of B".
+ * A "Proxy" principal is almost the same as a "Quoting" principal.
+ * However, the security service has determined that enough evidence
+ * exists that proves that Principal A is authorized to speak in
+ * B's behalf. This principal is denoted in the calculus as "(A for B)"
+ * in contrast to the quoting principal "(A|B)".
+ */
+ typedef unsigned long PrincipalType;
+
+ /**
+ * The Simple Principal Type (A)
+ * @see PrincipalType
+ */
+ const PrincipalType PT_Simple = 0; // A, valuetype SimplePrincipal
+ /**
+ * The Quoting Principal Type (A|B)
+ * @see PrincipalType
+ */
+ const PrincipalType PT_Quoting = 1; // B | A, valuetype QuotingPrincipal
+ /**
+ * The Proxy Principal Type (A for B)
+ * @see PrincipalType
+ */
+ const PrincipalType PT_Proxy = 2; // B for A, valuetype ProxyPrincipal
+
+ /**
+ * A Principal is represented by a base value type, which is extended
+ * for the various principals, Simple, Quoting, and Proxy. This base
+ * type of a Principal may be sufficient for access control in
+ * most systems.
+ * @param the_type contains the corresponding identifier
+ * @param the_name contains the logical name of the most derived
+ * Principal. Such as if the Principal is a nested
+ * ProxyPrincipal (i.e. C for B for A) the name here
+ * is A.
+ * @param environmental_attributes
+ * The attributes name certain things that do are
+ * environmental, such as IP addresses.
+ * @param with_privileges
+ * These are the privileges associated with Principal A
+ * restricted_resources.
+ * This attribute contains a collection of resources on which
+ * the principal is authorized to perform actions.
+ */
+ valuetype Principal {
+ /** This field contains the type of the Principal. */
+ public PrincipalType the_type;
+ /** This field contains the name of the Principal */
+ public PrincipalName the_name;
+ /**
+ * This field contains the attributes of the principal
+ * that are considered environmental, such as authentication
+ * mechanism, authentication channel identifier, etc.
+ */
+ public PrinAttributeList environmental_attributes;
+ /**
+ * This field contains the list of scoped privileges the
+ * security service has determined belong to the particular
+ * principal.
+ */
+ public ScopedPrivilegesList with_privileges;
+ };
+
+ /**
+ * A list of Principals.
+ * @see Principal
+ */
+ typedef sequence<Principal> PrincipalList;
+
+ /**
+ * A Simple Principal represents a single entity. It is usually
+ * derived by credentials acquisition, authentication, trust rules concerning quoting,
+ * or trust rules and certificates concerning Proxying.
+ * It has one extra field over the base Principal, which is
+ * "alternate_names".
+ */
+ valuetype SimplePrincipal : /* truncatable */ Principal {
+ /**
+ * This field indicates whether the principal was derived or is
+ * going to be derived from an authentication mechanism.
+ * <p>
+ * If the <code>SimplePrincipal</code> is directly or indirectly
+ * (as part of a composite <code>Principal</code>) in the
+ * <code>ClientCredentials.client_principal<code> or
+ * <code>TargetCredentials.target_principal<code> field,
+ * the <code>authenticated</code> field indicates the authentication
+ * status of the <code>SimplePrincipal</code> in the client or target
+ * principal, respectively.
+ * <p>
+ * If the <code>SimplePricipal</code> is directly or indirectly in
+ * the <code>ClientCredentials.target_principal<code>
+ * (or <code>TargetCredentials.client_principal<code>) field,
+ * the <code>authenticated</code> field indicates the target's
+ * (or client's belief) about its authentication status to the other
+ * party.
+ * <p>
+ * If the <code>SimplePrincipal</code> is directly or indirectly in
+ * the <code>the_principal</code> field of the initiator or acceptor
+ * of <code>OwnCredentials</code>, the <code>authenticated</code>
+ * field indicates the expectation of being authenticated to the other
+ * side of the communication when the initiator or acceptor is used.
+ * <p>
+ * If the <code>SimplePrincipal</code> is directly or indirectly in
+ * the <code>the_principal</code> field of a
+ * <code>PrincipalIdentityStatement</code>,
+ * the <code>authenticated</code> field indicates only the
+ * "best effort" of knowing whether the principal has been possibly
+ * authenticated or not. In other word, if this field is
+ * <code>TRUE</code>, it is for sure that the principal has been
+ * authenticated (or is expecting to be authenticated).
+ * If this field is <code>FALSE</code>, the principal may or may not
+ * have been authenticated. The reason for this ambiguity is that
+ * a <code>PrincipalIdentityStatement</code> may be created before
+ * the authentication of the principal being performed. In general,
+ * the <code>authenticated</code> field of a
+ * <code>SimplePrincipal</code> inside the <code>the_principal</code>
+ * field of a <code>PrincipalIdentityStatement</code> should not be
+ * taken as a definite answer for the authentication status of the
+ * <code>SimplePrincipal</code>.
+ *
+ * @see ClientCredentials.client_authentication
+ * @see ClientCredentials.target_authentication
+ * @see TargetCredentials.client_authentication
+ * @see TargetCredentials.target_authentication
+ */
+ // For example, if a client uses the User/Password mechanism to
+ // communicate with a target, the client's OwnCredentials, created
+ // using a PasswordGenerator, will have the <code>authenticated</code>
+ // field in the principal in the initiator being true,
+ // although the client may not have been authenticated to the target.
+ //
+ public boolean authenticated;
+ /**
+ * This field contains the other name types, such as
+ * that appear in the X.509 alternate name fields.
+ */
+ public PrincipalNameList alternate_names;
+
+ };
+
+ /**
+ * A ProxyPrincipal represents a principal that speaks for another.
+ * The principal is proved that it is authorized to speak for another.
+ * The system believes this, either by trust rules of its own,
+ * or by delivered endorsement from the principal such as
+ * Principal (B for A) where the endorsement takes the form
+ * in the Principal Calculus as (T says B serves A)
+ * where T is some entity trusted by the security service
+ * to make those statements.
+ * <p>
+ * Important: This valuetype extends the Principal value type. The
+ * <code>the_name</code> filed of this object will contain the name of the
+ * <code>speaks_for</code> principal, as that is the name most access control
+ * systems would care about. Therefore, this value type can be
+ * truncated by access control systems that do not want to
+ * examine the principal in detail.
+ */
+ valuetype ProxyPrincipal : /* truncatable */ Principal {
+
+ /**
+ * In a Proxy Principal of (A for B) the <code>speaking</code> field
+ * represents the principal A.
+ */
+ public Principal speaking;
+
+ /**
+ * In a Proxy Principal of (A for B) the <code>speaks_for</code> field
+ * represents the principal B.
+ */
+ public Principal speaks_for;
+
+ };
+
+ /**
+ * A QuotingPrincipal represents a principal that speaks for another.
+ * The principal is not proved that it is authorized to speak for another.
+ * The system derives principals like this based on statements in the
+ * Pricipal Calculus, such as "A says B says r", which results in the
+ * quoting principal (A|B) says r, where "r" is a statement, such as
+ * a CORBA request. The security service derives principals like
+ * this from the CSI Identity Assertion mechanism.
+ * <p>
+ * Important: This valuetype extends the Principal value type. The
+ * <code>the_name</code> filed of this object will contain the name of the
+ * <code>quotes_for</code> principal, as that is the name most access control
+ * systems would care about. Therefore, this value type can be
+ * truncated by access control systems that do not want to
+ * examine the principal in detail.
+ */
+ valuetype QuotingPrincipal : /* truncatable */ Principal {
+
+ /**
+ * In a Quoting Principal of (A|B) the <code>speaking</code> field
+ * represents the principal A.
+ */
+ public Principal speaking;
+
+ /**
+ * In a Quoting Principal of (A|B) the <code>quotes_for</code> field
+ * represents the principal B.
+ */
+ public Principal quotes_for;
+
+ };
+
+ //
+ // Statements
+ //
+
+ /**
+ * A Statement is a value type that has extensions which
+ * represent the different relevant data directed by its StatementType.
+ * There are two basic Statement Types, an IdentityStatement and
+ * an EndorsementStatement. An identity statement is a statement that
+ * asserts an identity. It may represent a the components of
+ * an X.509 certificate during an authentication. An EndorsementStatement
+ * may represent the contents of an X.509 AttributeCertificate or
+ * some other notion of an endorsement, such as a certificate in
+ * BizTalk XML.
+ * <p>
+ * Statements are contained in the Credentials Objects. They
+ * represent pieces of evidence collected from which the security
+ * service deduces the Principal of the Credentials Objects.
+ */
+ typedef unsigned long StatementType;
+
+ /**
+ * The Identity Statement Type.
+ * <p>
+ * A statement of this type at least extends to the
+ * IdentityStatement valuetype, if not truncated
+ * @see IdentityStatement
+ */
+ const StatementType ST_IdentityStatement = 1; //valuetype IdentityStatement
+
+ /**
+ * The Endorsement Statement Type.
+ * <p>
+ * A statement of this type at least extends to the
+ * EndorsementStatement valuetype, if not truncated
+ * @see EndorsementStatement
+ */
+ const StatementType ST_EndorsementStatement = 2; //valuetype EndorsementStatement
+
+ /**
+ * An encoding is a sequence of bytes.
+ */
+ typedef sequence<octet> Encoding;
+
+ /**
+ * Statement encoding type.
+ * <p>
+ * Statements carry their original encoding information, if
+ * they came from an encoding, such as list of X.509 identity
+ * certificates (i.e. a chain). The encoding type may be derivable
+ * from the encoding itself. For example, it's easy to tell the
+ * difference between a PEM encoded certificate, and a DER encoded
+ * certificate. Therefore, the encoding type may default to "Unknown".
+ * Other types may exist than the ones provided as constants in
+ * this module.
+ */
+ typedef string EncodingType;
+
+ /**
+ * The ET_NoEncoding type signifies that the statement
+ * has been generated solely by the security service
+ * and has no encoding.
+ */
+ const EncodingType ET_NoEncoding = "NoEncoding";
+
+ /**
+ * The ET_Unknown encoding type may always be used if the encoding
+ * type can only be figured out from encoding itself.
+ */
+ const EncodingType ET_Unknown = "Unknown";
+
+ /**
+ * User Exception for a bad encoding.
+ */
+ exception BadEncoding {};
+
+ /**
+ * User Exception for a bad or unsupported encoding type.
+ */
+ exception BadEncodingType {};
+
+ /**
+ * The Statement Layer is the layer of the protocol or security
+ * service from which the statement emanated, derived, or was collected.
+ */
+ typedef unsigned long StatementLayer;
+
+ /**
+ * Default type for a Statement Layer
+ */
+ const StatementLayer SL_Unknown = 0;
+ /**
+ * The SL_Transport statement type signifies that the associated
+ * statement is derived from the transport layer, such as
+ * an X.509 Certificate from a TLS handshake.
+ */
+ const StatementLayer SL_Transport = 1;
+ /**
+ * The SL_CSIAuthorization statement type signifies that the associated
+ * statement is derived from the CSI Authorization Layer in the CSIv2
+ * protocol.
+ */
+ const StatementLayer SL_CSIAuthorization = 2;
+ /**
+ * The SL_CSIClientAuth statement type signifies that the associated
+ * statement is derived from the CSI Client Authentication Layer
+ * in the CSIv2 protocol.
+ */
+ const StatementLayer SL_CSIClientAuth = 3;
+ /**
+ * The SL_CSIIdentity statement type signifies that the associated
+ * statement is derived from the CSI Identity Assertion Layer
+ * in the CSIv2 protocol.
+ */
+ const StatementLayer SL_CSIIdentity = 4;
+
+ /**
+ * The SL_UserDefined statement layer signifies that the associate
+ * statement is derived or created by a user or some other
+ * entity than the security service.
+ */
+ const StatementLayer SL_UserDefined = 5;
+
+ /**
+ * The Statement base type contains the information common
+ * to all statements. A statement has an "external" encoding, such
+ * as an X509 Certificate. Some statements may not have an encoding,
+ * but its extension may carry the pertinent marshable information,
+ * such as a PrincipalIdentityStatement for anonymous, which is
+ * generated by the security service.
+ */
+ valuetype Statement {
+ /**
+ * This field contains an identifier of the
+ * service layer that generated the statement.
+ * The layer that generated or delivered
+ * the statement, i.e. Transport, CSIv2 Authentication,
+ * CSIv2 Authorization, or CSIv2 Identity Assertion.
+ */
+ public StatementLayer the_layer;
+ /**
+ * The type of statement, which indicates its extension
+ * such as an Identity Statement or an Endorsement
+ * Statement.
+ */
+ public StatementType the_type;
+ /**
+ * This field indicates the type of encoding.
+ * The encoding may be contrived, at the encoding
+ * may not exist, however, the extension of the
+ * statement type may contain data that can
+ * be marshaled across the wire. See the Principal
+ * Identity Statement.
+ */
+ private EncodingType encoding_type;
+ /**
+ * The bytes of the encoding, if it exists.
+ */
+ private Encoding the_encoding;
+
+ /**
+ * Returns the encoding type
+ */
+ EncodingType get_encoding_type();
+
+ /**
+ * Returns an encoding of this statement. Some implementations
+ * may be able to convert. Using and encoding_type of
+ * ET_Unknown, will always yield the default encoding,
+ * if it exists. If the encoding does not exist,
+ * a successful return containing an empty
+ * sequence will result.
+ */
+ Encoding get_encoding(
+ in EncodingType encoding_type
+ ) raises (
+ BadEncodingType
+ );
+
+ /**
+ * This factory method allows users to create their
+ * own Statements from an encoding. The statements created
+ * by this factory method may have a type which is a further
+ * extension of the valuetype Statement.
+ */
+ factory create(
+ in EncodingType encoding_type,
+ in Encoding the_encoding
+ );
+ };
+ typedef sequence<Statement> StatementList;
+
+ /**
+ * The Identity Statement further classifies the encoding
+ * as a statement that if verified asserts an identity.
+ */
+ valuetype IdentityStatement : Statement {
+ /**
+ * This field contains a possibly well known identifier that
+ * may aid in the interpretation of the identity statement's
+ * encoding. It may be an empty string, which signifies that
+ * there is no known interpretation aid for the encoding, or
+ * that there is no encoding.
+ */
+ public string interpretation_aid;
+ };
+
+ /**
+ * The Principal Identity Statement is the minimal version of an
+ * Identity statement that asserts a single identity that the
+ * security service can translate into a principal.
+ * <p>
+ * An example of an identity statement is an X.509 certificate in
+ * which its attributes are exposed into the principal, such as
+ * privileges. This valuetype may also be further extended by the
+ * security service depending on its encoding and the capabilities
+ * of the security service.
+ */
+ valuetype PrincipalIdentityStatement : IdentityStatement {
+ public Principal the_principal;
+ };
+
+ /**
+ * The Endorsement Statement is a statement that is used for
+ * authorization. An Endorsement statement endorses a
+ * principal with certain characteristics, such as privileges
+ * or the authority to act on behalf of another principal, sometimes
+ * called "delegation".
+ * <p>
+ * According to our research, an endorsement statement may be a
+ * complex entity containing matching rules for the endorsement.
+ * An endorsement may have the following general form:
+ * <pre>
+ * I says Principal A matching [(P1 with [p1,...,pn]) or ....]
+ * speaks_for
+ * Principal B matching [(T1 with [t1,...,tn]) or ... ]
+ * has [s1,...,sm]
+ * on Resources matching [R1, .... Rn]
+ * </pre>
+ * Actual semantic reduction of principals is directed by the
+ * the matching rules, and may depend on other statements as well,
+ * such as local trust rules in the security service configuration.
+ * Also, much of the capability of an endorsement statement is
+ * dependent on its encoding.
+ * <p>
+ * This approach to authorization is a largely unexplored research
+ * topic. There are not many or well known encodings of endorsement
+ * statements. Therefore, we are reluctant to produce interfaces
+ * just yet, that go beyond the encoding. However, we do expose the
+ * Endorsement statement type, which may further direct the interpretation
+ * of it's encoding.
+ */
+ valuetype EndorsementStatement : Statement {
+ /**
+ * This field contains a possibly well known identifier that
+ * may aid in the interpretation of the identity statement's
+ * encoding. It may be an empty string, which signifies that
+ * there is no known interpretation aid for the encoding, or
+ * that there is no encoding.
+ */
+ public string interpretation_aid;
+ };
+
+ /**
+ * An X509IdentityStatement is one that extends the Principal Identity
+ * Statement. If one does get an X509 IdentityStatement, it is
+ * currently supported with IAIK in both DER and PEM formats.
+ */
+ valuetype X509IdentityStatement : PrincipalIdentityStatement {
+ /**
+ * This factory method allows users to create their
+ * own X509Identity statements from an encoding.
+ */
+ factory create(
+ in EncodingType encoding_type,
+ in Encoding the_encoding
+ );
+ };
+ typedef sequence<X509IdentityStatement> X509IdentityStatementList;
+
+ //-------------------------------------------------------------
+ // Security Level 3 Application Users Interface
+ //
+ //-------------------------------------------------------------
+
+ //
+ // The Security Level 3 Credentials Model
+ //
+
+ /**
+ * Credentials come in three types. OwnCredentials, ClientCredentials,
+ * and TargetCredentials. OwnCredentials represent the ORB instance's
+ * credentials. Each Credentials has initiating and accepting capability.
+ * ClientCredentials represent an established security context with
+ * a client. TargetCredentials represent an established security context
+ * with a Target's Server.
+ */
+ typedef unsigned long CredentialsType;
+
+ /**
+ * The CT_OwnCredentials CredentialsType signifies that the
+ * Credentials can be extended to the OwnCredentials Type.
+ */
+ const CredentialsType CT_OwnCredentials = 0;
+ /**
+ * The CT_ClientCredentials CredentialsType signifies that the
+ * Credentials can be extended to the ClientCredentials Type.
+ */
+ const CredentialsType CT_ClientCredentials = 1;
+ /**
+ * The CT_TargetCredentials CredentialsType signifies that the
+ * Credentials can be extended to the ClientCredentials Type.
+ */
+ const CredentialsType CT_TargetCredentials = 2;
+
+ /**
+ * A Credentials object has a validity state. Some credentials
+ * may be time or use dependent.
+ */
+ typedef long CredentialsState;
+
+ /**
+ * The Credentials with a CredentialsState of CS_Invalid cannot be
+ * used in any the initiating or accepting establishment of any
+ * security contexts.
+ */
+ const CredentialsState CS_Invalid = -3;
+
+ /**
+ * Credentials with a CredentialsState of CS_Expired can no longer
+ * be used for initiating or accepting establishment of any
+ * security contexts.
+ */
+ const CredentialsState CS_Expired = -2;
+ /**
+ * Credentials with a CredentialsState of CS_PendingRelease can no longer
+ * be used for initiating or accepting establishment of any
+ * security contexts. It means that "release_credentials" has been
+ * called on the credentials.
+ */
+ const CredentialsState CS_PendingRelease = -1;
+ /**
+ * Credentials with a CredentialsState of CS_Initialized cannot
+ * be used for initiating or accepting establishment of any
+ * security contexts. It means that credentials are in an initial
+ * state. This value is for internal use, and there is no
+ * reason a SecurityLevel3 user should see credentials in this state.
+ */
+ const CredentialsState CS_Initialized = 0;
+ /**
+ * Credentials with a CredentialsState of CS_Valid can
+ * be used for initiating or accepting establishment of
+ * security contexts.
+ */
+ const CredentialsState CS_Valid = 1;
+
+ /**
+ * Credentials have system generated identifiers
+ * to which they can be referred and retrieved.
+ */
+ typedef string CredentialsId;
+ typedef sequence<CredentialsId> CredentialsIdList;
+
+ /**
+ * A Context Id is a system generated unique identifier for identifying
+ * a security context to the application.
+ * Security Contexts may be long lived and not established on
+ * every request. Therefore, an identifier is assigned.
+ * <p>
+ * Note that this Context Id is not directly related to the context
+ * defined in the CSIv2 specification.
+ */
+ typedef string ContextId;
+
+ /**
+ * Credentials Usage
+ * <p>
+ * Credentials Usage refers to the concept that Credentials may
+ * be used to initiate security context, accept security contexts,
+ * or do both. its values are used in the acquisition
+ * of credentials for the purpose of designating the abilities
+ * of the credentials acquired.
+ */
+ typedef unsigned long CredentialsUsage;
+ /**
+ * The CU_Indefinite CredentialsUsage type is a value that
+ * signifies the default. Depending on some other acquisition
+ * arguments, the credentials usage may be able to be implicitly
+ * determined.
+ */
+ const CredentialsUsage CU_Indefinite = 1;
+ /**
+ * The CU_None CredentialsUsage type is a value that states the
+ * credentials cannot be used to make or accept security
+ * contexts. ClientCredentials and TargetCredentials have
+ * this credentials usage.
+ */
+ const CredentialsUsage CU_None = 2;
+ /**
+ * The CU_AcceptOnly CredentialsUsage type is a value that signifies
+ * that the credentials can only be used to accept the establishment
+ * of security contexts.
+ */
+ const CredentialsUsage CU_AcceptOnly = 3;
+ /**
+ * The CU_InitiateOnly CredentialsUsage type is a value that signifies
+ * that the credentials can only be used to initiate the establishment
+ * of security contexts.
+ */
+ const CredentialsUsage CU_InitiateOnly = 4;
+ /**
+ * The CU_InitiateAndAccept CredentialsUsage type is a value that
+ * signifies that the credentials can be used to both initiate
+ * and accept the establishment of security contexts.
+ */
+ const CredentialsUsage CU_InitiateAndAccept = 5;
+
+ /**
+ * A CredsDirective is a directive on a invocation as to the
+ * effects of the initiated security context will have on the
+ * the accepting side. Please see ContextEstablishmentPolicy
+ * for is use in context with establishing security contexts.
+ * @see ContextEstablishmentPolicy
+ */
+ typedef unsigned long CredsDirective;
+ /**
+ * The CD_Default CredsDirective is a value that signifies to
+ * use the capabilities of the selected credentials.
+ */
+ const CredsDirective CD_Default = 0;
+ /**
+ * The CD_InvokeTarget CredsDirective is a value that signifies that
+ * the selected credentials should only be used in a simple
+ * invocation fashion. They shall not attempt to endorse or embody
+ * the target to act on its behalf.
+ */
+ const CredsDirective CD_InvokeTarget = 1;
+ /**
+ * The CD_EndorseTarget CredsDirective is a value that signifies that
+ * the selected credentials, if capable, should attempt to endorse
+ * the target. In other words, it gives the accepting side the ability
+ * to act on behalf of the initiating side.
+ */
+ const CredsDirective CD_EndorseTarget = 2;
+ /**
+ * The CD_EmbodyTarget CredsDirective is a value that signifies that
+ * the selected credentials, if capable, should attempt to embody
+ * the target. In other words, it gives the accepting side the ability
+ * to impersonate the initiating side.
+ */
+ const CredsDirective CD_EmbodyTarget = 3;
+
+ /**
+ * A Feature Directive is a general directive used in policy that
+ * stipulates the of a particular feature. Such examples include,
+ * confidentiality, integrity, client authentication, etc.
+ */
+ typedef long FeatureDirective;
+
+ /**
+ * The FD_DoNotUse FeatureDirective means definitely not to use
+ * the feature.
+ */
+ const FeatureDirective FD_DoNotUse = -2;
+ /**
+ * The FD_DoNotUseIfPossible FeatureDirective means not to use
+ * the feature if it is possible. Note, some mechanisms may always
+ * use confidentiality.
+ */
+ const FeatureDirective FD_DoNotUseIfPossible = -1;
+ /**
+ * The FD_UseDefault FeatureDirective means to use or not to use
+ * the feature depending on defaults.
+ */
+ const FeatureDirective FD_UseDefault = 0;
+ /**
+ * The FD_UseIfPossible FeatureDirective means to use the feature
+ * if it is possible.
+ */
+ const FeatureDirective FD_UseIfPossible = 1;
+ /**
+ * The FD_Use FeatureDirective means definitely to use the feature.
+ */
+ const FeatureDirective FD_Use = 2;
+
+
+ /**
+ * The Initiator Type of the Initiator Side of the Credentials states
+ * the kind of Initiator it is. There are three types that mirror
+ * the type of Principal, Simple, Quoting, and Proxy, that the
+ * initiator intends to represent to a server while trying to
+ * establish a security context with the server.
+ */
+ typedef unsigned long InitiatorType;
+ /**
+ * The IT_None InitiatorType is a value that is defined for
+ * completeness, and has no real use.
+ */
+ const InitiatorType IT_None = 0;
+ /**
+ * The IT_Simple InitiatorType is a value that states that the
+ * initiator is a "Simple" Principal.
+ */
+ const InitiatorType IT_Simple = 1;
+ /**
+ * The IT_Quoting InitiatorType is a value that states that the
+ * initiator will quote another principal to the server. This
+ * principal is denoted in the Principal Calculus as (A|B), i.e.
+ * A quoting B.
+ */
+ const InitiatorType IT_Quoting = 2;
+ /**
+ * The IT_Proxy InitiatorType is a value that states that the
+ * initiator will quote another principal to the server along with
+ * getting or providing proof to the server that it can act on
+ * behalf of the quoted principals. This
+ * principal is denoted in the Principal Calculus as (A for B).
+ */
+ const InitiatorType IT_Proxy = 3;
+
+ /**
+ * The CredsInitiator object is an object that is directly a
+ * member of a particular OwnCredentials object. It represents
+ * the "initiator" side of the credentials.
+ */
+ local interface CredsInitiator {
+
+ /**
+ * The principal attribute contains a local view of the
+ * Principal that the Credentials intend to represent.
+ * Note that during context establishment, the actual establish
+ * client principal may be represented differently, especially
+ * with respect to environmental attributes. Some environmental
+ * attributes are a direct result of context establishment.
+ */
+ readonly attribute Principal the_principal;
+ /**
+ * The supporting statements attribute contains a list of statements
+ * supporting the principal associated with this initiator.
+ */
+ readonly attribute StatementList supporting_statements;
+ /**
+ * The restricted_resources attribute contains a list of
+ * resource names, by which the credentials initiator
+ * believes his authorizations apply.
+ */
+ readonly attribute ResourceNameList restricted_resources;
+ /**
+ * The initiator_type attribute signifies the intent of the
+ * initiator as to the principal it presents for the
+ * security context establishment. It should correspond
+ * to the type of the Principal. However, it might be slightly
+ * different, because using CSIv2 Client Authentication
+ * technically creates a "QuotingPrincipal" however, the
+ * initiator type will still be simple as no CSIv2 Identity
+ * Assertion will be used in establishing the security
+ * context.
+ */
+ readonly attribute InitiatorType initiator_type;
+ /**
+ * The supports_embodiment attribute is <code>TRUE</code> if these credentials
+ * can be directed by use of the CredsDirective, to give the
+ * the accepting end of a context establishment the ability
+ * to impersonate this initiator principal.
+ */
+ readonly attribute boolean supports_embodiment;
+ /**
+ * The supports_endorsement attribute is <code>TRUE</code> if these credentials
+ * can be directed by use of the CredsDirective, to endorse
+ * the accepting end of a context establishment to act
+ * on behalf of this initiator principal.
+ */
+ readonly attribute boolean supports_endorsement;
+ /**
+ * The supports_quoting attribute is <code>TRUE</code> if these credentials
+ * can be directed by use of the CredsDirective, to simply
+ * quote another principal on top of these credentials.
+ */
+ readonly attribute boolean supports_quoting;
+ /**
+ * The expiry_time attribute denotes the time that these
+ * credentials expire.
+ */
+ readonly attribute TimeBase::UtcT expiry_time;
+ };
+
+ /**
+ * The CredsAcceptor object is an object that is directly a
+ * member of a particular OwnCredentials object. It represents
+ * the "acceptor" side of the credentials.
+ */
+ local interface CredsAcceptor {
+
+ /**
+ * The principal attribute contains a local view of the
+ * Principal that the Credentials intend to represent.
+ * Note that during context establishment, the actual establish
+ * target principal may be represented differently, especially
+ * with respect to environmental attributes. Some environmental
+ * attributes are a direct result of context establishment.
+ */
+ readonly attribute SecurityLevel3::Principal the_principal;
+ /**
+ * The supporting_statements attribute contains a list of statements
+ * supporting the principal associated with this acceptor.
+ */
+ readonly attribute SecurityLevel3::StatementList supporting_statements;
+ /**
+ * The restricted_resources attribute contains a list of
+ * resource names, by which the credentials initiator
+ * believes his authorizations apply.
+ */
+ readonly attribute ResourceNameList restricted_resources;
+ /**
+ * The accepts_endorsement attribute is <code>TRUE</code> if these credentials
+ * supports and accepts CSIv2 endorsement information.
+ */
+ readonly attribute boolean accepts_endorsement;
+ /**
+ * The accepts_quoting attribute is <code>TRUE</code> if these credentials
+ * supports and accepts CSIv2 Identity Assertion information.
+ */
+ readonly attribute boolean accepts_quoting;
+ /**
+ * The expiry_time attribute denotes the time that these
+ * credentials expire.
+ */
+ readonly attribute TimeBase::UtcT expiry_time;
+
+ };
+
+ /**
+ * This type is used to identify listeners for removal.
+ * A Listener identity will be assigned to a listener when
+ * it is assigned to a particular object.
+ */
+ typedef string ListenerId;
+
+ /**
+ * This local interface is used to notify the user when the credentials
+ * have been relinquished. When credentials are "released" they may
+ * stay around until their work is finished. At that point they
+ * will be relinquished. Also, if the underlying transport credentials
+ * are released, then the SecurityLevel3 Credentials get released
+ * as well. This listener will get informed of this event.
+ */
+ local interface RelinquishedCredentialsListener {
+ void relinquished_notify(
+ in CredentialsId creds_id
+ );
+ };
+
+ /**
+ * The Credentials base interface contains the common items for
+ * the different types of credentials.
+ * @see OwnCredentials
+ * @see ClientCredentials
+ * @see TargetCredentials
+ */
+ local interface Credentials {
+
+ /**
+ * The creds_id attribute contains a system generated
+ * identifier with which can uniquely reference the credentials
+ * object.
+ */
+ readonly attribute CredentialsId creds_id;
+
+ /**
+ * The creds_type stipulates the type of credentials, i.e.
+ * to which type of credentials it may be narrowed, e.g.,
+ * Own, Client, or Target.
+ */
+ readonly attribute CredentialsType creds_type;
+
+ /**
+ * The creds_usage attribute stipulates the intended usage of the
+ * credentials. For OwnCredentials, it will be one of
+ * CU_AcceptOnly, CU_Initiate, CU_InitiateAndAccept.
+ * For ClientCredentials and TargetCredentials it will be
+ * CU_None.
+ */
+ readonly attribute CredentialsUsage creds_usage;
+
+ /**
+ * The expiry_time attribute denotes the time that these
+ * credentials expire.
+ */
+ readonly attribute TimeBase::UtcT expiry_time;
+
+ /**
+ * The creds_state attribute contains the
+ * validity state of the credentials.
+ */
+ readonly attribute CredentialsState creds_state;
+
+ /**
+ * Add a listener that will get notified when the
+ * OwnCredentials are finally done with any pending
+ * work and are relinquished by the security service.
+ */
+ ListenerId add_relinquished_listener(
+ in RelinquishedCredentialsListener listener
+ );
+
+ /**
+ * Removes a listener. This function raises a BAD_PARAM
+ * exception if the listener is not registered.
+ */
+ void remove_relinquished_listener(
+ in ListenerId id
+ );
+ };
+ /**
+ * A list of credentials.
+ */
+ typedef sequence<Credentials> CredentialsList;
+
+ /**
+ * OwnCredentials are created as a result of Credentials acquisition
+ * from the CredentialsCurator's CredentialsAcquirers.
+ * The Credentials have an initiator and an acceptor based
+ * upon its intended usage and capability. Some OwnCredentials
+ * that were acquired solely for initiating contexts (i.e. client side)
+ * will not have an acceptor, and visa versa.
+ */
+ local interface OwnCredentials : Credentials {
+
+ /**
+ * The creds_initiator attribute contains a reference to the
+ * local credentials initiator associated with these credentials.
+ * It is null if the creds_usage is AcceptOnly.
+ */
+ readonly attribute CredsInitiator creds_initiator;
+
+ /**
+ * The creds_acceptor attribute contains a reference to the
+ * local credentials acceptor associated with these credentials.
+ * It is null if the creds_usage is InitiateOnly.
+ */
+ readonly attribute CredsAcceptor creds_acceptor;
+
+ /**
+ * The release_credentials operation disables the credentials
+ * from further initiating and/or accepting contexts.
+ * Formal destruction of the Credentials object is delayed until
+ * its pending work is done, at which time it becomes Invalid.
+ */
+ void release_credentials ();
+ };
+
+ /**
+ * A list of OwnCredentials
+ */
+ typedef sequence<OwnCredentials> OwnCredentialsList;
+
+ /**
+ * An object of this interface represents the security context for
+ * a CSIv2 based remote client. It is created as the result of accepting
+ * a security context for the remote client.
+ * This object is only available during the servicing of a CORBA request.
+ * It can be retrieved from the
+ * <code>SecurityLevel3::SecurityCurrent</code> object,
+ * as it is thread based.
+ * <p>
+ * This object contains only the information used from the
+ * <code>OwnCredentials</code> that was pertinent in establishing the
+ * context. There is a pointer back to that <code>OwnCredentials</code>
+ * object. Once this context is created, its attributes are guaranteed
+ * not to change.
+ */
+ local interface ClientCredentials : Credentials {
+
+ /**
+ * The context_id attribute contains a system generated unique identifier
+ * for the context,
+ */
+ readonly attribute ContextId context_id;
+
+ /**
+ * The client_principal attribute contains the principal that
+ * the security service can deduce is the client from the
+ * information and mechanisms used.
+ */
+ readonly attribute Principal client_principal;
+
+ /**
+ * The client_supporting_statements attribute contains the statements that
+ * delivered from CSIv2 protocol along with any from the associated
+ * OwnCredentials that are used to deduce the client principal.
+ */
+ readonly attribute StatementList client_supporting_statements;
+
+ /**
+ * The client_restricted_resources attribute contains the names of the
+ * resources that the security service deduces from the CSIv2
+ * information and information from the associated OwnCredentials.
+ */
+ readonly attribute ResourceNameList client_restricted_resources;
+
+ /**
+ * The target_principal attribute contains the exact principal that
+ * the security service believes is representative of the
+ * clients version of the target's principal.
+ */
+ readonly attribute Principal target_principal;
+
+ /**
+ * The target_supporting_statements attribute contains the statements that
+ * support the deduction of the target principal.
+ */
+ readonly attribute StatementList target_supporting_statements;
+
+ /**
+ * The target_restricted_resources attribute contains names of resources
+ * on which the target is restricted. This information may come
+ * from the OwnCredentials.
+ */
+ readonly attribute ResourceNameList target_restricted_resources;
+
+ /**
+ * This attribute refers to the OwnCredentials that were used in
+ * establishing the security context.
+ */
+ readonly attribute OwnCredentials parent_credentials;
+
+ /**
+ * This attribute is <code>TRUE</code> if the target has
+ * authenticated the client, either over the transport, or at
+ * the CSIv2 Client Authentication layer.
+ */
+ readonly attribute boolean client_authentication;
+
+ /**
+ * This attribute is <code>TRUE</code> if the target believes that
+ * the client has authenticated the target over the transport.
+ */
+ readonly attribute boolean target_authentication;
+
+ /**
+ * This attribute is <code>TRUE</code> if the context is providing
+ * confidentiality protection.
+ */
+ readonly attribute boolean confidentiality;
+
+ /**
+ * This attribute is <code>TRUE</code> if the context is providing
+ * integrity protection.
+ */
+ readonly attribute boolean integrity;
+ };
+
+ /**
+ * The TargetCredentials object is created as the result of accepting a
+ * security context for a target. It represents that context.
+ * It contains only the information used from the OwnCredentials
+ * that was pertinent in establishing the context.
+ * There is a pointer back to that OwnCredentials object.
+ * Once this context is created, its attributes are guaranteed
+ * not to change.
+ */
+ local interface TargetCredentials : Credentials {
+
+ /**
+ * The context_id attribute contains a system generated
+ * unique identifier for the context.
+ */
+ readonly attribute ContextId context_id;
+
+ /**
+ * The client_principal attribute contains the principal that
+ * the security service believe is the target's
+ * ClientCredentials client_principal attribute.
+ */
+ readonly attribute Principal client_principal;
+
+ /**
+ * The client_supporting_statements attribute contains the
+ * statements that support the deduction of the client principal.
+ */
+ readonly attribute StatementList client_supporting_statements;
+
+ /**
+ * The client_restricted_resources attribute contains names of
+ * resources on which the client believes the client is restricted.
+ * This information may be derived from newly acquired endorsement
+ * information.
+ */
+ readonly attribute ResourceNameList client_restricted_resources;
+
+ /**
+ * The target_principal attribute contains the exact principal that
+ * the security service deduces to be the target.
+ */
+ readonly attribute Principal target_principal;
+
+ /**
+ * The target_supporting_statements attribute contains the statements
+ * that support the deduction of the target principal.
+ */
+ readonly attribute StatementList target_supporting_statements;
+
+ /**
+ * The target_restricted_resources attribute contains names of
+ * resources on which the target is restricted. This information
+ * may not be available.
+ */
+ readonly attribute ResourceNameList target_restricted_resources;
+
+ /**
+ * The parent_credentials attribute refers to the OwnCredentials
+ * that were used in establishing the security context.
+ */
+ readonly attribute OwnCredentials parent_credentials;
+
+ /**
+ * The client_authentication attribute is <code>TRUE</code> if the client
+ * believes that the target has authenticated the client, either
+ * over the transport, or at the CSIv2 Client Authentication layer.
+ */
+ readonly attribute boolean client_authentication;
+
+ /**
+ * The target_authentication attribute is <code>TRUE</code> if the client has
+ * authenticated the target over the transport.
+ */
+ readonly attribute boolean target_authentication;
+
+ /**
+ * The confidentiality attribute is <code>TRUE</code> if the context is
+ * providing confidentiality protection.
+ */
+ readonly attribute boolean confidentiality;
+
+ /**
+ * The integrity attribute is <code>TRUE</code> if the context is providing
+ * integrity protection.
+ */
+ readonly attribute boolean integrity;
+
+ /**
+ * The target_embodied attribute is <code>TRUE</code> if the security service
+ * believes that the target is embodied to impersonate the client
+ * side principal.
+ */
+ readonly attribute boolean target_embodied;
+
+ /**
+ * The target_endorsed attribute is <code>TRUE</code> if the security service
+ * believes that the target is endorsed to act on behalf of the
+ * client side principal.
+ */
+ readonly attribute boolean target_endorsed;
+
+ /**
+ * The release operation indicates to the CSIv2 protocol, that if
+ * state is being retained for these credentials, they
+ * will be discarded with the pending next request that
+ * may have not yet gone out.
+ * <p>
+ * Any objects references that are binded to these
+ * credentials after you release them will become unusable.
+ *
+ * This operation is experimental.
+ */
+ void release();
+ };
+
+
+ //--------------------------------------------------------------------
+ // Security Invocation Policy
+ //
+ //--------------------------------------------------------------------
+
+ /**
+ * The ContextEstablishmentPolicy policy object directs the
+ * establishment of security contexts with a target.
+ * <p>
+ * The CredsDirective usage is the following:
+ * <dl>
+ * <dt>
+ * CD_Default
+ * <dd>
+ * This directive means to use the default set
+ * up by the thread, the ORB, the ORB configuration,
+ * available credentials, or other policies.
+ * <dt>
+ * CD_InvokeTarget
+ * <dd>
+ * This directive means to use the
+ * the specified OwnCredentials to create a
+ * secure association with the target
+ * before invocation. Do not endorse or embody the target.
+ * Credentials may be IT_Simple, IT_Quoting, or IT_Proxy.
+ * <dt>
+ * CD_EndorseTarget
+ * <dd>
+ * This directive means to use the
+ * the specified OwnCredentials to create a
+ * secure association with the target
+ * before invocation.
+ * The credentials must be
+ * IT_Simple, IT_Quoting, or IT_Proxy own credentials
+ * that supports endorsement.
+ * Note, a Initiator Credentials that is a IT_Proxy
+ * may have an endorsement statement that not only
+ * endorses this immediate client, but may very well
+ * apply to the next target.
+ * <dt>
+ * CD_EmbodyTarget
+ * <dd>
+ * If possible give the target the ability to
+ * impersonate the client, is performed using
+ * transports that can forward their credentials
+ * in the transport that give the ability to the
+ * target to work in their own behalf. Alternatively,
+ * the authenticator may be able to be passed on.
+ * IT_Simple credentials must have or have the
+ * ability to forward credentials. This is analogous
+ * to flipping the DELEGATE bit on GSS-Kerberos Forwardable
+ * credentials. IT_Quoting principals means
+ * that you can forward the transport credentials,
+ * authenticator plus the Quoting statement.
+ * IT_Proxy principals means that you can forward
+ * the transport credentials, authenticator,
+ * and associated proxy statements.
+ * </dl>
+ * <p>
+ * On using Own Credentials. The creds_ids name Own Credentials.
+ * Also, they restrict the invocation to use only certain credentials.
+ * If the cred_ids list is empty, then the own credentials for the
+ * invocation are selected from a default, which may be
+ * set on the thread or the ORB instance.
+ */
+ local interface ContextEstablishmentPolicy : CORBA::Policy {
+
+ readonly attribute CredsDirective creds_directive;
+ readonly attribute OwnCredentialsList creds_list;
+ readonly attribute FeatureDirective use_client_auth;
+ readonly attribute FeatureDirective use_target_auth;
+ readonly attribute FeatureDirective use_confidentiality;
+ readonly attribute FeatureDirective use_integrity;
+ };
+
+ /**
+ * Type to be passed to ContextEstablishmentPolicy PolicyFactory
+ * through an Any.
+ */
+ struct ContextEstablishmentPolicyArgument
+ {
+ CredsDirective creds_directive;
+ OwnCredentialsList creds_list;
+ FeatureDirective use_client_auth;
+ FeatureDirective use_target_auth;
+ FeatureDirective use_confidentiality;
+ FeatureDirective use_integrity;
+ };
+
+ /**
+ * The ContextEstablishmentPolicyType constant is
+ * holds value used to denote the ContextEstablishmentPolicy.
+ */
+ const CORBA::PolicyType ContextEstablishmentPolicyType = ADIRON_VMCID | 1001;
+
+
+ /**
+ * The ObjectCredentialsPolicy object is placed on the policy list
+ * of a POA to indicate the own credentials
+ * that govern the accepting contexts for objects underneath
+ * that POA. The credentials listed here, only if they have Accepting
+ * capability, are used to created security components in the
+ * IOR of the object's reference when created.
+ */
+ local interface ObjectCredentialsPolicy : CORBA::Policy {
+ readonly attribute OwnCredentialsList creds_list;
+ };
+
+ /**
+ * Type to be passed to ObjectCredentialsPolicy PolicyFactory
+ * through an Any.
+ */
+ typedef OwnCredentialsList ObjectCredentialsPolicyArgument;
+
+ /**
+ * The ObjectCredentialsPolicyType constant is
+ * holds value used to denote the ObjectCredentialsPolicy.
+ */
+ const CORBA::PolicyType ObjectCredentialsPolicyType = ADIRON_VMCID | 1002;
+
+
+ //--------------------------------------------------------------------
+ // Security Level 3 Credentials Acquisition Mechanism
+ //
+ //--------------------------------------------------------------------
+
+ /**
+ * Credentials are acquired by a Credentials Acquirer by some
+ * acquisition mechanism specified in the Credentials Curator.
+ * Acquisition methods are available on the curator. The
+ * specifics of arguments needed and the acquisition process
+ * are defined by the method itself.
+ */
+ typedef string AcquisitionMethod;
+ typedef sequence<AcquisitionMethod> AcquisitionMethodList;
+
+ /**
+ * An acquisition of credentials may quite possibly fail as well
+ * as be a multistep process. A status defines the current
+ * state of an acquisition.
+ */
+ typedef long AcquisitionStatus;
+ /** Acquisition has failed. */
+ const AcquisitionStatus AQST_Failed = -2;
+ /** Acquisition has expired. */
+ const AcquisitionStatus AQST_Expired = -1;
+ /** Acquisition is initialized. */
+ const AcquisitionStatus AQST_Initialized = 0;
+ /** Acquisition needs more processing. */
+ const AcquisitionStatus AQST_Continued = 1;
+ /** Acquisition has succeeded. */
+ const AcquisitionStatus AQST_Succeeded = 2;
+
+ /**
+ * The CredentialsAcquirer object is created by the Credentials
+ * Curator based on the selected method and initial acquisition
+ * arguments. When this acquisition is complete and successful,
+ * the created credentials can be retrieved using the get_credentials
+ * operation. Once get_credentials is called, this object is destroyed.
+ */
+ local interface CredentialsAcquirer {
+
+ /**
+ * This attribute contains the acquisition method
+ * identifier naming the method by which these credentials
+ * are being acquired.
+ */
+ readonly attribute AcquisitionMethod acquisition_method;
+
+ /**
+ * This attribute contains the current acquisition
+ * status of the acquisition process.
+ */
+ readonly attribute AcquisitionStatus current_status;
+
+ /**
+ * If the acquisition process is a multistep process through calls
+ * to this acquirer, then this attribute contains the current
+ * iteration.
+ */
+ readonly attribute unsigned long nth_iteration;
+
+ /**
+ * If the <code>current_status</code> attribute contains
+ * the <code>AQST_Continued</code> value,
+ * this operation returns, if necessary and supported
+ * by the acquisition method, any data that may direct the
+ * acquisition.
+ * <p>
+ * If this operation in invoked when the <code>current_status</code>
+ * attribute does not have the <code>AQST_Continued</code> value,
+ * a <code>BAD_INV_ORDER</code> exception will be raised.
+ */
+ any get_continuation_data();
+
+ /**
+ * This operation continues the acquisition. The argument
+ * data is dependent on the acquisition method.
+ */
+ AcquisitionStatus continue_acquisition(
+ in any acquisition_arguments
+ );
+
+ /**
+ * Once the <code>current_status</code> attribute has the
+ * <code>AQST_Succeeded</code> value, a call to this operation
+ * is used to retrieve the acquired <code>OwnCredentials</code>
+ * and, optionally, place the credentials on the curator's default own
+ * credentials list (for use with default ContextEstablishmentPolicy
+ * and ObjectCredentialsPolicy).
+ * <p>
+ * The <code>CredentialsAcquirer</code> object is destroyed after
+ * this call.
+ * Any operation called on a destroyed <code>CredentialsAcquirer</code>
+ * raises a <code>BAD_INV_ORDER</code> exception.
+ * <p>
+ * If this operation in invoked when the <code>current_status</code>
+ * attribute does not have the <code>AQST_Succeeded</code> value,
+ * a <code>BAD_INV_ORDER</code> exception will be raised.
+ *
+ * @param on_list <code>TRUE</code> if these credentials go on the
+ * default own credentials list of the
+ * <code>CredentialsCurator</code>.
+ */
+ OwnCredentials get_credentials(
+ in boolean on_list
+ );
+
+ /**
+ * This operation is used to destroy the
+ * <code>CredentialsAcquirer</code> object before
+ * <code>get_credentials</code> is called.
+ * Any operation called on a destroyed <code>CredentialsAcquirer</code>
+ * raises a <code>BAD_INV_ORDER</code> exception.
+ */
+ void destroy();
+ };
+
+ /**
+ * The <code>CredentialsCurator</code> object is a single object per an ORB
+ * instance's Security Service. It has the ability to create
+ * <code>CredentialsAcquirer</code>s and keeps a list of active default
+ * credentials. It is resolved by a call to
+ * <pre>
+ * ORB.resolve_initial_references("SecurityLevel3:CredentialsCurator");
+ * </pre>
+ * Or it may be retrieved from the <code>SecurityManager</code>'s
+ * <code>credentials_curator</code> attribute.
+ * <p>
+ * The following pseudo code describes the process of credentials
+ * acquisition using <code>CredentialsCurator</code>.
+ * <pre>
+ * // Resolve the Credentials Curator
+ * CredentialsCurator curator = ....
+ * resolve_initial_references("SecurityLevel3:CredentialsCurator");
+ *
+ * // Build up an acquisition argument (e.g., using SL3CSI::CSIArgBuilder)
+ * Any arg = ...
+ *
+ * // Acquire credentials and get a Credentials Acquirer
+ * CredentialsAcquirer acquirer =
+ * curator.acquire_credentials("SL3CSIAQArgs",arg);
+ *
+ * // Get credentials and destroy the Credentials Acquirer
+ * OwnCredentials own = acquirer.get_credentials(false);
+ * </pre>
+ */
+ local interface CredentialsCurator {
+
+ /**
+ * This attribute contains a list of
+ * acquisition methods that are supported. Method identifiers
+ * are defined in modules that signify their support.
+ *
+ * @see "SL3CSI"
+ * @see "SL3TLS"
+ * @see "SL3TCPIP"
+ * @see "SL3KRB5"
+ */
+ readonly attribute SecurityLevel3::AcquisitionMethodList
+ supported_methods;
+
+ /**
+ * This operation starts the process of credentials acquisition and
+ * create a <code>CredentialsAcquirer</code> for a particular
+ * acquisition method. It takes an initial set of arguments for
+ * the acquisition. The content of the arguments are based on the
+ * acquisiton method. Depending on the method, it is possible that
+ * the credentials may be immediately available from a call to
+ * <code>get_credentials</code> on the returned
+ * <code>CredentialsAcquirer</code>.
+ * <p>
+ * If the process of credentials acquisition is not completed upon
+ * the return of the <code>acquire_credentials</code> operation,
+ * the returned <code>CredentialsAcquirer</code> object shall have
+ * its <code>current_status</code> at <code>AQST_Continued</code>.
+ * In this case, the <code>get_continuation_data</code> and
+ * <code>continue_acquisition</code> operations shall be used to
+ * complete the credentials acquisition process.
+ * <p>
+ * If the process of credentials acquisition fails, it is up to the
+ * implementation to either throw a system exception or return a
+ * <code>CredentialsAcquirer</code> with the <code>AQST_Failed</code>
+ * status.
+ * <p>
+ * The <code>acquisition_arguments</code> parameter is a CORBA
+ * <code>any</code> that is constructed according to the acquisition
+ * method used. The <code>ArgumentFactory</code> from the
+ * <code>SL3AQArgs</code> module is a local object that helps
+ * immensely with the construction of this complex argument.
+ * Extensions of that object are defined in their own separate
+ * modules that pertain to the particular acquisition mechanism,
+ * such as the SL3CSI, SL3TLS, SL3TCPIP, SL3KRB5 modules.
+ *
+ * @param acquisition_method
+ * The identifier of the desired acquisition method.
+ * A CORBA <code>BAD_PARAM</code> exception will be raised
+ * if the named method is not supported.
+ * @param acquisition_arguments
+ * The argument of the desired acquisition method.
+ * This CORBA <code>any</code> type is constructed according
+ * to the particular acquisition method.
+ *
+ * @see "SL3AQArgs"
+ * @see "SL3CSI"
+ * @see "SL3TLS"
+ * @see "SL3TCPIP"
+ * @see "SL3KRB5"
+ */
+ CredentialsAcquirer acquire_credentials(
+ in SecurityLevel3::AcquisitionMethod acquisition_method,
+ in any acquisition_arguments
+ );
+
+ /**
+ * The Curator's Default Own Credentials list.
+ */
+ readonly attribute OwnCredentialsList default_creds_list;
+
+ /**
+ * The Curator's ids of the credentials on the default list.
+ */
+ readonly attribute CredentialsIdList default_creds_ids;
+
+ /**
+ * This operation retrieves Own Credentials by identifier.
+ * It is not required that the identifier name a credentials
+ * on the default_credentials_list. The Curator keeps track
+ * of all OwnCredentials it creates, until they are explicitly
+ * released.
+ */
+ OwnCredentials get_own_credentials(
+ in CredentialsId credentials_id
+ );
+
+ /**
+ * This operation releases credentials from the default_creds_list,
+ * if there, and also disables the credentials from further use,
+ * provided that all their pending work is done.
+ */
+ void release_own_credentials (
+ in CredentialsId credentials_id
+ );
+
+ };
+
+ //--------------------------------------------------------------------
+ // Security Service ORB Objects
+ // Retrieved from the ORB by "resolve_initial_references".
+ //
+ //--------------------------------------------------------------------
+
+ /**
+ * The <code>SecurityManager</code> object represents the Security Level 3
+ * Security Service. There is one object of this type per ORB
+ * instance. It is resolved by a call to
+ * <pre>
+ * ORB.resolve_initial_references("SecurityLevel3:SecurityManager");
+ * </pre>
+ */
+ local interface SecurityManager {
+
+ /**
+ * The credentials_curator attribute contains the reference
+ * to the SecurityLevel3 Credentials Curator. There is only
+ * one instance per ORB.
+ */
+ readonly attribute CredentialsCurator credentials_curator;
+
+ /**
+ * The get_target_credentials operation retrieves the
+ * TargetCredentials that represents a CSIv2 security association
+ * with a Target. This operation causes communication with
+ * the target in order to establish a security context.
+ */
+ TargetCredentials get_target_credentials(
+ in Object the_object
+ );
+
+ /**
+ * The create_context_estab_policy operation is a policy factory
+ * operation that creates the Security Level 3
+ * ContextEstablishmentPolicy object. This policy is placed on
+ * the policy override lists of object references to direct
+ * the security characteristics when communicating through
+ * that object reference.
+ * <p>
+ * If this policy is not put on an object reference, and the
+ * <a href="TransportSecurity.ObjectCredentialsPolicy.html">
+ * TransportSecurity::ObjectCredentialsPolicy</a>
+ * is also not on the object references policy list,
+ * then the default credentials lists from the
+ * <a href="SecurityLevel3.CredentialsCurator.html">
+ * SecurityLevel3::CredentialsCurator</a>
+ * and
+ * <a href="TransportSecurity.CredentialsCurator.html">
+ * TransportSecurity::CredentialsCurator</a>
+ * are used.
+ */
+ ContextEstablishmentPolicy create_context_estab_policy(
+ in CredsDirective creds_directive,
+ in OwnCredentialsList creds_list,
+ in FeatureDirective use_client_auth,
+ in FeatureDirective use_target_auth,
+ in FeatureDirective use_confidentiality,
+ in FeatureDirective use_integrity
+ );
+
+ /**
+ * The create_object_creds_policy is a policy factory operation
+ * that creates the ObjectCredentialsPolicy object. This policy
+ * is solely for use with policies place on POAs with "POA.create_POA".
+ * It restricts the POAs use of credentials. If this policy is
+ * not put on a POA, and the
+ * <a href="TransportSecurity.ObjectCredentialsPolicy.html">
+ * TransportSecurity::ObjectCredentialsPolicy</a>
+ * is also not on the POA policy list, then the default
+ * credentials lists from the
+ * <a href="SecurityLevel3.CredentialsCurator.html">
+ * SecurityLevel3::CredentialsCurator</a>
+ * and
+ * <a href="TransportSecurity.CredentialsCurator.html">
+ * TransportSecurity::CredentialsCurator</a>
+ * are used.
+ */
+ ObjectCredentialsPolicy create_object_creds_policy(
+ in OwnCredentialsList creds_list
+ );
+ };
+
+ /**
+ * The <code>SecurityCurrent</code> object references thread specific
+ * data pertaining to the security service. It is used to retrieve
+ * the client's credentials during an invocation on the server side.
+ * <p>
+ * There is only one instance of this object per ORB instance.
+ * It is resolved by a call to
+ * <pre>
+ * ORB.resolve_initial_references("SecurityLevel3:SecurityCurrent");
+ * </pre>
+ */
+ local interface SecurityCurrent {
+
+ /**
+ * From inside the execution of a target object implementation,
+ * this attribute contains the representation of the remote client's
+ * credentials. This attribute is null if the client is not CSIv2
+ * based, or the client is from a collocated call.
+ * <p>
+ * The value of this attribute, if not null, represents the
+ * security context with a remote CSIv2 client.
+ * If the <code>request_is_local<code> attribute is <code>FALSE</code>,
+ * the current thread of execution is directly servicing a remote
+ * request for the target object within the target's implemenation.
+ * If the <code>request_is_local</code> attribute is <code>TRUE</code>,
+ * the current thread of execution is servicing an ORB mediated call
+ * on a collocated object.
+ * <p>
+ * If the client is not CSIv2 based, there are no CSIv2 Client
+ * Credentials, and this attribute is null. In this case,
+ * the user should try the
+ * <a href="TransportSecurity.SecurityCurrent.html>
+ * TransportSecurity::SecurityCurrent</a>,
+ * as the request may have come over a secure or
+ * insecure transport, such as IIOP or TLS, without a CSIv2
+ * Service Context.
+ */
+ readonly attribute ClientCredentials client_credentials;
+
+ /**
+ * If this attribute is <code>TRUE</code>, the client_credentials attribute
+ * returns the credentials of the remote client no matter how
+ * deep the collocated call stack, unless of course, this request
+ * is not CSIv2 based, in which case it returns null.
+ * This attribute is <code>TRUE</code> if the current thread of
+ * execution is servicing a request on a collocated object.
+ * This attribute is <code>FALSE</code> if the current thread of
+ * execution is immediately servicing a remote request.
+ * <p>
+ * If this attribute is <code>TRUE</code>, there may or may not be
+ * a remote client. If there is a remote client and the client is
+ * CSIv2 based, the <code>client_credentials</code> attribute will
+ * return the credentials of the remote client.
+ * <p>
+ * If this attribute is <code>FALSE</code>, there will always be a
+ * remote client. In such case, the <code>client_credentials</code>
+ * attribute will return the credentials of the remote client,
+ * unless the client is not CSIv2 based.
+ */
+ readonly attribute boolean request_is_local;
+ };
+
+};
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/SecurityReplaceable.idl b/TAO/orbsvcs/orbsvcs/SecurityReplaceable.idl
new file mode 100644
index 00000000000..c7beeefd060
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/SecurityReplaceable.idl
@@ -0,0 +1,237 @@
+// -*- IDL -*-
+//
+// $Id$
+
+#ifndef _SECURITY_REPLACEABLE_IDL_
+#define _SECURITY_REPLACEABLE_IDL_
+
+#include "orbsvcs/SecurityLevel2.idl"
+#include "tao/IOP.pidl"
+
+#pragma prefix "omg.org"
+
+module SecurityReplaceable {
+
+# pragma version SecurityReplaceable 1.8
+
+ local interface SecurityContext;
+ local interface ClientSecurityContext;
+ local interface ServerSecurityContext;
+
+ local interface Vault {
+
+# pragma version Vault 1.8
+
+ Security::AuthenticationMethodList
+ get_supported_authen_methods(
+ in Security::MechanismType mechanism
+ );
+
+ readonly attribute Security::OIDList supported_mech_oids;
+
+ Security::AuthenticationStatus acquire_credentials (
+ in Security::AuthenticationMethod method,
+ in Security::MechanismType mechanism,
+ in Security::SecurityName security_name,
+ in any auth_data,
+ in Security::AttributeList privileges,
+ out SecurityLevel2::Credentials creds,
+ out any continuation_data,
+ out any auth_specific_data
+ );
+
+ Security::AuthenticationStatus continue_credentials_acquisition (
+ in any response_data,
+ in SecurityLevel2::Credentials creds,
+ out any continuation_data,
+ out any auth_specific_data
+ );
+
+ IOP::TaggedComponentList create_ior_components(
+ in SecurityLevel2::Credentials creds_list
+ );
+
+
+ Security::AssociationStatus init_security_context (
+ in SecurityLevel2::Credentials creds,
+ in Security::SecurityName target_security_name,
+ in Object target,
+ in Security::DelegationMode delegation_mode,
+ in Security::OptionsDirectionPairList association_options,
+ in Security::MechanismType mechanism,
+ in Security::Opaque comp_data, //from IOR
+ in Security::ChannelBindings chan_binding,
+ out Security::OpaqueBuffer security_token,
+ out ClientSecurityContext security_context
+ );
+
+ Security::AssociationStatus accept_security_context (
+ in SecurityLevel2::CredentialsList creds_list,
+ in Security::ChannelBindings chan_bindings,
+ in Security::Opaque in_token,
+ out Security::Opaque out_token
+ );
+
+ Security::MechandOptionsList get_supported_mechs ();
+
+ };
+
+
+ local interface SecurityContext {
+
+# pragma version SecurityContext 1.8
+
+ readonly attribute Security::SecurityContextType
+ context_type;
+
+ readonly attribute Security::SecurityContextState
+ context_state;
+
+ readonly attribute Security::MechanismType
+ mechanism;
+
+ readonly attribute Security::ChannelBindings chan_binding;
+
+ readonly attribute SecurityLevel2::ReceivedCredentials
+ received_credentials;
+
+ Security::AssociationStatus continue_security_context (
+ in Security::OpaqueBuffer in_token,
+ out Security::OpaqueBuffer out_token
+ );
+
+ void protect_message (
+ in Security::OpaqueBuffer message,
+ in Security::QOP qop,
+ out Security::OpaqueBuffer text_buffer,
+ out Security::OpaqueBuffer token
+ );
+
+ boolean reclaim_message (
+ in Security::Opaque text_buffer,
+ in Security::Opaque token,
+ out Security::QOP qop,
+ out Security::Opaque message
+ );
+
+ boolean is_valid (
+ out Security::UtcT expiry_time
+ );
+
+ boolean discard_security_context (
+ in Security::Opaque discard_data,
+ out Security::OpaqueBuffer out_token
+ );
+
+ boolean process_discard_token (
+ in Security::OpaqueBuffer discard_token
+ );
+
+ };
+
+ local interface ClientSecurityContext : SecurityContext {
+
+# pragma version ClientSecurityContext 1.8
+
+ readonly attribute Security::AssociationOptions
+ association_options_used;
+
+ readonly attribute Security::DelegationMode
+ delegation_mode;
+
+ readonly attribute Security::Opaque comp_data;
+
+ readonly attribute SecurityLevel2::Credentials
+ client_credentials;
+
+ readonly attribute Security::AssociationOptions
+ server_options_supported;
+
+ readonly attribute Security::AssociationOptions
+ server_options_required;
+
+ readonly attribute Security::Opaque server_security_name;
+
+ };
+
+ local interface ServerSecurityContext : SecurityContext {
+
+# pragma version ServerSecurityContext 1.8
+
+ readonly attribute Security::AssociationOptions
+ association_options_used;
+
+ readonly attribute Security::DelegationMode
+ delegation_mode;
+
+ readonly attribute SecurityLevel2::Credentials
+ server_credentials;
+
+ readonly attribute Security::AssociationOptions
+ server_options_supported;
+
+ readonly attribute Security::AssociationOptions
+ server_options_required;
+
+ readonly attribute Security::Opaque server_security_name;
+
+ };
+
+ interface RequiredRights {
+
+ void get_required_rights(
+ in CORBA::Identifier operation_name,
+ in CORBA::RepositoryId interface_name,
+ out Security::RightsList rights,
+ out Security::RightsCombinator rights_combinator
+ );
+
+ void set_required_rights(
+ in CORBA::Identifier operation_name,
+ in CORBA::RepositoryId interface_name,
+ in Security::RightsList rights,
+ in Security::RightsCombinator rights_combinator
+ );
+
+ };
+
+ local interface AuditChannel {
+
+ void audit_write (
+ in Security::AuditEventType event_type,
+ in SecurityLevel2::CredentialsList creds_list,
+ in Security::UtcT time,
+ in Security::SelectorValueList descriptors,
+ in Security::Opaque event_specific_data
+ );
+
+ readonly attribute Security::AuditChannelId audit_channel_id;
+
+ };
+
+ local interface AuditDecision {
+
+ boolean audit_needed (
+ in Security::AuditEventType event_type,
+ in Security::SelectorValueList value_list
+ );
+
+ readonly attribute AuditChannel audit_channel;
+
+ };
+
+ local interface AccessDecision {
+
+ boolean access_allowed (
+ in SecurityLevel2::CredentialsList cred_list,
+ in CORBA::Identifier operation_name,
+ in CORBA::Identifier target_interface_name
+ );
+
+ };
+
+};
+
+#pragma prefix ""
+
+#endif /* _SECURITY_REPLACEABLE_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/Shutdown_Utilities.cpp b/TAO/orbsvcs/orbsvcs/Shutdown_Utilities.cpp
new file mode 100644
index 00000000000..e243dfa2530
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Shutdown_Utilities.cpp
@@ -0,0 +1,97 @@
+// $Id$
+
+#include "orbsvcs/Shutdown_Utilities.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID(orbsvcs,
+ Shutdown_Utilities,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+Service_Shutdown::Service_Shutdown (Shutdown_Functor& sf)
+ : functor_(sf)
+{
+ ACE_Sig_Set std_signals;
+#if !defined(ACE_LACKS_UNIX_SIGNALS)
+ std_signals.sig_add (SIGTERM);
+ std_signals.sig_add (SIGINT);
+#elif defined(ACE_WIN32)
+ std_signals.sig_add (SIGINT);
+#endif
+ this->set_signals (std_signals);
+}
+
+Service_Shutdown::Service_Shutdown (Shutdown_Functor& sf, ACE_Sig_Set& which_signals)
+ : functor_(sf)
+{
+ this->set_signals (which_signals);
+}
+
+// It would be nice if we could rely on a portable #define that
+// declared the largest signal held in sigset_t, but we can't.
+// So, for now, we'll make a possibly bold assumption that sigset_t
+// will be at least four bytes. If somebody wants to use a signal
+// greater than that, then they'll have to redefine ACE_NSIG.
+//
+// It would be even nicer if the register_handler() method just took
+// an ACE_Sig_Set as an argument and handled all this stuff itself.
+//
+void
+Service_Shutdown::set_signals (ACE_Sig_Set& which_signals)
+{
+ // iterate over all the signals in which_signals and register them...
+ bool did_register = false;
+ for (int i = 1; i < ACE_NSIG; ++i)
+ {
+ if (which_signals.is_member (i))
+ {
+ if (this->shutdown_.register_handler (i, this) == -1)
+ {
+#if defined(__TANDEM)
+// Tandem NSK platform has no signal 10 so do not emit a warning for it
+ if (i != 10)
+#endif
+ {
+ ACE_DEBUG ((LM_WARNING,
+ "WARNING: Failed to register signal handler "
+ "for signal %d: %p\n",
+ i, ACE_TEXT ("register_handler")));
+ }
+ }
+ else
+ {
+ // Store that we have registered for this signal
+ // we have to unregister later for just these signals
+ this->registered_signals_.sig_add (i);
+ did_register = true;
+ }
+ }
+ }
+ if (! did_register)
+ {
+ ACE_DEBUG ((LM_WARNING,
+ "WARNING: Service_Shutdown did not register any signals.\n"));
+ }
+}
+
+Service_Shutdown::~Service_Shutdown ()
+{
+ for (int i = 1; i < ACE_NSIG; ++i)
+ {
+ if (this->registered_signals_.is_member (i))
+ {
+ this->shutdown_.remove_handler(i);
+ }
+ }
+}
+
+int
+Service_Shutdown::handle_signal (int signum,
+ siginfo_t*, ucontext_t*)
+{
+ this->functor_(signum);
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Shutdown_Utilities.h b/TAO/orbsvcs/orbsvcs/Shutdown_Utilities.h
new file mode 100644
index 00000000000..2663a13d407
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Shutdown_Utilities.h
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+
+#ifndef _SHUTDOWN_UTILS_H
+#define _SHUTDOWN_UTILS_H
+#include /**/ "ace/pre.h"
+
+// $Id$
+
+#include "orbsvcs/svc_utils_export.h"
+
+#include "tao/Versioned_Namespace.h"
+
+#include "ace/Event_Handler.h"
+#include "ace/Signal.h"
+#include "ace/Sig_Handler.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * \brief Abstract definition for a Functor that shuts down a particular service.
+ *
+ * When subclassing, the developer should provide a constructor or
+ * other initialization method that somehow couples an instance of the
+ * functor to the service implementation. She should also provide an
+ * implementation of operator()(int which_signal) that actually performs
+ * the shutdown.
+ */
+class TAO_Svc_Utils_Export Shutdown_Functor
+{
+public:
+ virtual void operator() (int which_signal) = 0;
+
+protected:
+ Shutdown_Functor (void) {}
+ virtual ~Shutdown_Functor (void) {}
+};
+
+/**
+ * \brief Class that permits graceful shutdown of a service.
+ *
+ * Services require graceful shutdown. Sending a SIGTERM (which is
+ * what Ctrl-C does on Unix) should trigger a graceful shutdown, not
+ * simply a graceful termination of the process.
+ *
+ * This class can be used to capture signals and gracefully shut down
+ * the service.
+ */
+class TAO_Svc_Utils_Export Service_Shutdown : public ACE_Event_Handler
+{
+public:
+ Service_Shutdown (Shutdown_Functor& sf);
+ Service_Shutdown (Shutdown_Functor& sf, ACE_Sig_Set& which_signals);
+ ~Service_Shutdown ();
+
+ void set_signals (ACE_Sig_Set& which_signals);
+
+ virtual int handle_signal (int which_sig,
+ siginfo_t* siginfo,
+ ucontext_t* context);
+
+protected:
+ Shutdown_Functor& functor_;
+ ACE_Sig_Handler shutdown_;
+ ACE_Sig_Set registered_signals_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/Svc_Utils.mpc b/TAO/orbsvcs/orbsvcs/Svc_Utils.mpc
new file mode 100644
index 00000000000..6d3f2ea5626
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Svc_Utils.mpc
@@ -0,0 +1,34 @@
+// -*- MPC -*-
+// $Id$
+
+project(Svc_Utils) : orbsvcslib, core, portableserver, tao_versioning_idl_defaults {
+ sharedname = TAO_Svc_Utils
+ idlflags += -Wb,export_macro=TAO_Svc_Utils_Export -Wb,export_include=orbsvcs/svc_utils_export.h
+ dynamicflags = TAO_SVC_UTILS_BUILD_DLL
+
+ IDL_Files {
+ TimeBase.idl
+ RtecBase.idl
+ }
+
+ Source_Files {
+ TimeBaseC.cpp
+ TimeBaseS.cpp
+ RtecBaseC.cpp
+ RtecBaseS.cpp
+ Shutdown_Utilities.cpp
+ Time_Utilities.cpp
+ IOR_Multicast.cpp
+ }
+
+ Header_Files {
+ svc_utils_export.h
+ }
+
+ Template_Files {
+ }
+
+ Pkgconfig_Files {
+ TAO_Svc_Utils.pc.in
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/Svc_Utils.rc b/TAO/orbsvcs/orbsvcs/Svc_Utils.rc
new file mode 100644
index 00000000000..b927f5f9703
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Svc_Utils.rc
@@ -0,0 +1,30 @@
+#include "..\..\tao\Version.h"
+
+1 VERSIONINFO
+ FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "Svc_Utils\0"
+ VALUE "FileVersion", TAO_VERSION "\0"
+ VALUE "InternalName", "TAO_Svc_UtilsDLL\0"
+ VALUE "LegalCopyright", "\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "TAO_Svc_Utils.DLL\0"
+ VALUE "ProductName", "ORBSVCS\0"
+ VALUE "ProductVersion", TAO_VERSION "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosConcurrency.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosConcurrency.pc.in
new file mode 100644
index 00000000000..d3f639711d0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosConcurrency.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosConcurrency
+Description: TAO CosConcurrency Stub Library
+Requires: TAO_AnyTypeCode, TAO
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosConcurrency
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosConcurrency_Serv.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosConcurrency_Serv.pc.in
new file mode 100644
index 00000000000..60156a705ca
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosConcurrency_Serv.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosConcurrency_Serv
+Description: TAO CosConcurrency Service Library
+Requires: TAO_CosConcurrency_Skel
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosConcurrency_Serv
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosConcurrency_Skel.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosConcurrency_Skel.pc.in
new file mode 100644
index 00000000000..6a7095e3c5a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosConcurrency_Skel.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosConcurrency_Skel
+Description: TAO CosConcurrency Skeleton Library
+Requires: TAO_CosConcurrency, TAO_PortableServer
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosConcurrency_Skel
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosEvent.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosEvent.pc.in
new file mode 100644
index 00000000000..98cfefc9dbe
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosEvent.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosEvent
+Description: TAO CosEvent Stub Library
+Requires: TAO_AnyTypeCode, TAO
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosEvent
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosEvent_Serv.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosEvent_Serv.pc.in
new file mode 100644
index 00000000000..5f96ef5e7d8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosEvent_Serv.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosEvent_Serv
+Description: TAO CosEvent Service Library
+Requires: TAO_CosEvent_Skel, TAO_DynamicInterface, TAO_IFR_Client, TAO_Messaging, TAO_CosNaming, TAO_Svc_Utils
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosEvent_Serv
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosEvent_Skel.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosEvent_Skel.pc.in
new file mode 100644
index 00000000000..b48e61678d6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosEvent_Skel.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosEvent_Skel
+Description: TAO CosEvent Skeleton Library
+Requires: TAO_CosEvent, TAO_PortableServer
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosEvent_Skel
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosLifeCycle.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosLifeCycle.pc.in
new file mode 100644
index 00000000000..9ff630be427
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosLifeCycle.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosLifeCycle
+Description: TAO CosLifeCycle Library
+Requires: TAO_CosNaming, TAO_PortableServer, TAO
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosLifeCycle
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosLoadBalancing.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosLoadBalancing.pc.in
new file mode 100644
index 00000000000..ebb54ad54ee
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosLoadBalancing.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosLoadBalancing
+Description: TAO CosLoadBalancing Library
+Requires: TAO_CosNaming, TAO_IORManip, TAO_PortableGroup, TAO
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosLoadBalancing
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosNaming.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosNaming.pc.in
new file mode 100644
index 00000000000..19899254747
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosNaming.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosNaming
+Description: TAO CosNaming Stub Library
+Requires: TAO_AnyTypeCode, TAO
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosNaming
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosNaming_Serv.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosNaming_Serv.pc.in
new file mode 100644
index 00000000000..b67b573478c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosNaming_Serv.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosNaming_Serv
+Description: TAO CosNaming Service Library
+Requires: TAO_CosNaming_Skel, TAO_Messaging, TAO_Svc_Utils, TAO_IORTable
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosNaming_Serv
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosNaming_Skel.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosNaming_Skel.pc.in
new file mode 100644
index 00000000000..ba4fd0022c8
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosNaming_Skel.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosNaming_Skel
+Description: TAO CosNaming Skeleton Library
+Requires: TAO_CosNaming, TAO_PortableServer
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosNaming_Skel
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosNotification.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosNotification.pc.in
new file mode 100644
index 00000000000..5fec272c552
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosNotification.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosNotification
+Description: TAO CosNotification Stub Library
+Requires: TAO_CosEvent, TAO
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosNotification
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosNotification_Serv.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosNotification_Serv.pc.in
new file mode 100644
index 00000000000..79df7dfdc22
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosNotification_Serv.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosNotification_Serv
+Description: TAO CosNotification Service Library
+Requires: TAO_CosNotification_Skel, TAO_Svc_Utils, TAO_DynamicAny, TAO_ETCL
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosNotification_Serv
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosNotification_Skel.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosNotification_Skel.pc.in
new file mode 100644
index 00000000000..292003b1293
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosNotification_Skel.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosNotification_Skel
+Description: TAO CosNotification Skeleton Library
+Requires: TAO_CosNotification, TAO_CosEvent_Skel, TAO_PortableServer
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosNotification_Skel
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosProperty.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosProperty.pc.in
new file mode 100644
index 00000000000..67038f6d9e6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosProperty.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosProperty
+Description: TAO CosProperty Stub Library
+Requires: TAO_AnyTypeCode, TAO
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosProperty
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosProperty_Serv.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosProperty_Serv.pc.in
new file mode 100644
index 00000000000..ae944d6d818
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosProperty_Serv.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosProperty_Serv
+Description: TAO CosProperty Service Library
+Requires: TAO_PortableServer_Skel
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosProperty_Serv
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosProperty_Skel.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosProperty_Skel.pc.in
new file mode 100644
index 00000000000..34cfa1f495f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosProperty_Skel.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosProperty_Skel
+Description: TAO CosProperty Skeleton Library
+Requires: TAO_CosProperty, TAO_PortableServer
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosProperty_Skel
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosTime.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosTime.pc.in
new file mode 100644
index 00000000000..2372d76fd70
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosTime.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosTime
+Description: TAO CosTime Library
+Requires: TAO_PortableServer, TAO
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosTime
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosTrading.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosTrading.pc.in
new file mode 100644
index 00000000000..517f619d0a4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosTrading.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosTrading
+Description: TAO CosTrading Stub Library
+Requires: TAO_AnyTypeCode, TAO
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosTrading
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosTrading_Serv.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosTrading_Serv.pc.in
new file mode 100644
index 00000000000..311d34a75fd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosTrading_Serv.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosTrading_Serv
+Description: TAO CosTrading Service Library
+Requires: TAO_CosTrading_Skel, TAO_Svc_Utils, TAO_DynamicAny
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosTrading_Serv
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_CosTrading_Skel.pc.in b/TAO/orbsvcs/orbsvcs/TAO_CosTrading_Skel.pc.in
new file mode 100644
index 00000000000..3a0dfcada7b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_CosTrading_Skel.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_CosTrading_Skel
+Description: TAO CosTrading Skeleton Library
+Requires: TAO_CosTrading, TAO_PortableServer
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_CosTrading_Skel
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_DsEventLogAdmin.pc.in b/TAO/orbsvcs/orbsvcs/TAO_DsEventLogAdmin.pc.in
new file mode 100644
index 00000000000..5897aec83a9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_DsEventLogAdmin.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_DsEventLogAdmin
+Description: TAO Event Logging Service Stub Library
+Requires: TAO, TAO_DsLogAdmin, TAO_CosEvent
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_DsEventLogAdmin
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_DsEventLogAdmin_Serv.pc.in b/TAO/orbsvcs/orbsvcs/TAO_DsEventLogAdmin_Serv.pc.in
new file mode 100644
index 00000000000..ce352477a2d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_DsEventLogAdmin_Serv.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_DsEventLogAdmin_Serv
+Description: TAO Event Logging Service Implementation Library
+Requires: TAO_DsEventLogAdmin_Skel, TAO_DsLogAdmin_Serv, TAO_CosEvent_Serv
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_DsEventLogAdmin_Serv
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_DsEventLogAdmin_Skel.pc.in b/TAO/orbsvcs/orbsvcs/TAO_DsEventLogAdmin_Skel.pc.in
new file mode 100644
index 00000000000..9eb90123b04
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_DsEventLogAdmin_Skel.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_DsEventLogAdmin_Skel
+Description: TAO Event Logging Service Skeleton Library
+Requires: TAO_DsEventLogAdmin, TAO_DsLogAdmin_Skel, TAO_CosEvent_Skel, TAO_PortableServer
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_DsEventLogAdmin_Skel
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_DsLogAdmin.pc.in b/TAO/orbsvcs/orbsvcs/TAO_DsLogAdmin.pc.in
new file mode 100644
index 00000000000..90bfd120c36
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_DsLogAdmin.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_DsLogAdmin
+Description: TAO Basic Logging Service Stub Library
+Requires: TAO_AnyTypeCode, TAO
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_DsLogAdmin
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_DsLogAdmin_Serv.pc.in b/TAO/orbsvcs/orbsvcs/TAO_DsLogAdmin_Serv.pc.in
new file mode 100644
index 00000000000..e018cc07696
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_DsLogAdmin_Serv.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_DsLogAdmin_Serv
+Description: TAO Basic Logging Service Implementation Library
+Requires: TAO_DsLogAdmin_Skel, TAO_DynamicAny, TAO_ETCL, TAO_Svc_Utils
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_DsLogAdmin_Serv
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_DsLogAdmin_Skel.pc.in b/TAO/orbsvcs/orbsvcs/TAO_DsLogAdmin_Skel.pc.in
new file mode 100644
index 00000000000..e55f7803fee
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_DsLogAdmin_Skel.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_DsLogAdmin_Skel
+Description: TAO Basic Logging Service Skeleton Library
+Requires: TAO_DsLogAdmin, TAO_PortableServer
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_DsLogAdmin_Skel
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_DsNotifyLogAdmin.pc.in b/TAO/orbsvcs/orbsvcs/TAO_DsNotifyLogAdmin.pc.in
new file mode 100644
index 00000000000..2173eff7ec1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_DsNotifyLogAdmin.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_DsNotifyLogAdmin
+Description: TAO Notify Logging Service Stub Library
+Requires: TAO_DsEventLogAdmin, TAO_DsLogAdmin, TAO_CosNotification, TAO_CosEvent, TAO
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_DsNotifyLogAdmin
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_DsNotifyLogAdmin_Serv.pc.in b/TAO/orbsvcs/orbsvcs/TAO_DsNotifyLogAdmin_Serv.pc.in
new file mode 100644
index 00000000000..34743834b21
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_DsNotifyLogAdmin_Serv.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_DsNotifyLogAdmin_Serv
+Description: TAO Notify Logging Service Implementation Library
+Requires: TAO_DsNotifyLogAdmin_Skel, TAO_DsLogAdmin_Serv
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_DsNotifyLogAdmin_Serv
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_DsNotifyLogAdmin_Skel.pc.in b/TAO/orbsvcs/orbsvcs/TAO_DsNotifyLogAdmin_Skel.pc.in
new file mode 100644
index 00000000000..4488d78c740
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_DsNotifyLogAdmin_Skel.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_DsNotifyLogAdmin_Skel
+Description: TAO Notify Logging Service Skeleton Library
+Requires: TAO_DsNotifyLogAdmin, TAO_DsEventLogAdmin_Skel, TAO_DsLogAdmin_Skel, TAO_CosNotification_Skel, TAO_CosEvent_Skel, TAO_PortableServer
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_DsNotifyLogAdmin_Skel
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_ETCL.pc.in b/TAO/orbsvcs/orbsvcs/TAO_ETCL.pc.in
new file mode 100644
index 00000000000..98825681b5b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_ETCL.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_ETCL
+Description: TAO Extended Trading Constraint Language Library
+Requires: TAO_AnyTypeCode, TAO
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_ETCL
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_FTORB_Utils.pc.in b/TAO/orbsvcs/orbsvcs/TAO_FTORB_Utils.pc.in
new file mode 100644
index 00000000000..5165ed760b1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_FTORB_Utils.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_FTORB_Utils
+Description: TAO Fault Tolerant ORB Utilities Library
+Requires: TAO_IORManip, TAO_PortableServer, TAO
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_FTORB_Utils
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_FT_ClientORB.pc.in b/TAO/orbsvcs/orbsvcs/TAO_FT_ClientORB.pc.in
new file mode 100644
index 00000000000..5d4b8bba041
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_FT_ClientORB.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_FT_ClientORB
+Description: TAO Fault Tolerant Client ORB Library
+Requires: TAO_FTORB_Utils, TAO_Messaging, TAO_PortableGroup
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_FT_ClientORB
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_FT_ServerORB.pc.in b/TAO/orbsvcs/orbsvcs/TAO_FT_ServerORB.pc.in
new file mode 100644
index 00000000000..5b0b51b87e6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_FT_ServerORB.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_FT_ServerORB
+Description: TAO Fault Tolerant Server ORB Library
+Requires: TAO_FTORB_Utils, TAO_Messaging, TAO_PortableGroup
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_FT_ServerORB
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_FaultTolerance.pc.in b/TAO/orbsvcs/orbsvcs/TAO_FaultTolerance.pc.in
new file mode 100644
index 00000000000..4150e1f29eb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_FaultTolerance.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_FaultTolerance
+Description: TAO Fault Tolerant Client ORB Library
+Requires: TAO_FT_ServerORB, TAO_FT_ClientORB, TAO_CosNotification
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_FaultTolerance
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_PortableGroup.pc.in b/TAO/orbsvcs/orbsvcs/TAO_PortableGroup.pc.in
new file mode 100644
index 00000000000..0e4e6c876b4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_PortableGroup.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_PortableGroup
+Description: TAO PortableGroup Library
+Requires: TAO_CosNaming, TAO_IORManip, TAO_Messaging, TAO
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_PortableGroup
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_RTEvent.pc.in b/TAO/orbsvcs/orbsvcs/TAO_RTEvent.pc.in
new file mode 100644
index 00000000000..b36d36acba5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_RTEvent.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_RTEvent
+Description: TAO RTEvent Stub Library
+Requires: TAO_Svc_Utils, TAO_AnyTypeCode, TAO
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_RTEvent
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_RTEventLogAdmin.pc.in b/TAO/orbsvcs/orbsvcs/TAO_RTEventLogAdmin.pc.in
new file mode 100644
index 00000000000..7c0ba70dab7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_RTEventLogAdmin.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_RTEventLogAdmin
+Description: TAO RTEvent Logging Service Stub Library
+Requires: TAO, TAO_DsLogAdmin, TAO_RTEvent
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_RTEventLogAdmin
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_RTEventLogAdmin_Serv.pc.in b/TAO/orbsvcs/orbsvcs/TAO_RTEventLogAdmin_Serv.pc.in
new file mode 100644
index 00000000000..8e63c1dd211
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_RTEventLogAdmin_Serv.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_RTEventLogAdmin_Serv
+Description: TAO RTEvent Logging Service Implementation Library
+Requires: TAO_RTEventLogAdmin_Skel, TAO_DsLogAdmin_Serv, TAO_RTEvent_Serv
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_RTEventLogAdmin_Serv
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_RTEventLogAdmin_Skel.pc.in b/TAO/orbsvcs/orbsvcs/TAO_RTEventLogAdmin_Skel.pc.in
new file mode 100644
index 00000000000..210fe308b19
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_RTEventLogAdmin_Skel.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_RTEventLogAdmin_Skel
+Description: TAO RTEvent Logging Service Skeleton Library
+Requires: TAO_RTEventLogAdmin, TAO_DsLogAdmin_Skel, TAO_RTEvent_Skel, TAO_PortableServer
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_RTEventLogAdmin_Skel
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_RTEvent_Serv.pc.in b/TAO/orbsvcs/orbsvcs/TAO_RTEvent_Serv.pc.in
new file mode 100644
index 00000000000..b37c07333ea
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_RTEvent_Serv.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_RTEvent_Serv
+Description: TAO RTEvent Service Library
+Requires: TAO_RTEvent_Skel, TAO_Svc_Utils, TAO_Messaging
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_RTEvent_Serv
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_RTEvent_Skel.pc.in b/TAO/orbsvcs/orbsvcs/TAO_RTEvent_Skel.pc.in
new file mode 100644
index 00000000000..4d862cc270d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_RTEvent_Skel.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_RTEvent_Skel
+Description: TAO RTEvent Skeleton Library
+Requires: TAO_RTEvent, TAO_PortableServer
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_RTEvent_Skel
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/TAO_Svc_Utils.pc.in b/TAO/orbsvcs/orbsvcs/TAO_Svc_Utils.pc.in
new file mode 100644
index 00000000000..049fb2e53b5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TAO_Svc_Utils.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: TAO_Svc_Utils
+Description: TAO Service Utilities Library
+Requires: TAO_PortableServer
+Version: @VERSION@
+Libs: -L${libdir} -lTAO_Svc_Utils
+Cflags: -I${includedir}
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.cpp b/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.cpp
new file mode 100644
index 00000000000..55708a8dc13
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.cpp
@@ -0,0 +1,288 @@
+// $Id$
+
+#include "orbsvcs/Time/TAO_TIO.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Constructor.
+TAO_TIO::TAO_TIO (TimeBase::TimeT lower,
+ TimeBase::TimeT upper)
+{
+ this->attr_time_interval.lower_bound = lower;
+ this->attr_time_interval.upper_bound = upper;
+}
+
+// Destructor.
+TAO_TIO::~TAO_TIO (void)
+{
+}
+
+// This is the get method for the attribute time interval.
+
+TimeBase::IntervalT
+TAO_TIO::time_interval (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return attr_time_interval;
+}
+
+// This operation returns a value of type OverlapType depending on how
+// the interval in the object and the time range represented by the
+// parameter UTO overlap. If OverlapType is not OTNoOverlap, then the
+// out parameter overlap contains the overlap interval, otherwise the
+// out parameter contains the gap between the two intervals.
+
+CosTime::OverlapType
+TAO_TIO::spans (CosTime::UTO_ptr uto,
+ CosTime::TIO_out overlap
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_TIO *tio = 0;
+
+ ACE_TRY
+ {
+ TimeBase::TimeT lb1 =
+ this->time_interval ().lower_bound;
+
+ TimeBase::TimeT up1 =
+ this->time_interval ().upper_bound;
+
+ TimeBase::TimeT tmp1 = uto->time (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TimeBase::TimeT tmp2 = uto->inaccuracy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TimeBase::TimeT lb2 = tmp1 - tmp2;
+
+
+ tmp1 = uto->time (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ tmp2 = uto->inaccuracy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TimeBase::TimeT up2 = tmp1 + tmp2;
+
+ if (lb1 == lb2 && up1 == up2)
+ {
+ ACE_NEW_RETURN (tio,
+ TAO_TIO (lb1, up1),
+ CosTime::OTNoOverlap);
+ overlap = tio->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ return CosTime::OTOverlap;
+ }
+ else if (lb1 > lb2 && up1 < up2)
+ {
+ ACE_NEW_RETURN (tio,
+ TAO_TIO (lb1, up1),
+ CosTime::OTNoOverlap);
+
+ overlap = tio->_this ();
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ return CosTime::OTContained;
+ }
+ else if (lb1 < lb2 && up1 > up2)
+ {
+ ACE_NEW_RETURN (tio,
+ TAO_TIO (lb2, up2),
+ CosTime::OTNoOverlap);
+
+ overlap = tio->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ return CosTime::OTContained;
+ }
+ else if (lb1 < lb2)
+ {
+ if (up1 < lb2)
+ {
+ ACE_NEW_RETURN (tio,
+ TAO_TIO (0, 0),
+ CosTime::OTNoOverlap);
+
+ overlap = tio->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ return CosTime::OTNoOverlap;
+ }
+ else
+ {
+ ACE_NEW_RETURN (tio,
+ TAO_TIO (lb2, up1),
+ CosTime::OTNoOverlap);
+ overlap = tio->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ return CosTime::OTOverlap;
+ }
+ }
+ else if (up2 < lb1)
+ {
+
+ ACE_NEW_RETURN (tio,
+ TAO_TIO (0, 0),
+ CosTime::OTNoOverlap);
+
+ overlap = tio->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ return CosTime::OTNoOverlap;
+ }
+ else
+ {
+ ACE_NEW_RETURN (tio,
+ TAO_TIO (lb1, up2),
+ CosTime::OTNoOverlap);
+
+ overlap = tio->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception:");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ return CosTime::OTNoOverlap;
+}
+
+// This operation returns a value of type OverlapType depending on how
+// the interval in the object and interval in the parameter TIO
+// overlap. If OverlapType is not OTNoOverlap, then the out parameter
+// overlap contains the overlap interval, otherwise the out parameter
+// contains the gap between the two intervals.
+
+CosTime::OverlapType
+TAO_TIO::overlaps (CosTime::TIO_ptr tio,
+ CosTime::TIO_out overlap
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_TIO *tio_i = 0;
+
+ TimeBase::TimeT lb1 =
+ this->time_interval ().lower_bound;
+
+ TimeBase::TimeT up1 =
+ this->time_interval ().upper_bound;
+
+ TimeBase::TimeT lb2 =
+ tio->time_interval ().lower_bound;
+
+ TimeBase::TimeT up2 =
+ tio->time_interval ().upper_bound;
+
+ if (lb1 == lb2 && up1 == up2)
+ {
+ ACE_NEW_THROW_EX (tio_i,
+ TAO_TIO (lb1, up1),
+ CORBA::NO_MEMORY ());
+
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ overlap = tio_i->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ return CosTime::OTOverlap;
+ }
+ else if (lb1 > lb2 && up1 < up2)
+ {
+ ACE_NEW_THROW_EX (tio_i,
+ TAO_TIO (lb1, up1),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ overlap = tio_i->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ return CosTime::OTContained;
+ }
+ else if (lb1 < lb2 && up1 > up2)
+ {
+ ACE_NEW_THROW_EX (tio_i,
+ TAO_TIO (lb2, up2),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ overlap = tio_i->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ return CosTime::OTContained;
+ }
+ else if (lb1 < lb2)
+ {
+ if (up1 < lb2)
+ {
+ ACE_NEW_THROW_EX (tio_i,
+ TAO_TIO (0, 0),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+ overlap = tio_i->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ return CosTime::OTNoOverlap;
+ }
+ else
+ {
+ ACE_NEW_THROW_EX (tio_i,
+ TAO_TIO (lb2, up1),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ overlap = tio_i->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ return CosTime::OTOverlap;
+ }
+ }
+ else if (up2 < lb1)
+ {
+ ACE_NEW_THROW_EX (tio_i,
+ TAO_TIO (0, 0),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ overlap = tio_i->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+
+ return CosTime::OTNoOverlap;
+ }
+ else
+ {
+ ACE_NEW_THROW_EX (tio_i,
+ TAO_TIO (lb1, up2),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosTime::OTNoOverlap);
+ overlap = tio_i->_this ();
+ }
+
+ return CosTime::OTNoOverlap;
+}
+
+CosTime::UTO_ptr
+TAO_TIO::time (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_UTO *uto = 0;
+
+ ACE_NEW_THROW_EX (uto,
+ TAO_UTO ((this->time_interval ().upper_bound -
+ this->time_interval ().lower_bound) / 2,
+ this->time_interval ().upper_bound -
+ this->time_interval ().lower_bound,
+ 0),
+ CORBA::NO_MEMORY ());
+
+ ACE_CHECK_RETURN (CosTime::UTO::_nil ());
+
+ return uto->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.h b/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.h
new file mode 100644
index 00000000000..ff4f0e8ab36
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.h
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file TAO_TIO.h
+ *
+ * $Id$
+ *
+ * This class implements the CosTime::TIO IDL interface.
+ *
+ *
+ * @author Vishal Kachroo <vishal@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_TIO_H
+#define TAO_TIO_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/TimeServiceS.h"
+#include "orbsvcs/Time/TAO_UTO.h"
+#include "orbsvcs/Time/time_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_TIO
+ *
+ * @brief Time Interval Object Implementation.
+ *
+ * The TIO represents a time interval and has operations to
+ * compare itself with a UTO or another TIO. It also has an
+ * operation to create a UTO from the value of it's time
+ * interval.
+ */
+class TAO_Time_Export TAO_TIO : public POA_CosTime::TIO
+{
+public:
+ // = Initialization and termination methods.
+ /// Constructor.
+ TAO_TIO (TimeBase::TimeT lower,
+ TimeBase::TimeT upper);
+
+ /// Destructor.
+ ~TAO_TIO (void);
+
+ /// This is the get method for the attribute time interval.
+ virtual TimeBase::IntervalT time_interval (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * This operation returns a value of type OverlapType depending on
+ * how the interval in the object and the time range represented by
+ * the parameter UTO overlap. If OverlapType is not OTNoOverlap,
+ * then the out parameter overlap contains the overlap interval,
+ * otherwise the out parameter contains the gap between the two
+ * intervals.
+ */
+ virtual CosTime::OverlapType spans (CosTime::UTO_ptr time,
+ CosTime::TIO_out overlap
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * This operation returns a value of type OverlapType depending on
+ * how the interval in the object and interval in the parameter TIO
+ * overlap. If OverlapType is not OTNoOverlap, then the out
+ * parameter overlap contains the overlap interval, otherwise the
+ * out parameter contains the gap between the two intervals.
+ */
+ virtual CosTime::OverlapType overlaps (CosTime::TIO_ptr interval,
+ CosTime::TIO_out overlap
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * Returns a UTO in which the inaccuracy interval is equal to the
+ * time interval in the TIO and time value is the midpoint of the
+ * interval.
+ */
+ virtual CosTime::UTO_ptr time (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// This attribute returns an IntervalT structure with the values of
+ /// its fields filled in with the corresponding values from the TIO.
+ TimeBase::IntervalT attr_time_interval;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TIO_H */
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.cpp b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.cpp
new file mode 100644
index 00000000000..710c8fad7ee
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.cpp
@@ -0,0 +1,181 @@
+// -*- C++ -*-
+// $Id$
+
+#include "orbsvcs/Time/TAO_Time_Service_Clerk.h"
+#include "orbsvcs/Time/TAO_TIO.h"
+#include "orbsvcs/Time/TAO_UTO.h"
+
+#include "tao/ORB_Core.h"
+#include "ace/OS_NS_sys_time.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Constructor.
+TAO_Time_Service_Clerk::TAO_Time_Service_Clerk (int timer_value,
+ int timer_value_usecs,
+ const IORS& servers)
+ : server_ (servers),
+ helper_ (this)
+{
+ // Schedule the helper to be invoked by the reactor
+ // periodically.
+
+ if (TAO_ORB_Core_instance ()->reactor ()->schedule_timer
+ (&helper_,
+ 0,
+ ACE_Time_Value::zero,
+ ACE_Time_Value(timer_value,timer_value_usecs)) == -1)
+ ACE_ERROR ((LM_ERROR,
+ "%p\n",
+ "schedule_timer ()"));
+}
+
+// Destructor.
+
+TAO_Time_Service_Clerk::~TAO_Time_Service_Clerk (void)
+{
+}
+
+// This method returns the global time and an estimate of inaccuracy
+// in a UTO.
+
+CosTime::UTO_ptr
+TAO_Time_Service_Clerk::universal_time (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable))
+{
+ TAO_UTO *uto = 0;
+
+ ACE_NEW_THROW_EX (uto,
+ TAO_UTO (this->get_time (),
+ this->inaccuracy (),
+ this->time_displacement_factor ()),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosTime::UTO::_nil ());
+ // Return the global time as a UTO.
+
+ return uto->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// This method returns the global time in a UTO only if the time can
+// be guaranteed to have been obtained securely. This method is not
+// implemented currently.
+
+CosTime::UTO_ptr
+TAO_Time_Service_Clerk::secure_universal_time (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
+ CosTime::UTO::_nil ());
+}
+
+// This creates a new UTO based on the given parameters.
+
+CosTime::UTO_ptr
+TAO_Time_Service_Clerk::new_universal_time (TimeBase::TimeT time,
+ TimeBase::InaccuracyT inaccuracy,
+ TimeBase::TdfT tdf
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_UTO *uto = 0;
+
+ ACE_NEW_THROW_EX (uto,
+ TAO_UTO (time,
+ inaccuracy,
+ tdf),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosTime::UTO::_nil ());
+
+ return uto->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// This creates a new UTO given a time in the UtcT form.
+
+CosTime::UTO_ptr
+TAO_Time_Service_Clerk::uto_from_utc (const TimeBase::UtcT &utc
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_UTO *uto = 0;
+
+ // Use the low and high values of inaccuracy
+ // to calculate the total inaccuracy.
+
+ TimeBase::InaccuracyT inaccuracy = utc.inacchi;
+ inaccuracy <<= 32;
+ inaccuracy |= utc.inacclo;
+
+ ACE_NEW_THROW_EX (uto,
+ TAO_UTO (utc.time,
+ inaccuracy,
+ utc.tdf),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosTime::UTO::_nil ());
+ return uto->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// This creates a new TIO with the given parameters.
+
+CosTime::TIO_ptr
+TAO_Time_Service_Clerk::new_interval (TimeBase::TimeT lower,
+ TimeBase::TimeT upper
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_TIO *tio = 0;
+
+ ACE_NEW_THROW_EX (tio,
+ TAO_TIO (lower,
+ upper),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosTime::TIO::_nil ());
+ return tio->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::ULongLong
+TAO_Time_Service_Clerk::get_time (void)
+{
+ // Globally sync. time is the latest global time plus the time
+ // elapsed since last updation was done.
+
+ const ACE_Time_Value timeofday = ACE_OS::gettimeofday ();
+
+ return (CORBA::ULongLong) (static_cast<CORBA::ULongLong> (timeofday.sec ()) *
+ static_cast<ACE_UINT32> (10000000) +
+ static_cast<CORBA::ULongLong> (timeofday.usec () * 10))
+ - this->update_timestamp_
+ + this->time_;
+}
+
+// Returns the time displacement factor in minutes.
+// This is displacement from the GMT.
+CORBA::Short
+TAO_Time_Service_Clerk::time_displacement_factor (void)
+{
+ return time_displacement_factor_;
+}
+
+// Sets the TDF.
+void
+TAO_Time_Service_Clerk::time_displacement_factor (CORBA::Short tdf)
+{
+ this->time_displacement_factor_ = tdf;
+}
+
+// GET method for inaccuracy.
+TimeBase::InaccuracyT
+TAO_Time_Service_Clerk::inaccuracy (void)
+{
+ return this->inaccuracy_;
+}
+
+// SET method for inaccuracy.
+void
+TAO_Time_Service_Clerk::inaccuracy (TimeBase::InaccuracyT inaccuracy)
+{
+ this->inaccuracy_ = inaccuracy;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.h b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.h
new file mode 100644
index 00000000000..ef8d5a9a3dd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.h
@@ -0,0 +1,141 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file TAO_Time_Service_Clerk.h
+ *
+ * $Id$
+ *
+ * This class implements the CosTime::TimeService IDL interface.
+ *
+ *
+ * @author Vishal Kachroo <vishal@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_TIME_SERVICE_CLERK_H
+#define TAO_TIME_SERVICE_CLERK_H
+#include /**/ "ace/pre.h"
+
+#include "ace/Reactor.h"
+
+#include "orbsvcs/TimeServiceS.h"
+#include "orbsvcs/Time/Timer_Helper.h"
+#include "orbsvcs/Time/time_export.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Time_Service_Clerk
+ *
+ * @brief TimeService Object Implementation.
+ *
+ * The Object implementation implements methods to retrieve
+ * GLOBAL time as well as secure GLOBAL time. The times are
+ * retrieved as UTOs. The object also allows creation of a TIO
+ * for a given time interval. In general, the TimeService clerk
+ * manages the UTOs and the TIOs. The notion of time returned
+ * here is the globally synchronized time.
+ */
+class TAO_Time_Export TAO_Time_Service_Clerk : public POA_CosTime::TimeService
+{
+public:
+
+ /// Helper class to help in the updation of time.
+ friend class Timer_Helper;
+
+ /// Unbounded set of IORs.
+ typedef ACE_Array_Base<CosTime::TimeService_var> IORS;
+
+ // = Initialization and termination methods.
+ /// Constructor.
+ TAO_Time_Service_Clerk (int timer_value,
+ int timer_value_usecs,
+ const IORS& server);
+
+ /// Destructor.
+ ~TAO_Time_Service_Clerk (void);
+
+ /// This operation returns the global time and an estimate of
+ /// inaccuracy in a UTO.
+ virtual CosTime::UTO_ptr universal_time (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable));
+
+ /**
+ * This operation returns the global time in a UTO only if the time
+ * can be guaranteed to have been obtained securely. Currently this
+ * operation is not implemented and throws a CORBA::NO_IMPLEMENT
+ * exception, if called.
+ */
+ virtual CosTime::UTO_ptr secure_universal_time (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable));
+
+ /// This creates a new UTO based on the given parameters.
+ virtual CosTime::UTO_ptr new_universal_time (TimeBase::TimeT time,
+ TimeBase::InaccuracyT inaccuracy,
+ TimeBase::TdfT tdf
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// This creates a new UTO given a time in the UtcT form.
+ virtual CosTime::UTO_ptr uto_from_utc (const TimeBase::UtcT &utc
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// This creates a new TIO with the given parameters.
+ virtual CosTime::TIO_ptr new_interval (TimeBase::TimeT lower,
+ TimeBase::TimeT upper
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the globally synchronized time.
+ virtual CORBA::ULongLong get_time (void);
+
+ /// Returns the time displacement factor.
+ CORBA::Short time_displacement_factor (void);
+
+ /// Set the TDF.
+ void time_displacement_factor (CORBA::Short);
+
+ /// Get method for inaccuracy.
+ TimeBase::InaccuracyT inaccuracy (void);
+
+ /// Set method for inaccuracy.
+ void inaccuracy (TimeBase::InaccuracyT inaccuracy);
+
+ /// Clerk's notion of time.
+ CORBA::ULongLong time_;
+
+private:
+
+ /// Time displacement factor in minutes.
+ CORBA::Short time_displacement_factor_;
+
+ /// Inaccuracy in the time.
+ TimeBase::InaccuracyT inaccuracy_;
+
+ /// Set of server Time Server IORs.
+ IORS server_;
+
+ /// Time when last global synchronization was done.
+ CORBA::ULongLong update_timestamp_;
+
+ /**
+ * This is a friend class that inherits from the Event Handler
+ * class. The handle_timeout method of this class is scheduled for
+ * periodic invocation by the reactor. This method, in turn, updates
+ * the clerks notion of time. Using this class obviates the need for
+ * the clerk to multiple inherit from the servant base as well as
+ * the event handler.
+ */
+ Timer_Helper helper_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TIME_SERVICE_CLERK_H */
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.cpp b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.cpp
new file mode 100644
index 00000000000..6fc4cf2b98e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.cpp
@@ -0,0 +1,127 @@
+#include "orbsvcs/Time/TAO_UTO.h"
+#include "orbsvcs/Time/TAO_TIO.h"
+#include "orbsvcs/Time/TAO_Time_Service_Server.h"
+#include "ace/OS_NS_sys_time.h"
+#include "orbsvcs/Time_Utilities.h"
+
+#include "tao/debug.h"
+
+
+ACE_RCSID (Time,
+ TAO_Time_Service_Server,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Constructor.
+TAO_Time_Service_Server::TAO_Time_Service_Server (void)
+{
+}
+
+// Destructor.
+TAO_Time_Service_Server::~TAO_Time_Service_Server (void)
+{
+}
+
+// This method returns the current system time and an estimate of
+// inaccuracy in a UTO.
+
+CosTime::UTO_ptr
+TAO_Time_Service_Server::universal_time (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable))
+{
+ TAO_UTO *uto = 0;
+
+ TimeBase::TimeT timestamp;
+ ORBSVCS_Time::Absolute_Time_Value_to_TimeT(timestamp, ACE_OS::gettimeofday());
+
+ // Return the local time of the system as a UTO.
+ ACE_NEW_THROW_EX (uto,
+ TAO_UTO (timestamp,
+ 0,
+ 0),
+ CORBA::NO_MEMORY ());
+
+ ACE_CHECK_RETURN (CosTime::UTO::_nil ());
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Returning a UTO\n"));
+
+ return uto->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// This method returns the current time in a UTO only if the time can
+// be guaranteed to have been obtained securely. This method is not
+// implemented currently.
+
+CosTime::UTO_ptr
+TAO_Time_Service_Server::secure_universal_time (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
+ CosTime::UTO::_nil ());
+}
+
+// This creates a new UTO based on the given parameters.
+
+CosTime::UTO_ptr
+TAO_Time_Service_Server::new_universal_time (TimeBase::TimeT time,
+ TimeBase::InaccuracyT inaccuracy,
+ TimeBase::TdfT tdf
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_UTO *uto = 0;
+
+ ACE_NEW_THROW_EX (uto,
+ TAO_UTO (time,
+ inaccuracy,
+ tdf),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosTime::UTO::_nil ());
+
+ return uto->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// This creates a new UTO given a time in the UtcT form.
+
+CosTime::UTO_ptr
+TAO_Time_Service_Server::uto_from_utc (const TimeBase::UtcT &utc
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_UTO *uto = 0;
+
+ ACE_NEW_THROW_EX (uto,
+ TAO_UTO (utc.time,
+ utc.inacclo + utc.inacchi,
+ utc.tdf),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosTime::UTO::_nil ());
+
+ return uto->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// This creates a new TIO with the given parameters.
+
+CosTime::TIO_ptr
+TAO_Time_Service_Server::new_interval (TimeBase::TimeT lower,
+ TimeBase::TimeT upper
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_TIO *tio = 0;
+
+ ACE_NEW_THROW_EX (tio,
+ TAO_TIO (lower,
+ upper),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CosTime::TIO::_nil ());
+
+ return tio->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.h b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.h
new file mode 100644
index 00000000000..c87d563935a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.h
@@ -0,0 +1,87 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file TAO_Time_Service_Server.h
+ *
+ * $Id$
+ *
+ * This class implements the CosTime::TimeService IDL interface.
+ *
+ *
+ * @author Vishal Kachroo <vishal@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_TIME_SERVICE_SERVER_H
+#define TAO_TIME_SERVICE_SERVER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/TimeServiceS.h"
+#include "orbsvcs/Time/time_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Time_Service_Server
+ *
+ * @brief TimeService Object Implementation.
+ *
+ * The Object implementation implements methods to retrieve
+ * current time as well as secure current time. The times are
+ * retrieved as UTOs. The object also allows creation of a TIO
+ * for a given time interval. In general, the TimeService
+ * manages the UTOs and the TIOs. The notion of time returned
+ * here is the local time of the system.
+ */
+class TAO_Time_Export TAO_Time_Service_Server : public POA_CosTime::TimeService
+{
+
+public:
+ // = Initialization and termination methods.
+ /// Constructor.
+ TAO_Time_Service_Server (void);
+
+ /// Destructor.
+ ~TAO_Time_Service_Server (void);
+
+ /// This operation returns the current system time and an estimate of
+ /// inaccuracy in a UTO.
+ virtual CosTime::UTO_ptr universal_time (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable));
+
+ /**
+ * This operation returns the current time in a UTO only if the time
+ * can be guaranteed to have been obtained securely. Currently this operation
+ * is not implemented and throws a CORBA::NO_IMPLEMENT exception, if called.
+ */
+ virtual CosTime::UTO_ptr secure_universal_time (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable));
+
+ /// This creates a new UTO based on the given parameters.
+ virtual CosTime::UTO_ptr new_universal_time (TimeBase::TimeT time,
+ TimeBase::InaccuracyT inaccuracy,
+ TimeBase::TdfT tdf
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// This creates a new UTO given a time in the UtcT form.
+ virtual CosTime::UTO_ptr uto_from_utc (const TimeBase::UtcT &utc
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// This creates a new TIO with the given parameters.
+ virtual CosTime::TIO_ptr new_interval (TimeBase::TimeT lower,
+ TimeBase::TimeT upper
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TIME_SERVICE_SERVER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.cpp b/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.cpp
new file mode 100644
index 00000000000..c9ea818a549
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.cpp
@@ -0,0 +1,246 @@
+// -*- C++ -*-
+// $Id$
+
+#include "orbsvcs/Time/TAO_UTO.h"
+#include "orbsvcs/Time/TAO_TIO.h"
+#include "ace/OS.h"
+
+
+ACE_RCSID (Time,
+ TAO_UTO,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_UTO::TAO_UTO (TimeBase::TimeT time,
+ TimeBase::InaccuracyT inaccuracy,
+ TimeBase::TdfT tdf)
+{
+
+ this->attr_utc_time_.time = time;
+
+ // Extract the lower 32 bits in the inacclo.
+ this->attr_utc_time_.inacclo = (CORBA::ULong) ACE_U64_TO_U32 (inaccuracy);
+
+ // Extract the lower 16 bits of the remaining bits. 'And'ing with 0xFFFF
+ // is only a sanity check.
+
+#if defined (ACE_LACKS_U_LONGLONG_T)
+ this->attr_utc_time_.inacchi = 0;
+#else
+ this->attr_utc_time_.inacchi =
+ static_cast<CORBA::UShort> ((inaccuracy >> 32U) & 0xFFFF);
+
+#endif /* ACE_LACKS_U_LONGLONG_T */
+
+ this->attr_utc_time_.tdf = tdf;
+
+}
+
+// Destructor.
+
+TAO_UTO::~TAO_UTO (void)
+{
+}
+
+// Get Method for the readonly attribute time.
+
+TimeBase::TimeT
+TAO_UTO::time (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return attr_utc_time_.time;
+}
+
+// Get method for the readonly attribute inaccuracy.
+
+TimeBase::InaccuracyT
+TAO_UTO::inaccuracy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Construct the Inaccuracy from the
+ // inacchi and inacclo.
+
+ TimeBase::InaccuracyT inaccuracy = attr_utc_time_.inacchi;
+ inaccuracy <<= 32;
+ inaccuracy |= attr_utc_time_.inacclo;
+ return inaccuracy;
+}
+
+// Get method for the readonly attribute tdf.
+
+TimeBase::TdfT
+TAO_UTO::tdf (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return attr_utc_time_.tdf;
+}
+
+// Get method for the readonly attribute utc_time.
+
+TimeBase::UtcT
+TAO_UTO::utc_time (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return attr_utc_time_;
+}
+
+// Absolute time = Relative time + Base time. ?? Find out more about
+// the Base Time, UTC and Distributed Time Sync. Algos. [3].
+
+CosTime::UTO_ptr
+TAO_UTO::absolute_time (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CosTime::UTO::_nil ();
+}
+
+// Compares the time contained in the object with the time in the
+// supplied uto according to the supplied comparison type.
+
+CosTime::TimeComparison
+TAO_UTO::compare_time (CosTime::ComparisonType comparison_type,
+ CosTime::UTO_ptr uto
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TimeBase::TimeT uto_time = uto->time (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTime::TCIndeterminate);
+
+ TimeBase::InaccuracyT this_inaccuracy =
+ this->inaccuracy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTime::TCIndeterminate);
+
+ TimeBase::InaccuracyT uto_inaccuracy =
+ uto->inaccuracy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTime::TCIndeterminate);
+
+ if (comparison_type == CosTime::MidC)
+ {
+ if (this->time () == uto_time)
+ {
+ return CosTime::TCEqualTo;
+ }
+ else if (this->time () > uto_time)
+ {
+ return CosTime::TCGreaterThan;
+ }
+ else
+ return CosTime::TCLessThan;
+ }
+ else if (this->time () == uto_time)
+ {
+ if (this_inaccuracy == 0U
+ && uto_inaccuracy == 0U)
+ {
+ return CosTime::TCEqualTo;
+ }
+ }
+ else
+ {
+ if (this->time () > uto_time)
+ {
+ if (this->time () - this_inaccuracy
+ > uto_time - uto_inaccuracy)
+ {
+ return CosTime::TCGreaterThan;
+ }
+ }
+ else if (this->time () + this_inaccuracy
+ < uto_time - uto_inaccuracy)
+ {
+ return CosTime::TCLessThan;
+ }
+ }
+
+ return CosTime::TCIndeterminate;
+}
+
+// Returns a TIO representing the time interval between the time in
+// the object and the time in the UTO passed as a parameter. The
+// interval returned is the interval between the mid-points of the two
+// UTOs. Inaccuracies are ignored. Note the result of this operation
+// is meaningless if the base times of UTOs are different.
+
+CosTime::TIO_ptr
+TAO_UTO::time_to_interval (CosTime::UTO_ptr uto
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_TIO *tio = 0;
+
+ ACE_TRY
+ {
+ TimeBase::TimeT uto_time = uto->time (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->time () > uto_time)
+ {
+ ACE_NEW_THROW_EX (tio,
+ TAO_TIO (uto_time,
+ this->time ()),
+ CORBA::NO_MEMORY ());
+
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ ACE_NEW_THROW_EX (tio,
+ TAO_TIO (this->time (),
+ uto_time),
+ CORBA::NO_MEMORY ());
+
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception:");
+ return CosTime::TIO::_nil ();
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (CosTime::TIO::_nil ());
+
+ return tio->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// Returns a TIO object representing the error interval around the
+// time value in the UTO.
+
+CosTime::TIO_ptr
+TAO_UTO::interval (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_TIO *tio = 0;
+
+ ACE_TRY
+ {
+ TimeBase::TimeT this_inaccuracy =
+ this->inaccuracy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TimeBase::TimeT lower =
+ this->time () - this_inaccuracy;
+
+ TimeBase::TimeT upper =
+ this->time () + this_inaccuracy;
+
+ ACE_NEW_THROW_EX (tio,
+ TAO_TIO (lower,
+ upper),
+ CORBA::NO_MEMORY ());
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception:");
+ return CosTime::TIO::_nil ();
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (CosTime::TIO::_nil ());
+
+ return tio->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.h b/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.h
new file mode 100644
index 00000000000..b4e72e090da
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.h
@@ -0,0 +1,119 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file TAO_UTO.h
+ *
+ * $Id$
+ *
+ * This class implements the CosTime::UTO IDL interface.
+ *
+ *
+ * @author Vishal Kachroo <vishal@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_UTO_H
+#define TAO_UTO_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/TimeServiceS.h"
+#include "orbsvcs/Time/time_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_UTO
+ *
+ * @brief Universal Time Object Implementation.
+ *
+ * This is an encapsulation of the time. It provides the following
+ * operations on basic time.
+ * - Construction of a UTO from piece parts, and extraction of the
+ * piece parts from a UTO. The piece parts are the readonly
+ * attributes :
+ * time
+ * inaccuracy
+ * time displacement factor
+ * structure with all the above.
+ * - Comparison of time.
+ * - Conversion from relative to absolute time, and conversion to
+ * an interval (TIO).
+ */
+class TAO_Time_Export TAO_UTO : public POA_CosTime::UTO
+{
+public:
+ // = Initialization and termination methods.
+ /// Constructor.
+ TAO_UTO (TimeBase::TimeT time,
+ TimeBase::InaccuracyT inaccuracy,
+ TimeBase::TdfT tdf);
+
+ /// Destructor.
+ ~TAO_UTO (void);
+
+ /// For the readonly attribute <time>.
+ virtual TimeBase::TimeT time (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// For the readonly attribute <inaccuracy>.
+ virtual TimeBase::InaccuracyT inaccuracy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// For the readonly attribute <tdf>, which is the "time displacement
+ /// factor".
+ virtual TimeBase::TdfT tdf (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// For the readonly attribute <utc_time>.
+ virtual TimeBase::UtcT utc_time (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * Absolute time = Relative time + Base time.
+ * ?? Find out more about the Base Time, UTC and
+ * Distributed Time Sync. Algos. [3
+ */
+ CosTime::UTO_ptr absolute_time (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Compares the time contained in the object with the time in the
+ /// supplied uto according to the supplied comparison type.
+ CosTime::TimeComparison compare_time (CosTime::ComparisonType comparison_type,
+ CosTime::UTO_ptr uto
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * Returns a TIO representing the time interval between the time in
+ * the object and the time in the UTO passed as a parameter. The
+ * interval returned is the interval between the mid-points of the
+ * two UTOs. Inaccuracies are ignored. Note the result of this
+ * operation is meaningless if the base times of UTOs are different.
+ */
+ CosTime::TIO_ptr time_to_interval (CosTime::UTO_ptr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Returns a TIO object representing the error interval around the
+ /// time value in the UTO.
+ CosTime::TIO_ptr interval (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /**
+ * The readonly attribute structure having the time, inaccuracy and
+ * displacement. The get methods for other readonly attributes
+ * (time, inaccuracy, tdf) defined in the IDL use the members of
+ * this structure and hence need not have separate member variables
+ * for them.
+ */
+ TimeBase::UtcT attr_utc_time_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_UTO_H */
diff --git a/TAO/orbsvcs/orbsvcs/Time/Timer_Helper.cpp b/TAO/orbsvcs/orbsvcs/Time/Timer_Helper.cpp
new file mode 100644
index 00000000000..47923f8dba3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Time/Timer_Helper.cpp
@@ -0,0 +1,156 @@
+#include "orbsvcs/Time/Timer_Helper.h"
+#include "orbsvcs/Time/TAO_Time_Service_Clerk.h"
+
+#include "tao/debug.h"
+
+#include "ace/OS_NS_time.h"
+#include "ace/OS_NS_sys_time.h"
+
+ACE_RCSID (Time,
+ Timer_Helper,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+Timer_Helper::Timer_Helper (void)
+ : clerk_ (0)
+{
+}
+
+Timer_Helper::Timer_Helper (TAO_Time_Service_Clerk *clerk)
+ : clerk_ (clerk)
+{
+
+}
+
+Timer_Helper::~Timer_Helper (void)
+{
+}
+
+int
+Timer_Helper::handle_timeout (const ACE_Time_Value &,
+ const void *)
+{
+ int no_of_servers = 0;
+ CORBA::ULongLong sum = 0;
+
+ // The following are used to keep a track of the inaccuracy
+ // in synchronization.
+
+#if defined (ACE_LACKS_LONGLONG_T)
+ CORBA::ULongLong lowest_time (0xFFFFFFFF, 0xFFFFFFFF);
+#else
+ CORBA::ULongLong lowest_time = ACE_UINT64_LITERAL (0xFFFFFFFFFFFFFFFF);
+#endif
+
+ CORBA::ULongLong highest_time = 0;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ IORS::TYPE* value;
+ for (IORS::ITERATOR server_iterator (this->clerk_->server_);
+ server_iterator.next (value) != 0;
+ server_iterator.advance ())
+ {
+ // This is a remote call.
+ CosTime::UTO_var UTO_server =
+ (*value)->universal_time (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+#if defined (ACE_LACKS_LONGLONG_T)
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "\nTime = %Q\nInaccuracy = %Q\nTimeDiff = %d\nstruct.time = %Q\n"
+ "struct.inacclo = %d\nstruct.inacchi = %d\nstruct.Tdf = %d\n",
+ ACE_U64_TO_U32 (UTO_server->time ()),
+ ACE_U64_TO_U32 (UTO_server->inaccuracy ()),
+ UTO_server->tdf (),
+ ACE_U64_TO_U32 ((UTO_server->utc_time ()).time),
+ (UTO_server->utc_time ()).inacclo,
+ (UTO_server->utc_time ()).inacchi,
+ (UTO_server->utc_time ()).tdf));
+
+#else
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "\nTime = %Q\nInaccuracy = %Q\nTimeDiff = %d\nstruct.time = %Q\n"
+ "struct.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));
+#endif
+
+ CORBA::ULongLong curr_server_time =
+ UTO_server->time (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sum += curr_server_time;
+
+ ++no_of_servers;
+
+ // Set the highest time to the largest time seen so far.
+ if (curr_server_time > highest_time)
+ highest_time = curr_server_time;
+
+ // Set the lowest time to the smallest time seen so far.
+ if (curr_server_time < lowest_time)
+ lowest_time = curr_server_time;
+
+ }
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "\nUpdated time from %d servers in the network",
+ no_of_servers));
+
+ // Return the average of the times retrieved from the various
+ // servers.
+ clerk_->time_ = sum / no_of_servers ;
+
+ // Set the Time Displacement Factor. The TZ environment variable is
+ // read to set the time zone. We convert the timezone value from seconds
+ // to minutes.
+
+ ACE_OS::tzset ();
+ long arg = ACE_OS::timezone () / 60;
+ CORBA::Short goodarg = static_cast<CORBA::Short> (arg);
+ clerk_->time_displacement_factor (goodarg);
+
+ // Set the inaccuracy.
+ if (highest_time > lowest_time)
+ clerk_->inaccuracy (highest_time - lowest_time);
+ else
+ clerk_->inaccuracy (0);
+
+ const ACE_Time_Value timeofday = ACE_OS::gettimeofday ();
+
+ // Record the current time in a timestamp to know when global
+ // updation of time was done.
+ clerk_->update_timestamp_ =
+ static_cast<CORBA::ULongLong> (timeofday.sec ()) *
+ static_cast<ACE_UINT32> (10000000) +
+ static_cast<CORBA::ULongLong> (timeofday.usec () * 10);
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level > 0)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception in handle_timeout()\n");
+
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Time/Timer_Helper.h b/TAO/orbsvcs/orbsvcs/Time/Timer_Helper.h
new file mode 100644
index 00000000000..9bfd7297661
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Time/Timer_Helper.h
@@ -0,0 +1,80 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Timer_Helper.h
+ *
+ * $Id$
+ *
+ * This class is registered with the Reactor and extends from the
+ * event handler.It is a friend of the TAO_Time_Service_Clerk and
+ * helps to update the clerk's notion of globally synchronized
+ * time. This class obviates the need for multiple inheritance in
+ * the clerk.
+ *
+ * @author Vishal Kachroo <vishal@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TIMER_HELPER_H
+#define TIMER_HELPER_H
+
+#include /**/ "ace/pre.h"
+
+
+#include "ace/Event_Handler.h"
+#include "ace/Containers.h"
+#include "orbsvcs/Time/time_export.h"
+
+#include "orbsvcs/TimeServiceS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Time_Service_Clerk;
+
+/**
+ * @class Timer_Helper
+ *
+ * @brief Timer Helper for the clerk.
+ *
+ * The handle timeout method of this class is called periodically
+ * by the reactor. This method updates the clerk's notion of
+ * globally synchronized time by contacting the various Time
+ * Servers.
+ */
+class TAO_Time_Export Timer_Helper : public ACE_Event_Handler
+{
+public:
+ // = Initialization and termination methods.
+ /// Constructor.
+ Timer_Helper (void);
+
+ /// Destructor.
+ ~Timer_Helper (void);
+
+ /// Constructor that sets the clerk.
+ Timer_Helper (TAO_Time_Service_Clerk *clerk);
+
+ /// This method is called periodically by the Reactor to update the
+ /// clerk's time.
+ int handle_timeout (const ACE_Time_Value &time,
+ const void *arg);
+
+protected:
+ /// Clerk's instance that this class helps to update time.
+ TAO_Time_Service_Clerk *clerk_;
+
+ /// The set of server IORs.
+ typedef ACE_Array_Base<CosTime::TimeService_var> IORS;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TIMER_HELPER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Time/time_export.h b/TAO/orbsvcs/orbsvcs/Time/time_export.h
new file mode 100644
index 00000000000..53e8ff6bf74
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Time/time_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_TIME_EXPORT_H
+#define TAO_TIME_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_TIME_HAS_DLL)
+# define TAO_TIME_HAS_DLL 0
+# endif /* ! TAO_TIME_HAS_DLL */
+#else
+# if !defined (TAO_TIME_HAS_DLL)
+# define TAO_TIME_HAS_DLL 1
+# endif /* ! TAO_TIME_HAS_DLL */
+#endif
+
+#if defined (TAO_TIME_HAS_DLL) && (TAO_TIME_HAS_DLL == 1)
+# if defined (TAO_TIME_BUILD_DLL)
+# define TAO_Time_Export ACE_Proper_Export_Flag
+# define TAO_TIME_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_TIME_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_TIME_BUILD_DLL */
+# define TAO_Time_Export ACE_Proper_Import_Flag
+# define TAO_TIME_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_TIME_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_TIME_BUILD_DLL */
+#else /* TAO_TIME_HAS_DLL == 1 */
+# define TAO_Time_Export
+# define TAO_TIME_SINGLETON_DECLARATION(T)
+# define TAO_TIME_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_TIME_HAS_DLL == 1 */
+
+#endif /* TAO_TIME_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/TimeBase.idl b/TAO/orbsvcs/orbsvcs/TimeBase.idl
new file mode 100644
index 00000000000..40a51d7de8a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TimeBase.idl
@@ -0,0 +1,16 @@
+//
+// $Id$
+//
+
+#ifndef _TIME_BASE_IDL_
+#define _TIME_BASE_IDL_
+
+// Force the IDL compiler to include this file [it does not include
+// empty files]
+#pragma prefix "omg.org"
+
+#include "tao/TimeBase.pidl"
+
+#pragma prefix ""
+
+#endif /* _TIME_BASE_IDL_ */
diff --git a/TAO/orbsvcs/orbsvcs/TimeService.idl b/TAO/orbsvcs/orbsvcs/TimeService.idl
new file mode 100644
index 00000000000..c146223f83f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/TimeService.idl
@@ -0,0 +1,179 @@
+// -*- C++ -*-
+// $Id$
+
+#ifndef TAO_TIME_IDL
+#define TAO_TIME_IDL
+
+#include "TimeBase.idl"
+
+#pragma prefix "omg.org"
+
+module CosTime
+{
+ // = TITLE
+ // CosTime Module
+ //
+ // = DESCRIPTION
+ // This module has all the interfaces, and associated enum
+ // and exception declarations for the time service.
+
+ enum TimeComparison
+ {
+ // = TITLE
+ // TimeComparison defines the possible values that can be
+ // returned as a result of comparing two UTOs.
+
+ TCEqualTo,
+ TCLessThan,
+ TCGreaterThan,
+ TCIndeterminate
+ };
+
+ enum ComparisonType
+ {
+ // = TITLE
+ // ComparisonType defines the possible ways in which the times can
+ // be compared.
+
+ IntervalC,
+ MidC
+ };
+
+ enum OverlapType
+ {
+ // = TITLE
+ // OverlapType specifies the type of overlap between two time
+ // intervals.
+
+ OTContainer,
+ OTContained,
+ OTOverlap,
+ OTNoOverlap
+ };
+
+ exception TimeUnavailable
+ {
+ // = TITLE
+ // TimeUnavailable exception is raised by the Timeservice when
+ // it cannot successfully return time.
+ };
+
+ interface TIO; // forward declaration.
+
+ interface UTO
+ {
+ // = TITLE
+ // The interface UTO is an encapsulation of time.
+ //
+ // = DESCRIPTION
+ // This interface provides the following
+ // operations on basic time :
+ // - Construction of a UTO from piece parts, and extraction of the
+ // piece parts from a UTO. The piece parts are the readonly
+ // attributes :
+ // time
+ // inaccuracy
+ // time displacement factor
+ // structure with all the above.
+ //
+ // - Comparison of time.
+ //
+ // - Conversion from relative to absolute time, and conversion to
+ // an interval (TIO)
+
+ readonly attribute TimeBase::TimeT time;
+ // absolute tine value.
+
+ readonly attribute TimeBase::InaccuracyT inaccuracy;
+ // inaccuracy in the time.
+
+ readonly attribute TimeBase::TdfT tdf;
+ // the time displacement factor.
+
+ readonly attribute TimeBase::UtcT utc_time;
+ // structure having the absolute time, the inaccuracy and the time
+ // displacement factor.
+
+ UTO absolute_time ();
+ // This returns the absolute time by adding the base time to the
+ // relative time in the object.
+
+ TimeComparison compare_time (in ComparisonType comparison_type,
+ in UTO otu);
+ // Compares the time contained in the object with the time in
+ // the supplied uto according to the supplied comparison type.
+
+ TIO time_to_interval (in UTO otu);
+ // Returns a TIO representing the time interval between the time
+ // in the object and the time in the UTO passed as a
+ // parameter. The interval returned is the interval between the
+ // mid-points of the two UTOs. Inaccuracies are ignored. Note
+ // the result of this operation is meaningless if the base times
+ // of UTOs are different.
+
+ TIO interval ();
+ // Returns a TIO object representing the error interval around
+ // the time value in the UTO.
+ };
+
+ interface TIO
+ {
+ // = TITLE
+ // The TIO represents a time interval.
+ //
+ // = DESCRIPTION
+ // This interface has operations to compare itself with a UTO or
+ // another TIO. It also has an operation to create a UTO from
+ // the value of it's time interval.
+
+ readonly attribute TimeBase::IntervalT time_interval;
+ // Consists of a lower and an upper bound for the time interval.
+
+ CosTime::OverlapType spans (in UTO time,
+ out TIO overlap);
+ // This operation compares the time in this interface with the time
+ // in the supplied UTO and returns the overlap type as well as the
+ // interval of overlap in the form of a TIO.
+
+ CosTime::OverlapType overlaps (in TIO interval,
+ out TIO overlap);
+ // This operation compares the time in this interface with the time
+ // in the supplied TIO and returns the overlap type as well as the
+ // interval of overlap in the form of a TIO.
+
+ UTO time ();
+ // Converts the time interval in this interface into a UTO object by
+ // taking the midpoint of the interval as the time and the interval
+ // as the error envelope around the time.
+
+ };
+
+ interface TimeService
+ {
+ // = TITLE
+ // The time service manages the UTOs and the TIOs. This is the first
+ // interface seen by the clients requesting time.
+
+ UTO universal_time () raises (TimeUnavailable);
+ // This operation returns the current time and an estimate of
+ // inaccuracy in a UTO.
+
+ UTO secure_universal_time () raises(TimeUnavailable);
+ // This operation returns the current time in a UTO only if the
+ // time can be guaranteed to have been obtained securely.
+
+ UTO new_universal_time (in TimeBase::TimeT time,
+ in TimeBase::InaccuracyT inaccuracy,
+ in TimeBase::TdfT tdf);
+ // This creates a new UTO based on the given parameters.
+
+ UTO uto_from_utc (in TimeBase::UtcT utc);
+ // This creates a new UTO given a time in the UtcT form.
+
+ TIO new_interval (in TimeBase::TimeT lower,
+ in TimeBase::TimeT upper );
+ // This creates a new TIO with the given parameters.
+ };
+};
+
+#endif /* TAO_TIME_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/Time_Utilities.cpp b/TAO/orbsvcs/orbsvcs/Time_Utilities.cpp
new file mode 100644
index 00000000000..80152580eb5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Time_Utilities.cpp
@@ -0,0 +1,22 @@
+// $Id$
+
+#include "orbsvcs/Time_Utilities.h"
+
+#if !defined (__ACE_INLINE__)
+# include "orbsvcs/Time_Utilities.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(orbsvcs, Time_Utilities, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Number of nanoseconds between CORBA and POSIX epochs.
+#ifdef ACE_LACKS_LONGLONG_T
+const ACE_UINT64
+ORBSVCS_Time::Time_Base_Offset(0x82B60000, 0x0A990E2D6);
+#else
+const ACE_UINT64
+ORBSVCS_Time::Time_Base_Offset(ACE_UINT64_LITERAL(12218515200000000000));
+#endif
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Time_Utilities.h b/TAO/orbsvcs/orbsvcs/Time_Utilities.h
new file mode 100644
index 00000000000..8a471f31521
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Time_Utilities.h
@@ -0,0 +1,111 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Time_Utilities.h
+//
+// = AUTHOR
+// David Levine <levine@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef ORBSVCS_TIME_UTILITIES_H
+#define ORBSVCS_TIME_UTILITIES_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/TimeBaseC.h"
+#include "orbsvcs/svc_utils_export.h"
+#include "ace/OS_NS_time.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ORBSVCS_Time
+ *
+ * @brief Time conversion utilities.
+ *
+ * This class defines several static methods to convert between
+ * several ACE time structures and the CORBA TimeT structure.
+ *
+ * Recall that TimeBase::TimeT stores time in a 64-bit long long
+ * (or structure when that is not available) and uses hundreds of
+ * nanoseconds as time units (i.e. 1 second is 10^7 TimeT units).
+ *
+ * To convert between the CORBA and the UNIX epochs, we need to adjust
+ * absolute times by the difference between October 15th, 1582 (Julian
+ * Date 2299160.5) and January 1st, 1970 (Julian Date 2440578.5):
+ * 141418.0 days.
+ */
+class TAO_Svc_Utils_Export ORBSVCS_Time
+{
+public:
+ /// @brief A helper constant, IDL does not have constant for structures.
+ static TimeBase::TimeT zero ();
+
+ /**
+ * @name ACE_hrtime_t conversion routines
+ */
+ //@{
+ // We interpret an ACE_hrtime_t as nanoseconds.
+
+ /// @brief Convert relative high-resolution time to a <TimeBase::TimeT>.
+ static void hrtime_to_TimeT (TimeBase::TimeT &lhs,
+ ACE_hrtime_t rhs);
+
+ /// @brief Convert relative <TimeBase::TimeT> to a high-resolution time.
+ static void TimeT_to_hrtime (ACE_hrtime_t &lhs,
+ const TimeBase::TimeT &rhs);
+
+ /// @brief Convert relative <TimeBase::TimeT> to a high-resolution time.
+ static ACE_hrtime_t to_hrtime (const TimeBase::TimeT &t);
+ //@}
+
+
+ /**
+ * @name ACE_Time_Value conversion routines
+ */
+ //@{
+ // Recall that <ACE_Time_Value>s are <seconds, useconds> pairs.
+
+ /// @brief Convert relative <ACE_Time_Value> to a <TimeBase::TimeT>.
+ static void Time_Value_to_TimeT (TimeBase::TimeT& lhs,
+ const ACE_Time_Value& rhs);
+
+ /// @brief Convert relative <TimeBase::TimeT> to a <ACE_Time_Value>.
+ static void TimeT_to_Time_Value (ACE_Time_Value& lrs,
+ const TimeBase::TimeT& rhs);
+
+ /// @brief Convert relative <TimeBase::TimeT> to a <ACE_Time_Value>.
+ static ACE_Time_Value to_Time_Value (const TimeBase::TimeT &rhs);
+
+ /// @brief Convert absolute <ACE_Time_Value> to a <TimeBase::TimeT>
+ static void Absolute_Time_Value_to_TimeT (TimeBase::TimeT& lhs,
+ const ACE_Time_Value& rhs);
+
+ /// @brief Convert absolute <TimeBase::TimeT> to a <ACE_Time_Value>
+ static void Absolute_TimeT_to_Time_Value (ACE_Time_Value& lrs,
+ const TimeBase::TimeT& rhs);
+
+ /// @brief Convert absolute <TimeBase::TimeT> to a <ACE_Time_Value>.
+ static ACE_Time_Value to_Absolute_Time_Value (const TimeBase::TimeT &rhs);
+ //@}
+
+private:
+ /// @brief Number of nanoseconds between the CORBA and UNIX epochs.
+ static const ACE_UINT64 Time_Base_Offset;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "orbsvcs/Time_Utilities.i"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* ORBSVCS_TIME_UTILITIES_H */
diff --git a/TAO/orbsvcs/orbsvcs/Time_Utilities.i b/TAO/orbsvcs/orbsvcs/Time_Utilities.i
new file mode 100644
index 00000000000..f7531f657f3
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Time_Utilities.i
@@ -0,0 +1,103 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "ace/Time_Value.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE TimeBase::TimeT
+ORBSVCS_Time::zero ()
+{
+ return 0;
+}
+
+ACE_INLINE void
+ORBSVCS_Time::TimeT_to_hrtime (ACE_hrtime_t &lhs,
+ const TimeBase::TimeT& rhs)
+{
+ lhs = rhs;
+ lhs *= 100;
+}
+
+ACE_INLINE void
+ORBSVCS_Time::hrtime_to_TimeT (TimeBase::TimeT& lhs,
+ ACE_hrtime_t rhs)
+{
+ ACE_UINT64 t = rhs / 100; // convert to 100ns
+ lhs = t;
+}
+
+ACE_INLINE ACE_hrtime_t
+ORBSVCS_Time::to_hrtime (const TimeBase::TimeT& t)
+{
+ ACE_hrtime_t r;
+ ORBSVCS_Time::TimeT_to_hrtime (r, t);
+ return r;
+}
+
+ACE_INLINE void
+ORBSVCS_Time::Time_Value_to_TimeT (TimeBase::TimeT& lhs,
+ const ACE_Time_Value& rhs)
+{
+ ACE_hrtime_t t =
+ static_cast<ACE_hrtime_t> (rhs.sec ()) * ACE_U_ONE_SECOND_IN_NSECS +
+ static_cast<ACE_hrtime_t> (rhs.usec ()) * 1000u;
+
+ ORBSVCS_Time::hrtime_to_TimeT (lhs, t);
+}
+
+ACE_INLINE void
+ORBSVCS_Time::TimeT_to_Time_Value (ACE_Time_Value& lhs,
+ const TimeBase::TimeT& rhs)
+{
+ ACE_hrtime_t t;
+
+ ORBSVCS_Time::TimeT_to_hrtime (t, rhs);
+
+ lhs.set (static_cast<ACE_UINT32> (t / ACE_U_ONE_SECOND_IN_NSECS),
+ static_cast<ACE_UINT32> ((t % ACE_U_ONE_SECOND_IN_NSECS) / 1000));
+}
+
+ACE_INLINE ACE_Time_Value
+ORBSVCS_Time::to_Time_Value (const TimeBase::TimeT& t)
+{
+ ACE_Time_Value r;
+ ORBSVCS_Time::TimeT_to_Time_Value (r, t);
+ return r;
+}
+
+ACE_INLINE void
+ORBSVCS_Time::Absolute_Time_Value_to_TimeT (TimeBase::TimeT& lhs,
+ const ACE_Time_Value& rhs)
+{
+ ACE_hrtime_t t =
+ static_cast<ACE_hrtime_t> (rhs.sec ()) * ACE_U_ONE_SECOND_IN_NSECS +
+ static_cast<ACE_hrtime_t> (rhs.usec ()) * 1000u;
+
+ t += Time_Base_Offset;
+ ORBSVCS_Time::hrtime_to_TimeT (lhs, t);
+}
+
+ACE_INLINE void
+ORBSVCS_Time::Absolute_TimeT_to_Time_Value (ACE_Time_Value& lhs,
+ const TimeBase::TimeT& rhs)
+{
+ ACE_hrtime_t t;
+
+ ORBSVCS_Time::TimeT_to_hrtime (t, rhs);
+ t -= Time_Base_Offset;
+
+ lhs.set(static_cast<ACE_UINT32> (t / ACE_U_ONE_SECOND_IN_NSECS),
+ static_cast<ACE_UINT32> ((t % ACE_U_ONE_SECOND_IN_NSECS) / 1000));
+}
+
+ACE_INLINE ACE_Time_Value
+ORBSVCS_Time::to_Absolute_Time_Value (const TimeBase::TimeT& t)
+{
+ ACE_Time_Value r;
+ ORBSVCS_Time::Absolute_TimeT_to_Time_Value (r, t);
+ return r;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Constraint_Interpreter.cpp b/TAO/orbsvcs/orbsvcs/Trader/Constraint_Interpreter.cpp
new file mode 100644
index 00000000000..0db71ba50b0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Constraint_Interpreter.cpp
@@ -0,0 +1,255 @@
+// $Id$
+
+#include "orbsvcs/Trader/Constraint_Interpreter.h"
+#include "orbsvcs/Trader/Trader_Constraint_Visitors.h"
+
+ACE_RCSID (Trader,
+ Constraint_Interpreter,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Constraint_Interpreter::TAO_Constraint_Interpreter (
+ const CosTradingRepos::ServiceTypeRepository::TypeStruct& ts,
+ const char* constraints
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CosTrading::IllegalConstraint,
+ CORBA::NO_MEMORY))
+ : TAO_Interpreter ()
+{
+ // @@ Throwing Exception from constructor is very nasty situation to
+ // deal with.
+
+ TAO_Trader_Constraint_Validator type_checker (ts);
+
+ if (TAO_Interpreter::is_empty_string (constraints))
+ {
+ ACE_NEW_THROW_EX (this->root_,
+ TAO_Literal_Constraint ((CORBA::Boolean) 1),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ }
+ else
+ {
+ if (this->build_tree (constraints) != 0)
+ ACE_THROW (CosTrading::IllegalConstraint (constraints));
+
+ if (type_checker.validate (this->root_) == -1)
+ ACE_THROW (CosTrading::IllegalConstraint (constraints));
+ }
+}
+
+TAO_Constraint_Interpreter::
+TAO_Constraint_Interpreter (TAO_Constraint_Validator& validator,
+ const char* constraints
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalConstraint,
+ CORBA::NO_MEMORY))
+{
+ if (TAO_Interpreter::is_empty_string (constraints))
+ {
+ ACE_NEW_THROW_EX (this->root_,
+ TAO_Literal_Constraint ((CORBA::Boolean) 1),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ }
+ else
+ {
+ if (this->build_tree (constraints) != 0)
+ ACE_THROW (CosTrading::IllegalConstraint (constraints));
+
+ if (validator.validate (this->root_) == -1)
+ ACE_THROW (CosTrading::IllegalConstraint (constraints));
+ }
+}
+
+TAO_Constraint_Interpreter::~TAO_Constraint_Interpreter (void)
+{
+}
+
+CORBA::Boolean
+TAO_Constraint_Interpreter::evaluate (CosTrading::Offer* offer)
+{
+ TAO_Trader_Constraint_Evaluator evaluator (offer);
+ return evaluator.evaluate_constraint (this->root_);
+}
+
+CORBA::Boolean
+TAO_Constraint_Interpreter::evaluate (TAO_Constraint_Evaluator& evaluator)
+{
+ return evaluator.evaluate_constraint (this->root_);
+}
+
+TAO_Preference_Interpreter::TAO_Preference_Interpreter (
+ const CosTradingRepos::ServiceTypeRepository::TypeStruct& ts,
+ const char* preference
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CosTrading::Lookup::IllegalPreference,
+ CORBA::NO_MEMORY))
+ : TAO_Interpreter ()
+{
+ TAO_Trader_Constraint_Validator type_checker (ts);
+
+ if (TAO_Interpreter::is_empty_string (preference))
+ {
+ ACE_NEW_THROW_EX (this->root_,
+ TAO_Noop_Constraint (TAO_FIRST),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ }
+ else
+ {
+ if (this->build_tree (preference) != 0)
+ ACE_THROW (CosTrading::Lookup::IllegalPreference (preference));
+
+ if (type_checker.validate (this->root_) == -1)
+ ACE_THROW (CosTrading::Lookup::IllegalPreference (preference));
+ }
+}
+
+TAO_Preference_Interpreter::
+TAO_Preference_Interpreter (TAO_Constraint_Validator& validator,
+ const char* preference
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::Lookup::IllegalPreference,
+ CORBA::NO_MEMORY))
+ : TAO_Interpreter ()
+{
+ if (TAO_Interpreter::is_empty_string (preference))
+ {
+ ACE_NEW_THROW_EX (this->root_,
+ TAO_Noop_Constraint (TAO_FIRST),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ }
+ else
+ {
+ if (this->build_tree (preference) != 0)
+ ACE_THROW (CosTrading::Lookup::IllegalPreference (preference));
+
+ if (validator.validate (this->root_) == -1)
+ ACE_THROW (CosTrading::Lookup::IllegalPreference (preference));
+ }
+}
+
+TAO_Preference_Interpreter::~TAO_Preference_Interpreter ()
+{
+}
+
+void
+TAO_Preference_Interpreter::
+order_offer (CosTrading::Offer* offer,
+ CosTrading::OfferId offer_id)
+{
+ TAO_Trader_Constraint_Evaluator evaluator (offer);
+ this->order_offer (evaluator, offer, offer_id);
+}
+
+void
+TAO_Preference_Interpreter::
+order_offer (TAO_Constraint_Evaluator& evaluator,
+ CosTrading::Offer* offer,
+ CosTrading::OfferId offer_id)
+{
+ if (this->root_ != 0)
+ {
+ Preference_Info pref_info;
+
+ pref_info.offer_ = offer;
+ pref_info.offer_id_ = offer_id;
+ pref_info.evaluated_ = 1;
+
+ if (evaluator.evaluate_preference (this->root_, pref_info.value_) == 0)
+ {
+ // If the evaluation succeeds, insert the node into the
+ // correct place in the queue.
+ TAO_Expression_Type expr_type = this->root_->expr_type ();
+
+ if (expr_type == TAO_FIRST
+ || (expr_type == TAO_WITH
+ && ! static_cast<CORBA::Boolean> (pref_info.value_)))
+ this->offers_.enqueue_tail (pref_info);
+ else
+ this->offers_.enqueue_head (pref_info);
+
+ if (expr_type == TAO_MIN || expr_type == TAO_MAX)
+ {
+ Ordered_Offers::ITERATOR offer_iter (this->offers_);
+
+ // Push the new item down the list until the min/max
+ // criterion is satisfied. Observe the evaluation failed
+ // / evaluation suceeded partion in the list.
+ offer_iter.advance ();
+
+ for (int i = 1;
+ offer_iter.done () == 0;
+ offer_iter.advance (), i++)
+ {
+ Preference_Info* current_offer;
+ offer_iter.next (current_offer);
+
+ // Maintain the sorted order in the first partition.
+ if (current_offer->evaluated_ == 1
+ && ((expr_type == TAO_MIN
+ && pref_info.value_ > current_offer->value_)
+ || (expr_type == TAO_MAX
+ && pref_info.value_ < current_offer->value_)))
+ {
+ // Swap the out of order pair
+ this->offers_.set (*current_offer,
+ i - 1);
+ this->offers_.set (pref_info, i);
+ }
+ else
+ break;
+ }
+ }
+ }
+ else
+ {
+ // If the evaluation fails, just tack the sucker onto the
+ // end of the queue.
+ pref_info.evaluated_ = 0;
+ this->offers_.enqueue_tail (pref_info);
+ }
+ }
+}
+
+int
+TAO_Preference_Interpreter::
+remove_offer (CosTrading::Offer*& offer,
+ CosTrading::OfferId& offer_id)
+{
+ int return_value = -1;
+ Preference_Info pref_info;
+
+ return_value = this->offers_.dequeue_head (pref_info);
+
+ if (return_value == 0)
+ {
+ offer = pref_info.offer_;
+ offer_id = pref_info.offer_id_;
+ }
+
+ return return_value;
+}
+
+int
+TAO_Preference_Interpreter::
+remove_offer (CosTrading::Offer*& offer)
+{
+ CosTrading::OfferId offer_id = 0;
+ return this->remove_offer (offer, offer_id);
+}
+
+
+size_t
+TAO_Preference_Interpreter::num_offers (void)
+{
+ return this->offers_.size ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Constraint_Interpreter.h b/TAO/orbsvcs/orbsvcs/Trader/Constraint_Interpreter.h
new file mode 100644
index 00000000000..586f82080e4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Constraint_Interpreter.h
@@ -0,0 +1,166 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file Constraint_Interpreter.h
+ *
+ * $Id$
+ *
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_CONSTRAINT_INTERPRETER_H
+#define TAO_CONSTRAINT_INTERPRETER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Trader/Constraint_Nodes.h"
+#include "orbsvcs/Trader/Constraint_Visitors.h"
+#include "orbsvcs/Trader/Interpreter.h"
+
+#include "orbsvcs/CosTradingS.h"
+#include "orbsvcs/CosTradingReposS.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Constraint_Evaluator;
+class TAO_Constraint_Validator;
+
+/**
+ * @class TAO_Constraint_Interpreter
+ *
+ * @brief TAO_Constraint_Interpreter will, given a constraint string whose
+ * syntax and semantics comply with the trader specification for the
+ * constraint language, determine if a CosTrading::Offer meets the
+ * constraints.
+ *
+ * TAO_Constraint_Interpreter will first build an expression tree
+ * representing the constraint expression using Lex and Yacc. Then,
+ * using a TAO_Constraint_Validator, it will validate the semantic
+ * correctness of the tree. When the evaluate method is invoked with
+ * an Offer, the TAO_Constraint_Interpreter will construct an
+ * EvaluationVisitor, which will evaluate the tree and decide
+ * whether the offer meets the constraints.
+ */
+class TAO_Trading_Serv_Export TAO_Constraint_Interpreter : public TAO_Interpreter
+{
+public:
+ // = Initialization and termination methods.
+ TAO_Constraint_Interpreter (const CosTradingRepos::ServiceTypeRepository::TypeStruct& ts,
+ const char* constraints
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalConstraint,
+ CORBA::NO_MEMORY));
+
+ /**
+ * This constructor builds an expression tree representing the
+ * constraint specified in <constraints>, and throws an Illegal
+ * Constraint exception if the constraint given has syntax errors or
+ * semantic errors, such as mismatched types.
+ */
+ TAO_Constraint_Interpreter (TAO_Constraint_Validator& validator,
+ const char* constraints
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalConstraint,
+ CORBA::NO_MEMORY));
+
+ /// Destructor
+ ~TAO_Constraint_Interpreter (void);
+
+ CORBA::Boolean evaluate (CosTrading::Offer* offer);
+
+ CORBA::Boolean evaluate (TAO_Constraint_Evaluator& evaluator);
+
+ // Determine whether an offer fits the constraints with which the
+ // tree was constructed. This method is thread safe (hopefully).
+};
+
+/**
+ * @class TAO_Preference_Interpreter
+ *
+ * @brief The TAO_Preference_Interpreter will, given a valid preference
+ * string and offers, will order the offers based on the offers'
+ * compliance with the preferences.
+ *
+ * Each time the order_offer method is invoked, the
+ * TAO_Preference_Interpreter stores the offer reference in the
+ * order dictated by its evaluation of the preference string. After
+ * the TAO_Preference_Interpreter client has finished ordering all
+ * the offers, it will extract the offers in order using the
+ * remove_offer method.
+ */
+class TAO_Trading_Serv_Export TAO_Preference_Interpreter : public TAO_Interpreter
+{
+public:
+ // = Initialization and termination methods.
+ TAO_Preference_Interpreter (const CosTradingRepos::ServiceTypeRepository::TypeStruct& ts,
+ const char* preference
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::Lookup::IllegalPreference,
+ CORBA::NO_MEMORY));
+
+ /**
+ * Parse the preference string, determining first if it's
+ * valid. Throw an IllegalPreference exception if the preference
+ * doesn't conform to the BNF grammar for preferences.
+ */
+ TAO_Preference_Interpreter (TAO_Constraint_Validator& validator,
+ const char* preference
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::Lookup::IllegalPreference,
+ CORBA::NO_MEMORY));
+
+ /// Destructor
+ ~TAO_Preference_Interpreter(void);
+
+ void order_offer (CosTrading::Offer* offer,
+ CosTrading::OfferId offer_id = 0);
+
+ /// Evaluate the offer, and order it internally based on the results
+ /// of the evaluation.
+ void order_offer (TAO_Constraint_Evaluator& evaluator,
+ CosTrading::Offer* offer,
+ CosTrading::OfferId offer_id = 0);
+
+ int remove_offer (CosTrading::Offer*& offer,
+ CosTrading::OfferId& offer_id);
+
+ /// Remove the next offer. The offer returned will be the next in the
+ /// ordering determined by the preference string.
+ int remove_offer (CosTrading::Offer*& offer);
+
+ /// Return the number of offers remaining in the ordering.
+ size_t num_offers (void);
+
+ struct Preference_Info
+ {
+ /// True if the preference evaluation didn't return an error for this offer.
+ CORBA::Boolean evaluated_;
+
+ /// The value of the preference evaluation.
+ TAO_Literal_Constraint value_;
+
+ /// The offer id of this offer.
+ CosTrading::OfferId offer_id_;
+
+ /// A pointer to the offer.
+ CosTrading::Offer* offer_;
+ };
+
+ typedef ACE_Unbounded_Queue<Preference_Info> Ordered_Offers;
+
+private:
+
+ /// Disallow copying.
+ TAO_Preference_Interpreter (const TAO_Preference_Interpreter&);
+ TAO_Preference_Interpreter& operator= (const TAO_Preference_Interpreter&);
+
+ /// The ordered list of offers.
+ Ordered_Offers offers_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_CONSTRAINT_INTERPRETER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Constraint_Nodes.cpp b/TAO/orbsvcs/orbsvcs/Trader/Constraint_Nodes.cpp
new file mode 100644
index 00000000000..dd5ddc1e92b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Constraint_Nodes.cpp
@@ -0,0 +1,930 @@
+// $Id$
+
+#include "orbsvcs/Trader/Constraint_Nodes.h"
+#include "orbsvcs/Trader/Constraint_Visitors.h"
+
+#include "tao/AnyTypeCode/Any.h"
+#include "ace/OS_NS_string.h"
+
+ACE_RCSID (Trader,
+ Constraint_Nodes,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+int
+TAO_Noop_Constraint::accept (TAO_Constraint_Visitor* visitor)
+{
+ int return_value = -1;
+ switch (this->type_)
+ {
+ case TAO_FIRST:
+ return_value = visitor->visit_first (this);
+ break;
+ case TAO_RANDOM:
+ return_value = visitor->visit_random (this);
+ }
+
+ return return_value;
+}
+
+TAO_Binary_Constraint::
+TAO_Binary_Constraint (TAO_Expression_Type op_type,
+ TAO_Constraint* left,
+ TAO_Constraint* right)
+ : op_ (op_type),
+ left_ (left),
+ right_ (right)
+{
+}
+
+TAO_Binary_Constraint::~TAO_Binary_Constraint (void)
+{
+ delete left_;
+ delete right_;
+}
+
+// Dispatch table for the accept method
+static int (*dispatch_table[]) (TAO_Constraint_Visitor*,
+ TAO_Binary_Constraint*)=
+{
+ TAO_Binary_Constraint::visit_greater_than,
+ TAO_Binary_Constraint::visit_greater_than_equal,
+ TAO_Binary_Constraint::visit_less_than,
+ TAO_Binary_Constraint::visit_less_than_equal,
+ TAO_Binary_Constraint::visit_equal,
+ TAO_Binary_Constraint::visit_not_equal,
+ 0,
+ TAO_Binary_Constraint::visit_and,
+ TAO_Binary_Constraint::visit_or,
+ 0,
+ TAO_Binary_Constraint::visit_in,
+ TAO_Binary_Constraint::visit_twiddle,
+ 0,
+ TAO_Binary_Constraint::visit_add,
+ TAO_Binary_Constraint::visit_sub,
+ TAO_Binary_Constraint::visit_mult,
+ TAO_Binary_Constraint::visit_div
+};
+
+// Simulate the fun of actual double dispatching.
+
+int
+TAO_Binary_Constraint::accept (TAO_Constraint_Visitor* visitor)
+{
+ int offset = this->op_ - TAO_GT,
+ return_value = -1;
+
+ if (dispatch_table[offset] != 0)
+ return_value = dispatch_table[offset] (visitor, this);
+
+ return return_value;
+}
+
+int
+TAO_Binary_Constraint::
+visit_or (TAO_Constraint_Visitor* visitor,
+ TAO_Binary_Constraint* expr)
+{
+ return visitor->visit_or (expr);
+}
+
+int
+TAO_Binary_Constraint::
+visit_and (TAO_Constraint_Visitor* visitor,
+ TAO_Binary_Constraint* expr)
+{
+ return visitor->visit_and (expr);
+}
+
+int
+TAO_Binary_Constraint::
+visit_less_than (TAO_Constraint_Visitor* visitor,
+ TAO_Binary_Constraint* expr)
+{
+ return visitor->visit_less_than (expr);
+}
+
+int
+TAO_Binary_Constraint::
+visit_less_than_equal (TAO_Constraint_Visitor* visitor,
+ TAO_Binary_Constraint* expr)
+{
+ return visitor->visit_less_than_equal (expr);
+}
+
+int
+TAO_Binary_Constraint::
+visit_greater_than (TAO_Constraint_Visitor* visitor,
+ TAO_Binary_Constraint* expr)
+{
+ return visitor->visit_greater_than (expr);
+}
+
+int
+TAO_Binary_Constraint::
+visit_greater_than_equal (TAO_Constraint_Visitor* visitor,
+ TAO_Binary_Constraint* expr)
+{
+ return visitor->visit_greater_than_equal (expr);
+}
+
+int
+TAO_Binary_Constraint::
+visit_equal (TAO_Constraint_Visitor* visitor,
+ TAO_Binary_Constraint* expr)
+{
+ return visitor->visit_equal (expr);
+}
+
+int
+TAO_Binary_Constraint::
+visit_not_equal (TAO_Constraint_Visitor* visitor,
+ TAO_Binary_Constraint* expr)
+{
+ return visitor->visit_not_equal (expr);
+}
+
+int
+TAO_Binary_Constraint::
+visit_add (TAO_Constraint_Visitor* visitor,
+ TAO_Binary_Constraint* expr)
+{
+ return visitor->visit_add (expr);
+}
+
+int
+TAO_Binary_Constraint::
+visit_sub (TAO_Constraint_Visitor* visitor,
+ TAO_Binary_Constraint* expr)
+{
+ return visitor->visit_sub (expr);
+}
+
+int
+TAO_Binary_Constraint::
+visit_mult (TAO_Constraint_Visitor* visitor,
+ TAO_Binary_Constraint* expr)
+{
+ return visitor->visit_mult (expr);
+}
+
+int
+TAO_Binary_Constraint::
+visit_div (TAO_Constraint_Visitor* visitor,
+ TAO_Binary_Constraint* expr)
+{
+ return visitor->visit_div (expr);
+}
+
+int
+TAO_Binary_Constraint::
+visit_twiddle (TAO_Constraint_Visitor* visitor,
+ TAO_Binary_Constraint* expr)
+{
+ return visitor->visit_twiddle (expr);
+}
+
+int
+TAO_Binary_Constraint::
+visit_in (TAO_Constraint_Visitor* visitor,
+ TAO_Binary_Constraint* expr)
+{
+ return visitor->visit_in (expr);
+}
+
+
+TAO_Constraint*
+TAO_Binary_Constraint::left_operand (void) const
+{
+ return this->left_;
+}
+
+TAO_Constraint*
+TAO_Binary_Constraint::right_operand (void) const
+{
+ return this->right_;
+}
+
+TAO_Unary_Constraint::
+TAO_Unary_Constraint (TAO_Expression_Type op_type,
+ TAO_Constraint* operand)
+ : op_ (op_type),
+ operand_ (operand)
+{
+}
+
+TAO_Unary_Constraint::~TAO_Unary_Constraint (void)
+{
+ delete operand_;
+}
+
+
+int
+TAO_Unary_Constraint::accept (TAO_Constraint_Visitor* visitor)
+{
+ // Since there are only three unary operators, there's no need for a
+ // dispatch table.
+ int return_value = -1;
+ switch (this->op_)
+ {
+ case TAO_CONSTRAINT:
+ return_value = visitor->visit_constraint (this);
+ break;
+ case TAO_WITH:
+ return_value = visitor->visit_with (this);
+ break;
+ case TAO_MIN:
+ return_value = visitor->visit_min (this);
+ break;
+ case TAO_MAX:
+ return_value = visitor->visit_max (this);
+ break;
+ case TAO_NOT:
+ return_value = visitor->visit_not (this);
+ break;
+ case TAO_UMINUS:
+ return_value = visitor->visit_unary_minus (this);
+ break;
+ case TAO_EXIST:
+ return_value = visitor->visit_exist (this);
+ break;
+ }
+
+ return return_value;
+}
+
+TAO_Constraint*
+TAO_Unary_Constraint::operand (void)
+{
+ return this->operand_;
+}
+
+TAO_Property_Constraint::
+TAO_Property_Constraint (const char* name)
+ : name_ (CORBA::string_dup (name))
+{
+}
+
+TAO_Property_Constraint::~TAO_Property_Constraint (void)
+{
+ CORBA::string_free (this->name_);
+}
+
+int
+TAO_Property_Constraint::accept (TAO_Constraint_Visitor* visitor)
+{
+ return visitor->visit_property (this);
+}
+
+const char*
+TAO_Property_Constraint::name (void) const
+{
+ return name_;
+}
+
+TAO_Literal_Constraint::
+TAO_Literal_Constraint (const TAO_Literal_Constraint& lit)
+ : TAO_Constraint (lit)
+{
+ this->copy (lit);
+}
+
+
+TAO_Literal_Constraint::
+TAO_Literal_Constraint (CORBA::Any* any)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ CORBA::Any& any_ref = *any;
+ CORBA::TypeCode_var type = any_ref.type ();
+ // @@ No where to throw exception back.
+ CORBA::TCKind corba_type = CORBA::tk_null;
+ ACE_TRY
+ {
+ corba_type = type->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // @@ Seth: Don't know what else to do. Make sure we can tell
+ // when this constructor fails.
+ return;
+ }
+ ACE_ENDTRY;
+
+ this->type_ = TAO_Literal_Constraint::comparable_type (type.in ());
+ switch (this->type_)
+ {
+ case TAO_SIGNED:
+ this->op_.integer_ = 0;
+ if (corba_type == CORBA::tk_short)
+ {
+ CORBA::Short sh;
+ any_ref >>= sh;
+ this->op_.integer_ = (CORBA::Long) sh;
+ }
+ else
+ any_ref >>= this->op_.integer_;
+ break;
+ case TAO_UNSIGNED:
+ this->op_.uinteger_ = 0;
+ if (corba_type == CORBA::tk_ushort)
+ {
+ CORBA::UShort sh;
+ any_ref >>= sh;
+ this->op_.uinteger_ = (CORBA::ULong) sh;
+ }
+ else
+ any_ref >>= this->op_.uinteger_;
+ break;
+ case TAO_DOUBLE:
+ if (corba_type == CORBA::tk_float)
+ {
+ CORBA::Float fl;
+ (*any) >>= fl;
+ this->op_.double_ = (CORBA::Double) fl;
+ }
+ else
+ (*any) >>= this->op_.double_;
+ break;
+ case TAO_BOOLEAN:
+ {
+ CORBA::Any::to_boolean tmp (this->op_.bool_);
+ (*any) >>= tmp;
+ }
+ break;
+ case TAO_STRING:
+ {
+ const char* s;
+ any_ref >>= s;
+ this->op_.str_ = CORBA::string_dup (s);
+ }
+ break;
+ case TAO_SEQUENCE:
+ this->op_.any_ = any;
+ }
+}
+
+TAO_Literal_Constraint::TAO_Literal_Constraint (CORBA::ULong uinteger)
+ : type_ (TAO_UNSIGNED)
+{
+ this->op_.uinteger_ = uinteger;
+}
+
+TAO_Literal_Constraint::TAO_Literal_Constraint (CORBA::Long integer)
+ : type_ (TAO_SIGNED)
+{
+ this->op_.integer_ = integer;
+}
+
+TAO_Literal_Constraint::TAO_Literal_Constraint (CORBA::Boolean boolean)
+ : type_ (TAO_BOOLEAN)
+{
+ this->op_.bool_ = boolean;
+}
+
+TAO_Literal_Constraint::TAO_Literal_Constraint (CORBA::Double doub)
+ : type_ (TAO_DOUBLE)
+{
+ this->op_.double_ = doub;
+}
+
+TAO_Literal_Constraint::TAO_Literal_Constraint (const char* str)
+ : type_ (TAO_STRING)
+{
+ this->op_.str_ = CORBA::string_dup (str);
+}
+
+TAO_Literal_Constraint::~TAO_Literal_Constraint (void)
+{
+ if (this->type_ == TAO_STRING)
+ CORBA::string_free (this->op_.str_);
+}
+
+int
+TAO_Literal_Constraint::accept (TAO_Constraint_Visitor* visitor)
+{
+ return visitor->visit_literal (this);
+}
+
+void
+TAO_Literal_Constraint::operator= (const TAO_Literal_Constraint& co)
+{
+ this->copy (co);
+}
+
+TAO_Literal_Constraint::operator CORBA::Boolean (void) const
+{
+ return (this->type_ == TAO_BOOLEAN) ? this->op_.bool_ : 0;
+}
+
+TAO_Literal_Constraint::operator CORBA::ULong (void) const
+{
+ CORBA::ULong return_value = (CORBA::ULong)0;
+
+ if (this->type_ == TAO_UNSIGNED)
+ return_value = this->op_.uinteger_;
+ else if (this->type_ == TAO_SIGNED)
+ return_value =
+ (this->op_.integer_ > 0) ? (CORBA::ULong) this->op_.integer_ : 0;
+ else if (this->type_ == TAO_DOUBLE)
+ return_value =
+ (this->op_.double_ > 0) ?
+ ((this->op_.double_ > ACE_UINT32_MAX) ?
+ ACE_UINT32_MAX :
+ (CORBA::ULong) this->op_.double_)
+ : 0;
+
+ return return_value;
+}
+
+TAO_Literal_Constraint::operator CORBA::Long (void) const
+{
+ CORBA::Long return_value = (CORBA::Long)0;
+
+ if (this->type_ == TAO_SIGNED)
+ return_value = this->op_.integer_;
+ else if (this->type_ == TAO_UNSIGNED)
+ return_value =
+ (this->op_.uinteger_ > (CORBA::ULong) ACE_INT32_MAX) ?
+ ACE_INT32_MAX : (CORBA::Long) this->op_.uinteger_;
+ else if (this->type_ == TAO_DOUBLE)
+ return_value =
+ (this->op_.double_ > 0) ?
+ ((this->op_.double_ > ACE_INT32_MAX) ?
+ ACE_INT32_MAX :
+ (CORBA::Long) this->op_.double_) :
+ ((this->op_.double_ < ACE_INT32_MIN) ?
+ ACE_INT32_MIN :
+ (CORBA::Long) this->op_.double_);
+
+ return return_value;
+}
+
+TAO_Literal_Constraint::operator CORBA::Double (void) const
+{
+ CORBA::Double return_value = (CORBA::Double)0.0;
+
+ if (this->type_ == TAO_DOUBLE)
+ return_value = this->op_.double_;
+ else if (this->type_ == TAO_SIGNED)
+ return_value = (CORBA::Double) this->op_.integer_;
+ else if (this->type_ == TAO_UNSIGNED)
+ return_value = (CORBA::Double) this->op_.uinteger_;
+
+ return return_value;
+}
+
+TAO_Literal_Constraint::operator const char* (void) const
+{
+ return (this->type_ == TAO_STRING) ? this->op_.str_ : 0;
+}
+
+TAO_Literal_Constraint::operator const CORBA::Any* (void) const
+{
+ return (this->type_ == TAO_SEQUENCE) ? this->op_.any_ : 0;
+}
+
+TAO_Expression_Type
+TAO_Literal_Constraint::comparable_type (CORBA::TypeCode_ptr type)
+{
+ // Convert a CORBA::TCKind into a TAO_Literal_Type
+ ACE_DECLARE_NEW_CORBA_ENV;
+ TAO_Expression_Type return_value = TAO_UNKNOWN;
+ CORBA::TCKind kind = CORBA::tk_null;
+ ACE_TRY
+ {
+ kind = type->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return return_value;
+ }
+ ACE_ENDTRY;
+ // Since this is a "top level try block, no need to check again.
+
+ switch (kind)
+ {
+ case CORBA::tk_ushort:
+ case CORBA::tk_ulong:
+ return_value = TAO_UNSIGNED;
+ break;
+ case CORBA::tk_long:
+ case CORBA::tk_short:
+ return_value = TAO_SIGNED;
+ break;
+ case CORBA::tk_boolean:
+ return_value = TAO_BOOLEAN;
+ break;
+ case CORBA::tk_float:
+ case CORBA::tk_double:
+ return_value = TAO_DOUBLE;
+ break;
+ case CORBA::tk_string:
+ return_value = TAO_STRING;
+ break;
+ case CORBA::tk_sequence:
+ return_value = TAO_SEQUENCE;
+ break;
+ case CORBA::tk_alias:
+ {
+ CORBA::TCKind kind = CORBA::tk_void;
+ ACE_TRY_EX (label2)
+ {
+ CORBA::TypeCode_var typecode = type->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (label2);
+ kind = typecode->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (label2);;
+ }
+ ACE_CATCHANY
+ {
+ return return_value;
+ }
+ ACE_ENDTRY;
+ // Since this is a "top level try block, no need to check again.
+
+ if (kind == CORBA::tk_sequence)
+ return_value = TAO_SEQUENCE;
+ }
+ break;
+ default:
+ return_value = TAO_UNKNOWN;
+ }
+
+ return return_value;
+}
+
+bool
+operator== (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right)
+{
+ bool return_value = false;
+ TAO_Expression_Type widest_type =
+ TAO_Literal_Constraint::widest_type (left, right);
+
+ switch (widest_type)
+ {
+ case TAO_STRING:
+ return_value = (ACE_OS::strcmp ((const char*) left, (const char*) right) == 0);
+ break;
+ case TAO_DOUBLE:
+ return_value = (CORBA::Double) left == (CORBA::Double) right;
+ break;
+ case TAO_SIGNED:
+ return_value = (CORBA::Long) left == (CORBA::Long) right;
+ break;
+ case TAO_UNSIGNED:
+ return_value = (CORBA::ULong) left == (CORBA::ULong) right;
+ break;
+ case TAO_BOOLEAN:
+ return_value = (CORBA::Boolean) left == (CORBA::Boolean) right;
+ break;
+ }
+
+ return return_value;
+}
+
+
+bool
+operator!= (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right)
+{
+ bool return_value = false;
+ TAO_Expression_Type widest_type =
+ TAO_Literal_Constraint::widest_type (left, right);
+
+ switch (widest_type)
+ {
+ case TAO_STRING:
+ return_value = (ACE_OS::strcmp ((const char*) left, (const char*) right) != 0);
+ break;
+ case TAO_DOUBLE:
+ return_value = (CORBA::Double) left != (CORBA::Double) right;
+ break;
+ case TAO_SIGNED:
+ return_value = (CORBA::Long) left != (CORBA::Long) right;
+ break;
+ case TAO_UNSIGNED:
+ return_value = (CORBA::ULong) left != (CORBA::ULong) right;
+ break;
+ case TAO_BOOLEAN:
+ return_value = (CORBA::Boolean) left != (CORBA::Boolean) right;
+ break;
+ }
+
+ return return_value;
+}
+
+bool
+operator< (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right)
+{
+ bool return_value = false;
+ TAO_Expression_Type widest_type =
+ TAO_Literal_Constraint::widest_type (left, right);
+
+ switch (widest_type)
+ {
+ case TAO_STRING:
+ return_value = (ACE_OS::strcmp ((const char*) left, (const char*) right) < 0);
+ break;
+ case TAO_DOUBLE:
+ return_value = (CORBA::Double) left < (CORBA::Double) right;
+ break;
+ case TAO_SIGNED:
+ return_value = (CORBA::Long) left < (CORBA::Long) right;
+ break;
+ case TAO_UNSIGNED:
+ return_value = (CORBA::ULong) left < (CORBA::ULong) right;
+ break;
+ case TAO_BOOLEAN:
+ return_value = (CORBA::Boolean) left < (CORBA::Boolean) right;
+ break;
+ }
+
+ return return_value;
+}
+
+bool
+operator<= (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right)
+{
+ bool return_value = false;
+ TAO_Expression_Type widest_type =
+ TAO_Literal_Constraint::widest_type (left, right);
+
+ switch (widest_type)
+ {
+ case TAO_STRING:
+ return_value = (ACE_OS::strcmp ((const char*) left, (const char*) right) <= 0);
+ break;
+ case TAO_DOUBLE:
+ return_value = (CORBA::Double) left <= (CORBA::Double) right;
+ break;
+ case TAO_SIGNED:
+ return_value = (CORBA::Long) left <= (CORBA::Long) right;
+ break;
+ case TAO_UNSIGNED:
+ return_value = (CORBA::ULong) left <= (CORBA::ULong) right;
+ break;
+ }
+
+ return return_value;
+}
+
+bool
+operator> (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right)
+{
+ bool return_value = false;
+ TAO_Expression_Type widest_type =
+ TAO_Literal_Constraint::widest_type (left, right);
+
+ switch (widest_type)
+ {
+ case TAO_STRING:
+ return_value = (ACE_OS::strcmp ((const char*) left, (const char*) right) > 0);
+ break;
+ case TAO_DOUBLE:
+ return_value = (CORBA::Double) left > (CORBA::Double) right;
+ break;
+ case TAO_SIGNED:
+ return_value = (CORBA::Long) left > (CORBA::Long) right;
+ break;
+ case TAO_UNSIGNED:
+ return_value = (CORBA::ULong) left > (CORBA::ULong) right;
+ break;
+ }
+
+ return return_value;
+}
+
+bool
+operator>= (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right)
+{
+ bool return_value = false;
+ TAO_Expression_Type widest_type =
+ TAO_Literal_Constraint::widest_type (left, right);
+
+ switch (widest_type)
+ {
+ case TAO_STRING:
+ return_value = (ACE_OS::strcmp ((const char*) left, (const char*) right) >= 0);
+ break;
+ case TAO_DOUBLE:
+ return_value = (CORBA::Double) left >= (CORBA::Double) right;
+ break;
+ case TAO_SIGNED:
+ return_value = (CORBA::Long) left >= (CORBA::Long) right;
+ break;
+ case TAO_UNSIGNED:
+ return_value = (CORBA::ULong) left >= (CORBA::ULong) right;
+ break;
+ }
+
+ return return_value;
+}
+
+
+bool
+operator== (CORBA::Double left, const TAO_Literal_Constraint& right)
+{
+ return (left == (CORBA::Double) right);
+}
+
+bool
+operator== (const TAO::String_Manager& left,
+ const TAO_Literal_Constraint& right)
+{
+ bool result = false;
+
+ if ((const char*) right != 0)
+ result = ACE_OS::strcmp ((const char*) left,
+ (const char*) right) == 0;
+ return result;
+}
+
+
+TAO_Literal_Constraint
+operator+ (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right)
+{
+ TAO_Expression_Type widest_type =
+ TAO_Literal_Constraint::widest_type (left, right);
+
+ switch (widest_type)
+ {
+ case TAO_DOUBLE:
+ {
+ CORBA::Double result = (CORBA::Double) left + (CORBA::Double) right;
+ return TAO_Literal_Constraint ((CORBA::Double) result);
+ }
+ case TAO_SIGNED:
+ {
+ CORBA::Long result = (CORBA::Long) left + (CORBA::Long) right;
+ return TAO_Literal_Constraint ((CORBA::Long) result);
+ }
+ case TAO_UNSIGNED:
+ {
+ CORBA::ULong result = (CORBA::ULong) left + (CORBA::ULong) right;
+ return TAO_Literal_Constraint ((CORBA::ULong) result);
+ }
+ default:
+ return TAO_Literal_Constraint ((CORBA::Long)0);
+ }
+}
+
+TAO_Literal_Constraint
+operator- (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right)
+{
+ TAO_Expression_Type widest_type =
+ TAO_Literal_Constraint::widest_type (left, right);
+
+ switch (widest_type)
+ {
+ case TAO_DOUBLE:
+ {
+ CORBA::Double result = (CORBA::Double) left - (CORBA::Double) right;
+ return TAO_Literal_Constraint ((CORBA::Double) result);
+ }
+ case TAO_SIGNED:
+ {
+ CORBA::Long result = (CORBA::Long) left - (CORBA::Long) right;
+ return TAO_Literal_Constraint ((CORBA::Long) result);
+ }
+ case TAO_UNSIGNED:
+ {
+ CORBA::ULong result = (CORBA::ULong) left - (CORBA::ULong) right;
+ return TAO_Literal_Constraint ((CORBA::ULong) result);
+ }
+ default:
+ return TAO_Literal_Constraint ((CORBA::Long)0);
+ }
+}
+
+TAO_Literal_Constraint
+operator* (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right)
+{
+ TAO_Expression_Type widest_type =
+ TAO_Literal_Constraint::widest_type (left, right);
+
+ switch (widest_type)
+ {
+ case TAO_DOUBLE:
+ {
+ CORBA::Double result = (CORBA::Double) left * (CORBA::Double) right;
+ return TAO_Literal_Constraint ((CORBA::Double) result);
+ }
+ case TAO_SIGNED:
+ {
+ CORBA::Long result = (CORBA::Long) left * (CORBA::Long) right;
+ return TAO_Literal_Constraint ((CORBA::Long) result);
+ }
+ case TAO_UNSIGNED:
+ {
+ CORBA::ULong result = (CORBA::ULong) left * (CORBA::ULong) right;
+ return TAO_Literal_Constraint ((CORBA::ULong) result);
+ }
+ default:
+ return TAO_Literal_Constraint ((CORBA::Long)0);
+ }
+}
+
+TAO_Literal_Constraint
+operator/ (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right)
+{
+ TAO_Expression_Type widest_type =
+ TAO_Literal_Constraint::widest_type (left, right);
+
+ switch (widest_type)
+ {
+ case TAO_DOUBLE:
+ {
+ CORBA::Double result = (CORBA::Double) left / (CORBA::Double) right;
+ return TAO_Literal_Constraint ((CORBA::Double) result);
+ }
+ case TAO_SIGNED:
+ {
+ CORBA::Long result = (CORBA::Long) left / (CORBA::Long) right;
+ return TAO_Literal_Constraint ((CORBA::Long) result);
+ }
+ case TAO_UNSIGNED:
+ {
+ CORBA::ULong result = (CORBA::ULong) left / (CORBA::ULong) right;
+ return TAO_Literal_Constraint ((CORBA::ULong) result);
+ }
+ default:
+ return TAO_Literal_Constraint ((CORBA::Long)0);
+ }
+}
+
+TAO_Literal_Constraint
+operator- (const TAO_Literal_Constraint& operand)
+{
+ switch (operand.expr_type ())
+ {
+ case TAO_DOUBLE:
+ {
+ CORBA::Double result = - (CORBA::Double) operand;
+ return TAO_Literal_Constraint ((CORBA::Double) result);
+ }
+ case TAO_SIGNED:
+ {
+ CORBA::Long result = - (CORBA::Long) operand;
+ return TAO_Literal_Constraint ((CORBA::Long) result);
+ }
+ case TAO_UNSIGNED:
+ {
+ CORBA::Long result = - (CORBA::Long) ((CORBA::ULong) operand);
+ return TAO_Literal_Constraint ((CORBA::ULong) result);
+ }
+ default:
+ return TAO_Literal_Constraint ((CORBA::Long)0);
+ }
+}
+
+TAO_Expression_Type
+TAO_Literal_Constraint::widest_type (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right)
+{
+ TAO_Expression_Type left_type = left.expr_type (),
+ right_type = right.expr_type (),
+ return_value = right_type;
+
+ if (right_type != left_type)
+ {
+ if (right_type > left_type)
+ return_value = right_type;
+ else
+ return_value = left_type;
+ }
+
+ return return_value;
+}
+
+void
+TAO_Literal_Constraint::copy (const TAO_Literal_Constraint& lit)
+{
+ this->type_ = lit.type_;
+ if (this->type_ == TAO_STRING)
+ this->op_.str_ = CORBA::string_dup (lit.op_.str_);
+ else if (this->type_ == TAO_DOUBLE)
+ this->op_.double_ = lit.op_.double_;
+ else if (this->type_ == TAO_UNSIGNED)
+ this->op_.uinteger_ = lit.op_.uinteger_;
+ else if (this->type_ == TAO_SIGNED)
+ this->op_.integer_ = lit.op_.integer_;
+ else if (this->type_ == TAO_BOOLEAN)
+ this->op_.bool_ = lit.op_.bool_;
+ else if (this->type_ == TAO_SEQUENCE)
+ this->op_.any_ = lit.op_.any_;
+ else
+ type_ = TAO_UNKNOWN;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Constraint_Nodes.h b/TAO/orbsvcs/orbsvcs/Trader/Constraint_Nodes.h
new file mode 100644
index 00000000000..6e9ccd203fd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Constraint_Nodes.h
@@ -0,0 +1,358 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Constraint_Nodes.h
+ *
+ * $Id$
+ *
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_CONSTRAINT_NODES_H
+#define TAO_CONSTRAINT_NODES_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Trader/Constraint_Tokens.h"
+
+#include "tao/Basic_Types.h"
+#include "tao/String_Manager_T.h"
+
+#include "orbsvcs/Trader/trading_serv_export.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning (disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Constraint_Visitor;
+typedef unsigned short TAO_Expression_Type;
+
+namespace CORBA
+{
+ class Any;
+ typedef Any *Any_ptr;
+
+ class TypeCode;
+ typedef TypeCode *TypeCode_ptr;
+}
+
+/**
+ * @class TAO_Constraint
+ *
+ * @brief TAO_Constraint is the base class of all nodes on the
+ * constraint expression tree.
+ *
+ * An TAO_Constraint knows what type of operation or entity
+ * it represents, and which method on TAO_Constraint_Visitor
+ * correlates to its type. When the accept method is invoked, a
+ * subclass dispatches the method on an TAO_Constraint_Visitor
+ * correlating to its type.
+ */
+class TAO_Trading_Serv_Export TAO_Constraint
+{
+public:
+
+ /**
+ * Implementing the pattern of double dispatching, each subclass of
+ * TAO_Constraint will call back on an InterpreterVisitor the
+ * method to handle a node of its ExpressionType.
+ */
+ virtual int accept (TAO_Constraint_Visitor* visitor) = 0;
+
+ /// Return the expression type represented by this node.
+ virtual TAO_Expression_Type expr_type (void) const = 0;
+
+ virtual ~TAO_Constraint (void) {}
+};
+
+/**
+ * @class TAO_Noop_Constraint
+ *
+ * @brief A node that represents an operation with no operands.
+ */
+class TAO_Trading_Serv_Export TAO_Noop_Constraint : public TAO_Constraint
+{
+public:
+
+ TAO_Noop_Constraint (TAO_Expression_Type type)
+ : type_ (type) {}
+
+ virtual int accept (TAO_Constraint_Visitor* visitor);
+
+ virtual TAO_Expression_Type expr_type (void) const
+ { return this->type_; }
+
+private:
+
+ TAO_Expression_Type type_;
+};
+
+/**
+ * @class TAO_Binary_Constraint
+ *
+ * @brief TAO_Binary_Constraint represents an operation with left
+ * and right operands.
+ */
+class TAO_Trading_Serv_Export TAO_Binary_Constraint : public TAO_Constraint
+{
+public:
+
+ TAO_Binary_Constraint (TAO_Expression_Type op_type,
+ TAO_Constraint* left,
+ TAO_Constraint* right);
+
+ virtual int accept (TAO_Constraint_Visitor* visitor);
+
+ virtual ~TAO_Binary_Constraint (void);
+
+ virtual TAO_Expression_Type expr_type (void) const
+ { return this->op_; }
+
+ /// Return the left operand of the binary expression
+ TAO_Constraint* left_operand (void) const;
+
+ /// Return the right operand of the binary expression
+ TAO_Constraint* right_operand (void) const;
+
+ // Allow double dispatching without creating an inundation of
+ // classes by using a dispatch table of static method pointers to
+ // invoke the correct visitor method as efficiently as a virtual
+ // method invocation.
+ static int visit_or (TAO_Constraint_Visitor*, TAO_Binary_Constraint*);
+ static int visit_and (TAO_Constraint_Visitor* , TAO_Binary_Constraint*);
+ static int visit_less_than (TAO_Constraint_Visitor* , TAO_Binary_Constraint*);
+ static int visit_less_than_equal (TAO_Constraint_Visitor* , TAO_Binary_Constraint*);
+ static int visit_greater_than (TAO_Constraint_Visitor* , TAO_Binary_Constraint*);
+ static int visit_greater_than_equal (TAO_Constraint_Visitor* , TAO_Binary_Constraint*);
+ static int visit_equal (TAO_Constraint_Visitor* , TAO_Binary_Constraint*);
+ static int visit_not_equal (TAO_Constraint_Visitor* , TAO_Binary_Constraint*);
+ static int visit_add (TAO_Constraint_Visitor* , TAO_Binary_Constraint*);
+ static int visit_sub (TAO_Constraint_Visitor* , TAO_Binary_Constraint*);
+ static int visit_mult (TAO_Constraint_Visitor* , TAO_Binary_Constraint*);
+ static int visit_div (TAO_Constraint_Visitor* , TAO_Binary_Constraint*);
+ static int visit_twiddle (TAO_Constraint_Visitor* , TAO_Binary_Constraint*);
+ static int visit_in (TAO_Constraint_Visitor* , TAO_Binary_Constraint*);
+
+private:
+
+ TAO_Binary_Constraint (const TAO_Binary_Constraint&);
+ TAO_Binary_Constraint& operator= (const TAO_Binary_Constraint&);
+
+ /// The operator type
+ TAO_Expression_Type op_;
+
+ /// The operands of the expression
+ TAO_Constraint* left_;
+ TAO_Constraint* right_;
+};
+
+/**
+ * @class TAO_Unary_Constraint
+ *
+ * @brief TAO_Unary_Constraint represents an operation with only
+ * one operand.
+ */
+class TAO_Trading_Serv_Export TAO_Unary_Constraint : public TAO_Constraint
+{
+public:
+
+ TAO_Unary_Constraint (TAO_Expression_Type op_type,
+ TAO_Constraint* operand);
+
+ virtual ~TAO_Unary_Constraint (void);
+
+ virtual int accept (TAO_Constraint_Visitor* visitor);
+
+ virtual TAO_Expression_Type expr_type (void) const
+ { return this->op_; }
+
+ TAO_Constraint* operand (void);
+
+private:
+
+ TAO_Unary_Constraint (const TAO_Unary_Constraint&);
+ TAO_Unary_Constraint& operator= (const TAO_Unary_Constraint&);
+
+ /// The operator type
+ TAO_Expression_Type op_;
+
+ /// The operand of the expression
+ TAO_Constraint* operand_;
+};
+
+/**
+ * @class TAO_Property_Constraint
+ *
+ * @brief TAO_Property_Constraint represents a property whose
+ * value is determined by the offer being evaluated.
+ */
+class TAO_Trading_Serv_Export TAO_Property_Constraint : public TAO_Constraint
+{
+public:
+
+ TAO_Property_Constraint (const char* name);
+
+ virtual ~TAO_Property_Constraint (void);
+
+ virtual int accept (TAO_Constraint_Visitor* visitor);
+
+ virtual TAO_Expression_Type expr_type (void) const
+ { return TAO_IDENT; }
+
+ /// Returns the name of the property.
+ const char* name (void) const;
+
+private:
+
+ TAO_Property_Constraint (const TAO_Property_Constraint&);
+ TAO_Property_Constraint& operator= (const TAO_Property_Constraint&);
+
+ /// The name of the property.
+ char* name_;
+};
+
+/**
+ * @class TAO_Literal_Constraint
+ *
+ * @brief TAO_Literal_Constraint represents a literal occuring in
+ * the constraint expression tree.
+ */
+class TAO_Trading_Serv_Export TAO_Literal_Constraint : public TAO_Constraint
+{
+ public:
+
+ TAO_Literal_Constraint (void)
+ : type_ (TAO_UNKNOWN) {}
+
+ // = Constructors for each of the various types of literals.
+
+ TAO_Literal_Constraint (CORBA::Any* any);
+ TAO_Literal_Constraint (CORBA::ULong uinteger);
+ TAO_Literal_Constraint (CORBA::Long integer);
+ TAO_Literal_Constraint (CORBA::Boolean boolean);
+ TAO_Literal_Constraint (CORBA::Double doub);
+ TAO_Literal_Constraint (const char* str);
+
+ /// Copy constructor
+ TAO_Literal_Constraint (const TAO_Literal_Constraint& lit);
+
+ /// Destructor.
+ ~TAO_Literal_Constraint(void);
+
+ /// Visitor accept methods.
+ virtual int accept (TAO_Constraint_Visitor* visitor);
+
+ virtual TAO_Expression_Type expr_type (void) const
+ { return type_; }
+
+ /// Assignment operator.
+ void operator= (const TAO_Literal_Constraint& co);
+
+ // Conversion routines.
+ operator CORBA::Boolean (void) const;
+ operator CORBA::ULong (void) const;
+ operator CORBA::Long (void) const;
+ operator CORBA::Double (void) const;
+ operator const char* (void) const;
+ operator const CORBA::Any* (void) const;
+
+ // Return the type represented by this MysteryOperand.
+
+ // = Comparison operators.
+
+ friend bool
+ operator< (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right);
+
+ friend bool
+ operator<= (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right);
+
+ friend bool
+ operator> (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right);
+
+ friend bool
+ operator>= (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right);
+
+ friend bool
+ operator== (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right);
+
+ friend bool
+ operator!= (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right);
+
+ friend bool
+ operator== (double left,
+ const TAO_Literal_Constraint& right);
+
+ friend bool
+ operator== (const TAO::String_Manager& left,
+ const TAO_Literal_Constraint& right);
+
+ // = Arithmetic operators.
+
+ friend TAO_Literal_Constraint
+ operator+ (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right);
+
+ friend TAO_Literal_Constraint
+ operator- (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right);
+
+ friend TAO_Literal_Constraint
+ operator* (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right);
+
+ friend TAO_Literal_Constraint
+ operator/ (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right);
+
+ friend TAO_Literal_Constraint
+ operator- (const TAO_Literal_Constraint& operand);
+
+ /// Ensure both operands are of the same simple numeric type.
+ static TAO_Expression_Type
+ widest_type (const TAO_Literal_Constraint& left,
+ const TAO_Literal_Constraint& right);
+
+ /// Determine the comparable Expression Type from the CORBA type
+ static TAO_Expression_Type
+ comparable_type (CORBA::TypeCode_ptr type);
+
+ private:
+
+ /// Private copy method.
+ void copy (const TAO_Literal_Constraint& co);
+
+ union
+ {
+ char* str_;
+ CORBA::Any_ptr any_;
+ CORBA::ULong uinteger_;
+ CORBA::Long integer_;
+ CORBA::Boolean bool_;
+ CORBA::Double double_;
+ } op_;
+ // Union of the possible literal types.
+
+ /// The actual types of the TAO_Literal_Constraint.
+ TAO_Expression_Type type_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_CONSTRAINT_NODES_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Constraint_Tokens.h b/TAO/orbsvcs/orbsvcs/Trader/Constraint_Tokens.h
new file mode 100644
index 00000000000..864f8a512be
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Constraint_Tokens.h
@@ -0,0 +1,49 @@
+// $Id$
+
+#ifndef CONSTRAINT_TOKEN_H
+#define CONSTRAINT_TOKEN_H
+#include /**/ "ace/pre.h"
+
+# define TAO_GT 257
+# define TAO_GE 258
+# define TAO_LT 259
+# define TAO_LE 260
+# define TAO_EQ 261
+# define TAO_NE 262
+# define TAO_EXIST 263
+# define TAO_AND 264
+# define TAO_OR 265
+# define TAO_NOT 266
+# define TAO_IN 267
+# define TAO_TWIDDLE 268
+# define TAO_BOOLEAN 269
+# define TAO_PLUS 270
+# define TAO_MINUS 271
+# define TAO_MULT 272
+# define TAO_DIV 273
+# define TAO_UMINUS 274
+# define TAO_NUMBER 275
+# define TAO_RPAREN 276
+# define TAO_LPAREN 277
+# define TAO_IDENT 278
+# define TAO_STRING 279
+# define TAO_UNKNOWN 280
+# define TAO_UNSIGNED 281
+# define TAO_SIGNED 282
+# define TAO_DOUBLE 283
+# define TAO_CONSTRAINT 284
+# define TAO_SEQUENCE 285
+# define TAO_WITH 286
+# define TAO_MAX 287
+# define TAO_MIN 288
+# define TAO_FIRST 289
+# define TAO_RANDOM 290
+
+
+#include /**/ "ace/post.h"
+#endif //CONSTRAINT_TOKEN_H
+
+
+
+
+
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Constraint_Visitors.cpp b/TAO/orbsvcs/orbsvcs/Trader/Constraint_Visitors.cpp
new file mode 100644
index 00000000000..74b6cb25967
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Constraint_Visitors.cpp
@@ -0,0 +1,1204 @@
+// $Id$
+
+#include "orbsvcs/Trader/Constraint_Visitors.h"
+#include "orbsvcs/Trader/Constraint_Nodes.h"
+#include "orbsvcs/Trader/Interpreter_Utils_T.h"
+
+#include "tao/DynamicAny/DynSequence_i.h"
+
+#include "ace/OS_NS_string.h"
+
+
+ACE_RCSID (Trader,
+ Constraint_Visitors,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Constraint_Evaluator::Operand_Queue::Operand_Queue (void)
+{
+}
+
+TAO_Literal_Constraint&
+TAO_Constraint_Evaluator::Operand_Queue::get_left_operand (void)
+{
+ TAO_Literal_Constraint* left_operand = 0;
+ this->get (left_operand, 1);
+ return *left_operand;
+}
+
+TAO_Literal_Constraint&
+TAO_Constraint_Evaluator::Operand_Queue::get_right_operand (void)
+{
+ TAO_Literal_Constraint* right_operand = 0;
+ this->get (right_operand);
+ return *right_operand;
+}
+
+TAO_Literal_Constraint&
+TAO_Constraint_Evaluator::Operand_Queue::get_operand (void)
+{
+ TAO_Literal_Constraint* operand = 0;
+ this->get (operand);
+ return *operand;
+}
+
+void
+TAO_Constraint_Evaluator::Operand_Queue::dequeue_operand (void)
+{
+ TAO_Literal_Constraint operand;
+ this->dequeue_head (operand);
+}
+
+TAO_Constraint_Evaluator::TAO_Constraint_Evaluator (void)
+{
+ // No-Op.
+}
+
+CORBA::Boolean
+TAO_Constraint_Evaluator::evaluate_constraint (TAO_Constraint* root)
+{
+ CORBA::Boolean result = 0;
+ this->queue_.reset ();
+
+ // Evaluate the offer according to the constraints in root_;
+ if (root != 0)
+ {
+ if ((root->accept (this) == 0) &&
+ (! this->queue_.is_empty ()))
+ {
+ result = (CORBA::Boolean) this->queue_.get_operand();
+ this->queue_.dequeue_operand ();
+ }
+ }
+
+ // If a property couldn't be evaluated we must return 0.
+ return result;
+}
+
+int
+TAO_Constraint_Evaluator::
+evaluate_preference (TAO_Constraint* root,
+ TAO_Literal_Constraint& result)
+{
+ int return_value = -1;
+ while (! this->queue_.is_empty ())
+ this->queue_.dequeue_operand ();
+
+ // Evaluate the offer according to the constraints in root_;
+ if (root != 0)
+ {
+ if ((root->accept (this) == 0) &&
+ (! this->queue_.is_empty ()))
+ {
+ result = this->queue_.get_operand ();
+ this->queue_.dequeue_operand ();
+ return_value = 0;
+ }
+ }
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Evaluator::visit_constraint(TAO_Unary_Constraint* constraint)
+{
+ TAO_Constraint* operand = constraint->operand ();
+ return operand->accept (this);
+}
+
+int
+TAO_Constraint_Evaluator::visit_with (TAO_Unary_Constraint* unary_with)
+{
+ TAO_Constraint* operand = unary_with->operand ();
+ return operand->accept (this);
+}
+
+int
+TAO_Constraint_Evaluator::visit_min (TAO_Unary_Constraint* unary_min)
+{
+ TAO_Constraint* operand = unary_min->operand ();
+ return operand->accept (this);
+}
+
+int
+TAO_Constraint_Evaluator::visit_max (TAO_Unary_Constraint* unary_max)
+{
+ TAO_Constraint* operand = unary_max->operand ();
+ return operand->accept (this);
+}
+
+int
+TAO_Constraint_Evaluator::visit_random (TAO_Noop_Constraint *)
+{
+ TAO_Literal_Constraint random ((CORBA::Long) (ACE_OS::rand ()));
+ this->queue_.enqueue_head (random);
+ return 0;
+}
+
+int
+TAO_Constraint_Evaluator::visit_first (TAO_Noop_Constraint *)
+{
+ TAO_Literal_Constraint first ((CORBA::Long) 0);
+ this->queue_.enqueue_head (first);
+ return 0;
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_and (TAO_Binary_Constraint* boolean_and)
+{
+ int return_value = -1;
+ CORBA::Boolean result = (CORBA::Boolean) 0;
+ TAO_Constraint* left = boolean_and->left_operand (),
+ *right = boolean_and->right_operand ();
+
+ // Short circuiting AND.
+
+ if (left->accept (this) == 0)
+ {
+ result = (CORBA::Boolean) this->queue_.get_operand ();
+ this->queue_.dequeue_operand ();
+
+ if (result)
+ {
+ if (right->accept(this) == 0)
+ {
+ result = (CORBA::Boolean) this->queue_.get_operand();
+ this->queue_.dequeue_operand ();
+
+ return_value = 0;
+ }
+ }
+ else
+ return_value = 0;
+ }
+
+ if (return_value != -1)
+ this->queue_.enqueue_head (TAO_Literal_Constraint (result));
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_or (TAO_Binary_Constraint* boolean_or)
+{
+ int return_value = -1;
+ CORBA::Boolean result = (CORBA::Boolean) 0;
+ TAO_Constraint* left = boolean_or->left_operand (),
+ *right = boolean_or->right_operand ();
+
+ // Short-circuiting OR.
+
+ if (left->accept (this) == 0)
+ {
+ result = (CORBA::Boolean) this->queue_.get_operand ();
+ this->queue_.dequeue_operand ();
+
+ if (result == (CORBA::Boolean) 0)
+ {
+ if (right->accept (this) == 0)
+ {
+ result = (CORBA::Boolean) this->queue_.get_operand ();
+ this->queue_.dequeue_operand ();
+ return_value = 0;
+ }
+ }
+ else
+ return_value = 0;
+ }
+
+ if (return_value != -1)
+ this->queue_.enqueue_head (TAO_Literal_Constraint (result));
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_not (TAO_Unary_Constraint* unary_not)
+{
+ int return_value = -1;
+ TAO_Constraint* operand = unary_not->operand ();
+
+ // Logical NOT.
+
+ if (operand->accept (this) == 0)
+ {
+ CORBA::Boolean result = ! (CORBA::Boolean)this->queue_.get_operand ();
+ this->queue_.dequeue_operand ();
+ this->queue_.enqueue_head (TAO_Literal_Constraint (result));
+
+ return_value = 0;
+ }
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_exist (TAO_Unary_Constraint* unary_exist)
+{
+ TAO_Property_Constraint* operand =
+ (TAO_Property_Constraint*) unary_exist->operand ();
+ CORBA::String_var property_name ((const char*) operand->name ());
+
+ // Determine if a property is defined on this offer.
+
+ CORBA::Boolean result =
+ (CORBA::Boolean) (this->props_.find (property_name) == 0);
+
+ this->queue_.enqueue_head (TAO_Literal_Constraint (result));
+ return 0;
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_unary_minus (TAO_Unary_Constraint* unary_minus)
+{
+ int return_value = -1;
+ TAO_Constraint* operand = unary_minus->operand ();
+
+ if (operand->accept (this) == 0)
+ {
+ TAO_Literal_Constraint result = - this->queue_.get_operand ();
+ this->queue_.dequeue_operand ();
+ this->queue_.enqueue_head (result);
+
+ return_value = 0;
+ }
+
+ return return_value;
+}
+
+void
+TAO_Constraint_Evaluator::do_the_op (int operation)
+{
+ TAO_Literal_Constraint& l_op = this->queue_.get_left_operand ();
+ TAO_Literal_Constraint& r_op = this->queue_.get_right_operand ();
+
+ // Perform the listed bindary operation on the first two elements on
+ // the stack.
+
+ TAO_Literal_Constraint result =
+ (operation <= TAO_NE)
+ ?
+ TAO_Literal_Constraint
+ ((CORBA::Boolean)
+ ((operation == TAO_GT) ? l_op > r_op :
+ (operation == TAO_GE) ? l_op >= r_op :
+ (operation == TAO_LT) ? l_op < r_op :
+ (operation == TAO_LE) ? l_op <= r_op :
+ (operation == TAO_NE) ? l_op != r_op :
+ (operation == TAO_EQ) ? l_op == r_op : 0))
+ :
+ ((operation == TAO_PLUS) ? l_op + r_op :
+ (operation == TAO_MINUS) ? l_op - r_op :
+ (operation == TAO_MULT) ? l_op * r_op :
+ (operation == TAO_DIV) ? l_op / r_op :
+ TAO_Literal_Constraint ());
+
+ this->queue_.dequeue_operand ();
+ this->queue_.dequeue_operand ();
+ this->queue_.enqueue_head (result);
+}
+
+int
+TAO_Constraint_Evaluator::visit_bin_op (TAO_Binary_Constraint* op,
+ int operation)
+{
+ int return_value = -1;
+ TAO_Constraint* left = op->left_operand ();
+ TAO_Constraint* right = op->right_operand ();
+
+ // Perform an operation on the results of evaluating the left and
+ // right branches of this subtree.
+ if (left->accept (this) == 0)
+ {
+ if (right->accept (this) == 0)
+ {
+ this->do_the_op (operation);
+ return_value = 0;
+ }
+ else
+ this->queue_.dequeue_operand ();
+ }
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_add(TAO_Binary_Constraint* boolean_add)
+{
+ return this->visit_bin_op (boolean_add, TAO_PLUS);
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_sub (TAO_Binary_Constraint* boolean_sub)
+{
+ return this->visit_bin_op (boolean_sub, TAO_MINUS);
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_mult (TAO_Binary_Constraint* boolean_mult)
+{
+ return this->visit_bin_op (boolean_mult, TAO_MULT);
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_div (TAO_Binary_Constraint* boolean_div)
+{
+ return this->visit_bin_op (boolean_div, TAO_DIV);
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_twiddle (TAO_Binary_Constraint* binary_twiddle)
+{
+ int return_value = -1;
+ TAO_Constraint* left = binary_twiddle->left_operand (),
+ *right = binary_twiddle->right_operand ();
+
+ // Determine if the left operand is a substring of the right.
+
+ if (left->accept (this) == 0)
+ {
+ if (right->accept (this) == 0)
+ {
+ TAO_Literal_Constraint& left_operand = this->queue_.get_left_operand ();
+ TAO_Literal_Constraint& right_operand = this->queue_.get_right_operand ();
+
+ CORBA::Boolean result = (CORBA::Boolean)
+ (ACE_OS::strstr ((const char*)right_operand,
+ (const char*)left_operand) != 0);
+
+ this->queue_.dequeue_operand ();
+ this->queue_.dequeue_operand ();
+ this->queue_.enqueue_head (TAO_Literal_Constraint (result));
+ return_value = 0;
+ }
+ else
+ this->queue_.dequeue_operand ();
+ }
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_in(TAO_Binary_Constraint* binary_in)
+{
+ int return_value = -1;
+ TAO_Constraint* left = binary_in->left_operand (),
+ *right = binary_in->right_operand ();
+
+ // Determine if the left operand is contained in the right.
+
+ if (left->accept (this) == 0)
+ {
+ if (this->visit_property ((TAO_Property_Constraint*) right) == 0)
+ {
+ TAO_Literal_Constraint& left_value = this->queue_.get_left_operand();
+ const CORBA::Any* any = (const CORBA::Any*) this->queue_.get_right_operand();
+
+ if (any != 0)
+ {
+ CORBA::Boolean result =
+ this->sequence_does_contain ((CORBA::Any*) any, left_value);
+
+ this->queue_.dequeue_operand ();
+ this->queue_.dequeue_operand ();
+ this->queue_.enqueue_head (TAO_Literal_Constraint (result));
+ return_value = 0;
+ }
+ else
+ this->queue_.dequeue_operand ();
+ }
+ }
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_less_than (TAO_Binary_Constraint* boolean_lt)
+{
+ return this->visit_bin_op (boolean_lt, TAO_LT);
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_less_than_equal (TAO_Binary_Constraint* boolean_lte)
+{
+ return this->visit_bin_op (boolean_lte, TAO_LE);
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_greater_than (TAO_Binary_Constraint* boolean_gt)
+{
+ return this->visit_bin_op (boolean_gt, TAO_GT);
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_greater_than_equal (TAO_Binary_Constraint* boolean_gte)
+{
+ return this->visit_bin_op (boolean_gte, TAO_GE);
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_equal (TAO_Binary_Constraint* boolean_eq)
+{
+ return this->visit_bin_op (boolean_eq, TAO_EQ);
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_not_equal (TAO_Binary_Constraint* boolean_neq)
+{
+ return this->visit_bin_op (boolean_neq, TAO_NE);
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_literal (TAO_Literal_Constraint* literal)
+{
+ this->queue_.enqueue_head (*literal);
+ return 0;
+}
+
+int
+TAO_Constraint_Evaluator::
+visit_property (TAO_Property_Constraint* literal)
+{
+ ACE_UNUSED_ARG (literal);
+ return -1;
+ // A derived class decides how to do this.
+}
+
+/*@@ pradeep: where is this used?
+
+CORBA::Boolean
+TAO_find_string (CosTradingSequences::StringSeq& sequence,
+ const char* element)
+{
+ int length = sequence.length (),
+ return_value = 0;
+
+ for (int i = 0; i < length; i++)
+ {
+ if (ACE_OS::strcmp (sequence[i], element) == 0)
+ {
+ return_value = 1;
+ break;
+ }
+ }
+
+ return (CORBA::Boolean) return_value;
+}
+*/
+
+CORBA::Boolean
+TAO_Constraint_Evaluator::
+sequence_does_contain (CORBA::Any* sequence,
+ TAO_Literal_Constraint& element)
+{
+ // Helper method to cast the void* value returned from the sequence
+ // any into a sequence type locally compiled from idl. The sequence
+ // wrapper uses the [] operator to locate the target element in the
+ // sequence.
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ CORBA::Boolean return_value = 0;
+ CORBA::TypeCode_var type = sequence->type ();
+ CORBA::TCKind sequence_type = CORBA::tk_void;
+ ACE_TRY
+ {
+ sequence_type =
+ TAO_Sequence_Extracter_Base::sequence_type (type.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return return_value;
+ }
+ ACE_ENDTRY;
+ // ACE_CHECK_RETURN (return_value);
+
+ if (sequence_type == CORBA::tk_void)
+ return return_value;
+
+ switch (sequence_type)
+ {
+ case CORBA::tk_short:
+ {
+ CORBA::Long value = element;
+ return_value = ::TAO_find (*sequence, static_cast<CORBA::Short> (value));
+ }
+ break;
+ case CORBA::tk_ushort:
+ {
+ CORBA::ULong value = element;
+ return_value = ::TAO_find (*sequence, static_cast<CORBA::UShort> (value));
+ }
+ break;
+ case CORBA::tk_long:
+ {
+ CORBA::Long value = element;
+ return_value = ::TAO_find (*sequence, value);
+ }
+ break;
+ case CORBA::tk_ulong:
+ {
+ CORBA::ULong value = element;
+ return_value = ::TAO_find (*sequence, value);
+ }
+ break;
+ case CORBA::tk_float:
+ {
+ CORBA::Double value = element;
+ return_value = ::TAO_find (*sequence, static_cast<CORBA::Float> (value));
+ }
+ break;
+ case CORBA::tk_double:
+ {
+ CORBA::Double value = element;
+ return_value = ::TAO_find (*sequence, value);
+ }
+ break;
+ case CORBA::tk_boolean:
+ {
+ CORBA::Boolean value = element;
+ return_value = ::TAO_find (*sequence, value);
+ }
+ break;
+ case CORBA::tk_string:
+ {
+ const char* value = element;
+ return_value = ::TAO_find (*sequence, value);
+ }
+ break;
+ default:
+ break;
+ }
+
+ return return_value;
+}
+
+// Explicit template specializations
+
+int
+TAO_Element_Equal<CORBA::Short>::
+operator () (TAO_DynSequence_i& dyn_any,
+ CORBA::Short element) const
+{
+ int return_value = 0;
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Short value = dyn_any.get_short (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ return_value = (value == element);
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+ return return_value;
+}
+
+int
+TAO_Element_Equal<CORBA::UShort>::
+operator () (TAO_DynSequence_i& dyn_any,
+ CORBA::UShort element) const
+{
+ int return_value = 0;
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::UShort value = dyn_any.get_ushort (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ return_value = (value == element);
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+ return return_value;
+}
+
+int
+TAO_Element_Equal<CORBA::Long>::
+operator () (TAO_DynSequence_i& dyn_any,
+ CORBA::Long element) const
+{
+ int return_value = 0;
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Long value = dyn_any.get_long (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ return_value = (value == element);
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+ return return_value;
+}
+
+int
+TAO_Element_Equal<CORBA::ULong>::
+operator () (TAO_DynSequence_i& dyn_any,
+ CORBA::ULong element) const
+{
+ int return_value = 0;
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ULong value = dyn_any.get_ulong (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ return_value = (value == element);
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+ return return_value;
+}
+
+int
+TAO_Element_Equal<CORBA::Float>::
+operator () (TAO_DynSequence_i& dyn_any,
+ CORBA::Float element) const
+{
+ int return_value = 0;
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Float value = dyn_any.get_float (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ return_value = (value == element);
+ }
+ ACE_CATCHANY {} ACE_ENDTRY;
+ return return_value;
+}
+
+int
+TAO_Element_Equal<CORBA::Double>::
+operator () (TAO_DynSequence_i& dyn_any,
+ CORBA::Double element) const
+{
+ int return_value = 0;
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Double value = dyn_any.get_short (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ return_value = (value == element);
+ }
+ ACE_CATCHANY {} ACE_ENDTRY;
+ return return_value;
+}
+
+int
+TAO_Element_Equal<CORBA::Boolean>::
+operator () (TAO_DynSequence_i& dyn_any,
+ CORBA::Boolean element) const
+{
+ int return_value = 0;
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Boolean value = (CORBA::Boolean) dyn_any.get_short (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ return_value = (value == element);
+ }
+ ACE_CATCHANY {} ACE_ENDTRY;
+ return return_value;
+}
+
+int
+TAO_Element_Equal<const char*>::
+operator () (TAO_DynSequence_i& dyn_any,
+ const char* element) const
+{
+ int return_value = 0;
+ ACE_TRY_NEW_ENV
+ {
+ const char* value = dyn_any.get_string (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ return_value = (ACE_OS::strcmp (value, element) == 0);
+ }
+ ACE_CATCHANY {} ACE_ENDTRY;
+ return return_value;
+}
+
+TAO_Constraint_Validator::
+TAO_Constraint_Validator (void)
+{
+ // No-Op.
+}
+
+TAO_Constraint_Validator::~TAO_Constraint_Validator (void)
+{
+ for (TAO_Typecode_Table::iterator type_iter (this->type_map_);
+ ! type_iter.done ();
+ type_iter++)
+ {
+ CORBA::TypeCode_ptr corba_type = (*type_iter).int_id_;
+ CORBA::release (corba_type);
+ }
+}
+
+int
+TAO_Constraint_Validator::validate (TAO_Constraint* root)
+{
+ return root->accept(this);
+}
+
+int
+TAO_Constraint_Validator::visit_constraint (TAO_Unary_Constraint* constraint)
+{
+ int return_value = -1;
+ TAO_Expression_Type type;
+ TAO_Constraint* operand = constraint->operand ();
+ this->extract_type (operand, type);
+
+ if (this->expr_returns_boolean (type))
+ return_value = operand->accept (this);
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Validator::visit_first (TAO_Noop_Constraint *)
+{
+ return 0;
+}
+
+int
+TAO_Constraint_Validator::visit_random (TAO_Noop_Constraint *)
+{
+ return 0;
+}
+
+int
+TAO_Constraint_Validator::visit_with (TAO_Unary_Constraint* unary_with)
+{
+ return this->visit_constraint (unary_with);
+}
+
+int
+TAO_Constraint_Validator::visit_min (TAO_Unary_Constraint* unary_min)
+{
+ return this->visit_unary_minus (unary_min);
+}
+
+int
+TAO_Constraint_Validator::visit_max (TAO_Unary_Constraint* unary_max)
+{
+ return this->visit_unary_minus (unary_max);
+}
+
+int
+TAO_Constraint_Validator::
+visit_and (TAO_Binary_Constraint* boolean_and)
+{
+ int return_value = -1;
+ TAO_Constraint* left = boolean_and->left_operand (),
+ *right = boolean_and->right_operand ();
+ TAO_Expression_Type left_type, right_type;
+ this->extract_type (left, left_type);
+ this->extract_type (right, right_type);
+
+ // Can only "and" expressions that return a boolean value
+ if (this->expr_returns_boolean (left_type) &&
+ this->expr_returns_boolean (right_type))
+ {
+ if (left->accept (this) == 0 &&
+ right->accept (this) == 0)
+ return_value = 0;
+ }
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Validator::
+visit_or(TAO_Binary_Constraint* boolean_or)
+{
+ // The types for or are the same as those for and.
+ return this->visit_and (boolean_or);
+}
+
+int
+TAO_Constraint_Validator::
+visit_not (TAO_Unary_Constraint* unary_not)
+{
+ int return_value = -1;
+ // Not can only negate an expression that returns a boolean.
+ TAO_Expression_Type type;
+ TAO_Constraint* operand = unary_not->operand ();
+ this->extract_type (operand, type);
+
+ if (this->expr_returns_boolean (type))
+ return_value = operand->accept (this);
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Validator::
+visit_exist (TAO_Unary_Constraint* unary_exist)
+{
+ // Exist simply requires that its operand be a property name
+ // included in the service type.
+ int return_value = -1;
+ TAO_Constraint* operand = unary_exist->operand ();
+ TAO_Expression_Type type = operand->expr_type ();
+
+ if (type == TAO_IDENT)
+ return_value = operand->accept (this);
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Validator::
+visit_unary_minus (TAO_Unary_Constraint* unary_minus)
+{
+ // Unary minus can only negate a numeric operand.
+ int return_value = -1;
+ TAO_Expression_Type type;
+ TAO_Constraint* operand = unary_minus->operand ();
+ this->extract_type (operand, type);
+
+ if (this->expr_returns_number (type))
+ return_value = operand->accept (this);
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Validator::
+visit_add (TAO_Binary_Constraint* boolean_add)
+{
+ // All the mathematical operators require numeric operands.
+ int return_value = -1;
+ TAO_Constraint* left = boolean_add->left_operand (),
+ *right = boolean_add->right_operand ();
+ TAO_Expression_Type left_type, right_type;
+ this->extract_type (left, left_type);
+ this->extract_type (right, right_type);
+
+ if (this->expr_returns_number (left_type) &&
+ this->expr_returns_number (right_type))
+ {
+ if (left->accept (this) == 0 &&
+ right->accept (this) == 0)
+ return_value = 0;
+ }
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Validator::
+visit_sub (TAO_Binary_Constraint* boolean_sub)
+{
+ return this->visit_add (boolean_sub);
+}
+
+int
+TAO_Constraint_Validator::
+visit_mult (TAO_Binary_Constraint* boolean_mult)
+{
+ return this->visit_add (boolean_mult);
+}
+
+int
+TAO_Constraint_Validator::
+visit_div (TAO_Binary_Constraint* boolean_div)
+{
+ // Div not only requires that both of its operands be numeric, but
+ // also the the demoninator not be zero. However, since the
+ // denominator can be an expression who's value can only be
+ // determined while evaulating the constraint expression, this
+ // method detects only when the demoniator is a literal whose value
+ // is zero.
+ int return_value = -1;
+ TAO_Constraint* left = boolean_div->left_operand (),
+ *right = boolean_div->right_operand ();
+ TAO_Expression_Type left_type, right_type;
+ this->extract_type (left, left_type);
+ this->extract_type (right, right_type);
+
+ if (this->expr_returns_number (left_type) &&
+ this->expr_returns_number (right_type))
+ {
+ // Prevent division by zero, a no no.
+ int right_isnt_zero = 1;
+ switch(right->expr_type ())
+ {
+ case TAO_UNSIGNED:
+ right_isnt_zero =
+ ((CORBA::ULong) (*((TAO_Literal_Constraint*) right)) != 0);
+ break;
+ case TAO_SIGNED:
+ right_isnt_zero =
+ ((CORBA::Long) (*((TAO_Literal_Constraint*) right)) != 0);
+ break;
+ case TAO_DOUBLE:
+ right_isnt_zero =
+ ((CORBA::Double) (*((TAO_Literal_Constraint*) right)) != 0.0);
+ break;
+ }
+
+ if (right_isnt_zero)
+ {
+ if (left->accept (this) == 0 &&
+ right->accept (this) == 0)
+ return_value = 0;
+ }
+ }
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Validator::
+visit_twiddle (TAO_Binary_Constraint* binary_twiddle)
+{
+ // Twiddle requires that both of its operand be strings.
+ int return_value = -1;
+ TAO_Constraint* left = binary_twiddle->left_operand (),
+ *right = binary_twiddle->right_operand ();
+ TAO_Expression_Type left_type, right_type;
+ this->extract_type (left, left_type);
+ this->extract_type (right, right_type);
+
+ if (this->expr_returns_string (left_type) &&
+ this->expr_returns_string (right_type))
+ {
+ if (left->accept (this) == 0 &&
+ right->accept (this) == 0)
+ return_value = 0;
+ }
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Validator::
+visit_in (TAO_Binary_Constraint* binary_in)
+{
+ // In requires that the right operand be a sequence of a simple type
+ // and that its left operand be an expression that evaluates to a
+ // value of the same simple type.
+ int return_value = -1;
+ TAO_Expression_Type left_type, right_type;
+ TAO_Constraint
+ *left = binary_in->left_operand (),
+ *right = binary_in->right_operand ();
+
+ CORBA::TypeCode* prop_type = this->extract_type (right, right_type);
+ this->extract_type (left, left_type);
+
+ if (right_type == TAO_SEQUENCE)
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ CORBA::Boolean types_match = 0;
+ CORBA::TCKind seq_type = CORBA::tk_void;
+ ACE_TRY
+ {
+ seq_type =
+ TAO_Sequence_Extracter_Base::sequence_type (prop_type ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return return_value;
+ }
+ ACE_ENDTRY;
+
+ if (seq_type != CORBA::tk_void)
+ {
+ if (this->expr_returns_number (left_type))
+ {
+ types_match = (seq_type == CORBA::tk_short ||
+ seq_type == CORBA::tk_ushort ||
+ seq_type == CORBA::tk_long ||
+ seq_type == CORBA::tk_ulong ||
+ seq_type == CORBA::tk_float ||
+ seq_type == CORBA::tk_double);
+ }
+ else if (this->expr_returns_boolean (left_type))
+ types_match = (seq_type == CORBA::tk_boolean);
+ else if (this->expr_returns_string (left_type))
+ types_match = (seq_type == CORBA::tk_string);
+
+ if (types_match)
+ return_value = left->accept (this);
+ }
+ }
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Validator::
+visit_less_than(TAO_Binary_Constraint* boolean_lt)
+{
+ // Comparison operations require that both operands be of the same
+ // simple type.
+ int return_value = -1;
+ TAO_Constraint* left = boolean_lt->left_operand (),
+ *right = boolean_lt->right_operand ();
+ TAO_Expression_Type left_type, right_type;
+ this->extract_type (left, left_type);
+ this->extract_type (right, right_type);
+
+ if ((this->expr_returns_number (left_type) &&
+ this->expr_returns_number (right_type)) ||
+ (this->expr_returns_string (left_type) &&
+ this->expr_returns_string (right_type)))
+ {
+ if (left->accept (this) == 0 &&
+ right->accept (this) == 0)
+ return_value = 0;
+ }
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Validator::
+visit_less_than_equal (TAO_Binary_Constraint* boolean_lte)
+{
+ return this->visit_less_than (boolean_lte);
+}
+
+int
+TAO_Constraint_Validator::
+visit_greater_than (TAO_Binary_Constraint* boolean_gt)
+{
+ return this->visit_less_than (boolean_gt);
+}
+
+int
+TAO_Constraint_Validator::
+visit_greater_than_equal (TAO_Binary_Constraint* boolean_gte)
+{
+ return this->visit_less_than(boolean_gte);
+}
+
+int
+TAO_Constraint_Validator::
+visit_equal (TAO_Binary_Constraint* boolean_eq)
+{
+ int return_value = -1;
+ TAO_Constraint* left = boolean_eq->left_operand (),
+ *right = boolean_eq->right_operand ();
+ TAO_Expression_Type left_type, right_type;
+ this->extract_type (left, left_type);
+ this->extract_type (right, right_type);
+
+ if ((this->expr_returns_number (left_type) &&
+ this->expr_returns_number (right_type)) ||
+ (this->expr_returns_string (left_type) &&
+ this->expr_returns_string (right_type)) ||
+ (this->expr_returns_boolean (left_type) &&
+ this->expr_returns_boolean (right_type)))
+ {
+ if (left->accept (this) == 0 &&
+ right->accept (this) == 0)
+ return_value = 0;
+ }
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Validator::
+visit_not_equal (TAO_Binary_Constraint* boolean_neq)
+{
+ return this->visit_equal (boolean_neq);
+}
+
+int
+TAO_Constraint_Validator::
+visit_literal (TAO_Literal_Constraint *)
+{
+ return 0;
+}
+
+int
+TAO_Constraint_Validator::
+visit_property (TAO_Property_Constraint *)
+{
+ return 0;
+}
+
+CORBA::TypeCode*
+TAO_Constraint_Validator::extract_type (TAO_Constraint* expr,
+ TAO_Expression_Type& type)
+{
+ CORBA::TypeCode* return_value = 0;
+
+ type = expr->expr_type ();
+ if (type == TAO_IDENT)
+ {
+ TAO_Property_Constraint* prop = (TAO_Property_Constraint*) expr;
+ CORBA::String_var prop_name (prop->name ());
+
+ if (this->type_map_.find (prop_name, return_value) == 0)
+ type = TAO_Literal_Constraint::comparable_type (return_value);
+ }
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Validator::expr_returns_boolean (TAO_Expression_Type expr_type)
+{
+ // If the expression is a boolean operations, a boolean literal, or
+ // a boolean property, return 1.
+ int return_value = 0;
+
+ if (expr_type <= TAO_BOOLEAN)
+ return_value = 1;
+
+ return return_value;
+}
+
+
+int
+TAO_Constraint_Validator::expr_returns_number (TAO_Expression_Type expr_type)
+{
+ // If the expression is a number operation, a numeric literal, or a
+ // numeric property, return 1.
+ int return_value = 0;
+
+ if ((expr_type >= TAO_PLUS && expr_type <= TAO_NUMBER) ||
+ (expr_type >= TAO_UNSIGNED && expr_type <= TAO_DOUBLE))
+ return_value = 1;
+
+ return return_value;
+}
+
+int
+TAO_Constraint_Validator::expr_returns_string (TAO_Expression_Type expr_type)
+{
+ // If the expression is an operation with a string return value, a
+ // string literal, or a property whose type is string, return 1.
+ int return_value = 0;
+
+ if (expr_type == TAO_STRING)
+ return_value = 1;
+
+ return return_value;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Constraint_Visitors.h b/TAO/orbsvcs/orbsvcs/Trader/Constraint_Visitors.h
new file mode 100644
index 00000000000..9bbba2e8755
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Constraint_Visitors.h
@@ -0,0 +1,449 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file Constraint_Visitors.h
+ *
+ * $Id$
+ *
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_CONSTRAINT_VISITOR_H
+#define TAO_CONSTRAINT_VISITOR_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Trader/Interpreter_Utils.h"
+#include "orbsvcs/Trader/trading_serv_export.h"
+#include "ace/Containers.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_DynSequence_i;
+
+class TAO_Constraint;
+class TAO_Unary_Constraint;
+class TAO_Binary_Constraint;
+class TAO_Literal_Constraint;
+class TAO_Property_Constraint;
+class TAO_Noop_Constraint;
+
+/**
+ * @class TAO_Constraint_Visitor
+ *
+ * @brief This is the base class for all visitors who wish to preform
+ * some operation from the state of the expression tree. Using
+ * double dispatching, subclasses of Constraint expression call
+ * back to the InterpreterVisitor subclass from the accept
+ * method.
+ *
+ * Traversal of the expression tree uses the "Visitor"
+ * pattern. To "visit" a node, a client invokes the "accept"
+ * method on a subclass of ConstraintExpression, which, in turn,
+ * invokes the appropriate method on the visitor passed to it,
+ * based on its own type. So, the Constraint_Visitor has a
+ * method to deal with each possible type of node in an
+ * expression tree; one for each operator in the grammar.
+ */
+class TAO_Trading_Serv_Export TAO_Constraint_Visitor
+{
+public:
+
+ virtual ~TAO_Constraint_Visitor (void) {}
+
+ virtual int visit_constraint (TAO_Unary_Constraint* constraint) = 0;
+
+ virtual int visit_with (TAO_Unary_Constraint* unary_with) = 0;
+ virtual int visit_min (TAO_Unary_Constraint* unary_min) = 0;
+ virtual int visit_max (TAO_Unary_Constraint* unary_max) = 0;
+ virtual int visit_first (TAO_Noop_Constraint* noop_first) = 0;
+ virtual int visit_random (TAO_Noop_Constraint* noop_random) = 0;
+
+ virtual int visit_and (TAO_Binary_Constraint* boolean_and) = 0;
+ virtual int visit_or (TAO_Binary_Constraint* boolean_or) = 0;
+ virtual int visit_not (TAO_Unary_Constraint* unary_not) = 0;
+
+ virtual int visit_exist (TAO_Unary_Constraint* unary_exist) = 0;
+ virtual int visit_unary_minus (TAO_Unary_Constraint* unary_minus) = 0;
+
+ virtual int visit_add (TAO_Binary_Constraint* boolean_add) = 0;
+ virtual int visit_sub (TAO_Binary_Constraint* boolean_sub) = 0;
+ virtual int visit_mult (TAO_Binary_Constraint* boolean_mult) = 0;
+ virtual int visit_div (TAO_Binary_Constraint* boolean_div) = 0;
+
+ virtual int visit_twiddle (TAO_Binary_Constraint* binary_twiddle) = 0;
+ virtual int visit_in (TAO_Binary_Constraint* binary_in) = 0;
+
+ virtual int visit_less_than (TAO_Binary_Constraint* boolean_lt) = 0;
+ virtual int visit_less_than_equal (TAO_Binary_Constraint* boolean_lte) = 0;
+ virtual int visit_greater_than (TAO_Binary_Constraint* boolean_gt) = 0;
+ virtual int visit_greater_than_equal (TAO_Binary_Constraint* boolean_gte) = 0;
+ virtual int visit_equal (TAO_Binary_Constraint* boolean_eq) = 0;
+ virtual int visit_not_equal (TAO_Binary_Constraint* boolean_neq) = 0;
+
+ virtual int visit_literal (TAO_Literal_Constraint* literal) = 0;
+ virtual int visit_property (TAO_Property_Constraint* literal) = 0;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include "orbsvcs/Trader/Constraint_Nodes.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Constraint_Validator
+ *
+ * @brief TAO_Constraint_Validator ensures that in an expression tree
+ * passed to it, the operands of each operation match the
+ * correct types.
+ *
+ * TAO_Constraint_Validator uses the visitor pattern to
+ * traverse all the nodes in an expression tree, checking that
+ * for each operator node the operands are of the proper data
+ * type it they're literals, or that they exist in the service
+ * type definition _and_ have the proper type, if they're
+ * property names. The algorithm for type
+ * checking is as follows: ensure that operand expression(s)
+ * return the correct types using expr_returns* methods. If they
+ * (or it) return the correct types, call accept
+ * on each operand until all return true or one returns false,
+ * at which point we can back out of the traversal and indicate
+ * failure.
+ */
+class TAO_Trading_Serv_Export TAO_Constraint_Validator : public TAO_Constraint_Visitor
+{
+public:
+ /// Constructor.
+ TAO_Constraint_Validator (void);
+
+ /// Destructor.
+ virtual ~TAO_Constraint_Validator (void);
+
+ /**
+ * Validate returns 1 if the expression tree whose root is <root>
+ * makes semantic sense, in that the operands for each operation
+ * comply with each other and the types accepted by the operator.
+ */
+ int validate (TAO_Constraint* root);
+
+ // = Visitor Methods
+
+ virtual int visit_constraint (TAO_Unary_Constraint* constraint);
+
+ virtual int visit_with (TAO_Unary_Constraint* unary_with);
+ virtual int visit_min (TAO_Unary_Constraint* unary_min);
+ virtual int visit_max (TAO_Unary_Constraint* unary_max);
+ virtual int visit_first (TAO_Noop_Constraint* noop_first);
+ virtual int visit_random (TAO_Noop_Constraint* noop_random);
+
+ /// The two operands must return a boolean value.
+ virtual int visit_and (TAO_Binary_Constraint* boolean_and);
+ virtual int visit_or (TAO_Binary_Constraint* boolean_or);
+
+ /// The operand must return a boolean value.
+ virtual int visit_not (TAO_Unary_Constraint* unary_not);
+
+ /// The operand must return a valid (i.e., present in the service
+ /// type description) property name.
+ virtual int visit_exist (TAO_Unary_Constraint* unary_exist);
+
+ /// The operand must return a number to be negated.
+ virtual int visit_unary_minus (TAO_Unary_Constraint* unary_minus);
+
+ /// Both operands must return numeric results.
+ virtual int visit_add (TAO_Binary_Constraint* boolean_add);
+ virtual int visit_sub (TAO_Binary_Constraint* boolean_sub);
+ virtual int visit_mult (TAO_Binary_Constraint* boolean_mult);
+ virtual int visit_div (TAO_Binary_Constraint* boolean_div);
+
+ /// Both operands must return strings.
+ virtual int visit_twiddle (TAO_Binary_Constraint* binary_twiddle);
+
+ /// The right operand must be a sequence of the same simple type as
+ /// the left operand.
+ virtual int visit_in (TAO_Binary_Constraint* binary_in);
+
+ /// The left and right operands must both be of the same simple type.
+ virtual int visit_less_than (TAO_Binary_Constraint* boolean_lt);
+ virtual int visit_less_than_equal (TAO_Binary_Constraint* boolean_lte);
+ virtual int visit_greater_than (TAO_Binary_Constraint* boolean_gt);
+ virtual int visit_greater_than_equal (TAO_Binary_Constraint* boolean_gte);
+ virtual int visit_equal (TAO_Binary_Constraint* boolean_eq);
+ virtual int visit_not_equal (TAO_Binary_Constraint* boolean_neq);
+
+ /// The property must be defined in the service type description.
+ virtual int visit_literal (TAO_Literal_Constraint* literal);
+ virtual int visit_property (TAO_Property_Constraint* literal);
+
+protected:
+
+ /// A map gleaned from the ServiceTypeStruct, which correlates
+ /// property names with their types.
+ TAO_Typecode_Table type_map_;
+
+private:
+
+ CORBA::TypeCode* extract_type (TAO_Constraint* expr_type,
+ TAO_Expression_Type& type);
+
+ /// expr_returns_boolean returns 1 if <expr_type>, when evaluated, will
+ /// return a boolean.
+ int expr_returns_boolean (TAO_Expression_Type expr_type);
+
+ /// expr_returns_boolean returns 1 if <expr_type>, when evaluated, will
+ /// return a number.
+ int expr_returns_number (TAO_Expression_Type expr_type);
+
+ /// expr_returns_boolean returns 1 if <expr_type>, when evaluated, will
+ /// return a string.
+ int expr_returns_string (TAO_Expression_Type expr_type);
+
+ TAO_Constraint_Validator (const TAO_Constraint_Validator&);
+ TAO_Constraint_Validator& operator= (const TAO_Constraint_Validator&);
+};
+
+/**
+ * @class TAO_Constraint_Evaluator
+ *
+ * @brief TAO_Constraint_Evaluator traverse a constraint expression
+ * tree, and determines whether an offer fits the constraints
+ * represented by the tree
+ *
+ * Using the Visitor pattern, the TAO_Constraint_Evaluator has
+ * each node of the expression tree call back to it with the
+ * method designated for its type. In that method, the visitor
+ * will evaluate its operands and perform the operation
+ * designated by that node's type, and return the result. Note:
+ * the TAO_Constraint_Evaluator assumes the tree is semantically
+ * correct, that is, the validate method on
+ * TAO_Constraint_Validator return true. The only possible
+ * evaluation time errors are a divide by a property whose value
+ * is zero and undefined properties.
+ */
+class TAO_Trading_Serv_Export TAO_Constraint_Evaluator : public TAO_Constraint_Visitor
+{
+public:
+
+ /// Constructor.
+ TAO_Constraint_Evaluator (void);
+
+ /**
+ * Evaluate returns 1 if the offer satisfies the constraints
+ * represented by the the expression tree rooted at <root>, 0 if it
+ * doesn't. If an error occurs during process, the constraint
+ * automatically fails.
+ */
+ CORBA::Boolean evaluate_constraint (TAO_Constraint* root);
+
+ /// The result of the preference evaluation is stored in result. The
+ /// method returns 0 upon success, -1 upon failure.
+ int evaluate_preference (TAO_Constraint* root,
+ TAO_Literal_Constraint& result);
+
+ // = Visitor Methods
+
+ virtual int visit_constraint (TAO_Unary_Constraint* constraint);
+
+ virtual int visit_with (TAO_Unary_Constraint* unary_with);
+ virtual int visit_min (TAO_Unary_Constraint* unary_min);
+ virtual int visit_max (TAO_Unary_Constraint* unary_max);
+ virtual int visit_first (TAO_Noop_Constraint* noop_first);
+ virtual int visit_random (TAO_Noop_Constraint* noop_random);
+
+ /**
+ * Takes the logical and of the results of both operands. Note that
+ * in the case where the left operand returns zero, the result is
+ * immediately known.
+ */
+ virtual int visit_and (TAO_Binary_Constraint* boolean_and);
+
+ /**
+ * Takes the logical or of the results of both operands. Note that
+ * in the case where the left operand returns one, the result is
+ * immediately known.
+ */
+ virtual int visit_or (TAO_Binary_Constraint* boolean_or);
+
+ /// Logically negates the value of the operand.
+ virtual int visit_not (TAO_Unary_Constraint* unary_not);
+
+ /// The property exists if its name is bound to a value in the
+ /// <props_> map.
+ virtual int visit_exist (TAO_Unary_Constraint* unary_exist);
+
+ /// Mathematically negates the return value the operand.
+ virtual int visit_unary_minus (TAO_Unary_Constraint* unary_minus);
+
+ /// Add the results of evaluating the left and right operands.
+ virtual int visit_add (TAO_Binary_Constraint* boolean_add);
+
+ /// Subtract the results of evaluating the left and right operands.
+ virtual int visit_sub (TAO_Binary_Constraint* boolean_sub);
+
+ /// Multiply the results of evaluating the left and right operands.
+ virtual int visit_mult (TAO_Binary_Constraint* boolean_mult);
+
+ /// Divide the results of evaluating the left and right operands.
+ virtual int visit_div (TAO_Binary_Constraint* boolean_div);
+
+ /// Determines if the right operand is a substring of the left.
+ virtual int visit_twiddle (TAO_Binary_Constraint* binary_twiddle);
+
+ /// Determines if the sequence represented by the right operand
+ /// contains the left operand.
+ virtual int visit_in (TAO_Binary_Constraint* binary_in);
+
+ // = Compare the results of evaluating left and right operands.
+ virtual int visit_less_than (TAO_Binary_Constraint* boolean_lt);
+ virtual int visit_less_than_equal (TAO_Binary_Constraint* boolean_lte);
+ virtual int visit_greater_than (TAO_Binary_Constraint* boolean_gt);
+ virtual int visit_greater_than_equal (TAO_Binary_Constraint* boolean_gte);
+ virtual int visit_equal (TAO_Binary_Constraint* boolean_eq);
+ virtual int visit_not_equal (TAO_Binary_Constraint* boolean_neq);
+
+ /// Copy the value of the literal into the result container.
+ virtual int visit_literal (TAO_Literal_Constraint* literal);
+
+ /// Copy the value of the property into the result container.
+ virtual int visit_property (TAO_Property_Constraint* literal);
+
+private:
+
+ class TAO_Trading_Serv_Export Operand_Queue :
+ public ACE_Unbounded_Queue <TAO_Literal_Constraint>
+ // = TITLE
+ // A queue adapter with methods to setting and getting operands
+ // from the expression evaluation results.
+ {
+ public:
+
+ Operand_Queue (void);
+
+ /// In a binary operation, obtain the left operand.
+ TAO_Literal_Constraint& get_left_operand (void);
+
+ /// In a binary operation, obtain the right operand.
+ TAO_Literal_Constraint& get_right_operand (void);
+
+ /// In a unary operation, obtain the only operand.
+ TAO_Literal_Constraint& get_operand (void);
+
+ /// Remove an operand from the queue.
+ void dequeue_operand (void);
+ };
+
+ /// Method for performing a arithmetic or comparison operation.
+ void do_the_op (int operation);
+
+ /// Method for evaluating a binary operation.
+ int visit_bin_op (TAO_Binary_Constraint* op, int operation);
+
+ /// Determine if sequence contains <element>, a literal of the same
+ /// simple type as <sequence_type>. Return 1 in this eventuality.
+ CORBA::Boolean sequence_does_contain (CORBA::Any* sequence,
+ TAO_Literal_Constraint& element);
+
+ /// Disallow copying.
+ TAO_Constraint_Evaluator (const TAO_Constraint_Evaluator&);
+ TAO_Constraint_Evaluator& operator= (const TAO_Constraint_Evaluator&);
+
+protected:
+
+ /// The map of property names to their values for a property.
+ TAO_Lookup_Table props_;
+
+ /// The result of a non_boolean operation.
+ Operand_Queue queue_;
+};
+
+// Forward declaration
+template <class ELEMENT_TYPE> class TAO_Element_Equal;
+
+template<>
+class TAO_Element_Equal<CORBA::Short>
+{
+public:
+ /// Calls the correct method on dyn_seq to extract the element type,
+ /// then uses the appropriate form of equals comparison.
+ int operator () (TAO_DynSequence_i& dyn_any,
+ CORBA::Short element) const;
+};
+
+template<>
+class TAO_Element_Equal<CORBA::UShort>
+{
+public:
+ /// Calls the correct method on dyn_seq to extract the element type,
+ /// then uses the appropriate form of equals comparison.
+ int operator () (TAO_DynSequence_i& dyn_any,
+ CORBA::UShort element) const;
+};
+
+template<>
+class TAO_Element_Equal<CORBA::Long>
+{
+public:
+ /// Calls the correct method on dyn_seq to extract the element type,
+ /// then uses the appropriate form of equals comparison.
+ int operator () (TAO_DynSequence_i& dyn_any,
+ CORBA::Long element) const;
+};
+
+template<>
+class TAO_Element_Equal<CORBA::ULong>
+{
+public:
+ /// Calls the correct method on dyn_seq to extract the element type, then
+ /// uses the appropriate form of equals comparison.
+ int operator () (TAO_DynSequence_i& dyn_any,
+ CORBA::ULong element) const;
+
+};
+
+template<>
+class TAO_Element_Equal<CORBA::Float>
+{
+public:
+ /// Calls the correct method on dyn_seq to extract the element type,
+ /// then uses the appropriate form of equals comparison.
+ int operator () (TAO_DynSequence_i& dyn_any,
+ CORBA::Float element) const;
+};
+
+template<>
+class TAO_Element_Equal<CORBA::Double>
+{
+public:
+ /// Calls the correct method on dyn_seq to extract the element type,
+ /// then uses the appropriate form of equals comparison.
+ int operator () (TAO_DynSequence_i& dyn_any,
+ CORBA::Double element) const;
+};
+
+template<>
+class TAO_Element_Equal<CORBA::Boolean>
+{
+public:
+ /// Calls the correct method on dyn_seq to extract the element type,
+ /// then uses the appropriate form of equals comparison.
+ int operator () (TAO_DynSequence_i& dyn_any,
+ CORBA::Boolean element) const;
+};
+
+template<>
+class TAO_Element_Equal<const char*>
+{
+public:
+ /// Calls the correct method on dyn_seq to extract the element type,
+ /// then uses the appropriate form of equals comparison.
+ int operator () (TAO_DynSequence_i& dyn_any,
+ const char* element) const;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* CONSTRAINT_VISITORS_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Constraint_l.cpp b/TAO/orbsvcs/orbsvcs/Trader/Constraint_l.cpp
new file mode 100644
index 00000000000..a451f98e6a9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Constraint_l.cpp
@@ -0,0 +1,1790 @@
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * $Header$
+ */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+#include "tao/orbconf.h"
+#include "ace/OS.h"
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define 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 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 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 YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+extern FILE *yyin, *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 )
+ * 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 yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ *yy_cp = yy_hold_char; \
+ YY_RESTORE_YY_MORE_OFFSET \
+ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, 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 yy_size_t;
+
+
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int 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 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 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 yy_at_bol;
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as 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 yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+ };
+
+static YY_BUFFER_STATE 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 YY_CURRENT_BUFFER yy_current_buffer
+
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin. A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_is_interactive = is_interactive; \
+ }
+
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_at_bol = at_bol; \
+ }
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+typedef unsigned char YY_CHAR;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+typedef int yy_state_type;
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+ yytext_ptr = yy_bp; \
+ yyleng = (int) (yy_cp - yy_bp); \
+ yy_hold_char = *yy_cp; \
+ *yy_cp = '\0'; \
+ yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 31
+#define YY_END_OF_BUFFER 32
+static yyconst short int yy_accept[82] =
+ { 0,
+ 0, 0, 32, 30, 31, 30, 30, 22, 23, 14,
+ 12, 13, 30, 15, 26, 16, 30, 18, 29, 29,
+ 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+ 11, 21, 0, 28, 0, 26, 27, 0, 26, 17,
+ 20, 19, 29, 29, 29, 29, 29, 29, 10, 29,
+ 29, 29, 9, 29, 29, 0, 0, 29, 29, 8,
+ 29, 29, 2, 1, 7, 29, 29, 0, 27, 29,
+ 24, 29, 29, 29, 5, 25, 6, 3, 29, 4,
+ 0
+ } ;
+
+static yyconst int yy_ec[256] =
+ { 0,
+ 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,
+ 1, 2, 3, 1, 1, 1, 1, 1, 4, 5,
+ 6, 7, 8, 1, 9, 10, 11, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 1, 1, 13,
+ 14, 15, 1, 1, 16, 17, 17, 17, 18, 19,
+ 17, 17, 17, 17, 17, 20, 17, 17, 17, 17,
+ 17, 21, 22, 23, 24, 17, 17, 17, 17, 17,
+ 1, 25, 1, 1, 26, 1, 27, 17, 17, 28,
+
+ 29, 30, 17, 31, 32, 17, 17, 17, 33, 34,
+ 35, 17, 17, 36, 37, 38, 17, 17, 39, 40,
+ 17, 17, 1, 1, 1, 41, 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 yyconst int yy_meta[42] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 1, 1, 1, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 1, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 1
+ } ;
+
+static yyconst short int yy_base[84] =
+ { 0,
+ 0, 0, 107, 108, 108, 92, 38, 108, 108, 108,
+ 93, 92, 91, 108, 33, 88, 87, 86, 0, 83,
+ 77, 63, 56, 63, 60, 17, 58, 56, 64, 58,
+ 108, 108, 42, 108, 43, 77, 36, 76, 40, 108,
+ 108, 108, 0, 67, 62, 57, 52, 47, 0, 42,
+ 47, 42, 0, 45, 40, 47, 47, 55, 58, 0,
+ 38, 34, 0, 0, 0, 42, 38, 54, 52, 44,
+ 0, 23, 22, 23, 0, 0, 0, 0, 24, 0,
+ 108, 72, 51
+ } ;
+
+static yyconst short int yy_def[84] =
+ { 0,
+ 81, 1, 81, 81, 81, 81, 82, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
+ 81, 81, 82, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 82, 81, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 81, 81, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
+ 0, 81, 81
+ } ;
+
+static yyconst short int yy_nxt[150] =
+ { 0,
+ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+ 14, 15, 16, 17, 18, 19, 19, 19, 20, 19,
+ 19, 19, 21, 19, 4, 4, 22, 19, 23, 24,
+ 19, 25, 26, 27, 28, 29, 19, 19, 30, 19,
+ 31, 34, 38, 50, 39, 34, 56, 37, 51, 38,
+ 34, 39, 43, 57, 68, 68, 80, 79, 69, 78,
+ 77, 76, 35, 69, 57, 69, 35, 56, 75, 74,
+ 73, 35, 33, 33, 72, 71, 70, 67, 66, 65,
+ 64, 63, 62, 61, 60, 59, 58, 37, 36, 55,
+ 54, 53, 52, 49, 48, 47, 46, 45, 44, 42,
+
+ 41, 40, 37, 36, 36, 32, 81, 3, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81
+ } ;
+
+static yyconst short int yy_chk[150] =
+ { 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,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 7, 15, 26, 15, 33, 35, 37, 26, 39,
+ 56, 39, 83, 37, 57, 57, 79, 74, 57, 73,
+ 72, 70, 7, 69, 37, 68, 33, 35, 67, 66,
+ 62, 56, 82, 82, 61, 59, 58, 55, 54, 52,
+ 51, 50, 48, 47, 46, 45, 44, 38, 36, 30,
+ 29, 28, 27, 25, 24, 23, 22, 21, 20, 18,
+
+ 17, 16, 13, 12, 11, 6, 3, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81
+ } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *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 yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+
+#define INITIAL 0
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+// $Id$
+// ========================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// constraint.l
+//
+// = AUTHOR
+// Seth Widoff <sbw1@cs.wustl.edu>
+//
+// ========================================================================
+
+#include "orbsvcs/Trader/Constraint_Interpreter.h"
+#include "orbsvcs/Trader/Constraint_Nodes.h"
+#include "orbsvcs/Trader/Constraint_Tokens.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+static TAO_Literal_Constraint* extract_string(const char*);
+
+#define TAO_YY_LEX_DEBUG
+
+#ifdef TAO_CONSTRAINT_DEBUG
+#define TAO_YY_LEX_DEBUG ACE_OS::fprintf(stderr, "%s\n", yytext)
+#endif /* TAO_CONSTRAINT_DEBUG */
+
+
+
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+#if 0
+#ifndef YY_NO_UNPUT
+static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+#endif
+#endif /* 0 */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#ifdef YY_MALLOC_DECL
+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 YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef TAO_TRADER_ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define TAO_TRADER_ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ if ( yy_current_buffer->yy_is_interactive ) \
+ { \
+ int c = '*', n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
+ && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" );
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+ YY_USER_ACTION
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+YY_DECL
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp = 0, *yy_bp = 0;
+ register int yy_act;
+
+
+
+
+
+
+ if ( yy_init )
+ {
+ yy_init = 0;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! yy_start )
+ yy_start = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+
+ if ( ! yyout )
+ yyout = stdout;
+
+ if ( ! yy_current_buffer )
+ yy_current_buffer =
+ yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_load_buffer_state();
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = yy_c_buf_p;
+
+ /* Support of yytext. */
+ *yy_cp = yy_hold_char;
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = yy_start;
+yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 82 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ ++yy_cp;
+ }
+ while ( yy_base[yy_current_state] != 108 );
+
+yy_find_action:
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+
+do_action: /* This label is used only to access EOF actions. */
+
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = yy_hold_char;
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
+ goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_MIN; }
+ ACE_NOTREACHED (YY_BREAK)
+case 2:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_MAX; }
+ ACE_NOTREACHED (YY_BREAK)
+case 3:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_FIRST; }
+ ACE_NOTREACHED (YY_BREAK)
+case 4:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_RANDOM; }
+ ACE_NOTREACHED (YY_BREAK)
+case 5:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_WITH; }
+ ACE_NOTREACHED (YY_BREAK)
+case 6:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_EXIST; }
+ ACE_NOTREACHED (YY_BREAK)
+case 7:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_NOT; }
+ ACE_NOTREACHED (YY_BREAK)
+case 8:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_AND; }
+ ACE_NOTREACHED (YY_BREAK)
+case 9:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_OR; }
+ ACE_NOTREACHED (YY_BREAK)
+case 10:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_IN; }
+ ACE_NOTREACHED (YY_BREAK)
+case 11:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_TWIDDLE; }
+ ACE_NOTREACHED (YY_BREAK)
+case 12:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_PLUS; }
+ ACE_NOTREACHED (YY_BREAK)
+case 13:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_MINUS; }
+ ACE_NOTREACHED (YY_BREAK)
+case 14:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_MULT; }
+ ACE_NOTREACHED (YY_BREAK)
+case 15:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_DIV; }
+ ACE_NOTREACHED (YY_BREAK)
+case 16:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_LT; }
+ ACE_NOTREACHED (YY_BREAK)
+case 17:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_LE; }
+ ACE_NOTREACHED (YY_BREAK)
+case 18:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_GT; }
+ ACE_NOTREACHED (YY_BREAK)
+case 19:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_GE; }
+ ACE_NOTREACHED (YY_BREAK)
+case 20:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_EQ; }
+ ACE_NOTREACHED (YY_BREAK)
+case 21:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_NE; }
+ ACE_NOTREACHED (YY_BREAK)
+case 22:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_LPAREN; }
+ ACE_NOTREACHED (YY_BREAK)
+case 23:
+YY_RULE_SETUP
+
+{ TAO_YY_LEX_DEBUG; return TAO_RPAREN; }
+ ACE_NOTREACHED (YY_BREAK)
+case 24:
+YY_RULE_SETUP
+
+{
+ yylval.constraint_ =
+ new TAO_Literal_Constraint(true);
+ TAO_YY_LEX_DEBUG; return TAO_BOOLEAN;
+ }
+ ACE_NOTREACHED (YY_BREAK)
+case 25:
+YY_RULE_SETUP
+
+{
+ yylval.constraint_ =
+ new TAO_Literal_Constraint(false);
+ TAO_YY_LEX_DEBUG; return TAO_BOOLEAN;
+ }
+ ACE_NOTREACHED (YY_BREAK)
+case 26:
+YY_RULE_SETUP
+
+{
+ yylval.constraint_ =
+ new TAO_Literal_Constraint((yytext[0] == '-' ?
+ (CORBA::Long)atoi(yytext) : (CORBA::ULong)atoi(yytext)));
+ TAO_YY_LEX_DEBUG; return TAO_NUMBER;
+ }
+ ACE_NOTREACHED (YY_BREAK)
+case 27:
+YY_RULE_SETUP
+
+{
+ yylval.constraint_ =
+ new TAO_Literal_Constraint((CORBA::Double)atof(yytext));
+ TAO_YY_LEX_DEBUG; return TAO_NUMBER;
+ }
+ ACE_NOTREACHED (YY_BREAK)
+case 28:
+YY_RULE_SETUP
+
+{
+ yylval.constraint_ = extract_string(yytext);
+ TAO_YY_LEX_DEBUG; return TAO_STRING;
+ }
+ ACE_NOTREACHED (YY_BREAK)
+case 29:
+YY_RULE_SETUP
+
+{
+ yylval.constraint_ =
+ new TAO_Property_Constraint(yytext);
+ TAO_YY_LEX_DEBUG; return TAO_IDENT;
+ }
+ ACE_NOTREACHED (YY_BREAK)
+case 30:
+YY_RULE_SETUP
+
+{
+ TAO_YY_LEX_DEBUG; return TAO_UNKNOWN;
+ }
+ ACE_NOTREACHED (YY_BREAK)
+case 31:
+YY_RULE_SETUP
+
+TAO_TRADER_ECHO;
+ YY_BREAK
+
+case YY_STATE_EOF(INITIAL):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = yy_hold_char;
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
+ * consistency between 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.
+ */
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yy_current_buffer->yy_input_file = yyin;
+ yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since 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 ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * 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).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++yy_c_buf_p;
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = yy_c_buf_p;
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ yy_did_buffer_switch_on_eof = 0;
+
+ if ( yywrap() )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p =
+ yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ yy_c_buf_p =
+ &yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+ } /* end of yylex */
+
+
+/* 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 yy_get_next_buffer()
+ {
+ register char *dest = yy_current_buffer->yy_ch_buf;
+ register char *source = yytext_ptr;
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( yy_current_buffer->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( yy_c_buf_p - yytext_ptr - 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) (yy_c_buf_p - yytext_ptr) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+
+ else
+ {
+ int num_to_read =
+ yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+ YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = yy_current_buffer;
+
+ int yy_c_buf_p_offset =
+ (int) (yy_c_buf_p - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yy_flex_realloc( (void *) b->yy_ch_buf,
+ b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = yy_current_buffer->yy_buf_size -
+ number_to_move - 1;
+#endif
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+ yy_n_chars, num_to_read );
+
+ yy_current_buffer->yy_n_chars = yy_n_chars;
+ }
+
+ if ( yy_n_chars == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yyrestart( yyin );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ yy_current_buffer->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ yy_n_chars += number_to_move;
+ yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+ yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+ yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+ return ret_val;
+ }
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+static yy_state_type yy_get_previous_state()
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+
+ yy_current_state = yy_start;
+
+ for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 82 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
+ }
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+ {
+ register int yy_is_jam;
+ register char *yy_cp = yy_c_buf_p;
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 82 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 81);
+
+ return yy_is_jam ? 0 : yy_current_state;
+ }
+
+#if 0
+#ifndef YY_NO_UNPUT
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register char *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register char *yy_bp;
+#endif
+ {
+ register char *yy_cp = yy_c_buf_p;
+
+ /* undo effects of setting up yytext */
+ *yy_cp = yy_hold_char;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = yy_n_chars + 2;
+ register char *dest = &yy_current_buffer->yy_ch_buf[
+ yy_current_buffer->yy_buf_size + 2];
+ register char *source =
+ &yy_current_buffer->yy_ch_buf[number_to_move];
+
+ while ( source > yy_current_buffer->yy_ch_buf )
+ *--dest = *--source;
+
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ yy_current_buffer->yy_n_chars =
+ yy_n_chars = yy_current_buffer->yy_buf_size;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ *--yy_cp = (char) c;
+
+
+ yytext_ptr = yy_bp;
+ yy_hold_char = *yy_cp;
+ yy_c_buf_p = yy_cp;
+ }
+#endif /* ifndef YY_NO_UNPUT */
+#endif /* 0 */
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+ {
+ int c;
+
+ *yy_c_buf_p = yy_hold_char;
+
+ if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ {
+ /* 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 ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ /* This was really a NUL. */
+ *yy_c_buf_p = '\0';
+
+ else
+ { /* need more input */
+ int offset = yy_c_buf_p - yytext_ptr;
+ ++yy_c_buf_p;
+
+ switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because 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. */
+ yyrestart( yyin );
+
+ /* fall through */
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( yywrap() )
+ return EOF;
+
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput();
+#else
+ return input();
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p = yytext_ptr + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
+ *yy_c_buf_p = '\0'; /* preserve yytext */
+ yy_hold_char = *++yy_c_buf_p;
+
+
+ return c;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+ {
+ if ( ! yy_current_buffer )
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_init_buffer( yy_current_buffer, input_file );
+ yy_load_buffer_state();
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+ {
+ if ( yy_current_buffer == new_buffer )
+ return;
+
+ if ( yy_current_buffer )
+ {
+ /* Flush out information for old buffer. */
+ *yy_c_buf_p = yy_hold_char;
+ yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+ yy_current_buffer->yy_n_chars = yy_n_chars;
+ }
+
+ yy_current_buffer = new_buffer;
+ yy_load_buffer_state();
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ yy_did_buffer_switch_on_eof = 1;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+ {
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+ yyin = yy_current_buffer->yy_input_file;
+ yy_hold_char = *yy_c_buf_p;
+ }
+
+
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+ {
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* 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->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ yy_init_buffer( b, file );
+
+ return b;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+ {
+ if ( ! b )
+ return;
+
+ if ( b == yy_current_buffer )
+ yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ yy_flex_free( (void *) b->yy_ch_buf );
+
+ yy_flex_free( (void *) b );
+ }
+
+
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+
+ {
+ yy_flush_buffer( b );
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+#if defined (ACE_HAS_WINCE)
+ // Mimic the behavior as WinCE does not have isatty().
+ if ((file != 0) && (file == fileno(file))) {
+ b->yy_is_interactive = 1;
+ }
+ else {
+ b->yy_is_interactive = 0;
+ }
+#else
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif // ACE_HAS_WINCE
+
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+ {
+ if ( ! b )
+ return;
+
+ b->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->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == yy_current_buffer )
+ yy_load_buffer_state();
+ }
+
+
+#ifndef YY_NO_SCAN_BUFFER
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+char *base;
+yy_size_t size;
+#endif
+ {
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ yy_switch_to_buffer( b );
+
+ return b;
+ }
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+#else
+YY_BUFFER_STATE yy_scan_string( yy_str )
+yyconst char *yy_str;
+#endif
+ {
+ int len;
+ for ( len = 0; yy_str[len]; ++len )
+ ;
+
+ return yy_scan_bytes( yy_str, len );
+ }
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+#else
+YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+yyconst char *bytes;
+int len;
+#endif
+ {
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = len + 2;
+ buf = (char *) yy_flex_alloc( n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+ for ( i = 0; i < len; ++i )
+ buf[i] = bytes[i];
+
+ buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = yy_scan_buffer( buf, n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+ }
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+ {
+ if ( yy_start_stack_ptr >= yy_start_stack_depth )
+ {
+ yy_size_t new_size;
+
+ yy_start_stack_depth += YY_START_STACK_INCR;
+ new_size = yy_start_stack_depth * sizeof( int );
+
+ if ( ! yy_start_stack )
+ yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+ else
+ yy_start_stack = (int *) yy_flex_realloc(
+ (void *) yy_start_stack, new_size );
+
+ if ( ! yy_start_stack )
+ YY_FATAL_ERROR(
+ "out of memory expanding start-condition stack" );
+ }
+
+ yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+ BEGIN(new_state);
+ }
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state()
+ {
+ if ( --yy_start_stack_ptr < 0 )
+ YY_FATAL_ERROR( "start-condition stack underflow" );
+
+ BEGIN(yy_start_stack[yy_start_stack_ptr]);
+ }
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state()
+ {
+ return yy_start_stack[yy_start_stack_ptr - 1];
+ }
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( yyconst char msg[] )
+#else
+static void yy_fatal_error( msg )
+char msg[];
+#endif
+ {
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+ }
+
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ yytext[yyleng] = yy_hold_char; \
+ yy_c_buf_p = yytext + n; \
+ yy_hold_char = *yy_c_buf_p; \
+ *yy_c_buf_p = '\0'; \
+ yyleng = n; \
+ } \
+ while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+yyconst char *s2;
+int n;
+#endif
+ {
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+ }
+#endif
+
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static int yy_flex_strlen( yyconst char *s )
+#else
+static int yy_flex_strlen( s )
+yyconst char *s;
+#endif
+ {
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+ }
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+ {
+ return (void *) malloc( size );
+ }
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+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 YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+ {
+ free( ptr );
+ }
+
+#if YY_MAIN
+int main()
+ {
+ yylex();
+ return 0;
+ }
+#endif
+
+
+
+TAO_Literal_Constraint*
+extract_string(const char* total)
+{
+ int prev_slash = 0,
+ ctr = 0;
+ char str[BUFSIZ],
+ *tmp = (char*) total + 1;
+
+ while (*tmp != '\0')
+ {
+ if (*tmp == '\\')
+ {
+ if (prev_slash)
+ prev_slash = 0;
+ else
+ {
+ prev_slash = 1;
+ continue;
+ }
+ }
+ else if (*tmp == '\'')
+ prev_slash = 0;
+
+ str[ctr++] = *tmp;
+ tmp++;
+ }
+
+ str[ctr - 1] = '\0';
+ return new TAO_Literal_Constraint(str);
+}
+
+int
+yywrap (void)
+{
+ return 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Constraint_y.cpp b/TAO/orbsvcs/orbsvcs/Trader/Constraint_y.cpp
new file mode 100644
index 00000000000..4376a5b05ba
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Constraint_y.cpp
@@ -0,0 +1,900 @@
+
+ // $Id$
+// ========================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// constraint.y
+//
+// = AUTHOR
+// Seth Widoff <sbw1@cs.wustl.edu>
+//
+// ========================================================================
+
+#include "ace/OS_NS_string.h"
+#include "orbsvcs/Trader/Constraint_Interpreter.h"
+#include "orbsvcs/Trader/Constraint_Nodes.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//#define YYDEBUG 1
+# define TAO_GT 257
+# define TAO_GE 258
+# define TAO_LT 259
+# define TAO_LE 260
+# define TAO_EQ 261
+# define TAO_NE 262
+# define TAO_EXIST 263
+# define TAO_AND 264
+# define TAO_OR 265
+# define TAO_NOT 266
+# define TAO_IN 267
+# define TAO_TWIDDLE 268
+# define TAO_BOOLEAN 269
+# define TAO_PLUS 270
+# define TAO_MINUS 271
+# define TAO_MULT 272
+# define TAO_DIV 273
+# define TAO_UMINUS 274
+# define TAO_NUMBER 275
+# define TAO_RPAREN 276
+# define TAO_LPAREN 277
+# define TAO_IDENT 278
+# define TAO_STRING 279
+# define TAO_UNKNOWN 280
+# define TAO_UNSIGNED 281
+# define TAO_SIGNED 282
+# define TAO_DOUBLE 283
+# define TAO_CONSTRAINT 284
+# define TAO_SEQUENCE 285
+# define TAO_WITH 286
+# define TAO_MAX 287
+# define TAO_MIN 288
+# define TAO_FIRST 289
+# define TAO_RANDOM 290
+
+#ifdef __cplusplus
+
+#ifndef yyerror
+ void yyerror(const char *);
+#endif
+
+#ifndef yylex
+#ifdef __EXTERN_C__
+ extern "C" { int yylex(void); }
+#else
+ int yylex(void);
+#endif
+#endif
+ int yyparse(void);
+
+#endif
+#define yyclearin yychar = -1
+#define yyerrok yyerrflag = 0
+extern int yychar;
+extern int yyerrflag;
+YYSTYPE yylval;
+YYSTYPE yyval;
+typedef int yytabelem;
+#ifndef YYMAXDEPTH
+#define YYMAXDEPTH 150
+#endif
+#if YYMAXDEPTH > 0
+int yy_yys[YYMAXDEPTH], *yys = yy_yys;
+YYSTYPE yy_yyv[YYMAXDEPTH], *yyv = yy_yyv;
+#else /* user does initial allocation */
+int *yys;
+YYSTYPE *yyv;
+#endif
+static int yymaxdepth = YYMAXDEPTH;
+# define YYERRCODE 256
+
+
+
+
+//extern int yydebug = 1;
+yytabelem yyexca[] ={
+-1, 1,
+ 0, -1,
+ -2, 0,
+ };
+# define YYNPROD 38
+# define YYLAST 93
+yytabelem yyact[]={
+
+ 19, 54, 44, 16, 45, 19, 24, 37, 22, 38,
+ 39, 24, 21, 22, 18, 20, 23, 21, 25, 18,
+ 20, 23, 36, 7, 6, 5, 8, 9, 19, 60,
+ 26, 16, 40, 41, 24, 25, 22, 38, 39, 15,
+ 21, 11, 18, 20, 23, 32, 33, 34, 35, 30,
+ 31, 14, 10, 17, 13, 12, 4, 3, 1, 2,
+ 0, 0, 0, 0, 0, 27, 28, 29, 0, 0,
+ 42, 0, 48, 49, 50, 51, 52, 53, 43, 47,
+ 58, 59, 46, 0, 0, 0, 0, 0, 0, 0,
+ 56, 57, 55 };
+yytabelem yypact[]={
+
+ -263,-10000000, -230,-10000000, -234, -235, -235, -235,-10000000,-10000000,
+-10000000, -212, -245, -261, -240,-10000000, -258,-10000000, -235, -276,
+-10000000,-10000000, -271,-10000000,-10000000, -235, -235, -230, -230, -230,
+ -235, -235, -235, -235, -235, -235, -277, -235, -235, -235,
+ -235, -235,-10000000, -247,-10000000,-10000000, -234,-10000000,-10000000,-10000000,
+-10000000,-10000000,-10000000,-10000000,-10000000, -233, -240, -240,-10000000,-10000000,
+-10000000 };
+yytabelem yypgo[]={
+
+ 0, 58, 57, 59, 56, 52, 41, 55, 54, 51,
+ 39, 53 };
+yytabelem yyr1[]={
+
+ 0, 1, 1, 2, 2, 2, 2, 2, 3, 3,
+ 4, 4, 5, 5, 5, 5, 5, 5, 5, 6,
+ 6, 7, 7, 8, 8, 8, 9, 9, 9, 10,
+ 10, 11, 11, 11, 11, 11, 11, 11 };
+yytabelem yyr2[]={
+
+ 0, 3, 3, 5, 5, 5, 3, 3, 7, 3,
+ 7, 3, 7, 7, 7, 7, 7, 7, 3, 7,
+ 3, 7, 3, 7, 7, 3, 7, 7, 3, 5,
+ 3, 7, 5, 3, 3, 5, 3, 3 };
+yytabelem yychk[]={
+
+-10000000, -1, -3, -2, -4, 288, 287, 286, 289, 290,
+ -5, -6, -7, -8, -9, -10, 266, -11, 277, 263,
+ 278, 275, 271, 279, 269, 265, 264, -3, -3, -3,
+ 261, 262, 257, 258, 259, 260, 267, 268, 270, 271,
+ 272, 273, -11, -3, 278, 275, -4, -5, -6, -6,
+ -6, -6, -6, -6, 278, -8, -9, -9, -10, -10,
+ 276 };
+yytabelem yydef[]={
+
+ 0, -2, 1, 2, 9, 0, 0, 0, 6, 7,
+ 11, 18, 20, 22, 25, 28, 0, 30, 0, 0,
+ 33, 34, 0, 36, 37, 0, 0, 3, 4, 5,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 29, 0, 32, 35, 8, 10, 12, 13,
+ 14, 15, 16, 17, 19, 21, 23, 24, 26, 27,
+ 31 };
+typedef struct
+#ifdef __cplusplus
+ yytoktype
+#endif
+{ char *t_name; int t_val; } yytoktype;
+#ifndef YYDEBUG
+# define YYDEBUG 0 /* don't allow debugging */
+#endif
+
+#if YYDEBUG
+
+yytoktype yytoks[] =
+{
+ "TAO_GT", 257,
+ "TAO_GE", 258,
+ "TAO_LT", 259,
+ "TAO_LE", 260,
+ "TAO_EQ", 261,
+ "TAO_NE", 262,
+ "TAO_EXIST", 263,
+ "TAO_AND", 264,
+ "TAO_OR", 265,
+ "TAO_NOT", 266,
+ "TAO_IN", 267,
+ "TAO_TWIDDLE", 268,
+ "TAO_BOOLEAN", 269,
+ "TAO_PLUS", 270,
+ "TAO_MINUS", 271,
+ "TAO_MULT", 272,
+ "TAO_DIV", 273,
+ "TAO_UMINUS", 274,
+ "TAO_NUMBER", 275,
+ "TAO_RPAREN", 276,
+ "TAO_LPAREN", 277,
+ "TAO_IDENT", 278,
+ "TAO_STRING", 279,
+ "TAO_UNKNOWN", 280,
+ "TAO_UNSIGNED", 281,
+ "TAO_SIGNED", 282,
+ "TAO_DOUBLE", 283,
+ "TAO_CONSTRAINT", 284,
+ "TAO_SEQUENCE", 285,
+ "TAO_WITH", 286,
+ "TAO_MAX", 287,
+ "TAO_MIN", 288,
+ "TAO_FIRST", 289,
+ "TAO_RANDOM", 290,
+ "-unknown-", -1 /* ends search */
+};
+
+char * yyreds[] =
+{
+ "-no such reduction-",
+ "constraint : bool_or",
+ "constraint : preference",
+ "preference : TAO_MIN bool_or",
+ "preference : TAO_MAX bool_or",
+ "preference : TAO_WITH bool_or",
+ "preference : TAO_FIRST",
+ "preference : TAO_RANDOM",
+ "bool_or : bool_or TAO_OR bool_and",
+ "bool_or : bool_and",
+ "bool_and : bool_and TAO_AND bool_compare",
+ "bool_and : bool_compare",
+ "bool_compare : expr_in TAO_EQ expr_in",
+ "bool_compare : expr_in TAO_NE expr_in",
+ "bool_compare : expr_in TAO_GT expr_in",
+ "bool_compare : expr_in TAO_GE expr_in",
+ "bool_compare : expr_in TAO_LT expr_in",
+ "bool_compare : expr_in TAO_LE expr_in",
+ "bool_compare : expr_in",
+ "expr_in : expr_twiddle TAO_IN TAO_IDENT",
+ "expr_in : expr_twiddle",
+ "expr_twiddle : expr TAO_TWIDDLE expr",
+ "expr_twiddle : expr",
+ "expr : expr TAO_PLUS term",
+ "expr : expr TAO_MINUS term",
+ "expr : term",
+ "term : term TAO_MULT factor_not",
+ "term : term TAO_DIV factor_not",
+ "term : factor_not",
+ "factor_not : TAO_NOT factor",
+ "factor_not : factor",
+ "factor : TAO_LPAREN bool_or TAO_RPAREN",
+ "factor : TAO_EXIST TAO_IDENT",
+ "factor : TAO_IDENT",
+ "factor : TAO_NUMBER",
+ "factor : TAO_MINUS TAO_NUMBER",
+ "factor : TAO_STRING",
+ "factor : TAO_BOOLEAN",
+};
+#endif /* YYDEBUG */
+
+/*
+ * Copyright (c) 1993 by Sun Microsystems, Inc.
+ */
+
+//#pragma ident "@(#)yaccpar 6.12 93/06/07 SMI"
+
+/*
+** Skeleton parser driver for yacc output
+*/
+
+/*
+** yacc user known macros and defines
+*/
+#define YYERROR goto yyerrlab
+#define YYACCEPT return(0)
+#define YYABORT return(1)
+#define YYBACKUP( newtoken, newvalue )\
+{\
+ if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
+ {\
+ yyerror( "syntax error - cannot backup" );\
+ goto yyerrlab;\
+ }\
+ yychar = newtoken;\
+ yystate = *yyps;\
+ yylval = newvalue;\
+ goto yynewstate;\
+}
+#define YYRECOVERING() (!!yyerrflag)
+#define YYNEW(type) malloc(sizeof(type) * yynewmax)
+#define YYCOPY(to, from, type) \
+ (type *) ACE_OS::memcpy(to, (char *) from, yynewmax * sizeof(type))
+#define YYENLARGE( from, type) \
+ (type *) realloc((char *) from, yynewmax * sizeof(type))
+#ifndef YYDEBUG
+# define YYDEBUG 1 /* make debugging available */
+#endif
+
+/*
+** user known globals
+*/
+int yydebug; /* set to 1 to get debugging */
+
+/*
+** driver internal defines
+*/
+#define YYFLAG (-10000000)
+
+/*
+** global variables used by the parser
+*/
+YYSTYPE *yypv; /* top of value stack */
+int *yyps; /* top of state stack */
+
+int yystate; /* current state */
+int yytmp; /* extra var (lasts between blocks) */
+
+int yynerrs; /* number of errors */
+int yyerrflag; /* error recovery flag */
+int yychar; /* current input token number */
+
+
+
+#ifdef YYNMBCHARS
+#define YYLEX() yycvtok(yylex())
+/*
+** yycvtok - return a token if i is a wchar_t value that exceeds 255.
+** If i<255, i itself is the token. If i>255 but the neither
+** of the 30th or 31st bit is on, i is already a token.
+*/
+#if defined(__STDC__) || defined(__cplusplus)
+int yycvtok(int i)
+#else
+int yycvtok(i) int i;
+#endif
+{
+ int first = 0;
+ int last = YYNMBCHARS - 1;
+ int mid;
+ wchar_t j;
+
+ if(i&0x60000000){/*Must convert to a token. */
+ if( yymbchars[last].character < i ){
+ return i;/*Giving up*/
+ }
+ while ((last>=first)&&(first>=0)) {/*Binary search loop*/
+ mid = (first+last)/2;
+ j = yymbchars[mid].character;
+ if( j==i ){/*Found*/
+ return yymbchars[mid].tvalue;
+ }else if( j<i ){
+ first = mid + 1;
+ }else{
+ last = mid -1;
+ }
+ }
+ /*No entry in the table.*/
+ return i;/* Giving up.*/
+ }else{/* i is already a token. */
+ return i;
+ }
+}
+#else/*!YYNMBCHARS*/
+#define YYLEX() yylex()
+#endif/*!YYNMBCHARS*/
+
+/*
+** yyparse - return 0 if worked, 1 if syntax error not recovered from
+*/
+#if defined(__STDC__) || defined(__cplusplus)
+int yyparse(void)
+#else
+int yyparse()
+#endif
+{
+ register YYSTYPE *yypvt = 0; /* top of value stack for $vars */
+
+#if defined(__cplusplus) || defined(lint)
+/*
+ hacks to please C++ and lint - goto's inside switch should never be
+ executed; yypvt is set to 0 to avoid "used before set" warning.
+*/
+ static int __yaccpar_lint_hack__ = 0;
+ switch (__yaccpar_lint_hack__)
+ {
+ case 1: goto yyerrlab;
+ case 2: goto yynewstate;
+ }
+ yypvt = 0;
+#endif
+
+ /*
+ ** Initialize externals - yyparse may be called more than once
+ */
+ yypv = &yyv[-1];
+ yyps = &yys[-1];
+ yystate = 0;
+ yytmp = 0;
+ yynerrs = 0;
+ yyerrflag = 0;
+ yychar = -1;
+
+#if YYMAXDEPTH <= 0
+ if (yymaxdepth <= 0)
+ {
+ if ((yymaxdepth = YYEXPAND(0)) <= 0)
+ {
+ yyerror("yacc initialization error");
+ YYABORT;
+ }
+ }
+#endif
+
+ {
+ register YYSTYPE *yy_pv; /* top of value stack */
+ register int *yy_ps; /* top of state stack */
+ register int yy_state; /* current state */
+ register int yy_n; /* internal state number info */
+ goto yystack; /* moved from 6 lines above to here to please C++ */
+
+ /*
+ ** get globals into registers.
+ ** branch to here only if YYBACKUP was called.
+ */
+ yynewstate:
+ yy_pv = yypv;
+ yy_ps = yyps;
+ yy_state = yystate;
+ goto yy_newstate;
+
+ /*
+ ** get globals into registers.
+ ** either we just started, or we just finished a reduction
+ */
+ yystack:
+ yy_pv = yypv;
+ yy_ps = yyps;
+ yy_state = yystate;
+
+ /*
+ ** top of for (;;) loop while no reductions done
+ */
+ yy_stack:
+ /*
+ ** put a state and value onto the stacks
+ */
+#if YYDEBUG
+ /*
+ ** if debugging, look up token value in list of value vs.
+ ** name pairs. 0 and negative (-1) are special values.
+ ** Note: linear search is used since time is not a real
+ ** consideration while debugging.
+ */
+ if ( yydebug )
+ {
+ register int yy_i;
+
+ printf( "State %d, token ", yy_state );
+ if ( yychar == 0 )
+ printf( "end-of-file\n" );
+ else if ( yychar < 0 )
+ printf( "-none-\n" );
+ else
+ {
+ for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
+ yy_i++ )
+ {
+ if ( yytoks[yy_i].t_val == yychar )
+ break;
+ }
+ printf( "%s\n", yytoks[yy_i].t_name );
+ }
+ }
+#endif /* YYDEBUG */
+ if ( ++yy_ps >= &yys[ yymaxdepth ] ) /* room on stack? */
+ {
+ /*
+ ** reallocate and recover. Note that pointers
+ ** have to be reset, or bad things will happen
+ */
+ int yyps_index = (yy_ps - yys);
+ int yypv_index = (yy_pv - yyv);
+ int yypvt_index = (yypvt - yyv);
+ int yynewmax;
+#ifdef YYEXPAND
+ yynewmax = YYEXPAND(yymaxdepth);
+#else
+ yynewmax = 2 * yymaxdepth; /* double table size */
+ if (yymaxdepth == YYMAXDEPTH) /* first time growth */
+ {
+ char *newyys = (char *)YYNEW(int);
+ char *newyyv = (char *)YYNEW(YYSTYPE);
+ if (newyys != 0 && newyyv != 0)
+ {
+ yys = YYCOPY(newyys, yys, int);
+ yyv = YYCOPY(newyyv, yyv, YYSTYPE);
+ }
+ else
+ yynewmax = 0; /* failed */
+ }
+ else /* not first time */
+ {
+ yys = YYENLARGE(yys, int);
+ yyv = YYENLARGE(yyv, YYSTYPE);
+ if (yys == 0 || yyv == 0)
+ yynewmax = 0; /* failed */
+ }
+#endif
+ if (yynewmax <= yymaxdepth) /* tables not expanded */
+ {
+ yyerror( "yacc stack overflow" );
+ YYABORT;
+ }
+ yymaxdepth = yynewmax;
+
+ yy_ps = yys + yyps_index;
+ yy_pv = yyv + yypv_index;
+ yypvt = yyv + yypvt_index;
+ }
+ *yy_ps = yy_state;
+ *++yy_pv = yyval;
+
+ /*
+ ** we have a new state - find out what to do
+ */
+ yy_newstate:
+ if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
+ goto yydefault; /* simple state */
+#if YYDEBUG
+ /*
+ ** if debugging, need to mark whether new token grabbed
+ */
+ yytmp = yychar < 0;
+#endif
+ if ( ( yychar < 0 ) && ( ( yychar = YYLEX() ) < 0 ) )
+ yychar = 0; /* reached EOF */
+#if YYDEBUG
+ if ( yydebug && yytmp )
+ {
+ register int yy_i;
+
+ printf( "Received token " );
+ if ( yychar == 0 )
+ printf( "end-of-file\n" );
+ else if ( yychar < 0 )
+ printf( "-none-\n" );
+ else
+ {
+ for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
+ yy_i++ )
+ {
+ if ( yytoks[yy_i].t_val == yychar )
+ break;
+ }
+ printf( "%s\n", yytoks[yy_i].t_name );
+ }
+ }
+#endif /* YYDEBUG */
+ if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
+ goto yydefault;
+ if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar ) /*valid shift*/
+ {
+ yychar = -1;
+ yyval = yylval;
+ yy_state = yy_n;
+ if ( yyerrflag > 0 )
+ yyerrflag--;
+ goto yy_stack;
+ }
+
+ yydefault:
+ if ( ( yy_n = yydef[ yy_state ] ) == -2 )
+ {
+#if YYDEBUG
+ yytmp = yychar < 0;
+#endif
+ if ( ( yychar < 0 ) && ( ( yychar = YYLEX() ) < 0 ) )
+ yychar = 0; /* reached EOF */
+#if YYDEBUG
+ if ( yydebug && yytmp )
+ {
+ register int yy_i;
+
+ printf( "Received token " );
+ if ( yychar == 0 )
+ printf( "end-of-file\n" );
+ else if ( yychar < 0 )
+ printf( "-none-\n" );
+ else
+ {
+ for ( yy_i = 0;
+ yytoks[yy_i].t_val >= 0;
+ yy_i++ )
+ {
+ if ( yytoks[yy_i].t_val
+ == yychar )
+ {
+ break;
+ }
+ }
+ printf( "%s\n", yytoks[yy_i].t_name );
+ }
+ }
+#endif /* YYDEBUG */
+ /*
+ ** look through exception table
+ */
+ {
+ register int *yyxi = yyexca;
+
+ while ( ( *yyxi != -1 ) ||
+ ( yyxi[1] != yy_state ) )
+ {
+ yyxi += 2;
+ }
+ while ( ( *(yyxi += 2) >= 0 ) &&
+ ( *yyxi != yychar ) )
+ ;
+ if ( ( yy_n = yyxi[1] ) < 0 )
+ YYACCEPT;
+ }
+ }
+
+ /*
+ ** check for syntax error
+ */
+ if ( yy_n == 0 ) /* have an error */
+ {
+ /* no worry about speed here! */
+ switch ( yyerrflag )
+ {
+ case 0: /* new error */
+ yyerror( "syntax error" );
+ goto skip_init;
+ yyerrlab:
+ /*
+ ** get globals into registers.
+ ** we have a user generated syntax type error
+ */
+ yy_pv = yypv;
+ yy_ps = yyps;
+ yy_state = yystate;
+ skip_init:
+ yynerrs++;
+ /* FALLTHRU */
+ case 1:
+ case 2: /* incompletely recovered error */
+ /* try again... */
+ yyerrflag = 3;
+ /*
+ ** find state where "error" is a legal
+ ** shift action
+ */
+ while ( yy_ps >= yys )
+ {
+ yy_n = yypact[ *yy_ps ] + YYERRCODE;
+ if ( yy_n >= 0 && yy_n < YYLAST &&
+ yychk[yyact[yy_n]] == YYERRCODE) {
+ /*
+ ** simulate shift of "error"
+ */
+ yy_state = yyact[ yy_n ];
+ goto yy_stack;
+ }
+ /*
+ ** current state has no shift on
+ ** "error", pop stack
+ */
+#if YYDEBUG
+# define _POP_ "Error recovery pops state %d, uncovers state %d\n"
+ if ( yydebug )
+ printf( _POP_, *yy_ps,
+ yy_ps[-1] );
+# undef _POP_
+#endif
+ yy_ps--;
+ yy_pv--;
+ }
+ /*
+ ** there is no state on stack with "error" as
+ ** a valid shift. give up.
+ */
+ YYABORT;
+ case 3: /* no shift yet; eat a token */
+#if YYDEBUG
+ /*
+ ** if debugging, look up token in list of
+ ** pairs. 0 and negative shouldn't occur,
+ ** but since timing doesn't matter when
+ ** debugging, it doesn't hurt to leave the
+ ** tests here.
+ */
+ if ( yydebug )
+ {
+ register int yy_i;
+
+ printf( "Error recovery discards " );
+ if ( yychar == 0 )
+ printf( "token end-of-file\n" );
+ else if ( yychar < 0 )
+ printf( "token -none-\n" );
+ else
+ {
+ for ( yy_i = 0;
+ yytoks[yy_i].t_val >= 0;
+ yy_i++ )
+ {
+ if ( yytoks[yy_i].t_val
+ == yychar )
+ {
+ break;
+ }
+ }
+ printf( "token %s\n",
+ yytoks[yy_i].t_name );
+ }
+ }
+#endif /* YYDEBUG */
+ if ( yychar == 0 ) /* reached EOF. quit */
+ YYABORT;
+ yychar = -1;
+ goto yy_newstate;
+ }
+ }/* end if ( yy_n == 0 ) */
+ /*
+ ** reduction by production yy_n
+ ** put stack tops, etc. so things right after switch
+ */
+#if YYDEBUG
+ /*
+ ** if debugging, print the string that is the user's
+ ** specification of the reduction which is just about
+ ** to be done.
+ */
+ if ( yydebug )
+ printf( "Reduce by (%d) \"%s\"\n",
+ yy_n, yyreds[ yy_n ] );
+#endif
+ yytmp = yy_n; /* value to switch over */
+ yypvt = yy_pv; /* $vars top of value stack */
+ /*
+ ** Look in goto table for next state
+ ** Sorry about using yy_state here as temporary
+ ** register variable, but why not, if it works...
+ ** If yyr2[ yy_n ] doesn't have the low order bit
+ ** set, then there is no action to be done for
+ ** this reduction. So, no saving & unsaving of
+ ** registers done. The only difference between the
+ ** code just after the if and the body of the if is
+ ** the goto yy_stack in the body. This way the test
+ ** can be made before the choice of what to do is needed.
+ */
+ {
+ /* length of production doubled with extra bit */
+ register int yy_len = yyr2[ yy_n ];
+
+ if ( !( yy_len & 01 ) )
+ {
+ yy_len >>= 1;
+ yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
+ yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
+ *( yy_ps -= yy_len ) + 1;
+ if ( yy_state >= YYLAST ||
+ yychk[ yy_state =
+ yyact[ yy_state ] ] != -yy_n )
+ {
+ yy_state = yyact[ yypgo[ yy_n ] ];
+ }
+ goto yy_stack;
+ }
+ yy_len >>= 1;
+ yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
+ yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
+ *( yy_ps -= yy_len ) + 1;
+ if ( yy_state >= YYLAST ||
+ yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
+ {
+ yy_state = yyact[ yypgo[ yy_n ] ];
+ }
+ }
+ /* save until reenter driver code */
+ yystate = yy_state;
+ yyps = yy_ps;
+ yypv = yy_pv;
+ }
+ /*
+ ** code supplied by user is placed in this switch
+ */
+ switch( yytmp )
+ {
+
+case 1:
+
+{ yyval.constraint_ = new TAO_Unary_Constraint(TAO_CONSTRAINT, yypvt[-0].constraint_); } break;
+case 2:
+
+{ yyval.constraint_ = yypvt[-0].constraint_; } break;
+case 3:
+
+{ yyval.constraint_ = new TAO_Unary_Constraint(TAO_MIN, yypvt[-0].constraint_); } break;
+case 4:
+
+{ yyval.constraint_ = new TAO_Unary_Constraint(TAO_MAX, yypvt[-0].constraint_); } break;
+case 5:
+
+{ yyval.constraint_ = new TAO_Unary_Constraint(TAO_WITH, yypvt[-0].constraint_); } break;
+case 6:
+
+{ yyval.constraint_ = new TAO_Noop_Constraint(TAO_FIRST); } break;
+case 7:
+
+{ yyval.constraint_ = new TAO_Noop_Constraint(TAO_RANDOM); } break;
+case 8:
+
+{ yyval.constraint_ = new TAO_Binary_Constraint(TAO_OR, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
+case 9:
+
+{ yyval.constraint_ = yypvt[-0].constraint_; } break;
+case 10:
+
+{ yyval.constraint_ = new TAO_Binary_Constraint(TAO_AND, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
+case 11:
+
+{ yyval.constraint_ = yypvt[-0].constraint_; } break;
+case 12:
+
+{ yyval.constraint_ = new TAO_Binary_Constraint(TAO_EQ, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
+case 13:
+
+{ yyval.constraint_ = new TAO_Binary_Constraint(TAO_NE, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
+case 14:
+
+{ yyval.constraint_ = new TAO_Binary_Constraint(TAO_GT, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
+case 15:
+
+{ yyval.constraint_ = new TAO_Binary_Constraint(TAO_GE, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
+case 16:
+
+{ yyval.constraint_ = new TAO_Binary_Constraint(TAO_LT, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
+case 17:
+
+{ yyval.constraint_ = new TAO_Binary_Constraint(TAO_LE, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
+case 18:
+
+{ yyval.constraint_ = yypvt[-0].constraint_; } break;
+case 19:
+
+{ yyval.constraint_ = new TAO_Binary_Constraint(TAO_IN, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
+case 20:
+
+{ yyval.constraint_ = yypvt[-0].constraint_; } break;
+case 21:
+
+{ yyval.constraint_ = new TAO_Binary_Constraint(TAO_TWIDDLE, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
+case 22:
+
+{ yyval.constraint_ = yypvt[-0].constraint_; } break;
+case 23:
+
+{ yyval.constraint_ = new TAO_Binary_Constraint(TAO_PLUS, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
+case 24:
+
+{ yyval.constraint_ = new TAO_Binary_Constraint(TAO_MINUS, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
+case 25:
+
+{ yyval.constraint_ = yypvt[-0].constraint_; } break;
+case 26:
+
+{ yyval.constraint_ = new TAO_Binary_Constraint(TAO_MULT, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
+case 27:
+
+{ yyval.constraint_ = new TAO_Binary_Constraint(TAO_DIV, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
+case 28:
+
+{ yyval.constraint_ = yypvt[-0].constraint_; } break;
+case 29:
+
+{ yyval.constraint_ = new TAO_Unary_Constraint(TAO_NOT, yypvt[-0].constraint_); } break;
+case 30:
+
+{ yyval.constraint_ = yypvt[-0].constraint_; } break;
+case 31:
+
+{ yyval.constraint_ = yypvt[-1].constraint_; } break;
+case 32:
+
+{ yyval.constraint_ = new TAO_Unary_Constraint(TAO_EXIST, yypvt[-0].constraint_); } break;
+case 33:
+
+{ yyval.constraint_ = yypvt[-0].constraint_; } break;
+case 34:
+
+{ yyval.constraint_ = yypvt[-0].constraint_; } break;
+case 35:
+
+{ yyval.constraint_ = new TAO_Unary_Constraint(TAO_UMINUS, yypvt[-0].constraint_); } break;
+case 36:
+
+{ yyval.constraint_ = yypvt[-0].constraint_; } break;
+case 37:
+
+{ yyval.constraint_ = yypvt[-0].constraint_; } break;
+
+ }
+ goto yystack; /* reset registers in driver code */
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Interpreter.cpp b/TAO/orbsvcs/orbsvcs/Trader/Interpreter.cpp
new file mode 100644
index 00000000000..ff6f7b4a1e4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Interpreter.cpp
@@ -0,0 +1,101 @@
+// $Id$
+
+#include "orbsvcs/Trader/Interpreter.h"
+#include "ace/OS_NS_string.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_SYNCH_MUTEX TAO_Interpreter::parserMutex__;
+
+TAO_Interpreter::TAO_Interpreter (void)
+ : root_ (0)
+{
+}
+
+TAO_Interpreter::~TAO_Interpreter (void)
+{
+ delete root_;
+}
+
+int
+TAO_Interpreter::build_tree (const char* constraints)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ guard,
+ TAO_Interpreter::parserMutex__,
+ -1);
+
+ TAO_Lex_String_Input::reset ((char*)constraints);
+ int return_value = 0;
+
+ yyval.constraint_ = 0;
+ return_value = ::yyparse ();
+
+ if (return_value == 0 && yyval.constraint_ != 0)
+ this->root_ = yyval.constraint_;
+ else
+ {
+ while (yylex () > 0)
+ continue;
+ this->root_ = 0;
+ }
+
+ return return_value;
+}
+
+int
+TAO_Interpreter::is_empty_string (const char* str)
+{
+ int return_value = 0;
+
+ if (str != 0)
+ {
+ int i = 0;
+ while (str[i] != '\0')
+ {
+ if (str[i] != ' ')
+ break;
+
+ i++;
+ }
+
+ if (str[i] == '\0')
+ return_value = 1;
+ }
+
+ return return_value;
+}
+
+char* TAO_Lex_String_Input::string_ = 0;
+char* TAO_Lex_String_Input::current_ = 0;
+char* TAO_Lex_String_Input::end_ = 0;
+
+// Routine to have Lex read its input from the constraint string.
+
+int
+TAO_Lex_String_Input::copy_into (char* buf, int max_size)
+{
+ int chars_left = TAO_Lex_String_Input::end_ - TAO_Lex_String_Input::current_;
+ int n = max_size > chars_left ? chars_left : max_size;
+
+ if (n > 0)
+ {
+ ACE_OS:: memcpy (buf,
+ TAO_Lex_String_Input::current_,
+ n);
+ TAO_Lex_String_Input::current_ += n;
+ }
+
+ return n;
+}
+
+void
+TAO_Lex_String_Input::reset (char* input_string)
+{
+ TAO_Lex_String_Input::string_ = input_string;
+ TAO_Lex_String_Input::current_ = input_string;
+ TAO_Lex_String_Input::end_ = input_string +
+ ACE_OS::strlen (TAO_Lex_String_Input::string_);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Interpreter.h b/TAO/orbsvcs/orbsvcs/Trader/Interpreter.h
new file mode 100644
index 00000000000..7971ed9e024
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Interpreter.h
@@ -0,0 +1,107 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Interpreter.h
+ *
+ * $Id$
+ *
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_TCL_INTERPRETER_H
+#define TAO_TCL_INTERPRETER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Trader/Constraint_Nodes.h"
+#include "orbsvcs/Trader/Constraint_Visitors.h"
+#include "orbsvcs/Trader/trading_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Constraint_Evaluator;
+class TAO_Constraint_Validator;
+
+/**
+ * @class TAO_Interpreter
+ *
+ * @brief TAO_Interpreter is the superclass for all interpreters. Its
+ * build tree method invokes the yacc parser to parse a constraint
+ * or preference string.
+ */
+class TAO_Trading_Serv_Export TAO_Interpreter
+{
+protected:
+ // = Initialization and termination methods.
+ /// Constructor.
+ TAO_Interpreter (void);
+
+ /// Destructor.
+ ~TAO_Interpreter (void);
+
+ /// Using the Yacc generated parser, construct an expression tree
+ /// representing <constraints> from the tokens returned by it.
+ int build_tree (const char* preferences);
+
+ static int is_empty_string (const char* str);
+
+ /// The root of the expression tree, not equal to null if build_tree
+ /// successfully builds a tree from the constraints.
+ TAO_Constraint* root_;
+private:
+ /// This mutex protects the <build_tree> method from reentrance.
+ static TAO_SYNCH_MUTEX parserMutex__;
+};
+
+
+// Functions we need for parsing.
+extern int yyparse (void);
+extern void yyrestart (FILE*);
+extern int yylex (void);
+
+// Have yylex read from the constraint string, not from stdin.
+#undef YY_INPUT
+#define YY_INPUT(b, r, ms) (r = TAO_Lex_String_Input::copy_into(b, ms))
+
+#undef yyerror
+#define yyerror(x)
+
+/**
+ * @class TAO_Lex_String_Input
+ *
+ * @brief Have Lex read from a string and not from stdin. Essentially,
+ * the interpreter needs to call yylex() until EOF, and call
+ * TAO_Lex_String_Input::reset() with the new string, prior to
+ * calling yyparse.
+ */
+class TAO_Lex_String_Input
+{
+public:
+ /// Reset the lex input.
+ static void reset (char* input_string);
+
+ /// Method lex will call to read from the input string.
+ static int copy_into (char* buf, int max_size);
+
+private:
+
+ /// Pointers to keep track of the input string.
+ static char* string_;
+ static char* current_;
+ static char* end_;
+};
+
+// The union used by lex and yacc to build the Abstract Syntax Tree.
+typedef union
+{
+ TAO_Constraint* constraint_;
+} YYSTYPE;
+
+extern YYSTYPE yylval;
+extern YYSTYPE yyval;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TCL_INTERPRETER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils.cpp b/TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils.cpp
new file mode 100644
index 00000000000..993d47ad0e0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils.cpp
@@ -0,0 +1,56 @@
+// $Id$
+
+#include "orbsvcs/Trader/Interpreter_Utils.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// TAO_Sequence_Extracter_Base
+
+CORBA::TCKind
+TAO_Sequence_Extracter_Base::
+sequence_type (CORBA::TypeCode* type_code
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // @@ Seth, why do you use a comma to separate the two statements?
+ CORBA::TCKind return_value = CORBA::tk_void,
+ type_kind = type_code->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (return_value);
+
+ if (type_kind == CORBA::tk_alias
+ || type_kind == CORBA::tk_sequence)
+ {
+ CORBA::TypeCode_var base = CORBA::TypeCode::_duplicate (type_code);
+
+ for (;;)
+ {
+ CORBA::TCKind base_kind = base->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (return_value);
+
+ if (base_kind == CORBA::tk_alias)
+ {
+ base = base->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (return_value);
+ }
+ else
+ break;
+ }
+
+ CORBA::TCKind base_kind = base->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (return_value);
+
+ if (base_kind == CORBA::tk_sequence)
+ {
+ base = base->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (return_value);
+
+ base_kind = base->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (return_value);
+ return_value = base_kind;
+ }
+ }
+
+ return return_value;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils.h b/TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils.h
new file mode 100644
index 00000000000..b258b921ef1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils.h
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Interpreter_Utils.h
+ *
+ * $Id$
+ */
+//=============================================================================
+
+#ifndef TAO_INTERPRETER_UTILS_H
+#define TAO_INTERPRETER_UTILS_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Hash_Map_Manager.h"
+#include "ace/Null_Mutex.h"
+#include "ace/Functor.h"
+#include "ace/ACE.h"
+#include "ace/OS_NS_string.h"
+
+#include "tao/AnyTypeCode/TypeCode.h"
+#include "tao/CORBA_String.h"
+#include "tao/SystemException.h"
+
+#include "orbsvcs/Trader/trading_serv_export.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template<>
+class TAO_Trading_Serv_Export ACE_Hash<CORBA::String_var>
+{
+public:
+ unsigned long operator () (const CORBA::String_var& string) const
+ {
+ unsigned long ret = ACE::hash_pjw (string.in ());
+ return ret;
+ }
+};
+
+template<>
+class TAO_Trading_Serv_Export ACE_Less_Than<CORBA::String_var>
+{
+public:
+ int operator () (const CORBA::String_var &lhs,
+ const CORBA::String_var &rhs) const
+ {
+ return ACE_OS::strcmp (lhs.in (), rhs.in ()) < 0;
+ }
+};
+
+template<>
+class TAO_Trading_Serv_Export ACE_Equal_To<CORBA::String_var>
+{
+public:
+ int operator () (const CORBA::String_var &lhs,
+ const CORBA::String_var &rhs) const
+ {
+ return ACE_OS::strcmp (lhs.in (), rhs.in ()) == 0;
+ }
+};
+
+typedef ACE_Hash_Map_Manager_Ex<CORBA::String_var,
+ int,
+ ACE_Hash<CORBA::String_var>,
+ ACE_Equal_To<CORBA::String_var>,
+ ACE_Null_Mutex>
+ TAO_Lookup_Table;
+typedef ACE_Hash_Map_Manager_Ex<CORBA::String_var,
+ CORBA::TypeCode_ptr,
+ ACE_Hash<CORBA::String_var>,
+ ACE_Equal_To<CORBA::String_var>,
+ ACE_Null_Mutex>
+ TAO_Typecode_Table;
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// *************************************************************
+// TAO_Sequence_Extracter_Base
+// *************************************************************
+
+class TAO_Sequence_Extracter_Base
+// = TITLE
+// Static methods used by the TAO_Sequence_Extracter class.
+{
+public:
+
+ static CORBA::TCKind sequence_type (CORBA::TypeCode* code
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Return the sequence element type for the sequence whose typecode
+ // is <code>.
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_INTERPRETER_UTILS_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils_T.cpp b/TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils_T.cpp
new file mode 100644
index 00000000000..5474d4fb694
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils_T.cpp
@@ -0,0 +1,52 @@
+// $Id$
+
+#ifndef TAO_INTERPRETER_UTILS_CPP
+#define TAO_INTERPRETER_UTILS_CPP
+
+#include "orbsvcs/Trader/Interpreter_Utils_T.h"
+#include "orbsvcs/Trader/Constraint_Visitors.h"
+#include "tao/DynamicAny/DynSequence_i.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class OPERAND_TYPE> CORBA::Boolean
+TAO_find (const CORBA::Any& sequence, const OPERAND_TYPE& element)
+{
+ CORBA::Boolean return_value = 0;
+ TAO_Element_Equal<OPERAND_TYPE> functor;
+ TAO_DynSequence_i dyn_seq;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ dyn_seq.init (sequence ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ULong length =
+ dyn_seq.get_length ( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ dyn_seq.rewind( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ for (CORBA::ULong i = 0 ; i < length && ! return_value; i++)
+ {
+ if (functor (dyn_seq, element))
+ return_value = 1;
+
+ dyn_seq.next( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return 0;
+ }
+ ACE_ENDTRY;
+
+ return return_value;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_INTERPRETER_UTILS_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils_T.h b/TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils_T.h
new file mode 100644
index 00000000000..bbef8857006
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils_T.h
@@ -0,0 +1,23 @@
+// -*- C++ -*-
+
+// $Id$
+
+#ifndef TAO_INTERPRETER_UTILS_T_H
+#define TAO_INTERPRETER_UTILS_T_H
+#include /**/ "ace/pre.h"
+
+#include "tao/Basic_Types.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class OPERAND_TYPE>
+CORBA::Boolean TAO_find (const CORBA::Any& sequence, const OPERAND_TYPE& operand);
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Trader/Interpreter_Utils_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_INTERPRETER_UTILS_T_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Locking.h b/TAO/orbsvcs/orbsvcs/Trader/Locking.h
new file mode 100644
index 00000000000..e01ba419b43
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Locking.h
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Locking.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ * @author Irfan Pyarali <irfan@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_LOCKING_H
+#define TAO_LOCKING_H
+
+#include /**/ "ace/pre.h"
+
+// Macros for obtaining read/write locks that are
+// automatically released at the end of scope.
+// In case of failure, CORBA::SystemException is thrown.
+
+#define TAO_WRITE_GUARD(MUTEX,OBJ,LOCK) \
+ACE_Write_Guard<MUTEX> OBJ (LOCK); \
+if (OBJ.locked () == 0) \
+ TAO_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_NO));
+
+#define TAO_READ_GUARD(MUTEX,OBJ,LOCK) \
+ACE_Read_Guard<MUTEX> OBJ (LOCK); \
+if (OBJ.locked () == 0) \
+ TAO_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_NO));
+
+#define TAO_WRITE_GUARD_RETURN(MUTEX,OBJ,LOCK,RETURN) \
+ACE_Write_Guard<MUTEX> OBJ (LOCK); \
+if (OBJ.locked () == 0) \
+ TAO_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_NO), RETURN);
+
+#define TAO_READ_GUARD_RETURN(MUTEX,OBJ,LOCK,RETURN) \
+ACE_Read_Guard<MUTEX> OBJ (LOCK); \
+if (OBJ.locked () == 0) \
+ TAO_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_NO), RETURN);
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LOCKING_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Offer_Database.cpp b/TAO/orbsvcs/orbsvcs/Trader/Offer_Database.cpp
new file mode 100644
index 00000000000..9401c5366c0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Offer_Database.cpp
@@ -0,0 +1,389 @@
+// $Id$
+
+#ifndef TAO_OFFER_DATABASE_CPP
+#define TAO_OFFER_DATABASE_CPP
+
+#include "orbsvcs/Trader/Offer_Database.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class LOCK_TYPE>
+TAO_Offer_Database<LOCK_TYPE>::TAO_Offer_Database (void)
+{
+}
+
+template <class LOCK_TYPE>
+TAO_Offer_Database<LOCK_TYPE>::~TAO_Offer_Database (void)
+{
+ ACE_WRITE_GUARD (LOCK_TYPE, ace_mon, this->db_lock_);
+
+ for (ACE_TYPENAME Offer_Database::iterator type_iter (this->offer_db_);
+ ! type_iter.done ();
+ type_iter++)
+ {
+ Offer_Map_Entry* offer_map_entry = (*type_iter).int_id_;
+
+ {
+ // Artificial scope, so the guard will release the lock before
+ // we delete the lock along with the offer_map_entry.
+ ACE_WRITE_GUARD (LOCK_TYPE, ace_mon, offer_map_entry->lock_);
+
+ for (TAO_Offer_Map::iterator offer_iter (*offer_map_entry->offer_map_);
+ ! offer_iter.done ();
+ offer_iter++)
+ {
+ // Delete all the offers in the offer map.
+ CosTrading::Offer* offer = (*offer_iter).int_id_;
+ delete offer;
+ }
+
+ delete offer_map_entry->offer_map_;
+ }
+
+ delete offer_map_entry;
+ }
+}
+
+template <class LOCK_TYPE> CosTrading::OfferId
+TAO_Offer_Database<LOCK_TYPE>::
+insert_offer (const char* type, CosTrading::Offer* offer)
+{
+ CosTrading::OfferId return_value = 0;
+ ACE_TYPENAME Offer_Database::ENTRY* database_entry = 0;
+ CORBA::String_var service_type (type);
+
+ ACE_READ_GUARD_RETURN (LOCK_TYPE, ace_mon, this->db_lock_, 0);
+
+ if (this->offer_db_.find (service_type, database_entry) == -1)
+ {
+ // If there's no entry for the service type, create one.
+
+ Offer_Map_Entry* new_offer_map_entry = 0;
+ ACE_NEW_RETURN (new_offer_map_entry, Offer_Map_Entry, 0);
+ ACE_NEW_RETURN (new_offer_map_entry->offer_map_, TAO_Offer_Map, 0);
+ new_offer_map_entry->counter_ = 1;
+
+ if (this->db_lock_.release () == -1)
+ return 0;
+ else
+ {
+ // Add the new entry; upgrade lock.
+ ACE_WRITE_GUARD_RETURN (LOCK_TYPE, ace_mon, this->db_lock_, 0);
+ this->offer_db_.bind (service_type,
+ new_offer_map_entry,
+ database_entry);
+ }
+
+ if (this->db_lock_.acquire_read () == -1)
+ return 0;
+ }
+
+ Offer_Map_Entry* offer_map_entry =
+ database_entry->int_id_;
+ ACE_WRITE_GUARD_RETURN (LOCK_TYPE, ace_mon2, offer_map_entry->lock_, 0);
+
+ // Add the offer to the service offer table for this service type.
+ offer_map_entry->offer_map_->bind (offer_map_entry->counter_,
+ offer);
+ return_value = this->generate_offer_id (type,
+ offer_map_entry->counter_);
+ offer_map_entry->counter_++;
+
+ return return_value;
+}
+
+template <class LOCK_TYPE> int
+TAO_Offer_Database<LOCK_TYPE>::
+remove_offer (const char* type, CORBA::ULong id)
+{
+ ACE_READ_GUARD_RETURN (LOCK_TYPE, ace_mon, this->db_lock_, -1);
+
+ int return_value = -1;
+ ACE_TYPENAME Offer_Database::ENTRY* db_entry = 0;
+ CORBA::String_var service_type (type);
+
+ if (this->offer_db_.find (service_type, db_entry) == 0)
+ {
+ CosTrading::Offer* offer = 0;
+ Offer_Map_Entry* offer_map_entry = db_entry->int_id_;
+
+ if (offer_map_entry->lock_.acquire_write () == -1)
+ return -1;
+
+ return_value = offer_map_entry->offer_map_->unbind (id, offer);
+ delete offer;
+
+ // If the service type has no more offers, free the map, lest
+ // the memory forever persist.
+ if (offer_map_entry->offer_map_->current_size () == 0)
+ {
+ if (this->db_lock_.release () == -1)
+ return -1;
+ else
+ {
+ // Promote the database lock. Will be released by
+ // guard.
+ if (this->db_lock_.acquire_write () == -1)
+ return -1;
+
+ // Unbind the service type from the database.
+ this->offer_db_.unbind (service_type);
+
+ // Now that the type has been removed, we can release
+ // its lock.
+ if (offer_map_entry->lock_.release () == -1)
+ return -1;
+
+ // Delete the database resources for this type.
+ delete offer_map_entry->offer_map_;
+ delete offer_map_entry;
+ }
+ }
+ else if (offer_map_entry->lock_.release () == -1)
+ return -1;
+ }
+
+ return return_value;
+}
+
+template <class LOCK_TYPE> int
+TAO_Offer_Database<LOCK_TYPE>::
+remove_offer (const CosTrading::OfferId offer_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId))
+{
+ char* stype = 0;
+ CORBA::ULong index;
+
+ this->parse_offer_id (offer_id,
+ stype,
+ index
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->remove_offer (stype,
+ index) == -1)
+ ACE_THROW_RETURN (CosTrading::UnknownOfferId (offer_id),
+ -1);
+
+ return 0;
+}
+
+template <class LOCK_TYPE> CosTrading::Offer*
+TAO_Offer_Database<LOCK_TYPE>::
+lookup_offer (const CosTrading::OfferId offer_id,
+ char*& type_name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId))
+{
+ CORBA::ULong index;
+ CosTrading::Offer* offer = 0;
+ this->parse_offer_id (offer_id, type_name, index ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (offer);
+
+ if ((offer = this->lookup_offer (type_name, index)) == 0)
+ ACE_THROW_RETURN (CosTrading::UnknownOfferId (offer_id), offer);
+
+ return offer;
+}
+
+
+template <class LOCK_TYPE> CosTrading::Offer*
+TAO_Offer_Database<LOCK_TYPE>::
+lookup_offer (const CosTrading::OfferId offer_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId))
+{
+ char* type_name;
+ CORBA::ULong index;
+ CosTrading::Offer* offer = 0;
+
+ this->parse_offer_id (offer_id, type_name, index ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (offer);
+
+ if ((offer = this->lookup_offer (type_name, index)) == 0)
+ ACE_THROW_RETURN (CosTrading::UnknownOfferId (offer_id), offer);
+
+ return offer;
+}
+
+template <class LOCK_TYPE> CosTrading::Offer*
+TAO_Offer_Database<LOCK_TYPE>::
+lookup_offer (const char* type, CORBA::ULong id)
+{
+ ACE_READ_GUARD_RETURN (LOCK_TYPE, ace_mon, this->db_lock_, 0);
+
+ CosTrading::Offer* return_value = 0;
+ ACE_TYPENAME Offer_Database::ENTRY* db_entry = 0;
+ CORBA::String_var service_type (type);
+
+ if (this->offer_db_.find (service_type, db_entry) == 0)
+ {
+ Offer_Map_Entry* offer_map_entry = db_entry->int_id_;
+ ACE_READ_GUARD_RETURN (LOCK_TYPE, ace_mon, offer_map_entry->lock_, 0);
+
+ TAO_Offer_Map::ENTRY* offer_entry_ptr = 0;
+ if (offer_map_entry->offer_map_->find (id, offer_entry_ptr) == 0)
+ return_value = offer_entry_ptr->int_id_;
+ }
+
+ return return_value;
+}
+
+template <class LOCK_TYPE> TAO_Offer_Id_Iterator*
+TAO_Offer_Database<LOCK_TYPE>::retrieve_all_offer_ids (void)
+{
+ // Fill an TAO_Offer_Id_Iterator with the offer_ids of all offers
+ // exported to the TAO_Offer_Database. Iterates through the entire
+ // map, cramming offer_id strings into a newly constructed
+ // TAO_Offer_Id_Iterator.
+ TAO_Offer_Id_Iterator* id_iterator;
+ ACE_NEW_RETURN (id_iterator,
+ TAO_Offer_Id_Iterator (),
+ 0);
+ ACE_READ_GUARD_RETURN (LOCK_TYPE, ace_mon, this->db_lock_, 0);
+
+ for (ACE_TYPENAME Offer_Database::iterator type_iter (this->offer_db_);
+ ! type_iter.done ();
+ type_iter++)
+ {
+ const char* type_name = (*type_iter).ext_id_.in ();
+ Offer_Map_Entry* offer_map_entry = (*type_iter).int_id_;
+
+ ACE_READ_GUARD_RETURN (LOCK_TYPE, ace_mon, offer_map_entry->lock_, 0);
+
+ for (TAO_Offer_Map::iterator offer_iter (*offer_map_entry->offer_map_);
+ ! offer_iter.done ();
+ offer_iter++)
+ {
+ CORBA::ULong offer_index = (*offer_iter).ext_id_;
+ CosTrading::OfferId offer_id =
+ this->generate_offer_id (type_name, offer_index);
+
+ id_iterator->insert_id (offer_id);
+ }
+ }
+
+ return id_iterator;
+}
+
+template <class LOCK_TYPE> void
+TAO_Offer_Database<LOCK_TYPE>::
+parse_offer_id (const CosTrading::OfferId offer_id,
+ char*&service_type,
+ CORBA::ULong& id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalOfferId))
+{
+ // Get service type: it is everything from 17th character to the end.
+ service_type = (char *) offer_id + 16;
+
+ // Get id: temporarily put the end of string character where the service
+ // type starts, convert to number, replace the character back.
+ char* start_of_type = (char *) (offer_id + 16);
+ char temp = *start_of_type;
+ *start_of_type = '\0';
+ id = ACE_OS::atoi (offer_id);
+
+ *start_of_type = temp;
+
+ if (! TAO_Trader_Base::is_valid_identifier_name (service_type))
+ ACE_THROW (CosTrading::IllegalOfferId (offer_id));
+}
+
+template <class LOCK_TYPE> CosTrading::OfferId
+TAO_Offer_Database<LOCK_TYPE>::
+generate_offer_id (const char *service_type_name, CORBA::ULong id)
+{
+ // holds final id string.
+ size_t total_size = 16 + ACE_OS::strlen (service_type_name);
+
+ // hold portions of id string.
+ CosTrading::OfferId offer_id =
+ CORBA::string_alloc (static_cast<CORBA::ULong> (total_size));
+ char* return_value = 0;
+ ACE_OS::sprintf (offer_id, "%016u%s", id, service_type_name);
+
+ return_value = CORBA::string_dup (offer_id);
+ delete [] offer_id;
+
+ return return_value;
+}
+
+
+template <class LOCK_TYPE>
+TAO_Service_Offer_Iterator<LOCK_TYPE>::
+TAO_Service_Offer_Iterator (const char* type,
+ TAO_Offer_Database<LOCK_TYPE>& offer_database)
+ : stm_ (offer_database),
+ lock_ (0),
+ offer_iter_ (0),
+ type_ (type)
+{
+ CORBA::String_var service_type (type);
+
+ if (this->stm_.db_lock_.acquire_read () == -1)
+ return;
+
+ ACE_TYPENAME TAO_Offer_Database<LOCK_TYPE>::Offer_Map_Entry* entry = 0;
+ if (this->stm_.offer_db_.find (service_type, entry) == -1)
+ return;
+ else
+ {
+ this->lock_ = &entry->lock_;
+ if (this->lock_->acquire_read () == -1)
+ return;
+
+ ACE_NEW (offer_iter_,
+ TAO_Offer_Map::iterator (*entry->offer_map_));
+ }
+}
+
+template <class LOCK_TYPE>
+TAO_Service_Offer_Iterator<LOCK_TYPE>::~TAO_Service_Offer_Iterator (void)
+{
+ this->stm_.db_lock_.release ();
+
+ if (this->lock_ != 0)
+ {
+ this->lock_->release ();
+ delete this->offer_iter_;
+ }
+}
+
+template <class LOCK_TYPE> CosTrading::OfferId
+TAO_Service_Offer_Iterator<LOCK_TYPE>::get_id (void)
+{
+ return (this->offer_iter_ != 0)
+ ? TAO_Offer_Database<LOCK_TYPE>::generate_offer_id (this->type_, (**this->offer_iter_).ext_id_)
+ : 0;
+}
+
+template <class LOCK_TYPE> int
+TAO_Service_Offer_Iterator<LOCK_TYPE>::has_more_offers (void)
+{
+ return (this->offer_iter_ != 0) ? ! this->offer_iter_->done () : 0;
+}
+
+
+template <class LOCK_TYPE> CosTrading::Offer*
+TAO_Service_Offer_Iterator<LOCK_TYPE>::get_offer (void)
+{
+ return (this->offer_iter_ != 0) ? (**this->offer_iter_).int_id_ : 0;
+}
+
+template <class LOCK_TYPE> void
+TAO_Service_Offer_Iterator<LOCK_TYPE>::next_offer (void)
+{
+ if (this->offer_iter_ != 0)
+ this->offer_iter_->advance ();
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_OFFER_DATABASE_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Offer_Database.h b/TAO/orbsvcs/orbsvcs/Trader/Offer_Database.h
new file mode 100644
index 00000000000..3087ea49d94
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Offer_Database.h
@@ -0,0 +1,211 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Offer_Database.h
+ *
+ * $Id$
+ *
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_OFFER_DATABASE_H
+#define TAO_OFFER_DATABASE_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Trader/Trader.h"
+#include "orbsvcs/Trader/Offer_Iterators.h"
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class LOCK_TYPE> class TAO_Service_Offer_Iterator;
+
+/**
+ * @class TAO_Offer_Database
+ *
+ * The TAO_Offer_Database encapsulates the mapping of service
+ * types to those offers exported with that service types. The
+ * underlying structure is a map of maps. The first maps maps the
+ * service type name to a map of exported offers. The second map
+ * maps the identifying index for that offer within the service
+ * types. So a service type name and an index uniquely identifies an
+ * exported offer. In fact, when the register export interface
+ * returns a CosTrading::OfferId, it's returning no more than a
+ * simple string concatenation of these two values. In addition to
+ * all these wonderful things, the TAO_Offer_Database has built-in
+ * locking, one reader/writer-style lock for modifying the top-level
+ * map and a reader/writer-style for each of the offer
+ * maps. Needless to say the locks are acquired when the
+ * TAO_Offer_Database performs operations on the structures they
+ * guard.
+ * NOTE: TAO_Offer_Database needs to be parameterized by a
+ * READER/WRITER LOCK, a RECURSIVE MUTEX, or a NULL MUTEX, not a
+ * simple binary mutex! Mutexes will cause deadlock when you try to
+ * contruct an iterator (which acquires a read lock on the map under
+ * an existing read lock). Just don't do it, ok?
+ */
+template <class LOCK_TYPE>
+class TAO_Offer_Database
+{
+ friend class TAO_Service_Offer_Iterator<LOCK_TYPE>;
+public:
+
+ // Traits
+ typedef TAO_Service_Offer_Iterator<LOCK_TYPE> offer_iterator;
+
+ /// No arg constructor.
+ TAO_Offer_Database (void);
+
+ ~TAO_Offer_Database (void);
+
+ /// Add an offer of type <type> and generate a CosTrading::OfferId
+ /// for it. Returns 0 on failure.
+ CosTrading::OfferId insert_offer (const char* type,
+ CosTrading::Offer* offer);
+
+ int remove_offer (const CosTrading::OfferId offer_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId));
+
+ /// Lookup an offer whose offer_id is <offer_id>, and return
+ /// it. Otherwise, throw the appropriate exception.
+ CosTrading::Offer* lookup_offer (const CosTrading::OfferId offer_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId));
+
+ /**
+ * Lookup an offer whose OfferId is <offer_id> and return in
+ * <type_name> the type name of the object. Type name is just a
+ * pointer to a location in offer_id, so DON'T DELETE IT.
+ */
+ CosTrading::Offer* lookup_offer (const CosTrading::OfferId offer_id,
+ char*& type_name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId));
+
+ /// Return an iterator that will traverse and return all the offer
+ /// ids in the service type map.
+ TAO_Offer_Id_Iterator* retrieve_all_offer_ids (void);
+
+ struct Offer_Map_Entry
+ {
+ TAO_Offer_Map* offer_map_;
+ CORBA::ULong counter_;
+ LOCK_TYPE lock_;
+ };
+
+ typedef ACE_Hash_Map_Manager_Ex
+ <
+ CORBA::String_var,
+ Offer_Map_Entry*,
+ ACE_Hash<CORBA::String_var>,
+ ACE_Equal_To<CORBA::String_var>,
+ ACE_Null_Mutex
+ >
+ Offer_Database;
+
+private:
+
+ // The internal id is a pointer here, not only to avoid copying,
+ // since we would only copy on insertion, and we only insert once
+ // --- with an empty Offer_Map_Entry --- but also since most locks
+ // have unimplemented copy constructors.
+
+ /// Lookup an offer whose type is <type> and id, <id>. Return 0 on
+ /// failure.
+ CosTrading::Offer* lookup_offer (const char* type,
+ CORBA::ULong id);
+
+ /**
+ * Remove an offers whose id is <offer_id>. Returns 0 on success, -1
+ * on failure, and throws a CosTrading::IllegalOfferId if it can't
+ * parse the CosTrading::OfferId.
+ */
+ int remove_offer (const char* type, CORBA::ULong id);
+
+ /// Take in a service type name for the offer the current value of
+ /// of the counter and generate an offer id.
+ static CosTrading::OfferId generate_offer_id (const char *type_name,
+ CORBA::ULong id);
+
+ /// Take in a previously generated offer id and return the type
+ /// and id that were used to generate the offer id.
+ static void parse_offer_id (const CosTrading::OfferId offer_id,
+ char* &service_type,
+ CORBA::ULong& id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalOfferId));
+
+ // = Disallow these operations.
+ ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_Offer_Database<LOCK_TYPE> &))
+ ACE_UNIMPLEMENTED_FUNC (TAO_Offer_Database (const TAO_Offer_Database<LOCK_TYPE> &))
+
+ LOCK_TYPE db_lock_;
+
+ Offer_Database offer_db_;
+ // The protected data structure.
+};
+
+/**
+ * @class TAO_Service_Offer_Iterator
+ *
+ * @brief TAO_Service_Offer_Iterator iterates over the set of exported
+ * offers for a given type. Handily, it takes care of all the
+ * necessary locking, acquiring them in the constructor, and
+ * releasing them in the destructor.
+ */
+template <class LOCK_TYPE>
+class TAO_Service_Offer_Iterator
+{
+ public:
+
+ typedef TAO_Offer_Database<LOCK_TYPE> Offer_Database;
+
+ TAO_Service_Offer_Iterator (const char* type,
+ TAO_Offer_Database<LOCK_TYPE>& offer_database);
+
+ /// Release all the locks acquired.
+ ~TAO_Service_Offer_Iterator (void);
+
+ /// Returns 1 if there are more offers, 0 otherwise.
+ int has_more_offers (void);
+
+ /// Get the id for the current offer.
+ CosTrading::OfferId get_id (void);
+
+ /// Returns the next offer in the series.
+ CosTrading::Offer* get_offer (void);
+
+ /// Advances the iterator 1.
+ void next_offer (void);
+
+ private:
+ // Protected constructor.
+
+ /// Lock the top_level map.
+ TAO_Offer_Database<LOCK_TYPE>& stm_;
+
+ /// Lock for the internal map.
+ LOCK_TYPE* lock_;
+
+ /// Iterator over the actual offer map.
+ TAO_Offer_Map::iterator* offer_iter_;
+
+ /// The name of the type. Used for constructing offer ids.
+ const char* type_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Trader/Offer_Database.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_SERVICE_TYPE_MAP_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators.cpp b/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators.cpp
new file mode 100644
index 00000000000..da8ad797031
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators.cpp
@@ -0,0 +1,322 @@
+// $Id$
+
+#include "orbsvcs/Trader/Offer_Iterators.h"
+
+ACE_RCSID(Trader, Offer_Iterators, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Offer_Iterator::TAO_Offer_Iterator (const TAO_Property_Filter& pfilter)
+ : pfilter_ (pfilter)
+{
+}
+
+TAO_Offer_Iterator::~TAO_Offer_Iterator (void)
+{
+}
+
+void
+TAO_Offer_Iterator::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Remove self from POA
+
+ 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;
+}
+
+TAO_Query_Only_Offer_Iterator::
+TAO_Query_Only_Offer_Iterator(const TAO_Property_Filter& pfilter)
+ : TAO_Offer_Iterator (pfilter)
+{
+}
+
+TAO_Query_Only_Offer_Iterator::~TAO_Query_Only_Offer_Iterator(void)
+{
+}
+
+void
+TAO_Query_Only_Offer_Iterator::add_offer (CosTrading::OfferId offer_id,
+ const CosTrading::Offer* offer)
+{
+ this->offers_.enqueue_tail ((CosTrading::Offer*) offer);
+ CORBA::string_free (offer_id);
+}
+
+CORBA::ULong
+TAO_Query_Only_Offer_Iterator::max_left (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((CORBA::SystemException,
+ CosTrading::UnknownMaxLeft))
+{
+ return static_cast<CORBA::ULong> (this->offers_.size ());
+}
+
+CORBA::Boolean
+TAO_Query_Only_Offer_Iterator::next_n (CORBA::ULong n,
+ CosTrading::OfferSeq_out offers
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ offers = new CosTrading::OfferSeq;
+
+ CORBA::ULong sequence_size = static_cast<CORBA::ULong> (this->offers_.size ());
+ CORBA::ULong offers_in_sequence = (n < sequence_size) ? n : sequence_size;
+ offers->length (offers_in_sequence);
+
+ // populate the sequence.
+ for (CORBA::ULong i = 0; i < offers_in_sequence; i++)
+ {
+
+ CosTrading::Offer *source = 0;
+ this->offers_.dequeue_head (source);
+ this->pfilter_.filter_offer (source, offers[i]);
+ }
+
+ return offers_in_sequence != 0;
+}
+
+TAO_Offer_Iterator_Collection::TAO_Offer_Iterator_Collection (void)
+{
+}
+
+TAO_Offer_Iterator_Collection::~TAO_Offer_Iterator_Collection (void)
+{
+ while (! this->iters_.is_empty ())
+ {
+ CosTrading::OfferIterator* offer_iter = 0;
+ this->iters_.dequeue_head (offer_iter);
+
+ ACE_TRY_NEW_ENV
+ {
+ offer_iter->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::release (offer_iter);
+ }
+ ACE_CATCHANY
+ {
+ // Don't let the exceptions propagate since we're in a
+ // destructor!
+ }
+ ACE_ENDTRY;
+ }
+}
+
+void
+TAO_Offer_Iterator_Collection::
+add_offer_iterator (CosTrading::OfferIterator_ptr offer_iter)
+{
+ if (! CORBA::is_nil (offer_iter))
+ this->iters_.enqueue_tail (offer_iter);
+}
+
+CORBA::Boolean
+TAO_Offer_Iterator_Collection::next_n (CORBA::ULong n,
+ CosTrading::OfferSeq_out offers
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong offers_left = n;
+ CORBA::Boolean return_value = 1;
+ CosTrading::OfferSeq_var out_offers;
+
+ ACE_NEW_THROW_EX (offers,
+ CosTrading::OfferSeq,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (return_value);
+
+ while (offers_left > 0 && ! this->iters_.is_empty ())
+ {
+ CORBA::ULong offset = 0;
+ CORBA::Boolean any_left = 0;
+ CosTrading::OfferIterator* iter = 0;
+ this->iters_.dequeue_head (iter);
+
+ // Determine how many offers we should retrieve from this
+ // iterator.
+
+ // Retrieve the set of offers.
+ any_left =
+ iter->next_n (offers_left,
+ CosTrading::OfferSeq_out (out_offers.out ())
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (return_value);
+
+ // If we've exhausted this iterator, destroy it.
+ if (any_left == 0)
+ {
+ iter->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (return_value);
+ CORBA::release (iter);
+ }
+ else
+ this->iters_.enqueue_head (iter);
+
+ // Merge it with the passed set.
+ offset = offers->length ();
+ offers->length (out_offers->length () + offset);
+ for (CORBA::ULong j = out_offers->length (); j > 0; j--)
+ offers[j + offset - 1] = out_offers[j - 1];
+
+ offers_left -= out_offers->length ();
+ }
+
+ // Determine if we have anything left to offer.
+ if (this->iters_.is_empty ())
+ return_value = 0;
+
+ return return_value;
+}
+
+void
+TAO_Offer_Iterator_Collection::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Destroy all iterators in the collection.
+ for (Offer_Iters::ITERATOR iters_iter (this->iters_);
+ ! iters_iter.done ();
+ iters_iter.advance ())
+ {
+ CosTrading::OfferIterator** iter = 0;
+
+ iters_iter.next (iter);
+ (*iter)->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // Remove self from POA
+
+ 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;
+}
+
+CORBA::ULong
+TAO_Offer_Iterator_Collection::max_left (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::UnknownMaxLeft))
+{
+ ACE_THROW_RETURN (CosTrading::UnknownMaxLeft(),
+ 0);
+}
+
+TAO_Offer_Id_Iterator::TAO_Offer_Id_Iterator (void)
+{
+}
+
+TAO_Offer_Id_Iterator::~TAO_Offer_Id_Iterator (void)
+{
+ int return_value = 0;
+
+ do
+ {
+ CosTrading::OfferId offer_id = 0;
+
+ return_value = this->ids_.dequeue_head (offer_id);
+ if (return_value == 0)
+ CORBA::string_free (offer_id);
+ }
+ while (return_value == 0);
+}
+
+CORBA::ULong
+TAO_Offer_Id_Iterator::max_left (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::UnknownMaxLeft))
+{
+ return static_cast<CORBA::ULong> (this->ids_.size ());
+}
+
+void
+TAO_Offer_Id_Iterator::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Remove self from POA
+
+ 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;
+}
+
+CORBA::Boolean
+TAO_Offer_Id_Iterator::next_n (CORBA::ULong n,
+ CosTrading::OfferIdSeq_out _ids
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Calculate the number of Ids to be returned in this.
+ CORBA::ULong items_left = static_cast<CORBA::ULong> (this->ids_.size());
+ int difference = items_left - n;
+ CORBA::ULong returnable_items = (difference >= 0) ? n : items_left;
+ CORBA::Boolean return_value = (CORBA::Boolean) (difference > 0);
+
+ if (returnable_items == 0)
+ ACE_NEW_RETURN (_ids,
+ CosTrading::OfferIdSeq,
+ return_value);
+ else
+ {
+ // Allocate space for the returned OfferIds.
+ CosTrading::OfferId* id_buf =
+ CosTrading::OfferIdSeq::allocbuf (returnable_items);
+
+ if (id_buf != 0)
+ {
+ // Copy in those ids!
+ for (CORBA::ULong i = 0; i < returnable_items; i++)
+ {
+ CosTrading::OfferId offer_id = 0;
+
+ this->ids_.dequeue_head (offer_id);
+ id_buf[i] = offer_id;
+ }
+
+ // Place them into an OfferIdSeq.
+ ACE_NEW_RETURN (_ids,
+ CosTrading::OfferIdSeq (returnable_items,
+ returnable_items,
+ id_buf,
+ 1),
+ return_value);
+ }
+ else
+ ACE_NEW_RETURN (_ids,
+ CosTrading::OfferIdSeq,
+ return_value);
+ }
+
+ // Return true only if there are items left to be returned in
+ // subsequent calls.
+ return return_value;
+}
+
+void
+TAO_Offer_Id_Iterator::insert_id (CosTrading::OfferId new_id)
+{
+ this->ids_.enqueue_tail (new_id);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators.h b/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators.h
new file mode 100644
index 00000000000..247664b6f77
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators.h
@@ -0,0 +1,298 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Offer_Iterators.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_OFFER_ITERATORS_H
+#define TAO_OFFER_ITERATORS_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Trader/Trader_Utils.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ // *************************************************************
+ // TAO_Offer_Iterator
+ // *************************************************************
+
+class TAO_Offer_Iterator
+ : public virtual POA_CosTrading::OfferIterator
+{
+ // = TITLE
+ // This class implements CosTrading::OfferIterator IDL
+ // interface.
+
+ // = DESCRIPTION
+ // This is an abstract base class to allow for different
+ // implementations of OfferIterator.
+ // BEGIN SPEC
+ // The OfferIterator interface is used to return a set of service
+ // offers from the query operation by enabling the service offers
+ // to be extracted by successive operations on the OfferIterator
+ // interface.
+ // END SPEC
+public:
+ // = Initialization and termination methods.
+
+ TAO_Offer_Iterator (const TAO_Property_Filter& property_filter);
+
+ virtual ~TAO_Offer_Iterator (void);
+
+ /**
+ * BEGIN SPEC
+ * The destroy operation destroys the iterator. No further
+ * operations can be invoked on an iterator after it has been
+ * destroyed.
+ * END SPEC
+ */
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Add an offer to the collection of offers the iterator will
+ /// iterate over.
+ virtual void add_offer (CosTrading::OfferId offer_id,
+ const CosTrading::Offer* offer) = 0;
+
+ virtual CORBA::ULong max_left (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::UnknownMaxLeft)) = 0;
+
+ // BEGIN SPEC
+ // The max_left operation returns the number of service offers
+ // remaining in the iterator. The exception UnknownMaxLeft is raised
+ // if the iterator cannot determine the remaining number of service
+ // offers (e.g., if the iterator determines its set of service
+ // offers through lazy evaluation).
+ // END SPEC
+
+ /**
+ * BEGIN SPEC
+ * The next_n operation returns a set of service offers in the
+ * output parameter "offers." The operation returns n service offers
+ * if there are at least n service offers remaining in the
+ * iterator. If there are fewer than n service offers in the
+ * iterator, then all remaining service offers are returned. The
+ * actual number of service offers returned can be determined from
+ * the length of the "offers" sequence. The next_n operation returns
+ * TRUE if there are further service offers to be extracted from the
+ * iterator. It returns FALSE if there are no further service offers
+ * to be extracted.
+ * END SPEC
+ */
+ virtual CORBA::Boolean next_n (CORBA::ULong n,
+ CosTrading::OfferSeq_out offers
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
+ protected:
+
+ TAO_Offer_Iterator& operator=(const TAO_Offer_Iterator&);
+
+ /// The filter through which each returned offer must pass. Used to
+ /// strip offers of undesirable properties.
+ TAO_Property_Filter pfilter_;
+};
+
+ // *************************************************************
+ // TAO_Query_Only_Offer_Iterator
+ // *************************************************************
+
+class TAO_Query_Only_Offer_Iterator
+ : public TAO_Offer_Iterator
+ // = TITLE
+ // An implementation of the CosTrading::OfferIterator IDL
+ // interface that takes advantage of the fact that the trader is
+ // Query Only, and therefore its service offers are not being
+ // changed or removed.
+ //
+ // = DESCRIPTION
+ // The iterator stores pointers to Offers to be iterated over,
+ // and later accesses the Offers directly through the pointers.
+ //
+{
+public:
+ // = Initialization and termination methods.
+
+ TAO_Query_Only_Offer_Iterator (const TAO_Property_Filter& pfilter);
+
+ virtual ~TAO_Query_Only_Offer_Iterator (void);
+
+ /// Deposit at maximum n offers into the return sequence and return 1,
+ /// or return 0 if the iterator is done and no offers are returned.
+ virtual CORBA::Boolean next_n (CORBA::ULong n,
+ CosTrading::OfferSeq_out offers
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the number of items left in the iterator.
+ virtual CORBA::ULong max_left (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::UnknownMaxLeft));
+
+ /// Add an offer the iterator should iterate over.
+ void add_offer (CosTrading::OfferId offer_id,
+ const CosTrading::Offer* offer);
+
+private:
+
+ TAO_Query_Only_Offer_Iterator (const TAO_Query_Only_Offer_Iterator&);
+ TAO_Query_Only_Offer_Iterator& operator=(const TAO_Query_Only_Offer_Iterator&);
+
+ /// Structure that stores pointers to offers
+ /// to iterate over.
+ ACE_Unbounded_Queue <CosTrading::Offer *> offers_;
+};
+
+ // *************************************************************
+ // TAO_Offer_Iterator_Collection
+ // *************************************************************
+
+class TAO_Offer_Iterator_Collection :
+ public virtual POA_CosTrading::OfferIterator
+// = TITLE
+// A collection of offer iterator to query in turn.
+//
+// = DESCRIPTION
+// Since a query could conceivable query several other traders, it
+// needs a way to merge the results into a single set of results
+// suitable for being returned to the user. And since all the query
+// method can return to the user is a sequence and an iterator, and
+// the size of the sequence is constrained, there needs to be some
+// way to collect all the returned offer_iterators into a single
+// offer_iterator. This is that collection. The results of
+// collecting all the iterators in this way is a distributed tree of
+// iterators, which could conceivably become hugely inefficient if
+// the trader graph is deep enough.
+{
+public:
+
+ // = Constructors.
+
+ TAO_Offer_Iterator_Collection (void);
+
+ virtual ~TAO_Offer_Iterator_Collection (void);
+
+ /// Retrieve n offers from the set of iterators.
+ virtual CORBA::Boolean next_n (CORBA::ULong n,
+ CosTrading::OfferSeq_out offers
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Destroy the collection of iterators.
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Determine how many offers are left in the collection.
+ virtual CORBA::ULong max_left (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::UnknownMaxLeft));
+
+ /// Add an iterator to the collection.
+ void add_offer_iterator (CosTrading::OfferIterator_ptr offer_iter);
+
+private:
+
+ TAO_Offer_Iterator_Collection (const TAO_Offer_Iterator_Collection&);
+ TAO_Offer_Iterator_Collection& operator= (const TAO_Offer_Iterator_Collection&);
+
+ typedef ACE_Unbounded_Queue <CosTrading::OfferIterator*> Offer_Iters;
+
+ /// The iterator collection.
+ Offer_Iters iters_;
+};
+
+ // *************************************************************
+ // TAO_Offer_Id_Iterator
+ // *************************************************************
+
+class TAO_Offer_Id_Iterator :
+ public virtual POA_CosTrading::OfferIdIterator
+// = TITLE
+// Silly little iterator that contains the overflow of offer ids
+// from the Admin list_offers method.
+//
+// = DESCRIPTION
+//
+// BEGIN SPEC
+// The OfferIdIterator interface is used to return a set of offer
+// identifiers from the list_offers operation and the list_proxies
+// operation in the Admin interface by enabling the offer identifiers
+// to be extracted by successive operations on the OfferIdIterator
+// interface.
+// END SPEC
+{
+ public:
+
+ /// No op constructor
+ TAO_Offer_Id_Iterator(void);
+
+ ~TAO_Offer_Id_Iterator (void);
+
+ /**
+ * The max_left operation returns the number of offer identifiers
+ * remaining in the iterator. The exception UnknownMaxLeft is raised
+ * if the iterator cannot determine the remaining number of offer
+ * identifiers (e.g., if the iterator determines its set of offer
+ * identifiers through lazy evaluation).
+ */
+ virtual CORBA::ULong max_left(ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::UnknownMaxLeft));
+
+ /**
+ * The destroy operation destroys the iterator. No further
+ * operations can be invoked on an iterator after it has been
+ * destroyed.
+ */
+ virtual void destroy(ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * The next_n operation returns a set of offer identifiers in the
+ * output parameter "ids." The operation returns n offer identifiers
+ * if there are at least n offer identifiers remaining in the
+ * iterator. If there are fewer than n offer identifiers in the
+ * iterator, then all remaining offer identifiers are returned. The
+ * actual number of offer identifiers returned can be determined
+ * from the length of the "ids" sequence. The next_n operation
+ * returns TRUE if there are further offer identifiers to be
+ * extracted from the iterator. It returns FALSE if there are no
+ * further offer identifiers to be extracted.
+ */
+ virtual CORBA::Boolean next_n(CORBA::ULong _n,
+ CosTrading::OfferIdSeq_out _ids
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Insert a <new_id> into the contents of the iterator.
+ void insert_id(CosTrading::OfferId new_id);
+
+ private:
+
+ TAO_Offer_Id_Iterator (const TAO_Offer_Id_Iterator&);
+ TAO_Offer_Id_Iterator& operator= (TAO_Offer_Id_Iterator&);
+
+ TAO_String_Queue ids_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_OFFER_ITERATOR */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators_T.cpp b/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators_T.cpp
new file mode 100644
index 00000000000..f8ad8bd3a6f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators_T.cpp
@@ -0,0 +1,97 @@
+// $Id$
+
+#ifndef TAO_OFFER_ITERATORS_T_CPP
+#define TAO_OFFER_ITERATORS_T_CPP
+
+#include "orbsvcs/Trader/Offer_Iterators_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class MAP_LOCK_TYPE>
+TAO_Register_Offer_Iterator<MAP_LOCK_TYPE>::
+TAO_Register_Offer_Iterator (TAO_Offer_Database<MAP_LOCK_TYPE> &db,
+ const TAO_Property_Filter& pfilter)
+ : TAO_Offer_Iterator (pfilter),
+ db_ (db)
+{
+}
+
+template <class MAP_LOCK_TYPE>
+TAO_Register_Offer_Iterator<MAP_LOCK_TYPE>::
+~TAO_Register_Offer_Iterator (void)
+{
+ while (! this->offer_ids_.is_empty ())
+ {
+ CosTrading::OfferId offer_id = 0;
+ this->offer_ids_.dequeue_head (offer_id);
+
+ CORBA::string_free (offer_id);
+ }
+}
+
+template <class MAP_LOCK_TYPE> void
+TAO_Register_Offer_Iterator<MAP_LOCK_TYPE>::
+add_offer (CosTrading::OfferId id,
+ const CosTrading::Offer* /* offer */)
+{
+ this->offer_ids_.enqueue_tail (id);
+}
+
+template <class MAP_LOCK_TYPE> CORBA::ULong
+TAO_Register_Offer_Iterator<MAP_LOCK_TYPE>::
+max_left (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::UnknownMaxLeft))
+{
+ return static_cast<CORBA::ULong> (this->offer_ids_.size ());
+}
+
+template <class MAP_LOCK_TYPE> CORBA::Boolean
+TAO_Register_Offer_Iterator<MAP_LOCK_TYPE>::
+next_n (CORBA::ULong n,
+ CosTrading::OfferSeq_out offers
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong ret_offers = 0;
+
+ CORBA::ULong max_possible_offers_in_sequence =
+ (n < this->offer_ids_.size ()) ? n :
+ static_cast<CORBA::ULong> (this->offer_ids_.size ());
+
+ ACE_NEW_THROW_EX (offers,
+ CosTrading::OfferSeq,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ offers->length (max_possible_offers_in_sequence);
+
+ // While there are entries left and we haven't filled <offers>
+ // with requested number.
+ while (! this->offer_ids_.is_empty ()
+ && n > ret_offers)
+ {
+ // If offer is found, put it into the sequence.
+ // remove this id irrespective of whether the offer is found
+ // or not.
+ CosTrading::OfferId id = 0;
+ this->offer_ids_.dequeue_head (id);
+
+ CosTrading::OfferId_var offerid_var (id);
+ CosTrading::Offer* offer = this->db_.lookup_offer (id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (offer != 0)
+ this->pfilter_.filter_offer (offer,
+ offers[ret_offers++]);
+ }
+
+ // Reset the length to the correct value
+ offers->length (ret_offers);
+
+ return static_cast<CORBA::Boolean> (ret_offers != 0);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_REGISTER_OFFER_ITERATOR_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators_T.h b/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators_T.h
new file mode 100644
index 00000000000..8aa992e9add
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Offer_Iterators_T.h
@@ -0,0 +1,96 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Offer_Iterators_T.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_REGISTER_OFFER_ITERATOR_H
+#define TAO_REGISTER_OFFER_ITERATOR_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Trader/Offer_Iterators.h"
+#include "orbsvcs/Trader/Offer_Database.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Register_Offer_Iterator
+ *
+ * @brief An implementation of CosTrading::OfferIterator IDL interface
+ * appropriate when trader has Register functionality.
+ *
+ * Stores ids of offers to be iterated over. Before returning
+ * an offer, checks if the offer is still there (since it may
+ * have been removed by the Register).
+ */
+template <class MAP_LOCK_TYPE>
+class TAO_Register_Offer_Iterator : public TAO_Offer_Iterator
+{
+public:
+
+ // = Initialization and termination methods.
+
+ /// Takes service type and trader reference in order to
+ /// later locate offers using their ids.
+ TAO_Register_Offer_Iterator (TAO_Offer_Database<MAP_LOCK_TYPE> &db,
+ const TAO_Property_Filter& pfilter);
+
+ /// Destructor.
+ virtual ~TAO_Register_Offer_Iterator (void);
+
+ /// Deposit at maximum n offers into the return sequence and return 1,
+ /// or return 0 if the iterator is done and no offers are returned.
+ virtual CORBA::Boolean next_n (CORBA::ULong n,
+ CosTrading::OfferSeq_out offers
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * Throws CosTrading::UnknownMaxLeft since with the presence of
+ * "Register" functionality, the iterator cannot guarantee that
+ * the trader will have all the offers it has now when the time
+ * to return them comes.
+ */
+ virtual CORBA::ULong max_left (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::UnknownMaxLeft));
+
+ /// Add an offer the iterator should iterate over.
+ void add_offer (CosTrading::OfferId id,
+ const CosTrading::Offer *);
+
+private:
+
+ /// A reference to the trader is needed for access to the map of offers.
+ TAO_Offer_Database<MAP_LOCK_TYPE> &db_;
+
+ /// Offer ids of offers to iterate over.
+ TAO_String_Queue offer_ids_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Trader/Offer_Iterators_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_REGISTER_OFFER_ITERATOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Service_Type_Repository.cpp b/TAO/orbsvcs/orbsvcs/Trader/Service_Type_Repository.cpp
new file mode 100644
index 00000000000..106cc5e3045
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Service_Type_Repository.cpp
@@ -0,0 +1,695 @@
+// $Id$
+
+#include "orbsvcs/Trader/Service_Type_Repository.h"
+
+#include "ace/Lock_Adapter_T.h"
+
+
+ACE_RCSID (Trader,
+ Service_Type_Repository,
+ "$Id$")
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Service_Type_Repository::
+TAO_Service_Type_Repository (ACE_Lock* lock)
+ : lock_ (lock)
+{
+ this->incarnation_.low = 0;
+ this->incarnation_.high = 0;
+
+ // If a lock wasn't provided, let's assume the user doesn't want any
+ // kind of lock at all.
+ if (this->lock_ == 0)
+ ACE_NEW (this->lock_,
+ ACE_Lock_Adapter<ACE_Null_Mutex>);
+}
+
+TAO_Service_Type_Repository::~TAO_Service_Type_Repository (void)
+{
+ {
+ // Make sure not to throw exceptions in destructors...
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, *this->lock_);
+
+ for (Service_Type_Map_Iterator service_map_iterator (this->type_map_);
+ service_map_iterator.done () == 0;
+ service_map_iterator++)
+ {
+ Type_Info *type_info = (*service_map_iterator).int_id_;
+ delete type_info;
+ }
+ }
+
+ delete this->lock_;
+}
+
+CosTradingRepos::ServiceTypeRepository::IncarnationNumber
+TAO_Service_Type_Repository::incarnation (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosTradingRepos::ServiceTypeRepository::IncarnationNumber inc_num;
+
+ if (this->lock_->acquire_read () == -1)
+ {
+ inc_num = this->incarnation_;
+ this->lock_->release ();
+ }
+ else
+ {
+ inc_num.high = 0;
+ inc_num.low = 0;
+ }
+
+ return inc_num;
+}
+
+
+CosTradingRepos::ServiceTypeRepository::IncarnationNumber
+TAO_Service_Type_Repository::
+add_type (const char *name,
+ const char *if_name,
+ const CosTradingRepos::ServiceTypeRepository::PropStructSeq &props,
+ const CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq &super_types
+ 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))
+{
+ Prop_Map prop_map;
+ Service_Type_Map super_map;
+ CosTradingRepos::ServiceTypeRepository::IncarnationNumber inc_num;
+
+ inc_num.low = 0;
+ inc_num.high = 0;
+
+ // With exceptions enabled, inc_num isn't used.
+ ACE_UNUSED_ARG (inc_num);
+
+ ACE_WRITE_GUARD_THROW_EX (ACE_Lock, ace_mon, *this->lock_, CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (inc_num);
+
+ // Make sure Type name is valid.
+ if (TAO_Trader_Base::is_valid_identifier_name (name) == 0)
+ ACE_THROW_RETURN (CosTrading::IllegalServiceType (name),
+ this->incarnation_);
+
+ // Check if the service type already exists.
+ CORBA::String_var type_name (name);
+ if (this->type_map_.find (type_name) == 0)
+ ACE_THROW_RETURN (CosTradingRepos::ServiceTypeRepository::ServiceTypeExists (),
+ this->incarnation_);
+
+ // Make sure all property names are valid and appear only once.
+ this->validate_properties (prop_map,
+ props
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (this->incarnation_);
+
+ // Check that all super_types exist, and none are duplicated.
+ this->validate_supertypes (super_map,
+ super_types
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (this->incarnation_);
+
+ // NOTE: I don't really know a way to do this without an Interface
+ // Repository, since the Interface Repository IDs don't contain
+ // information about supertypes.
+ //
+ // make sure interface name is legal.
+ // this->validate_interface (if_name, super_types ACE_ENV_ARG_PARAMETER);
+ // ACE_CHECK_RETURN (this->incarnation);
+ //
+ // Instead, we do this:
+ //
+ if (if_name == 0)
+ ACE_THROW_RETURN (CosTradingRepos::ServiceTypeRepository::InterfaceTypeMismatch (),
+ this->incarnation_);
+
+ // Collect and make sure that properties of all supertypes and this
+ // type are compatible. We can use prop_map and super_types_map for
+ // the job.
+ this->validate_inheritance (prop_map,
+ super_types
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (this->incarnation_);
+
+ // We can now use prop_map to construct a sequence of all properties
+ // the this type.
+ this->update_type_map (name,
+ if_name,
+ props,
+ super_types,
+ prop_map,
+ super_map);
+
+ CosTradingRepos::ServiceTypeRepository::IncarnationNumber return_value =
+ this->incarnation_;
+
+ // Increment incarnation number.
+ this->incarnation_.low++;
+
+ // If we wrapped around in lows...
+ if (this->incarnation_.low == 0)
+ this->incarnation_.high++;
+
+ return return_value;
+}
+
+void
+TAO_Service_Type_Repository::remove_type (const char *name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::HasSubTypes))
+{
+ if (TAO_Trader_Base::is_valid_identifier_name (name) == 0)
+ ACE_THROW (CosTrading::IllegalServiceType (name));
+
+ ACE_WRITE_GUARD_THROW_EX (ACE_Lock, ace_mon, *this->lock_, CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ // Check if the type exists.
+ Service_Type_Map::ENTRY* type_entry = 0; ;
+ if (this->type_map_.find (name,
+ type_entry) == -1)
+ ACE_THROW (CosTrading::UnknownServiceType (name));
+
+ // Check if it has any subtypes.
+ Type_Info *type_info = type_entry->int_id_;
+ if (type_info->has_subtypes_)
+ ACE_THROW (CosTradingRepos::ServiceTypeRepository::HasSubTypes (name, ""));
+
+ // Remove the type from the map.
+ this->type_map_.unbind (type_entry);
+ delete type_info;
+}
+
+CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq *
+TAO_Service_Type_Repository::
+list_types (const CosTradingRepos::ServiceTypeRepository::SpecifiedServiceTypes &which_types
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_READ_GUARD_THROW_EX (ACE_Lock, ace_mon, *this->lock_, CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ULong i = 0;
+ CORBA::ULong length = static_cast<CORBA::ULong> (this->type_map_.current_size ());
+ CosTrading::ServiceTypeName *types =
+ CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq::allocbuf (length);
+
+ if (types == 0)
+ return 0;
+
+ int all = which_types._d () == CosTradingRepos::ServiceTypeRepository::all;
+
+ CosTradingRepos::ServiceTypeRepository::IncarnationNumber num =
+ which_types.incarnation ();
+
+ for (Service_Type_Map_Iterator itr (this->type_map_);
+ itr.done () == 0;
+ itr++)
+ {
+ Type_Info* type_info = (*itr).int_id_;
+ const char* type_name = (*itr).ext_id_.in ();
+
+ if (all
+ || num < type_info->type_struct_.incarnation)
+ types[i++] = CORBA::string_dup (type_name);
+ }
+
+ CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq *tmp = 0;
+
+ ACE_NEW_RETURN (tmp,
+ CosTradingRepos::ServiceTypeRepository::
+ ServiceTypeNameSeq (length,
+ i,
+ types,
+ 1),
+ 0);
+ return tmp;
+}
+
+CosTradingRepos::ServiceTypeRepository::TypeStruct *
+TAO_Service_Type_Repository::
+describe_type (const char * name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType))
+{
+ if (TAO_Trader_Base::is_valid_identifier_name (name) == 0)
+ ACE_THROW_RETURN
+ (CosTrading::IllegalServiceType (name),
+ (CosTradingRepos::ServiceTypeRepository::TypeStruct *) 0);
+
+ ACE_READ_GUARD_THROW_EX
+ (ACE_Lock,
+ ace_mon,
+ *this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ // Make sure the type exists.
+ CORBA::String_var type_name (name);
+ Service_Type_Map::ENTRY *type_entry = 0;
+ if (this->type_map_.find (type_name,
+ type_entry) == -1)
+ ACE_THROW_RETURN (CosTrading::UnknownServiceType (name),
+ (CosTradingRepos::ServiceTypeRepository::TypeStruct *) 0);
+
+ // Return appropriate information about the type.
+ CosTradingRepos::ServiceTypeRepository::TypeStruct *descr = 0;
+ ACE_NEW_RETURN (descr,
+ CosTradingRepos::ServiceTypeRepository::TypeStruct,
+ 0);
+ CosTradingRepos::ServiceTypeRepository::TypeStruct &s =
+ type_entry->int_id_->type_struct_;
+
+ descr->if_name = s.if_name;
+ descr->masked = s.masked;
+ descr->incarnation = s.incarnation;
+ descr->super_types = s.super_types;
+ descr->props = s.props;
+ /*
+ CORBA::ULong length = s.props.length ();
+ CosTradingRepos::ServiceTypeRepository::PropStruct* pstructs =
+ s.props.get_buffer (0);
+ descr->props.replace (length, length, pstructs, 0);
+ */
+ return descr;
+}
+
+CosTradingRepos::ServiceTypeRepository::TypeStruct *
+TAO_Service_Type_Repository::
+fully_describe_type (const char *name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType))
+{
+ if (TAO_Trader_Base::is_valid_identifier_name (name) == 0)
+ ACE_THROW_RETURN (CosTrading::IllegalServiceType (name),
+ 0);
+
+ ACE_READ_GUARD_THROW_EX (ACE_Lock, ace_mon, *this->lock_, CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ // Make sure the type exists.
+ CORBA::String_var type_name (name);
+ Service_Type_Map::ENTRY *type_entry = 0;
+ if (this->type_map_.find (type_name,
+ type_entry) == -1)
+ ACE_THROW_RETURN (CosTrading::UnknownServiceType (name),
+ 0);
+
+ // Return appropriate information about the type.
+ CosTradingRepos::ServiceTypeRepository::TypeStruct *descr = 0;
+ ACE_NEW_RETURN (descr,
+ CosTradingRepos::ServiceTypeRepository::TypeStruct,
+ 0);
+ CosTradingRepos::ServiceTypeRepository::TypeStruct &s =
+ type_entry->int_id_->type_struct_;
+
+ // Aggregate the Properties of this type and all its supertypes.
+ // Compute the transitive closure of all supertypes.
+ this->fully_describe_type_i (s,
+ descr->props,
+ descr->super_types);
+
+ // We do the explicit copy, since otherwise we'd have excessive
+ // properties copying.
+ descr->if_name = s.if_name;
+ descr->masked = s.masked;
+ descr->incarnation = s.incarnation;
+
+ return descr;
+}
+
+void
+TAO_Service_Type_Repository::
+mask_type (const char *name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::AlreadyMasked))
+{
+ if (TAO_Trader_Base::is_valid_identifier_name (name) == 0)
+ ACE_THROW (CosTrading::IllegalServiceType (name));
+
+ ACE_WRITE_GUARD_THROW_EX (ACE_Lock, ace_mon, *this->lock_, CORBA::INTERNAL ());
+
+ // Make sure the type exists.
+ CORBA::String_var type_name (name);
+ Service_Type_Map::ENTRY *type_entry = 0;
+ if (this->type_map_.find (type_name,
+ type_entry) != -1)
+ ACE_THROW (CosTrading::UnknownServiceType (name));
+
+ // Make sure the type is unmasked.
+ CORBA::Boolean &mask =
+ type_entry->int_id_->type_struct_.masked;
+
+ if (mask == 1)
+ ACE_THROW (CosTradingRepos::ServiceTypeRepository::AlreadyMasked (name));
+ else
+ mask = 1;
+}
+
+void
+TAO_Service_Type_Repository::
+unmask_type (const char *name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::NotMasked))
+{
+ if (TAO_Trader_Base::is_valid_identifier_name (name) == 0)
+ ACE_THROW (CosTrading::IllegalServiceType (name));
+
+ ACE_WRITE_GUARD_THROW_EX (ACE_Lock, ace_mon, *this->lock_, CORBA::INTERNAL ());
+
+ // Make sure the type exists.
+ CORBA::String_var type_name (name);
+ Service_Type_Map::ENTRY *type_entry = 0;
+ if (this->type_map_.find (type_name,
+ type_entry) != -1)
+ ACE_THROW (CosTrading::UnknownServiceType (name));
+
+ // Make sure the type is masked.
+ CORBA::Boolean &mask = type_entry->int_id_->type_struct_.masked;
+
+ if (mask == 0)
+ ACE_THROW (CosTradingRepos::ServiceTypeRepository::NotMasked (name));
+ else
+ mask = 0;
+}
+
+void
+TAO_Service_Type_Repository::
+fully_describe_type_i (const CosTradingRepos::ServiceTypeRepository::TypeStruct &type_struct,
+ CosTradingRepos::ServiceTypeRepository::PropStructSeq &props,
+ CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq &super_types)
+{
+ TAO_String_Queue service_type_queue;
+ this->collect_inheritance_hierarchy (type_struct,
+ service_type_queue);
+
+ // Count the total number of properties.
+ CORBA::ULong num_props = 0;
+ CORBA::ULong num_types = static_cast<CORBA::ULong> (service_type_queue.size ());
+
+ TAO_String_Queue::ITERATOR iterator (service_type_queue);
+
+ for (;
+ iterator.done () == 0;
+ iterator.advance ())
+ {
+ char **next_type_name = 0;
+ Service_Type_Map::ENTRY *type_entry = 0;
+
+ iterator.next (next_type_name);
+ CORBA::String_var hash_key (const_cast<const char *> (*next_type_name));
+ this->type_map_.find (hash_key,
+ type_entry);
+
+ CosTradingRepos::ServiceTypeRepository::TypeStruct &tstruct =
+ type_entry->int_id_->type_struct_;
+ num_props += tstruct.props.length ();
+ }
+
+ num_props += type_struct.props.length ();
+ props.length (num_props);
+ super_types.length (num_types);
+
+ // Copy in all properties.
+ int i = 0;
+ CORBA::ULong prop_index = 0;
+ CORBA::ULong type_index = 0;
+
+ for (i = type_struct.props.length () - 1;
+ i >= 0;
+ i--)
+ props[prop_index++] = type_struct.props[i];
+
+ for (iterator.first ();
+ iterator.done () == 0;
+ iterator.advance ())
+ {
+ char **next_type_name = 0;
+ Service_Type_Map::ENTRY *type_entry = 0;
+
+ iterator.next (next_type_name);
+ CORBA::String_var hash_key (const_cast<const char *> (*next_type_name));
+ this->type_map_.find (hash_key,
+ type_entry);
+
+ // Should never be zero.
+ if (type_entry != 0)
+ {
+ CosTradingRepos::ServiceTypeRepository::TypeStruct& tstruct =
+ type_entry->int_id_->type_struct_;
+
+ for (i = tstruct.props.length () - 1;
+ i >= 0;
+ i--)
+ props[prop_index++] = tstruct.props[i];
+
+ super_types[type_index++] = hash_key.in ();
+ }
+ }
+}
+
+void
+TAO_Service_Type_Repository::
+collect_inheritance_hierarchy (const CosTradingRepos::ServiceTypeRepository::TypeStruct &type_struct,
+ TAO_String_Queue &target)
+{
+ // Recurse for each super_type
+ for (int i = type_struct.super_types.length () - 1;
+ i >= 0;
+ i--)
+ {
+ Service_Type_Map::ENTRY *next_type_entry = 0;
+ CORBA::String_var next_type_name (type_struct.super_types[i]);
+
+ if (this->type_map_.find (next_type_name, next_type_entry) != -1)
+ {
+ CosTradingRepos::ServiceTypeRepository::TypeStruct &next_type_struct =
+ next_type_entry->int_id_->type_struct_;
+
+ const char *type_name =
+ type_struct.super_types[i];
+ target.enqueue_tail (const_cast<char *> (type_name));
+
+ this->collect_inheritance_hierarchy (next_type_struct,
+ target);
+ }
+ }
+}
+
+void
+TAO_Service_Type_Repository::
+validate_properties (Prop_Map &prop_map,
+ const CosTradingRepos::ServiceTypeRepository::PropStructSeq &props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName))
+{
+ for (CORBA::ULong i = 0;
+ i < props.length ();
+ i++)
+ {
+ const char *n = props[i].name;
+ if (TAO_Trader_Base::is_valid_property_name (n) == 0)
+ ACE_THROW (CosTrading::IllegalPropertyName (n));
+ else
+ {
+ CORBA::String_var prop_name (n);
+ CosTradingRepos::ServiceTypeRepository::PropStruct *prop_val =
+ const_cast<CosTradingRepos::ServiceTypeRepository::PropStruct *> (&props[i]);
+
+ if (prop_map.bind (prop_name,
+ prop_val) == 1)
+ ACE_THROW (CosTrading::DuplicatePropertyName (n));
+ }
+ }
+}
+
+void
+TAO_Service_Type_Repository::
+validate_supertypes (Service_Type_Map &super_map,
+ const CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq &super_types
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::DuplicateServiceTypeName))
+{
+ for (CORBA::ULong i = 0;
+ i < super_types.length ();
+ i++)
+ {
+ const char *type =
+ super_types[i];
+
+ if (TAO_Trader_Base::is_valid_identifier_name (type) == 0)
+ ACE_THROW (CosTrading::IllegalServiceType (type));
+ else
+ {
+ CORBA::String_var hash_type (type);
+ Service_Type_Map::ENTRY *type_entry = 0;
+
+ if (this->type_map_.find (hash_type,
+ type_entry) == -1)
+ ACE_THROW (CosTrading::UnknownServiceType (type));
+ else
+ {
+ if (super_map.bind (hash_type,
+ type_entry->int_id_) == 1)
+ ACE_THROW (CosTradingRepos::ServiceTypeRepository::DuplicateServiceTypeName (type));
+ }
+ }
+ }
+}
+
+void
+TAO_Service_Type_Repository::
+validate_inheritance (Prop_Map &prop_map,
+ const CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq &super_types
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTradingRepos::ServiceTypeRepository::ValueTypeRedefinition))
+{
+ CORBA::ULong num_super_types = super_types.length ();
+
+ for (CORBA::ULong i = 0;
+ i < num_super_types;
+ i++)
+ {
+ Service_Type_Map::ENTRY *super_type_entry = 0;
+ CORBA::String_var super_type (super_types[i]);
+ CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq place_holder;
+ CosTradingRepos::ServiceTypeRepository::PropStructSeq super_props;
+
+ this->type_map_.find (super_type, super_type_entry);
+
+ // Super_type_entry should never be zero.
+ if (super_type_entry != 0)
+ this->fully_describe_type_i (super_type_entry->int_id_->type_struct_,
+ super_props,
+ place_holder);
+ else
+ continue;
+
+ CORBA::ULong num_props = super_props.length ();
+
+ for (CORBA::ULong j = 0;
+ j < num_props;
+ j++)
+ {
+ Prop_Map::ENTRY *existing_prop = 0;
+ CORBA::String_var prop_name (super_props[j].name);
+
+ if (prop_map.bind (prop_name,
+ &super_props[j],
+ existing_prop) == 1)
+ {
+ // If already there, check that it is compatible with
+ // properties of other types. Value Types have to be the
+ // same.
+ const CosTradingRepos::ServiceTypeRepository::PropStruct &property_in_map =
+ *existing_prop->int_id_;
+
+ CORBA::TypeCode_ptr prop_type = property_in_map.value_type.in ();
+ int compare = 0;
+ ACE_TRY
+ {
+ compare =
+ super_props[j].value_type->equal (prop_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_TRY_THROW (CosTradingRepos::ServiceTypeRepository::ValueTypeRedefinition
+ (super_props[j].name,
+ super_props[j],
+ property_in_map.name,
+ property_in_map));
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ if (compare == 0
+ || super_props[j].mode > property_in_map.mode)
+ ACE_THROW (CosTradingRepos::ServiceTypeRepository::ValueTypeRedefinition
+ (super_props[j].name,
+ super_props[j],
+ property_in_map.name,
+ property_in_map));
+ }
+ }
+ }
+}
+
+void
+TAO_Service_Type_Repository::
+update_type_map (const char *name,
+ const char *if_name,
+ const CosTradingRepos::ServiceTypeRepository::PropStructSeq &props,
+ const CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq &super_types,
+ Prop_Map &,
+ Service_Type_Map &super_map)
+{
+ // Update entries for all supertypes to include this type as a
+ // subtype. we can use the super_types_map we have constructed.
+
+ for (Service_Type_Map_Iterator super_map_iterator (super_map);
+ super_map_iterator.done () == 0;
+ super_map_iterator++)
+ {
+ Type_Info *super_type_info =
+ (*super_map_iterator).int_id_;
+ super_type_info->has_subtypes_ = 0;
+ }
+
+ // All parameters are valid, create an entry for this service type
+ // in the this->type_map_.
+ Type_Info *type = 0;
+ ACE_NEW (type,
+ Type_Info);
+
+ type->type_struct_.props = props;
+ type->type_struct_.if_name = if_name;
+ type->type_struct_.super_types = super_types;
+ type->type_struct_.incarnation = this->incarnation_;
+ type->type_struct_.masked = 0;
+ type->has_subtypes_ = 0;
+
+ // Move the prop struct sequences and super type names from the in
+ // params to the internal storage.
+ /*
+ CORBA::ULong pslength = props.length ();
+ CosTradingRepos::ServiceTypeRepository::PropStructSeq* pstructs =
+ const_cast<CosTradingRepos::ServiceTypeRepository::PropStructSeq*> (&props);
+ CosTradingRepos::ServiceTypeRepository::PropStruct* psbuf =
+ pstructs->get_buffer (1);
+ type->type_struct_.props.replace (pslength,
+ pslength,
+ psbuf,
+ 1);
+ */
+ CORBA::String_var type_name (name);
+ this->type_map_.bind (type_name, type);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Service_Type_Repository.h b/TAO/orbsvcs/orbsvcs/Trader/Service_Type_Repository.h
new file mode 100644
index 00000000000..4f5b959b216
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Service_Type_Repository.h
@@ -0,0 +1,327 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Service_Type_Repository.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SERVICE_TYPE_REPOSITORY_H
+#define TAO_SERVICE_TYPE_REPOSITORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Trader/Trader.h"
+#include "ace/Hash_Map_Manager.h"
+#include "ace/Null_Mutex.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Service_Type_Repository
+ *
+ * @brief This class implements CosTradingRepos::ServiceTypeRepository
+ * IDL interface.
+ */
+class TAO_Trading_Serv_Export TAO_Service_Type_Repository
+ : public POA_CosTradingRepos::ServiceTypeRepository
+{
+public:
+ /**
+ * Parameterize the Service_Type_Repository with a lock to serialize
+ * access to the type repository map. A reader/writer lock is
+ * probably best. The Service_Type_Repository assumes control of the
+ * lock.
+ */
+ TAO_Service_Type_Repository (ACE_Lock *lock = 0);
+
+ ~TAO_Service_Type_Repository (void);
+
+ virtual CosTradingRepos::ServiceTypeRepository::IncarnationNumber
+ incarnation (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * BEGIN SPEC
+ * The add_type operation enables the creation of new service types
+ * in the service type repository. The caller supplies the "name"
+ * for the new type, the identifier for the interface associated
+ * with instances of this service type, the properties definitions
+ * for this service type, and the service type names of the
+ * immediate super-types to this service type.
+ */
+ virtual CosTradingRepos::ServiceTypeRepository::IncarnationNumber
+ add_type (const char *name,
+ const char *if_name,
+ const CosTradingRepos::ServiceTypeRepository::PropStructSeq &props,
+ const CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq &super_types
+ ACE_ENV_ARG_DECL_NOT_USED)
+ 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));
+
+ // If the type creation is successful, an incarnation number is
+ // returned as the value of the operation. Incarnation numbers are
+ // opaque values that are assigned to each modification to the
+ // repository's state. An incarnation number can be quoted when
+ // invoking the list_types operation to retrieve all changes to the
+ // service repository since a particular logical time. (Note:
+ // IncarnationNumber is currently declared as a struct consisting of
+ // two unsigned longs; what we really want here is an unsigned hyper
+ // [64-bit integer]. A future revision task force should modify this
+ // when CORBA systems support IDL 64-bit integers.)
+
+ // If the "name" parameter is malformed, then the
+ // CosTrading::IllegalServiceType exception is raised. If the type
+ // already exists, then the ServiceTypeExists exception is raised. °
+ // If the "if_name" parameter is not a sub-type of the interface
+ // associated with a service type from which this service type is
+ // derived, such that substitutability would be violated, then the
+ // InterfaceTypeMismatch exception is raised. If a property name
+ // supplied in the "props" parameter is malformed, the
+ // CosTrading::IllegalPropertyName exception is raised. If the
+ // same property name appears two or more times in the "props"
+ // parameter, the CosTrading::DuplicatePropertyName exception is
+ // raised. If a property value type associated with this service
+ // type illegally modifies the value type of a super-type's
+ // property, or if two super-types incompatibly declare value types
+ // for the same property name, then the ValueTypeRedefinition
+ // exception is raised. If one of the ServiceTypeNames in
+ // "super_types" is malformed, then the
+ // CosTrading::IllegalServiceType exception is raised. If one of the
+ // ServiceTypeNames in "super_types" does not exist, then the
+ // CosTrading::UnknownServiceType exception is raised. If the same
+ // service type name is included two or more times in this
+ // parameter, the DuplicateServiceTypeName exception is raised.
+ // END SPEC
+
+ /**
+ * BEGIN SPEC
+ * The remove_type operation removes the named type from the service
+ * type repository. If "name" is malformed, then the
+ * CosTrading::IllegalServiceType exception is raised. If
+ * "name" does not exist within the repository, then the
+ * CosTrading::UnknownServiceType exception is raised. If
+ * "name" has a service type which has been derived from it, then
+ * the HasSubTypes exception is raised. END SPEC
+ */
+ virtual void remove_type (const char *name
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::HasSubTypes));
+
+ virtual CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq *
+ list_types (const CosTradingRepos::ServiceTypeRepository::SpecifiedServiceTypes &which_types
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // BEGIN SPEC
+ // The list_types operation permits a client to obtain the names of
+ // service types which are in the repository. The "which_types"
+ // parameter permits the client to specify one of two possible
+ // values: all types known to the repository all types
+ // added/modified since a particular incarnation number The names of
+ // the requested types are returned by the operation for subsequent
+ // querying via the describe_type or the fully_describe_type
+ // operation.
+ // END SPEC
+
+ /**
+ * BEGIN SPEC
+ * The describe_type operation permits a client to obtain the
+ * details for a particular service type. If "name" is malformed,
+ * then the CosTrading::IllegalServiceType exception is raised. If
+ * "name" does not exist within the repository, then the
+ * CosTrading::UnknownServiceType exception is raised.
+ * END SPEC
+ */
+ virtual CosTradingRepos::ServiceTypeRepository::TypeStruct *
+ describe_type (const char *name
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType));
+
+ /**
+ * BEGIN SPEC
+ * The fully_describe_type operation permits a client to obtain the
+ * details for a particular service type. The property sequence
+ * returned in the TypeStruct includes all properties inherited from
+ * the transitive closure of its super types; the sequence of super
+ * types in the TypeStruct contains the names of the types in the
+ * transitive closure of the super type relation. If "name" is
+ * malformed, then the CosTrading::IllegalServiceType exception is
+ * raised. If "name" does not exist within the repository, then
+ * the CosTrading::UnknownServiceType exception is raised.
+ * END SPEC
+ */
+ virtual CosTradingRepos::ServiceTypeRepository::TypeStruct *
+ fully_describe_type (const char *name
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType));
+
+ /**
+ * BEGIN SPEC
+ * The mask_type operation permits the deprecation of a particular
+ * type (i.e., after being masked, exporters will no longer be able
+ * to advertise offers of that particular type). The type continues
+ * to exist in the service repository due to other service types
+ * being derived from it. If "name" is malformed, then the
+ * CosTrading::IllegalServiceType exception is raised. If "name"
+ * does not exist within the repository, then the
+ * CosTrading::UnknownServiceType exception is raised. If the type
+ * is currently in the masked state, then the AlreadyMasked
+ * exception is raised.
+ * END SPEC
+ */
+ virtual void mask_type (const char *name
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::AlreadyMasked));
+
+ /**
+ * BEGIN SPEC
+ * The unmask_type undeprecates a type (i.e., after being unmasked,
+ * exporters will be able to resume advertisement of offers of that
+ * particular type). If "name" is malformed, then the
+ * CosTrading::IllegalServiceType exception is raised. If "name"
+ * does not exist within the repository, then the
+ * CosTrading::UnknownServiceType exception is raised. If the type
+ * is not currently in the masked state, then the NotMasked
+ * exception is raised.
+ * END SPEC
+ */
+ virtual void unmask_type (const char *name
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::NotMasked));
+
+private:
+
+ /**
+ * @class Type_Info
+ *
+ * @brief Storage structure for information pertinent to the type.
+ */
+ class Type_Info
+ {
+ public:
+ /// Standard type info.
+ CosTradingRepos::ServiceTypeRepository::TypeStruct type_struct_;
+
+ /// Names of subtypes.
+ CORBA::Boolean has_subtypes_;
+ };
+
+ typedef ACE_Hash_Map_Manager_Ex <CORBA::String_var,
+ CosTradingRepos::ServiceTypeRepository::PropStruct *,
+ ACE_Hash<CORBA::String_var>,
+ ACE_Equal_To<CORBA::String_var>,
+ ACE_Null_Mutex>
+ Prop_Map;
+
+ typedef ACE_Hash_Map_Manager_Ex <CORBA::String_var,
+ Type_Info *,
+ ACE_Hash<CORBA::String_var>,
+ ACE_Equal_To<CORBA::String_var>,
+ ACE_Null_Mutex>
+ Service_Type_Map;
+
+ typedef ACE_Hash_Map_Iterator_Ex<CORBA::String_var,
+ Type_Info *,
+ ACE_Hash<CORBA::String_var>,
+ ACE_Equal_To<CORBA::String_var>,
+ ACE_Null_Mutex>
+ Service_Type_Map_Iterator;
+
+ /**
+ * Build a sequence aggregating the property names from all
+ * supertypes of the type, and a sequence representing the
+ * transitive closure of the super type relation.
+ */
+ void fully_describe_type_i (const CosTradingRepos::ServiceTypeRepository::TypeStruct &type_struct,
+ CosTradingRepos::ServiceTypeRepository::PropStructSeq &props,
+ CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq &super_types);
+
+ void collect_inheritance_hierarchy (const CosTradingRepos::ServiceTypeRepository::TypeStruct &type_struct,
+ TAO_String_Queue &target);
+
+ /// Confirm that the properties in props have valid names, and aren't
+ /// duplicated. Cram those properties into the prop_map.
+ void validate_properties (Prop_Map &prop_map,
+ const CosTradingRepos::ServiceTypeRepository::PropStructSeq &props
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName));
+
+ /// Confirm that the each super type exists, and cram them into super_map.
+ void validate_supertypes (Service_Type_Map &super_map,
+ const CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq &super_types
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::DuplicateServiceTypeName));
+
+ /// Ensure that properties of a super_type aren't having their types
+ /// or retstrictions redefined.
+ void validate_inheritance (Prop_Map &prop_map,
+ const CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq &super_types
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CosTradingRepos::ServiceTypeRepository::ValueTypeRedefinition));
+
+ // void validate_interface (const char *if_name,
+ // Service_Type_Map &super_map,
+ // ACE_ENV_SINGLE_ARG_DECL)
+ // ACE_THROW_SPEC ((CosTradingRepos::ServiceTypeRepository::InterfaceTypeMismatch));
+ // Ensure that the interface type derives from its superclasses'.
+
+ /// Update the type map with the information contained in the
+ /// TypeStruct, prop_map, and super_map.
+ void update_type_map (const char *name,
+ const char *if_name,
+ const CosTradingRepos::ServiceTypeRepository::PropStructSeq &props,
+ const CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq &super_types,
+ Prop_Map &prop_map,
+ Service_Type_Map &super_map);
+
+ TAO_Service_Type_Repository (const TAO_Service_Type_Repository &);
+ TAO_Service_Type_Repository &operator= (const TAO_Service_Type_Repository &);
+
+ /// Lock with which to serialize access to the service type map.
+ ACE_Lock *lock_;
+
+ /**
+ * Stores information for each service type in the repository. This
+ * is a mapping from service type name to a Type_Info struct which
+ * serves as a storage for various information for the given type.
+ */
+ Service_Type_Map type_map_;
+
+ /// Incarnation number to be used for the next modification to the
+ /// repository.
+ CosTradingRepos::ServiceTypeRepository::IncarnationNumber incarnation_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_SERVICE_TYPE_REPOSITORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Trader.cpp b/TAO/orbsvcs/orbsvcs/Trader/Trader.cpp
new file mode 100644
index 00000000000..14d035ee0e5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Trader.cpp
@@ -0,0 +1,866 @@
+// $Id$
+
+#include "orbsvcs/Trader/Trader.h"
+#include "orbsvcs/Trader/Offer_Iterators_T.h"
+#include "ace/Thread_Mutex.h"
+#include "ace/RW_Thread_Mutex.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_ctype.h"
+
+// The following #include is needed only for the instantiation pragmas.
+#include "orbsvcs/Trader/Trader_Interfaces.h"
+
+ACE_RCSID (Trader,
+ Trader,
+ "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Trader_Base::TAO_Trader_Base (void)
+ : trading_components_ (*this),
+ import_attributes_ (*this),
+ support_attributes_ (*this),
+ link_attributes_ (*this)
+{
+}
+
+TAO_Trader_Base::~TAO_Trader_Base (void)
+{
+}
+
+TAO_Import_Attributes_i &
+TAO_Trader_Base::import_attributes (void)
+{
+ return this->import_attributes_;
+}
+
+const TAO_Import_Attributes_i &
+TAO_Trader_Base::import_attributes (void) const
+{
+ return this->import_attributes_;
+}
+
+TAO_Support_Attributes_i &
+TAO_Trader_Base::support_attributes (void)
+{
+ return this->support_attributes_;
+}
+
+const TAO_Support_Attributes_i &
+TAO_Trader_Base::support_attributes (void) const
+{
+ return this->support_attributes_;
+}
+
+TAO_Link_Attributes_i &
+TAO_Trader_Base::link_attributes (void)
+{
+ return this->link_attributes_;
+}
+
+const TAO_Link_Attributes_i &
+TAO_Trader_Base::link_attributes (void) const
+{
+ return this->link_attributes_;
+}
+
+TAO_Trading_Components_i &
+TAO_Trader_Base::trading_components (void)
+{
+ return this->trading_components_;
+}
+
+const TAO_Trading_Components_i &
+TAO_Trader_Base::trading_components (void) const
+{
+ return this->trading_components_;
+}
+
+CORBA::Boolean
+TAO_Trader_Base::is_valid_property_name (const char* ident)
+{
+ bool return_value = false;
+
+ if (ident == 0)
+ return return_value;
+
+ size_t length = ACE_OS::strlen (ident);
+ if (length >= 1 && ACE_OS::ace_isalpha (ident[0]))
+ {
+ return_value = true;
+ for (size_t i = 0; i < length; i++)
+ {
+ if (! (ACE_OS::ace_isalnum (ident[i]) || ident[i] == '_'))
+ {
+ return_value = false;
+ break;
+ }
+ }
+ }
+
+ return return_value;
+}
+
+CORBA::Boolean
+TAO_Trader_Base::is_valid_identifier_name (const char* ident)
+{
+ static char const * const double_colon = "::";
+
+ if (ident == 0)
+ return 0;
+
+ int return_value = 1;
+
+ // Allow scoped identifiers
+ CORBA::Boolean done = 0;
+ char const * pos =
+ ACE_OS::strstr (ident,
+ double_colon);
+
+ do
+ {
+ if ('_' == ident[0])
+ {
+ // Treat escaped identifiers the same way as IDL
+ ++ident;
+ }
+
+ size_t length =
+ pos ? pos - ident : ACE_OS::strlen (ident);
+
+ if (length >= 1 && ACE_OS::ace_isalpha (ident[0]))
+ {
+ // First character must be alpha
+ for (size_t i = 0; i < length; ++i)
+ {
+ if (! (ACE_OS::ace_isalnum (ident[i])
+ || ident[i] == '_'))
+ {
+ // Subsequent characters is not alpha, numeric, or '_'
+ return_value = 0;
+ break;
+ }
+ }
+ }
+ else
+ return_value = 0;
+
+ if (pos)
+ {
+ // More identifiers
+ ident = pos + 2;
+ pos = ACE_OS::strstr (ident, double_colon);
+ }
+ else
+ {
+ // Last or only identifier
+ done = 1;
+ }
+ }
+ while (!done);
+
+ return return_value;
+}
+
+TAO_Lockable::~TAO_Lockable (void)
+{
+}
+
+TAO_Support_Attributes_i::
+TAO_Support_Attributes_i (TAO_Lockable &locker)
+ : locker_ (locker),
+ supports_modifiable_properties_ (1),
+ supports_dynamic_properties_ (1),
+ supports_proxy_offers_ (0),
+ type_repos_ (CosTrading::TypeRepository::_nil ()),
+ service_type_repos_ (CosTradingRepos::ServiceTypeRepository::_nil ())
+{
+}
+
+TAO_Support_Attributes_i::~TAO_Support_Attributes_i (void)
+{
+}
+
+CORBA::Boolean
+TAO_Support_Attributes_i::supports_modifiable_properties (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (),
+ 0);
+ return this->supports_modifiable_properties_;
+}
+
+void
+TAO_Support_Attributes_i::
+supports_modifiable_properties (CORBA::Boolean new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+ this->supports_modifiable_properties_ = new_value;
+}
+
+CORBA::Boolean
+TAO_Support_Attributes_i::supports_dynamic_properties (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (),
+ 0);
+
+ return this->supports_dynamic_properties_;
+}
+
+void
+TAO_Support_Attributes_i::
+supports_dynamic_properties (CORBA::Boolean new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+ this->supports_dynamic_properties_ = new_value;
+}
+
+CORBA::Boolean
+TAO_Support_Attributes_i::supports_proxy_offers (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (),
+ 0);
+
+ return this->supports_proxy_offers_;
+}
+
+void
+TAO_Support_Attributes_i::
+supports_proxy_offers (CORBA::Boolean new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+ this->supports_proxy_offers_ = new_value;
+}
+
+CosTrading::TypeRepository_ptr
+TAO_Support_Attributes_i::type_repos (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (),
+ CosTrading::TypeRepository::_nil ());
+ return this->type_repos_.ptr ();
+}
+
+void
+TAO_Support_Attributes_i::
+type_repos (CosTrading::TypeRepository_ptr new_value)
+{
+ // @@ Seth, There is no way to propagate the exception out.
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ this->type_repos_ = new_value;
+ // @@ What can we do even if we catch this?
+ this->service_type_repos_ =
+ CosTradingRepos::ServiceTypeRepository::_narrow (new_value ACE_ENV_ARG_PARAMETER);
+}
+
+CosTradingRepos::ServiceTypeRepository_ptr
+TAO_Support_Attributes_i::service_type_repos (void) const
+{
+ return this->service_type_repos_.ptr ();
+}
+
+
+TAO_Import_Attributes_i::
+TAO_Import_Attributes_i (TAO_Lockable &locker)
+ : locker_ (locker),
+ def_search_card_ (200),
+ max_search_card_ (500),
+ def_match_card_ (200),
+ max_match_card_ (500),
+ def_return_card_ (200),
+ max_return_card_ (500),
+ max_list_ (0),
+ def_hop_count_ (5),
+ max_hop_count_ (10),
+ def_follow_policy_ (CosTrading::if_no_local),
+ max_follow_policy_ (CosTrading::always)
+{
+}
+
+
+TAO_Import_Attributes_i::~TAO_Import_Attributes_i (void)
+{
+}
+
+CORBA::ULong
+TAO_Import_Attributes_i::def_search_card (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (), 10);
+ return this->def_search_card_;
+}
+
+void
+TAO_Import_Attributes_i::def_search_card (CORBA::ULong new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+
+ if (new_value > this->max_search_card_)
+ this->def_search_card_ = this->max_search_card_;
+ else
+ this->def_search_card_ = new_value;
+}
+
+CORBA::ULong
+TAO_Import_Attributes_i::max_search_card (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (), 10);
+ return this->max_search_card_;
+}
+
+void
+TAO_Import_Attributes_i::max_search_card (CORBA::ULong new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+
+ this->max_search_card_ = new_value;
+
+ if (this->def_search_card_ > this->max_search_card_)
+ this->def_search_card_ = this->max_search_card_;
+}
+
+CORBA::ULong
+TAO_Import_Attributes_i::def_match_card (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (), 10);
+ return this->def_match_card_;
+}
+
+void
+TAO_Import_Attributes_i::def_match_card (CORBA::ULong new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+
+ if (new_value > this->max_match_card_)
+ this->def_match_card_ = this->max_match_card_;
+ else
+ this->def_match_card_ = new_value;
+}
+
+CORBA::ULong
+TAO_Import_Attributes_i::max_match_card (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (), 10);
+ return this->max_match_card_;
+}
+
+void
+TAO_Import_Attributes_i::max_match_card (CORBA::ULong new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+ this->max_match_card_ = new_value;
+
+ if (this->def_match_card_ > this->max_match_card_)
+ this->def_match_card_ = this->max_match_card_;
+}
+
+CORBA::ULong
+TAO_Import_Attributes_i::def_return_card (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (), 10);
+ return this->def_return_card_;
+}
+
+void
+TAO_Import_Attributes_i::def_return_card (CORBA::ULong new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+
+ if (new_value > this->max_return_card_)
+ this->def_return_card_ = this->max_return_card_;
+ else
+ this->def_return_card_ = new_value;
+}
+
+CORBA::ULong
+TAO_Import_Attributes_i::max_return_card (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (), 10);
+ return this->max_return_card_;
+}
+
+void
+TAO_Import_Attributes_i::max_return_card (CORBA::ULong new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+ this->max_return_card_ = new_value;
+
+ if (this->def_return_card_ > this->max_return_card_)
+ this->def_return_card_ = this->max_return_card_;
+}
+
+CORBA::ULong
+TAO_Import_Attributes_i::max_list (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (), 0);
+ return this->max_list_;
+}
+
+void
+TAO_Import_Attributes_i::max_list (CORBA::ULong new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+ this->max_list_ = new_value;
+}
+
+CORBA::ULong
+TAO_Import_Attributes_i::def_hop_count (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (), 0);
+ return this->def_hop_count_;
+}
+
+void
+TAO_Import_Attributes_i::def_hop_count (CORBA::ULong new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+
+ if (new_value > this->max_hop_count_)
+ this->def_hop_count_ = this->max_hop_count_;
+ else
+ this->def_hop_count_ = new_value;
+}
+
+CORBA::ULong
+TAO_Import_Attributes_i::max_hop_count (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (), 0);
+ return this->max_hop_count_;
+}
+
+void
+TAO_Import_Attributes_i::max_hop_count (CORBA::ULong new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+ this->max_hop_count_ = new_value;
+
+ if (this->def_hop_count_ > this->max_hop_count_)
+ this->def_hop_count_ = this->max_hop_count_;
+}
+
+CosTrading::FollowOption
+TAO_Import_Attributes_i::def_follow_policy (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (), CosTrading::local_only);
+ return this->def_follow_policy_;
+}
+
+void
+TAO_Import_Attributes_i::def_follow_policy (CosTrading::FollowOption new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+
+ if (new_value > this->max_follow_policy_)
+ this->def_follow_policy_ = this->max_follow_policy_;
+ else
+ this->def_follow_policy_ = new_value;
+}
+
+CosTrading::FollowOption
+TAO_Import_Attributes_i::max_follow_policy (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (), CosTrading::local_only);
+ return this->max_follow_policy_;
+}
+
+void
+TAO_Import_Attributes_i::max_follow_policy (CosTrading::FollowOption new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+ this->max_follow_policy_ = new_value;
+
+ if (this->def_follow_policy_ > this->max_follow_policy_)
+ this->def_follow_policy_ = this->max_follow_policy_;
+}
+
+
+TAO_Trading_Components_i::TAO_Trading_Components_i (TAO_Lockable &locker)
+ : locker_ (locker),
+ lookup_ (CosTrading::Lookup::_nil ()),
+ register_ (CosTrading::Register::_nil ()),
+ link_ (CosTrading::Link::_nil ()),
+ proxy_ (CosTrading::Proxy::_nil ()),
+ admin_ (CosTrading::Admin::_nil ())
+{
+}
+
+TAO_Trading_Components_i::~TAO_Trading_Components_i (void)
+{
+}
+
+CosTrading::Lookup_ptr
+TAO_Trading_Components_i::lookup_if (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (),
+ CosTrading::Lookup::_nil ());
+ return this->lookup_.ptr ();
+}
+
+void
+TAO_Trading_Components_i::lookup_if (CosTrading::Lookup_ptr new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+ this->lookup_ = new_value;
+}
+
+CosTrading::Register_ptr
+TAO_Trading_Components_i::register_if (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (),
+ CosTrading::Register::_nil ());
+ return this->register_.ptr ();
+}
+
+void
+TAO_Trading_Components_i::register_if (CosTrading::Register_ptr new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+ this->register_ = new_value;
+}
+
+CosTrading::Link_ptr
+TAO_Trading_Components_i::link_if (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (),
+ CosTrading::Link::_nil ());
+ return this->link_.ptr ();
+}
+
+void
+TAO_Trading_Components_i::link_if (CosTrading::Link_ptr new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+ this->link_ = new_value;
+}
+
+CosTrading::Proxy_ptr
+TAO_Trading_Components_i::proxy_if (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (),
+ CosTrading::Proxy::_nil ());
+ return this->proxy_.ptr ();
+}
+
+void
+TAO_Trading_Components_i::proxy_if (CosTrading::Proxy_ptr new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+ this->proxy_ = new_value;
+}
+
+CosTrading::Admin_ptr
+TAO_Trading_Components_i::admin_if (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (),
+ CosTrading::Admin::_nil ());
+ return this->admin_.ptr ();
+}
+
+void
+TAO_Trading_Components_i::admin_if (CosTrading::Admin_ptr new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+ this->admin_ = new_value;
+}
+
+
+TAO_Link_Attributes_i::TAO_Link_Attributes_i (TAO_Lockable &locker)
+ :locker_ (locker),
+ max_link_follow_policy_ (CosTrading::local_only)
+{
+}
+
+TAO_Link_Attributes_i::~TAO_Link_Attributes_i (void)
+{
+}
+
+CosTrading::FollowOption
+TAO_Link_Attributes_i::max_link_follow_policy (void) const
+{
+ ACE_READ_GUARD_RETURN (ACE_Lock, ace_mon, this->locker_.lock (),
+ CosTrading::local_only);
+ return this->max_link_follow_policy_;
+}
+
+void
+TAO_Link_Attributes_i::max_link_follow_policy (CosTrading::FollowOption new_value)
+{
+ ACE_WRITE_GUARD (ACE_Lock, ace_mon, this->locker_.lock ());
+ this->max_link_follow_policy_ = new_value;
+}
+
+bool
+operator< (const CosTradingRepos::ServiceTypeRepository::IncarnationNumber &l,
+ const CosTradingRepos::ServiceTypeRepository::IncarnationNumber &r)
+{
+ if (l.high < r.high)
+ return true;
+ else if (l.high == r.high)
+ return (l.low < r.low);
+ else
+ return false;
+}
+
+bool
+operator> (const CosTradingRepos::ServiceTypeRepository::IncarnationNumber &l,
+ const CosTradingRepos::ServiceTypeRepository::IncarnationNumber &r)
+{
+ return (r < l);
+}
+
+bool
+operator== (const CosTrading::Admin::OctetSeq& left,
+ const CosTrading::Admin::OctetSeq& right)
+{
+ bool return_value = false;
+
+ const CORBA::ULong left_length = left.length ();
+ const CORBA::ULong right_length = right.length ();
+
+ if (left_length == right_length)
+ {
+ return_value = true;
+
+ for (CORBA::ULong i = 0; i < left_length; ++i)
+ {
+ if (left[i] != right[i])
+ {
+ return_value = false;
+ break;
+ }
+ }
+ }
+
+ return return_value;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include "ace/Arg_Shifter.h"
+#include "orbsvcs/Trader/Trader_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Trader_Factory::TAO_TRADER*
+TAO_Trader_Factory::create_trader (int& argc, ACE_TCHAR** argv)
+{
+ TAO_Trader_Factory trader_factory (argc, argv);
+ return trader_factory.manufacture_trader ();
+}
+
+TAO_Trader_Factory::TAO_Trader_Factory (int& argc, ACE_TCHAR** argv)
+ : conformance_ (TAO_TRADER_LINKED),
+ threadsafe_ (0),
+ supports_dynamic_properties_ (1),
+ supports_modifiable_properties_ (1),
+ def_search_card_ (20),
+ max_search_card_ (50),
+ def_match_card_ (20),
+ max_match_card_ (50),
+ def_return_card_ (20),
+ max_return_card_ (50),
+ def_hop_count_ (5),
+ max_hop_count_ (10),
+ def_follow_policy_ (CosTrading::if_no_local),
+ max_follow_policy_ (CosTrading::always)
+{
+ this->parse_args (argc, argv);
+}
+
+TAO_Trader_Factory::TAO_TRADER *
+TAO_Trader_Factory::manufacture_trader (void)
+{
+ typedef TAO_Trader<ACE_Null_Mutex, ACE_Null_Mutex> TRADER;
+
+#if defined ACE_HAS_THREADS
+ typedef TAO_Trader<TAO_SYNCH_MUTEX, TAO_SYNCH_RW_MUTEX> MT_TRADER;
+#else
+ typedef TAO_Trader<ACE_Null_Mutex, ACE_Null_Mutex> MT_TRADER;
+#endif /* ACE_HAS_THREADS */
+
+ TAO_TRADER* return_value = 0;
+ int components = static_cast<int> (TAO_Trader_Base::LOOKUP);
+
+ if (this->conformance_ >= TAO_TRADER_SIMPLE)
+ components |= static_cast<int> (TAO_Trader_Base::REGISTER);
+
+ if (this->conformance_ >= TAO_TRADER_STANDALONE)
+ components |= static_cast<int> (TAO_Trader_Base::ADMIN);
+
+ if (this->conformance_ >= TAO_TRADER_LINKED)
+ components |= static_cast<int> (TAO_Trader_Base::LINK);
+
+ if (this->threadsafe_)
+ ACE_NEW_RETURN (return_value,
+ MT_TRADER (static_cast<TAO_Trader_Base::Trader_Components> (components)),
+ 0);
+ else
+ ACE_NEW_RETURN (return_value,
+ TRADER (static_cast<TAO_Trader_Base::Trader_Components> (components)),
+ 0);
+
+ TAO_Import_Attributes_i &import_attributes =
+ return_value->import_attributes ();
+ TAO_Support_Attributes_i &support_attributes =
+ return_value->support_attributes ();
+
+ import_attributes.def_search_card (this->def_search_card_);
+ import_attributes.max_search_card (this->max_search_card_);
+ import_attributes.def_match_card (this->def_match_card_);
+ import_attributes.max_match_card (this->max_match_card_);
+ import_attributes.def_return_card (this->def_return_card_);
+ import_attributes.max_return_card (this->max_return_card_);
+ import_attributes.def_hop_count (this->def_hop_count_);
+ import_attributes.max_hop_count (this->max_hop_count_);
+ import_attributes.def_follow_policy (this->def_follow_policy_);
+ import_attributes.max_follow_policy (this->max_follow_policy_);
+ support_attributes.supports_modifiable_properties (this->supports_modifiable_properties_);
+ support_attributes.supports_dynamic_properties (this->supports_dynamic_properties_);
+
+ return return_value;
+}
+
+void
+TAO_Trader_Factory::parse_args (int& argc, ACE_TCHAR** argv)
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ while (arg_shifter.is_anything_left ())
+ {
+ const ACE_TCHAR* current_arg = arg_shifter.get_current ();
+
+ if (ACE_OS::strcmp (current_arg, ACE_TEXT("-TSthreadsafe")) == 0)
+ {
+ arg_shifter.consume_arg ();
+ this->threadsafe_ = 1;
+ }
+ else if (ACE_OS::strcmp (current_arg, ACE_TEXT("-TSconformance")) == 0)
+ {
+ arg_shifter.consume_arg ();
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* conformance_str = arg_shifter.get_current ();
+
+ if (ACE_OS::strcasecmp (conformance_str, ACE_TEXT("Linked")) == 0)
+ this->conformance_ = TAO_TRADER_LINKED;
+ else if (ACE_OS::strcasecmp (conformance_str, ACE_TEXT("Query")) == 0)
+ this->conformance_ = TAO_TRADER_QUERY;
+ else if (ACE_OS::strcasecmp (conformance_str, ACE_TEXT("Simple")) == 0)
+ this->conformance_ = TAO_TRADER_SIMPLE;
+ else if (ACE_OS::strcasecmp (conformance_str, ACE_TEXT("Standalone")) == 0)
+ this->conformance_ = TAO_TRADER_STANDALONE;
+
+ arg_shifter.consume_arg ();
+ }
+ }
+ else if (ACE_OS::strcmp (current_arg, ACE_TEXT("-TSsupports_dynamic_properties")) == 0)
+ {
+ arg_shifter.consume_arg ();
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* arg_str = arg_shifter.get_current ();
+
+ if (ACE_OS::strcasecmp (arg_str, ACE_TEXT("true")) == 0)
+ this->supports_dynamic_properties_ = 1;
+ else if (ACE_OS::strcasecmp (arg_str, ACE_TEXT("false")) == 0)
+ this->supports_dynamic_properties_ = 0;
+
+ arg_shifter.consume_arg ();
+ }
+
+ }
+ else if (ACE_OS::strcmp (current_arg, ACE_TEXT("-TSsupports_modifiable_properties")) == 0)
+ {
+ arg_shifter.consume_arg ();
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* arg_str = arg_shifter.get_current ();
+
+ if (ACE_OS::strcasecmp (arg_str, ACE_TEXT("true")) == 0)
+ this->supports_modifiable_properties_ = 1;
+ else if (ACE_OS::strcasecmp (arg_str, ACE_TEXT("false")) == 0)
+ this->supports_modifiable_properties_ = 0;
+
+ arg_shifter.consume_arg ();
+ }
+ }
+ else if (ACE_OS::strcmp (current_arg, ACE_TEXT("-TSdef_search_card")) == 0 ||
+ ACE_OS::strcmp (current_arg, ACE_TEXT("-TSmax_search_card")) == 0 ||
+ ACE_OS::strcmp (current_arg, ACE_TEXT("-TSdef_match_card")) == 0 ||
+ ACE_OS::strcmp (current_arg, ACE_TEXT("-TSmax_match_card")) == 0 ||
+ ACE_OS::strcmp (current_arg, ACE_TEXT("-TSdef_return_card")) == 0 ||
+ ACE_OS::strcmp (current_arg, ACE_TEXT("-TSmax_return_card")) == 0 ||
+ ACE_OS::strcmp (current_arg, ACE_TEXT("-TSdef_hop_count")) == 0 ||
+ ACE_OS::strcmp (current_arg, ACE_TEXT("-TSmax_hop_count")) == 0)
+ {
+ arg_shifter.consume_arg ();
+ if (arg_shifter.is_parameter_next ())
+ {
+ CORBA::ULong value =
+ static_cast<CORBA::ULong> (ACE_OS::atoi (arg_shifter.get_current ()));
+ arg_shifter.consume_arg ();
+
+ if (ACE_OS::strstr (current_arg, ACE_TEXT("card")))
+ {
+ if (ACE_OS::strstr (current_arg, ACE_TEXT("max")))
+ {
+ if (ACE_OS::strstr (current_arg, ACE_TEXT("search")))
+ this->max_search_card_ = value;
+ else if (ACE_OS::strstr (current_arg, ACE_TEXT("match")))
+ this->max_match_card_ = value;
+ else
+ this->max_return_card_ = value;
+ }
+ else
+ {
+ if (ACE_OS::strstr (current_arg, ACE_TEXT("search")))
+ this->def_search_card_ = value;
+ else if (ACE_OS::strstr (current_arg, ACE_TEXT("match")))
+ this->def_match_card_ = value;
+ else
+ this->def_return_card_ = value;
+ }
+ }
+ else
+ {
+ if (ACE_OS::strstr (current_arg, ACE_TEXT("max")))
+ this->max_hop_count_ = value;
+ else
+ this->def_hop_count_ = value;
+ }
+ }
+ }
+ else if (ACE_OS::strcmp (current_arg, ACE_TEXT("-TSdef_follow_policy")) == 0
+ || ACE_OS::strcmp (current_arg, ACE_TEXT("-TSmax_follow_policy")) == 0)
+ {
+ arg_shifter.consume_arg ();
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR* arg_str = arg_shifter.get_current ();
+ CosTrading::FollowOption follow_option;
+
+ if (ACE_OS::strcasecmp (arg_str, ACE_TEXT("always")) == 0)
+ follow_option = CosTrading::always;
+ else if (ACE_OS::strcasecmp (arg_str, ACE_TEXT("if_no_local")) == 0)
+ follow_option = CosTrading::if_no_local;
+ else if (ACE_OS::strcasecmp (arg_str, ACE_TEXT("local_only")) == 0)
+ follow_option = CosTrading::local_only;
+ else if (ACE_OS::strstr (current_arg, ACE_TEXT("def")))
+ follow_option = this->def_follow_policy_;
+ else
+ follow_option = this->max_follow_policy_;
+
+ if (ACE_OS::strstr (current_arg, ACE_TEXT("def")))
+ this->def_follow_policy_ = follow_option;
+ else
+ this->max_follow_policy_ = follow_option;
+
+ arg_shifter.consume_arg ();
+ }
+ }
+ else
+ arg_shifter.ignore_arg ();
+ }
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Trader.h b/TAO/orbsvcs/orbsvcs/Trader/Trader.h
new file mode 100644
index 00000000000..61b18d38c72
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Trader.h
@@ -0,0 +1,525 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Trader.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ * @author Irfan Pyarali <irfan@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_TRADER_BASE_H
+#define TAO_TRADER_BASE_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Trader/Interpreter_Utils.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Containers.h"
+
+#include "orbsvcs/CosTradingS.h"
+#include "orbsvcs/CosTradingReposS.h"
+#include "orbsvcs/CosTradingDynamicS.h"
+#include "orbsvcs/Trader/trading_serv_export.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning (disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward Declaration.
+class TAO_Trader_Base;
+
+ // *************************************************************
+ // TAO_Trader_Factory
+ // *************************************************************
+
+/**
+ * @class TAO_Trader_Factory
+ *
+ * @brief Uses command line arguments to construct a trader instance with
+ * the correct interface support, locking, and policy settings.
+ */
+class TAO_Trading_Serv_Export TAO_Trader_Factory
+{
+public:
+
+ typedef TAO_Trader_Base TAO_TRADER;
+
+ /**
+ * Creates an instance of the trader according to parameters whose
+ * default values can be overrided with the following command line
+ * arguments:
+ *
+ * -TSthreadsafe, default is not thread-safe
+ * -TSconformance {query, simple, stand-alone, linked}, default is linked
+ * -TSsupports_dynamic_properties {true, false}, default is true
+ * -TSsupports_modifiable_propertise {true, false}, default is true
+ * -TSdef_search_card {integer}, default is 20
+ * -TSmax_search_card {integer}, default is 50
+ * -TSdef_match_card {integer}, default is 20
+ * -TSmax_match_card {integer}, default is 50
+ * -TSdef_return_card {integer}, default is 20
+ * -TSmax_return_card {integer}, default is 50
+ * -TSdef_hop_count {integer}, default is 5,
+ * -TSmax_hop_count {integer}, default is 10
+ * -TSdef_follow_policy {always,if_no_local,local_only}, default is if_no_local,
+ * -TSmax_follow_policy {always,if_no_local,local_only}, default is always
+ */
+ static TAO_TRADER* create_trader (int& argc, ACE_TCHAR** argv);
+
+protected:
+
+ TAO_Trader_Factory (int& argc, ACE_TCHAR** argv);
+
+private:
+
+ enum Conformance { TAO_TRADER_QUERY,
+ TAO_TRADER_SIMPLE,
+ TAO_TRADER_STANDALONE,
+ TAO_TRADER_LINKED };
+
+ TAO_TRADER* manufacture_trader (void);
+
+ void parse_args (int& argc, ACE_TCHAR** argv);
+
+ TAO_Trader_Factory& operator= (const TAO_Trader_Factory&);
+ TAO_Trader_Factory (const TAO_Trader_Factory&);
+
+ // = Command line configurable parameters.
+
+ Conformance conformance_;
+ CORBA::Boolean threadsafe_;
+ CORBA::Boolean supports_dynamic_properties_;
+ CORBA::Boolean supports_modifiable_properties_;
+ CORBA::ULong def_search_card_;
+ CORBA::ULong max_search_card_;
+ CORBA::ULong def_match_card_;
+ CORBA::ULong max_match_card_;
+ CORBA::ULong def_return_card_;
+ CORBA::ULong max_return_card_;
+ CORBA::ULong def_hop_count_;
+ CORBA::ULong max_hop_count_;
+ CosTrading::FollowOption def_follow_policy_;
+ CosTrading::FollowOption max_follow_policy_;
+};
+
+ // *************************************************************
+ // Attribute Classes
+ // *************************************************************
+
+/**
+ * @class TAO_Lockable
+ *
+ * Class used to remove the circular dependencies between the
+ * Attribute classes and the Trader class.
+ */
+#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x582)
+// Work around Borland unresolved symbol errors concerning the
+// out-of-line virtual destructor. The virtual destructor should
+// not be inlined, nor should we have to export TAO_Lockable from the
+// DSO/DLL. *sigh*
+class TAO_Trading_Serv_Export TAO_Lockable
+#else
+class TAO_Lockable
+#endif /* __BORLANDC__ < 0x581 */
+{
+public:
+ virtual ~TAO_Lockable (void);
+
+ virtual ACE_Lock& lock (void) = 0;
+};
+
+
+/**
+ * @class TAO_Support_Attributes_i
+ *
+ * @brief This class stores, allows access to and modification of
+ * trader's support attributes.
+ *
+ * Contains a reference to the trader from which it is
+ * used so it can use trader's lock.
+ */
+class TAO_Trading_Serv_Export TAO_Support_Attributes_i
+{
+public:
+ // = Initialization and termination methods.
+ TAO_Support_Attributes_i (TAO_Lockable &locker);
+ ~TAO_Support_Attributes_i ();
+
+ // = Accessor methods.
+ CORBA::Boolean supports_modifiable_properties (void) const;
+ void supports_modifiable_properties (CORBA::Boolean);
+
+ CORBA::Boolean supports_dynamic_properties (void) const;
+ void supports_dynamic_properties (CORBA::Boolean);
+
+ CORBA::Boolean supports_proxy_offers (void) const;
+ void supports_proxy_offers (CORBA::Boolean);
+
+ CosTrading::TypeRepository_ptr type_repos (void) const;
+ void type_repos (CosTrading::TypeRepository_ptr);
+
+ CosTradingRepos::ServiceTypeRepository_ptr service_type_repos (void) const;
+
+private:
+
+ /// A reference to the trader (needed for obtaining the lock.)
+ TAO_Lockable &locker_;
+
+ /// Indicator of whether the trader supports property modification.
+ CORBA::Boolean supports_modifiable_properties_;
+
+ /// Indicator of whether the trader supports dynamic properties.
+ CORBA::Boolean supports_dynamic_properties_;
+
+ /// Indicator of whether the trader supports proxy offers.
+ CORBA::Boolean supports_proxy_offers_;
+
+ /// A reference to the TypeRepostitory used by the trader.
+ CORBA::Object_var type_repos_;
+
+ /// Already narrowed reference to the ServiceTypeRepository.
+ CosTradingRepos::ServiceTypeRepository_var service_type_repos_;
+};
+
+/**
+ * @class TAO_Link_Attributes_i
+ *
+ * @brief This class stores, allows access to and modification of
+ * trader's link attributes.
+ *
+ * Contains a reference to the trader from which it is
+ * used so it can use trader's lock.
+ */
+class TAO_Trading_Serv_Export TAO_Link_Attributes_i
+{
+public:
+ // = Initialization and termination methods.
+
+ TAO_Link_Attributes_i (TAO_Lockable &locker);
+ ~TAO_Link_Attributes_i ();
+
+ // = Accessor methods.
+
+ CosTrading::FollowOption max_link_follow_policy (void) const;
+ void max_link_follow_policy (CosTrading::FollowOption);
+
+private:
+
+ /// A reference to the trader (needed for obtaining the lock.)
+ TAO_Lockable &locker_;
+
+ ///
+ CosTrading::FollowOption max_link_follow_policy_;
+};
+
+/**
+ * @class TAO_Import_Attributes_i
+ *
+ * @brief This class stores, allows access to and modification of
+ * trader's import attributes.
+ *
+ * Contains a reference to the trader from which it is
+ * used so it can use trader's lock.
+ */
+class TAO_Trading_Serv_Export TAO_Import_Attributes_i
+{
+public:
+ // = Initialization and termination methods.
+
+ TAO_Import_Attributes_i (TAO_Lockable &locker);
+
+ ~TAO_Import_Attributes_i (void);
+
+ // = Accessor methods.
+
+ CORBA::ULong def_search_card (void) const;
+ void def_search_card (CORBA::ULong);
+
+ CORBA::ULong max_search_card (void) const;
+ void max_search_card (CORBA::ULong);
+
+ CORBA::ULong def_match_card (void) const;
+ void def_match_card (CORBA::ULong);
+
+ CORBA::ULong max_match_card (void) const;
+ void max_match_card (CORBA::ULong);
+
+ CORBA::ULong def_return_card (void) const;
+ void def_return_card (CORBA::ULong);
+
+ CORBA::ULong max_return_card (void) const;
+ void max_return_card (CORBA::ULong);
+
+ CORBA::ULong max_list (void) const;
+ void max_list (CORBA::ULong);
+
+ CORBA::ULong def_hop_count (void) const;
+ void def_hop_count (CORBA::ULong);
+
+ CORBA::ULong max_hop_count (void) const;
+ void max_hop_count (CORBA::ULong);
+
+ CosTrading::FollowOption def_follow_policy (void) const;
+ void def_follow_policy (CosTrading::FollowOption);
+
+ CosTrading::FollowOption max_follow_policy (void) const;
+ void max_follow_policy (CosTrading::FollowOption);
+
+private:
+
+ TAO_Lockable &locker_;
+
+ /// Upper bound of offers to be searched if <search_card>
+ /// is not specified.
+ CORBA::ULong def_search_card_;
+
+ /// Maximum upper bound of offers to be searched.
+ CORBA::ULong max_search_card_;
+
+ /// Upper bound of matched offers to be ordered if
+ /// <match_card> is not specified).
+ CORBA::ULong def_match_card_;
+
+ /// Maximum upper bound of matched offers to be ordered.
+ CORBA::ULong max_match_card_;
+
+ /// Upper bound of ordered offers to be returned if
+ /// <returned_card> is not specified.
+ CORBA::ULong def_return_card_;
+
+ /// Maximum upper bound of ordered offers to be returned.
+ CORBA::ULong max_return_card_;
+
+ /// Upper bound of depth
+ CORBA::ULong max_list_;
+
+ /// Upper bound of depth of links to be traversed if <hop_count> is
+ /// not specified.
+ CORBA::ULong def_hop_count_;
+
+ /// Maximum upper bound of depth of links to be traversed.
+ CORBA::ULong max_hop_count_;
+
+ /// Default link follow policy for a particular trader.
+ CosTrading::FollowOption def_follow_policy_;
+
+ /// Limiting link follow policy for all links of the trader -
+ /// overrides both link and importer policies.
+ CosTrading::FollowOption max_follow_policy_;
+};
+
+/**
+ * @class TAO_Trading_Components_i
+ *
+ * @brief Set/get methods for references to various
+ * interfaces of the trader.
+ *
+ * Note, this class is for use in local address space only and is NOT a
+ * direct implementation of IDL methods. (Implementation of
+ * IDL methods in CosTrading::Trader_Components would need
+ * add a _duplicate call for each get method).
+ */
+class TAO_Trading_Serv_Export TAO_Trading_Components_i
+{
+public:
+
+ // = Initialization and termination methods.
+ TAO_Trading_Components_i (TAO_Lockable &locker);
+ ~TAO_Trading_Components_i (void);
+
+ // = CosTrading::TraderComponents methods.
+
+ /// Returns an object reference to the Lookup interface of the trader.
+ /// Returns nil if the trader does not support Lookup interface.
+ CosTrading::Lookup_ptr lookup_if (void) const;
+
+ /// Set the reference to the Lookup interface.
+ void lookup_if (CosTrading::Lookup_ptr);
+
+ /// Returns object reference for the Register interface of the trader.
+ /// Returns nil if the trader does not support Register interface.
+ CosTrading::Register_ptr register_if (void) const;
+
+ /// Set the reference to the Register interface of the trader.
+ void register_if (CosTrading::Register_ptr);
+
+ /// Returns object reference for the Link interface of the trader.
+ /// Returns nil if the trader does not support Link interface.
+ CosTrading::Link_ptr link_if (void) const;
+
+ /// Set the reference to the Link interface of the trader.
+ void link_if (CosTrading::Link_ptr);
+
+ /// Returns object reference to the Proxy interface of the trader.
+ /// Returns nil if the trader does not support Proxy interface.
+ CosTrading::Proxy_ptr proxy_if (void) const;
+
+ /// Set the reference to the Proxy interface of the trader.
+ void proxy_if (CosTrading::Proxy_ptr);
+
+ /// Returns object reference for the Admin interface of the trader.
+ /// Returns nil if the trader does not support Admin interface.
+ CosTrading::Admin_ptr admin_if (void) const;
+
+ /// Set the reference to the Admin interface of the trader.
+ void admin_if (CosTrading::Admin_ptr);
+
+private:
+
+ TAO_Lockable &locker_;
+
+ CosTrading::Lookup_var lookup_;
+ CosTrading::Register_var register_;
+ CosTrading::Link_var link_;
+ CosTrading::Proxy_var proxy_;
+ CosTrading::Admin_var admin_;
+};
+
+ // *************************************************************
+ // TAO_Trader_Base
+ // *************************************************************
+
+/**
+ * @class TAO_Trader_Base
+ *
+ * @brief TAO_Trader inherits from this "helper" class.
+ * The sole purpose of this class is to factor some of TAO_Trader's
+ * data members out, so that they would not have to be templatized
+ * and be be aware of the type of lock they use.
+ *
+ * TAO_Trader is a template class. And while we want
+ * <import_attributes_>, <trader_components_>, and
+ * <support_attributes> use a lock contained in TAO_Trader, we do not
+ * want all these classes to be templatized. TAO_Trader_Base class solves
+ * this problem.
+ */
+class TAO_Trading_Serv_Export TAO_Trader_Base : public TAO_Lockable
+{
+public:
+
+ enum Trader_Components
+ {
+ LOOKUP = 0x001,
+ REGISTER = 0x002,
+ LINK = 0x004,
+ PROXY = 0x008,
+ ADMIN = 0x010
+ };
+
+ virtual ~TAO_Trader_Base (void);
+
+ // = Accessors for objects that manage trader's configuration.
+
+ TAO_Trading_Components_i &trading_components (void);
+
+ const TAO_Trading_Components_i &trading_components (void) const;
+
+ TAO_Import_Attributes_i &import_attributes (void);
+
+ const TAO_Import_Attributes_i &import_attributes (void) const;
+
+ TAO_Support_Attributes_i &support_attributes (void);
+
+ const TAO_Support_Attributes_i &support_attributes (void) const;
+
+ TAO_Link_Attributes_i &link_attributes (void);
+
+ const TAO_Link_Attributes_i &link_attributes (void) const;
+
+ // = Accessor for trader's lock.
+
+ /**
+ * Determine whether the identifier is a valid one (i.e., if the
+ * first character is a letter, and the subsequent ones letter,
+ * numbers, or underscores.)
+ *
+ * IDL identifier scoping and escaping rules apply.
+ */
+ static CORBA::Boolean is_valid_identifier_name (const char* ident);
+
+ /**
+ * Determine whether the identifier is a valid one (i.e., if the
+ * first character is a letter, and the subsequent ones letter,
+ * numbers, or underscores.)
+ */
+ static CORBA::Boolean is_valid_property_name (const char* ident);
+
+ /**
+ * Determine whether the link name is a valid one
+ * currently defined the same as property name.
+ */
+ static CORBA::Boolean is_valid_link_name (const char* ident)
+ {
+ return is_valid_property_name (ident);
+ }
+
+protected:
+ // = Objects determining current configuration of a trader.
+
+ /// Stores and allows lookup of trader's components.
+ TAO_Trading_Components_i trading_components_;
+
+ /// Stores and allows access/modification of trader's import attributes.
+ TAO_Import_Attributes_i import_attributes_;
+
+ /// Stores and allows access/modification of trader's support attributes.
+ TAO_Support_Attributes_i support_attributes_;
+
+ /// Stores and allows access/modification of trader's link attributes.
+ TAO_Link_Attributes_i link_attributes_;
+
+ protected:
+
+ /// Implemented.
+ TAO_Trader_Base (void);
+
+ private:
+
+ /// Unimplemented.
+ TAO_Trader_Base (const TAO_Trader_Base& TAO_Trader_Base);
+ TAO_Trader_Base& operator= (const TAO_Trader_Base&);
+};
+
+
+// Helpful typedefs
+// Should probably be private to TAO_Offer_Database, but g++ has a
+// hard time with it like that when compiling TAO_Service_Offer_Iterator.
+typedef ACE_Hash_Map_Manager_Ex<CORBA::ULong, CosTrading::Offer*, ACE_Hash<CORBA::ULong>, ACE_Equal_To<CORBA::ULong>, ACE_Null_Mutex> TAO_Offer_Map;
+
+typedef ACE_Unbounded_Set<CORBA::String_var> TAO_String_Set;
+typedef ACE_Unbounded_Queue<char*> TAO_String_Queue;
+
+// = Helpful operators.
+
+bool
+operator> (const CosTradingRepos::ServiceTypeRepository::IncarnationNumber &l,
+ const CosTradingRepos::ServiceTypeRepository::IncarnationNumber &r);
+
+bool
+operator< (const CosTradingRepos::ServiceTypeRepository::IncarnationNumber &l,
+ const CosTradingRepos::ServiceTypeRepository::IncarnationNumber &r);
+
+bool
+operator== (const CosTrading::Admin::OctetSeq& left,
+ const CosTrading::Admin::OctetSeq& right);
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TRADER_BASE_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Trader_Constraint_Visitors.cpp b/TAO/orbsvcs/orbsvcs/Trader/Trader_Constraint_Visitors.cpp
new file mode 100644
index 00000000000..818934b10bb
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Trader_Constraint_Visitors.cpp
@@ -0,0 +1,84 @@
+// $Id$
+
+#include "orbsvcs/Trader/Trader_Constraint_Visitors.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Trader_Constraint_Evaluator::
+TAO_Trader_Constraint_Evaluator (CosTrading::Offer* offer,
+ CORBA::Boolean supports_dp)
+ : prop_eval_ (*offer, supports_dp)
+{
+ this->props_.close ();
+ this->props_.open ();
+ int length = offer->properties.length ();
+
+ // Create a map of property names to their values.
+ for (int i = 0; i < length; i++)
+ {
+ CORBA::String_var name = (const char*) offer->properties[i].name;
+ this->props_.bind (name, i);
+ }
+}
+
+int
+TAO_Trader_Constraint_Evaluator::
+visit_property (TAO_Property_Constraint* literal)
+{
+ int return_value = -1, prop_index = 0;
+ // Handle case where property is not, in fact, mapped to a value
+ CORBA::String_var prop_name ((const char*) literal->name ());
+
+ if (this->props_.find (prop_name, prop_index) == 0)
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ CORBA::Any *value = 0;
+ // Retrieve the value of the property from the Property_Evaluator
+ ACE_TRY
+ {
+ value = this->prop_eval_.property_value (prop_index ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ // ACE_CHECK_RETURN (-1);
+
+ if (value != 0)
+ {
+ this->queue_.enqueue_head (TAO_Literal_Constraint (value));
+ return_value = 0;
+ }
+ }
+
+ return return_value;
+}
+
+TAO_Trader_Constraint_Validator::
+TAO_Trader_Constraint_Validator
+(const CosTradingRepos::ServiceTypeRepository::TypeStruct& type_struct)
+{
+ const CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq =
+ type_struct.props;
+ int length = prop_seq.length ();
+
+ // Create a map of the service type properties to their types.
+ for (int i = 0; i < length; i++)
+ {
+ CORBA::TypeCode_ptr corba_type =
+ CORBA::TypeCode::_duplicate (prop_seq[i].value_type.in ());
+
+ CORBA::String_var prop_name_str = (const char*) prop_seq[i].name;
+ this->type_map_.bind (prop_name_str, corba_type);
+ }
+}
+
+TAO_Trader_Constraint_Validator::
+~TAO_Trader_Constraint_Validator ()
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Trader_Constraint_Visitors.h b/TAO/orbsvcs/orbsvcs/Trader/Trader_Constraint_Visitors.h
new file mode 100644
index 00000000000..3b132230630
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Trader_Constraint_Visitors.h
@@ -0,0 +1,63 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Trader_Constraint_Visitors.h
+ *
+ * $Id$
+ *
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_TRADER_CONSTRAINT_VISITOR_H
+#define TAO_TRADER_CONSTRAINT_VISITOR_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Trader/Constraint_Visitors.h"
+#include "orbsvcs/Trader/Trader.h"
+#include "orbsvcs/Trader/Trader_Utils.h"
+#include "orbsvcs/CosTradingC.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Trading_Serv_Export TAO_Trader_Constraint_Validator
+: public TAO_Constraint_Validator
+{
+ public:
+ /**
+ * The constructor creates a map of property names to their values
+ * from the Type Description retrieved from the
+ * ServiceTypeRepository. The ServiceTypeRepository throws
+ * exceptions when it's displeased with the type name provided to
+ * it. The map allows O(lg n) associative access, rather than the
+ * O(n) sequential lookup from the CORBA data structures.
+ */
+ TAO_Trader_Constraint_Validator (const CosTradingRepos::ServiceTypeRepository::TypeStruct&
+ type_struct);
+
+ /// Desctructor.
+ virtual ~TAO_Trader_Constraint_Validator (void);
+
+};
+
+class TAO_Trading_Serv_Export TAO_Trader_Constraint_Evaluator : public TAO_Constraint_Evaluator
+{
+ public:
+ /// Constructor.
+ TAO_Trader_Constraint_Evaluator (CosTrading::Offer* offer,
+ CORBA::Boolean supports_dynamic_properties = 1);
+
+ virtual int visit_property (TAO_Property_Constraint* literal);
+
+ private:
+ /// Utility with which to evaluate the properties of an offer, be
+ /// they dyanmic or static.
+ TAO_Property_Evaluator prop_eval_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TRADER_CONSTRAINT_VISITOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp b/TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp
new file mode 100644
index 00000000000..60513db6b78
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp
@@ -0,0 +1,1940 @@
+// $Id$
+
+#ifndef TAO_TRADER_INTERFACES_CPP
+#define TAO_TRADER_INTERFACES_CPP
+
+#include "orbsvcs/Trader/Trader_Interfaces.h"
+#include "orbsvcs/Trader/Trader_T.h"
+#include "ace/INET_Addr.h"
+#include "orbsvcs/Trader/Trader_Constraint_Visitors.h"
+#include "ace/OS_NS_time.h"
+#include "ace/OS_NS_unistd.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+TAO_Lookup<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+TAO_Lookup (TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &trader)
+ : TAO_Trader_Components<POA_CosTrading::Lookup> (trader.trading_components ()),
+ TAO_Support_Attributes<POA_CosTrading::Lookup> (trader.support_attributes ()),
+ TAO_Import_Attributes<POA_CosTrading::Lookup> (trader.import_attributes ()),
+ IDS_SAVED (100),
+ trader_ (trader)
+{
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+TAO_Lookup<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::~TAO_Lookup (void)
+{
+ ACE_GUARD (TRADER_LOCK_TYPE, trader_mon, this->lock_);
+ for (Request_Ids::ITERATOR riter (this->request_ids_);
+ ! riter.done ();
+ riter.advance ())
+ {
+ CosTrading::Admin::OctetSeq** old_seq = 0;
+ riter.next (old_seq);
+ delete *old_seq;
+ }
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE> void
+TAO_Lookup<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+query (const char *type,
+ const char *constraint,
+ const char *preferences,
+ const CosTrading::PolicySeq &in_policies,
+ const CosTrading::Lookup::SpecifiedProps &desired_props,
+ CORBA::ULong how_many,
+ CosTrading::OfferSeq_out returned_offers,
+ CosTrading::OfferIterator_out returned_offer_iterator,
+ CosTrading::PolicyNameSeq_out returned_limits_applied
+ 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))
+{
+ // Instantiate a class to help interpret query policies.
+ TAO_Policies policies (this->trader_, in_policies ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // If a federated query returns to us, ignore it to prevent
+ // redundant results and infinite loops.
+ CosTrading::Admin::OctetSeq* request_id = 0;
+ int check = this->seen_request_id (policies, request_id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (check)
+ {
+ returned_offers = new CosTrading::OfferSeq;
+ returned_limits_applied = new CosTrading::PolicyNameSeq;
+ return;
+ }
+
+ // The presence of a link interface determines whether we should
+ // attempt to forward or propagate queries.
+ CosTrading::Link_ptr link_if =
+ this->trader_.trading_components ().link_if ();
+
+ // If the importer has specified a starting trader, foward the
+ // query.
+ CosTrading::TraderName* trader_name =
+ policies.starting_trader (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (! CORBA::is_nil (link_if) && trader_name != 0)
+ {
+ CosTrading::PolicySeq policies_to_forward;
+ policies.copy_to_forward (policies_to_forward, *trader_name);
+ const char* next_hop = (*trader_name)[0];
+ this->forward_query (next_hop,
+ type,
+ constraint,
+ preferences,
+ policies_to_forward,
+ desired_props,
+ how_many,
+ returned_offers,
+ returned_offer_iterator,
+ returned_limits_applied
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ return;
+ }
+
+ // Retrieve the type description struct from the Service Type Repos.
+ const TAO_Support_Attributes_i& support_attrs =
+ this->trader_.support_attributes ();
+ CosTradingRepos::ServiceTypeRepository_ptr rep =
+ support_attrs.service_type_repos ();
+ CosTradingRepos::ServiceTypeRepository::TypeStruct_var type_struct =
+ rep->fully_describe_type (type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ Should throw a NO_MEMORY exception here...
+ ACE_NEW (returned_offers,
+ CosTrading::OfferSeq);
+
+ // Obtain a reference to the offer database.
+ TAO_Offer_Database<MAP_LOCK_TYPE>& offer_database =
+ this->trader_.offer_database ();
+
+ // TAO_Offer_Filter -- ensures that we don't consider offers with
+ // modifiable or dynamic properties if the Trader doesn't support
+ // them, or the importer has turned them off using policies.
+ // TAO_Constraint_Validator -- validates the constraint with the
+ // property types in the supplied type. TAO_Constraint_Interpreter
+ // -- parses the constraint string, and determines whether an offer
+ // meets those constraints. TAO_Preference_Interpreter -- parses
+ // the preference string and orders offers according to those
+ // constraints.
+ TAO_Offer_Filter offer_filter (policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ TAO_Trader_Constraint_Validator validator (type_struct.in ());
+ TAO_Constraint_Interpreter constr_inter (validator,
+ constraint
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ TAO_Preference_Interpreter pref_inter (validator,
+ preferences
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Try to find the map of offers of desired service type.
+ offer_filter.configure_type (type_struct.ptr ());
+ this->lookup_one_type (type,
+ offer_database,
+ constr_inter,
+ pref_inter,
+ offer_filter);
+
+ CORBA::Boolean result = policies.exact_type_match (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (!result)
+ {
+ // If the importer hasn't demanded an exact match search, we
+ // search all the subtypes of the supplied type. NOTE: Only the
+ // properties belonging to the provided type are considered on
+ // subtypes. Additional properties on the subtype are generally
+ // ignored. This is as it should be, consistent with the notions
+ // of type inheritence.
+ this->lookup_all_subtypes (type,
+ type_struct->incarnation,
+ offer_database,
+ rep,
+ constr_inter,
+ pref_inter,
+ offer_filter
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // Take note of the limits applied in this query.
+ returned_limits_applied = offer_filter.limits_applied ();
+
+ // Fill the return sequence and iterator with the bountiful results.
+ CORBA::ULong offers_returned =
+ this->fill_receptacles (type,
+ how_many,
+ desired_props,
+ policies,
+ pref_inter,
+ *returned_offers.ptr (),
+ returned_offer_iterator
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // The following steps are only appropriate for a linked trader.
+ if (! CORBA::is_nil (link_if))
+ {
+ // Determine if we should perform a federated query, and if so
+ // construct a sequence of links to follow.
+ CosTrading::LinkNameSeq_var links;
+ CORBA::Boolean should_follow =
+ this->retrieve_links (policies,
+ offers_returned,
+ CosTrading::LinkNameSeq_out (links.out ())
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (should_follow && links->length () != 0)
+ {
+ // Query those links we've accumulated!
+ this->federated_query (links.in (),
+ policies,
+ *request_id,
+ pref_inter,
+ type,
+ constraint,
+ preferences,
+ desired_props,
+ how_many,
+ *returned_offers.ptr (),
+ returned_offer_iterator.ptr (),
+ *returned_limits_applied.ptr ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Lookup<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+lookup_one_type (const char* type,
+ TAO_Offer_Database<MAP_LOCK_TYPE>& offer_database,
+ TAO_Constraint_Interpreter& constr_inter,
+ TAO_Preference_Interpreter& pref_inter,
+ TAO_Offer_Filter& offer_filter)
+{
+ // Retrieve an iterator over the offers for a given type.
+ // @@ Would have used Offer_Database::offer_iterator for less
+ // coupling between TAO_Lookup and Offer_Database, but g++ barfs on
+ // that.
+#if defined(_MSC_VER)
+ TAO_Offer_Database<MAP_LOCK_TYPE>::offer_iterator
+ offer_iter (type, offer_database);
+#else
+ // MSVC won't grok this for some reason, but it's necessary for the
+ // HP compiler, which seriously requires the typename keyword
+ // here. I apologize if this ifdef offends some ACE users'
+ // sensibilities --- it certainly offends mine.
+ ACE_TYPENAME TAO_Offer_Database<MAP_LOCK_TYPE>::offer_iterator
+ offer_iter (type, offer_database);
+#endif
+
+ while (offer_filter.ok_to_consider_more () &&
+ offer_iter.has_more_offers ())
+ {
+ // For each offer in the iterator, attempt to match it with
+ // the constraints passed to the Query method. If it matches
+ // the constraint, use the TAO_Preference_Interpreter to
+ // order the matched offers with respect to the preference
+ // string passed to the method. All the while the offer
+ // filter ensures we don't exceed the match cardinality
+ // constraints.
+ CosTrading::Offer* offer = offer_iter.get_offer ();
+
+ TAO_Trader_Constraint_Evaluator evaluator (offer);
+ if (offer_filter.ok_to_consider (offer) &&
+ constr_inter.evaluate (evaluator))
+ {
+ // Shove the offer and its id into the preference
+ // ordering object, pref_inter.
+ CosTrading::OfferId offer_id = offer_iter.get_id ();
+ pref_inter.order_offer (evaluator, offer, offer_id);
+ offer_filter.matched_offer ();
+ }
+
+ offer_iter.next_offer ();
+ }
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Lookup<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+lookup_all_subtypes (const char* type,
+ CosTradingRepos::ServiceTypeRepository::IncarnationNumber& inc_num,
+ TAO_Offer_Database<MAP_LOCK_TYPE>& offer_database,
+ CosTradingRepos::ServiceTypeRepository_ptr rep,
+ TAO_Constraint_Interpreter& constr_inter,
+ TAO_Preference_Interpreter& pref_inter,
+ TAO_Offer_Filter& offer_filter
+ ACE_ENV_ARG_DECL)
+{
+ // BEGIN SPEC
+ // The trader may return a service offer of a subtype of the "type"
+ // requested. Sub-typing of service types is discussed in "Service
+ // Types" on page 16-4. A service subtype can be described by the
+ // properties of its supertypes. This ensures that a well-formed query
+ // for the "type" is also a well-formed query with respect to any
+ // subtypes. However, if the importer specifies the policy of
+ // exact_type_match = TRUE, then only offers with the exact (no
+ // subtype) service type requested are returned.
+ // END SPEC
+
+ CosTradingRepos::ServiceTypeRepository::SpecifiedServiceTypes sst;
+ CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq_var all_types;
+
+ // Optimization: Since a subtype can't have a higher incarnation
+ // number than a supertype, we don't need to consider those
+ // types with lower incarnation numbers.
+ sst.incarnation (inc_num);
+
+ all_types = rep->list_types (sst ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Scan all types inserted after the super types. If the transitive
+ // closure of a type's super type relation includes the super type
+ // being considered, then perform a search on that type.
+ CORBA::ULong num_types = all_types->length ();
+ CosTradingRepos::ServiceTypeRepository::TypeStruct_var type_struct;
+ for (CORBA::ULong i = 0;
+ i < num_types && offer_filter.ok_to_consider_more ();
+ i++)
+ {
+ // Obtain a description of the prospective type.
+ type_struct = rep->fully_describe_type (all_types[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq&
+ super_types = type_struct->super_types;
+ CORBA::ULong num_super_types = super_types.length ();
+
+ for (CORBA::ULong j = 0; j < num_super_types; j++)
+ {
+ if (ACE_OS::strcmp (type_struct->super_types[j], type) == 0)
+ {
+ // Egads, a subtype! This type has the type passed
+ // to query in its list of super_types.
+ offer_filter.configure_type (type_struct.ptr ());
+ this->lookup_one_type (all_types[i],
+ offer_database,
+ constr_inter,
+ pref_inter,
+ offer_filter);
+ break;
+ }
+ }
+ }
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+int
+TAO_Lookup<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+fill_receptacles (const char* /* type */,
+ CORBA::ULong how_many,
+ const CosTrading::Lookup::SpecifiedProps& desired_props,
+ TAO_Policies& policies,
+ TAO_Preference_Interpreter& pref_inter,
+ CosTrading::OfferSeq& offers,
+ CosTrading::OfferIterator_ptr& offer_itr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName))
+{
+ // BEGIN SPEC
+ // The returned offers are passed back in one of two ways (or a
+ // combination of both). ?The "offers" return result conveys a list
+ // of offers and the "offer_itr" is a reference to an interface at
+ // which offers can be obtained. ?The "how_many" parameter states
+ // how many offers are to be returned via the "offers" result, any
+ // remaining offers are available via the iterator interface. If the
+ // "how_many" exceeds the number of offers to be returned, then the
+ // "offer_itr" will be nil.
+ // END SPEC
+
+ TAO_Property_Filter prop_filter (desired_props ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // RETURNING: Calculate how many offers go into the sequence
+ // Calculate how many go into the iterator
+
+ CORBA::ULong return_card = policies.return_card (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CORBA::ULong i = 0;
+ CORBA::ULong size = static_cast<CORBA::ULong> (pref_inter.num_offers ());
+ CORBA::ULong offers_in_sequence = (how_many < size) ? how_many : size;
+ CORBA::ULong offers_in_iterator = size - offers_in_sequence;
+
+ // Ensure the total number of offers returned doesn't exceed return_card.
+ offers_in_sequence = offers_in_sequence > return_card
+ ? return_card
+ : offers_in_sequence;
+
+ return_card -= offers_in_sequence;
+
+ offers_in_iterator = offers_in_iterator > return_card
+ ? return_card
+ : offers_in_iterator;
+
+ CORBA::ULong total_offers = offers_in_sequence + offers_in_iterator;
+ offers.length (offers_in_sequence);
+
+ // Add to the sequence, filtering out the undesired properties.
+ for (i = 0; i < offers_in_sequence; i++)
+ {
+ CosTrading::Offer* offer = 0;
+ CosTrading::OfferId offer_id = 0;
+
+ // Pull the next ordered offer out of the preference
+ // interpreter.
+ pref_inter.remove_offer (offer, offer_id);
+
+ // Filter out the undesired properties.
+ prop_filter.filter_offer (offer, offers[i]);
+ CORBA::string_free (offer_id);
+ }
+
+ // Any remaining offers under the return_card go into iterator
+ if (offers_in_iterator > 0)
+ {
+ // Create an iterator implementation
+ TAO_Offer_Iterator *oi =
+ this->create_offer_iterator (prop_filter);
+
+ // Register it with the POA.
+ offer_itr = oi->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (total_offers - offers_in_iterator);
+
+ oi->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (total_offers - offers_in_iterator);
+
+ // Add to the iterator
+ for (i = 0; i < offers_in_iterator; i++)
+ {
+ CosTrading::Offer* offer = 0;
+ CosTrading::OfferId offer_id = 0;
+
+ // Pull the next ordered offer out of the preference
+ // intrerpreter and add it to the offer iterator.
+ pref_inter.remove_offer (offer, offer_id);
+ oi->add_offer (offer_id, offer);
+ }
+ }
+
+ // Clear the preference intrerpreter of superfluous items.
+ size_t num_offers = pref_inter.num_offers ();
+ for (size_t j = 0; j < num_offers; j++)
+ {
+ CosTrading::Offer* offer = 0;
+ CosTrading::OfferId offer_id = 0;
+
+ pref_inter.remove_offer (offer, offer_id);
+ CORBA::string_free (offer_id);
+ }
+
+ return total_offers;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+TAO_Offer_Iterator *
+TAO_Lookup<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+create_offer_iterator (const TAO_Property_Filter& pfilter)
+{
+ // This is the factory method that creates the appropriate type of
+ // offer iterator. If there's no Register interface, then we can
+ // just stick the offers directly into an iterator, since these
+ // offers will never be removed from the Trader. If there's a
+ // Register interface, then there's a chance that by the time the
+ // importer calls the next_n method on the iterator that the offer
+ // will have been withdrawn. So the Register_Offer_Iterator retains only
+ // the offer ids, and will recognize when an offer id no longer
+ // identifies an offer in the trader.
+
+ // We pass the property filter to the iterators, so when the iterators
+ // return the offers, they can remove the undesirable properties
+ // from those offers.
+ TAO_Offer_Iterator* iterator = 0;
+
+ if (CORBA::is_nil (this->trader_.trading_components ().register_if ()))
+ ACE_NEW_RETURN (iterator,
+ TAO_Query_Only_Offer_Iterator (pfilter),
+ 0);
+ else
+ ACE_NEW_RETURN (iterator,
+ TAO_Register_Offer_Iterator<MAP_LOCK_TYPE> (this->trader_.offer_database (),
+ pfilter),
+ 0);
+ return iterator;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CORBA::Boolean
+TAO_Lookup<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+retrieve_links (TAO_Policies& policies,
+ CORBA::ULong offers_returned,
+ CosTrading::LinkNameSeq_out links
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Lookup::PolicyTypeMismatch))
+{
+ CORBA::Boolean should_follow = 0;
+ CosTrading::FollowOption follow_rule = policies.link_follow_rule (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (should_follow);
+
+ // Determine whether or not a federated query is warranted. A query
+ // is waranted if the follow_rule governing this query is 'always'
+ // or if_no_local and the local query returned nothing.
+ if ((follow_rule == CosTrading::always ||
+ (follow_rule == CosTrading::if_no_local && offers_returned == 0)))
+ {
+ CORBA::ULong hc = policies.hop_count (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (hc > 0)
+ should_follow = 1;
+ }
+
+ if (should_follow)
+ {
+ // Grab the names of all the links in the trader, and push
+ // the suitable ones onto <valid_links>.
+ CosTrading::Link_ptr link_if =
+ this->trader_.trading_components ().link_if ();
+
+ links = link_if->list_links (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Determine which of the links registered with the Link
+ // interface are suitable to follow.
+ CORBA::ULong i = 0, j = 0,
+ length = links->length ();
+
+ for (i = 0; i < length; i++)
+ {
+ // Grab the link information.
+ CosTrading::Link::LinkInfo_var
+ link_info (link_if->describe_link (links[i] ACE_ENV_ARG_PARAMETER));
+ ACE_CHECK_RETURN (should_follow);
+
+ // Compute the link follow rule.
+ CosTrading::FollowOption link_rule =
+ policies.link_follow_rule (link_info.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (should_follow);
+
+ // Determine if the link follow rule applies.
+ if (link_rule == CosTrading::always
+ || (link_rule == CosTrading::if_no_local
+ && offers_returned == 0))
+ {
+ // Add the link to the list of links to follow.
+ if (i > j)
+ links[j] = links[i];
+
+ j++;
+ }
+ }
+
+ links->length (j);
+ }
+
+ return should_follow;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Lookup<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+federated_query (const CosTrading::LinkNameSeq& links,
+ const TAO_Policies& policies,
+ const CosTrading::Admin::OctetSeq& request_id,
+ TAO_Preference_Interpreter& pref_inter,
+ const char *type,
+ const char *constr,
+ const char *pref,
+ const CosTrading::Lookup::SpecifiedProps& desired_props,
+ CORBA::ULong how_many,
+ CosTrading::OfferSeq& offers,
+ CosTrading::OfferIterator_ptr& offer_iter,
+ CosTrading::PolicyNameSeq& limits
+ 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))
+{
+ // The general idea here is this: We've assembled a number of links
+ // to follow, and we'll query each of them in turn. On each query we
+ // adjust the policies for the new trader by reducing the hop_count,
+ // changing the link_follow_rule etc..., and merge the results from
+ // the new query with the results from the previous queries.
+
+ // We'll need the link and admin interfaces for this part of the
+ // federated query. It's ok to get the admin interface without
+ // checking if it's nil, becase the conformance criteria dictate
+ // that a trader can't implement the link interface without the
+ // admin interface.
+ CosTrading::Link_ptr link_interface
+ = this->trader_.trading_components ().link_if ();
+
+ // Begin collecting all the various offer_iterators into a
+ // collection. The end result is a distributed tree of offer
+ // iterators, which if traversed in its entirety is probably hugely
+ // inefficient, but oh well, I can't think of a better solution.
+ TAO_Offer_Iterator_Collection* offer_iter_collection = 0;
+ ACE_NEW (offer_iter_collection,
+ TAO_Offer_Iterator_Collection);
+ offer_iter_collection->add_offer_iterator (offer_iter);
+
+ CosTrading::PolicySeq policies_to_pass;
+ policies.copy_to_pass (policies_to_pass, request_id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ for (int i = links.length () - 1; i >= 0; i--)
+ {
+ CosTrading::OfferSeq *out_offers = 0;
+ CosTrading::OfferIterator *out_offer_iter = 0;
+ CosTrading::PolicyNameSeq *out_limits = 0;
+
+ ACE_TRY
+ {
+ // Obtain information about the link we're traversing.
+ CosTrading::Link::LinkInfo_var link_info =
+ link_interface->describe_link (links[i] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Set the link follow policy for the query over the link.
+ policies.copy_in_follow_option (policies_to_pass,
+ link_info.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosTrading::Lookup_var remote_lookup =
+ CosTrading::Lookup::_duplicate (link_info->target.in ());
+
+ // Perform the federated query.
+ remote_lookup->query (type,
+ constr,
+ pref,
+ policies_to_pass,
+ desired_props,
+ how_many - offers.length (),
+ CosTrading::OfferSeq_out (out_offers),
+ CosTrading::OfferIterator_out (out_offer_iter),
+ CosTrading::PolicyNameSeq_out (out_limits)
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ULong j = 0;
+ CosTrading::OfferSeq_var out_offers_var (out_offers);
+ CosTrading::PolicyNameSeq_var out_limits_var (out_limits);
+
+ // Add another iterator to the collection.
+ if (! CORBA::is_nil (out_offer_iter))
+ offer_iter_collection->add_offer_iterator (out_offer_iter);
+
+ // Concatenate the limits applied.
+ CORBA::ULong source_length = out_limits->length (),
+ target_length = limits.length (),
+ total_length = source_length + target_length;
+
+ limits.length (total_length);
+ for (j = 0; j < source_length; j++)
+ limits[j + target_length] = out_limits_var[j];
+
+ // Concatenate the sequence offers.
+ source_length = out_offers->length ();
+ target_length = offers.length ();
+ total_length = source_length + target_length;
+
+ offers.length (total_length);
+ for (j = 0; j < source_length; j++)
+ offers[j + target_length] = out_offers_var[j];
+ }
+ ACE_CATCHANY
+ {
+ // Ah, well, this query failed, move on to the next one.
+ }
+ ACE_ENDTRY;
+ // ACE_CHECK;
+ }
+
+ // Sort the sequence in preference order.
+ this->order_merged_sequence (pref_inter, offers);
+
+ // Return the collection of offer iterators.
+ offer_iter = offer_iter_collection->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ offer_iter_collection->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Lookup<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+order_merged_sequence (TAO_Preference_Interpreter& pref_inter,
+ CosTrading::OfferSeq& offers)
+{
+ CORBA::ULong j = 0;
+ CORBA::ULong length = offers.length ();
+
+ // Grab ownership of the offers already in the target sequence.
+ CosTrading::Offer* target_buf = offers.get_buffer (1);
+
+ // Order the sequence.
+ for (j = 0; j < length; j++)
+ pref_inter.order_offer (&target_buf[j]);
+ //pref_inter.order_offer (&offers[j]);
+
+ // Reallocate the sequence.
+ offers.length (length);
+
+ // CosTrading::OfferSeq copy;
+ // copy.length (length);
+
+ // Copy in the ordered offers.
+ for (j = 0; j < length; j++)
+ {
+ CosTrading::Offer* offer = 0;
+ pref_inter.remove_offer (offer);
+ //copy[j] = *offer;
+ offers[j] = *offer;
+ }
+
+ // Release the orphaned memory.
+ CosTrading::OfferSeq::freebuf (target_buf);
+ // offers = copy
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Lookup<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+forward_query (const char* next_hop,
+ const char *type,
+ const char *constr,
+ const char *pref,
+ const CosTrading::PolicySeq& policy_seq,
+ const CosTrading::Lookup::SpecifiedProps& desired_props,
+ CORBA::ULong how_many,
+ CosTrading::OfferSeq_out offers,
+ CosTrading::OfferIterator_out offer_itr,
+ CosTrading::PolicyNameSeq_out limits_applied
+ 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))
+{
+ // Forward this query to the next link in the starting_trader sequence.
+ CosTrading::Link_ptr link_interface
+ = this->trader_.trading_components ().link_if ();
+
+ ACE_TRY
+ {
+ CosTrading::Link::LinkInfo_var link_info =
+ link_interface->describe_link (next_hop ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosTrading::Lookup_var remote_lookup =
+ CosTrading::Lookup::_duplicate (link_info->target.in ());
+
+ CORBA::Object_var us = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Boolean self_loop =
+ remote_lookup->_is_equivalent (us.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (! self_loop)
+ {
+ // Perform forwarding query.
+ remote_lookup->query (type,
+ constr,
+ pref,
+ policy_seq,
+ desired_props,
+ how_many,
+ offers,
+ offer_itr,
+ limits_applied
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ this->query (type,
+ constr,
+ pref,
+ policy_seq,
+ desired_props,
+ how_many,
+ offers,
+ offer_itr,
+ limits_applied
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ CosTrading::Policy policy;
+ policy.name = TAO_Policies::POLICY_NAMES[TAO_Policies::STARTING_TRADER];
+ policy.value <<= next_hop;
+ ACE_TRY_THROW (CosTrading::Lookup::InvalidPolicyValue (policy));
+ }
+ ACE_ENDTRY;
+ // ACE_CHECK;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CORBA::Boolean
+TAO_Lookup<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+seen_request_id (TAO_Policies& policies,
+ CosTrading::Admin::OctetSeq*& seq
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Lookup::PolicyTypeMismatch))
+{
+ CORBA::Boolean return_value = 0;
+
+ seq = policies.request_id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+
+ if (seq == 0)
+ {
+ CosTrading::Admin_ptr admin_if =
+ this->trader_.trading_components ().admin_if ();
+ seq = admin_if->request_id_stem (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+ }
+ else
+ {
+ // Allocate memory so memory mangement is the same for both
+ // cases.
+ ACE_NEW_THROW_EX (seq,
+ CosTrading::Admin::OctetSeq (*seq),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (1);
+ }
+
+ ACE_GUARD_RETURN (TRADER_LOCK_TYPE, trader_mon, this->lock_, 1);
+
+ for (Request_Ids::ITERATOR riter (this->request_ids_);
+ ! riter.done ();
+ riter.advance ())
+ {
+ CosTrading::Admin::OctetSeq** old_seq = 0;
+ riter.next (old_seq);
+
+ if (**old_seq == *seq)
+ {
+ return_value = 1;
+ break;
+ }
+ }
+
+ if (return_value == 0)
+ {
+ if (this->request_ids_.size () == IDS_SAVED)
+ {
+ CosTrading::Admin::OctetSeq* octet_seq = 0;
+ this->request_ids_.dequeue_head (octet_seq);
+ delete octet_seq;
+ }
+
+ this->request_ids_.enqueue_tail (seq);
+ }
+
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+TAO_Register<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::TAO_Register (TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &trader)
+ : TAO_Trader_Components<POA_CosTrading::Register> (trader.trading_components ()),
+ TAO_Support_Attributes<POA_CosTrading::Register> (trader.support_attributes ()),
+ trader_ (trader)
+{
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+TAO_Register<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::~TAO_Register (void)
+{
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CosTrading::OfferId
+TAO_Register<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+_cxx_export (CORBA::Object_ptr reference,
+ const char *type,
+ const CosTrading::PropertySeq &properties
+ 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))
+{
+ // For robustness purposes --
+ if (CORBA::is_nil (reference))
+ ACE_THROW_RETURN (CosTrading::Register::InvalidObjectRef (), 0);
+
+ // Get service type map
+ TAO_Offer_Database<MAP_LOCK_TYPE> &offer_database = this->trader_.offer_database ();
+
+ CosTrading::Offer* offer = 0;
+ TAO_Support_Attributes_i& support_attrs =
+ this->trader_.support_attributes ();
+ CosTradingRepos::ServiceTypeRepository_ptr rep =
+ support_attrs.service_type_repos ();
+
+ // Yank our friend, the type struct, and confirm that the given
+ // properties match the type definition.
+ CosTradingRepos::ServiceTypeRepository::TypeStruct_var type_struct =
+ rep->fully_describe_type (type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Oops the type is masked, we shouldn't let exporters know the type
+ // exists.
+ if (type_struct->masked)
+ ACE_THROW_RETURN (CosTrading::UnknownServiceType (type), 0);
+
+ // TAO-specific way to determine if an object is derived from or is
+ // an interface type.
+ int check = (! reference->_is_a (type_struct->if_name ACE_ENV_ARG_PARAMETER));
+ ACE_CHECK_RETURN (0);
+ if (check)
+ ACE_THROW_RETURN (CosTrading::Register::
+ InterfaceTypeMismatch (type, reference), 0);
+
+ // Validate that the properties defined for this offer are correct
+ // to their types and strength.
+ this->validate_properties (type, type_struct.ptr (), properties ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // CORBA::ULong plength = properties.length ();
+ ACE_NEW_THROW_EX (offer, CosTrading::Offer, CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ // No copying, no memory leaks. Violates the "in" parameter semantics
+ // when this object is colocated with the client, however.
+ // CosTrading::PropertySeq* hack_seq =
+ // const_cast<CosTrading::PropertySeq*> (&properties);
+ // CosTrading::Property* pbuf = hack_seq->get_buffer (1);
+
+ // CosTrading::PropertySeq* hack_seq =
+ // const_cast<CosTrading::PropertySeq*> (&properties);
+ // CosTrading::Property* pbuf = hack_seq->get_buffer (0);
+ // offer->properties.replace (plength, plength, pbuf, 0);
+ // offer->properties._allocate_buffer (plength);
+ offer->properties = properties;
+ offer->reference = reference->_duplicate (reference);
+
+ // Insert the offer into the underlying type map.
+ CosTrading::OfferId id = offer_database.insert_offer (type, offer);
+
+ return id;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Register<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+withdraw (const char *id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId,
+ CosTrading::Register::ProxyOfferId))
+{
+ // Get service type map.
+ TAO_Offer_Database<MAP_LOCK_TYPE> &offer_database = this->trader_.offer_database ();
+ offer_database.remove_offer ((CosTrading::OfferId) id ACE_ENV_ARG_PARAMETER);
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CosTrading::Register::OfferInfo *
+TAO_Register<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+describe (const char *id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId,
+ CosTrading::Register::ProxyOfferId))
+{
+ // Get service type map.
+ char* type = 0;
+ TAO_Offer_Database<MAP_LOCK_TYPE> &offer_database = this->trader_.offer_database ();
+
+ // Perform a lookup to find the offer.
+ CosTrading::Offer* offer =
+ offer_database.lookup_offer ((CosTrading::OfferId) id, type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CosTrading::Register::OfferInfo *offer_info = 0;
+ ACE_NEW_THROW_EX (offer_info, CosTrading::Register::OfferInfo, CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ offer_info->reference = CORBA::Object::_duplicate (offer->reference.in ());
+ offer_info->type = CORBA::string_dup (type);
+
+ // Let the offer_info prop_seq "borrow" the sequence of properties.
+ //CORBA::ULong length = offer->properties.length ();
+ // CosTrading::Property* prop_buf = offer->properties.get_buffer ();
+ offer_info->properties = offer->properties;
+
+ return offer_info;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Register<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+modify (const char *id,
+ const CosTrading::PropertyNameSeq& del_list,
+ const CosTrading::PropertySeq& modify_list
+ ACE_ENV_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))
+{
+ // Throw an exception if the trader is not configured
+ // to support properties modification.
+ int check = (! this->supports_modifiable_properties (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+
+ if (check)
+ ACE_THROW (CosTrading::NotImplemented ());
+
+ char* type = 0;
+ TAO_Support_Attributes_i& support_attrs =
+ this->trader_.support_attributes ();
+ CosTradingRepos::ServiceTypeRepository_ptr rep =
+ support_attrs.service_type_repos ();
+ TAO_Offer_Database<MAP_LOCK_TYPE> &offer_database = this->trader_.offer_database ();
+
+ CosTrading::Offer* offer = offer_database.
+ lookup_offer (const_cast<CosTrading::OfferId> (id), type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (offer != 0)
+ {
+ // Yank our friend, the type struct.
+ CosTradingRepos::ServiceTypeRepository::TypeStruct_var type_struct =
+ rep->fully_describe_type (type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ TAO_Offer_Modifier offer_mod (type, type_struct.in (), offer);
+
+ // Delete, add, and change properties of the offer.
+ offer_mod.delete_properties (del_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ offer_mod.merge_properties (modify_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Alter our reference to the offer. We do this last, since the
+ // spec says: modify either suceeds completely or fails
+ // completely.
+ offer_mod.affect_change (modify_list);
+ }
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Register<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+withdraw_using_constraint (const char *type,
+ const char *constr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::IllegalConstraint,
+ CosTrading::Register::NoMatchingOffers))
+{
+ TAO_Support_Attributes_i&
+ support_attrs = this->trader_.support_attributes ();
+ CosTradingRepos::ServiceTypeRepository_ptr rep =
+ support_attrs.service_type_repos ();
+ TAO_Offer_Database<MAP_LOCK_TYPE> &offer_database = this->trader_.offer_database ();
+ CORBA::Boolean dp_support = support_attrs.supports_dynamic_properties ();
+ TAO_String_Queue ids;
+
+ // Retrieve the type struct
+ CosTradingRepos::ServiceTypeRepository::TypeStruct_var type_struct =
+ rep->fully_describe_type (type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Try to find the map of offers of desired service type.
+ // @@ Again, should be Offer_Database::offer_iterator
+ {
+#if defined (_MSC_VER)
+ TAO_Offer_Database<MAP_LOCK_TYPE>::offer_iterator
+ offer_iter (type, offer_database);
+#else
+ // MSVC won't grok this for some reason, but it's necessary for
+ // the HP compiler, which seriously requires the typename keyword
+ // here. I apologize if this ifdef offends some ACE users'
+ // sensibilities --- it certainly offends mine.
+ ACE_TYPENAME TAO_Offer_Database<MAP_LOCK_TYPE>::offer_iterator
+ offer_iter (type, offer_database);
+#endif /* _MSC_VER */
+
+ TAO_Trader_Constraint_Validator validator (type_struct.in ());
+ TAO_Constraint_Interpreter constr_inter (validator, constr ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ while (offer_iter.has_more_offers ())
+ {
+ CosTrading::Offer* offer = offer_iter.get_offer ();
+ // Add offer if it matches the constraints
+
+ TAO_Trader_Constraint_Evaluator evaluator (offer, dp_support);
+ if (constr_inter.evaluate (evaluator))
+ ids.enqueue_tail (offer_iter.get_id ());
+
+ offer_iter.next_offer ();
+ }
+ }
+
+ if (ids.size () != 0)
+ {
+ while (! ids.is_empty ())
+ {
+ char* offer_id = 0;
+
+ ids.dequeue_head (offer_id);
+ offer_database.remove_offer (offer_id ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ CORBA::string_free (offer_id);
+ }
+ }
+ else
+ ACE_THROW (CosTrading::Register::NoMatchingOffers (constr));
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CosTrading::Register_ptr
+TAO_Register<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+resolve (const CosTrading::TraderName &name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Register::IllegalTraderName,
+ CosTrading::Register::UnknownTraderName,
+ CosTrading::Register::RegisterNotSupported))
+{
+ // Determine if the first link is a legal link name.
+ if (! TAO_Trader_Base::is_valid_link_name (name[0]))
+ ACE_THROW_RETURN (CosTrading::Register::IllegalTraderName (name),
+ CosTrading::Register::_nil ());
+
+ // Grab a reference to the link interface, and get a link description.
+ CosTrading::Link_ptr link_if =
+ this->trader_.trading_components ().link_if ();
+
+ // Ensure that the link interface is supported.
+ if (! CORBA::is_nil (link_if))
+ return CosTrading::Register::_nil ();
+
+ CosTrading::Link::LinkInfo_var link_info;
+ CosTrading::Register_var remote_reg;
+
+ ACE_TRY
+ {
+ // Ensure that the link to the next trader exists.
+ link_info = link_if->describe_link (name[0] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ remote_reg =
+ CosTrading::Register::_narrow (link_info->target_reg.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_TRY_THROW (CosTrading::Register::UnknownTraderName (name));
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (CosTrading::Register::_nil ());
+
+ // Ensure that the register pointer isn't nil.
+ if (! CORBA::is_nil (remote_reg.in ()))
+ ACE_THROW_RETURN (CosTrading::Register::RegisterNotSupported (name),
+ CosTrading::Register::_nil ());
+
+ CosTrading::Register_ptr return_value = remote_reg.in ();
+
+ if (name.length () > 1)
+ {
+ // Create a new Trader Name with the first link removed.
+ CosTrading::TraderName trader_name (name.length () - 1);
+ for (int i = trader_name.length () - 1; i >= 0; i--)
+ trader_name[i] = name[i + 1];
+
+ return_value = remote_reg->resolve (trader_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosTrading::Register::_nil ());
+ }
+
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Register<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+validate_properties (const char* type,
+ const CosTradingRepos::ServiceTypeRepository::TypeStruct* type_struct,
+ const CosTrading::PropertySeq& properties
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalPropertyName,
+ CosTrading::PropertyTypeMismatch,
+ CosTrading::ReadonlyDynamicProperty,
+ CosTrading::MissingMandatoryProperty,
+ CosTrading::DuplicatePropertyName))
+{
+ CORBA::ULong length = properties.length ();
+ const CosTradingRepos::ServiceTypeRepository::PropStructSeq&
+ prop_types = type_struct->props;
+ TAO_Property_Evaluator_By_Name prop_eval (properties ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Perform property validation
+ length = prop_types.length ();
+
+ for (CORBA::ULong i = 0; i < length; i++)
+ {
+ const CosTradingRepos::ServiceTypeRepository::PropStruct&
+ prop_struct = prop_types[i];
+ const char* prop_name = prop_struct.name;
+
+ // Obtain the type of the exported property.
+ CORBA::TypeCode_var prop_type = prop_eval.property_type (prop_name);
+
+ if (CORBA::is_nil (prop_type.in ()))
+ {
+ // Offer cannot have a missing mandatory property.
+ if (prop_types[i].mode ==
+ CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY)
+ ACE_THROW (CosTrading::MissingMandatoryProperty (type, prop_name));
+ }
+ else
+ {
+ int check =
+ (! prop_type->equal (prop_struct.value_type.in ()
+ ACE_ENV_ARG_PARAMETER));
+ ACE_CHECK;
+ if (check)
+ {
+ // Offer cannot redefine the type of an property.
+ const CosTrading::Property* prop =
+ prop_eval.get_property (prop_name);
+ ACE_THROW (CosTrading::PropertyTypeMismatch (type, *prop));
+ }
+ else if (prop_struct.mode ==
+ CosTradingRepos::ServiceTypeRepository::PROP_READONLY &&
+ prop_eval.is_dynamic_property (prop_name))
+ ACE_THROW (CosTrading::ReadonlyDynamicProperty (type, prop_name));
+ }
+ }
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+TAO_Admin (TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &trader)
+ : TAO_Trader_Components <POA_CosTrading::Admin> (trader.trading_components ()),
+ TAO_Support_Attributes <POA_CosTrading::Admin> (trader.support_attributes ()),
+ TAO_Import_Attributes <POA_CosTrading::Admin> (trader.import_attributes ()),
+ TAO_Link_Attributes <POA_CosTrading::Admin> (trader.link_attributes ()),
+ trader_ (trader),
+ sequence_number_ (0)
+{
+ // A random 4-bytes will prefix the sequence number space for each
+ // trader, making it extremely unlikely that the sequence spaces for
+ // two traders will over lap. @@ TODO: This is a bad way to
+ // generate pseudo random numbers.
+
+ // Ok, then, Carlos, we'll do it a different way: ip addr + pid.
+ ACE_UINT32 ip_addr = 0;
+ ACE_TCHAR host_name[BUFSIZ];
+
+ if (ACE_OS::hostname (host_name,
+ BUFSIZ) != -1)
+ {
+ ACE_INET_Addr addr ((u_short) 0, host_name);
+ ip_addr = addr.get_ip_address ();
+ }
+ // The better way to do unique stem identifiers.
+ this->stem_id_.length (12);
+
+ if (ip_addr != 0)
+ {
+ pid_t pid = ACE_OS::getpid ();
+ this->stem_id_[0] = static_cast<CORBA::Octet> ((ip_addr >> 24) & 0xff);
+ this->stem_id_[1] = static_cast<CORBA::Octet> ((ip_addr >> 16) & 0xff);
+ this->stem_id_[2] = static_cast<CORBA::Octet> ((ip_addr >> 8) & 0xff);
+ this->stem_id_[3] = static_cast<CORBA::Octet> (ip_addr & 0xff);
+ this->stem_id_[4] = static_cast<CORBA::Octet> ((pid >> 24) & 0xff);
+ this->stem_id_[5] = static_cast<CORBA::Octet> ((pid >> 16) & 0xff);
+ this->stem_id_[6] = static_cast<CORBA::Octet> ((pid >> 8) & 0xff);
+ this->stem_id_[7] = static_cast<CORBA::Octet> (pid & 0xff);
+ }
+
+ // The default way -- eight random integers.
+ else
+ {
+ time_t time_value = ACE_OS::time ();
+ ACE_OS::srand (static_cast<u_int> (time_value));
+
+ this->stem_id_[0] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256);
+ this->stem_id_[1] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256);
+ this->stem_id_[2] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256);
+ this->stem_id_[3] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256);
+ this->stem_id_[4] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256);
+ this->stem_id_[5] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256);
+ this->stem_id_[6] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256);
+ this->stem_id_[7] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256);
+ }
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::~TAO_Admin (void)
+{
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CosTrading::Admin::OctetSeq *
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::request_id_stem (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD_RETURN (TRADER_LOCK_TYPE, trader_mon, this->lock_, 0);
+
+ // Add one to the sequence_number and concatenate it to the unique
+ // prefix. The sequence number is four octets long, the unique
+ // prefix, also 4 bytes long.
+
+ this->stem_id_[8] = static_cast<CORBA::Octet> (this->sequence_number_ & 0xff);
+ this->stem_id_[9] = static_cast<CORBA::Octet> ((this->sequence_number_ >> 8) & 0xff);
+ this->stem_id_[10] = static_cast<CORBA::Octet> ((this->sequence_number_ >> 16) & 0xff);
+ this->stem_id_[11] = static_cast<CORBA::Octet> ((this->sequence_number_ >> 24) & 0xff);
+
+ // Increment the sequence number and return a copy of the stem_id.
+ this->sequence_number_++;
+ return new CosTrading::Admin::OctetSeq (this->stem_id_);
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CORBA::ULong
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_def_search_card (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong return_value =
+ this->trader_.import_attributes ().def_search_card ();
+
+ this->trader_.import_attributes ().def_search_card (value);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CORBA::ULong
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_max_search_card (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong return_value =
+ this->trader_.import_attributes ().max_search_card ();
+
+ this->trader_.import_attributes ().max_search_card (value);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CORBA::ULong
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_def_match_card (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong return_value =
+ this->trader_.import_attributes ().def_match_card ();
+
+ this->trader_.import_attributes ().def_match_card (value);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CORBA::ULong
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_max_match_card (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong return_value =
+ this->trader_.import_attributes ().max_match_card ();
+
+ this->trader_.import_attributes ().max_match_card (value);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CORBA::ULong
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_def_return_card (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong return_value =
+ this->trader_.import_attributes ().def_return_card ();
+
+ this->trader_.import_attributes ().def_return_card (value);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CORBA::ULong
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_max_return_card (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong return_value =
+ this->trader_.import_attributes ().max_return_card ();
+
+ this->trader_.import_attributes ().max_return_card (value);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CORBA::ULong
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_max_list (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong return_value =
+ this->trader_.import_attributes ().max_list ();
+
+ this->trader_.import_attributes ().max_list (value);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CORBA::Boolean
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_supports_modifiable_properties (CORBA::Boolean value
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Boolean return_value =
+ this->trader_.support_attributes ().supports_modifiable_properties ();
+
+ this->trader_.support_attributes ().supports_modifiable_properties (value);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CORBA::Boolean
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_supports_dynamic_properties (CORBA::Boolean value
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Boolean return_value =
+ this->trader_.support_attributes ().supports_dynamic_properties ();
+
+ this->trader_.support_attributes ().supports_dynamic_properties (value);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CORBA::Boolean
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_supports_proxy_offers (CORBA::Boolean value
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Boolean return_value =
+ this->trader_.support_attributes ().supports_proxy_offers ();
+
+ this->trader_.support_attributes ().supports_proxy_offers (value);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CORBA::ULong
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_def_hop_count (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong return_value =
+ this->trader_.import_attributes ().def_hop_count ();
+
+ this->trader_.import_attributes ().def_hop_count (value);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CORBA::ULong
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_max_hop_count (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::ULong return_value =
+ this->trader_.import_attributes ().max_hop_count ();
+
+ this->trader_.import_attributes ().max_hop_count (value);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CosTrading::FollowOption
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_def_follow_policy (CosTrading::FollowOption policy
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosTrading::FollowOption return_value =
+ this->trader_.import_attributes ().def_follow_policy ();
+
+ this->trader_.import_attributes ().def_follow_policy (policy);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CosTrading::FollowOption
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_max_follow_policy (CosTrading::FollowOption policy
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosTrading::FollowOption return_value =
+ this->trader_.import_attributes ().max_follow_policy ();
+
+ this->trader_.import_attributes ().max_follow_policy (policy);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CosTrading::FollowOption
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_max_link_follow_policy (CosTrading::FollowOption policy
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosTrading::FollowOption return_value =
+ this->trader_.link_attributes ().max_link_follow_policy ();
+
+ this->trader_.link_attributes ().max_link_follow_policy (policy);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CosTrading::TypeRepository_ptr
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_type_repos (CosTrading::TypeRepository_ptr repository
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosTrading::TypeRepository_ptr return_value =
+ this->trader_.support_attributes ().type_repos ();
+
+ this->trader_.support_attributes ().type_repos (repository);
+ return return_value;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CosTrading::Admin::OctetSeq*
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+set_request_id_stem (const CosTrading::Admin::OctetSeq& stem
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD_RETURN (TRADER_LOCK_TYPE, trader_mon, this->lock_,
+ &this->stem_id_);
+ this->stem_id_ = stem;
+ return &this->stem_id_;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+list_offers (CORBA::ULong how_many,
+ CosTrading::OfferIdSeq_out ids,
+ CosTrading::OfferIdIterator_out id_itr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, CosTrading::NotImplemented))
+{
+ // This method only applies when the register interface is implemented
+ if (CORBA::is_nil (this->trader_.trading_components().register_if()))
+ ACE_THROW (CosTrading::NotImplemented());
+
+ TAO_Offer_Database<MAP_LOCK_TYPE>& type_map = this->trader_.offer_database ();
+ TAO_Offer_Id_Iterator* offer_id_iter = type_map.retrieve_all_offer_ids ();
+
+ id_itr = CosTrading::OfferIdIterator::_nil ();
+ if (how_many > 0)
+ {
+ int check = offer_id_iter->next_n (how_many, ids ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (check == 1)
+ {
+ id_itr = offer_id_iter->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ offer_id_iter->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ delete offer_id_iter;
+ }
+ else
+ ids = new CosTrading::OfferIdSeq (0);
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+list_proxies (CORBA::ULong,
+ CosTrading::OfferIdSeq_out,
+ CosTrading::OfferIdIterator_out
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::NotImplemented))
+{
+ ACE_THROW (CosTrading::NotImplemented ());
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+TAO_Link<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::TAO_Link (TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &trader)
+ : TAO_Trader_Components <POA_CosTrading::Link> (trader.trading_components ()),
+ TAO_Support_Attributes <POA_CosTrading::Link> (trader.support_attributes ()),
+ TAO_Link_Attributes <POA_CosTrading::Link> (trader.link_attributes ()),
+ trader_ (trader)
+{
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+TAO_Link<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::~TAO_Link (void)
+{
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Link<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>::
+add_link (const char *name,
+ CosTrading::Lookup_ptr target,
+ CosTrading::FollowOption def_pass_on_follow_rule,
+ CosTrading::FollowOption limiting_follow_rule
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Link::IllegalLinkName,
+ CosTrading::Link::DuplicateLinkName,
+ CosTrading::InvalidLookupRef,
+ CosTrading::Link::DefaultFollowTooPermissive,
+ CosTrading::Link::LimitingFollowTooPermissive))
+{
+ // Ensure the link name is valid.
+ if (! TAO_Trader_Base::is_valid_link_name (name))
+ ACE_THROW (CosTrading::Link::IllegalLinkName (name));
+
+ // Ensure this isn't a duplicate link name.
+ CORBA::String_var link_name (name);
+ if (this->links_.find (link_name) == 0)
+ ACE_THROW (CosTrading::Link::DuplicateLinkName (name));
+
+ // Ensure the lookup_ptr isn't nil.
+ if (CORBA::is_nil (target))
+ ACE_THROW (CosTrading::InvalidLookupRef (target));
+
+ // Ensure that the default link behavior isn't stronger than the
+ // limiting link behavior.
+ if (def_pass_on_follow_rule > limiting_follow_rule)
+ ACE_THROW (CosTrading::Link::DefaultFollowTooPermissive
+ (def_pass_on_follow_rule, limiting_follow_rule));
+
+ // Ensure that the limiting link behavior for this link doesn't
+ // exceed the maximum allowed for a link.
+ CosTrading::FollowOption follow_policy =
+ this->max_link_follow_policy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ if (limiting_follow_rule < follow_policy)
+ ACE_THROW (CosTrading::Link::LimitingFollowTooPermissive
+ (limiting_follow_rule, follow_policy));
+
+ // Create a link info structure for this link of the federation.
+ CosTrading::Link::LinkInfo link_info;
+
+ link_info.target = CosTrading::Lookup::_duplicate (target);
+
+ link_info.def_pass_on_follow_rule = def_pass_on_follow_rule;
+ link_info.limiting_follow_rule = limiting_follow_rule;
+ ACE_CHECK;
+
+ // Insert this link into the collection of links.
+ this->links_.bind (link_name, link_info);
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Link<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+remove_link (const char *name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Link::IllegalLinkName,
+ CosTrading::Link::UnknownLinkName))
+{
+ // Ensure the link name is valid.
+ if (! TAO_Trader_Base::is_valid_link_name (name))
+ ACE_THROW (CosTrading::Link::IllegalLinkName (name));
+
+ // Ensure this isn't a duplicate link name.
+ CORBA::String_var link_name (name);
+ if (this->links_.find (link_name) == -1)
+ ACE_THROW (CosTrading::Link::UnknownLinkName (name));
+
+ // Erase the link state from the map.
+ this->links_.unbind (link_name);
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CosTrading::Link::LinkInfo *
+TAO_Link<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::describe_link (const char *name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Link::IllegalLinkName,
+ CosTrading::Link::UnknownLinkName))
+{
+ // Ensure the link name is valid.
+ if (! TAO_Trader_Base::is_valid_link_name (name))
+ ACE_THROW_RETURN (CosTrading::Link::IllegalLinkName (name), 0);
+
+ // Ensure this isn't a duplicate link name.
+ ACE_TYPENAME Links::ENTRY* link_entry = 0;
+ CORBA::String_var link_name (name);
+ if (this->links_.find (link_name, link_entry) == -1)
+ ACE_THROW_RETURN (CosTrading::Link::UnknownLinkName (name),
+ 0);
+
+ // Build a new Link Info structure.
+ CosTrading::Link::LinkInfo* new_link_info = 0;
+ CosTrading::Link::LinkInfo& old_link_info = link_entry->int_id_;
+
+ ACE_NEW_THROW_EX (new_link_info,
+ CosTrading::Link::LinkInfo,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ new_link_info->def_pass_on_follow_rule = old_link_info.def_pass_on_follow_rule;
+ new_link_info->limiting_follow_rule = old_link_info.limiting_follow_rule;
+
+ new_link_info->target = old_link_info.target;
+
+ // Delayed retrieval of register interface.
+ // This avoids the nested upcall that would occur were we to invoke
+ // this method in the add_link method.
+
+ new_link_info->target_reg = old_link_info.target->register_if (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (new_link_info);
+
+ // return the link information for this link name.
+ return new_link_info;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CosTrading::LinkNameSeq*
+TAO_Link<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::list_links (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Allocate space for the link names.
+ size_t size = this->links_.current_size ();
+ CORBA::ULong i = 0;
+ CosTrading::LinkName* link_seq =
+ CosTrading::LinkNameSeq::allocbuf (static_cast<CORBA::ULong> (size));
+
+ // Copy the link names into the buffer.
+ for (ACE_TYPENAME Links::iterator links_iter (this->links_);
+ ! links_iter.done ();
+ links_iter++)
+ link_seq[i++] = CORBA::string_dup ((*links_iter).ext_id_.in ());
+
+ // Return a sequence of the buf names.
+ return new CosTrading::LinkNameSeq (i, i, link_seq, 1);
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Link<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+modify_link (const char *name,
+ CosTrading::FollowOption def_pass_on_follow_rule,
+ CosTrading::FollowOption limiting_follow_rule
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::Link::IllegalLinkName,
+ CosTrading::Link::UnknownLinkName,
+ CosTrading::Link::DefaultFollowTooPermissive,
+ CosTrading::Link::LimitingFollowTooPermissive))
+{
+ // Ensure the link name is valid.
+ if (! TAO_Trader_Base::is_valid_link_name (name))
+ ACE_THROW (CosTrading::Link::IllegalLinkName (name));
+
+ // Ensure this isn't a duplicate link name.
+ ACE_TYPENAME Links::ENTRY* link_entry = 0;
+ CORBA::String_var link_name (name);
+ if (this->links_.find (link_name, link_entry) == -1)
+ ACE_THROW (CosTrading::Link::UnknownLinkName (name));
+
+ // Ensure that the default link behavior isn't stronger than the
+ // limiting link behavior.
+ if (def_pass_on_follow_rule > limiting_follow_rule)
+ ACE_THROW (CosTrading::Link::DefaultFollowTooPermissive
+ (def_pass_on_follow_rule, limiting_follow_rule));
+
+ // Ensure that the limiting link behavior for this link doesn't
+ // exceed the maximum allowed for a link.
+ CosTrading::FollowOption follow_policy =
+ this->max_link_follow_policy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (limiting_follow_rule < follow_policy)
+ ACE_THROW (CosTrading::Link::LimitingFollowTooPermissive
+ (limiting_follow_rule, follow_policy));
+
+ // Adjust the link settings
+ CosTrading::Link::LinkInfo& link_info = link_entry->int_id_;
+ link_info.def_pass_on_follow_rule = def_pass_on_follow_rule;
+ link_info.limiting_follow_rule = limiting_follow_rule;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+TAO_Proxy<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+TAO_Proxy (TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &trader)
+ : TAO_Trader_Components <POA_CosTrading::Proxy> (trader.trading_components ()),
+ TAO_Support_Attributes <POA_CosTrading::Proxy> (trader.support_attributes ()),
+ trader_ (trader)
+{
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+TAO_Proxy<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::~TAO_Proxy (void)
+{
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CosTrading::OfferId
+TAO_Proxy<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+export_proxy (CosTrading::Lookup_ptr,
+ const char *,
+ const CosTrading::PropertySeq&,
+ CORBA::Boolean,
+ const char *,
+ const CosTrading::PolicySeq&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::InvalidLookupRef,
+ CosTrading::IllegalPropertyName,
+ CosTrading::PropertyTypeMismatch,
+ CosTrading::ReadonlyDynamicProperty,
+ CosTrading::MissingMandatoryProperty,
+ CosTrading::Proxy::IllegalRecipe,
+ CosTrading::DuplicatePropertyName,
+ CosTrading::DuplicatePolicyName))
+{
+ ACE_THROW_RETURN (CORBA::UNKNOWN (), 0);
+
+ return 0;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Proxy<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+withdraw_proxy (const char *
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId,
+ CosTrading::Proxy::NotProxyOfferId))
+{
+ ACE_THROW (CORBA::UNKNOWN ());
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+CosTrading::Proxy::ProxyInfo *
+TAO_Proxy<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+describe_proxy (const char *
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId,
+ CosTrading::Proxy::NotProxyOfferId))
+{
+ ACE_THROW_RETURN (CORBA::UNKNOWN (), 0);
+
+ return 0;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+void
+TAO_Proxy<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>::
+list_proxies (CORBA::ULong,
+ CosTrading::OfferIdSeq*&,
+ CosTrading::OfferIdIterator_ptr&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::NotImplemented))
+{
+ ACE_THROW (CORBA::UNKNOWN ());
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_TRADER_INTERFACES_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.h b/TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.h
new file mode 100644
index 00000000000..2b1db71d3bc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.h
@@ -0,0 +1,1019 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Trader_Interfaces.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ * @author Irfan Pyarali <irfan@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_TRADER_INTERFACES_H
+#define TAO_TRADER_INTERFACES_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Trader/Trader_Utils.h"
+#include "orbsvcs/Trader/Constraint_Interpreter.h"
+#include "orbsvcs/Trader/Offer_Iterators_T.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Hack because g++ forced this inane circular dependecy!
+
+class TAO_Constraint_Interpreter;
+class TAO_Constraint_Evaluator;
+class TAO_Constraint_Validator;
+class TAO_Preference_Interpreter;
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE> class TAO_Lookup;
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE> class TAO_Register;
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE> class TAO_Admin;
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE> class TAO_Proxy;
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE> class TAO_Link;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include "orbsvcs/Trader/Trader_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Lookup
+ *
+ * @brief This class implements CosTrading::Lookup IDL interface.
+ */
+template<class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+class TAO_Lookup :
+ public TAO_Trader_Components<POA_CosTrading::Lookup>,
+ public TAO_Support_Attributes<POA_CosTrading::Lookup>,
+ public TAO_Import_Attributes<POA_CosTrading::Lookup>
+{
+public:
+
+ TAO_Lookup (TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &trader);
+
+ ~TAO_Lookup (void);
+
+ virtual void
+ query (const char *type,
+ const char *constr,
+ const char *pref,
+ const CosTrading::PolicySeq& policies,
+ const CosTrading::Lookup::SpecifiedProps& desired_props,
+ CORBA::ULong how_many,
+ CosTrading::OfferSeq_out offers,
+ CosTrading::OfferIterator_out offer_itr,
+ CosTrading::PolicyNameSeq_out limits_applied
+ 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));
+
+ // BEGIN SPEC
+ // The query operation is the means by which an object can obtain
+ // references to other objects that provide services meeting its
+ // requirements.
+
+ // The "type" parameter conveys the required service type. It is key
+ // to the central purpose of trading: to perform an introduction for
+ // future type safe interactions between importer and exporter. By
+ // stating a service type, the importer implies the desired interface
+ // type and a domain of discourse for talking about properties of the
+ // service.
+
+ // The trader may return a service offer of a subtype of the "type"
+ // requested. Sub-typing of service types is discussed in "Service
+ // Types" on page 16-4. A service subtype can be described by the
+ // properties of its supertypes. This ensures that a well-formed
+ // query for the "type" is also a well-formed query with respect to
+ // any subtypes. However, if the importer specifies the policy of
+ // exact_type_match = TRUE, then only offers with the exact (no
+ // subtype) service type requested are returned.
+
+ // The constraint "constr" is the means by which the importer states
+ // those requirements of a service that are not captured in the
+ // signature of the interface. These requirements deal with the
+ // computational behavior of the desired service, non-functional
+ // aspects, and non-computational aspects (such as the organization
+ // owning the objects that provide the service). An importer is
+ // always guaranteed that any returned offer satisfies the matching
+ // constraint at the time of import. If the "constr" does not obey
+ // the syntax rules for a legal constraint expression, then an
+ // IllegalConstraint exception is raised.
+
+ // The "pref" parameter is also used to order those offers that
+ // match the "constr" so that the offers returned by the trader are
+ // in the order of greatest interest to the importer. If "pref" does
+ // not obey the syntax rules for a legal preference expression, then
+ // an IllegalPreference exception is raised.
+
+ // The "policies" parameter allows the importer to specify how the
+ // search should be performed as opposed to what sort of services
+ // should be found in the course of the search. This can be viewed
+ // as parameterizing the algorithms within the trader
+ // implementation. The "policies" are a sequence of name-value
+ // pairs. The names available to an importer depend on the
+ // implementation of the trader. However, some names are
+ // standardized where they effect the interpretation of other
+ // parameters or where they may impact linking and federation of
+ // traders.
+
+ // The "desired_props" parameter defines the set of properties
+ // describing returned offers that are to be returned with the
+ // object reference. There are three possibilities, the importer
+ // wants one of the properties, all of the properties (but without
+ // having to name them), or some properties (the names of which are
+ // provided).
+
+ // The desired_props parameter does not affect whether or not a
+ // service offer is returned. To avoid "missing" desired properties,
+ // the importer should specify "exists prop_name" in the
+ // constraint.
+
+ // The returned offers are passed back in one of two ways (or a
+ // combination of both). °The "offers" return result conveys a list
+ // of offers and the "offer_itr" is a reference to an interface at
+ // which offers can be obtained. The "how_many" parameter states
+ // how many offers are to be returned via the "offers" result, any
+ // remaining offers are available via the iterator interface. If the
+ // "how_many" exceeds the number of offers to be returned, then the
+ // "offer_itr" will be nil.
+
+ // If any cardinality or other limits were applied by one or more
+ // traders in responding to a particular query, then the
+ // "limits_applied" parameter will contain the names of the policies
+ // which limited the query. The sequence of names returned in
+ // "limits_applied" from any federated or proxy queries must be
+ // concatenated onto the names of limits applied locally and
+ // returned.
+ // END SPEC
+
+private:
+
+ /// Factory method for creating an appropriate Offer Iterator based
+ /// on the presence of the Register Interface.
+ TAO_Offer_Iterator* create_offer_iterator (const TAO_Property_Filter&);
+
+ /// Traverse the type hierarchy to pull the matching offers from all
+ /// subtypes of the root type.
+ void lookup_all_subtypes (const char* type,
+ CosTradingRepos::ServiceTypeRepository::IncarnationNumber& inc_num,
+ TAO_Offer_Database<MAP_LOCK_TYPE>& offer_database,
+ CosTradingRepos::ServiceTypeRepository_ptr rep,
+ TAO_Constraint_Interpreter& constr_inter,
+ TAO_Preference_Interpreter& pref_inter,
+ TAO_Offer_Filter& offer_filter
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Check if offers of a type fit the constraints and order them
+ /// according to the preferences submitted.
+ void lookup_one_type (const char* type,
+ TAO_Offer_Database<MAP_LOCK_TYPE>& offer_database,
+ TAO_Constraint_Interpreter& constr_inter,
+ TAO_Preference_Interpreter& pref_inter,
+ TAO_Offer_Filter& offer_filter);
+
+ /**
+ * This method takes the list of ordered offers and places a number
+ * of them in the sequence of returned offers and the rest into thr
+ * iterator. In addition, fill_receptacles uses the
+ * TAO_Property_Filter to ensure the returned offers contain the
+ * properties specified in the desired_props in parameter.
+ */
+ int fill_receptacles (const char *,
+ CORBA::ULong how_many,
+ const CosTrading::Lookup::SpecifiedProps& desired_props,
+ TAO_Policies& policies,
+ TAO_Preference_Interpreter& pref_inter,
+ CosTrading::OfferSeq& offers,
+ CosTrading::OfferIterator_ptr& offer_itr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName));
+
+ /// If a starting_trader policy was specfied, foward the query to the
+ /// next link in the sequence.
+ void forward_query (const char* next_hop,
+ const char *type,
+ const char *constr,
+ const char *pref,
+ const CosTrading::PolicySeq& policy_seq,
+ const CosTrading::Lookup::SpecifiedProps& desired_props,
+ CORBA::ULong how_many,
+ CosTrading::OfferSeq_out offers,
+ CosTrading::OfferIterator_out offer_itr,
+ CosTrading::PolicyNameSeq_out limits_applied
+ 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));
+
+ /**
+ * Assemble a sequence of links that the federate_query method
+ * should follow. Use the starting_trader policy, if one's provided,
+ * otherwise use the Link interface to determine which of the
+ * registered links should be followed in this query.
+ */
+ CORBA::Boolean retrieve_links (TAO_Policies& policies,
+ CORBA::ULong offer_returned,
+ CosTrading::LinkNameSeq_out links
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Lookup::PolicyTypeMismatch));
+
+ /**
+ * Perform and pass on a query over a set of links. Merge the
+ * results of the federated queries into a single set of results
+ * suitable for returning to the user.
+ */
+ void federated_query (const CosTrading::LinkNameSeq& links,
+ const TAO_Policies& policies,
+ const CosTrading::Admin::OctetSeq& request_id,
+ TAO_Preference_Interpreter& pref_inter,
+ const char *type,
+ const char *constr,
+ const char *pref,
+ const CosTrading::Lookup::SpecifiedProps& desired_props,
+ CORBA::ULong how_many,
+ CosTrading::OfferSeq& offers,
+ CosTrading::OfferIterator_ptr& offer_itr,
+ CosTrading::PolicyNameSeq& limits_applied
+ 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));
+
+ /// Merge the results from a federated query into the collected results.
+ void order_merged_sequence (TAO_Preference_Interpreter& pref_inter,
+ CosTrading::OfferSeq& offers);
+
+ CORBA::Boolean seen_request_id (TAO_Policies& policies,
+ CosTrading::Admin::OctetSeq*& seq
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Lookup::PolicyTypeMismatch));
+
+ // = Disallow these operations.
+ ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_Lookup<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &))
+ ACE_UNIMPLEMENTED_FUNC (TAO_Lookup (const TAO_Lookup<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &))
+
+ const unsigned int IDS_SAVED;
+
+ /// A reference to the trader for obtaining offer maps.
+ TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &trader_;
+
+ typedef ACE_Unbounded_Queue<CosTrading::Admin::OctetSeq*> Request_Ids;
+
+ /// A list of recent request_id_stems
+ Request_Ids request_ids_;
+
+ /// Lock to secure the set of request ids.
+ TRADER_LOCK_TYPE lock_;
+};
+
+/**
+ * @class TAO_Register
+ *
+ * @brief This class implements CosTrading::Register IDL interface.
+ */
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+class TAO_Register :
+ public TAO_Trader_Components<POA_CosTrading::Register>,
+ public TAO_Support_Attributes<POA_CosTrading::Register>
+{
+public:
+
+ TAO_Register (TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &trader);
+
+ virtual ~TAO_Register (void);
+
+ virtual CosTrading::OfferId _cxx_export (CORBA::Object_ptr reference,
+ const char *type,
+ const CosTrading::PropertySeq& properties
+ 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));
+
+ // BEGIN SPEC
+ // The export operation is the means by which a service is
+ // advertised, via a trader, to a community of potential
+ // importers. The OfferId returned is the handle with which the
+ // exporter can identify the exported offer when attempting to
+ // access it via other operations. The OfferId is only meaningful in
+ // the context of the trader that generated it.
+
+ // The "reference" parameter is the information that enables a client
+ // to interact with a remote server. If a trader implementation chooses
+ // to consider certain types of object references (e.g., a nil object
+ // reference) to be unexportable, then it may return the InvalidObjectRef
+ // exception in such cases.
+
+ // The "type" parameter
+ // identifies the service type, which contains the interface type of
+ // the "reference" and a set of named property types that may be
+ // used in further describing this offer (i.e., it restricts what is
+ // acceptable in the properties parameter). °
+
+ // If the string
+ // representation of the "type" does not obey the rules for
+ // identifiers, then an IllegalServiceType exception is raised. ° If
+ // the "type" is correct syntactically but a trader is able to
+ // unambiguously determine that it is not a recognized service type,
+ // then an UnknownServiceType exception is raised. °
+
+ // If the trader
+ // can determine that the interface type of the "reference"
+ // parameter is not a subtype of the interface type specified in
+ // "type," then an InterfaceTypeMismatch exception is raised. The
+ // "properties" parameter is a list of named values that conform to
+ // the property value types defined for those names. They describe
+ // the service being offered. This description typically covers
+ // behavioral, non-functional, and non-computational aspects of the
+ // service. °
+
+ // If any of the property names do not obey the syntax
+ // rules for PropertyNames, then an IllegalPropertyName exception is
+ // raised. °
+
+ // If the type of any of the property values is not the
+ // same as the declared type (declared in the service type), then a
+ // PropertyTypeMismatch exception is raised.
+
+ // ° If an attempt is made to assign a dynamic property value to a
+ // readonly property, then the ReadonlyDynamicProperty exception is
+ // raised. ° If the "properties" parameter omits any property
+ // declared in the service type with a mode of mandatory, then a
+ // MissingMandatoryProperty exception is raised. ° If two or more
+ // properties with the same property name are included in this
+ // parameter, the DuplicatePropertyName exception is raised.
+ // END SPEC
+
+ virtual void withdraw (const char *id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId,
+ CosTrading::Register::ProxyOfferId));
+
+ // BEGIN SPEC
+ // The withdraw operation removes the service offer from the trader
+ // (i.e., after withdraw the offer can no longer be returned as the
+ // result of a query). The offer is identified by the "id" parameter
+ // which was originally returned by export. ° If the string
+ // representation of "id" does not obey the rules for offer
+ // identifiers, then an IllegalOfferId exception is raised. ° If the
+ // "id" is legal but there is no offer within the trader with that
+ // "id," then an UnknownOfferId exception is raised. ° If the "id"
+ // identifies a proxy offer rather than an ordinary offer, then a
+ // ProxyOfferId exception is raised.
+ // END SPEC
+
+ virtual CosTrading::Register::OfferInfo*
+ describe (const char * id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId,
+ CosTrading::Register::ProxyOfferId));
+
+ // BEGIN SPEC
+ // The describe operation returns the information about an offered
+ // service that is held by the trader. It comprises the "reference"
+ // of the offered service, the "type" of the service offer, and the
+ // "properties" that describe this offer of service. The offer is
+ // identified by the "id" parameter which was originally returned by
+ // export. ° If the string representation of "id" does not obey the
+ // rules for object identifiers, then an IllegalOfferId exception is
+ // raised. ° If the "id" is legal but there is no offer within the
+ // trader with that "id," then an UnknownOfferId exception is
+ // raised. ° If the "id" identifies a proxy offer rather than an
+ // ordinary offer, then a ProxyOfferId exception is raised.
+ // END SPEC
+
+ virtual void modify (const char * id,
+ const CosTrading::PropertyNameSeq& del_list,
+ const CosTrading::PropertySeq& modify_list
+ ACE_ENV_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));
+
+ // BEGIN SPEC
+ // The modify operation is used to change the description of a
+ // service as held within a service offer. The object reference and
+ // the service type associated with the offer cannot be
+ // changed. This operation may: ° add new (non-mandatory) properties
+ // to describe an offer, ° change the values of some existing (not
+ // readonly) properties, or ° delete existing (neither mandatory nor
+ // readonly) properties.
+
+ // The modify operation either succeeds completely or it fails
+ // completely. The offer is identified by the "id" parameter which
+ // was originally returned by export. ° If the string representation
+ // of "id" does not obey the rules for offer identifiers, then an
+ // IllegalOfferId exception is raised. ° If the "id" is legal but
+ // there is no offer within the trader with that "id," then an
+ // UnknownOfferId exception is raised. ° If the "id" identifies a
+ // proxy offer rather than an ordinary offer, then a ProxyOfferId
+ // exception is raised.
+
+ // The "del_list" parameter gives the names of the properties that
+ // are no longer to be recorded for the identified offer. Future
+ // query and describe operations will not see these properties. ° If
+ // any of the names within the "del_list" do not obey the rules for
+ // PropertyName's, then an IllegalPropertyName exception is
+ // raised. ° If a "name" is legal but there is no property for the
+ // offer with that "name," then an UnknownPropertyName exception is
+ // raised. ° If the list includes a property that has a mandatory
+ // mode, then the MandatoryProperty exception is raised. ° If the
+ // same property name is included two or more times in this
+ // parameter, the DuplicatePropertyName exception is raised.
+
+ // The "modify_list" parameter gives the names and values of
+ // properties to be changed. If the property is not in the offer,
+ // then the modify operation adds it. The modified (or added)
+ // property values are returned in future query and describe
+ // operations in place of the original values. ° If any of the names
+ // within the "modify_list" do not obey the rules for
+ // PropertyName's, then an IllegalPropertyName exception is
+ // raised. ° If the list includes a property that has a readonly
+ // mode, then the ReadonlyProperty exception is raised unless that
+ // readonly property is not currently recorded for the offer. The
+ // ReadonlyDynamicProperty exception is raised if an attempt is made
+ // to assign a dynamic property value to a readonly property. ° If
+ // the value of any modified property is of a type that is not the
+ // same as the type expected, then the PropertyTypeMismatch
+ // exception is raised. ° If two or more properties with the same
+ // property name are included in this argument, the
+ // DuplicatePropertyName exception is raised.
+
+ // The NotImplemented exception shall be raised if and only if the
+ // supports_modifiable_properties attribute yields FALSE.
+ // END SPEC
+
+ virtual void withdraw_using_constraint (const char *type,
+ const char *constr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::IllegalConstraint,
+ CosTrading::Register::NoMatchingOffers));
+
+ // BEGIN SPEC
+ // The withdraw_using_constraint operation withdraws a set of offers
+ // from within a single trader. This set is identified in the same
+ // way that a query operation identifies a set of offers to be
+ // returned to an importer.
+
+ // The "type" parameter conveys the required service type. Each
+ // offer of the specified type will have the constraint expression
+ // applied to it. If it matches the constraint expression, then the
+ // offer will be withdrawn.° If "type" does not obey the rules for
+ // service types, then an IllegalServiceType exception is raised. °
+ // If the "type" is correct syntactically but is not recognized as a
+ // service type by the trader, then an UnknownServiceType exception
+ // is raised.
+
+ // The constraint "constr" is the means by which the client
+ // restricts the set of offers to those that are intended for
+ // withdrawal. ° If "constr" does not obey the syntax rules for a
+ // constraint then an IllegalConstraint exception is raised. ° If
+ // the constraint fails to match with any offer of the specified
+ // service type, then a NoMatchingOffers exception is raised.
+ // END SPEC
+
+ virtual CosTrading::Register_ptr
+ resolve (const CosTrading::TraderName &name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Register::IllegalTraderName,
+ CosTrading::Register::UnknownTraderName,
+ CosTrading::Register::RegisterNotSupported));
+
+ // BEGIN SPEC
+ // This operation is used to resolve a context relative name for
+ // another trader. In particular, it is used when exporting to a
+ // trader that is known by a name rather than by an object
+ // reference. The client provides the name, which will be a sequence
+ // of name components. ° If the content of the parameter cannot
+ // yield legal syntax for the first component, then the
+ // IllegalTraderName exception is raised. Otherwise, the first name
+ // component is compared against the name held in each link. ° If no
+ // match is found, or the trader does not support links, the
+ // UnknownTraderName exception is raised. Otherwise, the trader
+ // obtains the register_if held as part of the matched link. ° If
+ // the Register interface is not nil, then the trader binds to the
+ // Register interface and invokes resolve but passes the TraderName
+ // with the first component removed; if it is nil, then the
+ // RegisterNotSupported exception is raised. When a trader is able
+ // to match the first name component leaving no residual name, that
+ // trader returns the reference for the Register interface for that
+ // linked trader. In unwinding the recursion, intermediate traders
+ // return the Register interface reference to their client (another
+ // trader).
+ // END SPEC
+
+ protected:
+
+ void validate_properties (const char* type,
+ const CosTradingRepos::ServiceTypeRepository::TypeStruct* type_struct,
+ const CosTrading::PropertySeq& properties
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalPropertyName,
+ CosTrading::PropertyTypeMismatch,
+ CosTrading::ReadonlyDynamicProperty,
+ CosTrading::MissingMandatoryProperty,
+ CosTrading::DuplicatePropertyName));
+
+ // = Disallow these operations.
+ ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_Register<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &))
+ ACE_UNIMPLEMENTED_FUNC (TAO_Register (const TAO_Register<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &))
+
+ private:
+
+ TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &trader_;
+};
+
+/**
+ * @class TAO_Admin
+ *
+ * @brief This class implements CosTrading::Admin IDL interface.
+ *
+ * DESCRIPTION (FROM SPEC)
+ * The admin interface enables the values of the trader attributes to
+ * be read and written. All attributes are defined as readonly in
+ * either SupportAttributes, ImportAttributes, LinkAttributes, or
+ * Admin. To set the trader "attribute" to a new value,
+ * set_<attribute_name> operations are defined in Admin. Each of these
+ * set operations returns the previous value of the attribute as its
+ * function value. If the admin interface operation
+ * set_support_proxy_offers is invoked with a value set to FALSE in a
+ * trader which supports the proxy interface, the
+ * set_support_proxy_offer value does not affect the function of
+ * operations in the proxy interface. However, in this case, it does
+ * have the effect of making any proxy offers exported via the proxy
+ * interface for that trader unavailable to satisfy queries on that
+ * trader's lookup interface.
+ */
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+class TAO_Admin :
+ public TAO_Trader_Components <POA_CosTrading::Admin>,
+ public TAO_Support_Attributes <POA_CosTrading::Admin>,
+ public TAO_Import_Attributes <POA_CosTrading::Admin>,
+ public TAO_Link_Attributes <POA_CosTrading::Admin>
+{
+public:
+
+ TAO_Admin (TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &trader);
+
+ ~TAO_Admin (void);
+
+ // = Importing Parameters (used by the Lookup Interface)
+
+ /// Search card is the cardinality of the offers searched for
+ /// constraint compliance.
+ virtual CORBA::ULong set_def_search_card (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual CORBA::ULong set_max_search_card (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+ /// Match card is the cardinality of offers found compliant with the
+ /// constraints.
+ virtual CORBA::ULong set_def_match_card (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual CORBA::ULong set_max_match_card (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return card is the cardinality of the offers returned from
+ /// Lookup.
+ virtual CORBA::ULong set_def_return_card (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual CORBA::ULong set_max_return_card (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Types of offers available for consideration. Ween out those
+ /// offers with modifiable properties
+ virtual CORBA::ULong set_max_list (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual CORBA::Boolean
+ set_supports_modifiable_properties (CORBA::Boolean value
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual CORBA::Boolean
+ set_supports_dynamic_properties (CORBA::Boolean value
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual CORBA::Boolean
+ set_supports_proxy_offers (CORBA::Boolean value
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // = Link Interface parameters
+
+ virtual CORBA::ULong set_def_hop_count (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual CORBA::ULong set_max_hop_count (CORBA::ULong value
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosTrading::FollowOption
+ set_def_follow_policy (CosTrading::FollowOption policy
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual CosTrading::FollowOption
+ set_max_follow_policy (CosTrading::FollowOption policy
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual CosTrading::FollowOption
+ set_max_link_follow_policy (CosTrading::FollowOption policy
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // = Set Type Repository
+
+ virtual CosTrading::TypeRepository_ptr
+ set_type_repos (CosTrading::TypeRepository_ptr repository
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosTrading::Admin::OctetSeq*
+ request_id_stem (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosTrading::Admin::OctetSeq*
+ set_request_id_stem (const CosTrading::Admin::OctetSeq& stem
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void list_offers (CORBA::ULong how_many,
+ CosTrading::OfferIdSeq_out ids,
+ CosTrading::OfferIdIterator_out id_itr
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::NotImplemented));
+
+
+ // BEGIN SPEC
+ // The list_offers operation allows the administrator of a trader to
+ // perform housekeeping by obtaining a handle on each of the offers
+ // within a trader (e.g., for garbage collection etc.). Only the
+ // identifiers of ordinary offers are returned, identifiers of proxy
+ // offers are not returned via this operation. If the trader does
+ // not support the Register interface, the NotImplemented exception
+ // is raised. The returned identifiers are passed back in one of two
+ // ways (or a combination of both). ° The "ids" return result
+ // conveys a list of offer identifiers and the "id_itr" is a
+ // reference to an interface at which additional offer identities
+ // can be obtained. ° The "how_many" parameter states how many
+ // identifiers are to be returned via the "ids" result; any
+ // remaining are available via the iterator interface. If the
+ // "how_many" exceeds the number of offers held in the trader, then
+ // the "id_itr" is nil.
+ // END SPEC
+
+ virtual void list_proxies (CORBA::ULong,
+ CosTrading::OfferIdSeq_out,
+ CosTrading::OfferIdIterator_out
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::NotImplemented));
+
+private:
+
+ // = Disallow these operations.
+ ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &))
+ ACE_UNIMPLEMENTED_FUNC (TAO_Admin (const TAO_Admin<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &))
+
+ TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &trader_;
+
+ /// Unique prefix to create a sequence number space.
+ CosTrading::Admin::OctetSeq stem_id_;
+
+ /// Current sequence number.
+ CORBA::ULong sequence_number_;
+
+ TRADER_LOCK_TYPE lock_;
+};
+
+
+/**
+ * @class TAO_Link
+ */
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+class TAO_Link :
+ public TAO_Trader_Components <POA_CosTrading::Link>,
+ public TAO_Support_Attributes <POA_CosTrading::Link>,
+ public TAO_Link_Attributes <POA_CosTrading::Link>
+{
+public:
+
+ TAO_Link (TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &trader);
+
+ ~TAO_Link (void);
+
+ /**
+ * BEGIN SPEC
+ * The add_link operation allows a trader subsequently to use the
+ * service of another trader in the performance of its own trading
+ * service operations.
+ */
+ virtual void add_link (const char *name,
+ CosTrading::Lookup_ptr target,
+ CosTrading::FollowOption def_pass_on_follow_rule,
+ CosTrading::FollowOption limiting_follow_rule
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Link::IllegalLinkName,
+ CosTrading::Link::DuplicateLinkName,
+ CosTrading::InvalidLookupRef,
+ CosTrading::Link::DefaultFollowTooPermissive,
+ CosTrading::Link::LimitingFollowTooPermissive));
+
+ // The "name" parameter is used in subsequent link management
+ // operations to identify the intended link. If the parameter is not
+ // legally formed, then the IllegalLinkName exception is raised. An
+ // exception of DuplicateLinkName is raised if the link name already
+ // exists. The link name is also used as a component in a sequence
+ // of name components in naming a trader for resolving or forwarding
+ // operations. The sequence of context relative link names provides
+ // a path to a trader.
+
+ // The "target" parameter identifies the Lookup interface at which
+ // the trading service provided by the target trader can be
+ // accessed. Should the Lookup interface parameter be nil, then an
+ // exception of InvalidLookupRef is raised. The target interface is
+ // used to obtain the associated Register interface, which will be
+ // subsequently returned as part of a describe_link operation and
+ // invoked as part of a resolve operation.
+
+ // The "def_pass_on_follow_rule" parameter specifies the default
+ // link behavior for the link if no link behavior is specified on an
+ // importer's query request. If the "def_pass_on_follow_rule"
+ // exceeds the "limiting_follow_rule" specified in the next
+ // parameter, then a DefaultFollowTooPermissive exception is
+ // raised.
+
+ // The "limiting_follow_rule" parameter specifies the most
+ // permissive link follow behavior that the link is willing to
+ // tolerate. The exception LimitingFollowTooPermissive is raised if
+ // this parameter exceeds the trader's attribute of
+ // "max_link_follow_policy" at the time of the link's creation. Note
+ // it is possible for a link's "limiting_follow_rule" to exceed the
+ // trader's "max_link_follow_policy" later in the life of a link, as
+ // it is possible that the trader could set its
+ // "max_link_follow_policy" to a more restrictive value after the
+ // creation of the link.
+ // END SPEC
+
+ virtual void remove_link (const char *name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Link::IllegalLinkName,
+ CosTrading::Link::UnknownLinkName));
+
+ // BEGIN SPEC
+ // The remove_link operation removes all knowledge of the target
+ // trader. The target trader cannot be used subsequently to resolve,
+ // forward, or propagate trading operations from this trader.
+
+ // The "name" parameter identifies the link to be removed. The
+ // exception IllegalLinkName is raised if the link is formed poorly
+ // and the UnknownLinkName exception is raised if the named link is
+ // not in the trader.
+ // END SPEC
+
+ virtual CosTrading::Link::LinkInfo* describe_link (const char *name
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Link::IllegalLinkName,
+ CosTrading::Link::UnknownLinkName));
+
+ // BEGIN SPEC
+ // The describe_link operation returns information on a link held in
+ // the trader.
+
+ // The "name" parameter identifies the link whose description is
+ // required. For a malformed link name, the exception
+ // IllegalLinkName is raised. An UnknownLinkName exception is raised
+ // if the named link is not found in the trader.
+
+ // The operation returns a LinkInfo structure comprising: ° the
+ // Lookup interface of the target trading service, ° the Register
+ // interface of the target trading service, and ° the default, as
+ // well as the limiting follow behavior of the named link.
+
+ // If the target service does not support the Register interface,
+ // then that field of the LinkInfo structure is nil. Given the
+ // description of the Register::resolve() operation in "Resolve
+ // Operation" on page 16-45, most implementations will opt for
+ // determining the Register interface when add_link is called and
+ // storing that information statically with the rest of the link
+ // state.
+ // END SPEC
+
+ virtual CosTrading::LinkNameSeq* list_links (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // BEGIN SPEC
+ // The list_links operation returns a list of the names of all
+ // trading links within the trader. The names can be used
+ // subsequently for other management operations, such as
+ // describe_link or remove_link.
+ // END SPEC
+
+ virtual void modify_link (const char *name,
+ CosTrading::FollowOption def_pass_on_follow_rule,
+ CosTrading::FollowOption limiting_follow_rule
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::Link::IllegalLinkName,
+ CosTrading::Link::UnknownLinkName,
+ CosTrading::Link::DefaultFollowTooPermissive,
+ CosTrading::Link::LimitingFollowTooPermissive));
+
+ // BEGIN SPEC
+ // The modify_link operation is used to change the existing link
+ // follow behaviors of an identified link. The Lookup interface
+ // reference of the target trader and the name of the link cannot be
+ // changed.
+
+ // The "name" parameter identifies the link whose follow behaviors
+ // are to be changed. A poorly formed "name" raises the
+ // IllegalLinkName exception. An UnknownLinkName exception is raised
+ // if the link name is not known to the trader.
+
+ // The "def_pass_on_follow_rule" parameter specifies the new default
+ // link behavior for this link. If the "def_pass_on_follow_rule"
+ // exceeds the "limiting_follow_rule" specified in the next
+ // parameter, then a DefaultFollowTooPermissive exception is
+ // raised.
+
+ // The "limiting_follow_rule" parameter specifies the new limit for
+ // the follow behavior of this link. The exception
+ // LimitingFollowTooPermissive is raised if the value exceeds the
+ // current "max_link_follow_policy" of the trader.
+ // END SPEC
+
+private:
+
+ // = Disallow these operations.
+ ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_Link<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &))
+ ACE_UNIMPLEMENTED_FUNC (TAO_Link (const TAO_Link<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &))
+
+ typedef ACE_Hash_Map_Manager_Ex
+ <
+ CORBA::String_var,
+ CosTrading::Link::LinkInfo,
+ ACE_Hash<CORBA::String_var>,
+ ACE_Equal_To<CORBA::String_var>,
+ MAP_LOCK_TYPE
+ >
+ Links;
+
+ /// The collection of link connecting this trader to others in the
+ /// federation.
+ Links links_;
+
+ TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &trader_;
+};
+
+ // *************************************************************
+ // TAO_Proxy
+ // *************************************************************
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+class TAO_Proxy :
+ public TAO_Trader_Components <POA_CosTrading::Proxy>,
+ public TAO_Support_Attributes <POA_CosTrading::Proxy>
+{
+public:
+
+ TAO_Proxy (TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &trader);
+
+ ~TAO_Proxy (void);
+
+ virtual CosTrading::OfferId
+ export_proxy (CosTrading::Lookup_ptr,
+ const char *,
+ const CosTrading::PropertySeq &,
+ CORBA::Boolean if_match_all,
+ const char *,
+ const CosTrading::PolicySeq &
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::InvalidLookupRef,
+ CosTrading::IllegalPropertyName,
+ CosTrading::PropertyTypeMismatch,
+ CosTrading::ReadonlyDynamicProperty,
+ CosTrading::MissingMandatoryProperty,
+ CosTrading::Proxy::IllegalRecipe,
+ CosTrading::DuplicatePropertyName,
+ CosTrading::DuplicatePolicyName));
+
+ virtual void withdraw_proxy (const char *
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId,
+ CosTrading::Proxy::NotProxyOfferId));
+
+ virtual CosTrading::Proxy::ProxyInfo *
+ describe_proxy (const char *
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId,
+ CosTrading::Proxy::NotProxyOfferId));
+
+ // = CosTrading::TraderComponents methods.
+
+ virtual void list_proxies (CORBA::ULong,
+ CosTrading::OfferIdSeq *&,
+ CosTrading::OfferIdIterator_ptr &
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::NotImplemented));
+
+private:
+
+ // = Disallow these operations.
+ ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_Proxy<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &))
+ ACE_UNIMPLEMENTED_FUNC (TAO_Proxy (const TAO_Proxy<TRADER_LOCK_TYPE,MAP_LOCK_TYPE> &))
+
+
+ TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>& trader_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Trader/Trader_Interfaces.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_TRADER_INTERFACES_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Trader_T.cpp b/TAO/orbsvcs/orbsvcs/Trader/Trader_T.cpp
new file mode 100644
index 00000000000..74c5a327976
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Trader_T.cpp
@@ -0,0 +1,325 @@
+// $Id$
+
+#ifndef TAO_TRADER_CPP
+#define TAO_TRADER_CPP
+
+#include "orbsvcs/Trader/Trader_T.h"
+#include "orbsvcs/Trader/Trader_Interfaces.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>::
+TAO_Trader (TAO_Trader_Base::Trader_Components components)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ // @@ Seth, we need a way to propagate the exception out. This will
+ // not work on platforms using environment variable.
+ for (int i = LOOKUP_IF; i <= LINK_IF; i++)
+ this->ifs_[i] = 0;
+
+ if (ACE_BIT_ENABLED (components, LOOKUP))
+ {
+ TAO_Lookup<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>* lookup;
+
+ ACE_NEW (lookup,
+ (TAO_Lookup<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>) (*this));
+
+ this->trading_components ().lookup_if (lookup->_this (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+ lookup->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->ifs_[LOOKUP_IF] = lookup;
+ }
+ if (ACE_BIT_ENABLED (components, REGISTER))
+ {
+ TAO_Register<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>* reg;
+
+ ACE_NEW (reg,
+ (TAO_Register<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>) (*this));
+
+ this->trading_components ().register_if (reg->_this (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+ reg->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->ifs_[REGISTER_IF] = reg;
+ }
+ if (ACE_BIT_ENABLED (components, ADMIN))
+ {
+ TAO_Admin<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>* admin;
+
+ ACE_NEW (admin,
+ (TAO_Admin<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>) (*this));
+
+ this->trading_components ().admin_if (admin->_this (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+ admin->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->ifs_[ADMIN_IF] = admin;
+ }
+ if (ACE_BIT_ENABLED (components, PROXY))
+ {
+ TAO_Proxy<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>* proxy;
+
+ ACE_NEW (proxy,
+ (TAO_Proxy<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>) (*this));
+
+ this->trading_components ().proxy_if (proxy->_this (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+ proxy->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->ifs_[PROXY_IF] = proxy;
+ }
+ if (ACE_BIT_ENABLED (components, LINK))
+ {
+ TAO_Link<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>* link;
+
+ ACE_NEW (link,
+ (TAO_Link<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>) (*this));
+
+ this->trading_components ().link_if (link->_this (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+ link->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->ifs_[LINK_IF] = link;
+ }
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>::~TAO_Trader (void)
+{
+ // Remove Trading Components from POA
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ for (int i = LOOKUP_IF; i <= LINK_IF; i++)
+ {
+ if (this->ifs_[i] != 0)
+ {
+ ACE_TRY
+ {
+ PortableServer::POA_var poa =
+ this->ifs_[i]->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this->ifs_[i] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Don't let exceptions propagate out of this call since
+ // it's the destructor!
+ }
+ ACE_ENDTRY;
+ }
+ }
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+TAO_Offer_Database<MAP_LOCK_TYPE>&
+TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>::offer_database (void)
+{
+ return this->offer_database_;
+}
+
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE> ACE_Lock &
+TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>::lock (void)
+{
+ return this->lock_;
+}
+
+template <class IF>
+TAO_Trader_Components<IF>::
+TAO_Trader_Components (const TAO_Trading_Components_i& comps)
+ : comps_ (comps)
+{
+}
+
+template <class IF> CosTrading::Lookup_ptr
+TAO_Trader_Components<IF>::lookup_if (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CosTrading::Lookup::_duplicate (this->comps_.lookup_if ());
+}
+
+template <class IF> CosTrading::Register_ptr
+TAO_Trader_Components<IF>::register_if (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CosTrading::Register::_duplicate (this->comps_.register_if ());
+}
+
+template <class IF> CosTrading::Admin_ptr
+TAO_Trader_Components<IF>::admin_if (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CosTrading::Admin::_duplicate (this->comps_.admin_if ());
+}
+
+template <class IF> CosTrading::Proxy_ptr
+TAO_Trader_Components<IF>::proxy_if (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CosTrading::Proxy::_duplicate (this->comps_.proxy_if ());
+}
+
+template <class IF> CosTrading::Link_ptr
+TAO_Trader_Components<IF>::link_if (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CosTrading::Link::_duplicate (this->comps_.link_if ());
+}
+template <class IF>
+TAO_Support_Attributes<IF>::
+TAO_Support_Attributes (const TAO_Support_Attributes_i& attrs)
+ : attrs_ (attrs)
+{
+}
+
+template <class IF> CORBA::Boolean
+TAO_Support_Attributes<IF>::supports_modifiable_properties (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->attrs_.supports_modifiable_properties ();
+}
+
+template <class IF> CORBA::Boolean
+TAO_Support_Attributes<IF>::supports_dynamic_properties (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->attrs_.supports_dynamic_properties ();
+}
+
+template <class IF> CORBA::Boolean
+TAO_Support_Attributes<IF>::supports_proxy_offers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->attrs_.supports_proxy_offers ();
+}
+
+template <class IF> CosTrading::TypeRepository_ptr
+TAO_Support_Attributes<IF>::type_repos (ACE_ENV_SINGLE_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CosTrading::TypeRepository::_duplicate (this->attrs_.type_repos ());
+}
+
+template <class IF>
+TAO_Import_Attributes<IF>::
+TAO_Import_Attributes (const TAO_Import_Attributes_i& attrs)
+ : attrs_ (attrs)
+{
+}
+
+template <class IF> CORBA::ULong
+TAO_Import_Attributes<IF>::def_search_card (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->attrs_.def_search_card ();
+}
+
+template <class IF> CORBA::ULong
+TAO_Import_Attributes<IF>::max_search_card (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->attrs_.max_search_card ();
+}
+
+template <class IF> CORBA::ULong
+TAO_Import_Attributes<IF>::def_match_card (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->attrs_.def_match_card ();
+}
+
+template <class IF> CORBA::ULong
+TAO_Import_Attributes<IF>::max_match_card (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->attrs_.max_match_card ();
+}
+
+template <class IF> CORBA::ULong
+TAO_Import_Attributes<IF>::def_return_card (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->attrs_.def_return_card ();
+}
+
+template <class IF> CORBA::ULong
+TAO_Import_Attributes<IF>::max_return_card (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->attrs_.max_return_card ();
+}
+
+template <class IF> CORBA::ULong
+TAO_Import_Attributes<IF>::max_list (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->attrs_.max_list ();
+}
+
+template <class IF> CORBA::ULong
+TAO_Import_Attributes<IF>::def_hop_count (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->attrs_.def_hop_count ();
+}
+
+template <class IF> CORBA::ULong
+TAO_Import_Attributes<IF>::max_hop_count (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->attrs_.max_hop_count ();
+}
+
+template <class IF> CosTrading::FollowOption
+TAO_Import_Attributes<IF>::def_follow_policy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->attrs_.def_follow_policy ();
+}
+
+template <class IF> CosTrading::FollowOption
+TAO_Import_Attributes<IF>::max_follow_policy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->attrs_.max_follow_policy ();
+}
+
+template <class IF>
+TAO_Link_Attributes<IF>::
+TAO_Link_Attributes (const TAO_Link_Attributes_i& attrs)
+ : attrs_ (attrs)
+{
+}
+
+template <class IF> CosTrading::FollowOption
+TAO_Link_Attributes<IF>::max_link_follow_policy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->attrs_.max_link_follow_policy ();
+}
+
+template <class ELEMENT_TYPE> int
+TAO_Element_Equal<ELEMENT_TYPE>::
+operator () (TAO_DynSequence_i& dyn_any,
+ const ELEMENT_TYPE& element)
+{
+ return 1;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_TRADER_CPP */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Trader_T.h b/TAO/orbsvcs/orbsvcs/Trader/Trader_T.h
new file mode 100644
index 00000000000..cf892279bcc
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Trader_T.h
@@ -0,0 +1,278 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Trader_T.h
+ *
+ * $Id$
+ *
+ * @author Marina Spivak <marina@cs.wustl.edu>
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ * @author Irfan Pyarali <irfan@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_TRADER_H
+#define TAO_TRADER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Trader/Trader.h"
+#include "orbsvcs/Trader/Offer_Database.h"
+#include "ace/Containers.h"
+#include "ace/Lock_Adapter_T.h"
+
+// *************************************************************
+// TAO_Trader
+// *************************************************************
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning (disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_DynSequence_i;
+
+/**
+ * @class TAO_Trader
+ *
+ * @brief This class packages together all the various pieces that
+ * provide functionality specified in COS Trading specification.
+ *
+ * TAO_Trader contains all the components that together represent
+ * a single trader. Based on its constructor arguments,
+ * TAO_Trader creates instances of appropriate interface
+ * implementations as well as instances of objects common to
+ * more than one interface (offers, attributes, etc.).
+ * TAO_Trader also enforces the proper order on all
+ * initializations. TAO_Trader acts like a "glue" class that
+ * creates appropriate components, holds everything together,
+ * and enforces order. TAO_Trader is parameterized by two types
+ * of locks: one for its service service offers, one for its
+ * state (configuration).
+ */
+template <class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
+class TAO_Trader : public TAO_Trader_Base
+{
+public:
+
+ // The desired combination of interfaces to be passed to the
+ // TAO_Trader constructor.
+
+ /// Offer Database Trait.
+ typedef TAO_Offer_Database<MAP_LOCK_TYPE> Offer_Database;
+
+ /**
+ * Constructor which based on its arguments will create
+ * a particular type of trader (e.g. Query trader, Simple trader, etc.)
+ * The argument is a bitwise OR of desired Trader_Components as listed
+ * in enumerated type above.
+ */
+ TAO_Trader (Trader_Components components = LOOKUP);
+
+ /// Destructor.
+ virtual ~TAO_Trader (void);
+
+ /// Accessor for the structure with all the service offers.
+ Offer_Database& offer_database (void);
+
+ /// Returns the trader
+ ACE_Lock &lock (void);
+
+protected:
+
+ typedef TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE> TRADER_SELF;
+
+ Offer_Database offer_database_;
+
+ /// Lock that guards the state of the trader (its configuration).
+ ACE_Lock_Adapter<TRADER_LOCK_TYPE> lock_;
+
+ enum { LOOKUP_IF, REGISTER_IF, ADMIN_IF, PROXY_IF, LINK_IF };
+
+ PortableServer::ServantBase* ifs_[5];
+
+private:
+
+ // = Disallow these operations.
+ ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE> &))
+};
+
+ // *************************************************************
+ // Template Attribute Classes
+ // *************************************************************
+
+template <class IF>
+class TAO_Trader_Components :
+ public virtual IF
+{
+public:
+
+ TAO_Trader_Components (const TAO_Trading_Components_i& comps);
+
+ // = CosTrading::TraderComponents methods.
+ /// Returns an object reference to the Lookup interface of the trader.
+ /// Returns nil if the trader does not support Lookup interface.
+ virtual CosTrading::Lookup_ptr lookup_if (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Returns object reference for the Register interface of the trader.
+ /// Returns nil if the trader does not support Register interface.
+ virtual CosTrading::Register_ptr register_if (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Returns object reference for the Link interface of the trader.
+ /// Returns nil if the trader does not support Link interface.
+ virtual CosTrading::Link_ptr link_if (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Returns object reference to the Proxy interface of the trader.
+ /// Returns nil if the trader does not support Proxy interface.
+ virtual CosTrading::Proxy_ptr proxy_if (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Returns object reference for the Admin interface of the trader.
+ /// Returns nil if the trader does not support Admin interface.
+ virtual CosTrading::Admin_ptr admin_if (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ const TAO_Trading_Components_i& comps_;
+};
+
+template <class IF>
+class TAO_Support_Attributes : public virtual IF
+{
+public:
+
+ TAO_Support_Attributes (const TAO_Support_Attributes_i& attrs);
+
+ // = CosTrading::SupportAttributes methods.
+
+ virtual CORBA::Boolean supports_modifiable_properties (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean supports_dynamic_properties (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean supports_proxy_offers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosTrading::TypeRepository_ptr type_repos (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ const TAO_Support_Attributes_i& attrs_;
+};
+
+template <class IF>
+class TAO_Import_Attributes : public virtual IF
+{
+public:
+
+ TAO_Import_Attributes (const TAO_Import_Attributes_i& attrs);
+
+ // = CosTrading::ImportAttributes methods.
+
+ virtual CORBA::ULong def_search_card (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ULong max_search_card (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // Search cardinality determines the maximum number of offers searched
+ // before not considering other offers.
+
+ virtual CORBA::ULong def_match_card (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ULong max_match_card (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // Match cardinality determines the maximum number of offers
+ // matched to the constraints before not considering other offers..
+
+ virtual CORBA::ULong def_return_card (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ULong max_return_card (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ // Return cardinality determines the maximum number of offers marked
+ // to return before not considering other offers.
+
+
+ virtual CORBA::ULong max_list (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ULong def_hop_count (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ULong max_hop_count (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosTrading::FollowOption def_follow_policy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CosTrading::FollowOption max_follow_policy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+private:
+
+ const TAO_Import_Attributes_i& attrs_;
+};
+
+template <class IF>
+class TAO_Link_Attributes : public virtual IF
+{
+public:
+
+ TAO_Link_Attributes (const TAO_Link_Attributes_i& attrs);
+
+ // = CosTrading::LinkAttributes methods
+ virtual CosTrading::FollowOption max_link_follow_policy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ const TAO_Link_Attributes_i& attrs_;
+};
+
+ // *************************************************************
+ // TAO_Sequence_Extracter
+ // *************************************************************
+
+/**
+ * @class TAO_Element_Equal
+ *
+ * @brief Function object for determining if the sequence element at the
+ * current position of the dynamic sequence any parameter is equal to
+ * the element parameter.
+ */
+template <class ELEMENT_TYPE>
+class TAO_Element_Equal
+{
+public:
+ /// Calls the correct method on dyn_seq to extract the element type, then
+ /// uses the appropriate form of equals comparison.
+ int operator () (TAO_DynSequence_i& dyn_any,
+ const ELEMENT_TYPE& element);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "orbsvcs/Trader/Trader_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_TRADER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Trader_Utils.cpp b/TAO/orbsvcs/orbsvcs/Trader/Trader_Utils.cpp
new file mode 100644
index 00000000000..4de7d0c8638
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Trader_Utils.cpp
@@ -0,0 +1,1535 @@
+// $Id$
+
+#include "orbsvcs/Trader/Trader_Utils.h"
+#include "ace/OS_NS_string.h"
+
+ACE_RCSID(Trader, Trader_Utils, "$Id$")
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+bool
+operator== (CORBA::String_var const & lhs,
+ CORBA::String_var const & rhs)
+{
+ return (ACE_OS::strcmp (lhs.in (), rhs.in ()) == 0);
+}
+
+TAO_Policy_Creator::TAO_Policy_Creator (int num_policies)
+ : policies_ (num_policies),
+ num_policies_ (0)
+{
+ for (int i = 0; i < TAO_Policies::REQUEST_ID + 1; i++)
+ this->poltable_[i] = -1;
+}
+
+void
+TAO_Policy_Creator::search_card (CORBA::ULong scard)
+{
+ CosTrading::Policy& policy =
+ this->fetch_next_policy (TAO_Policies::SEARCH_CARD);
+ policy.value <<= scard;
+}
+
+void
+TAO_Policy_Creator::match_card (CORBA::ULong mcard)
+{
+ CosTrading::Policy& policy =
+ this->fetch_next_policy (TAO_Policies::MATCH_CARD);
+ policy.value <<= mcard;
+}
+
+void
+TAO_Policy_Creator::return_card (CORBA::ULong rcard)
+{
+ CosTrading::Policy& policy =
+ this->fetch_next_policy (TAO_Policies::RETURN_CARD);
+ policy.value <<= rcard;
+}
+
+void
+TAO_Policy_Creator::use_modifiable_properties (CORBA::Boolean mod_props)
+{
+ CosTrading::Policy& policy =
+ this->fetch_next_policy (TAO_Policies::USE_MODIFIABLE_PROPERTIES);
+ policy.value <<= CORBA::Any::from_boolean (mod_props);
+}
+
+void
+TAO_Policy_Creator::use_dynamic_properties (CORBA::Boolean dyn_props)
+{
+ CosTrading::Policy& policy =
+ this->fetch_next_policy (TAO_Policies::USE_DYNAMIC_PROPERTIES);
+ policy.value <<= CORBA::Any::from_boolean (dyn_props);
+}
+
+void
+TAO_Policy_Creator::use_proxy_offers (CORBA::Boolean prox_offs)
+{
+ CosTrading::Policy& policy =
+ this->fetch_next_policy (TAO_Policies::USE_PROXY_OFFERS);
+ policy.value <<= CORBA::Any::from_boolean (prox_offs);
+}
+
+void
+TAO_Policy_Creator::starting_trader (const CosTrading::TraderName& name)
+{
+ CosTrading::Policy& policy =
+ this->fetch_next_policy (TAO_Policies::STARTING_TRADER);
+ policy.value <<= name;
+}
+
+void
+TAO_Policy_Creator::starting_trader (CosTrading::TraderName* name)
+{
+ CosTrading::Policy& policy =
+ this->fetch_next_policy (TAO_Policies::STARTING_TRADER);
+ policy.value <<= name;
+}
+
+void
+TAO_Policy_Creator::
+link_follow_rule (CosTrading::FollowOption follow_option)
+{
+ CosTrading::Policy& policy =
+ this->fetch_next_policy (TAO_Policies::LINK_FOLLOW_RULE);
+ policy.value <<= follow_option;
+}
+
+void
+TAO_Policy_Creator::hop_count (CORBA::ULong hop_count)
+{
+ CosTrading::Policy& policy =
+ this->fetch_next_policy (TAO_Policies::HOP_COUNT);
+ policy.value <<= hop_count;
+}
+
+void
+TAO_Policy_Creator::exact_type_match (CORBA::Boolean exact_type)
+{
+ CosTrading::Policy& policy =
+ this->fetch_next_policy (TAO_Policies::EXACT_TYPE_MATCH);
+ policy.value <<= CORBA::Any::from_boolean (exact_type);
+}
+
+void
+TAO_Policy_Creator::request_id (const CosTrading::Admin::OctetSeq& request_id)
+{
+ CosTrading::Policy& policy =
+ this->fetch_next_policy (TAO_Policies::REQUEST_ID);
+ policy.value <<= request_id;
+}
+
+TAO_Policy_Creator::operator const CosTrading::PolicySeq& (void) const
+{
+ return this->policies_;
+}
+
+const CosTrading::PolicySeq&
+TAO_Policy_Creator::policy_seq (void) const
+{
+ return this->policies_;
+}
+
+CosTrading::Policy&
+TAO_Policy_Creator::fetch_next_policy (TAO_Policies::POLICY_TYPE pol_type)
+{
+ CORBA::ULong index = 0;
+
+ if (this->poltable_[pol_type] == -1)
+ {
+ // Expand the policy sequence, and copy in the policy name into
+ // the new element.
+ CORBA::ULong length = this->policies_.length ();
+ this->num_policies_++;
+
+ if (length < this->num_policies_)
+ this->policies_.length (this->num_policies_);
+
+ index = this->num_policies_ - 1;
+
+ // Ensure the starting trader policy gets the first slot.
+ if (pol_type != TAO_Policies::STARTING_TRADER
+ || index == 0)
+ {
+ this->policies_[index].name = TAO_Policies::POLICY_NAMES[pol_type];
+ this->poltable_[pol_type] = index;
+ }
+ else
+ {
+ // Copy the element in the first slot to the newly
+ // allocated slot.
+ TAO_Policies::POLICY_TYPE occupying_policy =
+ TAO_Policies::STARTING_TRADER;
+ for (CORBA::ULong i = 0; i < this->num_policies_ - 1; i++)
+ {
+ if (this->poltable_[i] == 0)
+ {
+ occupying_policy =
+ static_cast<TAO_Policies::POLICY_TYPE> (i);
+ break;
+ }
+ }
+
+ this->poltable_[occupying_policy] = index;
+ this->poltable_[TAO_Policies::STARTING_TRADER] = 0;
+ this->policies_[index].name =
+ TAO_Policies::POLICY_NAMES[occupying_policy];
+ this->policies_[index].value = this->policies_[0].value;
+ this->policies_[0].name =
+ TAO_Policies::POLICY_NAMES[TAO_Policies::STARTING_TRADER];
+
+ index = 0;
+ }
+ }
+ else
+ index = this->poltable_[pol_type];
+
+ return this->policies_[index];
+}
+
+// Constructor
+
+TAO_Property_Evaluator::
+TAO_Property_Evaluator(const CosTrading::PropertySeq& props,
+ CORBA::Boolean supports_dp)
+ : props_ (props),
+ supports_dp_ (supports_dp),
+ dp_cache_ (new CORBA::Any*[props.length ()])
+{
+ if (this->dp_cache_ != 0)
+ {
+ for (CORBA::ULong i = 0; i < this->props_.length (); i++)
+ this->dp_cache_[i] = 0;
+ }
+}
+
+
+TAO_Property_Evaluator::
+TAO_Property_Evaluator(CosTrading::Offer& offer,
+ CORBA::Boolean supports_dp)
+ : props_ (offer.properties),
+ supports_dp_ (supports_dp),
+ dp_cache_ (new CORBA::Any*[offer.properties.length ()])
+{
+ if (this->dp_cache_ != 0)
+ for (CORBA::ULong i = 0; i < this->props_.length (); i++)
+ this->dp_cache_[i] = 0;
+}
+
+TAO_Property_Evaluator::~TAO_Property_Evaluator (void)
+{
+ // Clean up the results of any dynamic properties.
+ for (CORBA::ULong i = 0; i < this->props_.length (); i++)
+ if (this->dp_cache_[i] != 0)
+ delete this->dp_cache_[i];
+
+ delete [] this->dp_cache_;
+}
+
+int
+TAO_Property_Evaluator::is_dynamic_property (int index)
+{
+ int return_value = 0;
+ int num_properties = this->props_.length();
+
+ // Ensure index is in bounds.
+ if (index >= 0 && index < num_properties)
+ {
+ // Obtain the value of the property at index <index>.
+ const CORBA::Any& value = this->props_[index].value;
+ CORBA::TypeCode_var type = value.type ();
+
+ // @@ Seth, this will not work on platforms using environment variable.
+ ACE_DECLARE_NEW_CORBA_ENV;
+ CORBA::Boolean equal = type->equal (CosTradingDynamic::_tc_DynamicProp
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (equal)
+ return_value = 1;
+ }
+
+ return return_value;
+}
+
+CORBA::Any*
+TAO_Property_Evaluator::property_value (int index
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTradingDynamic::DPEvalFailure))
+{
+ CORBA::Any* prop_val = 0;
+ CORBA::Boolean in_cache =
+ this->dp_cache_ != 0 && this->dp_cache_[index] != 0;
+
+ int dynamic = this->is_dynamic_property (index);
+
+ if (!dynamic)
+ prop_val = (CORBA::Any *) &(this->props_[index].value);
+ else if (this->supports_dp_ && in_cache)
+ prop_val = this->dp_cache_[index];
+ else if (this->supports_dp_)
+ {
+ // Property is defined at this point.
+ CosTradingDynamic::DynamicProp* dp_struct;
+ const CORBA::String_var name = this->props_[index].name.in ();
+ const CORBA::Any& value = this->props_[index].value;
+
+ // Extract the DP_Struct.
+ value >>= dp_struct;
+
+ CosTradingDynamic::DynamicPropEval_var dp_eval =
+ CosTradingDynamic::DynamicPropEval::_duplicate (dp_struct->eval_if.in ());
+
+ if (CORBA::is_nil (dp_eval.in ()))
+ {
+ ACE_THROW_RETURN (CosTradingDynamic::
+ DPEvalFailure (name,
+ CORBA::TypeCode::_nil (),
+ CORBA::Any ()),
+ prop_val);
+ }
+ else
+ {
+ CORBA::TypeCode* type = dp_struct->returned_type.in ();
+ CORBA::Any& info = dp_struct->extra_info;
+
+ ACE_TRY
+ {
+ // Retrieve the value of the dynamic property.
+ prop_val = dp_eval->evalDP(name, type, info ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->dp_cache_ != 0)
+ this->dp_cache_[index] = prop_val;
+ }
+ ACE_CATCH (CORBA::SystemException, excp)
+ {
+ ACE_TRY_THROW
+ (CosTradingDynamic::DPEvalFailure (name, type, info));
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (prop_val);
+ }
+ }
+
+ return prop_val;
+}
+
+CORBA::TypeCode_ptr
+TAO_Property_Evaluator::property_type (int index)
+{
+ CORBA::TypeCode_ptr prop_type = CORBA::TypeCode::_nil();
+
+ // Determine if property is both defined and dynamic.
+ if (this->is_dynamic_property (index))
+ {
+ // Extract type information from the DP_Struct.
+ const CORBA::Any& value = this->props_[index].value;
+ CosTradingDynamic::DynamicProp* dp_struct = 0;
+ value >>= dp_struct;
+
+ // Grab a pointer to the returned_type description
+ prop_type = CORBA::TypeCode::_duplicate (dp_struct->returned_type.in ());
+ }
+ else
+ // TypeCode is self-evident at this point.
+ prop_type = this->props_[index].value.type ();
+
+ return prop_type;
+}
+
+TAO_Property_Evaluator_By_Name::
+TAO_Property_Evaluator_By_Name (const CosTrading::PropertySeq& properties
+ ACE_ENV_ARG_DECL,
+ CORBA::Boolean supports_dp)
+ ACE_THROW_SPEC ((CosTrading::DuplicatePropertyName,
+ CosTrading::IllegalPropertyName))
+ : TAO_Property_Evaluator (properties, supports_dp)
+{
+ int length = this->props_.length();
+
+ for (int i = 0; i < length; i++)
+ {
+ const CosTrading::Property& prop = this->props_[i];
+
+ if (! TAO_Trader_Base::is_valid_property_name (prop.name))
+ ACE_THROW (CosTrading::IllegalPropertyName (prop.name));
+
+ CORBA::String_var prop_name = prop.name.in ();
+ if (this->table_.bind (prop_name, i))
+ ACE_THROW (CosTrading::DuplicatePropertyName (prop.name));
+ }
+}
+
+TAO_Property_Evaluator_By_Name::
+TAO_Property_Evaluator_By_Name(CosTrading::Offer& offer,
+ CORBA::Boolean supports_dp)
+ : TAO_Property_Evaluator(offer, supports_dp)
+{
+ int length = this->props_.length();
+
+ for (int i = 0; i < length; i++)
+ {
+ CORBA::String_var prop_name = (const char*) this->props_[i].name;
+ this->table_.bind (prop_name, i);
+ }
+}
+
+int
+TAO_Property_Evaluator_By_Name::
+is_dynamic_property(const char* property_name)
+{
+ int predicate = 0;
+ int index = 0;
+ CORBA::String_var prop_name (property_name);
+
+ // If the property name is in the map, delegate evaluation to our
+ // superclass. Otherwise, throw an exception.
+ if (this->table_.find (prop_name, index) == 0)
+ predicate = this->TAO_Property_Evaluator::is_dynamic_property(index);
+
+ return predicate;
+}
+
+CORBA::Any*
+TAO_Property_Evaluator_By_Name::property_value (const char* property_name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTradingDynamic::DPEvalFailure))
+{
+ int index = 0;
+ CORBA::Any* prop_value = 0;
+ CORBA::String_var prop_name (property_name);
+
+ // If the property name is in the map, delegate evaluation to our
+ // superclass. Otherwise, throw an exception.
+ if (this->table_.find (prop_name, index) == 0)
+ {
+ prop_value =
+ this->TAO_Property_Evaluator::property_value (index
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return prop_value;
+}
+
+CORBA::TypeCode_ptr
+TAO_Property_Evaluator_By_Name::property_type (const char* property_name)
+{
+ int index = 0;
+ CORBA::String_var prop_name (property_name);
+ CORBA::TypeCode_ptr prop_type = CORBA::TypeCode::_nil();
+
+ // If the property name is in the map, delegate evaluation to our
+ // superclass. Otherwise, throw an exception.
+ if (this->table_.find (prop_name, index) == 0)
+ prop_type = this->TAO_Property_Evaluator::property_type (index);
+
+ return prop_type;
+}
+
+const CosTrading::Property*
+TAO_Property_Evaluator_By_Name::get_property (const char* property_name)
+{
+ int index = 0;
+ CosTrading::Property* property = 0;
+ CORBA::String_var prop_name (property_name);
+
+ if (this->table_.find (prop_name, index) == 0)
+ property = (CosTrading::Property *) &this->props_[index];
+
+ return property;
+}
+
+TAO_Dynamic_Property::~TAO_Dynamic_Property (void)
+{
+}
+
+CosTradingDynamic::DynamicProp*
+TAO_Dynamic_Property::
+construct_dynamic_prop (const char* name,
+ CORBA::TypeCode_ptr returned_type,
+ const CORBA::Any& extra_info)
+{
+ ACE_UNUSED_ARG (name);
+
+ CosTradingDynamic::DynamicProp* dp_struct = 0;
+
+ ACE_NEW_RETURN (dp_struct,
+ CosTradingDynamic::DynamicProp,
+ 0);
+
+ if (this->prop_.in () == CosTradingDynamic::DynamicPropEval::_nil ())
+ {
+ // Seth, we need a way to either propagate exceptions out.
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ this->prop_ = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ dp_struct->eval_if =
+ CosTradingDynamic::DynamicPropEval::_duplicate (this->prop_.in ());
+
+ dp_struct->returned_type =
+ CORBA::TypeCode::_duplicate (returned_type);
+ dp_struct->extra_info = extra_info;
+
+ return dp_struct;
+}
+
+void
+TAO_Dynamic_Property::destroy (void)
+{
+ if (this->prop_.in () != CosTradingDynamic::DynamicPropEval::_nil ())
+ {
+ // @@ Seth, we need a way to propagate exceptions out.
+ ACE_DECLARE_NEW_CORBA_ENV;
+ 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;
+ }
+}
+
+const char* TAO_Policies::POLICY_NAMES[] =
+{
+ "starting_trader",
+ "exact_type_match",
+ "hop_count",
+ "link_follow_rule",
+ "match_card",
+ "return_card",
+ "search_card",
+ "use_dynamic_properties",
+ "use_modifiable_properties",
+ "use_proxy_offers",
+ "request_id"
+};
+
+TAO_Policies::TAO_Policies (TAO_Trader_Base& trader,
+ const CosTrading::PolicySeq& policies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::Lookup::IllegalPolicyName,
+ CosTrading::DuplicatePolicyName))
+ : trader_ (trader)
+{
+ for (int i = 0; i < TAO_NUM_POLICIES; i++)
+ this->policies_[i] = 0;
+
+ for (CORBA::ULong j = 0; j < policies.length (); j++)
+ {
+ const char *pol_name = (const char *) policies[j].name;
+ size_t length = (pol_name == 0) ? 0 : ACE_OS::strlen (pol_name);
+ int index = -1;
+
+ if (length < ACE_OS::strlen (POLICY_NAMES[HOP_COUNT]))
+ ACE_THROW (CosTrading::Lookup::IllegalPolicyName (pol_name));
+
+ switch (pol_name[0])
+ {
+ case 'e':
+ index = EXACT_TYPE_MATCH;
+ break;
+ case 'h':
+ index = HOP_COUNT;
+ break;
+ case 'l':
+ index = LINK_FOLLOW_RULE;
+ break;
+ case 'm':
+ index = MATCH_CARD;
+ break;
+ case 'r':
+ if (pol_name[2] == 't')
+ index = RETURN_CARD;
+ else if (pol_name[2] == 'q')
+ index = REQUEST_ID;
+ break;
+ case 's':
+ if (pol_name[1] == 't')
+ index = STARTING_TRADER;
+ else if (pol_name[1] == 'e')
+ index = SEARCH_CARD;
+ break;
+ case 'u':
+ if (pol_name[4] == 'd')
+ index = USE_DYNAMIC_PROPERTIES;
+ if (pol_name[4] == 'm')
+ index = USE_MODIFIABLE_PROPERTIES;
+ if (pol_name[4] == 'p')
+ index = USE_PROXY_OFFERS;
+ }
+
+ // Match the name of the policy, and insert its value into the
+ // vector.
+ if (index == -1 || ACE_OS::strcmp (POLICY_NAMES[index], pol_name) != 0)
+ ACE_THROW (CosTrading::Lookup::IllegalPolicyName (pol_name));
+ else if (this->policies_[index] != 0)
+ ACE_THROW (CosTrading::DuplicatePolicyName (pol_name));
+ else
+ this->policies_[index] = (CosTrading::Policy *) &(policies[j]);
+ }
+}
+
+TAO_Policies::~TAO_Policies (void)
+{
+}
+
+CORBA::ULong
+TAO_Policies::ulong_prop (POLICY_TYPE pol
+ ACE_ENV_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch))
+{
+ CORBA::ULong return_value = 0, max_value = 0;
+ const TAO_Import_Attributes_i& import_attrs =
+ this->trader_.import_attributes ();
+
+ // Discover the default values for each of the possible cardinality
+ // policies.
+ switch (pol)
+ {
+ case SEARCH_CARD:
+ return_value = import_attrs.def_search_card ();
+ max_value = import_attrs.max_search_card ();
+ break;
+ case MATCH_CARD:
+ return_value = import_attrs.def_match_card ();
+ max_value = import_attrs.max_match_card ();
+ break;
+ case RETURN_CARD:
+ return_value = import_attrs.def_return_card ();
+ max_value = import_attrs.max_return_card ();
+ break;
+ case HOP_COUNT:
+ return_value = import_attrs.def_hop_count ();
+ max_value = import_attrs.max_hop_count ();
+ break;
+ default:
+ break;
+ }
+
+ if (this->policies_[pol] != 0)
+ {
+ // Extract the desired policy value.
+ const CosTrading::Policy* policy = this->policies_[pol];
+ const CosTrading::PolicyValue& value = policy->value;
+ CORBA::TypeCode_var type = value.type ();
+
+ CORBA::Boolean equal_ulong = type->equal (CORBA::_tc_ulong ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (return_value);
+
+ if (!equal_ulong)
+ ACE_THROW_RETURN (CosTrading::Lookup::PolicyTypeMismatch (*policy),
+ return_value);
+ else
+ value >>= return_value;
+
+ if (max_value < return_value)
+ return_value = max_value;
+ }
+
+ return return_value;
+}
+
+CORBA::ULong
+TAO_Policies::search_card (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch))
+{
+ return this->ulong_prop (SEARCH_CARD ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ULong
+TAO_Policies::match_card (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch))
+{
+ return this->ulong_prop (MATCH_CARD ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ULong
+TAO_Policies::return_card (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch))
+{
+ return this->ulong_prop (RETURN_CARD ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_Policies::boolean_prop (POLICY_TYPE pol
+ ACE_ENV_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch))
+{
+ CORBA::Boolean def_value = 1,
+ return_value = 1;
+ const TAO_Support_Attributes_i& support_attrs =
+ this->trader_.support_attributes ();
+
+ switch (pol)
+ {
+ case USE_MODIFIABLE_PROPERTIES:
+ def_value = support_attrs.supports_modifiable_properties ();
+ break;
+ case USE_DYNAMIC_PROPERTIES:
+ def_value = support_attrs.supports_dynamic_properties ();
+ break;
+ case USE_PROXY_OFFERS:
+ def_value = support_attrs.supports_proxy_offers ();
+ break;
+ case EXACT_TYPE_MATCH:
+ def_value = 0;
+ break;
+ default:
+ break;
+ }
+
+ if (this->policies_[pol] != 0)
+ {
+ const CosTrading::Policy* policy = this->policies_[pol];
+ const CosTrading::PolicyValue& value = policy->value;
+ CORBA::TypeCode_var type = value.type ();
+
+ CORBA::Boolean equal_boolean =
+ type->equal (CORBA::_tc_boolean ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (return_value);
+
+ if (!equal_boolean)
+ ACE_THROW_RETURN (CosTrading::Lookup::PolicyTypeMismatch (*policy),
+ return_value);
+ else
+ value >>= CORBA::Any::to_boolean (return_value);
+
+ if (def_value == 0 &&
+ pol != EXACT_TYPE_MATCH)
+ return_value = 0;
+ }
+ else
+ return_value = def_value;
+
+ return return_value;
+}
+
+
+CORBA::Boolean
+TAO_Policies::use_modifiable_properties (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch))
+{
+ return this->boolean_prop (USE_MODIFIABLE_PROPERTIES ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_Policies::use_dynamic_properties (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch))
+{
+ return this->boolean_prop (USE_DYNAMIC_PROPERTIES ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_Policies::use_proxy_offers (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch))
+{
+ return this->boolean_prop (USE_PROXY_OFFERS ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+TAO_Policies::exact_type_match (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch))
+{
+ return this->boolean_prop (EXACT_TYPE_MATCH ACE_ENV_ARG_PARAMETER);
+}
+
+
+CosTrading::TraderName*
+TAO_Policies::starting_trader (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch,
+ CosTrading::Lookup::InvalidPolicyValue))
+{
+ CosTrading::TraderName* trader_name = 0;
+
+ if (this->policies_[STARTING_TRADER] != 0)
+ {
+ CosTrading::Policy* policy = this->policies_[STARTING_TRADER];
+ CosTrading::PolicyValue& value = policy->value;
+ CORBA::TypeCode_var type = value.type ();
+
+ CORBA::Boolean equal_tradername =
+ type->equal (CosTrading::_tc_TraderName ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (trader_name);
+
+ CORBA::Boolean equal_linknameseq =
+ type->equal (CosTrading::_tc_LinkNameSeq ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (trader_name);
+
+ if (!equal_tradername ||
+ !equal_linknameseq)
+ ACE_THROW_RETURN (CosTrading::Lookup::PolicyTypeMismatch (*policy),
+ trader_name);
+ else
+ value >>= trader_name;
+ }
+
+ return trader_name;
+}
+
+CosTrading::FollowOption
+TAO_Policies::link_follow_rule (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch))
+{
+ CosTrading::FollowOption return_value =
+ this->trader_.import_attributes ().def_follow_policy ();
+
+ if (this->policies_[LINK_FOLLOW_RULE] != 0)
+ {
+ CosTrading::FollowOption max_follow_policy =
+ this->trader_.import_attributes ().max_follow_policy ();
+
+ CosTrading::Policy* policy = this->policies_[LINK_FOLLOW_RULE];
+ CosTrading::PolicyValue& value = policy->value;
+ CORBA::TypeCode_var type = value.type ();
+
+ // Extract the link follow rule
+ CORBA::Boolean type_equal =
+ type->equal (CosTrading::_tc_FollowOption ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (return_value);
+
+ if (!type_equal)
+ ACE_THROW_RETURN (CosTrading::Lookup::PolicyTypeMismatch (*policy),
+ return_value);
+ else
+ value >>= return_value;
+
+ if (return_value > max_follow_policy)
+ return_value = max_follow_policy;
+ }
+
+ return return_value;
+}
+
+CosTrading::FollowOption
+TAO_Policies::link_follow_rule (const CosTrading::Link::LinkInfo& link_info
+ ACE_ENV_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch,
+ CosTrading::Lookup::InvalidPolicyValue,
+ CosTrading::Link::IllegalLinkName,
+ CosTrading::Link::UnknownLinkName))
+{
+ CosTrading::FollowOption return_value = CosTrading::local_only;
+ CosTrading::FollowOption trader_max_follow_policy =
+ this->trader_.import_attributes ().max_follow_policy ();
+ CosTrading::FollowOption link_limiting_follow_rule =
+ link_info.limiting_follow_rule;
+
+ // If not defined defaults to trader.def_link_follow_rule
+ CosTrading::FollowOption query_link_follow_rule =
+ this->link_follow_rule (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (return_value);
+
+ return_value = (query_link_follow_rule < trader_max_follow_policy)
+ ? query_link_follow_rule : trader_max_follow_policy;
+ return_value = (return_value < link_limiting_follow_rule)
+ ? return_value : link_limiting_follow_rule;
+
+ return return_value;
+}
+
+CORBA::ULong
+TAO_Policies::hop_count (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch))
+{
+ return this->ulong_prop (HOP_COUNT ACE_ENV_ARG_PARAMETER);
+}
+
+CosTrading::Admin::OctetSeq*
+TAO_Policies::request_id (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch))
+{
+ CosTrading::Admin::OctetSeq* request_id = 0;
+
+ if (this->policies_[REQUEST_ID] != 0)
+ {
+ CosTrading::Policy* policy = this->policies_[REQUEST_ID];
+ CosTrading::PolicyValue& value = policy->value;
+ CORBA::TypeCode_var type = value.type ();
+
+ CORBA::Boolean equal_octetseq =
+ type->equal (CosTrading::Admin::_tc_OctetSeq ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (request_id);
+
+ if (!equal_octetseq)
+ ACE_THROW_RETURN (CosTrading::Lookup::PolicyTypeMismatch (*policy),
+ request_id);
+ else
+ value >>= request_id;
+ }
+
+ return request_id;
+}
+
+void
+TAO_Policies::
+copy_in_follow_option (CosTrading::PolicySeq& policy_seq,
+ const CosTrading::Link::LinkInfo& link_info
+ ACE_ENV_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch,
+ CosTrading::Lookup::InvalidPolicyValue))
+{
+ CosTrading::FollowOption follow_option = CosTrading::local_only;
+ CosTrading::FollowOption trader_max_follow_policy =
+ this->trader_.import_attributes ().max_follow_policy ();
+
+ if (this->policies_[LINK_FOLLOW_RULE] != 0)
+ {
+ CosTrading::FollowOption query_link_follow_rule =
+ this->link_follow_rule (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ follow_option = (CosTrading::FollowOption)
+ (link_info.limiting_follow_rule < trader_max_follow_policy
+ ? (link_info.limiting_follow_rule < query_link_follow_rule
+ ? link_info.limiting_follow_rule
+ : query_link_follow_rule)
+ : (trader_max_follow_policy < query_link_follow_rule
+ ? trader_max_follow_policy
+ : query_link_follow_rule));
+ }
+ else
+ follow_option = (CosTrading::FollowOption)
+ (link_info.def_pass_on_follow_rule < trader_max_follow_policy
+ ? link_info.def_pass_on_follow_rule
+ : trader_max_follow_policy);
+
+ CORBA::ULong i = 0;
+ for (i = 0; i < policy_seq.length (); i++)
+ if (ACE_OS::strcmp (policy_seq[i].name,
+ POLICY_NAMES[LINK_FOLLOW_RULE]) == 0)
+ {
+ policy_seq[i].value <<= follow_option;
+ break;
+ }
+
+ if (i == policy_seq.length ())
+ {
+ policy_seq.length (i + 1);
+ policy_seq[i].name = POLICY_NAMES[LINK_FOLLOW_RULE];
+ policy_seq[i].value <<= follow_option;
+ }
+}
+
+void
+TAO_Policies::
+copy_to_pass (CosTrading::PolicySeq& policy_seq,
+ const CosTrading::Admin::OctetSeq& request_id
+ ACE_ENV_ARG_DECL) const
+{
+ CORBA::ULong counter = 0;
+ CosTrading::Policy* policy_buffer =
+ CosTrading::PolicySeq::allocbuf (REQUEST_ID + 1);
+
+ if (policy_buffer == 0)
+ return;
+
+ for (int i = 0; i <= REQUEST_ID; i++)
+ {
+ CosTrading::Policy& new_policy = policy_buffer[counter];
+
+ if (i == REQUEST_ID)
+ {
+ // Set the new request id.
+ new_policy.name = POLICY_NAMES[REQUEST_ID];
+ new_policy.value <<= request_id;
+ counter++;
+ }
+ else if (this->policies_[i] != 0)
+ {
+ // Copy in the existing policies.
+ new_policy.name = POLICY_NAMES[i];
+ new_policy.value = this->policies_[i]->value;
+ counter++;
+ }
+
+ // We always require a hop count.
+ if (i == HOP_COUNT)
+ {
+ CORBA::ULong count = this->hop_count (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ new_policy.name = POLICY_NAMES[HOP_COUNT];
+ new_policy.value <<= count - 1;
+
+ // Don't count hop count twice.
+ if (this->policies_[i] == 0)
+ counter++;
+ }
+ }
+
+ policy_seq.replace (REQUEST_ID + 1,
+ counter,
+ policy_buffer,
+ 1);
+}
+
+void
+TAO_Policies::copy_to_forward (CosTrading::PolicySeq& policy_seq,
+ const CosTrading::TraderName& trader_name) const
+{
+ // Create a new policy sequence, shortening the starting trader
+ // policy by one link.
+
+ CORBA::ULong counter = 0;
+ CosTrading::Policy* policy_buffer =
+ CosTrading::PolicySeq::allocbuf (REQUEST_ID + 1);
+
+ if (policy_buffer == 0)
+ return;
+
+ for (int i = 0; i <= REQUEST_ID; i++)
+ {
+ CosTrading::Policy& new_policy = policy_buffer[counter];
+
+ if (this->policies_[i] != 0)
+ {
+ // Copy in the existing policies.
+ if (i == STARTING_TRADER && trader_name.length () > 1)
+ {
+ // Eliminate the first link of the trader name.
+ // Only pass on the property if the sequence
+ // contains more links after us.
+
+ // The any will sieze control of this memory.
+ // Allocating here avoids copying in the policy
+ // any.
+ CORBA::ULong length = trader_name.length ();
+ CosTrading::LinkName* buf =
+ CosTrading::TraderName::allocbuf (length - 1);
+
+ if (buf != 0)
+ {
+ for (CORBA::ULong j = 1; j < length; j++)
+ buf[j - 1] = CORBA::string_dup (trader_name[j]);
+
+ new_policy.name = this->policies_[i]->name;
+ CosTrading::TraderName new_name (length - 1,
+ length - 1,
+ buf,
+ 1);
+
+ new_policy.value <<= new_name;
+ counter++;
+ }
+ }
+ else if (i != STARTING_TRADER)
+ {
+ new_policy.name = this->policies_[i]->name;
+ new_policy.value = this->policies_[i]->value;
+ counter++;
+ }
+ }
+ }
+
+ // Create the new sequence
+ policy_seq.replace (REQUEST_ID + 1,
+ counter,
+ policy_buffer, 1);
+}
+
+TAO_Offer_Modifier::
+TAO_Offer_Modifier (const char* type_name,
+ const CosTradingRepos::ServiceTypeRepository::TypeStruct& type_struct,
+ CosTrading::Offer* offer)
+ : type_ (type_name),
+ offer_ (offer)
+{
+ const CosTradingRepos::ServiceTypeRepository::PropStructSeq&
+ pstructs = type_struct.props;
+ CosTrading::PropertySeq& prop_seq = this->offer_->properties;
+ CORBA::ULong pstructs_length = pstructs.length (),
+ props_length = prop_seq.length (),
+ i = 0;
+
+ // Create a mapping of property names to their types.
+ for (i = 0; i < pstructs_length; i++)
+ {
+ CORBA::String_var prop_name = pstructs[i].name.in ();
+ CORBA::TypeCode_ptr type_code =
+ CORBA::TypeCode::_duplicate (pstructs[i].value_type.in ());
+ this->prop_types_.bind (prop_name, type_code);
+ }
+
+ // Separate the type defined properties into mandatory and readonly
+ for (i = 0; i < pstructs_length; i++)
+ {
+ const char* pname = pstructs[i].name;
+
+ if (pstructs[i].mode ==
+ CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY)
+ {
+ CORBA::String_var prop_name (pname);
+ this->mandatory_.insert (prop_name);
+ }
+ else if (pstructs[i].mode ==
+ CosTradingRepos::ServiceTypeRepository::PROP_READONLY)
+ {
+ CORBA::String_var prop_name (pname);
+ this->readonly_.insert (prop_name);
+ }
+ }
+
+ // Insert the indices of the offer properties into a map.
+ for (i = 0; i < props_length; i++)
+ {
+ CORBA::String_var prop_name =
+ static_cast<const char*> (prop_seq[i].name);
+ this->props_.bind (prop_name, &prop_seq[i]);
+ }
+}
+
+TAO_Offer_Modifier::~TAO_Offer_Modifier (void)
+{
+ for (TAO_Typecode_Table::iterator type_iter (this->prop_types_);
+ ! type_iter.done ();
+ type_iter++)
+ {
+ CORBA::TypeCode_ptr corba_type = (*type_iter).int_id_;
+ CORBA::release (corba_type);
+ }
+}
+
+void
+TAO_Offer_Modifier::
+delete_properties (const CosTrading::PropertyNameSeq& deletes
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::Register::UnknownPropertyName,
+ CosTrading::Register::MandatoryProperty,
+ CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName))
+{
+ // Validate that the listed property names can be deleted
+ CORBA::ULong i = 0,
+ length = deletes.length ();
+ TAO_String_Set delete_me;
+
+ for (i = 0; i < length; i++)
+ {
+ const char* dname = static_cast<const char*> (deletes[i]);
+ if (! TAO_Trader_Base::is_valid_property_name (dname))
+ ACE_THROW (CosTrading::IllegalPropertyName (dname));
+ else
+ {
+ CORBA::String_var prop_name (dname);
+ if (this->mandatory_.find (prop_name) == 0)
+ ACE_THROW (CosTrading::Register::MandatoryProperty (this->type_, dname));
+ else if (delete_me.insert (prop_name) == 1)
+ ACE_THROW (CosTrading::DuplicatePropertyName (dname));
+ else if (this->props_.find (prop_name) == -1)
+ ACE_THROW (CosTrading::Register::UnknownPropertyName (dname));
+ }
+ }
+
+ // Delete those properties from the offer.
+ for (i = 0; i < length; i++)
+ {
+ CORBA::String_var prop_name =
+ static_cast<const char *> (deletes[i]);
+ this->props_.unbind (prop_name);
+ }
+}
+
+void
+TAO_Offer_Modifier::
+merge_properties (const CosTrading::PropertySeq& modifies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName,
+ CosTrading::PropertyTypeMismatch,
+ CosTrading::ReadonlyDynamicProperty,
+ CosTrading::Register::ReadonlyProperty))
+{
+ int i = 0, length = 0;
+ TAO_String_Set modify_me;
+
+ // Ensure that the proposed changes aren't to readonly properties or
+ // otherwise invalid.
+ TAO_Property_Evaluator prop_eval (modifies);
+ for (i = 0, length = modifies.length (); i < length; i++)
+ {
+ const char* mname = modifies[i].name;
+ if (TAO_Trader_Base::is_valid_property_name (mname))
+ {
+ CORBA::String_var prop_name (mname);
+ if (this->readonly_.find (prop_name) == 0)
+ {
+ // Can't assign a dynamic property to a property with
+ // readonly mode, and can't reassign a readonly property.
+ if (prop_eval.is_dynamic_property (i))
+ ACE_THROW (CosTrading::ReadonlyDynamicProperty (this->type_, mname));
+ else if (this->props_.find (prop_name) == 0)
+ ACE_THROW (CosTrading::Register::ReadonlyProperty (this->type_, mname));
+ }
+
+ // Validate the property type if the property is defined in
+ // the service type description.
+ CORBA::TypeCode_ptr type_def = 0;
+ if (this->prop_types_.find (prop_name, type_def) == 0)
+ {
+ CORBA::TypeCode_var prop_type = prop_eval.property_type (i);
+
+ // @@ Frank: This code used to have this comment and line
+ // of code before I fixed the "ACE_TRY" fuzz warning here.
+ // @@ Seth, are we trying to ignore the exception here?
+ // CORBA::Environment ACE_TRY_ENV;
+ // @@ Frank: It seems clear that this is not going to work as
+ // expected. Is the purpose to ignore any exceptions from
+ // equal ()? For now, exceptions are returned since this
+ // seemed "safest".
+
+ CORBA::Boolean td_equal =
+ type_def->equal (prop_type.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (!td_equal)
+ ACE_THROW (CosTrading::PropertyTypeMismatch (mname, modifies[i]));
+ }
+
+ if (modify_me.insert (prop_name) == 1)
+ ACE_THROW (CosTrading::DuplicatePropertyName (mname));
+ }
+ else
+ ACE_THROW (CosTrading::IllegalPropertyName (mname));
+ }
+}
+
+void
+TAO_Offer_Modifier::affect_change (const CosTrading::PropertySeq& modifies)
+{
+ // Create a new property list reflecting the deletes, modifies, and
+ // add operations performed, and place this property list in the
+ // offer.
+
+ // Merge these properties with the original set.
+ CORBA::ULong i = 0,
+ merge_length = modifies.length ();
+
+ for (i = 0; i < merge_length; i++)
+ {
+ Property_Table::ENTRY* entry = 0;
+ CORBA::String_var prop_name = modifies[i].name.in ();
+
+ CosTrading::Property* prop =
+ const_cast<CosTrading::Property*> (&modifies[i]);
+ if (this->props_.bind (prop_name, prop, entry) == 1)
+ // We need to rebind here.
+ entry->int_id_ = prop;
+ }
+
+ CORBA::ULong num_modified = 0,
+ original_length = this->offer_->properties.length (),
+ total_length = static_cast<CORBA::ULong> (this->props_.current_size ());
+
+ // Scrap the existing property sequence and begin a new one
+ CosTrading::PropertySeq prop_seq (total_length);
+ // this->offer_->properties.length (total_length);
+
+ // Copy in the unaffected and modified props into the offer,
+ // excluding those that were deleted. Let's try and retain their
+ // relative ordering.
+ for (i = 0; i < original_length; i++)
+ {
+ CosTrading::Property* prop_value = 0;
+ const char* name = this->offer_->properties[i].name;
+ CORBA::String_var prop_name (name);
+ if (this->props_.unbind (prop_name, prop_value) == 0)
+ prop_seq[num_modified++] = *prop_value;
+ }
+
+ for (i = 0; i < merge_length; i++)
+ {
+ CosTrading::Property* prop_value = 0;
+ const char* name = modifies[i].name;
+ CORBA::String_var prop_name (name);
+ if (this->props_.unbind (prop_name, prop_value) == 0)
+ prop_seq[num_modified++] = *prop_value;
+ }
+
+ this->offer_->properties.length (total_length);
+ for (i = 0; i < total_length; i++)
+ this->offer_->properties[i] = prop_seq[i];
+ // Free the old, orphaned sequence.
+ // CosTrading::PropertySeq::freebuf (prop_buf);
+}
+
+TAO_Offer_Filter::TAO_Offer_Filter (TAO_Policies& policies
+ ACE_ENV_ARG_DECL)
+{
+ search_card_ = policies.search_card (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ match_card_ = policies.match_card (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ return_card_ = policies.return_card (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ dp_ = policies.use_dynamic_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ mod_ = policies.use_modifiable_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Boolean exact_type_match =
+ policies.exact_type_match (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (exact_type_match == 1)
+ {
+ CORBA::String_var exact_match
+ (TAO_Policies::POLICY_NAMES[TAO_Policies::EXACT_TYPE_MATCH]);
+ this->limits_.insert (exact_match);
+ }
+}
+
+void
+TAO_Offer_Filter::
+configure_type (CosTradingRepos::ServiceTypeRepository::TypeStruct* type_struct)
+{
+ CosTradingRepos::ServiceTypeRepository::PropStructSeq&
+ prop_seq = type_struct->props;
+
+ // Take note of non-modifiable properties in the type_struct
+ this->not_mod_props_.reset ();
+ for (int i = prop_seq.length () - 1; i >= 0; i--)
+ {
+ CosTradingRepos::ServiceTypeRepository::PropertyMode mode = prop_seq[i].mode;
+ if (mode == CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY_READONLY ||
+ mode == CosTradingRepos::ServiceTypeRepository::PROP_READONLY)
+ {
+ CORBA::String_var prop_name ((const char*) prop_seq[i].name);
+ this->not_mod_props_.insert (prop_name);
+ }
+ }
+}
+
+CORBA::Boolean
+TAO_Offer_Filter::ok_to_consider (CosTrading::Offer* offer)
+{
+ CORBA::String_var use_mods =
+ TAO_Policies::POLICY_NAMES[TAO_Policies::USE_MODIFIABLE_PROPERTIES];
+ CORBA::String_var use_dyns =
+ TAO_Policies::POLICY_NAMES[TAO_Policies::USE_DYNAMIC_PROPERTIES];
+ CORBA::Boolean return_value = 1;
+ TAO_Property_Evaluator prop_eval (*offer);
+
+ // If we should screen offers, determine if this offer is unworthy
+ // for consideration.
+ if (! (this->mod_ && this->dp_))
+ {
+ for (int i = offer->properties.length () - 1;
+ i >= 0 && return_value;
+ i--)
+ {
+ // Winnow away the unwanted offers with modifiable or
+ // dynamic properties.
+ if (! this->mod_)
+ {
+ // Determine if this property name is found in the set
+ // of modifiable properties for the type being considered.
+ CORBA::String_var prop_name ((const char*) offer->properties[i].name);
+ if (this->not_mod_props_.find (prop_name) == -1)
+ {
+ this->limits_.insert (use_mods);
+ return_value = 0;
+ }
+ }
+
+ if (! this->dp_ && return_value)
+ {
+ // Determine if this property is dynamic.
+ if (prop_eval.is_dynamic_property (i))
+ {
+ this->limits_.insert (use_dyns);
+ return_value = 0;
+ }
+ }
+
+ if (return_value == 0)
+ break;
+ }
+ }
+
+ // If we're good to go, consider this offer considered and decrement
+ // the search cardinality counter.
+ if (return_value)
+ {
+ this->search_card_--;
+ if (this->search_card_ == 0)
+ {
+ CORBA::String_var search_card =
+ TAO_Policies::POLICY_NAMES[TAO_Policies::SEARCH_CARD];
+ this->limits_.insert (search_card);
+ }
+ }
+
+ return return_value;
+}
+
+CORBA::Boolean
+TAO_Offer_Filter::ok_to_consider_more (void)
+{
+ return this->search_card_ > 0 && this->match_card_ > 0;
+}
+
+void
+TAO_Offer_Filter::matched_offer (void)
+{
+ this->match_card_--;
+ this->return_card_--;
+
+ if (this->match_card_ == 0)
+ {
+ CORBA::String_var match_card =
+ TAO_Policies::POLICY_NAMES[TAO_Policies::MATCH_CARD];
+ this->limits_.insert (match_card);
+ }
+
+ if (this->return_card_ == 0)
+ {
+ CORBA::String_var return_card =
+ TAO_Policies::POLICY_NAMES[TAO_Policies::MATCH_CARD];
+ this->limits_.insert (return_card);
+ }
+}
+
+CORBA::ULong
+TAO_Offer_Filter::search_card_remaining (void) const
+{
+ return this->search_card_;
+}
+
+CORBA::ULong
+TAO_Offer_Filter::match_card_remaining (void) const
+{
+ return this->match_card_;
+}
+
+CosTrading::PolicyNameSeq*
+TAO_Offer_Filter::limits_applied (void)
+{
+ int i = 0;
+ CORBA::ULong size = static_cast<CORBA::ULong> (this->limits_.size ());
+ CosTrading::PolicyName* temp =
+ CosTrading::PolicyNameSeq::allocbuf (size);
+
+ for (TAO_String_Set::iterator p_iter (this->limits_.begin());
+ ! p_iter.done ();
+ p_iter.advance ())
+ {
+ CORBA::String_var* policy_name_ptr = 0;
+ p_iter.next (policy_name_ptr);
+ temp[i++] = CORBA::string_dup (policy_name_ptr->in ());
+ }
+
+ return new CosTrading::PolicyNameSeq (size, size, temp, 1);
+}
+
+TAO_Property_Filter::
+TAO_Property_Filter (const SPECIFIED_PROPS& desired_props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName))
+ : policy_ (desired_props._d ())
+{
+ if (this->policy_ == CosTrading::Lookup::some)
+ {
+ const CosTrading::PropertyNameSeq&
+ prop_seq = desired_props.prop_names ();
+ int length = prop_seq.length ();
+
+ for (int i = 0; i < length; i++)
+ {
+ const char* pname = prop_seq[i];
+
+ // Check for errors or duplicates
+ if (TAO_Trader_Base::is_valid_property_name (pname))
+ {
+ CORBA::String_var prop_name (pname);
+ if (this->props_.insert (prop_name) == 1)
+ ACE_THROW (CosTrading::DuplicatePropertyName (pname));
+ }
+ else
+ ACE_THROW (CosTrading::IllegalPropertyName (pname));
+ }
+ }
+}
+
+TAO_Property_Filter::
+TAO_Property_Filter (const TAO_Property_Filter& prop_filter)
+ : props_ (prop_filter.props_),
+ policy_ (prop_filter.policy_)
+{
+}
+
+TAO_Property_Filter&
+TAO_Property_Filter::operator= (const TAO_Property_Filter& other)
+{
+ this->props_ = other.props_;
+ this->policy_ = other.policy_;
+
+ return *this;
+}
+
+void
+TAO_Property_Filter::filter_offer (CosTrading::Offer* source,
+ CosTrading::Offer& destination)
+{
+ Prop_Queue prop_queue;
+ CosTrading::PropertySeq& s_props = source->properties;
+ CosTrading::PropertySeq& d_props = destination.properties;
+ CORBA::ULong length = static_cast<CORBA::ULong> (s_props.length ()),
+ elem = 0;
+
+ destination.reference = CORBA::Object::_duplicate (source->reference.in ());
+ if (this->policy_ == CosTrading::Lookup::some)
+ {
+ for (CORBA::ULong i = 0; i < length; i++)
+ {
+ if (this->policy_ == CosTrading::Lookup::all)
+ prop_queue.enqueue_tail (&s_props[i]);
+ else
+ {
+ const char* p_name = s_props[i].name;
+ CORBA::String_var prop_name (p_name);
+
+ // Save those property that match.
+ if (this->props_.find (prop_name) == 0)
+ prop_queue.enqueue_tail (&s_props[i]);
+ }
+ }
+
+ // Shove the matched properties into the destination property
+ // sequence.
+ length = static_cast<CORBA::ULong> (prop_queue.size ());
+ d_props.length (length);
+ for (Prop_Queue::ITERATOR prop_iter (prop_queue);
+ ! prop_iter.done ();
+ prop_iter.advance (), elem++)
+ {
+ CosTrading::Property** prop_ptr = 0;
+
+ prop_iter.next (prop_ptr);
+ d_props[elem] = **prop_ptr;
+ }
+ }
+ else if (this->policy_ == CosTrading::Lookup::all)
+ // CosTrading::Property* props = s_props.get_buffer (0);
+ // d_props.replace (length, length, props, 0);
+ d_props = s_props;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Trader_Utils.h b/TAO/orbsvcs/orbsvcs/Trader/Trader_Utils.h
new file mode 100644
index 00000000000..70b5717dde7
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Trader_Utils.h
@@ -0,0 +1,783 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Trader_Utils.h
+ *
+ * $Id$
+ *
+ * @author Seth Widoff <sbw1@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_TRADER_UTILS_H
+#define TAO_TRADER_UTILS_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Trader/Trader.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Property_Evaluator
+ *
+ * @brief This class abstracts away the details of obtaining property
+ * values and property types. Since the procedure for obtaining the
+ * value or type of a dynamic property is disparate from the method
+ * for a static property, TAO_Property_Evaluator provides methods
+ * that will unify the two approaches under a single
+ * interface. Since dynamic properties aren't necessarily supported
+ * by a trader, this class accounts for that contingency. The use of
+ * indexed lookups allows them to occur in constant time on the
+ * CORBA sequences, but requires that the client know the layout of
+ * properties ahead of time.
+ */
+class TAO_Trading_Serv_Export TAO_Property_Evaluator
+{
+public:
+
+ TAO_Property_Evaluator(const CosTrading::PropertySeq& properties,
+ CORBA::Boolean supports_dp = 1);
+
+ /**
+ * Construct an instance of TAO_Property_Evaluator that operates on
+ * an <offer> where the support for dynamic properties is dictated
+ * by <supports_dynamic_properties>.
+ */
+ TAO_Property_Evaluator(CosTrading::Offer& offer,
+ CORBA::Boolean supports_dp = 1);
+
+ /// Clean up dynamic properties.
+ virtual ~TAO_Property_Evaluator (void);
+
+ /// Returns 1 if the property at index <index> is dynamic. Returns a
+ /// 0 when the index is out of bounds.
+ int is_dynamic_property(int index);
+
+ /**
+ * Returns value of the property whose index is <index>. If the
+ * property at that index is dynamic and the trader supports dynamic
+ * properties, then the property_value method will obtain the value
+ * of the dynamic property using the evalDP method on the
+ * CosTradingDynamic::DynamicPropEval interface, passing on a
+ * CosTradingDynamic::DPEvalFailure exception on failure. If the
+ * property index is undefined, the method returns a null pointer.
+ */
+ CORBA::Any* property_value(int index ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTradingDynamic::DPEvalFailure));
+
+
+ /**
+ * Returns the type of the property whose index is <index>. If the
+ * property is dynamic and the trader supports dynamic properties,
+ * then the method returns the <returned_type> field of the
+ * CosTradingDynamic::DynamicProp struct associated with the
+ * property name. If the index is out of bounds, the method returns
+ * a null pointer (that is, 0).
+ */
+ CORBA::TypeCode_ptr property_type (int index);
+
+protected:
+
+ typedef CosTradingDynamic::DynamicProp DP_Struct;
+ typedef CosTradingDynamic::DynamicPropEval DP_Eval;
+
+ /// The offer from which the TAO_Property_Evaluator extracts property
+ /// information.
+ const CosTrading::PropertySeq& props_;
+
+ int supports_dp_;
+
+ /**
+ * In order for the client to treat the results of property_value
+ * uniformly, we need to collect the dynamically allocated anys
+ * retrieved from dynamic properties and free them upon deletion. If
+ * we didn't do this, then the property_value method would leak or
+ * cause seg faults, since the client wouldn't be able to tell
+ * whether or not the return value should be freed.
+ */
+ CORBA::Any** dp_cache_;
+
+private:
+
+ TAO_Property_Evaluator (const TAO_Property_Evaluator&);
+ TAO_Property_Evaluator& operator= (const TAO_Property_Evaluator&);
+};
+
+/**
+ * @class TAO_Property_Evaluator_By_Name
+ *
+ * @brief This class extends the TAO_Property_Evaluator to allow lookups
+ * based on the property name of interest. Since the property
+ * information is contained within an integer indexed array,
+ * lookups may occur in O(n) time, where n is the length of the
+ * array. To make lookups by name more efficient,
+ * TAO_Property_Evaluator_By_Name creates a mapping of property
+ * names to integer indicies, upon which lookups are guaranteed to
+ * be O(lg n).
+ */
+class TAO_Trading_Serv_Export TAO_Property_Evaluator_By_Name : public TAO_Property_Evaluator
+{
+public:
+
+ TAO_Property_Evaluator_By_Name (const CosTrading::PropertySeq& properties
+ ACE_ENV_ARG_DECL ,
+ CORBA::Boolean supports_dp = 1)
+ ACE_THROW_SPEC ((CosTrading::DuplicatePropertyName,
+ CosTrading::IllegalPropertyName));
+
+ /**
+ * Construct an instance of TAO_Property_Evaluator that operates on
+ * an <offer> where the support for dynamic properties is dictated
+ * by <supports_dynamic_properties>.
+ */
+ TAO_Property_Evaluator_By_Name(CosTrading::Offer& offer,
+ CORBA::Boolean supports_dp = 1);
+
+ /**
+ * Returns 1 if the property whose name is <property_name> is
+ * defined and dynamic. If the property is undefined, this method
+ * will throw a Property_Undefined exception with impunity.
+ */
+ int is_dynamic_property(const char* property_name);
+
+ /**
+ * This method is identical to its counterpart in
+ * TAO_Property_Evaluator, except property_value first discovers the
+ * index through a string matching lookup.
+ */
+ CORBA::Any* property_value(const char* property_name
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTradingDynamic::DPEvalFailure));
+
+ /**
+ * This method is identical to its counterpart in
+ * TAO_Property_Evaluator, exception property_type first discovers
+ * the index through a string matching lookup.
+ */
+ CORBA::TypeCode_ptr property_type(const char* property_name);
+
+ const CosTrading::Property* get_property (const char* property_name);
+
+private:
+
+ TAO_Property_Evaluator_By_Name (const TAO_Property_Evaluator_By_Name&);
+ TAO_Property_Evaluator_By_Name& operator= (const TAO_Property_Evaluator_By_Name&);
+
+ /// The instance of the above mapping for the offer provided in the
+ /// constructor.
+ TAO_Lookup_Table table_;
+};
+
+/**
+ * @class TAO_Dynamic_Property
+ *
+ * @brief Little helper class that you can extend to have your dynamic
+ * property handler construct CosTradingDynamic::DynamicProp structs.
+ */
+class TAO_Trading_Serv_Export TAO_Dynamic_Property
+ : public virtual POA_CosTradingDynamic::DynamicPropEval
+{
+public:
+
+ TAO_Dynamic_Property (void) {}
+ virtual ~TAO_Dynamic_Property (void);
+
+ void destroy (void);
+
+ /// Dynamic property evaluation call-back method.
+ virtual CORBA::Any* evalDP(const char* name,
+ CORBA::TypeCode_ptr returned_type,
+ const CORBA::Any& extra_info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTradingDynamic::DPEvalFailure)) = 0;
+
+ /// Method to construct a dynamic property structure suitable for
+ /// exporting in a CosTrading::PropertyStruct to the Trading Service.
+ CosTradingDynamic::DynamicProp*
+ construct_dynamic_prop (const char* name,
+ CORBA::TypeCode_ptr returned_type,
+ const CORBA::Any& extra_info);
+
+private:
+
+ CosTradingDynamic::DynamicPropEval_var prop_;
+};
+
+/**
+ * @class TAO_Policies
+ *
+ * @brief This class ensures that policies submitted to Lookup make sense,
+ * have the correct value types, and don't exceed the maximums set
+ * through the Admin Interface.
+ *
+ * TAO_Policies does an admirable job of reconciling differences
+ * between the default parameter settings of the Trader and the import
+ * and other policies set by the client. Unbeknownst to its client
+ * TAO_Policies hides this arbitration, and records whether the user
+ * policy was chosen, or the default. This information gets returned
+ * to the invoker of the query method.
+ */
+class TAO_Policies
+{
+public:
+
+#define TAO_NUM_POLICIES 11
+
+ /**
+ * This enum represents the relative order that properties are
+ * passed from one trader to another. Hence, as recommended by the
+ * spec, the starting_trader policies will be the first element in
+ * the polcy sequence if it's set for a query.
+ */
+ enum POLICY_TYPE
+ {
+ STARTING_TRADER,
+ EXACT_TYPE_MATCH,
+ HOP_COUNT,
+ LINK_FOLLOW_RULE,
+ MATCH_CARD,
+ RETURN_CARD,
+ SEARCH_CARD,
+ USE_DYNAMIC_PROPERTIES,
+ USE_MODIFIABLE_PROPERTIES,
+ USE_PROXY_OFFERS,
+ REQUEST_ID
+ };
+
+ static const char * POLICY_NAMES[];
+
+ TAO_Policies (TAO_Trader_Base& trader,
+ const CosTrading::PolicySeq& policies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::Lookup::IllegalPolicyName,
+ CosTrading::DuplicatePolicyName));
+
+ // BEGIN SPEC
+ // The "policies" parameter allows the importer to specify how the
+ // search should be performed as opposed to what sort of services
+ // should be found in the course of the search. This can be viewed
+ // as parameterizing the algorithms within the trader
+ // implementation. The "policies" are a sequence of name-value
+ // pairs. The names available to an importer depend on the
+ // implementation of the trader. However, some names are
+ // standardized where they effect the interpretation of other
+ // parameters or where they may impact linking and federation of
+ // traders. ° If a policy name in this parameter does not obey the
+ // syntactic rules for legal PolicyName's, then an IllegalPolicyName
+ // exception is raised. ° If the type of the value associated with a
+ // policy differs from that specified in this specification, then a
+ // PolicyTypeMismatch exception is raised. ° If subsequent
+ // processing of a PolicyValue yields any errors (e.g., the
+ // starting_trader policy value is malformed), then an
+ // InvalidPolicyValue exception is raised. ° If the same policy name
+ // is included two or more times in this parameter, then the
+ // DuplicatePolicyName exception is raised.
+ // END SPEC
+
+ ~TAO_Policies (void);
+
+ CORBA::ULong search_card (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch));
+
+ // BEGIN SPEC
+ // The "search_card" policy indicates to the trader the maximum
+ // number of offers it should consider when looking for type
+ // conformance and constraint expression match. The lesser of this
+ // value and the trader's max_search_card attribute is used by the
+ // trader. If this policy is not specified, then the value of the
+ // trader's def_search_card attribute is used.
+ // END SPEC
+
+ CORBA::ULong match_card (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch));
+
+ // BEGIN SPEC
+ // The "match_card" policy indicates to the trader the maximum
+ // number of matching offers to which the preference specification
+ // should be applied. The lesser of this value and the trader's
+ // max_match_card attribute is used by the trader. If this policy is
+ // not specified, then the value of the trader's def_match_card
+ // attribute is used.
+ // END SPEC
+
+ CORBA::ULong return_card (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch));
+
+ // BEGIN SPEC
+ // The "return_card" policy indicates to the trader the maximum
+ // number of matching offers to return as a result of this
+ // query. The lesser of this value and the trader's max_return_card
+ // attribute is used by the trader. If this policy is not specified,
+ // then the value of the trader's def_return_card attribute is
+ // used.
+ // END SPEC
+
+ // = Offer consideration policies
+
+ CORBA::Boolean use_modifiable_properties (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch));
+
+ // BEGIN SPEC
+ // The "use_modifiable_properties" policy indicates whether the
+ // trader should consider offers which have modifiable properties
+ // when constructing the set of offers to which type conformance and
+ // constraint processing should be applied. If the value of this
+ // policy is TRUE, then such offers will be included; if FALSE, they
+ // will not. If this policy is not specified, such offers will be
+ // included.
+ // END SPEC
+
+ CORBA::Boolean use_dynamic_properties (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch));
+
+ // BEGIN SPEC
+ // The "use_dynamic_properties" policy indicates whether the trader
+ // should consider offers which have dynamic properties when
+ // constructing the set of offers to which type conformance and
+ // constraint processing should be applied. If the value of this
+ // policy is TRUE, then such offers will be included; if FALSE, they
+ // will not. If this policy is not specified, such offers will be
+ // included.
+ // END SPEC
+
+ CORBA::Boolean use_proxy_offers (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch));
+
+ // BEGIN SPEC
+ // The "use_proxy_offers" policy indicates whether the trader should
+ // consider proxy offers when constructing the set of offers to
+ // which type conformance and constraint processing should be
+ // applied. If the value of this policy is TRUE, then such offers
+ // will be included; if FALSE, they will not. If this policy is not
+ // specified, such offers will be included.
+ // END SPEC
+
+ CORBA::Boolean exact_type_match (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch));
+
+ // BEGIN SPEC
+ // The "exact_type_match" policy indicates to the trader whether the
+ // importer's service type must exactly match an offer's service
+ // type; if not (and by default), then any offer of a type
+ // conformant to the importer's service type is considered.
+ // END SPEC
+
+ // = Federated trader policies (not implemented yet)
+
+ /**
+ * BEGIN SPEC
+ * The "starting_trader" policy facilitates the distribution of the
+ * trading service itself. It allows an importer to scope a search
+ * by choosing to explicitly navigate the links of the trading
+ * graph. If the policy is used in a query invocation it is
+ * recommended that it be the first policy-value pair; this
+ * facilitates an optimal forwarding of the query operation. A
+ * "policies" parameter need not include a value for the
+ * "starting_trader" policy. Where this policy is present, the first
+ * name component is compared against the name held in each link. If
+ * no match is found, the InvalidPolicyValue exception is
+ * raised. Otherwise, the trader invokes query() on the Lookup
+ * interface held by the named link, but passing the
+ * "starting_trader" policy with the first component removed.
+ * END SPEC
+ */
+ CosTrading::TraderName* starting_trader (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch,
+ CosTrading::Lookup::InvalidPolicyValue));
+
+ /// Determine the link follow policy for this query overall.
+ CosTrading::FollowOption link_follow_rule (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch));
+
+ // BEGIN SPEC
+ //The "link_follow_rule" policy indicates how the client wishes
+ //links to be followed in the resolution of its query. See the
+ //discussion in "Link Follow Behavior" on page 16-16 for details.
+ // END SPEC
+
+
+ /**
+ * Determine the link follow policy for a given <link_name>.
+ * This method returns the link_follow_rule for a link whose name is
+ * <link_name> using the following formula:
+ * if the importer specified a link_follow_rule policy
+ * min(trader.max_follow_policy, link.limiting_follow_rule,
+ * query.link_follow_rule)
+ * else min(trader.max_follow_policy, link.limiting_follow_rule,
+ * trader.def_follow_policy)
+ */
+ CosTrading::FollowOption link_follow_rule (const CosTrading::Link::LinkInfo& link_info
+ ACE_ENV_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch,
+ CosTrading::Lookup::InvalidPolicyValue,
+ CosTrading::Link::IllegalLinkName,
+ CosTrading::Link::UnknownLinkName));
+
+ CORBA::ULong hop_count (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch));
+
+ // BEGIN SPEC
+ // The "hop_count" policy indicates to the trader the maximum number
+ // of hops across federation links that should be tolerated in the
+ // resolution of this query. The hop_count at the current trader is
+ // determined by taking the minimum of the trader's max_hop_count
+ // attribute and the importer's hop_count policy, if provided, or
+ // the trader's def_hop_count attribute if it is not. If the
+ // resulting value is zero, then no federated queries are
+ // permitted. If it is greater than zero, then it must be
+ // decremented before passing on to a federated trader.
+ // END SPEC
+
+ /// Return the request_id passed to the query method across a link to
+ /// another trader.
+ CosTrading::Admin::OctetSeq* request_id (ACE_ENV_SINGLE_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch));
+
+ /// Policies to forward to the next trader in a federated query.
+ void copy_to_pass (CosTrading::PolicySeq& policy_seq,
+ const CosTrading::Admin::OctetSeq& request_id
+ ACE_ENV_ARG_DECL) const;
+
+ /// Policies to forward to the next trader in a directed query.
+ void copy_to_forward (CosTrading::PolicySeq& policy_seq,
+ const CosTrading::TraderName& name) const;
+
+ /**
+ * Determine the link follow policy to pass down the link with <link_name>.
+ * This method returns the link_follow_rule for a link whose name is
+ * <link_name> using the following formula:
+ * If the importer specified a link_follow_rule, policy
+ * pass on min(query.link_follow_rule, link.limiting_follow_rule,
+ * trader.max_follow_policy)
+ * else pass on min(link.def_pass_on_follow_rule,
+ * trader.max_follow_policy)
+ */
+ void copy_in_follow_option (CosTrading::PolicySeq& policy_seq,
+ const CosTrading::Link::LinkInfo& link_info
+ ACE_ENV_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch,
+ CosTrading::Lookup::InvalidPolicyValue));
+
+private:
+
+ /// Reconclile a ULong property with its default.
+ CORBA::ULong ulong_prop (POLICY_TYPE pol
+ ACE_ENV_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch));
+
+ /// Reconcile a Boolean property with its debault.
+ CORBA::Boolean boolean_prop (POLICY_TYPE pol
+ ACE_ENV_ARG_DECL) const
+ ACE_THROW_SPEC ((CosTrading::Lookup::PolicyTypeMismatch));
+
+ TAO_Policies (const TAO_Policies&);
+ TAO_Policies& operator= (const TAO_Policies&);
+
+ /// The policies indexable from the enumerated type.
+ CosTrading::Policy* policies_[TAO_NUM_POLICIES];
+
+ /// For the validating identifier names.
+ TAO_Trader_Base& trader_;
+};
+
+/**
+ * @class TAO_Policy_Creator
+ *
+ * @brief This class is a utility for clients using the CosTrading::Lookup
+ * interface that helps them build a policy sequence without violating
+ * syntax rules and having to mess with typecodes.
+ */
+class TAO_Trading_Serv_Export TAO_Policy_Creator
+{
+public:
+
+ TAO_Policy_Creator (int num_policies = 0);
+
+ // = Routines to set policies.
+
+ /// Set the maximum number of offers searched for the query.
+ void search_card (CORBA::ULong scard);
+
+ /// Set the maximum number of offers searched for the query.
+ void match_card (CORBA::ULong mcard);
+
+ /// Set the maximum number of offers rerturned for the query.
+ void return_card (CORBA::ULong rcard);
+
+ // A note about cardinalities: The spec implies that these
+ // cardinalities apply to the global office space, that is, all
+ // offers on all linked traders. However, there's no mechanism for
+ // one trader to return to the calling trader the number of offers
+ // searched or matched. Thus, these cardinalities are applied on a
+ // per-trader basis.
+
+ /// Consider offers with modifiable properties.
+ void use_modifiable_properties (CORBA::Boolean mod_props);
+
+ /// Consider offers with dynamic properties.
+ void use_dynamic_properties (CORBA::Boolean dyn_props);
+
+ /// Consider proxy offers (NOT SUPPORTED).
+ void use_proxy_offers (CORBA::Boolean prox_offs);
+
+ /// Designate a trader at which to begin the query.
+ void starting_trader (const CosTrading::TraderName& name); // Copy
+ void starting_trader (CosTrading::TraderName* name); // Own
+
+ /// Specify under what conditions a federated query is appropriate.
+ void link_follow_rule (CosTrading::FollowOption follow_option);
+
+ /// Limit the breadth of a federated query.
+ void hop_count (CORBA::ULong hop_count);
+
+ /// Set the identifier for this query (clients shouldn't use this).
+ void request_id (const CosTrading::Admin::OctetSeq& request_id);
+
+ /// Search only the designated type --- not it's subtypes.
+ void exact_type_match (CORBA::Boolean exact_type);
+
+ /// Return the constructed policy sequence.
+ operator const CosTrading::PolicySeq& (void) const;
+
+ /// Return a PolicySeq suitable for passing to the query method of
+ /// the Lookup interface.
+ const CosTrading::PolicySeq& policy_seq (void) const;
+
+private:
+
+ TAO_Policy_Creator (const TAO_Policy_Creator&);
+ TAO_Policy_Creator& operator= (const TAO_Policy_Creator&);
+
+ /// Method to prepare the next slot in the policies_ sequence for
+ /// policy insertion.
+ CosTrading::Policy& fetch_next_policy (TAO_Policies::POLICY_TYPE pol_type);
+
+ /// Table mapping policy enum value to the index in the policies sequence.
+ int poltable_[TAO_Policies::REQUEST_ID + 1];
+
+ /// The sequence being prepared for submittal to the query method.
+ CosTrading::PolicySeq policies_;
+
+ /// The number of policies so far in the sequence.
+ CORBA::ULong num_policies_;
+};
+
+/**
+ * @class TAO_Offer_Modifier
+ *
+ * @brief This class deletes, modifies, and adds properties to a given
+ * offer according to the rules of the modify method on the Register
+ * interface.
+ */
+class TAO_Offer_Modifier
+{
+public:
+
+ /// Modify an <offer> of type <type>, whose properties are described
+ /// by <type_struct>
+ TAO_Offer_Modifier (const char* type,
+ const CosTradingRepos::ServiceTypeRepository::TypeStruct& type_struct,
+ CosTrading::Offer* offer);
+
+ ~TAO_Offer_Modifier (void);
+
+ /// Delete the properties whose names were given to the
+ /// constructor. Ensure we don't delete mandatory properties.
+ void delete_properties (const CosTrading::PropertyNameSeq& deletes
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::Register::UnknownPropertyName,
+ CosTrading::Register::MandatoryProperty,
+ CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName));
+
+ /**
+ * Copy to the destination the union of the source and destination
+ * properties. In the case of duplicate properties, update the
+ * destination with the source's value. This class claims the memory
+ * in the modifies sequence.
+ */
+ void merge_properties (const CosTrading::PropertySeq& modifies
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName,
+ CosTrading::PropertyTypeMismatch,
+ CosTrading::ReadonlyDynamicProperty,
+ CosTrading::Register::ReadonlyProperty));
+
+ /// Return a reference to the Offer with the changes affected.
+ void affect_change (const CosTrading::PropertySeq& modifies);
+
+private:
+
+ TAO_Offer_Modifier (const TAO_Offer_Modifier&);
+ TAO_Offer_Modifier& operator= (const TAO_Offer_Modifier&);
+
+ typedef ACE_Hash_Map_Manager_Ex <CORBA::String_var,
+ CosTrading::Property *,
+ ACE_Hash<CORBA::String_var>,
+ ACE_Equal_To<CORBA::String_var>,
+ ACE_Null_Mutex>
+ Property_Table;
+
+ /// The type of the offer.
+ const char *type_;
+
+ /// The map of properties in the offer.
+ Property_Table props_;
+
+ /// Table of property types.
+ TAO_Typecode_Table prop_types_;
+
+ /// The set of readonly and mandatory property names in the offer's
+ /// type.
+ TAO_String_Set readonly_;
+ TAO_String_Set mandatory_;
+
+ /// A reference to the offer undergoing change.
+ CosTrading::Offer* offer_;
+};
+
+/**
+ * @class TAO_Offer_Filter
+ *
+ * @brief The purpose of this class is to ensure that offers that
+ * shouldn't be considered by the TAO_Constraint_Interpreter
+ * aren't.
+ *
+ * There two classes of reasons why an offer for a correct
+ * type shouldn't be considered: 1) The default parameters of the
+ * Trader or policies passed to the Lookup::query method deem it
+ * inappropriate to consider offers with modifiable (i.e., not
+ * readonly) or dynamic properties. 2) We've exceeded the
+ * default or provided cardinality constraints. TAO_Offer_Filter
+ * ensures that violation of policies doesn't occur. It's the
+ * enforcer.
+ */
+class TAO_Offer_Filter
+{
+public:
+
+ /// Glean from the TypeStruct and Policy setting the appropriate way
+ /// to screen unsuitable offers from consideration.
+ TAO_Offer_Filter (TAO_Policies& policies
+ ACE_ENV_ARG_DECL);
+
+ /// Set the offer filter to screen for offers containing properties
+ /// that aren't marked as readonly in this TypeStruct.
+ void configure_type (CosTradingRepos::ServiceTypeRepository::TypeStruct* type_struct);
+
+ /**
+ * Determine whether the poicies contained in the given policy
+ * object allow the Lookup interface to consider the offer. That is,
+ * if use_modifiable_properties is false, and the offer contains
+ * modifiable properties as designated in the type struct, return
+ * false. If use_dynamic_properties is false, and the offer contains
+ * dynamic properties, then return false. If the lookup interface is
+ * safe in considering this offer, return true and subtract from the
+ * search card value. When the search card value falls to zero,
+ * ok_to_consider always returns false.
+ */
+ CORBA::Boolean ok_to_consider (CosTrading::Offer* offer);
+
+ /// It's ok to consider more offers when lookup hasn't exceeded the
+ /// cardinality values for searching and matching offers.
+ CORBA::Boolean ok_to_consider_more (void);
+
+ /// Signal that the Lookup method has matched an offer; decrement the
+ /// match_card.
+ void matched_offer (void);
+
+ // = Return the limits applied.
+ /**
+ * BEGIN SPEC
+ * If any cardinality or other limits were applied by one or more
+ * traders in responding to a particular query, then the
+ * "limits_applied" parameter will contain the names of the policies
+ * which limited the query. The sequence of names returned in
+ * "limits_applied" from any federated or proxy queries must be
+ * concatenated onto the names of limits applied locally and
+ * returned.
+ * END SPEC
+ */
+ CosTrading::PolicyNameSeq* limits_applied (void);
+
+ /// Accessors to retrieve the adjusted cardinalities.
+ CORBA::ULong search_card_remaining (void) const;
+ CORBA::ULong match_card_remaining (void) const;
+
+private:
+
+ TAO_Offer_Filter (const TAO_Offer_Filter&);
+ TAO_Offer_Filter& operator= (const TAO_Offer_Filter&);
+
+ /// The set of the name of modifiable properties.
+ TAO_String_Set not_mod_props_;
+
+ /// Cardinality and property limitations applied.
+ TAO_String_Set limits_;
+
+ /// Keep track of the cardinalities.
+ CORBA::ULong search_card_, match_card_, return_card_;
+
+ /// Keep track of property limitations: modifiable or dynamic ones
+ /// may be bad.
+ CORBA::Boolean dp_;
+ CORBA::Boolean mod_;
+};
+
+/**
+ * @class TAO_Property_Filter
+ *
+ * @brief The Ace_Property_Filter copies those properties specified in a
+ * CosTrading::Lookup::SpecifiedProps from a source
+ * CosTrading::Offer to a destination CosTrading::Offer.
+ */
+class TAO_Property_Filter
+{
+public:
+
+ typedef CosTrading::Lookup::SpecifiedProps SPECIFIED_PROPS;
+
+ /// An accomplice to g++'s insane lust for copy constructors.
+ TAO_Property_Filter (void) : policy_ (CosTrading::Lookup::all) {}
+
+ /// Verify that the specified properties are correct.
+ TAO_Property_Filter (const SPECIFIED_PROPS& desired_props
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName));
+
+ TAO_Property_Filter (const TAO_Property_Filter& prop_filter);
+ TAO_Property_Filter& operator= (const TAO_Property_Filter& prop_filter);
+
+ /// Copy the desired properties from the source offer to the
+ /// destination offer.
+ void filter_offer (CosTrading::Offer* source,
+ CosTrading::Offer& destination);
+
+private:
+
+ typedef ACE_Unbounded_Queue< CosTrading::Property* > Prop_Queue;
+
+ TAO_String_Set props_;
+ CosTrading::Lookup::HowManyProps policy_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_TRADER_UTILS_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Trading_Loader.cpp b/TAO/orbsvcs/orbsvcs/Trader/Trading_Loader.cpp
new file mode 100644
index 00000000000..a4f3bfd4e5d
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Trading_Loader.cpp
@@ -0,0 +1,512 @@
+// $Id$
+
+//===========================================================================
+
+// LIBRARY
+// libTAO_CosTrading.so
+//
+// DESCRIPTION
+// This class allows for dynamically loading
+// the Trading Service.
+//
+// AUTHORS
+// Priyanka Gontla <pgontla@ece.uci.edu>
+
+//===========================================================================
+
+#include "orbsvcs/Trader/Trading_Loader.h"
+
+#include "tao/ORB_Core.h"
+#include "tao/default_ports.h"
+#include "tao/IORTable/IORTable.h"
+
+#include "ace/Dynamic_Service.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/Argv_Type_Converter.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/os_include/os_netdb.h"
+
+ACE_RCSID (Trader, Trading_Loader, "$Id$")
+
+TAO_Trading_Loader::TAO_Trading_Loader (void)
+ : federate_ (0),
+ ior_output_file_ (0),
+ bootstrapper_ (0)
+{
+ char *trader_name = CORBA::string_alloc (MAXHOSTNAMELEN + 10);
+
+ if (trader_name != 0)
+ {
+ // The trader name is the concatenation of the local host name
+ // and the server's process id.
+ char host_name[MAXHOSTNAMELEN + 1];
+ ACE_INET_Addr localhost ((u_short) 0);
+ if (localhost.get_host_name (host_name, sizeof (host_name)) != 0)
+ {
+ const char *tmp = localhost.get_host_addr ();
+ if (tmp == 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\n\nTAO Trading Service (%P|%t) ")
+ ACE_TEXT ("TAO_Trading_Loader ")
+ ACE_TEXT ("- %p\n\n"),
+ ACE_TEXT ("cannot determine hostname")));
+ else
+ ACE_OS::strcpy (host_name, tmp);
+ }
+
+ ACE_OS::sprintf (trader_name,
+ "%s_%ld",
+ host_name,
+ static_cast<long> (ACE_OS::getpid ()));
+
+ for (char *dot = 0;
+ (dot = ACE_OS::strchr (trader_name, '.')) != 0;
+ *dot = '_')
+ continue;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Trading Service %s initializing.\n",
+ trader_name));
+
+ this->name_ = trader_name;
+ }
+}
+
+TAO_Trading_Loader::~TAO_Trading_Loader (void)
+{
+ // Destructor
+}
+
+int
+TAO_Trading_Loader::init (int argc, ACE_TCHAR *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Copy command line parameter.
+ ACE_Argv_Type_Converter command_line(argc, argv);
+
+ // Initialize the ORB Manager
+ this->orb_manager_.init (command_line.get_argc(),
+ command_line.get_ASCII_argv()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_var orb =
+ this->orb_manager_.orb ();
+
+ // Initializes and sets up the Trading Service
+ CORBA::Object_var object =
+ this->create_object (orb.in (), command_line.get_argc(), command_line.get_TCHAR_argv() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ // @@ Should we log this???
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+TAO_Trading_Loader::fini (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ if (this->trader_.get () != 0)
+ {
+ TAO_Trading_Components_i& trd_comp
+ = this->trader_->trading_components ();
+ CosTrading::Link_ptr our_link =
+ trd_comp.link_if ();
+
+ CosTrading::LinkNameSeq_var link_name_seq =
+ our_link->list_links (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Unlinking from federated traders.\n"));
+
+ for (CORBA::ULong j = 0;
+ j != link_name_seq->length ();
+ ++j)
+ {
+ CORBA::ULong i =
+ link_name_seq->length () - j - 1;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Describing the next link.\n"));
+ CosTrading::Link::LinkInfo_var link_info =
+ our_link->describe_link (link_name_seq[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Removing link to %s.\n",
+ static_cast<const char *> (link_name_seq[i])));
+ our_link->remove_link (link_name_seq[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosTrading::Lookup_ptr remote_lookup;
+ remote_lookup =
+ link_info->target.in ();
+
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Retrieving its link interface.\n"));
+ CosTrading::Link_var remote_link =
+ remote_lookup->link_if (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Removing its link to us.\n"));
+
+ if (this->bootstrapper_)
+ {
+ remote_link->remove_link ("Bootstrap"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ remote_link->remove_link (this->name_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Trading Service shutting down");
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+TAO_Trading_Loader::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int return_value =
+ this->orb_manager_.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return return_value;
+}
+
+CORBA::Object_ptr
+TAO_Trading_Loader::create_object (CORBA::ORB_ptr orb_ptr,
+ int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Duplicate the ORB
+ CORBA::ORB_var orb = CORBA::ORB::_duplicate (orb_ptr);
+
+ // Activating the poa manager
+ this->orb_manager_.activate_poa_manager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ // Create a Trader Object and set its Service Type Repository.
+ auto_ptr<TAO_Trader_Factory::TAO_TRADER> auto_trader (TAO_Trader_Factory::create_trader (argc, argv));
+
+ this->trader_ = auto_trader;
+
+ TAO_Support_Attributes_i &sup_attr =
+ this->trader_->support_attributes ();
+
+ TAO_Trading_Components_i &trd_comp =
+ this->trader_->trading_components ();
+
+ sup_attr.type_repos (this->type_repos_._this (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ // The Spec says: return a reference to the Lookup interface from
+ // the resolve_initial_references method.
+ CosTrading::Lookup_ptr lookup =
+ trd_comp.lookup_if ();
+
+ this->ior_ =
+ orb->object_to_string (lookup
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ // Parse the args
+ if (this->parse_args (argc, argv) == -1)
+ return CORBA::Object::_nil ();
+
+ // Dump the ior to a file.
+ if (this->ior_output_file_ != 0)
+ {
+ ACE_OS::fprintf (this->ior_output_file_,
+ "%s",
+ this->ior_.in ());
+ ACE_OS::fclose (this->ior_output_file_);
+ }
+
+ CORBA::Object_var table_object =
+ orb->resolve_initial_references ("IORTable" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ IORTable::Table_var adapter =
+ IORTable::Table::_narrow (table_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ if (CORBA::is_nil (adapter.in ()))
+ {
+ ACE_ERROR ((LM_ERROR, "Nil IORTable\n"));
+ }
+ else
+ {
+ adapter->bind ("TradingService",
+ this->ior_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+ }
+
+ if (this->federate_)
+ {
+ // Only become a multicast server if we're the only trader
+ // on the multicast network.
+ // @@ Could do other things. For example, every timeout
+ // period try to federate again, but let's not hardcode that
+ // policy.
+ int rc = this->bootstrap_to_federation (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ if (rc == -1)
+ this->init_multicast_server ();
+ }
+ else
+ this->init_multicast_server ();
+
+ return CORBA::Object::_nil ();
+}
+
+int
+TAO_Trading_Loader::bootstrap_to_federation (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // If all traders follow this strategy, it creates a complete graph
+ // of all known traders on a multicast network.
+ CORBA::ORB_var orb =
+ this->orb_manager_.orb ();
+
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Bootstrapping to another Trading Service.\n"));
+ CORBA::Object_var trading_obj =
+ orb->resolve_initial_references ("TradingService" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (trading_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "We're all alone. "
+ "Unable to link to other traders.\n"),
+ -1);
+
+ 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_CHECK_RETURN (-1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Obtaining the link interface.\n"));
+ CosTrading::Link_var link_if =
+ lookup_if->link_if (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ TAO_Trading_Components_i &trd_comp =
+ this->trader_->trading_components ();
+ CosTrading::Lookup_ptr our_lookup =
+ trd_comp.lookup_if ();
+ CosTrading::Link_ptr our_link =
+ trd_comp.link_if ();
+
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Linking found trader to self.\n"));
+ link_if->add_link (this->name_.in (),
+ our_lookup,
+ CosTrading::always,
+ CosTrading::always
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Linking self to found trader.\n"));
+ our_link->add_link ("Bootstrap",
+ lookup_if.in (),
+ CosTrading::always,
+ CosTrading::always
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Retrieving list of known linked traders.\n"));
+ CosTrading::LinkNameSeq_var link_name_seq =
+ link_if->list_links (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Linking self to all linked traders.\n"));
+ for (CORBA::ULong i = link_name_seq->length () - 1;
+ i > 0;
+ i--)
+ {
+ // Avoid linking to ourselves.
+ if (ACE_OS::strcmp (static_cast<const char *> (link_name_seq[i]),
+ this->name_.in ()) != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Getting info for link %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_CHECK_RETURN (-1);
+
+ CosTrading::Lookup_ptr remote_lookup;
+ remote_lookup = link_info->target.in ();
+
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Retrieving its link interface.\n"));
+ CosTrading::Link_var remote_link =
+ remote_lookup->link_if (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Creating a link to me from it.\n"));
+ remote_link->add_link (this->name_.in (),
+ our_lookup,
+ CosTrading::always,
+ CosTrading::always
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "*** Creating a link to it from me.\n"));
+ our_link->add_link (link_name_seq[i],
+ remote_lookup,
+ CosTrading::always,
+ CosTrading::always
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ }
+
+ return 0;
+}
+
+int
+TAO_Trading_Loader::init_multicast_server (void)
+{
+#if defined (ACE_HAS_IP_MULTICAST)
+ // Get reactor instance from TAO.
+ ACE_Reactor *reactor = TAO_ORB_Core_instance ()->reactor ();
+
+ // See if the -ORBMulticastDiscoveryEndpoint option was specified.
+ ACE_CString mde (TAO_ORB_Core_instance ()->orb_params ()
+ ->mcast_discovery_endpoint ());
+
+ // First, see if the user has given us a multicast port number for
+ // the name service on the command-line;
+ u_short port =
+ TAO_ORB_Core_instance ()->orb_params ()->service_port (TAO::MCAST_TRADINGSERVICE);
+
+ if (port == 0)
+ {
+ const char *port_number =
+ ACE_OS::getenv ("TradingServicePort");
+
+ if (port_number != 0)
+ port = static_cast<u_short> (ACE_OS::atoi (port_number));
+ else
+ port = TAO_DEFAULT_TRADING_SERVER_REQUEST_PORT;
+ }
+
+ // Instantiate a server that will receive requests for an ior
+ if (mde.length () != 0)
+ {
+ if (this->ior_multicast_.init ((char *) this->ior_.in (),
+ mde.c_str (),
+ TAO_SERVICEID_TRADINGSERVICE) == -1)
+ return -1;
+ }
+ else
+ {
+ if (this->ior_multicast_.init ((char *) this->ior_.in (),
+ port,
+ ACE_DEFAULT_MULTICAST_ADDR,
+ TAO_SERVICEID_TRADINGSERVICE) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Failed to init IOR multicast.\n"),
+ -1);
+ }
+
+ // Register event handler for the ior multicast.
+ if (reactor->register_handler (&this->ior_multicast_,
+ ACE_Event_Handler::READ_MASK) == -1)
+ ACE_DEBUG ((LM_DEBUG,
+ "cannot register Event handler\n"));
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "The multicast server setup is done.\n"));
+
+ // Other trader instances will bootstrap to us.
+ this->bootstrapper_ = 1;
+
+#endif /* ACE_HAS_IP_MULTICAST */
+ return 0;
+}
+
+
+int
+TAO_Trading_Loader::parse_args (int &argc, ACE_TCHAR *argv [])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ while (arg_shifter.is_anything_left ())
+ {
+ const ACE_TCHAR *current_arg = arg_shifter.get_current ();
+
+ if (ACE_OS::strcmp (current_arg,
+ ACE_TEXT("-TSfederate")) == 0)
+ {
+ arg_shifter.consume_arg ();
+ this->federate_ = 1;
+ }
+ if (ACE_OS::strcmp (current_arg,
+ ACE_TEXT("-TSdumpior")) == 0)
+ {
+ arg_shifter.consume_arg ();
+ if (arg_shifter.is_parameter_next ())
+ {
+ const ACE_TCHAR *file_name =
+ arg_shifter.get_current ();
+ this->ior_output_file_ =
+ ACE_OS::fopen (file_name, ACE_TEXT("w"));
+
+ if (this->ior_output_file_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to open %s for writing: %p\n",
+ file_name), -1);
+ arg_shifter.consume_arg ();
+ }
+ else
+ this->ior_output_file_ =
+ ACE_OS::fdopen (ACE_STDOUT,
+ ACE_TEXT("w"));
+ }
+
+ else
+ arg_shifter.ignore_arg ();
+ }
+
+ return 0;
+}
+
+ACE_FACTORY_DEFINE (TAO_Trading_Serv, TAO_Trading_Loader)
+
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Trading_Loader.h b/TAO/orbsvcs/orbsvcs/Trader/Trading_Loader.h
new file mode 100644
index 00000000000..3b344cd9333
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/Trading_Loader.h
@@ -0,0 +1,116 @@
+// -*- C++ -*-
+
+// $Id$
+
+// ===========================================================================
+// FILENAME
+// Trading_Loader.h
+//
+// DESCRIPTION
+// This class loads the Trading Service dynamically
+// either from svc.conf file or <string_to_object> call.
+//
+// AUTHORS
+// Priyanka Gontla <pgontla@ece.uci.edu>
+//
+// ==========================================================================
+
+#ifndef TAO_TRADING_LOADER_H
+#define TAO_TRADING_LOADER_H
+
+#include "orbsvcs/Trader/Trader.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/IOR_Multicast.h"
+#include "orbsvcs/Trader/Service_Type_Repository.h"
+
+#include "tao/Object_Loader.h"
+#include "tao/Utils/ORB_Manager.h"
+#include "ace/Auto_Ptr.h"
+
+class TAO_Trading_Serv_Export TAO_Trading_Loader : public TAO_Object_Loader
+{
+public:
+
+ TAO_Trading_Loader (void);
+ // Constructor
+
+ ~TAO_Trading_Loader (void);
+ // Destructor
+
+ virtual int init (int argc, ACE_TCHAR *argv[]);
+ // Called by the Service Configurator framework to initialize the
+ // Event Service. Defined in <ace/Service_Config.h>
+
+ virtual int fini (void);
+ // Called by the Service Configurator framework to remove the
+ // Event Service. Defined in <ace/Service_Config.h>
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the Trading Service
+
+ CORBA::Object_ptr create_object (CORBA::ORB_ptr orb,
+ int argc,
+ ACE_TCHAR *argv[]
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // This function call initializes the Trading Service given a reference to the
+ // ORB and the command line parameters.
+
+protected:
+
+ int init_multicast_server (void);
+ // Enable the Trading Service to answer multicast requests for its
+ // IOR.
+
+ int bootstrap_to_federation (ACE_ENV_SINGLE_ARG_DECL);
+ // Bootstrap to another trader, and attach to its trader network.
+
+ int parse_args (int &argc, ACE_TCHAR *argv []);
+ // Parses the command line arguments
+
+ TAO_ORB_Manager orb_manager_;
+ // The ORB manager.
+
+ auto_ptr<TAO_Trader_Factory::TAO_TRADER> trader_;
+ // Pointer to the linked trader.
+
+ TAO_Service_Type_Repository type_repos_;
+ // Service Type Repository used by the trading service.
+
+ CORBA::String_var ior_;
+ // IOR of the trader kept around for handiness purposes.
+
+ CORBA::Boolean federate_;
+ // Flag indicating whether this trader should join the federation.
+
+ FILE *ior_output_file_;
+ // File to output the Naming Service IOR.
+
+ CORBA::String_var name_;
+ // Name of this trading service: "hostname:pid".
+
+ TAO_IOR_Multicast ior_multicast_;
+ // Event handler that responds to resolve_initial_references
+ // requests.
+
+ CORBA::Boolean bootstrapper_;
+ // Flag inidicating whether we're the trader others are bootstrapping to.
+
+ CORBA::Boolean dumpior_;
+ // Flag indication whether to dump the ior to standard output
+
+private:
+
+ // Disallow copying and assignment.
+ TAO_Trading_Loader (const TAO_Trading_Loader &);
+ TAO_Trading_Loader &operator= (const TAO_Trading_Loader &);
+
+};
+
+ACE_FACTORY_DECLARE (TAO_Trading_Serv, TAO_Trading_Loader)
+
+#endif /* TAO_TRADING_LOADER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Trader/constraint.l b/TAO/orbsvcs/orbsvcs/Trader/constraint.l
new file mode 100644
index 00000000000..9d1aef05376
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/constraint.l
@@ -0,0 +1,136 @@
+%{
+// $Id$
+// ========================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// constraint.l
+//
+// = AUTHOR
+// Seth Widoff <sbw1@cs.wustl.edu>
+//
+// ========================================================================
+
+#include "ace/OS.h"
+#include "Constraint_Interpreter.h"
+#include "Constraint_Nodes.h"
+#include "Constraint_Tokens.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+static TAO_Literal_Constraint* extract_string(const char*);
+
+#define TAO_YY_LEX_DEBUG
+
+#ifdef TAO_CONSTRAINT_DEBUG
+#define TAO_YY_LEX_DEBUG ACE_OS::fprintf(stderr, "%s\n", yytext)
+#endif /* TAO_CONSTRAINT_DEBUG */
+
+
+%}
+
+white_space [ \t]
+letter [a-zA-Z]
+digit [0-9]
+alpha_num ({letter}|{digit})
+integer [-+]?{digit}+
+float ({digit}*\.{digit}+)([eE][-+]?{digit}+)?
+string '(([^'\\]*)|([^'\\]*\\')|([^'\\]*\\\\))*'
+ident {letter}({alpha_num}|[_])*
+newline \n
+unknown [^ \t]
+
+%%
+
+min { TAO_YY_LEX_DEBUG; return TAO_MIN; }
+max { TAO_YY_LEX_DEBUG; return TAO_MAX; }
+first { TAO_YY_LEX_DEBUG; return TAO_FIRST; }
+random { TAO_YY_LEX_DEBUG; return TAO_RANDOM; }
+with { TAO_YY_LEX_DEBUG; return TAO_WITH; }
+exist { TAO_YY_LEX_DEBUG; return TAO_EXIST; }
+not { TAO_YY_LEX_DEBUG; return TAO_NOT; }
+and { TAO_YY_LEX_DEBUG; return TAO_AND; }
+or { TAO_YY_LEX_DEBUG; return TAO_OR; }
+in { TAO_YY_LEX_DEBUG; return TAO_IN; }
+"~" { TAO_YY_LEX_DEBUG; return TAO_TWIDDLE; }
+"+" { TAO_YY_LEX_DEBUG; return TAO_PLUS; }
+"-" { TAO_YY_LEX_DEBUG; return TAO_MINUS; }
+"*" { TAO_YY_LEX_DEBUG; return TAO_MULT; }
+"/" { TAO_YY_LEX_DEBUG; return TAO_DIV; }
+"<" { TAO_YY_LEX_DEBUG; return TAO_LT; }
+"<=" { TAO_YY_LEX_DEBUG; return TAO_LE; }
+">" { TAO_YY_LEX_DEBUG; return TAO_GT; }
+">=" { TAO_YY_LEX_DEBUG; return TAO_GE; }
+"==" { TAO_YY_LEX_DEBUG; return TAO_EQ; }
+"!=" { TAO_YY_LEX_DEBUG; return TAO_NE; }
+"(" { TAO_YY_LEX_DEBUG; return TAO_LPAREN; }
+")" { TAO_YY_LEX_DEBUG; return TAO_RPAREN; }
+TRUE {
+ yylval.constraint_ =
+ new TAO_Literal_Constraint(true);
+ TAO_YY_LEX_DEBUG; return TAO_BOOLEAN;
+ }
+FALSE {
+ yylval.constraint_ =
+ new TAO_Literal_Constraint(false);
+ TAO_YY_LEX_DEBUG; return TAO_BOOLEAN;
+ }
+{integer} {
+ yylval.constraint_ =
+ new TAO_Literal_Constraint((yytext[0] == '-' ?
+ (CORBA::Long)atoi(yytext) : (CORBA::ULong)atoi(yytext)));
+ TAO_YY_LEX_DEBUG; return TAO_NUMBER;
+ }
+{float} {
+ yylval.constraint_ =
+ new TAO_Literal_Constraint((CORBA::Double)atof(yytext));
+ TAO_YY_LEX_DEBUG; return TAO_NUMBER;
+ }
+{string} {
+ yylval.constraint_ = extract_string(yytext);
+ TAO_YY_LEX_DEBUG; return TAO_STRING;
+ }
+{ident} {
+ yylval.constraint_ =
+ new TAO_Property_Constraint(yytext);
+ TAO_YY_LEX_DEBUG; return TAO_IDENT;
+ }
+{unknown} {
+ TAO_YY_LEX_DEBUG; return TAO_UNKNOWN;
+ }
+%%
+
+TAO_Literal_Constraint*
+extract_string(const char* total)
+{
+ int prev_slash = 0,
+ ctr = 0;
+ char str[BUFSIZ],
+ *tmp = (char*) total + 1;
+
+ while (*tmp != '\0')
+ {
+ if (*tmp == '\\')
+ {
+ if (prev_slash)
+ prev_slash = 0;
+ else
+ {
+ prev_slash = 1;
+ continue;
+ }
+ }
+ else if (*tmp == '\'')
+ prev_slash = 0;
+
+ str[ctr++] = *tmp;
+ tmp++;
+ }
+
+ str[ctr - 1] = '\0';
+ return new TAO_Literal_Constraint(str);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Trader/constraint.y b/TAO/orbsvcs/orbsvcs/Trader/constraint.y
new file mode 100644
index 00000000000..7d32796775a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/constraint.y
@@ -0,0 +1,139 @@
+%{
+ // $Id$
+// ========================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// constraint.y
+//
+// = AUTHOR
+// Seth Widoff <sbw1@cs.wustl.edu>
+//
+// ========================================================================
+
+#include "ace/OS.h"
+#include "Constraint_Interpreter.h"
+#include "Constraint_Nodes.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+//#define YYDEBUG 1
+%}
+
+%token TAO_GT TAO_GE TAO_LT TAO_LE TAO_EQ TAO_NE TAO_EXIST
+%token TAO_AND TAO_OR TAO_NOT TAO_IN TAO_TWIDDLE TAO_BOOLEAN
+%token TAO_PLUS TAO_MINUS TAO_MULT TAO_DIV TAO_UMINUS TAO_NUMBER
+%token TAO_RPAREN TAO_LPAREN TAO_IDENT TAO_STRING TAO_UNKNOWN
+%token TAO_UNSIGNED TAO_SIGNED TAO_DOUBLE TAO_CONSTRAINT TAO_SEQUENCE
+%token TAO_WITH TAO_MAX TAO_MIN TAO_FIRST TAO_RANDOM
+
+%start constraint
+
+%type <constraint_> TAO_IDENT TAO_NUMBER TAO_STRING TAO_BOOLEAN
+%type <constraint_> constraint preference bool_or bool_and bool_compare
+%type <constraint_> expr_in expr_twiddle expr term factor_not factor
+
+%%
+
+constraint: bool_or
+ { $$ = new TAO_Unary_Constraint(TAO_CONSTRAINT, $1); }
+ | preference
+ { $$ = $1; }
+ ;
+
+preference: TAO_MIN bool_or
+{ $$ = new TAO_Unary_Constraint(TAO_MIN, $2); }
+ | TAO_MAX bool_or
+{ $$ = new TAO_Unary_Constraint(TAO_MAX, $2); }
+ | TAO_WITH bool_or
+{ $$ = new TAO_Unary_Constraint(TAO_WITH, $2); }
+ | TAO_FIRST
+{ $$ = new TAO_Noop_Constraint(TAO_FIRST); }
+ | TAO_RANDOM
+{ $$ = new TAO_Noop_Constraint(TAO_RANDOM); }
+ ;
+
+bool_or: bool_or TAO_OR bool_and
+ { $$ = new TAO_Binary_Constraint(TAO_OR, $1, $3); }
+ | bool_and
+ { $$ = $1; }
+ ;
+
+bool_and: bool_and TAO_AND bool_compare
+ { $$ = new TAO_Binary_Constraint(TAO_AND, $1, $3); }
+ | bool_compare
+ { $$ = $1; }
+ ;
+
+bool_compare: expr_in TAO_EQ expr_in
+ { $$ = new TAO_Binary_Constraint(TAO_EQ, $1, $3); }
+ | expr_in TAO_NE expr_in
+ { $$ = new TAO_Binary_Constraint(TAO_NE, $1, $3); }
+ | expr_in TAO_GT expr_in
+ { $$ = new TAO_Binary_Constraint(TAO_GT, $1, $3); }
+ | expr_in TAO_GE expr_in
+ { $$ = new TAO_Binary_Constraint(TAO_GE, $1, $3); }
+ | expr_in TAO_LT expr_in
+ { $$ = new TAO_Binary_Constraint(TAO_LT, $1, $3); }
+ | expr_in TAO_LE expr_in
+ { $$ = new TAO_Binary_Constraint(TAO_LE, $1, $3); }
+ | expr_in
+ { $$ = $1; }
+ ;
+
+expr_in: expr_twiddle TAO_IN TAO_IDENT
+ { $$ = new TAO_Binary_Constraint(TAO_IN, $1, $3); }
+ | expr_twiddle
+ { $$ = $1; }
+ ;
+
+expr_twiddle: expr TAO_TWIDDLE expr
+ { $$ = new TAO_Binary_Constraint(TAO_TWIDDLE, $1, $3); }
+ | expr
+ { $$ = $1; }
+ ;
+
+expr: expr TAO_PLUS term
+ { $$ = new TAO_Binary_Constraint(TAO_PLUS, $1, $3); }
+ | expr TAO_MINUS term
+ { $$ = new TAO_Binary_Constraint(TAO_MINUS, $1, $3); }
+ | term
+ { $$ = $1; }
+ ;
+
+term: term TAO_MULT factor_not
+ { $$ = new TAO_Binary_Constraint(TAO_MULT, $1, $3); }
+ | term TAO_DIV factor_not
+ { $$ = new TAO_Binary_Constraint(TAO_DIV, $1, $3); }
+ | factor_not
+ { $$ = $1; }
+ ;
+
+factor_not: TAO_NOT factor
+ { $$ = new TAO_Unary_Constraint(TAO_NOT, $2); }
+ | factor
+ { $$ = $1; }
+ ;
+
+factor: TAO_LPAREN bool_or TAO_RPAREN
+ { $$ = $2; }
+ | TAO_EXIST TAO_IDENT
+ { $$ = new TAO_Unary_Constraint(TAO_EXIST, $2); }
+ | TAO_IDENT
+ { $$ = $1; }
+ | TAO_NUMBER
+ { $$ = $1; }
+ | TAO_MINUS TAO_NUMBER
+ { $$ = new TAO_Unary_Constraint(TAO_UMINUS, $2); }
+ | TAO_STRING
+ { $$ = $1; }
+ | TAO_BOOLEAN
+ { $$ = $1; }
+ ;
+
+%%
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+//extern int yydebug = 1;
diff --git a/TAO/orbsvcs/orbsvcs/Trader/trading_export.h b/TAO/orbsvcs/orbsvcs/Trader/trading_export.h
new file mode 100644
index 00000000000..079cf570be9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/trading_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_TRADING_EXPORT_H
+#define TAO_TRADING_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_TRADING_HAS_DLL)
+# define TAO_TRADING_HAS_DLL 0
+# endif /* ! TAO_TRADING_HAS_DLL */
+#else
+# if !defined (TAO_TRADING_HAS_DLL)
+# define TAO_TRADING_HAS_DLL 1
+# endif /* ! TAO_TRADING_HAS_DLL */
+#endif
+
+#if defined (TAO_TRADING_HAS_DLL) && (TAO_TRADING_HAS_DLL == 1)
+# if defined (TAO_TRADING_BUILD_DLL)
+# define TAO_Trading_Export ACE_Proper_Export_Flag
+# define TAO_TRADING_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_TRADING_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_TRADING_BUILD_DLL */
+# define TAO_Trading_Export ACE_Proper_Import_Flag
+# define TAO_TRADING_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_TRADING_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_TRADING_BUILD_DLL */
+#else /* TAO_TRADING_HAS_DLL == 1 */
+# define TAO_Trading_Export
+# define TAO_TRADING_SINGLETON_DECLARATION(T)
+# define TAO_TRADING_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_TRADING_HAS_DLL == 1 */
+
+#endif /* TAO_TRADING_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Trader/trading_serv_export.h b/TAO/orbsvcs/orbsvcs/Trader/trading_serv_export.h
new file mode 100644
index 00000000000..187f4ab03cd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/trading_serv_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_TRADING_SERV_EXPORT_H
+#define TAO_TRADING_SERV_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_TRADING_SERV_HAS_DLL)
+# define TAO_TRADING_SERV_HAS_DLL 0
+# endif /* ! TAO_TRADING_SERV_HAS_DLL */
+#else
+# if !defined (TAO_TRADING_SERV_HAS_DLL)
+# define TAO_TRADING_SERV_HAS_DLL 1
+# endif /* ! TAO_TRADING_SERV_HAS_DLL */
+#endif
+
+#if defined (TAO_TRADING_SERV_HAS_DLL) && (TAO_TRADING_SERV_HAS_DLL == 1)
+# if defined (TAO_TRADING_SERV_BUILD_DLL)
+# define TAO_Trading_Serv_Export ACE_Proper_Export_Flag
+# define TAO_TRADING_SERV_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_TRADING_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_TRADING_SERV_BUILD_DLL */
+# define TAO_Trading_Serv_Export ACE_Proper_Import_Flag
+# define TAO_TRADING_SERV_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_TRADING_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_TRADING_SERV_BUILD_DLL */
+#else /* TAO_TRADING_SERV_HAS_DLL == 1 */
+# define TAO_Trading_Serv_Export
+# define TAO_TRADING_SERV_SINGLETON_DECLARATION(T)
+# define TAO_TRADING_SERV_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_TRADING_SERV_HAS_DLL == 1 */
+
+#endif /* TAO_TRADING_SERV_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Trader/trading_skel_export.h b/TAO/orbsvcs/orbsvcs/Trader/trading_skel_export.h
new file mode 100644
index 00000000000..3b0f399cef9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Trader/trading_skel_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_TRADING_SKEL_EXPORT_H
+#define TAO_TRADING_SKEL_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_TRADING_SKEL_HAS_DLL)
+# define TAO_TRADING_SKEL_HAS_DLL 0
+# endif /* ! TAO_TRADING_SKEL_HAS_DLL */
+#else
+# if !defined (TAO_TRADING_SKEL_HAS_DLL)
+# define TAO_TRADING_SKEL_HAS_DLL 1
+# endif /* ! TAO_TRADING_SKEL_HAS_DLL */
+#endif
+
+#if defined (TAO_TRADING_SKEL_HAS_DLL) && (TAO_TRADING_SKEL_HAS_DLL == 1)
+# if defined (TAO_TRADING_SKEL_BUILD_DLL)
+# define TAO_Trading_Skel_Export ACE_Proper_Export_Flag
+# define TAO_TRADING_SKEL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_TRADING_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_TRADING_SKEL_BUILD_DLL */
+# define TAO_Trading_Skel_Export ACE_Proper_Import_Flag
+# define TAO_TRADING_SKEL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_TRADING_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_TRADING_SKEL_BUILD_DLL */
+#else /* TAO_TRADING_SKEL_HAS_DLL == 1 */
+# define TAO_Trading_Skel_Export
+# define TAO_TRADING_SKEL_SINGLETON_DECLARATION(T)
+# define TAO_TRADING_SKEL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_TRADING_SKEL_HAS_DLL == 1 */
+
+#endif /* TAO_TRADING_SKEL_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/ec_typed_events.mpb b/TAO/orbsvcs/orbsvcs/ec_typed_events.mpb
new file mode 100644
index 00000000000..ffe3eef08e1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ec_typed_events.mpb
@@ -0,0 +1,21 @@
+// -*- MPC -*-
+// $Id$
+
+feature(ec_typed_events) {
+ macros += TAO_HAS_TYPED_EVENT_CHANNEL
+
+ Source_Files {
+ CosTypedEventCommC.cpp
+ CosTypedEventChannelAdminC.cpp
+ }
+
+ Header_Files {
+ CosTypedEventCommC.h
+ CosTypedEventChannelAdminC.h
+ }
+
+ Inline_Files {
+ CosTypedEventCommC.inl
+ CosTypedEventChannelAdminC.inl
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/ec_typed_events_idl.mpb b/TAO/orbsvcs/orbsvcs/ec_typed_events_idl.mpb
new file mode 100644
index 00000000000..a70334dd978
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ec_typed_events_idl.mpb
@@ -0,0 +1,16 @@
+// -*- MPC -*-
+// $Id$
+
+feature(ec_typed_events) {
+ macros += TAO_HAS_TYPED_EVENT_CHANNEL
+
+ idlflags += -Wb,stub_export_macro=TAO_Event_Export -Wb,stub_export_include=orbsvcs/CosEvent/event_export.h -Wb,skel_export_macro=TAO_Event_Skel_Export -Wb,skel_export_include=orbsvcs/CosEvent/event_skel_export.h
+
+ IDL_Files {
+ CosTypedEventComm.idl
+ CosTypedEventChannelAdmin.idl
+ }
+
+ idlflags -= -Wb,stub_export_macro=TAO_Event_Export -Wb,stub_export_include=orbsvcs/CosEvent/event_export.h -Wb,skel_export_macro=TAO_Event_Skel_Export -Wb,skel_export_include=orbsvcs/CosEvent/event_skel_export.h
+
+}
diff --git a/TAO/orbsvcs/orbsvcs/ec_typed_events_serv.mpb b/TAO/orbsvcs/orbsvcs/ec_typed_events_serv.mpb
new file mode 100644
index 00000000000..b57bcab5758
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ec_typed_events_serv.mpb
@@ -0,0 +1,15 @@
+// -*- MPC -*-
+// $Id$
+
+feature(ec_typed_events) : dynamicinterface, ifr_client {
+ macros += TAO_HAS_TYPED_EVENT_CHANNEL
+
+ Source_Files {
+ CosEvent/CEC_TypedEvent.cpp
+ CosEvent/CEC_TypedEventChannel.cpp
+ CosEvent/CEC_TypedProxyPushConsumer.cpp
+ CosEvent/CEC_TypedConsumerAdmin.cpp
+ CosEvent/CEC_TypedSupplierAdmin.cpp
+ CosEvent/CEC_DynamicImplementation.cpp
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/ec_typed_events_skel.mpb b/TAO/orbsvcs/orbsvcs/ec_typed_events_skel.mpb
new file mode 100644
index 00000000000..1b0832a570b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/ec_typed_events_skel.mpb
@@ -0,0 +1,32 @@
+// -*- MPC -*-
+// $Id$
+
+feature(ec_typed_events) {
+ macros += TAO_HAS_TYPED_EVENT_CHANNEL
+
+ Source_Files {
+ CosTypedEventCommS.cpp
+ CosTypedEventChannelAdminS.cpp
+ }
+
+ Header_Files {
+ CosTypedEventCommS.h
+ CosTypedEventChannelAdminS.h
+
+ CosTypedEventCommS_T.h
+ CosTypedEventChannelAdminS_T.h
+ }
+
+ Inline_Files {
+ CosTypedEventCommS.inl
+ CosTypedEventChannelAdminS.inl
+
+ CosTypedEventCommS_T.inl
+ CosTypedEventChannelAdminS_T.inl
+ }
+
+ Template_Files {
+ CosTypedEventCommS_T.cpp
+ CosTypedEventChannelAdminS_T.cpp
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/miop.idl b/TAO/orbsvcs/orbsvcs/miop.idl
new file mode 100644
index 00000000000..b539dd7154a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/miop.idl
@@ -0,0 +1,55 @@
+//
+// $Id$
+//
+// ================================================================
+//
+// = LIBRARY
+// TAO_PortableGroup
+//
+// = FILENAME
+// miop.pidl
+//
+// = DESCRIPTION
+//
+// This file contains MIOP packet and profile information from
+// the MIOP specification.
+//
+// ================================================================
+
+#ifndef MIOP_IDL
+#define MIOP_IDL
+
+#include "tao/IOP.pidl"
+#include "tao/GIOP.pidl"
+
+#pragma prefix "omg.org"
+
+module MIOP
+{
+ typedef sequence <octet, 252> UniqueId;
+
+ struct PacketHeader_1_0
+ {
+ char magic[4];
+ octet hdr_version;
+ octet flags;
+ unsigned short packet_length;
+ unsigned long packet_number;
+ unsigned long number_of_packets;
+ UniqueId Id;
+ };
+
+ typedef GIOP::Version Version;
+
+ typedef string Address;
+
+ struct UIPMC_ProfileBody
+ {
+ Version miop_version;
+ Address the_address;
+ short the_port;
+ sequence<IOP::TaggedComponent> components;
+ };
+};
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/orbsvcs.mwc b/TAO/orbsvcs/orbsvcs/orbsvcs.mwc
new file mode 100644
index 00000000000..01faf104b82
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/orbsvcs.mwc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+workspace {
+}
+
diff --git a/TAO/orbsvcs/orbsvcs/sfp.idl b/TAO/orbsvcs/orbsvcs/sfp.idl
new file mode 100644
index 00000000000..0a8ab39b698
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/sfp.idl
@@ -0,0 +1,124 @@
+/* -*- C++ -*- */
+// $Id$
+
+#ifndef TAO_SFP_IDL
+#define TAO_SFP_IDL
+
+#include <ULongSeq.pidl>
+#include <OctetSeq.pidl>
+
+module flowProtocol
+{
+ typedef CORBA::ULongSeq my_seq_ulong;
+ enum MsgType
+ {
+ // The MsgTypes Start and struct Start,StartReply and struct
+ // StartReply conflicts.
+ // Also there are case-only differences for enumerator Credit and struct credit.
+ // We suffix _Msg to all enumerators until the AVStreams RTF fixes these.
+ // Messages in the forward direction
+ // Start,
+ Start_Msg,
+ EndofStream_Msg,
+ SimpleFrame_Msg,
+ SequencedFrame_Msg,
+ Frame_Msg,
+ SpecialFrame_Msg,
+ // Messages in the reverse direction
+ // StartReply,
+ StartReply_Msg,
+ Credit_Msg,
+ // Addition of type for a fragment.
+ Fragment_Msg
+ };
+
+ struct frameHeader
+ {
+ char magic_number[4];
+ // my_seq_char magic_number;
+ // '=', 'S', 'F', 'P'
+ octet flags;
+ // bit 0 = byte order,
+ // 1 = fragments, 2-7 always 0
+ octet message_type;
+ unsigned long message_size;
+ // Size following this header
+ };
+
+ struct fragment
+ {
+ // my_seq_char magic_number;
+ char magic_number[4];
+ // 'F', 'R', 'A', 'G'
+ octet flags;
+ // bit 1 = more fragments, %%bit 0 = byteorder
+ unsigned long frag_number;
+ // 1,..,n
+ unsigned long sequence_num;
+ unsigned long frag_sz;
+ unsigned long source_id;
+ // Required for UDP multicast with multiple sources
+ };
+
+ struct Start
+ {
+ char magic_number[4];
+ // my_seq_char magic_number;
+ // '=', 'S', 'T', 'A'
+ octet major_version;
+ octet minor_version;
+ octet flags;
+ // bit 0 = byte order
+ };
+
+ // Acknowledge successful processing of
+ // Start
+
+ struct StartReply
+ {
+ // my_seq_char magic_number;
+ char magic_number[4];
+ // "=",'S','T','R'
+ octet flags;
+ // bit 0 = byte order, 1 = exception
+ };
+
+ // If the message_type in frameHeader is sequencedFrame
+ // the the frameHeader will be followed by this
+ // (See also RTP note)
+
+ struct sequencedFrame
+ {
+ unsigned long sequence_num;
+ };
+ // If the message_type is Frame then
+ // the frameHeader is followed by this
+ // See also RTP note
+
+ struct frame
+ {
+ unsigned long timestamp;
+ unsigned long synchSource;
+ my_seq_ulong source_ids;
+ unsigned long sequence_num;
+ };
+
+ // XXX:The spec hasn't defined frameID.
+ typedef unsigned long frameID;
+ struct specialFrame
+ {
+ frameID context_id;
+ CORBA::OctetSeq context_data;
+ };
+
+ struct credit
+ {
+ // my_seq_char magic_number;
+ char magic_number[4];
+ // "=",'C','R','E'
+ unsigned long cred_num;
+ };
+
+};
+
+#endif /* TAO_SFP_IDL */
diff --git a/TAO/orbsvcs/orbsvcs/svc_utils_export.h b/TAO/orbsvcs/orbsvcs/svc_utils_export.h
new file mode 100644
index 00000000000..3f004359ae4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/svc_utils_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_SVC_UTILS_EXPORT_H
+#define TAO_SVC_UTILS_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_SVC_UTILS_HAS_DLL)
+# define TAO_SVC_UTILS_HAS_DLL 0
+# endif /* ! TAO_SVC_UTILS_HAS_DLL */
+#else
+# if !defined (TAO_SVC_UTILS_HAS_DLL)
+# define TAO_SVC_UTILS_HAS_DLL 1
+# endif /* ! TAO_SVC_UTILS_HAS_DLL */
+#endif
+
+#if defined (TAO_SVC_UTILS_HAS_DLL) && (TAO_SVC_UTILS_HAS_DLL == 1)
+# if defined (TAO_SVC_UTILS_BUILD_DLL)
+# define TAO_Svc_Utils_Export ACE_Proper_Export_Flag
+# define TAO_SVC_UTILS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_SVC_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_SVC_UTILS_BUILD_DLL */
+# define TAO_Svc_Utils_Export ACE_Proper_Import_Flag
+# define TAO_SVC_UTILS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_SVC_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_SVC_UTILS_BUILD_DLL */
+#else /* TAO_SVC_UTILS_HAS_DLL == 1 */
+# define TAO_Svc_Utils_Export
+# define TAO_SVC_UTILS_SINGLETON_DECLARATION(T)
+# define TAO_SVC_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_SVC_UTILS_HAS_DLL == 1 */
+
+#endif /* TAO_SVC_UTILS_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/ORBInitializer.cpp b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/ORBInitializer.cpp
new file mode 100644
index 00000000000..a7d70ac5c85
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/ORBInitializer.cpp
@@ -0,0 +1,55 @@
+#include "ORBInitializer.h"
+
+#include "orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.h"
+
+#include "tao/ORB_Constants.h"
+
+
+ACE_RCSID (CPU_Loaded,
+ ORBInitializer,
+ "$Id$")
+
+
+ORBInitializer::ORBInitializer (void)
+ : load_alert_ ()
+{
+}
+
+void
+ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableInterceptor::ServerRequestInterceptor_ptr reject_interceptor;
+ ACE_NEW_THROW_EX (reject_interceptor,
+ TAO_LB_ServerRequestInterceptor (this->load_alert_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableInterceptor::ServerRequestInterceptor_var safe_reject_interceptor =
+ reject_interceptor;
+
+ info->add_server_request_interceptor (safe_reject_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+TAO_LB_LoadAlert &
+ORBInitializer::load_alert (void)
+{
+ return this->load_alert_;
+}
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/ORBInitializer.h b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/ORBInitializer.h
new file mode 100644
index 00000000000..b288bb12c48
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/ORBInitializer.h
@@ -0,0 +1,92 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file ORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef ORB_INITIALIZER_H
+#define ORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/LoadBalancing/LB_LoadAlert.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+#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 */
+
+
+class ServerRequestInterceptor;
+
+/**
+ * @class ORBInitializer
+ *
+ * @brief ORBInitializer
+ *
+ * ORBInitializer
+ */
+class ORBInitializer
+ : public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ ORBInitializer (void);
+
+ /**
+ * @name PortableInterceptor::ORBInitializer Methods
+ *
+ * Methods required by the PortableInterceptor::ORBInitializer
+ * interface.
+ */
+ //@{
+ 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 a reference to the LoadAlert object.
+ TAO_LB_LoadAlert & load_alert (void);
+
+private:
+
+ /// The CosLoadBalancing::LoadAlert servant to be used at this
+ /// location.
+ /**
+ * This is the servant supplied by TAO's Load Balancer. It is
+ * used out of convencience.
+ */
+ TAO_LB_LoadAlert load_alert_;
+
+};
+
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* ORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/Roundtrip.cpp b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/Roundtrip.cpp
new file mode 100644
index 00000000000..004cd30266a
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/Roundtrip.cpp
@@ -0,0 +1,47 @@
+//
+// $Id$
+//
+#include "Roundtrip.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/ACE.h"
+
+ACE_RCSID(LoadBalancing,
+ Roundtrip,
+ "$Id$")
+
+Roundtrip::Roundtrip (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ count_ (0)
+{
+}
+
+Test::Timestamp
+Roundtrip::test_method (Test::Timestamp send_time,
+ Test::number cl_number
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (cl_number % 2 == 0)
+ {
+ for (int i = 1; i < 10000; i++)
+ {
+ (void) ACE::is_prime (900090, 2, 400090);
+ }
+ }
+ else
+ {
+ for (int i = 1; i < 5000; i++)
+ {
+ (void) ACE::is_prime (900090, 2, 400090);
+ }
+ }
+
+ return send_time;
+}
+
+void
+Roundtrip::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/Roundtrip.h b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/Roundtrip.h
new file mode 100644
index 00000000000..6cd4e89a956
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/Roundtrip.h
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef ROUNDTRIP_H
+#define ROUNDTRIP_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::Roundtrip interface
+class Roundtrip
+ : public virtual POA_Test::Roundtrip
+{
+public:
+ /// Constructor
+ Roundtrip (CORBA::ORB_ptr orb);
+
+ // = The skeleton methods
+ virtual Test::Timestamp test_method (Test::Timestamp send_time,
+ Test::number cl_number
+ ACE_ENV_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_;
+
+ int count_;
+};
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* ROUNDTRIP_H */
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/Test.idl b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/Test.idl
new file mode 100644
index 00000000000..f20041016a0
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/Test.idl
@@ -0,0 +1,28 @@
+//
+// $Id$
+//
+
+/// A simple module to avoid namespace pollution
+module Test
+{
+ /// Use a timestamp to measure the roundtrip delay
+ typedef unsigned long long Timestamp;
+ typedef long number;
+
+ /// Measure roundtrip delay
+ interface Roundtrip
+ {
+ /// A simple method to measure roundtrip delays
+ /**
+ * The operation simply returns its argument, this is used in AMI
+ * and deferred synchronous tests to measure the roundtrip delay
+ * without the need for a different reply handler for each
+ * request.
+ */
+ Timestamp test_method (in Timestamp send_time,
+ in number cl_number);
+
+ /// Shutdown the ORB
+ void shutdown ();
+ };
+};
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/client.cpp b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/client.cpp
new file mode 100644
index 00000000000..b68487ba367
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/client.cpp
@@ -0,0 +1,194 @@
+// $Id$
+
+#include "TestC.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Sched_Params.h"
+#include "ace/Stats.h"
+#include "ace/Sample_History.h"
+#include "ace/OS_NS_errno.h"
+
+#include "tao/Strategies/advanced_resource.h"
+
+ACE_RCSID(LoadBalancing,
+ client,
+ "$Id$")
+
+const char *ior = "file://test.ior";
+int niterations = 100;
+int do_dump_history = 0;
+int do_shutdown = 1;
+float rate = 0;
+int number;
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "hxk:i:n:r:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'h':
+ do_dump_history = 1;
+ break;
+
+ case 'x':
+ do_shutdown = 0;
+ break;
+
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case 'i':
+ niterations = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'r':
+ rate = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'n':
+ number = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-i <niterations> "
+ "-x (disable shutdown) "
+ "-h (dump history) "
+ "-r (rate [Hz])"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+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;
+ // 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,
+ "client (%P|%t): user is not superuser, "
+ "test runs in time-shared class\n"));
+ }
+ else
+ ACE_ERROR ((LM_ERROR,
+ "client (%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 (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test::Roundtrip_var roundtrip =
+ Test::Roundtrip::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (roundtrip.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Nil Test::Roundtrip reference <%s>\n",
+ ior),
+ 1);
+ }
+
+ for (int j = 0; j < 100; ++j)
+ {
+ ACE_hrtime_t start = 0;
+ (void) roundtrip->test_method (start, number ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_Sample_History history (niterations);
+
+ const float usecs = 1.0 / rate * 1e6;
+
+ ACE_Time_Value tv (0, static_cast<const long> (usecs));
+
+ // const timespec ts = tv;
+
+ ACE_hrtime_t test_start = ACE_OS::gethrtime ();
+ for (int i = 0; i < niterations; ++i)
+ {
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+
+ /*
+ if (rate)
+ {
+ //(void) ACE_OS::nanosleep (&ts, 0);
+ //prime_number = ACE::is_prime (699999, 2, 349999);
+ }
+ */
+
+ (void) roundtrip->test_method (start, number
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ history.sample (now - start);
+
+ }
+
+ ACE_hrtime_t test_end = ACE_OS::gethrtime ();
+
+ 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 (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 ());
+
+ if (do_shutdown)
+ {
+ roundtrip->shutdown (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/performance-tests/LoadBalancing/LBPerf/CPU/default.conf b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/default.conf
new file mode 100644
index 00000000000..981687f41f5
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/default.conf
@@ -0,0 +1,4 @@
+# $Id$
+#
+# The file is empty, forcing the ORB to use its default configuration.
+#
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/default.conf.xml b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/default.conf.xml
new file mode 100644
index 00000000000..03ac9dfa183
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/default.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from ./performance-tests/Latency/Single_Threaded/default.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <!-- -->
+ <!-- The file is empty, forcing the ORB to use its default configuration. -->
+ <!-- -->
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/default_configuration.pl b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/default_configuration.pl
new file mode 100755
index 00000000000..2f01c5c7243
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/default_configuration.pl
@@ -0,0 +1,51 @@
+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 ("test.ior");
+$defaultconf = PerlACE::LocalFile ("default$PerlACE::svcconf_ext");
+
+print STDERR "================ Single-threaded (default) Latency Test\n";
+
+unlink $iorfile;
+
+$SV = new PerlACE::Process ("server",
+ "-ORBSvcConf $defaultconf"
+ . " -o $iorfile");
+
+$CL = new PerlACE::Process ("client",
+ "-ORBSvcConf $defaultconf"
+ . " -k file://$iorfile"
+ . " -i 50000");
+
+$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);
+$server = $SV->WaitKill (10);
+
+unlink $iorfile;
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+exit $status;
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/server.cpp b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/server.cpp
new file mode 100644
index 00000000000..ed3756bffbe
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/server.cpp
@@ -0,0 +1,391 @@
+// $Id$
+
+#include "Roundtrip.h"
+#include "ORBInitializer.h"
+
+#include "orbsvcs/LoadBalancing/LB_CPU_Utilization_Monitor.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_strings.h"
+
+#include "tao/Strategies/advanced_resource.h"
+
+const char *ior_output_file = "test.ior";
+
+CORBA::Float reject_threshold = 0;
+CORBA::Float critical_threshold = 0;
+CORBA::Float dampening = 0;
+const char * strategy = "Random";
+int num_threads = 1;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:s:r:c:d:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+
+ case 's':
+ strategy = get_opts.opt_arg ();
+ break;
+
+ case 'r':
+ reject_threshold =
+ static_cast<CORBA::Float> (::atof (get_opts.opt_arg ()));
+ break;
+
+ case 'c':
+ critical_threshold =
+ static_cast<CORBA::Float> (::atof (get_opts.opt_arg ()));
+ break;
+
+ case 'd':
+ dampening =
+ static_cast<CORBA::Float> (::atof (get_opts.opt_arg ()));
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s\n"
+ " -o <iorfile>\n"
+ " -s <RoundRobin | Random | LeastLoaded>\n"
+ " -r <reject threshold> (LeastLoaded only)\n"
+ " -c <critical threshold> (LeastLoaded only)\n"
+ " -d <damping value> (LeastLoaded only)\n"
+ " -n <# of CPU burning threads>\n"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+CORBA::Object_ptr
+join_object_group (CORBA::ORB_ptr orb,
+ CosLoadBalancing::LoadManager_ptr lm,
+ const PortableGroup::Location & location
+ ACE_ENV_ARG_PARAMETER)
+{
+ CORBA::Object_var ns_object =
+ orb->resolve_initial_references ("NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ CosNaming::NamingContext_var nc =
+ CosNaming::NamingContext::_narrow (ns_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ CosNaming::Name name (1);
+ name.length (1);
+
+ name[0].id = "RoundtripObjectGroup";
+ name[0].kind = "Object Group";
+
+ CORBA::Object_var group;
+
+ ACE_TRY
+ {
+ group = nc->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ // Object group not created. Create one.
+ const char repository_id[] = "IDL:Test/Roundtrip: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;
+
+ PortableGroup::GenericFactory::FactoryCreationId_var fcid;
+
+ group = lm->create_object (repository_id,
+ criteria,
+ fcid.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TRY_EX (foo)
+ {
+ nc->bind (name,
+ group.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (foo);
+
+ PortableGroup::Properties props (1);
+ props.length (1);
+ props[0].nam.length (1);
+ props[0].nam[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.StrategyInfo");
+
+ CosLoadBalancing::StrategyInfo strategy_info;
+
+ strategy_info.name = CORBA::string_dup (strategy);
+
+ if (ACE_OS::strcasecmp (strategy, "LeastLoaded") == 0
+ && (reject_threshold != 0
+ || critical_threshold != 0
+ || dampening != 0))
+ {
+ CORBA::ULong len = 1;
+
+ PortableGroup::Properties & props =
+ strategy_info.props;
+
+ if (reject_threshold != 0)
+ {
+ const CORBA::ULong i = len - 1;
+
+ props.length (len++);
+
+ props[i].nam.length (1);
+ props[i].nam[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.Strategy.LeastLoaded.RejectThreshold");
+ props[i].val <<= reject_threshold;
+ }
+
+ if (critical_threshold != 0)
+ {
+ const CORBA::ULong i = len - 1;
+
+ props.length (len++);
+
+ props[i].nam.length (1);
+ props[i].nam[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.Strategy.LeastLoaded.CriticalThreshold");
+ props[i].val <<= critical_threshold;
+ }
+
+ if (dampening != 0)
+ {
+ const CORBA::ULong i = len - 1;
+
+ props.length (len++);
+
+ props[i].nam.length (1);
+ props[i].nam[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.Strategy.LeastLoaded.Dampening");
+ props[i].val <<= dampening;
+ }
+
+ }
+
+ props[0].val <<= strategy_info;
+
+ lm->set_default_properties (props
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound, ex)
+ {
+ // Somebody beat us to creating the object group. Clean up
+ // the one we created.
+ lm->delete_object (fcid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (foo);
+
+ group = nc->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (foo);
+ }
+ ACE_ENDTRY;
+ ACE_TRY_CHECK;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ Roundtrip * roundtrip_impl;
+ ACE_NEW_THROW_EX (roundtrip_impl,
+ Roundtrip (orb),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ PortableServer::ServantBase_var owner_transfer (roundtrip_impl);
+
+ Test::Roundtrip_var roundtrip =
+ roundtrip_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ group = lm->add_member (group.in (),
+ location,
+ roundtrip.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ return group._retn ();
+}
+
+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
+ {
+ ORBInitializer *initializer = 0;
+ ACE_NEW_RETURN (initializer,
+ ORBInitializer,
+ -1); // No exceptions yet!
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ 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;
+
+ 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;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var lm_object =
+ orb->resolve_initial_references ("LoadManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosLoadBalancing::LoadManager_var load_manager =
+ CosLoadBalancing::LoadManager::_narrow (lm_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_LB_CPU_Utilization_Monitor * monitor_servant;
+ ACE_NEW_THROW_EX (monitor_servant,
+ TAO_LB_CPU_Utilization_Monitor,
+ CORBA::NO_MEMORY ());
+ ACE_TRY_CHECK;
+
+ PortableServer::ServantBase_var safe_monitor_servant (monitor_servant);
+
+ CosLoadBalancing::LoadMonitor_var load_monitor =
+ monitor_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableGroup::Location_var location =
+ load_monitor->the_location (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var roundtrip =
+ ::join_object_group (orb.in (),
+ load_manager.in (),
+ location.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_LB_LoadAlert & alert_servant = initializer->load_alert ();
+
+ CosLoadBalancing::LoadAlert_var load_alert =
+ alert_servant._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (roundtrip.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\n",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ load_manager->register_load_monitor (location.in (),
+ load_monitor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ load_manager->register_load_alert (location.in (),
+ load_alert.in ()
+ ACE_ENV_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/performance-tests/LoadBalancing/LBPerf/CPU/svc.conf.xml b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/svc.conf.xml
new file mode 100644
index 00000000000..5b2a58bb6f0
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/svc.conf.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0'?>
+<!-- Converted from ./performance-tests/Latency/Single_Threaded/svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- -->
+ <!-- $Id$ -->
+ <!-- -->
+ <static id="Advanced_Resource_Factory" params="-ORBReactorMaskSignals 0 -ORBInputCDRAllocator null -ORBReactorType select_st -ORBConnectionCacheLock null"/>
+ <static id="Server_Strategy_Factory" params="-ORBPOALock null -ORBAllowReactivationOfSystemids 0"/>
+ <static id="Client_Strategy_Factory" params="-ORBTransportMuxStrategy EXCLUSIVE -ORBProfileLock null -ORBClientConnectionHandler RW"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/Makefile.am b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/Makefile.am
new file mode 100644
index 00000000000..9aa3215a760
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/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 = \
+ RPS
+
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/LoadBalancing.mpc b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/LoadBalancing.mpc
new file mode 100644
index 00000000000..beaad418d56
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/LoadBalancing.mpc
@@ -0,0 +1,38 @@
+// $Id$
+project(*Performance_IDL): loadbalancing, strategies {
+ IDL_Files {
+ Test.idl
+ }
+
+ custom_only = 1
+}
+
+project(*Performance_Server): loadbalancing, pi_server, strategies {
+ after += *Performance_IDL
+
+ Source_Files {
+ server.cpp
+ Roundtrip.cpp
+ ORBInitializer.cpp
+ ServerRequestInterceptor.cpp
+ RPS_Monitor.cpp
+ TestS.cpp
+ TestC.cpp
+ }
+
+ IDL_Files {
+ }
+}
+
+project(*Performance_Client): loadbalancing, strategies {
+ after += *Performance_IDL
+
+ Source_Files {
+ TestC.cpp
+ client.cpp
+ }
+
+ IDL_Files {
+ }
+}
+
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Makefile.am b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Makefile.am
new file mode 100644
index 00000000000..add39941212
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Makefile.am
@@ -0,0 +1,173 @@
+## 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.LoadBalancing_Performance_IDL.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+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_HEADERS = \
+ Test.idl
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+endif BUILD_AMI
+
+## Makefile.LoadBalancing_Performance_Client.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+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 = \
+ TestC.cpp \
+ client.cpp \
+ ORBInitializer.h \
+ RPS_Monitor.h \
+ Roundtrip.h \
+ ServerRequestInterceptor.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.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)/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_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+endif BUILD_AMI
+
+## Makefile.LoadBalancing_Performance_Server.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+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 = \
+ ORBInitializer.cpp \
+ RPS_Monitor.cpp \
+ Roundtrip.cpp \
+ ServerRequestInterceptor.cpp \
+ TestC.cpp \
+ TestS.cpp \
+ server.cpp \
+ ORBInitializer.h \
+ RPS_Monitor.h \
+ Roundtrip.h \
+ ServerRequestInterceptor.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.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)/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_ACE_FOR_TAO
+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/performance-tests/LoadBalancing/LBPerf/RPS/ORBInitializer.cpp b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ORBInitializer.cpp
new file mode 100644
index 00000000000..6ebd0450558
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ORBInitializer.cpp
@@ -0,0 +1,78 @@
+#include "ORBInitializer.h"
+#include "ServerRequestInterceptor.h"
+
+#include "orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.h"
+#include "orbsvcs/CosLoadBalancingC.h"
+
+#include "tao/ORB_Constants.h"
+
+ACE_RCSID (LoadBalancing,
+ ORBInitializer,
+ "$Id$")
+
+ORBInitializer::ORBInitializer (void)
+ : load_alert_ (),
+ interceptor_ (0)
+{
+}
+
+void
+ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_NEW_THROW_EX (this->interceptor_,
+ ServerRequestInterceptor,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableInterceptor::ServerRequestInterceptor_var sr_interceptor =
+ this->interceptor_;
+
+ info->add_server_request_interceptor (sr_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableInterceptor::ServerRequestInterceptor_ptr reject_interceptor;
+ ACE_NEW_THROW_EX (reject_interceptor,
+ TAO_LB_ServerRequestInterceptor (this->load_alert_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableInterceptor::ServerRequestInterceptor_var safe_reject_interceptor =
+ reject_interceptor;
+
+ info->add_server_request_interceptor (safe_reject_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+TAO_LB_LoadAlert &
+ORBInitializer::load_alert (void)
+{
+ return this->load_alert_;
+}
+
+ServerRequestInterceptor *
+ORBInitializer::interceptor (void) const
+{
+ return this->interceptor_;
+}
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ORBInitializer.h b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ORBInitializer.h
new file mode 100644
index 00000000000..77132d3adc8
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ORBInitializer.h
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file ORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef ORB_INITIALIZER_H
+#define ORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/LoadBalancing/LB_LoadAlert.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+#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 */
+
+
+class ServerRequestInterceptor;
+
+/**
+ * @class ORBInitializer
+ *
+ * @brief ORBInitializer
+ *
+ * ORBInitializer
+ */
+class ORBInitializer
+ : public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ ORBInitializer (void);
+
+ /**
+ * @name PortableInterceptor::ORBInitializer Methods
+ *
+ * Methods required by the PortableInterceptor::ORBInitializer
+ * interface.
+ */
+ //@{
+ 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 a reference to the LoadAlert object.
+ TAO_LB_LoadAlert & load_alert (void);
+
+ ServerRequestInterceptor * interceptor (void) const;
+
+private:
+
+ /// The CosLoadBalancing::LoadAlert servant to be used at this
+ /// location.
+ /**
+ * This is the servant supplied by TAO's Load Balancer. It is
+ * used out of convencience.
+ */
+ TAO_LB_LoadAlert load_alert_;
+
+ /// Interceptor that counts requests.
+ ServerRequestInterceptor * interceptor_;
+
+};
+
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* ORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.cpp b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.cpp
new file mode 100644
index 00000000000..1a640f3cbf7
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.cpp
@@ -0,0 +1,92 @@
+#include "RPS_Monitor.h"
+#include "ServerRequestInterceptor.h"
+#include "ace/UUID.h"
+#include "ace/OS_NS_sys_time.h"
+#include "tao/ORB_Constants.h"
+
+ACE_RCSID (LoadBalancing,
+ RPS_Monitor,
+ "$Id$")
+
+RPS_Monitor::RPS_Monitor (ServerRequestInterceptor * interceptor)
+ : location_ (1),
+ interceptor_ (interceptor),
+ last_time_ (ACE_OS::gettimeofday ()),
+ lock_ ()
+{
+ this->location_.length (1);
+
+ ACE_Utils::UUID_GENERATOR::instance ()->init ();
+
+ ACE_Utils::UUID uuid;
+ ACE_Utils::UUID_GENERATOR::instance ()->generateUUID (uuid);
+
+ this->location_[0].id = CORBA::string_dup (uuid.to_string ()->c_str ());
+ this->location_[0].kind = CORBA::string_dup ("UUID");
+}
+
+RPS_Monitor::~RPS_Monitor (void)
+{
+}
+
+CosLoadBalancing::Location *
+RPS_Monitor::the_location (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosLoadBalancing::Location * location;
+ ACE_NEW_THROW_EX (location,
+ CosLoadBalancing::Location (this->location_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ return location;
+}
+
+CosLoadBalancing::LoadList *
+RPS_Monitor::loads (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ const ACE_Time_Value current_time = ACE_OS::gettimeofday ();
+
+ ACE_Time_Value elapsed_time;
+
+ {
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, monitor, this->lock_, 0);
+
+ elapsed_time = current_time - this->last_time_;
+ this->last_time_ = current_time;
+ }
+
+ const CORBA::Float request_count =
+ static_cast<CORBA::Float> (this->interceptor_->request_count ());
+
+ CosLoadBalancing::LoadList * tmp;
+ ACE_NEW_THROW_EX (tmp,
+ CosLoadBalancing::LoadList (1),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ CosLoadBalancing::LoadList_var load_list = tmp;
+
+ load_list->length (1);
+
+ load_list[0].id = CosLoadBalancing::RequestsPerSecond;
+
+ if (elapsed_time == ACE_Time_Value::zero)
+ load_list[0].value = 0;
+ else
+ load_list[0].value = request_count / elapsed_time.msec () * 1000;
+
+ // Strictly for debugging or
+ ACE_DEBUG ((LM_DEBUG, "%f\n", load_list[0].value));
+
+ return load_list._retn ();
+}
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.h b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.h
new file mode 100644
index 00000000000..765656037b8
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/RPS_Monitor.h
@@ -0,0 +1,92 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file RPS_Monitor.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_RPS_MONITOR_H
+#define TAO_RPS_MONITOR_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/CosLoadBalancingS.h"
+
+# if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+# endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class ServerRequestInterceptor;
+
+/**
+ * @class RPS_Monitor
+ *
+ * @brief LoadMonitor implementation that calculates the number of
+ * request arriving per second.
+ */
+class RPS_Monitor
+ : public virtual POA_CosLoadBalancing::LoadMonitor
+{
+public:
+
+ /// Constructor
+ RPS_Monitor (ServerRequestInterceptor * interceptor);
+
+ /**
+ * @name CosLoadBalancing::LoadMonitor Methods
+ *
+ * Methods required by the CosLoadBalancing::LoadMonitor interface.
+ */
+ //@{
+
+ /// Return the location at which the LoadMonitor resides.
+ /**
+ * The returned "Location" is a sequence of length 1.
+ */
+ virtual CosLoadBalancing::Location * the_location (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the average CPU load at the location which this
+ /// LoadMonitor resides.
+ /**
+ * @return A "Load" sequence of length 1 that contains a LoadId
+ * equal to CosLoadBalancing::LoadAverage, and the average CPU
+ * load.
+ */
+ virtual CosLoadBalancing::LoadList * loads (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ //@}
+
+protected:
+
+ /// Destructor
+ /**
+ * Protected destructor to enforce proper memory management through
+ * reference counting.
+ */
+ ~RPS_Monitor (void);
+
+private:
+
+ /// The name of the location at which this LoadMonitor resides.
+ CosLoadBalancing::Location location_;
+
+ ServerRequestInterceptor * interceptor_;
+
+ ACE_Time_Value last_time_;
+
+ ACE_SYNCH_MUTEX lock_;
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_RPS_MONITOR_H */
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Roundtrip.cpp b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Roundtrip.cpp
new file mode 100644
index 00000000000..9a6a6ccd10e
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Roundtrip.cpp
@@ -0,0 +1,41 @@
+//
+// $Id$
+//
+#include "Roundtrip.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/ACE.h"
+
+ACE_RCSID(LoadBalancing,
+ Roundtrip,
+ "$Id$")
+
+Roundtrip::Roundtrip (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ count_ (0)
+{
+}
+
+Test::Timestamp
+Roundtrip::test_method (Test::Timestamp send_time,
+ Test::number cl_number
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ if (cl_number % 2 == 0)
+ {
+ for (int i = 1; i < 10000; i++)
+ {
+ (void) ACE::is_prime (290090, 2, 190090);
+ }
+ }
+
+ return send_time;
+}
+
+void
+Roundtrip::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Roundtrip.h b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Roundtrip.h
new file mode 100644
index 00000000000..6cd4e89a956
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Roundtrip.h
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef ROUNDTRIP_H
+#define ROUNDTRIP_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::Roundtrip interface
+class Roundtrip
+ : public virtual POA_Test::Roundtrip
+{
+public:
+ /// Constructor
+ Roundtrip (CORBA::ORB_ptr orb);
+
+ // = The skeleton methods
+ virtual Test::Timestamp test_method (Test::Timestamp send_time,
+ Test::number cl_number
+ ACE_ENV_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_;
+
+ int count_;
+};
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* ROUNDTRIP_H */
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ServerRequestInterceptor.cpp b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ServerRequestInterceptor.cpp
new file mode 100644
index 00000000000..bba0ca52470
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ServerRequestInterceptor.cpp
@@ -0,0 +1,81 @@
+#include "ServerRequestInterceptor.h"
+
+ACE_RCSID (LoadBalancing,
+ ServerRequestInterceptor,
+ "$Id$")
+
+ServerRequestInterceptor::ServerRequestInterceptor (void)
+ : request_count_ (0)
+{
+}
+
+ServerRequestInterceptor::~ServerRequestInterceptor (void)
+{
+}
+
+char *
+ServerRequestInterceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("ServerRequestInterceptor");
+}
+
+void
+ServerRequestInterceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ServerRequestInterceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr /* ri */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ ++this->request_count_;
+}
+
+void
+ServerRequestInterceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+ServerRequestInterceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr /* ri */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ServerRequestInterceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+ServerRequestInterceptor::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+CORBA::Long
+ServerRequestInterceptor::request_count (void)
+{
+ const CORBA::Long r = this->request_count_.value ();
+ this->request_count_ = 0;
+
+ return r;
+}
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ServerRequestInterceptor.h b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ServerRequestInterceptor.h
new file mode 100644
index 00000000000..1e85d70efd2
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/ServerRequestInterceptor.h
@@ -0,0 +1,122 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file ServerRequestInterceptor.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_SERVER_REQUEST_INTERCEPTOR_H
+#define TAO_SERVER_REQUEST_INTERCEPTOR_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PI_Server/PI_Server.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+#include "ace/Atomic_Op.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+class TAO_LB_LoadAlert;
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ServerRequestInterceptor
+ *
+ * @brief ServerRequestInterceptor that calculates the number of
+ * requests arriving per second.
+ *
+ * This ServerRequestInterceptor is responsible for redirecting
+ * requests back to the LoadManager.
+ */
+class ServerRequestInterceptor
+ : public virtual PortableInterceptor::ServerRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ ServerRequestInterceptor (void);
+
+ /**
+ * @name Methods Required by the ServerRequestInterceptor
+ * Interface
+ *
+ * These are the canonical methods required for all
+ * ServerRequestInterceptors.
+ */
+ //@{
+ 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));
+ //@}
+
+ CORBA::Long request_count (void);
+
+protected:
+
+ /// Destructor.
+ /**
+ * Protected destructor to enforce correct memory management via
+ * reference counting.
+ */
+ ~ServerRequestInterceptor (void);
+
+private:
+
+ /// The number of requests that have arrived on the server.
+ ACE_Atomic_Op<ACE_SYNCH_MUTEX, long> request_count_;
+
+};
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+
+#endif /* TAO_SERVER_REQUEST_INTERCEPTOR_H */
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Test.idl b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Test.idl
new file mode 100644
index 00000000000..f20041016a0
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/Test.idl
@@ -0,0 +1,28 @@
+//
+// $Id$
+//
+
+/// A simple module to avoid namespace pollution
+module Test
+{
+ /// Use a timestamp to measure the roundtrip delay
+ typedef unsigned long long Timestamp;
+ typedef long number;
+
+ /// Measure roundtrip delay
+ interface Roundtrip
+ {
+ /// A simple method to measure roundtrip delays
+ /**
+ * The operation simply returns its argument, this is used in AMI
+ * and deferred synchronous tests to measure the roundtrip delay
+ * without the need for a different reply handler for each
+ * request.
+ */
+ Timestamp test_method (in Timestamp send_time,
+ in number cl_number);
+
+ /// Shutdown the ORB
+ void shutdown ();
+ };
+};
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/client.cpp b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/client.cpp
new file mode 100644
index 00000000000..94221caa7bd
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/client.cpp
@@ -0,0 +1,193 @@
+// $Id$
+
+#include "TestC.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Sched_Params.h"
+#include "ace/Stats.h"
+#include "ace/Sample_History.h"
+#include "ace/OS_NS_errno.h"
+
+#include "tao/Strategies/advanced_resource.h"
+
+ACE_RCSID(LoadBalancing,
+ client,
+ "$Id$")
+
+const char *ior = "file://test.ior";
+int niterations = 100;
+int do_dump_history = 0;
+int do_shutdown = 1;
+float rate = 0;
+int number;
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "hxk:i:n:r:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'h':
+ do_dump_history = 1;
+ break;
+
+ case 'x':
+ do_shutdown = 0;
+ break;
+
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case 'i':
+ niterations = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'r':
+ rate =
+ static_cast<float> (ACE_OS::atoi (get_opts.opt_arg ()));
+ break;
+
+ case 'n':
+ number = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-i <niterations> "
+ "-x (disable shutdown) "
+ "-h (dump history) "
+ "-r (rate [Hz])"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+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;
+ // 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,
+ "client (%P|%t): user is not superuser, "
+ "test runs in time-shared class\n"));
+ }
+ else
+ ACE_ERROR ((LM_ERROR,
+ "client (%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 (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test::Roundtrip_var roundtrip =
+ Test::Roundtrip::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (roundtrip.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Nil Test::Roundtrip reference <%s>\n",
+ ior),
+ 1);
+ }
+ for (int j = 0; j < 100; ++j)
+ {
+ ACE_hrtime_t start = 0;
+ (void) roundtrip->test_method (start, number ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_Sample_History history (niterations);
+
+ // const float usecs = 1.0 / rate * 1e6;
+
+ // ACE_Time_Value tv (0, static_cast<const long> (usecs));
+
+ // const timespec ts = tv;
+
+ ACE_hrtime_t test_start = ACE_OS::gethrtime ();
+ for (int i = 0; i < niterations; ++i)
+ {
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+
+ /*
+ if (rate)
+ {
+ //(void) ACE_OS::nanosleep (&ts, 0);
+ //prime_number = ACE::is_prime (699999, 2, 349999);
+ }
+ */
+
+ (void) roundtrip->test_method (start, number
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ history.sample (now - start);
+
+ }
+
+ ACE_hrtime_t test_end = ACE_OS::gethrtime ();
+
+ 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 (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 ());
+
+ if (do_shutdown)
+ {
+ roundtrip->shutdown (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/performance-tests/LoadBalancing/LBPerf/RPS/default.conf b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/default.conf
new file mode 100644
index 00000000000..981687f41f5
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/default.conf
@@ -0,0 +1,4 @@
+# $Id$
+#
+# The file is empty, forcing the ORB to use its default configuration.
+#
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/default.conf.xml b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/default.conf.xml
new file mode 100644
index 00000000000..03ac9dfa183
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/default.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from ./performance-tests/Latency/Single_Threaded/default.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <!-- -->
+ <!-- The file is empty, forcing the ORB to use its default configuration. -->
+ <!-- -->
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/default_configuration.pl b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/default_configuration.pl
new file mode 100755
index 00000000000..2f01c5c7243
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/default_configuration.pl
@@ -0,0 +1,51 @@
+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 ("test.ior");
+$defaultconf = PerlACE::LocalFile ("default$PerlACE::svcconf_ext");
+
+print STDERR "================ Single-threaded (default) Latency Test\n";
+
+unlink $iorfile;
+
+$SV = new PerlACE::Process ("server",
+ "-ORBSvcConf $defaultconf"
+ . " -o $iorfile");
+
+$CL = new PerlACE::Process ("client",
+ "-ORBSvcConf $defaultconf"
+ . " -k file://$iorfile"
+ . " -i 50000");
+
+$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);
+$server = $SV->WaitKill (10);
+
+unlink $iorfile;
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+exit $status;
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/run_test.pl b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/run_test.pl
new file mode 100755
index 00000000000..630f9c9ad08
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/run_test.pl
@@ -0,0 +1,48 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../bin";
+use PerlACE::Run_Test;
+
+$status = 0;
+$iorfile = PerlACE::LocalFile ("test.ior");
+
+print STDERR "================ Single-threaded Latency Test\n";
+
+unlink $iorfile;
+
+$SV = new PerlACE::Process ("server",
+ "-o $iorfile");
+
+$CL = new PerlACE::Process ("client",
+ "-k file://$iorfile "
+ . " -i 50000");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (120);
+$server = $SV->WaitKill (10);
+
+unlink $iorfile;
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+exit $status;
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/server.cpp b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/server.cpp
new file mode 100644
index 00000000000..f6ce3d00373
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/server.cpp
@@ -0,0 +1,392 @@
+// $Id$
+
+#include "Roundtrip.h"
+#include "ORBInitializer.h"
+#include "RPS_Monitor.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/OS_NS_errno.h"
+
+#include "tao/ORBInitializer_Registry.h"
+#include "tao/Strategies/advanced_resource.h"
+
+ACE_RCSID (LoadBalancing,
+ server,
+ "$Id$")
+
+const char *ior_output_file = "test.ior";
+
+CORBA::Float reject_threshold = 0;
+CORBA::Float critical_threshold = 0;
+CORBA::Float dampening = 0;
+const char * strategy = "Random";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:s:r:c:d:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+
+ case 's':
+ strategy = get_opts.opt_arg ();
+ break;
+
+ case 'r':
+ reject_threshold =
+ static_cast<CORBA::Float> (::atof (get_opts.opt_arg ()));
+ break;
+
+ case 'c':
+ critical_threshold =
+ static_cast<CORBA::Float> (::atof (get_opts.opt_arg ()));
+ break;
+
+ case 'd':
+ dampening =
+ static_cast<CORBA::Float> (::atof (get_opts.opt_arg ()));
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s\n"
+ " -o <iorfile>\n"
+ " -s <RoundRobin | Random | LeastLoaded>\n"
+ " -r <reject threshold> (LeastLoaded only)\n"
+ " -c <critical threshold> (LeastLoaded only)\n"
+ " -d <damping value> (LeastLoaded only)\n"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+CORBA::Object_ptr
+join_object_group (CORBA::ORB_ptr orb,
+ CosLoadBalancing::LoadManager_ptr lm,
+ const PortableGroup::Location & location
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var ns_object =
+ orb->resolve_initial_references ("NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ CosNaming::NamingContext_var nc =
+ CosNaming::NamingContext::_narrow (ns_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ CosNaming::Name name (1);
+ name.length (1);
+
+ name[0].id = "RoundtripObjectGroup";
+ name[0].kind = "Object Group";
+
+ CORBA::Object_var group;
+
+ ACE_TRY
+ {
+ group = nc->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ // Object group not created. Create one.
+ const char repository_id[] = "IDL:Test/Roundtrip: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;
+
+ PortableGroup::GenericFactory::FactoryCreationId_var fcid;
+
+ group = lm->create_object (repository_id,
+ criteria,
+ fcid.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TRY_EX (foo)
+ {
+ nc->bind (name,
+ group.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (foo);
+
+ PortableGroup::Properties props (1);
+ props.length (1);
+ props[0].nam.length (1);
+ props[0].nam[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.StrategyInfo");
+
+ CosLoadBalancing::StrategyInfo strategy_info;
+
+ strategy_info.name = CORBA::string_dup (strategy);
+
+ if (ACE_OS::strcasecmp (strategy, "LeastLoaded") == 0
+ && (reject_threshold != 0
+ || critical_threshold != 0
+ || dampening != 0))
+ {
+ CORBA::ULong len = 1;
+
+ PortableGroup::Properties & props =
+ strategy_info.props;
+
+ if (reject_threshold != 0)
+ {
+ const CORBA::ULong i = len - 1;
+
+ props.length (len++);
+
+ props[i].nam.length (1);
+ props[i].nam[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.Strategy.LeastLoaded.RejectThreshold");
+ props[i].val <<= reject_threshold;
+ }
+
+ if (critical_threshold != 0)
+ {
+ const CORBA::ULong i = len - 1;
+
+ props.length (len++);
+
+ props[i].nam.length (1);
+ props[i].nam[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.Strategy.LeastLoaded.CriticalThreshold");
+ props[i].val <<= critical_threshold;
+ }
+
+ if (dampening != 0)
+ {
+ const CORBA::ULong i = len - 1;
+
+ props.length (len++);
+
+ props[i].nam.length (1);
+ props[i].nam[0].id =
+ CORBA::string_dup ("org.omg.CosLoadBalancing.Strategy.LeastLoaded.Dampening");
+ props[i].val <<= dampening;
+ }
+
+ }
+
+ props[0].val <<= strategy_info;
+
+ lm->set_default_properties (props
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound, ex)
+ {
+ // Somebody beat us to creating the object group. Clean up
+ // the one we created.
+ lm->delete_object (fcid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (foo);
+
+ group = nc->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (foo);
+ }
+ ACE_ENDTRY;
+ ACE_TRY_CHECK;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ Roundtrip * roundtrip_impl;
+ ACE_NEW_THROW_EX (roundtrip_impl,
+ Roundtrip (orb),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ PortableServer::ServantBase_var owner_transfer (roundtrip_impl);
+
+ Test::Roundtrip_var roundtrip =
+ roundtrip_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ group = lm->add_member (group.in (),
+ location,
+ roundtrip.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ return group._retn ();
+}
+
+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
+ {
+ ORBInitializer *initializer = 0;
+ ACE_NEW_RETURN (initializer,
+ ORBInitializer,
+ -1); // No exceptions yet!
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ 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;
+
+ 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;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var lm_object =
+ orb->resolve_initial_references ("LoadManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosLoadBalancing::LoadManager_var load_manager =
+ CosLoadBalancing::LoadManager::_narrow (lm_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RPS_Monitor * monitor_servant;
+ ACE_NEW_THROW_EX (monitor_servant,
+ RPS_Monitor (initializer->interceptor ()),
+ CORBA::NO_MEMORY ());
+ ACE_TRY_CHECK;
+
+ PortableServer::ServantBase_var safe_monitor_servant (monitor_servant);
+
+ CosLoadBalancing::LoadMonitor_var load_monitor =
+ monitor_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableGroup::Location_var location =
+ load_monitor->the_location (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var roundtrip =
+ ::join_object_group (orb.in (),
+ load_manager.in (),
+ location.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_LB_LoadAlert & alert_servant = initializer->load_alert ();
+
+ CosLoadBalancing::LoadAlert_var load_alert =
+ alert_servant._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ CORBA::String_var ior =
+ orb->object_to_string (roundtrip.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", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ load_manager->register_load_monitor (location.in (),
+ load_monitor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ load_manager->register_load_alert (location.in (),
+ load_alert.in ()
+ ACE_ENV_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/performance-tests/LoadBalancing/LBPerf/RPS/svc.conf b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/svc.conf
new file mode 100644
index 00000000000..9e0c5ed01ed
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/svc.conf
@@ -0,0 +1,6 @@
+#
+# $Id$
+#
+static Advanced_Resource_Factory "-ORBReactorMaskSignals 0 -ORBInputCDRAllocator null -ORBReactorType select_st -ORBConnectionCacheLock null"
+static Server_Strategy_Factory "-ORBPOALock null -ORBAllowReactivationOfSystemids 0"
+static Client_Strategy_Factory "-ORBTransportMuxStrategy EXCLUSIVE -ORBProfileLock null -ORBClientConnectionHandler RW"
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/svc.conf.xml b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/svc.conf.xml
new file mode 100644
index 00000000000..5b2a58bb6f0
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/svc.conf.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0'?>
+<!-- Converted from ./performance-tests/Latency/Single_Threaded/svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- -->
+ <!-- $Id$ -->
+ <!-- -->
+ <static id="Advanced_Resource_Factory" params="-ORBReactorMaskSignals 0 -ORBInputCDRAllocator null -ORBReactorType select_st -ORBConnectionCacheLock null"/>
+ <static id="Server_Strategy_Factory" params="-ORBPOALock null -ORBAllowReactivationOfSystemids 0"/>
+ <static id="Client_Strategy_Factory" params="-ORBTransportMuxStrategy EXCLUSIVE -ORBProfileLock null -ORBClientConnectionHandler RW"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/LoadBalancing/Makefile.am b/TAO/orbsvcs/performance-tests/LoadBalancing/Makefile.am
new file mode 100644
index 00000000000..afd8e97163f
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/LoadBalancing/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 = \
+ LBPerf
+
diff --git a/TAO/orbsvcs/performance-tests/Makefile.am b/TAO/orbsvcs/performance-tests/Makefile.am
new file mode 100644
index 00000000000..15ab91dc242
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/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 = \
+ LoadBalancing \
+ RTEvent
+
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/Colocated_Roundtrip.mpc b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/Colocated_Roundtrip.mpc
new file mode 100644
index 00000000000..18d1be0bb26
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/Colocated_Roundtrip.mpc
@@ -0,0 +1,15 @@
+// $Id$
+project: orbsvcsexe, rtcorbaevent, strategies, minimum_corba {
+ after += RTEC_Perf
+ libs += TAO_RTEC_Perf
+
+ specific (automake) {
+ includes += $(srcdir)/../lib
+ } else {
+ includes += ../lib
+ }
+
+ Source_Files {
+ driver.cpp
+ }
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/Makefile.am b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/Makefile.am
new file mode 100644
index 00000000000..252262f26b7
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/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.Colocated_Roundtrip.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = driver
+
+driver_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+driver_SOURCES = \
+ driver.cpp
+
+driver_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/performance-tests/RTEvent/lib/libTAO_RTEC_Perf.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTCORBAEvent.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_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTPortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.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_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/performance-tests/RTEvent/Colocated_Roundtrip/compare_histo.cpp b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/compare_histo.cpp
new file mode 100644
index 00000000000..d8ebf631bdc
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/compare_histo.cpp
@@ -0,0 +1,71 @@
+/**
+ * @file compare_histo.cpp
+ *
+ * $Id$
+ *
+ */
+
+#include <utility>
+#include <iostream>
+#include <fstream>
+#include <algorithm>
+#include <iterator>
+#include <map>
+
+typedef std::map<long,double> Vector;
+typedef std::pair<long,double> Element;
+
+std::ostream &
+operator<< (std::ostream &os,
+ const Vector::value_type &p)
+{
+ return os << p.first << " " << p.second;
+}
+
+
+void
+load_file (Vector &vector,
+ const char *filename)
+{
+ std::ifstream is (filename);
+ if (!is)
+ throw "Cannot open file";
+
+ while (is && !is.eof ())
+ {
+ long i; double v;
+ is >> i >> v;
+ Vector::value_type e (i, v);
+ vector.insert (e);
+ }
+}
+
+int
+main (int argc, char *argv[])
+{
+ Vector X;
+ load_file (X, argv[1]);
+ Vector Y;
+ load_file (Y, argv[2]);
+
+ Vector Z;
+ for (Vector::iterator i = X.begin (); i != X.end (); ++i) {
+ for (Vector::iterator j = Y.begin (); j != Y.end (); ++j) {
+ long ki = (*i).first - (*j).first;
+ double p = (*i).second * (*j).second;
+
+ Vector::iterator k = Z.find (ki);
+ if (k == Z.end ())
+ Z.insert (Element (ki, p));
+ else
+ Z[ki] += p;
+ }
+ }
+
+ for (Vector::iterator i = Z.begin (); i != Z.end (); ++i)
+ {
+ std::cout << (*i) << "\n";
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/compare_histo.pl b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/compare_histo.pl
new file mode 100755
index 00000000000..09196685fcc
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/compare_histo.pl
@@ -0,0 +1,94 @@
+#!/usr/bin/perl -w
+#
+# $Id$
+#
+
+use English;
+
+sub load_file {
+ local $filename = shift;
+ local %R = ();
+
+ open (XF, $filename)
+ || die "Cannot open $filename\n";
+ while (<XF>) {
+ chomp;
+ local @f = split(/\s+/, $_);
+ $R{$f[0]} = $f[1];
+ }
+ close(XF);
+
+ return %R;
+}
+
+sub interpolate {
+ local %T = @_;
+ local %R = ();
+
+ local $last_i;
+ foreach my $i (sort keys %T) {
+ if (!defined $last_i) {
+ $last_i = $i;
+ $R{$i} = $T{$i};
+ next;
+ }
+ local $si = $last_i + 1;
+ while ($si < $i) {
+ $R{$si} = $T{$last_i} + ($si - $last_i) * ($T{$i} - $T{$last_i}) / ($i - $last_i);
+ $si++;
+ }
+ $last_i = $i;
+ $R{$i} = $T{$i};
+ }
+ return %R;
+}
+
+sub range {
+ local @values = @_;
+ local ($min_i, $max_i);
+ foreach my $i (@values) {
+ if (!defined $min_i
+ || $i < $min_i) {
+ $min_i = $i;
+ }
+ if (!defined $max_i
+ || $i > $max_i) {
+ $max_i = $i;
+ }
+ }
+ return ($min_i, $max_i);
+}
+
+local %BX = load_file($ARGV[0]);
+print STDERR "X loaded\n";
+local %BY = load_file($ARGV[1]);
+print STDERR "Y loaded\n";
+
+local %X = %BX; interpolate (%BX);
+local %Y = %BY; interpolate (%BY);
+
+local ($min_i, $max_i) = range(keys %X);
+local ($min_j, $max_j) = range(keys %Y);
+
+print STDERR "RANGE[X] = $min_i, $max_i\n";
+print STDERR "RANGE[Y] = $min_j, $max_j\n";
+
+local $total = 0;
+foreach my $i (($min_i - $max_j)..($max_i - $min_j)) {
+ local $z = 0;
+ foreach my $j (-$max_j..-$min_j) {
+ local $f = 0;
+ local $g = 0;
+ if (defined $X{$i - $j}) {
+ $f = $X{$i - $j};
+ }
+ if (defined $Y{-$j}) {
+ $g = $Y{-$j};
+ }
+ $z += $f * $g;
+ }
+ print $i, " ", $z, "\n";
+ $total += $z;
+}
+
+print STDERR "TOTAL = $total\n";
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/driver.cpp b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/driver.cpp
new file mode 100644
index 00000000000..280e7ba2efa
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/driver.cpp
@@ -0,0 +1,248 @@
+// $Id$
+
+#include "RT_Class.h"
+#include "ORB_Holder.h"
+#include "Servant_var.h"
+#include "RIR_Narrow.h"
+#include "RTEC_Initializer.h"
+#include "RTServer_Setup.h"
+#include "Low_Priority_Setup.h"
+#include "EC_Destroyer.h"
+#include "Auto_Disconnect.h"
+#include "ORB_Task.h"
+#include "ORB_Task_Activator.h"
+#include "Client_Group.h"
+#include "Client_Options.h"
+
+#include "orbsvcs/Event_Service_Constants.h"
+
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/RTPortableServer/RTPortableServer.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "tao/Messaging/Messaging.h"
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Sample_History.h"
+#include "ace/Basic_Stats.h"
+#include "ace/Barrier.h"
+
+ACE_RCSID(TAO_PERF_RTEC_Colocated_Roundtrip, driver, "$Id$")
+
+int main (int argc, char *argv[])
+{
+ const CORBA::Long experiment_id = 1;
+
+ TAO_EC_Default_Factory::init_svcs ();
+
+ /// Move the test to the real-time class if it is possible.
+ RT_Class rt_class;
+
+ ACE_TRY_NEW_ENV
+ {
+ ORB_Holder orb (argc, argv, ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Client_Options options (argc, argv);
+ if (argc != 1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-i iterations (iterations) "
+ "-h high_priority_period (usecs) "
+ "-l low_priority_period (usecs) "
+ "-w high_priority_workload (usecs) "
+ "-v low_priority_workload (usecs) "
+ "-r (enable RT-CORBA) "
+ "-n nthreads (low priority thread) "
+ "-d (dump history) "
+ "-z (disable low priority) "
+ "\n",
+ argv [0]),
+ 1);
+ }
+
+ RTServer_Setup rtserver_setup (options.use_rt_corba,
+ orb,
+ rt_class,
+ 1 // options.nthreads
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ RIR_Narrow<PortableServer::POA>::resolve (orb,
+ "RootPOA"
+ 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;
+
+ PortableServer::POA_var ec_poa (rtserver_setup.poa ());
+
+ ACE_Thread_Manager my_thread_manager;
+
+ ORB_Task orb_task (orb);
+ orb_task.thr_mgr (&my_thread_manager);
+ ORB_Task_Activator orb_task_activator (rt_class.priority_high (),
+ rt_class.thr_sched_class (),
+ 1,
+ &orb_task);
+
+ ACE_DEBUG ((LM_DEBUG, "Finished ORB and POA configuration\n"));
+
+ Servant_var<TAO_EC_Event_Channel> ec_impl (
+ RTEC_Initializer::create (ec_poa.in (),
+ ec_poa.in (),
+ rtserver_setup.rtcorba_setup ()
+ ACE_ENV_ARG_PARAMETER)
+ );
+ ACE_TRY_CHECK;
+
+ ec_impl->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::ObjectId_var ec_id =
+ ec_poa->activate_object (ec_impl.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::Object_var ec_object =
+ ec_poa->id_to_reference (ec_id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow (ec_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ EC_Destroyer ec_destroyer (ec.in ());
+
+ ACE_DEBUG ((LM_DEBUG, "Finished EC configuration and activation\n"));
+
+ int thread_count = 1 + options.nthreads;
+
+ ACE_Barrier the_barrier (thread_count);
+
+ 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));
+
+ CORBA::Long event_range = 1;
+ if (options.funky_supplier_publication)
+ {
+ if (options.unique_low_priority_event)
+ event_range = 1 + options.low_priority_consumers;
+ else
+ event_range = 2;
+ }
+
+ Client_Group high_priority_group;
+ high_priority_group.init (experiment_id,
+ ACE_ES_EVENT_UNDEFINED,
+ event_range,
+ options.iterations,
+ options.high_priority_workload,
+ gsf,
+ ec_poa.in (),
+ ec_poa.in ());
+
+ Auto_Disconnect<Client_Group> high_priority_disconnect;
+
+ if (!options.high_priority_is_last)
+ {
+ high_priority_group.connect (ec.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ high_priority_disconnect = &high_priority_group;
+ }
+
+ int per_thread_period = options.low_priority_period;
+ if (options.global_low_priority_rate)
+ per_thread_period = options.low_priority_period * options.nthreads;
+
+ Low_Priority_Setup<Client_Group> low_priority_setup (
+ options.low_priority_consumers,
+ 0, // no limit on the number of iterations
+ options.unique_low_priority_event,
+ experiment_id,
+ ACE_ES_EVENT_UNDEFINED + 2,
+ options.low_priority_workload,
+ gsf,
+ options.nthreads,
+ rt_class.priority_low (),
+ rt_class.thr_sched_class (),
+ per_thread_period,
+ ec_poa.in (),
+ ec_poa.in (),
+ ec.in (),
+ &the_barrier
+ ACE_ENV_ARG_PARAMETER);
+
+ if (options.high_priority_is_last)
+ {
+ high_priority_group.connect (ec.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ high_priority_disconnect = &high_priority_group;
+ }
+ Send_Task high_priority_task;
+ high_priority_task.init (options.iterations,
+ options.high_priority_period,
+ 0,
+ ACE_ES_EVENT_UNDEFINED,
+ experiment_id,
+ high_priority_group.supplier (),
+ &the_barrier);
+ high_priority_task.thr_mgr (&my_thread_manager);
+ {
+ // Artificial scope to wait for the high priority task...
+ Task_Activator<Send_Task> high_priority_act (rt_class.priority_high (),
+ rt_class.thr_sched_class (),
+ 1,
+ &high_priority_task);
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - high priority task completed\n"));
+
+ low_priority_setup.stop_all_threads ();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - low priority task(s) stopped\n"));
+
+ ACE_Sample_History &history =
+ high_priority_group.consumer ()->sample_history ();
+ if (options.dump_history)
+ {
+ history.dump_samples ("HISTORY", gsf);
+ }
+
+ ACE_Basic_Stats high_priority_stats;
+ history.collect_basic_stats (high_priority_stats);
+ high_priority_stats.dump_results ("High Priority", gsf);
+
+ ACE_Basic_Stats low_priority_stats;
+ low_priority_setup.collect_basic_stats (low_priority_stats);
+ low_priority_stats.dump_results ("Low Priority", gsf);
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - starting cleanup\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_reactive.conf b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_reactive.conf
new file mode 100644
index 00000000000..8cd51345cc5
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_reactive.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list -ECSupplierFilter null -ECDispatching reactive"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_reactive.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_reactive.conf.xml
new file mode 100644
index 00000000000..c696f84f7c1
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_reactive.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_reactive.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 -ECSupplierFilter null -ECDispatching reactive"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_rtcorba.conf b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_rtcorba.conf
new file mode 100644
index 00000000000..d98222a2a0a
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_rtcorba.conf
@@ -0,0 +1,3 @@
+# $Id$
+static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBPriorityMapping continuous"
+static EC_Factory "-ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list -ECSupplierFilter null -ECDispatching reactive"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_rtcorba.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_rtcorba.conf.xml
new file mode 100644
index 00000000000..e50b5ee76a0
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_rtcorba.conf.xml
@@ -0,0 +1,7 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_rtcorba.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="RT_ORB_Loader" params="-ORBSchedPolicy SCHED_FIFO -ORBPriorityMapping continuous"/>
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list -ECSupplierFilter null -ECDispatching reactive"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_threaded.conf b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_threaded.conf
new file mode 100644
index 00000000000..502bc5cdb1e
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_threaded.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list -ECSupplierFilter null -ECDispatching mt -ECDispatchingThreads 2"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_threaded.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_threaded.conf.xml
new file mode 100644
index 00000000000..3af46f8016d
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_threaded.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.dispatching_threaded.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 -ECSupplierFilter null -ECDispatching mt -ECDispatchingThreads 2"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_null.conf b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_null.conf
new file mode 100644
index 00000000000..8cd51345cc5
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_null.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list -ECSupplierFilter null -ECDispatching reactive"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_null.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_null.conf.xml
new file mode 100644
index 00000000000..556a11f3e02
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_null.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_null.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 -ECSupplierFilter null -ECDispatching reactive"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_per_supplier.conf b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_per_supplier.conf
new file mode 100644
index 00000000000..712b90b6074
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_per_supplier.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list -ECSupplierFilter per-supplier -ECDispatching reactive"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_per_supplier.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_per_supplier.conf.xml
new file mode 100644
index 00000000000..bc2303a1caf
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_per_supplier.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.filter_per_supplier.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 -ECSupplierFilter per-supplier -ECDispatching reactive"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_read.conf b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_read.conf
new file mode 100644
index 00000000000..49c7ad0b504
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_read.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:copy_on_read:list -ECProxyPushSupplierCollection mt:copy_on_read:list -ECSupplierFilter null"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_read.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_read.conf.xml
new file mode 100644
index 00000000000..aad39607a11
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_read.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_read.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection mt:copy_on_read:list -ECProxyPushSupplierCollection mt:copy_on_read:list -ECSupplierFilter null"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_write.conf b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_write.conf
new file mode 100644
index 00000000000..691efd9c506
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_write.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list -ECSupplierFilter null"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_write.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_write.conf.xml
new file mode 100644
index 00000000000..ddb4ff44a7c
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_write.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_copy_on_write.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 -ECSupplierFilter null"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_delayed.conf b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_delayed.conf
new file mode 100644
index 00000000000..f49ae54a94a
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_delayed.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:delayed:list -ECProxyPushSupplierCollection mt:delayed:list -ECSupplierFilter null"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_delayed.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_delayed.conf.xml
new file mode 100644
index 00000000000..a7abef8d899
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_delayed.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_delayed.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection mt:delayed:list -ECProxyPushSupplierCollection mt:delayed:list -ECSupplierFilter null"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_immediate.conf b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_immediate.conf
new file mode 100644
index 00000000000..50aa86ff59a
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_immediate.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:immediate:list -ECProxyPushSupplierCollection mt:immediate:list -ECSupplierFilter null"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_immediate.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_immediate.conf.xml
new file mode 100644
index 00000000000..ebe10379b5b
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_immediate.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/ec.locking_immediate.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection mt:immediate:list -ECProxyPushSupplierCollection mt:immediate:list -ECSupplierFilter null"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_acc.sh b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_acc.sh
new file mode 100644
index 00000000000..52fd2b14d3b
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_acc.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+. parameters
+
+for t in $TYPES; do
+ for i in $t.*.dat; do
+ b=`basename $i .dat`
+ awk 'BEGIN {
+ s = 0;
+ }
+ {
+ s += $2;
+ print $1, s
+ }' $i > $b.acc.dat;
+ echo $i
+ done
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_cmp.sh b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_cmp.sh
new file mode 100755
index 00000000000..f45666db5a0
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_cmp.sh
@@ -0,0 +1,10 @@
+#/bin/sh
+
+for i in $TYPES; do
+ echo $i ;
+ for j in 99 999 9999; do
+ paste $i.avg.dat ${i}.${j}.dat |
+ awk '{print $1, $4 / $2}' > $i.${j}.cmp.dat
+ done
+done
+
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_compared_histo.sh b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_compared_histo.sh
new file mode 100644
index 00000000000..8f6a821b27d
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_compared_histo.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+#
+
+. parameters
+
+for j in copy_on_write copy_on_read delayed;
+do
+ for i in $NCONSUMERS;
+ do
+ ./compare_histo.pl ec_locking.$j.$i.16.histo.dat ec_locking.$j.32.16.histo.dat >$j.$i.dat;
+ done;
+done
+
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_gnuplot.pl b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_gnuplot.pl
new file mode 100755
index 00000000000..f39e43497d6
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_gnuplot.pl
@@ -0,0 +1,11 @@
+#!/usr/bin/perl -w
+#
+# $Id$
+#
+
+foreach $t (@ARGV) {
+ print "plot '", $t, "_delta.32.histo.dat'\n";
+ foreach $i (2..16) {
+ print "replot '", $t, "_delta.", 32*$i, ".histo.dat'\n";
+ }
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_histo.sh b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_histo.sh
new file mode 100755
index 00000000000..68a239db84a
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_histo.sh
@@ -0,0 +1,10 @@
+#/bin/sh
+
+. parameters
+
+for i in *.txt; do
+ b=`basename $i .txt`
+ echo $i
+ awk '/^HISTO/ {print $3}' $i | sort -n | uniq -c |
+ awk -v N=$ITERATIONS '{print $2, $1 / N}' > $b.histo.dat
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_percentiles.sh b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_percentiles.sh
new file mode 100755
index 00000000000..1ee71321146
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_percentiles.sh
@@ -0,0 +1,47 @@
+#/bin/sh
+
+. parameters
+
+PERCENTILES="0 .25 .50 .75 .99 .999 .9999 1"
+
+for t in $*; do
+ cat /dev/null > ${t}.avg.dat
+ for p in $PERCENTILES; do
+ cat /dev/null > ${t}$p.percentile.dat
+ done
+
+ for c in $NCONSUMERS; do
+ echo $t $c
+ INPUT=${t}.${c}.16.txt
+ awk -v c=$c '/^HISTO/ {
+ n++;
+ s += $3
+ }
+ END {
+ printf("%d %f\n", c, s/n);
+ }' $INPUT >> ${t}.avg.dat
+
+ TFILE=/tmp/${t}.$$
+ awk '/^HISTO/ {print $3}' $INPUT | sort -n | uniq -c > $TFILE
+ for p in $PERCENTILES; do
+ awk -v N=$ITERATIONS '{print $2, $1 / N}' $TFILE |
+ awk -v c=$c -v p=${p} '\
+BEGIN { x = 0; l = 0; }
+{ s += $2;
+ l = $1;
+ if (x == 0 && s >= p) {
+ x = $1;
+ }
+}
+END {
+ if (s < p) {
+ x = l;
+ }
+ printf("%d %f\n", c, x);
+}' >> ${t}${p}.percentile.dat
+ done
+ /bin/rm -f $TFILE
+
+ done
+
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_stat.sh b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_stat.sh
new file mode 100755
index 00000000000..f0fc96aed6c
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/generate_stat.sh
@@ -0,0 +1,42 @@
+#/bin/sh
+
+for i in $*; do
+ echo $i
+ cat $i |
+ awk 'BEGIN {
+ s1 = 0;
+ s2 = 0;
+ s3 = 0;
+ s4 = 0;
+ n = 0;
+ }
+ {
+ x = $1;
+ p = $2;
+ v = p * x;
+ s1 += v;
+ v *= x;
+ s2 += v;
+ v *= x;
+ s3 += v;
+ v *= x;
+ s4 += v;
+ }
+ END {
+ up0 = 1;
+ up1 = s1;
+ up2 = s2;
+ up3 = s3;
+ up4 = s4;
+ u1 = 0;
+ u2 = up2 - up1 * up1;
+ u3 = 2 * up1 * up1 * up1 - 3 * up1 * up2 + up3;
+ u4 = -3 * up1 * up1 * up1 * up1 + 6 * up1 * up1 * up2
+ -4 * up1 * up3 + up4;
+
+ skew = u3 / (u2 * sqrt(u2));
+ kurto = u4 / (u2 * u2) - 3;
+ printf("%f %f %f %f\n",
+ up1, u2, skew, kurto);
+ }'
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/parameters b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/parameters
new file mode 100644
index 00000000000..b2edbcae0ba
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/parameters
@@ -0,0 +1,9 @@
+NTHREADS="32"
+
+NCONSUMERS="32 64 96 128 160 192 224 256 288 320 352 384 416 448 480 512"
+
+ITERATIONS=25000
+
+LOCKING_TYPES="copy_on_read copy_on_write delayed"
+DISPATCHING_TYPES="threaded reactive rtcorba"
+FILTER_TYPES="null per_supplier"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/run_dispatching.sh b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/run_dispatching.sh
new file mode 100755
index 00000000000..d7e336b4e7c
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/run_dispatching.sh
@@ -0,0 +1,27 @@
+#! /bin/sh
+#
+# $Id$
+#
+
+. parameters
+
+for n in 2; do
+ for c in 2 4 6 8 10 12; do
+
+ date
+ echo rtcorba $c $n
+
+ ./driver -ORBSvcConf ec.dispatching_rtcorba.conf -r -d -h 10000 -l 10000 -i $ITERATIONS -c $c -n $n > ec_dispatching.rtcorba.${c}.${n}.txt 2>&1
+
+ date
+ echo threaded $c $n
+
+ ./driver -ORBSvcConf ec.dispatching_threaded.conf -d -h 10000 -l 10000 -i $ITERATIONS -c $c -n $n > ec_dispatching.threaded.${c}.${n}.txt 2>&1
+
+ date
+ echo reactive $c $n
+
+ ./driver -ORBSvcConf ec.dispatching_reactive.conf -d -h 10000 -l 10000 -i $ITERATIONS -c $c -n $n > ec_dispatching.reactive.${c}.${n}.txt 2>&1
+
+ done
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/run_filter.sh b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/run_filter.sh
new file mode 100755
index 00000000000..84ec666a6e3
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/run_filter.sh
@@ -0,0 +1,17 @@
+#! /bin/sh
+#
+# $Id$
+#
+
+. parameters
+
+for n in $NTHREADS; do
+ for c in $NCONSUMERS; do
+ for t in $FILTER_TYPES; do
+ date
+ echo $t $c $n
+
+ ./driver -ORBSvcConf ec.filter_${t}.conf -x -d -h 10000 -l 10000 -i $ITERATIONS -c $c -n $n > ec_filter.${t}.${c}.${n}.txt 2>&1
+ done
+ done
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/run_locking.sh b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/run_locking.sh
new file mode 100755
index 00000000000..88cda17cdcd
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/run_locking.sh
@@ -0,0 +1,17 @@
+#! /bin/sh
+#
+# $Id$
+#
+
+. parameters
+
+for n in $NTHREADS; do
+ for c in $NCONSUMERS; do
+ for t in $LOCKING_TYPES; do
+ date
+ echo $t $c $n
+
+ ./driver -ORBSvcConf ec.locking_${t}.conf -d -f -h 10000 -l 10000 -i $ITERATIONS -c $c -n $n > ec_locking.${t}.${c}.${n}.txt 2>&1
+ done
+ done
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/Federated_Roundtrip.mpc b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/Federated_Roundtrip.mpc
new file mode 100644
index 00000000000..a6681bf941c
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/Federated_Roundtrip.mpc
@@ -0,0 +1,28 @@
+// $Id$
+project(*server): orbsvcsexe, rtcorbaevent, strategies, minimum_corba {
+ after += RTEC_Perf
+ libs += TAO_RTEC_Perf
+
+ specific (automake) {
+ includes += $(srcdir)/../lib
+ }
+ includes += ../lib
+
+ Source_Files {
+ server.cpp
+ }
+}
+
+project(*client): orbsvcsexe, rtcorbaevent, strategies, minimum_corba {
+ after += RTEC_Perf
+ libs += TAO_RTEC_Perf
+
+ specific (automake) {
+ includes += $(srcdir)/../lib
+ }
+ includes += ../lib
+
+ Source_Files {
+ client.cpp
+ }
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/Makefile.am b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/Makefile.am
new file mode 100644
index 00000000000..6b11a5b9d3a
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/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.Federated_Roundtrip_Client.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+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 \
+ -I$(srcdir)/../lib \
+ -I../lib
+
+client_SOURCES = \
+ client.cpp
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/performance-tests/RTEvent/lib/libTAO_RTEC_Perf.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTCORBAEvent.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_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTPortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.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_RT_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Federated_Roundtrip_Server.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+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 \
+ -I$(srcdir)/../lib \
+ -I../lib
+
+server_SOURCES = \
+ server.cpp
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/performance-tests/RTEvent/lib/libTAO_RTEC_Perf.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTCORBAEvent.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_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTPortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.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_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/performance-tests/RTEvent/Federated_Roundtrip/client.cpp b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/client.cpp
new file mode 100644
index 00000000000..8720b8bb599
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/client.cpp
@@ -0,0 +1,302 @@
+// $Id$
+
+#include "RT_Class.h"
+#include "ORB_Holder.h"
+#include "Servant_var.h"
+#include "RIR_Narrow.h"
+#include "RTServer_Setup.h"
+#include "Peer_Base.h"
+#include "Auto_Disconnect.h"
+#include "Send_Task.h"
+#include "Task_Activator.h"
+#include "Client_Pair.h"
+
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+#include "tao/Messaging/Messaging.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "tao/RTCORBA/Priority_Mapping_Manager.h"
+#include "tao/RTCORBA/Continuous_Priority_Mapping.h"
+#include "tao/RTPortableServer/RTPortableServer.h"
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Sample_History.h"
+#include "ace/Basic_Stats.h"
+#include "ace/Stats.h"
+#include "ace/Sched_Params.h"
+#include "ace/Barrier.h"
+
+ACE_RCSID(TAO_RTEC_PERF_Roundtrip, client, "$Id$")
+
+const char *ior = "file://test.ior";
+int nthreads = 0;
+int high_priority_period = 0;
+int high_priority_workload = 0;
+int low_priority_period = 0;
+int low_priority_workload = 0;
+int disable_low_priority = 0;
+int use_rt_corba = 0;
+
+class Roundtrip_Peer : public Peer_Base
+{
+public:
+ Roundtrip_Peer (CORBA::ORB_ptr orb,
+ RTServer_Setup &rtserver_setup,
+ RT_Class &rt_class
+ ACE_ENV_ARG_DECL)
+ : Peer_Base (orb, rtserver_setup
+ ACE_ENV_ARG_PARAMETER)
+ , rt_class_ (&rt_class)
+ {
+ }
+
+ //@{
+ /** @name The Federated_Test::Peer methods
+ */
+ virtual Federated_Test::Experiment_Results *
+ run_experiment (CORBA::Long experiment_id,
+ CORBA::Long iterations
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+private:
+ RT_Class *rt_class_;
+};
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:n:l:h:w:v:zr");
+ 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 'h':
+ high_priority_period = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'l':
+ low_priority_period = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'w':
+ high_priority_workload = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'v':
+ low_priority_workload = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'z':
+ disable_low_priority = 1;
+ break;
+
+ case 'r':
+ use_rt_corba = 1;
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <IOR> "
+ "-i iterations (iterations) "
+ "-h high_priority_period (usecs) "
+ "-l low_priority_period (usecs) "
+ "-w high_priority_workload (usecs) "
+ "-v low_priority_workload (usecs) "
+ "-r (enable RT-CORBA) "
+ "-n nthreads (low priority thread) "
+ "-z (disable low priority) "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int main (int argc, char *argv[])
+{
+ TAO_EC_Default_Factory::init_svcs();
+ RT_Class rt_class;
+
+ ACE_TRY_NEW_ENV
+ {
+ ORB_Holder orb (argc, argv, ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ RTServer_Setup rtserver_setup (use_rt_corba,
+ orb,
+ rt_class,
+ nthreads
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ RIR_Narrow<PortableServer::POA>::resolve (orb,
+ "RootPOA"
+ 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;
+
+ ACE_DEBUG ((LM_DEBUG, "Finished ORB and POA configuration\n"));
+
+ Servant_var<Roundtrip_Peer> peer_impl (
+ new Roundtrip_Peer (orb,
+ rtserver_setup,
+ rt_class
+ ACE_ENV_ARG_PARAMETER)
+ );
+ ACE_TRY_CHECK;
+
+ Federated_Test::Peer_var peer =
+ peer_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Finished peer configuration and activation\n"));
+
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Federated_Test::Control_var control =
+ Federated_Test::Control::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ control->join (peer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+Federated_Test::Experiment_Results *
+Roundtrip_Peer::run_experiment (CORBA::Long experiment_id,
+ CORBA::Long iterations
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ int thread_count = 1;
+#if 0
+ if (disable_low_priority == 0)
+ thread_count += nthreads;
+#endif
+
+ ACE_Barrier the_barrier (thread_count);
+
+ 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 0
+ Low_Priority_Setup<Client_Pair> low_priority_setup (
+ nthreads,
+ 0, // no limit on the number of iterations
+ 1, // each client gets its own type
+ experiment_id,
+ ACE_ES_EVENT_UNDEFINED + 2,
+ low_priority_workload,
+ gsf,
+ disable_low_priority ? 0 : 1,
+ this->rt_class_.priority_low (),
+ this->rt_class_.thr_sched_class (),
+ low_priority_period,
+ this->poa_.in (),
+ this->poa_.in (),
+ this->event_channel_.in (),
+ &the_barrier
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+#endif
+
+ Client_Pair high_priority_group;
+ high_priority_group.init (experiment_id,
+ ACE_ES_EVENT_UNDEFINED,
+ iterations,
+ high_priority_workload,
+ gsf,
+ this->poa_.in (),
+ this->poa_.in ());
+ high_priority_group.connect (this->event_channel_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ Auto_Disconnect<Client_Pair> high_priority_disconnect (&high_priority_group);
+
+ Send_Task high_priority_task;
+ high_priority_task.init (iterations,
+ high_priority_period,
+ 0,
+ ACE_ES_EVENT_UNDEFINED,
+ experiment_id,
+ high_priority_group.supplier (),
+ &the_barrier);
+ {
+ // Artificial scope to wait for the high priority task...
+ Task_Activator<Send_Task> high_priority_act (this->rt_class_->priority_high (),
+ this->rt_class_->thr_sched_class (),
+ 1,
+ &high_priority_task);
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - high priority task completed\n"));
+
+#if 0
+ if (disable_low_priority == 0)
+ {
+ low_priority_setup.stop_all_threads ();
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - low priority task(s) stopped\n"));
+#endif
+
+ ACE_Sample_History &history =
+ high_priority_group.consumer ()->sample_history ();
+
+ Federated_Test::Experiment_Results_var results (
+ new Federated_Test::Experiment_Results (iterations)
+ );
+ results->length (iterations);
+ for (CORBA::ULong i = 0; i != results->length (); ++i)
+ {
+ results[i] = history.get_sample (i) / gsf;
+ }
+
+ return results._retn ();
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/parameters b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/parameters
new file mode 100644
index 00000000000..6a749778a2e
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/parameters
@@ -0,0 +1,20 @@
+NTHREADS="16"
+
+#NCONSUMERS="32 64 96 128 160 192 224 256 288 320 352 384 416 448 480 512"
+NCONSUMERS="2 4 8"
+
+#ITERATIONS=25000
+ITERATIONS=3000
+
+LOCKING_TYPES="copy_on_read copy_on_write delayed"
+DISPATCHING_TYPES="threaded reactive rtcorba"
+FILTER_TYPES="null per_supplier"
+
+#IOR=/project/amras/coryan/IOR/roundtrip.ior
+IOR=test.ior
+
+#REMOTE_HOST=celegorm
+REMOTE_HOST=localhost
+
+#REMOTE_LOCATION=/project/celegorm/coryan/EC_Roundtrip
+REMOTE_LOCATION=$PWD
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/roundtrip.conf b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/roundtrip.conf
new file mode 100644
index 00000000000..7cc3d800820
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/roundtrip.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECObserver basic -ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/roundtrip.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/roundtrip.conf.xml
new file mode 100644
index 00000000000..3e71148d35b
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/roundtrip.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/roundtrip.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECObserver basic -ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/run_roundtrip.sh b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/run_roundtrip.sh
new file mode 100755
index 00000000000..f7ea4c46d99
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/run_roundtrip.sh
@@ -0,0 +1,26 @@
+#! /bin/sh
+#
+# $Id$
+#
+
+. parameters
+
+for c in $NCONSUMERS; do
+
+ date
+ echo $t $c $n
+
+ /bin/rm -f $IOR
+# ssh $REMOTE_HOST "cd $REMOTE_LOCATION ; ./server -ORBSvcConf ec.locking_${t}.conf -r -o $IOR" >server.log 2>&1 </dev/null &
+ ./server -d -o $IOR -i $ITERATIONS -p 2 >server.$c.txt 2>&1 </dev/null &
+ while [ ! -f $IOR ]; do
+ sleep 1
+ done
+ ./client -ORBDebugLevel 0 -ORBSvcConf roundtrip.conf -k file://$IOR -z -h 10000 -l 10000 > ec_roundtrip.$c.01.txt 2>&1 </dev/null &
+
+ ./client -ORBDebugLevel 0 -ORBSvcConf roundtrip.conf -k file://$IOR -z -h 10000 -l 10000 > ec_roundtrip.$c.02.txt 2>&1 </dev/null &
+
+ wait
+ wait
+ wait
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/server.cpp b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/server.cpp
new file mode 100644
index 00000000000..677cf6870f5
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/server.cpp
@@ -0,0 +1,156 @@
+// $Id$
+
+#include "RT_Class.h"
+#include "ORB_Holder.h"
+#include "Servant_var.h"
+#include "RIR_Narrow.h"
+#include "RTServer_Setup.h"
+#include "Control.h"
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/RTPortableServer/RTPortableServer.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "tao/Messaging/Messaging.h"
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+
+ACE_RCSID (TAO_PERF_RTEC_Federated_Roundtrip,
+ server,
+ "$Id$")
+
+const char *ior_output_file = "test.ior";
+int iterations = 10000;
+int nthreads = 1;
+int peer_count = 2;
+int do_dump_history = 0;
+int use_rt_corba = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:i:p:n:rd");
+ 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 'i':
+ iterations = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'p':
+ peer_count = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'r':
+ use_rt_corba = 1;
+ break;
+
+ case 'd':
+ do_dump_history = 1;
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> "
+ "-n nthreads "
+ "-i iterations "
+ "-p peer_count "
+ "-r (use RT-CORBA) "
+ "-d (dump full history) "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int main (int argc, char *argv[])
+{
+ RT_Class rt_class;
+
+ ACE_TRY_NEW_ENV
+ {
+ ORB_Holder orb (argc, argv, ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ RTServer_Setup rtserver_setup (use_rt_corba,
+ orb,
+ rt_class,
+ nthreads
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ RIR_Narrow<PortableServer::POA>::resolve (orb,
+ "RootPOA"
+ 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;
+
+ PortableServer::POA_var control_poa (rtserver_setup.poa ());
+ Servant_var<Control> control_impl (
+ new Control (peer_count,
+ iterations,
+ do_dump_history,
+ orb,
+ control_poa.in ())
+ );
+
+ Federated_Test::Control_var control =
+ control_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (control.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", 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"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Makefile.am b/TAO/orbsvcs/performance-tests/RTEvent/Makefile.am
new file mode 100644
index 00000000000..c4a6b0c9764
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Makefile.am
@@ -0,0 +1,19 @@
+## 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 \
+ TCP_Baseline \
+ Roundtrip \
+ RTCORBA_Callback \
+ RTCORBA_Baseline \
+ Federated_Roundtrip \
+ Colocated_Roundtrip
+
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Makefile.am b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Makefile.am
new file mode 100644
index 00000000000..b536939e7c1
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Makefile.am
@@ -0,0 +1,170 @@
+## 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.RTCORBA_Baseline_IDL.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+if !BUILD_ACE_FOR_TAO
+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_HEADERS = \
+ Test.idl
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_RT_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.RTCORBA_Baseline_Client.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+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 \
+ -I$(srcdir)/../lib
+
+client_SOURCES = \
+ TestC.cpp \
+ client.cpp \
+ Roundtrip.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/performance-tests/RTEvent/lib/libTAO_RTEC_Perf.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTCORBAEvent.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_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTPortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.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_RT_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.RTCORBA_Baseline_Server.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+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 \
+ -I$(srcdir)/../lib
+
+server_SOURCES = \
+ Roundtrip.cpp \
+ TestC.cpp \
+ TestS.cpp \
+ server.cpp \
+ Roundtrip.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/performance-tests/RTEvent/lib/libTAO_RTEC_Perf.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTCORBAEvent.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_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTPortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.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_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/performance-tests/RTEvent/RTCORBA_Baseline/RTCORBA_Baseline.mpc b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/RTCORBA_Baseline.mpc
new file mode 100644
index 00000000000..188d5276fd9
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/RTCORBA_Baseline.mpc
@@ -0,0 +1,52 @@
+// $Id$
+
+project(*IDL): orbsvcsexe, rtcorbaevent, strategies, minimum_corba {
+
+ IDL_Files {
+ Test.idl
+ }
+
+ custom_only = 1
+}
+
+project(*server): orbsvcsexe, rtcorbaevent, strategies, minimum_corba {
+ after += RTEC_Perf
+ libs += TAO_RTEC_Perf
+
+ specific (automake) {
+ includes += $(srcdir)/../lib
+ } else {
+ includes += ../lib
+ }
+
+ Source_Files {
+ server.cpp
+ Roundtrip.cpp
+ TestS.cpp
+ TestC.cpp
+ }
+
+ after += *IDL
+ IDL_Files {
+ }
+}
+
+project(*client): orbsvcsexe, rtcorbaevent, strategies, minimum_corba {
+ after += RTEC_Perf
+ libs += TAO_RTEC_Perf
+
+ specific (automake) {
+ includes += $(srcdir)/../lib
+ } else {
+ includes += ../lib
+ }
+
+ Source_Files {
+ TestC.cpp
+ client.cpp
+ }
+
+ after += *IDL
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Roundtrip.cpp b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Roundtrip.cpp
new file mode 100644
index 00000000000..d4ef62e9781
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Roundtrip.cpp
@@ -0,0 +1,42 @@
+//
+// $Id$
+//
+#include "Roundtrip.h"
+#include "ace/High_Res_Timer.h"
+
+ACE_RCSID (TAO_RTEC_Perf_RTCORBA_Baseline,
+ Roundtrip,
+ "$Id$")
+
+Roundtrip::Roundtrip (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+ , gsf_ (ACE_High_Res_Timer::calibrate ())
+{
+}
+
+Test::Timestamp
+Roundtrip::test_method (Test::Timestamp send_time,
+ CORBA::Long workload_in_usecs
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+ CORBA::Long elapsed = 0;
+
+ while (elapsed < workload_in_usecs)
+ {
+ elapsed =
+ static_cast<CORBA::Long> (
+ (ACE_OS::gethrtime () - start) / this->gsf_
+ );
+ }
+
+ return send_time;
+}
+
+void
+Roundtrip::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Roundtrip.h b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Roundtrip.h
new file mode 100644
index 00000000000..a4b01ce89b1
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Roundtrip.h
@@ -0,0 +1,38 @@
+//
+// $Id$
+//
+
+#ifndef ROUNDTRIP_H
+#define ROUNDTRIP_H
+#include /**/ "ace/pre.h"
+
+#include "TestS.h"
+
+/// Implement the Test::Roundtrip interface
+class Roundtrip
+ : public virtual POA_Test::Roundtrip
+{
+public:
+ /// Constructor
+ Roundtrip (CORBA::ORB_ptr orb);
+
+ // = The skeleton methods
+ virtual Test::Timestamp test_method (Test::Timestamp send_time,
+ CORBA::Long workload_in_usecs
+ ACE_ENV_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_;
+
+ /// Translate the high resolution timer units into microseconds
+ ACE_UINT32 gsf_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* ROUNDTRIP_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Test.idl b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Test.idl
new file mode 100644
index 00000000000..7e72f72bcb5
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/Test.idl
@@ -0,0 +1,27 @@
+//
+// $Id$
+//
+
+/// A simple module to avoid namespace pollution
+module Test
+{
+ /// Use a timestamp to measure the roundtrip delay
+ typedef unsigned long long Timestamp;
+
+ /// Measure roundtrip delay
+ interface Roundtrip
+ {
+ /// A simple method to measure roundtrip delays
+ /**
+ * The operation simply returns its argument, this is used in AMI
+ * and deferred synchronous tests to measure the roundtrip delay
+ * without the need for a different reply handler for each
+ * request.
+ */
+ Timestamp test_method (in Timestamp send_time,
+ in long workload_in_usecs);
+
+ /// Shutdown the ORB
+ void shutdown ();
+ };
+};
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/client.cpp b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/client.cpp
new file mode 100644
index 00000000000..a3caafe3b54
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/client.cpp
@@ -0,0 +1,280 @@
+// $Id$
+
+#include "RT_Class.h"
+#include "ORB_Holder.h"
+#include "RIR_Narrow.h"
+#include "RTClient_Setup.h"
+#include "Client_Options.h"
+#include "TestC.h"
+
+#include "tao/Messaging/Messaging.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "tao/RTPortableServer/RTPortableServer.h"
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Sample_History.h"
+#include "ace/Basic_Stats.h"
+#include "ace/Stats.h"
+#include "ace/Task.h"
+#include "ace/Barrier.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (TAO_RTEC_PERF_RTCORBA_Baseline,
+ client,
+ "$Id$")
+
+class Roundtrip_Task : public ACE_Task_Base
+{
+public:
+ Roundtrip_Task (Test::Roundtrip_ptr roundtrip,
+ ACE_Barrier *the_barrier)
+ : roundtrip_ (Test::Roundtrip::_duplicate (roundtrip))
+ , barrier_ (the_barrier)
+ {
+ }
+
+ virtual void run_test (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ virtual int svc (void)
+ {
+ this->barrier_->wait ();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->run_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) done...\n"));
+ return 0;
+ }
+
+protected:
+ Test::Roundtrip_var roundtrip_;
+
+ ACE_Barrier *barrier_;
+};
+
+class High_Priority_Task : public Roundtrip_Task
+{
+public:
+ High_Priority_Task (Test::Roundtrip_ptr roundtrip,
+ ACE_Barrier *the_barrier,
+ int iterations,
+ int period_in_usecs,
+ int workload)
+ : Roundtrip_Task (roundtrip, the_barrier)
+ , sample_history (iterations)
+ , iterations_ (iterations)
+ , period_in_usecs_ (period_in_usecs)
+ , workload_ (workload)
+ {
+ }
+
+ virtual void run_test (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ for (int i = 0; i != this->iterations_; ++i)
+ {
+ ACE_Time_Value period (0, this->period_in_usecs_);
+ ACE_OS::sleep (period);
+
+ ACE_TRY {
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+ (void) this->roundtrip_->test_method (start,
+ this->workload_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_hrtime_t elapsed = ACE_OS::gethrtime () - start;
+
+ this->sample_history.sample (elapsed);
+
+ } ACE_CATCHANY {
+ } ACE_ENDTRY;
+ }
+ }
+
+ ACE_Sample_History sample_history;
+
+private:
+ int iterations_;
+
+ int period_in_usecs_;
+
+ int workload_;
+};
+
+class Low_Priority_Task : public Roundtrip_Task
+{
+public:
+ Low_Priority_Task (Test::Roundtrip_ptr roundtrip,
+ ACE_Barrier *the_barrier,
+ int period_in_usecs,
+ int workload)
+ : Roundtrip_Task (roundtrip, the_barrier)
+ , stopped_ (0)
+ , period_in_usecs_ (period_in_usecs)
+ , workload_ (workload)
+ {
+ }
+
+ void stop (void)
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ this->stopped_ = 1;
+ }
+
+ virtual void run_test (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ for (;;)
+ {
+ ACE_Time_Value period (0, this->period_in_usecs_);
+ ACE_OS::sleep (period);
+
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (this->stopped_)
+ return;
+ }
+
+ ACE_TRY {
+ CORBA::ULongLong dummy = 0;
+ (void) this->roundtrip_->test_method (dummy,
+ this->workload_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ } ACE_CATCHANY {
+ } ACE_ENDTRY;
+ }
+ }
+
+private:
+ TAO_SYNCH_MUTEX mutex_;
+
+ int stopped_;
+
+ int period_in_usecs_;
+
+ int workload_;
+};
+
+int main (int argc, char *argv[])
+{
+ RT_Class rt_class;
+
+ ACE_TRY_NEW_ENV
+ {
+ ORB_Holder orb (argc, argv, ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Client_Options options (argc, argv);
+ if (argc != 1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-i iterations (iterations) "
+ "-h high_priority_period (usecs) "
+ "-l low_priority_period (usecs) "
+ "-w high_priority_workload (usecs) "
+ "-v low_priority_workload (usecs) "
+ "-r (enable RT-CORBA) "
+ "-n nthreads (low priority thread) "
+ "-d (dump history) "
+ "-z (disable low priority) "
+ "\n",
+ argv [0]),
+ 1);
+ }
+
+ RTClient_Setup rtclient_setup (options.use_rt_corba,
+ orb,
+ rt_class,
+ options.nthreads
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Finished ORB and POA configuration\n"));
+
+ CORBA::Object_var object =
+ orb->string_to_object (options.ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test::Roundtrip_var roundtrip =
+ Test::Roundtrip::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::PolicyList_var inconsistent_policies;
+ (void) roundtrip->_validate_connection (inconsistent_policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int thread_count = 1 + options.nthreads;
+ ACE_Barrier the_barrier (thread_count);
+
+ 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));
+
+ int per_thread_period = options.low_priority_period;
+ if (options.global_low_priority_rate)
+ per_thread_period = options.low_priority_period * options.nthreads;
+ Low_Priority_Task low_priority (roundtrip.in (), &the_barrier,
+ per_thread_period,
+ options.low_priority_workload);
+ low_priority.activate (rt_class.thr_sched_class ()
+ | THR_NEW_LWP | THR_JOINABLE,
+ options.nthreads, 1,
+ rt_class.priority_low ());
+
+ High_Priority_Task high_priority (roundtrip.in (), &the_barrier,
+ options.iterations,
+ options.high_priority_period,
+ options.high_priority_workload);
+ high_priority.activate (rt_class.thr_sched_class ()
+ | THR_NEW_LWP | THR_JOINABLE,
+ 1, 1,
+ rt_class.priority_low ());
+
+ high_priority.wait ();
+ low_priority.stop ();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - high prio task joined\n"));
+
+ ACE_Sample_History &history = high_priority.sample_history;
+ if (options.dump_history)
+ {
+ history.dump_samples ("HISTORY", gsf);
+ }
+
+ ACE_Basic_Stats high_priority_stats;
+ history.collect_basic_stats (high_priority_stats);
+ high_priority_stats.dump_results ("High Priority", gsf);
+
+ low_priority.thr_mgr ()->wait ();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - all task(s) joined\n"));
+
+ roundtrip->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - starting cleanup\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/generate_cmp.sh b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/generate_cmp.sh
new file mode 100755
index 00000000000..2c7c555e9e8
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/generate_cmp.sh
@@ -0,0 +1,10 @@
+#/bin/sh
+
+for i in reactive rtcorba; do
+ echo $i ;
+ for j in 99 999 9999; do
+ paste $i.avg.dat ${i}.${j}.dat |
+ awk '{print $1, $4 / $2}' > $i.${j}.cmp.dat
+ done
+done
+
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/generate_histo.sh b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/generate_histo.sh
new file mode 100755
index 00000000000..9837c080edf
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/generate_histo.sh
@@ -0,0 +1,8 @@
+#/bin/sh
+
+for i in *.txt; do
+ b=`basename $i .txt`
+ echo $i
+ awk '/^HISTO/ {print $3}' $i | sort -n | uniq -c |
+ awk '{print $2, 100.0 * $1 / 20000.0}' > $b.histo.dat
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/generate_percentiles.sh b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/generate_percentiles.sh
new file mode 100755
index 00000000000..8d0914a6c16
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/generate_percentiles.sh
@@ -0,0 +1,47 @@
+#/bin/sh
+
+. parameters
+
+PERCENTILES="0 .25 .50 .75 .99 .999 .9999 1"
+
+for t in $*; do
+ cat /dev/null > ${t}.avg.dat
+ for p in $PERCENTILES; do
+ cat /dev/null > ${t}$p.percentile.dat
+ done
+
+ for c in $NCONSUMERS; do
+ echo $t $c
+ INPUT=${t}.${c}.txt
+ awk -v c=$c '/^HISTO/ {
+ n++;
+ s += $3
+ }
+ END {
+ printf("%d %f\n", c, s/n);
+ }' $INPUT >> ${t}.avg.dat
+
+ TFILE=/tmp/${t}.$$
+ awk '/^HISTO/ {print $3}' $INPUT | sort -n | uniq -c > $TFILE
+ for p in $PERCENTILES; do
+ awk -v N=$ITERATIONS '{print $2, $1 / N}' $TFILE |
+ awk -v c=$c -v p=${p} '\
+BEGIN { x = 0; l = 0; }
+{ s += $2;
+ l = $1;
+ if (x == 0 && s >= p) {
+ x = $1;
+ }
+}
+END {
+ if (s < p) {
+ x = l;
+ }
+ printf("%d %f\n", c, x);
+}' >> ${t}${p}.percentile.dat
+ done
+ /bin/rm -f $TFILE
+
+ done
+
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/realtime.conf b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/realtime.conf
new file mode 100644
index 00000000000..493ad253959
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/realtime.conf
@@ -0,0 +1,2 @@
+# $Id$
+static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBPriorityMapping direct"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/realtime.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/realtime.conf.xml
new file mode 100644
index 00000000000..86ba9fd5fbf
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/realtime.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/realtime.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="RT_ORB_Loader" params="-ORBSchedPolicy SCHED_FIFO -ORBPriorityMapping direct"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/run.sh b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/run.sh
new file mode 100755
index 00000000000..925ea8751dc
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/run.sh
@@ -0,0 +1,40 @@
+#! /bin/sh
+#
+# $Id$
+#
+
+LOW_PRIORITY="1 4 8 12 16 20 24 28 32"
+
+ITERATIONS=10000
+
+#IOR=/project/amras/coryan/IOR/roundtrip.ior
+IOR=test.ior
+
+for c in $LOW_PRIORITY; do
+ date
+ echo rtcorba $c
+
+ /bin/rm -f $IOR
+# ssh celegorm "cd /project/celegorm/coryan/RTCORBA_Baseline ; ./server -ORBSvcConf realtime.conf -r -n $c -o $IOR" >server.log 2>&1 </dev/null &
+ ./server -ORBSvcConf realtime.conf -r -n $c -o $IOR >server.log 2>&1 </dev/null &
+ while [ ! -f $IOR ]; do
+ sleep 1
+ done
+ ./client -ORBSvcConf realtime.conf -g -r -d -h 0 -l 0 -w 9000 -i $ITERATIONS -n $c -k file://$IOR > rtcorba.$c.txt 2>&1
+ sleep 5
+ wait
+
+ date
+ echo reactive $c
+
+ /bin/rm -f $IOR
+# ssh celegorm "cd /project/celegorm/coryan/RTCORBA_Baseline ; ./server -n $c -o $IOR" >server.log 2>&1 </dev/null &
+ ./server -n $c -o $IOR >server.log 2>&1 </dev/null &
+ while [ ! -f $IOR ]; do
+ sleep 1
+ done
+ ./client -g -d -h 0 -l 0 -w 9000 -i $ITERATIONS -n $c -k file://$IOR > reactive.$c.txt 2>&1
+ sleep 5
+ wait
+
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/server.cpp b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/server.cpp
new file mode 100644
index 00000000000..f82199ba24e
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/server.cpp
@@ -0,0 +1,137 @@
+// $Id$
+
+#include "RT_Class.h"
+#include "ORB_Holder.h"
+#include "Servant_var.h"
+#include "RIR_Narrow.h"
+#include "RTServer_Setup.h"
+#include "Roundtrip.h"
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/RTPortableServer/RTPortableServer.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "tao/Messaging/Messaging.h"
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+
+ACE_RCSID (TAO_PERF_RTEC_RTCORBA_Baseline,
+ server,
+ "$Id$")
+
+const char *ior_output_file = "test.ior";
+int use_rt_corba = 0;
+int nthreads = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:n:r");
+ 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 'r':
+ use_rt_corba = 1;
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> "
+ "-r (use RT-CORBA) "
+ "-n nthreads "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int main (int argc, char *argv[])
+{
+ /// Move the test to the real-time class if it is possible.
+ RT_Class rt_class;
+
+ ACE_TRY_NEW_ENV
+ {
+ ORB_Holder orb (argc, argv, ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ RTServer_Setup rtserver_setup (use_rt_corba,
+ orb,
+ rt_class,
+ nthreads
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ RIR_Narrow<PortableServer::POA>::resolve (orb,
+ "RootPOA"
+ 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;
+
+ PortableServer::POA_var the_poa (rtserver_setup.poa ());
+
+ Servant_var<Roundtrip> roundtrip (new Roundtrip (orb));
+
+ PortableServer::ObjectId_var id =
+ the_poa->activate_object (roundtrip.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ the_poa->id_to_reference (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (object.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", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - 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/performance-tests/RTEvent/RTCORBA_Callback/Callback.cpp b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Callback.cpp
new file mode 100644
index 00000000000..134dc30f9b3
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Callback.cpp
@@ -0,0 +1,43 @@
+//
+// $Id$
+//
+#include "Callback.h"
+#include "Implicit_Deactivator.h"
+#include "ace/OS_NS_time.h"
+
+ACE_RCSID (TAO_RTEC_Perf_RTCORBA_Callback,
+ Callback,
+ "$Id$")
+
+Callback::Callback (int iterations,
+ PortableServer::POA_ptr poa)
+ : sample_history_ (iterations)
+ , poa_ (PortableServer::POA::_duplicate (poa))
+{
+}
+
+ACE_Sample_History &
+Callback::sample_history (void)
+{
+ return this->sample_history_;
+}
+
+void
+Callback::sample (Test::Timestamp the_timestamp
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_hrtime_t elapsed = ACE_OS::gethrtime () - the_timestamp;
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (sample_history_.max_samples () == sample_history_.sample_count ())
+ return;
+ this->sample_history_.sample (elapsed);
+}
+
+PortableServer::POA_ptr
+Callback::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Callback.h b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Callback.h
new file mode 100644
index 00000000000..520895f1cab
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Callback.h
@@ -0,0 +1,58 @@
+/**
+ * @file Callback.h
+ *
+ * $Id$
+ *
+ */
+
+#ifndef CALLBACK_H
+#define CALLBACK_H
+
+#include "TestS.h"
+#include "ace/Sample_History.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Callback
+ *
+ * @brief Implicit the Test::Callback interface
+ *
+ */
+class Callback
+ : public virtual POA_Test::Callback
+
+{
+public:
+ /// Constructor
+ Callback (int iterations,
+ PortableServer::POA_ptr poa);
+
+ /// Access the history of samples
+ ACE_Sample_History &sample_history (void);
+
+ //@{
+ /** @name The RtecEventComm::PushCallback methods
+ */
+ virtual void sample (Test::Timestamp the_timestamp
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+private:
+ /// Synchronize access to the internal data
+ TAO_SYNCH_MUTEX mutex_;
+
+ /// The history of latency samples
+ ACE_Sample_History sample_history_;
+
+ /// The default poa
+ PortableServer::POA_var poa_;
+};
+
+#endif /* CALLBACK_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Makefile.am b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Makefile.am
new file mode 100644
index 00000000000..d94aad01491
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Makefile.am
@@ -0,0 +1,174 @@
+## 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.RTCORBA_Callback_IDL.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+if !BUILD_ACE_FOR_TAO
+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_HEADERS = \
+ Test.idl
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_RT_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.RTCORBA_Callback_Client.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+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 \
+ -I$(srcdir)/../lib
+
+client_SOURCES = \
+ Callback.cpp \
+ TestC.cpp \
+ TestS.cpp \
+ client.cpp \
+ Callback.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/performance-tests/RTEvent/lib/libTAO_RTEC_Perf.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTCORBAEvent.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_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTPortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.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_RT_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.RTCORBA_Callback_Server.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+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 \
+ -I$(srcdir)/../lib
+
+server_SOURCES = \
+ Session.cpp \
+ Session_Factory.cpp \
+ TestC.cpp \
+ TestS.cpp \
+ server.cpp \
+ Session.h \
+ Session_Factory.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/performance-tests/RTEvent/lib/libTAO_RTEC_Perf.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTCORBAEvent.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_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTPortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.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_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/performance-tests/RTEvent/RTCORBA_Callback/RTCORBA_Callback.mpc b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/RTCORBA_Callback.mpc
new file mode 100644
index 00000000000..bfd1de34f68
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/RTCORBA_Callback.mpc
@@ -0,0 +1,54 @@
+// $Id$
+
+project(*IDL): orbsvcsexe, rtcorbaevent, strategies, minimum_corba {
+ IDL_Files {
+ Test.idl
+ }
+
+ custom_only = 1
+}
+
+project(*server): orbsvcsexe, rtcorbaevent, strategies, minimum_corba {
+ after += RTEC_Perf
+ libs += TAO_RTEC_Perf
+
+ specific (automake) {
+ includes += $(srcdir)/../lib
+ } else {
+ includes += ../lib
+ }
+
+ Source_Files {
+ server.cpp
+ Session.cpp
+ Session_Factory.cpp
+ TestS.cpp
+ TestC.cpp
+ }
+
+ after += *IDL
+ IDL_Files {
+ }
+}
+
+project(*client): orbsvcsexe, rtcorbaevent, strategies, minimum_corba {
+ after += RTEC_Perf
+ libs += TAO_RTEC_Perf
+
+ specific (automake) {
+ includes += $(srcdir)/../lib
+ } else {
+ includes += ../lib
+ }
+
+ Source_Files {
+ client.cpp
+ Callback.cpp
+ TestS.cpp
+ TestC.cpp
+ }
+
+ after += *IDL
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session.cpp b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session.cpp
new file mode 100644
index 00000000000..5c7627717eb
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session.cpp
@@ -0,0 +1,40 @@
+//
+// $Id$
+//
+#include "Session.h"
+#include "Implicit_Deactivator.h"
+
+ACE_RCSID (TAO_RTEC_Perf_RTCORBA_Callback,
+ Session,
+ "$Id$")
+
+Session::Session (Test::Callback_ptr cb,
+ PortableServer::POA_ptr poa)
+ : cb_ (Test::Callback::_duplicate (cb))
+ , poa_ (PortableServer::POA::_duplicate (poa))
+{
+}
+
+void
+Session::sample (Test::Timestamp the_timestamp
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->cb_->sample (the_timestamp
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Session::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ Implicit_Deactivator deactivator (this
+ ACE_ENV_ARG_PARAMETER);
+}
+
+PortableServer::POA_ptr
+Session::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session.h b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session.h
new file mode 100644
index 00000000000..65d8f4b6507
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session.h
@@ -0,0 +1,38 @@
+//
+// $Id$
+//
+
+#ifndef SESSION_H
+#define SESSION_H
+#include /**/ "ace/pre.h"
+
+#include "TestS.h"
+
+/// Implement the Test::Session interface
+class Session
+ : public virtual POA_Test::Session
+{
+public:
+ /// Constructor
+ Session (Test::Callback_ptr cb,
+ PortableServer::POA_ptr poa);
+
+ // = The skeleton methods
+ virtual void sample (Test::Timestamp the_timestamp
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ Test::Callback_var cb_;
+
+ PortableServer::POA_var poa_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* SESSION_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session_Factory.cpp b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session_Factory.cpp
new file mode 100644
index 00000000000..735a8d0ec84
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session_Factory.cpp
@@ -0,0 +1,42 @@
+//
+// $Id$
+//
+#include "Session_Factory.h"
+#include "Session.h"
+#include "Servant_var.h"
+
+ACE_RCSID (TAO_RTEC_Perf_RTCORBA_Callback,
+ Session_Factory,
+ "$Id$")
+
+Session_Factory::Session_Factory (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+ , poa_ (PortableServer::POA::_duplicate (poa))
+{
+}
+
+Test::Session_ptr
+Session_Factory::create_new_session (Test::Callback_ptr cb
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ Servant_var<Session> session_impl (new Session (cb,
+ this->poa_.in ()));
+
+ return session_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+Session_Factory::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
+PortableServer::POA_ptr
+Session_Factory::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session_Factory.h b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session_Factory.h
new file mode 100644
index 00000000000..875535d6b93
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Session_Factory.h
@@ -0,0 +1,39 @@
+//
+// $Id$
+//
+
+#ifndef SESSION_FACTORY_H
+#define SESSION_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "TestS.h"
+
+/// Implement the Test::Session_Factory interface
+class Session_Factory
+ : public virtual POA_Test::Session_Factory
+{
+public:
+ /// Constructor
+ Session_Factory (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa);
+
+ // = The skeleton methods
+ virtual Test::Session_ptr create_new_session (Test::Callback_ptr cb
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// Use an ORB reference to shutdown the application.
+ CORBA::ORB_var orb_;
+
+ PortableServer::POA_var poa_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* SESSION_FACTORY_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Test.idl b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Test.idl
new file mode 100644
index 00000000000..2b27d49688c
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/Test.idl
@@ -0,0 +1,39 @@
+//
+// $Id$
+//
+
+/// A simple module to avoid namespace pollution
+module Test
+{
+ /// Use a timestamp to measure the roundtrip delay
+ typedef unsigned long long Timestamp;
+
+ interface Session;
+ interface Callback;
+
+ /// Create sessions to measure roundtrip delays
+ interface Session_Factory
+ {
+ /// Return a new session
+ Session create_new_session (in Callback the_callback);
+
+ /// Shutdown the server
+ void shutdown ();
+ };
+
+ /// Each experiment is ran using completely separate
+ interface Session
+ {
+ /// Run one iteration of the experiment
+ void sample (in Timestamp the_timestamp);
+
+ /// Destroy the session
+ void shutdown ();
+ };
+
+ interface Callback
+ {
+ /// Measure one iteration
+ void sample (in Timestamp the_timestamp);
+ };
+};
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/client.cpp b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/client.cpp
new file mode 100644
index 00000000000..420b6d15b95
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/client.cpp
@@ -0,0 +1,335 @@
+// $Id$
+
+#include "Callback.h"
+
+#include "RT_Class.h"
+#include "ORB_Holder.h"
+#include "Servant_var.h"
+#include "RIR_Narrow.h"
+#include "RTServer_Setup.h"
+#include "Client_Options.h"
+#include "Implicit_Deactivator.h"
+#include "Shutdown.h"
+#include "ORB_Task.h"
+#include "ORB_Task_Activator.h"
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/RTPortableServer/RTPortableServer.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "tao/Messaging/Messaging.h"
+#include "ace/Auto_Functor.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Basic_Stats.h"
+#include "ace/Stats.h"
+#include "ace/Task.h"
+#include "ace/Barrier.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (TAO_PERF_RTEC_RTCORBA_Baseline,
+ client,
+ "$Id$")
+
+class Roundtrip_Task : public ACE_Task_Base
+{
+public:
+ Roundtrip_Task (Test::Session_Factory_ptr session_factory,
+ ACE_Barrier *the_barrier)
+ : session_factory_ (Test::Session_Factory::_duplicate (session_factory))
+ , the_barrier_ (the_barrier)
+ {
+ }
+
+ virtual void run_test (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ virtual int svc (void)
+ {
+ this->the_barrier_->wait ();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->run_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) done...\n"));
+ return 0;
+ }
+
+protected:
+ Test::Session_Factory_var session_factory_;
+
+ ACE_Barrier *the_barrier_;
+};
+
+class High_Priority_Task : public Roundtrip_Task
+{
+public:
+ High_Priority_Task (Test::Session_Factory_ptr session_factory,
+ ACE_Barrier *the_barrier,
+ PortableServer::POA_ptr poa,
+ int iterations,
+ int period_in_usecs)
+ : Roundtrip_Task (session_factory, the_barrier)
+ , callback (new Callback (iterations, poa))
+ , iterations_ (iterations)
+ , period_in_usecs_ (period_in_usecs)
+ {
+ }
+
+ virtual void run_test (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ Test::Callback_var cb =
+ callback->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ Implicit_Deactivator deactivator (callback);
+
+ Test::Session_var session =
+ this->session_factory_->create_new_session (cb.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_Utils::Auto_Functor<Test::Session,Shutdown<Test::Session> > auto_shutdown (session.in ());
+
+ for (int i = 0; i != this->iterations_; ++i)
+ {
+ if ((i + 1) % 1000 == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) - Thread has sent %d messages @ %T\n",
+ i + 1));
+ }
+
+ ACE_Time_Value period (0, this->period_in_usecs_);
+ ACE_OS::sleep (period);
+
+ ACE_TRY {
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+ (void) session->sample (start
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ } ACE_CATCHANY {
+ } ACE_ENDTRY;
+ }
+ }
+
+ Servant_var<Callback> callback;
+
+private:
+ int iterations_;
+
+ int period_in_usecs_;
+};
+
+class Low_Priority_Task : public Roundtrip_Task
+{
+public:
+ Low_Priority_Task (Test::Session_Factory_ptr session_factory,
+ ACE_Barrier *the_barrier,
+ PortableServer::POA_ptr poa,
+ int period_in_usecs)
+ : Roundtrip_Task (session_factory, the_barrier)
+ , callback (new Callback (1, poa))
+ , stopped_ (0)
+ , period_in_usecs_ (period_in_usecs)
+ {
+ }
+
+ void stop (void)
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ this->stopped_ = 1;
+ }
+
+ virtual void run_test (ACE_ENV_SINGLE_ARG_DECL)
+ {
+ Test::Callback_var cb =
+ callback->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ Implicit_Deactivator deactivator (callback);
+
+ Test::Session_var session =
+ this->session_factory_->create_new_session (cb.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_Utils::Auto_Functor<Test::Session,Shutdown<Test::Session> > auto_shutdown (session.in ());
+
+ for (;;)
+ {
+ ACE_Time_Value period (0, this->period_in_usecs_);
+ ACE_OS::sleep (period);
+
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (this->stopped_)
+ return;
+ }
+
+ ACE_TRY {
+ CORBA::ULongLong dummy = 0;
+ (void) session->sample (dummy
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ } ACE_CATCHANY {
+ } ACE_ENDTRY;
+ }
+ }
+
+private:
+ TAO_SYNCH_MUTEX mutex_;
+
+ Servant_var<Callback> callback;
+
+ int stopped_;
+
+ int period_in_usecs_;
+};
+
+int main (int argc, char *argv[])
+{
+ /// Move the test to the real-time class if it is possible.
+ RT_Class rt_class;
+
+ ACE_TRY_NEW_ENV
+ {
+ ORB_Holder orb (argc, argv, ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Client_Options options (argc, argv);
+ if (argc != 1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-i iterations (iterations) "
+ "-h high_priority_period (usecs) "
+ "-l low_priority_period (usecs) "
+ "-w high_priority_workload (usecs) "
+ "-v low_priority_workload (usecs) "
+ "-r (enable RT-CORBA) "
+ "-n nthreads (low priority thread) "
+ "-d (dump history) "
+ "-z (disable low priority) "
+ "\n",
+ argv [0]),
+ 1);
+ }
+
+ RTServer_Setup rtserver_setup (options.use_rt_corba,
+ orb,
+ rt_class,
+ options.nthreads
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ RIR_Narrow<PortableServer::POA>::resolve (orb,
+ "RootPOA"
+ 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;
+
+ PortableServer::POA_var the_poa (rtserver_setup.poa ());
+
+ ORB_Task orb_task (orb);
+ ORB_Task_Activator orb_task_activator (rt_class.priority_high (),
+ rt_class.thr_sched_class (),
+ options.nthreads,
+ &orb_task);
+
+ ACE_DEBUG ((LM_DEBUG, "Finished ORB and POA configuration\n"));
+
+ CORBA::Object_var object =
+ orb->string_to_object (options.ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test::Session_Factory_var session_factory =
+ Test::Session_Factory::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::PolicyList_var inconsistent_policies;
+ (void) session_factory->_validate_connection (inconsistent_policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int thread_count = 1 + options.nthreads;
+ ACE_Barrier the_barrier (thread_count);
+
+ 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));
+
+ int per_thread_period = options.low_priority_period;
+ if (options.global_low_priority_rate)
+ per_thread_period = options.low_priority_period * options.nthreads;
+ Low_Priority_Task low_priority (session_factory.in (),
+ &the_barrier,
+ the_poa.in (),
+ per_thread_period);
+ low_priority.activate (rt_class.thr_sched_class ()
+ | THR_NEW_LWP | THR_JOINABLE,
+ options.nthreads, 1,
+ rt_class.priority_low ());
+
+ High_Priority_Task high_priority (session_factory.in (),
+ &the_barrier,
+ the_poa.in (),
+ options.iterations,
+ options.high_priority_period);
+ high_priority.activate (rt_class.thr_sched_class ()
+ | THR_NEW_LWP | THR_JOINABLE,
+ 1, 1,
+ rt_class.priority_low ());
+
+ high_priority.wait ();
+ low_priority.stop ();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - high prio task joined\n"));
+
+ ACE_Sample_History &history =
+ high_priority.callback->sample_history ();
+ if (options.dump_history)
+ {
+ history.dump_samples ("HISTORY", gsf);
+ }
+
+ ACE_Basic_Stats high_priority_stats;
+ history.collect_basic_stats (high_priority_stats);
+ high_priority_stats.dump_results ("High Priority", gsf);
+
+ low_priority.wait ();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - all task(s) joined\n"));
+
+ session_factory->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - starting cleanup\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/parameters b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/parameters
new file mode 100644
index 00000000000..919cc146b31
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/parameters
@@ -0,0 +1,13 @@
+NTHREADS="2 4 8 16 32"
+
+#ITERATIONS=25000
+ITERATIONS=5000
+
+#IOR=/project/amras/coryan/IOR/roundtrip.ior
+IOR=test.ior
+
+#REMOTE_HOST=celegorm
+REMOTE_HOST=localhost
+
+#REMOTE_LOCATION=/project/celegorm/coryan/EC_Roundtrip
+REMOTE_LOCATION=$PWD
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/realtime.conf b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/realtime.conf
new file mode 100644
index 00000000000..3a353fa3bf6
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/realtime.conf
@@ -0,0 +1,2 @@
+# $Id$
+static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBPriorityMapping continuous"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/realtime.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/realtime.conf.xml
new file mode 100644
index 00000000000..c10ec68a86d
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/realtime.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/realtime.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="RT_ORB_Loader" params="-ORBSchedPolicy SCHED_FIFO -ORBPriorityMapping continuous"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/run_test.sh b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/run_test.sh
new file mode 100755
index 00000000000..90304e63319
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/run_test.sh
@@ -0,0 +1,34 @@
+#! /bin/sh
+#
+# $Id$
+#
+
+. parameters
+
+for n in $NTHREADS; do
+ date
+ echo normal $n
+
+ /bin/rm -f $IOR
+# ssh $REMOTE_HOST "cd $REMOTE_LOCATION ;./server -o $IOR -n $n" >server.log 2>&1 </dev/null &
+ ./server -o $IOR -n $n >server.log 2>&1 </dev/null &
+ while [ ! -f $IOR ]; do
+ sleep 1
+ done
+ ./client -d -h 10000 -l 10000 -i $ITERATIONS -n $n -k file://$IOR > normal.$n.txt 2>&1
+
+ wait
+
+ date
+ echo realtime $n
+ /bin/rm -f $IOR
+# ssh $REMOTE_HOST "cd $REMOTE_LOCATION ; ./server -ORBSvcConf realtime.conf -r -o $IOR -n $n" >server.log 2>&1 </dev/null &
+ ./server -ORBSvcConf realtime.conf -r -o $IOR -n $n >server.log 2>&1 </dev/null &
+ while [ ! -f $IOR ]; do
+ sleep 1
+ done
+ ./client -ORBSvcConf realtime.conf -r -d -h 10000 -l 10000 -i $ITERATIONS -n $n -k file://$IOR > realtime.$n.txt 2>&1
+
+ wait
+
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/server.cpp b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/server.cpp
new file mode 100644
index 00000000000..59d0eb001d2
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/server.cpp
@@ -0,0 +1,145 @@
+// $Id$
+
+#include "Session_Factory.h"
+
+#include "RT_Class.h"
+#include "ORB_Holder.h"
+#include "Servant_var.h"
+#include "RIR_Narrow.h"
+#include "RTServer_Setup.h"
+#include "ORB_Task.h"
+#include "ORB_Task_Activator.h"
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/RTPortableServer/RTPortableServer.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "tao/Messaging/Messaging.h"
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+
+ACE_RCSID (TAO_PERF_RTEC_RTCORBA_Baseline,
+ server,
+ "$Id$")
+
+const char *ior_output_file = "test.ior";
+int use_rt_corba = 0;
+int nthreads = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:n:r");
+ 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 'r':
+ use_rt_corba = 1;
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> "
+ "-r (use RT-CORBA) "
+ "-n nthreads "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int main (int argc, char *argv[])
+{
+ /// Move the test to the real-time class if it is possible.
+ RT_Class rt_class;
+
+ ACE_TRY_NEW_ENV
+ {
+ ORB_Holder orb (argc, argv, ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ RTServer_Setup rtserver_setup (use_rt_corba,
+ orb,
+ rt_class,
+ nthreads
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ RIR_Narrow<PortableServer::POA>::resolve (orb,
+ "RootPOA"
+ 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;
+
+ PortableServer::POA_var the_poa (rtserver_setup.poa ());
+
+ ORB_Task orb_task (orb);
+ ORB_Task_Activator orb_task_activator (rt_class.priority_high (),
+ rt_class.thr_sched_class (),
+ nthreads,
+ &orb_task);
+
+ ACE_DEBUG ((LM_DEBUG, "Finished ORB and POA configuration\n"));
+
+ Servant_var<Session_Factory> session_factory (
+ new Session_Factory (orb,
+ the_poa.in ())
+ );
+
+ CORBA::Object_var object =
+ session_factory->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (object.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", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - 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/performance-tests/RTEvent/Roundtrip/Makefile.am b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/Makefile.am
new file mode 100644
index 00000000000..6a138d998ad
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/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_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Roundtrip_RTEvent_Client.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+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 \
+ -I$(srcdir)/../lib
+
+client_SOURCES = \
+ client.cpp
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/performance-tests/RTEvent/lib/libTAO_RTEC_Perf.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTCORBAEvent.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_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTPortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.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_RT_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Roundtrip_RTEvent_Server.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+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 \
+ -I$(srcdir)/../lib
+
+server_SOURCES = \
+ server.cpp
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/performance-tests/RTEvent/lib/libTAO_RTEC_Perf.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTCORBAEvent.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_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTPortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.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_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/performance-tests/RTEvent/Roundtrip/Roundtrip.mpc b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/Roundtrip.mpc
new file mode 100644
index 00000000000..1921fed616b
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/Roundtrip.mpc
@@ -0,0 +1,30 @@
+// $Id$
+project(*RTEvent_Server): orbsvcsexe, rtcorbaevent, strategies, minimum_corba {
+ after += RTEC_Perf
+ libs += TAO_RTEC_Perf
+
+ specific (automake) {
+ includes += $(srcdir)/../lib
+ } else {
+ includes += ../lib
+ }
+
+ Source_Files {
+ server.cpp
+ }
+}
+
+project(*RTEvent_Client): orbsvcsexe, rtcorbaevent, strategies, minimum_corba {
+ after += RTEC_Perf
+ libs += TAO_RTEC_Perf
+
+ specific (automake) {
+ includes += $(srcdir)/../lib
+ } else {
+ includes += ../lib
+ }
+
+ Source_Files {
+ client.cpp
+ }
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/client.cpp b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/client.cpp
new file mode 100644
index 00000000000..5e723b3cca5
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/client.cpp
@@ -0,0 +1,231 @@
+// $Id$
+
+#include "RT_Class.h"
+#include "ORB_Holder.h"
+#include "Servant_var.h"
+#include "RIR_Narrow.h"
+#include "RTServer_Setup.h"
+#include "Send_Task.h"
+#include "Client_Group.h"
+#include "ORB_Task.h"
+#include "ORB_Task_Activator.h"
+#include "Low_Priority_Setup.h"
+#include "EC_Destroyer.h"
+#include "Client_Options.h"
+
+#include "orbsvcs/Event_Service_Constants.h"
+
+#include "tao/Messaging/Messaging.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "tao/RTCORBA/Priority_Mapping_Manager.h"
+#include "tao/RTCORBA/Continuous_Priority_Mapping.h"
+#include "tao/RTPortableServer/RTPortableServer.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Sample_History.h"
+#include "ace/Basic_Stats.h"
+#include "ace/Stats.h"
+#include "ace/Sched_Params.h"
+#include "ace/Barrier.h"
+
+ACE_RCSID(TAO_RTEC_PERF_Roundtrip, client, "$Id$")
+
+int main (int argc, char *argv[])
+{
+ const CORBA::Long experiment_id = 1;
+
+ RT_Class rt_class;
+
+ ACE_TRY_NEW_ENV
+ {
+ ORB_Holder orb (argc, argv, ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Client_Options options (argc, argv);
+ if (argc != 1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-i iterations (iterations) "
+ "-h high_priority_period (usecs) "
+ "-l low_priority_period (usecs) "
+ "-w high_priority_workload (usecs) "
+ "-v low_priority_workload (usecs) "
+ "-r (enable RT-CORBA) "
+ "-n nthreads (low priority thread) "
+ "-d (dump history) "
+ "-z (disable low priority) "
+ "\n",
+ argv [0]),
+ 1);
+ }
+
+ RTServer_Setup rtserver_setup (options.use_rt_corba,
+ orb,
+ rt_class,
+ 1 // options.nthreads
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ RIR_Narrow<PortableServer::POA>::resolve (orb,
+ "RootPOA"
+ 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;
+
+ PortableServer::POA_var the_poa (rtserver_setup.poa ());
+
+ ACE_Thread_Manager my_thread_manager;
+
+ ORB_Task orb_task (orb);
+ orb_task.thr_mgr (&my_thread_manager);
+ ORB_Task_Activator orb_task_activator (rt_class.priority_high (),
+ rt_class.thr_sched_class (),
+ 1,
+ &orb_task);
+
+ ACE_DEBUG ((LM_DEBUG, "Finished ORB and POA configuration\n"));
+
+ CORBA::Object_var object =
+ orb->string_to_object (options.ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ EC_Destroyer ec_destroyer (ec.in ());
+
+ CORBA::PolicyList_var inconsistent_policies;
+ (void) ec->_validate_connection (inconsistent_policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Found EC, validated connection\n"));
+
+ int thread_count = 1 + options.nthreads;
+
+ ACE_Barrier the_barrier (thread_count);
+
+ 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));
+
+ CORBA::Long event_range = 1;
+ if (options.funky_supplier_publication)
+ {
+ if (options.unique_low_priority_event)
+ event_range = 1 + options.low_priority_consumers;
+ else
+ event_range = 2;
+ }
+
+ Client_Group high_priority_group;
+ high_priority_group.init (experiment_id,
+ ACE_ES_EVENT_UNDEFINED,
+ event_range,
+ options.iterations,
+ options.high_priority_workload,
+ gsf,
+ the_poa.in (),
+ the_poa.in ());
+
+ Auto_Disconnect<Client_Group> high_priority_disconnect;
+
+ if (!options.high_priority_is_last)
+ {
+ high_priority_group.connect (ec.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ high_priority_disconnect = &high_priority_group;
+ }
+
+ int per_thread_period = options.low_priority_period;
+ if (options.global_low_priority_rate)
+ per_thread_period = options.low_priority_period * options.nthreads;
+
+ Low_Priority_Setup<Client_Group> low_priority_setup (
+ options.low_priority_consumers,
+ 0, // no limit on the number of iterations
+ options.unique_low_priority_event,
+ experiment_id,
+ ACE_ES_EVENT_UNDEFINED + 2,
+ options.low_priority_workload,
+ gsf,
+ options.nthreads,
+ rt_class.priority_low (),
+ rt_class.thr_sched_class (),
+ per_thread_period,
+ the_poa.in (),
+ the_poa.in (),
+ ec.in (),
+ &the_barrier
+ ACE_ENV_ARG_PARAMETER);
+
+ if (options.high_priority_is_last)
+ {
+ high_priority_group.connect (ec.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ high_priority_disconnect = &high_priority_group;
+ }
+ Send_Task high_priority_task;
+ high_priority_task.init (options.iterations,
+ options.high_priority_period,
+ 0,
+ ACE_ES_EVENT_UNDEFINED,
+ experiment_id,
+ high_priority_group.supplier (),
+ &the_barrier);
+ high_priority_task.thr_mgr (&my_thread_manager);
+ {
+ // Artificial scope to wait for the high priority task...
+ Task_Activator<Send_Task> high_priority_act (rt_class.priority_high (),
+ rt_class.thr_sched_class (),
+ 1,
+ &high_priority_task);
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - high priority task completed\n"));
+
+ low_priority_setup.stop_all_threads ();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - low priority task(s) stopped\n"));
+
+ ACE_Sample_History &history =
+ high_priority_group.consumer ()->sample_history ();
+ if (options.dump_history)
+ {
+ history.dump_samples ("HISTORY", gsf);
+ }
+
+ ACE_Basic_Stats high_priority_stats;
+ history.collect_basic_stats (high_priority_stats);
+ high_priority_stats.dump_results ("High Priority", gsf);
+
+ ACE_Basic_Stats low_priority_stats;
+ low_priority_setup.collect_basic_stats (low_priority_stats);
+ low_priority_stats.dump_results ("Low Priority", gsf);
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - starting cleanup\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_reactive.conf b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_reactive.conf
new file mode 100644
index 00000000000..3c107d1ba17
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_reactive.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECDispatching reactive"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_reactive.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_reactive.conf.xml
new file mode 100644
index 00000000000..f74abe683cf
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_reactive.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_reactive.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECDispatching reactive"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_rtcorba.conf b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_rtcorba.conf
new file mode 100644
index 00000000000..3a353fa3bf6
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_rtcorba.conf
@@ -0,0 +1,2 @@
+# $Id$
+static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBPriorityMapping continuous"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_rtcorba.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_rtcorba.conf.xml
new file mode 100644
index 00000000000..cad852179de
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_rtcorba.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_rtcorba.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="RT_ORB_Loader" params="-ORBSchedPolicy SCHED_FIFO -ORBPriorityMapping continuous"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_threaded.conf b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_threaded.conf
new file mode 100644
index 00000000000..3d04d8461d0
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_threaded.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECDispatching mt -ECDispatchingThreads 2"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_threaded.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_threaded.conf.xml
new file mode 100644
index 00000000000..2ad5c61621a
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_threaded.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Roundtrip/ec.dispatching_threaded.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECDispatching mt -ECDispatchingThreads 2"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_read.conf b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_read.conf
new file mode 100644
index 00000000000..49c7ad0b504
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_read.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:copy_on_read:list -ECProxyPushSupplierCollection mt:copy_on_read:list -ECSupplierFilter null"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_read.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_read.conf.xml
new file mode 100644
index 00000000000..72146ccc298
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_read.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_read.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection mt:copy_on_read:list -ECProxyPushSupplierCollection mt:copy_on_read:list -ECSupplierFilter null"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_write.conf b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_write.conf
new file mode 100644
index 00000000000..691efd9c506
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_write.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list -ECSupplierFilter null"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_write.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_write.conf.xml
new file mode 100644
index 00000000000..73a63bf5ba9
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_write.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_copy_on_write.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 -ECSupplierFilter null"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_delayed.conf b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_delayed.conf
new file mode 100644
index 00000000000..f49ae54a94a
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_delayed.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:delayed:list -ECProxyPushSupplierCollection mt:delayed:list -ECSupplierFilter null"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_delayed.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_delayed.conf.xml
new file mode 100644
index 00000000000..b2461181885
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_delayed.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_delayed.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection mt:delayed:list -ECProxyPushSupplierCollection mt:delayed:list -ECSupplierFilter null"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_immediate.conf b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_immediate.conf
new file mode 100644
index 00000000000..50aa86ff59a
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_immediate.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:immediate:list -ECProxyPushSupplierCollection mt:immediate:list -ECSupplierFilter null"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_immediate.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_immediate.conf.xml
new file mode 100644
index 00000000000..37ab7100c94
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_immediate.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Roundtrip/ec.locking_immediate.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection mt:immediate:list -ECProxyPushSupplierCollection mt:immediate:list -ECSupplierFilter null"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_null.conf b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_null.conf
new file mode 100644
index 00000000000..b187ff3ed6b
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_null.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECSupplierFilter null"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_null.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_null.conf.xml
new file mode 100644
index 00000000000..5d41dbe8e18
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_null.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_null.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECSupplierFilter null"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_per_supplier.conf b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_per_supplier.conf
new file mode 100644
index 00000000000..e578b42e926
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_per_supplier.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECSupplierFilter per-supplier"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_per_supplier.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_per_supplier.conf.xml
new file mode 100644
index 00000000000..81245d1f970
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_per_supplier.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Roundtrip/ec.supplier_filter_per_supplier.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECSupplierFilter per-supplier"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/parameters b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/parameters
new file mode 100644
index 00000000000..bc36f6531b7
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/parameters
@@ -0,0 +1,19 @@
+NTHREADS="16"
+
+NCONSUMERS="32 64 96 128 160 192 224 256 288 320 352 384 416 448 480 512"
+
+ITERATIONS=25000
+#ITERATIONS=3000
+
+LOCKING_TYPES="copy_on_read copy_on_write delayed"
+DISPATCHING_TYPES="threaded reactive rtcorba"
+FILTER_TYPES="null per_supplier"
+
+#IOR=/project/amras/coryan/IOR/roundtrip.ior
+IOR=test.ior
+
+#REMOTE_HOST=celegorm
+REMOTE_HOST=localhost
+
+#REMOTE_LOCATION=/project/celegorm/coryan/EC_Roundtrip
+REMOTE_LOCATION=$PWD
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/roundtrip.conf b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/roundtrip.conf
new file mode 100644
index 00000000000..b0e36ffb28b
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/roundtrip.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list"
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/roundtrip.conf.xml b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/roundtrip.conf.xml
new file mode 100644
index 00000000000..3c6656cc873
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/roundtrip.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/performance-tests/RTEvent/Roundtrip/roundtrip.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"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_dispatching.sh b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_dispatching.sh
new file mode 100755
index 00000000000..4414a4ebf64
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_dispatching.sh
@@ -0,0 +1,47 @@
+#! /bin/sh
+#
+# $Id$
+#
+
+LOW_PRIORITY="1 5 10 15 20 15 30 35 40 45 50"
+#" 60 70 80 90 100 110 120 130 140 150 160"
+
+#IOR=/project/amras/coryan/IOR/roundtrip.ior
+IOR=test.ior
+
+for c in $LOW_PRIORITY; do
+# date
+# echo reactive $c
+#
+# /bin/rm -f $IOR
+# ssh celegorm "cd /project/celegorm/coryan/EC_Roundtrip ; ./server -ORBSvcConf ec.dispatching_reactive.conf -o $IOR" >server.log 2>&1 </dev/null &
+# while [ ! -f $IOR ]; do
+# sleep 1
+# done
+# ./client -d -h 1000 -l 2000 -i 500 -n $c -k file://$IOR > ec_dispatching_reactive.$c.txt 2>&1
+# wait
+#
+# date
+# echo threaded $c
+#
+# /bin/rm -f $IOR
+# ssh celegorm "cd /project/celegorm/coryan/EC_Roundtrip ; ./server -ORBSvcConf ec.dispatching_threaded.conf -o $IOR" >server.log 2>&1 </dev/null &
+# while [ ! -f $IOR ]; do
+# sleep 1
+# done
+# ./client -d -h 1000 -l 2000 -i 500 -n $c -k file://$IOR > ec_dispatching_threaded.$c.txt 2>&1
+# wait
+
+ date
+ echo rtcorba $c
+
+ /bin/rm -f $IOR
+# ssh celegorm "cd /project/celegorm/coryan/EC_Roundtrip ; ./server -ORBSvcConf ec.dispatching_rtcorba.conf -r -o $IOR" >server.log 2>&1 </dev/null &
+ ./server -ORBSvcConf ec.dispatching_rtcorba.conf -r -o $IOR" >server.log 2>&1 </dev/null &
+ while [ ! -f $IOR ]; do
+ sleep 1
+ done
+ ./client -ORBSvcConf ec.dispatching_rtcorba.conf -r -d -h 1000 -l 2000 -i 500 -n $c -k file://$IOR > ec_dispatching_rtcorba.$c.txt 2>&1
+ wait
+
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_locking.sh b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_locking.sh
new file mode 100755
index 00000000000..c2a9855bbdf
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_locking.sh
@@ -0,0 +1,25 @@
+#! /bin/sh
+#
+# $Id$
+#
+
+. parameters
+
+for n in $NTHREADS; do
+ for c in $NCONSUMERS; do
+ for t in $LOCKING_TYPES; do
+ date
+ echo $t $c $n
+
+ /bin/rm -f $IOR
+# ssh $REMOTE_HOST "cd $REMOTE_LOCATION ; ./server -ORBSvcConf ec.locking_${t}.conf -r -o $IOR" >server.log 2>&1 </dev/null &
+ ./server -ORBSvcConf ec.locking_${t}.conf -o $IOR -n $n >server.log 2>&1 </dev/null &
+ while [ ! -f $IOR ]; do
+ sleep 1
+ done
+ ./client -d -u -h 10000 -l 10000 -i $ITERATIONS -c $c -n $n -k file://$IOR > ec_locking.${t}.$c.txt 2>&1
+
+ wait
+ done
+ done
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_roundtrip.sh b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_roundtrip.sh
new file mode 100755
index 00000000000..ca94f25d439
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/run_roundtrip.sh
@@ -0,0 +1,22 @@
+#! /bin/sh
+#
+# $Id$
+#
+
+. parameters
+
+for c in $NCONSUMERS; do
+
+ date
+ echo $t $c $n
+
+ /bin/rm -f $IOR
+# ssh $REMOTE_HOST "cd $REMOTE_LOCATION ; ./server -ORBSvcConf ec.locking_${t}.conf -r -o $IOR" >server.log 2>&1 </dev/null &
+ ./server -ORBSvcConf roundtrip.conf -o $IOR -n 4 >server.log 2>&1 </dev/null &
+ while [ ! -f $IOR ]; do
+ sleep 1
+ done
+ ./client -d -u -h 10000 -l 10000 -i $ITERATIONS -c $c -n 0 -k file://$IOR > ec_roundtrip.$c.txt 2>&1
+
+ wait
+done
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/server.cpp b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/server.cpp
new file mode 100644
index 00000000000..8c7d83af31a
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/server.cpp
@@ -0,0 +1,168 @@
+// $Id$
+
+#include "RT_Class.h"
+#include "ORB_Holder.h"
+#include "Servant_var.h"
+#include "RIR_Narrow.h"
+#include "RTEC_Initializer.h"
+#include "RTServer_Setup.h"
+#include "ORB_Task.h"
+#include "ORB_Task_Activator.h"
+
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/RTPortableServer/RTPortableServer.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "tao/Messaging/Messaging.h"
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+
+ACE_RCSID (TAO_PERF_RTEC_Roundtrip,
+ server,
+ "$Id$")
+
+const char *ior_output_file = "test.ior";
+int use_rt_corba = 0;
+int nthreads = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:n:r");
+ 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 'r':
+ use_rt_corba = 1;
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> "
+ "-r (use RT-CORBA) "
+ "-n nthreads "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int main (int argc, char *argv[])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ /// Move the test to the real-time class if it is possible.
+ RT_Class rt_class;
+
+ ACE_TRY_NEW_ENV
+ {
+ ORB_Holder orb (argc, argv, ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ RTServer_Setup rtserver_setup (use_rt_corba,
+ orb,
+ rt_class,
+ nthreads
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ RIR_Narrow<PortableServer::POA>::resolve (orb,
+ "RootPOA"
+ 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;
+
+ PortableServer::POA_var ec_poa (rtserver_setup.poa ());
+
+ ORB_Task orb_task (orb);
+ ORB_Task_Activator orb_task_activator (rt_class.priority_high (),
+ rt_class.thr_sched_class (),
+ nthreads,
+ &orb_task);
+
+ ACE_DEBUG ((LM_DEBUG, "Finished ORB and POA configuration\n"));
+
+ Servant_var<TAO_EC_Event_Channel> ec_impl (
+ RTEC_Initializer::create (ec_poa.in (),
+ ec_poa.in (),
+ rtserver_setup.rtcorba_setup ()
+ ACE_ENV_ARG_PARAMETER)
+ );
+ ACE_TRY_CHECK;
+
+ ec_impl->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::ObjectId_var ec_id =
+ ec_poa->activate_object (ec_impl.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::Object_var ec_object =
+ ec_poa->id_to_reference (ec_id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow (ec_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (ec.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", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ do {
+ ACE_Time_Value tv (1, 0);
+ orb->run (tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ } while (ec_impl->destroyed () == 0);
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - 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/performance-tests/RTEvent/TCP_Baseline/Makefile.am b/TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/Makefile.am
new file mode 100644
index 00000000000..ce147a0d92d
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/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_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.TCP_Baseline_Client.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+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 \
+ -I$(srcdir)/../lib
+
+client_SOURCES = \
+ client.cpp
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/performance-tests/RTEvent/lib/libTAO_RTEC_Perf.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTCORBAEvent.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_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTPortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.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_RT_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.TCP_Baseline_Server.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+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 \
+ -I$(srcdir)/../lib
+
+server_SOURCES = \
+ server.cpp
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/performance-tests/RTEvent/lib/libTAO_RTEC_Perf.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTCORBAEvent.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_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTPortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_RTCORBA.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.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_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/performance-tests/RTEvent/TCP_Baseline/TCP_Baseline.mpc b/TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/TCP_Baseline.mpc
new file mode 100644
index 00000000000..bded52788ee
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/TCP_Baseline.mpc
@@ -0,0 +1,30 @@
+// $Id$
+project(*server): orbsvcsexe, rtcorbaevent, strategies, minimum_corba {
+ after += RTEC_Perf
+ libs += TAO_RTEC_Perf
+
+ specific (automake) {
+ includes += $(srcdir)/../lib
+ } else {
+ includes += ../lib
+ }
+
+ Source_Files {
+ server.cpp
+ }
+}
+
+project(*client): orbsvcsexe, rtcorbaevent, strategies, minimum_corba {
+ after += RTEC_Perf
+ libs += TAO_RTEC_Perf
+
+ specific (automake) {
+ includes += $(srcdir)/../lib
+ } else {
+ includes += ../lib
+ }
+
+ Source_Files {
+ client.cpp
+ }
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/client.cpp b/TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/client.cpp
new file mode 100644
index 00000000000..8c36cbd0349
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/client.cpp
@@ -0,0 +1,318 @@
+// $Id$
+
+#include "RT_Class.h"
+#include "Client_Options.h"
+
+#include "ace/High_Res_Timer.h"
+#include "ace/Sample_History.h"
+#include "ace/Basic_Stats.h"
+#include "ace/Stats.h"
+#include "ace/SOCK_Stream.h"
+#include "ace/SOCK_Connector.h"
+#include "ace/Get_Opt.h"
+#include "ace/Task.h"
+#include "ace/Barrier.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (TAO_RTEC_PERF_TCP_Baseline,
+ client,
+ "$Id$")
+
+char const * hi_endpoint = "localhost:12345";
+char const * lo_endpoint = "localhost:23456";
+
+int
+parse_args (int argc, char *argv[]);
+
+class Scavenger_Task : public ACE_Task_Base
+{
+public:
+ Scavenger_Task (char const * endpoint,
+ ACE_Barrier * the_barrier,
+ int period_in_usecs);
+
+ void stop(void);
+
+ virtual int svc ();
+
+private:
+ char const * endpoint_;
+ ACE_Barrier * the_barrier_;
+ int period_in_usecs_;
+ ACE_SYNCH_MUTEX mutex_;
+ int stopped_;
+};
+
+class Measuring_Task : public ACE_Task_Base
+{
+public:
+ Measuring_Task (char const * endpoint,
+ ACE_Barrier *the_barrier,
+ int iterations,
+ int period_in_usecs);
+
+ virtual int svc();
+
+ ACE_Sample_History sample_history;
+
+private:
+ char const * endpoint_;
+ ACE_Barrier * the_barrier_;
+ int iterations_;
+ int period_in_usecs_;
+};
+
+int main (int argc, char *argv[])
+{
+ RT_Class rt_class;
+
+ Client_Options options (argc, argv);
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ 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));
+
+ int thread_count = 1 + options.nthreads;
+ ACE_Barrier the_barrier (thread_count);
+
+ int per_thread_period = options.low_priority_period;
+ if (options.global_low_priority_rate)
+ per_thread_period = options.low_priority_period * options.nthreads;
+
+ Scavenger_Task lo_task (lo_endpoint, &the_barrier,
+ per_thread_period);
+ lo_task.activate (rt_class.thr_sched_class () | THR_NEW_LWP | THR_JOINABLE,
+ options.nthreads, 1,
+ rt_class.priority_low ());
+
+ Measuring_Task hi_task (hi_endpoint, &the_barrier,
+ options.iterations,
+ options.high_priority_period);
+ hi_task.activate (rt_class.thr_sched_class () | THR_NEW_LWP | THR_JOINABLE,
+ 1, 1,
+ rt_class.priority_low ());
+
+ hi_task.wait ();
+ lo_task.stop ();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - high prio task joined\n"));
+
+ ACE_Sample_History &history = hi_task.sample_history;
+ if (options.dump_history)
+ {
+ history.dump_samples ("HISTORY", gsf);
+ }
+
+ ACE_Basic_Stats high_priority_stats;
+ history.collect_basic_stats (high_priority_stats);
+ high_priority_stats.dump_results ("High Priority", gsf);
+
+ lo_task.wait ();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - all task(s) joined\n"));
+
+ return 0;
+}
+
+// ****************************************************************
+
+Scavenger_Task::Scavenger_Task(char const * endpoint,
+ ACE_Barrier * the_barrier,
+ int period_in_usecs)
+ : endpoint_ (endpoint)
+ , the_barrier_ (the_barrier)
+ , period_in_usecs_ (period_in_usecs)
+ , mutex_ ()
+ , stopped_ (0)
+{
+}
+
+void
+Scavenger_Task::stop(void)
+{
+ ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_);
+ this->stopped_ = 1;
+}
+
+int
+Scavenger_Task::svc(void)
+{
+ this->the_barrier_->wait ();
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Starting scavenger thread\n"));
+
+ ACE_SOCK_Stream stream;
+ {
+ ACE_INET_Addr remote_sap (this->endpoint_);
+ ACE_SOCK_Connector connector;
+
+ if (connector.connect(stream, remote_sap) == -1)
+ {
+ ACE_ERROR((LM_ERROR, "Cannot connect to <%s>\n", endpoint_));
+ return -1;
+ }
+ }
+
+ for (;;)
+ {
+ ACE_Time_Value period (0, this->period_in_usecs_);
+ ACE_OS::sleep (period);
+
+ {
+ ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->mutex_, -1);
+ if (this->stopped_)
+ break;
+ }
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+ ssize_t n = stream.send_n(&start, sizeof(start));
+ if (n == 0 || n == -1)
+ break;
+
+ ACE_hrtime_t end;
+ n = stream.recv(&end, sizeof(end));
+ if (n == 0 || n == -1)
+ break;
+
+ if (start != end)
+ {
+ ACE_ERROR((LM_ERROR,
+ "Mismatched response from <%s>\n", endpoint_));
+ break;
+ }
+
+ }
+ stream.close();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Finishing scavenger thread\n"));
+ return 0;
+}
+
+// ****************************************************************
+
+Measuring_Task::Measuring_Task (char const * endpoint,
+ ACE_Barrier * the_barrier,
+ int iterations,
+ int period_in_usecs)
+ : sample_history (iterations)
+ , endpoint_(endpoint)
+ , the_barrier_(the_barrier)
+ , iterations_ (iterations)
+ , period_in_usecs_ (period_in_usecs)
+{
+}
+
+int
+Measuring_Task::svc ()
+{
+ this->the_barrier_->wait ();
+
+ ACE_SOCK_Stream stream;
+ {
+ ACE_INET_Addr remote_sap (this->endpoint_);
+ ACE_SOCK_Connector connector;
+
+ if (connector.connect(stream, remote_sap) == -1)
+ {
+ ACE_ERROR((LM_ERROR, "Cannot connect to <%s>\n", endpoint_));
+ return -1;
+ }
+ }
+
+ for (int i = 0; i != this->iterations_; ++i)
+ {
+ ACE_Time_Value period (0, this->period_in_usecs_);
+ ACE_OS::sleep (period);
+
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+ ssize_t n = stream.send_n(&start, sizeof(start));
+ if (n == 0) {
+ ACE_ERROR((LM_ERROR,
+ "Connection closed while writing data to server <%s>\n",
+ endpoint_, ""));
+ break;
+ } else if (n == -1) {
+ ACE_ERROR((LM_ERROR,
+ "Error writing data to server <%s> %p\n",
+ endpoint_, ""));
+ break;
+ }
+ if (n == 0 || n == -1)
+ {
+ ACE_ERROR((LM_ERROR,
+ "Error sending data to server <%s>\n", endpoint_));
+ break;
+ }
+
+ ACE_hrtime_t end;
+ n = stream.recv_n(&end, sizeof(end));
+ if (n == 0) {
+ ACE_ERROR((LM_ERROR,
+ "Connection closed while reading data from server <%s>\n",
+ endpoint_, ""));
+ break;
+ } else if (n == -1) {
+ ACE_ERROR((LM_ERROR,
+ "Error reading data from server <%s> %p\n",
+ endpoint_, ""));
+ break;
+ }
+
+ if (start != end)
+ {
+ ACE_ERROR((LM_ERROR,
+ "Mismatched response from <%s>\n", endpoint_));
+ return -1;
+ }
+ ACE_hrtime_t elapsed = ACE_OS::gethrtime () - start;
+
+ this->sample_history.sample (elapsed);
+ }
+
+ stream.close();
+
+ return 0;
+}
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "H:L:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'H':
+ hi_endpoint = get_opts.opt_arg ();
+ break;
+
+ case 'L':
+ lo_endpoint = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-i iterations (iterations) "
+ "-h high_priority_period (usecs) "
+ "-l low_priority_period (usecs) "
+ "-w high_priority_workload (usecs) "
+ "-v low_priority_workload (usecs) "
+ "-r (enable RT-CORBA) "
+ "-n nthreads (low priority thread) "
+ "-d (dump history) "
+ "-z (disable low priority) "
+ "-H hi_endpoint "
+ "-L lo_endpoint "
+ "\n",
+ argv [0]),
+ 1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/server.cpp b/TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/server.cpp
new file mode 100644
index 00000000000..dcbfac08567
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/TCP_Baseline/server.cpp
@@ -0,0 +1,203 @@
+// $Id$
+
+#include "RT_Class.h"
+
+#include "ace/Task.h"
+#include "ace/SOCK_Acceptor.h"
+#include "ace/SOCK_Stream.h"
+#include "ace/Acceptor.h"
+#include "ace/Svc_Handler.h"
+#include "ace/Reactor.h"
+#include "ace/TP_Reactor.h"
+#include "ace/Get_Opt.h"
+
+ACE_RCSID (TAO_PERF_RTEC_TCP_Baseline,
+ server,
+ "$Id$")
+
+int use_rt = 0;
+int nthreads = 1;
+char const * hi_endpoint = "localhost:12345";
+char const * lo_endpoint = "localhost:23456";
+
+int
+parse_args (int argc, char *argv[]);
+
+class Task : public ACE_Task_Base
+{
+public:
+ Task(char const * endpoint);
+
+ virtual int svc();
+
+private:
+ char const * endpoint_;
+
+ ACE_Reactor reactor_;
+};
+
+int main (int argc, char *argv[])
+{
+ /// Move the test to the real-time class if it is possible.
+ RT_Class rt_class;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Task hi_task(hi_endpoint);
+ Task lo_task(lo_endpoint);
+
+ hi_task.activate(rt_class.thr_sched_class() | THR_NEW_LWP | THR_JOINABLE,
+ 1, 1, rt_class.priority_high());
+
+ lo_task.activate(rt_class.thr_sched_class() | THR_NEW_LWP | THR_JOINABLE,
+ nthreads, 1, rt_class.priority_low());
+ lo_task.wait();
+
+ hi_task.wait();
+
+ return 0;
+}
+
+// ****************************************************************
+
+class Svc_Handler : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_SYNCH>
+{
+public:
+ Svc_Handler(ACE_Reactor * reactor = 0);
+
+ virtual int handle_input(ACE_HANDLE);
+ virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask);
+};
+
+typedef ACE_Acceptor<Svc_Handler,ACE_SOCK_ACCEPTOR> Acceptor;
+
+Svc_Handler::Svc_Handler (ACE_Reactor * reactor)
+ : ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_SYNCH> (0, 0, reactor)
+{
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Accepted connection\n"));
+}
+
+int
+Svc_Handler::handle_input(ACE_HANDLE h)
+{
+ const size_t bufsize = BUFSIZ;
+ char buf[bufsize];
+
+ while(1)
+ {
+ ssize_t n = this->peer().recv(buf, bufsize);
+ if (n == 0) {
+ ACE_ERROR((LM_ERROR,
+ "Connection %d closed while reading data\n",
+ h, ""));
+ break;
+ } else if (n == -1) {
+ if(errno == EWOULDBLOCK)
+ return 0;
+
+ ACE_ERROR((LM_ERROR,
+ "Error on <%d> while reading %p\n",
+ h, ""));
+ break;
+ }
+
+ ssize_t k = this->peer().send(buf, n);
+ if(k == 0) {
+ ACE_ERROR((LM_ERROR,
+ "Connection <%d> closed while writing\n",
+ h, ""));
+ break;
+ } else if (k == -1) {
+ if(errno == EWOULDBLOCK)
+ return 0;
+
+ ACE_ERROR((LM_ERROR,
+ "Error on <%d> while writing %p\n",
+ h, ""));
+ break;
+ } else if (k != n) {
+ ACE_ERROR((LM_ERROR,
+ "Short write on <%d>\n",
+ h, ""));
+ break;
+ }
+ }
+
+ return -1;
+}
+
+int
+Svc_Handler::handle_close(ACE_HANDLE h, ACE_Reactor_Mask m)
+{
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Closed connection\n"));
+ this->peer().close();
+ int r =
+ this->ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_SYNCH>::handle_close (h,m);
+ return r;
+}
+
+// ****************************************************************
+
+Task::Task(char const * endpoint)
+ : endpoint_(endpoint)
+ , reactor_(new ACE_TP_Reactor)
+{
+ ACE_INET_Addr local_sap(endpoint_);
+ Acceptor * acceptor = new Acceptor;
+
+ if(acceptor->open(local_sap, &reactor_, ACE_NONBLOCK) == -1)
+ {
+ ACE_ERROR((LM_ERROR, "Cannot open endpoint <%s>\n", endpoint_));
+ }
+}
+
+int
+Task::svc()
+{
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Starting thread for %s\n", endpoint_));
+ (void) reactor_.run_reactor_event_loop();
+ return 0;
+}
+
+// ****************************************************************
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "h:l:n:r");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'h':
+ hi_endpoint = get_opts.opt_arg ();
+ break;
+
+ case 'l':
+ lo_endpoint = get_opts.opt_arg ();
+ break;
+
+ case 'n':
+ nthreads = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'r':
+ use_rt = 1;
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> "
+ "-r (use RT-CORBA) "
+ "-n nthreads "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.cpp
new file mode 100644
index 00000000000..5acd660e5c4
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.cpp
@@ -0,0 +1,24 @@
+/**
+ * @file Auto_Disconnect.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+#ifndef TAO_PERF_RTEC_AUTO_DISCONNECT_CPP
+#define TAO_PERF_RTEC_AUTO_DISCONNECT_CPP
+
+#include "Auto_Disconnect.h"
+
+#if !defined(__ACE_INLINE__)
+#include "Auto_Disconnect.inl"
+#endif /* __ACE_INLINE__ */
+
+template<class Client> Auto_Disconnect<Client>&
+Auto_Disconnect<Client>::operator= (Client *client)
+{
+ this->reset(client);
+ return *this;
+}
+
+#endif /* TAO_PERF_RTEC_AUTO_DISCONNECT_CPP */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.h
new file mode 100644
index 00000000000..6cb1a65d988
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.h
@@ -0,0 +1,54 @@
+/**
+ * @file Auto_Disconnect.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+#ifndef TAO_PERF_RTEC_AUTO_DISCONNECT_H
+#define TAO_PERF_RTEC_AUTO_DISCONNECT_H
+
+#include "tao/corba.h"
+#include "ace/Auto_Functor.h"
+
+/**
+ * @class Disconnect
+ *
+ * @brief Helper functor to call the disconnect() method of a class.
+ */
+template<class Client>
+class Disconnect
+{
+public:
+ void operator() (Client *client);
+};
+
+/**
+ * @class Auto_Disconnect
+ *
+ * @brief Automatically invoke the disconnect() operation on some
+ * RTEC client.
+ */
+template<class Client>
+class Auto_Disconnect : public ACE_Utils::Auto_Functor<Client,Disconnect<Client> >
+{
+public:
+ /// Constructor
+ /**
+ * @param client The client
+ */
+ explicit Auto_Disconnect (Client *s = 0);
+
+ /// Assignment operator
+ Auto_Disconnect<Client>& operator= (Client *client);
+};
+
+#if defined(__ACE_INLINE__)
+#include "Auto_Disconnect.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "Auto_Disconnect.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#endif /* TAO_PERF_RTEC_AUTO_DISCONNECT_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.inl
new file mode 100644
index 00000000000..3a09d5c68cf
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.inl
@@ -0,0 +1,27 @@
+/**
+ * @file Auto_Disconnect.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+#include "ace/CORBA_macros.h"
+
+template<class Client> ACE_INLINE void
+Disconnect<Client>::operator () (Client *client)
+{
+ ACE_DECLARE_NEW_ENV;
+ ACE_TRY
+ {
+ client->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY { };
+ ACE_ENDTRY;
+}
+
+template<class Client> ACE_INLINE
+Auto_Disconnect<Client>::Auto_Disconnect (Client *client)
+ : ACE_Utils::Auto_Functor<Client,Disconnect<Client> > (client)
+{
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Group.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Group.cpp
new file mode 100644
index 00000000000..7daaf4ae6b4
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Group.cpp
@@ -0,0 +1,76 @@
+/**
+ * @file Client_Group.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "Client_Group.h"
+#include "Auto_Disconnect.h"
+
+#if !defined(__ACE_INLINE__)
+#include "Client_Group.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ Client_Group,
+ "$Id$")
+
+void
+Client_Group::init (CORBA::Long experiment_id,
+ CORBA::Long base_event_type,
+ CORBA::ULong iterations,
+ CORBA::Long workload_in_usecs,
+ ACE_UINT32 gsf,
+ PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa)
+{
+ this->init (experiment_id, base_event_type, 1,
+ iterations, workload_in_usecs, gsf,
+ supplier_poa, consumer_poa);
+}
+
+void
+Client_Group::init (CORBA::Long experiment_id,
+ CORBA::Long base_event_type,
+ CORBA::Long event_type_range,
+ CORBA::ULong iterations,
+ CORBA::Long workload_in_usecs,
+ ACE_UINT32 gsf,
+ PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa)
+{
+ this->client_pair_.init (experiment_id,
+ base_event_type,
+ event_type_range,
+ iterations,
+ workload_in_usecs,
+ gsf,
+ supplier_poa,
+ consumer_poa);
+ this->loopback_pair_.init (experiment_id, base_event_type,
+ supplier_poa, consumer_poa);
+}
+
+void
+Client_Group::connect (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ this->client_pair_.connect (ec ACE_ENV_ARG_PARAMETER);
+ Auto_Disconnect<Client_Pair> client_pair_disconnect (&this->client_pair_);
+
+ this->loopback_pair_.connect (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ Auto_Disconnect<Loopback_Pair> loopback_pair_disconnect (&this->loopback_pair_);
+
+ loopback_pair_disconnect.release ();
+ client_pair_disconnect.release ();
+}
+
+void
+Client_Group::disconnect (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ Auto_Disconnect<Client_Pair> client_pair_disconnect (&this->client_pair_);
+ Auto_Disconnect<Loopback_Pair> loopback_pair_disconnect (&this->loopback_pair_);
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Group.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Group.h
new file mode 100644
index 00000000000..ef93ba153c1
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Group.h
@@ -0,0 +1,101 @@
+/**
+ * @file Client_Group.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_CLIENT_GROUP_H
+#define TAO_PERF_RTEC_CLIENT_GROUP_H
+
+#include "Servant_var.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "Client_Pair.h"
+#include "Loopback_Pair.h"
+
+/**
+ * @class Client_Group
+ *
+ * @brief Simplify the initialization of a Supplier/Consumer pair
+ * connected through a Loopback.
+ */
+class TAO_RTEC_Perf_Export Client_Group
+{
+public:
+ /// Constructor
+ /**
+ * We need a default constructor because this class is often used in
+ * arrays.
+ */
+ Client_Group (void);
+
+ /// Initialize the consumer/supplier pair(s)
+ /**
+ * @param experiment_id For tests that run multiple experiments
+ * this number is changed on each iteration, guaranteeing
+ * better isolation.
+ * @param base_event_type The event type generated by the supplier.
+ * The Loopback_Consumer consumes the same event, the
+ * Loopback_Supplier generates (base_event_type + 1), and the
+ * consumer subscribes for that type too.
+ * @param iterations The number of iterations expected on the test.
+ * @param workload_in_usecs The consumer workload, in microseconds.
+ * @param gsf The high resolution timer global scale factor.
+ *
+ */
+ void init (CORBA::Long experiment_id,
+ CORBA::Long base_event_type,
+ CORBA::ULong iterations,
+ CORBA::Long workload_in_usecs,
+ ACE_UINT32 gsf,
+ PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa);
+
+ /// Initialize the consumer/supplier pair(s)
+ /**
+ * @param event_type_range The supplier declares more events than it
+ * generates.
+ */
+ void init (CORBA::Long experiment_id,
+ CORBA::Long base_event_type,
+ CORBA::Long base_event_type_range,
+ CORBA::ULong iterations,
+ CORBA::Long workload_in_usecs,
+ ACE_UINT32 gsf,
+ PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa);
+
+ /// Connect to the event channel
+ void connect (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+
+ /// Disconnect from the event channel
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ //@{
+ /** @name Accessors
+ */
+ Supplier *supplier (void) const;
+
+ Consumer *consumer (void) const;
+
+ Loopback_Supplier *loopback_supplier (void) const;
+
+ Loopback_Consumer *loopback_consumer (void) const;
+ //@}
+
+private:
+ Client_Pair client_pair_;
+ Loopback_Pair loopback_pair_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "Client_Group.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_PERF_RTEC_CLIENT_GROUP_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Group.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Group.inl
new file mode 100644
index 00000000000..b0ae0d1ce35
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Group.inl
@@ -0,0 +1,36 @@
+/**
+ * @file Client_Group.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+ACE_INLINE
+Client_Group::Client_Group (void)
+{
+}
+
+ACE_INLINE Supplier *
+Client_Group::supplier (void) const
+{
+ return this->client_pair_.supplier ();
+}
+
+ACE_INLINE Consumer *
+Client_Group::consumer (void) const
+{
+ return this->client_pair_.consumer ();
+}
+
+ACE_INLINE Loopback_Supplier *
+Client_Group::loopback_supplier (void) const
+{
+ return this->loopback_pair_.loopback_supplier ();
+}
+
+ACE_INLINE Loopback_Consumer *
+Client_Group::loopback_consumer (void) const
+{
+ return this->loopback_pair_.loopback_consumer ();
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Options.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Options.cpp
new file mode 100644
index 00000000000..c8e69760669
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Options.cpp
@@ -0,0 +1,104 @@
+/**
+ * @file Client_Options.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "Client_Options.h"
+
+#include "ace/Log_Msg.h"
+#include "ace/OS.h"
+
+ACE_RCSID (TAO_PERF_RTEC,
+ Client_Options,
+ "$Id$")
+
+Client_Options::Client_Options (int &argc, char *argv[])
+ : ior ("file://test.ior")
+ , iterations (1000)
+ , nthreads (0)
+ , high_priority_period (0)
+ , high_priority_workload (0)
+ , low_priority_period (0)
+ , low_priority_workload (0)
+ , low_priority_consumers (0)
+ , dump_history (0)
+ , use_rt_corba (0)
+ , global_low_priority_rate (0)
+ , unique_low_priority_event (0)
+ , funky_supplier_publication (0)
+ , high_priority_is_last (0)
+{
+ 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, "-k") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->ior = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (option (arg_shifter, "-i", iterations)) {}
+ else if (option (arg_shifter, "-n", nthreads)) {}
+ else if (option (arg_shifter, "-h", high_priority_period)) {}
+ else if (option (arg_shifter, "-l", low_priority_period)) {}
+ else if (option (arg_shifter, "-w", low_priority_workload)) {}
+ else if (option (arg_shifter, "-v", high_priority_workload)) {}
+ else if (option (arg_shifter, "-c", low_priority_consumers)) {}
+
+ else if (boolean_option (arg_shifter, "-d", dump_history)) {}
+ else if (boolean_option (arg_shifter, "-r", use_rt_corba)) {}
+ else if (boolean_option (arg_shifter, "-g", global_low_priority_rate)) {}
+ else if (boolean_option (arg_shifter, "-u", unique_low_priority_event)) {}
+ else if (boolean_option (arg_shifter, "-f", funky_supplier_publication)) {}
+ else if (boolean_option (arg_shifter, "-x", high_priority_is_last)) {}
+
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+}
+
+int
+Client_Options::option (ACE_Arg_Shifter &arg_shifter,
+ const char *option_name,
+ int &option_value)
+{
+ if (ACE_OS::strcmp (arg_shifter.get_current (), option_name) != 0)
+ return 0;
+ arg_shifter.consume_arg ();
+ if (arg_shifter.is_parameter_next ())
+ {
+ option_value = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Missing value for option '%s'\n", option_name));
+ }
+ return 1;
+}
+
+int
+Client_Options::boolean_option (ACE_Arg_Shifter &arg_shifter,
+ const char *option_name,
+ int &option_value)
+{
+ if (ACE_OS::strcmp (arg_shifter.get_current (), option_name) != 0)
+ return 0;
+ arg_shifter.consume_arg ();
+ option_value = 1;
+ return 1;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Options.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Options.h
new file mode 100644
index 00000000000..8d12ab4fafc
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Options.h
@@ -0,0 +1,60 @@
+/**
+ * @file Client_Options.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ *
+ */
+
+#ifndef TAO_RTEC_PERF_CLIENT_OPTIONS_H
+#define TAO_RTEC_PERF_CLIENT_OPTIONS_H
+#include /**/ "ace/pre.h"
+
+#include "rtec_perf_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Arg_Shifter.h"
+
+/// Parse the command-line client_options for the tests.
+/**
+ * Note that some of the tests ignore some of the client_options, but it is
+ * easier to have them all in a single class.
+ */
+class TAO_RTEC_Perf_Export Client_Options
+{
+public:
+ /// Constructor
+ Client_Options (int &argc, char *argv[]);
+
+ const char *ior;
+ int iterations;
+ int nthreads;
+ int high_priority_period;
+ int high_priority_workload;
+ int low_priority_period;
+ int low_priority_workload;
+ int low_priority_consumers;
+
+ int dump_history;
+ int use_rt_corba;
+ int global_low_priority_rate;
+ int unique_low_priority_event;
+ int funky_supplier_publication;
+ int high_priority_is_last;
+
+private:
+ int option (ACE_Arg_Shifter &arg_shifter,
+ const char *option_name,
+ int &option_value);
+
+ int boolean_option (ACE_Arg_Shifter &arg_shifter,
+ const char *option_name,
+ int &option_value);
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_RTEC_PERF_CLIENT_OPTIONS_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Pair.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Pair.cpp
new file mode 100644
index 00000000000..9f32c911ff2
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Pair.cpp
@@ -0,0 +1,82 @@
+/**
+ * @file Client_Pair.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "Client_Pair.h"
+#include "Auto_Disconnect.h"
+
+#if !defined(__ACE_INLINE__)
+#include "Client_Pair.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ Client_Pair,
+ "$Id$")
+
+void
+Client_Pair::init (CORBA::Long experiment_id,
+ CORBA::Long base_event_type,
+ CORBA::ULong iterations,
+ CORBA::Long workload_in_usecs,
+ ACE_UINT32 gsf,
+ PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa)
+{
+ const CORBA::Long source_event_range = 1;
+ this->init (experiment_id,
+ base_event_type,
+ source_event_range,
+ iterations,
+ workload_in_usecs,
+ gsf,
+ supplier_poa,
+ consumer_poa);
+}
+
+void
+Client_Pair::init (CORBA::Long experiment_id,
+ CORBA::Long base_event_type,
+ CORBA::Long source_event_range,
+ CORBA::ULong iterations,
+ CORBA::Long workload_in_usecs,
+ ACE_UINT32 gsf,
+ PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa)
+{
+ this->supplier_ = new Supplier (experiment_id,
+ base_event_type, source_event_range,
+ supplier_poa);
+ this->consumer_ = new Consumer (experiment_id,
+ base_event_type + 1,
+ iterations,
+ workload_in_usecs,
+ gsf,
+ consumer_poa);
+}
+
+void
+Client_Pair::connect (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_->connect (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ Auto_Disconnect<Supplier> supplier_disconnect (this->supplier_);
+
+ this->consumer_->connect (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ Auto_Disconnect<Consumer> consumer_disconnect (this->consumer_);
+
+ consumer_disconnect.release ();
+ supplier_disconnect.release ();
+}
+
+void
+Client_Pair::disconnect (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ Auto_Disconnect<Supplier> supplier_disconnect (this->supplier_);
+ Auto_Disconnect<Consumer> consumer_disconnect (this->consumer_);
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Pair.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Pair.h
new file mode 100644
index 00000000000..8dc4e8b03b2
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Pair.h
@@ -0,0 +1,100 @@
+/**
+ * @file Client_Pair.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_CLIENT_PAIR_H
+#define TAO_PERF_RTEC_CLIENT_PAIR_H
+
+#include "Servant_var.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "Consumer.h"
+#include "Supplier.h"
+
+/**
+ * @class Client_Pair
+ *
+ * @brief Simplify the initialization of a Supplier/Consumer pair
+ * connected to the event channel.
+ */
+class TAO_RTEC_Perf_Export Client_Pair
+{
+public:
+ /// Constructor
+ /**
+ * We need a default constructor because this class is often used in
+ * arrays.
+ */
+ Client_Pair (void);
+
+ /// Initialize the consumer/supplier pair
+ /**
+ * @param experiment_id For tests that run multiple experiments
+ * this number is changed on each iteration, guaranteeing
+ * better isolation.
+ * @param base_event_type The event type generated by the supplier.
+ * The Loopback_Consumer consumes the same event, the
+ * Loopback_Supplier generates (base_event_type + 1), and the
+ * consumer subscribes for that type too.
+ * @param iterations The number of iterations expected on the test.
+ * @param workload_in_usecs The consumer workload, in microseconds.
+ * @param gsf The high resolution timer global scale factor.
+ *
+ */
+ void init (CORBA::Long experiment_id,
+ CORBA::Long base_event_type,
+ CORBA::ULong iterations,
+ CORBA::Long workload_in_usecs,
+ ACE_UINT32 gsf,
+ PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa);
+
+ /// Initialize the consumer/supplier pair
+ /**
+ * This variant works as the previous one, but it allows for
+ * multiple events in the supplier-side.
+ *
+ * @param source_event_range The number of events declared by the
+ * source.
+ */
+ void init (CORBA::Long experiment_id,
+ CORBA::Long base_event_type,
+ CORBA::Long source_event_range,
+ CORBA::ULong iterations,
+ CORBA::Long workload_in_usecs,
+ ACE_UINT32 gsf,
+ PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa);
+
+ /// Connect to the event channel
+ void connect (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+
+ /// Disconnect from the event channel
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ //@{
+ /** @name Accessors
+ */
+ Supplier *supplier (void) const;
+
+ Consumer *consumer (void) const;
+ //@}
+
+private:
+ Servant_var<Supplier> supplier_;
+ Servant_var<Consumer> consumer_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "Client_Pair.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_PERF_RTEC_CLIENT_PAIR_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Pair.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Pair.inl
new file mode 100644
index 00000000000..a4c0f7cabb7
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Client_Pair.inl
@@ -0,0 +1,24 @@
+/**
+ * @file Client_Pair.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+ACE_INLINE
+Client_Pair::Client_Pair (void)
+{
+}
+
+ACE_INLINE Supplier *
+Client_Pair::supplier (void) const
+{
+ return this->supplier_.in ();
+}
+
+ACE_INLINE Consumer *
+Client_Pair::consumer (void) const
+{
+ return this->consumer_.in ();
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Consumer.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Consumer.cpp
new file mode 100644
index 00000000000..5fc7489897e
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Consumer.cpp
@@ -0,0 +1,141 @@
+/**
+ * @file Consumer.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "Consumer.h"
+#include "Implicit_Deactivator.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (TAO_PERF_RTEC,
+ Consumer,
+ "$Id$")
+
+Consumer::Consumer (CORBA::Long experiment_id,
+ CORBA::Long event_type,
+ CORBA::ULong iterations,
+ CORBA::Long workload_in_usecs,
+ ACE_UINT32 gsf,
+ PortableServer::POA_ptr poa)
+ : experiment_id_ (experiment_id)
+ , event_type_ (event_type)
+ , sample_history_ (iterations)
+ , workload_in_usecs_ (workload_in_usecs)
+ , gsf_ (gsf)
+ , default_POA_ (PortableServer::POA::_duplicate (poa))
+{
+}
+
+void
+Consumer::connect (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (!CORBA::is_nil (this->proxy_supplier_.in ()))
+ return;
+
+ this->proxy_supplier_ =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ RtecEventComm::PushConsumer_var consumer =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::ConsumerQOS consumer_qos;
+ consumer_qos.is_gateway = 0;
+ 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 = this->event_type_;
+ h1.source = this->experiment_id_;
+
+ this->proxy_supplier_->connect_push_consumer (consumer.in (),
+ consumer_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RtecEventChannelAdmin::ProxyPushSupplier_var proxy;
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (CORBA::is_nil (this->proxy_supplier_.in ()))
+ return;
+ proxy = this->proxy_supplier_._retn ();
+ }
+
+ Implicit_Deactivator deactivator (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TRY {
+ proxy->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ } ACE_CATCHANY {
+ } ACE_ENDTRY;
+}
+
+ACE_Sample_History &
+Consumer::sample_history (void)
+{
+ return this->sample_history_;
+}
+
+void
+Consumer::push (const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+
+ ACE_hrtime_t creation;
+ ORBSVCS_Time::TimeT_to_hrtime (creation,
+ events[0].header.creation_time);
+
+ while (this->workload_in_usecs_ > 0)
+ {
+ ACE_hrtime_t elapsed = ACE_OS::gethrtime () - now;
+ if (elapsed > this->gsf_ * this->workload_in_usecs_)
+ break;
+ ACE_OS::sleep (0);
+ }
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (sample_history_.max_samples () == sample_history_.sample_count ())
+ return;
+ this->sample_history_.sample (now - creation);
+}
+
+void
+Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ this->proxy_supplier_ =
+ RtecEventChannelAdmin::ProxyPushSupplier::_nil ();
+}
+
+PortableServer::POA_ptr
+Consumer::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Consumer.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Consumer.h
new file mode 100644
index 00000000000..f9206fe4ba2
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Consumer.h
@@ -0,0 +1,88 @@
+/**
+ * @file Consumer.h
+ *
+ * $Id$
+ *
+ */
+
+#ifndef TAO_PERF_RTEC_CONSUMER_H
+#define TAO_PERF_RTEC_CONSUMER_H
+
+#include "rtec_perf_export.h"
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+
+#include "ace/Sample_History.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Consumer
+ *
+ * @brief Implement a simple consumer to keep track of the latency
+ *
+ */
+class TAO_RTEC_Perf_Export Consumer
+ : public virtual POA_RtecEventComm::PushConsumer
+
+{
+public:
+ /// Constructor
+ Consumer (CORBA::Long experiment_id,
+ CORBA::Long event_type,
+ CORBA::ULong iterations,
+ CORBA::Long workload_in_usecs,
+ ACE_UINT32 gsf,
+ PortableServer::POA_ptr poa);
+
+ /// Connect to the event channel
+ void connect (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+
+ /// Disconnect from the event channel
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Access the history of samples
+ ACE_Sample_History &sample_history (void);
+
+ //@{
+ /** @name 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));
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+private:
+ /// Synchronize access to the internal data
+ TAO_SYNCH_MUTEX mutex_;
+
+ /// The proxy this object is connected to
+ RtecEventChannelAdmin::ProxyPushSupplier_var proxy_supplier_;
+
+ /// The experiment id
+ CORBA::Long experiment_id_;
+
+ /// The event type
+ CORBA::Long event_type_;
+
+ /// The history of latency samples
+ ACE_Sample_History sample_history_;
+
+ /// The time spent processing each event, in microseconds
+ CORBA::ULong workload_in_usecs_;
+
+ /// The global scale factor for the high resolution timers
+ ACE_UINT32 gsf_;
+
+ /// The default poa
+ PortableServer::POA_var default_POA_;
+};
+
+#endif /* TAO_PERF_RTEC_CONSUMER_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Control.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Control.cpp
new file mode 100644
index 00000000000..b35d809551c
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Control.cpp
@@ -0,0 +1,179 @@
+/**
+ * @file Control.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "Control.h"
+#include "ORB_Shutdown.h"
+#include "Shutdown.h"
+#include "Auto_Disconnect.h"
+
+#include "orbsvcs/Event_Service_Constants.h"
+
+#include "ace/High_Res_Timer.h"
+#include "ace/Sample_History.h"
+#include "ace/Basic_Stats.h"
+#include "ace/Auto_Ptr.h"
+
+ACE_RCSID (TAO_RTEC_Perf,
+ Control,
+ "$Id$")
+
+Control::Control (size_t peers_expected,
+ size_t iterations,
+ int do_dump_history,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa)
+ : peers_expected_ (peers_expected)
+ , iterations_ (iterations)
+ , do_dump_history_ (do_dump_history)
+ , orb_ (CORBA::ORB::_duplicate (orb))
+ , poa_ (PortableServer::POA::_duplicate (poa))
+ , peers_count_ (0)
+ , peers_ (new Federated_Test::Peer_var[this->peers_expected_])
+{
+}
+
+Control::~Control (void)
+{
+ delete[] this->peers_;
+}
+
+void
+Control::join (Federated_Test::Peer_ptr peer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (this->peers_count_ == this->peers_expected_)
+ return;
+
+ this->peers_[this->peers_count_++] =
+ Federated_Test::Peer::_duplicate (peer);
+
+ if (this->peers_count_ < this->peers_expected_)
+ return;
+ }
+
+ /// Automatically shutdown the ORB
+ ACE_Utils::Auto_Functor<CORBA::ORB,ORB_Shutdown> orb_shutdown (this->orb_.in ());
+
+ /// Automatically shutdown the peers
+ typedef ACE_Utils::Auto_Functor<Federated_Test::Peer,Shutdown<Federated_Test::Peer> > Peer_Shutdown;
+ ACE_Auto_Basic_Array_Ptr<Peer_Shutdown> peer_shutdown (
+ new Peer_Shutdown[this->peers_count_]
+ );
+
+ size_t i;
+ for (i = 0; i != this->peers_count_; ++i)
+ {
+ peer_shutdown[i].reset(this->peers_[i].in());
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Control (%P|%t) Building the federation\n"));
+
+ /// Build the EC federation
+ for (i = 0; i != this->peers_count_; ++i)
+ {
+ for (size_t j = 0; j != this->peers_count_; ++j)
+ {
+ if (i != j)
+ {
+ this->peers_[j]->connect (this->peers_[i].in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ }
+
+ /// ... run the test(s) ...
+ for (i = 0; i != this->peers_count_; ++i)
+ {
+ /// ... automatically release the object references ...
+ ACE_Auto_Basic_Array_Ptr<Federated_Test::Loopback_var> loopbacks (
+ new Federated_Test::Loopback_var[2*this->peers_count_]
+ );
+
+ /// ... and automatically disconnect the loopbacks ...
+ typedef Auto_Disconnect<Federated_Test::Loopback> Loopback_Disconnect;
+ ACE_Auto_Basic_Array_Ptr<auto_ptr<Loopback_Disconnect> > disconnects (
+ new auto_ptr<Loopback_Disconnect>[2*this->peers_count_]
+ );
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Control (%P|%t) Running test for peer %d\n",
+ i));
+ CORBA::Long experiment_id = 128 + i;
+ CORBA::Long base_event_type = ACE_ES_EVENT_UNDEFINED;
+
+ size_t lcount = 0;
+
+ size_t j;
+ for (j = 0; j != this->peers_count_; ++j)
+ {
+ if (j != i)
+ {
+ loopbacks[lcount] =
+ this->peers_[j]->setup_loopback (experiment_id,
+ base_event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_AUTO_PTR_RESET (disconnects[lcount],
+ new Loopback_Disconnect (
+ loopbacks[lcount].in ()),
+ Loopback_Disconnect
+ );
+ lcount++;
+
+ loopbacks[lcount] =
+ this->peers_[j]->setup_loopback (experiment_id,
+ base_event_type + 2
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_AUTO_PTR_RESET (disconnects[lcount],
+ new Loopback_Disconnect (
+ loopbacks[lcount].in ()),
+ Loopback_Disconnect
+ );
+ lcount++;
+ }
+ }
+
+ Federated_Test::Experiment_Results_var results =
+ this->peers_[i]->run_experiment (experiment_id,
+ this->iterations_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_Sample_History history (results->length ());
+ for (CORBA::ULong k = 0; k != results->length (); ++k)
+ history.sample (results[k]);
+
+ // We use a fake scale factor because the peer already converted
+ // to microseconds...
+ const ACE_UINT32 fake_scale_factor = 1;
+
+ ACE_Basic_Stats stats;
+ history.collect_basic_stats (stats);
+ stats.dump_results ("Total", fake_scale_factor);
+
+ if (this->do_dump_history_)
+ {
+ history.dump_samples ("HISTORY", fake_scale_factor);
+ }
+ }
+}
+
+PortableServer::POA_ptr
+Control::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Control.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Control.h
new file mode 100644
index 00000000000..9b09d063fb0
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Control.h
@@ -0,0 +1,80 @@
+/**
+ * @file Control.h
+ *
+ * $Id$
+ *
+ */
+
+#ifndef TAO_RTEC_PERF_CONTROL_H
+#define TAO_RTEC_PERF_CONTROL_H
+#include /**/ "ace/pre.h"
+
+#include "Federated_TestS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Control
+ *
+ * @brief Implement the Federated_Test::Control interface
+ *
+ */
+class TAO_RTEC_Perf_Export Control
+ : public virtual POA_Federated_Test::Control
+{
+public:
+ /// Constructor
+ Control (size_t peers_expected,
+ size_t iterations,
+ int do_dump_history,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa);
+
+ /// Destructor
+ virtual ~Control (void);
+
+ //@{
+ /** @name The Federated_Test::Control methods
+ */
+ virtual void join (Federated_Test::Peer_ptr peer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+private:
+ /// Synchronize access to the internal data
+ TAO_SYNCH_MUTEX mutex_;
+
+ /// Number of peers expected
+ size_t peers_expected_;
+
+ /// Number of iterations on each test
+ size_t iterations_;
+
+ /// This flag is set to 1 to dump the complete test history
+ int do_dump_history_;
+
+ /// Keep a reference to the ORB, used in shutdown
+ CORBA::ORB_var orb_;
+
+ /// The default POA
+ PortableServer::POA_var poa_;
+
+ /// Current number of items in the in the @c peers_ array.
+ size_t peers_count_;
+
+ /// An array to keep the list of peers.
+ /**
+ * @todo I would like to use ACE_Array<> but the interface is too
+ * confusing. std::vector<> would be better, but I'm not allowed to
+ */
+ Federated_Test::Peer_var *peers_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_RTEC_PERF_CONTROL_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/EC_Destroyer.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/EC_Destroyer.cpp
new file mode 100644
index 00000000000..220c8c3957c
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/EC_Destroyer.cpp
@@ -0,0 +1,34 @@
+/**
+ * @file EC_Destroyer.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "EC_Destroyer.h"
+
+#if !defined(__ACE_INLINE__)
+#include "EC_Destroyer.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ EC_Destroyer,
+ "$Id$")
+
+EC_Destroyer::EC_Destroyer (RtecEventChannelAdmin::EventChannel_ptr ec)
+ : ec_ (RtecEventChannelAdmin::EventChannel::_duplicate (ec))
+{
+}
+
+EC_Destroyer::~EC_Destroyer (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY {
+ this->ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ } ACE_CATCH (CORBA::Exception, ex) {
+ // @@ TODO Log this event, check the Servant_var.cpp comments for
+ // details.
+ } ACE_ENDTRY;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/EC_Destroyer.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/EC_Destroyer.h
new file mode 100644
index 00000000000..0c622a996a8
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/EC_Destroyer.h
@@ -0,0 +1,48 @@
+/**
+ * @file EC_Destroyer.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_EC_DESTROYER_H
+#define TAO_PERF_RTEC_EC_DESTROYER_H
+
+#include "rtec_perf_export.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class EC_Destroyer
+ *
+ * @brief Implement a helper class to destroy a Real-time Event
+ * Channel.
+ *
+ */
+class TAO_RTEC_Perf_Export EC_Destroyer
+{
+public:
+ /// Constructor
+ EC_Destroyer (RtecEventChannelAdmin::EventChannel_ptr ec);
+
+ /// Destructor
+ /**
+ * @todo This method could benefit from the error logging described
+ * in Servant_var.cpp
+ */
+ ~EC_Destroyer (void);
+
+private:
+ /// The event channel
+ RtecEventChannelAdmin::EventChannel_var ec_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "EC_Destroyer.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_PERF_RTEC_EC_DESTROYER_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/EC_Destroyer.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/EC_Destroyer.inl
new file mode 100644
index 00000000000..8106257cde1
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/EC_Destroyer.inl
@@ -0,0 +1,7 @@
+/**
+ * @file EC_Destroyer.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Federated_Test.idl b/TAO/orbsvcs/performance-tests/RTEvent/lib/Federated_Test.idl
new file mode 100644
index 00000000000..ac013f92dd2
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Federated_Test.idl
@@ -0,0 +1,105 @@
+/**
+ * @file Federated_Test.idl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ *
+ */
+
+module Federated_Test
+{
+ interface Peer;
+
+ interface Loopback;
+
+ /**
+ * @interface Coordinator
+ *
+ * @brief Controls a federated test.
+ *
+ * Implementations of the Control interface:
+ *
+ * -# wait for all the peers to join
+ * -# connecting the peers to each other
+ * -# run different experiments on each peer
+ * -# collect the results and print them
+ *
+ */
+ interface Control
+ {
+ /// Join a new peer into the simulation.
+ /**
+ * Implementations of this interface arbitrarly decide when there
+ * are "enough" peers to run the test.
+ */
+ void join (in Peer the_peer);
+ };
+
+ /// The results of a single experiment
+ typedef sequence<unsigned long long> Experiment_Results;
+
+ /**
+ * @interface Peer
+ *
+ * @brief A member of a federated test
+ *
+ * Peers define the required interface to participate in a federated
+ * test.
+ */
+ interface Peer
+ {
+ /// Shutdown the peer
+ void shutdown ();
+
+ /// Setup an Consumer/Supplier loopback pair
+ /**
+ * Some experiments require one or more peers to setup a
+ * "loopback" through their event channel, i.e. a
+ * Consumer/Supplier pair that simply "loop" every event they
+ * receive through the event channel.
+ *
+ * @param experiment_id Each experiment receives a unique ID to
+ * separate resources.
+ *
+ * @param base_event_type The type the Consumer part of the
+ * loopback should subscribe to, the supplier generate events of
+ * type base_event_type + 1
+ *
+ * @return The returned object can be used to disconnect and
+ * destroy the loopback elements.
+ */
+ Loopback setup_loopback (in long experiment_id,
+ in long base_event_type);
+
+ /// Run a single experiment
+ /**
+ * @param experiment_id Each experiment is assigned a different ID
+ * by the Control object.
+ * @param iterations How many iterations of the experiment should
+ * be run.
+ *
+ * @return All the samples captured in the experiment, the samples
+ * are returned in microseconds.
+ */
+ Experiment_Results run_experiment (in long experiment_id,
+ in long iterations);
+
+ /// Return the event channel in this peer
+ readonly attribute Object channel;
+
+ /// Connect to a remote peer
+ void connect (in Peer remote_peer);
+ };
+
+ /**
+ * @interface Loopback
+ *
+ * @brief Control the elements on a Consumer/Supplier loopback pair.
+ */
+ interface Loopback
+ {
+ /// Disconnect and destroy the loopback elements
+ void disconnect ();
+ };
+};
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Implicit_Deactivator.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Implicit_Deactivator.cpp
new file mode 100644
index 00000000000..ded3aa19ae6
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Implicit_Deactivator.cpp
@@ -0,0 +1,74 @@
+/**
+ * @file Implicit_Deactivator.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "Implicit_Deactivator.h"
+#include "tao/PortableServer/Servant_Base.h"
+#include "tao/Environment.h"
+#include "ace/Swap.h"
+
+#if !defined(__ACE_INLINE__)
+#include "Implicit_Deactivator.inl"
+#endif /* __ACE_INLINE__ */
+
+Implicit_Deactivator::Implicit_Deactivator (PortableServer::Servant servant
+ ACE_ENV_ARG_DECL)
+{
+ this->poa_ =
+ servant->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->id_ =
+ this->poa_->servant_to_id (servant ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+Implicit_Deactivator::Implicit_Deactivator (Implicit_Deactivator &rhs)
+ : poa_ (rhs.poa_)
+ , id_ (rhs.id_)
+{
+ rhs.release ();
+}
+
+Implicit_Deactivator&
+Implicit_Deactivator::operator= (Implicit_Deactivator &rhs)
+{
+ Implicit_Deactivator tmp (rhs);
+ // @@ This seems bogus, there should be a more efficient way to swap
+ // vars
+ ACE_Swap<PortableServer::POA_var>::swap (this->poa_, tmp.poa_);
+ ACE_Swap<PortableServer::ObjectId_var>::swap (this->id_, tmp.id_);
+ return *this;
+}
+
+Implicit_Deactivator::~Implicit_Deactivator ()
+{
+ if (this->id_.ptr () == 0)
+ return;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY {
+ this->poa_->deactivate_object (this->id_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ } ACE_CATCHANY {
+ // @@ TODO This event should be logged. Cannot throw because that
+ // would make it impossible to use this class effectively.
+ // Read Servant_var.cpp for more details.
+ } ACE_ENDTRY;
+}
+
+Implicit_Deactivator&
+Implicit_Deactivator::operator= (PortableServer::Servant servant)
+{
+ Implicit_Deactivator tmp (servant);
+ // @@ This seems bogus, there should be a more efficient way to swap
+ // vars
+ ACE_Swap<PortableServer::POA_var>::swap (this->poa_, tmp.poa_);
+ ACE_Swap<PortableServer::ObjectId_var>::swap (this->id_, tmp.id_);
+ return *this;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Implicit_Deactivator.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Implicit_Deactivator.h
new file mode 100644
index 00000000000..d7140a3275c
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Implicit_Deactivator.h
@@ -0,0 +1,52 @@
+/**
+ * @file Implicit_Deactivator.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+#ifndef TAO_PERF_RTEC_IMPLICIT_DEACTIVATOR_H
+#define TAO_PERF_RTEC_IMPLICIT_DEACTIVATOR_H
+
+#include "rtec_perf_export.h"
+#include "tao/PortableServer/PortableServer.h"
+
+/**
+ * @class Implicit_Deactivator
+ *
+ * @brief Automatically deactivate an implicitly activated object.
+ */
+class TAO_RTEC_Perf_Export Implicit_Deactivator
+{
+public:
+ /// Constructor
+ /**
+ * @param client The client
+ */
+ explicit Implicit_Deactivator (PortableServer::Servant servant = 0
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ Implicit_Deactivator (Implicit_Deactivator& rhs);
+ Implicit_Deactivator& operator= (Implicit_Deactivator& rhs);
+
+ /// Destructor
+ ~Implicit_Deactivator (void);
+
+ /// Assignment operator
+ Implicit_Deactivator& operator= (PortableServer::Servant servant);
+
+ /// Release the servant, i.e. the destructor does not deactivate anything
+ void release (void);
+
+private:
+ /// The POA
+ PortableServer::POA_var poa_;
+
+ /// The object id
+ PortableServer::ObjectId_var id_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "Implicit_Deactivator.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_PERF_RTEC_IMPLICIT_DEACTIVATOR_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Implicit_Deactivator.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/Implicit_Deactivator.inl
new file mode 100644
index 00000000000..b220d7959e4
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Implicit_Deactivator.inl
@@ -0,0 +1,13 @@
+/**
+ * @file Implicit_Deactivator.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+ACE_INLINE void
+Implicit_Deactivator::release (void)
+{
+ this->id_ = 0;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback.cpp
new file mode 100644
index 00000000000..41c08b2a882
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback.cpp
@@ -0,0 +1,40 @@
+/**
+ * @file Loopback.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "Loopback.h"
+#include "Auto_Disconnect.h"
+#include "Implicit_Deactivator.h"
+
+ACE_RCSID (TAO_RTEC_Perf,
+ Loopback,
+ "$Id$")
+
+Loopback::Loopback (CORBA::Long experiment_id,
+ CORBA::Long base_event_type,
+ PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ this->loopback_pair_.init (experiment_id,
+ base_event_type,
+ supplier_poa,
+ consumer_poa);
+
+ this->loopback_pair_.connect (ec ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Loopback::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ Auto_Disconnect<Loopback_Pair> disconnect (&this->loopback_pair_);
+
+ Implicit_Deactivator deactivator (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback.h
new file mode 100644
index 00000000000..384c42cd3cb
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback.h
@@ -0,0 +1,47 @@
+/**
+ * @file Loopback.h
+ *
+ * $Id$
+ *
+ */
+
+#ifndef TAO_RTEC_PERF_LOOPBACK_H
+#define TAO_RTEC_PERF_LOOPBACK_H
+
+#include "Federated_TestS.h"
+#include "Loopback_Pair.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Loopback
+ *
+ * @brief Implement the Control::Loopback interface
+ *
+ */
+class TAO_RTEC_Perf_Export Loopback
+ : public virtual POA_Federated_Test::Loopback
+{
+public:
+ /// Constructor
+ Loopback (CORBA::Long experiment_id,
+ CORBA::Long base_event_type,
+ PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+
+ //@{
+ /** @name The Federated_Test::Loopback methods
+ */
+ virtual void disconnect (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+private:
+ Loopback_Pair loopback_pair_;
+};
+
+#endif /* TAO_RTEC_PERF_LOOPBACK_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Consumer.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Consumer.cpp
new file mode 100644
index 00000000000..2c3d1f8084e
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Consumer.cpp
@@ -0,0 +1,116 @@
+/**
+ * @file Loopback_Consumer.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "Loopback_Consumer.h"
+#include "Implicit_Deactivator.h"
+#include "orbsvcs/Event_Service_Constants.h"
+
+ACE_RCSID (PERF_RTEC,
+ Loopback_Consumer,
+ "$Id$")
+
+Loopback_Consumer::
+Loopback_Consumer (CORBA::Long experiment_id,
+ CORBA::Long event_type,
+ Loopback_Supplier *supplier,
+ PortableServer::POA_ptr poa)
+ : experiment_id_ (experiment_id)
+ , event_type_ (event_type)
+ , supplier_ (TAO::Utils::Servant_Var<Loopback_Supplier>::_duplicate (supplier))
+ , default_POA_ (PortableServer::POA::_duplicate (poa))
+{
+}
+
+void
+Loopback_Consumer::connect (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (!CORBA::is_nil (this->proxy_supplier_.in ()))
+ return;
+
+ this->proxy_supplier_ =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ RtecEventComm::PushConsumer_var consumer =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::ConsumerQOS consumer_qos;
+ consumer_qos.is_gateway = 0;
+ 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.source = this->experiment_id_;
+ h1.type = this->event_type_;
+
+ this->proxy_supplier_->connect_push_consumer (consumer.in (),
+ consumer_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Loopback_Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RtecEventChannelAdmin::ProxyPushSupplier_var proxy;
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (CORBA::is_nil (this->proxy_supplier_.in ()))
+ return;
+ proxy = this->proxy_supplier_._retn ();
+ }
+
+ Implicit_Deactivator deactivator (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TRY
+ {
+ proxy->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY {} ACE_ENDTRY;
+}
+
+void
+Loopback_Consumer::push (const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // ACE_DEBUG ((LM_DEBUG, "Loopback_Consumer::push (%P|%t)\n"));
+ this->supplier_->push (events ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Loopback_Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ this->proxy_supplier_ =
+ RtecEventChannelAdmin::ProxyPushSupplier::_nil ();
+}
+
+PortableServer::POA_ptr
+Loopback_Consumer::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Consumer.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Consumer.h
new file mode 100644
index 00000000000..4ff3203146c
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Consumer.h
@@ -0,0 +1,76 @@
+/**
+ * @file Loopback_Consumer.h
+ *
+ * $Id$
+ *
+ */
+
+#ifndef TAO_PERF_RTEC_LOOPBACK_CONSUMER_H
+#define TAO_PERF_RTEC_LOOPBACK_CONSUMER_H
+
+#include "Loopback_Supplier.h"
+#include "tao/Utils/Servant_Var.h"
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Loopback_Consumer
+ *
+ * @brief Implement a simple consumer to keep track of the latency
+ *
+ */
+class TAO_RTEC_Perf_Export Loopback_Consumer
+ : public virtual POA_RtecEventComm::PushConsumer
+
+{
+public:
+ /// Constructor
+ Loopback_Consumer (CORBA::Long experiment_id,
+ CORBA::Long event_type,
+ Loopback_Supplier *supplier,
+ PortableServer::POA_ptr poa);
+
+ /// Connect to the event channel
+ void connect (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+
+ /// Disconnect from the event channel
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ //@{
+ /** @name 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));
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+private:
+ /// Synchronize access to the internal data
+ TAO_SYNCH_MUTEX mutex_;
+
+ /// The experiment id
+ CORBA::Long experiment_id_;
+
+ /// The event type this consumer subscribes to
+ CORBA::Long event_type_;
+
+ /// The supplier used to close the loopback
+ TAO::Utils::Servant_Var<Loopback_Supplier> supplier_;
+
+ /// The proxy this object is connected to
+ RtecEventChannelAdmin::ProxyPushSupplier_var proxy_supplier_;
+
+ /// The default poa
+ PortableServer::POA_var default_POA_;
+};
+
+#endif /* ECFL_LOOPBACK_CONSUMER_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Pair.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Pair.cpp
new file mode 100644
index 00000000000..5a0c80aed0c
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Pair.cpp
@@ -0,0 +1,56 @@
+/**
+ * @file Loopback_Pair.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "Loopback_Pair.h"
+#include "Auto_Disconnect.h"
+
+#if !defined(__ACE_INLINE__)
+#include "Loopback_Pair.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ Loopback_Pair,
+ "$Id$")
+
+void
+Loopback_Pair::init (CORBA::Long experiment_id,
+ CORBA::Long base_event_type,
+ PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa)
+{
+ this->loopback_supplier_ = new Loopback_Supplier (experiment_id,
+ base_event_type + 1,
+ supplier_poa);
+ this->loopback_consumer_ = new Loopback_Consumer (experiment_id,
+ base_event_type,
+ loopback_supplier_.in (),
+ consumer_poa);
+}
+
+void
+Loopback_Pair::connect (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ this->loopback_supplier_->connect (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ Auto_Disconnect<Loopback_Supplier> loopback_supplier_disconnect (this->loopback_supplier_);
+
+ this->loopback_consumer_->connect (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ Auto_Disconnect<Loopback_Consumer> loopback_consumer_disconnect (this->loopback_consumer_);
+
+ loopback_consumer_disconnect.release ();
+ loopback_supplier_disconnect.release ();
+}
+
+void
+Loopback_Pair::disconnect (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ Auto_Disconnect<Loopback_Supplier> loopback_supplier_disconnect (this->loopback_supplier_);
+ Auto_Disconnect<Loopback_Consumer> loopback_consumer_disconnect (this->loopback_consumer_);
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Pair.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Pair.h
new file mode 100644
index 00000000000..d70b8bfd9a4
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Pair.h
@@ -0,0 +1,79 @@
+/**
+ * @file Loopback_Pair.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_LOOPBACK_PAIR_H
+#define TAO_PERF_RTEC_LOOPBACK_PAIR_H
+
+#include "Servant_var.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "Loopback_Supplier.h"
+#include "Loopback_Consumer.h"
+
+/**
+ * @class Loopback_Pair
+ *
+ * @brief Simplify the initialization of a Loopback connection through
+ * the event channel.
+ */
+class TAO_RTEC_Perf_Export Loopback_Pair
+{
+public:
+ /// Constructor
+ /**
+ * We need a default constructor because this class is often used in
+ * arrays.
+ */
+ Loopback_Pair (void);
+
+ /**
+ * @param experiment_id For tests that run multiple experiments
+ * this number is changed on each iteration, guaranteeing
+ * better isolation.
+ * @param base_event_type The event type generated by the supplier.
+ * The Loopback_Consumer consumes the same event, the
+ * Loopback_Supplier generates (base_event_type + 1), and the
+ * consumer subscribes for that type too.
+ * @param iterations The number of iterations expected on the test.
+ * @param workload_in_usecs The consumer workload, in microseconds.
+ * @param gsf The high resolution timer global scale factor.
+ *
+ */
+ void init (CORBA::Long experiment_id,
+ CORBA::Long base_event_type,
+ PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa);
+
+ /// Connect to the event channel
+ void connect (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+
+ /// Disconnect from the event channel
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ //@{
+ /** @name Accessors
+ */
+ Loopback_Supplier *loopback_supplier (void) const;
+
+ Loopback_Consumer *loopback_consumer (void) const;
+ //@}
+
+private:
+ Servant_var<Loopback_Supplier> loopback_supplier_;
+ Servant_var<Loopback_Consumer> loopback_consumer_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "Loopback_Pair.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_PERF_RTEC_LOOPBACK_PAIR_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Pair.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Pair.inl
new file mode 100644
index 00000000000..64079dad6d5
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Pair.inl
@@ -0,0 +1,24 @@
+/**
+ * @file Loopback_Pair.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+ACE_INLINE
+Loopback_Pair::Loopback_Pair (void)
+{
+}
+
+ACE_INLINE Loopback_Supplier *
+Loopback_Pair::loopback_supplier (void) const
+{
+ return this->loopback_supplier_.in ();
+}
+
+ACE_INLINE Loopback_Consumer *
+Loopback_Pair::loopback_consumer (void) const
+{
+ return this->loopback_consumer_.in ();
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Supplier.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Supplier.cpp
new file mode 100644
index 00000000000..1e516958c44
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Supplier.cpp
@@ -0,0 +1,134 @@
+/**
+ * @file Loopback_Supplier.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "Loopback_Supplier.h"
+#include "Implicit_Deactivator.h"
+
+ACE_RCSID (TAO_PERF_RTEC,
+ Loopback_Supplier,
+ "$Id$")
+
+Loopback_Supplier::Loopback_Supplier (CORBA::Long experiment_id,
+ CORBA::Long response_type,
+ PortableServer::POA_ptr poa)
+ : experiment_id_ (experiment_id)
+ , response_type_ (response_type)
+ , default_POA_ (PortableServer::POA::_duplicate (poa))
+ , counter_ (0)
+{
+}
+
+void
+Loopback_Supplier::connect (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (!CORBA::is_nil (this->proxy_consumer_.in ()))
+ return;
+
+ this->proxy_consumer_ =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ RtecEventComm::PushSupplier_var supplier =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::SupplierQOS supplier_qos;
+ supplier_qos.is_gateway = 0;
+ supplier_qos.publications.length (1);
+ RtecEventComm::EventHeader& sh0 =
+ supplier_qos.publications[0].event.header;
+ sh0.type = this->response_type_;
+ sh0.source = this->experiment_id_;
+
+ this->proxy_consumer_->connect_push_supplier (supplier.in (),
+ supplier_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Loopback_Supplier::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy;
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (CORBA::is_nil (this->proxy_consumer_.in ()))
+ return;
+ proxy = this->proxy_consumer_._retn ();
+ }
+
+ Implicit_Deactivator deactivator (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TRY {
+ proxy->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ } ACE_CATCHANY {
+ } ACE_ENDTRY;
+}
+
+void
+Loopback_Supplier::push (const RtecEventComm::EventSet &source
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // ACE_DEBUG ((LM_DEBUG, "Loopback_Supplier pushing\n"));
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy;
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (CORBA::is_nil (this->proxy_consumer_.in ()))
+ return;
+ proxy = this->proxy_consumer_;
+
+#if 0
+ this->counter_ += source.length ();
+ if ((this->counter_ + 1) % 1000 == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) - Loopback (%d) sending %d messages\n",
+ this->response_type_, this->counter_ + 1));
+ }
+#endif /* 0 */
+ }
+
+ // ACE_DEBUG ((LM_DEBUG, "Loopback_Supplier::push (%P|%t)\n"));
+ RtecEventComm::EventSet events (source);
+ for (CORBA::ULong i = 0; i != events.length (); ++i)
+ {
+ events[i].header.ttl = 1;
+ events[i].header.type = this->response_type_;
+ events[i].header.source = this->experiment_id_;
+ }
+
+ proxy->push (events ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Loopback_Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ this->proxy_consumer_ =
+ RtecEventChannelAdmin::ProxyPushConsumer::_nil ();
+}
+
+PortableServer::POA_ptr
+Loopback_Supplier::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Supplier.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Supplier.h
new file mode 100644
index 00000000000..24f2055cf04
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Loopback_Supplier.h
@@ -0,0 +1,80 @@
+/**
+ * @file Loopback_Supplier.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_RTEC_LOOPBACK_SUPPLIER_H
+#define TAO_RTEC_LOOPBACK_SUPPLIER_H
+
+#include "rtec_perf_export.h"
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Loopback_Supplier
+ *
+ * @brief Implement a simple supplier to keep track of the latency
+ *
+ */
+class TAO_RTEC_Perf_Export Loopback_Supplier
+ : public virtual POA_RtecEventComm::PushSupplier
+{
+public:
+ /// Constructor
+ /**
+ * The experiment ID is used to configure the supplier ID on the
+ * publication.
+ */
+ Loopback_Supplier (CORBA::Long experiment_id,
+ CORBA::Long response_type,
+ PortableServer::POA_ptr poa);
+
+ /// Connect to the event channel
+ void connect (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+
+ /// Disconnect from the event channel
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ void push (const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ //@{
+ /** @name The RtecEventComm::PushSupplier methods
+ */
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+private:
+ /// The experiment id
+ /// Synchronize access to the internal data
+ TAO_SYNCH_MUTEX mutex_;
+
+ /// The experiment id
+ CORBA::Long experiment_id_;
+
+ /// The response event type
+ CORBA::Long response_type_;
+
+ /// The proxy this object is connected to
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy_consumer_;
+
+ /// The default poa
+ PortableServer::POA_var default_POA_;
+
+ /// Count the number of events processed
+ CORBA::ULong counter_;
+};
+
+#endif /* TAO_RTEC_LOOPBACK_SUPPLIER_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.cpp
new file mode 100644
index 00000000000..36154df9fcd
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.cpp
@@ -0,0 +1,121 @@
+/**
+ * @file Low_Priority_Setup.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_LOW_PRIORITY_SETUP_CPP
+#define TAO_PERF_RTEC_LOW_PRIORITY_SETUP_CPP
+
+#include "Low_Priority_Setup.h"
+
+#include "ace/Basic_Stats.h"
+#include "ace/Sample_History.h"
+
+template<class Client_Type> Low_Priority_Setup<Client_Type>::
+Low_Priority_Setup (int consumer_count,
+ int iterations,
+ int use_different_types,
+ CORBA::Long experiment_id,
+ CORBA::Long base_event_type,
+ int workload,
+ ACE_UINT32 gsf,
+ int nthreads,
+ int thread_priority,
+ int thread_sched_class,
+ int per_thread_period,
+ PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa,
+ RtecEventChannelAdmin::EventChannel_ptr ec,
+ ACE_Barrier *barrier
+ ACE_ENV_ARG_DECL)
+ : consumer_count_ (consumer_count)
+ , clients_ (consumer_count ? new Client_Type[consumer_count] : 0)
+ , disconnect_ (consumer_count ? new Client_Auto_Disconnect[consumer_count] : 0)
+ , nthreads_ (nthreads)
+ , tasks_ (nthreads ? new Send_Task[nthreads] : 0)
+ , stoppers_ (nthreads ? new Auto_Send_Task_Stopper[nthreads] : 0)
+{
+ for (int i = 0; i != consumer_count; ++i)
+ {
+ int per_consumer_workload =
+ workload / this->consumer_count_;
+ if (workload != 0 && per_consumer_workload == 0)
+ per_consumer_workload = 1;
+
+ CORBA::Long event_type =
+ base_event_type;
+ if (use_different_types)
+ event_type = base_event_type + 2 * i;
+
+ this->clients_[i].init (experiment_id,
+ event_type,
+ iterations,
+ per_consumer_workload,
+ gsf,
+ supplier_poa,
+ consumer_poa);
+ this->clients_[i].connect (ec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ // Automatically disconnect the group if the connection was
+ // successful
+ this->disconnect_[i] = &this->clients_[i];
+ }
+
+ for (int j = 0; j != nthreads; ++j)
+ {
+ CORBA::Long event_type =
+ base_event_type;
+ if (use_different_types)
+ event_type = base_event_type + 2 * j;
+
+ this->tasks_[j].init (0,
+ per_thread_period,
+ j * per_thread_period,
+ event_type,
+ experiment_id,
+ this->clients_[j].supplier (),
+ barrier);
+ this->tasks_[j].thr_mgr (&this->thr_mgr_);
+ ACE_AUTO_PTR_RESET (this->stoppers_[j],
+ new Send_Task_Stopper (thread_priority,
+ thread_sched_class,
+ &this->tasks_[j]),
+ Send_Task_Stopper);
+ }
+}
+
+template<class Client_Type> void
+Low_Priority_Setup<Client_Type>::stop_all_threads (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "Stopping:"));
+ for (int i = 0; i != this->nthreads_; ++i)
+ {
+ this->tasks_[i].stop ();
+ ACE_DEBUG ((LM_DEBUG, " %d", i));
+ }
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+ this->thr_mgr_.wait ();
+
+ /// Resetting the auto_ptr<> destroys all the objects. The
+ /// destructors automatically stop and wait for all the threads.
+ /// Depending on your personal bias this is either "super neat" or
+ /// "a horrible kludge", IMHO is just good use of the language :-)
+ this->stoppers_.reset (0);
+}
+
+template<class Client_Type> void
+Low_Priority_Setup<Client_Type>::collect_basic_stats (ACE_Basic_Stats &stats)
+{
+ for (int i = 0; i != this->consumer_count_; ++i)
+ {
+ ACE_Sample_History &history =
+ this->clients_[i].consumer ()->sample_history ();
+ history.collect_basic_stats (stats);
+ }
+}
+
+#endif /* TAO_PERF_RTEC_LOW_PRIORITY_SETUP_CPP */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.h
new file mode 100644
index 00000000000..e6f5315abd0
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.h
@@ -0,0 +1,83 @@
+/**
+ * @file Low_Priority_Setup.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_LOW_PRIORITY_SETUP_H
+#define TAO_PERF_RTEC_LOW_PRIORITY_SETUP_H
+
+#include "Auto_Disconnect.h"
+#include "Send_Task.h"
+#include "Send_Task_Stopper.h"
+#include "ace/Auto_Ptr.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class RT_Class;
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Basic_Stats;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class Low_Priority_Setup
+ *
+ * @brief Simplify the initialization of performance tests clients
+ *
+ */
+template<class Client_Type>
+class Low_Priority_Setup
+{
+public:
+ /// Constructor
+ Low_Priority_Setup (int consumer_count,
+ int iterations,
+ int use_different_types,
+ CORBA::Long experiment_id,
+ CORBA::Long base_event_type,
+ int workload,
+ ACE_UINT32 gsf,
+ int nthreads,
+ int thread_priority,
+ int thread_sched_class,
+ int per_thread_period,
+ PortableServer::POA_ptr supplier_poa,
+ PortableServer::POA_ptr consumer_poa,
+ RtecEventChannelAdmin::EventChannel_ptr ec,
+ ACE_Barrier *barrier
+ ACE_ENV_ARG_DECL);
+
+ /// Stop all running threads
+ void stop_all_threads (void);
+
+ /// Collect the stats from all the clients
+ void collect_basic_stats (ACE_Basic_Stats &stats);
+
+ typedef ACE_Auto_Basic_Array_Ptr<Client_Type> Client_Array;
+ typedef Auto_Disconnect<Client_Type> Client_Auto_Disconnect;
+ typedef ACE_Auto_Basic_Array_Ptr<Client_Auto_Disconnect> Client_Auto_Disconnect_Array;
+ typedef ACE_Auto_Basic_Array_Ptr<Send_Task> Send_Task_Array;
+ typedef auto_ptr<Send_Task_Stopper> Auto_Send_Task_Stopper;
+ typedef ACE_Auto_Basic_Array_Ptr<Auto_Send_Task_Stopper> Send_Task_Stopper_Array;
+
+private:
+ int consumer_count_;
+ Client_Array clients_;
+ Client_Auto_Disconnect_Array disconnect_;
+
+ int nthreads_;
+ Send_Task_Array tasks_;
+ Send_Task_Stopper_Array stoppers_;
+ ACE_Thread_Manager thr_mgr_;
+};
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "Low_Priority_Setup.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#endif /* TAO_PERF_RTEC_LOW_PRIORITY_SETUP_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.inl
new file mode 100644
index 00000000000..e9f4cab94a8
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.inl
@@ -0,0 +1,7 @@
+/**
+ * @file Low_Priority_Setup.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Makefile.am b/TAO/orbsvcs/performance-tests/RTEvent/lib/Makefile.am
new file mode 100644
index 00000000000..cc8e9942d43
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Makefile.am
@@ -0,0 +1,181 @@
+## 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.RTEC_Perf.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES = \
+ Federated_TestC.cpp \
+ Federated_TestC.h \
+ Federated_TestC.inl \
+ Federated_TestS.cpp \
+ Federated_TestS.h \
+ Federated_TestS.inl \
+ Federated_TestS_T.cpp \
+ Federated_TestS_T.h \
+ Federated_TestS_T.inl
+
+CLEANFILES = \
+ Federated_Test-stamp \
+ Federated_TestC.cpp \
+ Federated_TestC.h \
+ Federated_TestC.inl \
+ Federated_TestS.cpp \
+ Federated_TestS.h \
+ Federated_TestS.inl \
+ Federated_TestS_T.cpp \
+ Federated_TestS_T.h \
+ Federated_TestS_T.inl
+
+Federated_TestC.cpp Federated_TestC.h Federated_TestC.inl Federated_TestS.cpp Federated_TestS.h Federated_TestS.inl Federated_TestS_T.cpp Federated_TestS_T.h Federated_TestS_T.inl: Federated_Test-stamp
+
+Federated_Test-stamp: $(srcdir)/Federated_Test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -Wb,export_macro=TAO_RTEC_Perf_Export -Wb,export_include=rtec_perf_export.h $(srcdir)/Federated_Test.idl
+ @touch $@
+
+noinst_LTLIBRARIES = libTAO_RTEC_Perf.la
+
+libTAO_RTEC_Perf_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_RTEC_PERF_BUILD_DLL
+
+libTAO_RTEC_Perf_la_SOURCES = \
+ Client_Group.cpp \
+ Client_Options.cpp \
+ Client_Pair.cpp \
+ Consumer.cpp \
+ Control.cpp \
+ EC_Destroyer.cpp \
+ Federated_TestC.cpp \
+ Federated_TestS.cpp \
+ Implicit_Deactivator.cpp \
+ Loopback.cpp \
+ Loopback_Consumer.cpp \
+ Loopback_Pair.cpp \
+ Loopback_Supplier.cpp \
+ ORB_Holder.cpp \
+ ORB_Shutdown.cpp \
+ ORB_Task.cpp \
+ ORB_Task_Activator.cpp \
+ Peer_Base.cpp \
+ PriorityBand_Setup.cpp \
+ RTCORBA_Setup.cpp \
+ RTClient_Setup.cpp \
+ RTEC_Initializer.cpp \
+ RTPOA_Setup.cpp \
+ RTServer_Setup.cpp \
+ RT_Class.cpp \
+ Send_Task.cpp \
+ Send_Task_Stopper.cpp \
+ Supplier.cpp \
+ SyncScope_Setup.cpp
+
+noinst_HEADERS = \
+ Auto_Disconnect.cpp \
+ Auto_Disconnect.h \
+ Auto_Disconnect.inl \
+ Client_Group.h \
+ Client_Group.inl \
+ Client_Options.h \
+ Client_Pair.h \
+ Client_Pair.inl \
+ Consumer.h \
+ Control.h \
+ EC_Destroyer.h \
+ EC_Destroyer.inl \
+ Federated_Test.idl \
+ Federated_TestC.h \
+ Federated_TestC.inl \
+ Federated_TestS.h \
+ Federated_TestS.inl \
+ Federated_TestS_T.cpp \
+ Federated_TestS_T.h \
+ Federated_TestS_T.inl \
+ Implicit_Deactivator.h \
+ Implicit_Deactivator.inl \
+ Loopback.h \
+ Loopback_Consumer.h \
+ Loopback_Pair.h \
+ Loopback_Pair.inl \
+ Loopback_Supplier.h \
+ Low_Priority_Setup.cpp \
+ Low_Priority_Setup.h \
+ Low_Priority_Setup.inl \
+ ORB_Holder.h \
+ ORB_Holder.inl \
+ ORB_Shutdown.h \
+ ORB_Shutdown.inl \
+ ORB_Task.h \
+ ORB_Task.inl \
+ ORB_Task_Activator.h \
+ ORB_Task_Activator.inl \
+ Peer_Base.h \
+ PriorityBand_Setup.h \
+ PriorityBand_Setup.inl \
+ RIR_Narrow.cpp \
+ RIR_Narrow.h \
+ RTCORBA_Setup.h \
+ RTCORBA_Setup.inl \
+ RTClient_Setup.h \
+ RTClient_Setup.inl \
+ RTEC_Initializer.h \
+ RTPOA_Setup.h \
+ RTPOA_Setup.inl \
+ RTServer_Setup.h \
+ RTServer_Setup.inl \
+ RT_Class.h \
+ RT_Class.inl \
+ Send_Task.h \
+ Send_Task_Stopper.h \
+ Send_Task_Stopper.inl \
+ Servant_var.cpp \
+ Servant_var.h \
+ Servant_var.inl \
+ Shutdown.cpp \
+ Shutdown.h \
+ Shutdown.inl \
+ Supplier.h \
+ SyncScope_Setup.h \
+ SyncScope_Setup.inl \
+ Task_Activator.cpp \
+ Task_Activator.h \
+ Task_Activator.inl \
+ rtec_perf_export.h
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+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/performance-tests/RTEvent/lib/ORB_Holder.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Holder.cpp
new file mode 100644
index 00000000000..a2ee9263b1f
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Holder.cpp
@@ -0,0 +1,37 @@
+/**
+ * @file ORB_Holder.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "ORB_Holder.h"
+
+#if !defined(__ACE_INLINE__)
+#include "ORB_Holder.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ ORB_Holder,
+ "$Id$")
+
+ORB_Holder::ORB_Holder (int &argc, char *argv[],
+ const char *orb_id
+ ACE_ENV_ARG_DECL)
+ : orb_ (CORBA::ORB_init (argc, argv, orb_id
+ ACE_ENV_ARG_PARAMETER))
+{
+}
+
+ORB_Holder::~ORB_Holder (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY {
+ this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ } ACE_CATCH (CORBA::Exception, ex) {
+ // @@ TODO Log this event, check the Servant_var.cpp comments for
+ // details.
+ } ACE_ENDTRY;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Holder.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Holder.h
new file mode 100644
index 00000000000..a600f780980
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Holder.h
@@ -0,0 +1,62 @@
+/**
+ * @file ORB_Holder.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_ORB_HOLDER_H
+#define TAO_PERF_RTEC_ORB_HOLDER_H
+
+#include "rtec_perf_export.h"
+#include "tao/ORB.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class ORB_Holder
+ *
+ * @brief Implement a helper class to initialize and destroy an ORB.
+ *
+ */
+class TAO_RTEC_Perf_Export ORB_Holder
+{
+public:
+ /// Constructor
+ ORB_Holder (int &argc, char *argv[],
+ const char *orb_id = 0
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Destructor
+ /**
+ * @todo This method could benefit from the error logging described
+ * in Servant_var.cpp
+ */
+ ~ORB_Holder (void);
+
+ /// Access the underlying ORB, using the canonical CORBA memory
+ /// management model
+ CORBA::ORB_ptr orb (void);
+
+ /// Implicit conversion to CORBA::ORB_ptr
+ /**
+ * It behaves as the .in() methods in the T_var classes.
+ */
+ operator CORBA::ORB_ptr () const;
+
+ /// Smart pointer behavior
+ CORBA::ORB_ptr operator-> () const;
+
+private:
+ /// The ORB
+ CORBA::ORB_var orb_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "ORB_Holder.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_PERF_RTEC_ORB_HOLDER_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Holder.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Holder.inl
new file mode 100644
index 00000000000..60900f61610
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Holder.inl
@@ -0,0 +1,25 @@
+/**
+ * @file ORB_Holder.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+ACE_INLINE CORBA::ORB_ptr
+ORB_Holder::orb (void)
+{
+ return CORBA::ORB::_duplicate (this->orb_.in ());
+}
+
+ACE_INLINE
+ORB_Holder::operator CORBA::ORB_ptr (void) const
+{
+ return this->orb_.in ();
+}
+
+ACE_INLINE CORBA::ORB_ptr
+ORB_Holder::operator-> (void) const
+{
+ return this->orb_.in ();
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Shutdown.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Shutdown.cpp
new file mode 100644
index 00000000000..2071b0a718e
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Shutdown.cpp
@@ -0,0 +1,16 @@
+/**
+ * @file ORB_Shutdown.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+#include "ORB_Shutdown.h"
+
+#if !defined(__ACE_INLINE__)
+#include "ORB_Shutdown.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ ORB_Shutdown,
+ "$Id$")
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Shutdown.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Shutdown.h
new file mode 100644
index 00000000000..4e26067d2a4
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Shutdown.h
@@ -0,0 +1,31 @@
+/**
+ * @file ORB_Shutdown.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+#ifndef TAO_PERF_RTEC_ORB_SHUTDOWN_H
+#define TAO_PERF_RTEC_ORB_SHUTDOWN_H
+#include /**/ "ace/pre.h"
+
+#include "rtec_perf_export.h"
+#include "tao/ORB.h"
+
+/**
+ * @class ORB_Shutdown
+ *
+ * @brief Helper functor to call the shutdown() operation in the ORB.
+ */
+class ORB_Shutdown
+{
+public:
+ void operator() (CORBA::ORB_ptr orb);
+};
+
+#if defined(__ACE_INLINE__)
+#include "ORB_Shutdown.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_PERF_RTEC_ORB_SHUTDOWN_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Shutdown.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Shutdown.inl
new file mode 100644
index 00000000000..13fbb623600
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Shutdown.inl
@@ -0,0 +1,23 @@
+// -*- C++ -*-
+
+/**
+ * @file ORB_Shutdown.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+ACE_INLINE void
+ORB_Shutdown::operator () (CORBA::ORB_ptr orb)
+{
+ ACE_DECLARE_NEW_ENV;
+ ACE_TRY
+ {
+ orb->shutdown (0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY { };
+ ACE_ENDTRY;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task.cpp
new file mode 100644
index 00000000000..369d7f358fa
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task.cpp
@@ -0,0 +1,39 @@
+/**
+ * @file ORB_Task.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "ORB_Task.h"
+
+#if !defined(__ACE_INLINE__)
+#include "ORB_Task.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ ORB_Task,
+ "$Id$")
+
+ORB_Task::ORB_Task (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+int
+ORB_Task::svc (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task.h
new file mode 100644
index 00000000000..28240439233
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task.h
@@ -0,0 +1,46 @@
+/**
+ * @file ORB_Task.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_ORB_TASK_H
+#define TAO_PERF_RTEC_ORB_TASK_H
+
+#include "rtec_perf_export.h"
+#include "tao/ORB.h"
+#include "ace/Task.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class ORB_Task
+ *
+ * @brief Implement a simple ACE_Task to send the events
+ *
+ */
+class TAO_RTEC_Perf_Export ORB_Task : public ACE_Task_Base
+{
+public:
+ /// Constructor
+ ORB_Task (CORBA::ORB_ptr orb);
+
+ /// Run the event loop
+ int svc (void);
+
+ /// Smart-pointer operator
+ CORBA::ORB_ptr operator-> (void) const;
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "ORB_Task.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_PERF_RTEC_ORB_TASK_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task.inl
new file mode 100644
index 00000000000..66344be0f08
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task.inl
@@ -0,0 +1,13 @@
+/**
+ * @file ORB_Task.inl
+ *
+` * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+ACE_INLINE CORBA::ORB_ptr
+ORB_Task::operator-> (void) const
+{
+ return this->orb_.in ();
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task_Activator.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task_Activator.cpp
new file mode 100644
index 00000000000..42bc3fb5676
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task_Activator.cpp
@@ -0,0 +1,29 @@
+/**
+ * @file ORB_Task_Activator.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "ORB_Task_Activator.h"
+
+#if !defined(__ACE_INLINE__)
+#include "ORB_Task_Activator.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ ORB_Task_Activator,
+ "$Id$")
+
+ORB_Task_Activator::~ORB_Task_Activator (void)
+{
+ if (this->task_ == 0)
+ return;
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY {
+ (*this->task_)->shutdown (0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ } ACE_CATCHANY {
+ } ACE_ENDTRY;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task_Activator.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task_Activator.h
new file mode 100644
index 00000000000..1a81ca995cc
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task_Activator.h
@@ -0,0 +1,42 @@
+/**
+ * @file ORB_Task_Activator.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_ORB_TASK_ACTIVATOR_H
+#define TAO_PERF_RTEC_ORB_TASK_ACTIVATOR_H
+
+#include "ORB_Task.h"
+#include "Task_Activator.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class ORB_Task_Activator
+ *
+ * @brief Implement a helper class to activate and stop Send_Tasks.
+ *
+ */
+class TAO_RTEC_Perf_Export ORB_Task_Activator : public Task_Activator<ORB_Task>
+{
+public:
+ /// Constructor
+ ORB_Task_Activator (int priority,
+ int scheduling_class,
+ int nthreads,
+ ORB_Task *task);
+
+ /// Destructor, stop the task and wait for it
+ ~ORB_Task_Activator (void);
+};
+
+#if defined(__ACE_INLINE__)
+#include "ORB_Task_Activator.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_PERF_RTEC_ORB_TASK_ACTIVATOR_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task_Activator.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task_Activator.inl
new file mode 100644
index 00000000000..ac24f29094c
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/ORB_Task_Activator.inl
@@ -0,0 +1,19 @@
+/**
+ * @file ORB_Task_Activator.inl
+ *
+` * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+ACE_INLINE
+ORB_Task_Activator::ORB_Task_Activator (int priority,
+ int scheduling_class,
+ int nthreads,
+ ORB_Task *task)
+ : Task_Activator<ORB_Task> (priority,
+ scheduling_class,
+ nthreads,
+ task)
+{
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Peer_Base.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Peer_Base.cpp
new file mode 100644
index 00000000000..2b0a05a1eee
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Peer_Base.cpp
@@ -0,0 +1,145 @@
+/**
+ * @file Peer_Base.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "Peer_Base.h"
+#include "RTServer_Setup.h"
+#include "RIR_Narrow.h"
+#include "Servant_var.h"
+#include "RTEC_Initializer.h"
+#include "EC_Destroyer.h"
+#include "Auto_Disconnect.h"
+#include "Loopback.h"
+
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Gateway_IIOP.h"
+
+ACE_RCSID (TAO_RTEC_Perf,
+ Peer_Base,
+ "$Id$")
+
+Peer_Base::Peer_Base (CORBA::ORB_ptr orb,
+ RTServer_Setup &rtserver_setup
+ ACE_ENV_ARG_DECL)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+ , poa_ (rtserver_setup.poa ())
+{
+ Servant_var<TAO_EC_Event_Channel> ec_impl (
+ RTEC_Initializer::create (this->poa_.in (),
+ this->poa_.in (),
+ rtserver_setup.rtcorba_setup ()
+ ACE_ENV_ARG_PARAMETER)
+ );
+ ACE_CHECK;
+
+ ec_impl->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::ObjectId_var ec_id =
+ this->poa_->activate_object (ec_impl.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ CORBA::Object_var ec_object =
+ this->poa_->id_to_reference (ec_id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->event_channel_ =
+ RtecEventChannelAdmin::EventChannel::_narrow (ec_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+Peer_Base::~Peer_Base (void)
+{
+}
+
+void
+Peer_Base::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ {
+ EC_Destroyer ec_destroyer (this->event_channel_.in ());
+ this->event_channel_ =
+ RtecEventChannelAdmin::EventChannel::_nil ();
+ }
+
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Object_ptr
+Peer_Base::channel (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::Object::_duplicate (this->event_channel_.in ());
+}
+
+void
+Peer_Base::connect (Federated_Test::Peer_ptr remote_peer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Connecting....\n"));
+ CORBA::Object_var remote_ec_object =
+ remote_peer->channel (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var remote_ec =
+ RtecEventChannelAdmin::EventChannel::_narrow (remote_ec_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ Servant_var<TAO_EC_Gateway_IIOP> gateway (new TAO_EC_Gateway_IIOP);
+ gateway->init (remote_ec.in (),
+ this->event_channel_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::Observer_var observer =
+ gateway->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::Observer_Handle h =
+ this->event_channel_->append_observer (observer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ gateway->observer_handle (h);
+}
+
+Federated_Test::Loopback_ptr
+Peer_Base::setup_loopback (CORBA::Long experiment_id,
+ CORBA::Long base_event_type
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ Servant_var<Loopback> loopback (
+ new Loopback (experiment_id,
+ base_event_type,
+ this->poa_.in (),
+ this->poa_.in (),
+ this->event_channel_.in ()
+ ACE_ENV_ARG_PARAMETER));
+ ACE_CHECK_RETURN (Federated_Test::Loopback::_nil ());
+
+ Auto_Disconnect<Loopback> disconnect (loopback);
+
+ Federated_Test::Loopback_var lb =
+ loopback->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (Federated_Test::Loopback::_nil ());
+
+ disconnect.release ();
+
+ return lb._retn ();
+}
+
+PortableServer::POA_ptr
+Peer_Base::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Peer_Base.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Peer_Base.h
new file mode 100644
index 00000000000..948ef5b20a1
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Peer_Base.h
@@ -0,0 +1,76 @@
+/**
+ * @file Peer_Base.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ *
+ */
+
+#ifndef TAO_RTEC_PERF_PEER_BASE_H
+#define TAO_RTEC_PERF_PEER_BASE_H
+
+#include "Federated_TestS.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class RTServer_Setup;
+
+/**
+ * @class Peer_Base
+ *
+ * @brief Implement the shared portions of Federated_Test::Peer
+ * servants
+ *
+ */
+class TAO_RTEC_Perf_Export Peer_Base
+ : public virtual POA_Federated_Test::Peer
+{
+public:
+ /// Constructor
+ Peer_Base (CORBA::ORB_ptr orb,
+ RTServer_Setup &rtserver_setup
+ ACE_ENV_ARG_DECL);
+
+ /// Destructor
+ virtual ~Peer_Base (void);
+
+ //@{
+ /** @name The Federated_Test::Peer methods
+ */
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Object_ptr
+ channel (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void connect (Federated_Test::Peer_ptr remote_peer
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ Federated_Test::Loopback_ptr setup_loopback (CORBA::Long experiment_id,
+ CORBA::Long base_event_type
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+protected:
+ /// Keep a reference to the ORB, used in shutdown
+ CORBA::ORB_var orb_;
+
+ /// The POA used for the suppliers, consumers, activate the EC and
+ /// as this servant's _default_POA()
+ PortableServer::POA_var poa_;
+
+ /// Event Channel references
+ RtecEventChannelAdmin::EventChannel_var event_channel_;
+};
+
+#endif /* TAO_RTEC_PERF_PEER_BASE_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/PriorityBand_Setup.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/PriorityBand_Setup.cpp
new file mode 100644
index 00000000000..bbb980bde7b
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/PriorityBand_Setup.cpp
@@ -0,0 +1,63 @@
+/**
+ * @file PriorityBand_Setup.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "PriorityBand_Setup.h"
+#include "RTCORBA_Setup.h"
+#include "RIR_Narrow.h"
+
+#if !defined(__ACE_INLINE__)
+#include "PriorityBand_Setup.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ PriorityBand_Setup,
+ "$Id$")
+
+PriorityBand_Setup::PriorityBand_Setup (CORBA::ORB_ptr orb,
+ const RTCORBA_Setup &rtcorba_setup
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::PolicyManager_var policy_manager =
+ RIR_Narrow<CORBA::PolicyManager>::resolve (orb,
+ "ORBPolicyManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RTCORBA::RTORB_var rtorb =
+ RIR_Narrow<RTCORBA::RTORB>::resolve (orb,
+ "RTORB"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const RTCORBA::ThreadpoolLanes &lanes = rtcorba_setup.lanes ();
+
+ RTCORBA::PriorityBands priority_bands (3); priority_bands.length (3);
+ for (CORBA::ULong i = 0; i != lanes.length (); ++i)
+ {
+ priority_bands[i].low = lanes[i].lane_priority;
+ priority_bands[i].high = lanes[i].lane_priority;
+ }
+
+ CORBA::PolicyList policy_list (1); policy_list.length (1);
+
+ policy_list[0] =
+ rtorb->create_priority_banded_connection_policy (priority_bands
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ policy_manager->set_policy_overrides (policy_list,
+ CORBA::ADD_OVERRIDE
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ policy_list[0]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+PriorityBand_Setup::~PriorityBand_Setup (void)
+{
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/PriorityBand_Setup.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/PriorityBand_Setup.h
new file mode 100644
index 00000000000..33cebd601cf
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/PriorityBand_Setup.h
@@ -0,0 +1,46 @@
+/**
+ * @file PriorityBand_Setup.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_PRIORITYBAND_SETUP_H
+#define TAO_PERF_RTEC_PRIORITYBAND_SETUP_H
+
+#include "rtec_perf_export.h"
+#include "tao/ORB.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class RTCORBA_Setup;
+
+/**
+ * @class PriorityBand_Setup
+ *
+ * @brief Simplify the initialization of performance tests.
+ *
+ */
+class TAO_RTEC_Perf_Export PriorityBand_Setup
+{
+public:
+ /// Constructor
+ PriorityBand_Setup (CORBA::ORB_ptr orb,
+ const RTCORBA_Setup &rtcorba_setup
+ ACE_ENV_ARG_DECL);
+
+ /// Destructor
+ /**
+ * It is a no-op, but it shuts up g++
+ */
+ ~PriorityBand_Setup (void);
+};
+
+#if defined(__ACE_INLINE__)
+#include "PriorityBand_Setup.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_PERF_RTEC_PRIORITYBAND_SETUP_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/PriorityBand_Setup.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/PriorityBand_Setup.inl
new file mode 100644
index 00000000000..c9ee6e6c756
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/PriorityBand_Setup.inl
@@ -0,0 +1,8 @@
+/**
+ * @file PriorityBand_Setup.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RIR_Narrow.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/RIR_Narrow.cpp
new file mode 100644
index 00000000000..ba719129de4
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RIR_Narrow.cpp
@@ -0,0 +1,49 @@
+/**
+ * @file RIR_Narrow.cpp
+ *
+ * $Id$
+ *
+ * @author Jody Hagins <jody@atdesk.com>
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+#ifndef TAO_PERF_RTEC_RIR_NARROW_CPP
+#define TAO_PERF_RTEC_RIR_NARROW_CPP
+
+#include "RIR_Narrow.h"
+
+#include "tao/Environment.h"
+
+#include "ace/Log_Msg.h"
+
+template<class Interface> ACE_TYPENAME RIR_Narrow<Interface>::Interface_ptr
+RIR_Narrow<Interface>::resolve (CORBA::ORB_ptr orb,
+ const char *object_id
+ ACE_ENV_ARG_DECL)
+{
+ Interface_var interface;
+
+ ACE_TRY
+ {
+ CORBA::Object_var object =
+ orb->resolve_initial_references (object_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ interface = Interface::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (interface.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Panic - error while narrowing <%s>\n",
+ object_id));
+ ACE_OS::exit (1);
+ }
+ }ACE_CATCHANY{
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Caught an exception \n");
+ }
+ ACE_ENDTRY;
+ return interface._retn ();
+}
+
+#endif /* TAO_PERF_RTEC_RIR_NARROW_CPP */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RIR_Narrow.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/RIR_Narrow.h
new file mode 100644
index 00000000000..3cb61f27724
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RIR_Narrow.h
@@ -0,0 +1,39 @@
+/**
+ * @file RIR_Narrow.h
+ *
+ * $Id$
+ *
+ * @author Jody Hagins <jody@atdesk.com>
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ *
+ */
+#ifndef TAO_PERF_RTEC_RIR_NARROW_H
+#define TAO_PERF_RTEC_RIR_NARROW_H
+
+#include "tao/ORB.h"
+#include "tao/Object.h"
+
+/**
+ * @class RIR_Narrow
+ *
+ * @brief Implement a helper method to narrow the results from
+ * resolve_initial_references.
+ *
+ */
+template<class Interface>
+class RIR_Narrow
+{
+public:
+ typedef ACE_TYPENAME Interface::_ptr_type Interface_ptr;
+ typedef ACE_TYPENAME Interface::_var_type Interface_var;
+
+ static Interface_ptr resolve (CORBA::ORB_ptr orb,
+ const char *object_id
+ ACE_ENV_ARG_DECL);
+};
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "RIR_Narrow.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#endif /* TAO_PERF_RTEC_RIR_NARROW_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTCORBA_Setup.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTCORBA_Setup.cpp
new file mode 100644
index 00000000000..b5c6d99ae37
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTCORBA_Setup.cpp
@@ -0,0 +1,82 @@
+/**
+ * @file RTCORBA_Setup.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "RTCORBA_Setup.h"
+#include "RIR_Narrow.h"
+#include "RT_Class.h"
+
+#include "ace/Log_Msg.h"
+
+#if !defined(__ACE_INLINE__)
+#include "RTCORBA_Setup.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ RTCORBA_Setup,
+ "$Id$")
+
+RTCORBA_Setup::RTCORBA_Setup (CORBA::ORB_ptr orb,
+ const RT_Class &rtclass,
+ int nthreads
+ ACE_ENV_ARG_DECL)
+ : lanes_ (3)
+{
+ this->priority_mapping_manager_ =
+ RIR_Narrow<RTCORBA::PriorityMappingManager>::resolve (orb,
+ "PriorityMappingManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->priority_mapping_ =
+ this->priority_mapping_manager_->mapping ();
+
+ RTCORBA::Current_var current =
+ RIR_Narrow<RTCORBA::Current>::resolve (orb,
+ "RTCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RTCORBA::Priority corba_prc_priority;
+ this->priority_mapping_->to_CORBA (rtclass.priority_process (),
+ corba_prc_priority);
+
+ current->the_priority (corba_prc_priority
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->lanes_.length (3);
+
+ this->setup_lane (rtclass.priority_high (),
+ this->lanes_[0]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->setup_lane (rtclass.priority_process (),
+ this->lanes_[1]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->setup_lane (rtclass.priority_low (),
+ this->lanes_[2]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->lanes_[2].static_threads = nthreads;
+
+ this->process_priority_ = this->lanes_[1].lane_priority;
+}
+
+void
+RTCORBA_Setup::setup_lane (int priority,
+ RTCORBA::ThreadpoolLane &lane
+ ACE_ENV_ARG_DECL)
+{
+ if (!this->priority_mapping_->to_CORBA (priority,
+ lane.lane_priority))
+ ACE_THROW (CORBA::BAD_PARAM ());
+
+ lane.static_threads = 1;
+ lane.dynamic_threads = 0;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTCORBA_Setup.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTCORBA_Setup.h
new file mode 100644
index 00000000000..96f7c487daf
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTCORBA_Setup.h
@@ -0,0 +1,63 @@
+/**
+ * @file RTCORBA_Setup.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_RTCORBA_SETUP_H
+#define TAO_PERF_RTEC_RTCORBA_SETUP_H
+
+#include "rtec_perf_export.h"
+#include "tao/RTCORBA/RTCORBA.h"
+#include "tao/RTCORBA/Priority_Mapping_Manager.h"
+#include "ace/Auto_Ptr.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class RT_Class;
+
+/**
+ * @class RTCORBA_Setup
+ *
+ * @brief Simplify the initialization of performance tests.
+ *
+ */
+class TAO_RTEC_Perf_Export RTCORBA_Setup
+{
+public:
+ /// Constructor
+ RTCORBA_Setup (CORBA::ORB_ptr orb,
+ const RT_Class &rtclass,
+ int nthreads
+ ACE_ENV_ARG_DECL);
+
+ /// Return the thread pool lanes appropriate for the benchamrks
+ const RTCORBA::ThreadpoolLanes & lanes (void) const;
+
+ /// Return the priority of the process
+ RTCORBA::Priority process_priority (void) const;
+
+private:
+ void setup_lane (int priority, RTCORBA::ThreadpoolLane &lane
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS );
+
+private:
+ RTCORBA::PriorityMappingManager_var priority_mapping_manager_;
+
+ RTCORBA::ThreadpoolLanes lanes_;
+
+ RTCORBA::Priority process_priority_;
+
+ /// Just a plain pointer, the ORB owns the memory...
+ RTCORBA::PriorityMapping *priority_mapping_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "RTCORBA_Setup.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_PERF_RTEC_RTCORBA_SETUP_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTCORBA_Setup.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTCORBA_Setup.inl
new file mode 100644
index 00000000000..e63b68593e3
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTCORBA_Setup.inl
@@ -0,0 +1,19 @@
+/**
+ * @file RTCORBA_Setup.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+ACE_INLINE const RTCORBA::ThreadpoolLanes &
+RTCORBA_Setup::lanes (void) const
+{
+ return this->lanes_;
+}
+
+ACE_INLINE RTCORBA::Priority
+RTCORBA_Setup::process_priority (void) const
+{
+ return this->process_priority_;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTClient_Setup.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTClient_Setup.cpp
new file mode 100644
index 00000000000..6e3d06125f6
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTClient_Setup.cpp
@@ -0,0 +1,55 @@
+/**
+ * @file RTClient_Setup.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "RTClient_Setup.h"
+#include "RIR_Narrow.h"
+#include "tao/RTCORBA/RTCORBA.h"
+
+#include "ace/Log_Msg.h"
+
+#if !defined(__ACE_INLINE__)
+#include "RTClient_Setup.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ RTClient_Setup,
+ "$Id$")
+
+RTClient_Setup::RTClient_Setup (int use_rt_corba,
+ CORBA::ORB_ptr orb,
+ const RT_Class &rt_class,
+ int nthreads
+ ACE_ENV_ARG_DECL)
+ : use_rt_corba_ (use_rt_corba)
+ , syncscope_setup_ (orb ACE_ENV_ARG_PARAMETER)
+{
+ ACE_CHECK;
+
+ if (use_rt_corba)
+ {
+ ACE_AUTO_PTR_RESET (this->rtcorba_setup_,
+ new RTCORBA_Setup (orb,
+ rt_class,
+ nthreads
+ ACE_ENV_ARG_PARAMETER),
+ RTCORBA_Setup
+ );
+ ACE_CHECK;
+
+#if 0
+ ACE_AUTO_PTR_RESET (this->priorityband_setup_,
+ new PriorityBand_Setup (orb,
+ *this->rtcorba_setup_
+ ACE_ENV_ARG_PARAMETER),
+ PriorityBand_Setup
+ );
+ ACE_CHECK;
+
+#endif /* 0 */
+ }
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTClient_Setup.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTClient_Setup.h
new file mode 100644
index 00000000000..8bea1503961
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTClient_Setup.h
@@ -0,0 +1,59 @@
+/**
+ * @file RTClient_Setup.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_RTCLIENT_SETUP_H
+#define TAO_PERF_RTEC_RTCLIENT_SETUP_H
+#include /**/ "ace/pre.h"
+
+#include "RTCORBA_Setup.h"
+#include "PriorityBand_Setup.h"
+#include "SyncScope_Setup.h"
+#include "ace/Auto_Ptr.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class RT_Class;
+
+/**
+ * @class RTClient_Setup
+ *
+ * @brief Simplify the initialization of performance tests.
+ *
+ */
+class TAO_RTEC_Perf_Export RTClient_Setup
+{
+public:
+ /// Constructor
+ RTClient_Setup (int use_rt_corba,
+ CORBA::ORB_ptr orb,
+ const RT_Class &rt_class,
+ int nthreads
+ ACE_ENV_ARG_DECL);
+
+ /// Return non-zero if RTCORBA is enabled
+ int use_rt_corba (void) const;
+
+ /// Return the underlying RTCORBA_Setup pointer
+ RTCORBA_Setup *rtcorba_setup (void);
+
+private:
+ int use_rt_corba_;
+
+ auto_ptr<RTCORBA_Setup> rtcorba_setup_;
+ auto_ptr<PriorityBand_Setup> priorityband_setup_;
+ SyncScope_Setup syncscope_setup_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "RTClient_Setup.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_PERF_RTEC_RTCLIENT_SETUP_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTClient_Setup.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTClient_Setup.inl
new file mode 100644
index 00000000000..7e7eebf1254
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTClient_Setup.inl
@@ -0,0 +1,19 @@
+/**
+ * @file RTClient_Setup.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+ACE_INLINE int
+RTClient_Setup::use_rt_corba (void) const
+{
+ return this->use_rt_corba_;
+}
+
+ACE_INLINE RTCORBA_Setup *
+RTClient_Setup::rtcorba_setup (void)
+{
+ return this->rtcorba_setup_.get ();
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Initializer.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Initializer.cpp
new file mode 100644
index 00000000000..408b52b3557
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Initializer.cpp
@@ -0,0 +1,47 @@
+/**
+ * @file RTEC_Initializer.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "RTEC_Initializer.h"
+#include "RTCORBA_Setup.h"
+
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "orbsvcs/Event/EC_RTCORBA_Factory.h"
+
+#include "ace/Dynamic_Service.h"
+
+ACE_RCSID (TAO_PERF_RTEC,
+ RTEC_Initializer,
+ "$Id$")
+
+TAO_EC_Event_Channel *
+RTEC_Initializer::create (PortableServer::POA_ptr consumer_poa,
+ PortableServer::POA_ptr supplier_poa,
+ RTCORBA_Setup * rtcorba_setup
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ TAO_EC_Event_Channel_Attributes attr (consumer_poa,
+ supplier_poa);
+
+ if (rtcorba_setup == 0)
+ {
+ return new TAO_EC_Event_Channel (attr);
+ }
+
+ TAO_EC_Factory *body =
+ ACE_Dynamic_Service<TAO_EC_Factory>::instance ("EC_Factory");
+ auto_ptr<TAO_EC_Factory> factory (
+ new TAO_EC_RTCORBA_Factory (body,
+ rtcorba_setup->lanes ()));
+
+ TAO_EC_Event_Channel *ec =
+ new TAO_EC_Event_Channel (attr, factory.get (), 1);
+ factory.release ();
+
+ return ec;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Initializer.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Initializer.h
new file mode 100644
index 00000000000..64645bcbf18
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Initializer.h
@@ -0,0 +1,44 @@
+/**
+ * @file RTEC_Initializer.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_RTEC_INITIALIZER_H
+#define TAO_PERF_RTEC_RTEC_INITIALIZER_H
+
+#include "rtec_perf_export.h"
+#include "tao/ORB.h"
+#include "tao/RTCORBA/RTCORBA.h"
+#include "tao/PortableServer/PortableServer.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 RTCORBA_Setup;
+
+/**
+ * @class RTEC_Initializer
+ *
+ * @brief Implement a helper method to initialize and instance of
+ * TAO's Real-time Event Service
+ *
+ */
+class TAO_RTEC_Perf_Export RTEC_Initializer
+{
+public:
+ /// Return a new event channel
+ static TAO_EC_Event_Channel *create (PortableServer::POA_ptr consumer_poa,
+ PortableServer::POA_ptr supplier_poa,
+ RTCORBA_Setup *rtcorba_setup
+ ACE_ENV_ARG_DECL);
+};
+
+#endif /* TAO_PERF_RTEC_RTEC_INITIALIZER_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Perf.mpc b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Perf.mpc
new file mode 100644
index 00000000000..c73d8a6a356
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Perf.mpc
@@ -0,0 +1,16 @@
+// $Id$
+
+project(RTEC_Perf): strategies, rtcorbaevent, minimum_corba {
+ sharedname = TAO_RTEC_Perf
+ idlflags += -Wb,export_macro=TAO_RTEC_Perf_Export -Wb,export_include=rtec_perf_export.h
+ dynamicflags += TAO_RTEC_PERF_BUILD_DLL
+
+ Template_Files {
+ Auto_Disconnect.cpp
+ Low_Priority_Setup.cpp
+ RIR_Narrow.cpp
+ Servant_var.cpp
+ Shutdown.cpp
+ Task_Activator.cpp
+ }
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTPOA_Setup.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTPOA_Setup.cpp
new file mode 100644
index 00000000000..fdaaee06d30
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTPOA_Setup.cpp
@@ -0,0 +1,100 @@
+/**
+ * @file RTPOA_Setup.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "RTPOA_Setup.h"
+#include "RIR_Narrow.h"
+#include "RTCORBA_Setup.h"
+#include "tao/RTCORBA/RTCORBA.h"
+
+#include "ace/Log_Msg.h"
+
+#if !defined(__ACE_INLINE__)
+#include "RTPOA_Setup.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ RTPOA_Setup,
+ "$Id$")
+
+RTPOA_Setup::RTPOA_Setup (CORBA::ORB_ptr orb,
+ const RTCORBA_Setup &rtcorba_setup
+ ACE_ENV_ARG_DECL)
+{
+ RTPortableServer::POA_var root_poa =
+ RIR_Narrow<RTPortableServer::POA>::resolve (orb,
+ "RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RTCORBA::RTORB_var rtorb =
+ RIR_Narrow<RTCORBA::RTORB>::resolve (orb,
+ "RTORB"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const CORBA::ULong stacksize = 1024 * 1024; // 1 Mb
+ const RTCORBA::ThreadpoolLanes &lanes = rtcorba_setup.lanes ();
+ const CORBA::Boolean allow_borrowing = 0;
+ const CORBA::Boolean allow_request_buffering = 0;
+ const CORBA::ULong max_buffered_requests = 0; // dummy value
+ const CORBA::ULong max_request_buffer_size = 0; // dummy value
+
+ RTCORBA::ThreadpoolId pool_id =
+ rtorb->create_threadpool_with_lanes (stacksize,
+ lanes,
+ allow_borrowing,
+ allow_request_buffering,
+ max_buffered_requests,
+ max_request_buffer_size
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ We need an 'auto_ptr for thread pools' here!
+ CORBA::PolicyList policies (4); policies.length (4);
+ policies[0] =
+ rtorb->create_priority_model_policy (RTCORBA::CLIENT_PROPAGATED,
+ rtcorba_setup.process_priority ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ policies[1] =
+ root_poa->create_id_assignment_policy (PortableServer::SYSTEM_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ policies[2] =
+ root_poa->create_implicit_activation_policy (PortableServer::IMPLICIT_ACTIVATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+#if 0
+ policies.length (3);
+#else
+ policies[3] =
+ rtorb->create_threadpool_policy (pool_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+#endif /* 0 */
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->poa_ =
+ root_poa->create_POA ("RTEC_Perf",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ for (CORBA::ULong i = 0; i != policies.length (); ++i)
+ {
+ policies[i]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTPOA_Setup.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTPOA_Setup.h
new file mode 100644
index 00000000000..dc3d19f0054
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTPOA_Setup.h
@@ -0,0 +1,45 @@
+/**
+ * @file RTPOA_Setup.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_RTPOA_SETUP_H
+#define TAO_PERF_RTEC_RTPOA_SETUP_H
+
+#include "rtec_perf_export.h"
+#include "tao/RTPortableServer/RTPortableServer.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class RTCORBA_Setup;
+
+/**
+ * @class RTPOA_Setup
+ *
+ * @brief Simplify the initialization of performance tests.
+ *
+ */
+class TAO_RTEC_Perf_Export RTPOA_Setup
+{
+public:
+ /// Constructor
+ RTPOA_Setup (CORBA::ORB_ptr orb,
+ const RTCORBA_Setup &rtcorba_setup
+ ACE_ENV_ARG_DECL);
+
+ PortableServer::POA_ptr poa (void);
+
+private:
+ PortableServer::POA_var poa_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "RTPOA_Setup.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_PERF_RTEC_RTPOA_SETUP_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTPOA_Setup.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTPOA_Setup.inl
new file mode 100644
index 00000000000..1cbd13ca230
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTPOA_Setup.inl
@@ -0,0 +1,13 @@
+/**
+ * @file RTPOA_Setup.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+ACE_INLINE PortableServer::POA_ptr
+RTPOA_Setup::poa (void)
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTServer_Setup.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTServer_Setup.cpp
new file mode 100644
index 00000000000..609f8f7b314
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTServer_Setup.cpp
@@ -0,0 +1,57 @@
+/**
+ * @file RTServer_Setup.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "RTServer_Setup.h"
+#include "RIR_Narrow.h"
+#include "tao/RTCORBA/RTCORBA.h"
+
+#include "ace/Log_Msg.h"
+
+#if !defined(__ACE_INLINE__)
+#include "RTServer_Setup.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ RTServer_Setup,
+ "$Id$")
+
+RTServer_Setup::RTServer_Setup (int use_rt_corba,
+ CORBA::ORB_ptr orb,
+ const RT_Class &rt_class,
+ int nthreads
+ ACE_ENV_ARG_DECL)
+ : RTClient_Setup (use_rt_corba,
+ orb,
+ rt_class,
+ nthreads
+ ACE_ENV_ARG_PARAMETER)
+{
+ ACE_CHECK;
+
+ if (use_rt_corba)
+ {
+ ACE_AUTO_PTR_RESET (this->rtpoa_setup_,
+ new RTPOA_Setup (orb,
+ *this->rtcorba_setup ()
+ ACE_ENV_ARG_PARAMETER),
+ RTPOA_Setup
+ );
+ ACE_CHECK;
+
+ this->poa_ =
+ this->rtpoa_setup_->poa ();
+ }
+ else
+ {
+ this->poa_ =
+ RIR_Narrow<RTPortableServer::POA>::resolve (orb,
+ "RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTServer_Setup.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTServer_Setup.h
new file mode 100644
index 00000000000..eecc21ec6f8
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTServer_Setup.h
@@ -0,0 +1,50 @@
+/**
+ * @file RTServer_Setup.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_RTSERVER_SETUP_H
+#define TAO_PERF_RTEC_RTSERVER_SETUP_H
+#include /**/ "ace/pre.h"
+
+#include "RTClient_Setup.h"
+#include "RTPOA_Setup.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class RTServer_Setup
+ *
+ * @brief Simplify the initialization of performance tests.
+ *
+ */
+class TAO_RTEC_Perf_Export RTServer_Setup : public RTClient_Setup
+{
+public:
+ /// Constructor
+ RTServer_Setup (int use_rt_corba,
+ CORBA::ORB_ptr orb,
+ const RT_Class &rt_class,
+ int nthreads
+ ACE_ENV_ARG_DECL);
+
+ /// Return the POA configured by the RTPOA_Setup
+ PortableServer::POA_ptr poa (void);
+
+private:
+ PortableServer::POA_var poa_;
+
+ auto_ptr<RTPOA_Setup> rtpoa_setup_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "RTServer_Setup.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_PERF_RTEC_RTSERVER_SETUP_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTServer_Setup.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTServer_Setup.inl
new file mode 100644
index 00000000000..40816da97c0
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTServer_Setup.inl
@@ -0,0 +1,13 @@
+/**
+ * @file RTServer_Setup.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+ACE_INLINE PortableServer::POA_ptr
+RTServer_Setup::poa (void)
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.cpp
new file mode 100644
index 00000000000..65abada52e8
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.cpp
@@ -0,0 +1,52 @@
+/**
+ * @file RT_Class.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "RT_Class.h"
+
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_errno.h"
+
+#if !defined(__ACE_INLINE__)
+#include "RT_Class.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ RT_Class,
+ "$Id$")
+
+RT_Class::RT_Class (void)
+ : prc_sched_class_ (ACE_SCHED_FIFO)
+ , thr_sched_class_ (THR_SCHED_FIFO)
+{
+ int priority =
+ (ACE_Sched_Params::priority_min (this->prc_sched_class_)
+ + ACE_Sched_Params::priority_max (this->prc_sched_class_)) / 2;
+
+ if (ACE_OS::sched_params (ACE_Sched_Params (this->prc_sched_class_,
+ priority,
+ ACE_SCOPE_PROCESS)) != 0)
+ {
+ if (ACE_OS::last_error () == EPERM)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "WARNING (%P|%t) user does not have "
+ "permissions to run real-time tests.\n"
+ "The test will run in the time-shared "
+ "class, it may fail or produce unpredictable "
+ "results\n"));
+ this->prc_sched_class_ = ACE_SCHED_OTHER;
+ this->thr_sched_class_ = THR_SCHED_DEFAULT;
+ }
+ }
+ this->priority_low_ =
+ ACE_Sched_Params::priority_min (this->prc_sched_class_);
+ this->priority_high_ =
+ ACE_Sched_Params::priority_max (this->prc_sched_class_);
+ this->priority_process_ =
+ (this->priority_low_ + this->priority_high_) / 2;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.h
new file mode 100644
index 00000000000..d4dd0888362
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.h
@@ -0,0 +1,74 @@
+/**
+ * @file RT_Class.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_RT_CLASS_H
+#define TAO_PERF_RTEC_RT_CLASS_H
+
+#include "rtec_perf_export.h"
+#include "ace/Sched_Params.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class RT_Class
+ *
+ * @brief Simplify the initialization of performance tests.
+ *
+ */
+class TAO_RTEC_Perf_Export RT_Class
+{
+public:
+ /// Constructor
+ RT_Class (void);
+
+ /** @name Return the test scheduling parameters
+ */
+ //@{
+ /// Return the process scheduling class selected for the test
+ int prc_sched_class (void) const;
+
+ /// Return the thread scheduling class selected for the test
+ int thr_sched_class (void) const;
+
+ /// Return the process priority selected for the test
+ int priority_process (void) const;
+
+ /// Return the (thread, native) priority for the high priority
+ /// task(s) in the test
+ int priority_high (void) const;
+
+ /// Return the (thread, native) priority for the low priority
+ /// task(s) in the test
+ int priority_low (void) const;
+
+ //@}
+
+private:
+ /// The process scheduling class
+ int prc_sched_class_;
+
+ /// The thread scheduling class
+ int thr_sched_class_;
+
+ /// The process priority
+ int priority_process_;
+
+ /// The high priority task(s) priority
+ int priority_high_;
+
+ /// The low priority task(s) priority
+ int priority_low_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "RT_Class.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_PERF_RTEC_RT_CLASS_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.inl
new file mode 100644
index 00000000000..a6a60d8e7a0
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RT_Class.inl
@@ -0,0 +1,37 @@
+/**
+ * @file RT_Class.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+ACE_INLINE int
+RT_Class::prc_sched_class (void) const
+{
+ return this->prc_sched_class_;
+}
+
+ACE_INLINE int
+RT_Class::thr_sched_class (void) const
+{
+ return this->thr_sched_class_;
+}
+
+ACE_INLINE int
+RT_Class::priority_process (void) const
+{
+ return this->priority_process_;
+}
+
+ACE_INLINE int
+RT_Class::priority_high (void) const
+{
+ return this->priority_high_;
+}
+
+ACE_INLINE int
+RT_Class::priority_low (void) const
+{
+ return this->priority_low_;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task.cpp
new file mode 100644
index 00000000000..125e75c85e7
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task.cpp
@@ -0,0 +1,130 @@
+/**
+ * @file Send_Task.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "Send_Task.h"
+
+#include "orbsvcs/Time_Utilities.h"
+
+#include "ace/Barrier.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (TAO_PERF_RTEC,
+ Send_Task,
+ "$Id$")
+
+Send_Task::Send_Task (void)
+ : iterations_ (0)
+ , period_in_usecs_ (0)
+ , startup_sleep_ (0)
+ , event_type_ (0)
+ , event_source_ (0)
+ , barrier_ (0)
+ , stop_ (0)
+{
+}
+
+void
+Send_Task::init (int iterations,
+ int period_in_usecs,
+ int startup_sleep,
+ int event_type,
+ int event_source,
+ Supplier *supplier,
+ ACE_Barrier *barrier)
+{
+ this->iterations_ = iterations;
+ this->period_in_usecs_ = period_in_usecs;
+ this->startup_sleep_ = startup_sleep;
+ this->event_type_ = event_type;
+ this->event_source_ = event_source;
+ this->supplier_ =
+ TAO::Utils::Servant_Var<Supplier>::_duplicate (supplier);
+ this->barrier_ = barrier;
+}
+
+void
+Send_Task::stop (void)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ this->stop_ = 1;
+}
+
+int
+Send_Task::svc (void)
+{
+ if (this->barrier_ == 0)
+ return -1;
+
+ this->barrier_->wait ();
+
+ ACE_Time_Value startup (0, this->startup_sleep_);
+ ACE_OS::sleep (startup);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) - Thread started, "
+ "iterations = %d, period = %d, event_type = %d\n",
+ this->iterations_, this->period_in_usecs_,
+ this->event_type_));
+
+
+ int start_i = 0;
+ if (this->iterations_ == 0)
+ {
+ // Starting from 1 results in an infinite loop (well, so long
+ // that I call it infinite), which is exactly what we want, kind
+ // of hackish, oh well.
+ start_i = 1;
+ }
+
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+ event[0].header.type = this->event_type_;
+ event[0].header.source = this->event_source_;
+ event[0].header.ttl = 1;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ for (int i = start_i; i != this->iterations_; ++i)
+ {
+ if ((i + 1) % 1000 == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) - Thread has sent %d messages @ %T\n",
+ i + 1));
+ }
+
+ ACE_Time_Value period (0, this->period_in_usecs_);
+ ACE_OS::sleep (period);
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, -1);
+ if (this->stop_ != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) - Thread has been stopped\n"));
+ return 0;
+ }
+ }
+ ACE_hrtime_t creation = ACE_OS::gethrtime ();
+ ORBSVCS_Time::hrtime_to_TimeT (event[0].header.creation_time,
+ creation);
+ ACE_TRY
+ {
+ // push one event...
+ this->supplier_->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ }
+ ACE_ENDTRY;
+ }
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) - Thread finished\n"));
+ return 0;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task.h
new file mode 100644
index 00000000000..318bb24e2aa
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task.h
@@ -0,0 +1,78 @@
+/**
+ * @file Send_Task.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_SEND_TASK_H
+#define TAO_PERF_RTEC_SEND_TASK_H
+
+#include "tao/Utils/Servant_Var.h"
+#include "Supplier.h"
+#include "ace/Task.h"
+#include "ace/Synch_Traits.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Barrier;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class Send_Task
+ *
+ * @brief Implement a simple ACE_Task to send the events
+ *
+ */
+class TAO_RTEC_Perf_Export Send_Task : public ACE_Task_Base
+{
+public:
+ /// Constructor
+ Send_Task (void);
+
+ /// This is for compilers that are a PITA complaining that we are
+ /// hiding something.
+ virtual int init (int argc, ACE_TCHAR *argv[])
+ {
+ return ACE_Task_Base::init (argc, argv);
+ }
+
+ void init (int iterations,
+ int period_in_usecs,
+ int startup_sleep,
+ int event_type,
+ int event_source,
+ Supplier *supplier,
+ ACE_Barrier *barrier);
+
+ /// Run the experiment
+ int svc (void);
+
+ /// Stop the experiment
+ void stop (void);
+
+private:
+ int iterations_;
+
+ int period_in_usecs_;
+
+ int startup_sleep_;
+
+ int event_type_;
+
+ int event_source_;
+
+ TAO::Utils::Servant_Var<Supplier> supplier_;
+
+ ACE_Barrier *barrier_;
+
+ TAO_SYNCH_MUTEX mutex_;
+ int stop_;
+};
+
+
+#endif /* TAO_PERF_RTEC_SEND_TASK_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task_Stopper.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task_Stopper.cpp
new file mode 100644
index 00000000000..6b8779e632e
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task_Stopper.cpp
@@ -0,0 +1,24 @@
+/**
+ * @file Send_Task_Stopper.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "Send_Task_Stopper.h"
+
+#if !defined(__ACE_INLINE__)
+#include "Send_Task_Stopper.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ Send_Task_Stopper,
+ "$Id$")
+
+Send_Task_Stopper::~Send_Task_Stopper (void)
+{
+ if (this->task_ == 0)
+ return;
+ this->task_->stop ();
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task_Stopper.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task_Stopper.h
new file mode 100644
index 00000000000..3212409700c
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task_Stopper.h
@@ -0,0 +1,41 @@
+/**
+ * @file Send_Task_Stopper.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_SEND_TASK_STOPPER_H
+#define TAO_PERF_RTEC_SEND_TASK_STOPPER_H
+
+#include "Send_Task.h"
+#include "Task_Activator.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Send_Task_Stopper
+ *
+ * @brief Implement a helper class to activate and stop Send_Tasks.
+ *
+ */
+class TAO_RTEC_Perf_Export Send_Task_Stopper : public Task_Activator<Send_Task>
+{
+public:
+ /// Constructor
+ Send_Task_Stopper (int priority,
+ int scheduling_class,
+ Send_Task *task);
+
+ /// Destructor, stop the task and wait for it
+ ~Send_Task_Stopper (void);
+};
+
+#if defined(__ACE_INLINE__)
+#include "Send_Task_Stopper.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_PERF_RTEC_SEND_TASK_STOPPER_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task_Stopper.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task_Stopper.inl
new file mode 100644
index 00000000000..b620c992a2d
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Send_Task_Stopper.inl
@@ -0,0 +1,16 @@
+/**
+ * @file Send_Task_Stopper.inl
+ *
+` * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+ACE_INLINE
+Send_Task_Stopper::Send_Task_Stopper (int priority,
+ int scheduling_class,
+ Send_Task *task)
+ : Task_Activator<Send_Task> (priority, scheduling_class, 1,
+ task)
+{
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Servant_var.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Servant_var.cpp
new file mode 100644
index 00000000000..7e154ad088b
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Servant_var.cpp
@@ -0,0 +1,58 @@
+/**
+ * @file Servant_var.cpp
+ *
+ * $Id$
+ *
+ * @author Jody Hagins <jody@atdesk.com>
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+#ifndef TAO_PERF_RTEC_SERVANT_VAR_CPP
+#define TAO_PERF_RTEC_SERVANT_VAR_CPP
+
+#include "Servant_var.h"
+#include "tao/Environment.h"
+
+#if !defined(__ACE_INLINE__)
+#include "Servant_var.inl"
+#endif /* __ACE_INLINE__ */
+
+template<class SERVANT>
+Servant_var<SERVANT>::~Servant_var ()
+{
+ if (this->ptr_ == 0)
+ return;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY {
+ this->ptr_->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ } ACE_CATCHANY {
+ // @@ TODO This event should be logged. Cannot throw because that
+ // would make it impossible to use this class effectively.
+ //
+ // Suggested implementation:
+ //
+ // class Servant_Logger {
+ // public:
+ // static void log_error (void *servant_pointer)
+ // {
+ // if (Servant_Logger::instance_ == 0)
+ // return;
+ // Servant_Logger::instance_->logger_implementation (servant_pointer);
+ // }
+ // static Servant_Logger *set_instance (Servant_Logger*);
+ //
+ // virtual void logger_implementation (void *servant_pointer) = 0;
+ //
+ // private:
+ // static Servant_Logger *instance_;
+ // };
+ //
+ // Using an abstract class for logging decouples the code from any
+ // particular implementation, and provides a light-weight,
+ // high-performance solution for applications that want to avoid
+ // logging.
+ } ACE_ENDTRY;
+}
+
+#endif /* TAO_PERF_RTEC_SERVANT_VAR_CPP */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Servant_var.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Servant_var.h
new file mode 100644
index 00000000000..4d035f8b43c
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Servant_var.h
@@ -0,0 +1,81 @@
+/**
+ * @file Servant_var.h
+ *
+ * $Id$
+ *
+ * @author Jody Hagins <jody@atdesk.com>
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+#ifndef TAO_PERF_RTEC_SERVANT_VAR_H
+#define TAO_PERF_RTEC_SERVANT_VAR_H
+
+#include "ace/Swap.h"
+#include "tao/corba.h"
+
+/**
+ * @class Servant_var
+ *
+ * @brief Implement a smart pointer class for Servants
+ *
+ * All servants, are reference counted objects.
+ * Unfortunately the specification lacks such an useful smart pointer
+ * class to manage their life-cycle.
+ */
+template<class SERVANT>
+class Servant_var
+{
+public:
+ /// Constructor
+ /**
+ * @param s The contained servant. The constructor assumes
+ * ownership.
+ */
+ explicit Servant_var (SERVANT *s = 0);
+
+ /// Copy constructor
+ Servant_var (const Servant_var<SERVANT> &rhs);
+
+ /// Assignment
+ Servant_var<SERVANT>& operator= (const Servant_var<SERVANT> &rhs);
+
+ /// Assignment
+ Servant_var<SERVANT>& operator= (SERVANT *s);
+
+ /// Destructor
+ ~Servant_var ();
+
+ /// Helper method to increase the reference count on a servant.
+ static SERVANT *duplicate (SERVANT *servart);
+
+ //@{
+ /** @name Smart pointer operations
+ */
+ const SERVANT * operator->() const;
+ SERVANT * operator->();
+
+ operator SERVANT *();
+ operator const SERVANT * () const;
+ //@}
+
+ //@{
+ /** @name Canonical CORBA T_var methods
+ */
+ SERVANT *in () const;
+ SERVANT *&out ();
+ SERVANT *&inout ();
+ //@}
+
+private:
+ /// The owned object
+ SERVANT *ptr_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "Servant_var.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "Servant_var.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#endif /* TAO_PERF_RTEC_SERVANT_VAR_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Servant_var.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/Servant_var.inl
new file mode 100644
index 00000000000..bc65b994d0d
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Servant_var.inl
@@ -0,0 +1,89 @@
+/**
+ * @file Servant_var.inl
+ *
+ * $Id$
+ *
+ * @author Jody Hagins <jody@atdesk.com>
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+template<class SERVANT> ACE_INLINE SERVANT *
+Servant_var<SERVANT>::duplicate (SERVANT *servant)
+{
+ if (servant != 0)
+ servant->_add_ref ();
+ return servant;
+}
+
+template<class SERVANT> ACE_INLINE
+Servant_var<SERVANT>::Servant_var (SERVANT *s)
+ : ptr_ (s)
+{
+}
+
+template<class SERVANT> ACE_INLINE
+Servant_var<SERVANT>::Servant_var (const Servant_var<SERVANT> &rhs)
+ : ptr_ (Servant_var<SERVANT>::duplicate (rhs.ptr_))
+{
+}
+
+template<class SERVANT> ACE_INLINE Servant_var<SERVANT>&
+Servant_var<SERVANT>::operator= (const Servant_var<SERVANT> &rhs)
+{
+ Servant_var<SERVANT> tmp (rhs);
+ ACE_Swap<SERVANT*>::swap (this->ptr_, tmp.ptr_);
+ return *this;
+}
+
+template<class SERVANT> ACE_INLINE Servant_var<SERVANT>&
+Servant_var<SERVANT>::operator= (SERVANT *rhs)
+{
+ Servant_var<SERVANT> tmp (rhs);
+ ACE_Swap<SERVANT*>::swap (this->ptr_, tmp.ptr_);
+ return *this;
+}
+
+template<class SERVANT> ACE_INLINE SERVANT*
+Servant_var<SERVANT>::operator-> ()
+{
+ return this->ptr_;
+}
+
+template<class SERVANT> ACE_INLINE const SERVANT*
+Servant_var<SERVANT>::operator-> () const
+{
+ return this->ptr_;
+}
+
+template<class SERVANT> ACE_INLINE
+Servant_var<SERVANT>::operator SERVANT *()
+{
+ return this->ptr_;
+}
+
+template<class SERVANT> ACE_INLINE
+Servant_var<SERVANT>::operator const SERVANT * () const
+{
+ return this->ptr_;
+}
+
+template<class SERVANT> ACE_INLINE SERVANT *
+Servant_var<SERVANT>::in () const
+{
+ return this->ptr_;
+}
+
+template<class SERVANT> ACE_INLINE SERVANT *&
+Servant_var<SERVANT>::out ()
+{
+ Servant_var<SERVANT> tmp;
+ ACE_Swap<SERVANT*>::swap (tmp.ptr_, this->ptr_);
+
+ return this->ptr_;
+}
+
+template<class SERVANT> ACE_INLINE SERVANT *&
+Servant_var<SERVANT>::inout ()
+{
+ return this->ptr_;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Shutdown.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Shutdown.cpp
new file mode 100644
index 00000000000..84d42ba3bc6
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Shutdown.cpp
@@ -0,0 +1,17 @@
+/**
+ * @file Shutdown.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+#ifndef TAO_PERF_RTEC_SHUTDOWN_CPP
+#define TAO_PERF_RTEC_SHUTDOWN_CPP
+
+#include "Shutdown.h"
+
+#if !defined(__ACE_INLINE__)
+#include "Shutdown.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_PERF_RTEC_SHUTDOWN_CPP */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Shutdown.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Shutdown.h
new file mode 100644
index 00000000000..d0737b7bf01
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Shutdown.h
@@ -0,0 +1,34 @@
+/**
+ * @file Shutdown.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+#ifndef TAO_PERF_RTEC_SHUTDOWN_H
+#define TAO_PERF_RTEC_SHUTDOWN_H
+
+#include "ace/config-all.h"
+#include "ace/CORBA_macros.h"
+
+/**
+ * @class Shutdown
+ *
+ * @brief Helper functor to call the shutdown() method of a class.
+ */
+template<class Client>
+class Shutdown
+{
+public:
+ void operator() (Client *client);
+};
+
+#if defined(__ACE_INLINE__)
+#include "Shutdown.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "Shutdown.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#endif /* TAO_PERF_RTEC_SHUTDOWN_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Shutdown.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/Shutdown.inl
new file mode 100644
index 00000000000..aa5af0895cb
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Shutdown.inl
@@ -0,0 +1,20 @@
+/**
+ * @file Shutdown.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+template<class Client> ACE_INLINE void
+Shutdown<Client>::operator () (Client *client)
+{
+ ACE_DECLARE_NEW_ENV;
+ ACE_TRY
+ {
+ client->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY { };
+ ACE_ENDTRY;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Supplier.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Supplier.cpp
new file mode 100644
index 00000000000..11c14e80232
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Supplier.cpp
@@ -0,0 +1,121 @@
+/**
+ * @file Supplier.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "Supplier.h"
+#include "Implicit_Deactivator.h"
+
+ACE_RCSID (TAO_PERF_RTEC,
+ Supplier,
+ "$Id$")
+
+Supplier::Supplier (CORBA::Long experiment_id,
+ CORBA::Long event_type,
+ CORBA::Long event_range,
+ PortableServer::POA_ptr poa)
+ : experiment_id_ (experiment_id)
+ , event_type_ (event_type)
+ , event_range_ (event_range)
+ , default_POA_ (PortableServer::POA::_duplicate (poa))
+{
+}
+
+void
+Supplier::connect (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (!CORBA::is_nil (this->proxy_consumer_.in ()))
+ return;
+
+ this->proxy_consumer_ =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ RtecEventComm::PushSupplier_var supplier =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::SupplierQOS supplier_qos;
+ supplier_qos.is_gateway = 0;
+ supplier_qos.publications.length (this->event_range_);
+ for (CORBA::Long i = 0; i != this->event_range_; ++i)
+ {
+ RtecEventComm::EventHeader& sh =
+ supplier_qos.publications[i].event.header;
+ sh.type = this->event_type_ + 2 * i;
+ sh.source = this->experiment_id_;
+ }
+
+ this->proxy_consumer_->connect_push_supplier (supplier.in (),
+ supplier_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Supplier::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy;
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (CORBA::is_nil (this->proxy_consumer_.in ()))
+ return;
+ proxy = this->proxy_consumer_._retn ();
+ }
+
+ Implicit_Deactivator deactivator (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TRY
+ {
+ proxy->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY {} ACE_ENDTRY;
+}
+
+void
+Supplier::push (const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // ACE_DEBUG ((LM_DEBUG, "Supplier pushing (%d,%d)\n",
+ // events[0].header.type, events[0].header.source));
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy;
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (CORBA::is_nil (this->proxy_consumer_.in ()))
+ return;
+ proxy = this->proxy_consumer_;
+ }
+
+ proxy->push (events ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ this->proxy_consumer_ =
+ RtecEventChannelAdmin::ProxyPushConsumer::_nil ();
+}
+
+PortableServer::POA_ptr
+Supplier::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Supplier.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Supplier.h
new file mode 100644
index 00000000000..4ae8d76a414
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Supplier.h
@@ -0,0 +1,81 @@
+/**
+ * @file Supplier.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_SUPPLIER_H
+#define TAO_PERF_RTEC_SUPPLIER_H
+
+#include "rtec_perf_export.h"
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Supplier
+ *
+ * @brief Implement a simple supplier to keep track of the latency
+ *
+ */
+class TAO_RTEC_Perf_Export Supplier
+ : public virtual POA_RtecEventComm::PushSupplier
+{
+public:
+ /// Constructor
+ /**
+ * The experiment ID is used to configure the supplier ID on the
+ * publication.
+ */
+ Supplier (CORBA::Long experiment_id,
+ CORBA::Long event_type,
+ CORBA::Long event_range,
+ PortableServer::POA_ptr poa);
+
+ /// Connect to the event channel
+ void connect (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+
+ /// Disconnect from the event channel
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ void push (const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ //@{
+ /** @name The RtecEventComm::PushSupplier methods
+ */
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+private:
+ /// The experiment id
+ /// Synchronize access to the internal data
+ TAO_SYNCH_MUTEX mutex_;
+
+ /// The experiment id
+ CORBA::Long experiment_id_;
+
+ /// The event type
+ CORBA::Long event_type_;
+
+ /// The event type
+ CORBA::Long event_range_;
+
+ /// The proxy this object is connected to
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy_consumer_;
+
+ /// The default poa
+ PortableServer::POA_var default_POA_;
+};
+
+#endif /* TAO_PERF_RTEC_SUPPLIER_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/SyncScope_Setup.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/SyncScope_Setup.cpp
new file mode 100644
index 00000000000..b0f66d12d9e
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/SyncScope_Setup.cpp
@@ -0,0 +1,71 @@
+/**
+ * @file SyncScope_Setup.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#include "SyncScope_Setup.h"
+#include "RIR_Narrow.h"
+#include "tao/AnyTypeCode/Any.h"
+
+#if !defined(__ACE_INLINE__)
+#include "SyncScope_Setup.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (TAO_PERF_RTEC,
+ SyncScope_Setup,
+ "$Id$")
+
+SyncScope_Setup::SyncScope_Setup (CORBA::ORB_ptr orb,
+ Messaging::SyncScope value
+ ACE_ENV_ARG_DECL)
+{
+ this->init (orb, value
+ ACE_ENV_ARG_PARAMETER);
+}
+
+SyncScope_Setup::SyncScope_Setup (CORBA::ORB_ptr orb
+ ACE_ENV_ARG_DECL)
+{
+ this->init (orb, Messaging::SYNC_WITH_TARGET
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+SyncScope_Setup::init (CORBA::ORB_ptr orb,
+ Messaging::SyncScope value
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::PolicyManager_var policy_manager =
+ RIR_Narrow<CORBA::PolicyManager>::resolve (orb,
+ "ORBPolicyManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::PolicyList policy_list (1);
+ policy_list.length (1);
+
+ CORBA::Any sync_scope;
+ sync_scope <<= value;
+
+ // @@ We need a helper class that automatically calls the
+ // destroy() method on each policy...
+ policy_list[0] =
+ orb->create_policy (Messaging::SYNC_SCOPE_POLICY_TYPE,
+ sync_scope
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ policy_manager->set_policy_overrides (policy_list,
+ CORBA::ADD_OVERRIDE
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ policy_list[0]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+SyncScope_Setup::~SyncScope_Setup (void)
+{
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/SyncScope_Setup.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/SyncScope_Setup.h
new file mode 100644
index 00000000000..9de943cc419
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/SyncScope_Setup.h
@@ -0,0 +1,53 @@
+/**
+ * @file SyncScope_Setup.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_SYNCSCOPE_SETUP_H
+#define TAO_PERF_RTEC_SYNCSCOPE_SETUP_H
+
+#include "rtec_perf_export.h"
+#include "tao/Messaging/Messaging.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class SyncScope_Setup
+ *
+ * @brief Simplify the initialization of performance tests.
+ *
+ */
+class TAO_RTEC_Perf_Export SyncScope_Setup
+{
+public:
+ /// Constructor
+ SyncScope_Setup (CORBA::ORB_ptr orb
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ SyncScope_Setup (CORBA::ORB_ptr orb,
+ Messaging::SyncScope value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /// Destructor
+ /**
+ * It is a no-op, but it shuts up g++
+ */
+ ~SyncScope_Setup (void);
+
+private:
+ /// Implement the shared code between both constructors
+ void init (CORBA::ORB_ptr orb,
+ Messaging::SyncScope value
+ ACE_ENV_ARG_DECL);
+};
+
+#if defined(__ACE_INLINE__)
+#include "SyncScope_Setup.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_PERF_RTEC_SYNCSCOPE_SETUP_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/SyncScope_Setup.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/SyncScope_Setup.inl
new file mode 100644
index 00000000000..1b47e4a8abf
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/SyncScope_Setup.inl
@@ -0,0 +1,7 @@
+/**
+ * @file SyncScope_Setup.inl
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Task_Activator.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Task_Activator.cpp
new file mode 100644
index 00000000000..3eb00cee362
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Task_Activator.cpp
@@ -0,0 +1,55 @@
+/**
+ * @file Task_Activator.cpp
+ *
+ * $Id$
+ *
+ * @author Jody Hagins <jody@atdesk.com>
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+#ifndef TAO_PERF_RTEC_TASK_ACTIVATOR_CPP
+#define TAO_PERF_RTEC_TASK_ACTIVATOR_CPP
+
+#include "Task_Activator.h"
+#include "tao/Environment.h"
+#include "ace/Log_Msg.h"
+
+#if !defined(__ACE_INLINE__)
+#include "Task_Activator.inl"
+#endif /* __ACE_INLINE__ */
+
+template<class Task>
+Task_Activator<Task>::Task_Activator (int priority,
+ int scheduling_class,
+ int nthreads,
+ Task *task)
+ : task_ (task)
+{
+ if (this->task_ == 0)
+ return;
+
+ // We explicitly ignore errors, this is exactly what we do in the
+ // test anyway. In a generic class we would need to throw an
+ // exception.
+ if (this->task_->activate (scheduling_class | THR_NEW_LWP | THR_JOINABLE,
+ nthreads,
+ 1, // force_activation
+ priority) == -1)
+ {
+ // Release, we cannot wait for it or anything like that...
+ this->task_ = 0;
+ ACE_DEBUG ((LM_DEBUG,
+ "Task_Activator failed %p\n", ""));
+ }
+}
+
+template<class Task>
+Task_Activator<Task>::~Task_Activator (void)
+{
+ if (this->task_ == 0)
+ return;
+
+ // Wait until the task terminates
+ this->task_->wait ();
+}
+
+#endif /* TAO_PERF_RTEC_TASK_ACTIVATOR_CPP */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Task_Activator.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Task_Activator.h
new file mode 100644
index 00000000000..f2f78836c29
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Task_Activator.h
@@ -0,0 +1,86 @@
+/**
+ * @file Task_Activator.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+#ifndef TAO_PERF_RTEC_TASK_ACTIVATOR_H
+#define TAO_PERF_RTEC_TASK_ACTIVATOR_H
+
+#include "ace/Task.h"
+#include "ace/Copy_Disabled.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Task_Activator
+ *
+ * @brief Simplify the activation and destruction of tasks
+ *
+ */
+template<class Task>
+class Task_Activator : private ACE_Copy_Disabled
+{
+public:
+ /// Constructor
+ /**
+ * @todo If we were to define a generic ACE class for this then we
+ * should certainly change the constructor. For example, we
+ * should pass an structure with all the thread activation
+ * arguments, like:<BR>
+ * Activation_Properties properties;<BR>
+ * Task_Activator<Foo> activator (properties, foo);<BR>
+ * <BR>
+ * The advantage of using an structure instead of a long list
+ * of arguments is that the user can change some of the
+ * defaults without having to know all the other values, plus
+ * it evolves better: over time if arguments are added the
+ * client code does not change.<BR>
+ * <BR>
+ * With a little trickery we can even change the arguments in
+ * a single line:<BR>
+ * Activation_Properties props ().priority (x).stack_size (y);<BR>
+ * <BR>
+ * all you need to do is return <CODE>*this</CODE> from each
+ * modifier.
+ *
+ */
+ Task_Activator (int priority,
+ int scheduling_class,
+ int nthreads,
+ Task *task);
+
+ /// Destructor
+ /**
+ * Wait until the task terminates before returning, this is useful
+ * in programs that need to guarantee that the task object is not
+ * destroyed before the underlying threads finished.
+ * However, the use of this class implicitly requires that the task
+ * will eventually terminate!
+ *
+ * Sometimes it is better to derive from this class and implement a
+ * cooperative termination protocol in the destructor of the derived
+ * class.
+ */
+ ~Task_Activator (void);
+
+ /// Release the task, do not terminate it
+ void release (void);
+
+protected:
+ Task *task_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "Task_Activator.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "Task_Activator.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#endif /* TAO_PERF_RTEC_TASK_ACTIVATOR_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Task_Activator.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/Task_Activator.inl
new file mode 100644
index 00000000000..147a3e53769
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Task_Activator.inl
@@ -0,0 +1,13 @@
+/**
+ * @file Task_Activator.inl
+ *
+` * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+
+template<class Task> ACE_INLINE void
+Task_Activator<Task>::release ()
+{
+ this->task_ = 0;
+}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/rtec_perf_export.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/rtec_perf_export.h
new file mode 100644
index 00000000000..7a32929cf47
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/rtec_perf_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_RTEC_PERF_EXPORT_H
+#define TAO_RTEC_PERF_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_RTEC_PERF_HAS_DLL)
+# define TAO_RTEC_PERF_HAS_DLL 0
+# endif /* ! TAO_RTEC_PERF_HAS_DLL */
+#else
+# if !defined (TAO_RTEC_PERF_HAS_DLL)
+# define TAO_RTEC_PERF_HAS_DLL 1
+# endif /* ! TAO_RTEC_PERF_HAS_DLL */
+#endif
+
+#if defined (TAO_RTEC_PERF_HAS_DLL) && (TAO_RTEC_PERF_HAS_DLL == 1)
+# if defined (TAO_RTEC_PERF_BUILD_DLL)
+# define TAO_RTEC_Perf_Export ACE_Proper_Export_Flag
+# define TAO_RTEC_PERF_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEC_PERF_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RTEC_PERF_BUILD_DLL */
+# define TAO_RTEC_Perf_Export ACE_Proper_Import_Flag
+# define TAO_RTEC_PERF_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RTEC_PERF_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RTEC_PERF_BUILD_DLL */
+#else /* TAO_RTEC_PERF_HAS_DLL == 1 */
+# define TAO_RTEC_Perf_Export
+# define TAO_RTEC_PERF_SINGLETON_DECLARATION(T)
+# define TAO_RTEC_PERF_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RTEC_PERF_HAS_DLL == 1 */
+
+#endif /* TAO_RTEC_PERF_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/performance-tests/perf.mwc b/TAO/orbsvcs/performance-tests/perf.mwc
new file mode 100644
index 00000000000..dd297256b34
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/perf.mwc
@@ -0,0 +1,5 @@
+// -*- MPC -*-
+// $Id$
+
+workspace {
+}
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
+}